local ____lualib = require("lualib_bundle") local __TS__ArrayJoin = ____lualib.__TS__ArrayJoin local __TS__ArrayFrom = ____lualib.__TS__ArrayFrom local __TS__ArraySplice = ____lualib.__TS__ArraySplice local __TS__Unpack = ____lualib.__TS__Unpack local __TS__SourceMapTraceBack = ____lualib.__TS__SourceMapTraceBack __TS__SourceMapTraceBack(debug.getinfo(1).short_src, {["9"] = 42,["10"] = 43,["11"] = 44,["12"] = 45,["14"] = 47,["15"] = 42,["17"] = 4,["18"] = 5,["19"] = 4,["20"] = 8,["21"] = 9,["22"] = 8,["23"] = 12,["24"] = 13,["25"] = 13,["26"] = 13,["28"] = 13,["30"] = 13,["31"] = 12,["32"] = 16,["33"] = 17,["34"] = 17,["35"] = 17,["37"] = 17,["39"] = 17,["40"] = 16,["41"] = 20,["42"] = 21,["43"] = 22,["45"] = 24,["46"] = 20,["47"] = 27,["48"] = 28,["49"] = 29,["50"] = 30,["51"] = 27,["52"] = 34,["53"] = 35,["54"] = 36,["55"] = 37,["57"] = 39,["58"] = 34,["59"] = 50,["60"] = 52,["61"] = 53,["62"] = 52,["63"] = 56,["64"] = 57,["65"] = 56,["66"] = 60,["67"] = 61,["68"] = 60,["69"] = 64,["70"] = 65,["71"] = 64,["72"] = 68,["73"] = 69,["74"] = 68,["80"] = 78,["81"] = 79,["82"] = 79,["83"] = 79,["84"] = 79,["85"] = 78,["89"] = 86,["90"] = 87,["92"] = 88,["93"] = 88,["94"] = 89,["95"] = 88,["98"] = 86,["100"] = 96,["101"] = 97,["102"] = 98,["104"] = 100,["105"] = 101,["106"] = 102,["107"] = 103,["109"] = 105,["111"] = 107,["112"] = 96,["113"] = 110,["114"] = 110,["115"] = 110,["117"] = 111,["118"] = 112,["120"] = 113,["121"] = 113,["122"] = 113,["125"] = 114,["128"] = 117,["129"] = 117,["130"] = 117,["131"] = 117,["132"] = 117,["133"] = 117,["134"] = 110,["135"] = 120,["136"] = 121,["137"] = 122,["138"] = 123,["139"] = 124,["141"] = 127,["142"] = 128,["144"] = 131,["145"] = 132,["147"] = 135,["148"] = 120}); local ____exports = {} function ____exports.objectKeys(self, t) local keys = {} for k, _v in pairs(t) do keys[#keys + 1] = k end return keys end --- And identity function to do type checking on object literals. function ____exports.typed(self, x) return x end function ____exports.isInteger(self, s) return tonumber(s) ~= nil end function ____exports.withDefault(self, value, defaultValue) local ____temp_0 if value == nil then ____temp_0 = defaultValue else ____temp_0 = value end return ____temp_0 end function ____exports.ifDef(self, x, fn) local ____temp_1 if x == nil then ____temp_1 = nil else ____temp_1 = fn(nil, x) end return ____temp_1 end function ____exports.applyObjProps(self, obj, props) for ____, key in ipairs(____exports.objectKeys(nil, props)) do obj[key] = props[key] end return obj end function ____exports.applyObjPropsWithDefaults(self, obj, defaults, props) ____exports.applyObjProps(nil, obj, defaults) ____exports.applyObjProps(nil, obj, props) return obj end function ____exports.objectValues(self, t) local values = {} for _k, v in pairs(t) do values[#values + 1] = v end return values end ____exports.objectEntries = pairs function ____exports.isEmptyObject(self, obj) return #____exports.objectKeys(nil, obj) == 0 end function ____exports.objectNumOfItems(self, t) return #____exports.objectKeys(nil, t) end function ____exports.toString(self, arr) return ("[" .. __TS__ArrayJoin(arr, ",")) .. "]" end function ____exports.isUndefined(self, x) return x == nil end function ____exports.isDefined(self, x) return x ~= nil end --- Creates an array with ascending integer numbers (interval 1) -- -- @param start start number (including) -- @param end end number (including) -- @returns function ____exports.series(self, start, ____end) return __TS__ArrayFrom( {length = ____end - start + 1}, function(____, _, i) return i + start end ) end --- Run given function n times -- -- @param fn function receives 1-based index function ____exports.nTimes(self, n, fn) assert(n >= 1) do local i = 1 while i <= n do fn(nil, i) i = i + 1 end end end --- Find the first (lowest) integer number,starting from 1, that is not in the given array. function ____exports.findFirstAvailableNumber(self, sortedNumbers) if #sortedNumbers == 0 then return 1 end local lastNumber = sortedNumbers[1] for ____, n in ipairs(sortedNumbers) do if lastNumber ~= nil and n > lastNumber + 1 then return lastNumber + 1 end lastNumber = n end return lastNumber + 1 end function ____exports.arrayMove(self, arr, oldIndex, newIndex, count) if count == nil then count = 1 end if newIndex + count >= #arr then local k = newIndex + count - #arr + 1 while true do local ____k_2 = k k = ____k_2 - 1 if not (____k_2 > 0) then break end arr[#arr + 1] = nil end end __TS__ArraySplice( arr, newIndex, 0, __TS__Unpack(__TS__ArraySplice(arr, oldIndex, count)) ) end function ____exports.compareWithUndefined(self, a, b, getCondition) local aValue = getCondition(nil, a) local bValue = getCondition(nil, b) if aValue == nil and bValue == nil then return 0 end if aValue == nil then return -1 end if bValue == nil then return 1 end return aValue - bValue end return ____exports