Plugin Directory

Changeset 2560431


Ignore:
Timestamp:
07/08/2021 08:45:21 AM (5 years ago)
Author:
alexp11223
Message:

Release

Location:
zettle-pos-integration/trunk
Files:
11 added
32 edited

Legend:

Unmodified
Added
Removed
  • zettle-pos-integration/trunk/modules/zettle-assets/assets/admin-scripts.js

    r2522603 r2560431  
    1 !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},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 r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},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="ByIP")}({ByIP:function(e,t,n){"use strict";n.r(t);var r=n("R0eK");function o(e){return function(e){if(Array.isArray(e))return i(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}String.prototype.format=function(){return Array.prototype.slice.call(arguments).reduce((function(e,t){return e.replace(/%s/,t)}),this)};var l=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._defaults={activeCls:"active",disabledCls:"disabled",triggerElSelector:".form-choice-selector",radioButtonSelector:'input[type="radio"]'},this._defaults.triggerElSelector="%s:not(.%s)".format(this._defaults.triggerElSelector,this._defaults.disabledCls),this.options=Object(r.a)(this._defaults,n),this.el=t||null,null!==this.el&&this.init()}var t,n,i;return t=e,(n=[{key:"init",value:function(){this.registerEvents()}},{key:"registerEvents",value:function(){var e=this,t=this.el.querySelectorAll(this.options.triggerElSelector);window.addEventListener("load",(function(){return e.onLoad(t)})),t.forEach((function(t){t.addEventListener("click",(function(n){e.onClick(n,t)}))}))}},{key:"onLoad",value:function(e){var t=this,n=o(e).some((function(e){return e.classList.contains(t.options.activeCls)}));e.length>1&&!n&&this.setActiveFromSelect(e),e.forEach((function(e){null!==(e.querySelector('input[type="radio"]:checked')||null)&&e.classList.add(t.options.activeCls)}))}},{key:"onClick",value:function(e,t){t.classList.contains(this.options.activeCls)||t.classList.contains(this.options.disabledCls)||this.triggerEl(t)}},{key:"triggerEl",value:function(e){var t=this;this.el.querySelectorAll(this.options.triggerElSelector).forEach((function(e){e.classList.contains(t.options.activeCls)&&e.classList.remove(t.options.activeCls)})),e.classList.add(this.options.activeCls),this.toggleRadioInput(e)}},{key:"toggleRadioInput",value:function(e){var t=this;this.el.querySelectorAll(this.options.triggerElSelector).forEach((function(e){e.querySelectorAll(t.options.radioButtonSelector).forEach((function(e){e.removeAttribute("checked"),e.checked=!1}))}));var n=e.querySelector(this.options.radioButtonSelector)||null;null!==n&&(n.checked=!0,n.setAttribute("checked",""))}},{key:"setActiveFromSelect",value:function(e){var t=this,n=e.item(0).querySelector("input"),r=document.querySelector('select[name="'+n.name+'"]')||null;if(null!==r){var o=r.options[r.options.selectedIndex];e.forEach((function(e){var n=e.querySelector(t.options.radioButtonSelector)||null;null!==n&&n.value===o.value&&(n.checked=!0,n.setAttribute("checked",""))}))}}},{key:"setElementActive",value:function(e){var t=e.querySelector(this.options.radioButtonSelector)||null;null!==t&&(t.checked=!0,t.setAttribute("checked",""))}}])&&a(t.prototype,n),i&&a(t,i),e}();function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var c=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._defaults={url:null,target:"_blank",features:{height:900,width:900,toolbar:0,location:0,menubar:0},preventDefault:!1},this.options=Object(r.a)(this._defaults,n),this.el=t||null,null!==this.el&&this.init()}var t,n,o;return t=e,(n=[{key:"init",value:function(){this.registerEvents()}},{key:"registerEvents",value:function(){var e=this;this.el.addEventListener("click",(function(t){return e.onClick(t,e.el)}))}},{key:"onClick",value:function(e,t){this.el instanceof HTMLAnchorElement&&e.preventDefault(),this.options.preventDefault&&e.preventDefault(),window.open(this.options.url,this.options.target,this._buildWindowFeatures())}},{key:"_buildWindowFeatures",value:function(){var e=this,t=Object.keys(this.options.features),n="",r=",";return t.forEach((function(o,i){var a=e.options.features[o];i+1===t.length&&(r=""),n=n.concat(o+"="+a)+r})),n}}])&&u(t.prototype,n),o&&u(t,o),e}();function s(e){return function(e){if(Array.isArray(e))return f(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return f(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function d(e){var t;return(t=[]).concat.apply(t,s(e))}function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,o,i=[],a=!0,l=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){l=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(l)throw o}}return i}(e,t)||b(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,t,n,r,o,i,a){try{var l=e[i](a),u=l.value}catch(e){return void n(e)}l.done?t(u):Promise.resolve(u).then(r,o)}function v(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){h(i,r,o,a,l,"next",e)}function l(e){h(i,r,o,a,l,"throw",e)}a(void 0)}))}}function y(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=b(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function b(e,t){if(e){if("string"==typeof e)return m(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?m(e,t):void 0}}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function g(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var S=function(){function e(t,n,o){var i=this;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._defaults={proceedActionButtonSelector:"button.btn-primary[name='save']",errorLabel:{class:"validation-error",position:{type:e.POSITION_AFTER_INPUT_FIELD}},baseUrl:window.location.origin},this.options=Object(r.a)(this._defaults,o),this.el=t,this.el){this.rules=n,this.isValid=null;var a=this.getActionButton(this.options.proceedActionButtonSelector);a?a.addEventListener("click",(function(e){return i.onClick(e,i.el)})):console.log(this.options.proceedActionButtonSelector+" not found")}}var t,n,o,i,a;return t=e,n=[{key:"onClick",value:function(e,t){var n=this;this.isValid||(e.preventDefault(),this.validate().then((function(e){if(!e.length)return n.isValid=!0,void n.submitActionButton(n.options.proceedActionButtonSelector);n.isValid=!1,n.removeErrorLabels(n.el);var t,r=y(e);try{for(r.s();!(t=r.n()).done;){var o=t.value;n.addErrorLabel(o.element,o.rule.parameters.message)}}catch(e){r.e(e)}finally{r.f()}e[0].element.focus()})).catch((function(e){console.error(e),n.isValid=!0,n.submitActionButton(n.options.proceedActionButtonSelector)})))}},{key:"validate",value:(a=v(regeneratorRuntime.mark((function e(){var t,n,r,o,i,a,l,u,c,s,f,h=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=d(Object.entries(this.rules).map((function(e){var t=p(e,2),n=t[0],r=t[1];return h.getValidatableElements(n).map((function(e){return{element:e,rules:r}}))}))),n=[],r=function(e,t){return{element:e,rule:t}},o=function(e){return{id:e[0],parameters:e[1]}},i=y(t),e.prev=5,i.s();case 7:if((a=i.n()).done){e.next=36;break}l=a.value,u=this.getElementValue(l.element),c=y(Object.entries(l.rules).map(o)),e.prev=11,c.s();case 13:if((s=c.n()).done){e.next=26;break}if("required"!==(f=s.value).id){e.next=19;break}if(this.validateRequired(u)){e.next=19;break}return n.push(r(l.element,f)),e.abrupt("break",26);case 19:if("remote"!==f.id){e.next=24;break}return e.next=22,this.validateRemote(u,f.parameters);case 22:if(e.sent){e.next=24;break}n.push(r(l.element,f));case 24:e.next=13;break;case 26:e.next=31;break;case 28:e.prev=28,e.t0=e.catch(11),c.e(e.t0);case 31:return e.prev=31,c.f(),e.finish(31);case 34:e.next=7;break;case 36:e.next=41;break;case 38:e.prev=38,e.t1=e.catch(5),i.e(e.t1);case 41:return e.prev=41,i.f(),e.finish(41);case 44:return e.abrupt("return",n);case 45:case"end":return e.stop()}}),e,this,[[5,38,41,44],[11,28,31,34]])}))),function(){return a.apply(this,arguments)})},{key:"getValidatableElements",value:function(e){return Array.from(this.el.querySelectorAll('*[name="'.concat(e,'"]'))).filter(this.isElementVisible)}},{key:"isElementVisible",value:function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}},{key:"getElementValue",value:function(e){return e.value}},{key:"validateRequired",value:function(e){return Boolean(e)}},{key:"validateRemote",value:(i=v(regeneratorRuntime.mark((function e(t,n){var o,i,a,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Object(r.a)({url:null,valueParamName:"value",requestMethod:"GET",requestHeaders:{Accept:"application/json","Content-Type":"application/json; charset=utf-8"},resultPropertyName:"result",nonce:null},n),o=n.requestHeaders,n.nonce&&(o["X-WP-Nonce"]=n.nonce),(i=new URL(n.url,this.options.baseUrl)).searchParams.append(n.valueParamName,t),e.next=7,fetch(i.toString(),{headers:o,method:n.requestMethod});case 7:if((a=e.sent).ok){e.next=10;break}throw new Error("Status Code: ".concat(a.status," Message: ").concat(a.statusText));case 10:return e.next=12,a.json();case 12:return l=e.sent,e.abrupt("return",Boolean(l[n.resultPropertyName]));case 14:case"end":return e.stop()}}),e,this)}))),function(e,t){return i.apply(this,arguments)})},{key:"addErrorLabel",value:function(t,n){var r='<p class="'.concat(this.options.errorLabel.class,'">').concat(n,"</p>");switch(this.options.errorLabel.position.type){case e.POSITION_IN_CLOSEST_SELECTOR:var o=t.closest(this.options.errorLabel.position.selector);if(!o)return void console.error("".concat(this.options.errorLabel.position.selector," not found"));o.insertAdjacentHTML("beforeend",r);break;default:console.warn("Unknown position type: ".concat(this.options.errorLabel.position.type));case e.POSITION_AFTER_INPUT_FIELD:t.insertAdjacentHTML("afterend",r)}}},{key:"removeErrorLabels",value:function(e){var t,n=y(e.querySelectorAll(".".concat(this.options.errorLabel.class)));try{for(n.s();!(t=n.n()).done;)t.value.remove()}catch(e){n.e(e)}finally{n.f()}}},{key:"getActionButton",value:function(e){return this.el.querySelector(e)}},{key:"submitActionButton",value:function(e){var t=this.getActionButton(e);t?t.click():console.log(e+" not found")}}],o=[{key:"POSITION_AFTER_INPUT_FIELD",get:function(){return"after_input_field"}},{key:"POSITION_IN_CLOSEST_SELECTOR",get:function(){return"closest"}}],n&&g(t.prototype,n),o&&g(t,o),e}();document.querySelectorAll(".form-choice-selection").forEach((function(e){new l(e)}));var k=document.querySelector(".zettle-settings-onboarding");k&&new S(k,zettleOnboardingValidationRules,{errorLabel:{position:{type:S.POSITION_IN_CLOSEST_SELECTOR,selector:".zettle-settings-onboarding-fields"}}});var E=document.querySelectorAll('*[data-popup="true"]');E.length>=1&&E.forEach((function(e){new c(e,{url:zettleAPIKeyCreation.url})})),document.querySelectorAll('.zettle-settings-onboarding-actions [type="submit"]').forEach((function(e){e.addEventListener("click",(function(){window.onbeforeunload=null}))}))},R0eK:function(e,t,n){"use strict";function r(){var e={},t=!0,n=0;"[object Boolean]"===Object.prototype.toString.call(arguments[0])&&(t=arguments[0],n++);for(var o=function(n){for(var o in n)n.hasOwnProperty(o)&&(t&&"[object Object]"===Object.prototype.toString.call(n[o])?e[o]=r(e[o],n[o]):e[o]=n[o])};n<arguments.length;n++)o(arguments[n]);return e}n.d(t,"a",(function(){return r}))}});
     1!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},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 r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},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="ByIP")}({ByIP:function(e,t,n){"use strict";n.r(t);var r=n("R0eK");function o(e){return function(e){if(Array.isArray(e))return i(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}String.prototype.format=function(){return Array.prototype.slice.call(arguments).reduce((function(e,t){return e.replace(/%s/,t)}),this)};var l=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._defaults={activeCls:"active",disabledCls:"disabled",triggerElSelector:".form-choice-selector",radioButtonSelector:'input[type="radio"]'},this._defaults.triggerElSelector="%s:not(.%s)".format(this._defaults.triggerElSelector,this._defaults.disabledCls),this.options=Object(r.a)(this._defaults,n),this.el=t||null,null!==this.el&&this.init()}var t,n,i;return t=e,(n=[{key:"init",value:function(){this.registerEvents()}},{key:"registerEvents",value:function(){var e=this,t=this.el.querySelectorAll(this.options.triggerElSelector);window.addEventListener("load",(function(){return e.onLoad(t)})),t.forEach((function(t){t.addEventListener("click",(function(n){e.onClick(n,t)}))}))}},{key:"onLoad",value:function(e){var t=this,n=o(e).some((function(e){return e.classList.contains(t.options.activeCls)}));e.length>1&&!n&&this.setActiveFromSelect(e),e.forEach((function(e){null!==(e.querySelector('input[type="radio"]:checked')||null)&&e.classList.add(t.options.activeCls)}))}},{key:"onClick",value:function(e,t){t.classList.contains(this.options.activeCls)||t.classList.contains(this.options.disabledCls)||this.triggerEl(t)}},{key:"triggerEl",value:function(e){var t=this;this.el.querySelectorAll(this.options.triggerElSelector).forEach((function(e){e.classList.contains(t.options.activeCls)&&e.classList.remove(t.options.activeCls)})),e.classList.add(this.options.activeCls),this.toggleRadioInput(e)}},{key:"toggleRadioInput",value:function(e){var t=this;this.el.querySelectorAll(this.options.triggerElSelector).forEach((function(e){e.querySelectorAll(t.options.radioButtonSelector).forEach((function(e){e.removeAttribute("checked"),e.checked=!1}))}));var n=e.querySelector(this.options.radioButtonSelector)||null;null!==n&&(n.checked=!0,n.setAttribute("checked",""))}},{key:"setActiveFromSelect",value:function(e){var t=this,n=e.item(0).querySelector("input"),r=document.querySelector('select[name="'+n.name+'"]')||null;if(null!==r){var o=r.options[r.options.selectedIndex];e.forEach((function(e){var n=e.querySelector(t.options.radioButtonSelector)||null;null!==n&&n.value===o.value&&(n.checked=!0,n.setAttribute("checked",""))}))}}},{key:"setElementActive",value:function(e){var t=e.querySelector(this.options.radioButtonSelector)||null;null!==t&&(t.checked=!0,t.setAttribute("checked",""))}}])&&a(t.prototype,n),i&&a(t,i),e}();function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var c=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._defaults={url:null,target:"_blank",features:{height:900,width:900,toolbar:0,location:0,menubar:0},preventDefault:!1},this.options=Object(r.a)(this._defaults,n),this.el=t||null,null!==this.el&&this.init()}var t,n,o;return t=e,(n=[{key:"init",value:function(){this.registerEvents()}},{key:"registerEvents",value:function(){var e=this;this.el.addEventListener("click",(function(t){return e.onClick(t,e.el)}))}},{key:"onClick",value:function(e,t){this.el instanceof HTMLAnchorElement&&e.preventDefault(),this.options.preventDefault&&e.preventDefault(),window.open(this.options.url,this.options.target,this._buildWindowFeatures())}},{key:"_buildWindowFeatures",value:function(){var e=this,t=Object.keys(this.options.features),n="",r=",";return t.forEach((function(o,i){var a=e.options.features[o];i+1===t.length&&(r=""),n=n.concat(o+"="+a)+r})),n}}])&&u(t.prototype,n),o&&u(t,o),e}();function s(e){return function(e){if(Array.isArray(e))return f(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return f(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function d(e){var t;return(t=[]).concat.apply(t,s(e))}function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,i=[],a=!0,l=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){l=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(l)throw o}}return i}(e,t)||b(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,t,n,r,o,i,a){try{var l=e[i](a),u=l.value}catch(e){return void n(e)}l.done?t(u):Promise.resolve(u).then(r,o)}function v(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){h(i,r,o,a,l,"next",e)}function l(e){h(i,r,o,a,l,"throw",e)}a(void 0)}))}}function y(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=b(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function b(e,t){if(e){if("string"==typeof e)return m(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?m(e,t):void 0}}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function g(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var S=function(){function e(t,n,o){var i=this;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._defaults={proceedActionButtonSelector:"button.btn-primary[name='save']",errorLabel:{class:"validation-error",position:{type:e.POSITION_AFTER_INPUT_FIELD}},baseUrl:window.location.origin},this.options=Object(r.a)(this._defaults,o),this.el=t,this.el){this.rules=n,this.isValid=null;var a=this.getActionButton(this.options.proceedActionButtonSelector);a?a.addEventListener("click",(function(e){return i.onClick(e,i.el)})):console.log(this.options.proceedActionButtonSelector+" not found")}}var t,n,o,i,a;return t=e,n=[{key:"onClick",value:function(e,t){var n=this;this.isValid||(e.preventDefault(),this.validate().then((function(e){if(!e.length)return n.isValid=!0,void n.submitActionButton(n.options.proceedActionButtonSelector);n.isValid=!1,n.removeErrorLabels(n.el);var t,r=y(e);try{for(r.s();!(t=r.n()).done;){var o=t.value;n.addErrorLabel(o.element,o.rule.parameters.message)}}catch(e){r.e(e)}finally{r.f()}e[0].element.focus()})).catch((function(e){console.error(e),n.isValid=!0,n.submitActionButton(n.options.proceedActionButtonSelector)})))}},{key:"validate",value:(a=v(regeneratorRuntime.mark((function e(){var t,n,r,o,i,a,l,u,c,s,f,h=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=d(Object.entries(this.rules).map((function(e){var t=p(e,2),n=t[0],r=t[1];return h.getValidatableElements(n).map((function(e){return{element:e,rules:r}}))}))),n=[],r=function(e,t){return{element:e,rule:t}},o=function(e){return{id:e[0],parameters:e[1]}},i=y(t),e.prev=5,i.s();case 7:if((a=i.n()).done){e.next=36;break}l=a.value,u=this.getElementValue(l.element),c=y(Object.entries(l.rules).map(o)),e.prev=11,c.s();case 13:if((s=c.n()).done){e.next=26;break}if("required"!==(f=s.value).id){e.next=19;break}if(this.validateRequired(u)){e.next=19;break}return n.push(r(l.element,f)),e.abrupt("break",26);case 19:if("remote"!==f.id){e.next=24;break}return e.next=22,this.validateRemote(u,f.parameters);case 22:if(e.sent){e.next=24;break}n.push(r(l.element,f));case 24:e.next=13;break;case 26:e.next=31;break;case 28:e.prev=28,e.t0=e.catch(11),c.e(e.t0);case 31:return e.prev=31,c.f(),e.finish(31);case 34:e.next=7;break;case 36:e.next=41;break;case 38:e.prev=38,e.t1=e.catch(5),i.e(e.t1);case 41:return e.prev=41,i.f(),e.finish(41);case 44:return e.abrupt("return",n);case 45:case"end":return e.stop()}}),e,this,[[5,38,41,44],[11,28,31,34]])}))),function(){return a.apply(this,arguments)})},{key:"getValidatableElements",value:function(e){return Array.from(this.el.querySelectorAll('*[name="'.concat(e,'"]'))).filter(this.isElementVisible)}},{key:"isElementVisible",value:function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}},{key:"getElementValue",value:function(e){return e.value}},{key:"validateRequired",value:function(e){return Boolean(e)}},{key:"validateRemote",value:(i=v(regeneratorRuntime.mark((function e(t,n){var o,i,a,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Object(r.a)({url:null,valueParamName:"value",requestMethod:"GET",requestHeaders:{Accept:"application/json","Content-Type":"application/json; charset=utf-8"},resultPropertyName:"result",nonce:null},n),o=n.requestHeaders,n.nonce&&(o["X-WP-Nonce"]=n.nonce),(i=new URL(n.url,this.options.baseUrl)).searchParams.append(n.valueParamName,t),e.next=7,fetch(i.toString(),{headers:o,method:n.requestMethod});case 7:if((a=e.sent).ok){e.next=10;break}throw new Error("Status Code: ".concat(a.status," Message: ").concat(a.statusText));case 10:return e.next=12,a.json();case 12:return l=e.sent,e.abrupt("return",Boolean(l[n.resultPropertyName]));case 14:case"end":return e.stop()}}),e,this)}))),function(e,t){return i.apply(this,arguments)})},{key:"addErrorLabel",value:function(t,n){var r='<p class="'.concat(this.options.errorLabel.class,'">').concat(n,"</p>");switch(this.options.errorLabel.position.type){case e.POSITION_IN_CLOSEST_SELECTOR:var o=t.closest(this.options.errorLabel.position.selector);if(!o)return void console.error("".concat(this.options.errorLabel.position.selector," not found"));o.insertAdjacentHTML("beforeend",r);break;default:console.warn("Unknown position type: ".concat(this.options.errorLabel.position.type));case e.POSITION_AFTER_INPUT_FIELD:t.insertAdjacentHTML("afterend",r)}}},{key:"removeErrorLabels",value:function(e){var t,n=y(e.querySelectorAll(".".concat(this.options.errorLabel.class)));try{for(n.s();!(t=n.n()).done;)t.value.remove()}catch(e){n.e(e)}finally{n.f()}}},{key:"getActionButton",value:function(e){return this.el.querySelector(e)}},{key:"submitActionButton",value:function(e){var t=this.getActionButton(e);t?t.click():console.log(e+" not found")}}],o=[{key:"POSITION_AFTER_INPUT_FIELD",get:function(){return"after_input_field"}},{key:"POSITION_IN_CLOSEST_SELECTOR",get:function(){return"closest"}}],n&&g(t.prototype,n),o&&g(t,o),e}();document.querySelectorAll(".form-choice-selection").forEach((function(e){new l(e)}));var k=document.querySelector(".zettle-settings-onboarding");k&&new S(k,zettleOnboardingValidationRules,{errorLabel:{position:{type:S.POSITION_IN_CLOSEST_SELECTOR,selector:".zettle-settings-onboarding-fields"}}});var E=document.querySelectorAll('*[data-popup="true"]');E.length>=1&&E.forEach((function(e){new c(e,{url:zettleAPIKeyCreation.url})})),document.querySelectorAll('.zettle-settings-onboarding-actions [type="submit"]').forEach((function(e){e.addEventListener("click",(function(){window.onbeforeunload=null}))}))},R0eK:function(e,t,n){"use strict";function r(){var e={},t=!0,n=0;"[object Boolean]"===Object.prototype.toString.call(arguments[0])&&(t=arguments[0],n++);for(var o=function(n){for(var o in n)n.hasOwnProperty(o)&&(t&&"[object Object]"===Object.prototype.toString.call(n[o])?e[o]=r(e[o],n[o]):e[o]=n[o])};n<arguments.length;n++)o(arguments[n]);return e}n.d(t,"a",(function(){return r}))}});
  • zettle-pos-integration/trunk/modules/zettle-assets/assets/sync-scripts.js

    r2522603 r2560431  
    1 !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},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 r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},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="OhJj")}({OhJj:function(e,t,n){"use strict";n.r(t);var r=n("R0eK");function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,o,s=[],i=!0,a=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(s.push(r.value),!t||s.length!==t);i=!0);}catch(e){a=!0,o=e}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return s}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){u(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t,n,r,o,s,i){try{var a=e[s](i),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,o)}function l(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var s=e.apply(t,n);function i(e){c(s,r,o,i,a,"next",e)}function a(e){c(s,r,o,i,a,"throw",e)}i(void 0)}))}}function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var f=function(){function e(t,n,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._defaults={requestMethod:"GET",requestHeaders:{Accept:"application/json","Content-Type":"application/json; charset=utf-8"},requestArguments:{types:{type:"array",active:!0,value:[]},executionTime:{type:"integer",active:!1,value:3},meta:{type:"object",active:!1,value:{}}},baseUrl:window.location.origin,preventDefault:!0,nonce:null,autoProceed:!0,selectors:{icon:".sync-progress-icon",cancelBtn:".sync-progress-action-cancel",backBtn:"button.btn-secondary",proceedBtn:"button.btn-primary",progressMessage:".sync-progress-message",progressStatus:".sync-progress-status"},messages:{error:"ERROR",confirmCancel:"CANCEL",finished:"FINISH",status:{prepare:"PREPARE",sync:"SYNC",cleanup:"CLEANUP"}},phases:["prepare","sync","cleanup"],jobTypes:{prepare:[],sync:[],cleanup:[]}},this.options=Object(r.a)(this._defaults,o,!0),this.jobsCompleted=0,this.el=t||null,this.url=n,this.currentPhase=0,this.init()}var t,n,s,i,u;return t=e,(n=[{key:"init",value:function(){if(null===this.el)throw new Error("No valid Element was given.");if(null!==this.url&&null===this.options.nonce)throw new Error("No Nonce was given.");this.options.autoProceed&&this.setActionButtonVisibility(!1,this.options.selectors.proceedBtn),this.registerEvents()}},{key:"registerEvents",value:function(){var e=this;window.addEventListener("load",(function(){e.updateProgress(0,0),e.setActionButtonsState(!1),e.toggleSyncIconAnimation(),e.loop()})),this.addNavigationConfirmation();var t=this.el.querySelector(this.options.selectors.cancelBtn);t&&t.addEventListener("click",(function(t){if(!confirm(e.options.messages.confirmCancel))return t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),!1;e.removeNavigationConfirmation()}))}},{key:"loop",value:(u=l(regeneratorRuntime.mark((function e(){var t,n,r,o,s,i,a,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.url,n=this.options.selectors,Object.keys(this.options.requestArguments).length>=1&&(t=this._buildRequestArguments(t)),e.prev=3,e.next=6,this.getJobs(t);case 6:if(r=e.sent,console.log("Queue response:",r),o=r.completed,s=r.remaining,i=r.meta,a=i.isFinished,this.updateProgress(o,s),!(!a||a&&this._advanceToNextPhase())){e.next=14;break}return e.next=14,this.loop();case 14:e.next=25;break;case 16:return e.prev=16,e.t0=e.catch(3),e.next=20,e.t0.data.json();case 20:u=e.sent,console.error(u),alert(this.options.messages.error),this.toggleSyncIconAnimation(),this.setActionButtonState(!0,n.backBtn);case 25:case"end":return e.stop()}}),e,this,[[3,16]])}))),function(){return u.apply(this,arguments)})},{key:"getJobs",value:(i=l(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t,this._buildRequest());case 2:if(!(n=e.sent).ok){e.next=7;break}return e.next=6,n.json();case 6:return e.abrupt("return",e.sent);case 7:throw n;case 8:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"_currentPhase",value:function(){return this.options.phases[this.currentPhase]}},{key:"_advanceToNextPhase",value:function(){var e=this._currentPhase(),t=this.options.selectors;return e===this.options.phases.slice(-1).pop()?(this.setActionButtonState(!1,t.backBtn),this.setActionButtonState(!0,t.proceedBtn),this.toggleSyncIconAnimation(),this.setProgressMessage(this.options.messages.finished,""),this.removeNavigationConfirmation(),this.options.autoProceed&&this.submitActionButton(t.proceedBtn),!1):(this.currentPhase++,console.log("Switched from phase ".concat(e," to ").concat(this._currentPhase())),this.jobsCompleted=0,this.updateProgress(0,0),!0)}},{key:"updateProgress",value:function(e,t){this.jobsCompleted+=e;var n=this.jobsCompleted+t;this.setProgressMessage(this.options.messages.status[this._currentPhase()]||"...",n?"(".concat(this.jobsCompleted," / ").concat(n,")"):"...")}},{key:"setProgressMessage",value:function(e,t){var n=this.options.selectors,r=this.el.querySelector(n.progressMessage),o=this.el.querySelector(n.progressStatus);r.innerHTML=e,o.innerHTML=t}},{key:"getActionButton",value:function(e){return document.querySelector(".zettle-settings-onboarding-actions").querySelector(e)}},{key:"setActionButtonState",value:function(e,t){var n=this.getActionButton(t);null!==n?n.disabled=!e:console.log(t+" not found")}},{key:"setActionButtonsState",value:function(e){document.querySelector(".zettle-settings-onboarding-actions").querySelectorAll("button").forEach((function(t){return t.disabled=!e}))}},{key:"setActionButtonVisibility",value:function(e,t){var n=this.getActionButton(t);null!==n?n.style.display=e?"block":"none":console.log(t+" not found")}},{key:"submitActionButton",value:function(e){var t=this.getActionButton(e);null!==t?t.click():console.log(e+" not found")}},{key:"toggleSyncIconAnimation",value:function(){var e=this.el.querySelector(this.options.selectors.icon)||null;null!==e&&e.classList.toggle("animate")}},{key:"_buildRequest",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=this.options.requestHeaders,n={"X-WP-Nonce":this.options.nonce};return{headers:t=a(a({},t),n),method:null!=e?e:this.options.requestMethod}}},{key:"_buildRequestArguments",value:function(e){for(var t=new URL(e,this.options.baseUrl),n=this._currentPhase(),s=this.options.jobTypes[n]||[],i=Object(r.a)(this.options.requestArguments,{types:{value:s},meta:{value:{phase:n}}}),a=function(){var e=o(c[u],2),n=e[0],r=e[1];if(r.active)switch(r.type){case"array":r.value.forEach((function(e){t.searchParams.append(n+"[]",e)}));break;case"object":for(var s=0,i=Object.entries(r.value);s<i.length;s++){var a=o(i[s],2),l=a[0],p=a[1];t.searchParams.append("".concat(n,"[").concat(l,"]"),p)}break;default:t.searchParams.append(n,r.value)}},u=0,c=Object.entries(i);u<c.length;u++)a();return t.toString()}},{key:"addNavigationConfirmation",value:function(){window.addEventListener("beforeunload",this.onBeforeUnload)}},{key:"removeNavigationConfirmation",value:function(){window.removeEventListener("beforeunload",this.onBeforeUnload)}},{key:"onBeforeUnload",value:function(e){e.preventDefault(),e.returnValue=""}}])&&p(t.prototype,n),s&&p(t,s),e}();document.querySelectorAll('*[data-sync-progress="true"]').forEach((function(e){new f(e,zettleQueueProcessEndpoint.url,zettleQueueProcessEndpoint)}))},R0eK:function(e,t,n){"use strict";function r(){var e={},t=!0,n=0;"[object Boolean]"===Object.prototype.toString.call(arguments[0])&&(t=arguments[0],n++);for(var o=function(n){for(var o in n)n.hasOwnProperty(o)&&(t&&"[object Object]"===Object.prototype.toString.call(n[o])?e[o]=r(e[o],n[o]):e[o]=n[o])};n<arguments.length;n++)o(arguments[n]);return e}n.d(t,"a",(function(){return r}))}});
     1!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},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 r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},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="OhJj")}({OhJj:function(e,t,n){"use strict";n.r(t);var r=n("R0eK");function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,s=[],i=!0,a=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(s.push(r.value),!t||s.length!==t);i=!0);}catch(e){a=!0,o=e}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return s}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){u(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t,n,r,o,s,i){try{var a=e[s](i),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,o)}function l(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var s=e.apply(t,n);function i(e){c(s,r,o,i,a,"next",e)}function a(e){c(s,r,o,i,a,"throw",e)}i(void 0)}))}}function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var f=function(){function e(t,n,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._defaults={requestMethod:"GET",requestHeaders:{Accept:"application/json","Content-Type":"application/json; charset=utf-8"},requestArguments:{types:{type:"array",active:!0,value:[]},executionTime:{type:"integer",active:!1,value:3},meta:{type:"object",active:!1,value:{}}},baseUrl:window.location.origin,preventDefault:!0,nonce:null,autoProceed:!0,selectors:{icon:".sync-progress-icon",cancelBtn:".sync-progress-action-cancel",backBtn:"button.btn-secondary",proceedBtn:"button.btn-primary",progressMessage:".sync-progress-message",progressStatus:".sync-progress-status"},messages:{error:"ERROR",confirmCancel:"CANCEL",finished:"FINISH",status:{prepare:"PREPARE",sync:"SYNC",cleanup:"CLEANUP"}},phases:["prepare","sync","cleanup"],jobTypes:{prepare:[],sync:[],cleanup:[]}},this.options=Object(r.a)(this._defaults,o,!0),this.jobsCompleted=0,this.el=t||null,this.url=n,this.currentPhase=0,this.init()}var t,n,s,i,u;return t=e,(n=[{key:"init",value:function(){if(null===this.el)throw new Error("No valid Element was given.");if(null!==this.url&&null===this.options.nonce)throw new Error("No Nonce was given.");this.options.autoProceed&&this.setActionButtonVisibility(!1,this.options.selectors.proceedBtn),this.registerEvents()}},{key:"registerEvents",value:function(){var e=this;window.addEventListener("load",(function(){e.updateProgress(0,0),e.setActionButtonsState(!1),e.toggleSyncIconAnimation(),e.loop()})),this.addNavigationConfirmation();var t=this.el.querySelector(this.options.selectors.cancelBtn);t&&t.addEventListener("click",(function(t){if(!confirm(e.options.messages.confirmCancel))return t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),!1;e.removeNavigationConfirmation()}))}},{key:"loop",value:(u=l(regeneratorRuntime.mark((function e(){var t,n,r,o,s,i,a,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.url,n=this.options.selectors,Object.keys(this.options.requestArguments).length>=1&&(t=this._buildRequestArguments(t)),e.prev=3,e.next=6,this.getJobs(t);case 6:if(r=e.sent,console.log("Queue response:",r),o=r.completed,s=r.remaining,i=r.meta,a=i.isFinished,this.updateProgress(o,s),!(!a||a&&this._advanceToNextPhase())){e.next=14;break}return e.next=14,this.loop();case 14:e.next=25;break;case 16:return e.prev=16,e.t0=e.catch(3),e.next=20,e.t0.data.json();case 20:u=e.sent,console.error(u),alert(this.options.messages.error),this.toggleSyncIconAnimation(),this.setActionButtonState(!0,n.backBtn);case 25:case"end":return e.stop()}}),e,this,[[3,16]])}))),function(){return u.apply(this,arguments)})},{key:"getJobs",value:(i=l(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t,this._buildRequest());case 2:if(!(n=e.sent).ok){e.next=7;break}return e.next=6,n.json();case 6:return e.abrupt("return",e.sent);case 7:throw n;case 8:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"_currentPhase",value:function(){return this.options.phases[this.currentPhase]}},{key:"_advanceToNextPhase",value:function(){var e=this._currentPhase(),t=this.options.selectors;return e===this.options.phases.slice(-1).pop()?(this.setActionButtonState(!1,t.backBtn),this.setActionButtonState(!0,t.proceedBtn),this.toggleSyncIconAnimation(),this.setProgressMessage(this.options.messages.finished,""),this.removeNavigationConfirmation(),this.options.autoProceed&&this.submitActionButton(t.proceedBtn),!1):(this.currentPhase++,console.log("Switched from phase ".concat(e," to ").concat(this._currentPhase())),this.jobsCompleted=0,this.updateProgress(0,0),!0)}},{key:"updateProgress",value:function(e,t){this.jobsCompleted+=e;var n=this.jobsCompleted+t;this.setProgressMessage(this.options.messages.status[this._currentPhase()]||"...",n?"(".concat(this.jobsCompleted," / ").concat(n,")"):"...")}},{key:"setProgressMessage",value:function(e,t){var n=this.options.selectors,r=this.el.querySelector(n.progressMessage),o=this.el.querySelector(n.progressStatus);r.innerHTML=e,o.innerHTML=t}},{key:"getActionButton",value:function(e){return document.querySelector(".zettle-settings-onboarding-actions").querySelector(e)}},{key:"setActionButtonState",value:function(e,t){var n=this.getActionButton(t);null!==n?n.disabled=!e:console.log(t+" not found")}},{key:"setActionButtonsState",value:function(e){document.querySelector(".zettle-settings-onboarding-actions").querySelectorAll("button").forEach((function(t){return t.disabled=!e}))}},{key:"setActionButtonVisibility",value:function(e,t){var n=this.getActionButton(t);null!==n?n.style.display=e?"block":"none":console.log(t+" not found")}},{key:"submitActionButton",value:function(e){var t=this.getActionButton(e);null!==t?t.click():console.log(e+" not found")}},{key:"toggleSyncIconAnimation",value:function(){var e=this.el.querySelector(this.options.selectors.icon)||null;null!==e&&e.classList.toggle("animate")}},{key:"_buildRequest",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=this.options.requestHeaders,n={"X-WP-Nonce":this.options.nonce};return{headers:t=a(a({},t),n),method:null!=e?e:this.options.requestMethod}}},{key:"_buildRequestArguments",value:function(e){for(var t=new URL(e,this.options.baseUrl),n=this._currentPhase(),s=this.options.jobTypes[n]||[],i=Object(r.a)(this.options.requestArguments,{types:{value:s},meta:{value:{phase:n}}}),a=function(){var e=o(c[u],2),n=e[0],r=e[1];if(r.active)switch(r.type){case"array":r.value.forEach((function(e){t.searchParams.append(n+"[]",e)}));break;case"object":for(var s=0,i=Object.entries(r.value);s<i.length;s++){var a=o(i[s],2),l=a[0],p=a[1];t.searchParams.append("".concat(n,"[").concat(l,"]"),p)}break;default:t.searchParams.append(n,r.value)}},u=0,c=Object.entries(i);u<c.length;u++)a();return t.toString()}},{key:"addNavigationConfirmation",value:function(){window.addEventListener("beforeunload",this.onBeforeUnload)}},{key:"removeNavigationConfirmation",value:function(){window.removeEventListener("beforeunload",this.onBeforeUnload)}},{key:"onBeforeUnload",value:function(e){e.preventDefault(),e.returnValue=""}}])&&p(t.prototype,n),s&&p(t,s),e}();document.querySelectorAll('*[data-sync-progress="true"]').forEach((function(e){new f(e,zettleQueueProcessEndpoint.url,zettleQueueProcessEndpoint)}))},R0eK:function(e,t,n){"use strict";function r(){var e={},t=!0,n=0;"[object Boolean]"===Object.prototype.toString.call(arguments[0])&&(t=arguments[0],n++);for(var o=function(n){for(var o in n)n.hasOwnProperty(o)&&(t&&"[object Object]"===Object.prototype.toString.call(n[o])?e[o]=r(e[o],n[o]):e[o]=n[o])};n<arguments.length;n++)o(arguments[n]);return e}n.d(t,"a",(function(){return r}))}});
  • zettle-pos-integration/trunk/modules/zettle-php-sdk/builders.woocommerce.php

    r2532865 r2560431  
    6969            }
    7070
    71             $taxStatus = $wcProduct->get_tax_status();
    72             $taxExempt = $taxStatus !== 'taxable';
    73 
    7471            $taxationType = $container->get('zettle.sync.taxation-type');
    7572            $priceSyncEnabled = $container->get('zettle.sync.price-sync-enabled');
     73
     74            $taxStatus = $wcProduct->get_tax_status();
     75            // IZET-374, can send taxExempt=true only for sales tax, for others should be false
     76            $taxExempt = $taxStatus !== 'taxable' && $taxationType === TaxationType::SALES_TAX;
    7677
    7778            $useDefaultTax = $taxationType === TaxationType::SALES_TAX
  • zettle-pos-integration/trunk/modules/zettle-php-sdk/services.php

    r2532865 r2560431  
    175175        },
    176176        'zettle.sdk.filters.tax' => static function (C $container): FilterInterface {
    177             return new TaxFilter();
     177            return new TaxFilter(
     178                function () use ($container): string {
     179                    return $container->get('zettle.sync.taxation-type');
     180                }
     181            );
    178182        },
    179183        'zettle.sdk.filters' => static function (C $container): array {
  • zettle-pos-integration/trunk/modules/zettle-php-sdk/src/Filter/TaxFilter.php

    r2532865 r2560431  
    55namespace Inpsyde\Zettle\PhpSdk\Filter;
    66
     7use Inpsyde\Zettle\PhpSdk\DAL\Entity\Organization\TaxationType;
    78use Inpsyde\Zettle\PhpSdk\DAL\Entity\Product\LazyProduct;
    89use Inpsyde\Zettle\PhpSdk\DAL\Entity\Product\WritableProductInterface;
     
    1112 * Sets taxExempt and usesDefaultTax to null for existing items
    1213 * because we are not supposed to overwrite taxes after creation.
     14 * For VAT accounts sets taxExempt to false (IZET-374).
    1315 */
    1416class TaxFilter implements FilterInterface
    1517{
     18    /**
     19     * @var callable():string
     20     */
     21    protected $taxationType;
     22
     23    /**
     24     * @param callable():string $taxationType Returns one of TaxationType values.
     25     * It's callback because of the recursive dependency.
     26     */
     27    public function __construct(callable $taxationType)
     28    {
     29        $this->taxationType = $taxationType;
     30    }
     31
    1632    /**
    1733     * @inheritDoc
     
    3551        assert($entity instanceof WritableProductInterface);
    3652
    37         $entity->setTaxExempt(null);
     53        $entity->setTaxExempt(($this->taxationType)() === TaxationType::SALES_TAX ? null : false);
    3854        $entity->setUsesDefaultTax(null);
    3955
  • zettle-pos-integration/trunk/modules/zettle-product-debug/assets/product-debug-modules.js

    r2522603 r2560431  
    1 !function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="./",n(n.s="CEol")}({CEol:function(t,e,n){"use strict";function r(){var t={},e=!0,n=0;"[object Boolean]"===Object.prototype.toString.call(arguments[0])&&(e=arguments[0],n++);for(var o=function(n){for(var o in n)n.hasOwnProperty(o)&&(e&&"[object Object]"===Object.prototype.toString.call(n[o])?t[o]=r(t[o],n[o]):t[o]=n[o])};n<arguments.length;n++)o(arguments[n]);return t}function o(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=t&&("undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"]);if(null==n)return;var r,o,i=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function a(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function u(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?a(Object(n),!0).forEach((function(e){s(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function s(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function l(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}n.r(e);var c=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._defaults={requestMethod:"GET",requestHeaders:{Accept:"application/json","Content-Type":"application/json; charset=utf-8"},requestArguments:{id:{type:"integer",active:!0,value:0},strategy:{type:"string",active:!1,value:""}},baseUrl:window.location.origin,nonce:null,status:[]},this.options=r(this._defaults,n,!0),this.url=e,this.init()}var e,n,i;return e=t,(n=[{key:"init",value:function(){if(null!==this.url&&null===this.options.nonce)throw new Error("No Nonce was given.")}},{key:"fetch",value:function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t){return Object.keys(this.options.requestArguments).length>=1&&(this.url=this._buildRequestArguments(this.url,t)),fetch(this.url,this._buildRequest()).then((function(t){return t.json()})).then((function(t){return t}))}))},{key:"_buildRequest",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=this.options.requestHeaders,n={"X-WP-Nonce":this.options.nonce};return{headers:e=u(u({},e),n),method:null!=t?t:this.options.requestMethod}}},{key:"_buildRequestArguments",value:function(t,e){for(var n=new URL(t,this.options.baseUrl),i=r(this.options.requestArguments,{id:{value:e}}),a=0,u=Object.entries(i);a<u.length;a++){var s=o(u[a],2),l=s[0],c=s[1];c.active&&n.searchParams.append(l,c.value)}return n.toString()}}])&&l(e.prototype,n),i&&l(e,i),t}();function f(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var d=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.statusMap=e||[]}var e,n,r;return e=t,(n=[{key:"match",value:function(t){var e=this,n=[];return t.forEach((function(t){n[t]=e.get(t)})),n}},{key:"get",value:function(t){return this.exists(t)?this.statusMap[t]:this.statusMap[void 0]}},{key:"set",value:function(t,e){this.statusMap[t]=e}},{key:"exists",value:function(t){return t in this.statusMap}},{key:"unset",value:function(t){delete this.statusMap[t]}}])&&f(e.prototype,n),r&&f(e,r),t}();function h(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var b=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.lineBreak=e||"",this.listItem=n||""}var e,n,r;return e=t,(n=[{key:"render",value:function(t){var e=this;return Object.keys(t).map((function(n,r){var o=t[n];switch(n){case"synced":return'<b class="is-synced">'.concat(o,"</b>");case"not-synced":return'<b class="not-synced">'.concat(o,"</b>");case"syncable":case"not-syncable":return"".concat(e.lineBreak,"<small><b>").concat(o,"</b></small>");case"product-not-found":return'<span class="na">'.concat(o,"</span>");default:return"".concat(e.lineBreak,"<small> ").concat(e.listItem," ").concat(o,"</small>")}})).join("")}}])&&h(e.prototype,n),r&&h(e,r),t}();function y(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return v(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return v(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function v(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function p(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var m=function(){function t(e,n,r,o){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.el=e||null,this.classToWatch=n,this.classAddedCallback=r,this.classRemovedCallback=o,this.observer=null,this.lastClassState=this.el.classList.contains(this.classToWatch),this.init()}var e,n,r;return e=t,(n=[{key:"init",value:function(){var t=this;if(null===this.el)throw new Error("No valid Element was given.");this.observer=new MutationObserver((function(e){var n,r=y(e);try{for(r.s();!(n=r.n()).done;){var o=n.value;if("attributes"===o.type&&"class"===o.attributeName){var i=o.target.classList.contains(t.classToWatch);t.lastClassState!==i&&(t.lastClassState=i,i?t.classAddedCallback():t.classRemovedCallback())}}}catch(t){r.e(t)}finally{r.f()}}))}},{key:"observe",value:function(){this.observer.observe(this.el,{attributes:!0})}},{key:"disconnect",value:function(){this.observer.disconnect()}}])&&p(e.prototype,n),r&&p(e,r),t}();function g(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var w=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n,r;return e=t,r=[{key:"debounce",value:function(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(){for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];r&&!n&&setTimeout(t.bind.apply(t,[t].concat(i)),0),clearTimeout(n),n=setTimeout(t.bind.apply(t,[t].concat(i)),e)}}}],(n=null)&&g(e.prototype,n),r&&g(e,r),t}();function O(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var j=function(){function t(e,n,o,i,a){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._defaults={loadContentDebounceTime:100,isHidden:!1},this.options=r(this._defaults,a,!0),this.el=i||null,this.productId=null,this.fetcher=e,this.matcher=n,this.renderer=o,this.init()}var e,n,o;return e=t,(n=[{key:"init",value:function(){if(null===this.el)throw new Error("No valid Element was given.");if(null===this.el.dataset.syncStatusId)throw new Error("No ProductId for Element was setted.");this.productId=parseInt(this.el.dataset.syncStatusId),this.assignDebouncedOnLoadContent(),this.registerEvents()}},{key:"registerEvents",value:function(){this.options.isHidden||window.addEventListener("load",this.debounceOnLoadContent,!1)}},{key:"assignDebouncedOnLoadContent",value:function(){this.debounceOnLoadContent=w.debounce(this.loadContent.bind(this),this.options.loadContentDebounceTime)}},{key:"loadContent",value:function(){var t=this;this.fetcher.fetch(this.productId).then((function(e){var n=t.matcher.match(e.result.error);t.el.innerHTML=t.renderer.render(n)}))}}])&&O(e.prototype,n),o&&O(e,o),t}(),k=document.getElementById("zettle_synced")||null;if(!k)throw new Error("Zettle Column not found.");var E=document.querySelectorAll('*[data-sync-status="true"]')||null;if(!E||E.length<1)throw new Error("Product Elements not found.");if("undefined"==typeof zettleProductValidation)throw Error("Url and Configuration Variable are not defined.");E.forEach((function(t){null!==t.dataset.id?t.status=new j(new c(zettleProductValidation.url,{nonce:zettleProductValidation.nonce,requestArguments:zettleProductValidation.requestArguments}),new d(zettleProductValidation.status),new b("<br>"," - "),t,{isHidden:k.classList.contains("hidden")}):t.status=null})),new m(k,"hidden",(function(){}),(function(){E.forEach((function(t){if(!(!t.status instanceof j)){var e=t.querySelector(".loader");t.contains(e)&&t.status.loadContent()}}))})).observe()}});
     1!function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="./",n(n.s="CEol")}({CEol:function(t,e,n){"use strict";function r(){var t={},e=!0,n=0;"[object Boolean]"===Object.prototype.toString.call(arguments[0])&&(e=arguments[0],n++);for(var o=function(n){for(var o in n)n.hasOwnProperty(o)&&(e&&"[object Object]"===Object.prototype.toString.call(n[o])?t[o]=r(t[o],n[o]):t[o]=n[o])};n<arguments.length;n++)o(arguments[n]);return t}function o(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==n)return;var r,o,i=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function a(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function u(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?a(Object(n),!0).forEach((function(e){s(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function s(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function l(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}n.r(e);var c=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._defaults={requestMethod:"GET",requestHeaders:{Accept:"application/json","Content-Type":"application/json; charset=utf-8"},requestArguments:{id:{type:"integer",active:!0,value:0},strategy:{type:"string",active:!1,value:""}},baseUrl:window.location.origin,nonce:null,status:[]},this.options=r(this._defaults,n,!0),this.url=e,this.init()}var e,n,i;return e=t,(n=[{key:"init",value:function(){if(null!==this.url&&null===this.options.nonce)throw new Error("No Nonce was given.")}},{key:"fetch",value:function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t){return Object.keys(this.options.requestArguments).length>=1&&(this.url=this._buildRequestArguments(this.url,t)),fetch(this.url,this._buildRequest()).then((function(t){return t.json()})).then((function(t){return t}))}))},{key:"_buildRequest",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=this.options.requestHeaders,n={"X-WP-Nonce":this.options.nonce};return{headers:e=u(u({},e),n),method:null!=t?t:this.options.requestMethod}}},{key:"_buildRequestArguments",value:function(t,e){for(var n=new URL(t,this.options.baseUrl),i=r(this.options.requestArguments,{id:{value:e}}),a=0,u=Object.entries(i);a<u.length;a++){var s=o(u[a],2),l=s[0],c=s[1];c.active&&n.searchParams.append(l,c.value)}return n.toString()}}])&&l(e.prototype,n),i&&l(e,i),t}();function f(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var d=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.statusMap=e||[]}var e,n,r;return e=t,(n=[{key:"match",value:function(t){var e=this,n=[];return t.forEach((function(t){n[t]=e.get(t)})),n}},{key:"get",value:function(t){return this.exists(t)?this.statusMap[t]:this.statusMap[void 0]}},{key:"set",value:function(t,e){this.statusMap[t]=e}},{key:"exists",value:function(t){return t in this.statusMap}},{key:"unset",value:function(t){delete this.statusMap[t]}}])&&f(e.prototype,n),r&&f(e,r),t}();function h(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var b=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.lineBreak=e||"",this.listItem=n||""}var e,n,r;return e=t,(n=[{key:"render",value:function(t){var e=this;return Object.keys(t).map((function(n,r){var o=t[n];switch(n){case"synced":return'<b class="is-synced">'.concat(o,"</b>");case"not-synced":return'<b class="not-synced">'.concat(o,"</b>");case"syncable":case"not-syncable":return"".concat(e.lineBreak,"<small><b>").concat(o,"</b></small>");case"product-not-found":return'<span class="na">'.concat(o,"</span>");default:return"".concat(e.lineBreak,"<small> ").concat(e.listItem," ").concat(o,"</small>")}})).join("")}}])&&h(e.prototype,n),r&&h(e,r),t}();function y(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return v(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return v(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function v(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function p(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var m=function(){function t(e,n,r,o){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.el=e||null,this.classToWatch=n,this.classAddedCallback=r,this.classRemovedCallback=o,this.observer=null,this.lastClassState=this.el.classList.contains(this.classToWatch),this.init()}var e,n,r;return e=t,(n=[{key:"init",value:function(){var t=this;if(null===this.el)throw new Error("No valid Element was given.");this.observer=new MutationObserver((function(e){var n,r=y(e);try{for(r.s();!(n=r.n()).done;){var o=n.value;if("attributes"===o.type&&"class"===o.attributeName){var i=o.target.classList.contains(t.classToWatch);t.lastClassState!==i&&(t.lastClassState=i,i?t.classAddedCallback():t.classRemovedCallback())}}}catch(t){r.e(t)}finally{r.f()}}))}},{key:"observe",value:function(){this.observer.observe(this.el,{attributes:!0})}},{key:"disconnect",value:function(){this.observer.disconnect()}}])&&p(e.prototype,n),r&&p(e,r),t}();function g(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var w=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n,r;return e=t,r=[{key:"debounce",value:function(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(){for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];r&&!n&&setTimeout(t.bind.apply(t,[t].concat(i)),0),clearTimeout(n),n=setTimeout(t.bind.apply(t,[t].concat(i)),e)}}}],(n=null)&&g(e.prototype,n),r&&g(e,r),t}();function O(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var j=function(){function t(e,n,o,i,a){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._defaults={loadContentDebounceTime:100,isHidden:!1},this.options=r(this._defaults,a,!0),this.el=i||null,this.productId=null,this.fetcher=e,this.matcher=n,this.renderer=o,this.init()}var e,n,o;return e=t,(n=[{key:"init",value:function(){if(null===this.el)throw new Error("No valid Element was given.");if(null===this.el.dataset.syncStatusId)throw new Error("No ProductId for Element was setted.");this.productId=parseInt(this.el.dataset.syncStatusId),this.assignDebouncedOnLoadContent(),this.registerEvents()}},{key:"registerEvents",value:function(){this.options.isHidden||window.addEventListener("load",this.debounceOnLoadContent,!1)}},{key:"assignDebouncedOnLoadContent",value:function(){this.debounceOnLoadContent=w.debounce(this.loadContent.bind(this),this.options.loadContentDebounceTime)}},{key:"loadContent",value:function(){var t=this;this.fetcher.fetch(this.productId).then((function(e){var n=t.matcher.match(e.result.error);t.el.innerHTML=t.renderer.render(n)}))}}])&&O(e.prototype,n),o&&O(e,o),t}(),k=document.getElementById("zettle_synced")||null;if(!k)throw new Error("Zettle Column not found.");var E=document.querySelectorAll('*[data-sync-status="true"]')||null;if(!E||E.length<1)throw new Error("Product Elements not found.");if("undefined"==typeof zettleProductValidation)throw Error("Url and Configuration Variable are not defined.");E.forEach((function(t){null!==t.dataset.id?t.status=new j(new c(zettleProductValidation.url,{nonce:zettleProductValidation.nonce,requestArguments:zettleProductValidation.requestArguments}),new d(zettleProductValidation.status),new b("<br>"," - "),t,{isHidden:k.classList.contains("hidden")}):t.status=null})),new m(k,"hidden",(function(){}),(function(){E.forEach((function(t){if(!(!t.status instanceof j)){var e=t.querySelector(".loader");t.contains(e)&&t.status.loadContent()}}))})).observe()}});
  • zettle-pos-integration/trunk/modules/zettle-product-settings/assets/products-editor.js

    r2532865 r2560431  
    1 !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},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 r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},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="xN7L")}({"5nXd":function(e,t,n){var r=n("MFOe"),o=r.slice,i=r.pluck,a=r.each,c=r.bind,s=r.create,u=r.isList,f=r.isFunction,l=r.isObject;e.exports={createStore:p};var d={version:"2.0.12",enabled:!1,get:function(e,t){var n=this.storage.read(this._namespacePrefix+e);return this._deserialize(n,t)},set:function(e,t){return void 0===t?this.remove(e):(this.storage.write(this._namespacePrefix+e,this._serialize(t)),t)},remove:function(e){this.storage.remove(this._namespacePrefix+e)},each:function(e){var t=this;this.storage.each((function(n,r){e.call(t,t._deserialize(n),(r||"").replace(t._namespaceRegexp,""))}))},clearAll:function(){this.storage.clearAll()},hasNamespace:function(e){return this._namespacePrefix=="__storejs_"+e+"_"},createStore:function(){return p.apply(this,arguments)},addPlugin:function(e){this._addPlugin(e)},namespace:function(e){return p(this.storage,this.plugins,e)}};function p(e,t,n){n||(n=""),e&&!u(e)&&(e=[e]),t&&!u(t)&&(t=[t]);var r=n?"__storejs_"+n+"_":"",p=n?new RegExp("^"+r):null;if(!/^[a-zA-Z0-9_\-]*$/.test(n))throw new Error("store.js namespaces can only have alphanumerics + underscores and dashes");var h=s({_namespacePrefix:r,_namespaceRegexp:p,_testStorage:function(e){try{var t="__storejs__test__";e.write(t,t);var n=e.read(t)===t;return e.remove(t),n}catch(e){return!1}},_assignPluginFnProp:function(e,t){var n=this[t];this[t]=function(){var t=o(arguments,0),r=this;function i(){if(n)return a(arguments,(function(e,n){t[n]=e})),n.apply(r,t)}var c=[i].concat(t);return e.apply(r,c)}},_serialize:function(e){return JSON.stringify(e)},_deserialize:function(e,t){if(!e)return t;var n="";try{n=JSON.parse(e)}catch(t){n=e}return void 0!==n?n:t},_addStorage:function(e){this.enabled||this._testStorage(e)&&(this.storage=e,this.enabled=!0)},_addPlugin:function(e){var t=this;if(u(e))a(e,(function(e){t._addPlugin(e)}));else if(!i(this.plugins,(function(t){return e===t}))){if(this.plugins.push(e),!f(e))throw new Error("Plugins must be function values that return objects");var n=e.call(this);if(!l(n))throw new Error("Plugins must return an object of function properties");a(n,(function(n,r){if(!f(n))throw new Error("Bad plugin property: "+r+" from plugin "+e.name+". Plugins should only return functions.");t._assignPluginFnProp(n,r)}))}},addStorage:function(e){!function(){var e="undefined"==typeof console?null:console;if(e){var t=e.warn?e.warn:e.log;t.apply(e,arguments)}}("store.addStorage(storage) is deprecated. Use createStore([storages])"),this._addStorage(e)}},d,{plugins:[]});return h.raw={},a(h,(function(e,t){f(e)&&(h.raw[t]=c(h,e))})),a(e,(function(e){h._addStorage(e)})),a(t,(function(e){h._addPlugin(e)})),h}},"8D0k":function(e,t,n){"use strict";var r=n("KCt4");function o(e,t,n,o,i){var a=r.writeRtpDescription(e.kind,t);if(a+=r.writeIceParameters(e.iceGatherer.getLocalParameters()),a+=r.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===n?"actpass":i||"active"),a+="a=mid:"+e.mid+"\r\n",e.rtpSender&&e.rtpReceiver?a+="a=sendrecv\r\n":e.rtpSender?a+="a=sendonly\r\n":e.rtpReceiver?a+="a=recvonly\r\n":a+="a=inactive\r\n",e.rtpSender){var c=e.rtpSender._initialTrackId||e.rtpSender.track.id;e.rtpSender._initialTrackId=c;var s="msid:"+(o?o.id:"-")+" "+c+"\r\n";a+="a="+s,a+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+s,e.sendEncodingParameters[0].rtx&&(a+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+s,a+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return a+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+r.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(a+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+r.localCName+"\r\n"),a}function i(e,t){var n={codecs:[],headerExtensions:[],fecMechanisms:[]},r=function(e,t){e=parseInt(e,10);for(var n=0;n<t.length;n++)if(t[n].payloadType===e||t[n].preferredPayloadType===e)return t[n]},o=function(e,t,n,o){var i=r(e.parameters.apt,n),a=r(t.parameters.apt,o);return i&&a&&i.name.toLowerCase()===a.name.toLowerCase()};return e.codecs.forEach((function(r){for(var i=0;i<t.codecs.length;i++){var a=t.codecs[i];if(r.name.toLowerCase()===a.name.toLowerCase()&&r.clockRate===a.clockRate){if("rtx"===r.name.toLowerCase()&&r.parameters&&a.parameters.apt&&!o(r,a,e.codecs,t.codecs))continue;(a=JSON.parse(JSON.stringify(a))).numChannels=Math.min(r.numChannels,a.numChannels),n.codecs.push(a),a.rtcpFeedback=a.rtcpFeedback.filter((function(e){for(var t=0;t<r.rtcpFeedback.length;t++)if(r.rtcpFeedback[t].type===e.type&&r.rtcpFeedback[t].parameter===e.parameter)return!0;return!1}));break}}})),e.headerExtensions.forEach((function(e){for(var r=0;r<t.headerExtensions.length;r++){var o=t.headerExtensions[r];if(e.uri===o.uri){n.headerExtensions.push(o);break}}})),n}function a(e,t,n){return-1!=={offer:{setLocalDescription:["stable","have-local-offer"],setRemoteDescription:["stable","have-remote-offer"]},answer:{setLocalDescription:["have-remote-offer","have-local-pranswer"],setRemoteDescription:["have-local-offer","have-remote-pranswer"]}}[t][e].indexOf(n)}function c(e,t){var n=e.getRemoteCandidates().find((function(e){return t.foundation===e.foundation&&t.ip===e.ip&&t.port===e.port&&t.priority===e.priority&&t.protocol===e.protocol&&t.type===e.type}));return n||e.addRemoteCandidate(t),!n}function s(e,t){var n=new Error(t);return n.name=e,n.code={NotSupportedError:9,InvalidStateError:11,InvalidAccessError:15,TypeError:void 0,OperationError:void 0}[e],n}e.exports=function(e,t){function n(t,n){n.addTrack(t),n.dispatchEvent(new e.MediaStreamTrackEvent("addtrack",{track:t}))}function u(t,n,r,o){var i=new Event("track");i.track=n,i.receiver=r,i.transceiver={receiver:r},i.streams=o,e.setTimeout((function(){t._dispatchEvent("track",i)}))}var f=function(n){var o=this,i=document.createDocumentFragment();if(["addEventListener","removeEventListener","dispatchEvent"].forEach((function(e){o[e]=i[e].bind(i)})),this.canTrickleIceCandidates=null,this.needNegotiation=!1,this.localStreams=[],this.remoteStreams=[],this._localDescription=null,this._remoteDescription=null,this.signalingState="stable",this.iceConnectionState="new",this.connectionState="new",this.iceGatheringState="new",n=JSON.parse(JSON.stringify(n||{})),this.usingBundle="max-bundle"===n.bundlePolicy,"negotiate"===n.rtcpMuxPolicy)throw s("NotSupportedError","rtcpMuxPolicy 'negotiate' is not supported");switch(n.rtcpMuxPolicy||(n.rtcpMuxPolicy="require"),n.iceTransportPolicy){case"all":case"relay":break;default:n.iceTransportPolicy="all"}switch(n.bundlePolicy){case"balanced":case"max-compat":case"max-bundle":break;default:n.bundlePolicy="balanced"}if(n.iceServers=function(e,t){var n=!1;return(e=JSON.parse(JSON.stringify(e))).filter((function(e){if(e&&(e.urls||e.url)){var r=e.urls||e.url;e.url&&!e.urls&&console.warn("RTCIceServer.url is deprecated! Use urls instead.");var o="string"==typeof r;return o&&(r=[r]),r=r.filter((function(e){return 0===e.indexOf("turn:")&&-1!==e.indexOf("transport=udp")&&-1===e.indexOf("turn:[")&&!n?(n=!0,!0):0===e.indexOf("stun:")&&t>=14393&&-1===e.indexOf("?transport=udp")})),delete e.url,e.urls=o?r[0]:r,!!r.length}}))}(n.iceServers||[],t),this._iceGatherers=[],n.iceCandidatePoolSize)for(var a=n.iceCandidatePoolSize;a>0;a--)this._iceGatherers.push(new e.RTCIceGatherer({iceServers:n.iceServers,gatherPolicy:n.iceTransportPolicy}));else n.iceCandidatePoolSize=0;this._config=n,this.transceivers=[],this._sdpSessionId=r.generateSessionId(),this._sdpSessionVersion=0,this._dtlsRole=void 0,this._isClosed=!1};Object.defineProperty(f.prototype,"localDescription",{configurable:!0,get:function(){return this._localDescription}}),Object.defineProperty(f.prototype,"remoteDescription",{configurable:!0,get:function(){return this._remoteDescription}}),f.prototype.onicecandidate=null,f.prototype.onaddstream=null,f.prototype.ontrack=null,f.prototype.onremovestream=null,f.prototype.onsignalingstatechange=null,f.prototype.oniceconnectionstatechange=null,f.prototype.onconnectionstatechange=null,f.prototype.onicegatheringstatechange=null,f.prototype.onnegotiationneeded=null,f.prototype.ondatachannel=null,f.prototype._dispatchEvent=function(e,t){this._isClosed||(this.dispatchEvent(t),"function"==typeof this["on"+e]&&this["on"+e](t))},f.prototype._emitGatheringStateChange=function(){var e=new Event("icegatheringstatechange");this._dispatchEvent("icegatheringstatechange",e)},f.prototype.getConfiguration=function(){return this._config},f.prototype.getLocalStreams=function(){return this.localStreams},f.prototype.getRemoteStreams=function(){return this.remoteStreams},f.prototype._createTransceiver=function(e,t){var n=this.transceivers.length>0,r={track:null,iceGatherer:null,iceTransport:null,dtlsTransport:null,localCapabilities:null,remoteCapabilities:null,rtpSender:null,rtpReceiver:null,kind:e,mid:null,sendEncodingParameters:null,recvEncodingParameters:null,stream:null,associatedRemoteMediaStreams:[],wantReceive:!0};if(this.usingBundle&&n)r.iceTransport=this.transceivers[0].iceTransport,r.dtlsTransport=this.transceivers[0].dtlsTransport;else{var o=this._createIceAndDtlsTransports();r.iceTransport=o.iceTransport,r.dtlsTransport=o.dtlsTransport}return t||this.transceivers.push(r),r},f.prototype.addTrack=function(t,n){if(this._isClosed)throw s("InvalidStateError","Attempted to call addTrack on a closed peerconnection.");var r;if(this.transceivers.find((function(e){return e.track===t})))throw s("InvalidAccessError","Track already exists.");for(var o=0;o<this.transceivers.length;o++)this.transceivers[o].track||this.transceivers[o].kind!==t.kind||(r=this.transceivers[o]);return r||(r=this._createTransceiver(t.kind)),this._maybeFireNegotiationNeeded(),-1===this.localStreams.indexOf(n)&&this.localStreams.push(n),r.track=t,r.stream=n,r.rtpSender=new e.RTCRtpSender(t,r.dtlsTransport),r.rtpSender},f.prototype.addStream=function(e){var n=this;if(t>=15025)e.getTracks().forEach((function(t){n.addTrack(t,e)}));else{var r=e.clone();e.getTracks().forEach((function(e,t){var n=r.getTracks()[t];e.addEventListener("enabled",(function(e){n.enabled=e.enabled}))})),r.getTracks().forEach((function(e){n.addTrack(e,r)}))}},f.prototype.removeTrack=function(t){if(this._isClosed)throw s("InvalidStateError","Attempted to call removeTrack on a closed peerconnection.");if(!(t instanceof e.RTCRtpSender))throw new TypeError("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.");var n=this.transceivers.find((function(e){return e.rtpSender===t}));if(!n)throw s("InvalidAccessError","Sender was not created by this connection.");var r=n.stream;n.rtpSender.stop(),n.rtpSender=null,n.track=null,n.stream=null,-1===this.transceivers.map((function(e){return e.stream})).indexOf(r)&&this.localStreams.indexOf(r)>-1&&this.localStreams.splice(this.localStreams.indexOf(r),1),this._maybeFireNegotiationNeeded()},f.prototype.removeStream=function(e){var t=this;e.getTracks().forEach((function(e){var n=t.getSenders().find((function(t){return t.track===e}));n&&t.removeTrack(n)}))},f.prototype.getSenders=function(){return this.transceivers.filter((function(e){return!!e.rtpSender})).map((function(e){return e.rtpSender}))},f.prototype.getReceivers=function(){return this.transceivers.filter((function(e){return!!e.rtpReceiver})).map((function(e){return e.rtpReceiver}))},f.prototype._createIceGatherer=function(t,n){var r=this;if(n&&t>0)return this.transceivers[0].iceGatherer;if(this._iceGatherers.length)return this._iceGatherers.shift();var o=new e.RTCIceGatherer({iceServers:this._config.iceServers,gatherPolicy:this._config.iceTransportPolicy});return Object.defineProperty(o,"state",{value:"new",writable:!0}),this.transceivers[t].bufferedCandidateEvents=[],this.transceivers[t].bufferCandidates=function(e){var n=!e.candidate||0===Object.keys(e.candidate).length;o.state=n?"completed":"gathering",null!==r.transceivers[t].bufferedCandidateEvents&&r.transceivers[t].bufferedCandidateEvents.push(e)},o.addEventListener("localcandidate",this.transceivers[t].bufferCandidates),o},f.prototype._gather=function(t,n){var o=this,i=this.transceivers[n].iceGatherer;if(!i.onlocalcandidate){var a=this.transceivers[n].bufferedCandidateEvents;this.transceivers[n].bufferedCandidateEvents=null,i.removeEventListener("localcandidate",this.transceivers[n].bufferCandidates),i.onlocalcandidate=function(e){if(!(o.usingBundle&&n>0)){var a=new Event("icecandidate");a.candidate={sdpMid:t,sdpMLineIndex:n};var c=e.candidate,s=!c||0===Object.keys(c).length;if(s)"new"!==i.state&&"gathering"!==i.state||(i.state="completed");else{"new"===i.state&&(i.state="gathering"),c.component=1,c.ufrag=i.getLocalParameters().usernameFragment;var u=r.writeCandidate(c);a.candidate=Object.assign(a.candidate,r.parseCandidate(u)),a.candidate.candidate=u,a.candidate.toJSON=function(){return{candidate:a.candidate.candidate,sdpMid:a.candidate.sdpMid,sdpMLineIndex:a.candidate.sdpMLineIndex,usernameFragment:a.candidate.usernameFragment}}}var f=r.getMediaSections(o._localDescription.sdp);f[a.candidate.sdpMLineIndex]+=s?"a=end-of-candidates\r\n":"a="+a.candidate.candidate+"\r\n",o._localDescription.sdp=r.getDescription(o._localDescription.sdp)+f.join("");var l=o.transceivers.every((function(e){return e.iceGatherer&&"completed"===e.iceGatherer.state}));"gathering"!==o.iceGatheringState&&(o.iceGatheringState="gathering",o._emitGatheringStateChange()),s||o._dispatchEvent("icecandidate",a),l&&(o._dispatchEvent("icecandidate",new Event("icecandidate")),o.iceGatheringState="complete",o._emitGatheringStateChange())}},e.setTimeout((function(){a.forEach((function(e){i.onlocalcandidate(e)}))}),0)}},f.prototype._createIceAndDtlsTransports=function(){var t=this,n=new e.RTCIceTransport(null);n.onicestatechange=function(){t._updateIceConnectionState(),t._updateConnectionState()};var r=new e.RTCDtlsTransport(n);return r.ondtlsstatechange=function(){t._updateConnectionState()},r.onerror=function(){Object.defineProperty(r,"state",{value:"failed",writable:!0}),t._updateConnectionState()},{iceTransport:n,dtlsTransport:r}},f.prototype._disposeIceAndDtlsTransports=function(e){var t=this.transceivers[e].iceGatherer;t&&(delete t.onlocalcandidate,delete this.transceivers[e].iceGatherer);var n=this.transceivers[e].iceTransport;n&&(delete n.onicestatechange,delete this.transceivers[e].iceTransport);var r=this.transceivers[e].dtlsTransport;r&&(delete r.ondtlsstatechange,delete r.onerror,delete this.transceivers[e].dtlsTransport)},f.prototype._transceive=function(e,n,o){var a=i(e.localCapabilities,e.remoteCapabilities);n&&e.rtpSender&&(a.encodings=e.sendEncodingParameters,a.rtcp={cname:r.localCName,compound:e.rtcpParameters.compound},e.recvEncodingParameters.length&&(a.rtcp.ssrc=e.recvEncodingParameters[0].ssrc),e.rtpSender.send(a)),o&&e.rtpReceiver&&a.codecs.length>0&&("video"===e.kind&&e.recvEncodingParameters&&t<15019&&e.recvEncodingParameters.forEach((function(e){delete e.rtx})),e.recvEncodingParameters.length?a.encodings=e.recvEncodingParameters:a.encodings=[{}],a.rtcp={compound:e.rtcpParameters.compound},e.rtcpParameters.cname&&(a.rtcp.cname=e.rtcpParameters.cname),e.sendEncodingParameters.length&&(a.rtcp.ssrc=e.sendEncodingParameters[0].ssrc),e.rtpReceiver.receive(a))},f.prototype.setLocalDescription=function(e){var t,n,o=this;if(-1===["offer","answer"].indexOf(e.type))return Promise.reject(s("TypeError",'Unsupported type "'+e.type+'"'));if(!a("setLocalDescription",e.type,o.signalingState)||o._isClosed)return Promise.reject(s("InvalidStateError","Can not set local "+e.type+" in state "+o.signalingState));if("offer"===e.type)t=r.splitSections(e.sdp),n=t.shift(),t.forEach((function(e,t){var n=r.parseRtpParameters(e);o.transceivers[t].localCapabilities=n})),o.transceivers.forEach((function(e,t){o._gather(e.mid,t)}));else if("answer"===e.type){t=r.splitSections(o._remoteDescription.sdp),n=t.shift();var c=r.matchPrefix(n,"a=ice-lite").length>0;t.forEach((function(e,t){var a=o.transceivers[t],s=a.iceGatherer,u=a.iceTransport,f=a.dtlsTransport,l=a.localCapabilities,d=a.remoteCapabilities;if(!(r.isRejected(e)&&0===r.matchPrefix(e,"a=bundle-only").length)&&!a.rejected){var p=r.getIceParameters(e,n),h=r.getDtlsParameters(e,n);c&&(h.role="server"),o.usingBundle&&0!==t||(o._gather(a.mid,t),"new"===u.state&&u.start(s,p,c?"controlling":"controlled"),"new"===f.state&&f.start(h));var v=i(l,d);o._transceive(a,v.codecs.length>0,!1)}}))}return o._localDescription={type:e.type,sdp:e.sdp},"offer"===e.type?o._updateSignalingState("have-local-offer"):o._updateSignalingState("stable"),Promise.resolve()},f.prototype.setRemoteDescription=function(o){var f=this;if(-1===["offer","answer"].indexOf(o.type))return Promise.reject(s("TypeError",'Unsupported type "'+o.type+'"'));if(!a("setRemoteDescription",o.type,f.signalingState)||f._isClosed)return Promise.reject(s("InvalidStateError","Can not set remote "+o.type+" in state "+f.signalingState));var l={};f.remoteStreams.forEach((function(e){l[e.id]=e}));var d=[],p=r.splitSections(o.sdp),h=p.shift(),v=r.matchPrefix(h,"a=ice-lite").length>0,m=r.matchPrefix(h,"a=group:BUNDLE ").length>0;f.usingBundle=m;var g=r.matchPrefix(h,"a=ice-options:")[0];return f.canTrickleIceCandidates=!!g&&g.substr(14).split(" ").indexOf("trickle")>=0,p.forEach((function(a,s){var u=r.splitLines(a),p=r.getKind(a),g=r.isRejected(a)&&0===r.matchPrefix(a,"a=bundle-only").length,y=u[0].substr(2).split(" ")[2],b=r.getDirection(a,h),_=r.parseMsid(a),x=r.getMid(a)||r.generateIdentifier();if(g||"application"===p&&("DTLS/SCTP"===y||"UDP/DTLS/SCTP"===y))f.transceivers[s]={mid:x,kind:p,protocol:y,rejected:!0};else{var C,S,w,R,T,E,P,O,k;!g&&f.transceivers[s]&&f.transceivers[s].rejected&&(f.transceivers[s]=f._createTransceiver(p,!0));var D,M,A=r.parseRtpParameters(a);g||(D=r.getIceParameters(a,h),(M=r.getDtlsParameters(a,h)).role="client"),P=r.parseRtpEncodingParameters(a);var j=r.parseRtcpParameters(a),I=r.matchPrefix(a,"a=end-of-candidates",h).length>0,L=r.matchPrefix(a,"a=candidate:").map((function(e){return r.parseCandidate(e)})).filter((function(e){return 1===e.component}));if(("offer"===o.type||"answer"===o.type)&&!g&&m&&s>0&&f.transceivers[s]&&(f._disposeIceAndDtlsTransports(s),f.transceivers[s].iceGatherer=f.transceivers[0].iceGatherer,f.transceivers[s].iceTransport=f.transceivers[0].iceTransport,f.transceivers[s].dtlsTransport=f.transceivers[0].dtlsTransport,f.transceivers[s].rtpSender&&f.transceivers[s].rtpSender.setTransport(f.transceivers[0].dtlsTransport),f.transceivers[s].rtpReceiver&&f.transceivers[s].rtpReceiver.setTransport(f.transceivers[0].dtlsTransport)),"offer"!==o.type||g){if("answer"===o.type&&!g){S=(C=f.transceivers[s]).iceGatherer,w=C.iceTransport,R=C.dtlsTransport,T=C.rtpReceiver,E=C.sendEncodingParameters,O=C.localCapabilities,f.transceivers[s].recvEncodingParameters=P,f.transceivers[s].remoteCapabilities=A,f.transceivers[s].rtcpParameters=j,L.length&&"new"===w.state&&(!v&&!I||m&&0!==s?L.forEach((function(e){c(C.iceTransport,e)})):w.setRemoteCandidates(L)),m&&0!==s||("new"===w.state&&w.start(S,D,"controlling"),"new"===R.state&&R.start(M)),!i(C.localCapabilities,C.remoteCapabilities).codecs.filter((function(e){return"rtx"===e.name.toLowerCase()})).length&&C.sendEncodingParameters[0].rtx&&delete C.sendEncodingParameters[0].rtx,f._transceive(C,"sendrecv"===b||"recvonly"===b,"sendrecv"===b||"sendonly"===b),!T||"sendrecv"!==b&&"sendonly"!==b?delete C.rtpReceiver:(k=T.track,_?(l[_.stream]||(l[_.stream]=new e.MediaStream),n(k,l[_.stream]),d.push([k,T,l[_.stream]])):(l.default||(l.default=new e.MediaStream),n(k,l.default),d.push([k,T,l.default])))}}else{(C=f.transceivers[s]||f._createTransceiver(p)).mid=x,C.iceGatherer||(C.iceGatherer=f._createIceGatherer(s,m)),L.length&&"new"===C.iceTransport.state&&(!I||m&&0!==s?L.forEach((function(e){c(C.iceTransport,e)})):C.iceTransport.setRemoteCandidates(L)),O=e.RTCRtpReceiver.getCapabilities(p),t<15019&&(O.codecs=O.codecs.filter((function(e){return"rtx"!==e.name}))),E=C.sendEncodingParameters||[{ssrc:1001*(2*s+2)}];var N,z=!1;if("sendrecv"===b||"sendonly"===b){if(z=!C.rtpReceiver,T=C.rtpReceiver||new e.RTCRtpReceiver(C.dtlsTransport,p),z)k=T.track,_&&"-"===_.stream||(_?(l[_.stream]||(l[_.stream]=new e.MediaStream,Object.defineProperty(l[_.stream],"id",{get:function(){return _.stream}})),Object.defineProperty(k,"id",{get:function(){return _.track}}),N=l[_.stream]):(l.default||(l.default=new e.MediaStream),N=l.default)),N&&(n(k,N),C.associatedRemoteMediaStreams.push(N)),d.push([k,T,N])}else C.rtpReceiver&&C.rtpReceiver.track&&(C.associatedRemoteMediaStreams.forEach((function(t){var n=t.getTracks().find((function(e){return e.id===C.rtpReceiver.track.id}));n&&function(t,n){n.removeTrack(t),n.dispatchEvent(new e.MediaStreamTrackEvent("removetrack",{track:t}))}(n,t)})),C.associatedRemoteMediaStreams=[]);C.localCapabilities=O,C.remoteCapabilities=A,C.rtpReceiver=T,C.rtcpParameters=j,C.sendEncodingParameters=E,C.recvEncodingParameters=P,f._transceive(f.transceivers[s],!1,z)}}})),void 0===f._dtlsRole&&(f._dtlsRole="offer"===o.type?"active":"passive"),f._remoteDescription={type:o.type,sdp:o.sdp},"offer"===o.type?f._updateSignalingState("have-remote-offer"):f._updateSignalingState("stable"),Object.keys(l).forEach((function(t){var n=l[t];if(n.getTracks().length){if(-1===f.remoteStreams.indexOf(n)){f.remoteStreams.push(n);var r=new Event("addstream");r.stream=n,e.setTimeout((function(){f._dispatchEvent("addstream",r)}))}d.forEach((function(e){var t=e[0],r=e[1];n.id===e[2].id&&u(f,t,r,[n])}))}})),d.forEach((function(e){e[2]||u(f,e[0],e[1],[])})),e.setTimeout((function(){f&&f.transceivers&&f.transceivers.forEach((function(e){e.iceTransport&&"new"===e.iceTransport.state&&e.iceTransport.getRemoteCandidates().length>0&&(console.warn("Timeout for addRemoteCandidate. Consider sending an end-of-candidates notification"),e.iceTransport.addRemoteCandidate({}))}))}),4e3),Promise.resolve()},f.prototype.close=function(){this.transceivers.forEach((function(e){e.iceTransport&&e.iceTransport.stop(),e.dtlsTransport&&e.dtlsTransport.stop(),e.rtpSender&&e.rtpSender.stop(),e.rtpReceiver&&e.rtpReceiver.stop()})),this._isClosed=!0,this._updateSignalingState("closed")},f.prototype._updateSignalingState=function(e){this.signalingState=e;var t=new Event("signalingstatechange");this._dispatchEvent("signalingstatechange",t)},f.prototype._maybeFireNegotiationNeeded=function(){var t=this;"stable"===this.signalingState&&!0!==this.needNegotiation&&(this.needNegotiation=!0,e.setTimeout((function(){if(t.needNegotiation){t.needNegotiation=!1;var e=new Event("negotiationneeded");t._dispatchEvent("negotiationneeded",e)}}),0))},f.prototype._updateIceConnectionState=function(){var e,t={new:0,closed:0,checking:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach((function(e){e.iceTransport&&!e.rejected&&t[e.iceTransport.state]++})),e="new",t.failed>0?e="failed":t.checking>0?e="checking":t.disconnected>0?e="disconnected":t.new>0?e="new":t.connected>0?e="connected":t.completed>0&&(e="completed"),e!==this.iceConnectionState){this.iceConnectionState=e;var n=new Event("iceconnectionstatechange");this._dispatchEvent("iceconnectionstatechange",n)}},f.prototype._updateConnectionState=function(){var e,t={new:0,closed:0,connecting:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach((function(e){e.iceTransport&&e.dtlsTransport&&!e.rejected&&(t[e.iceTransport.state]++,t[e.dtlsTransport.state]++)})),t.connected+=t.completed,e="new",t.failed>0?e="failed":t.connecting>0?e="connecting":t.disconnected>0?e="disconnected":t.new>0?e="new":t.connected>0&&(e="connected"),e!==this.connectionState){this.connectionState=e;var n=new Event("connectionstatechange");this._dispatchEvent("connectionstatechange",n)}},f.prototype.createOffer=function(){var n=this;if(n._isClosed)return Promise.reject(s("InvalidStateError","Can not call createOffer after close"));var i=n.transceivers.filter((function(e){return"audio"===e.kind})).length,a=n.transceivers.filter((function(e){return"video"===e.kind})).length,c=arguments[0];if(c){if(c.mandatory||c.optional)throw new TypeError("Legacy mandatory/optional constraints not supported.");void 0!==c.offerToReceiveAudio&&(i=!0===c.offerToReceiveAudio?1:!1===c.offerToReceiveAudio?0:c.offerToReceiveAudio),void 0!==c.offerToReceiveVideo&&(a=!0===c.offerToReceiveVideo?1:!1===c.offerToReceiveVideo?0:c.offerToReceiveVideo)}for(n.transceivers.forEach((function(e){"audio"===e.kind?--i<0&&(e.wantReceive=!1):"video"===e.kind&&--a<0&&(e.wantReceive=!1)}));i>0||a>0;)i>0&&(n._createTransceiver("audio"),i--),a>0&&(n._createTransceiver("video"),a--);var u=r.writeSessionBoilerplate(n._sdpSessionId,n._sdpSessionVersion++);n.transceivers.forEach((function(o,i){var a=o.track,c=o.kind,s=o.mid||r.generateIdentifier();o.mid=s,o.iceGatherer||(o.iceGatherer=n._createIceGatherer(i,n.usingBundle));var u=e.RTCRtpSender.getCapabilities(c);t<15019&&(u.codecs=u.codecs.filter((function(e){return"rtx"!==e.name}))),u.codecs.forEach((function(e){"H264"===e.name&&void 0===e.parameters["level-asymmetry-allowed"]&&(e.parameters["level-asymmetry-allowed"]="1"),o.remoteCapabilities&&o.remoteCapabilities.codecs&&o.remoteCapabilities.codecs.forEach((function(t){e.name.toLowerCase()===t.name.toLowerCase()&&e.clockRate===t.clockRate&&(e.preferredPayloadType=t.payloadType)}))})),u.headerExtensions.forEach((function(e){(o.remoteCapabilities&&o.remoteCapabilities.headerExtensions||[]).forEach((function(t){e.uri===t.uri&&(e.id=t.id)}))}));var f=o.sendEncodingParameters||[{ssrc:1001*(2*i+1)}];a&&t>=15019&&"video"===c&&!f[0].rtx&&(f[0].rtx={ssrc:f[0].ssrc+1}),o.wantReceive&&(o.rtpReceiver=new e.RTCRtpReceiver(o.dtlsTransport,c)),o.localCapabilities=u,o.sendEncodingParameters=f})),"max-compat"!==n._config.bundlePolicy&&(u+="a=group:BUNDLE "+n.transceivers.map((function(e){return e.mid})).join(" ")+"\r\n"),u+="a=ice-options:trickle\r\n",n.transceivers.forEach((function(e,t){u+=o(e,e.localCapabilities,"offer",e.stream,n._dtlsRole),u+="a=rtcp-rsize\r\n",!e.iceGatherer||"new"===n.iceGatheringState||0!==t&&n.usingBundle||(e.iceGatherer.getLocalCandidates().forEach((function(e){e.component=1,u+="a="+r.writeCandidate(e)+"\r\n"})),"completed"===e.iceGatherer.state&&(u+="a=end-of-candidates\r\n"))}));var f=new e.RTCSessionDescription({type:"offer",sdp:u});return Promise.resolve(f)},f.prototype.createAnswer=function(){var n=this;if(n._isClosed)return Promise.reject(s("InvalidStateError","Can not call createAnswer after close"));if("have-remote-offer"!==n.signalingState&&"have-local-pranswer"!==n.signalingState)return Promise.reject(s("InvalidStateError","Can not call createAnswer in signalingState "+n.signalingState));var a=r.writeSessionBoilerplate(n._sdpSessionId,n._sdpSessionVersion++);n.usingBundle&&(a+="a=group:BUNDLE "+n.transceivers.map((function(e){return e.mid})).join(" ")+"\r\n"),a+="a=ice-options:trickle\r\n";var c=r.getMediaSections(n._remoteDescription.sdp).length;n.transceivers.forEach((function(e,r){if(!(r+1>c)){if(e.rejected)return"application"===e.kind?"DTLS/SCTP"===e.protocol?a+="m=application 0 DTLS/SCTP 5000\r\n":a+="m=application 0 "+e.protocol+" webrtc-datachannel\r\n":"audio"===e.kind?a+="m=audio 0 UDP/TLS/RTP/SAVPF 0\r\na=rtpmap:0 PCMU/8000\r\n":"video"===e.kind&&(a+="m=video 0 UDP/TLS/RTP/SAVPF 120\r\na=rtpmap:120 VP8/90000\r\n"),void(a+="c=IN IP4 0.0.0.0\r\na=inactive\r\na=mid:"+e.mid+"\r\n");var s;if(e.stream)"audio"===e.kind?s=e.stream.getAudioTracks()[0]:"video"===e.kind&&(s=e.stream.getVideoTracks()[0]),s&&t>=15019&&"video"===e.kind&&!e.sendEncodingParameters[0].rtx&&(e.sendEncodingParameters[0].rtx={ssrc:e.sendEncodingParameters[0].ssrc+1});var u=i(e.localCapabilities,e.remoteCapabilities);!u.codecs.filter((function(e){return"rtx"===e.name.toLowerCase()})).length&&e.sendEncodingParameters[0].rtx&&delete e.sendEncodingParameters[0].rtx,a+=o(e,u,"answer",e.stream,n._dtlsRole),e.rtcpParameters&&e.rtcpParameters.reducedSize&&(a+="a=rtcp-rsize\r\n")}}));var u=new e.RTCSessionDescription({type:"answer",sdp:a});return Promise.resolve(u)},f.prototype.addIceCandidate=function(e){var t,n=this;return e&&void 0===e.sdpMLineIndex&&!e.sdpMid?Promise.reject(new TypeError("sdpMLineIndex or sdpMid required")):new Promise((function(o,i){if(!n._remoteDescription)return i(s("InvalidStateError","Can not add ICE candidate without a remote description"));if(e&&""!==e.candidate){var a=e.sdpMLineIndex;if(e.sdpMid)for(var u=0;u<n.transceivers.length;u++)if(n.transceivers[u].mid===e.sdpMid){a=u;break}var f=n.transceivers[a];if(!f)return i(s("OperationError","Can not add ICE candidate"));if(f.rejected)return o();var l=Object.keys(e.candidate).length>0?r.parseCandidate(e.candidate):{};if("tcp"===l.protocol&&(0===l.port||9===l.port))return o();if(l.component&&1!==l.component)return o();if((0===a||a>0&&f.iceTransport!==n.transceivers[0].iceTransport)&&!c(f.iceTransport,l))return i(s("OperationError","Can not add ICE candidate"));var d=e.candidate.trim();0===d.indexOf("a=")&&(d=d.substr(2)),(t=r.getMediaSections(n._remoteDescription.sdp))[a]+="a="+(l.type?d:"end-of-candidates")+"\r\n",n._remoteDescription.sdp=r.getDescription(n._remoteDescription.sdp)+t.join("")}else for(var p=0;p<n.transceivers.length&&(n.transceivers[p].rejected||(n.transceivers[p].iceTransport.addRemoteCandidate({}),(t=r.getMediaSections(n._remoteDescription.sdp))[p]+="a=end-of-candidates\r\n",n._remoteDescription.sdp=r.getDescription(n._remoteDescription.sdp)+t.join(""),!n.usingBundle));p++);o()}))},f.prototype.getStats=function(t){if(t&&t instanceof e.MediaStreamTrack){var n=null;if(this.transceivers.forEach((function(e){e.rtpSender&&e.rtpSender.track===t?n=e.rtpSender:e.rtpReceiver&&e.rtpReceiver.track===t&&(n=e.rtpReceiver)})),!n)throw s("InvalidAccessError","Invalid selector.");return n.getStats()}var r=[];return this.transceivers.forEach((function(e){["rtpSender","rtpReceiver","iceGatherer","iceTransport","dtlsTransport"].forEach((function(t){e[t]&&r.push(e[t].getStats())}))})),Promise.all(r).then((function(e){var t=new Map;return e.forEach((function(e){e.forEach((function(e){t.set(e.id,e)}))})),t}))};["RTCRtpSender","RTCRtpReceiver","RTCIceGatherer","RTCIceTransport","RTCDtlsTransport"].forEach((function(t){var n=e[t];if(n&&n.prototype&&n.prototype.getStats){var r=n.prototype.getStats;n.prototype.getStats=function(){return r.apply(this).then((function(e){var t=new Map;return Object.keys(e).forEach((function(n){var r;e[n].type={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[(r=e[n]).type]||r.type,t.set(n,e[n])})),t}))}}}));var l=["createOffer","createAnswer"];return l.forEach((function(e){var t=f.prototype[e];f.prototype[e]=function(){var e=arguments;return"function"==typeof e[0]||"function"==typeof e[1]?t.apply(this,[arguments[2]]).then((function(t){"function"==typeof e[0]&&e[0].apply(null,[t])}),(function(t){"function"==typeof e[1]&&e[1].apply(null,[t])})):t.apply(this,arguments)}})),(l=["setLocalDescription","setRemoteDescription","addIceCandidate"]).forEach((function(e){var t=f.prototype[e];f.prototype[e]=function(){var e=arguments;return"function"==typeof e[1]||"function"==typeof e[2]?t.apply(this,arguments).then((function(){"function"==typeof e[1]&&e[1].apply(null)}),(function(t){"function"==typeof e[2]&&e[2].apply(null,[t])})):t.apply(this,arguments)}})),["getStats"].forEach((function(e){var t=f.prototype[e];f.prototype[e]=function(){var e=arguments;return"function"==typeof e[1]?t.apply(this,arguments).then((function(){"function"==typeof e[1]&&e[1].apply(null)})):t.apply(this,arguments)}})),f}},CrYA:function(e,t,n){var r=n("MFOe").Global;function o(){return r.sessionStorage}function i(e){return o().getItem(e)}e.exports={name:"sessionStorage",read:i,write:function(e,t){return o().setItem(e,t)},each:function(e){for(var t=o().length-1;t>=0;t--){var n=o().key(t);e(i(n),n)}},remove:function(e){return o().removeItem(e)},clearAll:function(){return o().clear()}}},"DlR+":function(e,t,n){var r=n("MFOe"),o=r.Global,i=r.trim;e.exports={name:"cookieStorage",read:function(e){if(!e||!u(e))return null;var t="(?:^|.*;\\s*)"+escape(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";return unescape(a.cookie.replace(new RegExp(t),"$1"))},write:function(e,t){if(!e)return;a.cookie=escape(e)+"="+escape(t)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/"},each:c,remove:s,clearAll:function(){c((function(e,t){s(t)}))}};var a=o.document;function c(e){for(var t=a.cookie.split(/; ?/g),n=t.length-1;n>=0;n--)if(i(t[n])){var r=t[n].split("="),o=unescape(r[0]);e(unescape(r[1]),o)}}function s(e){e&&u(e)&&(a.cookie=escape(e)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/")}function u(e){return new RegExp("(?:^|;\\s*)"+escape(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(a.cookie)}},KCt4:function(e,t,n){"use strict";var r={generateIdentifier:function(){return Math.random().toString(36).substr(2,10)}};r.localCName=r.generateIdentifier(),r.splitLines=function(e){return e.trim().split("\n").map((function(e){return e.trim()}))},r.splitSections=function(e){return e.split("\nm=").map((function(e,t){return(t>0?"m="+e:e).trim()+"\r\n"}))},r.getDescription=function(e){var t=r.splitSections(e);return t&&t[0]},r.getMediaSections=function(e){var t=r.splitSections(e);return t.shift(),t},r.matchPrefix=function(e,t){return r.splitLines(e).filter((function(e){return 0===e.indexOf(t)}))},r.parseCandidate=function(e){for(var t,n={foundation:(t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" "))[0],component:parseInt(t[1],10),protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]},r=8;r<t.length;r+=2)switch(t[r]){case"raddr":n.relatedAddress=t[r+1];break;case"rport":n.relatedPort=parseInt(t[r+1],10);break;case"tcptype":n.tcpType=t[r+1];break;case"ufrag":n.ufrag=t[r+1],n.usernameFragment=t[r+1];break;default:n[t[r]]=t[r+1]}return n},r.writeCandidate=function(e){var t=[];t.push(e.foundation),t.push(e.component),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.address||e.ip),t.push(e.port);var n=e.type;return t.push("typ"),t.push(n),"host"!==n&&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(" ")},r.parseIceOptions=function(e){return e.substr(14).split(" ")},r.parseRtpMap=function(e){var t=e.substr(9).split(" "),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},r.writeRtpMap=function(e){var t=e.payloadType;void 0!==e.preferredPayloadType&&(t=e.preferredPayloadType);var n=e.channels||e.numChannels||1;return"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1!==n?"/"+n:"")+"\r\n"},r.parseExtmap=function(e){var t=e.substr(9).split(" ");return{id:parseInt(t[0],10),direction:t[0].indexOf("/")>0?t[0].split("/")[1]:"sendrecv",uri:t[1]}},r.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+"\r\n"},r.parseFmtp=function(e){for(var t,n={},r=e.substr(e.indexOf(" ")+1).split(";"),o=0;o<r.length;o++)n[(t=r[o].trim().split("="))[0].trim()]=t[1];return n},r.writeFmtp=function(e){var t="",n=e.payloadType;if(void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){var r=[];Object.keys(e.parameters).forEach((function(t){e.parameters[t]?r.push(t+"="+e.parameters[t]):r.push(t)})),t+="a=fmtp:"+n+" "+r.join(";")+"\r\n"}return t},r.parseRtcpFb=function(e){var t=e.substr(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},r.writeRtcpFb=function(e){var t="",n=e.payloadType;return void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach((function(e){t+="a=rtcp-fb:"+n+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"})),t},r.parseSsrcMedia=function(e){var t=e.indexOf(" "),n={ssrc:parseInt(e.substr(7,t-7),10)},r=e.indexOf(":",t);return r>-1?(n.attribute=e.substr(t+1,r-t-1),n.value=e.substr(r+1)):n.attribute=e.substr(t+1),n},r.parseSsrcGroup=function(e){var t=e.substr(13).split(" ");return{semantics:t.shift(),ssrcs:t.map((function(e){return parseInt(e,10)}))}},r.getMid=function(e){var t=r.matchPrefix(e,"a=mid:")[0];if(t)return t.substr(6)},r.parseFingerprint=function(e){var t=e.substr(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1]}},r.getDtlsParameters=function(e,t){return{role:"auto",fingerprints:r.matchPrefix(e+t,"a=fingerprint:").map(r.parseFingerprint)}},r.writeDtlsParameters=function(e,t){var n="a=setup:"+t+"\r\n";return e.fingerprints.forEach((function(e){n+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"})),n},r.parseCryptoLine=function(e){var t=e.substr(9).split(" ");return{tag:parseInt(t[0],10),cryptoSuite:t[1],keyParams:t[2],sessionParams:t.slice(3)}},r.writeCryptoLine=function(e){return"a=crypto:"+e.tag+" "+e.cryptoSuite+" "+("object"==typeof e.keyParams?r.writeCryptoKeyParams(e.keyParams):e.keyParams)+(e.sessionParams?" "+e.sessionParams.join(" "):"")+"\r\n"},r.parseCryptoKeyParams=function(e){if(0!==e.indexOf("inline:"))return null;var 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}},r.writeCryptoKeyParams=function(e){return e.keyMethod+":"+e.keySalt+(e.lifeTime?"|"+e.lifeTime:"")+(e.mkiValue&&e.mkiLength?"|"+e.mkiValue+":"+e.mkiLength:"")},r.getCryptoParameters=function(e,t){return r.matchPrefix(e+t,"a=crypto:").map(r.parseCryptoLine)},r.getIceParameters=function(e,t){var n=r.matchPrefix(e+t,"a=ice-ufrag:")[0],o=r.matchPrefix(e+t,"a=ice-pwd:")[0];return n&&o?{usernameFragment:n.substr(12),password:o.substr(10)}:null},r.writeIceParameters=function(e){return"a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n"},r.parseRtpParameters=function(e){for(var t={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},n=r.splitLines(e)[0].split(" "),o=3;o<n.length;o++){var i=n[o],a=r.matchPrefix(e,"a=rtpmap:"+i+" ")[0];if(a){var c=r.parseRtpMap(a),s=r.matchPrefix(e,"a=fmtp:"+i+" ");switch(c.parameters=s.length?r.parseFmtp(s[0]):{},c.rtcpFeedback=r.matchPrefix(e,"a=rtcp-fb:"+i+" ").map(r.parseRtcpFb),t.codecs.push(c),c.name.toUpperCase()){case"RED":case"ULPFEC":t.fecMechanisms.push(c.name.toUpperCase())}}}return r.matchPrefix(e,"a=extmap:").forEach((function(e){t.headerExtensions.push(r.parseExtmap(e))})),t},r.writeRtpDescription=function(e,t){var n="";n+="m="+e+" ",n+=t.codecs.length>0?"9":"0",n+=" UDP/TLS/RTP/SAVPF ",n+=t.codecs.map((function(e){return 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((function(e){n+=r.writeRtpMap(e),n+=r.writeFmtp(e),n+=r.writeRtcpFb(e)}));var o=0;return t.codecs.forEach((function(e){e.maxptime>o&&(o=e.maxptime)})),o>0&&(n+="a=maxptime:"+o+"\r\n"),n+="a=rtcp-mux\r\n",t.headerExtensions&&t.headerExtensions.forEach((function(e){n+=r.writeExtmap(e)})),n},r.parseRtpEncodingParameters=function(e){var t,n=[],o=r.parseRtpParameters(e),i=-1!==o.fecMechanisms.indexOf("RED"),a=-1!==o.fecMechanisms.indexOf("ULPFEC"),c=r.matchPrefix(e,"a=ssrc:").map((function(e){return r.parseSsrcMedia(e)})).filter((function(e){return"cname"===e.attribute})),s=c.length>0&&c[0].ssrc,u=r.matchPrefix(e,"a=ssrc-group:FID").map((function(e){return e.substr(17).split(" ").map((function(e){return parseInt(e,10)}))}));u.length>0&&u[0].length>1&&u[0][0]===s&&(t=u[0][1]),o.codecs.forEach((function(e){if("RTX"===e.name.toUpperCase()&&e.parameters.apt){var r={ssrc:s,codecPayloadType:parseInt(e.parameters.apt,10)};s&&t&&(r.rtx={ssrc:t}),n.push(r),i&&((r=JSON.parse(JSON.stringify(r))).fec={ssrc:s,mechanism:a?"red+ulpfec":"red"},n.push(r))}})),0===n.length&&s&&n.push({ssrc:s});var f=r.matchPrefix(e,"b=");return f.length&&(f=0===f[0].indexOf("b=TIAS:")?parseInt(f[0].substr(7),10):0===f[0].indexOf("b=AS:")?1e3*parseInt(f[0].substr(5),10)*.95-16e3:void 0,n.forEach((function(e){e.maxBitrate=f}))),n},r.parseRtcpParameters=function(e){var t={},n=r.matchPrefix(e,"a=ssrc:").map((function(e){return r.parseSsrcMedia(e)})).filter((function(e){return"cname"===e.attribute}))[0];n&&(t.cname=n.value,t.ssrc=n.ssrc);var o=r.matchPrefix(e,"a=rtcp-rsize");t.reducedSize=o.length>0,t.compound=0===o.length;var i=r.matchPrefix(e,"a=rtcp-mux");return t.mux=i.length>0,t},r.parseMsid=function(e){var t,n=r.matchPrefix(e,"a=msid:");if(1===n.length)return{stream:(t=n[0].substr(7).split(" "))[0],track:t[1]};var o=r.matchPrefix(e,"a=ssrc:").map((function(e){return r.parseSsrcMedia(e)})).filter((function(e){return"msid"===e.attribute}));return o.length>0?{stream:(t=o[0].value.split(" "))[0],track:t[1]}:void 0},r.parseSctpDescription=function(e){var t,n=r.parseMLine(e),o=r.matchPrefix(e,"a=max-message-size:");o.length>0&&(t=parseInt(o[0].substr(19),10)),isNaN(t)&&(t=65536);var i=r.matchPrefix(e,"a=sctp-port:");if(i.length>0)return{port:parseInt(i[0].substr(12),10),protocol:n.fmt,maxMessageSize:t};if(r.matchPrefix(e,"a=sctpmap:").length>0){var a=r.matchPrefix(e,"a=sctpmap:")[0].substr(10).split(" ");return{port:parseInt(a[0],10),protocol:a[1],maxMessageSize:t}}},r.writeSctpDescription=function(e,t){var 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("")},r.generateSessionId=function(){return Math.random().toString().substr(2,21)},r.writeSessionBoilerplate=function(e,t,n){var o=void 0!==t?t:2;return"v=0\r\no="+(n||"thisisadapterortc")+" "+(e||r.generateSessionId())+" "+o+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},r.writeMediaSection=function(e,t,n,o){var i=r.writeRtpDescription(e.kind,t);if(i+=r.writeIceParameters(e.iceGatherer.getLocalParameters()),i+=r.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===n?"actpass":"active"),i+="a=mid:"+e.mid+"\r\n",e.direction?i+="a="+e.direction+"\r\n":e.rtpSender&&e.rtpReceiver?i+="a=sendrecv\r\n":e.rtpSender?i+="a=sendonly\r\n":e.rtpReceiver?i+="a=recvonly\r\n":i+="a=inactive\r\n",e.rtpSender){var a="msid:"+o.id+" "+e.rtpSender.track.id+"\r\n";i+="a="+a,i+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+a,e.sendEncodingParameters[0].rtx&&(i+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+a,i+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return i+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+r.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(i+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+r.localCName+"\r\n"),i},r.getDirection=function(e,t){for(var n=r.splitLines(e),o=0;o<n.length;o++)switch(n[o]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return n[o].substr(2)}return t?r.getDirection(t):"sendrecv"},r.getKind=function(e){return r.splitLines(e)[0].split(" ")[0].substr(2)},r.isRejected=function(e){return"0"===e.split(" ",2)[1]},r.parseMLine=function(e){var t=r.splitLines(e)[0].substr(2).split(" ");return{kind:t[0],port:parseInt(t[1],10),protocol:t[2],fmt:t.slice(3).join(" ")}},r.parseOLine=function(e){var t=r.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]}},r.isValidSDP=function(e){if("string"!=typeof e||0===e.length)return!1;for(var t=r.splitLines(e),n=0;n<t.length;n++)if(t[n].length<2||"="!==t[n].charAt(1))return!1;return!0},e.exports=r},MFOe:function(e,t,n){(function(t){var n=Object.assign?Object.assign:function(e,t,n,r){for(var o=1;o<arguments.length;o++)c(Object(arguments[o]),(function(t,n){e[n]=t}));return e},r=function(){if(Object.create)return function(e,t,r,o){var i=a(arguments,1);return n.apply(this,[Object.create(e)].concat(i))};{function e(){}return function(t,r,o,i){var c=a(arguments,1);return e.prototype=t,n.apply(this,[new e].concat(c))}}}(),o=String.prototype.trim?function(e){return String.prototype.trim.call(e)}:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},i="undefined"!=typeof window?window:t;function a(e,t){return Array.prototype.slice.call(e,t||0)}function c(e,t){s(e,(function(e,n){return t(e,n),!1}))}function s(e,t){if(u(e)){for(var n=0;n<e.length;n++)if(t(e[n],n))return e[n]}else for(var r in e)if(e.hasOwnProperty(r)&&t(e[r],r))return e[r]}function u(e){return null!=e&&"function"!=typeof e&&"number"==typeof e.length}e.exports={assign:n,create:r,trim:o,bind:function(e,t){return function(){return t.apply(e,Array.prototype.slice.call(arguments,0))}},slice:a,each:c,map:function(e,t){var n=u(e)?[]:{};return s(e,(function(e,r){return n[r]=t(e,r),!1})),n},pluck:s,isList:u,isFunction:function(e){return e&&"[object Function]"==={}.toString.call(e)},isObject:function(e){return e&&"[object Object]"==={}.toString.call(e)},Global:i}}).call(this,n("yLpj"))},PD8m:function(e,t){e.exports={name:"memoryStorage",read:function(e){return n[e]},write:function(e,t){n[e]=t},each:function(e){for(var t in n)n.hasOwnProperty(t)&&e(n[t],t)},remove:function(e){delete n[e]},clearAll:function(e){n={}}};var n={}},RELg:function(e,t,n){var r=n("MFOe").Global;e.exports={name:"oldIE-userDataStorage",write:function(e,t){if(a)return;var n=s(e);i((function(e){e.setAttribute(n,t),e.save("storejs")}))},read:function(e){if(a)return;var t=s(e),n=null;return i((function(e){n=e.getAttribute(t)})),n},each:function(e){i((function(t){for(var n=t.XMLDocument.documentElement.attributes,r=n.length-1;r>=0;r--){var o=n[r];e(t.getAttribute(o.name),o.name)}}))},remove:function(e){var t=s(e);i((function(e){e.removeAttribute(t),e.save("storejs")}))},clearAll:function(){i((function(e){var t=e.XMLDocument.documentElement.attributes;e.load("storejs");for(var n=t.length-1;n>=0;n--)e.removeAttribute(t[n].name);e.save("storejs")}))}};var o=r.document,i=function(){if(!o||!o.documentElement||!o.documentElement.addBehavior)return null;var e,t,n;try{(t=new ActiveXObject("htmlfile")).open(),t.write('<script>document.w=window<\/script><iframe src="/favicon.ico"></iframe>'),t.close(),e=t.w.frames[0].document,n=e.createElement("div")}catch(t){n=o.createElement("div"),e=o.body}return function(t){var r=[].slice.call(arguments,0);r.unshift(n),e.appendChild(n),n.addBehavior("#default#userData"),n.load("storejs"),t.apply(this,r),e.removeChild(n)}}(),a=(r.navigator?r.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./);var c=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function s(e){return e.replace(/^\d/,"___$&").replace(c,"___")}},gRFJ:function(e,t,n){e.exports=[n("rdUC"),n("ynwM"),n("RELg"),n("DlR+"),n("CrYA"),n("PD8m")]},gaXo:function(module,exports){"object"!=typeof JSON&&(JSON={}),function(){"use strict";var rx_one=/^[\],:{}\s]*$/,rx_two=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,rx_three=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,rx_four=/(?:^|:|,)(?:\s*\[)+/g,rx_escapable=/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,rx_dangerous=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta,rep;function f(e){return e<10?"0"+e:e}function this_value(){return this.valueOf()}function quote(e){return rx_escapable.lastIndex=0,rx_escapable.test(e)?'"'+e.replace(rx_escapable,(function(e){var t=meta[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+e+'"'}function str(e,t){var n,r,o,i,a,c=gap,s=t[e];switch(s&&"object"==typeof s&&"function"==typeof s.toJSON&&(s=s.toJSON(e)),"function"==typeof rep&&(s=rep.call(t,e,s)),typeof s){case"string":return quote(s);case"number":return isFinite(s)?String(s):"null";case"boolean":case"null":return String(s);case"object":if(!s)return"null";if(gap+=indent,a=[],"[object Array]"===Object.prototype.toString.apply(s)){for(i=s.length,n=0;n<i;n+=1)a[n]=str(n,s)||"null";return o=0===a.length?"[]":gap?"[\n"+gap+a.join(",\n"+gap)+"\n"+c+"]":"["+a.join(",")+"]",gap=c,o}if(rep&&"object"==typeof rep)for(i=rep.length,n=0;n<i;n+=1)"string"==typeof rep[n]&&(o=str(r=rep[n],s))&&a.push(quote(r)+(gap?": ":":")+o);else for(r in s)Object.prototype.hasOwnProperty.call(s,r)&&(o=str(r,s))&&a.push(quote(r)+(gap?": ":":")+o);return o=0===a.length?"{}":gap?"{\n"+gap+a.join(",\n"+gap)+"\n"+c+"}":"{"+a.join(",")+"}",gap=c,o}}"function"!=typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},Boolean.prototype.toJSON=this_value,Number.prototype.toJSON=this_value,String.prototype.toJSON=this_value),"function"!=typeof JSON.stringify&&(meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},JSON.stringify=function(e,t,n){var r;if(gap="",indent="","number"==typeof n)for(r=0;r<n;r+=1)indent+=" ";else"string"==typeof n&&(indent=n);if(rep=t,t&&"function"!=typeof t&&("object"!=typeof t||"number"!=typeof t.length))throw new Error("JSON.stringify");return str("",{"":e})}),"function"!=typeof JSON.parse&&(JSON.parse=function(text,reviver){var j;function walk(e,t){var n,r,o=e[t];if(o&&"object"==typeof o)for(n in o)Object.prototype.hasOwnProperty.call(o,n)&&(void 0!==(r=walk(o,n))?o[n]=r:delete o[n]);return reviver.call(e,t,o)}if(text=String(text),rx_dangerous.lastIndex=0,rx_dangerous.test(text)&&(text=text.replace(rx_dangerous,(function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}))),rx_one.test(text.replace(rx_two,"@").replace(rx_three,"]").replace(rx_four,"")))return j=eval("("+text+")"),"function"==typeof reviver?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}()},je13:function(e,t,n){var r=n("5nXd"),o=n("gRFJ"),i=[n("uQRt")];e.exports=r.createStore(o,i)},rdUC:function(e,t,n){var r=n("MFOe").Global;function o(){return r.localStorage}function i(e){return o().getItem(e)}e.exports={name:"localStorage",read:i,write:function(e,t){return o().setItem(e,t)},each:function(e){for(var t=o().length-1;t>=0;t--){var n=o().key(t);e(i(n),n)}},remove:function(e){return o().removeItem(e)},clearAll:function(){return o().clear()}}},uQRt:function(e,t,n){e.exports=function(){return n("gaXo"),{}}},viyd:function(e,t,n){window,e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},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 r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},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=87)}([function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(t)}e.exports=n},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}},function(e,t,n){var r=n(19),o=n(1);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?o(e):t}},function(e,t,n){var r=n(222);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}},function(e,t,n){e.exports={EPSILON:n(61),create:n(62),clone:n(154),fromValues:n(155),copy:n(156),set:n(157),equals:n(158),exactEquals:n(159),add:n(160),subtract:n(63),sub:n(161),multiply:n(64),mul:n(162),divide:n(65),div:n(163),inverse:n(164),min:n(165),max:n(166),rotate:n(167),floor:n(168),ceil:n(169),round:n(170),scale:n(171),scaleAndAdd:n(172),distance:n(66),dist:n(173),squaredDistance:n(67),sqrDist:n(174),length:n(68),len:n(175),squaredLength:n(69),sqrLen:n(176),negate:n(177),normalize:n(178),dot:n(179),cross:n(180),lerp:n(181),random:n(182),transformMat2:n(183),transformMat2d:n(184),transformMat3:n(185),transformMat4:n(186),forEach:n(187),limit:n(188)}},function(e,t,n){"use strict";t.a={init:function(e,t){for(var n=e.length;n--;)e[n]=t},shuffle:function(e){for(var t=e.length-1;t>=0;t--){var n=Math.floor(Math.random()*t),r=e[t];e[t]=e[n],e[n]=r}return e},toPointList:function(e){var t=e.reduce((function(e,t){var n="[".concat(t.join(","),"]");return e.push(n),e}),[]);return"[".concat(t.join(",\r\n"),"]")},threshold:function(e,t,n){return e.reduce((function(r,o){return n.apply(e,[o])>=t&&r.push(o),r}),[])},maxIndex:function(e){for(var t=0,n=0;n<e.length;n++)e[n]>e[t]&&(t=n);return t},max:function(e){for(var t=0,n=0;n<e.length;n++)e[n]>t&&(t=e[n]);return t},sum:function(e){for(var t=e.length,n=0;t--;)n+=e[t];return n}}},function(e,t,n){"use strict";n.d(t,"h",(function(){return l})),n.d(t,"i",(function(){return p})),n.d(t,"b",(function(){return h})),n.d(t,"j",(function(){return v})),n.d(t,"e",(function(){return m})),n.d(t,"c",(function(){return g})),n.d(t,"f",(function(){return y})),n.d(t,"g",(function(){return b})),n.d(t,"a",(function(){return x})),n.d(t,"d",(function(){return S}));var r=n(7),o=n(83),i={clone:r.clone,dot:r.dot},a=function(e,t){var n=[],r={rad:0,vec:i.clone([0,0])},o={};function a(e){o[e.id]=e,n.push(e)}function c(){var e,t=0;for(e=0;e<n.length;e++)t+=n[e].rad;r.rad=t/n.length,r.vec=i.clone([Math.cos(r.rad),Math.sin(r.rad)])}return a(e),c(),{add:function(e){o[e.id]||(a(e),c())},fits:function(e){return Math.abs(i.dot(e.point.vec,r.vec))>t},getPoints:function(){return n},getCenter:function(){return r}}},c=function(e,t,n){return{rad:e[n],point:e,id:t}},s=n(8),u={clone:r.clone},f={clone:o.clone};function l(e,t){return{x:e,y:t,toVec2:function(){return u.clone([this.x,this.y])},toVec3:function(){return f.clone([this.x,this.y,1])},round:function(){return this.x=this.x>0?Math.floor(this.x+.5):Math.floor(this.x-.5),this.y=this.y>0?Math.floor(this.y+.5):Math.floor(this.y-.5),this}}}function d(e,t){t||(t=8);for(var n=e.data,r=n.length,o=8-t,i=new Int32Array(1<<t);r--;)i[n[r]>>o]++;return i}function p(e,t){var n=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,r=8-n;function o(e,n){for(var r=0,o=e;o<=n;o++)r+=t[o];return r}function i(e,n){for(var r=0,o=e;o<=n;o++)r+=o*t[o];return r}function a(){var r,a,c,u,f=[0],l=(1<<n)-1;t=d(e,n);for(var p=1;p<l;p++)0==(c=(r=o(0,p))*(a=o(p+1,l)))&&(c=1),u=i(0,p)*a-i(p+1,l)*r,f[p]=u*u/c;return s.a.maxIndex(f)}var c=a();return c<<r}(e);return function(e,t,n){n||(n=e);for(var r=e.data,o=r.length,i=n.data;o--;)i[o]=r[o]<t?1:0}(e,n,t),n}function h(e,t,n){var r,o,i,s,u=[];function f(e){var t=!1;for(o=0;o<u.length;o++)(i=u[o]).fits(e)&&(i.add(e),t=!0);return t}for(n||(n="rad"),r=0;r<e.length;r++)f(s=c(e[r],r,n))||u.push(a(s,t));return u}function v(e,t,n){var r,o,i,a,c=0,s=0,u=[];for(r=0;r<t;r++)u[r]={score:0,item:null};for(r=0;r<e.length;r++)if((o=n.apply(this,[e[r]]))>s)for((i=u[c]).score=o,i.item=e[r],s=Number.MAX_VALUE,a=0;a<t;a++)u[a].score<s&&(s=u[a].score,c=a);return u}function m(e,t,n){for(var r,o=0,i=t.x,a=Math.floor(e.length/4),c=t.x/2,s=0,u=t.x;i<a;){for(r=0;r<c;r++)n[s]=(.299*e[4*o+0]+.587*e[4*o+1]+.114*e[4*o+2]+(.299*e[4*(o+1)+0]+.587*e[4*(o+1)+1]+.114*e[4*(o+1)+2])+(.299*e[4*i+0]+.587*e[4*i+1]+.114*e[4*i+2])+(.299*e[4*(i+1)+0]+.587*e[4*(i+1)+1]+.114*e[4*(i+1)+2]))/4,s++,o+=2,i+=2;o+=u,i+=u}}function g(e,t,n){var r=e.length/4|0;if(n&&!0===n.singleChannel)for(var o=0;o<r;o++)t[o]=e[4*o+0];else for(var i=0;i<r;i++)t[i]=.299*e[4*i+0]+.587*e[4*i+1]+.114*e[4*i+2]}function y(e,t){for(var n=e.data,r=e.size.x,o=t.data,i=0,a=r,c=n.length,s=r/2,u=0;a<c;){for(var f=0;f<s;f++)o[u]=Math.floor((n[i]+n[i+1]+n[a]+n[a+1])/4),u++,i+=2,a+=2;i+=r,a+=r}}function b(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0],n=e[0],r=e[1],o=e[2],i=o*r,a=i*(1-Math.abs(n/60%2-1)),c=o-i,s=0,u=0,f=0;return n<60?(s=i,u=a):n<120?(s=a,u=i):n<180?(u=i,f=a):n<240?(u=a,f=i):n<300?(s=a,f=i):n<360&&(s=i,f=a),t[0]=255*(s+c)|0,t[1]=255*(u+c)|0,t[2]=255*(f+c)|0,t}function _(e){for(var t=[],n=[],r=1;r<Math.sqrt(e)+1;r++)e%r==0&&(n.push(r),r!==e/r&&t.unshift(Math.floor(e/r)));return n.concat(t)}function x(e,t){var n,r=_(t.x),o=_(t.y),i=Math.max(t.x,t.y),a=function(e,t){for(var n=0,r=0,o=[];n<e.length&&r<t.length;)e[n]===t[r]?(o.push(e[n]),n++,r++):e[n]>t[r]?r++:n++;return o}(r,o),c=[8,10,15,20,32,60,80],s={"x-small":5,small:4,medium:3,large:2,"x-large":1},u=s[e]||s.medium,f=c[u],l=Math.floor(i/f);function d(e){for(var t=0,n=e[Math.floor(e.length/2)];t<e.length-1&&e[t]<l;)t++;return t>0&&(n=Math.abs(e[t]-l)>Math.abs(e[t-1]-l)?e[t-1]:e[t]),l/n<c[u+1]/c[u]&&l/n>c[u-1]/c[u]?{x:n,y:n}:null}return(n=d(a))||(n=d(_(i)))||(n=d(_(l*f))),n}var C={top:function(e,t){return"%"===e.unit?Math.floor(t.height*(e.value/100)):null},right:function(e,t){return"%"===e.unit?Math.floor(t.width-t.width*(e.value/100)):null},bottom:function(e,t){return"%"===e.unit?Math.floor(t.height-t.height*(e.value/100)):null},left:function(e,t){return"%"===e.unit?Math.floor(t.width*(e.value/100)):null}};function S(e,t,n){var r={width:e,height:t},o=Object.keys(n).reduce((function(e,t){var o=function(e){return{value:parseFloat(e),unit:(e.indexOf("%"),e.length,"%")}}(n[t]),i=C[t](o,r);return e[t]=i,e}),{});return{sx:o.left,sy:o.top,sw:o.right-o.left,sh:o.bottom-o.top}}},function(e,t,n){"use strict";var r=n(82),o=n.n(r),i=n(3),a=n.n(i),c=n(4),s=n.n(c),u=n(0),f=n.n(u),l=n(7),d=n(9),p=n(8),h={clone:l.clone};function v(e){if(e<0)throw new Error("expected positive number, received ".concat(e))}var m=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Uint8Array,o=arguments.length>3?arguments[3]:void 0;a()(this,e),f()(this,"data",void 0),f()(this,"size",void 0),f()(this,"indexMapping",void 0),n?this.data=n:(this.data=new r(t.x*t.y),o&&p.a.init(this.data,0)),this.size=t}return s()(e,[{key:"inImageWithBorder",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return v(t),e.x>=0&&e.y>=0&&e.x<this.size.x+2*t&&e.y<this.size.y+2*t}},{key:"subImageAsCopy",value:function(e,t){v(t.x),v(t.y);for(var n=e.size,r=n.x,o=n.y,i=0;i<r;i++)for(var a=0;a<o;a++)e.data[a*r+i]=this.data[(t.y+a)*this.size.x+t.x+i];return e}},{key:"get",value:function(e,t){return this.data[t*this.size.x+e]}},{key:"getSafe",value:function(e,t){if(!this.indexMapping){this.indexMapping={x:[],y:[]};for(var n=0;n<this.size.x;n++)this.indexMapping.x[n]=n,this.indexMapping.x[n+this.size.x]=n;for(var r=0;r<this.size.y;r++)this.indexMapping.y[r]=r,this.indexMapping.y[r+this.size.y]=r}return this.data[this.indexMapping.y[t+this.size.y]*this.size.x+this.indexMapping.x[e+this.size.x]]}},{key:"set",value:function(e,t,n){return this.data[t*this.size.x+e]=n,delete this.indexMapping,this}},{key:"zeroBorder",value:function(){for(var e=this.size,t=e.x,n=e.y,r=0;r<t;r++)this.data[r]=this.data[(n-1)*t+r]=0;for(var o=1;o<n-1;o++)this.data[o*t]=this.data[o*t+(t-1)]=0;return delete this.indexMapping,this}},{key:"moments",value:function(e){var t,n,r,o,i,a,c,s,u,f,l=this.data,d=this.size.y,p=this.size.x,v=[],m=[],g=Math.PI,y=g/4;if(e<=0)return m;for(i=0;i<e;i++)v[i]={m00:0,m01:0,m10:0,m11:0,m02:0,m20:0,theta:0,rad:0};for(n=0;n<d;n++)for(o=n*n,t=0;t<p;t++)(r=l[n*p+t])>0&&((a=v[r-1]).m00+=1,a.m01+=n,a.m10+=t,a.m11+=t*n,a.m02+=o,a.m20+=t*t);for(i=0;i<e;i++)a=v[i],isNaN(a.m00)||0===a.m00||(s=a.m10/a.m00,u=a.m01/a.m00,c=a.m11/a.m00-s*u,f=(a.m02/a.m00-u*u-(a.m20/a.m00-s*s))/(2*c),f=.5*Math.atan(f)+(c>=0?y:-y)+g,a.theta=(180*f/g+90)%180-90,a.theta<0&&(a.theta+=180),a.rad=f>g?f-g:f,a.vec=h.clone([Math.cos(f),Math.sin(f)]),m.push(a));return m}},{key:"getAsRGBA",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=new Uint8ClampedArray(4*this.size.x*this.size.y),n=0;n<this.size.y;n++)for(var r=0;r<this.size.x;r++){var o=n*this.size.x+r,i=this.get(r,n)*e;t[4*o+0]=i,t[4*o+1]=i,t[4*o+2]=i,t[4*o+3]=255}return t}},{key:"show",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=e.getContext("2d");if(!n)throw new Error("Unable to get canvas context");var r=n.getImageData(0,0,e.width,e.height),o=this.getAsRGBA(t);e.width=this.size.x,e.height=this.size.y;var i=new ImageData(o,r.width,r.height);n.putImageData(i,0,0)}},{key:"overlay",value:function(e,t,n){var r=t<0||t>360?360:t,i=[0,1,1],a=[0,0,0],c=[255,255,255],s=[0,0,0],u=e.getContext("2d");if(!u)throw new Error("Unable to get canvas context");for(var f=u.getImageData(n.x,n.y,this.size.x,this.size.y),l=f.data,p=this.data.length;p--;){i[0]=this.data[p]*r;var h=4*p,v=i[0]<=0?c:i[0]>=360?s:Object(d.g)(i,a),m=o()(v,3);l[h]=m[0],l[h+1]=m[1],l[h+2]=m[2],l[h+3]=255}u.putImageData(f,n.x,n.y)}}]),e}();t.a=m},function(e,t,n){e.exports=n(227)},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t){var n=Array.isArray;e.exports=n},function(e,t,n){"use strict";t.a={drawRect:function(e,t,n,r){n.strokeStyle=r.color,n.fillStyle=r.color,n.lineWidth=r.lineWidth||1,n.beginPath(),n.strokeRect(e.x,e.y,t.x,t.y)},drawPath:function(e,t,n,r){n.strokeStyle=r.color,n.fillStyle=r.color,n.lineWidth=r.lineWidth,n.beginPath(),n.moveTo(e[0][t.x],e[0][t.y]);for(var o=1;o<e.length;o++)n.lineTo(e[o][t.x],e[o][t.y]);n.closePath(),n.stroke()},drawImage:function(e,t,n){var r=n.getImageData(0,0,t.x,t.y),o=r.data,i=o.length,a=e.length;if(i/a!=4)return!1;for(;a--;){var c=e[a];o[--i]=255,o[--i]=c,o[--i]=c,o[--i]=c}return n.putImageData(r,0,0),!0}}},function(e,t,n){var r=n(88),o=n(143)((function(e,t,n){r(e,t,n)}));e.exports=o},function(e,t,n){var r=n(226);function o(t,n,i){return"undefined"!=typeof Reflect&&Reflect.get?e.exports=o=Reflect.get:e.exports=o=function(e,t,n){var o=r(e,t);if(o){var i=Object.getOwnPropertyDescriptor(o,t);return i.get?i.get.call(n):i.value}},o(t,n,i||t)}e.exports=o},function(e,t,n){var r=n(44),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();e.exports=i},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=n=function(e){return typeof e}:e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(t)}e.exports=n},function(e,t){function n(e,t,n,r,o,i,a){try{var c=e[i](a),s=c.value}catch(e){return void n(e)}c.done?t(s):Promise.resolve(s).then(r,o)}e.exports=function(e){return function(){var t=this,r=arguments;return new Promise((function(o,i){var a=e.apply(t,r);function c(e){n(a,o,i,c,s,"next",e)}function s(e){n(a,o,i,c,s,"throw",e)}c(void 0)}))}}},function(e,t,n){"use strict";t.a={searchDirections:[[0,1],[1,1],[1,0],[1,-1],[0,-1],[-1,-1],[-1,0],[-1,1]],create:function(e,t){var n,r=e.data,o=t.data,i=this.searchDirections,a=e.size.x;function c(e,t,c,s){var u,f,l;for(u=0;u<7;u++){if(f=e.cy+i[e.dir][0],l=e.cx+i[e.dir][1],r[n=f*a+l]===t&&(0===o[n]||o[n]===c))return o[n]=c,e.cy=f,e.cx=l,!0;0===o[n]&&(o[n]=s),e.dir=(e.dir+1)%8}return!1}function s(e,t,n){return{dir:n,x:e,y:t,next:null,prev:null}}return{trace:function(e,t,n,r){return c(e,t,n,r)},contourTracing:function(e,t,n,r,o){return function(e,t,n,r,o){var i,a,u,f=null,l={cx:t,cy:e,dir:0};if(c(l,r,n,o)){i=f=s(t,e,l.dir),u=l.dir,(a=s(l.cx,l.cy,0)).prev=i,i.next=a,a.next=null,i=a;do{l.dir=(l.dir+6)%8,c(l,r,n,o),u!==l.dir?(i.dir=l.dir,(a=s(l.cx,l.cy,0)).prev=i,i.next=a,a.next=null,i=a):(i.dir=u,i.x=l.cx,i.y=l.cy),u=l.dir}while(l.cx!==t||l.cy!==e);f.prev=i.prev,i.prev.next=f}return f}(e,t,n,r,o)}}}}},function(e,t,n){var r=n(27),o=n(101),i=n(102),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?o(e):i(e)}},function(e,t,n){"use strict";(function(e){var r,o,i,a,c,s,u,f,l,d,p,h,v=n(7),m=n(34),g=n(10),y=n(9),b=n(8),_=(n(14),n(85)),x=n(21),C=n(86),S={ctx:{binary:null},dom:{binary:null}},w={x:0,y:0};function R(e){var t,n,o,i,a,c,s,u=l.size.x,f=l.size.y,d=-l.size.x,p=-l.size.y;for(t=0,n=0;n<e.length;n++)t+=(i=e[n]).rad;for((t=(180*(t/=e.length)/Math.PI+90)%180-90)<0&&(t+=180),t=(180-t)*Math.PI/180,a=m.copy(m.create(),[Math.cos(t),Math.sin(t),-Math.sin(t),Math.cos(t)]),n=0;n<e.length;n++)for(i=e[n],o=0;o<4;o++)v.transformMat2(i.box[o],i.box[o],a);for(n=0;n<e.length;n++)for(i=e[n],o=0;o<4;o++)i.box[o][0]<u&&(u=i.box[o][0]),i.box[o][0]>d&&(d=i.box[o][0]),i.box[o][1]<f&&(f=i.box[o][1]),i.box[o][1]>p&&(p=i.box[o][1]);for(c=[[u,f],[d,f],[d,p],[u,p]],s=r.halfSample?2:1,a=m.invert(a,a),o=0;o<4;o++)v.transformMat2(c[o],c[o],a);for(o=0;o<4;o++)v.scale(c[o],c[o],s);return c}function T(e,t){l.subImageAsCopy(a,Object(y.h)(e,t)),h.skeletonize()}function E(e,t,n,r){var o,i,c,s,u=[],f=[],l=Math.ceil(d.x/3);if(e.length>=2){for(o=0;o<e.length;o++)e[o].m00>l&&u.push(e[o]);if(u.length>=2){for(c=function(e){var t=Object(y.b)(e,.9),n=Object(y.j)(t,1,(function(e){return e.getPoints().length})),r=[],o=[];if(1===n.length){r=n[0].item.getPoints();for(var i=0;i<r.length;i++)o.push(r[i].point)}return o}(u),i=0,o=0;o<c.length;o++)i+=c[o].rad;c.length>1&&c.length>=u.length/4*3&&c.length>e.length/4&&(i/=c.length,s={index:t[1]*w.x+t[0],pos:{x:n,y:r},box:[v.clone([n,r]),v.clone([n+a.size.x,r]),v.clone([n+a.size.x,r+a.size.y]),v.clone([n,r+a.size.y])],moments:c,rad:i,vec:v.clone([Math.cos(i),Math.sin(i)])},f.push(s))}}return f}t.a={init:function(t,n){r=n,p=t,function(){o=r.halfSample?new g.a({x:p.size.x/2|0,y:p.size.y/2|0}):p,d=Object(y.a)(r.patchSize,o.size),w.x=o.size.x/d.x|0,w.y=o.size.y/d.y|0,l=new g.a(o.size,void 0,Uint8Array,!1),c=new g.a(d,void 0,Array,!0);var t=new ArrayBuffer(65536);a=new g.a(d,new Uint8Array(t,0,d.x*d.y)),i=new g.a(d,new Uint8Array(t,d.x*d.y*3,d.x*d.y),void 0,!0),h=Object(C.a)("undefined"!=typeof window?window:"undefined"!=typeof self?self:e,{size:d.x},t),f=new g.a({x:o.size.x/a.size.x|0,y:o.size.y/a.size.y|0},void 0,Array,!0),s=new g.a(f.size,void 0,void 0,!0),u=new g.a(f.size,void 0,Int32Array,!0)}(),r.useWorker||"undefined"==typeof document||(S.dom.binary=document.createElement("canvas"),S.dom.binary.className="binaryBuffer",S.ctx.binary=S.dom.binary.getContext("2d"),S.dom.binary.width=l.size.x,S.dom.binary.height=l.size.y)},locate:function(){r.halfSample&&Object(y.f)(p,o),Object(y.i)(o,l),l.zeroBorder();var e=function(){var e,t,n,r,o,s,u=[];for(e=0;e<w.x;e++)for(t=0;t<w.y;t++)T(n=a.size.x*e,r=a.size.y*t),i.zeroBorder(),b.a.init(c.data,0),s=_.a.create(i,c).rasterize(0),o=c.moments(s.count),u=u.concat(E(o,[e,t],n,r));return u}();if(e.length<w.x*w.y*.05)return null;var t=function(e){var t,n,r=0,o=0;function i(){var e;for(e=0;e<u.data.length;e++)if(0===u.data[e]&&1===s.data[e])return e;return u.length}function a(e){var t,n,o,i,c,l=e%u.size.x,d=e/u.size.x|0;if(e<u.data.length)for(o=f.data[e],u.data[e]=r,c=0;c<x.a.searchDirections.length;c++)n=d+x.a.searchDirections[c][0],t=l+x.a.searchDirections[c][1],i=n*u.size.x+t,0!==s.data[i]?0===u.data[i]&&Math.abs(v.dot(f.data[i].vec,o.vec))>.95&&a(i):u.data[i]=Number.MAX_VALUE}for(b.a.init(s.data,0),b.a.init(u.data,0),b.a.init(f.data,null),t=0;t<e.length;t++)n=e[t],f.data[n.index]=n,s.data[n.index]=1;for(s.zeroBorder();(o=i())<u.data.length;)r++,a(o);return r}(e);if(t<1)return null;var n=function(e){var t,n,r=[];for(t=0;t<e;t++)r.push(0);for(n=u.data.length;n--;)u.data[n]>0&&r[u.data[n]-1]++;return(r=r.map((function(e,t){return{val:e,label:t+1}}))).sort((function(e,t){return t.val-e.val})),r.filter((function(e){return e.val>=5}))}(t);return 0===n.length?null:function(e,t){var n,r,o,i,a=[],c=[];for(n=0;n<e.length;n++){for(r=u.data.length,a.length=0;r--;)u.data[r]===e[n].label&&(o=f.data[r],a.push(o));(i=R(a))&&c.push(i)}return c}(n)},checkImageConstraints:function(e,t){var n,r,o=e.getWidth(),i=e.getHeight(),a=t.halfSample?.5:1;e.getConfig().area&&(r=Object(y.d)(o,i,e.getConfig().area),e.setTopRight({x:r.sx,y:r.sy}),e.setCanvasSize({x:o,y:i}),o=r.sw,i=r.sh);var c={x:Math.floor(o*a),y:Math.floor(i*a)};if(n=Object(y.a)(t.patchSize,c),e.setWidth(Math.floor(Math.floor(c.x/n.x)*(1/a)*n.x)),e.setHeight(Math.floor(Math.floor(c.y/n.y)*(1/a)*n.y)),e.getWidth()%n.x==0&&e.getHeight()%n.y==0)return!0;throw new Error("Image dimensions do not comply with the current settings: Width (".concat(o," )and height (").concat(i,") must a multiple of ").concat(n.x))}}}).call(this,n(45))},function(e,t,n){var r=n(90),o=n(91),i=n(92),a=n(93),c=n(94);function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=r,s.prototype.delete=o,s.prototype.get=i,s.prototype.has=a,s.prototype.set=c,e.exports=s},function(e,t,n){var r=n(26);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t,n){var r=n(17).Symbol;e.exports=r},function(e,t,n){var r=n(35)(Object,"create");e.exports=r},function(e,t,n){var r=n(115);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},function(e,t,n){var r=n(130),o=n(18),i=Object.prototype,a=i.hasOwnProperty,c=i.propertyIsEnumerable,s=r(function(){return arguments}())?r:function(e){return o(e)&&a.call(e,"callee")&&!c.call(e,"callee")};e.exports=s},function(e,t){var n=/^(?:0|[1-9]\d*)$/;e.exports=function(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&n.test(e))&&e>-1&&e%1==0&&e<t}},function(e,t,n){var r=n(13),o=n(231),i=n(232),a=n(235);e.exports=function(e,t){return r(e)?e:o(e,t)?[e]:i(a(e))}},function(e,t,n){var r=n(223),o=n(224),i=n(59),a=n(225);e.exports=function(e){return r(e)||o(e)||i(e)||a()}},function(e,t,n){e.exports={determinant:n(247),transpose:n(248),multiply:n(249),identity:n(250),adjoint:n(251),rotate:n(252),invert:n(253),create:n(254),scale:n(255),copy:n(256),frob:n(257),ldu:n(258)}},function(e,t,n){var r=n(100),o=n(106);e.exports=function(e,t){var n=o(e,t);return r(n)?n:void 0}},function(e,t,n){var r=n(22),o=n(12);e.exports=function(e){if(!o(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},function(e,t,n){var r=n(48);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},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,n){var r=n(36),o=n(40);e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},function(e,t){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},function(e,t,n){var r=n(22),o=n(18);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}},function(e,t,n){var r=n(41);e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},function(e,t,n){var r=n(35)(n(17),"Map");e.exports=r},function(e,t,n){(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.exports=n}).call(this,n(45))},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){var r=n(107),o=n(114),i=n(116),a=n(117),c=n(118);function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=r,s.prototype.delete=o,s.prototype.get=i,s.prototype.has=a,s.prototype.set=c,e.exports=s},function(e,t,n){var r=n(37),o=n(26);e.exports=function(e,t,n){(void 0!==n&&!o(e[t],n)||void 0===n&&!(t in e))&&r(e,t,n)}},function(e,t,n){var r=n(35),o=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=o},function(e,t,n){var r=n(129)(Object.getPrototypeOf,Object);e.exports=r},function(e,t){var n=Object.prototype;e.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}},function(e,t,n){(function(e){var r=n(17),o=n(132),i=t&&!t.nodeType&&t,a=i&&"object"==typeof e&&e&&!e.nodeType&&e,c=a&&a.exports===i?r.Buffer:void 0,s=(c?c.isBuffer:void 0)||o;e.exports=s}).call(this,n(38)(e))},function(e,t,n){var r=n(134),o=n(135),i=n(136),a=i&&i.isTypedArray,c=a?o(a):r;e.exports=c},function(e,t){e.exports=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}},function(e,t,n){var r=n(37),o=n(26),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var a=e[t];i.call(e,t)&&o(a,n)&&(void 0!==n||t in e)||r(e,t,n)}},function(e,t,n){var r=n(139),o=n(141),i=n(39);e.exports=function(e){return i(e)?r(e,!0):o(e)}},function(e,t){e.exports=function(e){return e}},function(e,t,n){var r=n(145),o=Math.max;e.exports=function(e,t,n){return t=o(void 0===t?e.length-1:t,0),function(){for(var i=arguments,a=-1,c=o(i.length-t,0),s=Array(c);++a<c;)s[a]=i[t+a];a=-1;for(var u=Array(t+1);++a<t;)u[a]=i[a];return u[t]=n(s),r(e,this,u)}}},function(e,t,n){var r=n(146),o=n(148)(r);e.exports=o},function(e,t,n){var r=n(60);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}},function(e,t){e.exports=1e-6},function(e,t){e.exports=function(){var e=new Float32Array(2);return e[0]=0,e[1]=0,e}},function(e,t){e.exports=function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}},function(e,t){e.exports=function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e}},function(e,t){e.exports=function(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e}},function(e,t){e.exports=function(e,t){var n=t[0]-e[0],r=t[1]-e[1];return Math.sqrt(n*n+r*r)}},function(e,t){e.exports=function(e,t){var n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}},function(e,t){e.exports=function(e){var t=e[0],n=e[1];return Math.sqrt(t*t+n*n)}},function(e,t){e.exports=function(e){var t=e[0],n=e[1];return t*t+n*n}},function(e,t){e.exports=1e-6},function(e,t){e.exports=function(){var e=new Float32Array(3);return e[0]=0,e[1]=0,e[2]=0,e}},function(e,t){e.exports=function(e,t,n){var r=new Float32Array(3);return r[0]=e,r[1]=t,r[2]=n,r}},function(e,t){e.exports=function(e,t){var n=t[0],r=t[1],o=t[2],i=n*n+r*r+o*o;return i>0&&(i=1/Math.sqrt(i),e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i),e}},function(e,t){e.exports=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}},function(e,t){e.exports=function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}},function(e,t){e.exports=function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}},function(e,t){e.exports=function(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e}},function(e,t){e.exports=function(e,t){var n=t[0]-e[0],r=t[1]-e[1],o=t[2]-e[2];return Math.sqrt(n*n+r*r+o*o)}},function(e,t){e.exports=function(e,t){var n=t[0]-e[0],r=t[1]-e[1],o=t[2]-e[2];return n*n+r*r+o*o}},function(e,t){e.exports=function(e){var t=e[0],n=e[1],r=e[2];return Math.sqrt(t*t+n*n+r*r)}},function(e,t){e.exports=function(e){var t=e[0],n=e[1],r=e[2];return t*t+n*n+r*r}},function(e,t,n){var r=n(151),o=n(152),i=n(59),a=n(153);e.exports=function(e,t){return r(e)||o(e,t)||i(e,t)||a()}},function(e,t,n){e.exports={EPSILON:n(70),create:n(71),clone:n(189),angle:n(190),fromValues:n(72),copy:n(191),set:n(192),equals:n(193),exactEquals:n(194),add:n(195),subtract:n(75),sub:n(196),multiply:n(76),mul:n(197),divide:n(77),div:n(198),min:n(199),max:n(200),floor:n(201),ceil:n(202),round:n(203),scale:n(204),scaleAndAdd:n(205),distance:n(78),dist:n(206),squaredDistance:n(79),sqrDist:n(207),length:n(80),len:n(208),squaredLength:n(81),sqrLen:n(209),negate:n(210),inverse:n(211),normalize:n(73),dot:n(74),cross:n(212),lerp:n(213),random:n(214),transformMat4:n(215),transformMat3:n(216),transformQuat:n(217),rotateX:n(218),rotateY:n(219),rotateZ:n(220),forEach:n(221)}},function(e,t,n){var r=n(228),o=n(242)((function(e,t){return null==e?{}:r(e,t)}));e.exports=o},function(e,t,n){"use strict";var r=n(21),o={createContour2D:function(){return{dir:null,index:null,firstVertex:null,insideContours:null,nextpeer:null,prevpeer:null}},CONTOUR_DIR:{CW_DIR:0,CCW_DIR:1,UNKNOWN_DIR:2},DIR:{OUTSIDE_EDGE:-32767,INSIDE_EDGE:-32766},create:function(e,t){var n=e.data,i=t.data,a=e.size.x,c=e.size.y,s=r.a.create(e,t);return{rasterize:function(e){var t,r,u,f,l,d,p,h,v,m,g,y,b=[],_=0;for(y=0;y<400;y++)b[y]=0;for(b[0]=n[0],v=null,d=1;d<c-1;d++)for(f=0,r=b[0],l=1;l<a-1;l++)if(0===i[g=d*a+l])if((t=n[g])!==r){if(0===f)b[u=_+1]=t,r=t,null!==(p=s.contourTracing(d,l,u,t,o.DIR.OUTSIDE_EDGE))&&(_++,f=u,(h=o.createContour2D()).dir=o.CONTOUR_DIR.CW_DIR,h.index=f,h.firstVertex=p,h.nextpeer=v,h.insideContours=null,null!==v&&(v.prevpeer=h),v=h);else if(null!==(p=s.contourTracing(d,l,o.DIR.INSIDE_EDGE,t,f))){for((h=o.createContour2D()).firstVertex=p,h.insideContours=null,h.dir=0===e?o.CONTOUR_DIR.CCW_DIR:o.CONTOUR_DIR.CW_DIR,h.index=e,m=v;null!==m&&m.index!==f;)m=m.nextpeer;null!==m&&(h.nextpeer=m.insideContours,null!==m.insideContours&&(m.insideContours.prevpeer=h),m.insideContours=h)}}else i[g]=f;else i[g]===o.DIR.OUTSIDE_EDGE||i[g]===o.DIR.INSIDE_EDGE?(f=0,r=i[g]===o.DIR.INSIDE_EDGE?n[g]:b[0]):r=b[f=i[g]];for(m=v;null!==m;)m.index=e,m=m.nextpeer;return{cc:v,count:_}},debug:{drawContour:function(e,t){var n,r,i,a=e.getContext("2d"),c=t;for(a.strokeStyle="red",a.fillStyle="red",a.lineWidth=1,n=null!==c?c.insideContours:null;null!==c;){switch(null!==n?(r=n,n=n.nextpeer):(r=c,n=null!==(c=c.nextpeer)?c.insideContours:null),r.dir){case o.CONTOUR_DIR.CW_DIR:a.strokeStyle="red";break;case o.CONTOUR_DIR.CCW_DIR:a.strokeStyle="blue";break;case o.CONTOUR_DIR.UNKNOWN_DIR:a.strokeStyle="green"}i=r.firstVertex,a.beginPath(),a.moveTo(i.x,i.y);do{i=i.next,a.lineTo(i.x,i.y)}while(i!==r.firstVertex);a.stroke()}}}}}};t.a=o},function(e,t,n){"use strict";
     1!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},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 r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},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="xN7L")}({"5nXd":function(e,t,n){var r=n("MFOe"),o=r.slice,i=r.pluck,a=r.each,c=r.bind,s=r.create,u=r.isList,f=r.isFunction,l=r.isObject;e.exports={createStore:p};var d={version:"2.0.12",enabled:!1,get:function(e,t){var n=this.storage.read(this._namespacePrefix+e);return this._deserialize(n,t)},set:function(e,t){return void 0===t?this.remove(e):(this.storage.write(this._namespacePrefix+e,this._serialize(t)),t)},remove:function(e){this.storage.remove(this._namespacePrefix+e)},each:function(e){var t=this;this.storage.each((function(n,r){e.call(t,t._deserialize(n),(r||"").replace(t._namespaceRegexp,""))}))},clearAll:function(){this.storage.clearAll()},hasNamespace:function(e){return this._namespacePrefix=="__storejs_"+e+"_"},createStore:function(){return p.apply(this,arguments)},addPlugin:function(e){this._addPlugin(e)},namespace:function(e){return p(this.storage,this.plugins,e)}};function p(e,t,n){n||(n=""),e&&!u(e)&&(e=[e]),t&&!u(t)&&(t=[t]);var r=n?"__storejs_"+n+"_":"",p=n?new RegExp("^"+r):null;if(!/^[a-zA-Z0-9_\-]*$/.test(n))throw new Error("store.js namespaces can only have alphanumerics + underscores and dashes");var h=s({_namespacePrefix:r,_namespaceRegexp:p,_testStorage:function(e){try{var t="__storejs__test__";e.write(t,t);var n=e.read(t)===t;return e.remove(t),n}catch(e){return!1}},_assignPluginFnProp:function(e,t){var n=this[t];this[t]=function(){var t=o(arguments,0),r=this;function i(){if(n)return a(arguments,(function(e,n){t[n]=e})),n.apply(r,t)}var c=[i].concat(t);return e.apply(r,c)}},_serialize:function(e){return JSON.stringify(e)},_deserialize:function(e,t){if(!e)return t;var n="";try{n=JSON.parse(e)}catch(t){n=e}return void 0!==n?n:t},_addStorage:function(e){this.enabled||this._testStorage(e)&&(this.storage=e,this.enabled=!0)},_addPlugin:function(e){var t=this;if(u(e))a(e,(function(e){t._addPlugin(e)}));else if(!i(this.plugins,(function(t){return e===t}))){if(this.plugins.push(e),!f(e))throw new Error("Plugins must be function values that return objects");var n=e.call(this);if(!l(n))throw new Error("Plugins must return an object of function properties");a(n,(function(n,r){if(!f(n))throw new Error("Bad plugin property: "+r+" from plugin "+e.name+". Plugins should only return functions.");t._assignPluginFnProp(n,r)}))}},addStorage:function(e){!function(){var e="undefined"==typeof console?null:console;if(e){var t=e.warn?e.warn:e.log;t.apply(e,arguments)}}("store.addStorage(storage) is deprecated. Use createStore([storages])"),this._addStorage(e)}},d,{plugins:[]});return h.raw={},a(h,(function(e,t){f(e)&&(h.raw[t]=c(h,e))})),a(e,(function(e){h._addStorage(e)})),a(t,(function(e){h._addPlugin(e)})),h}},"8D0k":function(e,t,n){"use strict";var r=n("KCt4");function o(e,t,n,o,i){var a=r.writeRtpDescription(e.kind,t);if(a+=r.writeIceParameters(e.iceGatherer.getLocalParameters()),a+=r.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===n?"actpass":i||"active"),a+="a=mid:"+e.mid+"\r\n",e.rtpSender&&e.rtpReceiver?a+="a=sendrecv\r\n":e.rtpSender?a+="a=sendonly\r\n":e.rtpReceiver?a+="a=recvonly\r\n":a+="a=inactive\r\n",e.rtpSender){var c=e.rtpSender._initialTrackId||e.rtpSender.track.id;e.rtpSender._initialTrackId=c;var s="msid:"+(o?o.id:"-")+" "+c+"\r\n";a+="a="+s,a+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+s,e.sendEncodingParameters[0].rtx&&(a+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+s,a+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return a+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+r.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(a+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+r.localCName+"\r\n"),a}function i(e,t){var n={codecs:[],headerExtensions:[],fecMechanisms:[]},r=function(e,t){e=parseInt(e,10);for(var n=0;n<t.length;n++)if(t[n].payloadType===e||t[n].preferredPayloadType===e)return t[n]},o=function(e,t,n,o){var i=r(e.parameters.apt,n),a=r(t.parameters.apt,o);return i&&a&&i.name.toLowerCase()===a.name.toLowerCase()};return e.codecs.forEach((function(r){for(var i=0;i<t.codecs.length;i++){var a=t.codecs[i];if(r.name.toLowerCase()===a.name.toLowerCase()&&r.clockRate===a.clockRate){if("rtx"===r.name.toLowerCase()&&r.parameters&&a.parameters.apt&&!o(r,a,e.codecs,t.codecs))continue;(a=JSON.parse(JSON.stringify(a))).numChannels=Math.min(r.numChannels,a.numChannels),n.codecs.push(a),a.rtcpFeedback=a.rtcpFeedback.filter((function(e){for(var t=0;t<r.rtcpFeedback.length;t++)if(r.rtcpFeedback[t].type===e.type&&r.rtcpFeedback[t].parameter===e.parameter)return!0;return!1}));break}}})),e.headerExtensions.forEach((function(e){for(var r=0;r<t.headerExtensions.length;r++){var o=t.headerExtensions[r];if(e.uri===o.uri){n.headerExtensions.push(o);break}}})),n}function a(e,t,n){return-1!=={offer:{setLocalDescription:["stable","have-local-offer"],setRemoteDescription:["stable","have-remote-offer"]},answer:{setLocalDescription:["have-remote-offer","have-local-pranswer"],setRemoteDescription:["have-local-offer","have-remote-pranswer"]}}[t][e].indexOf(n)}function c(e,t){var n=e.getRemoteCandidates().find((function(e){return t.foundation===e.foundation&&t.ip===e.ip&&t.port===e.port&&t.priority===e.priority&&t.protocol===e.protocol&&t.type===e.type}));return n||e.addRemoteCandidate(t),!n}function s(e,t){var n=new Error(t);return n.name=e,n.code={NotSupportedError:9,InvalidStateError:11,InvalidAccessError:15,TypeError:void 0,OperationError:void 0}[e],n}e.exports=function(e,t){function n(t,n){n.addTrack(t),n.dispatchEvent(new e.MediaStreamTrackEvent("addtrack",{track:t}))}function u(t,n,r,o){var i=new Event("track");i.track=n,i.receiver=r,i.transceiver={receiver:r},i.streams=o,e.setTimeout((function(){t._dispatchEvent("track",i)}))}var f=function(n){var o=this,i=document.createDocumentFragment();if(["addEventListener","removeEventListener","dispatchEvent"].forEach((function(e){o[e]=i[e].bind(i)})),this.canTrickleIceCandidates=null,this.needNegotiation=!1,this.localStreams=[],this.remoteStreams=[],this._localDescription=null,this._remoteDescription=null,this.signalingState="stable",this.iceConnectionState="new",this.connectionState="new",this.iceGatheringState="new",n=JSON.parse(JSON.stringify(n||{})),this.usingBundle="max-bundle"===n.bundlePolicy,"negotiate"===n.rtcpMuxPolicy)throw s("NotSupportedError","rtcpMuxPolicy 'negotiate' is not supported");switch(n.rtcpMuxPolicy||(n.rtcpMuxPolicy="require"),n.iceTransportPolicy){case"all":case"relay":break;default:n.iceTransportPolicy="all"}switch(n.bundlePolicy){case"balanced":case"max-compat":case"max-bundle":break;default:n.bundlePolicy="balanced"}if(n.iceServers=function(e,t){var n=!1;return(e=JSON.parse(JSON.stringify(e))).filter((function(e){if(e&&(e.urls||e.url)){var r=e.urls||e.url;e.url&&!e.urls&&console.warn("RTCIceServer.url is deprecated! Use urls instead.");var o="string"==typeof r;return o&&(r=[r]),r=r.filter((function(e){return 0===e.indexOf("turn:")&&-1!==e.indexOf("transport=udp")&&-1===e.indexOf("turn:[")&&!n?(n=!0,!0):0===e.indexOf("stun:")&&t>=14393&&-1===e.indexOf("?transport=udp")})),delete e.url,e.urls=o?r[0]:r,!!r.length}}))}(n.iceServers||[],t),this._iceGatherers=[],n.iceCandidatePoolSize)for(var a=n.iceCandidatePoolSize;a>0;a--)this._iceGatherers.push(new e.RTCIceGatherer({iceServers:n.iceServers,gatherPolicy:n.iceTransportPolicy}));else n.iceCandidatePoolSize=0;this._config=n,this.transceivers=[],this._sdpSessionId=r.generateSessionId(),this._sdpSessionVersion=0,this._dtlsRole=void 0,this._isClosed=!1};Object.defineProperty(f.prototype,"localDescription",{configurable:!0,get:function(){return this._localDescription}}),Object.defineProperty(f.prototype,"remoteDescription",{configurable:!0,get:function(){return this._remoteDescription}}),f.prototype.onicecandidate=null,f.prototype.onaddstream=null,f.prototype.ontrack=null,f.prototype.onremovestream=null,f.prototype.onsignalingstatechange=null,f.prototype.oniceconnectionstatechange=null,f.prototype.onconnectionstatechange=null,f.prototype.onicegatheringstatechange=null,f.prototype.onnegotiationneeded=null,f.prototype.ondatachannel=null,f.prototype._dispatchEvent=function(e,t){this._isClosed||(this.dispatchEvent(t),"function"==typeof this["on"+e]&&this["on"+e](t))},f.prototype._emitGatheringStateChange=function(){var e=new Event("icegatheringstatechange");this._dispatchEvent("icegatheringstatechange",e)},f.prototype.getConfiguration=function(){return this._config},f.prototype.getLocalStreams=function(){return this.localStreams},f.prototype.getRemoteStreams=function(){return this.remoteStreams},f.prototype._createTransceiver=function(e,t){var n=this.transceivers.length>0,r={track:null,iceGatherer:null,iceTransport:null,dtlsTransport:null,localCapabilities:null,remoteCapabilities:null,rtpSender:null,rtpReceiver:null,kind:e,mid:null,sendEncodingParameters:null,recvEncodingParameters:null,stream:null,associatedRemoteMediaStreams:[],wantReceive:!0};if(this.usingBundle&&n)r.iceTransport=this.transceivers[0].iceTransport,r.dtlsTransport=this.transceivers[0].dtlsTransport;else{var o=this._createIceAndDtlsTransports();r.iceTransport=o.iceTransport,r.dtlsTransport=o.dtlsTransport}return t||this.transceivers.push(r),r},f.prototype.addTrack=function(t,n){if(this._isClosed)throw s("InvalidStateError","Attempted to call addTrack on a closed peerconnection.");var r;if(this.transceivers.find((function(e){return e.track===t})))throw s("InvalidAccessError","Track already exists.");for(var o=0;o<this.transceivers.length;o++)this.transceivers[o].track||this.transceivers[o].kind!==t.kind||(r=this.transceivers[o]);return r||(r=this._createTransceiver(t.kind)),this._maybeFireNegotiationNeeded(),-1===this.localStreams.indexOf(n)&&this.localStreams.push(n),r.track=t,r.stream=n,r.rtpSender=new e.RTCRtpSender(t,r.dtlsTransport),r.rtpSender},f.prototype.addStream=function(e){var n=this;if(t>=15025)e.getTracks().forEach((function(t){n.addTrack(t,e)}));else{var r=e.clone();e.getTracks().forEach((function(e,t){var n=r.getTracks()[t];e.addEventListener("enabled",(function(e){n.enabled=e.enabled}))})),r.getTracks().forEach((function(e){n.addTrack(e,r)}))}},f.prototype.removeTrack=function(t){if(this._isClosed)throw s("InvalidStateError","Attempted to call removeTrack on a closed peerconnection.");if(!(t instanceof e.RTCRtpSender))throw new TypeError("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.");var n=this.transceivers.find((function(e){return e.rtpSender===t}));if(!n)throw s("InvalidAccessError","Sender was not created by this connection.");var r=n.stream;n.rtpSender.stop(),n.rtpSender=null,n.track=null,n.stream=null,-1===this.transceivers.map((function(e){return e.stream})).indexOf(r)&&this.localStreams.indexOf(r)>-1&&this.localStreams.splice(this.localStreams.indexOf(r),1),this._maybeFireNegotiationNeeded()},f.prototype.removeStream=function(e){var t=this;e.getTracks().forEach((function(e){var n=t.getSenders().find((function(t){return t.track===e}));n&&t.removeTrack(n)}))},f.prototype.getSenders=function(){return this.transceivers.filter((function(e){return!!e.rtpSender})).map((function(e){return e.rtpSender}))},f.prototype.getReceivers=function(){return this.transceivers.filter((function(e){return!!e.rtpReceiver})).map((function(e){return e.rtpReceiver}))},f.prototype._createIceGatherer=function(t,n){var r=this;if(n&&t>0)return this.transceivers[0].iceGatherer;if(this._iceGatherers.length)return this._iceGatherers.shift();var o=new e.RTCIceGatherer({iceServers:this._config.iceServers,gatherPolicy:this._config.iceTransportPolicy});return Object.defineProperty(o,"state",{value:"new",writable:!0}),this.transceivers[t].bufferedCandidateEvents=[],this.transceivers[t].bufferCandidates=function(e){var n=!e.candidate||0===Object.keys(e.candidate).length;o.state=n?"completed":"gathering",null!==r.transceivers[t].bufferedCandidateEvents&&r.transceivers[t].bufferedCandidateEvents.push(e)},o.addEventListener("localcandidate",this.transceivers[t].bufferCandidates),o},f.prototype._gather=function(t,n){var o=this,i=this.transceivers[n].iceGatherer;if(!i.onlocalcandidate){var a=this.transceivers[n].bufferedCandidateEvents;this.transceivers[n].bufferedCandidateEvents=null,i.removeEventListener("localcandidate",this.transceivers[n].bufferCandidates),i.onlocalcandidate=function(e){if(!(o.usingBundle&&n>0)){var a=new Event("icecandidate");a.candidate={sdpMid:t,sdpMLineIndex:n};var c=e.candidate,s=!c||0===Object.keys(c).length;if(s)"new"!==i.state&&"gathering"!==i.state||(i.state="completed");else{"new"===i.state&&(i.state="gathering"),c.component=1,c.ufrag=i.getLocalParameters().usernameFragment;var u=r.writeCandidate(c);a.candidate=Object.assign(a.candidate,r.parseCandidate(u)),a.candidate.candidate=u,a.candidate.toJSON=function(){return{candidate:a.candidate.candidate,sdpMid:a.candidate.sdpMid,sdpMLineIndex:a.candidate.sdpMLineIndex,usernameFragment:a.candidate.usernameFragment}}}var f=r.getMediaSections(o._localDescription.sdp);f[a.candidate.sdpMLineIndex]+=s?"a=end-of-candidates\r\n":"a="+a.candidate.candidate+"\r\n",o._localDescription.sdp=r.getDescription(o._localDescription.sdp)+f.join("");var l=o.transceivers.every((function(e){return e.iceGatherer&&"completed"===e.iceGatherer.state}));"gathering"!==o.iceGatheringState&&(o.iceGatheringState="gathering",o._emitGatheringStateChange()),s||o._dispatchEvent("icecandidate",a),l&&(o._dispatchEvent("icecandidate",new Event("icecandidate")),o.iceGatheringState="complete",o._emitGatheringStateChange())}},e.setTimeout((function(){a.forEach((function(e){i.onlocalcandidate(e)}))}),0)}},f.prototype._createIceAndDtlsTransports=function(){var t=this,n=new e.RTCIceTransport(null);n.onicestatechange=function(){t._updateIceConnectionState(),t._updateConnectionState()};var r=new e.RTCDtlsTransport(n);return r.ondtlsstatechange=function(){t._updateConnectionState()},r.onerror=function(){Object.defineProperty(r,"state",{value:"failed",writable:!0}),t._updateConnectionState()},{iceTransport:n,dtlsTransport:r}},f.prototype._disposeIceAndDtlsTransports=function(e){var t=this.transceivers[e].iceGatherer;t&&(delete t.onlocalcandidate,delete this.transceivers[e].iceGatherer);var n=this.transceivers[e].iceTransport;n&&(delete n.onicestatechange,delete this.transceivers[e].iceTransport);var r=this.transceivers[e].dtlsTransport;r&&(delete r.ondtlsstatechange,delete r.onerror,delete this.transceivers[e].dtlsTransport)},f.prototype._transceive=function(e,n,o){var a=i(e.localCapabilities,e.remoteCapabilities);n&&e.rtpSender&&(a.encodings=e.sendEncodingParameters,a.rtcp={cname:r.localCName,compound:e.rtcpParameters.compound},e.recvEncodingParameters.length&&(a.rtcp.ssrc=e.recvEncodingParameters[0].ssrc),e.rtpSender.send(a)),o&&e.rtpReceiver&&a.codecs.length>0&&("video"===e.kind&&e.recvEncodingParameters&&t<15019&&e.recvEncodingParameters.forEach((function(e){delete e.rtx})),e.recvEncodingParameters.length?a.encodings=e.recvEncodingParameters:a.encodings=[{}],a.rtcp={compound:e.rtcpParameters.compound},e.rtcpParameters.cname&&(a.rtcp.cname=e.rtcpParameters.cname),e.sendEncodingParameters.length&&(a.rtcp.ssrc=e.sendEncodingParameters[0].ssrc),e.rtpReceiver.receive(a))},f.prototype.setLocalDescription=function(e){var t,n,o=this;if(-1===["offer","answer"].indexOf(e.type))return Promise.reject(s("TypeError",'Unsupported type "'+e.type+'"'));if(!a("setLocalDescription",e.type,o.signalingState)||o._isClosed)return Promise.reject(s("InvalidStateError","Can not set local "+e.type+" in state "+o.signalingState));if("offer"===e.type)t=r.splitSections(e.sdp),n=t.shift(),t.forEach((function(e,t){var n=r.parseRtpParameters(e);o.transceivers[t].localCapabilities=n})),o.transceivers.forEach((function(e,t){o._gather(e.mid,t)}));else if("answer"===e.type){t=r.splitSections(o._remoteDescription.sdp),n=t.shift();var c=r.matchPrefix(n,"a=ice-lite").length>0;t.forEach((function(e,t){var a=o.transceivers[t],s=a.iceGatherer,u=a.iceTransport,f=a.dtlsTransport,l=a.localCapabilities,d=a.remoteCapabilities;if(!(r.isRejected(e)&&0===r.matchPrefix(e,"a=bundle-only").length)&&!a.rejected){var p=r.getIceParameters(e,n),h=r.getDtlsParameters(e,n);c&&(h.role="server"),o.usingBundle&&0!==t||(o._gather(a.mid,t),"new"===u.state&&u.start(s,p,c?"controlling":"controlled"),"new"===f.state&&f.start(h));var v=i(l,d);o._transceive(a,v.codecs.length>0,!1)}}))}return o._localDescription={type:e.type,sdp:e.sdp},"offer"===e.type?o._updateSignalingState("have-local-offer"):o._updateSignalingState("stable"),Promise.resolve()},f.prototype.setRemoteDescription=function(o){var f=this;if(-1===["offer","answer"].indexOf(o.type))return Promise.reject(s("TypeError",'Unsupported type "'+o.type+'"'));if(!a("setRemoteDescription",o.type,f.signalingState)||f._isClosed)return Promise.reject(s("InvalidStateError","Can not set remote "+o.type+" in state "+f.signalingState));var l={};f.remoteStreams.forEach((function(e){l[e.id]=e}));var d=[],p=r.splitSections(o.sdp),h=p.shift(),v=r.matchPrefix(h,"a=ice-lite").length>0,m=r.matchPrefix(h,"a=group:BUNDLE ").length>0;f.usingBundle=m;var g=r.matchPrefix(h,"a=ice-options:")[0];return f.canTrickleIceCandidates=!!g&&g.substr(14).split(" ").indexOf("trickle")>=0,p.forEach((function(a,s){var u=r.splitLines(a),p=r.getKind(a),g=r.isRejected(a)&&0===r.matchPrefix(a,"a=bundle-only").length,y=u[0].substr(2).split(" ")[2],b=r.getDirection(a,h),_=r.parseMsid(a),x=r.getMid(a)||r.generateIdentifier();if(g||"application"===p&&("DTLS/SCTP"===y||"UDP/DTLS/SCTP"===y))f.transceivers[s]={mid:x,kind:p,protocol:y,rejected:!0};else{var C,S,R,w,T,E,P,O,k;!g&&f.transceivers[s]&&f.transceivers[s].rejected&&(f.transceivers[s]=f._createTransceiver(p,!0));var D,M,A=r.parseRtpParameters(a);g||(D=r.getIceParameters(a,h),(M=r.getDtlsParameters(a,h)).role="client"),P=r.parseRtpEncodingParameters(a);var j=r.parseRtcpParameters(a),I=r.matchPrefix(a,"a=end-of-candidates",h).length>0,L=r.matchPrefix(a,"a=candidate:").map((function(e){return r.parseCandidate(e)})).filter((function(e){return 1===e.component}));if(("offer"===o.type||"answer"===o.type)&&!g&&m&&s>0&&f.transceivers[s]&&(f._disposeIceAndDtlsTransports(s),f.transceivers[s].iceGatherer=f.transceivers[0].iceGatherer,f.transceivers[s].iceTransport=f.transceivers[0].iceTransport,f.transceivers[s].dtlsTransport=f.transceivers[0].dtlsTransport,f.transceivers[s].rtpSender&&f.transceivers[s].rtpSender.setTransport(f.transceivers[0].dtlsTransport),f.transceivers[s].rtpReceiver&&f.transceivers[s].rtpReceiver.setTransport(f.transceivers[0].dtlsTransport)),"offer"!==o.type||g){if("answer"===o.type&&!g){S=(C=f.transceivers[s]).iceGatherer,R=C.iceTransport,w=C.dtlsTransport,T=C.rtpReceiver,E=C.sendEncodingParameters,O=C.localCapabilities,f.transceivers[s].recvEncodingParameters=P,f.transceivers[s].remoteCapabilities=A,f.transceivers[s].rtcpParameters=j,L.length&&"new"===R.state&&(!v&&!I||m&&0!==s?L.forEach((function(e){c(C.iceTransport,e)})):R.setRemoteCandidates(L)),m&&0!==s||("new"===R.state&&R.start(S,D,"controlling"),"new"===w.state&&w.start(M)),!i(C.localCapabilities,C.remoteCapabilities).codecs.filter((function(e){return"rtx"===e.name.toLowerCase()})).length&&C.sendEncodingParameters[0].rtx&&delete C.sendEncodingParameters[0].rtx,f._transceive(C,"sendrecv"===b||"recvonly"===b,"sendrecv"===b||"sendonly"===b),!T||"sendrecv"!==b&&"sendonly"!==b?delete C.rtpReceiver:(k=T.track,_?(l[_.stream]||(l[_.stream]=new e.MediaStream),n(k,l[_.stream]),d.push([k,T,l[_.stream]])):(l.default||(l.default=new e.MediaStream),n(k,l.default),d.push([k,T,l.default])))}}else{(C=f.transceivers[s]||f._createTransceiver(p)).mid=x,C.iceGatherer||(C.iceGatherer=f._createIceGatherer(s,m)),L.length&&"new"===C.iceTransport.state&&(!I||m&&0!==s?L.forEach((function(e){c(C.iceTransport,e)})):C.iceTransport.setRemoteCandidates(L)),O=e.RTCRtpReceiver.getCapabilities(p),t<15019&&(O.codecs=O.codecs.filter((function(e){return"rtx"!==e.name}))),E=C.sendEncodingParameters||[{ssrc:1001*(2*s+2)}];var N,z=!1;if("sendrecv"===b||"sendonly"===b){if(z=!C.rtpReceiver,T=C.rtpReceiver||new e.RTCRtpReceiver(C.dtlsTransport,p),z)k=T.track,_&&"-"===_.stream||(_?(l[_.stream]||(l[_.stream]=new e.MediaStream,Object.defineProperty(l[_.stream],"id",{get:function(){return _.stream}})),Object.defineProperty(k,"id",{get:function(){return _.track}}),N=l[_.stream]):(l.default||(l.default=new e.MediaStream),N=l.default)),N&&(n(k,N),C.associatedRemoteMediaStreams.push(N)),d.push([k,T,N])}else C.rtpReceiver&&C.rtpReceiver.track&&(C.associatedRemoteMediaStreams.forEach((function(t){var n=t.getTracks().find((function(e){return e.id===C.rtpReceiver.track.id}));n&&function(t,n){n.removeTrack(t),n.dispatchEvent(new e.MediaStreamTrackEvent("removetrack",{track:t}))}(n,t)})),C.associatedRemoteMediaStreams=[]);C.localCapabilities=O,C.remoteCapabilities=A,C.rtpReceiver=T,C.rtcpParameters=j,C.sendEncodingParameters=E,C.recvEncodingParameters=P,f._transceive(f.transceivers[s],!1,z)}}})),void 0===f._dtlsRole&&(f._dtlsRole="offer"===o.type?"active":"passive"),f._remoteDescription={type:o.type,sdp:o.sdp},"offer"===o.type?f._updateSignalingState("have-remote-offer"):f._updateSignalingState("stable"),Object.keys(l).forEach((function(t){var n=l[t];if(n.getTracks().length){if(-1===f.remoteStreams.indexOf(n)){f.remoteStreams.push(n);var r=new Event("addstream");r.stream=n,e.setTimeout((function(){f._dispatchEvent("addstream",r)}))}d.forEach((function(e){var t=e[0],r=e[1];n.id===e[2].id&&u(f,t,r,[n])}))}})),d.forEach((function(e){e[2]||u(f,e[0],e[1],[])})),e.setTimeout((function(){f&&f.transceivers&&f.transceivers.forEach((function(e){e.iceTransport&&"new"===e.iceTransport.state&&e.iceTransport.getRemoteCandidates().length>0&&(console.warn("Timeout for addRemoteCandidate. Consider sending an end-of-candidates notification"),e.iceTransport.addRemoteCandidate({}))}))}),4e3),Promise.resolve()},f.prototype.close=function(){this.transceivers.forEach((function(e){e.iceTransport&&e.iceTransport.stop(),e.dtlsTransport&&e.dtlsTransport.stop(),e.rtpSender&&e.rtpSender.stop(),e.rtpReceiver&&e.rtpReceiver.stop()})),this._isClosed=!0,this._updateSignalingState("closed")},f.prototype._updateSignalingState=function(e){this.signalingState=e;var t=new Event("signalingstatechange");this._dispatchEvent("signalingstatechange",t)},f.prototype._maybeFireNegotiationNeeded=function(){var t=this;"stable"===this.signalingState&&!0!==this.needNegotiation&&(this.needNegotiation=!0,e.setTimeout((function(){if(t.needNegotiation){t.needNegotiation=!1;var e=new Event("negotiationneeded");t._dispatchEvent("negotiationneeded",e)}}),0))},f.prototype._updateIceConnectionState=function(){var e,t={new:0,closed:0,checking:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach((function(e){e.iceTransport&&!e.rejected&&t[e.iceTransport.state]++})),e="new",t.failed>0?e="failed":t.checking>0?e="checking":t.disconnected>0?e="disconnected":t.new>0?e="new":t.connected>0?e="connected":t.completed>0&&(e="completed"),e!==this.iceConnectionState){this.iceConnectionState=e;var n=new Event("iceconnectionstatechange");this._dispatchEvent("iceconnectionstatechange",n)}},f.prototype._updateConnectionState=function(){var e,t={new:0,closed:0,connecting:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach((function(e){e.iceTransport&&e.dtlsTransport&&!e.rejected&&(t[e.iceTransport.state]++,t[e.dtlsTransport.state]++)})),t.connected+=t.completed,e="new",t.failed>0?e="failed":t.connecting>0?e="connecting":t.disconnected>0?e="disconnected":t.new>0?e="new":t.connected>0&&(e="connected"),e!==this.connectionState){this.connectionState=e;var n=new Event("connectionstatechange");this._dispatchEvent("connectionstatechange",n)}},f.prototype.createOffer=function(){var n=this;if(n._isClosed)return Promise.reject(s("InvalidStateError","Can not call createOffer after close"));var i=n.transceivers.filter((function(e){return"audio"===e.kind})).length,a=n.transceivers.filter((function(e){return"video"===e.kind})).length,c=arguments[0];if(c){if(c.mandatory||c.optional)throw new TypeError("Legacy mandatory/optional constraints not supported.");void 0!==c.offerToReceiveAudio&&(i=!0===c.offerToReceiveAudio?1:!1===c.offerToReceiveAudio?0:c.offerToReceiveAudio),void 0!==c.offerToReceiveVideo&&(a=!0===c.offerToReceiveVideo?1:!1===c.offerToReceiveVideo?0:c.offerToReceiveVideo)}for(n.transceivers.forEach((function(e){"audio"===e.kind?--i<0&&(e.wantReceive=!1):"video"===e.kind&&--a<0&&(e.wantReceive=!1)}));i>0||a>0;)i>0&&(n._createTransceiver("audio"),i--),a>0&&(n._createTransceiver("video"),a--);var u=r.writeSessionBoilerplate(n._sdpSessionId,n._sdpSessionVersion++);n.transceivers.forEach((function(o,i){var a=o.track,c=o.kind,s=o.mid||r.generateIdentifier();o.mid=s,o.iceGatherer||(o.iceGatherer=n._createIceGatherer(i,n.usingBundle));var u=e.RTCRtpSender.getCapabilities(c);t<15019&&(u.codecs=u.codecs.filter((function(e){return"rtx"!==e.name}))),u.codecs.forEach((function(e){"H264"===e.name&&void 0===e.parameters["level-asymmetry-allowed"]&&(e.parameters["level-asymmetry-allowed"]="1"),o.remoteCapabilities&&o.remoteCapabilities.codecs&&o.remoteCapabilities.codecs.forEach((function(t){e.name.toLowerCase()===t.name.toLowerCase()&&e.clockRate===t.clockRate&&(e.preferredPayloadType=t.payloadType)}))})),u.headerExtensions.forEach((function(e){(o.remoteCapabilities&&o.remoteCapabilities.headerExtensions||[]).forEach((function(t){e.uri===t.uri&&(e.id=t.id)}))}));var f=o.sendEncodingParameters||[{ssrc:1001*(2*i+1)}];a&&t>=15019&&"video"===c&&!f[0].rtx&&(f[0].rtx={ssrc:f[0].ssrc+1}),o.wantReceive&&(o.rtpReceiver=new e.RTCRtpReceiver(o.dtlsTransport,c)),o.localCapabilities=u,o.sendEncodingParameters=f})),"max-compat"!==n._config.bundlePolicy&&(u+="a=group:BUNDLE "+n.transceivers.map((function(e){return e.mid})).join(" ")+"\r\n"),u+="a=ice-options:trickle\r\n",n.transceivers.forEach((function(e,t){u+=o(e,e.localCapabilities,"offer",e.stream,n._dtlsRole),u+="a=rtcp-rsize\r\n",!e.iceGatherer||"new"===n.iceGatheringState||0!==t&&n.usingBundle||(e.iceGatherer.getLocalCandidates().forEach((function(e){e.component=1,u+="a="+r.writeCandidate(e)+"\r\n"})),"completed"===e.iceGatherer.state&&(u+="a=end-of-candidates\r\n"))}));var f=new e.RTCSessionDescription({type:"offer",sdp:u});return Promise.resolve(f)},f.prototype.createAnswer=function(){var n=this;if(n._isClosed)return Promise.reject(s("InvalidStateError","Can not call createAnswer after close"));if("have-remote-offer"!==n.signalingState&&"have-local-pranswer"!==n.signalingState)return Promise.reject(s("InvalidStateError","Can not call createAnswer in signalingState "+n.signalingState));var a=r.writeSessionBoilerplate(n._sdpSessionId,n._sdpSessionVersion++);n.usingBundle&&(a+="a=group:BUNDLE "+n.transceivers.map((function(e){return e.mid})).join(" ")+"\r\n"),a+="a=ice-options:trickle\r\n";var c=r.getMediaSections(n._remoteDescription.sdp).length;n.transceivers.forEach((function(e,r){if(!(r+1>c)){if(e.rejected)return"application"===e.kind?"DTLS/SCTP"===e.protocol?a+="m=application 0 DTLS/SCTP 5000\r\n":a+="m=application 0 "+e.protocol+" webrtc-datachannel\r\n":"audio"===e.kind?a+="m=audio 0 UDP/TLS/RTP/SAVPF 0\r\na=rtpmap:0 PCMU/8000\r\n":"video"===e.kind&&(a+="m=video 0 UDP/TLS/RTP/SAVPF 120\r\na=rtpmap:120 VP8/90000\r\n"),void(a+="c=IN IP4 0.0.0.0\r\na=inactive\r\na=mid:"+e.mid+"\r\n");var s;if(e.stream)"audio"===e.kind?s=e.stream.getAudioTracks()[0]:"video"===e.kind&&(s=e.stream.getVideoTracks()[0]),s&&t>=15019&&"video"===e.kind&&!e.sendEncodingParameters[0].rtx&&(e.sendEncodingParameters[0].rtx={ssrc:e.sendEncodingParameters[0].ssrc+1});var u=i(e.localCapabilities,e.remoteCapabilities);!u.codecs.filter((function(e){return"rtx"===e.name.toLowerCase()})).length&&e.sendEncodingParameters[0].rtx&&delete e.sendEncodingParameters[0].rtx,a+=o(e,u,"answer",e.stream,n._dtlsRole),e.rtcpParameters&&e.rtcpParameters.reducedSize&&(a+="a=rtcp-rsize\r\n")}}));var u=new e.RTCSessionDescription({type:"answer",sdp:a});return Promise.resolve(u)},f.prototype.addIceCandidate=function(e){var t,n=this;return e&&void 0===e.sdpMLineIndex&&!e.sdpMid?Promise.reject(new TypeError("sdpMLineIndex or sdpMid required")):new Promise((function(o,i){if(!n._remoteDescription)return i(s("InvalidStateError","Can not add ICE candidate without a remote description"));if(e&&""!==e.candidate){var a=e.sdpMLineIndex;if(e.sdpMid)for(var u=0;u<n.transceivers.length;u++)if(n.transceivers[u].mid===e.sdpMid){a=u;break}var f=n.transceivers[a];if(!f)return i(s("OperationError","Can not add ICE candidate"));if(f.rejected)return o();var l=Object.keys(e.candidate).length>0?r.parseCandidate(e.candidate):{};if("tcp"===l.protocol&&(0===l.port||9===l.port))return o();if(l.component&&1!==l.component)return o();if((0===a||a>0&&f.iceTransport!==n.transceivers[0].iceTransport)&&!c(f.iceTransport,l))return i(s("OperationError","Can not add ICE candidate"));var d=e.candidate.trim();0===d.indexOf("a=")&&(d=d.substr(2)),(t=r.getMediaSections(n._remoteDescription.sdp))[a]+="a="+(l.type?d:"end-of-candidates")+"\r\n",n._remoteDescription.sdp=r.getDescription(n._remoteDescription.sdp)+t.join("")}else for(var p=0;p<n.transceivers.length&&(n.transceivers[p].rejected||(n.transceivers[p].iceTransport.addRemoteCandidate({}),(t=r.getMediaSections(n._remoteDescription.sdp))[p]+="a=end-of-candidates\r\n",n._remoteDescription.sdp=r.getDescription(n._remoteDescription.sdp)+t.join(""),!n.usingBundle));p++);o()}))},f.prototype.getStats=function(t){if(t&&t instanceof e.MediaStreamTrack){var n=null;if(this.transceivers.forEach((function(e){e.rtpSender&&e.rtpSender.track===t?n=e.rtpSender:e.rtpReceiver&&e.rtpReceiver.track===t&&(n=e.rtpReceiver)})),!n)throw s("InvalidAccessError","Invalid selector.");return n.getStats()}var r=[];return this.transceivers.forEach((function(e){["rtpSender","rtpReceiver","iceGatherer","iceTransport","dtlsTransport"].forEach((function(t){e[t]&&r.push(e[t].getStats())}))})),Promise.all(r).then((function(e){var t=new Map;return e.forEach((function(e){e.forEach((function(e){t.set(e.id,e)}))})),t}))};["RTCRtpSender","RTCRtpReceiver","RTCIceGatherer","RTCIceTransport","RTCDtlsTransport"].forEach((function(t){var n=e[t];if(n&&n.prototype&&n.prototype.getStats){var r=n.prototype.getStats;n.prototype.getStats=function(){return r.apply(this).then((function(e){var t=new Map;return Object.keys(e).forEach((function(n){var r;e[n].type={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[(r=e[n]).type]||r.type,t.set(n,e[n])})),t}))}}}));var l=["createOffer","createAnswer"];return l.forEach((function(e){var t=f.prototype[e];f.prototype[e]=function(){var e=arguments;return"function"==typeof e[0]||"function"==typeof e[1]?t.apply(this,[arguments[2]]).then((function(t){"function"==typeof e[0]&&e[0].apply(null,[t])}),(function(t){"function"==typeof e[1]&&e[1].apply(null,[t])})):t.apply(this,arguments)}})),(l=["setLocalDescription","setRemoteDescription","addIceCandidate"]).forEach((function(e){var t=f.prototype[e];f.prototype[e]=function(){var e=arguments;return"function"==typeof e[1]||"function"==typeof e[2]?t.apply(this,arguments).then((function(){"function"==typeof e[1]&&e[1].apply(null)}),(function(t){"function"==typeof e[2]&&e[2].apply(null,[t])})):t.apply(this,arguments)}})),["getStats"].forEach((function(e){var t=f.prototype[e];f.prototype[e]=function(){var e=arguments;return"function"==typeof e[1]?t.apply(this,arguments).then((function(){"function"==typeof e[1]&&e[1].apply(null)})):t.apply(this,arguments)}})),f}},CrYA:function(e,t,n){var r=n("MFOe").Global;function o(){return r.sessionStorage}function i(e){return o().getItem(e)}e.exports={name:"sessionStorage",read:i,write:function(e,t){return o().setItem(e,t)},each:function(e){for(var t=o().length-1;t>=0;t--){var n=o().key(t);e(i(n),n)}},remove:function(e){return o().removeItem(e)},clearAll:function(){return o().clear()}}},"DlR+":function(e,t,n){var r=n("MFOe"),o=r.Global,i=r.trim;e.exports={name:"cookieStorage",read:function(e){if(!e||!u(e))return null;var t="(?:^|.*;\\s*)"+escape(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";return unescape(a.cookie.replace(new RegExp(t),"$1"))},write:function(e,t){if(!e)return;a.cookie=escape(e)+"="+escape(t)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/"},each:c,remove:s,clearAll:function(){c((function(e,t){s(t)}))}};var a=o.document;function c(e){for(var t=a.cookie.split(/; ?/g),n=t.length-1;n>=0;n--)if(i(t[n])){var r=t[n].split("="),o=unescape(r[0]);e(unescape(r[1]),o)}}function s(e){e&&u(e)&&(a.cookie=escape(e)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/")}function u(e){return new RegExp("(?:^|;\\s*)"+escape(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(a.cookie)}},KCt4:function(e,t,n){"use strict";var r={generateIdentifier:function(){return Math.random().toString(36).substr(2,10)}};r.localCName=r.generateIdentifier(),r.splitLines=function(e){return e.trim().split("\n").map((function(e){return e.trim()}))},r.splitSections=function(e){return e.split("\nm=").map((function(e,t){return(t>0?"m="+e:e).trim()+"\r\n"}))},r.getDescription=function(e){var t=r.splitSections(e);return t&&t[0]},r.getMediaSections=function(e){var t=r.splitSections(e);return t.shift(),t},r.matchPrefix=function(e,t){return r.splitLines(e).filter((function(e){return 0===e.indexOf(t)}))},r.parseCandidate=function(e){for(var t,n={foundation:(t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" "))[0],component:parseInt(t[1],10),protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]},r=8;r<t.length;r+=2)switch(t[r]){case"raddr":n.relatedAddress=t[r+1];break;case"rport":n.relatedPort=parseInt(t[r+1],10);break;case"tcptype":n.tcpType=t[r+1];break;case"ufrag":n.ufrag=t[r+1],n.usernameFragment=t[r+1];break;default:n[t[r]]=t[r+1]}return n},r.writeCandidate=function(e){var t=[];t.push(e.foundation),t.push(e.component),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.address||e.ip),t.push(e.port);var n=e.type;return t.push("typ"),t.push(n),"host"!==n&&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(" ")},r.parseIceOptions=function(e){return e.substr(14).split(" ")},r.parseRtpMap=function(e){var t=e.substr(9).split(" "),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},r.writeRtpMap=function(e){var t=e.payloadType;void 0!==e.preferredPayloadType&&(t=e.preferredPayloadType);var n=e.channels||e.numChannels||1;return"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1!==n?"/"+n:"")+"\r\n"},r.parseExtmap=function(e){var t=e.substr(9).split(" ");return{id:parseInt(t[0],10),direction:t[0].indexOf("/")>0?t[0].split("/")[1]:"sendrecv",uri:t[1]}},r.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+"\r\n"},r.parseFmtp=function(e){for(var t,n={},r=e.substr(e.indexOf(" ")+1).split(";"),o=0;o<r.length;o++)n[(t=r[o].trim().split("="))[0].trim()]=t[1];return n},r.writeFmtp=function(e){var t="",n=e.payloadType;if(void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){var r=[];Object.keys(e.parameters).forEach((function(t){e.parameters[t]?r.push(t+"="+e.parameters[t]):r.push(t)})),t+="a=fmtp:"+n+" "+r.join(";")+"\r\n"}return t},r.parseRtcpFb=function(e){var t=e.substr(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},r.writeRtcpFb=function(e){var t="",n=e.payloadType;return void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach((function(e){t+="a=rtcp-fb:"+n+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"})),t},r.parseSsrcMedia=function(e){var t=e.indexOf(" "),n={ssrc:parseInt(e.substr(7,t-7),10)},r=e.indexOf(":",t);return r>-1?(n.attribute=e.substr(t+1,r-t-1),n.value=e.substr(r+1)):n.attribute=e.substr(t+1),n},r.parseSsrcGroup=function(e){var t=e.substr(13).split(" ");return{semantics:t.shift(),ssrcs:t.map((function(e){return parseInt(e,10)}))}},r.getMid=function(e){var t=r.matchPrefix(e,"a=mid:")[0];if(t)return t.substr(6)},r.parseFingerprint=function(e){var t=e.substr(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1]}},r.getDtlsParameters=function(e,t){return{role:"auto",fingerprints:r.matchPrefix(e+t,"a=fingerprint:").map(r.parseFingerprint)}},r.writeDtlsParameters=function(e,t){var n="a=setup:"+t+"\r\n";return e.fingerprints.forEach((function(e){n+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"})),n},r.parseCryptoLine=function(e){var t=e.substr(9).split(" ");return{tag:parseInt(t[0],10),cryptoSuite:t[1],keyParams:t[2],sessionParams:t.slice(3)}},r.writeCryptoLine=function(e){return"a=crypto:"+e.tag+" "+e.cryptoSuite+" "+("object"==typeof e.keyParams?r.writeCryptoKeyParams(e.keyParams):e.keyParams)+(e.sessionParams?" "+e.sessionParams.join(" "):"")+"\r\n"},r.parseCryptoKeyParams=function(e){if(0!==e.indexOf("inline:"))return null;var 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}},r.writeCryptoKeyParams=function(e){return e.keyMethod+":"+e.keySalt+(e.lifeTime?"|"+e.lifeTime:"")+(e.mkiValue&&e.mkiLength?"|"+e.mkiValue+":"+e.mkiLength:"")},r.getCryptoParameters=function(e,t){return r.matchPrefix(e+t,"a=crypto:").map(r.parseCryptoLine)},r.getIceParameters=function(e,t){var n=r.matchPrefix(e+t,"a=ice-ufrag:")[0],o=r.matchPrefix(e+t,"a=ice-pwd:")[0];return n&&o?{usernameFragment:n.substr(12),password:o.substr(10)}:null},r.writeIceParameters=function(e){return"a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n"},r.parseRtpParameters=function(e){for(var t={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},n=r.splitLines(e)[0].split(" "),o=3;o<n.length;o++){var i=n[o],a=r.matchPrefix(e,"a=rtpmap:"+i+" ")[0];if(a){var c=r.parseRtpMap(a),s=r.matchPrefix(e,"a=fmtp:"+i+" ");switch(c.parameters=s.length?r.parseFmtp(s[0]):{},c.rtcpFeedback=r.matchPrefix(e,"a=rtcp-fb:"+i+" ").map(r.parseRtcpFb),t.codecs.push(c),c.name.toUpperCase()){case"RED":case"ULPFEC":t.fecMechanisms.push(c.name.toUpperCase())}}}return r.matchPrefix(e,"a=extmap:").forEach((function(e){t.headerExtensions.push(r.parseExtmap(e))})),t},r.writeRtpDescription=function(e,t){var n="";n+="m="+e+" ",n+=t.codecs.length>0?"9":"0",n+=" UDP/TLS/RTP/SAVPF ",n+=t.codecs.map((function(e){return 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((function(e){n+=r.writeRtpMap(e),n+=r.writeFmtp(e),n+=r.writeRtcpFb(e)}));var o=0;return t.codecs.forEach((function(e){e.maxptime>o&&(o=e.maxptime)})),o>0&&(n+="a=maxptime:"+o+"\r\n"),n+="a=rtcp-mux\r\n",t.headerExtensions&&t.headerExtensions.forEach((function(e){n+=r.writeExtmap(e)})),n},r.parseRtpEncodingParameters=function(e){var t,n=[],o=r.parseRtpParameters(e),i=-1!==o.fecMechanisms.indexOf("RED"),a=-1!==o.fecMechanisms.indexOf("ULPFEC"),c=r.matchPrefix(e,"a=ssrc:").map((function(e){return r.parseSsrcMedia(e)})).filter((function(e){return"cname"===e.attribute})),s=c.length>0&&c[0].ssrc,u=r.matchPrefix(e,"a=ssrc-group:FID").map((function(e){return e.substr(17).split(" ").map((function(e){return parseInt(e,10)}))}));u.length>0&&u[0].length>1&&u[0][0]===s&&(t=u[0][1]),o.codecs.forEach((function(e){if("RTX"===e.name.toUpperCase()&&e.parameters.apt){var r={ssrc:s,codecPayloadType:parseInt(e.parameters.apt,10)};s&&t&&(r.rtx={ssrc:t}),n.push(r),i&&((r=JSON.parse(JSON.stringify(r))).fec={ssrc:s,mechanism:a?"red+ulpfec":"red"},n.push(r))}})),0===n.length&&s&&n.push({ssrc:s});var f=r.matchPrefix(e,"b=");return f.length&&(f=0===f[0].indexOf("b=TIAS:")?parseInt(f[0].substr(7),10):0===f[0].indexOf("b=AS:")?1e3*parseInt(f[0].substr(5),10)*.95-16e3:void 0,n.forEach((function(e){e.maxBitrate=f}))),n},r.parseRtcpParameters=function(e){var t={},n=r.matchPrefix(e,"a=ssrc:").map((function(e){return r.parseSsrcMedia(e)})).filter((function(e){return"cname"===e.attribute}))[0];n&&(t.cname=n.value,t.ssrc=n.ssrc);var o=r.matchPrefix(e,"a=rtcp-rsize");t.reducedSize=o.length>0,t.compound=0===o.length;var i=r.matchPrefix(e,"a=rtcp-mux");return t.mux=i.length>0,t},r.parseMsid=function(e){var t,n=r.matchPrefix(e,"a=msid:");if(1===n.length)return{stream:(t=n[0].substr(7).split(" "))[0],track:t[1]};var o=r.matchPrefix(e,"a=ssrc:").map((function(e){return r.parseSsrcMedia(e)})).filter((function(e){return"msid"===e.attribute}));return o.length>0?{stream:(t=o[0].value.split(" "))[0],track:t[1]}:void 0},r.parseSctpDescription=function(e){var t,n=r.parseMLine(e),o=r.matchPrefix(e,"a=max-message-size:");o.length>0&&(t=parseInt(o[0].substr(19),10)),isNaN(t)&&(t=65536);var i=r.matchPrefix(e,"a=sctp-port:");if(i.length>0)return{port:parseInt(i[0].substr(12),10),protocol:n.fmt,maxMessageSize:t};if(r.matchPrefix(e,"a=sctpmap:").length>0){var a=r.matchPrefix(e,"a=sctpmap:")[0].substr(10).split(" ");return{port:parseInt(a[0],10),protocol:a[1],maxMessageSize:t}}},r.writeSctpDescription=function(e,t){var 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("")},r.generateSessionId=function(){return Math.random().toString().substr(2,21)},r.writeSessionBoilerplate=function(e,t,n){var o=void 0!==t?t:2;return"v=0\r\no="+(n||"thisisadapterortc")+" "+(e||r.generateSessionId())+" "+o+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},r.writeMediaSection=function(e,t,n,o){var i=r.writeRtpDescription(e.kind,t);if(i+=r.writeIceParameters(e.iceGatherer.getLocalParameters()),i+=r.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===n?"actpass":"active"),i+="a=mid:"+e.mid+"\r\n",e.direction?i+="a="+e.direction+"\r\n":e.rtpSender&&e.rtpReceiver?i+="a=sendrecv\r\n":e.rtpSender?i+="a=sendonly\r\n":e.rtpReceiver?i+="a=recvonly\r\n":i+="a=inactive\r\n",e.rtpSender){var a="msid:"+o.id+" "+e.rtpSender.track.id+"\r\n";i+="a="+a,i+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+a,e.sendEncodingParameters[0].rtx&&(i+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+a,i+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return i+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+r.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(i+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+r.localCName+"\r\n"),i},r.getDirection=function(e,t){for(var n=r.splitLines(e),o=0;o<n.length;o++)switch(n[o]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return n[o].substr(2)}return t?r.getDirection(t):"sendrecv"},r.getKind=function(e){return r.splitLines(e)[0].split(" ")[0].substr(2)},r.isRejected=function(e){return"0"===e.split(" ",2)[1]},r.parseMLine=function(e){var t=r.splitLines(e)[0].substr(2).split(" ");return{kind:t[0],port:parseInt(t[1],10),protocol:t[2],fmt:t.slice(3).join(" ")}},r.parseOLine=function(e){var t=r.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]}},r.isValidSDP=function(e){if("string"!=typeof e||0===e.length)return!1;for(var t=r.splitLines(e),n=0;n<t.length;n++)if(t[n].length<2||"="!==t[n].charAt(1))return!1;return!0},e.exports=r},MFOe:function(e,t,n){(function(t){var n=Object.assign?Object.assign:function(e,t,n,r){for(var o=1;o<arguments.length;o++)c(Object(arguments[o]),(function(t,n){e[n]=t}));return e},r=function(){if(Object.create)return function(e,t,r,o){var i=a(arguments,1);return n.apply(this,[Object.create(e)].concat(i))};{function e(){}return function(t,r,o,i){var c=a(arguments,1);return e.prototype=t,n.apply(this,[new e].concat(c))}}}(),o=String.prototype.trim?function(e){return String.prototype.trim.call(e)}:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},i="undefined"!=typeof window?window:t;function a(e,t){return Array.prototype.slice.call(e,t||0)}function c(e,t){s(e,(function(e,n){return t(e,n),!1}))}function s(e,t){if(u(e)){for(var n=0;n<e.length;n++)if(t(e[n],n))return e[n]}else for(var r in e)if(e.hasOwnProperty(r)&&t(e[r],r))return e[r]}function u(e){return null!=e&&"function"!=typeof e&&"number"==typeof e.length}e.exports={assign:n,create:r,trim:o,bind:function(e,t){return function(){return t.apply(e,Array.prototype.slice.call(arguments,0))}},slice:a,each:c,map:function(e,t){var n=u(e)?[]:{};return s(e,(function(e,r){return n[r]=t(e,r),!1})),n},pluck:s,isList:u,isFunction:function(e){return e&&"[object Function]"==={}.toString.call(e)},isObject:function(e){return e&&"[object Object]"==={}.toString.call(e)},Global:i}}).call(this,n("yLpj"))},PD8m:function(e,t){e.exports={name:"memoryStorage",read:function(e){return n[e]},write:function(e,t){n[e]=t},each:function(e){for(var t in n)n.hasOwnProperty(t)&&e(n[t],t)},remove:function(e){delete n[e]},clearAll:function(e){n={}}};var n={}},RELg:function(e,t,n){var r=n("MFOe").Global;e.exports={name:"oldIE-userDataStorage",write:function(e,t){if(a)return;var n=s(e);i((function(e){e.setAttribute(n,t),e.save("storejs")}))},read:function(e){if(a)return;var t=s(e),n=null;return i((function(e){n=e.getAttribute(t)})),n},each:function(e){i((function(t){for(var n=t.XMLDocument.documentElement.attributes,r=n.length-1;r>=0;r--){var o=n[r];e(t.getAttribute(o.name),o.name)}}))},remove:function(e){var t=s(e);i((function(e){e.removeAttribute(t),e.save("storejs")}))},clearAll:function(){i((function(e){var t=e.XMLDocument.documentElement.attributes;e.load("storejs");for(var n=t.length-1;n>=0;n--)e.removeAttribute(t[n].name);e.save("storejs")}))}};var o=r.document,i=function(){if(!o||!o.documentElement||!o.documentElement.addBehavior)return null;var e,t,n;try{(t=new ActiveXObject("htmlfile")).open(),t.write('<script>document.w=window<\/script><iframe src="/favicon.ico"></iframe>'),t.close(),e=t.w.frames[0].document,n=e.createElement("div")}catch(t){n=o.createElement("div"),e=o.body}return function(t){var r=[].slice.call(arguments,0);r.unshift(n),e.appendChild(n),n.addBehavior("#default#userData"),n.load("storejs"),t.apply(this,r),e.removeChild(n)}}(),a=(r.navigator?r.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./);var c=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function s(e){return e.replace(/^\d/,"___$&").replace(c,"___")}},gRFJ:function(e,t,n){e.exports=[n("rdUC"),n("ynwM"),n("RELg"),n("DlR+"),n("CrYA"),n("PD8m")]},gaXo:function(module,exports){"object"!=typeof JSON&&(JSON={}),function(){"use strict";var rx_one=/^[\],:{}\s]*$/,rx_two=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,rx_three=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,rx_four=/(?:^|:|,)(?:\s*\[)+/g,rx_escapable=/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,rx_dangerous=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta,rep;function f(e){return e<10?"0"+e:e}function this_value(){return this.valueOf()}function quote(e){return rx_escapable.lastIndex=0,rx_escapable.test(e)?'"'+e.replace(rx_escapable,(function(e){var t=meta[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+e+'"'}function str(e,t){var n,r,o,i,a,c=gap,s=t[e];switch(s&&"object"==typeof s&&"function"==typeof s.toJSON&&(s=s.toJSON(e)),"function"==typeof rep&&(s=rep.call(t,e,s)),typeof s){case"string":return quote(s);case"number":return isFinite(s)?String(s):"null";case"boolean":case"null":return String(s);case"object":if(!s)return"null";if(gap+=indent,a=[],"[object Array]"===Object.prototype.toString.apply(s)){for(i=s.length,n=0;n<i;n+=1)a[n]=str(n,s)||"null";return o=0===a.length?"[]":gap?"[\n"+gap+a.join(",\n"+gap)+"\n"+c+"]":"["+a.join(",")+"]",gap=c,o}if(rep&&"object"==typeof rep)for(i=rep.length,n=0;n<i;n+=1)"string"==typeof rep[n]&&(o=str(r=rep[n],s))&&a.push(quote(r)+(gap?": ":":")+o);else for(r in s)Object.prototype.hasOwnProperty.call(s,r)&&(o=str(r,s))&&a.push(quote(r)+(gap?": ":":")+o);return o=0===a.length?"{}":gap?"{\n"+gap+a.join(",\n"+gap)+"\n"+c+"}":"{"+a.join(",")+"}",gap=c,o}}"function"!=typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},Boolean.prototype.toJSON=this_value,Number.prototype.toJSON=this_value,String.prototype.toJSON=this_value),"function"!=typeof JSON.stringify&&(meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},JSON.stringify=function(e,t,n){var r;if(gap="",indent="","number"==typeof n)for(r=0;r<n;r+=1)indent+=" ";else"string"==typeof n&&(indent=n);if(rep=t,t&&"function"!=typeof t&&("object"!=typeof t||"number"!=typeof t.length))throw new Error("JSON.stringify");return str("",{"":e})}),"function"!=typeof JSON.parse&&(JSON.parse=function(text,reviver){var j;function walk(e,t){var n,r,o=e[t];if(o&&"object"==typeof o)for(n in o)Object.prototype.hasOwnProperty.call(o,n)&&(void 0!==(r=walk(o,n))?o[n]=r:delete o[n]);return reviver.call(e,t,o)}if(text=String(text),rx_dangerous.lastIndex=0,rx_dangerous.test(text)&&(text=text.replace(rx_dangerous,(function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}))),rx_one.test(text.replace(rx_two,"@").replace(rx_three,"]").replace(rx_four,"")))return j=eval("("+text+")"),"function"==typeof reviver?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}()},je13:function(e,t,n){var r=n("5nXd"),o=n("gRFJ"),i=[n("uQRt")];e.exports=r.createStore(o,i)},rdUC:function(e,t,n){var r=n("MFOe").Global;function o(){return r.localStorage}function i(e){return o().getItem(e)}e.exports={name:"localStorage",read:i,write:function(e,t){return o().setItem(e,t)},each:function(e){for(var t=o().length-1;t>=0;t--){var n=o().key(t);e(i(n),n)}},remove:function(e){return o().removeItem(e)},clearAll:function(){return o().clear()}}},uQRt:function(e,t,n){e.exports=function(){return n("gaXo"),{}}},viyd:function(e,t,n){window,e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},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 r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},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=87)}([function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(t)}e.exports=n},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}},function(e,t,n){var r=n(19),o=n(1);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?o(e):t}},function(e,t,n){var r=n(222);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}},function(e,t,n){e.exports={EPSILON:n(61),create:n(62),clone:n(154),fromValues:n(155),copy:n(156),set:n(157),equals:n(158),exactEquals:n(159),add:n(160),subtract:n(63),sub:n(161),multiply:n(64),mul:n(162),divide:n(65),div:n(163),inverse:n(164),min:n(165),max:n(166),rotate:n(167),floor:n(168),ceil:n(169),round:n(170),scale:n(171),scaleAndAdd:n(172),distance:n(66),dist:n(173),squaredDistance:n(67),sqrDist:n(174),length:n(68),len:n(175),squaredLength:n(69),sqrLen:n(176),negate:n(177),normalize:n(178),dot:n(179),cross:n(180),lerp:n(181),random:n(182),transformMat2:n(183),transformMat2d:n(184),transformMat3:n(185),transformMat4:n(186),forEach:n(187),limit:n(188)}},function(e,t,n){"use strict";t.a={init:function(e,t){for(var n=e.length;n--;)e[n]=t},shuffle:function(e){for(var t=e.length-1;t>=0;t--){var n=Math.floor(Math.random()*t),r=e[t];e[t]=e[n],e[n]=r}return e},toPointList:function(e){var t=e.reduce((function(e,t){var n="[".concat(t.join(","),"]");return e.push(n),e}),[]);return"[".concat(t.join(",\r\n"),"]")},threshold:function(e,t,n){return e.reduce((function(r,o){return n.apply(e,[o])>=t&&r.push(o),r}),[])},maxIndex:function(e){for(var t=0,n=0;n<e.length;n++)e[n]>e[t]&&(t=n);return t},max:function(e){for(var t=0,n=0;n<e.length;n++)e[n]>t&&(t=e[n]);return t},sum:function(e){for(var t=e.length,n=0;t--;)n+=e[t];return n}}},function(e,t,n){"use strict";n.d(t,"h",(function(){return l})),n.d(t,"i",(function(){return p})),n.d(t,"b",(function(){return h})),n.d(t,"j",(function(){return v})),n.d(t,"e",(function(){return m})),n.d(t,"c",(function(){return g})),n.d(t,"f",(function(){return y})),n.d(t,"g",(function(){return b})),n.d(t,"a",(function(){return x})),n.d(t,"d",(function(){return S}));var r=n(7),o=n(83),i={clone:r.clone,dot:r.dot},a=function(e,t){var n=[],r={rad:0,vec:i.clone([0,0])},o={};function a(e){o[e.id]=e,n.push(e)}function c(){var e,t=0;for(e=0;e<n.length;e++)t+=n[e].rad;r.rad=t/n.length,r.vec=i.clone([Math.cos(r.rad),Math.sin(r.rad)])}return a(e),c(),{add:function(e){o[e.id]||(a(e),c())},fits:function(e){return Math.abs(i.dot(e.point.vec,r.vec))>t},getPoints:function(){return n},getCenter:function(){return r}}},c=function(e,t,n){return{rad:e[n],point:e,id:t}},s=n(8),u={clone:r.clone},f={clone:o.clone};function l(e,t){return{x:e,y:t,toVec2:function(){return u.clone([this.x,this.y])},toVec3:function(){return f.clone([this.x,this.y,1])},round:function(){return this.x=this.x>0?Math.floor(this.x+.5):Math.floor(this.x-.5),this.y=this.y>0?Math.floor(this.y+.5):Math.floor(this.y-.5),this}}}function d(e,t){t||(t=8);for(var n=e.data,r=n.length,o=8-t,i=new Int32Array(1<<t);r--;)i[n[r]>>o]++;return i}function p(e,t){var n=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,r=8-n;function o(e,n){for(var r=0,o=e;o<=n;o++)r+=t[o];return r}function i(e,n){for(var r=0,o=e;o<=n;o++)r+=o*t[o];return r}function a(){var r,a,c,u,f=[0],l=(1<<n)-1;t=d(e,n);for(var p=1;p<l;p++)0==(c=(r=o(0,p))*(a=o(p+1,l)))&&(c=1),u=i(0,p)*a-i(p+1,l)*r,f[p]=u*u/c;return s.a.maxIndex(f)}var c=a();return c<<r}(e);return function(e,t,n){n||(n=e);for(var r=e.data,o=r.length,i=n.data;o--;)i[o]=r[o]<t?1:0}(e,n,t),n}function h(e,t,n){var r,o,i,s,u=[];function f(e){var t=!1;for(o=0;o<u.length;o++)(i=u[o]).fits(e)&&(i.add(e),t=!0);return t}for(n||(n="rad"),r=0;r<e.length;r++)f(s=c(e[r],r,n))||u.push(a(s,t));return u}function v(e,t,n){var r,o,i,a,c=0,s=0,u=[];for(r=0;r<t;r++)u[r]={score:0,item:null};for(r=0;r<e.length;r++)if((o=n.apply(this,[e[r]]))>s)for((i=u[c]).score=o,i.item=e[r],s=Number.MAX_VALUE,a=0;a<t;a++)u[a].score<s&&(s=u[a].score,c=a);return u}function m(e,t,n){for(var r,o=0,i=t.x,a=Math.floor(e.length/4),c=t.x/2,s=0,u=t.x;i<a;){for(r=0;r<c;r++)n[s]=(.299*e[4*o+0]+.587*e[4*o+1]+.114*e[4*o+2]+(.299*e[4*(o+1)+0]+.587*e[4*(o+1)+1]+.114*e[4*(o+1)+2])+(.299*e[4*i+0]+.587*e[4*i+1]+.114*e[4*i+2])+(.299*e[4*(i+1)+0]+.587*e[4*(i+1)+1]+.114*e[4*(i+1)+2]))/4,s++,o+=2,i+=2;o+=u,i+=u}}function g(e,t,n){var r=e.length/4|0;if(n&&!0===n.singleChannel)for(var o=0;o<r;o++)t[o]=e[4*o+0];else for(var i=0;i<r;i++)t[i]=.299*e[4*i+0]+.587*e[4*i+1]+.114*e[4*i+2]}function y(e,t){for(var n=e.data,r=e.size.x,o=t.data,i=0,a=r,c=n.length,s=r/2,u=0;a<c;){for(var f=0;f<s;f++)o[u]=Math.floor((n[i]+n[i+1]+n[a]+n[a+1])/4),u++,i+=2,a+=2;i+=r,a+=r}}function b(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0],n=e[0],r=e[1],o=e[2],i=o*r,a=i*(1-Math.abs(n/60%2-1)),c=o-i,s=0,u=0,f=0;return n<60?(s=i,u=a):n<120?(s=a,u=i):n<180?(u=i,f=a):n<240?(u=a,f=i):n<300?(s=a,f=i):n<360&&(s=i,f=a),t[0]=255*(s+c)|0,t[1]=255*(u+c)|0,t[2]=255*(f+c)|0,t}function _(e){for(var t=[],n=[],r=1;r<Math.sqrt(e)+1;r++)e%r==0&&(n.push(r),r!==e/r&&t.unshift(Math.floor(e/r)));return n.concat(t)}function x(e,t){var n,r=_(t.x),o=_(t.y),i=Math.max(t.x,t.y),a=function(e,t){for(var n=0,r=0,o=[];n<e.length&&r<t.length;)e[n]===t[r]?(o.push(e[n]),n++,r++):e[n]>t[r]?r++:n++;return o}(r,o),c=[8,10,15,20,32,60,80],s={"x-small":5,small:4,medium:3,large:2,"x-large":1},u=s[e]||s.medium,f=c[u],l=Math.floor(i/f);function d(e){for(var t=0,n=e[Math.floor(e.length/2)];t<e.length-1&&e[t]<l;)t++;return t>0&&(n=Math.abs(e[t]-l)>Math.abs(e[t-1]-l)?e[t-1]:e[t]),l/n<c[u+1]/c[u]&&l/n>c[u-1]/c[u]?{x:n,y:n}:null}return(n=d(a))||(n=d(_(i)))||(n=d(_(l*f))),n}var C={top:function(e,t){return"%"===e.unit?Math.floor(t.height*(e.value/100)):null},right:function(e,t){return"%"===e.unit?Math.floor(t.width-t.width*(e.value/100)):null},bottom:function(e,t){return"%"===e.unit?Math.floor(t.height-t.height*(e.value/100)):null},left:function(e,t){return"%"===e.unit?Math.floor(t.width*(e.value/100)):null}};function S(e,t,n){var r={width:e,height:t},o=Object.keys(n).reduce((function(e,t){var o=function(e){return{value:parseFloat(e),unit:(e.indexOf("%"),e.length,"%")}}(n[t]),i=C[t](o,r);return e[t]=i,e}),{});return{sx:o.left,sy:o.top,sw:o.right-o.left,sh:o.bottom-o.top}}},function(e,t,n){"use strict";var r=n(82),o=n.n(r),i=n(3),a=n.n(i),c=n(4),s=n.n(c),u=n(0),f=n.n(u),l=n(7),d=n(9),p=n(8),h={clone:l.clone};function v(e){if(e<0)throw new Error("expected positive number, received ".concat(e))}var m=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Uint8Array,o=arguments.length>3?arguments[3]:void 0;a()(this,e),f()(this,"data",void 0),f()(this,"size",void 0),f()(this,"indexMapping",void 0),n?this.data=n:(this.data=new r(t.x*t.y),o&&p.a.init(this.data,0)),this.size=t}return s()(e,[{key:"inImageWithBorder",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return v(t),e.x>=0&&e.y>=0&&e.x<this.size.x+2*t&&e.y<this.size.y+2*t}},{key:"subImageAsCopy",value:function(e,t){v(t.x),v(t.y);for(var n=e.size,r=n.x,o=n.y,i=0;i<r;i++)for(var a=0;a<o;a++)e.data[a*r+i]=this.data[(t.y+a)*this.size.x+t.x+i];return e}},{key:"get",value:function(e,t){return this.data[t*this.size.x+e]}},{key:"getSafe",value:function(e,t){if(!this.indexMapping){this.indexMapping={x:[],y:[]};for(var n=0;n<this.size.x;n++)this.indexMapping.x[n]=n,this.indexMapping.x[n+this.size.x]=n;for(var r=0;r<this.size.y;r++)this.indexMapping.y[r]=r,this.indexMapping.y[r+this.size.y]=r}return this.data[this.indexMapping.y[t+this.size.y]*this.size.x+this.indexMapping.x[e+this.size.x]]}},{key:"set",value:function(e,t,n){return this.data[t*this.size.x+e]=n,delete this.indexMapping,this}},{key:"zeroBorder",value:function(){for(var e=this.size,t=e.x,n=e.y,r=0;r<t;r++)this.data[r]=this.data[(n-1)*t+r]=0;for(var o=1;o<n-1;o++)this.data[o*t]=this.data[o*t+(t-1)]=0;return delete this.indexMapping,this}},{key:"moments",value:function(e){var t,n,r,o,i,a,c,s,u,f,l=this.data,d=this.size.y,p=this.size.x,v=[],m=[],g=Math.PI,y=g/4;if(e<=0)return m;for(i=0;i<e;i++)v[i]={m00:0,m01:0,m10:0,m11:0,m02:0,m20:0,theta:0,rad:0};for(n=0;n<d;n++)for(o=n*n,t=0;t<p;t++)(r=l[n*p+t])>0&&((a=v[r-1]).m00+=1,a.m01+=n,a.m10+=t,a.m11+=t*n,a.m02+=o,a.m20+=t*t);for(i=0;i<e;i++)a=v[i],isNaN(a.m00)||0===a.m00||(s=a.m10/a.m00,u=a.m01/a.m00,c=a.m11/a.m00-s*u,f=(a.m02/a.m00-u*u-(a.m20/a.m00-s*s))/(2*c),f=.5*Math.atan(f)+(c>=0?y:-y)+g,a.theta=(180*f/g+90)%180-90,a.theta<0&&(a.theta+=180),a.rad=f>g?f-g:f,a.vec=h.clone([Math.cos(f),Math.sin(f)]),m.push(a));return m}},{key:"getAsRGBA",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=new Uint8ClampedArray(4*this.size.x*this.size.y),n=0;n<this.size.y;n++)for(var r=0;r<this.size.x;r++){var o=n*this.size.x+r,i=this.get(r,n)*e;t[4*o+0]=i,t[4*o+1]=i,t[4*o+2]=i,t[4*o+3]=255}return t}},{key:"show",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=e.getContext("2d");if(!n)throw new Error("Unable to get canvas context");var r=n.getImageData(0,0,e.width,e.height),o=this.getAsRGBA(t);e.width=this.size.x,e.height=this.size.y;var i=new ImageData(o,r.width,r.height);n.putImageData(i,0,0)}},{key:"overlay",value:function(e,t,n){var r=t<0||t>360?360:t,i=[0,1,1],a=[0,0,0],c=[255,255,255],s=[0,0,0],u=e.getContext("2d");if(!u)throw new Error("Unable to get canvas context");for(var f=u.getImageData(n.x,n.y,this.size.x,this.size.y),l=f.data,p=this.data.length;p--;){i[0]=this.data[p]*r;var h=4*p,v=i[0]<=0?c:i[0]>=360?s:Object(d.g)(i,a),m=o()(v,3);l[h]=m[0],l[h+1]=m[1],l[h+2]=m[2],l[h+3]=255}u.putImageData(f,n.x,n.y)}}]),e}();t.a=m},function(e,t,n){e.exports=n(227)},function(e,t,n){var r=n(226);function o(t,n,i){return"undefined"!=typeof Reflect&&Reflect.get?e.exports=o=Reflect.get:e.exports=o=function(e,t,n){var o=r(e,t);if(o){var i=Object.getOwnPropertyDescriptor(o,t);return i.get?i.get.call(n):i.value}},o(t,n,i||t)}e.exports=o},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t){var n=Array.isArray;e.exports=n},function(e,t,n){"use strict";t.a={drawRect:function(e,t,n,r){n.strokeStyle=r.color,n.fillStyle=r.color,n.lineWidth=r.lineWidth||1,n.beginPath(),n.strokeRect(e.x,e.y,t.x,t.y)},drawPath:function(e,t,n,r){n.strokeStyle=r.color,n.fillStyle=r.color,n.lineWidth=r.lineWidth,n.beginPath(),n.moveTo(e[0][t.x],e[0][t.y]);for(var o=1;o<e.length;o++)n.lineTo(e[o][t.x],e[o][t.y]);n.closePath(),n.stroke()},drawImage:function(e,t,n){var r=n.getImageData(0,0,t.x,t.y),o=r.data,i=o.length,a=e.length;if(i/a!=4)return!1;for(;a--;){var c=e[a];o[--i]=255,o[--i]=c,o[--i]=c,o[--i]=c}return n.putImageData(r,0,0),!0}}},function(e,t,n){var r=n(88),o=n(143)((function(e,t,n){r(e,t,n)}));e.exports=o},function(e,t,n){var r=n(44),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();e.exports=i},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=n=function(e){return typeof e}:e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(t)}e.exports=n},function(e,t){function n(e,t,n,r,o,i,a){try{var c=e[i](a),s=c.value}catch(e){return void n(e)}c.done?t(s):Promise.resolve(s).then(r,o)}e.exports=function(e){return function(){var t=this,r=arguments;return new Promise((function(o,i){var a=e.apply(t,r);function c(e){n(a,o,i,c,s,"next",e)}function s(e){n(a,o,i,c,s,"throw",e)}c(void 0)}))}}},function(e,t,n){"use strict";t.a={searchDirections:[[0,1],[1,1],[1,0],[1,-1],[0,-1],[-1,-1],[-1,0],[-1,1]],create:function(e,t){var n,r=e.data,o=t.data,i=this.searchDirections,a=e.size.x;function c(e,t,c,s){var u,f,l;for(u=0;u<7;u++){if(f=e.cy+i[e.dir][0],l=e.cx+i[e.dir][1],r[n=f*a+l]===t&&(0===o[n]||o[n]===c))return o[n]=c,e.cy=f,e.cx=l,!0;0===o[n]&&(o[n]=s),e.dir=(e.dir+1)%8}return!1}function s(e,t,n){return{dir:n,x:e,y:t,next:null,prev:null}}return{trace:function(e,t,n,r){return c(e,t,n,r)},contourTracing:function(e,t,n,r,o){return function(e,t,n,r,o){var i,a,u,f=null,l={cx:t,cy:e,dir:0};if(c(l,r,n,o)){i=f=s(t,e,l.dir),u=l.dir,(a=s(l.cx,l.cy,0)).prev=i,i.next=a,a.next=null,i=a;do{l.dir=(l.dir+6)%8,c(l,r,n,o),u!==l.dir?(i.dir=l.dir,(a=s(l.cx,l.cy,0)).prev=i,i.next=a,a.next=null,i=a):(i.dir=u,i.x=l.cx,i.y=l.cy),u=l.dir}while(l.cx!==t||l.cy!==e);f.prev=i.prev,i.prev.next=f}return f}(e,t,n,r,o)}}}}},function(e,t,n){var r=n(27),o=n(101),i=n(102),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?o(e):i(e)}},function(e,t,n){"use strict";(function(e){var r,o,i,a,c,s,u,f,l,d,p,h,v=n(7),m=n(34),g=n(10),y=n(9),b=n(8),_=(n(15),n(85)),x=n(21),C=n(86),S={ctx:{binary:null},dom:{binary:null}},R={x:0,y:0};function w(e){var t,n,o,i,a,c,s,u=l.size.x,f=l.size.y,d=-l.size.x,p=-l.size.y;for(t=0,n=0;n<e.length;n++)t+=(i=e[n]).rad;for((t=(180*(t/=e.length)/Math.PI+90)%180-90)<0&&(t+=180),t=(180-t)*Math.PI/180,a=m.copy(m.create(),[Math.cos(t),Math.sin(t),-Math.sin(t),Math.cos(t)]),n=0;n<e.length;n++)for(i=e[n],o=0;o<4;o++)v.transformMat2(i.box[o],i.box[o],a);for(n=0;n<e.length;n++)for(i=e[n],o=0;o<4;o++)i.box[o][0]<u&&(u=i.box[o][0]),i.box[o][0]>d&&(d=i.box[o][0]),i.box[o][1]<f&&(f=i.box[o][1]),i.box[o][1]>p&&(p=i.box[o][1]);for(c=[[u,f],[d,f],[d,p],[u,p]],s=r.halfSample?2:1,a=m.invert(a,a),o=0;o<4;o++)v.transformMat2(c[o],c[o],a);for(o=0;o<4;o++)v.scale(c[o],c[o],s);return c}function T(e,t){l.subImageAsCopy(a,Object(y.h)(e,t)),h.skeletonize()}function E(e,t,n,r){var o,i,c,s,u=[],f=[],l=Math.ceil(d.x/3);if(e.length>=2){for(o=0;o<e.length;o++)e[o].m00>l&&u.push(e[o]);if(u.length>=2){for(c=function(e){var t=Object(y.b)(e,.9),n=Object(y.j)(t,1,(function(e){return e.getPoints().length})),r=[],o=[];if(1===n.length){r=n[0].item.getPoints();for(var i=0;i<r.length;i++)o.push(r[i].point)}return o}(u),i=0,o=0;o<c.length;o++)i+=c[o].rad;c.length>1&&c.length>=u.length/4*3&&c.length>e.length/4&&(i/=c.length,s={index:t[1]*R.x+t[0],pos:{x:n,y:r},box:[v.clone([n,r]),v.clone([n+a.size.x,r]),v.clone([n+a.size.x,r+a.size.y]),v.clone([n,r+a.size.y])],moments:c,rad:i,vec:v.clone([Math.cos(i),Math.sin(i)])},f.push(s))}}return f}t.a={init:function(t,n){r=n,p=t,function(){o=r.halfSample?new g.a({x:p.size.x/2|0,y:p.size.y/2|0}):p,d=Object(y.a)(r.patchSize,o.size),R.x=o.size.x/d.x|0,R.y=o.size.y/d.y|0,l=new g.a(o.size,void 0,Uint8Array,!1),c=new g.a(d,void 0,Array,!0);var t=new ArrayBuffer(65536);a=new g.a(d,new Uint8Array(t,0,d.x*d.y)),i=new g.a(d,new Uint8Array(t,d.x*d.y*3,d.x*d.y),void 0,!0),h=Object(C.a)("undefined"!=typeof window?window:"undefined"!=typeof self?self:e,{size:d.x},t),f=new g.a({x:o.size.x/a.size.x|0,y:o.size.y/a.size.y|0},void 0,Array,!0),s=new g.a(f.size,void 0,void 0,!0),u=new g.a(f.size,void 0,Int32Array,!0)}(),r.useWorker||"undefined"==typeof document||(S.dom.binary=document.createElement("canvas"),S.dom.binary.className="binaryBuffer",S.ctx.binary=S.dom.binary.getContext("2d"),S.dom.binary.width=l.size.x,S.dom.binary.height=l.size.y)},locate:function(){r.halfSample&&Object(y.f)(p,o),Object(y.i)(o,l),l.zeroBorder();var e=function(){var e,t,n,r,o,s,u=[];for(e=0;e<R.x;e++)for(t=0;t<R.y;t++)T(n=a.size.x*e,r=a.size.y*t),i.zeroBorder(),b.a.init(c.data,0),s=_.a.create(i,c).rasterize(0),o=c.moments(s.count),u=u.concat(E(o,[e,t],n,r));return u}();if(e.length<R.x*R.y*.05)return null;var t=function(e){var t,n,r=0,o=0;function i(){var e;for(e=0;e<u.data.length;e++)if(0===u.data[e]&&1===s.data[e])return e;return u.length}function a(e){var t,n,o,i,c,l=e%u.size.x,d=e/u.size.x|0;if(e<u.data.length)for(o=f.data[e],u.data[e]=r,c=0;c<x.a.searchDirections.length;c++)n=d+x.a.searchDirections[c][0],t=l+x.a.searchDirections[c][1],i=n*u.size.x+t,0!==s.data[i]?0===u.data[i]&&Math.abs(v.dot(f.data[i].vec,o.vec))>.95&&a(i):u.data[i]=Number.MAX_VALUE}for(b.a.init(s.data,0),b.a.init(u.data,0),b.a.init(f.data,null),t=0;t<e.length;t++)n=e[t],f.data[n.index]=n,s.data[n.index]=1;for(s.zeroBorder();(o=i())<u.data.length;)r++,a(o);return r}(e);if(t<1)return null;var n=function(e){var t,n,r=[];for(t=0;t<e;t++)r.push(0);for(n=u.data.length;n--;)u.data[n]>0&&r[u.data[n]-1]++;return(r=r.map((function(e,t){return{val:e,label:t+1}}))).sort((function(e,t){return t.val-e.val})),r.filter((function(e){return e.val>=5}))}(t);return 0===n.length?null:function(e,t){var n,r,o,i,a=[],c=[];for(n=0;n<e.length;n++){for(r=u.data.length,a.length=0;r--;)u.data[r]===e[n].label&&(o=f.data[r],a.push(o));(i=w(a))&&c.push(i)}return c}(n)},checkImageConstraints:function(e,t){var n,r,o=e.getWidth(),i=e.getHeight(),a=t.halfSample?.5:1;e.getConfig().area&&(r=Object(y.d)(o,i,e.getConfig().area),e.setTopRight({x:r.sx,y:r.sy}),e.setCanvasSize({x:o,y:i}),o=r.sw,i=r.sh);var c={x:Math.floor(o*a),y:Math.floor(i*a)};if(n=Object(y.a)(t.patchSize,c),e.setWidth(Math.floor(Math.floor(c.x/n.x)*(1/a)*n.x)),e.setHeight(Math.floor(Math.floor(c.y/n.y)*(1/a)*n.y)),e.getWidth()%n.x==0&&e.getHeight()%n.y==0)return!0;throw new Error("Image dimensions do not comply with the current settings: Width (".concat(o," )and height (").concat(i,") must a multiple of ").concat(n.x))}}}).call(this,n(45))},function(e,t,n){var r=n(90),o=n(91),i=n(92),a=n(93),c=n(94);function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=r,s.prototype.delete=o,s.prototype.get=i,s.prototype.has=a,s.prototype.set=c,e.exports=s},function(e,t,n){var r=n(26);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t,n){var r=n(17).Symbol;e.exports=r},function(e,t,n){var r=n(35)(Object,"create");e.exports=r},function(e,t,n){var r=n(115);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},function(e,t,n){var r=n(130),o=n(18),i=Object.prototype,a=i.hasOwnProperty,c=i.propertyIsEnumerable,s=r(function(){return arguments}())?r:function(e){return o(e)&&a.call(e,"callee")&&!c.call(e,"callee")};e.exports=s},function(e,t){var n=/^(?:0|[1-9]\d*)$/;e.exports=function(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&n.test(e))&&e>-1&&e%1==0&&e<t}},function(e,t,n){var r=n(14),o=n(231),i=n(232),a=n(235);e.exports=function(e,t){return r(e)?e:o(e,t)?[e]:i(a(e))}},function(e,t,n){var r=n(223),o=n(224),i=n(59),a=n(225);e.exports=function(e){return r(e)||o(e)||i(e)||a()}},function(e,t,n){e.exports={determinant:n(247),transpose:n(248),multiply:n(249),identity:n(250),adjoint:n(251),rotate:n(252),invert:n(253),create:n(254),scale:n(255),copy:n(256),frob:n(257),ldu:n(258)}},function(e,t,n){var r=n(100),o=n(106);e.exports=function(e,t){var n=o(e,t);return r(n)?n:void 0}},function(e,t,n){var r=n(22),o=n(13);e.exports=function(e){if(!o(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},function(e,t,n){var r=n(48);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},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,n){var r=n(36),o=n(40);e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},function(e,t){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},function(e,t,n){var r=n(22),o=n(18);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}},function(e,t,n){var r=n(41);e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},function(e,t,n){var r=n(35)(n(17),"Map");e.exports=r},function(e,t,n){(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.exports=n}).call(this,n(45))},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){var r=n(107),o=n(114),i=n(116),a=n(117),c=n(118);function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=r,s.prototype.delete=o,s.prototype.get=i,s.prototype.has=a,s.prototype.set=c,e.exports=s},function(e,t,n){var r=n(37),o=n(26);e.exports=function(e,t,n){(void 0!==n&&!o(e[t],n)||void 0===n&&!(t in e))&&r(e,t,n)}},function(e,t,n){var r=n(35),o=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=o},function(e,t,n){var r=n(129)(Object.getPrototypeOf,Object);e.exports=r},function(e,t){var n=Object.prototype;e.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}},function(e,t,n){(function(e){var r=n(17),o=n(132),i=t&&!t.nodeType&&t,a=i&&"object"==typeof e&&e&&!e.nodeType&&e,c=a&&a.exports===i?r.Buffer:void 0,s=(c?c.isBuffer:void 0)||o;e.exports=s}).call(this,n(38)(e))},function(e,t,n){var r=n(134),o=n(135),i=n(136),a=i&&i.isTypedArray,c=a?o(a):r;e.exports=c},function(e,t){e.exports=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}},function(e,t,n){var r=n(37),o=n(26),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var a=e[t];i.call(e,t)&&o(a,n)&&(void 0!==n||t in e)||r(e,t,n)}},function(e,t,n){var r=n(139),o=n(141),i=n(39);e.exports=function(e){return i(e)?r(e,!0):o(e)}},function(e,t){e.exports=function(e){return e}},function(e,t,n){var r=n(145),o=Math.max;e.exports=function(e,t,n){return t=o(void 0===t?e.length-1:t,0),function(){for(var i=arguments,a=-1,c=o(i.length-t,0),s=Array(c);++a<c;)s[a]=i[t+a];a=-1;for(var u=Array(t+1);++a<t;)u[a]=i[a];return u[t]=n(s),r(e,this,u)}}},function(e,t,n){var r=n(146),o=n(148)(r);e.exports=o},function(e,t,n){var r=n(60);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}},function(e,t){e.exports=1e-6},function(e,t){e.exports=function(){var e=new Float32Array(2);return e[0]=0,e[1]=0,e}},function(e,t){e.exports=function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}},function(e,t){e.exports=function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e}},function(e,t){e.exports=function(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e}},function(e,t){e.exports=function(e,t){var n=t[0]-e[0],r=t[1]-e[1];return Math.sqrt(n*n+r*r)}},function(e,t){e.exports=function(e,t){var n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}},function(e,t){e.exports=function(e){var t=e[0],n=e[1];return Math.sqrt(t*t+n*n)}},function(e,t){e.exports=function(e){var t=e[0],n=e[1];return t*t+n*n}},function(e,t){e.exports=1e-6},function(e,t){e.exports=function(){var e=new Float32Array(3);return e[0]=0,e[1]=0,e[2]=0,e}},function(e,t){e.exports=function(e,t,n){var r=new Float32Array(3);return r[0]=e,r[1]=t,r[2]=n,r}},function(e,t){e.exports=function(e,t){var n=t[0],r=t[1],o=t[2],i=n*n+r*r+o*o;return i>0&&(i=1/Math.sqrt(i),e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i),e}},function(e,t){e.exports=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}},function(e,t){e.exports=function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}},function(e,t){e.exports=function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}},function(e,t){e.exports=function(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e}},function(e,t){e.exports=function(e,t){var n=t[0]-e[0],r=t[1]-e[1],o=t[2]-e[2];return Math.sqrt(n*n+r*r+o*o)}},function(e,t){e.exports=function(e,t){var n=t[0]-e[0],r=t[1]-e[1],o=t[2]-e[2];return n*n+r*r+o*o}},function(e,t){e.exports=function(e){var t=e[0],n=e[1],r=e[2];return Math.sqrt(t*t+n*n+r*r)}},function(e,t){e.exports=function(e){var t=e[0],n=e[1],r=e[2];return t*t+n*n+r*r}},function(e,t,n){var r=n(151),o=n(152),i=n(59),a=n(153);e.exports=function(e,t){return r(e)||o(e,t)||i(e,t)||a()}},function(e,t,n){e.exports={EPSILON:n(70),create:n(71),clone:n(189),angle:n(190),fromValues:n(72),copy:n(191),set:n(192),equals:n(193),exactEquals:n(194),add:n(195),subtract:n(75),sub:n(196),multiply:n(76),mul:n(197),divide:n(77),div:n(198),min:n(199),max:n(200),floor:n(201),ceil:n(202),round:n(203),scale:n(204),scaleAndAdd:n(205),distance:n(78),dist:n(206),squaredDistance:n(79),sqrDist:n(207),length:n(80),len:n(208),squaredLength:n(81),sqrLen:n(209),negate:n(210),inverse:n(211),normalize:n(73),dot:n(74),cross:n(212),lerp:n(213),random:n(214),transformMat4:n(215),transformMat3:n(216),transformQuat:n(217),rotateX:n(218),rotateY:n(219),rotateZ:n(220),forEach:n(221)}},function(e,t,n){var r=n(228),o=n(242)((function(e,t){return null==e?{}:r(e,t)}));e.exports=o},function(e,t,n){"use strict";var r=n(21),o={createContour2D:function(){return{dir:null,index:null,firstVertex:null,insideContours:null,nextpeer:null,prevpeer:null}},CONTOUR_DIR:{CW_DIR:0,CCW_DIR:1,UNKNOWN_DIR:2},DIR:{OUTSIDE_EDGE:-32767,INSIDE_EDGE:-32766},create:function(e,t){var n=e.data,i=t.data,a=e.size.x,c=e.size.y,s=r.a.create(e,t);return{rasterize:function(e){var t,r,u,f,l,d,p,h,v,m,g,y,b=[],_=0;for(y=0;y<400;y++)b[y]=0;for(b[0]=n[0],v=null,d=1;d<c-1;d++)for(f=0,r=b[0],l=1;l<a-1;l++)if(0===i[g=d*a+l])if((t=n[g])!==r){if(0===f)b[u=_+1]=t,r=t,null!==(p=s.contourTracing(d,l,u,t,o.DIR.OUTSIDE_EDGE))&&(_++,f=u,(h=o.createContour2D()).dir=o.CONTOUR_DIR.CW_DIR,h.index=f,h.firstVertex=p,h.nextpeer=v,h.insideContours=null,null!==v&&(v.prevpeer=h),v=h);else if(null!==(p=s.contourTracing(d,l,o.DIR.INSIDE_EDGE,t,f))){for((h=o.createContour2D()).firstVertex=p,h.insideContours=null,h.dir=0===e?o.CONTOUR_DIR.CCW_DIR:o.CONTOUR_DIR.CW_DIR,h.index=e,m=v;null!==m&&m.index!==f;)m=m.nextpeer;null!==m&&(h.nextpeer=m.insideContours,null!==m.insideContours&&(m.insideContours.prevpeer=h),m.insideContours=h)}}else i[g]=f;else i[g]===o.DIR.OUTSIDE_EDGE||i[g]===o.DIR.INSIDE_EDGE?(f=0,r=i[g]===o.DIR.INSIDE_EDGE?n[g]:b[0]):r=b[f=i[g]];for(m=v;null!==m;)m.index=e,m=m.nextpeer;return{cc:v,count:_}},debug:{drawContour:function(e,t){var n,r,i,a=e.getContext("2d"),c=t;for(a.strokeStyle="red",a.fillStyle="red",a.lineWidth=1,n=null!==c?c.insideContours:null;null!==c;){switch(null!==n?(r=n,n=n.nextpeer):(r=c,n=null!==(c=c.nextpeer)?c.insideContours:null),r.dir){case o.CONTOUR_DIR.CW_DIR:a.strokeStyle="red";break;case o.CONTOUR_DIR.CCW_DIR:a.strokeStyle="blue";break;case o.CONTOUR_DIR.UNKNOWN_DIR:a.strokeStyle="green"}i=r.firstVertex,a.beginPath(),a.moveTo(i.x,i.y);do{i=i.next,a.lineTo(i.x,i.y)}while(i!==r.firstVertex);a.stroke()}}}}}};t.a=o},function(e,t,n){"use strict";
    22/* @preserve ASM BEGIN */
    3 /* @preserve ASM END */t.a=function(e,t,n){"use asm";var r=new e.Uint8Array(n),o=t.size|0,i=e.Math.imul;function a(e,t){e|=0;t|=0;var n=0;var i=0;var a=0;var c=0;var s=0;var u=0;var f=0;var l=0;for(n=1;(n|0)<(o-1|0);n=n+1|0){l=l+o|0;for(i=1;(i|0)<(o-1|0);i=i+1|0){c=l-o|0;s=l+o|0;u=i-1|0;f=i+1|0;a=(r[e+c+u|0]|0)+(r[e+c+f|0]|0)+(r[e+l+i|0]|0)+(r[e+s+u|0]|0)+(r[e+s+f|0]|0)|0;if((a|0)==(5|0)){r[t+l+i|0]=1}else{r[t+l+i|0]=0}}}}function c(e,t,n){e|=0;t|=0;n|=0;var a=0;a=i(o,o)|0;while((a|0)>0){a=a-1|0;r[n+a|0]=(r[e+a|0]|0)-(r[t+a|0]|0)|0}}function s(e,t,n){e|=0;t|=0;n|=0;var a=0;a=i(o,o)|0;while((a|0)>0){a=a-1|0;r[n+a|0]=r[e+a|0]|0|(r[t+a|0]|0)|0}}function u(e){e|=0;var t=0;var n=0;n=i(o,o)|0;while((n|0)>0){n=n-1|0;t=(t|0)+(r[e+n|0]|0)|0}return t|0}function f(e,t){e|=0;t|=0;var n=0;n=i(o,o)|0;while((n|0)>0){n=n-1|0;r[e+n|0]=t}}function l(e,t){e|=0;t|=0;var n=0;var i=0;var a=0;var c=0;var s=0;var u=0;var f=0;var l=0;for(n=1;(n|0)<(o-1|0);n=n+1|0){l=l+o|0;for(i=1;(i|0)<(o-1|0);i=i+1|0){c=l-o|0;s=l+o|0;u=i-1|0;f=i+1|0;a=(r[e+c+u|0]|0)+(r[e+c+f|0]|0)+(r[e+l+i|0]|0)+(r[e+s+u|0]|0)+(r[e+s+f|0]|0)|0;if((a|0)>(0|0)){r[t+l+i|0]=1}else{r[t+l+i|0]=0}}}}function d(e,t){e|=0;t|=0;var n=0;n=i(o,o)|0;while((n|0)>0){n=n-1|0;r[t+n|0]=r[e+n|0]|0}}function p(e){e|=0;var t=0;var n=0;for(t=0;(t|0)<(o-1|0);t=t+1|0){r[e+t|0]=0;r[e+n|0]=0;n=n+o-1|0;r[e+n|0]=0;n=n+1|0}for(t=0;(t|0)<(o|0);t=t+1|0){r[e+n|0]=0;n=n+1|0}}function h(){var e=0;var t=0;var n=0;var r=0;var h=0;var v=0;t=i(o,o)|0;n=t+t|0;r=n+t|0;f(r,0);p(e);do{a(e,t);l(t,n);c(e,n,n);s(r,n,r);d(t,e);h=u(e)|0;v=(h|0)==0|0}while(!v)}return{skeletonize:h}}},function(e,t,n){e.exports=n(259)},function(e,t,n){var r=n(89),o=n(47),i=n(119),a=n(121),c=n(12),s=n(55),u=n(53);e.exports=function e(t,n,f,l,d){t!==n&&i(n,(function(i,s){if(d||(d=new r),c(i))a(t,n,s,f,e,l,d);else{var p=l?l(u(t,s),i,s+"",t,n,d):void 0;void 0===p&&(p=i),o(t,s,p)}}),s)}},function(e,t,n){var r=n(24),o=n(95),i=n(96),a=n(97),c=n(98),s=n(99);function u(e){var t=this.__data__=new r(e);this.size=t.size}u.prototype.clear=o,u.prototype.delete=i,u.prototype.get=a,u.prototype.has=c,u.prototype.set=s,e.exports=u},function(e,t){e.exports=function(){this.__data__=[],this.size=0}},function(e,t,n){var r=n(25),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0||(n==t.length-1?t.pop():o.call(t,n,1),--this.size,0))}},function(e,t,n){var r=n(25);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},function(e,t,n){var r=n(25);e.exports=function(e){return r(this.__data__,e)>-1}},function(e,t,n){var r=n(25);e.exports=function(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}},function(e,t,n){var r=n(24);e.exports=function(){this.__data__=new r,this.size=0}},function(e,t){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},function(e,t){e.exports=function(e){return this.__data__.get(e)}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t,n){var r=n(24),o=n(43),i=n(46);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!o||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new i(a)}return n.set(e,t),this.size=n.size,this}},function(e,t,n){var r=n(36),o=n(103),i=n(12),a=n(105),c=/^\[object .+?Constructor\]$/,s=Function.prototype,u=Object.prototype,f=s.toString,l=u.hasOwnProperty,d=RegExp("^"+f.call(l).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!i(e)||o(e))&&(r(e)?d:c).test(a(e))}},function(e,t,n){var r=n(27),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,c=r?r.toStringTag:void 0;e.exports=function(e){var t=i.call(e,c),n=e[c];try{e[c]=void 0;var r=!0}catch(e){}var o=a.call(e);return r&&(t?e[c]=n:delete e[c]),o}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},function(e,t,n){var r,o=n(104),i=(r=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!i&&i in e}},function(e,t,n){var r=n(17)["__core-js_shared__"];e.exports=r},function(e,t){var n=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return n.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},function(e,t){e.exports=function(e,t){return null==e?void 0:e[t]}},function(e,t,n){var r=n(108),o=n(24),i=n(43);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(i||o),string:new r}}},function(e,t,n){var r=n(109),o=n(110),i=n(111),a=n(112),c=n(113);function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=r,s.prototype.delete=o,s.prototype.get=i,s.prototype.has=a,s.prototype.set=c,e.exports=s},function(e,t,n){var r=n(28);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},function(e,t){e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},function(e,t,n){var r=n(28),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return o.call(t,e)?t[e]:void 0}},function(e,t,n){var r=n(28),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:o.call(t,e)}},function(e,t,n){var r=n(28);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},function(e,t,n){var r=n(29);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},function(e,t){e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},function(e,t,n){var r=n(29);e.exports=function(e){return r(this,e).get(e)}},function(e,t,n){var r=n(29);e.exports=function(e){return r(this,e).has(e)}},function(e,t,n){var r=n(29);e.exports=function(e,t){var n=r(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}},function(e,t,n){var r=n(120)();e.exports=r},function(e,t){e.exports=function(e){return function(t,n,r){for(var o=-1,i=Object(t),a=r(t),c=a.length;c--;){var s=a[e?c:++o];if(!1===n(i[s],s,i))break}return t}}},function(e,t,n){var r=n(47),o=n(122),i=n(123),a=n(126),c=n(127),s=n(30),u=n(13),f=n(131),l=n(51),d=n(36),p=n(12),h=n(133),v=n(52),m=n(53),g=n(137);e.exports=function(e,t,n,y,b,_,x){var C=m(e,n),S=m(t,n),w=x.get(S);if(w)r(e,n,w);else{var R=_?_(C,S,n+"",e,t,x):void 0,T=void 0===R;if(T){var E=u(S),P=!E&&l(S),O=!E&&!P&&v(S);R=S,E||P||O?u(C)?R=C:f(C)?R=a(C):P?(T=!1,R=o(S,!0)):O?(T=!1,R=i(S,!0)):R=[]:h(S)||s(S)?(R=C,s(C)?R=g(C):p(C)&&!d(C)||(R=c(S))):T=!1}T&&(x.set(S,R),b(R,S,y,_,x),x.delete(S)),r(e,n,R)}}},function(e,t,n){(function(e){var r=n(17),o=t&&!t.nodeType&&t,i=o&&"object"==typeof e&&e&&!e.nodeType&&e,a=i&&i.exports===o?r.Buffer:void 0,c=a?a.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=c?c(n):new e.constructor(n);return e.copy(r),r}}).call(this,n(38)(e))},function(e,t,n){var r=n(124);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},function(e,t,n){var r=n(125);e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},function(e,t,n){var r=n(17).Uint8Array;e.exports=r},function(e,t){e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}},function(e,t,n){var r=n(128),o=n(49),i=n(50);e.exports=function(e){return"function"!=typeof e.constructor||i(e)?{}:r(o(e))}},function(e,t,n){var r=n(12),o=Object.create,i=function(){function e(){}return function(t){if(!r(t))return{};if(o)return o(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=i},function(e,t){e.exports=function(e,t){return function(n){return e(t(n))}}},function(e,t,n){var r=n(22),o=n(18);e.exports=function(e){return o(e)&&"[object Arguments]"==r(e)}},function(e,t,n){var r=n(39),o=n(18);e.exports=function(e){return o(e)&&r(e)}},function(e,t){e.exports=function(){return!1}},function(e,t,n){var r=n(22),o=n(49),i=n(18),a=Function.prototype,c=Object.prototype,s=a.toString,u=c.hasOwnProperty,f=s.call(Object);e.exports=function(e){if(!i(e)||"[object Object]"!=r(e))return!1;var t=o(e);if(null===t)return!0;var n=u.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&s.call(n)==f}},function(e,t,n){var r=n(22),o=n(40),i=n(18),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,e.exports=function(e){return i(e)&&o(e.length)&&!!a[r(e)]}},function(e,t){e.exports=function(e){return function(t){return e(t)}}},function(e,t,n){(function(e){var r=n(44),o=t&&!t.nodeType&&t,i=o&&"object"==typeof e&&e&&!e.nodeType&&e,a=i&&i.exports===o&&r.process,c=function(){try{return i&&i.require&&i.require("util").types||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=c}).call(this,n(38)(e))},function(e,t,n){var r=n(138),o=n(55);e.exports=function(e){return r(e,o(e))}},function(e,t,n){var r=n(54),o=n(37);e.exports=function(e,t,n,i){var a=!n;n||(n={});for(var c=-1,s=t.length;++c<s;){var u=t[c],f=i?i(n[u],e[u],u,n,e):void 0;void 0===f&&(f=e[u]),a?o(n,u,f):r(n,u,f)}return n}},function(e,t,n){var r=n(140),o=n(30),i=n(13),a=n(51),c=n(31),s=n(52),u=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=i(e),f=!n&&o(e),l=!n&&!f&&a(e),d=!n&&!f&&!l&&s(e),p=n||f||l||d,h=p?r(e.length,String):[],v=h.length;for(var m in e)!t&&!u.call(e,m)||p&&("length"==m||l&&("offset"==m||"parent"==m)||d&&("buffer"==m||"byteLength"==m||"byteOffset"==m)||c(m,v))||h.push(m);return h}},function(e,t){e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},function(e,t,n){var r=n(12),o=n(50),i=n(142),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=o(e),n=[];for(var c in e)("constructor"!=c||!t&&a.call(e,c))&&n.push(c);return n}},function(e,t){e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},function(e,t,n){var r=n(144),o=n(149);e.exports=function(e){return r((function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,c=i>2?n[2]:void 0;for(a=e.length>3&&"function"==typeof a?(i--,a):void 0,c&&o(n[0],n[1],c)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,a)}return t}))}},function(e,t,n){var r=n(56),o=n(57),i=n(58);e.exports=function(e,t){return i(o(e,t,r),e+"")}},function(e,t){e.exports=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}},function(e,t,n){var r=n(147),o=n(48),i=n(56),a=o?function(e,t){return o(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:i;e.exports=a},function(e,t){e.exports=function(e){return function(){return e}}},function(e,t){var n=Date.now;e.exports=function(e){var t=0,r=0;return function(){var o=n(),i=16-(o-r);if(r=o,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}},function(e,t,n){var r=n(26),o=n(39),i=n(31),a=n(12);e.exports=function(e,t,n){if(!a(n))return!1;var c=typeof t;return!!("number"==c?o(n)&&i(t,n.length):"string"==c&&t in n)&&r(n[t],e)}},function(e,t){"undefined"!=typeof window&&(window.requestAnimationFrame||(window.requestAnimationFrame=window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)})),"function"!=typeof Math.imul&&(Math.imul=function(e,t){var n=65535&e,r=65535&t;return n*r+((e>>>16&65535)*r+n*(t>>>16&65535)<<16>>>0)|0}),"function"!=typeof Object.assign&&(Object.assign=function(e){"use strict";if(null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(null!==r)for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t})},function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(e,t){e.exports=function(e){var t=new Float32Array(2);return t[0]=e[0],t[1]=e[1],t}},function(e,t){e.exports=function(e,t){var n=new Float32Array(2);return n[0]=e,n[1]=t,n}},function(e,t){e.exports=function(e,t){return e[0]=t[0],e[1]=t[1],e}},function(e,t){e.exports=function(e,t,n){return e[0]=t,e[1]=n,e}},function(e,t,n){e.exports=function(e,t){var n=e[0],o=e[1],i=t[0],a=t[1];return Math.abs(n-i)<=r*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(o-a)<=r*Math.max(1,Math.abs(o),Math.abs(a))};var r=n(61)},function(e,t){e.exports=function(e,t){return e[0]===t[0]&&e[1]===t[1]}},function(e,t){e.exports=function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}},function(e,t,n){e.exports=n(63)},function(e,t,n){e.exports=n(64)},function(e,t,n){e.exports=n(65)},function(e,t){e.exports=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}},function(e,t){e.exports=function(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}},function(e,t){e.exports=function(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}},function(e,t){e.exports=function(e,t,n){var r=Math.cos(n),o=Math.sin(n),i=t[0],a=t[1];return e[0]=i*r-a*o,e[1]=i*o+a*r,e}},function(e,t){e.exports=function(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e}},function(e,t){e.exports=function(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e}},function(e,t){e.exports=function(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e}},function(e,t){e.exports=function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}},function(e,t){e.exports=function(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e}},function(e,t,n){e.exports=n(66)},function(e,t,n){e.exports=n(67)},function(e,t,n){e.exports=n(68)},function(e,t,n){e.exports=n(69)},function(e,t){e.exports=function(e,t){return e[0]=-t[0],e[1]=-t[1],e}},function(e,t){e.exports=function(e,t){var n=t[0],r=t[1],o=n*n+r*r;return o>0&&(o=1/Math.sqrt(o),e[0]=t[0]*o,e[1]=t[1]*o),e}},function(e,t){e.exports=function(e,t){return e[0]*t[0]+e[1]*t[1]}},function(e,t){e.exports=function(e,t,n){var r=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=r,e}},function(e,t){e.exports=function(e,t,n,r){var o=t[0],i=t[1];return e[0]=o+r*(n[0]-o),e[1]=i+r*(n[1]-i),e}},function(e,t){e.exports=function(e,t){t=t||1;var n=2*Math.random()*Math.PI;return e[0]=Math.cos(n)*t,e[1]=Math.sin(n)*t,e}},function(e,t){e.exports=function(e,t,n){var r=t[0],o=t[1];return e[0]=n[0]*r+n[2]*o,e[1]=n[1]*r+n[3]*o,e}},function(e,t){e.exports=function(e,t,n){var r=t[0],o=t[1];return e[0]=n[0]*r+n[2]*o+n[4],e[1]=n[1]*r+n[3]*o+n[5],e}},function(e,t){e.exports=function(e,t,n){var r=t[0],o=t[1];return e[0]=n[0]*r+n[3]*o+n[6],e[1]=n[1]*r+n[4]*o+n[7],e}},function(e,t){e.exports=function(e,t,n){var r=t[0],o=t[1];return e[0]=n[0]*r+n[4]*o+n[12],e[1]=n[1]*r+n[5]*o+n[13],e}},function(e,t,n){e.exports=function(e,t,n,o,i,a){var c,s;for(t||(t=2),n||(n=0),s=o?Math.min(o*t+n,e.length):e.length,c=n;c<s;c+=t)r[0]=e[c],r[1]=e[c+1],i(r,r,a),e[c]=r[0],e[c+1]=r[1];return e};var r=n(62)()},function(e,t){e.exports=function(e,t,n){var r=t[0]*t[0]+t[1]*t[1];if(r>n*n){var o=Math.sqrt(r);e[0]=t[0]/o*n,e[1]=t[1]/o*n}else e[0]=t[0],e[1]=t[1];return e}},function(e,t){e.exports=function(e){var t=new Float32Array(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}},function(e,t,n){e.exports=function(e,t){var n=r(e[0],e[1],e[2]),a=r(t[0],t[1],t[2]);o(n,n),o(a,a);var c=i(n,a);return c>1?0:Math.acos(c)};var r=n(72),o=n(73),i=n(74)},function(e,t){e.exports=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}},function(e,t){e.exports=function(e,t,n,r){return e[0]=t,e[1]=n,e[2]=r,e}},function(e,t,n){e.exports=function(e,t){var n=e[0],o=e[1],i=e[2],a=t[0],c=t[1],s=t[2];return Math.abs(n-a)<=r*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(o-c)<=r*Math.max(1,Math.abs(o),Math.abs(c))&&Math.abs(i-s)<=r*Math.max(1,Math.abs(i),Math.abs(s))};var r=n(70)},function(e,t){e.exports=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}},function(e,t){e.exports=function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}},function(e,t,n){e.exports=n(75)},function(e,t,n){e.exports=n(76)},function(e,t,n){e.exports=n(77)},function(e,t){e.exports=function(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}},function(e,t){e.exports=function(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}},function(e,t){e.exports=function(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}},function(e,t){e.exports=function(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}},function(e,t){e.exports=function(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e}},function(e,t){e.exports=function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}},function(e,t){e.exports=function(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e[2]=t[2]+n[2]*r,e}},function(e,t,n){e.exports=n(78)},function(e,t,n){e.exports=n(79)},function(e,t,n){e.exports=n(80)},function(e,t,n){e.exports=n(81)},function(e,t){e.exports=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}},function(e,t){e.exports=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}},function(e,t){e.exports=function(e,t,n){var r=t[0],o=t[1],i=t[2],a=n[0],c=n[1],s=n[2];return e[0]=o*s-i*c,e[1]=i*a-r*s,e[2]=r*c-o*a,e}},function(e,t){e.exports=function(e,t,n,r){var o=t[0],i=t[1],a=t[2];return e[0]=o+r*(n[0]-o),e[1]=i+r*(n[1]-i),e[2]=a+r*(n[2]-a),e}},function(e,t){e.exports=function(e,t){t=t||1;var n=2*Math.random()*Math.PI,r=2*Math.random()-1,o=Math.sqrt(1-r*r)*t;return e[0]=Math.cos(n)*o,e[1]=Math.sin(n)*o,e[2]=r*t,e}},function(e,t){e.exports=function(e,t,n){var r=t[0],o=t[1],i=t[2],a=n[3]*r+n[7]*o+n[11]*i+n[15];return a=a||1,e[0]=(n[0]*r+n[4]*o+n[8]*i+n[12])/a,e[1]=(n[1]*r+n[5]*o+n[9]*i+n[13])/a,e[2]=(n[2]*r+n[6]*o+n[10]*i+n[14])/a,e}},function(e,t){e.exports=function(e,t,n){var r=t[0],o=t[1],i=t[2];return e[0]=r*n[0]+o*n[3]+i*n[6],e[1]=r*n[1]+o*n[4]+i*n[7],e[2]=r*n[2]+o*n[5]+i*n[8],e}},function(e,t){e.exports=function(e,t,n){var r=t[0],o=t[1],i=t[2],a=n[0],c=n[1],s=n[2],u=n[3],f=u*r+c*i-s*o,l=u*o+s*r-a*i,d=u*i+a*o-c*r,p=-a*r-c*o-s*i;return e[0]=f*u+p*-a+l*-s-d*-c,e[1]=l*u+p*-c+d*-a-f*-s,e[2]=d*u+p*-s+f*-c-l*-a,e}},function(e,t){e.exports=function(e,t,n,r){var o=n[1],i=n[2],a=t[1]-o,c=t[2]-i,s=Math.sin(r),u=Math.cos(r);return e[0]=t[0],e[1]=o+a*u-c*s,e[2]=i+a*s+c*u,e}},function(e,t){e.exports=function(e,t,n,r){var o=n[0],i=n[2],a=t[0]-o,c=t[2]-i,s=Math.sin(r),u=Math.cos(r);return e[0]=o+c*s+a*u,e[1]=t[1],e[2]=i+c*u-a*s,e}},function(e,t){e.exports=function(e,t,n,r){var o=n[0],i=n[1],a=t[0]-o,c=t[1]-i,s=Math.sin(r),u=Math.cos(r);return e[0]=o+a*u-c*s,e[1]=i+a*s+c*u,e[2]=t[2],e}},function(e,t,n){e.exports=function(e,t,n,o,i,a){var c,s;for(t||(t=3),n||(n=0),s=o?Math.min(o*t+n,e.length):e.length,c=n;c<s;c+=t)r[0]=e[c],r[1]=e[c+1],r[2]=e[c+2],i(r,r,a),e[c]=r[0],e[c+1]=r[1],e[c+2]=r[2];return e};var r=n(71)()},function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(t,r)}e.exports=n},function(e,t,n){var r=n(60);e.exports=function(e){if(Array.isArray(e))return r(e)}},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(e,t,n){var r=n(2);e.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=r(e)););return e}},function(e,t,n){var r=function(e){"use strict";var t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function c(e,t,n,r){var o=t&&t.prototype instanceof f?t:f,i=Object.create(o.prototype),a=new C(r||[]);return i._invoke=function(e,t,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=b(a,n);if(c){if(c===u)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var f=s(e,t,n);if("normal"===f.type){if(r=n.done?"completed":"suspendedYield",f.arg===u)continue;return{value:f.arg,done:n.done}}"throw"===f.type&&(r="completed",n.method="throw",n.arg=f.arg)}}}(e,n,a),i}function s(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var u={};function f(){}function l(){}function d(){}var p={};p[o]=function(){return this};var h=Object.getPrototypeOf,v=h&&h(h(S([])));v&&v!==t&&n.call(v,o)&&(p=v);var m=d.prototype=f.prototype=Object.create(p);function g(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function y(e,t){var r;this._invoke=function(o,i){function a(){return new t((function(r,a){!function r(o,i,a,c){var u=s(e[o],e,i);if("throw"!==u.type){var f=u.arg,l=f.value;return l&&"object"==typeof l&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,a,c)}),(function(e){r("throw",e,a,c)})):t.resolve(l).then((function(e){f.value=e,a(f)}),(function(e){return r("throw",e,a,c)}))}c(u.arg)}(o,i,r,a)}))}return r=r?r.then(a,a):a()}}function b(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,b(e,t),"throw"===t.method))return u;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var r=s(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,u;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}function _(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(_,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:w}}function w(){return{value:void 0,done:!0}}return l.prototype=m.constructor=d,d.constructor=l,d[a]=l.displayName="GeneratorFunction",e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===l||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,a in e||(e[a]="GeneratorFunction")),e.prototype=Object.create(m),e},e.awrap=function(e){return{__await:e}},g(y.prototype),y.prototype[i]=function(){return this},e.AsyncIterator=y,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new y(c(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},g(m),m[a]="Generator",m[o]=function(){return this},m.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=S,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),s=n.call(i,"finallyLoc");if(c&&s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,u):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),u},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),x(n),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;x(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:S(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},e}(e.exports);try{regeneratorRuntime=r}catch(e){Function("r","regeneratorRuntime = r")(r)}},function(e,t,n){var r=n(229),o=n(239);e.exports=function(e,t){return r(e,t,(function(t,n){return o(e,n)}))}},function(e,t,n){var r=n(230),o=n(238),i=n(32);e.exports=function(e,t,n){for(var a=-1,c=t.length,s={};++a<c;){var u=t[a],f=r(e,u);n(f,u)&&o(s,i(u,e),f)}return s}},function(e,t,n){var r=n(32),o=n(42);e.exports=function(e,t){for(var n=0,i=(t=r(t,e)).length;null!=e&&n<i;)e=e[o(t[n++])];return n&&n==i?e:void 0}},function(e,t,n){var r=n(13),o=n(41),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!o(e))||a.test(e)||!i.test(e)||null!=t&&e in Object(t)}},function(e,t,n){var r=n(233),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,a=r((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(o,(function(e,n,r,o){t.push(r?o.replace(i,"$1"):n||e)})),t}));e.exports=a},function(e,t,n){var r=n(234);e.exports=function(e){var t=r(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}},function(e,t,n){var r=n(46);function o(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(o.Cache||r),n}o.Cache=r,e.exports=o},function(e,t,n){var r=n(236);e.exports=function(e){return null==e?"":r(e)}},function(e,t,n){var r=n(27),o=n(237),i=n(13),a=n(41),c=r?r.prototype:void 0,s=c?c.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(i(t))return o(t,e)+"";if(a(t))return s?s.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}},function(e,t,n){var r=n(54),o=n(32),i=n(31),a=n(12),c=n(42);e.exports=function(e,t,n,s){if(!a(e))return e;for(var u=-1,f=(t=o(t,e)).length,l=f-1,d=e;null!=d&&++u<f;){var p=c(t[u]),h=n;if("__proto__"===p||"constructor"===p||"prototype"===p)return e;if(u!=l){var v=d[p];void 0===(h=s?s(v,p,d):void 0)&&(h=a(v)?v:i(t[u+1])?[]:{})}r(d,p,h),d=d[p]}return e}},function(e,t,n){var r=n(240),o=n(241);e.exports=function(e,t){return null!=e&&o(e,t,r)}},function(e,t){e.exports=function(e,t){return null!=e&&t in Object(e)}},function(e,t,n){var r=n(32),o=n(30),i=n(13),a=n(31),c=n(40),s=n(42);e.exports=function(e,t,n){for(var u=-1,f=(t=r(t,e)).length,l=!1;++u<f;){var d=s(t[u]);if(!(l=null!=e&&n(e,d)))break;e=e[d]}return l||++u!=f?l:!!(f=null==e?0:e.length)&&c(f)&&a(d,f)&&(i(e)||o(e))}},function(e,t,n){var r=n(243),o=n(57),i=n(58);e.exports=function(e){return i(o(e,void 0,r),e+"")}},function(e,t,n){var r=n(244);e.exports=function(e){return null!=e&&e.length?r(e,1):[]}},function(e,t,n){var r=n(245),o=n(246);e.exports=function e(t,n,i,a,c){var s=-1,u=t.length;for(i||(i=o),c||(c=[]);++s<u;){var f=t[s];n>0&&i(f)?n>1?e(f,n-1,i,a,c):r(c,f):a||(c[c.length]=f)}return c}},function(e,t){e.exports=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}},function(e,t,n){var r=n(27),o=n(30),i=n(13),a=r?r.isConcatSpreadable:void 0;e.exports=function(e){return i(e)||o(e)||!!(a&&e&&e[a])}},function(e,t){e.exports=function(e){return e[0]*e[3]-e[2]*e[1]}},function(e,t){e.exports=function(e,t){if(e===t){var n=t[1];e[1]=t[2],e[2]=n}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e}},function(e,t){e.exports=function(e,t,n){var r=t[0],o=t[1],i=t[2],a=t[3],c=n[0],s=n[1],u=n[2],f=n[3];return e[0]=r*c+i*s,e[1]=o*c+a*s,e[2]=r*u+i*f,e[3]=o*u+a*f,e}},function(e,t){e.exports=function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e}},function(e,t){e.exports=function(e,t){var n=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=n,e}},function(e,t){e.exports=function(e,t,n){var r=t[0],o=t[1],i=t[2],a=t[3],c=Math.sin(n),s=Math.cos(n);return e[0]=r*s+i*c,e[1]=o*s+a*c,e[2]=r*-c+i*s,e[3]=o*-c+a*s,e}},function(e,t){e.exports=function(e,t){var n=t[0],r=t[1],o=t[2],i=t[3],a=n*i-o*r;return a?(a=1/a,e[0]=i*a,e[1]=-r*a,e[2]=-o*a,e[3]=n*a,e):null}},function(e,t){e.exports=function(){var e=new Float32Array(4);return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e}},function(e,t){e.exports=function(e,t,n){var r=t[0],o=t[1],i=t[2],a=t[3],c=n[0],s=n[1];return e[0]=r*c,e[1]=o*c,e[2]=i*s,e[3]=a*s,e}},function(e,t){e.exports=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}},function(e,t){e.exports=function(e){return Math.sqrt(Math.pow(e[0],2)+Math.pow(e[1],2)+Math.pow(e[2],2)+Math.pow(e[3],2))}},function(e,t){e.exports=function(e,t,n,r){return e[2]=r[2]/r[0],n[0]=r[0],n[1]=r[1],n[3]=r[3]-e[2]*n[1],[e,t,n]}},function(e,t,n){"use strict";n.r(t),n.d(t,"BarcodeDecoder",(function(){return ge})),n.d(t,"BarcodeReader",(function(){return O})),n.d(t,"CameraAccess",(function(){return Le})),n.d(t,"ImageDebug",(function(){return p.a})),n.d(t,"ImageWrapper",(function(){return c.a})),n.d(t,"ResultCollector",(function(){return Ne}));var r=n(19),o=n.n(r),i=n(15),a=n.n(i),c=(n(150),n(10)),s={},u=1,f=-1;s.getBarcodeLine=function(e,t,n){var r,o,i,a,c,s=0|t.x,u=0|t.y,f=0|n.x,l=0|n.y,d=Math.abs(l-u)>Math.abs(f-s),p=[],h=e.data,v=e.size.x,m=255,g=0;function y(e,t){c=h[t*v+e],m=c<m?c:m,g=c>g?c:g,p.push(c)}d&&(i=s,s=u,u=i,i=f,f=l,l=i),s>f&&(i=s,s=f,f=i,i=u,u=l,l=i);var b=f-s,_=Math.abs(l-u);r=b/2|0,o=u;var x=u<l?1:-1;for(a=s;a<f;a++)d?y(o,a):y(a,o),(r-=_)<0&&(o+=x,r+=b);return{line:p,min:m,max:g}},s.toBinaryLine=function(e){var t,n,r,o,i,a,c=e.min,s=e.max,l=e.line,d=c+(s-c)/2,p=[],h=(s-c)/12,v=-h;for(r=l[0]>d?u:f,p.push({pos:0,val:l[0]}),i=0;i<l.length-2;i++)r!==(o=(t=l[i+1]-l[i])+(n=l[i+2]-l[i+1])<v&&l[i+1]<1.5*d?f:t+n>h&&l[i+1]>.5*d?u:r)&&(p.push({pos:i,val:l[i]}),r=o);for(p.push({pos:l.length,val:l[l.length-1]}),a=p[0].pos;a<p[1].pos;a++)l[a]=l[a]>d?0:1;for(i=1;i<p.length-1;i++)for(h=p[i+1].val>p[i].val?p[i].val+(p[i+1].val-p[i].val)/3*2|0:p[i+1].val+(p[i].val-p[i+1].val)/3|0,a=p[i].pos;a<p[i+1].pos;a++)l[a]=l[a]>h?0:1;return{line:l,threshold:h}},s.debug={printFrequency:function(e,t){var n,r=t.getContext("2d");for(t.width=e.length,t.height=256,r.beginPath(),r.strokeStyle="blue",n=0;n<e.length;n++)r.moveTo(n,255),r.lineTo(n,255-e[n]);r.stroke(),r.closePath()},printPattern:function(e,t){var n,r=t.getContext("2d");for(t.width=e.length,r.fillColor="black",n=0;n<e.length;n++)1===e[n]&&r.fillRect(n,0,1,100)}};var l,d=s,p=n(14),h=n(3),v=n.n(h),m=n(4),g=n.n(m),y=n(1),b=n.n(y),_=n(6),x=n.n(_),C=n(5),S=n.n(C),w=n(2),R=n.n(w),T=n(0),E=n.n(T),P=n(8);!function(e){e[e.Forward=1]="Forward",e[e.Reverse=-1]="Reverse"}(l||(l={}));var O=function(){function e(t,n){return v()(this,e),E()(this,"_row",[]),E()(this,"config",{}),E()(this,"supplements",[]),E()(this,"SINGLE_CODE_ERROR",0),E()(this,"FORMAT","unknown"),E()(this,"CONFIG_KEYS",{}),this._row=[],this.config=t||{},n&&(this.supplements=n),this}return g()(e,[{key:"_nextUnset",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=t;n<e.length;n++)if(!e[n])return n;return e.length}},{key:"_matchPattern",value:function(e,t,n){var r,o=0,i=0,a=0,c=0,s=0,u=0;n=n||this.SINGLE_CODE_ERROR||1;for(var f=0;f<e.length;f++)a+=e[f],c+=t[f];if(a<c)return Number.MAX_VALUE;n*=r=a/c;for(var l=0;l<e.length;l++){if(s=e[l],u=t[l]*r,(i=Math.abs(s-u)/u)>n)return Number.MAX_VALUE;o+=i}return o/c}},{key:"_nextSet",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=t;n<e.length;n++)if(e[n])return n;return e.length}},{key:"_correctBars",value:function(e,t,n){for(var r=n.length,o=0;r--;)(o=e[n[r]]*(1-(1-t)/2))>1&&(e[n[r]]=o)}},{key:"decodePattern",value:function(e){this._row=e;var t=this._decode();return null===t?(this._row.reverse(),(t=this._decode())&&(t.direction=l.Reverse,t.start=this._row.length-t.start,t.end=this._row.length-t.end)):t.direction=l.Forward,t&&(t.format=this.FORMAT),t}},{key:"_matchRange",value:function(e,t,n){var r;for(r=e=e<0?0:e;r<t;r++)if(this._row[r]!==n)return!1;return!0}},{key:"_fillCounters",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._nextUnset(this._row),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._row.length,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=[],o=0;r[o]=0;for(var i=e;i<t;i++)this._row[i]^(n?1:0)?r[o]++:(r[++o]=1,n=!n);return r}},{key:"_toCounters",value:function(e,t){var n=t.length,r=this._row.length,o=!this._row[e],i=0;P.a.init(t,0);for(var a=e;a<r;a++)if(this._row[a]^(o?1:0))t[i]++;else{if(++i===n)break;t[i]=1,o=!o}return t}}],[{key:"Exception",get:function(){return{StartNotFoundException:"Start-Info was not found!",CodeNotFoundException:"Code could not be found!",PatternNotFoundException:"Pattern could not be found!"}}}]),e}(),k=function(e){x()(n,e);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=R()(e);if(t){var o=R()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return S()(this,n)}}(n);function n(){var e;v()(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),E()(b()(e),"CODE_SHIFT",98),E()(b()(e),"CODE_C",99),E()(b()(e),"CODE_B",100),E()(b()(e),"CODE_A",101),E()(b()(e),"START_CODE_A",103),E()(b()(e),"START_CODE_B",104),E()(b()(e),"START_CODE_C",105),E()(b()(e),"STOP_CODE",106),E()(b()(e),"CODE_PATTERN",[[2,1,2,2,2,2],[2,2,2,1,2,2],[2,2,2,2,2,1],[1,2,1,2,2,3],[1,2,1,3,2,2],[1,3,1,2,2,2],[1,2,2,2,1,3],[1,2,2,3,1,2],[1,3,2,2,1,2],[2,2,1,2,1,3],[2,2,1,3,1,2],[2,3,1,2,1,2],[1,1,2,2,3,2],[1,2,2,1,3,2],[1,2,2,2,3,1],[1,1,3,2,2,2],[1,2,3,1,2,2],[1,2,3,2,2,1],[2,2,3,2,1,1],[2,2,1,1,3,2],[2,2,1,2,3,1],[2,1,3,2,1,2],[2,2,3,1,1,2],[3,1,2,1,3,1],[3,1,1,2,2,2],[3,2,1,1,2,2],[3,2,1,2,2,1],[3,1,2,2,1,2],[3,2,2,1,1,2],[3,2,2,2,1,1],[2,1,2,1,2,3],[2,1,2,3,2,1],[2,3,2,1,2,1],[1,1,1,3,2,3],[1,3,1,1,2,3],[1,3,1,3,2,1],[1,1,2,3,1,3],[1,3,2,1,1,3],[1,3,2,3,1,1],[2,1,1,3,1,3],[2,3,1,1,1,3],[2,3,1,3,1,1],[1,1,2,1,3,3],[1,1,2,3,3,1],[1,3,2,1,3,1],[1,1,3,1,2,3],[1,1,3,3,2,1],[1,3,3,1,2,1],[3,1,3,1,2,1],[2,1,1,3,3,1],[2,3,1,1,3,1],[2,1,3,1,1,3],[2,1,3,3,1,1],[2,1,3,1,3,1],[3,1,1,1,2,3],[3,1,1,3,2,1],[3,3,1,1,2,1],[3,1,2,1,1,3],[3,1,2,3,1,1],[3,3,2,1,1,1],[3,1,4,1,1,1],[2,2,1,4,1,1],[4,3,1,1,1,1],[1,1,1,2,2,4],[1,1,1,4,2,2],[1,2,1,1,2,4],[1,2,1,4,2,1],[1,4,1,1,2,2],[1,4,1,2,2,1],[1,1,2,2,1,4],[1,1,2,4,1,2],[1,2,2,1,1,4],[1,2,2,4,1,1],[1,4,2,1,1,2],[1,4,2,2,1,1],[2,4,1,2,1,1],[2,2,1,1,1,4],[4,1,3,1,1,1],[2,4,1,1,1,2],[1,3,4,1,1,1],[1,1,1,2,4,2],[1,2,1,1,4,2],[1,2,1,2,4,1],[1,1,4,2,1,2],[1,2,4,1,1,2],[1,2,4,2,1,1],[4,1,1,2,1,2],[4,2,1,1,1,2],[4,2,1,2,1,1],[2,1,2,1,4,1],[2,1,4,1,2,1],[4,1,2,1,2,1],[1,1,1,1,4,3],[1,1,1,3,4,1],[1,3,1,1,4,1],[1,1,4,1,1,3],[1,1,4,3,1,1],[4,1,1,1,1,3],[4,1,1,3,1,1],[1,1,3,1,4,1],[1,1,4,1,3,1],[3,1,1,1,4,1],[4,1,1,1,3,1],[2,1,1,4,1,2],[2,1,1,2,1,4],[2,1,1,2,3,2],[2,3,3,1,1,1,2]]),E()(b()(e),"SINGLE_CODE_ERROR",.64),E()(b()(e),"AVG_CODE_ERROR",.3),E()(b()(e),"FORMAT","code_128"),E()(b()(e),"MODULE_INDICES",{bar:[0,2,4],space:[1,3,5]}),e}return g()(n,[{key:"_decodeCode",value:function(e,t){for(var n={error:Number.MAX_VALUE,code:-1,start:e,end:e,correction:{bar:1,space:1}},r=[0,0,0,0,0,0],o=e,i=!this._row[o],a=0,c=o;c<this._row.length;c++)if(this._row[c]^(i?1:0))r[a]++;else{if(a===r.length-1){t&&this._correct(r,t);for(var s=0;s<this.CODE_PATTERN.length;s++){var u=this._matchPattern(r,this.CODE_PATTERN[s]);u<n.error&&(n.code=s,n.error=u)}return n.end=c,-1===n.code||n.error>this.AVG_CODE_ERROR?null:(this.CODE_PATTERN[n.code]&&(n.correction.bar=this.calculateCorrection(this.CODE_PATTERN[n.code],r,this.MODULE_INDICES.bar),n.correction.space=this.calculateCorrection(this.CODE_PATTERN[n.code],r,this.MODULE_INDICES.space)),n)}r[++a]=1,i=!i}return null}},{key:"_correct",value:function(e,t){this._correctBars(e,t.bar,this.MODULE_INDICES.bar),this._correctBars(e,t.space,this.MODULE_INDICES.space)}},{key:"_findStart",value:function(){for(var e=[0,0,0,0,0,0],t=this._nextSet(this._row),n={error:Number.MAX_VALUE,code:-1,start:0,end:0,correction:{bar:1,space:1}},r=!1,o=0,i=t;i<this._row.length;i++)if(this._row[i]^(r?1:0))e[o]++;else{if(o===e.length-1){for(var a=e.reduce((function(e,t){return e+t}),0),c=this.START_CODE_A;c<=this.START_CODE_C;c++){var s=this._matchPattern(e,this.CODE_PATTERN[c]);s<n.error&&(n.code=c,n.error=s)}if(n.error<this.AVG_CODE_ERROR)return n.start=i-a,n.end=i,n.correction.bar=this.calculateCorrection(this.CODE_PATTERN[n.code],e,this.MODULE_INDICES.bar),n.correction.space=this.calculateCorrection(this.CODE_PATTERN[n.code],e,this.MODULE_INDICES.space),n;for(var u=0;u<4;u++)e[u]=e[u+2];e[4]=0,e[5]=0,o--}else o++;e[o]=1,r=!r}return null}},{key:"_decode",value:function(e,t){var n=this,r=this._findStart();if(null===r)return null;var o={code:r.code,start:r.start,end:r.end,correction:{bar:r.correction.bar,space:r.correction.space}},i=[];i.push(o);for(var a=o.code,c=function(e){switch(e){case n.START_CODE_A:return n.CODE_A;case n.START_CODE_B:return n.CODE_B;case n.START_CODE_C:return n.CODE_C;default:return null}}(o.code),s=!1,u=!1,f=u,l=!0,d=0,p=[],h=[];!s;){if(f=u,u=!1,null!==(o=this._decodeCode(o.end,o.correction)))switch(o.code!==this.STOP_CODE&&(l=!0),o.code!==this.STOP_CODE&&(p.push(o.code),a+=++d*o.code),i.push(o),c){case this.CODE_A:if(o.code<64)h.push(String.fromCharCode(32+o.code));else if(o.code<96)h.push(String.fromCharCode(o.code-64));else switch(o.code!==this.STOP_CODE&&(l=!1),o.code){case this.CODE_SHIFT:u=!0,c=this.CODE_B;break;case this.CODE_B:c=this.CODE_B;break;case this.CODE_C:c=this.CODE_C;break;case this.STOP_CODE:s=!0}break;case this.CODE_B:if(o.code<96)h.push(String.fromCharCode(32+o.code));else switch(o.code!==this.STOP_CODE&&(l=!1),o.code){case this.CODE_SHIFT:u=!0,c=this.CODE_A;break;case this.CODE_A:c=this.CODE_A;break;case this.CODE_C:c=this.CODE_C;break;case this.STOP_CODE:s=!0}break;case this.CODE_C:if(o.code<100)h.push(o.code<10?"0"+o.code:o.code);else switch(o.code!==this.STOP_CODE&&(l=!1),o.code){case this.CODE_A:c=this.CODE_A;break;case this.CODE_B:c=this.CODE_B;break;case this.STOP_CODE:s=!0}}else s=!0;f&&(c=c===this.CODE_A?this.CODE_B:this.CODE_A)}return null===o?null:(o.end=this._nextUnset(this._row,o.end),this._verifyTrailingWhitespace(o)?(a-=d*p[p.length-1])%103!==p[p.length-1]?null:h.length?(l&&h.splice(h.length-1,1),{code:h.join(""),start:r.start,end:o.end,codeset:c,startInfo:r,decodedCodes:i,endInfo:o,format:this.FORMAT}):null:null)}},{key:"_verifyTrailingWhitespace",value:function(e){var t;return(t=e.end+(e.end-e.start)/2)<this._row.length&&this._matchRange(e.end,t,0)?e:null}},{key:"calculateCorrection",value:function(e,t,n){for(var r=n.length,o=0,i=0;r--;)i+=e[n[r]],o+=t[n[r]];return i/o}}]),n}(O);function D(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function M(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?D(Object(n),!0).forEach((function(t){E()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):D(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var A=[1,1,1],j=[1,1,1,1,1],I=[1,1,2],L=[[3,2,1,1],[2,2,2,1],[2,1,2,2],[1,4,1,1],[1,1,3,2],[1,2,3,1],[1,1,1,4],[1,3,1,2],[1,2,1,3],[3,1,1,2],[1,1,2,3],[1,2,2,2],[2,2,1,2],[1,1,4,1],[2,3,1,1],[1,3,2,1],[4,1,1,1],[2,1,3,1],[3,1,2,1],[2,1,1,3]],N=[0,11,13,14,19,25,28,21,22,26],z=function(e){x()(n,e);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=R()(e);if(t){var o=R()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return S()(this,n)}}(n);function n(e,r){var o;return v()(this,n),o=t.call(this,a()({supplements:[]},e),r),E()(b()(o),"FORMAT","ean_13"),E()(b()(o),"SINGLE_CODE_ERROR",.7),E()(b()(o),"STOP_PATTERN",[1,1,1]),o}return g()(n,[{key:"_findPattern",value:function(e,t,n,r){var o=new Array(e.length).fill(0),i={error:Number.MAX_VALUE,start:0,end:0},a=0;t||(t=this._nextSet(this._row));for(var c=!1,s=t;s<this._row.length;s++)if(this._row[s]^(n?1:0))o[a]+=1;else{if(a===o.length-1){var u=this._matchPattern(o,e);if(u<.48&&i.error&&u<i.error)return c=!0,i.error=u,i.start=s-o.reduce((function(e,t){return e+t}),0),i.end=s,i;if(r){for(var f=0;f<o.length-2;f++)o[f]=o[f+2];o[o.length-2]=0,o[o.length-1]=0,a--}}else a++;o[a]=1,n=!n}return c?i:null}},{key:"_decodeCode",value:function(e,t){var n=[0,0,0,0],r=e,o={error:Number.MAX_VALUE,code:-1,start:e,end:e},i=!this._row[r],a=0;t||(t=L.length);for(var c=r;c<this._row.length;c++)if(this._row[c]^(i?1:0))n[a]++;else{if(a===n.length-1){for(var s=0;s<t;s++){var u=this._matchPattern(n,L[s]);o.end=c,u<o.error&&(o.code=s,o.error=u)}return o.error>.48?null:o}n[++a]=1,i=!i}return null}},{key:"_findStart",value:function(){for(var e=this._nextSet(this._row),t=null;!t;){if(!(t=this._findPattern(A,e,!1,!0)))return null;var n=t.start-(t.end-t.start);if(n>=0&&this._matchRange(n,t.start,0))return t;e=t.end,t=null}return null}},{key:"_calculateFirstDigit",value:function(e){for(var t=0;t<N.length;t++)if(e===N[t])return t;return null}},{key:"_decodePayload",value:function(e,t,n){for(var r=M({},e),o=0,i=0;i<6;i++){if(!(r=this._decodeCode(r.end)))return null;r.code>=10?(r.code-=10,o|=1<<5-i):o|=0<<5-i,t.push(r.code),n.push(r)}var a=this._calculateFirstDigit(o);if(null===a)return null;t.unshift(a);var c=this._findPattern(j,r.end,!0,!1);if(null===c||!c.end)return null;n.push(c);for(var s=0;s<6;s++){if(!(c=this._decodeCode(c.end,10)))return null;n.push(c),t.push(c.code)}return c}},{key:"_verifyTrailingWhitespace",value:function(e){var t=e.end+(e.end-e.start);return t<this._row.length&&this._matchRange(e.end,t,0)?e:null}},{key:"_findEnd",value:function(e,t){var n=this._findPattern(this.STOP_PATTERN,e,t,!1);return null!==n?this._verifyTrailingWhitespace(n):null}},{key:"_checksum",value:function(e){for(var t=0,n=e.length-2;n>=0;n-=2)t+=e[n];t*=3;for(var r=e.length-1;r>=0;r-=2)t+=e[r];return t%10==0}},{key:"_decodeExtensions",value:function(e){var t=this._nextSet(this._row,e),n=this._findPattern(I,t,!1,!1);if(null===n)return null;for(var r=0;r<this.supplements.length;r++)try{var o=this.supplements[r]._decode(this._row,n.end);if(null!==o)return{code:o.code,start:t,startInfo:n,end:o.end,decodedCodes:o.decodedCodes,format:this.supplements[r].FORMAT}}catch(e){console.error("* decodeExtensions error in ",this.supplements[r],": ",e)}return null}},{key:"_decode",value:function(e,t){var n=new Array,r=new Array,o={},i=this._findStart();if(!i)return null;var a={start:i.start,end:i.end};if(r.push(a),!(a=this._decodePayload(a,n,r)))return null;if(!(a=this._findEnd(a.end,!1)))return null;if(r.push(a),!this._checksum(n))return null;if(this.supplements.length>0){var c=this._decodeExtensions(a.end);if(!c)return null;if(!c.decodedCodes)return null;var s=c.decodedCodes[c.decodedCodes.length-1],u={start:s.start+((s.end-s.start)/2|0),end:s.end};if(!this._verifyTrailingWhitespace(u))return null;o={supplement:c,code:n.join("")+c.code}}return M(M({code:n.join(""),start:i.start,end:a.end,startInfo:i,decodedCodes:r},o),{},{format:this.FORMAT})}}]),n}(O),F=n(33),U=n.n(F),G=new Uint16Array(U()("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. *$/+%").map((function(e){return e.charCodeAt(0)}))),B=new Uint16Array([52,289,97,352,49,304,112,37,292,100,265,73,328,25,280,88,13,268,76,28,259,67,322,19,274,82,7,262,70,22,385,193,448,145,400,208,133,388,196,148,168,162,138,42]),W=function(e){x()(n,e);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=R()(e);if(t){var o=R()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return S()(this,n)}}(n);function n(){var e;v()(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),E()(b()(e),"FORMAT","code_39"),e}return g()(n,[{key:"_findStart",value:function(){for(var e=this._nextSet(this._row),t=e,n=new Uint16Array([0,0,0,0,0,0,0,0,0]),r=0,o=!1,i=e;i<this._row.length;i++)if(this._row[i]^(o?1:0))n[r]++;else{if(r===n.length-1){if(148===this._toPattern(n)){var a=Math.floor(Math.max(0,t-(i-t)/4));if(this._matchRange(a,t,0))return{start:t,end:i}}t+=n[0]+n[1];for(var c=0;c<7;c++)n[c]=n[c+2];n[7]=0,n[8]=0,r--}else r++;n[r]=1,o=!o}return null}},{key:"_toPattern",value:function(e){for(var t=e.length,n=0,r=t,o=0;r>3;){n=this._findNextWidth(e,n),r=0;for(var i=0,a=0;a<t;a++)e[a]>n&&(i|=1<<t-1-a,r++,o+=e[a]);if(3===r){for(var c=0;c<t&&r>0;c++)if(e[c]>n&&(r--,2*e[c]>=o))return-1;return i}}return-1}},{key:"_findNextWidth",value:function(e,t){for(var n=Number.MAX_VALUE,r=0;r<e.length;r++)e[r]<n&&e[r]>t&&(n=e[r]);return n}},{key:"_patternToChar",value:function(e){for(var t=0;t<B.length;t++)if(B[t]===e)return String.fromCharCode(G[t]);return null}},{key:"_verifyTrailingWhitespace",value:function(e,t,n){var r=P.a.sum(n);return 3*(t-e-r)>=r}},{key:"_decode",value:function(e,t){var n=new Uint16Array([0,0,0,0,0,0,0,0,0]),r=[];if(!(t=this._findStart()))return null;var o,i,a=this._nextSet(this._row,t.end);do{n=this._toCounters(a,n);var c=this._toPattern(n);if(c<0)return null;if(null===(o=this._patternToChar(c)))return null;r.push(o),i=a,a+=P.a.sum(n),a=this._nextSet(this._row,a)}while("*"!==o);return r.pop(),r.length&&this._verifyTrailingWhitespace(i,a,n)?{code:r.join(""),start:t.start,end:a,startInfo:t,decodedCodes:r,format:this.FORMAT}:null}}]),n}(O),V=n(16),q=n.n(V),J=/[IOQ]/g,X=/[A-Z0-9]{17}/,H=function(e){x()(n,e);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=R()(e);if(t){var o=R()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return S()(this,n)}}(n);function n(){var e;v()(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),E()(b()(e),"FORMAT","code_39_vin"),e}return g()(n,[{key:"_checkChecksum",value:function(e){return!!e}},{key:"_decode",value:function(e,t){var r=q()(R()(n.prototype),"_decode",this).call(this,e,t);if(!r)return null;var o=r.code;return o&&(o=o.replace(J,"")).match(X)&&this._checkChecksum(o)?(r.code=o,r):null}}]),n}(W),$=[48,49,50,51,52,53,54,55,56,57,45,36,58,47,46,43,65,66,67,68],Y=[3,6,9,96,18,66,33,36,48,72,12,24,69,81,84,21,26,41,11,14],Q=[26,41,11,14],K=function(e){x()(n,e);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=R()(e);if(t){var o=R()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return S()(this,n)}}(n);function n(){var e;v()(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),E()(b()(e),"_counters",[]),E()(b()(e),"FORMAT","codabar"),e}return g()(n,[{key:"_computeAlternatingThreshold",value:function(e,t){for(var n=Number.MAX_VALUE,r=0,o=0,i=e;i<t;i+=2)(o=this._counters[i])>r&&(r=o),o<n&&(n=o);return(n+r)/2|0}},{key:"_toPattern",value:function(e){var t=e+7;if(t>this._counters.length)return-1;for(var n=this._computeAlternatingThreshold(e,t),r=this._computeAlternatingThreshold(e+1,t),o=64,i=0,a=0,c=0;c<7;c++)i=0==(1&c)?n:r,this._counters[e+c]>i&&(a|=o),o>>=1;return a}},{key:"_isStartEnd",value:function(e){for(var t=0;t<Q.length;t++)if(Q[t]===e)return!0;return!1}},{key:"_sumCounters",value:function(e,t){for(var n=0,r=e;r<t;r++)n+=this._counters[r];return n}},{key:"_findStart",value:function(){for(var e=this._nextUnset(this._row),t=1;t<this._counters.length;t++){var n=this._toPattern(t);if(-1!==n&&this._isStartEnd(n))return{start:e+=this._sumCounters(0,t),end:e+this._sumCounters(t,t+8),startCounter:t,endCounter:t+8}}return null}},{key:"_patternToChar",value:function(e){for(var t=0;t<Y.length;t++)if(Y[t]===e)return String.fromCharCode($[t]);return null}},{key:"_calculatePatternLength",value:function(e){for(var t=0,n=e;n<e+7;n++)t+=this._counters[n];return t}},{key:"_verifyWhitespace",value:function(e,t){return(e-1<=0||this._counters[e-1]>=this._calculatePatternLength(e)/2)&&(t+8>=this._counters.length||this._counters[t+7]>=this._calculatePatternLength(t)/2)}},{key:"_charToPattern",value:function(e){for(var t=e.charCodeAt(0),n=0;n<$.length;n++)if($[n]===t)return Y[n];return 0}},{key:"_thresholdResultPattern",value:function(e,t){for(var n,r={space:{narrow:{size:0,counts:0,min:0,max:Number.MAX_VALUE},wide:{size:0,counts:0,min:0,max:Number.MAX_VALUE}},bar:{narrow:{size:0,counts:0,min:0,max:Number.MAX_VALUE},wide:{size:0,counts:0,min:0,max:Number.MAX_VALUE}}},o=t,i=0;i<e.length;i++){n=this._charToPattern(e[i]);for(var a=6;a>=0;a--){var c=2==(1&a)?r.bar:r.space,s=1==(1&n)?c.wide:c.narrow;s.size+=this._counters[o+a],s.counts++,n>>=1}o+=8}return["space","bar"].forEach((function(e){var t=r[e];t.wide.min=Math.floor((t.narrow.size/t.narrow.counts+t.wide.size/t.wide.counts)/2),t.narrow.max=Math.ceil(t.wide.min),t.wide.max=Math.ceil((2*t.wide.size+1.5)/t.wide.counts)})),r}},{key:"_validateResult",value:function(e,t){for(var n,r=this._thresholdResultPattern(e,t),o=t,i=0;i<e.length;i++){n=this._charToPattern(e[i]);for(var a=6;a>=0;a--){var c=0==(1&a)?r.bar:r.space,s=1==(1&n)?c.wide:c.narrow,u=this._counters[o+a];if(u<s.min||u>s.max)return!1;n>>=1}o+=8}return!0}},{key:"_decode",value:function(e,t){if(this._counters=this._fillCounters(),!(t=this._findStart()))return null;var n,r=t.startCounter,o=[];do{if((n=this._toPattern(r))<0)return null;var i=this._patternToChar(n);if(null===i)return null;if(o.push(i),r+=8,o.length>1&&this._isStartEnd(n))break}while(r<this._counters.length);if(o.length-2<4||!this._isStartEnd(n))return null;if(!this._verifyWhitespace(t.startCounter,r-8))return null;if(!this._validateResult(o,t.startCounter))return null;r=r>this._counters.length?this._counters.length:r;var a=t.start+this._sumCounters(t.startCounter,r-8);return{code:o.join(""),start:t.start,end:a,startInfo:t,decodedCodes:o,format:this.FORMAT}}}]),n}(O),Z=function(e){x()(n,e);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=R()(e);if(t){var o=R()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return S()(this,n)}}(n);function n(){var e;v()(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),E()(b()(e),"FORMAT","upc_a"),e}return g()(n,[{key:"_decode",value:function(e,t){var n=z.prototype._decode.call(this);return n&&n.code&&13===n.code.length&&"0"===n.code.charAt(0)?(n.code=n.code.substring(1),n):null}}]),n}(z),ee=function(e){x()(n,e);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=R()(e);if(t){var o=R()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return S()(this,n)}}(n);function n(){var e;v()(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),E()(b()(e),"FORMAT","ean_8"),e}return g()(n,[{key:"_decodePayload",value:function(e,t,n){for(var r=e,o=0;o<4;o++){if(!(r=this._decodeCode(r.end,10)))return null;t.push(r.code),n.push(r)}if(null===(r=this._findPattern(j,r.end,!0,!1)))return null;n.push(r);for(var i=0;i<4;i++){if(!(r=this._decodeCode(r.end,10)))return null;n.push(r),t.push(r.code)}return r}}]),n}(z),te=function(e){x()(n,e);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=R()(e);if(t){var o=R()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return S()(this,n)}}(n);function n(){var e;v()(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),E()(b()(e),"FORMAT","ean_2"),e}return g()(n,[{key:"_decode",value:function(e,t){e&&(this._row=e);var n=0,r=t,o=this._row.length,i=[],a=[],c=null;if(void 0===r)return null;for(var s=0;s<2&&r<o;s++){if(!(c=this._decodeCode(r)))return null;a.push(c),i.push(c.code%10),c.code>=10&&(n|=1<<1-s),1!==s&&(r=this._nextSet(this._row,c.end),r=this._nextUnset(this._row,r))}if(2!==i.length||parseInt(i.join(""))%4!==n)return null;var u=this._findStart();return{code:i.join(""),decodedCodes:a,end:c.end,format:this.FORMAT,startInfo:u,start:u.start}}}]),n}(z),ne=[24,20,18,17,12,6,3,10,9,5],re=function(e){x()(n,e);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=R()(e);if(t){var o=R()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return S()(this,n)}}(n);function n(){var e;v()(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),E()(b()(e),"FORMAT","ean_5"),e}return g()(n,[{key:"_decode",value:function(e,t){if(void 0===t)return null;e&&(this._row=e);for(var n=0,r=t,o=this._row.length,i=null,a=[],c=[],s=0;s<5&&r<o;s++){if(!(i=this._decodeCode(r)))return null;c.push(i),a.push(i.code%10),i.code>=10&&(n|=1<<4-s),4!==s&&(r=this._nextSet(this._row,i.end),r=this._nextUnset(this._row,r))}if(5!==a.length)return null;if(function(e){for(var t=e.length,n=0,r=t-2;r>=0;r-=2)n+=e[r];n*=3;for(var o=t-1;o>=0;o-=2)n+=e[o];return(n*=3)%10}(a)!==function(e){for(var t=0;t<10;t++)if(e===ne[t])return t;return null}(n))return null;var u=this._findStart();return{code:a.join(""),decodedCodes:c,end:i.end,format:this.FORMAT,startInfo:u,start:u.start}}}]),n}(z);function oe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var ie,ae=function(e){x()(n,e);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=R()(e);if(t){var o=R()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return S()(this,n)}}(n);function n(){var e;v()(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),E()(b()(e),"CODE_FREQUENCY",[[56,52,50,49,44,38,35,42,41,37],[7,11,13,14,19,25,28,21,22,26]]),E()(b()(e),"STOP_PATTERN",[1/6*7,1/6*7,1/6*7,1/6*7,1/6*7,1/6*7]),E()(b()(e),"FORMAT","upc_e"),e}return g()(n,[{key:"_decodePayload",value:function(e,t,n){for(var r=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?oe(Object(n),!0).forEach((function(t){E()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e),o=0,i=0;i<6;i++){if(!(r=this._decodeCode(r.end)))return null;r.code>=10&&(r.code=r.code-10,o|=1<<5-i),t.push(r.code),n.push(r)}return this._determineParity(o,t)?r:null}},{key:"_determineParity",value:function(e,t){for(var n=0;n<this.CODE_FREQUENCY.length;n++)for(var r=0;r<this.CODE_FREQUENCY[n].length;r++)if(e===this.CODE_FREQUENCY[n][r])return t.unshift(n),t.push(r),!0;return!1}},{key:"_convertToUPCA",value:function(e){var t=[e[0]],n=e[e.length-2];return(t=n<=2?t.concat(e.slice(1,3)).concat([n,0,0,0,0]).concat(e.slice(3,6)):3===n?t.concat(e.slice(1,4)).concat([0,0,0,0,0]).concat(e.slice(4,6)):4===n?t.concat(e.slice(1,5)).concat([0,0,0,0,0,e[5]]):t.concat(e.slice(1,6)).concat([0,0,0,0,n])).push(e[e.length-1]),t}},{key:"_checksum",value:function(e){return q()(R()(n.prototype),"_checksum",this).call(this,this._convertToUPCA(e))}},{key:"_findEnd",value:function(e,t){return q()(R()(n.prototype),"_findEnd",this).call(this,e,!0)}},{key:"_verifyTrailingWhitespace",value:function(e){var t=e.end+(e.end-e.start)/2;return t<this._row.length&&this._matchRange(e.end,t,0)?e:null}}]),n}(z),ce=function(e){x()(n,e);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=R()(e);if(t){var o=R()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return S()(this,n)}}(n);function n(e){var r;return v()(this,n),r=t.call(this,a()({normalizeBarSpaceWidth:!1},e)),E()(b()(r),"barSpaceRatio",[1,1]),E()(b()(r),"SINGLE_CODE_ERROR",.78),E()(b()(r),"AVG_CODE_ERROR",.38),E()(b()(r),"START_PATTERN",[1,1,1,1]),E()(b()(r),"STOP_PATTERN",[1,1,3]),E()(b()(r),"CODE_PATTERN",[[1,1,3,3,1],[3,1,1,1,3],[1,3,1,1,3],[3,3,1,1,1],[1,1,3,1,3],[3,1,3,1,1],[1,3,3,1,1],[1,1,1,3,3],[3,1,1,3,1],[1,3,1,3,1]]),E()(b()(r),"MAX_CORRECTION_FACTOR",5),E()(b()(r),"FORMAT","i2of5"),e.normalizeBarSpaceWidth&&(r.SINGLE_CODE_ERROR=.38,r.AVG_CODE_ERROR=.09),r.config=e,S()(r,b()(r))}return g()(n,[{key:"_matchPattern",value:function(e,t){if(this.config.normalizeBarSpaceWidth){for(var n=[0,0],r=[0,0],o=[0,0],i=this.MAX_CORRECTION_FACTOR,a=1/i,c=0;c<e.length;c++)n[c%2]+=e[c],r[c%2]+=t[c];o[0]=r[0]/n[0],o[1]=r[1]/n[1],o[0]=Math.max(Math.min(o[0],i),a),o[1]=Math.max(Math.min(o[1],i),a),this.barSpaceRatio=o;for(var s=0;s<e.length;s++)e[s]*=this.barSpaceRatio[s%2]}return O.prototype._matchPattern.call(this,e,t)}},{key:"_findPattern",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=new Array(e.length).fill(0),i=0,a={error:Number.MAX_VALUE,code:-1,start:0,end:0},c=this.AVG_CODE_ERROR;n=n||!1,r=r||!1,t||(t=this._nextSet(this._row));for(var s=t;s<this._row.length;s++)if(this._row[s]^(n?1:0))o[i]++;else{if(i===o.length-1){var u=o.reduce((function(e,t){return e+t}),0),f=this._matchPattern(o,e);if(f<c)return a.error=f,a.start=s-u,a.end=s,a;if(!r)return null;for(var l=0;l<o.length-2;l++)o[l]=o[l+2];o[o.length-2]=0,o[o.length-1]=0,i--}else i++;o[i]=1,n=!n}return null}},{key:"_findStart",value:function(){for(var e=0,t=this._nextSet(this._row),n=null,r=1;!n;){if(!(n=this._findPattern(this.START_PATTERN,t,!1,!0)))return null;if(r=Math.floor((n.end-n.start)/4),(e=n.start-10*r)>=0&&this._matchRange(e,n.start,0))return n;t=n.end,n=null}return null}},{key:"_verifyTrailingWhitespace",value:function(e){var t=e.end+(e.end-e.start)/2;return t<this._row.length&&this._matchRange(e.end,t,0)?e:null}},{key:"_findEnd",value:function(){this._row.reverse();var e=this._findPattern(this.STOP_PATTERN);if(this._row.reverse(),null===e)return null;var t=e.start;return e.start=this._row.length-e.end,e.end=this._row.length-t,null!==e?this._verifyTrailingWhitespace(e):null}},{key:"_decodePair",value:function(e){for(var t=[],n=0;n<e.length;n++){var r=this._decodeCode(e[n]);if(!r)return null;t.push(r)}return t}},{key:"_decodeCode",value:function(e){for(var t=this.AVG_CODE_ERROR,n={error:Number.MAX_VALUE,code:-1,start:0,end:0},r=0;r<this.CODE_PATTERN.length;r++){var o=this._matchPattern(e,this.CODE_PATTERN[r]);o<n.error&&(n.code=r,n.error=o)}return n.error<t?n:null}},{key:"_decodePayload",value:function(e,t,n){for(var r=0,o=e.length,i=[[0,0,0,0,0],[0,0,0,0,0]],a=null;r<o;){for(var c=0;c<5;c++)i[0][c]=e[r]*this.barSpaceRatio[0],i[1][c]=e[r+1]*this.barSpaceRatio[1],r+=2;if(!(a=this._decodePair(i)))return null;for(var s=0;s<a.length;s++)t.push(a[s].code+""),n.push(a[s])}return a}},{key:"_verifyCounterLength",value:function(e){return e.length%10==0}},{key:"_decode",value:function(e,t){var n=new Array,r=new Array,o=this._findStart();if(!o)return null;r.push(o);var i=this._findEnd();if(!i)return null;var a=this._fillCounters(o.end,i.start,!1);return this._verifyCounterLength(a)&&this._decodePayload(a,n,r)?n.length%2!=0||n.length<6?null:(r.push(i),{code:n.join(""),start:o.start,end:i.end,startInfo:o,decodedCodes:r,format:this.FORMAT}):null}}]),n}(O),se=[3,1,3,1,1,1],ue=[3,1,1,1,3],fe=[[1,1,3,3,1],[3,1,1,1,3],[1,3,1,1,3],[3,3,1,1,1],[1,1,3,1,3],[3,1,3,1,1],[1,3,3,1,1],[1,1,1,3,3],[3,1,1,3,1],[1,3,1,3,1]],le=se.reduce((function(e,t){return e+t}),0),de=function(e){x()(n,e);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=R()(e);if(t){var o=R()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return S()(this,n)}}(n);function n(){var e;v()(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),E()(b()(e),"barSpaceRatio",[1,1]),E()(b()(e),"FORMAT","2of5"),E()(b()(e),"SINGLE_CODE_ERROR",.78),E()(b()(e),"AVG_CODE_ERROR",.3),e}return g()(n,[{key:"_findPattern",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=[],i=0,a={error:Number.MAX_VALUE,code:-1,start:0,end:0},c=0,s=0,u=this.AVG_CODE_ERROR;t||(t=this._nextSet(this._row));for(var f=0;f<e.length;f++)o[f]=0;for(var l=t;l<this._row.length;l++)if(this._row[l]^(n?1:0))o[i]++;else{if(i===o.length-1){c=0;for(var d=0;d<o.length;d++)c+=o[d];if((s=this._matchPattern(o,e))<u)return a.error=s,a.start=l-c,a.end=l,a;if(!r)return null;for(var p=0;p<o.length-2;p++)o[p]=o[p+2];o[o.length-2]=0,o[o.length-1]=0,i--}else i++;o[i]=1,n=!n}return null}},{key:"_findStart",value:function(){for(var e=null,t=this._nextSet(this._row),n=1,r=0;!e;){if(!(e=this._findPattern(se,t,!1,!0)))return null;if(n=Math.floor((e.end-e.start)/le),(r=e.start-5*n)>=0&&this._matchRange(r,e.start,0))return e;t=e.end,e=null}return e}},{key:"_verifyTrailingWhitespace",value:function(e){var t=e.end+(e.end-e.start)/2;return t<this._row.length&&this._matchRange(e.end,t,0)?e:null}},{key:"_findEnd",value:function(){this._row.reverse();var e=this._nextSet(this._row),t=this._findPattern(ue,e,!1,!0);if(this._row.reverse(),null===t)return null;var n=t.start;return t.start=this._row.length-t.end,t.end=this._row.length-n,null!==t?this._verifyTrailingWhitespace(t):null}},{key:"_verifyCounterLength",value:function(e){return e.length%10==0}},{key:"_decodeCode",value:function(e){for(var t=this.AVG_CODE_ERROR,n={error:Number.MAX_VALUE,code:-1,start:0,end:0},r=0;r<fe.length;r++){var o=this._matchPattern(e,fe[r]);o<n.error&&(n.code=r,n.error=o)}return n.error<t?n:null}},{key:"_decodePayload",value:function(e,t,n){for(var r=0,o=e.length,i=[0,0,0,0,0],a=null;r<o;){for(var c=0;c<5;c++)i[c]=e[r]*this.barSpaceRatio[0],r+=2;if(!(a=this._decodeCode(i)))return null;t.push("".concat(a.code)),n.push(a)}return a}},{key:"_decode",value:function(e,t){var n=this._findStart();if(!n)return null;var r=this._findEnd();if(!r)return null;var o=this._fillCounters(n.end,r.start,!1);if(!this._verifyCounterLength(o))return null;var i=[];i.push(n);var a=[];return this._decodePayload(o,a,i)?a.length<5?null:(i.push(r),{code:a.join(""),start:n.start,end:r.end,startInfo:n,decodedCodes:i,format:this.FORMAT}):null}}]),n}(O),pe=new Uint16Array(U()("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%abcd*").map((function(e){return e.charCodeAt(0)}))),he=new Uint16Array([276,328,324,322,296,292,290,336,274,266,424,420,418,404,402,394,360,356,354,308,282,344,332,326,300,278,436,434,428,422,406,410,364,358,310,314,302,468,466,458,366,374,430,294,474,470,306,350]),ve=/[AEIO]/g,me={code_128_reader:k,ean_reader:z,ean_5_reader:re,ean_2_reader:te,ean_8_reader:ee,code_39_reader:W,code_39_vin_reader:H,codabar_reader:K,upc_reader:Z,upc_e_reader:ae,i2of5_reader:ce,"2of5_reader":de,code_93_reader:function(e){x()(n,e);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=R()(e);if(t){var o=R()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return S()(this,n)}}(n);function n(){var e;v()(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),E()(b()(e),"FORMAT","code_93"),e}return g()(n,[{key:"_patternToChar",value:function(e){for(var t=0;t<he.length;t++)if(he[t]===e)return String.fromCharCode(pe[t]);return null}},{key:"_toPattern",value:function(e){for(var t=e.length,n=e.reduce((function(e,t){return e+t}),0),r=0,o=0;o<t;o++){var i=Math.round(9*e[o]/n);if(i<1||i>4)return-1;if(0==(1&o))for(var a=0;a<i;a++)r=r<<1|1;else r<<=i}return r}},{key:"_findStart",value:function(){for(var e=this._nextSet(this._row),t=e,n=new Uint16Array([0,0,0,0,0,0]),r=0,o=!1,i=e;i<this._row.length;i++)if(this._row[i]^(o?1:0))n[r]++;else{if(r===n.length-1){if(350===this._toPattern(n)){var a=Math.floor(Math.max(0,t-(i-t)/4));if(this._matchRange(a,t,0))return{start:t,end:i}}t+=n[0]+n[1];for(var c=0;c<4;c++)n[c]=n[c+2];n[4]=0,n[5]=0,r--}else r++;n[r]=1,o=!o}return null}},{key:"_verifyEnd",value:function(e,t){return!(e===t||!this._row[t])}},{key:"_decodeExtended",value:function(e){for(var t=e.length,n=[],r=0;r<t;r++){var o=e[r];if(o>="a"&&o<="d"){if(r>t-2)return null;var i=e[++r],a=i.charCodeAt(0),c=void 0;switch(o){case"a":if(!(i>="A"&&i<="Z"))return null;c=String.fromCharCode(a-64);break;case"b":if(i>="A"&&i<="E")c=String.fromCharCode(a-38);else if(i>="F"&&i<="J")c=String.fromCharCode(a-11);else if(i>="K"&&i<="O")c=String.fromCharCode(a+16);else if(i>="P"&&i<="S")c=String.fromCharCode(a+43);else{if(!(i>="T"&&i<="Z"))return null;c=String.fromCharCode(127)}break;case"c":if(i>="A"&&i<="O")c=String.fromCharCode(a-32);else{if("Z"!==i)return null;c=":"}break;case"d":if(!(i>="A"&&i<="Z"))return null;c=String.fromCharCode(a+32);break;default:return console.warn("* code_93_reader _decodeExtended hit default case, this may be an error",c),null}n.push(c)}else n.push(o)}return n}},{key:"_matchCheckChar",value:function(e,t,n){var r=e.slice(0,t),o=r.length,i=r.reduce((function(e,t,r){return e+((-1*r+(o-1))%n+1)*pe.indexOf(t.charCodeAt(0))}),0);return pe[i%47]===e[t].charCodeAt(0)}},{key:"_verifyChecksums",value:function(e){return this._matchCheckChar(e,e.length-2,20)&&this._matchCheckChar(e,e.length-1,15)}},{key:"_decode",value:function(e,t){if(!(t=this._findStart()))return null;var n,r,o=new Uint16Array([0,0,0,0,0,0]),i=[],a=this._nextSet(this._row,t.end);do{o=this._toCounters(a,o);var c=this._toPattern(o);if(c<0)return null;if(null===(r=this._patternToChar(c)))return null;i.push(r),n=a,a+=P.a.sum(o),a=this._nextSet(this._row,a)}while("*"!==r);return i.pop(),i.length&&this._verifyEnd(n,a)&&this._verifyChecksums(i)?(i=i.slice(0,i.length-2),null===(i=this._decodeExtended(i))?null:{code:i.join(""),start:t.start,end:a,startInfo:t,decodedCodes:i,format:this.FORMAT}):null}}]),n}(O),code_32_reader:function(e){x()(n,e);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=R()(e);if(t){var o=R()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return S()(this,n)}}(n);function n(){var e;v()(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),E()(b()(e),"FORMAT","code_32_reader"),e}return g()(n,[{key:"_decodeCode32",value:function(e){if(/[^0-9BCDFGHJKLMNPQRSTUVWXYZ]/.test(e))return null;for(var t=0,n=0;n<e.length;n++)t=32*t+"0123456789BCDFGHJKLMNPQRSTUVWXYZ".indexOf(e[n]);var r=""+t;return r.length<9&&(r=("000000000"+r).slice(-9)),"A"+r}},{key:"_checkChecksum",value:function(e){return!!e}},{key:"_decode",value:function(e,t){var r=q()(R()(n.prototype),"_decode",this).call(this,e,t);if(!r)return null;var o=r.code;if(!o)return null;if(o=o.replace(ve,""),!this._checkChecksum(o))return null;var i=this._decodeCode32(o);return i?(r.code=i,r):null}}]),n}(W)},ge={registerReader:function(e,t){me[e]=t},create:function(e,t){var n=[];function r(){e.readers.forEach((function(e){var t,r={},i=[];"object"===o()(e)?(t=e.format,r=e.config):"string"==typeof e&&(t=e),r.supplements&&(i=r.supplements.map((function(e){return new me[e]})));try{var a=new me[t](r,i);n.push(a)}catch(e){throw console.error("* Error constructing reader ",t,e),e}}))}function i(e){var r,o=null,i=d.getBarcodeLine(t,e[0],e[1]);for(d.toBinaryLine(i),r=0;r<n.length&&null===o;r++)o=n[r].decodePattern(i.line);return null===o?null:{codeResult:o,barcodeLine:i}}function a(e){var n,r,o=function(e){return Math.sqrt(Math.pow(Math.abs(e[1].y-e[0].y),2)+Math.pow(Math.abs(e[1].x-e[0].x),2))}(n=function(e){return[{x:(e[1][0]-e[0][0])/2+e[0][0],y:(e[1][1]-e[0][1])/2+e[0][1]},{x:(e[3][0]-e[2][0])/2+e[2][0],y:(e[3][1]-e[2][1])/2+e[2][1]}]}(e)),a=Math.atan2(n[1].y-n[0].y,n[1].x-n[0].x);return null===(n=function(e,n,r){function o(t){var r=t*Math.sin(n),o=t*Math.cos(n);e[0].y-=r,e[0].x-=o,e[1].y+=r,e[1].x+=o}for(o(r);r>1&&(!t.inImageWithBorder(e[0])||!t.inImageWithBorder(e[1]));)o(-(r-=Math.ceil(r/2)));return e}(n,a,Math.floor(.1*o)))?null:(null===(r=i(n))&&(r=function(e,t,n){var r,o,a,c=Math.sqrt(Math.pow(e[1][0]-e[0][0],2)+Math.pow(e[1][1]-e[0][1],2)),s=null,u=Math.sin(n),f=Math.cos(n);for(r=1;r<16&&null===s;r++)a={y:(o=c/16*r*(r%2==0?-1:1))*u,x:o*f},t[0].y+=a.x,t[0].x-=a.y,t[1].y+=a.x,t[1].x-=a.y,s=i(t);return s}(e,n,a)),null===r?null:{codeResult:r.codeResult,line:n,angle:a,pattern:r.barcodeLine.line,threshold:r.barcodeLine.threshold})}return r(),{decodeFromBoundingBox:function(e){return a(e)},decodeFromBoundingBoxes:function(t){var n,r,o=[],i=e.multiple;for(n=0;n<t.length;n++){var c=t[n];if((r=a(c)||{}).box=c,i)o.push(r);else if(r.codeResult)return r}if(i)return{barcodes:o}},decodeFromImage:function(e){return function(e){for(var t=null,r=0;r<n.length&&null===t;r++)t=n[r].decodeImage?n[r].decodeImage(e):null;return t}(e)},registerReader:function(e,t){if(me[e])throw new Error("cannot register existing reader",e);me[e]=t},setReaders:function(t){e.readers=t,n.length=0,r()}}}},ye=function(){var e={};function t(t){return e[t]||(e[t]={subscribers:[]}),e[t]}function n(e,t){e.async?setTimeout((function(){e.callback(t)}),4):e.callback(t)}function r(e,n,r){var o;if("function"==typeof n)o={callback:n,async:r};else if(!(o=n).callback)throw new Error("Callback was not specified on options");t(e).subscribers.push(o)}return{subscribe:function(e,t,n){return r(e,t,n)},publish:function(e,r){var o=t(e),i=o.subscribers;i.filter((function(e){return!!e.once})).forEach((function(e){n(e,r)})),o.subscribers=i.filter((function(e){return!e.once})),o.subscribers.forEach((function(e){n(e,r)}))},once:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];r(e,{callback:t,async:n,once:!0})},unsubscribe:function(n,r){if(n){var o=t(n);o.subscribers=o&&r?o.subscribers.filter((function(e){return e.callback!==r})):[]}else e={}}}}(),be=n(11),_e=n.n(be),xe=n(20),Ce=n.n(xe),Se=n(84),we=n.n(Se),Re="This may mean that the user has declined camera access, or the browser does not support media APIs. If you are running in iOS, you must use Safari.";function Te(){try{return navigator.mediaDevices.enumerateDevices()}catch(t){var e=new Error("enumerateDevices is not defined. ".concat(Re));return e.code=-1,Promise.reject(e)}}function Ee(e){try{return navigator.mediaDevices.getUserMedia(e)}catch(e){var t=new Error("getUserMedia is not defined. ".concat(Re));return t.code=-1,Promise.reject(t)}}function Pe(e){return new Promise((function(t,n){var r=10;!function o(){r>0?e.videoWidth>10&&e.videoHeight>10?t():window.setTimeout(o,500):n(new Error("Unable to play video stream. Is webcam working?")),r--}()}))}function Oe(e,t){return ke.apply(this,arguments)}function ke(){return(ke=Ce()(_e.a.mark((function e(t,n){var r;return _e.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ee(n);case 2:if(r=e.sent,ie=r,!t){e.next=11;break}return t.setAttribute("autoplay","true"),t.setAttribute("muted","true"),t.setAttribute("playsinline","true"),t.srcObject=r,t.addEventListener("loadedmetadata",(function(){t.play()})),e.abrupt("return",Pe(t));case 11:return e.abrupt("return",Promise.resolve());case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function De(e){var t=we()(e,["width","height","facingMode","aspectRatio","deviceId"]);return void 0!==e.minAspectRatio&&e.minAspectRatio>0&&(t.aspectRatio=e.minAspectRatio,console.log("WARNING: Constraint 'minAspectRatio' is deprecated; Use 'aspectRatio' instead")),void 0!==e.facing&&(t.facingMode=e.facing,console.log("WARNING: Constraint 'facing' is deprecated. Use 'facingMode' instead'")),t}function Me(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=De(e);return t&&t.deviceId&&t.facingMode&&delete t.facingMode,Promise.resolve({audio:!1,video:t})}function Ae(){return(Ae=Ce()(_e.a.mark((function e(){var t;return _e.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Te();case 2:return t=e.sent,e.abrupt("return",t.filter((function(e){return"videoinput"===e.kind})));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function je(){if(!ie)return null;var e=ie.getVideoTracks();return e&&null!=e&&e.length?e[0]:null}var Ie={requestedVideoElement:null,request:function(e,t){return Ce()(_e.a.mark((function n(){var r;return _e.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return Ie.requestedVideoElement=e,n.next=3,Me(t);case 3:return r=n.sent,n.abrupt("return",Oe(e,r));case 5:case"end":return n.stop()}}),n)})))()},release:function(){var e=ie&&ie.getVideoTracks();return null!==Ie.requestedVideoElement&&Ie.requestedVideoElement.pause(),new Promise((function(t){setTimeout((function(){e&&e.length&&e[0].stop(),ie=null,Ie.requestedVideoElement=null,t()}),0)}))},enumerateVideoDevices:function(){return Ae.apply(this,arguments)},getActiveStreamLabel:function(){var e=je();return e?e.label:""},getActiveTrack:je},Le=Ie,Ne={create:function(e){var t,n=document.createElement("canvas"),r=n.getContext("2d"),o=[],i=null!==(t=e.capacity)&&void 0!==t?t:20,a=!0===e.capture;function c(t){return!!i&&t&&!function(e,t){return t&&t.some((function(t){return Object.keys(t).every((function(n){return t[n]===e[n]}))}))}(t,e.blacklist)&&function(e,t){return"function"!=typeof t||t(e)}(t,e.filter)}return{addResult:function(e,t,s){var u={};c(s)&&(i--,u.codeResult=s,a&&(n.width=t.x,n.height=t.y,p.a.drawImage(e,t,r),u.frame=n.toDataURL()),o.push(u))},getResults:function(){return o}}}},ze={inputStream:{name:"Live",type:"LiveStream",constraints:{width:640,height:480,facingMode:"environment"},area:{top:"0%",right:"0%",left:"0%",bottom:"0%"},singleChannel:!1},locate:!0,numOfWorkers:4,decoder:{readers:["code_128_reader"]},locator:{halfSample:!0,patchSize:"medium"}},Fe=n(7),Ue=function e(){v()(this,e),E()(this,"config",void 0),E()(this,"inputStream",void 0),E()(this,"framegrabber",void 0),E()(this,"inputImageWrapper",void 0),E()(this,"stopped",!1),E()(this,"boxSize",void 0),E()(this,"resultCollector",void 0),E()(this,"decoder",void 0),E()(this,"workerPool",[]),E()(this,"onUIThread",!0),E()(this,"canvasContainer",new Be)},Ge=function e(){v()(this,e),E()(this,"image",void 0),E()(this,"overlay",void 0)},Be=function e(){v()(this,e),E()(this,"ctx",void 0),E()(this,"dom",void 0),this.ctx=new Ge,this.dom=new Ge},We=n(23);function Ve(e){if("undefined"==typeof document)return null;if(e instanceof HTMLElement&&e.nodeName&&1===e.nodeType)return e;var t="string"==typeof e?e:"#interactive.viewport";return document.querySelector(t)}function qe(e,t){var n=function(e,t){var n=document.querySelector(e);return n||((n=document.createElement("canvas")).className=t),n}(e,t),r=n.getContext("2d");return{canvas:n,context:r}}var Je={274:"orientation"},Xe=Object.keys(Je).map((function(e){return Je[e]}));function He(e){return new Promise((function(t){var n=new FileReader;n.onload=function(e){return t(e.target.result)},n.readAsArrayBuffer(e)}))}function $e(e){return new Promise((function(t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="blob",r.onreadystatechange=function(){r.readyState!==XMLHttpRequest.DONE||200!==r.status&&0!==r.status||t(this.response)},r.onerror=n,r.send()}))}function Ye(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Xe,n=new DataView(e),r=e.byteLength,o=t.reduce((function(e,t){var n=Object.keys(Je).filter((function(e){return Je[e]===t}))[0];return n&&(e[n]=t),e}),{}),i=2;if(255!==n.getUint8(0)||216!==n.getUint8(1))return!1;for(;i<r;){if(255!==n.getUint8(i))return!1;if(225===n.getUint8(i+1))return Qe(n,i+4,o);i+=2+n.getUint16(i+2)}return!1}function Qe(e,t,n){if("Exif"!==function(e,t,n){for(var r="",o=t;o<t+4;o++)r+=String.fromCharCode(e.getUint8(o));return r}(e,t))return!1;var r,o=t+6;if(18761===e.getUint16(o))r=!1;else{if(19789!==e.getUint16(o))return!1;r=!0}if(42!==e.getUint16(o+2,!r))return!1;var i=e.getUint32(o+4,!r);return!(i<8)&&function(e,t,n,r,o){for(var i=e.getUint16(n,!o),a={},c=0;c<i;c++){var s=n+12*c+2,u=r[e.getUint16(s,!o)];u&&(a[u]=Ke(e,s,0,0,o))}return a}(e,0,o+i,n,r)}function Ke(e,t,n,r,o){var i=e.getUint16(t+2,!o),a=e.getUint32(t+4,!o);switch(i){case 3:if(1===a)return e.getUint16(t+8,!o)}return null}var Ze={};function et(e,t){e.onload=function(){t.loaded(this)}}Ze.load=function(e,t,n,r,o){var i,a,c,s=new Array(r),u=new Array(s.length);if(!1===o)s[0]=e;else for(i=0;i<s.length;i++)c=n+i,s[i]="".concat(e,"image-").concat("00".concat(c).slice(-3),".jpg");for(u.notLoaded=[],u.addImage=function(e){u.notLoaded.push(e)},u.loaded=function(n){for(var r=u.notLoaded,i=0;i<r.length;i++)if(r[i]===n){r.splice(i,1);for(var a=0;a<s.length;a++){var c=s[a].substr(s[a].lastIndexOf("/"));if(-1!==n.src.lastIndexOf(c)){u[a]={img:n};break}}break}0===r.length&&(!1===o?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Xe;return/^blob:/i.test(e)?$e(e).then(He).then((function(e){return Ye(e,t)})):Promise.resolve(null)}(e,["orientation"]).then((function(e){u[0].tags=e,t(u)})).catch((function(e){console.log(e),t(u)})):t(u))},i=0;i<s.length;i++)a=new Image,u.addImage(a),et(a,u),a.src=s[i]};var tt=Ze,nt={createVideoStream:function(e){var t,n,r=null,o=["canrecord","ended"],i={},a={x:0,y:0,type:"Point"},c={x:0,y:0,type:"XYSize"},s={getRealWidth:function(){return e.videoWidth},getRealHeight:function(){return e.videoHeight},getWidth:function(){return t},getHeight:function(){return n},setWidth:function(e){t=e},setHeight:function(e){n=e},setInputStream:function(e){r=e,this.setAttribute("src",void 0!==e.src?e.src:"")},ended:function(){return e.ended},getConfig:function(){return r},setAttribute:function(t,n){e&&e.setAttribute(t,n)},pause:function(){e.pause()},play:function(){e.play()},setCurrentTime:function(e){var t;"LiveStream"!==(null===(t=r)||void 0===t?void 0:t.type)&&this.setAttribute("currentTime",e.toString())},addEventListener:function(t,n,r){-1!==o.indexOf(t)?(i[t]||(i[t]=[]),i[t].push(n)):e.addEventListener(t,n,r)},clearEventHandlers:function(){o.forEach((function(t){var n=i[t];n&&n.length>0&&n.forEach((function(n){e.removeEventListener(t,n)}))}))},trigger:function(o,a){var u,f,l,d,p,h=i[o];if("canrecord"===o&&(d=e.videoWidth,p=e.videoHeight,t=null!==(f=r)&&void 0!==f&&f.size?d/p>1?r.size:Math.floor(d/p*r.size):d,n=null!==(l=r)&&void 0!==l&&l.size?d/p>1?Math.floor(p/d*r.size):r.size:p,c.x=t,c.y=n),h&&h.length>0)for(u=0;u<h.length;u++)h[u].apply(s,a)},setTopRight:function(e){a.x=e.x,a.y=e.y},getTopRight:function(){return a},setCanvasSize:function(e){c.x=e.x,c.y=e.y},getCanvasSize:function(){return c},getFrame:function(){return e}};return s},createLiveStream:function(e){e&&e.setAttribute("autoplay","true");var t=nt.createVideoStream(e);return t.ended=function(){return!1},t},createImageStream:function(){var e,t,n=null,r=0,o=0,i=0,a=!0,c=!1,s=null,u=0,f=null,l=!1,d=["canrecord","ended"],p={},h={x:0,y:0,type:"Point"},v={x:0,y:0,type:"XYSize"};function m(e,t){var n,r=p[e];if(r&&r.length>0)for(n=0;n<r.length;n++)r[n].apply(g,t)}var g={trigger:m,getWidth:function(){return e},getHeight:function(){return t},setWidth:function(t){e=t},setHeight:function(e){t=e},getRealWidth:function(){return r},getRealHeight:function(){return o},setInputStream:function(a){var l;n=a,!1===a.sequence?(f=a.src,u=1):(f=a.src,u=a.length),c=!1,tt.load(f,(function(a){var u,f;if(s=a,a[0].tags&&a[0].tags.orientation)switch(a[0].tags.orientation){case 6:case 8:r=a[0].img.height,o=a[0].img.width;break;default:r=a[0].img.width,o=a[0].img.height}else r=a[0].img.width,o=a[0].img.height;e=null!==(u=n)&&void 0!==u&&u.size?r/o>1?n.size:Math.floor(r/o*n.size):r,t=null!==(f=n)&&void 0!==f&&f.size?r/o>1?Math.floor(o/r*n.size):n.size:o,v.x=e,v.y=t,c=!0,i=0,setTimeout((function(){m("canrecord",[])}),0)}),1,u,null===(l=n)||void 0===l?void 0:l.sequence)},ended:function(){return l},setAttribute:function(){},getConfig:function(){return n},pause:function(){a=!0},play:function(){a=!1},setCurrentTime:function(e){i=e},addEventListener:function(e,t){-1!==d.indexOf(e)&&(p[e]||(p[e]=[]),p[e].push(t))},clearEventHandlers:function(){Object.keys(p).forEach((function(e){return delete p[e]}))},setTopRight:function(e){h.x=e.x,h.y=e.y},getTopRight:function(){return h},setCanvasSize:function(e){v.x=e.x,v.y=e.y},getCanvasSize:function(){return v},getFrame:function(){var e,t;return c?(a||(e=null===(t=s)||void 0===t?void 0:t[i],i<u-1?i++:setTimeout((function(){l=!0,m("ended",[])}),0)),e):null}};return g}},rt=nt,ot=n(9),it=Math.PI/180,at={create:function(e,t){var n,r={},o=e.getConfig(),i=(Object(ot.h)(e.getRealWidth(),e.getRealHeight()),e.getCanvasSize()),a=Object(ot.h)(e.getWidth(),e.getHeight()),c=e.getTopRight(),s=c.x,u=c.y,f=null,l=null;return(n=t||document.createElement("canvas")).width=i.x,n.height=i.y,f=n.getContext("2d"),l=new Uint8Array(a.x*a.y),r.attachData=function(e){l=e},r.getData=function(){return l},r.grab=function(){var t,r=o.halfSample,c=e.getFrame(),d=c,p=0;if(d){if(function(e,t){e.width!==t.x&&(e.width=t.x),e.height!==t.y&&(e.height=t.y)}(n,i),"ImageStream"===o.type&&(d=c.img,c.tags&&c.tags.orientation))switch(c.tags.orientation){case 6:p=90*it;break;case 8:p=-90*it}return 0!==p?(f.translate(i.x/2,i.y/2),f.rotate(p),f.drawImage(d,-i.y/2,-i.x/2,i.y,i.x),f.rotate(-p),f.translate(-i.x/2,-i.y/2)):f.drawImage(d,0,0,i.x,i.y),t=f.getImageData(s,u,a.x,a.y).data,r?Object(ot.e)(t,a,l):Object(ot.c)(t,l,o),!0}return!1},r.getSize=function(){return a},r}};function ct(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function st(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ct(Object(n),!0).forEach((function(t){E()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ct(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ut=[];function ft(e){return st(st({},e),{},{inputStream:st(st({},e.inputStream),{},{target:null})})}function lt(e){if(e){var t=e().default;if(!t)return void self.postMessage({event:"error",message:"Quagga could not be created"})}var n;function r(e){self.postMessage({event:"processed",imageData:n.data,result:e},[n.data.buffer])}function o(){self.postMessage({event:"initialized",imageData:n.data},[n.data.buffer])}self.onmessage=function(e){if("init"===e.data.cmd){var i=e.data.config;i.numOfWorkers=0,n=new t.ImageWrapper({x:e.data.size.x,y:e.data.size.y},new Uint8Array(e.data.imageData)),t.init(i,o,n),t.onProcessed(r)}else"process"===e.data.cmd?(n.data=new Uint8Array(e.data.imageData),t.start()):"setReaders"===e.data.cmd?t.setReaders(e.data.readers):"registerReader"===e.data.cmd&&t.registerReader(e.data.name,e.data.reader)}}function dt(e,t,n){var r,o,i=("undefined"!=typeof __factorySource__&&(o=__factorySource__),r=new Blob(["("+lt.toString()+")("+o+");"],{type:"text/javascript"}),window.URL.createObjectURL(r)),a={worker:new Worker(i),imageData:new Uint8Array(t.getWidth()*t.getHeight()),busy:!0};a.worker.onmessage=function(e){"initialized"===e.data.event?(URL.revokeObjectURL(i),a.busy=!1,a.imageData=new Uint8Array(e.data.imageData),n(a)):"processed"===e.data.event?(a.imageData=new Uint8Array(e.data.imageData),a.busy=!1):e.data.event},a.worker.postMessage({cmd:"init",size:{x:t.getWidth(),y:t.getHeight()},imageData:a.imageData,config:ft(e)},[a.imageData.buffer])}function pt(e,t,n,r){var o=e-ut.length;if(0===o&&r)r();else if(o<0)ut.slice(o).forEach((function(e){e.worker.terminate()})),ut=ut.slice(0,o),r&&r();else{var i=function(t){ut.push(t),ut.length>=e&&r&&r()};if(t)for(var a=0;a<o;a++)dt(t,n,i)}}function ht(e,t,n){for(var r=e.length;r--;)e[r][0]+=t,e[r][1]+=n}var vt=function(){function e(){var t=this;v()(this,e),E()(this,"context",new Ue),E()(this,"canRecord",(function(e){var n;t.context.config&&(We.a.checkImageConstraints(t.context.inputStream,null===(n=t.context.config)||void 0===n?void 0:n.locator),t.initCanvas(),t.context.framegrabber=at.create(t.context.inputStream,t.context.canvasContainer.dom.image),void 0===t.context.config.numOfWorkers&&(t.context.config.numOfWorkers=0),pt(t.context.config.numOfWorkers,t.context.config,t.context.inputStream,(function(){var n;0===(null===(n=t.context.config)||void 0===n?void 0:n.numOfWorkers)&&t.initializeData(),t.ready(e)})))})),E()(this,"update",(function(){if(t.context.onUIThread){var e,n=(o=t.context.framegrabber,ut.length?!!(i=ut.filter((function(e){return!e.busy}))[0])&&(o.attachData(i.imageData),o.grab()&&(i.busy=!0,i.worker.postMessage({cmd:"process",imageData:i.imageData},[i.imageData.buffer])),!0):null);n||(t.context.framegrabber.attachData(null===(e=t.context.inputImageWrapper)||void 0===e?void 0:e.data),t.context.framegrabber.grab()&&(n||t.locateAndDecode()))}else{var r;t.context.framegrabber.attachData(null===(r=t.context.inputImageWrapper)||void 0===r?void 0:r.data),t.context.framegrabber.grab(),t.locateAndDecode()}var o,i}))}var t;return g()(e,[{key:"initBuffers",value:function(e){if(this.context.config){var t=function(e,t,n){var r=t||new c.a({x:e.getWidth(),y:e.getHeight(),type:"XYSize"}),o=[Object(Fe.clone)([0,0]),Object(Fe.clone)([0,r.size.y]),Object(Fe.clone)([r.size.x,r.size.y]),Object(Fe.clone)([r.size.x,0])];return We.a.init(r,n),{inputImageWrapper:r,boxSize:o}}(this.context.inputStream,e,this.context.config.locator),n=t.inputImageWrapper,r=t.boxSize;this.context.inputImageWrapper=n,this.context.boxSize=r}}},{key:"initializeData",value:function(e){this.context.config&&(this.initBuffers(e),this.context.decoder=ge.create(this.context.config.decoder,this.context.inputImageWrapper))}},{key:"getViewPort",value:function(){return this.context.config&&this.context.config.inputStream?Ve(this.context.config.inputStream.target):null}},{key:"ready",value:function(e){this.context.inputStream.play(),e()}},{key:"initCanvas",value:function(){var e=function(e){var t,n,r,o,i=Ve(null==e||null===(t=e.config)||void 0===t||null===(n=t.inputStream)||void 0===n?void 0:n.target),a=null==e||null===(r=e.config)||void 0===r||null===(o=r.inputStream)||void 0===o?void 0:o.type;if(!a)return null;var c=function(e){if("undefined"!=typeof document){var t=qe("canvas.imgBuffer","imgBuffer"),n=qe("canvas.drawingBuffer","drawingBuffer");return t.canvas.width=n.canvas.width=e.x,t.canvas.height=n.canvas.height=e.y,{dom:{image:t.canvas,overlay:n.canvas},ctx:{image:t.context,overlay:n.context}}}return null}(e.inputStream.getCanvasSize());if(!c)return{dom:{image:null,overlay:null},ctx:{image:null,overlay:null}};var s=c.dom;return"undefined"!=typeof document&&i&&("ImageStream"!==a||i.contains(s.image)||i.appendChild(s.image),i.contains(s.overlay)||i.appendChild(s.overlay)),c}(this.context);if(e){var t=e.ctx,n=e.dom;this.context.canvasContainer.dom.image=n.image,this.context.canvasContainer.dom.overlay=n.overlay,this.context.canvasContainer.ctx.image=t.image,this.context.canvasContainer.ctx.overlay=t.overlay}}},{key:"initInputStream",value:function(e){if(this.context.config&&this.context.config.inputStream){var t=this.context.config.inputStream,n=t.type,r=t.constraints,o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"LiveStream",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;switch(e){case"VideoStream":var r=document.createElement("video");return{video:r,inputStream:n.createVideoStream(r)};case"ImageStream":return{inputStream:n.createImageStream()};case"LiveStream":var o=null;return t&&((o=t.querySelector("video"))||(o=document.createElement("video"),t.appendChild(o))),{video:o,inputStream:n.createLiveStream(o)};default:return console.error("* setupInputStream invalid type ".concat(e)),{video:null,inputStream:null}}}(n,this.getViewPort(),rt),i=o.video,a=o.inputStream;"LiveStream"===n&&i&&Le.request(i,r).then((function(){return a.trigger("canrecord")})).catch((function(t){return e(t)})),a.setAttribute("preload","auto"),a.setInputStream(this.context.config.inputStream),a.addEventListener("canrecord",this.canRecord.bind(void 0,e)),this.context.inputStream=a}}},{key:"getBoundingBoxes",value:function(){var e;return null!==(e=this.context.config)&&void 0!==e&&e.locate?We.a.locate():[[Object(Fe.clone)(this.context.boxSize[0]),Object(Fe.clone)(this.context.boxSize[1]),Object(Fe.clone)(this.context.boxSize[2]),Object(Fe.clone)(this.context.boxSize[3])]]}},{key:"transformResult",value:function(e){var t=this,n=this.context.inputStream.getTopRight(),r=n.x,o=n.y;if((0!==r||0!==o)&&(e.barcodes&&e.barcodes.forEach((function(e){return t.transformResult(e)})),e.line&&2===e.line.length&&function(e,t,n){e[0].x+=t,e[0].y+=n,e[1].x+=t,e[1].y+=n}(e.line,r,o),e.box&&ht(e.box,r,o),e.boxes&&e.boxes.length>0))for(var i=0;i<e.boxes.length;i++)ht(e.boxes[i],r,o)}},{key:"addResult",value:function(e,t){var n=this;t&&this.context.resultCollector&&(e.barcodes?e.barcodes.filter((function(e){return e.codeResult})).forEach((function(e){return n.addResult(e,t)})):e.codeResult&&this.context.resultCollector.addResult(t,this.context.inputStream.getCanvasSize(),e.codeResult))}},{key:"hasCodeResult",value:function(e){return!(!e||!(e.barcodes?e.barcodes.some((function(e){return e.codeResult})):e.codeResult))}},{key:"publishResult",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0,n=e;e&&this.context.onUIThread&&(this.transformResult(e),this.addResult(e,t),n=e.barcodes||e),ye.publish("processed",n),this.hasCodeResult(e)&&ye.publish("detected",n)}},{key:"locateAndDecode",value:function(){var e=this.getBoundingBoxes();if(e){var t,n=this.context.decoder.decodeFromBoundingBoxes(e)||{};n.boxes=e,this.publishResult(n,null===(t=this.context.inputImageWrapper)||void 0===t?void 0:t.data)}else{var r,o=this.context.decoder.decodeFromImage(this.context.inputImageWrapper);o?this.publishResult(o,null===(r=this.context.inputImageWrapper)||void 0===r?void 0:r.data):this.publishResult()}}},{key:"startContinuousUpdate",value:function(){var e,t=this,n=null,r=1e3/((null===(e=this.context.config)||void 0===e?void 0:e.frequency)||60);this.context.stopped=!1;var o=this.context;!function e(i){n=n||i,o.stopped||(i>=n&&(n+=r,t.update()),window.requestAnimationFrame(e))}(performance.now())}},{key:"start",value:function(){var e,t;this.context.onUIThread&&"LiveStream"===(null===(e=this.context.config)||void 0===e||null===(t=e.inputStream)||void 0===t?void 0:t.type)?this.startContinuousUpdate():this.update()}},{key:"stop",value:(t=Ce()(_e.a.mark((function e(){var t;return _e.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.context.stopped=!0,pt(0),null===(t=this.context.config)||void 0===t||!t.inputStream||"LiveStream"!==this.context.config.inputStream.type){e.next=6;break}return e.next=5,Le.release();case 5:this.context.inputStream.clearEventHandlers();case 6:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"setReaders",value:function(e){this.context.decoder&&this.context.decoder.setReaders(e),function(e){ut.forEach((function(t){return t.worker.postMessage({cmd:"setReaders",readers:e})}))}(e)}},{key:"registerReader",value:function(e,t){ge.registerReader(e,t),this.context.decoder&&this.context.decoder.registerReader(e,t),function(e,t){ut.forEach((function(n){return n.worker.postMessage({cmd:"registerReader",name:e,reader:t})}))}(e,t)}}]),e}(),mt=new vt,gt=mt.context,yt={init:function(e,t,n){var r,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:mt;return t||(r=new Promise((function(e,n){t=function(t){t?n(t):e()}}))),o.context.config=a()({},ze,e),o.context.config.numOfWorkers>0&&(o.context.config.numOfWorkers=0),n?(o.context.onUIThread=!1,o.initializeData(n),t&&t()):o.initInputStream(t),r},start:function(){return mt.start()},stop:function(){return mt.stop()},pause:function(){gt.stopped=!0},onDetected:function(e){e&&("function"==typeof e||"object"===o()(e)&&e.callback)?ye.subscribe("detected",e):console.trace("* warning: Quagga.onDetected called with invalid callback, ignoring")},offDetected:function(e){ye.unsubscribe("detected",e)},onProcessed:function(e){e&&("function"==typeof e||"object"===o()(e)&&e.callback)?ye.subscribe("processed",e):console.trace("* warning: Quagga.onProcessed called with invalid callback, ignoring")},offProcessed:function(e){ye.unsubscribe("processed",e)},setReaders:function(e){e?mt.setReaders(e):console.trace("* warning: Quagga.setReaders called with no readers, ignoring")},registerReader:function(e,t){e?t?mt.registerReader(e,t):console.trace("* warning: Quagga.registerReader called with no reader, ignoring"):console.trace("* warning: Quagga.registerReader called with no name, ignoring")},registerResultCollector:function(e){e&&"function"==typeof e.addResult&&(gt.resultCollector=e)},get canvas(){return gt.canvasContainer},decodeSingle:function(e,t){var n=this,r=new vt;return(e=a()({inputStream:{type:"ImageStream",sequence:!1,size:800,src:e.src},numOfWorkers:1,locator:{halfSample:!1}},e)).numOfWorkers>0&&(e.numOfWorkers=0),e.numOfWorkers>0&&("undefined"==typeof Blob||"undefined"==typeof Worker)&&(console.warn("* no Worker and/or Blob support - forcing numOfWorkers to 0"),e.numOfWorkers=0),new Promise((function(o,i){try{n.init(e,(function(){ye.once("processed",(function(e){r.stop(),t&&t.call(null,e),o(e)}),!0),r.start()}),null,r)}catch(e){i(e)}}))},get default(){return yt},BarcodeReader:O,CameraAccess:Le,ImageDebug:p.a,ImageWrapper:c.a,ResultCollector:Ne};t.default=yt}]).default},xN7L:function(e,t,n){"use strict";n.r(t);var r={};n.r(r),n.d(r,"shimGetUserMedia",(function(){return k})),n.d(r,"shimGetDisplayMedia",(function(){return D})),n.d(r,"shimMediaStream",(function(){return M})),n.d(r,"shimOnTrack",(function(){return A})),n.d(r,"shimGetSendersWithDtmf",(function(){return j})),n.d(r,"shimGetStats",(function(){return I})),n.d(r,"shimSenderReceiverGetStats",(function(){return L})),n.d(r,"shimAddTrackRemoveTrackWithNative",(function(){return N})),n.d(r,"shimAddTrackRemoveTrack",(function(){return z})),n.d(r,"shimPeerConnection",(function(){return F})),n.d(r,"fixNegotiationNeeded",(function(){return U}));var o={};n.r(o),n.d(o,"shimGetUserMedia",(function(){return W})),n.d(o,"shimGetDisplayMedia",(function(){return V})),n.d(o,"shimPeerConnection",(function(){return q})),n.d(o,"shimReplaceTrack",(function(){return J}));var i={};n.r(i),n.d(i,"shimGetUserMedia",(function(){return X})),n.d(i,"shimGetDisplayMedia",(function(){return H})),n.d(i,"shimOnTrack",(function(){return $})),n.d(i,"shimPeerConnection",(function(){return Y})),n.d(i,"shimSenderGetStats",(function(){return Q})),n.d(i,"shimReceiverGetStats",(function(){return K})),n.d(i,"shimRemoveStream",(function(){return Z})),n.d(i,"shimRTCDataChannel",(function(){return ee})),n.d(i,"shimAddTransceiver",(function(){return te})),n.d(i,"shimGetParameters",(function(){return ne})),n.d(i,"shimCreateOffer",(function(){return re})),n.d(i,"shimCreateAnswer",(function(){return oe}));var a={};n.r(a),n.d(a,"shimLocalStreamsAPI",(function(){return ie})),n.d(a,"shimRemoteStreamsAPI",(function(){return ae})),n.d(a,"shimCallbacksAPI",(function(){return ce})),n.d(a,"shimGetUserMedia",(function(){return se})),n.d(a,"shimConstraints",(function(){return ue})),n.d(a,"shimRTCIceServerUrls",(function(){return fe})),n.d(a,"shimTrackEventTransceiver",(function(){return le})),n.d(a,"shimCreateOfferLegacy",(function(){return de})),n.d(a,"shimAudioContext",(function(){return pe}));var c={};function s(){var e={},t=!0,n=0;"[object Boolean]"===Object.prototype.toString.call(arguments[0])&&(t=arguments[0],n++);for(var r=function(n){for(var r in n)n.hasOwnProperty(r)&&(t&&"[object Object]"===Object.prototype.toString.call(n[r])?e[r]=s(e[r],n[r]):e[r]=n[r])};n<arguments.length;n++)r(arguments[n]);return e}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.r(c),n.d(c,"shimRTCIceCandidate",(function(){return me})),n.d(c,"shimMaxMessageSize",(function(){return ge})),n.d(c,"shimSendThrowTypeError",(function(){return ye})),n.d(c,"shimConnectionState",(function(){return be})),n.d(c,"removeExtmapAllowMixed",(function(){return _e})),n.d(c,"shimAddIceCandidateNullOrEmpty",(function(){return xe}));var f=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._defaults={insertPosition:e.BEFORE_BEGIN,level:null,message:null},this.options=s(this._defaults,n,!0),this.el=t||null,this.noticeInstance=null,this.init()}var t,n,r;return t=e,r=[{key:"BEFORE_BEGIN",get:function(){return"beforebegin"}},{key:"BEFORE_END",get:function(){return"beforeend"}},{key:"AFTER_BEGIN",get:function(){return"afterbegin"}},{key:"AFTER_END",get:function(){return"afterend"}}],(n=[{key:"init",value:function(){if(null===this.el)throw new Error("No valid Element was passed.");this.registerEvents()}},{key:"registerEvents",value:function(){var e=this;null!==this.noticeInstance&&this.noticeInstance.addEventListener("click",(function(t){return e.onClick(t)}))}},{key:"onClick",value:function(e){}},{key:"onClickCloseIcon",value:function(e){this.removeNotice()}},{key:"hide",value:function(e){e.style.display="none"}},{key:"show",value:function(e){e.style.display="block"}},{key:"toggle",value:function(e){"block"!==window.getComputedStyle(e).display?this.show(e):this.hide(e)}},{key:"addNotice",value:function(){var e=this.buildNotice();this.renderNotice(e),this.noticeInstance=e}},{key:"removeNotice",value:function(){this.el.parentElement.removeChild(this.noticeInstance),this.resetNoticeInstance()}},{key:"buildNotice",value:function(){var e=document.createElement("DIV");return e.classList.add("alert","alert-".concat(this.options.level)),e.innerText=this.options.message,e}},{key:"renderNotice",value:function(e){null===this.noticeInstance&&this.el.parentElement.insertBefore(e,this.el)}},{key:"resetNoticeInstance",value:function(){this.noticeInstance=null}}])&&u(t.prototype,n),r&&u(t,r),e}();function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var d=function(){function e(t,n,r,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._defaults={productId:0,productIsValid:!0,listening:!1,observableProperties:null},this.options=s(this._defaults,o,!0),this.el=r||null,this.productEditorNotice=t||null,this.attributeListener=n||null,this.observer=null,this.init()}var t,n,r;return t=e,r=[{key:"TOTAL_ATTRIBUTE",get:function(){return"data-total"}}],(n=[{key:"init",value:function(){if(null===this.el)throw new Error("No valid Element was passed.");if(null===this.productEditorNotice)throw new Error("No valid ProductEditorNotice was passed.");if(null===this.attributeListener)throw new Error("No valid AttributeListener was passed.");this.registerEvents()}},{key:"registerEvents",value:function(){var t=this;window.addEventListener("load",(function(){return t.onLoad()})),this.options.listening&&(this.attributeListener.init((function(n){n.forEach((function(n){n.type===t.attributeListener.options.observerType&&null!==n.attributeName&&(!n.attributeName in t.options.observableProperties||e.TOTAL_ATTRIBUTE===n.attributeName&&t.processDataTotal(n.target))}))}),this.el,{observe:this.options.listening,observableProperties:this.options.observableProperties}),this.attributeListener.observe())}},{key:"onLoad",value:function(){this.options.productIsValid?null!==this.productEditorNotice.noticeInstance&&this.productEditorNotice.noticeInstance.removeNotice():this.productEditorNotice.addNotice()}},{key:"processDataTotal",value:function(t){if(t.hasAttribute(e.TOTAL_ATTRIBUTE)){var n=t.getAttribute(e.TOTAL_ATTRIBUTE);if(0===parseInt(n))return this.options.productIsValid=!1,void(null===this.productEditorNotice.noticeInstance&&this.productEditorNotice.addNotice());null!==this.productEditorNotice.noticeInstance&&(this.options.productIsValid=!0,this.productEditorNotice.removeNotice())}}}])&&l(t.prototype,n),r&&l(t,r),e}();function p(){var e={},t=!0,n=0;"[object Boolean]"===Object.prototype.toString.call(arguments[0])&&(t=arguments[0],n++);for(var r=function(n){for(var r in n)n.hasOwnProperty(r)&&(t&&"[object Object]"===Object.prototype.toString.call(n[r])?e[r]=p(e[r],n[r]):e[r]=n[r])};n<arguments.length;n++)r(arguments[n]);return e}function h(e){return(h="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 v(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function m(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var g=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;v(this,e),this.options=null,this.el=t||null,this.config=n||{},this.callback=r||null,this.observer=null}var t,n,r;return t=e,r=[{key:"OBSERVER_TYPE",get:function(){return"attributes"}},{key:"DEFAULT_OPTIONS",get:function(){return{observe:!1,observableProperties:null,observerType:e.OBSERVER_TYPE}}},{key:"DEFAULT_CONFIG",get:function(){var t={};return t[e.OBSERVER_TYPE]=!0,t}}],(n=[{key:"validateProperties",value:function(){if(null===this.el)throw new Error("No valid Element was passed.");if((e=this.config).constructor===Object&&0===Object.keys(e).length)throw new Error("Your passed config is empty.");var e}},{key:"init",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(null===t||h(t)!==("undefined"==typeof Function?"undefined":h(Function)))throw new Error("No valid callback function was passed.");this.callback=t,this.options=p(e.DEFAULT_OPTIONS,r,!0),this.config=p(e.DEFAULT_CONFIG,o,!0),n&&(this.el=n||null),this.validateProperties(),this.options.observe&&(this.observer=new MutationObserver(t))}},{key:"observe",value:function(){if(null===this.observer)throw new Error("No Observer initialized");!1!==this.options.observable&&this.observer.observe(this.el,this.config)}},{key:"takeRecords",value:function(){return this.observer.takeRecords()}},{key:"disconnect",value:function(){this.observer.disconnect()}}])&&m(t.prototype,n),r&&m(t,r),e}();let y=!0,b=!0;function _(e,t,n){const r=e.match(t);return r&&r.length>=n&&parseInt(r[n],10)}function x(e,t,n){if(!e.RTCPeerConnection)return;const r=e.RTCPeerConnection.prototype,o=r.addEventListener;r.addEventListener=function(e,r){if(e!==t)return o.apply(this,arguments);const i=e=>{const t=n(e);t&&(r.handleEvent?r.handleEvent(t):r(t))};return this._eventMap=this._eventMap||{},this._eventMap[t]||(this._eventMap[t]=new Map),this._eventMap[t].set(r,i),o.apply(this,[e,i])};const i=r.removeEventListener;r.removeEventListener=function(e,n){if(e!==t||!this._eventMap||!this._eventMap[t])return i.apply(this,arguments);if(!this._eventMap[t].has(n))return i.apply(this,arguments);const r=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,i.apply(this,[e,r])},Object.defineProperty(r,"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 C(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(y=e,e?"adapter.js logging disabled":"adapter.js logging enabled")}function S(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(b=!e,"adapter.js deprecation warnings "+(e?"disabled":"enabled"))}function w(){if("object"==typeof window){if(y)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}}function R(e,t){b&&console.warn(e+" is deprecated, please use "+t+" instead.")}function T(e){return"[object Object]"===Object.prototype.toString.call(e)}function E(e){return T(e)?Object.keys(e).reduce((function(t,n){const r=T(e[n]),o=r?E(e[n]):e[n],i=r&&!Object.keys(o).length;return void 0===o||i?t:Object.assign(t,{[n]:o})}),{}):e}function P(e,t,n){const r=n?"outbound-rtp":"inbound-rtp",o=new Map;if(null===t)return o;const i=[];return e.forEach(e=>{"track"===e.type&&e.trackIdentifier===t.id&&i.push(e)}),i.forEach(t=>{e.forEach(n=>{n.type===r&&n.trackId===t.id&&function e(t,n,r){n&&!r.has(n.id)&&(r.set(n.id,n),Object.keys(n).forEach(o=>{o.endsWith("Id")?e(t,t.get(n[o]),r):o.endsWith("Ids")&&n[o].forEach(n=>{e(t,t.get(n),r)})}))}(e,n,o)})}),o}const O=w;function k(e,t){const n=e&&e.navigator;if(!n.mediaDevices)return;const r=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 r="object"==typeof e[n]?e[n]:{ideal:e[n]};void 0!==r.exact&&"number"==typeof r.exact&&(r.min=r.max=r.exact);const o=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):"deviceId"===t?"sourceId":t};if(void 0!==r.ideal){t.optional=t.optional||[];let e={};"number"==typeof r.ideal?(e[o("min",n)]=r.ideal,t.optional.push(e),e={},e[o("max",n)]=r.ideal,t.optional.push(e)):(e[o("",n)]=r.ideal,t.optional.push(e))}void 0!==r.exact&&"number"!=typeof r.exact?(t.mandatory=t.mandatory||{},t.mandatory[o("",n)]=r.exact):["min","max"].forEach(e=>{void 0!==r[e]&&(t.mandatory=t.mandatory||{},t.mandatory[o(e,n)]=r[e])})}),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},o=function(e,o){if(t.version>=61)return o(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=r(e.audio)}if(e&&"object"==typeof e.video){let i=e.video.facingMode;i=i&&("object"==typeof i?i:{ideal:i});const a=t.version<66;if(i&&("user"===i.exact||"environment"===i.exact||"user"===i.ideal||"environment"===i.ideal)&&(!n.mediaDevices.getSupportedConstraints||!n.mediaDevices.getSupportedConstraints().facingMode||a)){let t;if(delete e.video.facingMode,"environment"===i.exact||"environment"===i.ideal?t=["back","rear"]:"user"!==i.exact&&"user"!==i.ideal||(t=["front"]),t)return n.mediaDevices.enumerateDevices().then(n=>{let a=(n=n.filter(e=>"videoinput"===e.kind)).find(e=>t.some(t=>e.label.toLowerCase().includes(t)));return!a&&n.length&&t.includes("back")&&(a=n[n.length-1]),a&&(e.video.deviceId=i.exact?{exact:a.deviceId}:{ideal:a.deviceId}),e.video=r(e.video),O("chrome: "+JSON.stringify(e)),o(e)})}e.video=r(e.video)}return O("chrome: "+JSON.stringify(e)),o(e)},i=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,r){o(e,e=>{n.webkitGetUserMedia(e,t,e=>{r&&r(i(e))})})}.bind(n),n.mediaDevices.getUserMedia){const e=n.mediaDevices.getUserMedia.bind(n.mediaDevices);n.mediaDevices.getUserMedia=function(t){return o(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(i(e))))}}}function D(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 r=n.video&&n.video.width,o=n.video&&n.video.height,i=n.video&&n.video.frameRate;return n.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:t,maxFrameRate:i||3}},r&&(n.video.mandatory.maxWidth=r),o&&(n.video.mandatory.maxHeight=o),e.navigator.mediaDevices.getUserMedia(n)})}:console.error("shimGetDisplayMedia: getSourceId argument is not a function"))}function M(e){e.MediaStream=e.MediaStream||e.webkitMediaStream}function A(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 r;r=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find(e=>e.track&&e.track.id===n.track.id):{track:n.track};const o=new Event("track");o.track=n.track,o.receiver=r,o.transceiver={receiver:r},o.streams=[t.stream],this.dispatchEvent(o)}),t.stream.getTracks().forEach(n=>{let r;r=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find(e=>e.track&&e.track.id===n.id):{track:n};const o=new Event("track");o.track=n,o.receiver=r,o.transceiver={receiver:r},o.streams=[t.stream],this.dispatchEvent(o)})},this.addEventListener("addstream",this._ontrackpoly)),t.apply(this,arguments)}}else x(e,"track",e=>(e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e))}function j(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,r){let o=n.apply(this,arguments);return o||(o=t(this,e),this._senders.push(o)),o};const r=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){r.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 r=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){this._senders=this._senders||[],r.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 I(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,n,r]=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 o=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},i=function(e){return new Map(Object.keys(e).map(t=>[t,e[t]]))};if(arguments.length>=2){const r=function(e){n(i(o(e)))};return t.apply(this,[r,e])}return new Promise((e,n)=>{t.apply(this,[function(t){e(i(o(t)))},n])}).then(n,r)}}function L(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=>P(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}),x(e,"track",e=>(e.receiver._pc=e.srcElement,e)),e.RTCRtpReceiver.prototype.getStats=function(){const e=this;return this._pc.getStats().then(t=>P(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,r;return this.getSenders().forEach(n=>{n.track===e&&(t?r=!0:t=n)}),this.getReceivers().forEach(t=>(t.track===e&&(n?r=!0:n=t),t.track===e)),r||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 N(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 r=t.apply(this,arguments);return this._shimmedLocalStreams[n.id]?-1===this._shimmedLocalStreams[n.id].indexOf(r)&&this._shimmedLocalStreams[n.id].push(r):this._shimmedLocalStreams[n.id]=[n,r],r};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 r=this.getSenders().filter(e=>-1===t.indexOf(e));this._shimmedLocalStreams[e.id]=[e].concat(r)};const r=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[e.id],r.apply(this,arguments)};const o=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]}),o.apply(this,arguments)}}function z(e,t){if(!e.RTCPeerConnection)return;if(e.RTCPeerConnection.prototype.addTrack&&t.version>=65)return N(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 r=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}r.apply(this,[t])};const o=e.RTCPeerConnection.prototype.removeStream;function i(e,t){let n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach(t=>{const r=e._reverseStreams[t],o=e._streams[r.id];n=n.replace(new RegExp(o.id,"g"),r.id)}),new RTCSessionDescription({type:t.type,sdp:n})}function a(e,t){let n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach(t=>{const r=e._reverseStreams[t],o=e._streams[r.id];n=n.replace(new RegExp(r.id,"g"),o.id)}),new RTCSessionDescription({type:t.type,sdp:n})}e.RTCPeerConnection.prototype.removeStream=function(e){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},o.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 r=[].slice.call(arguments,1);if(1!==r.length||!r[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 o=this.getSenders().find(e=>e.track===t);if(o)throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const i=this._streams[n.id];if(i)i.addTrack(t),Promise.resolve().then(()=>{this.dispatchEvent(new Event("negotiationneeded"))});else{const r=new e.MediaStream([t]);this._streams[n.id]=r,this._reverseStreams[r.id]=n,this.addStream(r)}return this.getSenders().find(e=>e.track===t)},["createOffer","createAnswer"].forEach((function(t){const n=e.RTCPeerConnection.prototype[t],r={[t](){const e=arguments;return arguments.length&&"function"==typeof arguments[0]?n.apply(this,[t=>{const n=i(this,t);e[0].apply(null,[n])},t=>{e[1]&&e[1].apply(null,t)},arguments[2]]):n.apply(this,arguments).then(e=>i(this,e))}};e.RTCPeerConnection.prototype[t]=r[t]}));const c=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=a(this,arguments[0]),c.apply(this,arguments)):c.apply(this,arguments)};const s=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get(){const e=s.get.apply(this);return""===e.type?e:i(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 F(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],r={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=r[t]}))}function U(e,t){x(e,"negotiationneeded",e=>{const n=e.target;if(!(t.version<72||n.getConfiguration&&"plan-b"===n.getConfiguration().sdpSemantics)||"stable"===n.signalingState)return e})}var G=n("8D0k"),B=n.n(G);function W(e){const t=e&&e.navigator,n=t.mediaDevices.getUserMedia.bind(t.mediaDevices);t.mediaDevices.getUserMedia=function(e){return n(e).catch(e=>Promise.reject(function(e){return{name:{PermissionDeniedError:"NotAllowedError"}[e.name]||e.name,message:e.message,constraint:e.constraint,toString(){return this.name}}}(e)))}}function V(e){"getDisplayMedia"in e.navigator&&e.navigator.mediaDevices&&(e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||(e.navigator.mediaDevices.getDisplayMedia=e.navigator.getDisplayMedia.bind(e.navigator)))}function q(e,t){if(e.RTCIceGatherer&&(e.RTCIceCandidate||(e.RTCIceCandidate=function(e){return e}),e.RTCSessionDescription||(e.RTCSessionDescription=function(e){return e}),t.version<15025)){const t=Object.getOwnPropertyDescriptor(e.MediaStreamTrack.prototype,"enabled");Object.defineProperty(e.MediaStreamTrack.prototype,"enabled",{set(e){t.set.call(this,e);const n=new Event("enabled");n.enabled=e,this.dispatchEvent(n)}})}e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)&&Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=new e.RTCDtmfSender(this):"video"===this.track.kind&&(this._dtmf=null)),this._dtmf}}),e.RTCDtmfSender&&!e.RTCDTMFSender&&(e.RTCDTMFSender=e.RTCDtmfSender);const n=B()(e,t.version);e.RTCPeerConnection=function(e){return e&&e.iceServers&&(e.iceServers=function(e,t){let n=!1;return(e=JSON.parse(JSON.stringify(e))).filter(e=>{if(e&&(e.urls||e.url)){let t=e.urls||e.url;e.url&&!e.urls&&R("RTCIceServer.url","RTCIceServer.urls");const r="string"==typeof t;return r&&(t=[t]),t=t.filter(e=>{if(0===e.indexOf("stun:"))return!1;const t=e.startsWith("turn")&&!e.startsWith("turn:[")&&e.includes("transport=udp");return t&&!n?(n=!0,!0):t&&!n}),delete e.url,e.urls=r?t[0]:t,!!t.length}})}(e.iceServers,t.version),w("ICE servers after filtering:",e.iceServers)),new n(e)},e.RTCPeerConnection.prototype=n.prototype}function J(e){e.RTCRtpSender&&!("replaceTrack"in e.RTCRtpSender.prototype)&&(e.RTCRtpSender.prototype.replaceTrack=e.RTCRtpSender.prototype.setTrack)}function X(e,t){const n=e&&e.navigator,r=e&&e.MediaStreamTrack;if(n.getUserMedia=function(e,t,r){R("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),n.mediaDevices.getUserMedia(e).then(t,r)},!(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)},r&&r.prototype.getSettings){const t=r.prototype.getSettings;r.prototype.getSettings=function(){const n=t.apply(this,arguments);return e(n,"mozAutoGainControl","autoGainControl"),e(n,"mozNoiseSuppression","noiseSuppression"),n}}if(r&&r.prototype.applyConstraints){const t=r.prototype.applyConstraints;r.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 H(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 $(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 Y(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],r={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=r[t]}));const n={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},r=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,o,i]=arguments;return r.apply(this,[e||null]).then(e=>{if(t.version<53&&!o)try{e.forEach(e=>{e.type=n[e.type]||e.type})}catch(t){if("TypeError"!==t.name)throw t;e.forEach((t,r)=>{e.set(r,Object.assign({},t,{type:n[t.type]||t.type}))})}return e}).then(o,i)}}function Q(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}),x(e,"track",e=>(e.receiver._pc=e.srcElement,e)),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function Z(e){e.RTCPeerConnection&&!("removeStream"in e.RTCPeerConnection.prototype)&&(e.RTCPeerConnection.prototype.removeStream=function(e){R("removeStream","removeTrack"),this.getSenders().forEach(t=>{t.track&&e.getTracks().includes(t.track)&&this.removeTrack(t)})})}function ee(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)}function te(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 r=t.apply(this,arguments);if(n){const{sender:t}=r,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 r})}function ne(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 re(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 oe(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 ie(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 ae(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 ce(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype,n=t.createOffer,r=t.createAnswer,o=t.setLocalDescription,i=t.setRemoteDescription,a=t.addIceCandidate;t.createOffer=function(e,t){const r=arguments.length>=2?arguments[2]:arguments[0],o=n.apply(this,[r]);return t?(o.then(e,t),Promise.resolve()):o},t.createAnswer=function(e,t){const n=arguments.length>=2?arguments[2]:arguments[0],o=r.apply(this,[n]);return t?(o.then(e,t),Promise.resolve()):o};let c=function(e,t,n){const r=o.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r};t.setLocalDescription=c,c=function(e,t,n){const r=i.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r},t.setRemoteDescription=c,c=function(e,t,n){const r=a.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r},t.addIceCandidate=c}function se(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(ue(e))}!t.getUserMedia&&t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,n,r){t.mediaDevices.getUserMedia(e).then(n,r)}.bind(t))}function ue(e){return e&&void 0!==e.video?Object.assign({},e,{video:E(e.video)}):e}function fe(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 r=e.iceServers[n];!r.hasOwnProperty("urls")&&r.hasOwnProperty("url")?(R("RTCIceServer.url","RTCIceServer.urls"),r=JSON.parse(JSON.stringify(r)),r.urls=r.url,delete r.url,t.push(r)):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 le(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 de(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 pe(e){"object"!=typeof e||e.AudioContext||(e.AudioContext=e.webkitAudioContext)}var he=n("KCt4"),ve=n.n(he);function me(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),r=ve.a.parseCandidate(e.candidate),o=Object.assign(n,r);return o.toJSON=function(){return{candidate:o.candidate,sdpMid:o.sdpMid,sdpMLineIndex:o.sdpMLineIndex,usernameFragment:o.usernameFragment}},o}return new t(e)},e.RTCIceCandidate.prototype=t.prototype,x(e,"icecandidate",t=>(t.candidate&&Object.defineProperty(t,"candidate",{value:new e.RTCIceCandidate(t.candidate),writable:"false"}),t))}function ge(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=ve.a.splitSections(e.sdp);return t.shift(),t.some(e=>{const t=ve.a.parseMLine(e);return t&&"application"===t.kind&&-1!==t.protocol.indexOf("SCTP")})},r=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},o=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},i=function(e,n){let r=65536;"firefox"===t.browser&&57===t.version&&(r=65535);const o=ve.a.matchPrefix(e.sdp,"a=max-message-size:");return o.length>0?r=parseInt(o[0].substr(19),10):"firefox"===t.browser&&-1!==n&&(r=2147483637),r},a=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=r(arguments[0]),t=o(e),n=i(arguments[0],e);let a;a=0===t&&0===n?Number.POSITIVE_INFINITY:0===t||0===n?Math.max(t,n):Math.min(t,n);const c={};Object.defineProperty(c,"maxMessageSize",{get:()=>a}),this._sctp=c}return a.apply(this,arguments)}}function ye(e){if(!e.RTCPeerConnection||!("createDataChannel"in e.RTCPeerConnection.prototype))return;function t(e,t){const n=e.send;e.send=function(){const r=arguments[0],o=r.length||r.size||r.byteLength;if("open"===e.readyState&&t.sctp&&o>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},x(e,"datachannel",e=>(t(e.channel,e.target),e))}function be(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 _e(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 xe(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())})}!function({window:e}={},t={shimChrome:!0,shimFirefox:!0,shimEdge:!0,shimSafari:!0}){const n=w,s=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=_(n.userAgent,/Firefox\/(\d+)\./,1);else if(n.webkitGetUserMedia||!1===e.isSecureContext&&e.webkitRTCPeerConnection&&!e.RTCIceGatherer)t.browser="chrome",t.version=_(n.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(n.mediaDevices&&n.userAgent.match(/Edge\/(\d+).(\d+)$/))t.browser="edge",t.version=_(n.userAgent,/Edge\/(\d+).(\d+)$/,2);else{if(!e.RTCPeerConnection||!n.userAgent.match(/AppleWebKit\/(\d+)\./))return t.browser="Not a supported browser.",t;t.browser="safari",t.version=_(n.userAgent,/AppleWebKit\/(\d+)\./,1),t.supportsUnifiedPlan=e.RTCRtpTransceiver&&"currentDirection"in e.RTCRtpTransceiver.prototype}return t}(e),u={browserDetails:s,commonShim:c,extractVersion:_,disableLog:C,disableWarnings:S};switch(s.browser){case"chrome":if(!r||!F||!t.shimChrome)return n("Chrome shim is not included in this adapter release."),u;if(null===s.version)return n("Chrome shim can not determine version, not shimming."),u;n("adapter.js shimming chrome."),u.browserShim=r,xe(e,s),k(e,s),M(e),F(e,s),A(e),z(e,s),j(e),I(e),L(e),U(e,s),me(e),be(e),ge(e,s),ye(e),_e(e,s);break;case"firefox":if(!i||!Y||!t.shimFirefox)return n("Firefox shim is not included in this adapter release."),u;n("adapter.js shimming firefox."),u.browserShim=i,xe(e,s),X(e,s),Y(e,s),$(e),Z(e),Q(e),K(e),ee(e),te(e),ne(e),re(e),oe(e),me(e),be(e),ge(e,s),ye(e);break;case"edge":if(!o||!q||!t.shimEdge)return n("MS edge shim is not included in this adapter release."),u;n("adapter.js shimming edge."),u.browserShim=o,W(e),V(e),q(e,s),J(e),ge(e,s),ye(e);break;case"safari":if(!a||!t.shimSafari)return n("Safari shim is not included in this adapter release."),u;n("adapter.js shimming safari."),u.browserShim=a,xe(e,s),fe(e),de(e),ce(e),ie(e),ae(e),le(e),se(e),pe(e),me(e),ge(e,s),ye(e),_e(e,s);break;default:n("Unsupported browser!")}}({window:"undefined"==typeof window?void 0:window});var Ce=n("viyd"),Se=n.n(Ce);function we(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Re(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?we(Object(n),!0).forEach((function(t){Te(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):we(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Te(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ee(e,t,n,r,o,i,a){try{var c=e[i](a),s=c.value}catch(e){return void n(e)}c.done?t(s):Promise.resolve(s).then(r,o)}function Pe(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Ee(i,r,o,a,c,"next",e)}function c(e){Ee(i,r,o,a,c,"throw",e)}a(void 0)}))}}function Oe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var ke=function(){function e(t,n,r){var o=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.root=t,this.successCallback=n;var i={settingsChangedCallback:null,errorCallback:null,viewport:t.querySelector(".zettle-barcode-scanner-viewport"),barcodeTypeSelect:t.querySelector('select[name="barcode_type"]'),cameraSelect:t.querySelector('select[name="camera"]'),streamSettings:{constraints:{width:640,height:480}}};this.options=p(i,r,!0),this.started=!1,this.lastSettings=null,t.querySelectorAll("select").forEach((function(e){e.addEventListener("change",(function(){var e=o.getSettings();o.options.settingsChangedCallback&&o.options.settingsChangedCallback(e,o),o.lastSettings=e,o.started&&o.restart()}))}))}var t,n,r,o;return t=e,(n=[{key:"start",value:function(){var e=this;Se.a.init(this._getQuaggaConfig(this.getSettings()),function(){var t=Pe(regeneratorRuntime.mark((function t(n){var r,o,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!n){t.next=5;break}return console.log(n),e.options.errorCallback&&e.options.errorCallback(n,e),e.stop(),t.abrupt("return");case 5:return t.next=7,e._fillCameraSelect(e.options.cameraSelect);case 7:(i=null===(r=Se.a.CameraAccess.getActiveTrack())||void 0===r||null===(o=r.getSettings())||void 0===o?void 0:o.deviceId)&&(e.options.cameraSelect.value=i),Se.a.start(),Se.a.onDetected((function(t){e.started&&e.successCallback(t.codeResult.code,e)})),e.started=!0;case 12:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}},{key:"stop",value:function(){Se.a.offDetected(),Se.a.stop(),this.started=!1}},{key:"restart",value:function(){this.stop(),this.start()}},{key:"getSettings",value:function(){return{barcodeType:this.options.barcodeTypeSelect.value,cameraDeviceId:this.options.cameraSelect.value}}},{key:"updateSettingsUi",value:function(e){e.barcodeType&&(this.options.barcodeTypeSelect.value=e.barcodeType),this.lastSettings=e}},{key:"_getQuaggaConfig",value:function(e){var t,n=e.barcodeType.split(",").map(this._getQuaggaReader);return{inputStream:{name:"Live",type:"LiveStream",target:this.options.viewport,constraints:Re(Re({},this.options.streamSettings.constraints),null!==(t=this.lastSettings)&&void 0!==t&&t.cameraDeviceId?{deviceId:this.lastSettings.cameraDeviceId}:{})},decoder:{readers:n}}}},{key:"_getQuaggaReader",value:function(e){return"ean_extended"===e?{format:"ean_reader",config:{supplements:["ean_5_reader","ean_2_reader"]}}:{format:"".concat(e,"_reader"),config:{}}}},{key:"_fillCameraSelect",value:(o=Pe(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.length=0,e.next=3,Se.a.CameraAccess.enumerateVideoDevices();case 3:e.sent.forEach((function(e){var n=document.createElement("option");n.value=e.deviceId,n.appendChild(document.createTextNode(e.label)),t.appendChild(n)}));case 5:case"end":return e.stop()}}),e)}))),function(e){return o.apply(this,arguments)})}])&&Oe(t.prototype,n),r&&Oe(t,r),e}(),De=n("je13"),Me=n.n(De),Ae=document.querySelector("#woocommerce-product-data"),je=document.querySelector(".woocommerce_variations");if(je){if(!zettleProductEditorNotice||!zettleProductEditorValidator)throw new Error("Nothing found to validate.");new d(new f(Ae,{level:zettleProductEditorNotice.level,message:zettleProductEditorNotice.message}),new g,je,{productId:zettleProductEditorValidator.productId,productIsValid:zettleProductEditorValidator.productIsValid,listening:!0,observableProperties:["data-total"]})}var Ie=[],Le=function(e){if(!e.getAttribute("data-initialized")){var t=e.parentElement.querySelector(".zettle-barcode-input-field"),n=t.querySelector("input"),r=new ke(e,(function(t,r){n.value=t,r.stop(),e.style.display="none"}),{errorCallback:function(t){alert(zettleBarcodeScanning.initErrorMessage),e.style.display="none"},settingsChangedCallback:function(e){Me.a.set("zettleBarcodeScanningSettings",e)}});Ie.push(r),t.querySelector("button").addEventListener("click",(function(){var t="block"===e.style.display;if(document.querySelectorAll(".zettle-barcode-scan").forEach((function(e){e.style.display="none"})),Ie.forEach((function(e){return e.stop()})),!t){var n=Me.a.get("zettleBarcodeScanningSettings");n&&r.updateSettingsUi(n),e.style.display="block",r.start()}})),e.setAttribute("data-initialized","true")}};if(je){var Ne=new g;Ne.init((function(e){document.querySelectorAll(".zettle-barcode-scan").forEach(Le)}),je,{observe:!0,observableProperties:["data-total"]}),Ne.observe()}else Le(document.querySelector(".zettle-barcode-scan"))},yLpj: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},ynwM:function(e,t,n){var r=n("MFOe").Global;e.exports={name:"oldFF-globalStorage",read:function(e){return o[e]},write:function(e,t){o[e]=t},each:i,remove:function(e){return o.removeItem(e)},clearAll:function(){i((function(e,t){delete o[e]}))}};var o=r.globalStorage;function i(e){for(var t=o.length-1;t>=0;t--){var n=o.key(t);e(o[n],n)}}}});
     3/* @preserve ASM END */t.a=function(e,t,n){"use asm";var r=new e.Uint8Array(n),o=t.size|0,i=e.Math.imul;function a(e,t){e|=0;t|=0;var n=0;var i=0;var a=0;var c=0;var s=0;var u=0;var f=0;var l=0;for(n=1;(n|0)<(o-1|0);n=n+1|0){l=l+o|0;for(i=1;(i|0)<(o-1|0);i=i+1|0){c=l-o|0;s=l+o|0;u=i-1|0;f=i+1|0;a=(r[e+c+u|0]|0)+(r[e+c+f|0]|0)+(r[e+l+i|0]|0)+(r[e+s+u|0]|0)+(r[e+s+f|0]|0)|0;if((a|0)==(5|0)){r[t+l+i|0]=1}else{r[t+l+i|0]=0}}}}function c(e,t,n){e|=0;t|=0;n|=0;var a=0;a=i(o,o)|0;while((a|0)>0){a=a-1|0;r[n+a|0]=(r[e+a|0]|0)-(r[t+a|0]|0)|0}}function s(e,t,n){e|=0;t|=0;n|=0;var a=0;a=i(o,o)|0;while((a|0)>0){a=a-1|0;r[n+a|0]=r[e+a|0]|0|(r[t+a|0]|0)|0}}function u(e){e|=0;var t=0;var n=0;n=i(o,o)|0;while((n|0)>0){n=n-1|0;t=(t|0)+(r[e+n|0]|0)|0}return t|0}function f(e,t){e|=0;t|=0;var n=0;n=i(o,o)|0;while((n|0)>0){n=n-1|0;r[e+n|0]=t}}function l(e,t){e|=0;t|=0;var n=0;var i=0;var a=0;var c=0;var s=0;var u=0;var f=0;var l=0;for(n=1;(n|0)<(o-1|0);n=n+1|0){l=l+o|0;for(i=1;(i|0)<(o-1|0);i=i+1|0){c=l-o|0;s=l+o|0;u=i-1|0;f=i+1|0;a=(r[e+c+u|0]|0)+(r[e+c+f|0]|0)+(r[e+l+i|0]|0)+(r[e+s+u|0]|0)+(r[e+s+f|0]|0)|0;if((a|0)>(0|0)){r[t+l+i|0]=1}else{r[t+l+i|0]=0}}}}function d(e,t){e|=0;t|=0;var n=0;n=i(o,o)|0;while((n|0)>0){n=n-1|0;r[t+n|0]=r[e+n|0]|0}}function p(e){e|=0;var t=0;var n=0;for(t=0;(t|0)<(o-1|0);t=t+1|0){r[e+t|0]=0;r[e+n|0]=0;n=n+o-1|0;r[e+n|0]=0;n=n+1|0}for(t=0;(t|0)<(o|0);t=t+1|0){r[e+n|0]=0;n=n+1|0}}function h(){var e=0;var t=0;var n=0;var r=0;var h=0;var v=0;t=i(o,o)|0;n=t+t|0;r=n+t|0;f(r,0);p(e);do{a(e,t);l(t,n);c(e,n,n);s(r,n,r);d(t,e);h=u(e)|0;v=(h|0)==0|0}while(!v)}return{skeletonize:h}}},function(e,t,n){e.exports=n(259)},function(e,t,n){var r=n(89),o=n(47),i=n(119),a=n(121),c=n(13),s=n(55),u=n(53);e.exports=function e(t,n,f,l,d){t!==n&&i(n,(function(i,s){if(d||(d=new r),c(i))a(t,n,s,f,e,l,d);else{var p=l?l(u(t,s),i,s+"",t,n,d):void 0;void 0===p&&(p=i),o(t,s,p)}}),s)}},function(e,t,n){var r=n(24),o=n(95),i=n(96),a=n(97),c=n(98),s=n(99);function u(e){var t=this.__data__=new r(e);this.size=t.size}u.prototype.clear=o,u.prototype.delete=i,u.prototype.get=a,u.prototype.has=c,u.prototype.set=s,e.exports=u},function(e,t){e.exports=function(){this.__data__=[],this.size=0}},function(e,t,n){var r=n(25),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0||(n==t.length-1?t.pop():o.call(t,n,1),--this.size,0))}},function(e,t,n){var r=n(25);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},function(e,t,n){var r=n(25);e.exports=function(e){return r(this.__data__,e)>-1}},function(e,t,n){var r=n(25);e.exports=function(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}},function(e,t,n){var r=n(24);e.exports=function(){this.__data__=new r,this.size=0}},function(e,t){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},function(e,t){e.exports=function(e){return this.__data__.get(e)}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t,n){var r=n(24),o=n(43),i=n(46);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!o||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new i(a)}return n.set(e,t),this.size=n.size,this}},function(e,t,n){var r=n(36),o=n(103),i=n(13),a=n(105),c=/^\[object .+?Constructor\]$/,s=Function.prototype,u=Object.prototype,f=s.toString,l=u.hasOwnProperty,d=RegExp("^"+f.call(l).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!i(e)||o(e))&&(r(e)?d:c).test(a(e))}},function(e,t,n){var r=n(27),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,c=r?r.toStringTag:void 0;e.exports=function(e){var t=i.call(e,c),n=e[c];try{e[c]=void 0;var r=!0}catch(e){}var o=a.call(e);return r&&(t?e[c]=n:delete e[c]),o}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},function(e,t,n){var r,o=n(104),i=(r=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!i&&i in e}},function(e,t,n){var r=n(17)["__core-js_shared__"];e.exports=r},function(e,t){var n=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return n.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},function(e,t){e.exports=function(e,t){return null==e?void 0:e[t]}},function(e,t,n){var r=n(108),o=n(24),i=n(43);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(i||o),string:new r}}},function(e,t,n){var r=n(109),o=n(110),i=n(111),a=n(112),c=n(113);function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=r,s.prototype.delete=o,s.prototype.get=i,s.prototype.has=a,s.prototype.set=c,e.exports=s},function(e,t,n){var r=n(28);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},function(e,t){e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},function(e,t,n){var r=n(28),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return o.call(t,e)?t[e]:void 0}},function(e,t,n){var r=n(28),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:o.call(t,e)}},function(e,t,n){var r=n(28);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},function(e,t,n){var r=n(29);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},function(e,t){e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},function(e,t,n){var r=n(29);e.exports=function(e){return r(this,e).get(e)}},function(e,t,n){var r=n(29);e.exports=function(e){return r(this,e).has(e)}},function(e,t,n){var r=n(29);e.exports=function(e,t){var n=r(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}},function(e,t,n){var r=n(120)();e.exports=r},function(e,t){e.exports=function(e){return function(t,n,r){for(var o=-1,i=Object(t),a=r(t),c=a.length;c--;){var s=a[e?c:++o];if(!1===n(i[s],s,i))break}return t}}},function(e,t,n){var r=n(47),o=n(122),i=n(123),a=n(126),c=n(127),s=n(30),u=n(14),f=n(131),l=n(51),d=n(36),p=n(13),h=n(133),v=n(52),m=n(53),g=n(137);e.exports=function(e,t,n,y,b,_,x){var C=m(e,n),S=m(t,n),R=x.get(S);if(R)r(e,n,R);else{var w=_?_(C,S,n+"",e,t,x):void 0,T=void 0===w;if(T){var E=u(S),P=!E&&l(S),O=!E&&!P&&v(S);w=S,E||P||O?u(C)?w=C:f(C)?w=a(C):P?(T=!1,w=o(S,!0)):O?(T=!1,w=i(S,!0)):w=[]:h(S)||s(S)?(w=C,s(C)?w=g(C):p(C)&&!d(C)||(w=c(S))):T=!1}T&&(x.set(S,w),b(w,S,y,_,x),x.delete(S)),r(e,n,w)}}},function(e,t,n){(function(e){var r=n(17),o=t&&!t.nodeType&&t,i=o&&"object"==typeof e&&e&&!e.nodeType&&e,a=i&&i.exports===o?r.Buffer:void 0,c=a?a.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=c?c(n):new e.constructor(n);return e.copy(r),r}}).call(this,n(38)(e))},function(e,t,n){var r=n(124);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},function(e,t,n){var r=n(125);e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},function(e,t,n){var r=n(17).Uint8Array;e.exports=r},function(e,t){e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}},function(e,t,n){var r=n(128),o=n(49),i=n(50);e.exports=function(e){return"function"!=typeof e.constructor||i(e)?{}:r(o(e))}},function(e,t,n){var r=n(13),o=Object.create,i=function(){function e(){}return function(t){if(!r(t))return{};if(o)return o(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=i},function(e,t){e.exports=function(e,t){return function(n){return e(t(n))}}},function(e,t,n){var r=n(22),o=n(18);e.exports=function(e){return o(e)&&"[object Arguments]"==r(e)}},function(e,t,n){var r=n(39),o=n(18);e.exports=function(e){return o(e)&&r(e)}},function(e,t){e.exports=function(){return!1}},function(e,t,n){var r=n(22),o=n(49),i=n(18),a=Function.prototype,c=Object.prototype,s=a.toString,u=c.hasOwnProperty,f=s.call(Object);e.exports=function(e){if(!i(e)||"[object Object]"!=r(e))return!1;var t=o(e);if(null===t)return!0;var n=u.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&s.call(n)==f}},function(e,t,n){var r=n(22),o=n(40),i=n(18),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,e.exports=function(e){return i(e)&&o(e.length)&&!!a[r(e)]}},function(e,t){e.exports=function(e){return function(t){return e(t)}}},function(e,t,n){(function(e){var r=n(44),o=t&&!t.nodeType&&t,i=o&&"object"==typeof e&&e&&!e.nodeType&&e,a=i&&i.exports===o&&r.process,c=function(){try{return i&&i.require&&i.require("util").types||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=c}).call(this,n(38)(e))},function(e,t,n){var r=n(138),o=n(55);e.exports=function(e){return r(e,o(e))}},function(e,t,n){var r=n(54),o=n(37);e.exports=function(e,t,n,i){var a=!n;n||(n={});for(var c=-1,s=t.length;++c<s;){var u=t[c],f=i?i(n[u],e[u],u,n,e):void 0;void 0===f&&(f=e[u]),a?o(n,u,f):r(n,u,f)}return n}},function(e,t,n){var r=n(140),o=n(30),i=n(14),a=n(51),c=n(31),s=n(52),u=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=i(e),f=!n&&o(e),l=!n&&!f&&a(e),d=!n&&!f&&!l&&s(e),p=n||f||l||d,h=p?r(e.length,String):[],v=h.length;for(var m in e)!t&&!u.call(e,m)||p&&("length"==m||l&&("offset"==m||"parent"==m)||d&&("buffer"==m||"byteLength"==m||"byteOffset"==m)||c(m,v))||h.push(m);return h}},function(e,t){e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},function(e,t,n){var r=n(13),o=n(50),i=n(142),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=o(e),n=[];for(var c in e)("constructor"!=c||!t&&a.call(e,c))&&n.push(c);return n}},function(e,t){e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},function(e,t,n){var r=n(144),o=n(149);e.exports=function(e){return r((function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,c=i>2?n[2]:void 0;for(a=e.length>3&&"function"==typeof a?(i--,a):void 0,c&&o(n[0],n[1],c)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,a)}return t}))}},function(e,t,n){var r=n(56),o=n(57),i=n(58);e.exports=function(e,t){return i(o(e,t,r),e+"")}},function(e,t){e.exports=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}},function(e,t,n){var r=n(147),o=n(48),i=n(56),a=o?function(e,t){return o(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:i;e.exports=a},function(e,t){e.exports=function(e){return function(){return e}}},function(e,t){var n=Date.now;e.exports=function(e){var t=0,r=0;return function(){var o=n(),i=16-(o-r);if(r=o,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}},function(e,t,n){var r=n(26),o=n(39),i=n(31),a=n(13);e.exports=function(e,t,n){if(!a(n))return!1;var c=typeof t;return!!("number"==c?o(n)&&i(t,n.length):"string"==c&&t in n)&&r(n[t],e)}},function(e,t){"undefined"!=typeof window&&(window.requestAnimationFrame||(window.requestAnimationFrame=window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)})),"function"!=typeof Math.imul&&(Math.imul=function(e,t){var n=65535&e,r=65535&t;return n*r+((e>>>16&65535)*r+n*(t>>>16&65535)<<16>>>0)|0}),"function"!=typeof Object.assign&&(Object.assign=function(e){"use strict";if(null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(null!==r)for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t})},function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(e,t){e.exports=function(e){var t=new Float32Array(2);return t[0]=e[0],t[1]=e[1],t}},function(e,t){e.exports=function(e,t){var n=new Float32Array(2);return n[0]=e,n[1]=t,n}},function(e,t){e.exports=function(e,t){return e[0]=t[0],e[1]=t[1],e}},function(e,t){e.exports=function(e,t,n){return e[0]=t,e[1]=n,e}},function(e,t,n){e.exports=function(e,t){var n=e[0],o=e[1],i=t[0],a=t[1];return Math.abs(n-i)<=r*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(o-a)<=r*Math.max(1,Math.abs(o),Math.abs(a))};var r=n(61)},function(e,t){e.exports=function(e,t){return e[0]===t[0]&&e[1]===t[1]}},function(e,t){e.exports=function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}},function(e,t,n){e.exports=n(63)},function(e,t,n){e.exports=n(64)},function(e,t,n){e.exports=n(65)},function(e,t){e.exports=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}},function(e,t){e.exports=function(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}},function(e,t){e.exports=function(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}},function(e,t){e.exports=function(e,t,n){var r=Math.cos(n),o=Math.sin(n),i=t[0],a=t[1];return e[0]=i*r-a*o,e[1]=i*o+a*r,e}},function(e,t){e.exports=function(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e}},function(e,t){e.exports=function(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e}},function(e,t){e.exports=function(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e}},function(e,t){e.exports=function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}},function(e,t){e.exports=function(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e}},function(e,t,n){e.exports=n(66)},function(e,t,n){e.exports=n(67)},function(e,t,n){e.exports=n(68)},function(e,t,n){e.exports=n(69)},function(e,t){e.exports=function(e,t){return e[0]=-t[0],e[1]=-t[1],e}},function(e,t){e.exports=function(e,t){var n=t[0],r=t[1],o=n*n+r*r;return o>0&&(o=1/Math.sqrt(o),e[0]=t[0]*o,e[1]=t[1]*o),e}},function(e,t){e.exports=function(e,t){return e[0]*t[0]+e[1]*t[1]}},function(e,t){e.exports=function(e,t,n){var r=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=r,e}},function(e,t){e.exports=function(e,t,n,r){var o=t[0],i=t[1];return e[0]=o+r*(n[0]-o),e[1]=i+r*(n[1]-i),e}},function(e,t){e.exports=function(e,t){t=t||1;var n=2*Math.random()*Math.PI;return e[0]=Math.cos(n)*t,e[1]=Math.sin(n)*t,e}},function(e,t){e.exports=function(e,t,n){var r=t[0],o=t[1];return e[0]=n[0]*r+n[2]*o,e[1]=n[1]*r+n[3]*o,e}},function(e,t){e.exports=function(e,t,n){var r=t[0],o=t[1];return e[0]=n[0]*r+n[2]*o+n[4],e[1]=n[1]*r+n[3]*o+n[5],e}},function(e,t){e.exports=function(e,t,n){var r=t[0],o=t[1];return e[0]=n[0]*r+n[3]*o+n[6],e[1]=n[1]*r+n[4]*o+n[7],e}},function(e,t){e.exports=function(e,t,n){var r=t[0],o=t[1];return e[0]=n[0]*r+n[4]*o+n[12],e[1]=n[1]*r+n[5]*o+n[13],e}},function(e,t,n){e.exports=function(e,t,n,o,i,a){var c,s;for(t||(t=2),n||(n=0),s=o?Math.min(o*t+n,e.length):e.length,c=n;c<s;c+=t)r[0]=e[c],r[1]=e[c+1],i(r,r,a),e[c]=r[0],e[c+1]=r[1];return e};var r=n(62)()},function(e,t){e.exports=function(e,t,n){var r=t[0]*t[0]+t[1]*t[1];if(r>n*n){var o=Math.sqrt(r);e[0]=t[0]/o*n,e[1]=t[1]/o*n}else e[0]=t[0],e[1]=t[1];return e}},function(e,t){e.exports=function(e){var t=new Float32Array(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}},function(e,t,n){e.exports=function(e,t){var n=r(e[0],e[1],e[2]),a=r(t[0],t[1],t[2]);o(n,n),o(a,a);var c=i(n,a);return c>1?0:Math.acos(c)};var r=n(72),o=n(73),i=n(74)},function(e,t){e.exports=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}},function(e,t){e.exports=function(e,t,n,r){return e[0]=t,e[1]=n,e[2]=r,e}},function(e,t,n){e.exports=function(e,t){var n=e[0],o=e[1],i=e[2],a=t[0],c=t[1],s=t[2];return Math.abs(n-a)<=r*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(o-c)<=r*Math.max(1,Math.abs(o),Math.abs(c))&&Math.abs(i-s)<=r*Math.max(1,Math.abs(i),Math.abs(s))};var r=n(70)},function(e,t){e.exports=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}},function(e,t){e.exports=function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}},function(e,t,n){e.exports=n(75)},function(e,t,n){e.exports=n(76)},function(e,t,n){e.exports=n(77)},function(e,t){e.exports=function(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}},function(e,t){e.exports=function(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}},function(e,t){e.exports=function(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}},function(e,t){e.exports=function(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}},function(e,t){e.exports=function(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e}},function(e,t){e.exports=function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}},function(e,t){e.exports=function(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e[2]=t[2]+n[2]*r,e}},function(e,t,n){e.exports=n(78)},function(e,t,n){e.exports=n(79)},function(e,t,n){e.exports=n(80)},function(e,t,n){e.exports=n(81)},function(e,t){e.exports=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}},function(e,t){e.exports=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}},function(e,t){e.exports=function(e,t,n){var r=t[0],o=t[1],i=t[2],a=n[0],c=n[1],s=n[2];return e[0]=o*s-i*c,e[1]=i*a-r*s,e[2]=r*c-o*a,e}},function(e,t){e.exports=function(e,t,n,r){var o=t[0],i=t[1],a=t[2];return e[0]=o+r*(n[0]-o),e[1]=i+r*(n[1]-i),e[2]=a+r*(n[2]-a),e}},function(e,t){e.exports=function(e,t){t=t||1;var n=2*Math.random()*Math.PI,r=2*Math.random()-1,o=Math.sqrt(1-r*r)*t;return e[0]=Math.cos(n)*o,e[1]=Math.sin(n)*o,e[2]=r*t,e}},function(e,t){e.exports=function(e,t,n){var r=t[0],o=t[1],i=t[2],a=n[3]*r+n[7]*o+n[11]*i+n[15];return a=a||1,e[0]=(n[0]*r+n[4]*o+n[8]*i+n[12])/a,e[1]=(n[1]*r+n[5]*o+n[9]*i+n[13])/a,e[2]=(n[2]*r+n[6]*o+n[10]*i+n[14])/a,e}},function(e,t){e.exports=function(e,t,n){var r=t[0],o=t[1],i=t[2];return e[0]=r*n[0]+o*n[3]+i*n[6],e[1]=r*n[1]+o*n[4]+i*n[7],e[2]=r*n[2]+o*n[5]+i*n[8],e}},function(e,t){e.exports=function(e,t,n){var r=t[0],o=t[1],i=t[2],a=n[0],c=n[1],s=n[2],u=n[3],f=u*r+c*i-s*o,l=u*o+s*r-a*i,d=u*i+a*o-c*r,p=-a*r-c*o-s*i;return e[0]=f*u+p*-a+l*-s-d*-c,e[1]=l*u+p*-c+d*-a-f*-s,e[2]=d*u+p*-s+f*-c-l*-a,e}},function(e,t){e.exports=function(e,t,n,r){var o=n[1],i=n[2],a=t[1]-o,c=t[2]-i,s=Math.sin(r),u=Math.cos(r);return e[0]=t[0],e[1]=o+a*u-c*s,e[2]=i+a*s+c*u,e}},function(e,t){e.exports=function(e,t,n,r){var o=n[0],i=n[2],a=t[0]-o,c=t[2]-i,s=Math.sin(r),u=Math.cos(r);return e[0]=o+c*s+a*u,e[1]=t[1],e[2]=i+c*u-a*s,e}},function(e,t){e.exports=function(e,t,n,r){var o=n[0],i=n[1],a=t[0]-o,c=t[1]-i,s=Math.sin(r),u=Math.cos(r);return e[0]=o+a*u-c*s,e[1]=i+a*s+c*u,e[2]=t[2],e}},function(e,t,n){e.exports=function(e,t,n,o,i,a){var c,s;for(t||(t=3),n||(n=0),s=o?Math.min(o*t+n,e.length):e.length,c=n;c<s;c+=t)r[0]=e[c],r[1]=e[c+1],r[2]=e[c+2],i(r,r,a),e[c]=r[0],e[c+1]=r[1],e[c+2]=r[2];return e};var r=n(71)()},function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(t,r)}e.exports=n},function(e,t,n){var r=n(60);e.exports=function(e){if(Array.isArray(e))return r(e)}},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(e,t,n){var r=n(2);e.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=r(e)););return e}},function(e,t,n){var r=function(e){"use strict";var t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function c(e,t,n,r){var o=t&&t.prototype instanceof f?t:f,i=Object.create(o.prototype),a=new C(r||[]);return i._invoke=function(e,t,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=b(a,n);if(c){if(c===u)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var f=s(e,t,n);if("normal"===f.type){if(r=n.done?"completed":"suspendedYield",f.arg===u)continue;return{value:f.arg,done:n.done}}"throw"===f.type&&(r="completed",n.method="throw",n.arg=f.arg)}}}(e,n,a),i}function s(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var u={};function f(){}function l(){}function d(){}var p={};p[o]=function(){return this};var h=Object.getPrototypeOf,v=h&&h(h(S([])));v&&v!==t&&n.call(v,o)&&(p=v);var m=d.prototype=f.prototype=Object.create(p);function g(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function y(e,t){var r;this._invoke=function(o,i){function a(){return new t((function(r,a){!function r(o,i,a,c){var u=s(e[o],e,i);if("throw"!==u.type){var f=u.arg,l=f.value;return l&&"object"==typeof l&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,a,c)}),(function(e){r("throw",e,a,c)})):t.resolve(l).then((function(e){f.value=e,a(f)}),(function(e){return r("throw",e,a,c)}))}c(u.arg)}(o,i,r,a)}))}return r=r?r.then(a,a):a()}}function b(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,b(e,t),"throw"===t.method))return u;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var r=s(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,u;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}function _(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(_,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:R}}function R(){return{value:void 0,done:!0}}return l.prototype=m.constructor=d,d.constructor=l,d[a]=l.displayName="GeneratorFunction",e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===l||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,a in e||(e[a]="GeneratorFunction")),e.prototype=Object.create(m),e},e.awrap=function(e){return{__await:e}},g(y.prototype),y.prototype[i]=function(){return this},e.AsyncIterator=y,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new y(c(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},g(m),m[a]="Generator",m[o]=function(){return this},m.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=S,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),s=n.call(i,"finallyLoc");if(c&&s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,u):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),u},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),x(n),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;x(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:S(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},e}(e.exports);try{regeneratorRuntime=r}catch(e){Function("r","regeneratorRuntime = r")(r)}},function(e,t,n){var r=n(229),o=n(239);e.exports=function(e,t){return r(e,t,(function(t,n){return o(e,n)}))}},function(e,t,n){var r=n(230),o=n(238),i=n(32);e.exports=function(e,t,n){for(var a=-1,c=t.length,s={};++a<c;){var u=t[a],f=r(e,u);n(f,u)&&o(s,i(u,e),f)}return s}},function(e,t,n){var r=n(32),o=n(42);e.exports=function(e,t){for(var n=0,i=(t=r(t,e)).length;null!=e&&n<i;)e=e[o(t[n++])];return n&&n==i?e:void 0}},function(e,t,n){var r=n(14),o=n(41),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!o(e))||a.test(e)||!i.test(e)||null!=t&&e in Object(t)}},function(e,t,n){var r=n(233),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,a=r((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(o,(function(e,n,r,o){t.push(r?o.replace(i,"$1"):n||e)})),t}));e.exports=a},function(e,t,n){var r=n(234);e.exports=function(e){var t=r(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}},function(e,t,n){var r=n(46);function o(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(o.Cache||r),n}o.Cache=r,e.exports=o},function(e,t,n){var r=n(236);e.exports=function(e){return null==e?"":r(e)}},function(e,t,n){var r=n(27),o=n(237),i=n(14),a=n(41),c=r?r.prototype:void 0,s=c?c.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(i(t))return o(t,e)+"";if(a(t))return s?s.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}},function(e,t,n){var r=n(54),o=n(32),i=n(31),a=n(13),c=n(42);e.exports=function(e,t,n,s){if(!a(e))return e;for(var u=-1,f=(t=o(t,e)).length,l=f-1,d=e;null!=d&&++u<f;){var p=c(t[u]),h=n;if("__proto__"===p||"constructor"===p||"prototype"===p)return e;if(u!=l){var v=d[p];void 0===(h=s?s(v,p,d):void 0)&&(h=a(v)?v:i(t[u+1])?[]:{})}r(d,p,h),d=d[p]}return e}},function(e,t,n){var r=n(240),o=n(241);e.exports=function(e,t){return null!=e&&o(e,t,r)}},function(e,t){e.exports=function(e,t){return null!=e&&t in Object(e)}},function(e,t,n){var r=n(32),o=n(30),i=n(14),a=n(31),c=n(40),s=n(42);e.exports=function(e,t,n){for(var u=-1,f=(t=r(t,e)).length,l=!1;++u<f;){var d=s(t[u]);if(!(l=null!=e&&n(e,d)))break;e=e[d]}return l||++u!=f?l:!!(f=null==e?0:e.length)&&c(f)&&a(d,f)&&(i(e)||o(e))}},function(e,t,n){var r=n(243),o=n(57),i=n(58);e.exports=function(e){return i(o(e,void 0,r),e+"")}},function(e,t,n){var r=n(244);e.exports=function(e){return null!=e&&e.length?r(e,1):[]}},function(e,t,n){var r=n(245),o=n(246);e.exports=function e(t,n,i,a,c){var s=-1,u=t.length;for(i||(i=o),c||(c=[]);++s<u;){var f=t[s];n>0&&i(f)?n>1?e(f,n-1,i,a,c):r(c,f):a||(c[c.length]=f)}return c}},function(e,t){e.exports=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}},function(e,t,n){var r=n(27),o=n(30),i=n(14),a=r?r.isConcatSpreadable:void 0;e.exports=function(e){return i(e)||o(e)||!!(a&&e&&e[a])}},function(e,t){e.exports=function(e){return e[0]*e[3]-e[2]*e[1]}},function(e,t){e.exports=function(e,t){if(e===t){var n=t[1];e[1]=t[2],e[2]=n}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e}},function(e,t){e.exports=function(e,t,n){var r=t[0],o=t[1],i=t[2],a=t[3],c=n[0],s=n[1],u=n[2],f=n[3];return e[0]=r*c+i*s,e[1]=o*c+a*s,e[2]=r*u+i*f,e[3]=o*u+a*f,e}},function(e,t){e.exports=function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e}},function(e,t){e.exports=function(e,t){var n=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=n,e}},function(e,t){e.exports=function(e,t,n){var r=t[0],o=t[1],i=t[2],a=t[3],c=Math.sin(n),s=Math.cos(n);return e[0]=r*s+i*c,e[1]=o*s+a*c,e[2]=r*-c+i*s,e[3]=o*-c+a*s,e}},function(e,t){e.exports=function(e,t){var n=t[0],r=t[1],o=t[2],i=t[3],a=n*i-o*r;return a?(a=1/a,e[0]=i*a,e[1]=-r*a,e[2]=-o*a,e[3]=n*a,e):null}},function(e,t){e.exports=function(){var e=new Float32Array(4);return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e}},function(e,t){e.exports=function(e,t,n){var r=t[0],o=t[1],i=t[2],a=t[3],c=n[0],s=n[1];return e[0]=r*c,e[1]=o*c,e[2]=i*s,e[3]=a*s,e}},function(e,t){e.exports=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}},function(e,t){e.exports=function(e){return Math.sqrt(Math.pow(e[0],2)+Math.pow(e[1],2)+Math.pow(e[2],2)+Math.pow(e[3],2))}},function(e,t){e.exports=function(e,t,n,r){return e[2]=r[2]/r[0],n[0]=r[0],n[1]=r[1],n[3]=r[3]-e[2]*n[1],[e,t,n]}},function(e,t,n){"use strict";n.r(t),n.d(t,"BarcodeDecoder",(function(){return _e})),n.d(t,"Readers",(function(){return r})),n.d(t,"CameraAccess",(function(){return Fe})),n.d(t,"ImageDebug",(function(){return h.a})),n.d(t,"ImageWrapper",(function(){return s.a})),n.d(t,"ResultCollector",(function(){return Ue}));var r={};n.r(r),n.d(r,"BarcodeReader",(function(){return k})),n.d(r,"TwoOfFiveReader",(function(){return pe})),n.d(r,"NewCodabarReader",(function(){return Z})),n.d(r,"Code128Reader",(function(){return D})),n.d(r,"Code32Reader",(function(){return ye})),n.d(r,"Code39Reader",(function(){return V})),n.d(r,"Code39VINReader",(function(){return $})),n.d(r,"Code93Reader",(function(){return me})),n.d(r,"EAN2Reader",(function(){return ne})),n.d(r,"EAN5Reader",(function(){return oe})),n.d(r,"EAN8Reader",(function(){return te})),n.d(r,"EANReader",(function(){return F})),n.d(r,"I2of5Reader",(function(){return se})),n.d(r,"UPCEReader",(function(){return ce})),n.d(r,"UPCReader",(function(){return ee}));var o=n(19),i=n.n(o),a=n(16),c=n.n(a),s=(n(150),n(10)),u={},f=1,l=-1;u.getBarcodeLine=function(e,t,n){var r,o,i,a,c,s=0|t.x,u=0|t.y,f=0|n.x,l=0|n.y,d=Math.abs(l-u)>Math.abs(f-s),p=[],h=e.data,v=e.size.x,m=255,g=0;function y(e,t){c=h[t*v+e],m=c<m?c:m,g=c>g?c:g,p.push(c)}d&&(i=s,s=u,u=i,i=f,f=l,l=i),s>f&&(i=s,s=f,f=i,i=u,u=l,l=i);var b=f-s,_=Math.abs(l-u);r=b/2|0,o=u;var x=u<l?1:-1;for(a=s;a<f;a++)d?y(o,a):y(a,o),(r-=_)<0&&(o+=x,r+=b);return{line:p,min:m,max:g}},u.toBinaryLine=function(e){var t,n,r,o,i,a,c=e.min,s=e.max,u=e.line,d=c+(s-c)/2,p=[],h=(s-c)/12,v=-h;for(r=u[0]>d?f:l,p.push({pos:0,val:u[0]}),i=0;i<u.length-2;i++)r!==(o=(t=u[i+1]-u[i])+(n=u[i+2]-u[i+1])<v&&u[i+1]<1.5*d?l:t+n>h&&u[i+1]>.5*d?f:r)&&(p.push({pos:i,val:u[i]}),r=o);for(p.push({pos:u.length,val:u[u.length-1]}),a=p[0].pos;a<p[1].pos;a++)u[a]=u[a]>d?0:1;for(i=1;i<p.length-1;i++)for(h=p[i+1].val>p[i].val?p[i].val+(p[i+1].val-p[i].val)/3*2|0:p[i+1].val+(p[i].val-p[i+1].val)/3|0,a=p[i].pos;a<p[i+1].pos;a++)u[a]=u[a]>h?0:1;return{line:u,threshold:h}},u.debug={printFrequency:function(e,t){var n,r=t.getContext("2d");for(t.width=e.length,t.height=256,r.beginPath(),r.strokeStyle="blue",n=0;n<e.length;n++)r.moveTo(n,255),r.lineTo(n,255-e[n]);r.stroke(),r.closePath()},printPattern:function(e,t){var n,r=t.getContext("2d");for(t.width=e.length,r.fillColor="black",n=0;n<e.length;n++)1===e[n]&&r.fillRect(n,0,1,100)}};var d,p=u,h=n(15),v=n(3),m=n.n(v),g=n(4),y=n.n(g),b=n(1),_=n.n(b),x=n(6),C=n.n(x),S=n(5),R=n.n(S),w=n(2),T=n.n(w),E=n(0),P=n.n(E),O=n(8);!function(e){e[e.Forward=1]="Forward",e[e.Reverse=-1]="Reverse"}(d||(d={}));var k=function(){function e(t,n){return m()(this,e),P()(this,"_row",[]),P()(this,"config",{}),P()(this,"supplements",[]),P()(this,"SINGLE_CODE_ERROR",0),P()(this,"FORMAT","unknown"),P()(this,"CONFIG_KEYS",{}),this._row=[],this.config=t||{},n&&(this.supplements=n),this}return y()(e,[{key:"_nextUnset",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=t;n<e.length;n++)if(!e[n])return n;return e.length}},{key:"_matchPattern",value:function(e,t,n){var r,o=0,i=0,a=0,c=0,s=0,u=0;n=n||this.SINGLE_CODE_ERROR||1;for(var f=0;f<e.length;f++)a+=e[f],c+=t[f];if(a<c)return Number.MAX_VALUE;n*=r=a/c;for(var l=0;l<e.length;l++){if(s=e[l],u=t[l]*r,(i=Math.abs(s-u)/u)>n)return Number.MAX_VALUE;o+=i}return o/c}},{key:"_nextSet",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=t;n<e.length;n++)if(e[n])return n;return e.length}},{key:"_correctBars",value:function(e,t,n){for(var r=n.length,o=0;r--;)(o=e[n[r]]*(1-(1-t)/2))>1&&(e[n[r]]=o)}},{key:"decodePattern",value:function(e){this._row=e;var t=this.decode();return null===t?(this._row.reverse(),(t=this.decode())&&(t.direction=d.Reverse,t.start=this._row.length-t.start,t.end=this._row.length-t.end)):t.direction=d.Forward,t&&(t.format=this.FORMAT),t}},{key:"_matchRange",value:function(e,t,n){var r;for(r=e=e<0?0:e;r<t;r++)if(this._row[r]!==n)return!1;return!0}},{key:"_fillCounters",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._nextUnset(this._row),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._row.length,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=[],o=0;r[o]=0;for(var i=e;i<t;i++)this._row[i]^(n?1:0)?r[o]++:(r[++o]=1,n=!n);return r}},{key:"_toCounters",value:function(e,t){var n=t.length,r=this._row.length,o=!this._row[e],i=0;O.a.init(t,0);for(var a=e;a<r;a++)if(this._row[a]^(o?1:0))t[i]++;else{if(++i===n)break;t[i]=1,o=!o}return t}}],[{key:"Exception",get:function(){return{StartNotFoundException:"Start-Info was not found!",CodeNotFoundException:"Code could not be found!",PatternNotFoundException:"Pattern could not be found!"}}}]),e}(),D=function(e){C()(n,e);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=T()(e);if(t){var o=T()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return R()(this,n)}}(n);function n(){var e;m()(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),P()(_()(e),"CODE_SHIFT",98),P()(_()(e),"CODE_C",99),P()(_()(e),"CODE_B",100),P()(_()(e),"CODE_A",101),P()(_()(e),"START_CODE_A",103),P()(_()(e),"START_CODE_B",104),P()(_()(e),"START_CODE_C",105),P()(_()(e),"STOP_CODE",106),P()(_()(e),"CODE_PATTERN",[[2,1,2,2,2,2],[2,2,2,1,2,2],[2,2,2,2,2,1],[1,2,1,2,2,3],[1,2,1,3,2,2],[1,3,1,2,2,2],[1,2,2,2,1,3],[1,2,2,3,1,2],[1,3,2,2,1,2],[2,2,1,2,1,3],[2,2,1,3,1,2],[2,3,1,2,1,2],[1,1,2,2,3,2],[1,2,2,1,3,2],[1,2,2,2,3,1],[1,1,3,2,2,2],[1,2,3,1,2,2],[1,2,3,2,2,1],[2,2,3,2,1,1],[2,2,1,1,3,2],[2,2,1,2,3,1],[2,1,3,2,1,2],[2,2,3,1,1,2],[3,1,2,1,3,1],[3,1,1,2,2,2],[3,2,1,1,2,2],[3,2,1,2,2,1],[3,1,2,2,1,2],[3,2,2,1,1,2],[3,2,2,2,1,1],[2,1,2,1,2,3],[2,1,2,3,2,1],[2,3,2,1,2,1],[1,1,1,3,2,3],[1,3,1,1,2,3],[1,3,1,3,2,1],[1,1,2,3,1,3],[1,3,2,1,1,3],[1,3,2,3,1,1],[2,1,1,3,1,3],[2,3,1,1,1,3],[2,3,1,3,1,1],[1,1,2,1,3,3],[1,1,2,3,3,1],[1,3,2,1,3,1],[1,1,3,1,2,3],[1,1,3,3,2,1],[1,3,3,1,2,1],[3,1,3,1,2,1],[2,1,1,3,3,1],[2,3,1,1,3,1],[2,1,3,1,1,3],[2,1,3,3,1,1],[2,1,3,1,3,1],[3,1,1,1,2,3],[3,1,1,3,2,1],[3,3,1,1,2,1],[3,1,2,1,1,3],[3,1,2,3,1,1],[3,3,2,1,1,1],[3,1,4,1,1,1],[2,2,1,4,1,1],[4,3,1,1,1,1],[1,1,1,2,2,4],[1,1,1,4,2,2],[1,2,1,1,2,4],[1,2,1,4,2,1],[1,4,1,1,2,2],[1,4,1,2,2,1],[1,1,2,2,1,4],[1,1,2,4,1,2],[1,2,2,1,1,4],[1,2,2,4,1,1],[1,4,2,1,1,2],[1,4,2,2,1,1],[2,4,1,2,1,1],[2,2,1,1,1,4],[4,1,3,1,1,1],[2,4,1,1,1,2],[1,3,4,1,1,1],[1,1,1,2,4,2],[1,2,1,1,4,2],[1,2,1,2,4,1],[1,1,4,2,1,2],[1,2,4,1,1,2],[1,2,4,2,1,1],[4,1,1,2,1,2],[4,2,1,1,1,2],[4,2,1,2,1,1],[2,1,2,1,4,1],[2,1,4,1,2,1],[4,1,2,1,2,1],[1,1,1,1,4,3],[1,1,1,3,4,1],[1,3,1,1,4,1],[1,1,4,1,1,3],[1,1,4,3,1,1],[4,1,1,1,1,3],[4,1,1,3,1,1],[1,1,3,1,4,1],[1,1,4,1,3,1],[3,1,1,1,4,1],[4,1,1,1,3,1],[2,1,1,4,1,2],[2,1,1,2,1,4],[2,1,1,2,3,2],[2,3,3,1,1,1,2]]),P()(_()(e),"SINGLE_CODE_ERROR",.64),P()(_()(e),"AVG_CODE_ERROR",.3),P()(_()(e),"FORMAT","code_128"),P()(_()(e),"MODULE_INDICES",{bar:[0,2,4],space:[1,3,5]}),e}return y()(n,[{key:"_decodeCode",value:function(e,t){for(var n={error:Number.MAX_VALUE,code:-1,start:e,end:e,correction:{bar:1,space:1}},r=[0,0,0,0,0,0],o=e,i=!this._row[o],a=0,c=o;c<this._row.length;c++)if(this._row[c]^(i?1:0))r[a]++;else{if(a===r.length-1){t&&this._correct(r,t);for(var s=0;s<this.CODE_PATTERN.length;s++){var u=this._matchPattern(r,this.CODE_PATTERN[s]);u<n.error&&(n.code=s,n.error=u)}return n.end=c,-1===n.code||n.error>this.AVG_CODE_ERROR?null:(this.CODE_PATTERN[n.code]&&(n.correction.bar=this.calculateCorrection(this.CODE_PATTERN[n.code],r,this.MODULE_INDICES.bar),n.correction.space=this.calculateCorrection(this.CODE_PATTERN[n.code],r,this.MODULE_INDICES.space)),n)}r[++a]=1,i=!i}return null}},{key:"_correct",value:function(e,t){this._correctBars(e,t.bar,this.MODULE_INDICES.bar),this._correctBars(e,t.space,this.MODULE_INDICES.space)}},{key:"_findStart",value:function(){for(var e=[0,0,0,0,0,0],t=this._nextSet(this._row),n={error:Number.MAX_VALUE,code:-1,start:0,end:0,correction:{bar:1,space:1}},r=!1,o=0,i=t;i<this._row.length;i++)if(this._row[i]^(r?1:0))e[o]++;else{if(o===e.length-1){for(var a=e.reduce((function(e,t){return e+t}),0),c=this.START_CODE_A;c<=this.START_CODE_C;c++){var s=this._matchPattern(e,this.CODE_PATTERN[c]);s<n.error&&(n.code=c,n.error=s)}if(n.error<this.AVG_CODE_ERROR)return n.start=i-a,n.end=i,n.correction.bar=this.calculateCorrection(this.CODE_PATTERN[n.code],e,this.MODULE_INDICES.bar),n.correction.space=this.calculateCorrection(this.CODE_PATTERN[n.code],e,this.MODULE_INDICES.space),n;for(var u=0;u<4;u++)e[u]=e[u+2];e[4]=0,e[5]=0,o--}else o++;e[o]=1,r=!r}return null}},{key:"decode",value:function(e,t){var n=this,r=this._findStart();if(null===r)return null;var o={code:r.code,start:r.start,end:r.end,correction:{bar:r.correction.bar,space:r.correction.space}},i=[];i.push(o);for(var a=o.code,c=function(e){switch(e){case n.START_CODE_A:return n.CODE_A;case n.START_CODE_B:return n.CODE_B;case n.START_CODE_C:return n.CODE_C;default:return null}}(o.code),s=!1,u=!1,f=u,l=!0,d=0,p=[],h=[];!s;){if(f=u,u=!1,null!==(o=this._decodeCode(o.end,o.correction)))switch(o.code!==this.STOP_CODE&&(l=!0),o.code!==this.STOP_CODE&&(p.push(o.code),a+=++d*o.code),i.push(o),c){case this.CODE_A:if(o.code<64)h.push(String.fromCharCode(32+o.code));else if(o.code<96)h.push(String.fromCharCode(o.code-64));else switch(o.code!==this.STOP_CODE&&(l=!1),o.code){case this.CODE_SHIFT:u=!0,c=this.CODE_B;break;case this.CODE_B:c=this.CODE_B;break;case this.CODE_C:c=this.CODE_C;break;case this.STOP_CODE:s=!0}break;case this.CODE_B:if(o.code<96)h.push(String.fromCharCode(32+o.code));else switch(o.code!==this.STOP_CODE&&(l=!1),o.code){case this.CODE_SHIFT:u=!0,c=this.CODE_A;break;case this.CODE_A:c=this.CODE_A;break;case this.CODE_C:c=this.CODE_C;break;case this.STOP_CODE:s=!0}break;case this.CODE_C:if(o.code<100)h.push(o.code<10?"0"+o.code:o.code);else switch(o.code!==this.STOP_CODE&&(l=!1),o.code){case this.CODE_A:c=this.CODE_A;break;case this.CODE_B:c=this.CODE_B;break;case this.STOP_CODE:s=!0}}else s=!0;f&&(c=c===this.CODE_A?this.CODE_B:this.CODE_A)}return null===o?null:(o.end=this._nextUnset(this._row,o.end),this._verifyTrailingWhitespace(o)?(a-=d*p[p.length-1])%103!==p[p.length-1]?null:h.length?(l&&h.splice(h.length-1,1),{code:h.join(""),start:r.start,end:o.end,codeset:c,startInfo:r,decodedCodes:i,endInfo:o,format:this.FORMAT}):null:null)}},{key:"_verifyTrailingWhitespace",value:function(e){var t;return(t=e.end+(e.end-e.start)/2)<this._row.length&&this._matchRange(e.end,t,0)?e:null}},{key:"calculateCorrection",value:function(e,t,n){for(var r=n.length,o=0,i=0;r--;)i+=e[n[r]],o+=t[n[r]];return i/o}}]),n}(k);function M(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function A(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?M(Object(n),!0).forEach((function(t){P()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var j=[1,1,1],I=[1,1,1,1,1],L=[1,1,2],N=[[3,2,1,1],[2,2,2,1],[2,1,2,2],[1,4,1,1],[1,1,3,2],[1,2,3,1],[1,1,1,4],[1,3,1,2],[1,2,1,3],[3,1,1,2],[1,1,2,3],[1,2,2,2],[2,2,1,2],[1,1,4,1],[2,3,1,1],[1,3,2,1],[4,1,1,1],[2,1,3,1],[3,1,2,1],[2,1,1,3]],z=[0,11,13,14,19,25,28,21,22,26],F=function(e){C()(n,e);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=T()(e);if(t){var o=T()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return R()(this,n)}}(n);function n(e,r){var o;return m()(this,n),o=t.call(this,c()({supplements:[]},e),r),P()(_()(o),"FORMAT","ean_13"),P()(_()(o),"SINGLE_CODE_ERROR",.7),P()(_()(o),"STOP_PATTERN",[1,1,1]),o}return y()(n,[{key:"_findPattern",value:function(e,t,n,r){var o=new Array(e.length).fill(0),i={error:Number.MAX_VALUE,start:0,end:0},a=0;t||(t=this._nextSet(this._row));for(var c=!1,s=t;s<this._row.length;s++)if(this._row[s]^(n?1:0))o[a]+=1;else{if(a===o.length-1){var u=this._matchPattern(o,e);if(u<.48&&i.error&&u<i.error)return c=!0,i.error=u,i.start=s-o.reduce((function(e,t){return e+t}),0),i.end=s,i;if(r){for(var f=0;f<o.length-2;f++)o[f]=o[f+2];o[o.length-2]=0,o[o.length-1]=0,a--}}else a++;o[a]=1,n=!n}return c?i:null}},{key:"_decodeCode",value:function(e,t){var n=[0,0,0,0],r=e,o={error:Number.MAX_VALUE,code:-1,start:e,end:e},i=!this._row[r],a=0;t||(t=N.length);for(var c=r;c<this._row.length;c++)if(this._row[c]^(i?1:0))n[a]++;else{if(a===n.length-1){for(var s=0;s<t;s++){var u=this._matchPattern(n,N[s]);o.end=c,u<o.error&&(o.code=s,o.error=u)}return o.error>.48?null:o}n[++a]=1,i=!i}return null}},{key:"_findStart",value:function(){for(var e=this._nextSet(this._row),t=null;!t;){if(!(t=this._findPattern(j,e,!1,!0)))return null;var n=t.start-(t.end-t.start);if(n>=0&&this._matchRange(n,t.start,0))return t;e=t.end,t=null}return null}},{key:"_calculateFirstDigit",value:function(e){for(var t=0;t<z.length;t++)if(e===z[t])return t;return null}},{key:"_decodePayload",value:function(e,t,n){for(var r=A({},e),o=0,i=0;i<6;i++){if(!(r=this._decodeCode(r.end)))return null;r.code>=10?(r.code-=10,o|=1<<5-i):o|=0<<5-i,t.push(r.code),n.push(r)}var a=this._calculateFirstDigit(o);if(null===a)return null;t.unshift(a);var c=this._findPattern(I,r.end,!0,!1);if(null===c||!c.end)return null;n.push(c);for(var s=0;s<6;s++){if(!(c=this._decodeCode(c.end,10)))return null;n.push(c),t.push(c.code)}return c}},{key:"_verifyTrailingWhitespace",value:function(e){var t=e.end+(e.end-e.start);return t<this._row.length&&this._matchRange(e.end,t,0)?e:null}},{key:"_findEnd",value:function(e,t){var n=this._findPattern(this.STOP_PATTERN,e,t,!1);return null!==n?this._verifyTrailingWhitespace(n):null}},{key:"_checksum",value:function(e){for(var t=0,n=e.length-2;n>=0;n-=2)t+=e[n];t*=3;for(var r=e.length-1;r>=0;r-=2)t+=e[r];return t%10==0}},{key:"_decodeExtensions",value:function(e){var t=this._nextSet(this._row,e),n=this._findPattern(L,t,!1,!1);if(null===n)return null;for(var r=0;r<this.supplements.length;r++)try{var o=this.supplements[r].decode(this._row,n.end);if(null!==o)return{code:o.code,start:t,startInfo:n,end:o.end,decodedCodes:o.decodedCodes,format:this.supplements[r].FORMAT}}catch(e){console.error("* decodeExtensions error in ",this.supplements[r],": ",e)}return null}},{key:"decode",value:function(e,t){var n=new Array,r=new Array,o={},i=this._findStart();if(!i)return null;var a={start:i.start,end:i.end};if(r.push(a),!(a=this._decodePayload(a,n,r)))return null;if(!(a=this._findEnd(a.end,!1)))return null;if(r.push(a),!this._checksum(n))return null;if(this.supplements.length>0){var c=this._decodeExtensions(a.end);if(!c)return null;if(!c.decodedCodes)return null;var s=c.decodedCodes[c.decodedCodes.length-1],u={start:s.start+((s.end-s.start)/2|0),end:s.end};if(!this._verifyTrailingWhitespace(u))return null;o={supplement:c,code:n.join("")+c.code}}return A(A({code:n.join(""),start:i.start,end:a.end,startInfo:i,decodedCodes:r},o),{},{format:this.FORMAT})}}]),n}(k),U=n(33),G=n.n(U),B=new Uint16Array(G()("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. *$/+%").map((function(e){return e.charCodeAt(0)}))),W=new Uint16Array([52,289,97,352,49,304,112,37,292,100,265,73,328,25,280,88,13,268,76,28,259,67,322,19,274,82,7,262,70,22,385,193,448,145,400,208,133,388,196,148,168,162,138,42]),V=function(e){C()(n,e);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=T()(e);if(t){var o=T()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return R()(this,n)}}(n);function n(){var e;m()(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),P()(_()(e),"FORMAT","code_39"),e}return y()(n,[{key:"_findStart",value:function(){for(var e=this._nextSet(this._row),t=e,n=new Uint16Array([0,0,0,0,0,0,0,0,0]),r=0,o=!1,i=e;i<this._row.length;i++)if(this._row[i]^(o?1:0))n[r]++;else{if(r===n.length-1){if(148===this._toPattern(n)){var a=Math.floor(Math.max(0,t-(i-t)/4));if(this._matchRange(a,t,0))return{start:t,end:i}}t+=n[0]+n[1];for(var c=0;c<7;c++)n[c]=n[c+2];n[7]=0,n[8]=0,r--}else r++;n[r]=1,o=!o}return null}},{key:"_toPattern",value:function(e){for(var t=e.length,n=0,r=t,o=0;r>3;){n=this._findNextWidth(e,n),r=0;for(var i=0,a=0;a<t;a++)e[a]>n&&(i|=1<<t-1-a,r++,o+=e[a]);if(3===r){for(var c=0;c<t&&r>0;c++)if(e[c]>n&&(r--,2*e[c]>=o))return-1;return i}}return-1}},{key:"_findNextWidth",value:function(e,t){for(var n=Number.MAX_VALUE,r=0;r<e.length;r++)e[r]<n&&e[r]>t&&(n=e[r]);return n}},{key:"_patternToChar",value:function(e){for(var t=0;t<W.length;t++)if(W[t]===e)return String.fromCharCode(B[t]);return null}},{key:"_verifyTrailingWhitespace",value:function(e,t,n){var r=O.a.sum(n);return 3*(t-e-r)>=r}},{key:"decode",value:function(e,t){var n=new Uint16Array([0,0,0,0,0,0,0,0,0]),r=[];if(!(t=this._findStart()))return null;var o,i,a=this._nextSet(this._row,t.end);do{n=this._toCounters(a,n);var c=this._toPattern(n);if(c<0)return null;if(null===(o=this._patternToChar(c)))return null;r.push(o),i=a,a+=O.a.sum(n),a=this._nextSet(this._row,a)}while("*"!==o);return r.pop(),r.length&&this._verifyTrailingWhitespace(i,a,n)?{code:r.join(""),start:t.start,end:a,startInfo:t,decodedCodes:r,format:this.FORMAT}:null}}]),n}(k),q=n(12),J=n.n(q),X=/[IOQ]/g,H=/[A-Z0-9]{17}/,$=function(e){C()(n,e);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=T()(e);if(t){var o=T()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return R()(this,n)}}(n);function n(){var e;m()(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),P()(_()(e),"FORMAT","code_39_vin"),e}return y()(n,[{key:"_checkChecksum",value:function(e){return!!e}},{key:"decode",value:function(e,t){var r=J()(T()(n.prototype),"decode",this).call(this,e,t);if(!r)return null;var o=r.code;return o&&(o=o.replace(X,"")).match(H)&&this._checkChecksum(o)?(r.code=o,r):null}}]),n}(V),Y=[48,49,50,51,52,53,54,55,56,57,45,36,58,47,46,43,65,66,67,68],Q=[3,6,9,96,18,66,33,36,48,72,12,24,69,81,84,21,26,41,11,14],K=[26,41,11,14],Z=function(e){C()(n,e);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=T()(e);if(t){var o=T()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return R()(this,n)}}(n);function n(){var e;m()(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),P()(_()(e),"_counters",[]),P()(_()(e),"FORMAT","codabar"),e}return y()(n,[{key:"_computeAlternatingThreshold",value:function(e,t){for(var n=Number.MAX_VALUE,r=0,o=0,i=e;i<t;i+=2)(o=this._counters[i])>r&&(r=o),o<n&&(n=o);return(n+r)/2|0}},{key:"_toPattern",value:function(e){var t=e+7;if(t>this._counters.length)return-1;for(var n=this._computeAlternatingThreshold(e,t),r=this._computeAlternatingThreshold(e+1,t),o=64,i=0,a=0,c=0;c<7;c++)i=0==(1&c)?n:r,this._counters[e+c]>i&&(a|=o),o>>=1;return a}},{key:"_isStartEnd",value:function(e){for(var t=0;t<K.length;t++)if(K[t]===e)return!0;return!1}},{key:"_sumCounters",value:function(e,t){for(var n=0,r=e;r<t;r++)n+=this._counters[r];return n}},{key:"_findStart",value:function(){for(var e=this._nextUnset(this._row),t=1;t<this._counters.length;t++){var n=this._toPattern(t);if(-1!==n&&this._isStartEnd(n))return{start:e+=this._sumCounters(0,t),end:e+this._sumCounters(t,t+8),startCounter:t,endCounter:t+8}}return null}},{key:"_patternToChar",value:function(e){for(var t=0;t<Q.length;t++)if(Q[t]===e)return String.fromCharCode(Y[t]);return null}},{key:"_calculatePatternLength",value:function(e){for(var t=0,n=e;n<e+7;n++)t+=this._counters[n];return t}},{key:"_verifyWhitespace",value:function(e,t){return(e-1<=0||this._counters[e-1]>=this._calculatePatternLength(e)/2)&&(t+8>=this._counters.length||this._counters[t+7]>=this._calculatePatternLength(t)/2)}},{key:"_charToPattern",value:function(e){for(var t=e.charCodeAt(0),n=0;n<Y.length;n++)if(Y[n]===t)return Q[n];return 0}},{key:"_thresholdResultPattern",value:function(e,t){for(var n,r={space:{narrow:{size:0,counts:0,min:0,max:Number.MAX_VALUE},wide:{size:0,counts:0,min:0,max:Number.MAX_VALUE}},bar:{narrow:{size:0,counts:0,min:0,max:Number.MAX_VALUE},wide:{size:0,counts:0,min:0,max:Number.MAX_VALUE}}},o=t,i=0;i<e.length;i++){n=this._charToPattern(e[i]);for(var a=6;a>=0;a--){var c=2==(1&a)?r.bar:r.space,s=1==(1&n)?c.wide:c.narrow;s.size+=this._counters[o+a],s.counts++,n>>=1}o+=8}return["space","bar"].forEach((function(e){var t=r[e];t.wide.min=Math.floor((t.narrow.size/t.narrow.counts+t.wide.size/t.wide.counts)/2),t.narrow.max=Math.ceil(t.wide.min),t.wide.max=Math.ceil((2*t.wide.size+1.5)/t.wide.counts)})),r}},{key:"_validateResult",value:function(e,t){for(var n,r=this._thresholdResultPattern(e,t),o=t,i=0;i<e.length;i++){n=this._charToPattern(e[i]);for(var a=6;a>=0;a--){var c=0==(1&a)?r.bar:r.space,s=1==(1&n)?c.wide:c.narrow,u=this._counters[o+a];if(u<s.min||u>s.max)return!1;n>>=1}o+=8}return!0}},{key:"decode",value:function(e,t){if(this._counters=this._fillCounters(),!(t=this._findStart()))return null;var n,r=t.startCounter,o=[];do{if((n=this._toPattern(r))<0)return null;var i=this._patternToChar(n);if(null===i)return null;if(o.push(i),r+=8,o.length>1&&this._isStartEnd(n))break}while(r<this._counters.length);if(o.length-2<4||!this._isStartEnd(n))return null;if(!this._verifyWhitespace(t.startCounter,r-8))return null;if(!this._validateResult(o,t.startCounter))return null;r=r>this._counters.length?this._counters.length:r;var a=t.start+this._sumCounters(t.startCounter,r-8);return{code:o.join(""),start:t.start,end:a,startInfo:t,decodedCodes:o,format:this.FORMAT}}}]),n}(k),ee=function(e){C()(n,e);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=T()(e);if(t){var o=T()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return R()(this,n)}}(n);function n(){var e;m()(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),P()(_()(e),"FORMAT","upc_a"),e}return y()(n,[{key:"decode",value:function(e,t){var n=F.prototype.decode.call(this);return n&&n.code&&13===n.code.length&&"0"===n.code.charAt(0)?(n.code=n.code.substring(1),n):null}}]),n}(F),te=function(e){C()(n,e);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=T()(e);if(t){var o=T()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return R()(this,n)}}(n);function n(){var e;m()(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),P()(_()(e),"FORMAT","ean_8"),e}return y()(n,[{key:"_decodePayload",value:function(e,t,n){for(var r=e,o=0;o<4;o++){if(!(r=this._decodeCode(r.end,10)))return null;t.push(r.code),n.push(r)}if(null===(r=this._findPattern(I,r.end,!0,!1)))return null;n.push(r);for(var i=0;i<4;i++){if(!(r=this._decodeCode(r.end,10)))return null;n.push(r),t.push(r.code)}return r}}]),n}(F),ne=function(e){C()(n,e);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=T()(e);if(t){var o=T()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return R()(this,n)}}(n);function n(){var e;m()(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),P()(_()(e),"FORMAT","ean_2"),e}return y()(n,[{key:"decode",value:function(e,t){e&&(this._row=e);var n=0,r=t,o=this._row.length,i=[],a=[],c=null;if(void 0===r)return null;for(var s=0;s<2&&r<o;s++){if(!(c=this._decodeCode(r)))return null;a.push(c),i.push(c.code%10),c.code>=10&&(n|=1<<1-s),1!==s&&(r=this._nextSet(this._row,c.end),r=this._nextUnset(this._row,r))}if(2!==i.length||parseInt(i.join(""))%4!==n)return null;var u=this._findStart();return{code:i.join(""),decodedCodes:a,end:c.end,format:this.FORMAT,startInfo:u,start:u.start}}}]),n}(F),re=[24,20,18,17,12,6,3,10,9,5],oe=function(e){C()(n,e);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=T()(e);if(t){var o=T()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return R()(this,n)}}(n);function n(){var e;m()(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),P()(_()(e),"FORMAT","ean_5"),e}return y()(n,[{key:"decode",value:function(e,t){if(void 0===t)return null;e&&(this._row=e);for(var n=0,r=t,o=this._row.length,i=null,a=[],c=[],s=0;s<5&&r<o;s++){if(!(i=this._decodeCode(r)))return null;c.push(i),a.push(i.code%10),i.code>=10&&(n|=1<<4-s),4!==s&&(r=this._nextSet(this._row,i.end),r=this._nextUnset(this._row,r))}if(5!==a.length)return null;if(function(e){for(var t=e.length,n=0,r=t-2;r>=0;r-=2)n+=e[r];n*=3;for(var o=t-1;o>=0;o-=2)n+=e[o];return(n*=3)%10}(a)!==function(e){for(var t=0;t<10;t++)if(e===re[t])return t;return null}(n))return null;var u=this._findStart();return{code:a.join(""),decodedCodes:c,end:i.end,format:this.FORMAT,startInfo:u,start:u.start}}}]),n}(F);function ie(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var ae,ce=function(e){C()(n,e);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=T()(e);if(t){var o=T()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return R()(this,n)}}(n);function n(){var e;m()(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),P()(_()(e),"CODE_FREQUENCY",[[56,52,50,49,44,38,35,42,41,37],[7,11,13,14,19,25,28,21,22,26]]),P()(_()(e),"STOP_PATTERN",[1/6*7,1/6*7,1/6*7,1/6*7,1/6*7,1/6*7]),P()(_()(e),"FORMAT","upc_e"),e}return y()(n,[{key:"_decodePayload",value:function(e,t,n){for(var r=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ie(Object(n),!0).forEach((function(t){P()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ie(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e),o=0,i=0;i<6;i++){if(!(r=this._decodeCode(r.end)))return null;r.code>=10&&(r.code=r.code-10,o|=1<<5-i),t.push(r.code),n.push(r)}return this._determineParity(o,t)?r:null}},{key:"_determineParity",value:function(e,t){for(var n=0;n<this.CODE_FREQUENCY.length;n++)for(var r=0;r<this.CODE_FREQUENCY[n].length;r++)if(e===this.CODE_FREQUENCY[n][r])return t.unshift(n),t.push(r),!0;return!1}},{key:"_convertToUPCA",value:function(e){var t=[e[0]],n=e[e.length-2];return(t=n<=2?t.concat(e.slice(1,3)).concat([n,0,0,0,0]).concat(e.slice(3,6)):3===n?t.concat(e.slice(1,4)).concat([0,0,0,0,0]).concat(e.slice(4,6)):4===n?t.concat(e.slice(1,5)).concat([0,0,0,0,0,e[5]]):t.concat(e.slice(1,6)).concat([0,0,0,0,n])).push(e[e.length-1]),t}},{key:"_checksum",value:function(e){return J()(T()(n.prototype),"_checksum",this).call(this,this._convertToUPCA(e))}},{key:"_findEnd",value:function(e,t){return J()(T()(n.prototype),"_findEnd",this).call(this,e,!0)}},{key:"_verifyTrailingWhitespace",value:function(e){var t=e.end+(e.end-e.start)/2;return t<this._row.length&&this._matchRange(e.end,t,0)?e:null}}]),n}(F),se=function(e){C()(n,e);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=T()(e);if(t){var o=T()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return R()(this,n)}}(n);function n(e){var r;return m()(this,n),r=t.call(this,c()({normalizeBarSpaceWidth:!1},e)),P()(_()(r),"barSpaceRatio",[1,1]),P()(_()(r),"SINGLE_CODE_ERROR",.78),P()(_()(r),"AVG_CODE_ERROR",.38),P()(_()(r),"START_PATTERN",[1,1,1,1]),P()(_()(r),"STOP_PATTERN",[1,1,3]),P()(_()(r),"CODE_PATTERN",[[1,1,3,3,1],[3,1,1,1,3],[1,3,1,1,3],[3,3,1,1,1],[1,1,3,1,3],[3,1,3,1,1],[1,3,3,1,1],[1,1,1,3,3],[3,1,1,3,1],[1,3,1,3,1]]),P()(_()(r),"MAX_CORRECTION_FACTOR",5),P()(_()(r),"FORMAT","i2of5"),e.normalizeBarSpaceWidth&&(r.SINGLE_CODE_ERROR=.38,r.AVG_CODE_ERROR=.09),r.config=e,R()(r,_()(r))}return y()(n,[{key:"_matchPattern",value:function(e,t){if(this.config.normalizeBarSpaceWidth){for(var r=[0,0],o=[0,0],i=[0,0],a=this.MAX_CORRECTION_FACTOR,c=1/a,s=0;s<e.length;s++)r[s%2]+=e[s],o[s%2]+=t[s];i[0]=o[0]/r[0],i[1]=o[1]/r[1],i[0]=Math.max(Math.min(i[0],a),c),i[1]=Math.max(Math.min(i[1],a),c),this.barSpaceRatio=i;for(var u=0;u<e.length;u++)e[u]*=this.barSpaceRatio[u%2]}return J()(T()(n.prototype),"_matchPattern",this).call(this,e,t)}},{key:"_findPattern",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=new Array(e.length).fill(0),i=0,a={error:Number.MAX_VALUE,start:0,end:0},c=this.AVG_CODE_ERROR;n=n||!1,r=r||!1,t||(t=this._nextSet(this._row));for(var s=t;s<this._row.length;s++)if(this._row[s]^(n?1:0))o[i]++;else{if(i===o.length-1){var u=o.reduce((function(e,t){return e+t}),0),f=this._matchPattern(o,e);if(f<c)return a.error=f,a.start=s-u,a.end=s,a;if(!r)return null;for(var l=0;l<o.length-2;l++)o[l]=o[l+2];o[o.length-2]=0,o[o.length-1]=0,i--}else i++;o[i]=1,n=!n}return null}},{key:"_findStart",value:function(){for(var e=0,t=this._nextSet(this._row),n=null,r=1;!n;){if(!(n=this._findPattern(this.START_PATTERN,t,!1,!0)))return null;if(r=Math.floor((n.end-n.start)/4),(e=n.start-10*r)>=0&&this._matchRange(e,n.start,0))return n;t=n.end,n=null}return null}},{key:"_verifyTrailingWhitespace",value:function(e){var t=e.end+(e.end-e.start)/2;return t<this._row.length&&this._matchRange(e.end,t,0)?e:null}},{key:"_findEnd",value:function(){this._row.reverse();var e=this._findPattern(this.STOP_PATTERN);if(this._row.reverse(),null===e)return null;var t=e.start;return e.start=this._row.length-e.end,e.end=this._row.length-t,null!==e?this._verifyTrailingWhitespace(e):null}},{key:"_decodePair",value:function(e){for(var t=[],n=0;n<e.length;n++){var r=this._decodeCode(e[n]);if(!r)return null;t.push(r)}return t}},{key:"_decodeCode",value:function(e){for(var t=this.AVG_CODE_ERROR,n={error:Number.MAX_VALUE,code:-1,start:0,end:0},r=0;r<this.CODE_PATTERN.length;r++){var o=this._matchPattern(e,this.CODE_PATTERN[r]);o<n.error&&(n.code=r,n.error=o)}return n.error<t?n:null}},{key:"_decodePayload",value:function(e,t,n){for(var r=0,o=e.length,i=[[0,0,0,0,0],[0,0,0,0,0]],a=null;r<o;){for(var c=0;c<5;c++)i[0][c]=e[r]*this.barSpaceRatio[0],i[1][c]=e[r+1]*this.barSpaceRatio[1],r+=2;if(!(a=this._decodePair(i)))return null;for(var s=0;s<a.length;s++)t.push(a[s].code+""),n.push(a[s])}return a}},{key:"_verifyCounterLength",value:function(e){return e.length%10==0}},{key:"decode",value:function(e,t){var n=new Array,r=new Array,o=this._findStart();if(!o)return null;r.push(o);var i=this._findEnd();if(!i)return null;var a=this._fillCounters(o.end,i.start,!1);return this._verifyCounterLength(a)&&this._decodePayload(a,n,r)?n.length%2!=0||n.length<6?null:(r.push(i),{code:n.join(""),start:o.start,end:i.end,startInfo:o,decodedCodes:r,format:this.FORMAT}):null}}]),n}(k),ue=[3,1,3,1,1,1],fe=[3,1,1,1,3],le=[[1,1,3,3,1],[3,1,1,1,3],[1,3,1,1,3],[3,3,1,1,1],[1,1,3,1,3],[3,1,3,1,1],[1,3,3,1,1],[1,1,1,3,3],[3,1,1,3,1],[1,3,1,3,1]],de=ue.reduce((function(e,t){return e+t}),0),pe=function(e){C()(n,e);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=T()(e);if(t){var o=T()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return R()(this,n)}}(n);function n(){var e;m()(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),P()(_()(e),"barSpaceRatio",[1,1]),P()(_()(e),"FORMAT","2of5"),P()(_()(e),"SINGLE_CODE_ERROR",.78),P()(_()(e),"AVG_CODE_ERROR",.3),e}return y()(n,[{key:"_findPattern",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=[],i=0,a={error:Number.MAX_VALUE,code:-1,start:0,end:0},c=0,s=0,u=this.AVG_CODE_ERROR;t||(t=this._nextSet(this._row));for(var f=0;f<e.length;f++)o[f]=0;for(var l=t;l<this._row.length;l++)if(this._row[l]^(n?1:0))o[i]++;else{if(i===o.length-1){c=0;for(var d=0;d<o.length;d++)c+=o[d];if((s=this._matchPattern(o,e))<u)return a.error=s,a.start=l-c,a.end=l,a;if(!r)return null;for(var p=0;p<o.length-2;p++)o[p]=o[p+2];o[o.length-2]=0,o[o.length-1]=0,i--}else i++;o[i]=1,n=!n}return null}},{key:"_findStart",value:function(){for(var e=null,t=this._nextSet(this._row),n=1,r=0;!e;){if(!(e=this._findPattern(ue,t,!1,!0)))return null;if(n=Math.floor((e.end-e.start)/de),(r=e.start-5*n)>=0&&this._matchRange(r,e.start,0))return e;t=e.end,e=null}return e}},{key:"_verifyTrailingWhitespace",value:function(e){var t=e.end+(e.end-e.start)/2;return t<this._row.length&&this._matchRange(e.end,t,0)?e:null}},{key:"_findEnd",value:function(){this._row.reverse();var e=this._nextSet(this._row),t=this._findPattern(fe,e,!1,!0);if(this._row.reverse(),null===t)return null;var n=t.start;return t.start=this._row.length-t.end,t.end=this._row.length-n,null!==t?this._verifyTrailingWhitespace(t):null}},{key:"_verifyCounterLength",value:function(e){return e.length%10==0}},{key:"_decodeCode",value:function(e){for(var t=this.AVG_CODE_ERROR,n={error:Number.MAX_VALUE,code:-1,start:0,end:0},r=0;r<le.length;r++){var o=this._matchPattern(e,le[r]);o<n.error&&(n.code=r,n.error=o)}return n.error<t?n:null}},{key:"_decodePayload",value:function(e,t,n){for(var r=0,o=e.length,i=[0,0,0,0,0],a=null;r<o;){for(var c=0;c<5;c++)i[c]=e[r]*this.barSpaceRatio[0],r+=2;if(!(a=this._decodeCode(i)))return null;t.push("".concat(a.code)),n.push(a)}return a}},{key:"decode",value:function(e,t){var n=this._findStart();if(!n)return null;var r=this._findEnd();if(!r)return null;var o=this._fillCounters(n.end,r.start,!1);if(!this._verifyCounterLength(o))return null;var i=[];i.push(n);var a=[];return this._decodePayload(o,a,i)?a.length<5?null:(i.push(r),{code:a.join(""),start:n.start,end:r.end,startInfo:n,decodedCodes:i,format:this.FORMAT}):null}}]),n}(k),he=new Uint16Array(G()("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%abcd*").map((function(e){return e.charCodeAt(0)}))),ve=new Uint16Array([276,328,324,322,296,292,290,336,274,266,424,420,418,404,402,394,360,356,354,308,282,344,332,326,300,278,436,434,428,422,406,410,364,358,310,314,302,468,466,458,366,374,430,294,474,470,306,350]),me=function(e){C()(n,e);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=T()(e);if(t){var o=T()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return R()(this,n)}}(n);function n(){var e;m()(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),P()(_()(e),"FORMAT","code_93"),e}return y()(n,[{key:"_patternToChar",value:function(e){for(var t=0;t<ve.length;t++)if(ve[t]===e)return String.fromCharCode(he[t]);return null}},{key:"_toPattern",value:function(e){for(var t=e.length,n=e.reduce((function(e,t){return e+t}),0),r=0,o=0;o<t;o++){var i=Math.round(9*e[o]/n);if(i<1||i>4)return-1;if(0==(1&o))for(var a=0;a<i;a++)r=r<<1|1;else r<<=i}return r}},{key:"_findStart",value:function(){for(var e=this._nextSet(this._row),t=e,n=new Uint16Array([0,0,0,0,0,0]),r=0,o=!1,i=e;i<this._row.length;i++)if(this._row[i]^(o?1:0))n[r]++;else{if(r===n.length-1){if(350===this._toPattern(n)){var a=Math.floor(Math.max(0,t-(i-t)/4));if(this._matchRange(a,t,0))return{start:t,end:i}}t+=n[0]+n[1];for(var c=0;c<4;c++)n[c]=n[c+2];n[4]=0,n[5]=0,r--}else r++;n[r]=1,o=!o}return null}},{key:"_verifyEnd",value:function(e,t){return!(e===t||!this._row[t])}},{key:"_decodeExtended",value:function(e){for(var t=e.length,n=[],r=0;r<t;r++){var o=e[r];if(o>="a"&&o<="d"){if(r>t-2)return null;var i=e[++r],a=i.charCodeAt(0),c=void 0;switch(o){case"a":if(!(i>="A"&&i<="Z"))return null;c=String.fromCharCode(a-64);break;case"b":if(i>="A"&&i<="E")c=String.fromCharCode(a-38);else if(i>="F"&&i<="J")c=String.fromCharCode(a-11);else if(i>="K"&&i<="O")c=String.fromCharCode(a+16);else if(i>="P"&&i<="S")c=String.fromCharCode(a+43);else{if(!(i>="T"&&i<="Z"))return null;c=String.fromCharCode(127)}break;case"c":if(i>="A"&&i<="O")c=String.fromCharCode(a-32);else{if("Z"!==i)return null;c=":"}break;case"d":if(!(i>="A"&&i<="Z"))return null;c=String.fromCharCode(a+32);break;default:return console.warn("* code_93_reader _decodeExtended hit default case, this may be an error",c),null}n.push(c)}else n.push(o)}return n}},{key:"_matchCheckChar",value:function(e,t,n){var r=e.slice(0,t),o=r.length,i=r.reduce((function(e,t,r){return e+((-1*r+(o-1))%n+1)*he.indexOf(t.charCodeAt(0))}),0);return he[i%47]===e[t].charCodeAt(0)}},{key:"_verifyChecksums",value:function(e){return this._matchCheckChar(e,e.length-2,20)&&this._matchCheckChar(e,e.length-1,15)}},{key:"decode",value:function(e,t){if(!(t=this._findStart()))return null;var n,r,o=new Uint16Array([0,0,0,0,0,0]),i=[],a=this._nextSet(this._row,t.end);do{o=this._toCounters(a,o);var c=this._toPattern(o);if(c<0)return null;if(null===(r=this._patternToChar(c)))return null;i.push(r),n=a,a+=O.a.sum(o),a=this._nextSet(this._row,a)}while("*"!==r);return i.pop(),i.length&&this._verifyEnd(n,a)&&this._verifyChecksums(i)?(i=i.slice(0,i.length-2),null===(i=this._decodeExtended(i))?null:{code:i.join(""),start:t.start,end:a,startInfo:t,decodedCodes:i,format:this.FORMAT}):null}}]),n}(k),ge=/[AEIO]/g,ye=function(e){C()(n,e);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=T()(e);if(t){var o=T()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return R()(this,n)}}(n);function n(){var e;m()(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),P()(_()(e),"FORMAT","code_32_reader"),e}return y()(n,[{key:"_decodeCode32",value:function(e){if(/[^0-9BCDFGHJKLMNPQRSTUVWXYZ]/.test(e))return null;for(var t=0,n=0;n<e.length;n++)t=32*t+"0123456789BCDFGHJKLMNPQRSTUVWXYZ".indexOf(e[n]);var r=""+t;return r.length<9&&(r=("000000000"+r).slice(-9)),"A"+r}},{key:"_checkChecksum",value:function(e){return!!e}},{key:"decode",value:function(e,t){var r=J()(T()(n.prototype),"decode",this).call(this,e,t);if(!r)return null;var o=r.code;if(!o)return null;if(o=o.replace(ge,""),!this._checkChecksum(o))return null;var i=this._decodeCode32(o);return i?(r.code=i,r):null}}]),n}(V),be={code_128_reader:D,ean_reader:F,ean_5_reader:oe,ean_2_reader:ne,ean_8_reader:te,code_39_reader:V,code_39_vin_reader:$,codabar_reader:Z,upc_reader:ee,upc_e_reader:ce,i2of5_reader:se,"2of5_reader":pe,code_93_reader:me,code_32_reader:ye},_e={registerReader:function(e,t){be[e]=t},create:function(e,t){var n=[];function r(){e.readers.forEach((function(e){var t,r={},o=[];"object"===i()(e)?(t=e.format,r=e.config):"string"==typeof e&&(t=e),r.supplements&&(o=r.supplements.map((function(e){return new be[e]})));try{var a=new be[t](r,o);n.push(a)}catch(e){throw console.error("* Error constructing reader ",t,e),e}}))}function o(e){var r,o=null,i=p.getBarcodeLine(t,e[0],e[1]);for(p.toBinaryLine(i),r=0;r<n.length&&null===o;r++)o=n[r].decodePattern(i.line);return null===o?null:{codeResult:o,barcodeLine:i}}function a(e){var n,r,i=function(e){return Math.sqrt(Math.pow(Math.abs(e[1].y-e[0].y),2)+Math.pow(Math.abs(e[1].x-e[0].x),2))}(n=function(e){return[{x:(e[1][0]-e[0][0])/2+e[0][0],y:(e[1][1]-e[0][1])/2+e[0][1]},{x:(e[3][0]-e[2][0])/2+e[2][0],y:(e[3][1]-e[2][1])/2+e[2][1]}]}(e)),a=Math.atan2(n[1].y-n[0].y,n[1].x-n[0].x);return null===(n=function(e,n,r){function o(t){var r=t*Math.sin(n),o=t*Math.cos(n);e[0].y-=r,e[0].x-=o,e[1].y+=r,e[1].x+=o}for(o(r);r>1&&(!t.inImageWithBorder(e[0])||!t.inImageWithBorder(e[1]));)o(-(r-=Math.ceil(r/2)));return e}(n,a,Math.floor(.1*i)))?null:(null===(r=o(n))&&(r=function(e,t,n){var r,i,a,c=Math.sqrt(Math.pow(e[1][0]-e[0][0],2)+Math.pow(e[1][1]-e[0][1],2)),s=null,u=Math.sin(n),f=Math.cos(n);for(r=1;r<16&&null===s;r++)a={y:(i=c/16*r*(r%2==0?-1:1))*u,x:i*f},t[0].y+=a.x,t[0].x-=a.y,t[1].y+=a.x,t[1].x-=a.y,s=o(t);return s}(e,n,a)),null===r?null:{codeResult:r.codeResult,line:n,angle:a,pattern:r.barcodeLine.line,threshold:r.barcodeLine.threshold})}return r(),{decodeFromBoundingBox:function(e){return a(e)},decodeFromBoundingBoxes:function(t){var n,r,o=[],i=e.multiple;for(n=0;n<t.length;n++){var c=t[n];if((r=a(c)||{}).box=c,i)o.push(r);else if(r.codeResult)return r}if(i)return{barcodes:o}},decodeFromImage:function(e){return function(e){for(var t=null,r=0;r<n.length&&null===t;r++)t=n[r].decodeImage?n[r].decodeImage(e):null;return t}(e)},registerReader:function(e,t){if(be[e])throw new Error("cannot register existing reader",e);be[e]=t},setReaders:function(t){e.readers=t,n.length=0,r()}}}},xe=function(){var e={};function t(t){return e[t]||(e[t]={subscribers:[]}),e[t]}function n(e,t){e.async?setTimeout((function(){e.callback(t)}),4):e.callback(t)}function r(e,n,r){var o;if("function"==typeof n)o={callback:n,async:r};else if(!(o=n).callback)throw new Error("Callback was not specified on options");t(e).subscribers.push(o)}return{subscribe:function(e,t,n){return r(e,t,n)},publish:function(e,r){var o=t(e),i=o.subscribers;i.filter((function(e){return!!e.once})).forEach((function(e){n(e,r)})),o.subscribers=i.filter((function(e){return!e.once})),o.subscribers.forEach((function(e){n(e,r)}))},once:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];r(e,{callback:t,async:n,once:!0})},unsubscribe:function(n,r){if(n){var o=t(n);o.subscribers=o&&r?o.subscribers.filter((function(e){return e.callback!==r})):[]}else e={}}}}(),Ce=n(11),Se=n.n(Ce),Re=n(20),we=n.n(Re),Te=n(84),Ee=n.n(Te),Pe="This may mean that the user has declined camera access, or the browser does not support media APIs. If you are running in iOS, you must use Safari.";function Oe(){try{return navigator.mediaDevices.enumerateDevices()}catch(t){var e=new Error("enumerateDevices is not defined. ".concat(Pe));return e.code=-1,Promise.reject(e)}}function ke(e){try{return navigator.mediaDevices.getUserMedia(e)}catch(e){var t=new Error("getUserMedia is not defined. ".concat(Pe));return t.code=-1,Promise.reject(t)}}function De(e){return new Promise((function(t,n){var r=10;!function o(){r>0?e.videoWidth>10&&e.videoHeight>10?t():window.setTimeout(o,500):n(new Error("Unable to play video stream. Is webcam working?")),r--}()}))}function Me(e,t){return Ae.apply(this,arguments)}function Ae(){return(Ae=we()(Se.a.mark((function e(t,n){var r;return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ke(n);case 2:if(r=e.sent,ae=r,!t){e.next=11;break}return t.setAttribute("autoplay","true"),t.setAttribute("muted","true"),t.setAttribute("playsinline","true"),t.srcObject=r,t.addEventListener("loadedmetadata",(function(){t.play()})),e.abrupt("return",De(t));case 11:return e.abrupt("return",Promise.resolve());case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function je(e){var t=Ee()(e,["width","height","facingMode","aspectRatio","deviceId"]);return void 0!==e.minAspectRatio&&e.minAspectRatio>0&&(t.aspectRatio=e.minAspectRatio,console.log("WARNING: Constraint 'minAspectRatio' is deprecated; Use 'aspectRatio' instead")),void 0!==e.facing&&(t.facingMode=e.facing,console.log("WARNING: Constraint 'facing' is deprecated. Use 'facingMode' instead'")),t}function Ie(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=je(e);return t&&t.deviceId&&t.facingMode&&delete t.facingMode,Promise.resolve({audio:!1,video:t})}function Le(){return(Le=we()(Se.a.mark((function e(){var t;return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Oe();case 2:return t=e.sent,e.abrupt("return",t.filter((function(e){return"videoinput"===e.kind})));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ne(){if(!ae)return null;var e=ae.getVideoTracks();return e&&null!=e&&e.length?e[0]:null}var ze={requestedVideoElement:null,request:function(e,t){return we()(Se.a.mark((function n(){var r;return Se.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return ze.requestedVideoElement=e,n.next=3,Ie(t);case 3:return r=n.sent,n.abrupt("return",Me(e,r));case 5:case"end":return n.stop()}}),n)})))()},release:function(){var e=ae&&ae.getVideoTracks();return null!==ze.requestedVideoElement&&ze.requestedVideoElement.pause(),new Promise((function(t){setTimeout((function(){e&&e.length&&e[0].stop(),ae=null,ze.requestedVideoElement=null,t()}),0)}))},enumerateVideoDevices:function(){return Le.apply(this,arguments)},getActiveStreamLabel:function(){var e=Ne();return e?e.label:""},getActiveTrack:Ne},Fe=ze,Ue={create:function(e){var t,n=document.createElement("canvas"),r=n.getContext("2d"),o=[],i=null!==(t=e.capacity)&&void 0!==t?t:20,a=!0===e.capture;function c(t){return!!i&&t&&!function(e,t){return t&&t.some((function(t){return Object.keys(t).every((function(n){return t[n]===e[n]}))}))}(t,e.blacklist)&&function(e,t){return"function"!=typeof t||t(e)}(t,e.filter)}return{addResult:function(e,t,s){var u={};c(s)&&(i--,u.codeResult=s,a&&(n.width=t.x,n.height=t.y,h.a.drawImage(e,t,r),u.frame=n.toDataURL()),o.push(u))},getResults:function(){return o}}}},Ge={inputStream:{name:"Live",type:"LiveStream",constraints:{width:640,height:480,facingMode:"environment"},area:{top:"0%",right:"0%",left:"0%",bottom:"0%"},singleChannel:!1},locate:!0,numOfWorkers:4,decoder:{readers:["code_128_reader"]},locator:{halfSample:!0,patchSize:"medium"}},Be=n(7),We=function e(){m()(this,e),P()(this,"config",void 0),P()(this,"inputStream",void 0),P()(this,"framegrabber",void 0),P()(this,"inputImageWrapper",void 0),P()(this,"stopped",!1),P()(this,"boxSize",void 0),P()(this,"resultCollector",void 0),P()(this,"decoder",void 0),P()(this,"workerPool",[]),P()(this,"onUIThread",!0),P()(this,"canvasContainer",new qe)},Ve=function e(){m()(this,e),P()(this,"image",void 0),P()(this,"overlay",void 0)},qe=function e(){m()(this,e),P()(this,"ctx",void 0),P()(this,"dom",void 0),this.ctx=new Ve,this.dom=new Ve},Je=n(23);function Xe(e){if("undefined"==typeof document)return null;if(e instanceof HTMLElement&&e.nodeName&&1===e.nodeType)return e;var t="string"==typeof e?e:"#interactive.viewport";return document.querySelector(t)}function He(e,t){var n=function(e,t){var n=document.querySelector(e);return n||((n=document.createElement("canvas")).className=t),n}(e,t),r=n.getContext("2d");return{canvas:n,context:r}}var $e={274:"orientation"},Ye=Object.keys($e).map((function(e){return $e[e]}));function Qe(e){return new Promise((function(t){var n=new FileReader;n.onload=function(e){return t(e.target.result)},n.readAsArrayBuffer(e)}))}function Ke(e){return new Promise((function(t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="blob",r.onreadystatechange=function(){r.readyState!==XMLHttpRequest.DONE||200!==r.status&&0!==r.status||t(this.response)},r.onerror=n,r.send()}))}function Ze(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ye,n=new DataView(e),r=e.byteLength,o=t.reduce((function(e,t){var n=Object.keys($e).filter((function(e){return $e[e]===t}))[0];return n&&(e[n]=t),e}),{}),i=2;if(255!==n.getUint8(0)||216!==n.getUint8(1))return!1;for(;i<r;){if(255!==n.getUint8(i))return!1;if(225===n.getUint8(i+1))return et(n,i+4,o);i+=2+n.getUint16(i+2)}return!1}function et(e,t,n){if("Exif"!==function(e,t,n){for(var r="",o=t;o<t+4;o++)r+=String.fromCharCode(e.getUint8(o));return r}(e,t))return!1;var r,o=t+6;if(18761===e.getUint16(o))r=!1;else{if(19789!==e.getUint16(o))return!1;r=!0}if(42!==e.getUint16(o+2,!r))return!1;var i=e.getUint32(o+4,!r);return!(i<8)&&function(e,t,n,r,o){for(var i=e.getUint16(n,!o),a={},c=0;c<i;c++){var s=n+12*c+2,u=r[e.getUint16(s,!o)];u&&(a[u]=tt(e,s,0,0,o))}return a}(e,0,o+i,n,r)}function tt(e,t,n,r,o){var i=e.getUint16(t+2,!o),a=e.getUint32(t+4,!o);switch(i){case 3:if(1===a)return e.getUint16(t+8,!o)}return null}var nt={};function rt(e,t){e.onload=function(){t.loaded(this)}}nt.load=function(e,t,n,r,o){var i,a,c,s=new Array(r),u=new Array(s.length);if(!1===o)s[0]=e;else for(i=0;i<s.length;i++)c=n+i,s[i]="".concat(e,"image-").concat("00".concat(c).slice(-3),".jpg");for(u.notLoaded=[],u.addImage=function(e){u.notLoaded.push(e)},u.loaded=function(n){for(var r=u.notLoaded,i=0;i<r.length;i++)if(r[i]===n){r.splice(i,1);for(var a=0;a<s.length;a++){var c=s[a].substr(s[a].lastIndexOf("/"));if(-1!==n.src.lastIndexOf(c)){u[a]={img:n};break}}break}0===r.length&&(!1===o?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ye;return/^blob:/i.test(e)?Ke(e).then(Qe).then((function(e){return Ze(e,t)})):Promise.resolve(null)}(e,["orientation"]).then((function(e){u[0].tags=e,t(u)})).catch((function(e){console.log(e),t(u)})):t(u))},i=0;i<s.length;i++)a=new Image,u.addImage(a),rt(a,u),a.src=s[i]};var ot=nt,it={createVideoStream:function(e){var t,n,r=null,o=["canrecord","ended"],i={},a={x:0,y:0,type:"Point"},c={x:0,y:0,type:"XYSize"},s={getRealWidth:function(){return e.videoWidth},getRealHeight:function(){return e.videoHeight},getWidth:function(){return t},getHeight:function(){return n},setWidth:function(e){t=e},setHeight:function(e){n=e},setInputStream:function(e){r=e,this.setAttribute("src",void 0!==e.src?e.src:"")},ended:function(){return e.ended},getConfig:function(){return r},setAttribute:function(t,n){e&&e.setAttribute(t,n)},pause:function(){e.pause()},play:function(){e.play()},setCurrentTime:function(e){var t;"LiveStream"!==(null===(t=r)||void 0===t?void 0:t.type)&&this.setAttribute("currentTime",e.toString())},addEventListener:function(t,n,r){-1!==o.indexOf(t)?(i[t]||(i[t]=[]),i[t].push(n)):e.addEventListener(t,n,r)},clearEventHandlers:function(){o.forEach((function(t){var n=i[t];n&&n.length>0&&n.forEach((function(n){e.removeEventListener(t,n)}))}))},trigger:function(o,a){var u,f,l,d,p,h=i[o];if("canrecord"===o&&(d=e.videoWidth,p=e.videoHeight,t=null!==(f=r)&&void 0!==f&&f.size?d/p>1?r.size:Math.floor(d/p*r.size):d,n=null!==(l=r)&&void 0!==l&&l.size?d/p>1?Math.floor(p/d*r.size):r.size:p,c.x=t,c.y=n),h&&h.length>0)for(u=0;u<h.length;u++)h[u].apply(s,a)},setTopRight:function(e){a.x=e.x,a.y=e.y},getTopRight:function(){return a},setCanvasSize:function(e){c.x=e.x,c.y=e.y},getCanvasSize:function(){return c},getFrame:function(){return e}};return s},createLiveStream:function(e){e&&e.setAttribute("autoplay","true");var t=it.createVideoStream(e);return t.ended=function(){return!1},t},createImageStream:function(){var e,t,n=null,r=0,o=0,i=0,a=!0,c=!1,s=null,u=0,f=null,l=!1,d=["canrecord","ended"],p={},h={x:0,y:0,type:"Point"},v={x:0,y:0,type:"XYSize"};function m(e,t){var n,r=p[e];if(r&&r.length>0)for(n=0;n<r.length;n++)r[n].apply(g,t)}var g={trigger:m,getWidth:function(){return e},getHeight:function(){return t},setWidth:function(t){e=t},setHeight:function(e){t=e},getRealWidth:function(){return r},getRealHeight:function(){return o},setInputStream:function(a){var l;n=a,!1===a.sequence?(f=a.src,u=1):(f=a.src,u=a.length),c=!1,ot.load(f,(function(a){var u,f;if(s=a,a[0].tags&&a[0].tags.orientation)switch(a[0].tags.orientation){case 6:case 8:r=a[0].img.height,o=a[0].img.width;break;default:r=a[0].img.width,o=a[0].img.height}else r=a[0].img.width,o=a[0].img.height;e=null!==(u=n)&&void 0!==u&&u.size?r/o>1?n.size:Math.floor(r/o*n.size):r,t=null!==(f=n)&&void 0!==f&&f.size?r/o>1?Math.floor(o/r*n.size):n.size:o,v.x=e,v.y=t,c=!0,i=0,setTimeout((function(){m("canrecord",[])}),0)}),1,u,null===(l=n)||void 0===l?void 0:l.sequence)},ended:function(){return l},setAttribute:function(){},getConfig:function(){return n},pause:function(){a=!0},play:function(){a=!1},setCurrentTime:function(e){i=e},addEventListener:function(e,t){-1!==d.indexOf(e)&&(p[e]||(p[e]=[]),p[e].push(t))},clearEventHandlers:function(){Object.keys(p).forEach((function(e){return delete p[e]}))},setTopRight:function(e){h.x=e.x,h.y=e.y},getTopRight:function(){return h},setCanvasSize:function(e){v.x=e.x,v.y=e.y},getCanvasSize:function(){return v},getFrame:function(){var e,t;return c?(a||(e=null===(t=s)||void 0===t?void 0:t[i],i<u-1?i++:setTimeout((function(){l=!0,m("ended",[])}),0)),e):null}};return g}},at=it,ct=n(9),st=Math.PI/180,ut={create:function(e,t){var n,r={},o=e.getConfig(),i=(Object(ct.h)(e.getRealWidth(),e.getRealHeight()),e.getCanvasSize()),a=Object(ct.h)(e.getWidth(),e.getHeight()),c=e.getTopRight(),s=c.x,u=c.y,f=null,l=null;return(n=t||document.createElement("canvas")).width=i.x,n.height=i.y,f=n.getContext("2d"),l=new Uint8Array(a.x*a.y),r.attachData=function(e){l=e},r.getData=function(){return l},r.grab=function(){var t,r=o.halfSample,c=e.getFrame(),d=c,p=0;if(d){if(function(e,t){e.width!==t.x&&(e.width=t.x),e.height!==t.y&&(e.height=t.y)}(n,i),"ImageStream"===o.type&&(d=c.img,c.tags&&c.tags.orientation))switch(c.tags.orientation){case 6:p=90*st;break;case 8:p=-90*st}return 0!==p?(f.translate(i.x/2,i.y/2),f.rotate(p),f.drawImage(d,-i.y/2,-i.x/2,i.y,i.x),f.rotate(-p),f.translate(-i.x/2,-i.y/2)):f.drawImage(d,0,0,i.x,i.y),t=f.getImageData(s,u,a.x,a.y).data,r?Object(ct.e)(t,a,l):Object(ct.c)(t,l,o),!0}return!1},r.getSize=function(){return a},r}};function ft(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function lt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ft(Object(n),!0).forEach((function(t){P()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ft(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var dt=[];function pt(e){return lt(lt({},e),{},{inputStream:lt(lt({},e.inputStream),{},{target:null})})}function ht(e){if(e){var t=e().default;if(!t)return void self.postMessage({event:"error",message:"Quagga could not be created"})}var n;function r(e){self.postMessage({event:"processed",imageData:n.data,result:e},[n.data.buffer])}function o(){self.postMessage({event:"initialized",imageData:n.data},[n.data.buffer])}self.onmessage=function(e){if("init"===e.data.cmd){var i=e.data.config;i.numOfWorkers=0,n=new t.ImageWrapper({x:e.data.size.x,y:e.data.size.y},new Uint8Array(e.data.imageData)),t.init(i,o,n),t.onProcessed(r)}else"process"===e.data.cmd?(n.data=new Uint8Array(e.data.imageData),t.start()):"setReaders"===e.data.cmd?t.setReaders(e.data.readers):"registerReader"===e.data.cmd&&t.registerReader(e.data.name,e.data.reader)}}function vt(e,t,n){var r,o,i=("undefined"!=typeof __factorySource__&&(o=__factorySource__),r=new Blob(["("+ht.toString()+")("+o+");"],{type:"text/javascript"}),window.URL.createObjectURL(r)),a={worker:new Worker(i),imageData:new Uint8Array(t.getWidth()*t.getHeight()),busy:!0};a.worker.onmessage=function(e){"initialized"===e.data.event?(URL.revokeObjectURL(i),a.busy=!1,a.imageData=new Uint8Array(e.data.imageData),n(a)):"processed"===e.data.event?(a.imageData=new Uint8Array(e.data.imageData),a.busy=!1):e.data.event},a.worker.postMessage({cmd:"init",size:{x:t.getWidth(),y:t.getHeight()},imageData:a.imageData,config:pt(e)},[a.imageData.buffer])}function mt(e,t,n,r){var o=e-dt.length;if(0===o&&r)r();else if(o<0)dt.slice(o).forEach((function(e){e.worker.terminate()})),dt=dt.slice(0,o),r&&r();else{var i=function(t){dt.push(t),dt.length>=e&&r&&r()};if(t)for(var a=0;a<o;a++)vt(t,n,i)}}function gt(e,t,n){for(var r=e.length;r--;)e[r][0]+=t,e[r][1]+=n}var yt=function(){function e(){var t=this;m()(this,e),P()(this,"context",new We),P()(this,"canRecord",(function(e){var n;t.context.config&&(Je.a.checkImageConstraints(t.context.inputStream,null===(n=t.context.config)||void 0===n?void 0:n.locator),t.initCanvas(),t.context.framegrabber=ut.create(t.context.inputStream,t.context.canvasContainer.dom.image),void 0===t.context.config.numOfWorkers&&(t.context.config.numOfWorkers=0),mt(t.context.config.numOfWorkers,t.context.config,t.context.inputStream,(function(){var n;0===(null===(n=t.context.config)||void 0===n?void 0:n.numOfWorkers)&&t.initializeData(),t.ready(e)})))})),P()(this,"update",(function(){if(t.context.onUIThread){var e,n=(o=t.context.framegrabber,dt.length?!!(i=dt.filter((function(e){return!e.busy}))[0])&&(o.attachData(i.imageData),o.grab()&&(i.busy=!0,i.worker.postMessage({cmd:"process",imageData:i.imageData},[i.imageData.buffer])),!0):null);n||(t.context.framegrabber.attachData(null===(e=t.context.inputImageWrapper)||void 0===e?void 0:e.data),t.context.framegrabber.grab()&&(n||t.locateAndDecode()))}else{var r;t.context.framegrabber.attachData(null===(r=t.context.inputImageWrapper)||void 0===r?void 0:r.data),t.context.framegrabber.grab(),t.locateAndDecode()}var o,i}))}var t;return y()(e,[{key:"initBuffers",value:function(e){if(this.context.config){var t=function(e,t,n){var r=t||new s.a({x:e.getWidth(),y:e.getHeight(),type:"XYSize"}),o=[Object(Be.clone)([0,0]),Object(Be.clone)([0,r.size.y]),Object(Be.clone)([r.size.x,r.size.y]),Object(Be.clone)([r.size.x,0])];return Je.a.init(r,n),{inputImageWrapper:r,boxSize:o}}(this.context.inputStream,e,this.context.config.locator),n=t.inputImageWrapper,r=t.boxSize;this.context.inputImageWrapper=n,this.context.boxSize=r}}},{key:"initializeData",value:function(e){this.context.config&&(this.initBuffers(e),this.context.decoder=_e.create(this.context.config.decoder,this.context.inputImageWrapper))}},{key:"getViewPort",value:function(){return this.context.config&&this.context.config.inputStream?Xe(this.context.config.inputStream.target):null}},{key:"ready",value:function(e){this.context.inputStream.play(),e()}},{key:"initCanvas",value:function(){var e=function(e){var t,n,r,o,i=Xe(null==e||null===(t=e.config)||void 0===t||null===(n=t.inputStream)||void 0===n?void 0:n.target),a=null==e||null===(r=e.config)||void 0===r||null===(o=r.inputStream)||void 0===o?void 0:o.type;if(!a)return null;var c=function(e){if("undefined"!=typeof document){var t=He("canvas.imgBuffer","imgBuffer"),n=He("canvas.drawingBuffer","drawingBuffer");return t.canvas.width=n.canvas.width=e.x,t.canvas.height=n.canvas.height=e.y,{dom:{image:t.canvas,overlay:n.canvas},ctx:{image:t.context,overlay:n.context}}}return null}(e.inputStream.getCanvasSize());if(!c)return{dom:{image:null,overlay:null},ctx:{image:null,overlay:null}};var s=c.dom;return"undefined"!=typeof document&&i&&("ImageStream"!==a||i.contains(s.image)||i.appendChild(s.image),i.contains(s.overlay)||i.appendChild(s.overlay)),c}(this.context);if(e){var t=e.ctx,n=e.dom;this.context.canvasContainer.dom.image=n.image,this.context.canvasContainer.dom.overlay=n.overlay,this.context.canvasContainer.ctx.image=t.image,this.context.canvasContainer.ctx.overlay=t.overlay}}},{key:"initInputStream",value:function(e){if(this.context.config&&this.context.config.inputStream){var t=this.context.config.inputStream,n=t.type,r=t.constraints,o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"LiveStream",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;switch(e){case"VideoStream":var r=document.createElement("video");return{video:r,inputStream:n.createVideoStream(r)};case"ImageStream":return{inputStream:n.createImageStream()};case"LiveStream":var o=null;return t&&((o=t.querySelector("video"))||(o=document.createElement("video"),t.appendChild(o))),{video:o,inputStream:n.createLiveStream(o)};default:return console.error("* setupInputStream invalid type ".concat(e)),{video:null,inputStream:null}}}(n,this.getViewPort(),at),i=o.video,a=o.inputStream;"LiveStream"===n&&i&&Fe.request(i,r).then((function(){return a.trigger("canrecord")})).catch((function(t){return e(t)})),a.setAttribute("preload","auto"),a.setInputStream(this.context.config.inputStream),a.addEventListener("canrecord",this.canRecord.bind(void 0,e)),this.context.inputStream=a}}},{key:"getBoundingBoxes",value:function(){var e;return null!==(e=this.context.config)&&void 0!==e&&e.locate?Je.a.locate():[[Object(Be.clone)(this.context.boxSize[0]),Object(Be.clone)(this.context.boxSize[1]),Object(Be.clone)(this.context.boxSize[2]),Object(Be.clone)(this.context.boxSize[3])]]}},{key:"transformResult",value:function(e){var t=this,n=this.context.inputStream.getTopRight(),r=n.x,o=n.y;if((0!==r||0!==o)&&(e.barcodes&&e.barcodes.forEach((function(e){return t.transformResult(e)})),e.line&&2===e.line.length&&function(e,t,n){e[0].x+=t,e[0].y+=n,e[1].x+=t,e[1].y+=n}(e.line,r,o),e.box&&gt(e.box,r,o),e.boxes&&e.boxes.length>0))for(var i=0;i<e.boxes.length;i++)gt(e.boxes[i],r,o)}},{key:"addResult",value:function(e,t){var n=this;t&&this.context.resultCollector&&(e.barcodes?e.barcodes.filter((function(e){return e.codeResult})).forEach((function(e){return n.addResult(e,t)})):e.codeResult&&this.context.resultCollector.addResult(t,this.context.inputStream.getCanvasSize(),e.codeResult))}},{key:"hasCodeResult",value:function(e){return!(!e||!(e.barcodes?e.barcodes.some((function(e){return e.codeResult})):e.codeResult))}},{key:"publishResult",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0,n=e;e&&this.context.onUIThread&&(this.transformResult(e),this.addResult(e,t),n=e.barcodes||e),xe.publish("processed",n),this.hasCodeResult(e)&&xe.publish("detected",n)}},{key:"locateAndDecode",value:function(){var e=this.getBoundingBoxes();if(e){var t,n=this.context.decoder.decodeFromBoundingBoxes(e)||{};n.boxes=e,this.publishResult(n,null===(t=this.context.inputImageWrapper)||void 0===t?void 0:t.data)}else{var r,o=this.context.decoder.decodeFromImage(this.context.inputImageWrapper);o?this.publishResult(o,null===(r=this.context.inputImageWrapper)||void 0===r?void 0:r.data):this.publishResult()}}},{key:"startContinuousUpdate",value:function(){var e,t=this,n=null,r=1e3/((null===(e=this.context.config)||void 0===e?void 0:e.frequency)||60);this.context.stopped=!1;var o=this.context;!function e(i){n=n||i,o.stopped||(i>=n&&(n+=r,t.update()),window.requestAnimationFrame(e))}(performance.now())}},{key:"start",value:function(){var e,t;this.context.onUIThread&&"LiveStream"===(null===(e=this.context.config)||void 0===e||null===(t=e.inputStream)||void 0===t?void 0:t.type)?this.startContinuousUpdate():this.update()}},{key:"stop",value:(t=we()(Se.a.mark((function e(){var t;return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.context.stopped=!0,mt(0),null===(t=this.context.config)||void 0===t||!t.inputStream||"LiveStream"!==this.context.config.inputStream.type){e.next=6;break}return e.next=5,Fe.release();case 5:this.context.inputStream.clearEventHandlers();case 6:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"setReaders",value:function(e){this.context.decoder&&this.context.decoder.setReaders(e),function(e){dt.forEach((function(t){return t.worker.postMessage({cmd:"setReaders",readers:e})}))}(e)}},{key:"registerReader",value:function(e,t){_e.registerReader(e,t),this.context.decoder&&this.context.decoder.registerReader(e,t),function(e,t){dt.forEach((function(n){return n.worker.postMessage({cmd:"registerReader",name:e,reader:t})}))}(e,t)}}]),e}(),bt=new yt,_t=bt.context,xt={init:function(e,t,n){var r,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:bt;return t||(r=new Promise((function(e,n){t=function(t){t?n(t):e()}}))),o.context.config=c()({},Ge,e),o.context.config.numOfWorkers>0&&(o.context.config.numOfWorkers=0),n?(o.context.onUIThread=!1,o.initializeData(n),t&&t()):o.initInputStream(t),r},start:function(){return bt.start()},stop:function(){return bt.stop()},pause:function(){_t.stopped=!0},onDetected:function(e){e&&("function"==typeof e||"object"===i()(e)&&e.callback)?xe.subscribe("detected",e):console.trace("* warning: Quagga.onDetected called with invalid callback, ignoring")},offDetected:function(e){xe.unsubscribe("detected",e)},onProcessed:function(e){e&&("function"==typeof e||"object"===i()(e)&&e.callback)?xe.subscribe("processed",e):console.trace("* warning: Quagga.onProcessed called with invalid callback, ignoring")},offProcessed:function(e){xe.unsubscribe("processed",e)},setReaders:function(e){e?bt.setReaders(e):console.trace("* warning: Quagga.setReaders called with no readers, ignoring")},registerReader:function(e,t){e?t?bt.registerReader(e,t):console.trace("* warning: Quagga.registerReader called with no reader, ignoring"):console.trace("* warning: Quagga.registerReader called with no name, ignoring")},registerResultCollector:function(e){e&&"function"==typeof e.addResult&&(_t.resultCollector=e)},get canvas(){return _t.canvasContainer},decodeSingle:function(e,t){var n=this,r=new yt;return(e=c()({inputStream:{type:"ImageStream",sequence:!1,size:800,src:e.src},numOfWorkers:1,locator:{halfSample:!1}},e)).numOfWorkers>0&&(e.numOfWorkers=0),e.numOfWorkers>0&&("undefined"==typeof Blob||"undefined"==typeof Worker)&&(console.warn("* no Worker and/or Blob support - forcing numOfWorkers to 0"),e.numOfWorkers=0),new Promise((function(o,i){try{n.init(e,(function(){xe.once("processed",(function(e){r.stop(),t&&t.call(null,e),o(e)}),!0),r.start()}),null,r)}catch(e){i(e)}}))},get default(){return xt},Readers:r,CameraAccess:Fe,ImageDebug:h.a,ImageWrapper:s.a,ResultCollector:Ue};t.default=xt}]).default},xN7L:function(e,t,n){"use strict";n.r(t);var r={};n.r(r),n.d(r,"shimGetUserMedia",(function(){return k})),n.d(r,"shimGetDisplayMedia",(function(){return D})),n.d(r,"shimMediaStream",(function(){return M})),n.d(r,"shimOnTrack",(function(){return A})),n.d(r,"shimGetSendersWithDtmf",(function(){return j})),n.d(r,"shimGetStats",(function(){return I})),n.d(r,"shimSenderReceiverGetStats",(function(){return L})),n.d(r,"shimAddTrackRemoveTrackWithNative",(function(){return N})),n.d(r,"shimAddTrackRemoveTrack",(function(){return z})),n.d(r,"shimPeerConnection",(function(){return F})),n.d(r,"fixNegotiationNeeded",(function(){return U}));var o={};n.r(o),n.d(o,"shimGetUserMedia",(function(){return W})),n.d(o,"shimGetDisplayMedia",(function(){return V})),n.d(o,"shimPeerConnection",(function(){return q})),n.d(o,"shimReplaceTrack",(function(){return J}));var i={};n.r(i),n.d(i,"shimGetUserMedia",(function(){return X})),n.d(i,"shimGetDisplayMedia",(function(){return H})),n.d(i,"shimOnTrack",(function(){return $})),n.d(i,"shimPeerConnection",(function(){return Y})),n.d(i,"shimSenderGetStats",(function(){return Q})),n.d(i,"shimReceiverGetStats",(function(){return K})),n.d(i,"shimRemoveStream",(function(){return Z})),n.d(i,"shimRTCDataChannel",(function(){return ee})),n.d(i,"shimAddTransceiver",(function(){return te})),n.d(i,"shimGetParameters",(function(){return ne})),n.d(i,"shimCreateOffer",(function(){return re})),n.d(i,"shimCreateAnswer",(function(){return oe}));var a={};n.r(a),n.d(a,"shimLocalStreamsAPI",(function(){return ie})),n.d(a,"shimRemoteStreamsAPI",(function(){return ae})),n.d(a,"shimCallbacksAPI",(function(){return ce})),n.d(a,"shimGetUserMedia",(function(){return se})),n.d(a,"shimConstraints",(function(){return ue})),n.d(a,"shimRTCIceServerUrls",(function(){return fe})),n.d(a,"shimTrackEventTransceiver",(function(){return le})),n.d(a,"shimCreateOfferLegacy",(function(){return de})),n.d(a,"shimAudioContext",(function(){return pe}));var c={};function s(){var e={},t=!0,n=0;"[object Boolean]"===Object.prototype.toString.call(arguments[0])&&(t=arguments[0],n++);for(var r=function(n){for(var r in n)n.hasOwnProperty(r)&&(t&&"[object Object]"===Object.prototype.toString.call(n[r])?e[r]=s(e[r],n[r]):e[r]=n[r])};n<arguments.length;n++)r(arguments[n]);return e}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.r(c),n.d(c,"shimRTCIceCandidate",(function(){return me})),n.d(c,"shimMaxMessageSize",(function(){return ge})),n.d(c,"shimSendThrowTypeError",(function(){return ye})),n.d(c,"shimConnectionState",(function(){return be})),n.d(c,"removeExtmapAllowMixed",(function(){return _e})),n.d(c,"shimAddIceCandidateNullOrEmpty",(function(){return xe}));var f=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._defaults={insertPosition:e.BEFORE_BEGIN,level:null,message:null},this.options=s(this._defaults,n,!0),this.el=t||null,this.noticeInstance=null,this.init()}var t,n,r;return t=e,r=[{key:"BEFORE_BEGIN",get:function(){return"beforebegin"}},{key:"BEFORE_END",get:function(){return"beforeend"}},{key:"AFTER_BEGIN",get:function(){return"afterbegin"}},{key:"AFTER_END",get:function(){return"afterend"}}],(n=[{key:"init",value:function(){if(null===this.el)throw new Error("No valid Element was passed.");this.registerEvents()}},{key:"registerEvents",value:function(){var e=this;null!==this.noticeInstance&&this.noticeInstance.addEventListener("click",(function(t){return e.onClick(t)}))}},{key:"onClick",value:function(e){}},{key:"onClickCloseIcon",value:function(e){this.removeNotice()}},{key:"hide",value:function(e){e.style.display="none"}},{key:"show",value:function(e){e.style.display="block"}},{key:"toggle",value:function(e){"block"!==window.getComputedStyle(e).display?this.show(e):this.hide(e)}},{key:"addNotice",value:function(){var e=this.buildNotice();this.renderNotice(e),this.noticeInstance=e}},{key:"removeNotice",value:function(){this.el.parentElement.removeChild(this.noticeInstance),this.resetNoticeInstance()}},{key:"buildNotice",value:function(){var e=document.createElement("DIV");return e.classList.add("alert","alert-".concat(this.options.level)),e.innerText=this.options.message,e}},{key:"renderNotice",value:function(e){null===this.noticeInstance&&this.el.parentElement.insertBefore(e,this.el)}},{key:"resetNoticeInstance",value:function(){this.noticeInstance=null}}])&&u(t.prototype,n),r&&u(t,r),e}();function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var d=function(){function e(t,n,r,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._defaults={productId:0,productIsValid:!0,listening:!1,observableProperties:null},this.options=s(this._defaults,o,!0),this.el=r||null,this.productEditorNotice=t||null,this.attributeListener=n||null,this.observer=null,this.init()}var t,n,r;return t=e,r=[{key:"TOTAL_ATTRIBUTE",get:function(){return"data-total"}}],(n=[{key:"init",value:function(){if(null===this.el)throw new Error("No valid Element was passed.");if(null===this.productEditorNotice)throw new Error("No valid ProductEditorNotice was passed.");if(null===this.attributeListener)throw new Error("No valid AttributeListener was passed.");this.registerEvents()}},{key:"registerEvents",value:function(){var t=this;window.addEventListener("load",(function(){return t.onLoad()})),this.options.listening&&(this.attributeListener.init((function(n){n.forEach((function(n){n.type===t.attributeListener.options.observerType&&null!==n.attributeName&&(!n.attributeName in t.options.observableProperties||e.TOTAL_ATTRIBUTE===n.attributeName&&t.processDataTotal(n.target))}))}),this.el,{observe:this.options.listening,observableProperties:this.options.observableProperties}),this.attributeListener.observe())}},{key:"onLoad",value:function(){this.options.productIsValid?null!==this.productEditorNotice.noticeInstance&&this.productEditorNotice.noticeInstance.removeNotice():this.productEditorNotice.addNotice()}},{key:"processDataTotal",value:function(t){if(t.hasAttribute(e.TOTAL_ATTRIBUTE)){var n=t.getAttribute(e.TOTAL_ATTRIBUTE);if(0===parseInt(n))return this.options.productIsValid=!1,void(null===this.productEditorNotice.noticeInstance&&this.productEditorNotice.addNotice());null!==this.productEditorNotice.noticeInstance&&(this.options.productIsValid=!0,this.productEditorNotice.removeNotice())}}}])&&l(t.prototype,n),r&&l(t,r),e}();function p(){var e={},t=!0,n=0;"[object Boolean]"===Object.prototype.toString.call(arguments[0])&&(t=arguments[0],n++);for(var r=function(n){for(var r in n)n.hasOwnProperty(r)&&(t&&"[object Object]"===Object.prototype.toString.call(n[r])?e[r]=p(e[r],n[r]):e[r]=n[r])};n<arguments.length;n++)r(arguments[n]);return e}function h(e){return(h="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 v(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function m(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var g=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;v(this,e),this.options=null,this.el=t||null,this.config=n||{},this.callback=r||null,this.observer=null}var t,n,r;return t=e,r=[{key:"OBSERVER_TYPE",get:function(){return"attributes"}},{key:"DEFAULT_OPTIONS",get:function(){return{observe:!1,observableProperties:null,observerType:e.OBSERVER_TYPE}}},{key:"DEFAULT_CONFIG",get:function(){var t={};return t[e.OBSERVER_TYPE]=!0,t}}],(n=[{key:"validateProperties",value:function(){if(null===this.el)throw new Error("No valid Element was passed.");if((e=this.config).constructor===Object&&0===Object.keys(e).length)throw new Error("Your passed config is empty.");var e}},{key:"init",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(null===t||h(t)!==("undefined"==typeof Function?"undefined":h(Function)))throw new Error("No valid callback function was passed.");this.callback=t,this.options=p(e.DEFAULT_OPTIONS,r,!0),this.config=p(e.DEFAULT_CONFIG,o,!0),n&&(this.el=n||null),this.validateProperties(),this.options.observe&&(this.observer=new MutationObserver(t))}},{key:"observe",value:function(){if(null===this.observer)throw new Error("No Observer initialized");!1!==this.options.observable&&this.observer.observe(this.el,this.config)}},{key:"takeRecords",value:function(){return this.observer.takeRecords()}},{key:"disconnect",value:function(){this.observer.disconnect()}}])&&m(t.prototype,n),r&&m(t,r),e}();let y=!0,b=!0;function _(e,t,n){const r=e.match(t);return r&&r.length>=n&&parseInt(r[n],10)}function x(e,t,n){if(!e.RTCPeerConnection)return;const r=e.RTCPeerConnection.prototype,o=r.addEventListener;r.addEventListener=function(e,r){if(e!==t)return o.apply(this,arguments);const i=e=>{const t=n(e);t&&(r.handleEvent?r.handleEvent(t):r(t))};return this._eventMap=this._eventMap||{},this._eventMap[t]||(this._eventMap[t]=new Map),this._eventMap[t].set(r,i),o.apply(this,[e,i])};const i=r.removeEventListener;r.removeEventListener=function(e,n){if(e!==t||!this._eventMap||!this._eventMap[t])return i.apply(this,arguments);if(!this._eventMap[t].has(n))return i.apply(this,arguments);const r=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,i.apply(this,[e,r])},Object.defineProperty(r,"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 C(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(y=e,e?"adapter.js logging disabled":"adapter.js logging enabled")}function S(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(b=!e,"adapter.js deprecation warnings "+(e?"disabled":"enabled"))}function R(){if("object"==typeof window){if(y)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}}function w(e,t){b&&console.warn(e+" is deprecated, please use "+t+" instead.")}function T(e){return"[object Object]"===Object.prototype.toString.call(e)}function E(e){return T(e)?Object.keys(e).reduce((function(t,n){const r=T(e[n]),o=r?E(e[n]):e[n],i=r&&!Object.keys(o).length;return void 0===o||i?t:Object.assign(t,{[n]:o})}),{}):e}function P(e,t,n){const r=n?"outbound-rtp":"inbound-rtp",o=new Map;if(null===t)return o;const i=[];return e.forEach(e=>{"track"===e.type&&e.trackIdentifier===t.id&&i.push(e)}),i.forEach(t=>{e.forEach(n=>{n.type===r&&n.trackId===t.id&&function e(t,n,r){n&&!r.has(n.id)&&(r.set(n.id,n),Object.keys(n).forEach(o=>{o.endsWith("Id")?e(t,t.get(n[o]),r):o.endsWith("Ids")&&n[o].forEach(n=>{e(t,t.get(n),r)})}))}(e,n,o)})}),o}const O=R;function k(e,t){const n=e&&e.navigator;if(!n.mediaDevices)return;const r=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 r="object"==typeof e[n]?e[n]:{ideal:e[n]};void 0!==r.exact&&"number"==typeof r.exact&&(r.min=r.max=r.exact);const o=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):"deviceId"===t?"sourceId":t};if(void 0!==r.ideal){t.optional=t.optional||[];let e={};"number"==typeof r.ideal?(e[o("min",n)]=r.ideal,t.optional.push(e),e={},e[o("max",n)]=r.ideal,t.optional.push(e)):(e[o("",n)]=r.ideal,t.optional.push(e))}void 0!==r.exact&&"number"!=typeof r.exact?(t.mandatory=t.mandatory||{},t.mandatory[o("",n)]=r.exact):["min","max"].forEach(e=>{void 0!==r[e]&&(t.mandatory=t.mandatory||{},t.mandatory[o(e,n)]=r[e])})}),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},o=function(e,o){if(t.version>=61)return o(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=r(e.audio)}if(e&&"object"==typeof e.video){let i=e.video.facingMode;i=i&&("object"==typeof i?i:{ideal:i});const a=t.version<66;if(i&&("user"===i.exact||"environment"===i.exact||"user"===i.ideal||"environment"===i.ideal)&&(!n.mediaDevices.getSupportedConstraints||!n.mediaDevices.getSupportedConstraints().facingMode||a)){let t;if(delete e.video.facingMode,"environment"===i.exact||"environment"===i.ideal?t=["back","rear"]:"user"!==i.exact&&"user"!==i.ideal||(t=["front"]),t)return n.mediaDevices.enumerateDevices().then(n=>{let a=(n=n.filter(e=>"videoinput"===e.kind)).find(e=>t.some(t=>e.label.toLowerCase().includes(t)));return!a&&n.length&&t.includes("back")&&(a=n[n.length-1]),a&&(e.video.deviceId=i.exact?{exact:a.deviceId}:{ideal:a.deviceId}),e.video=r(e.video),O("chrome: "+JSON.stringify(e)),o(e)})}e.video=r(e.video)}return O("chrome: "+JSON.stringify(e)),o(e)},i=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,r){o(e,e=>{n.webkitGetUserMedia(e,t,e=>{r&&r(i(e))})})}.bind(n),n.mediaDevices.getUserMedia){const e=n.mediaDevices.getUserMedia.bind(n.mediaDevices);n.mediaDevices.getUserMedia=function(t){return o(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(i(e))))}}}function D(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 r=n.video&&n.video.width,o=n.video&&n.video.height,i=n.video&&n.video.frameRate;return n.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:t,maxFrameRate:i||3}},r&&(n.video.mandatory.maxWidth=r),o&&(n.video.mandatory.maxHeight=o),e.navigator.mediaDevices.getUserMedia(n)})}:console.error("shimGetDisplayMedia: getSourceId argument is not a function"))}function M(e){e.MediaStream=e.MediaStream||e.webkitMediaStream}function A(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 r;r=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find(e=>e.track&&e.track.id===n.track.id):{track:n.track};const o=new Event("track");o.track=n.track,o.receiver=r,o.transceiver={receiver:r},o.streams=[t.stream],this.dispatchEvent(o)}),t.stream.getTracks().forEach(n=>{let r;r=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find(e=>e.track&&e.track.id===n.id):{track:n};const o=new Event("track");o.track=n,o.receiver=r,o.transceiver={receiver:r},o.streams=[t.stream],this.dispatchEvent(o)})},this.addEventListener("addstream",this._ontrackpoly)),t.apply(this,arguments)}}else x(e,"track",e=>(e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e))}function j(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,r){let o=n.apply(this,arguments);return o||(o=t(this,e),this._senders.push(o)),o};const r=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){r.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 r=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){this._senders=this._senders||[],r.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 I(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,n,r]=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 o=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},i=function(e){return new Map(Object.keys(e).map(t=>[t,e[t]]))};if(arguments.length>=2){const r=function(e){n(i(o(e)))};return t.apply(this,[r,e])}return new Promise((e,n)=>{t.apply(this,[function(t){e(i(o(t)))},n])}).then(n,r)}}function L(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=>P(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}),x(e,"track",e=>(e.receiver._pc=e.srcElement,e)),e.RTCRtpReceiver.prototype.getStats=function(){const e=this;return this._pc.getStats().then(t=>P(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,r;return this.getSenders().forEach(n=>{n.track===e&&(t?r=!0:t=n)}),this.getReceivers().forEach(t=>(t.track===e&&(n?r=!0:n=t),t.track===e)),r||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 N(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 r=t.apply(this,arguments);return this._shimmedLocalStreams[n.id]?-1===this._shimmedLocalStreams[n.id].indexOf(r)&&this._shimmedLocalStreams[n.id].push(r):this._shimmedLocalStreams[n.id]=[n,r],r};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 r=this.getSenders().filter(e=>-1===t.indexOf(e));this._shimmedLocalStreams[e.id]=[e].concat(r)};const r=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[e.id],r.apply(this,arguments)};const o=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]}),o.apply(this,arguments)}}function z(e,t){if(!e.RTCPeerConnection)return;if(e.RTCPeerConnection.prototype.addTrack&&t.version>=65)return N(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 r=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}r.apply(this,[t])};const o=e.RTCPeerConnection.prototype.removeStream;function i(e,t){let n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach(t=>{const r=e._reverseStreams[t],o=e._streams[r.id];n=n.replace(new RegExp(o.id,"g"),r.id)}),new RTCSessionDescription({type:t.type,sdp:n})}function a(e,t){let n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach(t=>{const r=e._reverseStreams[t],o=e._streams[r.id];n=n.replace(new RegExp(r.id,"g"),o.id)}),new RTCSessionDescription({type:t.type,sdp:n})}e.RTCPeerConnection.prototype.removeStream=function(e){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},o.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 r=[].slice.call(arguments,1);if(1!==r.length||!r[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 o=this.getSenders().find(e=>e.track===t);if(o)throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const i=this._streams[n.id];if(i)i.addTrack(t),Promise.resolve().then(()=>{this.dispatchEvent(new Event("negotiationneeded"))});else{const r=new e.MediaStream([t]);this._streams[n.id]=r,this._reverseStreams[r.id]=n,this.addStream(r)}return this.getSenders().find(e=>e.track===t)},["createOffer","createAnswer"].forEach((function(t){const n=e.RTCPeerConnection.prototype[t],r={[t](){const e=arguments;return arguments.length&&"function"==typeof arguments[0]?n.apply(this,[t=>{const n=i(this,t);e[0].apply(null,[n])},t=>{e[1]&&e[1].apply(null,t)},arguments[2]]):n.apply(this,arguments).then(e=>i(this,e))}};e.RTCPeerConnection.prototype[t]=r[t]}));const c=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=a(this,arguments[0]),c.apply(this,arguments)):c.apply(this,arguments)};const s=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get(){const e=s.get.apply(this);return""===e.type?e:i(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 F(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],r={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=r[t]}))}function U(e,t){x(e,"negotiationneeded",e=>{const n=e.target;if(!(t.version<72||n.getConfiguration&&"plan-b"===n.getConfiguration().sdpSemantics)||"stable"===n.signalingState)return e})}var G=n("8D0k"),B=n.n(G);function W(e){const t=e&&e.navigator,n=t.mediaDevices.getUserMedia.bind(t.mediaDevices);t.mediaDevices.getUserMedia=function(e){return n(e).catch(e=>Promise.reject(function(e){return{name:{PermissionDeniedError:"NotAllowedError"}[e.name]||e.name,message:e.message,constraint:e.constraint,toString(){return this.name}}}(e)))}}function V(e){"getDisplayMedia"in e.navigator&&e.navigator.mediaDevices&&(e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||(e.navigator.mediaDevices.getDisplayMedia=e.navigator.getDisplayMedia.bind(e.navigator)))}function q(e,t){if(e.RTCIceGatherer&&(e.RTCIceCandidate||(e.RTCIceCandidate=function(e){return e}),e.RTCSessionDescription||(e.RTCSessionDescription=function(e){return e}),t.version<15025)){const t=Object.getOwnPropertyDescriptor(e.MediaStreamTrack.prototype,"enabled");Object.defineProperty(e.MediaStreamTrack.prototype,"enabled",{set(e){t.set.call(this,e);const n=new Event("enabled");n.enabled=e,this.dispatchEvent(n)}})}e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)&&Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=new e.RTCDtmfSender(this):"video"===this.track.kind&&(this._dtmf=null)),this._dtmf}}),e.RTCDtmfSender&&!e.RTCDTMFSender&&(e.RTCDTMFSender=e.RTCDtmfSender);const n=B()(e,t.version);e.RTCPeerConnection=function(e){return e&&e.iceServers&&(e.iceServers=function(e,t){let n=!1;return(e=JSON.parse(JSON.stringify(e))).filter(e=>{if(e&&(e.urls||e.url)){let t=e.urls||e.url;e.url&&!e.urls&&w("RTCIceServer.url","RTCIceServer.urls");const r="string"==typeof t;return r&&(t=[t]),t=t.filter(e=>{if(0===e.indexOf("stun:"))return!1;const t=e.startsWith("turn")&&!e.startsWith("turn:[")&&e.includes("transport=udp");return t&&!n?(n=!0,!0):t&&!n}),delete e.url,e.urls=r?t[0]:t,!!t.length}})}(e.iceServers,t.version),R("ICE servers after filtering:",e.iceServers)),new n(e)},e.RTCPeerConnection.prototype=n.prototype}function J(e){e.RTCRtpSender&&!("replaceTrack"in e.RTCRtpSender.prototype)&&(e.RTCRtpSender.prototype.replaceTrack=e.RTCRtpSender.prototype.setTrack)}function X(e,t){const n=e&&e.navigator,r=e&&e.MediaStreamTrack;if(n.getUserMedia=function(e,t,r){w("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),n.mediaDevices.getUserMedia(e).then(t,r)},!(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)},r&&r.prototype.getSettings){const t=r.prototype.getSettings;r.prototype.getSettings=function(){const n=t.apply(this,arguments);return e(n,"mozAutoGainControl","autoGainControl"),e(n,"mozNoiseSuppression","noiseSuppression"),n}}if(r&&r.prototype.applyConstraints){const t=r.prototype.applyConstraints;r.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 H(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 $(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 Y(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],r={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=r[t]}));const n={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},r=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,o,i]=arguments;return r.apply(this,[e||null]).then(e=>{if(t.version<53&&!o)try{e.forEach(e=>{e.type=n[e.type]||e.type})}catch(t){if("TypeError"!==t.name)throw t;e.forEach((t,r)=>{e.set(r,Object.assign({},t,{type:n[t.type]||t.type}))})}return e}).then(o,i)}}function Q(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}),x(e,"track",e=>(e.receiver._pc=e.srcElement,e)),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function Z(e){e.RTCPeerConnection&&!("removeStream"in e.RTCPeerConnection.prototype)&&(e.RTCPeerConnection.prototype.removeStream=function(e){w("removeStream","removeTrack"),this.getSenders().forEach(t=>{t.track&&e.getTracks().includes(t.track)&&this.removeTrack(t)})})}function ee(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)}function te(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 r=t.apply(this,arguments);if(n){const{sender:t}=r,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 r})}function ne(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 re(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 oe(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 ie(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 ae(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 ce(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype,n=t.createOffer,r=t.createAnswer,o=t.setLocalDescription,i=t.setRemoteDescription,a=t.addIceCandidate;t.createOffer=function(e,t){const r=arguments.length>=2?arguments[2]:arguments[0],o=n.apply(this,[r]);return t?(o.then(e,t),Promise.resolve()):o},t.createAnswer=function(e,t){const n=arguments.length>=2?arguments[2]:arguments[0],o=r.apply(this,[n]);return t?(o.then(e,t),Promise.resolve()):o};let c=function(e,t,n){const r=o.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r};t.setLocalDescription=c,c=function(e,t,n){const r=i.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r},t.setRemoteDescription=c,c=function(e,t,n){const r=a.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r},t.addIceCandidate=c}function se(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(ue(e))}!t.getUserMedia&&t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,n,r){t.mediaDevices.getUserMedia(e).then(n,r)}.bind(t))}function ue(e){return e&&void 0!==e.video?Object.assign({},e,{video:E(e.video)}):e}function fe(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 r=e.iceServers[n];!r.hasOwnProperty("urls")&&r.hasOwnProperty("url")?(w("RTCIceServer.url","RTCIceServer.urls"),r=JSON.parse(JSON.stringify(r)),r.urls=r.url,delete r.url,t.push(r)):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 le(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 de(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 pe(e){"object"!=typeof e||e.AudioContext||(e.AudioContext=e.webkitAudioContext)}var he=n("KCt4"),ve=n.n(he);function me(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),r=ve.a.parseCandidate(e.candidate),o=Object.assign(n,r);return o.toJSON=function(){return{candidate:o.candidate,sdpMid:o.sdpMid,sdpMLineIndex:o.sdpMLineIndex,usernameFragment:o.usernameFragment}},o}return new t(e)},e.RTCIceCandidate.prototype=t.prototype,x(e,"icecandidate",t=>(t.candidate&&Object.defineProperty(t,"candidate",{value:new e.RTCIceCandidate(t.candidate),writable:"false"}),t))}function ge(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=ve.a.splitSections(e.sdp);return t.shift(),t.some(e=>{const t=ve.a.parseMLine(e);return t&&"application"===t.kind&&-1!==t.protocol.indexOf("SCTP")})},r=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},o=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},i=function(e,n){let r=65536;"firefox"===t.browser&&57===t.version&&(r=65535);const o=ve.a.matchPrefix(e.sdp,"a=max-message-size:");return o.length>0?r=parseInt(o[0].substr(19),10):"firefox"===t.browser&&-1!==n&&(r=2147483637),r},a=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=r(arguments[0]),t=o(e),n=i(arguments[0],e);let a;a=0===t&&0===n?Number.POSITIVE_INFINITY:0===t||0===n?Math.max(t,n):Math.min(t,n);const c={};Object.defineProperty(c,"maxMessageSize",{get:()=>a}),this._sctp=c}return a.apply(this,arguments)}}function ye(e){if(!e.RTCPeerConnection||!("createDataChannel"in e.RTCPeerConnection.prototype))return;function t(e,t){const n=e.send;e.send=function(){const r=arguments[0],o=r.length||r.size||r.byteLength;if("open"===e.readyState&&t.sctp&&o>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},x(e,"datachannel",e=>(t(e.channel,e.target),e))}function be(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 _e(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 xe(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())})}!function({window:e}={},t={shimChrome:!0,shimFirefox:!0,shimEdge:!0,shimSafari:!0}){const n=R,s=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=_(n.userAgent,/Firefox\/(\d+)\./,1);else if(n.webkitGetUserMedia||!1===e.isSecureContext&&e.webkitRTCPeerConnection&&!e.RTCIceGatherer)t.browser="chrome",t.version=_(n.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(n.mediaDevices&&n.userAgent.match(/Edge\/(\d+).(\d+)$/))t.browser="edge",t.version=_(n.userAgent,/Edge\/(\d+).(\d+)$/,2);else{if(!e.RTCPeerConnection||!n.userAgent.match(/AppleWebKit\/(\d+)\./))return t.browser="Not a supported browser.",t;t.browser="safari",t.version=_(n.userAgent,/AppleWebKit\/(\d+)\./,1),t.supportsUnifiedPlan=e.RTCRtpTransceiver&&"currentDirection"in e.RTCRtpTransceiver.prototype}return t}(e),u={browserDetails:s,commonShim:c,extractVersion:_,disableLog:C,disableWarnings:S};switch(s.browser){case"chrome":if(!r||!F||!t.shimChrome)return n("Chrome shim is not included in this adapter release."),u;if(null===s.version)return n("Chrome shim can not determine version, not shimming."),u;n("adapter.js shimming chrome."),u.browserShim=r,xe(e,s),k(e,s),M(e),F(e,s),A(e),z(e,s),j(e),I(e),L(e),U(e,s),me(e),be(e),ge(e,s),ye(e),_e(e,s);break;case"firefox":if(!i||!Y||!t.shimFirefox)return n("Firefox shim is not included in this adapter release."),u;n("adapter.js shimming firefox."),u.browserShim=i,xe(e,s),X(e,s),Y(e,s),$(e),Z(e),Q(e),K(e),ee(e),te(e),ne(e),re(e),oe(e),me(e),be(e),ge(e,s),ye(e);break;case"edge":if(!o||!q||!t.shimEdge)return n("MS edge shim is not included in this adapter release."),u;n("adapter.js shimming edge."),u.browserShim=o,W(e),V(e),q(e,s),J(e),ge(e,s),ye(e);break;case"safari":if(!a||!t.shimSafari)return n("Safari shim is not included in this adapter release."),u;n("adapter.js shimming safari."),u.browserShim=a,xe(e,s),fe(e),de(e),ce(e),ie(e),ae(e),le(e),se(e),pe(e),me(e),ge(e,s),ye(e),_e(e,s);break;default:n("Unsupported browser!")}}({window:"undefined"==typeof window?void 0:window});var Ce=n("viyd"),Se=n.n(Ce);function Re(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function we(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Re(Object(n),!0).forEach((function(t){Te(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Re(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Te(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ee(e,t,n,r,o,i,a){try{var c=e[i](a),s=c.value}catch(e){return void n(e)}c.done?t(s):Promise.resolve(s).then(r,o)}function Pe(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Ee(i,r,o,a,c,"next",e)}function c(e){Ee(i,r,o,a,c,"throw",e)}a(void 0)}))}}function Oe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var ke=function(){function e(t,n,r){var o=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.root=t,this.successCallback=n;var i={settingsChangedCallback:null,errorCallback:null,viewport:t.querySelector(".zettle-barcode-scanner-viewport"),barcodeTypeSelect:t.querySelector('select[name="barcode_type"]'),cameraSelect:t.querySelector('select[name="camera"]'),streamSettings:{constraints:{width:640,height:480}}};this.options=p(i,r,!0),this.started=!1,this.lastSettings=null,t.querySelectorAll("select").forEach((function(e){e.addEventListener("change",(function(){var e=o.getSettings();o.options.settingsChangedCallback&&o.options.settingsChangedCallback(e,o),o.lastSettings=e,o.started&&o.restart()}))}))}var t,n,r,o;return t=e,(n=[{key:"start",value:function(){var e=this;Se.a.init(this._getQuaggaConfig(this.getSettings()),function(){var t=Pe(regeneratorRuntime.mark((function t(n){var r,o,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!n){t.next=5;break}return console.log(n),e.options.errorCallback&&e.options.errorCallback(n,e),e.stop(),t.abrupt("return");case 5:return t.next=7,e._fillCameraSelect(e.options.cameraSelect);case 7:(i=null===(r=Se.a.CameraAccess.getActiveTrack())||void 0===r||null===(o=r.getSettings())||void 0===o?void 0:o.deviceId)&&(e.options.cameraSelect.value=i),Se.a.start(),Se.a.onDetected((function(t){e.started&&e.successCallback(t.codeResult.code,e)})),e.started=!0;case 12:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}},{key:"stop",value:function(){Se.a.offDetected(),Se.a.stop(),this.started=!1}},{key:"restart",value:function(){this.stop(),this.start()}},{key:"getSettings",value:function(){return{barcodeType:this.options.barcodeTypeSelect.value,cameraDeviceId:this.options.cameraSelect.value}}},{key:"updateSettingsUi",value:function(e){e.barcodeType&&(this.options.barcodeTypeSelect.value=e.barcodeType),this.lastSettings=e}},{key:"_getQuaggaConfig",value:function(e){var t,n=e.barcodeType.split(",").map(this._getQuaggaReader);return{inputStream:{name:"Live",type:"LiveStream",target:this.options.viewport,constraints:we(we({},this.options.streamSettings.constraints),null!==(t=this.lastSettings)&&void 0!==t&&t.cameraDeviceId?{deviceId:this.lastSettings.cameraDeviceId}:{})},decoder:{readers:n}}}},{key:"_getQuaggaReader",value:function(e){return"ean_extended"===e?{format:"ean_reader",config:{supplements:["ean_5_reader","ean_2_reader"]}}:{format:"".concat(e,"_reader"),config:{}}}},{key:"_fillCameraSelect",value:(o=Pe(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.length=0,e.next=3,Se.a.CameraAccess.enumerateVideoDevices();case 3:e.sent.forEach((function(e){var n=document.createElement("option");n.value=e.deviceId,n.appendChild(document.createTextNode(e.label)),t.appendChild(n)}));case 5:case"end":return e.stop()}}),e)}))),function(e){return o.apply(this,arguments)})}])&&Oe(t.prototype,n),r&&Oe(t,r),e}(),De=n("je13"),Me=n.n(De),Ae=document.querySelector("#woocommerce-product-data"),je=document.querySelector(".woocommerce_variations");if(je){if(!zettleProductEditorNotice||!zettleProductEditorValidator)throw new Error("Nothing found to validate.");new d(new f(Ae,{level:zettleProductEditorNotice.level,message:zettleProductEditorNotice.message}),new g,je,{productId:zettleProductEditorValidator.productId,productIsValid:zettleProductEditorValidator.productIsValid,listening:!0,observableProperties:["data-total"]})}var Ie=[],Le=function(e){if(!e.getAttribute("data-initialized")){var t=e.parentElement.querySelector(".zettle-barcode-input-field"),n=t.querySelector("input"),r=new ke(e,(function(t,r){n.value=t,r.stop(),e.style.display="none"}),{errorCallback:function(t){alert(zettleBarcodeScanning.initErrorMessage),e.style.display="none"},settingsChangedCallback:function(e){Me.a.set("zettleBarcodeScanningSettings",e)}});Ie.push(r),t.querySelector("button").addEventListener("click",(function(){var t="block"===e.style.display;if(document.querySelectorAll(".zettle-barcode-scan").forEach((function(e){e.style.display="none"})),Ie.forEach((function(e){return e.stop()})),!t){var n=Me.a.get("zettleBarcodeScanningSettings");n&&r.updateSettingsUi(n),e.style.display="block",r.start()}})),e.setAttribute("data-initialized","true")}};if(je){var Ne=new g;Ne.init((function(e){document.querySelectorAll(".zettle-barcode-scan").forEach(Le)}),je,{observe:!0,observableProperties:["data-total"]}),Ne.observe()}else Le(document.querySelector(".zettle-barcode-scan"))},yLpj: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},ynwM:function(e,t,n){var r=n("MFOe").Global;e.exports={name:"oldFF-globalStorage",read:function(e){return o[e]},write:function(e,t){o[e]=t},each:i,remove:function(e){return o.removeItem(e)},clearAll:function(){i((function(e,t){delete o[e]}))}};var o=r.globalStorage;function i(e){for(var t=o.length-1;t>=0;t--){var n=o.key(t);e(o[n],n)}}}});
  • zettle-pos-integration/trunk/readme.txt

    r2557575 r2560431  
    55Tested up to: 5.7
    66Requires PHP: 7.2
    7 Stable tag: 1.4.1
     7Stable tag: 1.4.2
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    6868== Changelog ==
    6969
     70= 1.4.2 =
     71- Send `taxExempt` only for sales tax.
     72
    7073= 1.4.1 =
    7174- Add US signup link.
  • zettle-pos-integration/trunk/vendor/autoload.php

    r2538456 r2560431  
    55require_once __DIR__ . '/composer/autoload_real.php';
    66
    7 return ComposerAutoloaderInit8d2b052c557977d79e970d97de9f56b5::getLoader();
     7return ComposerAutoloaderInit422cb043b3f00b30a2926f299cdfdf1b::getLoader();
  • zettle-pos-integration/trunk/vendor/composer/autoload_classmap.php

    r2532865 r2560431  
    11091109    'Symfony\\Component\\Uid\\AbstractUid' => $vendorDir . '/symfony/uid/AbstractUid.php',
    11101110    'Symfony\\Component\\Uid\\BinaryUtil' => $vendorDir . '/symfony/uid/BinaryUtil.php',
     1111    'Symfony\\Component\\Uid\\Command\\GenerateUlidCommand' => $vendorDir . '/symfony/uid/Command/GenerateUlidCommand.php',
     1112    'Symfony\\Component\\Uid\\Command\\GenerateUuidCommand' => $vendorDir . '/symfony/uid/Command/GenerateUuidCommand.php',
     1113    'Symfony\\Component\\Uid\\Command\\InspectUlidCommand' => $vendorDir . '/symfony/uid/Command/InspectUlidCommand.php',
     1114    'Symfony\\Component\\Uid\\Command\\InspectUuidCommand' => $vendorDir . '/symfony/uid/Command/InspectUuidCommand.php',
     1115    'Symfony\\Component\\Uid\\Factory\\NameBasedUuidFactory' => $vendorDir . '/symfony/uid/Factory/NameBasedUuidFactory.php',
     1116    'Symfony\\Component\\Uid\\Factory\\RandomBasedUuidFactory' => $vendorDir . '/symfony/uid/Factory/RandomBasedUuidFactory.php',
     1117    'Symfony\\Component\\Uid\\Factory\\TimeBasedUuidFactory' => $vendorDir . '/symfony/uid/Factory/TimeBasedUuidFactory.php',
     1118    'Symfony\\Component\\Uid\\Factory\\UlidFactory' => $vendorDir . '/symfony/uid/Factory/UlidFactory.php',
     1119    'Symfony\\Component\\Uid\\Factory\\UuidFactory' => $vendorDir . '/symfony/uid/Factory/UuidFactory.php',
    11111120    'Symfony\\Component\\Uid\\NilUuid' => $vendorDir . '/symfony/uid/NilUuid.php',
    11121121    'Symfony\\Component\\Uid\\Ulid' => $vendorDir . '/symfony/uid/Ulid.php',
  • zettle-pos-integration/trunk/vendor/composer/autoload_real.php

    r2538456 r2560431  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInit8d2b052c557977d79e970d97de9f56b5
     5class ComposerAutoloaderInit422cb043b3f00b30a2926f299cdfdf1b
    66{
    77    private static $loader;
     
    2323        }
    2424
    25         spl_autoload_register(array('ComposerAutoloaderInit8d2b052c557977d79e970d97de9f56b5', 'loadClassLoader'), true, true);
     25        spl_autoload_register(array('ComposerAutoloaderInit422cb043b3f00b30a2926f299cdfdf1b', 'loadClassLoader'), true, true);
    2626        self::$loader = $loader = new \Composer\Autoload\ClassLoader();
    27         spl_autoload_unregister(array('ComposerAutoloaderInit8d2b052c557977d79e970d97de9f56b5', 'loadClassLoader'));
     27        spl_autoload_unregister(array('ComposerAutoloaderInit422cb043b3f00b30a2926f299cdfdf1b', 'loadClassLoader'));
    2828
    2929        $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
     
    3131            require_once __DIR__ . '/autoload_static.php';
    3232
    33             call_user_func(\Composer\Autoload\ComposerStaticInit8d2b052c557977d79e970d97de9f56b5::getInitializer($loader));
     33            call_user_func(\Composer\Autoload\ComposerStaticInit422cb043b3f00b30a2926f299cdfdf1b::getInitializer($loader));
    3434        } else {
    3535            $classMap = require __DIR__ . '/autoload_classmap.php';
     
    4343
    4444        if ($useStaticLoader) {
    45             $includeFiles = Composer\Autoload\ComposerStaticInit8d2b052c557977d79e970d97de9f56b5::$files;
     45            $includeFiles = Composer\Autoload\ComposerStaticInit422cb043b3f00b30a2926f299cdfdf1b::$files;
    4646        } else {
    4747            $includeFiles = require __DIR__ . '/autoload_files.php';
    4848        }
    4949        foreach ($includeFiles as $fileIdentifier => $file) {
    50             composerRequire8d2b052c557977d79e970d97de9f56b5($fileIdentifier, $file);
     50            composerRequire422cb043b3f00b30a2926f299cdfdf1b($fileIdentifier, $file);
    5151        }
    5252
     
    5555}
    5656
    57 function composerRequire8d2b052c557977d79e970d97de9f56b5($fileIdentifier, $file)
     57function composerRequire422cb043b3f00b30a2926f299cdfdf1b($fileIdentifier, $file)
    5858{
    5959    if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
  • zettle-pos-integration/trunk/vendor/composer/autoload_static.php

    r2538456 r2560431  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInit8d2b052c557977d79e970d97de9f56b5
     7class ComposerStaticInit422cb043b3f00b30a2926f299cdfdf1b
    88{
    99    public static $files = array (
     
    14261426        'Symfony\\Component\\Uid\\AbstractUid' => __DIR__ . '/..' . '/symfony/uid/AbstractUid.php',
    14271427        'Symfony\\Component\\Uid\\BinaryUtil' => __DIR__ . '/..' . '/symfony/uid/BinaryUtil.php',
     1428        'Symfony\\Component\\Uid\\Command\\GenerateUlidCommand' => __DIR__ . '/..' . '/symfony/uid/Command/GenerateUlidCommand.php',
     1429        'Symfony\\Component\\Uid\\Command\\GenerateUuidCommand' => __DIR__ . '/..' . '/symfony/uid/Command/GenerateUuidCommand.php',
     1430        'Symfony\\Component\\Uid\\Command\\InspectUlidCommand' => __DIR__ . '/..' . '/symfony/uid/Command/InspectUlidCommand.php',
     1431        'Symfony\\Component\\Uid\\Command\\InspectUuidCommand' => __DIR__ . '/..' . '/symfony/uid/Command/InspectUuidCommand.php',
     1432        'Symfony\\Component\\Uid\\Factory\\NameBasedUuidFactory' => __DIR__ . '/..' . '/symfony/uid/Factory/NameBasedUuidFactory.php',
     1433        'Symfony\\Component\\Uid\\Factory\\RandomBasedUuidFactory' => __DIR__ . '/..' . '/symfony/uid/Factory/RandomBasedUuidFactory.php',
     1434        'Symfony\\Component\\Uid\\Factory\\TimeBasedUuidFactory' => __DIR__ . '/..' . '/symfony/uid/Factory/TimeBasedUuidFactory.php',
     1435        'Symfony\\Component\\Uid\\Factory\\UlidFactory' => __DIR__ . '/..' . '/symfony/uid/Factory/UlidFactory.php',
     1436        'Symfony\\Component\\Uid\\Factory\\UuidFactory' => __DIR__ . '/..' . '/symfony/uid/Factory/UuidFactory.php',
    14281437        'Symfony\\Component\\Uid\\NilUuid' => __DIR__ . '/..' . '/symfony/uid/NilUuid.php',
    14291438        'Symfony\\Component\\Uid\\Ulid' => __DIR__ . '/..' . '/symfony/uid/Ulid.php',
     
    14461455    {
    14471456        return \Closure::bind(function () use ($loader) {
    1448             $loader->prefixLengthsPsr4 = ComposerStaticInit8d2b052c557977d79e970d97de9f56b5::$prefixLengthsPsr4;
    1449             $loader->prefixDirsPsr4 = ComposerStaticInit8d2b052c557977d79e970d97de9f56b5::$prefixDirsPsr4;
    1450             $loader->classMap = ComposerStaticInit8d2b052c557977d79e970d97de9f56b5::$classMap;
     1457            $loader->prefixLengthsPsr4 = ComposerStaticInit422cb043b3f00b30a2926f299cdfdf1b::$prefixLengthsPsr4;
     1458            $loader->prefixDirsPsr4 = ComposerStaticInit422cb043b3f00b30a2926f299cdfdf1b::$prefixDirsPsr4;
     1459            $loader->classMap = ComposerStaticInit422cb043b3f00b30a2926f299cdfdf1b::$classMap;
    14511460
    14521461        }, null, ClassLoader::class);
  • zettle-pos-integration/trunk/vendor/composer/installed.json

    r2538456 r2560431  
    729729    {
    730730        "name": "inpsyde/inpsyde-debug",
    731         "version": "1.4.1",
    732         "version_normalized": "1.4.1.0",
     731        "version": "1.4.2",
     732        "version_normalized": "1.4.2.0",
    733733        "dist": {
    734734            "type": "path",
     
    764764    {
    765765        "name": "inpsyde/inpsyde-http-client",
    766         "version": "1.4.1",
    767         "version_normalized": "1.4.1.0",
     766        "version": "1.4.2",
     767        "version_normalized": "1.4.2.0",
    768768        "dist": {
    769769            "type": "path",
     
    792792    {
    793793        "name": "inpsyde/inpsyde-queue",
    794         "version": "1.4.1",
    795         "version_normalized": "1.4.1.0",
     794        "version": "1.4.2",
     795        "version_normalized": "1.4.2.0",
    796796        "dist": {
    797797            "type": "path",
     
    828828    {
    829829        "name": "inpsyde/inpsyde-state-machine",
    830         "version": "1.4.1",
    831         "version_normalized": "1.4.1.0",
     830        "version": "1.4.2",
     831        "version_normalized": "1.4.2.0",
    832832        "dist": {
    833833            "type": "path",
     
    863863    {
    864864        "name": "inpsyde/inpsyde-woocommerce-lifecycle-events",
    865         "version": "1.4.1",
    866         "version_normalized": "1.4.1.0",
     865        "version": "1.4.2",
     866        "version_normalized": "1.4.2.0",
    867867        "dist": {
    868868            "type": "path",
     
    10391039    {
    10401040        "name": "inpsyde/wc-product-contracts",
    1041         "version": "1.4.1",
    1042         "version_normalized": "1.4.1.0",
     1041        "version": "1.4.2",
     1042        "version_normalized": "1.4.2.0",
    10431043        "dist": {
    10441044            "type": "path",
     
    11401140    {
    11411141        "name": "inpsyde/zettle-assets",
    1142         "version": "1.4.1",
    1143         "version_normalized": "1.4.1.0",
     1142        "version": "1.4.2",
     1143        "version_normalized": "1.4.2.0",
    11441144        "dist": {
    11451145            "type": "path",
     
    11641164    {
    11651165        "name": "inpsyde/zettle-auth",
    1166         "version": "1.4.1",
    1167         "version_normalized": "1.4.1.0",
     1166        "version": "1.4.2",
     1167        "version_normalized": "1.4.2.0",
    11681168        "dist": {
    11691169            "type": "path",
     
    11901190    {
    11911191        "name": "inpsyde/zettle-logging",
    1192         "version": "1.4.1",
    1193         "version_normalized": "1.4.1.0",
     1192        "version": "1.4.2",
     1193        "version_normalized": "1.4.2.0",
    11941194        "dist": {
    11951195            "type": "path",
     
    12281228    {
    12291229        "name": "inpsyde/zettle-notices",
    1230         "version": "1.4.1",
    1231         "version_normalized": "1.4.1.0",
     1230        "version": "1.4.2",
     1231        "version_normalized": "1.4.2.0",
    12321232        "dist": {
    12331233            "type": "path",
     
    12511251    {
    12521252        "name": "inpsyde/zettle-onboarding",
    1253         "version": "1.4.1",
    1254         "version_normalized": "1.4.1.0",
     1253        "version": "1.4.2",
     1254        "version_normalized": "1.4.2.0",
    12551255        "dist": {
    12561256            "type": "path",
     
    12881288    {
    12891289        "name": "inpsyde/zettle-php-sdk",
    1290         "version": "1.4.1",
    1291         "version_normalized": "1.4.1.0",
     1290        "version": "1.4.2",
     1291        "version_normalized": "1.4.2.0",
    12921292        "dist": {
    12931293            "type": "path",
     
    13291329    {
    13301330        "name": "inpsyde/zettle-product-debug",
    1331         "version": "1.4.1",
    1332         "version_normalized": "1.4.1.0",
     1331        "version": "1.4.2",
     1332        "version_normalized": "1.4.2.0",
    13331333        "dist": {
    13341334            "type": "path",
     
    13521352    {
    13531353        "name": "inpsyde/zettle-product-settings",
    1354         "version": "1.4.1",
    1355         "version_normalized": "1.4.1.0",
     1354        "version": "1.4.2",
     1355        "version_normalized": "1.4.2.0",
    13561356        "dist": {
    13571357            "type": "path",
     
    13761376    {
    13771377        "name": "inpsyde/zettle-queue",
    1378         "version": "1.4.1",
    1379         "version_normalized": "1.4.1.0",
     1378        "version": "1.4.2",
     1379        "version_normalized": "1.4.2.0",
    13801380        "dist": {
    13811381            "type": "path",
     
    14001400    {
    14011401        "name": "inpsyde/zettle-settings",
    1402         "version": "1.4.1",
    1403         "version_normalized": "1.4.1.0",
     1402        "version": "1.4.2",
     1403        "version_normalized": "1.4.2.0",
    14041404        "dist": {
    14051405            "type": "path",
     
    14231423    {
    14241424        "name": "inpsyde/zettle-sync",
    1425         "version": "1.4.1",
    1426         "version_normalized": "1.4.1.0",
     1425        "version": "1.4.2",
     1426        "version_normalized": "1.4.2.0",
    14271427        "dist": {
    14281428            "type": "path",
     
    14471447    {
    14481448        "name": "inpsyde/zettle-webhooks",
    1449         "version": "1.4.1",
    1450         "version_normalized": "1.4.1.0",
     1449        "version": "1.4.2",
     1450        "version_normalized": "1.4.2.0",
    14511451        "dist": {
    14521452            "type": "path",
     
    15531553    {
    15541554        "name": "nyholm/psr7",
    1555         "version": "1.4.0",
    1556         "version_normalized": "1.4.0.0",
     1555        "version": "1.4.1",
     1556        "version_normalized": "1.4.1.0",
    15571557        "source": {
    15581558            "type": "git",
    15591559            "url": "https://github.com/Nyholm/psr7.git",
    1560             "reference": "23ae1f00fbc6a886cbe3062ca682391b9cc7c37b"
    1561         },
    1562         "dist": {
    1563             "type": "zip",
    1564             "url": "https://api.github.com/repos/Nyholm/psr7/zipball/23ae1f00fbc6a886cbe3062ca682391b9cc7c37b",
    1565             "reference": "23ae1f00fbc6a886cbe3062ca682391b9cc7c37b",
     1560            "reference": "2212385b47153ea71b1c1b1374f8cb5e4f7892ec"
     1561        },
     1562        "dist": {
     1563            "type": "zip",
     1564            "url": "https://api.github.com/repos/Nyholm/psr7/zipball/2212385b47153ea71b1c1b1374f8cb5e4f7892ec",
     1565            "reference": "2212385b47153ea71b1c1b1374f8cb5e4f7892ec",
    15661566            "shasum": "",
    15671567            "mirrors": [
     
    15831583        },
    15841584        "require-dev": {
    1585             "http-interop/http-factory-tests": "^0.8",
     1585            "http-interop/http-factory-tests": "^0.9",
    15861586            "php-http/psr7-integration-tests": "^1.0",
    15871587            "phpunit/phpunit": "^7.5 || 8.5 || 9.4",
    15881588            "symfony/error-handler": "^4.4"
    15891589        },
    1590         "time": "2021-02-18T15:41:32+00:00",
     1590        "time": "2021-07-02T08:32:20+00:00",
    15911591        "type": "library",
    15921592        "extra": {
     
    16231623        "support": {
    16241624            "issues": "https://github.com/Nyholm/psr7/issues",
    1625             "source": "https://github.com/Nyholm/psr7/tree/1.4.0"
     1625            "source": "https://github.com/Nyholm/psr7/tree/1.4.1"
    16261626        },
    16271627        "funding": [
     
    16881688    {
    16891689        "name": "php-http/client-common",
    1690         "version": "2.3.0",
    1691         "version_normalized": "2.3.0.0",
     1690        "version": "2.4.0",
     1691        "version_normalized": "2.4.0.0",
    16921692        "source": {
    16931693            "type": "git",
    16941694            "url": "https://github.com/php-http/client-common.git",
    1695             "reference": "e37e46c610c87519753135fb893111798c69076a"
    1696         },
    1697         "dist": {
    1698             "type": "zip",
    1699             "url": "https://api.github.com/repos/php-http/client-common/zipball/e37e46c610c87519753135fb893111798c69076a",
    1700             "reference": "e37e46c610c87519753135fb893111798c69076a",
     1695            "reference": "29e0c60d982f04017069483e832b92074d0a90b2"
     1696        },
     1697        "dist": {
     1698            "type": "zip",
     1699            "url": "https://api.github.com/repos/php-http/client-common/zipball/29e0c60d982f04017069483e832b92074d0a90b2",
     1700            "reference": "29e0c60d982f04017069483e832b92074d0a90b2",
    17011701            "shasum": "",
    17021702            "mirrors": [
     
    17331733            "php-http/stopwatch-plugin": "Symfony Stopwatch plugin"
    17341734        },
    1735         "time": "2020-07-21T10:04:13+00:00",
     1735        "time": "2021-07-05T08:19:25+00:00",
    17361736        "type": "library",
    17371737        "extra": {
     
    17631763            "http",
    17641764            "httplug"
    1765         ]
     1765        ],
     1766        "support": {
     1767            "issues": "https://github.com/php-http/client-common/issues",
     1768            "source": "https://github.com/php-http/client-common/tree/2.4.0"
     1769        }
    17661770    },
    17671771    {
     
    18441848    {
    18451849        "name": "php-http/discovery",
    1846         "version": "1.13.0",
    1847         "version_normalized": "1.13.0.0",
     1850        "version": "1.14.0",
     1851        "version_normalized": "1.14.0.0",
    18481852        "source": {
    18491853            "type": "git",
    18501854            "url": "https://github.com/php-http/discovery.git",
    1851             "reference": "788f72d64c43dc361e7fcc7464c3d947c64984a7"
    1852         },
    1853         "dist": {
    1854             "type": "zip",
    1855             "url": "https://api.github.com/repos/php-http/discovery/zipball/788f72d64c43dc361e7fcc7464c3d947c64984a7",
    1856             "reference": "788f72d64c43dc361e7fcc7464c3d947c64984a7",
     1855            "reference": "778f722e29250c1fac0bbdef2c122fa5d038c9eb"
     1856        },
     1857        "dist": {
     1858            "type": "zip",
     1859            "url": "https://api.github.com/repos/php-http/discovery/zipball/778f722e29250c1fac0bbdef2c122fa5d038c9eb",
     1860            "reference": "778f722e29250c1fac0bbdef2c122fa5d038c9eb",
    18571861            "shasum": "",
    18581862            "mirrors": [
     
    18771881        },
    18781882        "suggest": {
    1879             "php-http/message": "Allow to use Guzzle, Diactoros or Slim Framework factories",
    1880             "puli/composer-plugin": "Sets up Puli which is recommended for Discovery to work. Check http://docs.php-http.org/en/latest/discovery.html for more details."
    1881         },
    1882         "time": "2020-11-27T14:49:42+00:00",
     1883            "php-http/message": "Allow to use Guzzle, Diactoros or Slim Framework factories"
     1884        },
     1885        "time": "2021-06-01T14:30:21+00:00",
    18831886        "type": "library",
    18841887        "extra": {
     
    19161919        "support": {
    19171920            "issues": "https://github.com/php-http/discovery/issues",
    1918             "source": "https://github.com/php-http/discovery/tree/1.13.0"
     1921            "source": "https://github.com/php-http/discovery/tree/1.14.0"
    19191922        }
    19201923    },
     
    25522555    {
    25532556        "name": "symfony/options-resolver",
    2554         "version": "v5.2.4",
    2555         "version_normalized": "5.2.4.0",
     2557        "version": "v5.3.0",
     2558        "version_normalized": "5.3.0.0",
    25562559        "source": {
    25572560            "type": "git",
    25582561            "url": "https://github.com/symfony/options-resolver.git",
    2559             "reference": "5d0f633f9bbfcf7ec642a2b5037268e61b0a62ce"
    2560         },
    2561         "dist": {
    2562             "type": "zip",
    2563             "url": "https://api.github.com/repos/symfony/options-resolver/zipball/5d0f633f9bbfcf7ec642a2b5037268e61b0a62ce",
    2564             "reference": "5d0f633f9bbfcf7ec642a2b5037268e61b0a62ce",
     2562            "reference": "162e886ca035869866d233a2bfef70cc28f9bbe5"
     2563        },
     2564        "dist": {
     2565            "type": "zip",
     2566            "url": "https://api.github.com/repos/symfony/options-resolver/zipball/162e886ca035869866d233a2bfef70cc28f9bbe5",
     2567            "reference": "162e886ca035869866d233a2bfef70cc28f9bbe5",
    25652568            "shasum": "",
    25662569            "mirrors": [
     
    25772580            "symfony/polyfill-php80": "^1.15"
    25782581        },
    2579         "time": "2021-01-27T12:56:27+00:00",
     2582        "time": "2021-05-26T17:43:10+00:00",
    25802583        "type": "library",
    25812584        "installation-source": "dist",
     
    26102613        ],
    26112614        "support": {
    2612             "source": "https://github.com/symfony/options-resolver/tree/v5.2.4"
     2615            "source": "https://github.com/symfony/options-resolver/tree/v5.3.0"
    26132616        },
    26142617        "funding": [
     
    26292632    {
    26302633        "name": "symfony/polyfill-php73",
    2631         "version": "v1.22.1",
    2632         "version_normalized": "1.22.1.0",
     2634        "version": "v1.23.0",
     2635        "version_normalized": "1.23.0.0",
    26332636        "source": {
    26342637            "type": "git",
    26352638            "url": "https://github.com/symfony/polyfill-php73.git",
    2636             "reference": "a678b42e92f86eca04b7fa4c0f6f19d097fb69e2"
    2637         },
    2638         "dist": {
    2639             "type": "zip",
    2640             "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/a678b42e92f86eca04b7fa4c0f6f19d097fb69e2",
    2641             "reference": "a678b42e92f86eca04b7fa4c0f6f19d097fb69e2",
     2639            "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010"
     2640        },
     2641        "dist": {
     2642            "type": "zip",
     2643            "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fba8933c384d6476ab14fb7b8526e5287ca7e010",
     2644            "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010",
    26422645            "shasum": "",
    26432646            "mirrors": [
     
    26512654            "php": ">=7.1"
    26522655        },
    2653         "time": "2021-01-07T16:49:33+00:00",
     2656        "time": "2021-02-19T12:13:01+00:00",
    26542657        "type": "library",
    26552658        "extra": {
    26562659            "branch-alias": {
    2657                 "dev-main": "1.22-dev"
     2660                "dev-main": "1.23-dev"
    26582661            },
    26592662            "thanks": {
     
    26972700        ],
    26982701        "support": {
    2699             "source": "https://github.com/symfony/polyfill-php73/tree/v1.22.1"
     2702            "source": "https://github.com/symfony/polyfill-php73/tree/v1.23.0"
    27002703        },
    27012704        "funding": [
     
    27162719    {
    27172720        "name": "symfony/polyfill-php80",
    2718         "version": "v1.22.1",
    2719         "version_normalized": "1.22.1.0",
     2721        "version": "v1.23.0",
     2722        "version_normalized": "1.23.0.0",
    27202723        "source": {
    27212724            "type": "git",
    27222725            "url": "https://github.com/symfony/polyfill-php80.git",
    2723             "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91"
    2724         },
    2725         "dist": {
    2726             "type": "zip",
    2727             "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/dc3063ba22c2a1fd2f45ed856374d79114998f91",
    2728             "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91",
     2726            "reference": "eca0bf41ed421bed1b57c4958bab16aa86b757d0"
     2727        },
     2728        "dist": {
     2729            "type": "zip",
     2730            "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/eca0bf41ed421bed1b57c4958bab16aa86b757d0",
     2731            "reference": "eca0bf41ed421bed1b57c4958bab16aa86b757d0",
    27292732            "shasum": "",
    27302733            "mirrors": [
     
    27382741            "php": ">=7.1"
    27392742        },
    2740         "time": "2021-01-07T16:49:33+00:00",
     2743        "time": "2021-02-19T12:13:01+00:00",
    27412744        "type": "library",
    27422745        "extra": {
    27432746            "branch-alias": {
    2744                 "dev-main": "1.22-dev"
     2747                "dev-main": "1.23-dev"
    27452748            },
    27462749            "thanks": {
     
    27882791        ],
    27892792        "support": {
    2790             "source": "https://github.com/symfony/polyfill-php80/tree/v1.22.1"
     2793            "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.0"
    27912794        },
    27922795        "funding": [
     
    28072810    {
    28082811        "name": "symfony/polyfill-uuid",
    2809         "version": "v1.22.1",
    2810         "version_normalized": "1.22.1.0",
     2812        "version": "v1.23.0",
     2813        "version_normalized": "1.23.0.0",
    28112814        "source": {
    28122815            "type": "git",
    28132816            "url": "https://github.com/symfony/polyfill-uuid.git",
    2814             "reference": "9773608c15d3fe6ba2b6456a124777a7b8ffee2a"
    2815         },
    2816         "dist": {
    2817             "type": "zip",
    2818             "url": "https://api.github.com/repos/symfony/polyfill-uuid/zipball/9773608c15d3fe6ba2b6456a124777a7b8ffee2a",
    2819             "reference": "9773608c15d3fe6ba2b6456a124777a7b8ffee2a",
     2817            "reference": "9165effa2eb8a31bb3fa608df9d529920d21ddd9"
     2818        },
     2819        "dist": {
     2820            "type": "zip",
     2821            "url": "https://api.github.com/repos/symfony/polyfill-uuid/zipball/9165effa2eb8a31bb3fa608df9d529920d21ddd9",
     2822            "reference": "9165effa2eb8a31bb3fa608df9d529920d21ddd9",
    28202823            "shasum": "",
    28212824            "mirrors": [
     
    28322835            "ext-uuid": "For best performance"
    28332836        },
    2834         "time": "2021-01-22T09:19:47+00:00",
     2837        "time": "2021-02-19T12:13:01+00:00",
    28352838        "type": "library",
    28362839        "extra": {
    28372840            "branch-alias": {
    2838                 "dev-main": "1.22-dev"
     2841                "dev-main": "1.23-dev"
    28392842            },
    28402843            "thanks": {
     
    28752878        ],
    28762879        "support": {
    2877             "source": "https://github.com/symfony/polyfill-uuid/tree/v1.22.1"
     2880            "source": "https://github.com/symfony/polyfill-uuid/tree/v1.23.0"
    28782881        },
    28792882        "funding": [
     
    28942897    {
    28952898        "name": "symfony/uid",
    2896         "version": "v5.2.6",
    2897         "version_normalized": "5.2.6.0",
     2899        "version": "v5.3.3",
     2900        "version_normalized": "5.3.3.0",
    28982901        "source": {
    28992902            "type": "git",
    29002903            "url": "https://github.com/symfony/uid.git",
    2901             "reference": "47d4347b762f0bab9b4ec02112ddfaaa6d79481b"
    2902         },
    2903         "dist": {
    2904             "type": "zip",
    2905             "url": "https://api.github.com/repos/symfony/uid/zipball/47d4347b762f0bab9b4ec02112ddfaaa6d79481b",
    2906             "reference": "47d4347b762f0bab9b4ec02112ddfaaa6d79481b",
     2904            "reference": "45853bbc72f2b91c32e707afe7f896fddb3ee8e9"
     2905        },
     2906        "dist": {
     2907            "type": "zip",
     2908            "url": "https://api.github.com/repos/symfony/uid/zipball/45853bbc72f2b91c32e707afe7f896fddb3ee8e9",
     2909            "reference": "45853bbc72f2b91c32e707afe7f896fddb3ee8e9",
    29072910            "shasum": "",
    29082911            "mirrors": [
     
    29172920            "symfony/polyfill-uuid": "^1.15"
    29182921        },
    2919         "time": "2021-03-21T16:15:38+00:00",
     2922        "require-dev": {
     2923            "symfony/console": "^4.4|^5.0"
     2924        },
     2925        "time": "2021-06-24T08:13:00+00:00",
    29202926        "type": "library",
    29212927        "installation-source": "dist",
     
    29532959        ],
    29542960        "support": {
    2955             "source": "https://github.com/symfony/uid/tree/v5.2.6"
     2961            "source": "https://github.com/symfony/uid/tree/v5.3.3"
    29562962        },
    29572963        "funding": [
  • zettle-pos-integration/trunk/vendor/nyholm/psr7/src/Factory/Psr17Factory.php

    r2501019 r2560431  
    3838    public function createStreamFromFile(string $filename, string $mode = 'r'): StreamInterface
    3939    {
    40         $resource = @\fopen($filename, $mode);
     40        try {
     41            $resource = @\fopen($filename, $mode);
     42        } catch (\Throwable $e) {
     43            throw new \RuntimeException(\sprintf('The file "%s" cannot be opened.', $filename));
     44        }
     45
    4146        if (false === $resource) {
    42             if ('' === $mode || false === \in_array($mode[0], ['r', 'w', 'a', 'x', 'c'])) {
    43                 throw new \InvalidArgumentException('The mode ' . $mode . ' is invalid.');
     47            if ('' === $mode || false === \in_array($mode[0], ['r', 'w', 'a', 'x', 'c'], true)) {
     48                throw new \InvalidArgumentException(\sprintf('The mode "%s" is invalid.', $mode));
    4449            }
    4550
    46             throw new \RuntimeException('The file ' . $filename . ' cannot be opened.');
     51            throw new \RuntimeException(\sprintf('The file "%s" cannot be opened.', $filename));
    4752        }
    4853
  • zettle-pos-integration/trunk/vendor/nyholm/psr7/src/Stream.php

    r2501019 r2560431  
    210210
    211211        if (-1 === \fseek($this->stream, $offset, $whence)) {
    212             throw new \RuntimeException('Unable to seek to stream position ' . $offset . ' with whence ' . \var_export($whence, true));
     212            throw new \RuntimeException('Unable to seek to stream position "' . $offset . '" with whence ' . \var_export($whence, true));
    213213        }
    214214    }
  • zettle-pos-integration/trunk/vendor/nyholm/psr7/src/UploadedFile.php

    r2501019 r2560431  
    115115        }
    116116
    117         $resource = \fopen($this->file, 'r');
    118 
    119         return Stream::create($resource);
     117        try {
     118            return Stream::create(\fopen($this->file, 'r'));
     119        } catch (\Throwable $e) {
     120            throw new \RuntimeException(\sprintf('The file "%s" cannot be opened.', $this->file));
     121        }
    120122    }
    121123
     
    136138            }
    137139
    138             // Copy the contents of a stream into another stream until end-of-file.
    139             $dest = Stream::create(\fopen($targetPath, 'w'));
     140            try {
     141                // Copy the contents of a stream into another stream until end-of-file.
     142                $dest = Stream::create(\fopen($targetPath, 'w'));
     143            } catch (\Throwable $e) {
     144                throw new \RuntimeException(\sprintf('The file "%s" cannot be opened.', $targetPath));
     145            }
     146
    140147            while (!$stream->eof()) {
    141148                if (!$dest->write($stream->read(1048576))) {
     
    148155
    149156        if (false === $this->moved) {
    150             throw new \RuntimeException(\sprintf('Uploaded file could not be moved to %s', $targetPath));
     157            throw new \RuntimeException(\sprintf('Uploaded file could not be moved to "%s"', $targetPath));
    151158        }
    152159    }
  • zettle-pos-integration/trunk/vendor/nyholm/psr7/src/Uri.php

    r2501019 r2560431  
    5151        if ('' !== $uri) {
    5252            if (false === $parts = \parse_url($uri)) {
    53                 throw new \InvalidArgumentException("Unable to parse URI: $uri");
     53                throw new \InvalidArgumentException(\sprintf('Unable to parse URI: "%s"', $uri));
    5454            }
    5555
  • zettle-pos-integration/trunk/vendor/php-http/client-common/src/BatchResult.php

    r2477105 r2560431  
    1717{
    1818    /**
    19      * @var \SplObjectStorage
     19     * @var \SplObjectStorage<RequestInterface, ResponseInterface>
    2020     */
    2121    private $responses;
    2222
    2323    /**
    24      * @var \SplObjectStorage
     24     * @var \SplObjectStorage<RequestInterface, ClientExceptionInterface>
    2525     */
    2626    private $exceptions;
  • zettle-pos-integration/trunk/vendor/php-http/client-common/src/Plugin/RedirectPlugin.php

    r2477105 r2560431  
    106106     *
    107107     *     @var bool|string[] $preserve_header True keeps all headers, false remove all of them, an array is interpreted as a list of header names to keep
    108      *     @var bool $use_default_for_multiple Whether the location header must be directly used for a multiple redirection status code (300).
     108     *     @var bool $use_default_for_multiple Whether the location header must be directly used for a multiple redirection status code (300)
     109     *     @var bool $strict When true, redirect codes 300, 301, 302 will not modify request method and body.
    109110     * }
    110111     */
     
    115116            'preserve_header' => true,
    116117            'use_default_for_multiple' => true,
     118            'strict' => false,
    117119        ]);
    118120        $resolver->setAllowedTypes('preserve_header', ['bool', 'array']);
    119121        $resolver->setAllowedTypes('use_default_for_multiple', 'bool');
     122        $resolver->setAllowedTypes('strict', 'bool');
    120123        $resolver->setNormalizer('preserve_header', function (OptionsResolver $resolver, $value) {
    121124            if (is_bool($value) && false === $value) {
     
    129132        $this->preserveHeader = $options['preserve_header'];
    130133        $this->useDefaultForMultiple = $options['use_default_for_multiple'];
     134
     135        if ($options['strict']) {
     136            $this->redirectCodes[300]['switch'] = false;
     137            $this->redirectCodes[301]['switch'] = false;
     138            $this->redirectCodes[302]['switch'] = false;
     139        }
    131140    }
    132141
  • zettle-pos-integration/trunk/vendor/php-http/discovery/src/ClassDiscovery.php

    r2477105 r2560431  
    2323     */
    2424    private static $strategies = [
    25         Strategy\PuliBetaStrategy::class,
    2625        Strategy\CommonClassesStrategy::class,
    2726        Strategy\CommonPsr17ClassesStrategy::class,
     27        Strategy\PuliBetaStrategy::class,
     28    ];
     29
     30    private static $deprecatedStrategies = [
     31        Strategy\PuliBetaStrategy::class => true,
    2832    ];
    2933
     
    5660                $candidates = call_user_func($strategy.'::getCandidates', $type);
    5761            } catch (StrategyUnavailableException $e) {
    58                 $exceptions[] = $e;
     62                if (!isset(self::$deprecatedStrategies[$strategy])) {
     63                    $exceptions[] = $e;
     64                }
    5965
    6066                continue;
  • zettle-pos-integration/trunk/vendor/symfony/options-resolver/OptionsResolver.php

    r2477105 r2560431  
    132132
    133133    /**
     134     * Whether the whole options definition is marked as array prototype.
     135     */
     136    private $prototype;
     137
     138    /**
     139     * The prototype array's index that is being read.
     140     */
     141    private $prototypeIndex;
     142
     143    /**
    134144     * Sets the default value of a given option.
    135145     *
     
    788798
    789799        return $this->info[$option] ?? null;
     800    }
     801
     802    /**
     803     * Marks the whole options definition as array prototype.
     804     *
     805     * @return $this
     806     *
     807     * @throws AccessException If called from a lazy option, a normalizer or a root definition
     808     */
     809    public function setPrototype(bool $prototype): self
     810    {
     811        if ($this->locked) {
     812            throw new AccessException('The prototype property cannot be set from a lazy option or normalizer.');
     813        }
     814
     815        if (null === $this->prototype && $prototype) {
     816            throw new AccessException('The prototype property cannot be set from a root definition.');
     817        }
     818
     819        $this->prototype = $prototype;
     820
     821        return $this;
     822    }
     823
     824    public function isPrototype(): bool
     825    {
     826        return $this->prototype ?? false;
    790827    }
    791828
     
    9711008            try {
    9721009                $resolver = new self();
     1010                $resolver->prototype = false;
    9731011                $resolver->parentsOptions = $this->parentsOptions;
    9741012                $resolver->parentsOptions[] = $option;
     
    9761014                    $closure($resolver, $this);
    9771015                }
    978                 $value = $resolver->resolve($value);
     1016
     1017                if ($resolver->prototype) {
     1018                    $values = [];
     1019                    foreach ($value as $index => $prototypeValue) {
     1020                        if (!\is_array($prototypeValue)) {
     1021                            throw new InvalidOptionsException(sprintf('The value of the option "%s" is expected to be of type array of array, but is of type array of "%s".', $this->formatOptions([$option]), get_debug_type($prototypeValue)));
     1022                        }
     1023
     1024                        $resolver->prototypeIndex = $index;
     1025                        $values[$index] = $resolver->resolve($prototypeValue);
     1026                    }
     1027                    $value = $values;
     1028                } else {
     1029                    $value = $resolver->resolve($value);
     1030                }
    9791031            } finally {
     1032                $resolver->prototypeIndex = null;
    9801033                unset($this->calling[$option]);
    9811034            }
     
    12871340            }
    12881341
     1342            if ($this->prototype && null !== $this->prototypeIndex) {
     1343                $prefix .= sprintf('[%s]', $this->prototypeIndex);
     1344            }
     1345
    12891346            $options = array_map(static function (string $option) use ($prefix): string {
    12901347                return sprintf('%s[%s]', $prefix, $option);
  • zettle-pos-integration/trunk/vendor/symfony/uid/AbstractUid.php

    r2477105 r2560431  
    1313
    1414/**
    15  * @experimental in 5.2
    16  *
    1715 * @author Nicolas Grekas <[email protected]>
    1816 */
     
    3937
    4038    /**
     39     * @return static
     40     *
     41     * @throws \InvalidArgumentException When the passed value is not valid
     42     */
     43    public static function fromBinary(string $uid): self
     44    {
     45        if (16 !== \strlen($uid)) {
     46            throw new \InvalidArgumentException('Invalid binary uid provided.');
     47        }
     48
     49        return static::fromString($uid);
     50    }
     51
     52    /**
     53     * @return static
     54     *
     55     * @throws \InvalidArgumentException When the passed value is not valid
     56     */
     57    public static function fromBase58(string $uid): self
     58    {
     59        if (22 !== \strlen($uid)) {
     60            throw new \InvalidArgumentException('Invalid base-58 uid provided.');
     61        }
     62
     63        return static::fromString($uid);
     64    }
     65
     66    /**
     67     * @return static
     68     *
     69     * @throws \InvalidArgumentException When the passed value is not valid
     70     */
     71    public static function fromBase32(string $uid): self
     72    {
     73        if (26 !== \strlen($uid)) {
     74            throw new \InvalidArgumentException('Invalid base-32 uid provided.');
     75        }
     76
     77        return static::fromString($uid);
     78    }
     79
     80    /**
     81     * @return static
     82     *
     83     * @throws \InvalidArgumentException When the passed value is not valid
     84     */
     85    public static function fromRfc4122(string $uid): self
     86    {
     87        if (36 !== \strlen($uid)) {
     88            throw new \InvalidArgumentException('Invalid RFC4122 uid provided.');
     89        }
     90
     91        return static::fromString($uid);
     92    }
     93
     94    /**
    4195     * Returns the identifier as a raw binary string.
    4296     */
     
    4498
    4599    /**
    46      * Returns the identifier as a base-58 case sensitive string.
     100     * Returns the identifier as a base58 case sensitive string.
    47101     */
    48102    public function toBase58(): string
     
    52106
    53107    /**
    54      * Returns the identifier as a base-32 case insensitive string.
     108     * Returns the identifier as a base32 case insensitive string.
    55109     */
    56110    public function toBase32(): string
  • zettle-pos-integration/trunk/vendor/symfony/uid/BinaryUtil.php

    r2477105 r2560431  
    120120     * @param string $time Count of 100-nanosecond intervals since the UUID epoch 1582-10-15 00:00:00 in hexadecimal
    121121     */
    122     public static function timeToFloat(string $time): float
     122    public static function hexToDateTime(string $time): \DateTimeImmutable
    123123    {
    124124        if (\PHP_INT_SIZE >= 8) {
    125             $time = hexdec($time) - self::TIME_OFFSET_INT;
     125            $time = (string) (hexdec($time) - self::TIME_OFFSET_INT);
    126126        } else {
    127127            $time = str_pad(hex2bin($time), 8, "\0", \STR_PAD_LEFT);
     
    137137        }
    138138
    139         return $time / 10000000;
     139        if (9 > \strlen($time)) {
     140            $time = '-' === $time[0] ? '-'.str_pad(substr($time, 1), 8, '0', \STR_PAD_LEFT) : str_pad($time, 8, '0', \STR_PAD_LEFT);
     141        }
     142
     143        return \DateTimeImmutable::createFromFormat('U.u?', substr_replace($time, '.', -7, 0));
     144    }
     145
     146    /**
     147     * @return string Count of 100-nanosecond intervals since the UUID epoch 1582-10-15 00:00:00 in hexadecimal
     148     */
     149    public static function dateTimeToHex(\DateTimeInterface $time): string
     150    {
     151        if (\PHP_INT_SIZE >= 8) {
     152            if (-self::TIME_OFFSET_INT > $time = (int) $time->format('Uu0')) {
     153                throw new \InvalidArgumentException('The given UUID date cannot be earlier than 1582-10-15.');
     154            }
     155
     156            return str_pad(dechex(self::TIME_OFFSET_INT + $time), 16, '0', \STR_PAD_LEFT);
     157        }
     158
     159        $time = $time->format('Uu0');
     160        $negative = '-' === $time[0];
     161        if ($negative && self::TIME_OFFSET_INT < $time = substr($time, 1)) {
     162            throw new \InvalidArgumentException('The given UUID date cannot be earlier than 1582-10-15.');
     163        }
     164        $time = self::fromBase($time, self::BASE10);
     165        $time = str_pad($time, 8, "\0", \STR_PAD_LEFT);
     166
     167        if ($negative) {
     168            $time = self::add($time, self::TIME_OFFSET_COM1) ^ "\xff\xff\xff\xff\xff\xff\xff\xff";
     169        } else {
     170            $time = self::add($time, self::TIME_OFFSET_BIN);
     171        }
     172
     173        return bin2hex($time);
    140174    }
    141175}
  • zettle-pos-integration/trunk/vendor/symfony/uid/NilUuid.php

    r2477105 r2560431  
    1313
    1414/**
    15  * @experimental in 5.2
    16  *
    1715 * @author Grégoire Pineau <[email protected]>
    1816 */
     
    2321    public function __construct()
    2422    {
    25         $this->uid = '00000000-0000-0000-0000-000000000000';
     23        $this->uid = parent::NIL;
    2624    }
    2725}
  • zettle-pos-integration/trunk/vendor/symfony/uid/Ulid.php

    r2477105 r2560431  
    1616 *
    1717 * @see https://github.com/ulid/spec
    18  *
    19  * @experimental in 5.2
    2018 *
    2119 * @author Nicolas Grekas <[email protected]>
     
    2321class Ulid extends AbstractUid
    2422{
     23    private const NIL = '00000000000000000000000000';
     24
    2525    private static $time = '';
    2626    private static $rand = [];
     
    2929    {
    3030        if (null === $ulid) {
    31             $this->uid = self::generate();
     31            $this->uid = static::generate();
     32
     33            return;
     34        }
     35
     36        if (self::NIL === $ulid) {
     37            $this->uid = $ulid;
    3238
    3339            return;
     
    3844        }
    3945
    40         $this->uid = strtr($ulid, 'abcdefghjkmnpqrstvwxyz', 'ABCDEFGHJKMNPQRSTVWXYZ');
     46        $this->uid = strtoupper($ulid);
    4147    }
    4248
     
    6268            $ulid = (new Uuid($ulid))->toBinary();
    6369        } elseif (22 === \strlen($ulid) && 22 === strspn($ulid, BinaryUtil::BASE58[''])) {
    64             $ulid = BinaryUtil::fromBase($ulid, BinaryUtil::BASE58);
     70            $ulid = str_pad(BinaryUtil::fromBase($ulid, BinaryUtil::BASE58), 16, "\0", \STR_PAD_LEFT);
    6571        }
    6672
     
    8086        );
    8187
    82         return new static(strtr($ulid, 'abcdefghijklmnopqrstuv', 'ABCDEFGHJKMNPQRSTVWXYZ'));
     88        $u = new static(self::NIL);
     89        $u->uid = strtr($ulid, 'abcdefghijklmnopqrstuv', 'ABCDEFGHJKMNPQRSTVWXYZ');
     90
     91        return $u;
    8392    }
    8493
     
    105114    }
    106115
    107     /**
    108      * @return float Seconds since the Unix epoch 1970-01-01 00:00:00
    109      */
    110     public function getTime(): float
     116    public function getDateTime(): \DateTimeImmutable
    111117    {
    112118        $time = strtr(substr($this->uid, 0, 10), 'ABCDEFGHJKMNPQRSTVWXYZ', 'abcdefghijklmnopqrstuv');
    113119
    114120        if (\PHP_INT_SIZE >= 8) {
    115             return hexdec(base_convert($time, 32, 16)) / 1000;
    116         }
    117 
    118         $time = sprintf('%02s%05s%05s',
    119             base_convert(substr($time, 0, 2), 32, 16),
    120             base_convert(substr($time, 2, 4), 32, 16),
    121             base_convert(substr($time, 6, 4), 32, 16)
    122         );
    123 
    124         return BinaryUtil::toBase(hex2bin($time), BinaryUtil::BASE10) / 1000;
    125     }
    126 
    127     private static function generate(): string
    128     {
    129         $time = microtime(false);
    130         $time = substr($time, 11).substr($time, 2, 3);
     121            $time = (string) hexdec(base_convert($time, 32, 16));
     122        } else {
     123            $time = sprintf('%02s%05s%05s',
     124                base_convert(substr($time, 0, 2), 32, 16),
     125                base_convert(substr($time, 2, 4), 32, 16),
     126                base_convert(substr($time, 6, 4), 32, 16)
     127            );
     128            $time = BinaryUtil::toBase(hex2bin($time), BinaryUtil::BASE10);
     129        }
     130
     131        if (4 > \strlen($time)) {
     132            $time = str_pad($time, 4, '0', \STR_PAD_LEFT);
     133        }
     134
     135        return \DateTimeImmutable::createFromFormat('U.u', substr_replace($time, '.', -3, 0));
     136    }
     137
     138    public static function generate(\DateTimeInterface $time = null): string
     139    {
     140        if (null === $time) {
     141            return self::doGenerate();
     142        }
     143
     144        if (0 > $time = substr($time->format('Uu'), 0, -3)) {
     145            throw new \InvalidArgumentException('The timestamp must be positive.');
     146        }
     147
     148        return self::doGenerate($time);
     149    }
     150
     151    private static function doGenerate(string $mtime = null): string
     152    {
     153        if (null === $time = $mtime) {
     154            $time = microtime(false);
     155            $time = substr($time, 11).substr($time, 2, 3);
     156        }
    131157
    132158        if ($time !== self::$time) {
     
    140166            self::$time = $time;
    141167        } elseif ([0xFFFFF, 0xFFFFF, 0xFFFFF, 0xFFFFF] === self::$rand) {
    142             usleep(100);
    143 
    144             return self::generate();
     168            if (null === $mtime) {
     169                usleep(100);
     170            } else {
     171                self::$rand = [0, 0, 0, 0];
     172            }
     173
     174            return self::doGenerate($mtime);
    145175        } else {
    146176            for ($i = 3; $i >= 0 && 0xFFFFF === self::$rand[$i]; --$i) {
  • zettle-pos-integration/trunk/vendor/symfony/uid/Uuid.php

    r2518205 r2560431  
    1313
    1414/**
    15  * @experimental in 5.2
     15 * @author Grégoire Pineau <[email protected]>
    1616 *
    17  * @author Grégoire Pineau <[email protected]>
     17 * @see https://tools.ietf.org/html/rfc4122#appendix-C for details about namespaces
    1818 */
    1919class Uuid extends AbstractUid
    2020{
     21    public const NAMESPACE_DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
     22    public const NAMESPACE_URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
     23    public const NAMESPACE_OID = '6ba7b812-9dad-11d1-80b4-00c04fd430c8';
     24    public const NAMESPACE_X500 = '6ba7b814-9dad-11d1-80b4-00c04fd430c8';
     25
    2126    protected const TYPE = 0;
     27    protected const NIL = '00000000-0000-0000-0000-000000000000';
    2228
    2329    public function __construct(string $uuid)
    2430    {
    25         $type = uuid_is_valid($uuid) ? uuid_type($uuid) : false;
     31        $type = preg_match('{^[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}$}Di', $uuid) ? (int) $uuid[14] : false;
    2632
    27         if (false === $type || \UUID_TYPE_INVALID === $type || (static::TYPE ?: $type) !== $type) {
     33        if (false === $type || (static::TYPE ?: $type) !== $type) {
    2834            throw new \InvalidArgumentException(sprintf('Invalid UUID%s: "%s".', static::TYPE ? 'v'.static::TYPE : '', $uuid));
    2935        }
    3036
    31         $this->uid = strtr($uuid, 'ABCDEF', 'abcdef');
     37        $this->uid = strtolower($uuid);
    3238    }
    3339
     
    3844    {
    3945        if (22 === \strlen($uuid) && 22 === strspn($uuid, BinaryUtil::BASE58[''])) {
    40             $uuid = BinaryUtil::fromBase($uuid, BinaryUtil::BASE58);
     46            $uuid = str_pad(BinaryUtil::fromBase($uuid, BinaryUtil::BASE58), 16, "\0", \STR_PAD_LEFT);
    4147        }
    4248
     
    4955            $uuid = substr_replace($uuid, '-', 23, 0);
    5056        } elseif (26 === \strlen($uuid) && Ulid::isValid($uuid)) {
    51             $uuid = (new Ulid($uuid))->toRfc4122();
     57            $ulid = new Ulid('00000000000000000000000000');
     58            $ulid->uid = strtoupper($uuid);
     59            $uuid = $ulid->toRfc4122();
    5260        }
    5361
     
    5664        }
    5765
    58         if (!uuid_is_valid($uuid)) {
    59             throw new \InvalidArgumentException(sprintf('Invalid UUID%s: "%s".', static::TYPE ? 'v'.static::TYPE : '', $uuid));
     66        if (self::NIL === $uuid) {
     67            return new NilUuid();
    6068        }
    6169
    62         switch (uuid_type($uuid)) {
     70        switch ($uuid[14]) {
    6371            case UuidV1::TYPE: return new UuidV1($uuid);
    6472            case UuidV3::TYPE: return new UuidV3($uuid);
     
    6674            case UuidV5::TYPE: return new UuidV5($uuid);
    6775            case UuidV6::TYPE: return new UuidV6($uuid);
    68             case NilUuid::TYPE: return new NilUuid();
    6976        }
    7077
     
    105112    public static function isValid(string $uuid): bool
    106113    {
    107         if (__CLASS__ === static::class) {
    108             return uuid_is_valid($uuid);
     114        if (!preg_match('{^[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}$}Di', $uuid)) {
     115            return false;
    109116        }
    110117
    111         return uuid_is_valid($uuid) && static::TYPE === uuid_type($uuid);
     118        return __CLASS__ === static::class || static::TYPE === (int) $uuid[14];
    112119    }
    113120
  • zettle-pos-integration/trunk/vendor/symfony/uid/UuidV1.php

    r2477105 r2560431  
    1515 * A v1 UUID contains a 60-bit timestamp and 62 extra unique bits.
    1616 *
    17  * @experimental in 5.2
    18  *
    1917 * @author Grégoire Pineau <[email protected]>
    2018 */
     
    2220{
    2321    protected const TYPE = 1;
     22
     23    private static $clockSeq;
    2424
    2525    public function __construct(string $uuid = null)
     
    3232    }
    3333
    34     /**
    35      * @return float Seconds since the Unix epoch 1970-01-01 00:00:00
    36      */
    37     public function getTime(): float
     34    public function getDateTime(): \DateTimeImmutable
    3835    {
    39         $time = '0'.substr($this->uid, 15, 3).substr($this->uid, 9, 4).substr($this->uid, 0, 8);
    40 
    41         return BinaryUtil::timeToFloat($time);
     36        return BinaryUtil::hexToDateTime('0'.substr($this->uid, 15, 3).substr($this->uid, 9, 4).substr($this->uid, 0, 8));
    4237    }
    4338
     
    4641        return uuid_mac($this->uid);
    4742    }
     43
     44    public static function generate(\DateTimeInterface $time = null, Uuid $node = null): string
     45    {
     46        $uuid = !$time || !$node ? uuid_create(static::TYPE) : parent::NIL;
     47
     48        if ($time) {
     49            if ($node) {
     50                // use clock_seq from the node
     51                $seq = substr($node->uid, 19, 4);
     52            } else {
     53                // generate a static random clock_seq to prevent any collisions with the real one
     54                $seq = substr($uuid, 19, 4);
     55
     56                while (null === self::$clockSeq || $seq === self::$clockSeq) {
     57                    self::$clockSeq = sprintf('%04x', random_int(0, 0x3fff) | 0x8000);
     58                }
     59
     60                $seq = self::$clockSeq;
     61            }
     62
     63            $time = BinaryUtil::dateTimeToHex($time);
     64            $uuid = substr($time, 8).'-'.substr($time, 4, 4).'-1'.substr($time, 1, 3).'-'.$seq.substr($uuid, 23);
     65        }
     66
     67        if ($node) {
     68            $uuid = substr($uuid, 0, 24).substr($node->uid, 24);
     69        }
     70
     71        return $uuid;
     72    }
    4873}
  • zettle-pos-integration/trunk/vendor/symfony/uid/UuidV3.php

    r2477105 r2560431  
    1717 * Use Uuid::v3() to compute one.
    1818 *
    19  * @experimental in 5.2
    20  *
    2119 * @author Grégoire Pineau <[email protected]>
    2220 */
  • zettle-pos-integration/trunk/vendor/symfony/uid/UuidV4.php

    r2477105 r2560431  
    1414/**
    1515 * A v4 UUID contains a 122-bit random number.
    16  *
    17  * @experimental in 5.2
    1816 *
    1917 * @author Grégoire Pineau <[email protected]>
  • zettle-pos-integration/trunk/vendor/symfony/uid/UuidV5.php

    r2477105 r2560431  
    1717 * Use Uuid::v5() to compute one.
    1818 *
    19  * @experimental in 5.2
    20  *
    2119 * @author Grégoire Pineau <[email protected]>
    2220 */
  • zettle-pos-integration/trunk/vendor/symfony/uid/UuidV6.php

    r2477105 r2560431  
    1717 * Unlike UUIDv1, this implementation of UUIDv6 doesn't leak the MAC address of the host.
    1818 *
    19  * @experimental in 5.2
    20  *
    2119 * @author Nicolas Grekas <[email protected]>
    2220 */
     
    2523    protected const TYPE = 6;
    2624
    27     private static $seed;
     25    private static $node;
    2826
    2927    public function __construct(string $uuid = null)
    3028    {
    3129        if (null === $uuid) {
    32             $uuid = uuid_create(\UUID_TYPE_TIME);
    33             $this->uid = substr($uuid, 15, 3).substr($uuid, 9, 4).$uuid[0].'-'.substr($uuid, 1, 4).'-6'.substr($uuid, 5, 3).substr($uuid, 18, 6);
    34 
    35             // uuid_create() returns a stable "node" that can leak the MAC of the host, but
    36             // UUIDv6 prefers a truly random number here, let's XOR both to preserve the entropy
    37 
    38             if (null === self::$seed) {
    39                 self::$seed = [random_int(0, 0xffffff), random_int(0, 0xffffff)];
    40             }
    41 
    42             $node = unpack('N2', hex2bin('00'.substr($uuid, 24, 6)).hex2bin('00'.substr($uuid, 30)));
    43 
    44             $this->uid .= sprintf('%06x%06x',
    45                 (self::$seed[0] ^ $node[1]) | 0x010000,
    46                 self::$seed[1] ^ $node[2]
    47             );
     30            $this->uid = static::generate();
    4831        } else {
    4932            parent::__construct($uuid);
     
    5134    }
    5235
    53     /**
    54      * @return float Seconds since the Unix epoch 1970-01-01 00:00:00
    55      */
    56     public function getTime(): float
     36    public function getDateTime(): \DateTimeImmutable
    5737    {
    58         $time = '0'.substr($this->uid, 0, 8).substr($this->uid, 9, 4).substr($this->uid, 15, 3);
    59 
    60         return BinaryUtil::timeToFloat($time);
     38        return BinaryUtil::hexToDateTime('0'.substr($this->uid, 0, 8).substr($this->uid, 9, 4).substr($this->uid, 15, 3));
    6139    }
    6240
     
    6543        return substr($this->uid, 24);
    6644    }
     45
     46    public static function generate(\DateTimeInterface $time = null, Uuid $node = null): string
     47    {
     48        $uuidV1 = UuidV1::generate($time, $node);
     49        $uuid = substr($uuidV1, 15, 3).substr($uuidV1, 9, 4).$uuidV1[0].'-'.substr($uuidV1, 1, 4).'-6'.substr($uuidV1, 5, 3).substr($uuidV1, 18, 6);
     50
     51        if ($node) {
     52            return $uuid.substr($uuidV1, 24);
     53        }
     54
     55        // uuid_create() returns a stable "node" that can leak the MAC of the host, but
     56        // UUIDv6 prefers a truly random number here, let's XOR both to preserve the entropy
     57
     58        if (null === self::$node) {
     59            $seed = [random_int(0, 0xffffff), random_int(0, 0xffffff)];
     60            $node = unpack('N2', hex2bin('00'.substr($uuidV1, 24, 6)).hex2bin('00'.substr($uuidV1, 30)));
     61            self::$node = sprintf('%06x%06x', ($seed[0] ^ $node[1]) | 0x010000, $seed[1] ^ $node[2]);
     62        }
     63
     64        return $uuid.self::$node;
     65    }
    6766}
  • zettle-pos-integration/trunk/zettle-pos-integration.php

    r2538456 r2560431  
    88 * Plugin URI:  https://zettle.inpsyde.com/
    99 * Description: Zettle Point-Of-Sale Integration for WooCommerce
    10  * Version:     1.4.1
     10 * Version:     1.4.2
    1111 * Requires at least: 5.4
    1212 * Requires PHP: 7.2
Note: See TracChangeset for help on using the changeset viewer.