@redhat-cloud-services/frontend-components-config-utilities 2.0.0 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/federated-modules.js +1 -1
  2. package/package.json +1 -1
  3. package/repos/insights-chrome-build/58231b16fdee45a03a4ee3cf94a9f2c3 +0 -73
  4. package/repos/insights-chrome-build/app.info.deps.json +0 -1
  5. package/repos/insights-chrome-build/app.info.json +0 -14
  6. package/repos/insights-chrome-build/index.html +0 -29
  7. package/repos/insights-chrome-build/js/00e10699d4604274.woff2 +0 -0
  8. package/repos/insights-chrome-build/js/03be9971fdd08ef3.woff2 +0 -0
  9. package/repos/insights-chrome-build/js/05294d67f8e33aab.woff2 +0 -0
  10. package/repos/insights-chrome-build/js/091b27e83c831713.woff2 +0 -0
  11. package/repos/insights-chrome-build/js/0d54864d782470c6.woff +0 -0
  12. package/repos/insights-chrome-build/js/0d5f5f4e3bbf47e1.woff2 +0 -0
  13. package/repos/insights-chrome-build/js/1039d3d8000f2c4b.woff +0 -0
  14. package/repos/insights-chrome-build/js/13f6558f31b2ee0f.woff2 +0 -0
  15. package/repos/insights-chrome-build/js/1412957e204a8a1a.woff +0 -0
  16. package/repos/insights-chrome-build/js/17802e9fb8c2dd3c.woff +0 -0
  17. package/repos/insights-chrome-build/js/1be1bd18c67d1ac8.woff +0 -0
  18. package/repos/insights-chrome-build/js/26409b4397ab88cc.woff2 +0 -0
  19. package/repos/insights-chrome-build/js/278473d290fcbf3b.woff2 +0 -0
  20. package/repos/insights-chrome-build/js/2a96d5b208c56fa6.woff +0 -0
  21. package/repos/insights-chrome-build/js/2baac3a5d7ab7a15.woff2 +0 -0
  22. package/repos/insights-chrome-build/js/316d3d41de174f24.woff +0 -0
  23. package/repos/insights-chrome-build/js/3239d74dcb174610.woff2 +0 -0
  24. package/repos/insights-chrome-build/js/326f107b61d32769.woff +0 -0
  25. package/repos/insights-chrome-build/js/49ee635c956449ea.woff2 +0 -0
  26. package/repos/insights-chrome-build/js/4ace320f5eaa7ee9.woff2 +0 -0
  27. package/repos/insights-chrome-build/js/4b0d8eeb01c2f27e.woff2 +0 -0
  28. package/repos/insights-chrome-build/js/4df2ca3d94d759b3.svg +0 -515
  29. package/repos/insights-chrome-build/js/52f482efb5487bba.woff2 +0 -0
  30. package/repos/insights-chrome-build/js/64b9a14b3398824f.woff2 +0 -0
  31. package/repos/insights-chrome-build/js/66309a34eac8b284.woff2 +0 -0
  32. package/repos/insights-chrome-build/js/6e30b223886d1eef.woff2 +0 -0
  33. package/repos/insights-chrome-build/js/6fb4e4e104bb886f.woff2 +0 -0
  34. package/repos/insights-chrome-build/js/703c721f27900006.woff +0 -0
  35. package/repos/insights-chrome-build/js/79c835ddc356c3ef.woff +0 -0
  36. package/repos/insights-chrome-build/js/7a0809e40bf8e79a.woff +0 -0
  37. package/repos/insights-chrome-build/js/7a9fb47c5b35e50d.woff2 +0 -0
  38. package/repos/insights-chrome-build/js/7bb3ddb0583cc7a5.woff +0 -0
  39. package/repos/insights-chrome-build/js/7bf300b28414f3ad.woff +0 -0
  40. package/repos/insights-chrome-build/js/7d9b027229967149.woff2 +0 -0
  41. package/repos/insights-chrome-build/js/81245ab8c867ea09.woff +0 -0
  42. package/repos/insights-chrome-build/js/830dcb2cc707ae4c.woff +0 -0
  43. package/repos/insights-chrome-build/js/835112a9ba0d676e.woff +0 -0
  44. package/repos/insights-chrome-build/js/8f3e80eba644e3ec.svg +0 -33
  45. package/repos/insights-chrome-build/js/8f765508913b945e.woff2 +0 -0
  46. package/repos/insights-chrome-build/js/91bbac2b6e0eb739.woff +0 -0
  47. package/repos/insights-chrome-build/js/96971d99ef5f2ef7.woff2 +0 -0
  48. package/repos/insights-chrome-build/js/_c74b-_e0c3-_9cf0-_3467-_8add-_2900-_a7bc-_70d9-_eea3-_8afc-_d73e-_1a3c-_2385-_85ca-_5c4f-_0f-35898c0.b3f9836f62184986.js +0 -943
  49. package/repos/insights-chrome-build/js/_c74b-_e0c3-_9cf0-_3467-_8add-_2900-_a7bc-_70d9-_eea3-_8afc-_d73e-_1a3c-_2385-_85ca-_5c4f-_0f-35898c1.b3f9836f62184986.js +0 -943
  50. package/repos/insights-chrome-build/js/a14c79bac597c758.woff +0 -0
  51. package/repos/insights-chrome-build/js/a86c2bca47a21ff0.woff2 +0 -0
  52. package/repos/insights-chrome-build/js/ad4d1e278d4d13cb.woff +0 -0
  53. package/repos/insights-chrome-build/js/ajs-destination.b3f9836f62184986.js +0 -594
  54. package/repos/insights-chrome-build/js/auto-track.b3f9836f62184986.js +0 -122
  55. package/repos/insights-chrome-build/js/b0ebda5f4f12f761.woff2 +0 -0
  56. package/repos/insights-chrome-build/js/b97a3321aaf7e87a.woff2 +0 -0
  57. package/repos/insights-chrome-build/js/ba04b02b7da08f3d.woff2 +0 -0
  58. package/repos/insights-chrome-build/js/bb85876a67d3e7e7.woff2 +0 -0
  59. package/repos/insights-chrome-build/js/bbe18aee9c88166d.woff +0 -0
  60. package/repos/insights-chrome-build/js/c3ab7be4146884a3.woff2 +0 -0
  61. package/repos/insights-chrome-build/js/c49edc34d14553e4.woff +0 -0
  62. package/repos/insights-chrome-build/js/c8b06bb52b20081e.woff2 +0 -0
  63. package/repos/insights-chrome-build/js/c99e50723fcf0166.woff +0 -0
  64. package/repos/insights-chrome-build/js/cb827f53cc6d6dcf.woff2 +0 -0
  65. package/repos/insights-chrome-build/js/cd1824ff99b9ef33.woff2 +0 -0
  66. package/repos/insights-chrome-build/js/ce63a8f6be94c7cd.woff2 +0 -0
  67. package/repos/insights-chrome-build/js/chrome-root.b3f9836f62184986.js +0 -43326
  68. package/repos/insights-chrome-build/js/chrome.b3f9836f62184986.js +0 -33007
  69. package/repos/insights-chrome-build/js/d004dc9f8c955767.woff2 +0 -0
  70. package/repos/insights-chrome-build/js/d19c89c249d7f751.woff2 +0 -0
  71. package/repos/insights-chrome-build/js/d2a095f5996e5014.woff2 +0 -0
  72. package/repos/insights-chrome-build/js/d2ce043298f5c972.woff +0 -0
  73. package/repos/insights-chrome-build/js/d2cf7e795db09bc7.woff +0 -0
  74. package/repos/insights-chrome-build/js/d6083bde9a964ab4.svg +0 -96
  75. package/repos/insights-chrome-build/js/dd18fb6c0b7048e8.woff2 +0 -0
  76. package/repos/insights-chrome-build/js/df8a52d2494e1e03.woff2 +0 -0
  77. package/repos/insights-chrome-build/js/e5c7a27047a83d24.woff2 +0 -0
  78. package/repos/insights-chrome-build/js/e693e4f9d9c75499.woff2 +0 -0
  79. package/repos/insights-chrome-build/js/e8ec1c41a82bd354.woff +0 -0
  80. package/repos/insights-chrome-build/js/f66882bad34e5c9f.woff +0 -0
  81. package/repos/insights-chrome-build/js/f830d4d01f5e4497.woff +0 -0
  82. package/repos/insights-chrome-build/js/fed-mods.json +0 -15
  83. package/repos/insights-chrome-build/js/legacyVideos.b3f9836f62184986.js +0 -41
  84. package/repos/insights-chrome-build/js/main.b3f9836f62184986.css +0 -51216
  85. package/repos/insights-chrome-build/js/node_modules_hoist-non-react-statics_dist_hoist-non-react-statics_cjs_js.b3f9836f62184986.js +0 -323
  86. package/repos/insights-chrome-build/js/node_modules_lodash_isEqual_js.b3f9836f62184986.js +0 -48
  87. package/repos/insights-chrome-build/js/node_modules_patternfly_react-icons_dist_js_icons_bars-icon_js-node_modules_patternfly_react--0a3495.b3f9836f62184986.js +0 -242
  88. package/repos/insights-chrome-build/js/queryString.b3f9836f62184986.js +0 -128
  89. package/repos/insights-chrome-build/js/quick-start.b3f9836f62184986.js +0 -47
  90. package/repos/insights-chrome-build/js/remoteMiddleware.b3f9836f62184986.js +0 -87
  91. package/repos/insights-chrome-build/js/schemaFilter.b3f9836f62184986.js +0 -111
  92. package/repos/insights-chrome-build/js/src_bootstrap_tsx-src_moduleOverrides_unfetch_ts-node_modules_redhat-cloud-services_frontend--275e6e.b3f9836f62184986.css +0 -27041
  93. package/repos/insights-chrome-build/js/src_bootstrap_tsx-src_moduleOverrides_unfetch_ts-node_modules_redhat-cloud-services_frontend--275e6e.b3f9836f62184986.js +0 -20468
  94. package/repos/insights-chrome-build/js/src_components_Debugger_index_ts.b3f9836f62184986.css +0 -52
  95. package/repos/insights-chrome-build/js/src_components_Debugger_index_ts.b3f9836f62184986.js +0 -512
  96. package/repos/insights-chrome-build/js/src_components_FavoriteServices_EmptyState_tsx-src_hooks_useFavoritedServices_ts.b3f9836f62184986.css +0 -8664
  97. package/repos/insights-chrome-build/js/src_components_FavoriteServices_EmptyState_tsx-src_hooks_useFavoritedServices_ts.b3f9836f62184986.js +0 -5098
  98. package/repos/insights-chrome-build/js/src_components_FavoriteServices_LandingNavFavorites_tsx-src_utils_common_ts.b3f9836f62184986.css +0 -8662
  99. package/repos/insights-chrome-build/js/src_components_FavoriteServices_LandingNavFavorites_tsx-src_utils_common_ts.b3f9836f62184986.js +0 -898
  100. package/repos/insights-chrome-build/js/src_components_NotEntitledModal_index_tsx.b3f9836f62184986.css +0 -30
  101. package/repos/insights-chrome-build/js/src_components_NotEntitledModal_index_tsx.b3f9836f62184986.js +0 -237
  102. package/repos/insights-chrome-build/js/src_components_QuickstartsCatalogRoute_index_ts.b3f9836f62184986.js +0 -106
  103. package/repos/insights-chrome-build/js/src_components_Stratosphere_ProductSelection_tsx.b3f9836f62184986.css +0 -17513
  104. package/repos/insights-chrome-build/js/src_components_Stratosphere_ProductSelection_tsx.b3f9836f62184986.js +0 -335
  105. package/repos/insights-chrome-build/js/src_moduleOverrides_chart-utils-override_js-src_pdf_DownloadButton_tsx-webpack_sharing_consum-3a44a6.b3f9836f62184986.js +0 -91
  106. package/repos/insights-chrome-build/js/tsub-middleware.b3f9836f62184986.js +0 -6836
  107. package/repos/insights-chrome-build/js/vendors-node_modules_buffer_index_js-node_modules_lodash__baseFlatten_js-node_modules_lodash_-1de864.b3f9836f62184986.js +0 -2552
  108. package/repos/insights-chrome-build/js/vendors-node_modules_hoist-non-react-statics_dist_hoist-non-react-statics_cjs_js-node_modules-c053fb.b3f9836f62184986.js +0 -1761
  109. package/repos/insights-chrome-build/js/vendors-node_modules_inherits_inherits_browser_js-node_modules_lodash__baseMerge_js-node_modu-5ed1a1.b3f9836f62184986.js +0 -1113
  110. package/repos/insights-chrome-build/js/vendors-node_modules_lodash__baseForOwn_js-node_modules_lodash__baseIteratee_js-node_modules_-167437.b3f9836f62184986.js +0 -1289
  111. package/repos/insights-chrome-build/js/vendors-node_modules_lodash__baseIsEqual_js.b3f9836f62184986.js +0 -3148
  112. package/repos/insights-chrome-build/js/vendors-node_modules_openshift_dynamic-plugin-sdk_dist_index_js.b3f9836f62184986.js +0 -17197
  113. package/repos/insights-chrome-build/js/vendors-node_modules_patternfly_quickstarts_dist_index_es_js.b3f9836f62184986.js +0 -13149
  114. package/repos/insights-chrome-build/js/vendors-node_modules_patternfly_react-charts_dist_esm_components_ChartUtils_chart-theme_js-no-998b15.b3f9836f62184986.js +0 -166192
  115. package/repos/insights-chrome-build/js/vendors-node_modules_patternfly_react-core_dist_esm_components_Button_Button_js-node_modules_-6763c7.b3f9836f62184986.js +0 -6274
  116. package/repos/insights-chrome-build/js/vendors-node_modules_patternfly_react-core_dist_esm_index_js.b3f9836f62184986.js +0 -33678
  117. package/repos/insights-chrome-build/js/vendors-node_modules_patternfly_react-core_next_components_Select_Select_js-node_modules_patt-da466d.b3f9836f62184986.js +0 -4946
  118. package/repos/insights-chrome-build/js/vendors-node_modules_patternfly_react-icons_dist_esm_icons_bell-slash-icon_js-node_modules_pa-6de3ff.b3f9836f62184986.js +0 -74388
  119. package/repos/insights-chrome-build/js/vendors-node_modules_patternfly_react-icons_dist_esm_icons_star-icon_js-node_modules_axios_in-5a9fd5.b3f9836f62184986.js +0 -2881
  120. package/repos/insights-chrome-build/js/vendors-node_modules_prop-types_index_js.b3f9836f62184986.js +0 -649
  121. package/repos/insights-chrome-build/js/vendors-node_modules_react-redux_es_index_js.b3f9836f62184986.js +0 -2337
  122. package/repos/insights-chrome-build/js/vendors-node_modules_react-router-dom_dist_index_js.b3f9836f62184986.js +0 -6691
  123. package/repos/insights-chrome-build/js/vendors-node_modules_react_jsx-runtime_js.b3f9836f62184986.js +0 -1250
  124. package/repos/insights-chrome-build/js/vendors-node_modules_redhat-cloud-services_chrome_esm_index_js.b3f9836f62184986.js +0 -708
  125. package/repos/insights-chrome-build/js/vendors-node_modules_redhat-cloud-services_frontend-components-utilities_esm_interceptors_int-b5fffe.b3f9836f62184986.js +0 -21636
  126. package/repos/insights-chrome-build/js/vendors-node_modules_scalprum_core_dist_esm_index_js.b3f9836f62184986.js +0 -363
  127. package/repos/insights-chrome-build/js/vendors-node_modules_scalprum_react-core_dist_esm_index_js.b3f9836f62184986.js +0 -762
  128. package/repos/insights-chrome-build/js/vendors-node_modules_segment_analytics_js-video-plugins_dist_index_umd_js.b3f9836f62184986.js +0 -13
  129. package/repos/insights-chrome-build/js/vendors-node_modules_tslib_tslib_es6_js.b3f9836f62184986.js +0 -258
  130. package/repos/insights-chrome-build/js/vendors-node_modules_unleash_proxy-client-react_dist_index_browser_js.b3f9836f62184986.js +0 -1821
  131. package/repos/insights-chrome-build/silent-check-sso.html +0 -7
