slice-machine-ui 1.26.1-beta.10 → 1.26.1-beta.12

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 (471) 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/chunks/{183-ebd633fed7c74545.js → 183-6ad5c4eb28d4b155.js} +1 -1
  5. package/out/_next/static/chunks/207-f71df53ed0b0ac4d.js +1 -0
  6. package/out/_next/static/chunks/453-1a14e86de385fe7c.js +1 -0
  7. package/out/_next/static/chunks/614-af117b661cd3429a.js +1 -0
  8. package/out/_next/static/chunks/90-2d4bdae13d031364.js +1 -0
  9. package/out/_next/static/chunks/91-1c3665ce38e58792.js +1 -0
  10. package/out/_next/static/chunks/96-33e38032f1e55366.js +1 -0
  11. package/out/_next/static/chunks/pages/{_app-f7ec0d037993439e.js → _app-01bcd29a595cec3a.js} +2 -2
  12. package/out/_next/static/chunks/pages/changelog-ac1004bdd31d17f8.js +1 -0
  13. package/out/_next/static/chunks/pages/changes-5c4bd80747884a8c.js +1 -0
  14. package/out/_next/static/chunks/pages/custom-types/[customTypeId]-8bcc4d88f470d3f7.js +1 -0
  15. package/out/_next/static/chunks/pages/{custom-types-3c8e721ec6802127.js → custom-types-75e8eddec659f440.js} +1 -1
  16. package/out/_next/static/chunks/pages/{index-cf93d16e9c63b6db.js → index-16754a04037cf9c1.js} +1 -1
  17. package/out/_next/static/chunks/pages/labs-d6f2feb6720ee64c.js +1 -0
  18. package/out/_next/static/chunks/pages/page-types/[pageTypeId]-8461ab4fcfaf0755.js +1 -0
  19. package/out/_next/static/chunks/pages/settings-7ad1540dc0af794d.js +1 -0
  20. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-9941e7eeb9d4d084.js +1 -0
  21. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-217d0b0469d4320e.js +1 -0
  22. package/out/_next/static/chunks/pages/slices-801310de228fd05e.js +1 -0
  23. package/out/_next/static/css/17da9daaa8986410.css +1 -0
  24. package/out/_next/static/css/{27f2b9b9c9f65885.css → 663a1bac4ce890da.css} +1 -1
  25. package/out/_next/static/css/70e3649c6ba13fdc.css +1 -0
  26. package/out/_next/static/css/c36992b18975f9b9.css +1 -0
  27. package/out/_next/static/css/{fa4e416634515cbb.css → df904982b9637c1a.css} +1 -1
  28. package/out/_next/static/svF8JPCb25QlsmymuzIiN/_buildManifest.js +1 -0
  29. package/out/changelog.html +1 -1
  30. package/out/changes.html +1 -1
  31. package/out/custom-types/[customTypeId].html +1 -1
  32. package/out/custom-types.html +1 -1
  33. package/out/index.html +1 -1
  34. package/out/labs.html +1 -1
  35. package/out/page-types/[pageTypeId].html +1 -1
  36. package/out/settings.html +1 -1
  37. package/out/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
  38. package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
  39. package/out/slices.html +1 -1
  40. package/package.json +3 -3
  41. package/sentry.client.config.ts +2 -1
  42. package/src/ErrorBoundary.tsx +1 -1
  43. package/src/apiClient.ts +13 -9
  44. package/src/components/BaseHoverCard/BaseHoverCard.stories.tsx +1 -1
  45. package/src/components/BaseHoverCard/BaseHoverCard.test.tsx +1 -1
  46. package/src/components/BaseHoverCard/BaseHoverCard.tsx +1 -1
  47. package/src/components/BlankSlate/BlankSlate.stories.tsx +1 -1
  48. package/src/components/BlankSlate/index.ts +1 -1
  49. package/src/components/Breadcrumb/Breadcrumb.tsx +1 -1
  50. package/src/components/Card/Card.stories.tsx +3 -3
  51. package/src/components/Card/Card.tsx +3 -2
  52. package/src/components/CodeBlock/CodeBlock.tsx +6 -6
  53. package/src/components/ContentTabs/ContentTabs.tsx +1 -1
  54. package/src/components/Count/Count.tsx +1 -1
  55. package/src/components/Divider/Divider.stories.tsx +1 -1
  56. package/src/components/HoverCard/HoverCard.stories.tsx +3 -2
  57. package/src/components/HoverCard/HoverCard.test.tsx +2 -2
  58. package/src/components/HoverCard/HoverCard.tsx +2 -2
  59. package/src/components/HoverCard/index.ts +3 -3
  60. package/src/components/SideNav/SideNav.stories.tsx +6 -6
  61. package/src/components/SideNav/SideNav.tsx +6 -5
  62. package/src/components/SideNav/SideNavEnvironmentSelector.tsx +3 -3
  63. package/src/components/Table/Table.stories.tsx +2 -2
  64. package/src/components/Table/Table.test.tsx +2 -2
  65. package/src/components/Table/Table.tsx +2 -2
  66. package/src/components/Table/index.ts +1 -1
  67. package/src/components/TextLink/TextLink.stories.tsx +1 -1
  68. package/src/components/TextLink/TextLink.tsx +1 -1
  69. package/src/domain/__tests__/customType.test.ts +1 -2
  70. package/src/domain/__tests__/slice.test.ts +3 -3
  71. package/src/domain/customType.ts +1 -2
  72. package/src/domain/slice.ts +7 -4
  73. package/src/features/autoSave/AutoSaveStatusIndicator.tsx +2 -2
  74. package/src/features/changelog/useSliceMachineLatestNonBreakingVersion.ts +1 -1
  75. package/src/features/changelog/useSliceMachineReleaseNotes.ts +1 -1
  76. package/src/features/changelog/useSliceMachineVersions.ts +2 -2
  77. package/src/features/changes/BlankSlates/NoChangesBlankSlate.tsx +11 -14
  78. package/src/features/changes/PushChangesButton.tsx +5 -5
  79. package/src/features/changes/StatusBadge.tsx +2 -2
  80. package/src/features/customTypes/EditDropdown.tsx +6 -9
  81. package/src/features/customTypes/PageTypeOnboarding.tsx +5 -5
  82. package/src/features/customTypes/__tests__/CustomTypeBuilderPage.test.tsx +11 -12
  83. package/src/features/customTypes/__tests__/CustomTypesTablePage.test.tsx +11 -10
  84. package/src/features/customTypes/actions/convertCustomToPageType.ts +4 -4
  85. package/src/features/customTypes/actions/createCustomType.ts +5 -5
  86. package/src/features/customTypes/actions/deleteCustomType.ts +3 -3
  87. package/src/features/customTypes/actions/renameCustomType.ts +3 -3
  88. package/src/features/customTypes/customTypesBuilder/CustomTypeProvider.tsx +8 -8
  89. package/src/features/customTypes/customTypesBuilder/CustomTypesBuilderPage.tsx +17 -12
  90. package/src/features/customTypes/customTypesBuilder/PageSnippetDialog/PageSnippetDialog.tsx +7 -7
  91. package/src/features/customTypes/customTypesBuilder/SliceZoneBlankSlate.tsx +3 -3
  92. package/src/features/customTypes/customTypesBuilder/useCustomType.ts +1 -1
  93. package/src/features/customTypes/customTypesConfig.ts +2 -2
  94. package/src/features/customTypes/customTypesTable/CustomTypesTable.tsx +16 -16
  95. package/src/features/customTypes/customTypesTable/CustomTypesTablePage.tsx +9 -9
  96. package/src/features/customTypes/customTypesTable/useCustomTypes.ts +8 -8
  97. package/src/features/documentation/MarkdownRenderer/index.tsx +5 -6
  98. package/src/features/documentation/useDocumentation.ts +1 -1
  99. package/src/features/environments/actions/getActiveEnvironment.ts +1 -1
  100. package/src/features/environments/actions/getEnvironments.ts +1 -1
  101. package/src/features/environments/actions/setEnvironment.ts +3 -3
  102. package/src/features/inAppGuide/InAppGuideContext.tsx +2 -2
  103. package/src/features/inAppGuide/InAppGuideDialog.tsx +4 -4
  104. package/src/features/inAppGuide/inAppGuideContent.tsx +2 -2
  105. package/src/features/labs/labsList/LabsList.tsx +2 -2
  106. package/src/features/labs/labsList/LabsListItem.tsx +1 -1
  107. package/src/features/labs/labsList/LabsPage.tsx +5 -5
  108. package/src/features/labs/labsList/useLab.tsx +1 -1
  109. package/src/features/settings/SettingsPage.tsx +4 -4
  110. package/src/features/settings/git/ConnectGitRepository.tsx +9 -9
  111. package/src/features/settings/git/GitOwnerSelect.tsx +1 -1
  112. package/src/features/settings/git/GitProvider.ts +4 -4
  113. package/src/features/settings/git/GitProviderConnectButtons.tsx +1 -1
  114. package/src/features/settings/git/GitRepositoriesList.tsx +5 -5
  115. package/src/features/settings/git/GitRepositoriesSearch.tsx +5 -5
  116. package/src/features/settings/git/GitRepositoryConnectDialog.tsx +3 -3
  117. package/src/features/settings/git/useGitIntegrationExperiment.ts +1 -1
  118. package/src/features/settings/git/useGitOwners.ts +1 -1
  119. package/src/features/settings/git/useGitRepos.ts +1 -1
  120. package/src/features/settings/git/useLinkedGitRepos.ts +2 -2
  121. package/src/features/settings/git/useWriteAPIToken.ts +2 -2
  122. package/src/features/slices/actions/addSlicesToSliceZone.ts +2 -2
  123. package/src/features/slices/actions/createSlice.ts +5 -5
  124. package/src/features/slices/actions/deleteSlice.ts +1 -1
  125. package/src/features/slices/actions/renameSlice.ts +4 -4
  126. package/src/features/slices/actions/uploadSliceScreenshot.ts +2 -2
  127. package/src/features/slices/convertLegacySlice/ConvertLegacySliceAsNewSliceDialog.tsx +9 -9
  128. package/src/features/slices/convertLegacySlice/ConvertLegacySliceAsNewVariationDialog.tsx +6 -6
  129. package/src/features/slices/convertLegacySlice/ConvertLegacySliceButton.tsx +12 -12
  130. package/src/features/slices/convertLegacySlice/ConvertLegacySliceMergeWithIdenticalDialog.tsx +3 -3
  131. package/src/features/slices/convertLegacySlice/types.ts +2 -2
  132. package/src/features/slices/sliceBuilder/FloatingBackButton.tsx +6 -6
  133. package/src/features/slices/sliceBuilder/SliceBuilderProvider.tsx +9 -9
  134. package/src/features/slices/sliceBuilder/actions/deleteVariation.ts +4 -4
  135. package/src/features/slices/sliceBuilder/actions/renameVariation.ts +3 -3
  136. package/src/features/slices/sliceBuilder/useGroupsInSlicesExperiment.ts +1 -1
  137. package/src/features/slices/sliceCards/NonSharedSliceCard.tsx +4 -4
  138. package/src/features/slices/sliceCards/SharedSliceCard.tsx +7 -7
  139. package/src/features/slicesTemplates/actions/createSlicesTemplates.ts +2 -2
  140. package/src/features/slicesTemplates/useSlicesTemplates.ts +2 -1
  141. package/src/features/sync/AutoSyncProvider.tsx +17 -17
  142. package/src/features/sync/actions/pushChanges.ts +4 -3
  143. package/src/features/sync/actions/trackPushChangesSuccess.ts +3 -3
  144. package/src/features/sync/components/AutoSyncStatusIndicator.tsx +4 -4
  145. package/src/features/sync/fetchUnSyncChanges.ts +5 -5
  146. package/src/features/sync/getUnSyncChanges.ts +9 -9
  147. package/src/features/sync/useUnSyncChanges.ts +5 -5
  148. package/src/hooks/useActionQueue.tsx +5 -5
  149. package/src/hooks/useAdapterName.ts +1 -1
  150. package/src/hooks/useAuthStatus.ts +2 -2
  151. package/src/hooks/useCurrentSlice.tsx +4 -4
  152. package/src/hooks/useEditorContent.ts +5 -4
  153. package/src/hooks/useExperimentVariant.ts +2 -2
  154. package/src/hooks/useIsEmptyProject.ts +1 -1
  155. package/src/hooks/useRepositoryInformation.ts +2 -2
  156. package/src/hooks/useRouteChange.tsx +1 -1
  157. package/src/hooks/useSMTracker.ts +6 -6
  158. package/src/hooks/useScreenshotChangesModal.ts +4 -3
  159. package/src/hooks/useServerState.ts +4 -4
  160. package/src/hooks/useSliceMachineConfig.ts +2 -2
  161. package/src/hooks/useSliceMachineRunningVersion.ts +1 -1
  162. package/src/hooks/useThrottle.ts +1 -1
  163. package/src/hooks/useUpdateAvailable.ts +1 -1
  164. package/src/hooks/useWindowDimensions.ts +1 -1
  165. package/src/hooks/useWindowSize.ts +2 -1
  166. package/{components → src/legacy/components}/App/index.tsx +8 -8
  167. package/{components → src/legacy/components}/AppLayout/index.tsx +5 -6
  168. package/{components → src/legacy/components}/AuthInstructions/index.jsx +1 -1
  169. package/{components → src/legacy/components}/Button/index.tsx +1 -2
  170. package/{components → src/legacy/components}/Card/Default.jsx +2 -1
  171. package/{components → src/legacy/components}/Card/Preview.jsx +1 -1
  172. package/{components → src/legacy/components}/Card/WithTabs/index.jsx +4 -3
  173. package/{components → src/legacy/components}/Card/index.tsx +1 -0
  174. package/{components → src/legacy/components}/Changelog/index.tsx +8 -8
  175. package/{components → src/legacy/components}/Changelog/navigation/VersionBadge.tsx +2 -1
  176. package/{components → src/legacy/components}/Changelog/navigation/VersionTag.tsx +1 -0
  177. package/{components → src/legacy/components}/Changelog/navigation/index.tsx +6 -6
  178. package/{components → src/legacy/components}/Changelog/versionDetails/UpdateCommandBox.tsx +6 -6
  179. package/{components → src/legacy/components}/Changelog/versionDetails/VersionKindLabel.tsx +3 -4
  180. package/{components → src/legacy/components}/Changelog/versionDetails/index.tsx +5 -5
  181. package/{components → src/legacy/components}/ChangesEmptyState/AuthErrorPage.tsx +3 -3
  182. package/{components → src/legacy/components}/ChangesItems/ChangesItems.tsx +14 -14
  183. package/{components → src/legacy/components}/ChangesItems/DevCollaborationExperiment.tsx +3 -3
  184. package/{components → src/legacy/components}/CodeBlock/index.tsx +3 -3
  185. package/{components → src/legacy/components}/ConfigErrors/index.jsx +4 -3
  186. package/{components → src/legacy/components}/CustomTypeTable/changesPage.tsx +9 -8
  187. package/{components → src/legacy/components}/DeleteCTModal/index.tsx +9 -9
  188. package/{components → src/legacy/components}/DeleteDocumentsDrawer/AssociatedDocumentsCard.tsx +4 -4
  189. package/{components → src/legacy/components}/DeleteDocumentsDrawer/HardDeleteDocumentsDrawer.tsx +9 -9
  190. package/{components → src/legacy/components}/DeleteDocumentsDrawer/SoftDeleteDocumentsDrawer.tsx +9 -8
  191. package/{components → src/legacy/components}/DeleteSliceModal/index.tsx +6 -6
  192. package/{components → src/legacy/components}/DeleteVariationModal/index.tsx +6 -6
  193. package/{components → src/legacy/components}/DropDownSelector/index.tsx +2 -4
  194. package/{components → src/legacy/components}/EmptyState/index.tsx +3 -3
  195. package/{components → src/legacy/components}/FormFields/Array.jsx +2 -4
  196. package/{components → src/legacy/components}/FormFields/Checkbox.jsx +1 -1
  197. package/{components → src/legacy/components}/FormFields/CheckboxControl.jsx +1 -1
  198. package/{components → src/legacy/components}/FormFields/Input.tsx +3 -2
  199. package/{components → src/legacy/components}/FormFields/SelectDefaultValue.jsx +1 -1
  200. package/{components → src/legacy/components}/Forms/CreateCustomTypeModal/CreateCustomTypeModal.tsx +18 -18
  201. package/{components → src/legacy/components}/Forms/CreateSliceModal/CreateSliceModal.tsx +10 -10
  202. package/{components → src/legacy/components}/Forms/RenameCustomTypeModal/RenameCustomTypeModal.tsx +12 -12
  203. package/{components → src/legacy/components}/Forms/RenameSliceModal/RenameSliceModal.tsx +8 -8
  204. package/src/legacy/components/Forms/RenameVariationModal/RenameVariationModal.module.css.d.ts +5 -0
  205. package/{components → src/legacy/components}/Forms/RenameVariationModal/RenameVariationModal.tsx +6 -6
  206. package/{components → src/legacy/components}/Forms/components/InputBox.tsx +2 -2
  207. package/{components → src/legacy/components}/Forms/components/SelectRepeatable.tsx +4 -3
  208. package/{components → src/legacy/components}/Forms/formsValidator.ts +6 -4
  209. package/{components → src/legacy/components}/FullPage/index.tsx +1 -1
  210. package/{components → src/legacy/components}/ListItem/Header.tsx +3 -2
  211. package/{components → src/legacy/components}/ListItem/index.tsx +8 -10
  212. package/{components → src/legacy/components}/LoadingPage/index.tsx +1 -0
  213. package/{components → src/legacy/components}/LoginModal/index.tsx +22 -22
  214. package/{components → src/legacy/components}/ModalFormCard/index.tsx +7 -6
  215. package/{components → src/legacy/components}/Navigation/ChangesItem.tsx +12 -12
  216. package/{components → src/legacy/components}/Navigation/Environment.tsx +13 -13
  217. package/{components → src/legacy/components}/Navigation/RunningVersion.tsx +2 -2
  218. package/{components → src/legacy/components}/Navigation/UpdateBox.tsx +3 -3
  219. package/src/legacy/components/Navigation/VideoItem.module.css.d.ts +5 -0
  220. package/{components → src/legacy/components}/Navigation/VideoItem.tsx +14 -13
  221. package/src/legacy/components/Navigation/index.module.css.d.ts +5 -0
  222. package/{components → src/legacy/components}/Navigation/index.test.tsx +12 -12
  223. package/{components → src/legacy/components}/Navigation/index.tsx +20 -21
  224. package/{components → src/legacy/components}/ReviewModal/ReviewForm.tsx +12 -12
  225. package/{components → src/legacy/components}/ReviewModal/ReviewModal.tsx +6 -6
  226. package/{components → src/legacy/components}/ScreenshotChangesModal/VariationDropZone.tsx +7 -7
  227. package/{components → src/legacy/components}/ScreenshotChangesModal/index.tsx +12 -15
  228. package/{components → src/legacy/components}/ScreenshotChangesModal/useCustomScreenshot.tsx +1 -1
  229. package/{components → src/legacy/components}/ScreenshotPreviewModal/index.tsx +8 -7
  230. package/{components → src/legacy/components}/Simulator/components/FailedConnect/index.tsx +3 -3
  231. package/{components → src/legacy/components}/Simulator/components/Header/VariationsPopover/MenuList.tsx +2 -1
  232. package/{components → src/legacy/components}/Simulator/components/Header/VariationsPopover/index.tsx +4 -5
  233. package/{components → src/legacy/components}/Simulator/components/Header/index.tsx +7 -7
  234. package/{components → src/legacy/components}/Simulator/components/IframeRenderer/index.tsx +3 -4
  235. package/{components → src/legacy/components}/Simulator/components/Toolbar/ScreensizeInput/index.tsx +2 -1
  236. package/{components → src/legacy/components}/Simulator/components/Toolbar/index.tsx +4 -5
  237. package/{components → src/legacy/components}/Simulator/index.tsx +20 -26
  238. package/{components → src/legacy/components}/SliceMachineDrawer/index.tsx +3 -2
  239. package/{components → src/legacy/components}/ToasterContainer/index.tsx +3 -5
  240. package/{components → src/legacy/components}/Tooltip/TextWithTooltip.tsx +2 -2
  241. package/{components → src/legacy/components}/Tooltip/index.jsx +2 -2
  242. package/{components → src/legacy/components}/Warnings/index.jsx +1 -1
  243. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/DeleteSliceZoneModal.tsx +4 -4
  244. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/List.tsx +8 -8
  245. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/SlicesTemplatesModal.tsx +11 -11
  246. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/UpdateSliceZoneModal.tsx +3 -3
  247. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/UpdateSliceZoneModalList.tsx +4 -3
  248. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/index.tsx +26 -23
  249. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/sliceTemplatesComingSoon.ts +1 -1
  250. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/TabModal/InputBox.tsx +1 -1
  251. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/TabModal/create.tsx +2 -1
  252. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/TabModal/delete.tsx +2 -2
  253. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/TabModal/update.tsx +3 -2
  254. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/TabZone/index.tsx +29 -26
  255. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/index.tsx +5 -5
  256. package/{lib → src/legacy/lib}/builders/SliceBuilder/FieldZones/index.tsx +20 -20
  257. package/{lib → src/legacy/lib}/builders/SliceBuilder/Sidebar/AddVariationModal.tsx +7 -7
  258. package/{lib → src/legacy/lib}/builders/SliceBuilder/Sidebar/index.tsx +12 -12
  259. package/{lib → src/legacy/lib}/builders/SliceBuilder/SimulatorButton/index.tsx +12 -11
  260. package/{lib → src/legacy/lib}/builders/SliceBuilder/index.tsx +9 -9
  261. package/{lib → src/legacy/lib}/builders/common/EditModal/Field.jsx +3 -5
  262. package/{lib → src/legacy/lib}/builders/common/EditModal/Form.jsx +1 -1
  263. package/{lib → src/legacy/lib}/builders/common/EditModal/index.jsx +14 -16
  264. package/{lib → src/legacy/lib}/builders/common/SelectFieldTypeModal/index.jsx +3 -4
  265. package/{lib → src/legacy/lib}/builders/common/Zone/Card/components/ErrorTooltip.tsx +2 -2
  266. package/{lib → src/legacy/lib}/builders/common/Zone/Card/components/Hints/CodeBlock.tsx +4 -5
  267. package/{lib → src/legacy/lib}/builders/common/Zone/Card/components/Hints/index.tsx +2 -1
  268. package/{lib → src/legacy/lib}/builders/common/Zone/Card/components/NewField.tsx +16 -13
  269. package/{lib → src/legacy/lib}/builders/common/Zone/Card/index.jsx +3 -3
  270. package/{lib → src/legacy/lib}/builders/common/Zone/components/EmptyState/index.tsx +1 -1
  271. package/{lib → src/legacy/lib}/builders/common/Zone/index.jsx +3 -3
  272. package/{lib → src/legacy/lib}/builders/utils/index.ts +1 -1
  273. package/{lib → src/legacy/lib}/forms/fields.ts +1 -2
  274. package/{lib → src/legacy/lib}/forms/index.ts +1 -0
  275. package/{lib → src/legacy/lib}/models/common/CustomType/index.ts +5 -4
  276. package/{lib → src/legacy/lib}/models/common/CustomType/sliceZone.ts +2 -1
  277. package/{lib → src/legacy/lib}/models/common/DeprecatedMockConfigMessage.tsx +3 -2
  278. package/{lib → src/legacy/lib}/models/common/Environment.ts +2 -2
  279. package/{lib → src/legacy/lib}/models/common/Group.ts +3 -2
  280. package/{lib → src/legacy/lib}/models/common/Library.ts +2 -1
  281. package/{lib → src/legacy/lib}/models/common/LibraryUI.ts +1 -1
  282. package/{lib → src/legacy/lib}/models/common/ModelData.ts +3 -3
  283. package/{lib → src/legacy/lib}/models/common/ModelStatus/compareCustomTypeModels.ts +2 -1
  284. package/{lib → src/legacy/lib}/models/common/ModelStatus/compareSliceModels.ts +2 -1
  285. package/{lib → src/legacy/lib}/models/common/ModelStatus/index.ts +10 -9
  286. package/{lib → src/legacy/lib}/models/common/normalizers/customType.ts +2 -2
  287. package/{lib → src/legacy/lib}/models/common/normalizers/slices.ts +3 -2
  288. package/{lib → src/legacy/lib}/models/common/widgets/Boolean/index.ts +5 -7
  289. package/{lib → src/legacy/lib}/models/common/widgets/Color/index.ts +2 -3
  290. package/{lib → src/legacy/lib}/models/common/widgets/ContentRelationship/Form.tsx +9 -10
  291. package/{lib → src/legacy/lib}/models/common/widgets/ContentRelationship/index.ts +7 -7
  292. package/{lib → src/legacy/lib}/models/common/widgets/GeoPoint/index.ts +2 -3
  293. package/{lib → src/legacy/lib}/models/common/widgets/Group/Form.jsx +6 -6
  294. package/{lib → src/legacy/lib}/models/common/widgets/Group/ListItem/index.jsx +18 -24
  295. package/{lib → src/legacy/lib}/models/common/widgets/Group/index.ts +5 -3
  296. package/{lib → src/legacy/lib}/models/common/widgets/Image/Form.tsx +9 -11
  297. package/{lib → src/legacy/lib}/models/common/widgets/Image/components.tsx +6 -5
  298. package/{lib → src/legacy/lib}/models/common/widgets/Image/index.ts +3 -5
  299. package/{lib → src/legacy/lib}/models/common/widgets/Link/Form.jsx +5 -7
  300. package/{lib → src/legacy/lib}/models/common/widgets/LinkToMedia/Form.jsx +4 -6
  301. package/{lib → src/legacy/lib}/models/common/widgets/LinkToMedia/index.ts +4 -4
  302. package/{lib → src/legacy/lib}/models/common/widgets/Select/FormFields.jsx +7 -7
  303. package/{lib → src/legacy/lib}/models/common/widgets/Select/index.ts +3 -6
  304. package/{lib → src/legacy/lib}/models/common/widgets/StructuredText/Form.tsx +12 -11
  305. package/{lib → src/legacy/lib}/models/common/widgets/StructuredText/index.ts +3 -6
  306. package/{lib → src/legacy/lib}/models/common/widgets/StructuredText/options.tsx +2 -2
  307. package/{lib → src/legacy/lib}/models/common/widgets/Timestamp/index.ts +4 -5
  308. package/{lib → src/legacy/lib}/models/common/widgets/UID/index.ts +4 -5
  309. package/{lib → src/legacy/lib}/models/common/widgets/Widget.ts +3 -1
  310. package/{lib → src/legacy/lib}/models/common/widgets/withGroup.ts +1 -2
  311. package/{lib → src/legacy/lib}/models/server/ServerState.ts +4 -3
  312. package/{lib → src/legacy/lib}/utils/index.ts +4 -5
  313. package/{lib → src/legacy/lib}/utils/shared/customTypes.ts +1 -1
  314. package/src/modules/availableCustomTypes/index.ts +15 -13
  315. package/src/modules/availableCustomTypes/types.ts +2 -2
  316. package/src/modules/environment/index.ts +10 -8
  317. package/src/modules/environment/types.ts +1 -1
  318. package/src/modules/loading/index.ts +3 -2
  319. package/src/modules/modal/index.ts +4 -2
  320. package/src/modules/slices/index.ts +13 -9
  321. package/src/modules/slices/selector.ts +1 -1
  322. package/src/modules/slices/types.ts +2 -2
  323. package/src/modules/useSliceMachineActions.ts +25 -20
  324. package/src/modules/userContext/index.ts +5 -3
  325. package/{pages → src/pages}/_app.tsx +23 -25
  326. package/{pages → src/pages}/changelog.tsx +1 -1
  327. package/{pages → src/pages}/changes.tsx +22 -19
  328. package/src/pages/custom-types/[customTypeId].tsx +1 -0
  329. package/{pages → src/pages}/custom-types.tsx +1 -1
  330. package/{pages → src/pages}/index.tsx +3 -3
  331. package/src/pages/labs.tsx +1 -0
  332. package/src/pages/page-types/[pageTypeId].tsx +1 -0
  333. package/src/pages/settings.tsx +1 -0
  334. package/{pages → src/pages}/slices/[lib]/[sliceName]/[variation]/index.tsx +3 -3
  335. package/{pages → src/pages}/slices/[lib]/[sliceName]/[variation]/simulator.tsx +2 -2
  336. package/{pages → src/pages}/slices.tsx +21 -21
  337. package/src/redux/reducer.ts +8 -7
  338. package/src/redux/store.ts +8 -6
  339. package/src/redux/type.ts +7 -6
  340. package/src/theme.ts +1 -2
  341. package/test/__setup__.ts +10 -8
  342. package/test/__testutils__/createTestPlugin.ts +3 -2
  343. package/test/__testutils__/createTestProject.ts +5 -4
  344. package/test/__testutils__/index.tsx +6 -5
  345. package/test/__testutils__/mockAWSACLAPI.ts +1 -1
  346. package/test/__testutils__/mockCustomTypesAPI.ts +1 -1
  347. package/test/__testutils__/mockPrismicAuthAPI.ts +1 -1
  348. package/test/__testutils__/mockPrismicUserAPI.ts +2 -3
  349. package/test/__testutils__/readMSWFormData.ts +1 -1
  350. package/test/components/IframeRenderer.test.ts +3 -2
  351. package/test/lib/builders/EditModal.test.tsx +5 -3
  352. package/test/lib/builders/buildersUtils.test.ts +3 -3
  353. package/test/lib/consts.test.ts +6 -2
  354. package/test/lib/models/common/CustomType.test.ts +6 -2
  355. package/test/lib/models/common/ModelStatus.test.ts +6 -4
  356. package/test/lib/models/common/Slice.test.ts +3 -2
  357. package/test/lib/models/common/widgets/index.test.ts +8 -4
  358. package/test/lib/utils/index.test.ts +3 -2
  359. package/test/lib/utils/preferWroomBase.test.ts +3 -2
  360. package/test/lib/utils/shared/customTypes.test.ts +2 -1
  361. package/test/pages/slices.test.tsx +10 -10
  362. package/test/src/modules/__fixtures__/serverState.ts +1 -1
  363. package/test/src/modules/__fixtures__/sliceUtilsFactory.ts +3 -3
  364. package/test/src/modules/availableCustomTypes/index.test.ts +3 -3
  365. package/test/src/modules/environment.test.ts +3 -5
  366. package/test/src/modules/loading.test.ts +3 -3
  367. package/test/src/modules/modal.test.ts +5 -5
  368. package/test/src/modules/slices.test.ts +3 -2
  369. package/test/src/modules/userContext.test.ts +3 -3
  370. package/test/src/normalizers/customType.test.ts +16 -3
  371. package/test/src/utils/fieldNameCreator.test.ts +1 -1
  372. package/tsconfig.json +1 -6
  373. package/vite.config.ts +5 -10
  374. package/out/_next/static/chunks/25-792af14760d9df34.js +0 -1
  375. package/out/_next/static/chunks/286-e0950c3083c672e8.js +0 -1
  376. package/out/_next/static/chunks/318-77a29f41c3a027e3.js +0 -1
  377. package/out/_next/static/chunks/382-aacd61be9adba45a.js +0 -1
  378. package/out/_next/static/chunks/727-d0d6a29f0793bde2.js +0 -1
  379. package/out/_next/static/chunks/799-7b910b896ff60ebe.js +0 -1
  380. package/out/_next/static/chunks/pages/changelog-055db8139a22a592.js +0 -1
  381. package/out/_next/static/chunks/pages/changes-f43ad4ab5e00f9b9.js +0 -1
  382. package/out/_next/static/chunks/pages/custom-types/[customTypeId]-89ccb93ce7409ad0.js +0 -1
  383. package/out/_next/static/chunks/pages/labs-73a12d2fe0233fb9.js +0 -1
  384. package/out/_next/static/chunks/pages/page-types/[pageTypeId]-dbf86fe3a94dc892.js +0 -1
  385. package/out/_next/static/chunks/pages/settings-417f1d5c1e558c88.js +0 -1
  386. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-01d67e97cb901e46.js +0 -1
  387. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-a8933b0ef10806cd.js +0 -1
  388. package/out/_next/static/chunks/pages/slices-3c9b08adf578b020.js +0 -1
  389. package/out/_next/static/css/0e0d6c4ec6bf7373.css +0 -1
  390. package/out/_next/static/css/be1f49e49a5aa7eb.css +0 -1
  391. package/out/_next/static/css/f8eb526e10bc2441.css +0 -1
  392. package/out/_next/static/w56F6n1XbyP8jyJHeri22/_buildManifest.js +0 -1
  393. package/pages/custom-types/[customTypeId].tsx +0 -1
  394. package/pages/labs.tsx +0 -1
  395. package/pages/page-types/[pageTypeId].tsx +0 -1
  396. package/pages/settings.tsx +0 -1
  397. package/out/_next/static/{w56F6n1XbyP8jyJHeri22 → svF8JPCb25QlsmymuzIiN}/_ssgManifest.js +0 -0
  398. package/{components → src/legacy/components}/Card/CardBox.tsx +0 -0
  399. package/{components → src/legacy/components}/Card/WithTabs/components.jsx +1 -1
  400. package/{components → src/legacy/components}/Changelog/versionDetails/ReleaseNotesDetails.tsx +1 -1
  401. package/{components → src/legacy/components}/ChangesEmptyState/OfflinePage.tsx +1 -1
  402. package/{components → src/legacy/components}/ChangesEmptyState/index.ts +1 -1
  403. package/{components → src/legacy/components}/ChangesItems/ErrorBanner.tsx +1 -1
  404. package/{components → src/legacy/components}/ChangesItems/index.ts +0 -0
  405. package/{components → src/legacy/components}/ChangesSectionHeader/ChangesSectionHeader.tsx +0 -0
  406. package/{components → src/legacy/components}/ChangesSectionHeader/index.ts +0 -0
  407. package/{components → src/legacy/components}/DeleteDocumentsDrawer/index.tsx +1 -1
  408. package/{components → src/legacy/components}/DropDownSelector/MenuList.tsx +0 -0
  409. package/{components → src/legacy/components}/Flex/index.tsx +0 -0
  410. package/{components → src/legacy/components}/FormFields/index.ts +0 -0
  411. package/{components → src/legacy/components}/Forms/CreateCustomTypeModal/index.tsx +0 -0
  412. package/{components → src/legacy/components}/Forms/CreateSliceModal/index.tsx +0 -0
  413. package/{components → src/legacy/components}/Forms/RenameCustomTypeModal/index.ts +0 -0
  414. package/{components → src/legacy/components}/Forms/RenameSliceModal/index.ts +0 -0
  415. package/{components → src/legacy/components}/Forms/RenameVariationModal/RenameVariationModal.module.css +0 -0
  416. package/{components → src/legacy/components}/Forms/RenameVariationModal/index.ts +0 -0
  417. package/{components → src/legacy/components}/Forms/components/FlexCard.tsx +0 -0
  418. package/{components → src/legacy/components}/Forms/formsTypes.ts +0 -0
  419. package/{components → src/legacy/components}/Grid/index.tsx +0 -0
  420. package/{components → src/legacy/components}/InputDeleteIcon/index.jsx +1 -1
  421. package/{components → src/legacy/components}/ItemHeader/index.tsx +1 -1
  422. package/{components → src/legacy/components}/Li/index.tsx +0 -0
  423. package/{components → src/legacy/components}/ListItem/utils.js +0 -0
  424. package/{components → src/legacy/components}/MissingLibraries/index.tsx +0 -0
  425. package/{components → src/legacy/components}/Navigation/VideoItem.module.css +0 -0
  426. package/{components → src/legacy/components}/Navigation/index.module.css +0 -0
  427. package/{components → src/legacy/components}/ReactTooltipPortal/index.tsx +0 -0
  428. package/{components → src/legacy/components}/ReviewModal/ReviewFormSelect.tsx +1 -1
  429. package/{components → src/legacy/components}/ReviewModal/index.ts +0 -0
  430. package/{components → src/legacy/components}/ScreenshotPreview/index.tsx +1 -1
  431. package/{components → src/legacy/components}/Simulator/components/FullPage/index.tsx +0 -0
  432. package/{components → src/legacy/components}/Simulator/components/Header/links.ts +0 -0
  433. package/{components → src/legacy/components}/SliceMachineIconButton/index.tsx +1 -1
  434. package/{components → src/legacy/components}/SliceMachineModal/index.tsx +1 -1
  435. package/{components → src/legacy/components}/WindowPortal/index.js +0 -0
  436. package/{components → src/legacy/components}/YoutubeEmbed/index.tsx +0 -0
  437. package/{lib → src/legacy/lib}/builders/common/SelectFieldTypeModal/FieldTypeCard.jsx +0 -0
  438. package/{lib → src/legacy/lib}/builders/common/Zone/Card/components/EditItem.jsx +0 -0
  439. package/{lib → src/legacy/lib}/consts.ts +0 -0
  440. package/{lib → src/legacy/lib}/env/sentry.ts +0 -0
  441. package/{lib → src/legacy/lib}/forms/defaults.ts +1 -1
  442. package/{lib → src/legacy/lib}/forms/types.ts +0 -0
  443. package/{lib → src/legacy/lib}/hljs/svelte.ts +0 -0
  444. package/{lib → src/legacy/lib}/models/common/Auth.ts +0 -0
  445. package/{lib → src/legacy/lib}/models/common/ComponentUI.ts +1 -1
  446. package/{lib → src/legacy/lib}/models/common/CustomType/tab.ts +4 -4
  447. package/{lib → src/legacy/lib}/models/common/ErrorWithStatus.ts +0 -0
  448. package/{lib → src/legacy/lib}/models/common/Fields.ts +1 -1
  449. package/{lib → src/legacy/lib}/models/common/Manifest.ts +0 -0
  450. package/{lib → src/legacy/lib}/models/common/PrismicData.ts +0 -0
  451. package/{lib → src/legacy/lib}/models/common/PrismicFile.ts +0 -0
  452. package/{lib → src/legacy/lib}/models/common/Screenshots.ts +0 -0
  453. package/{lib → src/legacy/lib}/models/common/Simulator.ts +0 -0
  454. package/{lib → src/legacy/lib}/models/common/Slice.ts +2 -2
  455. package/{lib → src/legacy/lib}/models/common/Slices.ts +2 -2
  456. package/{lib → src/legacy/lib}/models/common/UserProfile.ts +0 -0
  457. package/{lib → src/legacy/lib}/models/common/Warning.ts +0 -0
  458. package/{lib → src/legacy/lib}/models/common/widgets/Date/index.ts +2 -2
  459. package/{lib → src/legacy/lib}/models/common/widgets/Embed/index.ts +2 -2
  460. package/{lib → src/legacy/lib}/models/common/widgets/Link/index.ts +3 -3
  461. package/{lib → src/legacy/lib}/models/common/widgets/Number/index.ts +2 -2
  462. package/{lib → src/legacy/lib}/models/common/widgets/Text/index.ts +5 -5
  463. package/{lib → src/legacy/lib}/models/common/widgets/ctBuilderArray.ts +0 -0
  464. package/{lib → src/legacy/lib}/models/common/widgets/index.ts +1 -1
  465. /package/{lib → src/legacy/lib}/models/common/widgets/sliceBuilderArray.ts +0 -0
  466. /package/{lib → src/legacy/lib}/prismic/endpoints.ts +0 -0
  467. /package/{lib → src/legacy/lib}/utils/poll.ts +0 -0
  468. /package/{lib → src/legacy/lib}/utils/preferWroomBase.ts +0 -0
  469. /package/{lib → src/legacy/lib}/utils/repo.ts +0 -0
  470. /package/{lib → src/legacy/lib}/utils/str.ts +0 -0
  471. /package/{pages → src/pages}/api/embed.js +0 -0
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[207],{70207:function(e,n,t){"use strict";t.d(n,{H:function(){return nc}});var i=t(52322),r=t(22715),l=t(97729),a=t.n(l),o=t(5632),s=t(2784),c=t(56580),d=t(41730),u=t(91061),m=t(47976),f=t(67445),h=t(90898),v=t(62230),p=t(85244),x=t(98240),y=t(50002),b=t(73844);t(82432);var j="_1k08lzu5 _1ecs97dez0 _1ecs97dez2 _1ecs97dezb _1ecs97d32 _1ecs97daf _1ecs97df0v",g=function(e){return(0,i.jsx)("div",(0,p.Z)((0,v.Z)({},e),{className:"_1k08lzu2 _1ecs97dez0 _1ecs97dez2 _1ecs97dezb _1ecs97d1u _1ecs97d97 _1ecs97d3fg _1ecs97d3mt _1ecs97df0r _1ecs97df23 _1ecs97df2h _1ecs97dezr"}))},C=function(e){return(0,i.jsx)("div",(0,p.Z)((0,v.Z)({},e),{className:"_1k08lzu3 _1ecs97dez0 _1ecs97dez2 _1ecs97dezc _1ecs97dez8 _1ecs97dfhl",children:(0,i.jsxs)("div",{className:"_1ecs97dez0 _1ecs97dez2 _1ecs97dezc _1ecs97df92",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,p.Z)((0,v.Z)({},e),{activationMode:"manual",className:"_1k08lzu6 _1ecs97dez0 _1ecs97dez2 _1ecs97dezb _1ecs97dezd"}))},S=function(e){var n=e.children,t=e.onAddNewTab,l=(0,x.Z)(e,["children","onAddNewTab"]);return(0,i.jsxs)(b.aV,(0,p.Z)((0,v.Z)({},l),{className:"_1k08lzu7 _1ecs97dez0 _1ecs97dez2 _1ecs97dezc _1ecs97dezq",children:[n,(0,i.jsx)("div",{className:"_1k08lzuc _1k08lzu8 _1ecs97dez0 _1ecs97dez2 _1ecs97dezc _1ecs97dez8 _1ecs97dfgy _1ecs97d1u _1ecs97d97 _1ecs97dfhi _1ecs97dezw _1ecs97dfc1",children:(0,i.jsx)(r.hU,{icon:"add",onClick:t,hiddenLabel:"Add new tab"})})]}))},I=function(e){var n=e.children,t=e.menu,l=e.value,a=(0,x.Z)(e,["children","menu","value"]);return(0,i.jsx)(b.xz,(0,p.Z)((0,v.Z)({},a),{"aria-label":l,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:l,children:(0,i.jsxs)("div",{className:"_1k08lzu9 _1k08lzu8 _1ecs97dez0 _1ecs97dez2 _1ecs97dezc _1ecs97dez8 _1ecs97dfgy _1ecs97dez1 _1ecs97da62 _1ecs97dadf _1ecs97df41 _1ecs97df92 _1ecs97dfhl _1ecs97dezv",children:[(0,i.jsx)(r.xv,{className:"_1ecs97dezv _1ecs97dezd",color:"inherit",component:"span",noWrap:!0,variant:"emphasized",children:n}),Boolean(t)?(0,i.jsx)("div",{className:"_1k08lzub _1ecs97dezv _1ecs97df0i",children:(0,i.jsxs)(r.h_,{children:[(0,i.jsx)(r.$F,{children:(0,i.jsx)(r.hU,{icon:"moreVert",hiddenLabel:"tab-".concat(l,"-menu-button")})}),(0,i.jsx)(r.AW,{align:"start",children:t})]})}):void 0]})}))},w=function(e){return(0,i.jsx)(b.VY,(0,p.Z)((0,v.Z)({},e),{className:"_1k08lzud _1ecs97dez0 _1ecs97d18 _1ecs97d8l _1ecs97dez3 _1ecs97dezd"}))},Z=t(81787),k=t(74026),T=t(6134),D=t(63397),N=t(75289),z=function(e){var n=e.name,t=e.label,r=e.placeholder,l=e.error,a=(0,x.Z)(e,["name","label","placeholder","error"]);return(0,i.jsxs)(N.xu,{mb:3,children:[(0,i.jsx)(N.__,{htmlFor:n,mb:2,children:t}),(0,i.jsx)(D.gN,(0,v.Z)({name:n,type:"text",placeholder:r,as:N.II,autoComplete:"off"},a)),l?(0,i.jsx)(N.xv,{sx:{color:"error",mt:1},children:l}):null]})},L=function(e){var n=e.isOpen,t=e.onSubmit,r=e.close,l=e.tabIds;return(0,i.jsx)(T.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?l.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)(z,{name:"id",label:"New Tab ID",placeholder:"A label for selecting the tab (i.e. not used in the API)",error:n.id})}})},V=function(e){var n=e.isOpen,t=e.onSubmit,r=e.close;return(0,i.jsx)(T.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)(N.xu,{sx:{px:4,py:4},children:[(0,i.jsx)(N.X6,{as:"h4",children:"Remove this tab?"}),(0,i.jsx)(N.xv,{as:"p",color:"textClear",sx:{mt:2},children:"This action cannot be undone."}),(0,i.jsx)(N.zx,{type:"button",variant:"buttons.actionDelete",sx:{mt:3},onClick:function(){t({}),r()},children:"Yes, remove tab"})]})}})},M=function(e){var n=e.isOpen,t=e.onSubmit,r=e.close,l=e.tabIds,a=e.initialTabKey;return(0,i.jsx)(T.Z,{omitFooter:!0,isOpen:n,widthInPx:"530px",formId:"create-tab",close:r,cardProps:{bodySx:{p:0}},onSubmit:function(e){t(e),r()},initialValues:{id:a},validate:function(e){var n=e.id;return n?l.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,l=e.values,a=e.setFieldValue,o=e.isValid;return(0,i.jsxs)(N.xu,{sx:{px:4,py:4},children:[(0,i.jsx)(z,{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){l.id!==e.target.value&&a("id",e.target.value.trim())},onChange:function(e){a("id",e.target.value)}}),(0,i.jsx)(N.zx,{type:"button",sx:{mt:3,width:"100%"},disabled:!o,onClick:function(){l.id&&l.id.length&&t({id:l.id.trim()}),r()},children:"Save"})]})}})},F=t(81541),A=t(28316),E=t(82770),H=t(28173),P=t(8564),B=t(74096),R=[B.UID,B.Group,B.StructuredText,B.Image,B.Link,B.LinkToMedia,B.ContentRelationship,B.Select,B.Boolean,B.Date,B.Timestamp,B.Embed,B.Number,B.GeoPoint,B.Color,B.Text,],O=t(13302),K=t(17384),U=t(73393),X=t(18645),G=t(88932),W=t(65077),q=t(2754),Y=function(e){return(0,i.jsxs)("svg",(0,p.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"})]}))},Q=function(e){var n=e.openCreateSliceModal,t=e.openUpdateSliceZoneModal,l=e.openSlicesTemplatesModal,a=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)(q.R$,{backgroundImage:"/blank-slate-slice-zone.png",children:(0,i.jsxs)(q.T9,{children:[(0,i.jsx)(r.xu,{justifyContent:"center",padding:{bottom:16},children:(0,i.jsx)(Y,{})}),(0,i.jsx)(q._T,{children:"Add slices"}),(0,i.jsx)(q.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)(q.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:l,description:"Select from premade examples.",endAdornment:(0,i.jsx)(r.Ct,{color:"purple",title:"New"}),children:"Use template"}):void 0,a?(0,i.jsx)(r.F8,{startIcon:"folder",onClick:t,description:"Select from your own slices.",children:"Select existing"}):void 0]})})]})})})};function $(e){var n=e.customType,t=e.tabId,i=e.slices,r=(0,v.Z)({},n);return i.forEach(function(e){r=(0,p.Z)((0,v.Z)({},r),{tabs:r.tabs.map(function(n){return n.key===t&&n.sliceZone?(0,p.Z)((0,v.Z)({},n),{sliceZone:{key:n.sliceZone.key,value:[{key:e.id,value:e},].concat((0,F.Z)(n.sliceZone.value))}}):n})})}),E.Xe.track({event:"custom-type:slice-zone-updated",customTypeId:n.id}),r}var J=t(22710),ee=t(17064),en=t(99267),et=t(17329),ei=t(81038);function er(){return el.apply(this,arguments)}function el(){return(el=(0,J.Z)(function(){var e,n,t;return(0,en.__generator)(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,ei.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,ee.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 ea=t(56054),eo=t(6777),es=t(95200),ec=t(34226),ed=t(98898),eu=t(83399),em=function(e){var n=e.deleteSliceZone,t=e.closeDeleteSliceZoneModal;return(0,i.jsx)(eu.Z,{isOpen:!0,shouldCloseOnOverlayClick:!0,style:{content:{maxWidth:612}},onRequestClose:t,children:(0,i.jsx)(ed.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)(N.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)(N.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:"Do you really want to delete Slice Zone?"}),(0,i.jsx)(N.x8,{type:"button",onClick:t})]})},Footer:function(){return(0,i.jsxs)(N.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)(ec.z,{label:"Cancel",variant:"secondary",onClick:t,sx:{mr:"10px",fontWeight:"bold",color:"grey12",borderRadius:6}}),(0,i.jsx)(ec.z,{label:"Delete",variant:"danger",onClick:n,sx:{minHeight:39,minWidth:78}})]})},children:(0,i.jsx)(N.nv,{children:"You're about to delete Slice Zone."})})})},ef=t(78656),eh=t(63269),ev=t(24804),ep=t(5479),ex=t(90374),ey=t(98235),eb=t(86251),ej=t.n(eb),eg=function(e){var n,t=e.isOpen,l=e.close,a=e.onSubmit,o=e.isLoading,s=e.slice,d=e.libraries,u=(0,c.v9)(function(e){return{remoteSlices:(0,es.sT)(e)}}).remoteSlices;return(0,i.jsxs)(r.Vq,{open:t,onOpenChange:function(e){return!e&&l()},size:{width:448,height:"auto"},children:[(0,i.jsx)(r.fK,{title:"Upgrade slice"}),(0,i.jsx)(r.cZ,{children:(0,i.jsx)(D.J9,{validateOnMount:!0,initialValues:{from:null===(n=d[0])||void 0===n?void 0:n.name,sliceName:(0,K.MP)(s.key)},validate:function(e){return(0,ey.h)(e,d,u)},onSubmit:function(e){a({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:ej().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:ej().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,K.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:ej().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"})]})})}})})]})},eC=t(76635),e_=function(e){var n,t,l=e.isOpen,a=e.close,o=e.onSubmit,c=e.isLoading,d=e.slice,u=e.sliceName,m=e.libraries,f=e.localSharedSlices,h=(0,s.useState)(!0),x=h[0],y=h[1];return(0,i.jsxs)(r.Vq,{open:l,onOpenChange:function(e){return!e&&a()},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)(D.J9,{initialValues:{libraryID:null===(n=f[0])||void 0===n?void 0:n.from,sliceID:null===(t=f[0])||void 0===t?void 0:t.model.id,variationID:(0,eC.camelCase)(d.key),variationName:u},validate:function(e){return eS(e,m)},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:ej().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:ej().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,ee.Z)(n.split("::"),2),i=t[0],r=t[1];e.setFieldValue("libraryID",i),e.setFieldValue("sliceID",r)}},children:f.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:ej().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,p.Z)((0,v.Z)({},e.values),{variationName:n.slice(0,30)});x&&(t.variationID=(0,eC.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:ej().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,eC.camelCase)(d.key),error:"string"==typeof e.errors.variationID,value:e.values.variationID,onValueChange:function(n){y(!1),e.setFieldValue("variationID",(0,eC.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"})]})})}})})]})},eS=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 l=null==r?void 0:r.components.find(function(n){return n.model.id===e.sliceID});return(i.sliceID||l||(i.sliceID="Does not exist."),e.variationName||(i.variationName="Cannot be empty."),e.variationID)?(null!==(t=null==l?void 0:l.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},eI=function(e){var n,t,l=e.isOpen,a=e.close,o=e.onSubmit,s=e.isLoading,c=e.identicalSlices;return(0,i.jsxs)(r.Vq,{open:l,onOpenChange:function(e){return!e&&a()},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)(D.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,ee.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:ej().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:ej().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"})]})})}})})]})},ew=function(e){var n,t,l=e.slice,a=e.path,o=(0,ex.Z)().refreshState,d=(0,s.useState)(!1),u=d[0],m=d[1],f=(0,s.useState)(),h=f[0],x=f[1],y=(0,Z.G)().setCustomType,b=(0,c.v9)(function(e){return{libraries:(0,es.Sd)(e)}}).libraries,j="Slice"===l.value.type&&null!==(n=l.value.fieldset)&&void 0!==n?n:l.key,g=b.filter(function(e){return e.isLocal}),C=g.map(function(e){return e.components}).flat(),_=eZ(l,j,C),S=(t=(0,J.Z)(function(e){var n,t,i,r,s,c,d,u;return(0,en.__generator)(this,function(u){switch(u.label){case 0:if(!h)return[2];return m(!0),E.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,ei.j.slices.convertLegacySliceToSharedSlice({model:l.value,src:(0,p.Z)((0,v.Z)({},a),{sliceID:l.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),G.Am.error("Could not convert slice `".concat(j,"`")),r;return[4,ei.j.customTypes.readCustomType({id:a.customTypeID})];case 2:if(c=(s=u.sent()).model,(d=s.errors).length||!c)return console.error("Could not refresh custom type view `".concat(a.customTypeID,"`"),d),G.Am.error("Could not refresh custom type view `".concat(a.customTypeID,"`")),[2];return[4,(0,E.y0)()];case 3:switch(o(u.sent()),m(!1),x(void 0),h){case"as_new_slice":G.Am.success("".concat(j," has been upgraded to a new slice ").concat(e.libraryID," > ").concat(e.sliceID));break;case"as_new_variation":G.Am.success("".concat(j," has been converted as a variation of ").concat(e.libraryID," > ").concat(e.sliceID));break;default:G.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:a,slice:l,sliceName:j,libraries:g,localSharedSlices:C,identicalSlices:_,close:function(){return x(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 x("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 x("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 x("merge_with_identical")},disabled:!_.length,children:"Merge with another slice"})]})]}),(0,i.jsx)(eg,(0,p.Z)((0,v.Z)({},I),{isOpen:"as_new_slice"===h})),(0,i.jsx)(e_,(0,p.Z)((0,v.Z)({},I),{isOpen:"as_new_variation"===h})),(0,i.jsx)(eI,(0,p.Z)((0,v.Z)({},I),{isOpen:"merge_with_identical"===h}))]})},eZ=function(e,n,t){return(0,s.useMemo)(function(){var i=[],r=(0,ep.ux)(e.value,n),l=!0,a=!1,o=void 0;try{for(var s,c=t[Symbol.iterator]();!(l=(s=c.next()).done);l=!0){var d=s.value,u=!0,m=!1,f=void 0;try{for(var h,v=d.model.variations[Symbol.iterator]();!(u=(h=v.next()).done);u=!0){var p=h.value,x=(0,ep.ux)(p,d.model.name);r.primary===x.primary&&r.items===x.items&&i.push({libraryID:d.from,sliceID:d.model.id,variationID:p.id,path:"".concat(d.from,"::").concat(d.model.id,"::").concat(p.id)})}}catch(y){m=!0,f=y}finally{try{u||null==v.return||v.return()}finally{if(m)throw f}}}}catch(b){a=!0,o=b}finally{try{l||null==c.return||c.return()}finally{if(a)throw o}}return i},[e,n,t])},ek=function(e){var n=e.slice,t=e.path,l=(0,ee.Z)((0,eh.E)("legacySliceUpgrader"),1)[0],a=l.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)(ev.Zb,{children:[(0,i.jsx)(ev.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)(ev.T$,{children:[(0,i.jsx)(r.u,{content:a,side:"bottom",children:(0,i.jsx)(r.Ct,{color:"purple",title:"Legacy Slice"})}),l.enabled?(0,i.jsx)(ew,{slice:n,path:t}):null]}),(0,i.jsx)(ev.eW,{subtitle:"1 variation",title:(0,ep.Dj)(n.value)})]})},eT=t(56319),eD=t(53420),eN=function(e){var n=e.slices,t=e.format,r=e.path,l=e.onRemoveSharedSlice,a=n.some(function(e){return"SharedSlice"!==e.type}),o=ef.$[t],c=(0,ee.Z)((0,eh.E)("legacySliceUpgrader"),1)[0];return(0,s.useEffect)(function(){a&&(c.enabled?G.Am.info("This ".concat(o.name({start:!1,plural:!1})," contains legacy slices that can be upgraded.")):G.Am.warning("This ".concat(o.name({start:!1,plural:!1})," contains slices that are incompatible.")))},[a]),(0,i.jsx)(eD.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)(ek,{slice:n,path:r})}var t=e.payload;return(0,i.jsx)(eT.b,{action:{type:"remove",onRemove:function(){l(t.model.id)}},mode:"navigation",slice:t,variant:"solid"})},sx:{padding:"16px"}})},ez=t(67557);function eL(){return(eL=(0,J.Z)(function(e){var n,t,i,r,l,a,o,s;return(0,en.__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,ei.j.sliceTemplateLibrary.createSlices({templateIDs:n})];case 1:if(l=(r=c.sent()).data,(a=r.errors).length>0||void 0===l)throw a;return l.sliceIDs.forEach(function(e,i){E.Xe.track({event:"slice:created",id:e,name:e,library:t[0],sliceTemplate:n[i]})}),[4,i(l.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),G.Am.error(s),[3,4];case 4:return[2]}})})).apply(this,arguments)}var eV=t(23373),eM=[{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"}}},],eF=function(e){var n=e.availableSlices,t=e.values,r=e.placeholderSlices;return(0,i.jsx)(D.F2,{name:"sliceKeys",render:function(e){return(0,i.jsx)(eD.Z,{gridTemplateMinPx:"200px",elems:n,defineElementKey:function(e){return"".concat(e.from,"-").concat(e.model.name)},renderElem:function(n){var l,a=null!==(l=null==r?void 0:r.some(function(e){return e.model.id===n.model.id}))&&void 0!==l&&l,o=t.sliceKeys.includes(n.model.id);return(0,i.jsx)(eT.b,{action:{type:"checkbox"},isComingSoon:a,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"})}})}})},eA=function(e){var n=e.formId,t=e.close,r=e.onSuccess,l=e.availableSlicesTemplates,a=e.localLibraries,o=(0,ex.Z)().createSliceSuccess;return(0,i.jsx)(T.Z,{isOpen:!0,buttonLabel:"Add",formId:n,close:t,onSubmit:function(e){var n;!function(e){return eL.apply(this,arguments)}({templateIDs:e.sliceKeys,localLibrariesNames:a.map(function(e){return e.name}),onSuccess:(n=(0,J.Z)(function(e){var n,t;return(0,en.__generator)(this,function(n){switch(n.label){case 0:return[4,(0,E.y0)()];case 1:var t;return o(n.sent().libraries),[4,Promise.all(e.map((t=(0,J.Z)(function(e){var n;return(0,en.__generator)(this,function(n){switch(n.label){case 0:return[4,ei.j.slices.readSlice({libraryID:a[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)(N.xv,{sx:{color:"error"},children:n.sliceKeys}):void 0},children:function(e){var n=e.values;return(0,i.jsx)(eF,{values:n,placeholderSlices:eM,availableSlices:(0,F.Z)(l.map(function(e){return{extension:"",fileName:"",from:"",href:"",pathToSlice:"",model:eV.id.toSM(e.model),screenshots:Object.entries(e.screenshots).reduce(function(e,n){return(0,p.Z)((0,v.Z)({},e),(0,ez.Z)({},n[0],{url:n[1]}))},{})}})).concat((0,F.Z)(eM))})}})},eE=function(e){var n=e.formId,t=e.close,r=e.onSubmit,l=e.availableSlices;return(0,i.jsx)(T.Z,{isOpen:!0,buttonLabel:"Add",formId:n,close:t,onSubmit:function(e){r(e.sliceKeys.map(function(e){var n;return null===(n=l.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)(N.xv,{sx:{color:"error"},children:n.sliceKeys}):void 0},children:function(e){var n=e.values;return(0,i.jsx)(eF,{values:n,availableSlices:l})}})},eH=function(e,n){var t,i=(n||[]).reduce(function(e,n){return(0,F.Z)(e).concat((0,F.Z)(n.components))},[]),r=e.value.reduce(function(e,n){var t=n.key,r=n.value;if("SharedSlice"===r.type){var l=i.find(function(e){return e.model.id===t});return l?(0,p.Z)((0,v.Z)({},e),{slicesInSliceZone:(0,F.Z)(e.slicesInSliceZone).concat([{type:"SharedSlice",payload:l},])}):(0,p.Z)((0,v.Z)({},e),{notFound:(0,F.Z)(e.notFound).concat([{key:t}])})}return(0,p.Z)((0,v.Z)({},e),{slicesInSliceZone:(0,F.Z)(e.slicesInSliceZone).concat([{type:"Slice",payload:{key:t,value:r}},])})},{slicesInSliceZone:[],notFound:[]});return{availableSlices:i,slicesInSliceZone:r.slicesInSliceZone,notFound:r.notFound}},eP=function(e){var n,t=e.customType,l=e.onCreateSliceZone,a=e.onDeleteSliceZone,d=e.onRemoveSharedSlice,u=e.sliceZone,m=e.tabId,f=(0,o.useRouter)(),h=f.query,v=f.replace,p=f.pathname,x=(0,et.QT)(er,[]),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],w=S[1],T=(0,c.v9)(function(e){return{remoteSlices:(0,es.sT)(e),libraries:(0,es.Sd)(e),slices:(0,es.xC)(e)}}),D=T.remoteSlices,N=T.libraries,z=(0,Z.G)().setCustomType,L=N.filter(function(e){return e.isLocal}),V=(0,s.useMemo)(function(){return u?eH(u,N):{availableSlices:[],slicesInSliceZone:[],notFound:[]}},[u,N]),M=V.availableSlices,F=V.slicesInSliceZone,A=V.notFound,P=(0,s.useState)(!1),B=P[0],R=P[1];(0,s.useEffect)(function(){(null==A?void 0:A.length)&&A.forEach(function(e){d(e.key)})},[A]);var O=F.filter(function(e){return"SharedSlice"===e.type}).map(function(e){return e.payload}),K=M.filter(function(e){return!O.some(function(n){return n.model.id===e.model.id})}),U=function(){_(!0)},X=function(){w(!0)},q=function(){j(!0),E.Xe.track({event:"custom-type:open-add-from-templates",customTypeId:t.id,customTypeFormat:t.format})},Y=function(){"true"===h.newPageType&&v({pathname:p,query:{pageTypeId:h.pageTypeId}},void 0,{shallow:!0})},J=function(){_(!1)},ee=function(){w(!1)},en=function(){j(!1)};return(0,i.jsxs)(i.Fragment,{children:[void 0===h.newPageType?(0,i.jsx)(H.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:X,description:"Start from scratch.",children:"Create new"}),x.length>0?(0,i.jsx)(r.Xi,{onSelect:q,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,K.length>0?(0,i.jsx)(r.Xi,{onSelect:U,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"!==m?(0,i.jsx)(r.rs,{checked:!!u,onCheckedChange:function(e){e?l():R(!0)},size:"small","data-testid":"slice-zone-switch"}):void 0,children:"Slice Zone"}):void 0,u?F.length>0?(0,i.jsx)(W.xR,{children:(0,i.jsx)(eN,{slices:F,format:t.format,path:{customTypeID:t.id,tabID:m,sliceZoneID:null!==(n=null==u?void 0:u.key)&&void 0!==n?n:""},onRemoveSharedSlice:d})}):(0,i.jsx)(Q,{openUpdateSliceZoneModal:U,openCreateSliceModal:X,openSlicesTemplatesModal:q,projectHasAvailableSlices:K.length>0,isSlicesTemplatesSupported:x.length>0}):void 0,C&&(0,i.jsx)(eE,{formId:"tab-slicezone-form-".concat(m),availableSlices:K,onSubmit:function(e){var n=$({customType:t,tabId:m,slices:e});z(k.Dc.fromSM(n)),J(),Y(),G.Am.success("Slice(s) added to slice zone")},close:J}),b&&(0,i.jsx)(eA,{formId:"tab-slicezone-form-".concat(m),availableSlicesTemplates:x,localLibraries:L,onSuccess:function(e){var n=$({customType:t,tabId:m,slices:e});z(k.Dc.fromSM(n)),en(),Y(),G.Am.success((0,i.jsx)(eo.GX,{message:"Slice template(s) added to slice zone and created at: ",path:"".concat(L[0].name,"/")}))},close:en}),B&&(0,i.jsx)(em,{closeDeleteSliceZoneModal:function(){R(!1)},deleteSliceZone:function(){a(),R(!1)}}),(null==L?void 0:L.length)!==0&&I&&(0,i.jsx)(ea.c,{onSuccess:function(e){var n=$({customType:t,tabId:m,slices:[e]});z(k.Dc.fromSM(n)),ee(),Y(),G.Am.success((0,i.jsx)(eo.GX,{message:"New slice added to slice zone and created at: ",path:"".concat(L[0].name,"/")}))},localLibraries:L,remoteSlices:D,onClose:ee})]})},eB=function(e){var n,t,l,a=e.tabId,c=(0,Z.G)(),d=c.customType,m=c.setCustomType,f=k.Dc.toSM(d),h=null===(n=f.tabs.find(function(e){return e.key===a}))||void 0===n?void 0:n.sliceZone,v=null!==(l=null===(t=f.tabs.find(function(e){return e.key===a}))||void 0===t?void 0:t.value)&&void 0!==l?l:[],p=(0,o.useRouter)().query,x=f.tabs.reduce(function(e,n){return(0,F.Z)(e).concat((0,F.Z)(n.value))},[]),y=function(e){var n=(0,u.AK)({customType:d,fieldId:e,sectionId:a});m(n)},b=function(e){var n=e.id,t=e.label,i=e.widgetTypeName;if(!(0,O.Ss)(B,i)){var r=B[i].create(t);if("Range"===r.type||"IntegrationFields"===r.type||"Separator"===r.type)throw Error("Unsupported Field Type: ".concat(r.type));var l=B[r.type];try{l.schema.validateSync(r,{stripUnknown:!1})}catch(o){throw Error('Add field: Model is invalid for field "'.concat(r.type,'".'))}var s=k.L$.fromSM(r),c=(0,u.xS)({customType:d,newField:s,newFieldId:n,sectionId:a});m(c),E.Xe.track({event:"field:added",id:n,name:t,type:i,isInAGroup:!1,contentType:"page"===d.format?"page type":"custom type"})}},j=function(e){if(!(0,O.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:a});(0,A.flushSync)(function(){return m(i)})}}},g=function(e){var n=e.apiId,t=e.newKey,i=e.value;if(!(0,O.Ss)(B,i.type)){var r=k.L$.fromSM(i),l=(0,u.L4)({customType:d,previousFieldId:n,newFieldId:t,newField:r,sectionId:a});m(l)}},C=function(){var e=(0,u.Tr)(d,a);m(e)},_=function(){var e=(0,u.E3)(d,a);m(e)},S=function(e){var n=(0,u.EN)({customType:d,sectionId:a,sliceId:e});m(n)};return(0,i.jsx)(P.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)(H.aV,{style:{flexGrow:1},children:[void 0===p.newPageType?(0,i.jsx)(X.Z,{zoneType:"customType",zoneTypeFormat:d.format,tabId:a,title:"Static Zone",dataTip:"",fields:v,poolOfFieldsToCheck:x,showHints:!0,EditModal:U.Z,widgetsArray:R,onDeleteItem:y,onSave:g,onSaveNewField:b,onDragEnd:j,renderHintBase:function(e){var n=e.item;return"data".concat((0,K.Ti)(n.key))},renderFieldAccessor:function(e){return"data".concat((0,K.Ti)(e))},testId:"static-zone-content",isRepeatableCustomType:d.repeatable}):void 0,(0,i.jsx)(eP,{customType:f,tabId:a,sliceZone:h,onRemoveSharedSlice:S,onCreateSliceZone:C,onDeleteSliceZone:_})]})})})},eR=function(){var e,n,t,l=(0,Z.G)(),a=l.customType,c=l.setCustomType,d=k.Dc.toSM(a),m=(0,s.useState)(null===(e=d.tabs[0])||void 0===e?void 0:e.key),f=m[0],h=m[1],v=(0,s.useState)(),p=v[0],x=v[1],y=(0,o.useRouter)().query,b=(null===(n=d.tabs.find(function(e){return e.key===f}))||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"===a.format?(0,i.jsx)(C,{}):void 0,"true"===y.newPageType?(0,i.jsx)(eB,{tabId:d.tabs[0].key}):(0,i.jsxs)(_,{onValueChange:h,value:f,children:[(0,i.jsx)(S,{onAddNewTab:function(){x({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(){x({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(){x({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)(w,{value:e.key,children:(0,i.jsx)(eB,{tabId:e.key})},e.key)})]})]}),(null==p?void 0:p.type)==="CREATE_CUSTOM_TYPE_TAB"?(0,i.jsx)(L,{close:function(){x(void 0)},isOpen:!0,onSubmit:function(e){var n=e.id;c((0,u.vB)(a,n)),h(n)},tabIds:d.tabs.map(function(e){return e.key.toLowerCase()})}):void 0,(null==p?void 0:p.type)==="UPDATE_CUSTOM_TYPE_TAB"?(0,i.jsx)(M,{close:function(){x(void 0)},initialTabKey:p.tabKey,isOpen:!0,onSubmit:function(e){var n=e.id;c((0,u.HO)(a,p.tabKey,n)),f===p.tabKey&&h(n)},tabIds:d.tabs.filter(function(e){return e.key!==p.tabKey}).map(function(e){return e.key.toLowerCase()})}):void 0,(null==p?void 0:p.type)==="DELETE_CUSTOM_TYPE_TAB"?(0,i.jsx)(V,{close:function(){x(void 0)},isOpen:!0,onSubmit:function(){if(c((0,u.F$)(a,p.tabKey)),f===p.tabKey){var e,n=null===(e=d.tabs.find(function(e){return e.key!==p.tabKey}))||void 0===e?void 0:e.key;void 0!==n&&h(n)}}}):void 0]})},eO=t(52312),eK=t(28849),eU=t(54845),eX=t(13230),eG=t.n(eX),eW=function(e){var n=e.tabs,t=(0,x.Z)(e,["tabs"]);return(0,i.jsxs)(b.fC,(0,p.Z)((0,v.Z)({},t),{className:eG().root,defaultValue:n[0].label,orientation:"vertical",children:[(0,i.jsx)(b.aV,{className:eG().list,"aria-label":"content tabs",children:n.map(function(e,n){var t=e.label;return(0,i.jsx)(b.xz,{className:eG().trigger,value:t,children:(0,i.jsx)(r.xv,{className:eG().triggerText,component:"span",color:"inherit",children:t})},"".concat(t,"-trig").concat(n+1))})}),n.map(function(e,n){var t=e.label,l=e.content;return(0,i.jsx)(b.VY,{className:eG().content,value:t,children:(0,i.jsx)(r.xr,{className:eG().scrollArea,children:l})},"".concat(t,"-content").concat(n+1))})]}))},eq=t(82205),eY=t(88241),eQ=t(8857),e$=t(72757),eJ=t(49109),e0=t(25145),e1=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"})})},e2=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"})})},e7=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"})]})})},e4=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"})})},e8=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"})})},e9=t(69537),e3=t.n(e9);eQ.Z.registerLanguage("tsx",eJ.Z),eQ.Z.registerLanguage("markup",e$.Z),eQ.Z.alias("markup","vue"),eQ.Z.alias("markup","svelte");var e6=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)(e4,{});case"js":case"jsx":return(0,i.jsx)(e2,{});case"vue":return(0,i.jsx)(e8,{});case"svelte":return(0,i.jsx)(e7,{});default:return(0,i.jsx)(e1,{})}}()},e5=function(e){var n=e.code,t=e.onCopy,l=(0,s.useState)(!1),a=l[0],o=l[1];(0,s.useEffect)(function(){if(a){var e=setTimeout(function(){o(!1)},1200);return function(){clearTimeout(e)}}},[a]);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:a?"check":"contentCopy",hiddenLabel:a?"Code successfully copied":"Copy code"})},ne=function(e){var n=e.fileInfo,t=e.className,l=e.copy,a=e.code,o=e.onCopy,s=/language-(\w+)/.exec(null!=t?t:"");return(0,i.jsxs)("div",{className:e3().root,children:[(0,i.jsxs)("div",{className:e3().header,children:[void 0!==n?(0,i.jsxs)("div",{className:e3().fileInfo,children:[(0,i.jsx)(e6,{fileName:n.fileName}),(0,i.jsx)(r.xv,{className:e3().fileName,color:"grey11",children:n.fileName})]}):(0,i.jsx)("span",{}),!0===l?(0,i.jsx)(e5,{onCopy:o,code:String(a)}):null]}),null!==s&&s[1]?(0,i.jsx)(eQ.Z,{showLineNumbers:!0,customStyle:{margin:0,border:"none",fontSize:"12px",lineHeight:"18px",borderRadius:"none",backgroundColor:"#FFF",borderBottomLeftRadius:"4px",borderBottomRightRadius:"4px"},children:String(a).replace(/\n$/,""),style:e0.MS,language:s[1],PreTag:"div"}):a]})},nn=t(36065),nt="_1ecs97dfh5",ni=function(e){var n=(0,nn.p)();if(!0===e.inline)return(0,i.jsx)("code",(0,p.Z)((0,v.Z)({},e),{className:"_1ecs97df46 _1ecs97d18 _1ecs97d8l _1ecs97df0r _1ecs97dfg3 _1ecs97dfhg"}));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,l,a=null===(i=e.node)||void 0===i?void 0:null===(r=i.data)||void 0===r?void 0:r.meta;return{fileName:a.substring(1,a.length-1),language:null===(l=e.className)||void 0===l?void 0:l.split("-")[1]}}return null}(),r=function(){E.Xe.track({event:"page-type:copy-snippet",framework:n})};return(0,i.jsx)(ne,(0,v.Z)((0,p.Z)((0,v.Z)({copy:!0},e),{onCopy:r,code:e.children}),null!==t?{fileInfo:t}:{}))},nr=function(e){var n=e.markdown;return(0,i.jsx)(eq.D,{children:n,linkTarget:"_blank",remarkPlugins:[eY.Z],components:{code:function(e){return(0,i.jsx)(ni,(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:nt,children:e.children,component:"p",variant:"normal"})},pre:function(e){return(0,i.jsx)(r.xv,{className:nt,children:e.children,component:"pre",variant:"normal"})}}})};function nl(e){return na.apply(this,arguments)}function na(){return(na=(0,J.Z)(function(e){var n,t,i,r;return(0,en.__generator)(this,function(l){switch(l.label){case 0:return n=JSON.parse(e),[4,ei.j.documentation.read({kind:n.kind,data:n.data})];case 1:if(i=(t=l.sent()).errors,r=t.documentation,i.length>0)throw i;return[2,r]}})})).apply(this,arguments)}t(75317);var no=function(e){var n,t=e.model,l=(0,nn.p)(),a=(0,et.QT)(nl,[JSON.stringify({kind:"PageSnippet",data:{model:t}})]);if(0===a.length)return null;var o=function(){E.Xe.track({event:"page-type:open-snippet",framework:l})};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 _1ecs97dez2 _1ecs97dezb _1ecs97df7d _1ecs97df94",children:a.length>1?(0,i.jsx)(eW,{style:{flex:1},tabs:a.map(function(e,n){var t=e.label,r=e.content;return{label:null!=t?t:"Tab ".concat(n+1),content:(0,i.jsx)(nr,{markdown:r})}})}):(0,i.jsx)(r.xr,{style:{flex:1,padding:16},children:(0,i.jsx)(nr,{markdown:a[0].content})})})]})},ns=function(e){var n=e.model;return(0,i.jsx)("div",{children:(0,i.jsx)(P.S,{children:(0,i.jsx)(s.Suspense,{fallback:(0,i.jsx)(r.zx,{color:"grey",startIcon:"code",children:"Page snippet"}),children:(0,i.jsx)(no,{model:n})})})})},nc=function(){var e=(0,o.useRouter)(),n=(0,c.v9)(function(n){return{selectedCustomType:(0,eK.Jk)(n,(0,f.Ag)(e.query))}}).selectedCustomType;return((0,s.useEffect)(function(){n&&(0,eO.TG)(n)||e.replace("/")},[n,e]),n&&(0,eO.TG)(n))?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(a(),{children:(0,i.jsxs)("title",{children:[n.local.label," - Slice Machine"]})}),(0,i.jsx)(nd,{customType:n.local})]}):(0,i.jsx)(h.LN,{})},nd=function(e){var n=e.customType;return null===n?(0,i.jsx)(h.LN,{}):(0,i.jsx)(h.LN,{children:(0,i.jsx)(Z.k,{initialCustomType:k.Dc.fromSM(n),children:function(e){var t,l=e.actionQueueStatus,a=e.customType,o=e.setCustomType,s=(0,u.y6)(a),c=f.cd[n.format],v=ef.$[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=a.label)&&void 0!==t?t:a.id})]}),(0,i.jsxs)(h.K2,{children:[(0,i.jsx)(m.X,{status:l}),"page"===a.format?(0,i.jsx)(ns,{model:a}):void 0,(0,i.jsx)(eU._,{isChangesLocal:!0,format:s,customType:a,setLocalCustomType:o})]})]}),(0,i.jsx)(h.RN,{children:(0,i.jsx)(r.xu,{flexDirection:"column",minWidth:0,children:(0,i.jsx)(eR,{})})})]})}})})}},63269:function(e,n,t){"use strict";t.d(n,{E:function(){return c}});var i=t(22710),r=t(62230),l=t(85244),a=t(17064),o=t(99267),s=t(19334);function c(e){var n,t,c,d=(0,a.Z)((0,s.f)(),2),u=d[0],m=d[1],f=(c=(0,i.Z)(function(n){var t;return(0,o.__generator)(this,function(i){switch(i.label){case 0:return t=(0,l.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,m(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},f]}},19334:function(e,n,t){"use strict";t.d(n,{f:function(){return o}});var i=t(22710),r=t(99267),l=t(17329),a=t(81038);function o(){var e,n=(0,l.QT)(s,[]),t=(e=(0,i.Z)(function(e){return(0,r.__generator)(this,function(n){switch(n.label){case 0:return[4,a.j.project.writeSliceMachineConfig({config:e})];case 1:return n.sent(),(0,l.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,a.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),l=t(85244),a=t(99267),o=t(52322),s=t(2784),c=t(36131),d=t(75289),u=t(82770),m=t(88932),f=t(5479),h=t(17384),v=t(81038);function p(){return(p=(0,i.Z)(function(e){var n,t,i,r,l,o,s;return(0,a.__generator)(this,function(a){switch(a.label){case 0:n=e.sliceName,t=e.libraryName,i=e.onSuccess,a.label=1;case 1:return a.trys.push([1,4,,5]),r=(0,f.fo)(n),[4,v.j.slices.createSlice({libraryID:t,model:r})];case 2:if((l=a.sent().errors).length>0)throw l;return u.Xe.track({event:"slice:created",id:(0,h.MP)(n),name:n,library:t}),[4,i(r)];case 3:return a.sent(),[3,5];case 4:return o=a.sent(),s="An unexpected error happened while creating slice ".concat(n,"."),console.error(s,o),m.Am.error(s),[3,5];case 5:return[2]}})})).apply(this,arguments)}var x=t(50950),y=t(6134),b=t(90374),j=t(36960),g=t(98235),C=function(e){var n,t=e.onClose,m=e.onSuccess,f=e.localLibraries,h=e.remoteSlices,v=(0,b.Z)().createSliceSuccess,C=(0,s.useState)(!1),_=C[0],S=C[1],I=(0,x.g)().syncChanges,w=(n=(0,i.Z)(function(e){var n,t;return(0,a.__generator)(this,function(r){switch(r.label){case 0:var l;return n=e.sliceName,t=e.from,S(!0),[4,function(e){return p.apply(this,arguments)}({sliceName:n,libraryName:t,onSuccess:(l=(0,i.Z)(function(e){var n;return(0,a.__generator)(this,function(n){switch(n.label){case 0:return[4,(0,u.y0)()];case 1:return v(n.sent().libraries),m(e,t),I(),[2]}})}),function(e){return l.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){w(e)},initialValues:{sliceName:"",from:f[0].name},validate:function(e){return(0,g.h)(e,f,h)},content:{title:"Create a new slice"},children:function(e){var n=e.touched,t=e.values,i=e.setFieldValue,a=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?a.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:f.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,l.Z)((0,r.Z)({},e),{color:"#161618"})}},theme:function(e){return(0,l.Z)((0,r.Z)({},e),{colors:(0,l.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),l=t.n(r),a=t(74600),o=t.n(a),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()(l()(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 a=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)(a).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),l=t(75289);n.Z=function(e){var n=e.elems,t=e.renderElem,a=e.defineElementKey,o=e.gridTemplateMinPx,s=e.gridGap,c=e.sx;return(0,r.jsx)(l.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(a(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"}}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[453],{2754:function(e,n,t){"use strict";t.d(n,{R$:function(){return l},Qj:function(){return v},T9:function(){return f},nf:function(){return m},u2:function(){return d},_T:function(){return p}});var r=t(67557),o=t(62230),i=t(85244),s=t(98240),c=t(52322),u=t(22715),a=t(6277);t(69143);var l=function(e){var n=e.backgroundImage,t=e.style,u=(0,s.Z)(e,["backgroundImage","style"]),l=void 0!==n;return(0,c.jsx)("article",(0,i.Z)((0,o.Z)({},u),{className:(0,a.W)("_18bjhbz0 _1ecs97dez0 _1ecs97dez1 _1ecs97dez2 _1ecs97dezb _1ecs97dfiv _1ecs97dfix _1ecs97dfiz _1ecs97d3fg _1ecs97d3mt _1ecs97df0r _1ecs97df23 _1ecs97df2h _1ecs97dezp",(0,r.Z)({},"_18bjhbz1 _1ecs97dezx _1ecs97df4v",l)),style:(0,o.Z)({backgroundImage:l?"url(".concat(n,")"):void 0},t)}))},d=function(e){return(0,c.jsx)("div",(0,i.Z)((0,o.Z)({},e),{className:"_1ecs97dez0 _1ecs97dez1 _1ecs97dez2 _1ecs97dezb _1ecs97d6r8 _1ecs97d6yl _1ecs97df29 _1ecs97df2l _1ecs97dezp"}))},f=function(e){return(0,c.jsx)("div",(0,i.Z)((0,o.Z)({},e),{className:"_18bjhbz3 _1ecs97dez0 _1ecs97dez1 _1ecs97dez2 _1ecs97dezb _1ecs97dffv"}))},p=function(e){return(0,c.jsx)(u.xv,(0,i.Z)((0,o.Z)({},e),{className:"_18bjhbz4"}))},m=function(e){return(0,c.jsx)(u.xv,(0,i.Z)((0,o.Z)({},e),{className:"_18bjhbz5",color:"grey11"}))},v=function(e){return(0,c.jsx)("div",(0,i.Z)((0,o.Z)({},e),{className:"_18bjhbz6 _1ecs97dez0 _1ecs97dez8 _1ecs97dez1 _1ecs97dez2 _1ecs97df95 _1ecs97dfdl",color:"grey"}))}},91061:function(e,n,t){"use strict";t.d(n,{AK:function(){return b},E3:function(){return m},EN:function(){return v},F$:function(){return x},GA:function(){return C},HO:function(){return g},L4:function(){return j},Tr:function(){return p},Ue:function(){return L},gR:function(){return I},j6:function(){return _},kQ:function(){return T},l9:function(){return S},mf:function(){return y},vB:function(){return h},xS:function(){return Z},y6:function(){return a}});var r=t(67557),o=t(62230),i=t(85244),s=t(17064),c=t(98863),u=t(88866);function a(e){var n;return null!==(n=e.format)&&void 0!==n?n:"custom"}function l(e){return Object.entries(e.json)}function d(e,n){return e.json[n]}function f(e,n){var t=d(e,n);if(void 0!==t)return Object.entries(t).find(function(e){var n=(0,s.Z)(e,2);return(n[0],n[1]).type===u.SlicesFieldType})}function p(e,n){if(t=e,d=f(t,c=n),(p=(0,s.Z)(null!=d?d:[],2))[0],null!==(a=null==(m=p[1])?void 0:m.config)&&void 0!==a?a:void 0)return e;var t,c,a,d,p,m,v=function(e,n){var t,r=l(e),o=r.findIndex(function(e){return(0,s.Z)(e,1)[0]===n}),i=r.flatMap(function(e){var n=(0,s.Z)(e,2),t=(n[0],n[1]);return Object.keys(t).filter(function(e){return t[e].type===u.SlicesFieldType})}),c=o;do t="slices".concat(0!==c?c.toString():""),c++;while(i.includes(t));return t}(e,n);return(0,i.Z)((0,o.Z)({},e),{json:(0,i.Z)((0,o.Z)({},e.json),(0,r.Z)({},n,(0,i.Z)((0,o.Z)({},e.json[n]),(0,r.Z)({},v,{type:u.SlicesFieldType,fieldset:"Slice Zone"}))))})}function m(e,n){var t=d(e,n);if(void 0===t)return e;var s=Object.keys(t).find(function(e){return t[e].type===u.SlicesFieldType});if(void 0===s)return e;var a=(0,c.ud)(t,s);return(0,i.Z)((0,o.Z)({},e),{json:(0,i.Z)((0,o.Z)({},e.json),(0,r.Z)({},n,a))})}function v(e){var n,t,s=e.customType,a=e.sectionId,l=e.sliceId,f=d(s,a);if(void 0===f)return s;var p=Object.keys(f).find(function(e){return f[e].type===u.SlicesFieldType});if(void 0===p)return s;var m=f[p];if(m.type!==u.SlicesFieldType)return s;var v=(0,c.ud)(null!==(t=null===(n=m.config)||void 0===n?void 0:n.choices)&&void 0!==t?t:{},l);return(0,i.Z)((0,o.Z)({},s),{json:(0,i.Z)((0,o.Z)({},s.json),(0,r.Z)({},a,(0,i.Z)((0,o.Z)({},f),(0,r.Z)({},p,(0,i.Z)((0,o.Z)({},m),{config:(0,i.Z)((0,o.Z)({},m.config),{choices:v})})))))})}function y(e){var n,t=(0,i.Z)((0,o.Z)({},e),{format:"page"}),r=l(e)[0];if(r){var c=(0,s.Z)(r,1)[0];t=p(t,c)}return t}function h(e,n){return(0,i.Z)((0,o.Z)({},e),{json:(0,i.Z)((0,o.Z)({},e.json),(0,r.Z)({},n,{}))})}function x(e,n){var t=(0,c.ud)(e.json,n);return(0,i.Z)((0,o.Z)({},e),{json:t})}function g(e,n,t){if(n===t)return e;var r=Object.keys(e.json).reduce(function(r,o){return o===n?r[t]=e.json[o]:r[o]=e.json[o],r},{});return(0,i.Z)((0,o.Z)({},e),{json:r})}function Z(e){var n=e.customType,t=e.sectionId,c=e.newField,a=e.newFieldId,l=n.json[t],d=f(n,t),p=Object.fromEntries(Object.entries(l).filter(function(e){var n=(0,s.Z)(e,2);return(n[0],n[1]).type!==u.SlicesFieldType})),m=(0,i.Z)((0,o.Z)({},p),(0,r.Z)({},a,c));if(void 0!==d){var v=(0,s.Z)(d,2),y=v[0],h=v[1];m[y]=h}return F({customType:n,sectionId:t,updatedSection:m})}function b(e){var n=e.customType,t=e.sectionId,r=e.fieldId,o=(0,c.ud)(n.json[t],r);return F({customType:n,sectionId:t,updatedSection:o})}function j(e){var n=e.customType,t=e.sectionId,r=e.previousFieldId,o=e.newFieldId,i=e.newField,s=w({fields:n.json[t],previousFieldId:r,newFieldId:o,newField:i});return F({customType:n,sectionId:t,updatedSection:s})}function I(e){var n=e.customType,t=e.sectionId,r=e.sourceIndex,o=e.destinationIndex,i=n.json[t],c=f(n,t),a=Object.fromEntries(Object.entries(i).filter(function(e){var n=(0,s.Z)(e,2);return(n[0],n[1]).type!==u.SlicesFieldType})),l=z({fields:a,sourceIndex:r,destinationIndex:o});if(void 0!==c){var d=(0,s.Z)(c,2),p=d[0],m=d[1];l[p]=m}return F({customType:n,sectionId:t,updatedSection:l})}function T(e){var n,t=e.customType,s=e.sectionId,c=e.groupFieldId,u=e.newField,a=e.newFieldId,l=k({customType:t,sectionId:s,groupFieldId:c}),d=null==l?void 0:null===(n=l.config)||void 0===n?void 0:n.fields;if(!l)return t;var f=O(l,(0,i.Z)((0,o.Z)({},d),(0,r.Z)({},a,u)));return F({customType:t,sectionId:s,updatedSection:(0,i.Z)((0,o.Z)({},t.json[s]),(0,r.Z)({},c,f))})}function _(e){var n,t=e.customType,s=e.sectionId,u=e.groupFieldId,a=e.fieldId,l=k({customType:t,sectionId:s,groupFieldId:u}),d=null==l?void 0:null===(n=l.config)||void 0===n?void 0:n.fields;if(!l||!d)return t;var f=(0,c.ud)(d,a),p=O(l,f);return F({customType:t,sectionId:s,updatedSection:(0,i.Z)((0,o.Z)({},t.json[s]),(0,r.Z)({},u,p))})}function S(e){var n,t=e.customType,s=e.sectionId,c=e.groupFieldId,u=e.previousFieldId,a=e.newFieldId,l=e.newField,d=k({customType:t,sectionId:s,groupFieldId:c}),f=null==d?void 0:null===(n=d.config)||void 0===n?void 0:n.fields;if(!d||!f)return t;var p=w({fields:f,previousFieldId:u,newFieldId:a,newField:l}),m=O(d,p);return F({customType:t,sectionId:s,updatedSection:(0,i.Z)((0,o.Z)({},t.json[s]),(0,r.Z)({},c,m))})}function C(e){var n,t=e.customType,s=e.sectionId,c=e.groupFieldId,u=e.sourceIndex,a=e.destinationIndex,l=k({customType:t,sectionId:s,groupFieldId:c}),d=null==l?void 0:null===(n=l.config)||void 0===n?void 0:n.fields;if(!l||!d)return t;var f=z({fields:d,sourceIndex:u,destinationIndex:a}),p=O(l,f);return F({customType:t,sectionId:s,updatedSection:(0,i.Z)((0,o.Z)({},t.json[s]),(0,r.Z)({},c,p))})}function F(e){var n=e.customType,t=e.sectionId,s=e.updatedSection;return(0,i.Z)((0,o.Z)({},n),{json:(0,i.Z)((0,o.Z)({},n.json),(0,r.Z)({},t,s))})}function w(e){var n=e.fields,t=e.previousFieldId,r=e.newFieldId,o=e.newField;return Object.entries(n).reduce(function(e,n){var i=(0,s.Z)(n,2),c=i[0],u=i[1];return c===t?e[r]=o:c!==r&&(e[c]=u),e},{})}function z(e){var n=e.fields,t=e.sourceIndex,r=e.destinationIndex,o=Object.entries(n),i=(0,s.Z)(o.splice(t,1),1)[0];return o.splice(r,0,i),Object.fromEntries(o)}function k(e){var n=e.customType,t=e.sectionId,r=e.groupFieldId,o=n.json[t][r];if(o.type===u.GroupFieldType)return o}function O(e,n){return(0,i.Z)((0,o.Z)({},e),{config:(0,i.Z)((0,o.Z)({},e.config),{fields:n})})}function L(e){var n,t,r=e.id,i=e.label,s=e.repeatable,c=e.format,u=(n=s,t=c,!1===n&&"page"===t?(0,o.Z)({},R,E):!1===n?N:"page"===t?(0,o.Z)({},M,E):A);return{format:c,id:r,json:u,label:i,repeatable:s,status:!0}}var N={Main:{}},R={Main:{slices:{config:{choices:{}},fieldset:"Slice Zone",type:"Slices"}}},A={Main:{uid:{config:{label:"UID"},type:"UID"}}},M={Main:(0,o.Z)({},A.Main,R.Main)},E={"SEO & Metadata":{meta_description:{config:{label:"Meta Description",placeholder:"A brief summary of the page"},type:"Text"},meta_image:{config:{constraint:{height:1260,width:2400},label:"Meta Image",thumbnails:[]},type:"Image"},meta_title:{config:{label:"Meta Title",placeholder:"A title of the page used for social media and search engines"},type:"Text"}}}},54845:function(e,n,t){"use strict";t.d(n,{_:function(){return N}});var r=t(22710),o=t(99267),i=t(52322),s=t(22715),c=t(5632),u=t(2784),a=t(65186),l=t(59326),d=t(75289),f=t(88932),p=t(81038),m=t(78656);function v(){return(v=(0,r.Z)(function(e){var n,t,r,i,s,c;return(0,o.__generator)(this,function(o){switch(o.label){case 0:n=e.customType,t=e.onSuccess,r=m.$[n.format],o.label=1;case 1:return o.trys.push([1,3,,4]),[4,p.j.customTypes.deleteCustomType({id:n.id})];case 2:if((i=o.sent().errors).length>0)throw i;return t(),f.Am.success("".concat(r.name({start:!0,plural:!1})," deleted")),[3,4];case 3:return s=o.sent(),c="Internal Error: ".concat(r.name({start:!0,plural:!1})," could not be deleted"),console.error(c,s),f.Am.error(c),[3,4];case 4:return[2]}})})).apply(this,arguments)}var y=t(34226),h=t(98898),x=t(83399),g=t(90374),Z=function(e){var n,t=e.customType,s=e.format,c=e.onClose,f=e.onDeleteCustomTypeSuccess,p=m.$[s],Z=(0,u.useState)(!1),b=Z[0],j=Z[1],I=(0,g.Z)().deleteCustomTypeSuccess,T=(n=(0,r.Z)(function(){return(0,o.__generator)(this,function(e){switch(e.label){case 0:return j(!0),[4,function(e){return v.apply(this,arguments)}({customType:t,onSuccess:function(){return I(t.id)}})];case 1:return e.sent(),f(),[2]}})}),function(){return n.apply(this,arguments)}),_=(0,l.B7)().theme;return(0,i.jsx)(x.Z,{isOpen:!0,shouldCloseOnOverlayClick:!0,style:{content:{maxWidth:612}},onRequestClose:function(){return c()},children:(0,i.jsx)(h.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(){var e;return(0,i.jsxs)(d.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.jsxs)(d.kC,{sx:{alignItems:"center"},children:[(0,i.jsx)(a.$vK,{size:20,color:null===(e=_.colors)||void 0===e?void 0:e.greyIcon}),(0,i.jsxs)(d.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:["Delete"," ",p.name({start:!1,plural:!1})]})]}),(0,i.jsx)(d.x8,{type:"button",onClick:function(){return c()}})]})},Footer:function(){return(0,i.jsxs)(d.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)(y.z,{label:"Cancel",variant:"secondary",onClick:function(){return c()},sx:{mr:"10px",fontWeight:"bold",color:"grey12",borderRadius:6}}),void 0!==t&&(0,i.jsx)(y.z,{label:"Delete",variant:"danger",isLoading:b,onClick:function(){T()},sx:{minHeight:39,minWidth:78}})]})},children:(0,i.jsxs)("div",{children:["This action will immediately make the following change:",(0,i.jsx)("ul",{children:(0,i.jsxs)("li",{children:["Delete the"," ",(0,i.jsxs)(d.xv,{sx:{fontWeight:"bold"},children:["customtypes/",null==t?void 0:t.id,"/"]})," ","directory."]})}),"The next time you push your changes to Prismic, the following change will happen:",(0,i.jsx)("ul",{children:(0,i.jsxs)("li",{children:["Remove the"," ",p.name({start:!1,plural:!1})," and any associated Documents from your repository."]})})]})})})},b=t(62230),j=t(85244),I=t(56580);function T(){return(T=(0,r.Z)(function(e){var n,t,r,i,s,c,u,a;return(0,o.__generator)(this,function(o){switch(o.label){case 0:n=e.model,t=e.newLabel,r=e.onSuccess,i=m.$[n.format],o.label=1;case 1:return o.trys.push([1,3,,4]),s=(0,j.Z)((0,b.Z)({},n),{label:t}),[4,p.j.customTypes.renameCustomType({model:s})];case 2:if((c=o.sent().errors).length>0)throw c;return r(s),f.Am.success("".concat(i.name({start:!0,plural:!1})," renamed")),[3,4];case 3:return u=o.sent(),a="Internal Error: ".concat(i.name({start:!0,plural:!1})," could not be renamed"),console.error(a,u),f.Am.error(a),[3,4];case 4:return[2]}})})).apply(this,arguments)}var _=t(50950),S=t(28849),C=t(6134),F=t(36960),w=function(e){var n,t,s,c=e.isChangesLocal,a=e.customType,l=e.format,f=e.onClose,p=e.setLocalCustomType,v=null!==(n=null==a?void 0:a.label)&&void 0!==n?n:"",y=null!==(t=null==a?void 0:a.id)&&void 0!==t?t:"",h=(0,g.Z)().renameCustomTypeSuccess,x=(0,_.g)().syncChanges,Z=(0,u.useState)(!1),w=Z[0],z=Z[1],k=(s=(0,r.Z)(function(e){return(0,o.__generator)(this,function(n){switch(n.label){case 0:if(z(!0),!(c&&p))return[3,1];return p((0,j.Z)((0,b.Z)({},a),{label:e.customTypeName})),[3,3];case 1:return[4,function(e){return T.apply(this,arguments)}({model:a,newLabel:e.customTypeName,onSuccess:function(e){h(e),x()}})];case 2:n.sent(),n.label=3;case 3:return z(!1),f(),[2]}})}),function(e){return s.apply(this,arguments)}),O=(0,I.v9)(function(e){return{customTypeLabels:(0,S.YS)(e)}}).customTypeLabels,L=m.$[l];return(0,i.jsx)(C.Z,{isOpen:!0,testId:"rename-custom-type-modal",widthInPx:"530px",formId:"rename-custom-type-modal-".concat(y),buttonLabel:"Rename",close:f,onSubmit:function(e){k(e)},initialValues:{customTypeName:v},isLoading:w,content:{title:"Rename a ".concat(L.name({start:!1,plural:!1}))},validate:function(e){var n=e.customTypeName,t={};return n&&n.length||(t.customTypeName="Cannot be empty."),void 0!=t.customTypeName&&O.includes(n)&&v!==n&&(t.customTypeName="".concat(L.name({start:!0,plural:!1})," name is already taken.")),Object.keys(t).length>0?t:void 0},children:function(e){var n=e.errors;return(0,i.jsx)(d.xu,{children:(0,i.jsx)(F.W,{name:"customTypeName",label:"".concat(L.name({start:!0,plural:!1})," Name"),placeholder:"A display name for the ".concat(L.name({start:!1,plural:!1})),error:n.customTypeName,testId:"custom-type-name-input"})})}})},z=t(82770),k=t(91061);function O(){return(O=(0,r.Z)(function(e,n){var t,r,i,s,c;return(0,o.__generator)(this,function(o){switch(o.label){case 0:t=m.$[e.format],o.label=1;case 1:return o.trys.push([1,3,,4]),r=(0,k.mf)(e),[4,(0,z.KA)(r)];case 2:if((i=o.sent().errors).length>0)throw i;return n(r),f.Am.success("".concat(t.name({start:!0,plural:!1})," converted to page type")),[3,4];case 3:return s=o.sent(),c="Internal Error: ".concat(t.name({start:!0,plural:!1})," not converted to page type"),console.error(c,s),f.Am.error(c),[3,4];case 4:return[2]}})})).apply(this,arguments)}var L=t(67445),N=function(e){var n,t=e.format,a=e.customType,l=e.isChangesLocal,d=e.setLocalCustomType,f=(0,c.useRouter)(),p=(0,g.Z)().saveCustomTypeSuccess,m=(0,u.useState)(!1),v=m[0],y=m[1],h=(0,u.useState)(!1),x=h[0],b=h[1],j=(0,u.useState)(!1),I=j[0],T=j[1],_=(n=(0,r.Z)(function(){var e,n;return(0,o.__generator)(this,function(t){switch(t.label){case 0:return T(!0),[4,function(e,n){return O.apply(this,arguments)}(a,p)];case 1:return t.sent(),e=L.cd.custom.getBuilderPagePathname(a.id),f.asPath===e&&(n=L.cd.page.getBuilderPagePathname(a.id),f.replace(n)),T(!1),[2]}})}),function(){return n.apply(this,arguments)}),S=function(){var e,n=L.cd[null!==(e=a.format)&&void 0!==e?e:"custom"].tablePagePathname;f.asPath!==n?f.replace(n):y(!1)};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(s.h_,{modal:!0,children:[(0,i.jsx)(s.$F,{disabled:I,children:(0,i.jsx)(s.hU,{color:"grey","data-testid":"editDropdown",hiddenLabel:"Custom type actions",icon:"moreVert",loading:I,variant:"solid"})}),(0,i.jsxs)(s.AW,{align:"end",children:[(0,i.jsx)(s.Xi,{startIcon:(0,i.jsx)(s.I5,{name:"edit"}),onSelect:function(){b(!0)},children:"Rename"}),"custom"===t&&!l&&(0,i.jsx)(s.Xi,{startIcon:(0,i.jsx)(s.I5,{name:"driveFileMove"}),onSelect:function(){_()},children:"Convert to page type"}),(0,i.jsx)(s.Xi,{color:"tomato",startIcon:(0,i.jsx)(s.I5,{name:"delete"}),onSelect:function(){y(!0)},children:"Remove"})]})]}),v?(0,i.jsx)(Z,{format:t,customType:a,onClose:function(){return y(!1)},onDeleteCustomTypeSuccess:S}):null,x?(0,i.jsx)(w,{format:t,customType:a,isChangesLocal:l,onClose:function(){return b(!1)},setLocalCustomType:d}):null]})}},34226:function(e,n,t){"use strict";t.d(n,{z:function(){return d}});var r=t(62230),o=t(85244),i=t(98240),s=t(52322),c=t(2784),u=t(75289),a=function(e,n){return e?"".concat(e,"-").concat(n):""},l=function(e){switch(e){case"white":case"secondaryMedium":case"secondarySmall":case"secondary":return"#1A1523";default:return"grey01"}},d=(0,c.forwardRef)(function(e,n){var t=e.label,c=e.Icon,d=e.type,f=e.form,p=e.isLoading,m=void 0!==p&&p,v=e.disabled,y=e.onClick,h=e.sx,x=e.iconSize,g=void 0===x?16:x,Z=e.iconFill,b=e.variant,j=void 0===b?"primary":b,I=(0,i.Z)(e,["label","Icon","type","form","isLoading","disabled","onClick","sx","iconSize","iconFill","variant"]);return(0,s.jsx)(u.zx,(0,o.Z)((0,r.Z)({ref:n,sx:(0,r.Z)((0,o.Z)((0,r.Z)({},void 0===h?{}:h),{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"}),m?{cursor:"wait !important"}:{}),type:d,form:f,disabled:void 0!==v&&v||m,onClick:m?void 0:y,variant:j},I),{children:m?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(u.$j,{size:g,color:l(j),"data-testid":a(I["data-testid"],"spinner")}),c&&t]}):(0,s.jsxs)(s.Fragment,{children:[c&&(0,s.jsx)(c,{size:g,fill:Z,"data-testid":a(I["data-testid"],"icon")}),t]})}))})},36960:function(e,n,t){"use strict";t.d(n,{W:function(){return c}});var r=t(62230),o=t(52322),i=t(63397);t(2784);var s=t(75289),c=function(e){var n=e.name,t=e.label,c=e.placeholder,u=e.error,a=e.testId,l=e.onChange;return(0,o.jsxs)(s.xu,{mb:3,children:[(0,o.jsx)(s.__,{htmlFor:n,mb:2,children:t}),(0,o.jsx)(i.gN,(0,r.Z)({name:n,type:"text",placeholder:c,as:s.II,autoComplete:"off"},l?{onChange:l}:null,a?{"data-testid":a}:null)),u?(0,o.jsx)(s.xv,{"data-testid":a?"".concat(a,"-error"):"input-error",sx:{color:"error",mt:1},children:u}):null]})}},6134:function(e,n,t){"use strict";var r=t(62230),o=t(85244),i=t(52322),s=t(63397),c=t(37149),u=t.n(c),a=t(75289),l=t(34226),d=t(83399),f=t(98898);n.Z=function(e){var n=e.children,t=e.close,c=e.isOpen,p=e.formId,m=e.validate,v=e.onSubmit,y=e.widthInPx,h=e.initialValues,x=e.content.title,g=e.cardProps,Z=e.omitFooter,b=void 0!==Z&&Z,j=e.isLoading,I=void 0!==j&&j,T=e.buttonLabel,_=void 0===T?"Save":T,S=e.testId,C=e.actionMessage;return u().setAppElement("#__next"),(0,i.jsx)(d.Z,{isOpen:c,shouldCloseOnOverlayClick:!0,onRequestClose:t,contentLabel:x,style:{content:{width:null!=y?y:"900px"}},children:(0,i.jsx)(s.J9,{initialValues:h,validate:function(e){return m?m(e):void 0},onSubmit:function(e){v(e)},children:function(e){var c=e.isValid,u=e.isSubmitting,d=e.values,m=e.errors,v=e.touched,y=e.setFieldValue,h=e.setValues;return(0,i.jsx)(s.l0,(0,o.Z)((0,r.Z)({id:p},null!=S?{"data-testid":S}:null),{children:(0,i.jsx)(f.Z,(0,o.Z)((0,r.Z)({borderFooter:!0,footerSx:{p:3,position:"sticky",bottom:0,background:"gray"},bodySx:{px:4,py:4},sx:{border:"none"}},g),{Header:function(e){var n=e.radius;return(0,i.jsxs)(a.kC,{sx:{position:"sticky",top:0,zIndex:1,p:"16px",pl:4,bg:"headSection",alignItems:"center",justifyContent:"space-between",borderTopLeftRadius:n,borderTopRightRadius:n,borderBottom:function(e){var n;return"1px solid ".concat(null===(n=e.colors)||void 0===n?void 0:n.borders)}},children:[(0,i.jsx)(a.X6,{sx:{fontSize:"20px"},children:x}),(0,i.jsx)(a.x8,{type:"button",onClick:t})]})},Footer:b?null:(0,i.jsxs)(a.kC,{sx:{alignItems:"space-between"},children:[(0,i.jsx)(a.kC,{sx:{fontSize:"14px",alignItems:"center"},children:"function"==typeof C?C(e):C}),(0,i.jsxs)(a.kC,{sx:{ml:"auto"},children:[(0,i.jsx)(a.zx,{mr:2,type:"button",onClick:t,variant:"secondary",disabled:u||I,children:"Cancel"}),(0,i.jsx)(l.z,{label:_,form:p,type:"submit",disabled:!c||u||I,isLoading:u||I,sx:{fontWeight:"400",paddingBlock:"8px",paddingInline:"16px",fontSize:"14px",borderRadius:"4px"}})]})]}),children:n({isValid:c,isSubmitting:u,values:d,errors:m,touched:v,setFieldValue:y,setValues:h})}))}))}})})}},69143:function(){}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[614],{24804:function(e,n,t){"use strict";t.d(n,{Zb:function(){return b},T$:function(){return p},eW:function(){return x},ZB:function(){return _},Lm:function(){return g}});var o=t(67557),i=t(62230),r=t(85244),c=t(98240),d=t(52322),s=t(50002),a=t(22715),l=t(6277),u=t(2784);t(71457);var h={solid:"_1ecs97d3c _1ecs97dap _1ecs97d4pk _1ecs97d4wx",outlined:"_1ecs97d2i _1ecs97d9v _1ecs97dw _1ecs97d89 _1ecs97d2w _1ecs97da9 _1ecs97d4oq _1ecs97d4w3 _1ecs97d4oc _1ecs97d4vp"},v={div:"_1ecs97dez0 _1ecs97dez3 _1ecs97dezd",img:"kedahr9 _1ecs97df77 _1ecs97dezn"},m={small:"kedahr2",medium:"kedahr3"},f={solid:"kedahr4 _1ecs97d1u _1ecs97d97 _1ecs97d4pe _1ecs97d4wr",outlined:"kedahr5 _1ecs97d18 _1ecs97d8l _1ecs97d4o6 _1ecs97d4vj"},b=function(e){var n,t=e.checked,a=e.size,v=e.variant,b=void 0===v?"solid":v,_=(e.interactive,e.disabled,e.onClick,e.href,e.component),p=void 0===_?"a":_,x=(e.replace,(0,c.Z)(e,["checked","size","variant","interactive","disabled","onClick","href","component","replace"])),g=(0,r.Z)((0,i.Z)({},x),{className:(0,l.W)("_1ecs97dez0 _1ecs97dez2 _1ecs97dezb _1ecs97d3fg _1ecs97d3mt _1ecs97df0r _1ecs97df23 _1ecs97df2h _1ecs97dez1 _1ecs97dezr _1ecs97dezv",m[void 0===a?"medium":a],f[b],(n={},(0,o.Z)(n,"kedahr6",e.interactive),(0,o.Z)(n,h[b],e.interactive),n)),"data-state":!0===(void 0!==t&&t)?"checked":void 0});return!0===e.interactive&&void 0===e.href?(0,d.jsx)("div",(0,r.Z)((0,i.Z)({},g),{"data-disabled":!0===e.disabled?"":void 0,onClick:function(n){if(!0!==e.disabled&&void 0!==e.onClick){var t=n.target;(0,s.JY)(t)===n.currentTarget&&e.onClick(n)}},tabIndex:!0===e.disabled?void 0:0})):!0===e.interactive?(0,u.createElement)(p,(0,i.Z)((0,r.Z)((0,i.Z)({},g),{href:e.href,onClick:function(e){var n=e.target;(0,s.JY)(n)!==e.currentTarget&&e.preventDefault()}}),"a"===p?{}:{replace:e.replace})):(0,d.jsx)("div",(0,i.Z)({},g))},_=function(e){var n=e.className,t=e.component,o=void 0===t?"img":t,s=e.overlay,a=(0,c.Z)(e,["className","component","overlay"]);return(0,d.jsxs)("div",{className:"kedahr7 _1ecs97dez0 _1ecs97dez2 _1ecs97dezb _1ecs97deze _1ecs97dezd _1ecs97df7d _1ecs97dezv",children:[(0,u.createElement)(o,(0,r.Z)((0,i.Z)({},a),{className:(0,l.W)(v[o],n)})),Boolean(s)?(0,d.jsx)("div",{className:"kedahra _1ecs97dez0 _1ecs97dez3 _1ecs97df9d _1ecs97dezt _1ecs97df0i",children:s}):void 0]})},p=function(e){return(0,d.jsx)("div",(0,r.Z)((0,i.Z)({},e),{className:"kedahrc kedahrb _1ecs97dez0 _1ecs97dez2 _1ecs97dez8 _1ecs97dez1 _1ecs97dezc _1ecs97df71 _1ecs97dezi"}))},x=function(e){var n=e.action,t=e.subtitle,o=e.title,s=(0,c.Z)(e,["action","subtitle","title"]);return(0,d.jsxs)("div",(0,r.Z)((0,i.Z)({},s),{className:"kedahrd kedahrb _1ecs97dez0 _1ecs97dez2 _1ecs97dez8 _1ecs97dez1 _1ecs97dezc _1ecs97df92 _1ecs97df73",children:[(0,d.jsxs)("div",{className:"kedahre _1ecs97dez0 _1ecs97dez2 _1ecs97dezb _1ecs97deze _1ecs97dezd _1ecs97df51",children:[(0,d.jsx)(a.xv,{component:"span",noWrap:!0,variant:"bold",children:o}),(0,d.jsx)(a.xv,{color:"grey11",component:"span",noWrap:!0,variant:"small",children:t})]}),n]}))},g=function(e){var n=e.children,t=(0,c.Z)(e,["children"]);return(0,d.jsx)("div",(0,r.Z)((0,i.Z)({},t),{className:"kedahrf _1ecs97dez0 _1ecs97dez2 _1ecs97dezb _1ecs97df6v _1ecs97dfb5 _1ecs97dezh _1ecs97dfhi _1ecs97dezt",children:(0,d.jsx)(a.xv,{align:"center",color:"inherit",component:"span",noWrap:!0,variant:"smallBold",children:n})}))}},34728:function(e,n,t){"use strict";t.d(n,{O:function(){return d}});var o=t(52322),i=t(22715),r=t(94007),c=t(79096),d=function(e){var n=function(e){var n=s[e.modelType];switch(e.modelStatus){case r.GJ.New:return{badgeColor:"green",badgeTitle:"New",tooltipContent:"This ".concat(n," exists only locally. Upon sync, it will be pushed to your remote repository.")};case r.GJ.Modified:return{badgeColor:"amber",badgeTitle:"Modified",tooltipContent:"This ".concat(n," has been modified locally. Upon sync, changes will be pushed to your remote repository.")};case r.GJ.Synced:return{badgeColor:"purple",badgeTitle:"Synced",tooltipContent:"This ".concat(n," is in sync with the remote repository.")};case r.GJ.Deleted:return{badgeColor:"tomato",badgeTitle:"Deleted",tooltipContent:"This ".concat(n," has been deleted locally.")};case r.GJ.Unknown:if(!e.isOnline)return{badgeColor:"grey",badgeTitle:"Unknown",tooltipContent:"Data from the remote repository could not be fetched (no internet connection)."};if(e.authStatus===c.t.UNAUTHORIZED)return{badgeColor:"grey",badgeTitle:"Unknown",tooltipContent:"Data from the remote repository could not be fetched (not connected to Prismic)."};if(e.authStatus===c.t.FORBIDDEN)return{badgeColor:"grey",badgeTitle:"Unknown",tooltipContent:"Data from the remote repository could not be fetched (you don't have access to the repository)."};default:return{badgeColor:"grey",badgeTitle:"Unknown",tooltipContent:"Data from the remote repository could not be fetched (unknown error)."}}}(e),t=n.badgeColor,d=n.badgeTitle,a=n.tooltipContent;return(0,o.jsx)(i.u,{content:a,side:"bottom",children:(0,o.jsx)(i.Ct,{color:t,title:d})})},s={CustomType:"type",Slice:"slice"}},56319:function(e,n,t){"use strict";t.d(n,{b:function(){return _}});var o=t(62230),i=t(85244),r=t(52322),c=t(22715),d=t(39097),s=t.n(d),a=t(24804),l=t(5479),u=t(34728),h=t(49451),v=function(e){return(0,r.jsx)("svg",(0,i.Z)((0,o.Z)({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:(0,r.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 5.5C4 4.67157 4.67157 4 5.5 4H18.5C19.3284 4 20 4.67157 20 5.5V12.4413C20 12.4512 19.9997 12.461 19.9991 12.4707C20.0072 12.6083 19.9586 12.7485 19.8536 12.8536C19.6583 13.0488 19.3417 13.0488 19.1464 12.8536L16.3536 10.0607C16.1583 9.8654 15.8417 9.8654 15.6464 10.0607L11.8536 13.8536C11.6583 14.0488 11.3417 14.0488 11.1464 13.8536L9.35355 12.0607C9.15829 11.8654 8.84171 11.8654 8.64645 12.0607L5 15.7071V18.5C5 18.7761 5.22386 19 5.5 19H12.5C12.7761 19 13 19.2239 13 19.5C13 19.7761 12.7761 20 12.5 20H5.5C4.67157 20 4 19.3284 4 18.5V15.5003V15.4997V5.5ZM11.5 12.7929L14.9393 9.35355C15.5251 8.76777 16.4749 8.76777 17.0607 9.35355L19 11.2929V5.5C19 5.22386 18.7761 5 18.5 5H5.5C5.22386 5 5 5.22386 5 5.5V14.2929L7.93934 11.3536C8.52513 10.7678 9.47487 10.7678 10.0607 11.3536L11.5 12.7929ZM16.5 13C16.7761 13 17 13.2239 17 13.5V16H19.5C19.7761 16 20 16.2239 20 16.5C20 16.7761 19.7761 17 19.5 17H17V19.5C17 19.7761 16.7761 20 16.5 20C16.2239 20 16 19.7761 16 19.5V17H13.5C13.2239 17 13 16.7761 13 16.5C13 16.2239 13.2239 16 13.5 16H16V13.5C16 13.2239 16.2239 13 16.5 13Z",fill:"currentColor"})}))},m=t(67557),f=t(17064),b={build:function(e){var n;return(0,i.Z)((0,o.Z)({},e),{screenshots:(n=e.screenshots)?Object.entries(n).reduce(function(e,n){var t,r=(0,f.Z)(n,2),c=r[0],d=r[1];return d.hash?(0,i.Z)((0,o.Z)({},e),(0,m.Z)({},c,(0,o.Z)({},d,{hash:d.hash}))):e},{}):{}})},variation:function(e,n){if(e.model.variations.length)return n?e.model.variations.find(function(e){return e.id===n}):e.model.variations[0]}},_=function(e){var n,t=e.action,d=e.isComingSoon,m=void 0!==d&&d,f=e.isDeleted,_=e.onUpdateScreenshot,g=e.selected,C=void 0!==g&&g,j=e.slice,Z=e.variant,k=e.variationId,y=b.variation(j,k);if(!y)return null;var z=(0,l.d7)(j,y),S=m||void 0!==f&&f,w=!S&&!!_,T="outlined"===Z,N=void 0!==k;return n="selection"===e.mode?{disabled:S,interactive:!0,onClick:function(){e.onSelectedChange(!C)}}:S?{interactive:!1}:{component:s(),href:h.Y.getBuilderPagePathname({libraryName:j.href,sliceName:j.model.name,variationId:y.id}),interactive:!0,replace:e.replace},(0,r.jsxs)(a.Zb,(0,i.Z)((0,o.Z)({"aria-label":"".concat(j.model.name," ").concat(y.name," slice card"),checked:C,"data-testid":"shared-slice-card"},n,"outlined"===Z?{size:"small",variant:"outlined"}:{}),{children:[void 0!==z?(0,r.jsx)(a.ZB,{alt:"Preview image",overlay:w&&!T?(0,r.jsx)(c.xu,{alignItems:"center",justifyContent:"center",children:(0,r.jsx)(p,{onClick:_})}):void 0,src:z}):(0,r.jsx)(a.ZB,{component:"div",children:(0,r.jsxs)(c.xu,{alignItems:"center",flexDirection:"column",gap:8,justifyContent:"center",children:[(0,r.jsx)(c.xv,{color:"grey11",component:"span",children:"No screenshot available"}),w&&!T?(0,r.jsx)(p,{onClick:_}):void 0]})}),(0,r.jsx)(a.eW,{action:"checkbox"===t.type&&"selection"===e.mode?(0,r.jsx)("div",{onClick:function(e){return e.stopPropagation()},children:(0,r.jsx)(c.XZ,{checked:C,disabled:S,onCheckedChange:e.onSelectedChange})}):"menu"===t.type?(0,r.jsxs)(c.h_,{modal:!0,children:[(0,r.jsx)(c.$F,{disabled:S,children:(0,r.jsx)(c.hU,{hiddenLabel:"Slice actions",icon:"moreVert"})}),(0,r.jsxs)(c.AW,{align:"end","data-testid":"slice-action-icon-dropdown",children:[w&&T?(0,r.jsx)(c.Xi,{onSelect:_,startIcon:(0,r.jsx)(v,{}),children:"Update screenshot"}):void 0,(0,r.jsx)(c.Xi,{onSelect:t.onRename,startIcon:(0,r.jsx)(c.I5,{name:"edit"}),children:"Rename"}),!0===t.removeDisabled&&N?(0,r.jsx)(c.u,{content:"The slice needs to have at least one variation.",side:"bottom",stableMount:!0,children:(0,r.jsx)(x,{disabled:!0,onSelect:t.onRemove})}):(0,r.jsx)(x,{disabled:!0===t.removeDisabled,onSelect:t.onRemove})]})]}):"remove"===t.type?(0,r.jsx)(c.hU,{icon:"close",onClick:function(){return!S&&t.onRemove()},hiddenLabel:"Remove slice"}):"status"===t.type?(0,r.jsx)(u.O,{authStatus:t.authStatus,isOnline:t.isOnline,modelStatus:t.modelStatus,modelType:"Slice"}):void 0,subtitle:(0,r.jsxs)(r.Fragment,{children:[N?y.id:"".concat(j.model.variations.length," variation").concat(j.model.variations.length>1?"s":""),m?(0,r.jsxs)(c.xv,{color:"purple11",component:"span",variant:"small",children:[" ","• (coming soon)"]}):void 0]}),title:N?y.name:j.model.name}),w&&!N&&(0,l.cx)(j)>0?(0,r.jsx)(a.Lm,{children:"Missing screenshot"}):void 0]}))},p=function(e){return(0,r.jsx)(c.zx,{onClick:e.onClick,renderStartIcon:function(){return(0,r.jsx)(v,{color:c.TV.color.greyLight11})},color:"grey",children:"Update screenshot"})},x=function(e){return(0,r.jsx)(c.Xi,(0,i.Z)((0,o.Z)({},e),{color:"tomato",startIcon:(0,r.jsx)(c.I5,{name:"delete"}),children:"Delete"}))}},49451:function(e,n,t){"use strict";t.d(n,{Y:function(){return o}});var o={getBuilderPagePathname:function(e){return"/slices/".concat(e.libraryName.replaceAll("/","--"),"/").concat(e.sliceName,"/").concat(e.variationId)}}},98898:function(e,n,t){"use strict";t.d(n,{Z:function(){return a}});var o=t(62230),i=t(85244),r=t(98240),c=t(52322);t(2784);var d=t(75289),s=function(e){var n=e.bg,t=e.background,i=e.sx,r=e.withRadius,s=e.radius,a=e.children;return(0,c.jsx)(d.xu,{sx:(0,o.Z)({p:4,bg:n||t},r?{borderBottomLeftRadius:s,borderBottomRightRadius:s}:null,i),children:a})},a=function(e){var n=e.Header,t=void 0===n?null:n,a=e.SubHeader,l=void 0===a?null:a,u=e.Body,h=void 0===u?null:u,v=e.Footer,m=void 0===v?null:v,f=e.borderFooter,b=e.radius,_=void 0===b?"6px":b,p=e.bodySx,x=e.footerSx,g=e.sx,C=e.bg,j=e.background,Z=e.children,k=(0,r.Z)(e,["Header","SubHeader","Body","Footer","borderFooter","radius","bodySx","footerSx","sx","bg","background","children"]);return(0,c.jsxs)(d.Zb,(0,i.Z)((0,o.Z)({sx:(0,o.Z)({border:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.borders))},borderRadius:_},void 0===g?null:g)},k),{children:[t?(0,c.jsx)(t,{radius:_}):null,l?(0,c.jsx)(l,{radius:_}):null,(0,c.jsxs)(s,{bg:C,background:j,sx:void 0===p?{}:p,withRadius:!m,children:[h?(0,c.jsx)(h,{}):null,Z||null]}),m?(0,c.jsx)(s,{bg:C,background:j,sx:(0,o.Z)({},void 0!==f&&f?{borderTop:function(e){var n=e.colors;return"1px solid ".concat(String(null==n?void 0:n.borders))}}:null,void 0===x?{}:x),radius:_,withRadius:!0,children:"object"==typeof m?m:(0,c.jsx)(m,{})}):null]}))}},63094:function(e,n,t){"use strict";t.d(n,{Sn:function(){return d},lS:function(){return o},nG:function(){return i},pq:function(){return s},rd:function(){return c},xo:function(){return r}});var o=["components"],i=["png","jpg","jpeg"],r=/^[A-Za-z0-9]+(?:_[A-Za-z0-9]+)*$/,c="placeholders/What_are_Slices_mrvome",d="SM_HELP_VIDEOS/mock_data",s="slice-machine-simulator"},71457:function(){}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[90],{47731:function(e,n,r){"use strict";r.d(n,{H:function(){return s}});var i=r(2784),t=r(90374),s=function(){var e=(0,t.Z)().openScreenshotsModal,n=(0,i.useState)({sliceFilterFn:function(e){return e}}),r=n[0],s=n[1];return{modalPayload:r,onOpenModal:function(n){s(n),e()}}}},12773:function(e,n,r){"use strict";r.d(n,{Z:function(){return L}});var i,t,s=r(62230),o=r(85244),a=r(52322),l=r(2784),c=r(951),u=r(75100),d=r(56580),x=r(75289),p=r(36416),h=r.n(p),f=function(e){var n=e.children;return(0,a.jsx)("kbd",{className:h().root,children:n})},v=function(e){return(0,a.jsxs)("svg",(0,o.Z)((0,s.Z)({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[(0,a.jsxs)("g",{clipPath:"url(#clip0_5065_192538)",children:[(0,a.jsx)("path",{d:"M9.66862 19.9993C11.1406 19.9993 12.3353 18.8047 12.3353 17.3327V14.666H9.66862C8.19662 14.666 7.00195 15.8607 7.00195 17.3327C7.00195 18.8047 8.19662 19.9993 9.66862 19.9993Z",fill:"#0ACF83"}),(0,a.jsx)("path",{d:"M7.00195 12.0007C7.00195 10.5287 8.19662 9.33398 9.66862 9.33398H12.3353V14.6673H9.66862C8.19662 14.6673 7.00195 13.4727 7.00195 12.0007Z",fill:"#A259FF"}),(0,a.jsx)("path",{d:"M7.00195 6.66667C7.00195 5.19467 8.19662 4 9.66862 4H12.3353V9.33333H9.66862C8.19662 9.33333 7.00195 8.13867 7.00195 6.66667Z",fill:"#F24E1E"}),(0,a.jsx)("path",{d:"M12.334 4H15.0007C16.4727 4 17.6673 5.19467 17.6673 6.66667C17.6673 8.13867 16.4727 9.33333 15.0007 9.33333H12.334V4Z",fill:"#FF7262"}),(0,a.jsx)("path",{d:"M17.6673 12.0007C17.6673 13.4727 16.4727 14.6673 15.0007 14.6673C13.5287 14.6673 12.334 13.4727 12.334 12.0007C12.334 10.5287 13.5287 9.33398 15.0007 9.33398C16.4727 9.33398 17.6673 10.5287 17.6673 12.0007Z",fill:"#1ABCFE"})]}),(0,a.jsx)("defs",{children:(0,a.jsx)("clipPath",{id:"clip0_5065_192538",children:(0,a.jsx)("rect",{width:"10.6688",height:"16",fill:"white",transform:"translate(7 4)"})})})]}))},g=r(98898),m=r(83399),j=r(77174),b=r(24340),y=r(90374);(t=i||(i={})).Mac="Mac",t.Linux="Linux",t.Windows="Windows";var C=function(){var e=navigator.userAgent,n=i.Linux;return Object.values(i).forEach(function(r){e.includes(r)&&(n=r)}),n},F=r(22710),w=r(99267),E=r(76473),I=r(88932),S=r(67557),D=r(82770);function k(e){return Z.apply(this,arguments)}function Z(){return(Z=(0,F.Z)(function(e){var n,r,i,t,a,l,c,u,d,x;return(0,w.__generator)(this,function(p){switch(p.label){case 0:n=e.variationId,r=e.slice,i=e.file,t=e.method,p.label=1;case 1:return p.trys.push([1,3,,4]),(a=new FormData).append("file",i),a.append("libraryName",r.from),a.append("sliceName",r.model.name),a.append("variationId",n),[4,(0,D.XQ)({libraryName:r.from,sliceId:r.model.id,variationId:n,file:i})];case 2:if(c=(l=p.sent()).errors,u=l.url,c.length>0)throw c;return D.Xe.track({event:"screenshot-taken",type:"custom",method:t}),[2,(0,o.Z)((0,s.Z)({},r),{screenshots:(0,o.Z)((0,s.Z)({},r.screenshots),(0,S.Z)({},n,{url:u}))})];case 3:return d=p.sent(),x="Screenshot not saved",console.error(x,d),I.Am.error(x),[3,4];case 4:return[2]}})})).apply(this,arguments)}var _=r(47010),M=r(63094),R=function(e){var n=e.inputFile,r=e.handleFile,i=e.children,t=e.isDragActive;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(x.__,{htmlFor:"input-file",variant:"buttons.white",sx:{p:2,px:0,display:"flex",justifyContent:"center",width:200,alignItems:"center",flex:1},children:i||"Select file"}),(0,a.jsx)("input",{id:"input-file",type:"file",ref:n,style:{display:"none"},accept:M.nG.map(function(e){return"image/".concat(e)}).join(","),onChange:function(e){var n;r(null===(n=e.target.files)||void 0===n?void 0:n[0],t)}})]})},H=function(){return(0,a.jsx)(x.kC,{variant:"boxes.centered",sx:{p:2,position:"absolute",height:"100%",width:"100%",background:"rgba(249, 248, 249, 0.7)",backdropFilter:"blur(5px)",zIndex:"1",pointerEvents:"none"},children:(0,a.jsxs)(x.kC,{variant:"boxes.centered",sx:{border:"1px dashed #6E56CF",height:"100%",width:"100%",borderRadius:"4px"},children:[(0,a.jsx)(A,{isActive:!0}),(0,a.jsx)(x.xv,{sx:{my:2},children:"Drop file here"}),(0,a.jsx)(x.xv,{variant:"secondary",children:"Maximum upload size file: 128Mb"})]})})},A=function(e){var n=e.isActive;return(0,a.jsx)(x.kC,{sx:{p:1,borderRadius:"50%",bg:n?"#F1EEFE":"#EDECEE",alignItems:"center",justifyContent:"center",width:"48px",height:"48px"},children:(0,a.jsx)(c.IEK,{style:{color:n?"#6E56CF":"#6F6E77",fontSize:"34px"}})})},z=function(e){var n,r,i,t,c,u,d=e.variationID,p=e.slice,h=e.imageTypes,f=void 0===h?M.nG:h,v=e.onUploadSuccess,g=p.screenshots[d],m=(0,y.Z)().saveSliceCustomScreenshotSuccess,j=(0,l.useState)(!1),b=j[0],C=j[1],S=(0,l.useState)(!1),D=S[0],Z=S[1],z=(0,l.useState)(!1),O=z[0],V=z[1];(0,E.y1)(["meta+v","ctrl+v"],function(){q()},[d,p,]);var P,B,L=(i=(r={onHandleFile:(n=(0,F.Z)(function(e,n){var r,i;return(0,w.__generator)(this,function(t){switch(t.label){case 0:return V(!0),[4,k({slice:p,file:e,method:n?"dragAndDrop":"upload",variationId:d})];case 1:return r=t.sent(),Z(!1),(i=null==r?void 0:r.screenshots[d])&&(m(d,i,r),v&&v(r)),V(!1),[2]}})}),function(e,r){return n.apply(this,arguments)})}).onHandleFile,t=(0,l.useRef)(null),c=(0,F.Z)(function(e,n){return(0,w.__generator)(this,function(r){switch(r.label){case 0:if(!e)return[3,2];return[4,i(e,n)];case 1:r.sent(),(null==t?void 0:t.current)&&(t.current.value=""),r.label=2;case 2:return[2]}})}),{handleFile:u=function(e,n){return c.apply(this,arguments)},inputFile:t,FileInputRenderer:R,fileInputProps:{inputFile:t,handleFile:u}}),N=L.FileInputRenderer,T=L.fileInputProps,U=(P=(0,F.Z)(function(e){var n,r;return(0,w.__generator)(this,function(i){switch(i.label){case 0:if(e.size>128e6)return[2,I.Am.error("File is too big. Max file size: 128Mb.")];return V(!0),[4,k({slice:p,file:e,method:"dragAndDrop",variationId:d})];case 1:return(r=null==(n=i.sent())?void 0:n.screenshots[d])&&(m(d,r,n),v&&v(n)),V(!1),[2]}})}),function(e){return P.apply(this,arguments)}),W="function"==typeof navigator.clipboard.read,q=(B=(0,F.Z)(function(){var e,n,r,i,t;return(0,w.__generator)(this,function(s){switch(s.label){case 0:if(!W)return[2];s.label=1;case 1:return s.trys.push([1,5,,6]),[4,navigator.clipboard.read()];case 2:if(!(void 0!==(e=s.sent())[0])||!(void 0!==(n=e[0].types.find(function(e){return f.map(function(e){return"image/".concat(e)}).includes(e)}))))return[3,4];return[4,e[0].getType(n)];case 3:return r=s.sent(),i=new File([r],"file"),[2,U(i)];case 4:return[3,6];case 5:return t=s.sent(),console.error("Could not paste file",t),[3,6];case 6:return[2]}})}),function(){return B.apply(this,arguments)}),G=function(e){e.preventDefault(),C(!1);var n,r=null===(n=e.dataTransfer.files)||void 0===n?void 0:n[0];if(void 0!==r)return f.some(function(e){return"image/".concat(e)===r.type})?void U(r):I.Am.error("Only files of type ".concat(f.join(", ")," are accepted."))},X=function(e){return function(n){n.preventDefault(),C(e)}},K=function(e){return function(n){n.preventDefault(),Z(e)}};return(0,a.jsxs)(x.kC,{as:"form",variant:"boxes.centered",sx:{bg:"#F9F8F9",position:"relative",borderRadius:"6px",height:"320px"},onDragEnter:X(!0),onDragLeave:X(!1),onDragOver:X(!0),onMouseEnter:K(!0),onMouseLeave:K(!1),onSubmit:function(e){return e.preventDefault()},onDrop:G,children:[O?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(x.$j,{}),(0,a.jsx)(x.xv,{sx:{my:2},children:"Uploading file ..."})]}):null,O||void 0===g?null:(0,a.jsx)(_.q,{src:g.url,sx:{width:"100%",height:"100%",maxHeight:"100%",backdropFilter:"blur(5px)"}}),O?null:(0,a.jsx)(x.kC,{sx:{p:2,position:"absolute",width:"100%",height:"100%",borderRadius:"6px",background:"#F9F8F9B2",justifyContent:"center",alignItems:"center",visibility:D||void 0===g?"visible":"hidden"},children:(0,a.jsx)(x.kC,{variant:"boxes.centered",sx:{border:"1px dashed #6E56CF",height:"100%",width:"100%",borderRadius:"4px"},children:(0,a.jsxs)(x.kC,{sx:{width:"100%",justifyContent:"center",alignItems:"center",flexDirection:"column"},children:[(0,a.jsx)(A,{isActive:b}),(0,a.jsx)(x.xv,{sx:{my:2},children:W?"Paste, drop or ...":"Drop or ..."}),(0,a.jsx)(N,(0,o.Z)((0,s.Z)({},T),{isDragActive:b})),(0,a.jsx)(x.xv,{sx:{color:"greyIcon",mt:1},children:"Maximum file size: 128Mb"})]})})}),b?(0,a.jsx)(H,{}):null]})},O=function(){var e,n=[i.Windows,i.Linux].includes(C())?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(f,{children:"ctrl"})," + ",(0,a.jsx)(f,{children:"shift"})," + ",(0,a.jsx)(f,{children:"c"})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(f,{children:"cmd"})," + ",(0,a.jsx)(f,{children:"shift"})," + ",(0,a.jsx)(f,{children:"c"})]});return(0,a.jsxs)(x.kC,{sx:{pl:"4px",alignItems:"center",color:"#000",borderRadius:"6px",fontSize:"12px",lineHeight:"24px",border:"1px solid #E4E2E4",boxShadow:"0px 1px 0px 0px rgba(0, 0, 0, 0.04)",width:"100%",minHeight:"40px"},children:[(0,a.jsx)(v,{}),(0,a.jsxs)("div",{children:["Use\xa0",n," to copy any frame as .png, then just paste it here"]})]})},V=function(e){var n=e.isValid;return(0,a.jsx)(x.kC,{sx:{p:2,border:"1px solid #E4E2E4",borderRadius:"6px",bg:"#FFF"},children:n?(0,a.jsx)(c.Ypm,{style:{fontSize:"16px"}}):(0,a.jsx)(u.j6O,{style:{fontSize:"16px",color:"#ED811C"}})})},P=function(e){var n=e.slice,r=e.onSelectVariation,i=e.variationSelector;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(x.X6,{as:"h4",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n.model.name}),(0,a.jsx)(x.xu,{children:(0,a.jsx)(x.xu,{as:"ul",sx:{pl:0,my:3},children:n.model.variations.map(function(e){var t=i.sliceID,l=i.variationID,c=t===n.model.id&&l===e.id;return(0,a.jsx)(x.xu,{as:"li",sx:(0,o.Z)((0,s.Z)({listStyle:"none",my:2,p:2,cursor:"pointer",borderRadius:"4px"},c&&{bg:"#EDECEE",fontWeight:"500"}),{":hover":{bg:"#EDECEE"}}),onClick:function(){return r({sliceID:n.model.id,variationID:e.id})},children:(0,a.jsxs)(x.kC,{sx:{alignItems:"center"},children:[(0,a.jsx)(V,{isValid:!!n.screenshots[e.id]}),(0,a.jsx)(x.xv,{sx:{ml:2},children:e.name})]})},"".concat(n.model.id,"-").concat(e.id))})})})]})},B=function(e,n){return e||(n.length?{sliceID:n[0].model.id,variationID:n[0].model.variations[0].id}:void 0)},L=function(e){var n=e.slices,r=e.defaultVariationSelector,i=e.onUploadSuccess,t=(0,y.Z)().closeModals,s=(0,d.v9)(function(e){return{isOpen:(0,j.gP)(e,b.q.SCREENSHOTS)}}).isOpen,o=(0,l.useState)(B(r,n)),c=o[0],u=o[1];if((0,l.useEffect)(function(){u(B(r,n))},[null==r?void 0:r.sliceID,null==r?void 0:r.variationID,s,]),0===n.length||!c)return null;var p,h="function"==typeof navigator.clipboard.read;return(0,a.jsx)(m.Z,{isOpen:s,shouldCloseOnOverlayClick:!0,onRequestClose:function(){return t()},children:(0,a.jsx)(g.Z,{radius:"0px",bodySx:{p:0,bg:"#FFF",position:"relative"},sx:{border:"none"},Header:function(e){var n=e.radius;return(0,a.jsxs)(x.kC,{sx:{position:"sticky",top:0,zIndex:1,background:"gray",p:"16px",alignItems:"center",justifyContent:"space-between",borderTopLeftRadius:n,borderTopRightRadius:n,borderBottom:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.borders))}},children:[(0,a.jsx)(x.X6,{sx:{fontSize:"20px"},children:"Slice screenshots"}),(0,a.jsx)(x.x8,{type:"button",onClick:function(){return t()}})]})},Footer:null,children:(0,a.jsxs)(x.xu,{sx:{display:"flex",flexWrap:"wrap",height:"100%"},children:[(0,a.jsx)(x.xu,{sx:{p:3,bg:"grey07",flexGrow:1,overflow:"auto",maxHeight:"100%",flexBasis:"sidebar"},children:n.map(function(e,n){return(0,a.jsx)(P,{slice:e,variationSelector:c,onSelectVariation:u},"".concat(e.model.id,"-").concat(n))})}),(0,a.jsxs)(x.kC,{as:"main",sx:{p:3,flexGrow:99999,flexBasis:0,flexDirection:"column",minWidth:320,gap:"8px"},children:[h?(0,a.jsx)(O,{}):void 0,(p=n.find(function(e){return e.model.id===c.sliceID}))?(0,a.jsx)(z,{variationID:c.variationID,slice:p,onUploadSuccess:i}):null]})]})})})}},47010:function(e,n,r){"use strict";r.d(n,{q:function(){return c}});var i=r(62230),t=r(52322),s=r(2784),o=r(65186),a=r(75289),l=(0,s.memo)(function(e){var n=e.src;return(0,t.jsx)(a.Ee,{src:n,alt:"Preview image",sx:{maxHeight:"100%"}})}),c=function(e){var n=e.src,r=e.sx;return(0,t.jsx)(a.kC,{sx:(0,i.Z)({position:"relative",alignItems:"center",justifyContent:"center",overflow:"hidden",backgroundImage:"url(/pattern.png)",backgroundColor:"headSection",backgroundRepeat:"repeat",backgroundSize:"20px",borderRadius:"4px"},r),children:void 0!==n?(0,t.jsx)(l,{src:n}):(0,t.jsxs)(a.xv,{sx:{display:"flex",flexDirection:"column",alignItems:"center"},children:[(0,t.jsx)(o.eJU,{}),"You have no screenshot yet."]})})}},36416:function(e){e.exports={root:"Kbd_root__nBos2"}}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[91],{840:function(e,n,r){"use strict";r.d(n,{F:function(){return A}});var t=r(52322),s=r(22715),a=r(97729),i=r.n(a),c=r(2784),l=r(41730),o=r(8564),d=r(78656),u=r(90898),h=r(24448),f=r(5632),x=r(2754),p=r(67557),m=r(50002),j=r(6277);r(64117);var g=function(e){var n=e.children;return(0,t.jsx)("div",{className:"_1ecs97dez0 _1ecs97dez5 _1ecs97d3fg _1ecs97d3mt _1ecs97df0r _1ecs97df23 _1ecs97df2h _1ecs97dezr",children:(0,t.jsx)("table",{className:"gdfsm51 _1ecs97dez0 _1ecs97dez5 _1ecs97df3p _1ecs97df4v",children:n})})},C=(0,c.createContext)("body");function v(){return(0,c.useContext)(C)}var b=function(e){var n=e.children;return(0,t.jsx)(C.Provider,{value:"head",children:(0,t.jsx)("thead",{className:"gdfsm52 _1ecs97dez0 _1ecs97dez5 _1ecs97d18 _1ecs97d8l",children:n})})},_=function(e){var n=e.children;return(0,t.jsx)(C.Provider,{value:"body",children:(0,t.jsx)("tbody",{className:"gdfsm53 _1ecs97dez0 _1ecs97dez5",children:n})})},y=function(e){var n,r=e.children,s=e.onClick,a=v();return(0,t.jsx)("tr",{className:(0,j.W)("_1ecs97dez0 _1ecs97dez5 _1ecs97df71",(n={},(0,p.Z)(n,"_1ecs97df41",!!s),(0,p.Z)(n,"_1ecs97dm _1ecs97d7z _1ecs97d3c _1ecs97dap _1ecs97d2w _1ecs97da9 _1ecs97df74 _1ecs97dfj8 _1ecs97df0d _1ecs97dfjb","body"===a),n)),onClick:function(e){var n,r=e.target;if(s&&e.currentTarget.contains(r)){var t=(0,m.JY)(r);(null===(n=null==t?void 0:t.contains(e.currentTarget))||void 0===n||n)&&s(e)}},children:r})},S=function(e){var n=e.children,r=v();return(0,t.jsx)("head"===r?"th":"td",{className:"gdfsm55 _1ecs97dez0 _1ecs97dez5 _1ecs97d3fg _1ecs97d3mt _1ecs97df2h _1ecs97dez1 _1ecs97da62 _1ecs97dadf _1ecs97df45 _1ecs97dfhi",children:(0,t.jsx)("div",{className:"gdfsm56 _1ecs97dez0 _1ecs97dez2",children:n})})},w=function(){return(0,t.jsxs)("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,t.jsx)("path",{d:"M8 28H24C25.1046 28 26 27.1046 26 26V9L21 4H8C6.89543 4 6 4.89543 6 6V26C6 27.1046 6.89543 28 8 28Z",fill:"#6E56CF"}),(0,t.jsx)("path",{d:"M23 9H26L21 4V7C21 8.10457 21.8954 9 23 9Z",fill:"#9E8CFC"}),(0,t.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.0912 12C13.2794 12 11 14.2794 11 17.0912C11 19.903 13.2794 22.1824 16.0912 22.1824C17.9763 22.1824 19.6215 21.1577 20.501 19.6372C20.6563 19.3688 20.7878 19.0849 20.8926 18.7883C20.9846 18.5279 20.8482 18.2422 20.5878 18.1502C20.3275 18.0582 20.0418 18.1947 19.9498 18.455C19.8657 18.693 19.7601 18.9209 19.6354 19.1365C18.9273 20.3606 17.6049 21.1824 16.0912 21.1824C13.8317 21.1824 12 19.3507 12 17.0912C12 14.8317 13.8317 13 16.0912 13C17.4478 13 18.6507 13.66 19.3955 14.6782H17.6216C17.3455 14.6782 17.1216 14.9021 17.1216 15.1782C17.1216 15.4544 17.3455 15.6782 17.6216 15.6782H20.2998C20.576 15.6782 20.7998 15.4544 20.7998 15.1782V12.5C20.7998 12.2239 20.576 12 20.2998 12C20.0237 12 19.7998 12.2239 19.7998 12.5V13.6032C18.8717 12.6167 17.5536 12 16.0912 12Z",fill:"white"})]})},L=function(){return(0,t.jsxs)("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,t.jsx)("path",{d:"M8 28H24C25.1046 28 26 27.1046 26 26V9L21 4H8C6.89543 4 6 4.89543 6 6V26C6 27.1046 6.89543 28 8 28Z",fill:"#6E56CF"}),(0,t.jsx)("path",{d:"M23 9H26L21 4V7C21 8.10457 21.8954 9 23 9Z",fill:"#9E8CFC"}),(0,t.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.0869 14.6818L14.6627 12.3787C14.7183 12.1561 14.9183 12 15.1477 12C15.473 12 15.7117 12.3057 15.6328 12.6213L15.1177 14.6818H17.7232L18.299 12.3787C18.3547 12.1561 18.5547 12 18.7841 12C19.1094 12 19.3481 12.3057 19.2692 12.6213L18.754 14.6818H21C21.2761 14.6818 21.5 14.9057 21.5 15.1818C21.5 15.458 21.2761 15.6818 21 15.6818H18.504L17.8449 18.3182H20C20.2761 18.3182 20.5 18.542 20.5 18.8182C20.5 19.0943 20.2761 19.3182 20 19.3182H17.5949L17.0192 21.6213C16.9635 21.8439 16.7635 22 16.5341 22C16.2088 22 15.9701 21.6943 16.049 21.3787L16.5642 19.3182H13.9586L13.3828 21.6213C13.3272 21.8439 13.1272 22 12.8977 22C12.5724 22 12.3338 21.6943 12.4127 21.3787L12.9278 19.3182H11C10.7239 19.3182 10.5 19.0943 10.5 18.8182C10.5 18.542 10.7239 18.3182 11 18.3182H13.1778L13.8369 15.6818H12C11.7239 15.6818 11.5 15.458 11.5 15.1818C11.5 14.9057 11.7239 14.6818 12 14.6818H14.0869ZM16.8142 18.3182L17.4732 15.6818H14.8677L14.2086 18.3182H16.8142Z",fill:"white"})]})},Z=r(67445),k=r(54845),T=r(22710),z=r(99267),H=r(17329),I=r(56580),R=r(74026),N=r(52312),V=r(81038),M=r(28849);function E(e){return F.apply(this,arguments)}function F(){return(F=(0,T.Z)(function(e){var n,r,t;return(0,z.__generator)(this,function(s){switch(s.label){case 0:return[4,V.j.customTypes.readAllCustomTypes({format:e})];case 1:if(r=(n=s.sent()).errors,t=n.models,r.length>0)throw r;return[2,t.map(function(e){return e.model})]}})})).apply(this,arguments)}var P=function(e){var n,r,a,i,l,o,u=e.format,h=e.isCreatingCustomType,p=e.openCreateCustomTypeModal,m=(0,f.useRouter)(),j=(r=(0,c.useCallback)(function(e){return(0,H.VA)(E,[u],e)},[u]),{customTypes:(0,H.QT)(E,[u]),updateCustomTypes:r}),C=j.customTypes,v=j.updateCustomTypes,T=C.sort(function(e,n){return e.id.localeCompare(n.id)}),z=Z.cd[u],V=d.$[u];return(o=(0,I.v9)(function(e){return{storeCustomTypes:(0,M.Ch)(e).filter(N.TG)}}).storeCustomTypes,(0,c.useEffect)(function(){var e=o.filter(function(e){return e.local.format===u});(e.length!==C.length||e.some(function(e){var n=C.find(function(n){return n.id===e.local.id});return!n||JSON.stringify(R.Dc.fromSM(e.local))!==JSON.stringify(n)}))&&v(e.map(function(e){var n=e.local;return R.Dc.fromSM(n)}))},[u,v,C,o]),0===T.length)?(0,t.jsxs)(x.R$,{"data-testid":"blank-slate",style:{alignSelf:"center",marginTop:s.TV.size[72]},children:[(0,t.jsx)(x.u2,{children:(0,t.jsx)(s.Ee,{src:z.blankSlateImage,sizing:"cover"})}),(0,t.jsxs)(x.T9,{children:[(0,t.jsx)(x._T,{children:V.name({start:!0,plural:!0})}),(0,t.jsx)(x.nf,{children:V.blankSlateDescription}),(0,t.jsx)(x.Qj,{children:(0,t.jsx)(s.zx,{onClick:p,loading:h,children:"Create"})})]})]}):(0,t.jsxs)(g,{children:[(0,t.jsx)(b,{children:(0,t.jsxs)(y,{children:[(0,t.jsx)(S,{children:(0,t.jsx)(s.I5,{name:"notes",size:"medium"})}),(0,t.jsx)(S,{children:"Label"}),(0,t.jsx)(S,{children:"API ID"}),(0,t.jsx)(S,{children:"Limit"}),(0,t.jsx)(S,{})]})}),(0,t.jsx)(_,{children:T.map(function(e){var n=e.repeatable,r=e.label,s=e.id;return(0,t.jsxs)(y,{onClick:function(){m.push(Z.cd[u].getBuilderPagePathname(s))},children:[(0,t.jsx)(S,{children:n?(0,t.jsx)(w,{}):(0,t.jsx)(L,{})}),(0,t.jsx)(S,{children:r}),(0,t.jsx)(S,{children:s}),(0,t.jsx)(S,{children:n?"Reusable":"Single"}),(0,t.jsx)(S,{children:(0,t.jsx)(k._,{isChangesLocal:!1,format:u,customType:e})})]},s)})})]})},A=function(e){var n=e.format,r=d.$[n],a=(0,c.useState)(!1),f=a[0],x=a[1],p=(0,c.useState)(!1),m=p[0],j=p[1];return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i(),{children:(0,t.jsxs)("title",{children:[r.name({start:!0,plural:!0})," - Slice Machine"]})}),(0,t.jsx)(o.S,{renderError:function(){return(0,t.jsx)(u.LN,{children:(0,t.jsx)(u.RN,{children:(0,t.jsx)(s.xu,{alignItems:"center",justifyContent:"center",children:(0,t.jsx)(s.Iq,{title:"Request failed",description:"An error occurred while fetching your ".concat(r.name({start:!1,plural:!0}),".")})})})})},children:(0,t.jsx)(c.Suspense,{fallback:(0,t.jsxs)(u.LN,{children:[(0,t.jsxs)(u.wd,{children:[(0,t.jsx)(u.Cx,{children:(0,t.jsx)(l.g,{children:r.name({start:!0,plural:!0})})}),(0,t.jsx)(u.K2,{children:(0,t.jsx)(s.zx,{disabled:!0,startIcon:"add",children:"Create"})})]}),(0,t.jsx)(u.RN,{children:(0,t.jsx)(s._3,{})})]}),children:(0,t.jsxs)(u.LN,{children:[(0,t.jsxs)(u.wd,{children:[(0,t.jsx)(u.Cx,{children:(0,t.jsx)(l.g,{children:r.name({start:!0,plural:!0})})}),(0,t.jsx)(u.K2,{children:(0,t.jsx)(s.zx,{"data-testid":"create-ct",loading:f,onClick:function(){j(!0)},startIcon:"add",children:"Create"})})]}),(0,t.jsx)(u.RN,{children:(0,t.jsxs)(s.xu,{flexDirection:"column",children:[(0,t.jsx)(P,{format:n,isCreatingCustomType:f,openCreateCustomTypeModal:function(){j(!0)}}),(0,t.jsx)(h.M,{format:n,isCreating:f,isOpen:m,onCreateChange:x,onOpenChange:j})]})})]})})})]})}},98898:function(e,n,r){"use strict";r.d(n,{Z:function(){return o}});var t=r(62230),s=r(85244),a=r(98240),i=r(52322);r(2784);var c=r(75289),l=function(e){var n=e.bg,r=e.background,s=e.sx,a=e.withRadius,l=e.radius,o=e.children;return(0,i.jsx)(c.xu,{sx:(0,t.Z)({p:4,bg:n||r},a?{borderBottomLeftRadius:l,borderBottomRightRadius:l}:null,s),children:o})},o=function(e){var n=e.Header,r=void 0===n?null:n,o=e.SubHeader,d=void 0===o?null:o,u=e.Body,h=void 0===u?null:u,f=e.Footer,x=void 0===f?null:f,p=e.borderFooter,m=e.radius,j=void 0===m?"6px":m,g=e.bodySx,C=e.footerSx,v=e.sx,b=e.bg,_=e.background,y=e.children,S=(0,a.Z)(e,["Header","SubHeader","Body","Footer","borderFooter","radius","bodySx","footerSx","sx","bg","background","children"]);return(0,i.jsxs)(c.Zb,(0,s.Z)((0,t.Z)({sx:(0,t.Z)({border:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.borders))},borderRadius:j},void 0===v?null:v)},S),{children:[r?(0,i.jsx)(r,{radius:j}):null,d?(0,i.jsx)(d,{radius:j}):null,(0,i.jsxs)(l,{bg:b,background:_,sx:void 0===g?{}:g,withRadius:!x,children:[h?(0,i.jsx)(h,{}):null,y||null]}),x?(0,i.jsx)(l,{bg:b,background:_,sx:(0,t.Z)({},void 0!==p&&p?{borderTop:function(e){var n=e.colors;return"1px solid ".concat(String(null==n?void 0:n.borders))}}:null,void 0===C?{}:C),radius:j,withRadius:!0,children:"object"==typeof x?x:(0,i.jsx)(x,{})}):null]}))}},24448:function(e,n,r){"use strict";r.d(n,{M:function(){return H}});var t=r(22710),s=r(62230),a=r(85244),i=r(99267),c=r(52322),l=r(5632),o=r(2784),d=r(56580),u=r(75289),h=r(91061),f=r(88932),x=r(82770),p=r(6777),m=r(78656);function j(){return(j=(0,t.Z)(function(e){var n,r,t,s,a,c,l,o,d,u;return(0,i.__generator)(this,function(i){switch(i.label){case 0:n=e.id,r=e.label,t=e.repeatable,s=e.format,a=e.onSuccess,c=m.$[s],l=(0,h.Ue)({id:n,label:r,repeatable:t,format:s}),i.label=1;case 1:return i.trys.push([1,4,,5]),[4,(0,x.KA)(l)];case 2:if((o=i.sent().errors).length>0)throw o;return x.Xe.track({event:"custom-type:created",id:l.id,name:r,format:s,type:t?"repeatable":"single",origin:"table"}),[4,a(l)];case 3:return i.sent(),f.Am.success((0,p.GX)({message:"".concat(c.name({start:!0,plural:!1})," saved successfully at "),path:"./customtypes/".concat(l.id,"/index.json")})),[3,5];case 4:return d=i.sent(),u="Internal Error: ".concat(c.name({start:!0,plural:!1})," not saved"),console.error(u,d),f.Am.error(u),[3,5];case 5:return[2]}})})).apply(this,arguments)}var g=r(67445),C=r(50950),v=r(6134),b=r(63094),_=r(17384),y=r(28849),S=r(90374),w=r(36960),L=r(17064),Z=r(63397),k=r(98240),T=function(e){var n=e.selected,r=(0,k.Z)(e,["selected"]);return(0,c.jsx)(u.kC,(0,s.Z)({sx:{p:"24px",mb:3,alignItems:"top",cursor:"pointer",borderRadius:"6px",backgroundColor:"grayLight",boxShadow:n?function(e){var n;return"0 0 0 2px ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.primary))}:"none","&:hover":{boxShadow:function(e){var n;return"0 0 0 2px ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.primary))}}}},r))},z=function(e){var n=e.format,r=(0,L.Z)((0,Z.U$)("repeatable"),3),t=r[0],s=r[2],a=m.$[n];return(0,c.jsxs)(u.xu,{mb:2,children:[(0,c.jsxs)(T,{selected:t.value,onClick:function(){return s.setValue(!0)},children:[(0,c.jsx)(u.Y8,{checked:t.value,onChange:function(){},"data-testid":"repeatable-type-radio-btn"}),(0,c.jsxs)(u.xu,{sx:{marginLeft:2},children:["Reusable type",(0,c.jsx)(u.xu,{as:"p",sx:{fontSize:"12px",color:"textClear",mt:1},children:a.hintRepeatable})]})]}),(0,c.jsxs)(T,{selected:!t.value,onClick:function(){return s.setValue(!1)},children:[(0,c.jsx)(u.Y8,{checked:!t.value,onChange:function(){},"data-testid":"single-type-radio-btn"}),(0,c.jsxs)(u.xu,{sx:{marginLeft:2},children:["Single type",(0,c.jsx)(u.xu,{as:"p",sx:{fontSize:"12px",color:"textClear",mt:1},children:a.hintSingle})]})]})]})},H=function(e){var n,r=e.format,f=e.isCreating,x=e.isOpen,p=e.origin,L=void 0===p?"table":p,Z=e.onCreateChange,k=e.onOpenChange,T=(0,S.Z)().createCustomTypeSuccess,H=(0,d.v9)(function(e){return{customTypeIds:(0,y.W6)(e),customTypeLabels:(0,y.YS)(e)}}),I=H.customTypeIds,R=H.customTypeLabels,N=m.$[r],V=(0,o.useState)(!0),M=V[0],E=V[1],F=(0,C.g)().syncChanges,P=(0,l.useRouter)(),A=(n=(0,t.Z)(function(e){var n,s,a;return(0,i.__generator)(this,function(c){switch(c.label){case 0:var l;return n=e.id,s=e.label,a=e.repeatable,Z(!0),[4,function(e){return j.apply(this,arguments)}({format:r,id:n,label:s,origin:L,repeatable:a,onSuccess:(l=(0,t.Z)(function(e){var r,t;return(0,i.__generator)(this,function(s){switch(s.label){case 0:return T(e),r=(0,h.y6)(e),t=g.cd[r],E(!0),[4,P.push({pathname:t.getBuilderPagePathname(n),query:"page"===e.format?{newPageType:!0}:void 0})];case 1:return s.sent(),F(),[2]}})}),function(e){return l.apply(this,arguments)})})];case 1:return c.sent(),Z(!1),k(!1),[2]}})}),function(e){return n.apply(this,arguments)}),D=function(e,n,r){r(M?(0,a.Z)((0,s.Z)({},n),{label:e.target.value,id:(0,_.lV)(e.target.value)}):(0,a.Z)((0,s.Z)({},n),{label:e.target.value}))},O=function(e,n){n("id",e.target.value),E(!1)};return(0,c.jsx)(v.Z,{testId:"create-ct-modal",isOpen:x,widthInPx:"530px",formId:"create-custom-type",buttonLabel:"Create",close:function(){k(!1),E(!0)},onSubmit:function(e){A(e)},isLoading:f,initialValues:{repeatable:!0,id:"",label:""},validate:function(e){var n=e.id,r=e.label,t={};return r&&r.length||(t.label="Cannot be empty."),!t.label&&R.includes(r)&&(t.label="".concat(N.name({start:!0,plural:!1})," name is already taken.")),n&&n.length||(t.id="ID cannot be empty."),t.id||!n||b.xo.exec(n)||(t.id="Invalid id: No special characters allowed."),!t.id&&n&&I.map(function(e){return e.toLowerCase()}).includes(n)&&(t.id='ID "'.concat(n,'" exists already.')),Object.keys(t).length>0?t:void 0},content:{title:"Create a new ".concat(N.name({start:!1,plural:!1}))},children:function(e){var n=e.errors,t=e.setValues,s=e.setFieldValue,a=e.values,i=e.touched;return(0,c.jsxs)(u.xu,{children:[(0,c.jsx)(z,{format:r}),(0,c.jsx)(w.W,{name:"label",label:"".concat(N.name({start:!0,plural:!1})," Name"),testId:"ct-name-input",placeholder:"A display name for the ".concat(N.name({start:!1,plural:!1})),error:i.label?n.label:void 0,onChange:function(e){return D(e,a,t)}}),(0,c.jsx)(w.W,{name:"id",testId:"ct-id-input",label:"".concat(N.name({start:!0,plural:!1})," ID"),placeholder:N.inputPlaceholder,error:i.id?n.id:void 0,onChange:function(e){return O(e,s)}})]})}})}},63094:function(e,n,r){"use strict";r.d(n,{Sn:function(){return c},lS:function(){return t},nG:function(){return s},pq:function(){return l},rd:function(){return i},xo:function(){return a}});var t=["components"],s=["png","jpg","jpeg"],a=/^[A-Za-z0-9]+(?:_[A-Za-z0-9]+)*$/,i="placeholders/What_are_Slices_mrvome",c="SM_HELP_VIDEOS/mock_data",l="slice-machine-simulator"},64117:function(){}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[96],{28173:function(e,n,t){"use strict";t.d(n,{aV:function(){return s},Bu:function(){return c}});var i=t(62230),r=t(85244),o=t(98240),l=t(52322),a=t(22715);t(82432),t(84779);var s=function(e){return(0,l.jsx)("div",(0,r.Z)((0,i.Z)({},e),{className:"_2a96i71 _1ecs97dez0 _1ecs97dez2 _1ecs97d3fg _1ecs97d3mt _1ecs97df0r _1ecs97df23 _1ecs97df2h _1ecs97dezb _1ecs97dezr"}))},c=function(e){var n=e.actions,t=e.children,s=e.toggle,c=(0,o.Z)(e,["actions","children","toggle"]);return(0,l.jsxs)("div",(0,r.Z)((0,i.Z)({},c),{className:"_2a96i73 _2a96i72 _1ecs97dez0 _1ecs97dez2 _1ecs97dezc _1ecs97dez8 _1ecs97d6r8 _1ecs97d6yl _1ecs97df2l _1ecs97dez1 _1ecs97df71 _1ecs97dfie _1ecs97d18 _1ecs97d8l _1ecs97df29 _1ecs97df92 _1ecs97dfi1",children:[(0,l.jsx)(a.xv,{color:"grey11",component:"span",noWrap:!0,variant:"bold",children:t}),s,Boolean(n)?(0,l.jsx)("div",{className:"_1ecs97dez0 _1ecs97dez2 _1ecs97dezc _1ecs97dez8 _1ecs97dezd _1ecs97df92 _1ecs97dezj _1ecs97df51",children:n}):null]}))}},47976:function(e,n,t){"use strict";t.d(n,{X:function(){return o}});var i=t(52322),r=t(22715),o=function(e){var n,t=e.status;switch(t){case"pending":n={icon:(0,i.jsx)(r._3,{color:"grey11"}),text:"Saving..."};break;case"failed":n={icon:(0,i.jsx)(r.I5,{name:"close",color:"tomato11",size:"medium"}),text:"Failed to save"};break;case"done":n={icon:(0,i.jsx)(r.I5,{name:"check",color:"green11",size:"medium"}),text:"Auto-saved"}}return(0,i.jsxs)(r.xu,{gap:8,alignItems:"center",children:[n.icon,(0,i.jsx)(r.xv,{color:"grey11",children:n.text})]})}},81787:function(e,n,t){"use strict";t.d(n,{G:function(){return h},k:function(){return m}});var i=t(22710),r=t(99267),o=t(52322),l=t(74217),a=t(2784),s=t(82770),c=t(91061),u=t(50950),d=t(26921),f=t(90374),p=t(78656),x=(0,a.createContext)(void 0);function m(e){var n=e.children,t=e.initialCustomType,m=(0,a.useState)(t),h=m[0],v=m[1],g=(0,c.y6)(h),b=p.$[g],y=(0,d.c)({errorMessage:b.autoSaveFailed}),j=y.actionQueueStatus,Z=y.setNextAction,k=(0,f.Z)().saveCustomTypeSuccess,C=(0,l.R9)(k),S=(0,u.g)().syncChanges,I=(0,a.useCallback)(function(e){v(e),Z((0,i.Z)(function(){var n;return(0,r.__generator)(this,function(t){switch(t.label){case 0:return[4,(0,s.KA)(e)];case 1:if((n=t.sent().errors).length>0)throw n;return C(e),S(),[2]}})}))},[Z,C,S]),F=(0,a.useMemo)(function(){return{actionQueueStatus:j,customType:h,setCustomType:I}},[j,h,I]);return(0,o.jsx)(x.Provider,{value:F,children:"function"==typeof n?n(F):n})}function h(){var e=(0,a.useContext)(x);if(!e)throw Error("CustomTypeProvider not found");return e}},57899:function(e,n,t){"use strict";t.d(n,{Z:function(){return u}});var i=t(62230),r=t(52322),o=t(61183);t(2784);var l=t(59326),a=t(75289),s=function(e){return{subLanguage:"xml",contains:[e.COMMENT("<!--","-->",{relevance:10}),{begin:/^(\s*)(<script(\s*context="module")?>)/gm,end:/^(\s*)(<\/script>)/gm,subLanguage:"javascript",excludeBegin:!0,excludeEnd:!0,contains:[{begin:/^(\s*)(\$:)/gm,end:/(\s*)/gm,className:"keyword"},]},{begin:/^(\s*)(<style.*>)/gm,end:/^(\s*)(<\/style>)/gm,subLanguage:"css",excludeBegin:!0,excludeEnd:!0},{begin:/\{/gm,end:/\}/gm,subLanguage:"javascript",contains:[{begin:/[\{]/,end:/[\}]/,skip:!0},{begin:/([#:\/@])(if|else|each|await|then|catch|debug|html)/gm,className:"keyword",relevance:10},]},]}};o.Z.registerLanguage("svelte",s);var c=["javascript","bash","xml","html","json"],u=function(e){var n,t=e.children,s=e.lang,u=e.sx,d=e.codeStyle,f=e.codeClass,p=e.Header,x=(0,l.B7)().theme,m=s?o.Z.highlight(t,{language:"vue"===s?"html":s}).value:o.Z.highlightAuto(t,c).value;return(0,r.jsxs)(a.kC,{as:"pre",sx:u,children:[p?(0,r.jsx)(p,{}):null,(0,r.jsx)("code",{className:"hljs".concat(f?" ".concat(f):""),style:(0,i.Z)({overflowX:"auto",padding:"3px 5px",borderRadius:"6px",border:"1px solid",borderColor:String(null===(n=x.colors)||void 0===n?void 0:n.textClear)},d),dangerouslySetInnerHTML:{__html:m}})]})}},74757:function(e,n,t){"use strict";t.d(n,{J:function(){return c},k:function(){return s}});var i=t(62230),r=t(85244),o=t(98240),l=t(52322);t(2784);var a=t(75289),s=function(e){var n=e.children,t=e.sx,s=(0,o.Z)(e,["children","sx"]);return(0,l.jsx)(a.xu,(0,r.Z)((0,i.Z)({sx:(0,i.Z)({display:["block","block","flex"],flexWrap:"wrap",justifyContent:"space-between"},t)},s),{children:n}))},c=function(e){var n=e.children,t=e.cols;return(0,l.jsx)(a.xu,{sx:{flex:"0 ".concat(100/(void 0===t?2:t)-1,"%"),mb:1},children:n})}},46577:function(e,n,t){"use strict";t.d(n,{$w:function(){return i},Hq:function(){return d},tM:function(){return u}});var i,r=t(62230),o=t(85244),l=t(52322),a=t(63397);t(2784);var s,c=t(75289);(s=i||(i={}))[s.ERROR=0]="ERROR",s[s.DISABLED=1]="DISABLED",s[s.WARNING=2]="WARNING";var u=function(e){var n={"&::placeholder":{color:"#C9D0D8"}};switch(e){case i.DISABLED:return(0,o.Z)((0,r.Z)({},n),{border:"1px solid #E6E6EA",backgroundColor:"#F3F5F7"});case i.ERROR:return(0,o.Z)((0,r.Z)({},n),{border:"1px solid #E26049","&:focus":{outline:"none",borderColor:"#E26049",boxShadow:"0 0 0 3px rgba(226, 96, 73, 0.2), inset 0 1px 2px rgba(226, 96, 73, 0.2)"}});case i.WARNING:return(0,o.Z)((0,r.Z)({},n),{border:"1px solid orange","&:focus":{outline:"none",borderColor:"orange",boxShadow:"0 0 0 3px rgba(255, 165, 0, 0.2), inset 0 1px 2px rgba(255, 165, 0, 0.2)"}});default:return n}},d=function(e){var n=e.sx,t=e.field,s=e.meta,d=e.formField,f=e.fieldName,p=e.fields,x=e.initialValues,m=e.isDisabled,h=s.error?i.ERROR:m||d.disabled?i.DISABLED:void 0;return(0,l.jsxs)(c.xu,{sx:void 0===n?{}:n,children:[(0,l.jsxs)(c.__,{variant:"label.primary",htmlFor:f,children:[d.label||f,s.touched&&s.error?(0,l.jsx)(c.xv,{as:"span",variant:"text.labelError",children:s.error}):null]}),(0,l.jsx)(a.gN,(0,o.Z)((0,r.Z)({id:f,name:f,type:"text",placeholder:d.placeholder||d.label||f},d.fieldLevelValidation&&x?{validate:function(e){return d.fieldLevelValidation&&d.fieldLevelValidation({value:e,fields:p,initialId:x.id})}}:null,t),{as:c.II,sx:u(h),disabled:m||d.disabled}))]})}},3402:function(e,n,t){"use strict";t.d(n,{kp:function(){return c},sP:function(){return d},w8:function(){return f},Hq:function(){return p.Hq}});var i=t(62230),r=t(85244),o=t(52322),l=t(63397),a=t(2784),s=t(75289),c=function(e){var n=e.field,t=e.meta,c=e.fieldName,u=e.label,d=e.focusOnNewEntry,f=void 0===d||d,p=e.inputPlaceholder,x=e.buttonLabel,m=(0,a.useState)(t.value.length),h=m[0],v=m[1],g=(0,a.useRef)(Array(t.value.length));return(0,a.useEffect)(function(){g.current=g.current.slice(0,t.value.length)},[t.value.length]),(0,a.useEffect)(function(){var e=g.current.length;f&&e>h&&g.current[e-1].focus(),v(e)},[g.current.length,f,h]),(0,o.jsxs)(a.Fragment,{children:[(0,o.jsxs)(s.__,{variant:"label.primary",htmlFor:c,children:[u,t.touched&&t.error?(0,o.jsx)(s.xv,{as:"span",variant:"text.labelError",children:t.error}):null]}),(0,o.jsx)(l.F2,(0,r.Z)((0,i.Z)({name:c,id:c},n),{render:function(e){return(0,o.jsxs)("div",{children:[n.value&&n.value.length>0?n.value.map(function(n,t){return(0,o.jsxs)(s.kC,{my:2,children:[(0,o.jsx)(s.II,{placeholder:p,name:"".concat(c,".").concat(t),value:n,ref:function(e){return g.current[t]=e},onChange:function(n){var i=n.target.value;return e.replace(t,i)}}),(0,o.jsx)(s.zx,{ml:2,type:"button",variant:"secondary",onClick:function(){return e.remove(t)},children:"-"})]},"".concat(c,"-").concat(+t+1))}):null,(0,o.jsx)(s.zx,{type:"button",onClick:function(){return e.insert(n.value.length,"")},children:x})]})}}))]})},u=t(98240),d=function(e){e.initialValues;var n=e.meta,t=e.label,a=e.fieldName,c=e.onChange,d=(0,u.Z)(e,["initialValues","meta","label","fieldName","onChange"]);return(0,o.jsxs)(s.__,(0,r.Z)((0,i.Z)({variant:"label.border"},d),{children:[(0,o.jsx)(l.gN,{as:s.XZ,type:"checkbox",name:a,onChange:function(){return c(!n.value)},checked:n.value}),t]}))},f=function(e){var n=e.field,t=e.label,i=e.defaultValue,r=e.onChange,l=e.controlledValue,s=e.setControlledValue,c=e.buildControlledValue,u=(0,a.useState)(i||n.defaultValue||!1),f=u[0],p=u[1];return(0,a.useEffect)(function(){c?s(c(l,f)):s(c)},[f,l,c]),(0,o.jsx)(d,{meta:{value:f},fieldName:n.name,onChange:function(e){return p(e)&&r&&r(e)},label:"function"==typeof t?t(l,f):t})},p=t(46577)},12374:function(e,n,t){"use strict";var i=t(62230),r=t(85244),o=t(98240),l=t(52322),a=t(2784),s=t(75289),c=(0,a.forwardRef)(function(e,n){var t=e.children,a=e.Component,c=void 0===a?s.kC:a,u=e.sx,d=(0,o.Z)(e,["children","Component","sx"]);return(0,l.jsx)(c,(0,r.Z)((0,i.Z)({as:"li",sx:(0,i.Z)({p:3,mx:3,alignItems:"center",variant:"styles.listItem"},void 0===u?{}:u),ref:n},d),{children:t}))});n.Z=c},97470:function(e,n,t){"use strict";t.d(n,{Z:function(){return j}});var i=t(62230),r=t(85244),o=t(52322),l=t(5446),a=t(2784),s=t(40023),c=t(951),u=t(8799),d=t(18978),f=t(59326),p=t(75289),x=t(12374),m=t(89363),h=t(98240),v=t(33710),g=t(82119),b=function(e){var n=e.text,t=e.as,l=e.sx,s=(0,h.Z)(e,["text","as","sx"]),c=(0,a.useRef)(null),u=(0,a.useState)(null),d=u[0],f=u[1],x=function(){f(c.current&&c.current.offsetWidth<c.current.scrollWidth)};return(0,a.useEffect)(function(){return x(),window.addEventListener("resize",x),function(){window.removeEventListener("resize",x)}},[]),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.xv,(0,r.Z)((0,i.Z)({"data-for":n,"data-tip":!0,sx:(0,i.Z)({flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},void 0===l?{}:l),as:t,ref:c},s),{children:n})),d&&(0,o.jsx)(g.X,{children:(0,o.jsx)(v.Z,{id:n,type:"dark",multiline:!0,border:!0,borderColor:"black",place:"bottom",effect:"solid",children:n})})]})},y=function(e){var n,t,i=e.text,r=e.sliceFieldName,l=e.theme,a=e.WidgetIcon;return(0,o.jsxs)(p.kC,{sx:{alignItems:"center",position:"relative"},children:[(0,o.jsx)(a,{size:28,style:{color:null===(n=l.colors)||void 0===n?void 0:n.primary,marginRight:"8px",borderRadius:"4px",padding:"4px",border:"2px solid",borderColor:null===(t=l.colors)||void 0===t?void 0:t.primary}}),(0,o.jsx)(b,{text:i,as:"p",sx:{py:0,px:1,fontWeight:"label",fontSize:"15px"},"data-testid":"field-name"}),(0,o.jsx)(p.xv,{as:"p",sx:{display:["none","none","initial"],fontSize:"14px",ml:1,color:"textClear"},"data-testid":"field-id",children:r})]})},j=function(e){var n=e.item,t=e.index,h=e.deleteItem,v=e.enterEditMode,g=e.modelFieldName,b=e.renderFieldAccessor,j=e.HintElement,Z=e.CustomEditElement,k=e.CustomEditElements,C=e.widget,S=e.draggableId,I=e.testId,F=e.isRepeatableCustomType,E=e.children,w=(0,f.B7)().theme,T=n.key,A=n.value,_=A.config,N=A.type;return(0,o.jsx)(a.Fragment,{children:(0,o.jsx)(s._l,{draggableId:S,index:t,children:function(e){var s,f,S,A,R;return(0,o.jsx)(a.Fragment,{children:(0,o.jsxs)(x.Z,(0,r.Z)((0,i.Z)({"data-testid":I,ref:e.innerRef},e.draggableProps),{Component:p.xu,sx:{p:0,mx:0,my:3},children:[(0,o.jsxs)(p.kC,{sx:{width:"100%"},children:[(0,o.jsx)(m.Z,(0,i.Z)({label:"Reorder slice field (drag and drop)",Icon:d.Fm7,color:null===(s=w.colors)||void 0===s?void 0:s.icons,mr:1,mt:3},e.dragHandleProps)),(0,o.jsxs)(p.xu,{sx:{bg:"headSection",width:"100%",borderRadius:"3px",border:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.borders))}},children:[(0,o.jsxs)(p.kC,{sx:{p:3,alignItems:"center",justifyContent:"space-between",width:"100%"},children:[(0,o.jsx)(y,{theme:w,text:(null==_?void 0:_.label)||T,sliceFieldName:b&&b(T),WidgetIcon:C.Meta.icon}),(0,o.jsxs)(p.kC,{children:[k||null,Z||(0,o.jsx)(m.Z,{size:22,Icon:c.$iz,label:"Edit field",sx:{cursor:"pointer",color:null===(f=w.colors)||void 0===f?void 0:f.icons},onClick:function(){return v([T,n.value],g,t)}}),!(!0===F&&"UID"==N)&&(0,o.jsxs)(l.v2,{children:[(0,o.jsx)(l.j2,{className:"sliceMenuButton","data-testid":"field-menu-button",style:{padding:"0",cursor:"pointer",width:"32px",height:"32px",border:"none",background:"transparent",outline:"0"},children:(0,o.jsx)(u.FQA,{size:20,color:null===(S=w.colors)||void 0===S?void 0:S.icons,style:{pointerEvents:"none"}})}),(0,o.jsx)(l.qy,{style:{background:null===(A=w.colors)||void 0===A?void 0:A.gray,border:"1px solid",borderRadius:"3px",borderColor:null===(R=w.colors)||void 0===R?void 0:R.borders,outline:"0"},children:(0,o.jsx)(l.sN,{style:{padding:"6px",cursor:"pointer"},onSelect:function(){return h(T)},children:"Delete field"})})]})]})]}),j||null]})]}),E]}))})}})})}},89363:function(e,n,t){"use strict";var i=t(62230),r=t(85244),o=t(98240),l=t(52322),a=t(75289),s=function(e,n){return n?{border:function(e){var n=e.colors;return"1px solid ".concat(n.error)}}:e?{border:function(e){var n=e.colors;return"1px solid ".concat(n.primary)}}:{border:function(e){var n=e.colors;return"1px solid ".concat(n.borders)}}},c=function(e){var n=e.sx,t=e.onClick,c=e.label,u=e.Icon,d=e.error,f=e.size,p=void 0===f?16:f,x=e.fitButton,m=e.active,h=e.useActive,v=e.activeSx,g=(0,o.Z)(e,["sx","onClick","label","Icon","error","size","fitButton","active","useActive","activeSx"]);return(0,l.jsx)(a.hU,(0,r.Z)((0,i.Z)({onClick:void 0===t?function(){return null}:t,"aria-label":c,type:"button",sx:(0,i.Z)({},void 0!==x&&x?{width:p,height:p}:null,void 0!==h&&h&&(void 0===v?s:v)(void 0!==m&&m,void 0===d?null:d),void 0===n?null:n)},g),{children:(0,l.jsx)(u,{size:p})}))};n.Z=c},46784:function(e,n,t){"use strict";var i=t(62230),r=t(17064),o=t(52322),l=t(63397),a=t(2784),s=t(75289),c=t(3402),u=t(98079),d=function(e){var n=e.fieldName,t=e.formField,d=e.fields,f=e.initialValues,p=(0,r.Z)((0,l.U$)(n),3),x=p[0],m=p[1],h=p[2],v=t.component;return(0,o.jsx)(s.xu,{sx:(0,i.Z)({mt:2,alignItems:"center"},t.type===u.h.CHECKBOX?{display:"flex",height:"130%"}:null),children:v?(0,o.jsx)(v,{meta:m,field:x,helpers:h,fieldName:n,formField:t,initialValues:f}):(0,o.jsxs)(a.Fragment,{children:[t.type===u.h.INPUT?(0,o.jsx)(c.Hq,{meta:m,field:x,fields:d,formField:t,fieldName:n,initialValues:f}):null,t.type===u.h.CHECKBOX&&(0,o.jsx)(c.sP,{meta:m,label:t.label,fieldName:n,initialValues:f,onChange:function(e){return h.setValue(e)}})]})})};n.Z=d},73393:function(e,n,t){"use strict";t.d(n,{Z:function(){return B}});var i=t(62230),r=t(85244),o=t(17064),l=t(52322),a=t(37149),s=t.n(a),c=t(59326),u=t(75289),d=t(65413),f=t(2784),p=t(92928),x=t(98898),m=t(98240),h=function(e){var n=e.children,t=(0,m.Z)(e,["children"]);return(0,l.jsx)(u.xu,(0,r.Z)((0,i.Z)({as:"ul",sx:{p:0,m:0,px:function(e){return"calc(".concat(e.space[3],"px + 8px)")},borderBottom:"1px solid #DFE1E5",position:"relative"}},t),{children:n}))};h.tabsRole="TabList";var v=function(e){var n=e.children,t=(0,m.Z)(e,["children"]),o=(0,c.B7)().theme;return(0,l.jsx)(p.OK,(0,r.Z)((0,i.Z)({},t),{style:(0,i.Z)({margin:"0 32px 0 0",top:"0",padding:"8px 0px",border:"none",bottom:"-1px",opacity:"0.8",transition:"all 150ms cubic-bezier(0.215,0.60,0.355,1)",borderRadius:"0"},t.selected?{borderBottom:"3px solid ".concat(o.colors.primary),color:o.colors.text,fontWeight:"500",opacity:"1",backgroundColor:"transparent"}:{borderBottom:"3px solid transparent"}),children:n}))};v.tabsRole="Tab";var g=function(e){var n=e.children,t=e.Footer,r=e.Header,o=e.tabs,a=e.bodySx,s=e.footerSx,c=e.defaultIndex,d=void 0===c?0:c,m=(0,f.useState)(d),g=m[0],b=m[1];return(0,l.jsx)(x.Z,{borderFooter:!0,footerSx:(0,i.Z)({p:0},s),bodySx:(0,i.Z)({p:0},a),sx:{border:"none"},Header:r,Footer:t,children:(0,l.jsxs)(p.mQ,{defaultIndex:d,onSelect:function(e){return b(e)},children:[(0,l.jsx)(h,{children:(o||[]).map(function(e){return(0,l.jsx)(v,{children:e},e)})}),f.Children.map(n,function(e,n){return(0,l.jsx)(u.xu,{sx:{p:function(e){return"calc(".concat(e.space[3],"px + 8px)")},display:n===g?"block":"none"},children:(0,l.jsx)(p.x4,{children:e})})})]})})},b=(0,f.memo)(g),y=t(74757),j=function(e){var n,t,i=e.text,r=e.sliceFieldName,o=e.theme,a=e.WidgetIcon;return(0,l.jsxs)(u.kC,{sx:{alignItems:"center"},children:[(0,l.jsx)(a,{size:28,style:{color:null===(n=o.colors)||void 0===n?void 0:n.primary,marginRight:"8px",borderRadius:"4px",padding:"4px",border:"2px solid",borderColor:null===(t=o.colors)||void 0===t?void 0:t.primary}}),(0,l.jsx)(u.xv,{as:"p","data-testid":"item-header-text",sx:{py:0,px:1,fontWeight:"label",fontSize:"15px"},children:i}),(0,l.jsx)(u.xv,{as:"p",sx:{display:["none","none","initial"],fontSize:"14px",ml:1,color:"textClear"},children:r})]})},Z=t(83399),k=t(77495),C=t(5632),S=t(65186),I=t(63094),F=function(){var e=(0,C.useRouter)();return(0,l.jsxs)(u.xu,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",padding:"60px"},children:[(0,l.jsx)(S.wr$,{size:48,color:"#C9D0D8"}),(0,l.jsx)(u.xu,{sx:{height:"12px"}}),(0,l.jsx)(u.xv,{color:"text",sx:{fontWeight:600,fontSize:"24px",lineHeight:"32px",textAlign:"center"},children:"Your mock data has moved"}),(0,l.jsx)(u.xu,{sx:{height:"8px"}}),(0,l.jsx)(u.xv,{color:"text",sx:{fontWeight:400,fontSize:"14px",lineHeight:"24px",textAlign:"center"},children:"You can now edit directly your mock data in the new Slice Simulator."}),(0,l.jsx)(u.xu,{sx:{height:"24px"}}),(0,l.jsx)(u.zx,{onClick:function(n){n.preventDefault(),window.open("".concat(e.asPath,"/simulator"),I.pq)},children:"Go to the Slice Simulator"})]})},E=t(74096),w=t(13302),T=t(8830),A=t(46784),_=t(67557),N=t(77033),R=t(63397),M=function(e){var n=e.formId,t=e.initialValues,a=e.validationSchema,s=e.onSave,c=e.FormFields,d=e.children;return(0,l.jsx)(u.xu,{children:(0,l.jsx)(R.J9,{initialValues:t,validationSchema:a,onSubmit:function(e,n){var t;s({newKey:e.id,value:Object.entries((0,m.Z)(e,["id"])).reduce(function(e,n){var t=(0,o.Z)(n,2),l=t[0],a=t[1];if((void 0===a?"undefined":(0,N.Z)(a))!==Boolean&&!a){var s,u=null===(s=c[l])||void 0===s?void 0:s.defaultValue;if(void 0!==u)return(0,r.Z)((0,i.Z)({},e),(0,_.Z)({},l,u))}return(0,r.Z)((0,i.Z)({},e),(0,_.Z)({},l,a))},{})})},children:function(e){return(0,l.jsx)(R.l0,{id:n,children:d((0,r.Z)((0,i.Z)({},e),{initialValues:t}))})}})})},z=(0,f.memo)(M);s().setAppElement("#__next");var B=function(e){var n=e.close,t=e.data,a=e.fields,s=e.onSave,f=e.zoneType,p=(0,c.B7)().theme;if(!t.isOpen)return null;var x=(0,o.Z)(t.field,2),m=x[0],h=x[1],v=(0,T.t)(E,h.config,h.type);if(!v)return(0,l.jsxs)("div",{children:[h.type," not found"]});var g=v.Meta.icon,C=v.FormFields,S=v.Form,I=v.schema,_=(0,i.Z)({},(0,k.f7)((0,w.B9)(C,"id")),v.prepareInitialValues?v.prepareInitialValues(h.config):h.config),N=function(){try{return{res:I.validateSync({type:h.type,config:_},{stripUnknown:!0})}}catch(e){return{err:e}}}(),R=N.res,M=N.err;M&&(console.error("[EditModal] Failed to validate field of type ".concat(h.type,".\n Please update model.json accordingly.")),console.error(M));var B={id:m,config:R?R.config:_},q=(0,o.Z)(C.id.validate.matches,2),D=q[0],O=q[1],P=d.object().shape({id:d.string().matches(D,O).min(3).max(35).required(),config:I.fields.config}),V="".concat("edit-modal-form","-").concat(Math.random().toString());return(0,l.jsx)(Z.Z,{isOpen:!0,shouldCloseOnOverlayClick:!0,onRequestClose:n,contentLabel:"Widget Form Modal",children:(0,l.jsx)(z,{apiId:m,formId:V,initialValues:B,validationSchema:P,FormFields:C,onSave:function(e){var t=e.newKey,r=e.value;s({apiId:m,newKey:t,value:(0,i.Z)({},h,r)}),n()},children:function(e){var t=e.values,s=t.id,c=t.config.label,d=e.isValid,x=e.isSubmitting,m=e.initialValues,h=S?(0,l.jsx)(S,(0,r.Z)((0,i.Z)({},e),{fields:a}),"field-model-tab-content"):(0,l.jsx)(y.k,{children:Object.entries(C).map(function(e){var n=(0,o.Z)(e,2),t=n[0],i=n[1];return(0,l.jsx)(y.J,{children:(0,l.jsx)(A.Z,{fieldName:(0,k.lm)(t),formField:i,fields:a,initialValues:m})},t)})},"field-model-tab-content"),v=["Field Model"],Z=[h];if("slice"===f){var I=(0,l.jsx)(u.xu,{children:(0,l.jsx)(F,{})},"mock-data-tab-content");v.push("Mock Data"),Z.push(I)}return(0,l.jsx)(b,{borderFooter:!0,footerSx:{position:"sticky",bottom:0,p:0},tabs:v,Header:function(e){var t=e.radius;return(0,l.jsxs)(u.kC,{sx:{position:"sticky",zIndex:1,top:0,p:3,bg:"headSection",alignItems:"center",justifyContent:"space-between",borderTopLeftRadius:t,borderTopRightRadius:t},children:[(0,l.jsx)(j,{theme:p,text:c||s,WidgetIcon:g}),(0,l.jsx)(u.x8,{onClick:n,type:"button"})]})},Footer:(0,l.jsxs)(u.kC,{sx:{position:"sticky",bottom:0,alignItems:"space-between",bg:"headSection",p:3},children:[(0,l.jsx)(u.xu,{sx:{ml:"auto"}}),(0,l.jsx)(u.zx,{mr:2,type:"button",onClick:n,variant:"secondary",children:"Cancel"}),(0,l.jsx)(u.zx,{form:V,type:"submit",disabled:!d&&x,sx:{fontWeight:"400",paddingBlock:"8px",paddingInline:"16px",fontSize:"14px",borderRadius:"4px"},children:"Done"})]}),children:Z})}})})}},35308:function(e,n,t){"use strict";t.d(n,{Z:function(){return x}});var i=t(62230),r=t(85244),o=t(52322),l=t(37149),a=t.n(l),s=t(75289),c=t(98898),u=t(74757),d=t(83399),f=t(59326),p=function(e){var n=e.title,t=e.description,i=e.icon,r=e.onSelect,l=(0,f.B7)().theme;return(0,o.jsxs)(s.kC,{sx:{p:3,my:2,alignItems:"center",cursor:"pointer",borderRadius:"3px",border:function(e){var n;return"1px solid ".concat(null===(n=e.colors)||void 0===n?void 0:n.borders)},"&:hover":{border:function(e){var n=e.colors;return"1px solid ".concat(n.primary)},boxShadow:"0 0 0 3px rgba(81, 99, 186, 0.2)"}},"data-testid":n,onClick:r,children:[(0,o.jsx)(i,{label:'Select field of type "'.concat(n,'"'),style:{color:l.colors.primary,marginRight:"8px",borderRadius:"4px",padding:"5px",border:"2px solid",borderColor:l.colors.primary},size:32}),(0,o.jsxs)(s.xu,{ml:1,children:[(0,o.jsx)(s.X6,{as:"h4",sx:{fontSize:1},children:(0,o.jsx)("b",{children:n})}),(0,o.jsx)(s.xv,{as:"p",variant:"xs",children:t})]})]})};a().setAppElement("#__next");var x=function(e){var n=e.data,t=e.close,l=e.onSelect,a=e.widgetsArray;return n.isOpen?(0,o.jsx)(d.Z,{isOpen:!0,shouldCloseOnOverlayClick:!0,onRequestClose:t,contentLabel:"Widget Form Modal",children:(0,o.jsx)(c.Z,{borderFooter:!0,footerSx:{p:3},bodySx:{pt:2,pb:4,px:4},sx:{border:"none"},Header:function(e){var n=e.radius;return(0,o.jsxs)(s.kC,{sx:{position:"sticky",top:0,zIndex:1,p:3,pl:4,bg:"headSection",alignItems:"center",justifyContent:"space-between",borderTopLeftRadius:n,borderTopRightRadius:n,borderBottom:function(e){var n;return"1px solid ".concat(null===(n=e.colors)||void 0===n?void 0:n.borders)}},children:[(0,o.jsx)(s.X6,{children:"Add a new field"}),(0,o.jsx)(s.x8,{onClick:t})]})},children:(0,o.jsx)(u.k,{children:a.filter(function(e){return e}).map(function(e){var n=e.Meta,t=e.TYPE_NAME,a=e.CUSTOM_NAME;return(0,o.jsx)(u.J,{children:(0,o.jsx)(p,(0,r.Z)((0,i.Z)({},n),{onSelect:function(){return l(a||t)}}))},a||t)})})})}):null}},13166:function(e,n,t){"use strict";t.d(n,{Z:function(){return v}});var i=t(22710),r=t(99267),o=t(52322),l=t(2784),a=t(49857),s=t(81038),c=t(77245),u=t(8799),d=t(65186),f=t(59326),p=t(75289),x=t(57899),m={position:"relative",top:"3px"},h=function(e){var n,t,i,r=e.code,a=e.lang,s=(0,f.B7)().theme,h=(0,l.useState)(!1),v=h[0],g=h[1],b=function(){r&&navigator.clipboard.writeText(r).then(function(){g(!0),setTimeout(function(){g(!1)},1200)})};return r?(0,o.jsxs)(p.kC,{sx:{p:2,px:3,alignItems:"center",borderTop:"1px solid",borderColor:"borders",justifyContent:"space-between"},children:[(0,o.jsxs)(p.kC,{sx:{alignItems:"center",display:["none","none","flex"],maxWidth:"80%"},children:[(0,o.jsx)(u.vcz,{size:26,color:null==s?void 0:null===(n=s.colors)||void 0===n?void 0:n.icons,style:{border:"1px solid",borderColor:null==s?void 0:null===(t=s.colors)||void 0===t?void 0:t.borders,borderRadius:"3px",padding:"4px",marginRight:"2px"}}),(0,o.jsx)(x.Z,{sx:{margin:"0px 8px",border:"none",borderRadius:"3px",fontSize:"13px"},lang:a,children:r})]}),(0,o.jsx)(p.xu,{children:(0,o.jsxs)(p.zx,{"aria-label":v?"Code snippet copied":"Copy code snippet",onClick:b,variant:"textButton",children:[v?(0,o.jsx)(d.HhX,{size:16,color:null==s?void 0:null===(i=s.colors)||void 0===i?void 0:i.success,style:m}):(0,o.jsx)(c.LhG,{size:16,style:m}),(0,o.jsx)(p.xv,{as:"span",sx:{display:["none","inline","none","inline"]},children:"\xa0Copy"})]})})]}):null},v=function(e){var n=e.show,t=e.renderHintBase,l=e.item,c=t({item:l}),u=(0,a.ZP)(c,(0,i.Z)(function(){return(0,r.__generator)(this,function(e){switch(e.label){case 0:return[4,s.j.snippets.readSnippets({fieldPath:c.split("."),model:l.value})];case 1:return[2,e.sent()]}})})),d=u.data,f=u.error;if(f&&console.error(f),!d||f)return null;var p=d.snippets||[];return p[0]?(0,o.jsx)("div",{style:{display:n?"initial":"none"},children:(0,o.jsx)(h,{code:p[0].code,lang:p[0].language})}):null}},76167:function(e,n,t){"use strict";t.d(n,{Z:function(){return Z}});var i=t(62230),r=t(85244),o=t(98240),l=t(52322),a=t(22715),s=t(63397),c=t(2784),u=t(75289),d=t(59326),f=t(46577),p=t(77495),x=t(77735),m=t(74096),h=t(17384),v=t(18978),g=t(33710),b=t(82119),y=function(e){var n=e.error;return n?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(b.X,{children:(0,l.jsx)(g.Z,{type:"light",multiline:!0,border:!0,borderColor:"tomato"})}),(0,l.jsx)(v.Zlu,{color:"tomato","data-tip":n,style:{position:"absolute",right:"8px"},size:16})]}):null},j=function(e){var n=e.innerRef,t=(0,o.Z)(e,["innerRef"]);return(0,l.jsx)(u.II,(0,r.Z)((0,i.Z)({},t),{ref:n}))},Z=function(e){var n=e.widgetTypeName,t=e.fields,o=e.onSave,v=e.onCancelNewField,g=(0,c.useRef)(null),b=(0,d.B7)().theme,Z=(0,c.useState)(!0),k=Z[0],C=Z[1];(0,c.useEffect)(function(){g.current&&g.current.focus()},[g]);var S=m[n];if(!S)return console.error('Widget of type "'.concat(n,'" not found. This is a problem on our side!')),(0,l.jsx)("div",{children:"Unexpected error. Contact us for more info."});var I=S.FormFields,F=S.Meta.icon,E={id:I.id,label:I.label},w=(0,r.Z)((0,i.Z)({},(0,p.f7)(E),"UID"===n?{id:"uid"}:{}),{widgetTypeName:n}),T=(0,p.gc)(E),A=function(e,n,t){t(k&&!E.id.disabled?(0,r.Z)((0,i.Z)({},n),{label:e.target.value,id:(0,h.lV)(e.target.value)}):(0,r.Z)((0,i.Z)({},n),{label:e.target.value}))},_=function(e,n){n("id",e.target.value),C(!1)};return(0,l.jsx)(s.J9,{onSubmit:o,validationSchema:T,initialValues:w,children:function(e){var n,o,c=e.errors,d=e.values,p=e.setValues,m=e.setFieldValue,h=e.submitForm;return(0,l.jsx)(s.l0,{"data-testid":"new-field-form",children:(0,l.jsxs)(u.kC,{as:"li",sx:{bg:"white",p:3,px:3,mx:0,ml:"34px",alignItems:"center",variant:"styles.listItem",border:function(e){var n,t;return"1px solid ".concat((null===(n=e.colors)||void 0===n?void 0:null===(t=n.borders)||void 0===t?void 0:t.toString())||"")},flexWrap:"wrap",gap:"12px",justifyContent:"flex-start"},children:[(0,l.jsx)(F,{style:{color:null===(n=b.colors)||void 0===n?void 0:n.primary,borderRadius:"4px",padding:"4px",border:"2px solid",borderColor:null===(o=b.colors)||void 0===o?void 0:o.primary},size:28}),(0,l.jsxs)(u.kC,{sx:{alignItems:"center",flexGrow:1,gap:2,position:"relative"},children:[(0,l.jsx)(u.xv,{as:"p",sx:{fontWeight:500,whiteSpace:"nowrap"},children:"Field Name"}),(0,l.jsx)(s.gN,{onChange:function(e){return A(e,d,p)},onKeyDown:function(e){"Enter"===e.key&&h()},name:"label",placeholder:"Field Name",type:"text",validate:function(e){if(!e.length)return"This field is required"},as:j,innerRef:g,sx:(0,r.Z)((0,i.Z)({},(0,f.tM)(E.label.disabled?f.$w.DISABLED:c.label?f.$w.ERROR:void 0)),{flexGrow:1,minWidth:"128px",width:"initial"}),"aria-label":"label-input","data-testid":"new-field-name-input"}),(0,l.jsx)(y,{error:c.label})]}),(0,l.jsxs)(u.kC,{sx:{alignItems:"center",flexGrow:1,gap:2,position:"relative"},children:[(0,l.jsx)(u.xv,{as:"p",sx:{fontWeight:500,whiteSpace:"nowrap"},children:"Field ID"}),(0,l.jsx)(s.gN,{onChange:function(e){return _(e,m)},onKeyDown:function(e){"Enter"===e.key&&h()},name:"id",placeholder:"e.g. buttonLink",type:"text",disabled:E.id.disabled,validate:function(e){return(0,x.u)({value:e,fields:t,initialId:null})},as:j,sx:(0,r.Z)((0,i.Z)({},(0,f.tM)(E.id.disabled?f.$w.DISABLED:c.id?f.$w.ERROR:void 0)),{flexGrow:1,minWidth:"128px",width:"initial"}),"data-testid":"new-field-id-input"}),(0,l.jsx)(y,{error:c.id})]}),(0,l.jsxs)(u.kC,{sx:{gap:2},children:[(0,l.jsx)(a.zx,{onClick:v,color:"grey",children:"Cancel"}),(0,l.jsx)(a.zx,{onClick:function(){h()},children:"Add"})]})]})})}})}},18645:function(e,n,t){"use strict";t.d(n,{Z:function(){return I}});var i=t(62230),r=t(85244),o=t(17064),l=t(81541),a=t(52322),s=t(22715),c=t(13980),u=t(2784),d=t(65077),f=t(82770),p=t(28173),x=t(35308),m=t(40023),h=t(75289),v=t(12374),g=t(97470),b=t(74096),y=t(8830),j=t(13166),Z=function(e){var n=e.fields,t=e.title,o=e.tabId,l=e.enterEditMode,s=e.enterSelectMode,c=e.onDragEnd,u=e.renderFieldAccessor,d=e.onDeleteItem,f=e.showHints,p=e.newField,x=e.renderHintBase,Z=e.isRepeatable,k=e.testId,C=e.isRepeatableCustomType;return(0,a.jsx)(m.Z5,{onDragEnd:c,children:(0,a.jsx)(m.bK,{droppableId:t,children:function(e,t){return(0,a.jsxs)(h.xu,(0,r.Z)((0,i.Z)({as:"ul",ref:e.innerRef},e.droppableProps),{"data-testid":k,sx:{paddingInline:"16px !important"},children:[n.map(function(e,n){var c=e.value,p=c.config,m=c.type,k=(0,y.t)(b,p,m);if(!k)return(0,a.jsx)(v.Z,{children:(0,a.jsxs)(h.xv,{children:['Field type "',m,'" not supported']})});var S={item:e,index:n,tabId:o,widget:k,showHints:f,key:e.key,enterSelectMode:s,renderFieldAccessor:u,enterEditMode:l,parentSnapshot:t,deleteItem:d,draggableId:"list-item-".concat(e.key),isRepeatableCustomType:C,testId:"list-item-".concat(e.key)};if(k.CustomListItem){var I=k.CustomListItem;return(0,a.jsx)(I,(0,i.Z)({},S))}var F=(0,a.jsx)(j.Z,{item:e,show:f,isRepeatable:Z,renderHintBase:x,Widgets:b,typeName:k.CUSTOM_NAME||k.TYPE_NAME});return(0,a.jsx)(g.Z,(0,r.Z)((0,i.Z)({},S),{HintElement:F}))}),e.placeholder,p]}))}})})},k=t(76167),C=function(e){var n=e.onEnterSelectMode,t=e.zoneName;return(0,a.jsxs)(h.xu,{sx:{textAlign:"center",my:4},children:[(0,a.jsx)(h.X6,{as:"h5",children:"Add a new field here"}),(0,a.jsx)(h.xu,{sx:{my:2},children:(0,a.jsx)(h.xv,{sx:{color:"textClear"},children:"Fields are inputs for content (e.g. text, images, links)."})}),(0,a.jsx)(h.xu,{sx:{display:"flex",justifyContent:"center",marginTop:16},children:(0,a.jsx)(s.zx,{color:"grey",onClick:function(){return n()},"data-testid":"add-".concat(t,"-field"),startIcon:"add",children:"Add a new field"})})]})},S=function(e){var n=e.zoneType,t=e.zoneTypeFormat,c=e.tabId,m=e.title,h=e.fields,v=e.poolOfFieldsToCheck,g=e.widgetsArray,b=e.isRepeatable,y=e.onDeleteItem,j=e.onSaveNewField,S=e.onDragEnd,I=e.EditModal,F=e.onSave,E=e.dataTip,w=e.renderHintBase,T=e.renderFieldAccessor,A=e.testId,_=e.isRepeatableCustomType,N=Object.entries(v).find(function(e){return"UID"===(0,o.Z)(e,2)[1].value.type})?g.filter(function(e){return"UID"!==e.TYPE_NAME}):g,R=(0,u.useState)(!1),M=R[0],z=R[1],B=(0,u.useState)({isOpen:!1}),q=B[0],D=B[1],O=(0,u.useState)({isOpen:!1}),P=O[0],V=O[1],L=(0,u.useState)(null),H=L[0],J=L[1],U=function(e){D({isOpen:!0,field:e});var i=(0,o.Z)(e,2),r=i[0],l=i[1];f.Xe.track({event:"field:settings-opened",id:r,name:l.config.label,type:l.type,isInAGroup:!1,contentType:"customType"===n?"page"===t?"page type":"custom type":"slice"})},W=function(){V({isOpen:!0})},$=function(){D({isOpen:!1})},G=function(){return V({isOpen:!1})},Y=function(e){J({widgetTypeName:e,fields:h}),V({isOpen:!1})},X=function(){return J(null)};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(p.Bu,{actions:h.length>0?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(s.xv,{color:"grey11",component:"span",noWrap:!0,children:"Show code snippets?"}),(0,a.jsx)(s.rs,{checked:M,onCheckedChange:z,size:"small",style:{flexShrink:0},"data-testid":"code-snippets-switch"}),(0,a.jsx)(s.zx,{"data-testid":"add-".concat(b?"Repeatable":"Static","-field"),onClick:W,startIcon:"add",color:"grey",disabled:null!==H,children:"Add a new field"})]}):void 0,children:m}),0!==h.length||H?h.length>0||H?(0,a.jsx)(d.xR,{children:(0,a.jsx)(Z,{tabId:c,isRepeatable:b,fields:h,showHints:M,dataTip:E,title:m,renderFieldAccessor:T,renderHintBase:w,enterEditMode:U,enterSelectMode:W,onDragEnd:S,onDeleteItem:y,testId:A,isRepeatableCustomType:_,newField:H&&(0,a.jsx)(k.Z,(0,r.Z)((0,i.Z)({},H),{fields:v||h,onSave:function(){for(var e=arguments.length,n=Array(e),t=0;t<e;t++)n[t]=arguments[t];j.apply(void 0,(0,l.Z)(n)),J(null)},onCancelNewField:X}))})}):void 0:(0,a.jsx)(d.xR,{children:(0,a.jsx)(C,{onEnterSelectMode:function(){return W()},zoneName:b?"Repeatable":"Static"})}),(0,a.jsx)(I,{data:q,close:$,onSave:F,fields:v,zoneType:n}),(0,a.jsx)(x.Z,{data:P,close:G,onSelect:Y,widgetsArray:N})]})};S.propTypes={isRepeatable:c.bool,title:c.string.isRequired,dataTip:c.string.isRequired,onSave:c.func.isRequired,onSaveNewField:c.func.isRequired,onDragEnd:c.func.isRequired,onDeleteItem:c.func.isRequired,poolOfFieldsToCheck:(0,c.arrayOf)((0,c.shape)({key:c.string,value:c.object})),renderHintBase:c.func.isRequired,renderFieldAccessor:c.func.isRequired,widgetsArray:c.array.isRequired,fields:(0,c.arrayOf)((0,c.shape)({key:c.string.isRequired,value:(0,c.shape)({config:c.object,fields:c.array,type:c.string.isRequired})}))};var I=S},8830:function(e,n,t){"use strict";t.d(n,{t:function(){return i}});var i=function(e,n,t){if("Link"===t)switch(null==n?void 0:n.select){case"document":return e.ContentRelationship;case"media":return e.LinkToMedia;default:return e.Link}return e[t]}},77735:function(e,n,t){"use strict";t.d(n,{J:function(){return l},u:function(){return o}});var i=t(63094),r=t(43947),o=function(e){var n=e.value,t=e.fields,i=e.initialId;return n?t.find(function(e){return e.key===n})&&n!==i?'Field "'.concat(n,'" already exists.'):void 0:"Field is required"},l={label:(0,r.II)("Label",{required:"This field is required",max:!0},void 0,void 0,"Label for content creators (defaults to field type)"),id:(0,r.II)("API ID*",{min:!0,max:!0,required:"This field is required",matches:[i.xo,"No special characters allowed (except _)"]},o,void 0,"A unique identifier for the field (e.g. buttonLink)"),placeholder:(0,r.II)("Placeholder",{required:"This field is required",max:[100,"String is too long. Max: 100"]},void 0,void 0,"Placeholder text for content creators")}},43947:function(e,n,t){"use strict";t.d(n,{II:function(){return c},Jg:function(){return o}});var i=t(77495),r=t(98079),o=function(e){var n=!(arguments.length>1)||void 0===arguments[1]||arguments[1],t=!(arguments.length>2)||void 0===arguments[2]||arguments[2];return{type:r.h.CHECKBOX,validate:{required:(0,i.MJ)(n,s)},required:n,label:e,defaultValue:t,yupType:"boolean"}},l=[3,"String is too short. Min: 3"],a=[35,"String is too long. Max: 35"],s=["Field is required"],c=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{min:l,max:a,required:s},t=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,c=arguments.length>4?arguments[4]:void 0,u=n||{},d=u.min,f=u.max,p=u.required,x=u.matches;return{type:r.h.INPUT,label:e,validate:{required:(0,i.MJ)(p,s),min:(0,i.MJ)(d,l),max:(0,i.MJ)(f,a),matches:x},defaultValue:o,fieldLevelValidation:t,yupType:"string",placeholder:c}}},77495:function(e,n,t){"use strict";t.d(n,{MJ:function(){return d},f7:function(){return f},gc:function(){return p},lm:function(){return u}});var i=t(67557),r=t(62230),o=t(85244),l=t(17064),a=t(81541),s=t(65413),c=t(98079),u=function(e){return"id"===e?"id":"config.".concat(e)},d=function(e,n){return Array.isArray(e)?e:"boolean"==typeof e&&e?n:null},f=function(e){return Object.entries(e).reduce(function(e,n){var t,a=(0,l.Z)(n,2),s=a[0],u=null===(t=a[1]).defaultValue?void 0:void 0!==t.defaultValue?t.defaultValue:t.type===c.h.CHECKBOX||(t.type===c.h.INPUT?"":t.type===c.h.SELECT?[]:void 0);return void 0!==u?(0,o.Z)((0,r.Z)({},e),(0,i.Z)({},s,u)):e},{})},p=function(e){return s.object().shape(Object.entries(e).filter(function(e){return e}).reduce(function(e,n){var t=(0,l.Z)(n,2),c=t[0],u=t[1],d=u.validate,f=u.yupType;if(!d)return e;if("function"==typeof d)return(0,o.Z)((0,r.Z)({},e),(0,i.Z)({},c,d(c,u)));var p=s[f]();return Object.entries(d).filter(function(e){return e&&e[1]}).forEach(function(e){var n,t=(0,l.Z)(e,2),i=t[0],r=t[1];if(r&&p[i]){p=(n=p)[i].apply(n,(0,a.Z)(Array.isArray(r)?r:[r]));return}console.warn('Invalid Yup validator for field "'.concat(c,'"'))}),(0,o.Z)((0,r.Z)({},e),(0,i.Z)({},c,p))},{})).required().default(void 0).noUnknown(!0)}},98079:function(e,n,t){"use strict";var i,r;t.d(n,{h:function(){return i}}),(r=i||(i={})).CHECKBOX="checkbox",r.INPUT="input",r.SELECT="select"},3602:function(e,n,t){"use strict";t.d(n,{H:function(){return f}});var i=t(8799),r=t(65413),o=t(77495),l=t(77735),a=t(43947),s=t(13302),c={icon:i.XGl,title:"Boolean",description:"An input that is either true or false"},u={label:l.J.label,id:l.J.id,placeholder_false:(0,a.II)("False Placeholder",{required:!1},null,"false","Value the content creator sees (Output as 'false' in the API)."),placeholder_true:(0,a.II)("True Placeholder",{required:!1},null,"true","Value the content creator sees (Output as 'true' in the API)"),default_value:(0,a.Jg)("Default to true")},d=r.object().shape({type:r.string().matches(/^Boolean$/,{excludeEmptyString:!0}).required(),config:(0,o.gc)((0,s.B9)(u,"id"))}),f={TYPE_NAME:"Boolean",create:function(e){return{type:"Boolean",config:{label:e,default_value:!1,placeholder_true:"true",placeholder_false:"false"}}},Meta:c,schema:d,FormFields:u}},53162:function(e,n,t){"use strict";t.d(n,{S:function(){return c}});var i,r=t(65186),o=t(13302),l={icon:r.jqW,title:"Color",description:"A color picker"},a=(0,o.zg)("Color"),s=a.TYPE_NAME,c={create:function(e){return{type:"Color",config:{label:e,placeholder:""}}},FormFields:a.FormFields,TYPE_NAME:s,schema:a.schema,Meta:l}},2737:function(e,n,t){"use strict";t.d(n,{l:function(){return C}});var i=t(62230),r=t(85244),o=t(65186),l=t(56580),a=t(65413),s=t(52312),c=t(28849),u=t(81618),d=t(17064),f=t(52322),p=t(36131),x=t(75289),m=t(74757),h=t(46784),v=t(77495),g=t(77735),b={label:g.J.label,id:g.J.id,customtypes:{validate:function(){return a.array().of(a.string())}}},y=function(e){var n=e.initialValues,t=e.values,o=e.fields,a=e.setFieldValue,u=(0,l.v9)(c.Ch).filter(s.TG),g=u.map(function(e){return{value:e.local.id,label:e.local.label}}),y=t.config.customtypes?t.config.customtypes.map(function(e){var n=u.find(function(n){return n.local.id===e});return{value:null==n?void 0:n.local.id,label:null==n?void 0:n.local.label}}):null;return(0,f.jsxs)(m.k,{children:[Object.entries(b).filter(function(e){return"customtypes"!==e[0]}).map(function(e){var t=(0,d.Z)(e,2),i=t[0],r=t[1];return(0,f.jsx)(m.J,{children:(0,f.jsx)(h.Z,{fieldName:(0,v.lm)(i),formField:r,fields:o,initialValues:n})},i)}),(0,f.jsx)(m.J,{children:(0,f.jsxs)(x.xu,{sx:{mt:2,alignItems:"center"},children:[(0,f.jsx)(x.__,{htmlFor:"origin",mb:"1",children:"Types"}),(0,f.jsx)(p.ZP,{isMulti:!0,name:"origin",options:g,onChange:function(e){e&&a("config.customtypes",e.map(function(e){return e.value}))},value:y,theme:function(e){return(0,r.Z)((0,i.Z)({},e),{colors:(0,r.Z)((0,i.Z)({},e.colors),{text:"text",primary:"background"})})}})]})})]})},j={icon:o.I2R,title:"Content Relationship",description:"Define content relations & internal links"},Z=u.I.shape({label:a.string().max(35,"String is too long. Max: 35"),select:a.string().required().matches(/^document$/,{excludeEmptyString:!0}),customtypes:a.array(a.string()).strict().optional()}),k=a.object().shape({type:a.string().matches(/^Link$/,{excludeEmptyString:!0}).required(),config:Z}),C={create:function(e){return{type:"Link",config:{label:e,select:"document"}}},Meta:j,schema:k,TYPE_NAME:"Link",FormFields:b,CUSTOM_NAME:"ContentRelationship",Form:y,prepareInitialValues:function(e){var n=(0,l.v9)(c.Ch).filter(s.TG);return(null==e?void 0:e.customtypes)?(0,r.Z)((0,i.Z)({},e),{customtypes:e.customtypes.filter(function(e){return n.find(function(n){return n.local.id===e})})}):e}}},17517:function(e,n,t){"use strict";t.d(n,{v:function(){return a}});var i,r=t(65186),o=(0,t(13302).zg)("Date"),l=o.FormFields,a={create:function(e){return{type:"Date",config:{label:e,placeholder:""}}},FormFields:l,TYPE_NAME:"Date",schema:o.schema,Meta:{icon:r.f$3,title:"Date",description:"A calendar date picker"}}},58165:function(e,n,t){"use strict";t.d(n,{S:function(){return a}});var i,r=t(34543),o=(0,t(13302).zg)("Embed"),l=o.FormFields,a={create:function(e){return{type:"Embed",config:{label:e,placeholder:""}}},FormFields:l,TYPE_NAME:"Embed",schema:o.schema,Meta:{icon:r.xqv,title:"Embed",description:"Embed videos, songs, tweets, slides, …"}}},98844:function(e,n,t){"use strict";t.d(n,{X:function(){return s}});var i,r=t(65186),o=t(65413),l=t(77735),a={label:l.J.label,id:l.J.id},s={create:function(e){return{type:"GeoPoint",config:{label:e}}},FormFields:a,TYPE_NAME:"GeoPoint",schema:o.object().shape({type:o.string().matches(/^GeoPoint$/,{excludeEmptyString:!0}).required(),config:o.object().shape({label:o.string()}).required().default(void 0).noUnknown(!0)}),Meta:{icon:r.c7Z,title:"GeoPoint",description:"A field for storing geo-coordinates"}}},78916:function(e,n,t){"use strict";t.d(n,{b:function(){return _}});var i=t(8799),r=t(65413),o=t(77495),l=t(13302),a=t(62230),s=t(85244),c=t(17064),u=t(52322),d=t(2784),f=t(63397),p=t(75289),x=t(74757),m=t(46784),h=t(77735),v=t(98240),g=t(65186),b=t(3402),y=t(89363),j=function(e){var n=e.onClick,t=e.error,r=e.onDelete,o=e.active,l=e.text,s=e.sx;return(0,u.jsx)(y.Z,{useActive:!0,fitButton:!0,error:t,onClick:n,active:o,sx:(0,a.Z)({position:"relative",width:"64px",height:"64px"},s),Icon:function(){return(0,u.jsxs)(d.Fragment,{children:[(0,u.jsxs)(p.kC,{sx:{flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[(0,u.jsx)(i.jnY,{size:22}),(0,u.jsx)(p.xv,{mt:1,children:l})]}),r?(0,u.jsx)(p.Ct,{onClick:r,variant:"circle-right",children:(0,u.jsx)(g.B4e,{})}):null]})}})},Z=function(e){var n=e.onClick;return(0,u.jsx)(y.Z,{fitButton:!0,onClick:n,sx:{width:"64px",height:"64px",border:function(e){var n=e.colors;return"1px solid ".concat(String(null==n?void 0:n.borders))}},Icon:function(){return(0,u.jsx)(p.kC,{sx:{flexDirection:"column",justifyContent:"center",alignItems:"center"},children:(0,u.jsx)(i.iTs,{size:34,color:"#5263BA","aria-label":"Add a thumbnail"})})}})},k=function(e){var n=e.prefix,t=e.required,i=e.display,r=(0,c.Z)((0,f.U$)(n),2),o=(r[0],r[1]),l=void 0!==t&&t?"*":"";return i?(0,u.jsxs)(d.Fragment,{children:[(0,u.jsx)(C,{name:"".concat(n,".name"),label:"Name".concat(l),placeholder:"main",sx:{mb:3},isConstraint:"config.constraint"===n,meta:o}),(0,u.jsx)(S,{name:"".concat(n,".width"),label:"Width (px)".concat(l),placeholder:" ",sx:{mb:3}}),(0,u.jsx)(S,{name:"".concat(n,".height"),label:"Height (px)".concat(l),placeholder:" "})]}):null},C=function(e){var n=e.name,t=e.label,i=e.placeholder,r=e.meta,o=e.isConstraint,l=(0,v.Z)(e,["name","label","placeholder","meta","isConstraint"]),d=(0,c.Z)((0,f.U$)(n),1)[0];return(0,u.jsx)(b.Hq,(0,s.Z)((0,a.Z)({},l),{fieldName:n,meta:r,formField:{label:t,placeholder:i},field:o?{value:"main",readOnly:!0}:{value:d.value},variant:o?"disabled":"primary"}))},S=function(e){var n=e.name,t=e.label,i=e.placeholder,r=(0,v.Z)(e,["name","label","placeholder"]),o=(0,c.Z)((0,f.U$)(n),2),l=o[0],d=o[1];return(0,u.jsx)(b.Hq,(0,s.Z)((0,a.Z)({},r),{fieldName:n,formField:{label:t,placeholder:i},meta:d,field:{min:0,type:"number",value:l.value||"",onKeyDown:function(e){("e"===e.key||"-"===e.key||"+"===e.key)&&e.preventDefault()}}}))},I=function(){return r.number().nullable().transform(function(e,n){return""===n?null:e})},F={label:h.J.label,id:h.J.id,constraint:{validate:function(){return r.object().defined().shape({width:I(),height:I()})}},thumbnails:{validate:function(){return r.array().defined().of(r.object().test({name:"Thumbnails",message:"Must set name and width or height at minimum",test:function(e){if(!e.name)return!1;var n="number"==typeof e.width&&e.width,t="number"==typeof e.height&&e.height;return e.name&&(n||t)}}))}}},E={name:"",width:"",height:""},w=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.width,t=e.height,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!i||n||t?n||t?"".concat(n||"auto","x").concat(t||"auto"):"...":"auto"},T=function(e){var n=e.initialValues,t=e.values,i=e.errors,r=e.fields,l=e.touched,h=(0,d.useState)(0),v=h[0],g=h[1],b=t.config,y=b.thumbnails,C=b.constraint;return(0,d.useEffect)(function(){g(y.length)},[y.length]),(0,u.jsxs)(x.k,{children:[Object.entries(F).map(function(e){var t=(0,c.Z)(e,2),i=t[0],l=t[1];return(0,u.jsx)(x.J,{children:(0,u.jsx)(m.Z,{fieldName:(0,o.lm)(i),formField:l,fields:r,initialValues:n})},i)}),(0,u.jsxs)(x.J,{children:[(0,u.jsx)(p.__,{htmlFor:"thumbnails",variant:"label.primary",sx:{mt:1,display:"flex",alignItems:"center"},children:"Responsive views*"}),(0,u.jsx)(p.Zb,{p:3,children:(0,u.jsx)(f.F2,{name:"config.thumbnails",render:function(n){var t=n.push,r=n.remove;return(0,u.jsxs)(d.Fragment,{children:[(0,u.jsxs)(p.kC,{mb:3,children:[(0,u.jsx)(j,{active:0===v,text:w(C,!0),sx:{mr:2},onClick:function(){return g(0)}}),y.map(function(e,n){return(0,u.jsx)(j,{sx:{mr:3},active:v===+n+1,text:w(e),error:!!i.thumbnails&&!!l.thumbnails&&!!l.thumbnails[n]&&!!i.thumbnails&&!!i.thumbnails[n],onDelete:function(){return r(n)},onClick:function(){return g(+n+1)}},"thumbnail-button-".concat(+n+1))}),(0,u.jsx)(Z,{onClick:function(){t(E)}})]}),(0,u.jsx)(k,(0,s.Z)((0,a.Z)({},e),{display:0===v,prefix:"config.constraint"})),y.map(function(n,t){return(0,d.createElement)(k,(0,s.Z)((0,a.Z)({},e),{required:!0,key:"thumbnail-".concat(+t+1),display:v===+t+1,prefix:"config.thumbnails[".concat(t,"]")}))})]})}})})]})]})},A=r.object().shape({type:r.string().matches(/^Image$/,{excludeEmptyString:!0}).required(),config:(0,o.gc)((0,l.B9)(F,"id"))}),_={Meta:{icon:i.jnY,title:"Image",description:"A responsive image field with constraints"},Form:T,schema:A,create:function(e){return{type:"Image",config:{label:e,constraint:{},thumbnails:[]}}},FormFields:F,TYPE_NAME:"Image"}},81618:function(e,n,t){"use strict";t.d(n,{h:function(){return g},I:function(){return v}});var i=t(34543),r=t(65413),o=t(62230),l=t(85244),a=t(17064),s=t(52322),c=t(74757),u=t(46784),d=t(77495),f=t(77735),p=t(43947),x=(0,l.Z)((0,o.Z)({},f.J),{allowTargetBlank:(0,p.Jg)("Allow target blank",!1,!1)}),m=function(e){var n=e.initialValues,t=e.fields;return(0,s.jsx)(c.k,{children:Object.entries(x).map(function(e){var i=(0,a.Z)(e,2),r=i[0],o=i[1];return(0,s.jsx)(c.J,{children:(0,s.jsx)(u.Z,{fieldName:(0,d.lm)(r),formField:o,fields:t,initialValues:n})},r)})})},h={icon:i.eR7,title:"Link",description:"A link to web, media or Prismic document"},v=r.object().shape({label:r.string().optional(),useAsTitle:r.boolean().optional(),placeholder:r.string().optional(),select:r.string().optional().oneOf(["media","document","web",null]).nullable(),customtypes:r.array(r.string()).strict().optional(),masks:r.array(r.string()).optional(),tags:r.array(r.string()).optional(),allowTargetBlank:r.boolean().strict().optional()}).required().default(void 0).noUnknown(!0),g={Meta:h,FormFields:x,schema:r.object().shape({type:r.string().matches(/^Link$/,{excludeEmptyString:!0}).required(),config:v.optional()}),Form:m,create:function(e){return{type:"Link",config:{label:e,placeholder:"",select:null}}},TYPE_NAME:"Link"}},57081:function(e,n,t){"use strict";t.d(n,{H:function(){return v}});var i=t(65186),r=t(65413),o=t(81618),l=t(62230),a=t(17064),s=t(52322),c=t(74757),u=t(46784),d=t(77495),f=t(77735),p=(0,l.Z)({},f.J),x=function(e){var n=e.initialValues,t=e.fields;return(0,s.jsx)(c.k,{children:Object.entries(p).map(function(e){var i=(0,a.Z)(e,2),r=i[0],o=i[1];return(0,s.jsx)(c.J,{children:(0,s.jsx)(u.Z,{fieldName:(0,d.lm)(r),formField:o,fields:t,initialValues:n})},r)})})},m={icon:i.x2k,title:"Link to media",description:"A link to files, document and media"},h=o.I.shape({select:r.string().required().matches(/^media$/,{excludeEmptyString:!0})}),v={Meta:m,FormFields:p,schema:r.object().shape({type:r.string().matches(/^Link$/,{excludeEmptyString:!0}).required(),config:h.optional()}),Form:x,create:function(e){return{type:"Link",config:{label:e,placeholder:"",select:"media"}}},TYPE_NAME:"Link",CUSTOM_NAME:"LinkToMedia"}},69528:function(e,n,t){"use strict";t.d(n,{L:function(){return a}});var i,r=t(951),o=(0,t(13302).zg)("Number"),l=o.FormFields,a={create:function(e){return{type:"Number",config:{label:e,placeholder:""}}},FormFields:l,TYPE_NAME:"Number",schema:o.schema,Meta:{icon:r.JUs,title:"Number",description:"A number input field"}}},24088:function(e,n,t){"use strict";t.d(n,{u:function(){return b}});var i=t(65186),r=t(65413),o=t(77495),l=t(13302),a=t(62230),s=t(85244),c=t(52322),u=t(63397),d=t(3402),f=t(77735),p=t(98079),x=function(e){return"use first value as default ".concat(e?'("'.concat(e,'")'):"")},m=function(e,n){return n?e:void 0},h=(0,s.Z)((0,a.Z)({},f.J),{default_value:{type:p.h.CHECKBOX,yupType:"string",defaultValue:null,validate:function(){return r.string().test({name:"default_value",message:'Default value is not part of field "options" in Select',test:function(e){return void 0===e||this.parent&&this.parent.options&&this.parent.options.find(function(n){return n===e})}})},component:function(e){var n,t=null===(n=(0,u.u6)().values.config)||void 0===n?void 0:n.options[0];return(0,c.jsx)(d.w8,(0,s.Z)((0,a.Z)({},e),{defaultValue:e.field.value,controlledValue:t,setControlledValue:e.helpers.setValue,buildControlledValue:m,label:x}))}},options:{yupType:"array",defaultValue:["1","2"],validate:{required:["Select requires a minimum of 2 options"],min:[2,"Choose at least 2 options"],test:{name:"non-empty values",message:"Values cannot be empty",test:function(e){return!e.some(function(e){return!e||!e.length})}}},component:function(e){return(0,c.jsx)(d.kp,(0,a.Z)({label:"Options",inputPlaceholder:"Select option output in API (e.g. 'blueTheme')",buttonLabel:"Add option"},e))}}}),v={icon:i.dzP,title:"Select",description:"A dropdown field of options for content creators."},g=r.object().shape({type:r.string().matches(/^Select$/,{excludeEmptyString:!0}).required(),config:(0,o.gc)((0,l.B9)(h,"id"))}),b={FormFields:h,create:function(e){return{type:"Select",config:{label:e,placeholder:"",options:["1","2"]}}},schema:g,Meta:v,TYPE_NAME:"Select"}},33945:function(e,n,t){"use strict";t.d(n,{P:function(){return M}});var i=t(62230),r=t(65186),o=t(65413),l=t(77495),a=t(13302),s=t(85244),c=t(17064),u=t(81541),d=t(52322),f=t(47927),p=t(76635),x=t(2784),m=t(75289),h=t(74757),v=t(89363),g=t(46784),b=t(77735),y=t(43947),j=t(8799),Z=t(34543),k=function(e){return function(n){var t=n.size;return(0,d.jsx)("span",{style:{fontSize:t},children:e})}},C=[{value:"paragraph",label:"P",icon:k("p")},{value:"preformatted",label:"PRE",icon:k("pre")},{value:"heading1",label:"H1",icon:k("h1")},{value:"heading2",label:"H2",icon:k("h2")},{value:"heading3",label:"H3",icon:k("h3")},{value:"heading4",label:"H4",icon:k("h4")},{value:"heading5",label:"H5",icon:k("h5")},{value:"heading6",label:"H6",icon:k("h6")},{value:"strong",label:"Strong",icon:k((0,d.jsx)("b",{children:"b"}))},{value:"em",label:"em",icon:k((0,d.jsx)("em",{style:{fontFamily:"serif"},children:"I"}))},{value:"hyperlink",label:"hyperlink",icon:k((0,d.jsx)(Z.eR7,{}))},{value:"image",label:"image",icon:k((0,d.jsx)(Z.LFN,{}))},{value:"embed",label:"embed",icon:k((0,d.jsx)(Z.xqv,{}))},{value:"list-item",label:"list",icon:k((0,d.jsx)(Z.SnF,{}))},{value:"o-list-item",label:"o",icon:k((0,d.jsx)(j.KyO,{}))},{value:"rtl",label:"rtl",icon:k("rtl")},],S=C.map(function(e){return e.value}),I=function(e){return!S.find(function(n){return!e.includes(n)})},F=function(e){var n=e.split(",");return C.reduce(function(e,t){var i=t.value;return n.includes(i)?(0,u.Z)(e).concat([i]):e},[])};function E(e,n){return(0,f.has)("parent",e)&&(0,p.isObject)(e.parent)&&(0,f.has)(n,e.parent)&&(0,p.isString)(e.parent[n])?e.parent[n]:null}function w(e){return function(){return o.string().test({name:e,message:"Options cannot be empty",test:function(n,t){var i=E(t,e),r=E(t,"single"===e?"multi":"single");return!!r&&"string"==typeof r||"string"==typeof i&&(!!i&&!!i.length||!!r&&!!r.length)&&!i.split(",").find(function(e){return!S.includes(e)})}})}}var T=(0,s.Z)((0,i.Z)({},b.J),{allowTargetBlank:(0,y.Jg)("Allow target blank for links"),single:{validate:w("single")},multi:{validate:w("multi")}}),A=["config.single","config.multi"],_=function(e){var n,t=e.initialValues,i=e.values,r=e.errors,o=e.fields,a=e.setFieldValue,s=i.config,f=s.single,p=s.multi,b=f?F(f):p&&F(p)||S,y=(0,x.useState)(!f),j=y[0],Z=y[1],k=(0,x.useState)(b),E=k[0],w=k[1];return(0,x.useEffect)(function(){var e=j?1:0;a(A[e],E.join(",")),setTimeout(function(){a(A[1-e],void 0)},100)},[j,E]),(0,d.jsxs)(h.k,{children:[Object.entries(T).map(function(e){var n=(0,c.Z)(e,2),i=n[0],r=n[1];return(0,d.jsx)(h.J,{children:(0,d.jsx)(g.Z,{fieldName:(0,l.lm)(i),formField:r,fields:o,initialValues:t})},i)}),(0,d.jsxs)(h.J,{children:[(0,d.jsxs)(m.__,{htmlFor:"accept",variant:"label.primary",sx:{mt:1,display:"flex",alignItems:"center"},children:["Accept*",(0,d.jsx)(m.zx,{type:"button",variant:"buttons.textButton",onClick:function(){if(I(E))return w([]);w(S)},children:I(E)?"Unselect All":"Select all"})]}),C.map(function(e){return(0,d.jsx)(v.Z,{fitButton:!0,useActive:!0,label:e.label,size:14,Icon:e.icon,sx:{p:"16px",mb:2,mr:2,variant:"buttons.selectIcon"},active:E.includes(e.value),onClick:function(){if(E.find(function(n){return n===e.value}))return w(E.filter(function(n){return n!==e.value}));w((0,u.Z)(E).concat([e.value]))}},e.value)}),(null===(n=r.config)||void 0===n?void 0:n[j?"multi":"single"])?(0,d.jsx)(m.xu,{sx:{position:"absolute"},children:(0,d.jsx)(m.xv,{as:"span",variant:"text.labelError",pl:0,children:r.config[j?"multi":"single"]})}):null]}),(0,d.jsx)(h.J,{children:(0,d.jsx)(m.kC,{sx:{mt:2,alignItems:"center",height:"100%"},children:(0,d.jsxs)(m.__,{variant:"label.border",children:[(0,d.jsx)(m.XZ,{checked:j,onChange:function(){return Z(!j)}}),"Allow multiple paragraphs"]})})})]})},N={icon:r.BAW,title:"Rich Text",description:"A rich text field with formatting options"},R=o.object().shape({type:o.string().matches(/^StructuredText$/,{excludeEmptyString:!0}).required(),config:(0,l.gc)((0,a.B9)((0,i.Z)({},T,{labels:{yupType:"array",validate:{}}}),"id"))}),M={create:function(e){return{type:"StructuredText",config:{label:e,placeholder:"",allowTargetBlank:!0,multi:S.join(",")}}},FormFields:T,Meta:N,schema:R,TYPE_NAME:"StructuredText",Form:_}},15139:function(e,n,t){"use strict";t.d(n,{y:function(){return u}});var i=t(65186),r=t(65413),o=t(77495),l=t(77735),a=t(13302),s=l.J,c=r.object().shape({type:r.string().matches(/^Text$/,{excludeEmptyString:!0}).required(),config:(0,o.gc)((0,a.B9)(s,"id"))}),u={create:function(e){return{type:"Text",config:{label:e,placeholder:""}}},Meta:{icon:i.SQS,title:"Key Text",description:"A simple text string field"},schema:c,TYPE_NAME:"Text",FormFields:s}},268:function(e,n,t){"use strict";t.d(n,{d:function(){return u}});var i,r=t(65186),o=t(65413),l=t(77495),a=t(77735),s=t(13302),c=a.J,u={create:function(e){return{type:"Timestamp",config:{label:e,placeholder:""}}},schema:o.object().shape({type:o.string().matches(/^Timestamp$/,{excludeEmptyString:!0}).required(),config:(0,l.gc)((0,s.B9)(c,"id"))}),FormFields:c,TYPE_NAME:"Timestamp",Meta:{icon:r.f$3,title:"Timestamp",description:"A calendar date picker with time"}}},30730:function(e,n,t){"use strict";t.r(n),t.d(n,{Boolean:function(){return i.H},Color:function(){return r.S},ContentRelationship:function(){return o.l},Date:function(){return l.v},Embed:function(){return a.S},GeoPoint:function(){return s.X},Image:function(){return c.b},Link:function(){return u.h},LinkToMedia:function(){return d.H},Number:function(){return f.L},Select:function(){return p.u},StructuredText:function(){return x.P},Text:function(){return m.y},Timestamp:function(){return h.d},UID:function(){return I}});var i=t(3602),r=t(53162),o=t(2737),l=t(17517),a=t(58165),s=t(98844),c=t(78916),u=t(81618),d=t(57081),f=t(69528),p=t(24088),x=t(33945),m=t(15139),h=t(268),v=t(62230),g=t(85244),b=t(65186),y=t(65413),j=t(77495),Z=t(77735),k=t(13302),C={label:Z.J.label,id:(0,g.Z)((0,v.Z)({},Z.J.id),{validate:{required:"This field is required",matches:[/^uid$/,"Api ID must be 'uid' for this field."]},disabled:!0}),placeholder:Z.J.placeholder},S=y.object().shape({type:y.string().matches(/^UID$/,{excludeEmptyString:!0}).required(),config:(0,j.gc)((0,k.B9)(C,"id"))}),I={create:function(e){return{type:"UID",config:{label:e,placeholder:""}}},Meta:{icon:b.izl,title:"UID",description:"Unique Identifier"},schema:S,TYPE_NAME:"UID",FormFields:C}},36632:function(e,n,t){"use strict";var i=t(3602),r=t(53162),o=t(2737),l=t(17517),a=t(58165),s=t(98844),c=t(78916),u=t(81618),d=t(57081),f=t(69528),p=t(24088),x=t(33945),m=t(15139),h=t(268);n.Z=[x.P,c.b,u.h,d.H,o.l,p.u,i.H,l.v,h.d,a.S,f.L,s.X,r.S,m.y,]},74096:function(e,n,t){"use strict";t.r(n),t.d(n,{Boolean:function(){return r.Boolean},Color:function(){return r.Color},ContentRelationship:function(){return r.ContentRelationship},Date:function(){return r.Date},Embed:function(){return r.Embed},GeoPoint:function(){return r.GeoPoint},Group:function(){return q},Image:function(){return r.Image},Link:function(){return r.Link},LinkToMedia:function(){return r.LinkToMedia},Number:function(){return r.Number},Select:function(){return r.Select},SharedSlice:function(){return D},SliceZone:function(){return O},StructuredText:function(){return r.StructuredText},Text:function(){return r.Text},Timestamp:function(){return r.Timestamp},UID:function(){return r.UID}});var i,r=t(30730),o=t(65186),l=t(65413),a=t(62230),s=t(85244),c=t(17064),u=t(52322),d=t(75289),f=t(74757),p=t(46784),x=t(77495),m=t(77735),h=t(43947),v=(0,s.Z)((0,a.Z)({},m.J),{repeat:(0,h.Jg)("Repeatable",!1,!0)}),g=function(e){var n=e.initialValues,t=e.fields,i=e.values,r=e.setFieldValue,o=i.config.repeat;return(0,u.jsxs)(f.k,{children:[Object.entries(v).filter(function(e){return"repeat"!==(0,c.Z)(e,1)[0]}).map(function(e){var i=(0,c.Z)(e,2),r=i[0],o=i[1];return(0,u.jsx)(f.J,{children:(0,u.jsx)(p.Z,{fieldName:(0,x.lm)(r),formField:o,fields:t,initialValues:n})},r)}),(0,u.jsx)(f.J,{children:(0,u.jsx)(d.xu,{sx:{mt:2,alignItems:"center",display:"flex",height:"130%"},children:(0,u.jsxs)(d.__,{variant:"label.border",sx:{mb:0},children:[(0,u.jsx)(d.XZ,{checked:o,onChange:function(){return r("config.repeat",!o)}}),"Repeatable"]})})})]})},b=t(98240),y=t(81541),j=t(2784),Z=t(40023),k=t(28316),C=t(82770),S=t(91061),I=t(81787),F=t(97470),E=t(73393),w=t(35308),T=t(13166),A=t(76167),_=t(8830),N=t(74026),R=t(36632),M=t(13302),z=t(17384),B=function(e){var n=e.tabId,t=e.widget,i=(e.parentSnapshot,e.showHints),o=e.isRepeatable,l=e.item,f=e.draggableId,p=(e.renderFieldAccessor,(0,b.Z)(e,["tabId","widget","parentSnapshot","showHints","isRepeatable","item","draggableId","renderFieldAccessor"])),x=(0,j.useState)(!1),m=x[0],h=x[1],v=(0,j.useState)(null),g=v[0],B=v[1],q=(0,j.useState)({isOpen:!1}),D=q[0],O=q[1],P=(0,I.G)(),V=P.customType,L=P.setCustomType,H=function(e){B({widgetTypeName:e}),h(!1)},J=function(){B(null)},U=function(){O({isOpen:!1})},W=function(e){var t=e.id,i=e.label,o=e.widgetTypeName,a=r[o].create(i),s=N.L$.fromSM(a),c=(0,S.kQ)({customType:V,sectionId:n,groupFieldId:l.key,newField:s,newFieldId:t});L(c),C.Xe.track({event:"field:added",id:t,name:i,type:o,isInAGroup:!0,contentType:"page"===V.format?"page type":"custom type"})},$=function(e){var t=e.apiId,i=e.newKey,o=e.value;if(!(0,M.Ss)(r,o.type)){var a=N.L$.fromSM(o),s=(0,S.l9)({customType:V,sectionId:n,groupFieldId:l.key,previousFieldId:t,newFieldId:i,newField:a});L(s)}},G=function(e){if(!(0,M.uS)(e)){var t=e.source,i=e.destination;if(i){var r=t.index,o=i.index,a=(0,S.GA)({customType:V,sectionId:n,groupFieldId:l.key,sourceIndex:r,destinationIndex:o});(0,k.flushSync)(function(){return L(a)})}}},Y=function(e){var t=(0,S.j6)({customType:V,sectionId:n,groupFieldId:l.key,fieldId:e});L(t)},X=function(e){O({isOpen:!0,field:e});var n=(0,c.Z)(e,2),t=n[0],i=n[1];C.Xe.track({event:"field:settings-opened",id:t,name:i.config.label,type:i.type,isInAGroup:!0,contentType:"page"===V.format?"page type":"custom type"})};return(0,u.jsxs)(j.Fragment,{children:[(0,u.jsx)(F.Z,(0,s.Z)((0,a.Z)({item:l,widget:t,draggableId:f,renderFieldAccessor:function(e){return"data.".concat(l.key,".[...]")}},p),{CustomEditElements:[(0,u.jsx)(d.zx,{mr:2,variant:"buttons.darkSmall",onClick:function(){return h(!0)},children:"Add Field"},"custom-edit-element-".concat(l.key)),],children:(0,u.jsx)(d.xu,{sx:{ml:4},children:(0,u.jsx)(Z.Z5,{onDragEnd:G,children:(0,u.jsx)(Z.bK,{droppableId:"".concat(n,"-").concat(l.key,"-zone"),children:function(e){return(0,u.jsxs)("ul",(0,s.Z)((0,a.Z)({ref:e.innerRef},e.droppableProps),{children:[l.value.config.fields.map(function(e,n){var t=e.value,c=t.config,d=t.type,f=(0,_.t)(r,c,d);if(!f)return null;var p={item:e,index:n,widget:f,key:e.key,enterEditMode:X,deleteItem:Y,renderFieldAccessor:function(e){return"data.".concat(l.key,".").concat(e)},draggableId:"group-".concat(l.key,"-").concat(e.key,"-").concat(n),testId:"list-item-group-".concat(l.key,"-").concat(e.key)},x=(0,u.jsx)(T.Z,{item:e,show:i,isRepeatable:o,renderHintBase:function(e){var n=e.item;return"data.".concat(l.key).concat((0,z.Ti)(n.key))},Widgets:r,typeName:f.CUSTOM_NAME||f.TYPE_NAME});return(0,u.jsx)(F.Z,(0,s.Z)((0,a.Z)({},p),{HintElement:x}))}),e.placeholder,g&&(0,u.jsx)(A.Z,(0,s.Z)((0,a.Z)({},g),{fields:l.value.config.fields||[],onSave:function(){for(var e=arguments.length,n=Array(e),t=0;t<e;t++)n[t]=arguments[t];W.apply(void 0,(0,y.Z)(n)),B(null)},onCancelNewField:J}))]}))}})})})})),(0,u.jsx)(w.Z,{data:{isOpen:m},close:function(){return h(!1)},onSelect:H,widgetsArray:R.Z}),(0,u.jsx)(E.Z,{data:D,close:U,onSave:$,fields:l.value.config.fields})]})},q={Meta:{icon:o.cC1,title:"Group",description:"A Group of Prismic fields"},Form:g,FormFields:v,schema:l.object().shape({type:l.string().matches(/^Group$/,{excludeEmptyString:!0}).required(),config:l.object().shape({fields:l.array(),label:l.string(),placeholder:l.string(),repeat:l.boolean().optional()})}),create:function(e){return{type:"Group",config:{label:e,repeat:!0,fields:[]}}},CustomListItem:B,TYPE_NAME:"Group"},D=null,O=null},13302:function(e,n,t){"use strict";t.d(n,{B9:function(){return s},Ss:function(){return u},uS:function(){return c},zg:function(){return d}});var i=t(98240),r=t(9849),o=t(65413),l=t(77495),a=t(77735),s=function(e,n){return e[n],(0,i.Z)(e,[n].map(r.Z))},c=function(e){return!e.destination||e.source.index===e.destination.index||e.source.droppableId!==e.destination.droppableId},u=function(e,n){return!e[n]&&(console.log('Could not find widget with type name "'.concat(n,'".')),!0)},d=function(e){return{TYPE_NAME:e,FormFields:a.J,schema:o.object().shape({type:o.string().test({name:"type",test:function(n){return n===e}}),config:(0,l.gc)(s(a.J,"id"))}),create:function(){return{type:e,config:(0,l.f7)(s(a.J,"id"))}}}}},84779:function(){},82432:function(){}}]);