PageSourceSearch

https://backoffice.mokapos.com/auth-micro-apps/4009.f95d4f0dc13d63e5c50c.js

js mokapos.com collected 2026-09-25 09:51:57 UTC 18,085 bytes, 1 lines download raw bytes

1(self.webpackChunkmoka_backoffice_auth_app=self.webpackChunkmoka_backoffice_auth_app||[]).push([[4009],{74279:t=>{function e(){}e.prototype={on:function(t,e,n){var r=this.e||(this.e={});return(r[t]||(r[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){var r=this;function i(){r.off(t,i),e.apply(n,arguments)}return i._=e,this.on(t,i,n)},emit:function(t){for(var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),r=0,i=n.length;r<i;r++)n[r].fn.apply(n[r].ctx,e);return this},off:function(t,e){var n=this.e||(this.e={}),r=n[t],i=[];if(r&&e)for(var o=0,s=r.length;o<s;o++)r[o].fn!==e&&r[o].fn._!==e&&i.push(r[o]);return i.length?n[t]=i:delete n[t],this}},t.exports=e,t.exports.TinyEmitter=e},82562:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},r.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var i=n(7508),o=function(){function t(){}return t.prototype.generateEventId=function(){return(0,i.v4)()},t.prototype.createImpressionEvent=function(t,e,n,i,o){var s=this.createBaseEvent(t,e,n,i);return o?r(r({},s),{variant:o}):s},t.prototype.createBaseEvent=function(t,e,n,r){return{eventType:r,eventId:this.generateEventId(),context:t,enabled:e,featureName:n}},t}();e.default=o},14009:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__assign||function(){return o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},o.apply(this,arguments)},s=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(t){o(t)}}function a(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},c=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};Object.defineProperty(e,"__esModule",{value:!0}),e.InMemoryStorageProvider=e.LocalStorageProvider=e.UnleashClient=e.resolveFetch=e.EVENTS=void 0;var u=n(74279),l=n(88524),h=n(8475);e.InMemoryStorageProvider=h.default;var f=n(6432);e.LocalStorageProvider=f.default;var p=n(82562),d=n(75581),v=["userId","sessionId","remoteAddress"];e.EVENTS={INIT:"initialized",ERROR:"error",READY:"ready",UPDATE:"update",IMPRESSION:"impression"};var y={name:"disabled",enabled:!1},b="repo";e.resolveFetch=function(){try{if("fetch"in window)return fetch.bind(window);if("fetch"in globalThis)return fetch.bind(globalThis)}catch(t){console.error('Unleash failed to resolve "fetch"',t)}};var g=function(t){function n(n){var r=n.storageProvider,i=n.url,c=n.clientKey,u=n.disableRefresh,h=void 0!==u&&u,d=n.refreshInterval,v=void 0===d?30:d,y=n.metricsInterval,b=void 0===y?30:y,g=n.disableMetrics,m=void 0!==g&&g,w=n.appName,E=n.environment,_=void 0===E?"default":E,x=n.context,I=n.fetch,N=void 0===I?(0,e.resolveFetch)():I,k=n.bootstrap,O=n.bootstrapOverride,S=void 0===O||O,T=n.headerName,P=void 0===T?"Authorization":T,R=n.customHeaders,j=void 0===R?{}:R,M=t.call(this)||this;if(M.toggles=[],M.etag="",!i)throw new Error("url is required");if(!c)throw new Error("clientKey is required");if(!w)throw new Error("appName is required.");return M.eventsHandler=new p.default,M.toggles=k&&k.length>0?k:[],M.url=new URL("".concat(i)),M.clientKey=c,M.headerName=P,M.customHeaders=j,M.storage=r||new f.default,M.refreshInterval=h?0:1e3*v,M.context=o({appName:w,environment:_},x),M.ready=new Promise((function(t){return s(M,void 0,void 0,(function(){var n;return a(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.init()];case 1:return r.sent(),[3,3];
1case 2:return n=r.sent(),console.error(n),this.emit(e.EVENTS.ERROR,n),[3,3];case 3:return t(),[2]}}))}))})),N||console.error('Unleash: You must either provide your own "fetch" implementation or run in an environment where "fetch" is available.'),M.fetch=N,M.bootstrap=k&&k.length>0?k:void 0,M.bootstrapOverride=S,M.metrics=new l.default({appName:w,metricsInterval:b,disableMetrics:m,url:i,clientKey:c,fetch:N,headerName:P}),M}return i(n,t),n.prototype.getAllToggles=function(){return c([],this.toggles,!0)},n.prototype.isEnabled=function(t){var n=this.toggles.find((function(e){return e.name===t})),r=!!n&&n.enabled;if(this.metrics.count(t,r),null==n?void 0:n.impressionData){var i=this.eventsHandler.createImpressionEvent(this.context,r,t,"isEnabled");this.emit(e.EVENTS.IMPRESSION,i)}return r},n.prototype.getVariant=function(t){var n=this.toggles.find((function(e){return e.name===t}));if(n){if(this.metrics.count(t,!0),n.impressionData){var r=this.eventsHandler.createImpressionEvent(this.context,n.enabled,t,"getVariant",n.variant.name);this.emit(e.EVENTS.IMPRESSION,r)}return n.variant}return this.metrics.count(t,!1),y},n.prototype.updateContext=function(t){return s(this,void 0,void 0,(function(){var e;return a(this,(function(n){switch(n.label){case 0:return(t.appName||t.environment)&&console.warn("appName and environment are static. They can't be updated with updateContext."),e={environment:this.context.environment,appName:this.context.appName},this.context=o(o({},e),t),this.timerRef?[4,this.fetchToggles()]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}
1))}))},n.prototype.getContext=function(){return o({},this.context)},n.prototype.setContextField=function(t,e){var n,r;if(v.includes(t))this.context=o(o({},this.context),((n={})[t]=e,n));else{var i=o(o({},this.context.properties),((r={})[t]=e,r));this.context=o(o({},this.context),{properties:i})}this.timerRef&&this.fetchToggles()},n.prototype.init=function(){return s(this,void 0,void 0,(function(){var t,n;return a(this,(function(r){switch(r.label){case 0:return[4,this.resolveSessionId()];case 1:return t=r.sent(),this.context=o({sessionId:t},this.context),n=this,[4,this.storage.get(b)];case 2:return n.toggles=r.sent()||[],!this.bootstrap||!this.bootstrapOverride&&0!==this.toggles.length?[3,4]:[4,this.storage.save(b,this.bootstrap)];case 3:r.sent(),this.toggles=this.bootstrap,this.emit(e.EVENTS.READY),r.label=4;case 4:return this.emit(e.EVENTS.INIT),[2]}}))}))},n.prototype.start=function(){return s(this,void 0,void 0,(function(){var t,n=this;return a(this,(function(r){switch(r.label){case 0:return this.timerRef?(console.error("Unleash SDK has already started, if you want to restart the SDK you should call client.stop() before starting again."),[2]):[4,this.ready];case 1:return r.sent(),this.metrics.start(),t=this.refreshInterval,[4,this.fetchToggles()];case 2:return r.sent(),this.bootstrap||this.emit(e.EVENTS.READY),t>0&&(this.timerRef=setInterval((function(){return n.fetchToggles()}),t)),[2]}}))}))},n.prototype.stop=function(){this.timerRef&&(clearInterval(this.timerRef),this.timerRef=void 0),this.metrics.stop()},n.prototype.resolveSessionId=function(){return s(this,void 0,void 0,(function(){var t;return a(this,(function(e){switch(e.label){case 0:return this.context.sessionId?[2,this.context.sessionId]:[3,1];case 1:return[4,this.storage.get("sessionId")];case 2:return(t=e.sent())?[3,4]:(t=Math.floor(1e9*Math.random()),[4,this.storage.save("sessionId",t)]);case 3:e.sent(),e.label=4;case 4:return[2,t]}}))}))},n.prototype.getHeaders=function(){var t,e=((t={})[this.headerName]=this.clientKey,t.Accept="application/json",t["Content-Type"]="application/json",t["If-None-Match"]=this.etag,t);return Object.entries(this.customHeaders).filter(d.notNullOrUndefined).forEach((function(t){var n=t[0],r=t[1];return e[n]=r})),e},n.prototype.storeToggles=function(t){return s(this,void 0,void 0,(function(){return a(this,(function(n){switch(n.label){case 0:return this.toggles=t,this.emit(e.EVENTS.UPDATE),[4,this.storage.save(b,t)];case 1:return n.sent(),[2]}}))}))},n.prototype.fetchToggles=function(){return s(this,void 0,void 0,(function(){var t,n,r,i,o;return a(this,(function(s){switch(s.label){case 0:if(!this.fetch)return[3,7];s.label=1;case 1:return s.trys.push([1,6,,7]),t=this.context,n=new URL(this.url.toString()),Object.entries(t).filter(d.notNullOrUndefined).forEach((function(t){var e=t[0],r=t[1];"properties"===e&&r?Object.entries(r).filter(d.notNullOrUndefined).forEach((function(t){var e=t[0],r=t[1];return n.searchParams.append("properties[".concat(e,"]"),r)})):n.searchParams.append(e,r)})),[4,this.fetch(n.toString(),{cache:"no-cache",headers:this.getHeaders()})];case 2:return(r=s.sent()).ok&&304!==r.status?(this.etag=r.headers.get("ETag")||"",[4,r.json()]):[3,5];case 3:return i=s.sent(),[4,this.storeToggles(i.toggles)];case 4:s.sent(),s.label=5;case 5:return[3,7];case 6:return o=s.sent(),console.error("Unleash: unable to fetch feature toggles",o),this.emit(e.EVENTS.ERROR,o),[3,7];case 7:return[2]}}
1))}))},n}(u.TinyEmitter);e.UnleashClient=g},88524:function(t,e){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},n.apply(this,arguments)},r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(t){o(t)}}function a(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t){var e=t.appName,n=t.metricsInterval,r=t.disableMetrics,i=void 0!==r&&r,o=t.url,s=t.clientKey,a=t.fetch,c=t.headerName;this.disabled=i,this.metricsInterval=1e3*n,this.appName=e,this.url=o,this.clientKey=s,this.bucket=this.createEmptyBucket(),this.fetch=a,this.headerName=c}return t.prototype.start=function(){var t=this;if(this.disabled)return!1;"number"==typeof this.metricsInterval&&this.metricsInterval>0&&setTimeout((function(){t.startTimer(),t.sendMetrics()}),2e3)},t.prototype.stop=function(){this.timer&&(clearTimeout(this.timer),delete this.timer)},t.prototype.createEmptyBucket=function(){return{start:new Date,stop:null,toggles:{}}},t.prototype.sendMetrics=function(){return r(this,void 0,void 0,(function(){var t,e,n;return i(this,(function(r){switch(r.label){case 0:return t="".concat(this.url,"/client/metrics"),e=this.getPayload(),this.bucketIsEmpty(e)?[2]:[4,this.fetch(t,{cache:"no-cache",method:"POST",headers:(n={},n[this.headerName]=this.clientKey,n.Accept="application/json",n["Content-Type"]="application/json",n),body:JSON.stringify(e)})];case 1:return r.sent(),[2]}}))}))},t.prototype.count=function(t,e){return!(this.disabled||!this.bucket||(this.assertBucket(t),this.bucket.toggles[t][e?"yes":"no"]++,0))},t.prototype.assertBucket=function(t){if(this.disabled||!this.bucket)return!1;this.bucket.toggles[t]||(this.bucket.toggles[t]={yes:0,no:0})},t.prototype.startTimer=function(){var t=this;this.timer=setInterval((function(){t.sendMetrics()}),this.metricsInterval)},t.prototype.bucketIsEmpty=function(t){return 0===Object.keys(t.bucket.toggles).length},t.prototype.getPayload=function(){var t=n(n({},this.bucket),{stop:new Date});return this.bucket=this.createEmptyBucket(),{bucket:t,appName:this.appName,instanceId:"browser"}},t}();e.default=o},8475:function(t,e){"use strict";var n=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(t){o(t)}}function a(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;
1function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(){this.store=new Map}return t.prototype.save=function(t,e){return n(this,void 0,void 0,(function(){return r(this,(function(n){return this.store.set(t,e),[2]}))}))},t.prototype.get=function(t){return n(this,void 0,void 0,(function(){return r(this,(function(e){return[2,this.store.get(t)]}))}))},t}();e.default=i},6432:function(t,e){"use strict";var n=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(t){o(t)}}function a(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(){this.prefix="unleash:repository"}return t.prototype.save=function(t,e){return n(this,void 0,void 0,(function(){var n,i;return r(this,(function(r){n=JSON.stringify(e),i="".concat(this.prefix,":").concat(t);try{window.localStorage.setItem(i,n)}catch(t){console.error(t)}return[2]}))}))},t.prototype.get=function(t){try{var e="".concat(this.prefix,":").concat(t),n=window.localStorage.getItem(e);return n?JSON.parse(n):void 0}catch(t){console.error(t)}},t}();e.default=i},75581:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.notNullOrUndefined=void 0,e.notNullOrUndefined=function(t){return null!=t[1]}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.