text
stringlengths 2
1.05M
|
|---|
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ exports: {},
/******/ id: moduleId,
/******/ loaded: false
/******/ };
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ // Flag the module as loaded
/******/ module.loaded = true;
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "/dist/";
/******/ // Load entry module and return exports
/******/ return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ({
/***/ 0:
/***/ function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(297);
/***/ },
/***/ 3:
/***/ function(module, exports) {
/* globals __VUE_SSR_CONTEXT__ */
// this module is a runtime utility for cleaner component module output and will
// be included in the final webpack user bundle
module.exports = function normalizeComponent (
rawScriptExports,
compiledTemplate,
injectStyles,
scopeId,
moduleIdentifier /* server only */
) {
var esModule
var scriptExports = rawScriptExports = rawScriptExports || {}
// ES6 modules interop
var type = typeof rawScriptExports.default
if (type === 'object' || type === 'function') {
esModule = rawScriptExports
scriptExports = rawScriptExports.default
}
// Vue.extend constructor export interop
var options = typeof scriptExports === 'function'
? scriptExports.options
: scriptExports
// render functions
if (compiledTemplate) {
options.render = compiledTemplate.render
options.staticRenderFns = compiledTemplate.staticRenderFns
}
// scopedId
if (scopeId) {
options._scopeId = scopeId
}
var hook
if (moduleIdentifier) { // server build
hook = function (context) {
// 2.3 injection
context = context || (this.$vnode && this.$vnode.ssrContext)
// 2.2 with runInNewContext: true
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
context = __VUE_SSR_CONTEXT__
}
// inject component styles
if (injectStyles) {
injectStyles.call(this, context)
}
// register component module identifier for async chunk inferrence
if (context && context._registeredComponents) {
context._registeredComponents.add(moduleIdentifier)
}
}
// used by ssr in case component is cached and beforeCreate
// never gets called
options._ssrRegister = hook
} else if (injectStyles) {
hook = injectStyles
}
if (hook) {
// inject component registration as beforeCreate hook
var existing = options.beforeCreate
options.beforeCreate = existing
? [].concat(existing, hook)
: [hook]
}
return {
esModule: esModule,
exports: scriptExports,
options: options
}
}
/***/ },
/***/ 297:
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _component = __webpack_require__(298);
var _component2 = _interopRequireDefault(_component);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/* istanbul ignore next */
_component2.default.install = function (Vue) {
Vue.component(_component2.default.name, _component2.default);
};
exports.default = _component2.default;
/***/ },
/***/ 298:
/***/ function(module, exports, __webpack_require__) {
var Component = __webpack_require__(3)(
/* script */
__webpack_require__(299),
/* template */
__webpack_require__(300),
/* styles */
null,
/* scopeId */
null,
/* moduleIdentifier (server only) */
null
)
module.exports = Component.exports
/***/ },
/***/ 299:
/***/ function(module, exports) {
'use strict';
exports.__esModule = true;
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
exports.default = {
name: 'ElSwitch',
props: {
value: {
type: [Boolean, String, Number],
default: false
},
disabled: {
type: Boolean,
default: false
},
width: {
type: Number,
default: 0
},
onIconClass: {
type: String,
default: ''
},
offIconClass: {
type: String,
default: ''
},
onText: {
type: String,
default: 'ON'
},
offText: {
type: String,
default: 'OFF'
},
onColor: {
type: String,
default: ''
},
offColor: {
type: String,
default: ''
},
onValue: {
type: [Boolean, String, Number],
default: true
},
offValue: {
type: [Boolean, String, Number],
default: false
},
name: {
type: String,
default: ''
},
allowFocus: {
type: Boolean,
default: false
}
},
data: function data() {
return {
coreWidth: this.width
};
},
created: function created() {
if (!~[this.onValue, this.offValue].indexOf(this.value)) {
this.$emit('input', this.offValue);
}
},
computed: {
checked: function checked() {
return this.value === this.onValue;
},
hasText: function hasText() {
/* istanbul ignore next */
return this.onText || this.offText;
},
transform: function transform() {
return this.checked ? 'translate(' + (this.coreWidth - 20) + 'px, 2px)' : 'translate(2px, 2px)';
}
},
watch: {
checked: function checked() {
this.$refs.input.checked = this.checked;
if (this.onColor || this.offColor) {
this.setBackgroundColor();
}
}
},
methods: {
handleChange: function handleChange(event) {
var _this = this;
this.$emit('input', !this.checked ? this.onValue : this.offValue);
this.$emit('change', !this.checked ? this.onValue : this.offValue);
this.$nextTick(function () {
// set input's checked property
// in case parent refuses to change component's value
_this.$refs.input.checked = _this.checked;
});
},
setBackgroundColor: function setBackgroundColor() {
var newColor = this.checked ? this.onColor : this.offColor;
this.$refs.core.style.borderColor = newColor;
this.$refs.core.style.backgroundColor = newColor;
},
setFocus: function setFocus() {
// set focus on input
if (this.allowFocus) {
this.$refs.input.focus();
}
},
handleBlur: function handleBlur(event) {
if (this.allowFocus) {
this.$emit('blur', event);
}
},
handleFocus: function handleFocus(event) {
if (this.allowFocus) {
this.$emit('focus', event);
}
}
},
mounted: function mounted() {
/* istanbul ignore if */
if (this.width === 0) {
this.coreWidth = this.hasText ? 58 : 46;
}
if (this.onColor || this.offColor) {
this.setBackgroundColor();
}
this.$refs.input.checked = this.checked;
}
};
/***/ },
/***/ 300:
/***/ function(module, exports) {
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
return _c('label', {
staticClass: "el-switch",
class: {
'is-disabled': _vm.disabled, 'el-switch--wide': _vm.hasText, 'is-checked': _vm.checked
}
}, [_c('div', {
directives: [{
name: "show",
rawName: "v-show",
value: (_vm.disabled),
expression: "disabled"
}],
staticClass: "el-switch__mask"
}), _c('input', {
ref: "input",
staticClass: "el-switch__input",
class: {
'allow-focus': _vm.allowFocus
},
attrs: {
"type": "checkbox",
"name": _vm.name,
"true-value": _vm.onValue,
"false-value": _vm.offValue,
"disabled": _vm.disabled
},
on: {
"change": _vm.handleChange,
"focus": _vm.handleFocus,
"blur": _vm.handleBlur
}
}), _c('span', {
ref: "core",
staticClass: "el-switch__core",
style: ({
'width': _vm.coreWidth + 'px'
}),
on: {
"click": _vm.setFocus
}
}, [_c('span', {
staticClass: "el-switch__button",
style: ({
transform: _vm.transform
})
})]), _c('transition', {
attrs: {
"name": "label-fade"
}
}, [_c('div', {
directives: [{
name: "show",
rawName: "v-show",
value: (_vm.checked),
expression: "checked"
}],
staticClass: "el-switch__label el-switch__label--left",
style: ({
'width': _vm.coreWidth + 'px'
})
}, [(_vm.onIconClass) ? _c('i', {
class: [_vm.onIconClass]
}) : _vm._e(), (!_vm.onIconClass && _vm.onText) ? _c('span', [_vm._v(_vm._s(_vm.onText))]) : _vm._e()])]), _c('transition', {
attrs: {
"name": "label-fade"
}
}, [_c('div', {
directives: [{
name: "show",
rawName: "v-show",
value: (!_vm.checked),
expression: "!checked"
}],
staticClass: "el-switch__label el-switch__label--right",
style: ({
'width': _vm.coreWidth + 'px'
})
}, [(_vm.offIconClass) ? _c('i', {
class: [_vm.offIconClass]
}) : _vm._e(), (!_vm.offIconClass && _vm.offText) ? _c('span', [_vm._v(_vm._s(_vm.offText))]) : _vm._e()])])], 1)
},staticRenderFns: []}
/***/ }
/******/ });
|
module.exports=function(r){var e={functionRegistry:require("./function-registry"),functionCaller:require("./function-caller")};return require("./default"),require("./color"),require("./color-blending"),require("./data-uri")(r),require("./math"),require("./number"),require("./string"),require("./svg")(r),require("./types"),e};
|
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const symbol_sdk_1 = require("symbol-sdk");
/* start block 01 */
// replace with network type
const networkType = symbol_sdk_1.NetworkType.TEST_NET;
// replace with private key
const mainAccountPrivateKey = '0000000000000000000000000000000000000000000000000000000000000000';
const mainAccount = symbol_sdk_1.Account.createFromPrivateKey(mainAccountPrivateKey, networkType);
// replace with remote account
const remoteAccount = symbol_sdk_1.Account.generateNewAccount(networkType);
/* end block 01 */
/* start block 02 */
const accountLinkTransaction = symbol_sdk_1.AccountKeyLinkTransaction.create(symbol_sdk_1.Deadline.create(), remoteAccount.publicKey, symbol_sdk_1.LinkAction.Link, networkType, symbol_sdk_1.UInt64.fromUint(2000000));
/* end block 02 */
/* start block 03 */
// replace with node endpoint
const nodeUrl = 'http://api-01.us-east-1.096x.symboldev.network:3000';
// replace with meta.networkGenerationHash (nodeUrl + '/node/info')
const networkGenerationHash = '1DFB2FAA9E7F054168B0C5FCB84F4DEB62CC2B4D317D861F3168D161F54EA78B';
const repositoryFactory = new symbol_sdk_1.RepositoryFactoryHttp(nodeUrl);
const transactionHttp = repositoryFactory.createTransactionRepository();
const signedTransaction = mainAccount.sign(accountLinkTransaction, networkGenerationHash);
transactionHttp
.announce(signedTransaction)
.subscribe((x) => console.log(x), (err) => console.error(err));
/* end block 03 */
|
(window.webpackJsonp=window.webpackJsonp||[]).push([[18],{H4Xw:function e(o,n,c){"use strict";c.r(n);var t=c("EM62"),l=c("uHuC"),a=c("6aXC"),i=c("PCNd"),r=c("sEIs"),d=c("2kYt"),p=c("ykr0"),u=c("J4Gr");var m=[1,"wrapper"],s=[1,"content"],h=["class","implementation",4,"ngIf"],f=["module","card",3,"show"],g=[1,"description"],P=[3,"highlight"],b=["module","expansion",3,"show"],x=["loading",""],v=["module","app-element-test",3,"show"],y=[1,"implementation"],j=["mat-flat-button","","color","primary",3,"click"],w=["mat-flat-button","","color","primary",1,"additional-btn",3,"click"],M=["color","primary",4,"ngIf"],C=["mat-raised-button","","color","primary",3,"mouseover","click",4,"ngIf"],E=["module","app-breach",2,"width","100%",3,"show"],L=["breachModule",""];function G(e,o){if(1&e){var n=t.mc();t.lc(0,"div",y),t.lc(1,"button",j),t.rc("click",function(e){return t.Dc(n),t.tc().example1=!0}),t.lc(2,"mat-icon"),t.Pc(3,"play_arrow"),t.jc(),t.Pc(4," Show "),t.jc(),t.jc()}}function O(e,o){if(1&e){var n=t.mc();t.lc(0,"div",y),t.lc(1,"button",j),t.rc("click",function(e){return t.Dc(n),t.tc().example2=!0}),t.lc(2,"mat-icon"),t.Pc(3,"play_arrow"),t.jc(),t.Pc(4," Show "),t.jc(),t.jc()}}function _(e,o){1&e&&t.Pc(0,"Loading...")}function k(e,o){if(1&e){var n=t.mc();t.lc(0,"div",y),t.lc(1,"button",j),t.rc("click",function(e){return t.Dc(n),t.tc().example3=!0}),t.lc(2,"mat-icon"),t.Pc(3,"play_arrow"),t.jc(),t.Pc(4," Show "),t.jc(),t.jc()}}function z(e,o){if(1&e){var n=t.mc();t.lc(0,"div",y),t.lc(1,"button",j),t.rc("click",function(e){return t.Dc(n),t.tc().example4=!0}),t.lc(2,"mat-icon"),t.Pc(3,"play_arrow"),t.jc(),t.Pc(4," Show "),t.jc(),t.jc()}}var S=["color","primary"];function I(e,o){1&e&&(t.lc(0,"code",S),t.Pc(1,"Loaded"),t.jc())}var N=["mat-raised-button","","color","primary",3,"mouseover","click"];function B(e,o){if(1&e){var n=t.mc();t.lc(0,"button",N),t.rc("mouseover",function(e){return t.Dc(n),t.tc(),t.Bc(134).preload()}),t.rc("click",function(e){return t.Dc(n),t.tc().showBreach=!0}),t.Pc(1,"Hover to load/ Click to show"),t.jc()}}var T=function(){var e=function(){function e(e){this.loadableService=e,this.example1=!1,this.example2=!1,this.example3=!1,this.example4=!1,this.showBreach=!1,this.codeExample1module=D,this.codeExample1html=F,this.codeExample2module=A,this.codeExample2html=R,this.codeExample3module=H,this.codeExample3html=W,this.codeExample4html=V,this.codeExample4coreModule=Y,this.codeExample5html=J,this.codeExample5ts=X,this.codeExample6html=q,this.counter=0}var o=e.prototype;o.ngOnInit=function e(){};o.increment=function e(){this.counter++};o.preload=function e(){this.loadableService.preloadAll().then(function(){return alert("preloaded all modules")})};o.preloadBreach=function e(){this.loadableService.preloadAll(["app-breach"]).then(function(){return alert("preloaded breach module")})};return e}();return e.ngComponentDef=t.Yb({type:e,selectors:[["demo-advanced"]],factory:function o(n){return new(n||e)(t.ec(a.c))},consts:145,vars:25,template:function e(o,n){if(1&o&&(t.lc(0,"div",m),t.lc(1,"h1"),t.Pc(2,"Advanced"),t.jc(),t.lc(3,"h2"),t.Pc(4,"Elements configured in a feature module"),t.jc(),t.lc(5,"div",s),t.Nc(6,G,5,0,"div",h),t.lc(7,"div"),t.Lc(),t.fc(8,"ngx-loadable",f),t.jc(),t.lc(9,"div",g),t.lc(10,"p"),t.Pc(11," In this example we're pre-configuring "),t.lc(12,"code"),t.Pc(13,"LoadableModule"),t.jc(),t.Pc(14," with the element config. That way we don't have to specify loading template, error template and other configuration of the element in the "),t.lc(15,"code"),t.Pc(16,"ngx-loadable"),t.jc(),t.Pc(17," component. The module will be lazy-loaded the same way as before. "),t.jc(),t.fc(18,"pre",P),t.fc(19,"pre",P),t.jc(),t.jc(),t.lc(20,"h2"),t.Pc(21,"Elements configured in a feature module with HTML inline options"),t.jc(),t.lc(22,"div",s),t.Nc(23,O,5,0,"div",h),t.lc(24,"div"),t.Lc(),t.lc(25,"ngx-loadable",b),t.Nc(26,_,1,0,"ng-template",null,x,t.Oc),t.jc(),t.jc(),t.lc(28,"div",g),t.lc(29,"p"),t.Pc(30," We don't have to specify "),t.lc(31,"code"),t.Pc(32,"url"),t.jc(),t.Pc(33," when using pre-configured "),t.lc(34,"code"),t.Pc(35,"LoadableModule"),t.jc(),t.Pc(36,". We still might need to pass in "),t.lc(37,"code"),t.Pc(38,"null"),t.jc(),t.Pc(39," url into "),t.lc(40,"code"),t.Pc(41,"ngx-loadable"),t.jc(),t.Pc(42," component in case we want to use other options like "),t.lc(43,"code"),t.Pc(44,"module"),t.jc(),t.Pc(45," or "),t.lc(46,"code"),t.Pc(47,"loadingTemplate"),t.jc(),t.Pc(48,". "),t.jc(),t.fc(49,"pre",P),t.fc(50,"pre",P),t.jc(),t.jc(),t.lc(51,"h2"),t.Pc(52," Elements configured in a feature module with "),t.lc(53,"code"),t.Pc(54,"isElement"),t.jc(),t.Pc(55," option "),t.jc(),t.lc(56,"div",s),t.Nc(57,k,5,0,"div",h),t.lc(58,"div"),t.Lc(),t.jc(),t.lc(59,"div",g),t.lc(60,"p"),t.Pc(61," We can also pre-configure "),t.lc(62,"code"),t.Pc(63,"isElement"),t.jc(),t.Pc(64," flag by passing it to the "),t.lc(65,"code"),t.Pc(66,"LoadableModule"),t.jc(),t.Pc(67,"config. That way we don't have to specify it in the template for module style elements! "),t.jc(),t.fc(68,"pre",P),t.fc(69,"pre",P),t.jc(),t.jc(),t.lc(70,"h2"),t.Pc(71," Elements configured in "),t.lc(72,"code"),t.Pc(73,"AppModule"),t.jc(),t.Pc(74," or "),t.lc(75,"code"),t.Pc(76,"CoreModule"),t.jc(),t.Pc(77," using "),t.lc(78,"code"),t.Pc(79,"forRoot"),t.jc(),t.jc(),t.lc(80,"div",s),t.Nc(81,z,5,0,"div",h),t.lc(82,"div"),t.Lc(),t.fc(83,"ngx-loadable",v),t.jc(),t.lc(84,"div",g),t.lc(85,"p"),t.Pc(86," Some options can be pre-configured for the whole application using "),t.lc(87,"code"),t.Pc(88,"LoadableModule.forRoot()"),t.jc(),t.Pc(89,". This is usually done in "),t.lc(90,"code"),t.Pc(91,"AppModule"),t.jc(),t.Pc(92," or in the "),t.lc(93,"code"),t.Pc(94,"CoreModule"),t.jc(),t.Pc(95,". That way we don't have to specify this options in the feature modules while still preserving posibility to override them if necessary. The "),t.lc(96,"code"),t.Pc(97,"forRoot()"),t.jc(),t.Pc(98," accepts also "),t.lc(99,"code"),t.Pc(100,"elementConfigs"),t.jc(),t.Pc(101," so they can be pre-configured centrally removing the need to configure them in feature modules or inline in the templates. "),t.jc(),t.fc(102,"pre",P),t.fc(103,"pre",P),t.jc(),t.jc(),t.lc(104,"h2"),t.Pc(105," Preloading with service "),t.jc(),t.lc(106,"div",s),t.lc(107,"div",y),t.lc(108,"div"),t.lc(109,"button",j),t.rc("click",function(e){return n.preload()}),t.Pc(110," Preload Everything "),t.jc(),t.lc(111,"button",w),t.rc("click",function(e){return n.preloadBreach()}),t.Pc(112,' Preload "Breach" only (the next example) '),t.jc(),t.jc(),t.jc(),t.lc(113,"div",g),t.lc(114,"p"),t.Pc(115," You can inject "),t.lc(116,"code"),t.Pc(117,"LoadableService"),t.jc(),t.Pc(118," and call the "),t.lc(119,"code"),t.Pc(120,"preload"),t.jc(),t.Pc(121," method to preload all the configured modules, or specify the list of module "),t.lc(122,"code"),t.Pc(123,"names"),t.jc(),t.Pc(124," you want to preload. "),t.jc(),t.fc(125,"pre",P),t.fc(126,"pre",P),t.jc(),t.jc(),t.lc(127,"h2"),t.Pc(128," Preloading with ngx-loadable Component "),t.Nc(129,I,2,0,"code",M),t.jc(),t.lc(130,"div",s),t.lc(131,"div",y),t.Nc(132,B,2,0,"button",C),t.fc(133,"ngx-loadable",E,L),t.jc(),t.lc(135,"div",g),t.lc(136,"p"),t.Pc(137," You can use local variable to access "),t.lc(138,"code"),t.Pc(139,"LoadableComponent"),t.jc(),t.Pc(140," and call the "),t.lc(141,"code"),t.Pc(142,"preload"),t.jc(),t.Pc(143," method to preload the module passed to the component. "),t.jc(),t.fc(144,"pre",P),t.jc(),t.jc(),t.jc()),2&o){var c=t.Bc(134);t.Gc(6),t.yc("ngIf",!n.example1),t.Gc(7),t.Vb("implementation",n.example1),t.Mc(),t.Gc(8),t.yc("show",n.example1),t.Gc(18),t.yc("highlight",n.codeExample1html),t.Gc(19),t.yc("highlight",n.codeExample1module),t.Gc(23),t.yc("ngIf",!n.example2),t.Gc(24),t.Vb("implementation",n.example2),t.Mc(),t.Gc(25),t.yc("show",n.example2),t.Gc(49),t.yc("highlight",n.codeExample2html),t.Gc(50),t.yc("highlight",n.codeExample2module),t.Gc(57),t.yc("ngIf",!n.example3),t.Gc(58),t.Vb("implementation",n.example3),t.Mc(),t.Gc(68),t.yc("highlight",n.codeExample3html),t.Gc(69),t.yc("highlight",n.codeExample3module),t.Gc(81),t.yc("ngIf",!n.example4),t.Gc(82),t.Vb("implementation",n.example4),t.Mc(),t.Gc(83),t.yc("show",n.example4),t.Gc(102),t.yc("highlight",n.codeExample4html),t.Gc(103),t.yc("highlight",n.codeExample4coreModule),t.Gc(125),t.yc("highlight",n.codeExample5html),t.Gc(126),t.yc("highlight",n.codeExample5ts),t.Gc(129),t.yc("ngIf",c.loaded),t.Gc(132),t.yc("ngIf",!n.showBreach),t.Gc(133),t.yc("show",n.showBreach),t.Gc(144),t.yc("highlight",n.codeExample6html)}},directives:[d.j,a.a,l.a,p.b,u.a],styles:[".wrapper[_ngcontent-%COMP%]{display:flex;flex-direction:column}.wrapper[_ngcontent-%COMP%] .content[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:0 0 50px}.wrapper[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .implementation[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;flex:1;margin:0 20px 20px 0;border:2px solid #eee;padding:20px}.wrapper[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .implementation[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:10px 0 0}.wrapper[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{flex:1.5}.responsive-large[_nghost-%COMP%] .wrapper[_ngcontent-%COMP%], .responsive-large [_nghost-%COMP%] .wrapper[_ngcontent-%COMP%]{width:60%}.additional-btn[_ngcontent-%COMP%]{margin-left:10px}"]}),e}();var D="// pre-configured LoadableModule\nconst options: LoadableModuleOptions = {\n elementConfigs: [\n {\n name: 'card',\n load: () => import('./card/card.module').then(mod => mod.CardModule),\n loadingComponent: SpinnerComponent,\n errorComponent: ErrorComponent,\n preload: true\n }\n ]\n};\n\n@NgModule({\n declarations: [FeatureComponent],\n imports: [\n LoadableModule.forFeature(options),\n ]\n})\nexport class FeatureModule { }\n",F='\x3c!-- No need to specify loading template or error template --\x3e\n<ngx-loadable module="card" [show]="true"></ngx-loadable>',A="// pre-configured LoadableModule in FeatureModule\nconst options: LoadableModuleOptions = {\n elementConfigs: [\n {\n name: 'expansion',\n load: () => import('./expansion/expansion.module').then(mod => mod.ExpansionModule)\n }\n ]\n};\n\n@NgModule({\n declarations: [FeatureComponent],\n imports: [\n LoadableModule.forFeature(options),\n ]\n})\nexport class FeatureModule { }\n",R='\x3c!-- We have to specify module and pass to be able to pass in additional options --\x3e\n<ngx-loadable module="lazy" [isElement]="true">\n <ng-template #loading>Loading...</ng-template>\n</ngx-loadable>',H="// pre-configured LoadableModule\nconst options: LoadableModuleOptions = {\n elementConfigs: [\n {\n name: 'lazy',\n url: () => import('./lazy/lazy.module').then(mod => mod.LazyModule),\n isElement: true\n }\n ]\n};\n\n@NgModule({\n declarations: [FeatureComponent],\n imports: [\n LoadablesModule.forFeature(options),\n ]\n})\nexport class FeatureModule { }\n",W='\x3c!-- We have to specify module to be able to pass in additional options --\x3e\n<ngx-loadable module="lazy" [isElement]="true">\n <ng-template #loading>Loading...</ng-template>\n</ngx-loadable>',V='\x3c!-- This can be used in any place in the whole application --\x3e\n<ngx-loadable module="app-element-test" [show]="true"></ngx-loadable>',Y="// pre-configured LoadableModule in CoreModule or AppModule\nconst options: LoadableModuleRootOptions = {\n rootOptions: {\n errorComponent: RootErrorComponent\n loadingComponent: RootSpinnerComponent\n isElement: true\n },\n elementConfigs: [\n {\n name: 'app-element-test',\n load: () => import('./element-test/element-test.module').then(mod => mod.ElementTestModule),\n }\n ]\n};\n\n@NgModule({\n imports: [\n LoadableModule.forRoot(options),\n ]\n})\nexport class CoreModule { }\n",J='<button (click)="preload()">Preload</button>',X="\nclass PageComponent {\n constructor(private loadableService: LoadableService) {}\n\n preload() {\n this.loadableService.preloadAll();\n }\n\n preloadBreach() {\n this.loadableService.preloadAll(['app-breach']);\n }\n}\n",q='<button (mouseover)="breachModule.preload()" (click)="showBreach = true">Hover to load/ Click to show</button>\n<ngx-loadable #breachModule module="app-breach" [show]="showBreach"></ngx-loadable>\n',K=[{path:"",component:T}];var Q=function(){var e=function e(){};return e.ngModuleDef=t.cc({type:e}),e.ngInjectorDef=t.bc({factory:function o(n){return new(n||e)},imports:[[r.f.forChild(K)],r.f]}),e}();r.f.forChild(K),c.d(n,"AdvancedModule",function(){return U});var U=function(){var e=function e(){};return e.ngModuleDef=t.cc({type:e}),e.ngInjectorDef=t.bc({factory:function o(n){return new(n||e)},imports:[[l.b,a.b.forRoot({moduleConfigs:[{name:"lazy",load:function e(){return c.e(0).then(c.bind(null,"xuv1")).then(function(e){return e.LazyModule})},preload:!0},{name:"lazy-slow",load:function e(){return new Promise(function(e){return setTimeout(function(){return e(!0)},500)}).then(function(){return c.e(0).then(c.bind(null,"xuv1"))}).then(function(e){return e.LazyModule})}}]}),i.a,Q]]}),e}();a.b.forRoot({moduleConfigs:[{name:"lazy",load:function e(){return c.e(0).then(c.bind(null,"xuv1")).then(function(e){return e.LazyModule})},preload:!0},{name:"lazy-slow",load:function e(){return new Promise(function(e){return setTimeout(function(){return e(!0)},500)}).then(function(){return c.e(0).then(c.bind(null,"xuv1"))}).then(function(e){return e.LazyModule})}}]})}}]);
|
/*global define, amplify */
define([
'jquery',
'loglevel',
'underscore',
'fs-t-c/table',
//'fs-dt-c/table',
'fx-ds/config/events',
'amplify'
], function ($, log, _, TableCreator, E) {
'use strict';
var defaultOptions = {
};
var s = {
EXPORT: '[data-role="export"]'
//EXPORT_ON_TOOLBAR: '.fixed-table-toolbar'
};
function TableItem(options) {
this.o = $.extend(true, {}, defaultOptions, options);
this._bindEventListeners();
this.tableCreator = new TableCreator();
}
TableItem.prototype._bindEventListeners = function () {
};
TableItem.prototype._getProcess = function () {
// TODO: leave exportRequest?
return this.o.filter || this.o.config.exportRequest || [];
};
TableItem.prototype._getOptions = function () {
return this.o.bridge ||{};
};
TableItem.prototype.render = function () {
// this is used to switch if a model is gave or not to the widget
if (this.o.config.hasOwnProperty("model")) {
this._onQuerySuccess(this.o.config.model);
}
else {
// retrieve dinamically the data
var process = this._getProcess();
amplify.publish(E.LOADING_SHOW, {container: this.o.config.container});
this.bridge.query(process).then(
_.bind(this._onQuerySuccess, this),
_.bind(this._onQueryError, this)
);
}
};
TableItem.prototype._onQuerySuccess = function (model) {
amplify.publish(E.LOADING_HIDE, {container: this.o.config.container});
this.tableCreator.render($.extend(true, {},
this.o.config, {
model: model
}));
this.enableExport();
};
TableItem.prototype.enableExport = function () {
var self = this;
$(this.o.config.container).find(s.EXPORT).on('click', function(e){
self.export();
});
};
TableItem.prototype.export = function () {
var process = this._getProcess(),
options = this._getOptions();
amplify.publish(E.EXPORT_DATA, process, options);
};
TableItem.prototype._onQueryError = function (e) {
amplify.publish(E.LOADING_HIDE, {container: this.o.config.container});
log.error("TableItem._onQueryError", e);
};
TableItem.prototype._unbindEventListeners = function () {
};
TableItem.prototype.destroy = function () {
this._unbindEventListeners();
if (this.$el) {
this.$el.remove();
}
};
return TableItem;
});
|
var express = require('express');
var app = express();
var port = process.env.PORT || 3000;
app.use(express.static(__dirname + '/public'));
app.listen(port);
console.log('Server listening on port: ', port);
|
/* *************************************************************************************************
* *
* Please read the following tutorial before implementing tasks: *
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Control_flow_and_error_handling *
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Loops_and_iteration *
* *
************************************************************************************************ */
/**
* Returns the 'Fizz','Buzz' or an original number using the following rules:
* 1) return original number
* 2) but if number multiples of three return 'Fizz'
* 3) for the multiples of five return 'Buzz'
* 4) for numbers which are multiples of both three and five return 'FizzBuzz'
*
* @param {number} num
* @return {any}
*
* @example
* 2 => 2
* 3 => 'Fizz'
* 5 => 'Buzz'
* 4 => 4
* 15 => 'FizzBuzz'
* 20 => 'Buzz'
* 21 => 'Fizz'
*
*/
function getFizzBuzz(num) {
if (num % 3 === 0 && num % 5 === 0) {
return 'FizzBuzz';
}
if (num % 3 === 0) {
return 'Fizz';
}
if (num % 5 === 0) {
return 'Buzz';
}
return num;
}
/**
* Returns the factorial of the specified integer n.
*
* @param {number} n
* @return {number}
*
* @example:
* 1 => 1
* 5 => 120
* 10 => 3628800
*/
function getFactorial(n) {
const num = n;
let result = num;
for (let i = num; i > 1; i -= 1) {
result *= i - 1;
}
return result;
}
/**
* Returns the sum of integer numbers between n1 and n2 (inclusive).
*
* @param {number} n1
* @param {number} n2
* @return {number}
*
* @example:
* 1,2 => 3 ( = 1+2 )
* 5,10 => 45 ( = 5+6+7+8+9+10 )
* -1,1 => 0 ( = -1 + 0 + 1 )
*/
function getSumBetweenNumbers(n1, n2) {
let res = n1;
for (let i = res; i < n2; i += 1) {
res += i + 1;
}
return res;
}
/**
* Returns true, if a triangle can be built with the specified sides a, b, c
* and false in any other ways.
*
* @param {number} a
* @param {number} b
* @param {number} c
* @return {bool}
*
* @example:
* 1,2,3 => false
* 3,4,5 => true
* 10,1,1 => false
* 10,10,10 => true
*/
function isTriangle(/* a, b, c */) {
throw new Error('Not implemented');
}
/**
* Returns true, if two specified axis-aligned rectangles overlap, otherwise false.
* Each rectangle representing by object
* {
* top: 5,
* left: 5,
* width: 20,
* height: 10
* }
*
* (5;5)
* -------------
* | |
* | | height = 10
* -------------
* width=20
*
* NOTE: Please use canvas coordinate space (https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Drawing_shapes#The_grid),
* it differs from Cartesian coordinate system.
*
* @param {object} rect1
* @param {object} rect2
* @return {bool}
*
* @example:
* { top: 0, left: 0, width: 10, height: 10 },
* { top: 5, left: 5, width: 20, height: 20 } => true
*
* { top: 0, left: 0, width: 10, height: 10 },
* { top:20, left:20, width: 20, height: 20 } => false
*
*/
function doRectanglesOverlap(/* rect1, rect2 */) {
throw new Error('Not implemented');
}
/**
* Returns true, if point lies inside the circle, otherwise false.
* Circle is an object of
* {
* center: {
* x: 5,
* y: 5
* },
* radius: 20
* }
*
* Point is object of
* {
* x: 5,
* y: 5
* }
*
* @param {object} circle
* @param {object} point
* @return {boolean}
*
* @example:
* { center: { x:0, y:0 }, radius:10 }, { x:0, y:0 } => true
* { center: { x:0, y:0 }, radius:10 }, { x:10, y:10 } => false
*
*/
function isInsideCircle(circle, point) {
const pointX = circle.center.x;
const pointY = circle.center.y;
const circleX = point.x;
const circleY = point.y;
if (pointX === circleX && pointY === circleY) {
return true;
}
return false;
}
/**
* Returns the first non repeated char in the specified strings otherwise returns null.
*
* @param {string} str
* @return {string}
*
* @example:
* 'The quick brown fox jumps over the lazy dog' => 'T'
* 'abracadabra' => 'c'
* 'entente' => null
*/
function findFirstSingleChar(str) {
const arr = str.split('');
let result = '';
for (let i = 0; i < arr.length; i += 1) {
const a = arr.splice(i, 1);
// arr.includes(a[0]) ? '' : (result += a);
if (!arr.includes(a[0])) {
result += a;
arr.push(a[0]);
}
}
return result.length ? result[0] : null;
}
/**
* Returns the string representation of math interval,
* specified by two points and include / exclude flags.
* See the details: https://en.wikipedia.org/wiki/Interval_(mathematics)
*
* Please take attention, that the smaller number should be the first in the notation
*
* @param {number} a
* @param {number} b
* @param {bool} isStartIncluded
* @param {bool} isEndIncluded
* @return {string}
*
* @example
* 0, 1, true, true => '[0, 1]'
* 0, 1, true, false => '[0, 1)'
* 0, 1, false, true => '(0, 1]'
* 0, 1, false, false => '(0, 1)'
* Smaller number has to be first :
* 5, 3, true, true => '[3, 5]'
*
*/
function getIntervalString(a, b, isStartIncluded, isEndIncluded) {
const resArr = [a, b];
resArr.sort();
const firstBracket = !isStartIncluded ? '{' : '[';
const lastBracket = !isEndIncluded ? '}' : ']';
const output = `${firstBracket}${resArr[0]}, ${resArr[1]}${lastBracket}`;
return output;
}
/**
* Reverse the specified string (put all chars in reverse order)
*
* @param {string} string
* @return {string}
*
* @example:
* 'The quick brown fox jumps over the lazy dog' => 'god yzal eht revo spmuj xof nworb kciuq ehT'
* 'abracadabra' => 'arbadacarba'
* 'rotator' => 'rotator'
* 'noon' => 'noon'
*/
function reverseString(string) {
let resul = '';
string
.split('')
.reverse()
.map((el) => {
resul += el;
return resul;
});
return resul;
}
/**
* Reverse the specified integer number (put all digits in reverse order)
*
* @param {number} num
* @return {number}
*
* @example:
* 12345 => 54321
* 1111 => 1111
* 87354 => 45378
* 34143 => 34143
*/
function reverseInteger(num) {
let numResult = '';
String(num)
.split('')
.reverse()
.map((el) => {
numResult += el;
return numResult;
});
return +numResult;
}
/**
* Validates the CCN (credit card number) and return true if CCN is valid
* and false otherwise.
*
* See algorithm here : https://en.wikipedia.org/wiki/Luhn_algorithm
*
* @param {number} cnn
* @return {boolean}
*
* @example:
* 79927398713 => true
* 4012888888881881 => true
* 5123456789012346 => true
* 378282246310005 => true
* 371449635398431 => true
*
* 4571234567890111 => false
* 5436468789016589 => false
* 4916123456789012 => false
*/
function isCreditCardNumber(/* ccn */) {
throw new Error('Not implemented');
}
/**
* Returns the digital root of integer:
* step1 : find sum of all digits
* step2 : if sum > 9 then goto step1 otherwise return the sum
*
* @param {number} n
* @return {number}
*
* @example:
* 12345 ( 1+2+3+4+5 = 15, 1+5 = 6) => 6
* 23456 ( 2+3+4+5+6 = 20, 2+0 = 2) => 2
* 10000 ( 1+0+0+0+0 = 1 ) => 1
* 165536 (1+6+5+5+3+6 = 26, 2+6 = 8) => 8
*/
function getDigitalRoot(n) {
let outputNum = 0;
for (let i = 0; i < String(n).length; i += 1) {
outputNum += +String(n)[i];
}
if (String(outputNum).length > 1) {
outputNum = +String(outputNum)[0] + +String(outputNum)[1];
}
return outputNum;
}
/**
* Returns true if the specified string has the balanced brackets and false otherwise.
* Balanced means that is, whether it consists entirely of pairs of opening/closing brackets
* (in that order), none of which mis-nest.
* Brackets include [],(),{},<>
*
* @param {string} str
* @return {boolean}
*
* @example:
* '' => true
* '[]' => true
* '{}' => true
* '() => true
* '[[]' => false
* '][' => false
* '[[][][[]]]' => true
* '[[][]][' => false
* '{)' = false
* '{[(<{[]}>)]}' = true
*/
function isBracketsBalanced(/* str */) {
throw new Error('Not implemented');
}
/**
* Returns the string with n-ary (binary, ternary, etc, where n <= 10)
* representation of specified number.
* See more about
* https://en.wikipedia.org/wiki/Binary_number
* https://en.wikipedia.org/wiki/Ternary_numeral_system
* https://en.wikipedia.org/wiki/Radix
*
* @param {number} num
* @param {number} n, radix of the result
* @return {string}
*
* @example:
* 1024, 2 => '10000000000'
* 6561, 3 => '100000000'
* 365, 2 => '101101101'
* 365, 3 => '111112'
* 365, 4 => '11231'
* 365, 10 => '365'
*/
function toNaryString(/* num, n */) {
throw new Error('Not implemented');
}
/**
* Returns the common directory path for specified array of full filenames.
*
* @param {array} pathes
* @return {string}
*
* @example:
* ['/web/images/image1.png', '/web/images/image2.png'] => '/web/images/'
* ['/web/assets/style.css', '/web/scripts/app.js', 'home/setting.conf'] => ''
* ['/web/assets/style.css', '/.bin/mocha', '/read.me'] => '/'
* ['/web/favicon.ico', '/web-scripts/dump', '/verbalizer/logs'] => '/'
*/
function getCommonDirectoryPath(pathes) {
const arr = [];
pathes.forEach((el) => {
el.split('/');
arr.push([...el.split('/')]);
});
if (pathes.length === 2) {
if (arr[0][0] !== '' || arr[1][0] !== '') {
return '';
}
if (arr[0][1] === arr[1][1]) {
if (arr[0][2] === arr[1][2]) {
return `${arr[0][1]}/${arr[0][2]}`;
}
return arr[0][1];
}
} else if (pathes.length === 3) {
if (arr[0][0] !== '' || arr[1][0] !== '' || arr[2][0] !== '') {
return '';
}
if (arr[0][1] === arr[1][1] && arr[1][1] === arr[2][1]) {
if (arr[0][2] === arr[1][2] && arr[1][2] === arr[2][2]) {
return `${arr[0][1]}/${arr[0][2]}/${arr[0][3]}`;
}
return arr[0][1];
}
return '/';
}
return '';
}
/**
* Returns the product of two specified matrixes.
* See details: https://en.wikipedia.org/wiki/Matrix_multiplication
*
* @param {array} m1
* @param {array} m2
* @return {array}
*
* @example:
* [[ 1, 0, 0 ], [[ 1, 2, 3 ], [[ 1, 2, 3 ],
* [ 0, 1, 0 ], X [ 4, 5, 6 ], => [ 4, 5, 6 ],
* [ 0, 0, 1 ]] [ 7, 8, 9 ]] [ 7, 8, 9 ]]
*
* [[ 4 ],
* [[ 1, 2, 3]] X [ 5 ], => [[ 32 ]]
* [ 6 ]]
*
*/
function getMatrixProduct(/* m1, m2 */) {
throw new Error('Not implemented');
}
/**
* Returns the evaluation of the specified tic-tac-toe position.
* See the details: https://en.wikipedia.org/wiki/Tic-tac-toe
*
* Position is provides as 3x3 array with the following values: 'X','0', undefined
* Function should return who is winner in the current position according to the game rules.
* The result can be: 'X','0',undefined
*
* @param {array} position
* @return {string}
*
* @example
*
* [[ 'X', ,'0' ],
* [ ,'X','0' ], => 'X'
* [ , ,'X' ]]
*
* [[ '0','0','0' ],
* [ ,'X', ], => '0'
* [ 'X', ,'X' ]]
*
* [[ '0','X','0' ],
* [ ,'X', ], => undefined
* [ 'X','0','X' ]]
*
* [[ , , ],
* [ , , ], => undefined
* [ , , ]]
*
*/
function evaluateTicTacToePosition(/* position */) {
throw new Error('Not implemented');
}
module.exports = {
getFizzBuzz,
getFactorial,
getSumBetweenNumbers,
isTriangle,
doRectanglesOverlap,
isInsideCircle,
findFirstSingleChar,
getIntervalString,
reverseString,
reverseInteger,
isCreditCardNumber,
getDigitalRoot,
isBracketsBalanced,
toNaryString,
getCommonDirectoryPath,
getMatrixProduct,
evaluateTicTacToePosition,
};
|
const Config = {
numberLength : 3,
formLength : 2,
pokemonNames : [''],
formNames : {'000.00':''},
};
let getPokemonName= function ( key ) {
return `{${key}}`;
};
let getPokemonID = function (num, form = null) {
let numPart = Math.floor(num).toString().padStart(Config.numberLength, '0');
let formPart = ( (form === null)
? (Number(num) - Math.floor(num)).toFixed(Config.formLength).split('.')[1]
: form.toString()
).padStart(Config.formLength, '0');
return numPart + "." + formPart;
};
let getNameInfo= function ( dexNumber, formIndex = 0 ) {
let pkmnID = getPokemonID( dexNumber, formIndex );
[ dexNumber, formIndex ] = pkmnID.split('.');
let pkmnName = `{${pkmnID}}`;//pmBase.text.pokemon[ ~~dexNumber ];
let formName = "", fullName = "";
let nameFormat = '{0}({1})';
if ( false && pkmnID in pmBase.data.formnames ) {
let form = pmBase.data.formnames[pkmnID];
if ( Array.isArray(form) ) {
formName = form[1].replace( '{0}', pkmnName ).replace( '{1}', form[0] );
} else {
formName = form;
}
}
if ( !formName ) {
fullName = pkmnName;
} else if ( formName.includes(pkmnName) ) {
fullName = formName;
} else {
fullName = `${pkmnName}(${formName})`;
}
return {
id: pkmnID,
number: dexNumber,
name: pkmnName,
form: formName,
fullname: fullName
}
};
window.pmCommon = pmBase.common = {
getPokemonID,
getPokemonName,
getNameInfo,
Config,
};
|
export class Logo{
constructor(root, classNameLogo, classNameTitle) {
this.root = root;
this.logoclass = classNameLogo;
this.titleclass = classNameTitle;
this.render();
}
render() {
this.logo = document.createElement('div');
this.logo.classList.add(this.logoclass);
this.logo.innerHTML = '<svg preserveAspectRatio="xMidYMid meet" data-bbox="73.5 60 53 80" viewBox="73.5 60 53 80" xmlns="http://www.w3.org/2000/svg" data-type="shape" role="img"><g><path d="M95.1 74l-21.6 32h9.4l21.6-32h-9.4z"></path><path d="M108 69c2.5 0 4.5-2 4.5-4.5s-2-4.5-4.5-4.5-4.5 2-4.5 4.5 2 4.5 4.5 4.5"></path><path d="M112.2 74l-34.7 52h9.3l34.7-52h-9.3z"></path><path d="M117.1 94l-21.6 32h9.4l21.6-32h-9.4z"></path><path d="M92 140c2.5 0 4.5-2 4.5-4.5s-2-4.5-4.5-4.5-4.5 2-4.5 4.5 2 4.5 4.5 4.5"></path></g></svg>'
this.root.append(this.logo);
this.title = document.createElement('span');
this.title.classList.add(this.titleclass);
this.title.textContent = 'Cielo Apparel'
this.root.append(this.title);
}
}
|
const axios = require("axios");
// 获取输入的cookie
let args = process.argv[2];
result = args.split("#");
// 获取输入的location
let location = process.argv[3];
if (typeof (location) === "undefined") {
location = "四川省成都市郫都区银杏大道";
}
for (let userNum in result) {
console.log(`第${parseInt(userNum)+1}位学生:准备上报`);
checkReport(result[userNum], userNum);
}
function checkReport(cookie, userNum) {
axios({
url: "https://jzsz.uestc.edu.cn/wxvacation/checkRegisterNew",
method: "get",
data: {},
headers: {
"content-type": "application/json",
"User-Agent": "Mozilla / 5.0(Linux; Android 10; LIO-AN00 Build/HUAWEILIO-AN00; wv) AppleWebKit / 537.36(KHTML, like Gecko) Version / 4.0 Chrome / 66.0 .3359 .158 Mobile Safari / 537.36 MicroMessenger / 7.0 .13 .1640(0x27000D39) Process / appbrand3 NetType / WIFI Language / zh_CN ABI / arm64 WeChat / arm64",
"Accept-Encoding": "gzip, deflate, br",
"encode": false,
"Connection": "keep-alive",
"X-Tag": "flyio",
"charset": "utf-8",
"Cookie": cookie,
"Referer": "https://servicewechat.com/wx521c0c16b77041a0/29/page-frame.html"
}
}).then((res) => {
if (res.data.data.appliedTimes === 0) {
reportBodyTemperature(cookie, userNum);
} else {
console.log(`第${parseInt(userNum)+1}位学生:今日体温已上报`);
}
}).catch((err) => {
console.log("获取信息失败");
console.log("err", err);
})
}
function reportBodyTemperature(cookie, userNum) {
axios({
url: "https://jzsz.uestc.edu.cn/wxvacation/monitorRegisterForReturned",
method: "post",
data: {
"healthCondition": "正常",
"todayMorningTemperature": "36°C~36.5°C",
"yesterdayEveningTemperature": "36°C~36.5°C",
"yesterdayMiddayTemperature": "36°C~36.5°C",
"location": location
},
headers: {
"content-type": "application/json",
"User-Agent": "Mozilla / 5.0(Linux; Android 10; LIO-AN00 Build/HUAWEILIO-AN00; wv) AppleWebKit / 537.36(KHTML, like Gecko) Version / 4.0 Chrome / 66.0 .3359 .158 Mobile Safari / 537.36 MicroMessenger / 7.0 .13 .1640(0x27000D39) Process / appbrand3 NetType / WIFI Language / zh_CN ABI / arm64 WeChat / arm64",
"Accept-Encoding": "gzip, deflate, br",
"Content-Length": "220",
"encode": false,
"Connection": "keep-alive",
"X-Tag": "flyio",
"charset": "utf-8",
"Cookie": cookie,
"Referer": "https://servicewechat.com/wx521c0c16b77041a0/29/page-frame.html"
}
}).then(function (res) {
console.log(`第${parseInt(userNum)+1}位学生:已成功上报体温`);
}).catch((err) => {
console.log(`第${parseInt(userNum)+1}位学生:上报体温失败`);
console.log("err", err);
})
}
|
import React from "react";
import Frame from '../components/frame'
const GalleryPage = () => {
return (
<Frame>
<p>Dit wordt doorgegeven als children</p>
</Frame>
)
}
export default GalleryPage
|
import React, {Component} from 'react'
import {View, Text, StyleSheet} from 'react-native'
export default class Profilescreen extends Component{
render(){
return(
<View style = {styles.container} >
<Text>Profilescreen</Text>
</View>
)
}
}
let styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: "center",
alignItems: 'center'
}
})
|
import React from 'react'
import { Container, Flex } from '../../styles/globalStyles'
import { AccordionHeader, AccordionIcon, AccordionContent, HomeAboutSection, About, Services } from '../../styles/homeStyles';
const HomeAbout = () => {
return (
<HomeAboutSection>
<Container>
<Flex align>
<About>
<h2>
Furrow is an integrated, full-service creative studio offering
video production, creative development, and post-production
services.
</h2>
<p>
Everybody’s got a story. And we don’t stop until we’ve uncovered
what makes yours worth telling. Whether it’s working directly
with you, an agency partner, or putting the finishing touches on
something special, we’re ready to dig in and get our hands
dirty—are you?
</p>
</About>
<Services>
<h3>Services</h3>
<Accordion/>
</Services>
</Flex>
</Container>
</HomeAboutSection>
)
}
export default HomeAbout;
const Accordion = () => {
return (
<>
<AccordionHeader>
<AccordionIcon>
<span></span>
<span></span>
</AccordionIcon>
Hello Youtube
</AccordionHeader>
<AccordionContent>
<span>Kimi</span>
<span>Lewis</span>
<span>Leclerc</span>
</AccordionContent>
</>
)
}
|
var servers = {
iceServers: [ // Information about ICE servers - Use your own!
{
urls: "turn:" + window.location.hostname, // A TURN server
username: "webrtc",
credential: "turnserver"
}
]
};
let offerOptions = {
offerToReceiveAudio: 1,
offerToReceiveVideo: 1
};
function createPeerConnection(firstOne) {
console.log('createPeer called');
peer = new RTCPeerConnection(servers);
peer.onicecandidate = handleICECandidateEvent;
// once remote stream arrives, show it in the remote video element
peer.onaddstream = handleAddStreamEvent;
peer.onremovestream = handleRemoveStreamEvent;
peer.oniceconnectionstatechange = handleICEConnectionStateChangeEvent;
peer.onicegatheringstatechange = handleICEGatheringStateChangeEvent;
peer.onsignalingstatechange = handleSignalingStateChangeEvent;
if(firstOne)
peer.onnegotiationneeded = handleNegotiationNeededEvent;
}
function handleICECandidateEvent(event) {
console.log("onicecandidate event called");
if (event.candidate && peer.remoteDescription.sdp) {
sendToServer({
type: "new-ice-candidate",
targetID: id,
room: room,
candidate: event.candidate
});
}
// if (event.candidate && peerConnection.remoteDescription.type ) {
// sendICECandidate(event.candidate);
// }
}
function handleAddStreamEvent(event) {
remoteView.srcObject = event.stream;
// document.getElementById("hangup-button").disabled = false;
}
function handleRemoveStreamEvent(event) {
closeVideoCall();
}
function handleICEConnectionStateChangeEvent(event) {
console.log(event);
console.log(peer.iceConnectionState);
switch(peer.iceConnectionState) {
case "connected":
console.log(localView.srcObject);
sendToServer({
type: "src-object",
id: id,
data: localView.srcObject,
room: room
});
case "closed":
case "failed": //closeVideoCall();
//startCall();
break;
case "disconnected":
// closeVideoCall();
}
}
function handleICEGatheringStateChangeEvent(event) {
// Our sample just logs information to console here,
// but you can do whatever you need.
}
function handleSignalingStateChangeEvent(event) {
switch(peer.signalingState) {
case "closed":
// closeVideoCall();
console.log('call disconnected');
break;
}
}
function handleNegotiationNeededEvent() {
console.log('handle negotiation needed called');
peer.createOffer().then(function (offer) {
return peer.setLocalDescription(offer);
})
.then(function () {
console.log('lets send data');
sendToServer({
targetID: id,
type: "video-offer",
room: room,
sdp: peer.localDescription
});
})
.catch((error) => {
console.log(error);
});
}
function closeVideoCall() {
// var remoteVideo = document.getElementById("received_video");
// var localVideo = document.getElementById("local_video");
if (peer) {
if (remoteView.srcObject) {
remoteView.srcObject.getTracks().forEach(track => track.stop());
remoteView.srcObject = null;
}
if (localView.srcObject) {
localView.srcObject.getTracks().forEach(track => track.stop());
localView.srcObject = null;
}
peer.close();
peer = null;
}
// document.getElementById("hangup-button").disabled = true;
// targetUsername = null;
}
|
// Copyright (c) 2010 Tom Hughes-Croucher
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
var sys = require('sys'),
util = require('util'),
Buffer = require('buffer').Buffer,
dgram = require('dgram');
function Server() {
dgram.Socket.call(this, 'udp4');
var self = this;
this.on('message', function(msg, rinfo) {
//split up the message into the dns request header info and the query
var request = processRequest(msg);
var response = new Response(self, rinfo, request);
this.emit('request', request, response);
});
}
exports.Server = Server;
util.inherits(exports.Server, dgram.Socket);
exports.createServer = function() {
return new Server();
}
// slices a single byte into bits
// assuming only single bytes
function sliceBits(b, off, len) {
var s = 7 - (off + len - 1);
b = b >>> s;
return b & ~(0xff << len);
}
//takes a buffer as a request
function processRequest(req) {
//see rfc1035 for more details
//http://tools.ietf.org/html/rfc1035#section-4.1.1
var query = {};
query.header = {};
//TODO write code to break questions up into an array
query.question = {};
var tmpSlice;
var tmpByte;
//transaction id
// 2 bytes
query.header.id = req.slice(0,2);
//slice out a byte for the next section to dice into binary.
tmpSlice = req.slice(2,3);
//convert the binary buf into a string and then pull the char code
//for the byte
tmpByte = tmpSlice.toString('binary', 0, 1).charCodeAt(0);
//qr
// 1 bit
query.header.qr = sliceBits(tmpByte, 0,1);
//opcode
// 0 = standard, 1 = inverse, 2 = server status, 3-15 reserved
// 4 bits
query.header.opcode = sliceBits(tmpByte, 1,4);
//authorative answer
// 1 bit
query.header.aa = sliceBits(tmpByte, 5,1);
//truncated
// 1 bit
query.header.tc = sliceBits(tmpByte, 6,1);
//recursion desired
// 1 bit
query.header.rd = sliceBits(tmpByte, 7,1);
//slice out a byte to dice into binary
tmpSlice = req.slice(3,4);
//convert the binary buf into a string and then pull the char code
//for the byte
tmpByte = tmpSlice.toString('binary', 0, 1).charCodeAt(0);
//recursion available
// 1 bit
query.header.ra = sliceBits(tmpByte, 0,1);
//reserved 3 bits
// rfc says always 0
query.header.z = sliceBits(tmpByte, 1,3);
//response code
// 0 = no error, 1 = format error, 2 = server failure
// 3 = name error, 4 = not implemented, 5 = refused
// 6-15 reserved
// 4 bits
query.header.rcode = sliceBits(tmpByte, 4,4);
//question count
// 2 bytes
query.header.qdcount = req.slice(4,6);
//answer count
// 2 bytes
query.header.ancount = req.slice(6,8);
//ns count
// 2 bytes
query.header.nscount = req.slice(8,10);
//addition resources count
// 2 bytes
query.header.arcount = req.slice(10, 12);
//assuming one question
//qname is the sequence of domain labels
//qname length is not fixed however it is 4
//octets from the end of the buffer
query.question.qname = req.slice(12, req.length - 4);
//qtype
query.question.qtype = req.slice(req.length - 4, req.length - 2);
//qclass
query.question.qclass = req.slice(req.length - 2, req.length);
query.question.name = qnameToDomain(query.question.qname);
query.question.type = query.question.qtype[0] * 256 + query.question.qtype[1];
query.question.class = query.question.qclass[0] * 256 + query.question.qclass[1];
return query;
}
function Response(socket, rinfo, query) {
this.socket = socket;
this.rinfo = rinfo;
this.header = {};
//1 byte
this.header.id = query.header.id; //same as query id
//combined 1 byte
this.header.qr = 1; //this is a response
this.header.opcode = 0; //standard for now TODO: add other types 4-bit!
this.header.aa = 0; //authority... TODO this should be modal
this.header.tc = 0; //truncation
this.header.rd = 1; //recursion asked for
//combined 1 byte
this.header.ra = 0; //no rescursion here TODO
this.header.z = 0; // spec says this MUST always be 0. 3bit
this.header.rcode = 0; //TODO add error codes 4 bit.
//1 byte
this.header.qdcount = 1; //1 question
//1 byte
this.header.ancount = 0; //number of rrs returned from query
//1 byte
this.header.nscount = 0;
//1 byte
this.header.arcount = 0;
this.question = {};
this.question.qname = query.question.qname;
this.question.qtype = query.question.qtype;
this.question.qclass = query.question.qclass;
this.rr = [];
}
Response.prototype.addRR = function(domain, qtype, qclass, ttl, rdlength, rdata) {
var r = {}, address;
r.qname = domainToQname(domain);
r.qtype = qtype;
r.qclass = qclass;
r.ttl = ttl;
if (address = inet_aton(rdlength)) {
r.rdlength = 4;
r.rdata = address;
} else {
r.rdlength = rdlength;
r.rdata = rdata;
}
this.rr.push(r);
this.header.ancount++;
}
Response.prototype.send = function(callback) {
var buffer = this.toBuffer();
this.socket.send(buffer, 0, buffer.length, this.rinfo.port, this.rinfo.address, callback || function() {});
}
Response.prototype.toBuffer = function() {
//calculate len in octets
//NB not calculating rr this is done later
//headers(12) + qname(qname + 2 + 2)
//e.g. 16 + 2 * qname;
//qnames are Buffers so length is already in octs
var qnameLen = this.question.qname.length;
var len = 16 + qnameLen;
var buf = getZeroBuf(len);
this.header.id.copy(buf, 0, 0, 2);
buf[2] = 0x00 | this.header.qr << 7 | this.header.opcode << 3 | this.header.aa << 2 | this.header.tc << 1 | this.header.rd;
buf[3] = 0x00 | this.header.ra << 7 | this.header.z << 4 | this.header.rcode;
numToBuffer(buf, 4, this.header.qdcount, 2);
numToBuffer(buf, 6, this.header.ancount, 2);
numToBuffer(buf, 8, this.header.nscount, 2);
numToBuffer(buf, 10, this.header.arcount, 2);
//end header
this.question.qname.copy(buf, 12, 0, qnameLen);
this.question.qtype.copy(buf, 12+qnameLen, 0, 2);
this.question.qclass.copy(buf, 12+qnameLen+2, 0, 2);
var rrStart = 12+qnameLen+4;
for (var i = 0; i < this.rr.length; i++) {
//TODO figure out if this is actually cheaper than just iterating
//over the rr section up front and counting before creating buf
//
//create a new buffer to hold the request plus the rr
//len of each response is 14 bytes of stuff + qname len
var tmpBuf = getZeroBuf(buf.length + this.rr[i].qname.length + 14);
buf.copy(tmpBuf, 0, 0, buf.length);
this.rr[i].qname.copy(tmpBuf, rrStart, 0, this.rr[i].qname.length);
numToBuffer(tmpBuf, rrStart+this.rr[i].qname.length, this.rr[i].qtype, 2);
numToBuffer(tmpBuf, rrStart+this.rr[i].qname.length+2, this.rr[i].qclass, 2);
numToBuffer(tmpBuf, rrStart+this.rr[i].qname.length+4, this.rr[i].ttl, 4);
numToBuffer(tmpBuf, rrStart+this.rr[i].qname.length+8, this.rr[i].rdlength, 2);
numToBuffer(tmpBuf, rrStart+this.rr[i].qname.length+10, this.rr[i].rdata, this.rr[i].rdlength); // rdlength indicates rdata length
rrStart = rrStart + this.rr[i].qname.length + 14;
buf = tmpBuf;
}
//TODO compression
return buf;
}
function inet_aton(address) {
var parts = address.match(/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/);
return parts ? parts[1] * 16777216 + parts[2] * 65536 + parts[3] * 256 + parts[4] * 1 : false;
}
function domainToQname(domain) {
var tokens = domain.split(".");
var len = domain.length + 2;
var qname = new Buffer(len);
var offset = 0;
for (var i = 0; i < tokens.length; i++) {
qname[offset] = tokens[i].length;
offset++;
for (var j = 0; j < tokens[i].length; j++) {
qname[offset] = tokens[i].charCodeAt(j);
offset++;
}
}
qname[offset] = 0;
return qname;
}
function getZeroBuf(len) {
var buf = new Buffer(len);
for (var i = 0; i < buf.length; i++) buf[i] = 0;
return buf;
}
//take a number and make sure it's written to the buffer as
//the correct length of bytes with leading 0 padding where necessary
// takes buffer, offset, number, length in bytes to insert
function numToBuffer(buf, offset, num, len, debug) {
if (typeof num != 'number') {
throw new Error('Num must be a number');
}
for (var i = offset; i < offset + len; i++) {
var shift = 8*((len - 1) - (i - offset));
var insert = (num >> shift) & 255;
buf[i] = insert;
}
return buf;
}
function qnameToDomain(qname) {
var domain= '';
for (var i = 0; i < qname.length; i++) {
if (qname[i] == 0) {
//last char chop trailing .
domain = domain.substring(0, domain.length - 1);
break;
}
var tmpBuf = qname.slice(i+1, i+qname[i]+1);
domain += tmpBuf.toString('binary', 0, tmpBuf.length);
domain += '.';
i = i + qname[i];
}
return domain;
}
|
/**
* Kendo UI v2016.1.412 (http://www.telerik.com/kendo-ui)
* Copyright 2016 Telerik AD. All rights reserved.
*
* Kendo UI commercial licenses may be obtained at
* http://www.telerik.com/purchase/license-agreement/kendo-ui-complete
* If you do not own a commercial license, this file shall be governed by the trial license terms.
*/
!function(a){"function"==typeof define&&define.amd?define(["kendo.core.min"],a):a()}(function(){!function(a,e){kendo.cultures.haw={name:"haw",numberFormat:{pattern:["-n"],decimals:2,",":",",".":".",groupSize:[3],percent:{pattern:["-n %","n %"],decimals:2,",":",",".":".",groupSize:[3],symbol:"%"},currency:{name:"",abbr:"",pattern:["($n)","$n"],decimals:2,",":",",".":".",groupSize:[3],symbol:"$"}},calendars:{standard:{days:{names:["Lāpule","Pōʻakahi","Poʻalua","Poʻakolu","Poʻahā","Poʻalima","Poʻaono"],namesAbbr:["Lp","P1","P2","P3","P4","P5","P6"],namesShort:["Lp","P1","P2","P3","P4","P5","P6"]},months:{names:["Ianuali","Pepeluali","Malaki","ʻApelila","Mei","Iune","Iulai","ʻAukake","Kepakemapa","ʻOkakopa","Nowemapa","Kekemapa"],namesAbbr:["Ian","Pep","Mal","ʻAp","Mei","Iun","Iul","ʻAuk","Kep","ʻOk","Now","Kek"]},AM:["AM","am","AM"],PM:["PM","pm","PM"],patterns:{d:"M/d/yyyy",D:"dddd, MMMM dd, yyyy",F:"dddd, MMMM dd, yyyy h:mm:ss tt",g:"M/d/yyyy h:mm tt",G:"M/d/yyyy h:mm:ss tt",m:"d MMMM",M:"d MMMM",s:"yyyy'-'MM'-'dd'T'HH':'mm':'ss",t:"h:mm tt",T:"h:mm:ss tt",u:"yyyy'-'MM'-'dd HH':'mm':'ss'Z'",y:"MMMM, yyyy",Y:"MMMM, yyyy"},"/":"/",":":":",firstDay:0}}}}(this)});
//# sourceMappingURL=kendo.culture.haw.min.js.map
|
/*! X-editable - v1.5.3
* In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery
* http://github.com/vitalets/x-editable
* Copyright (c) 2020 Vitaliy Potapov; Licensed MIT */
/**
Form with single input element, two buttons and two states: normal/loading.
Applied as jQuery method to DIV tag (not to form tag!). This is because form can be in loading state when spinner shown.
Editableform is linked with one of input types, e.g. 'text', 'select' etc.
@class editableform
@uses text
@uses textarea
**/
(function ($) {
"use strict";
var EditableForm = function (div, options) {
this.options = $.extend({}, $.fn.editableform.defaults, options);
this.$div = $(div); //div, containing form. Not form tag. Not editable-element.
if(!this.options.scope) {
this.options.scope = this;
}
//nothing shown after init
};
EditableForm.prototype = {
constructor: EditableForm,
initInput: function() { //called once
//take input from options (as it is created in editable-element)
this.input = this.options.input;
//set initial value
//todo: may be add check: typeof str === 'string' ?
this.value = this.input.str2value(this.options.value);
//prerender: get input.$input
this.input.prerender();
},
initTemplate: function() {
this.$form = $($.fn.editableform.template);
},
initButtons: function() {
var $btn = this.$form.find('.editable-buttons');
$btn.append($.fn.editableform.buttons);
if(this.options.showbuttons === 'bottom') {
$btn.addClass('editable-buttons-bottom');
}
},
/**
Renders editableform
@method render
**/
render: function() {
//init loader
this.$loading = $($.fn.editableform.loading);
this.$div.empty().append(this.$loading);
//init form template and buttons
this.initTemplate();
if(this.options.showbuttons) {
this.initButtons();
} else {
this.$form.find('.editable-buttons').remove();
}
//show loading state
this.showLoading();
//flag showing is form now saving value to server.
//It is needed to wait when closing form.
this.isSaving = false;
/**
Fired when rendering starts
@event rendering
@param {Object} event event object
**/
this.$div.triggerHandler('rendering');
//init input
this.initInput();
//append input to form
this.$form.find('div.editable-input').append(this.input.$tpl);
//append form to container
this.$div.append(this.$form);
//render input
$.when(this.input.render())
.then($.proxy(function () {
//setup input to submit automatically when no buttons shown
if(!this.options.showbuttons) {
this.input.autosubmit();
}
//attach 'cancel' handler
this.$form.find('.editable-cancel').click($.proxy(this.cancel, this));
if(this.input.error) {
this.error(this.input.error);
this.$form.find('.editable-submit').attr('disabled', true);
this.input.$input.attr('disabled', true);
//prevent form from submitting
this.$form.submit(function(e){ e.preventDefault(); });
} else {
this.error(false);
this.input.$input.removeAttr('disabled');
this.$form.find('.editable-submit').removeAttr('disabled');
var value = (this.value === null || this.value === undefined || this.value === '') ? this.options.defaultValue : this.value;
this.input.value2input(value);
//attach submit handler
this.$form.submit($.proxy(this.submit, this));
}
/**
Fired when form is rendered
@event rendered
@param {Object} event event object
**/
this.$div.triggerHandler('rendered');
this.showForm();
//call postrender method to perform actions required visibility of form
if(this.input.postrender) {
this.input.postrender();
}
}, this));
},
cancel: function() {
/**
Fired when form was cancelled by user
@event cancel
@param {Object} event event object
**/
this.$div.triggerHandler('cancel');
},
showLoading: function() {
var w, h;
if(this.$form) {
//set loading size equal to form
w = this.$form.outerWidth();
h = this.$form.outerHeight();
if(w) {
this.$loading.width(w);
}
if(h) {
this.$loading.height(h);
}
this.$form.hide();
} else {
//stretch loading to fill container width
w = this.$loading.parent().width();
if(w) {
this.$loading.width(w);
}
}
this.$loading.show();
},
showForm: function(activate) {
this.$loading.hide();
this.$form.show();
if(activate !== false) {
this.input.activate();
}
/**
Fired when form is shown
@event show
@param {Object} event event object
**/
this.$div.triggerHandler('show');
},
error: function(msg) {
var $group = this.$form.find('.control-group'),
$block = this.$form.find('.editable-error-block'),
lines;
if(msg === false) {
$group.removeClass($.fn.editableform.errorGroupClass);
$block.removeClass($.fn.editableform.errorBlockClass).empty().hide();
} else {
//convert newline to <br> for more pretty error display
if(msg) {
lines = (''+msg).split('\n');
for (var i = 0; i < lines.length; i++) {
lines[i] = $('<div>').text(lines[i]).html();
}
msg = lines.join('<br>');
}
this.$form.find('.form-control').addClass('is-invalid');
$group.addClass($.fn.editableform.errorGroupClass);
$block.addClass($.fn.editableform.errorBlockClass).html(msg).show();
}
},
submit: function(e) {
e.stopPropagation();
e.preventDefault();
//get new value from input
var newValue = this.input.input2value();
//validation: if validate returns string or truthy value - means error
//if returns object like {newValue: '...'} => submitted value is reassigned to it
var error = this.validate(newValue);
if ($.type(error) === 'object' && error.newValue !== undefined) {
newValue = error.newValue;
this.input.value2input(newValue);
if(typeof error.msg === 'string') {
this.error(error.msg);
this.showForm();
return;
}
} else if (error) {
this.error(error);
this.showForm();
return;
}
//if value not changed --> trigger 'nochange' event and return
/*jslint eqeq: true*/
if (!this.options.savenochange && this.input.value2str(newValue) === this.input.value2str(this.value)) {
/*jslint eqeq: false*/
/**
Fired when value not changed but form is submitted. Requires savenochange = false.
@event nochange
@param {Object} event event object
**/
this.$div.triggerHandler('nochange');
return;
}
//convert value for submitting to server
var submitValue = this.input.value2submit(newValue);
this.isSaving = true;
//sending data to server
$.when(this.save(submitValue))
.done($.proxy(function(response) {
this.isSaving = false;
//run success callback
var res = typeof this.options.success === 'function' ? this.options.success.call(this.options.scope, response, newValue) : null;
//if success callback returns false --> keep form open and do not activate input
if(res === false) {
this.error(false);
this.showForm(false);
return;
}
//if success callback returns string --> keep form open, show error and activate input
if(typeof res === 'string') {
this.error(res);
this.showForm();
return;
}
//if success callback returns object like {newValue: <something>} --> use that value instead of submitted
//it is useful if you want to chnage value in url-function
if(res && typeof res === 'object' && res.hasOwnProperty('newValue')) {
newValue = res.newValue;
}
//clear error message
this.error(false);
this.value = newValue;
/**
Fired when form is submitted
@event save
@param {Object} event event object
@param {Object} params additional params
@param {mixed} params.newValue raw new value
@param {mixed} params.submitValue submitted value as string
@param {Object} params.response ajax response
@example
$('#form-div').on('save'), function(e, params){
if(params.newValue === 'username') {...}
});
**/
this.$div.triggerHandler('save', {newValue: newValue, submitValue: submitValue, response: response});
}, this))
.fail($.proxy(function(xhr) {
this.isSaving = false;
var msg;
if(typeof this.options.error === 'function') {
msg = this.options.error.call(this.options.scope, xhr, newValue);
} else {
msg = typeof xhr === 'string' ? xhr : xhr.responseText || xhr.statusText || 'Unknown error!';
}
this.error(msg);
this.showForm();
}, this));
},
save: function(submitValue) {
//try parse composite pk defined as json string in data-pk
this.options.pk = $.fn.editableutils.tryParseJson(this.options.pk, true);
var pk = (typeof this.options.pk === 'function') ? this.options.pk.call(this.options.scope) : this.options.pk,
/*
send on server in following cases:
1. url is function
2. url is string AND (pk defined OR send option = always)
*/
send = !!(typeof this.options.url === 'function' || (this.options.url && ((this.options.send === 'always') || (this.options.send === 'auto' && pk !== null && pk !== undefined)))),
params;
if (send) { //send to server
this.showLoading();
//standard params
params = {
name: this.options.name || '',
value: submitValue,
pk: pk
};
//additional params
if(typeof this.options.params === 'function') {
params = this.options.params.call(this.options.scope, params);
} else {
//try parse json in single quotes (from data-params attribute)
this.options.params = $.fn.editableutils.tryParseJson(this.options.params, true);
$.extend(params, this.options.params);
}
if(typeof this.options.url === 'function') { //user's function
return this.options.url.call(this.options.scope, params);
} else {
//send ajax to server and return deferred object
return $.ajax($.extend({
url : this.options.url,
data : params,
type : 'POST'
}, this.options.ajaxOptions));
}
}
},
validate: function (value) {
if (value === undefined) {
value = this.value;
}
if (typeof this.options.validate === 'function') {
return this.options.validate.call(this.options.scope, value);
}
},
option: function(key, value) {
if(key in this.options) {
this.options[key] = value;
}
if(key === 'value') {
this.setValue(value);
}
//do not pass option to input as it is passed in editable-element
},
setValue: function(value, convertStr) {
if(convertStr) {
this.value = this.input.str2value(value);
} else {
this.value = value;
}
//if form is visible, update input
if(this.$form && this.$form.is(':visible')) {
this.input.value2input(this.value);
}
}
};
/*
Initialize editableform. Applied to jQuery object.
@method $().editableform(options)
@params {Object} options
@example
var $form = $('<div>').editableform({
type: 'text',
name: 'username',
url: '/post',
value: 'vitaliy'
});
//to display form you should call 'render' method
$form.editableform('render');
*/
$.fn.editableform = function (option) {
var args = arguments;
return this.each(function () {
var $this = $(this),
data = $this.data('editableform'),
options = typeof option === 'object' && option;
if (!data) {
$this.data('editableform', (data = new EditableForm(this, options)));
}
if (typeof option === 'string') { //call method
data[option].apply(data, Array.prototype.slice.call(args, 1));
}
});
};
//keep link to constructor to allow inheritance
$.fn.editableform.Constructor = EditableForm;
//defaults
$.fn.editableform.defaults = {
/* see also defaults for input */
/**
Type of input. Can be <code>text|textarea|select|date|checklist</code>
@property type
@type string
@default 'text'
**/
type: 'text',
/**
Url for submit, e.g. <code>'/post'</code>
If function - it will be called instead of ajax. Function should return deferred object to run fail/done callbacks.
@property url
@type string|function
@default null
@example
url: function(params) {
var d = new $.Deferred;
if(params.value === 'abc') {
return d.reject('error message'); //returning error via deferred object
} else {
//async saving data in js model
someModel.asyncSaveMethod({
...,
success: function(){
d.resolve();
}
});
return d.promise();
}
}
**/
url:null,
/**
Additional params for submit. If defined as <code>object</code> - it is **appended** to original ajax data (pk, name and value).
If defined as <code>function</code> - returned object **overwrites** original ajax data.
@example
params: function(params) {
//originally params contain pk, name and value
params.a = 1;
return params;
}
@property params
@type object|function
@default null
**/
params:null,
/**
Name of field. Will be submitted on server. Can be taken from <code>id</code> attribute
@property name
@type string
@default null
**/
name: null,
/**
Primary key of editable object (e.g. record id in database). For composite keys use object, e.g. <code>{id: 1, lang: 'en'}</code>.
Can be calculated dynamically via function.
@property pk
@type string|object|function
@default null
**/
pk: null,
/**
Initial value. If not defined - will be taken from element's content.
For __select__ type should be defined (as it is ID of shown text).
@property value
@type string|object
@default null
**/
value: null,
/**
Value that will be displayed in input if original field value is empty (`null|undefined|''`).
@property defaultValue
@type string|object
@default null
@since 1.4.6
**/
defaultValue: null,
/**
Strategy for sending data on server. Can be `auto|always|never`.
When 'auto' data will be sent on server **only if pk and url defined**, otherwise new value will be stored locally.
@property send
@type string
@default 'auto'
**/
send: 'auto',
/**
Function for client-side validation. If returns string - means validation not passed and string showed as error.
Since 1.5.1 you can modify submitted value by returning object from `validate`:
`{newValue: '...'}` or `{newValue: '...', msg: '...'}`
@property validate
@type function
@default null
@example
validate: function(value) {
if($.trim(value) == '') {
return 'This field is required';
}
}
**/
validate: null,
/**
Success callback. Called when value successfully sent on server and **response status = 200**.
Usefull to work with json response. For example, if your backend response can be <code>{success: true}</code>
or `{success: false, msg: "server error"}` you can check it inside this callback.
If it returns **string** - means error occured and string is shown as error message.
If it returns **object like** `{newValue: <something>}` - it overwrites value, submitted by user
(useful when server changes value).
Otherwise newValue simply rendered into element.
@property success
@type function
@default null
@example
success: function(response, newValue) {
if(!response.success) return response.msg;
}
**/
success: null,
/**
Error callback. Called when request failed (response status != 200).
Usefull when you want to parse error response and display a custom message.
Must return **string** - the message to be displayed in the error block.
@property error
@type function
@default null
@since 1.4.4
@example
error: function(response, newValue) {
if(response.status === 500) {
return 'Service unavailable. Please try later.';
} else {
return response.responseText;
}
}
**/
error: null,
/**
Additional options for submit ajax request.
List of values: http://api.jquery.com/jQuery.ajax
@property ajaxOptions
@type object
@default null
@since 1.1.1
@example
ajaxOptions: {
type: 'put',
dataType: 'json'
}
**/
ajaxOptions: null,
/**
Where to show buttons: left(true)|bottom|false
Form without buttons is auto-submitted.
@property showbuttons
@type boolean|string
@default true
@since 1.1.1
**/
showbuttons: true,
/**
Scope for callback methods (success, validate).
If <code>null</code> means editableform instance itself.
@property scope
@type DOMElement|object
@default null
@since 1.2.0
@private
**/
scope: null,
/**
Whether to save or cancel value when it was not changed but form was submitted
@property savenochange
@type boolean
@default false
@since 1.2.0
**/
savenochange: false
};
/*
Note: following params could redefined in engine: bootstrap or jqueryui:
Classes 'control-group' and 'editable-error-block' must always present!
*/
$.fn.editableform.template = '<form class="form-inline editableform">'+
'<div class="control-group">' +
'<div><div class="editable-input"></div><div class="editable-buttons"></div></div>'+
'<div class="editable-error-block invalid-feedback"></div>' +
'</div>' +
'</form>';
//loading div
$.fn.editableform.loading = '<div class="editableform-loading"></div>';
//buttons
$.fn.editableform.buttons = '<button type="submit" class="editable-submit">ok</button>'+
'<button type="button" class="editable-cancel">cancel</button>';
//error class attached to control-group
$.fn.editableform.errorGroupClass = null;
//error class attached to editable-error-block
$.fn.editableform.errorBlockClass = 'editable-error';
//engine
$.fn.editableform.engine = 'jquery';
}(window.jQuery));
/**
* EditableForm utilites
*/
(function ($) {
"use strict";
//utils
$.fn.editableutils = {
/**
* classic JS inheritance function
*/
inherit: function (Child, Parent) {
var F = function() { };
F.prototype = Parent.prototype;
Child.prototype = new F();
Child.prototype.constructor = Child;
Child.superclass = Parent.prototype;
},
/**
* set caret position in input
* see http://stackoverflow.com/questions/499126/jquery-set-cursor-position-in-text-area
*/
setCursorPosition: function(elem, pos) {
if (elem.setSelectionRange) {
try { elem.setSelectionRange(pos, pos); } catch (e) {}
} else if (elem.createTextRange) {
var range = elem.createTextRange();
range.collapse(true);
range.moveEnd('character', pos);
range.moveStart('character', pos);
range.select();
}
},
/**
* function to parse JSON in *single* quotes. (jquery automatically parse only double quotes)
* That allows such code as: <a data-source="{'a': 'b', 'c': 'd'}">
* safe = true --> means no exception will be thrown
* for details see http://stackoverflow.com/questions/7410348/how-to-set-json-format-to-html5-data-attributes-in-the-jquery
*/
tryParseJson: function(s, safe) {
if (typeof s === 'string' && s.length && s.match(/^[\{\[].*[\}\]]$/)) {
if (safe) {
try {
/*jslint evil: true*/
s = (new Function('return ' + s))();
/*jslint evil: false*/
} catch (e) {} finally {
return s;
}
} else {
/*jslint evil: true*/
s = (new Function('return ' + s))();
/*jslint evil: false*/
}
}
return s;
},
/**
* slice object by specified keys
*/
sliceObj: function(obj, keys, caseSensitive /* default: false */) {
var key, keyLower, newObj = {};
if (!$.isArray(keys) || !keys.length) {
return newObj;
}
for (var i = 0; i < keys.length; i++) {
key = keys[i];
if (obj.hasOwnProperty(key)) {
newObj[key] = obj[key];
}
if(caseSensitive === true) {
continue;
}
//when getting data-* attributes via $.data() it's converted to lowercase.
//details: http://stackoverflow.com/questions/7602565/using-data-attributes-with-jquery
//workaround is code below.
keyLower = key.toLowerCase();
if (obj.hasOwnProperty(keyLower)) {
newObj[key] = obj[keyLower];
}
}
return newObj;
},
/*
exclude complex objects from $.data() before pass to config
*/
getConfigData: function($element) {
var data = {};
$.each($element[0].dataset, function(k, v) {
if(typeof v !== 'object' || (v && typeof v === 'object' && (v.constructor === Object || v.constructor === Array))) {
data[k] = v;
}
});
return data;
},
/*
returns keys of object
*/
objectKeys: function(o) {
if (Object.keys) {
return Object.keys(o);
} else {
if (o !== Object(o)) {
throw new TypeError('Object.keys called on a non-object');
}
var k=[], p;
for (p in o) {
if (Object.prototype.hasOwnProperty.call(o,p)) {
k.push(p);
}
}
return k;
}
},
/**
method to escape html.
**/
escape: function(str) {
return $('<div>').text(str).html();
},
/*
returns array items from sourceData having value property equal or inArray of 'value'
*/
itemsByValue: function(value, sourceData, valueProp) {
if(!sourceData || value === null) {
return [];
}
if (typeof(valueProp) !== "function") {
var idKey = valueProp || 'value';
valueProp = function (e) { return e[idKey]; };
}
var isValArray = $.isArray(value),
result = [],
that = this;
$.each(sourceData, function(i, o) {
if(o.children) {
result = result.concat(that.itemsByValue(value, o.children, valueProp));
} else {
/*jslint eqeq: true*/
if(isValArray) {
if($.grep(value, function(v){ return v == (o && typeof o === 'object' ? valueProp(o) : o); }).length) {
result.push(o);
}
} else {
var itemValue = (o && (typeof o === 'object')) ? valueProp(o) : o;
if(value == itemValue) {
result.push(o);
}
}
/*jslint eqeq: false*/
}
});
return result;
},
/*
Returns input by options: type, mode.
*/
createInput: function(options) {
var TypeConstructor, typeOptions, input,
type = options.type;
//`date` is some kind of virtual type that is transformed to one of exact types
//depending on mode and core lib
if(type === 'date') {
//inline
if(options.mode === 'inline') {
if($.fn.editabletypes.datefield) {
type = 'datefield';
} else if($.fn.editabletypes.dateuifield) {
type = 'dateuifield';
}
//popup
} else {
if($.fn.editabletypes.date) {
type = 'date';
} else if($.fn.editabletypes.dateui) {
type = 'dateui';
}
}
//if type still `date` and not exist in types, replace with `combodate` that is base input
if(type === 'date' && !$.fn.editabletypes.date) {
type = 'combodate';
}
}
//`datetime` should be datetimefield in 'inline' mode
if(type === 'datetime' && options.mode === 'inline') {
type = 'datetimefield';
}
//change wysihtml5 to textarea for jquery UI and plain versions
if(type === 'wysihtml5' && !$.fn.editabletypes[type]) {
type = 'textarea';
}
//create input of specified type. Input will be used for converting value, not in form
if(typeof $.fn.editabletypes[type] === 'function') {
TypeConstructor = $.fn.editabletypes[type];
typeOptions = this.sliceObj(options, this.objectKeys(TypeConstructor.defaults));
input = new TypeConstructor(typeOptions);
return input;
} else {
$.error('Unknown type: '+ type);
return false;
}
},
//see http://stackoverflow.com/questions/7264899/detect-css-transitions-using-javascript-and-without-modernizr
supportsTransitions: function () {
var b = document.body || document.documentElement,
s = b.style,
p = 'transition',
v = ['Moz', 'Webkit', 'Khtml', 'O', 'ms'];
if(typeof s[p] === 'string') {
return true;
}
// Tests for vendor specific prop
p = p.charAt(0).toUpperCase() + p.substr(1);
for(var i=0; i<v.length; i++) {
if(typeof s[v[i] + p] === 'string') {
return true;
}
}
return false;
}
};
}(window.jQuery));
/**
Attaches stand-alone container with editable-form to HTML element. Element is used only for positioning, value is not stored anywhere.<br>
This method applied internally in <code>$().editable()</code>. You should subscribe on it's events (save / cancel) to get profit of it.<br>
Final realization can be different: bootstrap-popover, jqueryui-tooltip, poshytip, inline-div. It depends on which js file you include.<br>
Applied as jQuery method.
@class editableContainer
@uses editableform
**/
(function ($) {
"use strict";
var Popup = function (element, options) {
this.init(element, options);
};
var Inline = function (element, options) {
this.init(element, options);
};
//methods
Popup.prototype = {
containerName: null, //method to call container on element
containerDataName: null, //object name in element's .data()
innerCss: null, //tbd in child class
containerClass: 'editable-container editable-popup', //css class applied to container element
defaults: {}, //container itself defaults
init: function(element, options) {
this.$element = $(element);
//since 1.4.1 container do not use data-* directly as they already merged into options.
this.options = $.extend({}, $.fn.editableContainer.defaults, options);
this.splitOptions();
//set scope of form callbacks to element
this.formOptions.scope = this.$element[0];
this.initContainer();
//flag to hide container, when saving value will finish
this.delayedHide = false;
//bind 'destroyed' listener to destroy container when element is removed from dom
this.$element.on('destroyed', $.proxy(function(){
this.destroy();
}, this));
//attach document handler to close containers on click / escape
if(!$(document).data('editable-handlers-attached')) {
//close all on escape
$(document).on('keyup.editable', function (e) {
if (e.which === 27) {
$('.editable-open').editableContainer('hide', 'cancel');
//todo: return focus on element
}
});
//close containers when click outside
//(mousedown could be better than click, it closes everything also on drag drop)
$(document).on('click.editable', function(e) {
var $target = $(e.target), i,
exclude_classes = ['.editable-container',
'.ui-datepicker-header',
'.datepicker', //in inline mode datepicker is rendered into body
'.modal-backdrop',
'.bootstrap-wysihtml5-insert-image-modal',
'.bootstrap-wysihtml5-insert-link-modal'
];
// select2 has extra body click in IE
// see: https://github.com/ivaynberg/select2/issues/1058
if ($('.select2-drop-mask').is(':visible')) {
return;
}
//check if element is detached. It occurs when clicking in bootstrap datepicker
if (!$.contains(document.documentElement, e.target)) {
return;
}
//for some reason FF 20 generates extra event (click) in select2 widget with e.target = document
//we need to filter it via construction below. See https://github.com/vitalets/x-editable/issues/199
//Possibly related to http://stackoverflow.com/questions/10119793/why-does-firefox-react-differently-from-webkit-and-ie-to-click-event-on-selec
if($target.is(document)) {
return;
}
//if click inside one of exclude classes --> no nothing
for(i=0; i<exclude_classes.length; i++) {
if($target.is(exclude_classes[i]) || $target.parents(exclude_classes[i]).length) {
return;
}
}
//close all open containers (except one - target)
Popup.prototype.closeOthers(e.target);
});
$(document).data('editable-handlers-attached', true);
}
},
//split options on containerOptions and formOptions
splitOptions: function() {
this.containerOptions = {};
this.formOptions = {};
if(!$.fn[this.containerName]) {
throw new Error(this.containerName + ' not found. Have you included corresponding js file?');
}
//keys defined in container defaults go to container, others go to form
for(var k in this.options) {
if(k in this.defaults) {
this.containerOptions[k] = this.options[k];
} else {
this.formOptions[k] = this.options[k];
}
}
},
/*
Returns jquery object of container
@method tip()
*/
tip: function() {
return this.container() ? this.container().$tip : null;
},
/* returns container object */
container: function() {
var container;
//first, try get it by `containerDataName`
if(this.containerDataName) {
if(container = this.$element.data(this.containerDataName)) {
return container;
}
}
//second, try `containerName`
container = this.$element.data(this.containerName);
return container;
},
/* call native method of underlying container, e.g. this.$element.popover('method') */
call: function() {
this.$element[this.containerName].apply(this.$element, arguments);
},
initContainer: function(){
this.call(this.containerOptions);
},
renderForm: function() {
this.$form
.editableform(this.formOptions)
.on({
save: $.proxy(this.save, this), //click on submit button (value changed)
nochange: $.proxy(function(){ this.hide('nochange'); }, this), //click on submit button (value NOT changed)
cancel: $.proxy(function(){ this.hide('cancel'); }, this), //click on cancel button
show: $.proxy(function() {
if(this.delayedHide) {
this.hide(this.delayedHide.reason);
this.delayedHide = false;
} else {
this.setPosition();
}
}, this), //re-position container every time form is shown (occurs each time after loading state)
rendering: $.proxy(this.setPosition, this), //this allows to place container correctly when loading shown
resize: $.proxy(this.setPosition, this), //this allows to re-position container when form size is changed
rendered: $.proxy(function(){
/**
Fired when container is shown and form is rendered (for select will wait for loading dropdown options).
**Note:** Bootstrap popover has own `shown` event that now cannot be separated from x-editable's one.
The workaround is to check `arguments.length` that is always `2` for x-editable.
@event shown
@param {Object} event event object
@example
$('#username').on('shown', function(e, editable) {
editable.input.$input.val('overwriting value of input..');
});
**/
/*
TODO: added second param mainly to distinguish from bootstrap's shown event. It's a hotfix that will be solved in future versions via namespaced events.
*/
this.$element.triggerHandler('shown', $(this.options.scope).data('editable'));
}, this)
})
.editableform('render');
},
/**
Shows container with form
@method show()
@param {boolean} closeAll Whether to close all other editable containers when showing this one. Default true.
**/
/* Note: poshytip owerwrites this method totally! */
show: function (closeAll) {
this.$element.addClass('editable-open');
if(closeAll !== false) {
//close all open containers (except this)
this.closeOthers(this.$element[0]);
}
//show container itself
this.innerShow();
this.tip().addClass(this.containerClass);
/*
Currently, form is re-rendered on every show.
The main reason is that we dont know, what will container do with content when closed:
remove(), detach() or just hide() - it depends on container.
Detaching form itself before hide and re-insert before show is good solution,
but visually it looks ugly --> container changes size before hide.
*/
//if form already exist - delete previous data
if(this.$form) {
//todo: destroy prev data!
//this.$form.destroy();
}
this.$form = $('<div>');
//insert form into container body
if(this.tip().is(this.innerCss)) {
//for inline container
this.tip().append(this.$form);
} else {
this.tip().find(this.innerCss).append(this.$form);
}
//render form
this.renderForm();
},
/**
Hides container with form
@method hide()
@param {string} reason Reason caused hiding. Can be <code>save|cancel|onblur|nochange|undefined (=manual)</code>
**/
hide: function(reason) {
if(!this.tip() || !this.tip().is(':visible') || !this.$element.hasClass('editable-open')) {
return;
}
//if form is saving value, schedule hide
if(this.$form.data('editableform').isSaving) {
this.delayedHide = {reason: reason};
return;
} else {
this.delayedHide = false;
}
this.$element.removeClass('editable-open');
this.innerHide();
/**
Fired when container was hidden. It occurs on both save or cancel.
**Note:** Bootstrap popover has own `hidden` event that now cannot be separated from x-editable's one.
The workaround is to check `arguments.length` that is always `2` for x-editable.
@event hidden
@param {object} event event object
@param {string} reason Reason caused hiding. Can be <code>save|cancel|onblur|nochange|manual</code>
@example
$('#username').on('hidden', function(e, reason) {
if(reason === 'save' || reason === 'cancel') {
//auto-open next editable
$(this).closest('tr').next().find('.editable').editable('show');
}
});
**/
this.$element.triggerHandler('hidden', reason || 'manual');
},
/* internal show method. To be overwritten in child classes */
innerShow: function () {
},
/* internal hide method. To be overwritten in child classes */
innerHide: function () {
},
/**
Toggles container visibility (show / hide)
@method toggle()
@param {boolean} closeAll Whether to close all other editable containers when showing this one. Default true.
**/
toggle: function(closeAll) {
if(this.container() && this.tip() && this.tip().is(':visible')) {
this.hide();
} else {
this.show(closeAll);
}
},
/*
Updates the position of container when content changed.
@method setPosition()
*/
setPosition: function() {
//tbd in child class
},
save: function(e, params) {
/**
Fired when new value was submitted. You can use <code>$(this).data('editableContainer')</code> inside handler to access to editableContainer instance
@event save
@param {Object} event event object
@param {Object} params additional params
@param {mixed} params.newValue submitted value
@param {Object} params.response ajax response
@example
$('#username').on('save', function(e, params) {
//assuming server response: '{success: true}'
var pk = $(this).data('editableContainer').options.pk;
if(params.response && params.response.success) {
alert('value: ' + params.newValue + ' with pk: ' + pk + ' saved!');
} else {
alert('error!');
}
});
**/
this.$element.triggerHandler('save', params);
//hide must be after trigger, as saving value may require methods of plugin, applied to input
this.hide('save');
},
/**
Sets new option
@method option(key, value)
@param {string} key
@param {mixed} value
**/
option: function(key, value) {
this.options[key] = value;
if(key in this.containerOptions) {
this.containerOptions[key] = value;
this.setContainerOption(key, value);
} else {
this.formOptions[key] = value;
if(this.$form) {
this.$form.editableform('option', key, value);
}
}
},
setContainerOption: function(key, value) {
this.call('option', key, value);
},
/**
Destroys the container instance
@method destroy()
**/
destroy: function() {
this.hide();
this.innerDestroy();
this.$element.off('destroyed');
this.$element.removeData('editableContainer');
},
/* to be overwritten in child classes */
innerDestroy: function() {
},
/*
Closes other containers except one related to passed element.
Other containers can be cancelled or submitted (depends on onblur option)
*/
closeOthers: function(element) {
$('.editable-open').each(function(i, el){
//do nothing with passed element and it's children
if(el === element || $(el).find(element).length) {
return;
}
//otherwise cancel or submit all open containers
var $el = $(el),
ec = $el.data('editableContainer');
if(!ec) {
return;
}
if(ec.options.onblur === 'cancel') {
$el.data('editableContainer').hide('onblur');
} else if(ec.options.onblur === 'submit') {
$el.data('editableContainer').tip().find('form').submit();
}
});
},
/**
Activates input of visible container (e.g. set focus)
@method activate()
**/
activate: function() {
if(this.tip && this.tip().is(':visible') && this.$form) {
this.$form.data('editableform').input.activate();
}
}
};
/**
jQuery method to initialize editableContainer.
@method $().editableContainer(options)
@params {Object} options
@example
$('#edit').editableContainer({
type: 'text',
url: '/post',
pk: 1,
value: 'hello'
});
**/
$.fn.editableContainer = function (option) {
var args = arguments;
return this.each(function () {
var $this = $(this),
dataKey = 'editableContainer',
data = $this.data(dataKey),
options = typeof option === 'object' && option,
Constructor = (options.mode === 'inline') ? Inline : Popup;
if (!data) {
$this.data(dataKey, (data = new Constructor(this, options)));
}
if (typeof option === 'string') { //call method
data[option].apply(data, Array.prototype.slice.call(args, 1));
}
});
};
//store constructors
$.fn.editableContainer.Popup = Popup;
$.fn.editableContainer.Inline = Inline;
//defaults
$.fn.editableContainer.defaults = {
/**
Initial value of form input
@property value
@type mixed
@default null
@private
**/
value: null,
/**
Placement of container relative to element. Can be <code>top|right|bottom|left</code>. Not used for inline container.
@property placement
@type string
@default 'top'
**/
placement: 'top',
/**
Whether to hide container on save/cancel.
@property autohide
@type boolean
@default true
@private
**/
autohide: true,
/**
Action when user clicks outside the container. Can be <code>cancel|submit|ignore</code>.
Setting <code>ignore</code> allows to have several containers open.
@property onblur
@type string
@default 'cancel'
@since 1.1.1
**/
onblur: 'cancel',
/**
Animation speed (inline mode only)
@property anim
@type string
@default false
**/
anim: false,
/**
Mode of editable, can be `popup` or `inline`
@property mode
@type string
@default 'popup'
@since 1.4.0
**/
mode: 'popup'
};
/*
* workaround to have 'destroyed' event to destroy popover when element is destroyed
* see http://stackoverflow.com/questions/2200494/jquery-trigger-event-when-an-element-is-removed-from-the-dom
*/
jQuery.event.special.destroyed = {
remove: function(o) {
if (o.handler) {
o.handler();
}
}
};
}(window.jQuery));
/**
* Editable Inline
* ---------------------
*/
(function ($) {
"use strict";
//copy prototype from EditableContainer
//extend methods
$.extend($.fn.editableContainer.Inline.prototype, $.fn.editableContainer.Popup.prototype, {
containerName: 'editableform',
innerCss: '.editable-inline',
containerClass: 'editable-container editable-inline', //css class applied to container element
initContainer: function(){
//container is <span> element
this.$tip = $('<span></span>');
//convert anim to miliseconds (int)
if(!this.options.anim) {
this.options.anim = 0;
}
},
splitOptions: function() {
//all options are passed to form
this.containerOptions = {};
this.formOptions = this.options;
},
tip: function() {
return this.$tip;
},
innerShow: function () {
this.$element.hide();
this.tip().insertAfter(this.$element).show();
},
innerHide: function () {
this.$tip.hide(this.options.anim, $.proxy(function() {
this.$element.show();
this.innerDestroy();
}, this));
},
innerDestroy: function() {
if(this.tip()) {
this.tip().empty().remove();
}
}
});
}(window.jQuery));
/**
Makes editable any HTML element on the page. Applied as jQuery method.
@class editable
@uses editableContainer
**/
(function ($) {
"use strict";
var Editable = function (element, options) {
this.$element = $(element);
//data-* has more priority over js options: because dynamically created elements may change data-*
this.options = $.extend({}, $.fn.editable.defaults, options, $.fn.editableutils.getConfigData(this.$element));
if(this.options.selector) {
this.initLive();
} else {
this.init();
}
//check for transition support
if(this.options.highlight && !$.fn.editableutils.supportsTransitions()) {
this.options.highlight = false;
}
};
Editable.prototype = {
constructor: Editable,
init: function () {
var isValueByText = false,
doAutotext, finalize;
//name
this.options.name = this.options.name || this.$element.attr('id');
//create input of specified type. Input needed already here to convert value for initial display (e.g. show text by id for select)
//also we set scope option to have access to element inside input specific callbacks (e. g. source as function)
this.options.scope = this.$element[0];
this.input = $.fn.editableutils.createInput(this.options);
if(!this.input) {
return;
}
//set value from settings or by element's text
if (this.options.value === undefined || this.options.value === null) {
this.value = this.input.html2value($.trim(this.$element.html()));
isValueByText = true;
} else {
/*
value can be string when received from 'data-value' attribute
for complext objects value can be set as json string in data-value attribute,
e.g. data-value="{city: 'Moscow', street: 'Lenina'}"
*/
this.options.value = $.fn.editableutils.tryParseJson(this.options.value, true);
if(typeof this.options.value === 'string') {
this.value = this.input.str2value(this.options.value);
} else {
this.value = this.options.value;
}
}
//add 'editable' class to every editable element
this.$element.addClass('editable');
//specifically for "textarea" add class .editable-pre-wrapped to keep linebreaks
if(this.input.type === 'textarea') {
this.$element.addClass('editable-pre-wrapped');
}
//attach handler activating editable. In disabled mode it just prevent default action (useful for links)
if(this.options.toggle !== 'manual') {
this.$element.addClass('editable-click');
this.$element.on(this.options.toggle + '.editable', $.proxy(function(e){
//prevent following link if editable enabled
if(!this.options.disabled) {
e.preventDefault();
}
//stop propagation not required because in document click handler it checks event target
//e.stopPropagation();
if(this.options.toggle === 'mouseenter') {
//for hover only show container
this.show();
} else {
//when toggle='click' we should not close all other containers as they will be closed automatically in document click listener
var closeAll = (this.options.toggle !== 'click');
this.toggle(closeAll);
}
}, this));
} else {
this.$element.attr('tabindex', -1); //do not stop focus on element when toggled manually
}
//if display is function it's far more convinient to have autotext = always to render correctly on init
//see https://github.com/vitalets/x-editable-yii/issues/34
if(typeof this.options.display === 'function') {
this.options.autotext = 'always';
}
//check conditions for autotext:
switch(this.options.autotext) {
case 'always':
doAutotext = true;
break;
case 'auto':
//if element text is empty and value is defined and value not generated by text --> run autotext
doAutotext = !$.trim(this.$element.text()).length && this.value !== null && this.value !== undefined && !isValueByText;
break;
default:
doAutotext = false;
}
//depending on autotext run render() or just finilize init
$.when(doAutotext ? this.render() : true).then($.proxy(function() {
if(this.options.disabled) {
this.disable();
} else {
this.enable();
}
/**
Fired when element was initialized by `$().editable()` method.
Please note that you should setup `init` handler **before** applying `editable`.
@event init
@param {Object} event event object
@param {Object} editable editable instance (as here it cannot accessed via data('editable'))
@since 1.2.0
@example
$('#username').on('init', function(e, editable) {
alert('initialized ' + editable.options.name);
});
$('#username').editable();
**/
this.$element.triggerHandler('init', this);
}, this));
},
/*
Initializes parent element for live editables
*/
initLive: function() {
//store selector
var selector = this.options.selector;
//modify options for child elements
this.options.selector = false;
this.options.autotext = 'never';
//listen toggle events
this.$element.on(this.options.toggle + '.editable', selector, $.proxy(function(e){
var $target = $(e.target).closest(selector);
if(!$target.data('editable')) {
//if delegated element initially empty, we need to clear it's text (that was manually set to `empty` by user)
//see https://github.com/vitalets/x-editable/issues/137
if($target.hasClass(this.options.emptyclass)) {
$target.empty();
}
$target.editable(this.options).trigger(e);
}
}, this));
},
/*
Renders value into element's text.
Can call custom display method from options.
Can return deferred object.
@method render()
@param {mixed} response server response (if exist) to pass into display function
*/
render: function(response) {
//do not display anything
if(this.options.display === false) {
return;
}
//if input has `value2htmlFinal` method, we pass callback in third param to be called when source is loaded
if(this.input.value2htmlFinal) {
return this.input.value2html(this.value, this.$element[0], this.options.display, response);
//if display method defined --> use it
} else if(typeof this.options.display === 'function') {
return this.options.display.call(this.$element[0], this.value, response);
//else use input's original value2html() method
} else {
return this.input.value2html(this.value, this.$element[0]);
}
},
/**
Enables editable
@method enable()
**/
enable: function() {
this.options.disabled = false;
this.$element.removeClass('editable-disabled');
this.handleEmpty(this.isEmpty);
if(this.options.toggle !== 'manual') {
if(this.$element.attr('tabindex') === '-1') {
this.$element.removeAttr('tabindex');
}
}
},
/**
Disables editable
@method disable()
**/
disable: function() {
this.options.disabled = true;
this.hide();
this.$element.addClass('editable-disabled');
this.handleEmpty(this.isEmpty);
//do not stop focus on this element
this.$element.attr('tabindex', -1);
},
/**
Toggles enabled / disabled state of editable element
@method toggleDisabled()
**/
toggleDisabled: function() {
if(this.options.disabled) {
this.enable();
} else {
this.disable();
}
},
/**
Sets new option
@method option(key, value)
@param {string|object} key option name or object with several options
@param {mixed} value option new value
@example
$('.editable').editable('option', 'pk', 2);
**/
option: function(key, value) {
//set option(s) by object
if(key && typeof key === 'object') {
$.each(key, $.proxy(function(k, v){
this.option($.trim(k), v);
}, this));
return;
}
//set option by string
this.options[key] = value;
//disabled
if(key === 'disabled') {
return value ? this.disable() : this.enable();
}
//value
if(key === 'value') {
this.setValue(value);
}
//transfer new option to container!
if(this.container) {
this.container.option(key, value);
}
//pass option to input directly (as it points to the same in form)
if(this.input.option) {
this.input.option(key, value);
}
},
/*
* set emptytext if element is empty
*/
handleEmpty: function (isEmpty) {
//do not handle empty if we do not display anything
if(this.options.display === false) {
return;
}
/*
isEmpty may be set directly as param of method.
It is required when we enable/disable field and can't rely on content
as node content is text: "Empty" that is not empty %)
*/
if(isEmpty !== undefined) {
this.isEmpty = isEmpty;
} else {
//detect empty
//for some inputs we need more smart check
//e.g. wysihtml5 may have <br>, <p></p>, <img>
if(typeof(this.input.isEmpty) === 'function') {
this.isEmpty = this.input.isEmpty(this.$element);
} else {
this.isEmpty = $.trim(this.$element.html()) === '';
}
}
//emptytext shown only for enabled
if(!this.options.disabled) {
if (this.isEmpty) {
this.$element.html(this.options.emptytext);
if(this.options.emptyclass) {
this.$element.addClass(this.options.emptyclass);
}
} else if(this.options.emptyclass) {
this.$element.removeClass(this.options.emptyclass);
}
} else {
//below required if element disable property was changed
if(this.isEmpty) {
this.$element.empty();
if(this.options.emptyclass) {
this.$element.removeClass(this.options.emptyclass);
}
}
}
},
/**
Shows container with form
@method show()
@param {boolean} closeAll Whether to close all other editable containers when showing this one. Default true.
**/
show: function (closeAll) {
if(this.options.disabled) {
return;
}
//init editableContainer: popover, tooltip, inline, etc..
if(!this.container) {
var containerOptions = $.extend({}, this.options, {
value: this.value,
input: this.input //pass input to form (as it is already created)
});
this.$element.editableContainer(containerOptions);
//listen `save` event
this.$element.on("save.internal", $.proxy(this.save, this));
this.container = this.$element.data('editableContainer');
} else if(this.container.tip().is(':visible')) {
return;
}
//show container
this.container.show(closeAll);
},
/**
Hides container with form
@method hide()
**/
hide: function () {
if(this.container) {
this.container.hide();
}
},
/**
Toggles container visibility (show / hide)
@method toggle()
@param {boolean} closeAll Whether to close all other editable containers when showing this one. Default true.
**/
toggle: function(closeAll) {
if(this.container && this.container.tip().is(':visible')) {
this.hide();
} else {
this.show(closeAll);
}
},
/*
* called when form was submitted
*/
save: function(e, params) {
//mark element with unsaved class if needed
if(this.options.unsavedclass) {
/*
Add unsaved css to element if:
- url is not user's function
- value was not sent to server
- params.response === undefined, that means data was not sent
- value changed
*/
var sent = false;
sent = sent || typeof this.options.url === 'function';
sent = sent || this.options.display === false;
sent = sent || params.response !== undefined;
sent = sent || (this.options.savenochange && this.input.value2str(this.value) !== this.input.value2str(params.newValue));
if(sent) {
this.$element.removeClass(this.options.unsavedclass);
} else {
this.$element.addClass(this.options.unsavedclass);
}
}
//highlight when saving
if(this.options.highlight) {
var $e = this.$element,
bgColor = $e.css('background-color');
$e.css('background-color', this.options.highlight);
setTimeout(function(){
if(bgColor === 'transparent') {
bgColor = '';
}
$e.css('background-color', bgColor);
$e.addClass('editable-bg-transition');
setTimeout(function(){
$e.removeClass('editable-bg-transition');
}, 1700);
}, 10);
}
//set new value
this.setValue(params.newValue, false, params.response);
/**
Fired when new value was submitted. You can use <code>$(this).data('editable')</code> to access to editable instance
@event save
@param {Object} event event object
@param {Object} params additional params
@param {mixed} params.newValue submitted value
@param {Object} params.response ajax response
@example
$('#username').on('save', function(e, params) {
alert('Saved value: ' + params.newValue);
});
**/
//event itself is triggered by editableContainer. Description here is only for documentation
},
validate: function () {
if (typeof this.options.validate === 'function') {
return this.options.validate.call(this, this.value);
}
},
/**
Sets new value of editable
@method setValue(value, convertStr)
@param {mixed} value new value
@param {boolean} convertStr whether to convert value from string to internal format
**/
setValue: function(value, convertStr, response) {
if(convertStr) {
this.value = this.input.str2value(value);
} else {
this.value = value;
}
if(this.container) {
this.container.option('value', this.value);
}
$.when(this.render(response))
.then($.proxy(function() {
this.handleEmpty();
}, this));
},
/**
Activates input of visible container (e.g. set focus)
@method activate()
**/
activate: function() {
if(this.container) {
this.container.activate();
}
},
/**
Removes editable feature from element
@method destroy()
**/
destroy: function() {
this.disable();
if(this.container) {
this.container.destroy();
}
this.input.destroy();
if(this.options.toggle !== 'manual') {
this.$element.removeClass('editable-click');
this.$element.off(this.options.toggle + '.editable');
}
this.$element.off("save.internal");
this.$element.removeClass('editable editable-open editable-disabled');
this.$element.removeData('editable');
}
};
/* EDITABLE PLUGIN DEFINITION
* ======================= */
/**
jQuery method to initialize editable element.
@method $().editable(options)
@params {Object} options
@example
$('#username').editable({
type: 'text',
url: '/post',
pk: 1
});
**/
$.fn.editable = function (option) {
//special API methods returning non-jquery object
var result = {}, args = arguments, datakey = 'editable';
switch (option) {
/**
Runs client-side validation for all matched editables
@method validate()
@returns {Object} validation errors map
@example
$('#username, #fullname').editable('validate');
// possible result:
{
username: "username is required",
fullname: "fullname should be minimum 3 letters length"
}
**/
case 'validate':
this.each(function () {
var $this = $(this), data = $this.data(datakey), error;
if (data && (error = data.validate())) {
result[data.options.name] = error;
}
});
return result;
/**
Returns current values of editable elements.
Note that it returns an **object** with name-value pairs, not a value itself. It allows to get data from several elements.
If value of some editable is `null` or `undefined` it is excluded from result object.
When param `isSingle` is set to **true** - it is supposed you have single element and will return value of editable instead of object.
@method getValue()
@param {bool} isSingle whether to return just value of single element
@returns {Object} object of element names and values
@example
$('#username, #fullname').editable('getValue');
//result:
{
username: "superuser",
fullname: "John"
}
//isSingle = true
$('#username').editable('getValue', true);
//result "superuser"
**/
case 'getValue':
if(arguments.length === 2 && arguments[1] === true) { //isSingle = true
result = this.eq(0).data(datakey).value;
} else {
this.each(function () {
var $this = $(this), data = $this.data(datakey);
if (data && data.value !== undefined && data.value !== null) {
result[data.options.name] = data.input.value2submit(data.value);
}
});
}
return result;
/**
This method collects values from several editable elements and submit them all to server.
Internally it runs client-side validation for all fields and submits only in case of success.
See <a href="#newrecord">creating new records</a> for details.
Since 1.5.1 `submit` can be applied to single element to send data programmatically. In that case
`url`, `success` and `error` is taken from initial options and you can just call `$('#username').editable('submit')`.
@method submit(options)
@param {object} options
@param {object} options.url url to submit data
@param {object} options.data additional data to submit
@param {object} options.ajaxOptions additional ajax options
@param {function} options.error(obj) error handler
@param {function} options.success(obj,config) success handler
@returns {Object} jQuery object
**/
case 'submit': //collects value, validate and submit to server for creating new record
var config = arguments[1] || {},
$elems = this,
errors = this.editable('validate');
// validation ok
if($.isEmptyObject(errors)) {
var ajaxOptions = {};
// for single element use url, success etc from options
if($elems.length === 1) {
var editable = $elems.data('editable');
//standard params
var params = {
name: editable.options.name || '',
value: editable.input.value2submit(editable.value),
pk: (typeof editable.options.pk === 'function') ?
editable.options.pk.call(editable.options.scope) :
editable.options.pk
};
//additional params
if(typeof editable.options.params === 'function') {
params = editable.options.params.call(editable.options.scope, params);
} else {
//try parse json in single quotes (from data-params attribute)
editable.options.params = $.fn.editableutils.tryParseJson(editable.options.params, true);
$.extend(params, editable.options.params);
}
ajaxOptions = {
url: editable.options.url,
data: params,
type: 'POST'
};
// use success / error from options
config.success = config.success || editable.options.success;
config.error = config.error || editable.options.error;
// multiple elements
} else {
var values = this.editable('getValue');
ajaxOptions = {
url: config.url,
data: values,
type: 'POST'
};
}
// ajax success callabck (response 200 OK)
ajaxOptions.success = typeof config.success === 'function' ? function(response) {
config.success.call($elems, response, config);
} : $.noop;
// ajax error callabck
ajaxOptions.error = typeof config.error === 'function' ? function() {
config.error.apply($elems, arguments);
} : $.noop;
// extend ajaxOptions
if(config.ajaxOptions) {
$.extend(ajaxOptions, config.ajaxOptions);
}
// extra data
if(config.data) {
$.extend(ajaxOptions.data, config.data);
}
// perform ajax request
$.ajax(ajaxOptions);
} else { //client-side validation error
if(typeof config.error === 'function') {
config.error.call($elems, errors);
}
}
return this;
}
//return jquery object
return this.each(function () {
var $this = $(this),
data = $this.data(datakey),
options = typeof option === 'object' && option;
//for delegated targets do not store `editable` object for element
//it's allows several different selectors.
//see: https://github.com/vitalets/x-editable/issues/312
if(options && options.selector) {
data = new Editable(this, options);
return;
}
if (!data) {
$this.data(datakey, (data = new Editable(this, options)));
}
if (typeof option === 'string') { //call method
data[option].apply(data, Array.prototype.slice.call(args, 1));
}
});
};
$.fn.editable.defaults = {
/**
Type of input. Can be <code>text|textarea|select|date|checklist</code> and more
@property type
@type string
@default 'text'
**/
type: 'text',
/**
Sets disabled state of editable
@property disabled
@type boolean
@default false
**/
disabled: false,
/**
How to toggle editable. Can be <code>click|dblclick|mouseenter|manual</code>.
When set to <code>manual</code> you should manually call <code>show/hide</code> methods of editable.
**Note**: if you call <code>show</code> or <code>toggle</code> inside **click** handler of some DOM element,
you need to apply <code>e.stopPropagation()</code> because containers are being closed on any click on document.
@example
$('#edit-button').click(function(e) {
e.stopPropagation();
$('#username').editable('toggle');
});
@property toggle
@type string
@default 'click'
**/
toggle: 'click',
/**
Text shown when element is empty.
@property emptytext
@type string
@default 'Empty'
**/
emptytext: 'Empty',
/**
Allows to automatically set element's text based on it's value. Can be <code>auto|always|never</code>. Useful for select and date.
For example, if dropdown list is <code>{1: 'a', 2: 'b'}</code> and element's value set to <code>1</code>, it's html will be automatically set to <code>'a'</code>.
<code>auto</code> - text will be automatically set only if element is empty.
<code>always|never</code> - always(never) try to set element's text.
@property autotext
@type string
@default 'auto'
**/
autotext: 'auto',
/**
Initial value of input. If not set, taken from element's text.
Note, that if element's text is empty - text is automatically generated from value and can be customized (see `autotext` option).
For example, to display currency sign:
@example
<a id="price" data-type="text" data-value="100"></a>
<script>
$('#price').editable({
...
display: function(value) {
$(this).text(value + '$');
}
})
</script>
@property value
@type mixed
@default element's text
**/
value: null,
/**
Callback to perform custom displaying of value in element's text.
If `null`, default input's display used.
If `false`, no displaying methods will be called, element's text will never change.
Runs under element's scope.
_**Parameters:**_
* `value` current value to be displayed
* `response` server response (if display called after ajax submit), since 1.4.0
For _inputs with source_ (select, checklist) parameters are different:
* `value` current value to be displayed
* `sourceData` array of items for current input (e.g. dropdown items)
* `response` server response (if display called after ajax submit), since 1.4.0
To get currently selected items use `$.fn.editableutils.itemsByValue(value, sourceData)`.
@property display
@type function|boolean
@default null
@since 1.2.0
@example
display: function(value, sourceData) {
//display checklist as comma-separated values
var html = [],
checked = $.fn.editableutils.itemsByValue(value, sourceData);
if(checked.length) {
$.each(checked, function(i, v) { html.push($.fn.editableutils.escape(v.text)); });
$(this).html(html.join(', '));
} else {
$(this).empty();
}
}
**/
display: null,
/**
Css class applied when editable text is empty.
@property emptyclass
@type string
@since 1.4.1
@default editable-empty
**/
emptyclass: 'editable-empty',
/**
Css class applied when value was stored but not sent to server (`pk` is empty or `send = 'never'`).
You may set it to `null` if you work with editables locally and submit them together.
@property unsavedclass
@type string
@since 1.4.1
@default editable-unsaved
**/
unsavedclass: 'editable-unsaved',
/**
If selector is provided, editable will be delegated to the specified targets.
Usefull for dynamically generated DOM elements.
**Please note**, that delegated targets can't be initialized with `emptytext` and `autotext` options,
as they actually become editable only after first click.
You should manually set class `editable-click` to these elements.
Also, if element originally empty you should add class `editable-empty`, set `data-value=""` and write emptytext into element:
@property selector
@type string
@since 1.4.1
@default null
@example
<div id="user">
<!-- empty -->
<a href="#" data-name="username" data-type="text" class="editable-click editable-empty" data-value="" title="Username">Empty</a>
<!-- non-empty -->
<a href="#" data-name="group" data-type="select" data-source="/groups" data-value="1" class="editable-click" title="Group">Operator</a>
</div>
<script>
$('#user').editable({
selector: 'a',
url: '/post',
pk: 1
});
</script>
**/
selector: null,
/**
Color used to highlight element after update. Implemented via CSS3 transition, works in modern browsers.
@property highlight
@type string|boolean
@since 1.4.5
@default #FFFF80
**/
highlight: '#FFFF80'
};
}(window.jQuery));
/**
AbstractInput - base class for all editable inputs.
It defines interface to be implemented by any input type.
To create your own input you can inherit from this class.
@class abstractinput
**/
(function ($) {
"use strict";
//types
$.fn.editabletypes = {};
var AbstractInput = function () { };
AbstractInput.prototype = {
/**
Initializes input
@method init()
**/
init: function(type, options, defaults) {
this.type = type;
this.options = $.extend({}, defaults, options);
},
/*
this method called before render to init $tpl that is inserted in DOM
*/
prerender: function() {
this.$tpl = $(this.options.tpl); //whole tpl as jquery object
this.$input = this.$tpl; //control itself, can be changed in render method
this.$clear = null; //clear button
this.error = null; //error message, if input cannot be rendered
},
/**
Renders input from tpl. Can return jQuery deferred object.
Can be overwritten in child objects
@method render()
**/
render: function() {
},
/**
Sets element's html by value.
@method value2html(value, element)
@param {mixed} value
@param {DOMElement} element
**/
value2html: function(value, element) {
$(element)[this.options.escape ? 'text' : 'html']($.trim(value));
},
/**
Converts element's html to value
@method html2value(html)
@param {string} html
@returns {mixed}
**/
html2value: function(html) {
return $('<div>').html(html).text();
},
/**
Converts value to string (for internal compare). For submitting to server used value2submit().
@method value2str(value)
@param {mixed} value
@returns {string}
**/
value2str: function(value) {
return String(value);
},
/**
Converts string received from server into value. Usually from `data-value` attribute.
@method str2value(str)
@param {string} str
@returns {mixed}
**/
str2value: function(str) {
return str;
},
/**
Converts value for submitting to server. Result can be string or object.
@method value2submit(value)
@param {mixed} value
@returns {mixed}
**/
value2submit: function(value) {
return value;
},
/**
Sets value of input.
@method value2input(value)
@param {mixed} value
**/
value2input: function(value) {
this.$input.val(value);
},
/**
Returns value of input. Value can be object (e.g. datepicker)
@method input2value()
**/
input2value: function() {
return this.$input.val();
},
/**
Activates input. For text it sets focus.
@method activate()
**/
activate: function() {
if(this.$input.is(':visible')) {
this.$input.focus();
}
},
/**
Creates input.
@method clear()
**/
clear: function() {
this.$input.val(null);
},
/**
method to escape html.
**/
escape: function(str) {
return $('<div>').text(str).html();
},
/**
attach handler to automatically submit form when value changed (useful when buttons not shown)
**/
autosubmit: function() {
},
/**
Additional actions when destroying element
**/
destroy: function() {
},
// -------- helper functions --------
setClass: function() {
if(this.options.inputclass) {
this.$input.addClass(this.options.inputclass);
}
},
setAttr: function(attr) {
if (this.options[attr] !== undefined && this.options[attr] !== null) {
this.$input.attr(attr, this.options[attr]);
}
},
option: function(key, value) {
this.options[key] = value;
}
};
AbstractInput.defaults = {
/**
HTML template of input. Normally you should not change it.
@property tpl
@type string
@default ''
**/
tpl: '',
/**
CSS class automatically applied to input
@property inputclass
@type string
@default null
**/
inputclass: null,
/**
If `true` - html will be escaped in content of element via $.text() method.
If `false` - html will not be escaped, $.html() used.
When you use own `display` function, this option obviosly has no effect.
@property escape
@type boolean
@since 1.5.0
@default true
**/
escape: true,
//scope for external methods (e.g. source defined as function)
//for internal use only
scope: null,
//need to re-declare showbuttons here to get it's value from common config (passed only options existing in defaults)
showbuttons: true
};
$.extend($.fn.editabletypes, {abstractinput: AbstractInput});
}(window.jQuery));
/**
List - abstract class for inputs that have source option loaded from js array or via ajax
@class list
@extends abstractinput
**/
(function ($) {
"use strict";
var List = function (options) {
};
$.fn.editableutils.inherit(List, $.fn.editabletypes.abstractinput);
$.extend(List.prototype, {
render: function () {
var deferred = $.Deferred();
this.error = null;
this.onSourceReady(function () {
this.renderList();
deferred.resolve();
}, function () {
this.error = this.options.sourceError;
deferred.resolve();
});
return deferred.promise();
},
html2value: function (html) {
return null; //can't set value by text
},
value2html: function (value, element, display, response) {
var deferred = $.Deferred(),
success = function () {
if(typeof display === 'function') {
//custom display method
display.call(element, value, this.sourceData, response);
} else {
this.value2htmlFinal(value, element);
}
deferred.resolve();
};
//for null value just call success without loading source
if(value === null) {
success.call(this);
} else {
this.onSourceReady(success, function () { deferred.resolve(); });
}
return deferred.promise();
},
// ------------- additional functions ------------
onSourceReady: function (success, error) {
//run source if it function
var source;
if ($.isFunction(this.options.source)) {
source = this.options.source.call(this.options.scope);
this.sourceData = null;
//note: if function returns the same source as URL - sourceData will be taken from cahce and no extra request performed
} else {
source = this.options.source;
}
//if allready loaded just call success
if(this.options.sourceCache && $.isArray(this.sourceData)) {
success.call(this);
return;
}
//try parse json in single quotes (for double quotes jquery does automatically)
try {
source = $.fn.editableutils.tryParseJson(source, false);
} catch (e) {
error.call(this);
return;
}
//loading from url
if (typeof source === 'string') {
//try to get sourceData from cache
if(this.options.sourceCache) {
var cacheID = source,
cache;
if (!$(document).data(cacheID)) {
$(document).data(cacheID, {});
}
cache = $(document).data(cacheID);
//check for cached data
if (cache.loading === false && cache.sourceData) { //take source from cache
this.sourceData = cache.sourceData;
this.doPrepend();
success.call(this);
return;
} else if (cache.loading === true) { //cache is loading, put callback in stack to be called later
cache.callbacks.push($.proxy(function () {
this.sourceData = cache.sourceData;
this.doPrepend();
success.call(this);
}, this));
//also collecting error callbacks
cache.err_callbacks.push($.proxy(error, this));
return;
} else { //no cache yet, activate it
cache.loading = true;
cache.callbacks = [];
cache.err_callbacks = [];
}
}
//ajaxOptions for source. Can be overwritten bt options.sourceOptions
var ajaxOptions = $.extend({
url: source,
type: 'get',
cache: false,
dataType: 'json',
success: $.proxy(function (data) {
if(cache) {
cache.loading = false;
}
this.sourceData = this.makeArray(data);
if($.isArray(this.sourceData)) {
if(cache) {
//store result in cache
cache.sourceData = this.sourceData;
//run success callbacks for other fields waiting for this source
$.each(cache.callbacks, function () { this.call(); });
}
this.doPrepend();
success.call(this);
} else {
error.call(this);
if(cache) {
//run error callbacks for other fields waiting for this source
$.each(cache.err_callbacks, function () { this.call(); });
}
}
}, this),
error: $.proxy(function () {
error.call(this);
if(cache) {
cache.loading = false;
//run error callbacks for other fields
$.each(cache.err_callbacks, function () { this.call(); });
}
}, this)
}, this.options.sourceOptions);
//loading sourceData from server
$.ajax(ajaxOptions);
} else { //options as json/array
this.sourceData = this.makeArray(source);
if($.isArray(this.sourceData)) {
this.doPrepend();
success.call(this);
} else {
error.call(this);
}
}
},
doPrepend: function () {
if(this.options.prepend === null || this.options.prepend === undefined) {
return;
}
if(!$.isArray(this.prependData)) {
//run prepend if it is function (once)
if ($.isFunction(this.options.prepend)) {
this.options.prepend = this.options.prepend.call(this.options.scope);
}
//try parse json in single quotes
this.options.prepend = $.fn.editableutils.tryParseJson(this.options.prepend, true);
//convert prepend from string to object
if (typeof this.options.prepend === 'string') {
this.options.prepend = {'': this.options.prepend};
}
this.prependData = this.makeArray(this.options.prepend);
}
if($.isArray(this.prependData) && $.isArray(this.sourceData)) {
this.sourceData = this.prependData.concat(this.sourceData);
}
},
/*
renders input list
*/
renderList: function() {
// this method should be overwritten in child class
},
/*
set element's html by value
*/
value2htmlFinal: function(value, element) {
// this method should be overwritten in child class
},
/**
* convert data to array suitable for sourceData, e.g. [{value: 1, text: 'abc'}, {...}]
*/
makeArray: function(data) {
var count, obj, result = [], item, iterateItem;
if(!data || typeof data === 'string') {
return null;
}
if($.isArray(data)) { //array
/*
function to iterate inside item of array if item is object.
Caclulates count of keys in item and store in obj.
*/
iterateItem = function (k, v) {
obj = {value: k, text: v};
if(count++ >= 2) {
return false;// exit from `each` if item has more than one key.
}
};
for(var i = 0; i < data.length; i++) {
item = data[i];
if(typeof item === 'object') {
count = 0; //count of keys inside item
$.each(item, iterateItem);
//case: [{val1: 'text1'}, {val2: 'text2} ...]
if(count === 1) {
result.push(obj);
//case: [{value: 1, text: 'text1'}, {value: 2, text: 'text2'}, ...]
} else if(count > 1) {
//removed check of existance: item.hasOwnProperty('value') && item.hasOwnProperty('text')
if(item.children) {
item.children = this.makeArray(item.children);
}
result.push(item);
}
} else {
//case: ['text1', 'text2' ...]
result.push({value: item, text: item});
}
}
} else { //case: {val1: 'text1', val2: 'text2, ...}
$.each(data, function (k, v) {
result.push({value: k, text: v});
});
}
return result;
},
option: function(key, value) {
this.options[key] = value;
if(key === 'source') {
this.sourceData = null;
}
if(key === 'prepend') {
this.prependData = null;
}
}
});
List.defaults = $.extend({}, $.fn.editabletypes.abstractinput.defaults, {
/**
Source data for list.
If **array** - it should be in format: `[{value: 1, text: "text1"}, {value: 2, text: "text2"}, ...]`
For compability, object format is also supported: `{"1": "text1", "2": "text2" ...}` but it does not guarantee elements order.
If **string** - considered ajax url to load items. In that case results will be cached for fields with the same source and name. See also `sourceCache` option.
If **function**, it should return data in format above (since 1.4.0).
Since 1.4.1 key `children` supported to render OPTGROUP (for **select** input only):
@example
[
{text: "group1", children: [
{value: 1, text: "text1"},
{value: 2, text: "text2"}
]},
...
]
@property source
@type string | array | object | function
@default null
**/
source: null,
/**
Data automatically prepended to the beginning of dropdown list.
@property prepend
@type string | array | object | function
@default false
**/
prepend: false,
/**
Error message when list cannot be loaded (e.g. ajax error)
@property sourceError
@type string
@default Error when loading list
**/
sourceError: 'Error when loading list',
/**
if `true` and source is **string url** - results will be cached for fields with the same source.
Usefull for editable column in grid to prevent extra requests.
@property sourceCache
@type boolean
@default true
@since 1.2.0
**/
sourceCache: true,
/**
Additional ajax options to be used in $.ajax() when loading list from server.
Useful to send extra parameters or change request method.
@property sourceOptions
@type object|function
@default null
@since 1.5.0
@example
sourceOptions: {
data: {param: 123},
type: 'post'
}
**/
sourceOptions: null
});
$.fn.editabletypes.list = List;
}(window.jQuery));
/**
Text input
@class text
@extends abstractinput
@final
@example
<a href="#" id="username" data-type="text" data-pk="1">awesome</a>
<script>
$(function(){
$('#username').editable({
url: '/post',
title: 'Enter username'
});
});
</script>
**/
(function ($) {
"use strict";
var Text = function (options) {
this.init('text', options, Text.defaults);
};
$.fn.editableutils.inherit(Text, $.fn.editabletypes.abstractinput);
$.extend(Text.prototype, {
render: function() {
this.renderClear();
this.setClass();
this.setAttr('placeholder');
},
activate: function() {
if(this.$input.is(':visible')) {
this.$input.focus();
// if (this.$input.is('input,textarea') && !this.$input.is('[type="checkbox"],[type="range"],[type="number"],[type="email"]')) {
if (this.$input.is('input,textarea') && !this.$input.is('[type="checkbox"],[type="range"]')) {
$.fn.editableutils.setCursorPosition(this.$input.get(0), this.$input.val().length);
}
if(this.toggleClear) {
this.toggleClear();
}
}
},
//render clear button
renderClear: function() {
if (this.options.clear) {
this.$clear = $('<span class="editable-clear-x"></span>');
this.$input.after(this.$clear)
.css('padding-right', 24)
.keyup($.proxy(function(e) {
//arrows, enter, tab, etc
if(~$.inArray(e.keyCode, [40,38,9,13,27])) {
return;
}
clearTimeout(this.t);
var that = this;
this.t = setTimeout(function() {
that.toggleClear(e);
}, 100);
}, this))
.parent().css('position', 'relative');
this.$clear.click($.proxy(this.clear, this));
}
},
postrender: function() {
/*
//now `clear` is positioned via css
if(this.$clear) {
//can position clear button only here, when form is shown and height can be calculated
// var h = this.$input.outerHeight(true) || 20,
var h = this.$clear.parent().height(),
delta = (h - this.$clear.height()) / 2;
//this.$clear.css({bottom: delta, right: delta});
}
*/
},
//show / hide clear button
toggleClear: function(e) {
if(!this.$clear) {
return;
}
var len = this.$input.val().length,
visible = this.$clear.is(':visible');
if(len && !visible) {
this.$clear.show();
}
if(!len && visible) {
this.$clear.hide();
}
},
clear: function() {
this.$clear.hide();
this.$input.val('').focus();
}
});
Text.defaults = $.extend({}, $.fn.editabletypes.abstractinput.defaults, {
/**
@property tpl
@default <input type="text">
**/
tpl: '<input type="text">',
/**
Placeholder attribute of input. Shown when input is empty.
@property placeholder
@type string
@default null
**/
placeholder: null,
/**
Whether to show `clear` button
@property clear
@type boolean
@default true
**/
clear: true
});
$.fn.editabletypes.text = Text;
}(window.jQuery));
/**
Textarea input
@class textarea
@extends abstractinput
@final
@example
<a href="#" id="comments" data-type="textarea" data-pk="1">awesome comment!</a>
<script>
$(function(){
$('#comments').editable({
url: '/post',
title: 'Enter comments',
rows: 10
});
});
</script>
**/
(function ($) {
"use strict";
var Textarea = function (options) {
this.init('textarea', options, Textarea.defaults);
};
$.fn.editableutils.inherit(Textarea, $.fn.editabletypes.abstractinput);
$.extend(Textarea.prototype, {
render: function () {
this.setClass();
this.setAttr('placeholder');
this.setAttr('rows');
//ctrl + enter
this.$input.keydown(function (e) {
if (e.ctrlKey && e.which === 13) {
$(this).closest('form').submit();
}
});
},
//using `white-space: pre-wrap` solves \n <--> BR conversion very elegant!
/*
value2html: function(value, element) {
var html = '', lines;
if(value) {
lines = value.split("\n");
for (var i = 0; i < lines.length; i++) {
lines[i] = $('<div>').text(lines[i]).html();
}
html = lines.join('<br>');
}
$(element).html(html);
},
html2value: function(html) {
if(!html) {
return '';
}
var regex = new RegExp(String.fromCharCode(10), 'g');
var lines = html.split(/<br\s*\/?>/i);
for (var i = 0; i < lines.length; i++) {
var text = $('<div>').html(lines[i]).text();
// Remove newline characters (\n) to avoid them being converted by value2html() method
// thus adding extra <br> tags
text = text.replace(regex, '');
lines[i] = text;
}
return lines.join("\n");
},
*/
activate: function() {
$.fn.editabletypes.text.prototype.activate.call(this);
}
});
Textarea.defaults = $.extend({}, $.fn.editabletypes.abstractinput.defaults, {
/**
@property tpl
@default <textarea></textarea>
**/
tpl:'<textarea></textarea>',
/**
@property inputclass
@default input-large
**/
inputclass: 'input-large',
/**
Placeholder attribute of input. Shown when input is empty.
@property placeholder
@type string
@default null
**/
placeholder: null,
/**
Number of rows in textarea
@property rows
@type integer
@default 7
**/
rows: 7
});
$.fn.editabletypes.textarea = Textarea;
}(window.jQuery));
/**
Select (dropdown)
@class select
@extends list
@final
@example
<a href="#" id="status" data-type="select" data-pk="1" data-url="/post" data-title="Select status"></a>
<script>
$(function(){
$('#status').editable({
value: 2,
source: [
{value: 1, text: 'Active'},
{value: 2, text: 'Blocked'},
{value: 3, text: 'Deleted'}
]
});
});
</script>
**/
(function ($) {
"use strict";
var Select = function (options) {
this.init('select', options, Select.defaults);
};
$.fn.editableutils.inherit(Select, $.fn.editabletypes.list);
$.extend(Select.prototype, {
renderList: function() {
this.$input.empty();
var escape = this.options.escape;
var fillItems = function($el, data) {
var attr;
if($.isArray(data)) {
for(var i=0; i<data.length; i++) {
attr = {};
if(data[i].children) {
attr.label = data[i].text;
$el.append(fillItems($('<optgroup>', attr), data[i].children));
} else {
attr.value = data[i].value;
if(data[i].disabled) {
attr.disabled = true;
}
var $option = $('<option>', attr);
$option[escape ? 'text' : 'html'](data[i].text);
$el.append($option);
}
}
}
return $el;
};
fillItems(this.$input, this.sourceData);
this.setClass();
//enter submit
this.$input.on('keydown.editable', function (e) {
if (e.which === 13) {
$(this).closest('form').submit();
}
});
},
value2htmlFinal: function(value, element) {
var text = '',
items = $.fn.editableutils.itemsByValue(value, this.sourceData);
if(items.length) {
text = items[0].text;
}
//$(element).text(text);
$.fn.editabletypes.abstractinput.prototype.value2html.call(this, text, element);
},
autosubmit: function() {
this.$input.off('keydown.editable').on('change.editable', function(){
$(this).closest('form').submit();
});
}
});
Select.defaults = $.extend({}, $.fn.editabletypes.list.defaults, {
/**
@property tpl
@default <select></select>
**/
tpl:'<select></select>'
});
$.fn.editabletypes.select = Select;
}(window.jQuery));
/**
List of checkboxes.
Internally value stored as javascript array of values.
@class checklist
@extends list
@final
@example
<a href="#" id="options" data-type="checklist" data-pk="1" data-url="/post" data-title="Select options"></a>
<script>
$(function(){
$('#options').editable({
value: [2, 3],
source: [
{value: 1, text: 'option1'},
{value: 2, text: 'option2'},
{value: 3, text: 'option3'}
]
});
});
</script>
**/
(function ($) {
"use strict";
var Checklist = function (options) {
this.init('checklist', options, Checklist.defaults);
};
$.fn.editableutils.inherit(Checklist, $.fn.editabletypes.list);
$.extend(Checklist.prototype, {
renderList: function() {
var $label, $div;
this.$tpl.empty();
if(!$.isArray(this.sourceData)) {
return;
}
for(var i=0; i<this.sourceData.length; i++) {
$label = $('<label>').append($('<input>', {
type: 'checkbox',
value: this.sourceData[i].value
}));
var $option = $('<span>');
$option[this.options.escape ? 'text' : 'html'](' '+this.sourceData[i].text);
$label.append($option);
$('<div>').append($label).appendTo(this.$tpl);
}
this.$input = this.$tpl.find('input[type="checkbox"]');
this.setClass();
},
value2str: function(value) {
return $.isArray(value) ? value.sort().join($.trim(this.options.separator)) : '';
},
//parse separated string
str2value: function(str) {
var reg, value = null;
if(typeof str === 'string' && str.length) {
reg = new RegExp('\\s*'+$.trim(this.options.separator)+'\\s*');
value = str.split(reg);
} else if($.isArray(str)) {
value = str;
} else {
value = [str];
}
return value;
},
//set checked on required checkboxes
value2input: function(value) {
this.$input.prop('checked', false);
if($.isArray(value) && value.length) {
this.$input.each(function(i, el) {
var $el = $(el);
// cannot use $.inArray as it performs strict comparison
$.each(value, function(j, val){
/*jslint eqeq: true*/
if($el.val() == val) {
/*jslint eqeq: false*/
$el.prop('checked', true);
}
});
});
}
},
input2value: function() {
var checked = [];
this.$input.filter(':checked').each(function(i, el) {
checked.push($(el).val());
});
return checked;
},
//collect text of checked boxes
value2htmlFinal: function(value, element) {
var html = [],
checked = $.fn.editableutils.itemsByValue(value, this.sourceData),
escape = this.options.escape;
if(checked.length) {
$.each(checked, function(i, v) {
var text = escape ? $.fn.editableutils.escape(v.text) : v.text;
html.push(text);
});
$(element).html(html.join('<br>'));
} else {
$(element).empty();
}
},
activate: function() {
this.$input.first().focus();
},
autosubmit: function() {
this.$input.on('keydown', function(e){
if (e.which === 13) {
$(this).closest('form').submit();
}
});
}
});
Checklist.defaults = $.extend({}, $.fn.editabletypes.list.defaults, {
/**
@property tpl
@default <div></div>
**/
tpl:'<div class="editable-checklist"></div>',
/**
@property inputclass
@type string
@default null
**/
inputclass: null,
/**
Separator of values when reading from `data-value` attribute
@property separator
@type string
@default ','
**/
separator: ','
});
$.fn.editabletypes.checklist = Checklist;
}(window.jQuery));
/**
HTML5 input types.
Following types are supported:
* password
* email
* url
* tel
* number
* range
* time
Learn more about html5 inputs:
http://www.w3.org/wiki/HTML5_form_additions
To check browser compatibility please see:
https://developer.mozilla.org/en-US/docs/HTML/Element/Input
@class html5types
@extends text
@final
@since 1.3.0
@example
<a href="#" id="email" data-type="email" data-pk="1">admin@example.com</a>
<script>
$(function(){
$('#email').editable({
url: '/post',
title: 'Enter email'
});
});
</script>
**/
/**
@property tpl
@default depends on type
**/
/*
Password
*/
(function ($) {
"use strict";
var Password = function (options) {
this.init('password', options, Password.defaults);
};
$.fn.editableutils.inherit(Password, $.fn.editabletypes.text);
$.extend(Password.prototype, {
//do not display password, show '[hidden]' instead
value2html: function(value, element) {
if(value) {
$(element).text('[hidden]');
} else {
$(element).empty();
}
},
//as password not displayed, should not set value by html
html2value: function(html) {
return null;
}
});
Password.defaults = $.extend({}, $.fn.editabletypes.text.defaults, {
tpl: '<input type="password">'
});
$.fn.editabletypes.password = Password;
}(window.jQuery));
/*
Email
*/
(function ($) {
"use strict";
var Email = function (options) {
this.init('email', options, Email.defaults);
};
$.fn.editableutils.inherit(Email, $.fn.editabletypes.text);
Email.defaults = $.extend({}, $.fn.editabletypes.text.defaults, {
tpl: '<input type="email">'
});
$.fn.editabletypes.email = Email;
}(window.jQuery));
/*
Url
*/
(function ($) {
"use strict";
var Url = function (options) {
this.init('url', options, Url.defaults);
};
$.fn.editableutils.inherit(Url, $.fn.editabletypes.text);
Url.defaults = $.extend({}, $.fn.editabletypes.text.defaults, {
tpl: '<input type="url">'
});
$.fn.editabletypes.url = Url;
}(window.jQuery));
/*
Tel
*/
(function ($) {
"use strict";
var Tel = function (options) {
this.init('tel', options, Tel.defaults);
};
$.fn.editableutils.inherit(Tel, $.fn.editabletypes.text);
Tel.defaults = $.extend({}, $.fn.editabletypes.text.defaults, {
tpl: '<input type="tel">'
});
$.fn.editabletypes.tel = Tel;
}(window.jQuery));
/*
Number
*/
(function ($) {
"use strict";
var NumberInput = function (options) {
this.init('number', options, NumberInput.defaults);
};
$.fn.editableutils.inherit(NumberInput, $.fn.editabletypes.text);
$.extend(NumberInput.prototype, {
render: function () {
NumberInput.superclass.render.call(this);
this.setAttr('min');
this.setAttr('max');
this.setAttr('step');
},
postrender: function() {
if(this.$clear) {
//increase right ffset for up/down arrows
this.$clear.css({right: 24});
/*
//can position clear button only here, when form is shown and height can be calculated
var h = this.$input.outerHeight(true) || 20,
delta = (h - this.$clear.height()) / 2;
//add 12px to offset right for up/down arrows
this.$clear.css({top: delta, right: delta + 16});
*/
}
}
});
NumberInput.defaults = $.extend({}, $.fn.editabletypes.text.defaults, {
tpl: '<input type="number">',
inputclass: 'input-mini',
min: null,
max: null,
step: null
});
$.fn.editabletypes.number = NumberInput;
}(window.jQuery));
/*
Range (inherit from number)
*/
(function ($) {
"use strict";
var Range = function (options) {
this.init('range', options, Range.defaults);
};
$.fn.editableutils.inherit(Range, $.fn.editabletypes.number);
$.extend(Range.prototype, {
render: function () {
this.$input = this.$tpl.filter('input');
this.setClass();
this.setAttr('min');
this.setAttr('max');
this.setAttr('step');
this.$input.on('input', function(){
$(this).siblings('output').text($(this).val());
});
},
activate: function() {
this.$input.focus();
}
});
Range.defaults = $.extend({}, $.fn.editabletypes.number.defaults, {
tpl: '<input type="range"><output style="width: 30px; display: inline-block"></output>',
inputclass: 'input-medium'
});
$.fn.editabletypes.range = Range;
}(window.jQuery));
/*
Time
*/
(function ($) {
"use strict";
var Time = function (options) {
this.init('time', options, Time.defaults);
};
//inherit from abstract, as inheritance from text gives selection error.
$.fn.editableutils.inherit(Time, $.fn.editabletypes.abstractinput);
$.extend(Time.prototype, {
render: function() {
this.setClass();
}
});
Time.defaults = $.extend({}, $.fn.editabletypes.abstractinput.defaults, {
tpl: '<input type="time">'
});
$.fn.editabletypes.time = Time;
}(window.jQuery));
/**
Select2 input. Based on amazing work of Igor Vaynberg https://github.com/ivaynberg/select2.
Please see [original select2 docs](http://ivaynberg.github.com/select2) for detailed description and options.
You should manually download and include select2 distributive:
<link href="select2/select2.css" rel="stylesheet" type="text/css"></link>
<script src="select2/select2.js"></script>
To make it **bootstrap-styled** you can use css from [here](https://github.com/t0m/select2-bootstrap-css):
<link href="select2-bootstrap.css" rel="stylesheet" type="text/css"></link>
**Note:** currently `autotext` feature does not work for select2 with `ajax` remote source.
You need initially put both `data-value` and element's text youself:
<a href="#" data-type="select2" data-value="1">Text1</a>
@class select2
@extends abstractinput
@since 1.4.1
@final
@example
<a href="#" id="country" data-type="select2" data-pk="1" data-value="ru" data-url="/post" data-title="Select country"></a>
<script>
$(function(){
//local source
$('#country').editable({
source: [
{id: 'gb', text: 'Great Britain'},
{id: 'us', text: 'United States'},
{id: 'ru', text: 'Russia'}
],
select2: {
multiple: true
}
});
//remote source (simple)
$('#country').editable({
source: '/getCountries',
select2: {
placeholder: 'Select Country',
minimumInputLength: 1
}
});
//remote source (advanced)
$('#country').editable({
select2: {
placeholder: 'Select Country',
allowClear: true,
minimumInputLength: 3,
id: function (item) {
return item.CountryId;
},
ajax: {
url: '/getCountries',
dataType: 'json',
data: function (term, page) {
return { query: term };
},
results: function (data, page) {
return { results: data };
}
},
formatResult: function (item) {
return item.CountryName;
},
formatSelection: function (item) {
return item.CountryName;
},
initSelection: function (element, callback) {
return $.get('/getCountryById', { query: element.val() }, function (data) {
callback(data);
});
}
}
});
});
</script>
**/
(function ($) {
"use strict";
var Constructor = function (options) {
this.init('select2', options, Constructor.defaults);
options.select2 = options.select2 || {};
this.sourceData = null;
//placeholder
if(options.placeholder) {
options.select2.placeholder = options.placeholder;
}
//if not `tags` mode, use source
if(!options.select2.tags && options.source) {
var source = options.source;
//if source is function, call it (once!)
if ($.isFunction(options.source)) {
source = options.source.call(options.scope);
}
if (typeof source === 'string') {
options.select2.ajax = options.select2.ajax || {};
//some default ajax params
if(!options.select2.ajax.data) {
options.select2.ajax.data = function(term) {return { query:term };};
}
if(!options.select2.ajax.results) {
options.select2.ajax.results = function(data) { return {results:data };};
}
options.select2.ajax.url = source;
} else {
//check format and convert x-editable format to select2 format (if needed)
this.sourceData = this.convertSource(source);
options.select2.data = this.sourceData;
}
}
//overriding objects in config (as by default jQuery extend() is not recursive)
this.options.select2 = $.extend({}, Constructor.defaults.select2, options.select2);
//detect whether it is multi-valued
this.isMultiple = this.options.select2.tags || this.options.select2.multiple;
this.isRemote = ('ajax' in this.options.select2);
//store function returning ID of item
//should be here as used inautotext for local source
this.idFunc = this.options.select2.id;
if (typeof(this.idFunc) !== "function") {
var idKey = this.idFunc || 'id';
this.idFunc = function (e) { return e[idKey]; };
}
//store function that renders text in select2
this.formatSelection = this.options.select2.formatSelection;
if (typeof(this.formatSelection) !== "function") {
this.formatSelection = function (e) { return e.text; };
}
};
$.fn.editableutils.inherit(Constructor, $.fn.editabletypes.abstractinput);
$.extend(Constructor.prototype, {
render: function() {
this.setClass();
//can not apply select2 here as it calls initSelection
//over input that does not have correct value yet.
//apply select2 only in value2input
//this.$input.select2(this.options.select2);
//when data is loaded via ajax, we need to know when it's done to populate listData
if(this.isRemote) {
//listen to loaded event to populate data
this.$input.on('select2-loaded', $.proxy(function(e) {
this.sourceData = e.items.results;
}, this));
}
//trigger resize of editableform to re-position container in multi-valued mode
if(this.isMultiple) {
this.$input.on('change', function() {
$(this).closest('form').parent().triggerHandler('resize');
});
}
},
value2html: function(value, element) {
var text = '', data,
that = this;
if(this.options.select2.tags) { //in tags mode just assign value
data = value;
//data = $.fn.editableutils.itemsByValue(value, this.options.select2.tags, this.idFunc);
} else if(this.sourceData) {
data = $.fn.editableutils.itemsByValue(value, this.sourceData, this.idFunc);
} else {
//can not get list of possible values
//(e.g. autotext for select2 with ajax source)
}
//data may be array (when multiple values allowed)
if($.isArray(data)) {
//collect selected data and show with separator
text = [];
$.each(data, function(k, v){
text.push(v && typeof v === 'object' ? that.formatSelection(v) : v);
});
} else if(data) {
text = that.formatSelection(data);
}
text = $.isArray(text) ? text.join(this.options.viewseparator) : text;
//$(element).text(text);
Constructor.superclass.value2html.call(this, text, element);
},
html2value: function(html) {
return this.options.select2.tags ? this.str2value(html, this.options.viewseparator) : null;
},
value2input: function(value) {
// if value array => join it anyway
if($.isArray(value)) {
value = value.join(this.getSeparator());
}
//for remote source just set value, text is updated by initSelection
if(!this.$input.data('select2')) {
this.$input.val(value);
this.$input.select2(this.options.select2);
} else {
//second argument needed to separate initial change from user's click (for autosubmit)
this.$input.val(value).trigger('change', true);
//Uncaught Error: cannot call val() if initSelection() is not defined
//this.$input.select2('val', value);
}
// if defined remote source AND no multiple mode AND no user's initSelection provided -->
// we should somehow get text for provided id.
// The solution is to use element's text as text for that id (exclude empty)
if(this.isRemote && !this.isMultiple && !this.options.select2.initSelection) {
// customId and customText are methods to extract `id` and `text` from data object
// we can use this workaround only if user did not define these methods
// otherwise we cant construct data object
var customId = this.options.select2.id,
customText = this.options.select2.formatSelection;
if(!customId && !customText) {
var $el = $(this.options.scope);
if (!$el.data('editable').isEmpty) {
var data = {id: value, text: $el.text()};
this.$input.select2('data', data);
}
}
}
},
input2value: function() {
return this.$input.select2('val');
},
str2value: function(str, separator) {
if(typeof str !== 'string' || !this.isMultiple) {
return str;
}
separator = separator || this.getSeparator();
var val, i, l;
if (str === null || str.length < 1) {
return null;
}
val = str.split(separator);
for (i = 0, l = val.length; i < l; i = i + 1) {
val[i] = $.trim(val[i]);
}
return val;
},
autosubmit: function() {
this.$input.on('change', function(e, isInitial){
if(!isInitial) {
$(this).closest('form').submit();
}
});
},
getSeparator: function() {
return this.options.select2.separator || $.fn.select2.defaults.separator;
},
/*
Converts source from x-editable format: {value: 1, text: "1"} to
select2 format: {id: 1, text: "1"}
*/
convertSource: function(source) {
if($.isArray(source) && source.length && source[0].value !== undefined) {
for(var i = 0; i<source.length; i++) {
if(source[i].value !== undefined) {
source[i].id = source[i].value;
delete source[i].value;
}
}
}
return source;
},
activate: function() {
this.$input.select2('open');
},
destroy: function() {
if(this.$input) {
if(this.$input.data('select2')) {
this.$input.select2('destroy');
}
}
}
});
Constructor.defaults = $.extend({}, $.fn.editabletypes.abstractinput.defaults, {
/**
@property tpl
@default <input type="hidden">
**/
tpl:'<input type="hidden">',
/**
Configuration of select2. [Full list of options](http://ivaynberg.github.com/select2).
@property select2
@type object
@default null
**/
select2: null,
/**
Placeholder attribute of select
@property placeholder
@type string
@default null
**/
placeholder: null,
/**
Source data for select. It will be assigned to select2 `data` property and kept here just for convenience.
Please note, that format is different from simple `select` input: use 'id' instead of 'value'.
E.g. `[{id: 1, text: "text1"}, {id: 2, text: "text2"}, ...]`.
@property source
@type array|string|function
@default null
**/
source: null,
/**
Separator used to display tags.
@property viewseparator
@type string
@default ', '
**/
viewseparator: ', '
});
$.fn.editabletypes.select2 = Constructor;
}(window.jQuery));
/**
* Combodate - 1.1.0
* Dropdown date and time picker.
* Converts text input into dropdowns to pick day, month, year, hour, minute and second.
* Uses momentjs as datetime library http://momentjs.com.
* For i18n include corresponding file from https://github.com/timrwood/moment/tree/master/lang
*
* Confusion at noon and midnight - see http://en.wikipedia.org/wiki/12-hour_clock#Confusion_at_noon_and_midnight
* In combodate:
* 12:00 pm --> 12:00 (24-h format, midday)
* 12:00 am --> 00:00 (24-h format, midnight, start of day)
*
* Differs from momentjs parse rules:
* 00:00 pm, 12:00 pm --> 12:00 (24-h format, day not change)
* 00:00 am, 12:00 am --> 00:00 (24-h format, day not change)
*
*
* Author: Vitaliy Potapov
* Project page: http://github.com/vitalets/combodate
* Copyright (c) 2012 Vitaliy Potapov. Released under MIT License.
**/
(function ($) {
var Combodate = function (element, options) {
this.$element = $(element);
if(!this.$element.is('input')) {
$.error('Combodate should be applied to INPUT element');
return;
}
this.options = $.extend({}, $.fn.combodate.defaults, options, this.$element.data());
this.init();
};
Combodate.prototype = {
constructor: Combodate,
init: function () {
this.map = {
//key regexp moment.method
day: ['D', 'date'],
month: ['M', 'month'],
year: ['Y', 'year'],
hour: ['[Hh]', 'hours'],
minute: ['m', 'minutes'],
second: ['s', 'seconds'],
ampm: ['[Aa]', '']
};
this.$widget = $('<span class="combodate"></span>').html(this.getTemplate());
this.initCombos();
// internal momentjs instance
this.datetime = null;
//update original input on change
this.$widget.on('change', 'select', $.proxy(function(e) {
this.$element.val(this.getValue()).change();
// update days count if month or year changes
if (this.options.smartDays) {
if ($(e.target).is('.month') || $(e.target).is('.year')) {
this.fillCombo('day');
}
}
}, this));
this.$widget.find('select').css('width', 'auto');
// hide original input and insert widget
this.$element.hide().after(this.$widget);
// set initial value
this.setValue(this.$element.val() || this.options.value);
},
/*
Replace tokens in template with <select> elements
*/
getTemplate: function() {
var tpl = this.options.template;
var inputDisabled = this.$element.prop('disabled');
var customClass = this.options.customClass;
//first pass
$.each(this.map, function(k, v) {
v = v[0];
var r = new RegExp(v+'+'),
token = v.length > 1 ? v.substring(1, 2) : v;
tpl = tpl.replace(r, '{'+token+'}');
});
//replace spaces with
tpl = tpl.replace(/ /g, ' ');
//second pass
$.each(this.map, function(k, v) {
v = v[0];
var token = v.length > 1 ? v.substring(1, 2) : v;
tpl = tpl.replace('{'+token+'}', '<select class="'+k+' '+customClass +'"'+
(inputDisabled ? ' disabled="disabled"' : '')+'></select>');
});
return tpl;
},
/*
Initialize combos that presents in template
*/
initCombos: function() {
for (var k in this.map) {
var $c = this.$widget.find('.'+k);
// set properties like this.$day, this.$month etc.
this['$'+k] = $c.length ? $c : null;
// fill with items
this.fillCombo(k);
}
},
/*
Fill combo with items
*/
fillCombo: function(k) {
var $combo = this['$'+k];
if (!$combo) {
return;
}
// define method name to fill items, e.g `fillDays`
var f = 'fill' + k.charAt(0).toUpperCase() + k.slice(1);
var items = this[f]();
var value = $combo.val();
$combo.empty();
for(var i=0; i<items.length; i++) {
$combo.append('<option value="'+items[i][0]+'">'+items[i][1]+'</option>');
}
$combo.val(value);
},
/*
Initialize items of combos. Handles `firstItem` option
*/
fillCommon: function(key) {
var values = [],
relTime;
if(this.options.firstItem === 'name') {
//need both to support moment ver < 2 and >= 2
if (moment.localeData) {
relTime = moment.localeData()._relativeTime;
} else {
relTime = moment.relativeTime || moment.langData()._relativeTime;
}
var header = typeof relTime[key] === 'function' ? relTime[key](1, true, key, false) : relTime[key];
//take last entry (see momentjs lang files structure)
header = header.split(' ').reverse()[0];
values.push(['', header]);
} else if(this.options.firstItem === 'empty') {
values.push(['', '']);
}
return values;
},
/*
fill day
*/
fillDay: function() {
var items = this.fillCommon('d'), name, i,
twoDigit = this.options.template.indexOf('DD') !== -1,
daysCount = 31;
// detect days count (depends on month and year)
// originally https://github.com/vitalets/combodate/pull/7
if (this.options.smartDays && this.$month && this.$year) {
var month = parseInt(this.$month.val(), 10);
var year = parseInt(this.$year.val(), 10);
if (!isNaN(month) && !isNaN(year)) {
daysCount = moment([year, month]).daysInMonth();
}
}
for (i = 1; i <= daysCount; i++) {
name = twoDigit ? this.leadZero(i) : i;
items.push([i, name]);
}
return items;
},
/*
fill month
*/
fillMonth: function() {
var items = this.fillCommon('M'), name, i,
longNamesNum = this.options.template.indexOf('MMMMMM') !== -1,
shortNamesNum = this.options.template.indexOf('MMMMM') !== -1,
longNames = this.options.template.indexOf('MMMM') !== -1,
shortNames = this.options.template.indexOf('MMM') !== -1,
twoDigit = this.options.template.indexOf('MM') !== -1;
for(i=0; i<=11; i++) {
if (longNamesNum) {
name = moment().date(1).month(i).format('MM - MMMM');
} else if (shortNamesNum) {
name = moment().date(1).month(i).format('MM - MMM');
} else if(longNames) {
//see https://github.com/timrwood/momentjs.com/pull/36
name = moment().date(1).month(i).format('MMMM');
} else if(shortNames) {
name = moment().date(1).month(i).format('MMM');
} else if(twoDigit) {
name = this.leadZero(i+1);
} else {
name = i+1;
}
items.push([i, name]);
}
return items;
},
/*
fill year
*/
fillYear: function() {
var items = [], name, i,
longNames = this.options.template.indexOf('YYYY') !== -1;
for(i=this.options.maxYear; i>=this.options.minYear; i--) {
name = longNames ? i : (i+'').substring(2);
items[this.options.yearDescending ? 'push' : 'unshift']([i, name]);
}
items = this.fillCommon('y').concat(items);
return items;
},
/*
fill hour
*/
fillHour: function() {
var items = this.fillCommon('h'), name, i,
h12 = this.options.template.indexOf('h') !== -1,
h24 = this.options.template.indexOf('H') !== -1,
twoDigit = this.options.template.toLowerCase().indexOf('hh') !== -1,
min = h12 ? 1 : 0,
max = h12 ? 12 : 23;
for(i=min; i<=max; i++) {
name = twoDigit ? this.leadZero(i) : i;
items.push([i, name]);
}
return items;
},
/*
fill minute
*/
fillMinute: function() {
var items = this.fillCommon('m'), name, i,
twoDigit = this.options.template.indexOf('mm') !== -1;
for(i=0; i<=59; i+= this.options.minuteStep) {
name = twoDigit ? this.leadZero(i) : i;
items.push([i, name]);
}
return items;
},
/*
fill second
*/
fillSecond: function() {
var items = this.fillCommon('s'), name, i,
twoDigit = this.options.template.indexOf('ss') !== -1;
for(i=0; i<=59; i+= this.options.secondStep) {
name = twoDigit ? this.leadZero(i) : i;
items.push([i, name]);
}
return items;
},
/*
fill ampm
*/
fillAmpm: function() {
var ampmL = this.options.template.indexOf('a') !== -1,
ampmU = this.options.template.indexOf('A') !== -1,
items = [
['am', ampmL ? 'am' : 'AM'],
['pm', ampmL ? 'pm' : 'PM']
];
return items;
},
/*
Returns current date value from combos.
If format not specified - `options.format` used.
If format = `null` - Moment object returned.
*/
getValue: function(format) {
var dt, values = {},
that = this,
notSelected = false;
//getting selected values
$.each(this.map, function(k, v) {
if(k === 'ampm') {
return;
}
// if combo exists, use it's value, otherwise use default
if (that['$'+k]) {
values[k] = parseInt(that['$'+k].val(), 10);
} else {
var defaultValue;
if (that.datetime) {
defaultValue = that.datetime[v[1]]();
} else {
defaultValue = k === 'day' ? 1 : 0;
}
values[k] = defaultValue;
}
if(isNaN(values[k])) {
notSelected = true;
return false;
}
});
//if at least one visible combo not selected - return empty string
if(notSelected) {
return '';
}
//convert hours 12h --> 24h
if(this.$ampm) {
//12:00 pm --> 12:00 (24-h format, midday), 12:00 am --> 00:00 (24-h format, midnight, start of day)
if(values.hour === 12) {
values.hour = this.$ampm.val() === 'am' ? 0 : 12;
} else {
values.hour = this.$ampm.val() === 'am' ? values.hour : values.hour+12;
}
}
dt = moment([
values.year,
values.month,
values.day,
values.hour,
values.minute,
values.second
]);
//highlight invalid date
this.highlight(dt);
format = format === undefined ? this.options.format : format;
if(format === null) {
return dt.isValid() ? dt : null;
} else {
return dt.isValid() ? dt.format(format) : '';
}
},
setValue: function(value) {
if(!value) {
return;
}
// parse in strict mode (third param `true`)
var dt = typeof value === 'string' ? moment(value, this.options.format, true) : moment(value),
that = this,
values = {};
//function to find nearest value in select options
function getNearest($select, value) {
var delta = {};
$select.children('option').each(function(i, opt){
var optValue = $(opt).attr('value'),
distance;
if(optValue === '') return;
distance = Math.abs(optValue - value);
if(typeof delta.distance === 'undefined' || distance < delta.distance) {
delta = {value: optValue, distance: distance};
}
});
return delta.value;
}
if(dt.isValid()) {
//read values from date object
$.each(this.map, function(k, v) {
if(k === 'ampm') {
return;
}
values[k] = dt[v[1]]();
});
if(this.$ampm) {
//12:00 pm --> 12:00 (24-h format, midday), 12:00 am --> 00:00 (24-h format, midnight, start of day)
if(values.hour >= 12) {
values.ampm = 'pm';
if(values.hour > 12) {
values.hour -= 12;
}
} else {
values.ampm = 'am';
if(values.hour === 0) {
values.hour = 12;
}
}
}
$.each(values, function(k, v) {
//call val() for each existing combo, e.g. this.$hour.val()
if(that['$'+k]) {
if(k === 'minute' && that.options.minuteStep > 1 && that.options.roundTime) {
v = getNearest(that['$'+k], v);
}
if(k === 'second' && that.options.secondStep > 1 && that.options.roundTime) {
v = getNearest(that['$'+k], v);
}
that['$'+k].val(v);
}
});
// update days count
if (this.options.smartDays) {
this.fillCombo('day');
}
this.$element.val(dt.format(this.options.format)).change();
this.datetime = dt;
} else {
this.datetime = null;
}
},
/*
highlight combos if date is invalid
*/
highlight: function(dt) {
if(!dt.isValid()) {
if(this.options.errorClass) {
this.$widget.addClass(this.options.errorClass);
} else {
//store original border color
if(!this.borderColor) {
this.borderColor = this.$widget.find('select').css('border-color');
}
this.$widget.find('select').css('border-color', 'red');
}
} else {
if(this.options.errorClass) {
this.$widget.removeClass(this.options.errorClass);
} else {
this.$widget.find('select').css('border-color', this.borderColor);
}
}
},
leadZero: function(v) {
return v <= 9 ? '0' + v : v;
},
destroy: function() {
this.$widget.remove();
this.$element.removeData('combodate').show();
}
//todo: clear method
};
$.fn.combodate = function ( option ) {
var d, args = Array.apply(null, arguments);
args.shift();
//getValue returns date as string / object (not jQuery object)
if(option === 'getValue' && this.length && (d = this.eq(0).data('combodate'))) {
return d.getValue.apply(d, args);
}
return this.each(function () {
var $this = $(this),
data = $this.data('combodate'),
options = typeof option == 'object' && option;
if (!data) {
$this.data('combodate', (data = new Combodate(this, options)));
}
if (typeof option == 'string' && typeof data[option] == 'function') {
data[option].apply(data, args);
}
});
};
$.fn.combodate.defaults = {
//in this format value stored in original input
format: 'DD-MM-YYYY HH:mm',
//in this format items in dropdowns are displayed
template: 'D / MMM / YYYY H : mm',
//initial value, can be `new Date()`
value: null,
minYear: 1970,
maxYear: new Date().getFullYear(),
yearDescending: true,
minuteStep: 5,
secondStep: 1,
firstItem: 'empty', //'name', 'empty', 'none'
errorClass: null,
customClass: '',
roundTime: true, // whether to round minutes and seconds if step > 1
smartDays: false // whether days in combo depend on selected month: 31, 30, 28
};
}(window.jQuery));
/**
Combodate input - dropdown date and time picker.
Based on [combodate](http://vitalets.github.com/combodate) plugin (included). To use it you should manually include [momentjs](http://momentjs.com).
<script src="js/moment.min.js"></script>
Allows to input:
* only date
* only time
* both date and time
Please note, that format is taken from momentjs and **not compatible** with bootstrap-datepicker / jquery UI datepicker.
Internally value stored as `momentjs` object.
@class combodate
@extends abstractinput
@final
@since 1.4.0
@example
<a href="#" id="dob" data-type="combodate" data-pk="1" data-url="/post" data-value="1984-05-15" data-title="Select date"></a>
<script>
$(function(){
$('#dob').editable({
format: 'YYYY-MM-DD',
viewformat: 'DD.MM.YYYY',
template: 'D / MMMM / YYYY',
combodate: {
minYear: 2000,
maxYear: new Date().getFullYear(),
minuteStep: 1
}
}
});
});
</script>
**/
/*global moment*/
(function ($) {
"use strict";
var Constructor = function (options) {
this.init('combodate', options, Constructor.defaults);
//by default viewformat equals to format
if(!this.options.viewformat) {
this.options.viewformat = this.options.format;
}
//try parse combodate config defined as json string in data-combodate
options.combodate = $.fn.editableutils.tryParseJson(options.combodate, true);
//overriding combodate config (as by default jQuery extend() is not recursive)
this.options.combodate = $.extend({}, Constructor.defaults.combodate, options.combodate, {
format: this.options.format,
template: this.options.template
});
};
$.fn.editableutils.inherit(Constructor, $.fn.editabletypes.abstractinput);
$.extend(Constructor.prototype, {
render: function () {
this.$input.combodate(this.options.combodate);
if($.fn.editableform.engine === 'bs3') {
this.$input.siblings().find('select').addClass('form-control');
}
if(this.options.inputclass) {
this.$input.siblings().find('select').addClass(this.options.inputclass);
}
//"clear" link
/*
if(this.options.clear) {
this.$clear = $('<a href="#"></a>').html(this.options.clear).click($.proxy(function(e){
e.preventDefault();
e.stopPropagation();
this.clear();
}, this));
this.$tpl.parent().append($('<div class="editable-clear">').append(this.$clear));
}
*/
},
value2html: function(value, element) {
var text = value ? value.format(this.options.viewformat) : '';
//$(element).text(text);
Constructor.superclass.value2html.call(this, text, element);
},
html2value: function(html) {
return html ? moment(html, this.options.viewformat) : null;
},
value2str: function(value) {
return value ? value.format(this.options.format) : '';
},
str2value: function(str) {
return str ? moment(str, this.options.format) : null;
},
value2submit: function(value) {
return this.value2str(value);
},
value2input: function(value) {
this.$input.combodate('setValue', value);
},
input2value: function() {
return this.$input.combodate('getValue', null);
},
activate: function() {
this.$input.siblings('.combodate').find('select').eq(0).focus();
},
/*
clear: function() {
this.$input.data('datepicker').date = null;
this.$input.find('.active').removeClass('active');
},
*/
autosubmit: function() {
}
});
Constructor.defaults = $.extend({}, $.fn.editabletypes.abstractinput.defaults, {
/**
@property tpl
@default <input type="text">
**/
tpl:'<input type="text">',
/**
@property inputclass
@default null
**/
inputclass: null,
/**
Format used for sending value to server. Also applied when converting date from <code>data-value</code> attribute.<br>
See list of tokens in [momentjs docs](http://momentjs.com/docs/#/parsing/string-format)
@property format
@type string
@default YYYY-MM-DD
**/
format:'YYYY-MM-DD',
/**
Format used for displaying date. Also applied when converting date from element's text on init.
If not specified equals to `format`.
@property viewformat
@type string
@default null
**/
viewformat: null,
/**
Template used for displaying dropdowns.
@property template
@type string
@default D / MMM / YYYY
**/
template: 'D / MMM / YYYY',
/**
Configuration of combodate.
Full list of options: http://vitalets.github.com/combodate/#docs
@property combodate
@type object
@default null
**/
combodate: null
/*
(not implemented yet)
Text shown as clear date button.
If <code>false</code> clear button will not be rendered.
@property clear
@type boolean|string
@default 'x clear'
*/
//clear: '× clear'
});
$.fn.editabletypes.combodate = Constructor;
}(window.jQuery));
/**
* Editable Poshytip
* ---------------------
* requires jquery.poshytip.js
*/
(function ($) {
"use strict";
//extend methods
$.extend($.fn.editableContainer.Popup.prototype, {
containerName: 'poshytip',
innerCss: 'div.tip-inner',
defaults: $.fn.poshytip.defaults,
initContainer: function(){
this.handlePlacement();
$.extend(this.containerOptions, {
showOn: 'none',
content: '',
alignTo: 'target'
});
this.call(this.containerOptions);
},
/*
Overwrite totally show() method as poshytip requires content is set before show
*/
show: function (closeAll) {
this.$element.addClass('editable-open');
if(closeAll !== false) {
//close all open containers (except this)
this.closeOthers(this.$element[0]);
}
//render form
this.$form = $('<div>');
this.renderForm();
var $label = $('<label>').text(this.options.title || this.$element.data( "title") || this.$element.data( "originalTitle")),
$content = $('<div>').append($label).append(this.$form);
this.call('update', $content);
this.call('show');
this.tip().addClass(this.containerClass);
this.$form.data('editableform').input.activate();
},
/* hide */
innerHide: function () {
this.call('hide');
},
/* destroy */
innerDestroy: function() {
this.call('destroy');
},
setPosition: function() {
this.container().refresh(false);
},
handlePlacement: function() {
var x, y, ox = 0, oy = 0;
switch(this.options.placement) {
case 'top':
x = 'center';
y = 'top';
oy = 5;
break;
case 'right':
x = 'right';
y = 'center';
ox = 10;
break;
case 'bottom':
x = 'center';
y = 'bottom';
oy = 5;
break;
case 'left':
x = 'left';
y = 'center';
ox = 10;
break;
}
$.extend(this.containerOptions, {
alignX: x,
offsetX: ox,
alignY: y,
offsetY:oy
});
}
});
//defaults
$.fn.editableContainer.defaults = $.extend({}, $.fn.editableContainer.defaults, {
className: 'tip-yellowsimple'
});
/**
* Poshytip fix: disable incorrect table display
* see https://github.com/vadikom/poshytip/issues/7
*/
/*jshint eqeqeq:false, curly: false*/
if($.Poshytip) { //need this check, because in inline mode poshytip may not be loaded!
var tips = [],
reBgImage = /^url\(["']?([^"'\)]*)["']?\);?$/i,
rePNG = /\.png$/i,
ie6 = !!window.createPopup && document.documentElement.currentStyle.minWidth == 'undefined';
$.Poshytip.prototype.refresh = function(async) {
if (this.disabled)
return;
var currPos;
if (async) {
if (!this.$tip.data('active'))
return;
// save current position as we will need to animate
currPos = {left: this.$tip.css('left'), top: this.$tip.css('top')};
}
// reset position to avoid text wrapping, etc.
this.$tip.css({left: 0, top: 0}).appendTo(document.body);
// save default opacity
if (this.opacity === undefined)
this.opacity = this.$tip.css('opacity');
// check for images - this code is here (i.e. executed each time we show the tip and not on init) due to some browser inconsistencies
var bgImage = this.$tip.css('background-image').match(reBgImage),
arrow = this.$arrow.css('background-image').match(reBgImage);
if (bgImage) {
var bgImagePNG = rePNG.test(bgImage[1]);
// fallback to background-color/padding/border in IE6 if a PNG is used
if (ie6 && bgImagePNG) {
this.$tip.css('background-image', 'none');
this.$inner.css({margin: 0, border: 0, padding: 0});
bgImage = bgImagePNG = false;
} else {
this.$tip.prepend('<table class="fallback" border="0" cellpadding="0" cellspacing="0"><tr><td class="tip-top tip-bg-image" colspan="2"><span></span></td><td class="tip-right tip-bg-image" rowspan="2"><span></span></td></tr><tr><td class="tip-left tip-bg-image" rowspan="2"><span></span></td><td></td></tr><tr><td class="tip-bottom tip-bg-image" colspan="2"><span></span></td></tr></table>')
.css({border: 0, padding: 0, 'background-image': 'none', 'background-color': 'transparent'})
.find('.tip-bg-image').css('background-image', 'url("' + bgImage[1] +'")').end()
.find('td').eq(3).append(this.$inner);
}
// disable fade effect in IE due to Alpha filter + translucent PNG issue
if (bgImagePNG && !$.support.opacity)
this.opts.fade = false;
}
// IE arrow fixes
if (arrow && !$.support.opacity) {
// disable arrow in IE6 if using a PNG
if (ie6 && rePNG.test(arrow[1])) {
arrow = false;
this.$arrow.css('background-image', 'none');
}
// disable fade effect in IE due to Alpha filter + translucent PNG issue
this.opts.fade = false;
}
var $table = this.$tip.find('table.fallback');
if (ie6) {
// fix min/max-width in IE6
this.$tip[0].style.width = '';
$table.width('auto').find('td').eq(3).width('auto');
var tipW = this.$tip.width(),
minW = parseInt(this.$tip.css('min-width'), 10),
maxW = parseInt(this.$tip.css('max-width'), 10);
if (!isNaN(minW) && tipW < minW)
tipW = minW;
else if (!isNaN(maxW) && tipW > maxW)
tipW = maxW;
this.$tip.add($table).width(tipW).eq(0).find('td').eq(3).width('100%');
} else if ($table[0]) {
// fix the table width if we are using a background image
// IE9, FF4 use float numbers for width/height so use getComputedStyle for them to avoid text wrapping
// for details look at: http://vadikom.com/dailies/offsetwidth-offsetheight-useless-in-ie9-firefox4/
$table.width('auto').find('td').eq(3).width('auto').end().end().width(document.defaultView && document.defaultView.getComputedStyle && parseFloat(document.defaultView.getComputedStyle(this.$tip[0], null).width) || this.$tip.width()).find('td').eq(3).width('100%');
}
this.tipOuterW = this.$tip.outerWidth();
this.tipOuterH = this.$tip.outerHeight();
this.calcPos();
// position and show the arrow image
if (arrow && this.pos.arrow) {
this.$arrow[0].className = 'tip-arrow tip-arrow-' + this.pos.arrow;
this.$arrow.css('visibility', 'inherit');
}
if (async) {
this.asyncAnimating = true;
var self = this;
this.$tip.css(currPos).animate({left: this.pos.l, top: this.pos.t}, 200, function() { self.asyncAnimating = false; });
} else {
this.$tip.css({left: this.pos.l, top: this.pos.t});
}
};
}
/*jshinteqeqeq: true, curly: true*/
}(window.jQuery));
/**
jQuery UI Datepicker.
Description and examples: http://jqueryui.com/datepicker.
This input is also accessible as **date** type. Do not use it together with __bootstrap-datepicker__ as both apply <code>$().datepicker()</code> method.
For **i18n** you should include js file from here: https://github.com/jquery/jquery-ui/tree/master/ui/i18n.
@class dateui
@extends abstractinput
@final
@example
<a href="#" id="dob" data-type="date" data-pk="1" data-url="/post" data-title="Select date">15/05/1984</a>
<script>
$(function(){
$('#dob').editable({
format: 'yyyy-mm-dd',
viewformat: 'dd/mm/yyyy',
datepicker: {
firstDay: 1
}
}
});
});
</script>
**/
(function ($) {
"use strict";
var DateUI = function (options) {
this.init('dateui', options, DateUI.defaults);
this.initPicker(options, DateUI.defaults);
};
$.fn.editableutils.inherit(DateUI, $.fn.editabletypes.abstractinput);
$.extend(DateUI.prototype, {
initPicker: function(options, defaults) {
//by default viewformat equals to format
if(!this.options.viewformat) {
this.options.viewformat = this.options.format;
}
//correct formats: replace yyyy with yy (for compatibility with bootstrap datepicker)
this.options.viewformat = this.options.viewformat.replace('yyyy', 'yy');
this.options.format = this.options.format.replace('yyyy', 'yy');
//overriding datepicker config (as by default jQuery extend() is not recursive)
//since 1.4 datepicker internally uses viewformat instead of format. Format is for submit only
this.options.datepicker = $.extend({}, defaults.datepicker, options.datepicker, {
dateFormat: this.options.viewformat
});
},
render: function () {
this.$input.datepicker(this.options.datepicker);
//"clear" link
if(this.options.clear) {
this.$clear = $('<a href="#"></a>').html(this.options.clear).click($.proxy(function(e){
e.preventDefault();
e.stopPropagation();
this.clear();
}, this));
this.$tpl.parent().append($('<div class="editable-clear">').append(this.$clear));
}
},
value2html: function(value, element) {
var text = $.datepicker.formatDate(this.options.viewformat, value);
DateUI.superclass.value2html.call(this, text, element);
},
html2value: function(html) {
if(typeof html !== 'string') {
return html;
}
//if string does not match format, UI datepicker throws exception
var d;
try {
d = $.datepicker.parseDate(this.options.viewformat, html);
} catch(e) {}
return d;
},
value2str: function(value) {
return $.datepicker.formatDate(this.options.format, value);
},
str2value: function(str) {
if(typeof str !== 'string') {
return str;
}
//if string does not match format, UI datepicker throws exception
var d;
try {
d = $.datepicker.parseDate(this.options.format, str);
} catch(e) {}
return d;
},
value2submit: function(value) {
return this.value2str(value);
},
value2input: function(value) {
this.$input.datepicker('setDate', value);
},
input2value: function() {
return this.$input.datepicker('getDate');
},
activate: function() {
},
clear: function() {
this.$input.datepicker('setDate', null);
// submit automatically whe that are no buttons
if(this.isAutosubmit) {
this.submit();
}
},
autosubmit: function() {
this.isAutosubmit = true;
this.$input.on('mouseup', 'table.ui-datepicker-calendar a.ui-state-default', $.proxy(this.submit, this));
},
submit: function() {
var $form = this.$input.closest('form');
setTimeout(function() {
$form.submit();
}, 200);
}
});
DateUI.defaults = $.extend({}, $.fn.editabletypes.abstractinput.defaults, {
/**
@property tpl
@default <div></div>
**/
tpl:'<div class="editable-date"></div>',
/**
@property inputclass
@default null
**/
inputclass: null,
/**
Format used for sending value to server. Also applied when converting date from <code>data-value</code> attribute.<br>
Full list of tokens: http://docs.jquery.com/UI/Datepicker/formatDate
@property format
@type string
@default yyyy-mm-dd
**/
format:'yyyy-mm-dd',
/**
Format used for displaying date. Also applied when converting date from element's text on init.
If not specified equals to <code>format</code>
@property viewformat
@type string
@default null
**/
viewformat: null,
/**
Configuration of datepicker.
Full list of options: http://api.jqueryui.com/datepicker
@property datepicker
@type object
@default {
firstDay: 0,
changeYear: true,
changeMonth: true
}
**/
datepicker: {
firstDay: 0,
changeYear: true,
changeMonth: true,
showOtherMonths: true
},
/**
Text shown as clear date button.
If <code>false</code> clear button will not be rendered.
@property clear
@type boolean|string
@default 'x clear'
**/
clear: '× clear'
});
$.fn.editabletypes.dateui = DateUI;
}(window.jQuery));
/**
jQuery UI datefield input - modification for inline mode.
Shows normal <input type="text"> and binds popup datepicker.
Automatically shown in inline mode.
@class dateuifield
@extends dateui
@since 1.4.0
**/
(function ($) {
"use strict";
var DateUIField = function (options) {
this.init('dateuifield', options, DateUIField.defaults);
this.initPicker(options, DateUIField.defaults);
};
$.fn.editableutils.inherit(DateUIField, $.fn.editabletypes.dateui);
$.extend(DateUIField.prototype, {
render: function () {
// this.$input = this.$tpl.find('input');
this.$input.datepicker(this.options.datepicker);
$.fn.editabletypes.text.prototype.renderClear.call(this);
},
value2input: function(value) {
this.$input.val($.datepicker.formatDate(this.options.viewformat, value));
},
input2value: function() {
return this.html2value(this.$input.val());
},
activate: function() {
$.fn.editabletypes.text.prototype.activate.call(this);
},
toggleClear: function() {
$.fn.editabletypes.text.prototype.toggleClear.call(this);
},
autosubmit: function() {
//reset autosubmit to empty
}
});
DateUIField.defaults = $.extend({}, $.fn.editabletypes.dateui.defaults, {
/**
@property tpl
@default <input type="text">
**/
tpl: '<input type="text"/>',
/**
@property inputclass
@default null
**/
inputclass: null,
/* datepicker config */
datepicker: {
showOn: "button",
buttonImage: "http://jqueryui.com/resources/demos/datepicker/images/calendar.gif",
buttonImageOnly: true,
firstDay: 0,
changeYear: true,
changeMonth: true,
showOtherMonths: true
},
/* disable clear link */
clear: false
});
$.fn.editabletypes.dateuifield = DateUIField;
}(window.jQuery));
|
const { GraphQLClient } = require('graphql-request')
const { hasuraConfig } = require('../config')
module.exports = new GraphQLClient(hasuraConfig.url, {
headers: {
'x-hasura-admin-secret': hasuraConfig.adminSecret
}
})
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
import * as React from "react";
import styled from "styled-components";
import { space, color } from "styled-system";
var Svg = styled("svg")({
flex: "none"
}, space, color);
var SvgSignalWifi4BarLock = React.forwardRef(function (props, ref) {
return React.createElement(Svg, _extends({}, props, {
viewBox: "0 0 24 24",
height: props.size,
width: props.size,
fill: "currentcolor",
ref: ref
}), React.createElement("path", {
fill: "none",
d: "M0 0h24v24H0V0z"
}), React.createElement("path", {
d: "M23 16v-1.5c0-1.4-1.1-2.5-2.5-2.5S18 13.1 18 14.5V16c-.5 0-1 .5-1 1v4c0 .5.5 1 1 1h5c.5 0 1-.5 1-1v-4c0-.5-.5-1-1-1zm-1 0h-3v-1.5c0-.8.7-1.5 1.5-1.5s1.5.7 1.5 1.5V16zm-6.5-1.5c0-2.8 2.2-5 5-5 .4 0 .7 0 1 .1L23.6 7c-.4-.3-4.9-4-11.6-4C5.3 3 .8 6.7.4 7L12 21.5l3.5-4.4v-2.6z"
}));
});
SvgSignalWifi4BarLock.displayName = "SvgSignalWifi4BarLock";
SvgSignalWifi4BarLock.defaultProps = {
size: 24,
color: "inherit"
};
export default SvgSignalWifi4BarLock;
|
var keys_original = Cache.prototype.keys;
var match_original = Cache.prototype.match;
var matchAll_original = Cache.prototype.matchAll;
var delete_original = Cache.prototype.delete;
importScripts('../lib/index.js');
var tests = {
// init
ignoreSearch_store: function(e) {
return ignoreSearchPrepare().then(function() {
return createResponse({});
});
},
// other
'ignoreSearch_keysRequest:no-polyfill': function(e) {
return caches.open('ignoreSearch').then(function(cache) {
return keys_original.call(cache, '/ignoreSearch');
}).then(mapKeys).then(function(data) {
return createResponse(data);
});
},
// match()
ignoreSearch_matchIgnoreNoQuery: function(e) {
return caches.open('ignoreSearch').then(function(cache) {
return cache.match('/ignoreSearch', {
ignoreSearch: true
});
}).then(function(response) {
return response || createResponse({
cached: false
});
});
},
ignoreSearch_matchNoQuery: function(e) {
return caches.open('ignoreSearch').then(function(cache) {
return cache.match('/ignoreSearch', {
ignoreSearch: false
});
}).then(function(response) {
return response || createResponse({
cached: false
});
});
},
ignoreSearch_matchIgnoreWithQuery: function(e) {
return caches.open('ignoreSearch').then(function(cache) {
return cache.match('/ignoreSearch?3', {
ignoreSearch: true
});
}).then(function(response) {
return response || createResponse({
cached: false
});
});
},
ignoreSearch_matchWithQuery: function(e) {
return caches.open('ignoreSearch').then(function(cache) {
return cache.match('/ignoreSearch?3', {
ignoreSearch: false
});
}).then(function(response) {
return response || createResponse({
cached: false
});
});
},
ignoreSearch_matchIgnoreNoMatch: function(e) {
return caches.open('ignoreSearch').then(function(cache) {
return cache.match('/__noMatch', {
ignoreSearch: true
});
}).then(function(response) {
return response || createResponse({
cached: false
});
});
},
ignoreSearch_matchNoMatch: function(e) {
return caches.open('ignoreSearch').then(function(cache) {
return cache.match('/__noMatch', {
ignoreSearch: false
});
}).then(function(response) {
return response || createResponse({
cached: false
});
});
},
// matchAll()
ignoreSearch_matchAllIgnoreNoQuery: function(e) {
return caches.open('ignoreSearch').then(function(cache) {
return cache.matchAll('/ignoreSearch', {
ignoreSearch: true
});
}).then(function(responses) {
const result = responses.map(function(response) {
return (response || createResponse({
cached: false
})).json();
});
return Promise.all(result).then(function(data) {
return createResponse(data);
});
});
},
ignoreSearch_matchAllNoQuery: function(e) {
return caches.open('ignoreSearch').then(function(cache) {
return cache.matchAll('/ignoreSearch', {
ignoreSearch: false
});
}).then(function(responses) {
const result = responses.map(function(response) {
return (response || createResponse({
cached: false
})).json();
});
return Promise.all(result).then(function(data) {
return createResponse(data);
});
});
},
ignoreSearch_matchAllIgnoreWithQuery: function(e) {
return caches.open('ignoreSearch').then(function(cache) {
return cache.matchAll('/ignoreSearch?3', {
ignoreSearch: true
});
}).then(function(responses) {
const result = responses.map(function(response) {
return (response || createResponse({
cached: false
})).json();
});
return Promise.all(result).then(function(data) {
return createResponse(data);
});
});
},
ignoreSearch_matchAllWithQuery: function(e) {
return caches.open('ignoreSearch').then(function(cache) {
return cache.matchAll('/ignoreSearch?3', {
ignoreSearch: false
});
}).then(function(responses) {
const result = responses.map(function(response) {
return (response || createResponse({
cached: false
})).json();
});
return Promise.all(result).then(function(data) {
return createResponse(data);
});
});
},
ignoreSearch_matchAllIgnoreNoMatch: function(e) {
return caches.open('ignoreSearch').then(function(cache) {
return cache.matchAll('/__noMatch', {
ignoreSearch: true
});
}).then(function(responses) {
const result = responses.map(function(response) {
return (response || createResponse({
cached: false
})).json();
});
return Promise.all(result).then(function(data) {
return createResponse(data);
});
});
},
ignoreSearch_matchAllNoMatch: function(e) {
return caches.open('ignoreSearch').then(function(cache) {
return cache.matchAll('/__noMatch', {
ignoreSearch: false
});
}).then(function(responses) {
const result = responses.map(function(response) {
return (response || createResponse({
cached: false
})).json();
});
return Promise.all(result).then(function(data) {
return createResponse(data);
});
});
},
// keys()
ignoreSearch_keysRequest: function(e) {
return caches.open('ignoreSearch').then(function(cache) {
return cache.keys('/ignoreSearch');
}).then(mapKeys).then(function(data) {
return createResponse(data);
});
},
ignoreSearch_keysNoRequest: function(e) {
return caches.open('ignoreSearch').then(function(cache) {
return cache.keys();
}).then(mapKeys).then(function(data) {
return createResponse(data);
});
},
// keys(request)
ignoreSearch_keysIgnoreNoQuery: function(e) {
return caches.open('ignoreSearch').then(function(cache) {
return cache.keys('/ignoreSearch', {
ignoreSearch: true
});
}).then(mapKeys).then(function(data) {
return createResponse(data);
});
},
ignoreSearch_keysNoQuery: function(e) {
return caches.open('ignoreSearch').then(function(cache) {
return cache.keys('/ignoreSearch', {
ignoreSearch: false
});
}).then(mapKeys).then(function(data) {
return createResponse(data);
});
},
ignoreSearch_keysIgnoreWithQuery: function(e) {
return caches.open('ignoreSearch').then(function(cache) {
return cache.keys('/ignoreSearch?3', {
ignoreSearch: true
});
}).then(mapKeys).then(function(data) {
return createResponse(data);
});
},
ignoreSearch_keysWithQuery: function(e) {
return caches.open('ignoreSearch').then(function(cache) {
return cache.keys('/ignoreSearch?3', {
ignoreSearch: false
});
}).then(mapKeys).then(function(data) {
return createResponse(data);
});
},
ignoreSearch_keysIgnoreNoMatch: function(e) {
return caches.open('ignoreSearch').then(function(cache) {
return cache.keys('/__noMatch', {
ignoreSearch: true
});
}).then(mapKeys).then(function(data) {
return createResponse(data);
});
},
ignoreSearch_keysNoMatch: function(e) {
return caches.open('ignoreSearch').then(function(cache) {
return cache.keys('/__noMatch', {
ignoreSearch: false
});
}).then(mapKeys).then(function(data) {
return createResponse(data);
});
},
// delete()
ignoreSearch_deleteIgnoreNoQuery: function(e) {
return caches.open('ignoreSearch').then(function(cache) {
return deleteHelper(cache, '/ignoreSearch', {
ignoreSearch: true
});
}).then(function(data) {
return ignoreSearchPrepare().then(function() {
return data;
})
}).then(function(data) {
return createResponse(data);
});
},
ignoreSearch_deleteNoQuery: function(e) {
return caches.open('ignoreSearch').then(function(cache) {
return deleteHelper(cache, '/ignoreSearch', {
ignoreSearch: false
});
}).then(function(data) {
return ignoreSearchPrepare().then(function() {
return data;
})
}).then(function(data) {
return createResponse(data);
});
},
ignoreSearch_deleteIgnoreWithQuery: function(e) {
return caches.open('ignoreSearch').then(function(cache) {
return deleteHelper(cache, '/ignoreSearch?3', {
ignoreSearch: true
});
}).then(function(data) {
return ignoreSearchPrepare().then(function() {
return data;
})
}).then(function(data) {
return createResponse(data);
});
},
ignoreSearch_deleteWithQuery: function(e) {
return caches.open('ignoreSearch').then(function(cache) {
return deleteHelper(cache, '/ignoreSearch?3', {
ignoreSearch: false
});
}).then(function(data) {
return ignoreSearchPrepare().then(function() {
return data;
})
}).then(function(data) {
return createResponse(data);
});
},
ignoreSearch_deleteIgnoreNoMatch: function(e) {
return caches.open('ignoreSearch').then(function(cache) {
return deleteHelper(cache, '/__noMatch', {
ignoreSearch: true
});
}).then(function(data) {
return ignoreSearchPrepare().then(function() {
return data;
})
}).then(function(data) {
return createResponse(data);
});
},
ignoreSearch_deleteNoMatch: function(e) {
return caches.open('ignoreSearch').then(function(cache) {
return deleteHelper(cache, '/__noMatch', {
ignoreSearch: true
});
}).then(function(data) {
return ignoreSearchPrepare().then(function() {
return data;
})
}).then(function(data) {
return createResponse(data);
});
},
// CacheStorage.match()
ignoreSearch_storageMatchIgnoreNoQuery: function(e) {
return caches.match('/ignoreSearch', {
cacheName: 'ignoreSearch',
ignoreSearch: true
}).then(function(response) {
return response || createResponse({
cached: false
});
});
},
ignoreSearch_storageMatchNoQuery: function(e) {
return caches.match('/ignoreSearch', {
cacheName: 'ignoreSearch',
ignoreSearch: false
}).then(function(response) {
return response || createResponse({
cached: false
});
});
},
ignoreSearch_storageMatchIgnoreWithQuery: function(e) {
return caches.match('/ignoreSearch?3', {
cacheName: 'ignoreSearch',
ignoreSearch: true
}).then(function(response) {
return response || createResponse({
cached: false
});
});
},
ignoreSearch_storageMatchWithQuery: function(e) {
return caches.match('/ignoreSearch?3', {
cacheName: 'ignoreSearch',
ignoreSearch: false
}).then(function(response) {
return response || createResponse({
cached: false
});
});
},
// CacheStorage.match() no cacheName
ignoreSearch_storageMatchNoCacheIgnoreNoQuery: function(e) {
return caches.match('/ignoreSearch', {
ignoreSearch: true
}).then(function(response) {
return response || createResponse({
cached: false
});
});
},
ignoreSearch_storageMatchNoCacheNoQuery: function(e) {
return caches.match('/ignoreSearch', {
ignoreSearch: false
}).then(function(response) {
return response || createResponse({
cached: false
});
});
},
ignoreSearch_storageMatchNoCacheIgnoreWithQuery: function(e) {
return caches.match('/ignoreSearch?3', {
ignoreSearch: true
}).then(function(response) {
return response || createResponse({
cached: false
});
});
},
ignoreSearch_storageMatchNoCacheWithQuery: function(e) {
return caches.match('/ignoreSearch?3', {
ignoreSearch: false
}).then(function(response) {
return response || createResponse({
cached: false
});
});
},
};
function ignoreSearchPrepare() {
return Promise.all([
caches.delete('ignoreSearch'),
caches.delete('ignoreSearchObstacle'),
]).then(function() {
return Promise.all([
caches.open('ignoreSearch'),
caches.open('ignoreSearchObstacle')
]);
}).then(function(args) {
const cache = args[0];
const obstacleCache = args[1];
return Promise.all([
putSeries(cache, [
['/__ignoreSearch', createResponse({
cached: true,
index: -1
})],
['/ignoreSearch?1', createResponse({
cached: true,
index: 1
})],
['/ignoreSearch?2', createResponse({
cached: true,
index: 2
})],
['/ignoreSearch?3', createResponse({
cached: true,
index: 3
})],
['/ignoreSearch', createResponse({
cached: true,
index: 4
})],
]),
obstacleCache.put('/ignoreSearch?10', createResponse({
cached: true,
index: 10,
obstacle: true
})),
]);
});
}
function deleteHelper(cache, request, options) {
const data = {};
return cache.delete(request, options)
.then(function(deleted) {
data.deleted = deleted;
return keys_original.call(cache);
})
.then(mapKeys)
.then(function(keys) {
data.keys = keys;
return data;
});
}
function mapKeys(keys) {
return keys.map(function(req) {
var url = new URL(req.url);
return url.pathname + url.search;
});
}
self.addEventListener('install', function(e) {
e.waitUntil(self.skipWaiting());
});
self.addEventListener('activate', function(e) {
var activation = caches.keys().then(function(keys) {
const result = keys.map(function(cacheName) {
return caches.delete(cacheName);
});
return Promise.all(result);
}).then(function() {
return self.clients.claim();
});
e.waitUntil(activation);
});
self.addEventListener('fetch', function(e) {
var url = new URL(e.request.url);
var test = url.pathname.match(/^\/tests\/test_([\s\S]+?)$/);
test = test && tests[test[1]];
if (test) {
e.respondWith(test(e));
}
});
function createResponse(data) {
return new Response(JSON.stringify(data), {
status: 200,
statusText: 'OK',
headers: {
'Content-Type': 'application/json',
}
});
}
function putSeries(cache, arr) {
return arr.reduce(function(prev, args) {
return prev.then(function() {
return cache.put.apply(cache, args);
});
}, Promise.resolve());
}
|
var NAVTREEINDEX0 =
{
"_behaviors_8cs.html":[4,0,1,2,0],
"_behaviors_8cs.html#a6fd01b5707c1d4d9f0dc01b1355b4a10":[4,0,1,2,0,0],
"_behaviors_8cs.html#a6fd01b5707c1d4d9f0dc01b1355b4a10a25ee2cfda0331134393e7223fb750820":[4,0,1,2,0,0,0],
"_behaviors_8cs.html#a6fd01b5707c1d4d9f0dc01b1355b4a10a31771640c91759c243f311f8c250aacc":[4,0,1,2,0,0,2],
"_behaviors_8cs.html#a6fd01b5707c1d4d9f0dc01b1355b4a10a6d966554a8809330279e8fa135673f4c":[4,0,1,2,0,0,1],
"_blinky_8cs.html":[4,0,1,2,1],
"_clyde_8cs.html":[4,0,1,2,2],
"_debug_2netcoreapp3_81_2_thief-_game_8_assembly_info_8cs.html":[4,0,1,3,0,0,1],
"_debug_2netcoreapp3_81_2_thief___game_test_8_assembly_info_8cs.html":[4,0,2,0,0,0,1],
"_debug_2netstandard2_80_2_8_n_e_t_standard_00_version_0av2_80_8_assembly_attributes_8cs.html":[4,0,0,0,0,0,0],
"_debug_2netstandard2_80_2_path_finder_8_assembly_info_8cs.html":[4,0,0,0,0,0,1],
"_dimensions_8cs.html":[4,0,1,0,0],
"_game_8cs.html":[4,0,1,6],
"_graph_8cs.html":[4,0,0,1],
"_i_movable_8cs.html":[4,0,1,7],
"_id_generator_8cs.html":[4,0,0,2],
"_inky_8cs.html":[4,0,1,2,3],
"_key_codes_8cs.html":[4,0,1,0,1],
"_level_loader_8cs.html":[4,0,1,1,0],
"_level_parser_8cs.html":[4,0,1,0,2],
"_level_pattern_8cs.html":[4,0,1,1,1],
"_main_menu_8_designer_8cs.html":[4,0,1,9],
"_main_menu_8cs.html":[4,0,1,8],
"_map_8cs.html":[4,0,1,10],
"_monster_8cs.html":[4,0,1,2,4],
"_monster_types_8cs.html":[4,0,1,2,5],
"_monster_types_8cs.html#a5ad9fd3de8a9bd665b44fbdf1e92762e":[4,0,1,2,5,0],
"_monster_types_8cs.html#a5ad9fd3de8a9bd665b44fbdf1e92762ea28026022e0c447baf5e5e9606c0976f0":[4,0,1,2,5,0,2],
"_monster_types_8cs.html#a5ad9fd3de8a9bd665b44fbdf1e92762ea33257d86a4b1866bc300ca2c369eb098":[4,0,1,2,5,0,1],
"_monster_types_8cs.html#a5ad9fd3de8a9bd665b44fbdf1e92762eab4c6e605875a527843ffd9a939d1a668":[4,0,1,2,5,0,3],
"_monster_types_8cs.html#a5ad9fd3de8a9bd665b44fbdf1e92762eadec0198dd0f18b233339de93ee59b64b":[4,0,1,2,5,0,0],
"_monster_view_loader_8cs.html":[4,0,1,2,6],
"_movable_game_object_8cs.html":[4,0,1,11],
"_move_intensions_8cs.html":[4,0,1,12],
"_move_intensions_8cs.html#ac9ace69ec7e64dd22cb2badfb08bd350":[4,0,1,12,0],
"_move_intensions_8cs.html#ac9ace69ec7e64dd22cb2badfb08bd350a21507b40c80068eda19865706fdc2403":[4,0,1,12,0,2],
"_move_intensions_8cs.html#ac9ace69ec7e64dd22cb2badfb08bd350a684d325a7303f52e64011467ff5c5758":[4,0,1,12,0,3],
"_move_intensions_8cs.html#ac9ace69ec7e64dd22cb2badfb08bd350ac4e0e4e3118472beeb2ae75827450f1f":[4,0,1,12,0,1],
"_move_intensions_8cs.html#ac9ace69ec7e64dd22cb2badfb08bd350afbaedde498cdead4f2780217646e9ba1":[4,0,1,12,0,0],
"_pacman_8cs.html":[4,0,1,13],
"_path_info_8cs.html":[4,0,1,0,3],
"_pinky_8cs.html":[4,0,1,2,7],
"_program_8cs.html":[4,0,1,14],
"_r_e_a_d_m_e_8_m_d.html":[4,0,4],
"_release_2netcoreapp3_81_2_thief-_game_8_assembly_info_8cs.html":[4,0,1,3,1,0,1],
"_release_2netcoreapp3_81_2_thief___game_test_8_assembly_info_8cs.html":[4,0,2,0,1,0,1],
"_release_2netstandard2_80_2_8_n_e_t_standard_00_version_0av2_80_8_assembly_attributes_8cs.html":[4,0,0,0,1,0,0],
"_release_2netstandard2_80_2_path_finder_8_assembly_info_8cs.html":[4,0,0,0,1,0,1],
"_resources_8_designer_8cs.html":[4,0,1,4,0],
"_scene_8cs.html":[4,0,1,15],
"_score_board_8_designer_8cs.html":[4,0,1,17],
"_score_board_8cs.html":[4,0,1,16],
"_score_point_8cs.html":[4,0,1,18],
"_test_level_pattern_8cs.html":[4,0,2,1],
"_thief-_game_2obj_2_debug_2netcoreapp3_81_2_8_n_e_t_core_app_00_version_0av3_81_8_assembly_attributes_8cs.html":[4,0,1,3,0,0,0],
"_thief-_game_2obj_2_release_2netcoreapp3_81_2_8_n_e_t_core_app_00_version_0av3_81_8_assembly_attributes_8cs.html":[4,0,1,3,1,0,0],
"_thief___game_test_2obj_2_debug_2netcoreapp3_81_2_8_n_e_t_core_app_00_version_0av3_81_8_assembly_attributes_8cs.html":[4,0,2,0,0,0,0],
"_thief___game_test_2obj_2_release_2netcoreapp3_81_2_8_n_e_t_core_app_00_version_0av3_81_8_assembly_attributes_8cs.html":[4,0,2,0,1,0,0],
"_wall_8cs.html":[4,0,1,19],
"_waypoint_8cs.html":[4,0,0,3],
"_world_stat_8cs.html":[4,0,1,5,0],
"_world_stat_pickle_8cs.html":[4,0,1,5,1],
"annotated.html":[3,0],
"class_path_finder_1_1_graph.html":[3,0,0,0],
"class_path_finder_1_1_graph.html#a02f011cf10a99bafe77d9aa287c38be9":[3,0,0,0,4],
"class_path_finder_1_1_graph.html#a0353bd3720f028a329ed1915a3e73458":[3,0,0,0,8],
"class_path_finder_1_1_graph.html#a21fe88c11b941444aaa838a89f9f40ed":[3,0,0,0,9],
"class_path_finder_1_1_graph.html#a41970c08ec4fb64f881022c07548f8d7":[3,0,0,0,10],
"class_path_finder_1_1_graph.html#a45617c6fc526cd21d465ddf86fc73828":[3,0,0,0,1],
"class_path_finder_1_1_graph.html#a5d0dc5010edcae5de1446ba66ceae752":[3,0,0,0,5],
"class_path_finder_1_1_graph.html#a6b81c03c10ba2052ae660d0b2863483e":[3,0,0,0,2],
"class_path_finder_1_1_graph.html#a756d663d6d6283723f95ff4591ea2d51":[3,0,0,0,6],
"class_path_finder_1_1_graph.html#a790d61a20ab77529c7780987a2843f1f":[3,0,0,0,11],
"class_path_finder_1_1_graph.html#a8abbf7fd3938231c796d03eae03abb0c":[3,0,0,0,12],
"class_path_finder_1_1_graph.html#a9270e56a0bd263ce7f505f2d5031ea92":[3,0,0,0,3],
"class_path_finder_1_1_graph.html#ab9ac1781effde6c65ae7614a5b319276":[3,0,0,0,7],
"class_path_finder_1_1_graph.html#ac7dad9a2ba9e709752c9c7261e809260":[3,0,0,0,0],
"class_path_finder_1_1_id_generator.html":[3,0,0,1],
"class_path_finder_1_1_id_generator.html#a3ef68887b94f20f2c92056f355d74c4b":[3,0,0,1,1],
"class_path_finder_1_1_id_generator.html#a91161d9b9feb76389ee81e7edb3ec128":[3,0,0,1,0],
"class_path_finder_1_1_waypoint.html":[3,0,0,2],
"class_path_finder_1_1_waypoint.html#a11bc2408ad98f245bda5bd0e617773af":[3,0,0,2,2],
"class_path_finder_1_1_waypoint.html#a4ac06a7347704d7a18503c063c9a2e39":[3,0,0,2,8],
"class_path_finder_1_1_waypoint.html#a4cb4d18396b354a30c05ab1543a35446":[3,0,0,2,4],
"class_path_finder_1_1_waypoint.html#a58a68380f379b09024aeaf79ca1a0f90":[3,0,0,2,6],
"class_path_finder_1_1_waypoint.html#a5f3bd47550520fdc4508bec214dc395c":[3,0,0,2,0],
"class_path_finder_1_1_waypoint.html#a784729459d8527ec799d88f71de64e92":[3,0,0,2,1],
"class_path_finder_1_1_waypoint.html#aa4bdd5d893569dbd5a1f720e6a4dc8fe":[3,0,0,2,7],
"class_path_finder_1_1_waypoint.html#ada10c3094a6054e2cd30c260c7b865f5":[3,0,0,2,3],
"class_path_finder_1_1_waypoint.html#adcb8c6982deabe584602a3df0de7401b":[3,0,0,2,5],
"class_thief___game_1_1_blinky.html":[3,0,1,3],
"class_thief___game_1_1_blinky.html#a58fe6563692df5b1cb6b94ce393edcf0":[3,0,1,3,1],
"class_thief___game_1_1_blinky.html#a9c8cd1b8b5d880938778ef94597a4075":[3,0,1,3,0],
"class_thief___game_1_1_constants_1_1_key_codes.html":[3,0,1,0,0],
"class_thief___game_1_1_constants_1_1_key_codes.html#a43140188c3639e26b8a3f8c4496082b3":[3,0,1,0,0,2],
"class_thief___game_1_1_constants_1_1_key_codes.html#a5333606c9c5f4e148a035919907c854c":[3,0,1,0,0,3],
"class_thief___game_1_1_constants_1_1_key_codes.html#a5e0f6688ef53f3cf31161531b8634272":[3,0,1,0,0,0],
"class_thief___game_1_1_constants_1_1_key_codes.html#aec176f619d091c24e61168262951afc9":[3,0,1,0,0,1],
"class_thief___game_1_1_constants_1_1_level_parser.html":[3,0,1,0,1],
"class_thief___game_1_1_constants_1_1_level_parser.html#a0306f1212e2c84730a211cb050def62b":[3,0,1,0,1,6],
"class_thief___game_1_1_constants_1_1_level_parser.html#a3ffedd1b523154b4c847701a47818f19":[3,0,1,0,1,3],
"class_thief___game_1_1_constants_1_1_level_parser.html#a4f127273f5658fc2669f89b3319760cf":[3,0,1,0,1,2],
"class_thief___game_1_1_constants_1_1_level_parser.html#a5f7965cffd2b95fbbb6fbd4c3203e049":[3,0,1,0,1,8],
"class_thief___game_1_1_constants_1_1_level_parser.html#aa90aab0847047696f1409b67d54935d1":[3,0,1,0,1,1],
"class_thief___game_1_1_constants_1_1_level_parser.html#aaf4be03505b4ee1ef14c056486945487":[3,0,1,0,1,5],
"class_thief___game_1_1_constants_1_1_level_parser.html#ad3a98440ed925dd714f12198a2de029f":[3,0,1,0,1,7],
"class_thief___game_1_1_constants_1_1_level_parser.html#aed7b8e2f5a4d652362c352ee4d4cdc17":[3,0,1,0,1,0],
"class_thief___game_1_1_constants_1_1_level_parser.html#afe9439471674fd4fe04b535f0854f3ca":[3,0,1,0,1,4],
"class_thief___game_1_1_dimensions.html":[3,0,1,4],
"class_thief___game_1_1_dimensions.html#a118ad32b9e129dd980aec9c8bd1bb660":[3,0,1,4,1],
"class_thief___game_1_1_dimensions.html#a11b6b9a7f545b4354e0e828f1bb3449f":[3,0,1,4,8],
"class_thief___game_1_1_dimensions.html#a28fa9ebee18246ceffc100e884d05e32":[3,0,1,4,2],
"class_thief___game_1_1_dimensions.html#a2d89eb4ac1dfc51efe3a0dd5d8e6ea35":[3,0,1,4,11],
"class_thief___game_1_1_dimensions.html#a5b8967e0194d71165ac19607fbf95aef":[3,0,1,4,10],
"class_thief___game_1_1_dimensions.html#a653dca4651003e864326f6be7b06e7e9":[3,0,1,4,3],
"class_thief___game_1_1_dimensions.html#a7f2c394bcddf5e7fa57f21eef1acd638":[3,0,1,4,9],
"class_thief___game_1_1_dimensions.html#ac58d6e2a398a659d834511dcfb486fcc":[3,0,1,4,7],
"class_thief___game_1_1_dimensions.html#ad3ec2dff3767797c21eeacb2c7d06068":[3,0,1,4,0],
"class_thief___game_1_1_dimensions.html#aee7e563eef5b19e7370384dbef07b20a":[3,0,1,4,6],
"class_thief___game_1_1_dimensions.html#af82bc2f0d6d31421eab2bfc4d5a129b7":[3,0,1,4,4],
"class_thief___game_1_1_dimensions.html#afb37b1ea309d23a2ab3ae1bacb59cd39":[3,0,1,4,5],
"class_thief___game_1_1_energizer.html":[3,0,1,5],
"class_thief___game_1_1_energizer.html#a1dd43b057fac1ad940cce4e7e582587d":[3,0,1,5,0],
"class_thief___game_1_1_game.html":[3,0,1,6],
"class_thief___game_1_1_game.html#a02083a5a85109e7424b3e10310b1dbdf":[3,0,1,6,3],
"class_thief___game_1_1_game.html#a61673deedf8eff9896f19fb40c4b9722":[3,0,1,6,2],
"class_thief___game_1_1_game.html#aa27c6af8c8affa6b30eaa1c5ce4ee010":[3,0,1,6,0],
"class_thief___game_1_1_game.html#ad07925910dc673ef430e33c00642d0ee":[3,0,1,6,1],
"class_thief___game_1_1_level_loader.html":[3,0,1,8],
"class_thief___game_1_1_level_loader.html#a18ee31ceb2009e7158042892dd9bc3ae":[3,0,1,8,1],
"class_thief___game_1_1_level_loader.html#a4377bf176e61a3dbf4f0019e7a7ce0db":[3,0,1,8,3],
"class_thief___game_1_1_level_loader.html#a891a71bcd50dc9d469c5cd207f498b70":[3,0,1,8,2],
"class_thief___game_1_1_level_loader.html#abe273c3a3c29c18cfd0224c8b46bd506":[3,0,1,8,0],
"class_thief___game_1_1_level_pattern.html":[3,0,1,9],
"class_thief___game_1_1_level_pattern.html#a044babf2c616635b141beb0e0a84e2fa":[3,0,1,9,2],
"class_thief___game_1_1_level_pattern.html#a12eb2be3f9eaaac74ac75702319904f6":[3,0,1,9,9],
"class_thief___game_1_1_level_pattern.html#a3080544c214d9b5593277c86fe76a211":[3,0,1,9,0],
"class_thief___game_1_1_level_pattern.html#a4803d80791bc11c0bf0832d1b6e83284":[3,0,1,9,10],
"class_thief___game_1_1_level_pattern.html#a4b53a2dee8393230f3a068f1fc7efe63":[3,0,1,9,3],
"class_thief___game_1_1_level_pattern.html#a7fef81ef59bd9f21d0cc7422db3d1511":[3,0,1,9,8],
"class_thief___game_1_1_level_pattern.html#a90b7aa07f731a1bf9e01fd3ca966c695":[3,0,1,9,6],
"class_thief___game_1_1_level_pattern.html#a947a8e1564e3231968399844cbdd3961":[3,0,1,9,7],
"class_thief___game_1_1_level_pattern.html#aaf060d8e4b09e4e6edbb405521ca8276":[3,0,1,9,4],
"class_thief___game_1_1_level_pattern.html#ad9242c550a4598f538b306955be3406e":[3,0,1,9,5],
"class_thief___game_1_1_level_pattern.html#ae39ecc3837687c7865589acb815435f9":[3,0,1,9,1],
"class_thief___game_1_1_main_menu.html":[3,0,1,10],
"class_thief___game_1_1_main_menu.html#a1ccab46d6a8935adc5aa8bd8ed1c7d05":[3,0,1,10,6],
"class_thief___game_1_1_main_menu.html#a32c5e955c2740709e83c3bbb1c69ef28":[3,0,1,10,1],
"class_thief___game_1_1_main_menu.html#a33f43b8836a33e08ad3fa61c3e69e463":[3,0,1,10,0],
"class_thief___game_1_1_main_menu.html#a3e75155acf26c24af8c2ea9fb47a7be7":[3,0,1,10,11],
"class_thief___game_1_1_main_menu.html#a511c2237d451993ae21e3da1059b9d87":[3,0,1,10,5],
"class_thief___game_1_1_main_menu.html#a59e4a63b014ff0edad5be0a09e9a993e":[3,0,1,10,10],
"class_thief___game_1_1_main_menu.html#aa39b34a3eb0a8ab8c9410d70a3f0629c":[3,0,1,10,7],
"class_thief___game_1_1_main_menu.html#aab534619bdc32d1fe2bdbab8550f69f6":[3,0,1,10,2],
"class_thief___game_1_1_main_menu.html#acc47ccd6aa2d71d32e408ecde7c34f65":[3,0,1,10,3],
"class_thief___game_1_1_main_menu.html#af141635038b60df4cd849397bd8cc971":[3,0,1,10,9],
"class_thief___game_1_1_main_menu.html#af21fd57fece1144fbcbc97894344858b":[3,0,1,10,8],
"class_thief___game_1_1_main_menu.html#af451cd7f337e9e0e8d8d89ff5bbb898f":[3,0,1,10,4],
"class_thief___game_1_1_main_menu.html#afda244d1702f8b1ffe334a3f568edd80":[3,0,1,10,12],
"class_thief___game_1_1_map.html":[3,0,1,11],
"class_thief___game_1_1_map.html#a09ad443435fd5eb9b2c0578dad0467a2":[3,0,1,11,13],
"class_thief___game_1_1_map.html#a0a55d0fba42f66fc388d5a7c3d9ab32d":[3,0,1,11,19],
"class_thief___game_1_1_map.html#a0f03003d86c51a55cf6fae351c99fe4f":[3,0,1,11,18],
"class_thief___game_1_1_map.html#a22d428b0d93a37250a77881a58c46e75":[3,0,1,11,24],
"class_thief___game_1_1_map.html#a24ca49b507bb39881481a6e4a25db05f":[3,0,1,11,16],
"class_thief___game_1_1_map.html#a25f443667b4f867f640bbdc566ba8fbe":[3,0,1,11,4],
"class_thief___game_1_1_map.html#a355250d5699f558fa86182b1def8083a":[3,0,1,11,10],
"class_thief___game_1_1_map.html#a3955ca12af5de046ae5c20b457b3cd1a":[3,0,1,11,30],
"class_thief___game_1_1_map.html#a3b5e60a36d5acfc2cb08cfc7016d06fc":[3,0,1,11,28],
"class_thief___game_1_1_map.html#a40818fa6920818829a3428bfbbb5ef72":[3,0,1,11,25],
"class_thief___game_1_1_map.html#a48fc00817a8db4ea98c5f84f76343adc":[3,0,1,11,15],
"class_thief___game_1_1_map.html#a4b067a8516fcc32c47588d9c49871737":[3,0,1,11,26],
"class_thief___game_1_1_map.html#a51340e0a418a5dce6c098a120d881d5c":[3,0,1,11,2],
"class_thief___game_1_1_map.html#a5a6972f37664a9dd3f78823aff753f14":[3,0,1,11,23],
"class_thief___game_1_1_map.html#a66641e06ee29c5e522e517246f09c073":[3,0,1,11,0],
"class_thief___game_1_1_map.html#a757e39759212648cf71127ee64d93c5d":[3,0,1,11,11],
"class_thief___game_1_1_map.html#a75be8b2ea4084fbf30f65d1a752279c5":[3,0,1,11,33],
"class_thief___game_1_1_map.html#a846ffa7533a94f40b48e29f3ac8da002":[3,0,1,11,34],
"class_thief___game_1_1_map.html#a8e7f0cc0197a0d34c9adc1e9e568c7f9":[3,0,1,11,22],
"class_thief___game_1_1_map.html#a9a3bce638b13b70153fc907c13c7419a":[3,0,1,11,12],
"class_thief___game_1_1_map.html#a9d11a1c96e1844b27f48bfb8b3471404":[3,0,1,11,31],
"class_thief___game_1_1_map.html#aaae9e1af318c689bea0319d0a48160f8":[3,0,1,11,32],
"class_thief___game_1_1_map.html#aaf9cbab6bb458436f21f13615073c54c":[3,0,1,11,21],
"class_thief___game_1_1_map.html#ab1e572aff84498b2b3ab2c7a8bcdd54f":[3,0,1,11,5],
"class_thief___game_1_1_map.html#abb3583ff17ef42ac56ddf804c8f06ad6":[3,0,1,11,3],
"class_thief___game_1_1_map.html#ac5dd38e2197fbba11eeb5972b46f4adc":[3,0,1,11,8],
"class_thief___game_1_1_map.html#acb683e79d38bec26dedbb25b5b64c798":[3,0,1,11,1],
"class_thief___game_1_1_map.html#acd5a957f899d7a76f37e0a01182a4a8f":[3,0,1,11,29],
"class_thief___game_1_1_map.html#ad47b059fd8550fc2f10cf5a28acb2521":[3,0,1,11,7],
"class_thief___game_1_1_map.html#ad51236becf426d0fac86a224bcecfcac":[3,0,1,11,27],
"class_thief___game_1_1_map.html#ad8b964f8532c73bd9ce77e5bfca81339":[3,0,1,11,20],
"class_thief___game_1_1_map.html#adc3aa43dfdca4d94bc611db9ab2cf2f3":[3,0,1,11,6],
"class_thief___game_1_1_map.html#ae31c5053429e62c670319c6d8eaaed3a":[3,0,1,11,9],
"class_thief___game_1_1_map.html#ae61f3cdd0aae1279fd01b35c6789b387":[3,0,1,11,14],
"class_thief___game_1_1_map.html#af58dc7fd5e6d22f13aff445dd871507b":[3,0,1,11,17],
"class_thief___game_1_1_monster.html":[3,0,1,12],
"class_thief___game_1_1_monster.html#a14c7afbb93ee2be9a2d8381ef9566ad4":[3,0,1,12,4],
"class_thief___game_1_1_monster.html#a1e499e5c6593e5d6acac4dc6d083d97b":[3,0,1,12,16],
"class_thief___game_1_1_monster.html#a27bdaa3e47f16fbda5f72fc5e94163c5":[3,0,1,12,2],
"class_thief___game_1_1_monster.html#a29c431819c77e5dbf41c3269f57f75b0":[3,0,1,12,10],
"class_thief___game_1_1_monster.html#a48c5c09fc67ed473e79031759983b069":[3,0,1,12,1],
"class_thief___game_1_1_monster.html#a4d7518a07083066393e94bb33bc4c9bb":[3,0,1,12,3],
"class_thief___game_1_1_monster.html#a5866bb4b4871b72afb10b58727f3c603":[3,0,1,12,14],
"class_thief___game_1_1_monster.html#a5b01922e82531fd26ba6c986d01a7abd":[3,0,1,12,6],
"class_thief___game_1_1_monster.html#a64319fddc405487eb1b6c035cb99d9e5":[3,0,1,12,13],
"class_thief___game_1_1_monster.html#a68965cefc455e8f6e74ce4d7f378e4ae":[3,0,1,12,12],
"class_thief___game_1_1_monster.html#a6f088cfb2626802c1c1187475f325e15":[3,0,1,12,8],
"class_thief___game_1_1_monster.html#a7a56d5d3295e15132a468225b02c1d9d":[3,0,1,12,11],
"class_thief___game_1_1_monster.html#a85402a22fe6c3874092b014a3c80c5f5":[3,0,1,12,7],
"class_thief___game_1_1_monster.html#aa2a86c7084efa1d46e8145ca345641e2":[3,0,1,12,15],
"class_thief___game_1_1_monster.html#ac7a9bd2a502c1ae5b35114c8b16f1aa9":[3,0,1,12,5],
"class_thief___game_1_1_monster.html#ac95a9960e101715997babaf579ad198d":[3,0,1,12,9],
"class_thief___game_1_1_monster.html#aea185780567d216ca85b5d76ccb4a927":[3,0,1,12,0],
"class_thief___game_1_1_monster_view_loader.html":[3,0,1,13],
"class_thief___game_1_1_monster_view_loader.html#aa567d712583b0c193d90e6971e95d386":[3,0,1,13,0],
"class_thief___game_1_1_monsters_1_1_clyde.html":[3,0,1,1,0],
"class_thief___game_1_1_monsters_1_1_clyde.html#a7362a206a2fef7b28a03df7f2c17243d":[3,0,1,1,0,1],
"class_thief___game_1_1_monsters_1_1_clyde.html#aae6e9de2e2658c8b31f652845c2825f1":[3,0,1,1,0,0],
"class_thief___game_1_1_monsters_1_1_inky.html":[3,0,1,1,1],
"class_thief___game_1_1_monsters_1_1_inky.html#a5fdf4e6bdc09f3d435ec289ebcaec750":[3,0,1,1,1,0],
"class_thief___game_1_1_monsters_1_1_inky.html#aee0f5e9c562e5274ef1ed288254799fd":[3,0,1,1,1,1],
"class_thief___game_1_1_monsters_1_1_pinky.html":[3,0,1,1,2],
"class_thief___game_1_1_monsters_1_1_pinky.html#a23e001052910658e8ee2e7f6634d57ec":[3,0,1,1,2,0],
"class_thief___game_1_1_monsters_1_1_pinky.html#a81fa86131197af7fcf143f3d9efb47b2":[3,0,1,1,2,1],
"class_thief___game_1_1_movable_game_object.html":[3,0,1,14],
"class_thief___game_1_1_movable_game_object.html#a5a6059962546696cc78f60cd0a1b845e":[3,0,1,14,2],
"class_thief___game_1_1_movable_game_object.html#a5dc022876597a5f76d0430c911943670":[3,0,1,14,3],
"class_thief___game_1_1_movable_game_object.html#a60fbee9bc15a90cd417c1738df55e825":[3,0,1,14,5],
"class_thief___game_1_1_movable_game_object.html#a8941599013de958f995530861ebfdb83":[3,0,1,14,1],
"class_thief___game_1_1_movable_game_object.html#aaa4cea5b931ce65724644587bf7b07c8":[3,0,1,14,4],
"class_thief___game_1_1_movable_game_object.html#ae28acff3e62d5f9be99f49ce00f4f9c1":[3,0,1,14,0],
"class_thief___game_1_1_pacman.html":[3,0,1,15],
"class_thief___game_1_1_pacman.html#a19fb8d06a48620d327cc1f77d5edd6a4":[3,0,1,15,11],
"class_thief___game_1_1_pacman.html#a1bedf753fdbbc8f5b3e362033a637ddf":[3,0,1,15,14],
"class_thief___game_1_1_pacman.html#a22ac33e5e5ffedfef620b649cd168e76":[3,0,1,15,12],
"class_thief___game_1_1_pacman.html#a29608c0c1166d30881a2b26542630356":[3,0,1,15,2],
"class_thief___game_1_1_pacman.html#a3f9874c73d7f73e859aebc026ade9db8":[3,0,1,15,16],
"class_thief___game_1_1_pacman.html#a5817bc7f3bd9008b2ba6361e7ec5c5d6":[3,0,1,15,5],
"class_thief___game_1_1_pacman.html#a5c34c847a8af5d4b2b9d4abce79409c9":[3,0,1,15,0],
"class_thief___game_1_1_pacman.html#a6cb93c8e246ec2fb0cf83c5a2a7195a0":[3,0,1,15,4],
"class_thief___game_1_1_pacman.html#a843ddc49469ec25af7825b34c28c09b0":[3,0,1,15,10],
"class_thief___game_1_1_pacman.html#a94dc7d4e1a466690369d5b2825fde3ed":[3,0,1,15,6],
"class_thief___game_1_1_pacman.html#a9cfdabe8d3a4fff1847e832b15885e08":[3,0,1,15,13],
"class_thief___game_1_1_pacman.html#aa175b5584258ef2d6ca82a4903975c28":[3,0,1,15,1],
"class_thief___game_1_1_pacman.html#ac0eca030c77bdd1926c8f0e9e970d4e4":[3,0,1,15,15],
"class_thief___game_1_1_pacman.html#ac8d0aa8b24ab656eb946fddda908102c":[3,0,1,15,7],
"class_thief___game_1_1_pacman.html#acfa2185c075cb04165aff6b6fb7fd9a7":[3,0,1,15,3],
"class_thief___game_1_1_pacman.html#ad02b0113abbb78a76cad3d5debd9eaad":[3,0,1,15,8],
"class_thief___game_1_1_pacman.html#afd396d4bbdca00f9b64d3835d5ac819f":[3,0,1,15,9],
"class_thief___game_1_1_path_info.html":[3,0,1,16]
};
|
//* ===== MARKSHEET =====
/**
* @author 4Dcoder
* @property {ObjectId} id Marksheet primaryKey
* @property {String} type Marksheet type "PAPER|CBT"
* @property {ObjectId} course Marksheet course
* @property {ObjectId} student Marksheet student
* @property {Number} score Marksheet score
* @property {ObjectId} assessment_sitting Marksheet AssessmentSitting
* @description Markheet records score per student per course
*/
import Joi from "joi";
import mongoose from "mongoose";
// eslint-disable-next-line camelcase
import mongoose_csv from "mongoose-csv";
import { DATABASE } from "../../../constants";
import Staff from "../staff/model";
import Student from "../student/model";
import Classe from "../classe/model";
import { AssessmentSitting } from "../assessment/model";
const { Schema } = mongoose;
const { ObjectId } = Schema.Types;
export const marksheetCreate = {
type: Joi.string().valid(["PAPER", "CBT"]).required(),
course: Joi.string().required(),
student: Joi.string().required(),
score: Joi.number().required(),
total: Joi.number().required(),
assessment_sitting: Joi.string().optional(),
create_by: Joi.string().required(),
};
export const marksheetUpdate = {
type: Joi.string().valid(["PAPER", "CBT"]).optional(),
course: Joi.string().optional(),
student: Joi.string().optional(),
score: Joi.number().optional(),
total: Joi.number().optional(),
assessment_sitting: Joi.string().optional(),
updated_by: Joi.string().required(),
};
export const marksheetSchema = {
type: { type: String, enum: ["PAPER", "CBT"], required: true },
course: { type: ObjectId, ref: "Course", required: true },
student: { type: ObjectId, ref: "Student", required: true },
score: { type: Number, required: true },
assessment_sitting: { type: ObjectId, ref: "AssessmentSitting" },
deleted: { type: Boolean, default: false, required: true },
deleted_at: { type: Date },
created_by: { type: ObjectId, ref: "Staff", required: true },
updated_by: { type: ObjectId, ref: "Staff" },
};
const options = DATABASE.OPTIONS;
const newMarksheetSchema = new Schema(marksheetSchema, options);
newMarksheetSchema.set("collection", "marksheet");
const Marksheet = mongoose.model("Marksheet", newMarksheetSchema);
//* ===== RESULT =========
/**
* @author 4Dcoder
* @property {ObjectId} id Report primaryKey
* @property {String} type Report type "EVALUATION|TERMLY|ANNUAL" required
* @property {String} term Report type "FIRST|SECOND|THRID|ANNUAL" required
* @property {Array} cumulated Report cumulated Result Array
* @property {ObjectId} student Report student ObjectId
* @property {Array} marksheets Report marksheets Array<Marksheet>
* @property {Number} evaluation Report evaluation [1, 2, 3, 4]
* @property {Number} total Report total
* @property {Number} rank Report rank for that report
* @description Result ( a type of report) holds generated academic report being computed
*/
export const resultCreate = {
type: Joi.string().trim().valid(["EVALUATION", "TERMLY", "ANNUAL"]).required(),
term: Joi.string().trim().valid(["FIRST", "SECOND", "THRID", "ANNUAL"]).required(),
cumulated: Joi.array().optional(),
student: Joi.string().optional(),
marksheets: Joi.array().optional(),
evaluation: Joi.number().valid([1, 2, 3, 4]).required(),
total: Joi.number().optional(),
rank: Joi.number().optional(),
created_by: Joi.string().required(),
};
export const resultUpdate = {
type: Joi.string().trim().valid(["EVALUATION", "TERMLY", "ANNUAL"]).required(),
term: Joi.string().trim().valid(["FIRST", "SECOND", "THRID", "ANNUAL"]).required(),
cumulated: Joi.array().optional(),
student: Joi.string().optional(),
marksheets: Joi.array().optional(),
evaluation: Joi.number().valid([1, 2, 3, 4]).required(),
total: Joi.number().optional(),
rank: Joi.number().optional(),
updated_by: Joi.string().required(),
};
export const resultSchema = {
type: { type: String, enum: ["EVALUATION", "TERMLY", "ANNUAL"], required: true },
term: { type: String, enum: ["FIRST", "SECOND", "THRID", "ANNUAL"], required: true },
cumulated: [{ type: ObjectId, ref: "Result" }], // for annual
student: { type: ObjectId, ref: "Student", required: true },
marksheets: [{ type: ObjectId, ref: "Marksheet" }],
evaluation: { type: Number, enum: [1, 2, 3, 4], required: true },
total: { type: Number },
rank: { type: Number },
created_by: { type: ObjectId, ref: "Staff", required: true },
updated_by: { type: ObjectId, ref: "Staff" },
};
const newResultSchema = new Schema(resultSchema, options);
newResultSchema.set("collection", "result");
const Result = mongoose.model("Result", newResultSchema);
export { Marksheet, Result };
|
// queue
'use strict';
const uuid = require('uuid');
const socketio = require('socket.io');
const server = socketio(3000);
const chores = server.of('/chores');
const queue = {
chores: {},
addChore: function (chore) {
// creates random id
let id = uuid();
this.chores[id] = chore;
return {
id,
payload: chore,
};
},
removeChore: function () { },
};
chores.on('connect', (socket) => {
socket.on('add chore', chore => {
let payload = queue.addChore(chore);
chores.emit('chore added', payload);
});
});
|
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.compileVariableParsing = exports.failToParseVariables = void 0;
const generate_function_1 = __importDefault(require("generate-function"));
const graphql_1 = require("graphql");
const ast_1 = require("./ast");
const error_1 = require("./error");
const inspect_1 = __importDefault(require("./inspect"));
const inspect = (0, inspect_1.default)();
function failToParseVariables(x) {
return x.errors;
}
exports.failToParseVariables = failToParseVariables;
function createSubCompilationContext(context) {
return Object.assign({}, context);
}
function compileVariableParsing(schema, varDefNodes) {
const errors = [];
const coercedValues = Object.create(null);
let mainBody = "";
const dependencies = new Map();
for (const varDefNode of varDefNodes) {
const context = {
varDefNode,
depth: 0,
inputPath: (0, ast_1.addPath)(undefined, "input"),
responsePath: (0, ast_1.addPath)(undefined, "coerced"),
dependencies
};
const varName = varDefNode.variable.name.value;
const varType = (0, graphql_1.typeFromAST)(schema, varDefNode.type);
if (!varType || !(0, graphql_1.isInputType)(varType)) {
// Must use input types for variables. This should be caught during
// validation, however is checked again here for safety.
errors.push(new error_1.GraphQLError(`Variable "$${varName}" expected value of type ` +
`"${varType || (0, graphql_1.print)(varDefNode.type)}" which cannot be used as an input type.`, (0, ast_1.computeLocations)([varDefNode.type])));
continue;
}
// Ensure a constant shape of the input map
coercedValues[varName] = undefined;
const hasValueName = hasValue((0, ast_1.addPath)(context.inputPath, varName));
mainBody += `const ${hasValueName} = Object.prototype.hasOwnProperty.call(${getObjectPath(context.inputPath)}, "${varName}");\n`;
context.inputPath = (0, ast_1.addPath)(context.inputPath, varName);
context.responsePath = (0, ast_1.addPath)(context.responsePath, varName);
mainBody += generateInput(context, varType, varName, hasValueName, (0, graphql_1.valueFromAST)(varDefNode.defaultValue, varType), false);
}
if (errors.length > 0) {
throw errors;
}
const gen = (0, generate_function_1.default)();
gen(`
return function getVariables(input) {
const errors = [];
const coerced = ${JSON.stringify(coercedValues)}
${mainBody}
if (errors.length > 0) {
return {errors, coerced: undefined};
}
return {errors: undefined, coerced};
}
`);
// eslint-disable-next-line
return Function.apply(null, ["GraphQLJITError", "inspect"]
.concat(Array.from(dependencies.keys()))
.concat(gen.toString())).apply(null, [error_1.GraphQLError, inspect].concat(Array.from(dependencies.values())));
}
exports.compileVariableParsing = compileVariableParsing;
// Int Scalars represent 32 bits
// https://graphql.github.io/graphql-spec/June2018/#sec-Int
const MAX_32BIT_INT = 2147483647;
const MIN_32BIT_INT = -2147483648;
function generateInput(context, varType, varName, hasValueName, defaultValue, wrapInList) {
const currentOutput = getObjectPath(context.responsePath);
const currentInput = getObjectPath(context.inputPath);
const errorLocation = printErrorLocation((0, ast_1.computeLocations)([context.varDefNode]));
const gen = (0, generate_function_1.default)();
gen(`if (${currentInput} == null) {`);
if ((0, graphql_1.isNonNullType)(varType)) {
let nonNullMessage;
let omittedMessage;
if (context.errorMessage) {
const objectPath = printObjectPath(context.responsePath);
nonNullMessage = `${context.errorMessage} + \`Expected non-nullable type ${varType} not to be null at ${objectPath}.\``;
omittedMessage = `${context.errorMessage} + \`Field ${objectPath} of required type ${varType} was not provided.\``;
}
else {
nonNullMessage = `'Variable "$${varName}" of non-null type "${varType}" must not be null.'`;
omittedMessage = `'Variable "$${varName}" of required type "${varType}" was not provided.'`;
}
varType = varType.ofType;
gen(`
if (${currentOutput} == null) {
errors.push(new GraphQLJITError(${hasValueName} ? ${nonNullMessage} : ${omittedMessage}, ${errorLocation}));
}
`);
}
else {
gen(`
if (${hasValueName}) { ${currentOutput} = null; }
`);
if (defaultValue !== undefined) {
gen(`else { ${currentOutput} = ${JSON.stringify(defaultValue)} }`);
}
}
gen(`} else {`);
if ((0, graphql_1.isScalarType)(varType)) {
switch (varType.name) {
case graphql_1.GraphQLID.name:
gen(`
if (typeof ${currentInput} === "string") {
${currentOutput} = ${currentInput};
} else if (Number.isInteger(${currentInput})) {
${currentOutput} = ${currentInput}.toString();
} else {
errors.push(new GraphQLJITError('Variable "$${varName}" got invalid value ' +
inspect(${currentInput}) + "; " +
'Expected type ${varType.name}; ' +
'${varType.name} cannot represent value: ' +
inspect(${currentInput}), ${errorLocation})
);
}
`);
break;
case graphql_1.GraphQLString.name:
gen(`
if (typeof ${currentInput} === "string") {
${currentOutput} = ${currentInput};
} else {
errors.push(new GraphQLJITError('Variable "$${varName}" got invalid value ' +
inspect(${currentInput}) + "; " +
'Expected type ${varType.name}; ' +
'${varType.name} cannot represent a non string value: ' +
inspect(${currentInput}), ${errorLocation})
);
}
`);
break;
case graphql_1.GraphQLBoolean.name:
gen(`
if (typeof ${currentInput} === "boolean") {
${currentOutput} = ${currentInput};
} else {
errors.push(new GraphQLJITError('Variable "$${varName}" got invalid value ' +
inspect(${currentInput}) + "; " +
'Expected type ${varType.name}; ' +
'${varType.name} cannot represent a non boolean value: ' +
inspect(${currentInput}), ${errorLocation}));
}
`);
break;
case graphql_1.GraphQLInt.name:
gen(`
if (Number.isInteger(${currentInput})) {
if (${currentInput} > ${MAX_32BIT_INT} || ${currentInput} < ${MIN_32BIT_INT}) {
errors.push(new GraphQLJITError('Variable "$${varName}" got invalid value ' +
inspect(${currentInput}) + "; " +
'Expected type ${varType.name}; ' +
'${varType.name} cannot represent non 32-bit signed integer value: ' +
inspect(${currentInput}), ${errorLocation}));
} else {
${currentOutput} = ${currentInput};
}
} else {
errors.push(new GraphQLJITError('Variable "$${varName}" got invalid value ' +
inspect(${currentInput}) + "; " +
'Expected type ${varType.name}; ' +
'${varType.name} cannot represent non-integer value: ' +
inspect(${currentInput}), ${errorLocation})
);
}
`);
break;
case graphql_1.GraphQLFloat.name:
gen(`
if (Number.isFinite(${currentInput})) {
${currentOutput} = ${currentInput};
} else {
errors.push(new GraphQLJITError('Variable "$${varName}" got invalid value ' +
inspect(${currentInput}) + "; " +
'Expected type ${varType.name}; ' +
'${varType.name} cannot represent non numeric value: ' +
inspect(${currentInput}), ${errorLocation})
);
}
`);
break;
default:
context.dependencies.set(`${varType.name}parseValue`, varType.parseValue.bind(varType));
gen(`
try {
const parseResult = ${varType.name}parseValue(${currentInput});
if (parseResult === undefined || parseResult !== parseResult) {
errors.push(new GraphQLJITError('Variable "$${varName}" got invalid value ' +
inspect(${currentInput}) + "; " +
'Expected type ${varType.name}.', ${errorLocation}));
}
${currentOutput} = parseResult;
} catch (error) {
errors.push(new GraphQLJITError('Variable "$${varName}" got invalid value ' +
inspect(${currentInput}) + "; " +
'Expected type ${varType.name}.', ${errorLocation}, undefined, error)
);
}
`);
}
}
else if ((0, graphql_1.isEnumType)(varType)) {
context.dependencies.set(`${varType.name}getValue`, varType.getValue.bind(varType));
gen(`
if (typeof ${currentInput} === "string") {
const enumValue = ${varType.name}getValue(${currentInput});
if (enumValue) {
${currentOutput} = enumValue.value;
} else {
errors.push(
new GraphQLJITError('Variable "$${varName}" got invalid value ' +
inspect(${currentInput}) + "; " +
'Expected type ${varType.name}.', ${errorLocation})
);
}
} else {
errors.push(
new GraphQLJITError('Variable "$${varName}" got invalid value ' +
inspect(${currentInput}) + "; " +
'Expected type ${varType.name}.', ${errorLocation})
);
}
`);
}
else if ((0, graphql_1.isListType)(varType)) {
context.errorMessage = `'Variable "$${varName}" got invalid value ' + inspect(${currentInput}) + '; '`;
const hasValueName = hasValue(context.inputPath);
const index = `idx${context.depth}`;
const subContext = createSubCompilationContext(context);
subContext.responsePath = (0, ast_1.addPath)(subContext.responsePath, index, "variable");
subContext.inputPath = (0, ast_1.addPath)(subContext.inputPath, index, "variable");
subContext.depth++;
gen(`
if (Array.isArray(${currentInput})) {
${currentOutput} = [];
for (let ${index} = 0; ${index} < ${currentInput}.length; ++${index}) {
const ${hasValueName} =
${getObjectPath(subContext.inputPath)} !== undefined;
${generateInput(subContext, varType.ofType, varName, hasValueName, undefined, false)}
}
} else {
${generateInput(context, varType.ofType, varName, hasValueName, undefined, true)}
}
`);
}
else if ((0, graphql_1.isInputType)(varType)) {
gen(`
if (typeof ${currentInput} !== 'object') {
errors.push(new GraphQLJITError('Variable "$${varName}" got invalid value ' +
inspect(${currentInput}) + "; " +
'Expected type ${varType.name} to be an object.', ${errorLocation}));
} else {
${currentOutput} = {};
`);
const fields = varType.getFields();
const allowedFields = [];
for (const field of Object.values(fields)) {
const subContext = createSubCompilationContext(context);
allowedFields.push(field.name);
const hasValueName = hasValue((0, ast_1.addPath)(subContext.inputPath, field.name));
gen(`
const ${hasValueName} = Object.prototype.hasOwnProperty.call(
${getObjectPath(subContext.inputPath)}, "${field.name}"
);
`);
subContext.inputPath = (0, ast_1.addPath)(subContext.inputPath, field.name);
subContext.responsePath = (0, ast_1.addPath)(subContext.responsePath, field.name);
subContext.errorMessage = `'Variable "$${varName}" got invalid value ' + inspect(${currentInput}) + '; '`;
gen(`
${generateInput(subContext, field.type, field.name, hasValueName, field.defaultValue, false)}
`);
}
gen(`
const allowedFields = ${JSON.stringify(allowedFields)};
for (const fieldName of Object.keys(${currentInput})) {
if (!allowedFields.includes(fieldName)) {
errors.push(new GraphQLJITError('Variable "$${varName}" got invalid value ' +
inspect(${currentInput}) + "; " +
'Field "' + fieldName + '" is not defined by type ${varType.name}.', ${errorLocation}));
break;
}
}
}`);
}
else {
/* istanbul ignore next line */
throw new Error(`unknown type: ${varType}`);
}
if (wrapInList) {
gen(`${currentOutput} = [${currentOutput}];`);
}
gen(`}`);
return gen.toString();
}
function hasValue(path) {
const flattened = [];
let curr = path;
while (curr) {
flattened.push(curr.key);
curr = curr.prev;
}
return `hasValue${flattened.join("_")}`;
}
function printErrorLocation(location) {
return JSON.stringify(location);
}
function getObjectPath(path) {
const flattened = [];
let curr = path;
while (curr) {
flattened.unshift({ key: curr.key, type: curr.type });
curr = curr.prev;
}
let name = flattened[0].key;
for (let i = 1; i < flattened.length; ++i) {
name +=
flattened[i].type === "literal"
? `["${flattened[i].key}"]`
: `[${flattened[i].key}]`;
}
return name;
}
function printObjectPath(path) {
const flattened = [];
let curr = path;
while (curr) {
flattened.unshift({ key: curr.key, type: curr.type });
curr = curr.prev;
}
const initialIndex = Math.min(flattened.length - 1, 1);
let name = "value";
for (let i = initialIndex + 1; i < flattened.length; ++i) {
name +=
flattened[i].type === "literal"
? `.${flattened[i].key}`
: `[$\{${flattened[i].key}}]`;
}
return name;
}
//# sourceMappingURL=variables.js.map
|
import React, { Component } from 'react';
import Rx from '@reactivex/rxjs';
import AmCharts from "@amcharts/amcharts3-react";
//import mockdata from '../../json/AmchartData.json';
//import apiData from '../../json/ApiData.json';
import { connect } from "react-redux"
// var env = process.env.NODE_ENV || 'dev';
// const envVar = require('../../uiconfig/config.' + env);
//const ProviderCountAPI = envVar.uri + envVar.port + envVar.registry + envVar.project + apiData.apis.getGraphCount;
//const ProviderCountAPI = 'http://127.0.0.1:9001/registry/pegasus/provider/graphCount';
// const datatest = {
// year: '2017'
// }
// const InitParamProv = {
// method:'POST',
// headers : {'Content-Type': 'application/json'},
// body: JSON.stringify(datatest)
// };
// const InitParamProvRxjs = {
// year: '2017'
// };
class AmSerialAreaChartWithDwnld extends React.Component {
// constructor(props) {
// super(props);
// const initialWidth = window.innerWidth > 0 ? window.innerWidth : 500;
// this.state = {
// windowWidth: initialWidth - 100,
// componentWidth: 300,
// providerArray: [],
// messages: []
// };
// }
// getFromProviderApiPromise() {
// fetch(ProviderCountAPI, InitParamProv).
// then((response) => response.json())
// .then((responseJson) => {
// this.setState({ providerArray: responseJson.result });
// console.log('Promise Call:', this.state.providerArray);
// });
// }
// getFromProviderApiRedu() {
// const fetchData = Rx.Observable
// .ajax
// .post(ProviderCountAPI, InitParamProvRxjs)
// .scan((messages, message) => [message].concat(messages), [])
// .subscribe(data => {
// //console.log(data[0].response.result);
// this.setState({ messages: data[0].response.result })
// }
// );
// return fetchData;
// }
/**
*
* Rxjs with POST
* @returns
* @memberof AmSerialAreaChart
*/
// getFromProviderApiRxjs() {
// const fetchData = Rx.Observable
// .ajax
// .post(ProviderCountAPI, InitParamProvRxjs)
// .scan((messages, message) => [message].concat(messages), [])
// .subscribe(data => {
// //console.log(data[0].response.result);
// this.setState({ messages: data[0].response.result })
// }
// );
// return fetchData;
// }
//componentDidMount() {
//this.getFromProviderApiPromise();
//this.getFromProviderApiRedu();
//this.getFromProviderApiRxjs();
//}
render() {
//console.log(this.props.providerReducer.providerData.result);
//console.log(this.props);
//const {tweets,this.props.providerReducer.providerData.result } = this.props;
//console.log("from amchart", this.props.providerReducer.providerData);
//console.log("from 2 amchart", this.state.messages);
//var config = ;
return (
<div className="areaChartAreawithdownload">
{this.props.providerReducer.providerData.result ? (
<AmCharts.React style={{ width: "100%", height: "300px" }} options={{
"hideCredits": true,
"type": "serial",
"theme": "light",
"marginRight": 80,
"dataProvider": this.props.providerReducer.providerData.result,
"valueAxes": [{
"position": "left",
"title": "Provider Count"
}],
"graphs": [{
"id": "g1",
"fillAlphas": 0.4,
"valueField": "Active",
"balloonText": "<div style='margin:2px; font-size:10px;'>Active:<b>[[value]]</b></div>"
}, {
"id": "g2",
"lineColor": "#800080",
"fillAlphas": 0.4,
"valueField": "Inactive",
"balloonText": "<div style='margin:2px; font-size:10px;'>Inactive:<b>[[value]]</b></div>"
}],
"chartScrollbar": {
"graph": "g1",
"scrollbarHeight": 40,
"backgroundAlpha": 0,
"selectedBackgroundAlpha": 0.1,
"selectedBackgroundColor": "#888888",
"graphFillAlpha": 0,
"graphLineAlpha": 0.5,
"selectedGraphFillAlpha": 0,
"selectedGraphLineAlpha": 1,
"autoGridCount": true,
"color": "#AAAAAA"
},
"chartCursor": {
"categoryBalloonDateFormat": "JJ:NN, DD MMMM",
"cursorPosition": "mouse"
},
"categoryField": "Date",
"categoryAxis": {
"minPeriod": "mm",
"parseDates": true
},
"legend": {
"data": [{
title: "Active",
color: "rgb(114,188,247)",
}, {
title: "InActive",
color: "#800080",
}],
"position": "top"
},
"export": {
"enabled": true,
"dateFormat": "YYYY-MM-DD HH:NN:SS"
}
}} />
) : (
<div>
<div className="ui active inverted dimmer">
<div className="ui medium text loader">Loading</div>
</div>
</div>
)}
</div>
)
}
}
const mapStateToProps = (state) => {
return state;
}
const DefaultApp = connect(mapStateToProps)(AmSerialAreaChartWithDwnld);
export default DefaultApp;
|
var E, a, b, x1, x2, x3, x4, x5, x6, x7;
!function(E) {
E[E.a = 0] = "a", E[E.b = 1] = "b";
}(E || (E = {})), x1 += a, x1 += b, x1 += !0, x1 += 0, x1 += '', x1 += E.a, x1 += {}, x1 += null, x1 += void 0, x2 += a, x2 += b, x2 += !0, x2 += 0, x2 += '', x2 += E.a, x2 += {}, x2 += null, x2 += void 0, x3 += a, x3 += 0, x3 += E.a, x3 += null, x3 += void 0, x4 += a, x4 += 0, x4 += E.a, x4 += null, x4 += void 0, x5 += a, x6 += a, x6 += '', x7 += a;
|
function _typeof(obj) {
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
_typeof = function (obj) {
return typeof obj;
};
} else {
_typeof = function (obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};
}
return _typeof(obj);
}
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);
return Constructor;
}
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
function _objectSpread(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
var ownKeys = Object.keys(source);
if (typeof Object.getOwnPropertySymbols === 'function') {
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
}));
}
ownKeys.forEach(function (key) {
_defineProperty(target, key, source[key]);
});
}
return target;
}
var Language =
/*#__PURE__*/
function () {
function Language(language, months, monthsAbbr, days) {
_classCallCheck(this, Language);
this.language = language;
this.months = months;
this.monthsAbbr = monthsAbbr;
this.days = days;
this.rtl = false;
this.ymd = false;
this.yearSuffix = '';
}
_createClass(Language, [{
key: "language",
get: function get() {
return this._language;
},
set: function set(language) {
if (typeof language !== 'string') {
throw new TypeError('Language must be a string');
}
this._language = language;
}
}, {
key: "months",
get: function get() {
return this._months;
},
set: function set(months) {
if (months.length !== 12) {
throw new RangeError("There must be 12 months for ".concat(this.language, " language"));
}
this._months = months;
}
}, {
key: "monthsAbbr",
get: function get() {
return this._monthsAbbr;
},
set: function set(monthsAbbr) {
if (monthsAbbr.length !== 12) {
throw new RangeError("There must be 12 abbreviated months for ".concat(this.language, " language"));
}
this._monthsAbbr = monthsAbbr;
}
}, {
key: "days",
get: function get() {
return this._days;
},
set: function set(days) {
if (days.length !== 7) {
throw new RangeError("There must be 7 days for ".concat(this.language, " language"));
}
this._days = days;
}
}]);
return Language;
}(); // eslint-disable-next-line
var en = new Language('English', ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']) // eslint-disable-next-line
;
var utils = {
/**
* @type {Boolean}
*/
useUtc: false,
/**
* Returns the full year, using UTC or not
* @param {Date} date
*/
getFullYear: function getFullYear(date) {
return this.useUtc ? date.getUTCFullYear() : date.getFullYear();
},
/**
* Returns the month, using UTC or not
* @param {Date} date
*/
getMonth: function getMonth(date) {
return this.useUtc ? date.getUTCMonth() : date.getMonth();
},
/**
* Returns the date, using UTC or not
* @param {Date} date
*/
getDate: function getDate(date) {
return this.useUtc ? date.getUTCDate() : date.getDate();
},
/**
* Returns the day, using UTC or not
* @param {Date} date
*/
getDay: function getDay(date) {
return this.useUtc ? date.getUTCDay() : date.getDay();
},
/**
* Returns the hours, using UTC or not
* @param {Date} date
*/
getHours: function getHours(date) {
return this.useUtc ? date.getUTCHours() : date.getHours();
},
/**
* Returns the minutes, using UTC or not
* @param {Date} date
*/
getMinutes: function getMinutes(date) {
return this.useUtc ? date.getUTCMinutes() : date.getMinutes();
},
/**
* Sets the full year, using UTC or not
* @param {Date} date
*/
setFullYear: function setFullYear(date, value, useUtc) {
return this.useUtc ? date.setUTCFullYear(value) : date.setFullYear(value);
},
/**
* Sets the month, using UTC or not
* @param {Date} date
*/
setMonth: function setMonth(date, value, useUtc) {
return this.useUtc ? date.setUTCMonth(value) : date.setMonth(value);
},
/**
* Sets the date, using UTC or not
* @param {Date} date
* @param {Number} value
*/
setDate: function setDate(date, value, useUtc) {
return this.useUtc ? date.setUTCDate(value) : date.setDate(value);
},
/**
* Check if date1 is equivalent to date2, without comparing the time
* @see https://stackoverflow.com/a/6202196/4455925
* @param {Date} date1
* @param {Date} date2
*/
compareDates: function compareDates(date1, date2) {
var d1 = new Date(date1.getTime());
var d2 = new Date(date2.getTime());
if (this.useUtc) {
d1.setUTCHours(0, 0, 0, 0);
d2.setUTCHours(0, 0, 0, 0);
} else {
d1.setHours(0, 0, 0, 0);
d2.setHours(0, 0, 0, 0);
}
return d1.getTime() === d2.getTime();
},
/**
* Validates a date object
* @param {Date} date - an object instantiated with the new Date constructor
* @return {Boolean}
*/
isValidDate: function isValidDate(date) {
if (Object.prototype.toString.call(date) !== '[object Date]') {
return false;
}
return !isNaN(date.getTime());
},
/**
* Return abbreviated week day name
* @param {Date}
* @param {Array}
* @return {String}
*/
getDayNameAbbr: function getDayNameAbbr(date, days) {
if (_typeof(date) !== 'object') {
throw TypeError('Invalid Type');
}
return days[this.getDay(date)];
},
/**
* Return name of the month
* @param {Number|Date}
* @param {Array}
* @return {String}
*/
getMonthName: function getMonthName(month, months) {
if (!months) {
throw Error('missing 2nd parameter Months array');
}
if (_typeof(month) === 'object') {
return months[this.getMonth(month)];
}
if (typeof month === 'number') {
return months[month];
}
throw TypeError('Invalid type');
},
/**
* Return an abbreviated version of the month
* @param {Number|Date}
* @return {String}
*/
getMonthNameAbbr: function getMonthNameAbbr(month, monthsAbbr) {
if (!monthsAbbr) {
throw Error('missing 2nd paramter Months array');
}
if (_typeof(month) === 'object') {
return monthsAbbr[this.getMonth(month)];
}
if (typeof month === 'number') {
return monthsAbbr[month];
}
throw TypeError('Invalid type');
},
/**
* Alternative get total number of days in month
* @param {Number} year
* @param {Number} m
* @return {Number}
*/
daysInMonth: function daysInMonth(year, month) {
return /8|3|5|10/.test(month) ? 30 : month === 1 ? !(year % 4) && year % 100 || !(year % 400) ? 29 : 28 : 31;
},
/**
* Get nth suffix for date
* @param {Number} day
* @return {String}
*/
getNthSuffix: function getNthSuffix(day) {
switch (day) {
case 1:
case 21:
case 31:
return 'st';
case 2:
case 22:
return 'nd';
case 3:
case 23:
return 'rd';
default:
return 'th';
}
},
/**
* Formats date object
* @param {Date}
* @param {String}
* @param {Object}
* @return {String}
*/
formatDate: function formatDate(date, format, translation) {
translation = !translation ? en : translation;
var year = this.getFullYear(date);
var month = this.getMonth(date) + 1;
var day = this.getDate(date);
var str = format.replace(/dd/, ('0' + day).slice(-2)).replace(/d/, day).replace(/yyyy/, year).replace(/yy/, String(year).slice(2)).replace(/MMMM/, this.getMonthName(this.getMonth(date), translation.months)).replace(/MMM/, this.getMonthNameAbbr(this.getMonth(date), translation.monthsAbbr)).replace(/MM/, ('0' + month).slice(-2)).replace(/M(?!a|ä|e)/, month).replace(/su/, this.getNthSuffix(this.getDate(date))).replace(/D(?!e|é|i)/, this.getDayNameAbbr(date, translation.days));
return str;
},
/**
* Creates an array of dates for each day in between two dates.
* @param {Date} start
* @param {Date} end
* @return {Array}
*/
createDateArray: function createDateArray(start, end) {
var dates = [];
while (start <= end) {
dates.push(new Date(start));
start = this.setDate(new Date(start), this.getDate(new Date(start)) + 1);
}
return dates;
},
/**
* method used as a prop validator for input values
* @param {*} val
* @return {Boolean}
*/
validateDateInput: function validateDateInput(val) {
return val === null || val instanceof Date || typeof val === 'string' || typeof val === 'number';
}
};
var makeDateUtils = function makeDateUtils(useUtc) {
return _objectSpread({}, utils, {
useUtc: useUtc
});
};
var utils$1 = _objectSpread({}, utils) // eslint-disable-next-line
;
var script = {
props: {
selectedDate: Date,
resetTypedDate: [Date],
format: [String, Function],
translation: Object,
inline: Boolean,
id: String,
name: String,
refName: String,
openDate: Date,
placeholder: String,
inputClass: [String, Object, Array],
clearButton: Boolean,
clearButtonIcon: String,
calendarButton: Boolean,
calendarButtonIcon: String,
calendarButtonIconContent: String,
disabled: Boolean,
required: Boolean,
typeable: Boolean,
bootstrapStyling: Boolean,
useUtc: Boolean
},
data: function data() {
var constructedDateUtils = makeDateUtils(this.useUtc);
return {
input: null,
typedDate: false,
utils: constructedDateUtils
};
},
computed: {
formattedValue: function formattedValue() {
if (!this.selectedDate) {
return null;
}
if (this.typedDate) {
return this.typedDate;
}
return typeof this.format === 'function' ? this.format(this.selectedDate) : this.utils.formatDate(new Date(this.selectedDate), this.format, this.translation);
},
computedInputClass: function computedInputClass() {
if (this.bootstrapStyling) {
if (typeof this.inputClass === 'string') {
return [this.inputClass, 'form-control'].join(' ');
}
return _objectSpread({
'form-control': true
}, this.inputClass);
}
return this.inputClass;
}
},
watch: {
resetTypedDate: function resetTypedDate() {
this.typedDate = false;
}
},
methods: {
showCalendar: function showCalendar() {
this.$emit('showCalendar');
},
/**
* Attempt to parse a typed date
* @param {Event} event
*/
parseTypedDate: function parseTypedDate(event) {
// close calendar if escape or enter are pressed
if ([27, // escape
13 // enter
].includes(event.keyCode)) {
this.input.blur();
}
if (this.typeable) {
var typedDate = Date.parse(this.input.value);
if (!isNaN(typedDate)) {
this.typedDate = this.input.value;
this.$emit('typedDate', new Date(this.typedDate));
}
}
},
/**
* nullify the typed date to defer to regular formatting
* called once the input is blurred
*/
inputBlurred: function inputBlurred() {
if (this.typeable && isNaN(Date.parse(this.input.value))) {
this.clearDate();
this.input.value = null;
this.typedDate = null;
}
this.$emit('closeCalendar');
},
/**
* emit a clearDate event
*/
clearDate: function clearDate() {
this.$emit('clearDate');
}
},
mounted: function mounted() {
this.input = this.$el.querySelector('input');
}
} // eslint-disable-next-line
;
function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier
/* server only */
, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {
if (typeof shadowMode !== 'boolean') {
createInjectorSSR = createInjector;
createInjector = shadowMode;
shadowMode = false;
} // Vue.extend constructor export interop.
var options = typeof script === 'function' ? script.options : script; // render functions
if (template && template.render) {
options.render = template.render;
options.staticRenderFns = template.staticRenderFns;
options._compiled = true; // functional template
if (isFunctionalTemplate) {
options.functional = true;
}
} // scopedId
if (scopeId) {
options._scopeId = scopeId;
}
var hook;
if (moduleIdentifier) {
// server build
hook = function hook(context) {
// 2.3 injection
context = context || // cached call
this.$vnode && this.$vnode.ssrContext || // stateful
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext; // functional
// 2.2 with runInNewContext: true
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
context = __VUE_SSR_CONTEXT__;
} // inject component styles
if (style) {
style.call(this, createInjectorSSR(context));
} // register component module identifier for async chunk inference
if (context && context._registeredComponents) {
context._registeredComponents.add(moduleIdentifier);
}
}; // used by ssr in case component is cached and beforeCreate
// never gets called
options._ssrRegister = hook;
} else if (style) {
hook = shadowMode ? function () {
style.call(this, createInjectorShadow(this.$root.$options.shadowRoot));
} : function (context) {
style.call(this, createInjector(context));
};
}
if (hook) {
if (options.functional) {
// register for functional component in vue file
var originalRender = options.render;
options.render = function renderWithStyleInjection(h, context) {
hook.call(context);
return originalRender(h, context);
};
} else {
// inject component registration as beforeCreate hook
var existing = options.beforeCreate;
options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
}
}
return script;
}
var normalizeComponent_1 = normalizeComponent;
/* script */
const __vue_script__ = script;
/* template */
var __vue_render__ = function() {
var _vm = this;
var _h = _vm.$createElement;
var _c = _vm._self._c || _h;
return _c(
"div",
{ class: { "input-group": _vm.bootstrapStyling } },
[
_vm.calendarButton
? _c(
"span",
{
staticClass: "vdp-datepicker__calendar-button",
class: { "input-group-prepend": _vm.bootstrapStyling },
style: { "cursor:not-allowed;": _vm.disabled },
on: { click: _vm.showCalendar }
},
[
_c(
"span",
{ class: { "input-group-text": _vm.bootstrapStyling } },
[
_c("i", { class: _vm.calendarButtonIcon }, [
_vm._v(
"\n " +
_vm._s(_vm.calendarButtonIconContent) +
"\n "
),
!_vm.calendarButtonIcon
? _c("span", [_vm._v("…")])
: _vm._e()
])
]
)
]
)
: _vm._e(),
_vm._v(" "),
_c("input", {
ref: _vm.refName,
class: _vm.computedInputClass,
attrs: {
type: _vm.inline ? "hidden" : "text",
name: _vm.name,
id: _vm.id,
"open-date": _vm.openDate,
placeholder: _vm.placeholder,
"clear-button": _vm.clearButton,
disabled: _vm.disabled,
required: _vm.required,
readonly: !_vm.typeable,
autocomplete: "off"
},
domProps: { value: _vm.formattedValue },
on: {
click: _vm.showCalendar,
keyup: _vm.parseTypedDate,
blur: _vm.inputBlurred
}
}),
_vm._v(" "),
_vm.clearButton && _vm.selectedDate
? _c(
"span",
{
staticClass: "vdp-datepicker__clear-button",
class: { "input-group-append": _vm.bootstrapStyling },
on: {
click: function($event) {
return _vm.clearDate()
}
}
},
[
_c(
"span",
{ class: { "input-group-text": _vm.bootstrapStyling } },
[
_c("i", { class: _vm.clearButtonIcon }, [
!_vm.clearButtonIcon ? _c("span", [_vm._v("×")]) : _vm._e()
])
]
)
]
)
: _vm._e(),
_vm._v(" "),
_vm._t("afterDateInput")
],
2
)
};
var __vue_staticRenderFns__ = [];
__vue_render__._withStripped = true;
/* style */
const __vue_inject_styles__ = undefined;
/* scoped */
const __vue_scope_id__ = undefined;
/* module identifier */
const __vue_module_identifier__ = undefined;
/* functional template */
const __vue_is_functional_template__ = false;
/* style inject */
/* style inject SSR */
var DateInput = normalizeComponent_1(
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
__vue_inject_styles__,
__vue_script__,
__vue_scope_id__,
__vue_is_functional_template__,
__vue_module_identifier__,
undefined,
undefined
);
//
var script$1 = {
props: {
showDayView: Boolean,
selectedDate: Date,
pageDate: Date,
pageTimestamp: Number,
fullMonthName: Boolean,
allowedToShowView: Function,
dayCellContent: {
type: Function,
"default": function _default(day) {
return day.date;
}
},
disabledDates: Object,
highlighted: Object,
calendarClass: [String, Object, Array],
calendarStyle: Object,
translation: Object,
isRtl: Boolean,
mondayFirst: Boolean,
useUtc: Boolean
},
data: function data() {
var constructedDateUtils = makeDateUtils(this.useUtc);
return {
utils: constructedDateUtils
};
},
computed: {
/**
* Returns an array of day names
* @return {String[]}
*/
daysOfWeek: function daysOfWeek() {
if (this.mondayFirst) {
var tempDays = this.translation.days.slice();
tempDays.push(tempDays.shift());
return tempDays;
}
return this.translation.days;
},
/**
* Returns the day number of the week less one for the first of the current month
* Used to show amount of empty cells before the first in the day calendar layout
* @return {Number}
*/
blankDays: function blankDays() {
var d = this.pageDate;
var dObj = this.useUtc ? new Date(Date.UTC(d.getUTCFullYear(), d.getUTCMonth(), 1)) : new Date(d.getFullYear(), d.getMonth(), 1, d.getHours(), d.getMinutes());
if (this.mondayFirst) {
return this.utils.getDay(dObj) > 0 ? this.utils.getDay(dObj) - 1 : 6;
}
return this.utils.getDay(dObj);
},
/**
* @return {Object[]}
*/
days: function days() {
var d = this.pageDate;
var days = []; // set up a new date object to the beginning of the current 'page'
var dObj = this.useUtc ? new Date(Date.UTC(d.getUTCFullYear(), d.getUTCMonth(), 1)) : new Date(d.getFullYear(), d.getMonth(), 1, d.getHours(), d.getMinutes());
var daysInMonth = this.utils.daysInMonth(this.utils.getFullYear(dObj), this.utils.getMonth(dObj));
for (var i = 0; i < daysInMonth; i++) {
days.push({
date: this.utils.getDate(dObj),
timestamp: dObj.getTime(),
isSelected: this.isSelectedDate(dObj),
isDisabled: this.isDisabledDate(dObj),
isHighlighted: this.isHighlightedDate(dObj),
isHighlightStart: this.isHighlightStart(dObj),
isHighlightEnd: this.isHighlightEnd(dObj),
isToday: this.utils.compareDates(dObj, new Date()),
isWeekend: this.utils.getDay(dObj) === 0 || this.utils.getDay(dObj) === 6,
isSaturday: this.utils.getDay(dObj) === 6,
isSunday: this.utils.getDay(dObj) === 0
});
this.utils.setDate(dObj, this.utils.getDate(dObj) + 1);
}
return days;
},
/**
* Gets the name of the month the current page is on
* @return {String}
*/
currMonthName: function currMonthName() {
var monthName = this.fullMonthName ? this.translation.months : this.translation.monthsAbbr;
return this.utils.getMonthNameAbbr(this.utils.getMonth(this.pageDate), monthName);
},
/**
* Gets the name of the year that current page is on
* @return {Number}
*/
currYearName: function currYearName() {
var yearSuffix = this.translation.yearSuffix;
return "".concat(this.utils.getFullYear(this.pageDate)).concat(yearSuffix);
},
/**
* Is this translation using year/month/day format?
* @return {Boolean}
*/
isYmd: function isYmd() {
return this.translation.ymd && this.translation.ymd === true;
},
/**
* Is the left hand navigation button disabled?
* @return {Boolean}
*/
isLeftNavDisabled: function isLeftNavDisabled() {
return this.isRtl ? this.isNextMonthDisabled(this.pageTimestamp) : this.isPreviousMonthDisabled(this.pageTimestamp);
},
/**
* Is the right hand navigation button disabled?
* @return {Boolean}
*/
isRightNavDisabled: function isRightNavDisabled() {
return this.isRtl ? this.isPreviousMonthDisabled(this.pageTimestamp) : this.isNextMonthDisabled(this.pageTimestamp);
}
},
methods: {
selectDate: function selectDate(date) {
if (date.isDisabled) {
this.$emit('selectedDisabled', date);
return false;
}
this.$emit('selectDate', date);
},
/**
* @return {Number}
*/
getPageMonth: function getPageMonth() {
return this.utils.getMonth(this.pageDate);
},
/**
* Emit an event to show the month picker
*/
showMonthCalendar: function showMonthCalendar() {
this.$emit('showMonthCalendar');
},
/**
* Change the page month
* @param {Number} incrementBy
*/
changeMonth: function changeMonth(incrementBy) {
var date = this.pageDate;
this.utils.setMonth(date, this.utils.getMonth(date) + incrementBy);
this.$emit('changedMonth', date);
},
/**
* Decrement the page month
*/
previousMonth: function previousMonth() {
if (!this.isPreviousMonthDisabled()) {
this.changeMonth(-1);
}
},
/**
* Is the previous month disabled?
* @return {Boolean}
*/
isPreviousMonthDisabled: function isPreviousMonthDisabled() {
if (!this.disabledDates || !this.disabledDates.to) {
return false;
}
var d = this.pageDate;
return this.utils.getMonth(this.disabledDates.to) >= this.utils.getMonth(d) && this.utils.getFullYear(this.disabledDates.to) >= this.utils.getFullYear(d);
},
/**
* Increment the current page month
*/
nextMonth: function nextMonth() {
if (!this.isNextMonthDisabled()) {
this.changeMonth(+1);
}
},
/**
* Is the next month disabled?
* @return {Boolean}
*/
isNextMonthDisabled: function isNextMonthDisabled() {
if (!this.disabledDates || !this.disabledDates.from) {
return false;
}
var d = this.pageDate;
return this.utils.getMonth(this.disabledDates.from) <= this.utils.getMonth(d) && this.utils.getFullYear(this.disabledDates.from) <= this.utils.getFullYear(d);
},
/**
* Whether a day is selected
* @param {Date}
* @return {Boolean}
*/
isSelectedDate: function isSelectedDate(dObj) {
return this.selectedDate && this.utils.compareDates(this.selectedDate, dObj);
},
/**
* Whether a day is disabled
* @param {Date}
* @return {Boolean}
*/
isDisabledDate: function isDisabledDate(date) {
var _this = this;
var disabledDates = false;
if (typeof this.disabledDates === 'undefined') {
return false;
}
if (typeof this.disabledDates.dates !== 'undefined') {
this.disabledDates.dates.forEach(function (d) {
if (_this.utils.compareDates(date, d)) {
disabledDates = true;
return true;
}
});
}
if (typeof this.disabledDates.to !== 'undefined' && this.disabledDates.to && date < this.disabledDates.to) {
disabledDates = true;
}
if (typeof this.disabledDates.from !== 'undefined' && this.disabledDates.from && date > this.disabledDates.from) {
disabledDates = true;
}
if (typeof this.disabledDates.ranges !== 'undefined') {
this.disabledDates.ranges.forEach(function (range) {
if (typeof range.from !== 'undefined' && range.from && typeof range.to !== 'undefined' && range.to) {
if (date < range.to && date > range.from) {
disabledDates = true;
return true;
}
}
});
}
if (typeof this.disabledDates.days !== 'undefined' && this.disabledDates.days.indexOf(this.utils.getDay(date)) !== -1) {
disabledDates = true;
}
if (typeof this.disabledDates.daysOfMonth !== 'undefined' && this.disabledDates.daysOfMonth.indexOf(this.utils.getDate(date)) !== -1) {
disabledDates = true;
}
if (typeof this.disabledDates.customPredictor === 'function' && this.disabledDates.customPredictor(date)) {
disabledDates = true;
}
return disabledDates;
},
/**
* Whether a day is highlighted (only if it is not disabled already except when highlighted.includeDisabled is true)
* @param {Date}
* @return {Boolean}
*/
isHighlightedDate: function isHighlightedDate(date) {
var _this2 = this;
if (!(this.highlighted && this.highlighted.includeDisabled) && this.isDisabledDate(date)) {
return false;
}
var highlighted = false;
if (typeof this.highlighted === 'undefined') {
return false;
}
if (typeof this.highlighted.dates !== 'undefined') {
this.highlighted.dates.forEach(function (d) {
if (_this2.utils.compareDates(date, d)) {
highlighted = true;
return true;
}
});
}
if (this.isDefined(this.highlighted.from) && this.isDefined(this.highlighted.to)) {
highlighted = date >= this.highlighted.from && date <= this.highlighted.to;
}
if (typeof this.highlighted.days !== 'undefined' && this.highlighted.days.indexOf(this.utils.getDay(date)) !== -1) {
highlighted = true;
}
if (typeof this.highlighted.daysOfMonth !== 'undefined' && this.highlighted.daysOfMonth.indexOf(this.utils.getDate(date)) !== -1) {
highlighted = true;
}
if (typeof this.highlighted.customPredictor === 'function' && this.highlighted.customPredictor(date)) {
highlighted = true;
}
return highlighted;
},
dayClasses: function dayClasses(day) {
return {
'selected': day.isSelected,
'disabled': day.isDisabled,
'highlighted': day.isHighlighted,
'today': day.isToday,
'weekend': day.isWeekend,
'sat': day.isSaturday,
'sun': day.isSunday,
'highlight-start': day.isHighlightStart,
'highlight-end': day.isHighlightEnd
};
},
/**
* Whether a day is highlighted and it is the first date
* in the highlighted range of dates
* @param {Date}
* @return {Boolean}
*/
isHighlightStart: function isHighlightStart(date) {
return this.isHighlightedDate(date) && this.highlighted.from instanceof Date && this.utils.getFullYear(this.highlighted.from) === this.utils.getFullYear(date) && this.utils.getMonth(this.highlighted.from) === this.utils.getMonth(date) && this.utils.getDate(this.highlighted.from) === this.utils.getDate(date);
},
/**
* Whether a day is highlighted and it is the first date
* in the highlighted range of dates
* @param {Date}
* @return {Boolean}
*/
isHighlightEnd: function isHighlightEnd(date) {
return this.isHighlightedDate(date) && this.highlighted.to instanceof Date && this.utils.getFullYear(this.highlighted.to) === this.utils.getFullYear(date) && this.utils.getMonth(this.highlighted.to) === this.utils.getMonth(date) && this.utils.getDate(this.highlighted.to) === this.utils.getDate(date);
},
/**
* Helper
* @param {mixed} prop
* @return {Boolean}
*/
isDefined: function isDefined(prop) {
return typeof prop !== 'undefined' && prop;
}
} // eslint-disable-next-line
};
/* script */
const __vue_script__$1 = script$1;
/* template */
var __vue_render__$1 = function() {
var _vm = this;
var _h = _vm.$createElement;
var _c = _vm._self._c || _h;
return _c(
"div",
{
directives: [
{
name: "show",
rawName: "v-show",
value: _vm.showDayView,
expression: "showDayView"
}
],
class: [_vm.calendarClass, "vdp-datepicker__calendar"],
style: _vm.calendarStyle,
on: {
mousedown: function($event) {
$event.preventDefault();
}
}
},
[
_vm._t("beforeCalendarHeader"),
_vm._v(" "),
_c("header", [
_c(
"span",
{
staticClass: "prev",
class: { disabled: _vm.isLeftNavDisabled },
on: {
click: function($event) {
_vm.isRtl ? _vm.nextMonth() : _vm.previousMonth();
}
}
},
[_vm._v("<")]
),
_vm._v(" "),
_c(
"span",
{
staticClass: "day__month_btn",
class: _vm.allowedToShowView("month") ? "up" : "",
on: { click: _vm.showMonthCalendar }
},
[
_vm._v(
_vm._s(_vm.isYmd ? _vm.currYearName : _vm.currMonthName) +
" " +
_vm._s(_vm.isYmd ? _vm.currMonthName : _vm.currYearName)
)
]
),
_vm._v(" "),
_c(
"span",
{
staticClass: "next",
class: { disabled: _vm.isRightNavDisabled },
on: {
click: function($event) {
_vm.isRtl ? _vm.previousMonth() : _vm.nextMonth();
}
}
},
[_vm._v(">")]
)
]),
_vm._v(" "),
_c(
"div",
{ class: _vm.isRtl ? "flex-rtl" : "" },
[
_vm._l(_vm.daysOfWeek, function(d) {
return _c(
"span",
{ key: d.timestamp, staticClass: "cell day-header" },
[_vm._v(_vm._s(d))]
)
}),
_vm._v(" "),
_vm.blankDays > 0
? _vm._l(_vm.blankDays, function(d) {
return _c("span", {
key: d.timestamp,
staticClass: "cell day blank"
})
})
: _vm._e(),
_vm._l(_vm.days, function(day) {
return _c("span", {
key: day.timestamp,
staticClass: "cell day",
class: _vm.dayClasses(day),
domProps: { innerHTML: _vm._s(_vm.dayCellContent(day)) },
on: {
click: function($event) {
return _vm.selectDate(day)
}
}
})
})
],
2
)
],
2
)
};
var __vue_staticRenderFns__$1 = [];
__vue_render__$1._withStripped = true;
/* style */
const __vue_inject_styles__$1 = undefined;
/* scoped */
const __vue_scope_id__$1 = undefined;
/* module identifier */
const __vue_module_identifier__$1 = undefined;
/* functional template */
const __vue_is_functional_template__$1 = false;
/* style inject */
/* style inject SSR */
var PickerDay = normalizeComponent_1(
{ render: __vue_render__$1, staticRenderFns: __vue_staticRenderFns__$1 },
__vue_inject_styles__$1,
__vue_script__$1,
__vue_scope_id__$1,
__vue_is_functional_template__$1,
__vue_module_identifier__$1,
undefined,
undefined
);
//
var script$2 = {
props: {
showMonthView: Boolean,
selectedDate: Date,
pageDate: Date,
pageTimestamp: Number,
disabledDates: Object,
calendarClass: [String, Object, Array],
calendarStyle: Object,
translation: Object,
isRtl: Boolean,
allowedToShowView: Function,
useUtc: Boolean
},
data: function data() {
var constructedDateUtils = makeDateUtils(this.useUtc);
return {
utils: constructedDateUtils
};
},
computed: {
months: function months() {
var d = this.pageDate;
var months = []; // set up a new date object to the beginning of the current 'page'
var dObj = this.useUtc ? new Date(Date.UTC(d.getUTCFullYear(), 0, d.getUTCDate())) : new Date(d.getFullYear(), 0, d.getDate(), d.getHours(), d.getMinutes());
for (var i = 0; i < 12; i++) {
months.push({
month: this.utils.getMonthName(i, this.translation.months),
timestamp: dObj.getTime(),
isSelected: this.isSelectedMonth(dObj),
isDisabled: this.isDisabledMonth(dObj)
});
this.utils.setMonth(dObj, this.utils.getMonth(dObj) + 1);
}
return months;
},
/**
* Get year name on current page.
* @return {String}
*/
pageYearName: function pageYearName() {
var yearSuffix = this.translation.yearSuffix;
return "".concat(this.utils.getFullYear(this.pageDate)).concat(yearSuffix);
},
/**
* Is the left hand navigation disabled
* @return {Boolean}
*/
isLeftNavDisabled: function isLeftNavDisabled() {
return this.isRtl ? this.isNextYearDisabled(this.pageTimestamp) : this.isPreviousYearDisabled(this.pageTimestamp);
},
/**
* Is the right hand navigation disabled
* @return {Boolean}
*/
isRightNavDisabled: function isRightNavDisabled() {
return this.isRtl ? this.isPreviousYearDisabled(this.pageTimestamp) : this.isNextYearDisabled(this.pageTimestamp);
}
},
methods: {
/**
* Emits a selectMonth event
* @param {Object} month
*/
selectMonth: function selectMonth(month) {
if (month.isDisabled) {
return false;
}
this.$emit('selectMonth', month);
},
/**
* Changes the year up or down
* @param {Number} incrementBy
*/
changeYear: function changeYear(incrementBy) {
var date = this.pageDate;
this.utils.setFullYear(date, this.utils.getFullYear(date) + incrementBy);
this.$emit('changedYear', date);
},
/**
* Decrements the year
*/
previousYear: function previousYear() {
if (!this.isPreviousYearDisabled()) {
this.changeYear(-1);
}
},
/**
* Checks if the previous year is disabled or not
* @return {Boolean}
*/
isPreviousYearDisabled: function isPreviousYearDisabled() {
if (!this.disabledDates || !this.disabledDates.to) {
return false;
}
return this.utils.getFullYear(this.disabledDates.to) >= this.utils.getFullYear(this.pageDate);
},
/**
* Increments the year
*/
nextYear: function nextYear() {
if (!this.isNextYearDisabled()) {
this.changeYear(1);
}
},
/**
* Checks if the next year is disabled or not
* @return {Boolean}
*/
isNextYearDisabled: function isNextYearDisabled() {
if (!this.disabledDates || !this.disabledDates.from) {
return false;
}
return this.utils.getFullYear(this.disabledDates.from) <= this.utils.getFullYear(this.pageDate);
},
/**
* Emits an event that shows the year calendar
*/
showYearCalendar: function showYearCalendar() {
this.$emit('showYearCalendar');
},
/**
* Whether the selected date is in this month
* @param {Date}
* @return {Boolean}
*/
isSelectedMonth: function isSelectedMonth(date) {
return this.selectedDate && this.utils.getFullYear(this.selectedDate) === this.utils.getFullYear(date) && this.utils.getMonth(this.selectedDate) === this.utils.getMonth(date);
},
/**
* Whether a month is disabled
* @param {Date}
* @return {Boolean}
*/
isDisabledMonth: function isDisabledMonth(date) {
var disabledDates = false;
if (typeof this.disabledDates === 'undefined') {
return false;
}
if (typeof this.disabledDates.to !== 'undefined' && this.disabledDates.to) {
if (this.utils.getMonth(date) < this.utils.getMonth(this.disabledDates.to) && this.utils.getFullYear(date) <= this.utils.getFullYear(this.disabledDates.to) || this.utils.getFullYear(date) < this.utils.getFullYear(this.disabledDates.to)) {
disabledDates = true;
}
}
if (typeof this.disabledDates.from !== 'undefined' && this.disabledDates.from) {
if (this.utils.getMonth(date) > this.utils.getMonth(this.disabledDates.from) && this.utils.getFullYear(date) >= this.utils.getFullYear(this.disabledDates.from) || this.utils.getFullYear(date) > this.utils.getFullYear(this.disabledDates.from)) {
disabledDates = true;
}
}
if (typeof this.disabledDates.customPredictor === 'function' && this.disabledDates.customPredictor(date)) {
disabledDates = true;
}
return disabledDates;
}
} // eslint-disable-next-line
};
/* script */
const __vue_script__$2 = script$2;
/* template */
var __vue_render__$2 = function() {
var _vm = this;
var _h = _vm.$createElement;
var _c = _vm._self._c || _h;
return _c(
"div",
{
directives: [
{
name: "show",
rawName: "v-show",
value: _vm.showMonthView,
expression: "showMonthView"
}
],
class: [_vm.calendarClass, "vdp-datepicker__calendar"],
style: _vm.calendarStyle,
on: {
mousedown: function($event) {
$event.preventDefault();
}
}
},
[
_vm._t("beforeCalendarHeader"),
_vm._v(" "),
_c("header", [
_c(
"span",
{
staticClass: "prev",
class: { disabled: _vm.isLeftNavDisabled },
on: {
click: function($event) {
_vm.isRtl ? _vm.nextYear() : _vm.previousYear();
}
}
},
[_vm._v("<")]
),
_vm._v(" "),
_c(
"span",
{
staticClass: "month__year_btn",
class: _vm.allowedToShowView("year") ? "up" : "",
on: { click: _vm.showYearCalendar }
},
[_vm._v(_vm._s(_vm.pageYearName))]
),
_vm._v(" "),
_c(
"span",
{
staticClass: "next",
class: { disabled: _vm.isRightNavDisabled },
on: {
click: function($event) {
_vm.isRtl ? _vm.previousYear() : _vm.nextYear();
}
}
},
[_vm._v(">")]
)
]),
_vm._v(" "),
_vm._l(_vm.months, function(month) {
return _c(
"span",
{
key: month.timestamp,
staticClass: "cell month",
class: { selected: month.isSelected, disabled: month.isDisabled },
on: {
click: function($event) {
$event.stopPropagation();
return _vm.selectMonth(month)
}
}
},
[_vm._v(_vm._s(month.month))]
)
})
],
2
)
};
var __vue_staticRenderFns__$2 = [];
__vue_render__$2._withStripped = true;
/* style */
const __vue_inject_styles__$2 = undefined;
/* scoped */
const __vue_scope_id__$2 = undefined;
/* module identifier */
const __vue_module_identifier__$2 = undefined;
/* functional template */
const __vue_is_functional_template__$2 = false;
/* style inject */
/* style inject SSR */
var PickerMonth = normalizeComponent_1(
{ render: __vue_render__$2, staticRenderFns: __vue_staticRenderFns__$2 },
__vue_inject_styles__$2,
__vue_script__$2,
__vue_scope_id__$2,
__vue_is_functional_template__$2,
__vue_module_identifier__$2,
undefined,
undefined
);
//
var script$3 = {
props: {
showYearView: Boolean,
selectedDate: Date,
pageDate: Date,
pageTimestamp: Number,
disabledDates: Object,
highlighted: Object,
calendarClass: [String, Object, Array],
calendarStyle: Object,
translation: Object,
isRtl: Boolean,
allowedToShowView: Function,
useUtc: Boolean
},
computed: {
years: function years() {
var d = this.pageDate;
var years = []; // set up a new date object to the beginning of the current 'page'7
var dObj = this.useUtc ? new Date(Date.UTC(Math.floor(d.getUTCFullYear() / 10) * 10, d.getUTCMonth(), d.getUTCDate())) : new Date(Math.floor(d.getFullYear() / 10) * 10, d.getMonth(), d.getDate(), d.getHours(), d.getMinutes());
for (var i = 0; i < 10; i++) {
years.push({
year: this.utils.getFullYear(dObj),
timestamp: dObj.getTime(),
isSelected: this.isSelectedYear(dObj),
isDisabled: this.isDisabledYear(dObj)
});
this.utils.setFullYear(dObj, this.utils.getFullYear(dObj) + 1);
}
return years;
},
/**
* @return {String}
*/
getPageDecade: function getPageDecade() {
var decadeStart = Math.floor(this.utils.getFullYear(this.pageDate) / 10) * 10;
var decadeEnd = decadeStart + 9;
var yearSuffix = this.translation.yearSuffix;
return "".concat(decadeStart, " - ").concat(decadeEnd).concat(yearSuffix);
},
/**
* Is the left hand navigation button disabled?
* @return {Boolean}
*/
isLeftNavDisabled: function isLeftNavDisabled() {
return this.isRtl ? this.isNextDecadeDisabled(this.pageTimestamp) : this.isPreviousDecadeDisabled(this.pageTimestamp);
},
/**
* Is the right hand navigation button disabled?
* @return {Boolean}
*/
isRightNavDisabled: function isRightNavDisabled() {
return this.isRtl ? this.isPreviousDecadeDisabled(this.pageTimestamp) : this.isNextDecadeDisabled(this.pageTimestamp);
}
},
data: function data() {
var constructedDateUtils = makeDateUtils(this.useUtc);
return {
utils: constructedDateUtils
};
},
methods: {
selectYear: function selectYear(year) {
if (year.isDisabled) {
return false;
}
this.$emit('selectYear', year);
},
changeYear: function changeYear(incrementBy) {
var date = this.pageDate;
this.utils.setFullYear(date, this.utils.getFullYear(date) + incrementBy);
this.$emit('changedDecade', date);
},
previousDecade: function previousDecade() {
if (this.isPreviousDecadeDisabled()) {
return false;
}
this.changeYear(-10);
},
isPreviousDecadeDisabled: function isPreviousDecadeDisabled() {
if (!this.disabledDates || !this.disabledDates.to) {
return false;
}
var disabledYear = this.utils.getFullYear(this.disabledDates.to);
var lastYearInPreviousPage = Math.floor(this.utils.getFullYear(this.pageDate) / 10) * 10 - 1;
return disabledYear > lastYearInPreviousPage;
},
nextDecade: function nextDecade() {
if (this.isNextDecadeDisabled()) {
return false;
}
this.changeYear(10);
},
isNextDecadeDisabled: function isNextDecadeDisabled() {
if (!this.disabledDates || !this.disabledDates.from) {
return false;
}
var disabledYear = this.utils.getFullYear(this.disabledDates.from);
var firstYearInNextPage = Math.ceil(this.utils.getFullYear(this.pageDate) / 10) * 10;
return disabledYear < firstYearInNextPage;
},
/**
* Whether the selected date is in this year
* @param {Date}
* @return {Boolean}
*/
isSelectedYear: function isSelectedYear(date) {
return this.selectedDate && this.utils.getFullYear(this.selectedDate) === this.utils.getFullYear(date);
},
/**
* Whether a year is disabled
* @param {Date}
* @return {Boolean}
*/
isDisabledYear: function isDisabledYear(date) {
var disabledDates = false;
if (typeof this.disabledDates === 'undefined' || !this.disabledDates) {
return false;
}
if (typeof this.disabledDates.to !== 'undefined' && this.disabledDates.to) {
if (this.utils.getFullYear(date) < this.utils.getFullYear(this.disabledDates.to)) {
disabledDates = true;
}
}
if (typeof this.disabledDates.from !== 'undefined' && this.disabledDates.from) {
if (this.utils.getFullYear(date) > this.utils.getFullYear(this.disabledDates.from)) {
disabledDates = true;
}
}
if (typeof this.disabledDates.customPredictor === 'function' && this.disabledDates.customPredictor(date)) {
disabledDates = true;
}
return disabledDates;
}
} // eslint-disable-next-line
};
/* script */
const __vue_script__$3 = script$3;
/* template */
var __vue_render__$3 = function() {
var _vm = this;
var _h = _vm.$createElement;
var _c = _vm._self._c || _h;
return _c(
"div",
{
directives: [
{
name: "show",
rawName: "v-show",
value: _vm.showYearView,
expression: "showYearView"
}
],
class: [_vm.calendarClass, "vdp-datepicker__calendar"],
style: _vm.calendarStyle,
on: {
mousedown: function($event) {
$event.preventDefault();
}
}
},
[
_vm._t("beforeCalendarHeader"),
_vm._v(" "),
_c("header", [
_c(
"span",
{
staticClass: "prev",
class: { disabled: _vm.isLeftNavDisabled },
on: {
click: function($event) {
_vm.isRtl ? _vm.nextDecade() : _vm.previousDecade();
}
}
},
[_vm._v("<")]
),
_vm._v(" "),
_c("span", [_vm._v(_vm._s(_vm.getPageDecade))]),
_vm._v(" "),
_c(
"span",
{
staticClass: "next",
class: { disabled: _vm.isRightNavDisabled },
on: {
click: function($event) {
_vm.isRtl ? _vm.previousDecade() : _vm.nextDecade();
}
}
},
[_vm._v(">")]
)
]),
_vm._v(" "),
_vm._l(_vm.years, function(year) {
return _c(
"span",
{
key: year.timestamp,
staticClass: "cell year",
class: { selected: year.isSelected, disabled: year.isDisabled },
on: {
click: function($event) {
$event.stopPropagation();
return _vm.selectYear(year)
}
}
},
[_vm._v(_vm._s(year.year))]
)
})
],
2
)
};
var __vue_staticRenderFns__$3 = [];
__vue_render__$3._withStripped = true;
/* style */
const __vue_inject_styles__$3 = undefined;
/* scoped */
const __vue_scope_id__$3 = undefined;
/* module identifier */
const __vue_module_identifier__$3 = undefined;
/* functional template */
const __vue_is_functional_template__$3 = false;
/* style inject */
/* style inject SSR */
var PickerYear = normalizeComponent_1(
{ render: __vue_render__$3, staticRenderFns: __vue_staticRenderFns__$3 },
__vue_inject_styles__$3,
__vue_script__$3,
__vue_scope_id__$3,
__vue_is_functional_template__$3,
__vue_module_identifier__$3,
undefined,
undefined
);
//
var script$4 = {
components: {
DateInput: DateInput,
PickerDay: PickerDay,
PickerMonth: PickerMonth,
PickerYear: PickerYear
},
props: {
value: {
validator: function validator(val) {
return utils$1.validateDateInput(val);
}
},
name: String,
refName: String,
id: String,
format: {
type: [String, Function],
"default": 'dd MMM yyyy'
},
language: {
type: Object,
"default": function _default() {
return en;
}
},
openDate: {
validator: function validator(val) {
return utils$1.validateDateInput(val);
}
},
dayCellContent: Function,
fullMonthName: Boolean,
disabledDates: Object,
highlighted: Object,
placeholder: String,
inline: Boolean,
calendarClass: [String, Object, Array],
inputClass: [String, Object, Array],
wrapperClass: [String, Object, Array],
mondayFirst: Boolean,
clearButton: Boolean,
clearButtonIcon: String,
calendarButton: Boolean,
calendarButtonIcon: String,
calendarButtonIconContent: String,
bootstrapStyling: Boolean,
initialView: String,
disabled: Boolean,
required: Boolean,
typeable: Boolean,
useUtc: Boolean,
minimumView: {
type: String,
"default": 'day'
},
maximumView: {
type: String,
"default": 'year'
}
},
data: function data() {
var startDate = this.openDate ? new Date(this.openDate) : new Date();
var constructedDateUtils = makeDateUtils(this.useUtc);
var pageTimestamp = constructedDateUtils.setDate(startDate, 1);
return {
/*
* Vue cannot observe changes to a Date Object so date must be stored as a timestamp
* This represents the first day of the current viewing month
* {Number}
*/
pageTimestamp: pageTimestamp,
/*
* Selected Date
* {Date}
*/
selectedDate: null,
/*
* Flags to show calendar views
* {Boolean}
*/
showDayView: false,
showMonthView: false,
showYearView: false,
/*
* Positioning
*/
calendarHeight: 0,
resetTypedDate: new Date(),
utils: constructedDateUtils
};
},
watch: {
value: function value(_value) {
this.setValue(_value);
},
openDate: function openDate() {
this.setPageDate();
},
initialView: function initialView() {
this.setInitialView();
}
},
computed: {
computedInitialView: function computedInitialView() {
if (!this.initialView) {
return this.minimumView;
}
return this.initialView;
},
pageDate: function pageDate() {
return new Date(this.pageTimestamp);
},
translation: function translation() {
return this.language;
},
calendarStyle: function calendarStyle() {
return {
position: this.isInline ? 'static' : undefined
};
},
isOpen: function isOpen() {
return this.showDayView || this.showMonthView || this.showYearView;
},
isInline: function isInline() {
return !!this.inline;
},
isRtl: function isRtl() {
return this.translation.rtl === true;
}
},
methods: {
/**
* Called in the event that the user navigates to date pages and
* closes the picker without selecting a date.
*/
resetDefaultPageDate: function resetDefaultPageDate() {
if (this.selectedDate === null) {
this.setPageDate();
return;
}
this.setPageDate(this.selectedDate);
},
/**
* Effectively a toggle to show/hide the calendar
* @return {mixed}
*/
showCalendar: function showCalendar() {
if (this.disabled || this.isInline) {
return false;
}
if (this.isOpen) {
return this.close(true);
}
this.setInitialView();
},
/**
* Sets the initial picker page view: day, month or year
*/
setInitialView: function setInitialView() {
var initialView = this.computedInitialView;
if (!this.allowedToShowView(initialView)) {
throw new Error("initialView '".concat(this.initialView, "' cannot be rendered based on minimum '").concat(this.minimumView, "' and maximum '").concat(this.maximumView, "'"));
}
switch (initialView) {
case 'year':
this.showYearCalendar();
break;
case 'month':
this.showMonthCalendar();
break;
default:
this.showDayCalendar();
break;
}
},
/**
* Are we allowed to show a specific picker view?
* @param {String} view
* @return {Boolean}
*/
allowedToShowView: function allowedToShowView(view) {
var views = ['day', 'month', 'year'];
var minimumViewIndex = views.indexOf(this.minimumView);
var maximumViewIndex = views.indexOf(this.maximumView);
var viewIndex = views.indexOf(view);
return viewIndex >= minimumViewIndex && viewIndex <= maximumViewIndex;
},
/**
* Show the day picker
* @return {Boolean}
*/
showDayCalendar: function showDayCalendar() {
if (!this.allowedToShowView('day')) {
return false;
}
this.close();
this.showDayView = true;
return true;
},
/**
* Show the month picker
* @return {Boolean}
*/
showMonthCalendar: function showMonthCalendar() {
if (!this.allowedToShowView('month')) {
return false;
}
this.close();
this.showMonthView = true;
return true;
},
/**
* Show the year picker
* @return {Boolean}
*/
showYearCalendar: function showYearCalendar() {
if (!this.allowedToShowView('year')) {
return false;
}
this.close();
this.showYearView = true;
return true;
},
/**
* Set the selected date
* @param {Number} timestamp
*/
setDate: function setDate(timestamp) {
var date = new Date(timestamp);
this.selectedDate = date;
this.setPageDate(date);
this.$emit('selected', date);
this.$emit('input', date);
},
/**
* Clear the selected date
*/
clearDate: function clearDate() {
this.selectedDate = null;
this.setPageDate();
this.$emit('selected', null);
this.$emit('input', null);
this.$emit('cleared');
},
/**
* @param {Object} date
*/
selectDate: function selectDate(date) {
this.setDate(date.timestamp);
if (!this.isInline) {
this.close(true);
}
this.resetTypedDate = new Date();
},
/**
* @param {Object} date
*/
selectDisabledDate: function selectDisabledDate(date) {
this.$emit('selectedDisabled', date);
},
/**
* @param {Object} month
*/
selectMonth: function selectMonth(month) {
var date = new Date(month.timestamp);
if (this.allowedToShowView('day')) {
this.setPageDate(date);
this.$emit('changedMonth', month);
this.showDayCalendar();
} else {
this.selectDate(month);
}
},
/**
* @param {Object} year
*/
selectYear: function selectYear(year) {
var date = new Date(year.timestamp);
if (this.allowedToShowView('month')) {
this.setPageDate(date);
this.$emit('changedYear', year);
this.showMonthCalendar();
} else {
this.selectDate(year);
}
},
/**
* Set the datepicker value
* @param {Date|String|Number|null} date
*/
setValue: function setValue(date) {
if (typeof date === 'string' || typeof date === 'number') {
var parsed = new Date(date);
date = isNaN(parsed.valueOf()) ? null : parsed;
}
if (!date) {
this.setPageDate();
this.selectedDate = null;
return;
}
this.selectedDate = date;
this.setPageDate(date);
},
/**
* Sets the date that the calendar should open on
*/
setPageDate: function setPageDate(date) {
if (!date) {
if (this.openDate) {
date = new Date(this.openDate);
} else {
date = new Date();
}
}
this.pageTimestamp = this.utils.setDate(new Date(date), 1);
},
/**
* Handles a month change from the day picker
*/
handleChangedMonthFromDayPicker: function handleChangedMonthFromDayPicker(date) {
this.setPageDate(date);
this.$emit('changedMonth', date);
},
/**
* Set the date from a typedDate event
*/
setTypedDate: function setTypedDate(date) {
this.setDate(date.getTime());
},
/**
* Close all calendar layers
* @param {Boolean} emitEvent - emit close event
*/
close: function close(emitEvent) {
this.showDayView = this.showMonthView = this.showYearView = false;
if (!this.isInline) {
if (emitEvent) {
this.$emit('closed');
}
document.removeEventListener('click', this.clickOutside, false);
}
},
/**
* Initiate the component
*/
init: function init() {
if (this.value) {
this.setValue(this.value);
}
if (this.isInline) {
this.setInitialView();
}
}
},
mounted: function mounted() {
this.init();
}
} // eslint-disable-next-line
;
var isOldIE = typeof navigator !== 'undefined' && /msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());
function createInjector(context) {
return function (id, style) {
return addStyle(id, style);
};
}
var HEAD = document.head || document.getElementsByTagName('head')[0];
var styles = {};
function addStyle(id, css) {
var group = isOldIE ? css.media || 'default' : id;
var style = styles[group] || (styles[group] = {
ids: new Set(),
styles: []
});
if (!style.ids.has(id)) {
style.ids.add(id);
var code = css.source;
if (css.map) {
// https://developer.chrome.com/devtools/docs/javascript-debugging
// this makes source maps inside style tags work properly in Chrome
code += '\n/*# sourceURL=' + css.map.sources[0] + ' */'; // http://stackoverflow.com/a/26603875
code += '\n/*# sourceMappingURL=data:application/json;base64,' + btoa(unescape(encodeURIComponent(JSON.stringify(css.map)))) + ' */';
}
if (!style.element) {
style.element = document.createElement('style');
style.element.type = 'text/css';
if (css.media) style.element.setAttribute('media', css.media);
HEAD.appendChild(style.element);
}
if ('styleSheet' in style.element) {
style.styles.push(code);
style.element.styleSheet.cssText = style.styles.filter(Boolean).join('\n');
} else {
var index = style.ids.size - 1;
var textNode = document.createTextNode(code);
var nodes = style.element.childNodes;
if (nodes[index]) style.element.removeChild(nodes[index]);
if (nodes.length) style.element.insertBefore(textNode, nodes[index]);else style.element.appendChild(textNode);
}
}
}
var browser = createInjector;
/* script */
const __vue_script__$4 = script$4;
/* template */
var __vue_render__$4 = function() {
var _vm = this;
var _h = _vm.$createElement;
var _c = _vm._self._c || _h;
return _c(
"div",
{
staticClass: "vdp-datepicker",
class: [_vm.wrapperClass, _vm.isRtl ? "rtl" : ""]
},
[
_c(
"date-input",
{
attrs: {
selectedDate: _vm.selectedDate,
resetTypedDate: _vm.resetTypedDate,
format: _vm.format,
translation: _vm.translation,
inline: _vm.inline,
id: _vm.id,
name: _vm.name,
refName: _vm.refName,
openDate: _vm.openDate,
placeholder: _vm.placeholder,
inputClass: _vm.inputClass,
typeable: _vm.typeable,
clearButton: _vm.clearButton,
clearButtonIcon: _vm.clearButtonIcon,
calendarButton: _vm.calendarButton,
calendarButtonIcon: _vm.calendarButtonIcon,
calendarButtonIconContent: _vm.calendarButtonIconContent,
disabled: _vm.disabled,
required: _vm.required,
bootstrapStyling: _vm.bootstrapStyling,
"use-utc": _vm.useUtc
},
on: {
showCalendar: _vm.showCalendar,
closeCalendar: _vm.close,
typedDate: _vm.setTypedDate,
clearDate: _vm.clearDate
}
},
[_vm._t("afterDateInput", null, { slot: "afterDateInput" })],
2
),
_vm._v(" "),
_vm.allowedToShowView("day")
? _c(
"picker-day",
{
attrs: {
pageDate: _vm.pageDate,
selectedDate: _vm.selectedDate,
showDayView: _vm.showDayView,
fullMonthName: _vm.fullMonthName,
allowedToShowView: _vm.allowedToShowView,
disabledDates: _vm.disabledDates,
highlighted: _vm.highlighted,
calendarClass: _vm.calendarClass,
calendarStyle: _vm.calendarStyle,
translation: _vm.translation,
pageTimestamp: _vm.pageTimestamp,
isRtl: _vm.isRtl,
mondayFirst: _vm.mondayFirst,
dayCellContent: _vm.dayCellContent,
"use-utc": _vm.useUtc
},
on: {
changedMonth: _vm.handleChangedMonthFromDayPicker,
selectDate: _vm.selectDate,
showMonthCalendar: _vm.showMonthCalendar,
selectedDisabled: _vm.selectDisabledDate
}
},
[
_vm._t("beforeCalendarHeader", null, {
slot: "beforeCalendarHeader"
})
],
2
)
: _vm._e(),
_vm._v(" "),
_vm.allowedToShowView("month")
? _c(
"picker-month",
{
attrs: {
pageDate: _vm.pageDate,
selectedDate: _vm.selectedDate,
showMonthView: _vm.showMonthView,
allowedToShowView: _vm.allowedToShowView,
disabledDates: _vm.disabledDates,
calendarClass: _vm.calendarClass,
calendarStyle: _vm.calendarStyle,
translation: _vm.translation,
isRtl: _vm.isRtl,
"use-utc": _vm.useUtc
},
on: {
selectMonth: _vm.selectMonth,
showYearCalendar: _vm.showYearCalendar,
changedYear: _vm.setPageDate
}
},
[
_vm._t("beforeCalendarHeader", null, {
slot: "beforeCalendarHeader"
})
],
2
)
: _vm._e(),
_vm._v(" "),
_vm.allowedToShowView("year")
? _c(
"picker-year",
{
attrs: {
pageDate: _vm.pageDate,
selectedDate: _vm.selectedDate,
showYearView: _vm.showYearView,
allowedToShowView: _vm.allowedToShowView,
disabledDates: _vm.disabledDates,
calendarClass: _vm.calendarClass,
calendarStyle: _vm.calendarStyle,
translation: _vm.translation,
isRtl: _vm.isRtl,
"use-utc": _vm.useUtc
},
on: { selectYear: _vm.selectYear, changedDecade: _vm.setPageDate }
},
[
_vm._t("beforeCalendarHeader", null, {
slot: "beforeCalendarHeader"
})
],
2
)
: _vm._e()
],
1
)
};
var __vue_staticRenderFns__$4 = [];
__vue_render__$4._withStripped = true;
/* style */
const __vue_inject_styles__$4 = function (inject) {
if (!inject) return
inject("data-v-5e9b5ce6_0", { source: ".rtl {\n direction: rtl;\n}\n.vdp-datepicker {\n position: relative;\n text-align: left;\n}\n.vdp-datepicker * {\n box-sizing: border-box;\n}\n.vdp-datepicker__calendar {\n position: absolute;\n z-index: 100;\n background: #fff;\n width: 300px;\n border: 1px solid #ccc;\n}\n.vdp-datepicker__calendar header {\n display: block;\n line-height: 40px;\n}\n.vdp-datepicker__calendar header span {\n display: inline-block;\n text-align: center;\n width: 71.42857142857143%;\n float: left;\n}\n.vdp-datepicker__calendar header .prev,\n.vdp-datepicker__calendar header .next {\n width: 14.285714285714286%;\n float: left;\n text-indent: -10000px;\n position: relative;\n}\n.vdp-datepicker__calendar header .prev:after,\n.vdp-datepicker__calendar header .next:after {\n content: '';\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translateX(-50%) translateY(-50%);\n border: 6px solid transparent;\n}\n.vdp-datepicker__calendar header .prev:after {\n border-right: 10px solid #000;\n margin-left: -5px;\n}\n.vdp-datepicker__calendar header .prev.disabled:after {\n border-right: 10px solid #ddd;\n}\n.vdp-datepicker__calendar header .next:after {\n border-left: 10px solid #000;\n margin-left: 5px;\n}\n.vdp-datepicker__calendar header .next.disabled:after {\n border-left: 10px solid #ddd;\n}\n.vdp-datepicker__calendar header .prev:not(.disabled),\n.vdp-datepicker__calendar header .next:not(.disabled),\n.vdp-datepicker__calendar header .up:not(.disabled) {\n cursor: pointer;\n}\n.vdp-datepicker__calendar header .prev:not(.disabled):hover,\n.vdp-datepicker__calendar header .next:not(.disabled):hover,\n.vdp-datepicker__calendar header .up:not(.disabled):hover {\n background: #eee;\n}\n.vdp-datepicker__calendar .disabled {\n color: #ddd;\n cursor: default;\n}\n.vdp-datepicker__calendar .flex-rtl {\n display: flex;\n width: inherit;\n flex-wrap: wrap;\n}\n.vdp-datepicker__calendar .cell {\n display: inline-block;\n padding: 0 5px;\n width: 14.285714285714286%;\n height: 40px;\n line-height: 40px;\n text-align: center;\n vertical-align: middle;\n border: 1px solid transparent;\n}\n.vdp-datepicker__calendar .cell:not(.blank):not(.disabled).day,\n.vdp-datepicker__calendar .cell:not(.blank):not(.disabled).month,\n.vdp-datepicker__calendar .cell:not(.blank):not(.disabled).year {\n cursor: pointer;\n}\n.vdp-datepicker__calendar .cell:not(.blank):not(.disabled).day:hover,\n.vdp-datepicker__calendar .cell:not(.blank):not(.disabled).month:hover,\n.vdp-datepicker__calendar .cell:not(.blank):not(.disabled).year:hover {\n border: 1px solid #4bd;\n}\n.vdp-datepicker__calendar .cell.selected {\n background: #4bd;\n}\n.vdp-datepicker__calendar .cell.selected:hover {\n background: #4bd;\n}\n.vdp-datepicker__calendar .cell.selected.highlighted {\n background: #4bd;\n}\n.vdp-datepicker__calendar .cell.highlighted {\n background: #cae5ed;\n}\n.vdp-datepicker__calendar .cell.highlighted.disabled {\n color: #a3a3a3;\n}\n.vdp-datepicker__calendar .cell.grey {\n color: #888;\n}\n.vdp-datepicker__calendar .cell.grey:hover {\n background: inherit;\n}\n.vdp-datepicker__calendar .cell.day-header {\n font-size: 75%;\n white-space: nowrap;\n cursor: inherit;\n}\n.vdp-datepicker__calendar .cell.day-header:hover {\n background: inherit;\n}\n.vdp-datepicker__calendar .month,\n.vdp-datepicker__calendar .year {\n width: 33.333%;\n}\n.vdp-datepicker__clear-button,\n.vdp-datepicker__calendar-button {\n cursor: pointer;\n font-style: normal;\n}\n.vdp-datepicker__clear-button.disabled,\n.vdp-datepicker__calendar-button.disabled {\n color: #999;\n cursor: default;\n}\n", map: {"version":3,"sources":["Datepicker.vue"],"names":[],"mappings":"AAAA;EACE,cAAc;AAChB;AACA;EACE,kBAAkB;EAClB,gBAAgB;AAClB;AACA;EACE,sBAAsB;AACxB;AACA;EACE,kBAAkB;EAClB,YAAY;EACZ,gBAAgB;EAChB,YAAY;EACZ,sBAAsB;AACxB;AACA;EACE,cAAc;EACd,iBAAiB;AACnB;AACA;EACE,qBAAqB;EACrB,kBAAkB;EAClB,yBAAyB;EACzB,WAAW;AACb;AACA;;EAEE,0BAA0B;EAC1B,WAAW;EACX,qBAAqB;EACrB,kBAAkB;AACpB;AACA;;EAEE,WAAW;EACX,kBAAkB;EAClB,SAAS;EACT,QAAQ;EACR,4CAA4C;EAC5C,6BAA6B;AAC/B;AACA;EACE,6BAA6B;EAC7B,iBAAiB;AACnB;AACA;EACE,6BAA6B;AAC/B;AACA;EACE,4BAA4B;EAC5B,gBAAgB;AAClB;AACA;EACE,4BAA4B;AAC9B;AACA;;;EAGE,eAAe;AACjB;AACA;;;EAGE,gBAAgB;AAClB;AACA;EACE,WAAW;EACX,eAAe;AACjB;AACA;EACE,aAAa;EACb,cAAc;EACd,eAAe;AACjB;AACA;EACE,qBAAqB;EACrB,cAAc;EACd,0BAA0B;EAC1B,YAAY;EACZ,iBAAiB;EACjB,kBAAkB;EAClB,sBAAsB;EACtB,6BAA6B;AAC/B;AACA;;;EAGE,eAAe;AACjB;AACA;;;EAGE,sBAAsB;AACxB;AACA;EACE,gBAAgB;AAClB;AACA;EACE,gBAAgB;AAClB;AACA;EACE,gBAAgB;AAClB;AACA;EACE,mBAAmB;AACrB;AACA;EACE,cAAc;AAChB;AACA;EACE,WAAW;AACb;AACA;EACE,mBAAmB;AACrB;AACA;EACE,cAAc;EACd,mBAAmB;EACnB,eAAe;AACjB;AACA;EACE,mBAAmB;AACrB;AACA;;EAEE,cAAc;AAChB;AACA;;EAEE,eAAe;EACf,kBAAkB;AACpB;AACA;;EAEE,WAAW;EACX,eAAe;AACjB","file":"Datepicker.vue","sourcesContent":[".rtl {\n direction: rtl;\n}\n.vdp-datepicker {\n position: relative;\n text-align: left;\n}\n.vdp-datepicker * {\n box-sizing: border-box;\n}\n.vdp-datepicker__calendar {\n position: absolute;\n z-index: 100;\n background: #fff;\n width: 300px;\n border: 1px solid #ccc;\n}\n.vdp-datepicker__calendar header {\n display: block;\n line-height: 40px;\n}\n.vdp-datepicker__calendar header span {\n display: inline-block;\n text-align: center;\n width: 71.42857142857143%;\n float: left;\n}\n.vdp-datepicker__calendar header .prev,\n.vdp-datepicker__calendar header .next {\n width: 14.285714285714286%;\n float: left;\n text-indent: -10000px;\n position: relative;\n}\n.vdp-datepicker__calendar header .prev:after,\n.vdp-datepicker__calendar header .next:after {\n content: '';\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translateX(-50%) translateY(-50%);\n border: 6px solid transparent;\n}\n.vdp-datepicker__calendar header .prev:after {\n border-right: 10px solid #000;\n margin-left: -5px;\n}\n.vdp-datepicker__calendar header .prev.disabled:after {\n border-right: 10px solid #ddd;\n}\n.vdp-datepicker__calendar header .next:after {\n border-left: 10px solid #000;\n margin-left: 5px;\n}\n.vdp-datepicker__calendar header .next.disabled:after {\n border-left: 10px solid #ddd;\n}\n.vdp-datepicker__calendar header .prev:not(.disabled),\n.vdp-datepicker__calendar header .next:not(.disabled),\n.vdp-datepicker__calendar header .up:not(.disabled) {\n cursor: pointer;\n}\n.vdp-datepicker__calendar header .prev:not(.disabled):hover,\n.vdp-datepicker__calendar header .next:not(.disabled):hover,\n.vdp-datepicker__calendar header .up:not(.disabled):hover {\n background: #eee;\n}\n.vdp-datepicker__calendar .disabled {\n color: #ddd;\n cursor: default;\n}\n.vdp-datepicker__calendar .flex-rtl {\n display: flex;\n width: inherit;\n flex-wrap: wrap;\n}\n.vdp-datepicker__calendar .cell {\n display: inline-block;\n padding: 0 5px;\n width: 14.285714285714286%;\n height: 40px;\n line-height: 40px;\n text-align: center;\n vertical-align: middle;\n border: 1px solid transparent;\n}\n.vdp-datepicker__calendar .cell:not(.blank):not(.disabled).day,\n.vdp-datepicker__calendar .cell:not(.blank):not(.disabled).month,\n.vdp-datepicker__calendar .cell:not(.blank):not(.disabled).year {\n cursor: pointer;\n}\n.vdp-datepicker__calendar .cell:not(.blank):not(.disabled).day:hover,\n.vdp-datepicker__calendar .cell:not(.blank):not(.disabled).month:hover,\n.vdp-datepicker__calendar .cell:not(.blank):not(.disabled).year:hover {\n border: 1px solid #4bd;\n}\n.vdp-datepicker__calendar .cell.selected {\n background: #4bd;\n}\n.vdp-datepicker__calendar .cell.selected:hover {\n background: #4bd;\n}\n.vdp-datepicker__calendar .cell.selected.highlighted {\n background: #4bd;\n}\n.vdp-datepicker__calendar .cell.highlighted {\n background: #cae5ed;\n}\n.vdp-datepicker__calendar .cell.highlighted.disabled {\n color: #a3a3a3;\n}\n.vdp-datepicker__calendar .cell.grey {\n color: #888;\n}\n.vdp-datepicker__calendar .cell.grey:hover {\n background: inherit;\n}\n.vdp-datepicker__calendar .cell.day-header {\n font-size: 75%;\n white-space: nowrap;\n cursor: inherit;\n}\n.vdp-datepicker__calendar .cell.day-header:hover {\n background: inherit;\n}\n.vdp-datepicker__calendar .month,\n.vdp-datepicker__calendar .year {\n width: 33.333%;\n}\n.vdp-datepicker__clear-button,\n.vdp-datepicker__calendar-button {\n cursor: pointer;\n font-style: normal;\n}\n.vdp-datepicker__clear-button.disabled,\n.vdp-datepicker__calendar-button.disabled {\n color: #999;\n cursor: default;\n}\n"]}, media: undefined });
};
/* scoped */
const __vue_scope_id__$4 = undefined;
/* module identifier */
const __vue_module_identifier__$4 = undefined;
/* functional template */
const __vue_is_functional_template__$4 = false;
/* style inject SSR */
var Datepicker = normalizeComponent_1(
{ render: __vue_render__$4, staticRenderFns: __vue_staticRenderFns__$4 },
__vue_inject_styles__$4,
__vue_script__$4,
__vue_scope_id__$4,
__vue_is_functional_template__$4,
__vue_module_identifier__$4,
browser,
undefined
);
export default Datepicker;
|
import React from 'react';
import {
Datagrid,
DateField,
Edit,
EditButton,
FormTab,
NumberInput,
Pagination,
ReferenceInput,
ReferenceManyField,
SelectInput,
TabbedForm,
TextField,
TextInput,
} from 'react-admin';
import { InputAdornment } from '@material-ui/core';
import { makeStyles } from '@material-ui/core/styles';
import RichTextInput from 'ra-input-rich-text';
import CustomerReferenceField from '../customers/CustomerReferenceField';
// import StarRatingField from '../reviews/StarRatingField';
import Poster from './Poster';
import { styles as createStyles } from './ProductCreate';
const ProductTitle = ({ record }) => <span>Poster #{record.reference}</span>;
const styles = {
...createStyles,
comment: {
maxWidth: '20em',
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
},
};
const useStyles = makeStyles(styles);
const ProductEdit = props => {
const classes = useStyles();
return (
<Edit {...props} title={<ProductTitle />}>
<TabbedForm>
<FormTab label="resources.products.tabs.image">
<Poster />
<TextInput source="image" fullWidth />
<TextInput source="thumbnail" fullWidth />
</FormTab>
<FormTab label="resources.products.tabs.details" path="details">
<TextInput source="reference" />
<NumberInput
source="price"
className={classes.price}
InputProps={{
startAdornment: (
<InputAdornment position="start">
€
</InputAdornment>
),
}}
/>
<NumberInput
source="width"
className={classes.width}
formClassName={classes.widthFormGroup}
InputProps={{
endAdornment: (
<InputAdornment position="start">
cm
</InputAdornment>
),
}}
/>
<NumberInput
source="height"
className={classes.height}
formClassName={classes.heightFormGroup}
InputProps={{
endAdornment: (
<InputAdornment position="start">
cm
</InputAdornment>
),
}}
/>
<ReferenceInput source="category_id" reference="categories">
<SelectInput source="name" />
</ReferenceInput>
<NumberInput source="stock" className={classes.stock} />
</FormTab>
<FormTab
label="resources.products.tabs.description"
path="description"
>
<RichTextInput source="description" label="" />
</FormTab>
<FormTab label="resources.products.tabs.reviews" path="reviews">
<ReferenceManyField
reference="reviews"
target="product_id"
addLabel={false}
pagination={<Pagination />}
fullWidth
>
<Datagrid>
<DateField source="date" />
<CustomerReferenceField />
{/* <StarRatingField /> */}
<TextField
source="comment"
cellClassName={classes.comment}
/>
<TextField source="status" />
<EditButton />
</Datagrid>
</ReferenceManyField>
</FormTab>
</TabbedForm>
</Edit>
);
};
export default ProductEdit;
|
angular.module('proton.message')
.factory('transformLinks', function() {
return function(html, message) {
var links = [].slice.call(html.querySelectorAll('a[href^=http]'));
if (links.length > 0) {
links.forEach(function(link) {
link.setAttribute('target','_blank');
link.setAttribute('rel', 'noreferrer');
});
}
return html;
};
});
|
import React from 'react';
import _ from 'lodash';
import SectionHeader from '../components/section-header';
import icons from 'otkit-icons/token.common';
import styles from '../styles/otkit-icons.module.css';
const Icons = () => {
const { iconSize } = icons;
const keys = _.keys(icons).sort();
const actualIcons = _.without(keys, 'iconSize');
const tokens = actualIcons.map(name => {
const value = icons[name];
return (
<div className={styles['card']} key={name}>
<div className={styles['icon-block']}>
<div
className={styles['icon']}
dangerouslySetInnerHTML={{ __html: value }}
/>
</div>
<div className={styles['icon-name']}>{_.kebabCase(name)}</div>
</div>
);
});
return (
<div className={styles['main-container']}>
<SectionHeader text="Icons" type="SectionHeader__small" />
<div className={styles['section-icon']}>{tokens}</div>
</div>
);
};
export default Icons;
|
/*
Given two strings S and T, return if they are equal when both are typed into empty text editors. # means a backspace character.
https://leetcode.com/problems/backspace-string-compare
Example 1:
Input: S = "ab#c", T = "ad#c"
Output: true
Explanation: Both S and T become "ac".
Example 2:
Input: S = "ab##", T = "c#d#"
Output: true
Explanation: Both S and T become "".
Example 3:
Input: S = "a##c", T = "#a#c"
Output: true
Explanation: Both S and T become "c".
Example 4:
Input: S = "a#c", T = "b"
Output: false
Explanation: S becomes "c" while T becomes "b".
Note:
1 <= S.length <= 200
1 <= T.length <= 200
S and T only contain lowercase letters and '#' characters.
Follow up:
Can you solve it in O(N) time and O(1) space?
*/
/**
* @param {string} S
* @param {string} T
* @return {boolean}
*/
var backspaceCompare = function(S, T) {
var iterS = S.length - 1;
var iterT = T.length - 1;
while(iterS >= 0 || iterT >= 0) {
if(iterS >= 0 && S.charAt(iterS) === "#") {
var countBack = 0;
while(iterS >= 0 && (countBack > 0 || S[iterS] === "#")) {
if(iterS >= 0 && S[iterS] === "#") {
countBack++;
} else {
countBack--;
}
iterS--;
}
} else if(iterT >= 0 && T.charAt(iterT) === "#") {
var countBack = 0;
while(iterT >= 0 && (countBack > 0 || T[iterT] === "#")) {
if(iterT >= 0 && T[iterT] === "#") {
countBack++;
} else {
countBack--;
}
iterT--;
}
} else {
if(iterS < 0 || iterT < 0 || S.charAt(iterS) !== T.charAt(iterT))
return false;
iterS--;
iterT--;
}
}
return iterS < 0 && iterT < 0;
};
// Naive Aproach
var backspaceCompare2 = function(S, T) {
var stackS = [];
for(var i = 0; i < S.length; i++) {
if(S.charAt(i) === "#")
stackS.shift();
else
stackS.unshift(S.charAt(i));
}
var stackT = [];
for(var i = 0; i < T.length; i++) {
if(T.charAt(i) === "#")
stackT.shift();
else
stackT.unshift(T.charAt(i));
}
while(stackS.length > 0 && stackT.length > 0) {
var elemS = stackS.shift();
var elemT = stackT.shift();
if(elemS !== elemT)
return false;
}
return stackS.length === 0 && stackT.length === 0;
};
module.exports.backspaceCompare = backspaceCompare;
module.exports.backspaceCompare2 = backspaceCompare2;
|
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.JitsiMeetJS=t():e.JitsiMeetJS=t()}(window,(function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=153)}([function(e,t){e.exports={ADD_ICE_CANDIDATE_FAILED:"xmpp.add_ice_candidate_failed",AUDIO_MUTED_BY_FOCUS:"xmpp.audio_muted_by_focus",VIDEO_MUTED_BY_FOCUS:"xmpp.video_muted_by_focus",AUTHENTICATION_REQUIRED:"xmpp.authentication_required",BRIDGE_DOWN:"xmpp.bridge_down",CALL_ACCEPTED:"xmpp.callaccepted.jingle",CALL_INCOMING:"xmpp.callincoming.jingle",CALL_ENDED:"xmpp.callended.jingle",CHAT_ERROR_RECEIVED:"xmpp.chat_error_received",CONFERENCE_PROPERTIES_CHANGED:"xmpp.conference_properties_changed",CONNECTION_ESTABLISHED:"xmpp.connection.connected",CONNECTION_FAILED:"xmpp.connection.failed",CONNECTION_INTERRUPTED:"xmpp.connection.interrupted",CONNECTION_RESTORED:"xmpp.connection.restored",CONNECTION_ICE_FAILED:"xmpp.connection.ice.failed",CONNECTION_RESTARTED:"xmpp.connection.restart",CONNECTION_STATUS_CHANGED:"xmpp.connection.status.changed",DISPLAY_NAME_CHANGED:"xmpp.display_name_changed",EMUC_ROOM_ADDED:"xmpp.emuc_room_added",EMUC_ROOM_REMOVED:"xmpp.emuc_room_removed",ETHERPAD:"xmpp.etherpad",FOCUS_DISCONNECTED:"xmpp.focus_disconnected",FOCUS_LEFT:"xmpp.focus_left",GRACEFUL_SHUTDOWN:"xmpp.graceful_shutdown",ICE_RESTARTING:"rtc.ice_restarting",ICE_RESTART_SUCCESS:"rtc.ice_restart_success",KICKED:"xmpp.kicked",LOCAL_ROLE_CHANGED:"xmpp.localrole_changed",MEETING_ID_SET:"xmpp.meeting_id_set",MESSAGE_RECEIVED:"xmpp.message_received",INVITE_MESSAGE_RECEIVED:"xmpp.invite_message_received",PRIVATE_MESSAGE_RECEIVED:"xmpp.private_message_received",MUC_MEMBER_BOT_TYPE_CHANGED:"xmpp.muc_member_bot_type_changed",MUC_DESTROYED:"xmpp.muc_destroyed",MUC_JOINED:"xmpp.muc_joined",MUC_MEMBER_JOINED:"xmpp.muc_member_joined",MUC_MEMBER_LEFT:"xmpp.muc_member_left",MUC_LOBBY_MEMBER_JOINED:"xmpp.muc_lobby_member_joined",MUC_LOBBY_MEMBER_UPDATED:"xmpp.muc_lobby_member_updated",MUC_LOBBY_MEMBER_LEFT:"xmpp.muc_lobby_member_left",MUC_DENIED_ACCESS:"xmpp.muc_denied access",MUC_LEFT:"xmpp.muc_left",MUC_ROLE_CHANGED:"xmpp.muc_role_changed",MUC_LOCK_CHANGED:"xmpp.muc_lock_changed",MUC_MEMBERS_ONLY_CHANGED:"xmpp.muc_members_only_changed",PARTICIPANT_AUDIO_MUTED:"xmpp.audio_muted",PARTICIPANT_VIDEO_MUTED:"xmpp.video_muted",PARTICIPANT_VIDEO_TYPE_CHANGED:"xmpp.video_type",PARTICIPANT_FEATURES_CHANGED:"xmpp.participant_features_changed",PASSWORD_REQUIRED:"xmpp.password_required",PHONE_NUMBER_CHANGED:"conference.phoneNumberChanged",PRESENCE_RECEIVED:"xmpp.presence_received",PRESENCE_STATUS:"xmpp.presence_status",PROMPT_FOR_LOGIN:"xmpp.prompt_for_login",READY_TO_JOIN:"xmpp.ready_to_join",RECORDER_STATE_CHANGED:"xmpp.recorderStateChanged",REMOTE_STATS:"xmpp.remote_stats",RENEGOTIATION_FAILED:"xmpp.renegotiation_failed",RESERVATION_ERROR:"xmpp.room_reservation_error",ROOM_CONNECT_ERROR:"xmpp.room_connect_error",ROOM_CONNECT_NOT_ALLOWED_ERROR:"xmpp.room_connect_error.not_allowed",ROOM_JOIN_ERROR:"xmpp.room_join_error",ROOM_CONNECT_MEMBERS_ONLY_ERROR:"xmpp.room_connect_error.members_only",ROOM_MAX_USERS_ERROR:"xmpp.room_max_users_error",SENDING_CHAT_MESSAGE:"xmpp.sending_chat_message",SENDING_PRIVATE_CHAT_MESSAGE:"xmpp.sending_private_chat_message",SESSION_ACCEPT_TIMEOUT:"xmpp.session_accept_timeout",SPEAKER_STATS_RECEIVED:"xmpp.speaker_stats_received",CONFERENCE_TIMESTAMP_RECEIVED:"xmpp.conference_timestamp_received",AV_MODERATION_APPROVED:"xmpp.av_moderation.approved",AV_MODERATION_RECEIVED:"xmpp.av_moderation.received",AV_MODERATION_CHANGED:"xmpp.av_moderation.changed",AV_MODERATION_PARTICIPANT_APPROVED:"xmpp.av_moderation.participant.approved",START_MUTED_FROM_FOCUS:"xmpp.start_muted_from_focus",SUBJECT_CHANGED:"xmpp.subject_changed",SUSPEND_DETECTED:"xmpp.suspend_detected",TRANSCRIPTION_STATUS_CHANGED:"xmpp.transcription_status_changed",TRANSPORT_INFO:"xmpp.transportinfo.jingle",VIDEO_SIP_GW_AVAILABILITY_CHANGED:"xmpp.videoSIPGWAvailabilityChanged",VIDEO_SIP_GW_SESSION_STATE_CHANGED:"xmpp.videoSIPGWSessionStateChanged",ICE_CONNECTION_STATE_CHANGED:"xmpp.ice_connection_state_changed",JSON_MESSAGE_RECEIVED:"xmmp.json_message_received"}},function(e,t,n){"use strict";n.r(t),n.d(t,"AUDIO_INPUT_STATE_CHANGE",(function(){return i})),n.d(t,"AUTH_STATUS_CHANGED",(function(){return r})),n.d(t,"BEFORE_STATISTICS_DISPOSED",(function(){return s})),n.d(t,"CONFERENCE_ERROR",(function(){return o})),n.d(t,"CONFERENCE_FAILED",(function(){return a})),n.d(t,"CONFERENCE_JOINED",(function(){return c})),n.d(t,"CONFERENCE_LEFT",(function(){return d})),n.d(t,"CONFERENCE_UNIQUE_ID_SET",(function(){return u})),n.d(t,"CONNECTION_ESTABLISHED",(function(){return l})),n.d(t,"CONNECTION_INTERRUPTED",(function(){return h})),n.d(t,"CONNECTION_RESTORED",(function(){return p})),n.d(t,"DATA_CHANNEL_OPENED",(function(){return m})),n.d(t,"DISPLAY_NAME_CHANGED",(function(){return f})),n.d(t,"DOMINANT_SPEAKER_CHANGED",(function(){return g})),n.d(t,"CONFERENCE_CREATED_TIMESTAMP",(function(){return _})),n.d(t,"DTMF_SUPPORT_CHANGED",(function(){return v})),n.d(t,"ENDPOINT_MESSAGE_RECEIVED",(function(){return S})),n.d(t,"ENDPOINT_STATS_RECEIVED",(function(){return y})),n.d(t,"JVB121_STATUS",(function(){return E})),n.d(t,"KICKED",(function(){return b})),n.d(t,"PARTICIPANT_KICKED",(function(){return C})),n.d(t,"LAST_N_ENDPOINTS_CHANGED",(function(){return T})),n.d(t,"LOCK_STATE_CHANGED",(function(){return R})),n.d(t,"SERVER_REGION_CHANGED",(function(){return A})),n.d(t,"_MEDIA_SESSION_STARTED",(function(){return I})),n.d(t,"_MEDIA_SESSION_ACTIVE_CHANGED",(function(){return w})),n.d(t,"MEMBERS_ONLY_CHANGED",(function(){return P})),n.d(t,"MESSAGE_RECEIVED",(function(){return O})),n.d(t,"NO_AUDIO_INPUT",(function(){return D})),n.d(t,"NOISY_MIC",(function(){return N})),n.d(t,"NON_PARTICIPANT_MESSAGE_RECEIVED",(function(){return M})),n.d(t,"PRIVATE_MESSAGE_RECEIVED",(function(){return L})),n.d(t,"PARTICIPANT_CONN_STATUS_CHANGED",(function(){return k})),n.d(t,"PARTCIPANT_FEATURES_CHANGED",(function(){return x})),n.d(t,"PARTICIPANT_PROPERTY_CHANGED",(function(){return F})),n.d(t,"P2P_STATUS",(function(){return j})),n.d(t,"PHONE_NUMBER_CHANGED",(function(){return U})),n.d(t,"PROPERTIES_CHANGED",(function(){return H})),n.d(t,"RECORDER_STATE_CHANGED",(function(){return V})),n.d(t,"VIDEO_SIP_GW_AVAILABILITY_CHANGED",(function(){return B})),n.d(t,"VIDEO_SIP_GW_SESSION_STATE_CHANGED",(function(){return J})),n.d(t,"START_MUTED_POLICY_CHANGED",(function(){return G})),n.d(t,"STARTED_MUTED",(function(){return $})),n.d(t,"SUBJECT_CHANGED",(function(){return K})),n.d(t,"SUSPEND_DETECTED",(function(){return q})),n.d(t,"TALK_WHILE_MUTED",(function(){return W})),n.d(t,"TRACK_ADDED",(function(){return z})),n.d(t,"TRACK_AUDIO_LEVEL_CHANGED",(function(){return Q})),n.d(t,"TRACK_MUTE_CHANGED",(function(){return Y})),n.d(t,"TRACK_REMOVED",(function(){return X})),n.d(t,"TRANSCRIPTION_STATUS_CHANGED",(function(){return Z})),n.d(t,"USER_JOINED",(function(){return ee})),n.d(t,"USER_LEFT",(function(){return te})),n.d(t,"USER_ROLE_CHANGED",(function(){return ne})),n.d(t,"USER_STATUS_CHANGED",(function(){return ie})),n.d(t,"BOT_TYPE_CHANGED",(function(){return re})),n.d(t,"LOBBY_USER_JOINED",(function(){return se})),n.d(t,"LOBBY_USER_UPDATED",(function(){return oe})),n.d(t,"LOBBY_USER_LEFT",(function(){return ae})),n.d(t,"AV_MODERATION_APPROVED",(function(){return ce})),n.d(t,"AV_MODERATION_CHANGED",(function(){return de})),n.d(t,"AV_MODERATION_PARTICIPANT_APPROVED",(function(){return ue}));const i="conference.audio_input_state_changed",r="conference.auth_status_changed",s="conference.beforeStatisticsDisposed",o="conference.error",a="conference.failed",c="conference.joined",d="conference.left",u="conference.unique_id_set",l="conference.connectionEstablished",h="conference.connectionInterrupted",p="conference.connectionRestored",m="conference.dataChannelOpened",f="conference.displayNameChanged",g="conference.dominantSpeaker",_="conference.createdTimestamp",v="conference.dtmfSupportChanged",S="conference.endpoint_message_received",y="conference.endpoint_stats_received",E="conference.jvb121Status",b="conference.kicked",C="conference.participant_kicked",T="conference.lastNEndpointsChanged",R="conference.lock_state_changed",A="conference.server_region_changed",I="conference.media_session.started",w="conference.media_session.active_changed",P="conference.membersOnlyChanged",O="conference.messageReceived",D="conference.no_audio_input",N="conference.noisy_mic",M="conference.non_participant_message_received",L="conference.privateMessageReceived",k="conference.participant_conn_status_changed",x="conference.partcipant_features_changed",F="conference.participant_property_changed",j="conference.p2pStatus",U="conference.phoneNumberChanged",H="conference.propertiesChanged",V="conference.recorderStateChanged",B="conference.videoSIPGWAvailabilityChanged",J="conference.videoSIPGWSessionStateChanged",G="conference.start_muted_policy_changed",$="conference.started_muted",K="conference.subjectChanged",q="conference.suspendDetected",W="conference.talk_while_muted",z="conference.trackAdded",Q="conference.audioLevelsChanged",Y="conference.trackMuteChanged",X="conference.trackRemoved",Z="conference.transcriptionStatusChanged",ee="conference.userJoined",te="conference.userLeft",ne="conference.roleChanged",ie="conference.statusChanged",re="conference.bot_type_changed",se="conference.lobby.userJoined",oe="conference.lobby.userUpdated",ae="conference.lobby.userLeft",ce="conference.av_moderation.approved",de="conference.av_moderation.changed",ue="conference.av_moderation.participant.approved"},function(e,t,n){(function(t){var n;n=function(){"use strict";var e=void 0!==t?t:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var r=function(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n},s=function(e){if("string"!=typeof e)throw new Error("str2binl was passed a non-string");for(var t=[],n=0;n<8*e.length;n+=8)t[n>>5]|=(255&e.charCodeAt(n/8))<<n%32;return t},o=function(e,t,n,i,s,o){return r((a=r(r(t,e),r(i,o)))<<(c=s)|a>>>32-c,n);var a,c},a=function(e,t,n,i,r,s,a){return o(t&n|~t&i,e,t,r,s,a)},c=function(e,t,n,i,r,s,a){return o(t&i|n&~i,e,t,r,s,a)},d=function(e,t,n,i,r,s,a){return o(t^n^i,e,t,r,s,a)},u=function(e,t,n,i,r,s,a){return o(n^(t|~i),e,t,r,s,a)},l=function(e,t){e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;for(var n,i,s,o,l=1732584193,h=-271733879,p=-1732584194,m=271733878,f=0;f<e.length;f+=16)n=l,i=h,s=p,o=m,l=a(l,h,p,m,e[f+0],7,-680876936),m=a(m,l,h,p,e[f+1],12,-389564586),p=a(p,m,l,h,e[f+2],17,606105819),h=a(h,p,m,l,e[f+3],22,-1044525330),l=a(l,h,p,m,e[f+4],7,-176418897),m=a(m,l,h,p,e[f+5],12,1200080426),p=a(p,m,l,h,e[f+6],17,-1473231341),h=a(h,p,m,l,e[f+7],22,-45705983),l=a(l,h,p,m,e[f+8],7,1770035416),m=a(m,l,h,p,e[f+9],12,-1958414417),p=a(p,m,l,h,e[f+10],17,-42063),h=a(h,p,m,l,e[f+11],22,-1990404162),l=a(l,h,p,m,e[f+12],7,1804603682),m=a(m,l,h,p,e[f+13],12,-40341101),p=a(p,m,l,h,e[f+14],17,-1502002290),h=a(h,p,m,l,e[f+15],22,1236535329),l=c(l,h,p,m,e[f+1],5,-165796510),m=c(m,l,h,p,e[f+6],9,-1069501632),p=c(p,m,l,h,e[f+11],14,643717713),h=c(h,p,m,l,e[f+0],20,-373897302),l=c(l,h,p,m,e[f+5],5,-701558691),m=c(m,l,h,p,e[f+10],9,38016083),p=c(p,m,l,h,e[f+15],14,-660478335),h=c(h,p,m,l,e[f+4],20,-405537848),l=c(l,h,p,m,e[f+9],5,568446438),m=c(m,l,h,p,e[f+14],9,-1019803690),p=c(p,m,l,h,e[f+3],14,-187363961),h=c(h,p,m,l,e[f+8],20,1163531501),l=c(l,h,p,m,e[f+13],5,-1444681467),m=c(m,l,h,p,e[f+2],9,-51403784),p=c(p,m,l,h,e[f+7],14,1735328473),h=c(h,p,m,l,e[f+12],20,-1926607734),l=d(l,h,p,m,e[f+5],4,-378558),m=d(m,l,h,p,e[f+8],11,-2022574463),p=d(p,m,l,h,e[f+11],16,1839030562),h=d(h,p,m,l,e[f+14],23,-35309556),l=d(l,h,p,m,e[f+1],4,-1530992060),m=d(m,l,h,p,e[f+4],11,1272893353),p=d(p,m,l,h,e[f+7],16,-155497632),h=d(h,p,m,l,e[f+10],23,-1094730640),l=d(l,h,p,m,e[f+13],4,681279174),m=d(m,l,h,p,e[f+0],11,-358537222),p=d(p,m,l,h,e[f+3],16,-722521979),h=d(h,p,m,l,e[f+6],23,76029189),l=d(l,h,p,m,e[f+9],4,-640364487),m=d(m,l,h,p,e[f+12],11,-421815835),p=d(p,m,l,h,e[f+15],16,530742520),h=d(h,p,m,l,e[f+2],23,-995338651),l=u(l,h,p,m,e[f+0],6,-198630844),m=u(m,l,h,p,e[f+7],10,1126891415),p=u(p,m,l,h,e[f+14],15,-1416354905),h=u(h,p,m,l,e[f+5],21,-57434055),l=u(l,h,p,m,e[f+12],6,1700485571),m=u(m,l,h,p,e[f+3],10,-1894986606),p=u(p,m,l,h,e[f+10],15,-1051523),h=u(h,p,m,l,e[f+1],21,-2054922799),l=u(l,h,p,m,e[f+8],6,1873313359),m=u(m,l,h,p,e[f+15],10,-30611744),p=u(p,m,l,h,e[f+6],15,-1560198380),h=u(h,p,m,l,e[f+13],21,1309151649),l=u(l,h,p,m,e[f+4],6,-145523070),m=u(m,l,h,p,e[f+11],10,-1120210379),p=u(p,m,l,h,e[f+2],15,718787259),h=u(h,p,m,l,e[f+9],21,-343485551),l=r(l,n),h=r(h,i),p=r(p,s),m=r(m,o);return[l,h,p,m]},h={hexdigest:function(e){return function(e){for(var t="",n=0;n<4*e.length;n++)t+="0123456789abcdef".charAt(e[n>>2]>>n%4*8+4&15)+"0123456789abcdef".charAt(e[n>>2]>>n%4*8&15);return t}(l(s(e),8*e.length))},hash:function(e){return function(e){for(var t="",n=0;n<32*e.length;n+=8)t+=String.fromCharCode(e[n>>5]>>>n%32&255);return t}(l(s(e),8*e.length))}};function p(e,t){e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t;var n,i,r,s,o,a,c,d,u=new Array(80),l=1732584193,h=-271733879,p=-1732584194,g=271733878,S=-1009589776;for(n=0;n<e.length;n+=16){for(s=l,o=h,a=p,c=g,d=S,i=0;i<80;i++)u[i]=i<16?e[n+i]:v(u[i-3]^u[i-8]^u[i-14]^u[i-16],1),r=_(_(v(l,5),m(i,h,p,g)),_(_(S,u[i]),f(i))),S=g,g=p,p=v(h,30),h=l,l=r;l=_(l,s),h=_(h,o),p=_(p,a),g=_(g,c),S=_(S,d)}return[l,h,p,g,S]}function m(e,t,n,i){return e<20?t&n|~t&i:e<40?t^n^i:e<60?t&n|t&i|n&i:t^n^i}function f(e){return e<20?1518500249:e<40?1859775393:e<60?-1894007588:-899497514}function g(e,t){var n=S(e);n.length>16&&(n=p(n,8*e.length));for(var i=new Array(16),r=new Array(16),s=0;s<16;s++)i[s]=909522486^n[s],r[s]=1549556828^n[s];var o=p(i.concat(S(t)),512+8*t.length);return p(r.concat(o),672)}function _(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function v(e,t){return e<<t|e>>>32-t}function S(e){for(var t=[],n=0;n<8*e.length;n+=8)t[n>>5]|=(255&e.charCodeAt(n/8))<<24-n%32;return t}function y(e){for(var t,n,i="",r=0;r<4*e.length;r+=3)for(t=(e[r>>2]>>8*(3-r%4)&255)<<16|(e[r+1>>2]>>8*(3-(r+1)%4)&255)<<8|e[r+2>>2]>>8*(3-(r+2)%4)&255,n=0;n<4;n++)8*r+6*n>32*e.length?i+="=":i+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t>>6*(3-n)&63);return i}function E(e){for(var t="",n=0;n<32*e.length;n+=8)t+=String.fromCharCode(e[n>>5]>>>24-n%32&255);return t}var b={b64_hmac_sha1:function(e,t){return y(g(e,t))},b64_sha1:function(e){return y(p(S(e),8*e.length))},binb2str:E,core_hmac_sha1:g,str_hmac_sha1:function(e,t){return E(g(e,t))},str_sha1:function(e){return E(p(S(e),8*e.length))}},C=function(e){var t,n,i="",r=e.length;for(t=0;t<r;t++)(n=e.charCodeAt(t))>=0&&n<=127?i+=e.charAt(t):n>2047?(i+=String.fromCharCode(224|n>>12&15),i+=String.fromCharCode(128|n>>6&63),i+=String.fromCharCode(128|n>>0&63)):(i+=String.fromCharCode(192|n>>6&31),i+=String.fromCharCode(128|n>>0&63));return i},T=function(e){for(var t in e=e||{})if(Object.prototype.hasOwnProperty.call(e,t)){var i="",r="",s="",o=e[t],a="object"===n(o),c=escape(unescape(a?o.value:o));a&&(i=o.expires?";expires="+o.expires:"",r=o.domain?";domain="+o.domain:"",s=o.path?";path="+o.path:""),document.cookie=t+"="+c+i+r+s}};function R(e,t){return new w.Builder(e,t)}function A(e){return new w.Builder("iq",e)}function I(e){return new w.Builder("presence",e)}var w={VERSION:"@VERSION@",NS:{HTTPBIND:"http://jabber.org/protocol/httpbind",BOSH:"urn:xmpp:xbosh",CLIENT:"jabber:client",AUTH:"jabber:iq:auth",ROSTER:"jabber:iq:roster",PROFILE:"jabber:iq:profile",DISCO_INFO:"http://jabber.org/protocol/disco#info",DISCO_ITEMS:"http://jabber.org/protocol/disco#items",MUC:"http://jabber.org/protocol/muc",SASL:"urn:ietf:params:xml:ns:xmpp-sasl",STREAM:"http://etherx.jabber.org/streams",FRAMING:"urn:ietf:params:xml:ns:xmpp-framing",BIND:"urn:ietf:params:xml:ns:xmpp-bind",SESSION:"urn:ietf:params:xml:ns:xmpp-session",VERSION:"jabber:iq:version",STANZAS:"urn:ietf:params:xml:ns:xmpp-stanzas",XHTML_IM:"http://jabber.org/protocol/xhtml-im",XHTML:"http://www.w3.org/1999/xhtml"},XHTML:{tags:["a","blockquote","br","cite","em","img","li","ol","p","span","strong","ul","body"],attributes:{a:["href"],blockquote:["style"],br:[],cite:["style"],em:[],img:["src","alt","style","height","width"],li:["style"],ol:["style"],p:["style"],span:["style"],strong:[],ul:["style"],body:[]},css:["background-color","color","font-family","font-size","font-style","font-weight","margin-left","margin-right","text-align","text-decoration"],validTag:function(e){for(var t=0;t<w.XHTML.tags.length;t++)if(e===w.XHTML.tags[t])return!0;return!1},validAttribute:function(e,t){if(void 0!==w.XHTML.attributes[e]&&w.XHTML.attributes[e].length>0)for(var n=0;n<w.XHTML.attributes[e].length;n++)if(t===w.XHTML.attributes[e][n])return!0;return!1},validCSS:function(e){for(var t=0;t<w.XHTML.css.length;t++)if(e===w.XHTML.css[t])return!0;return!1}},Status:{ERROR:0,CONNECTING:1,CONNFAIL:2,AUTHENTICATING:3,AUTHFAIL:4,CONNECTED:5,DISCONNECTED:6,DISCONNECTING:7,ATTACHED:8,REDIRECT:9,CONNTIMEOUT:10,BINDREQUIRED:11},ErrorCondition:{BAD_FORMAT:"bad-format",CONFLICT:"conflict",MISSING_JID_NODE:"x-strophe-bad-non-anon-jid",NO_AUTH_MECH:"no-auth-mech",UNKNOWN_REASON:"unknown"},LogLevel:{DEBUG:0,INFO:1,WARN:2,ERROR:3,FATAL:4},ElementType:{NORMAL:1,TEXT:3,CDATA:4,FRAGMENT:11},TIMEOUT:1.1,SECONDARY_TIMEOUT:.1,addNamespace:function(e,t){w.NS[e]=t},forEachChild:function(e,t,n){for(var i=0;i<e.childNodes.length;i++){var r=e.childNodes[i];r.nodeType!==w.ElementType.NORMAL||t&&!this.isTagEqual(r,t)||n(r)}},isTagEqual:function(e,t){return e.tagName===t},_xmlGenerator:null,_makeGenerator:function(){var e;return void 0===document.implementation.createDocument||document.implementation.createDocument&&document.documentMode&&document.documentMode<10?(e=this._getIEXmlDom()).appendChild(e.createElement("strophe")):e=document.implementation.createDocument("jabber:client","strophe",null),e},xmlGenerator:function(){return w._xmlGenerator||(w._xmlGenerator=w._makeGenerator()),w._xmlGenerator},_getIEXmlDom:function(){for(var e=null,t=["Msxml2.DOMDocument.6.0","Msxml2.DOMDocument.5.0","Msxml2.DOMDocument.4.0","MSXML2.DOMDocument.3.0","MSXML2.DOMDocument","MSXML.DOMDocument","Microsoft.XMLDOM"],n=0;n<t.length&&null===e;n++)try{e=new ActiveXObject(t[n])}catch(t){e=null}return e},xmlElement:function(e){if(!e)return null;for(var t=w.xmlGenerator().createElement(e),i=1;i<arguments.length;i++){var r=arguments[i];if(r)if("string"==typeof r||"number"==typeof r)t.appendChild(w.xmlTextNode(r));else if("object"===n(r)&&"function"==typeof r.sort)for(var s=0;s<r.length;s++){var o=r[s];"object"===n(o)&&"function"==typeof o.sort&&void 0!==o[1]&&null!==o[1]&&t.setAttribute(o[0],o[1])}else if("object"===n(r))for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&void 0!==r[a]&&null!==r[a]&&t.setAttribute(a,r[a])}return t},xmlescape:function(e){return e=(e=(e=(e=(e=e.replace(/\&/g,"&")).replace(/</g,"<")).replace(/>/g,">")).replace(/'/g,"'")).replace(/"/g,""")},xmlunescape:function(e){return e=(e=(e=(e=(e=e.replace(/\&/g,"&")).replace(/</g,"<")).replace(/>/g,">")).replace(/'/g,"'")).replace(/"/g,'"')},xmlTextNode:function(e){return w.xmlGenerator().createTextNode(e)},xmlHtmlNode:function(e){var t;return DOMParser?t=(new DOMParser).parseFromString(e,"text/xml"):((t=new ActiveXObject("Microsoft.XMLDOM")).async="false",t.loadXML(e)),t},getText:function(e){if(!e)return null;var t="";0===e.childNodes.length&&e.nodeType===w.ElementType.TEXT&&(t+=e.nodeValue);for(var n=0;n<e.childNodes.length;n++)e.childNodes[n].nodeType===w.ElementType.TEXT&&(t+=e.childNodes[n].nodeValue);return w.xmlescape(t)},copyElement:function(e){var t;if(e.nodeType===w.ElementType.NORMAL){t=w.xmlElement(e.tagName);for(var n=0;n<e.attributes.length;n++)t.setAttribute(e.attributes[n].nodeName,e.attributes[n].value);for(var i=0;i<e.childNodes.length;i++)t.appendChild(w.copyElement(e.childNodes[i]))}else e.nodeType===w.ElementType.TEXT&&(t=w.xmlGenerator().createTextNode(e.nodeValue));return t},createHtml:function(e){var t;if(e.nodeType===w.ElementType.NORMAL){var i=e.nodeName.toLowerCase();if(w.XHTML.validTag(i))try{t=w.xmlElement(i);for(var r=0;r<w.XHTML.attributes[i].length;r++){var s=w.XHTML.attributes[i][r],o=e.getAttribute(s);if(null!=o&&""!==o&&!1!==o&&0!==o)if("style"===s&&"object"===n(o)&&void 0!==o.cssText&&(o=o.cssText),"style"===s){for(var a=[],c=o.split(";"),d=0;d<c.length;d++){var u=c[d].split(":"),l=u[0].replace(/^\s*/,"").replace(/\s*$/,"").toLowerCase();if(w.XHTML.validCSS(l)){var h=u[1].replace(/^\s*/,"").replace(/\s*$/,"");a.push(l+": "+h)}}a.length>0&&(o=a.join("; "),t.setAttribute(s,o))}else t.setAttribute(s,o)}for(var p=0;p<e.childNodes.length;p++)t.appendChild(w.createHtml(e.childNodes[p]))}catch(e){t=w.xmlTextNode("")}else{t=w.xmlGenerator().createDocumentFragment();for(var m=0;m<e.childNodes.length;m++)t.appendChild(w.createHtml(e.childNodes[m]))}}else if(e.nodeType===w.ElementType.FRAGMENT){t=w.xmlGenerator().createDocumentFragment();for(var f=0;f<e.childNodes.length;f++)t.appendChild(w.createHtml(e.childNodes[f]))}else e.nodeType===w.ElementType.TEXT&&(t=w.xmlTextNode(e.nodeValue));return t},escapeNode:function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"").replace(/\\/g,"\\5c").replace(/ /g,"\\20").replace(/\"/g,"\\22").replace(/\&/g,"\\26").replace(/\'/g,"\\27").replace(/\//g,"\\2f").replace(/:/g,"\\3a").replace(/</g,"\\3c").replace(/>/g,"\\3e").replace(/@/g,"\\40")},unescapeNode:function(e){return"string"!=typeof e?e:e.replace(/\\20/g," ").replace(/\\22/g,'"').replace(/\\26/g,"&").replace(/\\27/g,"'").replace(/\\2f/g,"/").replace(/\\3a/g,":").replace(/\\3c/g,"<").replace(/\\3e/g,">").replace(/\\40/g,"@").replace(/\\5c/g,"\\")},getNodeFromJid:function(e){return e.indexOf("@")<0?null:e.split("@")[0]},getDomainFromJid:function(e){var t=w.getBareJidFromJid(e);if(t.indexOf("@")<0)return t;var n=t.split("@");return n.splice(0,1),n.join("@")},getResourceFromJid:function(e){if(!e)return null;var t=e.split("/");return t.length<2?null:(t.splice(0,1),t.join("/"))},getBareJidFromJid:function(e){return e?e.split("/")[0]:null},_handleError:function(e){void 0!==e.stack&&w.fatal(e.stack),e.sourceURL?w.fatal("error: "+this.handler+" "+e.sourceURL+":"+e.line+" - "+e.name+": "+e.message):e.fileName?w.fatal("error: "+this.handler+" "+e.fileName+":"+e.lineNumber+" - "+e.name+": "+e.message):w.fatal("error: "+e.message)},log:function(e,t){e===this.LogLevel.FATAL&&"object"===n(window.console)&&"function"==typeof window.console.error&&window.console.error(t)},debug:function(e){this.log(this.LogLevel.DEBUG,e)},info:function(e){this.log(this.LogLevel.INFO,e)},warn:function(e){this.log(this.LogLevel.WARN,e)},error:function(e){this.log(this.LogLevel.ERROR,e)},fatal:function(e){this.log(this.LogLevel.FATAL,e)},serialize:function(e){if(!e)return null;"function"==typeof e.tree&&(e=e.tree());var t=i(Array(e.attributes.length).keys()).map((function(t){return e.attributes[t].nodeName}));t.sort();var n=t.reduce((function(t,n){return"".concat(t," ").concat(n,'="').concat(w.xmlescape(e.attributes.getNamedItem(n).value),'"')}),"<".concat(e.nodeName));if(e.childNodes.length>0){n+=">";for(var r=0;r<e.childNodes.length;r++){var s=e.childNodes[r];switch(s.nodeType){case w.ElementType.NORMAL:n+=w.serialize(s);break;case w.ElementType.TEXT:n+=w.xmlescape(s.nodeValue);break;case w.ElementType.CDATA:n+="<![CDATA["+s.nodeValue+"]]>"}}n+="</"+e.nodeName+">"}else n+="/>";return n},_requestId:0,_connectionPlugins:{},addConnectionPlugin:function(e,t){w._connectionPlugins[e]=t},Builder:function(e,t){"presence"!==e&&"message"!==e&&"iq"!==e||(t&&!t.xmlns?t.xmlns=w.NS.CLIENT:t||(t={xmlns:w.NS.CLIENT})),this.nodeTree=w.xmlElement(e,t),this.node=this.nodeTree}};w.Builder.prototype={tree:function(){return this.nodeTree},toString:function(){return w.serialize(this.nodeTree)},up:function(){return this.node=this.node.parentNode,this},root:function(){return this.node=this.nodeTree,this},attrs:function(e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(void 0===e[t]?this.node.removeAttribute(t):this.node.setAttribute(t,e[t]));return this},c:function(e,t,n){var i=w.xmlElement(e,t,n);return this.node.appendChild(i),"string"!=typeof n&&"number"!=typeof n&&(this.node=i),this},cnode:function(e){var t,n=w.xmlGenerator();try{t=void 0!==n.importNode}catch(e){t=!1}var i=t?n.importNode(e,!0):w.copyElement(e);return this.node.appendChild(i),this.node=i,this},t:function(e){var t=w.xmlTextNode(e);return this.node.appendChild(t),this},h:function(e){var t=document.createElement("body");t.innerHTML=e;for(var n=w.createHtml(t);n.childNodes.length>0;)this.node.appendChild(n.childNodes[0]);return this}},w.Handler=function(e,t,n,i,r,s,o){this.handler=e,this.ns=t,this.name=n,this.type=i,this.id=r,this.options=o||{matchBareFromJid:!1,ignoreNamespaceFragment:!1},this.options.matchBare&&(w.warn('The "matchBare" option is deprecated, use "matchBareFromJid" instead.'),this.options.matchBareFromJid=this.options.matchBare,delete this.options.matchBare),this.options.matchBareFromJid?this.from=s?w.getBareJidFromJid(s):null:this.from=s,this.user=!0},w.Handler.prototype={getNamespace:function(e){var t=e.getAttribute("xmlns");return t&&this.options.ignoreNamespaceFragment&&(t=t.split("#")[0]),t},namespaceMatch:function(e){var t=this,n=!1;return!this.ns||(w.forEachChild(e,null,(function(e){t.getNamespace(e)===t.ns&&(n=!0)})),n||this.getNamespace(e)===this.ns)},isMatch:function(e){var t=e.getAttribute("from");this.options.matchBareFromJid&&(t=w.getBareJidFromJid(t));var n=e.getAttribute("type");return!(!this.namespaceMatch(e)||this.name&&!w.isTagEqual(e,this.name)||this.type&&(Array.isArray(this.type)?-1===this.type.indexOf(n):n!==this.type)||this.id&&e.getAttribute("id")!==this.id||this.from&&t!==this.from)},run:function(e){var t=null;try{t=this.handler(e)}catch(e){throw w._handleError(e),e}return t},toString:function(){return"{Handler: "+this.handler+"("+this.name+","+this.id+","+this.ns+")}"}},w.TimedHandler=function(e,t){this.period=e,this.handler=t,this.lastCalled=(new Date).getTime(),this.user=!0},w.TimedHandler.prototype={run:function(){return this.lastCalled=(new Date).getTime(),this.handler()},reset:function(){this.lastCalled=(new Date).getTime()},toString:function(){return"{TimedHandler: "+this.handler+"("+this.period+")}"}},w.Connection=function(e,t){var n=this;this.service=e,this.options=t||{};var i=this.options.protocol||"";for(var r in 0===e.indexOf("ws:")||0===e.indexOf("wss:")||0===i.indexOf("ws")?this._proto=new w.Websocket(this):this._proto=new w.Bosh(this),this.jid="",this.domain=null,this.features=null,this._sasl_data={},this.do_session=!1,this.do_bind=!1,this.timedHandlers=[],this.handlers=[],this.removeTimeds=[],this.removeHandlers=[],this.addTimeds=[],this.addHandlers=[],this.protocolErrorHandlers={HTTP:{},websocket:{}},this._idleTimeout=null,this._disconnectTimeout=null,this.authenticated=!1,this.connected=!1,this.disconnecting=!1,this.do_authentication=!0,this.paused=!1,this.restored=!1,this._data=[],this._uniqueId=0,this._sasl_success_handler=null,this._sasl_failure_handler=null,this._sasl_challenge_handler=null,this.maxRetries=5,this._idleTimeout=setTimeout((function(){return n._onIdle()}),100),T(this.options.cookies),this.registerSASLMechanisms(this.options.mechanisms),w._connectionPlugins)if(Object.prototype.hasOwnProperty.call(w._connectionPlugins,r)){var s=function(){};s.prototype=w._connectionPlugins[r],this[r]=new s,this[r].init(this)}},w.Connection.prototype={reset:function(){this._proto._reset(),this.do_session=!1,this.do_bind=!1,this.timedHandlers=[],this.handlers=[],this.removeTimeds=[],this.removeHandlers=[],this.addTimeds=[],this.addHandlers=[],this.authenticated=!1,this.connected=!1,this.disconnecting=!1,this.restored=!1,this._data=[],this._requests=[],this._uniqueId=0},pause:function(){this.paused=!0},resume:function(){this.paused=!1},getUniqueId:function(e){var t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}));return"string"==typeof e||"number"==typeof e?t+":"+e:t+""},addProtocolErrorHandler:function(e,t,n){this.protocolErrorHandlers[e][t]=n},connect:function(e,t,n,i,r,s,o){this.jid=e,this.authzid=w.getBareJidFromJid(this.jid),this.authcid=o||w.getNodeFromJid(this.jid),this.pass=t,this.servtype="xmpp",this.connect_callback=n,this.disconnecting=!1,this.connected=!1,this.authenticated=!1,this.restored=!1,this.domain=w.getDomainFromJid(this.jid),this._changeConnectStatus(w.Status.CONNECTING,null),this._proto._connect(i,r,s)},attach:function(e,t,n,i,r,s,o){if(!(this._proto instanceof w.Bosh)){var a=new Error('The "attach" method can only be used with a BOSH connection.');throw a.name="StropheSessionError",a}this._proto._attach(e,t,n,i,r,s,o)},restore:function(e,t,n,i,r){if(!this._sessionCachingSupported()){var s=new Error('The "restore" method can only be used with a BOSH connection.');throw s.name="StropheSessionError",s}this._proto._restore(e,t,n,i,r)},_sessionCachingSupported:function(){if(this._proto instanceof w.Bosh){if(!JSON)return!1;try{sessionStorage.setItem("_strophe_","_strophe_"),sessionStorage.removeItem("_strophe_")}catch(e){return!1}return!0}return!1},xmlInput:function(e){},xmlOutput:function(e){},rawInput:function(e){},rawOutput:function(e){},nextValidRid:function(e){},send:function(e){if(null!==e){if("function"==typeof e.sort)for(var t=0;t<e.length;t++)this._queueData(e[t]);else"function"==typeof e.tree?this._queueData(e.tree()):this._queueData(e);this._proto._send()}},flush:function(){clearTimeout(this._idleTimeout),this._onIdle()},sendPresence:function(e,t,n,i){var r=this,s=null;"function"==typeof e.tree&&(e=e.tree());var o=e.getAttribute("id");if(o||(o=this.getUniqueId("sendPresence"),e.setAttribute("id",o)),"function"==typeof t||"function"==typeof n){var a=this.addHandler((function(e){s&&r.deleteTimedHandler(s),"error"===e.getAttribute("type")?n&&n(e):t&&t(e)}),null,"presence",null,o);i&&(s=this.addTimedHandler(i,(function(){return r.deleteHandler(a),n&&n(null),!1})))}return this.send(e),o},sendIQ:function(e,t,n,i){var r=this,s=null;"function"==typeof e.tree&&(e=e.tree());var o=e.getAttribute("id");if(o||(o=this.getUniqueId("sendIQ"),e.setAttribute("id",o)),"function"==typeof t||"function"==typeof n){var a=this.addHandler((function(e){s&&r.deleteTimedHandler(s);var i=e.getAttribute("type");if("result"===i)t&&t(e);else{if("error"!==i){var o=new Error("Got bad IQ type of ".concat(i));throw o.name="StropheError",o}n&&n(e)}}),null,"iq",["error","result"],o);i&&(s=this.addTimedHandler(i,(function(){return r.deleteHandler(a),n&&n(null),!1})))}return this.send(e),o},_queueData:function(e){if(null===e||!e.tagName||!e.childNodes){var t=new Error("Cannot queue non-DOMElement.");throw t.name="StropheError",t}this._data.push(e)},_sendRestart:function(){var e=this;this._data.push("restart"),this._proto._sendRestart(),this._idleTimeout=setTimeout((function(){return e._onIdle()}),100)},addTimedHandler:function(e,t){var n=new w.TimedHandler(e,t);return this.addTimeds.push(n),n},deleteTimedHandler:function(e){this.removeTimeds.push(e)},addHandler:function(e,t,n,i,r,s,o){var a=new w.Handler(e,t,n,i,r,s,o);return this.addHandlers.push(a),a},deleteHandler:function(e){this.removeHandlers.push(e);var t=this.addHandlers.indexOf(e);t>=0&&this.addHandlers.splice(t,1)},registerSASLMechanisms:function(e){this.mechanisms={},(e=e||[w.SASLAnonymous,w.SASLExternal,w.SASLMD5,w.SASLOAuthBearer,w.SASLXOAuth2,w.SASLPlain,w.SASLSHA1]).forEach(this.registerSASLMechanism.bind(this))},registerSASLMechanism:function(e){this.mechanisms[e.prototype.name]=e},disconnect:function(e){if(this._changeConnectStatus(w.Status.DISCONNECTING,e),w.warn("Disconnect was called because: "+e),this.connected){var t=!1;this.disconnecting=!0,this.authenticated&&(t=I({xmlns:w.NS.CLIENT,type:"unavailable"})),this._disconnectTimeout=this._addSysTimedHandler(3e3,this._onDisconnectTimeout.bind(this)),this._proto._disconnect(t)}else w.warn("Disconnect was called before Strophe connected to the server"),this._proto._abortAllRequests(),this._doDisconnect()},_changeConnectStatus:function(e,t,n){for(var i in w._connectionPlugins)if(Object.prototype.hasOwnProperty.call(w._connectionPlugins,i)){var r=this[i];if(r.statusChanged)try{r.statusChanged(e,t)}catch(e){w.error("".concat(i," plugin caused an exception changing status: ").concat(e))}}if(this.connect_callback)try{this.connect_callback(e,t,n)}catch(e){w._handleError(e),w.error("User connection callback caused an exception: ".concat(e))}},_doDisconnect:function(e){"number"==typeof this._idleTimeout&&clearTimeout(this._idleTimeout),null!==this._disconnectTimeout&&(this.deleteTimedHandler(this._disconnectTimeout),this._disconnectTimeout=null),w.debug("_doDisconnect was called"),this._proto._doDisconnect(),this.authenticated=!1,this.disconnecting=!1,this.restored=!1,this.handlers=[],this.timedHandlers=[],this.removeTimeds=[],this.removeHandlers=[],this.addTimeds=[],this.addHandlers=[],this._changeConnectStatus(w.Status.DISCONNECTED,e),this.connected=!1},_dataRecv:function(e,t){var n=this;w.debug("_dataRecv called");var i=this._proto._reqToData(e);if(null!==i){for(this.xmlInput!==w.Connection.prototype.xmlInput&&(i.nodeName===this._proto.strip&&i.childNodes.length?this.xmlInput(i.childNodes[0]):this.xmlInput(i)),this.rawInput!==w.Connection.prototype.rawInput&&(t?this.rawInput(t):this.rawInput(w.serialize(i)));this.removeHandlers.length>0;){var r=this.removeHandlers.pop(),s=this.handlers.indexOf(r);s>=0&&this.handlers.splice(s,1)}for(;this.addHandlers.length>0;)this.handlers.push(this.addHandlers.pop());if(this.disconnecting&&this._proto._emptyQueue())this._doDisconnect();else{var o=i.getAttribute("type");if(null!==o&&"terminate"===o){if(this.disconnecting)return;var a=i.getAttribute("condition"),c=i.getElementsByTagName("conflict");return null!==a?("remote-stream-error"===a&&c.length>0&&(a="conflict"),this._changeConnectStatus(w.Status.CONNFAIL,a)):this._changeConnectStatus(w.Status.CONNFAIL,w.ErrorCondition.UNKOWN_REASON),void this._doDisconnect(a)}w.forEachChild(i,null,(function(e){var t=n.handlers;n.handlers=[];for(var i=0;i<t.length;i++){var r=t[i];try{(!r.isMatch(e)||!n.authenticated&&r.user||r.run(e))&&n.handlers.push(r)}catch(e){w.warn("Removing Strophe handlers due to uncaught exception: "+e.message)}}}))}}},mechanisms:{},_connect_cb:function(e,t,n){var i;w.debug("_connect_cb was called"),this.connected=!0;try{i=this._proto._reqToData(e)}catch(e){if(e.name!==w.ErrorCondition.BAD_FORMAT)throw e;this._changeConnectStatus(w.Status.CONNFAIL,w.ErrorCondition.BAD_FORMAT),this._doDisconnect(w.ErrorCondition.BAD_FORMAT)}if(i&&(this.xmlInput!==w.Connection.prototype.xmlInput&&(i.nodeName===this._proto.strip&&i.childNodes.length?this.xmlInput(i.childNodes[0]):this.xmlInput(i)),this.rawInput!==w.Connection.prototype.rawInput&&(n?this.rawInput(n):this.rawInput(w.serialize(i))),this._proto._connect_cb(i)!==w.Status.CONNFAIL))if(i.getElementsByTagNameNS?i.getElementsByTagNameNS(w.NS.STREAM,"features").length>0:i.getElementsByTagName("stream:features").length>0||i.getElementsByTagName("features").length>0){var r=[],s=i.getElementsByTagName("mechanism");if(s.length>0)for(var o=0;o<s.length;o++){var a=w.getText(s[o]);this.mechanisms[a]&&r.push(this.mechanisms[a])}0!==r.length||0!==i.getElementsByTagName("auth").length?!1!==this.do_authentication&&this.authenticate(r):this._proto._no_auth_received(t)}else this._proto._no_auth_received(t)},sortMechanismsByPriority:function(e){for(var t=0;t<e.length-1;++t){for(var n=t,i=t+1;i<e.length;++i)e[i].prototype.priority>e[n].prototype.priority&&(n=i);if(n!==t){var r=e[t];e[t]=e[n],e[n]=r}}return e},authenticate:function(e){this._attemptSASLAuth(e)||this._attemptLegacyAuth()},_attemptSASLAuth:function(e){e=this.sortMechanismsByPriority(e||[]);for(var t=!1,n=0;n<e.length;++n)if(e[n].prototype.test(this)){this._sasl_success_handler=this._addSysHandler(this._sasl_success_cb.bind(this),null,"success",null,null),this._sasl_failure_handler=this._addSysHandler(this._sasl_failure_cb.bind(this),null,"failure",null,null),this._sasl_challenge_handler=this._addSysHandler(this._sasl_challenge_cb.bind(this),null,"challenge",null,null),this._sasl_mechanism=new e[n],this._sasl_mechanism.onStart(this);var i=R("auth",{xmlns:w.NS.SASL,mechanism:this._sasl_mechanism.name});if(this._sasl_mechanism.isClientFirst){var r=this._sasl_mechanism.onChallenge(this,null);i.t(btoa(r))}this.send(i.tree()),t=!0;break}return t},_sasl_challenge_cb:function(e){var t=atob(w.getText(e)),n=this._sasl_mechanism.onChallenge(this,t),i=R("response",{xmlns:w.NS.SASL});return""!==n&&i.t(btoa(n)),this.send(i.tree()),!0},_attemptLegacyAuth:function(){null===w.getNodeFromJid(this.jid)?(this._changeConnectStatus(w.Status.CONNFAIL,w.ErrorCondition.MISSING_JID_NODE),this.disconnect(w.ErrorCondition.MISSING_JID_NODE)):(this._changeConnectStatus(w.Status.AUTHENTICATING,null),this._addSysHandler(this._onLegacyAuthIQResult.bind(this),null,null,null,"_auth_1"),this.send(A({type:"get",to:this.domain,id:"_auth_1"}).c("query",{xmlns:w.NS.AUTH}).c("username",{}).t(w.getNodeFromJid(this.jid)).tree()))},_onLegacyAuthIQResult:function(e){var t=A({type:"set",id:"_auth_2"}).c("query",{xmlns:w.NS.AUTH}).c("username",{}).t(w.getNodeFromJid(this.jid)).up().c("password").t(this.pass);return w.getResourceFromJid(this.jid)||(this.jid=w.getBareJidFromJid(this.jid)+"/strophe"),t.up().c("resource",{}).t(w.getResourceFromJid(this.jid)),this._addSysHandler(this._auth2_cb.bind(this),null,null,null,"_auth_2"),this.send(t.tree()),!1},_sasl_success_cb:function(e){var t=this;if(this._sasl_data["server-signature"]){var n,i=atob(w.getText(e)).match(/([a-z]+)=([^,]+)(,|$)/);if("v"===i[1]&&(n=i[2]),n!==this._sasl_data["server-signature"])return this.deleteHandler(this._sasl_failure_handler),this._sasl_failure_handler=null,this._sasl_challenge_handler&&(this.deleteHandler(this._sasl_challenge_handler),this._sasl_challenge_handler=null),this._sasl_data={},this._sasl_failure_cb(null)}w.info("SASL authentication succeeded."),this._sasl_mechanism&&this._sasl_mechanism.onSuccess(),this.deleteHandler(this._sasl_failure_handler),this._sasl_failure_handler=null,this._sasl_challenge_handler&&(this.deleteHandler(this._sasl_challenge_handler),this._sasl_challenge_handler=null);var r=[],s=function(e,n){for(;e.length;)t.deleteHandler(e.pop());return t._onStreamFeaturesAfterSASL(n),!1};return r.push(this._addSysHandler((function(e){return s(r,e)}),null,"stream:features",null,null)),r.push(this._addSysHandler((function(e){return s(r,e)}),w.NS.STREAM,"features",null,null)),this._sendRestart(),!1},_onStreamFeaturesAfterSASL:function(e){this.features=e;for(var t=0;t<e.childNodes.length;t++){var n=e.childNodes[t];"bind"===n.nodeName&&(this.do_bind=!0),"session"===n.nodeName&&(this.do_session=!0)}return this.do_bind?(this.options.explicitResourceBinding?this._changeConnectStatus(w.Status.BINDREQUIRED,null):this.bind(),!1):(this._changeConnectStatus(w.Status.AUTHFAIL,null),!1)},bind:function(){if(this.do_bind){this._addSysHandler(this._onResourceBindResultIQ.bind(this),null,null,null,"_bind_auth_2");var e=w.getResourceFromJid(this.jid);e?this.send(A({type:"set",id:"_bind_auth_2"}).c("bind",{xmlns:w.NS.BIND}).c("resource",{}).t(e).tree()):this.send(A({type:"set",id:"_bind_auth_2"}).c("bind",{xmlns:w.NS.BIND}).tree())}else w.log(w.LogLevel.INFO,'Strophe.Connection.prototype.bind called but "do_bind" is false')},_onResourceBindResultIQ:function(e){var t;if("error"===e.getAttribute("type"))return w.warn("Resource binding failed."),e.getElementsByTagName("conflict").length>0&&(t=w.ErrorCondition.CONFLICT),this._changeConnectStatus(w.Status.AUTHFAIL,t,e),!1;var n=e.getElementsByTagName("bind");if(!(n.length>0))return w.warn("Resource binding failed."),this._changeConnectStatus(w.Status.AUTHFAIL,null,e),!1;var i=n[0].getElementsByTagName("jid");i.length>0&&(this.jid=w.getText(i[0]),this.do_session?this._establishSession():(this.authenticated=!0,this._changeConnectStatus(w.Status.CONNECTED,null)))},_establishSession:function(){if(!this.do_session)throw new Error("Strophe.Connection.prototype._establishSession "+"called but apparently ".concat(w.NS.SESSION," wasn't advertised by the server"));this._addSysHandler(this._onSessionResultIQ.bind(this),null,null,null,"_session_auth_2"),this.send(A({type:"set",id:"_session_auth_2"}).c("session",{xmlns:w.NS.SESSION}).tree())},_onSessionResultIQ:function(e){if("result"===e.getAttribute("type"))this.authenticated=!0,this._changeConnectStatus(w.Status.CONNECTED,null);else if("error"===e.getAttribute("type"))return w.warn("Session creation failed."),this._changeConnectStatus(w.Status.AUTHFAIL,null,e),!1;return!1},_sasl_failure_cb:function(e){return this._sasl_success_handler&&(this.deleteHandler(this._sasl_success_handler),this._sasl_success_handler=null),this._sasl_challenge_handler&&(this.deleteHandler(this._sasl_challenge_handler),this._sasl_challenge_handler=null),this._sasl_mechanism&&this._sasl_mechanism.onFailure(),this._changeConnectStatus(w.Status.AUTHFAIL,null,e),!1},_auth2_cb:function(e){return"result"===e.getAttribute("type")?(this.authenticated=!0,this._changeConnectStatus(w.Status.CONNECTED,null)):"error"===e.getAttribute("type")&&(this._changeConnectStatus(w.Status.AUTHFAIL,null,e),this.disconnect("authentication failed")),!1},_addSysTimedHandler:function(e,t){var n=new w.TimedHandler(e,t);return n.user=!1,this.addTimeds.push(n),n},_addSysHandler:function(e,t,n,i,r){var s=new w.Handler(e,t,n,i,r);return s.user=!1,this.addHandlers.push(s),s},_onDisconnectTimeout:function(){return w.debug("_onDisconnectTimeout was called"),this._changeConnectStatus(w.Status.CONNTIMEOUT,null),this._proto._onDisconnectTimeout(),this._doDisconnect(),!1},_onIdle:function(){for(var e=this;this.addTimeds.length>0;)this.timedHandlers.push(this.addTimeds.pop());for(;this.removeTimeds.length>0;){var t=this.removeTimeds.pop(),n=this.timedHandlers.indexOf(t);n>=0&&this.timedHandlers.splice(n,1)}for(var i=(new Date).getTime(),r=[],s=0;s<this.timedHandlers.length;s++){var o=this.timedHandlers[s];!this.authenticated&&o.user||(o.lastCalled+o.period-i<=0?o.run()&&r.push(o):r.push(o))}this.timedHandlers=r,clearTimeout(this._idleTimeout),this._proto._onIdle(),this.connected&&(this._idleTimeout=setTimeout((function(){return e._onIdle()}),100))}},w.SASLMechanism=function(e,t,n){this.name=e,this.isClientFirst=t,this.priority=n},w.SASLMechanism.prototype={test:function(e){return!0},onStart:function(e){this._connection=e},onChallenge:function(e,t){throw new Error("You should implement challenge handling!")},onFailure:function(){this._connection=null},onSuccess:function(){this._connection=null}},w.SASLAnonymous=function(){},w.SASLAnonymous.prototype=new w.SASLMechanism("ANONYMOUS",!1,20),w.SASLAnonymous.prototype.test=function(e){return null===e.authcid},w.SASLPlain=function(){},w.SASLPlain.prototype=new w.SASLMechanism("PLAIN",!0,50),w.SASLPlain.prototype.test=function(e){return null!==e.authcid},w.SASLPlain.prototype.onChallenge=function(e){var t=e.authzid;return t+="\0",t+=e.authcid,t+="\0",t+=e.pass,C(t)},w.SASLSHA1=function(){},w.SASLSHA1.prototype=new w.SASLMechanism("SCRAM-SHA-1",!0,70),w.SASLSHA1.prototype.test=function(e){return null!==e.authcid},w.SASLSHA1.prototype.onChallenge=function(e,t,n){var i=n||h.hexdigest(""+1234567890*Math.random()),r="n="+C(e.authcid);return r+=",r=",r+=i,e._sasl_data.cnonce=i,e._sasl_data["client-first-message-bare"]=r,r="n,,"+r,this.onChallenge=function(e,t){for(var n,i,r,s,o,a,c,d,u="c=biws,",l="".concat(e._sasl_data["client-first-message-bare"],",").concat(t,","),h=e._sasl_data.cnonce,p=/([a-z]+)=([^,]+)(,|$)/;t.match(p);){var m=t.match(p);switch(t=t.replace(m[0],""),m[1]){case"r":n=m[2];break;case"s":i=m[2];break;case"i":r=m[2]}}if(n.substr(0,h.length)!==h)return e._sasl_data={},e._sasl_failure_cb();l+=u+="r="+n,i=atob(i),i+="\0\0\0";var f=C(e.pass);for(s=a=b.core_hmac_sha1(f,i),c=1;c<r;c++){for(o=b.core_hmac_sha1(f,b.binb2str(a)),d=0;d<5;d++)s[d]^=o[d];a=o}s=b.binb2str(s);var g=b.core_hmac_sha1(s,"Client Key"),_=b.str_hmac_sha1(s,"Server Key"),v=b.core_hmac_sha1(b.str_sha1(b.binb2str(g)),l);for(e._sasl_data["server-signature"]=b.b64_hmac_sha1(_,l),d=0;d<5;d++)g[d]^=v[d];return u+=",p="+btoa(b.binb2str(g))},r},w.SASLMD5=function(){},w.SASLMD5.prototype=new w.SASLMechanism("DIGEST-MD5",!1,60),w.SASLMD5.prototype.test=function(e){return null!==e.authcid},w.SASLMD5.prototype._quote=function(e){return'"'+e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"'},w.SASLMD5.prototype.onChallenge=function(e,t,n){for(var i=/([a-z]+)=("[^"]+"|[^,"]+)(?:,|$)/,r=n||h.hexdigest(""+1234567890*Math.random()),s="",o=null,a="";t.match(i);){var c=t.match(i);switch(t=t.replace(c[0],""),c[2]=c[2].replace(/^"(.+)"$/,"$1"),c[1]){case"realm":s=c[2];break;case"nonce":a=c[2];break;case"qop":c[2];break;case"host":o=c[2]}}var d=e.servtype+"/"+e.domain;null!==o&&(d=d+"/"+o);var u=C(e.authcid+":"+s+":"+this._connection.pass),l=h.hash(u)+":"+a+":"+r,p="AUTHENTICATE:"+d,m="";return m+="charset=utf-8,",m+="username="+this._quote(C(e.authcid))+",",m+="realm="+this._quote(s)+",",m+="nonce="+this._quote(a)+",",m+="nc=00000001,",m+="cnonce="+this._quote(r)+",",m+="digest-uri="+this._quote(d)+",",m+="response="+h.hexdigest(h.hexdigest(l)+":"+a+":00000001:"+r+":auth:"+h.hexdigest(p))+",",m+="qop=auth",this.onChallenge=function(){return""},m},w.SASLOAuthBearer=function(){},w.SASLOAuthBearer.prototype=new w.SASLMechanism("OAUTHBEARER",!0,40),w.SASLOAuthBearer.prototype.test=function(e){return null!==e.pass},w.SASLOAuthBearer.prototype.onChallenge=function(e){var t="n,";return null!==e.authcid&&(t=t+"a="+e.authzid),t+=",",t+="",t+="auth=Bearer ",t+=e.pass,t+="",C(t+="")},w.SASLExternal=function(){},w.SASLExternal.prototype=new w.SASLMechanism("EXTERNAL",!0,10),w.SASLExternal.prototype.onChallenge=function(e){return e.authcid===e.authzid?"":e.authzid},w.SASLXOAuth2=function(){},w.SASLXOAuth2.prototype=new w.SASLMechanism("X-OAUTH2",!0,30),w.SASLXOAuth2.prototype.test=function(e){return null!==e.pass},w.SASLXOAuth2.prototype.onChallenge=function(e){var t="\0";return null!==e.authcid&&(t+=e.authzid),t+="\0",t+=e.pass,C(t)};var P={Strophe:w,$build:R,$iq:A,$msg:function(e){return new w.Builder("message",e)},$pres:I,SHA1:b,MD5:h,b64_hmac_sha1:b.b64_hmac_sha1,b64_sha1:b.b64_sha1,str_hmac_sha1:b.str_hmac_sha1,str_sha1:b.str_sha1},O=P.Strophe,D=P.$build;O.Request=function(e,t,n,i){this.id=++O._requestId,this.xmlData=e,this.data=O.serialize(e),this.origFunc=t,this.func=t,this.rid=n,this.date=NaN,this.sends=i||0,this.abort=!1,this.dead=null,this.age=function(){return this.date?(new Date-this.date)/1e3:0},this.timeDead=function(){return this.dead?(new Date-this.dead)/1e3:0},this.xhr=this._newXHR()},O.Request.prototype={getResponse:function(){var e=null;if(this.xhr.responseXML&&this.xhr.responseXML.documentElement){if("parsererror"===(e=this.xhr.responseXML.documentElement).tagName)throw O.error("invalid response received"),O.error("responseText: "+this.xhr.responseText),O.error("responseXML: "+O.serialize(this.xhr.responseXML)),new Error("parsererror")}else if(this.xhr.responseText){if(O.debug("Got responseText but no responseXML; attempting to parse it with DOMParser..."),!(e=(new DOMParser).parseFromString(this.xhr.responseText,"application/xml").documentElement))throw new Error("Parsing produced null node");if(e.querySelector("parsererror")){O.error("invalid response received: "+e.querySelector("parsererror").textContent),O.error("responseText: "+this.xhr.responseText);var t=new Error;throw t.name=O.ErrorCondition.BAD_FORMAT,t}}return e},_newXHR:function(){var e=null;return window.XMLHttpRequest?(e=new XMLHttpRequest).overrideMimeType&&e.overrideMimeType("text/xml; charset=utf-8"):window.ActiveXObject&&(e=new ActiveXObject("Microsoft.XMLHTTP")),e.onreadystatechange=this.func.bind(null,this),e}},O.Bosh=function(e){this._conn=e,this.rid=Math.floor(4294967295*Math.random()),this.sid=null,this.hold=1,this.wait=60,this.window=5,this.errors=0,this.inactivity=null,this.lastResponseHeaders=null,this._requests=[]},O.Bosh.prototype={strip:null,_buildBody:function(){var e=D("body",{rid:this.rid++,xmlns:O.NS.HTTPBIND});return null!==this.sid&&e.attrs({sid:this.sid}),this._conn.options.keepalive&&this._conn._sessionCachingSupported()&&this._cacheSession(),e},_reset:function(){this.rid=Math.floor(4294967295*Math.random()),this.sid=null,this.errors=0,this._conn._sessionCachingSupported()&&window.sessionStorage.removeItem("strophe-bosh-session"),this._conn.nextValidRid(this.rid)},_connect:function(e,t,n){this.wait=e||this.wait,this.hold=t||this.hold,this.errors=0;var i=this._buildBody().attrs({to:this._conn.domain,"xml:lang":"en",wait:this.wait,hold:this.hold,content:"text/xml; charset=utf-8",ver:"1.6","xmpp:version":"1.0","xmlns:xmpp":O.NS.BOSH});n&&i.attrs({route:n});var r=this._conn._connect_cb;this._requests.push(new O.Request(i.tree(),this._onRequestStateChange.bind(this,r.bind(this._conn)),i.tree().getAttribute("rid"))),this._throttledRequestHandler()},_attach:function(e,t,n,i,r,s,o){this._conn.jid=e,this.sid=t,this.rid=n,this._conn.connect_callback=i,this._conn.domain=O.getDomainFromJid(this._conn.jid),this._conn.authenticated=!0,this._conn.connected=!0,this.wait=r||this.wait,this.hold=s||this.hold,this.window=o||this.window,this._conn._changeConnectStatus(O.Status.ATTACHED,null)},_restore:function(e,t,n,i,r){var s=JSON.parse(window.sessionStorage.getItem("strophe-bosh-session"));if(!(null!=s&&s.rid&&s.sid&&s.jid&&(null==e||O.getBareJidFromJid(s.jid)===O.getBareJidFromJid(e)||null===O.getNodeFromJid(e)&&O.getDomainFromJid(s.jid)===e))){var o=new Error("_restore: no restoreable session.");throw o.name="StropheSessionError",o}this._conn.restored=!0,this._attach(s.jid,s.sid,s.rid,t,n,i,r)},_cacheSession:function(){this._conn.authenticated?this._conn.jid&&this.rid&&this.sid&&window.sessionStorage.setItem("strophe-bosh-session",JSON.stringify({jid:this._conn.jid,rid:this.rid,sid:this.sid})):window.sessionStorage.removeItem("strophe-bosh-session")},_connect_cb:function(e){var t=e.getAttribute("type");if(null!==t&&"terminate"===t){var n=e.getAttribute("condition");O.error("BOSH-Connection failed: "+n);var i=e.getElementsByTagName("conflict");return null!==n?("remote-stream-error"===n&&i.length>0&&(n="conflict"),this._conn._changeConnectStatus(O.Status.CONNFAIL,n)):this._conn._changeConnectStatus(O.Status.CONNFAIL,"unknown"),this._conn._doDisconnect(n),O.Status.CONNFAIL}this.sid||(this.sid=e.getAttribute("sid"));var r=e.getAttribute("requests");r&&(this.window=parseInt(r,10));var s=e.getAttribute("hold");s&&(this.hold=parseInt(s,10));var o=e.getAttribute("wait");o&&(this.wait=parseInt(o,10));var a=e.getAttribute("inactivity");a&&(this.inactivity=parseInt(a,10))},_disconnect:function(e){this._sendTerminate(e)},_doDisconnect:function(){this.sid=null,this.rid=Math.floor(4294967295*Math.random()),this._conn._sessionCachingSupported()&&window.sessionStorage.removeItem("strophe-bosh-session"),this._conn.nextValidRid(this.rid)},_emptyQueue:function(){return 0===this._requests.length},_callProtocolErrorHandlers:function(e){var t=this._getRequestStatus(e),n=this._conn.protocolErrorHandlers.HTTP[t];n&&n.call(this,t)},_hitError:function(e){this.errors++,O.warn("request errored, status: "+e+", number of errors: "+this.errors),this.errors>4&&this._conn._onDisconnectTimeout()},_no_auth_received:function(e){O.warn("Server did not yet offer a supported authentication mechanism. Sending a blank poll request."),e=e?e.bind(this._conn):this._conn._connect_cb.bind(this._conn);var t=this._buildBody();this._requests.push(new O.Request(t.tree(),this._onRequestStateChange.bind(this,e),t.tree().getAttribute("rid"))),this._throttledRequestHandler()},_onDisconnectTimeout:function(){this._abortAllRequests()},_abortAllRequests:function(){for(;this._requests.length>0;){var e=this._requests.pop();e.abort=!0,e.xhr.abort(),e.xhr.onreadystatechange=function(){}}},_onIdle:function(){var e=this._conn._data;if(this._conn.authenticated&&0===this._requests.length&&0===e.length&&!this._conn.disconnecting&&(O.debug("no requests during idle cycle, sending blank request"),e.push(null)),!this._conn.paused){if(this._requests.length<2&&e.length>0){for(var t=this._buildBody(),n=0;n<e.length;n++)null!==e[n]&&("restart"===e[n]?t.attrs({to:this._conn.domain,"xml:lang":"en","xmpp:restart":"true","xmlns:xmpp":O.NS.BOSH}):t.cnode(e[n]).up());delete this._conn._data,this._conn._data=[],this._requests.push(new O.Request(t.tree(),this._onRequestStateChange.bind(this,this._conn._dataRecv.bind(this._conn)),t.tree().getAttribute("rid"))),this._throttledRequestHandler()}if(this._requests.length>0){var i=this._requests[0].age();null!==this._requests[0].dead&&this._requests[0].timeDead()>Math.floor(O.SECONDARY_TIMEOUT*this.wait)&&this._throttledRequestHandler(),i>Math.floor(O.TIMEOUT*this.wait)&&(O.warn("Request "+this._requests[0].id+" timed out, over "+Math.floor(O.TIMEOUT*this.wait)+" seconds since last activity"),this._throttledRequestHandler())}}},_getRequestStatus:function(e,t){var n;if(4===e.xhr.readyState)try{n=e.xhr.status}catch(e){O.error("Caught an error while retrieving a request's status, reqStatus: "+n)}return void 0===n&&(n="number"==typeof t?t:0),n},_onRequestStateChange:function(e,t){if(O.debug("request id "+t.id+"."+t.sends+" state changed to "+t.xhr.readyState),t.abort)t.abort=!1;else if(4===t.xhr.readyState){var n=this._getRequestStatus(t);if(this.lastResponseHeaders=t.xhr.getAllResponseHeaders(),this.disconnecting&&n>=400)return this._hitError(n),void this._callProtocolErrorHandlers(t);var i=n>0&&n<500,r=t.sends>this._conn.maxRetries;if((i||r)&&(this._removeRequest(t),O.debug("request id "+t.id+" should now be removed")),200===n){var s=this._requests[0]===t;(this._requests[1]===t||s&&this._requests.length>0&&this._requests[0].age()>Math.floor(O.SECONDARY_TIMEOUT*this.wait))&&this._restartRequest(0),this._conn.nextValidRid(Number(t.rid)+1),O.debug("request id "+t.id+"."+t.sends+" got 200"),e(t),this.errors=0}else 0===n||n>=400&&n<600||n>=12e3?(O.error("request id "+t.id+"."+t.sends+" error "+n+" happened"),this._hitError(n),this._callProtocolErrorHandlers(t),n>=400&&n<500&&(this._conn._changeConnectStatus(O.Status.DISCONNECTING,null),this._conn._doDisconnect())):O.error("request id "+t.id+"."+t.sends+" error "+n+" happened");i||r?r&&!this._conn.connected&&this._conn._changeConnectStatus(O.Status.CONNFAIL,"giving-up"):this._throttledRequestHandler()}},_processRequest:function(e){var t=this,n=this._requests[e],i=this._getRequestStatus(n,-1);if(n.sends>this._conn.maxRetries)this._conn._onDisconnectTimeout();else{var r=n.age(),s=!isNaN(r)&&r>Math.floor(O.TIMEOUT*this.wait),o=null!==n.dead&&n.timeDead()>Math.floor(O.SECONDARY_TIMEOUT*this.wait),a=4===n.xhr.readyState&&(i<1||i>=500);if((s||o||a)&&(o&&O.error("Request ".concat(this._requests[e].id," timed out (secondary), restarting")),n.abort=!0,n.xhr.abort(),n.xhr.onreadystatechange=function(){},this._requests[e]=new O.Request(n.xmlData,n.origFunc,n.rid,n.sends),n=this._requests[e]),0===n.xhr.readyState){O.debug("request id "+n.id+"."+n.sends+" posting");try{var c=this._conn.options.contentType||"text/xml; charset=utf-8";n.xhr.open("POST",this._conn.service,!this._conn.options.sync),void 0!==n.xhr.setRequestHeader&&n.xhr.setRequestHeader("Content-Type",c),this._conn.options.withCredentials&&(n.xhr.withCredentials=!0)}catch(e){return O.error("XHR open failed: "+e.toString()),this._conn.connected||this._conn._changeConnectStatus(O.Status.CONNFAIL,"bad-service"),void this._conn.disconnect()}var d=function(){if(n.date=new Date,t._conn.options.customHeaders){var e=t._conn.options.customHeaders;for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.xhr.setRequestHeader(i,e[i])}n.xhr.send(n.data)};if(n.sends>1){var u=1e3*Math.min(Math.floor(O.TIMEOUT*this.wait),Math.pow(n.sends,3));setTimeout((function(){d()}),u)}else d();n.sends++,this._conn.xmlOutput!==O.Connection.prototype.xmlOutput&&(n.xmlData.nodeName===this.strip&&n.xmlData.childNodes.length?this._conn.xmlOutput(n.xmlData.childNodes[0]):this._conn.xmlOutput(n.xmlData)),this._conn.rawOutput!==O.Connection.prototype.rawOutput&&this._conn.rawOutput(n.data)}else O.debug("_processRequest: "+(0===e?"first":"second")+" request has readyState of "+n.xhr.readyState)}},_removeRequest:function(e){O.debug("removing request");for(var t=this._requests.length-1;t>=0;t--)e===this._requests[t]&&this._requests.splice(t,1);e.xhr.onreadystatechange=function(){},this._throttledRequestHandler()},_restartRequest:function(e){var t=this._requests[e];null===t.dead&&(t.dead=new Date),this._processRequest(e)},_reqToData:function(e){try{return e.getResponse()}catch(e){if("parsererror"!==e.message)throw e;this._conn.disconnect("strophe-parsererror")}},_sendTerminate:function(e){O.debug("_sendTerminate was called");var t=this._buildBody().attrs({type:"terminate"});e&&t.cnode(e.tree());var n=new O.Request(t.tree(),this._onRequestStateChange.bind(this,this._conn._dataRecv.bind(this._conn)),t.tree().getAttribute("rid"));this._requests.push(n),this._throttledRequestHandler()},_send:function(){var e=this;clearTimeout(this._conn._idleTimeout),this._throttledRequestHandler(),this._conn._idleTimeout=setTimeout((function(){return e._conn._onIdle()}),100)},_sendRestart:function(){this._throttledRequestHandler(),clearTimeout(this._conn._idleTimeout)},_throttledRequestHandler:function(){this._requests?O.debug("_throttledRequestHandler called with "+this._requests.length+" requests"):O.debug("_throttledRequestHandler called with undefined requests"),this._requests&&0!==this._requests.length&&(this._requests.length>0&&this._processRequest(0),this._requests.length>1&&Math.abs(this._requests[0].rid-this._requests[1].rid)<this.window&&this._processRequest(1))}};var N=P.Strophe,M=P.$build;return N.Websocket=function(e){this._conn=e,this.strip="wrapper";var t=e.service;if(0!==t.indexOf("ws:")&&0!==t.indexOf("wss:")){var n="";"ws"===e.options.protocol&&"https:"!==window.location.protocol?n+="ws":n+="wss",n+="://"+window.location.host,0!==t.indexOf("/")?n+=window.location.pathname+t:n+=t,e.service=n}},N.Websocket.prototype={_buildStream:function(){return M("open",{xmlns:N.NS.FRAMING,to:this._conn.domain,version:"1.0"})},_check_streamerror:function(e,t){var n;if(0===(n=e.getElementsByTagNameNS?e.getElementsByTagNameNS(N.NS.STREAM,"error"):e.getElementsByTagName("stream:error")).length)return!1;for(var i=n[0],r="",s="",o=0;o<i.childNodes.length;o++){var a=i.childNodes[o];if("urn:ietf:params:xml:ns:xmpp-streams"!==a.getAttribute("xmlns"))break;"text"===a.nodeName?s=a.textContent:r=a.nodeName}var c="WebSocket stream error: ";return c+=r||"unknown",s&&(c+=" - "+s),N.error(c),this._conn._changeConnectStatus(t,r),this._conn._doDisconnect(),!0},_reset:function(){},_connect:function(){this._closeSocket(),this.socket=new WebSocket(this._conn.service,"xmpp"),this.socket.onopen=this._onOpen.bind(this),this.socket.onerror=this._onError.bind(this),this.socket.onclose=this._onClose.bind(this),this.socket.onmessage=this._connect_cb_wrapper.bind(this)},_connect_cb:function(e){if(this._check_streamerror(e,N.Status.CONNFAIL))return N.Status.CONNFAIL},_handleStreamStart:function(e){var t=!1,n=e.getAttribute("xmlns");"string"!=typeof n?t="Missing xmlns in <open />":n!==N.NS.FRAMING&&(t="Wrong xmlns in <open />: "+n);var i=e.getAttribute("version");return"string"!=typeof i?t="Missing version in <open />":"1.0"!==i&&(t="Wrong version in <open />: "+i),!t||(this._conn._changeConnectStatus(N.Status.CONNFAIL,t),this._conn._doDisconnect(),!1)},_connect_cb_wrapper:function(e){if(0===e.data.indexOf("<open ")||0===e.data.indexOf("<?xml")){var t=e.data.replace(/^(<\?.*?\?>\s*)*/,"");if(""===t)return;var n=(new DOMParser).parseFromString(t,"text/xml").documentElement;this._conn.xmlInput(n),this._conn.rawInput(e.data),this._handleStreamStart(n)&&this._connect_cb(n)}else if(0===e.data.indexOf("<close ")){var i=(new DOMParser).parseFromString(e.data,"text/xml").documentElement;this._conn.xmlInput(i),this._conn.rawInput(e.data);var r=i.getAttribute("see-other-uri");if(r){var s=this._conn.service;(s.indexOf("wss:")>=0&&r.indexOf("wss:")>=0||s.indexOf("ws:")>=0)&&(this._conn._changeConnectStatus(N.Status.REDIRECT,"Received see-other-uri, resetting connection"),this._conn.reset(),this._conn.service=r,this._connect())}else this._conn._changeConnectStatus(N.Status.CONNFAIL,"Received closing stream"),this._conn._doDisconnect()}else{var o=this._streamWrap(e.data),a=(new DOMParser).parseFromString(o,"text/xml").documentElement;this.socket.onmessage=this._onMessage.bind(this),this._conn._connect_cb(a,null,e.data)}},_disconnect:function(e){if(this.socket&&this.socket.readyState!==WebSocket.CLOSED){e&&this._conn.send(e);var t=M("close",{xmlns:N.NS.FRAMING});this._conn.xmlOutput(t.tree());var n=N.serialize(t);this._conn.rawOutput(n);try{this.socket.send(n)}catch(e){N.warn("Couldn't send <close /> tag.")}}this._conn._doDisconnect()},_doDisconnect:function(){N.debug("WebSockets _doDisconnect was called"),this._closeSocket()},_streamWrap:function(e){return"<wrapper>"+e+"</wrapper>"},_closeSocket:function(){if(this.socket)try{this.socket.onclose=null,this.socket.onerror=null,this.socket.onmessage=null,this.socket.close()}catch(e){N.debug(e.message)}this.socket=null},_emptyQueue:function(){return!0},_onClose:function(e){this._conn.connected&&!this._conn.disconnecting?(N.error("Websocket closed unexpectedly"),this._conn._doDisconnect()):e&&1006===e.code&&!this._conn.connected&&this.socket?(N.error("Websocket closed unexcectedly"),this._conn._changeConnectStatus(N.Status.CONNFAIL,"The WebSocket connection could not be established or was disconnected."),this._conn._doDisconnect()):N.debug("Websocket closed")},_no_auth_received:function(e){N.error("Server did not offer a supported authentication mechanism"),this._conn._changeConnectStatus(N.Status.CONNFAIL,N.ErrorCondition.NO_AUTH_MECH),e&&e.call(this._conn),this._conn._doDisconnect()},_onDisconnectTimeout:function(){},_abortAllRequests:function(){},_onError:function(e){N.error("Websocket error "+e),this._conn._changeConnectStatus(N.Status.CONNFAIL,"The WebSocket connection could not be established or was disconnected."),this._disconnect()},_onIdle:function(){var e=this._conn._data;if(e.length>0&&!this._conn.paused){for(var t=0;t<e.length;t++)if(null!==e[t]){var n=void 0;n="restart"===e[t]?this._buildStream().tree():e[t];var i=N.serialize(n);this._conn.xmlOutput(n),this._conn.rawOutput(i),this.socket.send(i)}this._conn._data=[]}},_onMessage:function(e){var t,n='<close xmlns="urn:ietf:params:xml:ns:xmpp-framing" />';if(e.data===n)return this._conn.rawInput(n),this._conn.xmlInput(e),void(this._conn.disconnecting||this._conn._doDisconnect());if(0===e.data.search("<open ")){if(t=(new DOMParser).parseFromString(e.data,"text/xml").documentElement,!this._handleStreamStart(t))return}else{var i=this._streamWrap(e.data);t=(new DOMParser).parseFromString(i,"text/xml").documentElement}return this._check_streamerror(t,N.Status.ERROR)?void 0:this._conn.disconnecting&&"presence"===t.firstChild.nodeName&&"unavailable"===t.firstChild.getAttribute("type")?(this._conn.xmlInput(t),void this._conn.rawInput(N.serialize(t))):void this._conn._dataRecv(t,e.data)},_onOpen:function(){N.debug("Websocket open");var e=this._buildStream();this._conn.xmlOutput(e.tree());var t=N.serialize(e);this._conn.rawOutput(t),this.socket.send(t)},_reqToData:function(e){return e},_send:function(){this._conn.flush()},_sendRestart:function(){clearTimeout(this._conn._idleTimeout),this._conn._onIdle.bind(this._conn)()}},e.Strophe=P.Strophe,e.$build=P.$build,e.$iq=P.$iq,e.$msg=P.$msg,e.$pres=P.$pres,P},e.exports=n()}).call(this,n(45))},function(e,t,n){"use strict";var i=n(90);t.a=new i.a},function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return r})),n.d(t,"c",(function(){return s}));const i="audio",r="presenter",s="video"},function(e,t,n){var i=n(82),r=n(155),s={},o=[],a=i.levels.TRACE;e.exports={addGlobalTransport:function(e){i.addGlobalTransport(e)},removeGlobalTransport:function(e){i.removeGlobalTransport(e)},setGlobalOptions:function(e){i.setGlobalOptions(e)},getLogger:function(e,t,n){var r=new i(a,e,t,n);return e?(s[e]=s[e]||[],s[e].push(r)):o.push(r),r},setLogLevelById:function(e,t){for(var n=t?s[t]||[]:o,i=0;i<n.length;i++)n[i].setLevel(e)},setLogLevel:function(e){a=e;for(var t=0;t<o.length;t++)o[t].setLevel(e);for(var n in s){var i=s[n]||[];for(t=0;t<i.length;t++)i[t].setLevel(e)}},levels:i.levels,LogCollector:r}},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return b}));var i=n(19),r=n.n(i),s=n(1),o=n(21),a=n(8),c=n(28),d=n(3),u=n(50),l=n.n(u),h=n(92),p=n(37),m=n(63),f=n(93),g=n(94),_=n(43);const v=n(5).getLogger(e);let S,y=!1;function E(e){p.a.isBackendInitialized()||p.a.initBackend({callStatsID:e.callStatsID,callStatsSecret:e.callStatsSecret,userName:e.userName,aliasName:e.aliasName,applicationName:e.applicationName,getWiFiStatsMethod:e.getWiFiStatsMethod,confID:e.confID,siteID:e.siteID,configParams:e.configParams})||v.error("CallStats Backend initialization failed bad")}function b(e,t){this.rtpStatsMap=new Map,this.eventEmitter=new r.a,this.xmpp=e,this.options=t||{},this.callStatsIntegrationEnabled=this.options.callStatsID&&this.options.callStatsSecret&&this.options.enableCallStats&&!0!==b.disableThirdPartyRequests,this.callStatsIntegrationEnabled&&(this.callStatsApplicationLogsDisabled=this.options.callStatsApplicationLogsDisabled,d.a.isReactNative()?E(this.options):function(e){y||(l.a.loadScript(e.customScriptUrl||_.a,!0,!0,void 0,()=>E(e)),y=!0)}(this.options),this.options.confID||v.warn('"confID" is not defined')),this.callsStatsInstances=new Map,b.instances.add(this)}b.init=function(e){b.audioLevelsEnabled=!e.disableAudioLevels,"number"==typeof e.pcStatsInterval&&(b.pcStatsInterval=e.pcStatsInterval),"number"==typeof e.audioLevelsInterval&&(b.audioLevelsInterval=e.audioLevelsInterval),"number"==typeof e.longTasksStatsInterval&&(b.longTasksStatsInterval=e.longTasksStatsInterval),b.disableThirdPartyRequests=e.disableThirdPartyRequests},b.audioLevelsEnabled=!1,b.audioLevelsInterval=200,b.pcStatsInterval=1e4,b.disableThirdPartyRequests=!1,b.analytics=h.a,Object.defineProperty(b,"instances",{get:()=>(S||(S=new Set),S)}),b.prototype.startRemoteStats=function(e){this.stopRemoteStats(e);try{const t=new g.a(e,b.audioLevelsInterval,b.pcStatsInterval,this.eventEmitter);t.start(b.audioLevelsEnabled),this.rtpStatsMap.set(e.id,t)}catch(e){v.error("Failed to start collecting remote statistics: "+e)}},b.localStats=[],b.startLocalStats=function(e,t){if(!b.audioLevelsEnabled)return;const n=new m.a(e,b.audioLevelsInterval,t);this.localStats.push(n),n.start()},b.prototype.addAudioLevelListener=function(e){b.audioLevelsEnabled&&this.eventEmitter.on(c.a,e)},b.prototype.removeAudioLevelListener=function(e){b.audioLevelsEnabled&&this.eventEmitter.removeListener(c.a,e)},b.prototype.addBeforeDisposedListener=function(e){this.eventEmitter.on(c.b,e)},b.prototype.removeBeforeDisposedListener=function(e){this.eventEmitter.removeListener(c.b,e)},b.prototype.addConnectionStatsListener=function(e){this.eventEmitter.on(c.d,e)},b.prototype.removeConnectionStatsListener=function(e){this.eventEmitter.removeListener(c.d,e)},b.prototype.addByteSentStatsListener=function(e){this.eventEmitter.on(c.c,e)},b.prototype.removeByteSentStatsListener=function(e){this.eventEmitter.removeListener(c.c,e)},b.prototype.addLongTasksStatsListener=function(e){this.eventEmitter.on(c.e,e)},b.prototype.attachLongTasksStats=function(e){d.a.supportsPerformanceObserver()?(this.performanceObserverStats=new f.a(this.eventEmitter,b.longTasksStatsInterval),e.on(s.CONFERENCE_JOINED,()=>this.performanceObserverStats.startObserver()),e.on(s.CONFERENCE_LEFT,()=>this.performanceObserverStats.stopObserver())):v.warn("Performance observer for long tasks not supported by browser!")},b.prototype.getLongTasksStats=function(){return this.performanceObserverStats?this.performanceObserverStats.getLongTasksStats():null},b.prototype.removeLongTasksStatsListener=function(e){this.eventEmitter.removeListener(c.e,e)},b.prototype.setSpeakerList=function(e){for(const t of Array.from(this.rtpStatsMap.values()))t.peerconnection.isP2P||t.setSpeakerList(e)},b.prototype.dispose=function(){try{this.callsStatsInstances.size||this.eventEmitter.emit(c.b);for(const e of this.callsStatsInstances.values())this.stopCallStats(e.tpc);for(const e of this.rtpStatsMap.keys())this._stopRemoteStats(e);this.eventEmitter&&this.eventEmitter.removeAllListeners()}finally{b.instances.delete(this)}},b.stopLocalStats=function(e){if(b.audioLevelsEnabled)for(let t=0;t<b.localStats.length;t++)if(b.localStats[t].stream===e){b.localStats.splice(t,1)[0].stop();break}},b.prototype._stopRemoteStats=function(e){const t=this.rtpStatsMap.get(e);t&&(t.stop(),this.rtpStatsMap.delete(e))},b.prototype.stopRemoteStats=function(e){this._stopRemoteStats(e.id)},b.prototype.startCallStats=function(e,t){if(!this.callStatsIntegrationEnabled)return;if(this.callsStatsInstances.has(e.id))return void v.error("CallStats instance for ${tpc} exists already");v.info(`Starting CallStats for ${e}...`);const n=new p.a(e,{confID:this.options.confID,remoteUserID:t});this.callsStatsInstances.set(e.id,n)},b._getAllCallStatsInstances=function(){const e=new Set;for(const t of b.instances)for(const n of t.callsStatsInstances.values())e.add(n);return e},b.prototype.stopCallStats=function(e){const t=this.callsStatsInstances.get(e.id);t&&(1===this.callsStatsInstances.size&&this.eventEmitter.emit(c.b),this.callsStatsInstances.delete(e.id),t.sendTerminateEvent())},b.prototype.isCallstatsEnabled=function(){return this.callStatsIntegrationEnabled},b.prototype.sendConnectionResumeOrHoldEvent=function(e,t){const n=this.callsStatsInstances.get(e.id);n&&n.sendResumeOrHoldEvent(t)},b.prototype.sendIceConnectionFailedEvent=function(e){const t=this.callsStatsInstances.get(e.id);t&&t.sendIceConnectionFailedEvent()},b.prototype.sendMuteEvent=function(e,t,n){const i=e&&this.callsStatsInstances.get(e.id);p.a.sendMuteEvent(t,n,i)},b.prototype.sendScreenSharingEvent=function(e,t){for(const n of this.callsStatsInstances.values())n.sendScreenSharingEvent(e,t)},b.prototype.sendDominantSpeakerEvent=function(e){for(const e of this.callsStatsInstances.values())e.sendDominantSpeakerEvent();this.xmpp.sendDominantSpeakerEvent(e)},b.sendActiveDeviceListEvent=function(e){const t=b._getAllCallStatsInstances();if(t.size)for(const n of t)p.a.sendActiveDeviceListEvent(e,n);else p.a.sendActiveDeviceListEvent(e,null)},b.prototype.associateStreamWithVideoTag=function(e,t,n,i,r,s){const o=this.callsStatsInstances.get(e.id);o&&o.associateStreamWithVideoTag(t,n,i,r,s)},b.sendGetUserMediaFailed=function(e){const t=e instanceof o.a?function(e){const t=new Error;return t.stack=e.stack,t.name=(e.name||"Unknown error")+(e.gum&&e.gum.error&&e.gum.error.name?" - "+e.gum.error.name:""),t.constraintName=e.gum&&e.gum.constraints?JSON.stringify(e.gum.constraints):"",t.message=e.message,t}(e):e,n=b._getAllCallStatsInstances();if(n.size)for(const e of n)p.a.sendGetUserMediaFailed(t,e);else p.a.sendGetUserMediaFailed(t,null)},b.prototype.sendCreateOfferFailed=function(e,t){const n=this.callsStatsInstances.get(t.id);n&&n.sendCreateOfferFailed(e)},b.prototype.sendCreateAnswerFailed=function(e,t){const n=this.callsStatsInstances.get(t.id);n&&n.sendCreateAnswerFailed(e)},b.prototype.sendSetLocalDescFailed=function(e,t){const n=this.callsStatsInstances.get(t.id);n&&n.sendSetLocalDescFailed(e)},b.prototype.sendSetRemoteDescFailed=function(e,t){const n=this.callsStatsInstances.get(t.id);n&&n.sendSetRemoteDescFailed(e)},b.prototype.sendAddIceCandidateFailed=function(e,t){const n=this.callsStatsInstances.get(t.id);n&&n.sendAddIceCandidateFailed(e)},b.sendLog=function(e){const t=new Set;for(const e of b.instances){if(e.callStatsApplicationLogsDisabled)return;e.callsStatsInstances.size&&t.add(e.callsStatsInstances.values().next().value)}if(t.size)for(const n of t)p.a.sendApplicationLog(e,n);else p.a.sendApplicationLog(e,null)},b.prototype.sendFeedback=function(e,t){return b.analytics.sendEvent(a.n,{rating:e,comment:t}),p.a.sendFeedback(this.options.confID,e,t)},b.LOCAL_JID=n(158).LOCAL_JID,b.reportGlobalError=function(e){e instanceof o.a&&e.gum?b.sendGetUserMediaFailed(e):b.sendLog(e)},b.sendAnalyticsAndLog=function(e,t={}){if(!e)return void v.warn("No event or event name given.");let n;n="object"==typeof e?e:{name:e,properties:t},v.log(JSON.stringify(n)),this.analytics.sendEvent(e,t)},b.sendAnalytics=function(e,t={}){this.analytics.sendEvent(e,t)}}).call(this,"modules/statistics/statistics.js")},function(e,t){e.exports={CREATE_ANSWER_FAILED:"rtc.create_answer_failed",CREATE_OFFER_FAILED:"rtc.create_offer_failed",DATA_CHANNEL_OPEN:"rtc.data_channel_open",ENDPOINT_CONN_STATUS_CHANGED:"rtc.endpoint_conn_status_changed",DOMINANT_SPEAKER_CHANGED:"rtc.dominant_speaker_changed",LASTN_ENDPOINT_CHANGED:"rtc.lastn_endpoint_changed",PERMISSIONS_CHANGED:"rtc.permissions_changed",SENDER_VIDEO_CONSTRAINTS_CHANGED:"rtc.sender_video_constraints_changed",LASTN_VALUE_CHANGED:"rtc.lastn_value_changed",LOCAL_TRACK_SSRC_UPDATED:"rtc.local_track_ssrc_updated",LOCAL_TRACK_MAX_ENABLED_RESOLUTION_CHANGED:"rtc.local_track_max_enabled_resolution_changed",TRACK_ATTACHED:"rtc.track_attached",REMOTE_TRACK_ADDED:"rtc.remote_track_added",REMOTE_TRACK_MUTE:"rtc.remote_track_mute",REMOTE_TRACK_REMOVED:"rtc.remote_track_removed",REMOTE_TRACK_UNMUTE:"rtc.remote_track_unmute",SET_LOCAL_DESCRIPTION_FAILED:"rtc.set_local_description_failed",SET_REMOTE_DESCRIPTION_FAILED:"rtc.set_remote_description_failed",AUDIO_OUTPUT_DEVICE_CHANGED:"rtc.audio_output_device_changed",DEVICE_LIST_CHANGED:"rtc.device_list_changed",DEVICE_LIST_WILL_CHANGE:"rtc.device_list_will_change",DEVICE_LIST_AVAILABLE:"rtc.device_list_available",ENDPOINT_MESSAGE_RECEIVED:"rtc.endpoint_message_received",ENDPOINT_STATS_RECEIVED:"rtc.endpoint_stats_received",LOCAL_UFRAG_CHANGED:"rtc.local_ufrag_changed",REMOTE_UFRAG_CHANGED:"rtc.remote_ufrag_changed"}},function(e,t,n){"use strict";function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){r(e,t,n[t])}))}return e}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"t",(function(){return s})),n.d(t,"u",(function(){return o})),n.d(t,"v",(function(){return a})),n.d(t,"w",(function(){return c})),n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return u})),n.d(t,"c",(function(){return l})),n.d(t,"d",(function(){return h})),n.d(t,"e",(function(){return p})),n.d(t,"f",(function(){return m})),n.d(t,"g",(function(){return f})),n.d(t,"h",(function(){return g})),n.d(t,"i",(function(){return _})),n.d(t,"j",(function(){return v})),n.d(t,"k",(function(){return S})),n.d(t,"l",(function(){return y})),n.d(t,"m",(function(){return E})),n.d(t,"n",(function(){return b})),n.d(t,"o",(function(){return C})),n.d(t,"p",(function(){return T})),n.d(t,"q",(function(){return R})),n.d(t,"r",(function(){return A})),n.d(t,"s",(function(){return I})),n.d(t,"z",(function(){return w})),n.d(t,"B",(function(){return P})),n.d(t,"A",(function(){return O})),n.d(t,"C",(function(){return D})),n.d(t,"D",(function(){return N})),n.d(t,"E",(function(){return M})),n.d(t,"F",(function(){return L})),n.d(t,"J",(function(){return k})),n.d(t,"G",(function(){return x})),n.d(t,"H",(function(){return F})),n.d(t,"I",(function(){return j})),n.d(t,"K",(function(){return U})),n.d(t,"L",(function(){return H})),n.d(t,"M",(function(){return V})),n.d(t,"x",(function(){return B})),n.d(t,"y",(function(){return J})),n.d(t,"N",(function(){return G}));const s="operational",o="page",a="track",c="ui",d="restart",u="session-accept.timeout",l="session-initiate.received",h="session-initiate.timeout",p="terminate",m="transport-replace.received",f="transport-replace.success",g="decline",_="established",v="failed",S="switch.to.jvb",y="available.device",E="connection.disconnected",b="feedback",C="ice.duration",T="ice.establishment.duration.diff",R="ice.state.changed",A="track.no-bytes-sent",I="track.unmuted",w=function(){return{action:"bridge.down",actionSubject:"bridge.down",type:s}},P=function(e,t,n){return{type:s,action:"connection.failed",attributes:i({error_type:e,error_message:t},n)}};function O(e,t){return{action:e,attributes:t,source:"conference",type:s}}const D=function(e,t){const n="connection.stage.reached";return{action:n,actionSubject:e,attributes:t,source:n,type:s}},N=function(e,t,n){return{attributes:{participant_id:e,region:t,rtt:n},name:"e2e_rtt",type:s}},M=function(){return{action:"focus.left",actionSubject:"focus.left",type:s}},L=function(e,t={}){return{type:s,source:"get.user.media",action:e,attributes:t}},k=function(e={}){return{type:s,source:"peer.conn.status",action:"duration",attributes:e}},x=function(e,t={}){return{type:s,action:e,source:"jingle",attributes:t}},F=function(e,t){return{attributes:{media_type:e,value:t},action:"track.no.data.from.source",type:s}},j=function(e,t={}){return{type:s,action:e,source:"p2p",attributes:t}},U=function(e){return{type:s,action:"remotely.muted",mediaType:e}},H=function(e){return{type:s,action:"rtp.stats",attributes:e}},V=function(e){return{type:s,action:"transport.stats",attributes:e}};function B(e,t,n){return{type:s,action:"audio.output.problem",attributes:{userID:e,localAudioLevels:t,remoteAudioLevels:n}}}const J=function(e,t){return{type:s,action:"bridge-channel.error",attributes:{code:e,reason:t}}},G=function(e){return D("ttfm",e)}},function(e,t,n){"use strict";(function(e){var i=n(5),r=n(20),s=n.n(r),o=n(10),a=n.n(o),c=n(3),d=n(38),u=n.n(d);const l=Object(i.getLogger)(e),h={filterSpecialChars:e=>e?e.replace(/[\\\/\{,\}\+]/g,""):e,iceparams(e,t){let n,i,r=null;return(i=h.findLine(e,"a=ice-ufrag:",t))&&(n=h.findLine(e,"a=ice-pwd:",t))&&(r={ufrag:h.parseICEUfrag(i),pwd:h.parseICEPwd(n)}),r},parseICEUfrag:e=>e.substring(12),buildICEUfrag:e=>"a=ice-ufrag:"+e,parseICEPwd:e=>e.substring(10),buildICEPwd:e=>"a=ice-pwd:"+e,parseMID:e=>e.substring(6),parseMLine(e){const t={},n=e.substring(2).split(" ");return t.media=n.shift(),t.port=n.shift(),t.proto=n.shift(),""===n[n.length-1]&&n.pop(),t.fmt=n,t},buildMLine:e=>`m=${e.media} ${e.port} ${e.proto} ${e.fmt.join(" ")}`,parseRTPMap(e){const t={};let n=e.substring(9).split(" ");return t.id=n.shift(),n=n[0].split("/"),t.name=n.shift(),t.clockrate=n.shift(),t.channels=n.length?n.shift():"1",t},parseSCTPMap(e){const t=e.substring(10).split(" ");return[t[0],t[1],t.length>2?t[2]:null]},buildRTPMap(e){let t=`a=rtpmap:${e.getAttribute("id")} ${e.getAttribute("name")}/${e.getAttribute("clockrate")}`;return e.getAttribute("channels")&&"1"!==e.getAttribute("channels")&&(t+="/"+e.getAttribute("channels")),t},parseCrypto(e){const t={},n=e.substring(9).split(" ");return t.tag=n.shift(),t["crypto-suite"]=n.shift(),t["key-params"]=n.shift(),n.length&&(t["session-params"]=n.join(" ")),t},parseFingerprint(e){const t={},n=e.substring(14).split(" ");return t.hash=n.shift(),t.fingerprint=n.shift(),t},parseFmtp(e){const t=[];let n=e.split(" ");n.shift(),n=n.join(" ").split(";");for(let e=0;e<n.length;e++){let i=n[e].split("=")[0];for(;i.length&&" "===i[0];)i=i.substring(1);const r=n[e].split("=")[1];i&&r?t.push({name:i,value:r}):i&&t.push({name:"",value:i})}return t},parseICECandidate(e){const t={},n=e.split(" ");t.foundation=n[0].substring(12),t.component=n[1],t.protocol=n[2].toLowerCase(),t.priority=n[3],t.ip=n[4],t.port=n[5],t.type=n[7],t.generation=0;for(let e=8;e<n.length;e+=2)switch(n[e]){case"raddr":t["rel-addr"]=n[e+1];break;case"rport":t["rel-port"]=n[e+1];break;case"generation":t.generation=n[e+1];break;case"tcptype":t.tcptype=n[e+1];break;default:l.debug(`parseICECandidate not translating "${n[e]}" = "${n[e+1]}"`)}return t.network="1",t.id=Math.random().toString(36).substr(2,10),t},buildICECandidate(e){let t=["a=candidate:"+e.foundation,e.component,e.protocol,e.priority,e.ip,e.port,"typ",e.type].join(" ");switch(t+=" ",e.type){case"srflx":case"prflx":case"relay":e.hasOwnAttribute("rel-addr")&&e.hasOwnAttribute("rel-port")&&(t+="raddr",t+=" ",t+=e["rel-addr"],t+=" ",t+="rport",t+=" ",t+=e["rel-port"],t+=" ")}return e.hasOwnAttribute("tcptype")&&(t+="tcptype",t+=" ",t+=e.tcptype,t+=" "),t+="generation",t+=" ",t+=e.hasOwnAttribute("generation")?e.generation:"0",t},parseSSRC(e){const t=new Map,n=e.split("\r\n");for(let e=0;e<n.length;e++)if("a=ssrc:"===n[e].substring(0,7)){const i=n[e].split("a=ssrc:")[1].split(" ")[0];t.get(i)||t.set(i,[]),t.get(i).push(n[e])}return t},parseRTCPFB(e){const t=e.substr(10).split(" "),n={};return n.pt=t.shift(),n.type=t.shift(),n.params=t,n},parseExtmap(e){const t=e.substr(9).split(" "),n={};return n.value=t.shift(),-1===n.value.indexOf("/")?n.direction="both":(n.direction=n.value.substr(n.value.indexOf("/")+1),n.value=n.value.substr(0,n.value.indexOf("/"))),n.uri=t.shift(),n.params=t,n},findLine(e,t,n){let i=e.split("\r\n");for(let e=0;e<i.length;e++)if(i[e].substring(0,t.length)===t)return i[e];if(!n)return!1;i=n.split("\r\n");for(let e=0;e<i.length;e++)if(i[e].substring(0,t.length)===t)return i[e];return!1},findLines(e,t,n){let i=e.split("\r\n");const r=[];for(let e=0;e<i.length;e++)i[e].substring(0,t.length)===t&&r.push(i[e]);if(r.length||!n)return r;i=n.split("\r\n");for(let e=0;e<i.length;e++)i[e].substring(0,t.length)===t&&r.push(i[e]);return r},candidateToJingle(e){if(0===e.indexOf("candidate:"))e="a="+e;else if("a=candidate:"!==e.substring(0,12))return l.warn("parseCandidate called with a line that is not a candidate line"),l.warn(e),null;"\r\n"===e.substring(e.length-2)&&(e=e.substring(0,e.length-2));const t={},n=e.split(" ");if("typ"!==n[6])return l.warn("did not find typ in the right place"),l.warn(e),null;t.foundation=n[0].substring(12),t.component=n[1],t.protocol=n[2].toLowerCase(),t.priority=n[3],t.ip=n[4],t.port=n[5],t.type=n[7],t.generation="0";for(let e=8;e<n.length;e+=2)switch(n[e]){case"raddr":t["rel-addr"]=n[e+1];break;case"rport":t["rel-port"]=n[e+1];break;case"generation":t.generation=n[e+1];break;case"tcptype":t.tcptype=n[e+1];break;default:l.debug(`not translating "${n[e]}" = "${n[e+1]}"`)}return t.network="1",t.id=Math.random().toString(36).substr(2,10),t},candidateFromJingle(e){let t="a=candidate:";t+=e.getAttribute("foundation"),t+=" ",t+=e.getAttribute("component"),t+=" ";let n=e.getAttribute("protocol");switch(c.a.isFirefox()&&"ssltcp"===n.toLowerCase()&&(n="tcp"),t+=n,t+=" ",t+=e.getAttribute("priority"),t+=" ",t+=e.getAttribute("ip"),t+=" ",t+=e.getAttribute("port"),t+=" ",t+="typ",t+=" "+e.getAttribute("type"),t+=" ",e.getAttribute("type")){case"srflx":case"prflx":case"relay":e.getAttribute("rel-addr")&&e.getAttribute("rel-port")&&(t+="raddr",t+=" ",t+=e.getAttribute("rel-addr"),t+=" ",t+="rport",t+=" ",t+=e.getAttribute("rel-port"),t+=" ")}return"tcp"===n.toLowerCase()&&(t+="tcptype",t+=" ",t+=e.getAttribute("tcptype"),t+=" "),t+="generation",t+=" ",t+=e.getAttribute("generation")||"0",t+"\r\n"},parsePrimaryVideoSsrc(e){const t=e.ssrcs.map(e=>e.id).filter((e,t,n)=>n.indexOf(e)===t).length,n=e.ssrcGroups&&e.ssrcGroups.length||0;if(t>1&&0===n)return;let i=null;if(1===t)i=e.ssrcs[0].id;else if(2===t){const t=e.ssrcGroups.find(e=>"FID"===e.semantics);t&&(i=t.ssrcs.split(" ")[0])}else if(t>=3){const t=e.ssrcGroups.find(e=>"SIM"===e.semantics);t&&(i=t.ssrcs.split(" ")[0])}return i},generateSsrc:()=>u.a.randomInt(1,4294967295),getSsrcAttribute(e,t,n){for(let i=0;i<e.ssrcs.length;++i){const r=e.ssrcs[i];if(r.id===t&&r.attribute===n)return r.value}},parseGroupSsrcs:e=>e.ssrcs.split(" ").map(e=>parseInt(e,10)),getMedia:(e,t)=>e.media.find(e=>e.type===t),getUfrag(e){const t=e.split("\n").filter(e=>e.startsWith("a=ice-ufrag:"));if(t.length>0)return t[0].substr("a=ice-ufrag:".length)},preferCodec(e,t){if(!e||!t)return;const n=e.rtp.filter(e=>e.codec&&e.codec.toLowerCase()===t.toLowerCase()).map(e=>e.payload);if(n){const t=e.payloads.toString().split(" ").map(e=>parseInt(e,10));for(const e of n.reverse()){const n=t.indexOf(e);t.splice(n,1),t.unshift(e)}e.payloads=t.join(" ")}},stripCodec(e,t,n=!1){if(!e||!t)return;const i=[];let r=[];const o=t.toLowerCase()===s.a.H264&&n;for(const n of e.rtp)n.codec&&n.codec.toLowerCase()===t.toLowerCase()&&(o?i.push(n.payload):r.push(n.payload));if(o&&(r=e.fmtp.filter(e=>i.indexOf(e.payload)>-1&&e.config.includes("profile-level-id=64")).map(e=>e.payload)),r.length>0){const t=r.map(e=>"apt="+e),n=e.fmtp.filter(e=>-1!==t.indexOf(e.config));r.push(...n.map(e=>e.payload));const i=e.payloads.toString().split(" ").map(Number).filter(e=>-1===r.indexOf(e));0===i.length?(e.port=0,e.direction=a.a.INACTIVE,e.payloads="*"):e.payloads=i.join(" "),e.rtp=e.rtp.filter(e=>-1!==i.indexOf(e.payload)),e.fmtp=e.fmtp.filter(e=>-1!==i.indexOf(e.payload)),e.rtcpFb&&(e.rtcpFb=e.rtcpFb.filter(e=>-1!==i.indexOf(e.payload)))}}};t.a=h}).call(this,"modules/sdp/SDPUtil.js")},function(e,t){e.exports={INACTIVE:"inactive",RECVONLY:"recvonly",SENDONLY:"sendonly",SENDRECV:"sendrecv"}},function(e,t,n){"use strict";(function(e){var i=n(19),r=n.n(i),s=n(5),o=n(44),a=n.n(o),c=n(21),d=n(14),u=n(47),l=n.n(u),h=n(7),p=n.n(h),m=n(67),f=n.n(m),g=n(15),_=n.n(g),v=n(8),S=n(3),y=n(9),E=n(6),b=n(12),C=n.n(b),T=n(22),R=n(36);function A(e,t){if(null==e)return{};var n,i,r=function(e,t){if(null==e)return{};var n,i,r={},s=Object.keys(e);for(i=0;i<s.length;i++)n=s[i],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}const I=Object(s.getLogger)(e);S.a.usesAdapter()&&n(173);const w=new r.a,P={video:{height:{ideal:720,max:720,min:180},width:{ideal:1280,max:1280,min:320}}};let O="default",D=!1,N=!1,M=!1,L=!1,k=!1,x=null;const F=document.createElement("audio"),j=void 0!==F.setSinkId;let U,H=[];function V(){}function B(e,t){const n=Boolean(t)&&t.getAudioTracks().length>0,i=Boolean(t)&&t.getVideoTracks().length>0,r={};-1!==e.indexOf("video")&&(r.video=i),-1!==e.indexOf("audio")&&(r.audio=n),w.emit(p.a.PERMISSIONS_CHANGED,r)}function J(e){const t=e.filter(e=>"audioinput"===e.kind).length,n=e.filter(e=>"audiooutput"===e.kind).length,i=e.filter(e=>"videoinput"===e.kind).length,r=e.filter(e=>"videooutput"===e.kind).length;e.forEach(e=>{const s={audio_input_device_count:t,audio_output_device_count:n,video_input_device_count:i,video_output_device_count:r,device_id:e.deviceId,device_group_id:e.groupId,device_kind:e.kind,device_label:e.label};E.a.sendAnalytics(v.l,s)})}function G(e){(function(e){return e.length!==H.length||e.map(t).sort().join("")!==H.map(t).sort().join("");function t(e){return JSON.stringify({kind:e.kind,deviceId:e.deviceId,groupId:e.groupId,label:e.label,facing:e.facing})}})(e)&&(H=e.slice(0),I.info("list of media devices has changed:",H),J(H),w.emit(p.a.DEVICE_LIST_WILL_CHANGE,H),w.emit(p.a.DEVICE_LIST_CHANGED,H))}class $ extends T.a{constructor(){super(w)}init(e={}){var t,n;"boolean"==typeof e.disableAEC&&(M=e.disableAEC,I.info("Disable AEC: "+M)),"boolean"==typeof e.disableNS&&(L=e.disableNS,I.info("Disable NS: "+L)),"boolean"==typeof e.disableAP&&(N=e.disableAP,I.info("Disable AP: "+N)),"boolean"==typeof e.disableAGC&&(k=e.disableAGC,I.info("Disable AGC: "+k)),"boolean"==typeof(null===(t=e.audioQuality)||void 0===t?void 0:t.stereo)&&(x=e.audioQuality.stereo,I.info("Stereo: "+x)),window.clearInterval(U),U=void 0,S.a.isReactNative()?(this.RTCPeerConnectionType=RTCPeerConnection,this.attachMediaStream=void 0,this.getStreamID=function({id:e}){return"number"==typeof e?e:y.a.filterSpecialChars(e)},this.getTrackID=({id:e})=>e):(this.RTCPeerConnectionType=RTCPeerConnection,this.attachMediaStream=(n=(e,t)=>{e&&(e.srcObject=t)},function(e,t){const i=n.apply(K,arguments);return t&&K.isDeviceChangeAvailable("output")&&t.getAudioTracks&&t.getAudioTracks().length&&D&&e.setSinkId(K.getAudioOutputDevice()).catch((function(t){const n=new c.a(t,null,["audiooutput"]);C.a.callUnhandledRejectionHandler({promise:this,reason:n}),I.warn("Failed to set audio output device for the element. Default audio output device will be used instead",e,n)})),i}),this.getStreamID=({id:e})=>e,this.getTrackID=({id:e})=>e),this.pcConstraints=S.a.isChromiumBased()||S.a.isReactNative()?{optional:[{googScreencastMinBitrate:100},{googCpuOveruseDetection:!0}]}:{},R.b.init(e),this.isDeviceListAvailable()&&this.enumerateDevices(e=>{H=e.slice(0),I.debug("Available devices: ",H),J(H),w.emit(p.a.DEVICE_LIST_AVAILABLE,H),S.a.supportsDeviceChangeEvent()?navigator.mediaDevices.addEventListener("devicechange",()=>this.enumerateDevices(V)):U=window.setInterval(()=>this.enumerateDevices(V),3e3)})}enumerateDevices(e){navigator.mediaDevices.enumerateDevices().then(t=>{G(t),e(t)}).catch(t=>{I.warn("Failed to enumerate devices. "+t),G([]),e([])})}_getUserMedia(e,t={},n=0){return new Promise((i,r)=>{let s,o=!1;"number"==typeof n&&!isNaN(n)&&n>0&&(s=setTimeout(()=>{o=!0,s=void 0,r(new c.a(d.TIMEOUT))},n)),navigator.mediaDevices.getUserMedia(t).then(t=>{I.log("onUserMediaSuccess"),B(e,t),o||(void 0!==s&&clearTimeout(s),i(t))}).catch(n=>{I.warn(`Failed to get access to local media. ${n} ${JSON.stringify(t)}`);const i=new c.a(n,t,e);o||(void 0!==s&&clearTimeout(s),r(n)),i.name===d.PERMISSION_DENIED&&B(e,void 0)})})}_getDesktopMedia(){return R.b.isSupported()?new Promise((e,t)=>{R.b.obtainStream(t=>{e(t)},e=>{t(e)})}):Promise.reject(new Error("Desktop sharing is not supported!"))}_getMissingTracks(e=[],t){const n=[],i=e.includes("audio"),r=t&&t.getAudioTracks().length>0;i&&!r&&n.push("audio");const s=e.includes("video"),o=t&&t.getVideoTracks().length>0;return s&&!o&&n.push("video"),n}obtainAudioAndVideoPermissions(e){const{timeout:t}=e,n=A(e,["timeout"]),i=[],r=function(){if(!(-1!==(n.devices||[]).indexOf("desktop")))return Promise.resolve();const{desktopSharingSourceDevice:e}=n;if(e){const n=H&&H.find(t=>"videoinput"===t.kind&&(t.deviceId===e||t.label===e));if(!n)return Promise.reject(new c.a({name:"ConstraintNotSatisfiedError"},{},[e]));const i=["video"],r={video:{deviceId:n.deviceId}};return this._getUserMedia(i,r,t).then(e=>({sourceType:"device",stream:e}))}return this._getDesktopMedia()}.bind(this),s=function(){const e=(n.devices||["audio","video"]).filter(e=>"audio"===e||"video"===e);if(!e.length)return Promise.resolve();const i=function(e=[],t={}){const n=a()(t.constraints||P);if(e.indexOf("video")>=0){if(f.a[t.resolution]){const e=f.a[t.resolution];n.video.height={ideal:e.height},n.video.width={ideal:e.width}}if(n.video||(n.video={}),S.a.isWebKitBased()&&(n.video.height&&n.video.height.ideal?n.video.height={ideal:n.video.height.ideal}:I.warn("Ideal camera height missing, camera may not start properly"),n.video.width&&n.video.width.ideal?n.video.width={ideal:n.video.width.ideal}:I.warn("Ideal camera width missing, camera may not start properly")),t.cameraDeviceId)n.video.deviceId=t.cameraDeviceId;else{const e=t.facingMode||l.a.USER;n.video.facingMode=e}}else n.video=!1;return e.indexOf("audio")>=0?(n.audio&&"boolean"!=typeof n.audio||(n.audio={}),n.audio={autoGainControl:!k&&!N,deviceId:t.micDeviceId,echoCancellation:!M&&!N,noiseSuppression:!L&&!N},x&&Object.assign(n.audio,{channelCount:2})):n.audio=!1,n}(e,n);return I.info("Got media constraints: ",JSON.stringify(i)),this._getUserMedia(e,i,t)}.bind(this);return r().then((function(e){if(!e)return;const{stream:t,sourceId:n,sourceType:r}=e,s=t.getAudioTracks();if(s.length){const e=new MediaStream(s);i.push({stream:e,sourceId:n,sourceType:r,track:e.getAudioTracks()[0]})}const o=t.getVideoTracks();if(o.length){const e=new MediaStream(o);i.push({stream:e,sourceId:n,sourceType:r,track:e.getVideoTracks()[0],videoType:_.a.DESKTOP})}})).then(s).then((function(e){if(!e)return;const t=e.getAudioTracks();if(t.length){const e=new MediaStream(t);i.push({stream:e,track:e.getAudioTracks()[0],effects:n.effects})}const r=e.getVideoTracks();if(r.length){const e=new MediaStream(r);i.push({stream:e,track:e.getVideoTracks()[0],videoType:_.a.CAMERA,effects:n.effects})}})).then(()=>i).catch(e=>(i.forEach(({stream:e})=>{this.stopMediaStream(e)}),Promise.reject(e)))}isDeviceListAvailable(){return Boolean(navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices)}isDeviceChangeAvailable(e){return"output"!==e&&"audiooutput"!==e||j}stopMediaStream(e){e&&(e.getTracks().forEach(e=>{e.stop&&e.stop()}),e.stop&&e.stop(),e.release&&e.release())}isDesktopSharingEnabled(){return R.b.isSupported()}setAudioOutputDevice(e){return this.isDeviceChangeAvailable("output")?F.setSinkId(e).then(()=>{O=e,D=!0,I.log("Audio output device set to "+e),w.emit(p.a.AUDIO_OUTPUT_DEVICE_CHANGED,e)}):Promise.reject(new Error("Audio output device change is not supported"))}setDesktopSharingFrameRate(e){R.b.setDesktopSharingFrameRate(e)}getAudioOutputDevice(){return O}getCurrentlyAvailableMediaDevices(){return H}arePermissionsGrantedForAvailableDevices(){return H.some(e=>Boolean(e.label))}getEventDataForActiveDevice(e){const t=[],n={deviceId:e.deviceId,kind:e.kind,label:e.label,groupId:e.groupId};return t.push(n),{deviceList:t}}setSuspendVideo(e,t){e.optional||(e.optional=[]),e.optional=e.optional.filter(e=>!e.hasOwnProperty("googSuspendBelowMinBitrate")),t&&e.optional.push({googSuspendBelowMinBitrate:"true"})}}const K=new $;t.a=K}).call(this,"modules/RTC/RTCUtils.js")},function(e,t){const n=[],i=window.onerror;const r=window.onunhandledrejection;window.onerror=function(...e){n.forEach(t=>t(...e)),i&&i(...e)},window.onunhandledrejection=function(e){n.forEach(t=>t(null,null,null,null,e.reason)),r&&r(e)};const s={addHandler(e){n.push(e)},callErrorHandler(e){const t=window.onerror;t&&t(null,null,null,null,e)},callUnhandledRejectionHandler(e){const t=window.onunhandledrejection;t&&t(e)}};e.exports=s},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return T}));var i=n(5),r=n(1),s=n(53),o=n.n(s),a=n(4),c=n(7),d=n.n(c),u=n(3),l=n(6),h=n(12),p=n.n(h),m=n(22),f=n(31),g=n(120),_=n(121),v=n(11),S=n(122);const y=Object(i.getLogger)(e);let E=0,b=0;function C(e=[]){return e.map(e=>{const{sourceId:t,sourceType:n,stream:i,track:r,videoType:s,effects:o}=e,{deviceId:a,facingMode:c}=r.getSettings();return b=Object(f.d)(b),new _.a({deviceId:a,facingMode:c,mediaType:r.kind,rtcId:b,sourceId:t,sourceType:n,stream:i,track:r,videoType:s||null,effects:o})})}class T extends m.a{constructor(e,t={}){super(),this.conference=e,this.peerConnections=new Map,this.localTracks=[],this.options=t,this._channel=null,this._lastN=void 0,this._lastNEndpoints=null,this._maxFrameHeight=void 0,this._selectedEndpoints=null,this._lastNChangeListener=this._onLastNChanged.bind(this),this._onDeviceListChanged=this._onDeviceListChanged.bind(this),this._updateAudioOutputForAudioTracks=this._updateAudioOutputForAudioTracks.bind(this),this._videoType=o.a.NONE,v.a.isDeviceChangeAvailable("output")&&(v.a.addListener(d.a.AUDIO_OUTPUT_DEVICE_CHANGED,this._updateAudioOutputForAudioTracks),v.a.addListener(d.a.DEVICE_LIST_CHANGED,this._onDeviceListChanged))}destroy(){v.a.removeListener(d.a.AUDIO_OUTPUT_DEVICE_CHANGED,this._updateAudioOutputForAudioTracks),v.a.removeListener(d.a.DEVICE_LIST_CHANGED,this._onDeviceListChanged),this._channelOpenListener&&this.removeListener(d.a.DATA_CHANNEL_OPEN,this._channelOpenListener)}static createLocalTracks(e){return C(e)}static obtainAudioAndVideoPermissions(e){return v.a.obtainAudioAndVideoPermissions(e).then(e=>C(e))}initializeBridgeChannel(e,t){this._channel=new g.a(e,t,this.eventEmitter),this._channelOpenListener=()=>{const e=(e,t,n)=>{p.a.callErrorHandler(e),y.error(`Cannot send ${t}(${JSON.stringify(n)}) endpoint message`,e)};if(this._receiverVideoConstraints)try{this._channel.sendNewReceiverVideoConstraintsMessage(this._receiverVideoConstraints)}catch(t){e(t,"ReceiverVideoConstraints",this._receiverVideoConstraints)}if(this._selectedEndpoints)try{this._channel.sendSelectedEndpointsMessage(this._selectedEndpoints)}catch(t){e(t,"SelectedEndpointsChangedEvent",this._selectedEndpoints)}if(void 0!==this._maxFrameHeight)try{this._channel.sendReceiverVideoConstraintMessage(this._maxFrameHeight)}catch(t){e(t,"ReceiverVideoConstraint",this._maxFrameHeight)}if(void 0!==this._lastN&&-1!==this._lastN)try{this._channel.sendSetLastNMessage(this._lastN)}catch(t){e(t,"LastNChangedEvent",this._lastN)}try{this._channel.sendVideoTypeMessage(this._videoType)}catch(t){e(t,"VideoTypeMessage",this._videoType)}this.removeListener(d.a.DATA_CHANNEL_OPEN,this._channelOpenListener),this._channelOpenListener=null},this.addListener(d.a.DATA_CHANNEL_OPEN,this._channelOpenListener),this.addListener(d.a.LASTN_ENDPOINT_CHANGED,this._lastNChangeListener)}_onDeviceListChanged(){this._updateAudioOutputForAudioTracks(v.a.getAudioOutputDevice())}_onLastNChanged(e=[]){const t=this._lastNEndpoints||[];let n=[],i=[];this._lastNEndpoints=e,n=t.filter(e=>!this.isInLastN(e)),i=e.filter(e=>-1===t.indexOf(e)),this.conference.eventEmitter.emit(r.LAST_N_ENDPOINTS_CHANGED,n,i)}onCallEnded(){this._channel&&(this._channel&&"websocket"===this._channel.mode&&this._channel.close(),this._channel=null)}setDesktopSharingFrameRate(e){v.a.setDesktopSharingFrameRate(e)}setNewReceiverVideoConstraints(e){this._receiverVideoConstraints=e,this._channel&&this._channel.isOpen()&&this._channel.sendNewReceiverVideoConstraintsMessage(e)}setReceiverVideoConstraint(e){this._maxFrameHeight=e,this._channel&&this._channel.isOpen()&&this._channel.sendReceiverVideoConstraintMessage(e)}setVideoType(e){this._videoType!==e&&(this._videoType=e,this._channel&&this._channel.isOpen()&&this._channel.sendVideoTypeMessage(e))}selectEndpoints(e){this._selectedEndpoints=e,this._channel&&this._channel.isOpen()&&this._channel.sendSelectedEndpointsMessage(e)}static addListener(e,t){v.a.addListener(e,t)}static removeListener(e,t){v.a.removeListener(e,t)}static init(e={}){return this.options=e,v.a.init(this.options)}createPeerConnection(e,t,n,i){const r=JSON.parse(JSON.stringify(v.a.pcConstraints));void 0!==i.abtestSuspendVideo&&(v.a.setSuspendVideo(r,i.abtestSuspendVideo),l.a.analytics.addPermanentProperties({abtestSuspendVideo:i.abtestSuspendVideo})),i.enableInsertableStreams&&(y.debug("E2EE - setting insertable streams constraints"),t.encodedInsertableStreams=!0);(u.a.isReactNative()||u.a.isChromiumBased()&&!i.usesUnifiedPlan)&&(t.sdpSemantics="plan-b"),i.forceTurnRelay&&(t.iceTransportPolicy="relay"),t.bundlePolicy="max-bundle",E=Object(f.d)(E);const s=new S.a(this,E,e,t,r,n,i);return this.peerConnections.set(s.id,s),s}_removePeerConnection(e){const t=e.id;return!!this.peerConnections.has(t)&&(this.peerConnections.delete(t),!0)}addLocalTrack(e){if(!e)throw new Error("track must not be null nor undefined");this.localTracks.push(e),e.conference=this.conference}getLocalVideoTrack(){const e=this.getLocalTracks(a.c);return e.length?e[0]:void 0}getLocalAudioTrack(){const e=this.getLocalTracks(a.a);return e.length?e[0]:void 0}getLocalEndpointId(){return this.conference.myUserId()}getLocalTracks(e){let t=this.localTracks.slice();return void 0!==e&&(t=t.filter(t=>t.getType()===e)),t}getRemoteTracks(e){let t=[];for(const n of this.peerConnections.values()){const i=n.getRemoteTracks(void 0,e);i&&(t=t.concat(i))}return t}setAudioMute(e){const t=[];return this.getLocalTracks(a.a).forEach(n=>{t.push(e?n.mute():n.unmute())}),Promise.all(t)}setVideoMute(e){const t=[];return this.getLocalTracks(a.c).concat(this.getLocalTracks(a.b)).forEach(n=>{t.push(e?n.mute():n.unmute())}),Promise.all(t)}removeLocalTrack(e){const t=this.localTracks.indexOf(e);-1!==t&&this.localTracks.splice(t,1)}static attachMediaStream(e,t){return v.a.attachMediaStream(e,t)}static getStreamID(e){return v.a.getStreamID(e)}static getTrackID(e){return v.a.getTrackID(e)}static isDeviceListAvailable(){return v.a.isDeviceListAvailable()}static isDeviceChangeAvailable(e){return v.a.isDeviceChangeAvailable(e)}static isWebRtcSupported(){return u.a.isSupported()}static getAudioOutputDevice(){return v.a.getAudioOutputDevice()}static getCurrentlyAvailableMediaDevices(){return v.a.getCurrentlyAvailableMediaDevices()}static arePermissionsGrantedForAvailableDevices(){return v.a.arePermissionsGrantedForAvailableDevices()}static getEventDataForActiveDevice(e){return v.a.getEventDataForActiveDevice(e)}static setAudioOutputDevice(e){return v.a.setAudioOutputDevice(e)}static isUserStream(e){return T.isUserStreamById(v.a.getStreamID(e))}static isUserStreamById(e){return e&&"mixedmslabel"!==e&&"default"!==e}static enumerateDevices(e){v.a.enumerateDevices(e)}static stopMediaStream(e){v.a.stopMediaStream(e)}static isDesktopSharingEnabled(){return v.a.isDesktopSharingEnabled()}closeBridgeChannel(){this._channel&&(this._channel.close(),this._channel=null,this.removeListener(d.a.LASTN_ENDPOINT_CHANGED,this._lastNChangeListener))}setAudioLevel(e,t,n,i){const r=e.getTrackBySSRC(t);r&&(r.isAudioTrack()?(r.isLocal()!==i&&y.error(`${r} was expected to ${i?"be":"not be"} local`),r.setAudioLevel(n,e)):y.warn("Received audio level for non-audio track: "+t))}sendChannelMessage(e,t){if(!this._channel)throw new Error("Channel support is disabled!");this._channel.sendMessage(e,t)}sendEndpointStatsMessage(e){this._channel&&this._channel.isOpen()&&this._channel.sendEndpointStatsMessage(e)}setLastN(e){this._lastN!==e&&(this._lastN=e,this._channel&&this._channel.isOpen()&&this._channel.sendSetLastNMessage(e),this.eventEmitter.emit(d.a.LASTN_VALUE_CHANGED,e))}isInLastN(e){return!this._lastNEndpoints||this._lastNEndpoints.indexOf(e)>-1}_updateAudioOutputForAudioTracks(e){const t=this.getRemoteTracks(a.a);for(const n of t)n.setAudioOutput(e)}}}).call(this,"modules/RTC/RTC.js")},function(e,t,n){"use strict";n.r(t),n.d(t,"CONSTRAINT_FAILED",(function(){return i})),n.d(t,"ELECTRON_DESKTOP_PICKER_ERROR",(function(){return r})),n.d(t,"ELECTRON_DESKTOP_PICKER_NOT_FOUND",(function(){return s})),n.d(t,"GENERAL",(function(){return o})),n.d(t,"NOT_FOUND",(function(){return a})),n.d(t,"PERMISSION_DENIED",(function(){return c})),n.d(t,"SCREENSHARING_GENERIC_ERROR",(function(){return d})),n.d(t,"SCREENSHARING_USER_CANCELED",(function(){return u})),n.d(t,"TIMEOUT",(function(){return l})),n.d(t,"TRACK_IS_DISPOSED",(function(){return h})),n.d(t,"TRACK_NO_STREAM_FOUND",(function(){return p})),n.d(t,"UNSUPPORTED_RESOLUTION",(function(){return m}));const i="gum.constraint_failed",r="gum.electron_desktop_picker_error",s="gum.electron_desktop_picker_not_found",o="gum.general",a="gum.not_found",c="gum.permission_denied",d="gum.screensharing_generic_error",u="gum.screensharing_user_canceled",l="gum.timeout",h="track.track_is_disposed",p="track.no_stream_found",m="gum.unsupported_resolution"},function(e,t){e.exports={CAMERA:"camera",DESKTOP:"desktop"}},function(e,t,n){"use strict";n.r(t),n.d(t,"LOCAL_TRACK_STOPPED",(function(){return i})),n.d(t,"TRACK_AUDIO_LEVEL_CHANGED",(function(){return r})),n.d(t,"TRACK_AUDIO_OUTPUT_CHANGED",(function(){return s})),n.d(t,"TRACK_MUTE_CHANGED",(function(){return o})),n.d(t,"TRACK_VIDEOTYPE_CHANGED",(function(){return a})),n.d(t,"NO_DATA_FROM_SOURCE",(function(){return c})),n.d(t,"NO_AUDIO_INPUT",(function(){return d}));const i="track.stopped",r="track.audioLevelsChanged",s="track.audioOutputChanged",o="track.trackMuteChanged",a="track.videoTypeChanged",c="track.no_data_from_source",d="track.no_audio_input"},function(e,t,n){"use strict";n.r(t),n.d(t,"AUTHENTICATION_REQUIRED",(function(){return i})),n.d(t,"CHAT_ERROR",(function(){return r})),n.d(t,"CONFERENCE_DESTROYED",(function(){return s})),n.d(t,"CONFERENCE_MAX_USERS",(function(){return o})),n.d(t,"CONNECTION_ERROR",(function(){return a})),n.d(t,"CONFERENCE_RESTARTED",(function(){return c})),n.d(t,"NOT_ALLOWED_ERROR",(function(){return d})),n.d(t,"MEMBERS_ONLY_ERROR",(function(){return u})),n.d(t,"CONFERENCE_ACCESS_DENIED",(function(){return l})),n.d(t,"FOCUS_DISCONNECTED",(function(){return h})),n.d(t,"FOCUS_LEFT",(function(){return p})),n.d(t,"GRACEFUL_SHUTDOWN",(function(){return m})),n.d(t,"ICE_FAILED",(function(){return f})),n.d(t,"INCOMPATIBLE_SERVER_VERSIONS",(function(){return g})),n.d(t,"OFFER_ANSWER_FAILED",(function(){return _})),n.d(t,"PASSWORD_NOT_SUPPORTED",(function(){return v})),n.d(t,"PASSWORD_REQUIRED",(function(){return S})),n.d(t,"RESERVATION_ERROR",(function(){return y})),n.d(t,"VIDEOBRIDGE_NOT_AVAILABLE",(function(){return E}));const i="conference.authenticationRequired",r="conference.chatError",s="conference.destroyed",o="conference.max_users",a="conference.connectionError",c="conference.restarted",d="conference.connectionError.notAllowed",u="conference.connectionError.membersOnly",l="conference.connectionError.accessDenied",h="conference.focusDisconnected",p="conference.focusLeft",m="conference.gracefulShutdown",f="conference.iceFailed",g="conference.incompatible_server_versions",_="conference.offerAnswerFailed",v="conference.passwordNotSupported",S="conference.passwordRequired",y="conference.reservationError",E="conference.videobridgeNotAvailable"},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n(10),r=n.n(i),s=n(3),o=n(9);function a(e){const t=e.split("\r\nm=");for(let e=1,n=t.length;e<n;e++){let i="m="+t[e];e!==n-1&&(i+="\r\n"),t[e]=i}const n=t.shift()+"\r\n";this.media=t,this.raw=n+t.join(""),this.session=n}a.prototype.failICE=!1,a.prototype.removeTcpCandidates=!1,a.prototype.removeUdpCandidates=!1,a.prototype.getMediaSsrcMap=function(){const e={};for(let t=0;t<this.media.length;t++){const n={mediaindex:t,mid:o.a.parseMID(o.a.findLine(this.media[t],"a=mid:")),ssrcs:{},ssrcGroups:[]};e[t]=n,o.a.findLines(this.media[t],"a=ssrc:").forEach(e=>{const t=e.substring(7).split(" ")[0];n.ssrcs[t]||(n.ssrcs[t]={ssrc:t,lines:[]}),n.ssrcs[t].lines.push(e)}),o.a.findLines(this.media[t],"a=ssrc-group:").forEach(e=>{const t=e.indexOf(" "),i=e.substr(0,t).substr(13),r=e.substr(14+i.length).split(" ");r.length&&n.ssrcGroups.push({semantics:i,ssrcs:r})})}return e},a.prototype.containsSSRC=function(e){const t=this.getMediaSsrcMap();let n=!1;return Object.keys(t).forEach(i=>{n||t[i].ssrcs[e]&&(n=!0)}),n},a.prototype.toJingle=function(e,t){o.a.findLines(this.session,"a=group:").forEach(t=>{const n=t.split(" "),i=n.shift().substr(8);e.c("group",{xmlns:"urn:xmpp:jingle:apps:grouping:0",semantics:i});for(let t=0;t<n.length;t++)e.c("content",{name:n[t]}).up();e.up()});for(let n=0;n<this.media.length;n++){const i=o.a.parseMLine(this.media[n].split("\r\n")[0]);if("audio"!==i.media&&"video"!==i.media&&"application"!==i.media)continue;let a;const c=o.a.findLine(this.media[n],"a=ssrc:");a=!!c&&c.substring(7).split(" ")[0],e.c("content",{creator:t,name:i.media});const d=o.a.findLine(this.media[n],"a=mid:");if(d){const t=o.a.parseMID(d);e.attrs({name:t})}if("audio"===i.media||"video"===i.media){e.c("description",{xmlns:"urn:xmpp:jingle:apps:rtp:1",media:i.media}),a&&e.attrs({ssrc:a});for(let t=0;t<i.fmt.length;t++){const r=o.a.findLine(this.media[n],"a=rtpmap:"+i.fmt[t]);e.c("payload-type",o.a.parseRTPMap(r));const s=o.a.findLine(this.media[n],"a=fmtp:"+i.fmt[t]);if(s){const t=o.a.parseFmtp(s);for(let n=0;n<t.length;n++)e.c("parameter",t[n]).up()}this.rtcpFbToJingle(n,e,i.fmt[t]),e.up()}if(a){const t=o.a.parseSSRC(this.media[n]);for(const[n,i]of t)e.c("source",{ssrc:n,xmlns:"urn:xmpp:jingle:apps:rtp:ssma:0"}),i.forEach(t=>{const n=t.indexOf(" "),i=t.substr(n+1);if(e.c("parameter"),-1===i.indexOf(":"))e.attrs({name:i});else{const t=i.split(":",2)[0];e.attrs({name:t});let n=i.split(":",2)[1];n=o.a.filterSpecialChars(n),e.attrs({value:n})}e.up()}),e.up();o.a.findLines(this.media[n],"a=ssrc-group:").forEach(t=>{const n=t.indexOf(" "),i=t.substr(0,n).substr(13),r=t.substr(14+i.length).split(" ");r.length&&(e.c("ssrc-group",{semantics:i,xmlns:"urn:xmpp:jingle:apps:rtp:ssma:0"}),r.forEach(t=>e.c("source",{ssrc:t}).up()),e.up())})}const t=o.a.findLines(this.media[n],"a=rid:");if(t.length&&s.a.usesRidsForSimulcast()){const i=t.map(e=>e.split(":")[1]).map(e=>e.split(" ")[0]);i.forEach(t=>{e.c("source",{rid:t,xmlns:"urn:xmpp:jingle:apps:rtp:ssma:0"}),e.up()});o.a.findLine(this.media[n],"a=simulcast:")&&(e.c("rid-group",{semantics:"SIM",xmlns:"urn:xmpp:jingle:apps:rtp:ssma:0"}),i.forEach(t=>{e.c("source",{rid:t}).up()}),e.up())}o.a.findLine(this.media[n],"a=rtcp-mux")&&e.c("rtcp-mux").up(),this.rtcpFbToJingle(n,e,"*");const c=o.a.findLines(this.media[n],"a=extmap:");for(let t=0;t<c.length;t++){const n=o.a.parseExtmap(c[t]);if(e.c("rtp-hdrext",{xmlns:"urn:xmpp:jingle:apps:rtp:rtp-hdrext:0",uri:n.uri,id:n.value}),n.hasOwnProperty("direction"))switch(n.direction){case r.a.SENDONLY:e.attrs({senders:"responder"});break;case r.a.RECVONLY:e.attrs({senders:"initiator"});break;case r.a.SENDRECV:e.attrs({senders:"both"});break;case r.a.INACTIVE:e.attrs({senders:"none"})}e.up()}e.up()}this.transportToJingle(n,e);const u=this.media[n];o.a.findLine(u,"a="+r.a.SENDRECV,this.session)?e.attrs({senders:"both"}):o.a.findLine(u,"a="+r.a.SENDONLY,this.session)?e.attrs({senders:"initiator"}):o.a.findLine(u,"a="+r.a.RECVONLY,this.session)?e.attrs({senders:"responder"}):o.a.findLine(u,"a="+r.a.INACTIVE,this.session)&&e.attrs({senders:"none"}),"0"!==i.port||o.a.findLine(u,"a=bundle-only",this.session)||e.attrs({senders:"rejected"}),e.up()}return e.up(),e},a.prototype.transportToJingle=function(e,t){t.c("transport");const n=o.a.findLine(this.media[e],"a=sctpmap:",this.session);if(n){const e=o.a.parseSCTPMap(n);t.c("sctpmap",{xmlns:"urn:xmpp:jingle:transports:dtls-sctp:1",number:e[0],protocol:e[1]}),e.length>2&&t.attrs({streams:e[2]}),t.up()}o.a.findLines(this.media[e],"a=fingerprint:",this.session).forEach(n=>{const i=o.a.parseFingerprint(n);i.xmlns="urn:xmpp:jingle:apps:dtls:0",t.c("fingerprint").t(i.fingerprint),delete i.fingerprint;const r=o.a.findLine(this.media[e],"a=setup:",this.session);r&&(i.setup=r.substr(8)),t.attrs(i),t.up()});const i=o.a.iceparams(this.media[e],this.session);if(i){i.xmlns="urn:xmpp:jingle:transports:ice-udp:1",t.attrs(i);o.a.findLines(this.media[e],"a=candidate:",this.session).forEach(e=>{const n=o.a.candidateToJingle(e);this.failICE&&(n.ip="1.1.1.1");const i=n&&"string"==typeof n.protocol?n.protocol.toLowerCase():"";this.removeTcpCandidates&&("tcp"===i||"ssltcp"===i)||this.removeUdpCandidates&&"udp"===i||t.c("candidate",n).up()})}t.up()},a.prototype.rtcpFbToJingle=function(e,t,n){o.a.findLines(this.media[e],"a=rtcp-fb:"+n).forEach(e=>{const n=o.a.parseRTCPFB(e);"trr-int"===n.type?(t.c("rtcp-fb-trr-int",{xmlns:"urn:xmpp:jingle:apps:rtp:rtcp-fb:0",value:n.params[0]}),t.up()):(t.c("rtcp-fb",{xmlns:"urn:xmpp:jingle:apps:rtp:rtcp-fb:0",type:n.type}),n.params.length>0&&t.attrs({subtype:n.params[0]}),t.up())})},a.prototype.rtcpFbFromJingle=function(e,t){let n="";const i=e.find('>rtcp-fb-trr-int[xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0"]');i.length&&(n+="a=rtcp-fb:* trr-int ",i.attr("value")?n+=i.attr("value"):n+="0",n+="\r\n");return e.find('>rtcp-fb[xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0"]').each((e,i)=>{n+=`a=rtcp-fb:${t} ${i.getAttribute("type")}`,i.hasAttribute("subtype")&&(n+=" "+i.getAttribute("subtype")),n+="\r\n"}),n},a.prototype.fromJingle=function(e){const t=Date.now();this.raw=`v=0\r\no=- ${t} 2 IN IP4 0.0.0.0\r\ns=-\r\nt=0 0\r\n`;const n=$(e).find('>group[xmlns="urn:xmpp:jingle:apps:grouping:0"]');n.length&&n.each((e,t)=>{const n=$(t).find(">content").map((e,t)=>t.getAttribute("name")).get();n.length>0&&(this.raw+=`a=group:${t.getAttribute("semantics")||t.getAttribute("type")} ${n.join(" ")}\r\n`)}),this.session=this.raw,e.find(">content").each((e,t)=>{const n=this.jingle2media($(t));this.media.push(n)}),this.raw=this.session+this.media.join("")},a.prototype.jingle2media=function(e){const t=e.find(">description"),n=e.find('>transport[xmlns="urn:xmpp:jingle:transports:ice-udp:1"]');let i="";const s=n.find('>sctpmap[xmlns="urn:xmpp:jingle:transports:dtls-sctp:1"]'),a={media:t.attr("media"),port:"1"};if("rejected"===e.attr("senders")&&(a.port="0"),n.find('>fingerprint[xmlns="urn:xmpp:jingle:apps:dtls:0"]').length?a.proto=s.length?"DTLS/SCTP":"RTP/SAVPF":a.proto="RTP/AVPF",s.length){i+=`m=application ${a.port} DTLS/SCTP ${s.attr("number")}\r\n`,i+=`a=sctpmap:${s.attr("number")} ${s.attr("protocol")}`;const e=s.attr("streams");i+=e?` ${e}\r\n`:"\r\n"}else a.fmt=t.find(">payload-type").map((e,t)=>t.getAttribute("id")).get(),i+=o.a.buildMLine(a)+"\r\n";switch(i+="c=IN IP4 0.0.0.0\r\n",s.length||(i+="a=rtcp:1 IN IP4 0.0.0.0\r\n"),n.length&&(n.attr("ufrag")&&(i+=o.a.buildICEUfrag(n.attr("ufrag"))+"\r\n"),n.attr("pwd")&&(i+=o.a.buildICEPwd(n.attr("pwd"))+"\r\n"),n.find('>fingerprint[xmlns="urn:xmpp:jingle:apps:dtls:0"]').each((e,t)=>{i+="a=fingerprint:"+t.getAttribute("hash"),i+=" "+$(t).text(),i+="\r\n",t.hasAttribute("setup")&&(i+=`a=setup:${t.getAttribute("setup")}\r\n`)})),n.find(">candidate").each((e,t)=>{let n=t.getAttribute("protocol");n="string"==typeof n?n.toLowerCase():"",this.removeTcpCandidates&&("tcp"===n||"ssltcp"===n)||this.removeUdpCandidates&&"udp"===n||(this.failICE&&t.setAttribute("ip","1.1.1.1"),i+=o.a.candidateFromJingle(t))}),e.attr("senders")){case"initiator":i+=`a=${r.a.SENDONLY}\r\n`;break;case"responder":i+=`a=${r.a.RECVONLY}\r\n`;break;case"none":i+=`a=${r.a.INACTIVE}\r\n`;break;case"both":i+=`a=${r.a.SENDRECV}\r\n`}return i+=`a=mid:${e.attr("name")}\r\n`,t.find(">rtcp-mux").length&&(i+="a=rtcp-mux\r\n"),t.find(">payload-type").each((e,t)=>{i+=o.a.buildRTPMap(t)+"\r\n",$(t).find(">parameter").length&&(i+=`a=fmtp:${t.getAttribute("id")} `,i+=$(t).find(">parameter").map((e,t)=>{const n=t.getAttribute("name");return(n?n+"=":"")+t.getAttribute("value")}).get().join("; "),i+="\r\n"),i+=this.rtcpFbFromJingle($(t),t.getAttribute("id"))}),i+=this.rtcpFbFromJingle(t,"*"),t.find('>rtp-hdrext[xmlns="urn:xmpp:jingle:apps:rtp:rtp-hdrext:0"]').each((e,t)=>{i+=`a=extmap:${t.getAttribute("id")} ${t.getAttribute("uri")}\r\n`}),t.find('>ssrc-group[xmlns="urn:xmpp:jingle:apps:rtp:ssma:0"]').each((e,t)=>{const n=t.getAttribute("semantics"),r=$(t).find(">source").map((e,t)=>t.getAttribute("ssrc")).get();r.length&&(i+=`a=ssrc-group:${n} ${r.join(" ")}\r\n`)}),t.find('>source[xmlns="urn:xmpp:jingle:apps:rtp:ssma:0"]').each((e,t)=>{const n=t.getAttribute("ssrc");$(t).find(">parameter").each((e,t)=>{const r=t.getAttribute("name");let s=t.getAttribute("value");s=o.a.filterSpecialChars(s),i+=`a=ssrc:${n} ${r}`,s&&s.length&&(i+=":"+s),i+="\r\n"})}),i}},function(e,t,n){"use strict";var i,r="object"==typeof Reflect?Reflect:null,s=r&&"function"==typeof r.apply?r.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};i=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function a(){a.init.call(this)}e.exports=a,a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var c=10;function d(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function l(e,t,n,i){var r,s,o,a;if(d(n),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),s=e._events),o=s[t]),void 0===o)o=s[t]=n,++e._eventsCount;else if("function"==typeof o?o=s[t]=i?[n,o]:[o,n]:i?o.unshift(n):o.push(n),(r=u(e))>0&&o.length>r&&!o.warned){o.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=o.length,a=c,console&&console.warn&&console.warn(a)}return e}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},r=h.bind(i);return r.listener=n,i.wrapFn=r,r}function m(e,t,n){var i=e._events;if(void 0===i)return[];var r=i[t];return void 0===r?[]:"function"==typeof r?n?[r.listener||r]:[r]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(r):g(r,r.length)}function f(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function g(e,t){for(var n=new Array(t),i=0;i<t;++i)n[i]=e[i];return n}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");c=e}}),a.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},a.prototype.getMaxListeners=function(){return u(this)},a.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i="error"===e,r=this._events;if(void 0!==r)i=i&&void 0===r.error;else if(!i)return!1;if(i){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var c=r[e];if(void 0===c)return!1;if("function"==typeof c)s(c,this,t);else{var d=c.length,u=g(c,d);for(n=0;n<d;++n)s(u[n],this,t)}return!0},a.prototype.addListener=function(e,t){return l(this,e,t,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(e,t){return l(this,e,t,!0)},a.prototype.once=function(e,t){return d(t),this.on(e,p(this,e,t)),this},a.prototype.prependOnceListener=function(e,t){return d(t),this.prependListener(e,p(this,e,t)),this},a.prototype.removeListener=function(e,t){var n,i,r,s,o;if(d(t),void 0===(i=this._events))return this;if(void 0===(n=i[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(r=-1,s=n.length-1;s>=0;s--)if(n[s]===t||n[s].listener===t){o=n[s].listener,r=s;break}if(r<0)return this;0===r?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,r),1===n.length&&(i[e]=n[0]),void 0!==i.removeListener&&this.emit("removeListener",e,o||t)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(e){var t,n,i;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var r,s=Object.keys(n);for(i=0;i<s.length;++i)"removeListener"!==(r=s[i])&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(i=t.length-1;i>=0;i--)this.removeListener(e,t[i]);return this},a.prototype.listeners=function(e){return m(this,e,!0)},a.prototype.rawListeners=function(e){return m(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},a.prototype.listenerCount=f,a.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]}},function(e,t){e.exports={H264:"h264",OPUS:"opus",VP8:"vp8",VP9:"vp9"}},function(e,t,n){"use strict";var i=n(14);const r={};function s(e,t,n){if("object"==typeof e&&void 0!==e.name)switch(this.gum={error:e,constraints:t,devices:n&&Array.isArray(n)?n.slice(0):void 0},e.name){case"NotAllowedError":case"PermissionDeniedError":case"SecurityError":this.name=i.PERMISSION_DENIED,this.message=r[this.name]+(this.gum.devices||[]).join(", ");break;case"DevicesNotFoundError":case"NotFoundError":this.name=i.NOT_FOUND,this.message=r[this.name]+(this.gum.devices||[]).join(", ");break;case"ConstraintNotSatisfiedError":case"OverconstrainedError":{const s=e.constraintName||e.constraint;t&&t.video&&(!n||n.indexOf("video")>-1)&&("minWidth"===s||"maxWidth"===s||"minHeight"===s||"maxHeight"===s||"width"===s||"height"===s||"deviceId"===s)?(this.name=i.UNSUPPORTED_RESOLUTION,this.message=r[this.name]+function(e,t){if(t&&t.video&&t.video.mandatory)switch(e){case"width":return t.video.mandatory.minWidth;case"height":return t.video.mandatory.minHeight;default:return t.video.mandatory[e]||""}return""}(s,t)):(this.name=i.CONSTRAINT_FAILED,this.message=r[this.name]+e.constraintName);break}default:this.name=i.GENERAL,this.message=e.message||r[this.name]}else{if("string"!=typeof e)throw new Error("Invalid arguments");r[e]?(this.name=e,this.message=t||r[e]):this.message=e}this.stack=e.stack||(new Error).stack}r[i.UNSUPPORTED_RESOLUTION]="Video resolution is not supported: ",r[i.SCREENSHARING_USER_CANCELED]="User canceled screen sharing prompt",r[i.SCREENSHARING_GENERIC_ERROR]="Unknown error from screensharing",r[i.ELECTRON_DESKTOP_PICKER_ERROR]="Unkown error from desktop picker",r[i.ELECTRON_DESKTOP_PICKER_NOT_FOUND]="Failed to detect desktop picker",r[i.GENERAL]="Generic getUserMedia error",r[i.PERMISSION_DENIED]="User denied permission to use device(s): ",r[i.NOT_FOUND]="Requested device(s) was/were not found: ",r[i.CONSTRAINT_FAILED]="Constraint could not be satisfied: ",r[i.TIMEOUT]="Could not start media source. Timeout occured!",r[i.TRACK_IS_DISPOSED]="Track has been already disposed",r[i.TRACK_NO_STREAM_FOUND]="Track does not have an associated Media Stream",s.prototype=Object.create(Error.prototype),s.prototype.constructor=s,t.a=s},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var i=n(19),r=n.n(i);class s{constructor(e=new r.a){this.eventEmitter=e,this.addEventListener=this.on=this.addListener,this.removeEventListener=this.off=this.removeListener}addListener(e,t){return this.eventEmitter.addListener(e,t),()=>this.removeEventListener(e,t)}removeListener(e,t){this.eventEmitter.removeListener(e,t)}}},function(e,t,n){"use strict";n.r(t),n.d(t,"DETECTOR_STATE_CHANGE",(function(){return i})),n.d(t,"AUDIO_INPUT_STATE_CHANGE",(function(){return r})),n.d(t,"NO_AUDIO_INPUT",(function(){return s})),n.d(t,"VAD_NOISY_DEVICE",(function(){return o})),n.d(t,"VAD_REPORT_PUBLISHED",(function(){return a})),n.d(t,"VAD_SCORE_PUBLISHED",(function(){return c})),n.d(t,"VAD_TALK_WHILE_MUTED",(function(){return d}));const i="detector_state_change",r="audio_input_state_changed",s="no_audio_input_detected",o="detection.vad_noise_device",a="vad-report-published",c="detection.vad_score_published",d="detection.vad_talk_while_muted"},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return R})),n.d(t,"d",(function(){return A})),n.d(t,"c",(function(){return I})),n.d(t,"b",(function(){return w})),n.d(t,"e",(function(){return P}));var i=n(5),r=n(2),s=(n(159),n(40)),o=n(27),a=n(0),c=n.n(a),d=n(3),u=n(56),l=n(12),h=n.n(l),p=n(22),m=n(38),f=n.n(m),g=n(77),_=n(41),v=n(103),S=n(109),y=n(116),E=n(117),b=n(118);const C=Object(i.getLogger)(e),T=/<failure.*><not-allowed\/><text>(.*)<\/text><\/failure>/gi;const R=[{urls:"stun:meet-jit-si-turnrelay.jitsi.net:443"}],A="type",I="http://jitsi.org/protocol/jigasi",w="https://jitsi.org/meet/e2ee";class P extends p.a{constructor(e,t){var n;super(),this.connection=null,this.disconnectInProgress=!1,this.connectionTimes={},this.options=e,this.token=t,this.authenticatedUser=!1,Object(b.a)(),Object(y.a)();const i=e.xmppPing||{};i.domain=e.hosts.domain,this.connection=function({enableWebsocketResume:e,serviceUrl:t="/http-bind",shard:n,token:i,websocketKeepAlive:r,websocketKeepAliveUrl:s,xmppPing:o}){return i&&(t+=`${-1===t.indexOf("?")?"?":"&"}token=${i}`),new _.a({enableWebsocketResume:e,serviceUrl:t,websocketKeepAlive:r,websocketKeepAliveUrl:s,xmppPing:o,shard:n})}({enableWebsocketResume:e.enableWebsocketResume,serviceUrl:e.serviceUrl||e.bosh,token:t,websocketKeepAlive:e.websocketKeepAlive,websocketKeepAliveUrl:e.websocketKeepAliveUrl,xmppPing:i,shard:null===(n=e.deploymentInfo)||void 0===n?void 0:n.shard}),this.connection.on(_.a.Events.CONN_SHARD_CHANGED,()=>{const e={shard_changed:!0,suspend_time:this.connection.ping.getPingSuspendTime(),time_since_last_success:this.connection.getTimeSinceLastSuccess()};this.eventEmitter.emit(o.CONNECTION_FAILED,s.OTHER_ERROR,void 0,void 0,e)}),this._initStrophePlugins(),this.caps=new g.a(this.connection,"https://jitsi.org/jitsi-meet"),this.initFeaturesList(),$(window).on("beforeunload unload",e=>{this.disconnect(e).catch(()=>{})})}initFeaturesList(){this.caps.addFeature("urn:xmpp:jingle:1"),this.caps.addFeature("urn:xmpp:jingle:apps:rtp:1"),this.caps.addFeature("urn:xmpp:jingle:transports:ice-udp:1"),this.caps.addFeature("urn:xmpp:jingle:apps:dtls:0"),this.caps.addFeature("urn:xmpp:jingle:transports:dtls-sctp:1"),this.caps.addFeature("urn:xmpp:jingle:apps:rtp:audio"),this.caps.addFeature("urn:xmpp:jingle:apps:rtp:video"),this.caps.addFeature("http://jitsi.org/json-encoded-sources"),this.options.disableRtx||d.a.isFirefox()&&d.a.isVersionLessThan(84)||this.caps.addFeature("urn:ietf:rfc:4588"),!0===this.options.enableOpusRed&&d.a.supportsAudioRed()&&this.caps.addFeature("http://jitsi.org/opus-red"),(void 0===this.options.enableRemb||this.options.enableRemb)&&this.caps.addFeature("http://jitsi.org/remb"),d.a.isFirefox()||void 0!==this.options.enableTcc&&!this.options.enableTcc||this.caps.addFeature("http://jitsi.org/tcc"),this.caps.addFeature("urn:ietf:rfc:5761"),this.caps.addFeature("urn:ietf:rfc:5888"),d.a.isChromiumBased()&&!0===this.options.enableLipSync&&(C.info("Lip-sync enabled !"),this.caps.addFeature("http://jitsi.org/meet/lipsync")),this.connection.rayo&&this.caps.addFeature("urn:xmpp:rayo:client:1"),u.a.isSupported(this.options)&&this.caps.addFeature(w,!1,!0)}getConnection(){return this.connection}connectionHandler(e={},t,n){const i=window.performance.now(),a=r.Strophe.getStatusString(t).toLowerCase();if(this.connectionTimes[a]=i,C.log(`(TIME) Strophe ${a}${n?`[${n}]`:""}:\t`,i),this.eventEmitter.emit(c.a.CONNECTION_STATUS_CHANGED,e,t,n),t===r.Strophe.Status.CONNECTED||t===r.Strophe.Status.ATTACHED)this._sysMessageHandler&&(this.connection._stropheConn.deleteHandler(this._sysMessageHandler),this._sysMessageHandler=null),this.sendDiscoInfo&&this.connection.jingle.getStunAndTurnCredentials(),C.info("My Jabber ID: "+this.connection.jid),this._resetState(),this.sendDiscoInfo&&this.caps.getFeaturesAndIdentities(this.options.hosts.domain).then(({features:e,identities:t})=>{e.has(r.Strophe.NS.PING)||C.error(`Ping NOT supported by ${this.options.hosts.domain} - please enable ping in your XMPP server config`),this._processDiscoInfoIdentities(t,void 0)}).catch(e=>{const t="Feature discovery error";h.a.callErrorHandler(new Error(`${t}: ${e}`)),C.error(t,e)}),this.sendDiscoInfo=!1,e.password&&(this.authenticatedUser=!0),this.connection&&this.connection.connected&&r.Strophe.getResourceFromJid(this.connection.jid)&&this.eventEmitter.emit(o.CONNECTION_ESTABLISHED,r.Strophe.getResourceFromJid(this.connection.jid));else if(t===r.Strophe.Status.CONNFAIL)"x-strophe-bad-non-anon-jid"===n?this.anonymousConnectionFailed=!0:this.connectionFailed=!0,this.lastErrorMsg=n,"giving-up"===n&&this.eventEmitter.emit(o.CONNECTION_FAILED,s.OTHER_ERROR,n);else if(t===r.Strophe.Status.ERROR)this.lastErrorMsg=n;else if(t===r.Strophe.Status.DISCONNECTED){this.connection.ping.stopInterval();const e=Boolean(this.disconnectInProgress),t=n||this.lastErrorMsg;if(this.anonymousConnectionFailed)this.eventEmitter.emit(o.CONNECTION_FAILED,s.PASSWORD_REQUIRED);else if(this.connectionFailed)this.eventEmitter.emit(o.CONNECTION_FAILED,s.OTHER_ERROR,t,void 0,this._getConnectionFailedReasonDetails());else if(e)this.eventEmitter.emit(o.CONNECTION_DISCONNECTED,t);else{C.error("XMPP connection dropped!");const e=r.Strophe.getLastErrorStatus();e>=500&&e<600?this.eventEmitter.emit(o.CONNECTION_FAILED,s.SERVER_ERROR,t||"server-error",void 0,this._getConnectionFailedReasonDetails()):this.eventEmitter.emit(o.CONNECTION_FAILED,s.CONNECTION_DROPPED_ERROR,t||"connection-dropped-error",void 0,this._getConnectionFailedReasonDetails())}}else if(t===r.Strophe.Status.AUTHFAIL){const t=this.getConnection().getLastFailedMessage();this.eventEmitter.emit(o.CONNECTION_FAILED,s.PASSWORD_REQUIRED,n||this._parseConnectionFailedMessage(t),e)}}_processDiscoInfoIdentities(e,t){e.forEach(e=>{if("av_moderation"===e.type&&(this.avModerationComponentAddress=e.name),"speakerstats"===e.type&&(this.speakerStatsComponentAddress=e.name),"conference_duration"===e.type&&(this.conferenceDurationComponentAddress=e.name),"lobbyrooms"===e.type){this.lobbySupported=!0;const n=e=>{e.forEach(e=>{e.endsWith("#displayname_required")&&this.eventEmitter.emit(o.DISPLAY_NAME_REQUIRED)})};t?n(t):e.name&&this.caps.getFeaturesAndIdentities(e.name,e.type).then(({features:e})=>n(e)).catch(e=>C.warn("Error getting features from lobby.",e&&e.message))}}),(this.avModerationComponentAddress||this.speakerStatsComponentAddress||this.conferenceDurationComponentAddress)&&this.connection.addHandler(this._onPrivateMessage.bind(this),null,"message",null,null)}_parseConnectionFailedMessage(e){if(!e)return null;const t=T.exec(e);return t?t[1]:null}_connect(e,t){this._resetState(),this.sendDiscoInfo=!0,this.connection._stropheConn&&this.connection._stropheConn._addSysHandler?this._sysMessageHandler=this.connection._stropheConn._addSysHandler(this._onSystemMessage.bind(this),null,"message"):C.warn("Cannot attach strophe system handler, jiconop cannot operate"),this.connection.connect(e,t,this.connectionHandler.bind(this,{jid:e,password:t}))}_onSystemMessage(e){if(0===$(e).find(">services").length&&0===$(e).find(">query").length)return;this.sendDiscoInfo=!1;const t=this.connection.jingle.onReceiveStunAndTurnCredentials(e),{features:n,identities:i}=Object(g.b)(e);this._processDiscoInfoIdentities(i,n),i.forEach(e=>{"shard"===e.type&&(this.options.deploymentInfo.shard=this.connection.shard=e.name)}),(t||i.size>0||n.size>0)&&(this.connection._stropheConn.deleteHandler(this._sysMessageHandler),this._sysMessageHandler=null)}attach(e){this._resetState(),this.sendDiscoInfo=!0;const t=this.connectionTimes.attaching=window.performance.now();C.log("(TIME) Strophe Attaching:\t",t),this.connection.attach(e.jid,e.sid,parseInt(e.rid,10)+1,this.connectionHandler.bind(this,{jid:e.jid,password:e.password}))}_resetState(){this.anonymousConnectionFailed=!1,this.connectionFailed=!1,this.lastErrorMsg=void 0,this.disconnectInProgress=void 0}connect(e,t){if(!e){const{anonymousdomain:t,domain:n}=this.options.hosts;let i=t||n;const{location:r}=window;if(t){const e=r&&r.search;(e&&-1!==e.indexOf("login=true")||this.token)&&(i=n)}e=i||r&&r.hostname}return this._connect(e,t)}createRoom(e,t,n){let i=`${e}@${t.customDomain?t.customDomain:this.options.hosts.muc.toLowerCase()}/`;const r=n?n(this.connection.jid,this.authenticatedUser):f.a.randomHexString(8).toLowerCase();return C.info(`JID ${this.connection.jid} using MUC nickname ${r}`),i+=r,this.connection.emuc.createRoom(i,null,t)}getJid(){return this.connection.jid}getJingleLog(){const e=this.connection.jingle;return e?e.getLog():{}}getXmppLog(){return(this.connection.logger||{}).log||null}dial(...e){this.connection.rayo.dial(...e)}ping(e){return new Promise((t,n)=>{this.connection.ping.ping(this.connection.pingDomain,t,n,e)})}getSessions(){return this.connection.jingle.sessions}disconnect(e){return this.disconnectInProgress?this.disconnectInProgress:this.connection?(this.disconnectInProgress=new Promise(e=>{const t=(n,i)=>{i===r.Strophe.Status.DISCONNECTED&&(e(),this.eventEmitter.removeListener(c.a.CONNECTION_STATUS_CHANGED,t))};this.eventEmitter.on(c.a.CONNECTION_STATUS_CHANGED,t)}),this._cleanupXmppConnection(e),this.disconnectInProgress):Promise.resolve()}_cleanupXmppConnection(e){if(!this.connection.isUsingWebSocket&&this.connection.flush(),!this.connection.isUsingWebSocket&&null!=e){const t=e.type;if(("beforeunload"===t||"unload"===t)&&(this.connection.options.sync=!0,this.connection.sendUnavailableBeacon()))return}this.connection.disconnect(),!0!==this.connection.options.sync&&this.connection.flush()}_initStrophePlugins(){const e={jvb:{iceServers:[]},p2p:{iceServers:[]}},t=this.options.p2p&&this.options.p2p.stunServers||R;Array.isArray(t)&&(C.info("P2P STUN servers: ",t),e.p2p.iceServers=t),this.options.p2p&&this.options.p2p.iceTransportPolicy&&(C.info("P2P ICE transport policy: ",this.options.p2p.iceTransportPolicy),e.p2p.iceTransportPolicy=this.options.p2p.iceTransportPolicy),this.connection.addConnectionPlugin("emuc",new v.a(this)),this.connection.addConnectionPlugin("jingle",new S.a(this,this.eventEmitter,e)),this.connection.addConnectionPlugin("rayo",new E.a)}_getConnectionFailedReasonDetails(){const e={};if(this.options.deploymentInfo&&this.options.deploymentInfo.shard&&this.connection.lastResponseHeaders){const t=this.connection.lastResponseHeaders.trim().split(/[\r\n]+/),n={};t.forEach(e=>{const t=e.split(": "),i=t.shift(),r=t.join(": ");n[i]=r}),e.shard_changed=this.options.deploymentInfo.shard!==n["x-jitsi-shard"]}return e.suspend_time=this.connection.ping.getPingSuspendTime(),e.time_since_last_success=this.connection.getTimeSinceLastSuccess(),e}sendDominantSpeakerEvent(e){if(!this.speakerStatsComponentAddress||!e)return;const t=Object(r.$msg)({to:this.speakerStatsComponentAddress});t.c("speakerstats",{xmlns:"http://jitsi.org/jitmeet",room:e}).up(),this.connection.send(t)}tryParseJSONAndVerify(e){if(!e)return!1;try{const t=JSON.parse(e);if(t&&"object"==typeof t){const e=t[A];if(void 0!==e)return t;C.debug("parsing valid json but does not have correct structure","topic: ",e)}}catch(t){return C.error("Error parsing json "+e,t),!1}return!1}_onPrivateMessage(e){const t=e.getAttribute("from");if(t!==this.speakerStatsComponentAddress&&t!==this.conferenceDurationComponentAddress&&t!==this.avModerationComponentAddress)return!0;const n=$(e).find(">json-message").text(),i=this.tryParseJSONAndVerify(n);return!i||("speakerstats"===i[A]&&i.users?this.eventEmitter.emit(c.a.SPEAKER_STATS_RECEIVED,i.users):"conference_duration"===i[A]&&i.created_timestamp?this.eventEmitter.emit(c.a.CONFERENCE_TIMESTAMP_RECEIVED,i.created_timestamp):"av_moderation"===i[A]&&this.eventEmitter.emit(c.a.AV_MODERATION_RECEIVED,i),!0)}}}).call(this,"modules/xmpp/xmpp.js")},function(e,t,n){var i=n(165),r=n(166);t.write=r,t.parse=i.parse,t.parseFmtpConfig=i.parseFmtpConfig,t.parseParams=i.parseParams,t.parsePayloads=i.parsePayloads,t.parseRemoteCandidates=i.parseRemoteCandidates,t.parseImageAttributes=i.parseImageAttributes,t.parseSimulcastStreamList=i.parseSimulcastStreamList},function(e,t,n){"use strict";n.r(t),n.d(t,"STATUS_AVAILABLE",(function(){return i})),n.d(t,"STATUS_UNDEFINED",(function(){return r})),n.d(t,"STATUS_BUSY",(function(){return s})),n.d(t,"STATE_ON",(function(){return o})),n.d(t,"STATE_OFF",(function(){return a})),n.d(t,"STATE_PENDING",(function(){return c})),n.d(t,"STATE_RETRYING",(function(){return d})),n.d(t,"STATE_FAILED",(function(){return u})),n.d(t,"ERROR_NO_CONNECTION",(function(){return l})),n.d(t,"ERROR_SESSION_EXISTS",(function(){return h}));const i="available",r="undefined",s="busy",o="on",a="off",c="pending",d="retrying",u="failed",l="error_no_connection",h="error_session_already_exists"},function(e,t,n){"use strict";n.r(t),n.d(t,"CONNECTION_DISCONNECTED",(function(){return i})),n.d(t,"CONNECTION_ESTABLISHED",(function(){return r})),n.d(t,"CONNECTION_FAILED",(function(){return s})),n.d(t,"WRONG_STATE",(function(){return o})),n.d(t,"DISPLAY_NAME_REQUIRED",(function(){return a}));const i="connection.connectionDisconnected",r="connection.connectionEstablished",s="connection.connectionFailed",o="connection.wrongState",a="connection.display_name_required"},function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return r})),n.d(t,"c",(function(){return s})),n.d(t,"d",(function(){return o})),n.d(t,"e",(function(){return a}));const i="statistics.audioLevel",r="statistics.before_disposed",s="statistics.byte_sent_stats",o="statistics.connectionstats",a="statistics.long_tasks_stats"},function(e,t,n){"use strict";(function(e){var i=n(58),r=n(5),s=n(108),o=n.n(s);const a=Object(r.getLogger)(e);let c,d;function u(){return(Math.random().toString(16)+"000000000").substr(2,8)}t.a={_storage:i.b,init(e){this._storage=e||i.b},get callStatsUserName(){return c||(c=this._storage.getItem("callStatsUserName"),c||(c=function(){const e=o.a.generateUsername();return a.log("generated callstats uid",e),e}(),this._storage.setItem("callStatsUserName",c))),c},get machineId(){if(!d){const e=this._storage.getItem("billingId");d=e||this._storage.getItem("jitsiMeetId"),e?this._storage.setItem("jitsiMeetId",e):d||(d=function(){const e=u()+u()+u()+u();return a.log("generated id",e),e}(),this._storage.setItem("jitsiMeetId",d))}return d},get sessionId(){return this._storage.getItem("sessionId")},set sessionId(e){e?this._storage.setItem("sessionId",e):this._storage.removeItem("sessionId")}}}).call(this,"modules/settings/Settings.js")},function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"c",(function(){return s})),n.d(t,"a",(function(){return c}));var i=n(25);function r(e){return parseInt(e.ssrcs.split(" ")[0],10)}function s(e){return parseInt(e.ssrcs.split(" ")[1],10)}function o(e){return e.ssrcs?e.ssrcs.map(e=>e.id).filter((e,t,n)=>n.indexOf(e)===t).length:0}class a{constructor(e){if(!e)throw new Error("mLine is undefined");this.mLine=e}get ssrcs(){return this.mLine.ssrcs||(this.mLine.ssrcs=[]),this.mLine.ssrcs}set ssrcs(e){this.mLine.ssrcs=e}get direction(){return this.mLine.direction}set direction(e){this.mLine.direction=e}get ssrcGroups(){return this.mLine.ssrcGroups||(this.mLine.ssrcGroups=[]),this.mLine.ssrcGroups}set ssrcGroups(e){this.mLine.ssrcGroups=e}getSSRCAttrValue(e,t){const n=this.ssrcs.find(n=>n.id===e&&n.attribute===t);return n&&n.value}removeSSRC(e){this.mLine.ssrcs&&this.mLine.ssrcs.length&&(this.mLine.ssrcs=this.mLine.ssrcs.filter(t=>t.id!==e))}addSSRCAttribute(e){this.ssrcs.push(e)}findGroup(e,t){return this.ssrcGroups.find(n=>n.semantics===e&&(!t||t===n.ssrcs))}findGroups(e){return this.ssrcGroups.filter(t=>t.semantics===e)}findGroupByPrimarySSRC(e,t){return this.ssrcGroups.find(n=>n.semantics===e&&r(n)===t)}findSSRCByMSID(e){return this.ssrcs.find(t=>"msid"===t.attribute&&(null===e||t.value===e))}getSSRCCount(){return o(this.mLine)}containsAnySSRCGroups(){return void 0!==this.mLine.ssrcGroups}getPrimaryVideoSsrc(){const e=this.mLine.type;if("video"!==e)throw new Error(`getPrimarySsrc doesn't work with '${e}'`);if(1===o(this.mLine))return this.mLine.ssrcs[0].id;if(this.mLine.ssrcGroups){const e=this.findGroup("SIM");if(e)return r(e);const t=this.findGroup("FID");if(t)return r(t);const n=this.findGroup("FEC-FR");if(n)return r(n)}}getRtxSSRC(e){const t=this.findGroupByPrimarySSRC("FID",e);return t&&s(t)}getSSRCs(){return this.ssrcs.map(e=>e.id).filter((e,t,n)=>n.indexOf(e)===t)}getPrimaryVideoSSRCs(){const e=this.mLine.type;if("video"!==e)throw new Error("getPrimaryVideoSSRCs doesn't work with "+e);const t=this.getSSRCs();for(const e of this.ssrcGroups)if("FID"===e.semantics||"FEC-FR"===e.semantics){const n=s(e);t.splice(t.indexOf(n),1)}return t}dumpSSRCGroups(){return JSON.stringify(this.mLine.ssrcGroups)}removeGroupsWithSSRC(e){this.mLine.ssrcGroups&&(this.mLine.ssrcGroups=this.mLine.ssrcGroups.filter(t=>-1===t.ssrcs.indexOf(""+e)))}removeGroupsBySemantics(e){this.mLine.ssrcGroups&&(this.mLine.ssrcGroups=this.mLine.ssrcGroups.filter(t=>t.semantics!==e))}replaceSSRC(e,t){this.mLine.ssrcs&&this.mLine.ssrcs.forEach(n=>{n.id===e&&(n.id=t)})}addSSRCGroup(e){this.ssrcGroups.push(e)}}class c{constructor(e){this.parsedSDP=i.parse(e)}selectMedia(e){const t=this.parsedSDP.media.find(t=>t.type===e);return t?new a(t):null}toRawSDP(){return i.write(this.parsedSDP)}}},function(e,t,n){"use strict";function i(e){let t=e;return e>=Number.MAX_SAFE_INTEGER&&(t=0),t+1}function r(e){return e.length>0?e.reduce((e,t)=>e+t)/e.length:0}function s(e){return e.filter(e=>e>=0)}n.d(t,"d",(function(){return i})),n.d(t,"b",(function(){return r})),n.d(t,"c",(function(){return s})),n.d(t,"a",(function(){return o}));class o{constructor(){this.average=0,this.n=0}addNext(e){"number"==typeof e&&(this.n+=1,this.average=this.average+(e-this.average)/this.n)}getAverage(){return this.average}}},function(e,t,n){"use strict";n.r(t),n.d(t,"LOCAL_STATS_UPDATED",(function(){return i})),n.d(t,"REMOTE_STATS_UPDATED",(function(){return r}));const i="cq.local_stats_updated",r="cq.remote_stats_updated"},function(e,t,n){(function(e,n){var i="[object Arguments]",r="[object Map]",s="[object Object]",o="[object Set]",a=/^\[object .+?Constructor\]$/,c=/^(?:0|[1-9]\d*)$/,d={};d["[object Float32Array]"]=d["[object Float64Array]"]=d["[object Int8Array]"]=d["[object Int16Array]"]=d["[object Int32Array]"]=d["[object Uint8Array]"]=d["[object Uint8ClampedArray]"]=d["[object Uint16Array]"]=d["[object Uint32Array]"]=!0,d[i]=d["[object Array]"]=d["[object ArrayBuffer]"]=d["[object Boolean]"]=d["[object DataView]"]=d["[object Date]"]=d["[object Error]"]=d["[object Function]"]=d[r]=d["[object Number]"]=d[s]=d["[object RegExp]"]=d[o]=d["[object String]"]=d["[object WeakMap]"]=!1;var u="object"==typeof e&&e&&e.Object===Object&&e,l="object"==typeof self&&self&&self.Object===Object&&self,h=u||l||Function("return this")(),p=t&&!t.nodeType&&t,m=p&&"object"==typeof n&&n&&!n.nodeType&&n,f=m&&m.exports===p,g=f&&u.process,_=function(){try{return g&&g.binding&&g.binding("util")}catch(e){}}(),v=_&&_.isTypedArray;function S(e,t){for(var n=-1,i=null==e?0:e.length;++n<i;)if(t(e[n],n,e))return!0;return!1}function y(e){var t=-1,n=Array(e.size);return e.forEach((function(e,i){n[++t]=[i,e]})),n}function E(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var b,C,T,R=Array.prototype,A=Function.prototype,I=Object.prototype,w=h["__core-js_shared__"],P=A.toString,O=I.hasOwnProperty,D=(b=/[^.]+$/.exec(w&&w.keys&&w.keys.IE_PROTO||""))?"Symbol(src)_1."+b:"",N=I.toString,M=RegExp("^"+P.call(O).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),L=f?h.Buffer:void 0,k=h.Symbol,x=h.Uint8Array,F=I.propertyIsEnumerable,j=R.splice,U=k?k.toStringTag:void 0,H=Object.getOwnPropertySymbols,V=L?L.isBuffer:void 0,B=(C=Object.keys,T=Object,function(e){return C(T(e))}),J=_e(h,"DataView"),G=_e(h,"Map"),$=_e(h,"Promise"),K=_e(h,"Set"),q=_e(h,"WeakMap"),W=_e(Object,"create"),z=Ee(J),Q=Ee(G),Y=Ee($),X=Ee(K),Z=Ee(q),ee=k?k.prototype:void 0,te=ee?ee.valueOf:void 0;function ne(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function ie(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function re(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function se(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new re;++t<n;)this.add(e[t])}function oe(e){var t=this.__data__=new ie(e);this.size=t.size}function ae(e,t){var n=Te(e),i=!n&&Ce(e),r=!n&&!i&&Re(e),s=!n&&!i&&!r&&Oe(e),o=n||i||r||s,a=o?function(e,t){for(var n=-1,i=Array(e);++n<e;)i[n]=t(n);return i}(e.length,String):[],c=a.length;for(var d in e)!t&&!O.call(e,d)||o&&("length"==d||r&&("offset"==d||"parent"==d)||s&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||ye(d,c))||a.push(d);return a}function ce(e,t){for(var n=e.length;n--;)if(be(e[n][0],t))return n;return-1}function de(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":U&&U in Object(e)?function(e){var t=O.call(e,U),n=e[U];try{e[U]=void 0;var i=!0}catch(e){}var r=N.call(e);i&&(t?e[U]=n:delete e[U]);return r}(e):function(e){return N.call(e)}(e)}function ue(e){return Pe(e)&&de(e)==i}function le(e,t,n,a,c){return e===t||(null==e||null==t||!Pe(e)&&!Pe(t)?e!=e&&t!=t:function(e,t,n,a,c,d){var u=Te(e),l=Te(t),h=u?"[object Array]":Se(e),p=l?"[object Array]":Se(t),m=(h=h==i?s:h)==s,f=(p=p==i?s:p)==s,g=h==p;if(g&&Re(e)){if(!Re(t))return!1;u=!0,m=!1}if(g&&!m)return d||(d=new oe),u||Oe(e)?me(e,t,n,a,c,d):function(e,t,n,i,s,a,c){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!a(new x(e),new x(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return be(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case r:var d=y;case o:var u=1&i;if(d||(d=E),e.size!=t.size&&!u)return!1;var l=c.get(e);if(l)return l==t;i|=2,c.set(e,t);var h=me(d(e),d(t),i,s,a,c);return c.delete(e),h;case"[object Symbol]":if(te)return te.call(e)==te.call(t)}return!1}(e,t,h,n,a,c,d);if(!(1&n)){var _=m&&O.call(e,"__wrapped__"),v=f&&O.call(t,"__wrapped__");if(_||v){var S=_?e.value():e,b=v?t.value():t;return d||(d=new oe),c(S,b,n,a,d)}}if(!g)return!1;return d||(d=new oe),function(e,t,n,i,r,s){var o=1&n,a=fe(e),c=a.length,d=fe(t).length;if(c!=d&&!o)return!1;var u=c;for(;u--;){var l=a[u];if(!(o?l in t:O.call(t,l)))return!1}var h=s.get(e);if(h&&s.get(t))return h==t;var p=!0;s.set(e,t),s.set(t,e);var m=o;for(;++u<c;){l=a[u];var f=e[l],g=t[l];if(i)var _=o?i(g,f,l,t,e,s):i(f,g,l,e,t,s);if(!(void 0===_?f===g||r(f,g,n,i,s):_)){p=!1;break}m||(m="constructor"==l)}if(p&&!m){var v=e.constructor,S=t.constructor;v==S||!("constructor"in e)||!("constructor"in t)||"function"==typeof v&&v instanceof v&&"function"==typeof S&&S instanceof S||(p=!1)}return s.delete(e),s.delete(t),p}(e,t,n,a,c,d)}(e,t,n,a,le,c))}function he(e){return!(!we(e)||function(e){return!!D&&D in e}(e))&&(Ae(e)?M:a).test(Ee(e))}function pe(e){if(n=(t=e)&&t.constructor,i="function"==typeof n&&n.prototype||I,t!==i)return B(e);var t,n,i,r=[];for(var s in Object(e))O.call(e,s)&&"constructor"!=s&&r.push(s);return r}function me(e,t,n,i,r,s){var o=1&n,a=e.length,c=t.length;if(a!=c&&!(o&&c>a))return!1;var d=s.get(e);if(d&&s.get(t))return d==t;var u=-1,l=!0,h=2&n?new se:void 0;for(s.set(e,t),s.set(t,e);++u<a;){var p=e[u],m=t[u];if(i)var f=o?i(m,p,u,t,e,s):i(p,m,u,e,t,s);if(void 0!==f){if(f)continue;l=!1;break}if(h){if(!S(t,(function(e,t){if(o=t,!h.has(o)&&(p===e||r(p,e,n,i,s)))return h.push(t);var o}))){l=!1;break}}else if(p!==m&&!r(p,m,n,i,s)){l=!1;break}}return s.delete(e),s.delete(t),l}function fe(e){return function(e,t,n){var i=t(e);return Te(e)?i:function(e,t){for(var n=-1,i=t.length,r=e.length;++n<i;)e[r+n]=t[n];return e}(i,n(e))}(e,De,ve)}function ge(e,t){var n,i,r=e.__data__;return("string"==(i=typeof(n=t))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==n:null===n)?r["string"==typeof t?"string":"hash"]:r.map}function _e(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return he(n)?n:void 0}ne.prototype.clear=function(){this.__data__=W?W(null):{},this.size=0},ne.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ne.prototype.get=function(e){var t=this.__data__;if(W){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return O.call(t,e)?t[e]:void 0},ne.prototype.has=function(e){var t=this.__data__;return W?void 0!==t[e]:O.call(t,e)},ne.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=W&&void 0===t?"__lodash_hash_undefined__":t,this},ie.prototype.clear=function(){this.__data__=[],this.size=0},ie.prototype.delete=function(e){var t=this.__data__,n=ce(t,e);return!(n<0)&&(n==t.length-1?t.pop():j.call(t,n,1),--this.size,!0)},ie.prototype.get=function(e){var t=this.__data__,n=ce(t,e);return n<0?void 0:t[n][1]},ie.prototype.has=function(e){return ce(this.__data__,e)>-1},ie.prototype.set=function(e,t){var n=this.__data__,i=ce(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this},re.prototype.clear=function(){this.size=0,this.__data__={hash:new ne,map:new(G||ie),string:new ne}},re.prototype.delete=function(e){var t=ge(this,e).delete(e);return this.size-=t?1:0,t},re.prototype.get=function(e){return ge(this,e).get(e)},re.prototype.has=function(e){return ge(this,e).has(e)},re.prototype.set=function(e,t){var n=ge(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this},se.prototype.add=se.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},se.prototype.has=function(e){return this.__data__.has(e)},oe.prototype.clear=function(){this.__data__=new ie,this.size=0},oe.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},oe.prototype.get=function(e){return this.__data__.get(e)},oe.prototype.has=function(e){return this.__data__.has(e)},oe.prototype.set=function(e,t){var n=this.__data__;if(n instanceof ie){var i=n.__data__;if(!G||i.length<199)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new re(i)}return n.set(e,t),this.size=n.size,this};var ve=H?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,i=null==e?0:e.length,r=0,s=[];++n<i;){var o=e[n];t(o,n,e)&&(s[r++]=o)}return s}(H(e),(function(t){return F.call(e,t)})))}:function(){return[]},Se=de;function ye(e,t){return!!(t=null==t?9007199254740991:t)&&("number"==typeof e||c.test(e))&&e>-1&&e%1==0&&e<t}function Ee(e){if(null!=e){try{return P.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function be(e,t){return e===t||e!=e&&t!=t}(J&&"[object DataView]"!=Se(new J(new ArrayBuffer(1)))||G&&Se(new G)!=r||$&&"[object Promise]"!=Se($.resolve())||K&&Se(new K)!=o||q&&"[object WeakMap]"!=Se(new q))&&(Se=function(e){var t=de(e),n=t==s?e.constructor:void 0,i=n?Ee(n):"";if(i)switch(i){case z:return"[object DataView]";case Q:return r;case Y:return"[object Promise]";case X:return o;case Z:return"[object WeakMap]"}return t});var Ce=ue(function(){return arguments}())?ue:function(e){return Pe(e)&&O.call(e,"callee")&&!F.call(e,"callee")},Te=Array.isArray;var Re=V||function(){return!1};function Ae(e){if(!we(e))return!1;var t=de(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Ie(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function we(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Pe(e){return null!=e&&"object"==typeof e}var Oe=v?function(e){return function(t){return e(t)}}(v):function(e){return Pe(e)&&Ie(e.length)&&!!d[de(e)]};function De(e){return null!=(t=e)&&Ie(t.length)&&!Ae(t)?ae(e):pe(e);var t}n.exports=function(e,t){return le(e,t)}}).call(this,n(45),n(83)(e))},function(e,t,n){"use strict";n.d(t,"c",(function(){return i})),n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return s}));const i="pending",r="active",s="ended"},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));const i={ACCEPT:"session-accept",CONNECTION_ERROR:"connection-error-encountered",INITIATE:"session-initiate",TERMINATE:"session-terminate",TRANSPORT_INFO:"transport-info",UNAVAILABLE:"unavailable"}},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return a}));var i=n(21),r=n(14),s=n(3);const o=n(5).getLogger(e),a=5,c={obtainStream:null,init(e={}){this.options=e,this.obtainStream=this._createObtainStreamMethod(),this.obtainStream||o.info("Desktop sharing disabled")},_createObtainStreamMethod(){return s.a.isNWJS()?(e,t)=>{window.JitsiMeetNW.obtainDesktopStream(e,(e,n)=>{let s;s=e&&"InvalidStateError"===e.name?new i.a(r.SCREENSHARING_USER_CANCELED):new i.a(e,n,["desktop"]),"function"==typeof t&&t(s)})}:s.a.isElectron()?this.obtainScreenOnElectron:s.a.isReactNative()&&s.a.supportsGetDisplayMedia()?this.obtainScreenFromGetDisplayMediaRN:s.a.supportsGetDisplayMedia()?this.obtainScreenFromGetDisplayMedia:(o.log("Screen sharing not supported on ",s.a.getName()),null)},_getAudioConstraints(){const{audioQuality:e}=this.options;return!(null==e?void 0:e.stereo)||{autoGainControl:!1,channelCount:2,echoCancellation:!1,noiseSuppression:!1}},isSupported(){return null!==this.obtainStream},obtainScreenOnElectron(e,t){if(window.JitsiMeetScreenObtainer&&window.JitsiMeetScreenObtainer.openDesktopPicker){const{desktopSharingFrameRate:n,desktopSharingSources:s}=this.options;window.JitsiMeetScreenObtainer.openDesktopPicker({desktopSharingSources:s||["screen","window"]},(s,o,c=!1)=>{if(s){var d,u;let i=!1;if(c){i={};const e=this._getAudioConstraints();"boolean"!=typeof e&&(i={optional:e}),"screen"===o&&(i.mandatory={chromeMediaSource:"desktop"})}const r={audio:i,video:{mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:s,minFrameRate:null!==(d=null==n?void 0:n.min)&&void 0!==d?d:a,maxFrameRate:null!==(u=null==n?void 0:n.max)&&void 0!==u?u:a,maxWidth:window.screen.width,maxHeight:window.screen.height}}};navigator.mediaDevices.getUserMedia(r).then(t=>e({stream:t,sourceId:s,sourceType:o}),t)}else t(new i.a(r.SCREENSHARING_USER_CANCELED))},e=>t(new i.a(r.ELECTRON_DESKTOP_PICKER_ERROR,e)))}else t(new i.a(r.ELECTRON_DESKTOP_PICKER_NOT_FOUND))},obtainScreenFromGetDisplayMedia(e,t){let n;n=navigator.getDisplayMedia?navigator.getDisplayMedia.bind(navigator):navigator.mediaDevices.getDisplayMedia.bind(navigator.mediaDevices);const{desktopSharingFrameRate:s}=this.options,a="object"!=typeof s||{frameRate:s},c=this._getAudioConstraints();a.frameRate&&delete a.frameRate.min;const d={video:a,audio:c,cursor:"always"};o.info("Using getDisplayMedia for screen sharing",d),n(d).then(t=>{e({stream:t,sourceId:t.id})}).catch(e=>{const n={errorName:e&&e.name,errorMsg:e&&e.message,errorStack:e&&e.stack};o.error("getDisplayMedia error",d,n),n.errorMsg&&-1!==n.errorMsg.indexOf("denied by system")?t(new i.a(r.PERMISSION_DENIED)):t(new i.a(r.SCREENSHARING_USER_CANCELED))})},obtainScreenFromGetDisplayMediaRN(e,t){o.info("Using getDisplayMedia for screen sharing"),navigator.mediaDevices.getDisplayMedia({video:!0}).then(t=>{e({stream:t,sourceId:t.id})}).catch(()=>{t(new i.a(r.SCREENSHARING_USER_CANCELED))})},setDesktopSharingFrameRate(e){o.info("Setting the desktop capture rate to "+e),this.options.desktopSharingFrameRate={min:a,max:e}}};t.b=c}).call(this,"modules/RTC/ScreenObtainer.js")},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return O}));var i=n(3),r=n(12),s=n.n(r);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const a=n(5).getLogger(e),c="createOffer",d="createAnswer",u="setLocalDescription",l="setRemoteDescription",h="addIceCandidate",p="getUserMedia",m="iceConnectionFailure",f="applicationLog",g="fabricHold",_="fabricResume",v="audioMute",S="audioUnmute",y="videoPause",E="videoResume",b="screenShareStart",C="screenShareStop",T="dominantSpeaker",R="activeDeviceList",A="error",I="event",w="mstWithUserID";let P;class O{static _addNewFabricCallback(e,t){O.backend&&"success"!==e&&a.error(`Monitoring status: ${e} msg: ${t}`)}static _initCallback(e,t){if(a.log(`CallStats Status: err=${e} msg=${t}`),"success"!==e)return;O.backendInitialized=!0;let n=!1,i=null;for(const e of O.fabrics.values())e.hasFabric||(a.debug("addNewFabric - initCallback"),e._addNewFabric()&&(n=!0,i||(i=e)));n&&O._emptyReportQueue(i)}static _emptyReportQueue(e){const t=e.confID,n=e.peerconnection;for(const i of O.reportsQueue)if(i.type===A){const t=i.data;O._reportError(e,t.type,t.error,t.pc||n)}else if(i.type===I){const e=i.data;O.backend.sendFabricEvent(i.pc||n,e.event,t,e.eventData)}else if(i.type===w){const e=i.data;O.backend.associateMstWithUserID(i.pc||n,e.callStatsId,t,e.ssrc,e.usageLabel,e.containerId)}O.reportsQueue.length=0}static _reportError(e,t,n,i){let r=n;r||(a.warn("No error is passed!"),r=new Error("Unknown error")),O.backendInitialized&&e?O.backend.reportError(i,e.confID,t,r):O.reportsQueue.push({type:A,data:{error:r,pc:i,type:t}})}static _reportEvent(e,t,n){const i=e&&e.peerconnection,r=e&&e.confID;O.backendInitialized&&e?O.backend.sendFabricEvent(i,t,r,n):O.reportsQueue.push({confID:r,pc:i,type:I,data:{event:t,eventData:n}})}static _traceAndCatchBackendCalls(e){const t=["associateMstWithUserID","sendFabricEvent","sendUserFeedback"];for(const n of t){const t=e[n];e[n]=function(...n){try{return t.apply(e,n)}catch(e){s.a.callErrorHandler(e)}}}const n=["associateMstWithUserID","sendFabricEvent","sendUserFeedback"];for(const t of n){const n=e[t];e[t]=function(...i){a.debug(t,i),n.apply(e,i)}}const r=e.reportError;e.reportError=function(t,n,o,...c){o===f?i.a.isReactNative()||console&&console.debug("reportError",t,n,o):a.debug("reportError",t,n,o,...c);try{r.call(e,t,n,o,...c)}catch(e){o===f?console&&console.error("reportError",e):s.a.callErrorHandler(e)}}}static get fabrics(){return P||(P=new Set),P}static initBackend(e){if(O.backend)throw new Error("CallStats backend has been initialized already!");try{const t=callstats;O.backend=new t,O._traceAndCatchBackendCalls(O.backend),O.userID={aliasName:e.aliasName,userName:e.userName},O.callStatsID=e.callStatsID,O.callStatsSecret=e.callStatsSecret;const n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){o(e,t,n[t])}))}return e}({},e.configParams);if(e.applicationName&&(n.applicationVersion=`${e.applicationName} (${i.a.getName()})`),e.confID){const t=e.confID.match(/.*\/(.*)\/.*/);n.siteID=e.siteID||t&&t[1]||"/"}O.backend.initialize(O.callStatsID,O.callStatsSecret,O.userID,O._initCallback,void 0,n);const r=e.getWiFiStatsMethod;return r&&(O.backend.attachWifiStatsHandler(r),r().then(e=>{e&&a.info("Reported wifi addresses:",JSON.parse(e).addresses)}).catch(()=>{})),!0}catch(e){return s.a.callErrorHandler(e),O.backend=null,a.error(e),!1}}static isBackendInitialized(){return Boolean(O.backend)}static sendActiveDeviceListEvent(e,t){O._reportEvent(t,R,e)}static sendApplicationLog(e,t){try{O._reportError(t,f,e,t&&t.peerconnection)}catch(e){console&&"function"==typeof console.error&&console.error("sendApplicationLog failed",e)}}static sendFeedback(e,t,n){return new Promise((i,r)=>{if(O.backend)O.backend.sendUserFeedback(e,{userID:O.userID,overall:t,comment:n},(e,t)=>{"success"===e?i(t):r(t)});else{const e="Failed to submit feedback to CallStats - no backend";a.error(e),r(e)}})}static sendGetUserMediaFailed(e,t){O._reportError(t,p,e,null)}static sendMuteEvent(e,t,n){let i;i="video"===t?e?y:E:e?v:S,O._reportEvent(n,i)}constructor(e,t){this.confID=t.confID,this.tpc=e,this.peerconnection=e.peerconnection,this.remoteUserID=t.remoteUserID||"jitsi",this.hasFabric=!1,O.fabrics.add(this),O.backendInitialized&&(this._addNewFabric(),1===O.fabrics.size&&O._emptyReportQueue(this))}_addNewFabric(){a.info("addNewFabric",this.remoteUserID);try{const e={remoteEndpointType:this.tpc.isP2P?O.backend.endpointType.peer:O.backend.endpointType.server},t=O.backend.addNewFabric(this.peerconnection,this.remoteUserID,O.backend.fabricUsage.multiplex,this.confID,e,O._addNewFabricCallback);this.hasFabric=!0;const n="success"===t.status;return n||a.error("callstats fabric not initilized",t.message),n}catch(e){return s.a.callErrorHandler(e),!1}}associateStreamWithVideoTag(e,t,n,i,r){if(!O.backend)return;const s=t?O.userID:n;O.backendInitialized?O.backend.associateMstWithUserID(this.peerconnection,s,this.confID,e,i,r):O.reportsQueue.push({type:w,pc:this.peerconnection,data:{callStatsId:s,containerId:r,ssrc:e,usageLabel:i}})}sendDominantSpeakerEvent(){O._reportEvent(this,T)}sendTerminateEvent(){O.backendInitialized&&O.backend.sendFabricEvent(this.peerconnection,O.backend.fabricEvent.fabricTerminated,this.confID),O.fabrics.delete(this)}sendIceConnectionFailedEvent(){O._reportError(this,m,null,this.peerconnection)}sendCreateOfferFailed(e){O._reportError(this,c,e,this.peerconnection)}sendCreateAnswerFailed(e){O._reportError(this,d,e,this.peerconnection)}sendResumeOrHoldEvent(e){O._reportEvent(this,e?_:g)}sendScreenSharingEvent(e,t){let n;t&&(n={ssrc:t}),O._reportEvent(this,e?b:C,n)}sendSetLocalDescFailed(e){O._reportError(this,u,e,this.peerconnection)}sendSetRemoteDescFailed(e){O._reportError(this,l,e,this.peerconnection)}sendAddIceCandidateFailed(e){O._reportError(this,h,e,this.peerconnection)}}O.backend=null,O.reportsQueue=[],O.backendInitialized=!1,O.callStatsID=null,O.callStatsSecret=null,O.userID=null}).call(this,"modules/statistics/CallStats.js")},function(e,t){function n(e,t){return Math.floor(Math.random()*(t-e+1))+e}function i(e){return e[n(0,e.length-1)]}const r={randomHexDigit:()=>i("0123456789abcdef"),randomHexString(e){let t="";for(;e--;)t+=this.randomHexDigit();return t},randomElement:i,randomAlphanumStr:function(e){let t="";for(let n=0;n<e;n+=1)t+=i("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");return t},randomInt:n};e.exports=r},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var i=n(22);function r(e=class{}){return class extends e{constructor(...e){super(...e),this.connection=null}init(e){this.connection=e}}}t.b=r();const s=r(i.a)},function(e,t,n){"use strict";n.r(t),n.d(t,"CONNECTION_DROPPED_ERROR",(function(){return i})),n.d(t,"OTHER_ERROR",(function(){return r})),n.d(t,"PASSWORD_REQUIRED",(function(){return s})),n.d(t,"SERVER_ERROR",(function(){return o}));const i="connection.droppedError",r="connection.otherError",s="connection.passwordRequired",o="connection.serverError"},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return u}));var i=n(5),r=n(2),s=(n(160),n(22)),o=n(99),a=n(101),c=n(102);const d=Object(i.getLogger)(e);class u extends s.a{static get Events(){return{CONN_STATUS_CHANGED:"CONN_STATUS_CHANGED",CONN_SHARD_CHANGED:"CONN_SHARD_CHANGED"}}static get Status(){return r.Strophe.Status}constructor({enableWebsocketResume:e,websocketKeepAlive:t,websocketKeepAliveUrl:n,serviceUrl:i,shard:s,xmppPing:d}){super(),this._options={enableWebsocketResume:void 0===e||e,pingOptions:d,shard:s,websocketKeepAlive:void 0===t?6e4:Number(t),websocketKeepAliveUrl:n},this._stropheConn=new r.Strophe.Connection(i),this._usesWebsocket=i.startsWith("ws:")||i.startsWith("wss:"),this._stropheConn.maxRetries=3,this._rawInputTracker=new a.a,this._rawInputTracker.startTracking(this,this._stropheConn),this._resumeTask=new o.a(this._stropheConn),this._deferredIQs=[],this.addConnectionPlugin("ping",new c.a({getTimeSinceLastServerResponse:()=>this.getTimeSinceLastSuccess(),onPingThresholdExceeded:()=>this._onPingErrorThresholdExceeded(),pingOptions:d})),this._oneSuccessfulConnect=!1}get connected(){const e=this._stropheConn&&this._stropheConn._proto&&this._stropheConn._proto.socket;return(this._status===r.Strophe.Status.CONNECTED||this._status===r.Strophe.Status.ATTACHED)&&(!this.isUsingWebSocket||e&&e.readyState===WebSocket.OPEN)}get disco(){return this._stropheConn.disco}get disconnecting(){return!0===this._stropheConn.disconnecting}get domain(){return this._stropheConn.domain}get isUsingWebSocket(){return this._usesWebsocket}get jid(){return this._stropheConn.jid}get lastResponseHeaders(){return this._stropheConn._proto&&this._stropheConn._proto.lastResponseHeaders}get logger(){return this._stropheConn.logger}get options(){return this._stropheConn.options}get pingDomain(){var e;return(null===(e=this._options.pingOptions)||void 0===e?void 0:e.domain)||this.domain}get service(){return this._stropheConn.service}set shard(e){this._options.shard=e,this._oneSuccessfulConnect&&this._maybeStartWSKeepAlive()}get status(){return this._status}addConnectionPlugin(e,t){this[e]=t,t.init(this)}addHandler(...e){this._stropheConn.addHandler(...e)}attach(e,t,n,i,...r){this._stropheConn.attach(e,t,n,this._stropheConnectionCb.bind(this,i),...r)}connect(e,t,n,...i){this._stropheConn.connect(e,t,this._stropheConnectionCb.bind(this,n),...i)}_stropheConnectionCb(e,t,...n){this._status=t;let i=!1;var s;t===r.Strophe.Status.CONNECTED||t===r.Strophe.Status.ATTACHED?(this._maybeEnableStreamResume(),this._usesWebsocket&&this._oneSuccessfulConnect&&this._keepAliveAndCheckShard(),this._oneSuccessfulConnect=!0,this._maybeStartWSKeepAlive(),this._processDeferredIQs(),this._resumeTask.cancel(),this.ping.startInterval((null===(s=this._options.pingOptions)||void 0===s?void 0:s.domain)||this.domain)):t===r.Strophe.Status.DISCONNECTED&&(this.ping.stopInterval(),i=this._tryResumingConnection(),i||clearTimeout(this._wsKeepAlive));i||(e(t,...n),this.eventEmitter.emit(u.Events.CONN_STATUS_CHANGED,t))}_clearDeferredIQs(){for(const e of this._deferredIQs)e.reject(new Error("disconnect"));this._deferredIQs=[]}closeWebsocket(){this._stropheConn&&this._stropheConn._proto&&(this._stropheConn._proto._closeSocket(),this._stropheConn._proto._onClose(null))}disconnect(...e){this._resumeTask.cancel(),clearTimeout(this._wsKeepAlive),this._clearDeferredIQs(),this._stropheConn.disconnect(...e)}flush(...e){this._stropheConn.flush(...e)}getTimeSinceLastSuccess(){return this._rawInputTracker.getTimeSinceLastSuccess()}getLastFailedMessage(){return this._rawInputTracker.getLastFailedMessage()}_maybeEnableStreamResume(){if(!this._options.enableWebsocketResume)return;const{streamManagement:e}=this._stropheConn;this.isUsingWebSocket?e?e.isSupported()?e.getResumeToken()||(d.info("Enabling XEP-0198 stream management"),e.enable(!0)):d.warn("Stream resume enabled, but XEP-0198 is not supported by the server"):d.warn("Stream resume enabled, but Strophe streamManagement plugin is not installed"):d.warn("Stream resume enabled, but WebSockets are not enabled")}_maybeStartWSKeepAlive(){const{websocketKeepAlive:e}=this._options;if(this._usesWebsocket&&e>0){this._wsKeepAlive||d.info(`WebSocket keep alive interval: ${e}ms`),clearTimeout(this._wsKeepAlive);const t=e+60*Math.random()*1e3;d.debug(`Scheduling next WebSocket keep-alive in ${t}ms`),this._wsKeepAlive=setTimeout(()=>this._keepAliveAndCheckShard().then(()=>this._maybeStartWSKeepAlive()),t)}}_keepAliveAndCheckShard(){const{shard:e,websocketKeepAliveUrl:t}=this._options,n=t||this.service.replace("wss://","https://").replace("ws://","http://");return fetch(n).then(t=>{if(!e)return;const n=t.headers.get("x-jitsi-shard");n!==e&&(d.error(`Detected that shard changed from ${e} to ${n}`),this.eventEmitter.emit(u.Events.CONN_SHARD_CHANGED))}).catch(e=>{d.error("Websocket Keep alive failed for url: "+n,{error:e})})}_processDeferredIQs(){for(const e of this._deferredIQs)if(e.iq){clearTimeout(e.timeout);const t=Date.now()-e.start;this.sendIQ(e.iq,t=>e.resolve(t),t=>e.reject(t),t)}this._deferredIQs=[]}send(e){if(!this.connected)throw new Error("Not connected");this._stropheConn.send(e)}sendIQ(e,t,n,i){if(this.connected)return this._stropheConn.sendIQ(e,t,n,i);n("Not connected")}sendIQ2(e,{timeout:t}){return new Promise((n,i)=>{if(this.connected)this.sendIQ(e,e=>n(e),e=>i(e),t);else{const r={iq:e,resolve:n,reject:i,start:Date.now(),timeout:setTimeout(()=>{r.iq=void 0,i(void 0)},t)};this._deferredIQs.push(r)}})}_onPingErrorThresholdExceeded(){this.isUsingWebSocket&&(d.warn("Ping error threshold exceeded - killing the WebSocket"),this.closeWebsocket())}sendPresence(e,t,n,i){this.connected?this._stropheConn.sendPresence(e,t,n,i):n("Not connected")}sendUnavailableBeacon(){if(!navigator.sendBeacon||this._stropheConn.disconnecting||!this._stropheConn.connected)return!1;this._stropheConn._changeConnectStatus(r.Strophe.Status.DISCONNECTING),this._stropheConn.disconnecting=!0;const e=this._stropheConn._proto._buildBody().attrs({type:"terminate"}),t=Object(r.$pres)({xmlns:r.Strophe.NS.CLIENT,type:"unavailable"});e.cnode(t.tree());const n=navigator.sendBeacon(-1===this.service.indexOf("https://")?"https:"+this.service:this.service,r.Strophe.serialize(e.tree()));return d.info("Successfully send unavailable beacon "+n),this._stropheConn._proto._abortAllRequests(),this._stropheConn._doDisconnect(),!0}_tryResumingConnection(){const{streamManagement:e}=this._stropheConn;return!(!e||!e.getResumeToken())&&(this._resumeTask.schedule(),!0)}}}).call(this,"modules/xmpp/XmppConnection.js")},function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return r}));const i="signaling.peerMuted",r="signaling.peerVideoType"},function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return r}));const i="https://api.callstats.io/static/callstats-ws.min.js",r=5},function(e,t,n){(function(e,n){var i="[object Arguments]",r="[object Function]",s="[object GeneratorFunction]",o="[object Map]",a="[object Set]",c=/\w*$/,d=/^\[object .+?Constructor\]$/,u=/^(?:0|[1-9]\d*)$/,l={};l[i]=l["[object Array]"]=l["[object ArrayBuffer]"]=l["[object DataView]"]=l["[object Boolean]"]=l["[object Date]"]=l["[object Float32Array]"]=l["[object Float64Array]"]=l["[object Int8Array]"]=l["[object Int16Array]"]=l["[object Int32Array]"]=l[o]=l["[object Number]"]=l["[object Object]"]=l["[object RegExp]"]=l[a]=l["[object String]"]=l["[object Symbol]"]=l["[object Uint8Array]"]=l["[object Uint8ClampedArray]"]=l["[object Uint16Array]"]=l["[object Uint32Array]"]=!0,l["[object Error]"]=l[r]=l["[object WeakMap]"]=!1;var h="object"==typeof e&&e&&e.Object===Object&&e,p="object"==typeof self&&self&&self.Object===Object&&self,m=h||p||Function("return this")(),f=t&&!t.nodeType&&t,g=f&&"object"==typeof n&&n&&!n.nodeType&&n,_=g&&g.exports===f;function v(e,t){return e.set(t[0],t[1]),e}function S(e,t){return e.add(t),e}function y(e,t,n,i){var r=-1,s=e?e.length:0;for(i&&s&&(n=e[++r]);++r<s;)n=t(n,e[r],r,e);return n}function E(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function b(e){var t=-1,n=Array(e.size);return e.forEach((function(e,i){n[++t]=[i,e]})),n}function C(e,t){return function(n){return e(t(n))}}function T(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var R,A=Array.prototype,I=Function.prototype,w=Object.prototype,P=m["__core-js_shared__"],O=(R=/[^.]+$/.exec(P&&P.keys&&P.keys.IE_PROTO||""))?"Symbol(src)_1."+R:"",D=I.toString,N=w.hasOwnProperty,M=w.toString,L=RegExp("^"+D.call(N).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),k=_?m.Buffer:void 0,x=m.Symbol,F=m.Uint8Array,j=C(Object.getPrototypeOf,Object),U=Object.create,H=w.propertyIsEnumerable,V=A.splice,B=Object.getOwnPropertySymbols,J=k?k.isBuffer:void 0,G=C(Object.keys,Object),$=ge(m,"DataView"),K=ge(m,"Map"),q=ge(m,"Promise"),W=ge(m,"Set"),z=ge(m,"WeakMap"),Q=ge(Object,"create"),Y=Ee($),X=Ee(K),Z=Ee(q),ee=Ee(W),te=Ee(z),ne=x?x.prototype:void 0,ie=ne?ne.valueOf:void 0;function re(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function se(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function oe(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function ae(e){this.__data__=new se(e)}function ce(e,t){var n=Ce(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&Te(e)}(e)&&N.call(e,"callee")&&(!H.call(e,"callee")||M.call(e)==i)}(e)?function(e,t){for(var n=-1,i=Array(e);++n<e;)i[n]=t(n);return i}(e.length,String):[],r=n.length,s=!!r;for(var o in e)!t&&!N.call(e,o)||s&&("length"==o||Se(o,r))||n.push(o);return n}function de(e,t,n){var i=e[t];N.call(e,t)&&be(i,n)&&(void 0!==n||t in e)||(e[t]=n)}function ue(e,t){for(var n=e.length;n--;)if(be(e[n][0],t))return n;return-1}function le(e,t,n,d,u,h,p){var m;if(d&&(m=h?d(e,u,h,p):d(e)),void 0!==m)return m;if(!Ie(e))return e;var f=Ce(e);if(f){if(m=function(e){var t=e.length,n=e.constructor(t);t&&"string"==typeof e[0]&&N.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!t)return function(e,t){var n=-1,i=e.length;t||(t=Array(i));for(;++n<i;)t[n]=e[n];return t}(e,m)}else{var g=ve(e),_=g==r||g==s;if(Re(e))return function(e,t){if(t)return e.slice();var n=new e.constructor(e.length);return e.copy(n),n}(e,t);if("[object Object]"==g||g==i||_&&!h){if(E(e))return h?e:{};if(m=function(e){return"function"!=typeof e.constructor||ye(e)?{}:(t=j(e),Ie(t)?U(t):{});var t}(_?{}:e),!t)return function(e,t){return me(e,_e(e),t)}(e,function(e,t){return e&&me(t,we(t),e)}(m,e))}else{if(!l[g])return h?e:{};m=function(e,t,n,i){var r=e.constructor;switch(t){case"[object ArrayBuffer]":return pe(e);case"[object Boolean]":case"[object Date]":return new r(+e);case"[object DataView]":return function(e,t){var n=t?pe(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,i);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(e,t){var n=t?pe(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,i);case o:return function(e,t,n){return y(t?n(b(e),!0):b(e),v,new e.constructor)}(e,i,n);case"[object Number]":case"[object String]":return new r(e);case"[object RegExp]":return function(e){var t=new e.constructor(e.source,c.exec(e));return t.lastIndex=e.lastIndex,t}(e);case a:return function(e,t,n){return y(t?n(T(e),!0):T(e),S,new e.constructor)}(e,i,n);case"[object Symbol]":return s=e,ie?Object(ie.call(s)):{}}var s}(e,g,le,t)}}p||(p=new ae);var C=p.get(e);if(C)return C;if(p.set(e,m),!f)var R=n?function(e){return function(e,t,n){var i=t(e);return Ce(e)?i:function(e,t){for(var n=-1,i=t.length,r=e.length;++n<i;)e[r+n]=t[n];return e}(i,n(e))}(e,we,_e)}(e):we(e);return function(e,t){for(var n=-1,i=e?e.length:0;++n<i&&!1!==t(e[n],n,e););}(R||e,(function(i,r){R&&(i=e[r=i]),de(m,r,le(i,t,n,d,r,e,p))})),m}function he(e){return!(!Ie(e)||(t=e,O&&O in t))&&(Ae(e)||E(e)?L:d).test(Ee(e));var t}function pe(e){var t=new e.constructor(e.byteLength);return new F(t).set(new F(e)),t}function me(e,t,n,i){n||(n={});for(var r=-1,s=t.length;++r<s;){var o=t[r],a=i?i(n[o],e[o],o,n,e):void 0;de(n,o,void 0===a?e[o]:a)}return n}function fe(e,t){var n,i,r=e.__data__;return("string"==(i=typeof(n=t))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==n:null===n)?r["string"==typeof t?"string":"hash"]:r.map}function ge(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return he(n)?n:void 0}re.prototype.clear=function(){this.__data__=Q?Q(null):{}},re.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},re.prototype.get=function(e){var t=this.__data__;if(Q){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return N.call(t,e)?t[e]:void 0},re.prototype.has=function(e){var t=this.__data__;return Q?void 0!==t[e]:N.call(t,e)},re.prototype.set=function(e,t){return this.__data__[e]=Q&&void 0===t?"__lodash_hash_undefined__":t,this},se.prototype.clear=function(){this.__data__=[]},se.prototype.delete=function(e){var t=this.__data__,n=ue(t,e);return!(n<0)&&(n==t.length-1?t.pop():V.call(t,n,1),!0)},se.prototype.get=function(e){var t=this.__data__,n=ue(t,e);return n<0?void 0:t[n][1]},se.prototype.has=function(e){return ue(this.__data__,e)>-1},se.prototype.set=function(e,t){var n=this.__data__,i=ue(n,e);return i<0?n.push([e,t]):n[i][1]=t,this},oe.prototype.clear=function(){this.__data__={hash:new re,map:new(K||se),string:new re}},oe.prototype.delete=function(e){return fe(this,e).delete(e)},oe.prototype.get=function(e){return fe(this,e).get(e)},oe.prototype.has=function(e){return fe(this,e).has(e)},oe.prototype.set=function(e,t){return fe(this,e).set(e,t),this},ae.prototype.clear=function(){this.__data__=new se},ae.prototype.delete=function(e){return this.__data__.delete(e)},ae.prototype.get=function(e){return this.__data__.get(e)},ae.prototype.has=function(e){return this.__data__.has(e)},ae.prototype.set=function(e,t){var n=this.__data__;if(n instanceof se){var i=n.__data__;if(!K||i.length<199)return i.push([e,t]),this;n=this.__data__=new oe(i)}return n.set(e,t),this};var _e=B?C(B,Object):function(){return[]},ve=function(e){return M.call(e)};function Se(e,t){return!!(t=null==t?9007199254740991:t)&&("number"==typeof e||u.test(e))&&e>-1&&e%1==0&&e<t}function ye(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||w)}function Ee(e){if(null!=e){try{return D.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function be(e,t){return e===t||e!=e&&t!=t}($&&"[object DataView]"!=ve(new $(new ArrayBuffer(1)))||K&&ve(new K)!=o||q&&"[object Promise]"!=ve(q.resolve())||W&&ve(new W)!=a||z&&"[object WeakMap]"!=ve(new z))&&(ve=function(e){var t=M.call(e),n="[object Object]"==t?e.constructor:void 0,i=n?Ee(n):void 0;if(i)switch(i){case Y:return"[object DataView]";case X:return o;case Z:return"[object Promise]";case ee:return a;case te:return"[object WeakMap]"}return t});var Ce=Array.isArray;function Te(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}(e.length)&&!Ae(e)}var Re=J||function(){return!1};function Ae(e){var t=Ie(e)?M.call(e):"";return t==r||t==s}function Ie(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function we(e){return Te(e)?ce(e):function(e){if(!ye(e))return G(e);var t=[];for(var n in Object(e))N.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)}n.exports=function(e){return le(e,!0,!0)}}).call(this,n(45),n(83)(e))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));class i{constructor(){this.promise=new Promise((e,t)=>{this.resolve=(...t)=>{this.clearRejectTimeout(),e(...t)},this.reject=(...e)=>{this.clearRejectTimeout(),t(...e)}}),this.then=this.promise.then.bind(this.promise),this.catch=this.promise.catch.bind(this.promise)}clearRejectTimeout(){clearTimeout(this._timeout)}setRejectTimeout(e){this._timeout=setTimeout(()=>{this.reject(new Error("timeout"))},e)}}},function(e,t){e.exports={ENVIRONMENT:"environment",USER:"user"}},function(e,t,n){"use strict";const i={generateIdentifier:function(){return Math.random().toString(36).substr(2,10)}};i.localCName=i.generateIdentifier(),i.splitLines=function(e){return e.trim().split("\n").map(e=>e.trim())},i.splitSections=function(e){return e.split("\nm=").map((e,t)=>(t>0?"m="+e:e).trim()+"\r\n")},i.getDescription=function(e){const t=i.splitSections(e);return t&&t[0]},i.getMediaSections=function(e){const t=i.splitSections(e);return t.shift(),t},i.matchPrefix=function(e,t){return i.splitLines(e).filter(e=>0===e.indexOf(t))},i.parseCandidate=function(e){let t;t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" ");const n={foundation:t[0],component:{1:"rtp",2:"rtcp"}[t[1]]||t[1],protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]};for(let e=8;e<t.length;e+=2)switch(t[e]){case"raddr":n.relatedAddress=t[e+1];break;case"rport":n.relatedPort=parseInt(t[e+1],10);break;case"tcptype":n.tcpType=t[e+1];break;case"ufrag":n.ufrag=t[e+1],n.usernameFragment=t[e+1];break;default:void 0===n[t[e]]&&(n[t[e]]=t[e+1])}return n},i.writeCandidate=function(e){const t=[];t.push(e.foundation);const n=e.component;"rtp"===n?t.push(1):"rtcp"===n?t.push(2):t.push(n),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.address||e.ip),t.push(e.port);const i=e.type;return t.push("typ"),t.push(i),"host"!==i&&e.relatedAddress&&e.relatedPort&&(t.push("raddr"),t.push(e.relatedAddress),t.push("rport"),t.push(e.relatedPort)),e.tcpType&&"tcp"===e.protocol.toLowerCase()&&(t.push("tcptype"),t.push(e.tcpType)),(e.usernameFragment||e.ufrag)&&(t.push("ufrag"),t.push(e.usernameFragment||e.ufrag)),"candidate:"+t.join(" ")},i.parseIceOptions=function(e){return e.substr(14).split(" ")},i.parseRtpMap=function(e){let t=e.substr(9).split(" ");const n={payloadType:parseInt(t.shift(),10)};return t=t[0].split("/"),n.name=t[0],n.clockRate=parseInt(t[1],10),n.channels=3===t.length?parseInt(t[2],10):1,n.numChannels=n.channels,n},i.writeRtpMap=function(e){let t=e.payloadType;void 0!==e.preferredPayloadType&&(t=e.preferredPayloadType);const n=e.channels||e.numChannels||1;return"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1!==n?"/"+n:"")+"\r\n"},i.parseExtmap=function(e){const t=e.substr(9).split(" ");return{id:parseInt(t[0],10),direction:t[0].indexOf("/")>0?t[0].split("/")[1]:"sendrecv",uri:t[1]}},i.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+"\r\n"},i.parseFmtp=function(e){const t={};let n;const i=e.substr(e.indexOf(" ")+1).split(";");for(let e=0;e<i.length;e++)n=i[e].trim().split("="),t[n[0].trim()]=n[1];return t},i.writeFmtp=function(e){let t="",n=e.payloadType;if(void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){const i=[];Object.keys(e.parameters).forEach(t=>{void 0!==e.parameters[t]?i.push(t+"="+e.parameters[t]):i.push(t)}),t+="a=fmtp:"+n+" "+i.join(";")+"\r\n"}return t},i.parseRtcpFb=function(e){const t=e.substr(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},i.writeRtcpFb=function(e){let t="",n=e.payloadType;return void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach(e=>{t+="a=rtcp-fb:"+n+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"}),t},i.parseSsrcMedia=function(e){const t=e.indexOf(" "),n={ssrc:parseInt(e.substr(7,t-7),10)},i=e.indexOf(":",t);return i>-1?(n.attribute=e.substr(t+1,i-t-1),n.value=e.substr(i+1)):n.attribute=e.substr(t+1),n},i.parseSsrcGroup=function(e){const t=e.substr(13).split(" ");return{semantics:t.shift(),ssrcs:t.map(e=>parseInt(e,10))}},i.getMid=function(e){const t=i.matchPrefix(e,"a=mid:")[0];if(t)return t.substr(6)},i.parseFingerprint=function(e){const t=e.substr(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1].toUpperCase()}},i.getDtlsParameters=function(e,t){return{role:"auto",fingerprints:i.matchPrefix(e+t,"a=fingerprint:").map(i.parseFingerprint)}},i.writeDtlsParameters=function(e,t){let n="a=setup:"+t+"\r\n";return e.fingerprints.forEach(e=>{n+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"}),n},i.parseCryptoLine=function(e){const t=e.substr(9).split(" ");return{tag:parseInt(t[0],10),cryptoSuite:t[1],keyParams:t[2],sessionParams:t.slice(3)}},i.writeCryptoLine=function(e){return"a=crypto:"+e.tag+" "+e.cryptoSuite+" "+("object"==typeof e.keyParams?i.writeCryptoKeyParams(e.keyParams):e.keyParams)+(e.sessionParams?" "+e.sessionParams.join(" "):"")+"\r\n"},i.parseCryptoKeyParams=function(e){if(0!==e.indexOf("inline:"))return null;const t=e.substr(7).split("|");return{keyMethod:"inline",keySalt:t[0],lifeTime:t[1],mkiValue:t[2]?t[2].split(":")[0]:void 0,mkiLength:t[2]?t[2].split(":")[1]:void 0}},i.writeCryptoKeyParams=function(e){return e.keyMethod+":"+e.keySalt+(e.lifeTime?"|"+e.lifeTime:"")+(e.mkiValue&&e.mkiLength?"|"+e.mkiValue+":"+e.mkiLength:"")},i.getCryptoParameters=function(e,t){return i.matchPrefix(e+t,"a=crypto:").map(i.parseCryptoLine)},i.getIceParameters=function(e,t){const n=i.matchPrefix(e+t,"a=ice-ufrag:")[0],r=i.matchPrefix(e+t,"a=ice-pwd:")[0];return n&&r?{usernameFragment:n.substr(12),password:r.substr(10)}:null},i.writeIceParameters=function(e){let t="a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n";return e.iceLite&&(t+="a=ice-lite\r\n"),t},i.parseRtpParameters=function(e){const t={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},n=i.splitLines(e)[0].split(" ");for(let r=3;r<n.length;r++){const s=n[r],o=i.matchPrefix(e,"a=rtpmap:"+s+" ")[0];if(o){const n=i.parseRtpMap(o),r=i.matchPrefix(e,"a=fmtp:"+s+" ");switch(n.parameters=r.length?i.parseFmtp(r[0]):{},n.rtcpFeedback=i.matchPrefix(e,"a=rtcp-fb:"+s+" ").map(i.parseRtcpFb),t.codecs.push(n),n.name.toUpperCase()){case"RED":case"ULPFEC":t.fecMechanisms.push(n.name.toUpperCase())}}}return i.matchPrefix(e,"a=extmap:").forEach(e=>{t.headerExtensions.push(i.parseExtmap(e))}),t},i.writeRtpDescription=function(e,t){let n="";n+="m="+e+" ",n+=t.codecs.length>0?"9":"0",n+=" UDP/TLS/RTP/SAVPF ",n+=t.codecs.map(e=>void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType).join(" ")+"\r\n",n+="c=IN IP4 0.0.0.0\r\n",n+="a=rtcp:9 IN IP4 0.0.0.0\r\n",t.codecs.forEach(e=>{n+=i.writeRtpMap(e),n+=i.writeFmtp(e),n+=i.writeRtcpFb(e)});let r=0;return t.codecs.forEach(e=>{e.maxptime>r&&(r=e.maxptime)}),r>0&&(n+="a=maxptime:"+r+"\r\n"),t.headerExtensions&&t.headerExtensions.forEach(e=>{n+=i.writeExtmap(e)}),n},i.parseRtpEncodingParameters=function(e){const t=[],n=i.parseRtpParameters(e),r=-1!==n.fecMechanisms.indexOf("RED"),s=-1!==n.fecMechanisms.indexOf("ULPFEC"),o=i.matchPrefix(e,"a=ssrc:").map(e=>i.parseSsrcMedia(e)).filter(e=>"cname"===e.attribute),a=o.length>0&&o[0].ssrc;let c;const d=i.matchPrefix(e,"a=ssrc-group:FID").map(e=>e.substr(17).split(" ").map(e=>parseInt(e,10)));d.length>0&&d[0].length>1&&d[0][0]===a&&(c=d[0][1]),n.codecs.forEach(e=>{if("RTX"===e.name.toUpperCase()&&e.parameters.apt){let n={ssrc:a,codecPayloadType:parseInt(e.parameters.apt,10)};a&&c&&(n.rtx={ssrc:c}),t.push(n),r&&(n=JSON.parse(JSON.stringify(n)),n.fec={ssrc:a,mechanism:s?"red+ulpfec":"red"},t.push(n))}}),0===t.length&&a&&t.push({ssrc:a});let u=i.matchPrefix(e,"b=");return u.length&&(u=0===u[0].indexOf("b=TIAS:")?parseInt(u[0].substr(7),10):0===u[0].indexOf("b=AS:")?1e3*parseInt(u[0].substr(5),10)*.95-16e3:void 0,t.forEach(e=>{e.maxBitrate=u})),t},i.parseRtcpParameters=function(e){const t={},n=i.matchPrefix(e,"a=ssrc:").map(e=>i.parseSsrcMedia(e)).filter(e=>"cname"===e.attribute)[0];n&&(t.cname=n.value,t.ssrc=n.ssrc);const r=i.matchPrefix(e,"a=rtcp-rsize");t.reducedSize=r.length>0,t.compound=0===r.length;const s=i.matchPrefix(e,"a=rtcp-mux");return t.mux=s.length>0,t},i.writeRtcpParameters=function(e){let t="";return e.reducedSize&&(t+="a=rtcp-rsize\r\n"),e.mux&&(t+="a=rtcp-mux\r\n"),void 0!==e.ssrc&&e.cname&&(t+="a=ssrc:"+e.ssrc+" cname:"+e.cname+"\r\n"),t},i.parseMsid=function(e){let t;const n=i.matchPrefix(e,"a=msid:");if(1===n.length)return t=n[0].substr(7).split(" "),{stream:t[0],track:t[1]};const r=i.matchPrefix(e,"a=ssrc:").map(e=>i.parseSsrcMedia(e)).filter(e=>"msid"===e.attribute);return r.length>0?(t=r[0].value.split(" "),{stream:t[0],track:t[1]}):void 0},i.parseSctpDescription=function(e){const t=i.parseMLine(e),n=i.matchPrefix(e,"a=max-message-size:");let r;n.length>0&&(r=parseInt(n[0].substr(19),10)),isNaN(r)&&(r=65536);const s=i.matchPrefix(e,"a=sctp-port:");if(s.length>0)return{port:parseInt(s[0].substr(12),10),protocol:t.fmt,maxMessageSize:r};const o=i.matchPrefix(e,"a=sctpmap:");if(o.length>0){const e=o[0].substr(10).split(" ");return{port:parseInt(e[0],10),protocol:e[1],maxMessageSize:r}}},i.writeSctpDescription=function(e,t){let n=[];return n="DTLS/SCTP"!==e.protocol?["m="+e.kind+" 9 "+e.protocol+" "+t.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+t.port+"\r\n"]:["m="+e.kind+" 9 "+e.protocol+" "+t.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+t.port+" "+t.protocol+" 65535\r\n"],void 0!==t.maxMessageSize&&n.push("a=max-message-size:"+t.maxMessageSize+"\r\n"),n.join("")},i.generateSessionId=function(){return Math.random().toString().substr(2,21)},i.writeSessionBoilerplate=function(e,t,n){let r;const s=void 0!==t?t:2;r=e||i.generateSessionId();return"v=0\r\no="+(n||"thisisadapterortc")+" "+r+" "+s+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},i.getDirection=function(e,t){const n=i.splitLines(e);for(let e=0;e<n.length;e++)switch(n[e]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return n[e].substr(2)}return t?i.getDirection(t):"sendrecv"},i.getKind=function(e){return i.splitLines(e)[0].split(" ")[0].substr(2)},i.isRejected=function(e){return"0"===e.split(" ",2)[1]},i.parseMLine=function(e){const t=i.splitLines(e)[0].substr(2).split(" ");return{kind:t[0],port:parseInt(t[1],10),protocol:t[2],fmt:t.slice(3).join(" ")}},i.parseOLine=function(e){const t=i.matchPrefix(e,"o=")[0].substr(2).split(" ");return{username:t[0],sessionId:t[1],sessionVersion:parseInt(t[2],10),netType:t[3],addressType:t[4],address:t[5]}},i.isValidSDP=function(e){if("string"!=typeof e||0===e.length)return!1;const t=i.splitLines(e);for(let e=0;e<t.length;e++)if(t[e].length<2||"="!==t[e].charAt(1))return!1;return!0},e.exports=i},function(e,t,n){"use strict";n.r(t),n.d(t,"DEVICE_LIST_CHANGED",(function(){return i})),n.d(t,"PERMISSIONS_CHANGED",(function(){return r})),n.d(t,"PERMISSION_PROMPT_IS_SHOWN",(function(){return s})),n.d(t,"SLOW_GET_USER_MEDIA",(function(){return o}));const i="mediaDevices.devicechange",r="rtc.permissions_changed",s="mediaDevices.permissionPromptIsShown",o="mediaDevices.slowGetUserMedia"},function(e,t,n){const i=n(157),r={loadScript(e,t,n,r,s,o){const a=document,c=a.createElement("script"),d=a.getElementsByTagName("script")[0];if(c.async=t,r){const t=i();if(t){const n=t.src,i=n.substring(0,n.lastIndexOf("/")+1);n&&i&&(e=i+e)}}s&&(c.onload=s),o&&(c.onerror=o),c.src=e,n?d.parentNode.insertBefore(c,d):d.parentNode.appendChild(c)}};e.exports=r},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return f})),n.d(t,"b",(function(){return g}));var i=n(5),r=n(1),s=n(16),o=n(4),a=n(7),c=n.n(a),d=n(8),u=n(3),l=n(6);function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){p(e,t,n[t])}))}return e}function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const m=Object(i.getLogger)(e),f={ACTIVE:"active",INACTIVE:"inactive",INTERRUPTED:"interrupted",RESTORING:"restoring"};class g{static _getNewStateForJvbMode(e,t,n,i,r){return e?i?f.ACTIVE:u.a.supportsVideoMuteOnConnInterrupted()?r?t?n?f.INTERRUPTED:f.RESTORING:f.INACTIVE:f.ACTIVE:t?f.ACTIVE:f.INACTIVE:f.INTERRUPTED}static _getNewStateForP2PMode(e,t){return u.a.supportsVideoMuteOnConnInterrupted()?e||!t?f.ACTIVE:f.INTERRUPTED:f.ACTIVE}constructor(e,t,n){this.rtc=e,this.conference=t,this.trackTimers={},this.connStatusFromJvb={},this.outOfLastNTimeout="number"==typeof n.outOfLastNTimeout?n.outOfLastNTimeout:500,this.rtcMuteTimeout="number"==typeof n.rtcMuteTimeout?n.rtcMuteTimeout:1e4,this.rtcMutedTimestamp={},m.info("RtcMuteTimeout set to: "+this.rtcMuteTimeout),this.enteredLastNTimestamp=new Map,this.restoringTimers=new Map,this.connectionStatusMap=new Map}_getVideoFrozenTimeout(e){return this.rtc.isInLastN(e)?this.rtcMuteTimeout:this.outOfLastNTimeout}init(){this._onEndpointConnStatusChanged=this.onEndpointConnStatusChanged.bind(this),this.rtc.addListener(c.a.ENDPOINT_CONN_STATUS_CHANGED,this._onEndpointConnStatusChanged),this._onP2PStatus=this.refreshConnectionStatusForAll.bind(this),this.conference.on(r.P2P_STATUS,this._onP2PStatus),this._onUserLeft=this.onUserLeft.bind(this),this.conference.on(r.USER_LEFT,this._onUserLeft),u.a.supportsVideoMuteOnConnInterrupted()&&(this._onTrackRtcMuted=this.onTrackRtcMuted.bind(this),this.rtc.addListener(c.a.REMOTE_TRACK_MUTE,this._onTrackRtcMuted),this._onTrackRtcUnmuted=this.onTrackRtcUnmuted.bind(this),this.rtc.addListener(c.a.REMOTE_TRACK_UNMUTE,this._onTrackRtcUnmuted),this._onRemoteTrackAdded=this.onRemoteTrackAdded.bind(this),this.conference.on(r.TRACK_ADDED,this._onRemoteTrackAdded),this._onRemoteTrackRemoved=this.onRemoteTrackRemoved.bind(this),this.conference.on(r.TRACK_REMOVED,this._onRemoteTrackRemoved),this._onSignallingMuteChanged=this.onSignallingMuteChanged.bind(this),this._onTrackVideoTypeChanged=this.onTrackVideoTypeChanged.bind(this)),this._onLastNChanged=this._onLastNChanged.bind(this),this.conference.on(r.LAST_N_ENDPOINTS_CHANGED,this._onLastNChanged),this._onLastNValueChanged=this.refreshConnectionStatusForAll.bind(this),this.rtc.on(c.a.LASTN_VALUE_CHANGED,this._onLastNValueChanged)}dispose(){this.rtc.removeListener(c.a.ENDPOINT_CONN_STATUS_CHANGED,this._onEndpointConnStatusChanged),u.a.supportsVideoMuteOnConnInterrupted()&&(this.rtc.removeListener(c.a.REMOTE_TRACK_MUTE,this._onTrackRtcMuted),this.rtc.removeListener(c.a.REMOTE_TRACK_UNMUTE,this._onTrackRtcUnmuted),this.conference.off(r.TRACK_ADDED,this._onRemoteTrackAdded),this.conference.off(r.TRACK_REMOVED,this._onRemoteTrackRemoved)),this.conference.off(r.LAST_N_ENDPOINTS_CHANGED,this._onLastNChanged),this.rtc.removeListener(c.a.LASTN_VALUE_CHANGED,this._onLastNValueChanged),this.conference.off(r.P2P_STATUS,this._onP2PStatus),this.conference.off(r.USER_LEFT,this._onUserLeft);const e=Object.keys(this.trackTimers);for(const t of e)this.clearTimeout(t),this.clearRtcMutedTimestamp(t);for(const e in this.connectionStatusMap)this.connectionStatusMap.hasOwnProperty(e)&&this.onUserLeft(e);this.connStatusFromJvb={}}onEndpointConnStatusChanged(e,t){m.debug(`Detector RTCEvents.ENDPOINT_CONN_STATUS_CHANGED(${Date.now()}): ${e}: ${t}`),e!==this.conference.myUserId()&&(this.connStatusFromJvb[e]=t,this.figureOutConnectionStatus(e))}_changeConnectionStatus(e,t){if(e.getConnectionStatus()!==t){const n=e.getId();e._setConnectionStatus(t),m.debug(`Emit endpoint conn status(${Date.now()}) ${n}: ${t}`),l.a.sendLog(JSON.stringify({id:"peer.conn.status",participant:n,status:t})),this.conference.eventEmitter.emit(r.PARTICIPANT_CONN_STATUS_CHANGED,n,t)}}clearTimeout(e){this.trackTimers[e]&&(window.clearTimeout(this.trackTimers[e]),this.trackTimers[e]=null)}clearRtcMutedTimestamp(e){this.rtcMutedTimestamp[e]=null}onRemoteTrackAdded(e){e.isLocal()||e.getType()!==o.c||(m.debug("Detector on remote track added for: "+e.getParticipantId()),e.on(s.TRACK_MUTE_CHANGED,this._onSignallingMuteChanged),e.on(s.TRACK_VIDEOTYPE_CHANGED,t=>this._onTrackVideoTypeChanged(e,t)))}onRemoteTrackRemoved(e){if(!e.isLocal()&&e.getType()===o.c){const t=e.getParticipantId();m.debug("Detector on remote track removed: "+t),e.off(s.TRACK_MUTE_CHANGED,this._onSignallingMuteChanged),this.clearTimeout(t),this.clearRtcMutedTimestamp(t),this.figureOutConnectionStatus(t)}}isVideoTrackFrozen(e){if(!u.a.supportsVideoMuteOnConnInterrupted())return!1;const t=e.getId(),n=e.hasAnyVideoTrackWebRTCMuted(),i=this.rtcMutedTimestamp[t],r=this._getVideoFrozenTimeout(t);return n&&"number"==typeof i&&Date.now()-i>=r}refreshConnectionStatusForAll(){const e=this.conference.getParticipants();for(const t of e)this.figureOutConnectionStatus(t.getId())}figureOutConnectionStatus(e){const t=this.conference.getParticipantById(e);if(!t)return void m.debug("figure out conn status - no participant for: "+e);const n=this.conference.isP2PActive(),i=this._isRestoringTimedout(e),r=0===this.conference.getLastN(),s=t.isVideoMuted()||r,a=this.isVideoTrackFrozen(t),c=this.rtc.isInLastN(e);let d=this.connStatusFromJvb[e];"boolean"!=typeof d&&(d=!0);const u=n?g._getNewStateForP2PMode(s,a):g._getNewStateForJvbMode(d,c,i,s,a);u!==f.RESTORING&&this._clearRestoringTimer(e),m.debug(`Figure out conn status for ${e}, is video muted: ${s} is active(jvb): ${d} video track frozen: ${a} p2p mode: ${n} is in last N: ${c} currentStatus => newStatus: ${t.getConnectionStatus()} => ${u}`);const l=this.connectionStatusMap[e]||{};if(!("p2p"in l)||!("connectionStatus"in l)||l.p2p!==n||l.connectionStatus!==u){const i=Date.now();if(this.maybeSendParticipantConnectionStatusEvent(e,i),this.connectionStatusMap[e]=h({},l,{connectionStatus:u,p2p:n,startedMs:i}),!("videoType"in this.connectionStatusMap[e])){const n=t.getTracksByMediaType(o.c);Array.isArray(n)&&0!==n.length&&(this.connectionStatusMap[e].videoType=n[0].videoType)}}this._changeConnectionStatus(t,u)}maybeSendParticipantConnectionStatusEvent(e,t){const n=this.connectionStatusMap[e];n&&"startedMs"in n&&"videoType"in n&&"connectionStatus"in n&&"p2p"in n&&(n.value=t-n.startedMs,l.a.sendAnalytics(Object(d.J)(n)))}_onLastNChanged(e=[],t=[]){const n=Date.now();m.debug(`LastN endpoints changed leaving=${e}, entering=${t} at ${n}`),u.a.supportsVideoMuteOnConnInterrupted()||this.refreshConnectionStatusForAll();for(const t of e)this.enteredLastNTimestamp.delete(t),this._clearRestoringTimer(t),u.a.supportsVideoMuteOnConnInterrupted()&&this.figureOutConnectionStatus(t);for(const e of t)this.enteredLastNTimestamp.set(e,n),u.a.supportsVideoMuteOnConnInterrupted()&&this.figureOutConnectionStatus(e)}_clearRestoringTimer(e){const t=this.restoringTimers.get(e);t&&(clearTimeout(t),this.restoringTimers.delete(e))}_isRestoringTimedout(e){const t=this.enteredLastNTimestamp.get(e);if(t&&Date.now()-t>=1e4)return!0;return this.restoringTimers.get(e)||this.restoringTimers.set(e,setTimeout(()=>this.figureOutConnectionStatus(e),1e4)),!1}onUserLeft(e){this.maybeSendParticipantConnectionStatusEvent(e,Date.now()),delete this.connectionStatusMap[e]}onTrackRtcMuted(e){const t=e.getParticipantId(),n=this.conference.getParticipantById(t);if(m.debug("Detector track RTC muted: "+t,Date.now()),n){if(this.rtcMutedTimestamp[t]=Date.now(),!n.isVideoMuted()){this.clearTimeout(t);const e=this._getVideoFrozenTimeout(t);this.trackTimers[t]=window.setTimeout(()=>{m.debug(`Set RTC mute timeout for: ${t} of ${e} ms`),this.clearTimeout(t),this.figureOutConnectionStatus(t)},e)}}else m.error("No participant for id: "+t)}onTrackRtcUnmuted(e){const t=e.getParticipantId();m.debug("Detector track RTC unmuted: "+t,Date.now()),this.clearTimeout(t),this.clearRtcMutedTimestamp(t),this.figureOutConnectionStatus(t)}onSignallingMuteChanged(e){const t=e.getParticipantId();m.debug("Detector on track signalling mute changed: "+t,e.isMuted()),this.figureOutConnectionStatus(t)}onTrackVideoTypeChanged(e,t){const n=e.getParticipantId(),i=Date.now();this.maybeSendParticipantConnectionStatusEvent(n,i),this.connectionStatusMap[n]=h({},this.connectionStatusMap[n]||{},{videoType:t,startedMs:i})}}}).call(this,"modules/connectivity/ParticipantConnectionStatus.js")},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return s}));var i=n(5),r=n(22);const s="NETWORK_INFO_CHANGED",o=Object(i.getLogger)(e);class a extends r.a{constructor(){super(),this._current={isOnline:!0}}updateNetworkInfo({isOnline:e}){o.debug("updateNetworkInfo",{isOnline:e}),this._current={isOnline:!0===e},this.eventEmitter.emit(s,this._current)}isOnline(){return!0===this._current.isOnline}}const c=new a;t.b=c}).call(this,"modules/connectivity/NetworkInfo.js")},function(e,t){e.exports={CAMERA:"camera",DESKTOP:"desktop",DESKTOP_HIGH_FPS:"desktop_high_fps",NONE:"none"}},function(e,t,n){"use strict";t.a={getFocusRecordingUpdate(e){const t=e&&e.getElementsByTagName("jibri-recording-status")[0];if(t)return{error:t.getAttribute("failure_reason"),initiator:t.getAttribute("initiator"),recordingMode:t.getAttribute("recording_mode"),sessionID:t.getAttribute("session_id"),status:t.getAttribute("status")}},getHiddenDomainUpdate(e){const t=e.getElementsByTagName("live-stream-view-url")[0],n=t&&t.textContent,i=e.getElementsByTagName("mode")[0],r=i&&i.textContent&&i.textContent.toLowerCase(),s=e.getElementsByTagName("session_id")[0];return{liveStreamViewURL:n,mode:r,sessionID:s&&s.textContent}},getSessionIdFromIq(e){const t=e&&e.getElementsByTagName("jibri")[0];return t&&t.getAttribute("session_id")},getSessionId(e){const t=e.getElementsByTagName("session_id")[0];return t&&t.textContent},isFromFocus:e=>e.getAttribute("from").includes("focus")}},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return E}));var i=n(59),r=n.n(i),s=n(5),o=n(33),a=n.n(o),c=n(81),d=n(1),u=n(46),l=n(22),h=n(24);const p=Object(s.getLogger)(e),m="error",f="key-info",g="key-info-ack",_="session-ack",v="session-init",S=Symbol("OlmData"),y={OLM_ID_KEY_READY:"olm.id_key_ready",PARTICIPANT_E2EE_CHANNEL_READY:"olm.participant_e2ee_channel_ready",PARTICIPANT_KEY_UPDATED:"olm.partitipant_key_updated"};class E extends l.a{constructor(e){super(),this._conf=e,this._init=new u.a,this._key=void 0,this._keyIndex=-1,this._reqs=new Map,this._sessionInitialization=void 0,E.isSupported()?(this._bootstrapOlm(),this._conf.on(d.ENDPOINT_MESSAGE_RECEIVED,this._onEndpointMessageReceived.bind(this)),this._conf.on(d.CONFERENCE_LEFT,this._onConferenceLeft.bind(this)),this._conf.on(d.USER_LEFT,this._onParticipantLeft.bind(this)),this._conf.on(d.PARTICIPANT_PROPERTY_CHANGED,this._onParticipantPropertyChanged.bind(this))):this._init.reject(new Error("Olm not supported"))}async initSessions(){if(this._sessionInitialization)throw new Error("OlmAdapter initSessions called multiple times");{this._sessionInitialization=new u.a,await this._init;const e=[],t=this._conf.myUserId();for(const n of this._conf.getParticipants()){(await n.getFeatures()).has(h.b)&&t<n.getId()&&e.push(this._sendSessionInit(n))}await Promise.allSettled(e),this._sessionInitialization.resolve(),this._sessionInitialization=void 0}}static isSupported(){return void 0!==window.Olm}async updateKey(e){this._key=e,this._keyIndex++;const t=[];for(const e of this._conf.getParticipants()){const n=e.getId(),i=this._getParticipantOlmData(e);if(!i.session){p.warn(`Tried to send key to participant ${n} but we have no session`);continue}const r=Object(c.a)(),s={[h.d]:"olm",olm:{type:f,data:{ciphertext:this._encryptKeyInfo(i.session),uuid:r}}},o=new u.a;o.setRejectTimeout(5e3),o.catch(()=>{this._reqs.delete(r)}),this._reqs.set(r,o),t.push(o),this._sendMessage(s,n)}return await Promise.allSettled(t),this._keyIndex}updateCurrentKey(e){return this._key=e,this._keyIndex}clearParticipantSession(e){const t=this._getParticipantOlmData(e);t.session&&(t.session.free(),t.session=void 0)}clearAllParticipantsSessions(){for(const e of this._conf.getParticipants())this.clearParticipantSession(e)}async _bootstrapOlm(){p.debug("Initializing Olm...");try{await Olm.init(),this._olmAccount=new Olm.Account,this._olmAccount.create();const e=JSON.parse(this._olmAccount.identity_keys());this._idKey=e.curve25519,p.debug(`Olm ${Olm.get_library_version().join(".")} initialized`),this._init.resolve(),this.eventEmitter.emit(y.OLM_ID_KEY_READY,this._idKey)}catch(e){p.error("Failed to initialize Olm",e),this._init.reject(e)}}_encryptKeyInfo(e){const t={};return void 0!==this._key&&(t.key=!!this._key&&r.a.fromByteArray(this._key),t.keyIndex=this._keyIndex),e.encrypt(JSON.stringify(t))}_getParticipantOlmData(e){return e[S]=e[S]||{},e[S]}async _onConferenceLeft(){p.debug("Conference left"),await this._init;for(const e of this._conf.getParticipants())this._onParticipantLeft(e.getId(),e);this._olmAccount&&(this._olmAccount.free(),this._olmAccount=void 0)}async _onEndpointMessageReceived(e,t){if("olm"!==t[h.d])return;if(!t.olm)return void p.warn("Incorrectly formatted message");await this._init;const n=t.olm,i=e.getId(),s=this._getParticipantOlmData(e);switch(n.type){case v:if(s.session)p.warn(`Participant ${i} already has a session`),this._sendError(e,"Session already established");else{const e=new Olm.Session;e.create_outbound(this._olmAccount,n.data.idKey,n.data.otKey),s.session=e;const t={[h.d]:"olm",olm:{type:_,data:{ciphertext:this._encryptKeyInfo(e),uuid:n.data.uuid}}};this._sendMessage(t,i),this.eventEmitter.emit(y.PARTICIPANT_E2EE_CHANNEL_READY,i)}break;case _:if(s.session)p.warn(`Participant ${i} already has a session`),this._sendError(e,"No session found");else if(n.data.uuid===s.pendingSessionUuid){const{ciphertext:e}=n.data,t=this._reqs.get(n.data.uuid),o=new Olm.Session;o.create_inbound(this._olmAccount,e.body),this._olmAccount.remove_one_time_keys(o);const a=o.decrypt(e.type,e.body);s.session=o,s.pendingSessionUuid=void 0,this.eventEmitter.emit(y.PARTICIPANT_E2EE_CHANNEL_READY,i),this._reqs.delete(n.data.uuid),t.resolve();const c=b(a);if(c.key){const e=r.a.toByteArray(c.key),t=c.keyIndex;s.lastKey=e,this.eventEmitter.emit(y.PARTICIPANT_KEY_UPDATED,i,e,t)}}else p.warn("Received ACK with the wrong UUID"),this._sendError(e,"Invalid UUID");break;case m:p.error(n.data.error);break;case f:if(s.session){const{ciphertext:e}=n.data,t=b(s.session.decrypt(e.type,e.body));if(void 0!==t.key&&void 0!==t.keyIndex){const e=!!t.key&&r.a.toByteArray(t.key),o=t.keyIndex;a()(s.lastKey,e)||(s.lastKey=e,this.eventEmitter.emit(y.PARTICIPANT_KEY_UPDATED,i,e,o));const c={[h.d]:"olm",olm:{type:g,data:{ciphertext:this._encryptKeyInfo(s.session),uuid:n.data.uuid}}};this._sendMessage(c,i)}}else p.debug(`Received key info message from ${i} but we have no session for them!`),this._sendError(e,"No session found while processing key-info");break;case g:if(s.session){const{ciphertext:e}=n.data,t=b(s.session.decrypt(e.type,e.body));if(void 0!==t.key&&void 0!==t.keyIndex){const e=!!t.key&&r.a.toByteArray(t.key),n=t.keyIndex;a()(s.lastKey,e)||(s.lastKey=e,this.eventEmitter.emit(y.PARTICIPANT_KEY_UPDATED,i,e,n))}const o=this._reqs.get(n.data.uuid);this._reqs.delete(n.data.uuid),o.resolve()}else p.debug(`Received key info ack message from ${i} but we have no session for them!`),this._sendError(e,"No session found while processing key-info-ack")}}_onParticipantLeft(e,t){p.debug(`Participant ${e} left`),this.clearParticipantSession(t)}async _onParticipantPropertyChanged(e,t,n,i){switch(t){case"e2ee.enabled":if(i&&this._conf.isE2EEEnabled()){const t=this._conf.myUserId(),n=e.getId();if((await e.getFeatures()).has(h.b)&&t<n){this._sessionInitialization&&await this._sessionInitialization,await this._sendSessionInit(e);const t=this._getParticipantOlmData(e),i=Object(c.a)(),r={[h.d]:"olm",olm:{type:f,data:{ciphertext:this._encryptKeyInfo(t.session),uuid:i}}};this._sendMessage(r,n)}}}}_sendError(e,t){const n=e.getId(),i={[h.d]:"olm",olm:{type:m,data:{error:t}}};this._sendMessage(i,n)}_sendMessage(e,t){this._conf.sendMessage(e,t)}_sendSessionInit(e){const t=e.getId(),n=this._getParticipantOlmData(e);if(n.session)return p.warn(`Tried to send session-init to ${t} but we already have a session`),Promise.reject();if(void 0!==n.pendingSessionUuid)return p.warn(`Tried to send session-init to ${t} but we already have a pending session`),Promise.reject();this._olmAccount.generate_one_time_keys(1);const i=JSON.parse(this._olmAccount.one_time_keys()),r=Object.values(i.curve25519)[0];if(!r)return Promise.reject(new Error("No one-time-keys generated"));this._olmAccount.mark_keys_as_published();const s=Object(c.a)(),o={[h.d]:"olm",olm:{type:v,data:{idKey:this._idKey,otKey:r,uuid:s}}},a=new u.a;return a.setRejectTimeout(5e3),a.catch(()=>{this._reqs.delete(s),n.pendingSessionUuid=void 0}),this._reqs.set(s,a),this._sendMessage(o,t),n.pendingSessionUuid=s,a}}function b(e){try{return JSON.parse(e)}catch(e){return{}}}E.events=y}).call(this,"modules/e2ee/OlmAdapter.js")},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return f}));var i=n(5),r=n(75),s=n.n(r),o=n(1),a=n(7),c=n.n(a),d=n(3),u=n(46),l=n(98),h=n(55),p=n(76);const m=Object(i.getLogger)(e);class f{constructor(e){this.conference=e,this._conferenceJoined=!1,this._enabled=!1,this._key=void 0,this._enabling=void 0,this._e2eeCtx=new l.a,this._olmAdapter=new h.a(e),this._ratchetKey=s()(this._ratchetKeyImpl,5e3),this._rotateKey=s()(this._rotateKeyImpl,5e3),this.conference.on(o.CONFERENCE_JOINED,()=>{this._conferenceJoined=!0}),this.conference.on(o.PARTICIPANT_PROPERTY_CHANGED,this._onParticipantPropertyChanged.bind(this)),this.conference.on(o.USER_JOINED,this._onParticipantJoined.bind(this)),this.conference.on(o.USER_LEFT,this._onParticipantLeft.bind(this)),this.conference.on(o._MEDIA_SESSION_STARTED,this._onMediaSessionStarted.bind(this)),this.conference.on(o.TRACK_ADDED,e=>e.isLocal()&&this._onLocalTrackAdded(e)),this.conference.rtc.on(c.a.REMOTE_TRACK_ADDED,(e,t)=>this._setupReceiverE2EEForTrack(t,e)),this.conference.on(o.TRACK_MUTE_CHANGED,this._trackMuteChanged.bind(this)),this._olmAdapter.on(h.a.events.OLM_ID_KEY_READY,this._onOlmIdKeyReady.bind(this)),this._olmAdapter.on(h.a.events.PARTICIPANT_E2EE_CHANNEL_READY,this._onParticipantE2EEChannelReady.bind(this)),this._olmAdapter.on(h.a.events.PARTICIPANT_KEY_UPDATED,this._onParticipantKeyUpdated.bind(this))}static isSupported(e){return!(e.testing&&e.testing.disableE2EE)&&(d.a.supportsInsertableStreams()||e.enableEncodedTransformSupport&&d.a.supportsEncodedTransform())&&h.a.isSupported()}isEnabled(){return this._enabled}async setEnabled(e){if(e===this._enabled)return;if(this._enabling&&await this._enabling,this._enabling=new u.a,this._enabled=e,e)await this._olmAdapter.initSessions();else{for(const e of this.conference.getParticipants())this._e2eeCtx.cleanup(e.getId());this._olmAdapter.clearAllParticipantsSessions()}this.conference.setLocalParticipantProperty("e2ee.enabled",e),this.conference._restartMediaSessions(),this._key=!!e&&this._generateKey();const t=await this._olmAdapter.updateKey(this._key);this._e2eeCtx.setKey(this.conference.myUserId(),this._key,t),this._enabling.resolve()}_generateKey(){return window.crypto.getRandomValues(new Uint8Array(32))}_onLocalTrackAdded(e){for(const t of this.conference._getMediaSessions())this._setupSenderE2EEForTrack(t,e)}_onMediaSessionStarted(e){const t=this.conference.getLocalTracks();for(const n of t)this._setupSenderE2EEForTrack(e,n)}_onOlmIdKeyReady(e){m.debug("Olm id key ready: "+e),this.conference.setLocalParticipantProperty("e2ee.idKey",e)}_onParticipantJoined(){this._conferenceJoined&&this._enabled&&this._ratchetKey()}_onParticipantLeft(e){this._e2eeCtx.cleanup(e),this._enabled&&this._rotateKey()}_onParticipantE2EEChannelReady(e){m.debug(`E2EE channel with participant ${e} is ready`)}_onParticipantKeyUpdated(e,t,n){m.debug(`Participant ${e} updated their key`),this._e2eeCtx.setKey(e,t,n)}async _onParticipantPropertyChanged(e,t,n,i){switch(t){case"e2ee.idKey":m.debug(`Participant ${e.getId()} updated their id key: ${i}`);break;case"e2ee.enabled":!i&&this._enabled&&(this._olmAdapter.clearParticipantSession(e),this._rotateKey())}}async _ratchetKeyImpl(){m.debug("Ratchetting key");const e=await Object(p.a)(this._key),t=await Object(p.b)(e);this._key=new Uint8Array(t);const n=this._olmAdapter.updateCurrentKey(this._key);this._e2eeCtx.setKey(this.conference.myUserId(),this._key,n)}async _rotateKeyImpl(){m.debug("Rotating key"),this._key=this._generateKey();const e=await this._olmAdapter.updateKey(this._key);this._e2eeCtx.setKey(this.conference.myUserId(),this._key,e)}_setupReceiverE2EEForTrack(e,t){if(!this._enabled)return;const n=e.findReceiverForTrack(t.track);n?this._e2eeCtx.handleReceiver(n,t.getType(),t.getParticipantId()):m.warn(`Could not handle E2EE for ${t}: receiver not found in: ${e}`)}_setupSenderE2EEForTrack(e,t){if(!this._enabled)return;const n=e.peerconnection,i=n&&n.findSenderForTrack(t.track);i?this._e2eeCtx.handleSender(i,t.getType(),t.getParticipantId()):m.warn(`Could not handle E2EE for ${t}: sender not found in ${n}`)}_trackMuteChanged(e){if(d.a.doesVideoMuteByStreamRemove()&&e.isLocal()&&e.isVideoTrack()&&!e.isMuted())for(const t of this.conference._getMediaSessions())this._setupSenderE2EEForTrack(t,e)}}}).call(this,"modules/e2ee/E2EEncryption.js")},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return I}));var i=n(5),r=n(2),s=n(20),o=n(10),a=n.n(o),c=n(8),d=n(0),u=n.n(d),l=n(36),h=n(18),p=n(60),m=n(9),f=n(6),g=n(110),_=n(12),v=n.n(_),S=n(112),y=n(3),E=n(113),b=n(34),C=n(65),T=n(114),R=n(41);const A=Object(i.getLogger)(e);class I extends E.a{static parseVideoSenders(e){const t=e.find('>content[name="video"]');if(t.length){const e=t[0].getAttribute("senders");if("both"===e||"initiator"===e||"responder"===e||"none"===e)return e}return null}static parseMaxFrameHeight(e){const t=e.find('>content[name="video"]>max-frame-height');return t.length?Number(t.text()):null}constructor(e,t,n,i,r,s,o,a){super(e,t,n,i,r,s,a),this._bridgeSessionId=null,this._cachedOldLocalSdp=void 0,this._cachedNewLocalSdp=void 0,this._iceCheckingStartedTimestamp=null,this._gatheringStartedTimestamp=null,this.localRecvMaxFrameHeight=void 0,this._localVideoActive=!0,this._remoteVideoActive=!0,this._gatheringReported=!1,this.lasticecandidate=!1,this.closed=!1,this.isP2P=o,this.remoteRecvMaxFrameHeight=void 0,this.signalingLayer=new T.a,this.modificationQueue=new g.a,this.wasConnected=!1,this.establishmentDuration=void 0,this._xmppListeners=[],this._xmppListeners.push(i.addEventListener(R.a.Events.CONN_STATUS_CHANGED,this.onXmppStatusChanged.bind(this))),this._removeSenderVideoConstraintsChangeListener=void 0}_assertNotEnded(){return this.state!==b.b}doInitialize(e){var t,n,i;this.failICE=Boolean(e.failICE),this.lasticecandidate=!1,this.options=e,this.isReconnect=!1,this.wasstable=!1,this.webrtcIceUdpDisable=Boolean(e.webrtcIceUdpDisable),this.webrtcIceTcpDisable=Boolean(e.webrtcIceTcpDisable);const r={disableRtx:e.disableRtx};if(e.gatherStats&&(r.maxstats=300),r.capScreenshareBitrate=!1,r.enableInsertableStreams=e.enableInsertableStreams,r.videoQuality=e.videoQuality,r.forceTurnRelay=e.forceTurnRelay,r.audioQuality=e.audioQuality,r.usesUnifiedPlan=this.usesUnifiedPlan=y.a.supportsUnifiedPlan()&&(y.a.isFirefox()||y.a.isWebKitBased()||(y.a.isChromiumBased()&&this.isP2P?null===(t=null===(n=e.p2p)||void 0===n?void 0:n.enableUnifiedOnChrome)||void 0===t||t:null===(i=e.enableUnifiedOnChrome)||void 0===i||i)),this.isP2P){r.disableSimulcast=!0;const t=this._abtestSuspendVideoEnabled(e);void 0!==t&&(r.abtestSuspendVideo=t)}else{var o,a;r.disableSimulcast=e.disableSimulcast||e.preferH264&&!e.disableH264||e.videoQuality&&e.videoQuality.preferredCodec===s.H264,r.capScreenshareBitrate=r.disableSimulcast||!("number"==typeof(null===(o=e.desktopSharingFrameRate)||void 0===o?void 0:o.max)&&(null===(a=e.desktopSharingFrameRate)||void 0===a?void 0:a.max)>l.a),f.a.analytics.addPermanentProperties({capScreenshareBitrate:r.capScreenshareBitrate})}e.startSilent&&(r.startSilent=!0),this.peerconnection=this.rtc.createPeerConnection(this.signalingLayer,this.iceConfig,this.isP2P,r),this.peerconnection.onicecandidate=e=>{if(!e)return;const t=e.candidate,n=window.performance.now();if(t){null===this._gatheringStartedTimestamp&&(this._gatheringStartedTimestamp=n);let e=t.protocol;if("string"==typeof e)if(e=e.toLowerCase(),"tcp"===e||"ssltcp"===e){if(this.webrtcIceTcpDisable)return}else if("udp"===e&&this.webrtcIceUdpDisable)return}else this._gatheringReported||(f.a.sendAnalytics(c.o,{phase:"gathering",value:n-this._gatheringStartedTimestamp,p2p:this.isP2P,initiator:this.isInitiator}),this._gatheringReported=!0);this.sendIceCandidate(t)},this.peerconnection.onsignalingstatechange=()=>{"stable"===this.peerconnection.signalingState?this.wasstable=!0:"closed"!==this.peerconnection.signalingState&&"closed"!==this.peerconnection.connectionState||this.room.eventEmitter.emit(u.a.SUSPEND_DETECTED,this)},this.peerconnection.oniceconnectionstatechange=()=>{const e=window.performance.now();let t=!1;switch(this.isP2P||(this.room.connectionTimes["ice.state."+this.peerconnection.iceConnectionState]=e),A.log(`(TIME) ICE ${this.peerconnection.iceConnectionState} ${this.isP2P?"P2P":"JVB"}:\t`,e),f.a.sendAnalytics(c.q,{p2p:this.isP2P,state:this.peerconnection.iceConnectionState,signaling_state:this.peerconnection.signalingState,reconnect:this.isReconnect,value:e}),this.room.eventEmitter.emit(u.a.ICE_CONNECTION_STATE_CHANGED,this,this.peerconnection.iceConnectionState),this.peerconnection.iceConnectionState){case"checking":this._iceCheckingStartedTimestamp=e;break;case"connected":if("stable"===this.peerconnection.signalingState){t=!0;const e=!this.options.enableIceRestart&&this.room.supportsRestartByTerminate();(this.isReconnect||e)&&this.room.eventEmitter.emit(u.a.CONNECTION_RESTORED,this)}if(!this.wasConnected&&(this.wasstable||t||this.usesUnifiedPlan&&this.isInitiator&&y.a.isChromiumBased())){f.a.sendAnalytics(c.o,{phase:"checking",value:e-this._iceCheckingStartedTimestamp,p2p:this.isP2P,initiator:this.isInitiator});const t=Math.min(this._iceCheckingStartedTimestamp,this._gatheringStartedTimestamp);this.establishmentDuration=e-t,f.a.sendAnalytics(c.o,{phase:"establishment",value:this.establishmentDuration,p2p:this.isP2P,initiator:this.isInitiator}),this.wasConnected=!0,this.room.eventEmitter.emit(u.a.CONNECTION_ESTABLISHED,this)}this.isReconnect=!1;break;case"disconnected":this.isReconnect=!0,this.wasstable&&this.room.eventEmitter.emit(u.a.CONNECTION_INTERRUPTED,this);break;case"failed":this.room.eventEmitter.emit(u.a.CONNECTION_ICE_FAILED,this)}},this.peerconnection.onconnectionstatechange=()=>{const e=this.peerconnection.iceConnectionState;switch(this.peerconnection.connectionState){case"failed":"disconnected"===e&&this.room.eventEmitter.emit(u.a.CONNECTION_ICE_FAILED,this)}},this.peerconnection.onnegotiationneeded=()=>{const e=this.peerconnection.signalingState,t=this.peerconnection.remoteDescription;if(this.usesUnifiedPlan&&"stable"===e&&t&&"string"==typeof t.sdp){A.debug(`${this} onnegotiationneeded fired on ${this.peerconnection} in state: ${e}`);const t=e=>{const t=new h.a(this.peerconnection.localDescription.sdp);this._renegotiate().then(()=>{const n=new h.a(this.peerconnection.localDescription.sdp);this.notifyMySSRCUpdate(t,n),e()},e)};this.modificationQueue.push(t,e=>{e?A.error(this+" onnegotiationneeded error",e):A.debug(this+" onnegotiationneeded executed - OK")})}},this.signalingLayer.setChatRoom(this.room)}getRemoteRecvMaxFrameHeight(){if(this.isP2P)return this.remoteRecvMaxFrameHeight}sendIceCandidate(e){const t=new h.a(this.peerconnection.localDescription.sdp);if(e&&e.candidate.length&&!this.lasticecandidate){const n=m.a.iceparams(t.media[e.sdpMLineIndex],t.session),i=m.a.candidateToJingle(e.candidate);if(!n||!i){const e="failed to get ice && jcand";return v.a.callErrorHandler(new Error(e)),void A.error(e)}n.xmlns="urn:xmpp:jingle:transports:ice-udp:1",this.usedrip?(0===this.dripContainer.length&&setTimeout(()=>{0!==this.dripContainer.length&&(this.sendIceCandidates(this.dripContainer),this.dripContainer=[])},150),this.dripContainer.push(e)):this.sendIceCandidates([e])}else A.log(this+" sendIceCandidate: last candidate"),this.lasticecandidate=!0}sendIceCandidates(e){if(!this._assertNotEnded("sendIceCandidates"))return;A.log(`${this} sendIceCandidates ${JSON.stringify(e)}`);const t=Object(r.$iq)({to:this.remoteJid,type:"set"}).c("jingle",{xmlns:"urn:xmpp:jingle:1",action:"transport-info",initiator:this.initiatorJid,sid:this.sid}),n=new h.a(this.peerconnection.localDescription.sdp);for(let i=0;i<n.media.length;i++){const r=e.filter(e=>e.sdpMLineIndex===i),s=m.a.parseMLine(n.media[i].split("\r\n")[0]);if(r.length>0){const e=m.a.iceparams(n.media[i],n.session);e.xmlns="urn:xmpp:jingle:transports:ice-udp:1",t.c("content",{creator:this.initiatorJid===this.localJid?"initiator":"responder",name:r[0].sdpMid?r[0].sdpMid:s.media}).c("transport",e);for(let e=0;e<r.length;e++){const n=m.a.candidateToJingle(r[e].candidate);this.failICE&&(n.ip="1.1.1.1"),t.c("candidate",n).up()}const o=m.a.findLine(n.media[i],"a=fingerprint:",n.session);if(o){const e=m.a.parseFingerprint(o);e.required=!0,t.c("fingerprint",{xmlns:"urn:xmpp:jingle:apps:dtls:0"}).t(e.fingerprint),delete e.fingerprint,t.attrs(e),t.up()}t.up(),t.up()}}this.connection.sendIQ(t,null,this.newJingleErrorHandler(t),1e4)}sendIceFailedNotification(){const e=Object(r.$iq)({to:this.remoteJid,type:"set"}).c("jingle",{xmlns:"urn:xmpp:jingle:1",action:"session-info",initiator:this.initiatorJid,sid:this.sid}).c("ice-state",{xmlns:"http://jitsi.org/protocol/focus"}).t("failed").up();this._bridgeSessionId&&e.c("bridge-session",{xmlns:"http://jitsi.org/protocol/focus",id:this._bridgeSessionId}),this.connection.sendIQ2(e,{timeout:65}).catch(this.newJingleErrorHandler(e))}addIceCandidates(e){if("closed"===this.peerconnection.signalingState)return void A.warn(this+" Ignored add ICE candidate when in closed state");const t=[];if(e.find(">content>transport>candidate").each((e,n)=>{let i=m.a.candidateFromJingle(n);i=i.replace("\r\n","").replace("a=","");const r=new RTCIceCandidate({sdpMLineIndex:0,sdpMid:"",candidate:i});t.push(r)}),!t.length)return void A.error(this+" No ICE candidates to add ?",e[0]&&e[0].outerHTML);A.debug(`${this} Queued add (${t.length}) ICE candidates task`),this.modificationQueue.push(e=>{for(const e of t)this.peerconnection.addIceCandidate(e).then(()=>A.debug(this+" addIceCandidate ok!"),e=>A.error(this+" addIceCandidate failed!",e));e(),A.debug(this+" ICE candidates task finished")})}readSsrcInfo(e){$(e).find('>description>source[xmlns="urn:xmpp:jingle:apps:rtp:ssma:0"]').each((e,t)=>{const n=Number(t.getAttribute("ssrc"));this.isP2P?this.signalingLayer.setSSRCOwner(n,r.Strophe.getResourceFromJid(this.remoteJid)):$(t).find('>ssrc-info[xmlns="http://jitsi.org/jitmeet"]').each((e,t)=>{const i=t.getAttribute("owner");var s;i&&i.length&&(isNaN(n)||n<0?A.warn(`${this} Invalid SSRC ${n} value received for ${i}`):this.signalingLayer.setSSRCOwner(n,(s=i,r.Strophe.getResourceFromJid(s)||s)))})})}generateRecvonlySsrc(){this.peerconnection?this.peerconnection.generateRecvonlySsrc():A.error(this+" Unable to generate recvonly SSRC - no peerconnection")}getConfiguredVideoCodec(){return this.peerconnection.getConfiguredVideoCodec()}acceptOffer(e,t,n,i){this.setOfferAnswerCycle(e,()=>{this.sendSessionAccept(t,n)},n,i)}invite(e=[]){if(!this.isInitiator)throw new Error("Trying to invite from the responder session");A.debug(this+" Queued invite task"),this.modificationQueue.push(t=>{const n=[];for(const t of e)n.push(this.peerconnection.addTrack(t,this.isInitiator));Promise.all(n).then(()=>this.peerconnection.createOffer(this.mediaConstraints)).then(e=>this.peerconnection.setLocalDescription(e)).then(()=>{this.sendSessionInitiate(this.peerconnection.localDescription.sdp)}).then(()=>t(),e=>t(e))},e=>{e?A.error(this+" invite error",e):A.debug(this+" invite executed - OK")})}sendSessionInitiate(e){let t=Object(r.$iq)({to:this.remoteJid,type:"set"}).c("jingle",{xmlns:"urn:xmpp:jingle:1",action:"session-initiate",initiator:this.initiatorJid,sid:this.sid});new h.a(e).toJingle(t,this.isInitiator?"initiator":"responder"),t=t.tree(),A.debug(this+" Session-initiate: ",t),this.connection.sendIQ(t,()=>{A.info(this+' Got RESULT for "session-initiate"')},e=>{A.error(this+' "session-initiate" error',e)},1e4)}setAnswer(e){if(!this.isInitiator)throw new Error("Trying to set an answer on the responder session");this.setOfferAnswerCycle(e,()=>{if(A.info(this+" setAnswer - succeeded"),this.usesUnifiedPlan&&y.a.isChromiumBased()){const e=this.peerconnection.remoteDescription.sdp,t=new RTCSessionDescription({type:"offer",sdp:e});this._responderRenegotiate(t)}},e=>{A.error(this+" setAnswer failed: ",e)})}setOfferAnswerCycle(e,t,n,i=[]){A.debug(this+" Queued setOfferAnswerCycle task"),this.modificationQueue.push(t=>{const n=[];for(const e of i)n.push(this.peerconnection.addTrack(e,this.isInitiator));const r=this._processNewJingleOfferIq(e),s=this.peerconnection.localDescription.sdp,o=$(e).find('>bridge-session[xmlns="http://jitsi.org/protocol/focus"]').attr("id");o!==this._bridgeSessionId&&(this._bridgeSessionId=o),Promise.all(n).then(()=>this._renegotiate(r.raw)).then(()=>{if(this.state===b.c&&(this.state=b.a,!this.isP2P||this._localVideoActive&&!this.localRecvMaxFrameHeight||this.sendContentModify()),s){const e=new h.a(this.peerconnection.localDescription.sdp);this.notifyMySSRCUpdate(new h.a(s),e)}}).then(()=>t(),e=>t(e))},e=>{e?(A.error(`${this} setOfferAnswerCycle task failed: ${e}`),n(e)):(A.debug(this+" setOfferAnswerCycle task done"),t())})}setVideoCodecs(e=null,t=null){const n=this.peerconnection.getConfiguredVideoCodec();if(this._assertNotEnded()&&e!==n){A.info(`${this} Switching video codec from ${n} to ${e}`),this.peerconnection.setVideoCodecs(e,t);const i=e=>{this._renegotiate().then(()=>(A.debug(this+" setVideoCodecs task is done"),e()),t=>(A.error(`${this} setVideoCodecs task failed: ${t}`),e(t)))};A.debug(this+" Queued setVideoCodecs task"),this.modificationQueue.push(i)}}replaceTransport(e,t,n){if(this.options.enableForcedReload){const e=new h.a(this.peerconnection.localDescription.sdp);return this.sendTransportAccept(e,t,n),void this.room.eventEmitter.emit(u.a.CONNECTION_RESTARTED,this)}this.room.eventEmitter.emit(u.a.ICE_RESTARTING,this);const i=e.clone();e.find(">content[name='data']").attr("senders","rejected"),e.find(">content>description>source").remove(),e.find(">content>description>ssrc-group").remove();const r=e.find(">content>transport>fingerprint");r.attr("hash","sha-1"),r.text("00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00"),this.setOfferAnswerCycle(e,()=>{this.setOfferAnswerCycle(i,()=>{const e=new h.a(this.peerconnection.localDescription.sdp);this.sendTransportAccept(e,t,n),this.room.eventEmitter.emit(u.a.ICE_RESTART_SUCCESS,this,i)},n)},n)}sendSessionAccept(e,t){const n=new h.a(this.peerconnection.localDescription.sdp),i=Object(r.$iq)({to:this.remoteJid,type:"set"}).c("jingle",{xmlns:"urn:xmpp:jingle:1",action:"session-accept",initiator:this.initiatorJid,responder:this.responderJid,sid:this.sid});this.webrtcIceTcpDisable&&(n.removeTcpCandidates=!0),this.webrtcIceUdpDisable&&(n.removeUdpCandidates=!0),this.failICE&&(n.failICE=!0),n.toJingle(i,this.initiatorJid===this.localJid?"initiator":"responder"),A.info(this+" Sending session-accept"),A.debug(i.tree()),this.connection.sendIQ(i,e,this.newJingleErrorHandler(i,e=>{t(e),this.room.eventEmitter.emit(u.a.SESSION_ACCEPT_TIMEOUT,this)}),1e4)}sendContentModify(){const e=this.localRecvMaxFrameHeight,t=this._localVideoActive?"both":"none";let n=Object(r.$iq)({to:this.remoteJid,type:"set"}).c("jingle",{xmlns:"urn:xmpp:jingle:1",action:"content-modify",initiator:this.initiatorJid,sid:this.sid}).c("content",{name:"video",senders:t});void 0!==e&&(n=n.c("max-frame-height",{xmlns:"http://jitsi.org/jitmeet/video"}).t(e)),A.info(`${this} sending content-modify, video senders: ${t}, max frame height: ${e}`),A.debug(n.tree()),this.connection.sendIQ(n,null,this.newJingleErrorHandler(n),1e4)}setReceiverVideoConstraint(e){A.info(`${this} setReceiverVideoConstraint - max frame height: ${e}`),this.localRecvMaxFrameHeight=e,this.isP2P?this.state===b.a&&this.sendContentModify():this.rtc.setReceiverVideoConstraint(e)}sendTransportAccept(e,t,n){const i=Object(r.$iq)({to:this.remoteJid,type:"set"}).c("jingle",{xmlns:"urn:xmpp:jingle:1",action:"transport-accept",initiator:this.initiatorJid,sid:this.sid});e.media.forEach((t,n)=>{const r=m.a.parseMLine(t.split("\r\n")[0]);i.c("content",{creator:this.initiatorJid===this.localJid?"initiator":"responder",name:r.media}),e.transportToJingle(n,i),i.up()}),A.info(this+" Sending transport-accept"),A.debug(i.tree()),this.connection.sendIQ(i,t,this.newJingleErrorHandler(i,n),1e4)}sendTransportReject(e,t){const n=Object(r.$iq)({to:this.remoteJid,type:"set"}).c("jingle",{xmlns:"urn:xmpp:jingle:1",action:"transport-reject",initiator:this.initiatorJid,sid:this.sid});A.info(this+" Sending 'transport-reject'"),A.debug(n.tree()),this.connection.sendIQ(n,e,this.newJingleErrorHandler(n,t),1e4)}setSenderMaxBitrates(){return this._assertNotEnded()?this.peerconnection.setMaxBitRate():Promise.resolve()}setSenderVideoConstraint(e){if(this._assertNotEnded()){if(A.info(`${this} setSenderVideoConstraint: ${e}`),!this.isP2P&&y.a.isReactNative()&&void 0!==e){const t=e>0;return this.setMediaTransferActive(!0,t)}return this.peerconnection.setSenderVideoConstraint(e)}return Promise.resolve()}setSenderVideoDegradationPreference(){return this._assertNotEnded()?this.peerconnection.setSenderVideoDegradationPreference():Promise.resolve()}terminate(e,t,n){if(this.state!==b.b){if(!n||Boolean(n.sendSessionTerminate)){const i=Object(r.$iq)({to:this.remoteJid,type:"set"}).c("jingle",{xmlns:"urn:xmpp:jingle:1",action:"session-terminate",initiator:this.initiatorJid,sid:this.sid}).c("reason").c(n&&n.reason||"success").up();n&&n.reasonDescription?i.c("text").t(n.reasonDescription).up().up():i.up(),this._bridgeSessionId&&i.c("bridge-session",{xmlns:"http://jitsi.org/protocol/focus",id:this._bridgeSessionId,restart:n&&!0===n.requestRestart}).up(),A.info(this+" Sending session-terminate"),A.debug(i.tree()),this.connection.sendIQ(i,e,this.newJingleErrorHandler(i,t),1e4)}else A.info(this+" Skipped sending session-terminate");this.connection.jingle.terminate(this.sid)}}onTerminated(e,t){A.info(this+" Session terminated",e,t),this._xmppListeners.forEach(e=>e()),this._xmppListeners=[],this._removeSenderVideoConstraintsChangeListener&&this._removeSenderVideoConstraintsChangeListener(),this.close()}onXmppStatusChanged(e){e===R.a.Status.CONNECTED&&this._cachedOldLocalSdp&&(A.info(this+" Sending SSRC update on reconnect"),this.notifyMySSRCUpdate(this._cachedOldLocalSdp,this._cachedNewLocalSdp))}_parseSsrcInfoFromSourceAdd(e,t){const n=[],i=this;return $(e).each((e,r)=>{const s=$(r).attr("name");let o="";$(r).find('ssrc-group[xmlns="urn:xmpp:jingle:apps:rtp:ssma:0"]').each((function(){const e=this.getAttribute("semantics"),t=$(this).find(">source").map((function(){return this.getAttribute("ssrc")})).get();t.length&&(o+=`a=ssrc-group:${e} ${t.join(" ")}\r\n`)}));$(r).find('source[xmlns="urn:xmpp:jingle:apps:rtp:ssma:0"]').each((function(){const e=$(this).attr("ssrc");t.containsSSRC(e)?(!i.usesUnifiedPlan||!i.isP2P)&&A.warn(`${i} Source-add request for existing SSRC: ${e}`):$(this).find(">parameter").each((function(){o+=`a=ssrc:${e} ${$(this).attr("name")}`,$(this).attr("value")&&$(this).attr("value").length&&(o+=":"+$(this).attr("value")),o+="\r\n"}))})),t.media.forEach((e,t)=>{m.a.findLine(e,"a=mid:"+s)&&(n[t]||(n[t]=""),n[t]+=o)})}),n}addRemoteStream(e){this._addOrRemoveRemoteStream(!0,e)}removeRemoteStream(e){this._addOrRemoveRemoteStream(!1,e)}removeRemoteStreamsOnLeave(e){let t=[];const n=n=>{const i=this.peerconnection.getRemoteSourceInfoByParticipant(e);if(i.length){const r=new h.a(this.peerconnection.localDescription.sdp),s=this._processRemoteRemoveSource(i);t=this.peerconnection.removeRemoteTracks(e),this._renegotiate(s.raw).then(()=>{const e=new h.a(this.peerconnection.localDescription.sdp);this.notifyMySSRCUpdate(r,e),n()}).catch(e=>n(e))}else n()};return new Promise((i,r)=>{A.debug(`${this} Queued removeRemoteStreamsOnLeave task for participant ${e}`),this.modificationQueue.push(n,e=>{e?(A.error(this+" removeRemoteStreamsOnLeave error:",e),r(e)):(A.info(this+" removeRemoteStreamsOnLeave done!"),i(t))})})}_addOrRemoveRemoteStream(e,t){const n=e?"addRemoteStream":"removeRemoteStream";e&&this.readSsrcInfo(t);A.debug(`${this} Queued ${n} task`),this.modificationQueue.push(i=>{if(!this.peerconnection.localDescription||!this.peerconnection.localDescription.sdp){const e=n+" - localDescription not ready yet";return A.error(e),void i(e)}A.log(`${this} Processing ${n}`);const r=new h.a(this.peerconnection.localDescription.sdp),s=new h.a(this.peerconnection.remoteDescription.sdp),o=e?this._parseSsrcInfoFromSourceAdd(t,s):this._parseSsrcInfoFromSourceRemove(t,s),a=e?this._processRemoteAddSource(o):this._processRemoteRemoveSource(o),c=new RTCSessionDescription({type:"offer",sdp:a.raw});(e&&this.usesUnifiedPlan&&this.isP2P&&y.a.isChromiumBased()?this._responderRenegotiate(c):this._renegotiate(a.raw)).then(()=>{const e=new h.a(this.peerconnection.localDescription.sdp);A.log(`${this} ${n} - OK`),this.notifyMySSRCUpdate(r,e),i()},e=>{A.error(`${this} ${n} failed:`,e),i(e)})})}_processNewJingleOfferIq(e){const t=new h.a("");return this.webrtcIceTcpDisable&&(t.removeTcpCandidates=!0),this.webrtcIceUdpDisable&&(t.removeUdpCandidates=!0),this.failICE&&(t.failICE=!0),t.fromJingle(e),this.readSsrcInfo($(e).find(">content")),t}_processRemoteRemoveSource(e){const t=this.usesUnifiedPlan?new h.a(this.peerconnection.peerconnection.remoteDescription.sdp):new h.a(this.peerconnection.remoteDescription.sdp);return e.forEach((e,n)=>{(e=e.split("\r\n")).pop(),this.usesUnifiedPlan?e.forEach(e=>{const n=t.media.findIndex(t=>t.includes(e));if(n>-1)if((!this.usesUnifiedPlan||this.usesUnifiedPlan&&!this.isP2P)&&(t.media[n]=t.media[n].replace(e+"\r\n","")),this.isP2P){var i;const e=null===(i=m.a.parseMLine(t.media[n].split("\r\n")[0]))||void 0===i?void 0:i.media,r=this.peerconnection.getDesiredMediaDirection(e,!1);[a.a.SENDRECV,a.a.SENDONLY].forEach(e=>{t.media[n]=t.media[n].replace("a="+e,"a="+r)})}else t.media[n]=t.media[n].replace("a="+a.a.SENDONLY,"a="+a.a.INACTIVE)}):e.forEach(e=>{t.media[n]=t.media[n].replace(e+"\r\n","")})}),t.raw=t.session+t.media.join(""),t}_processRemoteAddSource(e){const t=new h.a(this.peerconnection.remoteDescription.sdp);return e.forEach((e,n)=>{if(t.media[n]+=e,this.isP2P&&this.usesUnifiedPlan){var i;const e=null===(i=m.a.parseMLine(t.media[n].split("\r\n")[0]))||void 0===i?void 0:i.media,r=this.peerconnection.getDesiredMediaDirection(e,!0);[a.a.RECVONLY,a.a.INACTIVE].forEach(e=>{t.media[n]=t.media[n].replace("a="+e,"a="+r)})}}),t.raw=t.session+t.media.join(""),t}_renegotiate(e){if("closed"===this.peerconnection.signalingState){const e=new Error("Attempted to renegotiate in state closed");return this.room.eventEmitter.emit(u.a.RENEGOTIATION_FAILED,e,this),Promise.reject(e)}const t=e||this.peerconnection.remoteDescription.sdp;if(!t){const e=new Error("Can not renegotiate without remote description, current state: "+this.state);return this.room.eventEmitter.emit(u.a.RENEGOTIATION_FAILED,e,this),Promise.reject(e)}const n=new RTCSessionDescription({type:this.isInitiator?"answer":"offer",sdp:t});return this.isInitiator?this._initiatorRenegotiate(n):this._responderRenegotiate(n)}_responderRenegotiate(e){return A.debug(this+" Renegotiate: setting remote description"),this.peerconnection.setRemoteDescription(e).then(()=>(A.debug(this+" Renegotiate: creating answer"),this.peerconnection.createAnswer(this.mediaConstraints).then(e=>(A.debug(this+" Renegotiate: setting local description"),this.peerconnection.setLocalDescription(e)))))}_initiatorRenegotiate(e){return A.debug(this+" Renegotiate: creating offer"),this.peerconnection.createOffer(this.mediaConstraints).then(t=>(A.debug(this+" Renegotiate: setting local description"),this.peerconnection.setLocalDescription(t).then(()=>(A.debug(this+" Renegotiate: setting remote description"),this.peerconnection.setRemoteDescription(e)))))}replaceTrack(e,t){const n=n=>{A.debug(`${this} replaceTrack worker started. oldTrack = ${e}, newTrack = ${t}`);const i=this.peerconnection.localDescription.sdp;this.usesUnifiedPlan||(this.peerconnection.options.capScreenshareBitrate&&e&&t&&t.isVideoTrack()&&this.peerconnection.clearRecvonlySsrc(),!e&&t&&t.isVideoTrack()?this.peerconnection.clearRecvonlySsrc():e&&e.isVideoTrack()&&!t&&(this.peerconnection.clearRecvonlySsrc(),this.peerconnection.generateRecvonlySsrc())),this.peerconnection.replaceTrack(e,t).then(n=>{let r=Promise.resolve();return A.debug(`${this} TPC.replaceTrack finished. shouldRenegotiate = ${n}, JingleSessionState = ${this.state}`),n&&(e||t)&&this.state===b.a&&(r=this._renegotiate().then(()=>{const e=new h.a(this.peerconnection.localDescription.sdp);this.notifyMySSRCUpdate(new h.a(i),e)})),r.then(()=>{if(t&&t.isVideoTrack())return A.debug(this+" replaceTrack worker: configuring video stream"),this.peerconnection.setSenderVideoDegradationPreference().then(()=>this.peerconnection.setSenderVideoConstraint()).then(()=>this.peerconnection.setMaxBitRate())})}).then(()=>n(),e=>n(e))};return new Promise((i,r)=>{A.debug(`${this} Queued replaceTrack task. Old track = ${e}, new track = ${t}`),this.modificationQueue.push(n,e=>{e?(A.error(this+" Replace track error:",e),r(e)):(A.info(this+" Replace track done!"),i())})})}_parseSsrcInfoFromSourceRemove(e,t){const n=[];return $(e).each((e,i)=>{const r=$(i).attr("name");let s="";$(i).find('ssrc-group[xmlns="urn:xmpp:jingle:apps:rtp:ssma:0"]').each((function(){const e=this.getAttribute("semantics"),t=$(this).find(">source").map((function(){return this.getAttribute("ssrc")})).get();t.length&&(s+=`a=ssrc-group:${e} ${t.join(" ")}\r\n`)}));const o=[];$(i).find('source[xmlns="urn:xmpp:jingle:apps:rtp:ssma:0"]').each((function(){const e=$(this).attr("ssrc");o.push(e)})),t.media.forEach((e,t)=>{m.a.findLine(e,"a=mid:"+r)&&(n[t]||(n[t]=""),o.forEach(i=>{const r=m.a.findLines(e,"a=ssrc:"+i);r.length&&(n[t]+=r.join("\r\n")+"\r\n")}),n[t]+=s)})}),n}_verifyNoSSRCChanged(e,t){const n=new h.a(this.peerconnection.localDescription.sdp);let i=new p.a(t,n);const r=i.getNewMedia();if(Object.keys(r).length)return A.error(`${this} - some SSRC were added on ${e}`,r),!1;i=new p.a(n,t);const s=i.getNewMedia();return!Object.keys(s).length||(A.error(`${this} - some SSRCs were removed on ${e}`,s),!1)}addTrackAsUnmute(e){return this._addRemoveTrackAsMuteUnmute(!1,e).then(()=>{if(e.isVideoTrack()&&y.a.doesVideoMuteByStreamRemove())return this.setSenderMaxBitrates().then(()=>this.setSenderVideoDegradationPreference()).then(()=>this.setSenderVideoConstraint())})}removeTrackAsMute(e){return this._addRemoveTrackAsMuteUnmute(!0,e)}_addRemoveTrackAsMuteUnmute(e,t){if(!t)return Promise.reject('invalid "track" argument value');const n=e?"removeTrackMute":"addTrackUnmute",i=i=>{const r=this.peerconnection;if(!r)return void i(`Error: tried ${n} track with no active peerconnection`);const s=r.localDescription.sdp;(e?r.removeTrackMute(t):r.addTrackUnmute(t)).then(e=>{e&&s&&r.remoteDescription.sdp?this._renegotiate().then(()=>{this._verifyNoSSRCChanged(n,new h.a(s)),i()}):i()},i)};return A.debug(`${this} Queued ${n} task`),new Promise((e,t)=>{this.modificationQueue.push(i,i=>{i?(A.error(`${this} ${n} failed`),t(i)):(A.debug(`${this} ${n} done`),e())})})}setMediaTransferActive(e,t){if(!this.peerconnection)return Promise.reject('Can not modify transfer active state, before "initialize" is called');const n=e?"audio active":"audio inactive",i=t?"video active":"video inactive";A.info(`${this} Queued make ${i}, ${n} task`);const r=n=>{const i=this.state===b.a,r=this.peerconnection.setAudioTransferActive(e);this._localVideoActive!==t&&(this._localVideoActive=t,this.isP2P&&i&&this.sendContentModify());const s=this.peerconnection.setVideoTransferActive(this._localVideoActive&&this._remoteVideoActive);i&&(r||s)?this._renegotiate().then(n,n):n()};return new Promise((e,t)=>{this.modificationQueue.push(r,r=>{r?(A.error(`${this} Make ${i}, ${n} task failed!`),t(r)):(A.debug(`${this} Make ${i}, ${n} task done!`),e())})})}modifyContents(e){const t=I.parseVideoSenders(e),n=I.parseMaxFrameHeight(e);if(n&&(A.info(`${this} received remote max frame height: ${n}`),this.remoteRecvMaxFrameHeight=n,this.eventEmitter.emit(C.a.REMOTE_VIDEO_CONSTRAINTS_CHANGED,this)),null===t)return void A.error(this+' - failed to parse video "senders" attribute in"content-modify" action');A.debug(`${this} queued "content-modify" task(video senders="${t}")`),this.modificationQueue.push(e=>{this._assertNotEnded("content-modify")&&this._modifyRemoteVideoActive(t)?this._renegotiate().then(e,e):e()},e=>{e?A.error(this+' "content-modify" failed',e):A.debug(`${this} "content-modify" task(video senders="${t}") done`)})}_modifyRemoteVideoActive(e){const t="both"===e||"initiator"===e&&this.isInitiator||"responder"===e&&!this.isInitiator;return t!==this._remoteVideoActive&&(A.debug(`${this} new remote video active: ${t}`),this._remoteVideoActive=t),this.peerconnection.setVideoTransferActive(this._localVideoActive&&this._remoteVideoActive)}notifyMySSRCUpdate(e,t){if(this.state!==b.a)return void A.warn(`${this} Skipping SSRC update in '${this.state} ' state.`);if(!this.connection.connected)return this._cachedOldLocalSdp||(this._cachedOldLocalSdp=e),this._cachedNewLocalSdp=t,void A.warn(this+" Not sending SSRC update while the signaling is disconnected");this._cachedOldLocalSdp=void 0,this._cachedNewLocalSdp=void 0;let n=new p.a(t,e);const i=Object(r.$iq)({to:this.remoteJid,type:"set"}).c("jingle",{xmlns:"urn:xmpp:jingle:1",action:"source-remove",initiator:this.initiatorJid,sid:this.sid});n.toJingle(i)&&(A.info(this+" Sending source-remove"),A.debug(i.tree()),this.connection.sendIQ(i,null,this.newJingleErrorHandler(i),1e4)),n=new p.a(e,t);const s=Object(r.$iq)({to:this.remoteJid,type:"set"}).c("jingle",{xmlns:"urn:xmpp:jingle:1",action:"source-add",initiator:this.initiatorJid,sid:this.sid});n.toJingle(s)&&(A.info(this+" Sending source-add"),A.debug(s.tree()),this.connection.sendIQ(s,null,this.newJingleErrorHandler(s),1e4))}newJingleErrorHandler(e,t){return e=>{const n={},i=$(e).find("error");if(i.length){n.code=i.attr("code");const t=$(e).find("error :first");t.length&&(n.reason=t[0].tagName);const r=i.find(">text");r.length&&(n.msg=r.text())}e||(n.reason="timeout"),n.session=this.toString(),t?t(n):this.state===b.b&&"item-not-found"===n.reason?A.debug(`${this} Jingle error: ${JSON.stringify(n)}`):v.a.callErrorHandler(new Error("Jingle error: "+JSON.stringify(n)))}}getIceConnectionState(){return this.peerconnection.getConnectionState()}close(){this.state=b.b,this.establishmentDuration=void 0,this.peerconnection&&(this.peerconnection.onicecandidate=null,this.peerconnection.oniceconnectionstatechange=null,this.peerconnection.onnegotiationneeded=null,this.peerconnection.onsignalingstatechange=null),A.debug(this+" Clearing modificationQueue"),this.modificationQueue.clear(),A.debug(this+" Queued PC close task"),this.modificationQueue.push(e=>{this.signalingLayer.setChatRoom(null),this.peerconnection&&this.peerconnection.close(),e(),A.debug(this+" PC close task done!")}),A.debug(this+" Shutdown modificationQueue!"),this.modificationQueue.shutdown()}toString(){return`JingleSessionPC[session=${this.isP2P?"P2P":"JVB"},initiator=${this.isInitiator},sid=${this.sid}]`}_abtestSuspendVideoEnabled({abTesting:e}){if(!e||!e.enableSuspendVideoTest)return;const t=this._getInitiatorJid();return Object(S.integerHash)(t)%2==0}}}).call(this,"modules/xmpp/JingleSessionPC.js")},function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return f}));n(74);var i=n(91),r=n.n(i);const s={Chrome:"chrome",Chromium:"chrome",Opera:"opera",Firefox:"firefox","Internet Explorer":"iexplorer",Safari:"safari"};function o(){const e=navigator.userAgent;if(e.match(/Electron/)){return{name:"electron",version:e.match(/Electron\/([\d.]+)/)[1]}}}function a(){const e=navigator.userAgent;if(e.match(/JitsiMeetNW/)){return{name:"nwjs",version:e.match(/JitsiMeetNW\/([\d.]+)/)[1]}}}function c(){const e=navigator.userAgent.match(/\b(react[ \t_-]*native)(?:\/(\S+))?/i);let t;if(e||"ReactNative"===navigator.product){let n;return e&&e.length>2&&(n=e[1],t=e[2]),n||(n="react-native"),t||(t="unknown"),{name:"react-native",version:t}}}function d(e){let t;const n=[c,o,a];for(let e=0;e<n.length;e++)if(t=n[e](),t)return t;const i=e.getBrowserName();return i in s?{name:s[i],version:e.getBrowserVersion()}:(t=function(){const e=navigator.userAgent,t={name:"unknown",version:void 0};if(e.match(/Chrome/)&&!e.match(/Edge/))if(e.match(/Edg(A?)/)){const n=e.match(/Chrome\/([\d.]+)/)[1];Number.parseInt(n,10)>72&&(t.name="chrome",t.version=n)}else t.name="chrome",t.version=e.match(/Chrome\/([\d.]+)/)[1];return t}(),t||{name:"unknown",version:void 0})}class u{constructor(e){let t,n;if(this._bowser=r.a.getParser(navigator.userAgent),void 0===e){const e=d(this._bowser);t=e.name,n=e.version}else e.name in s?(t=s[e.name],n=e.version):(t="unknown",n=void 0);this._name=t,this._version=n}getName(){return this._name}isChrome(){return"chrome"===this._name}isOpera(){return"opera"===this._name}isFirefox(){return"firefox"===this._name}isIExplorer(){return"iexplorer"===this._name}isSafari(){return"safari"===this._name}isNWJS(){return"nwjs"===this._name}isElectron(){return"electron"===this._name}isReactNative(){return"react-native"===this._name}getVersion(){return this._version}_checkCondition(e){if(this._version)return this._bowser.satisfies(e)}isVersionGreaterThan(e){return this._checkCondition({[this._name]:">"+e})}isVersionLessThan(e){return this._checkCondition({[this._name]:"<"+e})}isVersionEqualTo(e){return this._checkCondition({[this._name]:"~"+e})}}var l=n(19),h=n.n(l);class p extends h.a{constructor(...e){var t,n,i;super(...e),i={},(n="_storage")in(t=this)?Object.defineProperty(t,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[n]=i}clear(){this._storage={}}get length(){return Object.keys(this._storage).length}getItem(e){return this._storage[e]}setItem(e,t){this._storage[e]=t}removeItem(e){delete this._storage[e]}key(e){const t=Object.keys(this._storage);if(!(t.length<=e))return t[e]}serialize(){return JSON.stringify(this._storage)}}class m extends h.a{constructor(){super();try{this._storage=window.localStorage,this._localStorageDisabled=!1}catch(e){}this._storage||(console.warn("Local storage is disabled."),this._storage=new p,this._localStorageDisabled=!0)}isLocalStorageDisabled(){return this._localStorageDisabled}clear(){this._storage.clear(),this.emit("changed")}get length(){return this._storage.length}getItem(e){return this._storage.getItem(e)}setItem(e,t,n=!1){this._storage.setItem(e,t),n||this.emit("changed")}removeItem(e){this._storage.removeItem(e),this.emit("changed")}key(e){return this._storage.key(e)}serialize(){if(this.isLocalStorageDisabled)return this._storage.serialize();const e=this._storage.length,t={};for(let n=0;n<e;n++){const e=this._storage.key(n);t[e]=this._storage.getItem(e)}return JSON.stringify(t)}}const f=new m},function(e,t,n){"use strict";t.byteLength=function(e){var t=d(e),n=t[0],i=t[1];return 3*(n+i)/4-i},t.toByteArray=function(e){var t,n,i=d(e),o=i[0],a=i[1],c=new s(function(e,t,n){return 3*(t+n)/4-n}(0,o,a)),u=0,l=a>0?o-4:o;for(n=0;n<l;n+=4)t=r[e.charCodeAt(n)]<<18|r[e.charCodeAt(n+1)]<<12|r[e.charCodeAt(n+2)]<<6|r[e.charCodeAt(n+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=255&t;2===a&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,c[u++]=255&t);1===a&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t);return c},t.fromByteArray=function(e){for(var t,n=e.length,r=n%3,s=[],o=0,a=n-r;o<a;o+=16383)s.push(u(e,o,o+16383>a?a:o+16383));1===r?(t=e[n-1],s.push(i[t>>2]+i[t<<4&63]+"==")):2===r&&(t=(e[n-2]<<8)+e[n-1],s.push(i[t>>10]+i[t>>4&63]+i[t<<2&63]+"="));return s.join("")};for(var i=[],r=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,c=o.length;a<c;++a)i[a]=o[a],r[o.charCodeAt(a)]=a;function d(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function u(e,t,n){for(var r,s,o=[],a=t;a<n;a+=3)r=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),o.push(i[(s=r)>>18&63]+i[s>>12&63]+i[s>>6&63]+i[63&s]);return o.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var i=n(9);function r(e,t){if(!t)return!1;if(e.length!==t.length)return!1;for(let n=0,i=e.length;n<i;n++)if(e[n]instanceof Array&&t[n]instanceof Array){if(!e[n].equals(t[n]))return!1}else if(e[n]!==t[n])return!1;return!0}function s(e,t){if(this.mySDP=e,this.otherSDP=t,!e)throw new Error('"mySDP" is undefined!');if(!t)throw new Error('"otherSDP" is undefined!')}s.prototype.getNewMedia=function(){const e=this.mySDP.getMediaSsrcMap(),t=this.otherSDP.getMediaSsrcMap(),n={};return Object.keys(t).forEach(i=>{const s=e[i],o=t[i];s||!o?(Object.keys(o.ssrcs).forEach(e=>{if(-1===Object.keys(s.ssrcs).indexOf(e))n[i]||(n[i]={mediaindex:o.mediaindex,mid:o.mid,ssrcs:{},ssrcGroups:[]}),n[i].ssrcs[e]=o.ssrcs[e];else if(o.ssrcs[e].lines&&s.ssrcs[e].lines){void 0!==s.ssrcs[e].lines.find(e=>-1!==e.indexOf("msid"))!==(void 0!==o.ssrcs[e].lines.find(e=>-1!==e.indexOf("msid")))&&(n[i]||(n[i]={mediaindex:o.mediaindex,mid:o.mid,ssrcs:{},ssrcGroups:[]}),n[i].ssrcs[e]=o.ssrcs[e])}}),o.ssrcGroups.forEach(e=>{let t=!1;for(let n=0;n<s.ssrcGroups.length;n++){const i=s.ssrcGroups[n];if(e.semantics===i.semantics&&r(e.ssrcs,i.ssrcs)){t=!0;break}}t||(n[i]||(n[i]={mediaindex:o.mediaindex,mid:o.mid,ssrcs:{},ssrcGroups:[]}),n[i].ssrcGroups.push(e))})):n[i]=o}),n},s.prototype.toJingle=function(e){const t=this.getNewMedia();let n=!1;return Object.keys(t).forEach(r=>{n=!0;const s=t[r];e.c("content",{name:s.mid}),e.c("description",{xmlns:"urn:xmpp:jingle:apps:rtp:1",media:s.mid}),Object.keys(s.ssrcs).forEach(t=>{const n=s.ssrcs[t];e.c("source",{xmlns:"urn:xmpp:jingle:apps:rtp:ssma:0"}),e.attrs({ssrc:n.ssrc}),n.lines.forEach(t=>{const n=t.indexOf(" "),r=t.substr(n+1);if(e.c("parameter"),-1===r.indexOf(":"))e.attrs({name:r});else{const t=r.split(":",2),n=t[0],s=i.a.filterSpecialChars(t[1]);e.attrs({name:n}),e.attrs({value:s})}e.up()}),e.up()}),s.ssrcGroups.forEach(t=>{t.ssrcs.length&&(e.c("ssrc-group",{semantics:t.semantics,xmlns:"urn:xmpp:jingle:apps:rtp:ssma:0"}),t.ssrcs.forEach(t=>{e.c("source",{ssrc:t}).up()}),e.up())}),e.up(),e.up()}),n}},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return l})),n.d(t,"b",(function(){return h}));var i=n(5),r=n(25),s=n.n(r),o=n(10),a=n.n(o),c=n(4),d=n(3);const u=Object(i.getLogger)(e),l=["1","2","3"];class h{constructor(e,t){this.pc=e,this.videoBitrates=t.VP8||t,this.localStreamEncodingsConfig=[{active:!0,maxBitrate:d.a.isFirefox()?this.videoBitrates.high:this.videoBitrates.low,rid:"1",scaleResolutionDownBy:d.a.isFirefox()?1:4},{active:!0,maxBitrate:this.videoBitrates.standard,rid:"2",scaleResolutionDownBy:2},{active:!0,maxBitrate:d.a.isFirefox()?this.videoBitrates.low:this.videoBitrates.high,rid:"3",scaleResolutionDownBy:d.a.isFirefox()?4:1}]}_findTransceiver(e,t=null){let n=null;return!t||t&&d.a.doesVideoMuteByStreamRemove()&&t.isVideoTrack()&&t.isMuted()?n=this.pc.peerconnection.getTransceivers().find(t=>{var n,i;return(null===(n=t.receiver)||void 0===n||null===(i=n.track)||void 0===i?void 0:i.kind)===e}):t&&(n=this.pc.peerconnection.getTransceivers().find(e=>{var n,i;return(null===(n=e.sender)||void 0===n||null===(i=n.track)||void 0===i?void 0:i.id)===t.getTrackId()})),n}_getStreamEncodings(e){return this.pc.isSimulcastOn()&&e.isVideoTrack()?this.localStreamEncodingsConfig:e.isVideoTrack()?[{active:!0,maxBitrate:this.videoBitrates.high}]:[{active:!0}]}ensureCorrectOrderOfSsrcs(e){const t=s.a.parse(e.sdp);return t.media.forEach(e=>{if(e.type===c.a)return;if(!e.ssrcGroups||!e.ssrcGroups.length)return;let t=[];const n=new Set;e.ssrcGroups.map(e=>e.ssrcs.split(" ").filter(Boolean).forEach(e=>n.add(e))),n.forEach(n=>{const i=e.ssrcs.filter(e=>e.id.toString()===n);t=t.concat(i)}),e.ssrcs=t}),new RTCSessionDescription({type:e.type,sdp:s.a.write(t)})}insertUnifiedPlanSimulcastReceive(e){if(d.a.usesSdpMungingForSimulcast())return e;const t=s.a.parse(e.sdp),n=t.media.findIndex(e=>e.type===c.c);if(t.media[n].rids&&(t.media[n].simulcast_03||t.media[n].simulcast))return t.media.forEach((e,i)=>{e.type===c.c&&i!==n&&(t.media[i].rids=void 0,t.media[i].simulcast=void 0,t.media[i].simulcast_03=void 0)}),new RTCSessionDescription({type:e.type,sdp:s.a.write(t)});t.media[n].rids=[{id:"1",direction:"recv"},{id:"2",direction:"recv"},{id:"3",direction:"recv"}];const i=d.a.isFirefox()&&d.a.isVersionGreaterThan(71)?"recv "+l.join(";"):"recv rid="+l.join(";");return t.media[n].simulcast_03={value:i},new RTCSessionDescription({type:e.type,sdp:s.a.write(t)})}addTrack(e,t){const n=e.getTrack();if(t){const t={direction:a.a.SENDRECV,streams:[e.getOriginalStream()],sendEncodings:[]};d.a.isFirefox()||(t.sendEncodings=this._getStreamEncodings(e)),this.pc.peerconnection.addTransceiver(n,t)}else this.pc.peerconnection.addTrack(n)}addTrackUnmute(e){const t=e.getType(),n=e.getTrack(),i=this._findTransceiver(t);return i?(u.debug(`${this.pc} Adding ${e}`),i.sender.replaceTrack(n)):Promise.reject(new Error(`RTCRtpTransceiver for ${t} not found`))}getLocalStreamHeightConstraints(e){if(d.a.isReactNative())return null;const t=[],{height:n=720}=e.getSettings();for(const e of this.localStreamEncodingsConfig)t.push(n/e.scaleResolutionDownBy);return t}removeTrackMute(e){const t=e.getType(),n=this._findTransceiver(t,e);return n?(u.debug(`${this.pc} Removing ${e}`),n.sender.replaceTrack(null)):Promise.reject(new Error(`RTCRtpTransceiver for ${t} not found`))}replaceTrack(e,t){if(e&&t){const n=t.getType(),i=t.getOriginalStream();if(!i)return this.pc.localTracks.delete(e.rtcId),this.pc.localTracks.set(t.rtcId,t),Promise.resolve();const r=this._findTransceiver(n,e),s=t.getTrack();return r?(u.debug(`${this.pc} Replacing ${e} with ${t}`),r.sender.replaceTrack(s).then(()=>{const n=this.pc.localSSRCs.get(e.rtcId);this.pc.localTracks.delete(e.rtcId),this.pc.localSSRCs.delete(e.rtcId),this.pc._addedStreams=this.pc._addedStreams.filter(e=>e!==i),this.pc.localTracks.set(t.rtcId,t),this.pc._addedStreams.push(i),this.pc.localSSRCs.set(t.rtcId,n)})):Promise.reject(new Error("replace track failed"))}return e&&!t?this.removeTrackMute(e).then(()=>{const t=e.getType(),n=this._findTransceiver(t);n&&(n.direction=a.a.RECVONLY),this.pc.localTracks.delete(e.rtcId),this.pc.localSSRCs.delete(e.rtcId)}):t&&!e?this.addTrackUnmute(t).then(()=>{const e=t.getType(),n=this._findTransceiver(e,t);n&&(n.direction=a.a.SENDRECV);return(d.a.usesSdpMungingForSimulcast()?Promise.resolve():this.setEncodings(t)).then(()=>{this.pc.localTracks.set(t.rtcId,t)})}):(u.info(this.pc+" TPCUtils.replaceTrack called with no new track and no old track"),Promise.resolve())}setAudioTransferActive(e){this.setMediaTransferActive(c.a,e)}setEncodings(e){var t,n;const i=e.getType(),r=this._findTransceiver(i,e),s=null==r||null===(t=r.sender)||void 0===t?void 0:t.getParameters();return(null==s||null===(n=s.encodings)||void 0===n?void 0:n.length)?(s.encodings=this._getStreamEncodings(e),r.sender.setParameters(s)):Promise.resolve()}setMediaTransferActive(e,t){const n=this.pc.peerconnection.getTransceivers().filter(t=>t.receiver&&t.receiver.track&&t.receiver.track.kind===e),i=this.pc.getLocalTracks(e);u.info(`${this.pc} ${t?"Enabling":"Suspending"} ${e} media transfer.`),n.forEach((e,n)=>{t?0===n&&i.length?e.direction=a.a.SENDRECV:e.direction=a.a.RECVONLY:e.direction=a.a.INACTIVE})}setVideoTransferActive(e){this.setMediaTransferActive(c.c,e)}updateEncodingsResolution(e){if(!(d.a.isWebKitBased()&&e.encodings&&Array.isArray(e.encodings)))return;var t;(t=e.encodings).every(e=>void 0!==e.scaleResolutionDownBy&&e.scaleResolutionDownBy===t[0].scaleResolutionDownBy)&&e.encodings.forEach((e,t)=>{e.scaleResolutionDownBy=this.localStreamEncodingsConfig[t].scaleResolutionDownBy})}}}).call(this,"modules/RTC/TPCUtils.js")},function(e,t){var n,i,r=e.exports={};function s(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===s||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:s}catch(e){n=s}try{i="function"==typeof clearTimeout?clearTimeout:o}catch(e){i=o}}();var c,d=[],u=!1,l=-1;function h(){u&&c&&(u=!1,c.length?d=c.concat(d):l=-1,d.length&&p())}function p(){if(!u){var e=a(h);u=!0;for(var t=d.length;t;){for(c=d,d=[];++l<t;)c&&c[l].run();l=-1,t=d.length}c=null,u=!1,function(e){if(i===clearTimeout)return clearTimeout(e);if((i===o||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(e);try{i(e)}catch(t){try{return i.call(null,e)}catch(t){return i.call(this,e)}}}(e)}}function m(e,t){this.fun=e,this.array=t}function f(){}r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];d.push(new m(e,t)),1!==d.length||u||a(p)},m.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=f,r.addListener=f,r.once=f,r.off=f,r.removeListener=f,r.removeAllListeners=f,r.emit=f,r.prependListener=f,r.prependOnceListener=f,r.listeners=function(e){return[]},r.binding=function(e){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));window.AudioContext=window.AudioContext||window.webkitAudioContext;let i=null;function r(e,t,n){this.stream=e,this.intervalId=null,this.intervalMilis=t,this.audioLevel=0,this.callback=n}window.AudioContext&&(i=new AudioContext,i.suspend&&i.suspend()),r.prototype.start=function(){if(!r.isLocalStatsSupported())return;i.resume();const e=i.createAnalyser();e.smoothingTimeConstant=.8,e.fftSize=2048;i.createMediaStreamSource(this.stream).connect(e),this.intervalId=setInterval(()=>{const t=new Uint8Array(e.frequencyBinCount);e.getByteTimeDomainData(t);const n=function(e){let t=0;const n=e.length;for(let i=0;i<n;i++)t<e[i]&&(t=e[i]);return parseFloat(((t-127)/128).toFixed(3))}(t);this.audioLevel=function(e,t){let n=0;const i=t-e;return n=i>.2?t-.2:i<-.4?t+.4:e,parseFloat(n.toFixed(3))}(n,this.audioLevel),this.callback(this.audioLevel)},this.intervalMilis)},r.prototype.stop=function(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null)},r.isLocalStatsSupported=function(){return Boolean(i)}},function(e,t,n){"use strict";n.r(t),n.d(t,"ON",(function(){return i})),n.d(t,"OFF",(function(){return r}));const i="on",r="off"},function(e,t,n){"use strict";t.a={REMOTE_VIDEO_CONSTRAINTS_CHANGED:"media_session.REMOTE_VIDEO_CONSTRAINTS_CHANGED"}},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return h}));var i=n(19),r=n.n(i),s=n(5),o=n(16),a=n(4),c=n(3),d=n(11);const u=Object(s.getLogger)(e),l={track_mute:"onmute",track_unmute:"onunmute",track_ended:"onended"};class h extends r.a{constructor(e,t,n,i,r,s){super(),this.addEventListener=this.addListener,this.removeEventListener=this.off=this.removeListener,this.containers=[],this.conference=e,this.audioLevel=-1,this.type=r,this.track=n,this.videoType=s,this.handlers=new Map,this.disposed=!1,this._streamInactiveHandler=i,this._setStream(t)}_addMediaStreamInactiveHandler(e){c.a.isFirefox()?this.track.onended=e:this.stream.oninactive=e}_setHandler(e,t){if(l.hasOwnProperty(e)){if(t?this.handlers.set(e,t):this.handlers.delete(e),this.stream)for(const n of this.stream.getTracks())n[l[e]]=t}else u.error("Invalid handler type "+e)}_unregisterHandlers(){if(this.stream){for(const e of this.handlers.keys())for(const t of this.stream.getVideoTracks())t[l[e]]=void 0;this._streamInactiveHandler&&this._addMediaStreamInactiveHandler(void 0)}else u.warn(this+": unable to unregister handlers - no stream object")}_setStream(e){if(this.stream!==e&&(this.stream=e,this.stream)){for(const e of this.handlers.keys())this._setHandler(e,this.handlers.get(e));this._streamInactiveHandler&&this._addMediaStreamInactiveHandler(this._streamInactiveHandler)}}getVideoType(){return this.videoType}getType(){return this.type}isAudioTrack(){return this.getType()===a.a}isWebRTCTrackMuted(){return this.track&&this.track.muted}isVideoTrack(){return this.getType()===a.c}isLocal(){throw new Error("Not implemented by subclass")}isLocalAudioTrack(){return this.isAudioTrack()&&this.isLocal()}getOriginalStream(){return this.stream}getStreamId(){return this.stream?this.stream.id:null}getTrack(){return this.track}getTrackLabel(){return this.track.label}getTrackId(){return this.track?this.track.id:null}getUsageLabel(){return this.isAudioTrack()?"mic":this.videoType?this.videoType:"default"}_maybeFireTrackAttached(e){this.conference&&e&&this.conference._onTrackAttach(this,e)}attach(e){this.stream&&(this._onTrackAttach(e),d.a.attachMediaStream(e,this.stream)),this.containers.push(e),this._maybeFireTrackAttached(e),this._attachTTFMTracker(e)}detach(e){for(let t=this.containers,n=t.length-1;n>=0;--n){const i=t[n];e||(this._onTrackDetach(i),d.a.attachMediaStream(i,null)),e&&i!==e||t.splice(n,1)}e&&(this._onTrackDetach(e),d.a.attachMediaStream(e,null))}_onTrackAttach(e){}_onTrackDetach(e){}_attachTTFMTracker(e){}dispose(){return this.removeAllListeners(),this.disposed=!0,Promise.resolve()}isScreenSharing(){}getId(){return this.stream?d.a.getStreamID(this.stream):null}isActive(){return void 0===this.stream.active||this.stream.active}setAudioLevel(e,t){let n=e;c.a.supportsReceiverStats()&&void 0!==t&&this.isMuted()&&(n=0),this.audioLevel!==n?(this.audioLevel=n,this.emit(o.TRACK_AUDIO_LEVEL_CHANGED,n,t)):0===this.audioLevel&&0===n&&this.isLocal()&&!this.isWebRTCTrackMuted()&&this.emit(o.NO_AUDIO_INPUT,n)}getMSID(){const e=this.getStreamId(),t=this.getTrackId();return e&&t?`${e} ${t}`:null}setAudioOutput(e){return d.a.isDeviceChangeAvailable("output")?this.isVideoTrack()?Promise.resolve():Promise.all(this.containers.map(t=>t.setSinkId(e).catch(e=>{throw u.warn("Failed to change audio output device on element. Default or previously set audio output device will be used.",t,e),e}))).then(()=>{this.emit(o.TRACK_AUDIO_OUTPUT_CHANGED,e)}):Promise.reject(new Error("Audio output device change is not supported"))}}}).call(this,"modules/RTC/JitsiTrack.js")},function(e,t){e.exports={2160:{width:3840,height:2160},"4k":{width:3840,height:2160},1080:{width:1920,height:1080},fullhd:{width:1920,height:1080},720:{width:1280,height:720},hd:{width:1280,height:720},540:{width:960,height:540},qhd:{width:960,height:540},480:{width:640,height:480},vga:{width:640,height:480},360:{width:640,height:360},240:{width:320,height:240},180:{width:320,height:180}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var i=n(19),r=n.n(i),s=n(13),o=n(69),a=n(23);class c extends r.a{constructor(e,t,n){super(),this._procNodeSampleRate=e,this._vadProcessor=t,this._localTrack=n,this._bufferResidue=new Float32Array([]),this._audioContext=Object(o.a)({sampleRate:t.getRequiredPCMFrequency()}),this._vadSampleSize=t.getSampleLength(),this._onAudioProcess=this._onAudioProcess.bind(this),this._initializeAudioContext()}static create(e,t,n){return s.a.obtainAudioAndVideoPermissions({devices:["audio"],micDeviceId:e}).then(i=>{if(!i[0])throw new Error("Failed to create jitsi local track for device id: "+e);return new c(t,n,i[0])})}_initializeAudioContext(){this._audioSource=this._audioContext.createMediaStreamSource(this._localTrack.stream),this._audioProcessingNode=this._audioContext.createScriptProcessor(this._procNodeSampleRate,1,1)}_onAudioProcess(e){const t=e.inputBuffer.getChannelData(0),n=[...this._bufferResidue,...t],i=Date.now();let r=0;for(;r+this._vadSampleSize<n.length;r+=this._vadSampleSize){const e=n.slice(r,r+this._vadSampleSize),t=this._vadProcessor.calculateAudioFrameVAD(e.slice());this.emit(a.VAD_SCORE_PUBLISHED,{timestamp:i,score:t,pcmData:e,deviceId:this._localTrack.getDeviceId()})}this._bufferResidue=n.slice(r,n.length)}_connectAudioGraph(){this._audioProcessingNode.onaudioprocess=this._onAudioProcess,this._audioSource.connect(this._audioProcessingNode),this._audioProcessingNode.connect(this._audioContext.destination)}_disconnectAudioGraph(){this._audioProcessingNode.onaudioprocess=()=>{},this._audioProcessingNode.disconnect(),this._audioSource.disconnect()}_cleanupResources(){this._disconnectAudioGraph(),this._localTrack.stopStream()}getDeviceId(){return this._localTrack.getDeviceId()}getTrackLabel(){return this._localTrack.getDeviceLabel()}start(){this._connectAudioGraph()}stop(){this._disconnectAudioGraph(),this._bufferResidue=[]}destroy(){this._destroyed||(this._cleanupResources(),this._destroyed=!0)}}},function(e,t,n){"use strict";function i(e){const t=window.AudioContext||window.webkitAudioContext;if(t)return new t(e)}n.d(t,"a",(function(){return i}))},function(e,t,n){"use strict";n.r(t),n.d(t,"E2E_RTT_CHANGED",(function(){return i}));const i="e2eping.e2e_rtt_changed"},function(e,t){e.exports=class{constructor(e,t,n){this._userId=e,this.setDisplayName(t),this._isLocalStats=n||!1,this.setDominantSpeaker(!1),this.totalDominantSpeakerTime=0,this._dominantSpeakerStart=0,this._hasLeft=!1}getUserId(){return this._userId}getDisplayName(){return this.displayName}setDisplayName(e){this.displayName=e}isLocalStats(){return this._isLocalStats}isDominantSpeaker(){return this._dominantSpeakerStart>0}setDominantSpeaker(e){if(!this.isDominantSpeaker()&&e)this._dominantSpeakerStart=Date.now();else if(this.isDominantSpeaker()&&!e){const e=Date.now()-this._dominantSpeakerStart;this.totalDominantSpeakerTime+=e,this._dominantSpeakerStart=0}}getTotalDominantSpeakerTime(){let e=this.totalDominantSpeakerTime;return this.isDominantSpeaker()&&(e+=Date.now()-this._dominantSpeakerStart),e}hasLeft(){return this._hasLeft}markAsHasLeft(){this._hasLeft=!0,this.setDominantSpeaker(!1)}}},function(e,t,n){"use strict";var i=n(19),r=n.n(i),s=n(49),o=n(13),a=n(3),c=n(6),d=n(4),u=n(7),l=n.n(u);function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}t.a=new class{constructor(){this._eventEmitter=new r.a,this._permissions={},o.a.addListener(l.a.DEVICE_LIST_CHANGED,e=>this._eventEmitter.emit(s.DEVICE_LIST_CHANGED,e)),o.a.addListener(l.a.DEVICE_LIST_AVAILABLE,e=>this._logOutputDevice(this.getAudioOutputDevice(),e)),o.a.addListener(l.a.PERMISSIONS_CHANGED,e=>this._handlePermissionsChange(e)),this._permissionsApiSupported=new Promise(e=>{if(!navigator.permissions)return void e(!1);const t=this,n=[];n.push(navigator.permissions.query({name:"camera"}).then(e=>(this._handlePermissionsChange({[d.c]:this._parsePermissionState(e)}),e.onchange=function(){try{t._handlePermissionsChange({[d.c]:t._parsePermissionState(this)})}catch(e){}},!0)).catch(()=>!1)),n.push(navigator.permissions.query({name:"microphone"}).then(e=>(this._handlePermissionsChange({[d.a]:this._parsePermissionState(e)}),e.onchange=function(){try{t._handlePermissionsChange({[d.a]:t._parsePermissionState(this)})}catch(e){}},!0)).catch(()=>!1)),Promise.all(n).then(t=>e(t.every(e=>e)))})}_parsePermissionState(e={}){const t=e.state||e.status;if("string"!=typeof t)throw new TypeError;return"granted"===t}_handlePermissionsChange(e){[d.a,d.c].some(t=>t in e&&e[t]!==this._permissions[t])&&(this._permissions=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){h(e,t,n[t])}))}return e}({},this._permissions,e),this._eventEmitter.emit(s.PERMISSIONS_CHANGED,this._permissions),(this._permissions[d.a]||this._permissions[d.c])&&this.enumerateDevices(()=>{}))}_logOutputDevice(e,t){const n=t.find(t=>"audiooutput"===t.kind&&t.deviceId===e);n&&c.a.sendActiveDeviceListEvent(o.a.getEventDataForActiveDevice(n))}enumerateDevices(e){o.a.enumerateDevices(e)}isDeviceListAvailable(){return o.a.isDeviceListAvailable()}isDeviceChangeAvailable(e){return o.a.isDeviceChangeAvailable(e)}isDevicePermissionGranted(e){return new Promise(t=>{e in this._permissions?t(this._permissions[e]):this._permissionsApiSupported.then(n=>{if(!n)return void t(!1);const i=[];switch(e){case d.c:i.push(navigator.permissions.query({name:"camera"}));break;case d.a:i.push(navigator.permissions.query({name:"microphone"}));break;default:i.push(navigator.permissions.query({name:"camera"})),i.push(navigator.permissions.query({name:"microphone"}))}Promise.all(i).then(e=>t(e.every(e=>{try{return this._parsePermissionState(e)}catch(e){return!1}})),()=>t(!1))})})}isMultipleAudioInputSupported(){return!a.a.isFirefox()}getAudioOutputDevice(){return o.a.getAudioOutputDevice()}setAudioOutputDevice(e){return o.a.getCurrentlyAvailableMediaDevices().length>0&&this._logOutputDevice(e,o.a.getCurrentlyAvailableMediaDevices()),o.a.setAudioOutputDevice(e)}addEventListener(e,t){this._eventEmitter.addListener(e,t)}removeEventListener(e,t){this._eventEmitter.removeListener(e,t)}emitEvent(e,...t){this._eventEmitter.emit(e,...t)}}},function(e,t){e.exports={IDENTITY_UPDATED:"authentication.identity_updated"}},function(module,exports,__webpack_require__){(function(process,global){var __WEBPACK_AMD_DEFINE_RESULT__;
/**
* [js-md5]{@link https://github.com/emn178/js-md5}
*
* @namespace md5
* @version 0.7.3
* @author Chen, Yi-Cyuan [emn178@gmail.com]
* @copyright Chen, Yi-Cyuan 2014-2017
* @license MIT
*/!function(){"use strict";var ERROR="input is invalid type",WINDOW="object"==typeof window,root=WINDOW?window:{};root.JS_MD5_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&"object"==typeof self,NODE_JS=!root.JS_MD5_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;NODE_JS?root=global:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_MD5_NO_COMMON_JS&&"object"==typeof module&&module.exports,AMD=__webpack_require__(156),ARRAY_BUFFER=!root.JS_MD5_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,HEX_CHARS="0123456789abcdef".split(""),EXTRA=[128,32768,8388608,-2147483648],SHIFT=[0,8,16,24],OUTPUT_TYPES=["hex","array","digest","buffer","arrayBuffer","base64"],BASE64_ENCODE_CHAR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),blocks=[],buffer8;if(ARRAY_BUFFER){var buffer=new ArrayBuffer(68);buffer8=new Uint8Array(buffer),blocks=new Uint32Array(buffer)}!root.JS_MD5_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!ARRAY_BUFFER||!root.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var createOutputMethod=function(e){return function(t){return new Md5(!0).update(t)[e]()}},createMethod=function(){var e=createOutputMethod("hex");NODE_JS&&(e=nodeWrap(e)),e.create=function(){return new Md5},e.update=function(t){return e.create().update(t)};for(var t=0;t<OUTPUT_TYPES.length;++t){var n=OUTPUT_TYPES[t];e[n]=createOutputMethod(n)}return e},nodeWrap=function(method){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),nodeMethod=function(e){if("string"==typeof e)return crypto.createHash("md5").update(e,"utf8").digest("hex");if(null==e)throw ERROR;return e.constructor===ArrayBuffer&&(e=new Uint8Array(e)),Array.isArray(e)||ArrayBuffer.isView(e)||e.constructor===Buffer?crypto.createHash("md5").update(new Buffer(e)).digest("hex"):method(e)};return nodeMethod};function Md5(e){if(e)blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks,this.buffer8=buffer8;else if(ARRAY_BUFFER){var t=new ArrayBuffer(68);this.buffer8=new Uint8Array(t),this.blocks=new Uint32Array(t)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}Md5.prototype.update=function(e){if(!this.finalized){var t,n=typeof e;if("string"!==n){if("object"!==n)throw ERROR;if(null===e)throw ERROR;if(ARRAY_BUFFER&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||ARRAY_BUFFER&&ArrayBuffer.isView(e)))throw ERROR;t=!0}for(var i,r,s=0,o=e.length,a=this.blocks,c=this.buffer8;s<o;){if(this.hashed&&(this.hashed=!1,a[0]=a[16],a[16]=a[1]=a[2]=a[3]=a[4]=a[5]=a[6]=a[7]=a[8]=a[9]=a[10]=a[11]=a[12]=a[13]=a[14]=a[15]=0),t)if(ARRAY_BUFFER)for(r=this.start;s<o&&r<64;++s)c[r++]=e[s];else for(r=this.start;s<o&&r<64;++s)a[r>>2]|=e[s]<<SHIFT[3&r++];else if(ARRAY_BUFFER)for(r=this.start;s<o&&r<64;++s)(i=e.charCodeAt(s))<128?c[r++]=i:i<2048?(c[r++]=192|i>>6,c[r++]=128|63&i):i<55296||i>=57344?(c[r++]=224|i>>12,c[r++]=128|i>>6&63,c[r++]=128|63&i):(i=65536+((1023&i)<<10|1023&e.charCodeAt(++s)),c[r++]=240|i>>18,c[r++]=128|i>>12&63,c[r++]=128|i>>6&63,c[r++]=128|63&i);else for(r=this.start;s<o&&r<64;++s)(i=e.charCodeAt(s))<128?a[r>>2]|=i<<SHIFT[3&r++]:i<2048?(a[r>>2]|=(192|i>>6)<<SHIFT[3&r++],a[r>>2]|=(128|63&i)<<SHIFT[3&r++]):i<55296||i>=57344?(a[r>>2]|=(224|i>>12)<<SHIFT[3&r++],a[r>>2]|=(128|i>>6&63)<<SHIFT[3&r++],a[r>>2]|=(128|63&i)<<SHIFT[3&r++]):(i=65536+((1023&i)<<10|1023&e.charCodeAt(++s)),a[r>>2]|=(240|i>>18)<<SHIFT[3&r++],a[r>>2]|=(128|i>>12&63)<<SHIFT[3&r++],a[r>>2]|=(128|i>>6&63)<<SHIFT[3&r++],a[r>>2]|=(128|63&i)<<SHIFT[3&r++]);this.lastByteIndex=r,this.bytes+=r-this.start,r>=64?(this.start=r-64,this.hash(),this.hashed=!0):this.start=r}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Md5.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[t>>2]|=EXTRA[3&t],t>=56&&(this.hashed||this.hash(),e[0]=e[16],e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.bytes<<3,e[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},Md5.prototype.hash=function(){var e,t,n,i,r,s,o=this.blocks;this.first?t=((t=((e=((e=o[0]-680876937)<<7|e>>>25)-271733879<<0)^(n=((n=(-271733879^(i=((i=(-1732584194^2004318071&e)+o[1]-117830708)<<12|i>>>20)+e<<0)&(-271733879^e))+o[2]-1126478375)<<17|n>>>15)+i<<0)&(i^e))+o[3]-1316259209)<<22|t>>>10)+n<<0:(e=this.h0,t=this.h1,n=this.h2,t=((t+=((e=((e+=((i=this.h3)^t&(n^i))+o[0]-680876936)<<7|e>>>25)+t<<0)^(n=((n+=(t^(i=((i+=(n^e&(t^n))+o[1]-389564586)<<12|i>>>20)+e<<0)&(e^t))+o[2]+606105819)<<17|n>>>15)+i<<0)&(i^e))+o[3]-1044525330)<<22|t>>>10)+n<<0),t=((t+=((e=((e+=(i^t&(n^i))+o[4]-176418897)<<7|e>>>25)+t<<0)^(n=((n+=(t^(i=((i+=(n^e&(t^n))+o[5]+1200080426)<<12|i>>>20)+e<<0)&(e^t))+o[6]-1473231341)<<17|n>>>15)+i<<0)&(i^e))+o[7]-45705983)<<22|t>>>10)+n<<0,t=((t+=((e=((e+=(i^t&(n^i))+o[8]+1770035416)<<7|e>>>25)+t<<0)^(n=((n+=(t^(i=((i+=(n^e&(t^n))+o[9]-1958414417)<<12|i>>>20)+e<<0)&(e^t))+o[10]-42063)<<17|n>>>15)+i<<0)&(i^e))+o[11]-1990404162)<<22|t>>>10)+n<<0,t=((t+=((e=((e+=(i^t&(n^i))+o[12]+1804603682)<<7|e>>>25)+t<<0)^(n=((n+=(t^(i=((i+=(n^e&(t^n))+o[13]-40341101)<<12|i>>>20)+e<<0)&(e^t))+o[14]-1502002290)<<17|n>>>15)+i<<0)&(i^e))+o[15]+1236535329)<<22|t>>>10)+n<<0,t=((t+=((i=((i+=(t^n&((e=((e+=(n^i&(t^n))+o[1]-165796510)<<5|e>>>27)+t<<0)^t))+o[6]-1069501632)<<9|i>>>23)+e<<0)^e&((n=((n+=(e^t&(i^e))+o[11]+643717713)<<14|n>>>18)+i<<0)^i))+o[0]-373897302)<<20|t>>>12)+n<<0,t=((t+=((i=((i+=(t^n&((e=((e+=(n^i&(t^n))+o[5]-701558691)<<5|e>>>27)+t<<0)^t))+o[10]+38016083)<<9|i>>>23)+e<<0)^e&((n=((n+=(e^t&(i^e))+o[15]-660478335)<<14|n>>>18)+i<<0)^i))+o[4]-405537848)<<20|t>>>12)+n<<0,t=((t+=((i=((i+=(t^n&((e=((e+=(n^i&(t^n))+o[9]+568446438)<<5|e>>>27)+t<<0)^t))+o[14]-1019803690)<<9|i>>>23)+e<<0)^e&((n=((n+=(e^t&(i^e))+o[3]-187363961)<<14|n>>>18)+i<<0)^i))+o[8]+1163531501)<<20|t>>>12)+n<<0,t=((t+=((i=((i+=(t^n&((e=((e+=(n^i&(t^n))+o[13]-1444681467)<<5|e>>>27)+t<<0)^t))+o[2]-51403784)<<9|i>>>23)+e<<0)^e&((n=((n+=(e^t&(i^e))+o[7]+1735328473)<<14|n>>>18)+i<<0)^i))+o[12]-1926607734)<<20|t>>>12)+n<<0,t=((t+=((s=(i=((i+=((r=t^n)^(e=((e+=(r^i)+o[5]-378558)<<4|e>>>28)+t<<0))+o[8]-2022574463)<<11|i>>>21)+e<<0)^e)^(n=((n+=(s^t)+o[11]+1839030562)<<16|n>>>16)+i<<0))+o[14]-35309556)<<23|t>>>9)+n<<0,t=((t+=((s=(i=((i+=((r=t^n)^(e=((e+=(r^i)+o[1]-1530992060)<<4|e>>>28)+t<<0))+o[4]+1272893353)<<11|i>>>21)+e<<0)^e)^(n=((n+=(s^t)+o[7]-155497632)<<16|n>>>16)+i<<0))+o[10]-1094730640)<<23|t>>>9)+n<<0,t=((t+=((s=(i=((i+=((r=t^n)^(e=((e+=(r^i)+o[13]+681279174)<<4|e>>>28)+t<<0))+o[0]-358537222)<<11|i>>>21)+e<<0)^e)^(n=((n+=(s^t)+o[3]-722521979)<<16|n>>>16)+i<<0))+o[6]+76029189)<<23|t>>>9)+n<<0,t=((t+=((s=(i=((i+=((r=t^n)^(e=((e+=(r^i)+o[9]-640364487)<<4|e>>>28)+t<<0))+o[12]-421815835)<<11|i>>>21)+e<<0)^e)^(n=((n+=(s^t)+o[15]+530742520)<<16|n>>>16)+i<<0))+o[2]-995338651)<<23|t>>>9)+n<<0,t=((t+=((i=((i+=(t^((e=((e+=(n^(t|~i))+o[0]-198630844)<<6|e>>>26)+t<<0)|~n))+o[7]+1126891415)<<10|i>>>22)+e<<0)^((n=((n+=(e^(i|~t))+o[14]-1416354905)<<15|n>>>17)+i<<0)|~e))+o[5]-57434055)<<21|t>>>11)+n<<0,t=((t+=((i=((i+=(t^((e=((e+=(n^(t|~i))+o[12]+1700485571)<<6|e>>>26)+t<<0)|~n))+o[3]-1894986606)<<10|i>>>22)+e<<0)^((n=((n+=(e^(i|~t))+o[10]-1051523)<<15|n>>>17)+i<<0)|~e))+o[1]-2054922799)<<21|t>>>11)+n<<0,t=((t+=((i=((i+=(t^((e=((e+=(n^(t|~i))+o[8]+1873313359)<<6|e>>>26)+t<<0)|~n))+o[15]-30611744)<<10|i>>>22)+e<<0)^((n=((n+=(e^(i|~t))+o[6]-1560198380)<<15|n>>>17)+i<<0)|~e))+o[13]+1309151649)<<21|t>>>11)+n<<0,t=((t+=((i=((i+=(t^((e=((e+=(n^(t|~i))+o[4]-145523070)<<6|e>>>26)+t<<0)|~n))+o[11]-1120210379)<<10|i>>>22)+e<<0)^((n=((n+=(e^(i|~t))+o[2]+718787259)<<15|n>>>17)+i<<0)|~e))+o[9]-343485551)<<21|t>>>11)+n<<0,this.first?(this.h0=e+1732584193<<0,this.h1=t-271733879<<0,this.h2=n-1732584194<<0,this.h3=i+271733878<<0,this.first=!1):(this.h0=this.h0+e<<0,this.h1=this.h1+t<<0,this.h2=this.h2+n<<0,this.h3=this.h3+i<<0)},Md5.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,i=this.h3;return HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[15&n]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[15&i]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]},Md5.prototype.toString=Md5.prototype.hex,Md5.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,i=this.h3;return[255&e,e>>8&255,e>>16&255,e>>24&255,255&t,t>>8&255,t>>16&255,t>>24&255,255&n,n>>8&255,n>>16&255,n>>24&255,255&i,i>>8&255,i>>16&255,i>>24&255]},Md5.prototype.array=Md5.prototype.digest,Md5.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(16),t=new Uint32Array(e);return t[0]=this.h0,t[1]=this.h1,t[2]=this.h2,t[3]=this.h3,e},Md5.prototype.buffer=Md5.prototype.arrayBuffer,Md5.prototype.base64=function(){for(var e,t,n,i="",r=this.array(),s=0;s<15;)e=r[s++],t=r[s++],n=r[s++],i+=BASE64_ENCODE_CHAR[e>>>2]+BASE64_ENCODE_CHAR[63&(e<<4|t>>>4)]+BASE64_ENCODE_CHAR[63&(t<<2|n>>>6)]+BASE64_ENCODE_CHAR[63&n];return e=r[s],i+=BASE64_ENCODE_CHAR[e>>>2]+BASE64_ENCODE_CHAR[e<<4&63]+"=="};var exports=createMethod();COMMON_JS?module.exports=exports:(root.md5=exports,AMD&&(__WEBPACK_AMD_DEFINE_RESULT__=function(){return exports}.call(exports,__webpack_require__,exports,module),void 0===__WEBPACK_AMD_DEFINE_RESULT__||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)))}()}).call(this,__webpack_require__(62),__webpack_require__(45))},function(e,t,n){(function(t){var n=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,r=/^0b[01]+$/i,s=/^0o[0-7]+$/i,o=parseInt,a="object"==typeof t&&t&&t.Object===Object&&t,c="object"==typeof self&&self&&self.Object===Object&&self,d=a||c||Function("return this")(),u=Object.prototype.toString,l=Math.max,h=Math.min,p=function(){return d.Date.now()};function m(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function f(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==u.call(e)}(e))return NaN;if(m(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=m(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(n,"");var a=r.test(e);return a||s.test(e)?o(e.slice(2),a?2:8):i.test(e)?NaN:+e}e.exports=function(e,t,n){var i,r,s,o,a,c,d=0,u=!1,g=!1,_=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function v(t){var n=i,s=r;return i=r=void 0,d=t,o=e.apply(s,n)}function S(e){return d=e,a=setTimeout(E,t),u?v(e):o}function y(e){var n=e-c;return void 0===c||n>=t||n<0||g&&e-d>=s}function E(){var e=p();if(y(e))return b(e);a=setTimeout(E,function(e){var n=t-(e-c);return g?h(n,s-(e-d)):n}(e))}function b(e){return a=void 0,_&&i?v(e):(i=r=void 0,o)}function C(){var e=p(),n=y(e);if(i=arguments,r=this,c=e,n){if(void 0===a)return S(c);if(g)return a=setTimeout(E,t),v(c)}return void 0===a&&(a=setTimeout(E,t)),o}return t=f(t)||0,m(n)&&(u=!!n.leading,s=(g="maxWait"in n)?l(f(n.maxWait)||0,t):s,_="trailing"in n?!!n.trailing:_),C.cancel=function(){void 0!==a&&clearTimeout(a),d=0,i=c=r=a=void 0},C.flush=function(){return void 0===a?o:b(p())},C}}).call(this,n(45))},function(e,t,n){"use strict";async function i(e){const t=new TextEncoder;return crypto.subtle.deriveBits({name:"HKDF",salt:t.encode("JFrameRatchetKey"),hash:"SHA-256",info:new ArrayBuffer},e,256)}async function r(e){return crypto.subtle.importKey("raw",e,"HKDF",!1,["deriveBits","deriveKey"])}n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"b",(function(){return u})),n.d(t,"a",(function(){return l}));var i=n(2),r=n(0),s=n.n(r),o=n(22);const a=["category","type","lang","name"],c=["category","type","lang"];function d(e,t){let n=0;return c.some(i=>0!==(n=e[i]>t[i]?1:e[i]<t[i]&&-1)),n}function u(e){const t=new Set,n=new Set;return $(e).find(">query>feature").each((e,n)=>t.add(n.getAttribute("var"))),$(e).find(">query>identity").each((e,t)=>n.add({type:t.getAttribute("type"),name:t.getAttribute("name"),category:t.getAttribute("category")})),{features:t,identities:n}}class l extends o.a{constructor(e={},t="http://jitsi.org/jitsimeet"){if(super(),this.node=t,this.disco=e.disco,!this.disco)throw new Error("Missing strophe-plugins (disco plugin is required)!");this.version="",this.rooms=new Set,this.externalFeatures=new Set;const n=e.emuc;n.addListener(s.a.EMUC_ROOM_ADDED,e=>this._addChatRoom(e)),n.addListener(s.a.EMUC_ROOM_REMOVED,e=>this._removeChatRoom(e)),Object.keys(n.rooms).forEach(e=>{this._addChatRoom(n.rooms[e])}),i.Strophe.addNamespace("CAPS","http://jabber.org/protocol/caps"),this.disco.addFeature(i.Strophe.NS.CAPS)}addFeature(e,t=!1,n=!1){this.disco.addFeature(e),this._generateVersion(),n&&!this.externalFeatures.has(e)&&(this.externalFeatures.add(e),this.rooms.forEach(e=>this._updateRoomWithExternalFeatures(e))),t&&this.submit()}removeFeature(e,t=!1,n=!1){this.disco.removeFeature(e),this._generateVersion(),n&&this.externalFeatures.has(e)&&(this.externalFeatures.delete(e),this.rooms.forEach(e=>this._updateRoomWithExternalFeatures(e))),t&&this.submit()}submit(){this.rooms.forEach(e=>e.sendPresence())}_updateRoomWithExternalFeatures(e){if(0===this.externalFeatures.size)e.removeFromPresence("features");else{const t=[];this.externalFeatures.forEach(e=>{t.push({tagName:"feature",attributes:{var:e}})}),e.addOrReplaceInPresence("features",{children:t})}}getFeaturesAndIdentities(e,t,n=5e3){return this._getDiscoInfo(e,t,n)}_getDiscoInfo(e,t,n){return new Promise((i,r)=>this.disco.info(e,t,e=>{i(u(e))},r,n))}_addChatRoom(e){this.rooms.add(e),this._fixChatRoomPresenceMap(e),this._updateRoomWithExternalFeatures(e)}_removeChatRoom(e){this.rooms.delete(e)}_fixChatRoomPresenceMap(e){e.addOrReplaceInPresence("c",{attributes:{xmlns:i.Strophe.NS.CAPS,hash:"sha-1",node:this.node,ver:this.version}})}_notifyVersionChanged(){this.rooms.forEach(e=>this._fixChatRoomPresenceMap(e))}_generateVersion(){this.version=function(e,t){const n=e.sort(d).reduce((e,t)=>a.reduce((e,n,i)=>e+(0===i?"":"/")+(t[n]?t[n]:""),"")+"<",""),r=t.sort().reduce((e,t)=>e+t+"<","");return Object(i.b64_sha1)(n+r)}(this.disco._identities,this.disco._features),this._notifyVersionChanged()}}},function(e,t,n){var i=n(163),r=n(164);t.write=r,t.parse=i.parse,t.parseParams=i.parseParams,t.parseFmtpConfig=i.parseFmtpConfig,t.parsePayloads=i.parsePayloads,t.parseRemoteCandidates=i.parseRemoteCandidates,t.parseImageAttributes=i.parseImageAttributes,t.parseSimulcastStreamList=i.parseSimulcastStreamList},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return d}));var i=n(19),r=n(5),s=n(1),o=n(23),a=n(68);const c=Object(r.getLogger)(e);class d extends i.EventEmitter{constructor(e,t){super(),this._createVADProcessor=t,this._vadEmitter=null,this._isVADEmitterRunning=!1,this._detectionServices=[],this._vadInitTracker=Promise.resolve(),this._processVADScore=this._processVADScore.bind(this),e.on(s.TRACK_ADDED,this._trackAdded.bind(this)),e.on(s.TRACK_REMOVED,this._trackRemoved.bind(this)),e.on(s.TRACK_MUTE_CHANGED,this._trackMuteChanged.bind(this))}addVADDetectionService(e){this._detectionServices.push(e),e.on(o.DETECTOR_STATE_CHANGE,()=>{!this._detectionServices.filter(e=>!0===e.isActive()).length&&this._isVADEmitterRunning?this._stopVADEmitter():this._isVADEmitterRunning||this._startVADEmitter()})}_startVADEmitter(){this._vadEmitter&&(this._vadEmitter.on(o.VAD_SCORE_PUBLISHED,this._processVADScore),this._vadEmitter.start(),this._isVADEmitterRunning=!0)}_stopVADEmitter(){this._vadEmitter&&(this._vadEmitter.removeListener(o.VAD_SCORE_PUBLISHED,this._processVADScore),this._vadEmitter.stop()),this._isVADEmitterRunning=!1}_processVADScore(e){for(const t of this._detectionServices)t.processVADScore(e)}_changeDetectorsMuteState(e){for(const t of this._detectionServices)t.changeMuteState(e)}_trackAdded(e){e.isLocalAudioTrack()&&(this._vadInitTracker=this._vadInitTracker.then(()=>this._createVADProcessor()).then(t=>a.a.create(e.getDeviceId(),4096,t)).then(t=>{c.debug("Created VAD emitter for track: ",e.getTrackLabel()),this._vadEmitter=t,this._changeDetectorsMuteState(e.isMuted())}).catch(e=>{c.warn("Failed to start VADAudioAnalyser",e)}))}_trackMuteChanged(e){e.isLocalAudioTrack()&&(this._vadInitTracker=this._vadInitTracker.then(()=>{this._changeDetectorsMuteState(e.isMuted())}))}_trackRemoved(e){e.isLocalAudioTrack()&&(this._vadInitTracker=this._vadInitTracker.then(()=>{c.debug("Removing track from VAD detection - ",e.getTrackLabel()),this._vadEmitter&&(this._stopVADEmitter(),this._vadEmitter.destroy(),this._vadEmitter=null);for(const e of this._detectionServices)e.reset()}))}}}).call(this,"modules/detection/VADAudioAnalyser.js")},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var i=n(2),r=n(54);class s{constructor(e={}){this._connection=e.connection,this._mode=e.mode,this._setSessionID(e.sessionID),this.setStatus(e.status)}getError(){return this._error}getID(){return this._sessionID}getInitiator(){return this._initiator}getLiveStreamViewURL(){return this._liveStreamViewURL}getStatus(){return this._status}getTerminator(){return this._terminator}getMode(){return this._mode}setError(e){this._error=e}setLiveStreamViewURL(e){this._liveStreamViewURL=e}setStatus(e){this._status=e}setInitiator(e){this._initiator=e}setTerminator(e){this._terminator=e}start({appData:e,broadcastId:t,focusMucJid:n,streamId:i}){return new Promise((s,o)=>{this._connection.sendIQ(this._createIQ({action:"start",appData:e,focusMucJid:n,broadcastId:t,streamId:i}),e=>{this.setStatus("pending"),this._setSessionID(r.a.getSessionIdFromIq(e)),s()},e=>{this._setErrorFromIq(e),o(e)})})}stop({focusMucJid:e}){return new Promise((t,n)=>{this._connection.sendIQ(this._createIQ({action:"stop",focusMucJid:e}),t,n)})}_createIQ({action:e,appData:t,broadcastId:n,focusMucJid:r,streamId:s}){return Object(i.$iq)({to:r,type:"set"}).c("jibri",{xmlns:"http://jitsi.org/protocol/jibri",action:e,app_data:t,recording_mode:this._mode,streamid:s,you_tube_broadcast_id:n}).up()}_setErrorFromIq(e){const t=e.getElementsByTagName("error")[0];this.setError(t.children[0].tagName)}_setSessionID(e){this._sessionID=e}}},function(e,t,n){"use strict";var i="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),r=new Uint8Array(16);function s(){if(!i)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return i(r)}for(var o=[],a=0;a<256;++a)o.push((a+256).toString(16).substr(1));var c=function(e,t){var n=t||0,i=o;return(i[e[n+0]]+i[e[n+1]]+i[e[n+2]]+i[e[n+3]]+"-"+i[e[n+4]]+i[e[n+5]]+"-"+i[e[n+6]]+i[e[n+7]]+"-"+i[e[n+8]]+i[e[n+9]]+"-"+i[e[n+10]]+i[e[n+11]]+i[e[n+12]]+i[e[n+13]]+i[e[n+14]]+i[e[n+15]]).toLowerCase()};t.a=function(e,t,n){"string"==typeof e&&(t="binary"===e?new Uint8Array(16):null,e=null);var i=(e=e||{}).random||(e.rng||s)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t){for(var r=n||0,o=0;o<16;++o)t[r+o]=i[o];return t}return c(i)}},function(e,t){var n={trace:0,debug:1,info:2,log:3,warn:4,error:5};a.consoleTransport=console;var i=[a.consoleTransport];a.addGlobalTransport=function(e){-1===i.indexOf(e)&&i.push(e)},a.removeGlobalTransport=function(e){var t=i.indexOf(e);-1!==t&&i.splice(t,1)};var r={};function s(){var e={methodName:"",fileLocation:"",line:null,column:null},t=new Error,n=t.stack?t.stack.split("\n"):[];if(!n||n.length<3)return e;var i=null;return n[3]&&(i=n[3].match(/\s*at\s*(.+?)\s*\((\S*)\s*:(\d*)\s*:(\d*)\)/)),!i||i.length<=4?(0===n[2].indexOf("log@")?e.methodName=n[3].substr(0,n[3].indexOf("@")):e.methodName=n[2].substr(0,n[2].indexOf("@")),e):(e.methodName=i[1],e.fileLocation=i[2],e.line=i[3],e.column=i[4],e)}function o(){var e=arguments[0],t=arguments[1],o=Array.prototype.slice.call(arguments,2);if(!(n[t]<e.level))for(var a=!(e.options.disableCallerInfo||r.disableCallerInfo)&&s(),c=i.concat(e.transports),d=0;d<c.length;d++){var u=c[d],l=u[t];if(l&&"function"==typeof l){var h=[];h.push((new Date).toISOString()),e.id&&h.push("["+e.id+"]"),a&&a.methodName.length>1&&h.push("<"+a.methodName+">: ");var p=h.concat(o);l.bind(u).apply(u,p)}}}function a(e,t,i,r){this.id=t,this.options=r||{},this.transports=i,this.transports||(this.transports=[]),this.level=n[e];for(var s=Object.keys(n),a=0;a<s.length;a++)this[s[a]]=o.bind(null,this,s[a])}a.setGlobalOptions=function(e){r=e||{}},a.prototype.setLevel=function(e){this.level=n[e]},e.exports=a,a.levels={TRACE:"trace",DEBUG:"debug",INFO:"info",LOG:"log",WARN:"warn",ERROR:"error"}},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t){var n=e.exports={v:[{name:"version",reg:/^(\d*)$/}],o:[{name:"origin",reg:/^(\S*) (\d*) (\d*) (\S*) IP(\d) (\S*)/,names:["username","sessionId","sessionVersion","netType","ipVer","address"],format:"%s %s %d %s IP%d %s"}],s:[{name:"name"}],i:[{name:"description"}],u:[{name:"uri"}],e:[{name:"email"}],p:[{name:"phone"}],z:[{name:"timezones"}],r:[{name:"repeats"}],t:[{name:"timing",reg:/^(\d*) (\d*)/,names:["start","stop"],format:"%d %d"}],c:[{name:"connection",reg:/^IN IP(\d) (\S*)/,names:["version","ip"],format:"IN IP%d %s"}],b:[{push:"bandwidth",reg:/^(TIAS|AS|CT|RR|RS):(\d*)/,names:["type","limit"],format:"%s:%s"}],m:[{reg:/^(\w*) (\d*) ([\w/]*)(?: (.*))?/,names:["type","port","protocol","payloads"],format:"%s %d %s %s"}],a:[{push:"rtp",reg:/^rtpmap:(\d*) ([\w\-.]*)(?:\s*\/(\d*)(?:\s*\/(\S*))?)?/,names:["payload","codec","rate","encoding"],format:function(e){return e.encoding?"rtpmap:%d %s/%s/%s":e.rate?"rtpmap:%d %s/%s":"rtpmap:%d %s"}},{push:"fmtp",reg:/^fmtp:(\d*) ([\S| ]*)/,names:["payload","config"],format:"fmtp:%d %s"},{name:"control",reg:/^control:(.*)/,format:"control:%s"},{name:"rtcp",reg:/^rtcp:(\d*)(?: (\S*) IP(\d) (\S*))?/,names:["port","netType","ipVer","address"],format:function(e){return null!=e.address?"rtcp:%d %s IP%d %s":"rtcp:%d"}},{push:"rtcpFbTrrInt",reg:/^rtcp-fb:(\*|\d*) trr-int (\d*)/,names:["payload","value"],format:"rtcp-fb:%s trr-int %d"},{push:"rtcpFb",reg:/^rtcp-fb:(\*|\d*) ([\w-_]*)(?: ([\w-_]*))?/,names:["payload","type","subtype"],format:function(e){return null!=e.subtype?"rtcp-fb:%s %s %s":"rtcp-fb:%s %s"}},{push:"ext",reg:/^extmap:(\d+)(?:\/(\w+))?(?: (urn:ietf:params:rtp-hdrext:encrypt))? (\S*)(?: (\S*))?/,names:["value","direction","encrypt-uri","uri","config"],format:function(e){return"extmap:%d"+(e.direction?"/%s":"%v")+(e["encrypt-uri"]?" %s":"%v")+" %s"+(e.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(e){return null!=e.sessionConfig?"crypto:%d %s %s %s":"crypto:%d %s %s"}},{name:"setup",reg:/^setup:(\w*)/,format:"setup:%s"},{name:"connectionType",reg:/^connection:(new|existing)/,format:"connection:%s"},{name:"mid",reg:/^mid:([^\s]*)/,format:"mid:%s"},{name:"msid",reg:/^msid:(.*)/,format:"msid:%s"},{name:"ptime",reg:/^ptime:(\d*(?:\.\d*)*)/,format:"ptime:%d"},{name:"maxptime",reg:/^maxptime:(\d*(?:\.\d*)*)/,format:"maxptime:%d"},{name:"direction",reg:/^(sendrecv|recvonly|sendonly|inactive)/},{name:"icelite",reg:/^(ice-lite)/},{name:"iceUfrag",reg:/^ice-ufrag:(\S*)/,format:"ice-ufrag:%s"},{name:"icePwd",reg:/^ice-pwd:(\S*)/,format:"ice-pwd:%s"},{name:"fingerprint",reg:/^fingerprint:(\S*) (\S*)/,names:["type","hash"],format:"fingerprint:%s %s"},{push:"candidates",reg:/^candidate:(\S*) (\d*) (\S*) (\d*) (\S*) (\d*) typ (\S*)(?: raddr (\S*) rport (\d*))?(?: tcptype (\S*))?(?: generation (\d*))?(?: network-id (\d*))?(?: network-cost (\d*))?/,names:["foundation","component","transport","priority","ip","port","type","raddr","rport","tcptype","generation","network-id","network-cost"],format:function(e){var t="candidate:%s %d %s %d %s %d typ %s";return t+=null!=e.raddr?" raddr %s rport %d":"%v%v",t+=null!=e.tcptype?" tcptype %s":"%v",null!=e.generation&&(t+=" generation %d"),t+=null!=e["network-id"]?" network-id %d":"%v",t+=null!=e["network-cost"]?" network-cost %d":"%v"}},{name:"endOfCandidates",reg:/^(end-of-candidates)/},{name:"remoteCandidates",reg:/^remote-candidates:(.*)/,format:"remote-candidates:%s"},{name:"iceOptions",reg:/^ice-options:(\S*)/,format:"ice-options:%s"},{push:"ssrcs",reg:/^ssrc:(\d*) ([\w_-]*)(?::(.*))?/,names:["id","attribute","value"],format:function(e){var t="ssrc:%d";return null!=e.attribute&&(t+=" %s",null!=e.value&&(t+=":%s")),t}},{push:"ssrcGroups",reg:/^ssrc-group:([\x21\x23\x24\x25\x26\x27\x2A\x2B\x2D\x2E\w]*) (.*)/,names:["semantics","ssrcs"],format:"ssrc-group:%s %s"},{name:"msidSemantic",reg:/^msid-semantic:\s?(\w*) (\S*)/,names:["semantic","token"],format:"msid-semantic: %s %s"},{push:"groups",reg:/^group:(\w*) (.*)/,names:["type","mids"],format:"group:%s %s"},{name:"rtcpMux",reg:/^(rtcp-mux)/},{name:"rtcpRsize",reg:/^(rtcp-rsize)/},{name:"sctpmap",reg:/^sctpmap:([\w_/]*) (\S*)(?: (\S*))?/,names:["sctpmapNumber","app","maxMessageSize"],format:function(e){return null!=e.maxMessageSize?"sctpmap:%s %s %s":"sctpmap:%s %s"}},{name:"xGoogleFlag",reg:/^x-google-flag:([^\s]*)/,format:"x-google-flag:%s"},{push:"rids",reg:/^rid:([\d\w]+) (\w+)(?: ([\S| ]*))?/,names:["id","direction","params"],format:function(e){return e.params?"rid:%s %s %s":"rid:%s %s"}},{push:"imageattrs",reg:new RegExp("^imageattr:(\\d+|\\*)[\\s\\t]+(send|recv)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*)(?:[\\s\\t]+(recv|send)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*))?"),names:["pt","dir1","attrs1","dir2","attrs2"],format:function(e){return"imageattr:%s %s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast",reg:new RegExp("^simulcast:(send|recv) ([a-zA-Z0-9\\-_~;,]+)(?:\\s?(send|recv) ([a-zA-Z0-9\\-_~;,]+))?$"),names:["dir1","list1","dir2","list2"],format:function(e){return"simulcast:%s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast_03",reg:/^simulcast:[\s\t]+([\S+\s\t]+)$/,names:["value"],format:"simulcast: %s"},{name:"framerate",reg:/^framerate:(\d+(?:$|\.\d+))/,format:"framerate:%s"},{name:"sourceFilter",reg:/^source-filter: *(excl|incl) (\S*) (IP4|IP6|\*) (\S*) (.*)/,names:["filterMode","netType","addressTypes","destAddress","srcList"],format:"source-filter: %s %s %s %s %s"},{name:"bundleOnly",reg:/^(bundle-only)/},{name:"label",reg:/^label:(.+)/,format:"label:%s"},{name:"sctpPort",reg:/^sctp-port:(\d+)$/,format:"sctp-port:%s"},{name:"maxMessageSize",reg:/^max-message-size:(\d+)$/,format:"max-message-size:%s"},{push:"tsRefClocks",reg:/^ts-refclk:([^\s=]*)(?:=(\S*))?/,names:["clksrc","clksrcExt"],format:function(e){return"ts-refclk:%s"+(null!=e.clksrcExt?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(e){var t="mediaclk:";return t+=null!=e.id?"id=%s %s":"%v%s",t+=null!=e.mediaClockValue?"=%s":"",t+=null!=e.rateNumerator?" rate=%s":"",t+=null!=e.rateDenominator?"/%s":""}},{name:"keywords",reg:/^keywds:(.+)$/,format:"keywds:%s"},{name:"content",reg:/^content:(.+)/,format:"content:%s"},{name:"bfcpFloorCtrl",reg:/^floorctrl:(c-only|s-only|c-s)/,format:"floorctrl:%s"},{name:"bfcpConfId",reg:/^confid:(\d+)/,format:"confid:%s"},{name:"bfcpUserId",reg:/^userid:(\d+)/,format:"userid:%s"},{name:"bfcpFloorId",reg:/^floorid:(.+) (?:m-stream|mstrm):(.+)/,names:["id","mStream"],format:"floorid:%s mstrm:%s"},{push:"invalid",names:["value"]}]};Object.keys(n).forEach((function(e){n[e].forEach((function(e){e.reg||(e.reg=/(.*)/),e.format||(e.format="%s")}))}))},function(e,t){var n=e.exports={v:[{name:"version",reg:/^(\d*)$/}],o:[{name:"origin",reg:/^(\S*) (\d*) (\d*) (\S*) IP(\d) (\S*)/,names:["username","sessionId","sessionVersion","netType","ipVer","address"],format:"%s %s %d %s IP%d %s"}],s:[{name:"name"}],i:[{name:"description"}],u:[{name:"uri"}],e:[{name:"email"}],p:[{name:"phone"}],z:[{name:"timezones"}],r:[{name:"repeats"}],t:[{name:"timing",reg:/^(\d*) (\d*)/,names:["start","stop"],format:"%d %d"}],c:[{name:"connection",reg:/^IN IP(\d) (\S*)/,names:["version","ip"],format:"IN IP%d %s"}],b:[{push:"bandwidth",reg:/^(TIAS|AS|CT|RR|RS):(\d*)/,names:["type","limit"],format:"%s:%s"}],m:[{reg:/^(\w*) (\d*) ([\w\/]*)(?: (.*))?/,names:["type","port","protocol","payloads"],format:"%s %d %s %s"}],a:[{push:"rtp",reg:/^rtpmap:(\d*) ([\w\-\.]*)(?:\s*\/(\d*)(?:\s*\/(\S*))?)?/,names:["payload","codec","rate","encoding"],format:function(e){return e.encoding?"rtpmap:%d %s/%s/%s":e.rate?"rtpmap:%d %s/%s":"rtpmap:%d %s"}},{push:"fmtp",reg:/^fmtp:(\d*) ([\S| ]*)/,names:["payload","config"],format:"fmtp:%d %s"},{name:"control",reg:/^control:(.*)/,format:"control:%s"},{name:"rtcp",reg:/^rtcp:(\d*)(?: (\S*) IP(\d) (\S*))?/,names:["port","netType","ipVer","address"],format:function(e){return null!=e.address?"rtcp:%d %s IP%d %s":"rtcp:%d"}},{push:"rtcpFbTrrInt",reg:/^rtcp-fb:(\*|\d*) trr-int (\d*)/,names:["payload","value"],format:"rtcp-fb:%d trr-int %d"},{push:"rtcpFb",reg:/^rtcp-fb:(\*|\d*) ([\w-_]*)(?: ([\w-_]*))?/,names:["payload","type","subtype"],format:function(e){return null!=e.subtype?"rtcp-fb:%s %s %s":"rtcp-fb:%s %s"}},{push:"ext",reg:/^extmap:(\d+)(?:\/(\w+))? (\S*)(?: (\S*))?/,names:["value","direction","uri","config"],format:function(e){return"extmap:%d"+(e.direction?"/%s":"%v")+" %s"+(e.config?" %s":"")}},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(e){return null!=e.sessionConfig?"crypto:%d %s %s %s":"crypto:%d %s %s"}},{name:"setup",reg:/^setup:(\w*)/,format:"setup:%s"},{name:"mid",reg:/^mid:([^\s]*)/,format:"mid:%s"},{name:"msid",reg:/^msid:(.*)/,format:"msid:%s"},{name:"ptime",reg:/^ptime:(\d*)/,format:"ptime:%d"},{name:"maxptime",reg:/^maxptime:(\d*)/,format:"maxptime:%d"},{name:"direction",reg:/^(sendrecv|recvonly|sendonly|inactive)/},{name:"icelite",reg:/^(ice-lite)/},{name:"iceUfrag",reg:/^ice-ufrag:(\S*)/,format:"ice-ufrag:%s"},{name:"icePwd",reg:/^ice-pwd:(\S*)/,format:"ice-pwd:%s"},{name:"fingerprint",reg:/^fingerprint:(\S*) (\S*)/,names:["type","hash"],format:"fingerprint:%s %s"},{push:"candidates",reg:/^candidate:(\S*) (\d*) (\S*) (\d*) (\S*) (\d*) typ (\S*)(?: raddr (\S*) rport (\d*))?(?: tcptype (\S*))?(?: generation (\d*))?(?: network-id (\d*))?(?: network-cost (\d*))?/,names:["foundation","component","transport","priority","ip","port","type","raddr","rport","tcptype","generation","network-id","network-cost"],format:function(e){var t="candidate:%s %d %s %d %s %d typ %s";return t+=null!=e.raddr?" raddr %s rport %d":"%v%v",t+=null!=e.tcptype?" tcptype %s":"%v",null!=e.generation&&(t+=" generation %d"),t+=null!=e["network-id"]?" network-id %d":"%v",t+=null!=e["network-cost"]?" network-cost %d":"%v"}},{name:"endOfCandidates",reg:/^(end-of-candidates)/},{name:"remoteCandidates",reg:/^remote-candidates:(.*)/,format:"remote-candidates:%s"},{name:"iceOptions",reg:/^ice-options:(\S*)/,format:"ice-options:%s"},{push:"ssrcs",reg:/^ssrc:(\d*) ([\w_]*)(?::(.*))?/,names:["id","attribute","value"],format:function(e){var t="ssrc:%d";return null!=e.attribute&&(t+=" %s",null!=e.value&&(t+=":%s")),t}},{push:"ssrcGroups",reg:/^ssrc-group:([\x21\x23\x24\x25\x26\x27\x2A\x2B\x2D\x2E\w]*) (.*)/,names:["semantics","ssrcs"],format:"ssrc-group:%s %s"},{name:"msidSemantic",reg:/^msid-semantic:\s?(\w*) (\S*)/,names:["semantic","token"],format:"msid-semantic: %s %s"},{push:"groups",reg:/^group:(\w*) (.*)/,names:["type","mids"],format:"group:%s %s"},{name:"rtcpMux",reg:/^(rtcp-mux)/},{name:"rtcpRsize",reg:/^(rtcp-rsize)/},{name:"sctpmap",reg:/^sctpmap:([\w_\/]*) (\S*)(?: (\S*))?/,names:["sctpmapNumber","app","maxMessageSize"],format:function(e){return null!=e.maxMessageSize?"sctpmap:%s %s %s":"sctpmap:%s %s"}},{name:"xGoogleFlag",reg:/^x-google-flag:([^\s]*)/,format:"x-google-flag:%s"},{push:"rids",reg:/^rid:([\d\w]+) (\w+)(?: ([\S| ]*))?/,names:["id","direction","params"],format:function(e){return e.params?"rid:%s %s %s":"rid:%s %s"}},{push:"imageattrs",reg:new RegExp("^imageattr:(\\d+|\\*)[\\s\\t]+(send|recv)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*)(?:[\\s\\t]+(recv|send)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*))?"),names:["pt","dir1","attrs1","dir2","attrs2"],format:function(e){return"imageattr:%s %s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast",reg:new RegExp("^simulcast:(send|recv) ([a-zA-Z0-9\\-_~;,]+)(?:\\s?(send|recv) ([a-zA-Z0-9\\-_~;,]+))?$"),names:["dir1","list1","dir2","list2"],format:function(e){return"simulcast:%s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast_03",reg:/^simulcast:[\s\t]+([\S+\s\t]+)$/,names:["value"],format:"simulcast: %s"},{name:"framerate",reg:/^framerate:(\d+(?:$|\.\d+))/,format:"framerate:%s"},{push:"invalid",names:["value"]}]};Object.keys(n).forEach((function(e){n[e].forEach((function(e){e.reg||(e.reg=/(.*)/),e.format||(e.format="%s")}))}))},function(e,t,n){const i=n(169),r=function(e){this.track=e,this.recorder=null,this.data=null,this.name=null,this.startTime=null};function s(e){if(void 0===e.recorder)throw new Error("Passed an object to startRecorder which is not a TrackRecorder object");e.recorder.start(),e.startTime=new Date}function o(e){if(void 0===e.recorder)throw new Error("Passed an object to stopRecorder which is not a TrackRecorder object");e.recorder.stop()}function a(){if(MediaRecorder.isTypeSupported("audio/webm"))return"audio/webm";if(MediaRecorder.isTypeSupported("audio/ogg"))return"audio/ogg";throw new Error("unable to create a MediaRecorder with the right mimetype!")}function c(e){this.recorders=[],this.fileType=a(),this.isRecording=!1,this.jitsiConference=e}c.determineCorrectFileType=a,c.prototype.addTrack=function(e){if(e.isAudioTrack()){const t=this.instantiateTrackRecorder(e);this.recorders.push(t),this.updateNames(),this.isRecording&&s(t)}},c.prototype.instantiateTrackRecorder=function(e){const t=new r(e),n=t.track.getOriginalStream(),i=new MediaStream;return n.getAudioTracks().forEach(e=>i.addTrack(e)),t.recorder=new MediaRecorder(i,{mimeType:this.fileType}),t.data=[],t.recorder.ondataavailable=function(e){e.data.size>0&&t.data.push(e.data)},t},c.prototype.removeTrack=function(e){if(e.isVideoTrack())return;const t=this.recorders;let n;for(n=0;n<t.length;n++)if(t[n].track.getParticipantId()===e.getParticipantId()){const e=t[n];this.isRecording?o(e):t.splice(n,1)}this.updateNames()},c.prototype.updateNames=function(){const e=this.jitsiConference;this.recorders.forEach(t=>{if(t.track.isLocal())t.name="the transcriber";else{const n=t.track.getParticipantId(),i=e.getParticipantById(n).getDisplayName();"undefined"!==i&&(t.name=i)}})},c.prototype.start=function(){if(this.isRecording)throw new Error("audiorecorder is already recording");this.isRecording=!0,this.recorders.forEach(e=>s(e)),console.log(`Started the recording of the audio. There are currently ${this.recorders.length} recorders active.`)},c.prototype.stop=function(){this.isRecording=!1,this.recorders.forEach(e=>o(e)),console.log("stopped recording")},c.prototype.download=function(){this.recorders.forEach(e=>{const t=new Blob(e.data,{type:this.fileType}),n=URL.createObjectURL(t),i=document.createElement("a");document.body.appendChild(i),i.style="display: none",i.href=n,i.download="test."+this.fileType.split("/")[1],i.click(),window.URL.revokeObjectURL(n)})},c.prototype.getRecordingResults=function(){if(this.isRecording)throw new Error("cannot get blobs because the AudioRecorder is still recording!");this.updateNames();const e=[];return this.recorders.forEach(t=>e.push(new i(new Blob(t.data,{type:this.fileType}),t.name,t.startTime))),e},c.prototype.getFileType=function(){return this.fileType},e.exports=c},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var i=n(88),r=n(27),s=n(6),o=n(24),a=n(8);function c(e,t,n){this.appID=e,this.token=t,this.options=n,this.xmpp=new o.e(n,t),this.addEventListener(r.CONNECTION_FAILED,(e,t,n,i)=>{s.a.sendAnalyticsAndLog(Object(a.B)(e,t,i))}),this.addEventListener(r.CONNECTION_DISCONNECTED,e=>{e&&s.a.sendAnalytics(a.m,{message:e}),s.a.sendLog(JSON.stringify({id:a.m,msg:e}))})}c.prototype.connect=function(e={}){this.xmpp.connect(e.id,e.password)},c.prototype.attach=function(e){this.xmpp.attach(e)},c.prototype.disconnect=function(...e){return this.xmpp.disconnect(...e)},c.prototype.getJid=function(){return this.xmpp.getJid()},c.prototype.setToken=function(e){this.token=e},c.prototype.initJitsiConference=function(e,t){return new i.a({name:e,config:t,connection:this})},c.prototype.addEventListener=function(e,t){this.xmpp.addListener(e,t)},c.prototype.removeEventListener=function(e,t){this.xmpp.removeListener(e,t)},c.prototype.getConnectionTimes=function(){return this.xmpp.connectionTimes},c.prototype.addFeature=function(e,t=!1){this.xmpp.caps.addFeature(e,t,!0)},c.prototype.removeFeature=function(e,t=!1){this.xmpp.caps.removeFeature(e,t,!0)},c.prototype.getLogs=function(){const e=this.xmpp.getJingleLog(),t={};t.time=new Date,t.url=window.location.href,t.ua=navigator.userAgent;const n=this.xmpp.getXmppLog();return n&&(t.xmpp=n),e.metadata=t,e}},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return ue}));var i=n(19),r=n.n(i),s=n(5),o=n(33),a=n.n(o),c=n(2),d=n(17),u=n(89),l=n(1),h=n(96),p=n(21),m=n(14),f=n(16),g=n(97),_=n(119),v=n(13),S=n(36),y=n(3),E=n(127),b=n(128),C=n(51),T=n(23),R=n(129),A=n(130),I=n(79),w=n(131),P=n(132),O=n(56),D=n(133),N=n(134),M=n(135),L=n(136),k=n(137),x=n(29),F=n(138),j=n(139),U=n(140),H=n(6),V=n(141),B=n.n(V),J=n(12),G=n.n(J),K=n(38),q=n.n(K),W=n(142),z=n(143),Q=n(26),Y=n(24),X=n(53),Z=n.n(X),ee=n(20),te=n.n(ee),ne=n(4),ie=n(15),re=n.n(ie),se=n(8),oe=n(0);function ae(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){ce(e,t,n[t])}))}return e}function ce(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const de=Object(s.getLogger)(e);function ue(e){if(!e.name||e.name.toLowerCase()!==e.name){const e="Invalid conference name (no conference name passed or it contains invalid characters like capital letters)!";throw de.error(e),new Error(e)}this.eventEmitter=new r.a,this.options=e,this.eventManager=new u.a(this),this.participants={},this._init(e),this.componentsVersions=new W.a(this),this.jvbJingleSession=null,this.lastDominantSpeaker=null,this.dtmfManager=null,this.somebodySupportsDTMF=!1,this.authEnabled=!1,this.startAudioMuted=!1,this.startVideoMuted=!1,this.startMutedPolicy={audio:!1,video:!1},this.isMutedByFocus=!1,this.mutedByFocusActor=null,this.isVideoMutedByFocus=!1,this.mutedVideoByFocusActor=null,this.wasStopped=!1,this.properties={},this.connectionQuality=new E.a(this,this.eventEmitter,e),this.avgRtpStatsReporter=new j.a(this,e.config.avgRtpStatsN||15),e.config.disableAudioLevels||(this._audioOutputProblemDetector=new F.a(this)),this.isJvbConnectionInterrupted=!1,this.speakerStatsCollector=new U.a(this),this.deferredStartP2PTask=null;const t=parseInt(e.config.p2p&&e.config.p2p.backToP2PDelay,10);this.backToP2PDelay=isNaN(t)?5:t,de.info("backToP2PDelay: "+this.backToP2PDelay),this.isP2PConnectionInterrupted=!1,this.p2p=!1,this.p2pJingleSession=null,this.videoSIPGWHandler=new z.a(this.room),this.recordingManager=new k.a(this.room),this._conferenceJoinAnalyticsEventSent=void 0,this.isE2EESupported()&&(de.info("End-to-End Encryprtion is supported"),this._e2eEncryption=new O.a(this))}ue.prototype.constructor=ue,ue.resourceCreator=function(e,t){let n;if(t)n=q.a.randomHexString(8).toLowerCase();else{n=c.Strophe.getNodeFromJid(e).substr(0,8).toLowerCase();/[0-9a-f]{8}/g.test(n)||(n=q.a.randomHexString(8).toLowerCase())}return n},ue.prototype._init=function(e={}){e.connection&&(this.connection=e.connection,this.xmpp=this.connection.xmpp,this.eventManager.setupXMPPListeners());const{config:t}=this.options,n={disabledCodec:t.videoQuality?t.videoQuality.disabledCodec:t.p2p&&t.p2p.disableH264&&te.a.H264,enforcePreferredCodec:t.videoQuality&&t.videoQuality.enforcePreferredCodec,jvbCodec:t.videoQuality&&t.videoQuality.preferredCodec||t.preferH264&&te.a.H264,p2pCodec:t.p2p?t.p2p.preferredCodec||t.p2p.preferH264&&te.a.H264:te.a.VP8};this.codecSelection=new _.a(this,n),this._statsCurrentId=t.statisticsId?t.statisticsId:x.a.callStatsUserName,this.room=this.xmpp.createRoom(this.options.name,ae({},t,{statsId:this._statsCurrentId}),ue.resourceCreator),this._onIceConnectionInterrupted=this._onIceConnectionInterrupted.bind(this),this.room.addListener(oe.CONNECTION_INTERRUPTED,this._onIceConnectionInterrupted),this._onIceConnectionRestored=this._onIceConnectionRestored.bind(this),this.room.addListener(oe.CONNECTION_RESTORED,this._onIceConnectionRestored),this._onIceConnectionEstablished=this._onIceConnectionEstablished.bind(this),this.room.addListener(oe.CONNECTION_ESTABLISHED,this._onIceConnectionEstablished),this._updateProperties=this._updateProperties.bind(this),this.room.addListener(oe.CONFERENCE_PROPERTIES_CHANGED,this._updateProperties),this._sendConferenceJoinAnalyticsEvent=this._sendConferenceJoinAnalyticsEvent.bind(this),this.room.addListener(oe.MEETING_ID_SET,this._sendConferenceJoinAnalyticsEvent),this.e2eping=new D.a(this,t,(e,t)=>{try{this.sendMessage(e,t,!0)}catch(e){de.warn("Failed to send E2E ping request or response.",e&&e.msg)}}),this.rtc||(this.rtc=new v.a(this,e),this.eventManager.setupRTCListeners()),this.receiveVideoController=new M.a(this,this.rtc),this.sendVideoController=new L.a(this,this.rtc),this.participantConnectionStatus=new C.b(this.rtc,this,{rtcMuteTimeout:t._peerConnStatusRtcMuteTimeout,outOfLastNTimeout:t._peerConnStatusOutOfLastNTimeout}),this.participantConnectionStatus.init();let i=!0;if(t.testing&&t.testing.callStatsThreshold&&(i=100*Math.random()<=t.testing.callStatsThreshold),this.statistics||(this.statistics=new H.a(this.xmpp,{aliasName:this._statsCurrentId,userName:t.statisticsDisplayName?t.statisticsDisplayName:this.myUserId(),confID:t.confID||`${this.connection.options.hosts.domain}/${this.options.name}`,siteID:t.siteID,customScriptUrl:t.callStatsCustomScriptUrl,callStatsID:t.callStatsID,callStatsSecret:t.callStatsSecret,callStatsApplicationLogsDisabled:t.callStatsApplicationLogsDisabled,enableCallStats:i,roomName:this.options.name,applicationName:t.applicationName,getWiFiStatsMethod:t.getWiFiStatsMethod,configParams:t.callStatsConfigParams}),H.a.analytics.addPermanentProperties({callstats_name:this._statsCurrentId}),t.longTasksStatsInterval&&this.statistics.attachLongTasksStats(this)),this.eventManager.setupChatRoomListeners(),this.eventManager.setupStatisticsListeners(),t.enableTalkWhileMuted&&y.a.supportsVADDetection())if(t.createVADProcessor){de.info("Using VAD detection for generating talk while muted events"),this._audioAnalyser||(this._audioAnalyser=new I.a(this,t.createVADProcessor));const e=new P.a;e.on(T.VAD_TALK_WHILE_MUTED,()=>this.eventEmitter.emit(l.TALK_WHILE_MUTED)),this._audioAnalyser.addVADDetectionService(e)}else de.warn("No VAD Processor was provided. Talk while muted detection service was not initialized!");if(t.enableNoisyMicDetection&&y.a.supportsVADDetection())if(t.createVADProcessor){this._audioAnalyser||(this._audioAnalyser=new I.a(this,t.createVADProcessor));const e=new w.a;e.on(T.VAD_NOISY_DEVICE,()=>this.eventEmitter.emit(l.NOISY_MIC)),this._audioAnalyser.addVADDetectionService(e)}else de.warn("No VAD Processor was provided. Noisy microphone detection service was not initialized!");t.enableNoAudioDetection&&(this._noAudioSignalDetection=new R.a(this),this._noAudioSignalDetection.on(T.NO_AUDIO_INPUT,()=>{this.eventEmitter.emit(l.NO_AUDIO_INPUT)}),this._noAudioSignalDetection.on(T.AUDIO_INPUT_STATE_CHANGE,e=>{this.eventEmitter.emit(l.AUDIO_INPUT_STATE_CHANGE,e)})),"channelLastN"in t&&this.setLastN(t.channelLastN),this.jvb121Status=new N.a(this),this.p2pDominantSpeakerDetection=new A.a(this),t&&t.deploymentInfo&&t.deploymentInfo.userRegion&&this.setLocalParticipantProperty("region",t.deploymentInfo.userRegion),this.setLocalParticipantProperty("codecType",this.codecSelection.getPreferredCodec()),t&&t.transcriptionLanguage&&"en-US"!==t.transcriptionLanguage&&this.setLocalParticipantProperty("transcription_language",t.transcriptionLanguage)},ue.prototype.join=function(e,t=!1){this.room&&this.room.join(e,t).then(()=>this._maybeSetSITimeout())},ue.prototype.authenticateAndUpgradeRole=function(e){return g.a.call(this,ae({},e,{onCreateResource:ue.resourceCreator}))},ue.prototype.isJoined=function(){return this.room&&this.room.joined},ue.prototype.isP2PEnabled=function(){return Boolean(this.options.config.p2p&&this.options.config.p2p.enabled)||void 0===this.options.config.p2p},ue.prototype.isP2PTestModeEnabled=function(){return Boolean(this.options.config.testing&&this.options.config.testing.p2pTestMode)},ue.prototype.leave=function(){if(this.participantConnectionStatus&&(this.participantConnectionStatus.dispose(),this.participantConnectionStatus=null),this.avgRtpStatsReporter&&(this.avgRtpStatsReporter.dispose(),this.avgRtpStatsReporter=null),this._audioOutputProblemDetector&&(this._audioOutputProblemDetector.dispose(),this._audioOutputProblemDetector=null),this.e2eping&&(this.e2eping.stop(),this.e2eping=null),this.getLocalTracks().forEach(e=>this.onLocalTrackRemoved(e)),this.rtc.closeBridgeChannel(),this._sendConferenceLeftAnalyticsEvent(),this.statistics&&this.statistics.dispose(),this._delayedIceFailed&&this._delayedIceFailed.cancel(),this.jvbJingleSession&&(this.jvbJingleSession.close(),this.jvbJingleSession=null),this.p2pJingleSession&&(this.p2pJingleSession.close(),this.p2pJingleSession=null),this.room){const e=this.room;return e.removeListener(oe.CONNECTION_INTERRUPTED,this._onIceConnectionInterrupted),e.removeListener(oe.CONNECTION_RESTORED,this._onIceConnectionRestored),e.removeListener(oe.CONNECTION_ESTABLISHED,this._onIceConnectionEstablished),e.removeListener(oe.CONFERENCE_PROPERTIES_CHANGED,this._updateProperties),e.removeListener(oe.MEETING_ID_SET,this._sendConferenceJoinAnalyticsEvent),this.eventManager.removeXMPPListeners(),this.room=null,e.leave().then(()=>{this.rtc&&this.rtc.destroy()}).catch(e=>{throw this.getParticipants().forEach(e=>this.onMemberLeft(e.getJid())),e})}return Promise.reject(new Error("The conference is has been already left"))},ue.prototype._getActiveMediaSession=function(){return this.isP2PActive()?this.p2pJingleSession:this.jvbJingleSession},ue.prototype._getMediaSessions=function(){const e=[];return this.jvbJingleSession&&e.push(this.jvbJingleSession),this.p2pJingleSession&&e.push(this.p2pJingleSession),e},ue.prototype._sendBridgeVideoTypeMessage=function(e){let t=!e||e.isMuted()?Z.a.NONE:e.getVideoType();t===Z.a.DESKTOP&&this._desktopSharingFrameRate>S.a&&(t=Z.a.DESKTOP_HIGH_FPS),this.rtc.setVideoType(t)},ue.prototype.getName=function(){return this.options.name},ue.prototype.getConnection=function(){return this.connection},ue.prototype.isAuthEnabled=function(){return this.authEnabled},ue.prototype.isLoggedIn=function(){return Boolean(this.authIdentity)},ue.prototype.getAuthLogin=function(){return this.authIdentity},ue.prototype.isExternalAuthEnabled=function(){return this.room&&this.room.moderator.isExternalAuthEnabled()},ue.prototype.getExternalAuthUrl=function(e){return new Promise((t,n)=>{this.isExternalAuthEnabled()?e?this.room.moderator.getPopupLoginUrl(t,n):this.room.moderator.getLoginUrl(t,n):n()})},ue.prototype.getLocalTracks=function(e){let t=[];return this.rtc&&(t=this.rtc.getLocalTracks(e)),t},ue.prototype.getLocalAudioTrack=function(){return this.rtc?this.rtc.getLocalAudioTrack():null},ue.prototype.getLocalVideoTrack=function(){return this.rtc?this.rtc.getLocalVideoTrack():null},ue.prototype.getPerformanceStats=function(){return{longTasksStats:this.statistics.getLongTasksStats()}},ue.prototype.on=function(e,t){this.eventEmitter&&this.eventEmitter.on(e,t)},ue.prototype.off=function(e,t){this.eventEmitter&&this.eventEmitter.removeListener(e,t)},ue.prototype.addEventListener=ue.prototype.on,ue.prototype.removeEventListener=ue.prototype.off,ue.prototype.addCommandListener=function(e,t){this.room&&this.room.addPresenceListener(e,t)},ue.prototype.removeCommandListener=function(e,t){this.room&&this.room.removePresenceListener(e,t)},ue.prototype.sendTextMessage=function(e,t="body"){this.room&&this.room.sendMessage(e,t)},ue.prototype.sendPrivateTextMessage=function(e,t,n="body"){this.room&&this.room.sendPrivateMessage(e,t,n)},ue.prototype.sendCommand=function(e,t){this.room?this.room.addOrReplaceInPresence(e,t)&&this.room.sendPresence():de.warn("Not sending a command, room not initialized.")},ue.prototype.sendCommandOnce=function(e,t){this.sendCommand(e,t),this.removeCommand(e)},ue.prototype.removeCommand=function(e){this.room&&this.room.removeFromPresence(e)},ue.prototype.setDisplayName=function(e){this.room&&this.room.addOrReplaceInPresence("nick",{attributes:{xmlns:"http://jabber.org/protocol/nick"},value:e})&&this.room.sendPresence()},ue.prototype.setSubject=function(e){this.room&&this.isModerator()?this.room.setSubject(e):de.warn(`Failed to set subject, ${this.room?"":"not in a room, "}${this.isModerator()?"":"participant is not a moderator"}`)},ue.prototype.getTranscriber=function(){if(void 0===this.transcriber){this.transcriber=new B.a;const e=this.getLocalTracks(ne.a);for(const t of e)this.transcriber.addTrack(t);const t=this.rtc.getRemoteTracks(ne.a);for(const e of t)this.transcriber.addTrack(e)}return this.transcriber},ue.prototype.getTranscriptionStatus=function(){return this.room.transcriptionStatus},ue.prototype.addTrack=function(e){const t=e.getType(),n=this.rtc.getLocalTracks(t);return n.length>0?e===n[0]?Promise.resolve(e):Promise.reject(new Error(`Cannot add second ${t} track to the conference`)):this.replaceTrack(null,e)},ue.prototype._fireAudioLevelChangeEvent=function(e,t){const n=this.getActivePeerConnection();t&&n!==t||this.eventEmitter.emit(l.TRACK_AUDIO_LEVEL_CHANGED,this.myUserId(),e)},ue.prototype._fireMuteChangeEvent=function(e){let t;if(this.isMutedByFocus&&e.isAudioTrack()&&!e.isMuted()?(this.isMutedByFocus=!1,this.room.muteParticipant(this.room.myroomjid,!1,ne.a)):this.isVideoMutedByFocus&&e.isVideoTrack()&&!e.isMuted()&&(this.isVideoMutedByFocus=!1,this.room.muteParticipant(this.room.myroomjid,!1,ne.c)),this.mutedByFocusActor&&e.isAudioTrack()){const e=c.Strophe.getResourceFromJid(this.mutedByFocusActor);t=this.participants[e]}else if(this.mutedVideoByFocusActor&&e.isVideoTrack()){const e=c.Strophe.getResourceFromJid(this.mutedVideoByFocusActor);t=this.participants[e]}e.isVideoTrack()&&!y.a.doesVideoMuteByStreamRemove()&&this._sendBridgeVideoTypeMessage(e),this.eventEmitter.emit(l.TRACK_MUTE_CHANGED,e,t)},ue.prototype._getInitialLocalTracks=function(){return this.getLocalTracks().filter(e=>e.getType()===ne.a&&(!this.isStartAudioMuted()||y.a.isIosBrowser())||e.getType()===ne.c&&!this.isStartVideoMuted())},ue.prototype.onLocalTrackRemoved=function(e){e._setConference(null),this.rtc.removeLocalTrack(e),e.removeEventListener(f.TRACK_MUTE_CHANGED,e.muteHandler),e.removeEventListener(f.TRACK_AUDIO_LEVEL_CHANGED,e.audioLevelHandler),e.isVideoTrack()&&e.videoType===re.a.DESKTOP&&this.statistics.sendScreenSharingEvent(!1),this.eventEmitter.emit(l.TRACK_REMOVED,e)},ue.prototype.removeTrack=function(e){return this.replaceTrack(e,null)},ue.prototype.replaceTrack=function(e,t){return e&&e.disposed||t&&t.disposed?Promise.reject(new p.a(m.TRACK_IS_DISPOSED)):this._doReplaceTrack(e,t).then(()=>(e&&this.onLocalTrackRemoved(e),t&&this._setupNewTrack(t),((null==e?void 0:e.isVideoTrack())||(null==t?void 0:t.isVideoTrack()))&&this._sendBridgeVideoTypeMessage(t),null!==t&&(this.isMutedByFocus||this.isVideoMutedByFocus)&&this._fireMuteChangeEvent(t),Promise.resolve())).catch(e=>Promise.reject(new Error(e)))},ue.prototype._doReplaceTrack=function(e,t){const n=[];return this.jvbJingleSession?n.push(this.jvbJingleSession.replaceTrack(e,t)):de.info("_doReplaceTrack - no JVB JingleSession"),this.p2pJingleSession?n.push(this.p2pJingleSession.replaceTrack(e,t)):de.info("_doReplaceTrack - no P2P JingleSession"),Promise.all(n)},ue.prototype._setupNewTrack=function(e){if(e.isAudioTrack()||e.isVideoTrack()&&e.videoType!==re.a.DESKTOP){const t=v.a.getCurrentlyAvailableMediaDevices().find(t=>t.kind===e.getTrack().kind+"input"&&t.label===e.getTrack().label);t&&H.a.sendActiveDeviceListEvent(v.a.getEventDataForActiveDevice(t))}if(e.isVideoTrack()){const t="videoType";(e.videoType!==re.a.CAMERA||this.room.getFromPresence(t))&&this.sendCommand(t,{value:e.videoType})}this.rtc.addLocalTrack(e),e.isAudioTrack()?this.room.setAudioMute(e.isMuted()):this.room.setVideoMute(e.isMuted()),e.muteHandler=this._fireMuteChangeEvent.bind(this,e),e.audioLevelHandler=this._fireAudioLevelChangeEvent.bind(this),e.addEventListener(f.TRACK_MUTE_CHANGED,e.muteHandler),e.addEventListener(f.TRACK_AUDIO_LEVEL_CHANGED,e.audioLevelHandler),e._setConference(this),this.eventEmitter.emit(l.TRACK_ADDED,e)},ue.prototype._addLocalTrackAsUnmute=function(e){const t=[];return this.jvbJingleSession?t.push(this.jvbJingleSession.addTrackAsUnmute(e)):de.debug("Add local MediaStream as unmute - no JVB Jingle session started yet"),this.p2pJingleSession?t.push(this.p2pJingleSession.addTrackAsUnmute(e)):de.debug("Add local MediaStream as unmute - no P2P Jingle session started yet"),Promise.allSettled(t).then(()=>{e.isVideoTrack()&&this._sendBridgeVideoTypeMessage(e)})},ue.prototype._removeLocalTrackAsMute=function(e){const t=[];return this.jvbJingleSession?t.push(this.jvbJingleSession.removeTrackAsMute(e)):de.debug("Remove local MediaStream - no JVB JingleSession started yet"),this.p2pJingleSession?t.push(this.p2pJingleSession.removeTrackAsMute(e)):de.debug("Remove local MediaStream - no P2P JingleSession started yet"),Promise.allSettled(t).then(()=>{e.isVideoTrack()&&this._sendBridgeVideoTypeMessage()})},ue.prototype.getRole=function(){return this.room.role},ue.prototype.isHidden=function(){return this.connection?c.Strophe.getDomainFromJid(this.connection.getJid())===this.options.config.hiddenDomain:null},ue.prototype.isModerator=function(){return this.room?this.room.isModerator():null},ue.prototype.lock=function(e){return this.isModerator()?new Promise((t,n)=>{this.room.lockRoom(e||"",()=>t(),e=>n(e),()=>n(d.PASSWORD_NOT_SUPPORTED))}):Promise.reject(new Error("You are not moderator."))},ue.prototype.unlock=function(){return this.lock()},ue.prototype.selectParticipant=function(e){this.selectParticipants([e])},ue.prototype.selectParticipants=function(e){if(!Array.isArray(e))throw new Error("Invalid argument; participantIds must be an array.");this.receiveVideoController.selectEndpoints(e)},ue.prototype.getLastN=function(){return this.receiveVideoController.getLastN()},ue.prototype.setLastN=function(e){if(!Number.isInteger(e)&&!Number.parseInt(e,10))throw new Error("Invalid value for lastN: "+e);const t=Number(e);if(t<-1)throw new RangeError("lastN cannot be smaller than -1");if(this.receiveVideoController.setLastN(t),this.p2pJingleSession){const e=0!==t;this.p2pJingleSession.setMediaTransferActive(!0,e).catch(t=>{de.error(`Failed to adjust video transfer status (${e})`,t)})}},ue.prototype.isInLastN=function(e){return this.rtc.isInLastN(e)},ue.prototype.getParticipants=function(){return Object.values(this.participants)},ue.prototype.getParticipantCount=function(e=!1){let t=this.getParticipants();return e||(t=t.filter(e=>!e.isHidden())),t.length+1},ue.prototype.getParticipantById=function(e){return this.participants[e]},ue.prototype.grantOwner=function(e){const t=this.getParticipantById(e);t&&this.room.setAffiliation(t.getJid(),"owner")},ue.prototype.revokeOwner=function(e){const t=this.getParticipantById(e),n=this.myUserId()===e,i=this.isMembersOnly()?"member":"none";n?this.room.setAffiliation(this.room.myroomjid,i):t&&this.room.setAffiliation(t.getJid(),i)},ue.prototype.kickParticipant=function(e,t){const n=this.getParticipantById(e);n&&this.room.kick(n.getJid(),t)},ue.prototype._maybeClearSITimeout=function(){this._sessionInitiateTimeout&&(this.jvbJingleSession||this.getParticipantCount()<2)&&(window.clearTimeout(this._sessionInitiateTimeout),this._sessionInitiateTimeout=null)},ue.prototype._maybeSetSITimeout=function(){!this.jvbJingleSession&&this.getParticipantCount()>=2&&!this._sessionInitiateTimeout&&(this._sessionInitiateTimeout=window.setTimeout(()=>{this._sessionInitiateTimeout=null,H.a.sendAnalytics(Object(se.G)(se.d,{p2p:!1,value:5e3}))},5e3))},ue.prototype.muteParticipant=function(e,t){const n=t||ne.a;if(n!==ne.a&&n!==ne.c)return void de.error("Unsupported media type: "+n);const i=this.getParticipantById(e);i&&this.room.muteParticipant(i.getJid(),!0,n)},ue.prototype.onMemberJoined=function(e,t,n,i,r,s,o,a,d,u,p){const m=c.Strophe.getResourceFromJid(e);if("focus"===m||this.myUserId()===m)return;const f=new h.a(e,this,t,i,r,s,o);f.setRole(n),f.setBotType(a),f.setFeatures(u),f.setIsReplacing(p),this.participants[m]=f,this.eventEmitter.emit(l.USER_JOINED,m,f),this._updateFeatures(f),this.isJoined()&&this._maybeStartOrStopP2P(),this._maybeSetSITimeout()},ue.prototype._onMucJoined=function(){this._maybeStartOrStopP2P()},ue.prototype._updateFeatures=function(e){e.getFeatures().then(t=>{e._supportsDTMF=t.has("urn:xmpp:jingle:dtmf:0"),this.updateDTMFSupport(),t.has(Y.c)&&e.setProperty("features_jigasi",!0),t.has(Y.b)&&e.setProperty("features_e2ee",!0)}).catch(()=>!1)},ue.prototype._onMemberBotTypeChanged=function(e,t){const n=this.getParticipants().find(t=>t.getJid()===e);if(n){n.setBotType(t);const i=c.Strophe.getResourceFromJid(e);this.eventEmitter.emit(l.BOT_TYPE_CHANGED,i,t)}n.getBotType()||this._maybeStartOrStopP2P()},ue.prototype.onMemberLeft=function(e){const t=c.Strophe.getResourceFromJid(e);if("focus"===t||this.myUserId()===t)return;const n=this.participants[t];delete this.participants[t];const i=this._getMediaSessions(),r=[];for(const e of i)r.push(e.removeRemoteStreamsOnLeave(t));Promise.allSettled(r).then(e=>{let i=[];e.map(e=>e.value).forEach(e=>{e&&(i=i.concat(e))}),i.forEach(e=>{this.eventEmitter.emit(l.TRACK_REMOVED,e)}),n&&this.eventEmitter.emit(l.USER_LEFT,t,n),this._maybeStartOrStopP2P(!0),this._maybeClearSITimeout()})},ue.prototype.onMemberKicked=function(e,t,n,i,r){if(t===this.myUserId())return;const s=this.participants[t];if(e)return this.eventEmitter.emit(l.KICKED,s,i,r),void this.leave();const o=this.participants[n];o.setIsReplaced(r),this.eventEmitter.emit(l.PARTICIPANT_KICKED,s,o,i)},ue.prototype.onLocalRoleChanged=function(e){this.eventEmitter.emit(l.USER_ROLE_CHANGED,this.myUserId(),e)},ue.prototype.onUserRoleChanged=function(e,t){const n=c.Strophe.getResourceFromJid(e),i=this.getParticipantById(n);i&&(i.setRole(t),this.eventEmitter.emit(l.USER_ROLE_CHANGED,n,t))},ue.prototype.onDisplayNameChanged=function(e,t){const n=c.Strophe.getResourceFromJid(e),i=this.getParticipantById(n);i&&i._displayName!==t&&(i._displayName=t,this.eventEmitter.emit(l.DISPLAY_NAME_CHANGED,n,t))},ue.prototype.onRemoteTrackAdded=function(e){if(e.isP2P&&!this.isP2PActive())return void de.info("Trying to add remote P2P track, when not in P2P - IGNORED");if(!e.isP2P&&this.isP2PActive())return void de.info("Trying to add remote JVB track, when in P2P - IGNORED");const t=e.getParticipantId(),n=this.getParticipantById(t);if(!n)return void de.error("No participant found for id: "+t);n._tracks.push(e),this.transcriber&&this.transcriber.addTrack(e);const i=this.eventEmitter;e.addEventListener(f.TRACK_MUTE_CHANGED,()=>i.emit(l.TRACK_MUTE_CHANGED,e)),e.addEventListener(f.TRACK_AUDIO_LEVEL_CHANGED,(e,n)=>{this.getActivePeerConnection()===n&&i.emit(l.TRACK_AUDIO_LEVEL_CHANGED,t,e)}),i.emit(l.TRACK_ADDED,e)},ue.prototype.onCallAccepted=function(e,t){this.p2pJingleSession===e&&(de.info("P2P setAnswer"),this.p2pJingleSession.setAnswer(t),this.eventEmitter.emit(l._MEDIA_SESSION_STARTED,this.p2pJingleSession))},ue.prototype.onTransportInfo=function(e,t){this.p2pJingleSession===e&&(de.info("P2P addIceCandidates"),this.p2pJingleSession.addIceCandidates(t))},ue.prototype.onRemoteTrackRemoved=function(e){this.getParticipants().forEach(t=>{const n=t.getTracks();for(let i=0;i<n.length;i++)if(n[i]===e){t._tracks.splice(i,1),this.eventEmitter.emit(l.TRACK_REMOVED,e),this.transcriber&&this.transcriber.removeTrack(e);break}},this)},ue.prototype._onIncomingCallP2P=function(e,t){let n;!this.isP2PEnabled()&&!this.isP2PTestModeEnabled()||y.a.isFirefox()||y.a.isWebKitBased()?n={reason:"decline",reasonDescription:"P2P disabled",errorMsg:"P2P mode disabled in the configuration"}:this.p2pJingleSession?n={reason:"busy",reasonDescription:"P2P already in progress",errorMsg:'Duplicated P2P "session-initiate"'}:this._shouldBeInP2PMode()||(n={reason:"decline",reasonDescription:"P2P requirements not met",errorMsg:'Received P2P "session-initiate" when should not be in P2P mode'},H.a.sendAnalytics(Object(se.G)(se.h))),n?this._rejectIncomingCall(e,n):this._acceptP2PIncomingCall(e,t)},ue.prototype.onIncomingCall=function(e,t,n){if(e.isP2P)this._onIncomingCallP2P(e,t);else{if(!this.room.isFocus(e.remoteJid)){const t="Rejecting session-initiate from non-focus.";return void this._rejectIncomingCall(e,{reason:"security-error",reasonDescription:t,errorMsg:t})}this._acceptJvbIncomingCall(e,t,n)}},ue.prototype._acceptJvbIncomingCall=function(e,t,n){this.jvbJingleSession=e,this.room.connectionTimes["session.initiate"]=n,this._sendConferenceJoinAnalyticsEvent(),this.wasStopped&&H.a.sendAnalyticsAndLog(Object(se.G)(se.a,{p2p:!1}));const i=$(t).find('>bridge-session[xmlns="http://jitsi.org/protocol/focus"]').attr("region");this.eventEmitter.emit(l.SERVER_REGION_CHANGED,i),this._maybeClearSITimeout(),H.a.sendAnalytics(Object(se.G)(se.c,{p2p:!1,value:n}));try{e.initialize(this.room,this.rtc,ae({},this.options.config,{enableInsertableStreams:this.isE2EEEnabled()}))}catch(e){return G.a.callErrorHandler(e),void de.error(e)}this._setBridgeChannel(t,e.peerconnection);const r=this._getInitialLocalTracks();try{e.acceptOffer(t,()=>{this.isP2PActive()&&this.jvbJingleSession&&this._suspendMediaTransferForJvbConnection(),this.eventEmitter.emit(l._MEDIA_SESSION_STARTED,e),this.isP2PActive()||this.eventEmitter.emit(l._MEDIA_SESSION_ACTIVE_CHANGED,e)},e=>{G.a.callErrorHandler(e),de.error("Failed to accept incoming Jingle session",e)},r),this._desktopSharingFrameRate&&e.peerconnection.setDesktopSharingFrameRate(this._desktopSharingFrameRate),de.info("Starting CallStats for JVB connection..."),this.statistics.startCallStats(this.jvbJingleSession.peerconnection,"jitsi"),this.statistics.startRemoteStats(this.jvbJingleSession.peerconnection)}catch(e){G.a.callErrorHandler(e),de.error(e)}},ue.prototype._setBridgeChannel=function(e,t){let n=null;const i=$(e).find(">content>transport>web-socket").first();1===i.length&&(n=i[0].getAttribute("url")),n?this.rtc.initializeBridgeChannel(null,n):this.rtc.initializeBridgeChannel(t,null)},ue.prototype._rejectIncomingCall=function(e,t){t&&t.errorMsg&&G.a.callErrorHandler(new Error(t.errorMsg)),e.terminate(null,e=>{de.warn("An error occurred while trying to terminate invalid Jingle session",e)},{reason:t&&t.reason,reasonDescription:t&&t.reasonDescription,sendSessionTerminate:!0})},ue.prototype.onCallEnded=function(e,t,n){de.info(`Call ended: ${t} - ${n} P2P ?${e.isP2P}`),e===this.jvbJingleSession?(this.wasStopped=!0,H.a.sendAnalytics(Object(se.G)(se.e,{p2p:!1})),this.statistics&&(this.statistics.stopRemoteStats(this.jvbJingleSession.peerconnection),de.info("Stopping JVB CallStats"),this.statistics.stopCallStats(this.jvbJingleSession.peerconnection)),this.jvbJingleSession=null,this.rtc.onCallEnded()):e===this.p2pJingleSession?("decline"===t&&"force JVB121"===n?(de.info("In forced JVB 121 mode..."),H.a.analytics.addPermanentProperties({forceJvb121:!0})):"connectivity-error"===t&&"ICE FAILED"===n&&H.a.analytics.addPermanentProperties({p2pFailed:!0}),this._stopP2PSession()):de.error("Received onCallEnded for invalid session",e.sid,e.remoteJid,t,n)},ue.prototype.onSuspendDetected=function(e){e.isP2P||(this.leave(),this.eventEmitter.emit(l.SUSPEND_DETECTED))},ue.prototype.updateDTMFSupport=function(){let e=!1;const t=this.getParticipants();for(let n=0;n<t.length;n+=1)if(t[n].supportsDTMF()){e=!0;break}e!==this.somebodySupportsDTMF&&(this.somebodySupportsDTMF=e,this.eventEmitter.emit(l.DTMF_SUPPORT_CHANGED,e))},ue.prototype.isDTMFSupported=function(){return this.somebodySupportsDTMF},ue.prototype.myUserId=function(){return this.room&&this.room.myroomjid?c.Strophe.getResourceFromJid(this.room.myroomjid):null},ue.prototype.sendTones=function(e,t,n){const i=this.getActivePeerConnection();i?i.sendTones(e,t,n):de.warn("cannot sendTones: no peer connection")},ue.prototype.startRecording=function(e){return this.room?this.recordingManager.startRecording(e):Promise.reject(new Error("The conference is not created yet!"))},ue.prototype.stopRecording=function(e){return this.room?this.recordingManager.stopRecording(e):Promise.reject(new Error("The conference is not created yet!"))},ue.prototype.isSIPCallingSupported=function(){return!!this.room&&this.room.isSIPCallingSupported()},ue.prototype.dial=function(e){return this.room?this.room.dial(e):new Promise((e,t)=>{t(new Error("The conference is not created yet!"))})},ue.prototype.hangup=function(){return this.room?this.room.hangup():new Promise((e,t)=>{t(new Error("The conference is not created yet!"))})},ue.prototype.startTranscriber=function(){return this.dial("jitsi_meet_transcribe")},ue.prototype.stopTranscriber=ue.prototype.hangup,ue.prototype.getPhoneNumber=function(){return this.room?this.room.getPhoneNumber():null},ue.prototype.getPhonePin=function(){return this.room?this.room.getPhonePin():null},ue.prototype.getMeetingUniqueId=function(){if(this.room)return this.room.getMeetingId()},ue.prototype.getActivePeerConnection=function(){const e=this.isP2PActive()?this.p2pJingleSession:this.jvbJingleSession;return e?e.peerconnection:null},ue.prototype.getConnectionState=function(){const e=this.getActivePeerConnection();return e?e.getConnectionState():null},ue.prototype.setStartMutedPolicy=function(e){this.isModerator()?(this.startMutedPolicy=e,this.room.addOrReplaceInPresence("startmuted",{attributes:{audio:e.audio,video:e.video,xmlns:"http://jitsi.org/jitmeet/start-muted"}})&&this.room.sendPresence()):de.warn(`Failed to set start muted policy, ${this.room?"":"not in a room, "}${this.isModerator()?"":"participant is not a moderator"}`)},ue.prototype.getStartMutedPolicy=function(){return this.startMutedPolicy},ue.prototype.isStartAudioMuted=function(){return this.startAudioMuted},ue.prototype.isStartVideoMuted=function(){return this.startVideoMuted},ue.prototype.getConnectionTimes=function(){return this.room.connectionTimes},ue.prototype.setLocalParticipantProperty=function(e,t){this.sendCommand("jitsi_participant_"+e,{value:t})},ue.prototype.removeLocalParticipantProperty=function(e){this.removeCommand("jitsi_participant_"+e),this.room.sendPresence()},ue.prototype.getLocalParticipantProperty=function(e){const t=this.room.presMap.nodes.find(t=>t.tagName==="jitsi_participant_"+e);return t?t.value:void 0},ue.prototype.sendFeedback=function(e,t){return this.statistics.sendFeedback(e,t)},ue.prototype.isCallstatsEnabled=function(){return this.statistics.isCallstatsEnabled()},ue.prototype.getSsrcByTrack=function(e){var t;return e.isLocal()?null===(t=this.getActivePeerConnection())||void 0===t?void 0:t.getLocalSSRC(e):e.getSSRC()},ue.prototype._onTrackAttach=function(e,t){const n=e.isLocal();let i=null;const r=e.isP2P,s=r?e.getParticipantId():"jitsi",o=r?this.p2pJingleSession&&this.p2pJingleSession.peerconnection:this.jvbJingleSession&&this.jvbJingleSession.peerconnection;n?o&&(i=o.getLocalSSRC(e)):i=e.getSSRC(),t.id&&i&&o&&this.statistics.associateStreamWithVideoTag(o,i,n,s,e.getUsageLabel(),t.id)},ue.prototype.sendApplicationLog=function(e){H.a.sendLog(e)},ue.prototype._isFocus=function(e){return this.room?this.room.isFocus(e):null},ue.prototype._fireIncompatibleVersionsEvent=function(){this.eventEmitter.emit(l.CONFERENCE_FAILED,d.INCOMPATIBLE_SERVER_VERSIONS)},ue.prototype.sendEndpointMessage=function(e,t){this.rtc.sendChannelMessage(e,t)},ue.prototype.sendEndpointStatsMessage=function(e){this.rtc.sendEndpointStatsMessage(e)},ue.prototype.broadcastEndpointMessage=function(e){this.sendEndpointMessage("",e)},ue.prototype.sendMessage=function(e,t="",n=!1){const i=typeof e;if("object"===i||!n&&"string"===i)if(n)this.sendEndpointMessage(t,e);else{let n=e,r="body";if("object"===i){r="json-message",n.hasOwnProperty(Y.d)||(n[Y.d]="");try{n=JSON.stringify(n)}catch(e){return void de.error("Can not send a message, stringify failed: ",e)}}t?this.sendPrivateTextMessage(t,n,r):this.sendTextMessage(n,r)}else de.error("Can not send a message of type "+i)},ue.prototype.isConnectionInterrupted=function(){return this.isP2PActive()?this.isP2PConnectionInterrupted:this.isJvbConnectionInterrupted},ue.prototype._onConferenceRestarted=function(e){!e.isP2P&&this.options.config.enableForcedReload&&(this.restartInProgress=!0,this.eventEmitter.emit(l.CONFERENCE_FAILED,d.CONFERENCE_RESTARTED))},ue.prototype._onIceConnectionInterrupted=function(e){e.isP2P?this.isP2PConnectionInterrupted=!0:this.isJvbConnectionInterrupted=!0,e.isP2P===this.isP2PActive()&&this.eventEmitter.emit(l.CONNECTION_INTERRUPTED)},ue.prototype._onIceConnectionFailed=function(e){e.isP2P?(H.a.analytics.addPermanentProperties({p2pFailed:!0}),this.p2pJingleSession&&H.a.sendAnalyticsAndLog(Object(se.I)(se.j,{initiator:this.p2pJingleSession.isInitiator})),this._stopP2PSession("connectivity-error","ICE FAILED")):e&&this.jvbJingleSession===e&&(this._delayedIceFailed=new b.a(this),this._delayedIceFailed.start(e))},ue.prototype._onIceConnectionRestored=function(e){e.isP2P?this.isP2PConnectionInterrupted=!1:(this.isJvbConnectionInterrupted=!1,this._delayedIceFailed&&this._delayedIceFailed.cancel()),e.isP2P===this.isP2PActive()&&this.eventEmitter.emit(l.CONNECTION_RESTORED)},ue.prototype._acceptP2PIncomingCall=function(e,t){this.isP2PConnectionInterrupted=!1,this.p2pJingleSession=e,this._sendConferenceJoinAnalyticsEvent(),this.p2pJingleSession.initialize(this.room,this.rtc,ae({},this.options.config,{enableInsertableStreams:this.isE2EEEnabled()})),de.info("Starting CallStats for P2P connection...");let n=c.Strophe.getResourceFromJid(this.p2pJingleSession.remoteJid);const i=this.participants[n];i&&(n=i.getStatsID()||n),this.statistics.startCallStats(this.p2pJingleSession.peerconnection,n);const r=this.getLocalTracks();this.p2pJingleSession.acceptOffer(t,()=>{de.debug('Got RESULT for P2P "session-accept"'),this.eventEmitter.emit(l._MEDIA_SESSION_STARTED,this.p2pJingleSession)},e=>{de.error("Failed to accept incoming P2P Jingle session",e)},r)},ue.prototype._addRemoteJVBTracks=function(){this._addRemoteTracks("JVB",this.jvbJingleSession.peerconnection.getRemoteTracks())},ue.prototype._addRemoteP2PTracks=function(){this._addRemoteTracks("P2P",this.p2pJingleSession.peerconnection.getRemoteTracks())},ue.prototype._addRemoteTracks=function(e,t){for(const n of t)de.info(`Adding remote ${e} track: ${n}`),this.onRemoteTrackAdded(n)},ue.prototype._onIceConnectionEstablished=function(e){null!==this.p2pJingleSession&&(this.p2pEstablishmentDuration=this.p2pJingleSession.establishmentDuration),null!==this.jvbJingleSession&&(this.jvbEstablishmentDuration=this.jvbJingleSession.establishmentDuration);let t=!1;const n=this.options.config.forceJVB121Ratio;if(e.isP2P?this.p2pJingleSession!==e?(de.error("CONNECTION_ESTABLISHED - wrong P2P session instance ?!"),t=!0):!e.isInitiator&&"number"==typeof n&&Math.random()<n&&(de.info(`Forcing JVB 121 mode (ratio=${n})...`),H.a.analytics.addPermanentProperties({forceJvb121:!0}),this._stopP2PSession("decline","force JVB121"),t=!0):t=!0,!isNaN(this.p2pEstablishmentDuration)&&!isNaN(this.jvbEstablishmentDuration)){const e=this.p2pEstablishmentDuration-this.jvbEstablishmentDuration;H.a.sendAnalytics(se.p,{value:e})}e.isP2P===this.isP2PActive()&&this.eventEmitter.emit(l.CONNECTION_ESTABLISHED),t||(this._setP2PStatus(!0),this.jvbJingleSession?this._removeRemoteJVBTracks():de.info("Not removing remote JVB tracks - no session yet"),this._addRemoteP2PTracks(),this.jvbJingleSession&&this._suspendMediaTransferForJvbConnection(),de.info("Starting remote stats with p2p connection"),this.statistics.startRemoteStats(this.p2pJingleSession.peerconnection),H.a.sendAnalyticsAndLog(Object(se.I)(se.i,{initiator:this.p2pJingleSession.isInitiator})))},ue.prototype._updateProperties=function(e={}){const t=!a()(e,this.properties);if(this.properties=e,t){this.eventEmitter.emit(l.PROPERTIES_CHANGED,this.properties);["bridge-count","created-ms"].forEach(t=>{void 0!==e[t]&&H.a.analytics.addPermanentProperties({[t.replace("-","_")]:e[t]})})}},ue.prototype.getProperty=function(e){return this.properties[e]},ue.prototype._maybeClearDeferredStartP2P=function(){this.deferredStartP2PTask&&(de.info("Cleared deferred start P2P task"),clearTimeout(this.deferredStartP2PTask),this.deferredStartP2PTask=null)},ue.prototype._removeRemoteJVBTracks=function(){this._removeRemoteTracks("JVB",this.jvbJingleSession.peerconnection.getRemoteTracks())},ue.prototype._removeRemoteP2PTracks=function(){this._removeRemoteTracks("P2P",this.p2pJingleSession.peerconnection.getRemoteTracks())},ue.prototype._removeRemoteTracks=function(e,t){for(const n of t)de.info(`Removing remote ${e} track: ${n}`),this.onRemoteTrackRemoved(n)},ue.prototype._resumeMediaTransferForJvbConnection=function(){de.info("Resuming media transfer over the JVB connection..."),this.jvbJingleSession.setMediaTransferActive(!0,!0).then(()=>{de.info("Resumed media transfer over the JVB connection!")},e=>{de.error("Failed to resume media transfer over the JVB connection:",e)})},ue.prototype._setP2PStatus=function(e){if(this.p2p!==e){if(this.p2p=e,e){de.info("Peer to peer connection established!"),H.a.analytics.addPermanentProperties({p2pFailed:!1,forceJvb121:!1});const e=0!==this.getLastN();this.p2pJingleSession.setMediaTransferActive(!0,e).catch(t=>{de.error(`Failed to sync up P2P video transfer status(${e})`,t)})}else de.info("Peer to peer connection closed!");this.jvbJingleSession&&this.statistics.sendConnectionResumeOrHoldEvent(this.jvbJingleSession.peerconnection,!e),this.dtmfManager=null,this.eventEmitter.emit(l.P2P_STATUS,this,this.p2p),this.eventEmitter.emit(l._MEDIA_SESSION_ACTIVE_CHANGED,this._getActiveMediaSession()),this.eventEmitter.emit(this.isConnectionInterrupted()?l.CONNECTION_INTERRUPTED:l.CONNECTION_RESTORED)}else de.debug("Called _setP2PStatus with the same status: "+e)},ue.prototype._startP2PSession=function(e){if(this._maybeClearDeferredStartP2P(),this.p2pJingleSession)return void de.error("P2P session already started!");this.isP2PConnectionInterrupted=!1,this.p2pJingleSession=this.xmpp.connection.jingle.newP2PJingleSession(this.room.myroomjid,e),de.info("Created new P2P JingleSession",this.room.myroomjid,e),this._sendConferenceJoinAnalyticsEvent(),this.p2pJingleSession.initialize(this.room,this.rtc,ae({},this.options.config,{enableInsertableStreams:this.isE2EEEnabled()})),de.info("Starting CallStats for P2P connection...");let t=c.Strophe.getResourceFromJid(this.p2pJingleSession.remoteJid);const n=this.participants[t];n&&(t=n.getStatsID()||t),this.statistics.startCallStats(this.p2pJingleSession.peerconnection,t);const i=this.getLocalTracks();this.p2pJingleSession.invite(i)},ue.prototype._suspendMediaTransferForJvbConnection=function(){de.info("Suspending media transfer over the JVB connection..."),this.jvbJingleSession.setMediaTransferActive(!1,!1).then(()=>{de.info("Suspended media transfer over the JVB connection !")},e=>{de.error("Failed to suspend media transfer over the JVB connection:",e)})},ue.prototype._maybeStartOrStopP2P=function(e){if(!this.isP2PEnabled()||this.isP2PTestModeEnabled()||y.a.isFirefox()||y.a.isWebKitBased())return void de.info("Auto P2P disabled");const t=this.getParticipants(),n=t.length,i=this._shouldBeInP2PMode();if(!i&&this.deferredStartP2PTask&&this._maybeClearDeferredStartP2P(),!this.p2pJingleSession&&i){const i=n&&t[0],r=this.myUserId(),s=i.getId();if(r>s)return void de.debug("I'm the bigger peersId - the other peer should start P2P",r,s);if(r===s)return void de.error("The same IDs ? ",r,s);const o=i.getJid();if(e){if(this.deferredStartP2PTask)return void de.error("Deferred start P2P task's been set already!");de.info(`Will start P2P with: ${o} after ${this.backToP2PDelay} seconds...`),this.deferredStartP2PTask=setTimeout(this._startP2PSession.bind(this,o),1e3*this.backToP2PDelay)}else de.info("Will start P2P with: "+o),this._startP2PSession(o)}else this.p2pJingleSession&&!i&&(de.info("Will stop P2P with: "+this.p2pJingleSession.remoteJid),this.p2pJingleSession.isInitiator&&n>1&&H.a.sendAnalyticsAndLog(Object(se.I)(se.k)),this._stopP2PSession())},ue.prototype._shouldBeInP2PMode=function(){const e=this.getParticipants(),t=e.length,n=void 0!==e.find(e=>"poltergeist"===e.getBotType()||e.hasFeature(Y.c)),i=1===t&&!n;return de.debug(`P2P? peerCount: ${t}, hasBotPeer: ${n} => ${i}`),i},ue.prototype._stopP2PSession=function(e,t){if(!this.p2pJingleSession)return void de.error("No P2P session to be stopped!");const n=this.isP2PActive();n&&(this.jvbJingleSession&&this._resumeMediaTransferForJvbConnection(),this._removeRemoteP2PTracks()),de.info("Stopping remote stats for P2P connection"),this.statistics.stopRemoteStats(this.p2pJingleSession.peerconnection),de.info("Stopping CallStats for P2P connection"),this.statistics.stopCallStats(this.p2pJingleSession.peerconnection),this.p2pJingleSession.terminate(()=>{de.info("P2P session terminate RESULT")},t=>{e&&de.error("An error occurred while trying to terminate P2P Jingle session",t)},{reason:e||"success",reasonDescription:t||"Turing off P2P session",sendSessionTerminate:this.room&&this.getParticipantById(c.Strophe.getResourceFromJid(this.p2pJingleSession.remoteJid))}),this.p2pJingleSession=null,this._setP2PStatus(!1),n&&(this.jvbJingleSession?this._addRemoteJVBTracks():de.info("Not adding remote JVB tracks - no session yet"))},ue.prototype.isP2PActive=function(){return this.p2p},ue.prototype.getP2PConnectionState=function(){return this.isP2PActive()?this.p2pJingleSession.peerconnection.getConnectionState():null},ue.prototype.setDesktopSharingFrameRate=function(e){return"number"!=typeof e||isNaN(e)?(de.error(`Invalid value ${e} specified for desktop capture frame rate`),!1):(this._desktopSharingFrameRate=e,this.jvbJingleSession&&this.jvbJingleSession.peerconnection.setDesktopSharingFrameRate(e),this.rtc.setDesktopSharingFrameRate(e),!0)},ue.prototype.startP2PSession=function(){const e=this.getParticipants();if(1!==e.length)throw new Error("There must be exactly 1 participant to start the P2P session !");{const t=e[0].getJid();this._startP2PSession(t)}},ue.prototype.stopP2PSession=function(){this._stopP2PSession()},ue.prototype.getSpeakerStats=function(){return this.speakerStatsCollector.getStats()},ue.prototype.setReceiverConstraints=function(e){this.receiveVideoController.setReceiverConstraints(e)},ue.prototype.setReceiverVideoConstraint=function(e){this.receiveVideoController.setPreferredReceiveMaxFrameHeight(e)},ue.prototype.setSenderVideoConstraint=function(e){return this.sendVideoController.setPreferredSendMaxFrameHeight(e)},ue.prototype.createVideoSIPGWSession=function(e,t){return this.room?this.videoSIPGWHandler.createVideoSIPGWSession(e,t):new Error(Q.ERROR_NO_CONNECTION)},ue.prototype._sendConferenceJoinAnalyticsEvent=function(){const e=this.getMeetingUniqueId();!this._conferenceJoinAnalyticsEventSent&&e&&null!==this.getActivePeerConnection()&&(H.a.sendAnalytics(Object(se.A)("joined",{meetingId:e,participantId:`${e}.${this._statsCurrentId}`})),this._conferenceJoinAnalyticsEventSent=Date.now())},ue.prototype._sendConferenceLeftAnalyticsEvent=function(){const e=this.getMeetingUniqueId();e&&this._conferenceJoinAnalyticsEventSent&&H.a.sendAnalytics(Object(se.A)("left",{meetingId:e,participantId:`${e}.${this._statsCurrentId}`,stats:{duration:Math.floor((Date.now()-this._conferenceJoinAnalyticsEventSent)/1e3),perf:this.getPerformanceStats()}}))},ue.prototype._restartMediaSessions=function(){this.p2pJingleSession&&this.stopP2PSession(),this.jvbJingleSession&&this.jvbJingleSession.terminate(null,e=>{de.warn("An error occurred while trying to terminate the JVB session",e)},{reason:"success",reasonDescription:"restart required",requestRestart:!0,sendSessionTerminate:!0}),this._maybeStartOrStopP2P(!1)},ue.prototype.isE2EEEnabled=function(){return this._e2eEncryption&&this._e2eEncryption.isEnabled()},ue.prototype.isE2EESupported=function(){return O.a.isSupported(this.options.config)},ue.prototype.toggleE2EE=function(e){this.isE2EESupported()?this._e2eEncryption.setEnabled(e):de.warn("Cannot enable / disable E2EE: platform is not supported.")},ue.prototype.isLobbySupported=function(){return Boolean(this.room&&this.room.getLobby().isSupported())},ue.prototype.isMembersOnly=function(){return Boolean(this.room&&this.room.membersOnlyEnabled)},ue.prototype.enableLobby=function(){return this.room&&this.isModerator()?this.room.getLobby().enable():Promise.reject(new Error("The conference not started or user is not moderator"))},ue.prototype.disableLobby=function(){this.room&&this.isModerator()?this.room.getLobby().disable():de.warn(`Failed to disable lobby, ${this.room?"":"not in a room, "}${this.isModerator()?"":"participant is not a moderator"}`)},ue.prototype.joinLobby=function(e,t){return this.room?this.room.getLobby().join(e,t):Promise.reject(new Error("The conference not started"))},ue.prototype.lobbyDenyAccess=function(e){this.room&&this.room.getLobby().denyAccess(e)},ue.prototype.lobbyApproveAccess=function(e){this.room&&this.room.getLobby().approveAccess(e)},ue.prototype.isAVModerationSupported=function(){return Boolean(this.room&&this.room.getAVModeration().isSupported())},ue.prototype.enableAVModeration=function(e){this.room&&this.isModerator()&&(e===ne.a||e===ne.c)?this.room.getAVModeration().enable(!0,e):de.warn(`Failed to enable AV moderation, ${this.room?"":"not in a room, "}${this.isModerator()?"":"participant is not a moderator, "}${this.room&&this.isModerator()?"wrong media type passed":""}`)},ue.prototype.disableAVModeration=function(e){this.room&&this.isModerator()&&(e===ne.a||e===ne.c)?this.room.getAVModeration().enable(!1,e):de.warn(`Failed to disable AV moderation, ${this.room?"":"not in a room, "}${this.isModerator()?"":"participant is not a moderator, "}${this.room&&this.isModerator()?"wrong media type passed":""}`)},ue.prototype.avModerationApprove=function(e,t){if(this.room&&this.isModerator()&&(e===ne.a||e===ne.c)){const n=this.getParticipantById(t);if(!n)return;this.room.getAVModeration().approve(e,n.getJid())}else de.warn(`AV moderation skipped , ${this.room?"":"not in a room, "}${this.isModerator()?"":"participant is not a moderator, "}${this.room&&this.isModerator()?"wrong media type passed":""}`)}}).call(this,"JitsiConference.js")},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return b}));var i=n(5),r=n(2),s=n(17),o=n(1),a=n(43),c=n(6),d=n(95),u=n.n(d),l=n(4),h=n(7),p=n.n(h),m=n(15),f=n.n(m),g=n(73),_=n.n(g),v=n(8),S=n(0),y=n.n(S);const E=Object(i.getLogger)(e);function b(e){this.conference=e,this.xmppListeners={},e.on(o.TRACK_MUTE_CHANGED,t=>{if(!t.isLocal()||!e.statistics)return;const n=t.isP2P?e.p2pJingleSession:e.jvbJingleSession,i=n&&n.peerconnection||null;e.statistics.sendMuteEvent(i,t.isMuted(),t.getType())})}b.prototype.setupChatRoomListeners=function(){const e=this.conference,t=e.room;this.chatRoomForwarder=new u.a(t,this.conference.eventEmitter),t.addListener(y.a.ICE_RESTARTING,t=>{t.isP2P||e.rtc.closeBridgeChannel()}),t.addListener(y.a.PARTICIPANT_FEATURES_CHANGED,(t,n)=>{const i=e.getParticipantById(r.Strophe.getResourceFromJid(t));i&&(i.setFeatures(n),e.eventEmitter.emit(o.PARTCIPANT_FEATURES_CHANGED,i))}),t.addListener(y.a.ICE_RESTART_SUCCESS,(t,n)=>{!t.isP2P&&e._setBridgeChannel(n,t.peerconnection)}),t.addListener(y.a.AUDIO_MUTED_BY_FOCUS,t=>{c.a.sendAnalytics(Object(v.K)(l.a)),e.mutedByFocusActor=t,e.rtc.setAudioMute(!0).then(()=>{e.isMutedByFocus=!0,e.mutedByFocusActor=null}).catch(t=>{e.mutedByFocusActor=null,E.warn("Error while audio muting due to focus request",t)})}),t.addListener(y.a.VIDEO_MUTED_BY_FOCUS,t=>{c.a.sendAnalytics(Object(v.K)(l.c)),e.mutedVideoByFocusActor=t,e.rtc.setVideoMute(!0).then(()=>{e.isVideoMutedByFocus=!0,e.mutedVideoByFocusActor=null}).catch(t=>{e.mutedVideoByFocusActor=null,E.warn("Error while video muting due to focus request",t)})}),this.chatRoomForwarder.forward(y.a.SUBJECT_CHANGED,o.SUBJECT_CHANGED),this.chatRoomForwarder.forward(y.a.MUC_JOINED,o.CONFERENCE_JOINED),this.chatRoomForwarder.forward(y.a.MEETING_ID_SET,o.CONFERENCE_UNIQUE_ID_SET),t.addListener(y.a.MUC_JOINED,()=>{this.conference._onMucJoined(),this.conference.isJvbConnectionInterrupted=!1,Object.keys(t.connectionTimes).forEach(e=>{const n=Object(v.C)("conference_"+e,{value:t.connectionTimes[e]});c.a.sendAnalytics(n)}),Object.keys(t.xmpp.connectionTimes).forEach(e=>{const n=Object(v.C)("xmpp_"+e,{value:t.xmpp.connectionTimes[e]});c.a.sendAnalytics(n)})}),t.addListener(y.a.RENEGOTIATION_FAILED,(t,n)=>{n.isP2P||e.eventEmitter.emit(o.CONFERENCE_FAILED,s.OFFER_ANSWER_FAILED,t)}),this.chatRoomForwarder.forward(y.a.ROOM_JOIN_ERROR,o.CONFERENCE_FAILED,s.CONNECTION_ERROR),this.chatRoomForwarder.forward(y.a.ROOM_CONNECT_ERROR,o.CONFERENCE_FAILED,s.CONNECTION_ERROR),this.chatRoomForwarder.forward(y.a.ROOM_CONNECT_NOT_ALLOWED_ERROR,o.CONFERENCE_FAILED,s.NOT_ALLOWED_ERROR),this.chatRoomForwarder.forward(y.a.ROOM_CONNECT_MEMBERS_ONLY_ERROR,o.CONFERENCE_FAILED,s.MEMBERS_ONLY_ERROR),this.chatRoomForwarder.forward(y.a.ROOM_MAX_USERS_ERROR,o.CONFERENCE_FAILED,s.CONFERENCE_MAX_USERS),this.chatRoomForwarder.forward(y.a.PASSWORD_REQUIRED,o.CONFERENCE_FAILED,s.PASSWORD_REQUIRED),this.chatRoomForwarder.forward(y.a.AUTHENTICATION_REQUIRED,o.CONFERENCE_FAILED,s.AUTHENTICATION_REQUIRED),this.chatRoomForwarder.forward(y.a.BRIDGE_DOWN,o.CONFERENCE_FAILED,s.VIDEOBRIDGE_NOT_AVAILABLE),t.addListener(y.a.BRIDGE_DOWN,()=>c.a.sendAnalytics(Object(v.z)())),t.addListener(y.a.CONNECTION_RESTARTED,t=>{e._onConferenceRestarted(t)}),this.chatRoomForwarder.forward(y.a.RESERVATION_ERROR,o.CONFERENCE_FAILED,s.RESERVATION_ERROR),this.chatRoomForwarder.forward(y.a.GRACEFUL_SHUTDOWN,o.CONFERENCE_FAILED,s.GRACEFUL_SHUTDOWN),t.addListener(y.a.CONNECTION_ICE_FAILED,t=>{e._onIceConnectionFailed(t)}),this.chatRoomForwarder.forward(y.a.MUC_DESTROYED,o.CONFERENCE_FAILED,s.CONFERENCE_DESTROYED),this.chatRoomForwarder.forward(y.a.CHAT_ERROR_RECEIVED,o.CONFERENCE_ERROR,s.CHAT_ERROR),this.chatRoomForwarder.forward(y.a.FOCUS_DISCONNECTED,o.CONFERENCE_FAILED,s.FOCUS_DISCONNECTED),t.addListener(y.a.FOCUS_LEFT,()=>{c.a.sendAnalytics(Object(v.E)()),e.eventEmitter.emit(o.CONFERENCE_FAILED,s.FOCUS_LEFT)}),t.addListener(y.a.SESSION_ACCEPT_TIMEOUT,e=>{c.a.sendAnalyticsAndLog(Object(v.G)(v.b,{p2p:e.isP2P}))}),t.addListener(y.a.RECORDER_STATE_CHANGED,(t,n)=>{if(n){const i=r.Strophe.getResourceFromJid(n),s=e.getParticipantById(i)||i;"off"===t.getStatus()?t.setTerminator(s):"on"===t.getStatus()&&t.setInitiator(s)}e.eventEmitter.emit(o.RECORDER_STATE_CHANGED,t)}),this.chatRoomForwarder.forward(y.a.TRANSCRIPTION_STATUS_CHANGED,o.TRANSCRIPTION_STATUS_CHANGED),this.chatRoomForwarder.forward(y.a.VIDEO_SIP_GW_AVAILABILITY_CHANGED,o.VIDEO_SIP_GW_AVAILABILITY_CHANGED),this.chatRoomForwarder.forward(y.a.VIDEO_SIP_GW_SESSION_STATE_CHANGED,o.VIDEO_SIP_GW_SESSION_STATE_CHANGED),this.chatRoomForwarder.forward(y.a.PHONE_NUMBER_CHANGED,o.PHONE_NUMBER_CHANGED),t.setParticipantPropertyListener((t,n)=>{const i=e.getParticipantById(n);i&&i.setProperty(t.tagName.substring("jitsi_participant_".length),t.value)}),t.addListener(y.a.KICKED,e.onMemberKicked.bind(e)),t.addListener(y.a.SUSPEND_DETECTED,e.onSuspendDetected.bind(e)),this.chatRoomForwarder.forward(y.a.MUC_LOCK_CHANGED,o.LOCK_STATE_CHANGED),this.chatRoomForwarder.forward(y.a.MUC_MEMBERS_ONLY_CHANGED,o.MEMBERS_ONLY_CHANGED),t.addListener(y.a.MUC_MEMBER_JOINED,e.onMemberJoined.bind(e)),this.chatRoomForwarder.forward(y.a.MUC_LOBBY_MEMBER_JOINED,o.LOBBY_USER_JOINED),this.chatRoomForwarder.forward(y.a.MUC_LOBBY_MEMBER_UPDATED,o.LOBBY_USER_UPDATED),this.chatRoomForwarder.forward(y.a.MUC_LOBBY_MEMBER_LEFT,o.LOBBY_USER_LEFT),t.addListener(y.a.MUC_MEMBER_BOT_TYPE_CHANGED,e._onMemberBotTypeChanged.bind(e)),t.addListener(y.a.MUC_MEMBER_LEFT,e.onMemberLeft.bind(e)),this.chatRoomForwarder.forward(y.a.MUC_LEFT,o.CONFERENCE_LEFT),this.chatRoomForwarder.forward(y.a.MUC_DENIED_ACCESS,o.CONFERENCE_FAILED,s.CONFERENCE_ACCESS_DENIED),t.addListener(y.a.DISPLAY_NAME_CHANGED,e.onDisplayNameChanged.bind(e)),t.addListener(y.a.LOCAL_ROLE_CHANGED,t=>{e.onLocalRoleChanged(t),e.statistics&&e.isModerator()&&e.on(o.RECORDER_STATE_CHANGED,e=>{const t={error:e.getError(),id:"recorder_status",status:e.getStatus()};c.a.sendLog(JSON.stringify(t))})}),t.addListener(y.a.MUC_ROLE_CHANGED,e.onUserRoleChanged.bind(e)),t.addListener(_.a.IDENTITY_UPDATED,(t,n)=>{e.authEnabled=t,e.authIdentity=n,e.eventEmitter.emit(o.AUTH_STATUS_CHANGED,t,n)}),t.addListener(y.a.MESSAGE_RECEIVED,(t,n,i,s)=>{const a=r.Strophe.getResourceFromJid(t);e.eventEmitter.emit(o.MESSAGE_RECEIVED,a,n,s)}),t.addListener(y.a.PRIVATE_MESSAGE_RECEIVED,(t,n,i,s)=>{const a=r.Strophe.getResourceFromJid(t);e.eventEmitter.emit(o.PRIVATE_MESSAGE_RECEIVED,a,n,s)}),t.addListener(y.a.PRESENCE_STATUS,(t,n)=>{const i=r.Strophe.getResourceFromJid(t),s=e.getParticipantById(i);s&&s._status!==n&&(s._status=n,e.eventEmitter.emit(o.USER_STATUS_CHANGED,i,n))}),t.addListener(y.a.JSON_MESSAGE_RECEIVED,(t,n)=>{const i=r.Strophe.getResourceFromJid(t),s=e.getParticipantById(i);s?e.eventEmitter.emit(o.ENDPOINT_MESSAGE_RECEIVED,s,n):e.eventEmitter.emit(o.NON_PARTICIPANT_MESSAGE_RECEIVED,i,n)}),t.addPresenceListener("startmuted",(t,n)=>{let i=!1;if(e.myUserId()===n&&e.isModerator())i=!0;else{const t=e.getParticipantById(n);t&&t.isModerator()&&(i=!0)}if(!i)return;const r="true"===t.attributes.audio,s="true"===t.attributes.video;let a=!1;r!==e.startMutedPolicy.audio&&(e.startMutedPolicy.audio=r,a=!0),s!==e.startMutedPolicy.video&&(e.startMutedPolicy.video=s,a=!0),a&&e.eventEmitter.emit(o.START_MUTED_POLICY_CHANGED,e.startMutedPolicy)}),e.statistics&&(t.addListener(y.a.CONNECTION_ICE_FAILED,t=>{e.statistics.sendIceConnectionFailedEvent(t.peerconnection)}),t.addListener(y.a.ADD_ICE_CANDIDATE_FAILED,(t,n)=>{e.statistics.sendAddIceCandidateFailed(t,n)}))},b.prototype.setupRTCListeners=function(){const e=this.conference,t=e.rtc;t.addListener(p.a.REMOTE_TRACK_ADDED,e.onRemoteTrackAdded.bind(e)),t.addListener(p.a.REMOTE_TRACK_REMOVED,e.onRemoteTrackRemoved.bind(e)),t.addListener(p.a.DOMINANT_SPEAKER_CHANGED,(t,n)=>{if(e.lastDominantSpeaker!==t&&e.room){if(e.lastDominantSpeaker=t,e.eventEmitter.emit(o.DOMINANT_SPEAKER_CHANGED,t,n),n&&n.length){const i=n.slice(0);e.myUserId!==t&&i.splice(0,0,t),i.length>a.b&&i.splice(a.b,i.length-a.b),e.statistics&&e.statistics.setSpeakerList(i)}e.statistics&&e.myUserId()===t&&e.statistics.sendDominantSpeakerEvent(e.room.roomjid)}}),t.addListener(p.a.DATA_CHANNEL_OPEN,()=>{const t=window.performance.now(),n="data.channel.opened";E.log(`(TIME) ${n}:\t`,t),e.room.connectionTimes[n]=t,c.a.sendAnalytics(Object(v.C)(n,{value:t})),e.eventEmitter.emit(o.DATA_CHANNEL_OPENED)}),t.addListener(p.a.ENDPOINT_MESSAGE_RECEIVED,(t,n)=>{const i=e.getParticipantById(t);i?e.eventEmitter.emit(o.ENDPOINT_MESSAGE_RECEIVED,i,n):E.warn("Ignored ENDPOINT_MESSAGE_RECEIVED for not existing participant: "+t,n)}),t.addListener(p.a.ENDPOINT_STATS_RECEIVED,(t,n)=>{const i=e.getParticipantById(t);i?e.eventEmitter.emit(o.ENDPOINT_STATS_RECEIVED,i,n):E.warn("Ignoring ENDPOINT_STATS_RECEIVED for a non-existant participant: "+t)}),t.addListener(p.a.LOCAL_UFRAG_CHANGED,(e,t)=>{e.isP2P||c.a.sendLog(JSON.stringify({id:"local_ufrag",value:t}))}),t.addListener(p.a.REMOTE_UFRAG_CHANGED,(e,t)=>{e.isP2P||c.a.sendLog(JSON.stringify({id:"remote_ufrag",value:t}))}),t.addListener(p.a.CREATE_ANSWER_FAILED,(t,n)=>{e.statistics.sendCreateAnswerFailed(t,n),n.isP2P||e.eventEmitter.emit(o.CONFERENCE_FAILED,s.OFFER_ANSWER_FAILED,t)}),t.addListener(p.a.CREATE_OFFER_FAILED,(t,n)=>{e.statistics.sendCreateOfferFailed(t,n),n.isP2P||e.eventEmitter.emit(o.CONFERENCE_FAILED,s.OFFER_ANSWER_FAILED,t)}),t.addListener(p.a.SET_LOCAL_DESCRIPTION_FAILED,(t,n)=>{e.statistics.sendSetLocalDescFailed(t,n),n.isP2P||e.eventEmitter.emit(o.CONFERENCE_FAILED,s.OFFER_ANSWER_FAILED,t)}),t.addListener(p.a.SET_REMOTE_DESCRIPTION_FAILED,(t,n)=>{e.statistics.sendSetRemoteDescFailed(t,n),n.isP2P||e.eventEmitter.emit(o.CONFERENCE_FAILED,s.OFFER_ANSWER_FAILED,t)}),t.addListener(p.a.LOCAL_TRACK_SSRC_UPDATED,(t,n)=>{t.isVideoTrack()&&t.videoType===f.a.DESKTOP&&e.statistics.sendScreenSharingEvent(!0,n)})},b.prototype.removeXMPPListeners=function(){const e=this.conference;Object.keys(this.xmppListeners).forEach(t=>{e.xmpp.removeListener(t,this.xmppListeners[t])}),this.xmppListeners={}},b.prototype.setupXMPPListeners=function(){const e=this.conference;this._addConferenceXMPPListener(y.a.CALL_INCOMING,e.onIncomingCall.bind(e)),this._addConferenceXMPPListener(y.a.CALL_ACCEPTED,e.onCallAccepted.bind(e)),this._addConferenceXMPPListener(y.a.TRANSPORT_INFO,e.onTransportInfo.bind(e)),this._addConferenceXMPPListener(y.a.CALL_ENDED,e.onCallEnded.bind(e)),this._addConferenceXMPPListener(y.a.START_MUTED_FROM_FOCUS,(t,n)=>{e.options.config.ignoreStartMuted||(e.startAudioMuted=t,e.startVideoMuted=n,e.getLocalTracks().forEach(t=>{switch(t.getType()){case l.a:e.startAudioMuted&&t.mute();break;case l.c:e.startVideoMuted&&t.mute()}}),e.eventEmitter.emit(o.STARTED_MUTED))}),this._addConferenceXMPPListener(y.a.CONFERENCE_TIMESTAMP_RECEIVED,t=>{e.eventEmitter.emit(o.CONFERENCE_CREATED_TIMESTAMP,t)}),this._addConferenceXMPPListener(y.a.AV_MODERATION_CHANGED,(t,n,i)=>{const r=e.getParticipants().find(e=>e.getJid()===i);e.eventEmitter.emit(o.AV_MODERATION_CHANGED,{enabled:t,mediaType:n,actor:r})}),this._addConferenceXMPPListener(y.a.AV_MODERATION_PARTICIPANT_APPROVED,(t,n)=>{const i=e.getParticipantById(r.Strophe.getResourceFromJid(n));i&&e.eventEmitter.emit(o.AV_MODERATION_PARTICIPANT_APPROVED,{participant:i,mediaType:t})}),this._addConferenceXMPPListener(y.a.AV_MODERATION_APPROVED,t=>e.eventEmitter.emit(o.AV_MODERATION_APPROVED,{mediaType:t}))},b.prototype._addConferenceXMPPListener=function(e,t){this.xmppListeners[e]=t,this.conference.xmpp.addListener(e,t)},b.prototype.setupStatisticsListeners=function(){const e=this.conference;e.statistics&&(e.statistics.addAudioLevelListener((t,n,i,r)=>{e.rtc.setAudioLevel(t,n,i,r)}),e.statistics.addBeforeDisposedListener(()=>{e.eventEmitter.emit(o.BEFORE_STATISTICS_DISPOSED)}),e.options.config.startSilent||e.statistics.addByteSentStatsListener((t,n)=>{e.getLocalTracks(l.a).forEach(e=>{const i=t.getLocalSSRC(e);i&&n.hasOwnProperty(i)&&e._onByteSentStatsReceived(t,n[i])})}))}}).call(this,"JitsiConferenceEventManager.js")},function(e,t,n){"use strict";(function(e,i){n.d(t,"a",(function(){return a}));var r=n(58),s=n(5);const o=Object(s.getLogger)(e);class a extends r.a{constructor(){super(),o.info(`This appears to be ${this.getName()}, ver: ${this.getVersion()}`)}doesVideoMuteByStreamRemove(){return this.isChromiumBased()||this.isWebKitBased()}isChromiumBased(){return(this.isChrome()||this.isElectron()||this.isNWJS()||this.isOpera())&&!this.isWebKitBased()}isIosBrowser(){const{userAgent:e,maxTouchPoints:t,platform:n}=navigator;return e.match(/iP(ad|hone|od)/i)}isWebKitBased(){return this._bowser.isEngine("webkit")&&void 0!==navigator.mediaDevices&&void 0!==navigator.mediaDevices.getUserMedia&&void 0!==window.RTCRtpTransceiver&&Object.keys(RTCRtpTransceiver.prototype).indexOf("currentDirection")>-1}isTwa(){return"matchMedia"in window&&window.matchMedia("(display-mode:standalone)").matches}isSupported(){return this.isChromiumBased()&&this._getChromiumBasedVersion()>=72||this.isFirefox()||this.isReactNative()||this.isWebKitBased()}isUserInteractionRequiredForUnmute(){return this.isFirefox()&&this.isVersionLessThan("68")}supportsVideoMuteOnConnInterrupted(){return this.isChromiumBased()||this.isReactNative()}supportsBandwidthStatistics(){return!this.isFirefox()&&!this.isWebKitBased()}supportsCodecPreferences(){return Boolean(window.RTCRtpTransceiver&&"setCodecPreferences"in window.RTCRtpTransceiver.prototype&&window.RTCRtpReceiver&&void 0!==window.RTCRtpReceiver.getCapabilities)&&!this.isWebKitBased()}supportsDeviceChangeEvent(){return navigator.mediaDevices&&void 0!==navigator.mediaDevices.ondevicechange&&void 0!==navigator.mediaDevices.addEventListener}supportsLocalCandidateRttStatistics(){return this.isChromiumBased()||this.isReactNative()||this.isWebKitBased()}supportsPerformanceObserver(){return void 0!==window.PerformanceObserver&&PerformanceObserver.supportedEntryTypes.indexOf("longtask")>-1}supportsReceiverStats(){return void 0!==window.RTCRtpReceiver&&Object.keys(RTCRtpReceiver.prototype).indexOf("getSynchronizationSources")>-1&&!this.isWebKitBased()}supportsRTTStatistics(){return!this.isFirefox()}usesSdpMungingForSimulcast(){return this.isChromiumBased()||this.isReactNative()||this.isWebKitBased()}usesAdapter(){return!this.isReactNative()}usesRidsForSimulcast(){return!1}supportsGetDisplayMedia(){return void 0!==navigator.getDisplayMedia||void 0!==navigator.mediaDevices&&void 0!==navigator.mediaDevices.getDisplayMedia}supportsEncodedTransform(){return Boolean(window.RTCRtpScriptTransform)}supportsInsertableStreams(){if(void 0===window.RTCRtpSender||!window.RTCRtpSender.prototype.createEncodedStreams)return!1;const e=new ReadableStream;try{return window.postMessage(e,"*",[e]),!0}catch(e){return!1}}supportsAudioRed(){return Boolean(window.RTCRtpSender&&window.RTCRtpSender.getCapabilities&&window.RTCRtpSender.getCapabilities("audio").codecs.some(e=>"audio/red"===e.mimeType)&&window.RTCRtpReceiver&&window.RTCRtpReceiver.getCapabilities&&window.RTCRtpReceiver.getCapabilities("audio").codecs.some(e=>"audio/red"===e.mimeType))}supportsUnifiedPlan(){return!this.isReactNative()}supportsVADDetection(){return this.isChromiumBased()}_getChromiumBasedVersion(){if(this.isChromiumBased()){if(this.isNWJS())return Number.parseInt(i.versions.chromium,10);const e=navigator.userAgent;if(e.match(/Chrome/)){return Number.parseInt(e.match(/Chrome\/([\d.]+)/)[1],10)}}return-1}}}).call(this,"modules/browser/BrowserCapabilities.js",n(62))},function(e,t,n){e.exports=function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=90)}({17:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var i=n(18),r=function(){function e(){}return e.getFirstMatch=function(e,t){var n=t.match(e);return n&&n.length>0&&n[1]||""},e.getSecondMatch=function(e,t){var n=t.match(e);return n&&n.length>1&&n[2]||""},e.matchAndReturnConst=function(e,t,n){if(e.test(t))return n},e.getWindowsVersionName=function(e){switch(e){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},e.getMacOSVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),10===t[0])switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},e.getAndroidVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0},e.getVersionPrecision=function(e){return e.split(".").length},e.compareVersions=function(t,n,i){void 0===i&&(i=!1);var r=e.getVersionPrecision(t),s=e.getVersionPrecision(n),o=Math.max(r,s),a=0,c=e.map([t,n],(function(t){var n=o-e.getVersionPrecision(t),i=t+new Array(n+1).join(".0");return e.map(i.split("."),(function(e){return new Array(20-e.length).join("0")+e})).reverse()}));for(i&&(a=o-Math.min(r,s)),o-=1;o>=a;){if(c[0][o]>c[1][o])return 1;if(c[0][o]===c[1][o]){if(o===a)return 0;o-=1}else if(c[0][o]<c[1][o])return-1}},e.map=function(e,t){var n,i=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(n=0;n<e.length;n+=1)i.push(t(e[n]));return i},e.getBrowserAlias=function(e){return i.BROWSER_ALIASES_MAP[e]},e.getBrowserTypeByAlias=function(e){return i.BROWSER_MAP[e]||""},e}();t.default=r,e.exports=t.default},18:function(e,t,n){"use strict";t.__esModule=!0,t.ENGINE_MAP=t.OS_MAP=t.PLATFORMS_MAP=t.BROWSER_MAP=t.BROWSER_ALIASES_MAP=void 0,t.BROWSER_ALIASES_MAP={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},t.BROWSER_MAP={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},t.PLATFORMS_MAP={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},t.OS_MAP={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},t.ENGINE_MAP={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"}},90:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var i,r=(i=n(91))&&i.__esModule?i:{default:i},s=n(18);function o(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var a=function(){function e(){}var t,n;return e.getParser=function(e,t){if(void 0===t&&(t=!1),"string"!=typeof e)throw new Error("UserAgent should be a string");return new r.default(e,t)},e.parse=function(e){return new r.default(e).getResult()},t=e,(n=[{key:"BROWSER_MAP",get:function(){return s.BROWSER_MAP}},{key:"ENGINE_MAP",get:function(){return s.ENGINE_MAP}},{key:"OS_MAP",get:function(){return s.OS_MAP}},{key:"PLATFORMS_MAP",get:function(){return s.PLATFORMS_MAP}}])&&o(t,n),e}();t.default=a,e.exports=t.default},91:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var i=c(n(92)),r=c(n(93)),s=c(n(94)),o=c(n(95)),a=c(n(17));function c(e){return e&&e.__esModule?e:{default:e}}var d=function(){function e(e,t){if(void 0===t&&(t=!1),null==e||""===e)throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},!0!==t&&this.parse()}var t=e.prototype;return t.getUA=function(){return this._ua},t.test=function(e){return e.test(this._ua)},t.parseBrowser=function(){var e=this;this.parsedResult.browser={};var t=i.default.find((function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.browser=t.describe(this.getUA())),this.parsedResult.browser},t.getBrowser=function(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()},t.getBrowserName=function(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""},t.getBrowserVersion=function(){return this.getBrowser().version},t.getOS=function(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()},t.parseOS=function(){var e=this;this.parsedResult.os={};var t=r.default.find((function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.os=t.describe(this.getUA())),this.parsedResult.os},t.getOSName=function(e){var t=this.getOS().name;return e?String(t).toLowerCase()||"":t||""},t.getOSVersion=function(){return this.getOS().version},t.getPlatform=function(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()},t.getPlatformType=function(e){void 0===e&&(e=!1);var t=this.getPlatform().type;return e?String(t).toLowerCase()||"":t||""},t.parsePlatform=function(){var e=this;this.parsedResult.platform={};var t=s.default.find((function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.platform=t.describe(this.getUA())),this.parsedResult.platform},t.getEngine=function(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()},t.getEngineName=function(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""},t.parseEngine=function(){var e=this;this.parsedResult.engine={};var t=o.default.find((function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.engine=t.describe(this.getUA())),this.parsedResult.engine},t.parse=function(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this},t.getResult=function(){return Object.assign({},this.parsedResult)},t.satisfies=function(e){var t=this,n={},i=0,r={},s=0;if(Object.keys(e).forEach((function(t){var o=e[t];"string"==typeof o?(r[t]=o,s+=1):"object"==typeof o&&(n[t]=o,i+=1)})),i>0){var o=Object.keys(n),a=o.find((function(e){return t.isOS(e)}));if(a){var c=this.satisfies(n[a]);if(void 0!==c)return c}var d=o.find((function(e){return t.isPlatform(e)}));if(d){var u=this.satisfies(n[d]);if(void 0!==u)return u}}if(s>0){var l=Object.keys(r).find((function(e){return t.isBrowser(e,!0)}));if(void 0!==l)return this.compareVersion(r[l])}},t.isBrowser=function(e,t){void 0===t&&(t=!1);var n=this.getBrowserName().toLowerCase(),i=e.toLowerCase(),r=a.default.getBrowserTypeByAlias(i);return t&&r&&(i=r.toLowerCase()),i===n},t.compareVersion=function(e){var t=[0],n=e,i=!1,r=this.getBrowserVersion();if("string"==typeof r)return">"===e[0]||"<"===e[0]?(n=e.substr(1),"="===e[1]?(i=!0,n=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?n=e.substr(1):"~"===e[0]&&(i=!0,n=e.substr(1)),t.indexOf(a.default.compareVersions(r,n,i))>-1},t.isOS=function(e){return this.getOSName(!0)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===String(e).toLowerCase()},t.is=function(e){return this.isBrowser(e)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return void 0===e&&(e=[]),e.some((function(e){return t.is(e)}))},e}();t.default=d,e.exports=t.default},92:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var i,r=(i=n(17))&&i.__esModule?i:{default:i},s=/version\/(\d+(\.?_?\d+)+)/i,o=[{test:[/googlebot/i],describe:function(e){var t={name:"Googlebot"},n=r.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||r.default.getFirstMatch(s,e);return n&&(t.version=n),t}},{test:[/opera/i],describe:function(e){var t={name:"Opera"},n=r.default.getFirstMatch(s,e)||r.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:"Opera"},n=r.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||r.default.getFirstMatch(s,e);return n&&(t.version=n),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:"Samsung Internet for Android"},n=r.default.getFirstMatch(s,e)||r.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Whale/i],describe:function(e){var t={name:"NAVER Whale Browser"},n=r.default.getFirstMatch(s,e)||r.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:"MZ Browser"},n=r.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||r.default.getFirstMatch(s,e);return n&&(t.version=n),t}},{test:[/focus/i],describe:function(e){var t={name:"Focus"},n=r.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||r.default.getFirstMatch(s,e);return n&&(t.version=n),t}},{test:[/swing/i],describe:function(e){var t={name:"Swing"},n=r.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||r.default.getFirstMatch(s,e);return n&&(t.version=n),t}},{test:[/coast/i],describe:function(e){var t={name:"Opera Coast"},n=r.default.getFirstMatch(s,e)||r.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/yabrowser/i],describe:function(e){var t={name:"Yandex Browser"},n=r.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||r.default.getFirstMatch(s,e);return n&&(t.version=n),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:"UC Browser"},n=r.default.getFirstMatch(s,e)||r.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:"Maxthon"},n=r.default.getFirstMatch(s,e)||r.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/epiphany/i],describe:function(e){var t={name:"Epiphany"},n=r.default.getFirstMatch(s,e)||r.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/puffin/i],describe:function(e){var t={name:"Puffin"},n=r.default.getFirstMatch(s,e)||r.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sleipnir/i],describe:function(e){var t={name:"Sleipnir"},n=r.default.getFirstMatch(s,e)||r.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/k-meleon/i],describe:function(e){var t={name:"K-Meleon"},n=r.default.getFirstMatch(s,e)||r.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/micromessenger/i],describe:function(e){var t={name:"WeChat"},n=r.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||r.default.getFirstMatch(s,e);return n&&(t.version=n),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},n=r.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||r.default.getFirstMatch(s,e);return n&&(t.version=n),t}},{test:[/msie|trident/i],describe:function(e){var t={name:"Internet Explorer"},n=r.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/\sedg\//i],describe:function(e){var t={name:"Microsoft Edge"},n=r.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:"Microsoft Edge"},n=r.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/vivaldi/i],describe:function(e){var t={name:"Vivaldi"},n=r.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/seamonkey/i],describe:function(e){var t={name:"SeaMonkey"},n=r.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sailfish/i],describe:function(e){var t={name:"Sailfish"},n=r.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return n&&(t.version=n),t}},{test:[/silk/i],describe:function(e){var t={name:"Amazon Silk"},n=r.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/phantom/i],describe:function(e){var t={name:"PhantomJS"},n=r.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/slimerjs/i],describe:function(e){var t={name:"SlimerJS"},n=r.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:"BlackBerry"},n=r.default.getFirstMatch(s,e)||r.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:"WebOS Browser"},n=r.default.getFirstMatch(s,e)||r.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/bada/i],describe:function(e){var t={name:"Bada"},n=r.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/tizen/i],describe:function(e){var t={name:"Tizen"},n=r.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||r.default.getFirstMatch(s,e);return n&&(t.version=n),t}},{test:[/qupzilla/i],describe:function(e){var t={name:"QupZilla"},n=r.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||r.default.getFirstMatch(s,e);return n&&(t.version=n),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:"Firefox"},n=r.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/chromium/i],describe:function(e){var t={name:"Chromium"},n=r.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||r.default.getFirstMatch(s,e);return n&&(t.version=n),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:"Chrome"},n=r.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/GSA/i],describe:function(e){var t={name:"Google Search"},n=r.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t={name:"Android Browser"},n=r.default.getFirstMatch(s,e);return n&&(t.version=n),t}},{test:[/playstation 4/i],describe:function(e){var t={name:"PlayStation 4"},n=r.default.getFirstMatch(s,e);return n&&(t.version=n),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:"Safari"},n=r.default.getFirstMatch(s,e);return n&&(t.version=n),t}},{test:[/.*/i],describe:function(e){var t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:r.default.getFirstMatch(t,e),version:r.default.getSecondMatch(t,e)}}}];t.default=o,e.exports=t.default},93:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var i,r=(i=n(17))&&i.__esModule?i:{default:i},s=n(18),o=[{test:[/Roku\/DVP/],describe:function(e){var t=r.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:s.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=r.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:s.OS_MAP.WindowsPhone,version:t}}},{test:[/windows/i],describe:function(e){var t=r.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),n=r.default.getWindowsVersionName(t);return{name:s.OS_MAP.Windows,version:t,versionName:n}}},{test:[/macintosh/i],describe:function(e){var t=r.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),n=r.default.getMacOSVersionName(t),i={name:s.OS_MAP.MacOS,version:t};return n&&(i.versionName=n),i}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=r.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:s.OS_MAP.iOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t=r.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),n=r.default.getAndroidVersionName(t),i={name:s.OS_MAP.Android,version:t};return n&&(i.versionName=n),i}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=r.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),n={name:s.OS_MAP.WebOS};return t&&t.length&&(n.version=t),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=r.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||r.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||r.default.getFirstMatch(/\bbb(\d+)/i,e);return{name:s.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=r.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:s.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=r.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:s.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:s.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:s.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=r.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:s.OS_MAP.PlayStation4,version:t}}}];t.default=o,e.exports=t.default},94:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var i,r=(i=n(17))&&i.__esModule?i:{default:i},s=n(18),o=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(e){var t=r.default.getFirstMatch(/(can-l01)/i,e)&&"Nova",n={type:s.PLATFORMS_MAP.mobile,vendor:"Huawei"};return t&&(n.model=t),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),n=e.test(/like (ipod|iphone)/i);return t&&!n},describe:function(e){var t=r.default.getFirstMatch(/(ipod|iphone)/i,e);return{type:s.PLATFORMS_MAP.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:s.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:s.PLATFORMS_MAP.mobile}}},{test:function(e){return"blackberry"===e.getBrowserName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(e){return"bada"===e.getBrowserName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.mobile}}},{test:function(e){return"windows phone"===e.getBrowserName()},describe:function(){return{type:s.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:function(){return{type:s.PLATFORMS_MAP.tablet}}},{test:function(e){return"android"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.mobile}}},{test:function(e){return"macos"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(e){return"windows"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.desktop}}},{test:function(e){return"linux"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.desktop}}},{test:function(e){return"playstation 4"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.tv}}},{test:function(e){return"roku"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.tv}}}];t.default=o,e.exports=t.default},95:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var i,r=(i=n(17))&&i.__esModule?i:{default:i},s=n(18),o=[{test:function(e){return"microsoft edge"===e.getBrowserName(!0)},describe:function(e){if(/\sedg\//i.test(e))return{name:s.ENGINE_MAP.Blink};var t=r.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:s.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:s.ENGINE_MAP.Trident},n=r.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:s.ENGINE_MAP.Presto},n=r.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=e.test(/gecko/i),n=e.test(/like gecko/i);return t&&!n},describe:function(e){var t={name:s.ENGINE_MAP.Gecko},n=r.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:s.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:s.ENGINE_MAP.WebKit},n=r.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}}];t.default=o,e.exports=t.default}})},function(e,t,n){"use strict";(function(e){var i=n(5),r=n(8),s=n(3);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const a=Object(i.getLogger)(e);t.a=new class{constructor(){this.reset()}reset(){this.disposed=!1,this.analyticsHandlers=new Set,this.cache=[],this.permanentProperties={},this.conferenceName="",this.addPermanentProperties({user_agent:navigator.userAgent,browser_name:s.a.getName()})}dispose(){a.warn("Disposing of analytics adapter."),this.analyticsHandlers&&this.analyticsHandlers.size>0&&this.analyticsHandlers.forEach(e=>{"function"==typeof e.dispose&&e.dispose()}),this.setAnalyticsHandlers([]),this.disposed=!0}setAnalyticsHandlers(e){if(this.disposed)return;this.analyticsHandlers=new Set(e),this._setUserProperties();const t=this.cache;this.cache=null,t&&t.forEach(e=>this._sendEvent(e))}_setUserProperties(){this.analyticsHandlers.forEach(e=>{try{e.setUserProperties(this.permanentProperties)}catch(e){a.warn("Error in setUserProperties method of one of the analytics handlers: "+e)}})}addPermanentProperties(e){this.permanentProperties=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){o(e,t,n[t])}))}return e}({},this.permanentProperties,e),this._setUserProperties()}setConferenceName(e){this.conferenceName=e,this.addPermanentProperties({conference_name:e})}sendEvent(e,t={}){if(this.disposed)return;let n=null;"string"==typeof e?n={type:r.t,action:e,actionSubject:e,source:e,attributes:t}:"object"==typeof e&&(n=e),this._verifyRequiredFields(n)?this._sendEvent(n):a.error("Dropping a mis-formatted event: "+JSON.stringify(n))}_verifyRequiredFields(e){if(!e)return!1;e.type||(e.type=r.t);const t=e.type;return t!==r.t&&t!==r.u&&t!==r.w&&t!==r.v?(a.error("Unknown event type: "+t),!1):t===r.u?Boolean(e.name):(e.action=e.action||e.name||e.actionSubject,e.actionSubject=e.actionSubject||e.name||e.action,e.source=e.source||e.name||e.action||e.actionSubject,e.action&&e.actionSubject&&e.source?!!(t!==r.v||(e.objectType=e.objectType||"generic-object-type",e.containerType=e.containerType||"conference","conference"!==e.containerType||e.containerId||(e.containerId=this.conferenceName),e.objectType&&e.objectId&&e.containerType&&e.containerId))||(a.error("Required field missing (containerId, containerType, objectId or objectType)"),!1):(a.error("Required field missing (action, actionSubject or source)"),!1))}_maybeCacheEvent(e){return!!this.cache&&(this.cache.push(e),this.cache.length>100&&this.cache.splice(0,1),!0)}_sendEvent(e){this._maybeCacheEvent(e)||this.analyticsHandlers.forEach(t=>{try{t.sendEvent(e)}catch(e){a.warn("Error sending analytics event: "+e)}})}}}).call(this,"modules/statistics/AnalyticsAdapter.js")},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return a}));var i=n(5),r=n(28),s=n(31);const o=Object(i.getLogger)(e);class a{constructor(e,t){this.eventEmitter=e,this.longTasks=0,this.maxDuration=0,this.performanceStatsInterval=t,this.stats=new s.a}getLongTasksStats(){return{avgRatePerMinute:(60*this.stats.getAverage()).toFixed(2),maxDurationMs:this.maxDuration}}startObserver(){this.longTaskEventHandler=e=>{const t=e.getEntries();for(const e of t)this.longTasks++,this.maxDuration=Math.max(this.maxDuration,e.duration).toFixed(3)},o.info("Creating a Performance Observer for monitoring Long Tasks"),this.observer=new PerformanceObserver(this.longTaskEventHandler),this.observer.observe({type:"longtask",buffered:!0});const e=Date.now();this.longTasksIntervalId=setInterval(()=>{const t=Date.now(),n=this._lastTimeStamp?(t-this._lastTimeStamp)/1e3:(t-e)/1e3,i=this.longTasks/n;this.stats.addNext(i),this.eventEmitter.emit(r.e,this.getLongTasksStats()),this.longTasks=0,this._lastTimeStamp=Date.now()},this.performanceStatsInterval)}stopObserver(){this.observer&&this.observer.disconnect(),this.longTaskEventHandler=null,this.longTasksIntervalId&&(clearInterval(this.longTasksIntervalId),this.longTasksIntervalId=null)}}}).call(this,"modules/statistics/PerformanceObserverStats.js")},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return h}));var i=n(5),r=n(4),s=n(28),o=n(3);const a=n(12),c=Object(i.getLogger)(e);function d(e,t){return!t||t<=0||!e||e<=0?0:Math.round(e/t*100)}function u(){this.loss={},this.bitrate={download:0,upload:0},this.resolution={},this.framerate=0,this.codec=""}function l(){this.bandwidth={},this.bitrate={},this.packetLoss=null,this.transport=[]}function h(e,t,n,i){this.peerconnection=e,this.baselineAudioLevelsReport=null,this.currentAudioLevelsReport=null,this.currentStatsReport=null,this.previousStatsReport=null,this.audioLevelReportHistory={},this.audioLevelsIntervalId=null,this.eventEmitter=i,this.conferenceStats=new l,this.audioLevelsIntervalMilis=t,this.speakerList=[],this.statsIntervalId=null,this.statsIntervalMilis=n,this.ssrc2stats=new Map}u.prototype.setLoss=function(e){this.loss=e||{}},u.prototype.setResolution=function(e){this.resolution=e||{}},u.prototype.addBitrate=function(e){this.bitrate.download+=e.download,this.bitrate.upload+=e.upload},u.prototype.resetBitrate=function(){this.bitrate.download=0,this.bitrate.upload=0},u.prototype.setFramerate=function(e){this.framerate=e||0},u.prototype.setCodec=function(e){this.codec=e||""},h.prototype.setSpeakerList=function(e){this.speakerList=e},h.prototype.stop=function(){this.audioLevelsIntervalId&&(clearInterval(this.audioLevelsIntervalId),this.audioLevelsIntervalId=null),this.statsIntervalId&&(clearInterval(this.statsIntervalId),this.statsIntervalId=null)},h.prototype.errorCallback=function(e){a.callErrorHandler(e),c.error("Get stats error",e),this.stop()},h.prototype.start=function(e){e&&(o.a.supportsReceiverStats()&&c.info("Using RTCRtpSynchronizationSource for remote audio levels"),this.audioLevelsIntervalId=setInterval(()=>{if(o.a.supportsReceiverStats()){const e=this.peerconnection.getAudioLevels(this.speakerList);for(const t in e)if(e.hasOwnProperty(t)){const n=2.5*e[t];this.eventEmitter.emit(s.a,this.peerconnection,Number.parseInt(t,10),n,!1)}}else this.peerconnection.getStats().then(e=>{this.currentAudioLevelsReport="function"==typeof(null==e?void 0:e.result)?e.result():e,this.processAudioLevelReport(),this.baselineAudioLevelsReport=this.currentAudioLevelsReport}).catch(e=>this.errorCallback(e))},this.audioLevelsIntervalMilis));const t=()=>{this.peerconnection.getStats().then(e=>{this.currentStatsReport="function"==typeof(null==e?void 0:e.result)?e.result():e;try{this.processStatsReport()}catch(e){a.callErrorHandler(e),c.error("Processing of RTP stats failed:",e)}this.previousStatsReport=this.currentStatsReport}).catch(e=>this.errorCallback(e))};t(),this.statsIntervalId=setInterval(t,this.statsIntervalMilis)},h.prototype._processAndEmitReport=function(){const e={download:0,upload:0},t={download:0,upload:0};let n=0,i=0;const r={},o={},a={};let u,l,h=0,p=0,m=0,f=0;for(const[s,d]of this.ssrc2stats){const g=d.loss,_=g.isDownloadStream?"download":"upload";e[_]+=g.packetsTotal,t[_]+=g.packetsLost,n+=d.bitrate.download,i+=d.bitrate.upload;const v=this.peerconnection.getTrackBySSRC(s);if(v){v.isAudioTrack()?(h+=d.bitrate.download,p+=d.bitrate.upload,u=d.codec):(m+=d.bitrate.download,f+=d.bitrate.upload,l=d.codec);const e=v.getParticipantId();if(e){const t=d.resolution;if(t.width&&t.height&&-1!==t.width&&-1!==t.height){const n=r[e]||{};n[s]=t,r[e]=n}if(0!==d.framerate){const t=o[e]||{};t[s]=d.framerate,o[e]=t}if(u&&l){const t={audio:u,video:l},n=a[e]||{};n[s]=t,a[e]=n}}else c.error("No participant ID returned by "+v)}d.resetBitrate()}this.conferenceStats.bitrate={upload:i,download:n},this.conferenceStats.bitrate.audio={upload:p,download:h},this.conferenceStats.bitrate.video={upload:f,download:m},this.conferenceStats.packetLoss={total:d(t.download+t.upload,e.download+e.upload),download:d(t.download,e.download),upload:d(t.upload,e.upload)};const g={};let _;Object.keys(this.audioLevelReportHistory).forEach(e=>{const{data:t,isLocal:n}=this.audioLevelReportHistory[e],i=t.reduce((e,t)=>e+t)/t.length;if(n)_=i;else{const t=this.peerconnection.getTrackBySSRC(Number(e));if(t){const e=t.getParticipantId();e&&(g[e]=i)}}}),this.audioLevelReportHistory={},this.eventEmitter.emit(s.d,this.peerconnection,{bandwidth:this.conferenceStats.bandwidth,bitrate:this.conferenceStats.bitrate,packetLoss:this.conferenceStats.packetLoss,resolution:r,framerate:o,codec:a,transport:this.conferenceStats.transport,localAvgAudioLevels:_,avgAudioLevels:g}),this.conferenceStats.transport=[]},h.prototype.getNonNegativeValue=function(e){let t=e;return"number"!=typeof t&&(t=Number(t)),isNaN(t)?0:Math.max(0,t)},h.prototype._calculateBitrate=function(e,t,n){const i=this.getNonNegativeValue(e[n]),r=this.getNonNegativeValue(t[n]),s=Math.max(0,i-r),o=e.timestamp-t.timestamp;let a=0;return o>0&&(a=Math.round(8*s/o)),a},h.prototype.processStatsReport=function(){if(!this.previousStatsReport)return;const e={};this.currentStatsReport.forEach(t=>{if("candidate-pair"===t.type&&t.nominated&&"succeeded"===t.state){const e=t.availableIncomingBitrate,n=t.availableOutgoingBitrate;(e||n)&&(this.conferenceStats.bandwidth={download:Math.round(e/1e3),upload:Math.round(n/1e3)});const i=this.currentStatsReport.get(t.remoteCandidateId),r=this.currentStatsReport.get(t.localCandidateId);if(i&&r){const e=`${o.a.isChromiumBased()?i.ip:i.address}:${i.port}`,n=`${o.a.isChromiumBased()?r.ip:r.address}:${r.port}`,s=i.protocol,a=this.conferenceStats.transport;a.some(t=>t.ip===e&&t.type===s&&t.localip===n)||a.push({ip:e,type:s,localip:n,p2p:this.peerconnection.isP2P,localCandidateType:r.candidateType,remoteCandidateType:i.candidateType,networkType:r.networkType,rtt:1e3*t.currentRoundTripTime})}}else if("inbound-rtp"===t.type||"outbound-rtp"===t.type){const n=this.previousStatsReport.get(t.id),i=this.getNonNegativeValue(t.ssrc);if(!n||!i)return;let r=this.ssrc2stats.get(i);r||(r=new u,this.ssrc2stats.set(i,r));let s=!0,o="packetsReceived";"outbound-rtp"===t.type&&(s=!1,o="packetsSent");let a=t[o];(!a||a<0)&&(a=0);const c=this.getNonNegativeValue(n[o]),d=Math.max(0,a-c),l=this.getNonNegativeValue(t.packetsLost),h=this.getNonNegativeValue(n.packetsLost),p=Math.max(0,l-h);if(r.setLoss({packetsTotal:d+p,packetsLost:p,isDownloadStream:s}),"inbound-rtp"===t.type){const e={height:t.frameHeight,width:t.frameWidth},i=t.framesPerSecond;e.height&&e.width&&r.setResolution(e),r.setFramerate(Math.round(i||0)),r.addBitrate({download:this._calculateBitrate(t,n,"bytesReceived"),upload:0})}else e[i]=this.getNonNegativeValue(t.bytesSent),r.addBitrate({download:0,upload:this._calculateBitrate(t,n,"bytesSent")});const m=this.currentStatsReport.get(t.codecId);if(m){const e=m.mimeType.split("/")[1];e&&r.setCodec(e)}}else if("track"===t.type&&t.kind===r.c&&!t.remoteSource){const e={height:t.frameHeight,width:t.frameWidth},n=this.peerconnection.getLocalTracks(r.c);if(!(null==n?void 0:n.length))return;const i=this.peerconnection.getLocalSSRC(n[0]);if(!i)return;let s=this.ssrc2stats.get(i);s||(s=new u,this.ssrc2stats.set(i,s)),e.height&&e.width&&s.setResolution(e);let o=t.framesPerSecond;if(!o){const e=this.previousStatsReport.get(t.id);if(e){const n=t.timestamp-e.timestamp;if(n>0&&t.framesSent){o=(t.framesSent-e.framesSent)/n*1e3}}if(!o)return}const a=this.peerconnection.getActiveSimulcastStreams();o=a?Math.round(o/a):0,s.setFramerate(o)}}),this.eventEmitter.emit(s.c,this.peerconnection,e),this._processAndEmitReport()},h.prototype.processAudioLevelReport=function(){this.baselineAudioLevelsReport&&this.currentAudioLevelsReport.forEach(e=>{if("track"!==e.type)return;const t=e.audioLevel;if(!t)return;const n=e.trackIdentifier,i=this.peerconnection.getSsrcByTrackId(n);if(i){const e=i===this.peerconnection.getLocalSSRC(this.peerconnection.getLocalTracks(r.a));this.eventEmitter.emit(s.a,this.peerconnection,i,t,e)}})}}).call(this,"modules/statistics/RTPStatsCollector.js")},function(e,t){function n(e,t){if(!e||!t||"function"!=typeof e.addListener||"function"!=typeof t.emit)throw new Error("Invalid arguments passed to EventEmitterForwarder");this.src=e,this.dest=t}n.prototype.forward=function(...e){const t=e[0];e[0]=this.dest,this.src.addListener(t,Function.prototype.bind.apply(this.dest.emit,e))},e.exports=n},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n(2),r=n(1),s=n(51),o=n(4);class a{constructor(e,t,n,r,o,a,c,d,u){this._jid=e,this._id=i.Strophe.getResourceFromJid(e),this._conference=t,this._displayName=n,this._supportsDTMF=!1,this._tracks=[],this._role="none",this._status=a,this._hidden=r,this._statsID=o,this._connectionStatus=s.a.ACTIVE,this._properties={},this._identity=c,this._isReplacing=d,this._isReplaced=u,this._features=new Set}getConference(){return this._conference}getProperty(e){return this._properties[e]}hasAnyVideoTrackWebRTCMuted(){return this.getTracks().some(e=>e.getType()===o.c&&e.isWebRTCTrackMuted())}_setConnectionStatus(e){this._connectionStatus=e}getConnectionStatus(){return this._connectionStatus}setProperty(e,t){const n=this._properties[e];t!==n&&(this._properties[e]=t,this._conference.eventEmitter.emit(r.PARTICIPANT_PROPERTY_CHANGED,this,e,n,t))}getTracks(){return this._tracks.slice()}getTracksByMediaType(e){return this.getTracks().filter(t=>t.getType()===e)}getId(){return this._id}getJid(){return this._jid}getDisplayName(){return this._displayName}getStatsID(){return this._statsID}getStatus(){return this._status}isModerator(){return"moderator"===this._role}isHidden(){return this._hidden}isReplacing(){return this._isReplacing}isReplaced(){return this._isReplaced}isAudioMuted(){return this._isMediaTypeMuted(o.a)}_isMediaTypeMuted(e){return this.getTracks().reduce((t,n)=>t&&(n.getType()!==e||n.isMuted()),!0)}isVideoMuted(){return this._isMediaTypeMuted(o.c)}getRole(){return this._role}setRole(e){this._role=e}setIsReplacing(e){this._isReplacing=e}setIsReplaced(e){this._isReplaced=e}supportsDTMF(){return this._supportsDTMF}getFeatures(){return Promise.resolve(this._features)}hasFeature(e){return this._features.has(e)}setFeatures(e){this._features=e||new Set}getBotType(){return this._botType}setBotType(e){this._botType=e}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var i=n(27),r=n(24);function s({id:e,password:t,onCreateResource:n,onLoginSuccessful:s,roomPassword:o}){let a,c=!1,d=new r.e(this.connection.options);const u=new Promise((r,u)=>{a=u,d.addListener(i.CONNECTION_DISCONNECTED,()=>{d=void 0}),d.addListener(i.CONNECTION_ESTABLISHED,()=>{if(c)return;s&&s();d.createRoom(this.options.name,this.options.config,n).moderator.authenticate().then(()=>{d&&d.disconnect(),c||(this.join(o),r())}).catch(({error:e,message:t})=>{d.disconnect(),u({authenticationError:e,message:t})})}),d.addListener(i.CONNECTION_FAILED,(e,t,n)=>{u({connectionError:e,credentials:n,message:t}),d=void 0}),c||d.connect(e,t)});return u.cancel=()=>{c=!0,a({}),d&&d.disconnect()},u}},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return o}));var i=n(5);const r=Object(i.getLogger)(e),s=Symbol("kJitsiE2EE");class o{constructor(){let e="";const t=document.querySelector('script[src*="lib-jitsi-meet"]');if(t){const n=t.src.lastIndexOf("/");e=t.src.substring(0,n)+"/"}const n=new Blob([`importScripts("${e+"lib-jitsi-meet.e2ee-worker.js"}");`],{type:"application/javascript"}),i=window.URL.createObjectURL(n);this._worker=new Worker(i,{name:"E2EE Worker"}),this._worker.onerror=e=>r.onerror(e)}cleanup(e){this._worker.postMessage({operation:"cleanup",participantId:e})}handleReceiver(e,t,n){if(!e[s])if(e[s]=!0,window.RTCRtpScriptTransform){const t={operation:"decode",participantId:n};e.transform=new RTCRtpScriptTransform(this._worker,t)}else{const t=e.createEncodedStreams();this._worker.postMessage({operation:"decode",readableStream:t.readable,writableStream:t.writable,participantId:n},[t.readable,t.writable])}}handleSender(e,t,n){if(!e[s])if(e[s]=!0,window.RTCRtpScriptTransform){const t={operation:"encode",participantId:n};e.transform=new RTCRtpScriptTransform(this._worker,t)}else{const t=e.createEncodedStreams();this._worker.postMessage({operation:"encode",readableStream:t.readable,writableStream:t.writable,participantId:n},[t.readable,t.writable])}}setKey(e,t,n){this._worker.postMessage({operation:"setKey",participantId:e,key:t,keyIndex:n})}}}).call(this,"modules/e2ee/E2EEContext.js")},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return a}));var i=n(5),r=n(52),s=n(100);const o=Object(i.getLogger)(e);class a{constructor(e){this._stropheConn=e,this._resumeRetryN=0,this._retryDelay=void 0}get retryDelay(){return this._retryDelay}schedule(){this._cancelResume(),this._resumeRetryN+=1,this._networkOnlineListener=r.b.addEventListener(r.a,({isOnline:e})=>{e?this._scheduleResume():this._cancelResume()}),r.b.isOnline()&&this._scheduleResume()}_scheduleResume(){this._resumeTimeout||(this._resumeRetryN=Math.min(3,this._resumeRetryN),this._retryDelay=Object(s.a)(this._resumeRetryN,1500*this._resumeRetryN,3),o.info(`Will try to resume the XMPP connection in ${this.retryDelay}ms`),this._resumeTimeout=setTimeout(()=>this._resumeConnection(),this.retryDelay))}_cancelResume(){this._resumeTimeout&&(o.info("Canceling connection resume task"),clearTimeout(this._resumeTimeout),this._resumeTimeout=void 0,this._retryDelay=void 0)}_resumeConnection(){const{streamManagement:e}=this._stropheConn,t=e.getResumeToken();if(!t)return;o.info("Trying to resume the XMPP connection");const n=new URL(this._stropheConn.service);let{search:i}=n;const r=/(previd=)([\w-]+)/,s=i.match(r);s&&-1===s.indexOf(t)?i=i.replace(r,"$1"+t):s||(i+=-1===i.indexOf("?")?"?previd="+t:"&previd="+t),n.search=i,this._stropheConn.service=n.toString(),e.resume()}cancel(){this._cancelResume(),this._resumeRetryN=0,this._networkOnlineListener&&(this._networkOnlineListener(),this._networkOnlineListener=null)}}}).call(this,"modules/xmpp/ResumeTask.js")},function(e,t,n){"use strict";function i(e,t=500,n=2){return Math.floor(Math.random()*(1e3*Math.pow(n,e)-t)+t)}n.d(t,"a",(function(){return i}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));class i{constructor(){this._lastSuccess=null,this._lastFailedMessage=null}startTracking(e,t){const n=t.rawInput;t.rawInput=(...i)=>{const r=i[0];r.includes("failure")&&(this._lastFailedMessage=r),e.connected&&(this._lastSuccess=Date.now()),n.apply(t,i)}}getLastFailedMessage(){return this._lastFailedMessage}getTimeSinceLastSuccess(){return this._lastSuccess?Date.now()-this._lastSuccess:null}}},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return d}));var i=n(5),r=n(2),s=n(12),o=n.n(s),a=n(39);const c=Object(i.getLogger)(e);class d extends a.b{constructor({getTimeSinceLastServerResponse:e,onPingThresholdExceeded:t,pingOptions:n={}}){super(),this.failedPings=0,this._onPingThresholdExceeded=t,this._getTimeSinceLastServerResponse=e,this.pingInterval="number"==typeof n.interval?n.interval:1e4,this.pingTimeout="number"==typeof n.timeout?n.timeout:5e3,this.pingThreshold="number"==typeof n.threshold?n.threshold:2,this.pingTimestampsToKeep=Math.round(12e4/this.pingInterval),this.pingExecIntervals=new Array(this.pingTimestampsToKeep)}init(e){super.init(e),r.Strophe.addNamespace("PING","urn:xmpp:ping")}ping(e,t,n,i){this._addPingExecutionTimestamp();const s=Object(r.$iq)({type:"get",to:e});s.c("ping",{xmlns:r.Strophe.NS.PING}),this.connection.sendIQ2(s,{timeout:i}).then(t,n)}startInterval(e){clearInterval(this.intervalId),this.intervalId=window.setInterval(()=>{const t=Date.now();if(this._getTimeSinceLastServerResponse()<t-this._lastServerCheck)return this._addPingExecutionTimestamp(),this._lastServerCheck=t,void(this.failedPings=0);this.ping(e,()=>{this._lastServerCheck=this._getTimeSinceLastServerResponse()+Date.now(),this.failedPings=0},e=>{this.failedPings+=1;const t="Ping "+(e?"error":"timeout");this.failedPings>=this.pingThreshold?(o.a.callErrorHandler(new Error(t)),c.error(t,e),this._onPingThresholdExceeded&&this._onPingThresholdExceeded()):c.warn(t,e)},this.pingTimeout)},this.pingInterval),c.info(`XMPP pings will be sent every ${this.pingInterval} ms`)}stopInterval(){this.intervalId&&(window.clearInterval(this.intervalId),this.intervalId=null,this.failedPings=0,c.info("Ping interval cleared"))}_addPingExecutionTimestamp(){this.pingExecIntervals.push((new Date).getTime()),this.pingExecIntervals.length>this.pingTimestampsToKeep&&this.pingExecIntervals.shift()}getPingSuspendTime(){const e=this.pingExecIntervals.slice();e.push((new Date).getTime());let t=0,n=e[0];return e.forEach(e=>{const i=e-n;i>t&&(t=i),n=e}),t-=this.pingInterval,Math.max(t,0)}}}).call(this,"modules/xmpp/strophe.ping.js")},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return u}));var i=n(5),r=n(2),s=n(0),o=n.n(s),a=n(104),c=n(39);const d=Object(i.getLogger)(e);class u extends c.a{constructor(e){super(),this.xmpp=e,this.rooms={}}init(e){super.init(e),this.connection.addHandler(this.onPresence.bind(this),null,"presence",null,null,null,null),this.connection.addHandler(this.onPresenceUnavailable.bind(this),null,"presence","unavailable",null),this.connection.addHandler(this.onPresenceError.bind(this),null,"presence","error",null),this.connection.addHandler(this.onMessage.bind(this),null,"message",null,null),this.connection.addHandler(this.onMute.bind(this),"http://jitsi.org/jitmeet/audio","iq","set",null,null),this.connection.addHandler(this.onMuteVideo.bind(this),"http://jitsi.org/jitmeet/video","iq","set",null,null)}createRoom(e,t,n){const i=r.Strophe.getBareJidFromJid(e);if(this.rooms[i]){const e="You are already in the room!";throw d.error(e),new Error(e)}return this.rooms[i]=new a.a(this.connection,e,t,this.xmpp,n),this.eventEmitter.emit(o.a.EMUC_ROOM_ADDED,this.rooms[i]),this.rooms[i]}doLeave(e){this.eventEmitter.emit(o.a.EMUC_ROOM_REMOVED,this.rooms[e]),delete this.rooms[e]}onPresence(e){const t=e.getAttribute("from");if(e.getAttribute("type"))return!0;const n=this.rooms[r.Strophe.getBareJidFromJid(t)];return!n||($(e).find('>x[xmlns="http://jabber.org/protocol/muc#user"]>status[code="201"]').length&&n.createNonAnonymousRoom(),n.onPresence(e),!0)}onPresenceUnavailable(e){const t=e.getAttribute("from"),n=this.rooms[r.Strophe.getBareJidFromJid(t)];return!n||(n.onPresenceUnavailable(e,t),!0)}onPresenceError(e){const t=e.getAttribute("from"),n=this.rooms[r.Strophe.getBareJidFromJid(t)];return!n||(n.onPresenceError(e,t),!0)}onMessage(e){const t=e.getAttribute("from"),n=this.rooms[r.Strophe.getBareJidFromJid(t)];return!n||(n.onMessage(e,t),!0)}onMute(e){const t=e.getAttribute("from"),n=this.rooms[r.Strophe.getBareJidFromJid(t)];return!n||(n.onMute(e),!0)}onMuteVideo(e){const t=e.getAttribute("from"),n=this.rooms[r.Strophe.getBareJidFromJid(t)];return!n||(n.onMuteVideo(e),!0)}}}).call(this,"modules/xmpp/strophe.emuc.js")},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return b}));var i=n(5),r=n(33),s=n.n(r),o=n(2),a=n(64),c=n(4),d=n(0),u=n.n(d),l=n(12),h=n.n(l),p=n(22),m=n(105),f=n(106),g=n(41),_=n(107);const v=Object(i.getLogger)(e),S={packet2JSON(e,t){for(const n of Array.from(e.children)){const e={attributes:{},children:[],tagName:n.tagName};for(const t of Array.from(n.attributes))e.attributes[t.name]=t.value;const i=o.Strophe.getText(n);i&&(e.value=o.Strophe.xmlunescape(i)),t.push(e),this.packet2JSON(n,e.children)}},json2packet(e,t){for(let n=0;n<e.length;n++){const i=e[n];i&&(t.c(i.tagName,i.attributes),i.value&&t.t(i.value),i.children&&this.json2packet(i.children,t),t.up())}}};function y(e,t){const n=[];for(let i=0;i<e.length;i++)e[i].tagName===t&&n.push(e[i]);return n}const E=["owner","admin","member"];class b extends p.a{constructor(e,t,n,i,r){super(),this.xmpp=i,this.connection=e,this.roomjid=o.Strophe.getBareJidFromJid(t),this.myroomjid=t,this.password=n,this.replaceParticipant=!1,v.info("Joined MUC as "+this.myroomjid),this.members={},this.presMap={},this.presHandlers={},this._removeConnListeners=[],this.joined=!1,this.role=null,this.focusMucJid=null,this.noBridgeAvailable=!1,this.options=r||{},this.moderator=new _.a(this.roomjid,this.xmpp,this.eventEmitter,{connection:this.xmpp.options,conference:this.options}),(void 0===this.options.enableLobby||this.options.enableLobby)&&(this.lobby=new f.a(this)),this.avModeration=new m.a(this),this.initPresenceMap(r),this.lastPresences={},this.phoneNumber=null,this.phonePin=null,this.connectionTimes={},this.participantPropertyListener=null,this.locked=!1,this.transcriptionStatus=a.OFF}initPresenceMap(e={}){this.presMap.to=this.myroomjid,this.presMap.xns="http://jabber.org/protocol/muc",this.presMap.nodes=[],e.statsId&&this.presMap.nodes.push({tagName:"stats-id",value:e.statsId}),e.deploymentInfo&&e.deploymentInfo.userRegion&&this.presMap.nodes.push({tagName:"region",attributes:{id:e.deploymentInfo.userRegion,xmlns:"http://jitsi.org/jitsi-meet"}}),this.presenceUpdateTime=Date.now()}join(e,t){return this.password=e,this.replaceParticipant=t,new Promise(e=>{this.options.disableFocus&&v.info("Conference focus disabled for "+this.roomjid);(this.options.disableFocus?Promise.resolve():this.moderator.allocateConferenceFocus()).then(()=>{this.sendPresence(!0),this._removeConnListeners.push(this.connection.addEventListener(g.a.Events.CONN_STATUS_CHANGED,this.onConnStatusChanged.bind(this))),e()})})}sendPresence(e){const t=this.presMap.to;if(!this.connection||!this.connection.connected||!t||!this.joined&&!e)return;const n=Object(o.$pres)({to:t});e&&(this.replaceParticipant&&n.c("flip_device").up(),n.c("x",{xmlns:this.presMap.xns}),this.password&&n.c("password").t(this.password).up(),this.options.billingId&&n.c("billingid").t(this.options.billingId).up(),n.up()),S.json2packet(this.presMap.nodes,n),this.presenceSyncTime=Date.now(),this.connection.send(n),e&&this.connection.flush()}doLeave(){v.log("do leave",this.myroomjid);const e=Object(o.$pres)({to:this.myroomjid,type:"unavailable"});this.presMap.length=0,!this.connection.isUsingWebSocket&&this.connection.flush(),this.connection.send(e),this.connection.flush()}discoRoomInfo(){const e=Object(o.$iq)({type:"get",to:this.roomjid}).c("query",{xmlns:o.Strophe.NS.DISCO_INFO});this.connection.sendIQ(e,e=>{const t=1===$(e).find('>query>feature[var="muc_passwordprotected"]').length;t!==this.locked&&(this.eventEmitter.emit(u.a.MUC_LOCK_CHANGED,t),this.locked=t);const n=$(e).find('>query>x[type="result"]>field[var="muc#roominfo_meetingId"]>value');n.length?this.setMeetingId(n.text()):v.warn("No meeting ID from backend");const i=1===$(e).find('>query>feature[var="muc_membersonly"]').length,r=$(e).find('>query>x[type="result"]>field[var="muc#roominfo_lobbyroom"]>value');this.lobby&&this.lobby.setLobbyRoomJid(r&&r.length?r.text():void 0),i!==this.membersOnlyEnabled&&(this.membersOnlyEnabled=i,this.eventEmitter.emit(u.a.MUC_MEMBERS_ONLY_CHANGED,i))},e=>{h.a.callErrorHandler(e),v.error("Error getting room info: ",e)})}setMeetingId(e){this.meetingId!==e&&(this.meetingId&&v.warn(`Meeting Id changed from:${this.meetingId} to:${e}`),this.meetingId=e,this.eventEmitter.emit(u.a.MEETING_ID_SET,e))}createNonAnonymousRoom(){if(this.options.disableDiscoInfo)return;const e=Object(o.$iq)({type:"get",to:this.roomjid}).c("query",{xmlns:"http://jabber.org/protocol/muc#owner"}).c("x",{xmlns:"jabber:x:data",type:"submit"});this.connection.sendIQ(e,e=>{if(!$(e).find('>query>x[xmlns="jabber:x:data"]>field[var="muc#roomconfig_whois"]').length){const e="non-anonymous rooms not supported";return h.a.callErrorHandler(new Error(e)),void v.error(e)}const t=Object(o.$iq)({to:this.roomjid,type:"set"}).c("query",{xmlns:"http://jabber.org/protocol/muc#owner"});t.c("x",{xmlns:"jabber:x:data",type:"submit"}),t.c("field",{var:"FORM_TYPE"}).c("value").t("http://jabber.org/protocol/muc#roomconfig").up().up(),t.c("field",{var:"muc#roomconfig_whois"}).c("value").t("anyone").up().up(),this.connection.sendIQ(t)},e=>{h.a.callErrorHandler(e),v.error("Error getting room configuration form: ",e)})}onConnStatusChanged(e){e===g.a.Status.CONNECTED&&this.sendPresence()}onPresence(e){const t=e.getAttribute("from"),n={},i=e.getElementsByTagName("status")[0];i&&(n.status=i.textContent||"");let r=!1,a=!1;const c=e.getElementsByTagNameNS("http://jabber.org/protocol/muc#user","x")[0],d=c&&c.getElementsByTagName("item")[0];n.isReplaceParticipant=e.getElementsByTagName("flip_device").length,n.affiliation=d&&d.getAttribute("affiliation"),n.role=d&&d.getAttribute("role");const l=d&&d.getAttribute("jid");n.jid=l,n.isFocus=l&&0===l.indexOf(this.moderator.getFocusUserJid()+"/"),n.isHiddenDomain=l&&l.indexOf("@")>0&&this.options.hiddenDomain===l.substring(l.indexOf("@")+1,l.indexOf("/")),this.eventEmitter.emit(u.a.PRESENCE_RECEIVED,{fromHiddenDomain:n.isHiddenDomain,presence:e});const h=e.querySelector("x");h&&h.remove();const p=[];S.packet2JSON(e,p),this.lastPresences[t]=p;const m=e=>{const t={},n=e.children.find(e=>"user"===e.tagName);if(n){t.user={};for(const e of["id","name","avatar"]){const i=n.children.find(t=>t.tagName===e);i&&(t.user[e]=i.value)}}const i=e.children.find(e=>"group"===e.tagName);return i&&(t.group=i.value),t};for(let e=0;e<p.length;e++){const t=p[e];switch(t.tagName){case"bot":{const{attributes:e}=t;if(!e)break;const{type:i}=e;n.botType=i;break}case"nick":n.nick=t.value;break;case"userId":n.id=t.value;break;case"stats-id":n.statsID=t.value;break;case"identity":n.identity=m(t);break;case"features":n.features=this._extractFeatures(t);break;case"stat":{const{attributes:e}=t;if(!e)break;const{name:i}=e;"version"===i&&(n.version=e.value);break}}}if(t===this.myroomjid){const e="owner"===n.affiliation?n.role:"none";if(this.role!==e&&(this.role=e,this.eventEmitter.emit(u.a.LOCAL_ROLE_CHANGED,this.role)),!this.joined){this.joined=!0;const e=this.connectionTimes["muc.joined"]=window.performance.now();v.log("(TIME) MUC joined:\t",e),this.password&&(this.locked=!0),this.presenceUpdateTime>=this.presenceSyncTime&&this.sendPresence(),this.eventEmitter.emit(u.a.MUC_JOINED),!this.options.disableDiscoInfo&&this.discoRoomInfo()}}else if(void 0===l)v.info("Ignoring member with undefined JID");else if(void 0===this.members[t])this.members[t]=n,v.log("entered",t,n),r=void 0!==n.status,a=void 0!==n.version,n.isFocus?this._initFocus(t,n.features):(this.eventEmitter.emit(u.a.MUC_MEMBER_JOINED,t,n.nick,n.role,n.isHiddenDomain,n.statsID,n.status,n.identity,n.botType,n.jid,n.features,n.isReplaceParticipant),r=!1);else{const e=this.members[t];e.role!==n.role&&(e.role=n.role,this.eventEmitter.emit(u.a.MUC_ROLE_CHANGED,t,n.role)),e.affiliation!==n.affiliation&&(e.affiliation=n.affiliation),e.botType!==n.botType&&(e.botType=n.botType,this.eventEmitter.emit(u.a.MUC_MEMBER_BOT_TYPE_CHANGED,t,n.botType)),n.isFocus&&(e.isFocus=!0,this._initFocus(t,n.features)),n.displayName&&(e.displayName=n.displayName),e.status!==n.status&&(r=!0,e.status=n.status),e.version!==n.version&&(a=!0,e.version=n.version),s()(e.features,n.features)||(e.features=n.features,this.eventEmitter.emit(u.a.PARTICIPANT_FEATURES_CHANGED,t,n.features))}for(let e=0;e<p.length;e++){const i=p[e];switch(i.tagName){case"nick":if(!n.isFocus){const e=this.xmpp.options.displayJids?o.Strophe.getResourceFromJid(t):n.nick;this.eventEmitter.emit(u.a.DISPLAY_NAME_CHANGED,t,e)}break;case"bridgeNotAvailable":n.isFocus&&!this.noBridgeAvailable&&(this.noBridgeAvailable=!0,this.eventEmitter.emit(u.a.BRIDGE_DOWN));break;case"conference-properties":if(n.isFocus){const e={};for(let t=0;t<i.children.length;t++){const{attributes:n}=i.children[t];n&&n.key&&(e[n.key]=n.value)}this.eventEmitter.emit(u.a.CONFERENCE_PROPERTIES_CHANGED,e),this.restartByTerminateSupported="true"===e["support-terminate-restart"],v.info("Jicofo supports restart by terminate: "+this.supportsRestartByTerminate())}break;case"transcription-status":{const{attributes:e}=i;if(!e)break;const{status:t}=e;t&&t!==this.transcriptionStatus&&(this.transcriptionStatus=t,this.eventEmitter.emit(u.a.TRANSCRIPTION_STATUS_CHANGED,t));break}case"call-control":{const e=i.attributes;if(!e)break;this.phoneNumber=e.phone||null,this.phonePin=e.pin||null,this.eventEmitter.emit(u.a.PHONE_NUMBER_CHANGED);break}default:this.processNode(i,t)}}r&&this.eventEmitter.emit(u.a.PRESENCE_STATUS,t,n.status),a&&v.info(`Received version for ${l}: ${n.version}`)}_extractFeatures(e){const t=new Set;for(let n=0;n<e.children.length;n++){const{attributes:i}=e.children[n];i&&i.var&&t.add(i.var)}return t}_initFocus(e,t){this.focusMucJid=e,this.focusFeatures=t}setParticipantPropertyListener(e){this.participantPropertyListener=e}supportsRestartByTerminate(){return this.restartByTerminateSupported}processNode(e,t){try{let n=this.presHandlers[e.tagName];e.tagName.startsWith("jitsi_participant_")&&(n=[this.participantPropertyListener]),n&&n.forEach(n=>{n(e,o.Strophe.getResourceFromJid(t),t)})}catch(t){h.a.callErrorHandler(t),v.error(`Error processing:${e.tagName} node.`,t)}}sendMessage(e,t){const n=Object(o.$msg)({to:this.roomjid,type:"groupchat"});"body"===t?n.c(t,{},e):n.c(t,{xmlns:"http://jitsi.org/jitmeet"},e),this.connection.send(n),this.eventEmitter.emit(u.a.SENDING_CHAT_MESSAGE,e)}sendPrivateMessage(e,t,n){const i=Object(o.$msg)({to:`${this.roomjid}/${e}`,type:"chat"});"body"===n?i.c(n,t).up():i.c(n,{xmlns:"http://jitsi.org/jitmeet"},t).up(),this.connection.send(i),this.eventEmitter.emit(u.a.SENDING_PRIVATE_CHAT_MESSAGE,t)}setSubject(e){const t=Object(o.$msg)({to:this.roomjid,type:"groupchat"});t.c("subject",e),this.connection.send(t)}onParticipantLeft(e,t){delete this.lastPresences[e],t||(this.eventEmitter.emit(u.a.MUC_MEMBER_LEFT,e),this.moderator.onMucMemberLeft(e))}onPresenceUnavailable(e,t){if($(e).find('>ignore[xmlns="http://jitsi.org/jitmeet/"]').length)return!0;const n=$(e).find('>x[xmlns="http://jabber.org/protocol/muc#user"]>destroy');if(n.length){let t;const i=$(e).find('>x[xmlns="http://jabber.org/protocol/muc#user"]>destroy>reason');return i.length&&(t=i.text()),this.eventEmitter.emit(u.a.MUC_DESTROYED,t,n.attr("jid")),this.connection.emuc.doLeave(this.roomjid),!0}const i=$(e).find('>x[xmlns="http://jabber.org/protocol/muc#user"]>status[code="110"]').length,r=$(e).find('>x[xmlns="http://jabber.org/protocol/muc#user"]>status[code="307"]').length,s=Object.keys(this.members),a=$(e).find("flip_device").length;if(r){const n=$(e).find('>x[xmlns="http://jabber.org/protocol/muc#user"]>item>actor');let r,s;n.length&&(r=n.attr("nick"));const c=$(e).find('>x[xmlns="http://jabber.org/protocol/muc#user"]>item>reason');c.length&&(s=c.text()),this.eventEmitter.emit(u.a.KICKED,i,r,o.Strophe.getResourceFromJid(t),s,a)}i?(s.forEach(e=>{const t=this.members[e];delete this.members[e],this.onParticipantLeft(e,t.isFocus)}),this.connection.emuc.doLeave(this.roomjid),r||this.eventEmitter.emit(u.a.MUC_LEFT)):(delete this.members[t],this.onParticipantLeft(t,!1))}onMessage(e,t){const n=e.getAttribute("type");if("error"===n){const t=$(e).find(">error>text").text();return this.eventEmitter.emit(u.a.CHAT_ERROR_RECEIVED,t),!0}const i=$(e).find(">body").text(),r=$(e).find(">subject");if(r.length){const e=r.text();(e||""===e)&&(this.eventEmitter.emit(u.a.SUBJECT_CHANGED,e),v.log("Subject is changed to "+e))}let s=$(e).find(">delay").attr("stamp");if(!s&&(s=$(e).find('>[xmlns="jabber:x:delay"]').attr("stamp"),s)){const e=s.match(/(\d{4})(\d{2})(\d{2}T\d{2}:\d{2}:\d{2})/);s=`${e[1]}-${e[2]}-${e[3]}Z`}if(t===this.roomjid){let n;if($(e).find('>x[xmlns="http://jabber.org/protocol/muc#user"]>status[code="104"]').length)this.discoRoomInfo();else if((n=$(e).find('>x[xmlns="http://jabber.org/protocol/muc#user"]>invite'))&&n.length){const r=$(e).find('>x[xmlns="http://jabber.org/protocol/muc#user"]>password');let s;r&&r.length&&(s=r.text()),this.eventEmitter.emit(u.a.INVITE_MESSAGE_RECEIVED,t,n.attr("from"),i,s)}}const o=$(e).find(">json-message").text();if(o){const e=this.xmpp.tryParseJSONAndVerify(o);if(e&&void 0===s)return void this.eventEmitter.emit(u.a.JSON_MESSAGE_RECEIVED,t,e)}i&&("chat"===n?this.eventEmitter.emit(u.a.PRIVATE_MESSAGE_RECEIVED,t,i,this.myroomjid,s):"groupchat"===n&&this.eventEmitter.emit(u.a.MESSAGE_RECEIVED,t,i,this.myroomjid,s))}onPresenceError(e,t){if($(e).find('>error[type="auth"]>not-authorized[xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"]').length)v.log("on password required",t),this.eventEmitter.emit(u.a.PASSWORD_REQUIRED);else if($(e).find('>error[type="cancel"]>not-allowed[xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"]').length){o.Strophe.getDomainFromJid(e.getAttribute("to"))===this.xmpp.options.hosts.anonymousdomain?this.eventEmitter.emit(u.a.ROOM_JOIN_ERROR):(v.warn("onPresError ",e),this.eventEmitter.emit(u.a.ROOM_CONNECT_NOT_ALLOWED_ERROR))}else if($(e).find(">error>service-unavailable").length)v.warn("Maximum users limit for the room has been reached",e),this.eventEmitter.emit(u.a.ROOM_MAX_USERS_ERROR);else if($(e).find('>error[type="auth"]>registration-required[xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"]').length){const t=$(e).find(">lobbyroom");let n;t.length&&(n=t.text()),this.eventEmitter.emit(u.a.ROOM_CONNECT_MEMBERS_ONLY_ERROR,n)}else v.warn("onPresError ",e),this.eventEmitter.emit(u.a.ROOM_CONNECT_ERROR)}setAffiliation(e,t){const n=Object(o.$iq)({to:this.roomjid,type:"set"}).c("query",{xmlns:"http://jabber.org/protocol/muc#admin"}).c("item",{affiliation:t,nick:o.Strophe.getResourceFromJid(e)}).c("reason").t(`Your affiliation has been changed to '${t}'.`).up().up().up();this.connection.sendIQ(n,n=>v.log("Set affiliation of participant with jid: ",e,"to",t,n),e=>v.log("Set affiliation of participant error: ",e))}kick(e,t="You have been kicked."){const n=Object(o.$iq)({to:this.roomjid,type:"set"}).c("query",{xmlns:"http://jabber.org/protocol/muc#admin"}).c("item",{nick:o.Strophe.getResourceFromJid(e),role:"none"}).c("reason").t(t).up().up().up();this.connection.sendIQ(n,t=>v.log("Kick participant with jid: ",e,t),e=>v.log("Kick participant error: ",e))}lockRoom(e,t,n,i){this.connection.sendIQ(Object(o.$iq)({to:this.roomjid,type:"get"}).c("query",{xmlns:"http://jabber.org/protocol/muc#owner"}),r=>{if($(r).find('>query>x[xmlns="jabber:x:data"]>field[var="muc#roomconfig_roomsecret"]').length){const i=Object(o.$iq)({to:this.roomjid,type:"set"}).c("query",{xmlns:"http://jabber.org/protocol/muc#owner"});i.c("x",{xmlns:"jabber:x:data",type:"submit"}),i.c("field",{var:"FORM_TYPE"}).c("value").t("http://jabber.org/protocol/muc#roomconfig").up().up(),i.c("field",{var:"muc#roomconfig_roomsecret"}).c("value").t(e).up().up(),i.c("field",{var:"muc#roomconfig_passwordprotectedroom"}).c("value").t(null===e||0===e.length?"0":"1").up().up(),this.membersOnlyEnabled&&i.c("field",{var:"muc#roomconfig_membersonly"}).c("value").t("true").up().up(),i.c("field",{var:"muc#roomconfig_whois"}).c("value").t("anyone").up().up(),this.connection.sendIQ(i,()=>{this.password=e,t()},n)}else i()},n)}setMembersOnly(e,t,n){e&&Object.values(this.members).filter(e=>!e.isFocus).length&&Object.values(this.members).forEach(e=>{e.jid&&!E.includes(e.affiliation)&&this.xmpp.connection.sendIQ(Object(o.$iq)({to:this.roomjid,type:"set"}).c("query",{xmlns:"http://jabber.org/protocol/muc#admin"}).c("item",{affiliation:"member",jid:e.jid}).up().up())});const i=n||(()=>{});this.xmpp.connection.sendIQ(Object(o.$iq)({to:this.roomjid,type:"get"}).c("query",{xmlns:"http://jabber.org/protocol/muc#owner"}),n=>{if($(n).find('>query>x[xmlns="jabber:x:data"]>field[var="muc#roomconfig_membersonly"]').length){const n=Object(o.$iq)({to:this.roomjid,type:"set"}).c("query",{xmlns:"http://jabber.org/protocol/muc#owner"});n.c("x",{xmlns:"jabber:x:data",type:"submit"}),n.c("field",{var:"FORM_TYPE"}).c("value").t("http://jabber.org/protocol/muc#roomconfig").up().up(),n.c("field",{var:"muc#roomconfig_membersonly"}).c("value").t(e?"true":"false").up().up(),this.locked&&n.c("field",{var:"muc#roomconfig_passwordprotectedroom"}).c("value").t("1").up().up(),this.xmpp.connection.sendIQ(n,t,i)}else i(new Error("Setting members only room not supported!"))},i)}addToPresence(e,t){return this.addOrReplaceInPresence(e,t)}addOrReplaceInPresence(e,t){t.tagName=e;const n=this.presMap.nodes.filter(t=>e===t.tagName);return(1!==n.length||!s()(n[0],t))&&(this.removeFromPresence(e),this.presMap.nodes.push(t),this.presenceUpdateTime=Date.now(),!0)}getFromPresence(e){return this.presMap.nodes.find(t=>e===t.tagName)}removeFromPresence(e){const t=this.presMap.nodes.filter(t=>e!==t.tagName);this.presMap.nodes=t,this.presenceUpdateTime=Date.now()}addPresenceListener(e,t){if("function"!=typeof t)throw new Error('"handler" is not a function');let n=this.presHandlers[e];n||(this.presHandlers[e]=n=[]),-1===n.indexOf(t)?n.push(t):v.warn("Trying to add the same handler more than once for: "+e)}removePresenceListener(e,t){const n=this.presHandlers[e],i=n?n.indexOf(t):-1;-1!==i?n.splice(i,1):v.warn(`Handler for: ${e} was not registered`)}isFocus(e){const t=this.members[e];return t?t.isFocus:null}isModerator(){return"moderator"===this.role}getMemberRole(e){return this.members[e]?this.members[e].role:null}setVideoMute(e,t){this.sendVideoInfoPresence(e),t&&t(e)}setAudioMute(e,t){return this.sendAudioInfoPresence(e,t)}addAudioInfoToPresence(e){return!(e&&!this.getFromPresence("audiomuted"))&&this.addOrReplaceInPresence("audiomuted",{value:e.toString()})}sendAudioInfoPresence(e,t){this.addAudioInfoToPresence(e)&&this.sendPresence(),t&&t()}addVideoInfoToPresence(e){return!(e&&!this.getFromPresence("videomuted"))&&this.addOrReplaceInPresence("videomuted",{value:e.toString()})}sendVideoInfoPresence(e){this.addVideoInfoToPresence(e)&&this.sendPresence()}getMediaPresenceInfo(e,t){const n=this.lastPresences[`${this.roomjid}/${e}`];if(!n)return null;const i={muted:!0,videoType:void 0};let r=null;if(t===c.a)r=y(n,"audiomuted");else{if(t!==c.c)return v.error("Unsupported media type: "+t),null;{r=y(n,"videomuted");const e=y(n,"jitsi_participant_codecType"),t=y(n,"videoType");t.length>0&&(i.videoType=t[0].value),e.length>0&&(i.codecType=e[0].value)}}return r.length>0&&(i.muted="true"===r[0].value),i}isSIPCallingSupported(){return!!this.moderator&&this.moderator.isSipGatewayEnabled()}dial(e){return this.connection.rayo.dial(e,"fromnumber",o.Strophe.getBareJidFromJid(this.myroomjid),this.password,this.focusMucJid)}hangup(){return this.connection.rayo.hangup()}getLobby(){return this.lobby}getAVModeration(){return this.avModeration}getPhoneNumber(){return this.phoneNumber}getPhonePin(){return this.phonePin}getMeetingId(){return this.meetingId}muteParticipant(e,t,n){v.info("set mute",t);const i=Object(o.$iq)({to:this.focusMucJid,type:"set"}).c("mute",{xmlns:"http://jitsi.org/jitmeet/"+n,jid:e}).t(t.toString()).up();this.connection.sendIQ(i,e=>v.log("set mute",e),e=>v.log("set mute error",e))}onMute(e){if(e.getAttribute("from")!==this.focusMucJid)return void v.warn("Ignored mute from non focus peer");const t=$(e).find("mute");t.length&&"true"===t.text()?this.eventEmitter.emit(u.a.AUDIO_MUTED_BY_FOCUS,t.attr("actor")):v.warn("Ignoring a mute request which does not explicitly specify a positive mute command.")}onMuteVideo(e){if(e.getAttribute("from")!==this.focusMucJid)return void v.warn("Ignored mute from non focus peer");const t=$(e).find("mute");t.length&&"true"===t.text()?this.eventEmitter.emit(u.a.VIDEO_MUTED_BY_FOCUS,t.attr("actor")):v.warn("Ignoring a mute request which does not explicitly specify a positive mute command.")}clean(){this._removeConnListeners.forEach(e=>e()),this._removeConnListeners=[],this.joined=!1}leave(){return new Promise((e,t)=>{const n=setTimeout(()=>r(!0),5e3),i=this.eventEmitter;function r(s=!1){i.removeListener(u.a.MUC_LEFT,r),clearTimeout(n),s?t(new Error("The timeout for the confirmation about leaving the room expired.")):e()}this.clean(),i.on(u.a.MUC_LEFT,r),this.doLeave()})}}}).call(this,"modules/xmpp/ChatRoom.js")},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return d}));var i=n(5),r=n(2),s=n(4),o=n(0),a=n.n(o);const c=Object(i.getLogger)(e);class d{constructor(e){this._xmpp=e.xmpp,this._mainRoom=e,this._momderationEnabledByType={[s.a]:!1,[s.c]:!1},this._whitelistAudio=[],this._whitelistVideo=[],this._xmpp.addListener(a.a.AV_MODERATION_RECEIVED,this._onMessage.bind(this))}isSupported(){return Boolean(this._xmpp.avModerationComponentAddress)}enable(e,t){if(!this.isSupported()||!this._mainRoom.isModerator())return void c.error(`Cannot enable:${e} AV moderation supported:${this.isSupported()}, \n moderator:${this._mainRoom.isModerator()}`);if(e===this._momderationEnabledByType[t])return void c.warn(`Moderation already in state:${e} for mediaType:${t}`);const n=Object(r.$msg)({to:this._xmpp.avModerationComponentAddress});n.c("av_moderation",{enable:e,mediaType:t}).up(),this._xmpp.connection.send(n)}approve(e,t){if(!this.isSupported()||!this._mainRoom.isModerator())return void c.error(`Cannot approve in AV moderation supported:${this.isSupported()}, \n moderator:${this._mainRoom.isModerator()}`);const n=Object(r.$msg)({to:this._xmpp.avModerationComponentAddress});n.c("av_moderation",{mediaType:e,jidToWhitelist:t}).up(),this._xmpp.connection.send(n)}_onMessage(e){const t=e.whitelists;if(t){const e=(e,t,n)=>{n.filter(e=>!t.includes(e)).forEach(t=>this._xmpp.eventEmitter.emit(a.a.AV_MODERATION_PARTICIPANT_APPROVED,e,t))};Array.isArray(t[s.a])&&e(s.a,this._whitelistAudio,t[s.a]),Array.isArray(t[s.c])&&e(s.c,this._whitelistVideo,t[s.c])}else void 0!==e.enabled&&this._momderationEnabledByType[e.mediaType]!==e.enabled?(this._momderationEnabledByType[e.mediaType]=e.enabled,this._xmpp.eventEmitter.emit(a.a.AV_MODERATION_CHANGED,e.enabled,e.mediaType,e.actor)):e.approved&&this._xmpp.eventEmitter.emit(a.a.AV_MODERATION_APPROVED,e.mediaType)}}}).call(this,"modules/xmpp/AVModeration.js")},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return c}));var i=n(5),r=n(2),s=n(0),o=n.n(s);const a=Object(i.getLogger)(e);class c{constructor(e){this.xmpp=e.xmpp,this.mainRoom=e;const t=this._maybeJoinLobbyRoom.bind(this);this.mainRoom.addEventListener(o.a.LOCAL_ROLE_CHANGED,t),this.mainRoom.addEventListener(o.a.MUC_MEMBERS_ONLY_CHANGED,t),this.mainRoom.addEventListener(o.a.ROOM_CONNECT_MEMBERS_ONLY_ERROR,e=>{this.lobbyRoomJid=e})}isSupported(){return this.xmpp.lobbySupported}enable(){return this.isSupported()?new Promise((e,t)=>{this.mainRoom.setMembersOnly(!0,e,t)}):Promise.reject(new Error("Lobby not supported!"))}disable(){this.isSupported()&&this.mainRoom.isModerator()&&this.lobbyRoom&&this.mainRoom.membersOnlyEnabled&&this.mainRoom.setMembersOnly(!1)}_leaveLobbyRoom(){this.lobbyRoom&&this.lobbyRoom.leave().then(()=>{this.lobbyRoom=void 0,a.info("Lobby room left!")}).catch(()=>{})}setLobbyRoomJid(e){this.lobbyRoomJid=e}_maybeJoinLobbyRoom(){if(!this.isSupported())return;this.mainRoom.joined&&this.mainRoom.isModerator()&&this.mainRoom.membersOnlyEnabled&&!this.lobbyRoom&&this.join().then(()=>a.info("Joined lobby room")).catch(e=>a.error("Failed joining lobby",e))}join(e,t){const n=this.mainRoom.joined&&this.mainRoom.isModerator();if(!this.lobbyRoomJid)return Promise.reject(new Error("Missing lobbyRoomJid, cannot join lobby room."));const i=r.Strophe.getNodeFromJid(this.lobbyRoomJid),s=r.Strophe.getDomainFromJid(this.lobbyRoomJid);return this.lobbyRoom=this.xmpp.createRoom(i,{customDomain:s,disableDiscoInfo:!0,disableFocus:!0,enableLobby:!1}),e&&this.lobbyRoom.addOrReplaceInPresence("nick",{attributes:{xmlns:"http://jabber.org/protocol/nick"},value:e}),n?(this.lobbyRoom.addPresenceListener("email",(e,t)=>{this.mainRoom.eventEmitter.emit(o.a.MUC_LOBBY_MEMBER_UPDATED,t,{email:e.value})}),this.lobbyRoom.addEventListener(o.a.MUC_MEMBER_JOINED,(e,t,n,i,s,a,c,d,u)=>{Object.values(this.mainRoom.members).find(e=>e.jid===u)||this.mainRoom.eventEmitter.emit(o.a.MUC_LOBBY_MEMBER_JOINED,r.Strophe.getResourceFromJid(e),t,c?c.avatar:void 0)}),this.lobbyRoom.addEventListener(o.a.MUC_MEMBER_LEFT,e=>{this.mainRoom.eventEmitter.emit(o.a.MUC_LOBBY_MEMBER_LEFT,r.Strophe.getResourceFromJid(e))}),this.lobbyRoom.addEventListener(o.a.MUC_DESTROYED,()=>{Object.keys(this.lobbyRoom.members).forEach(e=>this.mainRoom.eventEmitter.emit(o.a.MUC_LOBBY_MEMBER_LEFT,r.Strophe.getResourceFromJid(e))),this.lobbyRoom.clean(),this.lobbyRoom=void 0,a.info("Lobby room left(destroyed)!")})):(this.lobbyRoom.addEventListener(o.a.KICKED,e=>{if(e)return this.mainRoom.eventEmitter.emit(o.a.MUC_DENIED_ACCESS),void this.lobbyRoom.clean()}),this.mainRoom.addEventListener(o.a.INVITE_MESSAGE_RECEIVED,(e,t,n,i)=>{a.debug(`Received approval to join ${e} ${t} ${n}`),e===this.mainRoom.roomjid&&(this.mainRoom.join(i),this._leaveLobbyRoom())}),this.lobbyRoom.addEventListener(o.a.MUC_DESTROYED,(e,t)=>{t?this.mainRoom.join():(this.lobbyRoom.clean(),this.mainRoom.eventEmitter.emit(o.a.MUC_DESTROYED,e))}),this.mainRoom.addEventListener(o.a.MUC_JOINED,()=>{this._leaveLobbyRoom()})),new Promise((e,i)=>{this.lobbyRoom.addEventListener(o.a.MUC_JOINED,()=>{e(),t&&!n&&this.lobbyRoom.addOrReplaceInPresence("email",{value:t})&&this.lobbyRoom.sendPresence()}),this.lobbyRoom.addEventListener(o.a.ROOM_JOIN_ERROR,i),this.lobbyRoom.addEventListener(o.a.ROOM_CONNECT_NOT_ALLOWED_ERROR,i),this.lobbyRoom.addEventListener(o.a.ROOM_CONNECT_ERROR,i),this.lobbyRoom.join()})}denyAccess(e){if(!this.isSupported()||!this.mainRoom.isModerator())return;const t=Object.keys(this.lobbyRoom.members).find(t=>r.Strophe.getResourceFromJid(t)===e);t?this.lobbyRoom.kick(t):a.error(`Not found member for ${e} in lobby room.`)}approveAccess(e){if(!this.isSupported()||!this.mainRoom.isModerator())return;const t=Object.keys(this.lobbyRoom.members).find(t=>r.Strophe.getResourceFromJid(t)===e);if(t){const e=this.lobbyRoom.members[t].jid,n=Object(r.$msg)({to:this.mainRoom.roomjid}).c("x",{xmlns:"http://jabber.org/protocol/muc#user"}).c("invite",{to:e});this.xmpp.connection.sendIQ(n,()=>{},t=>{a.error("Error sending invite for "+e,t)})}else a.error(`Not found member for ${t} in lobby room.`)}}}).call(this,"modules/xmpp/Lobby.js")},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return l}));var i=n(5),r=n(2),s=n(29);const o=n(73),a=n(0),c=n(12),d=Object(i.getLogger)(e);function u(e){let t=1;return function(n){if(n)return void(t=1);const i=Math.pow(2,t-1);return t+=1,i*e}}function l(e,t,n,i){function r(e){if(e.data&&e.data.sessionId){if(e.origin!==window.location.origin)return void d.warn("Ignoring sessionId from different origin: "+e.origin);s.a.sessionId=e.data.sessionId}}this.roomName=e,this.xmppService=t,this.getNextTimeout=u(1e3),this.getNextErrorTimeout=u(1e3),this.externalAuthEnabled=!1,this.options=i,this.sipGatewayEnabled=!1,this.eventEmitter=n,this.connection=this.xmppService.connection,window.addEventListener?window.addEventListener("message",r,!1):window.attachEvent("onmessage",r)}l.prototype.isExternalAuthEnabled=function(){return this.externalAuthEnabled},l.prototype.isSipGatewayEnabled=function(){return this.sipGatewayEnabled},l.prototype.onMucMemberLeft=function(e){d.info("Someone left is it focus ? "+e);"focus"===r.Strophe.getResourceFromJid(e)&&(d.info("Focus has left the room - leaving conference"),this.eventEmitter.emit(a.FOCUS_LEFT))},l.prototype.setFocusUserJid=function(e){this.focusUserJid||(this.focusUserJid=e,d.info("Focus jid set to: "+this.focusUserJid))},l.prototype.getFocusUserJid=function(){return this.focusUserJid},l.prototype.getFocusComponent=function(){let e=this.options.connection.hosts.focus;return e||(e="focus."+this.options.connection.hosts.domain),e},l.prototype.createConferenceIq=function(){const e=Object(r.$iq)({to:this.getFocusComponent(),type:"set"}),{sessionId:t}=s.a,n=s.a.machineId,i=this.options.conference;return d.info(`Session ID: ${t} machine UID: ${n}`),e.c("conference",{xmlns:"http://jitsi.org/protocol/focus",room:this.roomName,"machine-uid":n}),t&&e.attrs({"session-id":t}),e.c("property",{name:"disableRtx",value:Boolean(i.disableRtx)}).up(),void 0!==i.audioPacketDelay&&e.c("property",{name:"audioPacketDelay",value:i.audioPacketDelay}).up(),i.startBitrate&&e.c("property",{name:"startBitrate",value:i.startBitrate}).up(),i.minBitrate&&e.c("property",{name:"minBitrate",value:i.minBitrate}).up(),void 0!==this.options.conference.startAudioMuted&&e.c("property",{name:"startAudioMuted",value:this.options.conference.startAudioMuted}).up(),void 0!==this.options.conference.startVideoMuted&&e.c("property",{name:"startVideoMuted",value:this.options.conference.startVideoMuted}).up(),e.up(),e},l.prototype.parseSessionId=function(e){const t=$(e).find("conference").attr("session-id");t&&(d.info("Received sessionId: "+t),s.a.sessionId=t)},l.prototype.parseConfigOptions=function(e){this.setFocusUserJid($(e).find("conference").attr("focusjid"));const t=$(e).find(">conference>property[name='authentication'][value='true']").length>0;d.info("Authentication enabled: "+t),this.externalAuthEnabled=$(e).find(">conference>property[name='externalAuth'][value='true']").length>0,d.info("External authentication enabled: "+this.externalAuthEnabled),this.externalAuthEnabled||this.parseSessionId(e);const n=$(e).find(">conference").attr("identity");this.eventEmitter.emit(o.IDENTITY_UPDATED,t,n),$(e).find(">conference>property[name='sipGatewayEnabled'][value='true']").length&&(this.sipGatewayEnabled=!0),d.info("Sip gateway enabled: "+this.sipGatewayEnabled)},l.prototype.allocateConferenceFocus=function(){return new Promise(e=>{this.setFocusUserJid(this.options.connection.focusUserJid),this.connection.sendIQ(this.createConferenceIq(),t=>this._allocateConferenceFocusSuccess(t,e),t=>this._allocateConferenceFocusError(t,e)),this.connection.flush()})},l.prototype._allocateConferenceFocusError=function(e,t){const n=$(e).find(">error>session-invalid").length||$(e).find(">error>not-acceptable").length;if(n&&(d.info("Session expired! - removing"),s.a.sessionId=void 0),$(e).find(">error>graceful-shutdown").length)return void this.eventEmitter.emit(a.GRACEFUL_SHUTDOWN);const i=$(e).find(">error>reservation-error");if(i.length){const t=i.attr("error-code"),n=$(e).find(">error>text");let r;return n&&(r=n.text()),void this.eventEmitter.emit(a.RESERVATION_ERROR,t,r)}if($(e).find(">error>not-authorized").length){d.warn("Unauthorized to start the conference",e);return r.Strophe.getDomainFromJid(e.getAttribute("to"))!==this.options.connection.hosts.anonymousdomain&&(this.externalAuthEnabled=!0),void this.eventEmitter.emit(a.AUTHENTICATION_REQUIRED)}const o=this.getNextErrorTimeout(),u="Focus error, retry after "+o;c.callErrorHandler(new Error(u)),d.error(u,e);const l=this.getFocusComponent(),h=o/1e3;n||this.eventEmitter.emit(a.FOCUS_DISCONNECTED,l,h),this.getNextTimeout(!0),window.setTimeout(()=>this.allocateConferenceFocus().then(t),o)},l.prototype._allocateConferenceFocusSuccess=function(e,t){if(this.parseConfigOptions(e),this.getNextErrorTimeout(!0),"true"===$(e).find("conference").attr("ready"))this.getNextTimeout(!0),t();else{const e=this.getNextTimeout();d.info("Waiting for the focus... "+e),window.setTimeout(()=>this.allocateConferenceFocus().then(t),e)}},l.prototype.authenticate=function(){return new Promise((e,t)=>{this.connection.sendIQ(this.createConferenceIq(),t=>{this.parseSessionId(t),e()},e=>t({error:$(e).find("iq>error :first").prop("tagName"),message:$(e).find("iq>error>text").text()}))})},l.prototype.getLoginUrl=function(e,t){this._getLoginUrl(!1,e,t)},l.prototype._getLoginUrl=function(e,t,n){const i=Object(r.$iq)({to:this.getFocusComponent(),type:"get"}),o={xmlns:"http://jitsi.org/protocol/focus",room:this.roomName,"machine-uid":s.a.machineId};let a="auth url";function u(e,t){c.callErrorHandler(new Error(e)),d.error(e,t),n(t)}e&&(o.popup=!0,a="POPUP "+a),i.c("login-url",o),this.connection.sendIQ(i,e=>{let n=$(e).find("login-url").attr("url");n=decodeURIComponent(n),n?(d.info(`Got ${a}: ${n}`),t(n)):u(`Failed to get ${a} from the focus`,e)},u.bind(void 0,`Get ${a} error`))},l.prototype.getPopupLoginUrl=function(e,t){this._getLoginUrl(!0,e,t)},l.prototype.logout=function(e){const t=Object(r.$iq)({to:this.getFocusComponent(),type:"set"}),{sessionId:n}=s.a;n?(t.c("logout",{xmlns:"http://jitsi.org/protocol/focus","session-id":n}),this.connection.sendIQ(t,t=>{let n=$(t).find("logout").attr("logout-url");n&&(n=decodeURIComponent(n)),d.info("Log out OK, url: "+n,t),s.a.sessionId=void 0,e(n)},e=>{c.callErrorHandler(new Error("Logout error")),d.error("Logout error",e)})):e()}}).call(this,"modules/xmpp/moderator.js")},function(e,t,n){const i=n(38),r=["Aaliyah","Aaron","Abagail","Abbey","Abbie","Abbigail","Abby","Abdiel","Abdul","Abdullah","Abe","Abel","Abelardo","Abigail","Abigale","Abigayle","Abner","Abraham","Ada","Adah","Adalberto","Adaline","Adam","Adan","Addie","Addison","Adela","Adelbert","Adele","Adelia","Adeline","Adell","Adella","Adelle","Aditya","Adolf","Adolfo","Adolph","Adolphus","Adonis","Adrain","Adrian","Adriana","Adrianna","Adriel","Adrien","Adrienne","Afton","Aglae","Agnes","Agustin","Agustina","Ahmad","Ahmed","Aida","Aidan","Aiden","Aileen","Aisha","Aiyana","Akeem","Al","Alaina","Alan","Alana","Alanis","Alanna","Alayna","Alba","Albert","Alberta","Albertha","Alberto","Albin","Albina","Alda","Alden","Alec","Aleen","Alejandra","Alejandrin","Alek","Alena","Alene","Alessandra","Alessandro","Alessia","Aletha","Alex","Alexa","Alexander","Alexandra","Alexandre","Alexandrea","Alexandria","Alexandrine","Alexandro","Alexane","Alexanne","Alexie","Alexis","Alexys","Alexzander","Alf","Alfonso","Alfonzo","Alford","Alfred","Alfreda","Alfredo","Ali","Alia","Alice","Alicia","Alisa","Alisha","Alison","Alivia","Aliya","Aliyah","Aliza","Alize","Allan","Allen","Allene","Allie","Allison","Ally","Alphonso","Alta","Althea","Alva","Alvah","Alvena","Alvera","Alverta","Alvina","Alvis","Alyce","Alycia","Alysa","Alysha","Alyson","Alysson","Amalia","Amanda","Amani","Amara","Amari","Amaya","Amber","Ambrose","Amelia","Amelie","Amely","America","Americo","Amie","Amina","Amir","Amira","Amiya","Amos","Amparo","Amy","Amya","Ana","Anabel","Anabelle","Anahi","Anais","Anastacio","Anastasia","Anderson","Andre","Andreane","Andreanne","Andres","Andrew","Andy","Angel","Angela","Angelica","Angelina","Angeline","Angelita","Angelo","Angie","Angus","Anibal","Anika","Anissa","Anita","Aniya","Aniyah","Anjali","Anna","Annabel","Annabell","Annabelle","Annalise","Annamae","Annamarie","Anne","Annetta","Annette","Annie","Ansel","Ansley","Anthony","Antoinette","Antone","Antonetta","Antonette","Antonia","Antonietta","Antonina","Antonio","Antwan","Antwon","Anya","April","Ara","Araceli","Aracely","Arch","Archibald","Ardella","Arden","Ardith","Arely","Ari","Ariane","Arianna","Aric","Ariel","Arielle","Arjun","Arlene","Arlie","Arlo","Armand","Armando","Armani","Arnaldo","Arne","Arno","Arnold","Arnoldo","Arnulfo","Aron","Art","Arthur","Arturo","Arvel","Arvid","Arvilla","Aryanna","Asa","Asha","Ashlee","Ashleigh","Ashley","Ashly","Ashlynn","Ashton","Ashtyn","Asia","Assunta","Astrid","Athena","Aubree","Aubrey","Audie","Audra","Audreanne","Audrey","August","Augusta","Augustine","Augustus","Aurelia","Aurelie","Aurelio","Aurore","Austen","Austin","Austyn","Autumn","Ava","Avery","Avis","Axel","Ayana","Ayden","Ayla","Aylin","Baby","Bailee","Bailey","Barbara","Barney","Baron","Barrett","Barry","Bart","Bartholome","Barton","Baylee","Beatrice","Beau","Beaulah","Bell","Bella","Belle","Ben","Benedict","Benjamin","Bennett","Bennie","Benny","Benton","Berenice","Bernadette","Bernadine","Bernard","Bernardo","Berneice","Bernhard","Bernice","Bernie","Berniece","Bernita","Berry","Bert","Berta","Bertha","Bertram","Bertrand","Beryl","Bessie","Beth","Bethany","Bethel","Betsy","Bette","Bettie","Betty","Bettye","Beulah","Beverly","Bianka","Bill","Billie","Billy","Birdie","Blair","Blaise","Blake","Blanca","Blanche","Blaze","Bo","Bobbie","Bobby","Bonita","Bonnie","Boris","Boyd","Brad","Braden","Bradford","Bradley","Bradly","Brady","Braeden","Brain","Brandi","Brando","Brandon","Brandt","Brandy","Brandyn","Brannon","Branson","Brant","Braulio","Braxton","Brayan","Breana","Breanna","Breanne","Brenda","Brendan","Brenden","Brendon","Brenna","Brennan","Brennon","Brent","Bret","Brett","Bria","Brian","Briana","Brianne","Brice","Bridget","Bridgette","Bridie","Brielle","Brigitte","Brionna","Brisa","Britney","Brittany","Brock","Broderick","Brody","Brook","Brooke","Brooklyn","Brooks","Brown","Bruce","Bryana","Bryce","Brycen","Bryon","Buck","Bud","Buddy","Buford","Bulah","Burdette","Burley","Burnice","Buster","Cade","Caden","Caesar","Caitlyn","Cale","Caleb","Caleigh","Cali","Calista","Callie","Camden","Cameron","Camila","Camilla","Camille","Camren","Camron","Camryn","Camylle","Candace","Candelario","Candice","Candida","Candido","Cara","Carey","Carissa","Carlee","Carleton","Carley","Carli","Carlie","Carlo","Carlos","Carlotta","Carmel","Carmela","Carmella","Carmelo","Carmen","Carmine","Carol","Carolanne","Carole","Carolina","Caroline","Carolyn","Carolyne","Carrie","Carroll","Carson","Carter","Cary","Casandra","Casey","Casimer","Casimir","Casper","Cassandra","Cassandre","Cassidy","Cassie","Catalina","Caterina","Catharine","Catherine","Cathrine","Cathryn","Cathy","Cayla","Ceasar","Cecelia","Cecil","Cecile","Cecilia","Cedrick","Celestine","Celestino","Celia","Celine","Cesar","Chad","Chadd","Chadrick","Chaim","Chance","Chandler","Chanel","Chanelle","Charity","Charlene","Charles","Charley","Charlie","Charlotte","Chase","Chasity","Chauncey","Chaya","Chaz","Chelsea","Chelsey","Chelsie","Chesley","Chester","Chet","Cheyanne","Cheyenne","Chloe","Chris","Christ","Christa","Christelle","Christian","Christiana","Christina","Christine","Christop","Christophe","Christopher","Christy","Chyna","Ciara","Cicero","Cielo","Cierra","Cindy","Citlalli","Clair","Claire","Clara","Clarabelle","Clare","Clarissa","Clark","Claud","Claude","Claudia","Claudie","Claudine","Clay","Clemens","Clement","Clementina","Clementine","Clemmie","Cleo","Cleora","Cleta","Cletus","Cleve","Cleveland","Clifford","Clifton","Clint","Clinton","Clotilde","Clovis","Cloyd","Clyde","Coby","Cody","Colby","Cole","Coleman","Colin","Colleen","Collin","Colt","Colten","Colton","Columbus","Concepcion","Conner","Connie","Connor","Conor","Conrad","Constance","Constantin","Consuelo","Cooper","Cora","Coralie","Corbin","Cordelia","Cordell","Cordia","Cordie","Corene","Corine","Cornelius","Cornell","Corrine","Cortez","Cortney","Cory","Coty","Courtney","Coy","Craig","Crawford","Creola","Cristal","Cristian","Cristina","Cristobal","Cristopher","Cruz","Crystal","Crystel","Cullen","Curt","Curtis","Cydney","Cynthia","Cyril","Cyrus","Dagmar","Dahlia","Daija","Daisha","Daisy","Dakota","Dale","Dallas","Dallin","Dalton","Damaris","Dameon","Damian","Damien","Damion","Damon","Dan","Dana","Dandre","Dane","D'angelo","Dangelo","Danial","Daniela","Daniella","Danielle","Danika","Dannie","Danny","Dante","Danyka","Daphne","Daphnee","Daphney","Darby","Daren","Darian","Dariana","Darien","Dario","Darion","Darius","Darlene","Daron","Darrel","Darrell","Darren","Darrick","Darrin","Darrion","Darron","Darryl","Darwin","Daryl","Dashawn","Dasia","Dave","David","Davin","Davion","Davon","Davonte","Dawn","Dawson","Dax","Dayana","Dayna","Dayne","Dayton","Dean","Deangelo","Deanna","Deborah","Declan","Dedric","Dedrick","Dee","Deion","Deja","Dejah","Dejon","Dejuan","Delaney","Delbert","Delfina","Delia","Delilah","Dell","Della","Delmer","Delores","Delpha","Delphia","Delphine","Delta","Demarco","Demarcus","Demario","Demetris","Demetrius","Demond","Dena","Denis","Dennis","Deon","Deondre","Deontae","Deonte","Dereck","Derek","Derick","Deron","Derrick","Deshaun","Deshawn","Desiree","Desmond","Dessie","Destany","Destin","Destinee","Destiney","Destini","Destiny","Devan","Devante","Deven","Devin","Devon","Devonte","Devyn","Dewayne","Dewitt","Dexter","Diamond","Diana","Dianna","Diego","Dillan","Dillon","Dimitri","Dina","Dino","Dion","Dixie","Dock","Dolly","Dolores","Domenic","Domenica","Domenick","Domenico","Domingo","Dominic","Dominique","Don","Donald","Donato","Donavon","Donna","Donnell","Donnie","Donny","Dora","Dorcas","Dorian","Doris","Dorothea","Dorothy","Dorris","Dortha","Dorthy","Doug","Douglas","Dovie","Doyle","Drake","Drew","Duane","Dudley","Dulce","Duncan","Durward","Dustin","Dusty","Dwight","Dylan","Earl","Earlene","Earline","Earnest","Earnestine","Easter","Easton","Ebba","Ebony","Ed","Eda","Edd","Eddie","Eden","Edgar","Edgardo","Edison","Edmond","Edmund","Edna","Eduardo","Edward","Edwardo","Edwin","Edwina","Edyth","Edythe","Effie","Efrain","Efren","Eileen","Einar","Eino","Eladio","Elaina","Elbert","Elda","Eldon","Eldora","Eldred","Eldridge","Eleanora","Eleanore","Eleazar","Electa","Elena","Elenor","Elenora","Eleonore","Elfrieda","Eli","Elian","Eliane","Elias","Eliezer","Elijah","Elinor","Elinore","Elisa","Elisabeth","Elise","Eliseo","Elisha","Elissa","Eliza","Elizabeth","Ella","Ellen","Ellie","Elliot","Elliott","Ellis","Ellsworth","Elmer","Elmira","Elmo","Elmore","Elna","Elnora","Elody","Eloisa","Eloise","Elouise","Eloy","Elroy","Elsa","Else","Elsie","Elta","Elton","Elva","Elvera","Elvie","Elvis","Elwin","Elwyn","Elyse","Elyssa","Elza","Emanuel","Emelia","Emelie","Emely","Emerald","Emerson","Emery","Emie","Emil","Emile","Emilia","Emiliano","Emilie","Emilio","Emily","Emma","Emmalee","Emmanuel","Emmanuelle","Emmet","Emmett","Emmie","Emmitt","Emmy","Emory","Ena","Enid","Enoch","Enola","Enos","Enrico","Enrique","Ephraim","Era","Eriberto","Eric","Erica","Erich","Erick","Ericka","Erik","Erika","Erin","Erling","Erna","Ernest","Ernestina","Ernestine","Ernesto","Ernie","Ervin","Erwin","Eryn","Esmeralda","Esperanza","Esta","Esteban","Estefania","Estel","Estell","Estella","Estelle","Estevan","Esther","Estrella","Etha","Ethan","Ethel","Ethelyn","Ethyl","Ettie","Eudora","Eugene","Eugenia","Eula","Eulah","Eulalia","Euna","Eunice","Eusebio","Eva","Evalyn","Evan","Evangeline","Evans","Eve","Eveline","Evelyn","Everardo","Everett","Everette","Evert","Evie","Ewald","Ewell","Ezekiel","Ezequiel","Ezra","Fabian","Fabiola","Fae","Fannie","Fanny","Fatima","Faustino","Fausto","Favian","Fay","Faye","Federico","Felicia","Felicita","Felicity","Felipa","Felipe","Felix","Felton","Fermin","Fern","Fernando","Ferne","Fidel","Filiberto","Filomena","Finn","Fiona","Flavie","Flavio","Fleta","Fletcher","Flo","Florence","Florencio","Florian","Florida","Florine","Flossie","Floy","Floyd","Ford","Forest","Forrest","Foster","Frances","Francesca","Francesco","Francis","Francisca","Francisco","Franco","Frank","Frankie","Franz","Fred","Freda","Freddie","Freddy","Frederic","Frederick","Frederik","Frederique","Fredrick","Fredy","Freeda","Freeman","Freida","Frida","Frieda","Friedrich","Fritz","Furman","Gabe","Gabriel","Gabriella","Gabrielle","Gaetano","Gage","Gail","Gardner","Garett","Garfield","Garland","Garnet","Garnett","Garret","Garrett","Garrick","Garrison","Garry","Garth","Gaston","Gavin","Gay","Gayle","Gaylord","Gene","General","Genesis","Genevieve","Gennaro","Genoveva","Geo","Geoffrey","George","Georgette","Georgiana","Georgianna","Geovanni","Geovanny","Geovany","Gerald","Geraldine","Gerard","Gerardo","Gerda","Gerhard","Germaine","German","Gerry","Gerson","Gertrude","Gia","Gianni","Gideon","Gilbert","Gilberto","Gilda","Giles","Gillian","Gina","Gino","Giovani","Giovanna","Giovanni","Giovanny","Gisselle","Giuseppe","Gladyce","Gladys","Glen","Glenda","Glenna","Glennie","Gloria","Godfrey","Golda","Golden","Gonzalo","Gordon","Grace","Gracie","Graciela","Grady","Graham","Grant","Granville","Grayce","Grayson","Green","Greg","Gregg","Gregoria","Gregorio","Gregory","Greta","Gretchen","Greyson","Griffin","Grover","Guadalupe","Gudrun","Guido","Guillermo","Guiseppe","Gunnar","Gunner","Gus","Gussie","Gust","Gustave","Guy","Gwen","Gwendolyn","Hadley","Hailee","Hailey","Hailie","Hal","Haleigh","Haley","Halie","Halle","Hallie","Hank","Hanna","Hannah","Hans","Hardy","Harley","Harmon","Harmony","Harold","Harrison","Harry","Harvey","Haskell","Hassan","Hassie","Hattie","Haven","Hayden","Haylee","Hayley","Haylie","Hazel","Hazle","Heath","Heather","Heaven","Heber","Hector","Heidi","Helen","Helena","Helene","Helga","Hellen","Helmer","Heloise","Henderson","Henri","Henriette","Henry","Herbert","Herman","Hermann","Hermina","Herminia","Herminio","Hershel","Herta","Hertha","Hester","Hettie","Hilario","Hilbert","Hilda","Hildegard","Hillard","Hillary","Hilma","Hilton","Hipolito","Hiram","Hobart","Holden","Hollie","Hollis","Holly","Hope","Horace","Horacio","Hortense","Hosea","Houston","Howard","Howell","Hoyt","Hubert","Hudson","Hugh","Hulda","Humberto","Hunter","Hyman","Ian","Ibrahim","Icie","Ida","Idell","Idella","Ignacio","Ignatius","Ike","Ila","Ilene","Iliana","Ima","Imani","Imelda","Immanuel","Imogene","Ines","Irma","Irving","Irwin","Isaac","Isabel","Isabell","Isabella","Isabelle","Isac","Isadore","Isai","Isaiah","Isaias","Isidro","Ismael","Isobel","Isom","Israel","Issac","Itzel","Iva","Ivah","Ivory","Ivy","Izabella","Izaiah","Jabari","Jace","Jacey","Jacinthe","Jacinto","Jack","Jackeline","Jackie","Jacklyn","Jackson","Jacky","Jaclyn","Jacquelyn","Jacques","Jacynthe","Jada","Jade","Jaden","Jadon","Jadyn","Jaeden","Jaida","Jaiden","Jailyn","Jaime","Jairo","Jakayla","Jake","Jakob","Jaleel","Jalen","Jalon","Jalyn","Jamaal","Jamal","Jamar","Jamarcus","Jamel","Jameson","Jamey","Jamie","Jamil","Jamir","Jamison","Jammie","Jan","Jana","Janae","Jane","Janelle","Janessa","Janet","Janice","Janick","Janie","Janis","Janiya","Jannie","Jany","Jaquan","Jaquelin","Jaqueline","Jared","Jaren","Jarod","Jaron","Jarred","Jarrell","Jarret","Jarrett","Jarrod","Jarvis","Jasen","Jasmin","Jason","Jasper","Jaunita","Javier","Javon","Javonte","Jay","Jayce","Jaycee","Jayda","Jayde","Jayden","Jaydon","Jaylan","Jaylen","Jaylin","Jaylon","Jayme","Jayne","Jayson","Jazlyn","Jazmin","Jazmyn","Jazmyne","Jean","Jeanette","Jeanie","Jeanne","Jed","Jedediah","Jedidiah","Jeff","Jefferey","Jeffery","Jeffrey","Jeffry","Jena","Jenifer","Jennie","Jennifer","Jennings","Jennyfer","Jensen","Jerad","Jerald","Jeramie","Jeramy","Jerel","Jeremie","Jeremy","Jermain","Jermaine","Jermey","Jerod","Jerome","Jeromy","Jerrell","Jerrod","Jerrold","Jerry","Jess","Jesse","Jessica","Jessie","Jessika","Jessy","Jessyca","Jesus","Jett","Jettie","Jevon","Jewel","Jewell","Jillian","Jimmie","Jimmy","Jo","Joan","Joana","Joanie","Joanne","Joannie","Joanny","Joany","Joaquin","Jocelyn","Jodie","Jody","Joe","Joel","Joelle","Joesph","Joey","Johan","Johann","Johanna","Johathan","John","Johnathan","Johnathon","Johnnie","Johnny","Johnpaul","Johnson","Jolie","Jon","Jonas","Jonatan","Jonathan","Jonathon","Jordan","Jordane","Jordi","Jordon","Jordy","Jordyn","Jorge","Jose","Josefa","Josefina","Joseph","Josephine","Josh","Joshua","Joshuah","Josiah","Josiane","Josianne","Josie","Josue","Jovan","Jovani","Jovanny","Jovany","Joy","Joyce","Juana","Juanita","Judah","Judd","Jude","Judge","Judson","Judy","Jules","Julia","Julian","Juliana","Julianne","Julie","Julien","Juliet","Julio","Julius","June","Junior","Junius","Justen","Justice","Justina","Justine","Juston","Justus","Justyn","Juvenal","Juwan","Kacey","Kaci","Kacie","Kade","Kaden","Kadin","Kaela","Kaelyn","Kaia","Kailee","Kailey","Kailyn","Kaitlin","Kaitlyn","Kale","Kaleb","Kaleigh","Kaley","Kali","Kallie","Kameron","Kamille","Kamren","Kamron","Kamryn","Kane","Kara","Kareem","Karelle","Karen","Kari","Kariane","Karianne","Karina","Karine","Karl","Karlee","Karley","Karli","Karlie","Karolann","Karson","Kasandra","Kasey","Kassandra","Katarina","Katelin","Katelyn","Katelynn","Katharina","Katherine","Katheryn","Kathleen","Kathlyn","Kathryn","Kathryne","Katlyn","Katlynn","Katrina","Katrine","Kattie","Kavon","Kay","Kaya","Kaycee","Kayden","Kayla","Kaylah","Kaylee","Kayleigh","Kayley","Kayli","Kaylie","Kaylin","Keagan","Keanu","Keara","Keaton","Keegan","Keeley","Keely","Keenan","Keira","Keith","Kellen","Kelley","Kelli","Kellie","Kelly","Kelsi","Kelsie","Kelton","Kelvin","Ken","Kendall","Kendra","Kendrick","Kenna","Kennedi","Kennedy","Kenneth","Kennith","Kenny","Kenton","Kenya","Kenyatta","Kenyon","Keon","Keshaun","Keshawn","Keven","Kevin","Kevon","Keyon","Keyshawn","Khalid","Khalil","Kian","Kiana","Kianna","Kiara","Kiarra","Kiel","Kiera","Kieran","Kiley","Kim","Kimberly","King","Kip","Kira","Kirk","Kirsten","Kirstin","Kitty","Kobe","Koby","Kody","Kolby","Kole","Korbin","Korey","Kory","Kraig","Kris","Krista","Kristian","Kristin","Kristina","Kristofer","Kristoffer","Kristopher","Kristy","Krystal","Krystel","Krystina","Kurt","Kurtis","Kyla","Kyle","Kylee","Kyleigh","Kyler","Kylie","Kyra","Lacey","Lacy","Ladarius","Lafayette","Laila","Laisha","Lamar","Lambert","Lamont","Lance","Landen","Lane","Laney","Larissa","Laron","Larry","Larue","Laura","Laurel","Lauren","Laurence","Lauretta","Lauriane","Laurianne","Laurie","Laurine","Laury","Lauryn","Lavada","Lavern","Laverna","Laverne","Lavina","Lavinia","Lavon","Lavonne","Lawrence","Lawson","Layla","Layne","Lazaro","Lea","Leann","Leanna","Leanne","Leatha","Leda","Lee","Leif","Leila","Leilani","Lela","Lelah","Leland","Lelia","Lempi","Lemuel","Lenna","Lennie","Lenny","Lenora","Lenore","Leo","Leola","Leon","Leonard","Leonardo","Leone","Leonel","Leonie","Leonor","Leonora","Leopold","Leopoldo","Leora","Lera","Lesley","Leslie","Lesly","Lessie","Lester","Leta","Letha","Letitia","Levi","Lew","Lewis","Lexi","Lexie","Lexus","Lia","Liam","Liana","Libbie","Libby","Lila","Lilian","Liliana","Liliane","Lilla","Lillian","Lilliana","Lillie","Lilly","Lily","Lilyan","Lina","Lincoln","Linda","Lindsay","Lindsey","Linnea","Linnie","Linwood","Lionel","Lisa","Lisandro","Lisette","Litzy","Liza","Lizeth","Lizzie","Llewellyn","Lloyd","Logan","Lois","Lola","Lolita","Loma","Lon","London","Lonie","Lonnie","Lonny","Lonzo","Lora","Loraine","Loren","Lorena","Lorenz","Lorenza","Lorenzo","Lori","Lorine","Lorna","Lottie","Lou","Louie","Louisa","Lourdes","Louvenia","Lowell","Loy","Loyal","Loyce","Lucas","Luciano","Lucie","Lucienne","Lucile","Lucinda","Lucio","Lucious","Lucius","Lucy","Ludie","Ludwig","Lue","Luella","Luigi","Luis","Luisa","Lukas","Lula","Lulu","Luna","Lupe","Lura","Lurline","Luther","Luz","Lyda","Lydia","Lyla","Lynn","Lyric","Lysanne","Mabel","Mabelle","Mable","Mac","Macey","Maci","Macie","Mack","Mackenzie","Macy","Madaline","Madalyn","Maddison","Madeline","Madelyn","Madelynn","Madge","Madie","Madilyn","Madisen","Madison","Madisyn","Madonna","Madyson","Mae","Maegan","Maeve","Mafalda","Magali","Magdalen","Magdalena","Maggie","Magnolia","Magnus","Maia","Maida","Maiya","Major","Makayla","Makenna","Makenzie","Malachi","Malcolm","Malika","Malinda","Mallie","Mallory","Malvina","Mandy","Manley","Manuel","Manuela","Mara","Marc","Marcel","Marcelina","Marcelino","Marcella","Marcelle","Marcellus","Marcelo","Marcia","Marco","Marcos","Marcus","Margaret","Margarete","Margarett","Margaretta","Margarette","Margarita","Marge","Margie","Margot","Margret","Marguerite","Maria","Mariah","Mariam","Marian","Mariana","Mariane","Marianna","Marianne","Mariano","Maribel","Marie","Mariela","Marielle","Marietta","Marilie","Marilou","Marilyne","Marina","Mario","Marion","Marisa","Marisol","Maritza","Marjolaine","Marjorie","Marjory","Mark","Markus","Marlee","Marlen","Marlene","Marley","Marlin","Marlon","Marques","Marquis","Marquise","Marshall","Marta","Martin","Martina","Martine","Marty","Marvin","Mary","Maryam","Maryjane","Maryse","Mason","Mateo","Mathew","Mathias","Mathilde","Matilda","Matilde","Matt","Matteo","Mattie","Maud","Maude","Maudie","Maureen","Maurice","Mauricio","Maurine","Maverick","Mavis","Max","Maxie","Maxime","Maximilian","Maximillia","Maximillian","Maximo","Maximus","Maxine","Maxwell","May","Maya","Maybell","Maybelle","Maye","Maymie","Maynard","Mayra","Mazie","Mckayla","Mckenna","Mckenzie","Meagan","Meaghan","Meda","Megane","Meggie","Meghan","Mekhi","Melany","Melba","Melisa","Melissa","Mellie","Melody","Melvin","Melvina","Melyna","Melyssa","Mercedes","Meredith","Merl","Merle","Merlin","Merritt","Mertie","Mervin","Meta","Mia","Micaela","Micah","Michael","Michaela","Michale","Micheal","Michel","Michele","Michelle","Miguel","Mikayla","Mike","Mikel","Milan","Miles","Milford","Miller","Millie","Milo","Milton","Mina","Minerva","Minnie","Miracle","Mireille","Mireya","Misael","Missouri","Misty","Mitchel","Mitchell","Mittie","Modesta","Modesto","Mohamed","Mohammad","Mohammed","Moises","Mollie","Molly","Mona","Monica","Monique","Monroe","Monserrat","Monserrate","Montana","Monte","Monty","Morgan","Moriah","Morris","Mortimer","Morton","Mose","Moses","Moshe","Mossie","Mozell","Mozelle","Muhammad","Muriel","Murl","Murphy","Murray","Mustafa","Mya","Myah","Mylene","Myles","Myra","Myriam","Myrl","Myrna","Myron","Myrtice","Myrtie","Myrtis","Myrtle","Nadia","Nakia","Name","Nannie","Naomi","Naomie","Napoleon","Narciso","Nash","Nasir","Nat","Natalia","Natalie","Natasha","Nathan","Nathanael","Nathanial","Nathaniel","Nathen","Nayeli","Neal","Ned","Nedra","Neha","Neil","Nelda","Nella","Nelle","Nellie","Nels","Nelson","Neoma","Nestor","Nettie","Neva","Newell","Newton","Nia","Nicholas","Nicholaus","Nichole","Nick","Nicklaus","Nickolas","Nico","Nicola","Nicolas","Nicole","Nicolette","Nigel","Nikita","Nikki","Nikko","Niko","Nikolas","Nils","Nina","Noah","Noble","Noe","Noel","Noelia","Noemi","Noemie","Noemy","Nola","Nolan","Nona","Nora","Norbert","Norberto","Norene","Norma","Norris","Norval","Norwood","Nova","Novella","Nya","Nyah","Nyasia","Obie","Oceane","Ocie","Octavia","Oda","Odell","Odessa","Odie","Ofelia","Okey","Ola","Olaf","Ole","Olen","Oleta","Olga","Olin","Oliver","Ollie","Oma","Omari","Omer","Ona","Onie","Opal","Ophelia","Ora","Oral","Oran","Oren","Orie","Orin","Orion","Orland","Orlando","Orlo","Orpha","Orrin","Orval","Orville","Osbaldo","Osborne","Oscar","Osvaldo","Oswald","Oswaldo","Otha","Otho","Otilia","Otis","Ottilie","Ottis","Otto","Ova","Owen","Ozella","Pablo","Paige","Palma","Pamela","Pansy","Paolo","Paris","Parker","Pascale","Pasquale","Pat","Patience","Patricia","Patrick","Patsy","Pattie","Paul","Paula","Pauline","Paxton","Payton","Pearl","Pearlie","Pearline","Pedro","Peggie","Penelope","Percival","Percy","Perry","Pete","Peter","Petra","Peyton","Philip","Phoebe","Phyllis","Pierce","Pierre","Pietro","Pink","Pinkie","Piper","Polly","Porter","Precious","Presley","Preston","Price","Prince","Princess","Priscilla","Providenci","Prudence","Queen","Queenie","Quentin","Quincy","Quinn","Quinten","Quinton","Rachael","Rachel","Rachelle","Rae","Raegan","Rafael","Rafaela","Raheem","Rahsaan","Rahul","Raina","Raleigh","Ralph","Ramiro","Ramon","Ramona","Randal","Randall","Randi","Randy","Ransom","Raoul","Raphael","Raphaelle","Raquel","Rashad","Rashawn","Rasheed","Raul","Raven","Ray","Raymond","Raymundo","Reagan","Reanna","Reba","Rebeca","Rebecca","Rebeka","Rebekah","Reece","Reed","Reese","Regan","Reggie","Reginald","Reid","Reilly","Reina","Reinhold","Remington","Rene","Renee","Ressie","Reta","Retha","Retta","Reuben","Reva","Rex","Rey","Reyes","Reymundo","Reyna","Reynold","Rhea","Rhett","Rhianna","Rhiannon","Rhoda","Ricardo","Richard","Richie","Richmond","Rick","Rickey","Rickie","Ricky","Rico","Rigoberto","Riley","Rita","River","Robb","Robbie","Robert","Roberta","Roberto","Robin","Robyn","Rocio","Rocky","Rod","Roderick","Rodger","Rodolfo","Rodrick","Rodrigo","Roel","Rogelio","Roger","Rogers","Rolando","Rollin","Roma","Romaine","Roman","Ron","Ronaldo","Ronny","Roosevelt","Rory","Rosa","Rosalee","Rosalia","Rosalind","Rosalinda","Rosalyn","Rosamond","Rosanna","Rosario","Roscoe","Rose","Rosella","Roselyn","Rosemarie","Rosemary","Rosendo","Rosetta","Rosie","Rosina","Roslyn","Ross","Rossie","Rowan","Rowena","Rowland","Roxane","Roxanne","Roy","Royal","Royce","Rozella","Ruben","Rubie","Ruby","Rubye","Rudolph","Rudy","Rupert","Russ","Russel","Russell","Rusty","Ruth","Ruthe","Ruthie","Ryan","Ryann","Ryder","Rylan","Rylee","Ryleigh","Ryley","Sabina","Sabrina","Sabryna","Sadie","Sadye","Sage","Saige","Sallie","Sally","Salma","Salvador","Salvatore","Sam","Samanta","Samantha","Samara","Samir","Sammie","Sammy","Samson","Sandra","Sandrine","Sandy","Sanford","Santa","Santiago","Santina","Santino","Santos","Sarah","Sarai","Sarina","Sasha","Saul","Savanah","Savanna","Savannah","Savion","Scarlett","Schuyler","Scot","Scottie","Scotty","Seamus","Sean","Sebastian","Sedrick","Selena","Selina","Selmer","Serena","Serenity","Seth","Shad","Shaina","Shakira","Shana","Shane","Shanel","Shanelle","Shania","Shanie","Shaniya","Shanna","Shannon","Shanny","Shanon","Shany","Sharon","Shaun","Shawn","Shawna","Shaylee","Shayna","Shayne","Shea","Sheila","Sheldon","Shemar","Sheridan","Sherman","Sherwood","Shirley","Shyann","Shyanne","Sibyl","Sid","Sidney","Sienna","Sierra","Sigmund","Sigrid","Sigurd","Silas","Sim","Simeon","Simone","Sincere","Sister","Skye","Skyla","Skylar","Sofia","Soledad","Solon","Sonia","Sonny","Sonya","Sophia","Sophie","Spencer","Stacey","Stacy","Stan","Stanford","Stanley","Stanton","Stefan","Stefanie","Stella","Stephan","Stephania","Stephanie","Stephany","Stephen","Stephon","Sterling","Steve","Stevie","Stewart","Stone","Stuart","Summer","Sunny","Susan","Susana","Susanna","Susie","Suzanne","Sven","Syble","Sydnee","Sydney","Sydni","Sydnie","Sylvan","Sylvester","Sylvia","Tabitha","Tad","Talia","Talon","Tamara","Tamia","Tania","Tanner","Tanya","Tara","Taryn","Tate","Tatum","Tatyana","Taurean","Tavares","Taya","Taylor","Teagan","Ted","Telly","Terence","Teresa","Terrance","Terrell","Terrence","Terrill","Terry","Tess","Tessie","Tevin","Thad","Thaddeus","Thalia","Thea","Thelma","Theo","Theodora","Theodore","Theresa","Therese","Theresia","Theron","Thomas","Thora","Thurman","Tia","Tiana","Tianna","Tiara","Tierra","Tiffany","Tillman","Timmothy","Timmy","Timothy","Tina","Tito","Titus","Tobin","Toby","Tod","Tom","Tomas","Tomasa","Tommie","Toney","Toni","Tony","Torey","Torrance","Torrey","Toy","Trace","Tracey","Tracy","Travis","Travon","Tre","Tremaine","Tremayne","Trent","Trenton","Tressa","Tressie","Treva","Trever","Trevion","Trevor","Trey","Trinity","Trisha","Tristian","Tristin","Triston","Troy","Trudie","Trycia","Trystan","Turner","Twila","Tyler","Tyra","Tyree","Tyreek","Tyrel","Tyrell","Tyrese","Tyrique","Tyshawn","Tyson","Ubaldo","Ulices","Ulises","Una","Unique","Urban","Uriah","Uriel","Ursula","Vada","Valentin","Valentina","Valentine","Valerie","Vallie","Van","Vance","Vanessa","Vaughn","Veda","Velda","Vella","Velma","Velva","Vena","Verda","Verdie","Vergie","Verla","Verlie","Vern","Verna","Verner","Vernice","Vernie","Vernon","Verona","Veronica","Vesta","Vicenta","Vicente","Vickie","Vicky","Victor","Victoria","Vida","Vidal","Vilma","Vince","Vincent","Vincenza","Vincenzo","Vinnie","Viola","Violet","Violette","Virgie","Virgil","Virginia","Virginie","Vita","Vito","Viva","Vivian","Viviane","Vivianne","Vivien","Vivienne","Vladimir","Wade","Waino","Waldo","Walker","Wallace","Walter","Walton","Wanda","Ward","Warren","Watson","Wava","Waylon","Wayne","Webster","Weldon","Wellington","Wendell","Wendy","Werner","Westley","Weston","Whitney","Wilber","Wilbert","Wilburn","Wiley","Wilford","Wilfred","Wilfredo","Wilfrid","Wilhelm","Wilhelmine","Will","Willa","Willard","William","Willie","Willis","Willow","Willy","Wilma","Wilmer","Wilson","Wilton","Winfield","Winifred","Winnifred","Winona","Winston","Woodrow","Wyatt","Wyman","Xander","Xavier","Xzavier","Yadira","Yasmeen","Yasmin","Yasmine","Yazmin","Yesenia","Yessenia","Yolanda","Yoshiko","Yvette","Yvonne","Zachariah","Zachary","Zachery","Zack","Zackary","Zackery","Zakary","Zander","Zane","Zaria","Zechariah","Zelda","Zella","Zelma","Zena","Zetta","Zion","Zita","Zoe","Zoey","Zoie","Zoila","Zola","Zora","Zula"];e.exports={generateUsername:function(){return`${i.randomElement(r)}-${i.randomAlphanumStr(3)}`}}},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return E}));var i=n(5),r=n(2),s=n(8),o=n(0),a=n.n(o),c=n(6),d=n(12),u=n.n(d),l=n(38),h=n.n(l),p=n(39),m=n(57);const f=Object(i.getLogger)(e);function g(e,t){let n;try{n=JSON.parse(t.textContent)}catch(e){return void f.error("json-message XML contained invalid JSON, ignoring: "+t.textContent)}if(!n||!n.sources)return;const i=y(e,"video"),r=y(e,"audio");for(const e in n.sources)if(n.sources.hasOwnProperty(e)){const t=n.sources[e],s=t&&t.length>0&&t[0],o=t&&t.length>1&&t[1],a=t&&t.length>2&&t[2],c=t&&t.length>3&&t[3];if(s&&s.length>0)for(let t=0;t<s.length;t++)i.appendChild(_(e,s[t]));if(o&&o.length>0)for(let e=0;e<o.length;e++)i.appendChild(v(o[e]));if(a&&a.length>0)for(let t=0;t<a.length;t++)r.appendChild(_(e,a[t]));if(c&&c.length>0)for(let e=0;e<c.length;e++)r.appendChild(v(c[e]))}}function _(e,t){const n=$build("source",{xmlns:"urn:xmpp:jingle:apps:rtp:ssma:0",ssrc:t.s});return t.m&&n.c("parameter",{name:"msid",value:t.m}).up(),n.c("ssrc-info",{xmlns:"http://jitsi.org/jitmeet",owner:e}).up(),n.node}function v(e){const t=$build("ssrc-group",{xmlns:"urn:xmpp:jingle:apps:rtp:ssma:0",semantics:S(e[0])});for(let n=1;n<e.length;n++)t.c("source",{xmlns:"urn:xmpp:jingle:apps:rtp:ssma:0",ssrc:e[n]}).up();return t.node}function S(e){return"f"===e?"FID":"s"===e?"SIM":null}function y(e,t){const n=$(e).find("jingle")[0];let i,r=$(n).find(`content[name="${t}"]`);return r.length?r=r[0]:(r=$build("content",{name:t}).node,n.appendChild(r)),i=$(r).find("description"),i.length?i=i[0]:(i=$build("description",{xmlns:"urn:xmpp:jingle:apps:rtp:1",media:t}).node,r.appendChild(i)),i}class E extends p.b{constructor(e,t,n){super(),this.xmpp=e,this.eventEmitter=t,this.sessions={},this.jvbIceConfig=n.jvb,this.p2pIceConfig=n.p2p,this.mediaConstraints={offerToReceiveAudio:!0,offerToReceiveVideo:!0}}init(e){super.init(e),this.connection.addHandler(this.onJingle.bind(this),"urn:xmpp:jingle:1","iq","set",null,null)}onJingle(e){const t=$(e).find("jingle").attr("sid"),n=$(e).find("jingle").attr("action"),i=e.getAttribute("from"),o=Object(r.$iq)({type:"result",to:i,id:e.getAttribute("id")});f.debug(`on jingle ${n} from ${i}`,e);let d=this.sessions[t];if("session-initiate"!==n){if(!d)return o.attrs({type:"error"}),o.c("error",{type:"cancel"}).c("item-not-found",{xmlns:"urn:ietf:params:xml:ns:xmpp-stanzas"}).up().c("unknown-session",{xmlns:"urn:xmpp:jingle:errors:1"}),f.warn("invalid session id: "+t),f.debug(e),this.connection.send(o),!0;if(i!==d.remoteJid)return f.warn("jid mismatch for session id",t,d.remoteJid,e),o.attrs({type:"error"}),o.c("error",{type:"cancel"}).c("item-not-found",{xmlns:"urn:ietf:params:xml:ns:xmpp-stanzas"}).up().c("unknown-session",{xmlns:"urn:xmpp:jingle:errors:1"}),this.connection.send(o),!0}else if(void 0!==d)return o.attrs({type:"error"}),o.c("error",{type:"cancel"}).c("service-unavailable",{xmlns:"urn:ietf:params:xml:ns:xmpp-stanzas"}).up(),f.warn("duplicate session id",t,e),this.connection.send(o),!0;const l=window.performance.now(),h="focus"!==r.Strophe.getResourceFromJid(i),p=$(e).find("jingle>json-message");if(p&&p.length>0){f.info(`Found a JSON-encoded element in ${n}, translating to standard Jingle.`);for(let t=0;t<p.length;t++)g(e,p[t])}switch(n){case"session-initiate":{f.log("(TIME) received session-initiate:\t",l);const t=$(e).find("jingle>startmuted");if(t&&t.length>0){const e=t.attr("audio"),n=t.attr("video");this.eventEmitter.emit(a.a.START_MUTED_FROM_FOCUS,"true"===e,"true"===n)}f.info(`Marking session from ${i} as ${h?"":"*not*"} P2P`);const n=h?this.p2pIceConfig:this.jvbIceConfig;d=new m.a($(e).find("jingle").attr("sid"),$(e).attr("to"),i,this.connection,this.mediaConstraints,JSON.parse(JSON.stringify(n)),h,!1),this.sessions[d.sid]=d,this.eventEmitter.emit(a.a.CALL_INCOMING,d,$(e).find(">jingle"),l);break}case"session-accept":this.eventEmitter.emit(a.a.CALL_ACCEPTED,d,$(e).find(">jingle"));break;case"content-modify":d.modifyContents($(e).find(">jingle"));break;case"transport-info":this.eventEmitter.emit(a.a.TRANSPORT_INFO,d,$(e).find(">jingle"));break;case"session-terminate":{f.log("terminating...",d.sid);let t=null,n=null;$(e).find(">jingle>reason").length&&(t=$(e).find(">jingle>reason>:first")[0].tagName,n=$(e).find(">jingle>reason>text").text()),this.terminate(d.sid,t,n),this.eventEmitter.emit(a.a.CALL_ENDED,d,t,n);break}case"transport-replace":f.info("(TIME) Start transport replace:\t",l),c.a.sendAnalytics(Object(s.G)(s.f,{p2p:h,value:l})),d.replaceTransport($(e).find(">jingle"),()=>{const e=window.performance.now();f.info("(TIME) Transport replace success:\t",e),c.a.sendAnalytics(Object(s.G)(s.g,{p2p:h,value:e}))},e=>{u.a.callErrorHandler(e),f.error("Transport replace failed",e),d.sendTransportReject()});break;case"addsource":case"source-add":d.addRemoteStream($(e).find(">jingle>content"));break;case"removesource":case"source-remove":d.removeRemoteStream($(e).find(">jingle>content"));break;default:f.warn("jingle action not implemented",n),o.attrs({type:"error"}),o.c("error",{type:"cancel"}).c("bad-request",{xmlns:"urn:ietf:params:xml:ns:xmpp-stanzas"}).up()}return this.connection.send(o),!0}newP2PJingleSession(e,t){const n=new m.a(h.a.randomHexString(12),e,t,this.connection,this.mediaConstraints,this.p2pIceConfig,!0,!0);return this.sessions[n.sid]=n,n}terminate(e,t,n){this.sessions.hasOwnProperty(e)&&("ended"!==this.sessions[e].state&&this.sessions[e].onTerminated(t,n),delete this.sessions[e])}getStunAndTurnCredentials(){this.connection.sendIQ(Object(r.$iq)({type:"get",to:this.xmpp.options.hosts.domain}).c("services",{xmlns:"urn:xmpp:extdisco:2"}),e=>this.onReceiveStunAndTurnCredentials(e),e=>{f.warn("getting turn credentials with extdisco:2 failed, trying extdisco:1",e),this.connection.sendIQ(Object(r.$iq)({type:"get",to:this.xmpp.options.hosts.domain}).c("services",{xmlns:"urn:xmpp:extdisco:1"}),e=>this.onReceiveStunAndTurnCredentials(e),e=>{f.warn("getting turn credentials failed",e),f.warn("is mod_turncredentials or similar installed and configured?")})})}onReceiveStunAndTurnCredentials(e){const t=[];$(e).find(">services>service").each((e,n)=>{const i={},r=(n=$(n)).attr("type");switch(r){case"stun":i.urls="stun:"+n.attr("host"),n.attr("port")&&(i.urls+=":"+n.attr("port")),t.push(i);break;case"turn":case"turns":{i.urls=r+":",i.username=n.attr("username"),i.urls+=n.attr("host");n.attr("port")&&(i.urls+=":"+n.attr("port"));const e=n.attr("transport");e&&"udp"!==e&&(i.urls+="?transport="+e),i.credential=n.attr("password")||i.credential,t.push(i);break}}});const n=this.xmpp.options;for(let e=t.length-1;e>0;e--){const n=Math.floor(Math.random()*(e+1)),i=t[e];t[e]=t[n],t[n]=i}let i;return i=n.useTurnUdp?e=>e.urls.startsWith("turn"):e=>e.urls.startsWith("turn")&&e.urls.indexOf("transport=tcp")>=0,this.jvbIceConfig.iceServers=t.filter(i),this.p2pIceConfig.iceServers=t,t.length>0}getLog(){const e={};return Object.keys(this.sessions).forEach(t=>{const n=this.sessions[t].peerconnection;n&&n.updateLog&&(e["jingle_"+t]={updateLog:n.updateLog,stats:n.stats,url:window.location.href})}),e}}}).call(this,"modules/xmpp/strophe.jingle.js")},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return a}));var i=n(111),r=n.n(i),s=n(5);const o=Object(s.getLogger)(e);class a{constructor(){this._queue=r.a.queue(this._processQueueTasks.bind(this),1),this._stopped=!1}clear(){this._queue.kill()}_processQueueTasks(e,t){try{e(t)}catch(e){o.error("Task failed: "+(null==e?void 0:e.stack)),t(e)}}push(e,t){this._stopped?t&&t(new Error("The queue has been stopped")):this._queue.push(e,t)}shutdown(){this._stopped=!0}}}).call(this,"modules/util/AsyncQueue.js")},function(e,t,n){(function(n,i){var r;
/*!
* async
* https://github.com/caolan/async
*
* Copyright 2010-2014 Caolan McMahon
* Released under the MIT license
*/!function(){var s,o,a={};function c(e){var t=!1;return function(){if(t)throw new Error("Callback was already called.");t=!0,e.apply(s,arguments)}}null!=(s=this)&&(o=s.async),a.noConflict=function(){return s.async=o,a};var d=Object.prototype.toString,u=Array.isArray||function(e){return"[object Array]"===d.call(e)},l=function(e,t){if(e.forEach)return e.forEach(t);for(var n=0;n<e.length;n+=1)t(e[n],n,e)},h=function(e,t){if(e.map)return e.map(t);var n=[];return l(e,(function(e,i,r){n.push(t(e,i,r))})),n},p=function(e){if(Object.keys)return Object.keys(e);var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t};void 0!==n&&n.nextTick?(a.nextTick=n.nextTick,a.setImmediate=void 0!==i?function(e){i(e)}:a.nextTick):"function"==typeof i?(a.nextTick=function(e){i(e)},a.setImmediate=a.nextTick):(a.nextTick=function(e){setTimeout(e,0)},a.setImmediate=a.nextTick),a.each=function(e,t,n){if(n=n||function(){},!e.length)return n();var i=0;function r(t){t?(n(t),n=function(){}):(i+=1)>=e.length&&n()}l(e,(function(e){t(e,c(r))}))},a.forEach=a.each,a.eachSeries=function(e,t,n){if(n=n||function(){},!e.length)return n();var i=0,r=function(){t(e[i],(function(t){t?(n(t),n=function(){}):(i+=1)>=e.length?n():r()}))};r()},a.forEachSeries=a.eachSeries,a.eachLimit=function(e,t,n,i){m(t).apply(null,[e,n,i])},a.forEachLimit=a.eachLimit;var m=function(e){return function(t,n,i){if(i=i||function(){},!t.length||e<=0)return i();var r=0,s=0,o=0;!function a(){if(r>=t.length)return i();for(;o<e&&s<t.length;)o+=1,n(t[(s+=1)-1],(function(e){e?(i(e),i=function(){}):(o-=1,(r+=1)>=t.length?i():a())}))}()}},f=function(e){return function(){var t=Array.prototype.slice.call(arguments);return e.apply(null,[a.each].concat(t))}},g=function(e){return function(){var t=Array.prototype.slice.call(arguments);return e.apply(null,[a.eachSeries].concat(t))}},_=function(e,t,n,i){if(t=h(t,(function(e,t){return{index:t,value:e}})),i){var r=[];e(t,(function(e,t){n(e.value,(function(n,i){r[e.index]=i,t(n)}))}),(function(e){i(e,r)}))}else e(t,(function(e,t){n(e.value,(function(e){t(e)}))}))};a.map=f(_),a.mapSeries=g(_),a.mapLimit=function(e,t,n,i){return v(t)(e,n,i)};var v=function(e){return function(e,t){return function(){var n=Array.prototype.slice.call(arguments);return t.apply(null,[m(e)].concat(n))}}(e,_)};a.reduce=function(e,t,n,i){a.eachSeries(e,(function(e,i){n(t,e,(function(e,n){t=n,i(e)}))}),(function(e){i(e,t)}))},a.inject=a.reduce,a.foldl=a.reduce,a.reduceRight=function(e,t,n,i){var r=h(e,(function(e){return e})).reverse();a.reduce(r,t,n,i)},a.foldr=a.reduceRight;var S=function(e,t,n,i){var r=[];e(t=h(t,(function(e,t){return{index:t,value:e}})),(function(e,t){n(e.value,(function(n){n&&r.push(e),t()}))}),(function(e){i(h(r.sort((function(e,t){return e.index-t.index})),(function(e){return e.value})))}))};a.filter=f(S),a.filterSeries=g(S),a.select=a.filter,a.selectSeries=a.filterSeries;var y=function(e,t,n,i){var r=[];e(t=h(t,(function(e,t){return{index:t,value:e}})),(function(e,t){n(e.value,(function(n){n||r.push(e),t()}))}),(function(e){i(h(r.sort((function(e,t){return e.index-t.index})),(function(e){return e.value})))}))};a.reject=f(y),a.rejectSeries=g(y);var E=function(e,t,n,i){e(t,(function(e,t){n(e,(function(n){n?(i(e),i=function(){}):t()}))}),(function(e){i()}))};a.detect=f(E),a.detectSeries=g(E),a.some=function(e,t,n){a.each(e,(function(e,i){t(e,(function(e){e&&(n(!0),n=function(){}),i()}))}),(function(e){n(!1)}))},a.any=a.some,a.every=function(e,t,n){a.each(e,(function(e,i){t(e,(function(e){e||(n(!1),n=function(){}),i()}))}),(function(e){n(!0)}))},a.all=a.every,a.sortBy=function(e,t,n){a.map(e,(function(e,n){t(e,(function(t,i){t?n(t):n(null,{value:e,criteria:i})}))}),(function(e,t){if(e)return n(e);n(null,h(t.sort((function(e,t){var n=e.criteria,i=t.criteria;return n<i?-1:n>i?1:0})),(function(e){return e.value})))}))},a.auto=function(e,t){t=t||function(){};var n=p(e),i=n.length;if(!i)return t();var r={},s=[],o=function(e){s.unshift(e)},c=function(){i--,l(s.slice(0),(function(e){e()}))};o((function(){if(!i){var e=t;t=function(){},e(null,r)}})),l(n,(function(n){var i=u(e[n])?e[n]:[e[n]],d=function(e){var i=Array.prototype.slice.call(arguments,1);if(i.length<=1&&(i=i[0]),e){var s={};l(p(r),(function(e){s[e]=r[e]})),s[n]=i,t(e,s),t=function(){}}else r[n]=i,a.setImmediate(c)},h=i.slice(0,Math.abs(i.length-1))||[],m=function(){return t=function(e,t){return e&&r.hasOwnProperty(t)},i=!0,((e=h).reduce?e.reduce(t,i):(l(e,(function(e,n,r){i=t(i,e,n,r)})),i))&&!r.hasOwnProperty(n);var e,t,i};if(m())i[i.length-1](d,r);else{var f=function(){m()&&(!function(e){for(var t=0;t<s.length;t+=1)if(s[t]===e)return void s.splice(t,1)}(f),i[i.length-1](d,r))};o(f)}}))},a.retry=function(e,t,n){var i=[];"function"==typeof e&&(n=t,t=e,e=5),e=parseInt(e,10)||5;var r=function(r,s){for(var o=function(e,t){return function(n){e((function(e,i){n(!e||t,{err:e,result:i})}),s)}};e;)i.push(o(t,!(e-=1)));a.series(i,(function(e,t){t=t[t.length-1],(r||n)(t.err,t.result)}))};return n?r():r},a.waterfall=function(e,t){if(t=t||function(){},!u(e)){var n=new Error("First argument to waterfall must be an array of functions");return t(n)}if(!e.length)return t();var i=function(e){return function(n){if(n)t.apply(null,arguments),t=function(){};else{var r=Array.prototype.slice.call(arguments,1),s=e.next();s?r.push(i(s)):r.push(t),a.setImmediate((function(){e.apply(null,r)}))}}};i(a.iterator(e))()};var b=function(e,t,n){if(n=n||function(){},u(t))e.map(t,(function(e,t){e&&e((function(e){var n=Array.prototype.slice.call(arguments,1);n.length<=1&&(n=n[0]),t.call(null,e,n)}))}),n);else{var i={};e.each(p(t),(function(e,n){t[e]((function(t){var r=Array.prototype.slice.call(arguments,1);r.length<=1&&(r=r[0]),i[e]=r,n(t)}))}),(function(e){n(e,i)}))}};a.parallel=function(e,t){b({map:a.map,each:a.each},e,t)},a.parallelLimit=function(e,t,n){b({map:v(t),each:m(t)},e,n)},a.series=function(e,t){if(t=t||function(){},u(e))a.mapSeries(e,(function(e,t){e&&e((function(e){var n=Array.prototype.slice.call(arguments,1);n.length<=1&&(n=n[0]),t.call(null,e,n)}))}),t);else{var n={};a.eachSeries(p(e),(function(t,i){e[t]((function(e){var r=Array.prototype.slice.call(arguments,1);r.length<=1&&(r=r[0]),n[t]=r,i(e)}))}),(function(e){t(e,n)}))}},a.iterator=function(e){var t=function(n){var i=function(){return e.length&&e[n].apply(null,arguments),i.next()};return i.next=function(){return n<e.length-1?t(n+1):null},i};return t(0)},a.apply=function(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t.concat(Array.prototype.slice.call(arguments)))}};var C=function(e,t,n,i){var r=[];e(t,(function(e,t){n(e,(function(e,n){r=r.concat(n||[]),t(e)}))}),(function(e){i(e,r)}))};a.concat=f(C),a.concatSeries=g(C),a.whilst=function(e,t,n){e()?t((function(i){if(i)return n(i);a.whilst(e,t,n)})):n()},a.doWhilst=function(e,t,n){e((function(i){if(i)return n(i);var r=Array.prototype.slice.call(arguments,1);t.apply(null,r)?a.doWhilst(e,t,n):n()}))},a.until=function(e,t,n){e()?n():t((function(i){if(i)return n(i);a.until(e,t,n)}))},a.doUntil=function(e,t,n){e((function(i){if(i)return n(i);var r=Array.prototype.slice.call(arguments,1);t.apply(null,r)?n():a.doUntil(e,t,n)}))},a.queue=function(e,t){function n(e,t,n,i){if(e.started||(e.started=!0),u(t)||(t=[t]),0==t.length)return a.setImmediate((function(){e.drain&&e.drain()}));l(t,(function(t){var r={data:t,callback:"function"==typeof i?i:null};n?e.tasks.unshift(r):e.tasks.push(r),e.saturated&&e.tasks.length===e.concurrency&&e.saturated(),a.setImmediate(e.process)}))}void 0===t&&(t=1);var i=0,r={tasks:[],concurrency:t,saturated:null,empty:null,drain:null,started:!1,paused:!1,push:function(e,t){n(r,e,!1,t)},kill:function(){r.drain=null,r.tasks=[]},unshift:function(e,t){n(r,e,!0,t)},process:function(){if(!r.paused&&i<r.concurrency&&r.tasks.length){var t=r.tasks.shift();r.empty&&0===r.tasks.length&&r.empty(),i+=1;var n=c((function(){i-=1,t.callback&&t.callback.apply(t,arguments),r.drain&&r.tasks.length+i===0&&r.drain(),r.process()}));e(t.data,n)}},length:function(){return r.tasks.length},running:function(){return i},idle:function(){return r.tasks.length+i===0},pause:function(){!0!==r.paused&&(r.paused=!0,r.process())},resume:function(){!1!==r.paused&&(r.paused=!1,r.process())}};return r},a.priorityQueue=function(e,t){function n(e,t){return e.priority-t.priority}var i=a.queue(e,t);return i.push=function(e,t,r){!function(e,t,i,r){if(e.started||(e.started=!0),u(t)||(t=[t]),0==t.length)return a.setImmediate((function(){e.drain&&e.drain()}));l(t,(function(t){var s={data:t,priority:i,callback:"function"==typeof r?r:null};e.tasks.splice(function(e,t,n){for(var i=-1,r=e.length-1;i<r;){var s=i+(r-i+1>>>1);n(t,e[s])>=0?i=s:r=s-1}return i}(e.tasks,s,n)+1,0,s),e.saturated&&e.tasks.length===e.concurrency&&e.saturated(),a.setImmediate(e.process)}))}(i,e,t,r)},delete i.unshift,i},a.cargo=function(e,t){var n=!1,i=[],r={tasks:i,payload:t,saturated:null,empty:null,drain:null,drained:!0,push:function(e,n){u(e)||(e=[e]),l(e,(function(e){i.push({data:e,callback:"function"==typeof n?n:null}),r.drained=!1,r.saturated&&i.length===t&&r.saturated()})),a.setImmediate(r.process)},process:function s(){if(!n){if(0===i.length)return r.drain&&!r.drained&&r.drain(),void(r.drained=!0);var o="number"==typeof t?i.splice(0,t):i.splice(0,i.length),a=h(o,(function(e){return e.data}));r.empty&&r.empty(),n=!0,e(a,(function(){n=!1;var e=arguments;l(o,(function(t){t.callback&&t.callback.apply(null,e)})),s()}))}},length:function(){return i.length},running:function(){return n}};return r};var T=function(e){return function(t){var n=Array.prototype.slice.call(arguments,1);t.apply(null,n.concat([function(t){var n=Array.prototype.slice.call(arguments,1);"undefined"!=typeof console&&(t?console.error&&console.error(t):console[e]&&l(n,(function(t){console[e](t)})))}]))}};a.log=T("log"),a.dir=T("dir"),a.memoize=function(e,t){var n={},i={};t=t||function(e){return e};var r=function(){var r=Array.prototype.slice.call(arguments),s=r.pop(),o=t.apply(null,r);o in n?a.nextTick((function(){s.apply(null,n[o])})):o in i?i[o].push(s):(i[o]=[s],e.apply(null,r.concat([function(){n[o]=arguments;var e=i[o];delete i[o];for(var t=0,r=e.length;t<r;t++)e[t].apply(null,arguments)}])))};return r.memo=n,r.unmemoized=e,r},a.unmemoize=function(e){return function(){return(e.unmemoized||e).apply(null,arguments)}},a.times=function(e,t,n){for(var i=[],r=0;r<e;r++)i.push(r);return a.map(i,t,n)},a.timesSeries=function(e,t,n){for(var i=[],r=0;r<e;r++)i.push(r);return a.mapSeries(i,t,n)},a.seq=function(){var e=arguments;return function(){var t=this,n=Array.prototype.slice.call(arguments),i=n.pop();a.reduce(e,n,(function(e,n,i){n.apply(t,e.concat([function(){var e=arguments[0],t=Array.prototype.slice.call(arguments,1);i(e,t)}]))}),(function(e,n){i.apply(t,[e].concat(n))}))}},a.compose=function(){return a.seq.apply(null,Array.prototype.reverse.call(arguments))};var R=function(e,t){var n=function(){var n=this,i=Array.prototype.slice.call(arguments),r=i.pop();return e(t,(function(e,t){e.apply(n,i.concat([t]))}),r)};if(arguments.length>2){var i=Array.prototype.slice.call(arguments,2);return n.apply(this,i)}return n};a.applyEach=f(R),a.applyEachSeries=g(R),a.forever=function(e,t){!function n(i){if(i){if(t)return t(i);throw i}e(n)}()},e.exports?e.exports=a:void 0===(r=function(){return a}.apply(t,[]))||(e.exports=r)}()}).call(this,n(62),n(161).setImmediate)},function(e,t){e.exports={integerHash:function(e){if(!e)return 0;let t,n,i=0;for(n=0;n<e.length;n++)t=e.charCodeAt(n),i+=t*Math.pow(31,e.length-1-n),i=Math.abs(0|i);return i}}},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return a}));var i=n(5),r=n(22),s=n(34);const o=Object(i.getLogger)(e);class a extends r.a{constructor(e,t,n,i,r,s,o){super(),this.sid=e,this.localJid=t,this.remoteJid=n,this.connection=i,this.mediaConstraints=r,this.iceConfig=s,this.isInitiator=o,this.usedrip=!0,this.dripContainer=[],this.room=null,this.state=null,this.rtc=null}get initiatorJid(){return this.isInitiator?this.localJid:this.remoteJid}get responderJid(){return this.isInitiator?this.remoteJid:this.localJid}initialize(e,t,n){if(null!==this.state){const e=`attempt to initiate on session ${this.sid}\n in state ${this.state}`;throw o.error(e),new Error(e)}this.room=e,this.rtc=t,this.state=s.c,this.doInitialize(n)}doInitialize(e){}addIceCandidates(e){}getState(){return this.state}addSources(e){}removeSources(e){}terminate(e,t,n){}acceptOffer(e,t,n){}_getInitiatorJid(){return this.isInitiator?this.localJid:this.remoteJid}}}).call(this,"modules/xmpp/JingleSession.js")},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return c}));var i=n(5),r=n(4),s=n(42),o=n(115);const a=Object(i.getLogger)(e);class c extends o.a{constructor(){super(),this.ssrcOwners=new Map,this.chatRoom=null}setChatRoom(e){const t=this.chatRoom;this.chatRoom=e,t&&(t.removePresenceListener("audiomuted",this._audioMuteHandler),t.removePresenceListener("videomuted",this._videoMuteHandler),t.removePresenceListener("videoType",this._videoTypeHandler)),e&&(this._audioMuteHandler=(e,t)=>{this.eventEmitter.emit(s.a,t,r.a,"true"===e.value)},e.addPresenceListener("audiomuted",this._audioMuteHandler),this._videoMuteHandler=(e,t)=>{this.eventEmitter.emit(s.a,t,r.c,"true"===e.value)},e.addPresenceListener("videomuted",this._videoMuteHandler),this._videoTypeHandler=(e,t)=>{this.eventEmitter.emit(s.b,t,e.value)},e.addPresenceListener("videoType",this._videoTypeHandler))}getPeerMediaInfo(e,t){if(this.chatRoom)return this.chatRoom.getMediaPresenceInfo(e,t);a.error("Requested peer media info, before room was set")}getSSRCOwner(e){return this.ssrcOwners.get(e)}setSSRCOwner(e,t){if("number"!=typeof e)throw new TypeError(`SSRC(${e}) must be a number`);this.ssrcOwners.set(e,t)}}}).call(this,"modules/xmpp/SignalingLayerImpl.js")},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n(22);class r extends i.a{getSSRCOwner(e){throw new Error("not implemented")}getPeerMediaInfo(e,t){throw new Error("not implemented")}}},function(e,t,n){"use strict";var i=n(2),r=n(39);class s extends r.b{constructor(){super(),this.log=[]}init(e){super.init(e),this.connection.rawInput=this.logIncoming.bind(this),this.connection.rawOutput=this.logOutgoing.bind(this)}logIncoming(e){this.log.push([(new Date).getTime(),"incoming",e])}logOutgoing(e){this.log.push([(new Date).getTime(),"outgoing",e])}}t.a=function(){i.Strophe.addConnectionPlugin("logger",new s)}},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return a}));var i=n(5),r=n(2),s=n(39);const o=Object(i.getLogger)(e);class a extends s.b{init(e){super.init(e),this.connection.addHandler(this.onRayo.bind(this),"urn:xmpp:rayo:1","iq","set",null,null)}onRayo(e){o.info("Rayo IQ",e)}dial(e,t,n,i,s){return new Promise((a,c)=>{if(!s)return void c(new Error("Internal error!"));const d=Object(r.$iq)({type:"set",to:s});d.c("dial",{xmlns:"urn:xmpp:rayo:1",to:e,from:t}),d.c("header",{name:"JvbRoomName",value:n}).up(),i&&i.length&&d.c("header",{name:"JvbRoomPassword",value:i}).up(),this.connection.sendIQ(d,e=>{o.info("Dial result ",e);const t=$(e).find("ref").attr("uri");this.callResource=t.substr("xmpp:".length),o.info("Received call resource: "+this.callResource),a()},e=>{o.info("Dial error ",e),c(e)})})}hangup(){return new Promise((e,t)=>{if(!this.callResource)return t(new Error("No call in progress")),void o.warn("No call in progress");const n=Object(r.$iq)({type:"set",to:this.callResource});n.c("hangup",{xmlns:"urn:xmpp:rayo:1"}),this.connection.sendIQ(n,t=>{o.info("Hangup result ",t),this.callResource=null,e()},e=>{o.info("Hangup error ",e),this.callResource=null,t(new Error("Hangup error "))})})}}}).call(this,"modules/xmpp/strophe.rayo.js")},function(e,t,n){"use strict";(function(e){var i=n(5),r=n(2),s=n(12),o=n.n(s);const a=Object(i.getLogger)(e);let c=-1;const d=/request id \d+.\d+ got 200/,u=/request errored, status: (\d+), number of errors: \d+/;t.a=function(){r.Strophe.log=function(e,t){switch(a.trace("Strophe",e,t),"string"==typeof t&&-1!==t.indexOf("Request ")&&-1!==t.indexOf("timed out (secondary), restarting")&&(e=r.Strophe.LogLevel.WARN),e){case r.Strophe.LogLevel.DEBUG:-1!==c&&d.test(t)&&(a.debug("Reset lastErrorStatus"),c=-1);break;case r.Strophe.LogLevel.WARN:a.warn("Strophe: "+t);const e=u.exec(t);e&&2===e.length&&(c=parseInt(e[1],10),a.debug("lastErrorStatus set to: "+c));break;case r.Strophe.LogLevel.ERROR:case r.Strophe.LogLevel.FATAL:t="Strophe: "+t,o.a.callErrorHandler(new Error(t)),a.error(t)}},r.Strophe.getLastErrorStatus=function(){return c},r.Strophe.getStatusString=function(e){switch(e){case r.Strophe.Status.BINDREQUIRED:return"BINDREQUIRED";case r.Strophe.Status.ERROR:return"ERROR";case r.Strophe.Status.CONNECTING:return"CONNECTING";case r.Strophe.Status.CONNFAIL:return"CONNFAIL";case r.Strophe.Status.AUTHENTICATING:return"AUTHENTICATING";case r.Strophe.Status.AUTHFAIL:return"AUTHFAIL";case r.Strophe.Status.CONNECTED:return"CONNECTED";case r.Strophe.Status.DISCONNECTED:return"DISCONNECTED";case r.Strophe.Status.DISCONNECTING:return"DISCONNECTING";case r.Strophe.Status.ATTACHED:return"ATTACHED";default:return"unknown"}}}}).call(this,"modules/xmpp/strophe.util.js")},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return u}));var i=n(5),r=n(1),s=n(20),o=n.n(s),a=n(4),c=n(3);const d=Object(i.getLogger)(e);class u{constructor(e,t){this.conference=e,this.options=t,this.disabledCodec=t.disabledCodec===o.a.VP8?void 0:this._getCodecMimeType(t.disabledCodec);const n=this._getCodecMimeType(t.jvbCodec),i=this._getCodecMimeType(t.p2pCodec);this.jvbPreferredCodec=n&&this._isCodecSupported(n)?n:o.a.VP8,this.p2pPreferredCodec=i&&this._isCodecSupported(i)?i:o.a.VP8,d.debug(`Codec preferences for the conference are JVB: ${this.jvbPreferredCodec},\n P2P: ${this.p2pPreferredCodec}`),c.a.isFirefox()&&this.jvbPreferredCodec===o.a.VP9&&(this.jvbPreferredCodec=o.a.VP8),this.conference.on(r.USER_JOINED,()=>this._selectPreferredCodec()),this.conference.on(r.USER_LEFT,()=>this._selectPreferredCodec()),this.conference.on(r._MEDIA_SESSION_STARTED,e=>this._onMediaSessionStared(e))}_getCodecMimeType(e){return"string"==typeof e?Object.values(o.a).find(t=>t===e.toLowerCase()):null}_isCodecSupported(e){return!(!c.a.isFirefox()&&!c.a.isReactNative())||window.RTCRtpReceiver&&window.RTCRtpReceiver.getCapabilities&&window.RTCRtpReceiver.getCapabilities("video").codecs.some(t=>t.mimeType.toLowerCase()==="video/"+e)}_onMediaSessionStared(e){const t=e.isP2P?this.p2pPreferredCodec:this.jvbPreferredCodec,n=this.disabledCodec&&this._isCodecSupported(this.disabledCodec)?this.disabledCodec:null;this._selectPreferredCodec(e,t,n)}_selectPreferredCodec(e=null,t=null,n=null){const i=e||this.conference.jvbJingleSession,r=t||this.jvbPreferredCodec;let s=r;if(i&&!i.isP2P&&!this.options.enforcePreferredCodec){const e=this.conference.getParticipants().map(e=>e.getId());for(const t of e){const e=i.signalingLayer.getPeerMediaInfo(t,a.c),n=null==e?void 0:e.codecType;!n||n===r||c.a.isFirefox()&&n===o.a.VP9||(s=n)}}i&&i.setVideoCodecs(s,n)}getPreferredCodec(){return this.jvbPreferredCodec}}}).call(this,"modules/RTC/CodecSelection.js")},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return p}));var i=n(5),r=n(7),s=n.n(r),o=n(8),a=n(6),c=n(12),d=n.n(c);function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){l(e,t,n[t])}))}return e}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const h=Object(i.getLogger)(e);class p{constructor(e,t,n){if(!e&&!t)throw new TypeError("At least peerconnection or wsUrl must be given");if(e&&t)throw new TypeError("Just one of peerconnection or wsUrl must be given");if(e?h.debug("constructor() with peerconnection"):h.debug(`constructor() with wsUrl:"${t}"`),this._channel=null,this._eventEmitter=n,this._mode=null,this._areRetriesEnabled=!1,this._closedFromClient=!1,e){const t=e.createDataChannel("JVB data channel",{protocol:"http://jitsi.org/protocols/colibri"});this._handleChannel(t),this._mode="datachannel"}else t&&(this._areRetriesEnabled=!0,this._wsUrl=t,this._initWebSocket())}_initWebSocket(){const e=new WebSocket(this._wsUrl);this._handleChannel(e),this._mode="websocket"}_startConnectionRetries(){let e=1;const t=()=>{this.isOpen()||(this._initWebSocket(this._wsUrl),e=Math.min(2*e,60),this._retryTimeout=setTimeout(t,1e3*e))};this._retryTimeout=setTimeout(t,1e3*e)}_stopConnectionRetries(){this._retryTimeout&&(clearTimeout(this._retryTimeout),this._retryTimeout=void 0)}_retryWebSocketConnection(e){if(!this._areRetriesEnabled)return;const{code:t,reason:n}=e;a.a.sendAnalytics(Object(o.y)(t,n)),this._areRetriesEnabled=!1,this._eventEmitter.once(s.a.DATA_CHANNEL_OPEN,()=>{this._stopConnectionRetries(),this._areRetriesEnabled=!0}),this._startConnectionRetries()}get mode(){return this._mode}close(){if(this._closedFromClient=!0,this._stopConnectionRetries(),this._areRetriesEnabled=!1,this._channel){try{this._channel.close()}catch(e){}this._channel=null}}isOpen(){return this._channel&&("open"===this._channel.readyState||this._channel.readyState===WebSocket.OPEN)}sendEndpointStatsMessage(e){this._send(u({colibriClass:"EndpointStats"},e))}sendMessage(e,t){this._send({colibriClass:"EndpointMessage",msgPayload:t,to:e})}sendSetLastNMessage(e){h.log(`Sending lastN=${e}.`),this._send({colibriClass:"LastNChangedEvent",lastN:e})}sendSelectedEndpointsMessage(e){h.log(`Sending selected endpoints: ${e}.`),this._send({colibriClass:"SelectedEndpointsChangedEvent",selectedEndpoints:e})}sendReceiverVideoConstraintMessage(e){h.log(`Sending ReceiverVideoConstraint with maxFrameHeight=${e}px`),this._send({colibriClass:"ReceiverVideoConstraint",maxFrameHeight:e})}sendNewReceiverVideoConstraintsMessage(e){h.log("Sending ReceiverVideoConstraints with "+JSON.stringify(e)),this._send(u({colibriClass:"ReceiverVideoConstraints"},e))}sendVideoTypeMessage(e){h.debug("Sending VideoTypeMessage with video type as "+e),this._send({colibriClass:"VideoTypeMessage",videoType:e})}_handleChannel(e){const t=this._eventEmitter;e.onopen=()=>{h.info(this._mode+" channel opened"),t.emit(s.a.DATA_CHANNEL_OPEN)},e.onerror=e=>{"websocket"!==this._mode&&h.error("Channel error: "+e.message)},e.onmessage=({data:e})=>{let n;try{n=JSON.parse(e)}catch(t){return d.a.callErrorHandler(t),void h.error("Failed to parse channel message as JSON: ",e,t)}const i=n.colibriClass;switch(i){case"DominantSpeakerEndpointChangeEvent":{const{dominantSpeakerEndpoint:e,previousSpeakers:i=[]}=n;h.debug(`Dominant speaker: ${e}, previous speakers: ${i}`),t.emit(s.a.DOMINANT_SPEAKER_CHANGED,e,i);break}case"EndpointConnectivityStatusChangeEvent":{const e=n.endpoint,i="true"===n.active;h.info(`Endpoint connection status changed: ${e} active=${i}`),t.emit(s.a.ENDPOINT_CONN_STATUS_CHANGED,e,i);break}case"EndpointMessage":t.emit(s.a.ENDPOINT_MESSAGE_RECEIVED,n.from,n.msgPayload);break;case"EndpointStats":t.emit(s.a.ENDPOINT_STATS_RECEIVED,n.from,n);break;case"LastNEndpointsChangeEvent":{const e=n.lastNEndpoints;h.info("New forwarded endpoints: "+e),t.emit(s.a.LASTN_ENDPOINT_CHANGED,e);break}case"SenderVideoConstraints":{const e=n.videoConstraints;e&&(h.info("SenderVideoConstraints: "+JSON.stringify(e)),t.emit(s.a.SENDER_VIDEO_CONSTRAINTS_CHANGED,e));break}case"ServerHello":h.info(`Received ServerHello, version=${n.version}.`);break;default:h.debug("Channel JSON-formatted message: ",n),t.emit("rtc.datachannel."+i,n)}},e.onclose=e=>{h.info("Channel closed by "+(this._closedFromClient?"client":"server")),"websocket"===this._mode&&(this._closedFromClient||(h.error(`Channel closed: ${e.code} ${e.reason}`),this._retryWebSocketConnection(e))),this._channel=null},this._channel=e}_send(e){const t=this._channel;if(!this.isOpen())throw h.error("Bridge Channel send: no opened channel."),new Error("No opened channel");t.send(JSON.stringify(e))}}}).call(this,"modules/RTC/BridgeChannel.js")},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return y}));var i=n(5),r=n(21),s=n(14),o=n(16),a=n(47),c=n.n(a),d=n(4),u=n(7),l=n.n(u),h=n(15),p=n.n(h),m=n(8),f=n(3),g=n(6),_=n(66),v=n(11);const S=Object(i.getLogger)(e);class y extends _.a{constructor({deviceId:e,facingMode:t,mediaType:n,resolution:i,rtcId:r,sourceId:s,sourceType:a,stream:c,track:d,videoType:u,effects:h=[]}){super(null,c,d,()=>this.emit(o.LOCAL_TRACK_STOPPED),n,u),this._setEffectInProgress=!1;const m=h.find(e=>e.isEnabled(this));m&&this._startStreamEffect(m),this.rtcId=r,this.sourceId=s,this.sourceType=a,this.resolution=d.getSettings().height,this.maxEnabledResolution=i,this._constraints=d.getConstraints(),Object.keys(this._constraints).length||u!==p.a.CAMERA||(this._constraints={height:d.getSettings().height,width:d.getSettings().width}),this.deviceId=e,this._prevSetMuted=Promise.resolve(),this._facingMode=t,this._trackEnded=!1,this._hasSentData=!1,this._testDataSent=!0,this._realDeviceId=""===this.deviceId?void 0:this.deviceId,this._trackMutedTS=0,this._onDeviceListWillChange=e=>{const t=this._realDeviceId;this._setRealDeviceIdFromDeviceList(e),(void 0===this.getTrack().readyState&&void 0!==this._realDeviceId&&!e.find(e=>e.deviceId===this._realDeviceId)||void 0!==t&&void 0===this._realDeviceId)&&(this._trackEnded=!0)},this.isAudioTrack()&&v.a.isDeviceChangeAvailable("output")&&(this._onAudioOutputDeviceChanged=this.setAudioOutput.bind(this),v.a.addListener(l.a.AUDIO_OUTPUT_DEVICE_CHANGED,this._onAudioOutputDeviceChanged)),v.a.addListener(l.a.DEVICE_LIST_WILL_CHANGE,this._onDeviceListWillChange),this._initNoDataFromSourceHandlers()}isEnded(){return this.isVideoTrack()&&this.isMuted()?this._trackEnded:"ended"===this.getTrack().readyState||this._trackEnded}_initNoDataFromSourceHandlers(){this._isNoDataFromSourceEventsEnabled()&&(this._setHandler("track_mute",()=>{this._trackMutedTS=window.performance.now(),this._fireNoDataFromSourceEvent()}),this._setHandler("track_unmute",()=>{this._fireNoDataFromSourceEvent(),g.a.sendAnalyticsAndLog(m.s,{media_type:this.getType(),track_type:"local",value:window.performance.now()-this._trackMutedTS})}),this.isVideoTrack()&&this.videoType===p.a.CAMERA&&this._setHandler("track_ended",()=>{this.isReceivingData()||this._fireNoDataFromSourceEvent()}))}_isNoDataFromSourceEventsEnabled(){return!this.isVideoTrack()||this.videoType!==p.a.DESKTOP}_fireNoDataFromSourceEvent(){const e=!this.isReceivingData();this.emit(o.NO_DATA_FROM_SOURCE,e),g.a.sendAnalytics(Object(m.H)(this.getType(),e)),g.a.sendLog(JSON.stringify({name:o.NO_DATA_FROM_SOURCE,log:e}))}_setRealDeviceIdFromDeviceList(e){const t=this.getTrack(),n=t.kind+"input";let i=e.find(e=>e.kind===n&&e.label===t.label);if(!i&&"default"===this._realDeviceId){const r=(t.label||"").replace("Default - ","");i=e.find(e=>e.kind===n&&e.label===r)}this._realDeviceId=i?i.deviceId:void 0}_setStream(e){super._setStream(e),e?(this.storedMSID=this.getMSID(),S.debug(`Setting new MSID: ${this.storedMSID} on ${this}`)):S.debug("Setting 'null' stream on "+this)}_startStreamEffect(e){this._streamEffect=e,this._originalStream=this.stream,this._setStream(this._streamEffect.startEffect(this._originalStream)),this.track=this.stream.getTracks()[0]}_stopStreamEffect(){this._streamEffect&&(this._streamEffect.stopEffect(),this._setStream(this._originalStream),this._originalStream=null,this.track=this.stream?this.stream.getTracks()[0]:null)}_switchStreamEffect(e){this._streamEffect&&(this._stopStreamEffect(),this._streamEffect=void 0),e&&this._startStreamEffect(e)}setEffect(e){if(void 0===this._streamEffect&&void 0===e)return Promise.resolve();if(void 0!==e&&!e.isEnabled(this))return Promise.reject(new Error("Incompatible effect instance!"));if(!0===this._setEffectInProgress)return Promise.reject(new Error("setEffect already in progress!"));if(this.isMuted()&&!this.isAudioTrack())return this._streamEffect=e,Promise.resolve();const t=this.conference;return t?(this._setEffectInProgress=!0,t.removeTrack(this).then(()=>(this._switchStreamEffect(e),this.isVideoTrack()&&this.containers.forEach(e=>v.a.attachMediaStream(e,this.stream)),t.addTrack(this))).then(()=>{this._setEffectInProgress=!1}).catch(e=>{throw this._setEffectInProgress=!1,this._switchStreamEffect(),S.error("Failed to switch to the new stream!",e),e})):(this._switchStreamEffect(e),this.isVideoTrack()&&this.containers.forEach(e=>v.a.attachMediaStream(e,this.stream)),Promise.resolve())}mute(){return this._queueSetMuted(!0)}unmute(){return this._queueSetMuted(!1)}_queueSetMuted(e){const t=this._setMuted.bind(this,e);return this._prevSetMuted=this._prevSetMuted.then(t,t),this._prevSetMuted}_setMuted(e){if(this.isMuted()===e)return Promise.resolve();if(this.disposed)return Promise.reject(new r.a(s.TRACK_IS_DISPOSED));let t=Promise.resolve();const n=()=>S.info(`Mute ${this}: ${e}`);if(this.isAudioTrack()||this.videoType===p.a.DESKTOP||!f.a.doesVideoMuteByStreamRemove())n(),this._streamEffect&&this._streamEffect.setMuted?this._streamEffect.setMuted(e):this.track&&(this.track.enabled=!e);else if(e)t=new Promise((e,t)=>{n(),this._removeStreamFromConferenceAsMute(()=>{this._streamEffect&&this._stopStreamEffect(),this._unregisterHandlers(),this.stopStream(),this._setStream(null),e()},t)});else{n();const e={cameraDeviceId:this.getDeviceId(),devices:[d.c],effects:this._streamEffect?[this._streamEffect]:[],facingMode:this.getCameraFacingMode()};t=v.a.obtainAudioAndVideoPermissions(Object.assign({},e,{constraints:{video:this._constraints}})),t=t.then(e=>{const t=this.getType()===d.b?d.c:this.getType(),n=e.find(e=>e.track.kind===t);if(!n)throw new r.a(s.TRACK_NO_STREAM_FOUND);return this._setStream(n.stream),this.track=n.track,this.videoType!==n.videoType&&(S.warn(this+": video type has changed after unmute!",this.videoType,n.videoType),this.videoType=n.videoType),this._streamEffect&&this._startStreamEffect(this._streamEffect),this.containers.map(e=>v.a.attachMediaStream(e,this.stream)),this._addStreamToConferenceAsUnmute()})}return t.then(()=>this._sendMuteStatus(e)).then(()=>this.emit(o.TRACK_MUTE_CHANGED,this))}_addStreamToConferenceAsUnmute(){return this.conference?new Promise((e,t)=>{this.conference._addLocalTrackAsUnmute(this).then(e,e=>t(new Error(e)))}):Promise.resolve()}_removeStreamFromConferenceAsMute(e,t){this.conference?this.conference._removeLocalTrackAsMute(this).then(e,e=>t(new Error(e))):e()}_sendMuteStatus(e){return this.conference&&this.conference.room?new Promise(t=>{this.conference.room[this.isAudioTrack()?"setAudioMute":"setVideoMute"](e,t)}):Promise.resolve()}dispose(){let e=Promise.resolve();return this._streamEffect&&(e=this.setEffect()),this.conference&&(e=e.then(()=>this.conference.removeTrack(this))),this.stream&&(this.stopStream(),this.detach()),v.a.removeListener(l.a.DEVICE_LIST_WILL_CHANGE,this._onDeviceListWillChange),this._onAudioOutputDeviceChanged&&v.a.removeListener(l.a.AUDIO_OUTPUT_DEVICE_CHANGED,this._onAudioOutputDeviceChanged),e.then(()=>super.dispose())}isMuted(){return!this.stream||(!(!this.isVideoTrack()||this.isActive())||(this._streamEffect&&this._streamEffect.isMuted?this._streamEffect.isMuted():!this.track||!this.track.enabled))}_setConference(e){this.conference=e;for(let e=0;e<this.containers.length;e++)this._maybeFireTrackAttached(this.containers[e])}isLocal(){return!0}getDeviceId(){return this._realDeviceId||this.deviceId}getParticipantId(){return this.conference&&this.conference.myUserId()}_onByteSentStatsReceived(e,t){t>0&&(this._hasSentData=!0);const n=e.getConnectionState();this._testDataSent&&"connected"===n&&(setTimeout(()=>{this._hasSentData||(S.warn(`${this} 'bytes sent' <= 0: ${t}`),g.a.analytics.sendEvent(m.r,{media_type:this.getType()}))},3e3),this._testDataSent=!1)}getCameraFacingMode(){if(this.isVideoTrack()&&this.videoType===p.a.CAMERA){var e,t;const n=null===(e=(t=this.track).getSettings)||void 0===e?void 0:e.call(t);return n&&"facingMode"in n?n.facingMode:void 0!==this._facingMode?this._facingMode:c.a.USER}}stopStream(){this._stopStreamInProgress=!0;try{v.a.stopMediaStream(this.stream)}finally{this._stopStreamInProgress=!1}}_switchCamera(){this.isVideoTrack()&&this.videoType===p.a.CAMERA&&"function"==typeof this.track._switchCamera&&(this.track._switchCamera(),this._facingMode=this._facingMode===c.a.ENVIRONMENT?c.a.USER:c.a.ENVIRONMENT)}isReceivingData(){if(this.isVideoTrack()&&(this.isMuted()||this._stopStreamInProgress||this.videoType===p.a.DESKTOP))return!0;if(!this.stream)return!1;return(this._effectEnabled?this._originalStream:this.stream).getTracks().some(e=>!("readyState"in e&&"live"!==e.readyState||"muted"in e&&!0===e.muted))}toString(){return`LocalTrack[${this.rtcId},${this.getType()}]`}}}).call(this,"modules/RTC/JitsiLocalTrack.js")},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return P}));var i=n(152),r=n(5),s=n(25),o=n.n(s),a=n(20),c=n(10),d=n.n(c),u=n(4),l=n(7),h=n.n(l),p=n(42),m=n(15),f=n(36),g=n(3),_=n(123),v=n(124),S=n(18),y=n(9),E=n(125),b=n(30),C=n(12),T=n(126),R=n(13),A=n(11),I=n(61);const w=Object(r.getLogger)(e);function P(e,t,r,s,o,a,c){this.audioTransferActive=!(!0===c.startSilent),this._dtmfSender=void 0,this._dtmfTonesQueue=[],this.videoTransferActive=!0,this.rtc=e,this.id=t,this.isP2P=a,this.remoteTracks=new Map,this.localTracks=new Map,this._addedStreams=[],this.localSSRCs=new Map,this.localUfrag=null,this.remoteUfrag=null,this.signalingLayer=r,this._peerVideoTypeChanged=this._peerVideoTypeChanged.bind(this),this.signalingLayer.on(p.b,this._peerVideoTypeChanged),this._peerMutedChanged=this._peerMutedChanged.bind(this),this.signalingLayer.on(p.a,this._peerMutedChanged),this.options=c;const d=o||{};d.optional=d.optional||[],Array.isArray(d.optional)?d.optional.push({rtcStatsSFUP2P:this.isP2P}):w.warn("Optional param is not an array, rtcstats p2p data is omitted."),this.peerconnection=new A.a.RTCPeerConnectionType(s,d);const u={low:2e5,standard:7e5,high:25e5};this.videoBitrates=this.options.videoQuality&&this.options.videoQuality.maxBitratesVideo?this.options.videoQuality.maxBitratesVideo:u,this.tpcUtils=new I.b(this,this.videoBitrates),this.updateLog=[],this.stats={},this.statsinterval=null,this._capScreenshareBitrate=this.options.capScreenshareBitrate,this._usesUnifiedPlan=c.usesUnifiedPlan,this._usesTransceiverCodecPreferences=g.a.supportsCodecPreferences()&&this._usesUnifiedPlan,this._usesTransceiverCodecPreferences&&w.info("Using RTCRtpTransceiver#setCodecPreferences for codec selection"),this.maxstats=c.maxstats,this.interop=new i.a;const l=n(167);this.simulcast=new l({numOfLayers:I.a.length,explodeRemoteSimulcast:!1,usesUnifiedPlan:this._usesUnifiedPlan}),this.sdpConsistency=new E.a(this.toString()),this.localSdpMunger=new _.a(this,this.rtc.getLocalEndpointId()),this.eventEmitter=e.eventEmitter,this.rtxModifier=new v.a,this.senderVideoMaxHeight=null,this.trace=(e,t)=>{w.debug(e,t),this.updateLog.push({time:new Date,type:e,value:t||""})},this.onicecandidate=null,this.peerconnection.onicecandidate=e=>{this.trace("onicecandidate",JSON.stringify(e.candidate,null," ")),null!==this.onicecandidate&&this.onicecandidate(e)},this._usesUnifiedPlan?(this.onTrack=e=>{const t=e.streams[0];this._remoteTrackAdded(t,e.track,e.transceiver),t.addEventListener("removetrack",e=>{this._remoteTrackRemoved(t,e.track)})},this.peerconnection.addEventListener("track",this.onTrack)):(this.peerconnection.onaddstream=e=>this._remoteStreamAdded(e.stream),this.peerconnection.onremovestream=e=>this._remoteStreamRemoved(e.stream)),this.onsignalingstatechange=null,this.peerconnection.onsignalingstatechange=e=>{this.trace("onsignalingstatechange",this.signalingState),null!==this.onsignalingstatechange&&this.onsignalingstatechange(e)},this.oniceconnectionstatechange=null,this.peerconnection.oniceconnectionstatechange=e=>{this.trace("oniceconnectionstatechange",this.iceConnectionState),null!==this.oniceconnectionstatechange&&this.oniceconnectionstatechange(e)},this.onnegotiationneeded=null,this.peerconnection.onnegotiationneeded=e=>{this.trace("onnegotiationneeded"),null!==this.onnegotiationneeded&&this.onnegotiationneeded(e)},this.onconnectionstatechange=null,this.peerconnection.onconnectionstatechange=e=>{this.trace("onconnectionstatechange",this.connectionState),null!==this.onconnectionstatechange&&this.onconnectionstatechange(e)},this.ondatachannel=null,this.peerconnection.ondatachannel=e=>{this.trace("ondatachannel"),null!==this.ondatachannel&&this.ondatachannel(e)},this.maxstats&&(this.statsinterval=window.setInterval(()=>{this.getStats().then(e=>{if("function"==typeof(null==e?void 0:e.result)){const t=e.result();for(let e=0;e<t.length;++e){const n=t[e];n.names().forEach(e=>{this._processStat(n,e,n.stat(e))})}}else e.forEach(e=>this._processStat(e,"",e))})},1e3)),w.info("Create new "+this)}P.prototype._processStat=function(e,t,n){const i=`${e.id}-${t}`;let r=this.stats[i];const s=new Date;r||(this.stats[i]=r={startTime:s,endTime:s,values:[],times:[]}),r.values.push(n),r.times.push(s.getTime()),r.values.length>this.maxstats&&(r.values.shift(),r.times.shift()),r.endTime=s};const O=function(e){return null==e?"":`type: ${e.type}\r\n${e.sdp}`};P.prototype.getConnectionState=function(){const e=this.peerconnection.iceConnectionState;return"completed"===e?"connected":e},P.prototype.getDesiredMediaDirection=function(e,t=!1){const n=this.hasAnyTracksOfType(e);if(this._usesUnifiedPlan)return t?n?d.a.SENDRECV:d.a.SENDONLY:n?d.a.RECVONLY:d.a.INACTIVE;return(e===u.a?this.audioTransferActive:this.videoTransferActive)?n?d.a.SENDRECV:d.a.RECVONLY:d.a.INACTIVE},P.prototype._getReceiversByEndpointIds=function(e,t){let n=[],i=[];for(const i of e)n=n.concat(this.getRemoteTracks(i,t));const r=n.map(e=>{var t;return null===(t=e.track)||void 0===t?void 0:t.id});return i=this.peerconnection.getReceivers().filter(e=>e.track&&e.track.kind===t&&r.find(t=>t===e.track.id)),i},P.prototype.isSimulcastOn=function(){return!this.options.disableSimulcast},P.prototype._peerVideoTypeChanged=function(e,t){if(!e)return void w.error(this+" No endpointID on peerVideoTypeChanged");const n=this.getRemoteTracks(e,u.c);n.length&&n[0]._setVideoType(t)},P.prototype._peerMutedChanged=function(e,t,n){if(!e)return void w.error(this+" On peerMuteChanged - no endpoint ID");const i=this.getRemoteTracks(e,t);i.length&&i[0].setMute(n)},P.prototype.getAudioLevels=function(e=[]){const t={};return(e.length?this._getReceiversByEndpointIds(e,u.a):this.peerconnection.getReceivers().filter(e=>e.track&&e.track.kind===u.a&&e.track.enabled)).forEach(e=>{const n=e.getSynchronizationSources();n&&n.length&&(t[n[0].source]=n[0].audioLevel)}),t},P.prototype.getLocalTracks=function(e){let t=Array.from(this.localTracks.values());return void 0!==e&&(t=t.filter(t=>t.getType()===e)),t},P.prototype.getLocalVideoTrack=function(){return this.getLocalTracks(u.c)[0]},P.prototype.hasAnyTracksOfType=function(e){if(!e)throw new Error('"mediaType" is required');return this.getLocalTracks(e).length>0},P.prototype.getRemoteTracks=function(e,t){const n=[],i=e?[e]:this.remoteTracks.keys();for(const e of i){const i=this.remoteTracks.get(e);if(i)for(const e of i.keys())if(!t||t===e){const t=i.get(e);t&&n.push(t)}}return n},P.prototype.getRemoteSourceInfoByParticipant=function(e){const t=[],n=this.getRemoteTracks(e);if(!(null==n?void 0:n.length))return t;const i=n.map(e=>e.getSSRC()),r=new S.a(this.remoteDescription.sdp);return i.forEach((e,n)=>{for(const i of r.media){let r="",s=y.a.findLines(i,"a=ssrc:"+e);if(s.length){t[n]||(t[n]="");const o=y.a.findLines(i,"a=ssrc-group:FID "+e);if(o.length){const e=o[0].split(" ")[2];r+=o[0]+"\r\n",s=s.concat(y.a.findLines(i,"a=ssrc:"+e))}t[n]+=s.join("\r\n")+"\r\n",t[n]+=r}}}),t},P.prototype.getTargetVideoBitrates=function(){const e=this.getConfiguredVideoCodec();return this.videoBitrates[e.toUpperCase()]||this.videoBitrates},P.prototype.getTrackBySSRC=function(e){if("number"!=typeof e)throw new Error(`SSRC ${e} is not a number`);for(const t of this.localTracks.values())if(this.getLocalSSRC(t)===e)return t;for(const t of this.getRemoteTracks())if(t.getSSRC()===e)return t;return null},P.prototype.getSsrcByTrackId=function(e){const t=t=>t.getTrack().id===e,n=this.getLocalTracks().find(t);if(n)return this.getLocalSSRC(n);const i=this.getRemoteTracks().find(t);return i?i.getSSRC():null},P.prototype._remoteStreamAdded=function(e){const t=R.a.getStreamID(e);if(!R.a.isUserStreamById(t))return void w.info(`${this} ignored remote 'stream added' event for non-user stream[id=${t}]`);g.a.isChromiumBased()&&(e.onaddtrack=t=>{this._remoteTrackAdded(e,t.track)},e.onremovetrack=t=>{this._remoteTrackRemoved(e,t.track)});const n=e.getAudioTracks();for(const t of n)this._remoteTrackAdded(e,t);const i=e.getVideoTracks();for(const t of i)this._remoteTrackAdded(e,t)},P.prototype._remoteTrackAdded=function(e,t,n=null){const i=R.a.getStreamID(e),r=t.kind;if(!this.isP2P&&!R.a.isUserStreamById(i))return void w.info(`${this} ignored remote 'stream added' event for non-user stream[id=${i}]`);if(w.info(`${this} adding remote track for stream[id=${i},type=${r}]`),!r)return void C.callErrorHandler(new Error("MediaType undefined for remote track, stream id: "+i));const s=this._usesUnifiedPlan?new S.a(this.peerconnection.remoteDescription.sdp):new S.a(this.remoteDescription.sdp);let o;if(this._usesUnifiedPlan)if(n&&n.mid){const e=n.mid;o=s.media.filter(t=>y.a.findLine(t,"a=mid:"+e))}else o=s.media.filter(e=>{const t=y.a.findLine(e,"a=msid:");return void 0!==t&&i===t.substring(7).split(" ")[0]});else o=s.media.filter(e=>e.startsWith("m="+r));if(!o.length)return void C.callErrorHandler(new Error(`No media lines found in remote SDP for remote stream[id=${i},type=${r}]`));let a=y.a.findLines(o[0],"a=ssrc:");if(a=a.filter(e=>-1!==e.indexOf("msid:"+i)),!a.length)return void C.callErrorHandler(new Error(`No SSRC lines found in remote SDP for remote stream[msid=${i},type=${r}]`));const c=a[0].substring(7).split(" ")[0],d=Number(c),u=this.signalingLayer.getSSRCOwner(d);if(isNaN(d)||d<0)return void C.callErrorHandler(new Error(`Invalid SSRC for remote stream[ssrc=${d},id=${i},type=${r}]`));if(!u)return void C.callErrorHandler(new Error(`No SSRC owner known for remote stream[ssrc=${d},id=${i},type=${r}]`));w.info(`${this} creating remote track[endpoint=${u},ssrc=${d},type=${r}]`);const l=this.signalingLayer.getPeerMediaInfo(u,r);if(!l)return void C.callErrorHandler(new Error(`${this}: no peer media info available for ${u}`));const h=l.muted,p=l.videoType;this._createRemoteTrack(u,e,t,r,p,d,h)},P.prototype._createRemoteTrack=function(e,t,n,i,r,s,o){let a=this.remoteTracks.get(e);a||(a=new Map,this.remoteTracks.set(e,a));const c=a.get(i);if(c&&c.getTrack()===n)return void w.info(`${this} ignored duplicated track event for track[endpoint=${e},type=${i}]`);c&&(w.error(`${this} received a second remote track for track[endpoint=${e},type=${i}]deleting the existing track`),this._remoteTrackRemoved(c.getOriginalStream(),c.getTrack()));const d=new T.a(this.rtc,this.rtc.conference,e,t,n,i,r,s,o,this.isP2P);a.set(i,d),this.eventEmitter.emit(h.a.REMOTE_TRACK_ADDED,d,this)},P.prototype._remoteStreamRemoved=function(e){if(!R.a.isUserStream(e)){const t=R.a.getStreamID(e);return void w.info(`Ignored remote 'stream removed' event for stream[id=${t}]`)}const t=e.getVideoTracks();for(const n of t)this._remoteTrackRemoved(e,n);const n=e.getAudioTracks();for(const t of n)this._remoteTrackRemoved(e,t)},P.prototype._remoteTrackRemoved=function(e,t){const n=R.a.getStreamID(e),i=t&&R.a.getTrackID(t);R.a.isUserStreamById(n)?(w.info(`${this} remote track removed stream[id=${n},trackId=${i}]`),n?i?this._removeRemoteTrackById(n,i)||w.warn(`${this} Removed track not found for stream[id=${n},trackId=${i}]`):C.callErrorHandler(new Error(this+" remote track removal failed - no track ID")):C.callErrorHandler(new Error(this+" remote track removal failed - no stream ID"))):w.info(`${this} ignored remote 'stream removed' event for non-user stream[id=${n}]`)},P.prototype._getRemoteTrackById=function(e,t){for(const n of this.remoteTracks.values())for(const i of n.values())if(i.getStreamId()==e&&i.getTrackId()==t)return i},P.prototype.removeRemoteTracks=function(e){const t=[],n=this.remoteTracks.get(e);if(n){const i=n.get(u.a),r=n.get(u.c);i&&t.push(i),r&&t.push(r),this.remoteTracks.delete(e)}return w.debug(`${this} removed remote tracks[endpoint=${e},count=${t.length}`),t},P.prototype._removeRemoteTrack=function(e){e.dispose();const t=e.getParticipantId(),n=this.remoteTracks.get(t);n?n.delete(e.getType())||w.error(`${this} Failed to remove ${e} - type mapping messed up ?`):w.error(`${this} removeRemoteTrack: no remote tracks map for endpoint=${t}`),this.eventEmitter.emit(h.a.REMOTE_TRACK_REMOVED,e)},P.prototype._removeRemoteTrackById=function(e,t){const n=this._getRemoteTrackById(e,t);return n&&this._removeRemoteTrack(n),n},P.prototype._extractSSRCMap=function(e){const t=new Map,n=new Map;if("object"!=typeof e||null===e||"string"!=typeof e.sdp)return w.warn("An empty description was passed as an argument"),t;const i=o.a.parse(e.sdp);if(!Array.isArray(i.media))return t;let r=i.media;this._usesUnifiedPlan&&(r=[],[u.a,u.c].forEach(e=>{const t=i.media.find(t=>t.type===e);t&&r.push(t)}));for(const e of r){if(!Array.isArray(e.ssrcs))continue;if(Array.isArray(e.ssrcGroups))for(const t of e.ssrcGroups)if(void 0!==t.semantics&&void 0!==t.ssrcs){const e=t.ssrcs.split(" ").map(e=>parseInt(e,10)),i=e[0];t.ssrcs=e,n.has(i)||n.set(i,[]),n.get(i).push(t)}let i=e.ssrcs;i=this._usesUnifiedPlan?i.filter(e=>"cname"===e.attribute):i.filter(e=>"msid"===e.attribute);for(const r of i){const i=this._usesUnifiedPlan?e.type:r.value,s=r.id;let o=t.get(i);if(o||(o={ssrcs:[],groups:[],msid:i},t.set(i,o)),o.ssrcs.push(s),n.has(s)){const e=n.get(s);for(const t of e)o.groups.push(t)}}}return t};const D=function(e){if("object"!=typeof e||null===e||"string"!=typeof e.sdp)return w.warn("An empty description was passed as an argument"),e;const t=n(25),i=t.parse(e.sdp);void 0!==i&&void 0!==i.media&&Array.isArray(i.media)&&i.media.forEach(e=>{const t=[],n=[];if(void 0!==e.ssrcGroups&&Array.isArray(e.ssrcGroups)&&e.ssrcGroups.forEach(e=>{void 0!==e.semantics&&"FID"===e.semantics&&void 0!==e.ssrcs&&t.push(Number(e.ssrcs.split(" ")[0]))}),Array.isArray(e.ssrcs)){let i;for(i=0;i<e.ssrcs.length;i++)"object"==typeof e.ssrcs[i]&&void 0!==e.ssrcs[i].id&&t.indexOf(e.ssrcs[i].id)>=0&&(n.push(e.ssrcs[i]),delete e.ssrcs[i]);for(i=0;i<e.ssrcs.length;i++)void 0!==e.ssrcs[i]&&n.push(e.ssrcs[i]);e.ssrcs=function(e=[]){if(!g.a.isChrome()||!g.a.isVersionGreaterThan(70))return e;let t=[...e];return e.filter(e=>e.attribute==="mslabel"&&e.value==="-").map(e=>e.id).forEach(e=>{const n=t.find(t=>t.id===e&&"cname"===t.attribute);n.value=`${d.a.RECVONLY}-${e}`,t=t.filter(t=>t.id!==e),t.push(n)}),t}(n)}});const r=t.write(i);return new RTCSessionDescription({type:e.type,sdp:r})};P.prototype.getLocalSSRC=function(e){const t=this._getSSRC(e.rtcId);return t&&t.ssrcs[0]},P.prototype._injectSsrcGroupForUnifiedSimulcast=function(e){const t=o.a.parse(e.sdp),n=t.media.find(e=>"video"===e.type);n.ssrcGroups=n.ssrcGroups||[];const i=n.ssrcGroups.filter(e=>"FID"===e.semantics);if(n.simulcast||n.simulcast_03){const t=[];if(i&&i.length?i.forEach(e=>{t.push(e.ssrcs.split(" ")[0])}):n.ssrcs.forEach(e=>{"msid"===e.attribute&&t.push(e.id)}),n.ssrcGroups.find(e=>"SIM"===e.semantics))return e;n.ssrcGroups.push({semantics:"SIM",ssrcs:t.join(" ")})}return new RTCSessionDescription({type:e.type,sdp:o.a.write(t)})};const N={signalingState(){return this.peerconnection.signalingState},iceConnectionState(){return this.peerconnection.iceConnectionState},connectionState(){return this.peerconnection.connectionState},localDescription(){let e=this.peerconnection.localDescription;return e?(this.trace("getLocalDescription::preTransform",O(e)),this._usesUnifiedPlan&&!this.isP2P?(e=this.interop.toPlanB(e),this.trace("getLocalDescription::postTransform (Plan B)",O(e)),e=this._injectSsrcGroupForUnifiedSimulcast(e),this.trace("getLocalDescription::postTransform (inject ssrc group)",O(e))):this._usesUnifiedPlan||(g.a.doesVideoMuteByStreamRemove()&&(e=this.localSdpMunger.maybeAddMutedLocalVideoTracksToSDP(e),w.debug("getLocalDescription::postTransform (munge local SDP)",e)),e=function(e,t){if(!e)throw new Error("No local description passed in.");const n=new b.a(e.sdp),i=n.selectMedia(u.a);let r=!1;i&&i.direction!==d.a.SENDRECV&&(t.startSilent?i.direction=d.a.INACTIVE:i.direction=d.a.SENDRECV,r=!0);const s=n.selectMedia(u.c);return s&&s.direction!==d.a.SENDRECV&&(s.direction=d.a.SENDRECV,r=!0),r?new RTCSessionDescription({type:e.type,sdp:n.toRawSDP()}):e}(e,this.options)),e=this.localSdpMunger.transformStreamIdentifiers(e),e):(w.debug(this+" getLocalDescription no localDescription found"),{})},remoteDescription(){let e=this.peerconnection.remoteDescription;return e?(this.trace("getRemoteDescription::preTransform",O(e)),this._usesUnifiedPlan&&(this.isP2P?e=this._adjustRemoteMediaDirection(e):(e=this.interop.toPlanB(e),this.trace("getRemoteDescription::postTransform (Plan B)",O(e)))),e):(w.debug(this+" getRemoteDescription no remoteDescription found"),{})}};Object.keys(N).forEach(e=>{Object.defineProperty(P.prototype,e,{get:N[e]})}),P.prototype._getSSRC=function(e){return this.localSSRCs.get(e)},P.prototype._isSharingLowFpsScreen=function(){return this._isSharingScreen()&&this._capScreenshareBitrate},P.prototype._isSharingScreen=function(){const e=this.getLocalVideoTrack();return e&&e.videoType===m.DESKTOP},P.prototype._mungeCodecOrder=function(e){if(!this.codecPreference)return e;const t=o.a.parse(e.sdp),n=t.media.find(e=>e.type===this.codecPreference.mediaType);if(!n)return e;if(this.codecPreference.enable)if(y.a.preferCodec(n,this.codecPreference.mimeType),this.codecPreference.mimeType===a.H264&&g.a.isReactNative()&&this.isP2P&&y.a.stripCodec(n,this.codecPreference.mimeType,!0),this.codecPreference.mimeType===a.VP9){const e=this.videoBitrates.VP9||this.videoBitrates,t=e.high?e.high:25e5,i=Math.floor((this._isSharingScreen()?25e5:t)/1e3);n.bandwidth=[{type:"AS",limit:i}]}else n.bandwidth=void 0;else y.a.stripCodec(n,this.codecPreference.mimeType);return new RTCSessionDescription({type:e.type,sdp:o.a.write(t)})},P.prototype.containsTrack=function(e){if(e.isLocal())return this.localTracks.has(e.rtcId);const t=e.getParticipantId(),n=this.remoteTracks.get(t);return Boolean(n&&n.get(e.getType())===e)},P.prototype.addTrack=function(e,t=!1){const n=e.rtcId;if(w.info(`${this} adding ${e}`),this.localTracks.has(n))return Promise.reject(new Error(`${e} is already in ${this}`));if(this.localTracks.set(n,e),this._usesUnifiedPlan)try{this.tpcUtils.addTrack(e,t)}catch(t){return w.error(`${this} Adding track=${e} failed: ${null==t?void 0:t.message}`),Promise.reject(t)}else{const t=e.getOriginalStream();if(t)this._addStream(t);else if(!g.a.doesVideoMuteByStreamRemove()||e.isAudioTrack()||e.isVideoTrack()&&!e.isMuted())return Promise.reject(new Error(`${this} no WebRTC stream for track=${e}`));if(g.a.doesVideoMuteByStreamRemove()&&e.isVideoTrack()&&e.isMuted()){const t=this.generateNewStreamSSRCInfo(e);this.sdpConsistency.setPrimarySsrc(t.ssrcs[0]);const n=t.groups.find(e=>"SIM"===e.semantics);n&&this.simulcast.setSsrcCache(n.ssrcs);const i=t.groups.filter(e=>"FID"===e.semantics);if(i){const e=new Map;i.forEach(t=>{const n=t.ssrcs[0],i=t.ssrcs[1];e.set(n,i)}),this.rtxModifier.setSsrcCache(e)}}}let i=Promise.resolve();return g.a.isFirefox()&&(i=i.then(()=>this.tpcUtils.setEncodings(e))),i},P.prototype.addTrackUnmute=function(e){if(!this._assertTrackBelongs("addTrackUnmute",e))return Promise.reject("Track not found on the peerconnection");w.info(`${this} Adding track=${e} as unmute`);const t=e.getOriginalStream();return t?this._usesUnifiedPlan?this.tpcUtils.addTrackUnmute(e):(this._addStream(t),Promise.resolve(!0)):(w.error(`${this} Unable to add track=${e} as unmute - no WebRTC stream`),Promise.reject("Stream not found"))},P.prototype._addStream=function(e){this.peerconnection.addStream(e),this._addedStreams.push(e)},P.prototype._removeStream=function(e){this.peerconnection.removeStream(e),this._addedStreams=this._addedStreams.filter(t=>t!==e)},P.prototype._assertTrackBelongs=function(e,t){const n=this.localTracks.has(t.rtcId);return n||w.error(`${this} ${e}: track=${t} does not belong to pc`),n},P.prototype.getConfiguredVideoCodec=function(){var e;const t=null===(e=this.peerconnection.localDescription)||void 0===e?void 0:e.sdp,n=a.VP8;if(!t)return n;const i=o.a.parse(t).media.find(e=>e.type===u.c).rtp[0].codec;return i?Object.values(a).find(e=>e===i.toLowerCase()):n},P.prototype.setDesktopSharingFrameRate=function(e){const t=e<=f.a;this._capScreenshareBitrate=this.isSimulcastOn()&&t},P.prototype.setVideoCodecs=function(e=null,t=null){const n=null===t,i=t||e;this.codecPreference&&(e||t)?(this.codecPreference.enable=n,this.codecPreference.mimeType=i):e||t?this.codecPreference={enable:n,mediaType:u.c,mimeType:i}:w.warn(`${this} Invalid codec settings[preferred=${e},disabled=${t}],\n atleast one value is needed`)},P.prototype.isMediaStreamInPc=function(e){return this._addedStreams.indexOf(e)>-1},P.prototype.removeTrack=function(e){const t=e.getOriginalStream();this.trace("removeStream",e.rtcId,t?t.id:void 0),this._assertTrackBelongs("removeStream",e)&&(this.localTracks.delete(e.rtcId),this.localSSRCs.delete(e.rtcId),t&&this.peerconnection.removeStream(t))},P.prototype.findSenderByKind=function(e){return this.peerconnection.getSenders().find(t=>t.track&&t.track.kind===e)},P.prototype.findReceiverForTrack=function(e){return this.peerconnection.getReceivers().find(t=>t.track===e)},P.prototype.findSenderForTrack=function(e){return this.peerconnection.getSenders().find(t=>t.track===e)},P.prototype.replaceTrack=function(e,t){if(this._usesUnifiedPlan)return w.debug(this+" TPC.replaceTrack using unified plan"),this.tpcUtils.replaceTrack(e,t).then(()=>this.isSimulcastOn()&&g.a.usesSdpMungingForSimulcast()||this.isP2P);w.debug(this+" TPC.replaceTrack using plan B");let n=Promise.resolve();return e&&this.removeTrack(e),t&&(n=this.addTrack(t)),n.then(()=>!0)},P.prototype.removeTrackMute=function(e){const t=e.getOriginalStream();return this.trace("removeStreamMute",e.rtcId,t?t.id:null),this._assertTrackBelongs("removeStreamMute",e)?this._usesUnifiedPlan?this.tpcUtils.removeTrackMute(e):t?(w.info(`${this} Removing track=${e} as mute`),this._removeStream(t),Promise.resolve(!0)):(w.error(`${this} removeStreamMute - no WebRTC stream for track=${e}`),Promise.reject("Stream not found")):Promise.reject("Track not found in the peerconnection")},P.prototype.createDataChannel=function(e,t){return this.trace("createDataChannel",e,t),this.peerconnection.createDataChannel(e,t)},P.prototype._ensureSimulcastGroupIsLast=function(e){let t=e.sdp;const n=t.indexOf("m=video"),i=t.indexOf("a=ssrc-group:SIM",n);let r=t.lastIndexOf("a=ssrc-group");if(-1===i||-1===r||r===i)return e;const s=t.indexOf("\r\n",i),o=t.substring(i,s+2);t=t.replace(o,""),r=t.lastIndexOf("a=ssrc-group");const a=t.indexOf("\r\n",r),c=t.slice(0,a),d=o.trim(),u=t.slice(a);return t=`${c}\r\n${d}${u}`,new RTCSessionDescription({type:e.type,sdp:t})},P.prototype._adjustLocalMediaDirection=function(e){const t=new b.a(e.sdp);let n=!1;const i=t.selectMedia(u.a);if(i){const e=this.getDesiredMediaDirection(u.a);i.direction!==e&&(i.direction=e,w.info(`${this} Adjusted local audio direction to ${e}`),n=!0)}else w.warn(this+' No "audio" media found in the local description');const r=t.selectMedia(u.c);if(r){const e=this.getDesiredMediaDirection(u.c);r.direction!==e&&(r.direction=e,w.info(`${this} Adjusted local video direction to ${e}`),n=!0)}else w.warn(this+' No "video" media found in the local description');return n?new RTCSessionDescription({type:e.type,sdp:t.toRawSDP()}):e},P.prototype._adjustRemoteMediaDirection=function(e){const t=new b.a(e.sdp);return[u.a,u.c].forEach(e=>{const n=t.selectMedia(e),i=this.hasAnyTracksOfType(e),r=this.getRemoteTracks(null,e).length>0;n.direction=i&&r?d.a.SENDRECV:i?d.a.RECVONLY:r?d.a.SENDONLY:d.a.INACTIVE}),new RTCSessionDescription({type:e.type,sdp:t.toRawSDP()})},P.prototype._mungeOpus=function(e){const{audioQuality:t}=this.options;if(!(null==t?void 0:t.stereo)&&!(null==t?void 0:t.opusMaxAverageBitrate))return e;const n=o.a.parse(e.sdp),i=n.media;for(const e of i)if("audio"===e.type){const{payload:n}=e.rtp.find(e=>e.codec===a.OPUS);if(!n)continue;let i=e.fmtp.find(e=>e.payload===n);i||(i={payload:n,config:""});const r=o.a.parseParams(i.config);let s=!1;if((null==t?void 0:t.stereo)&&(r.stereo=1,s=!0),(null==t?void 0:t.opusMaxAverageBitrate)&&(r.maxaveragebitrate=t.opusMaxAverageBitrate,s=!0),!s)continue;let c="";for(const e of Object.keys(r))c+=`${e}=${r[e]}; `;i.config=c.trim()}return new RTCSessionDescription({type:e.type,sdp:o.a.write(n)})},P.prototype.setLocalDescription=function(e){let t=e;return this.trace("setLocalDescription::preTransform",O(t)),t=this._mungeOpus(t),this._usesUnifiedPlan?this.isP2P||(t=this.interop.toUnifiedPlan(t),this.trace("setLocalDescription::postTransform (Unified Plan)",O(t))):(t=this._adjustLocalMediaDirection(t),t=this._ensureSimulcastGroupIsLast(t)),this._usesTransceiverCodecPreferences||(t=this._mungeCodecOrder(t)),new Promise((e,n)=>{this.peerconnection.setLocalDescription(t).then(()=>{this.trace("setLocalDescriptionOnSuccess");const n=y.a.getUfrag(t.sdp);n!==this.localUfrag&&(this.localUfrag=n,this.eventEmitter.emit(h.a.LOCAL_UFRAG_CHANGED,this,n)),e()},e=>{this.trace("setLocalDescriptionOnFailure",e),this.eventEmitter.emit(h.a.SET_LOCAL_DESCRIPTION_FAILED,e,this),n(e)})})},P.prototype.setAudioTransferActive=function(e){w.debug(`${this} audio transfer active: ${e}`);const t=this.audioTransferActive!==e;return this.audioTransferActive=e,this._usesUnifiedPlan?(this.tpcUtils.setAudioTransferActive(e),!1):t},P.prototype.setSenderVideoDegradationPreference=function(){if(!this.peerconnection.getSenders)return w.debug(this+" Browser does not support RTCRtpSender"),Promise.resolve();const e=this.getLocalVideoTrack(),t=this.findSenderByKind(u.c);if(!t)return Promise.resolve();const n=t.getParameters(),i=this._isSharingLowFpsScreen()?"maintain-resolution":"maintain-framerate";return w.info(`${this} Setting a degradation preference [preference=${i},track=${e}`),n.degradationPreference=i,this.tpcUtils.updateEncodingsResolution(n),t.setParameters(n)},P.prototype.setMaxBitRate=function(){var e,t,n;if(this.getConfiguredVideoCodec()===a.VP9||!window.RTCRtpSender)return Promise.resolve();const i=this.getLocalVideoTrack();if(!i)return Promise.resolve();const r=i.getVideoType();if(!((null===(e=this.options)||void 0===e||null===(t=e.videoQuality)||void 0===t?void 0:t.maxBitratesVideo)||this._isSharingLowFpsScreen()||this._usesUnifiedPlan))return Promise.resolve();const s=i._originalStream&&i._originalStream.id!==i.getStreamId(),o=this.findSenderByKind(u.c);if(!o)return Promise.resolve();const c=o.getParameters();if(!(null===(n=c.encodings)||void 0===n?void 0:n.length))return Promise.resolve();if(this.isSimulcastOn()){for(const e in c.encodings)if(c.encodings.hasOwnProperty(e)){const t=this._isSharingLowFpsScreen()?s?25e5:5e5:r===m.DESKTOP&&g.a.isChromiumBased()?void 0:this.tpcUtils.localStreamEncodingsConfig[e].maxBitrate;w.info(`${this} Setting a max bitrate of ${t} bps on layer `+this.tpcUtils.localStreamEncodingsConfig[e].rid),c.encodings[e].maxBitrate=t}}else{var d;let e=null===(d=this.getTargetVideoBitrates())||void 0===d?void 0:d.high;if(r===m.CAMERA){const t=this.senderVideoMaxHeight?Math.floor(i.resolution/this.senderVideoMaxHeight):1,n=this.tpcUtils.localStreamEncodingsConfig.find(e=>e.scaleResolutionDownBy===t);n&&(w.info(`${this} Setting max bitrate=${n.maxBitrate} bps on track=${i}`),e=n.maxBitrate)}c.encodings[0].maxBitrate=e}return this.tpcUtils.updateEncodingsResolution(c),o.setParameters(c)},P.prototype.setRemoteDescription=function(e){if(this.trace("setRemoteDescription::preTransform",O(e)),e=this._mungeOpus(e),this._usesUnifiedPlan){if(!this.isP2P){const t=this.peerconnection.remoteDescription;e=this.interop.toUnifiedPlan(e,t),this.trace("setRemoteDescription::postTransform (Unified)",O(e)),this.isSimulcastOn()&&(e=this.simulcast.mungeRemoteDescription(e),e=this.tpcUtils.insertUnifiedPlanSimulcastReceive(e),this.trace("setRemoteDescription::postTransform (sim receive)",O(e)))}}else this.isSimulcastOn()&&(e=this.simulcast.mungeRemoteDescription(e,!0),this.trace("setRemoteDescription::postTransform (simulcast)",O(e))),e=D(e);return e=this._mungeCodecOrder(e),this._usesUnifiedPlan&&(e=this.tpcUtils.ensureCorrectOrderOfSsrcs(e)),new Promise((t,n)=>{this.peerconnection.setRemoteDescription(e).then(()=>{this.trace("setRemoteDescriptionOnSuccess");const n=y.a.getUfrag(e.sdp);n!==this.remoteUfrag&&(this.remoteUfrag=n,this.eventEmitter.emit(h.a.REMOTE_UFRAG_CHANGED,this,n)),t()},e=>{this.trace("setRemoteDescriptionOnFailure",e),this.eventEmitter.emit(h.a.SET_REMOTE_DESCRIPTION_FAILED,e,this),n(e)})})},P.prototype.setSenderVideoConstraint=function(e=null){var t;if(e<0)throw new Error("Invalid frameHeight: "+e);if(g.a.isReactNative())return Promise.resolve();const n=null===e?this.senderVideoMaxHeight:e;if(this.senderVideoMaxHeight=n,null===n)return Promise.resolve();w.log(`${this} senderVideoMaxHeight: ${n}`);const i=this.getLocalVideoTrack();if(!i||i.isMuted())return Promise.resolve();const r=this.findSenderByKind(u.c);if(!r)return Promise.resolve();const s=r.getParameters();if(!(null==s||null===(t=s.encodings)||void 0===t?void 0:t.length))return Promise.resolve();if(this.isSimulcastOn()){this.encodingsEnabledState=this.tpcUtils.getLocalStreamHeightConstraints(i.track).map(e=>e<=n);const e=this.tpcUtils.localStreamEncodingsConfig.findIndex(e=>4===e.scaleResolutionDownBy);if(n>0&&-1!==e&&(this.encodingsEnabledState[e]=!0),this._isSharingLowFpsScreen()&&this._usesUnifiedPlan&&!g.a.isWebKitBased()){const e=g.a.isFirefox()?0:this.encodingsEnabledState.length-1;this.encodingsEnabledState=this.encodingsEnabledState.map((t,n)=>n===e)}for(const e in s.encodings)s.encodings.hasOwnProperty(e)&&(s.encodings[e].active=this.encodingsEnabledState[e]);this.tpcUtils.updateEncodingsResolution(s)}else n>0?(s.encodings[0].scaleResolutionDownBy=i.videoType===m.DESKTOP||i.resolution<=n?1:Math.floor(i.resolution/n),s.encodings[0].active=!0):(s.encodings[0].scaleResolutionDownBy=void 0,s.encodings[0].active=!1);return w.info(`${this} setting max height=${n},encodings=${JSON.stringify(s.encodings)}`),r.setParameters(s).then(()=>{if(i.maxEnabledResolution=n,this.eventEmitter.emit(h.a.LOCAL_TRACK_MAX_ENABLED_RESOLUTION_CHANGED,i),this.isP2P||!this.isSimulcastOn())return this.setMaxBitRate()})},P.prototype.setVideoTransferActive=function(e){w.debug(`${this} video transfer active: ${e}`);const t=this.videoTransferActive!==e;return this.videoTransferActive=e,this._usesUnifiedPlan?(this.tpcUtils.setVideoTransferActive(e),!1):t},P.prototype.sendTones=function(e,t=200,n=200){if(!this._dtmfSender){if(this.peerconnection.getSenders){const e=this.peerconnection.getSenders().find(e=>e.dtmf);this._dtmfSender=e&&e.dtmf,this._dtmfSender&&w.info(this+" initialized DTMFSender using getSenders")}if(!this._dtmfSender){const e=Array.from(this.localTracks.values()).find(e=>e.isAudioTrack());this.peerconnection.createDTMFSender&&e&&(this._dtmfSender=this.peerconnection.createDTMFSender(e.getTrack())),this._dtmfSender&&w.info(this+" initialized DTMFSender using deprecated createDTMFSender")}this._dtmfSender&&(this._dtmfSender.ontonechange=this._onToneChange.bind(this))}if(this._dtmfSender){if(this._dtmfSender.toneBuffer)return void this._dtmfTonesQueue.push({tones:e,duration:t,interToneGap:n});this._dtmfSender.insertDTMF(e,t,n)}else w.warn(this+" sendTones - failed to select DTMFSender")},P.prototype._onToneChange=function(e){if(this._dtmfSender&&""===e.tone&&this._dtmfTonesQueue.length){const{tones:e,duration:t,interToneGap:n}=this._dtmfTonesQueue.shift();this._dtmfSender.insertDTMF(e,t,n)}},P.prototype.generateRecvonlySsrc=function(){const e=y.a.generateSsrc();w.info(`${this} generated new recvonly SSRC=${e}`),this.sdpConsistency.setPrimarySsrc(e)},P.prototype.clearRecvonlySsrc=function(){w.info(this+" Clearing primary video SSRC!"),this.sdpConsistency.clearVideoSsrcCache()},P.prototype.close=function(){this.trace("stop"),this.signalingLayer.off(p.a,this._peerMutedChanged),this.signalingLayer.off(p.b,this._peerVideoTypeChanged),this._usesUnifiedPlan&&this.peerconnection.removeEventListener("track",this.onTrack);for(const e of this.remoteTracks.values())for(const t of e.values())this._removeRemoteTrack(t);this.remoteTracks.clear(),this._addedStreams=[],this._dtmfSender=null,this._dtmfTonesQueue=[],this.rtc._removePeerConnection(this)||w.error(this+" RTC._removePeerConnection returned false"),null!==this.statsinterval&&(window.clearInterval(this.statsinterval),this.statsinterval=null),w.info(this+" Closing peerconnection"),this.peerconnection.close()},P.prototype.createAnswer=function(e){return this._createOfferOrAnswer(!1,e)},P.prototype.createOffer=function(e){return this._createOfferOrAnswer(!0,e)},P.prototype._createOfferOrAnswer=function(e,t){const n=e?"Offer":"Answer";this.trace("create"+n,JSON.stringify(t,null," "));const i=(e,t,i)=>{try{this.trace(`create${n}OnSuccess::preTransform`,O(e)),this._usesUnifiedPlan||(this.hasAnyTracksOfType(u.c)||this.sdpConsistency.hasPrimarySsrcCached()||this.generateRecvonlySsrc(),e=new RTCSessionDescription({type:e.type,sdp:this.sdpConsistency.makeVideoPrimarySsrcsConsistent(e.sdp)}),this.trace(`create${n}OnSuccess::postTransform (make primary audio/video ssrcs consistent)`,O(e)));const i=this.getLocalVideoTrack();this.isSimulcastOn()&&g.a.usesSdpMungingForSimulcast()&&((null==i?void 0:i.getVideoType())===m.CAMERA||this._usesUnifiedPlan||!this._isSharingLowFpsScreen())&&(e=this.simulcast.mungeLocalDescription(e),this.trace("create"+n+"OnSuccess::postTransform (simulcast)",O(e))),!this.options.disableRtx&&g.a.usesSdpMungingForSimulcast()&&(e=new RTCSessionDescription({type:e.type,sdp:this.rtxModifier.modifyRtxSsrcs(e.sdp)}),this.trace("create"+n+"OnSuccess::postTransform (rtx modifier)",O(e)));const r=this._extractSSRCMap(e);this._processLocalSSRCsMap(r),t(e)}catch(t){this.trace(`create${n}OnError`,t),this.trace(`create${n}OnError`,O(e)),w.error(`${this} create${n}OnError`,t,O(e)),i(t)}},r=(t,i)=>{this.trace(`create${n}OnFailure`,t);const r=e?h.a.CREATE_OFFER_FAILED:h.a.CREATE_ANSWER_FAILED;this.eventEmitter.emit(r,t,this),i(t)};if(this._usesTransceiverCodecPreferences){const e=this.peerconnection.getTransceivers().find(e=>{var t,n;return e.receiver&&(null===(t=e.receiver)||void 0===t||null===(n=t.track)||void 0===n?void 0:n.kind)===u.c});if(e){var s,o,a;let t=null===(s=RTCRtpReceiver.getCapabilities(u.c))||void 0===s?void 0:s.codecs;const n=null===(o=this.codecPreference)||void 0===o?void 0:o.mimeType,i=null===(a=this.codecPreference)||void 0===a?void 0:a.enable;t&&n&&i?t.sort(e=>e.mimeType.toLowerCase()===`${u.c}/${n}`?-1:1):t&&n&&(t=t.filter(e=>e.mimeType.toLowerCase()!==`${u.c}/${n}`));try{e.setCodecPreferences(t)}catch(e){w.warn(`${this} Setting codec[preference=${n},enable=${i}] failed`,e)}}}return new Promise((n,s)=>{let o;o=e?this.peerconnection.createOffer(t):this.peerconnection.createAnswer(t),o.then(e=>i(e,n,s),e=>r(e,s))})},P.prototype._extractPrimarySSRC=function(e){return e&&e.groups&&e.groups.length?e.groups[0].ssrcs[0]:e&&e.ssrcs&&e.ssrcs.length?e.ssrcs[0]:null},P.prototype._processLocalSSRCsMap=function(e){for(const t of this.localTracks.values()){const n=this._usesUnifiedPlan?t.getType():t.storedMSID;if(e.has(n)){const i=e.get(n);if(!i)return void w.error(`${this} No SSRC found for stream=${n}`);const r=this.localSSRCs.get(t.rtcId),s=this._extractPrimarySSRC(i),o=this._extractPrimarySSRC(r);s!==o&&(o&&w.error(`${this} Overwriting SSRC for track=${t}] with ssrc=${i}`),this.localSSRCs.set(t.rtcId,i),this.eventEmitter.emit(h.a.LOCAL_TRACK_SSRC_UPDATED,t,s))}else t.isVideoTrack()||t.isMuted()||w.warn(`${this} No SSRCs found in the local SDP for track=${t}, stream=${n}`)}},P.prototype.addIceCandidate=function(e){return this.trace("addIceCandidate",JSON.stringify({candidate:e.candidate,sdpMid:e.sdpMid,sdpMLineIndex:e.sdpMLineIndex,usernameFragment:e.usernameFragment},null," ")),this.peerconnection.addIceCandidate(e)},P.prototype.getActiveSimulcastStreams=function(){let e=1;var t;this.isSimulcastOn()&&this.encodingsEnabledState?e=null===(t=this.encodingsEnabledState.filter(e=>Boolean(e)))||void 0===t?void 0:t.length:this.isSimulcastOn()&&(e=I.a.length);return e},P.prototype.getStats=function(){return this.peerconnection.getStats()},P.prototype.generateNewStreamSSRCInfo=function(e){const t=e.rtcId;let n=this._getSSRC(t);if(n&&w.error(`${this} Overwriting local SSRCs for track id=${t}`),!this.isSimulcastOn()||e.getVideoType()!==m.CAMERA&&this._isSharingLowFpsScreen())n={ssrcs:[y.a.generateSsrc()],groups:[]};else{n={ssrcs:[],groups:[]};for(let e=0;e<I.a.length;e++)n.ssrcs.push(y.a.generateSsrc());n.groups.push({ssrcs:n.ssrcs.slice(),semantics:"SIM"})}if(!this.options.disableRtx){const e=n.ssrcs.length;for(let t=0;t<e;++t){const e=n.ssrcs[t],i=y.a.generateSsrc();n.ssrcs.push(i),n.groups.push({ssrcs:[e,i],semantics:"FID"})}}return n.msid=e.storedMSID,this.localSSRCs.set(t,n),n},P.prototype.usesUnifiedPlan=function(){return this._usesUnifiedPlan},P.prototype.toString=function(){return`TPC[id=${this.id},type=${this.isP2P?"P2P":"JVB"}]`}}).call(this,"modules/RTC/TraceablePeerConnection.js")},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return d}));var i=n(5),r=n(10),s=n.n(r),o=n(4),a=n(30);const c=Object(i.getLogger)(e);class d{constructor(e,t){this.tpc=e,this.localEndpointId=t}_addMutedLocalVideoTracksToSDP(e){const t=this.tpc.getLocalTracks(o.c);if(!t.length)return!1;1!==t.length&&c.error(this.tpc+" there is more than 1 video track ! Strange things may happen !",t);const n=e.selectMedia("video");if(!n)return c.debug(this.tpc+' unable to hack local video track SDP- no "video" media'),!1;let i=!1;for(const e of t){const t=e.isMuted(),r=e.getOriginalStream(),o=r&&this.tpc.isMediaStreamInPc(r);if(!(t||!o))continue;const a=this.tpc.isSimulcastOn()?this.tpc.simulcast.ssrcCache:[this.tpc.sdpConsistency.cachedPrimarySsrc];if(!a.length){c.error(`No SSRCs stored for: ${e} in ${this.tpc}`);continue}i=!0,n.direction=s.a.SENDRECV;const d="injected-"+a[0];for(const t of a)n.removeSSRC(t),n.addSSRCAttribute({id:t,attribute:"cname",value:d}),n.addSSRCAttribute({id:t,attribute:"msid",value:e.storedMSID});if(a.length>1){const e={ssrcs:a.join(" "),semantics:"SIM"};n.findGroup(e.semantics,e.ssrcs)||n.addSSRCGroup(e)}this.tpc.options.disableRtx||this.tpc.rtxModifier.modifyRtxSsrcs2(n)}return i}_generateMsidAttribute(e,t,n=null){if(!e||!t)return c.warn(`Unable to munge local MSID - track id=${t} or media type=${e} is missing`),null;const i=this.tpc.id;return"-"!==n&&n?`${n}-${i} ${t}-${i}`:`${this.localEndpointId}-${e}-${i} ${t}-${i}`}_transformMediaIdentifiers(e){var t;const n=this.tpc.id;for(const t of e.ssrcs)switch(t.attribute){case"cname":case"label":case"mslabel":t.value=t.value&&`${t.value}-${n}`;break;case"msid":if(t.value){const n=t.value.split(" ");var i;if(2===n.length)t.value=this._generateMsidAttribute(null===(i=e.mLine)||void 0===i?void 0:i.type,n[1],n[0]);else c.warn("Unable to munge local MSID - weird format detected: "+t.value)}}if(!this.tpc.usesUnifiedPlan())return;const r=null===(t=e.mLine)||void 0===t?void 0:t.direction;if(r===s.a.RECVONLY||r===s.a.INACTIVE)e.ssrcs=void 0,e.ssrcGroups=void 0;else{var o,a,d;const t=null===(o=e.mLine)||void 0===o?void 0:o.msid,n=t&&t.split(" ")[1],i=[...new Set(null===(a=e.mLine)||void 0===a||null===(d=a.ssrcs)||void 0===d?void 0:d.map(e=>e.id))];for(const t of i){if(!e.ssrcs.find(e=>e.id===t&&"msid"===e.attribute)){var u;const i=this._generateMsidAttribute(null===(u=e.mLine)||void 0===u?void 0:u.type,n);e.ssrcs.push({id:t,attribute:"msid",value:i})}}}}maybeAddMutedLocalVideoTracksToSDP(e){if(!e)throw new Error("No local description passed in.");const t=new a.a(e.sdp);return this._addMutedLocalVideoTracksToSDP(t)?new RTCSessionDescription({type:e.type,sdp:t.toRawSDP()}):e}transformStreamIdentifiers(e){if(!e||!e.sdp||!e.type)return e;const t=new a.a(e.sdp),n=t.selectMedia("audio");n&&this._transformMediaIdentifiers(n);const i=t.selectMedia("video");return i&&this._transformMediaIdentifiers(i),new RTCSessionDescription({type:e.type,sdp:t.toRawSDP()})}}}).call(this,"modules/sdp/LocalSdpMunger.js")},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return c}));var i=n(5),r=n(9),s=n(30);const o=Object(i.getLogger)(e);function a(e,t,n){const i=t.id,r=t.msid,s=t.cname,o=e.getRtxSSRC(i);o!==n&&(o&&(e.removeSSRC(o),e.removeGroupsWithSSRC(o)),e.addSSRCAttribute({id:n,attribute:"cname",value:s}),e.addSSRCAttribute({id:n,attribute:"msid",value:r}),e.addSSRCGroup({semantics:"FID",ssrcs:`${i} ${n}`}))}class c{constructor(){this.correspondingRtxSsrcs=new Map}clearSsrcCache(){this.correspondingRtxSsrcs.clear()}setSsrcCache(e){o.debug("Setting ssrc cache to ",e),this.correspondingRtxSsrcs=e}modifyRtxSsrcs(e){const t=new s.a(e),n=t.selectMedia("video");return n?this.modifyRtxSsrcs2(n)?t.toRawSDP():e:(o.debug("No 'video' media found in the sdp: "+e),e)}modifyRtxSsrcs2(e){if("recvonly"===e.direction)return!1;if(e.getSSRCCount()<1)return!1;const t=e.getPrimaryVideoSSRCs();for(const n of t){const t=e.getSSRCAttrValue(n,"msid"),i=e.getSSRCAttrValue(n,"cname");let s=this.correspondingRtxSsrcs.get(n);if(!s){const t=e.getRtxSSRC(n);s=t||r.a.generateSsrc(),this.correspondingRtxSsrcs.set(n,s)}a(e,{id:n,cname:i,msid:t},s)}return!0}stripRtx(e){const t=new s.a(e),n=t.selectMedia("video");if(!n)return o.debug("No 'video' media found in the sdp: "+e),e;if("recvonly"===n.direction)return o.debug("RtxModifier doing nothing, video m line is recvonly"),e;if(n.getSSRCCount()<1)return o.debug("RtxModifier doing nothing, no video ssrcs present"),e;if(!n.containsAnySSRCGroups())return o.debug("RtxModifier doing nothing, no video ssrcGroups present"),e;const i=n.findGroups("FID");n.removeGroupsBySemantics("FID");for(const e of i){const t=Object(s.c)(e);n.removeSSRC(t)}return t.toRawSDP()}}}).call(this,"modules/sdp/RtxModifier.js")},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return o}));var i=n(5),r=n(30);const s=Object(i.getLogger)(e);class o{constructor(e){this.clearVideoSsrcCache(),this.logPrefix=e}clearVideoSsrcCache(){this.cachedPrimarySsrc=null,this.injectRecvOnly=!1}setPrimarySsrc(e){if("number"!=typeof e)throw new Error("Primary SSRC must be a number!");this.cachedPrimarySsrc=e}hasPrimarySsrcCached(){return Boolean(this.cachedPrimarySsrc)}makeVideoPrimarySsrcsConsistent(e){const t=new r.a(e),n=t.selectMedia("video");if(!n)return s.debug(`${this.logPrefix} no 'video' media found in the sdp: ${e}`),e;if("recvonly"===n.direction)this.cachedPrimarySsrc&&this.injectRecvOnly?n.addSSRCAttribute({id:this.cachedPrimarySsrc,attribute:"cname",value:"recvonly-"+this.cachedPrimarySsrc}):s.info(this.logPrefix+" no SSRC found for the recvonly video stream!");else{const t=n.getPrimaryVideoSsrc();if(!t)return s.info(this.logPrefix+" sdp-consistency couldn't parse new primary ssrc"),e;if(this.cachedPrimarySsrc){n.replaceSSRC(t,this.cachedPrimarySsrc);for(const e of n.ssrcGroups)if("FID"===e.semantics){const n=Object(r.b)(e),i=Object(r.c)(e);n===t&&(e.ssrcs=`${this.cachedPrimarySsrc} ${i}`)}}else this.cachedPrimarySsrc=t;this.injectRecvOnly=!0}return t.toRawSDP()}}}).call(this,"modules/sdp/SdpConsistency.js")},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return h}));var i=n(16),r=n(8),s=n(6),o=n(66);const a=n(5).getLogger(e),c=n(7);let d=!1,u=!1;const l=["abort","canplay","canplaythrough","emptied","ended","error","loadeddata","loadedmetadata","loadstart","pause","play","playing","ratechange","stalled","suspend","waiting"];class h extends o.a{constructor(e,t,n,i,r,s,o,c,d,u){if(super(t,i,r,()=>{},s,o),this.rtc=e,"number"!=typeof c)throw new TypeError(`SSRC ${c} is not a number`);this.ssrc=c,this.ownerEndpointId=n,this.muted=d,this.isP2P=u,a.debug("New remote track added: "+this),this.hasBeenMuted=d,this.rtc&&this.track&&this._bindTrackHandlers(),this._containerHandlers={},l.forEach(e=>{this._containerHandlers[e]=this._containerEventHandler.bind(this,e)})}_bindTrackHandlers(){this.track.addEventListener("mute",()=>this._onTrackMute()),this.track.addEventListener("unmute",()=>this._onTrackUnmute()),this.track.addEventListener("ended",()=>{a.debug(`"onended" event(${Date.now()}): ${this}`)})}_onTrackMute(){a.debug(`"onmute" event(${Date.now()}): ${this}`),this.rtc.eventEmitter.emit(c.REMOTE_TRACK_MUTE,this)}_onTrackUnmute(){a.debug(`"onunmute" event(${Date.now()}): ${this}`),this.rtc.eventEmitter.emit(c.REMOTE_TRACK_UNMUTE,this)}setMute(e){this.muted!==e&&(e&&(this.hasBeenMuted=!0),this.stream&&(this.stream.muted=e),this.muted=e,this.emit(i.TRACK_MUTE_CHANGED,this))}isMuted(){return this.muted}getParticipantId(){return this.ownerEndpointId}isLocal(){return!1}getSSRC(){return this.ssrc}_setVideoType(e){this.videoType!==e&&(this.videoType=e,this.emit(i.TRACK_VIDEOTYPE_CHANGED,e))}_playCallback(){const e=this.isVideoTrack()?"video":"audio",t=window.performance.now();console.log(`(TIME) Render ${e}:\t`,t),this.conference.getConnectionTimes()[e+".render"]=t;const n=window.connectionTimes["obtainPermissions.start"],i=window.connectionTimes["obtainPermissions.end"],o=isNaN(i)||isNaN(n)?0:i-n,a=t-(this.conference.getConnectionTimes()["session.initiate"]-this.conference.getConnectionTimes()["muc.joined"])-o;this.conference.getConnectionTimes()[e+".ttfm"]=a,console.log(`(TIME) TTFM ${e}:\t`,a),s.a.sendAnalytics(Object(r.N)({media_type:e,muted:this.hasBeenMuted,value:a}))}_attachTTFMTracker(e){d&&this.isAudioTrack()||u&&this.isVideoTrack()||(this.isAudioTrack()&&(d=!0),this.isVideoTrack()&&(u=!0),e.addEventListener("canplay",this._playCallback.bind(this)))}_onTrackAttach(e){a.debug("Track has been attached to a container: "+this),l.forEach(t=>{e.addEventListener(t,this._containerHandlers[t])})}_onTrackDetach(e){a.debug("Track has been detached from a container: "+this),l.forEach(t=>{e.removeEventListener(t,this._containerHandlers[t])})}_containerEventHandler(e){a.debug(`${e} handler was called for a container with attached ${this}`)}_getStatus(){const{enabled:e,muted:t,readyState:n}=this.track;return`readyState: ${n}, muted: ${t}, enabled: ${e}`}toString(){return`RemoteTrack[userID: ${this.getParticipantId()}, type: ${this.getType()}, ssrc: ${this.getSSRC()}, p2p: ${this.isP2P}, status: ${this._getStatus()}]`}}}).call(this,"modules/RTC/JitsiRemoteTrack.js")},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return _}));var i=n(5),r=n(1),s=n(20),o=n.n(s),a=n(7),c=n(32),d=n(3);const u=n(67),l=n(15),h=n(0),p=Object(i.getLogger)(e),m=[{width:1920,height:1080,layers:3,target:"high",targetRN:4e6},{width:1280,height:720,layers:3,target:"high",targetRN:25e5},{width:960,height:540,layers:3,target:"standard",targetRN:9e5},{width:640,height:360,layers:2,target:"standard",targetRN:5e5},{width:480,height:270,layers:2,target:"low",targetRN:35e4},{width:320,height:180,layers:1,target:"low",targetRN:15e4}];let f=800;function g(e,t,n,i){let r=0,s=Math.min(t.height,t.width),a=m.find(e=>e.height<=s);if(a&&e&&i.codec===o.a.VP8)for(s=a.height;s>=180;s/=2){const e=s;if(a=m.find(t=>t.height===e),!a)break;r+=d.a.isReactNative()?a.targetRN:i[a.target]}else a&&(r=d.a.isReactNative()?a.targetRN:i[a.target]);return Math.min(r/1e3,function(e){if(e>6e4)return Number.MAX_SAFE_INTEGER;return f*Math.pow(1.08,e/1e3)}(Math.max(0,n-1e3)))}class _{constructor(e,t,n){var i;this.eventEmitter=t,this._conference=e,this._localStats={connectionQuality:100,jvbRTT:void 0},this._lastConnectionQualityUpdate=-1,this._options=n,this._remoteStats={},this._timeIceConnected=-1,this._timeVideoUnmuted=-1,(null===(i=this._options.config)||void 0===i?void 0:i.startBitrate)>0&&(f=this._options.config.startBitrate),e.on(r.CONNECTION_INTERRUPTED,()=>{this._updateLocalConnectionQuality(0),this.eventEmitter.emit(c.LOCAL_STATS_UPDATED,this._localStats),this._broadcastLocalStats()}),e.room.addListener(h.ICE_CONNECTION_STATE_CHANGED,(e,t)=>{e.isP2P||"connected"!==t||(this._timeIceConnected=window.performance.now())}),e.on(r.ENDPOINT_MESSAGE_RECEIVED,(e,t)=>{"stats"===t.type&&this._updateRemoteStats(e.getId(),t.values)}),e.on(r.ENDPOINT_STATS_RECEIVED,(e,t)=>{this._updateRemoteStats(e.getId(),t)}),e.statistics.addConnectionStatsListener(this._updateLocalStats.bind(this)),e.on(r.TRACK_MUTE_CHANGED,e=>{e.isVideoTrack()&&(e.isMuted()?this._timeVideoUnmuted=-1:this._maybeUpdateUnmuteTime())}),e.on(r.TRACK_ADDED,e=>{e.isVideoTrack()&&!e.isMuted()&&this._maybeUpdateUnmuteTime()}),e.rtc.on(a.LOCAL_TRACK_MAX_ENABLED_RESOLUTION_CHANGED,e=>{this._localStats.maxEnabledResolution=e.maxEnabledResolution}),e.on(r.SERVER_REGION_CHANGED,e=>{this._localStats.serverRegion=e}),e.on(r.PROPERTIES_CHANGED,e=>{this._localStats.bridgeCount=Number((e||{})["bridge-count"])})}_maybeUpdateUnmuteTime(){this._timeVideoUnmuted<0&&(this._timeVideoUnmuted=window.performance.now())}_calculateConnectionQuality(e,t,n){const i=u[n];let r,s=100;if(this._localStats.packetLoss&&(r=this._localStats.packetLoss.upload,t&&(r*=.5)),t||!i||e===l.DESKTOP||this._timeIceConnected<0||this._timeVideoUnmuted<0)void 0===r?(p.error("Cannot calculate connection quality, unknown packet loss."),s=100):s=r<=2?100:r<=4?70:r<=6?50:r<=8?30:r<=12?10:0;else{const e=this._conference.getActivePeerConnection();if(e){var o,a;const t=e.isSimulcastOn(),n=e.getTargetVideoBitrates();n.codec=e.getConfiguredVideoCodec();const r=window.performance.now()-Math.max(this._timeVideoUnmuted,this._timeIceConnected),c=null!==(o=null===(a=this._options.config)||void 0===a?void 0:a.pcStatsInterval)&&void 0!==o?o:1e4;let d=g(t,i,r,n);d=Math.min(d,2500),r>c&&(s=100*this._localStats.bitrate.upload/d)}r&&r>=10&&(s=Math.min(s,30))}if(this._lastConnectionQualityUpdate>0){const e=2,t=this._localStats.connectionQuality,n=(window.performance.now()-this._lastConnectionQualityUpdate)/1e3;s=Math.min(s,t+n*e)}return Math.min(100,s)}_updateLocalConnectionQuality(e){this._localStats.connectionQuality=e,this._lastConnectionQualityUpdate=window.performance.now()}_broadcastLocalStats(){const e={bitrate:this._localStats.bitrate,packetLoss:this._localStats.packetLoss,connectionQuality:this._localStats.connectionQuality,jvbRTT:this._localStats.jvbRTT,serverRegion:this._localStats.serverRegion,maxEnabledResolution:this._localStats.maxEnabledResolution,avgAudioLevels:this._localStats.localAvgAudioLevels};try{this._conference.sendEndpointStatsMessage(e)}catch(e){}}_updateLocalStats(e,t){if(!e.isP2P){const e=t.transport&&t.transport.length&&t.transport[0].rtt;this._localStats.jvbRTT=e||void 0}if(e!==this._conference.getActivePeerConnection())return;let n;const i=!this._conference.isConnectionInterrupted(),r=this._conference.getLocalVideoTrack(),s=r?r.videoType:void 0,o=!r||r.isMuted(),a=r?Math.min(r.resolution,r.maxEnabledResolution):null;for(n in o||this._maybeUpdateUnmuteTime(),t)t.hasOwnProperty(n)&&(this._localStats[n]=t[n]);i&&this._updateLocalConnectionQuality(this._calculateConnectionQuality(s,o,a)),this.eventEmitter.emit(c.LOCAL_STATS_UPDATED,this._localStats),this._broadcastLocalStats()}_updateRemoteStats(e,t){this._remoteStats[e]={bitrate:t.bitrate,packetLoss:t.packetLoss,connectionQuality:t.connectionQuality,jvbRTT:t.jvbRTT,serverRegion:t.serverRegion,maxEnabledResolution:t.maxEnabledResolution,avgAudioLevels:t.avgAudioLevels},this.eventEmitter.emit(c.REMOTE_STATS_UPDATED,e,this._remoteStats[e])}getStats(){return this._localStats}}}).call(this,"modules/connectivity/ConnectionQuality.js")},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return a}));var i=n(5),r=n(17),s=n(1);const o=Object(i.getLogger)(e);class a{constructor(e){this._conference=e}_actOnIceFailed(){const{enableForcedReload:e,enableIceRestart:t}=this._conference.options.config,n=void 0!==t&&!t,i=this._conference.room.supportsRestartByTerminate(),a=i&&!t,c=this._conference.restartInProgress&&e;if(o.info(`ICE failed, enableForcedReload: ${e}, enableIceRestart: ${t}, restartInProgress: ${this._conference.restartInProgress}, supports restart by terminate: `+i),n||!t&&!i||c)return o.info("ICE failed, but ICE restarts are disabled"),void this._conference.eventEmitter.emit(s.CONFERENCE_FAILED,r.ICE_FAILED);const d=this._conference.jvbJingleSession,u=d&&d.getIceConnectionState();d?"connected"===u?o.info("ICE connection restored - not sending ICE failed"):(o.info(`Sending ICE failed - the connection did not recover, ICE state: ${u}, use 'session-terminate': `+a),a?this._conference.jvbJingleSession.terminate(()=>{o.info("session-terminate for ice restart - done")},e=>{o.error("session-terminate for ice restart - error: "+e.message)},{reason:"connectivity-error",reasonDescription:"ICE FAILED",requestRestart:!0,sendSessionTerminate:!0}):this._conference.jvbJingleSession.sendIceFailedNotification()):o.warn("Not sending ICE failed - no JVB connection")}start(){this._conference.xmpp.ping(65e3).then(()=>{this._canceled||(this._iceFailedTimeout=window.setTimeout(()=>{this._iceFailedTimeout=void 0,this._actOnIceFailed()},2e3))},e=>{o.error("PING error/timeout - not sending ICE failed",e)})}cancel(){this._canceled=!0,window.clearTimeout(this._iceFailedTimeout)}}}).call(this,"modules/connectivity/IceFailedHandling.js")},function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var i=n(19),r=n.n(i),s=n(1),o=n(16),a=n(3),c=n(23);class d extends r.a{constructor(e){super(),this._conference=e,this._timeoutTrigger=null,this._hasAudioInput=null,a.a.supportsReceiverStats()||e.statistics.addAudioLevelListener(this._audioLevel.bind(this)),e.on(s.TRACK_ADDED,this._trackAdded.bind(this))}_clearTriggerTimeout(){clearTimeout(this._timeoutTrigger),this._timeoutTrigger=null}_handleAudioInputStateChange(e){const t=0!==e;null!==this._hasAudioInput&&this._hasAudioInput===t||(this._hasAudioInput=t,this.emit(c.AUDIO_INPUT_STATE_CHANGE,this._hasAudioInput))}_handleNoAudioInputDetection(e){this._eventFired||(0!==e||this._timeoutTrigger?0!==e&&this._timeoutTrigger&&this._clearTriggerTimeout():this._timeoutTrigger=setTimeout(()=>{this._eventFired=!0,this.emit(c.NO_AUDIO_INPUT)},4e3))}_audioLevel(e,t,n,i){if(!i||!this._audioTrack)return;const r=e.localSSRCs.get(this._audioTrack.rtcId);r&&r.ssrcs.includes(t)&&(this._handleAudioInputStateChange(n),this._handleNoAudioInputDetection(n))}_trackAdded(e){e.isLocalAudioTrack()&&(this._audioTrack=e,this._eventFired=!1,this._clearTriggerTimeout(),a.a.supportsReceiverStats()&&(e.on(o.NO_AUDIO_INPUT,e=>{this._handleNoAudioInputDetection(e)}),e.on(o.TRACK_AUDIO_LEVEL_CHANGED,e=>{this._handleNoAudioInputDetection(e),this._handleAudioInputStateChange(e)})))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var i=n(1),r=n(7),s=n.n(r);class o{constructor(e){this.conference=e,e.addEventListener(i.TRACK_AUDIO_LEVEL_CHANGED,this._audioLevel.bind(this)),this.myUserID=this.conference.myUserId()}_audioLevel(e,t){!this.conference.isP2PActive()||t<=.6||e===this.myUserID&&this.conference.getLocalAudioTrack().isMuted()||this.conference.rtc.eventEmitter.emit(s.a.DOMINANT_SPEAKER_CHANGED,e)}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var i=n(19),r=n(31),s=n(23);class o extends i.EventEmitter{constructor(){super(),this._processing=!1,this._scoreArray=[],this._audioLvlArray=[],this._active=!1,this._calculateNoisyScore=this._calculateNoisyScore.bind(this)}_calculateNoisyScore(){const e=Object(r.b)(this._scoreArray),t=Object(r.b)(this._audioLvlArray);e<.2&&t>.04&&(this.emit(s.VAD_NOISY_DEVICE),this._setActiveState(!1)),this.reset()}_recordValues(e,t){this._scoreArray.push(e),this._audioLvlArray.push(t)}_setActiveState(e){this._active=e,this.emit(s.DETECTOR_STATE_CHANGE,this._active)}changeMuteState(e){this._setActiveState(!e),this.reset()}isActive(){return this._active}reset(){this._processing=!1,this._scoreArray=[],this._audioLvlArray=[],clearTimeout(this._processTimeout)}processVADScore(e){if(this._active)if(this._processing){const t=Object(r.c)(e.pcmData);this._recordValues(e.score,Object(r.b)(t))}else if(e.score<.2){const t=Object(r.c)(e.pcmData),n=Object(r.b)(t);n>.02&&(this._processing=!0,this._recordValues(e.score,n),this._processTimeout=setTimeout(this._calculateNoisyScore,1500))}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var i=n(19),r=n(31),s=n(23);class o extends i.EventEmitter{constructor(){super(),this._processing=!1,this._scoreArray=[],this._active=!1,this._calculateVADScore=this._calculateVADScore.bind(this)}_calculateVADScore(){Object(r.b)(this._scoreArray)>.6&&(this.emit(s.VAD_TALK_WHILE_MUTED),this._setActiveState(!1)),this.reset()}_setActiveState(e){this._active=e,this.emit(s.DETECTOR_STATE_CHANGE,this._active)}changeMuteState(e){this._setActiveState(e),this.reset()}isActive(){return this._active}processVADScore(e){this._active&&(this._processing?this._scoreArray.push(e.score):e.score>.9&&(this._processing=!0,this._scoreArray.push(e.score),this._processTimeout=setTimeout(this._calculateVADScore,700)))}reset(){this._processing=!1,this._scoreArray=[],clearTimeout(this._processTimeout)}}},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return u}));var i=n(5),r=n(1),s=n(70),o=n(8),a=n(6);const c=Object(i.getLogger)(e);class d{constructor(e,t){this.participant=e,this.e2eping=t,this.id=e.getId(),this.requests={},this.lastRequestId=1,this.clearIntervals=this.clearIntervals.bind(this),this.sendRequest=this.sendRequest.bind(this),this.handleResponse=this.handleResponse.bind(this),this.maybeSendAnalytics=this.maybeSendAnalytics.bind(this),this.sendAnalytics=this.sendAnalytics.bind(this),t.isDataChannelOpen&&this.sendRequest(),this.pingInterval=window.setInterval(this.sendRequest,t.pingIntervalMs),this.analyticsInterval=window.setTimeout(this.maybeSendAnalytics,this.e2eping.analyticsIntervalMs)}clearIntervals(){this.pingInterval&&window.clearInterval(this.pingInterval),this.analyticsInterval&&window.clearInterval(this.analyticsInterval)}sendRequest(){const e=this.lastRequestId++,t={type:"e2e-ping-request",id:e};this.e2eping.sendMessage(t,this.id),this.requests[e]={id:e,timeSent:window.performance.now()}}handleResponse(e){const t=this.requests[e.id];t&&(t.rtt=window.performance.now()-t.timeSent,this.e2eping.eventEmitter.emit(s.E2E_RTT_CHANGED,this.participant,t.rtt)),this.maybeSendAnalytics()}maybeSendAnalytics(){const e=window.performance.now();let t,n,i=1/0;for(n in this.requests)this.requests.hasOwnProperty(n)&&(t=this.requests[n],t.timeSent<e-this.e2eping.analyticsIntervalMs?delete this.requests[n]:t.rtt&&(i=Math.min(i,t.rtt)));i<1/0&&this.sendAnalytics(i)}sendAnalytics(e){a.a.sendAnalytics(Object(o.D)(this.id,this.participant.getProperty("region"),e))}}class u{constructor(e,t,n){this.conference=e,this.eventEmitter=e.eventEmitter,this.sendMessage=n,this.pingIntervalMs=1e4,this.analyticsIntervalMs=6e4,this.participants={},this.isDataChannelOpen=!1,t&&t.e2eping&&("number"==typeof t.e2eping.pingInterval&&(this.pingIntervalMs=t.e2eping.pingInterval),"number"==typeof t.e2eping.analyticsInterval&&(this.analyticsIntervalMs=t.e2eping.analyticsInterval),this.analyticsIntervalMs>0&&this.analyticsIntervalMs<this.pingIntervalMs&&(this.analyticsIntervalMs=this.pingIntervalMs)),c.info(`Initializing e2e ping; pingInterval=${this.pingIntervalMs}, analyticsInterval=${this.analyticsIntervalMs}.`),this.participantJoined=this.participantJoined.bind(this),e.on(r.USER_JOINED,this.participantJoined),this.participantLeft=this.participantLeft.bind(this),e.on(r.USER_LEFT,this.participantLeft),this.messageReceived=this.messageReceived.bind(this),e.on(r.ENDPOINT_MESSAGE_RECEIVED,this.messageReceived),this.dataChannelOpened=this.dataChannelOpened.bind(this),e.on(r.DATA_CHANNEL_OPENED,this.dataChannelOpened)}dataChannelOpened(){this.isDataChannelOpen=!0;for(const e in this.participants)if(this.participants.hasOwnProperty(e)){const t=this.participants[e];window.setTimeout(t.sendRequest,200)}}messageReceived(e,t){"e2e-ping-request"===t.type?this.handleRequest(e.getId(),t):"e2e-ping-response"===t.type&&this.handleResponse(e.getId(),t)}participantJoined(e,t){this.pingIntervalMs<=0||(this.participants[e]&&(c.info(`Participant wrapper already exists for ${e}. Clearing.`),this.participants[e].clearIntervals(),delete this.participants[e]),this.participants[e]=new d(t,this))}participantLeft(e){this.pingIntervalMs<=0||this.participants[e]&&(this.participants[e].clearIntervals(),delete this.participants[e])}handleRequest(e,t){if(t&&t.id){const n={type:"e2e-ping-response",id:t.id};this.sendMessage(n,e)}else c.info(`Received an invalid e2e ping request from ${e}.`)}handleResponse(e,t){const n=this.participants[e];n&&n.handleResponse(t)}stop(){c.info("Stopping e2eping"),this.conference.off(r.USER_JOINED,this.participantJoined),this.conference.off(r.USER_LEFT,this.participantLeft),this.conference.off(r.ENDPOINT_MESSAGE_RECEIVED,this.messageReceived),this.conference.off(r.DATA_CHANNEL_OPENED,this.dataChannelOpened);for(const e in this.participants)this.participants.hasOwnProperty(e)&&this.participants[e].clearIntervals();this.participants={}}}}).call(this,"modules/e2eping/e2eping.js")},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return o}));var i=n(5),r=n(1);const s=Object(i.getLogger)(e);class o{constructor(e){this._conference=e,this._jvb121=!0,this._conference.addEventListener(r.USER_JOINED,()=>this.evaluateStatus()),this._conference.addEventListener(r.USER_LEFT,()=>this.evaluateStatus()),this._conference.addEventListener(r.P2P_STATUS,()=>this.evaluateStatus())}evaluateStatus(){const e=this._jvb121,t=!this._conference.isP2PActive()&&this._conference.getParticipantCount()<=2;e!==t&&(this._jvb121=t,s.debug(`JVB121 status ${e} => ${t}`),this._conference.eventEmitter.emit(r.JVB121_STATUS,e,t))}}}).call(this,"modules/event/Jvb121EventGenerator.js")},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return d}));var i=n(5),r=n(33),s=n.n(r),o=n(1);const a=Object(i.getLogger)(e);class c{constructor(){this._defaultConstraints={maxHeight:180},this._lastN=-1,this._maxFrameHeight=2160,this._selectedEndpoints=[],this._receiverVideoConstraints={constraints:{},defaultConstraints:this.defaultConstraints,lastN:this._lastN,onStageEndpoints:[],selectedEndpoints:this._selectedEndpoints}}get constraints(){return this._receiverVideoConstraints.lastN=this._lastN,this._selectedEndpoints.length?(this._receiverVideoConstraints.constraints={},this._selectedEndpoints.length>1?(this._receiverVideoConstraints.defaultConstraints={maxHeight:this._maxFrameHeight},this._receiverVideoConstraints.onStageEndpoints=[],this._receiverVideoConstraints.selectedEndpoints=[]):(this._receiverVideoConstraints.constraints[this._selectedEndpoints[0]]={maxHeight:this._maxFrameHeight},this._receiverVideoConstraints.defaultConstraints=this._defaultConstraints,this._receiverVideoConstraints.onStageEndpoints=this._selectedEndpoints,this._receiverVideoConstraints.selectedEndpoints=[]),this._receiverVideoConstraints):this._receiverVideoConstraints}updateLastN(e){const t=this._lastN!==e;return t&&(this._lastN=e,a.debug(`Updating ReceiverVideoConstraints lastN(${e})`)),t}updateReceiveResolution(e){const t=this._maxFrameHeight!==e;return t&&(this._maxFrameHeight=e,a.debug("Updating receive maxFrameHeight: "+e)),t}updateReceiverVideoConstraints(e){const t=!s()(this._receiverVideoConstraints,e);return t&&(this._receiverVideoConstraints=e,a.debug("Updating ReceiverVideoConstraints "+JSON.stringify(e))),t}updateSelectedEndpoints(e){a.debug("Updating selected endpoints: "+JSON.stringify(e)),this._selectedEndpoints=e}}class d{constructor(e,t){var n,i;this._conference=e,this._rtc=t;const{config:r}=e.options;this._lastN=null!==(n=null==r?void 0:r.startLastN)&&void 0!==n?n:(null==r?void 0:r.channelLastN)||-1,this._maxFrameHeight=2160;if(null===(i=null==r?void 0:r.useNewBandwidthAllocationStrategy)||void 0===i||i){this._receiverVideoConstraints=new c;this._receiverVideoConstraints.updateLastN(this._lastN)&&this._rtc.setNewReceiverVideoConstraints(this._receiverVideoConstraints.constraints)}else this._rtc.setLastN(this._lastN);this._selectedEndpoints=[],this._conference.on(o._MEDIA_SESSION_STARTED,e=>this._onMediaSessionStarted(e))}_onMediaSessionStarted(e){e.isP2P||!this._receiverVideoConstraints?e.setReceiverVideoConstraint(this._maxFrameHeight):(this._receiverVideoConstraints.updateReceiveResolution(this._maxFrameHeight),this._rtc.setNewReceiverVideoConstraints(this._receiverVideoConstraints.constraints))}getLastN(){return this._lastN}selectEndpoints(e){if(this._selectedEndpoints=e,this._receiverVideoConstraints){const t=e.filter(e=>e!==this._conference.myUserId()),n=JSON.parse(JSON.stringify(this._receiverVideoConstraints.constraints));t.length&&this._receiverVideoConstraints.updateSelectedEndpoints(t);const i=this._receiverVideoConstraints.constraints;s()(i,n)||this._rtc.setNewReceiverVideoConstraints(i)}else this._rtc.selectEndpoints(e)}setLastN(e){if(this._lastN!==e){if(this._lastN=e,this._receiverVideoConstraints){return void(this._receiverVideoConstraints.updateLastN(e)&&this._rtc.setNewReceiverVideoConstraints(this._receiverVideoConstraints.constraints))}this._rtc.setLastN(e)}}setPreferredReceiveMaxFrameHeight(e){this._maxFrameHeight=e;for(const t of this._conference._getMediaSessions())if(t.isP2P||!this._receiverVideoConstraints)e&&t.setReceiverVideoConstraint(e);else{this._receiverVideoConstraints.updateReceiveResolution(e)&&this._rtc.setNewReceiverVideoConstraints(this._receiverVideoConstraints.constraints)}}setReceiverConstraints(e){this._receiverVideoConstraints||(this._receiverVideoConstraints=new c);if(this._receiverVideoConstraints.updateReceiverVideoConstraints(e)){var t,n;this._lastN=null!==(t=e.lastN)&&void 0!==t?t:this._lastN,this._selectedEndpoints=null!==(n=e.selectedEndpoints)&&void 0!==n?n:this._selectedEndpoints,this._rtc.setNewReceiverVideoConstraints(e);const s=this._conference._getMediaSessions().find(e=>e.isP2P);if(s){var i;let t=null===(i=Object.values(e.constraints)[0])||void 0===i?void 0:i.maxHeight;var r;if(!t)t=null===(r=e.defaultConstraints)||void 0===r?void 0:r.maxHeight;t&&s.setReceiverVideoConstraint(t)}}}}}).call(this,"modules/qualitycontrol/ReceiveVideoController.js")},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n(1),r=n(7),s=n.n(r),o=n(65);class a{constructor(e,t){var n,r;this.conference=e,this.layerSuspensionEnabled=null===(n=e.options)||void 0===n||null===(r=n.config)||void 0===r?void 0:r.enableLayerSuspension,this.rtc=t,this.conference.on(i._MEDIA_SESSION_STARTED,e=>this._onMediaSessionStarted(e)),this.conference.on(i._MEDIA_SESSION_ACTIVE_CHANGED,()=>this._propagateSendMaxFrameHeight()),this.rtc.on(s.a.SENDER_VIDEO_CONSTRAINTS_CHANGED,e=>{var t;(null===(t=this._senderVideoConstraints)||void 0===t?void 0:t.idealHeight)!==e.idealHeight&&(this._senderVideoConstraints=e,this._propagateSendMaxFrameHeight())})}_onMediaSessionStarted(e){e.addListener(o.a.REMOTE_VIDEO_CONSTRAINTS_CHANGED,e=>{e===this.conference._getActiveMediaSession()&&this._propagateSendMaxFrameHeight()}),e.setSenderVideoDegradationPreference(),e.setSenderMaxBitrates()}_propagateSendMaxFrameHeight(){const e=this.selectSendMaxFrameHeight(),t=[];if(e>=0)for(const n of this.conference._getMediaSessions())t.push(n.setSenderVideoConstraint(e));return Promise.all(t)}selectSendMaxFrameHeight(){var e;const t=this.conference._getActiveMediaSession(),n=t?t.isP2P?t.getRemoteRecvMaxFrameHeight():this.layerSuspensionEnabled?null===(e=this._senderVideoConstraints)||void 0===e?void 0:e.idealHeight:void 0:void 0;return this.preferredSendMaxFrameHeight>=0&&n>=0?Math.min(this.preferredSendMaxFrameHeight,n):n>=0?n:this.preferredSendMaxFrameHeight}setPreferredSendMaxFrameHeight(e){return this.preferredSendMaxFrameHeight=e,this._propagateSendMaxFrameHeight()}}},function(e,t,n){"use strict";(function(e){var i=n(5),r=n(0),s=n.n(r),o=n(80),a=n(54);function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const d=Object(i.getLogger)(e);t.a=class{constructor(e){this._sessions={},this._chatRoom=e,this.onPresence=this.onPresence.bind(this),this._chatRoom.eventEmitter.addListener(s.a.PRESENCE_RECEIVED,this.onPresence)}getSession(e){return this._sessions[e]}onPresence({fromHiddenDomain:e,presence:t}){a.a.isFromFocus(t)?this._handleFocusPresence(t):e&&this._handleJibriPresence(t)}startRecording(e){const t=new o.a(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){c(e,t,n[t])}))}return e}({},e,{connection:this._chatRoom.connection}));return t.start({appData:e.appData,broadcastId:e.broadcastId,focusMucJid:this._chatRoom.focusMucJid,streamId:e.streamId}).then(()=>(this.getSession(t.getID())||(this._addSession(t),this._emitSessionUpdate(t)),t)).catch(e=>(this._emitSessionUpdate(t),Promise.reject(e)))}stopRecording(e){const t=this.getSession(e);return t?t.stop({focusMucJid:this._chatRoom.focusMucJid}):Promise.reject(new Error("Could not find session"))}_addSession(e){this._sessions[e.getID()]=e}_createSession(e,t,n){const i=new o.a({connection:this._chatRoom.connection,focusMucJid:this._chatRoom.focusMucJid,mode:n,sessionID:e,status:t});return this._addSession(i),i}_emitSessionUpdate(e,t){this._chatRoom.eventEmitter.emit(s.a.RECORDER_STATE_CHANGED,e,t)}_handleFocusPresence(e){const t=a.a.getFocusRecordingUpdate(e);if(!t)return;const{error:n,initiator:i,recordingMode:r,sessionID:s,status:o}=t;let c=this.getSession(s);c||"off"!==o?c&&c.getStatus()===o&&c.getError()===n?d.warn("Ignoring duplicate presence update: ",JSON.stringify(t)):(c||(c=this._createSession(s,o,r)),c.setStatus(o),n&&c.setError(n),this._emitSessionUpdate(c,i)):d.warn("Ignoring recording presence update","Received a new session with status off.")}_handleJibriPresence(e){const{liveStreamViewURL:t,mode:n,sessionID:i}=a.a.getHiddenDomainUpdate(e);if(!i)return void d.warn("Ignoring potential jibri presence due to no session id.");let r=this.getSession(i);r||(r=this._createSession(i,"",n)),r.setLiveStreamViewURL(t),this._emitSessionUpdate(r)}}}).call(this,"modules/recording/RecordingManager.js")},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return u}));var i=n(5),r=n(1),s=n(4),o=n(32),a=n(8),c=n(6);const d=Object(i.getLogger)(e);class u{constructor(e){this._conference=e,this._localAudioLevelCache={},this._reportedParticipants=[],this._audioProblemCandidates={},this._numberOfRemoteAudioLevelsReceived={},this._onLocalAudioLevelsReport=this._onLocalAudioLevelsReport.bind(this),this._onRemoteAudioLevelReceived=this._onRemoteAudioLevelReceived.bind(this),this._clearUserData=this._clearUserData.bind(this),this._conference.on(o.REMOTE_STATS_UPDATED,this._onRemoteAudioLevelReceived),this._conference.statistics.addConnectionStatsListener(this._onLocalAudioLevelsReport),this._conference.on(r.USER_LEFT,this._clearUserData)}_onRemoteAudioLevelReceived(e,{avgAudioLevels:t}){const n=this._numberOfRemoteAudioLevelsReceived[e]+1||0;if(this._numberOfRemoteAudioLevelsReceived[e]=n,-1!==this._reportedParticipants.indexOf(e)||e in this._audioProblemCandidates||t<=0||n<3)return;const i=this._conference.getParticipantById(e);if(i){if(i.getTracksByMediaType(s.a).length>0&&i.isAudioMuted())return}const r=this._localAudioLevelCache[e];Array.isArray(r)&&!r.every(e=>0===e)||(this._audioProblemCandidates[e]={remoteAudioLevels:t,localAudioLevels:[]})}_onLocalAudioLevelsReport(e,{avgAudioLevels:t}){e===this._conference.getActivePeerConnection()&&(Object.keys(t).forEach(e=>{if(-1!==this._reportedParticipants.indexOf(e))return;const n=this._localAudioLevelCache[e];Array.isArray(n)?n.length>=2&&n.shift():this._localAudioLevelCache[e]=[],this._localAudioLevelCache[e].push(t[e])}),Object.keys(this._audioProblemCandidates).forEach(e=>{const{localAudioLevels:n,remoteAudioLevels:i}=this._audioProblemCandidates[e];if(n.push(t[e]),2===n.length){if(n.every(e=>void 0===e||0===e)){const t=JSON.stringify(n);c.a.sendAnalytics(Object(a.x)(e,t,i)),d.warn(`A potential problem is detected with the audio output for participant ${e}, local audio levels: ${t}, remote audio levels: ${i}`),this._reportedParticipants.push(e),this._clearUserData(e)}delete this._audioProblemCandidates[e]}}))}_clearUserData(e){delete this._localAudioLevelCache[e]}dispose(){this._conference.off(o.REMOTE_STATS_UPDATED,this._onRemoteAudioLevelReceived),this._conference.off(r.USER_LEFT,this._clearUserData),this._conference.statistics.removeConnectionStatsListener(this._onLocalAudioLevelsReport),this._localAudioLevelCache=void 0,this._audioProblemCandidates=void 0,this._reportedParticipants=void 0,this._numberOfRemoteAudioLevelsReceived=void 0,this._conference=void 0}}}).call(this,"modules/statistics/AudioOutputProblemDetector.js")},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return g}));var i=n(5),r=n(33),s=n.n(r),o=n(1),a=n(4),c=n(15),d=n(32),u=n(8),l=n(3),h=n(6);const p=Object(i.getLogger)(e);class m{constructor(e){this.name=e,this.count=0,this.sum=0,this.samples=[]}addNext(e){"number"!=typeof e?p.error(`${this.name} - invalid value for idx: ${this.count}`,e):isNaN(e)||(this.sum+=e,this.samples.push(e),this.count+=1)}calculate(){return this.sum/this.count}appendReport(e){e[this.name+"_avg"]=this.calculate(),e[this.name+"_samples"]=JSON.stringify(this.samples)}reset(){this.samples=[],this.sum=0,this.count=0}}class f{constructor(e,t,n){this.isP2P=t,this._n=n,this._sampleIdx=0,this._avgRTT=new m("rtt"),this._avgRemoteRTTMap=new Map,this._avgRtpStatsReporter=e,this._avgEnd2EndRTT=void 0,this._onConnectionStats=(e,t)=>{this.isP2P===e.isP2P&&this._calculateAvgStats(t)};const i=e._conference;i.statistics.addConnectionStatsListener(this._onConnectionStats),this.isP2P||(this._onUserLeft=e=>this._avgRemoteRTTMap.delete(e),i.on(o.USER_LEFT,this._onUserLeft),this._onRemoteStatsUpdated=(e,t)=>this._processRemoteStats(e,t),i.on(d.REMOTE_STATS_UPDATED,this._onRemoteStatsUpdated))}_calculateAvgStats(e){if(e){if(l.a.supportsRTTStatistics()&&e.transport&&e.transport.length&&this._avgRTT.addNext(e.transport[0].rtt),this._sampleIdx+=1,this._sampleIdx>=this._n){if(l.a.supportsRTTStatistics()){const t=this._avgRtpStatsReporter._conference,n={p2p:this.isP2P,conference_size:t.getParticipantCount()};if(e.transport&&e.transport.length&&Object.assign(n,{local_candidate_type:e.transport[0].localCandidateType,remote_candidate_type:e.transport[0].remoteCandidateType,transport_type:e.transport[0].type}),this._avgRTT.appendReport(n),this.isP2P){const e=this._avgRtpStatsReporter.jvbStatsMonitor._avgEnd2EndRTT;isNaN(e)||(n.rtt_diff=this._avgRTT.calculate()-e)}else{const e=this._calculateAvgRemoteRTT(),t=this._avgRTT.calculate();this._avgEnd2EndRTT=t+e,isNaN(t)||isNaN(e)||(n.end2end_rtt_avg=this._avgEnd2EndRTT)}h.a.sendAnalytics(Object(u.L)(n))}this._resetAvgStats()}}else p.error("No stats")}_calculateAvgRemoteRTT(){let e=0,t=0;for(const n of this._avgRemoteRTTMap.values()){const i=n.calculate();isNaN(i)||(t+=i,e+=1,n.reset())}return t/e}_processRemoteStats(e,t){const n="number"==typeof t.jvbRTT;let i=this._avgRemoteRTTMap.get(e);!i&&n&&(i=new m(e+"_stat_rtt"),this._avgRemoteRTTMap.set(e,i)),n?i.addNext(t.jvbRTT):i&&this._avgRemoteRTTMap.delete(e)}_resetAvgStats(){this._avgRTT.reset(),this._avgRemoteRTTMap&&this._avgRemoteRTTMap.clear(),this._sampleIdx=0}dispose(){const e=this._avgRtpStatsReporter._conference;e.statistics.removeConnectionStatsListener(this._onConnectionStats),this.isP2P||(e.off(d.REMOTE_STATS_UPDATED,this._onRemoteStatsUpdated),e.off(o.USER_LEFT,this._onUserLeft))}}class g{constructor(e,t){this._n=t,t>0?(p.info(`Avg RTP stats will be calculated every ${t} samples`),this._sampleIdx=0,this._conference=e,this._avgAudioBitrateUp=new m("bitrate_audio_upload"),this._avgAudioBitrateDown=new m("bitrate_audio_download"),this._avgVideoBitrateUp=new m("bitrate_video_upload"),this._avgVideoBitrateDown=new m("bitrate_video_download"),this._avgBandwidthUp=new m("bandwidth_upload"),this._avgBandwidthDown=new m("bandwidth_download"),this._avgPacketLossTotal=new m("packet_loss_total"),this._avgPacketLossUp=new m("packet_loss_upload"),this._avgPacketLossDown=new m("packet_loss_download"),this._avgRemoteFPS=new m("framerate_remote"),this._avgRemoteScreenFPS=new m("framerate_screen_remote"),this._avgLocalFPS=new m("framerate_local"),this._avgLocalScreenFPS=new m("framerate_screen_local"),this._avgRemoteCameraPixels=new m("pixels_remote"),this._avgRemoteScreenPixels=new m("pixels_screen_remote"),this._avgLocalCameraPixels=new m("pixels_local"),this._avgLocalScreenPixels=new m("pixels_screen_local"),this._avgCQ=new m("connection_quality"),this._cachedTransportStats=void 0,this._onLocalStatsUpdated=e=>{this._calculateAvgStats(e),this._maybeSendTransportAnalyticsEvent(e)},e.on(d.LOCAL_STATS_UPDATED,this._onLocalStatsUpdated),this._onP2PStatusChanged=()=>{p.debug("Resetting average stats calculation"),this._resetAvgStats(),this.jvbStatsMonitor._resetAvgStats(),this.p2pStatsMonitor._resetAvgStats()},e.on(o.P2P_STATUS,this._onP2PStatusChanged),this._onJvb121StatusChanged=(e,t)=>{!0===t&&(p.info("Resetting JVB avg RTP stats"),this._resetAvgJvbStats())},e.on(o.JVB121_STATUS,this._onJvb121StatusChanged),this.jvbStatsMonitor=new f(this,!1,t),this.p2pStatsMonitor=new f(this,!0,t)):p.info("Avg RTP stats reports are disabled.")}_calculateAvgStats(e){if(!e)return void p.error("No stats");const t=this._conference.isP2PActive(),n=this._conference.getParticipantCount();if(!t&&n<2)return;const i=e.bitrate,r=e.bandwidth,s=e.packetLoss,o=e.framerate,a=e.resolution;if(i)if(r)if(s)if(o)if(a){if(this._avgAudioBitrateUp.addNext(i.audio.upload),this._avgAudioBitrateDown.addNext(i.audio.download),this._avgVideoBitrateUp.addNext(i.video.upload),this._avgVideoBitrateDown.addNext(i.video.download),l.a.supportsBandwidthStatistics()&&(this._avgBandwidthUp.addNext(r.upload),this._avgBandwidthDown.addNext(r.download)),this._avgPacketLossUp.addNext(s.upload),this._avgPacketLossDown.addNext(s.download),this._avgPacketLossTotal.addNext(s.total),this._avgCQ.addNext(e.connectionQuality),o&&(this._avgRemoteFPS.addNext(this._calculateAvgVideoFps(o,!1,c.CAMERA)),this._avgRemoteScreenFPS.addNext(this._calculateAvgVideoFps(o,!1,c.DESKTOP)),this._avgLocalFPS.addNext(this._calculateAvgVideoFps(o,!0,c.CAMERA)),this._avgLocalScreenFPS.addNext(this._calculateAvgVideoFps(o,!0,c.DESKTOP))),a&&(this._avgRemoteCameraPixels.addNext(this._calculateAvgVideoPixels(a,!1,c.CAMERA)),this._avgRemoteScreenPixels.addNext(this._calculateAvgVideoPixels(a,!1,c.DESKTOP)),this._avgLocalCameraPixels.addNext(this._calculateAvgVideoPixels(a,!0,c.CAMERA)),this._avgLocalScreenPixels.addNext(this._calculateAvgVideoPixels(a,!0,c.DESKTOP))),this._sampleIdx+=1,this._sampleIdx>=this._n){const i={p2p:t,conference_size:n};e.transport&&e.transport.length&&Object.assign(i,{local_candidate_type:e.transport[0].localCandidateType,remote_candidate_type:e.transport[0].remoteCandidateType,transport_type:e.transport[0].type}),this._avgAudioBitrateUp.appendReport(i),this._avgAudioBitrateDown.appendReport(i),this._avgVideoBitrateUp.appendReport(i),this._avgVideoBitrateDown.appendReport(i),l.a.supportsBandwidthStatistics()&&(this._avgBandwidthUp.appendReport(i),this._avgBandwidthDown.appendReport(i)),this._avgPacketLossUp.appendReport(i),this._avgPacketLossDown.appendReport(i),this._avgPacketLossTotal.appendReport(i),this._avgRemoteFPS.appendReport(i),isNaN(this._avgRemoteScreenFPS.calculate())||this._avgRemoteScreenFPS.appendReport(i),this._avgLocalFPS.appendReport(i),isNaN(this._avgLocalScreenFPS.calculate())||this._avgLocalScreenFPS.appendReport(i),this._avgRemoteCameraPixels.appendReport(i),isNaN(this._avgRemoteScreenPixels.calculate())||this._avgRemoteScreenPixels.appendReport(i),this._avgLocalCameraPixels.appendReport(i),isNaN(this._avgLocalScreenPixels.calculate())||this._avgLocalScreenPixels.appendReport(i),this._avgCQ.appendReport(i),h.a.sendAnalytics(Object(u.L)(i)),this._resetAvgStats()}}else p.error("No resolution");else p.error('No "framerate"');else p.error('No "packetloss"');else p.error('No "bandwidth"');else p.error('No "bitrate"')}_calculateAvgVideoPixels(e,t,n){let i=0,r=0;const s=this._conference.myUserId();for(const o of Object.keys(e))if(t?o===s:o!==s){const s=t?null:this._conference.getParticipantById(o),a=e[o];if((t||s)&&a){const e=this._calculatePeerAvgVideoPixels(a,s,n);isNaN(e)||(i+=e,r+=1)}}return i/r}_calculatePeerAvgVideoPixels(e,t,n){let i=Object.keys(e).map(e=>Number(e)),r=null;const s=this._conference.getActivePeerConnection();t?(r=t.getTracksByMediaType(a.c),r&&(i=i.filter(e=>r.find(t=>!t.isMuted()&&t.getSSRC()===e&&t.videoType===n)))):(r=this._conference.getLocalTracks(a.c),i=i.filter(e=>r.find(t=>!t.isMuted()&&s.getLocalSSRC(t)===e&&t.videoType===n)));let o=0,c=0;for(const t of i){const n=Number(e[t].height)*Number(e[t].width);!isNaN(n)&&n>0&&(o+=n,c+=1)}return o/c}_calculateAvgVideoFps(e,t,n){let i=0,r=0;const s=this._conference.myUserId();for(const o of Object.keys(e))if(t?o===s:o!==s){const s=t?null:this._conference.getParticipantById(o),a=e[o];if((t||s)&&a){const e=this._calculatePeerAvgVideoFps(a,s,n);isNaN(e)||(i+=e,r+=1)}}return i/r}_calculatePeerAvgVideoFps(e,t,n){let i=Object.keys(e).map(e=>Number(e)),r=null;const s=this._conference.getActivePeerConnection();t?(r=t.getTracksByMediaType(a.c),r&&(i=i.filter(e=>r.find(t=>!t.isMuted()&&t.getSSRC()===e&&t.videoType===n)))):(r=this._conference.getLocalTracks(a.c),i=i.filter(e=>r.find(t=>!t.isMuted()&&s.getLocalSSRC(t)===e&&t.videoType===n)));let o=0,c=0;for(const t of i){const n=Number(e[t]);!isNaN(n)&&n>0&&(o+=n,c+=1)}return o/c}_maybeSendTransportAnalyticsEvent(e){if(!e||!e.transport||!e.transport.length)return;const t={p2p:e.transport[0].p2p,local_candidate_type:e.transport[0].localCandidateType,remote_candidate_type:e.transport[0].remoteCandidateType,transport_type:e.transport[0].type};this._cachedTransportStats&&s()(t,this._cachedTransportStats)||(this._cachedTransportStats=t,h.a.sendAnalytics(Object(u.M)(t)))}_resetAvgJvbStats(){this._resetAvgStats(),this.jvbStatsMonitor._resetAvgStats()}_resetAvgStats(){this._avgAudioBitrateUp.reset(),this._avgAudioBitrateDown.reset(),this._avgVideoBitrateUp.reset(),this._avgVideoBitrateDown.reset(),this._avgBandwidthUp.reset(),this._avgBandwidthDown.reset(),this._avgPacketLossUp.reset(),this._avgPacketLossDown.reset(),this._avgPacketLossTotal.reset(),this._avgRemoteFPS.reset(),this._avgRemoteScreenFPS.reset(),this._avgLocalFPS.reset(),this._avgLocalScreenFPS.reset(),this._avgRemoteCameraPixels.reset(),this._avgRemoteScreenPixels.reset(),this._avgLocalCameraPixels.reset(),this._avgLocalScreenPixels.reset(),this._avgCQ.reset(),this._sampleIdx=0}dispose(){this._conference.off(o.P2P_STATUS,this._onP2PStatusChanged),this._conference.off(d.LOCAL_STATS_UPDATED,this._onLocalStatsUpdated),this._conference.off(o.JVB121_STATUS,this._onJvb121StatusChanged),this.jvbStatsMonitor.dispose(),this.p2pStatsMonitor.dispose()}}}).call(this,"modules/statistics/AvgRTPStatsReporter.js")},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var i=n(1),r=n(0),s=n.n(r),o=n(71),a=n.n(o);class c{constructor(e){this.stats={users:{},dominantSpeakerId:null};const t=e.myUserId();this.stats.users[t]=new a.a(t,null,!0),this.conference=e,e.addEventListener(i.DOMINANT_SPEAKER_CHANGED,this._onDominantSpeaker.bind(this)),e.addEventListener(i.USER_JOINED,this._onUserJoin.bind(this)),e.addEventListener(i.USER_LEFT,this._onUserLeave.bind(this)),e.addEventListener(i.DISPLAY_NAME_CHANGED,this._onDisplayNameChange.bind(this)),e.xmpp&&e.xmpp.addListener(s.a.SPEAKER_STATS_RECEIVED,this._updateStats.bind(this))}_onDominantSpeaker(e){const t=this.stats.users[this.stats.dominantSpeakerId],n=this.stats.users[e];t&&t.setDominantSpeaker(!1),n&&n.setDominantSpeaker(!0),this.stats.dominantSpeakerId=e}_onUserJoin(e,t){t.isHidden()||this.stats.users[e]||(this.stats.users[e]=new a.a(e,t.getDisplayName()))}_onUserLeave(e){const t=this.stats.users[e];t&&t.markAsHasLeft()}_onDisplayNameChange(e,t){const n=this.stats.users[e];n&&n.setDisplayName(t)}getStats(){return this.stats.users}_updateStats(e){for(const t in e){let n;const i=this.conference.getParticipantById(t);i&&i.isHidden()||(this.stats.users[t]?(n=this.stats.users[t],n.getDisplayName()||n.setDisplayName(e[t].displayName)):(n=new a.a(t,e[t].displayName),this.stats.users[t]=n,n.markAsHasLeft())),n.totalDominantSpeakerTime=e[t].totalDominantSpeakerTime}}}},function(e,t,n){const i=n(86),r=n(170);function s(){this.audioRecorder=new i,this.transcriptionService=new r,this.counter=null,this.startTime=null,this.transcription=null,this.callback=null,this.results=[],this.state="before",this.lineLength=0}function o(e,t){if(console.log("retrieved an answer from the transcription service. The answer has an array of length: "+t.wordArray.length),t.wordArray.length>0){let n=t.startTime.getUTCMilliseconds()-e.startTime.getUTCMilliseconds();n<0&&(n=0);let i="[";t.wordArray.forEach(e=>{e.begin+=n,e.end+=n,i+=e.word+","}),i+="]",console.log(i),t.wordArray.name=t.name}e.results.push(t.wordArray),e.counter--,console.log("current counter: "+e.counter),e.maybeMerge()}function a(e){for(let t=0;t<e.length;t++)0===e[t].length&&e.splice(t,1);return e.length>0}s.prototype.start=function(){if("before"!==this.state)throw new Error(`The transcription can only start when it's in the "before" state. It's currently in the "${this.state}" state`);this.state="recording",this.audioRecorder.start(),this.startTime=new Date},s.prototype.stop=function(e){if("recording"!==this.state)throw new Error(`The transcription can only stop when it's in the "recording" state. It's currently in the "${this.state}" state`);console.log("stopping recording and sending audio files"),this.audioRecorder.stop();const t=o.bind(null,this);this.audioRecorder.getRecordingResults().forEach(e=>{this.transcriptionService.send(e,t),this.counter++}),this.state="transcribing",this.callback=e},s.prototype.maybeMerge=function(){"transcribing"===this.state&&0===this.counter&&this.merge()},s.prototype.merge=function(){console.log("starting merge process!\n The length of the array: "+this.results.length),this.transcription="";const e=this.results,t=[];for(a(e),e.forEach(e=>function(e,t){if(0===e.length)e.push(t);else{if(e[e.length-1].begin<=t.begin)return void e.push(t);for(let n=0;n<e.length;n++)if(t.begin<e[n].begin)return void e.splice(n,0,t);e.push(t)}}(t,e));a(e);){let t=e[0];e.forEach(e=>{e[0].begin<t[0].begin&&(t=e)});let n=t.shift();for(this.updateTranscription(n,t.name);t.length>0;){let i=!1;const r=t[0].begin;if(e.forEach(e=>{e[0].begin<r&&(i=!0)}),i)break;n=t.shift(),this.updateTranscription(n,null)}}this.state="finished",this.callback&&this.callback(this.transcription)},s.prototype.updateTranscription=function(e,t){null!=t&&(this.transcription+=`\n${t}:`,this.lineLength=t.length+1),this.lineLength+e.word.length>80&&(this.transcription+="\n ",this.lineLength=4),this.transcription+=" "+e.word,this.lineLength+=e.word.length+1},s.prototype.addTrack=function(e){this.audioRecorder.addTrack(e)},s.prototype.removeTrack=function(e){this.audioRecorder.removeTrack(e)},s.prototype.getTranscription=function(){if("finished"!==this.state)throw new Error(`The transcription can only be retrieved when it's in the "finished" state. It's currently in the "${this.state}" state`);return this.transcription},s.prototype.getState=function(){return this.state},s.prototype.reset=function(){this.state="before",this.counter=null,this.transcription=null,this.startTime=null,this.callback=null,this.results=[],this.lineLength=0},e.exports=s},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return s}));var i=n(6);const r=n(5).getLogger(e);function s(e){this.versions={},this.conference=e,this.conference.addCommandListener("versions",this.processVersions.bind(this))}s.prototype.processVersions=function(e,t,n){if(!this.conference._isFocus(n))return void r.warn("Received versions not from the focus user: "+e,n);const s=[];e.children.forEach(e=>{const t=e.attributes.name,n=e.value;this.versions[t]!==n&&(this.versions[t]=n,r.info(`Got ${t} version: ${n}`),s.push({id:"component_version",component:t,version:n}))}),s.length>0&&i.a.sendLog(JSON.stringify(s))},s.prototype.getComponentVersion=function(e){return this.versions[e]}}).call(this,"modules/version/ComponentsVersions.js")},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return d}));var i=n(5),r=n(0),s=n.n(r),o=n(144),a=n(26);const c=Object(i.getLogger)(e);class d{constructor(e){this.chatRoom=e,this.eventEmitter=e.eventEmitter,c.debug("creating VideoSIPGW"),this.sessions={},this.sessionStateChangeListener=this.sessionStateChanged.bind(this),e.addPresenceListener("jibri-sip-call-state",this.handleJibriSIPState.bind(this))}handleJibriSIPState(e){const t=e.attributes;if(!t)return;c.debug("Handle video sip gw state : ",t);const n=t.state;if(n!==this.state)switch(n){case a.STATE_ON:case a.STATE_OFF:case a.STATE_PENDING:case a.STATE_RETRYING:case a.STATE_FAILED:{const e=t.sipaddress;if(!e)return;const i=this.sessions[e];i?i.setState(n,t.failure_reason):c.warn("Video SIP GW session not found:",e)}}}createVideoSIPGWSession(e,t){if(this.sessions[e])return c.warn("There was already a Video SIP GW session for address",e),new Error(a.ERROR_SESSION_EXISTS);const n=new o.a(e,t,this.chatRoom);return n.addStateListener(this.sessionStateChangeListener),this.sessions[e]=n,n}sessionStateChanged(e){const t=e.address;if(e.newState===a.STATE_OFF||e.newState===a.STATE_FAILED){const e=this.sessions[t];if(!e)return void c.error("Missing Video SIP GW session with address:",t);e.removeStateListener(this.sessionStateChangeListener),delete this.sessions[t]}this.eventEmitter.emit(s.a.VIDEO_SIP_GW_SESSION_STATE_CHANGED,e)}}}).call(this,"modules/videosipgw/VideoSIPGW.js")},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return c}));var i=n(5),r=n(2),s=n(22),o=n(26);const a=Object(i.getLogger)(e);class c extends s.a{constructor(e,t,n){super(),this.sipAddress=e,this.displayName=t,this.chatRoom=n,this.state=void 0}stop(){this.state!==o.STATE_OFF&&this.state!==o.STATE_FAILED?this._sendJibriIQ("stop"):a.warn("Video SIP GW session already stopped or failed!")}start(){this.state!==o.STATE_ON&&this.state!==o.STATE_OFF&&this.state!==o.STATE_PENDING&&this.state!==o.STATE_RETRYING?this._sendJibriIQ("start"):a.warn("Video SIP GW session already started!")}setState(e,t){if(e===this.state)return;const n=this.state;this.state=e,this.eventEmitter.emit("STATE_CHANGED",{address:this.sipAddress,failureReason:t,oldState:n,newState:this.state,displayName:this.displayName})}addStateListener(e){this.addListener("STATE_CHANGED",e)}removeStateListener(e){this.removeListener("STATE_CHANGED",e)}_sendJibriIQ(e){const t={xmlns:"http://jitsi.org/protocol/jibri",action:e,sipaddress:this.sipAddress};t.displayname=this.displayName;const n=Object(r.$iq)({to:this.chatRoom.focusMucJid,type:"set"}).c("jibri",t).up();a.debug(e+" video SIP GW session",n.nodeTree),this.chatRoom.connection.sendIQ(n,()=>{},t=>{a.error(`Failed to ${e} video SIP GW session, error: `,t),this.setState(o.STATE_FAILED)})}}}).call(this,"modules/videosipgw/JitsiVideoSIPGWSession.js")},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return c}));var i=n(5),r=n(16),s=n(13),o=n(6);const a=Object(i.getLogger)(e);function c(){return new Promise(e=>{s.a.enumerateDevices(t=>{const n=t.filter(e=>"audioinput"===e.kind),i=[];for(const e of n){const t=s.a.obtainAudioAndVideoPermissions({devices:["audio"],micDeviceId:e.deviceId}).then(e=>{const t=e[0],n=t.getOriginalStream();return o.a.startLocalStats(n,t.setAudioLevel.bind(t)),t.addEventListener(r.LOCAL_TRACK_STOPPED,()=>{o.a.stopLocalStats(n)}),t});i.push(t)}Promise.allSettled(i).then(t=>{const n=t.filter(e=>"fulfilled"===e.status),i=t.filter(e=>"rejected"===e.status),s=n.map(e=>e.value),o=i.map(e=>e.value);for(const e of o)a.error("Failed to acquire audio device with error: ",e);for(const t of s)t.on(r.TRACK_AUDIO_LEVEL_CHANGED,n=>{n>.008&&(d(s),e({deviceId:t.deviceId,deviceLabel:t.track.label}))});setTimeout(()=>{d(s),e({deviceId:"",deviceLabel:""})},3e3)})})})}function d(e){for(const t of e)t.stopStream()}}).call(this,"modules/detection/ActiveDeviceDetector.js")},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return f}));var i=n(5),r=n(2),s=n(4),o=n(15),a=n.n(o),c=n(13),d=n(147),u=n(35);function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){h(e,t,n[t])}))}return e}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(e,t){if(null==e)return{};var n,i,r=function(e,t){if(null==e)return{};var n,i,r={},s=Object.keys(e);for(i=0;i<s.length;i++)n=s[i],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}const m=Object(i.getLogger)(e);class f{constructor(e={}){const{jitsiConnection:t}=e,n=p(e,["jitsiConnection"]);this._options=l({iceConfig:t&&t.xmpp.connection.jingle.p2pIceConfig},n),this._peerConnection=null,this._onFatalError=this._onFatalError.bind(this),this._onSendMessage=this._onSendMessage.bind(this),this._onRemoteStream=this._onRemoteStream.bind(this)}processMessage(e){const t=e.from;if(!t)return;if(this._peerConnection&&this._peerConnection.getPeerJid()!==t)return void this._onFatalError(t,u.a.CONNECTION_ERROR,"rejected");const n=this._convertStringToXML(e.data.iq),i=n&&n.find("jingle"),r=i&&i.attr("action");r===u.a.INITIATE&&(this._peerConnection=this._createPeerConnection(t,{isInitiator:!1,receiveVideo:!0})),this._peerConnection&&this._peerConnection.processMessage(i),r!==u.a.CONNECTION_ERROR&&r!==u.a.UNAVAILABLE&&r!==u.a.TERMINATE||this._selfCloseConnection()}start(e,t=[]){this._peerConnection=this._createPeerConnection(e,{isInitiator:!0,receiveVideo:!1}),this._peerConnection.start(t)}stop(){this._peerConnection&&this._peerConnection.stop(),this._peerConnection=null}_convertStringToXML(e){try{const t=(new DOMParser).parseFromString(e,"text/xml");return $(t)}catch(e){return m.error("Attempted to convert incorrectly formatted xml"),null}}_createPeerConnection(e,t={}){if(!e)throw new Error("Cannot create ProxyConnectionPC without a peer.");const n=l({iceConfig:this._options.iceConfig,onError:this._onFatalError,onRemoteStream:this._onRemoteStream,onSendMessage:this._onSendMessage,peerJid:e},t);return new d.a(n)}_onFatalError(e,t,n=""){m.error("Received a proxy connection error",e,t,n);const i=Object(r.$iq)({to:e,type:"set"}).c("jingle",{xmlns:"urn:xmpp:jingle:1",action:t}).c("details").t(n).up();this._onSendMessage(e,i),this._peerConnection&&this._peerConnection.getPeerJid()===e&&this._selfCloseConnection()}_onRemoteStream(e){if(!this._options.onRemoteStream)return m.error("Remote track received without callback."),void e.dispose();const t=e.isVideoTrack();let n;t&&(n=this._options.convertVideoToDesktop?a.a.DESKTOP:a.a.CAMERA);const i=e.getOriginalStream(),r=c.a.createLocalTracks([{deviceId:"proxy:"+this._peerConnection.getPeerJid(),mediaType:t?s.c:s.a,sourceType:"proxy",stream:i,track:i.getVideoTracks()[0],videoType:n}]);this._options.onRemoteStream(r[0])}_onSendMessage(e,t){if(this._options.onSendMessage)try{const n=(new XMLSerializer).serializeToString(t.nodeTree||t);this._options.onSendMessage(e,{iq:n})}catch(e){m.error("Attempted to send an incorrectly formatted iq.")}}_selfCloseConnection(){this.stop(),this._options.onConnectionClosed&&this._options.onConnectionClosed()}}}).call(this,"modules/proxyconnection/ProxyConnectionService.js")},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return f}));var i=n(5),r=n(7),s=n.n(r),o=n(0),a=n.n(o),c=n(13),d=n(57),u=n(24),l=n(35);function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){p(e,t,n[t])}))}return e}function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const m=Object(i.getLogger)(e);class f{constructor(e={}){this._options=h({iceConfig:{},isInitiator:!1,receiveAudio:!1,receiveVideo:!1},e),this._tracks=[],this._peerConnection=null,this._onError=this._onError.bind(this),this._onRemoteStream=this._onRemoteStream.bind(this),this._onSendMessage=this._onSendMessage.bind(this)}getPeerJid(){return this._options.peerJid}processMessage(e){switch(e.attr("action")){case l.a.ACCEPT:this._onSessionAccept(e);break;case l.a.INITIATE:this._onSessionInitiate(e);break;case l.a.TERMINATE:this._onSessionTerminate(e);break;case l.a.TRANSPORT_INFO:this._onTransportInfo(e)}}start(e=[]){this._peerConnection||(this._tracks=this._tracks.concat(e),this._peerConnection=this._createPeerConnection(),this._peerConnection.invite(e))}stop(){this._peerConnection&&this._peerConnection.terminate(),this._onSessionTerminate()}_createPeerConnection(){const e={connected:!0,jingle:{terminate:()=>{}},sendIQ:this._onSendMessage,addEventListener:()=>()=>{}},t=h({iceServers:u.a},this._options.iceConfig),n={addPresenceListener:()=>{},connectionTimes:[],eventEmitter:{emit:e=>{switch(e){case a.a.CONNECTION_ICE_FAILED:case a.a.CONNECTION_FAILED:this._onError(l.a.CONNECTION_ERROR,e)}}},getMediaPresenceInfo:()=>({}),removePresenceListener:()=>{},supportsRestartByTerminate:()=>!1};this._rtc=new c.a({myUserId:()=>""},{}),this._rtc.addListener(s.a.REMOTE_TRACK_ADDED,this._onRemoteStream);const i=new d.a(void 0,void 0,this._options.peerJid,e,{offerToReceiveAudio:this._options.receiveAudio,offerToReceiveVideo:this._options.receiveVideo},t,!0,this._options.isInitiator);return i.initialize(n,this._rtc,{}),i}_onError(e,t=""){this._options.onError(this._options.peerJid,e,t)}_onRemoteStream(e){this._tracks.push(e),this._options.onRemoteStream(e)}_onSendMessage(e){this._options.onSendMessage(this._options.peerJid,e)}_onSessionAccept(e){this._peerConnection?this._peerConnection.setAnswer(e):m.error("Received an answer when no peer connection exists.")}_onSessionInitiate(e){this._peerConnection?m.error("Received an offer when an offer was already sent."):(this._peerConnection=this._createPeerConnection(),this._peerConnection.acceptOffer(e,()=>{},()=>this._onError(this._options.peerJid,l.a.CONNECTION_ERROR,"session initiate error")))}_onSessionTerminate(){this._tracks.forEach(e=>e.dispose()),this._tracks=[],this._peerConnection&&this._peerConnection.onTerminated(),this._rtc&&(this._rtc.removeListener(s.a.REMOTE_TRACK_ADDED,this._onRemoteStream),this._rtc.destroy())}_onTransportInfo(e){this._peerConnection.addIceCandidates(e)}}}).call(this,"modules/proxyconnection/ProxyConnectionPC.js")},function(e,t,n){"use strict";t.a={error:{BUSY:"busy",ERROR:"error",RESOURCE_CONSTRAINT:"resource-constraint",SERVICE_UNAVAILABLE:"service-unavailable"},mode:{FILE:"file",STREAM:"stream"},status:{OFF:"off",ON:"on",PENDING:"pending"}}},function(e,t,n){"use strict";var i=n(19),r=n.n(i),s=n(3),o=n(29),a=n(50),c=n.n(a),d=n(43);const u=new r.a;let l=!1,h=null;t.a={init:async function(e){if(l)throw new Error("Precall Test already initialized");const{callStatsID:t,callStatsSecret:n,disableThirdPartyRequests:i}=e;if(!t||!n||i)throw new Error("Callstats is disabled");return await function(e){if(!s.a.isReactNative())return new Promise(t=>{c.a.loadScript(e.callStatsCustomScriptUrl||d.a,!0,!0,void 0,t)})}(e),h=new window.callstats,function(e){return new Promise((t,n)=>{const i=e.callStatsID,r=e.callStatsSecret,s=e.statisticsId||e.statisticsDisplayName||o.a.callStatsUserName;h.initialize(i,r,s,(e,i)=>{"success"===e?(h.on("preCallTestResults",(...e)=>{u.emit("preCallTestResults",...e)}),l=!0,t()):n({status:e,message:i})},null,{disablePrecalltest:!0})})}(e)},execute:function(){return l?new Promise((e,t)=>{u.on("preCallTestResults",(n,i)=>{"success"===n?e(i):t({status:n,payload:i})}),h.makePrecallTest()}):Promise.reject("uninitialized")}}},function(e,t){const n={getTokenAuthUrl:(e,t,n)=>"string"!=typeof e?null:e.replace("{room}",t).replace("{roleUpgrade}",!0===n)};e.exports=n},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return o}));var i=n(5),r=n(69);const s=Object(i.getLogger)(e);class o{constructor(){this._started=!1,this._streamsToMix=[],this._streamMSSArray=[]}addMediaStream(e){e.getAudioTracks()||s.warn("Added MediaStream doesn't contain audio tracks."),this._streamsToMix.push(e)}start(){if(this._started)return this._mixedMSD.stream;if(this._audioContext=Object(r.a)(),!this._streamsToMix.length)return s.warn("No MediaStream's added to AudioMixer, nothing will happen."),null;this._started=!0,this._mixedMSD=this._audioContext.createMediaStreamDestination();for(const e of this._streamsToMix){const t=this._audioContext.createMediaStreamSource(e);t.connect(this._mixedMSD),this._streamMSSArray.push(t)}return this._mixedMSD.stream}reset(){this._started=!1,this._streamsToMix=[];for(const e of this._streamMSSArray)e.disconnect();this._streamMSSArray=[],this._audioContext&&(this._audioContext=void 0)}}}).call(this,"modules/webaudio/AudioMixer.js")},function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var i=n(44),r=n.n(i),s=n(78),o=n.n(s);var a=function(e,t){return void 0!==e&&void 0!==e.media&&Array.isArray(e.media)&&e.media.forEach(e=>{e.sources&&e.sources.length&&(e.ssrcs=[],e.sources.forEach(t=>{Object.keys(t).forEach(n=>{"id"!==n&&e.ssrcs.push({id:t.id,attribute:n,value:t[n]})})}),delete e.sources),e.ssrcGroups&&e.ssrcGroups.length&&e.ssrcGroups.forEach(e=>{void 0!==e.ssrcs&&Array.isArray(e.ssrcs)&&(e.ssrcs=e.ssrcs.join(" "))})}),o.a.write(e,t)},c=function(e){const t=o.a.parse(e);return void 0!==t&&void 0!==t.media&&Array.isArray(t.media)&&t.media.forEach(e=>{void 0!==e.ssrcs&&Array.isArray(e.ssrcs)&&(e.sources=[],e.ssrcs.forEach(t=>{const n=e.sources.findIndex(e=>e.id===t.id);if(n>-1)e.sources[n][t.attribute]=t.value;else{const n={id:t.id};n[t.attribute]=t.value,e.sources.push(n)}}),delete e.ssrcs),void 0!==e.ssrcGroups&&Array.isArray(e.ssrcGroups)&&e.ssrcGroups.forEach(e=>{"string"==typeof e.ssrcs&&(e.ssrcs=e.ssrcs.split(" "))})}),t};const d=["audio","video","data"],u=e=>e.find(e=>"SIM"===e.semantics),l=e=>e.find(e=>"FID"===e.semantics);function h(e,t,n,i){if(!e||!t)return;const r=e=>i.find(t=>t.id.toString()===e);t.ssrcs.forEach(t=>{e.sources.push(r(t));const i=n[parseInt(t,10)].find(e=>"FID"===e.semantics);if(i){const n=i.ssrcs.find(e=>e!==t);e.sources.push(r(n)),e.ssrcGroups.push(i)}}),e.ssrcGroups.push(t)}function p(e,t,n,i){if(!e||!t)return;if(e.sources=[],e.ssrcGroups=[],!n[t.id])return e.sources.push(t),void(e.msid=t.msid);const r=u(n[t.id]),s=l(n[t.id]);if(r)h(e,r,n,i);else if(s){const r=s.ssrcs.find(e=>e!==t),o=u(n[r]);o?h(e,o,n,i):(s.ssrcs.forEach(t=>{e.sources.push((e=>i.find(t=>t.id.toString()===e))(t))}),e.ssrcGroups.push(s))}e.msid=e.sources[0].msid}function m(e,t,n){if(!n.find(t=>!!t.sources&&t.sources.some(t=>t.id===e.id))){if(!t[e.id])return!1;const i=u(t[e.id]),r=l(t[e.id]);if(i)return n.some(e=>e.sources&&e.sources.some(e=>e.id.toString()===i.ssrcs[0]));if(r&&e.id.toString()!==r.ssrcs[0]){return m({id:r.ssrcs[0]},t,n)}return!1}return!0}class f{toPlanB(e){if(!e||"string"!=typeof e.sdp)return console.warn("An empty description was passed as an argument."),e;const t=c(e.sdp);if(!t.media||!t.media.length)return console.warn("The description has no media."),e;if(t.media.every(e=>-1!==d.indexOf(e.mid)))return console.warn("The description does not look like unified plan sdp"),e;const n={},i=t.media;t.media=[],i.forEach(e=>{const t=e.type;if("application"===t)return e.mid="data",void(n[e.mid]=e);if(void 0===n[t]){const i=r()(e);i.sources&&Array.isArray(i.sources)&&i.sources.forEach(t=>{e.msid?t.msid=e.msid:delete t.msid}),i.ssrcGroups&&e.msid||(i.ssrcGroups=[]),delete i.msid,i.mid=t,n[t]=i}else e.msid&&(e.sources&&Array.isArray(e.sources)&&(n[t].sources=(n[t].sources||[]).concat(e.sources)),void 0!==e.ssrcGroups&&Array.isArray(e.ssrcGroups)&&(n[t].ssrcGroups=n[t].ssrcGroups.concat(e.ssrcGroups)))}),t.media=Object.values(n);const s=[];Object.values(n).forEach(e=>{"inactive"!==e.direction&&s.push(e.mid)}),t.groups.forEach(e=>{"BUNDLE"===e.type&&(e.mids=s.join(" "))}),t.msidSemantic={semantic:"WMS",token:"*"};const o=a(t);return new RTCSessionDescription({type:e.type,sdp:o})}toUnifiedPlan(e,t=null){if(!e||"string"!=typeof e.sdp)return console.warn("An empty description was passed as an argument."),e;const n=c(e.sdp);if(!n.media||!n.media.length)return console.warn("The description has no media."),e;if(n.media.length>3||n.media.every(e=>-1===d.indexOf(e.mid)))return console.warn("The description does not look like plan-b"),e;const i=t?c(t.sdp):null,s={};n.media.forEach(e=>{const t=e.type;if("application"===t){if(!i||!i.media){const t=r()(e);return t.mid=Object.keys(s).length.toString(),void(s[e.mid]=t)}const n=i.media.findIndex(e=>e.type===t);return void(n&&(i.media[n]=e,i.media[n].mid=n))}const n=function(e){const t={};return e&&Array.isArray(e)?(e.forEach(e=>{e.ssrcs&&Array.isArray(e.ssrcs)&&e.ssrcs.forEach(n=>{void 0===t[n]&&(t[n]=[]),t[n].push(e)})}),t):t}(e.ssrcGroups);if(e.sources)e.sources.forEach((t,o)=>{if(!t.msid)return;if(!i||!i.media){if(m(t,n,Object.values(s)))return;const i=r()(e);return i.mid=Object.keys(s).length.toString(),i.direction=o||"sendonly"===e.direction?"sendonly":"sendrecv",i.bundleOnly=void 0,p(i,t,n,e.sources),void(s[i.mid]=i)}if(m(t,n,i.media))return;const a=r()(e);a.mid=i.media.length.toString(),a.direction="sendonly",p(a,t,n,e.sources),i.media.push(a)});else if(!i){const t=r()(e);t.mid=Object.keys(s).length.toString(),s[e.mid]=t}}),n.media=i?i.media:Object.values(s);const o=[];n.media.forEach(e=>{o.push(e.mid)}),n.groups.forEach(e=>{"BUNDLE"===e.type&&(e.mids=o.join(" "))}),n.msidSemantic={semantic:"WMS",token:"*"},n.origin.sessionVersion++;const u=a(n);return new RTCSessionDescription({type:e.type,sdp:u})}}},function(e,t,n){e.exports=n(154).default},function(e,t,n){"use strict";n.r(t),function(e){var i=n(5),r=n.n(i),s=n(17),o=n(1),a=n(87),c=n(40),d=n(27),u=n(72),l=n(49),h=n(21),p=n(14),m=n(16),f=n(64),g=n(13),_=n(3),v=n(52),S=n(51),y=n(145),E=n(23),b=n(68),C=n(146),T=n(148),R=n(29),A=n(63),I=n(149),w=n(6),P=n(150),O=n.n(P),D=n(12),N=n.n(D),M=n(50),L=n.n(M),k=n(26),x=n(151),F=n(4),j=n(32),U=n(70),H=n(8);function V(e,t){if(null==e)return{};var n,i,r=function(e,t){if(null==e)return{};var n,i,r={},s=Object.keys(e);for(i=0;i<s.length;i++)n=s[i],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}const B=r.a.getLogger(e);function J(e){const t={audio_requested:e.devices.includes("audio"),video_requested:e.devices.includes("video"),screen_sharing_requested:e.devices.includes("desktop")};return t.video_requested&&(t.resolution=e.resolution),t}t.default=function(e){return"object"==typeof window.JitsiMeetJS?Object.assign({},window.JitsiMeetJS,e):e}({version:"b0d27fa8da",JitsiConnection:a.a,ProxyConnectionService:C.a,constants:{participantConnectionStatus:S.a,recording:T.a,sipVideoGW:k,transcriptionStatus:f},events:{conference:o,connection:d,detection:E,track:m,mediaDevices:l,connectionQuality:j,e2eping:U},errors:{conference:s,connection:c,track:p},errorTypes:{JitsiTrackError:h.a},logLevels:r.a.levels,mediaDevices:u.a,analytics:w.a.analytics,init(e={}){R.a.init(e.externalStorage),w.a.init(e),window.connectionTimes||(window.connectionTimes={}),!0!==e.enableAnalyticsLogging&&(B.warn("Analytics disabled, disposing."),this.analytics.dispose()),e.enableWindowOnErrorHandler&&N.a.addHandler(this.getGlobalOnErrorHandler.bind(this));const t=e.deploymentInfo;if(t&&Object.keys(t).length>0){const e={};for(const n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.id="deployment_info",w.a.sendLog(JSON.stringify(e))}if(this.version){const e={id:"component_version",component:"lib-jitsi-meet",version:this.version};w.a.sendLog(JSON.stringify(e))}return g.a.init(e)},isDesktopSharingEnabled:()=>g.a.isDesktopSharingEnabled(),isWebRtcSupported:()=>g.a.isWebRtcSupported(),setLogLevel(e){r.a.setLogLevel(e)},setLogLevelById(e,t){r.a.setLogLevelById(e,t)},addGlobalLogTransport(e){r.a.addGlobalTransport(e)},removeGlobalLogTransport(e){r.a.removeGlobalTransport(e)},setGlobalLogOptions(e){r.a.setGlobalOptions(e)},createLocalTracks(e={},t){let n=!1;const{firePermissionPromptIsShownEvent:i,fireSlowPromiseEvent:r}=e,s=V(e,["firePermissionPromptIsShownEvent","fireSlowPromiseEvent"]);return(i||t)&&!g.a.arePermissionsGrantedForAvailableDevices()?u.a.emitEvent(l.PERMISSION_PROMPT_IS_SHOWN,_.a.getName()):r&&window.setTimeout(()=>{n||u.a.emitEvent(l.SLOW_GET_USER_MEDIA)},1e3),window.connectionTimes||(window.connectionTimes={}),window.connectionTimes["obtainPermissions.start"]=window.performance.now(),g.a.obtainAudioAndVideoPermissions(s).then(e=>{if(n=!0,window.connectionTimes["obtainPermissions.end"]=window.performance.now(),w.a.sendAnalytics(Object(H.F)("success",J(s))),!g.a.options.disableAudioLevels)for(let t=0;t<e.length;t++){const n=e[t],i=n.getOriginalStream();n.getType()===F.a&&(w.a.startLocalStats(i,n.setAudioLevel.bind(n)),n.addEventListener(m.LOCAL_TRACK_STOPPED,()=>{w.a.stopLocalStats(i)}))}const t=g.a.getCurrentlyAvailableMediaDevices();if(t)for(let n=0;n<e.length;n++){e[n]._setRealDeviceIdFromDeviceList(t)}for(const t of e)t.type===F.c&&"desktop"===t.videoType&&this.setVideoTrackContentHints(t.track,"detail");return e}).catch(t=>{if(n=!0,t.name===p.SCREENSHARING_USER_CANCELED){const e={id:"screensharing_user_canceled",message:t.message};w.a.sendLog(JSON.stringify(e)),w.a.sendAnalytics(Object(H.F)("warning",{reason:"extension install user canceled"}))}else if(t.name===p.NOT_FOUND){const n={id:"usermedia_missing_device",status:t.gum.devices};w.a.sendLog(JSON.stringify(n));const i=J(e);i.reason="device not found",i.devices=t.gum.devices.join("."),w.a.sendAnalytics(Object(H.F)("error",i))}else{w.a.sendGetUserMediaFailed(t);const n=J(e);n.reason=t.name,w.a.sendAnalytics(Object(H.F)("error",n))}return window.connectionTimes["obtainPermissions.end"]=window.performance.now(),Promise.reject(t)})},createTrackVADEmitter:(e,t,n)=>b.a.create(e,t,n),createAudioMixer:()=>new x.a,getActiveAudioDevice:()=>Object(y.a)(),isDeviceListAvailable(){return B.warn("This method is deprecated, use JitsiMeetJS.mediaDevices.isDeviceListAvailable instead"),this.mediaDevices.isDeviceListAvailable()},isDeviceChangeAvailable(e){return B.warn("This method is deprecated, use JitsiMeetJS.mediaDevices.isDeviceChangeAvailable instead"),this.mediaDevices.isDeviceChangeAvailable(e)},isMultipleAudioInputSupported(){return this.mediaDevices.isMultipleAudioInputSupported()},isCollectingLocalStats:()=>w.a.audioLevelsEnabled&&A.a.isLocalStatsSupported(),enumerateDevices(e){B.warn("This method is deprecated, use JitsiMeetJS.mediaDevices.enumerateDevices instead"),this.mediaDevices.enumerateDevices(e)},getGlobalOnErrorHandler(e,t,n,i,r){B.error("UnhandledError: "+e,"Script: "+t,"Line: "+n,"Column: "+i,"StackTrace: ",r),w.a.reportGlobalError(r)},setNetworkInfo({isOnline:e}){v.b.updateNetworkInfo({isOnline:e})},setVideoTrackContentHints(e,t){"contentHint"in e?(e.contentHint=t,e.contentHint!==t&&B.debug("Invalid video track contentHint")):B.debug("MediaStreamTrack contentHint attribute not supported")},precallTest:I.a,util:{AuthUtil:O(),ScriptUtil:L(),browser:_.a}})}.call(this,"JitsiMeetJS.js")},function(e,t,n){var i=n(82);function r(e,t){this.logStorage=e,this.stringifyObjects=!(!t||!t.stringifyObjects)&&t.stringifyObjects,this.storeInterval=t&&t.storeInterval?t.storeInterval:3e4,this.maxEntryLength=t&&t.maxEntryLength?t.maxEntryLength:1e4,Object.keys(i.levels).forEach(function(e){this[i.levels[e]]=function(){this._log.apply(this,arguments)}.bind(this,e)}.bind(this)),this.storeLogsIntervalID=null,this.queue=[],this.totalLen=0,this.outputCache=[]}r.prototype.stringify=function(e){try{return JSON.stringify(e)}catch(e){return"[object with circular refs?]"}},r.prototype.formatLogMessage=function(e){for(var t="",n=1,r=arguments.length;n<r;n++){var s=arguments[n];!this.stringifyObjects&&e!==i.levels.ERROR||"object"!=typeof s||(s=this.stringify(s)),t+=s,n!==r-1&&(t+=" ")}return t.length?t:null},r.prototype._log=function(){var e=arguments[1],t=this.formatLogMessage.apply(this,arguments);if(t){var n=this.queue[this.queue.length-1],i=n&&n.text;i===t?n.count+=1:(this.queue.push({text:t,timestamp:e,count:1}),this.totalLen+=t.length)}this.totalLen>=this.maxEntryLength&&this._flush(!0,!0)},r.prototype.start=function(){this._reschedulePublishInterval()},r.prototype._reschedulePublishInterval=function(){this.storeLogsIntervalID&&(window.clearTimeout(this.storeLogsIntervalID),this.storeLogsIntervalID=null),this.storeLogsIntervalID=window.setTimeout(this._flush.bind(this,!1,!0),this.storeInterval)},r.prototype.flush=function(){this._flush(!1,!0)},r.prototype._flush=function(e,t){this.totalLen>0&&(this.logStorage.isReady()||e)&&(this.logStorage.isReady()?(this.outputCache.length&&(this.outputCache.forEach(function(e){this.logStorage.storeLogs(e)}.bind(this)),this.outputCache=[]),this.logStorage.storeLogs(this.queue)):this.outputCache.push(this.queue),this.queue=[],this.totalLen=0),t&&this._reschedulePublishInterval()},r.prototype.stop=function(){this._flush(!1,!1)},e.exports=r},function(e,t){(function(t){e.exports=t}).call(this,{})},function(e,t,n){var i,r,s;
/*!
* currentExecutingScript
* Get the currently executing script, regardless of its source/trigger/synchronicity. Similar to HTML5's `document.currentScript` but arguably much more useful!
* Copyright (c) 2015 James M. Greene
* Licensed MIT
* https://github.com/JamesMGreene/currentExecutingScript
* v0.1.3
*/this||window,r=[],void 0===(s="function"==typeof(i=function(){var e=/^(interactive|loaded|complete)$/,t=window.location?window.location.href:null,n=t&&t.replace(/#.*$/,"").replace(/\?.*$/,"")||null,i=document.getElementsByTagName("script"),r="readyState"in(i[0]||document.createElement("script")),s=!window.opera||"[object Opera]"!==window.opera.toString(),o="currentScript"in document;"stackTraceLimit"in Error&&Error.stackTraceLimit!==1/0&&(Error.stackTraceLimit,Error.stackTraceLimit=1/0);var a=!1,c=!1;function d(){if(0===i.length)return null;var t,u,l,h,p,m=[],f=d.skipStackDepth||1;for(t=0;t<i.length;t++)s&&r?e.test(i[t].readyState)&&m.push(i[t]):m.push(i[t]);if(u=new Error,a&&(l=u.stack),!l&&c)try{throw u}catch(e){l=e.stack}if(l&&!(p=function(e,t){var n,r=null;if(t=t||i,"string"==typeof e&&e)for(n=t.length;n--;)if(t[n].src===e){r=t[n];break}return r}(h=function e(t,n){var i,r=null,s="number"==typeof n;return n=s?Math.round(n):0,"string"==typeof t&&t&&(s?i=t.match(/(data:text\/javascript(?:;[^,]+)?,.+?|(?:|blob:)(?:http[s]?|file):\/\/[\/]?.+?\/[^:\)]*?)(?::\d+)(?::\d+)?/):(i=t.match(/^(?:|[^:@]*@|.+\)@(?=data:text\/javascript|blob|http[s]?|file)|.+?\s+(?: at |@)(?:[^:\(]+ )*[\(]?)(data:text\/javascript(?:;[^,]+)?,.+?|(?:|blob:)(?:http[s]?|file):\/\/[\/]?.+?\/[^:\)]*?)(?::\d+)(?::\d+)?/))&&i[1]||(i=t.match(/\)@(data:text\/javascript(?:;[^,]+)?,.+?|(?:|blob:)(?:http[s]?|file):\/\/[\/]?.+?\/[^:\)]*?)(?::\d+)(?::\d+)?/)),i&&i[1]&&(r=n>0?e(t.slice(t.indexOf(i[0])+i[0].length),n-1):i[1])),r}(l,f),m))&&n&&h===n&&(p=function(e){var t,n,r=null;for(t=0,n=(e=e||i).length;t<n;t++)if(!e[t].hasAttribute("src")){if(r){r=null;break}r=e[t]}return r}(m)),p||1===m.length&&(p=m[0]),p||o&&(p=document.currentScript),!p&&s&&r)for(t=m.length;t--;)if("interactive"===m[t].readyState){p=m[t];break}return p||(p=m[m.length-1]||null),p}(function(){try{var e=new Error;throw a="string"==typeof e.stack&&!!e.stack,e}catch(e){c="string"==typeof e.stack&&!!e.stack}})(),d.skipStackDepth=1;var u=d;return u.near=d,u.far=function(){return null},u.origin=function(){return null},u})?i.apply(t,r):i)||(e.exports=s)},function(e,t){e.exports={LOCAL_JID:"local"}},function(e,t,n){!function(e){"use strict";e.Strophe.addConnectionPlugin("disco",{_connection:null,_identities:[],_features:[],_items:[],init:function(t){this._connection=t,this._identities=[],this._features=[],this._items=[],t.addHandler(this._onDiscoInfo.bind(this),e.Strophe.NS.DISCO_INFO,"iq","get",null,null),t.addHandler(this._onDiscoItems.bind(this),e.Strophe.NS.DISCO_ITEMS,"iq","get",null,null)},addIdentity:function(e,t,n,i){for(var r=0;r<this._identities.length;r++)if(this._identities[r].category==e&&this._identities[r].type==t&&this._identities[r].name==n&&this._identities[r].lang==i)return!1;return this._identities.push({category:e,type:t,name:n,lang:i}),!0},addFeature:function(e){for(var t=0;t<this._features.length;t++)if(this._features[t]==e)return!1;return this._features.push(e),!0},removeFeature:function(e){for(var t=0;t<this._features.length;t++)if(this._features[t]===e)return this._features.splice(t,1),!0;return!1},addItem:function(e,t,n,i){return!(n&&!i||(this._items.push({jid:e,name:t,node:n,call_back:i}),0))},info:function(t,n,i,r,s){var o={xmlns:e.Strophe.NS.DISCO_INFO};n&&(o.node=n);var a=e.$iq({from:this._connection.jid,to:t,type:"get"}).c("query",o);this._connection.sendIQ(a,i,r,s)},items:function(t,n,i,r,s){var o={xmlns:e.Strophe.NS.DISCO_ITEMS};n&&(o.node=n);var a=e.$iq({from:this._connection.jid,to:t,type:"get"}).c("query",o);this._connection.sendIQ(a,i,r,s)},_buildIQResult:function(t,n){var i=t.getAttribute("id"),r=t.getAttribute("from"),s=e.$iq({type:"result",id:i});return null!==r&&s.attrs({to:r}),s.c("query",n)},_onDiscoInfo:function(t){var n,i=t.getElementsByTagName("query")[0].getAttribute("node"),r={xmlns:e.Strophe.NS.DISCO_INFO};i&&(r.node=i);var s=this._buildIQResult(t,r);for(n=0;n<this._identities.length;n++)r={category:this._identities[n].category,type:this._identities[n].type},this._identities[n].name&&(r.name=this._identities[n].name),this._identities[n].lang&&(r["xml:lang"]=this._identities[n].lang),s.c("identity",r).up();for(n=0;n<this._features.length;n++)s.c("feature",{var:this._features[n]}).up();return this._connection.send(s.tree()),!0},_onDiscoItems:function(t){var n,i,r={xmlns:e.Strophe.NS.DISCO_ITEMS},s=t.getElementsByTagName("query")[0].getAttribute("node");if(s){for(r.node=s,n=[],i=0;i<this._items.length;i++)if(this._items[i].node==s){n=this._items[i].call_back(t);break}}else n=this._items;var o=this._buildIQResult(t,r);for(i=0;i<n.length;i++){var a={jid:n[i].jid};n[i].name&&(a.name=n[i].name),n[i].node&&(a.node=n[i].node),o.c("item",a).up()}return this._connection.send(o.tree()),!0}})}(n(2))},function(e,t,n){!function(e){"use strict";e.Strophe.addConnectionPlugin("streamManagement",{logging:!1,autoSendCountOnEveryIncomingStanza:!1,requestResponseInterval:5,_c:null,_NS:"urn:xmpp:sm:3",_isStreamManagementEnabled:!1,_serverProcesssedStanzasCounter:null,_clientProcessedStanzasCounter:null,_clientSentStanzasCounter:null,_originalXMLOutput:null,_requestHandler:null,_incomingHandler:null,_requestResponseIntervalCount:0,_isSupported:!1,_unacknowledgedStanzas:[],_acknowledgedStanzaListeners:[],addAcknowledgedStanzaListener:function(e){this._acknowledgedStanzaListeners.push(e)},enable:function(t){if(!this._isSupported)throw new Error("The server doesn't support urn:xmpp:sm:3 namespace");if(this._connectionStatus!==e.Strophe.Status.CONNECTED)throw new Error("enable() can only be called in the CONNECTED state");this._c.send(e.$build("enable",{xmlns:this._NS,resume:t})),this._c.flush(),this._c.pause()},getResumeToken:function(){return this._resumeToken},isSupported(){return this._isSupported},resume:function(){if(!this.getResumeToken())throw new Error("No resume token");if(this._connectionStatus!==e.Strophe.Status.DISCONNECTED)throw new Error("resume() can only be called in the DISCONNECTED state");this._c.options.explicitResourceBinding=!0,this._resuming=!0,this._originalConnect.apply(this._c,this._connectArgs)},requestAcknowledgement:function(){if(this._connectionStatus!==e.Strophe.Status.CONNECTED)throw new Error("requestAcknowledgement() can only be called in the CONNECTED state");this._requestResponseIntervalCount=0,this._c.send(e.$build("r",{xmlns:this._NS}))},getOutgoingCounter:function(){return this._clientSentStanzasCounter},getIncomingCounter:function(){return this._clientProcessedStanzasCounter},init:function(t){this._c=t,e.Strophe.addNamespace("SM",this._NS),this._originalXMLOutput=this._c.xmlOutput,this._c.xmlOutput=this.xmlOutput.bind(this),this._originalConnect=this._c.connect,this._c.connect=this._interceptConnectArgs.bind(this),this._originalOnStreamFeaturesAfterSASL=this._c._onStreamFeaturesAfterSASL,this._c._onStreamFeaturesAfterSASL=this._onStreamFeaturesAfterSASL.bind(this),this._originalDoDisconnect=this._c._doDisconnect,this._c._doDisconnect=this._interceptDoDisconnect.bind(this),this._originalDisconnect=this._c.disconnect,this._c.disconnect=this._interceptDisconnect.bind(this)},_interceptDisconnect:function(){this._resumeToken=void 0,this._originalDisconnect.apply(this._c,arguments)},_interceptDoDisconnect:function(){this.getResumeToken()&&!this._resuming&&this._c.connected&&!this._c.disconnecting&&(this._resumeState={handlers:this._c.handlers,timedHandlers:this._c.timedHandlers,removeTimeds:this._c.removeTimeds,removeHandlers:this._c.removeHandlers,addTimeds:this._c.addTimeds,addHandlers:this._c.addHandlers},this._storedJid=this._c.jid,this.logging&&e.Strophe.debug("SM stored resume state, handler count: "+this._resumeState.handlers.length)),this._c._data=[],this._originalDoDisconnect.apply(this._c,arguments)},_interceptConnectArgs:function(){this._connectArgs=arguments,this._originalConnect.apply(this._c,arguments)},_onStreamFeaturesAfterSASL:function(e){return this._isSupported=e.getElementsByTagNameNS(this._NS,"sm").length>0,this._originalOnStreamFeaturesAfterSASL.apply(this._c,arguments)},statusChanged:function(t){if(this._connectionStatus=t,this.getResumeToken()||t!==e.Strophe.Status.CONNECTED&&t!==e.Strophe.Status.DISCONNECTED)if(t===e.Strophe.Status.BINDREQUIRED){this._c.jid=this._storedJid;for(const e in this._resumeState)this._c[e]=this._resumeState[e];this._c.send(e.$build("resume",{xmlns:this._NS,h:this._clientProcessedStanzasCounter,previd:this._resumeToken})),this._c.flush()}else t===e.Strophe.Status.ERROR&&(this.logging&&e.Strophe.debug("SM cleared resume token on error"),this._resumeToken=void 0);else this.logging&&e.Strophe.debug("SM reset state"),this._serverProcesssedStanzasCounter=0,this._clientProcessedStanzasCounter=0,this._clientSentStanzasCounter=0,this._isStreamManagementEnabled=!1,this._requestResponseIntervalCount=0,this._resuming=!1,t===e.Strophe.Status.DISCONNECTED&&(this._isSupported=!1),this._unacknowledgedStanzas=[],this._requestHandler&&this._c.deleteHandler(this._requestHandler),this._incomingHandler&&this._c.deleteHandler(this._incomingHandler),this._requestHandler=this._c.addHandler(this._handleServerRequestHandler.bind(this),this._NS,"r"),this._ackHandler=this._c.addHandler(this._handleServerAck.bind(this),this._NS,"a"),this._incomingHandler=this._c.addHandler(this._incomingStanzaHandler.bind(this)),this._enabledHandler=this._c._addSysHandler(this._handleEnabled.bind(this),this._NS,"enabled"),this._resumeFailedHandler=this._c._addSysHandler(this._handleResumeFailed.bind(this),this._NS,"failed"),this._resumedHandler=this._c._addSysHandler(this._handleResumed.bind(this),this._NS,"resumed")},xmlOutput:function(t){return(e.Strophe.isTagEqual(t,"iq")||e.Strophe.isTagEqual(t,"presence")||e.Strophe.isTagEqual(t,"message"))&&this._increaseSentStanzasCounter(t),this._originalXMLOutput.call(this._c,t)},_handleEnabled:function(e){return this._isStreamManagementEnabled=!0,this._resumeToken="true"===e.getAttribute("resume")&&e.getAttribute("id"),this._c.resume(),!0},_handleResumeFailed:function(t){const n=t&&t.firstElementChild&&t.firstElementChild.tagName;return this._c._changeConnectStatus(e.Strophe.Status.ERROR,n,t),this._c._doDisconnect(),!0},_handleResumed:function(t){var n=parseInt(t.getAttribute("h"));if(this._handleAcknowledgedStanzas(n,this._serverProcesssedStanzasCounter),this._resuming=!1,this._c.do_bind=!1,this._c.authenticated=!0,this._c.restored=!0,this._unacknowledgedStanzas.length>0){this.logging&&e.Strophe.debug("SM Sending unacknowledged stanzas",this._unacknowledgedStanzas);for(const e of this._unacknowledgedStanzas)this._c.send(e)}else this.logging&&e.Strophe.debug("SM No unacknowledged stanzas",this._unacknowledgedStanzas);return this._c._changeConnectStatus(e.Strophe.Status.CONNECTED,null),!0},_incomingStanzaHandler:function(t){return(e.Strophe.isTagEqual(t,"iq")||e.Strophe.isTagEqual(t,"presence")||e.Strophe.isTagEqual(t,"message"))&&(this._increaseReceivedStanzasCounter(),this.autoSendCountOnEveryIncomingStanza&&this._answerProcessedStanzas()),!0},_handleAcknowledgedStanzas:function(t,n){var i=t-n;i<0&&this._throwError("New reported stanza count lower than previous. New: "+t+" - Previous: "+n),i>this._unacknowledgedStanzas.length&&this._throwError("Higher reported acknowledge count than unacknowledged stanzas. Reported Acknowledge Count: "+i+" - Unacknowledge Stanza Count: "+this._unacknowledgedStanzas.length+" - New: "+t+" - Previous: "+n);for(var r=0;r<i;r++)for(var s=this._unacknowledgedStanzas.shift(),o=0;o<this._acknowledgedStanzaListeners.length;o++)this._acknowledgedStanzaListeners[o](s);this.logging&&this._unacknowledgedStanzas.length>0&&e.Strophe.warn("SM Unacknowledged stanzas",this._unacknowledgedStanzas),this._serverProcesssedStanzasCounter=t,this.requestResponseInterval>0&&(this._requestResponseIntervalCount=0)},_handleServerRequestHandler:function(){return this._answerProcessedStanzas(),!0},_handleServerAck:function(e){var t=parseInt(e.getAttribute("h"));return this._handleAcknowledgedStanzas(t,this._serverProcesssedStanzasCounter),!0},_answerProcessedStanzas:function(){this._isStreamManagementEnabled&&this._c.send(e.$build("a",{xmlns:this._NS,h:this._clientProcessedStanzasCounter}))},_increaseSentStanzasCounter:function(t){if(this._isStreamManagementEnabled){if(-1!==this._unacknowledgedStanzas.indexOf(t))return;this._unacknowledgedStanzas.push(t),this._clientSentStanzasCounter++,this.requestResponseInterval>0&&(this._requestResponseIntervalCount++,this._requestResponseIntervalCount===this.requestResponseInterval&&setTimeout(()=>{this._connectionStatus===e.Strophe.Status.CONNECTED&&this.requestAcknowledgement()},1))}},_increaseReceivedStanzasCounter:function(){this._isStreamManagementEnabled&&this._clientProcessedStanzasCounter++},_throwError:function(t){throw e.Strophe.error(t),new Error(t)}})}(n(2))},function(e,t,n){(function(e){var i=void 0!==e&&e||"undefined"!=typeof self&&self||window,r=Function.prototype.apply;function s(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new s(r.call(setTimeout,i,arguments),clearTimeout)},t.setInterval=function(){return new s(r.call(setInterval,i,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},s.prototype.unref=s.prototype.ref=function(){},s.prototype.close=function(){this._clearFn.call(i,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(162),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(45))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var i,r,s,o,a,c=1,d={},u=!1,l=e.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(e);h=h&&h.setTimeout?h:e,"[object process]"==={}.toString.call(e.process)?i=function(e){t.nextTick((function(){m(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((s=new MessageChannel).port1.onmessage=function(e){m(e.data)},i=function(e){s.port2.postMessage(e)}):l&&"onreadystatechange"in l.createElement("script")?(r=l.documentElement,i=function(e){var t=l.createElement("script");t.onreadystatechange=function(){m(e),t.onreadystatechange=null,r.removeChild(t),t=null},r.appendChild(t)}):i=function(e){setTimeout(m,0,e)}:(o="setImmediate$"+Math.random()+"$",a=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(o)&&m(+t.data.slice(o.length))},e.addEventListener?e.addEventListener("message",a,!1):e.attachEvent("onmessage",a),i=function(t){e.postMessage(o+t,"*")}),h.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var r={callback:e,args:t};return d[c]=r,i(c),c++},h.clearImmediate=p}function p(e){delete d[e]}function m(e){if(u)setTimeout(m,0,e);else{var t=d[e];if(t){u=!0;try{!function(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(void 0,n)}}(t)}finally{p(e),u=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,n(45),n(62))},function(e,t,n){var i=function(e){return String(Number(e))===e?Number(e):e},r=function(e,t,n){var r=e.name&&e.names;e.push&&!t[e.push]?t[e.push]=[]:r&&!t[e.name]&&(t[e.name]={});var s=e.push?{}:r?t[e.name]:t;!function(e,t,n,r){if(r&&!n)t[r]=i(e[1]);else for(var s=0;s<n.length;s+=1)null!=e[s+1]&&(t[n[s]]=i(e[s+1]))}(n.match(e.reg),s,e.names,e.name),e.push&&t[e.push].push(s)},s=n(84),o=RegExp.prototype.test.bind(/^([a-z])=(.*)/);t.parse=function(e){var t={},n=[],i=t;return e.split(/(\r\n|\r|\n)/).filter(o).forEach((function(e){var t=e[0],o=e.slice(2);"m"===t&&(n.push({rtp:[],fmtp:[]}),i=n[n.length-1]);for(var a=0;a<(s[t]||[]).length;a+=1){var c=s[t][a];if(c.reg.test(o))return r(c,i,o)}})),t.media=n,t};var a=function(e,t){var n=t.split(/=(.+)/,2);return 2===n.length?e[n[0]]=i(n[1]):1===n.length&&t.length>1&&(e[n[0]]=void 0),e};t.parseParams=function(e){return e.split(/;\s?/).reduce(a,{})},t.parseFmtpConfig=t.parseParams,t.parsePayloads=function(e){return e.toString().split(" ").map(Number)},t.parseRemoteCandidates=function(e){for(var t=[],n=e.split(" ").map(i),r=0;r<n.length;r+=3)t.push({component:n[r],ip:n[r+1],port:n[r+2]});return t},t.parseImageAttributes=function(e){return e.split(" ").map((function(e){return e.substring(1,e.length-1).split(",").reduce(a,{})}))},t.parseSimulcastStreamList=function(e){return e.split(";").map((function(e){return e.split(",").map((function(e){var t,n=!1;return"~"!==e[0]?t=i(e):(t=i(e.substring(1,e.length)),n=!0),{scid:t,paused:n}}))}))}},function(e,t,n){var i=n(84),r=/%[sdv%]/g,s=function(e){var t=1,n=arguments,i=n.length;return e.replace(r,(function(e){if(t>=i)return e;var r=n[t];switch(t+=1,e){case"%%":return"%";case"%s":return String(r);case"%d":return Number(r);case"%v":return""}}))},o=function(e,t,n){var i=[e+"="+(t.format instanceof Function?t.format(t.push?n:n[t.name]):t.format)];if(t.names)for(var r=0;r<t.names.length;r+=1){var o=t.names[r];t.name?i.push(n[t.name][o]):i.push(n[t.names[r]])}else i.push(n[t.name]);return s.apply(null,i)},a=["v","o","s","i","u","e","p","c","b","t","r","z","a"],c=["i","c","b","a"];e.exports=function(e,t){t=t||{},null==e.version&&(e.version=0),null==e.name&&(e.name=" "),e.media.forEach((function(e){null==e.payloads&&(e.payloads="")}));var n=t.outerOrder||a,r=t.innerOrder||c,s=[];return n.forEach((function(t){i[t].forEach((function(n){n.name in e&&null!=e[n.name]?s.push(o(t,n,e)):n.push in e&&null!=e[n.push]&&e[n.push].forEach((function(e){s.push(o(t,n,e))}))}))})),e.media.forEach((function(e){s.push(o("m",i.m[0],e)),r.forEach((function(t){i[t].forEach((function(n){n.name in e&&null!=e[n.name]?s.push(o(t,n,e)):n.push in e&&null!=e[n.push]&&e[n.push].forEach((function(e){s.push(o(t,n,e))}))}))}))})),s.join("\r\n")+"\r\n"}},function(e,t,n){var i=function(e){return String(Number(e))===e?Number(e):e},r=function(e,t,n){var r=e.name&&e.names;e.push&&!t[e.push]?t[e.push]=[]:r&&!t[e.name]&&(t[e.name]={});var s=e.push?{}:r?t[e.name]:t;!function(e,t,n,r){if(r&&!n)t[r]=i(e[1]);else for(var s=0;s<n.length;s+=1)null!=e[s+1]&&(t[n[s]]=i(e[s+1]))}(n.match(e.reg),s,e.names,e.name),e.push&&t[e.push].push(s)},s=n(85),o=RegExp.prototype.test.bind(/^([a-z])=(.*)/);t.parse=function(e){var t={},n=[],i=t;return e.split(/(\r\n|\r|\n)/).filter(o).forEach((function(e){var t=e[0],o=e.slice(2);"m"===t&&(n.push({rtp:[],fmtp:[]}),i=n[n.length-1]);for(var a=0;a<(s[t]||[]).length;a+=1){var c=s[t][a];if(c.reg.test(o))return r(c,i,o)}})),t.media=n,t};var a=function(e,t){var n=t.split(/=(.+)/,2);return 2===n.length&&(e[n[0]]=i(n[1])),e};t.parseParams=function(e){return e.split(/\;\s?/).reduce(a,{})},t.parseFmtpConfig=t.parseParams,t.parsePayloads=function(e){return e.split(" ").map(Number)},t.parseRemoteCandidates=function(e){for(var t=[],n=e.split(" ").map(i),r=0;r<n.length;r+=3)t.push({component:n[r],ip:n[r+1],port:n[r+2]});return t},t.parseImageAttributes=function(e){return e.split(" ").map((function(e){return e.substring(1,e.length-1).split(",").reduce(a,{})}))},t.parseSimulcastStreamList=function(e){return e.split(";").map((function(e){return e.split(",").map((function(e){var t,n=!1;return"~"!==e[0]?t=i(e):(t=i(e.substring(1,e.length)),n=!0),{scid:t,paused:n}}))}))}},function(e,t,n){var i=n(85),r=/%[sdv%]/g,s=function(e){var t=1,n=arguments,i=n.length;return e.replace(r,(function(e){if(t>=i)return e;var r=n[t];switch(t+=1,e){case"%%":return"%";case"%s":return String(r);case"%d":return Number(r);case"%v":return""}}))},o=function(e,t,n){var i=[e+"="+(t.format instanceof Function?t.format(t.push?n:n[t.name]):t.format)];if(t.names)for(var r=0;r<t.names.length;r+=1){var o=t.names[r];t.name?i.push(n[t.name][o]):i.push(n[t.names[r]])}else i.push(n[t.name]);return s.apply(null,i)},a=["v","o","s","i","u","e","p","c","b","t","r","z","a"],c=["i","c","b","a"];e.exports=function(e,t){t=t||{},null==e.version&&(e.version=0),null==e.name&&(e.name=" "),e.media.forEach((function(e){null==e.payloads&&(e.payloads="")}));var n=t.outerOrder||a,r=t.innerOrder||c,s=[];return n.forEach((function(t){i[t].forEach((function(n){n.name in e&&null!=e[n.name]?s.push(o(t,n,e)):n.push in e&&null!=e[n.push]&&e[n.push].forEach((function(e){s.push(o(t,n,e))}))}))})),e.media.forEach((function(e){s.push(o("m",i.m[0],e)),r.forEach((function(t){i[t].forEach((function(n){n.name in e&&null!=e[n.name]?s.push(o(t,n,e)):n.push in e&&null!=e[n.push]&&e[n.push].forEach((function(e){s.push(o(t,n,e))}))}))}))})),s.join("\r\n")+"\r\n"}},function(e,t,n){var i=n(25),r=n(168),s=r.parseSsrcs,o=r.writeSsrcs;function a(e,t,n){return e.ssrcs.filter((function(e){return e.id===t})).filter((function(e){return e.attribute===n})).map((function(e){return e.value}))[0]}function c(e){this.options=e||{},this.options.numOfLayers||(this.options.numOfLayers=3),console.log("SdpSimulcast: using "+this.options.numOfLayers+" layers"),this.ssrcCache=[]}function d(e,t){null!=e&&Array.isArray(e.media)&&e.media.forEach((function(e){"video"===e.type&&t(e)}))}function u(e){return e&&null!=e&&e.type&&""!=e.type&&e.sdp&&""!=e.sdp}c.prototype.clearSsrcCache=function(){this.ssrcCache=[]},c.prototype.setSsrcCache=function(e){this.ssrcCache=e},c.prototype._parseSimLayers=function(e){var t=e.ssrcGroups&&e.ssrcGroups.find((function(e){return"SIM"===e.semantics}));return t?t.ssrcs.split(" ").map((function(e){return parseInt(e)})):[e.ssrcs[0].id]},c.prototype._buildNewToOldSsrcMap=function(e,t){for(var n={},i=0;i<e.length;++i){var r=e[i],s=t[i]||null;n[r]=s}return n},c.prototype._fillInSourceDataFromCache=function(e){console.log("SdpSimulcast restoring from cache: ",this.ssrcCache);var t=this._parseSimLayers(e);console.log("SdpSimulcast Parsed new sim ssrcs: ",t);var n=a(e,t[0],"msid"),i=a(e,t[0],"cname"),r=this._buildNewToOldSsrcMap(t,this.ssrcCache);console.log("SdpSimulcast built replacement map: ",r);var s=this.ssrcCache.filter((function(e){return-1===Object.values(r).indexOf(e)}));return console.log("SdpSimulcast built ssrcs to add: ",s),e.ssrcs.forEach((function(e){r[e.id]&&(e.id=r[e.id])})),s.forEach((function(t){e.ssrcs.push({id:t,attribute:"msid",value:n}),e.ssrcs.push({id:t,attribute:"cname",value:i})})),e.ssrcGroups=e.ssrcGroups||[],e.ssrcGroups.push({semantics:"SIM",ssrcs:this.ssrcCache.join(" ")}),e},c.prototype._generateSourceData=function(e,t){var n=function(e,t){e.ssrcs.push({id:t,attribute:"cname",value:r}),e.ssrcs.push({id:t,attribute:"msid",value:i})},i=a(e,t,"msid"),r=a(e,t,"cname");this.options.usesUnifiedPlan&&!i&&(i=e.msid,e.ssrcs.forEach(t=>{e.ssrcs.push({id:t.id,attribute:"msid",value:i})}));for(var s=[],o=0;o<this.options.numOfLayers-1;++o){var c=Math.floor(4294967295*Math.random())+0;n(e,c),s.push(c)}return e.ssrcGroups=e.ssrcGroups||[],e.ssrcGroups.push({semantics:"SIM",ssrcs:t+" "+s.join(" ")}),e},c.prototype._restoreSimulcast=function(e){var t,n=e.ssrcs&&e.ssrcs.map((function(e){return e.id})).filter((function(e,t,n){return n.indexOf(e)===t})).length||0,i=e.ssrcGroups&&e.ssrcGroups.length||0;if(0===n||n>2)return e;if(2==n&&0===i)return e;if(1===n)t=e.ssrcs[0].id;else{var r=e.ssrcGroups.filter((function(e){return"FID"===e.semantics}))[0];if(!r)return e;t=parseInt(r.ssrcs.split(" ")[0])}return console.log("SdpSimulcast: current ssrc cache: ",this.ssrcCache),console.log("SdpSimulcast: parsed primary ssrc "+t),-1!==this.ssrcCache.indexOf(t)?(console.log("SdpSimulcast: Have seen primary ssrc before, filling in data from cache"),e=this._fillInSourceDataFromCache(e)):(console.log("SdpSimulcast: Have not seen primary ssrc before, generating source data"),e=this._generateSourceData(e,t)),this.ssrcCache=this._parseSimLayers(e),e},c.prototype.mungeRemoteDescription=function(e,t){if(!u(e))return e;var n=i.parse(e.sdp),r=this;return d(n,(function(e){r.options.explodeRemoteSimulcast?function(e){if(e&&Array.isArray(e.ssrcGroups))for(var t=s(e),n=[],i=e.ssrcGroups.length;i--;)if("SIM"===e.ssrcGroups[i].semantics){for(var r=e.ssrcGroups[i].ssrcs.split(" "),a=0;a<r.length;a++){var c=r[a];n.push(c);var d=t[c].msid.split(" ");t[c].msid=[d[0],"/",a," ",d[1],"/",a].join(""),t[c].cname=[t[c].cname,"/",a].join(""),e.ssrcGroups.forEach((function(e){if("SIM"!==e.semantics){var i=e.ssrcs.split(" ");-1!==i.indexOf(c)&&i.forEach((function(e){t[e].msid=t[c].msid,t[e].cname=t[c].cname,e!==c&&n.push(e)}))}}))}e.ssrcs=o(t,n),e.ssrcGroups.splice(i,1)}}(e):function(e){if(e&&Array.isArray(e.ssrcGroups)){var t=s(e);e.ssrcGroups.forEach((function(n){if("SIM"===n.semantics){console.info("Imploding SIM group: "+n.ssrcs),n.nuke=!0;for(var i=n.ssrcs.split(" "),r=1;r<i.length;r++){var s=i[r];delete t[s],e.ssrcGroups.forEach((function(e){if("SIM"!==e.semantics){var n=e.ssrcs.split(" ");-1!==n.indexOf(s)&&(n.forEach((function(e){delete t[e]})),e.nuke=!0)}}))}}})),e.ssrcs=o(t);for(var n=e.ssrcGroups.length;n--;)e.ssrcGroups[n].nuke&&e.ssrcGroups.splice(n,1)}else console.info("Halt: There are no SSRC groups in the remote description.")}(e),!r.options.usesUnifiedPlan&&t?function(e){e&&(Array.isArray(e.invalid)||(e.invalid=[]),e.invalid.some((function(e){return"x-google-flag:conference"===e.value}))||e.invalid.push({value:"x-google-flag:conference"}))}(e):function(e){e&&void 0!==e.xGoogleFlag&&(e.xGoogleFlag=void 0)}(e)})),new RTCSessionDescription({type:e.type,sdp:i.write(n)})},c.prototype.mungeLocalDescription=function(e){if(!u(e))return e;var t=i.parse(e.sdp),n=this;return d(t,(function(e){"recvonly"!=e.direction&&"inactive"!=e.direction&&n._restoreSimulcast(e)})),new RTCSessionDescription({type:e.type,sdp:i.write(t)})},e.exports=c},function(e,t){t.writeSsrcs=function(e,t){var n=[];if(void 0!==e&&0!==Object.keys(e).length){Array.isArray(t)||(t=[]);for(var i=0;i<t.length;i++){var r=t[i],s=e[r];Object.keys(s).forEach((function(e){n.push({id:r,attribute:e,value:s[e]})}))}Object.keys(e).forEach((function(i){if(i=parseInt(i),!(t.indexOf(i)>=0)){var r=e[i];Object.keys(r).forEach((function(e){n.push({id:i,attribute:e,value:r[e]})}))}}))}return n},t.parseSsrcs=function(e){var t={};return void 0!==e.ssrcs&&Array.isArray(e.ssrcs)&&e.ssrcs.forEach((function(e){t[e.id]||(t[e.id]={}),t[e.id][e.attribute]=e.value})),t}},function(e,t){e.exports=function(e,t,n,i){this.blob=e,this.name=t,this.startTime=n,this.wordArray=i}},function(e,t,n){const i=n(171),r=n(86),s=n(172),o=function(){this.url=function(){const e="config does not contain an url to a Sphinx4 https server";if(void 0===config.sphinxURL)console.log(e);else{const t=config.sphinxURL;if(void 0!==t.includes&&t.includes("https://"))return t;console.log(e)}}()};o.prototype=Object.create(s.prototype),o.constructor=o,o.prototype.sendRequest=function(e,t){console.log("sending an audio file to "+this.url),console.log("the audio file being sent: "+e);const n=new XMLHttpRequest;n.onreadystatechange=function(){if(n.readyState===XMLHttpRequest.DONE&&200===n.status)t(n.responseText);else if(n.readyState===XMLHttpRequest.DONE)throw new Error("unable to accept response from sphinx server. status: "+n.status)},n.open("POST",this.url),n.setRequestHeader("Content-Type",r.determineCorrectFileType()),n.send(e),console.log("send "+e)},o.prototype.formatResponse=function(e){const t=JSON.parse(e).objects;t.shift();const n=[];return t.forEach(e=>e.filler||n.push(new i(e.word,e.start,e.end))),n},o.prototype.verify=function(e){if(console.log("response from server:"+e.toString()),"string"!=typeof e)return!1;let t;try{t=JSON.parse(e)}catch(e){return console.log(e),!1}if(void 0===t.objects)return!1;const n=t.objects;return!(!n[0]||!n[0]["session-id"])},e.exports=o},function(e,t){const n=function(e,t,n){this.word=e,this.begin=t,this.end=n};n.prototype.getWord=function(){return this.word},n.prototype.getBeginTime=function(){return this.begin},n.prototype.getEndTime=function(){return this.end},e.exports=n},function(e,t){const n=function(){throw new Error("TranscriptionService is abstract and cannot becreated")};n.prototype.send=function(e,t){this.sendRequest(e.blob,n=>{this.verify(n)?e.wordArray=this.formatResponse(n):(console.log("the retrieved response from the server is not valid!"),e.wordArray=[]),t(e)})},n.prototype.sendRequest=function(e,t){throw new Error("TranscriptionService.sendRequest is abstract")},n.prototype.formatResponse=function(e){throw new Error("TranscriptionService.format is abstract")},n.prototype.verify=function(e){throw new Error("TranscriptionService.verify is abstract")},e.exports=n},function(e,t,n){"use strict";n.r(t);var i={};n.r(i),n.d(i,"shimGetUserMedia",(function(){return S})),n.d(i,"shimGetDisplayMedia",(function(){return y})),n.d(i,"shimMediaStream",(function(){return E})),n.d(i,"shimOnTrack",(function(){return b})),n.d(i,"shimGetSendersWithDtmf",(function(){return C})),n.d(i,"shimGetStats",(function(){return T})),n.d(i,"shimSenderReceiverGetStats",(function(){return R})),n.d(i,"shimAddTrackRemoveTrackWithNative",(function(){return A})),n.d(i,"shimAddTrackRemoveTrack",(function(){return I})),n.d(i,"shimPeerConnection",(function(){return w})),n.d(i,"fixNegotiationNeeded",(function(){return P}));var r={};n.r(r),n.d(r,"shimGetUserMedia",(function(){return O})),n.d(r,"shimGetDisplayMedia",(function(){return D})),n.d(r,"shimOnTrack",(function(){return N})),n.d(r,"shimPeerConnection",(function(){return M})),n.d(r,"shimSenderGetStats",(function(){return L})),n.d(r,"shimReceiverGetStats",(function(){return k})),n.d(r,"shimRemoveStream",(function(){return x})),n.d(r,"shimRTCDataChannel",(function(){return F})),n.d(r,"shimAddTransceiver",(function(){return j})),n.d(r,"shimGetParameters",(function(){return U})),n.d(r,"shimCreateOffer",(function(){return H})),n.d(r,"shimCreateAnswer",(function(){return V}));var s={};n.r(s),n.d(s,"shimLocalStreamsAPI",(function(){return B})),n.d(s,"shimRemoteStreamsAPI",(function(){return J})),n.d(s,"shimCallbacksAPI",(function(){return G})),n.d(s,"shimGetUserMedia",(function(){return $})),n.d(s,"shimConstraints",(function(){return K})),n.d(s,"shimRTCIceServerUrls",(function(){return q})),n.d(s,"shimTrackEventTransceiver",(function(){return W})),n.d(s,"shimCreateOfferLegacy",(function(){return z})),n.d(s,"shimAudioContext",(function(){return Q}));var o={};n.r(o),n.d(o,"shimRTCIceCandidate",(function(){return Z})),n.d(o,"shimMaxMessageSize",(function(){return ee})),n.d(o,"shimSendThrowTypeError",(function(){return te})),n.d(o,"shimConnectionState",(function(){return ne})),n.d(o,"removeExtmapAllowMixed",(function(){return ie})),n.d(o,"shimAddIceCandidateNullOrEmpty",(function(){return re}));let a=!0,c=!0;function d(e,t,n){const i=e.match(t);return i&&i.length>=n&&parseInt(i[n],10)}function u(e,t,n){if(!e.RTCPeerConnection)return;const i=e.RTCPeerConnection.prototype,r=i.addEventListener;i.addEventListener=function(e,i){if(e!==t)return r.apply(this,arguments);const s=e=>{const t=n(e);t&&(i.handleEvent?i.handleEvent(t):i(t))};return this._eventMap=this._eventMap||{},this._eventMap[t]||(this._eventMap[t]=new Map),this._eventMap[t].set(i,s),r.apply(this,[e,s])};const s=i.removeEventListener;i.removeEventListener=function(e,n){if(e!==t||!this._eventMap||!this._eventMap[t])return s.apply(this,arguments);if(!this._eventMap[t].has(n))return s.apply(this,arguments);const i=this._eventMap[t].get(n);return this._eventMap[t].delete(n),0===this._eventMap[t].size&&delete this._eventMap[t],0===Object.keys(this._eventMap).length&&delete this._eventMap,s.apply(this,[e,i])},Object.defineProperty(i,"on"+t,{get(){return this["_on"+t]},set(e){this["_on"+t]&&(this.removeEventListener(t,this["_on"+t]),delete this["_on"+t]),e&&this.addEventListener(t,this["_on"+t]=e)},enumerable:!0,configurable:!0})}function l(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(a=e,e?"adapter.js logging disabled":"adapter.js logging enabled")}function h(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(c=!e,"adapter.js deprecation warnings "+(e?"disabled":"enabled"))}function p(){if("object"==typeof window){if(a)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}}function m(e,t){c&&console.warn(e+" is deprecated, please use "+t+" instead.")}function f(e){return"[object Object]"===Object.prototype.toString.call(e)}function g(e){return f(e)?Object.keys(e).reduce((function(t,n){const i=f(e[n]),r=i?g(e[n]):e[n],s=i&&!Object.keys(r).length;return void 0===r||s?t:Object.assign(t,{[n]:r})}),{}):e}function _(e,t,n){const i=n?"outbound-rtp":"inbound-rtp",r=new Map;if(null===t)return r;const s=[];return e.forEach(e=>{"track"===e.type&&e.trackIdentifier===t.id&&s.push(e)}),s.forEach(t=>{e.forEach(n=>{n.type===i&&n.trackId===t.id&&function e(t,n,i){n&&!i.has(n.id)&&(i.set(n.id,n),Object.keys(n).forEach(r=>{r.endsWith("Id")?e(t,t.get(n[r]),i):r.endsWith("Ids")&&n[r].forEach(n=>{e(t,t.get(n),i)})}))}(e,n,r)})}),r}const v=p;function S(e,t){const n=e&&e.navigator;if(!n.mediaDevices)return;const i=function(e){if("object"!=typeof e||e.mandatory||e.optional)return e;const t={};return Object.keys(e).forEach(n=>{if("require"===n||"advanced"===n||"mediaSource"===n)return;const i="object"==typeof e[n]?e[n]:{ideal:e[n]};void 0!==i.exact&&"number"==typeof i.exact&&(i.min=i.max=i.exact);const r=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):"deviceId"===t?"sourceId":t};if(void 0!==i.ideal){t.optional=t.optional||[];let e={};"number"==typeof i.ideal?(e[r("min",n)]=i.ideal,t.optional.push(e),e={},e[r("max",n)]=i.ideal,t.optional.push(e)):(e[r("",n)]=i.ideal,t.optional.push(e))}void 0!==i.exact&&"number"!=typeof i.exact?(t.mandatory=t.mandatory||{},t.mandatory[r("",n)]=i.exact):["min","max"].forEach(e=>{void 0!==i[e]&&(t.mandatory=t.mandatory||{},t.mandatory[r(e,n)]=i[e])})}),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},r=function(e,r){if(t.version>=61)return r(e);if((e=JSON.parse(JSON.stringify(e)))&&"object"==typeof e.audio){const t=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])};t((e=JSON.parse(JSON.stringify(e))).audio,"autoGainControl","googAutoGainControl"),t(e.audio,"noiseSuppression","googNoiseSuppression"),e.audio=i(e.audio)}if(e&&"object"==typeof e.video){let s=e.video.facingMode;s=s&&("object"==typeof s?s:{ideal:s});const o=t.version<66;if(s&&("user"===s.exact||"environment"===s.exact||"user"===s.ideal||"environment"===s.ideal)&&(!n.mediaDevices.getSupportedConstraints||!n.mediaDevices.getSupportedConstraints().facingMode||o)){let t;if(delete e.video.facingMode,"environment"===s.exact||"environment"===s.ideal?t=["back","rear"]:"user"!==s.exact&&"user"!==s.ideal||(t=["front"]),t)return n.mediaDevices.enumerateDevices().then(n=>{let o=(n=n.filter(e=>"videoinput"===e.kind)).find(e=>t.some(t=>e.label.toLowerCase().includes(t)));return!o&&n.length&&t.includes("back")&&(o=n[n.length-1]),o&&(e.video.deviceId=s.exact?{exact:o.deviceId}:{ideal:o.deviceId}),e.video=i(e.video),v("chrome: "+JSON.stringify(e)),r(e)})}e.video=i(e.video)}return v("chrome: "+JSON.stringify(e)),r(e)},s=function(e){return t.version>=64?e:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[e.name]||e.name,message:e.message,constraint:e.constraint||e.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}};if(n.getUserMedia=function(e,t,i){r(e,e=>{n.webkitGetUserMedia(e,t,e=>{i&&i(s(e))})})}.bind(n),n.mediaDevices.getUserMedia){const e=n.mediaDevices.getUserMedia.bind(n.mediaDevices);n.mediaDevices.getUserMedia=function(t){return r(t,t=>e(t).then(e=>{if(t.audio&&!e.getAudioTracks().length||t.video&&!e.getVideoTracks().length)throw e.getTracks().forEach(e=>{e.stop()}),new DOMException("","NotFoundError");return e},e=>Promise.reject(s(e))))}}}function y(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&("function"==typeof t?e.navigator.mediaDevices.getDisplayMedia=function(n){return t(n).then(t=>{const i=n.video&&n.video.width,r=n.video&&n.video.height,s=n.video&&n.video.frameRate;return n.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:t,maxFrameRate:s||3}},i&&(n.video.mandatory.maxWidth=i),r&&(n.video.mandatory.maxHeight=r),e.navigator.mediaDevices.getUserMedia(n)})}:console.error("shimGetDisplayMedia: getSourceId argument is not a function"))}function E(e){e.MediaStream=e.MediaStream||e.webkitMediaStream}function b(e){if("object"==typeof e&&e.RTCPeerConnection&&!("ontrack"in e.RTCPeerConnection.prototype)){Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(e){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=e)},enumerable:!0,configurable:!0});const t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=t=>{t.stream.addEventListener("addtrack",n=>{let i;i=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find(e=>e.track&&e.track.id===n.track.id):{track:n.track};const r=new Event("track");r.track=n.track,r.receiver=i,r.transceiver={receiver:i},r.streams=[t.stream],this.dispatchEvent(r)}),t.stream.getTracks().forEach(n=>{let i;i=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find(e=>e.track&&e.track.id===n.id):{track:n};const r=new Event("track");r.track=n,r.receiver=i,r.transceiver={receiver:i},r.streams=[t.stream],this.dispatchEvent(r)})},this.addEventListener("addstream",this._ontrackpoly)),t.apply(this,arguments)}}else u(e,"track",e=>(e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e))}function C(e){if("object"==typeof e&&e.RTCPeerConnection&&!("getSenders"in e.RTCPeerConnection.prototype)&&"createDTMFSender"in e.RTCPeerConnection.prototype){const t=function(e,t){return{track:t,get dtmf(){return void 0===this._dtmf&&("audio"===t.kind?this._dtmf=e.createDTMFSender(t):this._dtmf=null),this._dtmf},_pc:e}};if(!e.RTCPeerConnection.prototype.getSenders){e.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const n=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,i){let r=n.apply(this,arguments);return r||(r=t(this,e),this._senders.push(r)),r};const i=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){i.apply(this,arguments);const t=this._senders.indexOf(e);-1!==t&&this._senders.splice(t,1)}}const n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._senders=this._senders||[],n.apply(this,[e]),e.getTracks().forEach(e=>{this._senders.push(t(this,e))})};const i=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){this._senders=this._senders||[],i.apply(this,[e]),e.getTracks().forEach(e=>{const t=this._senders.find(t=>t.track===e);t&&this._senders.splice(this._senders.indexOf(t),1)})}}else if("object"==typeof e&&e.RTCPeerConnection&&"getSenders"in e.RTCPeerConnection.prototype&&"createDTMFSender"in e.RTCPeerConnection.prototype&&e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)){const t=e.RTCPeerConnection.prototype.getSenders;e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e},Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function T(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,n,i]=arguments;if(arguments.length>0&&"function"==typeof e)return t.apply(this,arguments);if(0===t.length&&(0===arguments.length||"function"!=typeof e))return t.apply(this,[]);const r=function(e){const t={};return e.result().forEach(e=>{const n={id:e.id,timestamp:e.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type};e.names().forEach(t=>{n[t]=e.stat(t)}),t[n.id]=n}),t},s=function(e){return new Map(Object.keys(e).map(t=>[t,e[t]]))};if(arguments.length>=2){const i=function(e){n(s(r(e)))};return t.apply(this,[i,e])}return new Promise((e,n)=>{t.apply(this,[function(t){e(s(r(t)))},n])}).then(n,i)}}function R(e){if(!("object"==typeof e&&e.RTCPeerConnection&&e.RTCRtpSender&&e.RTCRtpReceiver))return;if(!("getStats"in e.RTCRtpSender.prototype)){const t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e});const n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){const e=this;return this._pc.getStats().then(t=>_(t,e.track,!0))}}if(!("getStats"in e.RTCRtpReceiver.prototype)){const t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){const e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e}),u(e,"track",e=>(e.receiver._pc=e.srcElement,e)),e.RTCRtpReceiver.prototype.getStats=function(){const e=this;return this._pc.getStats().then(t=>_(t,e.track,!1))}}if(!("getStats"in e.RTCRtpSender.prototype)||!("getStats"in e.RTCRtpReceiver.prototype))return;const t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof e.MediaStreamTrack){const e=arguments[0];let t,n,i;return this.getSenders().forEach(n=>{n.track===e&&(t?i=!0:t=n)}),this.getReceivers().forEach(t=>(t.track===e&&(n?i=!0:n=t),t.track===e)),i||t&&n?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):t?t.getStats():n?n.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return t.apply(this,arguments)}}function A(e){e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(e=>this._shimmedLocalStreams[e][0])};const t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,n){if(!n)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const i=t.apply(this,arguments);return this._shimmedLocalStreams[n.id]?-1===this._shimmedLocalStreams[n.id].indexOf(i)&&this._shimmedLocalStreams[n.id].push(i):this._shimmedLocalStreams[n.id]=[n,i],i};const n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._shimmedLocalStreams=this._shimmedLocalStreams||{},e.getTracks().forEach(e=>{if(this.getSenders().find(t=>t.track===e))throw new DOMException("Track already exists.","InvalidAccessError")});const t=this.getSenders();n.apply(this,arguments);const i=this.getSenders().filter(e=>-1===t.indexOf(e));this._shimmedLocalStreams[e.id]=[e].concat(i)};const i=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[e.id],i.apply(this,arguments)};const r=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},e&&Object.keys(this._shimmedLocalStreams).forEach(t=>{const n=this._shimmedLocalStreams[t].indexOf(e);-1!==n&&this._shimmedLocalStreams[t].splice(n,1),1===this._shimmedLocalStreams[t].length&&delete this._shimmedLocalStreams[t]}),r.apply(this,arguments)}}function I(e,t){if(!e.RTCPeerConnection)return;if(e.RTCPeerConnection.prototype.addTrack&&t.version>=65)return A(e);const n=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){const e=n.apply(this);return this._reverseStreams=this._reverseStreams||{},e.map(e=>this._reverseStreams[e.id])};const i=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(t){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},t.getTracks().forEach(e=>{if(this.getSenders().find(t=>t.track===e))throw new DOMException("Track already exists.","InvalidAccessError")}),!this._reverseStreams[t.id]){const n=new e.MediaStream(t.getTracks());this._streams[t.id]=n,this._reverseStreams[n.id]=t,t=n}i.apply(this,[t])};const r=e.RTCPeerConnection.prototype.removeStream;function s(e,t){let n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach(t=>{const i=e._reverseStreams[t],r=e._streams[i.id];n=n.replace(new RegExp(r.id,"g"),i.id)}),new RTCSessionDescription({type:t.type,sdp:n})}function o(e,t){let n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach(t=>{const i=e._reverseStreams[t],r=e._streams[i.id];n=n.replace(new RegExp(i.id,"g"),r.id)}),new RTCSessionDescription({type:t.type,sdp:n})}e.RTCPeerConnection.prototype.removeStream=function(e){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},r.apply(this,[this._streams[e.id]||e]),delete this._reverseStreams[this._streams[e.id]?this._streams[e.id].id:e.id],delete this._streams[e.id]},e.RTCPeerConnection.prototype.addTrack=function(t,n){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const i=[].slice.call(arguments,1);if(1!==i.length||!i[0].getTracks().find(e=>e===t))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");const r=this.getSenders().find(e=>e.track===t);if(r)throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const s=this._streams[n.id];if(s)s.addTrack(t),Promise.resolve().then(()=>{this.dispatchEvent(new Event("negotiationneeded"))});else{const i=new e.MediaStream([t]);this._streams[n.id]=i,this._reverseStreams[i.id]=n,this.addStream(i)}return this.getSenders().find(e=>e.track===t)},["createOffer","createAnswer"].forEach((function(t){const n=e.RTCPeerConnection.prototype[t],i={[t](){const e=arguments;return arguments.length&&"function"==typeof arguments[0]?n.apply(this,[t=>{const n=s(this,t);e[0].apply(null,[n])},t=>{e[1]&&e[1].apply(null,t)},arguments[2]]):n.apply(this,arguments).then(e=>s(this,e))}};e.RTCPeerConnection.prototype[t]=i[t]}));const a=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=o(this,arguments[0]),a.apply(this,arguments)):a.apply(this,arguments)};const c=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get(){const e=c.get.apply(this);return""===e.type?e:s(this,e)}}),e.RTCPeerConnection.prototype.removeTrack=function(e){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!e._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(!(e._pc===this))throw new DOMException("Sender was not created by this connection.","InvalidAccessError");let t;this._streams=this._streams||{},Object.keys(this._streams).forEach(n=>{this._streams[n].getTracks().find(t=>e.track===t)&&(t=this._streams[n])}),t&&(1===t.getTracks().length?this.removeStream(this._reverseStreams[t.id]):t.removeTrack(e.track),this.dispatchEvent(new Event("negotiationneeded")))}}function w(e,t){!e.RTCPeerConnection&&e.webkitRTCPeerConnection&&(e.RTCPeerConnection=e.webkitRTCPeerConnection),e.RTCPeerConnection&&t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){const n=e.RTCPeerConnection.prototype[t],i={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=i[t]}))}function P(e,t){u(e,"negotiationneeded",e=>{const n=e.target;if(!(t.version<72||n.getConfiguration&&"plan-b"===n.getConfiguration().sdpSemantics)||"stable"===n.signalingState)return e})}function O(e,t){const n=e&&e.navigator,i=e&&e.MediaStreamTrack;if(n.getUserMedia=function(e,t,i){m("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),n.mediaDevices.getUserMedia(e).then(t,i)},!(t.version>55&&"autoGainControl"in n.mediaDevices.getSupportedConstraints())){const e=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])},t=n.mediaDevices.getUserMedia.bind(n.mediaDevices);if(n.mediaDevices.getUserMedia=function(n){return"object"==typeof n&&"object"==typeof n.audio&&(n=JSON.parse(JSON.stringify(n)),e(n.audio,"autoGainControl","mozAutoGainControl"),e(n.audio,"noiseSuppression","mozNoiseSuppression")),t(n)},i&&i.prototype.getSettings){const t=i.prototype.getSettings;i.prototype.getSettings=function(){const n=t.apply(this,arguments);return e(n,"mozAutoGainControl","autoGainControl"),e(n,"mozNoiseSuppression","noiseSuppression"),n}}if(i&&i.prototype.applyConstraints){const t=i.prototype.applyConstraints;i.prototype.applyConstraints=function(n){return"audio"===this.kind&&"object"==typeof n&&(n=JSON.parse(JSON.stringify(n)),e(n,"autoGainControl","mozAutoGainControl"),e(n,"noiseSuppression","mozNoiseSuppression")),t.apply(this,[n])}}}}function D(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&(e.navigator.mediaDevices.getDisplayMedia=function(n){if(!n||!n.video){const e=new DOMException("getDisplayMedia without video constraints is undefined");return e.name="NotFoundError",e.code=8,Promise.reject(e)}return!0===n.video?n.video={mediaSource:t}:n.video.mediaSource=t,e.navigator.mediaDevices.getUserMedia(n)})}function N(e){"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function M(e,t){if("object"!=typeof e||!e.RTCPeerConnection&&!e.mozRTCPeerConnection)return;!e.RTCPeerConnection&&e.mozRTCPeerConnection&&(e.RTCPeerConnection=e.mozRTCPeerConnection),t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){const n=e.RTCPeerConnection.prototype[t],i={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=i[t]}));const n={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},i=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,r,s]=arguments;return i.apply(this,[e||null]).then(e=>{if(t.version<53&&!r)try{e.forEach(e=>{e.type=n[e.type]||e.type})}catch(t){if("TypeError"!==t.name)throw t;e.forEach((t,i)=>{e.set(i,Object.assign({},t,{type:n[t.type]||t.type}))})}return e}).then(r,s)}}function L(e){if("object"!=typeof e||!e.RTCPeerConnection||!e.RTCRtpSender)return;if(e.RTCRtpSender&&"getStats"in e.RTCRtpSender.prototype)return;const t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e});const n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function k(e){if("object"!=typeof e||!e.RTCPeerConnection||!e.RTCRtpSender)return;if(e.RTCRtpSender&&"getStats"in e.RTCRtpReceiver.prototype)return;const t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){const e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e}),u(e,"track",e=>(e.receiver._pc=e.srcElement,e)),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function x(e){e.RTCPeerConnection&&!("removeStream"in e.RTCPeerConnection.prototype)&&(e.RTCPeerConnection.prototype.removeStream=function(e){m("removeStream","removeTrack"),this.getSenders().forEach(t=>{t.track&&e.getTracks().includes(t.track)&&this.removeTrack(t)})})}function F(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)}function j(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.addTransceiver;t&&(e.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];const e=arguments[1],n=e&&"sendEncodings"in e;n&&e.sendEncodings.forEach(e=>{if("rid"in e){if(!/^[a-z0-9]{0,16}$/i.test(e.rid))throw new TypeError("Invalid RID value provided.")}if("scaleResolutionDownBy"in e&&!(parseFloat(e.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in e&&!(parseFloat(e.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")});const i=t.apply(this,arguments);if(n){const{sender:t}=i,n=t.getParameters();(!("encodings"in n)||1===n.encodings.length&&0===Object.keys(n.encodings[0]).length)&&(n.encodings=e.sendEncodings,t.sendEncodings=e.sendEncodings,this.setParametersPromises.push(t.setParameters(n).then(()=>{delete t.sendEncodings}).catch(()=>{delete t.sendEncodings})))}return i})}function U(e){if("object"!=typeof e||!e.RTCRtpSender)return;const t=e.RTCRtpSender.prototype.getParameters;t&&(e.RTCRtpSender.prototype.getParameters=function(){const e=t.apply(this,arguments);return"encodings"in e||(e.encodings=[].concat(this.sendEncodings||[{}])),e})}function H(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>t.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):t.apply(this,arguments)}}function V(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createAnswer;e.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>t.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):t.apply(this,arguments)}}function B(e){if("object"==typeof e&&e.RTCPeerConnection){if("getLocalStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in e.RTCPeerConnection.prototype)){const t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addStream=function(e){this._localStreams||(this._localStreams=[]),this._localStreams.includes(e)||this._localStreams.push(e),e.getAudioTracks().forEach(n=>t.call(this,n,e)),e.getVideoTracks().forEach(n=>t.call(this,n,e))},e.RTCPeerConnection.prototype.addTrack=function(e,...n){return n&&n.forEach(e=>{this._localStreams?this._localStreams.includes(e)||this._localStreams.push(e):this._localStreams=[e]}),t.apply(this,arguments)}}"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){this._localStreams||(this._localStreams=[]);const t=this._localStreams.indexOf(e);if(-1===t)return;this._localStreams.splice(t,1);const n=e.getTracks();this.getSenders().forEach(e=>{n.includes(e.track)&&this.removeTrack(e)})})}}function J(e){if("object"==typeof e&&e.RTCPeerConnection&&("getRemoteStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in e.RTCPeerConnection.prototype))){Object.defineProperty(e.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(e){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=e),this.addEventListener("track",this._onaddstreampoly=e=>{e.streams.forEach(e=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(e))return;this._remoteStreams.push(e);const t=new Event("addstream");t.stream=e,this.dispatchEvent(t)})})}});const t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){const e=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(t){t.streams.forEach(t=>{if(e._remoteStreams||(e._remoteStreams=[]),e._remoteStreams.indexOf(t)>=0)return;e._remoteStreams.push(t);const n=new Event("addstream");n.stream=t,e.dispatchEvent(n)})}),t.apply(e,arguments)}}}function G(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype,n=t.createOffer,i=t.createAnswer,r=t.setLocalDescription,s=t.setRemoteDescription,o=t.addIceCandidate;t.createOffer=function(e,t){const i=arguments.length>=2?arguments[2]:arguments[0],r=n.apply(this,[i]);return t?(r.then(e,t),Promise.resolve()):r},t.createAnswer=function(e,t){const n=arguments.length>=2?arguments[2]:arguments[0],r=i.apply(this,[n]);return t?(r.then(e,t),Promise.resolve()):r};let a=function(e,t,n){const i=r.apply(this,[e]);return n?(i.then(t,n),Promise.resolve()):i};t.setLocalDescription=a,a=function(e,t,n){const i=s.apply(this,[e]);return n?(i.then(t,n),Promise.resolve()):i},t.setRemoteDescription=a,a=function(e,t,n){const i=o.apply(this,[e]);return n?(i.then(t,n),Promise.resolve()):i},t.addIceCandidate=a}function $(e){const t=e&&e.navigator;if(t.mediaDevices&&t.mediaDevices.getUserMedia){const e=t.mediaDevices,n=e.getUserMedia.bind(e);t.mediaDevices.getUserMedia=e=>n(K(e))}!t.getUserMedia&&t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,n,i){t.mediaDevices.getUserMedia(e).then(n,i)}.bind(t))}function K(e){return e&&void 0!==e.video?Object.assign({},e,{video:g(e.video)}):e}function q(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection;e.RTCPeerConnection=function(e,n){if(e&&e.iceServers){const t=[];for(let n=0;n<e.iceServers.length;n++){let i=e.iceServers[n];!i.hasOwnProperty("urls")&&i.hasOwnProperty("url")?(m("RTCIceServer.url","RTCIceServer.urls"),i=JSON.parse(JSON.stringify(i)),i.urls=i.url,delete i.url,t.push(i)):t.push(e.iceServers[n])}e.iceServers=t}return new t(e,n)},e.RTCPeerConnection.prototype=t.prototype,"generateCertificate"in t&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:()=>t.generateCertificate})}function W(e){"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function z(e){const t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(e){if(e){void 0!==e.offerToReceiveAudio&&(e.offerToReceiveAudio=!!e.offerToReceiveAudio);const t=this.getTransceivers().find(e=>"audio"===e.receiver.track.kind);!1===e.offerToReceiveAudio&&t?"sendrecv"===t.direction?t.setDirection?t.setDirection("sendonly"):t.direction="sendonly":"recvonly"===t.direction&&(t.setDirection?t.setDirection("inactive"):t.direction="inactive"):!0!==e.offerToReceiveAudio||t||this.addTransceiver("audio"),void 0!==e.offerToReceiveVideo&&(e.offerToReceiveVideo=!!e.offerToReceiveVideo);const n=this.getTransceivers().find(e=>"video"===e.receiver.track.kind);!1===e.offerToReceiveVideo&&n?"sendrecv"===n.direction?n.setDirection?n.setDirection("sendonly"):n.direction="sendonly":"recvonly"===n.direction&&(n.setDirection?n.setDirection("inactive"):n.direction="inactive"):!0!==e.offerToReceiveVideo||n||this.addTransceiver("video")}return t.apply(this,arguments)}}function Q(e){"object"!=typeof e||e.AudioContext||(e.AudioContext=e.webkitAudioContext)}var Y=n(48),X=n.n(Y);function Z(e){if(!e.RTCIceCandidate||e.RTCIceCandidate&&"foundation"in e.RTCIceCandidate.prototype)return;const t=e.RTCIceCandidate;e.RTCIceCandidate=function(e){if("object"==typeof e&&e.candidate&&0===e.candidate.indexOf("a=")&&((e=JSON.parse(JSON.stringify(e))).candidate=e.candidate.substr(2)),e.candidate&&e.candidate.length){const n=new t(e),i=X.a.parseCandidate(e.candidate),r=Object.assign(n,i);return r.toJSON=function(){return{candidate:r.candidate,sdpMid:r.sdpMid,sdpMLineIndex:r.sdpMLineIndex,usernameFragment:r.usernameFragment}},r}return new t(e)},e.RTCIceCandidate.prototype=t.prototype,u(e,"icecandidate",t=>(t.candidate&&Object.defineProperty(t,"candidate",{value:new e.RTCIceCandidate(t.candidate),writable:"false"}),t))}function ee(e,t){if(!e.RTCPeerConnection)return;"sctp"in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"sctp",{get(){return void 0===this._sctp?null:this._sctp}});const n=function(e){if(!e||!e.sdp)return!1;const t=X.a.splitSections(e.sdp);return t.shift(),t.some(e=>{const t=X.a.parseMLine(e);return t&&"application"===t.kind&&-1!==t.protocol.indexOf("SCTP")})},i=function(e){const t=e.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===t||t.length<2)return-1;const n=parseInt(t[1],10);return n!=n?-1:n},r=function(e){let n=65536;return"firefox"===t.browser&&(n=t.version<57?-1===e?16384:2147483637:t.version<60?57===t.version?65535:65536:2147483637),n},s=function(e,n){let i=65536;"firefox"===t.browser&&57===t.version&&(i=65535);const r=X.a.matchPrefix(e.sdp,"a=max-message-size:");return r.length>0?i=parseInt(r[0].substr(19),10):"firefox"===t.browser&&-1!==n&&(i=2147483637),i},o=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,"chrome"===t.browser&&t.version>=76){const{sdpSemantics:e}=this.getConfiguration();"plan-b"===e&&Object.defineProperty(this,"sctp",{get(){return void 0===this._sctp?null:this._sctp},enumerable:!0,configurable:!0})}if(n(arguments[0])){const e=i(arguments[0]),t=r(e),n=s(arguments[0],e);let o;o=0===t&&0===n?Number.POSITIVE_INFINITY:0===t||0===n?Math.max(t,n):Math.min(t,n);const a={};Object.defineProperty(a,"maxMessageSize",{get:()=>o}),this._sctp=a}return o.apply(this,arguments)}}function te(e){if(!e.RTCPeerConnection||!("createDataChannel"in e.RTCPeerConnection.prototype))return;function t(e,t){const n=e.send;e.send=function(){const i=arguments[0],r=i.length||i.size||i.byteLength;if("open"===e.readyState&&t.sctp&&r>t.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+t.sctp.maxMessageSize+" bytes)");return n.apply(e,arguments)}}const n=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){const e=n.apply(this,arguments);return t(e,this),e},u(e,"datachannel",e=>(t(e.channel,e.target),e))}function ne(e){if(!e.RTCPeerConnection||"connectionState"in e.RTCPeerConnection.prototype)return;const t=e.RTCPeerConnection.prototype;Object.defineProperty(t,"connectionState",{get(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(t,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(e){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),e&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=e)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach(e=>{const n=t[e];t[e]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=e=>{const t=e.target;if(t._lastConnectionState!==t.connectionState){t._lastConnectionState=t.connectionState;const n=new Event("connectionstatechange",e);t.dispatchEvent(n)}return e},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),n.apply(this,arguments)}})}function ie(e,t){if(!e.RTCPeerConnection)return;if("chrome"===t.browser&&t.version>=71)return;if("safari"===t.browser&&t.version>=605)return;const n=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(t){if(t&&t.sdp&&-1!==t.sdp.indexOf("\na=extmap-allow-mixed")){const n=t.sdp.split("\n").filter(e=>"a=extmap-allow-mixed"!==e.trim()).join("\n");e.RTCSessionDescription&&t instanceof e.RTCSessionDescription?arguments[0]=new e.RTCSessionDescription({type:t.type,sdp:n}):t.sdp=n}return n.apply(this,arguments)}}function re(e,t){if(!e.RTCPeerConnection||!e.RTCPeerConnection.prototype)return;const n=e.RTCPeerConnection.prototype.addIceCandidate;n&&0!==n.length&&(e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?("chrome"===t.browser&&t.version<78||"firefox"===t.browser&&t.version<68||"safari"===t.browser)&&arguments[0]&&""===arguments[0].candidate?Promise.resolve():n.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}const se=function({window:e}={},t={shimChrome:!0,shimFirefox:!0,shimSafari:!0}){const n=p,a=function(e){const t={browser:null,version:null};if(void 0===e||!e.navigator)return t.browser="Not a browser.",t;const{navigator:n}=e;if(n.mozGetUserMedia)t.browser="firefox",t.version=d(n.userAgent,/Firefox\/(\d+)\./,1);else if(n.webkitGetUserMedia||!1===e.isSecureContext&&e.webkitRTCPeerConnection&&!e.RTCIceGatherer)t.browser="chrome",t.version=d(n.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else{if(!e.RTCPeerConnection||!n.userAgent.match(/AppleWebKit\/(\d+)\./))return t.browser="Not a supported browser.",t;t.browser="safari",t.version=d(n.userAgent,/AppleWebKit\/(\d+)\./,1),t.supportsUnifiedPlan=e.RTCRtpTransceiver&&"currentDirection"in e.RTCRtpTransceiver.prototype}return t}(e),c={browserDetails:a,commonShim:o,extractVersion:d,disableLog:l,disableWarnings:h,sdp:Y};switch(a.browser){case"chrome":if(!i||!w||!t.shimChrome)return n("Chrome shim is not included in this adapter release."),c;if(null===a.version)return n("Chrome shim can not determine version, not shimming."),c;n("adapter.js shimming chrome."),c.browserShim=i,re(e,a),S(e,a),E(e),w(e,a),b(e),I(e,a),C(e),T(e),R(e),P(e,a),Z(e),ne(e),ee(e,a),te(e),ie(e,a);break;case"firefox":if(!r||!M||!t.shimFirefox)return n("Firefox shim is not included in this adapter release."),c;n("adapter.js shimming firefox."),c.browserShim=r,re(e,a),O(e,a),M(e,a),N(e),x(e),L(e),k(e),F(e),j(e),U(e),H(e),V(e),Z(e),ne(e),ee(e,a),te(e);break;case"safari":if(!s||!t.shimSafari)return n("Safari shim is not included in this adapter release."),c;n("adapter.js shimming safari."),c.browserShim=s,re(e,a),q(e),z(e),G(e),B(e),J(e),W(e),$(e),Q(e),Z(e),ee(e,a),te(e),ie(e,a);break;default:n("Unsupported browser!")}return c}({window:"undefined"==typeof window?void 0:window});t.default=se}])}));
//# sourceMappingURL=lib-jitsi-meet.min.map
|
import { mount } from '@vue/test-utils';
import { GlAlert, GlButton, GlEmptyState, GlTable } from '@gitlab/ui';
import ServiceAccountsList from '~/google_cloud/components/service_accounts_list.vue';
describe('ServiceAccounts component', () => {
describe('when the project does not have any service accounts', () => {
let wrapper;
const findEmptyState = () => wrapper.findComponent(GlEmptyState);
const findButtonInEmptyState = () => findEmptyState().findComponent(GlButton);
beforeEach(() => {
const propsData = {
list: [],
createUrl: '#create-url',
emptyIllustrationUrl: '#empty-illustration-url',
};
wrapper = mount(ServiceAccountsList, { propsData });
});
afterEach(() => {
wrapper.destroy();
});
it('shows the empty state component', () => {
expect(findEmptyState().exists()).toBe(true);
});
it('shows the link to create new service accounts', () => {
const button = findButtonInEmptyState();
expect(button.exists()).toBe(true);
expect(button.text()).toBe(ServiceAccountsList.i18n.createServiceAccount);
expect(button.attributes('href')).toBe('#create-url');
});
});
describe('when three service accounts are passed via props', () => {
let wrapper;
const findTitle = () => wrapper.find('h2');
const findDescription = () => wrapper.find('p');
const findTable = () => wrapper.findComponent(GlTable);
const findRows = () => findTable().findAll('tr');
const findButton = () => wrapper.findComponent(GlButton);
const findSecretManagerTip = () => wrapper.findComponent(GlAlert);
beforeEach(() => {
const propsData = {
list: [{}, {}, {}],
createUrl: '#create-url',
emptyIllustrationUrl: '#empty-illustration-url',
};
wrapper = mount(ServiceAccountsList, { propsData });
});
it('shows the title', () => {
expect(findTitle().text()).toBe(ServiceAccountsList.i18n.serviceAccountsTitle);
});
it('shows the description', () => {
expect(findDescription().text()).toBe(ServiceAccountsList.i18n.serviceAccountsDescription);
});
it('shows the table', () => {
expect(findTable().exists()).toBe(true);
});
it('table must have three rows + header row', () => {
expect(findRows().length).toBe(4);
});
it('shows the link to create new service accounts', () => {
const button = findButton();
expect(button.exists()).toBe(true);
expect(button.text()).toBe(ServiceAccountsList.i18n.createServiceAccount);
expect(button.attributes('href')).toBe('#create-url');
});
it('must contain secret managers tip', () => {
const tip = findSecretManagerTip();
const expectedText = ServiceAccountsList.i18n.secretManagersDescription.substr(0, 48);
expect(tip.text()).toContain(expectedText);
});
});
});
|
import React, { Component } from 'react';
class CallbackFunction extends Component {
render() {
return (
<div>
</div>
);
}
}
export default CallbackFunction;
|
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
*/
import { Injectable } from '@angular/core';
import * as i0 from "@angular/core";
/**
* Configuration service for the NgbTimepicker component.
* You can inject this service, typically in your root component, and customize the values of its properties in
* order to provide default values for all the timepickers used in the application.
*/
export class NgbTimepickerConfig {
constructor() {
this.meridian = false;
this.spinners = true;
this.seconds = false;
this.hourStep = 1;
this.minuteStep = 1;
this.secondStep = 1;
this.disabled = false;
this.readonlyInputs = false;
this.size = 'medium';
}
}
NgbTimepickerConfig.decorators = [
{ type: Injectable, args: [{ providedIn: 'root' },] }
];
/** @nocollapse */ NgbTimepickerConfig.ngInjectableDef = i0.defineInjectable({ factory: function NgbTimepickerConfig_Factory() { return new NgbTimepickerConfig(); }, token: NgbTimepickerConfig, providedIn: "root" });
if (false) {
/** @type {?} */
NgbTimepickerConfig.prototype.meridian;
/** @type {?} */
NgbTimepickerConfig.prototype.spinners;
/** @type {?} */
NgbTimepickerConfig.prototype.seconds;
/** @type {?} */
NgbTimepickerConfig.prototype.hourStep;
/** @type {?} */
NgbTimepickerConfig.prototype.minuteStep;
/** @type {?} */
NgbTimepickerConfig.prototype.secondStep;
/** @type {?} */
NgbTimepickerConfig.prototype.disabled;
/** @type {?} */
NgbTimepickerConfig.prototype.readonlyInputs;
/** @type {?} */
NgbTimepickerConfig.prototype.size;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGltZXBpY2tlci1jb25maWcuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9AbmctYm9vdHN0cmFwL25nLWJvb3RzdHJhcC8iLCJzb3VyY2VzIjpbInRpbWVwaWNrZXIvdGltZXBpY2tlci1jb25maWcudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztBQUFBLE9BQU8sRUFBQyxVQUFVLEVBQUMsTUFBTSxlQUFlLENBQUM7Ozs7Ozs7QUFRekMsTUFBTSxPQUFPLG1CQUFtQjtJQURoQztRQUVFLGFBQVEsR0FBRyxLQUFLLENBQUM7UUFDakIsYUFBUSxHQUFHLElBQUksQ0FBQztRQUNoQixZQUFPLEdBQUcsS0FBSyxDQUFDO1FBQ2hCLGFBQVEsR0FBRyxDQUFDLENBQUM7UUFDYixlQUFVLEdBQUcsQ0FBQyxDQUFDO1FBQ2YsZUFBVSxHQUFHLENBQUMsQ0FBQztRQUNmLGFBQVEsR0FBRyxLQUFLLENBQUM7UUFDakIsbUJBQWMsR0FBRyxLQUFLLENBQUM7UUFDdkIsU0FBSSxHQUFpQyxRQUFRLENBQUM7S0FDL0M7OztZQVhBLFVBQVUsU0FBQyxFQUFDLFVBQVUsRUFBRSxNQUFNLEVBQUM7Ozs7O0lBRTlCLHVDQUFpQjs7SUFDakIsdUNBQWdCOztJQUNoQixzQ0FBZ0I7O0lBQ2hCLHVDQUFhOztJQUNiLHlDQUFlOztJQUNmLHlDQUFlOztJQUNmLHVDQUFpQjs7SUFDakIsNkNBQXVCOztJQUN2QixtQ0FBOEMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQge0luamVjdGFibGV9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuXG4vKipcbiAqIENvbmZpZ3VyYXRpb24gc2VydmljZSBmb3IgdGhlIE5nYlRpbWVwaWNrZXIgY29tcG9uZW50LlxuICogWW91IGNhbiBpbmplY3QgdGhpcyBzZXJ2aWNlLCB0eXBpY2FsbHkgaW4geW91ciByb290IGNvbXBvbmVudCwgYW5kIGN1c3RvbWl6ZSB0aGUgdmFsdWVzIG9mIGl0cyBwcm9wZXJ0aWVzIGluXG4gKiBvcmRlciB0byBwcm92aWRlIGRlZmF1bHQgdmFsdWVzIGZvciBhbGwgdGhlIHRpbWVwaWNrZXJzIHVzZWQgaW4gdGhlIGFwcGxpY2F0aW9uLlxuICovXG5ASW5qZWN0YWJsZSh7cHJvdmlkZWRJbjogJ3Jvb3QnfSlcbmV4cG9ydCBjbGFzcyBOZ2JUaW1lcGlja2VyQ29uZmlnIHtcbiAgbWVyaWRpYW4gPSBmYWxzZTtcbiAgc3Bpbm5lcnMgPSB0cnVlO1xuICBzZWNvbmRzID0gZmFsc2U7XG4gIGhvdXJTdGVwID0gMTtcbiAgbWludXRlU3RlcCA9IDE7XG4gIHNlY29uZFN0ZXAgPSAxO1xuICBkaXNhYmxlZCA9IGZhbHNlO1xuICByZWFkb25seUlucHV0cyA9IGZhbHNlO1xuICBzaXplOiAnc21hbGwnIHwgJ21lZGl1bScgfCAnbGFyZ2UnID0gJ21lZGl1bSc7XG59XG4iXX0=
|
import typescript from 'rollup-plugin-typescript2';
import babel from '@rollup/plugin-babel';
import commonjs from '@rollup/plugin-commonjs';
import resolve from '@rollup/plugin-node-resolve';
// import builtins from 'builtin-modules'
import { terser } from 'rollup-plugin-terser';
import pkg from './package.json';
export default {
input: 'src/next-qrcode.ts',
output: [
{
file: pkg.main,
format: 'cjs',
exports: 'named',
},
{
file: pkg.module,
format: 'esm',
exports: 'named',
},
],
// external: builtins,
// To use hook in development
// https://reactjs.org/warnings/invalid-hook-call-warning.html
external: ['react', 'react-dom'],
plugins: [
typescript({
tsconfig: './tsconfig.json',
clean: true,
}),
babel({
exclude: 'node_modules/**',
}),
resolve({
preferBuiltins: true,
}),
commonjs({
extensions: ['.js', '.ts', '.tsx'],
}),
terser(),
],
};
|
/**
* @author v.lugovksy
* created on 16.12.2015
*/
(function () {
'use strict';
angular.module('BlurAdmin.pages.smartWifi')
.directive('dashboardPieChart', dashboardPieChart);
/** @ngInject */
function dashboardPieChart() {
return {
restrict: 'E',
controller: 'DashboardPieChartCtrl',
templateUrl: 'app/pages/smartWifi/dashboard/dashboardPieChart/dashboardPieChart.html'
};
}
})();
|
export const TOGGLE_SEARCH_BOX = 'TOGGLE_SEARCH_BOX';
export const TOGGLE_MENU = 'TOGGLE_MENU';
export const FREE_ARTICLE = 'FREE_ARTICLE';
export const FETCH_ARTICLE = 'FETCH_ARTICLE';
export const FETCH_ARTICLES = 'FETCH_ARTICLES';
export const FETCH_ARTICLE_FAILED = 'FETCH_ARTICLE_FAILED';
|
// Copyright (C) 2017 Ramesh Vyaghrapuri. All rights reserved.
// Use of this source code is governed by a MIT-style license
// that can be found in the LICENSE file.
"use strict";
import { expect } from "chai";
import {
PathChange,
Replace,
Move,
Changes,
Text,
Decoder
} from "../../index.js";
describe("Move", () => {
it("reverts", () => {
const initial = new Text("abc12def");
const move1 = new Move(3, 2, -1);
const reverted = move1.revert();
expect(initial.apply(move1).apply(reverted)).to.deep.equal(initial);
expect(reverted.revert()).to.deep.equal(move1);
});
it("merges with null", () => {
const move = new Move(1, 2, 3);
expect(move.merge(null)).to.deep.equal([null, move]);
expect(move.reverseMerge(null)).to.deep.equal([null, move]);
});
it("merges with replace", () => {
const move = new Move(1, 2, 3);
const replace = new Replace(new Text("before"), new Text("after"));
const expected = new Replace(replace.before.apply(move), replace.after);
expect(move.merge(replace)).to.deep.equal([expected, null]);
expect(move.reverseMerge(replace)).to.deep.equal([expected, null]);
});
it("merges with pathchange", () => {
const move = new Move(1, 2, 3);
const inner = new Replace(new Text("before"), new Text("after"));
const indexMap = { 0: 0, 1: 4, 2: 5, 3: 1, 4: 2, 5: 3, 6: 6 };
for (let idx in indexMap) {
const pc = new PathChange([+idx], inner);
const expected = new PathChange([indexMap[idx]], inner);
expect(move.merge(pc)).to.deep.equal([expected, move]);
expect(move.reverseMerge(pc)).to.deep.equal([expected, move]);
}
});
it("merges with empty path pathchange", () => {
const move = new Move(1, 2, 3);
const other = new PathChange(null, new Move(100, 2, 3));
expect(move.merge(other)).to.deep.equal(move.merge(other.change));
expect(move.reverseMerge(other)).to.deep.equal(
move.reverseMerge(other.change)
);
});
it("merges with changeset", () => {
const move = new Move(1, 2, 3);
const pc = new PathChange(
[100],
new Replace(new Text("before"), new Text("after"))
);
const cs = new Changes([pc, pc]);
expect(move.merge(cs)).to.deep.equal([cs, move]);
});
});
describe("Move - interop serialization", () => {
it("should serialize", () => {
const move = new Move(1, 2, 3);
expect(JSON.stringify(move)).to.equal("[1,2,3]");
});
it("should deserialize", () => {
const move = new Move(1, 2, 3);
const json = JSON.parse(JSON.stringify(move));
expect(Move.fromJSON(new Decoder(), json)).to.deep.equal(move);
});
});
|
/* Element initializers with unknown index. */
function foo(i) {
var x = [1, 2, i == 1 ? 3 : 4, 5, 6];
+i;
var y = "" + x;
if (i == 1) {
y;
"1,2,3,5,6";
} else {
y;
"1,2,4,5,6";
}
var __es_v0 = 3;
}
for (var i = 0; i < 10; i++) {
foo(i);
foo(i % 1);
}
|
'use strict';
const
{ User } = require('../../../models'),
{ secret_jwt } = require('../../../config/server'),
jwt = require('jsonwebtoken')
module.exports = {
signin: async (bodyData) => {
const user = await User.findOne({ where: { email: bodyData.email }, raw: true })
if (!user) {
console.log('User not found.')
return {
error: true,
data: {
message: 'Email not found.'
}
}
} else {
if (User.compareHash(user, bodyData.password)) {
// Authenticated
return {
error: false,
data: {
user: {
id: user.id,
email: user.email
}
}
}
} else {
console.log(`Wrong password with ${user.email}.`)
return {
error: true,
data: {
message: `Wrong password with ${user.email}`
}
}
}
}
},
getUserFromToken(token) {
const cleanTkn = token.split(' ')[1]
return jwt.decode(cleanTkn).user
}
}
|
import API from '../data';
import counter from '../counter';
const modal = document.getElementById('reservation-modal');
const displayReservations = (ul, userReservation) => {
const reservation = document.createElement('li');
reservation.className = 'reservation';
const reservationMeta = document.createElement('div');
reservationMeta.className = 'reservation-meta';
reservation.appendChild(reservationMeta);
const startdate = document.createElement('p');
startdate.className = 'reservation-p';
startdate.innerText = `${userReservation.date_start} to`;
const enddate = document.createElement('p');
enddate.className = 'reservation-p';
enddate.innerText = `${userReservation.date_end} by:`;
reservationMeta.appendChild(startdate);
reservationMeta.appendChild(enddate);
const name = document.createElement('p');
name.innerText = `${userReservation.username}`;
name.style.textTransform = 'Capitalize';
reservationMeta.appendChild(name);
ul.appendChild(reservation);
};
const reserveModal = (meal) => {
const reserveContainer = document.createElement('div');
reserveContainer.className = 'reserve-container';
const closeSection = document.createElement('div');
closeSection.className = 'close-section';
reserveContainer.appendChild(closeSection);
const closeButton = document.createElement('button');
closeButton.className = 'close-btn icn-btn';
closeButton.innerHTML = '×';
closeSection.appendChild(closeButton);
const reserveContent = document.createElement('div');
reserveContent.className = 'reserve-content';
reserveContainer.appendChild(reserveContent);
const reserveImg = document.createElement('img');
reserveImg.className = 'reserve-img';
reserveImg.src = meal.strMealThumb;
reserveContent.appendChild(reserveImg);
const reserveTitle = document.createElement('h2');
reserveTitle.className = 'reserve-title';
reserveTitle.innerText = meal.strMeal;
reserveContent.appendChild(reserveTitle);
const mealInfo = document.createElement('ul');
mealInfo.className = 'meal-info';
reserveContent.appendChild(mealInfo);
const category = document.createElement('li');
category.className = 'reserve-details';
mealInfo.appendChild(category);
const categorySpan = document.createElement('span');
categorySpan.className = 'category';
categorySpan.innerHTML = 'Category: ';
category.appendChild(categorySpan);
const categorySpanSpan = document.createElement('span');
categorySpanSpan.innerText = meal.strCategory;
category.appendChild(categorySpanSpan);
const area = document.createElement('li');
area.className = 'reserve-details';
mealInfo.appendChild(area);
const areaSpan = document.createElement('span');
areaSpan.className = 'area';
areaSpan.innerHTML = 'Area: ';
area.appendChild(areaSpan);
const areaSpanSpan = document.createElement('span');
areaSpanSpan.innerText = meal.strArea;
area.appendChild(areaSpanSpan);
const recipe = document.createElement('li');
recipe.className = 'reserve-details';
mealInfo.appendChild(recipe);
const recipeSpan = document.createElement('span');
recipeSpan.className = 'recipe';
recipeSpan.innerHTML = 'Recipe: ';
recipe.appendChild(recipeSpan);
const recipeSrc = document.createElement('a');
recipeSrc.href = 'meal.strSource';
recipeSrc.innerHTML = 'Recipe Link';
recipe.appendChild(recipeSrc);
const videoInstruction = document.createElement('li');
videoInstruction.className = 'reserve-details';
mealInfo.appendChild(videoInstruction);
const videoSpan = document.createElement('span');
videoSpan.className = 'video-instruction';
videoSpan.innerHTML = 'Video: ';
videoInstruction.appendChild(videoSpan);
const videoSrc = document.createElement('a');
videoSrc.href = 'meal.strYoutube';
videoSrc.innerHTML = 'YouTube Link';
videoInstruction.appendChild(videoSrc);
const sectionTitle = document.createElement('div');
reserveContent.appendChild(sectionTitle);
const sectionTitleHeader = document.createElement('div');
sectionTitleHeader.className = 'section-title';
const reservationCounterHeading = document.createElement('h2');
reservationCounterHeading.innerHTML = 'Reservations';
sectionTitleHeader.appendChild(reservationCounterHeading);
const reservationCounter = document.createElement('span');
reservationCounter.className = 'reservations-counter';
reservationCounterHeading.appendChild(reservationCounter);
sectionTitle.appendChild(sectionTitleHeader);
const reservationList = document.createElement('li');
reservationList.className = 'reservation-list';
API.getReservations(meal.idMeal).then((data) => {
if (data === 'No reservations available for this meal') {
reservationList.innerHTML = `<li class='no-reservations'>${`${data}. Add a new reservation`}</li>`;
} else {
const reservationCounter = counter.reservation(data);
sectionTitleHeader.innerHTML = `Reservations(${reservationCounter})`;
data.forEach((userReservation) => {
displayReservations(reservationList, userReservation);
});
}
});
sectionTitle.appendChild(reservationList);
const reservationForm = document.createElement('div');
reservationForm.className = 'reservation-form';
reserveContent.appendChild(reservationForm);
const reservationFormTitle = document.createElement('h2');
reservationFormTitle.className = 'reservation-form-title';
reservationFormTitle.innerHTML = 'Add a reservation';
reservationForm.appendChild(reservationFormTitle);
const reserveForm = document.createElement('form');
reserveForm.className = 'form';
reservationForm.appendChild(reserveForm);
const inputReserveName = document.createElement('input');
inputReserveName.type = 'text';
inputReserveName.className = 'input-reserve-name';
inputReserveName.name = 'username';
inputReserveName.placeholder = 'Your Name';
inputReserveName.attributes.required = true;
reserveForm.appendChild(inputReserveName);
const inputReserveStartDate = document.createElement('input');
inputReserveStartDate.type = 'date';
inputReserveStartDate.className = 'input-reserve-start-date';
inputReserveStartDate.name = 'start-date';
inputReserveStartDate.placeholder = 'Start Date (yyyy-mm-dd)';
inputReserveStartDate.attributes.required = true;
reserveForm.appendChild(inputReserveStartDate);
const inputReserveEndDate = document.createElement('input');
inputReserveEndDate.type = 'date';
inputReserveEndDate.className = 'input-reserve-end-date';
inputReserveEndDate.name = 'end-date';
inputReserveEndDate.placeholder = 'End Date (yyyy-mm-dd)';
inputReserveEndDate.attributes.required = true;
reserveForm.appendChild(inputReserveEndDate);
const reserveSubmitButton = document.createElement('button');
reserveSubmitButton.type = 'submit';
reserveSubmitButton.className = 'reserve-submit-button cursor';
reserveSubmitButton.innerHTML = 'Reserve';
reserveForm.appendChild(reserveSubmitButton);
reserveSubmitButton.onclick = (e) => {
e.preventDefault();
API.postReservations(
meal.idMeal,
inputReserveName.value,
inputReserveStartDate.value,
inputReserveEndDate.value,
).then(() => {
if (reservationList.hasChildNodes()) {
reservationList.innerHTML = '';
API.getReservations(meal.idMeal).then((data) => {
if (data === 'No reservations available for this meal') {
reservationList.innerHTML = `<li class='no-reservations'>${`${data}. Add a new reservation`}</li>`;
} else {
const reservationCounter = counter.reservation(data);
sectionTitleHeader.innerHTML = `Reservations(${reservationCounter})`;
data.forEach((userReservation) => {
displayReservations(reservationList, userReservation);
});
}
});
}
});
inputReserveName.value = '';
inputReserveStartDate.value = '';
inputReserveEndDate.value = '';
};
closeButton.addEventListener('click', () => {
modal.style.display = 'none';
});
modal.appendChild(reserveContainer);
};
export default reserveModal;
|
import React from "react";
import VideoSidebar from "../Video/VideoSidebar";
const Introduction = () => {
return (
<div className="row justify-content-between">
<div className="col-12 col-md-6">
<div className="textComp-section">
<h1 className="center">Introduction</h1>
<div className="card">
<div className="card-body">
<p>
Sometimes wrting test automation code is as time-consuming as writing the code itself.
One could wonder if it's really worth it. Isn't writing the features more important than testing them?
</p>
<p>
Perhaps this is accurate in the beginning of your applications life-cycle. But as your application grows,
new application features tend to break existing ones.
</p>
<p>
Having automated end-to-end tests greatly reduces the amount of manual testing needed.
Developers get instant feedback when their code updates break crucial application flows.
</p>
<p>
This increases the productive output from your development team dramatically, and allows you to
push features into your live system at a faster pace, while resting assured you didn't introduce bugs in your live system.
</p>
</div>
</div>
</div>
</div>
<div className="col-12 col-md-5">
<VideoSidebar
src="https://www.youtube.com/embed/-91YkYkmjZk"
height="230"
width="100%"
title="Why do test automation"
/>
<VideoSidebar
src="https://www.youtube.com/embed/850MnrHoEYc"
height="230"
width="100%"
title="getting-started"
/>
</div>
</div>
);
};
export default Introduction;
|
$(document).ready(function() {
});
|
import describe from 'tape-bdd';
import transmute from 'transmutation';
const promise = new Promise(res => res({ test: 'promise' }));
const promiseArray = new Promise(res => res(['promise']));
describe('Extend Operator', (it) => {
it('extends with the result of a function instead of a primitive or promise', assert => transmute({ parameter: 'roar' })
.extend(({ parameter }) => ({ [parameter]: 'result' }))
.then(value => assert.deepEqual(value, { parameter: 'roar', roar: 'result' }))
);
it('extends a path with the result of a function instead of a primitive or promise', assert => transmute({ parameter: 'roar' })
.extend('testing.stuff', ({ parameter }) => ({ [parameter]: 'result' }))
.then(value => assert.deepEqual(value, { parameter: 'roar', testing: { stuff: { roar: 'result' } } }))
);
it('extends a path with the promised result of a function instead of a primitive or promise', assert => transmute({ parameter: 'roar' })
.extend('testing.stuff', ({ parameter }) =>
new Promise(res => res({ [parameter]: 'result' }))
)
.then(value => assert.deepEqual(value, { parameter: 'roar', testing: { stuff: { roar: 'result' } } }))
);
it('extends a path with the transmuted result of a function instead of a primitive or promise', assert => transmute({ parameter: 'roar' })
.extend('testing.stuff', ({ parameter }) =>
transmute({ [parameter]: 'result' })
)
.then(value => assert.deepEqual(value, { parameter: 'roar', testing: { stuff: { roar: 'result' } } }))
);
it('extends an array of paths with the transmuted result of a function instead of a primitive or promise', assert => transmute({ parameter: 'roar' })
.extend(['testing.stuff', 'second.place'], ({ parameter }) =>
transmute({ [parameter]: 'result' })
)
.then(value => assert.deepEqual(value, { parameter: 'roar', testing: { stuff: { roar: 'result' } }, second: { place: { roar: 'result' } } }))
);
it('extends an array of paths with a result while sharing a portion of the path', assert => transmute({ parameter: 'roar' })
.extend(['testing.stuff', 'testing.place'], ({ parameter }) =>
transmute({ [parameter]: 'result' })
)
.then(value => assert.deepEqual(value, {
parameter: 'roar',
testing: {
stuff: { roar: 'result' },
place: { roar: 'result' },
},
}))
);
it('extends an array of paths without triggering merge problems', assert => transmute({ parameter: 'roar' })
.extend(['parameter', 'testing.place'], ({ parameter }) =>
transmute({ [parameter]: 'result' })
)
.then(value => assert.deepEqual(value, {
parameter: 'roar',
testing: {
place: { roar: 'result' },
},
}))
);
it('does not add any additional pathing when extending with a null path', assert => transmute({ parameter: 'roar' })
.extend(null, ({ parameter }) =>
transmute({ [parameter]: 'result' })
)
.then(value => assert.deepEqual(value, { parameter: 'roar', roar: 'result' }))
);
it('uses an integer as a key when an integer is a path', assert => transmute({ parameter: 'roar' })
.extend(42, ({ parameter }) =>
transmute({ [parameter]: 'result' })
)
.then(value => assert.deepEqual(value, {
parameter: 'roar',
42: { roar: 'result' },
}))
);
// TODO: Fix the null in an array problem
it.skip('does not add any additional pathing when extending with a null path in an array', assert => transmute({ parameter: 'roar' })
.extend([null, 'testing'], ({ parameter }) =>
transmute({ [parameter]: 'result' })
)
.then(value => assert.deepEqual(value, {
parameter: 'roar',
roar: 'result',
testing: { roar: 'result' },
}))
);
// TODO: Fix the null in an array problem
it.skip('uses an integer as a key when an integer is a path', assert => transmute({ parameter: 'roar' })
.extend([42, 54, null, 'testing'], ({ parameter }) =>
transmute({ [parameter]: 'result' })
)
.then(value => assert.deepEqual(value, {
parameter: 'roar',
roar: 'result',
42: { roar: 'result' },
54: { roar: 'result' },
testing: { roar: 'result' },
}))
);
/* Object merging */
it('does nothing when extending an object with an identical object', assert => transmute({ test: 'roar' })
.extend({ test: 'roar' })
.then(value => assert.deepEqual(value, { test: 'roar' }))
);
it('extend an object with additional key/values when extended with a different object', assert => transmute({ test: 'roar' })
.extend({ roar: 'test' })
.then(value => assert.deepEqual(value, { test: 'roar', roar: 'test' }))
);
it('does nothing when extending an object with an object with the same key', assert => transmute({ test: 'roar' })
.extend({ test: 'no' })
.then(value => assert.deepEqual(value, { test: 'roar' }))
);
it('adds new children to a key that already exists', assert => transmute({ test: { deep: 'roar' } })
.extend({ test: { extension: 'works' } })
.then(value => assert.deepEqual(value, { test: { deep: 'roar', extension: 'works' } }))
);
it('adds new child based on path', assert => transmute({ test: 'roar' })
.extend('extension', 'works')
.then(value => assert.deepEqual(value, { test: 'roar', extension: 'works' }))
);
it('does nothing when changing a direct value on path that exists', assert => transmute({ test: 'roar' })
.extend('test', 'works')
.then(value => assert.deepEqual(value, { test: 'roar' }))
);
it('extends a new path perfectly fine with a string', assert => transmute({ test: 'roar' })
.extend('jam.test.stuff', 'works')
.then(value => assert.deepEqual(value, { test: 'roar', jam: { test: { stuff: 'works' } } }))
);
it('extends a new path perfectly fine with a promise result', assert => transmute({ test: 'roar' })
.extend('jam.test.stuff', promise)
.then(value => assert.deepEqual(value, { test: 'roar', jam: { test: { stuff: { test: 'promise' } } } }))
);
it('extends an existing path with a promise result', assert => transmute({ test: ['roar'] })
.extend('test', promiseArray)
.then(value => assert.deepEqual(value, { test: ['roar', 'promise'] }))
);
/* Non object to object extensions */
it('stays null extending a null with a null', assert => transmute(null)
.extend(null)
.then(value => assert.deepEqual(value, null))
);
it('keeps the integer the same when extending an integer with a null', assert => transmute(5)
.extend(null)
.then(value => assert.deepEqual(value, 5))
);
it('keeps the string the same when extending a string with a null', assert => transmute('roar')
.extend(null)
.then(value => assert.deepEqual(value, 'roar'))
);
it('keeps the array the same when extending an array with a null', assert => transmute([0, 'ten'])
.extend(null)
.then(value => assert.deepEqual(value, [0, 'ten']))
);
it('keeps the object the same when extending an object with a null', assert => transmute({ test: 'roar' })
.extend(null)
.then(value => assert.deepEqual(value, { test: 'roar' }))
);
it('changes a null to an integer when extending a null with an integer', assert => transmute(null)
.extend(5)
.then(value => assert.deepEqual(value, 5))
);
it('keeps the original integer if trying to extend with another integer', assert => transmute(4)
.extend(5)
.then(value => assert.deepEqual(value, 4))
);
it('keeps the original string if trying to extend with an integer', assert => transmute('roar')
.extend(5)
.then(value => assert.deepEqual(value, 'roar'))
);
it('batches an integer with the rest of an array when extending an array with an integer', assert => transmute([0, 'ten'])
.extend(5)
.then(value => assert.deepEqual(value, [0, 'ten', 5]))
);
it('keeps the original object if trying to extend with an integer', assert => transmute({ test: 'roar' })
.extend(5)
.then(value => assert.deepEqual(value, { test: 'roar' }))
);
it('changes a null to a string when extending a null with a string', assert => transmute(null)
.extend('roar')
.then(value => assert.deepEqual(value, 'roar'))
);
it('keeps the original integer when extending with a string', assert => transmute(5)
.extend('roar')
.then(value => assert.deepEqual(value, 5))
);
it('keeps the original string when extending with another string', assert => transmute('roar')
.extend('no')
.then(value => assert.deepEqual(value, 'roar'))
);
it('batches a string with the rest of an array when extending an array with a string', assert => transmute([0, 'ten'])
.extend('roar')
.then(value => assert.deepEqual(value, [0, 'ten', 'roar']))
);
it('keeps the original object when extending with a string', assert => transmute({ test: 'roar' })
.extend('roar')
.then(value => assert.deepEqual(value, { test: 'roar' }))
);
it('changes a null to an array when extending a null with an array', assert => transmute(null)
.extend([0, 'ten'])
.then(value => assert.deepEqual(value, [0, 'ten']))
);
it('keeps the original integer when extending with an array', assert => transmute(5)
.extend([0, 'ten'])
.then(value => assert.deepEqual(value, 5))
);
it('keeps the original string when extending with an array', assert => transmute('roar')
.extend([0, 'ten'])
.then(value => assert.deepEqual(value, 'roar'))
);
it('prepends the array with another array when extending an array with another array', assert => transmute([0, 'ten'])
.extend([0, 'ten'])
.then(value => assert.deepEqual(value, [0, 'ten', 0, 'ten']))
);
it('keeps the original object when extending with an array', assert => transmute({ test: 'roar' })
.extend([0, 'ten'])
.then(value => assert.deepEqual(value, { test: 'roar' }))
);
it('changes a null to an object when extending a null with an object', assert => transmute(null)
.extend({ test: 'roar' })
.then(value => assert.deepEqual(value, { test: 'roar' }))
);
it('keeps the original integer when extending with an object', assert => transmute(5)
.extend({ test: 'roar' })
.then(value => assert.deepEqual(value, 5))
);
it('keeps the original string when extending with an object', assert => transmute('roar')
.extend({ test: 'roar' })
.then(value => assert.deepEqual(value, 'roar'))
);
it('appends an object to an array when extending an array with an object', assert => transmute([0, 'ten'])
.extend({ test: 'roar' })
.then(value => assert.deepEqual(value, [0, 'ten', { test: 'roar' }]))
);
});
|
/**
* @license Angular v11.2.13
* (c) 2010-2021 Google LLC. https://angular.io/
* License: MIT
*/
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("@angular/animations"),require("@angular/animations/browser")):"function"==typeof define&&define.amd?define("@angular/animations/browser/testing",["exports","@angular/animations","@angular/animations/browser"],n):n(((t=t||self).ng=t.ng||{},t.ng.animations=t.ng.animations||{},t.ng.animations.browser=t.ng.animations.browser||{},t.ng.animations.browser.testing={}),t.ng.animations,t.ng.animations.browser)}(this,(function(t,n,o){"use strict";
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)n.hasOwnProperty(o)&&(t[o]=n[o])})(t,n)},r=function(){function t(){}return t.prototype.validateStyleProperty=function(t){return o.ɵvalidateStyleProperty(t)},t.prototype.matchesElement=function(t,n){return o.ɵmatchesElement(t,n)},t.prototype.containsElement=function(t,n){return o.ɵcontainsElement(t,n)},t.prototype.query=function(t,n,e){return o.ɵinvokeQuery(t,n,e)},t.prototype.computeStyle=function(t,n,o){return o||""},t.prototype.animate=function(n,o,e,r,s,a){void 0===a&&(a=[]);var u=new i(n,o,e,r,s,a);return t.log.push(u),u},t}();r.log=[];var i=function(t){function r(n,e,i,s,a,u){var p=t.call(this,i,s)||this;return p.element=n,p.keyframes=e,p.duration=i,p.delay=s,p.easing=a,p.previousPlayers=u,p.__finished=!1,p.__started=!1,p.previousStyles={},p._onInitFns=[],p.currentSnapshot={},o.ɵallowPreviousPlayerStylesMerge(i,s)&&u.forEach((function(t){if(t instanceof r){var n=t.currentSnapshot;Object.keys(n).forEach((function(t){return p.previousStyles[t]=n[t]}))}})),p}return function i(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}(r,t),r.prototype.onInit=function(t){this._onInitFns.push(t)},r.prototype.init=function(){t.prototype.init.call(this),this._onInitFns.forEach((function(t){return t()})),this._onInitFns=[]},r.prototype.finish=function(){t.prototype.finish.call(this),this.__finished=!0},r.prototype.destroy=function(){t.prototype.destroy.call(this),this.__finished=!0},r.prototype.triggerMicrotask=function(){},r.prototype.play=function(){t.prototype.play.call(this),this.__started=!0},r.prototype.hasStarted=function(){return this.__started},r.prototype.beforeDestroy=function(){var t=this,o={};Object.keys(this.previousStyles).forEach((function(n){o[n]=t.previousStyles[n]})),this.hasStarted()&&this.keyframes.forEach((function(e){Object.keys(e).forEach((function(r){"offset"!=r&&(o[r]=t.__finished?e[r]:n.AUTO_STYLE)}))})),this.currentSnapshot=o},r}(n.NoopAnimationPlayer);
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/t.MockAnimationDriver=r,t.MockAnimationPlayer=i,Object.defineProperty(t,"__esModule",{value:!0})}));
|
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var React = _interopRequireWildcard(require("react"));
var _createSvgIcon = _interopRequireDefault(require("./utils/createSvgIcon"));
var _jsxRuntime = require("react/jsx-runtime");
var _default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
d: "M18 13h-5v5c0 .55-.45 1-1 1s-1-.45-1-1v-5H6c-.55 0-1-.45-1-1s.45-1 1-1h5V6c0-.55.45-1 1-1s1 .45 1 1v5h5c.55 0 1 .45 1 1s-.45 1-1 1z"
}), 'AddRounded');
exports.default = _default;
|
/*! Widget: output - updated 1/15/2016 (v2.25.2) */
!function(a){"use strict";var b=a.tablesorter,c=b.output={event:"outputTable",regexQuote:/([\n\t\x09\x0d\x0a]|<[^<]+>)/,regexBR:/(<br([\s\/])?>|\n)/g,regexIMG:/<img[^>]+alt\s*=\s*['"]([^'"]+)['"][^>]*>/i,regexHTML:/<[^<]+>/g,replaceCR:"\r\n",replaceTab:" ",popupTitle:"Output",popupStyle:"width:100%;height:100%;",message:"Your device does not support downloading. Please try again in desktop browser.",init:function(a){a.$table.off(c.event).on(c.event,function(b){b.stopPropagation(),c.process(a,a.widgetOptions)})},processRow:function(d,e,f,g){var h,i,j,k,l,m,n,o,p,q,r=d.widgetOptions,s=[],t=r.output_duplicateSpans,u=f&&g&&r.output_headerRows&&a.isFunction(r.output_callbackJSON),v=0,w=e.length;for(k=0;w>k;k++)for(s[k]||(s[k]=[]),v=0,i=e.eq(k).children(),j=i.length,n=0;j>n;n++){if(h=i.eq(n),h.filter("[rowspan]").length)for(o=parseInt(h.attr("rowspan"),10)-1,q=c.formatData(d,r,h,f),l=1;o>=l;l++)s[k+l]||(s[k+l]=[]),s[k+l][v]=f?q:t?q:"";if(h.filter("[colspan]").length)for(p=parseInt(h.attr("colspan"),10)-1,q=c.formatData(d,r,h,f),m=1;p>=m;m++)if(h.filter("[rowspan]").length)for(o=parseInt(h.attr("rowspan"),10),l=0;o>l;l++)s[k+l]||(s[k+l]=[]),s[k+l][v+m]=u?r.output_callbackJSON(h,q,v+m)||q+"("+(v+m)+")":f?q:t?q:"";else s[k][v+m]=u?r.output_callbackJSON(h,q,v+m)||q+"("+(v+m)+")":f?q:t?q:"";for(;"undefined"!=typeof s[k][v];)v++;s[k][v]=s[k][v]||c.formatData(d,r,h,f),v++}return b.output.removeColumns(d,r,s)},removeColumns:function(a,b,c){var d,e,f,g=[],h=c.length;for(d=0;h>d;d++)for(e=c[d],g[d]=[],f=0;f<a.columns;f++)b.output_hiddenColumnArray[f]||g[d].push(e[f]);return g},process:function(d,e){var f,g,h,i,j,k,l,m,n=window.JSON&&JSON.hasOwnProperty("stringify"),o=0,p=(e.output_separator||",").toLowerCase(),q="json"===p,r="array"===p,s=q||r?",":e.output_separator,t=e.output_saveRows,u=d.$table;for(e.output_regex=new RegExp("("+(/\\/.test(s)?"\\":"")+s+")"),e.output_hiddenColumnArray=[],o=0;o<d.columns;o++)e.output_hiddenColumnArray[o]=a.inArray(o,e.output_ignoreColumns)>-1||!e.output_hiddenColumns&&"none"===d.$headerIndexed[o].css("display")&&!d.$headerIndexed[o].hasClass("tablesorter-scroller-hidden-column");if(g=u.children("thead").children("tr").not("."+(b.css.filterRow||"tablesorter-filter-row")).filter(function(){return e.output_hiddenColumns||"none"!==a(this).css("display")}),i=c.processRow(d,g,!0,q),h=u.children("tbody").children("tr").not(d.selectorRemove),h="function"==typeof t?h.filter(t):/^f/.test(t)?h.not("."+(e.filter_filteredRow||"filtered")):/^v/.test(t)?h.filter(":visible"):/^[.#:\[]/.test(t)?h.filter(t):h,j=c.processRow(d,h),e.output_includeFooter&&(j=j.concat(c.processRow(d,u.children("tfoot").children("tr:visible")))),k=i.length,q){for(p=[],l=j.length,o=0;l>o;o++)m=i[k>1&&e.output_headerRows?o%k:k-1],p.push(c.row2Hash(m,j[o]));f=n?JSON.stringify(p):p}else m=[i[k>1&&e.output_headerRows?o%k:k-1]],p=c.row2CSV(e,e.output_headerRows?i:m,r).concat(c.row2CSV(e,j,r)),f=r&&n?JSON.stringify(p):p.join("\n");if(a.isFunction(e.output_callback)){if(m=e.output_callback(d,f,d.pager&&d.pager.ajaxObject.url||null),m===!1)return;"string"==typeof m&&(f=m)}/p/i.test(e.output_delivery||"")?c.popup(f,e.output_popupStyle,q||r):c.download(e,f)},row2CSV:function(a,b,c){var d,e,f=[],g=b.length;for(e=0;g>e;e++)d=(b[e]||[]).join("").replace(/\"/g,""),(b[e]||[]).length>0&&""!==d&&(f[f.length]=c?b[e]:b[e].join(a.output_separator));return f},row2Hash:function(a,b){var c,d={},e=b.length;for(c=0;e>c;c++)c<a.length&&(d[a[c]]=b[c]);return d},formatData:function(b,d,e,f){var g=e.attr(d.output_dataAttrib),h="undefined"!=typeof g?g:e.html(),i=(d.output_separator||",").toLowerCase(),j="json"===i||"array"===i,k=h.replace(/\"/g,d.output_replaceQuote||"“");return k=d.output_trimSpaces?k.replace(c.regexBR,""):k.replace(c.regexBR,c.replaceCR).replace(/\t/g,c.replaceTab),h=k.match(c.regexIMG),d.output_includeHTML||null===h||(k=h[1]),k=d.output_includeHTML&&!f?k:k.replace(c.regexHTML,""),k=d.output_trimSpaces||f?a.trim(k):k,i=j?!1:d.output_wrapQuotes||d.output_regex.test(k)||c.regexQuote.test(k),k=i?'"'+k+'"':k,"function"==typeof d.output_formatContent?d.output_formatContent(b,d,{isHeader:f,$cell:e,content:k}):k},popup:function(a,b,d){var e=window.open("",c.popupTitle,b);return e.document.write("<html><head><title>"+c.popupTitle+'</title></head><body><textarea wrap="'+(d?"on":"off")+'" style="'+c.popupStyle+'">'+a+"\n</textarea></body></html>"),e.document.close(),e.focus(),!0},download:function(a,b){var d,e,f,g=window.navigator,h=document.createElement("a");if(/(iP)/g.test(g.userAgent))return alert(c.message),!1;try{f=!!new Blob}catch(i){f=!1}return f?(window.URL=window.URL||window.webkitURL,e=new Blob(["\ufeff",b],{type:a.output_encoding}),g.msSaveBlob?g.msSaveBlob(e,a.output_saveFileName):(h.href=window.URL.createObjectURL(e),h.download=a.output_saveFileName,document.createEvent&&(d=document.createEvent("MouseEvents"),d.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),h.dispatchEvent(d))),!1):(window.open(a.output_encoding+encodeURIComponent(b)+"?download","_self"),!0)},remove:function(a){a.$table.off(c.event)}};b.addWidget({id:"output",options:{output_separator:",",output_ignoreColumns:[],output_hiddenColumns:!1,output_includeFooter:!1,output_dataAttrib:"data-name",output_headerRows:!1,output_delivery:"popup",output_saveRows:"filtered",output_duplicateSpans:!0,output_replaceQuote:"“;",output_includeHTML:!1,output_trimSpaces:!0,output_wrapQuotes:!1,output_popupStyle:"width=500,height=300",output_saveFileName:"mytable.csv",output_formatContent:null,output_callback:function(a,b){return!0},output_callbackJSON:function(a,b,c){return b+"("+c+")"},output_encoding:"data:application/octet-stream;charset=utf8,"},init:function(a,b,d){c.init(d)},remove:function(a,b){c.remove(b)}})}(jQuery);
|
/*! tableSorter 2.4+ widgets - updated 11/14/2012
*
* Column Styles
* Column Filters
* Column Resizing
* Sticky Header
* UI Theme (generalized)
* Save Sort
* ["zebra", "uitheme", "stickyHeaders", "filter", "columns"]
*/
/*jshint browser:true, jquery:true, unused:false, loopfunc:true */
/*global jQuery: false, localStorage: false, navigator: false */
;(function($){
"use strict";
$.tablesorter = $.tablesorter || {};
$.tablesorter.themes = {
"bootstrap" : {
table : 'table table-bordered table-striped',
header : 'bootstrap-header', // give the header a gradient background
icons : '', // add "icon-white" to make them white; this icon class is added to the <i> in the header
sortNone : 'bootstrap-icon-unsorted',
sortAsc : 'icon-chevron-up',
sortDesc : 'icon-chevron-down',
active : '', // applied when column is sorted
hover : '', // use custom css here - bootstrap class may not override it
filterRow: '', // filter row class
even : '', // even row zebra striping
odd : '' // odd row zebra striping
},
"jui" : {
table : 'ui-widget ui-widget-content ui-corner-all', // table classes
header : 'ui-widget-header ui-corner-all ui-state-default', // header classes
icons : 'ui-icon', // icon class added to the <i> in the header
sortNone : 'ui-icon-carat-2-n-s',
sortAsc : 'ui-icon-carat-1-n',
sortDesc : 'ui-icon-carat-1-s',
active : 'ui-state-active', // applied when column is sorted
hover : 'ui-state-hover', // hover class
filterRow: '',
even : 'ui-widget-content', // even row zebra striping
odd : 'ui-state-default' // odd row zebra striping
}
};
// *** Store data in local storage, with a cookie fallback ***
/* IE7 needs JSON library for JSON.stringify - (http://caniuse.com/#search=json)
if you need it, then include https://github.com/douglascrockford/JSON-js
$.parseJSON is not available is jQuery versions older than 1.4.1, using older
versions will only allow storing information for one page at a time
// *** Save data (JSON format only) ***
// val must be valid JSON... use http://jsonlint.com/ to ensure it is valid
var val = { "mywidget" : "data1" }; // valid JSON uses double quotes
// $.tablesorter.storage(table, key, val);
$.tablesorter.storage(table, 'tablesorter-mywidget', val);
// *** Get data: $.tablesorter.storage(table, key); ***
v = $.tablesorter.storage(table, 'tablesorter-mywidget');
// val may be empty, so also check for your data
val = (v && v.hasOwnProperty('mywidget')) ? v.mywidget : '';
alert(val); // "data1" if saved, or "" if not
*/
$.tablesorter.storage = function(table, key, val){
var d, k, ls = false, v = {},
id = table.id || $('.tablesorter').index( $(table) ),
url = window.location.pathname;
try { ls = !!(localStorage.getItem); } catch(e) {}
// *** get val ***
if ($.parseJSON){
if (ls){
v = $.parseJSON(localStorage[key]) || {};
} else {
k = document.cookie.split(/[;\s|=]/); // cookie
d = $.inArray(key, k) + 1; // add one to get from the key to the value
v = (d !== 0) ? $.parseJSON(k[d]) || {} : {};
}
}
if (val && JSON && JSON.hasOwnProperty('stringify')){
// add unique identifiers = url pathname > table ID/index on page > data
if (v[url] && v[url][id]){
v[url][id] = val;
} else {
if (v[url]){
v[url][id] = val;
} else {
v[url] = {};
v[url][id] = val;
}
}
// *** set val ***
if (ls){
localStorage[key] = JSON.stringify(v);
} else {
d = new Date();
d.setTime(d.getTime() + (31536e+6)); // 365 days
document.cookie = key + '=' + (JSON.stringify(v)).replace(/\"/g,'\"') + '; expires=' + d.toGMTString() + '; path=/';
}
} else {
return ( v && v.hasOwnProperty(url) && v[url].hasOwnProperty(id) ) ? v[url][id] : {};
}
};
// Widget: General UI theme
// "uitheme" option in "widgetOptions"
// **************************
$.tablesorter.addWidget({
id: "uitheme",
format: function(table){
var time, klass, $el, $tar, t,
$t = $(table),
c = table.config,
wo = c.widgetOptions,
theme = typeof wo.uitheme === 'object' ? 'jui' : wo.uitheme || 'jui', // default uitheme is 'jui'
// use Object.prototype.toString.call().test('Array') instead of $.isArray to make this widget compatible with jQuery v1.2.6
o = (typeof wo.uitheme === 'object' && !Object.prototype.toString.call(wo.uitheme).test('Array')) ? wo.uitheme : $.tablesorter.themes[ $.tablesorter.themes.hasOwnProperty(theme) ? theme : 'jui'],
$h = $(c.headerList),
sh = 'tr.' + (wo.stickyHeaders || 'tablesorter-stickyHeader'),
rmv = o.sortNone + ' ' + o.sortDesc + ' ' + o.sortAsc;
if (c.debug) { time = new Date(); }
if (!$t.hasClass('tablesorter-' + theme) || c.theme === theme || !table.hasInitialized){
// update zebra stripes
if (o.even !== '') { wo.zebra[0] += ' ' + o.even; }
if (o.odd !== '') { wo.zebra[1] += ' ' + o.odd; }
// add table/footer class names
$t
// remove other selected themes; use widgetOptions.theme_remove
.removeClass( c.theme === '' ? '' : 'tablesorter-' + c.theme )
.addClass('tablesorter-' + theme + ' ' + o.table); // add theme widget class name
c.theme = ''; // clear out theme option so it doesn't interfere
// update header classes
$h
.addClass(o.header)
.filter(':not(.sorter-false)')
.hover(function(){
$(this).addClass(o.hover);
}, function(){
$(this).removeClass(o.hover);
});
if (!$h.find('.tablesorter-wrapper').length) {
// Firefox needs this inner div to position the resizer correctly
$h.wrapInner('<div class="tablesorter-wrapper" style="position:relative;height:100%;width:100%"></div>');
}
if (c.cssIcon){
// if c.cssIcon is '', then no <i> is added to the header
$h.find('.' + c.cssIcon).addClass(o.icons);
}
if ($t.hasClass('hasFilters')){
$h.find('.tablesorter-filter-row').addClass(o.filterRow);
}
}
$.each($h, function(i){
$el = $(this);
$tar = (c.cssIcon) ? $el.find('.' + c.cssIcon) : $el;
if (this.sortDisabled){
// no sort arrows for disabled columns!
$el.removeClass(rmv);
$tar.removeClass(rmv + ' tablesorter-icon ' + o.icons);
} else {
t = ($t.hasClass('hasStickyHeaders')) ? $t.find(sh).find('th').eq(i).add($el) : $el;
klass = ($el.hasClass(c.cssAsc)) ? o.sortDesc : ($el.hasClass(c.cssDesc)) ? o.sortAsc : $el.hasClass(c.cssHeader) ? o.sortNone : '';
$el[klass === o.sortNone ? 'removeClass' : 'addClass'](o.active);
$tar.removeClass(rmv).addClass(klass);
}
});
if (c.debug){
$.tablesorter.benchmark("Applying " + theme + " theme", time);
}
},
remove: function(table, c, wo){
var $t = $(table),
theme = typeof wo.uitheme === 'object' ? 'jui' : wo.uitheme || 'jui',
o = typeof wo.uitheme === 'object' ? wo.uitheme : $.tablesorter.themes[ $.tablesorter.themes.hasOwnProperty(theme) ? theme : 'jui'],
$h = $t.children('thead').children(),
rmv = o.sortNone + ' ' + o.sortDesc + ' ' + o.sortAsc;
$t
.removeClass('tablesorter-' + theme + ' ' + o.table)
.find(c.cssHeader).removeClass(o.header);
$h
.unbind('mouseenter mouseleave') // remove hover
.removeClass(o.hover + ' ' + rmv + ' ' + o.active)
.find('.tablesorter-filter-row').removeClass(o.filterRow);
$h.find('.tablesorter-icon').removeClass(o.icons);
}
});
// Widget: Column styles
// "columns", "columns_thead" (true) and
// "columns_tfoot" (true) options in "widgetOptions"
// **************************
$.tablesorter.addWidget({
id: "columns",
format: function(table){
var $tb, $tr, $td, $t, time, last, rmv, i, k, l,
$tbl = $(table),
c = table.config,
wo = c.widgetOptions,
b = $tbl.children('tbody:not(.' + c.cssInfoBlock + ')'),
list = c.sortList,
len = list.length,
css = [ "primary", "secondary", "tertiary" ]; // default options
// keep backwards compatibility, for now
css = (c.widgetColumns && c.widgetColumns.hasOwnProperty('css')) ? c.widgetColumns.css || css :
(wo && wo.hasOwnProperty('columns')) ? wo.columns || css : css;
last = css.length-1;
rmv = css.join(' ');
if (c.debug){
time = new Date();
}
// check if there is a sort (on initialization there may not be one)
for (k = 0; k < b.length; k++ ){
$tb = $.tablesorter.processTbody(table, $(b[k]), true); // detach tbody
$tr = $tb.children('tr');
l = $tr.length;
// loop through the visible rows
$tr.each(function(){
$t = $(this);
if (this.style.display !== 'none'){
// remove all columns class names
$td = $t.children().removeClass(rmv);
// add appropriate column class names
if (list && list[0]){
// primary sort column class
$td.eq(list[0][0]).addClass(css[0]);
if (len > 1){
for (i = 1; i < len; i++){
// secondary, tertiary, etc sort column classes
$td.eq(list[i][0]).addClass( css[i] || css[last] );
}
}
}
}
});
$.tablesorter.processTbody(table, $tb, false);
}
// add classes to thead and tfoot
$tr = wo.columns_thead !== false ? 'thead tr' : '';
if (wo.columns_tfoot !== false) {
$tr += ($tr === '' ? '' : ',') + 'tfoot tr';
}
if ($tr.length) {
$t = $tbl.find($tr).children().removeClass(rmv);
if (list && list[0]){
// primary sort column class
$t.filter('[data-column="' + list[0][0] + '"]').addClass(css[0]);
if (len > 1){
for (i = 1; i < len; i++){
// secondary, tertiary, etc sort column classes
$t.filter('[data-column="' + list[i][0] + '"]').addClass(css[i] || css[last]);
}
}
}
}
if (c.debug){
$.tablesorter.benchmark("Applying Columns widget", time);
}
},
remove: function(table, c, wo){
var k, $tb,
b = $(table).children('tbody:not(.' + c.cssInfoBlock + ')'),
rmv = (c.widgetOptions.columns || [ "primary", "secondary", "tertiary" ]).join(' ');
for (k = 0; k < b.length; k++ ){
$tb = $.tablesorter.processTbody(table, $(b[k]), true); // remove tbody
$tb.children('tr').each(function(){
$(this).children().removeClass(rmv);
});
$.tablesorter.processTbody(table, $tb, false); // restore tbody
}
}
});
/* Widget: filter
widgetOptions:
filter_childRows : false // if true, filter includes child row content in the search
filter_columnFilters : true // if true, a filter will be added to the top of each table column
filter_cssFilter : 'tablesorter-filter' // css class name added to the filter row & each input in the row
filter_functions : null // add custom filter functions using this option
filter_hideFilters : false // collapse filter row when mouse leaves the area
filter_ignoreCase : true // if true, make all searches case-insensitive
filter_reset : null // jQuery selector string of an element used to reset the filters
filter_searchDelay : 300 // typing delay in milliseconds before starting a search
filter_startsWith : false // if true, filter start from the beginning of the cell contents
filter_useParsedData : false // filter all data using parsed content
**************************/
$.tablesorter.addWidget({
id: "filter",
format: function(table){
if (table.config.parsers && !$(table).hasClass('hasFilters')){
var i, j, k, l, val, ff, x, xi, st, sel, str,
ft, ft2, $th, rg, s, t, dis, col,
last = '', // save last filter search
ts = $.tablesorter,
c = table.config,
$ths = $(c.headerList),
wo = c.widgetOptions,
css = wo.filter_cssFilter || 'tablesorter-filter',
$t = $(table).addClass('hasFilters'),
b = $t.children('tbody:not(.' + c.cssInfoBlock + ')'),
cols = c.parsers.length,
reg = [ // regex used in filter "check" functions
/^\/((?:\\\/|[^\/])+)\/([mig]{0,3})?$/, // 0 = regex to test for regex
new RegExp(c.cssChildRow), // 1 = child row
/undefined|number/, // 2 = check type
/(^[\"|\'|=])|([\"|\'|=]$)/, // 3 = exact match
/[\"\'=]/g, // 4 = replace exact match flags
/[^\w,. \-()]/g, // 5 = replace non-digits (from digit & currency parser)
/[<>=]/g // 6 = replace operators
],
parsed = $ths.map(function(i){
return (ts.getData) ? ts.getData($ths.filter('[data-column="' + i + '"]:last'), c.headers[i], 'filter') === 'parsed' : $(this).hasClass('filter-parsed');
}).get(),
time, timer,
// dig fer gold
checkFilters = function(filter){
var arry = $.isArray(filter),
$inpts = $t.find('thead').eq(0).children('tr').find('select.' + css + ', input.' + css),
v = (arry) ? filter : $inpts.map(function(){
return $(this).val() || '';
}).get(),
cv = (v || []).join(''); // combined filter values
// add filter array back into inputs
if (arry) {
$inpts.each(function(i,el){
$(el).val(filter[i] || '');
});
}
if (wo.filter_hideFilters === true){
// show/hide filter row as needed
$t.find('.tablesorter-filter-row').trigger( cv === '' ? 'mouseleave' : 'mouseenter' );
}
// return if the last search is the same; but filter === false when updating the search
// see example-widget-filter.html filter toggle buttons
if (last === cv && filter !== false) { return; }
$t.trigger('filterStart', [v]);
if (c.showProcessing) {
// give it time for the processing icon to kick in
setTimeout(function(){
findRows(filter, v, cv);
return false;
}, 30);
} else {
findRows(filter, v, cv);
return false;
}
},
findRows = function(filter, v, cv){
var $tb, $tr, $td, cr, r, l, ff, time, arry;
if (c.debug) { time = new Date(); }
for (k = 0; k < b.length; k++ ){
$tb = $.tablesorter.processTbody(table, $(b[k]), true);
$tr = $tb.children('tr');
l = $tr.length;
if (cv === ''){
$tr.show().removeClass('filtered');
} else {
// loop through the rows
for (j = 0; j < l; j++){
// skip child rows
if (reg[1].test($tr[j].className)) { continue; }
r = true;
cr = $tr.eq(j).nextUntil('tr:not(.' + c.cssChildRow + ')');
// so, if "table.config.widgetOptions.filter_childRows" is true and there is
// a match anywhere in the child row, then it will make the row visible
// checked here so the option can be changed dynamically
t = (cr.length && (wo && wo.hasOwnProperty('filter_childRows') &&
typeof wo.filter_childRows !== 'undefined' ? wo.filter_childRows : true)) ? cr.text() : '';
t = wo.filter_ignoreCase ? t.toLocaleLowerCase() : t;
$td = $tr.eq(j).children('td');
for (i = 0; i < cols; i++){
// ignore if filter is empty or disabled
if (v[i]){
// check if column data should be from the cell or from parsed data
if (wo.filter_useParsedData || parsed[i]){
x = c.cache[k].normalized[j][i];
} else {
// using older or original tablesorter
x = $.trim($td.eq(i).text());
}
xi = !reg[2].test(typeof x) && wo.filter_ignoreCase ? x.toLocaleLowerCase() : x;
ff = r; // if r is true, show that row
// val = case insensitive, v[i] = case sensitive
val = wo.filter_ignoreCase ? v[i].toLocaleLowerCase() : v[i];
if (wo.filter_functions && wo.filter_functions[i]){
if (wo.filter_functions[i] === true){
// default selector; no "filter-select" class
ff = ($ths.filter('[data-column="' + i + '"]:last').hasClass('filter-match')) ? xi.search(val) >= 0 : v[i] === x;
} else if (typeof wo.filter_functions[i] === 'function'){
// filter callback( exact cell content, parser normalized content, filter input value, column index )
ff = wo.filter_functions[i](x, c.cache[k].normalized[j][i], v[i], i);
} else if (typeof wo.filter_functions[i][v[i]] === 'function'){
// selector option function
ff = wo.filter_functions[i][v[i]](x, c.cache[k].normalized[j][i], v[i], i);
}
// Look for regex
} else if (reg[0].test(val)){
rg = reg[0].exec(val);
try {
ff = new RegExp(rg[1], rg[2]).test(xi);
} catch (err){
ff = false;
}
// Look for quotes or equals to get an exact match
} else if (reg[3].test(val) && xi === val.replace(reg[4], '')){
ff = true;
// Look for a not match
} else if (/^\!/.test(val)){
val = val.replace('!','');
s = xi.search($.trim(val));
ff = val === '' ? true : !(wo.filter_startsWith ? s === 0 : s >= 0);
// Look for operators >, >=, < or <=
} else if (/^[<>]=?/.test(val)){
// xi may be numeric - see issue #149
rg = isNaN(xi) ? $.tablesorter.formatFloat(xi.replace(reg[5], ''), table) : $.tablesorter.formatFloat(xi, table);
s = $.tablesorter.formatFloat(val.replace(reg[5], '').replace(reg[6],''), table);
if (/>/.test(val)) { ff = />=/.test(val) ? rg >= s : rg > s; }
if (/</.test(val)) { ff = /<=/.test(val) ? rg <= s : rg < s; }
// Look for wild card: ? = single, or * = multiple
} else if (/[\?|\*]/.test(val)){
ff = new RegExp( val.replace(/\?/g, '\\S{1}').replace(/\*/g, '\\S*') ).test(xi);
// Look for match, and add child row data for matching
} else {
x = (xi + t).indexOf(val);
ff = ( (!wo.filter_startsWith && x >= 0) || (wo.filter_startsWith && x === 0) );
}
r = (ff) ? (r ? true : false) : false;
}
}
$tr[j].style.display = (r ? '' : 'none');
$tr.eq(j)[r ? 'removeClass' : 'addClass']('filtered');
if (cr.length) { cr[r ? 'show' : 'hide'](); }
}
}
$.tablesorter.processTbody(table, $tb, false);
}
last = cv; // save last search
if (c.debug){
ts.benchmark("Completed filter widget search", time);
}
$t.trigger('applyWidgets'); // make sure zebra widget is applied
$t.trigger('filterEnd');
},
buildSelect = function(i, updating){
var o, arry = [];
i = parseInt(i, 10);
o = '<option value="">' + ($ths.filter('[data-column="' + i + '"]:last').attr('data-placeholder') || '') + '</option>';
for (k = 0; k < b.length; k++ ){
l = c.cache[k].row.length;
// loop through the rows
for (j = 0; j < l; j++){
// get non-normalized cell content
if (wo.filter_useParsedData){
arry.push( '' + c.cache[k].normalized[j][i] );
} else {
t = c.cache[k].row[j][0].cells[i];
if (t){
arry.push( $.trim(c.supportsTextContent ? t.textContent : $(t).text()) );
}
}
}
}
// get unique elements and sort the list
// if $.tablesorter.sortText exists (not in the original tablesorter),
// then natural sort the list otherwise use a basic sort
arry = $.grep(arry, function(v, k){
return $.inArray(v ,arry) === k;
});
arry = (ts.sortText) ? arry.sort(function(a,b){ return ts.sortText(table, a, b, i); }) : arry.sort(true);
// build option list
for (k = 0; k < arry.length; k++){
o += '<option value="' + arry[k] + '">' + arry[k] + '</option>';
}
$t.find('thead').find('select.' + css + '[data-column="' + i + '"]')[ updating ? 'html' : 'append' ](o);
},
buildDefault = function(updating){
// build default select dropdown
for (i = 0; i < cols; i++){
t = $ths.filter('[data-column="' + i + '"]:last');
// look for the filter-select class, but don't build it twice.
if (t.hasClass('filter-select') && !t.hasClass('filter-false') && !(wo.filter_functions && wo.filter_functions[i] === true)){
if (!wo.filter_functions) { wo.filter_functions = {}; }
wo.filter_functions[i] = true; // make sure this select gets processed by filter_functions
buildSelect(i, updating);
}
}
};
if (c.debug){
time = new Date();
}
wo.filter_ignoreCase = wo.filter_ignoreCase !== false; // set default filter_ignoreCase to true
wo.filter_useParsedData = wo.filter_useParsedData === true; // default is false
// don't build filter row if columnFilters is false or all columns are set to "filter-false" - issue #156
if (wo.filter_columnFilters !== false && $ths.filter('.filter-false').length !== $ths.length){
t = '<tr class="tablesorter-filter-row">'; // build filter row
for (i = 0; i < cols; i++){
dis = false;
$th = $ths.filter('[data-column="' + i + '"]:last'); // assuming last cell of a column is the main column
sel = (wo.filter_functions && wo.filter_functions[i] && typeof wo.filter_functions[i] !== 'function') || $th.hasClass('filter-select');
t += '<td>';
if (sel){
t += '<select data-column="' + i + '" class="' + css;
} else {
t += '<input type="search" placeholder="' + ($th.attr('data-placeholder') || "") + '" data-column="' + i + '" class="' + css;
}
// use header option - headers: { 1: { filter: false } } OR add class="filter-false"
if (ts.getData){
dis = ts.getData($th[0], c.headers[i], 'filter') === 'false';
// get data from jQuery data, metadata, headers option or header class name
t += dis ? ' disabled" disabled' : '"';
} else {
dis = (c.headers[i] && c.headers[i].hasOwnProperty('filter') && c.headers[i].filter === false) || $th.hasClass('filter-false');
// only class names and header options - keep this for compatibility with tablesorter v2.0.5
t += (dis) ? ' disabled" disabled' : '"';
}
t += (sel ? '></select>' : '>') + '</td>';
}
$t.find('thead').eq(0).append(t += '</tr>');
}
$t
// add .tsfilter namespace to all BUT search
.bind('addRows updateCell update appendCache search'.split(' ').join('.tsfilter '), function(e, filter){
if (e.type !== 'search'){
buildDefault(true);
}
checkFilters(e.type === 'search' ? filter : '');
return false;
})
.find('input.' + css).bind('keyup search', function(e, filter){
// ignore arrow and meta keys; allow backspace
if ((e.which < 32 && e.which !== 8) || (e.which >= 37 && e.which <=40)) { return; }
// skip delay
if (typeof filter !== 'undefined'){
checkFilters(filter);
return false;
}
// delay filtering
clearTimeout(timer);
timer = setTimeout(function(){
checkFilters();
}, wo.filter_searchDelay || 300);
});
// reset button/link
if (wo.filter_reset && $(wo.filter_reset).length){
$(wo.filter_reset).bind('click', function(){
$t.find('.' + css).val('');
checkFilters();
return false;
});
}
if (wo.filter_functions){
// i = column # (string)
for (col in wo.filter_functions){
if (wo.filter_functions.hasOwnProperty(col) && typeof col === 'string'){
t = $ths.filter('[data-column="' + col + '"]:last');
ff = '';
if (wo.filter_functions[col] === true && !t.hasClass('filter-false')){
buildSelect(col);
} else if (typeof col === 'string' && !t.hasClass('filter-false')){
// add custom drop down list
for (str in wo.filter_functions[col]){
if (typeof str === 'string'){
ff += ff === '' ? '<option value="">' + (t.attr('data-placeholder') || '') + '</option>' : '';
ff += '<option value="' + str + '">' + str + '</option>';
}
}
$t.find('thead').find('select.' + css + '[data-column="' + col + '"]').append(ff);
}
}
}
}
buildDefault();
$t.find('select.' + css).bind('change search', function(){
checkFilters();
});
if (wo.filter_hideFilters === true){
$t
.find('.tablesorter-filter-row')
.addClass('hideme')
.bind('mouseenter mouseleave', function(e){
// save event object - http://bugs.jquery.com/ticket/12140
var all, evt = e;
ft = $(this);
clearTimeout(st);
st = setTimeout(function(){
if (/enter|over/.test(evt.type)){
ft.removeClass('hideme');
} else {
// don't hide if input has focus
// $(':focus') needs jQuery 1.6+
if ($(document.activeElement).closest('tr')[0] !== ft[0]){
// get all filter values
all = $t.find('.' + (wo.filter_cssFilter || 'tablesorter-filter')).map(function(){
return $(this).val() || '';
}).get().join('');
// don't hide row if any filter has a value
if (all === ''){
ft.addClass('hideme');
}
}
}
}, 200);
})
.find('input, select').bind('focus blur', function(e){
ft2 = $(this).closest('tr');
clearTimeout(st);
st = setTimeout(function(){
// don't hide row if any filter has a value
if ($t.find('.' + (wo.filter_cssFilter || 'tablesorter-filter')).map(function(){ return $(this).val() || ''; }).get().join('') === ''){
ft2[ e.type === 'focus' ? 'removeClass' : 'addClass']('hideme');
}
}, 200);
});
}
// show processing icon
if (c.showProcessing) {
$t.bind('filterStart filterEnd', function(e, v) {
var fc = (v) ? $t.find('.' + c.cssHeader).filter('[data-column]').filter(function(){
return v[$(this).data('column')] !== '';
}) : '';
ts.isProcessing($t[0], e.type === 'filterStart', v ? fc : '');
});
}
if (c.debug){
ts.benchmark("Applying Filter widget", time);
}
// filter widget initialized
$t.trigger('filterInit');
}
},
remove: function(table, c, wo){
var k, $tb,
$t = $(table),
b = $t.children('tbody:not(.' + c.cssInfoBlock + ')');
$t
.removeClass('hasFilters')
// add .tsfilter namespace to all BUT search
.unbind('addRows updateCell update appendCache search'.split(' ').join('.tsfilter'))
.find('.tablesorter-filter-row').remove();
for (k = 0; k < b.length; k++ ){
$tb = $.tablesorter.processTbody(table, $(b[k]), true); // remove tbody
$tb.children().removeClass('filtered').show();
$.tablesorter.processTbody(table, $tb, false); // restore tbody
}
if (wo.filterreset) { $(wo.filter_reset).unbind('click'); }
}
});
// Widget: Sticky headers
// based on this awesome article:
// http://css-tricks.com/13465-persistent-headers/
// and https://github.com/jmosbech/StickyTableHeaders by Jonas Mosbech
// **************************
$.tablesorter.addWidget({
id: "stickyHeaders",
format: function(table){
if ($(table).hasClass('hasStickyHeaders')) { return; }
var $table = $(table).addClass('hasStickyHeaders'),
c = table.config,
wo = c.widgetOptions,
win = $(window),
header = $(table).children('thead:first'), //.add( $(table).find('caption') ),
hdrCells = header.children('tr:not(.sticky-false)').children(),
css = wo.stickyHeaders || 'tablesorter-stickyHeader',
innr = '.tablesorter-header-inner',
firstRow = hdrCells.eq(0).parent(),
tfoot = $table.find('tfoot'),
t2 = $table.clone(),
// clone the entire thead - seems to work in IE8+
stkyHdr = t2.children('thead:first')
.addClass(css)
.css({
width : header.outerWidth(true),
position : 'fixed',
margin : 0,
top : 0,
visibility : 'hidden',
zIndex : 1
}),
stkyCells = stkyHdr.children('tr:not(.sticky-false)').children(), // issue #172
laststate = '',
spacing = 0,
resizeHdr = function(){
var bwsr = navigator.userAgent;
spacing = 0;
// yes, I dislike browser sniffing, but it really is needed here :(
// webkit automatically compensates for border spacing
if ($table.css('border-collapse') !== 'collapse' && !/(webkit|msie)/i.test(bwsr)) {
// Firefox & Opera use the border-spacing
// update border-spacing here because of demos that switch themes
spacing = parseInt(hdrCells.eq(0).css('border-left-width'), 10) * 2;
}
stkyHdr.css({
left : header.offset().left - win.scrollLeft() - spacing,
width: header.outerWidth()
});
stkyCells
.each(function(i){
var $h = hdrCells.eq(i);
$(this).css({
width: $h.width() - spacing,
height: $h.height()
});
})
.find(innr).each(function(i){
var hi = hdrCells.eq(i).find(innr),
w = hi.width(); // - ( parseInt(hi.css('padding-left'), 10) + parseInt(hi.css('padding-right'), 10) );
$(this).width(w);
});
};
// clear out cloned table, except for sticky header
t2.find('thead:gt(0),tr.sticky-false,tbody,tfoot,caption').remove();
t2.css({ height:0, width:0, padding:0, margin:0, border:0 });
// remove rows you don't want to be sticky
stkyHdr.find('tr.sticky-false').remove();
// remove resizable block
stkyCells.find('.tablesorter-resizer').remove();
// update sticky header class names to match real header after sorting
$table
.bind('sortEnd.tsSticky', function(){
hdrCells.each(function(i){
var t = stkyCells.eq(i);
t.attr('class', $(this).attr('class'));
if (c.cssIcon){
t
.find('.' + c.cssIcon)
.attr('class', $(this).find('.' + c.cssIcon).attr('class'));
}
});
})
.bind('pagerComplete.tsSticky', function(){
resizeHdr();
});
// set sticky header cell width and link clicks to real header
hdrCells.find('*').andSelf().filter(c.selectorSort).each(function(i){
var t = $(this);
stkyCells.eq(i)
// clicking on sticky will trigger sort
.bind('mouseup', function(e){
t.trigger(e, true); // external mouseup flag (click timer is ignored)
})
// prevent sticky header text selection
.bind('mousedown', function(){
this.onselectstart = function(){ return false; };
return false;
});
});
$table.before( t2 );
// make it sticky!
win
.bind('scroll.tsSticky', function(){
var offset = firstRow.offset(),
sTop = win.scrollTop(),
tableHt = $table.height() - (stkyHdr.height() + (tfoot.height() || 0)),
vis = (sTop > offset.top) && (sTop < offset.top + tableHt) ? 'visible' : 'hidden';
stkyHdr
.css({
// adjust when scrolling horizontally - fixes issue #143
left : header.offset().left - win.scrollLeft() - spacing,
visibility : vis
});
if (vis !== laststate){
// make sure the column widths match
resizeHdr();
laststate = vis;
}
})
.bind('resize.tsSticky', function(){
resizeHdr();
});
},
remove: function(table, c, wo){
var $t = $(table),
css = wo.stickyHeaders || 'tablesorter-stickyHeader';
$t
.removeClass('hasStickyHeaders')
.unbind('sortEnd.tsSticky pagerComplete.tsSticky')
.find('.' + css).remove();
$(window).unbind('scroll.tsSticky resize.tsSticky');
}
});
// Add Column resizing widget
// this widget saves the column widths if
// $.tablesorter.storage function is included
// **************************
$.tablesorter.addWidget({
id: "resizable",
format: function(table){
if ($(table).hasClass('hasResizable')) { return; }
$(table).addClass('hasResizable');
var t, j, s, $c, $cols,
$tbl = $(table),
c = table.config,
wo = c.widgetOptions,
position = 0,
$target = null,
$next = null,
stopResize = function(){
position = 0;
$target = $next = null;
$(window).trigger('resize'); // will update stickyHeaders, just in case
};
s = ($.tablesorter.storage && wo.resizable !== false) ? $.tablesorter.storage(table, 'tablesorter-resizable') : {};
// process only if table ID or url match
if (s){
for (j in s){
if (!isNaN(j) && j < c.headerList.length){
$(c.headerList[j]).width(s[j]); // set saved resizable widths
}
}
}
$tbl.children('thead:first').find('tr').each(function(){
$c = $(this).children();
if (!$(this).find('.tablesorter-wrapper').length) {
// Firefox needs this inner div to position the resizer correctly
$c.wrapInner('<div class="tablesorter-wrapper" style="position:relative;height:100%;width:100%"></div>');
}
$c = $c.slice(0,-1); // don't include the last column of the row
$cols = $cols ? $cols.add($c) : $c;
});
$cols
.each(function(){
t = $(this);
j = parseInt(t.css('padding-right'), 10) + 8; // 8 is 1/2 of the 16px wide resizer
t
.find('.tablesorter-wrapper')
.append('<div class="tablesorter-resizer" style="cursor:w-resize;position:absolute;height:100%;width:16px;right:-' + j + 'px;top:0;z-index:1;"></div>');
})
.bind('mousemove.tsresize', function(e){
// ignore mousemove if no mousedown
if (position === 0 || !$target) { return; }
// resize columns
var w = e.pageX - position;
$target.width( $target.width() + w );
$next.width( $next.width() - w );
position = e.pageX;
})
.bind('mouseup.tsresize', function(){
if ($.tablesorter.storage && $target){
s[$target.index()] = $target.width();
s[$next.index()] = $next.width();
if (wo.resizable !== false){
$.tablesorter.storage(table, 'tablesorter-resizable', s);
}
}
stopResize();
})
.find('.tablesorter-resizer')
.bind('mousedown', function(e){
// save header cell and mouse position; closest() not supported by jQuery v1.2.6
$target = $(e.target).parents('th:last');
$next = $target.next();
position = e.pageX;
});
$tbl.find('thead:first')
.bind('mouseup.tsresize mouseleave.tsresize', function(e){
stopResize();
})
// right click to reset columns to default widths
.bind('contextmenu.tsresize', function(){
$.tablesorter.resizableReset(table);
// $.isEmptyObject() needs jQuery 1.4+
var rtn = $.isEmptyObject ? $.isEmptyObject(s) : s === {}; // allow right click if already reset
s = {};
return rtn;
});
},
remove: function(table, c, wo){
$(table)
.removeClass('hasResizable')
.find('thead')
.unbind('mouseup.tsresize mouseleave.tsresize contextmenu.tsresize')
.find('tr').children()
.unbind('mousemove.tsresize mouseup.tsresize')
.find('.tablesorter-wrapper').each(function(){
$(this).find('.tablesorter-resizer').remove();
$(this).replaceWith( $(this).contents() );
});
$.tablesorter.resizableReset(table);
}
});
$.tablesorter.resizableReset = function(table){
$(table.config.headerList).width('auto');
$.tablesorter.storage(table, 'tablesorter-resizable', {});
};
// Save table sort widget
// this widget saves the last sort only if the
// saveSort widget option is true AND the
// $.tablesorter.storage function is included
// **************************
$.tablesorter.addWidget({
id: 'saveSort',
init: function(table, thisWidget){
// run widget format before all other widgets are applied to the table
thisWidget.format(table, true);
},
format: function(table, init){
var sl, time, c = table.config,
wo = c.widgetOptions,
ss = wo.saveSort !== false, // make saveSort active/inactive; default to true
sortList = { "sortList" : c.sortList };
if (c.debug){
time = new Date();
}
if ($(table).hasClass('hasSaveSort')){
if (ss && table.hasInitialized && $.tablesorter.storage){
$.tablesorter.storage( table, 'tablesorter-savesort', sortList );
if (c.debug){
$.tablesorter.benchmark('saveSort widget: Saving last sort: ' + c.sortList, time);
}
}
} else {
// set table sort on initial run of the widget
$(table).addClass('hasSaveSort');
sortList = '';
// get data
if ($.tablesorter.storage){
sl = $.tablesorter.storage( table, 'tablesorter-savesort' );
sortList = (sl && sl.hasOwnProperty('sortList') && $.isArray(sl.sortList)) ? sl.sortList : '';
if (c.debug){
$.tablesorter.benchmark('saveSort: Last sort loaded: "' + sortList + '"', time);
}
}
// init is true when widget init is run, this will run this widget before all other widgets have initialized
// this method allows using this widget in the original tablesorter plugin; but then it will run all widgets twice.
if (init && sortList && sortList.length > 0){
c.sortList = sortList;
} else if (table.hasInitialized && sortList && sortList.length > 0){
// update sort change
$(table).trigger('sorton', [sortList]);
}
}
},
remove: function(table, c, wo){
// clear storage
$.tablesorter.storage( table, 'tablesorter-savesort', '' );
}
});
})(jQuery);
|
import "core-js/modules/es.array.concat";
import { hasOwnProperty, isObject } from './../../helpers/object';
import { arrayEach } from './../../helpers/array';
/**
* Create separated id for borders for each cell.
*
* @param {Number} row Visual row index.
* @param {Number} col Visual column index.
* @returns {String}
*/
export function createId(row, col) {
return "border_row".concat(row, "col").concat(col);
}
/**
* Create default single border for each position (top/right/bottom/left).
*
* @returns {Object} `{{width: number, color: string}}`
*/
export function createDefaultCustomBorder() {
return {
width: 1,
color: '#000'
};
}
/**
* Create default object for empty border.
*
* @returns {Object} `{{hide: boolean}}`
*/
export function createSingleEmptyBorder() {
return {
hide: true
};
}
/**
* Create default Handsontable border object.
*
* @returns {Object} `{{width: number, color: string, cornerVisible: boolean}}`
*/
export function createDefaultHtBorder() {
return {
width: 1,
color: '#000',
cornerVisible: false
};
}
/**
* Prepare empty border for each cell with all custom borders hidden.
*
* @param {Number} row Visual row index.
* @param {Number} col Visual column index.
* @returns {Object} `{{id: *, border: *, row: *, col: *, top: {hide: boolean}, right: {hide: boolean}, bottom: {hide: boolean}, left: {hide: boolean}}}`
*/
export function createEmptyBorders(row, col) {
return {
id: createId(row, col),
border: createDefaultHtBorder(),
row: row,
col: col,
top: createSingleEmptyBorder(),
right: createSingleEmptyBorder(),
bottom: createSingleEmptyBorder(),
left: createSingleEmptyBorder()
};
}
export function extendDefaultBorder(defaultBorder, customBorder) {
if (hasOwnProperty(customBorder, 'border')) {
defaultBorder.border = customBorder.border;
}
if (hasOwnProperty(customBorder, 'top')) {
if (customBorder.top) {
if (!isObject(customBorder.top)) {
customBorder.top = createDefaultCustomBorder();
}
defaultBorder.top = customBorder.top;
} else {
customBorder.top = createSingleEmptyBorder();
defaultBorder.top = customBorder.top;
}
}
if (hasOwnProperty(customBorder, 'right')) {
if (customBorder.right) {
if (!isObject(customBorder.right)) {
customBorder.right = createDefaultCustomBorder();
}
defaultBorder.right = customBorder.right;
} else {
customBorder.right = createSingleEmptyBorder();
defaultBorder.right = customBorder.right;
}
}
if (hasOwnProperty(customBorder, 'bottom')) {
if (customBorder.bottom) {
if (!isObject(customBorder.bottom)) {
customBorder.bottom = createDefaultCustomBorder();
}
defaultBorder.bottom = customBorder.bottom;
} else {
customBorder.bottom = createSingleEmptyBorder();
defaultBorder.bottom = customBorder.bottom;
}
}
if (hasOwnProperty(customBorder, 'left')) {
if (customBorder.left) {
if (!isObject(customBorder.left)) {
customBorder.left = createDefaultCustomBorder();
}
defaultBorder.left = customBorder.left;
} else {
customBorder.left = createSingleEmptyBorder();
defaultBorder.left = customBorder.left;
}
}
return defaultBorder;
}
/**
* Check if selection has border.
*
* @param hot
* @param direction
*/
export function checkSelectionBorders(hot, direction) {
var atLeastOneHasBorder = false;
arrayEach(hot.getSelectedRange(), function (range) {
range.forAll(function (r, c) {
var metaBorders = hot.getCellMeta(r, c).borders;
if (metaBorders) {
if (direction) {
if (!hasOwnProperty(metaBorders[direction], 'hide') || metaBorders[direction].hide === false) {
atLeastOneHasBorder = true;
return false; // breaks forAll
}
} else {
atLeastOneHasBorder = true;
return false; // breaks forAll
}
}
});
});
return atLeastOneHasBorder;
}
/**
* Mark label in contextMenu as selected.
*
* @param label
* @returns {string}
*/
export function markSelected(label) {
return "<span class=\"selected\">".concat(String.fromCharCode(10003), "</span>").concat(label); // workaround for https://github.com/handsontable/handsontable/issues/1946
}
|
import Icon from '../components/Icon.vue'
Icon.register({
peace: {
width: 496,
height: 512,
paths: [
{
d: 'M248 8c137 0 248 111 248 248s-111 248-248 248-248-111-248-248 111-248 248-248zM432 256c0-90.5-65.8-165.8-152-181v165.7l129.4 103.5c14.4-26.2 22.6-56.2 22.6-88.2zM216 437v-114.5l-89.3 71.4c24.8 21.8 55.4 37 89.3 43zM280 322.6v114.4c33.9-6 64.5-21.2 89.3-43zM216 75c-86.2 15.2-152 90.5-152 181 0 31.9 8.2 62 22.6 88.2l129.4-103.5v-165.7z'
}
]
}
})
|
//GLOBAL VARIABLES
//window.player = music player
const defaultAlbumImg = "https://d2qqvwdwi4u972.cloudfront.net/static/img/default_album.png"
$(document).ready(function(){
window.player = $("#music-player")
$("footer:not(#orig-footer)").remove()
/* CSRF Handling*/
$.ajaxSetup({
beforeSend: function(xhr, settings) {
function getCookie(name) {
var cookieValue = null;
if (document.cookie && document.cookie != '') {
var cookies = document.cookie.split(';');
for (var i = 0; i < cookies.length; i++) {
var cookie = jQuery.trim(cookies[i]);
// Does this cookie string begin with the name we want?
if (cookie.substring(0, name.length + 1) == (name + '=')) {
cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
break;
}
}
}
return cookieValue;
}
if (!(/^http:.*/.test(settings.url) || /^https:.*/.test(settings.url))) {
// Only send the token to relative URLs i.e. locally.
xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken'));
}
}
});
$("button#search-song").click(searchSong)
$("input#search-songs").keypress(e => {
let key = e.which || e.keyCode
if(key == 13) searchSong()
})
$(document).on("click", ".suggested-track", function() { //click on suggestion
$.post("/postsong", {
'name': searchQuery, //the query was saved the moment the "search" button was pressed
'index': parseInt(this.id), //id is the index of the song in the results list
loc: currentLocation
}, data => {
//if data is valid and preview url is available, set player to player to play preview url
//if invalid or preview url unavailable, dead link is used (not playable)
if(!data.valid || !data.name) {
alert("Unable to add song.")
return
}
let src = (data.preview) ? data.preview : "#"
let image = (data.image) ? data.image : defaultAlbumImg
if($(".no-songs").length || $(".song-error").length) $(".song-list").html("")
$(".song-list").append(`<div class="track">
<p src="${src}">${data.name}<span class="artist"> - ${data.artist}</span></p>
<img src="${image}" width=50 height=50>
</div>`)
pause()
$(".suggestions").html("")
}).fail(() => alert('Error: Could not post song'))
$("button#post-song").val("")
})
$(document).on("click", ":not(.suggestions)", () => $(".suggestions").html(""))
/*Audio controls*/
$(".fa-play").click(() => {
if(!checkPlayable()) return
if(player[0].canPlayType && player[0].paused) play()
else pause()
})
player.on("ended", nextSong)
/*Playlist controls*/
$(document).on("click", ".track", function(){
player.attr("src", $(this).children("p").attr("src"))
$(".selected").removeClass("selected")
$(this).addClass("selected")
if(!checkPlayable()) {
alert("Error: Song not playable")
return
}
play()
})
$(".fa-step-forward").click(nextSong)
$(".fa-step-backward").click(() => {
if($(".selected").is(":first-child")) return
$(".selected").prev().addClass("temp")
$(".selected").removeClass("selected")
$(".temp").addClass("selected")
$(".temp").removeClass("temp")
player.attr("src", $(".selected").children("p").attr("src"))
if(!checkPlayable()) return
play()
})
})
function pause(){
player[0].pause()
$(".fa-play").removeClass("fa-pause")
}
function play(){
player[0].play()
$(".fa-play").addClass("fa-pause")
}
function checkPlayable(){
if(player.attr("src") == "#"){
$(".selected").css("background-color", "#ffcccc")
nextSong()
return false
}
return true
}
function nextSong(){
if($(".selected").is(":last-child")) {
$(".selected").removeClass("selected")
pause()
return
}
$(".selected").next().addClass("temp")
$(".selected").removeClass("selected")
$(".temp").addClass("selected")
$(".temp").removeClass("temp")
player.attr("src", $(".selected").children("p").attr("src"))
if(!$(".selected").length || !checkPlayable()) return
play()
}
function searchSong(){
if(!$("#search-songs").val().length) return
$(".suggestions").html("")
window.searchQuery = $("#search-songs").val()
$.get("/searchsong", {'name': $("#search-songs").val()}, data => {
data = JSON.parse(data)
//console.log(data)
data.results.tracks.items.forEach((elem, index) => {
$(".suggestions").append(`<div class="suggested-track" id="${index}">
<p src="${elem.preview_url}">${elem.name}<span class="artist"> - ${elem.artists[0].name}</span></p>
<img src="${elem.album.images[2].url}" width=40 height=40>
</div>`)
})
})
}
|
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _timeTime = require('../time/Time');
var _timeTime2 = _interopRequireDefault(_timeTime);
var _rcUtil = require('rc-util');
var _rcUtil2 = _interopRequireDefault(_rcUtil);
var _util = require('../util/');
var toFragment = _rcUtil2['default'].Children.mapSelf;
var CalendarFooter = _react2['default'].createClass({
displayName: 'CalendarFooter',
propTypes: {
onSelect: _react.PropTypes.func,
value: _react.PropTypes.object,
defaultValue: _react.PropTypes.object
},
onSelect: function onSelect(value) {
this.props.onSelect(value);
},
render: function render() {
var props = this.props;
var value = props.value;
var locale = props.locale;
var prefixCls = props.prefixCls;
var footerEl = null;
if (props.showToday || props.showTime) {
var nowEl = undefined;
if (props.showToday) {
nowEl = (0, _util.getTodayElement)(props);
}
var okBtn = undefined;
if (props.showOk) {
okBtn = (0, _util.getOkElement)(props);
}
var footerBtn = undefined;
if (nowEl) {
footerBtn = _react2['default'].createElement(
'span',
{ className: prefixCls + '-footer-btn' },
toFragment([nowEl, okBtn])
);
}
var timeEl = undefined;
if (props.showTime) {
timeEl = _react2['default'].createElement(_timeTime2['default'], { value: value, prefixCls: prefixCls,
disabled: props.timeDisabled,
locale: locale, onChange: this.onSelect });
}
footerEl = _react2['default'].createElement(
'div',
{ className: prefixCls + '-footer' },
timeEl,
footerBtn
);
}
return footerEl;
}
});
exports['default'] = CalendarFooter;
module.exports = exports['default'];
|
import React, { Component } from 'react';
import './SortVisualizer.css';
import Visualizer from './Visualizer/Visualizer';
import AlgorithmSelect from './AlgorithmSelect/AlgorithmSelect';
import { Sort, setSpeed, stopSort } from './Sorter';
import { log } from './Logger';
import { calcStyle } from './Visualizer/Bar/Bar';
const MAX_LENGTH = 120;
const DEFAULT_MIN = 0;
const DEFAULT_MAX = 75;
const DEFAULT_SPEED = 50;
let isSorting = false;
let speed = DEFAULT_SPEED;
let algorithmId = 0;
export default class SortVisualizer extends Component {
constructor(props) {
super(props);
this.handleChangeMinValue = this.handleChangeMinValue.bind(this);
this.handleChangeMaxValue = this.handleChangeMaxValue.bind(this);
this.handleChangeLength = this.handleChangeLength.bind(this);
this.handleStartSort = this.handleStartSort.bind(this);
this.handleReset = this.handleReset.bind(this);
this.handleAlgorithmSelected = this.handleAlgorithmSelected.bind(this);
this.handleOpenSettings = this.handleOpenSettings.bind(this);
this.state = {
minValue: DEFAULT_MIN,
maxValue: DEFAULT_MAX,
length: MAX_LENGTH,
algorithmList: [
{ id: 0, name: "Selection Sort" },
{ id: 1, name: "Bubble Sort" },
{ id: 2, name: "Insertion Sort" },
{ id: 3, name: "Merge Sort" },
{ id: 4, name: "Quicksort (Lomuto)" },
{ id: 5, name: "Quicksort (Hoare)" },
{ id: 6, name: "Heap Sort" },
{ id: 7, name: "Counting Sort [WIP]" },
{ id: 8, name: "Radix Sort [WIP]" },
{ id: 9, name: "Bucket Sort [WIP]" }
]
};
}
componentDidMount() {
log("--SortVisualizer Mounted--");
this.updateVisualizer(DEFAULT_MIN, DEFAULT_MAX, MAX_LENGTH);
}
handleChangeMinValue = (e) => {
log("--SortVisualizer.js: handleChangeMinValue--");
const val = e.target.value;
this.updateVisualizer(val, this.state.maxValue, this.state.length);
}
handleChangeMaxValue = (e) => {
log("--SortVisualizer.js: handleChangeMaxValue--");
const val = e.target.value;
this.updateVisualizer(this.state.minValue, val, this.state.length);
}
handleChangeLength = (e) => {
log("--SortVisualizer.js: handleChangeLength--");
const val = e.target.value;
this.updateVisualizer(this.state.minValue, this.state.maxValue, val);
}
handleChangeSpeed = (e) => {
log("--SortVisualizer.js: handleChangeSpeed--");
const val = e.target.value;
speed = val;
setSpeed(speed);
document.getElementById("settings--speed").innerText = val;
}
handleStartSort = () => {
log("--SortVisualizer.js: handleStartSort--");
if (isSorting) return;
isSorting = true;
Sort(algorithmId, this.state.length, speed);
}
handleReset = () => {
if (isSorting) {
stopSort();
}
let a = Array.from(document.querySelectorAll(".bar"));
a.forEach(element => {
element.dataset.value = element.dataset.originalvalue;
element.className = "bar tooltip";
element.style.height = calcStyle(element.dataset.value).height;
element.firstChild.innerText = element.dataset.value;
});
}
handleOpenSettings = () => {
document.body.classList.toggle("settings-open");
}
handleAlgorithmSelected = (value) => {
algorithmId = value;
}
updateVisualizer = (min, max, len) => {
if (isSorting) return;
this.handleReset();
this.setState({ minValue: min, maxValue: max, length: len });
}
render() {
const { minValue, maxValue, length, algorithmList } = this.state;
return (
<div className="content">
<button
className="settings-toggle"
aria-label="toggle settings"
onClick={this.handleOpenSettings}
>
<span className="hamburger"></span>
</button>
<div className="top">
<div className="top__panel">
<div className="title">
<h1 className="title">Sorting Algorithm <br /> Visualizer</h1>
</div>
<div className="algorithm">
<span className="algorithm--title">Algorithm: </span>
<div className="algorithm__select">
<AlgorithmSelect
defaultSelectText={algorithmList[0].name}
optionsList={algorithmList}
onAlgorithmSelected={this.handleAlgorithmSelected}
/>
</div>
</div>
<div className="settings">
<div className="settings--input">
<span className="settings--input__title">Mininum</span>
<input
name="settings--input_min"
type="range"
className="settings--input__slider settings--input__min"
min="0"
max="75"
defaultValue="0"
onChange={this.handleChangeMinValue}>
</input>
<label htmlFor="settings--input__min" className="settings--input__label">{minValue}</label>
</div>
<div className="settings--input">
<span className="settings--input__title">Maximum</span>
<input
name="settings--input_max"
type="range"
className="settings--input__slider settings--input__max"
min="0"
max="75"
defaultValue="75"
onChange={this.handleChangeMaxValue}>
</input>
<label htmlFor="settings--input__max" className="settings--input__label">{maxValue}</label>
</div>
<div className="settings--input">
<span className="settings--input__title">Count</span>
<input
name="settings--input_count"
type="range"
className="settings--input__slider settings--input__count"
min="3"
max="120"
defaultValue="120"
onChange={this.handleChangeLength}>
</input>
<label htmlFor="settings--input__count" className="settings--input__label">{length}</label>
</div>
<div className="settings--input">
<span className="settings--input__title">Speed</span>
<input
name="settings--input_speed"
type="range"
className="settings--input__slider settings--input__speed"
min="1"
max="100"
defaultValue="50"
onChange={this.handleChangeSpeed}>
</input>
<label id="settings--speed" htmlFor="settings--input__speed" className="settings--input__label">{speed}</label>
</div>
</div>
</div>
<div className="controls">
<button className="controls__btn" onClick={this.handleStartSort}>Start</button>
<button className="controls__btn" onClick={this.handleReset}>Reset</button>
</div>
</div>
<div className="visualizer__container">
<Visualizer id="visualizer" minValue={minValue} maxValue={maxValue} length={length} keepBars="false" />
</div>
</div>
);
}
}
export function sortingFinished() {
isSorting = false;
}
|
import React from 'react'
import Link from 'gatsby-link'
import profilePic from './profile-pic.jpg'
import { rhythm } from '../utils/typography'
class Bio extends React.Component {
render() {
return (
<p
style={{
marginBottom: rhythm(2.5),
}}
>
<img
src={profilePic}
alt={`Krzysztof Żuraw`}
style={{
float: 'left',
marginRight: rhythm(1 / 4),
marginBottom: 0,
width: rhythm(2),
height: rhythm(2),
borderRadius: rhythm(50),
}}
/>
Delivered by{' '}
<strong>
<Link style={{ boxShadow: 'none' }} to={'/about'}>
Krzysztof Żuraw
</Link>
</strong>. Opinions are my own. You can follow updates via{' '}
<Link style={{ boxShadow: 'none' }} to={'/rss.xml'} target="_blank">
RSS feed
</Link>.
</p>
)
}
}
export default Bio
|
'use strict';
// From https://github.com/johni0702/voice-activity-detection
var analyserFrequency = require('analyser-frequency-average');
module.exports = function(audioContext, stream, opts) {
opts = opts || {};
var defaults = {
fftSize: 1024,
bufferLen: 1024,
smoothingTimeConstant: 0.2,
minCaptureFreq: 85, // in Hz
maxCaptureFreq: 255, // in Hz
noiseCaptureDuration: 1000, // in ms
minNoiseLevel: 0.3, // from 0 to 1
maxNoiseLevel: 0.7, // from 0 to 1
avgNoiseMultiplier: 1.2,
onVoiceStart: function() {
},
onVoiceStop: function() {
},
onUpdate: function(val) {
}
};
var options = {};
for (var key in defaults) {
options[key] = opts.hasOwnProperty(key) ? opts[key] : defaults[key];
}
var baseLevel = 0;
var voiceScale = 1;
var activityCounter = 0;
var activityCounterMin = 0;
var activityCounterMax = 60;
var activityCounterThresh = 5;
var envFreqRange = [];
var isNoiseCapturing = true;
var prevVadState = undefined;
var vadState = false;
var captureTimeout = null;
var source = audioContext.createMediaStreamSource(stream);
var analyser = audioContext.createAnalyser();
analyser.smoothingTimeConstant = options.smoothingTimeConstant;
analyser.fftSize = options.fftSize;
var scriptProcessorNode = audioContext.createScriptProcessor(options.bufferLen, 1, 1);
connect();
scriptProcessorNode.onaudioprocess = monitor;
if (isNoiseCapturing) {
//console.log('VAD: start noise capturing');
captureTimeout = setTimeout(init, options.noiseCaptureDuration);
}
function init() {
//console.log('VAD: stop noise capturing');
isNoiseCapturing = false;
envFreqRange = envFreqRange.filter(function(val) {
return val;
}).sort();
var averageEnvFreq = envFreqRange.length ? envFreqRange.reduce(function (p, c) { return Math.min(p, c) }, 1) : (options.minNoiseLevel || 0.1);
baseLevel = averageEnvFreq * options.avgNoiseMultiplier;
if (options.minNoiseLevel && baseLevel < options.minNoiseLevel) baseLevel = options.minNoiseLevel;
if (options.maxNoiseLevel && baseLevel > options.maxNoiseLevel) baseLevel = options.maxNoiseLevel;
voiceScale = 1 - baseLevel;
//console.log('VAD: base level:', baseLevel);
}
function connect() {
source.connect(analyser);
analyser.connect(scriptProcessorNode);
scriptProcessorNode.connect(audioContext.destination);
}
function disconnect() {
scriptProcessorNode.disconnect();
}
function destroy() {
captureTimeout && clearTimeout(captureTimeout);
disconnect();
analyser.disconnect();
source.disconnect();
source.mediaStream.getTracks().forEach(track => track.stop());
}
function monitor() {
var frequencies = new Uint8Array(analyser.frequencyBinCount);
analyser.getByteFrequencyData(frequencies);
var average = analyserFrequency(analyser, frequencies, options.minCaptureFreq, options.maxCaptureFreq);
if (isNoiseCapturing) {
envFreqRange.push(average);
return;
}
if (average >= baseLevel && activityCounter < activityCounterMax) {
activityCounter++;
} else if (average < baseLevel && activityCounter > activityCounterMin) {
activityCounter--;
}
vadState = activityCounter > activityCounterThresh;
if (prevVadState !== vadState) {
vadState ? onVoiceStart() : onVoiceStop();
prevVadState = vadState;
}
options.onUpdate(Math.max(0, average - baseLevel) / voiceScale);
}
function onVoiceStart() {
options.onVoiceStart();
}
function onVoiceStop() {
options.onVoiceStop();
}
return {connect: connect, disconnect: disconnect, destroy: destroy};
};
|
import { renderApp, createHistory } from 'testUtils'
import { fireEvent, screen } from '@testing-library/react'
import { featureSetup } from 'featureUtils'
featureSetup()
describe('editing a list property', () => {
const history = createHistory(['/editor/resourceTemplate:testing:uber1'])
it('allows selecting and removing a non-repeatable literal', async () => {
const { container } = renderApp(null, history)
await screen.findByText('Uber template1', { selector: 'h3' })
const select = container.querySelector('select[aria-label="Select Uber template1, property10"]')
expect(select).toBeInTheDocument()
fireEvent.change(select, { target: { value: 'http://id.loc.gov/vocabulary/mrectype/analog' } })
// There is analog text. Perhaps check css.
await screen.findByText('analog', { selector: '.rbt-token' })
// There is remove button
expect(await screen.findByTestId('Remove analog')).toHaveTextContent('×')
// There is no edit button.
expect(screen.queryByTestId('Edit analog')).not.toBeInTheDocument()
// Selector is disabled
expect(select).toBeDisabled()
const removeBtn = screen.getByTestId('Remove analog')
fireEvent.click(removeBtn)
expect(screen.queryByText('analog', { selector: '.rbt-token' })).not.toBeInTheDocument()
}, 10000)
it('allows entering a repeatable list', async () => {
const { container } = renderApp(null, history)
await screen.findByText('Uber template1', { selector: 'h3' })
const select = container.querySelector('select[aria-label="Select Uber template1, property11"]')
expect(select).toBeInTheDocument()
fireEvent.change(select, { target: { value: 'http://id.loc.gov/vocabulary/mrectype/analog' } })
await screen.findByText('analog', { selector: '.rbt-token' })
expect(select).not.toBeDisabled()
fireEvent.change(select, { target: { value: 'http://id.loc.gov/vocabulary/mrectype/digital' } })
await screen.findByText('digital', { selector: '.rbt-token' })
}, 10000)
it('displays items from multiple authorities', async () => {
const { container } = renderApp(null, history)
await screen.findByText('Uber template1', { selector: 'h3' })
expect(container.querySelector('div[data-label="Uber template1, property12"] option[value="http://id.loc.gov/vocabulary/mrectype/analog"]')).toBeInTheDocument()
expect(container.querySelector('div[data-label="Uber template1, property12"] option[value="http://id.loc.gov/vocabulary/mrecmedium/mag"]')).toBeInTheDocument()
})
})
|
var searchData=
[
['pbrsemantics',['PBRSemantics',['../classpvr_1_1assets_1_1_model_1_1_material_1_1_p_b_r_semantics.html',1,'pvr::assets::Model::Material']]],
['podmetallicroughnesssemantics',['PODMetallicRoughnessSemantics',['../classpvr_1_1assets_1_1_model_1_1_material_1_1_p_o_d_metallic_roughness_semantics.html',1,'pvr::assets::Model::Material']]]
];
|
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const react_1 = __importDefault(require("react"));
const ReactComponent = props => (react_1.default.createElement("svg", Object.assign({ viewBox: "0 0 24 24", width: "1em", height: "1em" }, props),
react_1.default.createElement("path", { fill: "none", d: "M0 0h24v24H0V0z" }),
react_1.default.createElement("g", null,
react_1.default.createElement("path", { d: "M20 2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h14l4 4V4c0-1.1-.9-2-2-2zm0 15.17L18.83 16H4V4h16v13.17z" }),
react_1.default.createElement("path", { d: "M13 5h-2v4H7v2h4v4h2v-4h4V9h-4z" }),
react_1.default.createElement("path", { opacity: 0.3, d: "M4 4v12h14.83L20 17.17V4H4zm13 7h-4v4h-2v-4H7V9h4V5h2v4h4v2z" }))));
exports.default = ReactComponent;
|
'use strict'
/* -----------------------------------------------------------------------------
* dependencies
* -------------------------------------------------------------------------- */
// 3rd party
const { findLast } = require('lodash')
// lib
const ComponentResolver = require('../../support/component-resolver')
const Component = require('../component')
const Field = require('../field')
/* -----------------------------------------------------------------------------
* WebComponentResolver
* -------------------------------------------------------------------------- */
module.exports = class NativeComponentResolver extends ComponentResolver {
static get defaultComponents () {
return [{
Component: Component,
check: __ => true
}, {
Component: Field,
check: el => el.selector.endsWith('Input')
}]
}
resolve (el) {
return findLast(this.components, c => c.check(el))['Component']
}
}
|
'use strict';
System.register(['./components/assets', './components/credentials', './components/config'], function (_export, _context) {
"use strict";
var AssetPageCtrl, CredentialPageCtrl, ExampleAppConfigCtrl;
return {
setters: [function (_componentsAssets) {
AssetPageCtrl = _componentsAssets.AssetPageCtrl;
}, function (_componentsCredentials) {
CredentialPageCtrl = _componentsCredentials.CredentialPageCtrl;
}, function (_componentsConfig) {
ExampleAppConfigCtrl = _componentsConfig.ExampleAppConfigCtrl;
}],
execute: function () {
_export('ConfigCtrl', ExampleAppConfigCtrl);
_export('AssetPageCtrl', AssetPageCtrl);
_export('CredentialPageCtrl', CredentialPageCtrl);
}
};
});
//# sourceMappingURL=module.js.map
|
/**
* date: 2018-05-24 16:11
* auth: XuQiang
**/
export default (date) => {
if (date && typeof date !== 'number') {
throw new Error('Syntax error, parameter types can only be time stamp or null.');
}
date = date || Date.now();
const week = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
const month = ['Jan.', 'Feb.', 'Mar.', 'Apr.', 'May.', 'Jun.', 'Jul.', 'Aug.', 'Sep.', 'Oct.', 'Nov.', 'Dec.'];
//get first day of current month.
const getFirstDay = () => {
const month = new Date(date);
month.setDate(1);
const d = month.getDay();
return month.getTime() - d * 24 * 3600 * 1000;
};
const format = (str) => {
str = str || 'YYYY-MM-DD';
const d = new Date(date);
const result = str.split('-').map(f => {
switch (f) {
case 'MM':
return (Array(2).join('0') + (d.getMonth() + 1)).slice(-2);
case 'DD':
return (Array(2).join('0') + d.getDate()).slice(-2);
case 'YYYY':
return (Array(4).join('0') + d.getFullYear()).slice(-4);
case 'HH':
return (Array(2).join('0') + d.getHours()).slice(-2);
case 'mm':
return (Array(2).join('0') + d.getMinutes()).slice(-2);
case 'ss':
return (Array(2).join('0') + d.getSeconds()).slice(-2);
default:
return '';
}
});
return result.join('-');
};
const addDay = (day) => {
if (day && typeof day !== 'number') {
throw new Error('Syntax error, day\'s types can only be number.');
}
day = day || 0;
const d = new Date(date);
d.setDate(d.getDate() + day);
return Number(d.valueOf());
};
const getMonth = (time) => {
if (time && typeof time !== 'number') {
throw new Error('Syntax error, time\'s types can only be number.');
}
time = time || date;
const d = new Date(time);
return month[d.getMonth()];
};
const getCurrentMonth = (year, month) => {
if (month && typeof month !== 'number') {
throw new Error('Syntax error, month\'s types can only be number.');
}
if (year && typeof year !== 'number') {
throw new Error('Syntax error, year\'s types can only be number.');
}
year = year || new Date(date).getFullYear();
month = month || 0;
const current = new Date();
current.setFullYear(year);
current.setMonth(month);
return current.valueOf();
};
return {date, week, month, getFirstDay, format, addDay, getMonth, getCurrentMonth};
};
|
!function(e){var n={pattern:/(\d)(?:%|[a-z]+)/,lookbehind:!0},r={pattern:/(^|[^\w.-])-?\d*\.?\d+/,lookbehind:!0},i={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},url:{pattern:/url\((["']?).*?\1\)/i,greedy:!0},string:{pattern:/("|')(?:(?!\1)[^\\\r\n]|\\(?:\r\n|[\s\S]))*\1/,greedy:!0},interpolation:null,func:null,important:/\B!(?:important|optional)\b/i,keyword:{pattern:/(^|\s+)(?:(?:if|else|for|return|unless)(?=\s+|$)|@[\w-]+)/,lookbehind:!0},hexcode:/#[\da-f]{3,6}/i,color:[/\b(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)\b/i,{pattern:/\b(?:rgb|hsl)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:rgb|hsl)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:n,number:r,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:n,boolean:/\b(?:true|false)\b/,operator:[/~|[+!\/%<>?=]=?|[-:]=|\*[*=]?|\.{2,3}|&&|\|\||\B-\B|\b(?:and|in|is(?: a| defined| not|nt)?|not|or)\b/],number:r,punctuation:/[{}()\[\];:,]/};i.interpolation={pattern:/\{[^\r\n}:]+\}/,alias:"variable",inside:{delimiter:{pattern:/^{|}$/,alias:"punctuation"},rest:i}},i.func={pattern:/[\w-]+\([^)]*\).*/,inside:{function:/^[^(]+/,rest:i}},e.languages.stylus={"atrule-declaration":{pattern:/(^\s*)@.+/m,lookbehind:!0,inside:{atrule:/^@[\w-]+/,rest:i}},"variable-declaration":{pattern:/(^[ \t]*)[\w$-]+\s*.?=[ \t]*(?:(?:\{[^}]*\}|.+)|$)/m,lookbehind:!0,inside:{variable:/^\S+/,rest:i}},statement:{pattern:/(^[ \t]*)(?:if|else|for|return|unless)[ \t]+.+/m,lookbehind:!0,inside:{keyword:/^\S+/,rest:i}},"property-declaration":{pattern:/((?:^|\{)([ \t]*))(?:[\w-]|\{[^}\r\n]+\})+(?:\s*:\s*|[ \t]+)[^{\r\n]*(?:;|[^{\r\n,](?=$)(?!(?:\r?\n|\r)(?:\{|\2[ \t]+)))/m,lookbehind:!0,inside:{property:{pattern:/^[^\s:]+/,inside:{interpolation:i.interpolation}},rest:i}},selector:{pattern:/(^[ \t]*)(?:(?=\S)(?:[^{}\r\n:()]|::?[\w-]+(?:\([^)\r\n]*\))?|\{[^}\r\n]+\})+)(?:(?:\r?\n|\r)(?:\1(?:(?=\S)(?:[^{}\r\n:()]|::?[\w-]+(?:\([^)\r\n]*\))?|\{[^}\r\n]+\})+)))*(?:,$|\{|(?=(?:\r?\n|\r)(?:\{|\1[ \t]+)))/m,lookbehind:!0,inside:{interpolation:i.interpolation,comment:i.comment,punctuation:/[{},]/}},func:i.func,string:i.string,comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0,greedy:!0},interpolation:i.interpolation,punctuation:/[{}()\[\];:.]/}}(Prism);
|
/*!
* tablesort v5.1.0 (2018-09-14)
* http://tristen.ca/tablesort/demo/
* Copyright (c) 2018 ; Licensed MIT
*/
!function(){var a=function(a){return a=a.replace(/\-/g,"/"),a=a.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2,4})/,"$3-$2-$1"),new Date(a).getTime()||-1};Tablesort.extend("date",function(b){return(-1!==b.search(/(Mon|Tue|Wed|Thu|Fri|Sat|Sun)\.?\,?\s*/i)||-1!==b.search(/\d{1,2}[\/\-]\d{1,2}[\/\-]\d{2,4}/)||-1!==b.search(/(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)/i))&&!isNaN(a(b))},function(b,c){return b=b.toLowerCase(),c=c.toLowerCase(),a(c)-a(b)})}();
|
/* eslint @typescript-eslint/no-var-requires: 0 */
const config = require("./webpack.config.dev.js");
module.exports = {
...config,
resolve: {
extensions: config.resolve.extensions,
// Reset resolution back to defaults. Required for 'dist' mode. We want everything to be loaded from 'node_modules',
// like it would in the end-user's app, with the exception of the source files for this example project.
// modules: ...webpack defaults...
alias: {
"@upload.io/uploader-examples": config.resolve.alias["@upload.io/uploader-examples"]
}
}
};
|
module.exports = new Date(2010, 0, 9)
|
var path = require('path')
var utils = require('./utils')
var config = require('../config')
var vueLoaderConfig = require('./vue-loader.conf')
function resolve (dir) {
return path.join(__dirname, '..', dir)
}
module.exports = {
entry: {
app: './src/main.ts'
},
output: {
path: config.build.assetsRoot,
filename: '[name].js',
publicPath: process.env.NODE_ENV === 'production'
? config.build.assetsPublicPath
: config.dev.assetsPublicPath
},
resolve: {
extensions: ['.ts', '.tsx', '.js', '.vue', '.json'],
alias: {
'vue$': 'vue/dist/vue.esm.js',
'@': resolve('src'),
'@components': resolve('src/components')
}
},
module: {
rules: [
{
test: /\.(js|vue)$/,
loader: 'eslint-loader',
enforce: 'pre',
include: [resolve('src'), resolve('test')],
options: {
formatter: require('eslint-friendly-formatter')
}
},
{
test: /\.(ts)$/,
loader: 'tslint-loader',
enforce: 'pre',
include: [resolve('src'), resolve('test')]
},
{
test: /\.vue$/,
loader: 'vue-loader',
options: vueLoaderConfig
},
{
test: /\.js$/,
loader: 'babel-loader',
include: [resolve('src'), resolve('test')]
},
{
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('img/[name].[hash:7].[ext]')
}
},
{
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
}
},
{
test: /\.ts$/,
exclude: /node_modules/,
loader: 'ts-loader',
options: {
appendTsSuffixTo: [/\.vue$/]
}
}
],
loaders: [ {
test: /\.styl$/,
loader: ['style-loader', 'css-loader', 'stylus-loader']
}
]
}
}
|
import jQuery from 'jquery';
export default function checkInView() {
if (jQuery.fn.checkInView) {
return;
}
jQuery.fn.checkInView = function(partial = false) {
const elem = this;
if (!elem.length) {
return false;
}
const container = elem.parent();
const contHeight = container.height();
container.scrollTop();
const elemTop = elem.offset().top - container.offset().top;
const elemBottom = elemTop + elem.height();
const isTotal = elemTop >= 0 && elemBottom <= contHeight;
const isPart = (elemTop < 0 && elemBottom > 0 || elemTop > 0 && elemTop <= container.height()) && partial;
return isTotal || isPart;
};
}
|
const mix = require('laravel-mix');
mix.browserSync('127.0.0.1:8001');
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel application. By default, we are compiling the Sass
| file for the application as well as bundling up all the JS files.
|
*/
mix.js('resources/js/app.js', 'public/js')
.react()
.sass('resources/sass/app.scss', 'public/css')
mix.copyDirectory('node_modules/tinymce/icons', 'public/js/icons');
mix.copyDirectory('node_modules/tinymce/langs', 'public/js/langs');
mix.copyDirectory('node_modules/tinymce/plugins', 'public/js/plugins');
mix.copyDirectory('node_modules/tinymce/skins', 'public/js/skins');
mix.copyDirectory('node_modules/tinymce/themes', 'public/js/themes');
|
define(function (require, exports, module) {
//搜索
require('search/index');
//from page
var active = 0,
as = document.getElementById('indicator').getElementsByTagName('li');
for (var i = 0; i < as.length; i++) {
(function () {
var j = i;
as[i].onclick = function () {
t2.slide(j);
return false;
}
})();
}
var t1 = new TouchScroll({ id: 'wrapper', 'width': 5, 'opacity': 0.7, color: '#555', minLength: 20 });
var t2 = new TouchSlider({
id: 'thelist', speed: 600, timeout: 6000, before: function (index) {
as[active].className = '';
active = index;
as[active].className = 'active';
}
});
$(function() {
$("#subEdmEmail").click(function () {
var email = $("#edmEmail").val();
if (/^[a-zA-Z0-9_\.\-]+\@@([a-zA-Z0-9\_]+\.)+[a-zA-Z0-9]{2,4}$/.test(email)) {
$.post("/Home/AddEmailForEDM?email=" + $("#edmEmail").val(), function(data) {
alert("感谢您的订阅,我们会定期给您发送最新的优惠资讯。谢谢!");
});
}
else {
alert("请输入正确的邮箱");
}
});
});
//$m.node('.ChangeHref .lk-img').each(function () {
// var href = $m.node.attr(this, 'href');
// href = href.replace("www", 'm');
// $m.node.attr(this, 'href', href);
//})
});
|
/* @flow */
import * as React from 'react';
import { Localized } from '@fluent/react';
/**
* Marks term expressions from Fluent syntax.
*
* Documentation: https://projectfluent.org/fluent/guide/terms.html
*
* Example matches:
*
* {-brand}
* { -brand }
* { -brand-name }
*/
const fluentTerm = {
rule: /({ ?-[^}]* ?})/,
tag: (x: string) => {
return (
<Localized id='placeable-parser-fluentTerm' attrs={{ title: true }}>
<mark className='placeable' title='Fluent term'>
{x}
</mark>
</Localized>
);
},
};
export default fluentTerm;
|
import React from "react";
import { IndexLink, Link } from "react-router";
export default class Navigation extends React.Component{
constructor(){
super();
this.state = {
collapsed: true,
};
}
toggleCollapse(){
const collapsed =!this.state.collapsed;
this.setState({collapsed});
}
render(){
const { location } = this.props;
const { collapsed } = this.state;
const homeClass = location.pathname === '/' ? "active" : "";
const usersClass = location.pathname.match(/^\/users/) ? "active" : "";
const articlesClass = location.pathname.match(/^\/articles/) ? "active" : "";
const navClass = collapsed ? "collapse" : "";
return(
<div class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<a href="#/" class="navbar-brand">My React App</a>
<button class="navbar-toggle" type="button" onClick={this.toggleCollapse.bind(this)}>
<span class="sr-only">Toggle Navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class={"navbar-collapse " + navClass} id="navbar-main">
<ul class="nav navbar-nav">
<li class={homeClass}>
<IndexLink to="/" onClick={this.toggleCollapse.bind(this)}>Home</IndexLink>
</li>
<li class={usersClass}>
<Link to="users" onClick={this.toggleCollapse.bind(this)}>Users</Link>
</li>
<li class={articlesClass}>
<Link to="articles" onClick={this.toggleCollapse.bind(this)}>Articles</Link>
</li>
</ul>
</div>
</div>
</div>
);
}
}
|
import React from 'react';
import configureStore from 'redux-mock-store';
import thunk from 'redux-thunk';
import { Provider } from 'react-redux';
import promiseMiddleware from 'redux-promise-middleware';
import { Route, MemoryRouter } from 'react-router-dom';
import { act } from 'react-dom/test-utils';
import notificationsMiddleware from '@redhat-cloud-services/frontend-components-notifications/notificationsMiddleware';
import { mount, shallow } from 'enzyme';
import { shallowToJson } from 'enzyme-to-json';
import PlatformTemplates from '../../../smart-components/platform/platform-templates';
import { CATALOG_INVENTORY_API_BASE } from '../../../utilities/constants';
import { platformInitialState } from '../../../redux/reducers/platform-reducer';
import { FETCH_PLATFORM_ITEMS } from '../../../redux/action-types';
import { mockApi } from '../../../helpers/shared/__mocks__/user-login';
describe('<PlatformTemplates />', () => {
let initialProps;
const middlewares = [thunk, promiseMiddleware, notificationsMiddleware()];
let mockStore;
let initialState;
const ComponentWrapper = ({ store, initialEntries = ['/foo'], children }) => (
<Provider store={store}>
<MemoryRouter initialEntries={initialEntries}>
<Route path="/platform/platform-templates">{children}</Route>
</MemoryRouter>
</Provider>
);
beforeEach(() => {
initialProps = {};
mockStore = configureStore(middlewares);
initialState = {
breadcrumbsReducer: { fragments: [] },
platformReducer: {
...platformInitialState,
selectedPlatform: {
id: '1',
name: 'Foo'
},
platformItems: {
1: {
meta: {
limit: 50,
offset: 0,
count: 0
}
}
}
}
};
});
it('should render correctly', () => {
const store = mockStore(initialState);
const wrapper = shallow(
<ComponentWrapper
store={store}
initialEntries={['/platform/platform-templates?platform=1']}
>
<PlatformTemplates store={mockStore(initialState)} {...initialProps} />
);
</ComponentWrapper>
).find(PlatformTemplates);
expect(shallowToJson(wrapper)).toMatchSnapshot();
});
it('should mount and fetch data', async () => {
mockApi
.onGet(
`${CATALOG_INVENTORY_API_BASE}/sources/1/service_offerings?filter[archived_at][nil]&limit=50&offset=0`
)
.replyOnce(200, {
data: [
{
id: '1',
name: 'Offering 1'
}
]
});
const expectedActions = [
{
type: `${FETCH_PLATFORM_ITEMS}_PENDING`,
meta: { count: 0, filter: '', limit: 50, offset: 0, platformId: '1' }
},
{
meta: { count: 0, filter: '', limit: 50, offset: 0, platformId: '1' },
type: `${FETCH_PLATFORM_ITEMS}_FULFILLED`,
payload: { data: [{ id: '1', name: 'Offering 1' }] }
}
];
const store = mockStore(initialState);
await act(async () => {
mount(
<ComponentWrapper
store={store}
initialEntries={['/platform/platform-templates?platform=1']}
>
<PlatformTemplates
{...initialProps}
store={mockStore(initialState)}
/>
</ComponentWrapper>
);
});
expect(store.getActions()).toEqual(expectedActions);
});
});
|
(function (jQuery) {
// Variable
var $ = jQuery;
$.fn.ripple = function () {
$(this).click(function (e) {
var rippler = $(this),
ink = rippler.find(".ink");
if (rippler.find(".ink").length === 0) {
rippler.append("<span class='ink'></span>");
}
ink.removeClass("animate");
if (!ink.height() && !ink.width()) {
var d = Math.max(rippler.outerWidth(), rippler.outerHeight());
ink.css({
height: d,
width: d
});
}
var x = e.pageX - rippler.offset().left - ink.width()/2;
var y = e.pageY - rippler.offset().top - ink.height()/2;
ink.css({
top: y+'px',
left:x+'px'
}).addClass("animate");
});
};
$.fn.carouselAnimate = function()
{
function doAnimations(elems)
{
var animEndEv = 'webkitAnimationEnd animationend';
elems.each(function () {
var $this = $(this),
$animationType = $this.data('animation');
$this.addClass($animationType).one(animEndEv, function () {
$this.removeClass($animationType);
});
});
}
var $myCarousel = this;
var $firstAnimatingElems = $myCarousel.find('.item:first')
.find('[data-animation ^= "animated"]');
doAnimations($firstAnimatingElems);
$myCarousel.carousel('pause');
$myCarousel.on('slide.bs.carousel', function (e) {
var $animatingElems = $(e.relatedTarget)
.find("[data-animation ^= 'animated']");
doAnimations($animatingElems);
});
};
this.hide = function()
{
$(".tree").hide();
$(".sub-tree").hide();
};
this.treeMenu = function()
{
$('.tree-toggle').click(function(e){
e.preventDefault();
var $this = $(this).parent().children('ul.tree');
$(".tree").not($this).slideUp(600);
$this.toggle(700);
$(".tree").not($this).parent("li").find(".tree-toggle .right-arrow").removeClass("fa-angle-down").addClass("fa-angle-right");
$this.parent("li").find(".tree-toggle .right-arrow").toggleClass("fa-angle-right fa-angle-down");
});
$('.sub-tree-toggle').click(function(e) {
e.preventDefault();
var $this = $(this).parent().children('ul.sub-tree');
$(".sub-tree").not($this).slideUp(600);
$this.toggle(700);
$(".sub-tree").not($this).parent("li").find(".sub-tree-toggle .right-arrow").removeClass("fa-angle-down").addClass("fa-angle-right");
$this.parent("li").find(".sub-tree-toggle .right-arrow").toggleClass("fa-angle-right fa-angle-down");
});
};
this.leftMenu = function()
{
$('.opener-left-menu').on('click', function(){
$(".line-chart").width("100%");
$(".mejs-video").height("auto").width("100%");
if($('#right-menu').is(":visible"))
{
$('#right-menu').animate({ 'width': '0px' }, 'slow', function(){
$('#right-menu').hide();
});
}
if( $('#left-menu .sub-left-menu').is(':visible') ) {
$('#content').animate({ 'padding-left': '0px'}, 'slow');
$('#left-menu .sub-left-menu').animate({ 'width': '0px' }, 'slow', function(){
$('.overlay').show();
$('.opener-left-menu').removeClass('is-open');
$('.opener-left-menu').addClass('is-closed');
$('#left-menu .sub-left-menu').hide();
});
}
else {
$('#left-menu .sub-left-menu').show();
$('#left-menu .sub-left-menu').animate({ 'width': '230px' }, 'slow');
$('#content').animate({ 'padding-left': '230px','padding-right':'0px'}, 'slow');
$('.overlay').hide();
$('.opener-left-menu').removeClass('is-closed');
$('.opener-left-menu').addClass('is-open');
}
});
};
this.userList = function(){
$(".user-list ul").niceScroll({
touchbehavior:true,
cursorcolor:"#FF00FF",
cursoropacitymax:0.6,
cursorwidth:24,
usetransition:true,
hwacceleration:true,
autohidemode:"hidden"
});
};
this.rightMenu = function(){
$('.opener-right-menu').on('click', function(){
userList();
$(".user").niceScroll();
$(".user ul li").on('click',function(){
$(".user-list ul").getNiceScroll().remove();
$(".user").hide();
$(".chatbox").show(1000);
userList();
});
$(".close-chat").on("click",function(){
$(".user").show();
$(".chatbox").hide(1000);
});
$(".line-chart").width("100%");
if($('#left-menu .sub-left-menu').is(':visible')) {
$('#left-menu .sub-left-menu').animate({ 'width': '0px' }, 'slow', function(){
$('#left-menu .sub-left-menu').hide();
$('.overlay').show();
$('.opener-left-menu').removeClass('is-open');
$('.opener-left-menu').addClass('is-closed');
});
$('#content').animate({ 'padding-left': '0px'}, 'slow');
}
if($('#right-menu').is(':visible') ) {
$('#right-menu').animate({ 'width': '0px' }, 'slow', function(){
$('#right-menu').hide();
});
$('#content').animate({ 'padding-right': '0px'}, 'slow');
}
else {
$('#right-menu').show();
$('#right-menu').animate({ 'width': '230px' }, 'slow');
$('#content').animate({ 'padding-right': '230px'}, 'slow');
}
});
};
$(".box-v6-content-bg").each(function(){
$(this).attr("style","width:" + $(this).attr("data-progress") + ";");
});
$('.carousel-thumb').on('slid.bs.carousel', function () {
if($(this).find($(".item")).is(".active"))
{
var Current = $(this).find($(".item.active")).attr("data-slide");
$(".carousel-thumb-img li img").removeClass("animated rubberBand");
$(".carousel-thumb-img li").removeClass("active");
$($(".carousel-thumb-img").children()[Current]).addClass("active");
$($(".carousel-thumb-img li").children()[Current]).addClass("animated rubberBand");
}
});
$(".carousel-thumb-img li").on("click",function(){
$(".carousel-thumb-img li img").removeClass("animated rubberBand");
$(".carousel-thumb-img li").removeClass("active");
$(this).addClass("active");
});
$("#mimin-mobile-menu-opener").on("click",function(e){
$("#mimin-mobile").toggleClass("reverse");
var rippler = $("#mimin-mobile");
if(!rippler.hasClass("reverse"))
{
if(rippler.find(".ink").length == 0) {
rippler.append("<div class='ink'></div>");
}
var ink = rippler.find(".ink");
ink.removeClass("animate");
if(!ink.height() && !ink.width())
{
var d = Math.max(rippler.outerWidth(), rippler.outerHeight());
ink.css({height: d, width: d});
}
var x = e.pageX - rippler.offset().left - ink.width()/2;
var y = e.pageY - rippler.offset().top - ink.height()/2;
ink.css({
top: y+'px',
left:x+'px',
}).addClass("animate");
rippler.css({'z-index':9999});
rippler.animate({
backgroundColor: "#278DDE",
width: '100%'
}, 750 );
$("#mimin-mobile .ink").on("animationend webkitAnimationEnd oAnimationEnd MSAnimationEnd",
function(e){
$(".sub-mimin-mobile-menu-list").show();
$("#mimin-mobile-menu-opener span").removeClass("fa-bars").addClass("fa-close").css({"font-size":"2em"});
});
}else{
if(rippler.find(".ink").length == 0) {
rippler.append("<div class='ink'></div>");
}
var ink = rippler.find(".ink");
ink.removeClass("animate");
if(!ink.height() && !ink.width())
{
var d = Math.max(rippler.outerWidth(), rippler.outerHeight());
ink.css({height: d, width: d});
}
var x = e.pageX - rippler.offset().left - ink.width()/2;
var y = e.pageY - rippler.offset().top - ink.height()/2;
ink.css({
top: y+'px',
left:x+'px',
}).addClass("animate");
rippler.animate({
backgroundColor: "transparent",
'z-index':'-1'
}, 750 );
$("#mimin-mobile .ink").on("animationend webkitAnimationEnd oAnimationEnd MSAnimationEnd",
function(e){
$("#mimin-mobile-menu-opener span").removeClass("fa-close").addClass("fa-bars").css({"font-size":"1em"});
$(".sub-mimin-mobile-menu-list").hide();
});
}
});
$(".form-text").on("click",function(){
$(this).before("<div class='ripple-form'></div>");
$(".ripple-form").on("animationend webkitAnimationEnd oAnimationEnd MSAnimationEnd",
function(e){
// do something here
$(this).remove();
});
});
$('.mail-wrapper').find('.mail-left').css('height', $('.mail-wrapper').innerHeight());
$("#left-menu ul li a").ripple();
$(".ripple div").ripple();
$("#carousel-example3").carouselAnimate();
$("#left-menu .sub-left-menu").niceScroll();
$(".sub-mimin-mobile-menu-list").niceScroll({
touchbehavior:true,
cursorcolor:"#FF00FF",
cursoropacitymax:0.6,
cursorwidth:24,
usetransition:true,
hwacceleration:true,
autohidemode:"hidden"
});
$(".fileupload-v1-btn").on("click",function(){
var wrapper = $(this).parent("span").parent("div");
var path = wrapper.find($(".fileupload-v1-path"));
$(".fileupload-v1-file").click();
$(".fileupload-v1-file").on("change",function(){
path.attr("placeholder",$(this).val());
console.log(wrapper);
console.log(path);
});
});
var datetime = null, datetime2 = null,
date = null;
var update = function () {
date = moment(new Date())
datetime.html(date.format('HH:mm'));
datetime2.html(date.format('dddd, Do MMMM YYYY'));
};
$(document).ready(function(){
datetime = $('.time h1');
datetime2 = $('.time p');
update();
setInterval(update, 1000);
});
$("body").tooltip({ selector: '[data-toggle=tooltip]' });
leftMenu();
rightMenu();
treeMenu();
hide();
})(jQuery);
|
export default class DomHandler {
static innerWidth(el) {
if (el) {
let width = el.offsetWidth;
let style = getComputedStyle(el);
width += parseFloat(style.paddingLeft) + parseFloat(style.paddingRight);
return width;
}
return 0;
}
static width(el) {
if (el) {
let width = el.offsetWidth;
let style = getComputedStyle(el);
width -= parseFloat(style.paddingLeft) + parseFloat(style.paddingRight);
return width;
}
return 0;
}
static getWindowScrollTop() {
let doc = document.documentElement;
return (window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0);
}
static getWindowScrollLeft() {
let doc = document.documentElement;
return (window.pageXOffset || doc.scrollLeft) - (doc.clientLeft || 0);
}
static getOuterWidth(el, margin) {
if (el) {
let width = el.offsetWidth;
if (margin) {
let style = getComputedStyle(el);
width += parseFloat(style.marginLeft) + parseFloat(style.marginRight);
}
return width;
}
return 0;
}
static getOuterHeight(el, margin) {
if (el) {
let height = el.offsetHeight;
if (margin) {
let style = getComputedStyle(el);
height += parseFloat(style.marginTop) + parseFloat(style.marginBottom);
}
return height;
}
return 0;
}
static getClientHeight(el, margin) {
if (el) {
let height = el.clientHeight;
if (margin) {
let style = getComputedStyle(el);
height += parseFloat(style.marginTop) + parseFloat(style.marginBottom);
}
return height;
}
return 0;
}
static getViewport() {
let win = window,
d = document,
e = d.documentElement,
g = d.getElementsByTagName('body')[0],
w = win.innerWidth || e.clientWidth || g.clientWidth,
h = win.innerHeight || e.clientHeight || g.clientHeight;
return {width: w, height: h};
}
static getOffset(el) {
if (el) {
let rect = el.getBoundingClientRect();
return {
top: rect.top + (window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0),
left: rect.left + (window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0),
};
}
return {
top: 'auto',
left: 'auto'
};
}
static index(element) {
if (element) {
let children = element.parentNode.childNodes;
let num = 0;
for (let i = 0; i < children.length; i++) {
if (children[i] === element) return num;
if (children[i].nodeType === 1) num++;
}
}
return -1;
}
static addMultipleClasses(element, className) {
if (element && className) {
if (element.classList) {
let styles = className.split(' ');
for (let i = 0; i < styles.length; i++) {
element.classList.add(styles[i]);
}
}
else {
let styles = className.split(' ');
for (let i = 0; i < styles.length; i++) {
element.className += ' ' + styles[i];
}
}
}
}
static addClass(element, className) {
if (element && className) {
if (element.classList)
element.classList.add(className);
else
element.className += ' ' + className;
}
}
static removeClass(element, className) {
if (element && className) {
if (element.classList)
element.classList.remove(className);
else
element.className = element.className.replace(new RegExp('(^|\\b)' + className.split(' ').join('|') + '(\\b|$)', 'gi'), ' ');
}
}
static hasClass(element, className) {
if (element) {
if (element.classList)
return element.classList.contains(className);
else
return new RegExp('(^| )' + className + '( |$)', 'gi').test(element.className);
}
}
static find(element, selector) {
return element ? Array.from(element.querySelectorAll(selector)) : [];
}
static findSingle(element, selector) {
if (element) {
return element.querySelector(selector);
}
return null;
}
static getHeight(el) {
if (el) {
let height = el.offsetHeight;
let style = getComputedStyle(el);
height -= parseFloat(style.paddingTop) + parseFloat(style.paddingBottom) + parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth);
return height;
}
return 0;
}
static getWidth(el) {
if (el) {
let width = el.offsetWidth;
let style = getComputedStyle(el);
width -= parseFloat(style.paddingLeft) + parseFloat(style.paddingRight) + parseFloat(style.borderLeftWidth) + parseFloat(style.borderRightWidth);
return width;
}
return 0;
}
static alignOverlay(overlay, target, appendTo) {
if (overlay && target) {
if (appendTo === 'self') {
this.relativePosition(overlay, target);
}
else {
overlay.style.minWidth = DomHandler.getOuterWidth(target) + 'px';
this.absolutePosition(overlay, target);
}
}
}
static absolutePosition(element, target) {
if (element) {
let elementDimensions = element.offsetParent ? { width: element.offsetWidth, height: element.offsetHeight } : this.getHiddenElementDimensions(element)
let elementOuterHeight = elementDimensions.height;
let elementOuterWidth = elementDimensions.width;
let targetOuterHeight = target.offsetHeight;
let targetOuterWidth = target.offsetWidth;
let targetOffset = target.getBoundingClientRect();
let windowScrollTop = this.getWindowScrollTop();
let windowScrollLeft = this.getWindowScrollLeft();
let viewport = this.getViewport();
let top, left;
if (targetOffset.top + targetOuterHeight + elementOuterHeight > viewport.height) {
top = targetOffset.top + windowScrollTop - elementOuterHeight;
if(top < 0) {
top = windowScrollTop;
}
element.style.transformOrigin = 'bottom';
}
else {
top = targetOuterHeight + targetOffset.top + windowScrollTop;
element.style.transformOrigin = 'top';
}
if (targetOffset.left + targetOuterWidth + elementOuterWidth > viewport.width)
left = Math.max(0, targetOffset.left + windowScrollLeft + targetOuterWidth - elementOuterWidth);
else
left = targetOffset.left + windowScrollLeft;
element.style.top = top + 'px';
element.style.left = left + 'px';
}
}
static relativePosition(element, target) {
if (element) {
let elementDimensions = element.offsetParent ? { width: element.offsetWidth, height: element.offsetHeight } : this.getHiddenElementDimensions(element);
const targetHeight = target.offsetHeight;
const targetOffset = target.getBoundingClientRect();
const viewport = this.getViewport();
let top, left;
if ((targetOffset.top + targetHeight + elementDimensions.height) > viewport.height) {
top = -1 * (elementDimensions.height);
if (targetOffset.top + top < 0) {
top = -1 * targetOffset.top;
}
element.style.transformOrigin = 'bottom';
}
else {
top = targetHeight;
element.style.transformOrigin = 'top';
}
if (elementDimensions.width > viewport.width) {
// element wider then viewport and cannot fit on screen (align at left side of viewport)
left = targetOffset.left * -1;
}
else if ((targetOffset.left + elementDimensions.width) > viewport.width) {
// element wider then viewport but can be fit on screen (align at right side of viewport)
left = (targetOffset.left + elementDimensions.width - viewport.width) * -1;
}
else {
// element fits on screen (align with target)
left = 0;
}
element.style.top = top + 'px';
element.style.left = left + 'px';
}
}
static flipfitCollision(element, target, my = 'left top', at = 'left bottom', callback) {
const targetOffset = target.getBoundingClientRect();
const viewport = this.getViewport();
const myArr = my.split(' ');
const atArr = at.split(' ');
const getPositionValue = (arr, isOffset) => (isOffset ? (+arr.substring(arr.search(/(\+|-)/g)) || 0) : (arr.substring(0, arr.search(/(\+|-)/g)) || arr));
const position = {
my: {
x: getPositionValue(myArr[0]),
y: getPositionValue(myArr[1] || myArr[0]),
offsetX: getPositionValue(myArr[0], true),
offsetY: getPositionValue((myArr[1] || myArr[0]), true)
},
at: {
x: getPositionValue(atArr[0]),
y: getPositionValue(atArr[1] || atArr[0]),
offsetX: getPositionValue(atArr[0], true),
offsetY: getPositionValue((atArr[1] || atArr[0]), true)
}
};
const myOffset = {
left: () => {
const totalOffset = position.my.offsetX + position.at.offsetX;
return totalOffset + targetOffset.left + (position.my.x === 'left' ? 0 : -1 * (position.my.x === 'center' ? this.getOuterWidth(element) / 2 : this.getOuterWidth(element)));
},
top: () => {
const totalOffset = position.my.offsetY + position.at.offsetY;
return totalOffset + targetOffset.top + (position.my.y === 'top' ? 0 : -1 * (position.my.y === 'center' ? this.getOuterHeight(element) / 2 : this.getOuterHeight(element)));
}
};
const alignWithAt = {
count: {
x: 0,
y: 0
},
left: function() {
const left = myOffset.left();
const scrollLeft = DomHandler.getWindowScrollLeft();
element.style.left = (left + scrollLeft) + 'px';
if (this.count.x === 2) {
element.style.left = scrollLeft + 'px';
this.count.x = 0;
}
else if (left < 0) {
this.count.x++;
position.my.x = 'left';
position.at.x = 'right';
position.my.offsetX *= -1;
position.at.offsetX *= -1;
this.right();
}
},
right: function() {
const left = myOffset.left() + DomHandler.getOuterWidth(target);
const scrollLeft = DomHandler.getWindowScrollLeft();
element.style.left = (left + scrollLeft) + 'px';
if (this.count.x === 2) {
element.style.left = (viewport.width - DomHandler.getOuterWidth(element) + scrollLeft) + 'px';
this.count.x = 0;
}
else if (left + DomHandler.getOuterWidth(element) > viewport.width) {
this.count.x++;
position.my.x = 'right';
position.at.x = 'left';
position.my.offsetX *= -1;
position.at.offsetX *= -1;
this.left();
}
},
top: function() {
const top = myOffset.top();
const scrollTop = DomHandler.getWindowScrollTop();
element.style.top = (top + scrollTop) + 'px';
if (this.count.y === 2) {
element.style.left = scrollTop + 'px';
this.count.y = 0;
}
else if (top < 0) {
this.count.y++;
position.my.y = 'top';
position.at.y = 'bottom';
position.my.offsetY *= -1;
position.at.offsetY *= -1;
this.bottom();
}
},
bottom: function() {
const top = myOffset.top() + DomHandler.getOuterHeight(target);
const scrollTop = DomHandler.getWindowScrollTop();
element.style.top = (top + scrollTop) + 'px';
if (this.count.y === 2) {
element.style.left = (viewport.height - DomHandler.getOuterHeight(element) + scrollTop) + 'px';
this.count.y = 0;
}
else if (top + DomHandler.getOuterHeight(target) > viewport.height) {
this.count.y++;
position.my.y = 'bottom';
position.at.y = 'top';
position.my.offsetY *= -1;
position.at.offsetY *= -1;
this.top();
}
},
center: function(axis) {
if (axis === 'y') {
const top = myOffset.top() + (DomHandler.getOuterHeight(target) / 2);
element.style.top = (top + DomHandler.getWindowScrollTop()) + 'px';
if (top < 0) {
this.bottom();
}
else if (top + DomHandler.getOuterHeight(target) > viewport.height) {
this.top();
}
}
else {
const left = myOffset.left() + (DomHandler.getOuterWidth(target) / 2);
element.style.left = (left + DomHandler.getWindowScrollLeft()) + 'px';
if (left < 0) {
this.left();
}
else if (left + DomHandler.getOuterWidth(element) > viewport.width) {
this.right();
}
}
}
};
alignWithAt[position.at.x]('x');
alignWithAt[position.at.y]('y');
if (this.isFunction(callback)) {
callback(position);
}
}
static findCollisionPosition(position) {
if (position) {
const isAxisY = position === 'top' || position === 'bottom';
const myXPosition = position === 'left' ? 'right' : 'left';
const myYPosition = position === 'top' ? 'bottom' : 'top';
if (isAxisY) {
return {
axis: 'y',
my: `center ${myYPosition}`,
at: `center ${position}`,
}
}
return {
axis: 'x',
my: `${myXPosition} center`,
at: `${position} center`
}
}
}
static getParents(element, parents = []) {
return element['parentNode'] === null ? parents : this.getParents(element.parentNode, parents.concat([element.parentNode]));
}
static getScrollableParents(element) {
let scrollableParents = [];
if (element) {
let parents = this.getParents(element);
const overflowRegex = /(auto|scroll)/;
const overflowCheck = (node) => {
let styleDeclaration = window['getComputedStyle'](node, null);
return overflowRegex.test(styleDeclaration.getPropertyValue('overflow')) || overflowRegex.test(styleDeclaration.getPropertyValue('overflowX')) || overflowRegex.test(styleDeclaration.getPropertyValue('overflowY'));
};
for (let parent of parents) {
let scrollSelectors = parent.nodeType === 1 && parent.dataset['scrollselectors'];
if (scrollSelectors) {
let selectors = scrollSelectors.split(',');
for (let selector of selectors) {
let el = this.findSingle(parent, selector);
if (el && overflowCheck(el)) {
scrollableParents.push(el);
}
}
}
if (parent.nodeType !== 9 && overflowCheck(parent)) {
scrollableParents.push(parent);
}
}
}
return scrollableParents;
}
static getHiddenElementOuterHeight(element) {
if (element) {
element.style.visibility = 'hidden';
element.style.display = 'block';
let elementHeight = element.offsetHeight;
element.style.display = '';
element.style.visibility = '';
return elementHeight;
}
return 0;
}
static getHiddenElementOuterWidth(element) {
if (element) {
element.style.visibility = 'hidden';
element.style.display = 'block';
let elementWidth = element.offsetWidth;
element.style.display = '';
element.style.visibility = '';
return elementWidth;
}
return 0;
}
static getHiddenElementDimensions(element) {
let dimensions = {};
if (element) {
element.style.visibility = 'hidden';
element.style.display = 'block';
dimensions.width = element.offsetWidth;
dimensions.height = element.offsetHeight;
element.style.display = '';
element.style.visibility = '';
}
return dimensions;
}
static fadeIn(element, duration) {
if (element) {
element.style.opacity = 0;
let last = +new Date();
let opacity = 0;
let tick = function () {
opacity = +element.style.opacity + (new Date().getTime() - last) / duration;
element.style.opacity = opacity;
last = +new Date();
if (+opacity < 1) {
(window.requestAnimationFrame && requestAnimationFrame(tick)) || setTimeout(tick, 16);
}
};
tick();
}
}
static fadeOut(element, ms) {
if (element) {
let opacity = 1,
interval = 50,
duration = ms,
gap = interval / duration;
let fading = setInterval(() => {
opacity -= gap;
if (opacity <= 0) {
opacity = 0;
clearInterval(fading);
}
element.style.opacity = opacity;
}, interval);
}
}
static getUserAgent() {
return navigator.userAgent;
}
static isIOS() {
return /iPad|iPhone|iPod/.test(navigator.userAgent) && !window['MSStream'];
}
static isAndroid() {
return /(android)/i.test(navigator.userAgent);
}
static isFunction(obj) {
return !!(obj && obj.constructor && obj.call && obj.apply);
}
static appendChild(element, target) {
if (this.isElement(target))
target.appendChild(element);
else if(target.el && target.el.nativeElement)
target.el.nativeElement.appendChild(element);
else
throw new Error('Cannot append ' + target + ' to ' + element);
}
static removeChild(element, target) {
if (this.isElement(target))
target.removeChild(element);
else if (target.el && target.el.nativeElement)
target.el.nativeElement.removeChild(element);
else
throw new Error('Cannot remove ' + element + ' from ' + target);
}
static isElement(obj) {
return (typeof HTMLElement === "object" ? obj instanceof HTMLElement :
obj && typeof obj === "object" && obj !== null && obj.nodeType === 1 && typeof obj.nodeName === "string"
);
}
static scrollInView(container, item) {
let borderTopValue = getComputedStyle(container).getPropertyValue('borderTopWidth');
let borderTop = borderTopValue ? parseFloat(borderTopValue) : 0;
let paddingTopValue = getComputedStyle(container).getPropertyValue('paddingTop');
let paddingTop = paddingTopValue ? parseFloat(paddingTopValue) : 0;
let containerRect = container.getBoundingClientRect();
let itemRect = item.getBoundingClientRect();
let offset = (itemRect.top + document.body.scrollTop) - (containerRect.top + document.body.scrollTop) - borderTop - paddingTop;
let scroll = container.scrollTop;
let elementHeight = container.clientHeight;
let itemHeight = this.getOuterHeight(item);
if (offset < 0) {
container.scrollTop = scroll + offset;
}
else if ((offset + itemHeight) > elementHeight) {
container.scrollTop = scroll + offset - elementHeight + itemHeight;
}
}
static clearSelection() {
if(window.getSelection) {
if(window.getSelection().empty) {
window.getSelection().empty();
} else if(window.getSelection().removeAllRanges && window.getSelection().rangeCount > 0 && window.getSelection().getRangeAt(0).getClientRects().length > 0) {
window.getSelection().removeAllRanges();
}
}
else if(document['selection'] && document['selection'].empty) {
try {
document['selection'].empty();
} catch(error) {
//ignore IE bug
}
}
}
static calculateScrollbarWidth(el) {
if (el) {
let style = getComputedStyle(el);
return (el.offsetWidth - el.clientWidth - parseFloat(style.borderLeftWidth) - parseFloat(style.borderRightWidth));
}
else {
if(this.calculatedScrollbarWidth != null)
return this.calculatedScrollbarWidth;
let scrollDiv = document.createElement("div");
scrollDiv.className = "p-scrollbar-measure";
document.body.appendChild(scrollDiv);
let scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;
document.body.removeChild(scrollDiv);
this.calculatedScrollbarWidth = scrollbarWidth;
return scrollbarWidth;
}
}
static getBrowser() {
if(!this.browser) {
let matched = this.resolveUserAgent();
this.browser = {};
if (matched.browser) {
this.browser[matched.browser] = true;
this.browser['version'] = matched.version;
}
if (this.browser['chrome']) {
this.browser['webkit'] = true;
} else if (this.browser['webkit']) {
this.browser['safari'] = true;
}
}
return this.browser;
}
static resolveUserAgent() {
let ua = navigator.userAgent.toLowerCase();
let match = /(chrome)[ ]([\w.]+)/.exec(ua) ||
/(webkit)[ ]([\w.]+)/.exec(ua) ||
/(opera)(?:.*version|)[ ]([\w.]+)/.exec(ua) ||
/(msie) ([\w.]+)/.exec(ua) ||
(ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua)) ||
[];
return {
browser: match[1] || "",
version: match[2] || "0"
};
}
static isVisible(element) {
return element && element.offsetParent != null;
}
static getFocusableElements(element) {
let focusableElements = DomHandler.find(element, `button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden]),
[href][clientHeight][clientWidth]:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden]),
input:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden]), select:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden]),
textarea:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden]), [tabIndex]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden]),
[contenteditable]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])`
);
let visibleFocusableElements = [];
for (let focusableElement of focusableElements) {
if (getComputedStyle(focusableElement).display !== "none" && getComputedStyle(focusableElement).visibility !== "hidden")
visibleFocusableElements.push(focusableElement);
}
return visibleFocusableElements;
}
static getFirstFocusableElement(element) {
const focusableElements = DomHandler.getFocusableElements(element);
return focusableElements.length > 0 ? focusableElements[0] : null;
}
static getLastFocusableElement(element) {
const focusableElements = DomHandler.getFocusableElements(element);
return focusableElements.length > 0 ? focusableElements[focusableElements.length - 1] : null;
}
}
|
import React, { useState, useEffect } from 'react';
import { Feather } from '@expo/vector-icons'
import { useNavigation } from '@react-navigation/native'
import { View, FlatList, Image, Text, TouchableOpacity } from 'react-native';
import api from '../../services/api'
import logoImg from '../../assets/logo.png'
import styles from './styles'
export default function Incidents() {
const [incidents, setIncidents] = useState([])
const [total, setTotal] = useState(0)
const [page, setPage] = useState(1)
const [loading, setLoading] = useState(false)
const navigation = useNavigation();
function navigationToDetail(incident) {
navigation.navigate('Detail', { incident })
}
async function loadIncidents() {
// para evitar de mais de uma requisição seja feita
if(loading) {
return;
}
if(total > 0 & incidents.length === total) {
return;
}
setLoading(true)
const res = await api.get('incidents', {
params: { page }
});
setIncidents([...incidents, ...res.data]);
setTotal(res.headers['x-total-count'])
setPage(page + 1)
setLoading(false)
}
useEffect(() => {
loadIncidents()
}, [])
return (
<View style={styles.container}>
<View style={styles.header}>
<Image source={logoImg} />
<Text style={styles.headerText}>
Total de <Text style={styles.headerTextBold}>{total} casos</Text>.
</Text>
</View>
<Text style={styles.title}>Bem-vindo!</Text>
<Text style={styles.description}>Escolha um dos casos abaixo e salve o dia.</Text>
<FlatList
style={styles.incidentsList}
data={incidents}
keyExtractor={incident => String(incident.id)}
showsVerticalScrollIndicator={false}
onEndReached={loadIncidents}
onEndReachedThreshold={0.2}
renderItem={({ item: incident }) => (
<View style={styles.incident}>
<Text style={styles.incidentProperty}>ONG:</Text>
<Text style={styles.incidentValue}>{incident.name}</Text>
<Text style={styles.incidentProperty}>CASOS:</Text>
<Text style={styles.incidentValue}>{incident.title}</Text>
<Text style={styles.incidentProperty}>VALOR:</Text>
<Text style={styles.incidentValue}>
{Intl.NumberFormat('pt-BR', { style: 'currency', currency: 'BRL' })
.format(incident.value)}
</Text>
<TouchableOpacity
style={styles.detailsButton}
onPress={() => navigationToDetail(incident)}
>
<Text style={styles.detailsButtonText}>Ver Mais detalhes</Text>
<Feather name="arrow-right" size={20} color="#E02041" />
</TouchableOpacity>
</View>
)}
/>
</View>
)
}
|
import React from 'react';
import { useSelector } from 'react-redux';
import { useLocation } from 'react-router-dom';
import cx from 'classnames';
import { t, BraytechText, BungieText } from '../../../utils/i18n';
import manifest from '../../../utils/manifest';
// import OberservedImage from '../../../components/ObservedImage';
// import Collectibles from '../../../components/Collectibles';
import Records from '../../../components/Records';
import Button from '../../../components/UI/Button';
import * as SVG from '../../../svg';
import './styles.css';
const eventsCalendar = [
{
hashes: [
1309646866, // The Farm - just in case
158022875,
3840133183,
770505917,
1199493030,
2429391832,
],
component: SolsticeOfHeroes,
},
{
hashes: [3753505781],
component: IronBanner,
},
];
function Events(props) {
const member = useSelector((state) => state.member);
const characterActivities = member.data.profile.characterActivities.data;
const activeEvents = eventsCalendar.filter((event) => characterActivities[member.characterId].availableActivities.filter((activity) => event.hashes.filter((hash) => activity.activityHash === hash).length).length);
return activeEvents.map((event, e) => {
const Component = event.component;
return <Component key={e} />;
});
}
export { Events, eventsCalendar };
function IronBanner() {
const member = useSelector((state) => state.member);
const characters = member.data.profile.characters.data;
const character = characters.find((character) => character.characterId === member.characterId);
const definitionActivity = manifest.DestinyActivityDefinition[3753505781];
const season10items = [
{
itemHash: 1882457108,
},
{
itemHash: 713182381,
},
{
itemHash: 63725907,
},
{
itemHash: 1425558127,
},
{
itemHash: 2310625418,
},
{
itemHash: 2845071512,
},
{
itemHash: 3308875113,
},
{
itemHash: 92135663,
},
{
itemHash: 3600816955,
},
{
itemHash: 1339294334,
},
{
itemHash: 2758933481,
},
{
itemHash: 167461728,
},
{
itemHash: 2614190248,
},
{
itemHash: 3115791898,
},
{
itemHash: 21320325,
},
];
return (
<div className='group iron-banner'>
<div className='icon'>
<SVG.Events.IronBanner />
</div>
<div className='module event'>
<div className='text'>
<div className='sub-header'>
<div>{t('Active event')}</div>
</div>
<h3>{definitionActivity.displayProperties?.name}</h3>
<div className='description'>
<p>{t('Event.IronBanner.Description')}</p>
<p>{t('Destiny1.Grimoire.IronBanner')}</p>
</div>
</div>
</div>
{/* <div className='module'>
<h4>{t('Collectibles')}</h4>
<ul className='list inventory-items'>
<Items items={season10items.filter(i => {
const definitionItem = manifest.DestinyInventoryItemDefinition[i.itemHash];
if (definitionItem.classType > -1 && definitionItem.classType < 3 && definitionItem.classType === character.classType) {
return true;
} else {
return false;
}
})} />
</ul>
</div> */}
<div className='module'>
<h4>{t('Records')}</h4>
<ul className='list record-items'>
<Records selfLinkFrom='/this-week' hashes={[1430747933]} ordered />
</ul>
</div>
</div>
);
}
const SOLSTICE_OF_HEROES_SINGE_MAP = {
2429391832: {
className: 'void',
svg: SVG.Common.Void,
},
1199493030: {
className: 'arc',
svg: SVG.Common.Arc,
},
770505917: {
className: 'solar',
svg: SVG.Common.Solar,
},
};
function SolsticeOfHeroes() {
const member = useSelector((state) => state.member);
const characterActivities = member.data.profile.characterActivities.data;
const activity = characterActivities[member.characterId].availableActivities.find((activity) => [770505917, 1199493030, 2429391832].includes(activity.activityHash));
const location = useLocation();
const SingeIcon = SOLSTICE_OF_HEROES_SINGE_MAP[activity.activityHash].svg;
return (
<div className='group solstice-of-heroes'>
{/* <div className='background'>
<OberservedImage src='/static/images/events/soh2020.jpg' />
</div> */}
<div className='icon'>
<SVG.Events.SolsticeOfHeroes />
</div>
<div className='module event'>
<div className='text'>
<div className='sub-header'>
<div>{t('Active event')}</div>
</div>
<h3>{t('Event.SolsticeOfHeroes.Name')}</h3>
<BraytechText className='description' value={t('Event.SolsticeOfHeroes.Description.Extended')} />
<Button
anchor
to={{
pathname: '/solstice-of-heroes',
state: {
from: location.pathname,
},
}}
cta
>
<div className='text'>{t('Event.SolsticeOfHeroes.CTA')}</div>
<i className='segoe-uniE0AB' />
</Button>
</div>
</div>
{/* <div className='module modifier'>
<div className='sub-header'>
<div>{t('Event.SolsticeOfHeroes.ActivityModifier')}</div>
</div>
<div className='icon'>
<div className='background'>
<svg viewBox='0 0 250.6 221.8'>
<path
d="M141,212.7c-7,12.1-24.4,12.1-31.4,0L56,120L2.5,27.2C-4.5,15.1,4.2,0,18.1,0h107.1h107.1
c13.9,0,22.7,15.1,15.7,27.2L194.5,120L141,212.7z"
/>
</svg>
</div>
<div className={cx('element', SOLSTICE_OF_HEROES_SINGE_MAP[activity.activityHash].className)}>
<SingeIcon />
</div>
</div>
<BungieText className='text' value={manifest.DestinyActivityDefinition[activity.activityHash].displayProperties.description} />
</div> */}
</div>
);
}
|
import React, { Fragment, useState, useEffect } from 'react';
import { useStyles } from './DeleteEquipmentStyles';
import { useSelector, useDispatch } from 'react-redux';
import { deleteEquipment, getEquipment } from '../../redux/actions/equipmentActions';
import Spinner from '../../components/Spinner/Spinner';
import HeroHeader from '../../components/HeroHeader/HeroHeader';
import FormHeader from '../../components/FormHeader/FormHeader';
import FormSelect from '../../components/FormSelect/FormSelect';
import FormButton from '../../components/FormButton/FormButton';
import Grid from '@material-ui/core/Grid';
import MenuItem from '@material-ui/core/MenuItem';
const DeleteEquipment = ({ history }) => {
const classes = useStyles();
const [equipmentToDelete, setEquipmentToDelete] = useState('');
const isLoading = useSelector(state => state.equipment.loading);
const equipment = useSelector(state => state.equipment.equipment);
const token = useSelector(state => state.admins.admin.token);
const dispatch = useDispatch();
useEffect(() => {
dispatch(getEquipment());
}, [dispatch]);
const handleSubmit = event => {
event.preventDefault();
dispatch(deleteEquipment(equipmentToDelete, token)).then(
() => dispatch(getEquipment()));
setEquipmentToDelete('');
history.push('/admin/delete-equipment');
};
return (
<div className={classes.mainDivStyle}>
{isLoading
?
<div className={classes.spinnerDiv}>
<Spinner />
</div>
:
<Fragment>
<HeroHeader headerText='Admin: Delete Equipment' />
<Grid container spacing={0} className={classes.darkGreyContainerStyle} justify='center' align='center' item xs={12} sm={12} md={12} lg={12} xl={12}>
<form onSubmit={handleSubmit} className={classes.formContainerStyle}>
<Grid container spacing={0} className={classes.whiteContainerStyle}>
<FormHeader headerText='Delete Equipment' />
<FormSelect
inputLabelText='Equipment to Delete'
selectValue={equipmentToDelete}
onChangeSelect={newEquipmentToDelete => setEquipmentToDelete(newEquipmentToDelete.target.value)}
menuItemFunction={equipment.map(specificEquipment => {
return (
<MenuItem
value={specificEquipment.id}
key={specificEquipment.id}
>
{specificEquipment.Name}
</MenuItem>
);
})}
/>
<FormButton
buttonText='Delete Equipment'
validationStatus={equipmentToDelete}
/>
</Grid>
</form>
</Grid>
</Fragment>}
</div>
);
};
export default DeleteEquipment;
|
/**
* The Fibonacci sequence is defined by the recurrence relation:
*
* Fn = Fn−1 + Fn−2, where F1 = 1 and F2 = 1.
* Hence the first 12 terms will be:
*
* F1 = 1
* F2 = 1
* F3 = 2
* F4 = 3
* F5 = 5
* F6 = 8
* F7 = 13
* F8 = 21
* F9 = 34
* F10 = 55
* F11 = 89
* F12 = 144
* The 12th term, F12, is the first term to contain three digits.
*
* What is the index of the first term in the Fibonacci sequence to contain 1000 digits?
*/
import bignum from 'bignum';
/**
* Use a linear and non-recursive fibonacci implementation
*
* @return {number}
*/
const firstSeqw1000digits = () => {
let i = 1;
let a = bignum(1);
let b = bignum(0);
while (a.toString().length < 1000) {
const tmp = a;
a = a.add(b);
b = tmp;
i++;
}
return i;
};
console.log(firstSeqw1000digits());
|
import React, { Component, Console } from 'react';
import { StyleSheet, Text, View, TextInput, ImageBackground, TouchableOpacity, ToastAndroid } from 'react-native';
//import IndexLogin from '../../../indexLogin';
import NetworkService from '../../../networks/NetworkService'
import AsyncStorage from 'react-native';
export default class App extends Component{
state={
email:"",
password:"",
username:"",
}
user={
correo:"",
fnacimiento:"",
foto:"",
nick:"",
nombre:"",
pass:"",
}
_storeData = async () => {
try {
await AsyncStorage.setItem('User', this.user);
console.log("Guardando this.user...")
} catch (error) {
console.log("Fallo al guardar..")
// Error saving data
}
};
// main = () => {this.props.navigation.navigate('Main')}
goToRecoverPassword = () => {this.props.navigation.navigate('RecoverPassword');}
loginDB = async () => { //console.log("DEVULVE:",NetworkService.loginUser(this.state));
await NetworkService.loginUser(this.state).then( res => {this.user = res});
//this.setState(this.user);
console.log("STATE:",this.state);
console.log("USER:",this.user);
//Si el login OK, ya tenemos el usuario
if(this.checkLoginOK){
console.log("antes storeData")
this._storeData
//this.goToMain()
} else {
console.log("error login")
ToastAndroid.show('Login failed', ToastAndroid.SHORT);
}
}
//Return if login has been ok
checkLoginOK(){
if(this.user == undefined){
return false;
}else{
return true;
}
}
goToMain(){
this.props.navigation.navigate('MainLogged', { screen: 'DashBoard' } );
}
register = () => {this.props.navigation.navigate('Register')}
render(){
return (
<View style={styles.container}>
<ImageBackground source={require('../../../Wallpapers/fondoPantallaPrincipal.jpg')} style={styles.backgroundImage}>
<View style={styles.inputView} >
<TextInput
style={styles.inputText}
placeholder="Email..."
placeholderTextColor="#FFFFFF"
onChangeText={text => this.setState({email:text})}/>
</View>
<View style={styles.inputView} >
<TextInput
secureTextEntr
style={styles.inputText}
placeholder="Contraseña..."
placeholderTextColor="#FFFFFF"
onChangeText={text => this.setState({password:text})}/>
</View>
<TouchableOpacity style={styles.loginBtn} onPress={this.loginDB}>
<Text style={styles.loginText}>Iniciar Sesion</Text>
</TouchableOpacity>
<TouchableOpacity onPress={this.register}>
<Text style={styles.loginText}>Registrarse</Text>
</TouchableOpacity>
<TouchableOpacity onPress={this.goToRecoverPassword} style={{
width: '100%',
height: 50,
justifyContent: 'center',
alignItems: 'center',
position: 'absolute', //Here is the trick
bottom: 0, //Here is the trick
}}>
<Text style={styles.loginText}>Forgot password? Get it back here</Text>
</TouchableOpacity>
</ImageBackground>
</View>
);
}
}
const styles = StyleSheet.create({
body : {
alignItems : 'center',
justifyContent : 'center',
fontSize: 17,
color: '#ffffff'
},
container: {
flex:1,
backgroundColor: '#fff',
justifyContent: 'center',
},
title:{
color:'white',//'#64EE85',
fontSize: 24,
fontWeight: '600',
paddingHorizontal: 20
},
backgroundImage:{
justifyContent: 'center',
alignItems: 'center',
flex: 1,
},
inputView:{
width:"80%",
backgroundColor:"#465881",
borderRadius:25,
height: 50,
marginBottom:20,
justifyContent:"center",
padding:20
},
inputText:{
height:50,
color:"white"
},
loginBtn:{
width:"80%",
backgroundColor:"#64EE85",
borderRadius:25,
height:50,
alignItems:"center",
justifyContent:"center",
marginTop:40,
marginBottom:10
},
loginText:{
color:"white"
}
});
|
/* --- START --- */
$(".insert-produto").hide();
$("#cancel_add-produto").hide();
/* --- FUNCTIONS --- */
//PRODUTO_INFO
var content_info = function(id){
var obj = {
"img": $("tr#"+id).find("img").attr("src"),
"nome": $("tr#"+id).find(".nome").text(),
"categoria": $("tr#"+id).find(".categoria").text(),
"sub_categoria": $("tr#"+id).find(".sub_categoria").text(),
"marca": $("tr#"+id).find(".marca").text(),
"cor": $("tr#"+id).find(".cor").text(),
"preco": $("tr#"+id).find(".preco").text()
};
return obj;
};
//INSERT
var add_produto = function(){
$(".insert-produto").slideDown(400);
$("#add-produto").hide();
$("#cancel_add-produto").fadeIn(200);
};
var cancel_add_produto = function(){
$(".insert-produto").slideUp(400);
$("#add-produto").fadeIn(200);
$("#cancel_add-produto").hide();
};
//EDIT
var edit_produto = function(){
var id = $(this).attr("name");
var content = content_info(id);
$.each(content,function( key, value ) {
if(key == "img"){$("#update").find(key).attr("src",value);}
if((key == "nome")||(key == "preco")){$("#update").find(".modal_"+key).attr("value",value);}
else{$("#update").find(".modal_"+key).text(value);}
});
$(".form_update").attr("action","produto_update/"+id);
};
//DELETE
var delete_produto = function(){
var id = $(this).attr("name");
var content = content_info(id);
$.each(content,function( key, value ) {
if(key == "img"){$("#delete").find(key).attr("src",value);}
else{$("#delete").find(".modal_"+key).text(value);}
});
$(".form_delete").attr("action","produto_delete/"+id);
};
/* --- EVENTS --- */
$("#add-produto").on("click",add_produto);
$("#cancel_add-produto").on("click",cancel_add_produto);
$("#cancel_add-produto").on("click",cancel_add_produto);
$("button.edit").on("click",edit_produto);
$("button.delete").on("click",delete_produto);
|
// Copyright 2009 the Sputnik authors. All rights reserved.
/**
* If ToBoolean(x) is true, return x
*
* @path ch11/11.11/11.11.2/S11.11.2_A4_T4.js
* @description Type(x) or Type(y) vary between Null and Undefined
*/
//CHECK#1
if ((true || undefined) !== true) {
$ERROR('#1: (true || undefined) === true');
}
//CHECK#2
if ((true || null) !== true) {
$ERROR('#2: (true || null) === true');
}
|
import { createIcon } from '../createIcon';
export const FireAltIconConfig = {
name: 'FireAltIcon',
height: 512,
width: 448,
svgPath: 'M323.56 51.2c-20.8 19.3-39.58 39.59-56.22 59.97C240.08 73.62 206.28 35.53 168 0 69.74 91.17 0 209.96 0 281.6 0 408.85 100.29 512 224 512s224-103.15 224-230.4c0-53.27-51.98-163.14-124.44-230.4zm-19.47 340.65C282.43 407.01 255.72 416 226.86 416 154.71 416 96 368.26 96 290.75c0-38.61 24.31-72.63 72.79-130.75 6.93 7.98 98.83 125.34 98.83 125.34l58.63-66.88c4.14 6.85 7.91 13.55 11.27 19.97 27.35 52.19 15.81 118.97-33.43 153.42z',
yOffset: 0,
xOffset: 0,
};
export const FireAltIcon = createIcon(FireAltIconConfig);
export default FireAltIcon;
|
function makeLogging(f, log) {
function wrapper() {
log.push([].slice.call(arguments));
return f.apply(this, arguments);
}
return wrapper;
}
|
'use strict';
const mongoose = require('mongoose');
const usersSchema = mongoose.Schema({
username: { type: String, required: true },
password: { type: String, required: true },
});
const Users = mongoose.model('users', usersSchema);
module.exports = Users;
|
(function (config, vendorPath) {
"use strict";
var paths = {
'jquery': vendorPath + '/static/bower_components/jquery/dist/jquery',
'require.js': vendorPath + '/static/require.js/require',
'socket.io': vendorPath + '/static/socket.io/socket.io.min',
'react': vendorPath + '/static/react/react',
'react-dom': vendorPath + '/static/react/react-dom',
'fastclick': vendorPath + '/static/mobile/fastclick'
};
if (!beyond.params.local) {
paths['jquery'] += '.min';
paths['require.js'] += '.min';
paths['react'] += '.min';
paths['react-dom'] += '.min';
}
requirejs.config({
paths: paths
});
requirejs.config({
shim: {
'react': {
// the following line allows you to inject React in your modules
// instead of using it as a global
exports: 'React'
},
// the following line declares that react-dom depends on react, so
// RequireJS will load react first whenever you require react-dom
'react-dom': {
'deps': ['react'],
'exports': 'ReactDOM'
}
}
});
})(requirejs.config, beyond.requireConfig.paths['libraries/vendor']);
|
search_result['2436']=["topic_00000000000005D4.html","ApplicantDetailHistoryResponseDto Constructor",""];
|
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
export var Text = (function () {
function Text(value, sourceSpan) {
this.value = value;
this.sourceSpan = sourceSpan;
}
Text.prototype.visit = function (visitor, context) { return visitor.visitText(this, context); };
return Text;
}());
export var Expansion = (function () {
function Expansion(switchValue, type, cases, sourceSpan, switchValueSourceSpan) {
this.switchValue = switchValue;
this.type = type;
this.cases = cases;
this.sourceSpan = sourceSpan;
this.switchValueSourceSpan = switchValueSourceSpan;
}
Expansion.prototype.visit = function (visitor, context) { return visitor.visitExpansion(this, context); };
return Expansion;
}());
export var ExpansionCase = (function () {
function ExpansionCase(value, expression, sourceSpan, valueSourceSpan, expSourceSpan) {
this.value = value;
this.expression = expression;
this.sourceSpan = sourceSpan;
this.valueSourceSpan = valueSourceSpan;
this.expSourceSpan = expSourceSpan;
}
ExpansionCase.prototype.visit = function (visitor, context) { return visitor.visitExpansionCase(this, context); };
return ExpansionCase;
}());
export var Attribute = (function () {
function Attribute(name, value, sourceSpan) {
this.name = name;
this.value = value;
this.sourceSpan = sourceSpan;
}
Attribute.prototype.visit = function (visitor, context) { return visitor.visitAttribute(this, context); };
return Attribute;
}());
export var Element = (function () {
function Element(name, attrs, children, sourceSpan, startSourceSpan, endSourceSpan) {
this.name = name;
this.attrs = attrs;
this.children = children;
this.sourceSpan = sourceSpan;
this.startSourceSpan = startSourceSpan;
this.endSourceSpan = endSourceSpan;
}
Element.prototype.visit = function (visitor, context) { return visitor.visitElement(this, context); };
return Element;
}());
export var Comment = (function () {
function Comment(value, sourceSpan) {
this.value = value;
this.sourceSpan = sourceSpan;
}
Comment.prototype.visit = function (visitor, context) { return visitor.visitComment(this, context); };
return Comment;
}());
export function visitAll(visitor, nodes, context) {
if (context === void 0) { context = null; }
var result = [];
nodes.forEach(function (ast) {
var astResult = ast.visit(visitor, context);
if (astResult) {
result.push(astResult);
}
});
return result;
}
//# sourceMappingURL=ast.js.map
|
"use strict";
/**
* validators service
*
* @module services/validators
**/
var _requestObj = null;
/**
* validators constructor
*
* @constructor
*/
const Validators = function(requestObj){
const oThis = this;
// Assign request object
_requestObj = requestObj;
// Define the url prefix
oThis.urlPrefix = '/api/v2/ethereum-address-validation';
return oThis;
};
Validators.prototype = {
/**
* Verify ethereum address
*
* @param {object} params
*
* @public
*/
verifyEthereumAddress: function (params) {
const oThis =this;
return _requestObj.get(oThis.urlPrefix, params);
}
};
module.exports = Validators;
|
exports.up = function(knex) {
return knex.schema.table('images', function(t) {
t.string('external_url')
})
.then(() => { console.log('added external_url to images') })
.catch((err) => { throw err} )
.finally(() => { knex.destroy() })
};
exports.down = function(knex) {
return knex.schema.table('images', function(t) {
t.dropColumn('external_url')
})
};
|
'use strict';
import format from 'errors/format';
export function assertJSON(json, config, path = '') {
for (const prop in config) {
if (!config.hasOwnProperty(prop)
|| typeof config[prop] !== 'object' || config[prop] === null) {
continue;
}
const { type, checks, children } = config[prop];
const propPath = path.length > 0 ? `${path}.${prop}` : prop;
// type check
if (type && json[prop] !== void(0) && typeof json[prop] !== type) {
throw new TypeError(format.typeError(propPath, type, json[prop]));
}
// other checks
if (checks) {
if (checks.enum) {
assertEnum(json, prop, checks.enum, propPath);
}
if (checks.require) {
assertRequire(json, prop, checks.require, propPath);
}
if (checks.forbid) {
assertForbid(json, prop, checks.forbid, propPath);
}
}
if (children && json[prop] && typeof json[prop] === 'object') {
assertJSON(json[prop], children, propPath);
}
}
}
export function assertEnum(obj, prop, { array = [], error }, path) {
if (obj == null) {
return;
}
if (obj[prop] == null) {
return;
}
if (array) {
if (Reflect.apply(Array.prototype.includes, array, [obj[prop]])) {
return;
}
if (error) {
throw new Error(error(obj, prop, path));
}
throw new Error(format.enumError(path, array, obj[prop]));
} else {
throw new Error('Invalid enum config: property "array" is missing');
}
}
export function checkCondition(obj, { absent, present }) {
if (obj == null) {
return false;
}
if (absent && typeof absent === 'object') {
for (const p of absent) {
if (obj[p] != null) {
continue;
}
return true;
}
}
if (present && typeof present === 'object') {
for (const p of present) {
if (obj[p] != null) {
return true;
}
}
}
return false;
}
export function assertRequire(obj, prop, { when, error }, path) {
let condition = true;
if (when) {
if (typeof when !== 'object' || when === null) {
throw new TypeError(format.typeError('when', 'object', when));
}
condition = checkCondition(obj, when);
}
if (condition) {
if (obj[prop] != null) {
return;
}
if (error) {
throw new Error(error(obj, prop, path));
}
throw new Error(format.missingParam(path));
}
}
export function assertForbid(obj, prop, { when, error }, path) {
let condition = true;
if (when) {
if (typeof when !== 'object' || when === null) {
throw new TypeError(format.typeError('when', 'object', when));
}
condition = checkCondition(obj, when);
}
if (condition) {
if (obj[prop] == null) {
return;
}
if (error) {
throw new Error(error(obj, prop, path));
}
throw new Error(format.extraParam(path));
}
}
export function calcAccessPath(urlConfig, root = 'root') {
if (urlConfig.path) {
return urlConfig.path;
}
return urlToAccessPath(urlConfig.url);
function urlToAccessPath(urlStr) {
let accessPath = urlStr.split('/')
.filter(x => x.length && x[0] !== ':')
.join('.');
if (accessPath.length > 0 && accessPath[0] === '.') {
accessPath = accessPath.substr(1);
}
return accessPath.length > 0 ? accessPath : root;
}
}
export function injectParamsToUrl(urlStr, params = {}) {
return urlStr.split('/').map(str => {
if (str.length > 1 && str[0] === ':') {
const paramKey = str.substr(1);
if (paramKey in params) {
return params[paramKey];
}
// TODO: obscure error message
throw new Error(format.missingParam(paramKey));
}
return str;
}).join('/');
}
export default {
assertJSON,
assertEnum,
checkCondition,
assertRequire,
assertForbid,
calcAccessPath,
injectParamsToUrl,
};
|
angular.module('ovh-api-services').service('OvhApiTelephonyEasyHuntingV6', ($resource, $cacheFactory) => {
const cache = $cacheFactory('OvhApiTelephonyEasyHuntingV6');
const queryCache = $cacheFactory('OvhApiTelephonyEasyHuntingV6Query');
const interceptor = {
response(response) {
cache.remove(response.config.url);
queryCache.removeAll();
return response.resource;
},
};
const res = $resource('/telephony/:billingAccount/easyHunting/:serviceName', {
billingAccount: '@billingAccount',
serviceName: '@serviceName',
}, {
query: {
method: 'GET',
isArray: true,
cache,
},
get: {
method: 'GET',
cache: queryCache,
},
change: {
method: 'PUT',
interceptor,
},
soundUpload: {
method: 'POST',
url: '/telephony/:billingAccount/easyHunting/:serviceName/soundUpload',
},
});
res.resetCache = function () {
cache.removeAll();
};
res.resetQueryCache = function () {
queryCache.removeAll();
};
res.resetAllCache = function () {
this.resetCache();
this.resetQueryCache();
};
return res;
});
|
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.sleep = async (ms) => {
return new Promise(resolve => setTimeout(resolve, ms));
};
exports.busyWaitForNanoSeconds = (duration) => {
return new Promise(res => {
const start = process.hrtime.bigint();
let isWaiting = true;
while (isWaiting) {
if ((process.hrtime.bigint() - start) > duration) {
isWaiting = false;
}
}
res();
});
};
//# sourceMappingURL=sleep.function.js.map
|
define([
'./defaultValue',
'./defined',
'./defineProperties',
'./DeveloperError'
], function(
defaultValue,
defined,
defineProperties,
DeveloperError) {
'use strict';
/**
* Determines visibility based on the distance to the camera.
*
* @alias DistanceDisplayCondition
* @constructor
*
* @param {Number} [near=0.0] The smallest distance in the interval where the object is visible.
* @param {Number} [far=Number.MAX_VALUE] The largest distance in the interval where the object is visible.
*
* @example
* // Make a billboard that is only visible when the distance to the camera is between 10 and 20 meters.
* billboard.distanceDisplayCondition = new Cesium.DistanceDisplayCondition(10.0, 20.0);
*/
function DistanceDisplayCondition(near, far) {
near = defaultValue(near, 0.0);
this._near = near;
far = defaultValue(far, Number.MAX_VALUE);
this._far = far;
}
defineProperties(DistanceDisplayCondition.prototype, {
/**
* The smallest distance in the interval where the object is visible.
* @memberof DistanceDisplayCondition.prototype
* @type {Number}
* @default 0.0
*/
near: {
get: function() {
return this._near;
},
set: function(value) {
this._near = value;
}
},
/**
* The largest distance in the interval where the object is visible.
* @memberof DistanceDisplayCondition.prototype
* @type {Number}
* @default Number.MAX_VALUE
*/
far: {
get: function() {
return this._far;
},
set: function(value) {
this._far = value;
}
}
});
/**
* The number of elements used to pack the object into an array.
* @type {Number}
*/
DistanceDisplayCondition.packedLength = 2;
/**
* Stores the provided instance into the provided array.
*
* @param {DistanceDisplayCondition} value The value to pack.
* @param {Number[]} array The array to pack into.
* @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
*
* @returns {Number[]} The array that was packed into
*/
DistanceDisplayCondition.pack = function(value, array, startingIndex) {
//>>includeStart('debug', pragmas.debug);
if (!defined(value)) {
throw new DeveloperError('value is required');
}
if (!defined(array)) {
throw new DeveloperError('array is required');
}
//>>includeEnd('debug');
startingIndex = defaultValue(startingIndex, 0);
array[startingIndex++] = value.near;
array[startingIndex] = value.far;
return array;
};
/**
* Retrieves an instance from a packed array.
*
* @param {Number[]} array The packed array.
* @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
* @param {DistanceDisplayCondition} [result] The object into which to store the result.
* @returns {DistanceDisplayCondition} The modified result parameter or a new DistanceDisplayCondition instance if one was not provided.
*/
DistanceDisplayCondition.unpack = function(array, startingIndex, result) {
//>>includeStart('debug', pragmas.debug);
if (!defined(array)) {
throw new DeveloperError('array is required');
}
//>>includeEnd('debug');
startingIndex = defaultValue(startingIndex, 0);
if (!defined(result)) {
result = new DistanceDisplayCondition();
}
result.near = array[startingIndex++];
result.far = array[startingIndex];
return result;
};
/**
* Determines if two distance display conditions are equal.
*
* @param {DistanceDisplayCondition} left A distance display condition.
* @param {DistanceDisplayCondition} right Another distance display condition.
* @return {Boolean} Whether the two distance display conditions are equal.
*/
DistanceDisplayCondition.equals = function(left, right) {
return left === right ||
(defined(left) &&
defined(right) &&
left.near === right.near &&
left.far === right.far);
};
/**
* Duplicates a distance display condition instance.
*
* @param {DistanceDisplayCondition} [value] The distance display condition to duplicate.
* @param {DistanceDisplayCondition} [result] The result onto which to store the result.
* @return {DistanceDisplayCondition} The duplicated instance.
*/
DistanceDisplayCondition.clone = function(value, result) {
if (!defined(value)) {
return undefined;
}
if (!defined(result)) {
result = new DistanceDisplayCondition();
}
result.near = value.near;
result.far = value.far;
return result;
};
/**
* Duplicates this instance.
*
* @param {DistanceDisplayCondition} [result] The result onto which to store the result.
* @return {DistanceDisplayCondition} The duplicated instance.
*/
DistanceDisplayCondition.prototype.clone = function(result) {
return DistanceDisplayCondition.clone(this, result);
};
/**
* Determines if this distance display condition is equal to another.
*
* @param {DistanceDisplayCondition} other Another distance display condition.
* @return {Boolean} Whether this distance display condition is equal to the other.
*/
DistanceDisplayCondition.prototype.equals = function(other) {
return DistanceDisplayCondition.equals(this, other);
};
return DistanceDisplayCondition;
});
|
import React, { Component } from 'react'
import { Redirect } from 'react-router-dom'
import $ from 'jquery'
import { toast } from 'react-toastify'
import Http from '../Http'
class ModalDelete extends Component {
constructor(){
super()
this.state = {
isLoadingBtn: false,
isDone: false
}
}
deleteProduct(){
Http.delete(`/product/${this.props.productId}`)
.then((res) => {
console.log(res.data)
if (res.data.status == 200) {
this.setState({
isLoadingBtn: false,
isDone: true
})
$(`#${this.props.modalId}`).modal('hide')
toast.success("Product successfully deleted!", {
className: "bg-success"
})
}
if (res.data.status == 500) {
this.setState({
isLoadingBtn: false
})
$(`#${this.props.modalId}`).modal('hide')
toast.error("Oops looks like something went wrong", {
className: "bg-danger"
})
}
})
.catch((err) => {
console.log(err.message)
this.setState({
isLoadingBtn: false
})
$(`#${this.props.modalId}`).modal('hide')
toast.error("Oops looks like something went wrong", {
className: "bg-danger"
})
})
}
__renderBtnDelete(){
if (this.state.isLoadingBtn) {
return <div class="lds-ripple-white"><div></div><div></div></div>
}else{
return (
<button
class="btn btn-white"
onClick={ async () => {
this.setState({
isLoadingBtn: true,
})
setTimeout(() => {
this.deleteProduct()
}, 3000)
}}>
Ok, Got it
</button>
)
}
}
render(){
return(
<div>
<div class="modal fade" id={this.props.modalId} tabindex="-1" role="dialog" aria-labelledby="modal-notification" aria-hidden="true">
<div class="modal-dialog modal-danger modal-dialog-centered modal-" role="document">
<div class="modal-content bg-gradient-danger">
<div class="modal-header">
<h6 class="modal-title" id="modal-title-notification">Your attention is required</h6>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div class="py-3 text-center">
<i class="fa fa-trash-o ni-3x"></i>
<h4 class="heading mt-4">Are you sure want to delete this product ?</h4>
</div>
</div>
<div class="modal-footer">
{ this.__renderBtnDelete() }
<button type="button" class="btn btn-link text-white ml-auto" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</div>
)
}
}
export default ModalDelete
|
// 获取时间yyy-mmm-ddd
export function getNowFormatDate() {
let date = new Date();
let seperator1 = "-";
let year = date.getFullYear();
let month = date.getMonth() + 1;
let strDate = date.getDate();
if (month >= 1 && month <= 9) {
month = "0" + month;
}
if (strDate >= 0 && strDate <= 9) {
strDate = "0" + strDate;
}
let currentdate = year + seperator1 + month + seperator1 + strDate;
return currentdate;
}
//常用的正则校验
export const reg = {
phone:/^1[0-9]{10}$/, //匹配手机号
pass:/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{8,16}$/, // 匹配8-16位数字和字母密码的正则表达式
id:/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/, // 身份证
ip:/\d+\.\d+\.\d+\.\d+/,// 匹配ip地址
cn:/^[\u4e00-\u9fa5]*$/, //匹配中文
qq:/[1-9][0-9]{4,}/, // 匹配腾讯QQ号
}
//检测平台(设备)类型
export const os = {
isWechat :/micromessenger/i.test(navigator.userAgent),
isWeibo :/weibo/i.test(navigator.userAgent),
isQQ :/qq\//i.test(navigator.userAgent),
isIOS : /(iphone|ipod|ipad|ios)/i.test(navigator.userAgent),
isAndroid : /android/i.test(navigator.userAgent),
}
// 数字格式化
export function prefix_zero(num) {
return num >= 10 ? num : "0" + num;
}
// 敏感符号转义
export function entities(s) {
let e = {
'"': '"',
'&': '&',
'<': '<',
'>': '>'
}
return s.replace(/["<>&]/g, m => {
return e[m]
})
}
/**
* 防抖函数--在事件被触发n秒后再执行回调,如果在这n秒内又被触发,则重新计时
*/
export function debounce(fun, delay) {
return function (args) {
let that = this
clearTimeout(fun.id)
fun.id = setTimeout(function () {
fun.call(that, args)
}, delay)
}
}
// 数组去重
export function distinct(arr = testArr) {
return arr.filter((v, i, array) => array.indexOf(v) === i)
}
// 深拷贝
export function clone(obj) {
var copy;
// Handle the 3 simple types, and null or undefined
if (null == obj || "object" != typeof obj) return obj;
// Handle Date
if (obj instanceof Date) {
copy = new Date();
copy.setTime(obj.getTime());
return copy;
}
// Handle Array
if (obj instanceof Array) {
copy = [];
for (var i = 0, len = obj.length; i < len; i++) {
copy[i] = clone(obj[i]);
}
return copy;
}
// Handle Object
if (obj instanceof Object) {
copy = {};
for (var attr in obj) {
if (obj.hasOwnProperty(attr)) copy[attr] = clone(obj[attr]);
}
return copy;
}
throw new Error("Unable to copy obj! Its type isn't supported.");
}
// 移动端适配方案
// (function (doc, win) {
// var docEl = doc.documentElement,
// resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',
// recalc = function () {
// var clientWidth = docEl.clientWidth;
// var fontSize = 20;
// docEl.style.fontSize = fontSize + 'px';
// var docStyles = getComputedStyle(docEl);
// var realFontSize = parseFloat(docStyles.fontSize);
// var scale = realFontSize / fontSize;
// console.log("realFontSize: " + realFontSize + ", scale: " + scale);
// fontSize = clientWidth / 667 * 20;
// if(isIphoneX()) fontSize = 19;
// fontSize = fontSize / scale;
// docEl.style.fontSize = fontSize + 'px';
// };
// // Abort if browser does not support addEventListener
// if (!doc.addEventListener) return;
// win.addEventListener(resizeEvt, recalc, false);
// doc.addEventListener('DOMContentLoaded', recalc, false);
// // iphoneX判断
// function isIphoneX(){
// return /iphone/gi.test(navigator.userAgent) && (screen.height == 812 && screen.width == 375)
// }
// })(document, window);
|
import React, { Component } from 'react'
import { Container, Icon, Segment, Header } from 'semantic-ui-react'
import { Link } from 'react-router-dom'
export default class Home extends Component {
render() {
return (
<Container className="page">
<Header as='h1'>
<Icon name='rocket'/>
Welcome to PNGR!
</Header>
<Segment>
<p>This is a boilerplate app using React for the front-end, and Golang + Postgres for the backend.</p>
<p>The only things implemented are...</p>
<ul>
<li>Account Creation</li>
<li>Session Management</li>
<li><b>CR</b>eate<b>U</b>pdate<b>D</b>elete for simple "posts"</li>
</ul>
<p><Link to="/signup">Sign Up</Link> to see how sessions work and create/view secured posts.</p>
</Segment>
</Container>
);
}
}
|
/**
* @author Dmitry Malakhov
*/
'use strict';
const { resolve } = require('path'),
webpack = require('webpack'),
omit = require('lodash.omit');
const Package = require('../package.json');
const PATH_SOURCES = resolve(__dirname, '../app');
const PATH_DIST = resolve(__dirname, '..', 'public');
const dependencies = omit(Package.dependencies, [
'apollo-server-express',
'express',
'graphql',
]);
const vendorChunks = Object.keys(dependencies);
const config = env => ({
target: 'web',
node: {
fs: 'empty',
child_process: 'empty',
net: 'empty',
},
context: PATH_SOURCES,
output: {
path: PATH_DIST,
publicPath: '/',
sourceMapFilename: '[name].map',
},
entry: {
main: ['./index'],
vendor: vendorChunks,
},
resolve: {
modules: ['node_modules'],
extensions: ['.js', '.json'],
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: 'babel-loader',
},
{
test: /\.(png|svg|jpg|gif)$/,
use: [{
loader: 'file-loader',
options: {
limit: 5120,
name: 'images/[name]-[hash].[ext]',
},
}],
},
{
test: /\.(woff|woff2|eot|ttf|otf)$/,
use: [
{
loader: 'file-loader',
options: {
name: 'fonts/[name]-[hash].[ext]',
},
},
],
},
],
},
plugins: [
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
}),
new webpack.optimize.CommonsChunkPlugin({
name: 'manifest',
minChunks: Infinity,
}),
new webpack.NoEmitOnErrorsPlugin(),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify(env),
},
}),
],
});
module.exports = { config, PATH_DIST };
|
import React, { useState, useEffect } from 'react'
import { Form, Input, Button, Select, Spin, message, Row, Col } from 'antd/lib';
import { authHeader, handleError } from "../../common/AuthHeader.js";
import { useSelector, useDispatch } from "react-redux";
import { assetsActions } from '../../../redux/actions/Assets';
import { formItemLayout } from "../../common/CommonUtil.js"
const { Option, OptGroup } = Select;
function BasicsTabSpray({enableEdit, editingAllowed, addingNewAsset, clearState, onChange, clusters, localState, formRef}) {
const assetReducer = useSelector(state => state.assetReducer);
const [selectedCluster, setSelectedCluster] = useState(assetReducer.clusterId);
const [jobSearchErrorShown, setJobSearchErrorShown] = useState(false);
const [searchResultsLoaded, setSearchResultsLoaded] = useState(false);
const [dropZoneFileSearchSuggestions, setDropZoneFileSearchSuggestions] = useState([]);
const [dropZones, setDropZones] = useState({});
const [selectedDropZoneName, setSelectedDropZoneName] = useState('');
const [selectedDropZoneIP, setSelectedDropZoneIP] = useState('');
const [sprayedFileScope, setSprayedFileScope] = useState('');
const [sprayFileName, setSprayFileName] = useState('');
const dispatch = useDispatch();
useEffect(() => {
getDropZones(selectedCluster || localState.selectedCluster);
}, [selectedCluster, localState.selectedCluster])
const onDropZoneFileChange = (value) => {
setSprayFileName(value);
localState.job.sprayFileName = value;
}
const onClusterSelection = (value) => {
dispatch(assetsActions.clusterSelected(value));
setSelectedCluster(value);
getDropZones(value);
setSelectedDropZoneIP('');
setSelectedDropZoneName('');
formRef.current.setFieldsValue({
...formRef.current.getFieldsValue(),
sprayDropZone: ''
});
}
const getDropZones = (clusterId) => {
if(clusterId) {
fetch("/api/hpcc/read/getDropZones?clusterId="+clusterId, {
headers: authHeader()
})
.then((response) => {
if(response.ok) {
return response.json();
}
handleError(response);
}).then(dropZones => {
setDropZones(dropZones);
if(formRef && formRef.current && formRef.current.getFieldValue('sprayDropZone')) {
Object.keys(dropZones).forEach((dropZone) => {
if(dropZones[dropZone].includes(formRef.current.getFieldValue('sprayDropZone'))) {
setSelectedDropZoneIP(formRef.current.getFieldValue('sprayDropZone'));
}
})
}
})
}
}
const searchDropZoneFiles = (searchString) => {
if(searchString.length <= 3 || jobSearchErrorShown) {
return;
}
setJobSearchErrorShown(false);
setSearchResultsLoaded(false);
var data = JSON.stringify({
clusterId: selectedCluster,
dropZoneName: selectedDropZoneName,
nameFilter: searchString,
server: selectedDropZoneIP
});
fetch("/api/hpcc/read/dropZoneFileSearch", {
method: 'post',
headers: authHeader(),
body: data
}).then((response) => {
if(response.ok) {
return response.json();
} else {
throw response;
}
handleError(response);
})
.then(suggestions => {
setDropZoneFileSearchSuggestions(suggestions)
setSearchResultsLoaded(true)
}).catch(error => {
if(!jobSearchErrorShown) {
error.json().then((body) => {
message.config({top:130})
message.error("There was an error searching the files from cluster");
});
setJobSearchErrorShown(true)
}
});
}
const onDropZoneChange = (e) => {
setSelectedDropZoneIP(e);
Object.keys(dropZones).filter((dropZone) => {
if(dropZones[dropZone].includes(e)) {
setSelectedDropZoneName(dropZone);
}
})
}
return (
<React.Fragment>
{addingNewAsset ?
<Form.Item {...formItemLayout} label="Cluster" name="clusters">
<Select placeholder="Select a Cluster" disabled={!editingAllowed} onChange={onClusterSelection} style={{ width: 190 }}>
{clusters.map(cluster => <Option key={cluster.id}>{cluster.name}</Option>)}
</Select>
</Form.Item> : null
}
<Form.Item label="Dropzone" name="sprayDropZone" >
{enableEdit ?
<Select placeholder="Drop Zone" style={{ width: 190 }} defaultValue={selectedDropZoneName} onChange={onDropZoneChange} disabled={!editingAllowed}>
{Object.keys(dropZones).map(d => <OptGroup label={d}>{dropZones[d].map(dropZone => <Option value={dropZone} key={dropZone}>{dropZone}</Option>)}</OptGroup>) }
</Select>
:
<textarea className="read-only-textarea" />
}
</Form.Item>
<Form.Item label="Name"
name="name"
validateTrigger= "onBlur"
rules={[{ required: true, message: 'Please enter a Name!', pattern: new RegExp(/^[a-zA-Z0-9:._-]*$/) }]}>
<Input
id="job_name"
onChange={onChange}
placeholder="Name"
disabled={true}
disabled={!editingAllowed}
className={enableEdit ? null : "read-only-input"} />
</Form.Item>
<Form.Item
label="Title"
name="title"
validateTrigger= "onBlur"
rules={[{ required: true, message: 'Please enter a title!' }, {
pattern: new RegExp(/^[a-zA-Z0-9:._-]*$/),
message: 'Please enter a valid Title',
}]}>
<Input id="job_title"
onChange={onChange}
placeholder="Title"
disabled={!editingAllowed}
className={enableEdit? null : "read-only-input"}
/>
</Form.Item>
<Form.Item
label="File"
name="sprayFileName">
{addingNewAsset ?
<Row type="flex">
<Col span={21} order={1}>
<Select
showSearch
value={sprayFileName}
placeholder="Search dropzone files..."
defaultActiveFirstOption={false}
showArrow={false}
filterOption={false}
onSearch={searchDropZoneFiles}
onChange={onDropZoneFileChange}
notFoundContent={searchResultsLoaded ? 'Not Found' : <Spin />}
>
{dropZoneFileSearchSuggestions.map((suggestion) => (
<Option key={suggestion.name} value={suggestion.name}>
{suggestion.name}
</Option>
))}
</Select>
</Col>
<Col span={3} order={2} style={{"paddingLeft": "3px"}}>
<Button htmlType="button" onClick={clearState}>
Clear
</Button>
</Col>
</Row>
: <textarea className="read-only-textarea" />}
</Form.Item>
<Form.Item label="Scope" name="sprayedFileScope" >
{enableEdit ?
<Input id="sprayedFileScope"
onChange={onChange}
placeholder="Scope"
value={sprayedFileScope}
disabled={!editingAllowed}
/>
:
<textarea className="read-only-textarea" />
}
</Form.Item>
</React.Fragment>
)
}
export default BasicsTabSpray
|
/*
* Kendo UI Web v2013.1.319 (http://kendoui.com)
* Copyright 2013 Telerik AD. All rights reserved.
*
* Kendo UI Web commercial licenses may be obtained at
* https://www.kendoui.com/purchase/license-agreement/kendo-ui-web-commercial.aspx
* If you do not own a commercial license, this file shall be governed by the
* GNU General Public License (GPL) version 3.
* For GPL requirements, please review: http://www.gnu.org/copyleft/gpl.html
*/
(function(){kendo.cultures["th-TH"]={name:"th-TH",numberFormat:{pattern:["-n"],decimals:2,",":",",".":".",groupSize:[3],percent:{pattern:["-n %","n %"],decimals:2,",":",",".":".",groupSize:[3],symbol:"%"},currency:{pattern:["-$n","$n"],decimals:2,",":",",".":".",groupSize:[3],symbol:"฿"}},calendars:{standard:{days:{names:["อาทิตย์","จันทร์","อังคาร","พุธ","พฤหัสบดี","ศุกร์","เสาร์"],namesAbbr:["อา.","จ.","อ.","พ.","พฤ.","ศ.","ส."],namesShort:["อ","จ","อ","พ","พ","ศ","ส"]},months:{names:["มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน","กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม","พฤศจิกายน","ธันวาคม",""],namesAbbr:["ม.ค.","ก.พ.","มี.ค.","เม.ย.","พ.ค.","มิ.ย.","ก.ค.","ส.ค.","ก.ย.","ต.ค.","พ.ย.","ธ.ค.",""]},AM:["AM","am","AM"],PM:["PM","pm","PM"],patterns:{d:"d/M/yyyy",D:"d MMMM yyyy",F:"d MMMM yyyy H:mm:ss",g:"d/M/yyyy H:mm",G:"d/M/yyyy H:mm:ss",m:"dd MMMM",M:"dd MMMM",s:"yyyy'-'MM'-'dd'T'HH':'mm':'ss",t:"H:mm",T:"H:mm:ss",u:"yyyy'-'MM'-'dd HH':'mm':'ss'Z'",y:"MMMM yyyy",Y:"MMMM yyyy"},"/":"/",":":":",firstDay:1}}}})(this);
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.