webcom
Version:
Webcom library
19 lines • 76.8 kB
JavaScript
/*!
* Webcom. Build realtime apps. Share and sync data instantly between your clients
*
* Module name: Webcom
* Version: 3.10.1
* Created: 2025-11-07T12:56:13.685Z
*
* Copyright (C) <2015-2025> Orange
*
* This software is confidential and proprietary information of Orange.
* You shall not disclose such Confidential Information and shall use it only in
* accordance with the terms of the agreement you entered into.
* Unauthorized copying of this file, via any medium is strictly prohibited.
*
* If you are Orange employee you shall use this software in accordance with
* the Orange Source Charter (http://opensource.itn.ftgroup/index.php/Orange_Source_Charter)
*/(()=>{var t={45:(t,e,n)=>{var r=n(738).default;t.exports=function(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)},t.exports.__esModule=!0,t.exports.default=t.exports},79:t=>{t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r},t.exports.__esModule=!0,t.exports.default=t.exports},122:(t,e,n)=>{var r=n(79);t.exports=function(t,e){if(t){if("string"==typeof t)return r(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}},t.exports.__esModule=!0,t.exports.default=t.exports},132:(t,e,n)=>{var r=n(901),i=n(291),o=n(122),a=n(869);t.exports=function(t){return r(t)||i(t)||o(t)||a()},t.exports.__esModule=!0,t.exports.default=t.exports},156:t=>{t.exports=function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],u=!0,c=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){c=!0,i=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}},t.exports.__esModule=!0,t.exports.default=t.exports},171:(t,e,n)=>{"use strict";n.d(e,{J:()=>r});var r=function(){if("undefined"!=typeof globalThis)return globalThis;return global}()},172:t=>{t.exports=function(t,e){this.v=t,this.k=e},t.exports.__esModule=!0,t.exports.default=t.exports},203:(t,e,n)=>{"use strict";n.d(e,{$8:()=>d,$x:()=>v,Ik:()=>O,Pc:()=>x,WP:()=>j,Yj:()=>w,ar:()=>p,cK:()=>I,gP:()=>P,gp:()=>m,lq:()=>y,se:()=>f,vA:()=>c,vD:()=>k,vM:()=>A,y:()=>_,zB:()=>g,zM:()=>S,zR:()=>u});var r=n(738),i=n.n(r),o=n(132),a=n.n(o),s=n(412),u="Webcom internal error";function c(t,e){t||d(u,e)}var h={values:[]};function l(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];Object.assign(h,{method:t,args:e||[],checkers:r})}function f(t,e,n){h.values.push({name:t,value:e,checker:n})}var d=function(t,e){var n;throw new Error("".concat((n="").concat.apply(n,a()(t)),": ").concat(e))};function p(t,e){if(!h.method){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];l.apply(void 0,[t,e].concat(r))}var o=h.method,a=h.args,s=h.checkers,u=h.values;Object.assign(h,{method:void 0,args:void 0,checkers:void 0,values:[]}),a.length>s.length&&d(o,"too many arguments, ".concat(a.length," instead of ").concat(s.length)),s.forEach(function(t,e){return v(t,a[e],o,function(t){return"argument #".concat(e+1," ").concat(t)})}),u.forEach(function(t){var e=t.name,n=t.value;return v(t.checker,n,o,function(t){return"".concat(e," ").concat(t)})})}function v(t,e,n,r){var i=t(e);i&&d(n,r(i))}function y(t){return function(e){return b("undefined")(e)&&t&&t(e)}}function g(t){return function(e){return null===e?"must not be null":t&&t(e)}}var _=function(t){return void 0===t?"is missing":""};function m(t){return function(e){return!(e instanceof t)&&"must be an instance of ".concat(t.name)}}function b(t){return function(e){return i()(e)!==t&&"must be a ".concat(t)}}var k=b("undefined"),w=b("string"),x=b("function"),S=b("boolean"),A=E(Number.isFinite,"must be a finite number"),O=b("object");function P(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(t){return e.every(function(e){return e(t)})&&"either ".concat(e.map(function(e){return e(t)}).join(" or "))}}function j(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(t){var n;return e.some(function(e){return n=e(t)})&&n}}var R="is not valid";function E(t,e){return function(n){return!t(n)&&(e||R)}}E(function(t){return(0,s.Et)(t)&&Math.floor(t)===t},"must be an integer");function I(t,e){return E(function(e){return t.test(e)},e)}},204:(t,e,n)=>{"use strict";n.d(e,{MX:()=>I,d1:()=>z,h:()=>V,Ay:()=>B});var r=n(132),i=n.n(r),o=n(383),a=n.n(o),s=n(579),u=n.n(s),c=n(715),h=n.n(c),l=n(171),f=n(854),d=n(412),p="console",v=f.y[p],y=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];var o=function(t){return(0,d.Gv)(t)?JSON.stringify(t):(t||"undefined").toString()};if((0,d.Kg)(t)){var a=0;return[t=t.replace(/%(.)/g,function(t,e){switch(e){case"%":return"%";case"s":case"o":case"O":return o(n[a++]);case"d":case"i":case"f":return n[a++];default:return t}})].concat(i()(n.slice(a).map(o))).join(" ")}return[t].concat(n).map(o).join(" ")};function g(t,e,n,r,i){if(!n||!r||!i){var o=e,a=function(t){return function(e){return o("[".concat(t,"] ").concat(e))}};n=n||a("INFO"),r=r||a("WARN"),i=i||a("ERR!"),e=a("LOG ")}return{log:function(){return e.call(t,y.apply(void 0,arguments))},info:function(){return n.call(t,y.apply(void 0,arguments))},warn:function(){return r.call(t,y.apply(void 0,arguments))},error:function(){return i.call(t,y.apply(void 0,arguments))}}}if((0,d.Tn)(v))v=g(l.J,v);else if((0,d.Gv)(v)&&v){var _=v,m=_.log,b=_.info,k=_.warn,w=_.error;v=g(v,m,b,k,w)}else{var x=function(t,e,n){for(var r=arguments.length,i=new Array(r>3?r-3:0),o=3;o<r;o++)i[o-3]=arguments[o];(0,d.Kg)(n)?(n="[".concat(t,"] ")+n,e.apply(void 0,[n].concat(i))):e.apply(void 0,["[".concat(t,"] "),n].concat(i))};v={log:x.bind(void 0,"LOG ",l.J[p].log),info:x.bind(void 0,"INFO",l.J[p].info),warn:x.bind(void 0,"WARN",l.J[p].warn),error:x.bind(void 0,"ERR!",l.J[p].error)}}(0,f.aZ)(p,function(){return v},function(t){return v=t});var S=n(203),A=n(304),O={};function P(t,e){var n=t.length;return n>=e?t.substring(0,e):t+I.substring(0,e-n)}function j(t){return t.map(function(t){return(0,d.Tn)(t)?t():t})}var R=u()(function t(e,n,r,i){a()(this,t),this._fqdn=e,this._prefix=n;var o=e.join(".");this._count=void 0===O[o]?O[o]=0:++O[o],this.displayTimestamp=r,this.setPrefixWidth(i||8),this._log=this._emitLog.bind(this,v.log),this._info=this._emitLog.bind(this,v.info),this._warn=this._emitLog.bind(this,v.warn),this._error=this._emitLog.bind(this,v.error),this._enabled=!0},[{key:"fqdn",get:function(){return this._fqdn}},{key:"_emitLog",value:function(t,e){var n=this.displayTimestamp?[(new Date).toISOString()]:[];n.push(this._displayedPrefix);for(var r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(0,d.Kg)(e)?(n.push(e),e=n.join(" "),t.apply(void 0,[e].concat(i()(j(o))))):t.apply(void 0,n.concat(i()(j([e].concat(o)))))}},{key:"setPrefixWidth",value:function(t){this._displayedPrefix="".concat(P(this._prefix,t)," #").concat(P(this._count.toString(),3))}},{key:"setLevel",value:function(t){this._enabled=t>=0,this.log=t>=B.LOG?this._log:A.lQ,this.info=t>=B.INFO?this._info:A.lQ,this.warn=t>=B.WARN?this._warn:A.lQ,this.error=t>=B.ERROR?this._error:A.lQ}},{key:"updateLevel",value:function(t){this._enabled&&this.setLevel(t)}}]),E=-1,I=" ",C=!1,T=15,N=[],M={},L={},D={},H="_leaf_";function F(t){return t?t.split("."):[]}function J(t){return{disabledDepth:W(t,D),enabledDepth:W(t,L)}}function U(t,e,n,r){for(var i=0;i<t.length;){var o=t[i++];e.hasOwnProperty(o)||(e[o]={}),e=e[o]}r&&Object.keys(e).forEach(function(t){return delete e[t]}),e[H]=n}function q(t,e){for(var n=0;n<t.length;){var r=t[n++];if(!e.hasOwnProperty(r))return;e=e[r]}delete e[H]}function W(t,e){var n=-1,r=0;do{e.hasOwnProperty(H)&&(n=r)}while(r<t.length&&(e=e[t[r++]]));return n}function K(t,e){Object.entries(t||{}).forEach(function(t){var n=h()(t,2),r=n[0],i=n[1];r===H?e(i):K(i,e)})}function Y(t,e){for(var n=[],r=0;e&&r<t.length;)e=e[t[r++]];return K(e,function(t){return n.push(t)}),n}function G(t){C=t,N.forEach(function(t){return t.displayTimestamp=C})}var z="LogManager",B=function(){function t(){a()(this,t)}return u()(t,null,[{key:"enable",value:function(e){(0,S.ar)([z,".enable"],arguments,(0,S.lq)(S.Yj));var n=F(e),r=J(n),i=r.enabledDepth,o=r.disabledDepth;i<=o&&(o<0&&t.disable(),U(n,L,!0,!0),q(n,D),Y(n,M).forEach(function(t){return t.setLevel(Q)}))}},{key:"disable",value:function(t){(0,S.ar)([z,".disable"],arguments,(0,S.lq)(S.Yj));var e=F(t),n=J(e),r=n.enabledDepth;n.disabledDepth<=r&&(U(e,D,!0,!0),q(e,L),Y(e,M).forEach(function(t){return t.setLevel(E)}))}},{key:"showTimestamp",value:function(){(0,S.ar)([z,".showTimestamp"],arguments),G(!0)}},{key:"hideTimestamp",value:function(){(0,S.ar)([z,".hideTimestamp"],arguments),G(!1)}},{key:"setPrefixWidth",value:function(t){(0,S.ar)([z,".setPrefixWidth"],arguments,S.vM),t<0?t=0:t>I.length&&(t=I.length),T=t,N.forEach(function(t){return t.setPrefixWidth(T)})}},{key:"level",get:function(){return Q},set:function(t){(0,S.ar)([z,".level"],arguments,S.vM),t>E&&t!==Q&&(N.forEach(function(e){return e.updateLevel(t)}),Q=t)}},{key:"LOG",get:function(){return 4}},{key:"INFO",get:function(){return 3}},{key:"WARN",get:function(){return 2}},{key:"ERROR",get:function(){return 1}},{key:"NONE",get:function(){return 0}},{key:"debugOnCallback",value:function(t){var e=t&&t.toUpperCase();return function(t,n){return v.log("********** UPDATE ".concat(e||t.ref().pathString()," **********"),t.toString(),n?"[<<".concat(n,"]"):"")}}},{key:"debugOnCompletionCallback",value:function(t,e){var n=t&&t.toUpperCase();return function(t){return t?v.log("********** REVOKED ".concat(n," **********"),t):v.log("********** COMPLETED ".concat(n," **********")),e}}},{key:"debugOnCallbackWithCancel",value:function(e){var n=e&&e.toUpperCase();return[t.debugOnCallback(e),function(t){return v.log.apply(v,["********** COMPLETE ".concat(n," **********")].concat(i()(t?["FAILED:",t.code,t.message]:["cancelled"])))}]}}])}();function V(t,e){var n=F(t),r=new R(n,e||n[n.length-1],C,T);return function(t){var e=t.fqdn;U(e,M,t),N.push(t);var n=J(e),r=n.disabledDepth,i=n.enabledDepth;t.setLevel(i>=r?Q:E)}(r),r}var Q=B.INFO},250:(t,e,n)=>{var r=n(887);t.exports=function(t,e,n,i,o){var a=r(t,e,n,i,o);return a.next().then(function(t){return t.done?t.value:a.next()})},t.exports.__esModule=!0,t.exports.default=t.exports},280:(t,e,n)=>{"use strict";n.d(e,{vG:()=>f,wg:()=>a,yb:()=>h});var r=n(171),i=n(854),o="setTimeout",a=i.y[o];a||(a=r.J[o]),(0,i.aZ)(o,function(){return a},function(t){return a=t}),r.J[o]||(r.J[o]=a),r.J.setImmediate||(r.J.setImmediate=a);var s="clearTimeout",u=i.y[s];u||(u=r.J[s]),(0,i.aZ)(s,function(){return u},function(t){return u=t}),r.J[s]||(r.J[s]=u),r.J.clearImmediate||(r.J.clearImmediate=u);var c="setInterval",h=i.y[c];h||(h=r.J[c]),(0,i.aZ)(c,function(){return h},function(t){return h=t});var l="clearInterval",f=i.y[l];f||(f=r.J[l]),(0,i.aZ)(l,function(){return f},function(t){return f=t})},291:t=>{t.exports=function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)},t.exports.__esModule=!0,t.exports.default=t.exports},293:t=>{function e(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}t.exports=function(t){return function(){var n=this,r=arguments;return new Promise(function(i,o){var a=t.apply(n,r);function s(t){e(a,i,o,s,u,"next",t)}function u(t){e(a,i,o,s,u,"throw",t)}s(void 0)})}},t.exports.__esModule=!0,t.exports.default=t.exports},296:(t,e,n)=>{"use strict";n.d(e,{Ls:()=>l,Ov:()=>h});n(171);var r=n(854),i="browser",o="mobile/",a="node",s="".concat(o,"android"),u="".concat(o,"iOS"),c={};c[i]="b",c[s]="a",c[u]="i",c[a]="n";var h,l=!0,f="device",d=r.y[f];d||p(a);function p(t){d=t,l=t===i,0===t.indexOf(o),h=(c[t]||"")+"3.10.1"}(0,r.aZ)(f,function(){return d},function(t){return p(t)})},304:(t,e,n)=>{"use strict";n.d(e,{lQ:()=>r});n(280);var r=Function.prototype},373:t=>{t.exports=function(t){var e=Object(t),n=[];for(var r in e)n.unshift(r);return function t(){for(;n.length;)if((r=n.pop())in e)return t.value=r,t.done=!1,t;return t.done=!0,t}},t.exports.__esModule=!0,t.exports.default=t.exports},383:t=>{t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.__esModule=!0,t.exports.default=t.exports},412:(t,e,n)=>{"use strict";n.d(e,{Et:()=>u,Gv:()=>h,Kg:()=>s,Lm:()=>a,Tn:()=>c,yi:()=>l});var r=n(738),i=n.n(r),o=n(296);function a(t){return"boolean"==typeof t}function s(t){return"string"==typeof t}function u(t){return"number"==typeof t}function c(t){return"function"==typeof t}function h(t){return"object"===i()(t)}function l(){return o.Ls&&(window.navigator.userAgent.match(/CriOS|Twitter for iPhone|FBAN\/FBIOS|Windows Phone/)||window.navigator.standalone)}},546:t=>{function e(n,r,i,o){var a=Object.defineProperty;try{a({},"",{})}catch(n){a=0}t.exports=e=function(t,n,r,i){function o(n,r){e(t,n,function(t){return this._invoke(n,r,t)})}n?a?a(t,n,{value:r,enumerable:!i,configurable:!i,writable:!i}):t[n]=r:(o("next",0),o("throw",1),o("return",2))},t.exports.__esModule=!0,t.exports.default=t.exports,e(n,r,i,o)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},550:t=>{function e(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(n){}return(t.exports=e=function(){return!!n},t.exports.__esModule=!0,t.exports.default=t.exports)()}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},579:(t,e,n)=>{var r=n(736);function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,r(i.key),i)}}t.exports=function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t},t.exports.__esModule=!0,t.exports.default=t.exports},633:(t,e,n)=>{var r=n(172),i=n(993),o=n(250),a=n(887),s=n(791),u=n(373),c=n(960);function h(){"use strict";var e=i(),n=e.m(h),l=(Object.getPrototypeOf?Object.getPrototypeOf(n):n.__proto__).constructor;function f(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===l||"GeneratorFunction"===(e.displayName||e.name))}var d={throw:1,return:2,break:3,continue:3};function p(t){var e,n;return function(r){e||(e={stop:function(){return n(r.a,2)},catch:function(){return r.v},abrupt:function(t,e){return n(r.a,d[t],e)},delegateYield:function(t,i,o){return e.resultName=i,n(r.d,c(t),o)},finish:function(t){return n(r.f,t)}},n=function(t,n,i){r.p=e.prev,r.n=e.next;try{return t(n,i)}finally{e.next=r.n}}),e.resultName&&(e[e.resultName]=r.v,e.resultName=void 0),e.sent=r.v,e.next=r.n;try{return t.call(this,e)}finally{r.p=e.prev,r.n=e.next}}}return(t.exports=h=function(){return{wrap:function(t,n,r,i){return e.w(p(t),n,r,i&&i.reverse())},isGeneratorFunction:f,mark:e.m,awrap:function(t,e){return new r(t,e)},AsyncIterator:s,async:function(t,e,n,r,i){return(f(e)?a:o)(p(t),e,n,r,i)},keys:u,values:c}},t.exports.__esModule=!0,t.exports.default=t.exports)()}t.exports=h,t.exports.__esModule=!0,t.exports.default=t.exports},636:t=>{function e(n,r){return t.exports=e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},t.exports.__esModule=!0,t.exports.default=t.exports,e(n,r)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},646:(t,e,n)=>{var r=n(550),i=n(636);t.exports=function(t,e,n){if(r())return Reflect.construct.apply(null,arguments);var o=[null];o.push.apply(o,e);var a=new(t.bind.apply(t,o));return n&&i(a,n.prototype),a},t.exports.__esModule=!0,t.exports.default=t.exports},693:(t,e,n)=>{var r=n(736);t.exports=function(t,e,n){return(e=r(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},t.exports.__esModule=!0,t.exports.default=t.exports},715:(t,e,n)=>{var r=n(987),i=n(156),o=n(122),a=n(752);t.exports=function(t,e){return r(t)||i(t,e)||o(t,e)||a()},t.exports.__esModule=!0,t.exports.default=t.exports},736:(t,e,n)=>{var r=n(738).default,i=n(45);t.exports=function(t){var e=i(t,"string");return"symbol"==r(e)?e:e+""},t.exports.__esModule=!0,t.exports.default=t.exports},738:t=>{function e(n){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(n)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},752:t=>{t.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.")},t.exports.__esModule=!0,t.exports.default=t.exports},756:(t,e,n)=>{var r=n(633)();t.exports=r;try{regeneratorRuntime=r}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},757:(t,e,n)=>{"use strict";n.d(e,{n:()=>S});var r=n(715),i=n.n(r),o=n(383),a=n.n(o),s=n(579),u=n.n(s),c=n(854),h="env",l=c.y[h];l||(l=process[h]),(0,c.aZ)(h,function(){return l},function(t){return l=t});var f,d,p,v,y=(0,n(204).h)("network.nodeProxy");function g(t){try{return new URL(t)}catch(t){return null}}!function(){if(f=g(l.http_proxy||l.HTTP_PROXY),d=g(l.https_proxy||l.HTTPS_PROXY),p=l.no_proxy||l.NO_PROXY,y.log("Node.js proxy layer set to: http_proxy='".concat(f,"'; https_proxy='").concat(d,"'; no_proxy=").concat(p)),p){var t=p.split(",");v=t.indexOf("*")<0?function(e){return t.every(function(t){return!e.origin.endsWith(t)})}:function(){return!1}}else v=function(){return!0}}();const _=require("http");var m=n.n(_);const b=require("https");var k=n.n(b),w=n(412),x=n(203),S=u()(function t(){a()(this,t),this.readyState=0,this._headers={},this.status=0},[{key:"open",value:function(t,e){this._method=t,this._href=e}},{key:"setRequestHeader",value:function(t,e){this._headers[t]=e}},{key:"send",value:function(t){(0,w.Tn)(this.onreadystatechange)||(0,x.$8)("NodeXmlHttpRequest","missing onreadystatechange event handler"),t&&(t=Buffer.from(t),this._headers["Content-Length"]=t.length),O.call(this,t)}},{key:"getAllResponseHeaders",value:function(){return Object.entries(this._headers).reduce(function(t,e){var n=i()(e,2),r=n[0],o=n[1];return"".concat(t,"\n").concat(r,": ").concat(o)},"")}}],[{key:"DONE",get:function(){return 4}}]);function A(t){this.responseText=t.message,this._headers={},this.readyState=4,this.onreadystatechange()}function O(t){var e=this,n=function(t){var e=new URL(t);switch(e.protocol){case"http:":case"ws:":return f&&v(e)?{url:e,secure:!1,proxy:f}:{url:e,secure:!1};case"https:":case"wss:":return d&&v(e)?{url:e,secure:!0,proxy:d}:{url:e,secure:!0};default:return{url:e,secure:!1}}}(this._href),r=n.url,i=n.secure,o=n.proxy;if(o)if(i){var a=r.hostname+":443",s=m().request({protocol:o.protocol,hostname:o.hostname,port:o.port,method:"CONNECT",path:a});s.on("connect",function(n,i){if(200===n.statusCode){var o=k().request({host:r.host,path:r.pathname+r.search+r.hash,method:e._method,agent:new(k().Agent)({socket:i})});P.call(e,o,t)}else A.call(e,new Error("Status ".concat(n.statusCode)))}),s.on("error",A.bind(this)),s.setHeader("Host",a),s.end()}else{var u=m().request({protocol:o.protocol,hostname:o.hostname,port:o.port,method:this._method,path:r.href});u.setHeader("Host",r.host),P.call(this,u,t)}else{var c=(i?k():m()).request({protocol:r.protocol,hostname:r.hostname,port:r.port,method:this._method,path:r.pathname+r.search+r.hash});c.setHeader("Host",r.host),P.call(this,c,t)}}function P(t,e){var n=this;Object.entries(this._headers).forEach(function(e){var n=i()(e,2),r=n[0],o=n[1];return t.setHeader(r,o)}),e&&t.write(e),t.on("error",A.bind(this)),t.on("response",function(t){var r=[];t.on("data",function(t){return r.push(t)}),t.on("error",A.bind(n)),t.on("end",function(){n.status=t.statusCode;var i=[301,302,303,307,308].includes(n.status)&&t.headers.location;i?(n._href=i,O.call(n,e)):(n.readyState=4,n.responseText=Buffer.concat(r).toString("utf8"),n._headers=t.headers,n.onreadystatechange())})}),t.end()}},779:(t,e)=>{"use strict";var n,r={cipher:{},hash:{},keyexchange:{},mode:{},misc:{},codec:{},exception:{corrupt:function(t){this.toString=function(){return"CORRUPT: "+this.message},this.message=t},invalid:function(t){this.toString=function(){return"INVALID: "+this.message},this.message=t},bug:function(t){this.toString=function(){return"BUG: "+this.message},this.message=t},notReady:function(t){this.toString=function(){return"NOT READY: "+this.message},this.message=t}}};r.bitArray={bitSlice:function(t,e,n){return t=r.bitArray._shiftRight(t.slice(e/32),32-(31&e)).slice(1),void 0===n?t:r.bitArray.clamp(t,n-e)},extract:function(t,e,n){var r=Math.floor(-e-n&31);return(-32&(e+n-1^e)?t[e/32|0]<<32-r^t[e/32+1|0]>>>r:t[e/32|0]>>>r)&(1<<n)-1},concat:function(t,e){if(0===t.length||0===e.length)return t.concat(e);var n=t[t.length-1],i=r.bitArray.getPartial(n);return 32===i?t.concat(e):r.bitArray._shiftRight(e,i,0|n,t.slice(0,t.length-1))},bitLength:function(t){var e,n=t.length;return 0===n?0:(e=t[n-1],32*(n-1)+r.bitArray.getPartial(e))},clamp:function(t,e){if(32*t.length<e)return t;var n=(t=t.slice(0,Math.ceil(e/32))).length;return e&=31,n>0&&e&&(t[n-1]=r.bitArray.partial(e,t[n-1]&2147483648>>e-1,1)),t},partial:function(t,e,n){return 32===t?e:(n?0|e:e<<32-t)+1099511627776*t},getPartial:function(t){return Math.round(t/1099511627776)||32},equal:function(t,e){if(r.bitArray.bitLength(t)!==r.bitArray.bitLength(e))return!1;var n,i=0;for(n=0;n<t.length;n++)i|=t[n]^e[n];return 0===i},_shiftRight:function(t,e,n,i){var o,a,s;for(void 0===i&&(i=[]);e>=32;e-=32)i.push(n),n=0;if(0===e)return i.concat(t);for(o=0;o<t.length;o++)i.push(n|t[o]>>>e),n=t[o]<<32-e;return a=t.length?t[t.length-1]:0,s=r.bitArray.getPartial(a),i.push(r.bitArray.partial(e+s&31,e+s>32?n:i.pop(),1)),i},_xor4:function(t,e){return[t[0]^e[0],t[1]^e[1],t[2]^e[2],t[3]^e[3]]},byteswapM:function(t){var e,n;for(e=0;e<t.length;++e)n=t[e],t[e]=n>>>24|n>>>8&65280|(65280&n)<<8|n<<24;return t}},r.codec.utf8String={fromBits:function(t){var e,n,i="",o=r.bitArray.bitLength(t);for(e=0;e<o/8;e++)3&e||(n=t[e/4]),i+=String.fromCharCode(n>>>8>>>8>>>8),n<<=8;return decodeURIComponent(escape(i))},toBits:function(t){t=unescape(encodeURIComponent(t));var e,n=[],i=0;for(e=0;e<t.length;e++)i=i<<8|t.charCodeAt(e),3&~e||(n.push(i),i=0);return 3&e&&n.push(r.bitArray.partial(8*(3&e),i)),n}},r.codec.base64={_chars:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",fromBits:function(t,e,n){var i,o="",a=0,s=r.codec.base64._chars,u=0,c=r.bitArray.bitLength(t);for(n&&(s=s.substr(0,62)+"-_"),i=0;6*o.length<c;)o+=s.charAt((u^t[i]>>>a)>>>26),a<6?(u=t[i]<<6-a,a+=26,i++):(u<<=6,a-=6);for(;3&o.length&&!e;)o+="=";return o},toBits:function(t,e){t=t.replace(/\s|=/g,"");var n,i,o=[],a=0,s=r.codec.base64._chars,u=0;for(e&&(s=s.substr(0,62)+"-_"),n=0;n<t.length;n++){if((i=s.indexOf(t.charAt(n)))<0)throw new r.exception.invalid("this isn't base64!");a>26?(a-=26,o.push(u^i>>>a),u=i<<32-a):u^=i<<32-(a+=6)}return 56&a&&o.push(r.bitArray.partial(56&a,u,1)),o}},r.codec.base64url={fromBits:function(t){return r.codec.base64.fromBits(t,1,1)},toBits:function(t){return r.codec.base64.toBits(t,1)}},r.hash.sha256=function(t){this._key[0]||this._precompute(),t?(this._h=t._h.slice(0),this._buffer=t._buffer.slice(0),this._length=t._length):this.reset()},r.hash.sha256.hash=function(t){return(new r.hash.sha256).update(t).finalize()},r.hash.sha256.prototype={blockSize:512,reset:function(){return this._h=this._init.slice(0),this._buffer=[],this._length=0,this},update:function(t){"string"==typeof t&&(t=r.codec.utf8String.toBits(t));var e,n=this._buffer=r.bitArray.concat(this._buffer,t),i=this._length,o=this._length=i+r.bitArray.bitLength(t);if(o>9007199254740991)throw new r.exception.invalid("Cannot hash more than 2^53 - 1 bits");if("undefined"!=typeof Uint32Array){var a=new Uint32Array(n),s=0;for(e=512+i-(512+i&511);e<=o;e+=512)this._block(a.subarray(16*s,16*(s+1))),s+=1;n.splice(0,16*s)}else for(e=512+i-(512+i&511);e<=o;e+=512)this._block(n.splice(0,16));return this},finalize:function(){var t,e=this._buffer,n=this._h;for(t=(e=r.bitArray.concat(e,[r.bitArray.partial(1,1)])).length+2;15&t;t++)e.push(0);for(e.push(Math.floor(this._length/4294967296)),e.push(0|this._length);e.length;)this._block(e.splice(0,16));return this.reset(),n},_init:[],_key:[],_precompute:function(){var t,e,n=0,r=2;function i(t){return 4294967296*(t-Math.floor(t))|0}for(;n<64;r++){for(e=!0,t=2;t*t<=r;t++)if(r%t===0){e=!1;break}e&&(n<8&&(this._init[n]=i(Math.pow(r,.5))),this._key[n]=i(Math.pow(r,1/3)),n++)}},_block:function(t){var e,n,r,i,o=this._h,a=this._key,s=o[0],u=o[1],c=o[2],h=o[3],l=o[4],f=o[5],d=o[6],p=o[7];for(e=0;e<64;e++)e<16?n=t[e]:(r=t[e+1&15],i=t[e+14&15],n=t[15&e]=(r>>>7^r>>>18^r>>>3^r<<25^r<<14)+(i>>>17^i>>>19^i>>>10^i<<15^i<<13)+t[15&e]+t[e+9&15]|0),n=n+p+(l>>>6^l>>>11^l>>>25^l<<26^l<<21^l<<7)+(d^l&(f^d))+a[e],p=d,d=f,f=l,l=h+n|0,h=c,c=u,s=n+((u=s)&c^h&(u^c))+(u>>>2^u>>>13^u>>>22^u<<30^u<<19^u<<10)|0;o[0]=o[0]+s|0,o[1]=o[1]+u|0,o[2]=o[2]+c|0,o[3]=o[3]+h|0,o[4]=o[4]+l|0,o[5]=o[5]+f|0,o[6]=o[6]+d|0,o[7]=o[7]+p|0}},r.hash.sha1=function(t){t?(this._h=t._h.slice(0),this._buffer=t._buffer.slice(0),this._length=t._length):this.reset()},r.hash.sha1.hash=function(t){return(new r.hash.sha1).update(t).finalize()},r.hash.sha1.prototype={blockSize:512,reset:function(){return this._h=this._init.slice(0),this._buffer=[],this._length=0,this},update:function(t){"string"==typeof t&&(t=r.codec.utf8String.toBits(t));var e,n=this._buffer=r.bitArray.concat(this._buffer,t),i=this._length,o=this._length=i+r.bitArray.bitLength(t);if(o>9007199254740991)throw new r.exception.invalid("Cannot hash more than 2^53 - 1 bits");if("undefined"!=typeof Uint32Array){var a=new Uint32Array(n),s=0;for(e=this.blockSize+i-(this.blockSize+i&this.blockSize-1);e<=o;e+=this.blockSize)this._block(a.subarray(16*s,16*(s+1))),s+=1;n.splice(0,16*s)}else for(e=this.blockSize+i-(this.blockSize+i&this.blockSize-1);e<=o;e+=this.blockSize)this._block(n.splice(0,16));return this},finalize:function(){var t,e=this._buffer,n=this._h;for(t=(e=r.bitArray.concat(e,[r.bitArray.partial(1,1)])).length+2;15&t;t++)e.push(0);for(e.push(Math.floor(this._length/4294967296)),e.push(0|this._length);e.length;)this._block(e.splice(0,16));return this.reset(),n},_init:[1732584193,4023233417,2562383102,271733878,3285377520],_key:[1518500249,1859775393,2400959708,3395469782],_f:function(t,e,n,r){return t<=19?e&n|~e&r:t<=39?e^n^r:t<=59?e&n|e&r|n&r:t<=79?e^n^r:void 0},_S:function(t,e){return e<<t|e>>>32-t},_block:function(t){var e,n,r,i,o,a,s,u,c=this._h;if("undefined"!=typeof Uint32Array){u=Array(80);for(var h=0;h<16;h++)u[h]=t[h]}else u=t;for(r=c[0],i=c[1],o=c[2],a=c[3],s=c[4],e=0;e<=79;e++)e>=16&&(u[e]=this._S(1,u[e-3]^u[e-8]^u[e-14]^u[e-16])),n=this._S(5,r)+this._f(e,i,o,a)+s+u[e]+this._key[Math.floor(e/20)]|0,s=a,a=o,o=this._S(30,i),i=r,r=n;c[0]=c[0]+r|0,c[1]=c[1]+i|0,c[2]=c[2]+o|0,c[3]=c[3]+a|0,c[4]=c[4]+s|0}},t.exports&&(t.exports=r),void 0===(n=function(){return r}.apply(e,[]))||(t.exports=n)},791:(t,e,n)=>{var r=n(172),i=n(546);t.exports=function t(e,n){function o(t,i,a,s){try{var u=e[t](i),c=u.value;return c instanceof r?n.resolve(c.v).then(function(t){o("next",t,a,s)},function(t){o("throw",t,a,s)}):n.resolve(c).then(function(t){u.value=t,a(u)},function(t){return o("throw",t,a,s)})}catch(t){s(t)}}var a;this.next||(i(t.prototype),i(t.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),i(this,"_invoke",function(t,e,r){function i(){return new n(function(e,n){o(t,r,e,n)})}return a=a?a.then(i,i):i()},!0)},t.exports.__esModule=!0,t.exports.default=t.exports},854:(t,e,n)=>{"use strict";n.d(e,{El:()=>i,aZ:()=>o,y:()=>r});var r=n(171).J.WebcomDependencies||{},i={};function o(t,e,n){Object.defineProperty(i,t,{enumerable:!0,get:e,set:n})}},869:t=>{t.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.")},t.exports.__esModule=!0,t.exports.default=t.exports},887:(t,e,n)=>{var r=n(993),i=n(791);t.exports=function(t,e,n,o,a){return new i(r().w(t,e,n,o),a||Promise)},t.exports.__esModule=!0,t.exports.default=t.exports},896:t=>{"use strict";t.exports=require("fs")},901:(t,e,n)=>{var r=n(79);t.exports=function(t){if(Array.isArray(t))return r(t)},t.exports.__esModule=!0,t.exports.default=t.exports},960:(t,e,n)=>{var r=n(738).default;t.exports=function(t){if(null!=t){var e=t["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}throw new TypeError(r(t)+" is not iterable")},t.exports.__esModule=!0,t.exports.default=t.exports},982:t=>{"use strict";t.exports=require("crypto")},987:t=>{t.exports=function(t){if(Array.isArray(t))return t},t.exports.__esModule=!0,t.exports.default=t.exports},993:(t,e,n)=>{var r=n(546);function i(){
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
var e,n,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.toStringTag||"@@toStringTag";function u(t,i,o,a){var s=i&&i.prototype instanceof h?i:h,u=Object.create(s.prototype);return r(u,"_invoke",function(t,r,i){var o,a,s,u=0,h=i||[],l=!1,f={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,n){return o=t,a=0,s=e,f.n=n,c}};function d(t,r){for(a=t,s=r,n=0;!l&&u&&!i&&n<h.length;n++){var i,o=h[n],d=f.p,p=o[2];t>3?(i=p===r)&&(s=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=d&&((i=t<2&&d<o[1])?(a=0,f.v=r,f.n=o[1]):d<p&&(i=t<3||o[0]>r||r>p)&&(o[4]=t,o[5]=r,f.n=p,a=0))}if(i||t>1)return c;throw l=!0,r}return function(i,h,p){if(u>1)throw TypeError("Generator is already running");for(l&&1===h&&d(h,p),a=h,s=p;(n=a<2?e:s)||!l;){o||(a?a<3?(a>1&&(f.n=-1),d(a,s)):f.n=s:f.v=s);try{if(u=2,o){if(a||(i="next"),n=o[i]){if(!(n=n.call(o,s)))throw TypeError("iterator result is not an object");if(!n.done)return n;s=n.value,a<2&&(a=0)}else 1===a&&(n=o.return)&&n.call(o),a<2&&(s=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((n=(l=f.n<0)?s:t.call(r,f))!==c)break}catch(t){o=e,a=1,s=t}finally{u=1}}return{value:n,done:l}}}(t,o,a),!0),u}var c={};function h(){}function l(){}function f(){}n=Object.getPrototypeOf;var d=[][a]?n(n([][a]())):(r(n={},a,function(){return this}),n),p=f.prototype=h.prototype=Object.create(d);function v(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,r(t,s,"GeneratorFunction")),t.prototype=Object.create(p),t}return l.prototype=f,r(p,"constructor",f),r(f,"constructor",l),l.displayName="GeneratorFunction",r(f,s,"GeneratorFunction"),r(p),r(p,s,"Generator"),r(p,a,function(){return this}),r(p,"toString",function(){return"[object Generator]"}),(t.exports=i=function(){return{w:u,m:v}},t.exports.__esModule=!0,t.exports.default=t.exports)()}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={exports:{}};return t[r](o,o.exports,n),o.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var r={};(()=>{"use strict";n.d(r,{default:()=>b});var t=n(171),e=n(383),i=n.n(e),o=n(579),a=n.n(o),s=n(715),u=n.n(s),c=n(203),h=n(204),l=n(412),f="WebcomApp",d=a()(function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i()(this,t),(0,c.ar)(["new ",f],arguments,(0,c.cK)(/^[a-z0-9](?:[-a-z0-9]{0,38}[a-z0-9])?$/),(0,c.lq)((0,c.gP)(c.Ik,c.Yj))),this._logger=(0,h.h)("api.WebcomApp",f),this._services={},this.appId=e,this.config={},(0,l.Kg)(n)&&(n=Object.keys(y).reduce(function(t,e){return t[e]={baseUrl:n},t},{})),this._fillConfig(n),this._logger.log("Initialized %s with options %s",e,JSON.stringify(this.config))},[{key:"dispose",value:function(){(0,c.ar)([f,"#dispose"],arguments),Object.values(this._services).forEach(function(t){return t._dispose()}),this._services={}}},{key:"_fillConfig",value:function(t){p.call(this,t,y)}},{key:"toString",value:function(){return"".concat(this.appId,"{").concat(Object.keys(this._services).join(","),"}")}}]);function p(t,e){var n=this,r=function(t,e,i,o){var a=function(t){return"".concat(f,".Configuration.").concat(o.concat(t).join("."))};e=Object.assign({},e),Object.entries(i).forEach(function(i){var s=u()(i,2),h=s[0],l=s[1];if(l instanceof Object&&!(l instanceof Array))t[h]=t[h]||{},r(t[h],e[h]||{},l,o.concat(h));else{var f=e[h],d=l[1]||function(t){return t};try{t[h]=d(void 0===f?void 0===t[h]?l.length?l[0]:l:t[h]:f)}catch(e){var p=a(h);void 0===e.value?(0,c.$8)(p,e.message):(n._logger.warn("%s: %s",p,e.message),t[h]=e.value)}}delete e[h]}),Object.keys(e).forEach(function(t){return n._logger.warn("%s: unknown config key",a(t))})};r(this.config,t,e,[])}function v(t,e,n){return"".concat(n.key,":").concat(e,":").concat(function(t,e){var n=e.baseUrl;return"/".concat(n.protocol.slice(0,-1),"/").concat(n.host,"/").concat(t.appId,"/")}(t,n))}var y={},g=n(854),_="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz";var m="Webcom",b=a()(function t(){i()(this,t),this._init.apply(this,arguments)},[{key:"_init",value:function(){(0,c.$8)(["new ",m],"this static class cannot be instantiated")}}],[{key:"SDK_VERSION",get:function(){return"3.10.1"}},{key:"Log",get:function(){return h.Ay}},{key:"App",value:function(t,e){return new d(t,e)}},{key:"getUniqueKeyDate",value:function(t){return new Date(function(t){for(var e=t.substring(0,8),n=0,r=0;r<8;++r)n=64*n+_.indexOf(e[r]);return n}(t))}},{key:"dependencies",get:function(){return g.El}}]),k=(0,h.h)("api.Webcom",m),w=n(132),x=n.n(w),S=n(296);function A(t){"http:"===t.protocol&&S.Ls&&"https:"===window.location.protocol&&this._logger.warn("Insecure access to a Webcom service from a secure page. Please setup your service with an https protocol.")}var O=new RegExp("^(?:([^:]+:)//)?(?:[^/@]+@)?([^/:]+(?::\\d+)?)(?:/.*)?$"),P="io.datasync.orange.com";function j(e){if(e&&(t.J.URL&&e instanceof URL||e.href&&e.protocol&&e.host))return e;var n=e?O.exec(e):[P,void 0,P];if(n){var r=u()(n,3),i=r[0],o=r[1],a=r[2];return o||(i="".concat(o="https:","//").concat(i)),{href:i,protocol:o,host:a}}throw new Error("cannot parse base URL: ".concat(e))}function R(t,e){return function(n){var r=t(n);if(r)throw new Error(r);return e?e(n):n}}var E=n(738),I=n.n(E);function C(t,e,n,r){return N(t.prototype,e,n,r)}function T(t,e,n,r){return M(t,e,{value:n},r)}function N(t,e,n,r){return M(t,e,{get:n},r)}function M(t,e,n,r){return Object.defineProperty(t,e,Object.assign(n,{enumerable:r,configurable:!0}))}var L="some",D="required",H="none",F=a()(function t(e,n){i()(this,t),(0,c.vA)(e===L||e===D||e===H,"Wrong state value for a new State object: expecting 'some', 'required' or 'none'."),this.state=e,(0,c.vA)(e!==L||n&&n.webcomAuthToken,"Missing details or webcomAuthToken for a new 'some' State"),this.details=n},[{key:"isUnauthenticated",value:function(){return this.state===H}},{key:"isAuthenticated",value:function(){return this.state===L}},{key:"isRequired",value:function(){return this.state===D}},{key:"isSameAs",value:function(t){return this.state===t.state&&(this.state!==L||this.details.webcomAuthToken===t.details.webcomAuthToken)}}]),J=new F(H),U=(new F(D),function(t){return new F(L,t)});var q,W="Authentication";function K(t){switch((0,c.ar)([m,".avatarURL"],arguments,c.Ik),t&&t.provider){case"facebook":return"https://graph.facebook.com/".concat(t.providerUid,"/picture?type=large");case"github":return t.providerProfile.avatar_url;case"gitlab":case"google":return t.providerProfile.picture}}y[W]={from:[void 0,R((0,c.lq)((0,c.gp)(d)))],baseUrl:[null,j],storage:[void 0,R((0,c.lq)((0,c.gP)(c.Yj,c.Pc)))],initialState:[void 0,function(t){return t&&JSON.parse(t)}],key:[void 0,R(c.vD,function(){return"auth"})]},C(d,"authentication",function(){var t=this._services[W];if(!t){var e=this.config[W].from;t=e?e.authentication:q(this),this._services[W]=t}return t});var Y=n(280);function G(t){var e=t.code||"UNKNOWN_ERROR",n=t.message||JSON.stringify(t),r=new Error("".concat(e,"[").concat(n,"]"));return r.code=e,r}var z=a()(function t(){i()(this,t),this.cache_={}},[{key:"length",get:function(){return Object.keys(this.cache_).length}},{key:"key",value:function(t){var e=Object.keys(this.cache_);return 0<=t&&t<e.length?e[t]:null}},{key:"getItem",value:function(t){return this.cache_.hasOwnProperty(t)?this.cache_[t]:null}},{key:"setItem",value:function(t,e){this.cache_[t]=e}},{key:"removeItem",value:function(t){delete this.cache_[t]}},{key:"clear",value:function(){this.cache_={}}}]),B="localStorage",V=g.y[B];V||(V=t.J[B]||new z),(0,g.aZ)(B,function(){return V},function(t){return V=t});var Q="sessionStorage",$=g.y[Q];function Z(t){return"webcom:"+t}$||($=t.J[Q]||null),(0,g.aZ)(Q,function(){return $},function(t){return $=t});var X=a()(function t(e,n){i()(this,t);var r=e();if(r){var o=Z("sentinel");r.setItem(o,""),r.removeItem(o)}function a(){return e()||(0,c.$8)("JSONStorage","the ".concat(n," implementation could not be found!"))}this.set=function(t,e){if(null===e)a().removeItem(Z(t));else{var n=JSON.stringify(e);a().setItem(Z(t),"string"==typeof n?n:"null")}},this.get=function(t){var e=a().getItem(Z(t));return e&&JSON.parse(e)},this.remove=function(t){a().removeItem(Z(t))}}),tt=new X(function(){return V},"localStorage"),et=new X(function(){return $},"sessionStorage"),nt=n(779),rt=n.n(nt);function it(t){return decodeURIComponent(t.replace(/\+/g," "))}function ot(){var t=2147483648;return Math.floor(Math.random()*t).toString(36)+Math.abs(Math.floor(Math.random()*t)^Date.now()).toString(36)}function at(t){var e={};return t.replace(/^[^?]*\?/,"").split("&").forEach(function(t){var n=t.indexOf("=");if(n<0)e[it(t)]=!0;else{var r=it(t.substring(0,n));e[r]=it(t.substring(n+1))}}),e}function st(t){if(!t)return"";var e=[];return Object.entries(t).forEach(function(t){var n=u()(t,2),r=n[0],i=n[1];null!=i&&((0,l.Gv)(i)&&(i=JSON.stringify(i)),e.push(encodeURIComponent(r)+"="+encodeURIComponent(i)))}),e.join("&")}function ut(t,e){var n=t.indexOf("?"),r=e?(n<0?"?":"&")+st(e):"",i=t.indexOf("#");return i<0?t+r:t.substring(0,i)+r+t.substring(i)}function ct(t,e){return rt().codec.base64.fromBits(rt().hash.sha1.hash(t),!1,e)}var ht=n(646),lt=n.n(ht);var ft="XMLHttpRequest",dt=g.y[ft];dt||(dt=n(757).n),(0,g.aZ)(ft,function(){return dt},function(t){return dt=t});var pt=(0,h.h)("network.HttpRequest","HttpRequest"),vt="application/x-www-form-urlencoded",yt="application/json",gt="Content-Type",_t="PUT",mt="PATCH",bt="POST",kt="DELETE",wt="GET",xt=a()(function t(e,n){i()(this,t),this.name=e,this.value=n}),St=a()(function t(e,n){i()(this,t);for(var r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];this.url=ut([n].concat(x()(o.filter(function(t){return t&&t.length}).map(function(t){return encodeURIComponent(t)}))).join("/"),{c:S.Ov}),this.method=e.toUpperCase(),this.headers={Accept:"application/json, text/plain"}},[{key:"addQueryParameters",value:function(t){return this.url=ut(this.url,t),this}},{key:"addJson",value:function(t){return this.contentType=yt,this.data=t,this}},{key:"addForm",value:function(t){return this.contentType=vt,this.data=t,this}},{key:"addHeader",value:function(t){return(0,c.ar)(["HttpRequest","#addHeader"],arguments,(0,c.lq)((0,c.gp)(xt))),t&&(this.headers[t.name]=t.value),this}},{key:"readResponseHeaders",value:function(){return this.readHeaders=!0,this}},{key:"send",value:function(){var t=this;return new Promise(function(e,n){var r=null;void 0!==t.data&&[bt,_t,mt].indexOf(t.method)>=0&&((r=t.contentType===vt?st(t.data):t.contentType===yt?JSON.stringify(t.data):t.data)?t.headers[gt]=t.contentType:delete t.headers[gt]),pt.log("==> ".concat(t.method," ").concat(t.url)),Object.keys(t.headers).forEach(function(e){return pt.log(" > HEADER ".concat(e,": ").concat(t.headers[e]))}),r&&pt.log(" > DATA: ".concat(r)),t._open(r,e,function(t){pt.log("<== ERROR: ".concat(JSON.stringify(t))),n(G(t))})})}},{key:"_open",value:function(t,e,n){var r=this,i=new dt,o="RESPONSE_PAYLOAD_ERROR";i.onreadystatechange=function(){if(4===i.readyState){var t=i.responseText,a=i.status;if(a>=500)n({code:o,message:"HTTP status ".concat(a)});else try{var s=t.length?JSON.parse(t):{};if(a>=400)n(s.error||s);else if(a>=200&&a<300||304===a){var u={body:s},c=u.body.error||null;c?n((0,l.Gv)(c)?c:{code:u.body.status,message:c}):(r.readHeaders&&(u.headers=function(t){var e=t.getAllResponseHeaders().trim().split(/[\r\n]+/),n={};return e.forEach(function(t){var e=t.indexOf(": "),r=t.substring(0,e).toLowerCase();n[r]=t.substring(e+2)}),n}(i)),pt.log("<== ".concat(JSON.stringify(u))),e(u))}else n({code:o,message:"HTTP status ".concat(a)})}catch(t){n({code:o,message:"invalid response payload, not a Json content type"})}}},i.open(this.method,this.url,!0),Object.entries(this.headers).forEach(function(t){var e=u()(t,2),n=e[0],r=e[1];return i.setRequestHeader(n,r)}),i.send(t)}}]);function At(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return lt()(St,[wt,t].concat(n))}function Ot(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return lt()(St,[_t,t].concat(n))}function Pt(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return lt()(St,[bt,t].concat(n))}function jt(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return lt()(St,[mt,t].concat(n))}function Rt(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return lt()(St,[kt,t].concat(n))}function Et(t){if(t)return new xt("Authorization","Bearer ".concat(t))}var It=a()(function t(e){i()(this,t),T(this,"name",e),this.counters_={}},[{key:"attach",value:function(t){this.counters_=t.counters_}},{key:"incrementCounter",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.counters_[t]=(this.counters_[t]||0)+e}},{key:"get",value:function(){return Object.assign({},this.counters_)}}]),Ct=new It("deprecated"),Tt=n(304);function Nt(t,e,n,r){r=r&&r.concat(": ")||"",n=n?"use ".concat(n," instead"):"it should no longer be used",t.warn("".concat(r).concat(e," is deprecated, ").concat(n,".")),Ct.incrementCounter(e)}T(h.Ay,"showDeprecations",function(){(0,c.ar)([h.d1,"showDeprecations"],arguments),Mt=Nt}),T(h.Ay,"hideDeprecations",function(){(0,c.ar)([h.d1,"hideDeprecations"],arguments),Mt=Tt.lQ});var Mt=Nt;T(b,"Authentication",{avatarURL:K}),N(b,"avatarURL",function(){return Mt(k,"Webcom.avatarURL","Webcom.Authentication.avatarURL"),K});var Lt={code:"USER_DENIED",message:"The user aborted authentication"},Dt={facebook:{height:650,width:680},google:{height:460,width:490},github:{height:760,width:340},gitlab:{height:710,width:800},orange:{height:700,width:1e3},mobileconnectOFR:{height:540,width:700}},Ht={menubar:0,location:0,resizable:0,scrollbars:1,status:0,dialog:1,width:700,height:375};function Ft(t,e){var n=t.config[W];return(0,l.Kg)(n.storage)?n.storage:v(t,"state",n)+e}function Jt(t,e,n){(0,Y.wg)(function(){return t(e,n)})}function Ut(){return S.Ls&&(et.get(this._oauthSessionKey)||tt.get(this._oauthSessionKey))}var qt,Wt,Kt,Yt=a()(function t(e){i()(this,t),this._logger=(0,h.h)("api.Authentication",W),this._logger.log("Initializing with options ".concat(JSON.stringify(e.config[W]))),this._app=e,this._init(e)},[{key:"_init",value:function(t){var e=t.config[W];A.call(this,e.baseUrl);var n=this._logger._count;this._currentState=function(t){try{return new F(t.state,t.details)}catch(t){return J}}(function(t,e){var n=t.config[W];return n.initialState||((0,l.Tn)(n.storage)?{}:tt.get(Ft(t,e)))}(t,n)),this._authStateSetter=function(t,e){var n=t.config[W];if((0,l.Tn)(n.storage))return function(t){return n.storage(JSON.stringify(t))};var r=Ft(t,e);return function(t){return t&&!t.isUnauthenticated()?tt.set(r,t):tt.remove(r)}}(t,n),this._oauthSessionKey=v(t,"ongoing",e)+n,this.isAuthContextual=!1,this._firstSubscriptions=[],this._lastSubscriptions=[],this._authRoute="".concat(e.baseUrl.href,"/auth/v2/").concat(t.appId),this._resumeAuthState(),this._logger.log("Initialized for appId %s",t.appId)}},{key:"_dispose",value:function(){}},{key:"currentState",get:function(){return this._currentState},set:function(t){this._currentState.isSameAs(t)||(this._currentState=function(t){if(t.isAuthenticated()){var e=Object.assign({},t.details);return delete e.extra,U(e)}return t}(t),this._authStateSetter(this._currentState),this._notifyErrorOrAuthStateChanged(null,t))}},{key:"_resumeAuthState",value:function(){var t=this;if(S.Ls)if("popup"===tt.get(this._oauthSessionKey))document.body.style.display="none",tt.set(this._oauthSessionKey,at(location.search).__wcsession),window.close();else{var e=et.get(this._oauthSessionKey);if(e){var n=at(location.search).__wcsession;if(n)return void(this._oauthSessionPromise=this.resumeSession(n,e).finally(function(){delete t._oauthSessionPromise,et.remove(t._oauthSessionKey)}).catch(Tt.lQ));et.remove(this._oauthSessionKey)}}this._logger.info("Authentication state resumed: %s",this.currentState.state),this._logger.log("Authentication details are: %o",this.currentState.details)}},{key:"getAccountDetails",value:function(){var t=[W,"#removeIdentity"];try{(0,c.ar)(t,arguments);var e=this._getCurrentAuthenticationDetails(t);return this._httpGet("accounts",e.uid).addHeader(Et(e.webcomAuthToken)).send().then(function(t){for(var e={},n=0,r=Object.entries(t.body);n<r.length;n++){var i=u()(r[n],2),o=i[0],a=i[1];switch(o){case"providers":for(var s={},c=0,h=Object.entries(a);c<h.length;c++){var l=u()(h[c],2),f=l[0],d=l[1];s[f]=Object.keys(d)}e.identities=s;break;case"createdOn":e[o]=new Date(a);break;default:e[o]=a}}return e})}catch(t){return Promise.reject(t)}}},{key:"subscribe",value:function(t,e){return(0,c.ar)([W,"#subscribe"],arguments,c.Pc,(0,c.lq)(c.zM)),e?this._firstSubscriptions.push(t):this._lastSubscriptions.push(t),Ut.call(this)?this._logger.log("Notification not sent, because an OAuth authentication is ongoing."):Jt(t,null,this.currentState),t}},{key:"unsubscribe",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;(0,c.ar)([W,"#unsubscribe"],arguments,(0,c.lq)(c.Pc),(0,c.lq)(c.zM));var n=this._firstSubscriptions.length+this._lastSubscriptions.length,r=function(e){return t&&t!==e};return!1!==e&&(this._firstSubscriptions=this._firstSubscriptions.filter(r)),!0!==e&&(this._lastSubscriptions=this._lastSubscriptions.filter(r)),n-this._firstSubscriptions.length-this._lastSubscriptions.length}},{key:"_notifyErrorOrAuthStateChanged",value:function(t,e){this._firstSubscriptions.concat(this._lastSubscriptions).forEach(function(n){return Jt(n,t,e)})}},{key:"authenticationRevoked",value:function(t,e){(0,c.ar)([W,"#authenticationRevoked"],arguments,(0,c.gp)(F),c.Yj);var n=new Error("Authentication was revoked by the server: ".concat(e));n.code="AUTH_REVOKED",this._notifyErrorOrAuthStateChanged(n,null),this.currentState=t}},{key:"resumeSession",value:function(t,e){return(0,c.ar)("AuthenticationImpl#resumeSession",arguments,c.Yj,c.Yj),this._logger.info("fetching authentication state from an ongoing OAuth2 session..."),Pt(this._authRoute,"session").addJson({sessionKey:t,requestKey:e}).send().then(this._updateStateFromHttpResponse(),this._notifyErrorFromHttpResponse.bind(this))}},{key:"_extendHttpRequest",value:function(t){var e=this,n=t;return n.addAuthContext=function(){var n=e._contextAuthToken();return n?t.addHeader(Et(n)):t},n}},{key:"_httpGet",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this._extendHttpRequest(At.apply(void 0,[this._authRoute].concat(e)))}},{key:"_httpPost",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this._extendHttpRequest(Pt.apply(void 0,[this._authRoute].concat(e)))}},{key:"_httpPut",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this._extendHttpRequest(Ot.apply(void 0,[this._authRoute].concat(e)))}},{key:"_httpDelete",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this._extendHttpRequest(Rt.apply(void 0,[this._authRoute].concat(e)))}},{key:"_updateStateFromHttpResponse",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(t){return t};return function(n){var r=e(n).body,i=r.token,o=r.user;if(i)return o.webcomAuthToken=i,t.currentState=U(o),new Promise(function(t){return(0,Y.wg)(function(){return t(o)})});throw G({code:"UNEXPECTED_RESPONSE",message:"the 'token' property is missing."})}}},{key:"_notifyErrorFromHttpResponse",value:function(t){throw this._notifyErrorOrAuthStateChanged(t,null),t}},{key:"useCurrentContextForNextAuthOperation",value:function(){(0,c.ar)([W,"#useCurrentContextForNextAuthOperation"],arguments),this.isAuthContextual=!0}},{key:"useNewContextForNextAuthOperation",value:function(){(0,c.ar)([W,"#useNewContextForNextAuthOperation"],arguments),this.isAuthContextual=!1}},{key:"_contextAuthToken",value:function(){var t=this.isAuthContextual?this