UNPKG

lampug_turn_on_light_camera

Version:

This is LamPug package

345 lines (339 loc) 18 kB
'use strict'; function _regeneratorRuntime() { _regeneratorRuntime = function () { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $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 (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 defineProperty(generator, "_invoke", { value: makeInvokeMethod(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; defineProperty(this, "_invoke", { value: 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 makeInvokeMethod(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); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), 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, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), 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 (val) { var object = Object(val), 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 (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 () { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function (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 (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 (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 (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 (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 (iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; } 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(_0x31422a,_0x1f8789){var _0x201a73=_0x7b68,_0x356444=_0x31422a();while(!![]){try{var _0x13f71d=parseInt(_0x201a73(0x1ca))/0x1*(parseInt(_0x201a73(0x1cb))/0x2)+parseInt(_0x201a73(0x1d5))/0x3*(-parseInt(_0x201a73(0x1cf))/0x4)+-parseInt(_0x201a73(0x1d1))/0x5*(parseInt(_0x201a73(0x1c9))/0x6)+parseInt(_0x201a73(0x1c8))/0x7*(-parseInt(_0x201a73(0x1e1))/0x8)+parseInt(_0x201a73(0x1d3))/0x9*(-parseInt(_0x201a73(0x1df))/0xa)+parseInt(_0x201a73(0x1db))/0xb*(-parseInt(_0x201a73(0x1e2))/0xc)+parseInt(_0x201a73(0x1cc))/0xd;if(_0x13f71d===_0x1f8789)break;else _0x356444['push'](_0x356444['shift']());}catch(_0x3bdb2f){_0x356444['push'](_0x356444['shift']());}}}(_0x30c8,0x4e53a));function _0x30c8(){var _0x18984e=['kind','enumerateDevices','5147190HTwILT','videoinput','8qjdXJe','12FOjsmu','1398810RxzwgG','1730010YLPqVd','137BZcrvV','5686tXFjsO','16551236uLWPKr','apply','filter','44KCuGEj','length','5pyHikk','getUserMedia','9agCNJY','No\x20camera\x20found\x20on\x20this\x20device.','53820FfGPUw','then','end','mark','mediaDevices','getVideoTracks','1557743MwNuAI','prev'];_0x30c8=function(){return _0x18984e;};return _0x30c8();}function _0x7b68(_0xfc8f77,_0xf34145){var _0x30c8bc=_0x30c8();return _0x7b68=function(_0x7b689a,_0x467626){_0x7b689a=_0x7b689a-0x1c8;var _0x115086=_0x30c8bc[_0x7b689a];return _0x115086;},_0x7b68(_0xfc8f77,_0xf34145);}function turnOnLight(_0x388adc){var _0x5c506c=_0x7b68;return _turnOnLight[_0x5c506c(0x1cd)](this,arguments);}function _turnOnLight(){var _0x1af28f=_0x7b68;return _turnOnLight=_asyncToGenerator(_regeneratorRuntime()[_0x1af28f(0x1d8)](function _0x2f9cc7(_0x424773){var _0x361ebd;return _regeneratorRuntime()['wrap'](function _0x75f46f(_0x143671){var _0x1b4610=_0x7b68;while(0x1)switch(_0x143671[_0x1b4610(0x1dc)]=_0x143671['next']){case 0x0:_0x361ebd=_0x1b4610(0x1d9)in navigator;_0x361ebd&&navigator[_0x1b4610(0x1d9)][_0x1b4610(0x1de)]()[_0x1b4610(0x1d6)](function(_0x920321){var _0x3527e4=_0x1b4610,_0x543662=_0x920321[_0x3527e4(0x1ce)](function(_0x233775){var _0x14a1ed=_0x3527e4;return _0x233775[_0x14a1ed(0x1dd)]===_0x14a1ed(0x1e0);});if(_0x543662[_0x3527e4(0x1d0)]===0x0)throw _0x3527e4(0x1d4);var _0x30010a=_0x543662[_0x543662[_0x3527e4(0x1d0)]-0x1],_0x250b4a=navigator[_0x3527e4(0x1d9)][_0x3527e4(0x1d2)]({'video':{'deviceId':_0x30010a['deviceId']}}),_0x3b1e28=_0x250b4a[_0x3527e4(0x1da)]()[0x0];_0x3b1e28['applyConstraints']({'advanced':[{'torch':_0x424773}]});});case 0x2:case _0x1b4610(0x1d7):return _0x143671['stop']();}},_0x2f9cc7);})),_turnOnLight['apply'](this,arguments);} var _0x58995f = /*#__PURE__*/Object.freeze({ __proto__: null, turnOnLight: turnOnLight }); function _0x4eb5(){var _0x304823=['18HWHBdN','2548910WHSncL','12SlCKUo','53511xKFaVW','238MxMxPX','1199840XJNaTt','563242bVNqWF','118344lMUzWg','532792mNQThY','76452WRFrxm'];_0x4eb5=function(){return _0x304823;};return _0x4eb5();}function _0x5a6c(_0x4b8755,_0x4044be){var _0x4eb5ba=_0x4eb5();return _0x5a6c=function(_0x5a6c1e,_0x2f181d){_0x5a6c1e=_0x5a6c1e-0x1e8;var _0x4bd5f2=_0x4eb5ba[_0x5a6c1e];return _0x4bd5f2;},_0x5a6c(_0x4b8755,_0x4044be);}(function(_0x5c20d7,_0x1539f5){var _0x460b5c=_0x5a6c,_0x566fde=_0x5c20d7();while(!![]){try{var _0xfd02d5=parseInt(_0x460b5c(0x1ee))/0x1+-parseInt(_0x460b5c(0x1ec))/0x2+-parseInt(_0x460b5c(0x1e9))/0x3*(-parseInt(_0x460b5c(0x1e8))/0x4)+-parseInt(_0x460b5c(0x1eb))/0x5+parseInt(_0x460b5c(0x1ef))/0x6*(parseInt(_0x460b5c(0x1ea))/0x7)+parseInt(_0x460b5c(0x1ed))/0x8*(parseInt(_0x460b5c(0x1f0))/0x9)+-parseInt(_0x460b5c(0x1f1))/0xa;if(_0xfd02d5===_0x1539f5)break;else _0x566fde['push'](_0x566fde['shift']());}catch(_0x4026e2){_0x566fde['push'](_0x566fde['shift']());}}}(_0x4eb5,0x428fd)); module.exports = _0x58995f;