slice-machine-ui 1.26.1-beta.2 → 1.26.1-beta.20

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 (521) hide show
  1. package/.eslintrc.js +6 -1
  2. package/.storybook/preview.tsx +2 -1
  3. package/out/404.html +1 -1
  4. package/out/_next/static/aa7R_XjeTBeGJoT6HrJb4/_buildManifest.js +1 -0
  5. package/out/_next/static/chunks/127-6451528762141246.js +1 -0
  6. package/out/_next/static/chunks/{183-ebd633fed7c74545.js → 183-6ad1d7303abecd2b.js} +1 -1
  7. package/out/_next/static/chunks/18539003-8854ec97730b0755.js +22 -0
  8. package/out/_next/static/chunks/569-2ae3e9666f3bf991.js +1 -0
  9. package/out/_next/static/chunks/614-873c38acd991869b.js +1 -0
  10. package/out/_next/static/chunks/756-61dc56b98d01e964.js +10 -0
  11. package/out/_next/static/chunks/90-2d4bdae13d031364.js +1 -0
  12. package/out/_next/static/chunks/91-717d764a224ac07f.js +1 -0
  13. package/out/_next/static/chunks/96-d28e81d2b1c10a08.js +1 -0
  14. package/out/_next/static/chunks/pages/_app-d2bb4f9b121e3de8.js +530 -0
  15. package/out/_next/static/chunks/pages/changelog-042822d12df57669.js +1 -0
  16. package/out/_next/static/chunks/pages/changes-194f6cf187fa6ee7.js +1 -0
  17. package/out/_next/static/chunks/pages/custom-types/[customTypeId]-ff73a06702296c34.js +1 -0
  18. package/out/_next/static/chunks/pages/{custom-types-3c8e721ec6802127.js → custom-types-900b40b54b74e6d6.js} +1 -1
  19. package/out/_next/static/chunks/pages/{index-cf93d16e9c63b6db.js → index-ccd2975faba412f6.js} +1 -1
  20. package/out/_next/static/chunks/pages/labs-7a4fe64cb86b59e8.js +1 -0
  21. package/out/_next/static/chunks/pages/page-types/[pageTypeId]-30d471f6127ebed7.js +1 -0
  22. package/out/_next/static/chunks/pages/settings-419384d4d43070c2.js +1 -0
  23. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-9bdb355306fca592.js +1 -0
  24. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-afbfff837c3dc4dd.js +1 -0
  25. package/out/_next/static/chunks/pages/slices-98f88ac46b6ad58b.js +1 -0
  26. package/out/_next/static/css/22f264c93bd9d85f.css +1 -0
  27. package/out/_next/static/css/321d78460d2d69bc.css +1 -0
  28. package/out/_next/static/css/a686f7612f1943ed.css +1 -0
  29. package/out/_next/static/css/c47241940651ef2f.css +1 -0
  30. package/out/_next/static/css/dc201720b301472d.css +1 -0
  31. package/out/_next/static/css/e5745b5b0494af29.css +1 -0
  32. package/out/changelog.html +1 -1
  33. package/out/changes.html +1 -1
  34. package/out/custom-types/[customTypeId].html +1 -1
  35. package/out/custom-types.html +1 -1
  36. package/out/index.html +1 -1
  37. package/out/labs.html +1 -1
  38. package/out/page-types/[pageTypeId].html +1 -1
  39. package/out/settings.html +1 -1
  40. package/out/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
  41. package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
  42. package/out/slices.html +1 -1
  43. package/package.json +10 -8
  44. package/sentry.client.config.ts +2 -1
  45. package/src/ErrorBoundary.tsx +1 -1
  46. package/src/apiClient.ts +13 -9
  47. package/src/components/BaseHoverCard/BaseHoverCard.stories.tsx +1 -1
  48. package/src/components/BaseHoverCard/BaseHoverCard.test.tsx +1 -1
  49. package/src/components/BaseHoverCard/BaseHoverCard.tsx +1 -1
  50. package/src/components/BlankSlate/BlankSlate.module.css +74 -0
  51. package/src/components/BlankSlate/BlankSlate.module.css.d.ts +13 -0
  52. package/src/components/BlankSlate/BlankSlate.stories.tsx +1 -1
  53. package/src/components/BlankSlate/BlankSlate.tsx +1 -1
  54. package/src/components/BlankSlate/index.ts +1 -1
  55. package/src/components/Breadcrumb/Breadcrumb.module.css +11 -0
  56. package/src/components/Breadcrumb/Breadcrumb.module.css.d.ts +6 -0
  57. package/src/components/Breadcrumb/Breadcrumb.stories.tsx +34 -0
  58. package/src/components/Breadcrumb/Breadcrumb.tsx +43 -25
  59. package/src/components/Breadcrumb/index.ts +1 -1
  60. package/src/components/Card/Card.stories.tsx +3 -3
  61. package/src/components/Card/Card.tsx +3 -2
  62. package/src/components/CodeBlock/CodeBlock.module.css +46 -0
  63. package/src/components/CodeBlock/CodeBlock.module.css.d.ts +10 -0
  64. package/src/components/CodeBlock/CodeBlock.tsx +7 -7
  65. package/src/components/ContentTabs/ContentTabs.module.css +60 -0
  66. package/src/components/ContentTabs/ContentTabs.module.css.d.ts +12 -0
  67. package/src/components/ContentTabs/ContentTabs.tsx +2 -2
  68. package/src/components/Count/Count.tsx +1 -1
  69. package/src/components/Divider/Divider.module.css +23 -0
  70. package/src/components/Divider/Divider.module.css.d.ts +7 -0
  71. package/src/components/Divider/Divider.stories.tsx +3 -4
  72. package/src/components/Divider/Divider.tsx +5 -8
  73. package/src/components/HoverCard/HoverCard.module.css +79 -0
  74. package/src/components/HoverCard/HoverCard.module.css.d.ts +13 -0
  75. package/src/components/HoverCard/HoverCard.stories.tsx +3 -2
  76. package/src/components/HoverCard/HoverCard.test.tsx +2 -2
  77. package/src/components/HoverCard/HoverCard.tsx +3 -3
  78. package/src/components/HoverCard/index.ts +3 -3
  79. package/src/components/PageLayout/PageLayout.module.css +1 -1
  80. package/src/components/SideNav/SideNav.module.css +1 -1
  81. package/src/components/SideNav/SideNav.stories.tsx +6 -6
  82. package/src/components/SideNav/SideNav.tsx +8 -8
  83. package/src/components/SideNav/SideNavEnvironmentSelector.tsx +10 -12
  84. package/src/components/Table/Table.stories.tsx +2 -2
  85. package/src/components/Table/Table.test.tsx +2 -2
  86. package/src/components/Table/Table.tsx +2 -2
  87. package/src/components/Table/index.ts +1 -1
  88. package/src/components/TextLink/TextLink.module.css +58 -0
  89. package/src/components/TextLink/TextLink.module.css.d.ts +11 -0
  90. package/src/components/TextLink/TextLink.stories.tsx +1 -1
  91. package/src/components/TextLink/TextLink.tsx +5 -5
  92. package/src/domain/__tests__/customType.test.ts +1 -186
  93. package/src/domain/__tests__/group.test.ts +161 -0
  94. package/src/domain/__tests__/slice.test.ts +41 -0
  95. package/src/domain/customType.ts +1 -193
  96. package/src/domain/group.ts +89 -0
  97. package/src/domain/slice.ts +53 -12
  98. package/src/features/autoSave/AutoSaveStatusIndicator.tsx +2 -2
  99. package/src/features/changelog/useSliceMachineLatestNonBreakingVersion.ts +1 -1
  100. package/src/features/changelog/useSliceMachineReleaseNotes.ts +1 -1
  101. package/src/features/changelog/useSliceMachineVersions.ts +2 -2
  102. package/src/features/changes/BlankSlates/NoChangesBlankSlate.tsx +11 -14
  103. package/src/features/changes/PushChangesButton.tsx +5 -5
  104. package/src/features/changes/StatusBadge.tsx +2 -2
  105. package/src/features/customTypes/EditDropdown.tsx +6 -9
  106. package/src/features/customTypes/PageTypeOnboarding.tsx +5 -5
  107. package/src/features/customTypes/__tests__/CustomTypeBuilderPage.test.tsx +16 -18
  108. package/src/features/customTypes/__tests__/CustomTypesTablePage.test.tsx +11 -10
  109. package/src/features/customTypes/actions/convertCustomToPageType.ts +4 -4
  110. package/src/features/customTypes/actions/createCustomType.ts +5 -5
  111. package/src/features/customTypes/actions/deleteCustomType.ts +3 -3
  112. package/src/features/customTypes/actions/renameCustomType.ts +3 -3
  113. package/src/features/customTypes/customTypesBuilder/CustomTypeProvider.tsx +8 -8
  114. package/src/features/customTypes/customTypesBuilder/CustomTypesBuilderPage.tsx +25 -15
  115. package/src/features/customTypes/customTypesBuilder/PageSnippetDialog/PageSnippetDialog.tsx +7 -7
  116. package/src/features/customTypes/customTypesBuilder/SliceZoneBlankSlate.tsx +3 -3
  117. package/src/features/customTypes/customTypesBuilder/useCustomType.ts +1 -1
  118. package/src/features/customTypes/customTypesConfig.ts +2 -2
  119. package/src/features/customTypes/customTypesTable/CustomTypesTable.tsx +16 -16
  120. package/src/features/customTypes/customTypesTable/CustomTypesTablePage.tsx +19 -20
  121. package/src/features/customTypes/customTypesTable/useCustomTypes.ts +8 -8
  122. package/src/features/documentation/MarkdownRenderer/index.tsx +5 -6
  123. package/src/features/documentation/useDocumentation.ts +1 -1
  124. package/src/features/environments/actions/getActiveEnvironment.ts +1 -1
  125. package/src/features/environments/actions/getEnvironments.ts +1 -1
  126. package/src/features/environments/actions/setEnvironment.ts +3 -3
  127. package/src/features/inAppGuide/InAppGuideContext.tsx +2 -2
  128. package/src/features/inAppGuide/InAppGuideDialog.tsx +4 -4
  129. package/src/features/inAppGuide/inAppGuideContent.tsx +4 -4
  130. package/src/features/labs/labsList/LabsList.tsx +2 -2
  131. package/src/features/labs/labsList/LabsListItem.tsx +1 -1
  132. package/src/features/labs/labsList/LabsPage.tsx +8 -5
  133. package/src/features/labs/labsList/useLab.tsx +1 -1
  134. package/src/features/settings/SettingsPage.tsx +7 -4
  135. package/src/features/settings/git/ConnectGitRepository.tsx +9 -9
  136. package/src/features/settings/git/GitOwnerSelect.tsx +1 -1
  137. package/src/features/settings/git/GitProvider.ts +4 -4
  138. package/src/features/settings/git/GitProviderConnectButtons.tsx +1 -1
  139. package/src/features/settings/git/GitRepositoriesList.tsx +5 -5
  140. package/src/features/settings/git/GitRepositoriesSearch.tsx +5 -5
  141. package/src/features/settings/git/GitRepositoryConnectDialog.tsx +5 -8
  142. package/src/features/settings/git/useGitIntegrationExperiment.ts +1 -1
  143. package/src/features/settings/git/useGitOwners.ts +1 -1
  144. package/src/features/settings/git/useGitRepos.ts +1 -1
  145. package/src/features/settings/git/useLinkedGitRepos.ts +2 -2
  146. package/src/features/settings/git/useWriteAPIToken.ts +2 -2
  147. package/src/features/slices/actions/addSlicesToSliceZone.ts +2 -2
  148. package/src/features/slices/actions/createSlice.ts +5 -5
  149. package/src/features/slices/actions/deleteSlice.ts +1 -1
  150. package/src/features/slices/actions/renameSlice.ts +4 -4
  151. package/src/features/slices/actions/uploadSliceScreenshot.ts +2 -2
  152. package/src/features/slices/convertLegacySlice/ConvertLegacySliceAsNewSliceDialog.tsx +10 -10
  153. package/src/features/slices/convertLegacySlice/ConvertLegacySliceAsNewVariationDialog.tsx +7 -7
  154. package/src/features/slices/convertLegacySlice/ConvertLegacySliceButton.module.css +14 -0
  155. package/src/features/slices/convertLegacySlice/ConvertLegacySliceButton.module.css.d.ts +6 -0
  156. package/src/features/slices/convertLegacySlice/ConvertLegacySliceButton.tsx +12 -12
  157. package/src/features/slices/convertLegacySlice/ConvertLegacySliceMergeWithIdenticalDialog.tsx +5 -8
  158. package/src/features/slices/convertLegacySlice/types.ts +2 -2
  159. package/src/features/slices/sliceBuilder/FloatingBackButton.tsx +6 -6
  160. package/src/features/slices/sliceBuilder/SliceBuilderProvider.tsx +9 -9
  161. package/src/features/slices/sliceBuilder/actions/deleteVariation.ts +4 -4
  162. package/src/features/slices/sliceBuilder/actions/renameVariation.ts +3 -3
  163. package/src/features/slices/sliceBuilder/useGroupsInSlicesExperiment.ts +8 -0
  164. package/src/features/slices/sliceCards/NonSharedSliceCard.tsx +4 -4
  165. package/src/features/slices/sliceCards/SharedSliceCard.tsx +7 -7
  166. package/src/features/slicesTemplates/actions/createSlicesTemplates.ts +2 -2
  167. package/src/features/slicesTemplates/useSlicesTemplates.ts +2 -1
  168. package/src/features/sync/AutoSyncProvider.tsx +17 -17
  169. package/src/features/sync/actions/pushChanges.ts +4 -3
  170. package/src/features/sync/actions/trackPushChangesSuccess.ts +3 -3
  171. package/src/features/sync/components/AutoSyncStatusIndicator.module.css +1 -1
  172. package/src/features/sync/components/AutoSyncStatusIndicator.tsx +4 -4
  173. package/src/features/sync/fetchUnSyncChanges.ts +5 -5
  174. package/src/features/sync/getUnSyncChanges.ts +9 -9
  175. package/src/features/sync/useUnSyncChanges.ts +5 -5
  176. package/src/hooks/useActionQueue.tsx +5 -5
  177. package/src/hooks/useAdapterName.ts +1 -1
  178. package/src/hooks/useAuthStatus.ts +2 -2
  179. package/src/hooks/useCurrentSlice.tsx +4 -4
  180. package/src/hooks/useEditorContent.ts +5 -4
  181. package/src/hooks/useExperimentVariant.ts +2 -2
  182. package/src/hooks/useIsEmptyProject.ts +1 -1
  183. package/src/hooks/useRepositoryInformation.ts +2 -2
  184. package/src/hooks/useRouteChange.tsx +1 -1
  185. package/src/hooks/useSMTracker.ts +6 -6
  186. package/src/hooks/useScreenshotChangesModal.ts +4 -3
  187. package/src/hooks/useServerState.ts +4 -4
  188. package/src/hooks/useSliceMachineConfig.ts +2 -2
  189. package/src/hooks/useSliceMachineRunningVersion.ts +1 -1
  190. package/src/hooks/useThrottle.ts +1 -1
  191. package/src/hooks/useUpdateAvailable.ts +1 -1
  192. package/src/hooks/useWindowDimensions.ts +1 -1
  193. package/src/hooks/useWindowSize.ts +2 -1
  194. package/{components → src/legacy/components}/App/index.tsx +8 -8
  195. package/{components → src/legacy/components}/AppLayout/index.tsx +6 -7
  196. package/{components → src/legacy/components}/AuthInstructions/index.jsx +1 -1
  197. package/{components → src/legacy/components}/Button/index.tsx +1 -2
  198. package/{components → src/legacy/components}/Card/Default.jsx +2 -1
  199. package/{components → src/legacy/components}/Card/Preview.jsx +1 -1
  200. package/{components → src/legacy/components}/Card/WithTabs/index.jsx +4 -3
  201. package/{components → src/legacy/components}/Card/index.tsx +1 -0
  202. package/{components → src/legacy/components}/Changelog/index.tsx +8 -8
  203. package/{components → src/legacy/components}/Changelog/navigation/VersionBadge.tsx +2 -1
  204. package/{components → src/legacy/components}/Changelog/navigation/VersionTag.tsx +1 -0
  205. package/{components → src/legacy/components}/Changelog/navigation/index.tsx +6 -6
  206. package/{components → src/legacy/components}/Changelog/versionDetails/UpdateCommandBox.tsx +6 -6
  207. package/{components → src/legacy/components}/Changelog/versionDetails/VersionKindLabel.tsx +3 -4
  208. package/{components → src/legacy/components}/Changelog/versionDetails/index.tsx +5 -5
  209. package/{components → src/legacy/components}/ChangesEmptyState/AuthErrorPage.tsx +5 -5
  210. package/{components → src/legacy/components}/ChangesItems/ChangesItems.tsx +14 -14
  211. package/{components → src/legacy/components}/ChangesItems/DevCollaborationExperiment.tsx +3 -3
  212. package/{components → src/legacy/components}/CodeBlock/index.tsx +3 -3
  213. package/{components → src/legacy/components}/ConfigErrors/index.jsx +4 -3
  214. package/{components → src/legacy/components}/CustomTypeTable/changesPage.tsx +9 -8
  215. package/{components → src/legacy/components}/DeleteCTModal/index.tsx +9 -9
  216. package/{components → src/legacy/components}/DeleteDocumentsDrawer/AssociatedDocumentsCard.tsx +4 -4
  217. package/{components → src/legacy/components}/DeleteDocumentsDrawer/HardDeleteDocumentsDrawer.tsx +9 -9
  218. package/{components → src/legacy/components}/DeleteDocumentsDrawer/SoftDeleteDocumentsDrawer.tsx +9 -8
  219. package/{components → src/legacy/components}/DeleteSliceModal/index.tsx +6 -6
  220. package/{components → src/legacy/components}/DeleteVariationModal/index.tsx +6 -6
  221. package/{components → src/legacy/components}/DropDownSelector/index.tsx +2 -4
  222. package/{components → src/legacy/components}/EmptyState/index.tsx +3 -3
  223. package/{components → src/legacy/components}/FormFields/Array.jsx +2 -4
  224. package/{components → src/legacy/components}/FormFields/Checkbox.jsx +1 -1
  225. package/{components → src/legacy/components}/FormFields/CheckboxControl.jsx +1 -1
  226. package/{components → src/legacy/components}/FormFields/Input.tsx +3 -2
  227. package/{components → src/legacy/components}/FormFields/SelectDefaultValue.jsx +1 -1
  228. package/{components → src/legacy/components}/Forms/CreateCustomTypeModal/CreateCustomTypeModal.tsx +18 -18
  229. package/{components → src/legacy/components}/Forms/CreateSliceModal/CreateSliceModal.tsx +10 -10
  230. package/{components → src/legacy/components}/Forms/RenameCustomTypeModal/RenameCustomTypeModal.tsx +12 -12
  231. package/{components → src/legacy/components}/Forms/RenameSliceModal/RenameSliceModal.tsx +8 -8
  232. package/src/legacy/components/Forms/RenameVariationModal/RenameVariationModal.module.css +5 -0
  233. package/src/legacy/components/Forms/RenameVariationModal/RenameVariationModal.module.css.d.ts +5 -0
  234. package/{components → src/legacy/components}/Forms/RenameVariationModal/RenameVariationModal.tsx +7 -7
  235. package/{components → src/legacy/components}/Forms/components/InputBox.tsx +2 -2
  236. package/{components → src/legacy/components}/Forms/components/SelectRepeatable.tsx +4 -3
  237. package/{components → src/legacy/components}/Forms/formsValidator.ts +6 -4
  238. package/{components → src/legacy/components}/FullPage/index.tsx +1 -1
  239. package/{components → src/legacy/components}/ListItem/Header.tsx +3 -2
  240. package/{components → src/legacy/components}/ListItem/index.tsx +8 -10
  241. package/{components → src/legacy/components}/LoadingPage/index.tsx +1 -0
  242. package/{components → src/legacy/components}/LoginModal/index.tsx +22 -22
  243. package/{components → src/legacy/components}/ModalFormCard/index.tsx +7 -6
  244. package/{components → src/legacy/components}/Navigation/ChangesItem.tsx +18 -16
  245. package/{components → src/legacy/components}/Navigation/Environment.tsx +13 -13
  246. package/{components → src/legacy/components}/Navigation/RunningVersion.tsx +2 -2
  247. package/{components → src/legacy/components}/Navigation/UpdateBox.tsx +3 -3
  248. package/src/legacy/components/Navigation/VideoItem.module.css.d.ts +5 -0
  249. package/{components → src/legacy/components}/Navigation/VideoItem.tsx +14 -13
  250. package/src/legacy/components/Navigation/index.module.css +3 -0
  251. package/src/legacy/components/Navigation/index.module.css.d.ts +5 -0
  252. package/{components → src/legacy/components}/Navigation/index.test.tsx +12 -12
  253. package/{components → src/legacy/components}/Navigation/index.tsx +20 -21
  254. package/{components → src/legacy/components}/ReviewModal/ReviewForm.tsx +12 -12
  255. package/{components → src/legacy/components}/ReviewModal/ReviewModal.tsx +6 -6
  256. package/{components → src/legacy/components}/ScreenshotChangesModal/VariationDropZone.tsx +7 -7
  257. package/{components → src/legacy/components}/ScreenshotChangesModal/index.tsx +12 -15
  258. package/{components → src/legacy/components}/ScreenshotChangesModal/useCustomScreenshot.tsx +1 -1
  259. package/{components → src/legacy/components}/ScreenshotPreviewModal/index.tsx +8 -7
  260. package/{components → src/legacy/components}/Simulator/components/FailedConnect/index.tsx +3 -3
  261. package/{components → src/legacy/components}/Simulator/components/Header/VariationsPopover/MenuList.tsx +2 -1
  262. package/{components → src/legacy/components}/Simulator/components/Header/VariationsPopover/index.tsx +4 -5
  263. package/{components → src/legacy/components}/Simulator/components/Header/index.tsx +7 -7
  264. package/{components → src/legacy/components}/Simulator/components/IframeRenderer/index.tsx +3 -4
  265. package/{components → src/legacy/components}/Simulator/components/Toolbar/ScreensizeInput/index.tsx +2 -1
  266. package/{components → src/legacy/components}/Simulator/components/Toolbar/index.tsx +4 -5
  267. package/{components → src/legacy/components}/Simulator/index.tsx +25 -30
  268. package/{components → src/legacy/components}/SliceMachineDrawer/index.tsx +3 -2
  269. package/{components → src/legacy/components}/ToasterContainer/index.tsx +3 -5
  270. package/{components → src/legacy/components}/Tooltip/TextWithTooltip.tsx +2 -2
  271. package/{components → src/legacy/components}/Tooltip/index.jsx +2 -2
  272. package/{components → src/legacy/components}/Warnings/index.jsx +1 -1
  273. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/DeleteSliceZoneModal.tsx +4 -4
  274. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/List.tsx +8 -8
  275. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/SlicesTemplatesModal.tsx +11 -11
  276. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/UpdateSliceZoneModal.tsx +3 -3
  277. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/UpdateSliceZoneModalList.tsx +4 -3
  278. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/index.tsx +26 -23
  279. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/sliceTemplatesComingSoon.ts +1 -1
  280. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/TabModal/InputBox.tsx +1 -1
  281. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/TabModal/create.tsx +2 -1
  282. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/TabModal/delete.tsx +2 -2
  283. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/TabModal/update.tsx +3 -2
  284. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/TabZone/index.tsx +32 -32
  285. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/index.tsx +5 -5
  286. package/src/legacy/lib/builders/SliceBuilder/FieldZones/index.tsx +273 -0
  287. package/{lib → src/legacy/lib}/builders/SliceBuilder/Sidebar/AddVariationModal.tsx +7 -7
  288. package/{lib → src/legacy/lib}/builders/SliceBuilder/Sidebar/index.tsx +12 -12
  289. package/{lib → src/legacy/lib}/builders/SliceBuilder/SimulatorButton/index.tsx +12 -11
  290. package/{lib → src/legacy/lib}/builders/SliceBuilder/index.tsx +13 -9
  291. package/{lib → src/legacy/lib}/builders/common/EditModal/Field.jsx +3 -5
  292. package/{lib → src/legacy/lib}/builders/common/EditModal/Form.jsx +1 -1
  293. package/{lib → src/legacy/lib}/builders/common/EditModal/index.jsx +14 -16
  294. package/{lib → src/legacy/lib}/builders/common/SelectFieldTypeModal/index.jsx +3 -4
  295. package/{lib → src/legacy/lib}/builders/common/Zone/Card/components/ErrorTooltip.tsx +2 -2
  296. package/{lib → src/legacy/lib}/builders/common/Zone/Card/components/Hints/CodeBlock.tsx +4 -5
  297. package/{lib → src/legacy/lib}/builders/common/Zone/Card/components/Hints/index.tsx +2 -1
  298. package/{lib → src/legacy/lib}/builders/common/Zone/Card/components/NewField.tsx +16 -13
  299. package/{lib → src/legacy/lib}/builders/common/Zone/Card/index.jsx +15 -9
  300. package/{lib → src/legacy/lib}/builders/common/Zone/components/EmptyState/index.tsx +2 -2
  301. package/{lib → src/legacy/lib}/builders/common/Zone/index.jsx +7 -10
  302. package/{lib → src/legacy/lib}/builders/utils/index.ts +1 -1
  303. package/{lib → src/legacy/lib}/forms/fields.ts +1 -2
  304. package/{lib → src/legacy/lib}/forms/index.ts +1 -0
  305. package/{lib → src/legacy/lib}/models/common/CustomType/index.ts +5 -4
  306. package/{lib → src/legacy/lib}/models/common/CustomType/sliceZone.ts +2 -1
  307. package/{lib → src/legacy/lib}/models/common/DeprecatedMockConfigMessage.tsx +3 -2
  308. package/{lib → src/legacy/lib}/models/common/Environment.ts +2 -2
  309. package/{lib → src/legacy/lib}/models/common/Group.ts +3 -2
  310. package/{lib → src/legacy/lib}/models/common/Library.ts +2 -1
  311. package/{lib → src/legacy/lib}/models/common/LibraryUI.ts +1 -1
  312. package/{lib → src/legacy/lib}/models/common/ModelData.ts +3 -3
  313. package/{lib → src/legacy/lib}/models/common/ModelStatus/compareCustomTypeModels.ts +2 -1
  314. package/{lib → src/legacy/lib}/models/common/ModelStatus/compareSliceModels.ts +2 -1
  315. package/{lib → src/legacy/lib}/models/common/ModelStatus/index.ts +10 -9
  316. package/{lib → src/legacy/lib}/models/common/Slice.ts +19 -5
  317. package/{lib → src/legacy/lib}/models/common/normalizers/customType.ts +2 -2
  318. package/{lib → src/legacy/lib}/models/common/normalizers/slices.ts +3 -2
  319. package/{lib → src/legacy/lib}/models/common/widgets/Boolean/index.ts +5 -7
  320. package/{lib → src/legacy/lib}/models/common/widgets/Color/index.ts +2 -3
  321. package/{lib → src/legacy/lib}/models/common/widgets/ContentRelationship/Form.tsx +9 -10
  322. package/{lib → src/legacy/lib}/models/common/widgets/ContentRelationship/index.ts +7 -7
  323. package/{lib → src/legacy/lib}/models/common/widgets/GeoPoint/index.ts +2 -3
  324. package/{lib → src/legacy/lib}/models/common/widgets/Group/Form.jsx +6 -6
  325. package/{lib → src/legacy/lib}/models/common/widgets/Group/ListItem/index.jsx +63 -76
  326. package/{lib → src/legacy/lib}/models/common/widgets/Group/index.ts +6 -4
  327. package/{lib → src/legacy/lib}/models/common/widgets/Image/Form.tsx +9 -11
  328. package/{lib → src/legacy/lib}/models/common/widgets/Image/components.tsx +6 -5
  329. package/{lib → src/legacy/lib}/models/common/widgets/Image/index.ts +3 -5
  330. package/{lib → src/legacy/lib}/models/common/widgets/Link/Form.jsx +5 -7
  331. package/{lib → src/legacy/lib}/models/common/widgets/LinkToMedia/Form.jsx +4 -6
  332. package/{lib → src/legacy/lib}/models/common/widgets/LinkToMedia/index.ts +4 -4
  333. package/{lib → src/legacy/lib}/models/common/widgets/Select/FormFields.jsx +7 -7
  334. package/{lib → src/legacy/lib}/models/common/widgets/Select/index.ts +3 -6
  335. package/{lib → src/legacy/lib}/models/common/widgets/StructuredText/Form.tsx +12 -11
  336. package/{lib → src/legacy/lib}/models/common/widgets/StructuredText/index.ts +3 -6
  337. package/{lib → src/legacy/lib}/models/common/widgets/StructuredText/options.tsx +2 -2
  338. package/{lib → src/legacy/lib}/models/common/widgets/Timestamp/index.ts +4 -5
  339. package/{lib → src/legacy/lib}/models/common/widgets/UID/index.ts +4 -5
  340. package/{lib → src/legacy/lib}/models/common/widgets/Widget.ts +3 -1
  341. package/src/legacy/lib/models/common/widgets/groupBuilderArray.ts +18 -0
  342. package/src/legacy/lib/models/common/widgets/sliceBuilderArray.ts +19 -0
  343. package/src/legacy/lib/models/common/widgets/withGroup.ts +2 -0
  344. package/{lib → src/legacy/lib}/models/server/ServerState.ts +4 -3
  345. package/{lib → src/legacy/lib}/utils/index.ts +4 -5
  346. package/{lib → src/legacy/lib}/utils/shared/customTypes.ts +1 -1
  347. package/src/modules/availableCustomTypes/index.ts +15 -13
  348. package/src/modules/availableCustomTypes/types.ts +2 -2
  349. package/src/modules/environment/index.ts +10 -8
  350. package/src/modules/environment/types.ts +1 -1
  351. package/src/modules/loading/index.ts +3 -2
  352. package/src/modules/modal/index.ts +4 -2
  353. package/src/modules/slices/index.ts +13 -9
  354. package/src/modules/slices/selector.ts +1 -1
  355. package/src/modules/slices/types.ts +2 -2
  356. package/src/modules/useSliceMachineActions.ts +25 -20
  357. package/src/modules/userContext/index.ts +5 -3
  358. package/{pages → src/pages}/_app.tsx +23 -25
  359. package/{pages → src/pages}/changelog.tsx +1 -1
  360. package/{pages → src/pages}/changes.tsx +25 -19
  361. package/src/pages/custom-types/[customTypeId].tsx +1 -0
  362. package/{pages → src/pages}/custom-types.tsx +1 -1
  363. package/{pages → src/pages}/index.tsx +3 -3
  364. package/src/pages/labs.tsx +1 -0
  365. package/src/pages/page-types/[pageTypeId].tsx +1 -0
  366. package/src/pages/settings.tsx +1 -0
  367. package/{pages → src/pages}/slices/[lib]/[sliceName]/[variation]/index.tsx +3 -3
  368. package/{pages → src/pages}/slices/[lib]/[sliceName]/[variation]/simulator.tsx +2 -2
  369. package/{pages → src/pages}/slices.tsx +24 -21
  370. package/src/redux/reducer.ts +8 -7
  371. package/src/redux/store.ts +8 -6
  372. package/src/redux/type.ts +7 -6
  373. package/src/theme.ts +1 -2
  374. package/src/utils/getContentTypeForTracking.ts +21 -0
  375. package/test/__setup__.ts +12 -7
  376. package/test/__testutils__/createTestPlugin.ts +3 -2
  377. package/test/__testutils__/createTestProject.ts +5 -4
  378. package/test/__testutils__/index.tsx +6 -5
  379. package/test/__testutils__/mockAWSACLAPI.ts +1 -1
  380. package/test/__testutils__/mockCustomTypesAPI.ts +1 -1
  381. package/test/__testutils__/mockPrismicAuthAPI.ts +1 -1
  382. package/test/__testutils__/mockPrismicUserAPI.ts +2 -3
  383. package/test/__testutils__/readMSWFormData.ts +1 -1
  384. package/test/components/IframeRenderer.test.ts +3 -2
  385. package/test/lib/builders/EditModal.test.tsx +5 -3
  386. package/test/lib/builders/buildersUtils.test.ts +3 -3
  387. package/test/lib/consts.test.ts +6 -2
  388. package/test/lib/models/common/CustomType.test.ts +6 -2
  389. package/test/lib/models/common/ModelStatus.test.ts +6 -4
  390. package/test/lib/models/common/Slice.test.ts +3 -2
  391. package/test/lib/models/common/widgets/index.test.ts +8 -4
  392. package/test/lib/utils/index.test.ts +3 -2
  393. package/test/lib/utils/preferWroomBase.test.ts +3 -2
  394. package/test/lib/utils/shared/customTypes.test.ts +2 -1
  395. package/test/pages/slices.test.tsx +10 -10
  396. package/test/src/modules/__fixtures__/serverState.ts +3 -3
  397. package/test/src/modules/__fixtures__/sliceUtilsFactory.ts +3 -3
  398. package/test/src/modules/availableCustomTypes/index.test.ts +3 -3
  399. package/test/src/modules/environment.test.ts +3 -5
  400. package/test/src/modules/loading.test.ts +3 -3
  401. package/test/src/modules/modal.test.ts +5 -5
  402. package/test/src/modules/slices.test.ts +3 -2
  403. package/test/src/modules/userContext.test.ts +3 -3
  404. package/test/src/normalizers/customType.test.ts +16 -3
  405. package/test/src/utils/fieldNameCreator.test.ts +1 -1
  406. package/tsconfig.json +1 -6
  407. package/vite.config.ts +5 -10
  408. package/components/Forms/RenameVariationModal/RenameVariationModal.css.ts +0 -7
  409. package/components/Navigation/index.css.ts +0 -5
  410. package/lib/builders/SliceBuilder/FieldZones/index.tsx +0 -216
  411. package/lib/models/common/widgets/sliceBuilderArray.ts +0 -31
  412. package/lib/models/common/widgets/withGroup.ts +0 -20
  413. package/out/_next/static/M7hTqxKEI7x7a09i22lAK/_buildManifest.js +0 -1
  414. package/out/_next/static/chunks/18539003-a5a5d48f20a7b261.js +0 -97
  415. package/out/_next/static/chunks/25-792af14760d9df34.js +0 -1
  416. package/out/_next/static/chunks/286-e0950c3083c672e8.js +0 -1
  417. package/out/_next/static/chunks/318-d6f1200138628ec3.js +0 -1
  418. package/out/_next/static/chunks/46-d22d7a121254e31d.js +0 -8
  419. package/out/_next/static/chunks/727-2c302be2def92786.js +0 -1
  420. package/out/_next/static/chunks/799-7b910b896ff60ebe.js +0 -1
  421. package/out/_next/static/chunks/904-c9221a5cb09524e8.js +0 -1
  422. package/out/_next/static/chunks/pages/_app-7c41eb6cdd942b9e.js +0 -436
  423. package/out/_next/static/chunks/pages/changelog-5c9ac93faf0df06b.js +0 -1
  424. package/out/_next/static/chunks/pages/changes-3e4989e09fd412a8.js +0 -1
  425. package/out/_next/static/chunks/pages/custom-types/[customTypeId]-d1a4a07e6b600fa6.js +0 -1
  426. package/out/_next/static/chunks/pages/labs-6f5925cd6cdcee9e.js +0 -1
  427. package/out/_next/static/chunks/pages/page-types/[pageTypeId]-a724ff12ef322020.js +0 -1
  428. package/out/_next/static/chunks/pages/settings-f0620e5b727cda03.js +0 -1
  429. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-01d67e97cb901e46.js +0 -1
  430. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-8d7043e6638d65cd.js +0 -1
  431. package/out/_next/static/chunks/pages/slices-77cff50b1df13579.js +0 -1
  432. package/out/_next/static/css/238631d146c5ed97.css +0 -1
  433. package/out/_next/static/css/72465cc1225f28a2.css +0 -1
  434. package/out/_next/static/css/838fd8bb5a7c32b0.css +0 -1
  435. package/out/_next/static/css/b22c0750c14cc089.css +0 -1
  436. package/out/_next/static/css/be1f49e49a5aa7eb.css +0 -1
  437. package/out/_next/static/css/f8eb526e10bc2441.css +0 -1
  438. package/pages/custom-types/[customTypeId].tsx +0 -1
  439. package/pages/labs.tsx +0 -1
  440. package/pages/page-types/[pageTypeId].tsx +0 -1
  441. package/pages/settings.tsx +0 -1
  442. package/src/components/BlankSlate/BlankSlate.css.ts +0 -96
  443. package/src/components/Breadcrumb/Breadcrumb.css.ts +0 -5
  444. package/src/components/Breadcrumb/Breadcrumb.stories.ts +0 -32
  445. package/src/components/CodeBlock/CodeBlock.css.ts +0 -37
  446. package/src/components/ContentTabs/ContentTabs.css.ts +0 -49
  447. package/src/components/Divider/Divider.css.ts +0 -31
  448. package/src/components/HoverCard/HoverCard.css.ts +0 -105
  449. package/src/components/TextLink/TextLink.css.ts +0 -65
  450. package/src/features/slices/convertLegacySlice/ConvertLegacySliceButton.css.ts +0 -15
  451. package/out/_next/static/{M7hTqxKEI7x7a09i22lAK → aa7R_XjeTBeGJoT6HrJb4}/_ssgManifest.js +0 -0
  452. package/{components → src/legacy/components}/Card/CardBox.tsx +0 -0
  453. package/{components → src/legacy/components}/Card/WithTabs/components.jsx +1 -1
  454. package/{components → src/legacy/components}/Changelog/versionDetails/ReleaseNotesDetails.tsx +1 -1
  455. package/{components → src/legacy/components}/ChangesEmptyState/OfflinePage.tsx +1 -1
  456. package/{components → src/legacy/components}/ChangesEmptyState/index.ts +1 -1
  457. package/{components → src/legacy/components}/ChangesItems/ErrorBanner.tsx +1 -1
  458. package/{components → src/legacy/components}/ChangesItems/index.ts +0 -0
  459. package/{components → src/legacy/components}/ChangesSectionHeader/ChangesSectionHeader.tsx +0 -0
  460. package/{components → src/legacy/components}/ChangesSectionHeader/index.ts +0 -0
  461. package/{components → src/legacy/components}/DeleteDocumentsDrawer/index.tsx +1 -1
  462. package/{components → src/legacy/components}/DropDownSelector/MenuList.tsx +0 -0
  463. package/{components → src/legacy/components}/Flex/index.tsx +0 -0
  464. package/{components → src/legacy/components}/FormFields/index.ts +0 -0
  465. package/{components → src/legacy/components}/Forms/CreateCustomTypeModal/index.tsx +0 -0
  466. package/{components → src/legacy/components}/Forms/CreateSliceModal/index.tsx +0 -0
  467. package/{components → src/legacy/components}/Forms/RenameCustomTypeModal/index.ts +0 -0
  468. package/{components → src/legacy/components}/Forms/RenameSliceModal/index.ts +0 -0
  469. package/{components → src/legacy/components}/Forms/RenameVariationModal/index.ts +0 -0
  470. package/{components → src/legacy/components}/Forms/components/FlexCard.tsx +0 -0
  471. package/{components → src/legacy/components}/Forms/formsTypes.ts +0 -0
  472. package/{components → src/legacy/components}/Grid/index.tsx +0 -0
  473. package/{components → src/legacy/components}/InputDeleteIcon/index.jsx +1 -1
  474. package/{components → src/legacy/components}/ItemHeader/index.tsx +1 -1
  475. package/{components → src/legacy/components}/Li/index.tsx +0 -0
  476. package/{components → src/legacy/components}/ListItem/utils.js +0 -0
  477. package/{components → src/legacy/components}/MissingLibraries/index.tsx +0 -0
  478. package/{components → src/legacy/components}/Navigation/VideoItem.module.css +0 -0
  479. package/{components → src/legacy/components}/ReactTooltipPortal/index.tsx +0 -0
  480. package/{components → src/legacy/components}/ReviewModal/ReviewFormSelect.tsx +1 -1
  481. package/{components → src/legacy/components}/ReviewModal/index.ts +0 -0
  482. package/{components → src/legacy/components}/ScreenshotPreview/index.tsx +1 -1
  483. package/{components → src/legacy/components}/Simulator/components/FullPage/index.tsx +0 -0
  484. package/{components → src/legacy/components}/Simulator/components/Header/links.ts +0 -0
  485. package/{components → src/legacy/components}/SliceMachineIconButton/index.tsx +1 -1
  486. package/{components → src/legacy/components}/SliceMachineModal/index.tsx +1 -1
  487. package/{components → src/legacy/components}/WindowPortal/index.js +0 -0
  488. package/{components → src/legacy/components}/YoutubeEmbed/index.tsx +0 -0
  489. package/{lib → src/legacy/lib}/builders/common/SelectFieldTypeModal/FieldTypeCard.jsx +0 -0
  490. package/{lib → src/legacy/lib}/builders/common/Zone/Card/components/EditItem.jsx +0 -0
  491. package/{lib → src/legacy/lib}/consts.ts +0 -0
  492. package/{lib → src/legacy/lib}/env/sentry.ts +0 -0
  493. package/{lib → src/legacy/lib}/forms/defaults.ts +1 -1
  494. package/{lib → src/legacy/lib}/forms/types.ts +0 -0
  495. package/{lib → src/legacy/lib}/hljs/svelte.ts +0 -0
  496. package/{lib → src/legacy/lib}/models/common/Auth.ts +0 -0
  497. package/{lib → src/legacy/lib}/models/common/ComponentUI.ts +1 -1
  498. package/{lib → src/legacy/lib}/models/common/CustomType/tab.ts +4 -4
  499. package/{lib → src/legacy/lib}/models/common/ErrorWithStatus.ts +0 -0
  500. package/{lib → src/legacy/lib}/models/common/Fields.ts +1 -1
  501. package/{lib → src/legacy/lib}/models/common/Manifest.ts +0 -0
  502. package/{lib → src/legacy/lib}/models/common/PrismicData.ts +0 -0
  503. package/{lib → src/legacy/lib}/models/common/PrismicFile.ts +0 -0
  504. package/{lib → src/legacy/lib}/models/common/Screenshots.ts +0 -0
  505. package/{lib → src/legacy/lib}/models/common/Simulator.ts +0 -0
  506. package/{lib → src/legacy/lib}/models/common/Slices.ts +2 -2
  507. package/{lib → src/legacy/lib}/models/common/UserProfile.ts +0 -0
  508. package/{lib → src/legacy/lib}/models/common/Warning.ts +0 -0
  509. package/{lib → src/legacy/lib}/models/common/widgets/Date/index.ts +2 -2
  510. package/{lib → src/legacy/lib}/models/common/widgets/Embed/index.ts +2 -2
  511. package/{lib → src/legacy/lib}/models/common/widgets/Link/index.ts +3 -3
  512. package/{lib → src/legacy/lib}/models/common/widgets/Number/index.ts +2 -2
  513. package/{lib → src/legacy/lib}/models/common/widgets/Text/index.ts +5 -5
  514. package/{lib → src/legacy/lib}/models/common/widgets/ctBuilderArray.ts +0 -0
  515. package/{lib → src/legacy/lib}/models/common/widgets/index.ts +1 -1
  516. /package/{lib → src/legacy/lib}/prismic/endpoints.ts +0 -0
  517. /package/{lib → src/legacy/lib}/utils/poll.ts +0 -0
  518. /package/{lib → src/legacy/lib}/utils/preferWroomBase.ts +0 -0
  519. /package/{lib → src/legacy/lib}/utils/repo.ts +0 -0
  520. /package/{lib → src/legacy/lib}/utils/str.ts +0 -0
  521. /package/{pages → src/pages}/api/embed.js +0 -0