@@ -1,1821 +0,0 @@
1
- (self["webpackChunkinsights_chrome"] = self["webpackChunkinsights_chrome"] || []).push([["vendors-node_modules_unleash_proxy-client-react_dist_index_browser_js"],{
2
-
3
- /***/ "./node_modules/@unleash/proxy-client-react/dist/index.browser.js":
4
- /*!************************************************************************!*\
5
- !*** ./node_modules/@unleash/proxy-client-react/dist/index.browser.js ***!
6
- \************************************************************************/
7
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
8
-
9
- (()=>{"use strict";var e={n:n=>{var t=n&&n.__esModule?()=>n.default:()=>n;return e.d(t,{a:t}),t},d:(n,t)=>{for(var r in t)e.o(t,r)&&!e.o(n,r)&&Object.defineProperty(n,r,{enumerable:!0,get:t[r]})},o:(e,n)=>Object.prototype.hasOwnProperty.call(e,n),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{FlagContext:()=>o,FlagProvider:()=>a,InMemoryStorageProvider:()=>t.InMemoryStorageProvider,LocalStorageProvider:()=>t.LocalStorageProvider,UnleashClient:()=>t.UnleashClient,default:()=>v,useFlag:()=>i,useFlags:()=>l,useFlagsStatus:()=>c,useUnleashClient:()=>d,useUnleashContext:()=>f,useVariant:()=>s});const t=__webpack_require__(/*! unleash-proxy-client */ "./node_modules/unleash-proxy-client/build/index.js"),r=__webpack_require__(/*! react */ "webpack/sharing/consume/default/react/react?88de"),o=e.n(r)().createContext(null);var u={bootstrap:[],disableRefresh:!0,disableMetrics:!0,url:"http://localhost",appName:"offline",clientKey:"not-used"};const a=function(e){var n=e.config,a=e.children,i=e.unleashClient,l=e.startClient,c=void 0===l||l,s=n||u,f=r.useRef(i||new t.UnleashClient(s)),d=r.useState(Boolean(i?(null==n?void 0:n.bootstrap)&&!1!==(null==n?void 0:n.bootstrapOverride):s.bootstrap&&!1!==s.bootstrapOverride)),v=d[0],p=d[1],b=r.useState(null),g=b[0],y=b[1],h=r.useRef(null);r.useEffect((function(){s||i||console.error("You must provide either a config or an unleash client to the flag provider.\n If you are initializing the client in useEffect, you can avoid this warning\n by checking if the client exists before rendering.");var e,n=function(e){h.current=e,null===h.current&&y(e)},t=function(){e=setTimeout((function(){p(!0)}),0)};return f.current.on("ready",t),f.current.on("error",n),(c||!i)&&(f.current.stop(),f.current.start()),function(){f.current&&(f.current.off("error",n),f.current.off("ready",t),f.current.stop()),e&&clearTimeout(e)}}),[]);var m=function(e){return n=void 0,t=void 0,o=function(){return function(e,n){var t,r,o,u,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return u={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function i(u){return function(i){return function(u){if(t)throw new TypeError("Generator is already executing.");for(;a;)try{if(t=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=n.call(e,a)}catch(e){u=[6,e],r=0}finally{t=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,i])}}}(this,(function(n){switch(n.label){case 0:return[4,f.current.updateContext(e)];case 1:return n.sent(),[2]}}))},new((r=void 0)||(r=Promise))((function(e,u){function a(e){try{l(o.next(e))}catch(e){u(e)}}function i(e){try{l(o.throw(e))}catch(e){u(e)}}function l(n){var t;n.done?e(n.value):(t=n.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,i)}l((o=o.apply(n,t||[])).next())}));var n,t,r,o},x=function(e){return f.current.isEnabled(e)},C=function(e){return f.current.getVariant(e)},S=function(e,n,t){return f.current.on(e,n,t)},w=r.useMemo((function(){return{on:S,updateContext:m,isEnabled:x,getVariant:C,client:f.current,flagsReady:v,flagsError:g,setFlagsReady:p,setFlagsError:y}}),[v,g]);return r.createElement(o.Provider,{value:w},a)},i=function(e){var n=(0,r.useContext)(o),t=n.isEnabled,u=n.client,a=(0,r.useState)(!!t(e)),i=a[0],l=a[1],c=(0,r.useRef)();return c.current=i,(0,r.useEffect)((function(){if(u){u.on("update",(function(){var n=t(e);n!==c.current&&(c.current=n,l(!!n))})),u.on("ready",(function(){var n=t(e);c.current=n,l(n)}))}}),[u]),i},l=function(){var e=(0,r.useContext)(o).client,n=(0,r.useState)(e.getAllToggles()),t=n[0],u=n[1];return(0,r.useEffect)((function(){var n=function(){u(e.getAllToggles())};return e.on("update",n),function(){e.off("update",n)}}),[]),t},c=function(){var e=(0,r.useContext)(o);return{flagsReady:e.flagsReady,flagsError:e.flagsError}},s=function(e){var n=(0,r.useContext)(o),t=n.getVariant,u=n.client,a=(0,r.useState)(t(e)),i=a[0],l=a[1],c=(0,r.useRef)({name:i.name,enabled:i.enabled});return c.current=i,(0,r.useEffect)((function(){if(u){u.on("update",(function(){var n=t(e);c.current.name===(null==n?void 0:n.name)&&c.current.enabled===(null==n?void 0:n.enabled)||(l(n),c.current=n)})),u.on("ready",(function(){var n=t(e);c.current.name=null==n?void 0:n.name,c.current.enabled=null==n?void 0:n.enabled,l(n)}))}}),[u]),i||{}},f=function(){return(0,r.useContext)(o).updateContext},d=function(){return(0,r.useContext)(o).client},v=a;module.exports=n})();
10
-
11
- /***/ }),
12
-
13
- /***/ "./node_modules/tiny-emitter/index.js":
14
- /*!********************************************!*\
15
- !*** ./node_modules/tiny-emitter/index.js ***!
16
- \********************************************/
17
- /***/ ((module) => {
18
-
19
- function E () {
20
- // Keep this empty so it's easier to inherit from
21
- // (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
22
- }
23
-
24
- E.prototype = {
25
- on: function (name, callback, ctx) {
26
- var e = this.e || (this.e = {});
27
-
28
- (e[name] || (e[name] = [])).push({
29
- fn: callback,
30
- ctx: ctx
31
- });
32
-
33
- return this;
34
- },
35
-
36
- once: function (name, callback, ctx) {
37
- var self = this;
38
- function listener () {
39
- self.off(name, listener);
40
- callback.apply(ctx, arguments);
41
- };
42
-
43
- listener._ = callback
44
- return this.on(name, listener, ctx);
45
- },
46
-
47
- emit: function (name) {
48
- var data = [].slice.call(arguments, 1);
49
- var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
50
- var i = 0;
51
- var len = evtArr.length;
52
-
53
- for (i; i < len; i++) {
54
- evtArr[i].fn.apply(evtArr[i].ctx, data);
55
- }
56
-
57
- return this;
58
- },
59
-
60
- off: function (name, callback) {
61
- var e = this.e || (this.e = {});
62
- var evts = e[name];
63
- var liveEvents = [];
64
-
65
- if (evts && callback) {
66
- for (var i = 0, len = evts.length; i < len; i++) {
67
- if (evts[i].fn !== callback && evts[i].fn._ !== callback)
68
- liveEvents.push(evts[i]);
69
- }
70
- }
71
-
72
- // Remove event from queue to prevent memory leak
73
- // Suggested by https://github.com/lazd
74
- // Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
75
-
76
- (liveEvents.length)
77
- ? e[name] = liveEvents
78
- : delete e[name];
79
-
80
- return this;
81
- }
82
- };
83
-
84
- module.exports = E;
85
- module.exports.TinyEmitter = E;
86
-
87
-
88
- /***/ }),
89
-
90
- /***/ "./node_modules/unleash-proxy-client/build/events-handler.js":
91
- /*!*******************************************************************!*\
92
- !*** ./node_modules/unleash-proxy-client/build/events-handler.js ***!
93
- \*******************************************************************/
94
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
95
-
96
- "use strict";
97
-
98
- var __assign = (this && this.__assign) || function () {
99
- __assign = Object.assign || function(t) {
100
- for (var s, i = 1, n = arguments.length; i < n; i++) {
101
- s = arguments[i];
102
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
103
- t[p] = s[p];
104
- }
105
- return t;
106
- };
107
- return __assign.apply(this, arguments);
108
- };
109
- Object.defineProperty(exports, "__esModule", ({ value: true }));
110
- var uuid_1 = __webpack_require__(/*! uuid */ "./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/index.js");
111
- var EventsHandler = /** @class */ (function () {
112
- function EventsHandler() {
113
- }
114
- EventsHandler.prototype.generateEventId = function () {
115
- return (0, uuid_1.v4)();
116
- };
117
- EventsHandler.prototype.createImpressionEvent = function (context, enabled, featureName, eventType, impressionData, variant) {
118
- var baseEvent = this.createBaseEvent(context, enabled, featureName, eventType, impressionData);
119
- if (variant) {
120
- return __assign(__assign({}, baseEvent), { variant: variant });
121
- }
122
- return baseEvent;
123
- };
124
- EventsHandler.prototype.createBaseEvent = function (context, enabled, featureName, eventType, impressionData) {
125
- return {
126
- eventType: eventType,
127
- eventId: this.generateEventId(),
128
- context: context,
129
- enabled: enabled,
130
- featureName: featureName,
131
- impressionData: impressionData
132
- };
133
- };
134
- return EventsHandler;
135
- }());
136
- exports["default"] = EventsHandler;
137
- //# sourceMappingURL=events-handler.js.map
138
-
139
- /***/ }),
140
-
141
- /***/ "./node_modules/unleash-proxy-client/build/index.js":
142
- /*!**********************************************************!*\
143
- !*** ./node_modules/unleash-proxy-client/build/index.js ***!
144
- \**********************************************************/
145
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
146
-
147
- "use strict";
148
-
149
- var __extends = (this && this.__extends) || (function () {
150
- var extendStatics = function (d, b) {
151
- extendStatics = Object.setPrototypeOf ||
152
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
153
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
154
- return extendStatics(d, b);
155
- };
156
- return function (d, b) {
157
- if (typeof b !== "function" && b !== null)
158
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
159
- extendStatics(d, b);
160
- function __() { this.constructor = d; }
161
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
162
- };
163
- })();
164
- var __assign = (this && this.__assign) || function () {
165
- __assign = Object.assign || function(t) {
166
- for (var s, i = 1, n = arguments.length; i < n; i++) {
167
- s = arguments[i];
168
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
169
- t[p] = s[p];
170
- }
171
- return t;
172
- };
173
- return __assign.apply(this, arguments);
174
- };
175
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
176
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
177
- return new (P || (P = Promise))(function (resolve, reject) {
178
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
179
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
180
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
181
- step((generator = generator.apply(thisArg, _arguments || [])).next());
182
- });
183
- };
184
- var __generator = (this && this.__generator) || function (thisArg, body) {
185
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
186
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
187
- function verb(n) { return function (v) { return step([n, v]); }; }
188
- function step(op) {
189
- if (f) throw new TypeError("Generator is already executing.");
190
- while (_) try {
191
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
192
- if (y = 0, t) op = [op[0] & 2, t.value];
193
- switch (op[0]) {
194
- case 0: case 1: t = op; break;
195
- case 4: _.label++; return { value: op[1], done: false };
196
- case 5: _.label++; y = op[1]; op = [0]; continue;
197
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
198
- default:
199
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
200
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
201
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
202
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
203
- if (t[2]) _.ops.pop();
204
- _.trys.pop(); continue;
205
- }
206
- op = body.call(thisArg, _);
207
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
208
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
209
- }
210
- };
211
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
212
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
213
- if (ar || !(i in from)) {
214
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
215
- ar[i] = from[i];
216
- }
217
- }
218
- return to.concat(ar || Array.prototype.slice.call(from));
219
- };
220
- Object.defineProperty(exports, "__esModule", ({ value: true }));
221
- exports.InMemoryStorageProvider = exports.LocalStorageProvider = exports.UnleashClient = exports.resolveFetch = exports.EVENTS = void 0;
222
- var tiny_emitter_1 = __webpack_require__(/*! tiny-emitter */ "./node_modules/tiny-emitter/index.js");
223
- var metrics_1 = __webpack_require__(/*! ./metrics */ "./node_modules/unleash-proxy-client/build/metrics.js");
224
- var storage_provider_inmemory_1 = __webpack_require__(/*! ./storage-provider-inmemory */ "./node_modules/unleash-proxy-client/build/storage-provider-inmemory.js");
225
- exports.InMemoryStorageProvider = storage_provider_inmemory_1.default;
226
- var storage_provider_local_1 = __webpack_require__(/*! ./storage-provider-local */ "./node_modules/unleash-proxy-client/build/storage-provider-local.js");
227
- exports.LocalStorageProvider = storage_provider_local_1.default;
228
- var events_handler_1 = __webpack_require__(/*! ./events-handler */ "./node_modules/unleash-proxy-client/build/events-handler.js");
229
- var util_1 = __webpack_require__(/*! ./util */ "./node_modules/unleash-proxy-client/build/util.js");
230
- var DEFINED_FIELDS = ['userId', 'sessionId', 'remoteAddress'];
231
- exports.EVENTS = {
232
- INIT: 'initialized',
233
- ERROR: 'error',
234
- READY: 'ready',
235
- UPDATE: 'update',
236
- IMPRESSION: 'impression',
237
- };
238
- var IMPRESSION_EVENTS = {
239
- IS_ENABLED: 'isEnabled',
240
- GET_VARIANT: 'getVariant',
241
- };
242
- var defaultVariant = { name: 'disabled', enabled: false };
243
- var storeKey = 'repo';
244
- var resolveFetch = function () {
245
- try {
246
- if (typeof window !== 'undefined' && 'fetch' in window) {
247
- return fetch.bind(window);
248
- }
249
- else if ('fetch' in globalThis) {
250
- return fetch.bind(globalThis);
251
- }
252
- }
253
- catch (e) {
254
- console.error('Unleash failed to resolve "fetch"', e);
255
- }
256
- return undefined;
257
- };
258
- exports.resolveFetch = resolveFetch;
259
- var UnleashClient = /** @class */ (function (_super) {
260
- __extends(UnleashClient, _super);
261
- function UnleashClient(_a) {
262
- var storageProvider = _a.storageProvider, url = _a.url, clientKey = _a.clientKey, _b = _a.disableRefresh, disableRefresh = _b === void 0 ? false : _b, _c = _a.refreshInterval, refreshInterval = _c === void 0 ? 30 : _c, _d = _a.metricsInterval, metricsInterval = _d === void 0 ? 30 : _d, _e = _a.disableMetrics, disableMetrics = _e === void 0 ? false : _e, appName = _a.appName, _f = _a.environment, environment = _f === void 0 ? 'default' : _f, context = _a.context, _g = _a.fetch, fetch = _g === void 0 ? (0, exports.resolveFetch)() : _g, bootstrap = _a.bootstrap, _h = _a.bootstrapOverride, bootstrapOverride = _h === void 0 ? true : _h, _j = _a.headerName, headerName = _j === void 0 ? 'Authorization' : _j, _k = _a.customHeaders, customHeaders = _k === void 0 ? {} : _k, _l = _a.impressionDataAll, impressionDataAll = _l === void 0 ? false : _l, _m = _a.usePOSTrequests, usePOSTrequests = _m === void 0 ? false : _m;
263
- var _this = _super.call(this) || this;
264
- _this.toggles = [];
265
- _this.etag = '';
266
- _this.readyEventEmitted = false;
267
- _this.usePOSTrequests = false;
268
- _this.started = false;
269
- // Validations
270
- if (!url) {
271
- throw new Error('url is required');
272
- }
273
- if (!clientKey) {
274
- throw new Error('clientKey is required');
275
- }
276
- if (!appName) {
277
- throw new Error('appName is required.');
278
- }
279
- _this.eventsHandler = new events_handler_1.default();
280
- _this.impressionDataAll = impressionDataAll;
281
- _this.toggles = bootstrap && bootstrap.length > 0 ? bootstrap : [];
282
- _this.url = url instanceof URL ? url : new URL(url);
283
- _this.clientKey = clientKey;
284
- _this.headerName = headerName;
285
- _this.customHeaders = customHeaders;
286
- _this.storage =
287
- storageProvider ||
288
- (typeof window !== 'undefined'
289
- ? new storage_provider_local_1.default()
290
- : new storage_provider_inmemory_1.default());
291
- _this.refreshInterval = disableRefresh ? 0 : refreshInterval * 1000;
292
- _this.context = __assign({ appName: appName, environment: environment }, context);
293
- _this.usePOSTrequests = usePOSTrequests;
294
- _this.ready = new Promise(function (resolve) {
295
- _this.init()
296
- .then(resolve)
297
- .catch(function (error) {
298
- console.error(error);
299
- _this.emit(exports.EVENTS.ERROR, error);
300
- resolve();
301
- });
302
- });
303
- if (!fetch) {
304
- console.error('Unleash: You must either provide your own "fetch" implementation or run in an environment where "fetch" is available.');
305
- }
306
- _this.fetch = fetch;
307
- _this.bootstrap =
308
- bootstrap && bootstrap.length > 0 ? bootstrap : undefined;
309
- _this.bootstrapOverride = bootstrapOverride;
310
- _this.metrics = new metrics_1.default({
311
- onError: _this.emit.bind(_this, exports.EVENTS.ERROR),
312
- appName: appName,
313
- metricsInterval: metricsInterval,
314
- disableMetrics: disableMetrics,
315
- url: _this.url,
316
- clientKey: clientKey,
317
- fetch: fetch,
318
- headerName: headerName,
319
- });
320
- return _this;
321
- }
322
- UnleashClient.prototype.getAllToggles = function () {
323
- return __spreadArray([], this.toggles, true);
324
- };
325
- UnleashClient.prototype.isEnabled = function (toggleName) {
326
- var _a;
327
- var toggle = this.toggles.find(function (t) { return t.name === toggleName; });
328
- var enabled = toggle ? toggle.enabled : false;
329
- this.metrics.count(toggleName, enabled);
330
- if ((toggle === null || toggle === void 0 ? void 0 : toggle.impressionData) || this.impressionDataAll) {
331
- var event_1 = this.eventsHandler.createImpressionEvent(this.context, enabled, toggleName, IMPRESSION_EVENTS.IS_ENABLED, (_a = toggle === null || toggle === void 0 ? void 0 : toggle.impressionData) !== null && _a !== void 0 ? _a : undefined);
332
- this.emit(exports.EVENTS.IMPRESSION, event_1);
333
- }
334
- return enabled;
335
- };
336
- UnleashClient.prototype.getVariant = function (toggleName) {
337
- var _a;
338
- var toggle = this.toggles.find(function (t) { return t.name === toggleName; });
339
- var enabled = (toggle === null || toggle === void 0 ? void 0 : toggle.enabled) || false;
340
- var variant = toggle ? toggle.variant : defaultVariant;
341
- this.metrics.count(toggleName, enabled);
342
- if ((toggle === null || toggle === void 0 ? void 0 : toggle.impressionData) || this.impressionDataAll) {
343
- var event_2 = this.eventsHandler.createImpressionEvent(this.context, enabled, toggleName, IMPRESSION_EVENTS.GET_VARIANT, (_a = toggle === null || toggle === void 0 ? void 0 : toggle.impressionData) !== null && _a !== void 0 ? _a : undefined, variant.name);
344
- this.emit(exports.EVENTS.IMPRESSION, event_2);
345
- }
346
- return variant;
347
- };
348
- UnleashClient.prototype.updateContext = function (context) {
349
- return __awaiter(this, void 0, void 0, function () {
350
- var staticContext;
351
- var _this = this;
352
- return __generator(this, function (_a) {
353
- switch (_a.label) {
354
- case 0:
355
- // @ts-expect-error Give the user a nicer error message when
356
- // including static fields in the mutable context object
357
- if (context.appName || context.environment) {
358
- console.warn("appName and environment are static. They can't be updated with updateContext.");
359
- }
360
- staticContext = {
361
- environment: this.context.environment,
362
- appName: this.context.appName,
363
- sessionId: this.context.sessionId,
364
- };
365
- this.context = __assign(__assign({}, staticContext), context);
366
- if (!(this.timerRef || this.readyEventEmitted)) return [3 /*break*/, 2];
367
- return [4 /*yield*/, this.fetchToggles()];
368
- case 1:
369
- _a.sent();
370
- return [3 /*break*/, 4];
371
- case 2:
372
- if (!this.started) return [3 /*break*/, 4];
373
- return [4 /*yield*/, new Promise(function (resolve) {
374
- var listener = function () {
375
- _this.fetchToggles().then(function () {
376
- _this.off(exports.EVENTS.READY, listener);
377
- resolve();
378
- });
379
- };
380
- _this.once(exports.EVENTS.READY, listener);
381
- })];
382
- case 3:
383
- _a.sent();
384
- _a.label = 4;
385
- case 4: return [2 /*return*/];
386
- }
387
- });
388
- });
389
- };
390
- UnleashClient.prototype.getContext = function () {
391
- return __assign({}, this.context);
392
- };
393
- UnleashClient.prototype.setContextField = function (field, value) {
394
- var _a, _b;
395
- if (DEFINED_FIELDS.includes(field)) {
396
- this.context = __assign(__assign({}, this.context), (_a = {}, _a[field] = value, _a));
397
- }
398
- else {
399
- var properties = __assign(__assign({}, this.context.properties), (_b = {}, _b[field] = value, _b));
400
- this.context = __assign(__assign({}, this.context), { properties: properties });
401
- }
402
- if (this.timerRef) {
403
- this.fetchToggles();
404
- }
405
- };
406
- UnleashClient.prototype.init = function () {
407
- return __awaiter(this, void 0, void 0, function () {
408
- var sessionId, _a;
409
- return __generator(this, function (_b) {
410
- switch (_b.label) {
411
- case 0: return [4 /*yield*/, this.resolveSessionId()];
412
- case 1:
413
- sessionId = _b.sent();
414
- this.context = __assign({ sessionId: sessionId }, this.context);
415
- _a = this;
416
- return [4 /*yield*/, this.storage.get(storeKey)];
417
- case 2:
418
- _a.toggles = (_b.sent()) || [];
419
- if (!(this.bootstrap &&
420
- (this.bootstrapOverride || this.toggles.length === 0))) return [3 /*break*/, 4];
421
- return [4 /*yield*/, this.storage.save(storeKey, this.bootstrap)];
422
- case 3:
423
- _b.sent();
424
- this.toggles = this.bootstrap;
425
- this.emit(exports.EVENTS.READY);
426
- _b.label = 4;
427
- case 4:
428
- this.emit(exports.EVENTS.INIT);
429
- return [2 /*return*/];
430
- }
431
- });
432
- });
433
- };
434
- UnleashClient.prototype.start = function () {
435
- return __awaiter(this, void 0, void 0, function () {
436
- var interval;
437
- var _this = this;
438
- return __generator(this, function (_a) {
439
- switch (_a.label) {
440
- case 0:
441
- this.started = true;
442
- if (this.timerRef) {
443
- console.error('Unleash SDK has already started, if you want to restart the SDK you should call client.stop() before starting again.');
444
- return [2 /*return*/];
445
- }
446
- return [4 /*yield*/, this.ready];
447
- case 1:
448
- _a.sent();
449
- this.metrics.start();
450
- interval = this.refreshInterval;
451
- return [4 /*yield*/, this.fetchToggles()];
452
- case 2:
453
- _a.sent();
454
- if (interval > 0) {
455
- this.timerRef = setInterval(function () { return _this.fetchToggles(); }, interval);
456
- }
457
- return [2 /*return*/];
458
- }
459
- });
460
- });
461
- };
462
- UnleashClient.prototype.stop = function () {
463
- if (this.timerRef) {
464
- clearInterval(this.timerRef);
465
- this.timerRef = undefined;
466
- }
467
- this.metrics.stop();
468
- };
469
- UnleashClient.prototype.resolveSessionId = function () {
470
- return __awaiter(this, void 0, void 0, function () {
471
- var sessionId;
472
- return __generator(this, function (_a) {
473
- switch (_a.label) {
474
- case 0:
475
- if (!this.context.sessionId) return [3 /*break*/, 1];
476
- return [2 /*return*/, this.context.sessionId];
477
- case 1: return [4 /*yield*/, this.storage.get('sessionId')];
478
- case 2:
479
- sessionId = _a.sent();
480
- if (!!sessionId) return [3 /*break*/, 4];
481
- sessionId = Math.floor(Math.random() * 1000000000);
482
- return [4 /*yield*/, this.storage.save('sessionId', sessionId)];
483
- case 3:
484
- _a.sent();
485
- _a.label = 4;
486
- case 4: return [2 /*return*/, sessionId];
487
- }
488
- });
489
- });
490
- };
491
- UnleashClient.prototype.getHeaders = function () {
492
- var _a;
493
- var headers = (_a = {},
494
- _a[this.headerName] = this.clientKey,
495
- _a.Accept = 'application/json',
496
- _a['Content-Type'] = 'application/json',
497
- _a['If-None-Match'] = this.etag,
498
- _a);
499
- Object.entries(this.customHeaders)
500
- .filter(util_1.notNullOrUndefined)
501
- .forEach(function (_a) {
502
- var name = _a[0], value = _a[1];
503
- return (headers[name] = value);
504
- });
505
- return headers;
506
- };
507
- UnleashClient.prototype.storeToggles = function (toggles) {
508
- return __awaiter(this, void 0, void 0, function () {
509
- return __generator(this, function (_a) {
510
- switch (_a.label) {
511
- case 0:
512
- this.toggles = toggles;
513
- this.emit(exports.EVENTS.UPDATE);
514
- return [4 /*yield*/, this.storage.save(storeKey, toggles)];
515
- case 1:
516
- _a.sent();
517
- return [2 /*return*/];
518
- }
519
- });
520
- });
521
- };
522
- UnleashClient.prototype.fetchToggles = function () {
523
- return __awaiter(this, void 0, void 0, function () {
524
- var isPOST, url, method, body, response, data, e_1;
525
- return __generator(this, function (_a) {
526
- switch (_a.label) {
527
- case 0:
528
- if (!this.fetch) return [3 /*break*/, 8];
529
- _a.label = 1;
530
- case 1:
531
- _a.trys.push([1, 7, , 8]);
532
- isPOST = this.usePOSTrequests;
533
- url = isPOST
534
- ? this.url
535
- : (0, util_1.urlWithContextAsQuery)(this.url, this.context);
536
- method = isPOST ? 'POST' : 'GET';
537
- body = isPOST
538
- ? JSON.stringify({ context: this.context })
539
- : undefined;
540
- return [4 /*yield*/, this.fetch(url.toString(), {
541
- method: method,
542
- cache: 'no-cache',
543
- headers: this.getHeaders(),
544
- body: body,
545
- })];
546
- case 2:
547
- response = _a.sent();
548
- if (!(response.ok && response.status !== 304)) return [3 /*break*/, 5];
549
- this.etag = response.headers.get('ETag') || '';
550
- return [4 /*yield*/, response.json()];
551
- case 3:
552
- data = _a.sent();
553
- return [4 /*yield*/, this.storeToggles(data.toggles)];
554
- case 4:
555
- _a.sent();
556
- if (!this.bootstrap && !this.readyEventEmitted) {
557
- this.emit(exports.EVENTS.READY);
558
- this.readyEventEmitted = true;
559
- }
560
- return [3 /*break*/, 6];
561
- case 5:
562
- if (!response.ok && response.status !== 304) {
563
- console.error('Unleash: Fetching feature toggles did not have an ok response');
564
- this.emit(exports.EVENTS.ERROR, {
565
- type: 'HttpError',
566
- code: response.status,
567
- });
568
- }
569
- _a.label = 6;
570
- case 6: return [3 /*break*/, 8];
571
- case 7:
572
- e_1 = _a.sent();
573
- console.error('Unleash: unable to fetch feature toggles', e_1);
574
- this.emit(exports.EVENTS.ERROR, e_1);
575
- return [3 /*break*/, 8];
576
- case 8: return [2 /*return*/];
577
- }
578
- });
579
- });
580
- };
581
- return UnleashClient;
582
- }(tiny_emitter_1.TinyEmitter));
583
- exports.UnleashClient = UnleashClient;
584
- //# sourceMappingURL=index.js.map
585
-
586
- /***/ }),
587
-
588
- /***/ "./node_modules/unleash-proxy-client/build/metrics.js":
589
- /*!************************************************************!*\
590
- !*** ./node_modules/unleash-proxy-client/build/metrics.js ***!
591
- \************************************************************/
592
- /***/ (function(__unused_webpack_module, exports) {
593
-
594
- "use strict";
595
-
596
- // Simplified version of: https://github.com/Unleash/unleash-client-node/blob/main/src/metrics.ts
597
- var __assign = (this && this.__assign) || function () {
598
- __assign = Object.assign || function(t) {
599
- for (var s, i = 1, n = arguments.length; i < n; i++) {
600
- s = arguments[i];
601
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
602
- t[p] = s[p];
603
- }
604
- return t;
605
- };
606
- return __assign.apply(this, arguments);
607
- };
608
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
609
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
610
- return new (P || (P = Promise))(function (resolve, reject) {
611
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
612
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
613
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
614
- step((generator = generator.apply(thisArg, _arguments || [])).next());
615
- });
616
- };
617
- var __generator = (this && this.__generator) || function (thisArg, body) {
618
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
619
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
620
- function verb(n) { return function (v) { return step([n, v]); }; }
621
- function step(op) {
622
- if (f) throw new TypeError("Generator is already executing.");
623
- while (_) try {
624
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
625
- if (y = 0, t) op = [op[0] & 2, t.value];
626
- switch (op[0]) {
627
- case 0: case 1: t = op; break;
628
- case 4: _.label++; return { value: op[1], done: false };
629
- case 5: _.label++; y = op[1]; op = [0]; continue;
630
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
631
- default:
632
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
633
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
634
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
635
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
636
- if (t[2]) _.ops.pop();
637
- _.trys.pop(); continue;
638
- }
639
- op = body.call(thisArg, _);
640
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
641
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
642
- }
643
- };
644
- Object.defineProperty(exports, "__esModule", ({ value: true }));
645
- var Metrics = /** @class */ (function () {
646
- function Metrics(_a) {
647
- var onError = _a.onError, appName = _a.appName, metricsInterval = _a.metricsInterval, _b = _a.disableMetrics, disableMetrics = _b === void 0 ? false : _b, url = _a.url, clientKey = _a.clientKey, fetch = _a.fetch, headerName = _a.headerName;
648
- this.onError = onError;
649
- this.disabled = disableMetrics;
650
- this.metricsInterval = metricsInterval * 1000;
651
- this.appName = appName;
652
- this.url = url instanceof URL ? url : new URL(url);
653
- this.clientKey = clientKey;
654
- this.bucket = this.createEmptyBucket();
655
- this.fetch = fetch;
656
- this.headerName = headerName;
657
- }
658
- Metrics.prototype.start = function () {
659
- var _this = this;
660
- if (this.disabled) {
661
- return false;
662
- }
663
- if (typeof this.metricsInterval === 'number' &&
664
- this.metricsInterval > 0) {
665
- // send first metrics after two seconds.
666
- setTimeout(function () {
667
- _this.startTimer();
668
- _this.sendMetrics();
669
- }, 2000);
670
- }
671
- };
672
- Metrics.prototype.stop = function () {
673
- if (this.timer) {
674
- clearTimeout(this.timer);
675
- delete this.timer;
676
- }
677
- };
678
- Metrics.prototype.createEmptyBucket = function () {
679
- return {
680
- start: new Date(),
681
- stop: null,
682
- toggles: {},
683
- };
684
- };
685
- Metrics.prototype.sendMetrics = function () {
686
- return __awaiter(this, void 0, void 0, function () {
687
- var url, payload, e_1;
688
- var _a;
689
- return __generator(this, function (_b) {
690
- switch (_b.label) {
691
- case 0:
692
- url = "".concat(this.url, "/client/metrics");
693
- payload = this.getPayload();
694
- if (this.bucketIsEmpty(payload)) {
695
- return [2 /*return*/];
696
- }
697
- _b.label = 1;
698
- case 1:
699
- _b.trys.push([1, 3, , 4]);
700
- return [4 /*yield*/, this.fetch(url, {
701
- cache: 'no-cache',
702
- method: 'POST',
703
- headers: (_a = {},
704
- _a[this.headerName] = this.clientKey,
705
- _a.Accept = 'application/json',
706
- _a['Content-Type'] = 'application/json',
707
- _a),
708
- body: JSON.stringify(payload),
709
- })];
710
- case 2:
711
- _b.sent();
712
- return [3 /*break*/, 4];
713
- case 3:
714
- e_1 = _b.sent();
715
- console.error('Unleash: unable to send feature metrics', e_1);
716
- this.onError(e_1);
717
- return [3 /*break*/, 4];
718
- case 4: return [2 /*return*/];
719
- }
720
- });
721
- });
722
- };
723
- Metrics.prototype.count = function (name, enabled) {
724
- if (this.disabled || !this.bucket) {
725
- return false;
726
- }
727
- this.assertBucket(name);
728
- this.bucket.toggles[name][enabled ? 'yes' : 'no']++;
729
- return true;
730
- };
731
- Metrics.prototype.assertBucket = function (name) {
732
- if (this.disabled || !this.bucket) {
733
- return false;
734
- }
735
- if (!this.bucket.toggles[name]) {
736
- this.bucket.toggles[name] = {
737
- yes: 0,
738
- no: 0,
739
- };
740
- }
741
- };
742
- Metrics.prototype.startTimer = function () {
743
- var _this = this;
744
- this.timer = setInterval(function () {
745
- _this.sendMetrics();
746
- }, this.metricsInterval);
747
- };
748
- Metrics.prototype.bucketIsEmpty = function (payload) {
749
- return Object.keys(payload.bucket.toggles).length === 0;
750
- };
751
- Metrics.prototype.getPayload = function () {
752
- var bucket = __assign(__assign({}, this.bucket), { stop: new Date() });
753
- this.bucket = this.createEmptyBucket();
754
- return {
755
- bucket: bucket,
756
- appName: this.appName,
757
- instanceId: 'browser',
758
- };
759
- };
760
- return Metrics;
761
- }());
762
- exports["default"] = Metrics;
763
- //# sourceMappingURL=metrics.js.map
764
-
765
- /***/ }),
766
-
767
- /***/ "./node_modules/unleash-proxy-client/build/storage-provider-inmemory.js":
768
- /*!******************************************************************************!*\
769
- !*** ./node_modules/unleash-proxy-client/build/storage-provider-inmemory.js ***!
770
- \******************************************************************************/
771
- /***/ (function(__unused_webpack_module, exports) {
772
-
773
- "use strict";
774
-
775
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
776
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
777
- return new (P || (P = Promise))(function (resolve, reject) {
778
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
779
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
780
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
781
- step((generator = generator.apply(thisArg, _arguments || [])).next());
782
- });
783
- };
784
- var __generator = (this && this.__generator) || function (thisArg, body) {
785
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
786
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
787
- function verb(n) { return function (v) { return step([n, v]); }; }
788
- function step(op) {
789
- if (f) throw new TypeError("Generator is already executing.");
790
- while (_) try {
791
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
792
- if (y = 0, t) op = [op[0] & 2, t.value];
793
- switch (op[0]) {
794
- case 0: case 1: t = op; break;
795
- case 4: _.label++; return { value: op[1], done: false };
796
- case 5: _.label++; y = op[1]; op = [0]; continue;
797
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
798
- default:
799
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
800
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
801
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
802
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
803
- if (t[2]) _.ops.pop();
804
- _.trys.pop(); continue;
805
- }
806
- op = body.call(thisArg, _);
807
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
808
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
809
- }
810
- };
811
- Object.defineProperty(exports, "__esModule", ({ value: true }));
812
- var InMemoryStorageProvider = /** @class */ (function () {
813
- function InMemoryStorageProvider() {
814
- this.store = new Map();
815
- }
816
- InMemoryStorageProvider.prototype.save = function (name, data) {
817
- return __awaiter(this, void 0, void 0, function () {
818
- return __generator(this, function (_a) {
819
- this.store.set(name, data);
820
- return [2 /*return*/];
821
- });
822
- });
823
- };
824
- InMemoryStorageProvider.prototype.get = function (name) {
825
- return __awaiter(this, void 0, void 0, function () {
826
- return __generator(this, function (_a) {
827
- return [2 /*return*/, this.store.get(name)];
828
- });
829
- });
830
- };
831
- return InMemoryStorageProvider;
832
- }());
833
- exports["default"] = InMemoryStorageProvider;
834
- //# sourceMappingURL=storage-provider-inmemory.js.map
835
-
836
- /***/ }),
837
-
838
- /***/ "./node_modules/unleash-proxy-client/build/storage-provider-local.js":
839
- /*!***************************************************************************!*\
840
- !*** ./node_modules/unleash-proxy-client/build/storage-provider-local.js ***!
841
- \***************************************************************************/
842
- /***/ (function(__unused_webpack_module, exports) {
843
-
844
- "use strict";
845
-
846
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
847
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
848
- return new (P || (P = Promise))(function (resolve, reject) {
849
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
850
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
851
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
852
- step((generator = generator.apply(thisArg, _arguments || [])).next());
853
- });
854
- };
855
- var __generator = (this && this.__generator) || function (thisArg, body) {
856
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
857
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
858
- function verb(n) { return function (v) { return step([n, v]); }; }
859
- function step(op) {
860
- if (f) throw new TypeError("Generator is already executing.");
861
- while (_) try {
862
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
863
- if (y = 0, t) op = [op[0] & 2, t.value];
864
- switch (op[0]) {
865
- case 0: case 1: t = op; break;
866
- case 4: _.label++; return { value: op[1], done: false };
867
- case 5: _.label++; y = op[1]; op = [0]; continue;
868
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
869
- default:
870
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
871
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
872
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
873
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
874
- if (t[2]) _.ops.pop();
875
- _.trys.pop(); continue;
876
- }
877
- op = body.call(thisArg, _);
878
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
879
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
880
- }
881
- };
882
- Object.defineProperty(exports, "__esModule", ({ value: true }));
883
- var LocalStorageProvider = /** @class */ (function () {
884
- function LocalStorageProvider() {
885
- this.prefix = 'unleash:repository';
886
- }
887
- LocalStorageProvider.prototype.save = function (name, data) {
888
- return __awaiter(this, void 0, void 0, function () {
889
- var repo, key;
890
- return __generator(this, function (_a) {
891
- repo = JSON.stringify(data);
892
- key = "".concat(this.prefix, ":").concat(name);
893
- try {
894
- window.localStorage.setItem(key, repo);
895
- }
896
- catch (ex) {
897
- console.error(ex);
898
- }
899
- return [2 /*return*/];
900
- });
901
- });
902
- };
903
- LocalStorageProvider.prototype.get = function (name) {
904
- try {
905
- var key = "".concat(this.prefix, ":").concat(name);
906
- var data = window.localStorage.getItem(key);
907
- return data ? JSON.parse(data) : undefined;
908
- }
909
- catch (e) {
910
- console.error(e);
911
- }
912
- };
913
- return LocalStorageProvider;
914
- }());
915
- exports["default"] = LocalStorageProvider;
916
- //# sourceMappingURL=storage-provider-local.js.map
917
-
918
- /***/ }),
919
-
920
- /***/ "./node_modules/unleash-proxy-client/build/util.js":
921
- /*!*********************************************************!*\
922
- !*** ./node_modules/unleash-proxy-client/build/util.js ***!
923
- \*********************************************************/
924
- /***/ ((__unused_webpack_module, exports) => {
925
-
926
- "use strict";
927
-
928
- Object.defineProperty(exports, "__esModule", ({ value: true }));
929
- exports.urlWithContextAsQuery = exports.notNullOrUndefined = void 0;
930
- var notNullOrUndefined = function (_a) {
931
- var value = _a[1];
932
- return value !== undefined && value !== null;
933
- };
934
- exports.notNullOrUndefined = notNullOrUndefined;
935
- var urlWithContextAsQuery = function (url, context) {
936
- var urlWithQuery = new URL(url.toString());
937
- // Add context information to url search params. If the properties
938
- // object is included in the context, flatten it into the search params
939
- // e.g. /?...&property.param1=param1Value&property.param2=param2Value
940
- Object.entries(context)
941
- .filter(exports.notNullOrUndefined)
942
- .forEach(function (_a) {
943
- var contextKey = _a[0], contextValue = _a[1];
944
- if (contextKey === 'properties' && contextValue) {
945
- Object.entries(contextValue)
946
- .filter(exports.notNullOrUndefined)
947
- .forEach(function (_a) {
948
- var propertyKey = _a[0], propertyValue = _a[1];
949
- return urlWithQuery.searchParams.append("properties[".concat(propertyKey, "]"), propertyValue);
950
- });
951
- }
952
- else {
953
- urlWithQuery.searchParams.append(contextKey, contextValue);
954
- }
955
- });
956
- return urlWithQuery;
957
- };
958
- exports.urlWithContextAsQuery = urlWithContextAsQuery;
959
- //# sourceMappingURL=util.js.map
960
-
961
- /***/ }),
962
-
963
- /***/ "./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/index.js":
964
- /*!***************************************************************************************!*\
965
- !*** ./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/index.js ***!
966
- \***************************************************************************************/
967
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
968
-
969
- "use strict";
970
- __webpack_require__.r(__webpack_exports__);
971
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
972
- /* harmony export */ "NIL": () => (/* reexport safe */ _nil_js__WEBPACK_IMPORTED_MODULE_4__["default"]),
973
- /* harmony export */ "parse": () => (/* reexport safe */ _parse_js__WEBPACK_IMPORTED_MODULE_8__["default"]),
974
- /* harmony export */ "stringify": () => (/* reexport safe */ _stringify_js__WEBPACK_IMPORTED_MODULE_7__["default"]),
975
- /* harmony export */ "v1": () => (/* reexport safe */ _v1_js__WEBPACK_IMPORTED_MODULE_0__["default"]),
976
- /* harmony export */ "v3": () => (/* reexport safe */ _v3_js__WEBPACK_IMPORTED_MODULE_1__["default"]),
977
- /* harmony export */ "v4": () => (/* reexport safe */ _v4_js__WEBPACK_IMPORTED_MODULE_2__["default"]),
978
- /* harmony export */ "v5": () => (/* reexport safe */ _v5_js__WEBPACK_IMPORTED_MODULE_3__["default"]),
979
- /* harmony export */ "validate": () => (/* reexport safe */ _validate_js__WEBPACK_IMPORTED_MODULE_6__["default"]),
980
- /* harmony export */ "version": () => (/* reexport safe */ _version_js__WEBPACK_IMPORTED_MODULE_5__["default"])
981
- /* harmony export */ });
982
- /* harmony import */ var _v1_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./v1.js */ "./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/v1.js");
983
- /* harmony import */ var _v3_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./v3.js */ "./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/v3.js");
984
- /* harmony import */ var _v4_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./v4.js */ "./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/v4.js");
985
- /* harmony import */ var _v5_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./v5.js */ "./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/v5.js");
986
- /* harmony import */ var _nil_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./nil.js */ "./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/nil.js");
987
- /* harmony import */ var _version_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./version.js */ "./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/version.js");
988
- /* harmony import */ var _validate_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./validate.js */ "./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/validate.js");
989
- /* harmony import */ var _stringify_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./stringify.js */ "./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/stringify.js");
990
- /* harmony import */ var _parse_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./parse.js */ "./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/parse.js");
991
-
992
-
993
-
994
-
995
-
996
-
997
-
998
-
999
-
1000
-
1001
- /***/ }),
1002
-
1003
- /***/ "./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/md5.js":
1004
- /*!*************************************************************************************!*\
1005
- !*** ./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/md5.js ***!
1006
- \*************************************************************************************/
1007
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1008
-
1009
- "use strict";
1010
- __webpack_require__.r(__webpack_exports__);
1011
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1012
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1013
- /* harmony export */ });
1014
- /*
1015
- * Browser-compatible JavaScript MD5
1016
- *
1017
- * Modification of JavaScript MD5
1018
- * https://github.com/blueimp/JavaScript-MD5
1019
- *
1020
- * Copyright 2011, Sebastian Tschan
1021
- * https://blueimp.net
1022
- *
1023
- * Licensed under the MIT license:
1024
- * https://opensource.org/licenses/MIT
1025
- *
1026
- * Based on
1027
- * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
1028
- * Digest Algorithm, as defined in RFC 1321.
1029
- * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009
1030
- * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
1031
- * Distributed under the BSD License
1032
- * See http://pajhome.org.uk/crypt/md5 for more info.
1033
- */
1034
- function md5(bytes) {
1035
- if (typeof bytes === 'string') {
1036
- var msg = unescape(encodeURIComponent(bytes)); // UTF8 escape
1037
-
1038
- bytes = new Uint8Array(msg.length);
1039
-
1040
- for (var i = 0; i < msg.length; ++i) {
1041
- bytes[i] = msg.charCodeAt(i);
1042
- }
1043
- }
1044
-
1045
- return md5ToHexEncodedArray(wordsToMd5(bytesToWords(bytes), bytes.length * 8));
1046
- }
1047
- /*
1048
- * Convert an array of little-endian words to an array of bytes
1049
- */
1050
-
1051
-
1052
- function md5ToHexEncodedArray(input) {
1053
- var output = [];
1054
- var length32 = input.length * 32;
1055
- var hexTab = '0123456789abcdef';
1056
-
1057
- for (var i = 0; i < length32; i += 8) {
1058
- var x = input[i >> 5] >>> i % 32 & 0xff;
1059
- var hex = parseInt(hexTab.charAt(x >>> 4 & 0x0f) + hexTab.charAt(x & 0x0f), 16);
1060
- output.push(hex);
1061
- }
1062
-
1063
- return output;
1064
- }
1065
- /**
1066
- * Calculate output length with padding and bit length
1067
- */
1068
-
1069
-
1070
- function getOutputLength(inputLength8) {
1071
- return (inputLength8 + 64 >>> 9 << 4) + 14 + 1;
1072
- }
1073
- /*
1074
- * Calculate the MD5 of an array of little-endian words, and a bit length.
1075
- */
1076
-
1077
-
1078
- function wordsToMd5(x, len) {
1079
- /* append padding */
1080
- x[len >> 5] |= 0x80 << len % 32;
1081
- x[getOutputLength(len) - 1] = len;
1082
- var a = 1732584193;
1083
- var b = -271733879;
1084
- var c = -1732584194;
1085
- var d = 271733878;
1086
-
1087
- for (var i = 0; i < x.length; i += 16) {
1088
- var olda = a;
1089
- var oldb = b;
1090
- var oldc = c;
1091
- var oldd = d;
1092
- a = md5ff(a, b, c, d, x[i], 7, -680876936);
1093
- d = md5ff(d, a, b, c, x[i + 1], 12, -389564586);
1094
- c = md5ff(c, d, a, b, x[i + 2], 17, 606105819);
1095
- b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330);
1096
- a = md5ff(a, b, c, d, x[i + 4], 7, -176418897);
1097
- d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426);
1098
- c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341);
1099
- b = md5ff(b, c, d, a, x[i + 7], 22, -45705983);
1100
- a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416);
1101
- d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417);
1102
- c = md5ff(c, d, a, b, x[i + 10], 17, -42063);
1103
- b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162);
1104
- a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682);
1105
- d = md5ff(d, a, b, c, x[i + 13], 12, -40341101);
1106
- c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290);
1107
- b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329);
1108
- a = md5gg(a, b, c, d, x[i + 1], 5, -165796510);
1109
- d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632);
1110
- c = md5gg(c, d, a, b, x[i + 11], 14, 643717713);
1111
- b = md5gg(b, c, d, a, x[i], 20, -373897302);
1112
- a = md5gg(a, b, c, d, x[i + 5], 5, -701558691);
1113
- d = md5gg(d, a, b, c, x[i + 10], 9, 38016083);
1114
- c = md5gg(c, d, a, b, x[i + 15], 14, -660478335);
1115
- b = md5gg(b, c, d, a, x[i + 4], 20, -405537848);
1116
- a = md5gg(a, b, c, d, x[i + 9], 5, 568446438);
1117
- d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690);
1118
- c = md5gg(c, d, a, b, x[i + 3], 14, -187363961);
1119
- b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501);
1120
- a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467);
1121
- d = md5gg(d, a, b, c, x[i + 2], 9, -51403784);
1122
- c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473);
1123
- b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734);
1124
- a = md5hh(a, b, c, d, x[i + 5], 4, -378558);
1125
- d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463);
1126
- c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562);
1127
- b = md5hh(b, c, d, a, x[i + 14], 23, -35309556);
1128
- a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060);
1129
- d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353);
1130
- c = md5hh(c, d, a, b, x[i + 7], 16, -155497632);
1131
- b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640);
1132
- a = md5hh(a, b, c, d, x[i + 13], 4, 681279174);
1133
- d = md5hh(d, a, b, c, x[i], 11, -358537222);
1134
- c = md5hh(c, d, a, b, x[i + 3], 16, -722521979);
1135
- b = md5hh(b, c, d, a, x[i + 6], 23, 76029189);
1136
- a = md5hh(a, b, c, d, x[i + 9], 4, -640364487);
1137
- d = md5hh(d, a, b, c, x[i + 12], 11, -421815835);
1138
- c = md5hh(c, d, a, b, x[i + 15], 16, 530742520);
1139
- b = md5hh(b, c, d, a, x[i + 2], 23, -995338651);
1140
- a = md5ii(a, b, c, d, x[i], 6, -198630844);
1141
- d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415);
1142
- c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905);
1143
- b = md5ii(b, c, d, a, x[i + 5], 21, -57434055);
1144
- a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571);
1145
- d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606);
1146
- c = md5ii(c, d, a, b, x[i + 10], 15, -1051523);
1147
- b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799);
1148
- a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359);
1149
- d = md5ii(d, a, b, c, x[i + 15], 10, -30611744);
1150
- c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380);
1151
- b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649);
1152
- a = md5ii(a, b, c, d, x[i + 4], 6, -145523070);
1153
- d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379);
1154
- c = md5ii(c, d, a, b, x[i + 2], 15, 718787259);
1155
- b = md5ii(b, c, d, a, x[i + 9], 21, -343485551);
1156
- a = safeAdd(a, olda);
1157
- b = safeAdd(b, oldb);
1158
- c = safeAdd(c, oldc);
1159
- d = safeAdd(d, oldd);
1160
- }
1161
-
1162
- return [a, b, c, d];
1163
- }
1164
- /*
1165
- * Convert an array bytes to an array of little-endian words
1166
- * Characters >255 have their high-byte silently ignored.
1167
- */
1168
-
1169
-
1170
- function bytesToWords(input) {
1171
- if (input.length === 0) {
1172
- return [];
1173
- }
1174
-
1175
- var length8 = input.length * 8;
1176
- var output = new Uint32Array(getOutputLength(length8));
1177
-
1178
- for (var i = 0; i < length8; i += 8) {
1179
- output[i >> 5] |= (input[i / 8] & 0xff) << i % 32;
1180
- }
1181
-
1182
- return output;
1183
- }
1184
- /*
1185
- * Add integers, wrapping at 2^32. This uses 16-bit operations internally
1186
- * to work around bugs in some JS interpreters.
1187
- */
1188
-
1189
-
1190
- function safeAdd(x, y) {
1191
- var lsw = (x & 0xffff) + (y & 0xffff);
1192
- var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
1193
- return msw << 16 | lsw & 0xffff;
1194
- }
1195
- /*
1196
- * Bitwise rotate a 32-bit number to the left.
1197
- */
1198
-
1199
-
1200
- function bitRotateLeft(num, cnt) {
1201
- return num << cnt | num >>> 32 - cnt;
1202
- }
1203
- /*
1204
- * These functions implement the four basic operations the algorithm uses.
1205
- */
1206
-
1207
-
1208
- function md5cmn(q, a, b, x, s, t) {
1209
- return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b);
1210
- }
1211
-
1212
- function md5ff(a, b, c, d, x, s, t) {
1213
- return md5cmn(b & c | ~b & d, a, b, x, s, t);
1214
- }
1215
-
1216
- function md5gg(a, b, c, d, x, s, t) {
1217
- return md5cmn(b & d | c & ~d, a, b, x, s, t);
1218
- }
1219
-
1220
- function md5hh(a, b, c, d, x, s, t) {
1221
- return md5cmn(b ^ c ^ d, a, b, x, s, t);
1222
- }
1223
-
1224
- function md5ii(a, b, c, d, x, s, t) {
1225
- return md5cmn(c ^ (b | ~d), a, b, x, s, t);
1226
- }
1227
-
1228
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (md5);
1229
-
1230
- /***/ }),
1231
-
1232
- /***/ "./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/nil.js":
1233
- /*!*************************************************************************************!*\
1234
- !*** ./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/nil.js ***!
1235
- \*************************************************************************************/
1236
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1237
-
1238
- "use strict";
1239
- __webpack_require__.r(__webpack_exports__);
1240
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1241
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1242
- /* harmony export */ });
1243
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ('00000000-0000-0000-0000-000000000000');
1244
-
1245
- /***/ }),
1246
-
1247
- /***/ "./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/parse.js":
1248
- /*!***************************************************************************************!*\
1249
- !*** ./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/parse.js ***!
1250
- \***************************************************************************************/
1251
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1252
-
1253
- "use strict";
1254
- __webpack_require__.r(__webpack_exports__);
1255
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1256
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1257
- /* harmony export */ });
1258
- /* harmony import */ var _validate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./validate.js */ "./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/validate.js");
1259
-
1260
-
1261
- function parse(uuid) {
1262
- if (!(0,_validate_js__WEBPACK_IMPORTED_MODULE_0__["default"])(uuid)) {
1263
- throw TypeError('Invalid UUID');
1264
- }
1265
-
1266
- var v;
1267
- var arr = new Uint8Array(16); // Parse ########-....-....-....-............
1268
-
1269
- arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
1270
- arr[1] = v >>> 16 & 0xff;
1271
- arr[2] = v >>> 8 & 0xff;
1272
- arr[3] = v & 0xff; // Parse ........-####-....-....-............
1273
-
1274
- arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
1275
- arr[5] = v & 0xff; // Parse ........-....-####-....-............
1276
-
1277
- arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
1278
- arr[7] = v & 0xff; // Parse ........-....-....-####-............
1279
-
1280
- arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
1281
- arr[9] = v & 0xff; // Parse ........-....-....-....-############
1282
- // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes)
1283
-
1284
- arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;
1285
- arr[11] = v / 0x100000000 & 0xff;
1286
- arr[12] = v >>> 24 & 0xff;
1287
- arr[13] = v >>> 16 & 0xff;
1288
- arr[14] = v >>> 8 & 0xff;
1289
- arr[15] = v & 0xff;
1290
- return arr;
1291
- }
1292
-
1293
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (parse);
1294
-
1295
- /***/ }),
1296
-
1297
- /***/ "./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/regex.js":
1298
- /*!***************************************************************************************!*\
1299
- !*** ./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/regex.js ***!
1300
- \***************************************************************************************/
1301
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1302
-
1303
- "use strict";
1304
- __webpack_require__.r(__webpack_exports__);
1305
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1306
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1307
- /* harmony export */ });
1308
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i);
1309
-
1310
- /***/ }),
1311
-
1312
- /***/ "./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/rng.js":
1313
- /*!*************************************************************************************!*\
1314
- !*** ./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/rng.js ***!
1315
- \*************************************************************************************/
1316
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1317
-
1318
- "use strict";
1319
- __webpack_require__.r(__webpack_exports__);
1320
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1321
- /* harmony export */ "default": () => (/* binding */ rng)
1322
- /* harmony export */ });
1323
- // Unique ID creation requires a high quality random # generator. In the browser we therefore
1324
- // require the crypto API and do not support built-in fallback to lower quality random number
1325
- // generators (like Math.random()).
1326
- var getRandomValues;
1327
- var rnds8 = new Uint8Array(16);
1328
- function rng() {
1329
- // lazy load so that environments that need to polyfill have a chance to do so
1330
- if (!getRandomValues) {
1331
- // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also,
1332
- // find the complete implementation of crypto (msCrypto) on IE11.
1333
- getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);
1334
-
1335
- if (!getRandomValues) {
1336
- throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
1337
- }
1338
- }
1339
-
1340
- return getRandomValues(rnds8);
1341
- }
1342
-
1343
- /***/ }),
1344
-
1345
- /***/ "./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/sha1.js":
1346
- /*!**************************************************************************************!*\
1347
- !*** ./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/sha1.js ***!
1348
- \**************************************************************************************/
1349
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1350
-
1351
- "use strict";
1352
- __webpack_require__.r(__webpack_exports__);
1353
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1354
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1355
- /* harmony export */ });
1356
- // Adapted from Chris Veness' SHA1 code at
1357
- // http://www.movable-type.co.uk/scripts/sha1.html
1358
- function f(s, x, y, z) {
1359
- switch (s) {
1360
- case 0:
1361
- return x & y ^ ~x & z;
1362
-
1363
- case 1:
1364
- return x ^ y ^ z;
1365
-
1366
- case 2:
1367
- return x & y ^ x & z ^ y & z;
1368
-
1369
- case 3:
1370
- return x ^ y ^ z;
1371
- }
1372
- }
1373
-
1374
- function ROTL(x, n) {
1375
- return x << n | x >>> 32 - n;
1376
- }
1377
-
1378
- function sha1(bytes) {
1379
- var K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6];
1380
- var H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0];
1381
-
1382
- if (typeof bytes === 'string') {
1383
- var msg = unescape(encodeURIComponent(bytes)); // UTF8 escape
1384
-
1385
- bytes = [];
1386
-
1387
- for (var i = 0; i < msg.length; ++i) {
1388
- bytes.push(msg.charCodeAt(i));
1389
- }
1390
- } else if (!Array.isArray(bytes)) {
1391
- // Convert Array-like to Array
1392
- bytes = Array.prototype.slice.call(bytes);
1393
- }
1394
-
1395
- bytes.push(0x80);
1396
- var l = bytes.length / 4 + 2;
1397
- var N = Math.ceil(l / 16);
1398
- var M = new Array(N);
1399
-
1400
- for (var _i = 0; _i < N; ++_i) {
1401
- var arr = new Uint32Array(16);
1402
-
1403
- for (var j = 0; j < 16; ++j) {
1404
- arr[j] = bytes[_i * 64 + j * 4] << 24 | bytes[_i * 64 + j * 4 + 1] << 16 | bytes[_i * 64 + j * 4 + 2] << 8 | bytes[_i * 64 + j * 4 + 3];
1405
- }
1406
-
1407
- M[_i] = arr;
1408
- }
1409
-
1410
- M[N - 1][14] = (bytes.length - 1) * 8 / Math.pow(2, 32);
1411
- M[N - 1][14] = Math.floor(M[N - 1][14]);
1412
- M[N - 1][15] = (bytes.length - 1) * 8 & 0xffffffff;
1413
-
1414
- for (var _i2 = 0; _i2 < N; ++_i2) {
1415
- var W = new Uint32Array(80);
1416
-
1417
- for (var t = 0; t < 16; ++t) {
1418
- W[t] = M[_i2][t];
1419
- }
1420
-
1421
- for (var _t = 16; _t < 80; ++_t) {
1422
- W[_t] = ROTL(W[_t - 3] ^ W[_t - 8] ^ W[_t - 14] ^ W[_t - 16], 1);
1423
- }
1424
-
1425
- var a = H[0];
1426
- var b = H[1];
1427
- var c = H[2];
1428
- var d = H[3];
1429
- var e = H[4];
1430
-
1431
- for (var _t2 = 0; _t2 < 80; ++_t2) {
1432
- var s = Math.floor(_t2 / 20);
1433
- var T = ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[_t2] >>> 0;
1434
- e = d;
1435
- d = c;
1436
- c = ROTL(b, 30) >>> 0;
1437
- b = a;
1438
- a = T;
1439
- }
1440
-
1441
- H[0] = H[0] + a >>> 0;
1442
- H[1] = H[1] + b >>> 0;
1443
- H[2] = H[2] + c >>> 0;
1444
- H[3] = H[3] + d >>> 0;
1445
- H[4] = H[4] + e >>> 0;
1446
- }
1447
-
1448
- return [H[0] >> 24 & 0xff, H[0] >> 16 & 0xff, H[0] >> 8 & 0xff, H[0] & 0xff, H[1] >> 24 & 0xff, H[1] >> 16 & 0xff, H[1] >> 8 & 0xff, H[1] & 0xff, H[2] >> 24 & 0xff, H[2] >> 16 & 0xff, H[2] >> 8 & 0xff, H[2] & 0xff, H[3] >> 24 & 0xff, H[3] >> 16 & 0xff, H[3] >> 8 & 0xff, H[3] & 0xff, H[4] >> 24 & 0xff, H[4] >> 16 & 0xff, H[4] >> 8 & 0xff, H[4] & 0xff];
1449
- }
1450
-
1451
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (sha1);
1452
-
1453
- /***/ }),
1454
-
1455
- /***/ "./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/stringify.js":
1456
- /*!*******************************************************************************************!*\
1457
- !*** ./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/stringify.js ***!
1458
- \*******************************************************************************************/
1459
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1460
-
1461
- "use strict";
1462
- __webpack_require__.r(__webpack_exports__);
1463
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1464
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1465
- /* harmony export */ });
1466
- /* harmony import */ var _validate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./validate.js */ "./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/validate.js");
1467
-
1468
- /**
1469
- * Convert array of 16 byte values to UUID string format of the form:
1470
- * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
1471
- */
1472
-
1473
- var byteToHex = [];
1474
-
1475
- for (var i = 0; i < 256; ++i) {
1476
- byteToHex.push((i + 0x100).toString(16).substr(1));
1477
- }
1478
-
1479
- function stringify(arr) {
1480
- var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
1481
- // Note: Be careful editing this code! It's been tuned for performance
1482
- // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
1483
- var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one
1484
- // of the following:
1485
- // - One or more input array values don't map to a hex octet (leading to
1486
- // "undefined" in the uuid)
1487
- // - Invalid input values for the RFC `version` or `variant` fields
1488
-
1489
- if (!(0,_validate_js__WEBPACK_IMPORTED_MODULE_0__["default"])(uuid)) {
1490
- throw TypeError('Stringified UUID is invalid');
1491
- }
1492
-
1493
- return uuid;
1494
- }
1495
-
1496
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (stringify);
1497
-
1498
- /***/ }),
1499
-
1500
- /***/ "./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/v1.js":
1501
- /*!************************************************************************************!*\
1502
- !*** ./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/v1.js ***!
1503
- \************************************************************************************/
1504
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1505
-
1506
- "use strict";
1507
- __webpack_require__.r(__webpack_exports__);
1508
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1509
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1510
- /* harmony export */ });
1511
- /* harmony import */ var _rng_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./rng.js */ "./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/rng.js");
1512
- /* harmony import */ var _stringify_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./stringify.js */ "./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/stringify.js");
1513
-
1514
- // **`v1()` - Generate time-based UUID**
1515
- //
1516
- // Inspired by https://github.com/LiosK/UUID.js
1517
- // and http://docs.python.org/library/uuid.html
1518
-
1519
- var _nodeId;
1520
-
1521
- var _clockseq; // Previous uuid creation time
1522
-
1523
-
1524
- var _lastMSecs = 0;
1525
- var _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details
1526
-
1527
- function v1(options, buf, offset) {
1528
- var i = buf && offset || 0;
1529
- var b = buf || new Array(16);
1530
- options = options || {};
1531
- var node = options.node || _nodeId;
1532
- var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not
1533
- // specified. We do this lazily to minimize issues related to insufficient
1534
- // system entropy. See #189
1535
-
1536
- if (node == null || clockseq == null) {
1537
- var seedBytes = options.random || (options.rng || _rng_js__WEBPACK_IMPORTED_MODULE_0__["default"])();
1538
-
1539
- if (node == null) {
1540
- // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
1541
- node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
1542
- }
1543
-
1544
- if (clockseq == null) {
1545
- // Per 4.2.2, randomize (14 bit) clockseq
1546
- clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
1547
- }
1548
- } // UUID timestamps are 100 nano-second units since the Gregorian epoch,
1549
- // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
1550
- // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
1551
- // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
1552
-
1553
-
1554
- var msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock
1555
- // cycle to simulate higher resolution clock
1556
-
1557
- var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)
1558
-
1559
- var dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression
1560
-
1561
- if (dt < 0 && options.clockseq === undefined) {
1562
- clockseq = clockseq + 1 & 0x3fff;
1563
- } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
1564
- // time interval
1565
-
1566
-
1567
- if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
1568
- nsecs = 0;
1569
- } // Per 4.2.1.2 Throw error if too many uuids are requested
1570
-
1571
-
1572
- if (nsecs >= 10000) {
1573
- throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
1574
- }
1575
-
1576
- _lastMSecs = msecs;
1577
- _lastNSecs = nsecs;
1578
- _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
1579
-
1580
- msecs += 12219292800000; // `time_low`
1581
-
1582
- var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
1583
- b[i++] = tl >>> 24 & 0xff;
1584
- b[i++] = tl >>> 16 & 0xff;
1585
- b[i++] = tl >>> 8 & 0xff;
1586
- b[i++] = tl & 0xff; // `time_mid`
1587
-
1588
- var tmh = msecs / 0x100000000 * 10000 & 0xfffffff;
1589
- b[i++] = tmh >>> 8 & 0xff;
1590
- b[i++] = tmh & 0xff; // `time_high_and_version`
1591
-
1592
- b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
1593
-
1594
- b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
1595
-
1596
- b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`
1597
-
1598
- b[i++] = clockseq & 0xff; // `node`
1599
-
1600
- for (var n = 0; n < 6; ++n) {
1601
- b[i + n] = node[n];
1602
- }
1603
-
1604
- return buf || (0,_stringify_js__WEBPACK_IMPORTED_MODULE_1__["default"])(b);
1605
- }
1606
-
1607
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (v1);
1608
-
1609
- /***/ }),
1610
-
1611
- /***/ "./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/v3.js":
1612
- /*!************************************************************************************!*\
1613
- !*** ./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/v3.js ***!
1614
- \************************************************************************************/
1615
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1616
-
1617
- "use strict";
1618
- __webpack_require__.r(__webpack_exports__);
1619
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1620
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1621
- /* harmony export */ });
1622
- /* harmony import */ var _v35_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./v35.js */ "./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/v35.js");
1623
- /* harmony import */ var _md5_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./md5.js */ "./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/md5.js");
1624
-
1625
-
1626
- var v3 = (0,_v35_js__WEBPACK_IMPORTED_MODULE_0__["default"])('v3', 0x30, _md5_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
1627
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (v3);
1628
-
1629
- /***/ }),
1630
-
1631
- /***/ "./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/v35.js":
1632
- /*!*************************************************************************************!*\
1633
- !*** ./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/v35.js ***!
1634
- \*************************************************************************************/
1635
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1636
-
1637
- "use strict";
1638
- __webpack_require__.r(__webpack_exports__);
1639
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1640
- /* harmony export */ "DNS": () => (/* binding */ DNS),
1641
- /* harmony export */ "URL": () => (/* binding */ URL),
1642
- /* harmony export */ "default": () => (/* export default binding */ __WEBPACK_DEFAULT_EXPORT__)
1643
- /* harmony export */ });
1644
- /* harmony import */ var _stringify_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./stringify.js */ "./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/stringify.js");
1645
- /* harmony import */ var _parse_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./parse.js */ "./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/parse.js");
1646
-
1647
-
1648
-
1649
- function stringToBytes(str) {
1650
- str = unescape(encodeURIComponent(str)); // UTF8 escape
1651
-
1652
- var bytes = [];
1653
-
1654
- for (var i = 0; i < str.length; ++i) {
1655
- bytes.push(str.charCodeAt(i));
1656
- }
1657
-
1658
- return bytes;
1659
- }
1660
-
1661
- var DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
1662
- var URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
1663
- /* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(name, version, hashfunc) {
1664
- function generateUUID(value, namespace, buf, offset) {
1665
- if (typeof value === 'string') {
1666
- value = stringToBytes(value);
1667
- }
1668
-
1669
- if (typeof namespace === 'string') {
1670
- namespace = (0,_parse_js__WEBPACK_IMPORTED_MODULE_0__["default"])(namespace);
1671
- }
1672
-
1673
- if (namespace.length !== 16) {
1674
- throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');
1675
- } // Compute hash of namespace and value, Per 4.3
1676
- // Future: Use spread syntax when supported on all platforms, e.g. `bytes =
1677
- // hashfunc([...namespace, ... value])`
1678
-
1679
-
1680
- var bytes = new Uint8Array(16 + value.length);
1681
- bytes.set(namespace);
1682
- bytes.set(value, namespace.length);
1683
- bytes = hashfunc(bytes);
1684
- bytes[6] = bytes[6] & 0x0f | version;
1685
- bytes[8] = bytes[8] & 0x3f | 0x80;
1686
-
1687
- if (buf) {
1688
- offset = offset || 0;
1689
-
1690
- for (var i = 0; i < 16; ++i) {
1691
- buf[offset + i] = bytes[i];
1692
- }
1693
-
1694
- return buf;
1695
- }
1696
-
1697
- return (0,_stringify_js__WEBPACK_IMPORTED_MODULE_1__["default"])(bytes);
1698
- } // Function#name is not settable on some platforms (#270)
1699
-
1700
-
1701
- try {
1702
- generateUUID.name = name; // eslint-disable-next-line no-empty
1703
- } catch (err) {} // For CommonJS default export support
1704
-
1705
-
1706
- generateUUID.DNS = DNS;
1707
- generateUUID.URL = URL;
1708
- return generateUUID;
1709
- }
1710
-
1711
- /***/ }),
1712
-
1713
- /***/ "./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/v4.js":
1714
- /*!************************************************************************************!*\
1715
- !*** ./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/v4.js ***!
1716
- \************************************************************************************/
1717
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1718
-
1719
- "use strict";
1720
- __webpack_require__.r(__webpack_exports__);
1721
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1722
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1723
- /* harmony export */ });
1724
- /* harmony import */ var _rng_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./rng.js */ "./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/rng.js");
1725
- /* harmony import */ var _stringify_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./stringify.js */ "./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/stringify.js");
1726
-
1727
-
1728
-
1729
- function v4(options, buf, offset) {
1730
- options = options || {};
1731
- var rnds = options.random || (options.rng || _rng_js__WEBPACK_IMPORTED_MODULE_0__["default"])(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
1732
-
1733
- rnds[6] = rnds[6] & 0x0f | 0x40;
1734
- rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
1735
-
1736
- if (buf) {
1737
- offset = offset || 0;
1738
-
1739
- for (var i = 0; i < 16; ++i) {
1740
- buf[offset + i] = rnds[i];
1741
- }
1742
-
1743
- return buf;
1744
- }
1745
-
1746
- return (0,_stringify_js__WEBPACK_IMPORTED_MODULE_1__["default"])(rnds);
1747
- }
1748
-
1749
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (v4);
1750
-
1751
- /***/ }),
1752
-
1753
- /***/ "./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/v5.js":
1754
- /*!************************************************************************************!*\
1755
- !*** ./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/v5.js ***!
1756
- \************************************************************************************/
1757
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1758
-
1759
- "use strict";
1760
- __webpack_require__.r(__webpack_exports__);
1761
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1762
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1763
- /* harmony export */ });
1764
- /* harmony import */ var _v35_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./v35.js */ "./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/v35.js");
1765
- /* harmony import */ var _sha1_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./sha1.js */ "./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/sha1.js");
1766
-
1767
-
1768
- var v5 = (0,_v35_js__WEBPACK_IMPORTED_MODULE_0__["default"])('v5', 0x50, _sha1_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
1769
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (v5);
1770
-
1771
- /***/ }),
1772
-
1773
- /***/ "./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/validate.js":
1774
- /*!******************************************************************************************!*\
1775
- !*** ./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/validate.js ***!
1776
- \******************************************************************************************/
1777
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1778
-
1779
- "use strict";
1780
- __webpack_require__.r(__webpack_exports__);
1781
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1782
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1783
- /* harmony export */ });
1784
- /* harmony import */ var _regex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./regex.js */ "./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/regex.js");
1785
-
1786
-
1787
- function validate(uuid) {
1788
- return typeof uuid === 'string' && _regex_js__WEBPACK_IMPORTED_MODULE_0__["default"].test(uuid);
1789
- }
1790
-
1791
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (validate);
1792
-
1793
- /***/ }),
1794
-
1795
- /***/ "./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/version.js":
1796
- /*!*****************************************************************************************!*\
1797
- !*** ./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/version.js ***!
1798
- \*****************************************************************************************/
1799
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1800
-
1801
- "use strict";
1802
- __webpack_require__.r(__webpack_exports__);
1803
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1804
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1805
- /* harmony export */ });
1806
- /* harmony import */ var _validate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./validate.js */ "./node_modules/unleash-proxy-client/node_modules/uuid/dist/esm-browser/validate.js");
1807
-
1808
-
1809
- function version(uuid) {
1810
- if (!(0,_validate_js__WEBPACK_IMPORTED_MODULE_0__["default"])(uuid)) {
1811
- throw TypeError('Invalid UUID');
1812
- }
1813
-
1814
- return parseInt(uuid.substr(14, 1), 16);
1815
- }
1816
-
1817
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (version);
1818
-
1819
- /***/ })
1820
-
1821
- }]);