// ==UserScript== // @name Dollchan Extension Tools // @version 21.7.6.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))) { iterator = getIterator(O, iteratorMethod); next = iterator.next; result = IS_CONSTRUCTOR ? new this() : []; 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); } } result.length = index; return result; }; },{"../internals/call-with-safe-iteration-closing":73,"../internals/create-property":90,"../internals/function-bind-context":116,"../internals/function-call":118,"../internals/get-iterator":123,"../internals/get-iterator-method":122,"../internals/is-array-iterator-method":140,"../internals/is-constructor":143,"../internals/length-of-array-like":153,"../internals/to-object":214}],66:[function(require,module,exports){ 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); 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":153,"../internals/to-absolute-index":210,"../internals/to-indexed-object":211}],67:[function(require,module,exports){ var bind = require('../internals/function-bind-context'); var uncurryThis = require('../internals/function-uncurry-this'); 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 push = uncurryThis([].push); 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, specificCreate) { var O = toObject($this); var self = IndexedObject(O); var boundFunction = bind(callbackfn, that); var length = lengthOfArrayLike(self); var index = 0; var create = specificCreate || arraySpeciesCreate; var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($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) target[index] = result; else if (result) switch (TYPE) { case 3: return true; case 5: return value; case 6: return index; case 2: push(target, value); } else switch (TYPE) { case 4: return false; case 7: push(target, 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":72,"../internals/function-bind-context":116,"../internals/function-uncurry-this":120,"../internals/indexed-object":134,"../internals/length-of-array-like":153,"../internals/to-object":214}],68:[function(require,module,exports){ var fails = require('../internals/fails'); var wellKnownSymbol = require('../internals/well-known-symbol'); var V8_VERSION = require('../internals/engine-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/engine-v8-version":107,"../internals/fails":112,"../internals/well-known-symbol":225}],69:[function(require,module,exports){ var toAbsoluteIndex = require('../internals/to-absolute-index'); var lengthOfArrayLike = require('../internals/length-of-array-like'); var createProperty = require('../internals/create-property'); var $Array = Array; var max = Math.max; module.exports = function (O, start, end) { var length = lengthOfArrayLike(O); var k = toAbsoluteIndex(start, length); var fin = toAbsoluteIndex(end === undefined ? length : end, length); var result = $Array(max(fin - k, 0)); for (var n = 0; k < fin; k++, n++) createProperty(result, n, O[k]); result.length = n; return result; }; },{"../internals/create-property":90,"../internals/length-of-array-like":153,"../internals/to-absolute-index":210}],70:[function(require,module,exports){ var uncurryThis = require('../internals/function-uncurry-this'); module.exports = uncurryThis([].slice); },{"../internals/function-uncurry-this":120}],71:[function(require,module,exports){ 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":141,"../internals/is-constructor":143,"../internals/is-object":145,"../internals/well-known-symbol":225}],72:[function(require,module,exports){ var arraySpeciesConstructor = require('../internals/array-species-constructor'); module.exports = function (originalArray, length) { return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length); }; },{"../internals/array-species-constructor":71}],73:[function(require,module,exports){ 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":63,"../internals/iterator-close":150}],74:[function(require,module,exports){ 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) { if (!SKIP_CLOSING && !SAFE_CLOSING) 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":225}],75:[function(require,module,exports){ 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":120}],76:[function(require,module,exports){ 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":75,"../internals/is-callable":142,"../internals/to-string-tag-support":217,"../internals/well-known-symbol":225}],77:[function(require,module,exports){ var uncurryThis = require('../internals/function-uncurry-this'); var $Error = Error; var replace = uncurryThis(''.replace); var TEST = (function (arg) { return String($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":120}],78:[function(require,module,exports){ 'use strict'; var call = require('../internals/function-call'); var aCallable = require('../internals/a-callable'); var anObject = require('../internals/an-object'); module.exports = function addAll() { var set = anObject(this); var adder = aCallable(set.add); for (var k = 0, len = arguments.length; k < len; k++) { call(adder, set, arguments[k]); } return set; }; },{"../internals/a-callable":57,"../internals/an-object":63,"../internals/function-call":118}],79:[function(require,module,exports){ 'use strict'; var call = require('../internals/function-call'); var aCallable = require('../internals/a-callable'); var anObject = require('../internals/an-object'); module.exports = function deleteAll() { var collection = anObject(this); var remover = aCallable(collection['delete']); var allDeleted = true; var wasDeleted; for (var k = 0, len = arguments.length; k < len; k++) { wasDeleted = call(remover, collection, arguments[k]); allDeleted = allDeleted && wasDeleted; } return !!allDeleted; }; },{"../internals/a-callable":57,"../internals/an-object":63,"../internals/function-call":118}],80:[function(require,module,exports){ 'use strict'; var bind = require('../internals/function-bind-context'); var call = require('../internals/function-call'); var aCallable = require('../internals/a-callable'); var aConstructor = require('../internals/a-constructor'); var iterate = require('../internals/iterate'); var push = [].push; module.exports = function from(source ) { var length = arguments.length; var mapFn = length > 1 ? arguments[1] : undefined; var mapping, array, n, boundFunction; aConstructor(this); mapping = mapFn !== undefined; if (mapping) aCallable(mapFn); if (source == undefined) return new this(); array = []; if (mapping) { n = 0; boundFunction = bind(mapFn, length > 2 ? arguments[2] : undefined); iterate(source, function (nextItem) { call(push, array, boundFunction(nextItem, n++)); }); } else { iterate(source, push, { that: array }); } return new this(array); }; },{"../internals/a-callable":57,"../internals/a-constructor":58,"../internals/function-bind-context":116,"../internals/function-call":118,"../internals/iterate":149}],81:[function(require,module,exports){ 'use strict'; var arraySlice = require('../internals/array-slice'); module.exports = function of() { return new this(arraySlice(arguments)); }; },{"../internals/array-slice":70}],82:[function(require,module,exports){ 'use strict'; var defineProperty = require('../internals/object-define-property').f; var create = require('../internals/object-create'); var defineBuiltIns = require('../internals/define-built-ins'); var bind = require('../internals/function-bind-context'); var anInstance = require('../internals/an-instance'); var iterate = require('../internals/iterate'); var defineIterator = require('../internals/define-iterator'); 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: undefined, last: undefined, size: 0 }); if (!DESCRIPTORS) that.size = 0; if (iterable != undefined) 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: undefined, 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 data = state.index; var entry = state.first; while (entry) { entry.removed = true; if (entry.previous) entry.previous = entry.previous.next = undefined; delete data[entry.index]; entry = entry.next; } state.first = state.last = undefined; 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) defineProperty(Prototype, 'size', { 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: undefined }); }, 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 = undefined; return { value: undefined, done: true }; } if (kind == 'keys') return { value: entry.key, done: false }; if (kind == 'values') return { value: entry.value, done: false }; return { value: [entry.key, entry.value], done: false }; }, IS_MAP ? 'entries' : 'values', !IS_MAP, true); setSpecies(CONSTRUCTOR_NAME); } }; },{"../internals/an-instance":62,"../internals/define-built-ins":92,"../internals/define-iterator":94,"../internals/descriptors":96,"../internals/function-bind-context":116,"../internals/internal-metadata":138,"../internals/internal-state":139,"../internals/iterate":149,"../internals/object-create":166,"../internals/object-define-property":168,"../internals/set-species":200}],83:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var global = require('../internals/global'); 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 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 = global[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 (iterable != undefined) 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":62,"../internals/check-correctness-of-iteration":74,"../internals/define-built-in":91,"../internals/export":111,"../internals/fails":112,"../internals/function-uncurry-this":120,"../internals/global":128,"../internals/inherit-if-required":135,"../internals/internal-metadata":138,"../internals/is-callable":142,"../internals/is-forced":144,"../internals/is-object":145,"../internals/iterate":149,"../internals/set-to-string-tag":201}],84:[function(require,module,exports){ 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":129,"../internals/object-define-property":168,"../internals/object-get-own-property-descriptor":169,"../internals/own-keys":183}],85:[function(require,module,exports){ 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":225}],86:[function(require,module,exports){ 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}],87:[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":89,"../internals/iterators":152,"../internals/iterators-core":151,"../internals/object-create":166,"../internals/set-to-string-tag":201}],88:[function(require,module,exports){ 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":89,"../internals/descriptors":96,"../internals/object-define-property":168}],89:[function(require,module,exports){ module.exports = function (bitmap, value) { return { enumerable: !(bitmap & 1), configurable: !(bitmap & 2), writable: !(bitmap & 4), value: value }; }; },{}],90:[function(require,module,exports){ 'use strict'; var toPropertyKey = require('../internals/to-property-key'); var definePropertyModule = require('../internals/object-define-property'); var createPropertyDescriptor = require('../internals/create-property-descriptor'); module.exports = function (object, key, value) { var propertyKey = toPropertyKey(key); if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value)); else object[propertyKey] = value; }; },{"../internals/create-property-descriptor":89,"../internals/object-define-property":168,"../internals/to-property-key":216}],91:[function(require,module,exports){ 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 { if (!options.unsafe) delete O[key]; else if (O[key]) simple = true; 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":142,"../internals/make-built-in":154,"../internals/object-define-property":168}],92:[function(require,module,exports){ 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){ var global = require('../internals/global'); var defineProperty = Object.defineProperty; module.exports = function (key, value) { try { defineProperty(global, key, { value: value, configurable: true, writable: true }); } catch (error) { global[key] = value; } return value; }; },{"../internals/global":128}],94:[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/create-iterator-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 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-iterator-constructor":87,"../internals/create-non-enumerable-property":88,"../internals/define-built-in":91,"../internals/export":111,"../internals/function-call":118,"../internals/function-name":119,"../internals/is-callable":142,"../internals/is-pure":146,"../internals/iterators":152,"../internals/iterators-core":151,"../internals/object-get-prototype-of":173,"../internals/object-set-prototype-of":179,"../internals/set-to-string-tag":201,"../internals/well-known-symbol":225}],95:[function(require,module,exports){ 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":129,"../internals/object-define-property":168,"../internals/path":184,"../internals/well-known-symbol-wrapped":224}],96:[function(require,module,exports){ var fails = require('../internals/fails'); module.exports = !fails(function () { return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7; }); },{"../internals/fails":112}],97:[function(require,module,exports){ var global = require('../internals/global'); var isObject = require('../internals/is-object'); var document = global.document; var EXISTS = isObject(document) && isObject(document.createElement); module.exports = function (it) { return EXISTS ? document.createElement(it) : {}; }; },{"../internals/global":128,"../internals/is-object":145}],98:[function(require,module,exports){ 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; }; },{}],99:[function(require,module,exports){ 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 }; },{}],100:[function(require,module,exports){ 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":97}],101:[function(require,module,exports){ module.exports = typeof window == 'object' && typeof Deno != 'object'; },{}],102:[function(require,module,exports){ var userAgent = require('../internals/engine-user-agent'); var global = require('../internals/global'); module.exports = /ipad|iphone|ipod/i.test(userAgent) && global.Pebble !== undefined; },{"../internals/engine-user-agent":106,"../internals/global":128}],103:[function(require,module,exports){ var userAgent = require('../internals/engine-user-agent'); module.exports = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent); },{"../internals/engine-user-agent":106}],104:[function(require,module,exports){ var classof = require('../internals/classof-raw'); var global = require('../internals/global'); module.exports = classof(global.process) == 'process'; },{"../internals/classof-raw":75,"../internals/global":128}],105:[function(require,module,exports){ var userAgent = require('../internals/engine-user-agent'); module.exports = /web0s(?!.*chrome)/i.test(userAgent); },{"../internals/engine-user-agent":106}],106:[function(require,module,exports){ var getBuiltIn = require('../internals/get-built-in'); module.exports = getBuiltIn('navigator', 'userAgent') || ''; },{"../internals/get-built-in":121}],107:[function(require,module,exports){ var global = require('../internals/global'); var userAgent = require('../internals/engine-user-agent'); var process = global.process; var Deno = global.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/engine-user-agent":106,"../internals/global":128}],108:[function(require,module,exports){ var global = require('../internals/global'); var uncurryThis = require('../internals/function-uncurry-this'); module.exports = function (CONSTRUCTOR, METHOD) { return uncurryThis(global[CONSTRUCTOR].prototype[METHOD]); }; },{"../internals/function-uncurry-this":120,"../internals/global":128}],109:[function(require,module,exports){ module.exports = [ 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf' ]; },{}],110:[function(require,module,exports){ var fails = require('../internals/fails'); var createPropertyDescriptor = require('../internals/create-property-descriptor'); module.exports = !fails(function () { var error = Error('a'); if (!('stack' in error)) return true; Object.defineProperty(error, 'stack', createPropertyDescriptor(1, 7)); return error.stack !== 7; }); },{"../internals/create-property-descriptor":89,"../internals/fails":112}],111:[function(require,module,exports){ var global = require('../internals/global'); 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 = global; } else if (STATIC) { target = global[TARGET] || defineGlobalProperty(TARGET, {}); } else { target = (global[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":84,"../internals/create-non-enumerable-property":88,"../internals/define-built-in":91,"../internals/define-global-property":93,"../internals/global":128,"../internals/is-forced":144,"../internals/object-get-own-property-descriptor":169}],112:[function(require,module,exports){ module.exports = function (exec) { try { return !!exec(); } catch (error) { return true; } }; },{}],113:[function(require,module,exports){ 'use strict'; require('../modules/es.regexp.exec'); var uncurryThis = require('../internals/function-uncurry-this'); 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') { re = {}; re.constructor = {}; re.constructor[SPECIES] = function () { return re; }; re.flags = ''; re[SYMBOL] = /./[SYMBOL]; } re.exec = function () { execCalled = true; return null; }; re[SYMBOL](''); return !execCalled; }); if ( !DELEGATES_TO_SYMBOL || !DELEGATES_TO_EXEC || FORCED ) { var uncurriedNativeRegExpMethod = uncurryThis(/./[SYMBOL]); var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) { var uncurriedNativeMethod = uncurryThis(nativeMethod); var $exec = regexp.exec; if ($exec === regexpExec || $exec === RegExpPrototype.exec) { if (DELEGATES_TO_SYMBOL && !forceStringMethod) { return { done: true, value: uncurriedNativeRegExpMethod(regexp, str, arg2) }; } return { done: true, value: uncurriedNativeMethod(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":88,"../internals/define-built-in":91,"../internals/fails":112,"../internals/function-uncurry-this":120,"../internals/regexp-exec":192,"../internals/well-known-symbol":225,"../modules/es.regexp.exec":252}],114:[function(require,module,exports){ var fails = require('../internals/fails'); module.exports = !fails(function () { return Object.isExtensible(Object.preventExtensions({})); }); },{"../internals/fails":112}],115:[function(require,module,exports){ 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){ var uncurryThis = require('../internals/function-uncurry-this'); 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":120}],117:[function(require,module,exports){ 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){ 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){ 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":96,"../internals/has-own-property":129}],120:[function(require,module,exports){ var NATIVE_BIND = require('../internals/function-bind-native'); var FunctionPrototype = Function.prototype; var bind = FunctionPrototype.bind; var call = FunctionPrototype.call; var uncurryThis = NATIVE_BIND && bind.bind(call, call); module.exports = NATIVE_BIND ? function (fn) { return fn && uncurryThis(fn); } : function (fn) { return fn && function () { return call.apply(fn, arguments); }; }; },{"../internals/function-bind-native":117}],121:[function(require,module,exports){ var global = require('../internals/global'); 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(global[namespace]) : global[namespace] && global[namespace][method]; }; },{"../internals/global":128,"../internals/is-callable":142}],122:[function(require,module,exports){ var classof = require('../internals/classof'); var getMethod = require('../internals/get-method'); var Iterators = require('../internals/iterators'); var wellKnownSymbol = require('../internals/well-known-symbol'); var ITERATOR = wellKnownSymbol('iterator'); module.exports = function (it) { if (it != undefined) return getMethod(it, ITERATOR) || getMethod(it, '@@iterator') || Iterators[classof(it)]; }; },{"../internals/classof":76,"../internals/get-method":125,"../internals/iterators":152,"../internals/well-known-symbol":225}],123:[function(require,module,exports){ 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 $TypeError(tryToString(argument) + ' is not iterable'); }; },{"../internals/a-callable":57,"../internals/an-object":63,"../internals/function-call":118,"../internals/get-iterator-method":122,"../internals/try-to-string":219}],124:[function(require,module,exports){ var call = require('../internals/function-call'); module.exports = function (it) { return call(Map.prototype.entries, it); }; },{"../internals/function-call":118}],125:[function(require,module,exports){ var aCallable = require('../internals/a-callable'); module.exports = function (V, P) { var func = V[P]; return func == null ? undefined : aCallable(func); }; },{"../internals/a-callable":57}],126:[function(require,module,exports){ var call = require('../internals/function-call'); module.exports = function (it) { return call(Set.prototype.values, it); }; },{"../internals/function-call":118}],127:[function(require,module,exports){ 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":120,"../internals/to-object":214}],128:[function(require,module,exports){ (function (global){(function (){ 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) || (function () { return this; })() || Function('return this')(); }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{}],129:[function(require,module,exports){ 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":120,"../internals/to-object":214}],130:[function(require,module,exports){ module.exports = {}; },{}],131:[function(require,module,exports){ var global = require('../internals/global'); module.exports = function (a, b) { var console = global.console; if (console && console.error) { arguments.length == 1 ? console.error(a) : console.error(a, b); } }; },{"../internals/global":128}],132:[function(require,module,exports){ var getBuiltIn = require('../internals/get-built-in'); module.exports = getBuiltIn('document', 'documentElement'); },{"../internals/get-built-in":121}],133:[function(require,module,exports){ 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":96,"../internals/document-create-element":97,"../internals/fails":112}],134:[function(require,module,exports){ 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":75,"../internals/fails":112,"../internals/function-uncurry-this":120}],135:[function(require,module,exports){ 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":142,"../internals/is-object":145,"../internals/object-set-prototype-of":179}],136:[function(require,module,exports){ 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":120,"../internals/is-callable":142,"../internals/shared-store":203}],137:[function(require,module,exports){ 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":88,"../internals/is-object":145}],138:[function(require,module,exports){ 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":120,"../internals/has-own-property":129,"../internals/hidden-keys":130,"../internals/is-object":145,"../internals/object-define-property":168,"../internals/object-get-own-property-names":171,"../internals/object-get-own-property-names-external":170,"../internals/object-is-extensible":174,"../internals/uid":220}],139:[function(require,module,exports){ var NATIVE_WEAK_MAP = require('../internals/native-weak-map'); var global = require('../internals/global'); var uncurryThis = require('../internals/function-uncurry-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 = global.TypeError; var WeakMap = global.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 TypeError('Incompatible receiver, ' + TYPE + ' required'); } return state; }; }; if (NATIVE_WEAK_MAP || shared.state) { var store = shared.state || (shared.state = new WeakMap()); var wmget = uncurryThis(store.get); var wmhas = uncurryThis(store.has); var wmset = uncurryThis(store.set); set = function (it, metadata) { if (wmhas(store, it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED); metadata.facade = it; wmset(store, it, metadata); return metadata; }; get = function (it) { return wmget(store, it) || {}; }; has = function (it) { return wmhas(store, 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":88,"../internals/function-uncurry-this":120,"../internals/global":128,"../internals/has-own-property":129,"../internals/hidden-keys":130,"../internals/is-object":145,"../internals/native-weak-map":161,"../internals/shared-key":202,"../internals/shared-store":203}],140:[function(require,module,exports){ 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":152,"../internals/well-known-symbol":225}],141:[function(require,module,exports){ var classof = require('../internals/classof-raw'); module.exports = Array.isArray || function isArray(argument) { return classof(argument) == 'Array'; }; },{"../internals/classof-raw":75}],142:[function(require,module,exports){ module.exports = function (argument) { return typeof argument == 'function'; }; },{}],143:[function(require,module,exports){ 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 empty = []; var construct = getBuiltIn('Reflect', 'construct'); var constructorRegExp = /^\s*(?:class|function)\b/; var exec = uncurryThis(constructorRegExp.exec); var INCORRECT_TO_STRING = !constructorRegExp.exec(noop); var isConstructorModern = function isConstructor(argument) { if (!isCallable(argument)) return false; try { construct(noop, empty, 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":76,"../internals/fails":112,"../internals/function-uncurry-this":120,"../internals/get-built-in":121,"../internals/inspect-source":136,"../internals/is-callable":142}],144:[function(require,module,exports){ 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":142}],145:[function(require,module,exports){ var isCallable = require('../internals/is-callable'); module.exports = function (it) { return typeof it == 'object' ? it !== null : isCallable(it); }; },{"../internals/is-callable":142}],146:[function(require,module,exports){ module.exports = false; },{}],147:[function(require,module,exports){ 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":75,"../internals/is-object":145,"../internals/well-known-symbol":225}],148:[function(require,module,exports){ 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":121,"../internals/is-callable":142,"../internals/object-is-prototype-of":175,"../internals/use-symbol-as-uid":221}],149:[function(require,module,exports){ 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_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', condition); 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_ITERATOR) { iterator = iterable; } else { iterFn = getIteratorMethod(iterable); if (!iterFn) throw $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 = 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":63,"../internals/function-bind-context":116,"../internals/function-call":118,"../internals/get-iterator":123,"../internals/get-iterator-method":122,"../internals/is-array-iterator-method":140,"../internals/iterator-close":150,"../internals/length-of-array-like":153,"../internals/object-is-prototype-of":175,"../internals/try-to-string":219}],150:[function(require,module,exports){ 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":63,"../internals/function-call":118,"../internals/get-method":125}],151:[function(require,module,exports){ 'use strict'; var fails = require('../internals/fails'); var isCallable = require('../internals/is-callable'); 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 = IteratorPrototype == undefined || 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":142,"../internals/is-pure":146,"../internals/object-create":166,"../internals/object-get-prototype-of":173,"../internals/well-known-symbol":225}],152:[function(require,module,exports){ arguments[4][130][0].apply(exports,arguments) },{"dup":130}],153:[function(require,module,exports){ var toLength = require('../internals/to-length'); module.exports = function (obj) { return toLength(obj.length); }; },{"../internals/to-length":213}],154:[function(require,module,exports){ 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 defineProperty = Object.defineProperty; 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 (String(name).slice(0, 7) === 'Symbol(') { name = '[' + String(name).replace(/^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)) { defineProperty(value, 'name', { value: name, configurable: true }); } 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 = TEMPLATE.join(typeof name == 'string' ? name : ''); } return value; }; Function.prototype.toString = makeBuiltIn(function toString() { return isCallable(this) && getInternalState(this).source || inspectSource(this); }, 'toString'); },{"../internals/descriptors":96,"../internals/fails":112,"../internals/function-name":119,"../internals/has-own-property":129,"../internals/inspect-source":136,"../internals/internal-state":139,"../internals/is-callable":142}],155:[function(require,module,exports){ 'use strict'; var call = require('../internals/function-call'); var aCallable = require('../internals/a-callable'); var anObject = require('../internals/an-object'); module.exports = function emplace(key, handler) { var map = anObject(this); var get = aCallable(map.get); var has = aCallable(map.has); var set = aCallable(map.set); var value = (call(has, map, key) && 'update' in handler) ? handler.update(call(get, map, key), key, map) : handler.insert(key, map); call(set, map, key, value); return value; }; },{"../internals/a-callable":57,"../internals/an-object":63,"../internals/function-call":118}],156:[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 $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":63,"../internals/function-call":118,"../internals/is-callable":142}],157:[function(require,module,exports){ var ceil = Math.ceil; var floor = Math.floor; module.exports = Math.trunc || function trunc(x) { var n = +x; return (n > 0 ? floor : ceil)(n); }; },{}],158:[function(require,module,exports){ var global = require('../internals/global'); var bind = require('../internals/function-bind-context'); var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f; var macrotask = require('../internals/task').set; var IS_IOS = require('../internals/engine-is-ios'); var IS_IOS_PEBBLE = require('../internals/engine-is-ios-pebble'); var IS_WEBOS_WEBKIT = require('../internals/engine-is-webos-webkit'); var IS_NODE = require('../internals/engine-is-node'); var MutationObserver = global.MutationObserver || global.WebKitMutationObserver; var document = global.document; var process = global.process; var Promise = global.Promise; var queueMicrotaskDescriptor = getOwnPropertyDescriptor(global, 'queueMicrotask'); var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value; var flush, head, last, notify, toggle, node, promise, then; if (!queueMicrotask) { flush = function () { var parent, fn; if (IS_NODE && (parent = process.domain)) parent.exit(); while (head) { fn = head.fn; head = head.next; try { fn(); } catch (error) { if (head) notify(); else last = undefined; throw error; } } last = undefined; 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, global); notify = function () { macrotask(flush); }; } } module.exports = queueMicrotask || function (fn) { var task = { fn: fn, next: undefined }; if (last) last.next = task; if (!head) { head = task; notify(); } last = task; }; },{"../internals/engine-is-ios":103,"../internals/engine-is-ios-pebble":102,"../internals/engine-is-node":104,"../internals/engine-is-webos-webkit":105,"../internals/function-bind-context":116,"../internals/global":128,"../internals/object-get-own-property-descriptor":169,"../internals/task":209}],159:[function(require,module,exports){ var NATIVE_SYMBOL = require('../internals/native-symbol'); module.exports = NATIVE_SYMBOL && !!Symbol['for'] && !!Symbol.keyFor; },{"../internals/native-symbol":160}],160:[function(require,module,exports){ var V8_VERSION = require('../internals/engine-v8-version'); var fails = require('../internals/fails'); module.exports = !!Object.getOwnPropertySymbols && !fails(function () { var symbol = Symbol(); return !String(symbol) || !(Object(symbol) instanceof Symbol) || !Symbol.sham && V8_VERSION && V8_VERSION < 41; }); },{"../internals/engine-v8-version":107,"../internals/fails":112}],161:[function(require,module,exports){ var global = require('../internals/global'); var isCallable = require('../internals/is-callable'); var inspectSource = require('../internals/inspect-source'); var WeakMap = global.WeakMap; module.exports = isCallable(WeakMap) && /native code/.test(inspectSource(WeakMap)); },{"../internals/global":128,"../internals/inspect-source":136,"../internals/is-callable":142}],162:[function(require,module,exports){ 'use strict'; var aCallable = require('../internals/a-callable'); var PromiseCapability = function (C) { var resolve, reject; this.promise = new C(function ($$resolve, $$reject) { if (resolve !== undefined || reject !== undefined) throw 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}],163:[function(require,module,exports){ var toString = require('../internals/to-string'); module.exports = function (argument, $default) { return argument === undefined ? arguments.length < 2 ? '' : $default : toString(argument); }; },{"../internals/to-string":218}],164:[function(require,module,exports){ var isRegExp = require('../internals/is-regexp'); var $TypeError = TypeError; module.exports = function (it) { if (isRegExp(it)) { throw $TypeError("The method doesn't accept regular expressions"); } return it; }; },{"../internals/is-regexp":147}],165:[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(); 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":96,"../internals/fails":112,"../internals/function-call":118,"../internals/function-uncurry-this":120,"../internals/indexed-object":134,"../internals/object-get-own-property-symbols":172,"../internals/object-keys":177,"../internals/object-property-is-enumerable":178,"../internals/to-object":214}],166:[function(require,module,exports){ 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":63,"../internals/document-create-element":97,"../internals/enum-bug-keys":109,"../internals/hidden-keys":130,"../internals/html":132,"../internals/object-define-properties":167,"../internals/shared-key":202}],167:[function(require,module,exports){ 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":63,"../internals/descriptors":96,"../internals/object-define-property":168,"../internals/object-keys":177,"../internals/to-indexed-object":211,"../internals/v8-prototype-define-bug":222}],168:[function(require,module,exports){ 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 $TypeError('Accessors not supported'); if ('value' in Attributes) O[P] = Attributes.value; return O; }; },{"../internals/an-object":63,"../internals/descriptors":96,"../internals/ie8-dom-define":133,"../internals/to-property-key":216,"../internals/v8-prototype-define-bug":222}],169:[function(require,module,exports){ 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":89,"../internals/descriptors":96,"../internals/function-call":118,"../internals/has-own-property":129,"../internals/ie8-dom-define":133,"../internals/object-property-is-enumerable":178,"../internals/to-indexed-object":211,"../internals/to-property-key":216}],170:[function(require,module,exports){ 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-simple'); 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-simple":69,"../internals/classof-raw":75,"../internals/object-get-own-property-names":171,"../internals/to-indexed-object":211}],171:[function(require,module,exports){ 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":109,"../internals/object-keys-internal":176}],172:[function(require,module,exports){ exports.f = Object.getOwnPropertySymbols; },{}],173:[function(require,module,exports){ 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":86,"../internals/has-own-property":129,"../internals/is-callable":142,"../internals/shared-key":202,"../internals/to-object":214}],174:[function(require,module,exports){ 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":64,"../internals/classof-raw":75,"../internals/fails":112,"../internals/is-object":145}],175:[function(require,module,exports){ var uncurryThis = require('../internals/function-uncurry-this'); module.exports = uncurryThis({}.isPrototypeOf); },{"../internals/function-uncurry-this":120}],176:[function(require,module,exports){ 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":66,"../internals/function-uncurry-this":120,"../internals/has-own-property":129,"../internals/hidden-keys":130,"../internals/to-indexed-object":211}],177:[function(require,module,exports){ 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":109,"../internals/object-keys-internal":176}],178:[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; },{}],179:[function(require,module,exports){ var uncurryThis = require('../internals/function-uncurry-this'); var anObject = require('../internals/an-object'); var aPossiblePrototype = require('../internals/a-possible-prototype'); module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () { var CORRECT_SETTER = false; var test = {}; var setter; try { setter = uncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set); setter(test, []); CORRECT_SETTER = test instanceof Array; } catch (error) { } return function setPrototypeOf(O, proto) { anObject(O); aPossiblePrototype(proto); if (CORRECT_SETTER) setter(O, proto); else O.__proto__ = proto; return O; }; }() : undefined); },{"../internals/a-possible-prototype":59,"../internals/an-object":63,"../internals/function-uncurry-this":120}],180:[function(require,module,exports){ var DESCRIPTORS = require('../internals/descriptors'); var uncurryThis = require('../internals/function-uncurry-this'); 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 createMethod = function (TO_ENTRIES) { return function (it) { var O = toIndexedObject(it); var keys = objectKeys(O); var length = keys.length; var i = 0; var result = []; var key; while (length > i) { key = keys[i++]; if (!DESCRIPTORS || propertyIsEnumerable(O, key)) { push(result, TO_ENTRIES ? [key, O[key]] : O[key]); } } return result; }; }; module.exports = { entries: createMethod(true), values: createMethod(false) }; },{"../internals/descriptors":96,"../internals/function-uncurry-this":120,"../internals/object-keys":177,"../internals/object-property-is-enumerable":178,"../internals/to-indexed-object":211}],181:[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":76,"../internals/to-string-tag-support":217}],182:[function(require,module,exports){ 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 $TypeError("Can't convert object to primitive value"); }; },{"../internals/function-call":118,"../internals/is-callable":142,"../internals/is-object":145}],183:[function(require,module,exports){ 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":63,"../internals/function-uncurry-this":120,"../internals/get-built-in":121,"../internals/object-get-own-property-names":171,"../internals/object-get-own-property-symbols":172}],184:[function(require,module,exports){ var global = require('../internals/global'); module.exports = global; },{"../internals/global":128}],185:[function(require,module,exports){ module.exports = function (exec) { try { return { error: false, value: exec() }; } catch (error) { return { error: true, value: error }; } }; },{}],186:[function(require,module,exports){ var global = require('../internals/global'); 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 IS_BROWSER = require('../internals/engine-is-browser'); var IS_PURE = require('../internals/is-pure'); var V8_VERSION = require('../internals/engine-v8-version'); var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype; var SPECIES = wellKnownSymbol('species'); var SUBCLASSING = false; var NATIVE_PROMISE_REJECTION_EVENT = isCallable(global.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 >= 51 && /native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) return false; 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 && IS_BROWSER && !NATIVE_PROMISE_REJECTION_EVENT; }); module.exports = { CONSTRUCTOR: FORCED_PROMISE_CONSTRUCTOR, REJECTION_EVENT: NATIVE_PROMISE_REJECTION_EVENT, SUBCLASSING: SUBCLASSING }; },{"../internals/engine-is-browser":101,"../internals/engine-v8-version":107,"../internals/global":128,"../internals/inspect-source":136,"../internals/is-callable":142,"../internals/is-forced":144,"../internals/is-pure":146,"../internals/promise-native-constructor":187,"../internals/well-known-symbol":225}],187:[function(require,module,exports){ var global = require('../internals/global'); module.exports = global.Promise; },{"../internals/global":128}],188:[function(require,module,exports){ 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":63,"../internals/is-object":145,"../internals/new-promise-capability":162}],189:[function(require,module,exports){ 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":74,"../internals/promise-constructor-detection":186,"../internals/promise-native-constructor":187}],190:[function(require,module,exports){ var Queue = function () { this.head = null; this.tail = null; }; Queue.prototype = { add: function (item) { var entry = { item: item, next: null }; if (this.head) this.tail.next = entry; else this.head = entry; this.tail = entry; }, get: function () { var entry = this.head; if (entry) { this.head = entry.next; if (this.tail === entry) this.tail = null; return entry.item; } } }; module.exports = Queue; },{}],191:[function(require,module,exports){ 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 $TypeError('RegExp#exec called on incompatible receiver'); }; },{"../internals/an-object":63,"../internals/classof-raw":75,"../internals/function-call":118,"../internals/is-callable":142,"../internals/regexp-exec":192}],192:[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":120,"../internals/internal-state":139,"../internals/object-create":166,"../internals/regexp-flags":193,"../internals/regexp-sticky-helpers":195,"../internals/regexp-unsupported-dot-all":196,"../internals/regexp-unsupported-ncg":197,"../internals/shared":204,"../internals/to-string":218}],193:[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":63}],194:[function(require,module,exports){ var call = require('../internals/function-call'); var hasOwn = require('../internals/has-own-property'); var isPrototypeOf = require('../internals/object-is-prototype-of'); var regExpFlags = require('../internals/regexp-flags'); var RegExpPrototype = RegExp.prototype; module.exports = function (R) { var flags = R.flags; return flags === undefined && !('flags' in RegExpPrototype) && !hasOwn(R, 'flags') && isPrototypeOf(RegExpPrototype, R) ? call(regExpFlags, R) : flags; }; },{"../internals/function-call":118,"../internals/has-own-property":129,"../internals/object-is-prototype-of":175,"../internals/regexp-flags":193}],195:[function(require,module,exports){ var fails = require('../internals/fails'); var global = require('../internals/global'); var $RegExp = global.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":128}],196:[function(require,module,exports){ var fails = require('../internals/fails'); var global = require('../internals/global'); var $RegExp = global.RegExp; module.exports = fails(function () { var re = $RegExp('.', 's'); return !(re.dotAll && re.exec('\n') && re.flags === 's'); }); },{"../internals/fails":112,"../internals/global":128}],197:[function(require,module,exports){ var fails = require('../internals/fails'); var global = require('../internals/global'); var $RegExp = global.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":128}],198:[function(require,module,exports){ var $TypeError = TypeError; module.exports = function (it) { if (it == undefined) throw $TypeError("Can't call method on " + it); return it; }; },{}],199:[function(require,module,exports){ module.exports = function (x, y) { return x === y || x != x && y != y; }; },{}],200:[function(require,module,exports){ 'use strict'; var getBuiltIn = require('../internals/get-built-in'); var definePropertyModule = require('../internals/object-define-property'); 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); var defineProperty = definePropertyModule.f; if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) { defineProperty(Constructor, SPECIES, { configurable: true, get: function () { return this; } }); } }; },{"../internals/descriptors":96,"../internals/get-built-in":121,"../internals/object-define-property":168,"../internals/well-known-symbol":225}],201:[function(require,module,exports){ 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":129,"../internals/object-define-property":168,"../internals/well-known-symbol":225}],202:[function(require,module,exports){ 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":204,"../internals/uid":220}],203:[function(require,module,exports){ var global = require('../internals/global'); var defineGlobalProperty = require('../internals/define-global-property'); var SHARED = '__core-js_shared__'; var store = global[SHARED] || defineGlobalProperty(SHARED, {}); module.exports = store; },{"../internals/define-global-property":93,"../internals/global":128}],204:[function(require,module,exports){ var IS_PURE = require('../internals/is-pure'); var store = require('../internals/shared-store'); (module.exports = function (key, value) { return store[key] || (store[key] = value !== undefined ? value : {}); })('versions', []).push({ version: '3.23.1', mode: IS_PURE ? 'pure' : 'global', copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)', license: 'https://github.com/zloirock/core-js/blob/v3.23.1/LICENSE', source: 'https://github.com/zloirock/core-js' }); },{"../internals/is-pure":146,"../internals/shared-store":203}],205:[function(require,module,exports){ var anObject = require('../internals/an-object'); var aConstructor = require('../internals/a-constructor'); 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 || (S = anObject(C)[SPECIES]) == undefined ? defaultConstructor : aConstructor(S); }; },{"../internals/a-constructor":58,"../internals/an-object":63,"../internals/well-known-symbol":225}],206:[function(require,module,exports){ 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":120,"../internals/require-object-coercible":198,"../internals/to-integer-or-infinity":212,"../internals/to-string":218}],207:[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 $RangeError('Wrong number of repetitions'); for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) result += str; return result; }; },{"../internals/require-object-coercible":198,"../internals/to-integer-or-infinity":212,"../internals/to-string":218}],208:[function(require,module,exports){ 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":121,"../internals/well-known-symbol":225}],209:[function(require,module,exports){ var global = require('../internals/global'); 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/engine-is-ios'); var IS_NODE = require('../internals/engine-is-node'); var set = global.setImmediate; var clear = global.clearImmediate; var process = global.process; var Dispatch = global.Dispatch; var Function = global.Function; var MessageChannel = global.MessageChannel; var String = global.String; var counter = 0; var queue = {}; var ONREADYSTATECHANGE = 'onreadystatechange'; var location, defer, channel, port; try { location = global.location; } catch (error) { } 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 listener = function (event) { run(event.data); }; var post = function (id) { global.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 = listener; defer = bind(port.postMessage, port); } else if ( global.addEventListener && isCallable(global.postMessage) && !global.importScripts && location && location.protocol !== 'file:' && !fails(post) ) { defer = post; global.addEventListener('message', listener, 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":70,"../internals/document-create-element":97,"../internals/engine-is-ios":103,"../internals/engine-is-node":104,"../internals/fails":112,"../internals/function-apply":115,"../internals/function-bind-context":116,"../internals/global":128,"../internals/has-own-property":129,"../internals/html":132,"../internals/is-callable":142,"../internals/validate-arguments-length":223}],210:[function(require,module,exports){ 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":212}],211:[function(require,module,exports){ var IndexedObject = require('../internals/indexed-object'); var requireObjectCoercible = require('../internals/require-object-coercible'); module.exports = function (it) { return IndexedObject(requireObjectCoercible(it)); }; },{"../internals/indexed-object":134,"../internals/require-object-coercible":198}],212:[function(require,module,exports){ var trunc = require('../internals/math-trunc'); module.exports = function (argument) { var number = +argument; return number !== number || number === 0 ? 0 : trunc(number); }; },{"../internals/math-trunc":157}],213:[function(require,module,exports){ var toIntegerOrInfinity = require('../internals/to-integer-or-infinity'); var min = Math.min; module.exports = function (argument) { return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; }; },{"../internals/to-integer-or-infinity":212}],214:[function(require,module,exports){ var requireObjectCoercible = require('../internals/require-object-coercible'); var $Object = Object; module.exports = function (argument) { return $Object(requireObjectCoercible(argument)); }; },{"../internals/require-object-coercible":198}],215:[function(require,module,exports){ 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 $TypeError("Can't convert object to primitive value"); } if (pref === undefined) pref = 'number'; return ordinaryToPrimitive(input, pref); }; },{"../internals/function-call":118,"../internals/get-method":125,"../internals/is-object":145,"../internals/is-symbol":148,"../internals/ordinary-to-primitive":182,"../internals/well-known-symbol":225}],216:[function(require,module,exports){ 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":148,"../internals/to-primitive":215}],217:[function(require,module,exports){ 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":225}],218:[function(require,module,exports){ var classof = require('../internals/classof'); var $String = String; module.exports = function (argument) { if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string'); return $String(argument); }; },{"../internals/classof":76}],219:[function(require,module,exports){ var $String = String; module.exports = function (argument) { try { return $String(argument); } catch (error) { return 'Object'; } }; },{}],220:[function(require,module,exports){ var uncurryThis = require('../internals/function-uncurry-this'); var id = 0; var postfix = Math.random(); var toString = uncurryThis(1.0.toString); module.exports = function (key) { return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36); }; },{"../internals/function-uncurry-this":120}],221:[function(require,module,exports){ var NATIVE_SYMBOL = require('../internals/native-symbol'); module.exports = NATIVE_SYMBOL && !Symbol.sham && typeof Symbol.iterator == 'symbol'; },{"../internals/native-symbol":160}],222:[function(require,module,exports){ 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":96,"../internals/fails":112}],223:[function(require,module,exports){ var $TypeError = TypeError; module.exports = function (passed, required) { if (passed < required) throw $TypeError('Not enough arguments'); return passed; }; },{}],224:[function(require,module,exports){ var wellKnownSymbol = require('../internals/well-known-symbol'); exports.f = wellKnownSymbol; },{"../internals/well-known-symbol":225}],225:[function(require,module,exports){ var global = require('../internals/global'); var shared = require('../internals/shared'); var hasOwn = require('../internals/has-own-property'); var uid = require('../internals/uid'); var NATIVE_SYMBOL = require('../internals/native-symbol'); var USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid'); var WellKnownSymbolsStore = shared('wks'); var Symbol = global.Symbol; var symbolFor = Symbol && Symbol['for']; var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid; module.exports = function (name) { if (!hasOwn(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) { var description = 'Symbol.' + name; if (NATIVE_SYMBOL && hasOwn(Symbol, name)) { WellKnownSymbolsStore[name] = Symbol[name]; } else if (USE_SYMBOL_AS_UID && symbolFor) { WellKnownSymbolsStore[name] = symbolFor(description); } else { WellKnownSymbolsStore[name] = createWellKnownSymbol(description); } } return WellKnownSymbolsStore[name]; }; },{"../internals/global":128,"../internals/has-own-property":129,"../internals/native-symbol":160,"../internals/shared":204,"../internals/uid":220,"../internals/use-symbol-as-uid":221}],226:[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 clearErrorStack = require('../internals/clear-error-stack'); var installErrorCause = require('../internals/install-error-cause'); var iterate = require('../internals/iterate'); var normalizeStringArgument = require('../internals/normalize-string-argument'); var wellKnownSymbol = require('../internals/well-known-symbol'); var ERROR_STACK_INSTALLABLE = require('../internals/error-stack-installable'); var TO_STRING_TAG = wellKnownSymbol('toStringTag'); var $Error = Error; var push = [].push; var $AggregateError = function AggregateError(errors, message ) { var options = arguments.length > 2 ? arguments[2] : undefined; 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)); if (ERROR_STACK_INSTALLABLE) createNonEnumerableProperty(that, 'stack', clearErrorStack(that.stack, 1)); installErrorCause(that, options); 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/clear-error-stack":77,"../internals/copy-constructor-properties":84,"../internals/create-non-enumerable-property":88,"../internals/create-property-descriptor":89,"../internals/error-stack-installable":110,"../internals/export":111,"../internals/install-error-cause":137,"../internals/iterate":149,"../internals/normalize-string-argument":163,"../internals/object-create":166,"../internals/object-get-prototype-of":173,"../internals/object-is-prototype-of":175,"../internals/object-set-prototype-of":179,"../internals/well-known-symbol":225}],227:[function(require,module,exports){ require('../modules/es.aggregate-error.constructor'); },{"../modules/es.aggregate-error.constructor":226}],228:[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 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/engine-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 SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat'); 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 || !SPECIES_SUPPORT; $({ 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); } } A.length = n; return A; } }); },{"../internals/array-method-has-species-support":68,"../internals/array-species-create":72,"../internals/create-property":90,"../internals/does-not-exceed-safe-integer":98,"../internals/engine-v8-version":107,"../internals/export":111,"../internals/fails":112,"../internals/is-array":141,"../internals/is-object":145,"../internals/length-of-array-like":153,"../internals/to-object":214,"../internals/well-known-symbol":225}],229:[function(require,module,exports){ 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":65,"../internals/check-correctness-of-iteration":74,"../internals/export":111}],230:[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/define-iterator'); 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 kind = state.kind; var index = state.index++; if (!target || index >= target.length) { state.target = undefined; return { value: undefined, done: true }; } if (kind == 'keys') return { value: index, done: false }; if (kind == 'values') return { value: target[index], done: false }; return { value: [index, target[index]], done: 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":60,"../internals/define-iterator":94,"../internals/descriptors":96,"../internals/internal-state":139,"../internals/is-pure":146,"../internals/iterators":152,"../internals/object-define-property":168,"../internals/to-indexed-object":211}],231:[function(require,module,exports){ 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 isObject = require('../internals/is-object'); var isSymbol = require('../internals/is-symbol'); var arraySlice = require('../internals/array-slice'); var NATIVE_SYMBOL = require('../internals/native-symbol'); var $stringify = getBuiltIn('JSON', 'stringify'); var exec = uncurryThis(/./.exec); var charAt = uncurryThis(''.charAt); var charCodeAt = uncurryThis(''.charCodeAt); var replace = uncurryThis(''.replace); var numberToString = uncurryThis(1.0.toString); var tester = /[\uD800-\uDFFF]/g; var low = /^[\uD800-\uDBFF]$/; var hi = /^[\uDC00-\uDFFF]$/; var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL || fails(function () { var symbol = getBuiltIn('Symbol')(); 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 stringifyWithSymbolsFix = function (it, replacer) { var args = arraySlice(arguments); var $replacer = replacer; if (!isObject(replacer) && it === undefined || isSymbol(it)) return; if (!isArray(replacer)) replacer = function (key, value) { if (isCallable($replacer)) value = call($replacer, this, key, value); if (!isSymbol(value)) return value; }; args[1] = replacer; return apply($stringify, null, args); }; var fixIllFormed = function (match, offset, string) { var prev = charAt(string, offset - 1); var next = charAt(string, offset + 1); if ((exec(low, match) && !exec(hi, next)) || (exec(hi, match) && !exec(low, prev))) { return '\\u' + numberToString(charCodeAt(match, 0), 16); } return match; }; if ($stringify) { $({ target: 'JSON', stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE }, { stringify: function stringify(it, replacer, space) { var args = arraySlice(arguments); var result = apply(WRONG_SYMBOLS_CONVERSION ? stringifyWithSymbolsFix : $stringify, null, args); return ILL_FORMED_UNICODE && typeof result == 'string' ? replace(result, tester, fixIllFormed) : result; } }); } },{"../internals/array-slice":70,"../internals/export":111,"../internals/fails":112,"../internals/function-apply":115,"../internals/function-call":118,"../internals/function-uncurry-this":120,"../internals/get-built-in":121,"../internals/is-array":141,"../internals/is-callable":142,"../internals/is-object":145,"../internals/is-symbol":148,"../internals/native-symbol":160}],232:[function(require,module,exports){ var global = require('../internals/global'); var setToStringTag = require('../internals/set-to-string-tag'); setToStringTag(global.JSON, 'JSON', true); },{"../internals/global":128,"../internals/set-to-string-tag":201}],233:[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":83,"../internals/collection-strong":82}],234:[function(require,module,exports){ require('../modules/es.map.constructor'); },{"../modules/es.map.constructor":233}],235:[function(require,module,exports){ 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}],236:[function(require,module,exports){ var setToStringTag = require('../internals/set-to-string-tag'); setToStringTag(Math, 'Math', true); },{"../internals/set-to-string-tag":201}],237:[function(require,module,exports){ 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":165}],238:[function(require,module,exports){ 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":180}],239:[function(require,module,exports){ var $ = require('../internals/export'); var NATIVE_SYMBOL = require('../internals/native-symbol'); 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/native-symbol":160,"../internals/object-get-own-property-symbols":172,"../internals/to-object":214}],240:[function(require,module,exports){ 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":181,"../internals/to-string-tag-support":217}],241:[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'); $({ target: 'Promise', stat: true }, { 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":149,"../internals/new-promise-capability":162,"../internals/perform":185}],242:[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":149,"../internals/new-promise-capability":162,"../internals/perform":185,"../internals/promise-statics-incorrect-iteration":189}],243:[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_ANY_ERROR = 'No one promise resolved'; $({ target: 'Promise', stat: true }, { 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":121,"../internals/iterate":149,"../internals/new-promise-capability":162,"../internals/perform":185}],244:[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":121,"../internals/is-callable":142,"../internals/is-pure":146,"../internals/promise-constructor-detection":186,"../internals/promise-native-constructor":187}],245:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var IS_PURE = require('../internals/is-pure'); var IS_NODE = require('../internals/engine-is-node'); var global = require('../internals/global'); 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 = global.TypeError; var document = global.document; var process = global.process; var newPromiseCapability = newPromiseCapabilityModule.f; var newGenericPromiseCapability = newPromiseCapability; var DISPATCH_EVENT = !!(document && document.createEvent && global.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(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); global.dispatchEvent(event); } else event = { promise: promise, reason: reason }; if (!NATIVE_PROMISE_REJECTION_EVENT && (handler = global['on' + name])) handler(event); else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason); }; var onUnhandled = function (state) { call(task, global, 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, global, 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 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: undefined }); }; 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 }); setToStringTag(PromiseConstructor, PROMISE, false, true); setSpecies(PROMISE); },{"../internals/a-callable":57,"../internals/an-instance":62,"../internals/define-built-in":91,"../internals/engine-is-node":104,"../internals/export":111,"../internals/function-call":118,"../internals/global":128,"../internals/host-report-errors":131,"../internals/internal-state":139,"../internals/is-callable":142,"../internals/is-object":145,"../internals/is-pure":146,"../internals/microtask":158,"../internals/new-promise-capability":162,"../internals/object-set-prototype-of":179,"../internals/perform":185,"../internals/promise-constructor-detection":186,"../internals/promise-native-constructor":187,"../internals/queue":190,"../internals/set-species":200,"../internals/set-to-string-tag":201,"../internals/species-constructor":205,"../internals/task":209}],246:[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":121,"../internals/is-callable":142,"../internals/is-pure":146,"../internals/promise-native-constructor":187,"../internals/promise-resolve":188,"../internals/species-constructor":205}],247:[function(require,module,exports){ 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":242,"../modules/es.promise.catch":244,"../modules/es.promise.constructor":245,"../modules/es.promise.race":248,"../modules/es.promise.reject":249,"../modules/es.promise.resolve":250}],248:[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":149,"../internals/new-promise-capability":162,"../internals/perform":185,"../internals/promise-statics-incorrect-iteration":189}],249:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var call = require('../internals/function-call'); 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); call(capability.reject, undefined, r); return capability.promise; } }); },{"../internals/export":111,"../internals/function-call":118,"../internals/new-promise-capability":162,"../internals/promise-constructor-detection":186}],250:[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":121,"../internals/is-pure":146,"../internals/promise-constructor-detection":186,"../internals/promise-native-constructor":187,"../internals/promise-resolve":188}],251:[function(require,module,exports){ var $ = require('../internals/export'); var global = require('../internals/global'); var setToStringTag = require('../internals/set-to-string-tag'); $({ global: true }, { Reflect: {} }); setToStringTag(global.Reflect, 'Reflect', true); },{"../internals/export":111,"../internals/global":128,"../internals/set-to-string-tag":201}],252:[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":192}],253:[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":83,"../internals/collection-strong":82}],254:[function(require,module,exports){ require('../modules/es.set.constructor'); },{"../modules/es.set.constructor":253}],255:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var uncurryThis = require('../internals/function-uncurry-this'); 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 un$EndsWith = uncurryThis(''.endsWith); 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 un$EndsWith ? un$EndsWith(that, search, end) : slice(that, end - search.length, end) === search; } }); },{"../internals/correct-is-regexp-logic":85,"../internals/export":111,"../internals/function-uncurry-this":120,"../internals/is-pure":146,"../internals/not-a-regexp":164,"../internals/object-get-own-property-descriptor":169,"../internals/require-object-coercible":198,"../internals/to-length":213,"../internals/to-string":218}],256:[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":85,"../internals/export":111,"../internals/function-uncurry-this":120,"../internals/not-a-regexp":164,"../internals/require-object-coercible":198,"../internals/to-string":218}],257:[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/define-iterator'); 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 { value: undefined, done: true }; point = charAt(string, index); state.index += point.length; return { value: point, done: false }; }); },{"../internals/define-iterator":94,"../internals/internal-state":139,"../internals/string-multibyte":206,"../internals/to-string":218}],258:[function(require,module,exports){ var $ = require('../internals/export'); var repeat = require('../internals/string-repeat'); $({ target: 'String', proto: true }, { repeat: repeat }); },{"../internals/export":111,"../internals/string-repeat":207}],259:[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 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; var stringIndexOf = function (string, searchValue, fromIndex) { if (fromIndex > string.length) return -1; if (searchValue === '') return fromIndex; return indexOf(string, searchValue, fromIndex); }; $({ target: 'String', proto: true }, { replaceAll: function replaceAll(searchValue, replaceValue) { var O = requireObjectCoercible(this); var IS_REG_EXP, flags, replacer, string, searchString, functionalReplace, searchLength, advanceBy, replacement; var position = 0; var endOfLastMatch = 0; var result = ''; if (searchValue != null) { IS_REG_EXP = isRegExp(searchValue); if (IS_REG_EXP) { flags = toString(requireObjectCoercible(getRegExpFlags(searchValue))); if (!~indexOf(flags, 'g')) throw $TypeError('`.replaceAll` does not allow non-global regexes'); } replacer = getMethod(searchValue, REPLACE); if (replacer) { return call(replacer, searchValue, O, replaceValue); } else 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 = stringIndexOf(string, searchString, 0); 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 = stringIndexOf(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":120,"../internals/get-method":125,"../internals/get-substitution":127,"../internals/is-callable":142,"../internals/is-pure":146,"../internals/is-regexp":147,"../internals/regexp-get-flags":194,"../internals/require-object-coercible":198,"../internals/to-string":218,"../internals/well-known-symbol":225}],260:[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 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 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 = searchValue == undefined ? undefined : getMethod(searchValue, REPLACE); 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 global = rx.global; if (global) { var fullUnicode = rx.unicode; rx.lastIndex = 0; } var results = []; while (true) { var 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 = []; 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); var 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":61,"../internals/an-object":63,"../internals/fails":112,"../internals/fix-regexp-well-known-symbol-logic":113,"../internals/function-apply":115,"../internals/function-call":118,"../internals/function-uncurry-this":120,"../internals/get-method":125,"../internals/get-substitution":127,"../internals/is-callable":142,"../internals/regexp-exec-abstract":191,"../internals/require-object-coercible":198,"../internals/to-integer-or-infinity":212,"../internals/to-length":213,"../internals/to-string":218,"../internals/well-known-symbol":225}],261:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var uncurryThis = require('../internals/function-uncurry-this'); 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 un$StartsWith = uncurryThis(''.startsWith); 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 un$StartsWith ? un$StartsWith(that, search, index) : stringSlice(that, index, index + search.length) === search; } }); },{"../internals/correct-is-regexp-logic":85,"../internals/export":111,"../internals/function-uncurry-this":120,"../internals/is-pure":146,"../internals/not-a-regexp":164,"../internals/object-get-own-property-descriptor":169,"../internals/require-object-coercible":198,"../internals/to-length":213,"../internals/to-string":218}],262:[function(require,module,exports){ var defineWellKnownSymbol = require('../internals/define-well-known-symbol'); defineWellKnownSymbol('asyncIterator'); },{"../internals/define-well-known-symbol":95}],263:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var global = require('../internals/global'); 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/native-symbol'); 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 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/define-well-known-symbol'); 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 = global.Symbol; var SymbolPrototype = $Symbol && $Symbol[PROTOTYPE]; var TypeError = global.TypeError; var QObject = global.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 setSymbolDescriptor = DESCRIPTORS && fails(function () { return nativeObjectCreate(nativeDefineProperty({}, 'a', { get: function () { return nativeDefineProperty(this, 'a', { value: 7 }).a; } })).a != 7; }) ? 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); } } : 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, {})); 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 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) { if (this === ObjectPrototype) call(setter, ObjectPrototypeSymbols, value); if (hasOwn(this, HIDDEN) && hasOwn(this[HIDDEN], tag)) this[HIDDEN][tag] = false; setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value)); }; 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) { nativeDefineProperty(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":63,"../internals/array-iteration":67,"../internals/create-property-descriptor":89,"../internals/define-built-in":91,"../internals/define-well-known-symbol":95,"../internals/descriptors":96,"../internals/export":111,"../internals/fails":112,"../internals/function-call":118,"../internals/function-uncurry-this":120,"../internals/global":128,"../internals/has-own-property":129,"../internals/hidden-keys":130,"../internals/internal-state":139,"../internals/is-pure":146,"../internals/native-symbol":160,"../internals/object-create":166,"../internals/object-define-properties":167,"../internals/object-define-property":168,"../internals/object-get-own-property-descriptor":169,"../internals/object-get-own-property-names":171,"../internals/object-get-own-property-names-external":170,"../internals/object-get-own-property-symbols":172,"../internals/object-is-prototype-of":175,"../internals/object-keys":177,"../internals/object-property-is-enumerable":178,"../internals/set-to-string-tag":201,"../internals/shared":204,"../internals/shared-key":202,"../internals/symbol-define-to-primitive":208,"../internals/to-indexed-object":211,"../internals/to-property-key":216,"../internals/to-string":218,"../internals/uid":220,"../internals/well-known-symbol":225,"../internals/well-known-symbol-wrapped":224}],264:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var DESCRIPTORS = require('../internals/descriptors'); var global = require('../internals/global'); 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 defineProperty = require('../internals/object-define-property').f; var copyConstructorProperties = require('../internals/copy-constructor-properties'); var NativeSymbol = global.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('test')) == 'Symbol(test)'; var symbolToString = uncurryThis(SymbolPrototype.toString); var symbolValueOf = uncurryThis(SymbolPrototype.valueOf); var regexp = /^Symbol\((.*)\)[^)]+$/; var replace = uncurryThis(''.replace); var stringSlice = uncurryThis(''.slice); defineProperty(SymbolPrototype, 'description', { configurable: true, get: function description() { var symbol = symbolValueOf(this); var string = symbolToString(symbol); if (hasOwn(EmptyStringDescriptionStore, symbol)) return ''; 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":84,"../internals/descriptors":96,"../internals/export":111,"../internals/function-uncurry-this":120,"../internals/global":128,"../internals/has-own-property":129,"../internals/is-callable":142,"../internals/object-define-property":168,"../internals/object-is-prototype-of":175,"../internals/to-string":218}],265:[function(require,module,exports){ 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/native-symbol-registry'); 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":121,"../internals/has-own-property":129,"../internals/native-symbol-registry":159,"../internals/shared":204,"../internals/to-string":218}],266:[function(require,module,exports){ var defineWellKnownSymbol = require('../internals/define-well-known-symbol'); defineWellKnownSymbol('hasInstance'); },{"../internals/define-well-known-symbol":95}],267:[function(require,module,exports){ var defineWellKnownSymbol = require('../internals/define-well-known-symbol'); defineWellKnownSymbol('isConcatSpreadable'); },{"../internals/define-well-known-symbol":95}],268:[function(require,module,exports){ var defineWellKnownSymbol = require('../internals/define-well-known-symbol'); defineWellKnownSymbol('iterator'); },{"../internals/define-well-known-symbol":95}],269:[function(require,module,exports){ 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":231,"../modules/es.object.get-own-property-symbols":239,"../modules/es.symbol.constructor":263,"../modules/es.symbol.for":265,"../modules/es.symbol.key-for":270}],270:[function(require,module,exports){ 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/native-symbol-registry'); var SymbolToStringRegistry = shared('symbol-to-string-registry'); $({ target: 'Symbol', stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, { keyFor: function keyFor(sym) { if (!isSymbol(sym)) throw TypeError(tryToString(sym) + ' is not a symbol'); if (hasOwn(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym]; } }); },{"../internals/export":111,"../internals/has-own-property":129,"../internals/is-symbol":148,"../internals/native-symbol-registry":159,"../internals/shared":204,"../internals/try-to-string":219}],271:[function(require,module,exports){ var defineWellKnownSymbol = require('../internals/define-well-known-symbol'); defineWellKnownSymbol('matchAll'); },{"../internals/define-well-known-symbol":95}],272:[function(require,module,exports){ var defineWellKnownSymbol = require('../internals/define-well-known-symbol'); defineWellKnownSymbol('match'); },{"../internals/define-well-known-symbol":95}],273:[function(require,module,exports){ var defineWellKnownSymbol = require('../internals/define-well-known-symbol'); defineWellKnownSymbol('replace'); },{"../internals/define-well-known-symbol":95}],274:[function(require,module,exports){ var defineWellKnownSymbol = require('../internals/define-well-known-symbol'); defineWellKnownSymbol('search'); },{"../internals/define-well-known-symbol":95}],275:[function(require,module,exports){ var defineWellKnownSymbol = require('../internals/define-well-known-symbol'); defineWellKnownSymbol('species'); },{"../internals/define-well-known-symbol":95}],276:[function(require,module,exports){ var defineWellKnownSymbol = require('../internals/define-well-known-symbol'); defineWellKnownSymbol('split'); },{"../internals/define-well-known-symbol":95}],277:[function(require,module,exports){ var defineWellKnownSymbol = require('../internals/define-well-known-symbol'); var defineSymbolToPrimitive = require('../internals/symbol-define-to-primitive'); defineWellKnownSymbol('toPrimitive'); defineSymbolToPrimitive(); },{"../internals/define-well-known-symbol":95,"../internals/symbol-define-to-primitive":208}],278:[function(require,module,exports){ var getBuiltIn = require('../internals/get-built-in'); var defineWellKnownSymbol = require('../internals/define-well-known-symbol'); var setToStringTag = require('../internals/set-to-string-tag'); defineWellKnownSymbol('toStringTag'); setToStringTag(getBuiltIn('Symbol'), 'Symbol'); },{"../internals/define-well-known-symbol":95,"../internals/get-built-in":121,"../internals/set-to-string-tag":201}],279:[function(require,module,exports){ var defineWellKnownSymbol = require('../internals/define-well-known-symbol'); defineWellKnownSymbol('unscopables'); },{"../internals/define-well-known-symbol":95}],280:[function(require,module,exports){ require('../modules/es.aggregate-error'); },{"../modules/es.aggregate-error":227}],281:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var deleteAll = require('../internals/collection-delete-all'); $({ target: 'Map', proto: true, real: true, forced: true }, { deleteAll: deleteAll }); },{"../internals/collection-delete-all":79,"../internals/export":111}],282:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var emplace = require('../internals/map-emplace'); $({ target: 'Map', proto: true, real: true, forced: true }, { emplace: emplace }); },{"../internals/export":111,"../internals/map-emplace":155}],283:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var anObject = require('../internals/an-object'); var bind = require('../internals/function-bind-context'); var getMapIterator = require('../internals/get-map-iterator'); var iterate = require('../internals/iterate'); $({ target: 'Map', proto: true, real: true, forced: true }, { every: function every(callbackfn ) { var map = anObject(this); var iterator = getMapIterator(map); var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined); return !iterate(iterator, function (key, value, stop) { if (!boundFunction(value, key, map)) return stop(); }, { AS_ENTRIES: true, IS_ITERATOR: true, INTERRUPTED: true }).stopped; } }); },{"../internals/an-object":63,"../internals/export":111,"../internals/function-bind-context":116,"../internals/get-map-iterator":124,"../internals/iterate":149}],284:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var getBuiltIn = require('../internals/get-built-in'); var bind = require('../internals/function-bind-context'); var call = require('../internals/function-call'); var aCallable = require('../internals/a-callable'); var anObject = require('../internals/an-object'); var speciesConstructor = require('../internals/species-constructor'); var getMapIterator = require('../internals/get-map-iterator'); var iterate = require('../internals/iterate'); $({ target: 'Map', proto: true, real: true, forced: true }, { filter: function filter(callbackfn ) { var map = anObject(this); var iterator = getMapIterator(map); var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined); var newMap = new (speciesConstructor(map, getBuiltIn('Map')))(); var setter = aCallable(newMap.set); iterate(iterator, function (key, value) { if (boundFunction(value, key, map)) call(setter, newMap, key, value); }, { AS_ENTRIES: true, IS_ITERATOR: true }); return newMap; } }); },{"../internals/a-callable":57,"../internals/an-object":63,"../internals/export":111,"../internals/function-bind-context":116,"../internals/function-call":118,"../internals/get-built-in":121,"../internals/get-map-iterator":124,"../internals/iterate":149,"../internals/species-constructor":205}],285:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var anObject = require('../internals/an-object'); var bind = require('../internals/function-bind-context'); var getMapIterator = require('../internals/get-map-iterator'); var iterate = require('../internals/iterate'); $({ target: 'Map', proto: true, real: true, forced: true }, { findKey: function findKey(callbackfn ) { var map = anObject(this); var iterator = getMapIterator(map); var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined); return iterate(iterator, function (key, value, stop) { if (boundFunction(value, key, map)) return stop(key); }, { AS_ENTRIES: true, IS_ITERATOR: true, INTERRUPTED: true }).result; } }); },{"../internals/an-object":63,"../internals/export":111,"../internals/function-bind-context":116,"../internals/get-map-iterator":124,"../internals/iterate":149}],286:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var anObject = require('../internals/an-object'); var bind = require('../internals/function-bind-context'); var getMapIterator = require('../internals/get-map-iterator'); var iterate = require('../internals/iterate'); $({ target: 'Map', proto: true, real: true, forced: true }, { find: function find(callbackfn ) { var map = anObject(this); var iterator = getMapIterator(map); var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined); return iterate(iterator, function (key, value, stop) { if (boundFunction(value, key, map)) return stop(value); }, { AS_ENTRIES: true, IS_ITERATOR: true, INTERRUPTED: true }).result; } }); },{"../internals/an-object":63,"../internals/export":111,"../internals/function-bind-context":116,"../internals/get-map-iterator":124,"../internals/iterate":149}],287:[function(require,module,exports){ var $ = require('../internals/export'); var from = require('../internals/collection-from'); $({ target: 'Map', stat: true, forced: true }, { from: from }); },{"../internals/collection-from":80,"../internals/export":111}],288:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var call = require('../internals/function-call'); var uncurryThis = require('../internals/function-uncurry-this'); var aCallable = require('../internals/a-callable'); var getIterator = require('../internals/get-iterator'); var iterate = require('../internals/iterate'); var push = uncurryThis([].push); $({ target: 'Map', stat: true, forced: true }, { groupBy: function groupBy(iterable, keyDerivative) { aCallable(keyDerivative); var iterator = getIterator(iterable); var newMap = new this(); var has = aCallable(newMap.has); var get = aCallable(newMap.get); var set = aCallable(newMap.set); iterate(iterator, function (element) { var derivedKey = keyDerivative(element); if (!call(has, newMap, derivedKey)) call(set, newMap, derivedKey, [element]); else push(call(get, newMap, derivedKey), element); }, { IS_ITERATOR: true }); return newMap; } }); },{"../internals/a-callable":57,"../internals/export":111,"../internals/function-call":118,"../internals/function-uncurry-this":120,"../internals/get-iterator":123,"../internals/iterate":149}],289:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var anObject = require('../internals/an-object'); var getMapIterator = require('../internals/get-map-iterator'); var sameValueZero = require('../internals/same-value-zero'); var iterate = require('../internals/iterate'); $({ target: 'Map', proto: true, real: true, forced: true }, { includes: function includes(searchElement) { return iterate(getMapIterator(anObject(this)), function (key, value, stop) { if (sameValueZero(value, searchElement)) return stop(); }, { AS_ENTRIES: true, IS_ITERATOR: true, INTERRUPTED: true }).stopped; } }); },{"../internals/an-object":63,"../internals/export":111,"../internals/get-map-iterator":124,"../internals/iterate":149,"../internals/same-value-zero":199}],290:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var call = require('../internals/function-call'); var iterate = require('../internals/iterate'); var aCallable = require('../internals/a-callable'); $({ target: 'Map', stat: true, forced: true }, { keyBy: function keyBy(iterable, keyDerivative) { var newMap = new this(); 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/iterate":149}],291:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var anObject = require('../internals/an-object'); var getMapIterator = require('../internals/get-map-iterator'); var iterate = require('../internals/iterate'); $({ target: 'Map', proto: true, real: true, forced: true }, { keyOf: function keyOf(searchElement) { return iterate(getMapIterator(anObject(this)), function (key, value, stop) { if (value === searchElement) return stop(key); }, { AS_ENTRIES: true, IS_ITERATOR: true, INTERRUPTED: true }).result; } }); },{"../internals/an-object":63,"../internals/export":111,"../internals/get-map-iterator":124,"../internals/iterate":149}],292:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var getBuiltIn = require('../internals/get-built-in'); var bind = require('../internals/function-bind-context'); var call = require('../internals/function-call'); var aCallable = require('../internals/a-callable'); var anObject = require('../internals/an-object'); var speciesConstructor = require('../internals/species-constructor'); var getMapIterator = require('../internals/get-map-iterator'); var iterate = require('../internals/iterate'); $({ target: 'Map', proto: true, real: true, forced: true }, { mapKeys: function mapKeys(callbackfn ) { var map = anObject(this); var iterator = getMapIterator(map); var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined); var newMap = new (speciesConstructor(map, getBuiltIn('Map')))(); var setter = aCallable(newMap.set); iterate(iterator, function (key, value) { call(setter, newMap, boundFunction(value, key, map), value); }, { AS_ENTRIES: true, IS_ITERATOR: true }); return newMap; } }); },{"../internals/a-callable":57,"../internals/an-object":63,"../internals/export":111,"../internals/function-bind-context":116,"../internals/function-call":118,"../internals/get-built-in":121,"../internals/get-map-iterator":124,"../internals/iterate":149,"../internals/species-constructor":205}],293:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var getBuiltIn = require('../internals/get-built-in'); var bind = require('../internals/function-bind-context'); var call = require('../internals/function-call'); var aCallable = require('../internals/a-callable'); var anObject = require('../internals/an-object'); var speciesConstructor = require('../internals/species-constructor'); var getMapIterator = require('../internals/get-map-iterator'); var iterate = require('../internals/iterate'); $({ target: 'Map', proto: true, real: true, forced: true }, { mapValues: function mapValues(callbackfn ) { var map = anObject(this); var iterator = getMapIterator(map); var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined); var newMap = new (speciesConstructor(map, getBuiltIn('Map')))(); var setter = aCallable(newMap.set); iterate(iterator, function (key, value) { call(setter, newMap, key, boundFunction(value, key, map)); }, { AS_ENTRIES: true, IS_ITERATOR: true }); return newMap; } }); },{"../internals/a-callable":57,"../internals/an-object":63,"../internals/export":111,"../internals/function-bind-context":116,"../internals/function-call":118,"../internals/get-built-in":121,"../internals/get-map-iterator":124,"../internals/iterate":149,"../internals/species-constructor":205}],294:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var aCallable = require('../internals/a-callable'); var anObject = require('../internals/an-object'); var iterate = require('../internals/iterate'); $({ target: 'Map', proto: true, real: true, arity: 1, forced: true }, { merge: function merge(iterable ) { var map = anObject(this); var setter = aCallable(map.set); var argumentsLength = arguments.length; var i = 0; while (i < argumentsLength) { iterate(arguments[i++], setter, { that: map, AS_ENTRIES: true }); } return map; } }); },{"../internals/a-callable":57,"../internals/an-object":63,"../internals/export":111,"../internals/iterate":149}],295:[function(require,module,exports){ var $ = require('../internals/export'); var of = require('../internals/collection-of'); $({ target: 'Map', stat: true, forced: true }, { of: of }); },{"../internals/collection-of":81,"../internals/export":111}],296:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var anObject = require('../internals/an-object'); var aCallable = require('../internals/a-callable'); var getMapIterator = require('../internals/get-map-iterator'); var iterate = require('../internals/iterate'); var $TypeError = TypeError; $({ target: 'Map', proto: true, real: true, forced: true }, { reduce: function reduce(callbackfn ) { var map = anObject(this); var iterator = getMapIterator(map); var noInitial = arguments.length < 2; var accumulator = noInitial ? undefined : arguments[1]; aCallable(callbackfn); iterate(iterator, function (key, value) { if (noInitial) { noInitial = false; accumulator = value; } else { accumulator = callbackfn(accumulator, value, key, map); } }, { AS_ENTRIES: true, IS_ITERATOR: true }); if (noInitial) throw $TypeError('Reduce of empty map with no initial value'); return accumulator; } }); },{"../internals/a-callable":57,"../internals/an-object":63,"../internals/export":111,"../internals/get-map-iterator":124,"../internals/iterate":149}],297:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var anObject = require('../internals/an-object'); var bind = require('../internals/function-bind-context'); var getMapIterator = require('../internals/get-map-iterator'); var iterate = require('../internals/iterate'); $({ target: 'Map', proto: true, real: true, forced: true }, { some: function some(callbackfn ) { var map = anObject(this); var iterator = getMapIterator(map); var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined); return iterate(iterator, function (key, value, stop) { if (boundFunction(value, key, map)) return stop(); }, { AS_ENTRIES: true, IS_ITERATOR: true, INTERRUPTED: true }).stopped; } }); },{"../internals/an-object":63,"../internals/export":111,"../internals/function-bind-context":116,"../internals/get-map-iterator":124,"../internals/iterate":149}],298:[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":156}],299:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var call = require('../internals/function-call'); var anObject = require('../internals/an-object'); var aCallable = require('../internals/a-callable'); var $TypeError = TypeError; $({ target: 'Map', proto: true, real: true, forced: true }, { update: function update(key, callback ) { var map = anObject(this); var get = aCallable(map.get); var has = aCallable(map.has); var set = aCallable(map.set); var length = arguments.length; aCallable(callback); var isPresentInMap = call(has, map, key); if (!isPresentInMap && length < 3) { throw $TypeError('Updating absent value'); } var value = isPresentInMap ? call(get, map, key) : aCallable(length > 2 ? arguments[2] : undefined)(key, map); call(set, map, key, callback(value, key, map)); return map; } }); },{"../internals/a-callable":57,"../internals/an-object":63,"../internals/export":111,"../internals/function-call":118}],300:[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":156}],301:[function(require,module,exports){ require('../modules/es.promise.all-settled.js'); },{"../modules/es.promise.all-settled.js":241}],302:[function(require,module,exports){ require('../modules/es.promise.any'); },{"../modules/es.promise.any":243}],303:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var newPromiseCapabilityModule = require('../internals/new-promise-capability'); var perform = require('../internals/perform'); $({ target: 'Promise', stat: true, forced: true }, { 'try': function (callbackfn) { var promiseCapability = newPromiseCapabilityModule.f(this); var result = perform(callbackfn); (result.error ? promiseCapability.reject : promiseCapability.resolve)(result.value); return promiseCapability.promise; } }); },{"../internals/export":111,"../internals/new-promise-capability":162,"../internals/perform":185}],304:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var addAll = require('../internals/collection-add-all'); $({ target: 'Set', proto: true, real: true, forced: true }, { addAll: addAll }); },{"../internals/collection-add-all":78,"../internals/export":111}],305:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var deleteAll = require('../internals/collection-delete-all'); $({ target: 'Set', proto: true, real: true, forced: true }, { deleteAll: deleteAll }); },{"../internals/collection-delete-all":79,"../internals/export":111}],306:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var getBuiltIn = require('../internals/get-built-in'); var call = require('../internals/function-call'); var aCallable = require('../internals/a-callable'); var anObject = require('../internals/an-object'); var speciesConstructor = require('../internals/species-constructor'); var iterate = require('../internals/iterate'); $({ target: 'Set', proto: true, real: true, forced: true }, { difference: function difference(iterable) { var set = anObject(this); var newSet = new (speciesConstructor(set, getBuiltIn('Set')))(set); var remover = aCallable(newSet['delete']); iterate(iterable, function (value) { call(remover, newSet, value); }); return newSet; } }); },{"../internals/a-callable":57,"../internals/an-object":63,"../internals/export":111,"../internals/function-call":118,"../internals/get-built-in":121,"../internals/iterate":149,"../internals/species-constructor":205}],307:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var anObject = require('../internals/an-object'); var bind = require('../internals/function-bind-context'); var getSetIterator = require('../internals/get-set-iterator'); var iterate = require('../internals/iterate'); $({ target: 'Set', proto: true, real: true, forced: true }, { every: function every(callbackfn ) { var set = anObject(this); var iterator = getSetIterator(set); var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined); return !iterate(iterator, function (value, stop) { if (!boundFunction(value, value, set)) return stop(); }, { IS_ITERATOR: true, INTERRUPTED: true }).stopped; } }); },{"../internals/an-object":63,"../internals/export":111,"../internals/function-bind-context":116,"../internals/get-set-iterator":126,"../internals/iterate":149}],308:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var getBuiltIn = require('../internals/get-built-in'); var call = require('../internals/function-call'); var aCallable = require('../internals/a-callable'); var anObject = require('../internals/an-object'); var bind = require('../internals/function-bind-context'); var speciesConstructor = require('../internals/species-constructor'); var getSetIterator = require('../internals/get-set-iterator'); var iterate = require('../internals/iterate'); $({ target: 'Set', proto: true, real: true, forced: true }, { filter: function filter(callbackfn ) { var set = anObject(this); var iterator = getSetIterator(set); var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined); var newSet = new (speciesConstructor(set, getBuiltIn('Set')))(); var adder = aCallable(newSet.add); iterate(iterator, function (value) { if (boundFunction(value, value, set)) call(adder, newSet, value); }, { IS_ITERATOR: true }); return newSet; } }); },{"../internals/a-callable":57,"../internals/an-object":63,"../internals/export":111,"../internals/function-bind-context":116,"../internals/function-call":118,"../internals/get-built-in":121,"../internals/get-set-iterator":126,"../internals/iterate":149,"../internals/species-constructor":205}],309:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var anObject = require('../internals/an-object'); var bind = require('../internals/function-bind-context'); var getSetIterator = require('../internals/get-set-iterator'); var iterate = require('../internals/iterate'); $({ target: 'Set', proto: true, real: true, forced: true }, { find: function find(callbackfn ) { var set = anObject(this); var iterator = getSetIterator(set); var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined); return iterate(iterator, function (value, stop) { if (boundFunction(value, value, set)) return stop(value); }, { IS_ITERATOR: true, INTERRUPTED: true }).result; } }); },{"../internals/an-object":63,"../internals/export":111,"../internals/function-bind-context":116,"../internals/get-set-iterator":126,"../internals/iterate":149}],310:[function(require,module,exports){ var $ = require('../internals/export'); var from = require('../internals/collection-from'); $({ target: 'Set', stat: true, forced: true }, { from: from }); },{"../internals/collection-from":80,"../internals/export":111}],311:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var getBuiltIn = require('../internals/get-built-in'); var call = require('../internals/function-call'); var aCallable = require('../internals/a-callable'); var anObject = require('../internals/an-object'); var speciesConstructor = require('../internals/species-constructor'); var iterate = require('../internals/iterate'); $({ target: 'Set', proto: true, real: true, forced: true }, { intersection: function intersection(iterable) { var set = anObject(this); var newSet = new (speciesConstructor(set, getBuiltIn('Set')))(); var hasCheck = aCallable(set.has); var adder = aCallable(newSet.add); iterate(iterable, function (value) { if (call(hasCheck, set, value)) call(adder, newSet, value); }); return newSet; } }); },{"../internals/a-callable":57,"../internals/an-object":63,"../internals/export":111,"../internals/function-call":118,"../internals/get-built-in":121,"../internals/iterate":149,"../internals/species-constructor":205}],312:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var call = require('../internals/function-call'); var aCallable = require('../internals/a-callable'); var anObject = require('../internals/an-object'); var iterate = require('../internals/iterate'); $({ target: 'Set', proto: true, real: true, forced: true }, { isDisjointFrom: function isDisjointFrom(iterable) { var set = anObject(this); var hasCheck = aCallable(set.has); return !iterate(iterable, function (value, stop) { if (call(hasCheck, set, value) === true) return stop(); }, { INTERRUPTED: true }).stopped; } }); },{"../internals/a-callable":57,"../internals/an-object":63,"../internals/export":111,"../internals/function-call":118,"../internals/iterate":149}],313:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var getBuiltIn = require('../internals/get-built-in'); 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 getIterator = require('../internals/get-iterator'); var iterate = require('../internals/iterate'); $({ target: 'Set', proto: true, real: true, forced: true }, { isSubsetOf: function isSubsetOf(iterable) { var iterator = getIterator(this); var otherSet = anObject(iterable); var hasCheck = otherSet.has; if (!isCallable(hasCheck)) { otherSet = new (getBuiltIn('Set'))(iterable); hasCheck = aCallable(otherSet.has); } return !iterate(iterator, function (value, stop) { if (call(hasCheck, otherSet, value) === false) return stop(); }, { IS_ITERATOR: true, INTERRUPTED: true }).stopped; } }); },{"../internals/a-callable":57,"../internals/an-object":63,"../internals/export":111,"../internals/function-call":118,"../internals/get-built-in":121,"../internals/get-iterator":123,"../internals/is-callable":142,"../internals/iterate":149}],314:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var call = require('../internals/function-call'); var aCallable = require('../internals/a-callable'); var anObject = require('../internals/an-object'); var iterate = require('../internals/iterate'); $({ target: 'Set', proto: true, real: true, forced: true }, { isSupersetOf: function isSupersetOf(iterable) { var set = anObject(this); var hasCheck = aCallable(set.has); return !iterate(iterable, function (value, stop) { if (call(hasCheck, set, value) === false) return stop(); }, { INTERRUPTED: true }).stopped; } }); },{"../internals/a-callable":57,"../internals/an-object":63,"../internals/export":111,"../internals/function-call":118,"../internals/iterate":149}],315:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var uncurryThis = require('../internals/function-uncurry-this'); var anObject = require('../internals/an-object'); var toString = require('../internals/to-string'); var getSetIterator = require('../internals/get-set-iterator'); var iterate = require('../internals/iterate'); var arrayJoin = uncurryThis([].join); var push = [].push; $({ target: 'Set', proto: true, real: true, forced: true }, { join: function join(separator) { var set = anObject(this); var iterator = getSetIterator(set); var sep = separator === undefined ? ',' : toString(separator); var result = []; iterate(iterator, push, { that: result, IS_ITERATOR: true }); return arrayJoin(result, sep); } }); },{"../internals/an-object":63,"../internals/export":111,"../internals/function-uncurry-this":120,"../internals/get-set-iterator":126,"../internals/iterate":149,"../internals/to-string":218}],316:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var getBuiltIn = require('../internals/get-built-in'); var bind = require('../internals/function-bind-context'); var call = require('../internals/function-call'); var aCallable = require('../internals/a-callable'); var anObject = require('../internals/an-object'); var speciesConstructor = require('../internals/species-constructor'); var getSetIterator = require('../internals/get-set-iterator'); var iterate = require('../internals/iterate'); $({ target: 'Set', proto: true, real: true, forced: true }, { map: function map(callbackfn ) { var set = anObject(this); var iterator = getSetIterator(set); var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined); var newSet = new (speciesConstructor(set, getBuiltIn('Set')))(); var adder = aCallable(newSet.add); iterate(iterator, function (value) { call(adder, newSet, boundFunction(value, value, set)); }, { IS_ITERATOR: true }); return newSet; } }); },{"../internals/a-callable":57,"../internals/an-object":63,"../internals/export":111,"../internals/function-bind-context":116,"../internals/function-call":118,"../internals/get-built-in":121,"../internals/get-set-iterator":126,"../internals/iterate":149,"../internals/species-constructor":205}],317:[function(require,module,exports){ var $ = require('../internals/export'); var of = require('../internals/collection-of'); $({ target: 'Set', stat: true, forced: true }, { of: of }); },{"../internals/collection-of":81,"../internals/export":111}],318:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var aCallable = require('../internals/a-callable'); var anObject = require('../internals/an-object'); var getSetIterator = require('../internals/get-set-iterator'); var iterate = require('../internals/iterate'); var $TypeError = TypeError; $({ target: 'Set', proto: true, real: true, forced: true }, { reduce: function reduce(callbackfn ) { var set = anObject(this); var iterator = getSetIterator(set); var noInitial = arguments.length < 2; var accumulator = noInitial ? undefined : arguments[1]; aCallable(callbackfn); iterate(iterator, function (value) { if (noInitial) { noInitial = false; accumulator = value; } else { accumulator = callbackfn(accumulator, value, value, set); } }, { IS_ITERATOR: true }); if (noInitial) throw $TypeError('Reduce of empty set with no initial value'); return accumulator; } }); },{"../internals/a-callable":57,"../internals/an-object":63,"../internals/export":111,"../internals/get-set-iterator":126,"../internals/iterate":149}],319:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var anObject = require('../internals/an-object'); var bind = require('../internals/function-bind-context'); var getSetIterator = require('../internals/get-set-iterator'); var iterate = require('../internals/iterate'); $({ target: 'Set', proto: true, real: true, forced: true }, { some: function some(callbackfn ) { var set = anObject(this); var iterator = getSetIterator(set); var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined); return iterate(iterator, function (value, stop) { if (boundFunction(value, value, set)) return stop(); }, { IS_ITERATOR: true, INTERRUPTED: true }).stopped; } }); },{"../internals/an-object":63,"../internals/export":111,"../internals/function-bind-context":116,"../internals/get-set-iterator":126,"../internals/iterate":149}],320:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var getBuiltIn = require('../internals/get-built-in'); var call = require('../internals/function-call'); var aCallable = require('../internals/a-callable'); var anObject = require('../internals/an-object'); var speciesConstructor = require('../internals/species-constructor'); var iterate = require('../internals/iterate'); $({ target: 'Set', proto: true, real: true, forced: true }, { symmetricDifference: function symmetricDifference(iterable) { var set = anObject(this); var newSet = new (speciesConstructor(set, getBuiltIn('Set')))(set); var remover = aCallable(newSet['delete']); var adder = aCallable(newSet.add); iterate(iterable, function (value) { call(remover, newSet, value) || call(adder, newSet, value); }); return newSet; } }); },{"../internals/a-callable":57,"../internals/an-object":63,"../internals/export":111,"../internals/function-call":118,"../internals/get-built-in":121,"../internals/iterate":149,"../internals/species-constructor":205}],321:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var getBuiltIn = require('../internals/get-built-in'); var aCallable = require('../internals/a-callable'); var anObject = require('../internals/an-object'); var speciesConstructor = require('../internals/species-constructor'); var iterate = require('../internals/iterate'); $({ target: 'Set', proto: true, real: true, forced: true }, { union: function union(iterable) { var set = anObject(this); var newSet = new (speciesConstructor(set, getBuiltIn('Set')))(set); iterate(iterable, aCallable(newSet.add), { that: newSet }); return newSet; } }); },{"../internals/a-callable":57,"../internals/an-object":63,"../internals/export":111,"../internals/get-built-in":121,"../internals/iterate":149,"../internals/species-constructor":205}],322:[function(require,module,exports){ require('../modules/es.string.replace-all'); },{"../modules/es.string.replace-all":259}],323:[function(require,module,exports){ var defineWellKnownSymbol = require('../internals/define-well-known-symbol'); defineWellKnownSymbol('asyncDispose'); },{"../internals/define-well-known-symbol":95}],324:[function(require,module,exports){ var defineWellKnownSymbol = require('../internals/define-well-known-symbol'); defineWellKnownSymbol('dispose'); },{"../internals/define-well-known-symbol":95}],325:[function(require,module,exports){ var defineWellKnownSymbol = require('../internals/define-well-known-symbol'); defineWellKnownSymbol('matcher'); },{"../internals/define-well-known-symbol":95}],326:[function(require,module,exports){ var defineWellKnownSymbol = require('../internals/define-well-known-symbol'); defineWellKnownSymbol('metadataKey'); },{"../internals/define-well-known-symbol":95}],327:[function(require,module,exports){ var defineWellKnownSymbol = require('../internals/define-well-known-symbol'); defineWellKnownSymbol('metadata'); },{"../internals/define-well-known-symbol":95}],328:[function(require,module,exports){ var defineWellKnownSymbol = require('../internals/define-well-known-symbol'); defineWellKnownSymbol('observable'); },{"../internals/define-well-known-symbol":95}],329:[function(require,module,exports){ var defineWellKnownSymbol = require('../internals/define-well-known-symbol'); defineWellKnownSymbol('patternMatch'); },{"../internals/define-well-known-symbol":95}],330:[function(require,module,exports){ var defineWellKnownSymbol = require('../internals/define-well-known-symbol'); defineWellKnownSymbol('replaceAll'); },{"../internals/define-well-known-symbol":95}],331:[function(require,module,exports){ var global = require('../internals/global'); 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 wellKnownSymbol = require('../internals/well-known-symbol'); var ITERATOR = wellKnownSymbol('iterator'); var TO_STRING_TAG = wellKnownSymbol('toStringTag'); 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; } if (!CollectionPrototype[TO_STRING_TAG]) { createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME); } 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(global[COLLECTION_NAME] && global[COLLECTION_NAME].prototype, COLLECTION_NAME); } handlePrototype(DOMTokenListPrototype, 'DOMTokenList'); },{"../internals/create-non-enumerable-property":88,"../internals/dom-iterables":99,"../internals/dom-token-list-prototype":100,"../internals/global":128,"../internals/well-known-symbol":225,"../modules/es.array.iterator":230}],332:[function(require,module,exports){ var parent = require('../../es/array/from'); module.exports = parent; },{"../../es/array/from":15}],333:[function(require,module,exports){ var parent = require('../../es/array/iterator'); module.exports = parent; },{"../../es/array/iterator":16}],334:[function(require,module,exports){ var parent = require('../../es/map'); require('../../modules/web.dom-collections.iterator'); module.exports = parent; },{"../../es/map":17,"../../modules/web.dom-collections.iterator":331}],335:[function(require,module,exports){ var parent = require('../../es/math/clz32'); module.exports = parent; },{"../../es/math/clz32":18}],336:[function(require,module,exports){ var parent = require('../../es/object/assign'); module.exports = parent; },{"../../es/object/assign":19}],337:[function(require,module,exports){ var parent = require('../../es/object/entries'); module.exports = parent; },{"../../es/object/entries":20}],338:[function(require,module,exports){ var parent = require('../../es/promise'); require('../../modules/web.dom-collections.iterator'); module.exports = parent; },{"../../es/promise":21,"../../modules/web.dom-collections.iterator":331}],339:[function(require,module,exports){ var parent = require('../../es/set'); require('../../modules/web.dom-collections.iterator'); module.exports = parent; },{"../../es/set":22,"../../modules/web.dom-collections.iterator":331}],340:[function(require,module,exports){ var parent = require('../../es/string/ends-with'); module.exports = parent; },{"../../es/string/ends-with":23}],341:[function(require,module,exports){ var parent = require('../../es/string/includes'); module.exports = parent; },{"../../es/string/includes":24}],342:[function(require,module,exports){ var parent = require('../../es/string/repeat'); module.exports = parent; },{"../../es/string/repeat":25}],343:[function(require,module,exports){ var parent = require('../../es/string/replace-all'); module.exports = parent; },{"../../es/string/replace-all":26}],344:[function(require,module,exports){ var parent = require('../../es/string/starts-with'); module.exports = parent; },{"../../es/string/starts-with":27}],345:[function(require,module,exports){ var parent = require('../../es/symbol'); require('../../modules/web.dom-collections.iterator'); module.exports = parent; },{"../../es/symbol":28,"../../modules/web.dom-collections.iterator":331}],346:[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":347,"./polyfills/element.child-node.before":348,"./polyfills/element.child-node.closest":349,"./polyfills/element.child-node.remove":350,"./polyfills/element.child-node.replace-with":351,"./polyfills/element.node-list.for-each":352,"./polyfills/element.parent-node.append":353,"./polyfills/element.parent-node.prepend":354}],347:[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]); },{}],348:[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]); },{}],349:[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; }; } },{}],350:[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]); },{}],351:[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; },{}],352:[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); } }; } },{}],353:[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]); },{}],354:[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]); },{}],355:[function(require,module,exports){ var runtime = (function (exports) { "use strict"; var Op = Object.prototype; var hasOwn = Op.hasOwnProperty; 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 || []); generator._invoke = 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; define(Gp, "constructor", GeneratorFunctionPrototype); define(GeneratorFunctionPrototype, "constructor", GeneratorFunction); 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(); } this._invoke = 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 method = delegate.iterator[context.method]; if (method === undefined) { context.delegate = null; if (context.method === "throw") { if (delegate.iterator["return"]) { context.method = "return"; context.arg = undefined; maybeInvokeDelegate(delegate, context); if (context.method === "throw") { return ContinueSentinel; } } context.method = "throw"; context.arg = new TypeError( "The iterator does not provide a 'throw' 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(object) { 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) { 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; } } return { next: doneResult }; } 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); } } },{}],356:[function(require,module,exports){ "use strict"; var _window$opera; function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } function _regeneratorRuntime() { "use strict"; _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 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(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (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(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(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; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(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 ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; } function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _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(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); } function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _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 _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } 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 _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } (function deMainFuncInner(deWindow, prestoStorage, FormData, scrollTo, localData) { 'use strict'; var _marked = _regeneratorRuntime().mark(getFormElements); var version = '21.7.6.0'; var commit = '9e1ce1f'; var defaultCfg = { disabled: 0, language: 0, hideBySpell: 1, spells: null, sortSpells: 0, hideRefPsts: 0, nextPageThr: 0, delHiddPost: 0, ajaxUpdThr: 1, updThrDelay: 20, updCount: 1, favIcoBlink: 0, desktNotif: 0, markNewPosts: 1, useDobrAPI: 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, zoomFactor: 25, webmControl: 1, webmTitles: 0, 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: 0, decodeLinks: 0, insertNum: 1, addOPLink: 0, addImgs: 0, addMP3: 1, addVocaroo: 1, embedYTube: 1, YTubeWidth: 360, YTubeHeigh: 270, YTubeTitles: 0, ytApiKey: '', addVimeo: 1, ajaxPosting: 1, postSameImg: 1, removeEXIF: 1, removeFName: 0, sendErrNotif: 1, scrAfterRep: 0, fileInputs: 2, addPostForm: 2, spacedQuote: 1, favOnReply: 1, warnSubjTrip: 0, addSageBtn: 1, saveSage: 1, sageReply: 0, altCaptcha: 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, hideReplies: 0, rePageTitle: 1, inftyScroll: 1, scrollToTop: 0, saveScroll: 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 = { 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', 'Виділяти кольором нові пости'], useDobrAPI: ['dobrochan: использовать JSON API', 'dobrochan: use JSON API', 'dobrochan: використовувати JSON API'], 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 in posts* ', 'Корекція часу в постах* '], 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: ['Миним. размер раскрытых картинок (px)', 'Minimal size for expanded images (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', 'Памʼятати сажу'], altCaptcha: ['Использовать альтернативную капчу', 'Use alternative captcha', 'Використовувати альтернативну капчу'], 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 darkblue', 'Gradient blue', 'Solid grey', 'Transparent blue', 'Square dark'], ['Gradient darkblue', 'Gradient blue', 'Solid grey', 'Transparent blue', 'Square dark']], 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', 'Пам`ятати позицію скролла в тредах'], 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'], pcount: ['Постов в треде', 'Posts in thread', 'Постів у треді'], pcountNotHid: ['Постов в треде (без скрытых)', 'Posts in thread (without hidden)', 'Постів у треді (крім схованих)'], imglen: ['Картинок в треде', 'Images in thread', 'Зображень у треді'], posters: ['Постящих в треде', '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', 'Закріпити превʼю'], 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', 'Ховати по імені'], 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 post', 'Скарга на пост'], reportThr: ['Жалоба на тред', 'Report 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', 'Інформація для відлагодження'], infoCount: ['Обновить счетчики постов', 'Refresh posts counters', 'Оновити лічильники постів'], infoPage: ['Проверить положение тредов (до 10-й страницы)', 'Check for threads position (up to 10th page)', 'Перевірити актуальність тредів (до 10 сторінки)'], clrDeleted: ['Очистить недоступные (404) треды', 'Clear inaccessible (404) threads', 'Очистити недоступні (404) треди'], oldPosts: ['Постов при последнем посещении', 'Posts at the last visit', 'Постів під час останнього відвідування'], newPosts: ['Количество новых постов', 'Number of new posts', 'Кількість нових постів'], myPostsRep: ['Ответов на ваши посты', 'Replies to your posts', 'Відповідей на ваші пости'], thrPage: ['Тред на @странице', 'Thread on @page', 'Тред на @сторінці'], 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: ', 'переглядів: '], pasteImage: ['Ctrl+V - вставить картинку из буфера', 'Ctrl+V - paste an image from clipboard', 'Ctrl+V - додати зображення з буферу'], 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', 'Тред заархівовано'], stormWallCheck: ['Проверка StormWall защиты от DDoS атак...', 'Checking for the StormWall DDoS protection...', 'Перевірка StormWall захисту від DDoS атак...'], stormWallErr: ['Пожалуйста, решите капчу StormWall защиты', 'Please resolve the StormWall protection captcha', 'Будь ласка, вирішіть капчу StormWall захисту'], 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', 'Відео'], cap: ['Капча', '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!
Ви можете підтримати проект пожертвою'], firefoxAddon: ['Firefox аддон доступен!', 'Firefox add-on is available!', 'Firefox аддон доступний!'] }; var doc = deWindow.document; var emptyFn = Function.prototype; var aProto = Array.prototype; var gitWiki = 'https://github.com/SthephanShinkufag/Dollchan-Extension-Tools/wiki/'; var gitRaw = 'https://raw.githubusercontent.com/SthephanShinkufag/Dollchan-Extension-Tools/master/'; var aib, Cfg, docBody, dTime, dummy, isExpImg, isPreImg, lang, locStorage, nav, needScroll, pByEl, pByNum, pr, sesStorage, updater; var quotedText = ''; var visPosts = 2; var topWinZ = 10; var $id = function $id(id) { return doc.getElementById(id); }; var $q = function $q(path) { var root = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : docBody; return root.querySelector(path); }; var $Q = function $Q(path) { var root = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : docBody; return root.querySelectorAll(path); }; var $match = function $match(parent) { for (var _len = arguments.length, rules = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { rules[_key - 1] = arguments[_key]; } return parent.split(', ').map(function (val) { return val + rules.join(', ' + val); }).join(', '); }; function $bBegin(sibling, html) { sibling.insertAdjacentHTML('beforebegin', html); return sibling.previousSibling; } function $aBegin(parent, html) { parent.insertAdjacentHTML('afterbegin', html); return parent.firstChild; } function $bEnd(parent, html) { parent.insertAdjacentHTML('beforeend', html); return parent.lastChild; } function $aEnd(sibling, html) { sibling.insertAdjacentHTML('afterend', html); return sibling.nextSibling; } function $replace(el, html) { el.insertAdjacentHTML('afterend', html); el.remove(); } function $del(el) { el === null || el === void 0 ? void 0 : el.remove(); } function $delAll(path) { var root = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : docBody; root.querySelectorAll(path, root).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) { var el = doc.createElement('script'); el.type = 'text/javascript'; el.textContent = text; doc.head.append(el); el.remove(); } function $css(text) { if (nav.isSafari && !('flex' in docBody.style)) { text = text.replace(/(transform|transition|flex|align-items)/g, ' -webkit-$1'); } 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 $toggleAttr(el, name, value, isAdd) { if (isAdd) { el.setAttribute(name, value); } else { el.removeAttribute(name); } } 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); } var $hasProp = 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; } var escapeRegExp = 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); } var pad2 = function pad2(i) { return i < 10 ? '0' + i : i; }; var arrTags = function arrTags(arr, start, end) { return start + arr.join(end + start) + end; }; var fixBrd = function fixBrd(board) { return '/' + (board ? board + '/' : ''); }; var getFileName = function getFileName(url) { return url.substring(url.lastIndexOf('/') + 1); }; var getFileExt = function getFileExt(url) { return url.substring(url.lastIndexOf('.') + 1); }; var cutFileExt = function cutFileExt(fileName) { return fileName.substring(0, fileName.lastIndexOf('.')); }; var prettifySize = 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; el.value = el.value.substr(0, start) + txt + el.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 readFile(_x, _x2) { return _readFile.apply(this, arguments); } function _readFile() { _readFile = _asyncToGenerator( _regeneratorRuntime().mark(function _callee20(file, asText) { return _regeneratorRuntime().wrap(function _callee20$(_context30) { while (1) { switch (_context30.prev = _context30.next) { case 0: return _context30.abrupt("return", 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); } })); case 1: case "end": return _context30.stop(); } } }, _callee20); })); return _readFile.apply(this, arguments); } function getFileMime(url) { var dotIdx = url.lastIndexOf('.') + 1; switch (dotIdx && url.substr(dotIdx).toLowerCase()) { case 'gif': return 'image/gif'; case 'jpeg': case 'jpg': return 'image/jpeg'; 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(docBody, "")); link.click(); setTimeout(function () { deWindow.URL.revokeObjectURL(url); link.remove(); }, 2e5); } function checkCSSColor(color) { if (!color || color === 'inherit' || color === 'currentColor') { return false; } if (color === 'transparent') { return true; } var image = doc.createElement('img'); image.style.color = 'rgb(0, 0, 0)'; image.style.color = color; if (image.style.color !== 'rgb(0, 0, 0)') { return true; } image.style.color = 'rgb(255, 255, 255)'; image.style.color = color; return image.style.color !== 'rgb(255, 255, 255)'; } function showDonateMsg() { var font = ' style="font: 13px monospace; color: green;"'; $popup('donate', Lng.donateMsg[lang] + ':
' + '' + '
Yandex.Money
' + "410012122418236
WebMoney
") + "WMZ – Z100197626370
") + "WMR – R266614957054
") + "WMU – U142375546253
") + "Bitcoin
P2PKH – 15xEo7BVQ3zjztJqKSRVhTq3tt3rNSHFpC
") + "P2SH – 3AhNPPpvtxQoFCLXk5e9Hzh6Ex9h7EoNzq
") + (nav.firefoxVer >= 56 && nav.scriptHandler !== 'WebExtension' ? "