package/.eslintrc.js CHANGED
@@ -9,7 +9,7 @@ module.exports = {
9
9
  project: ["./tsconfig.json"],
10
10
  tsconfigRootDir: __dirname,
11
11
  },
12
- plugins: ["@typescript-eslint", "import"],
12
+ plugins: ["@typescript-eslint", "simple-import-sort", "import"],
13
13
  extends: [
14
14
  "plugin:react-hooks/recommended",
15
15
  "plugin:@typescript-eslint/recommended",
@@ -30,5 +30,10 @@ module.exports = {
30
30
  ],
31
31
  "@typescript-eslint/prefer-nullish-coalescing": "warn",
32
32
  "@typescript-eslint/strict-boolean-expressions": "warn",
33
+ "simple-import-sort/exports": "warn",
34
+ "simple-import-sort/imports": "warn",
35
+ "import/first": "error",
36
+ "import/newline-after-import": "error",
37
+ "import/no-duplicates": "error",
33
38
  },
34
39
  };
@@ -1,5 +1,6 @@
1
- import { ThemeProvider, TooltipProvider } from "@prismicio/editor-ui";
2
1
  import "@prismicio/editor-ui/style.css";
2
+
3
+ import { ThemeProvider, TooltipProvider } from "@prismicio/editor-ui";
3
4
  import type { Preview } from "@storybook/react";
