@commercetools-frontend/application-shell 0.0.0-FEC-157-preview-releases-20241126230331

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 (324) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +7 -0
  3. package/dist/application-entry-point-547561a2.cjs.dev.js +109 -0
  4. package/dist/application-entry-point-54a9664f.esm.js +94 -0
  5. package/dist/application-entry-point-654951a6.cjs.prod.js +90 -0
  6. package/dist/box-09bf50e1.cjs.prod.js +30 -0
  7. package/dist/box-4857aa65.cjs.dev.js +30 -0
  8. package/dist/box-9cf180c1.esm.js +17 -0
  9. package/dist/cart-645074db.cjs.prod.js +30 -0
  10. package/dist/cart-b0044279.cjs.dev.js +30 -0
  11. package/dist/cart-bb491ca1.esm.js +17 -0
  12. package/dist/commercetools-frontend-application-shell.cjs.d.ts +2 -0
  13. package/dist/commercetools-frontend-application-shell.cjs.d.ts.map +1 -0
  14. package/dist/commercetools-frontend-application-shell.cjs.dev.js +215 -0
  15. package/dist/commercetools-frontend-application-shell.cjs.js +7 -0
  16. package/dist/commercetools-frontend-application-shell.cjs.prod.js +215 -0
  17. package/dist/commercetools-frontend-application-shell.esm.js +81 -0
  18. package/dist/connected-square-2d046cb8.cjs.prod.js +30 -0
  19. package/dist/connected-square-a2fea344.cjs.dev.js +30 -0
  20. package/dist/connected-square-fe6a790f.esm.js +17 -0
  21. package/dist/custom-view-dev-host-076c2a9f.cjs.prod.js +197 -0
  22. package/dist/custom-view-dev-host-5eebbfcd.esm.js +188 -0
  23. package/dist/custom-view-dev-host-7e7d8572.cjs.dev.js +200 -0
  24. package/dist/declarations/src/components/app-bar/app-bar.d.ts +10 -0
  25. package/dist/declarations/src/components/app-bar/index.d.ts +1 -0
  26. package/dist/declarations/src/components/application-entry-point/application-entry-point.d.ts +10 -0
  27. package/dist/declarations/src/components/application-entry-point/index.d.ts +1 -0
  28. package/dist/declarations/src/components/application-loader/application-loader.d.ts +8 -0
  29. package/dist/declarations/src/components/application-loader/index.d.ts +1 -0
  30. package/dist/declarations/src/components/application-page-title/application-page-title.d.ts +25 -0
  31. package/dist/declarations/src/components/application-page-title/index.d.ts +1 -0
  32. package/dist/declarations/src/components/application-shell/application-shell.d.ts +45 -0
  33. package/dist/declarations/src/components/application-shell/global-styles.d.ts +3 -0
  34. package/dist/declarations/src/components/application-shell/index.d.ts +1 -0
  35. package/dist/declarations/src/components/application-shell-authenticated/application-shell-authenticated.d.ts +25 -0
  36. package/dist/declarations/src/components/application-shell-provider/application-shell-provider.d.ts +17 -0
  37. package/dist/declarations/src/components/application-shell-provider/index.d.ts +1 -0
  38. package/dist/declarations/src/components/application-shell-provider/use-coerced-environment-values.d.ts +6 -0
  39. package/dist/declarations/src/components/application-shell-provider/utils.d.ts +3 -0
  40. package/dist/declarations/src/components/authenticated/am-i-logged-in.d.ts +13 -0
  41. package/dist/declarations/src/components/authenticated/authenticated.d.ts +16 -0
  42. package/dist/declarations/src/components/authenticated/has-cached-authentication-state.d.ts +2 -0
  43. package/dist/declarations/src/components/authenticated/index.d.ts +1 -0
  44. package/dist/declarations/src/components/authenticated/oidc-callback-error-page.d.ts +12 -0
  45. package/dist/declarations/src/components/authenticated/oidc-callback.async.d.ts +6 -0
  46. package/dist/declarations/src/components/authenticated/oidc-callback.d.ts +11 -0
  47. package/dist/declarations/src/components/authenticated/types.d.ts +6 -0
  48. package/dist/declarations/src/components/back-to-project/back-to-project.d.ts +8 -0
  49. package/dist/declarations/src/components/back-to-project/index.d.ts +1 -0
  50. package/dist/declarations/src/components/back-to-project/messages.d.ts +7 -0
  51. package/dist/declarations/src/components/configure-intl-provider/configure-intl-provider.d.ts +12 -0
  52. package/dist/declarations/src/components/configure-intl-provider/index.d.ts +1 -0
  53. package/dist/declarations/src/components/custom-view-dev-host/custom-view-dev-host.d.ts +11 -0
  54. package/dist/declarations/src/components/custom-view-dev-host/index.d.ts +6 -0
  55. package/dist/declarations/src/components/custom-view-flop-flip-provider/custom-view-flop-flip-provider.d.ts +10 -0
  56. package/dist/declarations/src/components/custom-view-flop-flip-provider/index.d.ts +1 -0
  57. package/dist/declarations/src/components/custom-view-shell/custom-view-shell.d.ts +12 -0
  58. package/dist/declarations/src/components/custom-view-shell/custom-view-shell.styles.d.ts +9 -0
  59. package/dist/declarations/src/components/custom-view-shell/index.d.ts +1 -0
  60. package/dist/declarations/src/components/custom-view-shell-authenticated/custom-view-shell-authenticated.d.ts +15 -0
  61. package/dist/declarations/src/components/custom-view-shell-authenticated/index.d.ts +1 -0
  62. package/dist/declarations/src/components/error-apologizer/error-apologizer.d.ts +5 -0
  63. package/dist/declarations/src/components/error-apologizer/index.d.ts +6 -0
  64. package/dist/declarations/src/components/error-apologizer/messages.d.ts +11 -0
  65. package/dist/declarations/src/components/error-boundary/error-boundary.d.ts +20 -0
  66. package/dist/declarations/src/components/error-boundary/index.d.ts +1 -0
  67. package/dist/declarations/src/components/fetch-project/fetch-project.d.ts +18 -0
  68. package/dist/declarations/src/components/fetch-project/index.d.ts +1 -0
  69. package/dist/declarations/src/components/fetch-user/fetch-user.d.ts +16 -0
  70. package/dist/declarations/src/components/fetch-user/index.d.ts +1 -0
  71. package/dist/declarations/src/components/inject-reducers/index.d.ts +1 -0
  72. package/dist/declarations/src/components/inject-reducers/inject-reducers.d.ts +14 -0
  73. package/dist/declarations/src/components/loading-placeholder/index.d.ts +1 -0
  74. package/dist/declarations/src/components/loading-placeholder/loading-placeholder.d.ts +10 -0
  75. package/dist/declarations/src/components/locale-switcher/index.d.ts +1 -0
  76. package/dist/declarations/src/components/locale-switcher/locale-switcher.d.ts +12 -0
  77. package/dist/declarations/src/components/locale-switcher/messages.d.ts +18 -0
  78. package/dist/declarations/src/components/navbar/index.d.ts +6 -0
  79. package/dist/declarations/src/components/navbar/legacy-icons/box.d.ts +2 -0
  80. package/dist/declarations/src/components/navbar/legacy-icons/cart.d.ts +2 -0
  81. package/dist/declarations/src/components/navbar/legacy-icons/connected-square.d.ts +2 -0
  82. package/dist/declarations/src/components/navbar/legacy-icons/gear.d.ts +2 -0
  83. package/dist/declarations/src/components/navbar/legacy-icons/heart.d.ts +2 -0
  84. package/dist/declarations/src/components/navbar/legacy-icons/list-with-search.d.ts +2 -0
  85. package/dist/declarations/src/components/navbar/legacy-icons/paperclip.d.ts +2 -0
  86. package/dist/declarations/src/components/navbar/legacy-icons/plugin.d.ts +2 -0
  87. package/dist/declarations/src/components/navbar/legacy-icons/rocket.d.ts +2 -0
  88. package/dist/declarations/src/components/navbar/legacy-icons/speedometer.d.ts +2 -0
  89. package/dist/declarations/src/components/navbar/legacy-icons/star.d.ts +2 -0
  90. package/dist/declarations/src/components/navbar/legacy-icons/tag-multi.d.ts +2 -0
  91. package/dist/declarations/src/components/navbar/legacy-icons/tree-structure.d.ts +2 -0
  92. package/dist/declarations/src/components/navbar/legacy-icons/user-filled.d.ts +2 -0
  93. package/dist/declarations/src/components/navbar/legacy-icons/world.d.ts +2 -0
  94. package/dist/declarations/src/components/navbar/main-navbar.styles.d.ts +51 -0
  95. package/dist/declarations/src/components/navbar/menu-items.d.ts +107 -0
  96. package/dist/declarations/src/components/navbar/menu-items.styles.d.ts +52 -0
  97. package/dist/declarations/src/components/navbar/messages.d.ts +7 -0
  98. package/dist/declarations/src/components/navbar/navbar-skeleton.d.ts +6 -0
  99. package/dist/declarations/src/components/navbar/navbar-skeleton.styles.d.ts +43 -0
  100. package/dist/declarations/src/components/navbar/navbar.d.ts +51 -0
  101. package/dist/declarations/src/components/navbar/non-nullable.d.ts +1 -0
  102. package/dist/declarations/src/components/navbar/shared.styles.d.ts +18 -0
  103. package/dist/declarations/src/components/navbar/use-navbar-state-manager.d.ts +25 -0
  104. package/dist/declarations/src/components/project-container/index.d.ts +61 -0
  105. package/dist/declarations/src/components/project-container/messages.d.ts +7 -0
  106. package/dist/declarations/src/components/project-container/project-container.d.ts +17 -0
  107. package/dist/declarations/src/components/project-data-locale/index.d.ts +1 -0
  108. package/dist/declarations/src/components/project-data-locale/project-data-locale.d.ts +14 -0
  109. package/dist/declarations/src/components/project-expired/index.d.ts +6 -0
  110. package/dist/declarations/src/components/project-expired/messages.d.ts +11 -0
  111. package/dist/declarations/src/components/project-expired/project-expired.d.ts +5 -0
  112. package/dist/declarations/src/components/project-not-found/index.d.ts +6 -0
  113. package/dist/declarations/src/components/project-not-found/messages.d.ts +15 -0
  114. package/dist/declarations/src/components/project-not-found/project-not-found.d.ts +5 -0
  115. package/dist/declarations/src/components/project-not-initialized/index.d.ts +6 -0
  116. package/dist/declarations/src/components/project-not-initialized/messages.d.ts +11 -0
  117. package/dist/declarations/src/components/project-not-initialized/project-not-initialized.d.ts +5 -0
  118. package/dist/declarations/src/components/project-suspended/index.d.ts +8 -0
  119. package/dist/declarations/src/components/project-suspended/messages.d.ts +15 -0
  120. package/dist/declarations/src/components/project-suspended/project-suspended.d.ts +8 -0
  121. package/dist/declarations/src/components/project-switcher/index.d.ts +1 -0
  122. package/dist/declarations/src/components/project-switcher/messages.d.ts +28 -0
  123. package/dist/declarations/src/components/project-switcher/project-switcher.d.ts +11 -0
  124. package/dist/declarations/src/components/quick-access/butler/butler.d.ts +14 -0
  125. package/dist/declarations/src/components/quick-access/butler/index.d.ts +1 -0
  126. package/dist/declarations/src/components/quick-access/butler-command/butler-command.d.ts +13 -0
  127. package/dist/declarations/src/components/quick-access/butler-command/index.d.ts +1 -0
  128. package/dist/declarations/src/components/quick-access/butler-container/butler-container.d.ts +6 -0
  129. package/dist/declarations/src/components/quick-access/butler-container/index.d.ts +1 -0
  130. package/dist/declarations/src/components/quick-access/constants.d.ts +24 -0
  131. package/dist/declarations/src/components/quick-access/create-commands.d.ts +13 -0
  132. package/dist/declarations/src/components/quick-access/history-entries.d.ts +3 -0
  133. package/dist/declarations/src/components/quick-access/index.d.ts +8 -0
  134. package/dist/declarations/src/components/quick-access/messages.d.ts +247 -0
  135. package/dist/declarations/src/components/quick-access/pim-indexer-states.d.ts +6 -0
  136. package/dist/declarations/src/components/quick-access/quick-access.d.ts +12 -0
  137. package/dist/declarations/src/components/quick-access/sub-commands.d.ts +17 -0
  138. package/dist/declarations/src/components/quick-access/types.d.ts +31 -0
  139. package/dist/declarations/src/components/quick-access/utils.d.ts +5 -0
  140. package/dist/declarations/src/components/redirect-to-login/index.d.ts +6 -0
  141. package/dist/declarations/src/components/redirect-to-login/redirect-to-login.d.ts +5 -0
  142. package/dist/declarations/src/components/redirect-to-logout/index.d.ts +5 -0
  143. package/dist/declarations/src/components/redirect-to-logout/redirect-to-logout.d.ts +6 -0
  144. package/dist/declarations/src/components/redirect-to-project-create/index.d.ts +6 -0
  145. package/dist/declarations/src/components/redirect-to-project-create/redirect-to-project-create.d.ts +5 -0
  146. package/dist/declarations/src/components/redirector/index.d.ts +1 -0
  147. package/dist/declarations/src/components/redirector/redirector.d.ts +23 -0
  148. package/dist/declarations/src/components/requests-in-flight-loader/constants.d.ts +1 -0
  149. package/dist/declarations/src/components/requests-in-flight-loader/index.d.ts +7 -0
  150. package/dist/declarations/src/components/requests-in-flight-loader/messages.d.ts +8 -0
  151. package/dist/declarations/src/components/requests-in-flight-loader/reducer.d.ts +4 -0
  152. package/dist/declarations/src/components/requests-in-flight-loader/requests-in-flight-loader.d.ts +6 -0
  153. package/dist/declarations/src/components/requests-in-flight-loader/types.d.ts +9 -0
  154. package/dist/declarations/src/components/route-catch-all/index.d.ts +3 -0
  155. package/dist/declarations/src/components/route-catch-all/route-catch-all.d.ts +2 -0
  156. package/dist/declarations/src/components/service-page-project-switcher/index.d.ts +1 -0
  157. package/dist/declarations/src/components/service-page-project-switcher/service-page-project-switcher.d.ts +5 -0
  158. package/dist/declarations/src/components/setup-flop-flip-provider/index.d.ts +1 -0
  159. package/dist/declarations/src/components/setup-flop-flip-provider/setup-flop-flip-provider.d.ts +17 -0
  160. package/dist/declarations/src/components/suspended-route/index.d.ts +1 -0
  161. package/dist/declarations/src/components/suspended-route/suspended-route.d.ts +6 -0
  162. package/dist/declarations/src/components/theme-switcher/index.d.ts +1 -0
  163. package/dist/declarations/src/components/theme-switcher/theme-switcher.d.ts +2 -0
  164. package/dist/declarations/src/components/user-settings-menu/index.d.ts +12 -0
  165. package/dist/declarations/src/components/user-settings-menu/messages.d.ts +33 -0
  166. package/dist/declarations/src/components/user-settings-menu/user-settings-menu.d.ts +20 -0
  167. package/dist/declarations/src/configure-store.d.ts +22 -0
  168. package/dist/declarations/src/constants.d.ts +42 -0
  169. package/dist/declarations/src/export-types.d.ts +8 -0
  170. package/dist/declarations/src/hooks/use-applications-menu/index.d.ts +1 -0
  171. package/dist/declarations/src/hooks/use-applications-menu/use-applications-menu.d.ts +13 -0
  172. package/dist/declarations/src/hooks/use-is-served-by-proxy/index.d.ts +1 -0
  173. package/dist/declarations/src/hooks/use-is-served-by-proxy/use-is-served-by-proxy.d.ts +2 -0
  174. package/dist/declarations/src/hooks/use-routes-creator/index.d.ts +1 -0
  175. package/dist/declarations/src/hooks/use-routes-creator/use-routes-creator.d.ts +22 -0
  176. package/dist/declarations/src/index.d.ts +33 -0
  177. package/dist/declarations/src/middleware/hide-notifications.d.ts +3 -0
  178. package/dist/declarations/src/middleware/logger.d.ts +3 -0
  179. package/dist/declarations/src/ssr/index.d.ts +2 -0
  180. package/dist/declarations/src/test-utils/custom-views-utils.d.ts +21 -0
  181. package/dist/declarations/src/test-utils/index.d.ts +2 -0
  182. package/dist/declarations/src/test-utils/test-utils.d.ts +83 -0
  183. package/dist/declarations/src/types/generated/ctp.d.ts +14279 -0
  184. package/dist/declarations/src/types/generated/mc.d.ts +742 -0
  185. package/dist/declarations/src/types/generated/proxy.d.ts +154 -0
  186. package/dist/declarations/src/types/generated/settings.d.ts +2116 -0
  187. package/dist/declarations/src/utils/get-mc-api-url/get-mc-api-url.d.ts +3 -0
  188. package/dist/declarations/src/utils/get-mc-api-url/index.d.ts +1 -0
  189. package/dist/declarations/src/utils/get-mc-origin/get-mc-origin.d.ts +18 -0
  190. package/dist/declarations/src/utils/get-mc-origin/index.d.ts +1 -0
  191. package/dist/declarations/src/utils/get-previous-project-key/get-previous-project-key.d.ts +2 -0
  192. package/dist/declarations/src/utils/get-previous-project-key/index.d.ts +1 -0
  193. package/dist/declarations/src/utils/index.d.ts +3 -0
  194. package/dist/declarations/src/utils/location/index.d.ts +1 -0
  195. package/dist/declarations/src/utils/location/location.d.ts +5 -0
  196. package/dist/declarations/src/utils/oidc.d.ts +10 -0
  197. package/dist/declarations/src/utils/select-project-key-from-local-storage/index.d.ts +1 -0
  198. package/dist/declarations/src/utils/select-project-key-from-local-storage/select-project-key-from-local-storage.d.ts +1 -0
  199. package/dist/declarations/src/utils/setup-global-error-listener/index.d.ts +1 -0
  200. package/dist/declarations/src/utils/setup-global-error-listener/setup-global-error-listener.d.ts +1 -0
  201. package/dist/declarations/src/version.d.ts +2 -0
  202. package/dist/error-apologizer-76f087f4.esm.js +39 -0
  203. package/dist/error-apologizer-84dc825c.cjs.prod.js +53 -0
  204. package/dist/error-apologizer-f6793491.cjs.dev.js +53 -0
  205. package/dist/gear-4f7cde98.cjs.prod.js +30 -0
  206. package/dist/gear-ee90ba83.esm.js +17 -0
  207. package/dist/gear-f2668579.cjs.dev.js +30 -0
  208. package/dist/get-mc-origin-8f7a578c.cjs.prod.js +51 -0
  209. package/dist/get-mc-origin-a86dff20.cjs.dev.js +51 -0
  210. package/dist/get-mc-origin-fecfee07.esm.js +44 -0
  211. package/dist/heart-01f01038.cjs.prod.js +30 -0
  212. package/dist/heart-86f780f3.esm.js +17 -0
  213. package/dist/heart-e49dd92a.cjs.dev.js +30 -0
  214. package/dist/index-76b6a9ad.cjs.dev.js +2215 -0
  215. package/dist/index-91985d64.cjs.prod.js +232 -0
  216. package/dist/index-b1476d46.cjs.dev.js +232 -0
  217. package/dist/index-b2fb611e.esm.js +2150 -0
  218. package/dist/index-b6081c20.esm.js +206 -0
  219. package/dist/index-ff82019b.cjs.prod.js +2058 -0
  220. package/dist/list-with-search-027ab8eb.cjs.dev.js +30 -0
  221. package/dist/list-with-search-6462447e.cjs.prod.js +30 -0
  222. package/dist/list-with-search-d2901e34.esm.js +17 -0
  223. package/dist/location-537e0660.cjs.prod.js +32 -0
  224. package/dist/location-c835b8df.cjs.dev.js +32 -0
  225. package/dist/location-f21dbc25.esm.js +30 -0
  226. package/dist/navbar-1465f182.cjs.prod.js +1189 -0
  227. package/dist/navbar-62d10e1c.cjs.dev.js +1426 -0
  228. package/dist/navbar-7b53adec.esm.js +1394 -0
  229. package/dist/oidc-8827f9fe.cjs.dev.js +98 -0
  230. package/dist/oidc-b2520905.esm.js +84 -0
  231. package/dist/oidc-callback-17a812d6.esm.js +234 -0
  232. package/dist/oidc-callback-76814954.cjs.prod.js +243 -0
  233. package/dist/oidc-callback-adb8385b.cjs.dev.js +249 -0
  234. package/dist/oidc-d74e6aa2.cjs.prod.js +98 -0
  235. package/dist/paperclip-005ec544.cjs.dev.js +30 -0
  236. package/dist/paperclip-a820ee87.esm.js +17 -0
  237. package/dist/paperclip-fe72a70d.cjs.prod.js +30 -0
  238. package/dist/plugin-81ae1044.cjs.prod.js +30 -0
  239. package/dist/plugin-c7bf9e53.esm.js +17 -0
  240. package/dist/plugin-feb22442.cjs.dev.js +30 -0
  241. package/dist/project-container-091b168d.cjs.dev.js +390 -0
  242. package/dist/project-container-55778868.cjs.prod.js +381 -0
  243. package/dist/project-container-b5401554.esm.js +368 -0
  244. package/dist/project-expired-47196b04.cjs.dev.js +136 -0
  245. package/dist/project-expired-5d8570a3.cjs.prod.js +136 -0
  246. package/dist/project-expired-9efda620.esm.js +122 -0
  247. package/dist/project-not-found-6346d0bc.cjs.prod.js +129 -0
  248. package/dist/project-not-found-f069a112.esm.js +115 -0
  249. package/dist/project-not-found-fef5d1f1.cjs.dev.js +129 -0
  250. package/dist/project-not-initialized-cad5df83.esm.js +122 -0
  251. package/dist/project-not-initialized-d05d529a.cjs.prod.js +136 -0
  252. package/dist/project-not-initialized-e1b3ec3f.cjs.dev.js +136 -0
  253. package/dist/project-suspended-36f6576b.cjs.prod.js +134 -0
  254. package/dist/project-suspended-a29d0f56.cjs.dev.js +134 -0
  255. package/dist/project-suspended-b488c3fe.esm.js +120 -0
  256. package/dist/quick-access-5ffe0e5c.cjs.prod.js +1877 -0
  257. package/dist/quick-access-638c9699.esm.js +1888 -0
  258. package/dist/quick-access-ee38025a.cjs.dev.js +1917 -0
  259. package/dist/redirect-to-login-321190b7.cjs.dev.js +118 -0
  260. package/dist/redirect-to-login-8c7575fb.cjs.prod.js +118 -0
  261. package/dist/redirect-to-login-d9c20203.esm.js +116 -0
  262. package/dist/redirect-to-logout-03e7fdb7.cjs.dev.js +125 -0
  263. package/dist/redirect-to-logout-263d0e66.cjs.prod.js +125 -0
  264. package/dist/redirect-to-logout-3a4109b6.esm.js +112 -0
  265. package/dist/redirect-to-project-create-9249e554.esm.js +60 -0
  266. package/dist/redirect-to-project-create-e4ff7797.cjs.prod.js +68 -0
  267. package/dist/redirect-to-project-create-f4f01842.cjs.dev.js +68 -0
  268. package/dist/redirector-01f35da8.cjs.prod.js +75 -0
  269. package/dist/redirector-76670a54.esm.js +59 -0
  270. package/dist/redirector-98dfc5f0.cjs.dev.js +75 -0
  271. package/dist/requests-in-flight-loader-7f677421.cjs.prod.js +121 -0
  272. package/dist/requests-in-flight-loader-aafcb3cd.cjs.dev.js +121 -0
  273. package/dist/requests-in-flight-loader-e2d591ca.esm.js +106 -0
  274. package/dist/rocket-3372731a.cjs.dev.js +30 -0
  275. package/dist/rocket-bacf24be.esm.js +17 -0
  276. package/dist/rocket-cb99be06.cjs.prod.js +30 -0
  277. package/dist/route-catch-all-7803b1fd.esm.js +42 -0
  278. package/dist/route-catch-all-8e71a93c.cjs.prod.js +44 -0
  279. package/dist/route-catch-all-b979e1fd.cjs.dev.js +44 -0
  280. package/dist/service-page-project-switcher-05b50df7.cjs.prod.js +37 -0
  281. package/dist/service-page-project-switcher-0ee3a898.esm.js +40 -0
  282. package/dist/service-page-project-switcher-e7998e11.cjs.dev.js +46 -0
  283. package/dist/speedometer-26f52e73.cjs.prod.js +30 -0
  284. package/dist/speedometer-4c8e0b9c.esm.js +17 -0
  285. package/dist/speedometer-c1ec5a1d.cjs.dev.js +30 -0
  286. package/dist/star-6b9a91d2.cjs.dev.js +30 -0
  287. package/dist/star-af90a9c6.esm.js +17 -0
  288. package/dist/star-e4902bbb.cjs.prod.js +30 -0
  289. package/dist/tag-multi-1c065f61.cjs.prod.js +30 -0
  290. package/dist/tag-multi-4c2742de.esm.js +17 -0
  291. package/dist/tag-multi-abef3e15.cjs.dev.js +30 -0
  292. package/dist/tree-structure-3ec98cce.cjs.prod.js +30 -0
  293. package/dist/tree-structure-96ab0b7e.cjs.dev.js +30 -0
  294. package/dist/tree-structure-ca0498a0.esm.js +17 -0
  295. package/dist/use-applications-menu-222b9106.cjs.prod.js +173 -0
  296. package/dist/use-applications-menu-302a0ac8.cjs.dev.js +173 -0
  297. package/dist/use-applications-menu-b583e9c3.esm.js +158 -0
  298. package/dist/use-is-served-by-proxy-28f19a6f.cjs.dev.js +10 -0
  299. package/dist/use-is-served-by-proxy-480e8de8.cjs.prod.js +10 -0
  300. package/dist/use-is-served-by-proxy-a383da4b.esm.js +8 -0
  301. package/dist/user-filled-26f333b2.cjs.prod.js +30 -0
  302. package/dist/user-filled-34aeebcc.cjs.dev.js +30 -0
  303. package/dist/user-filled-61d8a81b.esm.js +17 -0
  304. package/dist/user-settings-menu-a0813186.cjs.dev.js +359 -0
  305. package/dist/user-settings-menu-dc94ceb2.esm.js +333 -0
  306. package/dist/user-settings-menu-ead5fed2.cjs.prod.js +335 -0
  307. package/dist/world-22189397.cjs.prod.js +30 -0
  308. package/dist/world-500baeb2.cjs.dev.js +30 -0
  309. package/dist/world-523efd61.esm.js +17 -0
  310. package/package.json +146 -0
  311. package/ssr/dist/commercetools-frontend-application-shell-ssr.cjs.d.ts +2 -0
  312. package/ssr/dist/commercetools-frontend-application-shell-ssr.cjs.d.ts.map +1 -0
  313. package/ssr/dist/commercetools-frontend-application-shell-ssr.cjs.dev.js +20 -0
  314. package/ssr/dist/commercetools-frontend-application-shell-ssr.cjs.js +7 -0
  315. package/ssr/dist/commercetools-frontend-application-shell-ssr.cjs.prod.js +20 -0
  316. package/ssr/dist/commercetools-frontend-application-shell-ssr.esm.js +4 -0
  317. package/ssr/package.json +4 -0
  318. package/test-utils/dist/commercetools-frontend-application-shell-test-utils.cjs.d.ts +2 -0
  319. package/test-utils/dist/commercetools-frontend-application-shell-test-utils.cjs.d.ts.map +1 -0
  320. package/test-utils/dist/commercetools-frontend-application-shell-test-utils.cjs.dev.js +556 -0
  321. package/test-utils/dist/commercetools-frontend-application-shell-test-utils.cjs.js +7 -0
  322. package/test-utils/dist/commercetools-frontend-application-shell-test-utils.cjs.prod.js +547 -0
  323. package/test-utils/dist/commercetools-frontend-application-shell-test-utils.esm.js +503 -0
  324. package/test-utils/package.json +4 -0