New: ' + Lng.firefoxAddon[lang] : '')); } 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; } _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 _iterator = _createForOfIteratorHelperLoose(children), _step; !(_step = _iterator()).done;) { var child = _step.value; 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); }); } }]); return CancelablePromise; }(); var Maybe = function () { function Maybe(Ctor ) { _classCallCheck(this, Maybe); this._ctor = Ctor; this.hasValue = false; } _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; } }]); return Maybe; }(); 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); } _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) { if (this.data) { this.data["delete"](key); } } }]); return TemporaryContent; }(); 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; } _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; } }); } }]); return TasksPool; }(); 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)); } } _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); }); } }]); return WorkerPool; }(); var TarBuilder = function () { function TarBuilder() { _classCallCheck(this, TarBuilder); this._data = []; } _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; } }]); return TarBuilder; }(); var WebmParser = function () { function WebmParser(data) { _classCallCheck(this, WebmParser); var offset = 0; var dv = nav.getUnsafeDataView(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 _el = new WebmParser.Element(dv, len, offset); if (_el.error) { break error; } if (_el.id === segmentId) { this.segment = _el; break; } else if (_el.id === voidId) { voids.push(_el); } else { break error; } offset += _el.headSize + _el.size; } this.voids = voids; this.data = data; this.length = len; this.rv = [null]; this.error = false; return; } while (false); this.error = true; } _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.getUnsafeUint8Array(this.data, 0, this.segment.endOffset); return this.rv; } }]); return WebmParser; }(); 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( _regeneratorRuntime().mark(function _callee21(id) { var value; return _regeneratorRuntime().wrap(function _callee21$(_context31) { while (1) { switch (_context31.prev = _context31.next) { case 0: if (!nav.hasNewGM) { _context31.next = 7; break; } _context31.next = 3; return GM.getValue(id); case 3: value = _context31.sent; return _context31.abrupt("return", value); case 7: if (!nav.hasOldGM) { _context31.next = 11; break; } return _context31.abrupt("return", GM_getValue(id)); case 11: if (!nav.hasWebStorage) { _context31.next = 15; break; } return _context31.abrupt("return", 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 15: if (!nav.hasPrestoStorage) { _context31.next = 17; break; } return _context31.abrupt("return", prestoStorage.getItem(id)); case 17: return _context31.abrupt("return", locStorage[id]); case 18: case "end": return _context31.stop(); } } }, _callee21); })); 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) { var obj = {}; obj[id] = value; chrome.storage.sync.set(obj, function () { if (chrome.runtime.lastError) { chrome.storage.local.set(obj, emptyFn); chrome.storage.sync.remove(id, emptyFn); } else { chrome.storage.local.remove(id, emptyFn); } }); } else if (nav.hasPrestoStorage) { prestoStorage.setItem(id, value); } else { locStorage[id] = value; } } 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, emptyFn); } else if (nav.hasPrestoStorage) { prestoStorage.removeItem(id); } else { locStorage.removeItem(id); } } function getStoredObj(_x4) { return _getStoredObj.apply(this, arguments); } function _getStoredObj() { _getStoredObj = _asyncToGenerator( _regeneratorRuntime().mark(function _callee22(id) { return _regeneratorRuntime().wrap(function _callee22$(_context32) { while (1) { switch (_context32.prev = _context32.next) { case 0: _context32.t1 = JSON; _context32.next = 3; return getStored(id); case 3: _context32.t2 = _context32.sent; if (_context32.t2) { _context32.next = 6; break; } _context32.t2 = '{}'; case 6: _context32.t3 = _context32.t2; _context32.t0 = _context32.t1.parse.call(_context32.t1, _context32.t3); if (_context32.t0) { _context32.next = 10; break; } _context32.t0 = {}; case 10: return _context32.abrupt("return", _context32.t0); case 11: case "end": return _context32.stop(); } } }, _callee22); })); return _getStoredObj.apply(this, arguments); } function saveCfgObj(dm, fn) { getStoredObj('DESU_Config').then(function (val) { var res = fn(val[dm]); if (res) { val[dm] = res; } else { delete val[dm]; } setStored('DESU_Config', JSON.stringify(val)); }); } function saveCfg(id, val) { if (Cfg[id] !== val) { Cfg[id] = val; saveCfgObj(aib.dm, function (cfg) { cfg[id] = val; return cfg; }); } } function toggleCfg(id) { saveCfg(id, +!Cfg[id]); } function readData() { return Promise.all([readFavorites(), readCfg()]); } function readCfg() { return _readCfg.apply(this, arguments); } function _readCfg() { _readCfg = _asyncToGenerator( _regeneratorRuntime().mark(function _callee23() { var obj, val, isGlobal; return _regeneratorRuntime().wrap(function _callee23$(_context33) { while (1) { switch (_context33.prev = _context33.next) { case 0: _context33.next = 2; return getStoredObj('DESU_Config'); case 2: val = _context33.sent; if (!(aib.dm in val) || $isEmpty(obj = val[aib.dm])) { isGlobal = nav.hasGlobalStorage && !!val.global; obj = isGlobal ? val.global : {}; if (isGlobal) { delete obj.correctTime; delete obj.captchaLang; } } defaultCfg.captchaLang = aib.captchaLang; defaultCfg.language = +!String(navigator.language).toLowerCase().startsWith('ru'); Cfg = Object.assign(Object.create(defaultCfg), obj); if (!Cfg.timeOffset) { Cfg.timeOffset = '+0'; } if (!Cfg.timePattern) { Cfg.timePattern = aib.timePattern; } if (aib.dobrochan && !Cfg.useDobrAPI) { aib.JsonBuilder = null; } if (!('FormData' in deWindow)) { Cfg.ajaxPosting = 0; } if (!Cfg.ajaxPosting) { Cfg.fileInputs = 0; } if (!('Notification' in deWindow)) { Cfg.desktNotif = 0; } if (nav.isPresto) { Cfg.preLoadImgs = 0; Cfg.findImgFile = 0; if (!nav.hasOldGM) { Cfg.updDollchan = 0; } Cfg.fileInputs = 0; } if (nav.scriptHandler === 'WebExtension') { 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.dm] = 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); } }, emptyFn); } case 24: case "end": return _context33.stop(); } } }, _callee23); })); 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 updateFav = null; var favBrd = ((_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 _post = post, num = _post.num; if (post.isOp && num in favBrd) { var entry = favBrd[num]; var _post2 = post, thr = _post2.thr; post.toggleFavBtn(true); post.thr.isFav = true; if (aib.t) { entry.cnt = thr.pcount; entry["new"] = entry.you = 0; if (Cfg.markNewPosts && entry.last) { var lastPost = pByNum.get(+entry.last.match(/\d+/)); if (lastPost) { while (lastPost = lastPost.next) { Post.addMark(lastPost.el, true); } } } entry.last = aib.anchor + thr.last.num; } else { entry["new"] = thr.pcount - entry.cnt; } updateFav = [aib.host, aib.b, aib.t, [thr.pcount, 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-pcount').textContent = Thread.first.pcount - Thread.first.hidCounter; } if (updateFav) { saveFavorites(favObj); sendStorageEvent('__de-favorites', updateFav); } 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 hidThrEls = $Q('.de-thr-hid', firstPost.thr.form.el); var hidThrLen = hidThrEls.length; if (hidThrLen) { Pages.addPage(hidThrLen); } } } function readFavorites() { return getStoredObj('DESU_Favorites'); } function saveFavorites(data) { setStored('DESU_Favorites', JSON.stringify(data)); } function readViewedPosts() { if (!Cfg.markViewed) { return; } var data = sesStorage['de-viewed']; if (data) { data.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; } _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 _this6 = this; if (this._cacheTO === null) { this._cacheTO = setTimeout(function () { if (_this6._cachedStorage) { locStorage[_this6.storageName] = JSON.stringify(_this6._cachedStorage); } _this6.purge(); if (_this6._onAfterSave) { _this6._onAfterSave(); } }, 0); } } }]); return PostsStorage; }(); var HiddenPosts = new ( function (_PostsStorage) { _inherits(HiddenPostsClass, _PostsStorage); var _super = _createSuper(HiddenPostsClass); function HiddenPostsClass() { var _this7; _classCallCheck(this, HiddenPostsClass); _this7 = _super.call(this); _this7.storageName = 'de-posts'; return _this7; } _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); } } }]); return HiddenPostsClass; }(PostsStorage))(); var HiddenThreads = new ( function (_PostsStorage2) { _inherits(HiddenThreadsClass, _PostsStorage2); var _super2 = _createSuper(HiddenThreadsClass); function HiddenThreadsClass() { var _this8; _classCallCheck(this, HiddenThreadsClass); _this8 = _super2.call(this); _this8.storageName = 'de-threads'; return _this8; } _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(); } }]); return HiddenThreadsClass; }(PostsStorage))(); var MyPosts = new ( function (_PostsStorage3) { _inherits(MyPostsClass, _PostsStorage3); var _super3 = _createSuper(MyPostsClass); function MyPostsClass() { var _this9; _classCallCheck(this, MyPostsClass); _this9 = _super3.call(this); _this9.storageName = 'de-myposts'; _this9._cachedData = null; _this9._onReadNew = function (newStorage) { _this9._cachedData = newStorage[aib.b] ? new Set(Object.keys(newStorage[aib.b]).map(function (val) { return +val; })) : new Set(); }; _this9._onAfterSave = function () { return sendStorageEvent('__de-mypost', 1); }; return _this9; } _createClass(MyPostsClass, [{ key: "has", value: function has(num) { return this._cachedData.has(num); } }, { key: "update", value: function update() { this.purge(); for (var _iterator2 = _createForOfIteratorHelperLoose(this._cachedData), _step2; !(_step2 = _iterator2()).done;) { var _pByNum$num; var num = _step2.value; (_pByNum$num = pByNum[num]) === null || _pByNum$num === void 0 ? void 0 : _pByNum$num.changeMyMark(true); } } }, { key: "purge", value: function purge() { _get(_getPrototypeOf(MyPostsClass.prototype), "purge", this).call(this); this._cachedData = null; this._readStorage(); } }, { key: "readStorage", value: function readStorage() { this._readStorage(); } }, { key: "set", value: function set(num, thrNum) { _get(_getPrototypeOf(MyPostsClass.prototype), "set", this).call(this, num, thrNum); this._cachedData.add(+num); } }]); return MyPostsClass; }(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': (function () { try { data = JSON.parse(val); } catch (err) { return; } Cfg.hideBySpell = +data.hide; temp = $q('input[info="hideBySpell"]'); if (temp) { temp.checked = data.hide; } $hide(docBody); if (data.data) { Spells.setSpells(data.data, false); Cfg.spells = JSON.stringify(data.data); temp = $id('de-spell-txt'); if (temp) { temp.value = Spells.list; } } else { SpellsRunner.unhideAll(); Spells.disableSpells(); temp = $id('de-spell-txt'); if (temp) { temp.value = ''; } } $show(docBody); })(); } }, false); } var Panel = Object.create({ isVidEnabled: false, initPanel: function initPanel(formEl) { var _pr, _this10 = this; var imgLen = $Q(aib.qPostImg, formEl).length; var isThr = aib.t; (((_pr = pr) === null || _pr === void 0 ? void 0 : _pr.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); ['mouseover', 'mouseout'].forEach(function (e) { return _this10._el.addEventListener(e, _this10); }); this._buttons = $id('de-panel-buttons'); this.isNew = true; }, removeMain: function removeMain() { var _this11 = this; this._el.removeEventListener('click', this, true); ['mouseover', 'mouseout'].forEach(function (e) { return _this11._el.removeEventListener(e, _this11); }); delete this._pcountEl; delete this._icountEl; delete this._acountEl; $id('de-main').remove(); }, handleEvent: function handleEvent(e) { var _this$_menu, _this12 = this; if ('isTrusted' in e && !e.isTrusted) { return; } var el = nav.fixEventEl(e.target); el = el.tagName.toLowerCase() === 'svg' ? el.parentNode : el; switch (e.type) { case 'click': switch (el.id) { case 'de-panel-logo': if (Cfg.expandPanel && !$q('.de-win-active')) { $hide(this._buttons); } toggleCfg('expandPanel'); return; case 'de-panel-cfg': toggleWindow('cfg', false); break; case 'de-panel-hid': toggleWindow('hid', false); break; case 'de-panel-fav': toggleWindow('fav', false); break; case 'de-panel-vid': this.isVidEnabled = !this.isVidEnabled; toggleWindow('vid', false); break; case 'de-panel-refresh': deWindow.location.reload(); break; case 'de-panel-goup': scrollTo(0, 0); break; case 'de-panel-godown': scrollTo(0, docBody.scrollHeight || docBody.offsetHeight); break; case 'de-panel-expimg': el.classList.toggle('de-panel-button-active'); isExpImg = !isExpImg; $del($q('.de-fullimg-center')); for (var post = Thread.first.op; post; post = post.next) { post.toggleImages(isExpImg, false); } break; case 'de-panel-preimg': el.classList.toggle('de-panel-button-active'); isPreImg = !isPreImg; if (!e.ctrlKey) { for (var _iterator3 = _createForOfIteratorHelperLoose(DelForm), _step3; !(_step3 = _iterator3()).done;) { var _el2 = _step3.value.el; ContentLoader.preloadImages(_el2); } } break; case 'de-panel-maskimg': el.classList.toggle('de-panel-button-active'); toggleCfg('maskImgs'); updateCSS(); break; case 'de-panel-upd-on': case 'de-panel-upd-warn': case 'de-panel-upd-off': updater.toggle(); break; case 'de-panel-audio-on': case 'de-panel-audio-off': if (updater.toggleAudio(0)) { updater.enableUpdater(); el.id = 'de-panel-audio-on'; } else { el.id = 'de-panel-audio-off'; } $del($q('.de-menu')); break; case 'de-panel-savethr': break; case 'de-panel-enable': toggleCfg('disabled'); deWindow.location.reload(); break; default: return; } e.preventDefault(); return; case 'mouseover': if (!Cfg.expandPanel) { clearTimeout(this._hideTO); $show(this._buttons); } switch (el.id) { case 'de-panel-cfg': KeyEditListener.setTitle(el, 10); break; case 'de-panel-hid': KeyEditListener.setTitle(el, 7); break; case 'de-panel-fav': KeyEditListener.setTitle(el, 6); break; case 'de-panel-vid': KeyEditListener.setTitle(el, 18); break; case 'de-panel-goback': KeyEditListener.setTitle(el, 4); break; case 'de-panel-gonext': KeyEditListener.setTitle(el, 17); break; case 'de-panel-maskimg': KeyEditListener.setTitle(el, 9); break; case 'de-panel-refresh': if (aib.t) { return; } case 'de-panel-savethr': case 'de-panel-audio-off': if (((_this$_menu = this._menu) === null || _this$_menu === void 0 ? void 0 : _this$_menu.parentEl) === el) { return; } this._menuTO = setTimeout(function () { _this12._menu = addMenu(el); _this12._menu.onover = function () { return clearTimeout(_this12._hideTO); }; _this12._menu.onout = function () { return _this12._prepareToHide(null); }; _this12._menu.onremove = function () { return _this12._menu = null; }; }, Cfg.linksOver); } return; default: this._prepareToHide(nav.fixEventEl(e.relatedTarget)); switch (el.id) { case 'de-panel-refresh': case 'de-panel-savethr': case 'de-panel-audio-off': clearTimeout(this._menuTO); this._menuTO = 0; } } }, updateCounter: function updateCounter(postCount, imgsCount, postersCount) { this._pcountEl.textContent = postCount; this._icountEl.textContent = imgsCount; this._acountEl.textContent = postersCount; this.isNew = false; }, _el: null, _hideTO: 0, _menu: null, _menuTO: 0, get _acountEl() { var value = $id('de-panel-info-acount'); Object.defineProperty(this, '_acountEl', { value: value, configurable: true }); return value; }, get _icountEl() { var value = $id('de-panel-info-icount'); Object.defineProperty(this, '_icountEl', { value: value, configurable: true }); return value; }, get _pcountEl() { var value = $id('de-panel-info-pcount'); Object.defineProperty(this, '_pcountEl', { value: value, configurable: true }); return value; }, _getButton: function _getButton(id) { var page, href, title, useId; switch (id) { case 'goback': 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': 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': href = aib.catalogUrl; } return "
\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"); }, _prepareToHide: function _prepareToHide(rt) { var _this13 = this; if (!Cfg.expandPanel && !$q('.de-win-active') && (!rt || !this._el.contains(rt.farthestViewportElement || rt))) { this._hideTO = setTimeout(function () { return $hide(_this13._buttons); }, 500); } } }); function updateWinZ(style) { if (style.zIndex < topWinZ) { style.zIndex = ++topWinZ; } } function makeDraggable(name, win, head) { head.addEventListener('mousedown', { _oldX: 0, _oldY: 0, _win: win, _wStyle: win.style, _X: 0, _Y: 0, _Z: 0, handleEvent: function handleEvent(e) { var _this14 = this; if (!Cfg[name + 'WinDrag']) { return; } var curX = e.clientX, curY = e.clientY; switch (e.type) { case 'mousedown': this._oldX = curX; this._oldY = curY; this._X = Cfg[name + 'WinX']; this._Y = Cfg[name + 'WinY']; if (this._Z < topWinZ) { this._Z = this._wStyle.zIndex = ++topWinZ; } ['mouseleave', 'mousemove', 'mouseup'].forEach(function (e) { return docBody.addEventListener(e, _this14); }); e.preventDefault(); return; case 'mousemove': { var maxX = Post.sizing.wWidth - this._win.offsetWidth; var maxY = Post.sizing.wHeight - this._win.offsetHeight - 25; var cr = this._win.getBoundingClientRect(); var x = cr.left + curX - this._oldX; var y = cr.top + curY - this._oldY; this._X = x >= maxX || curX > this._oldX && x > maxX - 20 ? 'right: 0' : x < 0 || curX < this._oldX && x < 20 ? 'left: 0' : "left: ".concat(x, "px"); this._Y = y >= maxY || curY > this._oldY && y > maxY - 20 ? 'bottom: 25px' : y < 0 || curY < this._oldY && y < 20 ? 'top: 0' : "top: ".concat(y, "px"); var width = this._wStyle.width; this._win.setAttribute('style', "".concat(this._X, "; ").concat(this._Y, "; z-index: ").concat(this._Z).concat(width ? '; width: ' + width : '')); this._oldX = curX; this._oldY = curY; return; } case 'mouseleave': case 'mouseup': ['mouseleave', 'mousemove', 'mouseup'].forEach(function (e) { return docBody.removeEventListener(e, _this14); }); saveCfg(name + 'WinX', this._X); saveCfg(name + 'WinY', this._Y); } } }); } var WinResizer = function () { function WinResizer(name, dir, cfgName, win, target) { _classCallCheck(this, WinResizer); this.name = name; this.dir = dir; this.cfgName = cfgName; this.vertical = dir === 'top' || dir === 'bottom'; this.win = win; this.wStyle = this.win.style; this.tStyle = target.style; $q('.de-resizer-' + dir, win).addEventListener('mousedown', this); } _createClass(WinResizer, [{ key: "handleEvent", value: function handleEvent(e) { var _this15 = this; var val, x, y; var _Post$sizing = Post.sizing, maxX = _Post$sizing.wWidth, maxY = _Post$sizing.wHeight; var width = this.wStyle.width; var cr = this.win.getBoundingClientRect(); var z = "; z-index: ".concat(this.wStyle.zIndex).concat(width ? '; width:' + width : ''); switch (e.type) { case 'mousedown': if (this.win.classList.contains('de-win-fixed')) { x = 'right: 0'; y = 'bottom: 25px'; } else { x = Cfg[this.name + 'WinX']; y = Cfg[this.name + 'WinY']; } switch (this.dir) { case 'top': val = "".concat(x, "; bottom: ").concat(maxY - cr.bottom, "px").concat(z); break; case 'bottom': val = "".concat(x, "; top: ").concat(cr.top, "px").concat(z); break; case 'left': val = "right: ".concat(maxX - cr.right, "px; ").concat(y + z); break; case 'right': val = "left: ".concat(cr.left, "px; ").concat(y + z); } this.win.setAttribute('style', val); ['mousemove', 'mouseup'].forEach(function (e) { return docBody.addEventListener(e, _this15); }); e.preventDefault(); return; case 'mousemove': if (this.vertical) { val = e.clientY; this.tStyle.setProperty('height', Math.max(parseInt(this.tStyle.height, 10) + (this.dir === '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.dir === 'left' ? cr.left - (val < 20 ? 0 : val) : (val > maxX - 20 ? maxX : val) - cr.right), this.name === 'reply' ? 275 : 400) + 'px', 'important'); } return; default: ['mousemove', 'mouseup'].forEach(function (e) { return docBody.removeEventListener(e, _this15); }); saveCfg(this.cfgName, parseInt(this.vertical ? this.tStyle.height : this.tStyle.width, 10)); if (this.win.classList.contains('de-win-fixed')) { this.win.setAttribute('style', 'right: 0; bottom: 25px' + z); return; } if (this.vertical) { saveCfg(this.name + 'WinY', cr.top < 1 ? 'top: 0' : cr.bottom > maxY - 26 ? 'bottom: 25px' : "top: ".concat(cr.top, "px")); } else { saveCfg(this.name + 'WinX', cr.left < 1 ? 'left: 0' : cr.right > maxX - 1 ? 'right: 0' : "left: ".concat(cr.left, "px")); } this.win.setAttribute('style', Cfg[this.name + 'WinX'] + '; ' + Cfg[this.name + 'WinY'] + z); } } }]); return WinResizer; }(); function toggleWindow(name, isUpdate, data, noAnim) { var _win; var el; var win = $id('de-win-' + name); var isActive = (_win = win) === null || _win === void 0 ? void 0 : _win.classList.contains('de-win-active'); if (isUpdate && !isActive) { return; } if (!win) { 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; ")); win = $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', win); if (name === 'cfg') { winBody.className = 'de-win-body ' + aib.cReply; } else { setTimeout(function () { var backColor = getComputedStyle(docBody).getPropertyValue('background-color'); winBody.style.backgroundColor = backColor !== 'transparent' ? backColor : '#EEE'; }, 100); } if (name === 'fav') { new WinResizer('fav', 'left', 'favWinWidth', win, win); new WinResizer('fav', 'right', 'favWinWidth', win, win); } el = $q('.de-win-buttons', win); el.onmouseover = function (e) { var el = nav.fixEventEl(e.target); var parent = el.parentNode; switch (el.classList[0]) { case 'de-win-btn-close': parent.title = Lng.closeWindow[lang]; break; case 'de-win-btn-toggle': parent.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 = function () { toggleCfg(name + 'WinDrag'); var isDrag = Cfg[name + 'WinDrag']; if (!isDrag) { var temp = $q('.de-win-active.de-win-fixed', win.parentNode); if (temp) { toggleWindow(temp.id.substr(7), false); } } win.classList.toggle('de-win', isDrag); win.classList.toggle('de-win-fixed', !isDrag); var width = win.style.width; win.style.cssText = "".concat(isDrag ? "".concat(Cfg[name + 'WinX'], "; ").concat(Cfg[name + 'WinY']) : 'right: 0; bottom: 25px').concat(width ? '; width: ' + width : ''); updateWinZ(win.style); }; makeDraggable(name, win, $q('.de-win-head', win)); } updateWinZ(win.style); var isRemove = !isUpdate && isActive; if (!isRemove && !win.classList.contains('de-win') && (el = $q(".de-win-active.de-win-fixed:not(#de-win-".concat(name, ")"), win.parentNode))) { toggleWindow(el.id.substr(7), false); } var isAnim = !noAnim && !isUpdate && Cfg.animation; var body = $q('.de-win-body', win); if (isAnim && body.hasChildNodes()) { win.addEventListener('animationend', function aEvent(e) { e.target.removeEventListener('animationend', aEvent); showWindow(win, body, name, isRemove, data, Cfg.animation); win = body = name = isRemove = data = null; }); win.classList.remove('de-win-open'); win.classList.add('de-win-close'); } else { showWindow(win, body, name, isRemove, data, isAnim); } } function showWindow(win, body, name, isRemove, data, isAnim) { body.innerHTML = ''; win.classList.toggle('de-win-active', !isRemove); if (isRemove) { win.classList.remove('de-win-close'); $hide(win); 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(body, data); break; } readFavorites().then(function (favObj) { showFavoritesWindow(body, favObj); $show(win); if (isAnim) { win.classList.add('de-win-open'); } }); return; case 'cfg': CfgWindow.initCfgWindow(body); break; case 'hid': showHiddenWindow(body); break; case 'vid': showVideosWindow(body); } $show(win); if (isAnim) { win.classList.add('de-win-open'); } } function showVideosWindow(body) { var els = $Q('.de-video-link'); if (!els.length) { body.innerHTML = "".concat(Lng.noVideoLinks[lang], ""); return; } if (!$id('de-ytube-api')) { var _script = doc.createElement('script'); _script.type = 'text/javascript'; _script.src = aib.prot + '//www.youtube.com/player_api'; _script.id = 'de-ytube-api'; doc.head.append(_script); } body.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})();"; body.append(script); body.addEventListener('click', { linkList: linkList, currentLink: null, listHidden: false, player: body.firstElementChild, playerInfo: null, handleEvent: function handleEvent(e) { var el = e.target; if (el.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 (!el.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; el.classList.add('de-current'); Videos.addPlayer(this, info, el.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); } body.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(body) { var boards = HiddenThreads.getRawData(); var hasThreads = !$isEmpty(boards); if (hasThreads) { var _loop = function _loop(board) { if (!$hasProp(boards, board)) { return "continue"; } var threads = boards[board]; if ($isEmpty(threads)) { return "continue"; } var block = $bEnd(body, "
/".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
")); } } }; for (var board in boards) { var _ret = _loop(board); if (_ret === "continue") continue; } } $bEnd(body, (!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.clrDeleted[lang], function () { var _ref = _asyncToGenerator( _regeneratorRuntime().mark(function _callee(e) { var els, _loop2, i, len; return _regeneratorRuntime().wrap(function _callee$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: els = $Q('.de-entry[info]', e.target.parentNode.parentNode); _loop2 = _regeneratorRuntime().mark(function _loop2(i, len) { var _els$i$getAttribute$s, _els$i$getAttribute$s2, board, tNum; return _regeneratorRuntime().wrap(function _loop2$(_context) { while (1) { switch (_context.prev = _context.next) { 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]; _context.next = 3; return $ajax(aib.getThrUrl(board, tNum))["catch"](function (err) { if (err.code === 404) { HiddenThreads.removeStorage(tNum, board); HiddenPosts.removeStorage(tNum, board); } }); case 3: case "end": return _context.stop(); } } }, _loop2); }); i = 0, len = els.length; case 3: if (!(i < len)) { _context2.next = 8; break; } return _context2.delegateYield(_loop2(i, len), "t0", 5); case 5: ++i; _context2.next = 3; break; case 8: toggleWindow('hid', true); case 9: case "end": return _context2.stop(); } } }, _callee); })); return function (_x5) { return _ref.apply(this, arguments); }; }()), $button(Lng.remove[lang], Lng.delEntries[lang], function () { $Q('.de-entry[info]', body).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, _favObj$aib$host2$aib; var entry = (_favObj$aib$host2 = favObj[aib.host]) === null || _favObj$aib$host2 === void 0 ? void 0 : (_favObj$aib$host2$aib = _favObj$aib$host2[aib.b]) === null || _favObj$aib$host2$aib === void 0 ? void 0 : _favObj$aib$host2$aib[num]; if (!entry) { return; } var isUpdate = false; switch (mode) { case 'error': if (entry.err !== value) { isUpdate = true; } entry.err = value; break; case 'update': if (entry.cnt !== value[0]) { isUpdate = true; } entry.cnt = value[0]; entry["new"] = entry.you = 0; entry.last = aib.anchor + value[1]; } 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 _ref2 = _toConsumableArray(el.children), iconEl = _ref2[0], youEl = _ref2[1], newEl = _ref2[2], oldEl = _ref2[3]; $hide(youEl); $hide(newEl); if (mode === 'error') { iconEl.firstElementChild.setAttribute('class', 'de-fav-inf-icon de-fav-unavail'); iconEl.title = value; return; } youEl.textContent = 0; newEl.textContent = 0; oldEl.textContent = value[0]; } function cleanFavorites() { var els = $Q('.de-entry[de-removed]'); var len = els.length; if (!len) { return; } readFavorites().then(function (favObj) { for (var i = 0; i < len; ++i) { var el = els[i]; var host = el.getAttribute('de-host'); var board = el.getAttribute('de-board'); var num = +el.getAttribute('de-num'); removeFavEntry(favObj, host, board, num); toggleThrFavBtn(host, board, num, false); } saveRenewFavorites(favObj); }); } function showFavoritesWindow(body, 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(body, "
".concat(html, "
")).addEventListener('click', function (e) { var el = nav.fixEventEl(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.getAttribute('de-checked') === ''; var toggleFn = function toggleFn(btnEl) { return $toggleAttr(btnEl, '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]', body); $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 { body.insertAdjacentHTML('beforeend', "
".concat(Lng.noFavThr[lang], "
")); } var btns = $bEnd(body, '
'); btns.append( getEditButton('favor', function (fn) { return readFavorites().then(function (favObj) { return fn(favObj, true, saveRenewFavorites); }); }), $button(Lng.refresh[lang], Lng.infoCount[lang], _asyncToGenerator( _regeneratorRuntime().mark(function _callee2() { var favObj, isUpdate, last404, myposts, els, _i2, _len2, el, _host, _board, num, _entry, _ref4, titleEl, youEl, countEl, iconEl, form, isArchived, _yield$ajaxLoad, _yield$ajaxLoad2, posts, cnt, j, links, a, _len3, tc; return _regeneratorRuntime().wrap(function _callee2$(_context3) { while (1) { switch (_context3.prev = _context3.next) { case 0: _context3.next = 2; return readFavorites(); case 2: favObj = _context3.sent; if (favObj[aib.host]) { _context3.next = 5; break; } return _context3.abrupt("return"); case 5: isUpdate = false; last404 = false; myposts = JSON.parse(locStorage['de-myposts'] || '{}'); els = $Q('.de-entry'); _i2 = 0, _len2 = els.length; case 10: if (!(_i2 < _len2)) { _context3.next = 64; break; } el = els[_i2]; _host = el.getAttribute('de-host'); _board = el.getAttribute('de-board'); num = el.getAttribute('de-num'); _entry = favObj[_host][_board][num]; if (!(_host !== aib.host || _entry.err === 'Closed' || _entry.err === 'Archived')) { _context3.next = 18; break; } return _context3.abrupt("continue", 61); case 18: _ref4 = _toConsumableArray(el.lastElementChild.children), titleEl = _ref4[0], youEl = _ref4[1], countEl = _ref4[2]; iconEl = titleEl.firstElementChild; iconEl.setAttribute('class', 'de-fav-inf-icon de-fav-wait'); titleEl.title = Lng.updating[lang]; form = void 0, isArchived = void 0; _context3.prev = 23; if (aib.hasArchive) { _context3.next = 30; break; } _context3.next = 27; return ajaxLoad(aib.getThrUrl(_board, num)); case 27: form = _context3.sent; _context3.next = 36; break; case 30: _context3.next = 32; return ajaxLoad(aib.getThrUrl(_board, num), true, false, true); case 32: _yield$ajaxLoad = _context3.sent; _yield$ajaxLoad2 = _slicedToArray(_yield$ajaxLoad, 2); form = _yield$ajaxLoad2[0]; isArchived = _yield$ajaxLoad2[1]; case 36: last404 = false; _context3.next = 56; break; case 39: _context3.prev = 39; _context3.t0 = _context3["catch"](23); if (!(_context3.t0 instanceof AjaxError && _context3.t0.code === 404)) { _context3.next = 49; break; } if (!last404) { _context3.next = 46; break; } Thread.removeSavedData(_board, num); _context3.next = 49; break; case 46: last404 = true; --_i2; return _context3.abrupt("continue", 61); case 49: last404 = false; $hide(countEl); $hide(youEl); iconEl.setAttribute('class', 'de-fav-inf-icon de-fav-unavail'); _entry.err = titleEl.title = getErrorMessage(_context3.t0); isUpdate = true; return _context3.abrupt("continue", 61); case 56: if (aib.qClosed && $q(aib.qClosed, form)) { 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; } } posts = $Q(aib.qPost, form); cnt = posts.length + 1 - _entry.cnt; countEl.textContent = cnt; if (cnt === 0) { $hide(countEl); $hide(youEl); } else { $show(countEl); _entry["new"] = cnt; isUpdate = true; if (myposts !== null && myposts !== void 0 && myposts[_board]) { _entry.you = 0; for (j = 0; j < cnt; ++j) { links = $Q(aib.qPostMsg.split(', ').join(' a, ') + ' a', posts[posts.length - 1 - j]); for (a = 0, _len3 = links.length; a < _len3; ++a) { tc = links[a].textContent; if (tc[0] === '>' && tc[1] === '>' && myposts[_board][tc.substr(2)]) { _entry.you++; } } } if (_entry.you) { youEl.textContent = _entry.you; $show(youEl); } } } case 61: ++_i2; _context3.next = 10; break; case 64: AjaxCache.clearCache(); if (isUpdate) { saveFavorites(favObj); } case 66: case "end": return _context3.stop(); } } }, _callee2, null, [[23, 39]]); }))), $button(Lng.page[lang], Lng.infoPage[lang], _asyncToGenerator( _regeneratorRuntime().mark(function _callee3() { var els, len, thrInfo, _i3, el, iconEl, titleEl, endPage, infoLoaded, updateInf, page, _tNums, form, _els, _i4, _len4, _i5, inf, _i6, _inf; return _regeneratorRuntime().wrap(function _callee3$(_context4) { while (1) { switch (_context4.prev = _context4.next) { case 0: els = $Q('.de-fav-current > .de-fav-entries > .de-entry'); len = els.length; if (len) { _context4.next = 4; break; } return _context4.abrupt("return"); case 4: $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); $toggleAttr(inf.titleEl, 'title', inf.iconTitle, inf.iconTitle); inf.pageEl.textContent = '@' + page; }; page = 0; case 11: if (!(page < endPage)) { _context4.next = 30; break; } _tNums = new Set(); _context4.prev = 13; _context4.next = 16; return ajaxLoad(aib.getPageUrl(aib.b, page)); case 16: form = _context4.sent; _els = DelForm.getThreads(form); for (_i4 = 0, _len4 = _els.length; _i4 < _len4; ++_i4) { _tNums.add(aib.getTNum(_els[_i4])); } _context4.next = 24; break; case 21: _context4.prev = 21; _context4.t0 = _context4["catch"](13); return _context4.abrupt("continue", 27); case 24: for (_i5 = 0; _i5 < len; ++_i5) { inf = thrInfo[_i5]; if (_tNums.has(inf.num)) { updateInf(inf, page); inf.found = true; infoLoaded++; } } if (!(infoLoaded === len)) { _context4.next = 27; break; } return _context4.abrupt("break", 30); case 27: ++page; _context4.next = 11; break; case 30: for (_i6 = 0; _i6 < len; ++_i6) { _inf = thrInfo[_i6]; if (!_inf.found) { updateInf(_inf, '?'); } } closePopup('load-pages'); case 32: case "end": return _context4.stop(); } } }, _callee3, null, [[13, 21]]); }))), $button(Lng.clear[lang], Lng.clrDeleted[lang], _asyncToGenerator( _regeneratorRuntime().mark(function _callee4() { var last404, els, parent, _loop3, _i7, _len5; return _regeneratorRuntime().wrap(function _callee4$(_context6) { while (1) { switch (_context6.prev = _context6.next) { case 0: last404 = false; els = $Q('.de-entry'); parent = $q('.de-fav-table'); parent.classList.add('de-fav-table-unfold'); _loop3 = _regeneratorRuntime().mark(function _loop3(_i8, _len5) { var el, iconEl, titleEl; return _regeneratorRuntime().wrap(function _loop3$(_context5) { while (1) { switch (_context5.prev = _context5.next) { case 0: el = els[_i8]; iconEl = $q('.de-fav-inf-icon', el); titleEl = iconEl.parentNode; iconEl.setAttribute('class', 'de-fav-inf-icon de-fav-wait'); titleEl.title = Lng.updating[lang]; _context5.next = 7; return $ajax(el.getAttribute('de-url'), null, true).then(function (xhr) { switch (el.getAttribute('de-host')) { case '2ch.hk': case '2ch.pm': { var dc = $createDoc(xhr.responseText); if (dc && $q('.message-title', dc)) { throw new AjaxError(404, 'Error'); } } } iconEl.setAttribute('class', 'de-fav-inf-icon'); titleEl.removeAttribute('title'); last404 = false; })["catch"](function (err) { if (err.code === 404) { if (!last404) { last404 = true; --_i8; _i7 = _i8; return; } Thread.removeSavedData(el.getAttribute('de-board'), +el.getAttribute('de-num')); el.setAttribute('de-removed', ''); } iconEl.setAttribute('class', 'de-fav-inf-icon de-fav-unavail'); titleEl.title = getErrorMessage(err); last404 = false; }); case 7: _i7 = _i8; case 8: case "end": return _context5.stop(); } } }, _loop3); }); _i7 = 0, _len5 = els.length; case 6: if (!(_i7 < _len5)) { _context6.next = 11; break; } return _context6.delegateYield(_loop3(_i7, _len5), "t0", 8); case 8: ++_i7; _context6.next = 6; break; case 11: cleanFavorites(); parent.classList.remove('de-fav-table-unfold'); case 13: case "end": return _context6.stop(); } } }, _callee4); })))); var delBtns = $bEnd(body, ''); delBtns.append($button(Lng.remove[lang], Lng.delEntries[lang], function () { $Q('.de-entry > .de-fav-del-btn[de-checked]', body).forEach(function (el) { return el.parentNode.setAttribute('de-removed', ''); }); cleanFavorites(); $show(btns); $hide(delBtns); }), $button(Lng.cancel[lang], '', function () { $Q('.de-fav-del-btn', body).forEach(function (el) { return el.removeAttribute('de-checked'); }); $show(btns); $hide(delBtns); })); } var CfgWindow = { initCfgWindow: function initCfgWindow(body) { var _this16 = this; ['click', 'mouseover', 'mouseout', 'change', 'keyup', 'keydown', 'scroll'].forEach(function (e) { return body.addEventListener(e, _this16); }); var div = $bEnd(body, "
".concat(this._getTab('filters') + this._getTab('posts') + this._getTab('images') + this._getTab('links') + (pr.form || pr.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 (data) { saveCfgObj(aib.dm, function () { return data; }); deWindow.location.reload(); }); }), 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 = function () { return getStoredObj('DESU_Config').then(function (data) { if (data && 'global' in data && !$isEmpty(data.global)) { saveCfgObj(aib.dm, function () { return data.global; }); deWindow.location.reload(); } else { $popup('err-noglobalcfg', Lng.noGlobalCfg[lang]); } }); }; div = $bEnd(el, "
").concat(Lng.saveGlobal[lang], "
")).firstElementChild.onclick = function () { return getStoredObj('DESU_Config').then(function (data) { var obj = {}; var com = data[aib.dm]; for (var 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; saveCfgObj('global', function () { return data.global; }); toggleWindow('cfg', true); }); }; el.insertAdjacentHTML('beforeend', "
".concat(Lng.descrGlobal[lang], "")); }) : '', !nav.isPresto ? $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.dm, ")"), Lng.myPosts[lang] + " (".concat(aib.dm, ")")]); $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 (_ref7) { var data = _ref7.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, dmObj = _obj[aib.dm]; var isOldCfg = !cfgObj && !favObj && !dmObj; 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 (dmObj) { if (dmObj.posts) { locStorage['de-posts'] = JSON.stringify(dmObj.posts); } if (dmObj.threads) { locStorage['de-threads'] = JSON.stringify(dmObj.threads); } if (dmObj.myposts) { locStorage['de-myposts'] = JSON.stringify(dmObj.myposts); } } if (cfgObj || dmObj || 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 _ref8 = _asyncToGenerator( _regeneratorRuntime().mark(function _callee5(e) { var name, nameDm, d, val, valDm, i, len, cfgData; return _regeneratorRuntime().wrap(function _callee5$(_context7) { while (1) { switch (_context7.prev = _context7.next) { case 0: name = []; nameDm = []; d = new Date(); val = []; valDm = []; i = 0, len = els.length; case 6: if (!(i < len)) { _context7.next = 38; break; } if (els[i].checked) { _context7.next = 9; break; } return _context7.abrupt("continue", 35); case 9: _context7.t0 = i; _context7.next = _context7.t0 === 0 ? 12 : _context7.t0 === 1 ? 18 : _context7.t0 === 2 ? 30 : _context7.t0 === 3 ? 33 : 35; break; case 12: name.push('Cfg'); _context7.next = 15; return Promise.all([getStored('DESU_Config'), getStored('DESU_keys')]); case 15: cfgData = _context7.sent; val.push("\"settings\":".concat(cfgData[0]), "\"hotkeys\":".concat(cfgData[1] || '""')); return _context7.abrupt("break", 35); case 18: name.push('Fav'); _context7.t1 = val; _context7.t2 = "\"favorites\":"; _context7.next = 23; return getStored('DESU_Favorites'); case 23: _context7.t3 = _context7.sent; if (_context7.t3) { _context7.next = 26; break; } _context7.t3 = '{}'; case 26: _context7.t4 = _context7.t3; _context7.t5 = _context7.t2.concat.call(_context7.t2, _context7.t4); _context7.t1.push.call(_context7.t1, _context7.t5); return _context7.abrupt("break", 35); case 30: nameDm.push('Hid'); valDm.push("\"posts\":".concat(locStorage['de-posts'] || '{}'), "\"threads\":".concat(locStorage['de-threads'] || '{}')); return _context7.abrupt("break", 35); case 33: nameDm.push('You'); valDm.push("\"myposts\":".concat(locStorage['de-myposts'] || '{}')); case 35: ++i; _context7.next = 6; break; case 38: if (valDm = valDm.join(',')) { val.push("\"".concat(aib.dm, "\":{").concat(valDm, "}")); name.push("".concat(aib.dm, " (").concat(nameDm.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 41: case "end": return _context7.stop(); } } }, _callee5); })); return function (_x6) { return _ref8.apply(this, arguments); }; }(), true); }) : '', $button(Lng.reset[lang] + '…', Lng.resetCfg[lang], function () { return $popup('cfg-reset', "".concat(Lng.resetData[lang], ":
") + "
".concat(aib.dm, ":").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.dm]; 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 type = e.type, el = e.target; var tag = el.tagName; if (type === 'click' && tag === 'DIV' && el.classList.contains('de-cfg-tab')) { var info = el.getAttribute('info'); this._clickTab(info); saveCfg('cfgTab', info); } if (type === 'change' && tag === 'SELECT') { var _info = el.getAttribute('info'); saveCfg(_info, el.selectedIndex); this._updateDependant(); switch (_info) { case 'language': lang = el.selectedIndex; Panel.removeMain(); if (pr.form) { pr.addMarkupPanel(); pr.setPlaceholders(); pr.updateLanguage(); aib.updateSubmitBtn(pr.subm); if (pr.files) { $Q('.de-file-img, .de-file-txt-input', pr.form).forEach(function (el) { return el.title = Lng.youCanDrag[lang]; }); } } this._updateCSS(); Panel.initPanel(DelForm.first.el); toggleWindow('cfg', false); break; case 'delHiddPost': { var isHide = Cfg.delHiddPost === 1 || Cfg.delHiddPost === 2; for (var post = Thread.first.op; post; post = post.next) { if (post.isHidden && !post.isOp) { post.wrap.classList.toggle('de-hidden', isHide); } } updateCSS(); break; } case 'postBtnsCSS': updateCSS(); if (nav.isPresto) { $q('.de-svg-icons').remove(); addSVGIcons(); } break; case 'thrBtns': case 'noSpoilers': case 'resizeImgs': updateCSS(); break; case 'expandImgs': updateCSS(); AttachedImage.closeImg(); break; case 'imgNames': if (Cfg.imgNames) { for (var _iterator4 = _createForOfIteratorHelperLoose(DelForm), _step4; !(_step4 = _iterator4()).done;) { var _el3 = _step4.value.el; processImgInfoLinks(_el3, 0, Cfg.imgNames); } } else { $Q('.de-img-name').forEach(function (el) { return el.textContent = el.getAttribute('de-img-name-old'); }); } updateCSS(); break; case 'fileInputs': pr.files.changeMode(); pr.setPlaceholders(); updateCSS(); break; case 'addPostForm': pr.isBottom = Cfg.addPostForm === 1; pr.setReply(false, !aib.t || Cfg.addPostForm > 1); break; case 'addTextBtns': pr.addMarkupPanel(); case 'scriptStyle': case 'panelCounter': this._updateCSS(); break; case 'favThrOrder': readFavorites().then(function (favObj) { var body = $q('#de-win-fav > .de-win-body'); body.innerHTML = ''; showFavoritesWindow(body, favObj); }); } return; } if (type === 'click' && tag === 'INPUT' && el.type === 'checkbox') { var _info2 = el.getAttribute('info'); toggleCfg(_info2); this._updateDependant(); switch (_info2) { case 'expandTrunc': case 'widePosts': case 'showHideBtn': case 'showRepBtn': case 'noPostNames': case 'imgNavBtns': case 'strikeHidd': case 'removeHidd': case 'noBoardRule': case 'userCSS': updateCSS(); break; case 'hideBySpell': Spells.toggle(); break; case 'sortSpells': if (Cfg.sortSpells) { Spells.toggle(); } break; case 'hideRefPsts': for (var _post3 = Thread.first.op; _post3; _post3 = _post3.next) { if (!Cfg.hideRefPsts) { _post3.ref.unhideRef(); } else if (_post3.isHidden) { _post3.ref.hideRef(); } } break; case 'ajaxUpdThr': if (aib.t) { if (Cfg.ajaxUpdThr) { updater.enableUpdater(); } else { updater.disableUpdater(); } } break; case 'updCount': updater.toggleCounter(Cfg.updCount); break; case 'desktNotif': if (Cfg.desktNotif) { Notification.requestPermission(); } break; case 'markNewPosts': Post.clearMarks(); break; case 'useDobrAPI': aib.JsonBuilder = Cfg.useDobrAPI ? DobrochanPostsBuilder : null; break; case 'markMyPosts': case 'markMyLinks': if (!Cfg.markMyPosts && !Cfg.markMyLinks) { locStorage.removeItem('de-myposts'); MyPosts.purge(); } updateCSS(); break; case 'correctTime': DateTime.toggleSettings(el); break; case 'imgInfoLink': { var img = $q('.de-fullimg-wrap'); if (img) { img.click(); } updateCSS(); break; } case 'imgSrcBtns': if (Cfg.imgSrcBtns) { for (var _iterator5 = _createForOfIteratorHelperLoose(DelForm), _step5; !(_step5 = _iterator5()).done;) { var _el4 = _step5.value.el; processImgInfoLinks(_el4, 1, 0); $Q('.de-img-embed').forEach(function (el) { return addImgButtons(el.parentNode.nextSibling.nextSibling); }); } } else { $delAll('.de-btn-img'); } break; case 'addSageBtn': PostForm.hideField(pr.mail.closest('label') || pr.mail); setTimeout(function () { return pr.toggleSage(); }, 0); updateCSS(); break; case 'altCaptcha': pr.cap.initCapPromise(); break; case 'txtBtnsLoc': pr.addMarkupPanel(); updateCSS(); break; case 'userPassw': PostForm.setUserPassw(); break; case 'userName': PostForm.setUserName(); break; case 'noPassword': $toggle(pr.passw.closest(aib.qFormTr)); break; case 'noName': PostForm.hideField(pr.name); break; case 'noSubj': PostForm.hideField(pr.subj); break; case 'inftyScroll': toggleInfinityScroll(); break; case 'hotKeys': if (Cfg.hotKeys) { HotKeys.enableHotKeys(); } else { HotKeys.disableHotKeys(); } } return; } if (type === 'click' && tag === 'INPUT' && el.type === 'button') { switch (el.id) { case 'de-cfg-button-pass': $q('input[info="passwValue"]').value = Math.round(Math.random() * 1e12).toString(32); PostForm.setUserPassw(); break; case 'de-cfg-button-keys': e.preventDefault(); if ($id('de-popup-edit-hotkeys')) { return; } 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); }); }); break; case 'de-cfg-button-updnow': $popup('updavail', Lng.loading[lang], true); getStoredObj('DESU_Config').then(function (data) { return checkForUpdates(true, data.lastUpd); }).then(function (html) { return $popup('updavail', html); }, emptyFn); break; case 'de-cfg-button-donate': showDonateMsg(); break; case 'de-cfg-button-debug': { var perf = {}; var arr = Logger.getLogData(true); for (var i = 0, len = arr.length; i < len; ++i) { perf[arr[i][0]] = arr[i][1]; } $popup('cfg-debug', Lng.infoDebug[lang] + ':').firstElementChild.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'); } } } if (type === 'keyup' && tag === 'INPUT' && el.type === 'text') { var _info3 = el.getAttribute('info'); switch (_info3) { case 'postBtnsBack': { var isCheck = checkCSSColor(el.value); el.classList.toggle('de-input-error', !isCheck); if (isCheck) { saveCfg('postBtnsBack', el.value); updateCSS(); } break; } case 'limitPostMsg': saveCfg('limitPostMsg', Math.max(+el.value || 0, 50)); updateCSS(); break; case 'minImgSize': saveCfg('minImgSize', Math.max(+el.value, 1)); break; case 'zoomFactor': saveCfg('zoomFactor', Math.min(Math.max(+el.value, 1), 100)); break; case 'webmVolume': { var val = Math.min(+el.value || 0, 100); saveCfg('webmVolume', val); sendStorageEvent('__de-webmvolume', val); break; } case 'minWebmWidth': saveCfg('minWebmWidth', Math.max(+el.value, Cfg.minImgSize)); break; case 'maskVisib': saveCfg('maskVisib', Math.min(+el.value || 0, 100)); updateCSS(); break; case 'linksOver': saveCfg('linksOver', +el.value | 0); break; case 'linksOut': saveCfg('linksOut', +el.value | 0); break; case 'ytApiKey': saveCfg('ytApiKey', el.value.trim()); break; case 'passwValue': PostForm.setUserPassw(); break; case 'nameValue': PostForm.setUserName(); break; default: saveCfg(_info3, el.value); } return; } if (tag === 'A') { if (el.id === 'de-btn-spell-add') { switch (e.type) { case 'click': e.preventDefault(); break; case 'mouseover': el.odelay = setTimeout(function () { return addMenu(el); }, Cfg.linksOver); break; case 'mouseout': clearTimeout(el.odelay); } return; } if (type === 'click') { switch (el.id) { case 'de-btn-spell-apply': e.preventDefault(); saveCfg('hideBySpell', 1); $q('input[info="hideBySpell"]').checked = true; Spells.toggle(); break; case 'de-btn-spell-clear': e.preventDefault(); if (!confirm(Lng.clear[lang] + '?')) { return; } $id('de-spell-txt').value = ''; Spells.toggle(); } } return; } if (tag === 'TEXTAREA' && el.id === 'de-spell-txt' && (type === 'keydown' || type === 'scroll')) { this._updateRowMeter(el); } }, _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 (inputEl) { saveCfg('userCSSTxt', inputEl.value); updateCSS(); toggleWindow('cfg', true); }); }, '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 _el5 = els[i]; var _info4 = _el5.getAttribute('info'); if (_el5.tagName === 'INPUT') { if (_el5.type === 'checkbox') { _el5.checked = !!Cfg[_info4]; } else { _el5.value = Cfg[_info4]; } } else { _el5.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\t").concat(aib.dobrochan ? this._getBox('useDobrAPI') : '', "\n\t\t\t\t
"), "\n\t\t\t").concat(this._getBox('markMyPosts'), "
\n\t\t\t").concat(!localData ? "".concat(this._getBox('expandTrunc'), "
") : '', "\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'), "\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'), "
\n\t\t\t\t").concat(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(nav.isPresto ? '' : this._getSel('preLoadImgs') + '
', "\n\t\t\t").concat(nav.isPresto || aib._4chan ? '' : "
\n\t\t\t\t".concat(this._getBox('findImgFile'), "\n\t\t\t
"), "\n\t\t\t").concat(this._getSel('openImgs'), "
\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'), "\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'), "
\n\t\t\t").concat(this._getBox('decodeLinks'), "
\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'), "
") : '', "\n\t\t\t
\n\t\t\t\t").concat(this._getBox('addMP3'), "\n\t\t\t\t").concat(aib.prot === 'http:' ? this._getBox('addVocaroo') : '', "\n\t\t\t
\n\t\t\t").concat(this._getSel('embedYTube'), "\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'), "
\n\t\t\t\t").concat(this._getInp('ytApiKey', true, 25), "
\n\t\t\t\t").concat(this._getBox('addVimeo'), "\n\t\t\t
\n\t\t
"); }, _getCfgForm: function _getCfgForm() { return "
\n\t\t\t".concat(this._getBox('ajaxPosting'), "
\n\t\t\t").concat(pr.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(pr.files && !nav.isPresto ? this._getSel('fileInputs') : '', "\n\t\t\t
") : '', "\n\t\t\t").concat(pr.form ? this._getSel('addPostForm') + '
' : '', "\n\t\t\t").concat(pr.txta ? this._getBox('spacedQuote') + '
' : '', "\n\t\t\t").concat(this._getBox('favOnReply'), "
\n\t\t\t").concat(pr.subj ? this._getBox('warnSubjTrip') + '
' : '', "\n\t\t\t").concat(pr.mail ? "".concat(this._getBox('addSageBtn'), "\n\t\t\t\t").concat(this._getBox('saveSage'), "
") : '', "\n\t\t\t").concat(pr.cap ? "".concat(aib.hasAltCaptcha ? "".concat(this._getBox('altCaptcha'), "
") : '', "\n\t\t\t\t").concat(this._getInp('capUpdTime'), "
\n\t\t\t\t").concat(this._getSel('captchaLang'), "
") : '', "\n\t\t\t").concat(pr.txta ? "".concat(this._getSel('addTextBtns'), "\n\t\t\t\t").concat(!aib._4chan ? this._getBox('txtBtnsLoc') : '', "
") : '', "\n\t\t\t").concat(pr.passw ? "".concat(this._getInp('passwValue', false, 9), "\n\t\t\t\t").concat(this._getBox('userPassw'), "
") : '', "\n\t\t\t").concat(pr.name ? "".concat(this._getInp('nameValue', false, 9), "\n\t\t\t\t").concat(this._getBox('userName'), "
") : '', "\n\t\t\t").concat(pr.rules || pr.passw || pr.name ? Lng.hide[lang] + (pr.rules ? this._getBox('noBoardRule') : '') + (pr.passw ? this._getBox('noPassword') : '') + (pr.name ? this._getBox('noName') : '') + (pr.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 docBody.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'), "
\n\t\t\t").concat(!localData ? "".concat(this._getBox('inftyScroll'), "
\n\t\t\t\t").concat(this._getBox('hideReplies'), "
\n\t\t\t\t").concat(this._getBox('scrollToTop'), "
") : '', "\n\t\t\t").concat(this._getBox('saveScroll'), "
\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 && !nav.isPresto && !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) { 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] : 2; var el = doc.createElement('div'); el.append(Cfg[id]); return ""); }, _getList: function _getList(arr) { return arrTags(arr, ''); }, _getSel: function _getSel(id) { 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="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 buttonHTML = isWait ? '' : "\u2716 "; if (el) { $q('div', el).innerHTML = txt.trim(); $q('span', el).innerHTML = buttonHTML; if (!isWait && Cfg.animation) { $animate(el, 'de-blink'); } } else { el = $bEnd($id('de-wrapper-popup'), "
\n\t\t\t").concat(buttonHTML, "\n\t\t\t
").concat(txt.trim(), "
\n\t\t
")); el.onclick = function (e) { var el = nav.fixEventEl(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.lastElementChild; } 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 _this17 = 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(docBody, "
").concat(html, "
")); var cr = parentEl.getBoundingClientRect(); var style = el.style, w = el.offsetWidth, h = el.offsetHeight; style.left = (isFixed ? 0 : deWindow.pageXOffset) + (cr.left + w < 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._el = el; this.parentEl = parentEl; ['mouseover', 'mouseout'].forEach(function (e) { return el.addEventListener(e, _this17, true); }); el.addEventListener('click', this); parentEl.addEventListener('mouseout', this); } _createClass(Menu, [{ key: "handleEvent", value: function handleEvent(e) { var _this18 = 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': { var _rt; clearTimeout(this._closeTO); var rt = nav.fixEventEl(e.relatedTarget); rt = ((_rt = rt) === null || _rt === void 0 ? void 0 : _rt.farthestViewportElement) || rt; if (!rt || rt !== this._el && !this._el.contains(rt)) { if (isOverEvent) { if (this.onover) { this.onover(); } } else if (!rt || rt !== this.parentEl && !this.parentEl.contains(rt)) { this._closeTO = setTimeout(function () { return _this18.removeMenu(); }, 75); if (this.onout) { this.onout(); } } } } } } }, { key: "removeMenu", value: function removeMenu() { var _this19 = this; if (!this._el) { return; } if (this.onremove) { this.onremove(); } ['mouseover', 'mouseout'].forEach(function (e) { return _this19._el.removeEventListener(e, _this19, true); }); this.parentEl.removeEventListener('mouseout', this); this._el.removeEventListener('click', this); this._el.remove(); this._el = null; } }], [{ 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 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.dm !== href.match(/^(?: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 = link.nextElementSibling) && (webmTitle = webmTitle.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?image_url=".concat(p, "Google"), "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")], '', ''); }; switch (el.id) { case 'de-btn-spell-add': return new Menu(el, "
".concat(fn('#words,#exp,#exph,#imgn,#ihash,#subj,#name,#trip,#img,#sage'.split(',')), "
").concat(fn('#op,#tlen,#all,#video,#vauthor,#num,#wipe,#rep,#outrep,
'.split(',')), "
"), function (_ref9) { var s = _ref9.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, fn(Lng.selAjaxPages[lang]), function (el) { return Pages.loadPages(aProto.indexOf.call(el.parentNode.children, el) + 1); }); case 'de-panel-savethr': return new Menu(el, fn($q(aib.qPostImg, DelForm.first.el) ? Lng.selSaveThr[lang] : [Lng.selSaveThr[lang][0]]), function (el) { if ($id('de-popup-savethr')) { return; } var imgOnly = !!aProto.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, fn(Lng.selAudioNotif[lang]), function (el) { updater.enableUpdater(); updater.toggleAudio([3e4, 6e4, 12e4, 3e5][aProto.indexOf.call(el.parentNode.children, el)]); $id('de-panel-audio-off').id = 'de-panel-audio-on'; }); } } var HotKeys = { cPost: null, enabled: false, gKeys: null, lastPageOffset: 0, ntKeys: null, tKeys: null, version: 7, clearCPost: function clearCPost() { this.cPost = null; this.lastPageOffset = 0; }, disableHotKeys: function disableHotKeys() { if (this.enabled) { this.enabled = false; if (this.cPost) { this.cPost.unselect(); } this.clearCPost(); this.gKeys = this.ntKeys = this.tKeys = null; doc.removeEventListener('keydown', this, true); } }, enableHotKeys: function enableHotKeys() { var _this20 = this; if (!this.enabled) { this.enabled = true; this._paused = false; Promise.resolve(this.readKeys()).then(function (keys) { if (_this20.enabled) { var _keys = _slicedToArray(keys, 5); _this20.gKeys = _keys[2]; _this20.ntKeys = _keys[3]; _this20.tKeys = _keys[4]; doc.addEventListener('keydown', _this20, true); } }); } }, getDefaultKeys: function getDefaultKeys() { return [HotKeys.version, nav.isFirefox, [ 0x004B , 0x004A , 0x0052 , 0x0048 , 0x1025 , 0x900D , 0x4046 , 0x4048 , 0x0050 , 0x0042 , 0x4053 , 0x0049 , 0xC042 , 0xC049 , 0xC054 , 0xC050 , 0xC043 , 0x1027 , 0x4056 ], [ 0x004D , 0x004E , 0x0056 , 0x0045 ], [ 0x0055 ]]; }, handleEvent: function handleEvent(e) { if (this._paused || e.metaKey) { return; } var idx; var isThr = aib.t; var el = e.target; var tag = el.tagName; var kc = e.keyCode | (e.ctrlKey ? 0x1000 : 0) | (e.shiftKey ? 0x2000 : 0) | (e.altKey ? 0x4000 : 0) | (tag === 'TEXTAREA' || tag === 'INPUT' && (el.type === 'text' || el.type === 'password') ? 0x8000 : 0); if (kc === 0x74 || kc === 0x8074) { if (isThr || $id('de-popup-load-pages')) { return; } AttachedImage.closeImg(); Pages.loadPages(+Cfg.loadPages); } else if (kc === 0x1B) { if (AttachedImage.viewer) { AttachedImage.closeImg(); return; } if (this.cPost) { this.cPost.unselect(); this.cPost = null; } if (isThr) { Post.clearMarks(); } this.lastPageOffset = 0; } else if (kc === 0x801B) { el.blur(); } else { var post; var globIdx = this.gKeys.indexOf(kc); switch (globIdx) { case 2: if (pr.form) { post = this.cPost || this._getFirstVisPost(false, true) || Thread.first.op; this.cPost = post; pr.showQuickReply(post, post.num, true, false); post.select(); } break; case 3: post = this._getFirstVisPost(false, true) || this._getNextVisPost(null, true, false); if (post) { post.setUserVisib(!post.isHidden); this._scroll(post, false, post.isOp); } break; case 4: if (AttachedImage.viewer) { AttachedImage.viewer.navigate(false); } else if (isThr || aib.page !== aib.firstPage) { deWindow.location.pathname = aib.getPageUrl(aib.b, isThr ? 0 : aib.page - 1); } break; case 5: if (el !== pr.txta && el !== pr.cap.textEl) { return; } pr.subm.click(); break; case 6: toggleWindow('fav', false); break; case 7: toggleWindow('hid', false); break; case 8: $toggle($id('de-panel-buttons')); break; case 9: toggleCfg('maskImgs'); updateCSS(); break; case 10: toggleWindow('cfg', false); break; case 11: post = this._getFirstVisPost(false, true) || this._getNextVisPost(null, true, false); if (post) { post.toggleImages(); } break; case 12: if (el !== pr.txta) { return; } $id('de-btn-bold').click(); break; case 13: if (el !== pr.txta) { return; } $id('de-btn-italic').click(); break; case 14: if (el !== pr.txta) { return; } $id('de-btn-strike').click(); break; case 15: if (el !== pr.txta) { return; } $id('de-btn-spoil').click(); break; case 16: if (el !== pr.txta) { return; } $id('de-btn-code').click(); break; case 17: if (AttachedImage.viewer) { AttachedImage.viewer.navigate(true); } else if (!isThr) { var pageNum = DelForm.last.pageNum + 1; if (pageNum <= aib.lastPage) { deWindow.location.pathname = aib.getPageUrl(aib.b, pageNum); } } break; case 18: toggleWindow('vid', false); break; case -1: if (isThr) { idx = this.tKeys.indexOf(kc); if (idx === 0) { updater.forceLoad(null); break; } return; } idx = this.ntKeys.indexOf(kc); if (idx === -1) { return; } else if (idx === 2) { post = this._getFirstVisPost(false, true) || this._getNextVisPost(null, true, false); if (post) { if (typeof GM_openInTab === 'function') { GM_openInTab(aib.getThrUrl(aib.b, post.tNum), false, true); } else { deWindow.open(aib.getThrUrl(aib.b, post.tNum), '_blank'); } } break; } else if (idx === 3) { post = this._getFirstVisPost(false, true) || this._getNextVisPost(null, true, false); if (post) { if (post.thr.loadCount !== 0 && post.thr.op.next.count === 1) { var nextThr = post.thr.nextNotHidden; post.thr.loadPosts(visPosts, !!nextThr); post = (nextThr || post.thr).op; } else { post.thr.loadPosts('all'); post = post.thr.op; } scrollTo(deWindow.pageXOffset, deWindow.pageYOffset + post.top); if (this.cPost && this.cPost !== post) { this.cPost.unselect(); this.cPost = post; } } break; } default: { var scrollToThr = !isThr && (globIdx === 0 || globIdx === 1); this._scroll(this._getFirstVisPost(scrollToThr, false), globIdx === 0 || idx === 0, scrollToThr); } } } e.preventDefault(); e.stopPropagation(); }, pauseHotKeys: function pauseHotKeys() { this._paused = true; }, readKeys: function readKeys() { var _this21 = this; return _asyncToGenerator( _regeneratorRuntime().mark(function _callee6() { var str, keys, tKeys, mapFunc; return _regeneratorRuntime().wrap(function _callee6$(_context8) { while (1) { switch (_context8.prev = _context8.next) { case 0: _context8.next = 2; return getStored('DESU_keys'); case 2: str = _context8.sent; if (str) { _context8.next = 5; break; } return _context8.abrupt("return", _this21.getDefaultKeys()); case 5: try { keys = JSON.parse(str); } catch (err) {} if (keys) { _context8.next = 8; break; } return _context8.abrupt("return", _this21.getDefaultKeys()); case 8: if (keys[0] !== _this21.version) { tKeys = _this21.getDefaultKeys(); switch (keys[0]) { case 1: keys[2][11] = tKeys[2][11]; keys[4] = tKeys[4]; case 2: keys[2][12] = tKeys[2][12]; keys[2][13] = tKeys[2][13]; keys[2][14] = tKeys[2][14]; keys[2][15] = tKeys[2][15]; keys[2][16] = tKeys[2][16]; case 3: keys[2][17] = keys[3][3]; keys[3][3] = keys[3].splice(4, 1)[0]; case 4: case 5: case 6: keys[2][18] = tKeys[2][18]; } keys[0] = _this21.version; setStored('DESU_keys', JSON.stringify(keys)); } if (keys[1] ^ nav.isFirefox) { mapFunc = nav.isFirefox ? function (key) { return key === 189 ? 173 : key === 187 ? 61 : key === 186 ? 59 : key; } : function (key) { return key === 173 ? 189 : key === 61 ? 187 : key === 59 ? 186 : key; }; keys[1] = nav.isFirefox; keys[2] = keys[2].map(mapFunc); keys[3] = keys[3].map(mapFunc); setStored('DESU_keys', JSON.stringify(keys)); } return _context8.abrupt("return", keys); case 11: case "end": return _context8.stop(); } } }, _callee6); }))(); }, resume: function resume(keys) { var _keys2 = _slicedToArray(keys, 5); this.gKeys = _keys2[2]; this.ntKeys = _keys2[3]; this.tKeys = _keys2[4]; this._paused = false; }, _paused: false, _getNextVisPost: function _getNextVisPost(cPost, isOp, toUp) { if (isOp) { var thr = cPost ? toUp ? cPost.thr.prevNotHidden : cPost.thr.nextNotHidden : Thread.first.isHidden ? Thread.first.nextNotHidden : Thread.first; return thr ? thr.op : null; } return cPost ? cPost.getAdjacentVisPost(toUp) : Thread.first.isHidden || Thread.first.op.isHidden ? Thread.first.op.getAdjacentVisPost(toUp) : Thread.first.op; }, _getFirstVisPost: function _getFirstVisPost(getThread, getFull) { if (this.lastPageOffset !== deWindow.pageYOffset) { var post = getThread ? Thread.first : Thread.first.op; while (post.top < 1) { var tPost = post.next; if (!tPost) { break; } post = tPost; } if (this.cPost) { this.cPost.unselect(); } this.cPost = getThread ? getFull ? post.op : post.op.prev : getFull ? post : post.prev; this.lastPageOffset = deWindow.pageYOffset; } return this.cPost; }, _scroll: function _scroll(post, toUp, toThread) { var next = this._getNextVisPost(post, toThread, toUp); if (!next) { if (!aib.t) { var pageNum = toUp ? DelForm.first.pageNum - 1 : DelForm.last.pageNum + 1; if (toUp ? pageNum >= aib.firstPage : pageNum <= aib.lastPage) { deWindow.location.pathname = aib.getPageUrl(aib.b, pageNum); } } return; } if (post) { post.unselect(); } if (toThread) { next.el.scrollIntoView(); } else { scrollTo(0, deWindow.pageYOffset + next.el.getBoundingClientRect().top - Post.sizing.wHeight / 2 + next.el.clientHeight / 2); } this.lastPageOffset = deWindow.pageYOffset; next.select(); this.cPost = next; } }; var KeyEditListener = function () { function KeyEditListener(popupEl, keys, allKeys) { _classCallCheck(this, KeyEditListener); this.cEl = null; this.cKey = -1; this.errorInput = false; var aInputs = _toConsumableArray($Q('.de-input-key', popupEl)); for (var i = 0, len = allKeys.length; i < len; ++i) { var k = allKeys[i]; if (k !== 0) { for (var j = i + 1; j < len; ++j) { if (k === allKeys[j]) { aInputs[i].classList.add('de-input-error'); aInputs[j].classList.add('de-input-error'); break; } } } } this.popupEl = popupEl; this.keys = keys; this.initKeys = JSON.parse(JSON.stringify(keys)); this.allKeys = allKeys; this.allInputs = aInputs; this.errCount = $Q('.de-input-error', popupEl).length; if (this.errCount !== 0) { this.saveButton.disabled = true; } } _createClass(KeyEditListener, [{ key: "saveButton", get: function get() { var value = $id('de-keys-save'); Object.defineProperty(this, 'saveButton', { value: value, configurable: true }); return value; } }, { key: "handleEvent", value: function handleEvent(e) { var key; var el = e.target; switch (e.type) { case 'blur': if (HotKeys.enabled && this.errCount === 0) { HotKeys.resume(this.keys); } el.classList.remove('de-input-selected'); this.cEl = null; return; case 'focus': if (HotKeys.enabled) { HotKeys.pauseHotKeys(); } el.classList.add('de-input-selected'); this.cEl = el; return; case 'click': { var keys; if (el.id === 'de-keys-reset') { this.keys = HotKeys.getDefaultKeys(); this.initKeys = HotKeys.getDefaultKeys(); if (HotKeys.enabled) { HotKeys.resume(this.keys); } var _KeyEditListener$getE = KeyEditListener.getEditMarkup(this.keys); var _KeyEditListener$getE2 = _slicedToArray(_KeyEditListener$getE, 2); this.allKeys = _KeyEditListener$getE2[0]; this.popupEl.innerHTML = _KeyEditListener$getE2[1]; this.allInputs = _toConsumableArray($Q('.de-input-key', this.popupEl)); this.errCount = 0; delete this.saveButton; break; } else if (el.id === 'de-keys-save') { keys = this.keys; setStored('DESU_keys', JSON.stringify(keys)); } else if (el.className === 'de-popup-btn') { keys = this.initKeys; } else { return; } if (HotKeys.enabled) { HotKeys.resume(keys); } closePopup('edit-hotkeys'); break; } case 'keydown': { if (!this.cEl) { return; } key = e.keyCode; if (key === 0x1B || key === 0x2E) { this.cEl.value = ''; this.cKey = 0; this.errorInput = false; break; } var keyStr = KeyEditListener.keyCodes[key]; if (typeof keyStr === 'undefined') { this.cKey = -1; return; } var str = ''; if (e.ctrlKey) { str += 'Ctrl+'; } if (e.shiftKey) { str += 'Shift+'; } if (e.altKey) { str += 'Alt+'; } if (key === 16 || key === 17 || key === 18) { this.errorInput = true; this.cKey = 0; } else { this.cKey = key | (e.ctrlKey ? 0x1000 : 0) | (e.shiftKey ? 0x2000 : 0) | (e.altKey ? 0x4000 : 0) | (this.cEl.hasAttribute('de-text') ? 0x8000 : 0); this.errorInput = false; str += keyStr; } this.cEl.value = str; break; } case 'keyup': { el = this.cEl; key = this.cKey; if (!el || key === -1) { return; } var rEl; var isError = el.classList.contains('de-input-error'); if (!this.errorInput && key !== -1) { var idx = this.allInputs.indexOf(el); var oKey = this.allKeys[idx]; if (oKey === key) { this.errorInput = false; break; } var rIdx = key === 0 ? -1 : this.allKeys.indexOf(key); this.allKeys[idx] = key; if (isError) { idx = this.allKeys.indexOf(oKey); if (idx !== -1 && this.allKeys.indexOf(oKey, idx + 1) === -1) { rEl = this.allInputs[idx]; if (rEl.classList.contains('de-input-error')) { this.errCount--; rEl.classList.remove('de-input-error'); } } if (rIdx === -1) { this.errCount--; el.classList.remove('de-input-error'); } } if (rIdx === -1) { this.keys[+el.getAttribute('de-id1')][+el.getAttribute('de-id2')] = key; if (this.errCount === 0) { this.saveButton.disabled = false; } this.errorInput = false; break; } rEl = this.allInputs[rIdx]; if (!rEl.classList.contains('de-input-error')) { this.errCount++; rEl.classList.add('de-input-error'); } } if (!isError) { this.errCount++; el.classList.add('de-input-error'); } if (this.errCount !== 0) { this.saveButton.disabled = true; } } } e.preventDefault(); } }], [{ key: "getEditMarkup", value: function getEditMarkup(keys) { var allKeys = []; return [allKeys, "".concat(Lng.hotKeyEdit[lang].join('').replace(/%l/g, '').replace(/%i([2-4])([0-9]+)(t)?/g, function (all, id1, id2, isText) { var key = keys[+id1][+id2]; allKeys.push(key); return ""); }), "") + "")]; } }, { key: "getStrKey", value: function getStrKey(key) { return (key & 0x1000 ? 'Ctrl+' : '') + (key & 0x2000 ? 'Shift+' : '') + (key & 0x4000 ? 'Alt+' : '') + KeyEditListener.keyCodes[key & 0xFFF]; } }, { key: "setTitle", value: function setTitle(el, idx) { var title = el.getAttribute('de-title'); if (!title) { title = el.getAttribute('title'); el.setAttribute('de-title', title); } if (HotKeys.enabled && idx !== -1) { title += " [".concat(KeyEditListener.getStrKey(HotKeys.gKeys[idx]), "]"); } el.title = title; } }]); return KeyEditListener; }(); KeyEditListener.keyCodes = [ '',,,,,,,, 'Backspace', 'Tab',,,, 'Enter',,, 'Shift', 'Ctrl', 'Alt',,,,,,,,,,,,,, 'Space',,,,, '←', '↑', '→', '↓',,,,,,,, '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',, ';',, '=',,,, 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',,,,,, 'Num 0', 'Num 1', 'Num 2', 'Num 3', 'Num 4', 'Num 5', 'Num 6', 'Num 7', 'Num 8', 'Num 9', 'Num *', 'Num +',, 'Num -', 'Num .', 'Num /',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, '-',,,,,,,,,,,,, ';', '=', ',', '-', '.', '/', '`',,,,,,,,,,,,,,,,,,,,,,,,,,, '[', '\\', ']', '\'']; var ContentLoader = { afterFn: null, isLoading: false, popupId: null, downloadThread: function downloadThread(imgOnly) { var _this22 = this; var progress, counter; var current = 1; var warnings = ''; var tar = new TarBuilder(); var dc = imgOnly ? doc : doc.documentElement.cloneNode(true); var els = _toConsumableArray($Q(aib.qPostImg, $q('[de-form]', dc))); var count = els.length; var delSymbols = function delSymbols(str) { var r = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; return str.replace(/[\\/:*?"<>|]/g, r); }; this._thrPool = new TasksPool(4, function (num, data) { return _this22.loadImgData(data[0]).then(function (imgData) { var _data3 = _slicedToArray(data, 4), url = _data3[0], fName = _data3[1], el = _data3[2], parentLink = _data3[3]; var safeName = delSymbols(fName, '_'); progress.value = counter.innerHTML = current++; if (parentLink) { var thumbName = safeName.replace(/\.[a-z]+$/, '.png'); if (imgOnly) { thumbName = 'thumb-' + thumbName; } else { thumbName = 'thumbs/' + thumbName; safeName = imgData ? 'images/' + safeName : thumbName; parentLink.href = getImgNameLink(el).href = safeName; } if (imgData) { tar.addFile(safeName, imgData); } else { warnings += "
".concat(Lng.cantLoad[lang], "
").concat(url, "") + "
".concat(Lng.willSavePview[lang]); $popup('err-files', Lng.loadErrors[lang] + warnings); if (imgOnly) { return _this22.getDataFromImg(el).then(function (data) { return tar.addFile(thumbName, data); }, emptyFn); } } return imgOnly ? null : _this22.getDataFromImg(el).then(function (data) { el.src = thumbName; tar.addFile(thumbName, data); }, function () { return el.src = safeName; }); } else if (imgData !== null && imgData !== void 0 && imgData.length) { tar.addFile(el.href = el.src = 'data/' + safeName, imgData); } else { $del(el); } }); }, function () { var docName = "".concat(aib.dm, "-").concat(delSymbols(aib.b), "-").concat(aib.t); if (!imgOnly) { $q('head', dc).insertAdjacentHTML('beforeend', ''); var dcBody = $q('body', dc); dcBody.classList.remove('de-runned'); dcBody.classList.add('de-mode-local'); $delAll('#de-css, #de-css-dynamic, #de-css-user', dc); tar.addString('data/dollscript.js', "".concat(nav.isESNext ? "(".concat(String(deMainFuncInner), ")(window, null, null, (x, y) => window.scrollTo(x, y), ") : "(".concat(String( deMainFuncOuter), ")(")).concat(JSON.stringify({ dm: aib.dm, b: aib.b, t: aib.t }), ");")); var dt = doc.doctype; tar.addString(docName + '.html', '' + dc.outerHTML); } var title = delSymbols(Thread.first.op.title.trim()); downloadBlob(tar.get(), "".concat(docName).concat(imgOnly ? '-images' : '').concat(title ? ' - ' + title : '', ".tar")); closePopup('load-files'); _this22._thrPool = tar = warnings = count = current = imgOnly = progress = counter = null; }); els.forEach(function (el) { var parentLink = el.closest('a'); if (parentLink) { var url = parentLink.href; _this22._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 = +tc.substr(2)) && 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.dm), "\\/"), 'i'); $Q('link, *[src]', dc).forEach(function (el) { if (els.indexOf(el) !== -1) { return; } var url = el.tagName === 'LINK' ? el.href : el.src; if (!urlRegex.test(url)) { el.remove(); return; } var fName = delSymbols(getFileName(url), '_').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); _this22._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.loadImgData(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.loadImgData(el.src); } }, loadImgData: function loadImgData(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.getUnsafeUint8Array(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 ? ContentLoader.loadImgData(url, false) : null; }); }, preloadImages: function preloadImages(data) { var _this23 = 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 _this23.loadImgData(data[0]).then(function (imageData) { var _data4 = _slicedToArray(data, 6), url = _data4[0], parentLink = _data4[1], iType = _data4[2], isRepToOrig = _data4[3], el = _data4[4], isVideo = _data4[5]; if (imageData) { var fName = decodeURIComponent(getFileName(url)); var nameLink = getImgNameLink(el); 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([imageData], { type: iType })); if (isVideo) { el.setAttribute('de-video', ''); } if (isRepToOrig) { el.src = parentLink.href; } if (rarJpgFinder) { rarJpgFinder.runWorker(imageData.buffer, [imageData.buffer], function (info) { return _this23._addImgFileIcon(nameLink, fName, info); }); } } if (_this23.popupId) { $popup(_this23.popupId, "".concat(Lng.loadImage[lang], ": ").concat(cImg, "/").concat(len), true); } cImg++; }); }, function () { _this23.isLoading = false; if (_this23.afterFn) { _this23.afterFn(); _this23.afterFn = _this23.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/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; } } _createClass(DateTime, [{ key: "genRFunc", value: function genRFunc(rPattern) { var _this24 = this; return function (dtime) { return rPattern.replace('_o', (_this24.diff < 0 ? '' : '+') + _this24.diff).replace('_s', function () { return _this24.pad2(dtime.getSeconds()); }).replace('_i', function () { return _this24.pad2(dtime.getMinutes()); }).replace('_h', function () { return _this24.pad2(dtime.getHours()); }).replace('_d', function () { return _this24.pad2(dtime.getDate()); }).replace('_w', function () { return _this24.arrW[dtime.getDay()]; }).replace('_n', function () { return _this24.pad2(dtime.getMonth() + 1); }).replace('_m', function () { return _this24.arrM[dtime.getMonth()]; }).replace('_M', function () { return _this24.arrFM[dtime.getMonth()]; }).replace('_y', function () { return ('' + dtime.getFullYear()).substring(2); }).replace('_Y', function () { return dtime.getFullYear(); }); }; } }, { key: "getRPattern", value: function getRPattern(txt) { 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; } if (this.onRPat) { this.onRPat(rPattern); } this.genDateTime = this.genRFunc(rPattern); return true; } }, { key: "fix", value: function fix(txt) { var _this25 = 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 (_this25.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() + _this25.diff); return _this25.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 toggleSettings(el) { if (el.checked && (!/^[+-]\d{1,2}$/.test(Cfg.timeOffset) || DateTime.checkPattern(Cfg.timePattern))) { $popup('err-correcttime', Lng.cTimeError[lang]); saveCfg('correctTime', 0); el.checked = false; } } }]); return DateTime; }(); 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; } } _createClass(Videos, [{ key: "player", get: function get() { var post = this.post; var value = aib.insertYtPlayer(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.prot, "//www.youtube.com/watch?v=").concat(m[1]).concat(time ? '#t=' + time : '') : "".concat(aib.prot, "//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; if (mode === 1) { this._addThumb(m, el.classList.contains('de-ytube')); } else { el.classList.add('de-current'); this.setPlayer(m, el.classList.contains('de-ytube')); } return; } if (mode === 1) { if ($q('.de-video-thumb', this.player)) { el.classList.add('de-current'); this.setPlayer(m, el.classList.contains('de-ytube')); } else { el.classList.remove('de-current'); this._addThumb(m, el.classList.contains('de-ytube')); } } 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) { $del(el); return; } if (!el) { el = $bEnd(docBody, "")); } 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.prot, "//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"](emptyFn); } }], [{ 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.prot, "//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(_ref10, num) { var _ref11 = _slicedToArray(_ref10, 4), link = _ref11[0], isYtube = _ref11[1], videoObj = _ref11[2], id = _ref11[3]; for (var _len6 = arguments.length, data = new Array(_len6 > 2 ? _len6 - 2 : 0), _key2 = 2; _key2 < _len6; _key2++) { data[_key2 - 2] = arguments[_key2]; } 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); }); } }]); return Videos; }(); 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(); } _createClass(VideosParser, [{ key: "endParser", value: function endParser() { if (this._loader) { 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); } } } } }]); return VideosParser; }(); 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) { var _els2 = $Q('a[href*="vocaroo.com"]', isPost ? data.el : data); for (var _i9 = 0, _len7 = _els2.length; _i9 < _len7; ++_i9) { var _link = _els2[_i9]; var _el6 = _link.previousSibling; if (!_el6 || _el6.className !== 'de-vocaroo') { _link.insertAdjacentHTML('beforebegin', "
\n\t\t\t\t\t\n\t\t\t\t
"); } } } } 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 (((isCORS ? !nav.hasGMXHR : !nav.canUseNativeXHR) || aib.hasRefererErr && nav.canUseFetch) && (nav.canUseFetch || !url.startsWith('blob'))) { if (!params) { params = {}; } params.referrer = doc.referrer.startsWith(aib.prot + '//' + 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 _ref12 = _asyncToGenerator( _regeneratorRuntime().mark(function _callee7(res) { return _regeneratorRuntime().wrap(function _callee7$(_context9) { while (1) { switch (_context9.prev = _context9.next) { case 0: if (aib.isAjaxStatusOK(res.status)) { _context9.next = 3; break; } reject(new AjaxError(res.status, res.statusText)); return _context9.abrupt("return"); case 3: _context9.t0 = params.responseType; _context9.next = _context9.t0 === 'arraybuffer' ? 6 : _context9.t0 === 'blob' ? 10 : 14; break; case 6: _context9.next = 8; return res.arrayBuffer(); case 8: res.response = _context9.sent; return _context9.abrupt("break", 17); case 10: _context9.next = 12; return res.blob(); case 12: res.response = _context9.sent; return _context9.abrupt("break", 17); case 14: _context9.next = 16; return res.text(); case 16: res.responseText = _context9.sent; case 17: resolve(res); case 18: case "end": return _context9.stop(); } } }, _callee7); })); return function (_x7) { return _ref12.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 obj = { 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) { 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) { obj.upload = { onprogress: params.onprogress }; delete params.onprogress; } delete params.method; Object.assign(obj, params); } if (nav.hasNewGM) { GM.xmlHttpRequest(obj); cancelFn = emptyFn; } else { gmxhr = GM_xmlhttpRequest(obj); 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 (_ref13) { var target = _ref13.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; } _createClass(AjaxError, [{ key: "toString", value: function toString() { return this.code <= 0 ? String(this.message || Lng.noConnect[lang]) : "HTTP [".concat(this.code, "] ").concat(this.message); } }]); return AjaxError; }(); 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.random()); }, runCachedAjax: function runCachedAjax(url, useCache) { var _this26 = this; var _ref14 = this._data.get(url) || {}, hasCacheControl = _ref14.hasCacheControl, params = _ref14.params; var ajaxURL = hasCacheControl === false ? this.fixURL(url) : url; return $ajax(ajaxURL, useCache && params || { useTimeout: true }, aib._4chan).then(function (xhr) { return _this26.saveData(url, xhr) ? xhr : $ajax(_this26.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 !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 fnResult = function fnResult(el) { return !el ? CancelablePromise.reject(new AjaxError(0, Lng.errCorruptData[lang])) : checkArch ? [el, (xhr.responseURL || '').includes('/arch/')] : el; }; var text = xhr.responseText; var el = getAjaxResponseEl(text, needForm); return aib.stormWallFixAjax ? aib.stormWallFixAjax(url, text, el, needForm, fnResult) : fnResult(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 _this27 = 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 _ref15 = _asyncToGenerator( _regeneratorRuntime().mark(function _callee8(formEl) { var newForm, firstForm, thr, oldLastThr; return _regeneratorRuntime().wrap(function _callee8$(_context10) { while (1) { switch (_context10.prev = _context10.next) { case 0: newForm = _this27._addForm(formEl, pageNum); if (!newForm.firstThr) { _context10.next = 16; break; } if (needThreads) { _context10.next = 4; break; } return _context10.abrupt("return", _this27._updateForms(DelForm.last)); case 4: $hide(newForm.el); _context10.next = 7; return _this27._updateForms(DelForm.last); case 7: 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(); _this27._endAdding(); if (needThreads) { _this27.addPage(needThreads, pageNum + 1); } return _context10.abrupt("return", CancelablePromise.reject(new CancelError())); case 16: _this27._endAdding(); _this27.addPage(); return _context10.abrupt("return", CancelablePromise.reject(new CancelError())); case 19: case "end": return _context10.stop(); } } }, _callee8); })); return function (_x8) { return _ref15.apply(this, arguments); }; }()).then(function () { return _this27._endAdding(); })["catch"](function (err) { if (!(err instanceof CancelError)) { $popup('add-page', getErrorMessage(err)); _this27._endAdding(); } }); }, loadPages: function loadPages(count) { var _this28 = this; return _asyncToGenerator( _regeneratorRuntime().mark(function _callee9() { var _iterator6, _step6, form, i, len, first; return _regeneratorRuntime().wrap(function _callee9$(_context11) { while (1) { switch (_context11.prev = _context11.next) { case 0: $popup('load-pages', Lng.loading[lang], true); if (_this28._addingPromise) { _this28._addingPromise.cancelPromise(); _this28._endAdding(); } PviewsCache.purge(); isExpImg = false; pByEl = new Map(); pByNum = new Map(); Post.hiddenNums = new Set(); AttachedImage.closeImg(); if (pr.isQuick) { pr.clearForm(); } DelForm.tNums = new Set(); _iterator6 = _createForOfIteratorHelperLoose(DelForm); case 11: if ((_step6 = _iterator6()).done) { _context11.next = 20; break; } form = _step6.value; $Q('a[href^="blob:"]', form.el).forEach(function (el) { return URL.revokeObjectURL(el.href); }); $hide(form.el); if (!(form === DelForm.last)) { _context11.next = 17; break; } return _context11.abrupt("break", 20); case 17: form.el.remove(); case 18: _context11.next = 11; break; case 20: DelForm.first = DelForm.last; i = aib.page, len = Math.min(aib.lastPage + 1, aib.page + count); case 22: if (!(i < len)) { _context11.next = 38; break; } _context11.prev = 23; _context11.t0 = _this28; _context11.next = 27; return ajaxLoad(aib.getPageUrl(aib.b, i)); case 27: _context11.t1 = _context11.sent; _context11.t2 = i; _context11.t0._addForm.call(_context11.t0, _context11.t1, _context11.t2); _context11.next = 35; break; case 32: _context11.prev = 32; _context11.t3 = _context11["catch"](23); $popup('load-pages', getErrorMessage(_context11.t3)); case 35: ++i; _context11.next = 22; break; case 38: first = DelForm.first; if (!(first !== DelForm.last)) { _context11.next = 45; break; } DelForm.first = first.next; first.el.remove(); _context11.next = 44; return _this28._updateForms(DelForm.first); case 44: closePopup('load-pages'); case 45: case "end": return _context11.stop(); } } }, _callee9, null, [[23, 32]]); }))(); }, _isAdding: false, _addingPromise: null, _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( _regeneratorRuntime().mark(function _callee10() { return _regeneratorRuntime().wrap(function _callee10$(_context12) { while (1) { switch (_context12.prev = _context12.next) { case 0: _context12.t0 = readPostsData; _context12.t1 = newForm.firstThr.op; _context12.next = 4; return readFavorites(); case 4: _context12.t2 = _context12.sent; (0, _context12.t0)(_context12.t1, _context12.t2); if (pr.passw) { PostForm.setUserPassw(); } embedPostMsgImages(newForm.el); if (HotKeys.enabled) { HotKeys.clearCPost(); } case 9: case "end": return _context12.stop(); } } }, _callee10); }))(); } }; function toggleInfinityScroll() { if (!aib.t) { doc.defaultView[Cfg.inftyScroll ? 'addEventListener' : 'removeEventListener']('onwheel' in doc.defaultView ? 'wheel' : 'mousewheel', toggleInfinityScroll.onwheel); } } toggleInfinityScroll.onwheel = function (e) { if ((e.type === 'wheel' ? e.deltaY : -('wheelDeltaY' in e ? e.wheelDeltaY : e.wheelDelta)) > 0) { deWindow.requestAnimationFrame(function () { if (Thread.last.bottom - 150 < Post.sizing.wHeight) { Pages.addPage(); } }); } }; 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 _iterator7 = _createForOfIteratorHelperLoose(reps), _step7; !(_step7 = _iterator7()).done;) { var rep = _step7.value; str += this._decompileRep(rep, false) + '\n'; } } if (oreps) { for (var _iterator8 = _createForOfIteratorHelperLoose(oreps), _step8; !(_step8 = _iterator8()).done;) { var orep = _step8.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', '//']; }, get needArg() { return [ true, true, true, true, true, false, true, false, false, false, false, false, false, false, false, true, true, false]; }, get outreps() { this._initSpells(); return this.outreps; }, get reps() { this._initSpells(); return this.reps; }, addSpell: function addSpell(type, arg, isNeg) { var fld = $id('de-spell-txt'); var val = fld === null || fld === void 0 ? void 0 : fld.value; var chk = $q('input[info="hideBySpell"]'); var spells = val && this.parseText(val); if (!val || spells) { if (!spells) { try { spells = JSON.parse(Cfg.spells); } catch (err) {} spells = spells || [Date.now(), [], null, null]; } var idx; var isAdded = true; var scope = aib.t ? [aib.b, aib.t] : null; if (spells[1]) { var sScope = String(scope); var 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) { saveCfg('hideBySpell', 1); if (chk) { chk.checked = true; } } else if (!spells[1] && !spells[2] && !spells[3]) { saveCfg('hideBySpell', 0); if (chk) { chk.checked = false; } } if (spells[1] && Cfg.sortSpells) { this._sort(spells[1]); } saveCfg('spells', JSON.stringify(spells)); this.setSpells(spells, true); if (fld) { fld.value = this.list; } Pview.updatePosition(true); return; } if (chk) { chk.checked = false; } }, 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 _ref16 = wipeMsg || [], _ref17 = _slicedToArray(_ref16, 2), msgBit = _ref17[0], msgData = _ref17[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 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 value = null; var configurable = true; Object.defineProperties(this, { hiders: { configurable: configurable, value: value }, outreps: { configurable: configurable, value: value }, reps: { configurable: configurable, value: value } }); saveCfg('hideBySpell', 0); }, outReplace: function outReplace(txt) { for (var _iterator9 = _createForOfIteratorHelperLoose(this.outreps), _step9; !(_step9 = _iterator9()).done;) { var orep = _step9.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 _iterator10 = _createForOfIteratorHelperLoose(this.reps), _step10; !(_step10 = _iterator10()).done;) { var rep = _step10.value; txt = txt.replace(rep[0], rep[1]); } return txt; }, setSpells: function setSpells(spells, sync) { if (sync) { this._sync(spells); } if (!Cfg.hideBySpell) { SpellsRunner.unhideAll(); this.disableSpells(); return; } this._optimize(spells); if (this.hiders) { var sRunner = new SpellsRunner(); for (var post = Thread.first.op; post; post = post.next) { sRunner.runSpells(post); } sRunner.endSpells(); } else { SpellsRunner.unhideAll(); } }, toggle: function toggle() { var spells; var fld = $id('de-spell-txt'); var val = fld.value; if (val && (spells = this.parseText(val))) { closePopup('err-spell'); this.setSpells(spells, true); saveCfg('spells', JSON.stringify(spells)); fld.value = this.list; } else { if (!val) { closePopup('err-spell'); SpellsRunner.unhideAll(); this.disableSpells(); saveCfg('spells', JSON.stringify([Date.now(), null, null, null])); sendStorageEvent('__de-spells', '{ hide: false, data: null }'); } $q('input[info="hideBySpell"]').checked = false; } }, _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 _iterator11 = _createForOfIteratorHelperLoose(data), _step11; !(_step11 = _iterator11()).done;) { var item = _step11.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 _iterator12 = _createForOfIteratorHelperLoose(data), _step12; !(_step12 = _iterator12()).done;) { var item = _step12.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 _iterator13 = _createForOfIteratorHelperLoose(data), _step13; !(_step13 = _iterator13()).done;) { var _step13$value = _slicedToArray(_step13.value, 4), r0 = _step13$value[0], r1 = _step13$value[1], r2 = _step13$value[2], r3 = _step13$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 _i10 = 0, _len8 = sp.length - 1; _i10 < _len8; ++_i10) { var j = _i10 + 1; if (sp[_i10][0] === sp[j][0] && sp[_i10][1] <= sp[j][1] && sp[_i10][1] >= sp[j][1] && (sp[_i10][2] === null || sp[_i10][2] === undefined || sp[_i10][2] <= sp[j][2] && sp[_i10][2] >= sp[j][2])) { sp.splice(j, 1); _i10--; _len8--; } else if (sp[_i10][0] === 0xFF) { sp.push(sp.splice(_i10, 1)[0]); _i10--; _len8--; } } }, _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; } _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: 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 _i11 = 0, len = arr.length; _i11 < len; ++_i11) { switch (arr[_i11]) { 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]; this[1].push(nums); } else { this[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; } }]); return SpellsCodegen; }(); 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; } } _createClass(SpellsRunner, [{ key: "endSpells", value: function endSpells() { var _this29 = this; if (this._endPromise) { this._endPromise.then(function () { return _this29._savePostsHelper(); }); } else { this._savePostsHelper(); } } }, { key: "runSpells", value: function runSpells(post) { var _this30 = this; var res = new SpellsInterpreter(post, this._spells).runInterpreter(); if (res instanceof Promise) { res = res.then(function (val) { return _this30._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, _ref18) { var _ref19 = _slicedToArray(_ref18, 3), hasNumSpell = _ref19[0], val = _ref19[1], msg = _ref19[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; } }]); return SpellsRunner; }(); 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; } _createClass(SpellsInterpreter, [{ key: "runInterpreter", value: function runInterpreter() { var _this31 = 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) { this._ctx.push(len, scope, ++i, isNegScope); return val.then(function (v) { return _this31._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 _iterator14 = _createForOfIteratorHelperLoose(this._triggeredSpellsStack), _step14; !(_step14 = _iterator14()).done;) { var spellEls = _step14.value; for (var _iterator15 = _createForOfIteratorHelperLoose(spellEls), _step15; !(_step15 = _iterator15()).done;) { var _step15$value = _slicedToArray(_step15.value, 3), isNeg = _step15$value[0], spell = _step15$value[1], wipeMsg = _step15$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); } } }, { 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( _regeneratorRuntime().mark(function _callee11(val) { var _iterator16, _step16, image; return _regeneratorRuntime().wrap(function _callee11$(_context13) { while (1) { switch (_context13.prev = _context13.next) { case 0: _iterator16 = _createForOfIteratorHelperLoose(this._post.images); case 1: if ((_step16 = _iterator16()).done) { _context13.next = 14; break; } image = _step16.value; _context13.t0 = image instanceof AttachedImage; if (!_context13.t0) { _context13.next = 10; break; } _context13.next = 7; return ImagesHashStorage.getHash(image); case 7: _context13.t1 = _context13.sent; _context13.t2 = val; _context13.t0 = _context13.t1 === _context13.t2; case 10: if (!_context13.t0) { _context13.next = 12; break; } return _context13.abrupt("return", true); case 12: _context13.next = 1; break; case 14: return _context13.abrupt("return", false); case 15: case "end": return _context13.stop(); } } }, _callee11, this); })); function _ihash(_x9) { 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 _iterator17 = _createForOfIteratorHelperLoose(images), _step17; !(_step17 = _iterator17()).done;) { var image = _step17.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 _iterator18 = _createForOfIteratorHelperLoose(this._post.images), _step18; !(_step18 = _iterator18()).done;) { var image = _step18.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: "_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 _iterator19 = _createForOfIteratorHelperLoose(videos.vData), _step19; !(_step19 = _iterator19()).done;) { var siteData = _step19.value; for (var _iterator20 = _createForOfIteratorHelperLoose(siteData), _step20; !(_step20 = _iterator20()).done;) { var data = _step20.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 _i12 = 0, _n2 = len / 4; _i12 < len; keys++) { x = arr[_i12]; var _j = 0; while (arr[_i12++] === x) { _j++; } if (len > 25) { if (_j > pop && x.length > 2) { pop = _j; } if (pop >= _n2) { 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 _n3 = 0; var capsw = 0; var casew = 0; for (var _i13 = 0; _i13 < len; ++_i13) { x = arr[_i13]; if ((x.match(/[a-zа-я]/ig) || []).length < 5) { continue; } if ((x.match(/[A-ZА-Я]/g) || []).length > 2) { casew++; } if (x === x.toUpperCase()) { capsw++; } _n3++; } if (capsw / _n3 >= 0.3 && _n3 > 4) { this._wipeMsg = [16, "CAPS ".concat(capsw / arr.length * 100, "%")]; return true; } else if (casew / _n3 >= 0.3 && _n3 > 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 _arr2 = val[1], _i14 = _arr2.length - 1; _i14 >= 0; --_i14) { if (num >= _arr2[_i14][0] && num <= _arr2[_i14][1]) { return true; } } return false; } }]); return SpellsInterpreter; }(); var PostForm = function () { function PostForm(form) { var _this32 = 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._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); pr = new PostForm(form && doc.adoptNode(form), oeForm && doc.adoptNode(oeForm), true); }, function () { return pr = 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.updateLanguage(); this._initCaptcha(); this._initSubmit(); if (Cfg.ajaxPosting) { this._initAjaxPosting(); } if (Cfg.addSageBtn && this.mail) { PostForm.hideField(this.mail.closest('label') || this.mail); setTimeout(function () { return _this32.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); } } _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 _this33 = this; var value = $aEnd(this.subm, '' + ''); value.onclick = function () { toggleCfg('sageReply'); _this33.toggleSage(); }; Object.defineProperty(this, 'sageBtn', { value: value }); return value; } }, { key: "top", get: function get() { return this.pForm.getBoundingClientRect().top; } }, { key: "addMarkupPanel", value: function addMarkupPanel() { var _this34 = this; var el = $id('de-txt-panel'); if (!Cfg.addTextBtns) { aib.removeFormButtons(el); return; } if (!el) { el = $add(''); ['click', 'mouseover'].forEach(function (e) { return el.addEventListener(e, _this34); }); } el.style.cssFloat = Cfg.txtBtnsLoc ? 'none' : 'right'; aib.insertFormButtons(this, 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: "handleEvent", value: function handleEvent(e) { var el = e.target; if (el.tagName !== 'DIV') { el = el.parentNode; } var _el7 = el, id = _el7.id; if (!id.startsWith('de-btn')) { return; } if (e.type === 'mouseover') { if (id === 'de-btn-quote') { quotedText = deWindow.getSelection().toString(); } 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 = pr.txta; var start = txtaEl.selectionStart, end = txtaEl.selectionEnd; var quote = Cfg.spacedQuote ? '> ' : '>'; if (id === 'de-btn-quote') { insertText(txtaEl, quote + (start === end ? quotedText : txtaEl.value.substring(start, end)).replace(/^[\r\n]|[\r\n]+$/g, '').replace(/\n/gm, '\n' + quote) + (quotedText ? '\n' : '')); quotedText = ''; } else { var scrtop = txtaEl.scrtop; var val = PostForm._wrapText(el.getAttribute('de-tag'), txtaEl.value.substring(start, end)); var len = start + val[0]; txtaEl.value = txtaEl.value.substr(0, start) + val[1] + txtaEl.value.substr(end); txtaEl.setSelectionRange(len, len); txtaEl.focus(); txtaEl.scrollTop = scrtop; } e.preventDefault(); e.stopPropagation(); } }, { key: "refreshCap", value: function refreshCap() { var isErr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; if (this.cap) { this.cap.refreshCaptcha(isErr, isErr, 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.cap) { this._setPlaceholder('cap'); } } }, { 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.refreshCap(); } 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 = "de-abtn de-parea-btn-".concat(aib.t ? 'reply' : 'thr'); } else if (isCloseReply && !quotedText && post.wrap.nextElementSibling === this.qArea) { this.closeReply(); return; } post.wrap.after(this.qArea); if (this.qArea.classList.contains('de-win')) { updateWinZ(this.qArea.style); } 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.refreshCap(); } 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 = !quotedText ? '' : "".concat(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: "updateLanguage", value: function updateLanguage() { this.txta.title = Lng.pasteImage[lang]; aib.updateSubmitBtn(this.subm); } }, { key: "updatePAreaBtns", value: function updatePAreaBtns() { var txt = 'de-abtn 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 _this35 = this; var el; if (aib.qFormRedir && (el = $q(aib.qFormRedir, this.form))) { aib.disableRedirection(el); } this.form.onsubmit = function (e) { e.preventDefault(); $popup('upload', Lng.sending[lang], true); html5Submit(_this35.form, _this35.subm, true).then(checkSubmit)["catch"](showSubmitError); }; } }, { key: "_initCaptcha", value: function _initCaptcha() { var _this36 = this; var capEl = $q('input[type="text"][name*="aptcha"], *[id*="captcha"], *[class*="captcha"]', this.form); if (!capEl) { this.cap = null; return; } this.cap = new Captcha(capEl, this.tNum); var updCapFn = function updCapFn() { _this36.cap.addCaptcha(); _this36.cap.updateOutdated(); }; this.txta.addEventListener('focus', updCapFn); if (this.files) { this.files.onchange = updCapFn; } this.form.addEventListener('click', function () { return _this36.cap.addCaptcha(); }, true); } }, { key: "_initFileInputs", value: function _initFileInputs() { var _this37 = this; var fileEl = $q(aib.qFormFile, this.form); if (!fileEl) { return; } if (aib.fixFileInputs) { aib.fixFileInputs(fileEl.closest(aib.qFormTd)); } this.files = new Files(this, $q(aib.qFormFile, this.form)); deWindow.addEventListener('load', function () { return setTimeout(function () { return !_this37.files.filesCount && _this37.files.clearInputs(); }, 0); }); } }, { key: "_initSubmit", value: function _initSubmit() { var _this38 = this; this.subm.addEventListener('click', function (e) { if (Cfg.warnSubjTrip && _this38.subj && /#.|##./.test(_this38.subj.value)) { e.preventDefault(); $popup('upload', Lng.subjHasTrip[lang]); return; } var val = _this38.txta.value; if (Spells.outreps) { val = Spells.outReplace(val); } if (_this38.tNum && pByNum.get(_this38.tNum).subj === 'Dollchan Extension Tools') { var temp = "\n\n".concat(PostForm._wrapText(aib.markupTags[5], "".concat('-'.repeat(50), "\n").concat(nav.ua, "\nv").concat(version, ".").concat(commit).concat(nav.isESNext ? '.es6' : '', " [").concat(nav.scriptHandler, "]"))[1]); if (!val.includes(temp)) { val += temp; } } _this38.txta.value = val; _this38.toggleSage(); if (Cfg.ajaxPosting) { $popup('upload', Lng.checking[lang], true); } if (_this38.video && (val = _this38.video.value) && (val = val.match(Videos.ytReg))) { _this38.video.value = 'http://www.youtube.com/watch?v=' + val[1]; } if (_this38.isQuick) { $hide(_this38.pForm); $hide(_this38.qArea); _this38._pBtn[+_this38.isBottom].after(_this38.pForm); } updater.pauseUpdater(); }); } }, { key: "_initTextarea", value: function _initTextarea() { var _this39 = this; var el = this.txta; if (aib.dobrochan) { el.removeAttribute('id'); } 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 _ref20 = _asyncToGenerator( _regeneratorRuntime().mark(function _callee12(e) { var _e$clipboardData; var files, _iterator21, _step21, file, inputs, i, len, input; return _regeneratorRuntime().wrap(function _callee12$(_context14) { while (1) { switch (_context14.prev = _context14.next) { case 0: files = e === null || e === void 0 ? void 0 : (_e$clipboardData = e.clipboardData) === null || _e$clipboardData === void 0 ? void 0 : _e$clipboardData.files; _iterator21 = _createForOfIteratorHelperLoose(files); case 2: if ((_step21 = _iterator21()).done) { _context14.next = 17; break; } file = _step21.value; inputs = _this39.files._inputs; i = 0, len = inputs.length; case 6: if (!(i < len)) { _context14.next = 15; break; } input = inputs[i]; if (input.hasFile) { _context14.next = 12; break; } _context14.next = 11; return input.addUrlFile(URL.createObjectURL(file), file); case 11: return _context14.abrupt("break", 15); case 12: ++i; _context14.next = 6; break; case 15: _context14.next = 2; break; case 17: case "end": return _context14.stop(); } } }, _callee12); })); return function (_x10) { return _ref20.apply(this, arguments); }; }()); if (nav.isFirefox || nav.isWebkit) { el.addEventListener('mouseup', function (_ref21) { var target = _ref21.target; var s = target.style; var width = s.width, height = s.height; s.setProperty('width', width + 'px', 'important'); s.setProperty('height', height + 'px', 'important'); saveCfg('textaWidth', parseInt(width, 10)); saveCfg('textaHeight', parseInt(height, 10)); }); return; } $aEnd(el, '
').addEventListener('mousedown', { _el: el, _elStyle: style, handleEvent: function handleEvent(e) { var _this40 = this; switch (e.type) { case 'mousedown': ['mousemove', 'mouseup'].forEach(function (e) { return docBody.addEventListener(e, _this40); }); 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 docBody.removeEventListener(e, _this40); }); saveCfg('textaWidth', parseInt(this._elStyle.width, 10)); saveCfg('textaHeight', parseInt(this._elStyle.height, 10)); } } }); } }, { key: "_makeHideableContainer", value: function _makeHideableContainer() { var _this41 = this; (this.pForm = $add('
')).append(this.form || '', this.oeForm || ''); var html = '
[]

'; this.pArea = [$bBegin(DelForm.first.el, html), $aEnd(aib._4chan ? $q('.board', DelForm.first.el) : DelForm.first.el, html)]; this._pBtn = [this.pArea[0].firstChild, this.pArea[1].firstChild]; this._pBtn[0].firstElementChild.onclick = function (e) { return _this41.showMainReply(false, e); }; this._pBtn[1].firstElementChild.onclick = function (e) { return _this41.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 _this42 = 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 (_ref22) { var target = _ref22.target; var el = target.parentNode; switch (nav.fixEventEl(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 _ref23 = _toConsumableArray(buttons.children), clearBtn = _ref23[0], toggleBtn = _ref23[1], closeBtn = _ref23[2]; clearBtn.onclick = function () { saveCfg('sageReply', 0); _this42.toggleSage(); _this42.files.clearInputs(); [_this42.txta, _this42.name, _this42.mail, _this42.subj, _this42.video, _this42.cap && _this42.cap.textEl].forEach(function (el) { return el && (el.value = ''); }); }; toggleBtn.onclick = function () { toggleCfg('replyWinDrag'); if (Cfg.replyWinDrag) { _this42.qArea.className = aib.cReply + ' de-win'; updateWinZ(_this42.qArea.style); } else { _this42.qArea.className = aib.cReply + ' de-win-inpost'; _this42.txta.focus(); } }; closeBtn.onclick = function () { return _this42.closeReply(); }; } }, { key: "_setPlaceholder", value: function _setPlaceholder(val) { var el = val === 'cap' ? this.cap.textEl : this[val]; if (el) { $toggleAttr(el, 'placeholder', Lng[val][lang], aib.multiFile || Cfg.fileInputs !== 2); } } }, { key: "_toggleQuickReply", value: function _toggleQuickReply(tNum) { if (this.oeForm) { $del($q('input[name="oek_parent"]', this.oeForm)); if (tNum) { this.oeForm.insertAdjacentHTML('afterbegin', "")); } } if (this.form) { if (aib.changeReplyMode && tNum !== this.tNum) { aib.changeReplyMode(this.form, tNum); } $del($q("input[name=\"".concat(aib.formParent, "\"]"), this.form)); if (tNum) { this.form.insertAdjacentHTML('afterbegin', "")); } } } }], [{ key: "hideField", value: function hideField(el) { var next = el.nextElementSibling; $toggle(next && next.style.display !== 'none' || el.previousElementSibling ? el : el.closest(aib.qFormTr)); } }, { key: "setUserName", value: function setUserName() { var el = $q('input[info="nameValue"]'); if (el) { saveCfg('nameValue', el.value); } pr.name.value = Cfg.userName ? Cfg.nameValue : ''; } }, { key: "setUserPassw", value: function setUserPassw() { if (!Cfg.userPassw) { return; } var el = $q('input[info="passwValue"]'); if (el) { saveCfg('passwValue', el.value); } var value = pr.passw.value = Cfg.passwValue; for (var _iterator22 = _createForOfIteratorHelperLoose(DelForm), _step22; !(_step22 = _iterator22()).done;) { var passEl = _step22.value.passEl; if (passEl) { passEl.value = value; } } } }, { 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)]; } }]); return PostForm; }(); 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(/]+>Назад.+| :not(legend):not(:first-of-type) *')) { return true; } } return false; } function getFormElements(form, submitter) { var controls, fixName, i, len, field, tagName, type, name, options, j, jlen, option, img, files, _j2, _jlen, dirname; return _regeneratorRuntime().wrap(function getFormElements$(_context15) { while (1) { switch (_context15.prev = _context15.next) { 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 3: if (!(i < len)) { _context15.next = 65; break; } field = controls[i]; tagName = field.tagName.toLowerCase(); type = field.getAttribute('type'); name = field.getAttribute('name'); if (!(field.closest('datalist') || isFormElDisabled(field) || field !== submitter && (tagName === 'button' || tagName === 'input' && (type === 'submit' || type === 'reset' || type === 'button')) || tagName === 'input' && (type === 'checkbox' && !field.checked || type === 'radio' && !field.checked || type === 'image' && !name) || tagName === 'object')) { _context15.next = 10; break; } return _context15.abrupt("continue", 62); case 10: if (!(tagName === 'select')) { _context15.next = 23; break; } options = $Q('select > option, select > optgrout > option', field); j = 0, jlen = options.length; case 13: if (!(j < jlen)) { _context15.next = 21; break; } option = options[j]; if (!(option.selected && !isFormElDisabled(option))) { _context15.next = 18; break; } _context15.next = 18; return { type: type, el: field, name: fixName(name), value: option.value }; case 18: ++j; _context15.next = 13; break; case 21: _context15.next = 51; break; case 23: if (!(tagName === 'input')) { _context15.next = 51; break; } _context15.t0 = type; _context15.next = _context15.t0 === 'image' ? 27 : _context15.t0 === 'checkbox' ? 28 : _context15.t0 === 'radio' ? 28 : _context15.t0 === 'file' ? 31 : 51; break; case 27: throw new Error('input[type="image"] is not supported'); case 28: _context15.next = 30; return { type: type, el: field, name: fixName(name), value: field.value || 'on' }; case 30: return _context15.abrupt("continue", 62); case 31: img = void 0; if (!field.files.length) { _context15.next = 43; break; } files = field.files; _j2 = 0, _jlen = files.length; case 35: if (!(_j2 < _jlen)) { _context15.next = 41; break; } _context15.next = 38; return { name: name, type: type, el: field, value: files[_j2] }; case 38: ++_j2; _context15.next = 35; break; case 41: _context15.next = 50; break; case 43: if (!(field.obj && (img = field.obj.imgFile))) { _context15.next = 48; break; } _context15.next = 46; return { name: name, type: type, el: field, value: new File([img.data], img.name, { type: img.type }) }; case 46: _context15.next = 50; break; case 48: _context15.next = 50; return { el: field, name: fixName(name), type: 'application/octet-stream', value: new File([''], '') }; case 50: return _context15.abrupt("continue", 62); case 51: if (!(type === 'textarea')) { _context15.next = 56; break; } _context15.next = 54; return { type: type, el: field, name: name || '', value: field.value }; case 54: _context15.next = 58; break; case 56: _context15.next = 58; return { type: type, el: field, name: fixName(name), value: field.value }; case 58: dirname = field.getAttribute('dirname'); if (!dirname) { _context15.next = 62; break; } _context15.next = 62; return { el: field, name: fixName(dirname), type: 'direction', value: nav.matchesSelector(field, ':dir(rtl)') ? 'rtl' : 'ltr' }; case 62: ++i; _context15.next = 3; break; case 65: case "end": return _context15.stop(); } } }, _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 _ref24 = _toConsumableArray(counterWrap.children), counterEl = _ref24[0], totalEl = _ref24[1], speedEl = _ref24[2]; return function (_ref25) { var total = _ref25.total, i = _ref25.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(_x12, _x13) { return _html5Submit.apply(this, arguments); } function _html5Submit() { _html5Submit = _asyncToGenerator( _regeneratorRuntime().mark(function _callee25(form, submitter) { var needProgress, data, hasFiles, _iterator38, _step38, _step38$value, name, value, type, el, val, _el$obj, _el$obj$imgFile, fileName, newFileName, mime, cleanData, ajaxParams, url, _args35 = arguments; return _regeneratorRuntime().wrap(function _callee25$(_context35) { while (1) { switch (_context35.prev = _context35.next) { case 0: needProgress = _args35.length > 2 && _args35[2] !== undefined ? _args35[2] : false; data = new FormData(); hasFiles = false; _iterator38 = _createForOfIteratorHelperLoose(getFormElements(form, submitter)); case 4: if ((_step38 = _iterator38()).done) { _context35.next = 30; break; } _step38$value = _step38.value, name = _step38$value.name, value = _step38$value.value, type = _step38$value.type, el = _step38$value.el; val = value; if (!(name === 'de-file-txt')) { _context35.next = 9; break; } return _context35.abrupt("continue", 28); case 9: if (!(type === 'file')) { _context35.next = 27; break; } hasFiles = true; fileName = value.name; newFileName = !Cfg.removeFName || (_el$obj = el.obj) !== null && _el$obj !== void 0 && (_el$obj$imgFile = _el$obj.imgFile) !== null && _el$obj$imgFile !== void 0 && _el$obj$imgFile.isConstName ? 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' && !aib.makaba))) { _context35.next = 26; break; } _context35.t0 = cleanFile; _context35.next = 18; return readFile(value); case 18: _context35.t1 = _context35.sent.data; _context35.t2 = el.obj ? el.obj.extraFile : null; cleanData = (0, _context35.t0)(_context35.t1, _context35.t2); if (cleanData) { _context35.next = 23; break; } return _context35.abrupt("return", Promise.reject(new Error(Lng.fileCorrupt[lang] + ': ' + fileName))); case 23: val = new File(cleanData, newFileName, { type: mime }); _context35.next = 27; break; case 26: if (Cfg.removeFName) { val = new File([value], newFileName, { type: mime }); } case 27: data.append(name, val); case 28: _context35.next = 4; break; case 30: if (!aib.sendHTML5Post) { _context35.next = 32; break; } return _context35.abrupt("return", aib.sendHTML5Post(form, data, needProgress, hasFiles)); case 32: ajaxParams = { data: data, method: 'POST' }; if (needProgress && hasFiles) { ajaxParams.onprogress = getUploadFunc(); } url = form.action; return _context35.abrupt("return", $ajax(url, ajaxParams).then(function (_ref52) { var text = _ref52.responseText; return aib.jsonSubmit ? text : aib.stormWallFixSubmit ? aib.stormWallFixSubmit(url, text, ajaxParams) : $createDoc(text); })["catch"](function (err) { return Promise.reject(err); })); case 36: case "end": return _context35.stop(); } } }, _callee25); })); return _html5Submit.apply(this, arguments); } function cleanFile(data, extraData) { var img = nav.getUnsafeUint8Array(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.getUnsafeUint8Array(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.getUnsafeUint8Array(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.getUnsafeUint8Array(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.getUnsafeUint8Array(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, off, len) { var xRes = 0; var yRes = 0; var resT = 0; var dv = nav.getUnsafeDataView(data, off); 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(); } _createClass(Files, [{ key: "rarInput", get: function get() { var value = $bEnd(docBody, ''); 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 _iterator23 = _createForOfIteratorHelperLoose(this._inputs), _step23; !(_step23 = _iterator23()).done;) { var inp = _step23.value; inp.changeMode(isThumbMode); } this.hideEmpty(); } }, { key: "clearInputs", value: function clearInputs() { for (var _iterator24 = _createForOfIteratorHelperLoose(this._inputs), _step24; !(_step24 = _iterator24()).done;) { var inp = _step24.value; inp.clearInp(); } this.hideEmpty(); } }, { 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(); } } }]); return Files; }(); 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 _ref26 = _toConsumableArray(this._utils.children); this._btnRar = _ref26[0]; this._btnSpoil = _ref26[1]; this._btnTxt = _ref26[2]; this._btnRen = _ref26[3]; this._btnDel = _ref26[4]; this._utils.addEventListener('click', this); this._txtWrap = $add("\n\t\t\t\n\t\t\t")); var _ref27 = _toConsumableArray(this._txtWrap.children); this._txtInput = _ref27[0]; this._txtAddBtn = _ref27[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._input.before(this._txtWrap); this._input.after(this._utils); } } _createClass(FileInput, [{ key: "addUrlFile", value: function () { var _addUrlFile = _asyncToGenerator( _regeneratorRuntime().mark(function _callee13(url) { var _this43 = this; var file, _args16 = arguments; return _regeneratorRuntime().wrap(function _callee13$(_context16) { while (1) { switch (_context16.prev = _context16.next) { case 0: file = _args16.length > 1 && _args16[1] !== undefined ? _args16[1] : null; if (url) { _context16.next = 3; break; } return _context16.abrupt("return", Promise.reject(new Error('URL is null'))); case 3: $popup('file-loading', Lng.loading[lang], true); _context16.next = 6; return ContentLoader.loadImgData(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'); _this43._isTxtEditable = _this43._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; } } _this43.imgFile = { data: data.buffer, name: name, type: type || getFileMime(name) }; if (!file) { file = new Blob([data], { type: _this43.imgFile.type }); file.name = name; } _this43._parent._files[_this43._parent._inputs.indexOf(_this43)] = file; DollchanAPI.notify('filechange', _this43._parent._files); if (FileInput._isThumbMode) { $hide(_this43._txtWrap); } _this43._onFileChange(true); }); case 6: return _context16.abrupt("return", _context16.sent); case 7: case "end": return _context16.stop(); } } }, _callee13); })); function addUrlFile(_x14) { return _addUrlFile.apply(this, arguments); } return addUrlFile; }() }, { key: "changeMode", value: function changeMode(showThumbs) { $toggle(this._input, !Cfg.fileInputs); $toggleAttr(this._input, 'multiple', true, aib.multiFile && Cfg.fileInputs); $toggle(this._btnRen, Cfg.fileInputs && this.hasFile); if (!(showThumbs ^ !!this._thumb)) { return; } if (showThumbs) { this._initThumbs(); return; } this._input.before(this._txtWrap); this._input.after(this._utils); $del($q('de-file-txt-area')); $show(this._parent.fileTr); $show(this._txtWrap); if (this._mediaEl) { deWindow.URL.revokeObjectURL(this._mediaEl.src); } this._toggleDragEvents(this._thumb, false); $del(this._thumb); 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) { this._toggleDelBtn(false); $hide(this._btnSpoil); if (this._spoilEl) { this._spoilEl.checked = this._btnSpoil.checked = false; } $hide(this._btnRar); $hide(this._txtAddBtn); $del(this._rarMsg); 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 _this44 = 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) { (function () { 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) { _this44._removeFileHelper(); } }); _this44._parent._files[curInpIdx + i] = el.files[i]; } })(); } else { if (filesLen > 0) { setTimeout(function () { return _this44._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.isConstName = 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 (_ref28) { var data = _ref28.data; _this44.imgFile = { data: data, name: newName, type: file.type, isConstName: true }; _this44._removeFileHelper(); if (FileInput._isThumbMode) { _this44._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 i = _inpArray.indexOf(this), j = 0; i < inpLen && j < _filesLen; ++i, ++j) { FileInput._readDroppedFile(_inpArray[i], dt.files[j]); this._parent._files[i] = dt.files[j]; } 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 _this45 = this; var el = this._parent.rarInput; el.onchange = function (e) { $hide(_this45._btnRar); var myBtn = _this45._rarMsg = $aBegin(_this45._utils, ''); var file = e.target.files[0]; readFile(file).then(function (_ref29) { var data = _ref29.data; if (_this45._rarMsg === myBtn) { myBtn.className = 'de-file-rarmsg'; var origFileName = _this45.imgFile ? _this45.imgFile.name : _this45._input.files[0].name; myBtn.title = origFileName + ' + ' + file.name; myBtn.textContent = getFileExt(origFileName) + ' + ' + getFileExt(file.name); _this45.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); if (aib.dobrochan) { $id('post_files_count').value = this._parent.filesCount + 1; } } }, { key: "_initThumbs", value: function _initThumbs() { var _this46 = this; var fileTr = this._parent.fileTr; $hide(fileTr); $hide(this._txtWrap); var isTr = fileTr.tagName === '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 _this46._thumb.addEventListener(e, _this46); }); this._thumb.append(this._utils); this._toggleDragEvents(this._thumb, true); if (this.hasFile) { this._showFileThumb(); } } }, { key: "_onFileChange", value: function _onFileChange(hasImgFile) { this._txtInput.value = hasImgFile ? this.imgFile.name : this._input.files[0].name; if (!hasImgFile) { this.imgFile = null; } if (this._parent.onchange) { this._parent.onchange(); } 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 (!nav.isPresto && !aib._4chan && /^image\/(?:png|jpeg)$/.test(hasImgFile ? this.imgFile.type : this._input.files[0].type)) { $del(this._rarMsg); $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 _this47 = 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 (_ref30) { var data = _ref30.data; if (_this47._input.files[0] === file) { _this47._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 _this48 = this; var name = isAdd ? 'addEventListener' : 'removeEventListener'; el[name]('dragover', function (e) { return e.preventDefault(); }); ['dragenter', 'dragleave', 'drop'].forEach(function (e) { return el[name](e, _this48); }); } }], [{ key: "_isThumbMode", get: function get() { return Cfg.fileInputs === 2; } }, { key: "_readDroppedFile", value: function _readDroppedFile(inputObj, file) { return readFile(file).then(function (_ref31) { var data = _ref31.data; inputObj.imgFile = { data: data, name: file.name, type: file.type }; inputObj.showInp(); inputObj._onFileChange(true); }); } }]); return FileInput; }(); 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.getCapParent(el); this.isAdded = false; this.isSubmitWait = false; this._isRecap = !aib._02ch && !!$q('[id*="recaptcha"], [class*="recaptcha"]', this.parentEl); this._lastUpdate = null; this.originHTML = this.parentEl.innerHTML; $hide(this.parentEl); if (!this._isRecap) { this.parentEl.innerHTML = ''; } } _createClass(Captcha, [{ key: "addCaptcha", value: function addCaptcha() { if (this.isAdded) { return; } this.isAdded = true; if (!this._isRecap) { this.parentEl.innerHTML = this.originHTML; this.textEl = $q('input[type="text"][name*="aptcha"]', this.parentEl); } else { var el = $q('#g-recaptcha, .g-recaptcha'); $replace(el, "
")); } this.initCapPromise(); } }, { 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: "initCapPromise", value: function initCapPromise() { var _this49 = this; var initPromise = aib.captchaInit ? aib.captchaInit(this) : null; if (initPromise) { initPromise.then(function () { return _this49.showCaptcha(); }, function (err) { if (err instanceof AjaxError) { _this49._setUpdateError(err); } else { _this49.hasCaptcha = false; } }); } else if (this.hasCaptcha) { this.showCaptcha(true); } } }, { key: "initImage", value: function initImage(img) { var _this50 = 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 _this50.refreshCaptcha(true); }; } }, { key: "initTextEl", value: function initTextEl() { var _this51 = this; this.textEl.autocomplete = 'off'; if (!aib.formHeaders && (aib.multiFile || Cfg.fileInputs !== 2)) { this.textEl.placeholder = Lng.cap[lang]; } ['keypress', 'focus'].forEach(function (e) { return _this51.textEl.addEventListener(e, _this51); }); 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._updateRecap(); } 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 === 'A') { a.replaceWith(img); } if (isUpdateImage) { this.refreshCaptcha(false); } else { this._lastUpdate = Date.now(); } $show(this.parentEl); } }, { key: "refreshCaptcha", value: function refreshCaptcha(isFocus) { var _this52 = this; var isErr = 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 && !isErr) { return; } this._lastUpdate = Date.now(); if (aib.captchaUpdate) { var updatePromise = aib.captchaUpdate(this, isErr); if (updatePromise) { updatePromise.then(function () { return _this52._updateTextEl(isFocus); }, function (err) { return _this52._setUpdateError(err); }); } } else if (this._isRecap) { this._updateRecap(); } 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; if (aib.stormWallFixCaptcha) { aib.stormWallFixCaptcha(newSrc, img); } } } }, { key: "updateHelper", value: function updateHelper(url, fn) { if (aib._capUpdPromise) { aib._capUpdPromise.cancelPromise(); } return aib._capUpdPromise = $ajax(url).then(function (xhr) { aib._capUpdPromise = null; fn(xhr); }, function (err) { if (!(err instanceof CancelError)) { aib._capUpdPromise = null; return CancelablePromise.reject(err); } }); } }, { key: "updateOutdated", value: function updateOutdated() { if (this._lastUpdate && Date.now() - this._lastUpdate > Cfg.capUpdTime * 1e3) { this.refreshCaptcha(false); } } }, { key: "_setUpdateError", value: function _setUpdateError(e) { var _this53 = this; if (e) { this.parentEl = e.toString(); this.isAdded = false; this.parentEl.onclick = function () { _this53.parentEl.onclick = null; _this53.addCaptcha(); }; $show(this.parentEl); } } }, { key: "_updateRecap", value: function _updateRecap() { var script = doc.createElement('script'); script.type = 'text/javascript'; script.src = aib.prot + '//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(); } } } }]); return Captcha; }(); 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._linkDelay = 0; this._menu = null; this._menuDelay = 0; } _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: _regeneratorRuntime().mark(function refLinks() { var links, lNum, i, len, link, tc; return _regeneratorRuntime().wrap(function refLinks$(_context17) { while (1) { switch (_context17.prev = _context17.next) { case 0: links = $Q('a', this.msg); i = 0, len = links.length; case 2: if (!(i < len)) { _context17.next = 12; break; } link = links[i]; tc = link.textContent; if (!(tc[0] !== '>' || tc[1] !== '>' || !(lNum = parseInt(tc.substr(2), 10)))) { _context17.next = 7; break; } return _context17.abrupt("continue", 9); case 7: _context17.next = 9; return [link, lNum]; case 9: ++i; _context17.next = 2; break; case 12: case "end": return _context17.stop(); } } }, 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 _this54 = this; var temp; var el = nav.fixEventEl(e.target); var type = e.type; var isOutEvent = type === 'mouseout'; var isPview = this instanceof Pview; if (type === 'click') { switch (e.button) { case 0: break; case 1: e.stopPropagation(); default: return; } if (this._menu) { this._menu.removeMenu(); this._menu = null; } switch (el.tagName) { case 'A': if (el.classList.contains('de-video-link')) { this.videos.clickLink(el, Cfg.embedYTube); e.preventDefault(); return; } if (!(temp = el.firstElementChild) || temp.tagName !== 'IMG') { temp = el.parentNode; if (temp === this.trunc) { this._getFullMsg(temp, false); e.preventDefault(); e.stopPropagation(); } else if (Cfg.insertNum && pr.form && (this._pref === temp || this._pref === el) && !/Reply|Ответ/.test(el.textContent)) { e.preventDefault(); e.stopPropagation(); if (!Cfg.showRepBtn) { quotedText = deWindow.getSelection().toString(); pr.showQuickReply(isPview ? Pview.topParent : this, this.num, !isPview, false); quotedText = ''; } else if (pr.isQuick || aib.t && pr.isHidden) { pr.showQuickReply(isPview ? Pview.topParent : this, this.num, false, true); } else if (aib.t) { var formText = pr.txta.value; var isOnNewLine = formText === '' || formText.slice(-1) === '\n'; insertText(pr.txta, ">>".concat(this.num).concat(isOnNewLine ? '\n' : '')); } else { deWindow.location.assign(el.href.replace(/#i/, '#')); } } else if ((temp = el.textContent)[0] === '>' && temp[1] === '>' && !temp[2].includes('/')) { var post = pByNum.get(+temp.match(/\d+/)); if (post) { post.selectAndScrollTo(); } } return; } el = temp; case 'IMG': if (el.classList.contains('de-video-thumb')) { if (Cfg.embedYTube === 1) { var videos = this.videos; videos.currentLink.classList.add('de-current'); videos.setPlayer(videos.playerInfo, el.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; } if (aib.makaba) { var c = el.classList; if (c.contains('post__rate') || c[0] === 'like-div' || c[0] === 'dislike-div' || (temp = el.parentNode) && ((c = temp.classList).contains('post__rate') || c[0] === 'like-div' || c[0] === 'dislike-div') || (temp = temp.parentNode) && ((c = temp.className) === 'like-div' || c === 'dislike-div')) { var task = temp.id.split('-')[0]; var num = +temp.id.match(/\d+/); $ajax("/api/".concat(task, "?board=").concat(aib.b, "&num=").concat(num)).then(function (xhr) { var obj = JSON.parse(xhr.responseText); if (obj.result !== 1) { $popup('err-2chlike', Lng.error[lang] + ': ' + obj.error.message); return; } temp.classList.add("".concat(task, "-div-checked"), "post__rate_".concat(task, "d")); var countEl = $q(".".concat(task, "-count, #").concat(task, "-count").concat(num), temp); countEl.textContent = +countEl.textContent + 1; }, function () { return $popup('err-2chlike', Lng.noConnect[lang]); }); } if (el.classList.contains('expand-large-comment')) { this._getFullMsg(el, false); e.preventDefault(); e.stopPropagation(); } } switch (el.classList[0]) { case 'de-btn-expthr': 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': this.setUserVisib(!this.isHidden); return; case 'de-btn-img': quotedText = aib.getImgRealName(aib.getImgWrap(el)); pr.showQuickReply(isPview ? Pview.topParent : this, this.num, !isPview, false); return; case 'de-btn-reply': pr.showQuickReply(isPview ? Pview.topParent : this, this.num, !isPview, false); 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; } return; } if (!this._hasEvents) { this._hasEvents = true; ['click', 'mouseout'].forEach(function (e) { return _this54.el.addEventListener(e, _this54, true); }); } if (el.classList.contains('de-video-link')) { if (aib.makaba && !el.videoInfo) { var origMsg = this.msg.firstChild; this.videos.updatePost($Q('.de-video-link', origMsg), $Q('.de-video-link', origMsg.nextSibling), true); } if (Cfg.embedYTube === 2) { this.videos.toggleFloatedThumb(el, isOutEvent); } } if (!isOutEvent && Cfg.expandImgs && el.tagName === 'IMG' && !el.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 (el.classList[0]) { case 'de-btn-expthr': this.btns.title = Lng.expandThr[lang]; this._addMenu(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 (Cfg.showHideBtn === 1) { this._addMenu(el, isOutEvent, (this instanceof Pview ? pByNum.get(this.num) : this)._getMenuHide()); } return; case 'de-btn-img': if (el.parentNode.className !== 'de-fullimg-info') { this._addMenu(el, isOutEvent, Menu.getMenuImg(el)); } return; case 'de-btn-reply': { var title = this.btns.title = this.isOp ? Lng.replyToThr[lang] : Lng.replyToPost[lang]; if (Cfg.showRepBtn === 1) { if (!isOutEvent) { quotedText = deWindow.getSelection().toString(); } this._addMenu(el, isOutEvent, "".concat(title, "") + (aib.reportForm ? "".concat(this.num === this.thr.num ? Lng.reportThr[lang] : Lng.reportPost[lang], "") : '') + (Cfg.markMyPosts || Cfg.markMyLinks ? "".concat(MyPosts.has(this.num) ? Lng.deleteMyPost[lang] : Lng.markMyPost[lang], "") : '')); } 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 (!Cfg.linksNavig || el.tagName !== '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._linkDelay); if (!(aib.getPostOfEl(nav.fixEventEl(e.relatedTarget)) instanceof Pview) && Pview.top) { Pview.top.markToDel(); } else if (this.kid) { this.kid.markToDel(); } } else { this._linkDelay = setTimeout(function () { return _this54.kid = Pview.showPview(_this54, el); }, Cfg.linksOver); } e.preventDefault(); e.stopPropagation(); } } }, { key: "toggleFavBtn", value: function toggleFavBtn(isEnable) { var elClass = isEnable ? 'de-btn-fav-sel' : 'de-btn-fav'; if (this.btnFav) { this.btnFav.setAttribute('class', elClass); } if (this.thr.btnFav) { this.thr.btnFav.setAttribute('class', elClass); } } }, { key: "updateMsg", value: function updateMsg(newMsg, sRunner) { var videoExt, videoLinks; var origMsg = aib.dobrochan ? this.msg.firstElementChild : this.msg; if (Cfg.embedYTube) { videoExt = $q('.de-video-ext', origMsg); videoLinks = $Q(':not(.de-video-ext) > .de-video-link', origMsg); } origMsg.replaceWith(newMsg); Object.defineProperties(this, { msg: { configurable: true, value: newMsg }, trunc: { configurable: true, value: null } }); Post.Сontent.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 _this55 = 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 !== _this55.el) { el.classList.toggle('de-ref-you', val); post.el.classList.toggle('de-mypost-reply', val); } }); } }, { key: "_addMenu", value: function _addMenu(el, isOutEvent, html) { var _this56 = this; if (!this.menu || this.menu.parentEl !== el) { if (isOutEvent) { clearTimeout(this._menuDelay); } else { this._menuDelay = setTimeout(function () { return _this56._showMenu(el, html); }, Cfg.linksOver); } } } }, { 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: "_clickMenu", value: function _clickMenu(el, e) { var isHide = !this.isHidden; var num = this.num; switch (el.getAttribute('info')) { case 'hide-sel': { var _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; } var 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)) { if (this._selText.includes('\n')) { Spells.addSpell(1 , "/".concat(escapeRegExp(this._selText).replace(/\r?\n/g, '\\n'), "/"), false); } else { Spells.addSpell(0 , this._selText.toLowerCase(), false); } } else { dummy.innerHTML = ''; dummy.append(this._selRange.cloneContents()); Spells.addSpell(2 , "/".concat(escapeRegExp(dummy.innerHTML.replace(/^<[^>]+>|<[^>]+>$/g, '')), "/"), false); } return; } case 'hide-name': Spells.addSpell(6 , this.posterName, false); return; case 'hide-trip': Spells.addSpell(7 , this.posterTrip, false); return; case 'hide-img': { var _this$images$firstAtt = this.images.firstAttach, w = _this$images$firstAtt.weight, wi = _this$images$firstAtt.width, h = _this$images$firstAtt.height; Spells.addSpell(8 , [0, [w, w], [wi, wi, h, h]], false); return; } case 'hide-imgn': Spells.addSpell(3 , "/".concat(escapeRegExp(this.images.firstAttach.name), "/"), false); return; case 'hide-ihash': ImagesHashStorage.getHash(this.images.firstAttach).then(function (hash) { if (hash !== -1) { Spells.addSpell(4 , hash, false); } }); return; case 'hide-noimg': Spells.addSpell(0x108 , '', true); return; case 'hide-text': { var words = Post.getWrds(this.text); for (var post = Thread.first.op; post; post = post.next) { Post.findSameText(num, !isHide, words, post); } return; } case 'hide-notext': Spells.addSpell(0x10B , '', true); return; case 'hide-refs': this.ref.toggleRef(isHide, true); this.setUserVisib(isHide); return; case 'hide-refsonly': Spells.addSpell(0 , '>>' + num, false); return; case 'img-load': { $popup('file-loading', Lng.loading[lang], true); var url = el.href; ContentLoader.loadImgData(url, false).then(function (data) { if (!data) { $popup('file-loading', Lng.cantLoad[lang] + ' URL: ' + url); return; } closePopup('file-loading'); downloadBlob(new Blob([data], { type: getFileMime(url) }), el.getAttribute('download')); }); e.preventDefault(); return; } case 'post-markmy': { var isAdd = !MyPosts.has(num); if (isAdd) { MyPosts.set(num, this.thr.num); } else { MyPosts.removeStorage(num); } this.changeMyMark(isAdd); return; } case 'post-reply': { var isPview = this instanceof Pview; pr.showQuickReply(isPview ? Pview.topParent : this, num, !isPview, false); quotedText = ''; return; } case 'post-report': aib.reportForm(num, this.thr.num); return; case 'thr-exp': { var task = +el.textContent.match(/\d+/); this.thr.loadPosts(!task ? 'all' : task === 10 ? 'more' : task); } } } }, { key: "_getFullMsg", value: function _getFullMsg(truncEl, isInit) { var _this57 = 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 (_this57.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 (_this57.num === aib.getPNum(post)) { sourceEl = post; break; } } } if (sourceEl) { _this57.updateMsg(aib.fixHTML(doc.adoptNode($q(aib.qPostMsg, sourceEl))), maybeSpells.value); truncEl.remove(); } if (maybeSpells.hasValue) { maybeSpells.value.endSpells(); } }, emptyFn); } }, { key: "_showMenu", value: function _showMenu(el, html) { var _this58 = this; if (this._menu) { this._menu.removeMenu(); } this._menu = new Menu(el, html, function (el, e) { return (_this58 instanceof Pview ? pByNum.get(_this58.num) || _this58 : _this58)._clickMenu(el, e); }, false); this._menu.onremove = function () { return _this58._menu = null; }; } }]); return AbstractPost; }(); var Post = function (_AbstractPost) { _inherits(Post, _AbstractPost); var _super4 = _createSuper(Post); function Post(el, thr, num, count, isOp, prev) { var _this59; _classCallCheck(this, Post); _this59 = _super4.call(this, thr, num, isOp); _this59.count = count; _this59.el = el; _this59.isDeleted = false; _this59.isHidden = false; _this59.isOmitted = false; _this59.isViewed = false; _this59.next = null; _this59.prev = prev; _this59.spellHidden = false; _this59.userToggled = false; _this59._selRange = null; _this59._selText = ''; if (prev) { prev.next = _assertThisInitialized(_this59); } pByEl.set(el, _assertThisInitialized(_this59)); pByNum.set(num, _assertThisInitialized(_this59)); var isMyPost = MyPosts.has(num); if (isMyPost) { _this59.el.classList.add('de-mypost'); } else if (localData && _this59.el.classList.contains('de-mypost')) { MyPosts.set(num, thr.num); isMyPost = true; } el.classList.add(isOp ? 'de-oppost' : 'de-reply'); _this59.sage = aib.getSage(el); _this59.btns = $aEnd(_this59._pref = $q(aib.qPostRef, el), '' + Post.getPostBtns(isOp, aib.t) + (_this59.sage ? '' : '') + (isOp ? '' : "".concat(count + 1, "")) + (isMyPost ? '(You)' : '') + ''); _this59.counterEl = isOp ? null : $q('.de-post-counter', _this59.btns); if (Cfg.expandTrunc && _this59.trunc) { _this59._getFullMsg(_this59.trunc, true); } el.addEventListener('mouseover', _assertThisInitialized(_this59), true); return _this59; } _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.Сontent(this).headerEl; } }, { key: "html", get: function get() { return new Post.Сontent(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 ((_post4 = post) !== null && _post4 !== void 0 && _post4.isDeleted) { var _post4; 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.Сontent(this).posterName; } }, { key: "posterTrip", get: function get() { return new Post.Сontent(this).posterTrip; } }, { key: "subj", get: function get() { return new Post.Сontent(this).subj; } }, { key: "text", get: function get() { return new Post.Сontent(this).text; } }, { key: "title", get: function get() { return new Post.Сontent(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.Сontent(this).wrap; } }, { key: "addFuncs", value: function addFuncs() { _get(_getPrototypeOf(Post.prototype), "addFuncs", this).call(this); 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 _$q; (_$q = $q('.de-selected')) === null || _$q === void 0 ? void 0 : _$q.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 _this60 = 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; _this60.hideContent(e.type === 'mouseout'); scrollTo(deWindow.pageXOffset, yOffset); }; } } if (Cfg.strikeHidd) { setTimeout(function () { return _this60._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 _iterator25 = _createForOfIteratorHelperLoose(this.images), _step25; !(_step25 = _iterator25()).done;) { var image = _step25.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 ? 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 sel = deWindow.getSelection(); var ssel = sel.toString().trim(); if (ssel) { this._selText = ssel; this._selRange = sel.getRangeAt(0); } return "".concat(ssel ? item('sel') : '').concat(this.posterName ? item('name') : '').concat(this.posterTrip ? item('trip') : '').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: "_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) { Post.clearMarks(); } else { if (!Post.hasNew) { Post.hasNew = true; doc.addEventListener('click', Post.clearMarks, true); } postEl.classList.add('de-new-post'); } } }, { 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.hidCounter++; } 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'); } } } }]); return Post; }(AbstractPost); Post.hasNew = false; Post.hiddenNums = new Set(); Post.Сontent = function (_TemporaryContent) { _inherits(PostContent, _TemporaryContent); var _super5 = _createSuper(PostContent); function PostContent(post) { var _this61; _classCallCheck(this, PostContent); _this61 = _super5.call(this, post); if (_this61._isInited) { return _possibleConstructorReturn(_this61); } _this61._isInited = true; _this61.el = post.el; _this61.post = post; return _this61; } _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: "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, 70).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; } }]); return PostContent; }(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, "
")); this._aEl = $q('a', this._noteEl); this.textEl = this._aEl.nextElementSibling; } _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 _this62 = this; this.text = note; var text; if (this.isHideThr) { this._aEl.onmouseover = this._aEl.onmouseout = function (e) { return _this62._post.hideContent(e.type === 'mouseout'); }; this._aEl.onclick = function (e) { e.preventDefault(); _this62._post.setUserVisib(!_this62._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); } }]); return PostNote; }(); 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) { _inherits(Pview, _AbstractPost2); var _super6 = _createSuper(Pview); function Pview(parent, link, pNum, tNum) { var _this63; _classCallCheck(this, Pview); _this63 = _super6.call(this, parent.thr, pNum, pNum === tNum); _this63.isSticky = false; _this63.parent = parent; _this63.remoteThr = null; _this63.tNum = tNum; _this63._isCached = false; _this63._isLeft = false; _this63._isTop = false; _this63._link = link; _this63._newPos = null; _this63._offsetTop = 0; _this63._readDelay = 0; var post = pByNum.get(pNum); if (post && (!post.isOp || !(parent instanceof Pview) || !parent._isCached)) { _this63._buildPview(post); return _possibleConstructorReturn(_this63); } _this63._isCached = true; _this63.board = link.pathname.match(/^\/?(.+\/)/)[1].replace(aib.res, '').replace(/\/$/, ''); if (PviewsCache.has(_this63.board + tNum)) { post = PviewsCache.get(_this63.board + tNum).getPost(pNum); if (post) { _this63._buildPview(post); } else { _this63._showPview(_this63.el = $add("
\n\t\t\t\t\t").concat(Lng.postNotFound[lang], "
"))); } return _possibleConstructorReturn(_this63); } _this63._showPview(_this63.el = $add("
\n\t\t\t").concat(Lng.loading[lang], "
"))); _this63._loadPromise = ajaxPostsLoad(_this63.board, tNum, false, false).then(function (pBuilder) { return _this63._onload(pBuilder); }, function (err) { return _this63._onerror(err); }); return _this63; } _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 = nav.fixEventEl(e.relatedTarget); if (!el || isOverEvent && (el.tagName !== '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) { _get(_getPrototypeOf(Pview.prototype), "handleEvent", this).call(this, e); } } }, { key: "markToDel", value: function markToDel() { var _this64 = this; clearTimeout(Pview._delTO); Pview._delTO = setTimeout(function () { return _this64.deleteNonSticky(); }, 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: "_buildPview", value: function () { var _buildPview2 = _asyncToGenerator( _regeneratorRuntime().mark(function _callee14(post) { var _yield$readFavorites$, _yield$readFavorites$2; var num, pv, isMyPost, isOp, isFav, isCached, pCountHtml, pText, btnsEl, link; return _regeneratorRuntime().wrap(function _callee14$(_context18) { while (1) { switch (_context18.prev = _context18.next) { case 0: $del(this.el); 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'); isOp = this.isOp; _context18.t0 = isOp; if (!_context18.t0) { _context18.next = 30; break; } _context18.t1 = post.thr.isFav; if (_context18.t1) { _context18.next = 29; break; } _context18.next = 18; return readFavorites(); case 18: _context18.t3 = aib.host; _context18.t4 = _yield$readFavorites$ = _context18.sent[_context18.t3]; _context18.t2 = _context18.t4 === null; if (_context18.t2) { _context18.next = 23; break; } _context18.t2 = _yield$readFavorites$ === void 0; case 23: if (!_context18.t2) { _context18.next = 27; break; } _context18.t5 = void 0; _context18.next = 28; break; case 27: _context18.t5 = (_yield$readFavorites$2 = _yield$readFavorites$[this.board]) === null || _yield$readFavorites$2 === void 0 ? void 0 : _yield$readFavorites$2[num]; case 28: _context18.t1 = _context18.t5; case 29: _context18.t0 = _context18.t1; case 30: isFav = _context18.t0; isCached = post instanceof CacheItem; pCountHtml = (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); $del($q('.de-post-counter', btnsEl)); if (post.isHidden) { btnsEl.classList.add('de-post-hide'); } btnsEl.innerHTML = "").concat(pText); $delAll("".concat(!aib.t && isOp ? aib.qOmitted + ', ' : '', ".de-fullimg-wrap, .de-fullimg-after"), 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 37: case "end": return _context18.stop(); } } }, _callee14, this); })); function _buildPview(_x15) { 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() * 1e3); $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: "_showMenu", value: function _showMenu(el, html) { var _this65 = this; _get(_getPrototypeOf(Pview.prototype), "_showMenu", this).call(this, el, html); this._menu.onover = function () { return _this65.mouseEnter(); }; this._menu.onout = function () { return Pview.top.markToDel(); }; } }, { key: "_showPview", value: function _showPview(el) { var _this66 = this; ['mouseover', 'mouseout'].forEach(function (e) { return el.addEventListener(e, _this66, 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 tNum = +(link.pathname.match(/.+?\/[^\d]*(\d+)/) || [0, aib.getPostOfEl(link).tNum])[1]; var pNum = link.textContent.match(/\d+/g); pNum = pNum ? +pNum.pop() : 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'); }); } }]); return 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; } _createClass(CacheItem, [{ key: "refLinks", value: _regeneratorRuntime().mark(function refLinks() { return _regeneratorRuntime().wrap(function refLinks$(_context19) { while (1) { switch (_context19.prev = _context19.next) { case 0: return _context19.delegateYield(this._pBuilder.getRefLinks(this.count, this._thrUrl), "t0", 1); case 1: case "end": return _context19.stop(); } } }, 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.Сontent(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 _this67 = this; var value = null; if (this.isOp) { var pcount = this._pBuilder.length; value = { lastNum: this._pBuilder.getPNum(pcount - 1), pcount: pcount }; Object.defineProperty(value, 'title', { get: function get() { return _this67.title; } }); } Object.defineProperty(this, 'thr', { value: value }); return value; } }]); return CacheItem; }(); var PviewsCache = function (_TemporaryContent2) { _inherits(PviewsCache, _TemporaryContent2); var _super7 = _createSuper(PviewsCache); function PviewsCache(pBuilder, board, tNum) { var _this68; _classCallCheck(this, PviewsCache); _this68 = _super7.call(this, board + tNum); if (_this68._isInited) { return _possibleConstructorReturn(_this68); } _this68._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); _this68._b = board; _this68._posts = lPByNum; if (Cfg.linksNavig) { RefMap.gen(lPByNum); } return _this68; } _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; } }]); return PviewsCache; }(TemporaryContent); PviewsCache.purgeSecs = 3e5; var ImagesNavigBtns = function () { function ImagesNavigBtns(viewerObj) { _classCallCheck(this, ImagesNavigBtns); var btns = $bEnd(docBody, "
\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 _ref32 = _toConsumableArray(btns.children); this.prevBtn = _ref32[0]; this.nextBtn = _ref32[1]; this.autoBtn = _ref32[2]; this._btns = btns; this._btnsStyle = btns.style; this._hideTmt = 0; this._isHidden = true; this._oldX = -1; this._oldY = -1; this._viewer = viewerObj; doc.defaultView.addEventListener('mousemove', this); btns.addEventListener('mouseover', this); } _createClass(ImagesNavigBtns, [{ key: "handleEvent", value: function handleEvent(e) { var _this69 = 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 _this69._btns.addEventListener(e, _this69); }); } if (!this._isHidden) { clearTimeout(this._hideTmt); KeyEditListener.setTitle(this.prevBtn, 4); KeyEditListener.setTitle(this.nextBtn, 17); } return; case 'mouseout': this._setHideTmt(); 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._hideTmt); } }, { key: "showBtns", value: function showBtns() { if (this._isHidden) { this._btnsStyle.removeProperty('display'); this._isHidden = false; this._setHideTmt(); } } }, { key: "_setHideTmt", value: function _setHideTmt() { var _this70 = this; clearTimeout(this._hideTmt); this._hideTmt = setTimeout(function () { return _this70.hideBtns(); }, 2e3); } }]); return ImagesNavigBtns; }(); var ImagesViewer = function () { function ImagesViewer(data) { _classCallCheck(this, ImagesViewer); this.data = null; this.isAutoPlay = false; this._data = null; 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._width = 0; this._showFullImg(data); } _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 _this71 = this; switch (e.type) { case 'mousedown': if (this.data.isVideo && ExpandableImage.isControlClick(e)) { return; } this._oldX = e.clientX; this._oldY = e.clientY; ['mousemove', 'mouseup'].forEach(function (e) { return docBody.addEventListener(e, _this71, true); }); break; case 'mousemove': { var curX = e.clientX, curY = e.clientY; 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; } return; } case 'mouseup': ['mousemove', 'mouseup'].forEach(function (e) { return docBody.removeEventListener(e, _this71, true); }); return; case 'click': { var el = e.target; if (this.data.isVideo && ExpandableImage.isControlClick(e) || el.tagName !== 'IMG' && el.tagName !== 'VIDEO' && !el.classList.contains('de-fullimg-wrap') && !el.classList.contains('de-fullimg-wrap-link') && !el.classList.contains('de-fullimg-video-hack') && el.className !== 'de-fullimg-load') { return; } if (e.button === 0) { if (this._moved) { this._moved = false; } else { this.closeImgViewer(e); AttachedImage.viewer = null; } e.stopPropagation(); break; } return; } case 'mousewheel': this._handleWheelEvent(e.clientX, e.clientY, -1 / 40 * ('wheelDeltaY' in e ? e.wheelDeltaY : e.wheelDelta)); break; default: this._handleWheelEvent(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 angle = this.data.rotate; var isVert = angle === 90 || angle === 270; var img = $q('img, video', this._fullEl); img.style.transform = "rotate(".concat(angle, "deg)").concat(angle === 90 ? ' translateY(-100%)' : angle === 270 ? ' translateX(-100%)' : ''); img.classList.toggle('de-fullimg-rotated', isVert); img.style.height = "".concat((isVert ? this._height / this._width : 1) * 100, "%"); if (this.data.isVideo && nav.firefoxVer >= 59) { img.previousElementSibling.style = (isVert ? 'width: calc(100% - 40px); height: 100%; ' : '') + (angle === 90 ? 'right: 0; ' : '') + (angle === 180 ? 'bottom: 0;' : ''); } if (isNextAngle || angle !== 180) { this._rotateFullImg(this._fullEl); } } }, { key: "toggleVideoLoop", value: function toggleVideoLoop() { if (this.data.isVideo) { $toggleAttr($q('video', this._fullEl), '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: "_handleWheelEvent", value: function _handleWheelEvent(clientX, clientY, delta) { if (delta === 0) { return; } var width, height; var oldW = this._width, oldH = this._height; if (delta > 0) { width = oldW / this._zoomFactor; height = oldH / this._zoomFactor; if (width <= this._minSize && height <= this._minSize) { return; } } else { width = oldW * this._zoomFactor; height = oldH * this._zoomFactor; } 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'; } }, { 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 _this72 = 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 _this72._resizeFullImg(el); }, function (el) { return _this72._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("
= 59 && data.isVideo ? 10 : 0), "px; left:").concat(this._oldL, "px; width:").concat(width, "px; height:").concat(height, "px; display: block\">
")); el.append(this._fullEl); if (data.isImage) { $aBegin(this._fullEl, "")).append($q('img', this._fullEl)); } this._elStyle = el.style; this.data = data; this._parentEl = el; ['onwheel' in el ? 'wheel' : 'mousewheel', 'mousedown', 'click'].forEach(function (e) { return el.addEventListener(e, _this72, 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); } }]); return ImagesViewer; }(); 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; } } _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 = /(jpe?g|png|gif|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|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 _this73 = this; if (!aib.getImgRedirectSrc || this.redirected) { return; } aib.getImgRedirectSrc(this.src).then(function (newSrc) { _this73.redirected = true; Object.defineProperty(_this73, 'src', { value: newSrc }); $q('img, video', fullEl).src = _this73.el.src = _this73.el.parentNode.href = getImgNameLink(_this73.el).href = newSrc; if (!_this73.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); (aib.hasPicWrap ? this._getImageParent : this.el.parentNode).nextSibling.remove(); 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); } } } }, { 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 = Post.sizing.wWidth - 2; var maxHeight = Post.sizing.wHeight - (Cfg.imgInfoLink ? 24 : 2) - (nav.firefoxVer >= 59 && this.isVideo ? 19 : 0); 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 _this74 = 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 el = this.el; (aib.hasPicWrap ? this._getImageParent : el.parentNode).insertAdjacentHTML('afterend', '
'); this._fullEl = this.getFullImg(true, null, null); this._fullEl.addEventListener('click', function (e) { return _this74.collapseImg(e); }, true); this.srcBtnEvents(this); var parent = el.parentNode; $hide(parent); parent.after(this._fullEl); this.checkForRedirect(this._fullEl); if (e) { var fullImgTop = this._fullEl.getBoundingClientRect().top; if (fullImgTop < 0 || origImgTop < 0) { scrollTo(deWindow.pageXOffset, deWindow.pageYOffset + fullImgTop); } } } }, { 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 _this75 = 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 (_ref33) { var img = _ref33.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; var ar = _this75._size ? _this75._size[1] / _this75._size[0] : newH / newW; var isRotated = !img.scrollWidth ? false : img.scrollHeight / img.scrollWidth > 1 ? ar < 1 : ar > 1; if (!_this75._size || isRotated) { _this75._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 ? '' : '
', "\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 (_ref34) { var el = _ref34.target; if (!el.onceLoaded) { el.load(); el.onceLoaded = true; } }); if (!this._size) { videoEl.addEventListener('loadedmetadata', function (_ref35) { var el = _ref35.target; _this75._size = [el.videoWidth, el.videoHeight]; onsizechange(wrapEl); }); } setTimeout(function () { return videoEl.dispatchEvent(new CustomEvent('volumechange')); }, 150); videoEl.addEventListener('volumechange', function (_ref36) { var el = _ref36.target, isTrusted = _ref36.isTrusted; var val = el.muted ? 0 : Math.round(el.volume * 100); if (isTrusted && val !== Cfg.webmVolume) { saveCfg('webmVolume', val); sendStorageEvent('__de-webmvolume', val); } }); 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.loadImgData(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)); _this75.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(_ref37) { var _this76 = this; var _fullEl = _ref37._fullEl; if (!Cfg.imgSrcBtns) { return; } var srcBtnEl = $q('.de-btn-img', _fullEl); srcBtnEl.addEventListener('mouseover', function () { return srcBtnEl.odelay = setTimeout(function () { var menuHtml = !_this76.isVideo ? Menu.getMenuImg(srcBtnEl) : Menu.getMenuImg(srcBtnEl, true) + "".concat(Lng.getFrameLinks[lang], ""); new Menu(srcBtnEl, menuHtml, !_this76.isVideo ? emptyFn : 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(_this76.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); }); }, emptyFn); }); }, Cfg.linksOver); }); srcBtnEl.addEventListener('mouseout', function (e) { return clearTimeout(e.target.odelay); }); } }, { 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; } }]); return ExpandableImage; }(); var EmbeddedImage = function (_ExpandableImage) { _inherits(EmbeddedImage, _ExpandableImage); var _super8 = _createSuper(EmbeddedImage); function EmbeddedImage() { _classCallCheck(this, EmbeddedImage); return _super8.apply(this, arguments); } _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; } }]); return EmbeddedImage; }(ExpandableImage); var AttachedImage = function (_ExpandableImage2) { _inherits(AttachedImage, _ExpandableImage2); var _super9 = _createSuper(AttachedImage); function AttachedImage() { _classCallCheck(this, AttachedImage); return _super9.apply(this, arguments); } _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.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; } } }]); return AttachedImage; }(ExpandableImage); AttachedImage.viewer = null; var PostImages = function (_Symbol$iterator) { 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 _i15 = 0, _len9 = els.length; _i15 < _len9; ++_i15) { var _el8 = els[_i15]; last = new EmbeddedImage(post, _el8, last); filesMap.set(_el8, last); if (!first) { first = last; } } } this.first = first; this.last = last; this.hasAttachments = hasAttachments; this._map = filesMap; } _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 }; } }; } }]); return PostImages; }(Symbol.iterator); 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, emptyFn); Object.defineProperty(this, '_workers', { value: value, configurable: true }); return value; }, _genImgHash: function _genImgHash(_ref38) { var _ref39 = _slicedToArray(_ref38, 3), arrBuf = _ref39[0], oldw = _ref39[1], oldh = _ref39[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 _i16 = 0; _i16 < newh; ++_i16) { for (var _j3 = 0; _j3 < neww; ++_j3) { var temp = _i16 / (newh - 1) * (oldh - 1); var l = Math.min(temp | 0, oldh - 2); var u = temp - l; temp = _j3 / (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(_ref40) { var _this77 = this; return _asyncToGenerator( _regeneratorRuntime().mark(function _callee15() { var el, src, data, val, w, h, cnv, ctx, buffer; return _regeneratorRuntime().wrap(function _callee15$(_context20) { while (1) { switch (_context20.prev = _context20.next) { case 0: el = _ref40.el, src = _ref40.src; if (!(src in _this77._storage)) { _context20.next = 3; break; } return _context20.abrupt("return", _this77._storage[src]); case 3: if (el.complete) { _context20.next = 6; break; } _context20.next = 6; return new Promise(function (resolve) { return el.addEventListener('load', function () { return resolve(); }); }); case 6: el.removeAttribute('loading'); if (!(el.naturalWidth + el.naturalHeight === 0)) { _context20.next = 9; break; } return _context20.abrupt("return", -1); case 9: val = -1; w = el.naturalWidth, h = el.naturalHeight; cnv = _this77._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) { _context20.next = 22; break; } _context20.next = 20; return new Promise(function (resolve) { return _this77._workers.runWorker([buffer, w, h], [buffer], function (val) { return resolve(val); }); }); case 20: data = _context20.sent; if (data && 'hash' in data) { val = data.hash; } case 22: _this77._storage[src] = val; return _context20.abrupt("return", val); case 24: case "end": return _context20.stop(); } } }, _callee15); }))(); } }); function getImgNameLink(el) { return $q(aib.qPostImgNameLink, aib.getImgWrap(el)); } 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 _iterator26 = _createForOfIteratorHelperLoose(post.images), _step26; !(_step26 = _iterator26()).done;) { var image = _step26.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 = void 0; if (!(ext = link.getAttribute('de-img-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; } _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: _regeneratorRuntime().mark(function getRefLinks(i, thrUrl) { var msg, links, _i17, len, link, tc, lNum, url; return _regeneratorRuntime().wrap(function getRefLinks$(_context21) { while (1) { switch (_context21.prev = _context21.next) { case 0: msg = i === 0 ? $q(aib.qPostMsg, this._form) : $q(aib.qPostMsg, this._posts[i - 1]); links = $Q('a', msg); _i17 = 0, len = links.length; case 3: if (!(_i17 < len)) { _context21.next = 16; break; } link = links[_i17]; tc = link.textContent; if (!(tc[0] === '>' && tc[1] === '>')) { _context21.next = 13; break; } lNum = parseInt(tc.substr(2), 10); if (!lNum) { _context21.next = 13; break; } _context21.next = 11; return [link, lNum]; case 11: url = link.getAttribute('href'); if (url[0] === '#') { link.setAttribute('href', thrUrl + url); } case 13: ++_i17; _context21.next = 3; break; case 16: case "end": return _context21.stop(); } } }, getRefLinks, this); }) }, { key: "bannedPostsData", value: _regeneratorRuntime().mark(function bannedPostsData() { var banEls, i, len, banEl, postEl; return _regeneratorRuntime().wrap(function bannedPostsData$(_context22) { while (1) { switch (_context22.prev = _context22.next) { case 0: banEls = $Q(aib.qBan, this._form); i = 0, len = banEls.length; case 2: if (!(i < len)) { _context22.next = 10; break; } banEl = banEls[i]; postEl = aib.getPostElOfEl(banEl); _context22.next = 7; return [1, postEl ? aib.getPNum(postEl) : null, doc.adoptNode(banEl)]; case 7: ++i; _context22.next = 2; break; case 10: case "end": return _context22.stop(); } } }, bannedPostsData, this); }) }]); return DOMPostsBuilder; }(); 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 = []; } _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 ccName = ''; var ccText = ''; var ccImg = ''; var ccClass = ''; if (cc) { 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: _regeneratorRuntime().mark(function bannedPostsData() { return _regeneratorRuntime().wrap(function bannedPostsData$(_context23) { while (1) { switch (_context23.prev = _context23.next) { case 0: case "end": return _context23.stop(); } } }, 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('>', '>') }; } }]); return _4chanPostsBuilder; }(); _4chanPostsBuilder._customSpoiler = new Map(); var DobrochanPostsBuilder = function () { function DobrochanPostsBuilder(json, board) { _classCallCheck(this, DobrochanPostsBuilder); if (json.error) { throw new AjaxError(0, "API error: ".concat(json.error.message)); } this._json = json.result; this._board = board; this._posts = json.result.threads[0].posts; this.length = this._posts.length - 1; this.postersCount = ''; } _createClass(DobrochanPostsBuilder, [{ key: "isClosed", get: function get() { return !!this._json.threads[0].archived; } }, { key: "getOpMessage", value: function getOpMessage() { return $add(aib.fixHTML("
".concat(this._posts[0].message_html, "
"))); } }, { key: "getPNum", value: function getPNum(i) { return this._posts[i + 1].display_id; } }, { key: "getOpEl", value: function getOpEl() { return this.getPostEl(-1); } }, { key: "getPostEl", value: function getPostEl(i) { var el = $add(aib.fixHTML(this.getPostHTML(i))); if (i === -1) { return el; } return el.firstElementChild.firstElementChild.lastElementChild; } }, { key: "getPostHTML", value: function getPostHTML(i) { var data = this._posts[i + 1]; var num = data.display_id; var board = this._board; var multiFile = data.files.length > 1; var filesHTML = ''; for (var _iterator27 = _createForOfIteratorHelperLoose(data.files), _step27; !(_step27 = _iterator27()).done;) { var _step27$value = _step27.value, file_id = _step27$value.file_id, metadata = _step27$value.metadata, rating = _step27$value.rating, size = _step27$value.size, src = _step27$value.src, thumb = _step27$value.thumb, thumb_height = _step27$value.thumb_height, thumb_width = _step27$value.thumb_width; var fileName = void 0, fullFileName = void 0; var th = thumb; var thumbW = 200; var thumbH = 200; var ext = getFileExt(src); if (board === 'b' || board === 'rf') { fileName = fullFileName = getFileName(th); } else { fileName = fullFileName = getFileName(src); if (multiFile && fileName.length > 20) { fileName = fileName.substr(0, 20 - ext.length) + '(…)' + ext; } } var maxRating = 'r15'; if (rating === 'r-18g' && maxRating !== 'r-18g') { th = 'images/r-18g.png'; } else if (rating === 'r-18' && (maxRating !== 'r-18g' || maxRating !== 'r-18')) { th = 'images/r-18.png'; } else if (rating === 'r-15' && maxRating === 'sfw') { th = 'images/r-15.png'; } else if (rating === 'illegal') { th = 'images/illegal.png'; } else { thumbW = thumb_width; thumbH = thumb_height; } var fileInfo = "
\u0424\u0430\u0439\u043B:\n\t\t\t\t").concat(fileName, "
\n\t\t\t\t").concat(ext, ", ").concat(prettifySize(size), ", ").concat(metadata.width, "x").concat(metadata.height, "\n\t\t\t\t").concat(multiFile ? '' : ' - Нажмите на картинку для увеличения', "
\n\t\t\t\t\n\t\t\t\t\t\"edit\"\n\t\t\t\t\n\t\t\t
"); filesHTML += "".concat(multiFile ? '' : fileInfo, "\n\t\t\t
").concat(multiFile ? fileInfo : '', "\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t
"); } var date = data.date.replace(/^(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})$/, function (all, y, mo, d, h, m, s) { var dt = new Date(y, +mo - 1, d, h, m, s); return "".concat(pad2(dt.getDate()), " ").concat(Lng.fullMonth[1][dt.getMonth()], " ").concat(dt.getFullYear(), " (").concat(Lng.week[1][dt.getDay()], ") ").concat(pad2(dt.getHours()), ":").concat(pad2(dt.getMinutes())); }); var isOp = i === -1; return "".concat(isOp ? "
") : "\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\t\t No.").concat(num, "\n\t\t\t\t
\n\t\t\t\t").concat(filesHTML, "\n\t\t\t\t").concat(multiFile ? '
' : '', "\n\t\t\t\t
").concat(data.message_html, "
\n\t\t\t").concat(isOp ? '' : '
'); } }, { key: "bannedPostsData", value: _regeneratorRuntime().mark(function bannedPostsData() { return _regeneratorRuntime().wrap(function bannedPostsData$(_context24) { while (1) { switch (_context24.prev = _context24.next) { case 0: case "end": return _context24.stop(); } } }, bannedPostsData); }) }]); return DobrochanPostsBuilder; }(); 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; } _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$files; var data = this._posts[i + 1]; var num = data.num; var board = this._board; var _switch = function _switch(val, obj) { return val in obj ? obj[val] : obj['@@default']; }; var filesHTML = ''; if ((_data$files = data.files) !== null && _data$files !== void 0 && _data$files.length) { filesHTML = "
"); for (var _iterator28 = _createForOfIteratorHelperLoose(data.files), _step28; !(_step28 = _iterator28()).done;) { var file = _step28.value; var imgId = num + '-' + file.md5; 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; var isVideo = file.type === 6 || file.type === 10; var imgClass = "post__file-preview".concat(isVideo ? ' post__file-webm' : '').concat(data.nsfw ? ' post__file-nsfw' : ''); 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
"); } 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\">## \u041A\u043E\u0434\u0435\u0440 ##", '!!%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: _regeneratorRuntime().mark(function bannedPostsData() { var p, _iterator29, _step29, _step29$value, banned, num; return _regeneratorRuntime().wrap(function bannedPostsData$(_context25) { while (1) { switch (_context25.prev = _context25.next) { case 0: p = this._isNew ? 'post__' : ''; _iterator29 = _createForOfIteratorHelperLoose(this._posts); case 2: if ((_step29 = _iterator29()).done) { _context25.next = 15; break; } _step29$value = _step29.value, banned = _step29$value.banned, num = _step29$value.num; _context25.t0 = banned; _context25.next = _context25.t0 === 1 ? 7 : _context25.t0 === 2 ? 10 : 13; break; case 7: _context25.next = 9; return [1, num, $add("(\u0410\u0432\u0442\u043E\u0440 \u044D\u0442\u043E\u0433\u043E \u043F\u043E\u0441\u0442\u0430 \u0431\u044B\u043B \u0437\u0430\u0431\u0430\u043D\u0435\u043D.)"))]; case 9: return _context25.abrupt("break", 13); case 10: _context25.next = 12; return [2, num, $add("") + '(Автор этого поста был предупрежден.)')]; case 12: return _context25.abrupt("break", 13); case 13: _context25.next = 2; break; case 15: case "end": return _context25.stop(); } } }, 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(/