4
5
 
5
6
  const preview: Preview = {
package/out/404.html CHANGED
@@ -1 +1 @@
1
- <!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/238631d146c5ed97.css" as="style"/><link rel="stylesheet" href="/_next/static/css/238631d146c5ed97.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-c67a75d1b6f99dc8.js"></script><script src="/_next/static/chunks/webpack-2f903acb0cccbf9e.js" defer=""></script><script src="/_next/static/chunks/framework-cdccea7a52cc6e81.js" defer=""></script><script src="/_next/static/chunks/main-5e6780279ca21cb9.js" defer=""></script><script src="/_next/static/chunks/pages/_app-7c41eb6cdd942b9e.js" defer=""></script><script src="/_next/static/chunks/pages/_error-69b4f498bafdd188.js" defer=""></script><script src="/_next/static/M7hTqxKEI7x7a09i22lAK/_buildManifest.js" defer=""></script><script src="/_next/static/M7hTqxKEI7x7a09i22lAK/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":404}},"page":"/_error","query":{},"buildId":"M7hTqxKEI7x7a09i22lAK","runtimeConfig":{"sentryEnvironment":"beta"},"nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
1
+ <!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/c47241940651ef2f.css" as="style"/><link rel="stylesheet" href="/_next/static/css/c47241940651ef2f.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-c67a75d1b6f99dc8.js"></script><script src="/_next/static/chunks/webpack-2f903acb0cccbf9e.js" defer=""></script><script src="/_next/static/chunks/framework-cdccea7a52cc6e81.js" defer=""></script><script src="/_next/static/chunks/main-5e6780279ca21cb9.js" defer=""></script><script src="/_next/static/chunks/pages/_app-d2bb4f9b121e3de8.js" defer=""></script><script src="/_next/static/chunks/pages/_error-69b4f498bafdd188.js" defer=""></script><script src="/_next/static/aa7R_XjeTBeGJoT6HrJb4/_buildManifest.js" defer=""></script><script src="/_next/static/aa7R_XjeTBeGJoT6HrJb4/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":404}},"page":"/_error","query":{},"buildId":"aa7R_XjeTBeGJoT6HrJb4","runtimeConfig":{"sentryEnvironment":"beta"},"nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
@@ -0,0 +1 @@
1
+ self.__BUILD_MANIFEST=function(s,c,a,e,t,i,b,n,d,f,u,h,l,k,j,p,g,o,r){return{__rewrites:{beforeFiles:[],afterFiles:[],fallback:[]},"/":[a,j,p,"static/chunks/pages/index-ccd2975faba412f6.js"],"/_error":["static/chunks/pages/_error-69b4f498bafdd188.js"],"/changelog":[s,e,"static/chunks/870-0c7a8a9622de78b7.js","static/chunks/pages/changelog-042822d12df57669.js"],"/changes":[s,t,"static/chunks/8eec4907-b712959d9f984b68.js",i,"static/chunks/918-5bb55fb464e34768.js",c,n,"static/css/e5745b5b0494af29.css","static/chunks/pages/changes-194f6cf187fa6ee7.js"],"/custom-types":[a,j,p,"static/chunks/pages/custom-types-900b40b54b74e6d6.js"],"/custom-types/[customTypeId]":[s,d,f,u,h,e,b,i,l,g,c,a,k,o,r,"static/chunks/pages/custom-types/[customTypeId]-ff73a06702296c34.js"],"/labs":["static/chunks/pages/labs-7a4fe64cb86b59e8.js"],"/page-types/[pageTypeId]":[s,d,f,u,h,e,b,i,l,g,c,a,k,o,r,"static/chunks/pages/page-types/[pageTypeId]-30d471f6127ebed7.js"],"/settings":["static/css/ca32882a5d2d8d88.css","static/chunks/pages/settings-419384d4d43070c2.js"],"/slices":[s,t,b,c,n,"static/css/321d78460d2d69bc.css","static/chunks/pages/slices-98f88ac46b6ad58b.js"],"/slices/[lib]/[sliceName]/[variation]":[s,t,d,f,u,h,e,b,i,l,c,k,n,"static/css/dc201720b301472d.css","static/chunks/pages/slices/[lib]/[sliceName]/[variation]-afbfff837c3dc4dd.js"],"/slices/[lib]/[sliceName]/[variation]/simulator":[t,"static/chunks/72585f70-28b4d7d5384b3703.js","static/chunks/18539003-8854ec97730b0755.js","static/chunks/756-61dc56b98d01e964.js","static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-9bdb355306fca592.js"],sortedPages:["/","/_app","/_error","/changelog","/changes","/custom-types","/custom-types/[customTypeId]","/labs","/page-types/[pageTypeId]","/settings","/slices","/slices/[lib]/[sliceName]/[variation]","/slices/[lib]/[sliceName]/[variation]/simulator"]}}("static/chunks/59b4e022-7a3b5554b806349f.js","static/chunks/614-873c38acd991869b.js","static/chunks/569-2ae3e9666f3bf991.js","static/chunks/183-6ad1d7303abecd2b.js","static/chunks/c8eae200-966ce352f7b5d2b9.js","static/chunks/543-f8766685f7f451e2.js","static/chunks/50-cfc2514205b86001.js","static/chunks/90-2d4bdae13d031364.js","static/chunks/f36c6662-03bb5e9d9aa0b0aa.js","static/chunks/4c744e84-e3161d754618373f.js","static/chunks/065a3ddb-9a38ca0d60f0bf2f.js","static/chunks/1cc2734a-2c5b6c0367fcde86.js","static/chunks/696-b992b9e1ce75777e.js","static/chunks/96-d28e81d2b1c10a08.js","static/chunks/91-717d764a224ac07f.js","static/css/22f264c93bd9d85f.css","static/chunks/210-aee6116139329803.js","static/chunks/127-6451528762141246.js","static/css/a686f7612f1943ed.css"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[127],{8127:function(e,n,t){"use strict";t.d(n,{H:function(){return nv}});var i=t(52322),r=t(22715),a=t(97729),l=t.n(a),o=t(5632),s=t(2784),c=t(56580),d=t(41730),u=t(91061),f=t(47976),m=t(67445),h=t(76478),v=t(62230),x=t(85244),p=t(98240),y=t(50002),b=t(73844);t(45158);var j="_1k08lzu5 _1ecs97dffi _1ecs97dffk _1ecs97dfft _1ecs97d32 _1ecs97daf _1ecs97dfhd",g=function(e){return(0,i.jsx)("div",(0,x.Z)((0,v.Z)({},e),{className:"_1k08lzu2 _1ecs97dffi _1ecs97dffk _1ecs97dfft _1ecs97d1u _1ecs97d97 _1ecs97d3j4 _1ecs97d3qh _1ecs97dfh9 _1ecs97dfil _1ecs97dfiz _1ecs97dfg9"}))},C=function(e){return(0,i.jsx)("div",(0,x.Z)((0,v.Z)({},e),{className:"_1k08lzu3 _1ecs97dffi _1ecs97dffk _1ecs97dffu _1ecs97dffq _1ecs97dfy4",children:(0,i.jsxs)("div",{className:"_1ecs97dffi _1ecs97dffk _1ecs97dffu _1ecs97dfpl",children:[(0,i.jsx)("span",{className:j}),(0,i.jsx)("span",{className:j}),(0,i.jsx)("span",{className:j})]})}))},_=function(e){return(0,i.jsx)(b.fC,(0,x.Z)((0,v.Z)({},e),{activationMode:"manual",className:"_1k08lzu6 _1ecs97dffi _1ecs97dffk _1ecs97dfft _1ecs97dffv"}))},S=function(e){var n=e.children,t=e.onAddNewTab,a=(0,p.Z)(e,["children","onAddNewTab"]);return(0,i.jsxs)(b.aV,(0,x.Z)((0,v.Z)({},a),{className:"_1k08lzu7 _1ecs97dffi _1ecs97dffk _1ecs97dffu _1ecs97dfg8",children:[n,(0,i.jsx)("div",{className:"_1k08lzuc _1k08lzu8 _1ecs97dffi _1ecs97dffk _1ecs97dffu _1ecs97dffq _1ecs97dfxh _1ecs97d1u _1ecs97d97 _1ecs97dfy1 _1ecs97dfge _1ecs97dfsk",children:(0,i.jsx)(r.hU,{icon:"add",onClick:t,hiddenLabel:"Add new tab"})})]}))},I=function(e){var n=e.children,t=e.menu,a=e.value,l=(0,p.Z)(e,["children","menu","value"]);return(0,i.jsx)(b.xz,(0,x.Z)((0,v.Z)({},l),{"aria-label":a,asChild:!0,onMouseDown:function(e){var n=e.target,t=(0,y.JY)(n);t!==e.currentTarget&&t!==e.currentTarget.parentElement&&e.preventDefault(),n===e.currentTarget&&n.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})},value:a,children:(0,i.jsxs)("div",{className:"_1k08lzu9 _1k08lzu8 _1ecs97dffi _1ecs97dffk _1ecs97dffu _1ecs97dffq _1ecs97dfxh _1ecs97dffj _1ecs97dah2 _1ecs97daof _1ecs97dfkk _1ecs97dfpl _1ecs97dfy4 _1ecs97dfgd",children:[(0,i.jsx)(r.xv,{className:"_1ecs97dfgd _1ecs97dffv",color:"inherit",component:"span",noWrap:!0,variant:"emphasized",children:n}),Boolean(t)?(0,i.jsx)("div",{className:"_1k08lzub _1ecs97dfgd _1ecs97dfh0",children:(0,i.jsxs)(r.h_,{children:[(0,i.jsx)(r.$F,{children:(0,i.jsx)(r.hU,{icon:"moreVert",hiddenLabel:"tab-".concat(a,"-menu-button")})}),(0,i.jsx)(r.AW,{align:"start",children:t})]})}):void 0]})}))},k=function(e){return(0,i.jsx)(b.VY,(0,x.Z)((0,v.Z)({},e),{className:"_1k08lzud _1ecs97dffi _1ecs97d18 _1ecs97d8l _1ecs97dffl _1ecs97dffv"}))},w=t(22710),Z=t(99267),T=t(74217),D=t(82770),N=t(50950),L=t(26921),V=t(90374),M=t(78656),F=(0,s.createContext)(void 0);function A(e){var n=e.children,t=e.initialCustomType,r=(0,s.useState)(t),a=r[0],l=r[1],o=(0,u.y6)(a),c=M.$[o],d=(0,L.c)({errorMessage:c.autoSaveFailed}),f=d.actionQueueStatus,m=d.setNextAction,h=(0,V.Z)().saveCustomTypeSuccess,v=(0,T.R9)(h),x=(0,N.g)().syncChanges,p=(0,s.useCallback)(function(e){l(e),m((0,w.Z)(function(){var n;return(0,Z.__generator)(this,function(t){switch(t.label){case 0:return[4,(0,D.KA)(e)];case 1:if((n=t.sent().errors).length>0)throw n;return v(e),x(),[2]}})}))},[m,v,x]),y=(0,s.useMemo)(function(){return{actionQueueStatus:f,customType:a,setCustomType:p}},[f,a,p]);return(0,i.jsx)(F.Provider,{value:y,children:"function"==typeof n?n(y):n})}function E(){var e=(0,s.useContext)(F);if(!e)throw Error("CustomTypeProvider not found");return e}var z=t(15354),P=t(6134),H=t(63397),B=t(75289),R=function(e){var n=e.name,t=e.label,r=e.placeholder,a=e.error,l=(0,p.Z)(e,["name","label","placeholder","error"]);return(0,i.jsxs)(B.xu,{mb:3,children:[(0,i.jsx)(B.__,{htmlFor:n,mb:2,children:t}),(0,i.jsx)(H.gN,(0,v.Z)({name:n,type:"text",placeholder:r,as:B.II,autoComplete:"off"},l)),a?(0,i.jsx)(B.xv,{sx:{color:"error",mt:1},children:a}):null]})},O=function(e){var n=e.isOpen,t=e.onSubmit,r=e.close,a=e.tabIds;return(0,i.jsx)(P.Z,{isOpen:n,widthInPx:"530px",formId:"create-tab",close:r,onSubmit:function(e){t(e),r()},initialValues:{id:""},validate:function(e){var n=e.id;return n?a.includes(n.toLowerCase())?{id:"Tab exists already"}:void 0:{id:"Tab ID is required"}},content:{title:"Add Tab"},children:function(e){var n=e.errors;return(0,i.jsx)(R,{name:"id",label:"New Tab ID",placeholder:"A label for selecting the tab (i.e. not used in the API)",error:n.id})}})},K=function(e){var n=e.isOpen,t=e.onSubmit,r=e.close;return(0,i.jsx)(P.Z,{omitFooter:!0,isOpen:n,widthInPx:"530px",formId:"create-tab",close:r,cardProps:{bodySx:{p:0}},onSubmit:function(e){t(e),r()},initialValues:{},content:{title:"Remove Tab"},children:function(){return(0,i.jsxs)(B.xu,{sx:{px:4,py:4},children:[(0,i.jsx)(B.X6,{as:"h4",children:"Remove this tab?"}),(0,i.jsx)(B.xv,{as:"p",color:"textClear",sx:{mt:2},children:"This action cannot be undone."}),(0,i.jsx)(B.zx,{type:"button",variant:"buttons.actionDelete",sx:{mt:3},onClick:function(){t({}),r()},children:"Yes, remove tab"})]})}})},U=function(e){var n=e.isOpen,t=e.onSubmit,r=e.close,a=e.tabIds,l=e.initialTabKey;return(0,i.jsx)(P.Z,{omitFooter:!0,isOpen:n,widthInPx:"530px",formId:"create-tab",close:r,cardProps:{bodySx:{p:0}},onSubmit:function(e){t(e),r()},initialValues:{id:l},validate:function(e){var n=e.id;return n?a.includes(n.toLowerCase())?{id:"Tab exists already"}:void 0:{id:"Tab ID is required"}},content:{title:"Rename Tab"},children:function(e){var n=e.errors,a=e.values,l=e.setFieldValue,o=e.isValid;return(0,i.jsxs)(B.xu,{sx:{px:4,py:4},children:[(0,i.jsx)(R,{name:"id",label:"Rename Tab ID",placeholder:"A label for selecting the tab (i.e. not used in the API)",error:n.id,onBlur:function(e){a.id!==e.target.value&&l("id",e.target.value.trim())},onChange:function(e){l("id",e.target.value)}}),(0,i.jsx)(B.zx,{type:"button",sx:{mt:3,width:"100%"},disabled:!o,onClick:function(){a.id&&a.id.length&&t({id:a.id.trim()}),r()},children:"Save"})]})}})},X=t(81541),q=t(28316),W=t(28173),Q=t(8564),Y=t(52586),G=[Y.UID,Y.Group,Y.StructuredText,Y.Image,Y.Link,Y.LinkToMedia,Y.ContentRelationship,Y.Select,Y.Boolean,Y.Date,Y.Timestamp,Y.Embed,Y.Number,Y.GeoPoint,Y.Color,Y.Text,],$=t(13302),J=t(17384),ee=t(9461),en=t(73393),et=t(18645),ei=t(88932),er=t(65077),ea=t(82032),el=function(e){return(0,i.jsxs)("svg",(0,x.Z)((0,v.Z)({width:"127",height:"98",viewBox:"0 0 127 98",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[(0,i.jsx)("path",{d:"M73.5 44.5H85",stroke:"#17151F",strokeLinecap:"round"}),(0,i.jsx)("path",{d:"M35 68.5H40.5H92C93.1046 68.5 94 67.6046 94 66.5V39C94 37.8954 93.1046 37 92 37H35C33.8954 37 33 37.8954 33 39V66.5C33 67.6046 33.8954 68.5 35 68.5Z",fill:"#F4F2F4",stroke:"#17151F"}),(0,i.jsx)("path",{d:"M38 60.5H41.0381H89C89.5523 60.5 90 60.0523 90 59.5V52C90 51.4477 89.5523 51 89 51H38C37.4477 51 37 51.4477 37 52V59.5C37 60.0523 37.4477 60.5 38 60.5Z",fill:"#6E56CF",stroke:"#17151F"}),(0,i.jsx)("circle",{cx:"89.5",cy:"44.5",r:"0.5",fill:"#17151F"}),(0,i.jsx)("path",{d:"M40.5 97.5V56H86V97.5H40.5Z",fill:"#F9F8F9",stroke:"#17151F"}),(0,i.jsx)("rect",{x:"47",y:"75",width:"33",height:"16",fill:"#E4E2E4"}),(0,i.jsx)("path",{d:"M48 57H52V70C52 71.1046 51.1046 72 50 72V72C48.8954 72 48 71.1046 48 70V57Z",fill:"#E4E2E4"}),(0,i.jsx)("path",{d:"M55 57H59V70C59 71.1046 58.1046 72 57 72V72C55.8954 72 55 71.1046 55 70V57Z",fill:"#E4E2E4"}),(0,i.jsx)("path",{d:"M62 57H66V70C66 71.1046 65.1046 72 64 72V72C62.8954 72 62 71.1046 62 70V57Z",fill:"#E4E2E4"}),(0,i.jsx)("line",{x1:"0.353553",y1:"35.9856",x2:"15.5467",y2:"51.1787",stroke:"#C8C7CB"}),(0,i.jsx)("line",{x1:"42.1959",y1:"0.87059",x2:"47.7569",y2:"21.6248",stroke:"#C8C7CB"}),(0,i.jsx)("line",{x1:"99.5522",y1:"8.4091",x2:"87.2281",y2:"26.0097",stroke:"#C8C7CB"}),(0,i.jsx)("line",{x1:"126.408",y1:"41.0849",x2:"108.807",y2:"53.4089",stroke:"#C8C7CB"}),(0,i.jsx)("path",{d:"M39.8713 47C38.7657 47 38.0627 46.4554 38.0033 45.6337L38 45.5875H38.8251L38.8284 45.6205C38.868 46.0198 39.2937 46.2838 39.8977 46.2838C40.4719 46.2838 40.8746 46 40.8746 45.5908V45.5875C40.8746 45.2442 40.6271 45.0363 40.0132 44.9043L39.5017 44.7987C38.5281 44.5941 38.1056 44.1386 38.1056 43.429V43.4257C38.1056 42.5743 38.8383 42 39.868 42C40.9241 42 41.5809 42.5776 41.6403 43.3432L41.6436 43.3861H40.8284L40.8218 43.3465C40.7624 42.9769 40.4092 42.7129 39.8647 42.7162C39.3366 42.7162 38.9604 42.9637 38.9604 43.3696V43.3729C38.9604 43.7096 39.2013 43.9208 39.7954 44.0462L40.3069 44.1551C41.3102 44.3663 41.7294 44.769 41.7294 45.4884V45.4917C41.7294 46.4191 41.0132 47 39.8713 47Z",fill:"black"}),(0,i.jsx)("path",{d:"M42.6865 46.8812V42.1188H43.6634L45.0957 45.7822H45.1518L46.5809 42.1188H47.5578V46.8812H46.7921V43.495H46.7327L45.4125 46.8812H44.8317L43.5116 43.495H43.4554V46.8812H42.6865Z",fill:"black"})]}))},eo=function(e){var n=e.openCreateSliceModal,t=e.openUpdateSliceZoneModal,a=e.openSlicesTemplatesModal,l=e.projectHasAvailableSlices,o=e.isSlicesTemplatesSupported;return(0,i.jsx)(r.xu,{flexGrow:1,justifyContent:"center","data-testid":"slice-zone-blank-slate",children:(0,i.jsx)(ea.R$,{backgroundImage:"/blank-slate-slice-zone.png",children:(0,i.jsxs)(ea.T9,{children:[(0,i.jsx)(r.xu,{justifyContent:"center",padding:{bottom:16},children:(0,i.jsx)(el,{})}),(0,i.jsx)(ea._T,{children:"Add slices"}),(0,i.jsx)(ea.nf,{children:"Slices are website sections that you can reuse on different pages with different content. Each slice has its own component in your code."}),(0,i.jsx)(ea.Qj,{children:(0,i.jsxs)(r.S0,{children:[(0,i.jsx)(r.F8,{startIcon:"add",onClick:n,description:"Start from scratch.",children:"Create new"}),o?(0,i.jsx)(r.F8,{startIcon:"contentCopy",onClick:a,description:"Select from premade examples.",endAdornment:(0,i.jsx)(r.Ct,{color:"purple",title:"New"}),children:"Use template"}):void 0,l?(0,i.jsx)(r.F8,{startIcon:"folder",onClick:t,description:"Select from your own slices.",children:"Select existing"}):void 0]})})]})})})};function es(e){var n=e.customType,t=e.tabId,i=e.slices,r=(0,v.Z)({},n);return i.forEach(function(e){r=(0,x.Z)((0,v.Z)({},r),{tabs:r.tabs.map(function(n){return n.key===t&&n.sliceZone?(0,x.Z)((0,v.Z)({},n),{sliceZone:{key:n.sliceZone.key,value:[{key:e.id,value:e},].concat((0,X.Z)(n.sliceZone.value))}}):n})})}),D.Xe.track({event:"custom-type:slice-zone-updated",customTypeId:n.id}),r}var ec=t(17064),ed=t(18566),eu=t(81038);function ef(){return em.apply(this,arguments)}function em(){return(em=(0,w.Z)(function(){var e,n,t;return(0,Z.__generator)(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,eu.j.sliceTemplateLibrary.readLibrary({})];case 1:if(n=(e=i.sent()).templates,(t=e.errors).length>0)throw t;return[2,n.map(function(e){return{model:e.model,screenshots:Object.fromEntries(Object.entries(e.screenshots).map(function(e){var n=(0,ec.Z)(e,2),t=n[0],i=n[1];return[t,URL.createObjectURL(i),]}))}})];case 2:return i.sent(),[2,[]];case 3:return[2]}})})).apply(this,arguments)}var eh=t(56054),ev=t(6777),ex=t(95200),ep=t(34226),ey=t(98898),eb=t(83399),ej=function(e){var n=e.deleteSliceZone,t=e.closeDeleteSliceZoneModal;return(0,i.jsx)(eb.Z,{isOpen:!0,shouldCloseOnOverlayClick:!0,style:{content:{maxWidth:612}},onRequestClose:t,children:(0,i.jsx)(ey.Z,{bodySx:{p:0,bg:"white",position:"relative",height:"100%",padding:16},footerSx:{position:"sticky",bottom:0,p:0},sx:{border:"none",overflow:"hidden"},borderFooter:!0,Header:function(){return(0,i.jsxs)(B.kC,{sx:{position:"sticky",top:0,zIndex:1,p:"16px",alignItems:"center",justifyContent:"space-between",borderBottom:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.borders))}},children:[(0,i.jsx)(B.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:"Do you really want to delete Slice Zone?"}),(0,i.jsx)(B.x8,{type:"button",onClick:t})]})},Footer:function(){return(0,i.jsxs)(B.kC,{sx:{justifyContent:"flex-end",height:64,alignItems:"center",paddingRight:16,borderTop:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.darkBorders))},backgroundColor:"gray"},children:[(0,i.jsx)(ep.z,{label:"Cancel",variant:"secondary",onClick:t,sx:{mr:"10px",fontWeight:"bold",color:"grey12",borderRadius:6}}),(0,i.jsx)(ep.z,{label:"Delete",variant:"danger",onClick:n,sx:{minHeight:39,minWidth:78}})]})},children:(0,i.jsx)(B.nv,{children:"You're about to delete Slice Zone."})})})},eg=t(63269),eC=t(24804),e_=t(5479),eS=t(98235),eI=t(86251),ek=t.n(eI),ew=function(e){var n,t=e.isOpen,a=e.close,l=e.onSubmit,o=e.isLoading,s=e.slice,d=e.libraries,u=(0,c.v9)(function(e){return{remoteSlices:(0,ex.sT)(e)}}).remoteSlices;return(0,i.jsxs)(r.Vq,{open:t,onOpenChange:function(e){return!e&&a()},size:{width:448,height:"auto"},children:[(0,i.jsx)(r.fK,{title:"Upgrade slice"}),(0,i.jsx)(r.cZ,{children:(0,i.jsx)(H.J9,{validateOnMount:!0,initialValues:{from:null===(n=d[0])||void 0===n?void 0:n.name,sliceName:(0,J.MP)(s.key)},validate:function(e){return(0,eS.h)(e,d,u)},onSubmit:function(e){l({libraryID:e.from,sliceID:e.sliceName})},children:function(e){return(0,i.jsx)("form",{id:"convert-legacy-slice-as-new-slice-dialog",children:(0,i.jsxs)(r.xu,{flexDirection:"column",children:[(0,i.jsxs)(r.xr,{className:ek().scrollArea,style:{width:448},children:[(0,i.jsx)(r.xv,{variant:"normal",color:"grey11",children:"This will create a new slice with the same fields. The new slice will replace the legacy slice in all of your types, and the existing slice content will be re-mapped to the new slice."}),(0,i.jsx)(r.xv,{variant:"normal",color:"grey11",children:"This will not migrate your component. You will need to do that manually."}),(0,i.jsxs)(r.xu,{flexDirection:"column",gap:4,children:[(0,i.jsxs)("label",{className:ek().label,children:[(0,i.jsx)(r.xv,{variant:"bold",children:"Display name*"}),"string"==typeof e.errors.sliceName?(0,i.jsx)(r.xv,{variant:"small",color:"tomato10",children:e.errors.sliceName}):null]}),(0,i.jsx)(r.yt,{placeholder:"Pascalised Slice API ID (e.g. ".concat((0,J.MP)(s.key),")"),error:"string"==typeof e.errors.sliceName,value:e.values.sliceName,onValueChange:function(n){e.setFieldValue("sliceName",n.slice(0,30))},"data-testid":"slice-name-input"}),(0,i.jsx)(r.xv,{variant:"normal",color:"grey11",children:"A display name for the slice"})]}),(0,i.jsxs)(r.xu,{flexDirection:"column",gap:4,children:[(0,i.jsxs)("label",{className:ek().label,children:[(0,i.jsx)(r.xv,{variant:"bold",children:"Slice library*"}),"string"==typeof e.errors.from?(0,i.jsx)(r.xv,{variant:"small",color:"tomato10",children:e.errors.from}):null]}),(0,i.jsx)(r.Ph,{size:"medium",color:"grey",startIcon:"folder",flexContent:!0,value:e.values.from,onValueChange:function(n){return n?void e.setFieldValue("from",n):null},children:d.map(function(e){return(0,i.jsx)(r.Ql,{value:e.name,children:e.name},e.name)})}),(0,i.jsx)(r.xv,{variant:"normal",color:"grey11",children:"The library where we'll store your slice"})]})]}),(0,i.jsx)(r.kX,{ok:{text:"Upgrade",onClick:function(){e.submitForm()},loading:o,disabled:!e.isValid},cancel:{text:"Cancel"},size:"medium"})]})})}})})]})},eZ=t(76635),eT=function(e){var n,t,a=e.isOpen,l=e.close,o=e.onSubmit,c=e.isLoading,d=e.slice,u=e.sliceName,f=e.libraries,m=e.localSharedSlices,h=(0,s.useState)(!0),p=h[0],y=h[1];return(0,i.jsxs)(r.Vq,{open:a,onOpenChange:function(e){return!e&&l()},size:{width:448,height:"auto"},children:[(0,i.jsx)(r.fK,{title:"Convert to slice variation"}),(0,i.jsx)(r.cZ,{children:(0,i.jsx)(H.J9,{initialValues:{libraryID:null===(n=m[0])||void 0===n?void 0:n.from,sliceID:null===(t=m[0])||void 0===t?void 0:t.model.id,variationID:(0,eZ.camelCase)(d.key),variationName:u},validate:function(e){return eD(e,f)},onSubmit:function(e){o(e)},children:function(e){return(0,i.jsx)("form",{id:"convert-legacy-slice-as-new-variation-dialog",children:(0,i.jsxs)(r.xu,{display:"flex",flexDirection:"column",children:[(0,i.jsxs)(r.xr,{className:ek().scrollArea,style:{width:448},children:[(0,i.jsx)(r.xv,{variant:"normal",color:"grey11",children:"If you have multiple slices that are similar, you can combine them as variations of the same slice."}),(0,i.jsxs)(r.xu,{display:"flex",flexDirection:"column",gap:4,children:[(0,i.jsxs)("label",{className:ek().label,children:[(0,i.jsx)(r.xv,{variant:"bold",children:"Target slice*"}),"string"==typeof e.errors.libraryID?(0,i.jsx)(r.xv,{variant:"small",color:"tomato10",children:e.errors.libraryID}):null,"string"==typeof e.errors.sliceID?(0,i.jsx)(r.xv,{variant:"small",color:"tomato10",children:e.errors.sliceID}):null]}),(0,i.jsx)(r.Ph,{size:"medium",color:"grey",startIcon:"viewDay",flexContent:!0,value:"".concat(e.values.libraryID,"::").concat(e.values.sliceID),onValueChange:function(n){if(n){var t=(0,ec.Z)(n.split("::"),2),i=t[0],r=t[1];e.setFieldValue("libraryID",i),e.setFieldValue("sliceID",r)}},children:m.map(function(e){return(0,i.jsxs)(r.Ql,{value:"".concat(e.from,"::").concat(e.model.id),children:[e.from," ",">"," ",e.model.name," (",e.model.id,")"]},"".concat(e.from,"::").concat(e.model.id))})}),(0,i.jsx)(r.xv,{variant:"normal",color:"grey11",children:"Choose the slice to which you would like to add this variation."})]}),(0,i.jsxs)(r.xu,{display:"flex",flexDirection:"column",gap:4,children:[(0,i.jsxs)("label",{className:ek().label,children:[(0,i.jsx)(r.xv,{variant:"bold",children:"Variation name*"}),"string"==typeof e.errors.variationName?(0,i.jsx)(r.xv,{variant:"small",color:"tomato10",children:e.errors.variationName}):null]}),(0,i.jsx)(r.yt,{placeholder:u,error:"string"==typeof e.errors.variationName,value:e.values.variationName,onValueChange:function(n){var t=(0,x.Z)((0,v.Z)({},e.values),{variationName:n.slice(0,30)});p&&(t.variationID=(0,eZ.camelCase)(t.variationName)),e.setValues(t,!0)},"data-testid":"variation-name-input"})]}),(0,i.jsxs)(r.xu,{display:"flex",flexDirection:"column",gap:4,children:[(0,i.jsxs)("label",{className:ek().label,children:[(0,i.jsx)(r.xv,{variant:"bold",children:"ID*"}),"string"==typeof e.errors.variationID?(0,i.jsx)(r.xv,{variant:"small",color:"tomato10",children:e.errors.variationID}):null]}),(0,i.jsx)(r.yt,{placeholder:(0,eZ.camelCase)(d.key),error:"string"==typeof e.errors.variationID,value:e.values.variationID,onValueChange:function(n){y(!1),e.setFieldValue("variationID",(0,eZ.camelCase)(n.slice(0,30)))},"data-testid":"variation-id-input"})]})]}),(0,i.jsx)(r.kX,{ok:{text:"Convert",onClick:function(){e.submitForm()},loading:c,disabled:!e.isValid},cancel:{text:"Cancel"},size:"medium"})]})})}})})]})},eD=function(e,n){var t,i={};e.libraryID||(i.libraryID="Cannot be empty.");var r=n.find(function(n){return n.path===e.libraryID});i.libraryID||r||(i.libraryID="Does not exist."),e.sliceID||(i.sliceID="Cannot be empty.");var a=null==r?void 0:r.components.find(function(n){return n.model.id===e.sliceID});return(i.sliceID||a||(i.sliceID="Does not exist."),e.variationName||(i.variationName="Cannot be empty."),e.variationID)?(null!==(t=null==a?void 0:a.model.variations.map(function(e){return e.id}))&&void 0!==t?t:[]).includes(e.variationID)&&(i.variationID="Slice variation ID is already taken."):i.variationID="Cannot be empty.",i},eN=function(e){var n,t,a=e.isOpen,l=e.close,o=e.onSubmit,s=e.isLoading,c=e.identicalSlices;return(0,i.jsxs)(r.Vq,{open:a,onOpenChange:function(e){return!e&&l()},size:{width:448,height:"auto"},children:[(0,i.jsx)(r.fK,{title:"Merge with an existing slice"}),(0,i.jsx)(r.cZ,{children:(0,i.jsx)(H.J9,{initialValues:{path:null!==(t=null===(n=c[0])||void 0===n?void 0:n.path)&&void 0!==t?t:""},validate:function(e){if(!e.path)return{path:"Cannot be empty."}},onSubmit:function(e){var n,t=(0,ec.Z)(e.path.split("::"),3),i=t[0];o({libraryID:i,sliceID:t[1],variationID:t[2]})},children:function(e){return(0,i.jsx)("form",{id:"convert-legacy-slice-merge-with-identical-dialog",children:(0,i.jsxs)(r.xu,{display:"flex",flexDirection:"column",children:[(0,i.jsxs)(r.xr,{className:ek().scrollArea,children:[(0,i.jsx)(r.xv,{variant:"normal",color:"grey11",children:"If you have multiple identical slices, you can merge them. All of your content will be remapped to the target slice."}),(0,i.jsxs)(r.xu,{display:"flex",flexDirection:"column",gap:4,children:[(0,i.jsxs)("label",{className:ek().label,children:[(0,i.jsx)(r.xv,{variant:"bold",children:"Target slice*"}),"string"==typeof e.errors.path?(0,i.jsx)(r.xv,{variant:"small",color:"tomato10",children:e.errors.path}):null]}),(0,i.jsx)(r.Ph,{size:"medium",color:"grey",startIcon:"viewDay",flexContent:!0,value:e.values.path,onValueChange:function(n){n&&e.setFieldValue("path",n)},children:c.map(function(e){return(0,i.jsx)(r.Ql,{value:e.path,children:e.path.split("::").join(" > ")},e.path)})}),(0,i.jsx)(r.xv,{variant:"normal",color:"grey11",children:"Choose a slice that you would like to merge this into."})]})]}),(0,i.jsx)(r.kX,{ok:{text:"Merge",onClick:function(){e.submitForm()},loading:s,disabled:!e.isValid},cancel:{text:"Cancel"},size:"medium"})]})})}})})]})},eL=function(e){var n,t,a=e.slice,l=e.path,o=(0,V.Z)().refreshState,d=(0,s.useState)(!1),u=d[0],f=d[1],m=(0,s.useState)(),h=m[0],p=m[1],y=E().setCustomType,b=(0,c.v9)(function(e){return{libraries:(0,ex.Sd)(e)}}).libraries,j="Slice"===a.value.type&&null!==(n=a.value.fieldset)&&void 0!==n?n:a.key,g=b.filter(function(e){return e.isLocal}),C=g.map(function(e){return e.components}).flat(),_=eV(a,j,C),S=(t=(0,w.Z)(function(e){var n,t,i,r,s,c,d,u;return(0,Z.__generator)(this,function(u){switch(u.label){case 0:if(!h)return[2];return f(!0),D.Xe.track({event:"legacy-slice:converted",id:e.sliceID,variation:null!==(n=e.variationID)&&void 0!==n?n:"default",library:e.libraryID,conversionType:h}),[4,eu.j.slices.convertLegacySliceToSharedSlice({model:a.value,src:(0,x.Z)((0,v.Z)({},l),{sliceID:a.key}),dest:{libraryID:e.libraryID,sliceID:e.sliceID,variationName:null!==(t=e.variationName)&&void 0!==t?t:"Default",variationID:null!==(i=e.variationID)&&void 0!==i?i:"default"}})];case 1:if((r=u.sent().errors).length)throw console.error("Could not convert slice `".concat(j,"`"),r),ei.Am.error("Could not convert slice `".concat(j,"`")),r;return[4,eu.j.customTypes.readCustomType({id:l.customTypeID})];case 2:if(c=(s=u.sent()).model,(d=s.errors).length||!c)return console.error("Could not refresh custom type view `".concat(l.customTypeID,"`"),d),ei.Am.error("Could not refresh custom type view `".concat(l.customTypeID,"`")),[2];return[4,(0,D.y0)()];case 3:switch(o(u.sent()),f(!1),p(void 0),h){case"as_new_slice":ei.Am.success("".concat(j," has been upgraded to a new slice ").concat(e.libraryID," > ").concat(e.sliceID));break;case"as_new_variation":ei.Am.success("".concat(j," has been converted as a variation of ").concat(e.libraryID," > ").concat(e.sliceID));break;default:ei.Am.success("".concat(j," has been merged with ").concat(e.libraryID," > ").concat(e.sliceID))}return y(c),[2]}})}),function(e){return t.apply(this,arguments)}),I={path:l,slice:a,sliceName:j,libraries:g,localSharedSlices:C,identicalSlices:_,close:function(){return p(void 0)},onSubmit:S,isLoading:u};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(r.h_,{children:[(0,i.jsx)(r.$F,{children:(0,i.jsx)(r.zx,{"data-testid":"convert-legacy-slice",startIcon:"refresh",endIcon:"arrowDropDown",size:"medium",color:"grey",children:"Migrate legacy slice"})}),(0,i.jsxs)(r.AW,{align:"start",children:[(0,i.jsx)(r.Xi,{startIcon:(0,i.jsx)(r.I5,{name:"folder",size:"large"}),description:"Use it with new types",onSelect:function(){return p("as_new_slice")},children:"Upgrade slice"}),(0,i.jsx)(r.Xi,{startIcon:(0,i.jsx)(r.I5,{name:"viewDay",size:"large"}),description:"Add it to another slice",onSelect:function(){return p("as_new_variation")},disabled:!C.length,children:"Convert to slice variation"}),(0,i.jsx)(r.Xi,{startIcon:(0,i.jsx)(r.I5,{name:"driveFileMove",size:"large"}),description:"Combine identical slices",onSelect:function(){return p("merge_with_identical")},disabled:!_.length,children:"Merge with another slice"})]})]}),(0,i.jsx)(ew,(0,x.Z)((0,v.Z)({},I),{isOpen:"as_new_slice"===h})),(0,i.jsx)(eT,(0,x.Z)((0,v.Z)({},I),{isOpen:"as_new_variation"===h})),(0,i.jsx)(eN,(0,x.Z)((0,v.Z)({},I),{isOpen:"merge_with_identical"===h}))]})},eV=function(e,n,t){return(0,s.useMemo)(function(){var i=[],r=(0,e_.ux)(e.value,n),a=!0,l=!1,o=void 0;try{for(var s,c=t[Symbol.iterator]();!(a=(s=c.next()).done);a=!0){var d=s.value,u=!0,f=!1,m=void 0;try{for(var h,v=d.model.variations[Symbol.iterator]();!(u=(h=v.next()).done);u=!0){var x=h.value,p=(0,e_.ux)(x,d.model.name);r.primary===p.primary&&r.items===p.items&&i.push({libraryID:d.from,sliceID:d.model.id,variationID:x.id,path:"".concat(d.from,"::").concat(d.model.id,"::").concat(x.id)})}}catch(y){f=!0,m=y}finally{try{u||null==v.return||v.return()}finally{if(f)throw m}}}}catch(b){l=!0,o=b}finally{try{a||null==c.return||c.return()}finally{if(l)throw o}}return i},[e,n,t])},eM=function(e){var n=e.slice,t=e.path,a=(0,ec.Z)((0,eg.E)("legacySliceUpgrader"),1)[0],l=a.enabled?"This Slice was created with the Legacy Builder. It needs to be converted first to be used within Slice Machine.":"This Slice was created with the Legacy Builder, and is incompatible with Slice Machine. You cannot edit, push, or delete it in Slice Machine. In order to proceed, manually remove the Slice from your type model. Then create a new Slice with the same fields using Slice Machine.";return(0,i.jsxs)(eC.Zb,{children:[(0,i.jsx)(eC.ZB,{component:"div",children:(0,i.jsx)(r.xu,{alignItems:"center",justifyContent:"center",children:(0,i.jsx)(r.xv,{color:"grey11",component:"span",children:"No screenshot available"})})}),(0,i.jsxs)(eC.T$,{children:[(0,i.jsx)(r.u,{content:l,side:"bottom",children:(0,i.jsx)(r.Ct,{color:"purple",title:"Legacy Slice"})}),a.enabled?(0,i.jsx)(eL,{slice:n,path:t}):null]}),(0,i.jsx)(eC.eW,{subtitle:"1 variation",title:(0,e_.Dj)(n.value)})]})},eF=t(56319),eA=t(53420),eE=function(e){var n=e.slices,t=e.format,r=e.path,a=e.onRemoveSharedSlice,l=n.some(function(e){return"SharedSlice"!==e.type}),o=M.$[t],c=(0,ec.Z)((0,eg.E)("legacySliceUpgrader"),1)[0];return(0,s.useEffect)(function(){l&&(c.enabled?ei.Am.info("This ".concat(o.name({start:!1,plural:!1})," contains legacy slices that can be upgraded.")):ei.Am.warning("This ".concat(o.name({start:!1,plural:!1})," contains slices that are incompatible.")))},[l]),(0,i.jsx)(eA.Z,{elems:n,defineElementKey:function(e){return"SharedSlice"!==e.type?e.payload.key:e.payload.model.name},renderElem:function(e){if("SharedSlice"!==e.type){var n=e.payload;return(0,i.jsx)(eM,{slice:n,path:r})}var t=e.payload;return(0,i.jsx)(eF.b,{action:{type:"remove",onRemove:function(){a(t.model.id)}},mode:"navigation",slice:t,variant:"solid"})},sx:{padding:"16px"}})},ez=t(67557);function eP(){return(eP=(0,w.Z)(function(e){var n,t,i,r,a,l,o,s;return(0,Z.__generator)(this,function(c){switch(c.label){case 0:return c.trys.push([0,3,,4]),n=e.templateIDs,t=e.localLibrariesNames,i=e.onSuccess,[4,eu.j.sliceTemplateLibrary.createSlices({templateIDs:n})];case 1:if(a=(r=c.sent()).data,(l=r.errors).length>0||void 0===a)throw l;return a.sliceIDs.forEach(function(e,i){D.Xe.track({event:"slice:created",id:e,name:e,library:t[0],sliceTemplate:n[i]})}),[4,i(a.sliceIDs)];case 2:return c.sent(),[3,4];case 3:return o=c.sent(),s="Internal Error: Slice(s) not created",console.error(s,o),ei.Am.error(s),[3,4];case 4:return[2]}})})).apply(this,arguments)}var eH=t(23373),eB=[{extension:"",fileName:"",from:"",href:"",pathToSlice:"",model:{id:"video_highlights",name:"VideoHighlights",type:"SharedSlice",variations:[{description:"",docURL:"",id:"default",name:"Default",version:"sktwi1xtmkfgx8626"},]},screenshots:{default:{url:"/videoHighlights.png"}}},],eR=function(e){var n=e.availableSlices,t=e.values,r=e.placeholderSlices;return(0,i.jsx)(H.F2,{name:"sliceKeys",render:function(e){return(0,i.jsx)(eA.Z,{gridTemplateMinPx:"200px",elems:n,defineElementKey:function(e){return"".concat(e.from,"-").concat(e.model.name)},renderElem:function(n){var a,l=null!==(a=null==r?void 0:r.some(function(e){return e.model.id===n.model.id}))&&void 0!==a&&a,o=t.sliceKeys.includes(n.model.id);return(0,i.jsx)(eF.b,{action:{type:"checkbox"},isComingSoon:l,mode:"selection",onSelectedChange:function(i){i?e.push(n.model.id):e.remove(t.sliceKeys.indexOf(n.model.id))},selected:o,slice:n,variant:"outlined"})}})}})},eO=function(e){var n=e.formId,t=e.close,r=e.onSuccess,a=e.availableSlicesTemplates,l=e.localLibraries,o=(0,V.Z)().createSliceSuccess;return(0,i.jsx)(P.Z,{isOpen:!0,buttonLabel:"Add",formId:n,close:t,onSubmit:function(e){var n;!function(e){return eP.apply(this,arguments)}({templateIDs:e.sliceKeys,localLibrariesNames:l.map(function(e){return e.name}),onSuccess:(n=(0,w.Z)(function(e){var n,t;return(0,Z.__generator)(this,function(n){switch(n.label){case 0:return[4,(0,D.y0)()];case 1:var t;return o(n.sent().libraries),[4,Promise.all(e.map((t=(0,w.Z)(function(e){var n;return(0,Z.__generator)(this,function(n){switch(n.label){case 0:return[4,eu.j.slices.readSlice({libraryID:l[0].name,sliceID:e})];case 1:return[2,n.sent().model]}})}),function(e){return t.apply(this,arguments)})).filter(function(e){return void 0!==e}))];case 2:return r(n.sent()),[2]}})}),function(e){return n.apply(this,arguments)})})},initialValues:{sliceKeys:[]},content:{title:"Use template slices"},validate:function(e){if(0===e.sliceKeys.length)return{sliceKeys:"Select at least one template to add"}},actionMessage:function(e){var n=e.errors;return void 0!==n.sliceKeys?(0,i.jsx)(B.xv,{sx:{color:"error"},children:n.sliceKeys}):void 0},children:function(e){var n=e.values;return(0,i.jsx)(eR,{values:n,placeholderSlices:eB,availableSlices:(0,X.Z)(a.map(function(e){return{extension:"",fileName:"",from:"",href:"",pathToSlice:"",model:eH.id.toSM(e.model),screenshots:Object.entries(e.screenshots).reduce(function(e,n){return(0,x.Z)((0,v.Z)({},e),(0,ez.Z)({},n[0],{url:n[1]}))},{})}})).concat((0,X.Z)(eB))})}})},eK=function(e){var n=e.formId,t=e.close,r=e.onSubmit,a=e.availableSlices;return(0,i.jsx)(P.Z,{isOpen:!0,buttonLabel:"Add",formId:n,close:t,onSubmit:function(e){r(e.sliceKeys.map(function(e){var n;return null===(n=a.find(function(n){return n.model.id===e}))||void 0===n?void 0:n.model}).filter(function(e){return void 0!==e}))},initialValues:{sliceKeys:[]},content:{title:"Select existing slices"},testId:"update-slices-modal",validate:function(e){if(0===e.sliceKeys.length)return{sliceKeys:"Select at least one slice to add"}},actionMessage:function(e){var n=e.errors;return void 0!==n.sliceKeys?(0,i.jsx)(B.xv,{sx:{color:"error"},children:n.sliceKeys}):void 0},children:function(e){var n=e.values;return(0,i.jsx)(eR,{values:n,availableSlices:a})}})},eU=function(e,n){var t,i=(n||[]).reduce(function(e,n){return(0,X.Z)(e).concat((0,X.Z)(n.components))},[]),r=e.value.reduce(function(e,n){var t=n.key,r=n.value;if("SharedSlice"===r.type){var a=i.find(function(e){return e.model.id===t});return a?(0,x.Z)((0,v.Z)({},e),{slicesInSliceZone:(0,X.Z)(e.slicesInSliceZone).concat([{type:"SharedSlice",payload:a},])}):(0,x.Z)((0,v.Z)({},e),{notFound:(0,X.Z)(e.notFound).concat([{key:t}])})}return(0,x.Z)((0,v.Z)({},e),{slicesInSliceZone:(0,X.Z)(e.slicesInSliceZone).concat([{type:"Slice",payload:{key:t,value:r}},])})},{slicesInSliceZone:[],notFound:[]});return{availableSlices:i,slicesInSliceZone:r.slicesInSliceZone,notFound:r.notFound}},eX=function(e){var n,t=e.customType,a=e.onCreateSliceZone,l=e.onDeleteSliceZone,d=e.onRemoveSharedSlice,u=e.sliceZone,f=e.tabId,m=(0,o.useRouter)(),h=m.query,v=m.replace,x=m.pathname,p=(0,ed.QT)(ef,[]),y=(0,s.useState)(!1),b=y[0],j=y[1],g=(0,s.useState)(!1),C=g[0],_=g[1],S=(0,s.useState)(!1),I=S[0],k=S[1],w=(0,c.v9)(function(e){return{remoteSlices:(0,ex.sT)(e),libraries:(0,ex.Sd)(e),slices:(0,ex.xC)(e)}}),Z=w.remoteSlices,T=w.libraries,N=E().setCustomType,L=T.filter(function(e){return e.isLocal}),V=(0,s.useMemo)(function(){return u?eU(u,T):{availableSlices:[],slicesInSliceZone:[],notFound:[]}},[u,T]),M=V.availableSlices,F=V.slicesInSliceZone,A=V.notFound,P=(0,s.useState)(!1),H=P[0],B=P[1];(0,s.useEffect)(function(){(null==A?void 0:A.length)&&A.forEach(function(e){d(e.key)})},[A]);var R=F.filter(function(e){return"SharedSlice"===e.type}).map(function(e){return e.payload}),O=M.filter(function(e){return!R.some(function(n){return n.model.id===e.model.id})}),K=function(){_(!0)},U=function(){k(!0)},X=function(){j(!0),D.Xe.track({event:"custom-type:open-add-from-templates",customTypeId:t.id,customTypeFormat:t.format})},q=function(){"true"===h.newPageType&&v({pathname:x,query:{pageTypeId:h.pageTypeId}},void 0,{shallow:!0})},Q=function(){_(!1)},Y=function(){k(!1)},G=function(){j(!1)};return(0,i.jsxs)(i.Fragment,{children:[void 0===h.newPageType?(0,i.jsx)(W.Bu,{actions:u?(0,i.jsxs)(r.h_,{children:[(0,i.jsx)(r.$F,{children:(0,i.jsx)(r.zx,{color:"grey",startIcon:"add",children:"Add slices"})}),(0,i.jsxs)(r.AW,{align:"end",children:[(0,i.jsx)(r.Xi,{startIcon:(0,i.jsx)(r.I5,{name:"add",size:"large"}),onSelect:U,description:"Start from scratch.",children:"Create new"}),p.length>0?(0,i.jsx)(r.Xi,{onSelect:X,startIcon:(0,i.jsx)(r.I5,{name:"contentCopy",size:"large"}),description:"Select from premade examples.",shortcut:(0,i.jsx)(r.Ct,{color:"purple",title:"New"}),children:"Use template"}):void 0,O.length>0?(0,i.jsx)(r.Xi,{onSelect:K,startIcon:(0,i.jsx)(r.I5,{name:"folder",size:"large"}),description:"Select from your own slices.",children:"Select existing"}):void 0]})]}):void 0,toggle:"page"!==t.format||"Main"!==f?(0,i.jsx)(r.rs,{checked:!!u,onCheckedChange:function(e){e?a():B(!0)},size:"small","data-testid":"slice-zone-switch"}):void 0,children:"Slice Zone"}):void 0,u?F.length>0?(0,i.jsx)(er.xR,{children:(0,i.jsx)(eE,{slices:F,format:t.format,path:{customTypeID:t.id,tabID:f,sliceZoneID:null!==(n=null==u?void 0:u.key)&&void 0!==n?n:""},onRemoveSharedSlice:d})}):(0,i.jsx)(eo,{openUpdateSliceZoneModal:K,openCreateSliceModal:U,openSlicesTemplatesModal:X,projectHasAvailableSlices:O.length>0,isSlicesTemplatesSupported:p.length>0}):void 0,C&&(0,i.jsx)(eK,{formId:"tab-slicezone-form-".concat(f),availableSlices:O,onSubmit:function(e){var n=es({customType:t,tabId:f,slices:e});N(z.Dc.fromSM(n)),Q(),q(),ei.Am.success("Slice(s) added to slice zone")},close:Q}),b&&(0,i.jsx)(eO,{formId:"tab-slicezone-form-".concat(f),availableSlicesTemplates:p,localLibraries:L,onSuccess:function(e){var n=es({customType:t,tabId:f,slices:e});N(z.Dc.fromSM(n)),G(),q(),ei.Am.success((0,i.jsx)(ev.GX,{message:"Slice template(s) added to slice zone and created at: ",path:"".concat(L[0].name,"/")}))},close:G}),H&&(0,i.jsx)(ej,{closeDeleteSliceZoneModal:function(){B(!1)},deleteSliceZone:function(){l(),B(!1)}}),(null==L?void 0:L.length)!==0&&I&&(0,i.jsx)(eh.c,{onSuccess:function(e){var n=es({customType:t,tabId:f,slices:[e]});N(z.Dc.fromSM(n)),Y(),q(),ei.Am.success((0,i.jsx)(ev.GX,{message:"New slice added to slice zone and created at: ",path:"".concat(L[0].name,"/")}))},localLibraries:L,remoteSlices:Z,onClose:Y})]})},eq=function(e){var n,t,a,l=e.tabId,c=E(),d=c.customType,f=c.setCustomType,m=z.Dc.toSM(d),h=null===(n=m.tabs.find(function(e){return e.key===l}))||void 0===n?void 0:n.sliceZone,v=null!==(a=null===(t=m.tabs.find(function(e){return e.key===l}))||void 0===t?void 0:t.value)&&void 0!==a?a:[],x=(0,o.useRouter)().query,p=m.tabs.reduce(function(e,n){return(0,X.Z)(e).concat((0,X.Z)(n.value))},[]),y=function(e){var n=(0,u.AK)({customType:d,fieldId:e,sectionId:l});f(n)},b=function(e){var n=e.id,t=e.label,i=e.widgetTypeName;if(!(0,$.Ss)(Y,i)){var r=Y[i].create(t);if("Range"===r.type||"IntegrationFields"===r.type||"Separator"===r.type)throw Error("Unsupported Field Type: ".concat(r.type));var a=Y[r.type];try{a.schema.validateSync(r,{stripUnknown:!1})}catch(o){throw Error('Add field: Model is invalid for field "'.concat(r.type,'".'))}var s=z.L$.fromSM(r),c=(0,u.xS)({customType:d,newField:s,newFieldId:n,sectionId:l});f(c),D.Xe.track({event:"field:added",id:n,name:t,type:s.type,isInAGroup:!1,contentType:(0,ee.T)(window.location.pathname)})}},j=function(e){if(!(0,$.uS)(e)){var n=e.source,t=e.destination;if(t){var i=(0,u.gR)({customType:d,sourceIndex:n.index,destinationIndex:t.index,sectionId:l});(0,q.flushSync)(function(){return f(i)})}}},g=function(e){var n=e.apiId,t=e.newKey,i=e.value;if(!(0,$.Ss)(Y,i.type)){var r=z.L$.fromSM(i),a=(0,u.L4)({customType:d,previousFieldId:n,newFieldId:t,newField:r,sectionId:l});f(a)}},C=function(){var e=(0,u.Tr)(d,l);f(e)},_=function(){var e=(0,u.E3)(d,l);f(e)},S=function(e){var n=(0,u.EN)({customType:d,sectionId:l,sliceId:e});f(n)};return(0,i.jsx)(Q.S,{children:(0,i.jsx)(s.Suspense,{fallback:(0,i.jsx)(r.xu,{padding:32,children:(0,i.jsx)(r._3,{})}),children:(0,i.jsxs)(W.aV,{style:{flexGrow:1},children:[void 0===x.newPageType?(0,i.jsx)(et.Z,{zoneType:"customType",tabId:l,title:"Static Zone",dataTip:"",fields:v,poolOfFieldsToCheck:p,showHints:!0,EditModal:en.Z,widgetsArray:G,onDeleteItem:y,onSave:g,onSaveNewField:b,onDragEnd:j,renderHintBase:function(e){var n=e.item;return"data".concat((0,J.Ti)(n.key))},renderFieldAccessor:function(e){return"data".concat((0,J.Ti)(e))},testId:"static-zone-content",isRepeatableCustomType:d.repeatable}):void 0,(0,i.jsx)(eX,{customType:m,tabId:l,sliceZone:h,onRemoveSharedSlice:S,onCreateSliceZone:C,onDeleteSliceZone:_})]})})})},eW=function(){var e,n,t,a=E(),l=a.customType,c=a.setCustomType,d=z.Dc.toSM(l),f=(0,s.useState)(null===(e=d.tabs[0])||void 0===e?void 0:e.key),m=f[0],h=f[1],v=(0,s.useState)(),x=v[0],p=v[1],y=(0,o.useRouter)().query,b=(null===(n=d.tabs.find(function(e){return e.key===m}))||void 0===n?void 0:null===(t=n.sliceZone)||void 0===t?void 0:t.value.length)===0;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(g,{style:b?{flexGrow:1}:void 0,children:["page"===l.format?(0,i.jsx)(C,{}):void 0,"true"===y.newPageType?(0,i.jsx)(eq,{tabId:d.tabs[0].key}):(0,i.jsxs)(_,{onValueChange:h,value:m,children:[(0,i.jsx)(S,{onAddNewTab:function(){p({type:"CREATE_CUSTOM_TYPE_TAB"})},children:d.tabs.map(function(e){return(0,i.jsx)(I,{menu:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.Xi,{onSelect:function(){p({type:"UPDATE_CUSTOM_TYPE_TAB",tabKey:e.key})},startIcon:(0,i.jsx)(r.I5,{name:"edit"}),children:"Rename"}),(0,i.jsx)(r.Xi,{color:"tomato",disabled:d.tabs.length<=1,onSelect:function(){p({type:"DELETE_CUSTOM_TYPE_TAB",tabKey:e.key})},startIcon:(0,i.jsx)(r.I5,{name:"delete"}),children:"Remove"})]}),value:e.key,children:e.key},e.key)})}),d.tabs.map(function(e){return(0,i.jsx)(k,{value:e.key,children:(0,i.jsx)(eq,{tabId:e.key})},e.key)})]})]}),(null==x?void 0:x.type)==="CREATE_CUSTOM_TYPE_TAB"?(0,i.jsx)(O,{close:function(){p(void 0)},isOpen:!0,onSubmit:function(e){var n=e.id;c((0,u.vB)(l,n)),h(n)},tabIds:d.tabs.map(function(e){return e.key.toLowerCase()})}):void 0,(null==x?void 0:x.type)==="UPDATE_CUSTOM_TYPE_TAB"?(0,i.jsx)(U,{close:function(){p(void 0)},initialTabKey:x.tabKey,isOpen:!0,onSubmit:function(e){var n=e.id;c((0,u.HO)(l,x.tabKey,n)),m===x.tabKey&&h(n)},tabIds:d.tabs.filter(function(e){return e.key!==x.tabKey}).map(function(e){return e.key.toLowerCase()})}):void 0,(null==x?void 0:x.type)==="DELETE_CUSTOM_TYPE_TAB"?(0,i.jsx)(K,{close:function(){p(void 0)},isOpen:!0,onSubmit:function(){if(c((0,u.F$)(l,x.tabKey)),m===x.tabKey){var e,n=null===(e=d.tabs.find(function(e){return e.key!==x.tabKey}))||void 0===e?void 0:e.key;void 0!==n&&h(n)}}}):void 0]})},eQ=t(52312),eY=t(28849),eG=t(54845),e$=t(13230),eJ=t.n(e$),e0=function(e){var n=e.tabs,t=(0,p.Z)(e,["tabs"]);return(0,i.jsxs)(b.fC,(0,x.Z)((0,v.Z)({},t),{className:eJ().root,defaultValue:n[0].label,orientation:"vertical",children:[(0,i.jsx)(b.aV,{className:eJ().list,"aria-label":"content tabs",children:n.map(function(e,n){var t=e.label;return(0,i.jsx)(b.xz,{className:eJ().trigger,value:t,children:(0,i.jsx)(r.xv,{className:eJ().triggerText,component:"span",color:"inherit",children:t})},"".concat(t,"-trig").concat(n+1))})}),n.map(function(e,n){var t=e.label,a=e.content;return(0,i.jsx)(b.VY,{className:eJ().content,value:t,children:(0,i.jsx)(r.xr,{className:eJ().scrollArea,children:a})},"".concat(t,"-content").concat(n+1))})]}))},e1=t(82205),e2=t(88241),e7=t(8857),e4=t(72757),e8=t(49109),e9=t(25145),e6=function(){return(0,i.jsx)("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.1707 19.1237C17.9629 19.3056 17.9419 19.6214 18.1237 19.8293C18.3056 20.0371 18.6214 20.0581 18.8293 19.8763L22.8293 16.3763C22.9378 16.2814 23 16.1442 23 16C23 15.8558 22.9378 15.7187 22.8293 15.6237L18.8293 12.1237C18.6214 11.9419 18.3056 11.9629 18.1237 12.1708C17.9419 12.3786 17.9629 12.6945 18.1707 12.8763L21.7407 16L18.1707 19.1237ZM13.8293 12.8763C14.0371 12.6945 14.0581 12.3786 13.8763 12.1708C13.6944 11.9629 13.3786 11.9419 13.1707 12.1237L9.17075 15.6237C9.06224 15.7187 9 15.8558 9 16C9 16.1442 9.06224 16.2814 9.17075 16.3763L13.1707 19.8763C13.3786 20.0581 13.6944 20.0371 13.8763 19.8293C14.0581 19.6214 14.0371 19.3056 13.8293 19.1237L10.2593 16L13.8293 12.8763Z",fill:"#6F6E77"})})},e3=function(){return(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",children:(0,i.jsx)("path",{d:"M21.2388 10H10.7623C10.3415 10 10 10.3415 10 10.7623V21.2377C10 21.6585 10.3415 22 10.7623 22H21.2377C21.6585 22 22 21.6585 22 21.2388V10.7623C22 10.3415 21.6585 10 21.2388 10ZM16.5714 19.1953C16.5714 20.3371 15.9018 20.8571 14.9241 20.8571C14.0402 20.8571 13.4029 20.2645 13.1429 19.7143L14.0413 19.1708C14.2143 19.4777 14.4777 19.7143 14.8571 19.7143C15.2199 19.7143 15.4286 19.5725 15.4286 19.0212V15.4286H16.5714V19.1953ZM19.0502 20.8571C18.0379 20.8571 17.4632 20.3471 17.1429 19.7143L18 19.1429C18.2333 19.5246 18.4877 19.8895 19.0257 19.8895C19.4777 19.8895 19.7143 19.6641 19.7143 19.3516C19.7143 18.9788 19.4688 18.846 18.9721 18.6283L18.6998 18.5112C17.9129 18.1763 17.3895 17.7567 17.3895 16.8683C17.3895 16.0513 18.0134 15.4286 18.9866 15.4286C19.6797 15.4286 20.1775 15.6696 20.5368 16.3013L19.6886 16.8471C19.5011 16.5112 19.3002 16.3795 18.9866 16.3795C18.6674 16.3795 18.4654 16.5826 18.4654 16.8471C18.4654 17.1741 18.6674 17.3058 19.135 17.5089L19.4074 17.6261C20.3348 18.0223 20.8571 18.4275 20.8571 19.3382C20.8571 20.3192 20.0859 20.8571 19.0502 20.8571Z",fill:"#6F6E77"})})},e5=function(){return(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:32,height:32,children:(0,i.jsxs)("g",{fill:"none",fillRule:"evenodd",children:[(0,i.jsx)("path",{d:"M0 0h32v32H0z"}),(0,i.jsx)("path",{fill:"#6F6E77",fillRule:"nonzero",d:"M15.45 10.534c1.592-1.013 3.794-.542 4.908 1.054.533.747.742 1.679.585 2.584a3.2 3.2 0 0 1-.48 1.197c.35.664.466 1.427.333 2.167a3.205 3.205 0 0 1-1.449 2.148l-2.795 1.782c-1.593 1.013-3.792.542-4.908-1.054a3.413 3.413 0 0 1-.585-2.584c.075-.425.24-.834.48-1.197a3.374 3.374 0 0 1-.334-2.167 3.205 3.205 0 0 1 1.449-2.148Zm3.756 1.785a2.224 2.224 0 0 0-2.383-.883 2.053 2.053 0 0 0-.57.249l-2.794 1.782c-.46.29-.778.759-.873 1.292a2.06 2.06 0 0 0 .352 1.555 2.224 2.224 0 0 0 2.384.883c.203-.054.393-.138.569-.249l1.064-.68a.567.567 0 0 1 .171-.076.67.67 0 0 1 .718.266.613.613 0 0 1 .106.468.582.582 0 0 1-.263.39L14.89 19.1a.567.567 0 0 1-.17.076.67.67 0 0 1-.718-.266.612.612 0 0 1-.114-.414l.011-.103-.103-.033a3.608 3.608 0 0 1-1.094-.547l-.144-.106-.051.16c-.03.084-.052.17-.068.26a2.06 2.06 0 0 0 .352 1.555 2.224 2.224 0 0 0 2.384.883c.2-.054.393-.138.569-.249l2.795-1.782c.46-.29.777-.759.872-1.292a2.06 2.06 0 0 0-.352-1.555 2.224 2.224 0 0 0-2.384-.883 2.053 2.053 0 0 0-.568.249l-1.065.68a.567.567 0 0 1-.17.076.67.67 0 0 1-.718-.266.613.613 0 0 1-.106-.468.582.582 0 0 1 .263-.39l2.795-1.783a.567.567 0 0 1 .17-.076.67.67 0 0 1 .719.266c.086.119.127.268.113.414l-.01.103.102.033c.393.119.764.303 1.095.547l.143.106.052-.16c.03-.084.051-.17.068-.26a2.06 2.06 0 0 0-.353-1.555Z"})]})})},ne=function(){return(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",children:(0,i.jsx)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.1719 10H20.8281C21.4753 10 22 10.5247 22 11.1719V20.8281C22 21.4753 21.4753 22 20.8281 22H11.1719C10.5247 22 10 21.4753 10 20.8281V11.1719C10 10.5247 10.5247 10 11.1719 10ZM17.4283 20.7223V19.549C17.641 19.7275 17.8721 19.8613 18.1215 19.9505C18.371 20.0397 18.6228 20.0843 18.8771 20.0843C19.0263 20.0843 19.1565 20.0709 19.2678 20.044C19.3791 20.0171 19.472 19.9798 19.5466 19.9322C19.6211 19.8845 19.6768 19.8283 19.7135 19.7635C19.7501 19.6987 19.7685 19.6285 19.7685 19.5527C19.7685 19.45 19.7391 19.3583 19.6805 19.2777C19.6217 19.197 19.5417 19.1225 19.4402 19.054C19.3387 18.9856 19.2183 18.9196 19.0789 18.856C18.9395 18.7925 18.7891 18.7277 18.6277 18.6617C18.2169 18.4906 17.9106 18.2816 17.7089 18.0347C17.5071 17.7878 17.4062 17.4896 17.4062 17.1401C17.4062 16.8663 17.4613 16.631 17.5713 16.4343C17.6814 16.2375 17.8311 16.0756 18.0206 15.9484C18.2102 15.8213 18.4296 15.7278 18.6791 15.668C18.9285 15.6081 19.1926 15.5781 19.4714 15.5781C19.7452 15.5781 19.988 15.5946 20.1995 15.6276C20.411 15.6606 20.606 15.7113 20.7845 15.7798V16.8761C20.6965 16.815 20.6005 16.7612 20.4966 16.7148C20.3927 16.6683 20.2857 16.6298 20.1756 16.5992C20.0656 16.5687 19.9562 16.5461 19.8473 16.5314C19.7385 16.5168 19.6352 16.5094 19.5374 16.5094C19.4029 16.5094 19.2806 16.5223 19.1706 16.5479C19.0605 16.5736 18.9676 16.6097 18.8918 16.6561C18.816 16.7025 18.7573 16.7581 18.7157 16.8229C18.6742 16.8877 18.6534 16.9604 18.6534 17.0411C18.6534 17.1291 18.6766 17.2079 18.7231 17.2776C18.7695 17.3472 18.8356 17.4132 18.9212 17.4756C19.0068 17.5379 19.1107 17.599 19.2329 17.6589C19.3552 17.7188 19.4934 17.7805 19.6474 17.8441C19.8577 17.932 20.0466 18.0255 20.2142 18.1245C20.3817 18.2235 20.5253 18.3354 20.6451 18.46C20.765 18.5847 20.8567 18.7271 20.9203 18.8872C20.9838 19.0473 21.0156 19.2337 21.0156 19.4463C21.0156 19.7397 20.96 19.9859 20.8487 20.1851C20.7375 20.3844 20.5865 20.5457 20.3957 20.6691C20.205 20.7926 19.9831 20.8812 19.73 20.935C19.4769 20.9887 19.2097 21.0156 18.9285 21.0156C18.6399 21.0156 18.3655 20.9912 18.105 20.9423C17.8446 20.8934 17.619 20.8201 17.4283 20.7223ZM16.9609 16.6582H15.4558V20.9453H14.2634V16.6582H12.7656V15.6953H16.9609V16.6582Z",fill:"#6F6E77"})})},nn=function(){return(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",children:(0,i.jsx)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12.031 11L15.7584 17.8336L16.0831 18.4288L16.4077 17.8336L20.1352 11H22L16.0831 21.4347L10 11H12.031ZM19.2924 11.0006L16.0831 16.8843L12.8737 11.0005L14.2612 11.0001L14.727 11L15.2777 11.9497L16.1319 13.4226L16.9886 11.9512L17.542 11.0006H17.9881H19.2924Z",fill:"#6F6E77"})})},nt=t(69537),ni=t.n(nt);e7.Z.registerLanguage("tsx",e8.Z),e7.Z.registerLanguage("markup",e4.Z),e7.Z.alias("markup","vue"),e7.Z.alias("markup","svelte");var nr=function(e){var n,t=(null!==(n=e.fileName.match(/\.([^\.]*)$/))&&void 0!==n?n:[])[1];return function(){switch(t){case"ts":case"tsx":return(0,i.jsx)(ne,{});case"js":case"jsx":return(0,i.jsx)(e3,{});case"vue":return(0,i.jsx)(nn,{});case"svelte":return(0,i.jsx)(e5,{});default:return(0,i.jsx)(e6,{})}}()},na=function(e){var n=e.code,t=e.onCopy,a=(0,s.useState)(!1),l=a[0],o=a[1];(0,s.useEffect)(function(){if(l){var e=setTimeout(function(){o(!1)},1200);return function(){clearTimeout(e)}}},[l]);var c=function(){navigator.clipboard.writeText(n).then(function(){o(!0),void 0!==t&&t()})};return(0,i.jsx)(r.hU,{size:"small",onClick:c,icon:l?"check":"contentCopy",hiddenLabel:l?"Code successfully copied":"Copy code"})},nl=function(e){var n=e.fileInfo,t=e.className,a=e.copy,l=e.code,o=e.onCopy,s=/language-(\w+)/.exec(null!=t?t:"");return(0,i.jsxs)("div",{className:ni().root,children:[(0,i.jsxs)("div",{className:ni().header,children:[void 0!==n?(0,i.jsxs)("div",{className:ni().fileInfo,children:[(0,i.jsx)(nr,{fileName:n.fileName}),(0,i.jsx)(r.xv,{className:ni().fileName,color:"grey11",children:n.fileName})]}):(0,i.jsx)("span",{}),!0===a?(0,i.jsx)(na,{onCopy:o,code:String(l)}):null]}),null!==s&&s[1]?(0,i.jsx)(e7.Z,{showLineNumbers:!0,customStyle:{margin:0,border:"none",fontSize:"12px",lineHeight:"18px",borderRadius:"none",backgroundColor:"#FFF",borderBottomLeftRadius:"4px",borderBottomRightRadius:"4px"},children:String(l).replace(/\n$/,""),style:e9.MS,language:s[1],PreTag:"div"}):l]})},no=t(36065),ns="_1ecs97dfxo",nc=function(e){var n=(0,no.p)();if(!0===e.inline)return(0,i.jsx)("code",(0,x.Z)((0,v.Z)({},e),{className:"_1ecs97dfkp _1ecs97d18 _1ecs97d8l _1ecs97dfh9 _1ecs97dfwm _1ecs97dfxz"}));var t=function(){var n,t;if((null===(n=e.node)||void 0===n?void 0:null===(t=n.data)||void 0===t?void 0:t.meta)!==void 0){var i,r,a,l=null===(i=e.node)||void 0===i?void 0:null===(r=i.data)||void 0===r?void 0:r.meta;return{fileName:l.substring(1,l.length-1),language:null===(a=e.className)||void 0===a?void 0:a.split("-")[1]}}return null}(),r=function(){D.Xe.track({event:"page-type:copy-snippet",framework:n})};return(0,i.jsx)(nl,(0,v.Z)((0,x.Z)((0,v.Z)({copy:!0},e),{onCopy:r,code:e.children}),null!==t?{fileInfo:t}:{}))},nd=function(e){var n=e.markdown;return(0,i.jsx)(e1.D,{children:n,linkTarget:"_blank",remarkPlugins:[e2.Z],components:{code:function(e){return(0,i.jsx)(nc,(0,v.Z)({},e))},h1:function(e){return(0,i.jsx)(r.xv,{children:e.children,component:"h1",variant:"h1"})},h2:function(e){return(0,i.jsx)(r.xv,{children:e.children,component:"h2",variant:"h2"})},h3:function(e){return(0,i.jsx)(r.xv,{children:e.children,component:"h3",variant:"h3"})},h4:function(e){return(0,i.jsx)(r.xv,{children:e.children,component:"h4",variant:"h4"})},h5:function(e){return(0,i.jsx)(r.xv,{children:e.children,component:"h4",variant:"h4"})},p:function(e){return(0,i.jsx)(r.xv,{className:ns,children:e.children,component:"p",variant:"normal"})},pre:function(e){return(0,i.jsx)(r.xv,{className:ns,children:e.children,component:"pre",variant:"normal"})}}})};function nu(e){return nf.apply(this,arguments)}function nf(){return(nf=(0,w.Z)(function(e){var n,t,i,r;return(0,Z.__generator)(this,function(a){switch(a.label){case 0:return n=JSON.parse(e),[4,eu.j.documentation.read({kind:n.kind,data:n.data})];case 1:if(i=(t=a.sent()).errors,r=t.documentation,i.length>0)throw i;return[2,r]}})})).apply(this,arguments)}t(75317);var nm=function(e){var n,t=e.model,a=(0,no.p)(),l=(0,ed.QT)(nu,[JSON.stringify({kind:"PageSnippet",data:{model:t}})]);if(0===l.length)return null;var o=function(){D.Xe.track({event:"page-type:open-snippet",framework:a})};return(0,i.jsxs)(r.Vq,{size:"small",trigger:(0,i.jsx)(r.zx,{color:"grey",onClick:o,startIcon:"code",children:"Page snippet"}),children:[(0,i.jsx)(r.fK,{icon:"code",title:"Page snippet"}),(0,i.jsx)("section",{className:"_3uvawd0 _1ecs97dffk _1ecs97dfft _1ecs97dfnw _1ecs97dfpn",children:l.length>1?(0,i.jsx)(e0,{style:{flex:1},tabs:l.map(function(e,n){var t=e.label,r=e.content;return{label:null!=t?t:"Tab ".concat(n+1),content:(0,i.jsx)(nd,{markdown:r})}})}):(0,i.jsx)(r.xr,{style:{flex:1,padding:16},children:(0,i.jsx)(nd,{markdown:l[0].content})})})]})},nh=function(e){var n=e.model;return(0,i.jsx)("div",{children:(0,i.jsx)(Q.S,{children:(0,i.jsx)(s.Suspense,{fallback:(0,i.jsx)(r.zx,{color:"grey",startIcon:"code",children:"Page snippet"}),children:(0,i.jsx)(nm,{model:n})})})})},nv=function(){var e=(0,o.useRouter)(),n=(0,c.v9)(function(n){return{selectedCustomType:(0,eY.Jk)(n,(0,m.Ag)(e.query))}}).selectedCustomType;return((0,s.useEffect)(function(){n&&(0,eQ.TG)(n)||e.replace("/")},[n,e]),n&&(0,eQ.TG)(n))?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l(),{children:(0,i.jsxs)("title",{children:[n.local.label," - Slice Machine"]})}),(0,i.jsx)(nx,{customType:n.local})]}):(0,i.jsx)(h.LN,{})},nx=function(e){var n=e.customType;return null===n?(0,i.jsx)(h.LN,{}):(0,i.jsx)(h.LN,{children:(0,i.jsx)(A,{initialCustomType:z.Dc.fromSM(n),children:function(e){var t,a=e.actionQueueStatus,l=e.customType,o=e.setCustomType,s=(0,u.y6)(l),c=m.cd[n.format],v=M.$[n.format];return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(h.wd,{children:[(0,i.jsx)(h.Xq,{url:c.tablePagePathname}),(0,i.jsxs)(h.Cx,{children:[(0,i.jsx)(d.g,{children:v.name({start:!0,plural:!0})}),(0,i.jsx)(d.g,{active:!0,children:null!==(t=l.label)&&void 0!==t?t:l.id})]}),(0,i.jsxs)(h.K2,{children:[(0,i.jsx)(f.X,{status:a}),"page"===l.format?(0,i.jsx)(nh,{model:l}):void 0,(0,i.jsx)(eG._,{isChangesLocal:!0,format:s,customType:l,setLocalCustomType:o})]})]}),(0,i.jsx)(h.RN,{children:(0,i.jsx)(r.xu,{flexDirection:"column",minWidth:0,children:(0,i.jsx)(eW,{})})})]})}})})}},63269:function(e,n,t){"use strict";t.d(n,{E:function(){return c}});var i=t(22710),r=t(62230),a=t(85244),l=t(17064),o=t(99267),s=t(19334);function c(e){var n,t,c,d=(0,l.Z)((0,s.f)(),2),u=d[0],f=d[1],m=(c=(0,i.Z)(function(n){var t;return(0,o.__generator)(this,function(i){switch(i.label){case 0:return t=(0,a.Z)((0,r.Z)({},u),{labs:(0,r.Z)({},u.labs)}),n?t.labs[e]=n:e in t.labs&&delete t.labs[e],0===Object.keys(t.labs).length&&delete t.labs,[4,f(t)];case 1:return i.sent(),[2]}})}),function(e){return c.apply(this,arguments)});return[{enabled:null!==(t=null==u?void 0:null===(n=u.labs)||void 0===n?void 0:n[e])&&void 0!==t&&t},m]}},19334:function(e,n,t){"use strict";t.d(n,{f:function(){return o}});var i=t(22710),r=t(99267),a=t(18566),l=t(81038);function o(){var e,n=(0,a.QT)(s,[]),t=(e=(0,i.Z)(function(e){return(0,r.__generator)(this,function(n){switch(n.label){case 0:return[4,l.j.project.writeSliceMachineConfig({config:e})];case 1:return n.sent(),(0,a.VA)(s,[],e),[2]}})}),function(n){return e.apply(this,arguments)});return[n,t]}function s(){return c.apply(this,arguments)}function c(){return(c=(0,i.Z)(function(){return(0,r.__generator)(this,function(e){return[2,l.j.project.getSliceMachineConfig()]})})).apply(this,arguments)}},56054:function(e,n,t){"use strict";t.d(n,{c:function(){return C}});var i=t(22710),r=t(62230),a=t(85244),l=t(99267),o=t(52322),s=t(2784),c=t(36131),d=t(75289),u=t(82770),f=t(88932),m=t(5479),h=t(17384),v=t(81038);function x(){return(x=(0,i.Z)(function(e){var n,t,i,r,a,o,s;return(0,l.__generator)(this,function(l){switch(l.label){case 0:n=e.sliceName,t=e.libraryName,i=e.onSuccess,l.label=1;case 1:return l.trys.push([1,4,,5]),r=(0,m.fo)(n),[4,v.j.slices.createSlice({libraryID:t,model:r})];case 2:if((a=l.sent().errors).length>0)throw a;return u.Xe.track({event:"slice:created",id:(0,h.MP)(n),name:n,library:t}),[4,i(r)];case 3:return l.sent(),[3,5];case 4:return o=l.sent(),s="An unexpected error happened while creating slice ".concat(n,"."),console.error(s,o),f.Am.error(s),[3,5];case 5:return[2]}})})).apply(this,arguments)}var p=t(50950),y=t(6134),b=t(90374),j=t(36960),g=t(98235),C=function(e){var n,t=e.onClose,f=e.onSuccess,m=e.localLibraries,h=e.remoteSlices,v=(0,b.Z)().createSliceSuccess,C=(0,s.useState)(!1),_=C[0],S=C[1],I=(0,p.g)().syncChanges,k=(n=(0,i.Z)(function(e){var n,t;return(0,l.__generator)(this,function(r){switch(r.label){case 0:var a;return n=e.sliceName,t=e.from,S(!0),[4,function(e){return x.apply(this,arguments)}({sliceName:n,libraryName:t,onSuccess:(a=(0,i.Z)(function(e){var n;return(0,l.__generator)(this,function(n){switch(n.label){case 0:return[4,(0,u.y0)()];case 1:return v(n.sent().libraries),f(e,t),I(),[2]}})}),function(e){return a.apply(this,arguments)})})];case 1:return r.sent(),[2]}})}),function(e){return n.apply(this,arguments)});return(0,o.jsx)(y.Z,{testId:"create-slice-modal",isOpen:!0,widthInPx:"530px",isLoading:_,formId:"create-new-slice",close:t,buttonLabel:"Create",onSubmit:function(e){k(e)},initialValues:{sliceName:"",from:m[0].name},validate:function(e){return(0,g.h)(e,m,h)},content:{title:"Create a new slice"},children:function(e){var n=e.touched,t=e.values,i=e.setFieldValue,l=e.errors;return(0,o.jsxs)(d.xu,{children:[(0,o.jsx)(j.W,{name:"sliceName",label:"Slice Name",placeholder:"Pascalised Slice API ID (e.g. TextBlock)",error:n.sliceName?l.sliceName:void 0,testId:"slice-name-input"}),(0,o.jsx)(d.__,{htmlFor:"from",sx:{mb:2},children:"Target Library"}),(0,o.jsx)(c.ZP,{name:"from",options:m.map(function(e){return{value:e.name,label:e.name}}),onChange:function(e){return e?void i("from",e.value):null},defaultValue:{value:t.from,label:t.from},styles:{option:function(e){return(0,a.Z)((0,r.Z)({},e),{color:"#161618"})}},theme:function(e){return(0,a.Z)((0,r.Z)({},e),{colors:(0,a.Z)((0,r.Z)({},e.colors),{primary:"#E9E8EA"})})},menuPortalTarget:document.body})]})}})}},98235:function(e,n,t){"use strict";t.d(n,{h:function(){return c}});var i=t(81541),r=t(96009),a=t.n(r),l=t(74600),o=t.n(l),s=t(63094);function c(e,n,t){var r=e.sliceName;if(!r)return{sliceName:"Cannot be empty"};if(!s.xo.exec(r))return{sliceName:"No special characters allowed"};if(o()(a()(r)).replace(/\s/gm,"")!==r.trim())return{sliceName:"Value has to be PascalCased"};if(r.match(/^\d/))return{sliceName:"Value cannot start with a number"};if(s.lS.includes(r))return{sliceName:"".concat(r," is reserved for Slice Machine use")};var l=n.flatMap(function(e){return e.components.map(function(e){return e.model.name})}),c=t.map(function(e){return e.name});if((0,i.Z)(l).concat((0,i.Z)(c)).includes(r))return{sliceName:"Slice name is already taken."}}},53420:function(e,n,t){"use strict";var i=t(62230),r=t(52322),a=t(75289);n.Z=function(e){var n=e.elems,t=e.renderElem,l=e.defineElementKey,o=e.gridTemplateMinPx,s=e.gridGap,c=e.sx;return(0,r.jsx)(a.xu,{as:"section",sx:(0,i.Z)({display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(".concat(void 0===o?"320px":o,", 1fr))"),gridGap:void 0===s?"16px":s,pt:2},c),children:n.map(function(e,n){return e?(0,r.jsx)("span",{children:t(e,n)},"".concat(l(e),"-").concat(n+1)):null})})}},75317:function(){},69537:function(e){e.exports={block:"CodeBlock_block__ljak4",blockWithDisplayRevert:"CodeBlock_blockWithDisplayRevert__zM3Ns CodeBlock_block__ljak4",root:"CodeBlock_root__3ZYFL CodeBlock_blockWithDisplayRevert__zM3Ns CodeBlock_block__ljak4",header:"CodeBlock_header__kLT1f CodeBlock_block__ljak4",fileInfo:"CodeBlock_fileInfo__ocLpL CodeBlock_block__ljak4",fileName:"CodeBlock_fileName__jmuEV CodeBlock_blockWithDisplayRevert__zM3Ns CodeBlock_block__ljak4"}},13230:function(e){e.exports={flex:"ContentTabs_flex__kAimf",column:"ContentTabs_column__x5QZL ContentTabs_flex__kAimf",root:"ContentTabs_root__GPtve ContentTabs_column__x5QZL ContentTabs_flex__kAimf",list:"ContentTabs_list__XarTi ContentTabs_flex__kAimf",trigger:"ContentTabs_trigger__8hs6H ContentTabs_column__x5QZL ContentTabs_flex__kAimf",triggerText:"ContentTabs_triggerText__ka3DD",content:"ContentTabs_content__mMr1s ContentTabs_column__x5QZL ContentTabs_flex__kAimf",scrollArea:"ContentTabs_scrollArea__ZBVHa"}},86251:function(e){e.exports={scrollArea:"ConvertLegacySliceButton_scrollArea__gW7L4",label:"ConvertLegacySliceButton_label__yP2Pt"}}}]);