@@ -0,0 +1,2058 @@
1
+ 'use strict';
2
+
3
+ var _pt = require('prop-types');
4
+ var react = require('react');
5
+ var reactRouterDom = require('react-router-dom');
6
+ var index = require('./index-91985d64.cjs.prod.js');
7
+ var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
8
+ var _styled = require('@emotion/styled/base');
9
+ var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find');
10
+ var _includesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/includes');
11
+ var _Array$isArray = require('@babel/runtime-corejs3/core-js-stable/array/is-array');
12
+ var _Object$keys = require('@babel/runtime-corejs3/core-js-stable/object/keys');
13
+ var _Object$getOwnPropertySymbols = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
14
+ var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/filter');
15
+ var _Object$getOwnPropertyDescriptor = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor');
16
+ var _forEachInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/for-each');
17
+ var _Object$getOwnPropertyDescriptors = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors');
18
+ var _Object$defineProperties = require('@babel/runtime-corejs3/core-js-stable/object/define-properties');
19
+ var _Object$defineProperty = require('@babel/runtime-corejs3/core-js-stable/object/define-property');
20
+ var react$1 = require('@emotion/react');
21
+ var applicationComponents = require('@commercetools-frontend/application-components');
22
+ var applicationShellConnectors = require('@commercetools-frontend/application-shell-connectors');
23
+ var constants = require('@commercetools-frontend/constants');
24
+ var i18n = require('@commercetools-frontend/i18n');
25
+ var reactNotifications = require('@commercetools-frontend/react-notifications');
26
+ var sentry = require('@commercetools-frontend/sentry');
27
+ var oidc = require('./oidc-d74e6aa2.cjs.prod.js');
28
+ require('@babel/runtime-corejs3/core-js-stable/url');
29
+ var designSystem = require('@commercetools-uikit/design-system');
30
+ var Spacings = require('@commercetools-uikit/spacings');
31
+ var reactIntl = require('react-intl');
32
+ var FlatButton = require('@commercetools-uikit/flat-button');
33
+ var icons = require('@commercetools-uikit/icons');
34
+ var location = require('./location-537e0660.cjs.prod.js');
35
+ var jsxRuntime = require('@emotion/react/jsx-runtime');
36
+ var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
37
+ var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
38
+ var memoize = require('memoize-one');
39
+ var reactSelect = require('react-select');
40
+ var AccessibleHidden = require('@commercetools-uikit/accessible-hidden');
41
+ var SelectInput = require('@commercetools-uikit/select-input');
42
+ var Text = require('@commercetools-uikit/text');
43
+ var CTLogoSVG = require('@commercetools-frontend/assets/images/ct-logo.svg');
44
+ var LoadingSpinner = require('@commercetools-uikit/loading-spinner');
45
+ var history = require('@commercetools-frontend/browser-history');
46
+ var l10n = require('@commercetools-frontend/l10n');
47
+ var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
48
+ var _Reflect$construct = require('@babel/runtime-corejs3/core-js-stable/reflect/construct');
49
+ var _classCallCheck = require('@babel/runtime-corejs3/helpers/classCallCheck');
50
+ var _createClass = require('@babel/runtime-corejs3/helpers/createClass');
51
+ var _inherits = require('@babel/runtime-corejs3/helpers/inherits');
52
+ var _possibleConstructorReturn = require('@babel/runtime-corejs3/helpers/possibleConstructorReturn');
53
+ var _getPrototypeOf = require('@babel/runtime-corejs3/helpers/getPrototypeOf');
54
+ require('@babel/runtime-corejs3/core-js-stable/instance/index-of');
55
+ var _sliceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/slice');
56
+ var _Object$fromEntries = require('@babel/runtime-corejs3/core-js-stable/object/from-entries');
57
+ var _flagsInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/flags');
58
+ var react$2 = require('@apollo/client/react');
59
+ var combineAdapters = require('@flopflip/combine-adapters');
60
+ var httpAdapter = require('@flopflip/http-adapter');
61
+ var ldAdapter = require('@flopflip/launchdarkly-adapter');
62
+ var reactBroadcast = require('@flopflip/react-broadcast');
63
+ var types = require('@flopflip/types');
64
+ var reactRedux = require('react-redux');
65
+ var _startsWithInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/starts-with');
66
+ var _reduceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/reduce');
67
+ require('@commercetools-uikit/design-system/materials/resets.css');
68
+ var ssr = require('@commercetools-frontend/application-config/ssr');
69
+ var permissions = require('@commercetools-frontend/permissions');
70
+ var memoryAdapter = require('@flopflip/memory-adapter');
71
+ var _JSON$stringify = require('@babel/runtime-corejs3/core-js-stable/json/stringify');
72
+ var _someInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/some');
73
+ var actionsGlobal = require('@commercetools-frontend/actions-global');
74
+
75
+ function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
76
+
77
+ var _pt__default = /*#__PURE__*/_interopDefault(_pt);
78
+ var _styled__default = /*#__PURE__*/_interopDefault(_styled);
79
+ var _findInstanceProperty__default = /*#__PURE__*/_interopDefault(_findInstanceProperty);
80
+ var _includesInstanceProperty__default = /*#__PURE__*/_interopDefault(_includesInstanceProperty);
81
+ var _Array$isArray__default = /*#__PURE__*/_interopDefault(_Array$isArray);
82
+ var _Object$keys__default = /*#__PURE__*/_interopDefault(_Object$keys);
83
+ var _Object$getOwnPropertySymbols__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertySymbols);
84
+ var _filterInstanceProperty__default = /*#__PURE__*/_interopDefault(_filterInstanceProperty);
85
+ var _Object$getOwnPropertyDescriptor__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertyDescriptor);
86
+ var _forEachInstanceProperty__default = /*#__PURE__*/_interopDefault(_forEachInstanceProperty);
87
+ var _Object$getOwnPropertyDescriptors__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertyDescriptors);
88
+ var _Object$defineProperties__default = /*#__PURE__*/_interopDefault(_Object$defineProperties);
89
+ var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defineProperty);
90
+ var Spacings__default = /*#__PURE__*/_interopDefault(Spacings);
91
+ var FlatButton__default = /*#__PURE__*/_interopDefault(FlatButton);
92
+ var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstanceProperty);
93
+ var memoize__default = /*#__PURE__*/_interopDefault(memoize);
94
+ var AccessibleHidden__default = /*#__PURE__*/_interopDefault(AccessibleHidden);
95
+ var SelectInput__default = /*#__PURE__*/_interopDefault(SelectInput);
96
+ var Text__default = /*#__PURE__*/_interopDefault(Text);
97
+ var CTLogoSVG__default = /*#__PURE__*/_interopDefault(CTLogoSVG);
98
+ var LoadingSpinner__default = /*#__PURE__*/_interopDefault(LoadingSpinner);
99
+ var history__default = /*#__PURE__*/_interopDefault(history);
100
+ var _Reflect$construct__default = /*#__PURE__*/_interopDefault(_Reflect$construct);
101
+ var _sliceInstanceProperty__default = /*#__PURE__*/_interopDefault(_sliceInstanceProperty);
102
+ var _Object$fromEntries__default = /*#__PURE__*/_interopDefault(_Object$fromEntries);
103
+ var _flagsInstanceProperty__default = /*#__PURE__*/_interopDefault(_flagsInstanceProperty);
104
+ var combineAdapters__default = /*#__PURE__*/_interopDefault(combineAdapters);
105
+ var httpAdapter__default = /*#__PURE__*/_interopDefault(httpAdapter);
106
+ var ldAdapter__default = /*#__PURE__*/_interopDefault(ldAdapter);
107
+ var _startsWithInstanceProperty__default = /*#__PURE__*/_interopDefault(_startsWithInstanceProperty);
108
+ var _reduceInstanceProperty__default = /*#__PURE__*/_interopDefault(_reduceInstanceProperty);
109
+ var memoryAdapter__default = /*#__PURE__*/_interopDefault(memoryAdapter);
110
+ var _JSON$stringify__default = /*#__PURE__*/_interopDefault(_JSON$stringify);
111
+ var _someInstanceProperty__default = /*#__PURE__*/_interopDefault(_someInstanceProperty);
112
+
113
+ // NOTE: This string will be replaced on build time with the package version.
114
+ var version = "22.35.1";
115
+
116
+ const RequestsInFlightLoader = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./requests-in-flight-loader-7f677421.cjs.prod.js' /* webpackChunkName: "requests-in-flight-loader" */); }));
117
+
118
+ // Attempt to load the `projectKey` from localStorage
119
+ function selectProjectKeyFromLocalStorage() {
120
+ return window.localStorage.getItem(constants.STORAGE_KEYS.ACTIVE_PROJECT_KEY);
121
+ }
122
+
123
+ const getPreviousProjectKey = defaultProjectKeyOfUser => {
124
+ const previouslyUsedProjectKeyFromLocalStorage = selectProjectKeyFromLocalStorage();
125
+ if (previouslyUsedProjectKeyFromLocalStorage) return previouslyUsedProjectKeyFromLocalStorage;
126
+ if (defaultProjectKeyOfUser) return defaultProjectKeyOfUser;
127
+ return;
128
+ };
129
+
130
+ var messages$1 = reactIntl.defineMessages({
131
+ backToProjectLink: {
132
+ id: 'AppBar.backToProjectLink',
133
+ defaultMessage: 'Back to project'
134
+ }
135
+ });
136
+
137
+ /**
138
+ * Note:
139
+ * A full page reload is needed as the user's project may have changed (deletions and/or additions).
140
+ * As a result the project and user queries need refetching.
141
+ */
142
+ const redirectToProject = key => location.location.replace(`/${key}`);
143
+ const BackToProject = props => {
144
+ const intl = reactIntl.useIntl();
145
+ return jsxRuntime.jsx(FlatButton__default["default"], {
146
+ onClick: () => redirectToProject(props.projectKey || ''),
147
+ icon: jsxRuntime.jsx(icons.AngleLeftIcon, {}),
148
+ label: intl.formatMessage(messages$1.backToProjectLink)
149
+ });
150
+ };
151
+ BackToProject.displayName = 'BackToProject';
152
+
153
+ const animationPulse = react$1.keyframes`
154
+ 0% {
155
+ background-color: ${designSystem.customProperties.colorNeutral};
156
+ }
157
+ 100% {
158
+ background-color: ${designSystem.customProperties.colorNeutral95};
159
+ }
160
+ `;
161
+ const getWidthBySize = props => {
162
+ switch (props.shape) {
163
+ case 'dot':
164
+ switch (props.size) {
165
+ case 's':
166
+ return designSystem.customProperties.spacingS;
167
+ case 'm':
168
+ return designSystem.customProperties.spacingM;
169
+ case 'l':
170
+ return designSystem.customProperties.spacingL;
171
+ case 'xl':
172
+ return designSystem.customProperties.spacingXl;
173
+ default:
174
+ return 'auto';
175
+ }
176
+ case 'rect':
177
+ switch (props.size) {
178
+ case 's':
179
+ return '150px';
180
+ case 'm':
181
+ return '300px';
182
+ case 'l':
183
+ return '450px';
184
+ case 'xl':
185
+ return '600px';
186
+ default:
187
+ return 'auto';
188
+ }
189
+ default:
190
+ return 'auto';
191
+ }
192
+ };
193
+ const getHeightBySize = props => {
194
+ switch (props.shape) {
195
+ case 'dot':
196
+ return getWidthBySize(props);
197
+ case 'rect':
198
+ return '32px';
199
+ default:
200
+ return 'auto';
201
+ }
202
+ };
203
+ const getRadiusBySize = props => {
204
+ switch (props.shape) {
205
+ case 'dot':
206
+ switch (props.size) {
207
+ case 's':
208
+ return designSystem.customProperties.borderRadius4;
209
+ case 'm':
210
+ return '8px';
211
+ case 'l':
212
+ return '12px';
213
+ case 'xl':
214
+ return '16px';
215
+ default:
216
+ return 'none';
217
+ }
218
+ case 'rect':
219
+ return designSystem.customProperties.borderRadius4;
220
+ default:
221
+ return 'none';
222
+ }
223
+ };
224
+ const LoadingPlaceholder = /*#__PURE__*/_styled__default["default"]("div", {
225
+ target: "e4c5pm00"
226
+ } )("background-color:", designSystem.customProperties.colorNeutral, ";animation-name:", animationPulse, ";animation-duration:1s;animation-timing-function:ease-out;animation-delay:0;animation-direction:alternate;animation-iteration-count:infinite;width:", getWidthBySize, ";height:", getHeightBySize, ";border-radius:", getRadiusBySize, ";" + ("" ));
227
+ LoadingPlaceholder.displayName = 'LoadingPlaceholder';
228
+
229
+ var messages = reactIntl.defineMessages({
230
+ projectsLabel: {
231
+ id: 'ProjectSwitcher.projectsLabel',
232
+ description: 'The label for project dropdown switcher',
233
+ defaultMessage: 'Projects'
234
+ },
235
+ searchPlaceholder: {
236
+ id: 'ProjectSwitcher.searchPlaceholder',
237
+ description: 'Projects filter search input placeholder',
238
+ defaultMessage: 'Search for a project'
239
+ },
240
+ noResults: {
241
+ id: 'ProjectSwitcher.noResults',
242
+ description: 'Projects filter no results text',
243
+ defaultMessage: 'Sorry, but there are no projects that match your search.'
244
+ },
245
+ suspended: {
246
+ id: 'ProjectSwitcher.suspended',
247
+ description: 'Label for a suspended project',
248
+ defaultMessage: 'Suspended'
249
+ },
250
+ expired: {
251
+ id: 'ProjectSwitcher.expired',
252
+ description: 'Label for a suspended project',
253
+ defaultMessage: 'Expired'
254
+ }
255
+ });
256
+
257
+ const _excluded = ["children"];
258
+ function ownKeys$8(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
259
+ function _objectSpread$8(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$8(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$8(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
260
+ var ProjectsQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchUserProjects" }, variableDefinitions: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", alias: { kind: "Name", value: "user" }, name: { kind: "Name", value: "me" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "projects" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "suspension" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "isActive" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "expiry" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "isActive" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "isProductionProject" }, arguments: [], directives: [] }] } }] } }] } }] } }], loc: { start: 0, end: 258, source: { body: "query FetchUserProjects {\n user: me {\n id\n projects {\n total\n results {\n name\n key\n suspension {\n isActive\n }\n expiry {\n isActive\n }\n isProductionProject\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
261
+ const PROJECT_SWITCHER_LABEL_ID = 'project-switcher-label';
262
+ const ValueContainer = _ref2 => {
263
+ let children = _ref2.children,
264
+ restProps = _objectWithoutProperties(_ref2, _excluded);
265
+ return jsxRuntime.jsx(Text__default["default"].Body, {
266
+ fontWeight: "medium",
267
+ as: "span",
268
+ children: jsxRuntime.jsx(SelectInput__default["default"].ValueContainer, _objectSpread$8(_objectSpread$8({}, restProps), {}, {
269
+ children: children
270
+ }))
271
+ });
272
+ };
273
+ const ProjectStampsList = props => jsxRuntime.jsxs(Spacings__default["default"].Stack, {
274
+ scale: "xs",
275
+ alignItems: "flex-end",
276
+ children: [props.isProductionProject && jsxRuntime.jsx(applicationComponents.ProjectStamp.IsProduction, {}), props.suspension && props.suspension.isActive && jsxRuntime.jsx(applicationComponents.ProjectStamp.IsSuspended, {}), props.expiry && props.expiry.isActive && jsxRuntime.jsx(applicationComponents.ProjectStamp.IsExpired, {}), props.expiry && Boolean(props.expiry.daysLeft) && jsxRuntime.jsx(applicationComponents.ProjectStamp.WillExpire, {
277
+ daysLeft: props.expiry.daysLeft
278
+ })]
279
+ });
280
+ var _ref$2 = {
281
+ name: "uyj17t",
282
+ styles: "flex:1;word-wrap:break-word"
283
+ } ;
284
+ const ProjectSwitcherOption = props => {
285
+ const project = props.data;
286
+ return jsxRuntime.jsx(SelectInput__default["default"].Option, _objectSpread$8(_objectSpread$8({}, props), {}, {
287
+ children: jsxRuntime.jsxs(Spacings__default["default"].Inline, {
288
+ scale: "xs",
289
+ justifyContent: "space-between",
290
+ children: [jsxRuntime.jsxs("div", {
291
+ css: _ref$2,
292
+ children: [jsxRuntime.jsx(Text__default["default"].Body, {
293
+ fontWeight: "medium",
294
+ tone: props.isDisabled ? 'tertiary' : 'inherit',
295
+ children: project.name
296
+ }), jsxRuntime.jsx(Text__default["default"].Caption, {
297
+ tone: props.isDisabled ? 'tertiary' : 'secondary',
298
+ children: project.key
299
+ })]
300
+ }), jsxRuntime.jsx(ProjectStampsList, {
301
+ isProductionProject: project.isProductionProject,
302
+ suspension: project.suspension,
303
+ expiry: project.expiry
304
+ })]
305
+ })
306
+ }));
307
+ };
308
+ const mapProjectsToOptions = memoize__default["default"](projects => {
309
+ return [{
310
+ label: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$8({}, messages.projectsLabel)),
311
+ options: _mapInstanceProperty__default["default"](projects).call(projects, project => ({
312
+ key: project.key,
313
+ name: project.name,
314
+ label: project.name,
315
+ value: project.key,
316
+ suspension: project.suspension,
317
+ expiry: project.expiry,
318
+ isProductionProject: project.isProductionProject
319
+ }))
320
+ }];
321
+ });
322
+ const CustomMenuList = props => {
323
+ return jsxRuntime.jsx("div", {
324
+ children: jsxRuntime.jsx(reactSelect.components.MenuList, _objectSpread$8(_objectSpread$8({}, props), {}, {
325
+ children: props.children
326
+ }))
327
+ });
328
+ };
329
+ const Control = props => jsxRuntime.jsx(reactSelect.components.Control, _objectSpread$8(_objectSpread$8({}, props), {}, {
330
+ css: /*#__PURE__*/react$1.css("min-width:", designSystem.designTokens.constraint3, ";" + ("" ), "" ),
331
+ children: props.children
332
+ }));
333
+ const redirectTo = targetUrl => location.location.replace(targetUrl);
334
+ const ProjectSwitcher = props => {
335
+ const intl = reactIntl.useIntl();
336
+ const _useMcQuery = applicationShellConnectors.useMcQuery(ProjectsQuery, {
337
+ onError: sentry.reportErrorToSentry,
338
+ context: {
339
+ target: constants.GRAPHQL_TARGETS.MERCHANT_CENTER_BACKEND
340
+ }
341
+ }),
342
+ loading = _useMcQuery.loading,
343
+ data = _useMcQuery.data;
344
+ if (loading) return null;
345
+ return jsxRuntime.jsxs("div", {
346
+ children: [jsxRuntime.jsx(AccessibleHidden__default["default"], {
347
+ children: jsxRuntime.jsx("span", {
348
+ id: PROJECT_SWITCHER_LABEL_ID,
349
+ children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$8({}, messages.projectsLabel))
350
+ })
351
+ }), jsxRuntime.jsx(SelectInput__default["default"], {
352
+ value: props.projectKey || '',
353
+ name: "project-switcher",
354
+ "aria-labelledby": PROJECT_SWITCHER_LABEL_ID,
355
+ onChange: event => {
356
+ const selectedProjectKey = event.target.value;
357
+ if (selectedProjectKey !== props.projectKey) {
358
+ if (window.app.__DEVELOPMENT__?.oidc?.authorizeUrl) {
359
+ applicationShellConnectors.oidcStorage.setActiveProjectKey(selectedProjectKey);
360
+ }
361
+
362
+ // We simply redirect to a "new" browser page, instead of using the
363
+ // history router. This will simplify a lot of things and avoid possible
364
+ // problems like e.g. resetting the store/state.
365
+ redirectTo(`/${selectedProjectKey}`);
366
+ }
367
+ },
368
+ options: data && data.user && mapProjectsToOptions(data.user.projects.results) || [],
369
+ isOptionDisabled: option => {
370
+ const project = option;
371
+ return project.suspension.isActive || project.expiry.isActive;
372
+ },
373
+ components: {
374
+ Option: ProjectSwitcherOption,
375
+ ValueContainer,
376
+ MenuList: CustomMenuList,
377
+ Control
378
+ },
379
+ isClearable: false,
380
+ backspaceRemovesValue: false,
381
+ placeholder: intl.formatMessage(messages.searchPlaceholder),
382
+ noOptionsMessage: () => intl.formatMessage(messages.noResults),
383
+ horizontalConstraint: 'auto',
384
+ appearance: "quiet",
385
+ maxMenuHeight: 380,
386
+ maxMenuWidth: 8,
387
+ minMenuWidth: 8
388
+ })]
389
+ });
390
+ };
391
+ ProjectSwitcher.displayName = 'ProjectSwitcher';
392
+
393
+ // eslint-disable-next-line import/prefer-default-export
394
+ const REQUESTS_IN_FLIGHT_LOADER_DOM_ID = 'loader-for-requests-in-flight';
395
+
396
+ const UserSettingsMenu = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./user-settings-menu-ead5fed2.cjs.prod.js' /* webpackChunkName: "user-settings-menu" */); }));
397
+
398
+ var _ref$1 = {
399
+ name: "zjik7",
400
+ styles: "display:flex"
401
+ } ;
402
+ var _ref2$1 = {
403
+ name: "36bnqj",
404
+ styles: "display:flex;flex:1"
405
+ } ;
406
+ var _ref3$1 = {
407
+ name: "w3f7al",
408
+ styles: "height:22px"
409
+ } ;
410
+ const AppBar = props => {
411
+ const previousProjectKey = getPreviousProjectKey(props.user?.defaultProjectKey ?? undefined);
412
+ return jsxRuntime.jsxs("div", {
413
+ css: /*#__PURE__*/react$1.css("background-color:", designSystem.designTokens.colorSurface, ";box-shadow:0px 2px 5px 0px rgba(0, 0, 0, 0.15);padding:0 40px;min-height:", oidc.DIMENSIONS.header, ";position:relative;width:100%;z-index:20000;display:flex;align-items:center;justify-content:space-between;" + ("" ), "" ),
414
+ "data-test": "top-navigation",
415
+ children: [jsxRuntime.jsx("div", {
416
+ css: /*#__PURE__*/react$1.css("float:right;font-weight:normal;font-size:1rem;margin-right:", designSystem.designTokens.spacing55, ";display:flex;align-items:center;" + ("" ), "" ),
417
+ children: jsxRuntime.jsxs(Spacings__default["default"].Inline, {
418
+ scale: "m",
419
+ alignItems: "center",
420
+ children: [jsxRuntime.jsxs("div", {
421
+ css: /*#__PURE__*/react$1.css("display:flex;gap:", designSystem.designTokens.spacing30, ";align-items:center;" + ("" ), "" ),
422
+ children: [(() => {
423
+ if (!props.user) {
424
+ return jsxRuntime.jsx(LoadingPlaceholder, {
425
+ shape: "rect",
426
+ size: "s"
427
+ });
428
+ }
429
+ // The `<ProjectSwitcher>` should be rendered only if the
430
+ // user is fetched and the user has projects while the app runs in an project context.
431
+ if (props.user.projects.total > 0 && props.projectKeyFromUrl) {
432
+ var _context;
433
+ const selectedProject = _findInstanceProperty__default["default"](_context = props.user.projects.results).call(_context, project => project.key === props.projectKeyFromUrl);
434
+ return jsxRuntime.jsxs("div", {
435
+ css: /*#__PURE__*/react$1.css("display:flex;gap:", designSystem.designTokens.spacing20, ";align-items:center;" + ("" ), "" ),
436
+ children: [selectedProject?.isProductionProject && jsxRuntime.jsx("div", {
437
+ css: _ref3$1,
438
+ children: jsxRuntime.jsx(applicationComponents.ProjectStamp.IsProduction, {})
439
+ }), jsxRuntime.jsx(ProjectSwitcher
440
+ // In this case it's not necessary to check if the `projectKey` param
441
+ // is included in the list of projects. In such case
442
+ // the dropdown will still be rendered but no project will be selected.
443
+ // This is fine becase the user has still the possibility to "switch"
444
+ // to a project.
445
+ , {
446
+ projectKey: props.projectKeyFromUrl || previousProjectKey
447
+ })]
448
+ });
449
+ }
450
+ if (!props.user.defaultProjectKey) return null;
451
+ return jsxRuntime.jsx(BackToProject, {
452
+ projectKey: previousProjectKey
453
+ });
454
+ })(), jsxRuntime.jsx("div", {
455
+ id: oidc.CONTAINERS.LOCALE_SWITCHER
456
+ })]
457
+ }), jsxRuntime.jsx(Spacings__default["default"].Inline, {
458
+ children: jsxRuntime.jsx("div", {
459
+ id: REQUESTS_IN_FLIGHT_LOADER_DOM_ID,
460
+ css: _ref2$1
461
+ })
462
+ })]
463
+ })
464
+ }), jsxRuntime.jsxs("div", {
465
+ css: _ref$1,
466
+ children: [jsxRuntime.jsx("div", {
467
+ id: oidc.CONTAINERS.LEFT_OF_PROFILE
468
+ }), props.user ? jsxRuntime.jsx(UserSettingsMenu, {
469
+ language: props.user.language,
470
+ firstName: props.user.firstName,
471
+ lastName: props.user.lastName,
472
+ gravatarHash: props.user.gravatarHash,
473
+ email: props.user.email
474
+ }) : jsxRuntime.jsx(LoadingPlaceholder, {
475
+ shape: "dot",
476
+ size: "l"
477
+ })]
478
+ })]
479
+ });
480
+ };
481
+ AppBar.displayName = 'AppBar';
482
+
483
+ const ApplicationLoader = props => jsxRuntime.jsxs("div", {
484
+ css: /*#__PURE__*/react$1.css("display:flex;align-items:center;justify-content:center;flex:1;flex-direction:column;height:100vh;padding:", designSystem.customProperties.spacingL, ";>*+*{margin:", designSystem.customProperties.spacingL, " 0 0;}" + ("" ), "" ),
485
+ "data-testid": "application-loader",
486
+ children: [jsxRuntime.jsx(LoadingSpinner__default["default"], {}), props.showLogo === true ? jsxRuntime.jsx("img", {
487
+ alt: "commercetools logo",
488
+ src: CTLogoSVG__default["default"]
489
+ }) : null]
490
+ });
491
+ ApplicationLoader.displayName = 'ApplicationLoader';
492
+
493
+ const getBrowserHistory = () => history__default["default"];
494
+ const getBrowserLocale = win => {
495
+ const browserLocale = win && win.navigator && win.navigator.language;
496
+ return l10n.getSupportedLocale(browserLocale);
497
+ };
498
+
499
+ const hideAppLoader = () => {
500
+ /**
501
+ * NOTE:
502
+ * This function is defined in the `index.html` in a script-tag
503
+ * by the `html-template.js` in the `mc-scripts`. There are
504
+ * alternative ways of acheiving this namely:
505
+ * 1. Using custom events and dispatching here
506
+ * - Not supported in IE11 and would need a polyfill
507
+ * 2. Removing the DOM node here
508
+ * - Both `index.html` and this component would have to
509
+ * now the div's id/class. If one would change the index.html
510
+ * the app would never show (always show the loading screen)
511
+ */
512
+ if (window.onAppLoaded) window.onAppLoaded();
513
+ };
514
+ const ConfigureIntlProvider = props => {
515
+ react.useEffect(() => {
516
+ if (props.locale) {
517
+ hideAppLoader();
518
+ }
519
+ }, [props.locale]);
520
+ if (!props.locale) {
521
+ return null;
522
+ }
523
+ return jsxRuntime.jsx(reactIntl.IntlProvider, {
524
+ locale: props.locale,
525
+ messages: props.messages,
526
+ children: props.children
527
+ });
528
+ };
529
+ ConfigureIntlProvider.propTypes = {};
530
+ ConfigureIntlProvider.displayName = 'ConfigureIntlProvider';
531
+
532
+ const ErrorApologizer = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./error-apologizer-84dc825c.cjs.prod.js' /* webpackChunkName: "error-apologizer" */); }));
533
+
534
+ var ProjectQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchProject" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "projectKey" } }, type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "project" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "key" }, value: { kind: "Variable", name: { kind: "Name", value: "projectKey" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "version" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "countries" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "currencies" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "languages" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "initialized" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "expiry" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "isActive" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "daysLeft" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "suspension" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "isActive" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "reason" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "isProductionProject" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "allAppliedPermissions" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "allAppliedActionRights" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "group" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "allAppliedDataFences" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "StoreDataFence" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "type" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "group" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "__typename" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "allPermissionsForAllApplications" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "allAppliedPermissions" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "allAppliedActionRights" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "group" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "allAppliedMenuVisibilities" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "allAppliedDataFences" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "StoreDataFence" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "type" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "group" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "__typename" }, arguments: [], directives: [] }] } }] } }] } }, { kind: "Field", name: { kind: "Name", value: "owner" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "sampleDataImportDataset" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "isUserAdminOfCurrentProject" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 1081, source: { body: "query FetchProject($projectKey: String) {\n project(key: $projectKey) {\n key\n version\n name\n countries\n currencies\n languages\n initialized\n expiry {\n isActive\n daysLeft\n }\n suspension {\n isActive\n reason\n }\n isProductionProject\n allAppliedPermissions {\n name\n value\n }\n allAppliedActionRights {\n group\n name\n value\n }\n allAppliedDataFences {\n ... on StoreDataFence {\n type\n name\n value\n group\n __typename\n }\n }\n allPermissionsForAllApplications {\n allAppliedPermissions {\n name\n value\n }\n allAppliedActionRights {\n group\n name\n value\n }\n allAppliedMenuVisibilities {\n name\n value\n }\n allAppliedDataFences {\n ... on StoreDataFence {\n type\n name\n value\n group\n __typename\n }\n }\n }\n owner {\n id\n name\n }\n sampleDataImportDataset\n isUserAdminOfCurrentProject\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
535
+ const FetchProject = props => {
536
+ const _useMcQuery = applicationShellConnectors.useMcQuery(ProjectQuery, {
537
+ onError: sentry.reportErrorToSentry,
538
+ variables: {
539
+ projectKey: props.projectKey
540
+ },
541
+ context: {
542
+ target: constants.GRAPHQL_TARGETS.MERCHANT_CENTER_BACKEND
543
+ },
544
+ skip: props.skip === true
545
+ }),
546
+ loading = _useMcQuery.loading,
547
+ data = _useMcQuery.data,
548
+ error = _useMcQuery.error;
549
+ return jsxRuntime.jsx(jsxRuntime.Fragment, {
550
+ children: props.children({
551
+ isLoading: loading,
552
+ error,
553
+ project: data && data.project
554
+ })
555
+ });
556
+ };
557
+ FetchProject.propTypes = {
558
+ projectKey: _pt__default["default"].string,
559
+ skip: _pt__default["default"].bool,
560
+ children: _pt__default["default"].func.isRequired
561
+ };
562
+ FetchProject.displayName = 'FetchProject';
563
+
564
+ var LoggedInUserQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchLoggedInUser" }, variableDefinitions: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", alias: { kind: "Name", value: "user" }, name: { kind: "Name", value: "me" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "email" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "createdAt" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "gravatarHash" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "firstName" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lastName" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "language" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "numberFormat" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "timeZone" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "launchdarklyTrackingId" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "launchdarklyTrackingGroup" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "launchdarklyTrackingSubgroup" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "launchdarklyTrackingTeam" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "launchdarklyTrackingCloudEnvironment" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "defaultProjectKey" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "businessRole" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "projects" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "suspension" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "isActive" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "expiry" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "isActive" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "isProductionProject" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "idTokenUserInfo" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "iss" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "sub" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "aud" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "exp" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "iat" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "email" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "additionalClaims" }, arguments: [], directives: [] }] } }] } }] } }], loc: { start: 0, end: 692, source: { body: "query FetchLoggedInUser {\n user: me {\n id\n email\n createdAt\n gravatarHash\n firstName\n lastName\n language\n numberFormat\n timeZone\n launchdarklyTrackingId\n launchdarklyTrackingGroup\n launchdarklyTrackingSubgroup\n launchdarklyTrackingTeam\n launchdarklyTrackingCloudEnvironment\n defaultProjectKey\n businessRole\n projects {\n total\n results {\n name\n key\n suspension {\n isActive\n }\n expiry {\n isActive\n }\n isProductionProject\n }\n }\n idTokenUserInfo {\n iss\n sub\n aud\n exp\n iat\n email\n name\n additionalClaims\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
565
+ const FetchUser = props => {
566
+ const _useMcQuery = applicationShellConnectors.useMcQuery(LoggedInUserQuery, {
567
+ onError: sentry.reportErrorToSentry,
568
+ context: {
569
+ target: constants.GRAPHQL_TARGETS.MERCHANT_CENTER_BACKEND
570
+ }
571
+ }),
572
+ loading = _useMcQuery.loading,
573
+ data = _useMcQuery.data,
574
+ error = _useMcQuery.error;
575
+ return jsxRuntime.jsx(jsxRuntime.Fragment, {
576
+ children: props.children({
577
+ isLoading: loading,
578
+ user: data && data.user,
579
+ error
580
+ })
581
+ });
582
+ };
583
+ FetchUser.propTypes = {
584
+ children: _pt__default["default"].func.isRequired
585
+ };
586
+ FetchUser.displayName = 'FetchUser';
587
+
588
+ const Navbar = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./navbar-1465f182.cjs.prod.js' /* webpackChunkName: "navbar" */); }));
589
+
590
+ const ProjectContainer = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./project-container-55778868.cjs.prod.js' /* webpackChunkName: "project-container" */); }));
591
+
592
+ const getSelectedDataLocaleForProject = projectLocales => {
593
+ const cachedDataLocale = window.localStorage.getItem(constants.STORAGE_KEYS.SELECTED_DATA_LOCALE);
594
+ // Make sure the cached locale is listed in the selected project
595
+ const isCachedDataLocaleIncludedInProjectLanguages = _includesInstanceProperty__default["default"](projectLocales).call(projectLocales, cachedDataLocale || '');
596
+ if (cachedDataLocale && isCachedDataLocaleIncludedInProjectLanguages) return cachedDataLocale;
597
+ // Pick the first locale from the list
598
+ const defaultDataLocaleForProject = projectLocales[0];
599
+ // Cache it
600
+ window.localStorage.setItem(constants.STORAGE_KEYS.SELECTED_DATA_LOCALE, defaultDataLocaleForProject);
601
+ return defaultDataLocaleForProject;
602
+ };
603
+ const ProjectDataLocale = props => {
604
+ const _useState = react.useState(getSelectedDataLocaleForProject(props.locales)),
605
+ _useState2 = _slicedToArray(_useState, 2),
606
+ locale = _useState2[0],
607
+ setLocale = _useState2[1];
608
+ const handleSetProjectDataLocale = react.useCallback(locale => {
609
+ setLocale(locale);
610
+ // Cache it
611
+ window.localStorage.setItem(constants.STORAGE_KEYS.SELECTED_DATA_LOCALE, locale);
612
+ }, []);
613
+ return jsxRuntime.jsx(jsxRuntime.Fragment, {
614
+ children: props.children({
615
+ locale,
616
+ setProjectDataLocale: handleSetProjectDataLocale
617
+ })
618
+ });
619
+ };
620
+ ProjectDataLocale.propTypes = {
621
+ locales: _pt__default["default"].arrayOf(_pt__default["default"].string).isRequired,
622
+ children: _pt__default["default"].func.isRequired
623
+ };
624
+ ProjectDataLocale.displayName = 'ProjectDataLocale';
625
+
626
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct__default["default"](Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
627
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function () { return !!t; })(); }
628
+ let ErrorBoundary = /*#__PURE__*/function (_Component) {
629
+ _inherits(ErrorBoundary, _Component);
630
+ var _super = _createSuper(ErrorBoundary);
631
+ function ErrorBoundary() {
632
+ var _this;
633
+ _classCallCheck(this, ErrorBoundary);
634
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
635
+ args[_key] = arguments[_key];
636
+ }
637
+ _this = _super.call(this, ...args);
638
+ _this.state = {
639
+ hasError: false
640
+ };
641
+ return _this;
642
+ }
643
+ _createClass(ErrorBoundary, [{
644
+ key: "componentDidUpdate",
645
+ value: function componentDidUpdate(prevProps) {
646
+ const hasRouteChanged = prevProps.pathname !== this.props.pathname;
647
+ this.setState(prevState => hasRouteChanged && prevState.hasError ? {
648
+ hasError: false
649
+ } : null);
650
+ }
651
+ }, {
652
+ key: "componentDidCatch",
653
+ value: function componentDidCatch(error, errorInfo) {
654
+ // Note: In development mode componentDidCatch is not based on try-catch
655
+ // to catch exceptions. Thus exceptions caught here will also be caught in
656
+ // the global `error` event listener (setup-global-error-listener.js).
657
+ // see: https://github.com/facebook/react/issues/10474
658
+ sentry.reportErrorToSentry(error, {
659
+ extra: errorInfo
660
+ });
661
+ }
662
+ }, {
663
+ key: "render",
664
+ value: function render() {
665
+ if (this.state.hasError) {
666
+ return jsxRuntime.jsx(ErrorApologizer, {});
667
+ }
668
+ return jsxRuntime.jsx(jsxRuntime.Fragment, {
669
+ children: this.props.children
670
+ });
671
+ }
672
+ }], [{
673
+ key: "getDerivedStateFromError",
674
+ value: function getDerivedStateFromError( /* error */
675
+ ) {
676
+ // Update state so the next render will show the fallback UI.
677
+ return {
678
+ hasError: true
679
+ };
680
+ }
681
+ }]);
682
+ return ErrorBoundary;
683
+ }(react.Component);
684
+ ErrorBoundary.propTypes = {};
685
+
686
+ const ButlerContainer = /*#__PURE__*/_styled__default["default"]("div", {
687
+ target: "e1fuwyk10"
688
+ } )({
689
+ name: "xvk698",
690
+ styles: "position:absolute;left:0;bottom:0;top:0;right:0;background-color:rgba(0, 0, 0, 0.35);z-index:20001"
691
+ } );
692
+
693
+ var pimIndexerStates = {
694
+ // we did not check yet
695
+ UNCHECKED: 'UNCHECKED',
696
+ // the project is indexed by pim-indexer
697
+ INDEXED: 'INDEXED',
698
+ // the project is not indexed by pim-indexer
699
+ NOT_INDEXED: 'NOT_INDEXED'
700
+ };
701
+
702
+ const QuickAccess = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./quick-access-5ffe0e5c.cjs.prod.js' /* webpackChunkName: "quick-access" */); }));
703
+ const QuickAccessTrigger = props => {
704
+ const _useState = react.useState(false),
705
+ _useState2 = _slicedToArray(_useState, 2),
706
+ isVisible = _useState2[0],
707
+ setIsVisible = _useState2[1];
708
+ const open = react.useCallback(() => {
709
+ setIsVisible(true);
710
+ }, []);
711
+ const close = react.useCallback(() => {
712
+ setIsVisible(false);
713
+ }, []);
714
+ // We store the information of whether a project is indexed by pim-indexer,
715
+ // to avoid having to refetch that information every time Quick Access is
716
+ // opened. We can't move the information to the quick-access.js component
717
+ // as that component unmounts and would lose its state.
718
+ //
719
+ // We need to know whether a project is indexed by pim-indexer to know
720
+ // whether we should query pim-search or whether we can skip that request.
721
+ //
722
+ // We don't need to update this information when the project key changes,
723
+ // as changing a project always results in a full page reload anyways.
724
+ const _useState3 = react.useState(pimIndexerStates.UNCHECKED),
725
+ _useState4 = _slicedToArray(_useState3, 2),
726
+ pimIndexerState = _useState4[0],
727
+ setPimIndexerState = _useState4[1];
728
+ const handlePimIndexerStateChange = react.useCallback(nextPimIndexerState => {
729
+ setPimIndexerState(nextPimIndexerState);
730
+ }, []);
731
+ const keyHandler = react.useCallback(event => {
732
+ const hotKey = 'f';
733
+ // avoid interfering with any key combinations using modifier keys
734
+ if (event.ctrlKey || event.altKey || event.shiftKey || event.metaKey) return;
735
+
736
+ // Let users close QuickAccess by pressing Escape
737
+ if (event.key === 'Escape' && event.target.id === 'quick-access-search-input') {
738
+ close();
739
+ return;
740
+ }
741
+
742
+ // Avoid interfering with any other elements. We only
743
+ // open the QuickAccess when nothing was focused, so target is document.body
744
+ if (event.target !== document.body &&
745
+ // tabIndex="-1" has a special meaning
746
+ // It will make the element focusable, while hiding it from the
747
+ // navigation. It is typically used for modals and overlays.
748
+ // react-modal uses it for example. We want to treat those elements
749
+ // similar to document.body.
750
+ // See https://stackoverflow.com/a/32912224
751
+ event.target.getAttribute('tabindex') !== '-1' &&
752
+ // Do not prevent Quick Access from opening when a link has focus
753
+ event.target.nodeName !== 'A') return;
754
+ if (event.key === hotKey) {
755
+ if (!isVisible) {
756
+ // prevent the letter from appearing in the search input when
757
+ // it is the key press that lead to opening Quick Access
758
+ event.preventDefault();
759
+ }
760
+ open();
761
+ }
762
+ return;
763
+ }, [close, isVisible, open]);
764
+ react.useEffect(() => {
765
+ document.addEventListener('keydown', keyHandler);
766
+ return () => {
767
+ document.removeEventListener('keydown', keyHandler);
768
+ };
769
+ }, [keyHandler]);
770
+ if (!isVisible) return null;
771
+ return jsxRuntime.jsx(ErrorBoundary, {
772
+ children: jsxRuntime.jsx(react.Suspense, {
773
+ fallback: jsxRuntime.jsx(ButlerContainer, {
774
+ tabIndex: -1
775
+ }),
776
+ children: jsxRuntime.jsx(QuickAccess, {
777
+ pimIndexerState: pimIndexerState,
778
+ onPimIndexerStateChange: handlePimIndexerStateChange,
779
+ onClose: close,
780
+ onChangeProjectDataLocale: props.onChangeProjectDataLocale
781
+ })
782
+ })
783
+ });
784
+ };
785
+ QuickAccessTrigger.propTypes = {};
786
+ QuickAccessTrigger.displayName = 'QuickAccessTrigger';
787
+
788
+ const RedirectToLogout = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./redirect-to-logout-263d0e66.cjs.prod.js' /* webpackChunkName: "redirect-to-logout" */); }));
789
+
790
+ const RedirectToProjectCreate = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./redirect-to-project-create-e4ff7797.cjs.prod.js' /* webpackChunkName: "redirect-to-project-create" */); }));
791
+
792
+ function ownKeys$7(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
793
+ function _objectSpread$7(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$7(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$7(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
794
+ var AllFeaturesQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "AllFeatures" }, variableDefinitions: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "allFeatures" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "reason" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 72, source: { body: "query AllFeatures {\n allFeatures {\n name\n value\n reason\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
795
+ // This value is hard-coded here because we want to make sure that the
796
+ // app uses our account of LD. The value is meant to be public, so there
797
+ // is no need to be concerned about security.
798
+ const ldClientSideIdProduction = '5979d95f6040390cd07b5e01';
799
+ function getUserContextForLaunchDarklyAdapter(user, projectKey) {
800
+ return {
801
+ kind: 'user',
802
+ key: user?.id,
803
+ project: projectKey ?? '',
804
+ id: user?.launchdarklyTrackingId ?? '',
805
+ team: user?.launchdarklyTrackingTeam ?? [],
806
+ group: user?.launchdarklyTrackingGroup ?? '',
807
+ subgroup: user?.launchdarklyTrackingSubgroup ?? '',
808
+ cloudEnvironment: user?.launchdarklyTrackingCloudEnvironment ?? ''
809
+ };
810
+ }
811
+ const parseFlags = fetchedFlags => {
812
+ var _context;
813
+ return _Object$fromEntries__default["default"](_mapInstanceProperty__default["default"](_context = fetchedFlags.allFeatures).call(_context, fetchedFlag => [fetchedFlag.name, {
814
+ value: fetchedFlag.value,
815
+ reason: fetchedFlag.reason
816
+ }]));
817
+ };
818
+ const getCacheMode = adapterIdentifier => {
819
+ if (
820
+ // @ts-ignore
821
+ typeof window.Cypress !== 'undefined' || adapterIdentifier === types.adapterIdentifiers.http) {
822
+ // Temporary workaround: when running in Cypress, do not use lazy mode
823
+ // as the flag is not being updated in time during the test run.
824
+ return types.cacheModes.eager;
825
+ }
826
+ return types.cacheModes.lazy;
827
+ };
828
+ const SetupFlopFlipProvider = props => {
829
+ const apolloClient = react$2.useApolloClient();
830
+ const enableLongLivedFeatureFlags = applicationShellConnectors.useApplicationContext(context => context.environment.enableLongLivedFeatureFlags);
831
+ const flags = react.useMemo(() => _objectSpread$7(_objectSpread$7({}, constants.featureFlags.FLAGS), _flagsInstanceProperty__default["default"](props)), [_flagsInstanceProperty__default["default"](props)]);
832
+ react.useMemo(() => {
833
+ if (enableLongLivedFeatureFlags) {
834
+ combineAdapters__default["default"].combine([ldAdapter__default["default"], httpAdapter__default["default"]]);
835
+ } else {
836
+ combineAdapters__default["default"].combine([ldAdapter__default["default"]]);
837
+ }
838
+ }, [enableLongLivedFeatureFlags]);
839
+ const defaultFlags = react.useMemo(() => _objectSpread$7(_objectSpread$7({}, constants.featureFlags.DEFAULT_FLAGS), props.defaultFlags), [props.defaultFlags]);
840
+ const adapterArgs = react.useMemo(() => ({
841
+ user: {
842
+ key: props.user?.id
843
+ },
844
+ launchdarkly: {
845
+ cacheIdentifier: types.cacheIdentifiers.local,
846
+ cacheMode: getCacheMode(types.adapterIdentifiers.launchdarkly),
847
+ sdk: {
848
+ // Allow to overwrite the client ID, passed via the `additionalEnv` properties
849
+ // of the application config.
850
+ // This is mostly useful for internal usage on our staging environments.
851
+ clientSideId: props.ldClientSideId ?? ldClientSideIdProduction,
852
+ clientOptions: {
853
+ sendEventsOnlyForVariation: true
854
+ }
855
+ },
856
+ flags,
857
+ context: getUserContextForLaunchDarklyAdapter(props.user, props.projectKey)
858
+ },
859
+ http: {
860
+ // polling interval set to 15 minutes
861
+ pollingIntervalMs: 1000 * 60 * 15,
862
+ cacheIdentifier: types.cacheIdentifiers.local,
863
+ cacheMode: getCacheMode(types.adapterIdentifiers.http),
864
+ user: {
865
+ key: props.user?.id
866
+ },
867
+ execute: async adapterArgs => {
868
+ const response = await apolloClient.query({
869
+ query: AllFeaturesQuery,
870
+ errorPolicy: 'ignore',
871
+ fetchPolicy: 'network-only',
872
+ context: {
873
+ target: constants.GRAPHQL_TARGETS.MERCHANT_CENTER_BACKEND,
874
+ projectKey: adapterArgs.user?.project
875
+ }
876
+ });
877
+ return parseFlags(response.data);
878
+ }
879
+ }
880
+ }), [apolloClient, flags, props.ldClientSideId, props.projectKey, props.user]);
881
+ return jsxRuntime.jsx(reactBroadcast.ConfigureFlopFlip, {
882
+ adapter: combineAdapters__default["default"],
883
+ adapterArgs: adapterArgs,
884
+ defaultFlags: defaultFlags,
885
+ shouldDeferAdapterConfiguration: typeof props.shouldDeferAdapterConfiguration === 'boolean' ? props.shouldDeferAdapterConfiguration : !props.user,
886
+ children: props.children
887
+ });
888
+ };
889
+ SetupFlopFlipProvider.propTypes = {};
890
+ SetupFlopFlipProvider.displayName = 'SetupFlopFlipProvider';
891
+
892
+ const ThemeSwitcher = () => {
893
+ const theme = 'default';
894
+ return jsxRuntime.jsx(jsxRuntime.Fragment, {
895
+ children: jsxRuntime.jsx(designSystem.ThemeProvider, {
896
+ theme: theme,
897
+ themeOverrides: applicationComponents.themesOverrides[theme]
898
+ })
899
+ });
900
+ };
901
+
902
+ function ownKeys$6(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
903
+ function _objectSpread$6(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$6(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$6(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
904
+ const getHasUnauthorizedError = graphQLErrors => _findInstanceProperty__default["default"](graphQLErrors).call(graphQLErrors, gqlError => gqlError.extensions && gqlError.extensions.code && gqlError.extensions.code === 'UNAUTHENTICATED');
905
+ const getHasUserBeenDeletedError = graphQLErrors => _findInstanceProperty__default["default"](graphQLErrors).call(graphQLErrors, gqlError => {
906
+ var _context;
907
+ return gqlError.message &&
908
+ // NOTE: The CTP API does not provide an error code in this case.
909
+ _includesInstanceProperty__default["default"](_context = gqlError.message).call(_context, 'was not found.');
910
+ });
911
+ const MainContainer = /*#__PURE__*/_styled__default["default"]("main", {
912
+ target: "esrtekc0"
913
+ } )({
914
+ name: "evthls",
915
+ styles: "grid-column:2/3;grid-row:3/4;min-width:0;overflow-x:hidden;overflow-y:scroll;display:flex;flex-direction:column;position:relative"
916
+ } );
917
+
918
+ /**
919
+ * This component is rendered whenever the user is considered "authenticated"
920
+ * and contains the "restricted" application part.
921
+ */
922
+ var _ref = {
923
+ name: "tlwzvn",
924
+ styles: "flex-grow:1;display:flex;flex-direction:column;position:relative;>*:not(:first-of-type){flex-grow:1;display:flex;flex-direction:column;}"
925
+ } ;
926
+ var _ref2 = {
927
+ name: "lzrvov",
928
+ styles: "grid-column:1/2;grid-row:2/4;overflow:hidden"
929
+ } ;
930
+ var _ref3 = {
931
+ name: "tjbz3t",
932
+ styles: "grid-row:'2/3';grid-column:'2/3'"
933
+ } ;
934
+ var _ref4 = {
935
+ name: "8bdwu0",
936
+ styles: "grid-row:1;grid-column:1/3"
937
+ } ;
938
+ const ApplicationShellAuthenticated = props => {
939
+ const applicationEnvironment = applicationShellConnectors.useApplicationContext(context => context.environment);
940
+ // TODO: using this hook will subscribe the component to route updates.
941
+ // This is currently useful for detecting a change in the project key
942
+ // from URL ("/" --> "/:projectKey").
943
+ // However, every route change will trigger a re-render. This is probably
944
+ // ok-ish but we might want to look into a more performant solution.
945
+ const location = reactRouterDom.useLocation();
946
+ const notificationsGlobalRef = react.useRef(null);
947
+ const notificationsPageRef = react.useRef(null);
948
+ const layoutRefs = react.useRef({
949
+ notificationsGlobalRef,
950
+ notificationsPageRef
951
+ });
952
+ return jsxRuntime.jsx(FetchUser, {
953
+ children: _ref5 => {
954
+ let isLoadingUser = _ref5.isLoading,
955
+ user = _ref5.user,
956
+ error = _ref5.error;
957
+ if (error) {
958
+ // In case there is an unauthorized error, we redirect to the login page
959
+ if (error.graphQLErrors && _Array$isArray__default["default"](error.graphQLErrors)) {
960
+ const hasUnauthorizedError = getHasUnauthorizedError(error.graphQLErrors);
961
+ const hasUserBeenDeletedError = getHasUserBeenDeletedError(error.graphQLErrors);
962
+ if (hasUnauthorizedError || hasUserBeenDeletedError) {
963
+ let logoutReason;
964
+ if (hasUnauthorizedError) logoutReason = constants.LOGOUT_REASONS.UNAUTHORIZED;else if (hasUserBeenDeletedError) logoutReason = constants.LOGOUT_REASONS.DELETED;
965
+ return jsxRuntime.jsx(RedirectToLogout, {
966
+ reason: logoutReason
967
+ });
968
+ }
969
+ }
970
+ // Since we do not know the locale of the user, we pick it from the
971
+ // user's browser to attempt to match the language for the correct translations.
972
+ const userLocale = getBrowserLocale(window);
973
+ return jsxRuntime.jsx(i18n.AsyncLocaleData, {
974
+ locale: userLocale,
975
+ applicationMessages: props.applicationMessages,
976
+ children: _ref6 => {
977
+ let locale = _ref6.locale,
978
+ messages = _ref6.messages;
979
+ sentry.reportErrorToSentry(error, {});
980
+ return jsxRuntime.jsx(ConfigureIntlProvider, {
981
+ locale: locale,
982
+ messages: messages,
983
+ children: jsxRuntime.jsx(ErrorApologizer, {})
984
+ });
985
+ }
986
+ });
987
+ }
988
+ const projectKeyFromUrl = applicationShellConnectors.selectProjectKeyFromUrl(location.pathname);
989
+ return jsxRuntime.jsx(applicationShellConnectors.ApplicationContextProvider, {
990
+ user: user,
991
+ environment: applicationEnvironment,
992
+ children: jsxRuntime.jsx(i18n.AsyncLocaleData, {
993
+ locale: user?.language,
994
+ applicationMessages: props.applicationMessages,
995
+ children: _ref7 => {
996
+ let isLoadingLocaleData = _ref7.isLoading,
997
+ locale = _ref7.locale,
998
+ messages = _ref7.messages;
999
+ return jsxRuntime.jsx(ConfigureIntlProvider
1000
+ // We do not want to pass the language as long as the locale data
1001
+ // is not loaded.
1002
+ , _objectSpread$6(_objectSpread$6({}, isLoadingLocaleData ? {} : {
1003
+ locale,
1004
+ messages
1005
+ }), {}, {
1006
+ children: jsxRuntime.jsx(SetupFlopFlipProvider, {
1007
+ user: user,
1008
+ projectKey: projectKeyFromUrl,
1009
+ ldClientSideId: applicationEnvironment.ldClientSideId,
1010
+ flags: props.featureFlags,
1011
+ defaultFlags: props.defaultFeatureFlags,
1012
+ children: jsxRuntime.jsxs(jsxRuntime.Fragment, {
1013
+ children: [jsxRuntime.jsx(ThemeSwitcher, {}), jsxRuntime.jsx(RequestsInFlightLoader, {}), jsxRuntime.jsx(sentry.SentryUserTracker, {
1014
+ user: user ?? undefined
1015
+ }), jsxRuntime.jsxs("div", {
1016
+ css: /*#__PURE__*/react$1.css("height:100vh;display:grid;grid-template-rows:auto ", oidc.DIMENSIONS.header, " 1fr;grid-template-columns:min-content 1fr;" + ("" ), "" ),
1017
+ children: [jsxRuntime.jsxs("div", {
1018
+ ref: notificationsGlobalRef,
1019
+ role: "region",
1020
+ "aria-live": "polite",
1021
+ css: _ref4,
1022
+ children: [jsxRuntime.jsx("div", {
1023
+ id: "above-top-navigation"
1024
+ }), jsxRuntime.jsx(reactNotifications.NotificationsList, {
1025
+ domain: constants.DOMAINS.GLOBAL
1026
+ })]
1027
+ }), jsxRuntime.jsx(reactRouterDom.Route, {
1028
+ children: () => {
1029
+ if (!projectKeyFromUrl) return jsxRuntime.jsx(QuickAccessTrigger, {});
1030
+ return jsxRuntime.jsx(FetchProject, {
1031
+ projectKey: projectKeyFromUrl,
1032
+ children: _ref8 => {
1033
+ let isProjectLoading = _ref8.isLoading,
1034
+ project = _ref8.project;
1035
+ if (isProjectLoading || !project) return null;
1036
+
1037
+ // when used outside of a project context,
1038
+ // or when the project is expired or supsended
1039
+ const shouldUseProjectContext = !(project.suspension && project.suspension.isActive || project.expiry && project.expiry.isActive);
1040
+ if (!shouldUseProjectContext) return jsxRuntime.jsx(QuickAccessTrigger, {});
1041
+ return jsxRuntime.jsx(ProjectDataLocale, {
1042
+ locales: project.languages,
1043
+ children: _ref9 => {
1044
+ let dataLocale = _ref9.locale,
1045
+ setProjectDataLocale = _ref9.setProjectDataLocale;
1046
+ return jsxRuntime.jsx(applicationShellConnectors.ApplicationContextProvider, {
1047
+ user: user,
1048
+ project: project,
1049
+ projectDataLocale: dataLocale,
1050
+ environment: applicationEnvironment,
1051
+ children: jsxRuntime.jsx(QuickAccessTrigger, {
1052
+ onChangeProjectDataLocale: setProjectDataLocale
1053
+ })
1054
+ });
1055
+ }
1056
+ });
1057
+ }
1058
+ });
1059
+ }
1060
+ }), jsxRuntime.jsx("header", {
1061
+ css: _ref3,
1062
+ children: jsxRuntime.jsx(AppBar, {
1063
+ user: user,
1064
+ projectKeyFromUrl: projectKeyFromUrl
1065
+ })
1066
+ }), jsxRuntime.jsx("aside", {
1067
+ css: _ref2,
1068
+ children: (() => {
1069
+ // The <NavBar> should only be rendered within a project
1070
+ // context, therefore when there is a `projectKey`.
1071
+ // If there is no `projectKey` in the URL (e.g. `/account`
1072
+ // routes), we don't render it.
1073
+ // NOTE: we also "cache" the `projectKey` in localStorage
1074
+ // but this should only be used to "re-hydrate" the URL
1075
+ // location (e.g when you go to `/`, there should be a
1076
+ // redirect to `/:projectKey`). Therefore, we should not
1077
+ // rely on the value in localStorage to determine which
1078
+ // `projectKey` is currently used.
1079
+ if (!projectKeyFromUrl) return null;
1080
+ return jsxRuntime.jsx(FetchProject, {
1081
+ projectKey: projectKeyFromUrl,
1082
+ children: _ref10 => {
1083
+ let isLoadingProject = _ref10.isLoading,
1084
+ project = _ref10.project;
1085
+ const isLoading = isLoadingUser || isLoadingLocaleData || isLoadingProject || !locale || !project;
1086
+ return jsxRuntime.jsx(applicationShellConnectors.ApplicationContextProvider, {
1087
+ user: user,
1088
+ environment: applicationEnvironment
1089
+ // NOTE: do not pass the `project` into the application context.
1090
+ // The permissions for the Navbar are resolved separately, within
1091
+ // a different React context.
1092
+ ,
1093
+ children: jsxRuntime.jsx(Navbar, {
1094
+ applicationLocale: locale,
1095
+ projectKey: projectKeyFromUrl,
1096
+ project: project,
1097
+ environment: applicationEnvironment,
1098
+ onMenuItemClick: props.onMenuItemClick,
1099
+ isLoading: isLoading
1100
+ })
1101
+ });
1102
+ }
1103
+ });
1104
+ })()
1105
+ }), isLoadingUser || isLoadingLocaleData ? jsxRuntime.jsx(MainContainer, {
1106
+ role: "main",
1107
+ children: jsxRuntime.jsx(ApplicationLoader, {})
1108
+ }) : jsxRuntime.jsxs(MainContainer, {
1109
+ role: "main",
1110
+ children: [jsxRuntime.jsx("div", {
1111
+ ref: notificationsPageRef,
1112
+ children: jsxRuntime.jsx(reactNotifications.NotificationsList, {
1113
+ domain: constants.DOMAINS.PAGE
1114
+ })
1115
+ }), jsxRuntime.jsx(reactNotifications.NotificationsList, {
1116
+ domain: constants.DOMAINS.SIDE
1117
+ }), jsxRuntime.jsxs("div", {
1118
+ css: _ref,
1119
+ children: [jsxRuntime.jsx(applicationComponents.PortalsContainer
1120
+ // @ts-ignore
1121
+ , {
1122
+ ref: layoutRefs,
1123
+ offsetTop: oidc.DIMENSIONS.header,
1124
+ offsetLeft: projectKeyFromUrl ? oidc.NAVBAR.widthLeftNavigation : '0px',
1125
+ offsetLeftOnExpandedMenu: projectKeyFromUrl ? oidc.NAVBAR.widthLeftNavigationWhenExpanded : '0px'
1126
+ }), jsxRuntime.jsxs(reactRouterDom.Switch, {
1127
+ children: [jsxRuntime.jsx(reactRouterDom.Route, {
1128
+ path: "/profile",
1129
+ render: () => jsxRuntime.jsx(reactRouterDom.Redirect, {
1130
+ to: "/account/profile"
1131
+ })
1132
+ }), jsxRuntime.jsx(reactRouterDom.Route, {
1133
+ path: "/account",
1134
+ children:
1135
+ /**
1136
+ * In case the AppShell uses the `render` function, we assume it's one of two cases:
1137
+ * 1. The application does not use `children` and therefore implements the routes including
1138
+ * the <RouteCatchAll> (this is the "legacy" behavior).
1139
+ * 2. It's the account application, which always uses `render` and therefore should render as normal.
1140
+ *
1141
+ * In case the AppShell uses the `children` function, we can always assume that
1142
+ * it's a normal Custom Application and that it should trigger a force reload.
1143
+ */
1144
+ props.render ? jsxRuntime.jsx(jsxRuntime.Fragment, {
1145
+ children: props.render()
1146
+ }) : jsxRuntime.jsx(index.RouteCatchAll, {})
1147
+ }), jsxRuntime.jsx(reactRouterDom.Route, {
1148
+ exact: true,
1149
+ path: "/",
1150
+ children: (() => {
1151
+ const previousProjectKey = getPreviousProjectKey(user?.defaultProjectKey ?? undefined);
1152
+
1153
+ /**
1154
+ * NOTE:
1155
+ * Given the user has not been loaded a loading spinner is shown.
1156
+ * Given the user was not working on a project previously nor has a default
1157
+ * project, the user will be prompted to create one.
1158
+ * Given the user was working on a project previously or has a default
1159
+ * project, the application will redirect to that project.
1160
+ */
1161
+ if (!user) return jsxRuntime.jsx(ApplicationLoader, {});
1162
+ if (!previousProjectKey) return jsxRuntime.jsx(RedirectToProjectCreate, {});
1163
+ return jsxRuntime.jsx(reactRouterDom.Redirect, {
1164
+ to: `/${previousProjectKey}`
1165
+ });
1166
+ })()
1167
+ }), jsxRuntime.jsx(reactRouterDom.Route, {
1168
+ exact: false,
1169
+ path: "/:projectKey",
1170
+ children: jsxRuntime.jsx(ProjectContainer, {
1171
+ user: user,
1172
+ environment: applicationEnvironment,
1173
+ disableRoutePermissionCheck: props.disableRoutePermissionCheck
1174
+ // This effectively renders the
1175
+ // children, which is the application
1176
+ // specific part
1177
+ ,
1178
+ render: props.render,
1179
+ children: props.children
1180
+ })
1181
+ })]
1182
+ })]
1183
+ })]
1184
+ })]
1185
+ })]
1186
+ })
1187
+ })
1188
+ }));
1189
+ }
1190
+ })
1191
+ });
1192
+ }
1193
+ });
1194
+ };
1195
+ ApplicationShellAuthenticated.propTypes = {};
1196
+ ApplicationShellAuthenticated.displayName = 'ApplicationShellAuthenticated';
1197
+
1198
+ const maxTitleCharLength = 24;
1199
+ const staticPaths = ['account', 'login'];
1200
+ const defaultProps$1 = {
1201
+ additionalParts: []
1202
+ };
1203
+ const getPageTitle = (pathname, additionalParts) => {
1204
+ const _pathname$split = pathname.split('/'),
1205
+ _pathname$split2 = _slicedToArray(_pathname$split, 3),
1206
+ projectKeyOrStaticPath = _pathname$split2[1],
1207
+ entryPointUriPath = _pathname$split2[2];
1208
+ const customTitleParts = _mapInstanceProperty__default["default"](additionalParts).call(additionalParts, titlePart => {
1209
+ if (titlePart.length <= maxTitleCharLength) {
1210
+ return titlePart;
1211
+ }
1212
+ return [_sliceInstanceProperty__default["default"](titlePart).call(titlePart, 0, maxTitleCharLength / 2), _sliceInstanceProperty__default["default"](titlePart).call(titlePart, titlePart.length - maxTitleCharLength / 2)].join('...');
1213
+ });
1214
+ if (_includesInstanceProperty__default["default"](staticPaths).call(staticPaths, projectKeyOrStaticPath)) {
1215
+ return [...(customTitleParts || []), projectKeyOrStaticPath, 'Merchant Center'].join(' - ');
1216
+ }
1217
+ return [...(customTitleParts || []), entryPointUriPath, projectKeyOrStaticPath, 'Merchant Center'].join(' - ');
1218
+ };
1219
+ const ApplicationPageTitle = props => {
1220
+ const location = reactRouterDom.useLocation();
1221
+ react.useLayoutEffect(() => {
1222
+ const pageTitle = getPageTitle(location.pathname, props.additionalParts);
1223
+ document.title = pageTitle;
1224
+ }, [location.pathname, props.additionalParts]);
1225
+ return null;
1226
+ };
1227
+ ApplicationPageTitle.propTypes = {
1228
+ additionalParts: _pt__default["default"].arrayOf(_pt__default["default"].string).isRequired
1229
+ };
1230
+ ApplicationPageTitle.displayName = 'ApplicationPageTitle';
1231
+ ApplicationPageTitle.defaultProps = defaultProps$1;
1232
+
1233
+ function ownKeys$5(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
1234
+ function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$5(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$5(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
1235
+ const SuspendedRoute = props => jsxRuntime.jsx(reactRouterDom.Route, _objectSpread$5(_objectSpread$5({}, props), {}, {
1236
+ children: jsxRuntime.jsx(react.Suspense, {
1237
+ fallback: jsxRuntime.jsx(LoadingSpinner__default["default"], {}),
1238
+ children: props.children
1239
+ })
1240
+ }));
1241
+ SuspendedRoute.displayName = 'SuspendedRoute';
1242
+
1243
+ var AmILoggedInQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "AmILoggedIn" }, variableDefinitions: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "amILoggedIn" }, arguments: [], directives: [] }] } }], loc: { start: 0, end: 36, source: { body: "query AmILoggedIn {\n amILoggedIn\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
1244
+ const AmILoggedIn = props => {
1245
+ // ...otherwise, we ping a "secured" endpoint in the MC API to see if there is
1246
+ // a valid access token. If we get an error, we assume that the user is not
1247
+ // authenticated. If we don't get any error, the access token sent with the cookie
1248
+ // is valid. We return null while the query is loading.
1249
+ const _useMcQuery = applicationShellConnectors.useMcQuery(AmILoggedInQuery, {
1250
+ context: {
1251
+ target: constants.GRAPHQL_TARGETS.MERCHANT_CENTER_BACKEND,
1252
+ skipTokenRetry: true
1253
+ },
1254
+ // NOTE: With `no-cache` the `useQuery` will not trigger a
1255
+ // re-render of the `AmILoggedIn` component. Relying on a default
1256
+ // fetch policy results in rendering the component without refetching the data
1257
+ // which as a result unmounts child components (such as an application).
1258
+ //
1259
+ // For example:
1260
+ // Given the user not authenticated
1261
+ // Then the first pass of useQuery returns an exptected error
1262
+ // Given the query is triggered again (through `useQuery`)
1263
+ // Then the component will re-render
1264
+ // Resulting in inconsistent data with the error not being defined
1265
+ fetchPolicy: 'no-cache',
1266
+ onCompleted: data => {
1267
+ if (!data) {
1268
+ // In case the request is 200 but there is no data, we assume
1269
+ // there are some errors.
1270
+ window.localStorage.removeItem(constants.STORAGE_KEYS.IS_AUTHENTICATED);
1271
+ } else {
1272
+ // Even though the login page might set this flag, we just make sure that
1273
+ // we do it here as well. This will help in the future when we eventually
1274
+ // move the auth service to itw own domain, in which case the local storage
1275
+ // is not shared anymore.
1276
+ window.localStorage.setItem(constants.STORAGE_KEYS.IS_AUTHENTICATED, String(true));
1277
+ }
1278
+ },
1279
+ onError: () => {
1280
+ // The query fails without the `mcAccessToken`. In this case the caching
1281
+ // needs to be unset as otherwise the application will end up in a infinte
1282
+ // redirect loop.
1283
+ window.localStorage.removeItem(constants.STORAGE_KEYS.IS_AUTHENTICATED);
1284
+ }
1285
+ }),
1286
+ data = _useMcQuery.data,
1287
+ loading = _useMcQuery.loading,
1288
+ error = _useMcQuery.error;
1289
+ if (error) {
1290
+ // No matter what error, we consider it as a failed authentication
1291
+ return jsxRuntime.jsx(jsxRuntime.Fragment, {
1292
+ children: props.render({
1293
+ isAuthenticated: false
1294
+ })
1295
+ });
1296
+ }
1297
+ if (!loading && data && data.amILoggedIn) {
1298
+ return jsxRuntime.jsx(jsxRuntime.Fragment, {
1299
+ children: props.render({
1300
+ isAuthenticated: true
1301
+ })
1302
+ });
1303
+ }
1304
+ return null;
1305
+ };
1306
+ AmILoggedIn.displayName = 'AmILoggedIn';
1307
+
1308
+ const withoutProjectKeyClaim = scope => {
1309
+ var _context;
1310
+ return _filterInstanceProperty__default["default"](_context = scope.split(' ')).call(_context, claim => !_startsWithInstanceProperty__default["default"](claim).call(claim, oidc.OIDC_CLAIMS.PROJECT_KEY)).join(' ');
1311
+ };
1312
+ const hasCachedAuthenticationState = () => {
1313
+ if (window.app.__DEVELOPMENT__?.oidc?.authorizeUrl) {
1314
+ try {
1315
+ let activeProjectKey = applicationShellConnectors.oidcStorage.getActiveProjectKey();
1316
+ if (activeProjectKey) {
1317
+ // GIVEN The application is not requesting a project key,
1318
+ // THEN we assume that the application does not need a project context.
1319
+ // GIVEN The application is not requesting a project key,
1320
+ // THEN we remove the cached project key.
1321
+ // This is the case of an application like `account`.
1322
+ if (!window.app.__DEVELOPMENT__?.oidc?.initialProjectKey) {
1323
+ applicationShellConnectors.oidcStorage.removeActiveProjectKey();
1324
+ }
1325
+
1326
+ // If the project key we had in the storage does not match the one
1327
+ // we have in the development config, then we need to discard it and
1328
+ // use the one from the development config.
1329
+ if (window.app.__DEVELOPMENT__?.oidc?.initialProjectKey && window.app.__DEVELOPMENT__?.oidc?.initialProjectKey !== activeProjectKey) {
1330
+ activeProjectKey = window.app.__DEVELOPMENT__?.oidc?.initialProjectKey;
1331
+ applicationShellConnectors.oidcStorage.setActiveProjectKey(activeProjectKey);
1332
+ }
1333
+ } else {
1334
+ if (window.app.__DEVELOPMENT__?.oidc?.initialProjectKey) {
1335
+ // Here we store the initial project key in local storage,
1336
+ // so that it gets picked up when we initiate the login flow.
1337
+ applicationShellConnectors.oidcStorage.setActiveProjectKey(window.app.__DEVELOPMENT__?.oidc?.initialProjectKey);
1338
+ }
1339
+ }
1340
+
1341
+ // cachedScope is assumed to be the exact cached version of the `requestedScope`
1342
+ // if they don't match, then we know that one of the claims within the scope has changed
1343
+ // given a change, we need to force the user to log in, so that new values on respective claim
1344
+ // will apply for the given custom application
1345
+ const cachedScope = applicationShellConnectors.oidcStorage.getSessionScope();
1346
+ // Force the user to log in again
1347
+ if (!cachedScope) {
1348
+ return false;
1349
+ }
1350
+ // Rebuild the requested OIDC scope to verify that it didn't change.
1351
+ const requestedScope = oidc.buildOidcScope({
1352
+ projectKey: activeProjectKey ?? undefined,
1353
+ oAuthScopes: window.app.__DEVELOPMENT__?.oidc?.oAuthScopes,
1354
+ additionalOAuthScopes: window.app.__DEVELOPMENT__?.oidc?.additionalOAuthScopes,
1355
+ teamId: window.app.__DEVELOPMENT__?.oidc?.teamId,
1356
+ applicationId: window.app.__DEVELOPMENT__?.oidc?.applicationId
1357
+ });
1358
+ // Omit the project key from the check. This allows to switch projects
1359
+ // without having to log in again.
1360
+ const cachedScopeWithoutProjectKey = withoutProjectKeyClaim(cachedScope);
1361
+ const requestedScopeWithoutProjectKey = withoutProjectKeyClaim(requestedScope);
1362
+ // Check that the session scope didn't change.
1363
+ if (cachedScopeWithoutProjectKey === requestedScopeWithoutProjectKey) {
1364
+ return true;
1365
+ }
1366
+ return false;
1367
+ } catch (err) {
1368
+ return false;
1369
+ }
1370
+ }
1371
+ return window.localStorage.getItem(constants.STORAGE_KEYS.IS_AUTHENTICATED) === 'true';
1372
+ };
1373
+
1374
+ const OidcCallback = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./oidc-callback-76814954.cjs.prod.js' /* webpackChunkName: "oidc-callback" */); }));
1375
+
1376
+ function ownKeys$4(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
1377
+ function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$4(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$4(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
1378
+ const Authenticated = props => {
1379
+ // We attempt to see if the user was already authenticated by looking
1380
+ // at the "cached" flag in local storage.
1381
+ const cachedAuthenticationState = hasCachedAuthenticationState();
1382
+ if (cachedAuthenticationState) {
1383
+ return jsxRuntime.jsx(jsxRuntime.Fragment, {
1384
+ children: props.render({
1385
+ isAuthenticated: true
1386
+ })
1387
+ });
1388
+ }
1389
+
1390
+ // When using the OIDC workflow, we always return false, to trigger
1391
+ // the redirect to the login page.
1392
+ if (window.app.__DEVELOPMENT__?.oidc?.authorizeUrl) {
1393
+ return jsxRuntime.jsx(jsxRuntime.Fragment, {
1394
+ children: props.render({
1395
+ isAuthenticated: false
1396
+ })
1397
+ });
1398
+ }
1399
+
1400
+ // Fall back to check for cookie-based authentication.
1401
+ return jsxRuntime.jsx(AmILoggedIn, _objectSpread$4({}, props));
1402
+ };
1403
+ Authenticated.displayName = 'Authenticated';
1404
+ const AuthenticationRoutes = props => jsxRuntime.jsxs(reactRouterDom.Switch, {
1405
+ children: [jsxRuntime.jsx(SuspendedRoute, {
1406
+ path: `/account/oidc/callback`,
1407
+ children: jsxRuntime.jsx(OidcCallback, {
1408
+ locale: props.locale,
1409
+ applicationMessages: props.applicationMessages
1410
+ })
1411
+ }), jsxRuntime.jsx(SuspendedRoute, {
1412
+ path: `/:projectKey/:identifier/oidc/callback`,
1413
+ children: jsxRuntime.jsx(OidcCallback, {
1414
+ locale: props.locale,
1415
+ applicationMessages: props.applicationMessages
1416
+ })
1417
+ }), jsxRuntime.jsx(reactRouterDom.Route, {
1418
+ children: jsxRuntime.jsx(Authenticated, _objectSpread$4({}, props))
1419
+ })]
1420
+ });
1421
+ AuthenticationRoutes.displayName = 'AuthenticationRoutes';
1422
+
1423
+ function ownKeys$3(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
1424
+ function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$3(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$3(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
1425
+ /**
1426
+ * NOTE:
1427
+ * This function try-catches around a `JSON.parse` and return
1428
+ * the parsed value whenever possible.
1429
+ *
1430
+ * This allows parsing most primitive values.
1431
+ *
1432
+ * - `JSON.parse('null')` => `null`
1433
+ * - `JSON.parse('1')` => `1`
1434
+ * - `JSON.parse('["a", "b"]')` => `['a', 'b']`
1435
+ */
1436
+ const getCoerceEnvironmentValue = environmentValueAsString => {
1437
+ // Return the value as-is if it's not a string.
1438
+ if (typeof environmentValueAsString !== 'string') {
1439
+ return environmentValueAsString;
1440
+ }
1441
+
1442
+ // In case the value is a string, we try to parse it to attempt to extract
1443
+ // the primitive value, if the original value is indeed supposed to be a primitive.
1444
+ // For example, `'1'` is converted to a number, `'true'` is converted to a boolean, etc.
1445
+ try {
1446
+ // Strip out escaped quotes. This is mostly important to coerce an array of string
1447
+ // with escaped quotes.
1448
+ return JSON.parse(String(environmentValueAsString).replace(/(\\")/g, '"'));
1449
+ } catch (e) {
1450
+ return environmentValueAsString;
1451
+ }
1452
+ };
1453
+ const shallowlyCoerceValues = uncoercedEnvironmentValues => {
1454
+ var _context;
1455
+ return _reduceInstanceProperty__default["default"](_context = _Object$keys__default["default"](uncoercedEnvironmentValues)).call(_context, (coercedEnvironmentValues, key) => {
1456
+ const uncoercedEnvironmentValue = uncoercedEnvironmentValues[key];
1457
+ return _objectSpread$3(_objectSpread$3({}, coercedEnvironmentValues), {}, {
1458
+ [key]: getCoerceEnvironmentValue(uncoercedEnvironmentValue)
1459
+ });
1460
+ }, {});
1461
+ };
1462
+ const useCoercedEnvironmentValues = environment => {
1463
+ const coercedEnvironmentValues = react.useMemo(() => shallowlyCoerceValues(environment), [environment]);
1464
+ return coercedEnvironmentValues;
1465
+ };
1466
+
1467
+ const ApplicationShellProvider = props => {
1468
+ const apolloClient = react.useMemo(() => props.apolloClient ?? applicationShellConnectors.createApolloClient(), [props.apolloClient]);
1469
+ react.useEffect(() => {
1470
+ applicationShellConnectors.setCachedApolloClient(apolloClient);
1471
+ }, [apolloClient]);
1472
+ const coercedEnvironmentValues = useCoercedEnvironmentValues(props.environment);
1473
+ const browserLocale = getBrowserLocale(window);
1474
+ return jsxRuntime.jsx(react.Suspense, {
1475
+ fallback: jsxRuntime.jsx(ApplicationLoader, {}),
1476
+ children: jsxRuntime.jsx(ErrorBoundary, {
1477
+ children: jsxRuntime.jsx(applicationShellConnectors.ApplicationContextProvider, {
1478
+ environment: coercedEnvironmentValues,
1479
+ children: jsxRuntime.jsx(reactRedux.Provider, {
1480
+ store: index.internalReduxStore,
1481
+ children: jsxRuntime.jsx(react$2.ApolloProvider, {
1482
+ client: apolloClient,
1483
+ children: jsxRuntime.jsxs(reactRouterDom.Router, {
1484
+ history: getBrowserHistory(),
1485
+ children: [jsxRuntime.jsx(ApplicationPageTitle, {}), jsxRuntime.jsx(AuthenticationRoutes, {
1486
+ locale: browserLocale,
1487
+ applicationMessages: props.applicationMessages,
1488
+ render: _ref => {
1489
+ let isAuthenticated = _ref.isAuthenticated;
1490
+ if (isAuthenticated) return props.children({
1491
+ isAuthenticated
1492
+ });
1493
+ return jsxRuntime.jsx(i18n.AsyncLocaleData, {
1494
+ locale: browserLocale,
1495
+ applicationMessages: props.applicationMessages,
1496
+ children: _ref2 => {
1497
+ let locale = _ref2.locale,
1498
+ messages = _ref2.messages;
1499
+ return jsxRuntime.jsx(ConfigureIntlProvider, {
1500
+ locale: locale,
1501
+ messages: messages,
1502
+ children: props.children({
1503
+ isAuthenticated
1504
+ })
1505
+ });
1506
+ }
1507
+ });
1508
+ }
1509
+ })]
1510
+ })
1511
+ })
1512
+ })
1513
+ })
1514
+ })
1515
+ });
1516
+ };
1517
+ ApplicationShellProvider.propTypes = {};
1518
+ ApplicationShellProvider.displayName = 'ApplicationShellProvider';
1519
+
1520
+ const RedirectToLogin = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./redirect-to-login-8c7575fb.cjs.prod.js' /* webpackChunkName: "redirect-to-login" */); }));
1521
+
1522
+ const styles = {
1523
+ name: "gx7yk8",
1524
+ styles: "html,body{font-size:var(--font-size-30);height:100vh;}#app{height:100%;}"
1525
+ } ;
1526
+ const GlobalStyles = () => jsxRuntime.jsx(react$1.Global, {
1527
+ styles: styles
1528
+ });
1529
+
1530
+ const StrictModeEnablement$1 = props => {
1531
+ if (props.enableReactStrictMode) {
1532
+ return jsxRuntime.jsx(react.StrictMode, {
1533
+ children: props.children
1534
+ });
1535
+ } else {
1536
+ return jsxRuntime.jsx(jsxRuntime.Fragment, {
1537
+ children: props.children
1538
+ });
1539
+ }
1540
+ };
1541
+ StrictModeEnablement$1.propTypes = {};
1542
+ const ApplicationShell = props => {
1543
+ react.useEffect(() => {
1544
+ props.onRegisterErrorListeners?.({
1545
+ dispatch: index.internalReduxStore.dispatch
1546
+ });
1547
+ // eslint-disable-next-line react-hooks/exhaustive-deps
1548
+ }, []); // <-- run only once, when component mounts
1549
+
1550
+ return jsxRuntime.jsxs(StrictModeEnablement$1, {
1551
+ enableReactStrictMode: props.enableReactStrictMode,
1552
+ children: [jsxRuntime.jsx(GlobalStyles, {}), jsxRuntime.jsx(ApplicationShellProvider, {
1553
+ apolloClient: props.apolloClient,
1554
+ environment: props.environment,
1555
+ applicationMessages: props.applicationMessages,
1556
+ children: _ref => {
1557
+ let isAuthenticated = _ref.isAuthenticated;
1558
+ if (isAuthenticated) {
1559
+ return jsxRuntime.jsxs(reactRouterDom.Switch, {
1560
+ children: [jsxRuntime.jsx(SuspendedRoute, {
1561
+ path: "/logout",
1562
+ children: jsxRuntime.jsx(RedirectToLogout, {})
1563
+ }), jsxRuntime.jsx(SuspendedRoute, {
1564
+ children: jsxRuntime.jsx(ApplicationShellAuthenticated, {
1565
+ defaultFeatureFlags: props.defaultFeatureFlags,
1566
+ featureFlags: props.featureFlags,
1567
+ render: props.render,
1568
+ applicationMessages: props.applicationMessages,
1569
+ onMenuItemClick: props.onMenuItemClick,
1570
+ disableRoutePermissionCheck: props.disableRoutePermissionCheck,
1571
+ children: props.children
1572
+ })
1573
+ })]
1574
+ });
1575
+ }
1576
+ return jsxRuntime.jsx(RedirectToLogin, {});
1577
+ }
1578
+ })]
1579
+ });
1580
+ };
1581
+ ApplicationShell.propTypes = {};
1582
+ ApplicationShell.displayName = 'ApplicationShell';
1583
+ ApplicationShell.version = version;
1584
+
1585
+ const CustomViewDevHost = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./custom-view-dev-host-076c2a9f.cjs.prod.js' /* webpackChunkName: "custom-view-dev-host" */); }));
1586
+
1587
+ function CustomViewFlopFlipProvider(props) {
1588
+ const adapterArgs = react.useMemo(() => ({
1589
+ user: {
1590
+ key: props.user?.id
1591
+ }
1592
+ }), [props.user?.id]);
1593
+ return jsxRuntime.jsx(reactBroadcast.ConfigureFlopFlip, {
1594
+ adapter: memoryAdapter__default["default"],
1595
+ defaultFlags: _flagsInstanceProperty__default["default"](props),
1596
+ adapterArgs: adapterArgs,
1597
+ children: props.children
1598
+ });
1599
+ }
1600
+ CustomViewFlopFlipProvider.propTypes = {};
1601
+
1602
+ function ownKeys$2(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
1603
+ function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$2(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$2(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
1604
+ const CustomViewWithPermissionCheck = props => {
1605
+ const permissionKeys = ssr.entryPointUriPathToPermissionKeys(constants.CUSTOM_VIEW_HOST_ENTRY_POINT_URI_PATH);
1606
+
1607
+ // Require View permission to render the application.
1608
+ const canView = permissions.useIsAuthorized({
1609
+ demandedPermissions: [permissionKeys.View]
1610
+ });
1611
+ if (canView) {
1612
+ return jsxRuntime.jsx(jsxRuntime.Fragment, {
1613
+ children: props.children
1614
+ });
1615
+ }
1616
+ return jsxRuntime.jsx(applicationComponents.PageUnauthorized, {});
1617
+ };
1618
+ CustomViewWithPermissionCheck.propTypes = {};
1619
+ function CustomViewShellAuthenticated(props) {
1620
+ const browserLocale = getBrowserLocale(window);
1621
+ return jsxRuntime.jsx(FetchUser, {
1622
+ children: _ref => {
1623
+ let isLoading = _ref.isLoading,
1624
+ fetchUserError = _ref.error,
1625
+ user = _ref.user;
1626
+ if (isLoading) {
1627
+ return jsxRuntime.jsx(ApplicationLoader, {});
1628
+ }
1629
+ return jsxRuntime.jsx(i18n.AsyncLocaleData, {
1630
+ locale: user?.language || browserLocale,
1631
+ applicationMessages: props.messages,
1632
+ children: _ref2 => {
1633
+ let isLoadingLocaleData = _ref2.isLoading,
1634
+ locale = _ref2.locale,
1635
+ messages = _ref2.messages;
1636
+ return jsxRuntime.jsx(ConfigureIntlProvider
1637
+ // We do not want to pass the language as long as the locale data
1638
+ // is not loaded.
1639
+ , _objectSpread$2(_objectSpread$2({}, isLoadingLocaleData ? {} : {
1640
+ locale,
1641
+ messages
1642
+ }), {}, {
1643
+ children: jsxRuntime.jsx(applicationShellConnectors.ApplicationContextProvider, {
1644
+ user: user,
1645
+ environment: props.environment,
1646
+ children: jsxRuntime.jsx(jsxRuntime.Fragment, {
1647
+ children: jsxRuntime.jsx(FetchProject, {
1648
+ projectKey: props.projectKey,
1649
+ children: _ref3 => {
1650
+ let isProjectLoading = _ref3.isLoading,
1651
+ project = _ref3.project;
1652
+ if (fetchUserError) {
1653
+ return jsxRuntime.jsx(applicationComponents.PageUnauthorized, {});
1654
+ }
1655
+ if (isProjectLoading) {
1656
+ return jsxRuntime.jsx(ApplicationLoader, {});
1657
+ }
1658
+ return jsxRuntime.jsx(applicationShellConnectors.ApplicationContextProvider, {
1659
+ user: user,
1660
+ project: project,
1661
+ projectDataLocale: props.dataLocale,
1662
+ environment: props.environment,
1663
+ children: jsxRuntime.jsx(CustomViewFlopFlipProvider, {
1664
+ flags: _flagsInstanceProperty__default["default"](props),
1665
+ user: user,
1666
+ children: jsxRuntime.jsx(CustomViewWithPermissionCheck, {
1667
+ children: props.children
1668
+ })
1669
+ })
1670
+ });
1671
+ }
1672
+ })
1673
+ })
1674
+ })
1675
+ }));
1676
+ }
1677
+ });
1678
+ }
1679
+ });
1680
+ }
1681
+ CustomViewShellAuthenticated.propTypes = {};
1682
+
1683
+ // These styles exist so we can make the Page Layout components to work
1684
+ // property when they are used within a Custom View panel.
1685
+ // Those components have some default margins and paddings around them
1686
+ // which are required when using this components in Custom Applications,
1687
+ // but we don't want them in Custom View panels since they already provide
1688
+ // their own paddings.
1689
+ // These overrides allows us to change the border/margins those Page Layout
1690
+ // components use when they are used within a Custom View panel.
1691
+ const customViewsThemesOverrides = {
1692
+ default: {
1693
+ marginForCustomViewsSelectorAsTabular: '0',
1694
+ marginForPageContent: `${designSystem.designTokens.spacing50} 0`,
1695
+ paddingForDetailPageHeader: `0 0 ${designSystem.designTokens.spacing40} 0`,
1696
+ paddingForMainPageHeader: '0',
1697
+ paddingForTabularPageHeader: '0'
1698
+ }
1699
+ };
1700
+
1701
+ function ownKeys$1(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
1702
+ function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
1703
+ const browserLocale = getBrowserLocale(window);
1704
+ function NotificationsContainer(props) {
1705
+ return jsxRuntime.jsxs(jsxRuntime.Fragment, {
1706
+ children: [jsxRuntime.jsxs("div", {
1707
+ ref: props.notificationsGlobalRef,
1708
+ role: "region",
1709
+ "aria-live": "polite",
1710
+ style: {
1711
+ gridRow: 1,
1712
+ gridColumn: '1/3'
1713
+ },
1714
+ children: [jsxRuntime.jsx("div", {
1715
+ id: "above-top-navigation"
1716
+ }), jsxRuntime.jsx(reactNotifications.NotificationsList, {
1717
+ domain: constants.DOMAINS.GLOBAL
1718
+ })]
1719
+ }), jsxRuntime.jsx("div", {
1720
+ ref: props.notificationsPageRef,
1721
+ children: jsxRuntime.jsx(reactNotifications.NotificationsList, {
1722
+ domain: constants.DOMAINS.PAGE
1723
+ })
1724
+ }), jsxRuntime.jsx(reactNotifications.NotificationsList, {
1725
+ domain: constants.DOMAINS.SIDE
1726
+ })]
1727
+ });
1728
+ }
1729
+ NotificationsContainer.propTypes = {};
1730
+ const ContentWrapper = /*#__PURE__*/_styled__default["default"]("div", {
1731
+ target: "e8xye0r0"
1732
+ } )("height:100%;padding:", designSystem.designTokens.spacing40, " 40px;" + ("" ));
1733
+ function StrictModeEnablement(props) {
1734
+ if (props.enableReactStrictMode) {
1735
+ return jsxRuntime.jsx(react.StrictMode, {
1736
+ children: props.children
1737
+ });
1738
+ } else {
1739
+ return jsxRuntime.jsx(jsxRuntime.Fragment, {
1740
+ children: props.children
1741
+ });
1742
+ }
1743
+ }
1744
+ StrictModeEnablement.propTypes = {};
1745
+ function CustomViewThemeProvider() {
1746
+ const theme = 'default';
1747
+ const customViewThemeOverrides = _objectSpread$1(_objectSpread$1({}, applicationComponents.themesOverrides[theme]), customViewsThemesOverrides[theme]);
1748
+ return jsxRuntime.jsx(designSystem.ThemeProvider, {
1749
+ theme: theme,
1750
+ themeOverrides: customViewThemeOverrides
1751
+ });
1752
+ }
1753
+
1754
+ /*
1755
+ During e2e tests, the Custom View template is built in production mode but still runs on localhost.
1756
+ Checking for local production mode is necessary for applying the development host URL,
1757
+ creating an environment for testing interaction with the Custom View template.
1758
+ */
1759
+ const isLocalProdMode = window.app.env === 'development';
1760
+ function CustomViewShell(props) {
1761
+ const _useState = react.useState(),
1762
+ _useState2 = _slicedToArray(_useState, 2),
1763
+ hostContext = _useState2[0],
1764
+ setHostContext = _useState2[1];
1765
+ const iFrameCommunicationPort = react.useRef();
1766
+ const notificationsGlobalRef = react.useRef(null);
1767
+ const notificationsPageRef = react.useRef(null);
1768
+ const layoutRefs = react.useRef({
1769
+ notificationsGlobalRef,
1770
+ notificationsPageRef
1771
+ });
1772
+ const hostMessageHandler = react.useCallback(event => {
1773
+ if (event.data.eventName === constants.CUSTOM_VIEWS_EVENTS_NAMES.CUSTOM_VIEW_INITIALIZATION) {
1774
+ setHostContext(event.data.eventData.context);
1775
+ } else {
1776
+ console.warn(`CustomViewShell: Unknown received event with name: ${event.data.eventName}`, {
1777
+ event
1778
+ });
1779
+ }
1780
+ }, []);
1781
+ const handleClose = react.useCallback(() => {
1782
+ iFrameCommunicationPort.current?.postMessage({
1783
+ origin: window.location.origin,
1784
+ source: `${constants.CUSTOM_VIEWS_EVENTS_META.CUSTOM_VIEW_KEY_PREFIX}${hostContext?.customViewConfig.id}`,
1785
+ destination: constants.CUSTOM_VIEWS_EVENTS_META.HOST_APPLICATION_CODE,
1786
+ eventName: constants.CUSTOM_VIEWS_EVENTS_NAMES.CUSTOM_VIEW_CLOSE,
1787
+ eventData: {}
1788
+ });
1789
+ }, [hostContext?.customViewConfig.id]);
1790
+ react.useEffect(() => {
1791
+ const bootstrapMessageHandler = event => {
1792
+ if ((event.origin === window.location.origin ||
1793
+ // event.origin is not defined in test environment
1794
+ "production" === 'test') && event.data === constants.CUSTOM_VIEWS_EVENTS_NAMES.CUSTOM_VIEW_BOOTSTRAP) {
1795
+ iFrameCommunicationPort.current = event.ports[0];
1796
+ iFrameCommunicationPort.current.onmessage = hostMessageHandler;
1797
+ // Once bootstraped, we don't want to listen for global messages anymore.
1798
+ // We will only listen to messages coming through the MessageChannel port.
1799
+ window.removeEventListener('message', bootstrapMessageHandler);
1800
+ } else {
1801
+ console.warn('CustomViewShell: Received an event that is not allowed.', {
1802
+ event
1803
+ });
1804
+ }
1805
+ };
1806
+ window.addEventListener('message', bootstrapMessageHandler);
1807
+ return () => {
1808
+ window.removeEventListener('message', bootstrapMessageHandler);
1809
+ };
1810
+ }, [hostMessageHandler]);
1811
+ react.useEffect(() => {
1812
+ // Close the channel when the component unmounts
1813
+ return () => {
1814
+ iFrameCommunicationPort.current?.close();
1815
+ iFrameCommunicationPort.current = undefined;
1816
+ };
1817
+ }, []);
1818
+ if (!hostContext) {
1819
+ return jsxRuntime.jsx(ApplicationLoader, {
1820
+ showLogo: true
1821
+ });
1822
+ }
1823
+ const hostUrl = isLocalProdMode ? window.app.__DEVELOPMENT__?.customViewHostUrl : hostContext.hostUrl;
1824
+ return jsxRuntime.jsxs(jsxRuntime.Fragment, {
1825
+ children: [jsxRuntime.jsx(GlobalStyles, {}), jsxRuntime.jsx(ApplicationShellProvider, {
1826
+ environment: window.app,
1827
+ applicationMessages: props.applicationMessages,
1828
+ apolloClient: props.apolloClient,
1829
+ children: _ref => {
1830
+ let isAuthenticated = _ref.isAuthenticated;
1831
+ if (isAuthenticated) {
1832
+ return jsxRuntime.jsx(applicationShellConnectors.CustomViewContextProvider, {
1833
+ hostUrl: hostUrl,
1834
+ customViewConfig: hostContext.customViewConfig,
1835
+ children: jsxRuntime.jsxs(CustomViewShellAuthenticated, {
1836
+ dataLocale: hostContext.dataLocale,
1837
+ environment: window.app,
1838
+ messages: props.applicationMessages,
1839
+ projectKey: hostContext.projectKey,
1840
+ flags: hostContext.featureFlags,
1841
+ customViewConfig: hostContext.customViewConfig,
1842
+ children: [jsxRuntime.jsx(CustomViewThemeProvider, {}), jsxRuntime.jsx(applicationComponents.PortalsContainer
1843
+ // @ts-ignore
1844
+ , {
1845
+ ref: layoutRefs
1846
+ }), jsxRuntime.jsx(NotificationsContainer, {
1847
+ notificationsGlobalRef: notificationsGlobalRef,
1848
+ notificationsPageRef: notificationsPageRef
1849
+ }), jsxRuntime.jsxs(reactRouterDom.Route, {
1850
+ path: `/custom-views/${hostContext.customViewConfig.id}/projects/${hostContext.projectKey}`,
1851
+ children: [jsxRuntime.jsx(applicationComponents.ModalPageTopBar, {
1852
+ onClose: handleClose,
1853
+ hidePathLabel: true
1854
+ }), jsxRuntime.jsx(ContentWrapper, {
1855
+ children: props.children
1856
+ })]
1857
+ })]
1858
+ })
1859
+ });
1860
+ }
1861
+ return jsxRuntime.jsx(i18n.AsyncLocaleData, {
1862
+ locale: browserLocale,
1863
+ applicationMessages: props.applicationMessages,
1864
+ children: _ref2 => {
1865
+ let locale = _ref2.locale,
1866
+ messages = _ref2.messages;
1867
+ return jsxRuntime.jsx(ConfigureIntlProvider, {
1868
+ locale: locale,
1869
+ messages: messages,
1870
+ children: jsxRuntime.jsx(applicationComponents.PageUnauthorized, {})
1871
+ });
1872
+ }
1873
+ });
1874
+ }
1875
+ })]
1876
+ });
1877
+ }
1878
+ CustomViewShell.propTypes = {};
1879
+ const CustomViewShellWrapper = props => {
1880
+ if ((isLocalProdMode) && !props.disableDevHost) {
1881
+ return jsxRuntime.jsx(StrictModeEnablement, {
1882
+ enableReactStrictMode: props.enableReactStrictMode,
1883
+ children: jsxRuntime.jsx(react.Suspense, {
1884
+ fallback: jsxRuntime.jsx(ApplicationLoader, {}),
1885
+ children: jsxRuntime.jsx(CustomViewDevHost, {
1886
+ applicationMessages: props.applicationMessages,
1887
+ children: jsxRuntime.jsx(CustomViewShell, {
1888
+ apolloClient: props.apolloClient,
1889
+ applicationMessages: props.applicationMessages,
1890
+ children: props.children
1891
+ })
1892
+ })
1893
+ })
1894
+ });
1895
+ }
1896
+ return jsxRuntime.jsx(StrictModeEnablement, {
1897
+ enableReactStrictMode: props.enableReactStrictMode,
1898
+ children: jsxRuntime.jsx(CustomViewShell, {
1899
+ apolloClient: props.apolloClient,
1900
+ applicationMessages: props.applicationMessages,
1901
+ children: props.children
1902
+ })
1903
+ });
1904
+ };
1905
+ CustomViewShellWrapper.propTypes = {};
1906
+
1907
+ const defaultProps = {
1908
+ shouldCleanUpOnUnmount: true
1909
+ };
1910
+ const InjectReducers = props => {
1911
+ const _useState = react.useState(false),
1912
+ _useState2 = _slicedToArray(_useState, 2),
1913
+ areReducersInjected = _useState2[0],
1914
+ setAreReducersInjected = _useState2[1];
1915
+ const store = reactRedux.useStore();
1916
+ react.useEffect(() => {
1917
+ store.injectReducers({
1918
+ id: props.id,
1919
+ reducers: props.reducers
1920
+ });
1921
+ setAreReducersInjected(true);
1922
+ return () => {
1923
+ if (props.shouldCleanUpOnUnmount) {
1924
+ store.removeReducers({
1925
+ id: props.id
1926
+ });
1927
+ }
1928
+ };
1929
+ }, [props.id, props.reducers, props.shouldCleanUpOnUnmount, store]);
1930
+
1931
+ // Render children only when the plugin reducers have been injected
1932
+ if (areReducersInjected) return jsxRuntime.jsx(jsxRuntime.Fragment, {
1933
+ children: props.children
1934
+ });
1935
+ return null;
1936
+ };
1937
+ InjectReducers.propTypes = {
1938
+ id: _pt__default["default"].string.isRequired,
1939
+ reducers: _pt__default["default"].any.isRequired,
1940
+ shouldCleanUpOnUnmount: _pt__default["default"].bool.isRequired,
1941
+ children: _pt__default["default"].node.isRequired
1942
+ };
1943
+ InjectReducers.displayName = 'InjectReducers';
1944
+ InjectReducers.defaultProps = defaultProps;
1945
+
1946
+ const errorMessageIgnoreList = [/ResizeObserver loop (limit exceeded|completed with undelivered notifications)/i];
1947
+
1948
+ // Ensure to initialize Sentry as soon as possible, so that we have the chance
1949
+ // of catching possible errors.
1950
+ sentry.boot();
1951
+ const makeErrorToCapture = error => {
1952
+ if (error instanceof Error) return error;
1953
+ if (error instanceof ErrorEvent) return new Error(error.message);
1954
+ return new Error(_JSON$stringify__default["default"](error.reason || 'Unhandled rejection without a reason'));
1955
+ };
1956
+ const getErrorMessage = error => {
1957
+ if (typeof error === 'string') return error;
1958
+ const errorToCapture = makeErrorToCapture(error);
1959
+ return errorToCapture.message || errorToCapture.name;
1960
+ };
1961
+ const shouldErrorBeTracked = error => {
1962
+ const errorMessage = getErrorMessage(error);
1963
+ return !_someInstanceProperty__default["default"](errorMessageIgnoreList).call(errorMessageIgnoreList, match => match.test(errorMessage));
1964
+ };
1965
+ function setupGlobalErrorListener() {
1966
+ // Capture unhandled errors generated from rejected Promises.
1967
+ //
1968
+ // http://www.2ality.com/2016/04/unhandled-rejections.html
1969
+ // https://docs.getsentry.com/hosted/clients/javascript/usage/#promises
1970
+ //
1971
+ // Note: this currently works only in Chrome, and it might not be needed.
1972
+ // We just keep it here as a nice-to-have thing.
1973
+ window.addEventListener('unhandledrejection', event => {
1974
+ if (shouldErrorBeTracked(event)) {
1975
+ const errorId = sentry.reportErrorToSentry(event);
1976
+ index.internalReduxStore.dispatch(actionsGlobal.showUnexpectedErrorNotification({
1977
+ errorId
1978
+ }));
1979
+ }
1980
+ });
1981
+
1982
+ // Capture normal global errors coming from non Promise code.
1983
+ window.addEventListener('error', errorEvent => {
1984
+ if (shouldErrorBeTracked(errorEvent)) {
1985
+ const errorId = sentry.reportErrorToSentry(errorEvent);
1986
+ index.internalReduxStore.dispatch(actionsGlobal.showUnexpectedErrorNotification({
1987
+ errorId
1988
+ }));
1989
+ }
1990
+ });
1991
+ }
1992
+
1993
+ function ownKeys(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
1994
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
1995
+
1996
+ /**
1997
+ * The route path to match. Usually it starts with `/:projectKey/my-entry-point`.
1998
+ */
1999
+
2000
+ const makeRoute = (routePath, routeOptions) => {
2001
+ const getUrl = (nextParams, nextQueryParams) => {
2002
+ const baseUrl = reactRouterDom.generatePath(routePath, _objectSpread(_objectSpread({}, routeOptions.params), nextParams));
2003
+ if (nextQueryParams) {
2004
+ return `${baseUrl}?${nextQueryParams.toString()}`;
2005
+ }
2006
+ return baseUrl;
2007
+ };
2008
+ const go = (nextParams, nextQueryParams) => {
2009
+ routeOptions.goTo(getUrl(nextParams, nextQueryParams));
2010
+ };
2011
+ return {
2012
+ path: routePath,
2013
+ getUrl,
2014
+ go
2015
+ };
2016
+ };
2017
+ function useRoutesCreator() {
2018
+ const _useRouteMatch = reactRouterDom.useRouteMatch(),
2019
+ params = _useRouteMatch.params;
2020
+ const _useHistory = reactRouterDom.useHistory(),
2021
+ goTo = _useHistory.push,
2022
+ location = _useHistory.location;
2023
+ const createRoute = routePath => makeRoute(routePath, {
2024
+ goTo,
2025
+ params,
2026
+ location
2027
+ });
2028
+ return {
2029
+ createRoute
2030
+ };
2031
+ }
2032
+
2033
+ exports.ApplicationLoader = ApplicationLoader;
2034
+ exports.ApplicationPageTitle = ApplicationPageTitle;
2035
+ exports.ApplicationShell = ApplicationShell;
2036
+ exports.ApplicationShellProvider = ApplicationShellProvider;
2037
+ exports.ButlerContainer = ButlerContainer;
2038
+ exports.ConfigureIntlProvider = ConfigureIntlProvider;
2039
+ exports.CustomViewShellWrapper = CustomViewShellWrapper;
2040
+ exports.ErrorApologizer = ErrorApologizer;
2041
+ exports.ErrorBoundary = ErrorBoundary;
2042
+ exports.FetchProject = FetchProject;
2043
+ exports.FetchUser = FetchUser;
2044
+ exports.InjectReducers = InjectReducers;
2045
+ exports.ProjectDataLocale = ProjectDataLocale;
2046
+ exports.ProjectSwitcher = ProjectSwitcher;
2047
+ exports.REQUESTS_IN_FLIGHT_LOADER_DOM_ID = REQUESTS_IN_FLIGHT_LOADER_DOM_ID;
2048
+ exports.RedirectToLogin = RedirectToLogin;
2049
+ exports.RedirectToLogout = RedirectToLogout;
2050
+ exports.RedirectToProjectCreate = RedirectToProjectCreate;
2051
+ exports.SetupFlopFlipProvider = SetupFlopFlipProvider;
2052
+ exports.SuspendedRoute = SuspendedRoute;
2053
+ exports.getBrowserLocale = getBrowserLocale;
2054
+ exports.getPreviousProjectKey = getPreviousProjectKey;
2055
+ exports.pimIndexerStates = pimIndexerStates;
2056
+ exports.setupGlobalErrorListener = setupGlobalErrorListener;
2057
+ exports.useRoutesCreator = useRoutesCreator;
2058
+ exports.version = version;