slice-machine-ui 1.22.2-beta.8 → 1.22.2-beta.9

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 (54) hide show
  1. package/components/AppLayout/index.tsx +1 -1
  2. package/lib/builders/CustomTypeBuilder/SliceZone/index.tsx +1 -1
  3. package/lib/builders/SliceBuilder/Sidebar/index.tsx +1 -1
  4. package/lib/builders/SliceBuilder/SimulatorButton/index.tsx +1 -1
  5. package/lib/builders/common/Zone/components/EmptyState/index.tsx +1 -1
  6. package/lib/builders/common/Zone/index.jsx +1 -1
  7. package/out/404.html +1 -1
  8. package/out/_next/static/{gmURGa9M7ohOYzPk99uIp → WrLzc18gEPLIN9tdlBqv8}/_buildManifest.js +1 -1
  9. package/out/_next/static/chunks/18539003-4460ccbfe3109578.js +97 -0
  10. package/out/_next/static/chunks/482-34cee2a2071c235f.js +1 -0
  11. package/out/_next/static/chunks/{505-fa47e200ac3a012d.js → 505-3f1cf09a086dcba8.js} +1 -1
  12. package/out/_next/static/chunks/550-c80fd46fb64d1eef.js +1 -0
  13. package/out/_next/static/chunks/904-519dbf0f7e8c6243.js +1 -0
  14. package/out/_next/static/chunks/{958-0a6a103fac00582b.js → 958-8aca174b80cb0c35.js} +1 -1
  15. package/out/_next/static/chunks/pages/_app-db28273bb12866e9.js +458 -0
  16. package/out/_next/static/chunks/pages/{changes-97d67a1d2c156b51.js → changes-52c9d917808d1461.js} +1 -1
  17. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-ef11594ce026b650.js +1 -0
  18. package/out/_next/static/css/{29d73729eff3b961.css → 1bbf650dfd37ce69.css} +1 -1
  19. package/out/changelog.html +1 -1
  20. package/out/changes.html +1 -1
  21. package/out/custom-types/[customTypeId].html +1 -1
  22. package/out/custom-types.html +1 -1
  23. package/out/index.html +1 -1
  24. package/out/labs.html +1 -1
  25. package/out/page-types/[pageTypeId].html +1 -1
  26. package/out/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
  27. package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
  28. package/out/slices.html +1 -1
  29. package/package.json +6 -6
  30. package/src/components/BlankSlate/BlankSlate.css.ts +4 -1
  31. package/src/components/BlankSlate/BlankSlate.tsx +2 -7
  32. package/src/components/Card/Card.stories.tsx +3 -3
  33. package/src/components/HoverCard/HoverCard.css.ts +0 -9
  34. package/src/components/HoverCard/HoverCard.stories.tsx +1 -1
  35. package/src/components/HoverCard/HoverCard.tsx +1 -1
  36. package/src/components/List/List.stories.tsx +2 -2
  37. package/src/components/SideNav/SideNavEnvironmentSelector.tsx +2 -2
  38. package/src/components/Window/Window.tsx +1 -1
  39. package/src/features/customTypes/EditDropdown.tsx +7 -5
  40. package/src/features/customTypes/customTypesBuilder/PageSnippetDialog/PageSnippetDialog.tsx +2 -2
  41. package/src/features/inAppGuide/InAppGuideDialog.tsx +1 -7
  42. package/src/features/slices/convertLegacySlice/ConvertLegacySliceAsNewSliceDialog.tsx +1 -1
  43. package/src/features/slices/convertLegacySlice/ConvertLegacySliceAsNewVariationDialog.tsx +1 -1
  44. package/src/features/slices/convertLegacySlice/ConvertLegacySliceButton.tsx +1 -1
  45. package/src/features/slices/convertLegacySlice/ConvertLegacySliceMergeWithIdenticalDialog.tsx +1 -1
  46. package/src/features/slices/sliceBuilder/FloatingBackButton.tsx +1 -1
  47. package/src/features/slices/sliceCards/SharedSliceCard.tsx +2 -2
  48. package/out/_next/static/chunks/18539003-9f66499125869c64.js +0 -97
  49. package/out/_next/static/chunks/482-7e97f91961588a90.js +0 -1
  50. package/out/_next/static/chunks/550-8557ad3750e1e581.js +0 -1
  51. package/out/_next/static/chunks/904-dda24b22ea065891.js +0 -1
  52. package/out/_next/static/chunks/pages/_app-8c14c8d5b76781af.js +0 -447
  53. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-45f39b106898eeb3.js +0 -1
  54. /package/out/_next/static/{gmURGa9M7ohOYzPk99uIp → WrLzc18gEPLIN9tdlBqv8}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[849],{21985:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/changes",function(){return t(4920)}])},56577:function(e,n,t){"use strict";t.d(n,{z:function(){return u}});var s=t(62230),i=t(85244),r=t(98240),a=t(52322),o=t(2784),c=t(75289),l=function(e,n){return e?"".concat(e,"-").concat(n):""},d=function(e){switch(e){case"white":case"secondaryMedium":case"secondarySmall":case"secondary":return"#1A1523";default:return"grey01"}},u=(0,o.forwardRef)(function(e,n){var t=e.label,o=e.Icon,u=e.type,h=e.form,x=e.isLoading,m=void 0!==x&&x,f=e.disabled,p=e.onClick,g=e.sx,j=e.iconSize,v=void 0===j?16:j,y=e.iconFill,b=e.variant,_=void 0===b?"primary":b,C=(0,r.Z)(e,["label","Icon","type","form","isLoading","disabled","onClick","sx","iconSize","iconFill","variant"]);return(0,a.jsx)(c.zx,(0,i.Z)((0,s.Z)({ref:n,sx:(0,s.Z)((0,i.Z)((0,s.Z)({},void 0===g?{}:g),{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"}),m?{cursor:"wait !important"}:{}),type:u,form:h,disabled:void 0!==f&&f||m,onClick:m?void 0:p,variant:_},C),{children:m?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.$j,{size:v,color:d(_),"data-cy":l(C["data-cy"],"spinner")}),o&&t]}):(0,a.jsxs)(a.Fragment,{children:[o&&(0,a.jsx)(o,{size:v,fill:y,"data-cy":l(C["data-cy"],"icon")}),t]})}))})},59469:function(e,n,t){"use strict";var s=t(62230),i=t(52322),r=t(75289);n.Z=function(e){var n=e.elems,t=e.renderElem,a=e.defineElementKey,o=e.gridTemplateMinPx,c=e.gridGap,l=e.sx;return(0,i.jsx)(r.xu,{as:"section",sx:(0,s.Z)({display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(".concat(void 0===o?"320px":o,", 1fr))"),gridGap:void 0===c?"16px":c,pt:2},l),children:n.map(function(e,n){return e?(0,i.jsx)("span",{children:t(e,n)},"".concat(a(e),"-").concat(n+1)):null})})}},4920:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return ed}});var s=t(52322),i=t(22715),r=t(2784),a=t(97729),o=t.n(a),c=t(65077),l=t(56580),d=t(22337),u=t(75289),h=t(951),x=function(e){var n=e.children;return(0,s.jsx)(u.kC,{sx:{alignItems:"center",justifyContent:"space-between",mt:"8px",bg:"grey02",borderRadius:4,padding:"12px 16px"},children:n})},m=t(39097),f=t.n(m),p=t(7819),g=t(34728),j=t(67445),v=function(e){var n=e.ct,t=e.status,i=e.authStatus,r=e.isOnline;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(u.xu,{as:"td",style:{width:"40%"},children:(0,s.jsx)(u.xv,{sx:{fontWeight:500},children:n.label})}),(0,s.jsx)(u.xu,{as:"td",style:{width:"40%"},children:n.id}),(0,s.jsx)(u.xu,{as:"td",style:{width:"20%"},children:(0,s.jsx)(g.O,{authStatus:i,isOnline:r,modelStatus:t,modelType:"CustomType"})})]})},y=function(e){var n=e.customTypes,t=e.modelsStatuses,i=e.authStatus,r=e.isOnline;return(0,s.jsxs)(u.xu,{as:"table","data-legacy-component":!0,children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{className:"transparent small",children:[(0,s.jsx)(u.xu,{as:"th",sx:{width:"40%",fontWeight:600},children:"Name"}),(0,s.jsx)(u.xu,{as:"th",sx:{width:"40%",fontWeight:600},children:"API ID"}),(0,s.jsx)(u.xu,{as:"th",sx:{width:"20%",fontWeight:600},children:"Status"})]})}),(0,s.jsx)("tbody",{children:n.map(function(e){return(0,p.TG)(e)?(0,s.jsx)(f(),{passHref:!0,href:j.cd[e.local.format].getBuilderPagePathname(e.local.id),legacyBehavior:!0,children:(0,s.jsx)("tr",{tabIndex:0,"data-cy":"custom-type-".concat(e.local.id),children:(0,s.jsx)(v,{ct:e.local,status:t.customTypes[e.local.id],authStatus:i,isOnline:r,modelsStatuses:t},e.local.id)})},e.local.id):(0,s.jsx)("tr",{tabIndex:0,className:"disabled","data-cy":"custom-type-".concat(e.remote.id),children:(0,s.jsx)(v,{ct:e.remote,status:t.customTypes[e.remote.id],authStatus:i,isOnline:r,modelsStatuses:t},e.remote.id)})})})]})},b=t(59469),_=t(84449),C=t(5479),S=t(47731),D=t(32681),T=t(65958),k=function(e){var n=e.unSyncedCustomTypes,t=e.unSyncedSlices,i=e.modelsStatuses,r=e.authStatus,a=e.isOnline,o=(0,S.H)(),c=o.modalPayload,l=o.onOpenModal,d=c.sliceFilterFn,m=c.defaultVariationSelector,f=t.filter(function(e){return i.slices[e.model.id]!==D.G.Deleted});return(0,s.jsxs)(s.Fragment,{children:[n.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(x,{children:(0,s.jsxs)(u.xu,{children:[(0,s.jsx)(u.xv,{variant:"heading",children:"Types"}),(0,s.jsx)(u.xv,{variant:"grey",sx:{ml:"8px"},children:n.length})]})}),(0,s.jsx)(y,{customTypes:n,modelsStatuses:i,authStatus:r,isOnline:a})]}),t.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(u.xu,{sx:{mb:"8px"},children:(0,s.jsxs)(x,{children:[(0,s.jsxs)(u.xu,{children:[(0,s.jsx)(u.xv,{variant:"heading",children:"Slices"}),(0,s.jsx)(u.xv,{variant:"grey",sx:{ml:"8px"},children:t.length})]}),(0,s.jsxs)(u.xu,{children:[t.some(function(e){return(0,C.cx)(e)>0&&i.slices[e.model.id]!==D.G.Deleted})&&(0,s.jsxs)(u.xv,{sx:{mr:3,color:"warning02",fontSize:"12px",lineHeight:"16px",fontWeight:600},children:[(0,s.jsx)(h.sQg,{size:16,style:{marginRight:"4px",position:"relative",top:"3px"}}),"Missing Screenshots"]}),(0,s.jsxs)(u.zx,{variant:"darkSmall",onClick:function(){return l({sliceFilterFn:function(e){return e}})},children:[(0,s.jsx)(h.hOO,{style:{color:"#FFF",fontSize:"15px",position:"relative",top:"3px",marginRight:"4px"}})," ","Update all screenshots"]})]})]})}),(0,s.jsx)(b.Z,{gridGap:"32px 16px",elems:t,gridTemplateMinPx:"305px",defineElementKey:function(e){return e.model.name},renderElem:function(e){var n=i.slices[e.model.id];return(0,s.jsx)(T.b,{action:{type:"status",authStatus:r,isOnline:a,modelStatus:n},isDeleted:n===D.G.Deleted,mode:"navigation",onUpdateScreenshot:function(){l({sliceFilterFn:function(n){return n.filter(function(n){return n.model.id===e.model.id})}})},slice:e,variant:"solid"})}}),(0,s.jsx)(_.Z,{slices:d(f),defaultVariationSelector:m})]})]})},O=t(91914),w=function(){return(0,s.jsx)(u.kC,{sx:{justifyContent:"center",alignItems:"center",flex:1},children:(0,s.jsxs)(u.kC,{sx:{flexDirection:"column",alignItems:"center",transform:"translateY(-50%)"},children:[(0,s.jsx)(O.wQ1,{size:48}),(0,s.jsx)(u.xv,{sx:{fontWeight:600,fontSize:"24px",lineHeight:"32px",mb:"8px",mt:"2px"},children:"No internet connection"}),(0,s.jsx)(u.xv,{sx:{fontSize:"13px",lineHeight:"24px"},children:"You need a stable internet connection to review and push changes"})]})})},z=t(90374),Z=t(79096),E=function(e){var n=e.authStatus,t=(0,z.Z)().openLoginModal;return(0,s.jsxs)(i.xu,{flexDirection:"column",height:"100%",alignItems:"center",justifyContent:"center",gap:8,children:[n===Z.t.FORBIDDEN?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.xv,{variant:"h3",children:"It seems like you are logged out"}),(0,s.jsx)(i.xv,{children:"Log in to connect to your repository."})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.xv,{variant:"h3",children:"It seems like you don't have access to this repository"}),(0,s.jsx)(i.xv,{children:"Check that the repository name is correct, then contact your repository administrator."})]}),(0,s.jsxs)(i.xv,{children:["If that doesn't work, it's possible that Slice Machine is having trouble accessing Prismic's servers."," ",(0,s.jsx)(i.hh,{href:"https://community.prismic.io/",children:"Contact our support team"}),"."]}),n===Z.t.FORBIDDEN&&(0,s.jsx)(i.zx,{onClick:function(){return t()},children:"Log in to Prismic"})]})},R=t(5632),N=t.n(R),F=t(2754),I=t(34543),M=t(62230),P=t(85244),H=t(98240),W=t(6277);t(25977);var A={primary:"_1ecs97dbc8 _1ecs97dbjl _1ecs97dbc2 _1ecs97dbjf _1ecs97dbca _1ecs97dbjn",secondary:"_1ecs97daji _1ecs97dah3 _1ecs97dajc _1ecs97dagx _1ecs97dajk _1ecs97dah5"},B={normal:"ovkapw1",smallBold:"ovkapw2",inherit:"ovkapw3 _1ecs97df47"},G=function(e){var n=e.children,t=e.color,a=e.endIcon,o=e.href,c=e.textVariant,l=void 0===c?"smallBold":c,d=(0,H.Z)(e,["children","color","endIcon","href","textVariant"]);return(0,s.jsxs)("a",(0,P.Z)((0,M.Z)({href:o,target:"_blank",rel:"noreferrer"},d),{className:(0,W.Z)("ovkapw0 _1ecs97dez0 _1ecs97df41 _1ecs97dez2 _1ecs97dez8",A[void 0===t?"primary":t]),children:[(0,s.jsx)(i.xv,{component:"span",color:"inherit",variant:l,children:n}),(0,r.isValidElement)(a)?(0,r.cloneElement)(a,{className:(0,W.Z)(a.props.className,"_1ecs97dfhw",B[l])}):null]}))},L=t(39092),U=function(){var e,n=(e=(0,l.v9)(function(e){return{repoName:(0,L.MY)(e)}}).repoName,"https://".concat(e,".prismic.io/documents/working"));return(0,s.jsxs)(F.R$,{style:{alignSelf:"center",marginTop:i.TV.size[72]},children:[(0,s.jsx)(F.u2,{children:(0,s.jsx)(i.Ee,{src:"/blank-slate-changes-uptodate.png",sizing:"cover"})}),(0,s.jsxs)(F.T9,{children:[(0,s.jsx)(F._T,{children:"Everything up-to-date"}),(0,s.jsx)(F.nf,{children:"You have no changes staged. Your changes appear here after you have saved them, while they're waiting to be pushed to the Page Builder. Ready to get going?"}),(0,s.jsxs)(F.Qj,{children:[(0,s.jsx)(i.zx,{onClick:function(){N().push("/")},children:"Create a page type"}),(0,s.jsx)(G,{endIcon:(0,s.jsx)(I.AlO,{}),textVariant:"normal",href:n,children:"Create content"})]})]})]})},V=t(67764),Y=t(32665),X=t(3098),q=t(56577),Q=t(24340),$=t(77174),J=t(49471),K=t(40432),ee=t(78656),en=function(e){var n=e.ctName,t=e.numberOfDocuments,i=e.link,r=e.isOverLimit;return(0,s.jsxs)(u.Zb,{sx:{mb:12},variant:"drawerCard","data-cy":"AssociatedDocumentsCard-".concat(n),children:[(0,s.jsxs)(u.kC,{sx:{flexDirection:"column"},children:[(0,s.jsx)(u.xv,{children:n}),(0,s.jsxs)(u.xv,{sx:{color:"textClear",fontSize:"12px",lineHeight:"16px"},children:[t," documents"]})]}),(0,s.jsx)(u.rU,{href:i,target:"_blank",variant:"cardSmall",sx:{color:void 0!==r&&r?"danger":"purple08"},children:"View documents"})]})},et=function(e){var n=e.format,t=e.id,i=e.name;return(0,s.jsxs)(u.Zb,{sx:{mb:12},variant:"drawerCard","data-cy":"CustomTypesReferencesCard-".concat(i),children:[(0,s.jsxs)(u.kC,{sx:{flexDirection:"column"},children:[(0,s.jsx)(u.xv,{children:i}),(0,s.jsx)(u.xv,{sx:{color:"textClear",fontSize:"12px",lineHeight:"16px"},children:"Missing Slices"})]}),(0,s.jsxs)(u.rU,{href:j.cd[n].getBuilderPagePathname(t),target:"_blank",variant:"cardSmall",children:["View ",ee.$[n].name({start:!1,plural:!1})]},t)]})},es=t(79797),ei=t(54132),er=function(e){var n=e.isOpen,t=e.title,i=e.footer,r=e.explanations,a=(0,z.Z)().closeModals;return(0,s.jsx)(es.Z,{placement:"right",open:n,level:null,onClose:a,width:496,children:(0,s.jsx)(ei.Z,{radius:"0px",bodySx:{bg:"white",padding:24,flex:1,display:"flex",flexDirection:"column",overflow:"scroll"},footerSx:{p:0},sx:{flexDirection:"column",display:"flex",height:"100%",border:"none"},borderFooter:!0,Header:function(){return(0,s.jsxs)(u.kC,{sx:{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,s.jsx)(u.kC,{sx:{alignItems:"center"},children:(0,s.jsx)(u.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:t})}),(0,s.jsx)(u.x8,{type:"button",onClick:function(){return a()}})]})},Footer:function(){return(0,s.jsx)(u.kC,{sx:{flexDirection:"column",justifyContent:"center",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:"white",padding:20},children:i})},children:r})})},ea=function(e){var n=e.onToggle,t=e.isConfirmed,i=e.sx;return(0,s.jsxs)(u.kC,{sx:(0,M.Z)({borderRadius:6,flexDirection:"column",backgroundColor:"grey03",padding:12,width:"100%"},i),children:[(0,s.jsx)(u.xv,{sx:{fontWeight:"bold",mb:2},children:"Are you sure to proceed?"}),(0,s.jsxs)(u.__,{sx:{mt:"4px",py:1},variant:"large",children:[(0,s.jsx)(u.XZ,{defaultChecked:t,onChange:n,variant:"forms.checkbox.dark"}),"Delete these Documents"]})]})},eo=function(e){var n=e.pushChanges,t=(0,r.useState)(!1),i=t[0],a=t[1],o=(0,l.v9)(function(e){return{isDeleteDocumentsDrawerOpen:(0,$.gP)(e,Q.q.SOFT_DELETE_DOCUMENTS_DRAWER),remoteOnlyCustomTypes:(0,J.Ch)(e).filter(p.yp),modalData:e.pushChanges}}),c=o.isDeleteDocumentsDrawerOpen,d=o.remoteOnlyCustomTypes,h=o.modalData,x=(0,z.Z)(),m=x.closeModals,f=x.openToaster;if(!c)return null;if((null==h?void 0:h.type)!=="SOFT")return f("No change data",K.Jf.ERROR),null;var g=h.details.customTypes.map(function(e){var n,t=d.find(function(n){return(0,p.n5)(n)===e.id});return void 0===t?null:(0,s.jsx)(en,{isOverLimit:!0,ctName:null!==(n=t.remote.label)&&void 0!==n?n:t.remote.id,link:e.url,numberOfDocuments:e.numberOfDocuments},e.id)});return(0,s.jsx)(er,{isOpen:c,title:"Confirm deletion",footer:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ea,{onToggle:function(){a(!i)},isConfirmed:i,sx:{mb:10}}),(0,s.jsx)(q.z,{label:"Push changes",variant:"primary",onClick:function(){m(),n(i)},disabled:!i,sx:{fontWeight:"bold",color:"white",borderRadius:6,width:"100%"}})]}),explanations:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(u.xv,{sx:{fontWeight:"bold",mb:1,lineHeight:"24px"},children:"This action will also delete Documents."}),(0,s.jsxs)(u.xv,{sx:{mb:24},children:[h.details.customTypes.length>1?"These types have":"This type has"," ","associated Documents, which will also be deleted. This might create broken links in your repository."]}),g]})})},ec=function(e){var n=e.pushChanges,t=(0,l.v9)(function(e){return{isDeleteDocumentsDrawerOpen:(0,$.gP)(e,Q.q.HARD_DELETE_DOCUMENTS_DRAWER),remoteOnlyCustomTypes:(0,J.Ch)(e).filter(p.yp),modalData:e.pushChanges}}),i=t.isDeleteDocumentsDrawerOpen,r=t.remoteOnlyCustomTypes,a=t.modalData,o=(0,z.Z)(),c=o.closeModals,d=o.openToaster;if(!i)return null;if((null==a?void 0:a.type)!=="HARD")return d("No change data",K.Jf.ERROR),null;var h=a.details.customTypes.map(function(e){var n,t=r.find(function(n){return(0,p.n5)(n)===e.id});return void 0===t?null:(0,s.jsx)(en,{isOverLimit:!0,ctName:null!==(n=t.remote.label)&&void 0!==n?n:t.remote.id,link:e.url,numberOfDocuments:e.numberOfDocuments},e.id)});return(0,s.jsx)(er,{isOpen:i,title:"Manual action required",footer:(0,s.jsx)(q.z,{label:"Try again",variant:"primary",onClick:function(){c(),n(!1)},sx:{fontWeight:"bold",color:"white",borderRadius:6,width:"100%"}}),explanations:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(u.xv,{sx:{fontWeight:"bold",mb:1,lineHeight:"24px"},children:["Your type",a.details.customTypes.length>1&&"s"," cannot be deleted."]}),(0,s.jsxs)(u.xv,{sx:{mb:24},children:[a.details.customTypes.length>1?"These types have":"This type has"," ","too many associated Documents. Archive and delete these Documents manually and then try deleting the types again."]}),h]})})},el=function(e){var n=e.pushChanges,t=(0,l.v9)(function(e){return{isOpen:(0,$.gP)(e,Q.q.REFERENCES_MISSING_DRAWER),localCustomTypes:(0,J.Ch)(e).filter(p.TG),modalData:e.pushChanges}}),i=t.isOpen,r=t.modalData,a=t.localCustomTypes,o=(0,z.Z)(),c=o.closeModals,d=o.openToaster;if(!i)return null;if((null==r?void 0:r.details)===void 0)return d("No change data",K.Jf.ERROR),null;var h=(null==r?void 0:r.details.customTypes.length)>1,x=r.details.customTypes.map(function(e){var n,t=a.find(function(n){return(0,p.n5)(n)===e.id});return void 0===t?null:(0,s.jsx)(et,{format:t.local.format,id:t.local.id,name:null!==(n=t.local.label)&&void 0!==n?n:t.local.id})});return(0,s.jsx)(er,{isOpen:i,title:"Missing Slices",footer:(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(q.z,{label:"Try again",variant:"primary",onClick:function(){c(),n(!1)},sx:{fontWeight:"bold",color:"white",borderRadius:6,width:"100%"}})}),explanations:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(u.xv,{sx:{fontWeight:"bold",mb:1,lineHeight:"24px"},children:["You have",h?"":" a"," type",h?"s":""," that reference"," ",h?"":"s"," one or more missing Slices"]}),(0,s.jsxs)(u.xv,{sx:{mb:24},children:["Before pushing, remove references to any missing Slices by opening"," ","the affected type",h?"s":""," and clicking the"," ",(0,s.jsx)("b",{children:"Save"})," button."]}),x]})})},ed=function(){var e=(0,V.X)(),n=e.unSyncedSlices,t=e.unSyncedCustomTypes,a=e.modelsStatuses,u=e.authStatus,h=e.isOnline,x=(0,r.useMemo)(function(){var e;return{changedSlices:n.map(function(e){return{slice:e,status:a.slices[e.model.id]}}).filter(function(e){return V.O.includes(e.status)}),changedCustomTypes:t.map(function(e){return(0,p.TG)(e)?e.local:e.remote}).map(function(e){return{customType:e,status:a.customTypes[e.id]}}).filter(function(e){return V.O.includes(e.status)})}},[n,t,a]),m=x.changedSlices,f=x.changedCustomTypes,g=(0,z.Z)(),j=g.pushChanges,v=g.closeModals,y=(0,l.v9)(function(e){return{isSyncing:(0,Y.hg)(e,X.z.CHANGES_PUSH)}}).isSyncing;(0,r.useEffect)(function(){return function(){v()}},[]);var b=n.length+t.length,_=function(e){return j({confirmDeleteDocuments:e,changedSlices:m,changedCustomTypes:f})},C=(0,r.useMemo)(function(){return h?u===Z.t.UNAUTHORIZED||u===Z.t.FORBIDDEN?(0,s.jsx)(E,{authStatus:u}):0===b?(0,s.jsx)(U,{}):(0,s.jsx)(k,{unSyncedSlices:n,unSyncedCustomTypes:t,modelsStatuses:a,authStatus:u,isOnline:h}):(0,s.jsx)(w,{})},[h,u,b,n,t,a,]);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o(),{children:(0,s.jsx)("title",{children:"Changes - Slice Machine"})}),(0,s.jsxs)(d.LN,{children:[(0,s.jsxs)(d.wd,{children:[(0,s.jsx)(d.Cx,{folder:"Changes"}),(0,s.jsx)(d.K2,{children:(0,s.jsx)(i.zx,{onClick:function(){return _(!1)},loading:y,disabled:0===b||!h||u===Z.t.UNAUTHORIZED||u===Z.t.FORBIDDEN||y,"data-cy":"push-changes",children:"Push Changes"})})]}),(0,s.jsx)(d.RN,{children:(0,s.jsxs)(c.xR,{sx:{display:"flex",flexDirection:"column"},children:[C,(0,s.jsx)(eo,{pushChanges:_}),(0,s.jsx)(ec,{pushChanges:_}),(0,s.jsx)(el,{pushChanges:_})]})})]})]})}},2754:function(e,n,t){"use strict";t.d(n,{R$:function(){return d},Qj:function(){return f},T9:function(){return h},nf:function(){return m},u2:function(){return u},_T:function(){return x}});var s=t(67557),i=t(62230),r=t(85244),a=t(98240),o=t(52322),c=t(6277),l=t(22715);t(69143);var d=function(e){var n=e.backgroundImage,t=e.style,l=(0,a.Z)(e,["backgroundImage","style"]),d=void 0!==n;return(0,o.jsx)("article",(0,r.Z)((0,i.Z)({},l),{className:(0,c.Z)("_18bjhbz0 _1ecs97dez0 _1ecs97dez1 _1ecs97dez2 _1ecs97dezb _1ecs97dfiv _1ecs97dfix _1ecs97dfiz _1ecs97d3fg _1ecs97d3mt _1ecs97df0r _1ecs97df23 _1ecs97df2h _1ecs97dezp",(0,s.Z)({},"_18bjhbz1 _1ecs97dezx _1ecs97df4v",d)),style:(0,i.Z)({backgroundImage:d?"url(".concat(n,")"):void 0},t)}))},u=function(e){return(0,o.jsx)("div",(0,r.Z)((0,i.Z)({},e),{className:"_1ecs97dez0 _1ecs97dez1 _1ecs97dez2 _1ecs97dezb _1ecs97d6r8 _1ecs97d6yl _1ecs97df29 _1ecs97df2l _1ecs97dezp"}))},h=function(e){return(0,o.jsx)("div",(0,r.Z)((0,i.Z)({},e),{className:"_18bjhbz3 _1ecs97dez0 _1ecs97dez1 _1ecs97dez2 _1ecs97dezb _1ecs97dffv"}))},x=function(e){return(0,o.jsx)(l.xv,(0,r.Z)((0,i.Z)({},e),{className:"_18bjhbz4"}))},m=function(e){return(0,o.jsx)(l.xv,(0,r.Z)((0,i.Z)({},e),{className:"_18bjhbz5",color:"grey11"}))},f=function(e){return(0,o.jsx)(l.hE,(0,r.Z)((0,i.Z)({},e),{className:"_18bjhbz6 _1ecs97df95 _1ecs97dez8 _1ecs97dfdl",size:"medium",variant:"secondary"}))}},69143:function(){},25977:function(){}},function(e){e.O(0,[789,123,918,958,80,774,888,179],function(){return e(e.s=21985)}),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[849],{21985:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/changes",function(){return t(4920)}])},56577:function(e,n,t){"use strict";t.d(n,{z:function(){return u}});var s=t(62230),i=t(85244),r=t(98240),a=t(52322),o=t(2784),c=t(75289),l=function(e,n){return e?"".concat(e,"-").concat(n):""},d=function(e){switch(e){case"white":case"secondaryMedium":case"secondarySmall":case"secondary":return"#1A1523";default:return"grey01"}},u=(0,o.forwardRef)(function(e,n){var t=e.label,o=e.Icon,u=e.type,h=e.form,x=e.isLoading,m=void 0!==x&&x,f=e.disabled,p=e.onClick,g=e.sx,j=e.iconSize,v=void 0===j?16:j,y=e.iconFill,b=e.variant,_=void 0===b?"primary":b,C=(0,r.Z)(e,["label","Icon","type","form","isLoading","disabled","onClick","sx","iconSize","iconFill","variant"]);return(0,a.jsx)(c.zx,(0,i.Z)((0,s.Z)({ref:n,sx:(0,s.Z)((0,i.Z)((0,s.Z)({},void 0===g?{}:g),{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"}),m?{cursor:"wait !important"}:{}),type:u,form:h,disabled:void 0!==f&&f||m,onClick:m?void 0:p,variant:_},C),{children:m?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.$j,{size:v,color:d(_),"data-cy":l(C["data-cy"],"spinner")}),o&&t]}):(0,a.jsxs)(a.Fragment,{children:[o&&(0,a.jsx)(o,{size:v,fill:y,"data-cy":l(C["data-cy"],"icon")}),t]})}))})},59469:function(e,n,t){"use strict";var s=t(62230),i=t(52322),r=t(75289);n.Z=function(e){var n=e.elems,t=e.renderElem,a=e.defineElementKey,o=e.gridTemplateMinPx,c=e.gridGap,l=e.sx;return(0,i.jsx)(r.xu,{as:"section",sx:(0,s.Z)({display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(".concat(void 0===o?"320px":o,", 1fr))"),gridGap:void 0===c?"16px":c,pt:2},l),children:n.map(function(e,n){return e?(0,i.jsx)("span",{children:t(e,n)},"".concat(a(e),"-").concat(n+1)):null})})}},4920:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return ed}});var s=t(52322),i=t(22715),r=t(2784),a=t(97729),o=t.n(a),c=t(65077),l=t(56580),d=t(22337),u=t(75289),h=t(951),x=function(e){var n=e.children;return(0,s.jsx)(u.kC,{sx:{alignItems:"center",justifyContent:"space-between",mt:"8px",bg:"grey02",borderRadius:4,padding:"12px 16px"},children:n})},m=t(39097),f=t.n(m),p=t(7819),g=t(34728),j=t(67445),v=function(e){var n=e.ct,t=e.status,i=e.authStatus,r=e.isOnline;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(u.xu,{as:"td",style:{width:"40%"},children:(0,s.jsx)(u.xv,{sx:{fontWeight:500},children:n.label})}),(0,s.jsx)(u.xu,{as:"td",style:{width:"40%"},children:n.id}),(0,s.jsx)(u.xu,{as:"td",style:{width:"20%"},children:(0,s.jsx)(g.O,{authStatus:i,isOnline:r,modelStatus:t,modelType:"CustomType"})})]})},y=function(e){var n=e.customTypes,t=e.modelsStatuses,i=e.authStatus,r=e.isOnline;return(0,s.jsxs)(u.xu,{as:"table","data-legacy-component":!0,children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{className:"transparent small",children:[(0,s.jsx)(u.xu,{as:"th",sx:{width:"40%",fontWeight:600},children:"Name"}),(0,s.jsx)(u.xu,{as:"th",sx:{width:"40%",fontWeight:600},children:"API ID"}),(0,s.jsx)(u.xu,{as:"th",sx:{width:"20%",fontWeight:600},children:"Status"})]})}),(0,s.jsx)("tbody",{children:n.map(function(e){return(0,p.TG)(e)?(0,s.jsx)(f(),{passHref:!0,href:j.cd[e.local.format].getBuilderPagePathname(e.local.id),legacyBehavior:!0,children:(0,s.jsx)("tr",{tabIndex:0,"data-cy":"custom-type-".concat(e.local.id),children:(0,s.jsx)(v,{ct:e.local,status:t.customTypes[e.local.id],authStatus:i,isOnline:r,modelsStatuses:t},e.local.id)})},e.local.id):(0,s.jsx)("tr",{tabIndex:0,className:"disabled","data-cy":"custom-type-".concat(e.remote.id),children:(0,s.jsx)(v,{ct:e.remote,status:t.customTypes[e.remote.id],authStatus:i,isOnline:r,modelsStatuses:t},e.remote.id)})})})]})},b=t(59469),_=t(84449),C=t(5479),S=t(47731),D=t(32681),T=t(65958),k=function(e){var n=e.unSyncedCustomTypes,t=e.unSyncedSlices,i=e.modelsStatuses,r=e.authStatus,a=e.isOnline,o=(0,S.H)(),c=o.modalPayload,l=o.onOpenModal,d=c.sliceFilterFn,m=c.defaultVariationSelector,f=t.filter(function(e){return i.slices[e.model.id]!==D.G.Deleted});return(0,s.jsxs)(s.Fragment,{children:[n.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(x,{children:(0,s.jsxs)(u.xu,{children:[(0,s.jsx)(u.xv,{variant:"heading",children:"Types"}),(0,s.jsx)(u.xv,{variant:"grey",sx:{ml:"8px"},children:n.length})]})}),(0,s.jsx)(y,{customTypes:n,modelsStatuses:i,authStatus:r,isOnline:a})]}),t.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(u.xu,{sx:{mb:"8px"},children:(0,s.jsxs)(x,{children:[(0,s.jsxs)(u.xu,{children:[(0,s.jsx)(u.xv,{variant:"heading",children:"Slices"}),(0,s.jsx)(u.xv,{variant:"grey",sx:{ml:"8px"},children:t.length})]}),(0,s.jsxs)(u.xu,{children:[t.some(function(e){return(0,C.cx)(e)>0&&i.slices[e.model.id]!==D.G.Deleted})&&(0,s.jsxs)(u.xv,{sx:{mr:3,color:"warning02",fontSize:"12px",lineHeight:"16px",fontWeight:600},children:[(0,s.jsx)(h.sQg,{size:16,style:{marginRight:"4px",position:"relative",top:"3px"}}),"Missing Screenshots"]}),(0,s.jsxs)(u.zx,{variant:"darkSmall",onClick:function(){return l({sliceFilterFn:function(e){return e}})},children:[(0,s.jsx)(h.hOO,{style:{color:"#FFF",fontSize:"15px",position:"relative",top:"3px",marginRight:"4px"}})," ","Update all screenshots"]})]})]})}),(0,s.jsx)(b.Z,{gridGap:"32px 16px",elems:t,gridTemplateMinPx:"305px",defineElementKey:function(e){return e.model.name},renderElem:function(e){var n=i.slices[e.model.id];return(0,s.jsx)(T.b,{action:{type:"status",authStatus:r,isOnline:a,modelStatus:n},isDeleted:n===D.G.Deleted,mode:"navigation",onUpdateScreenshot:function(){l({sliceFilterFn:function(n){return n.filter(function(n){return n.model.id===e.model.id})}})},slice:e,variant:"solid"})}}),(0,s.jsx)(_.Z,{slices:d(f),defaultVariationSelector:m})]})]})},z=t(91914),O=function(){return(0,s.jsx)(u.kC,{sx:{justifyContent:"center",alignItems:"center",flex:1},children:(0,s.jsxs)(u.kC,{sx:{flexDirection:"column",alignItems:"center",transform:"translateY(-50%)"},children:[(0,s.jsx)(z.wQ1,{size:48}),(0,s.jsx)(u.xv,{sx:{fontWeight:600,fontSize:"24px",lineHeight:"32px",mb:"8px",mt:"2px"},children:"No internet connection"}),(0,s.jsx)(u.xv,{sx:{fontSize:"13px",lineHeight:"24px"},children:"You need a stable internet connection to review and push changes"})]})})},w=t(90374),Z=t(79096),R=function(e){var n=e.authStatus,t=(0,w.Z)().openLoginModal;return(0,s.jsxs)(i.xu,{flexDirection:"column",height:"100%",alignItems:"center",justifyContent:"center",gap:8,children:[n===Z.t.FORBIDDEN?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.xv,{variant:"h3",children:"It seems like you are logged out"}),(0,s.jsx)(i.xv,{children:"Log in to connect to your repository."})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.xv,{variant:"h3",children:"It seems like you don't have access to this repository"}),(0,s.jsx)(i.xv,{children:"Check that the repository name is correct, then contact your repository administrator."})]}),(0,s.jsxs)(i.xv,{children:["If that doesn't work, it's possible that Slice Machine is having trouble accessing Prismic's servers."," ",(0,s.jsx)(i.hh,{href:"https://community.prismic.io/",children:"Contact our support team"}),"."]}),n===Z.t.FORBIDDEN&&(0,s.jsx)(i.zx,{onClick:function(){return t()},children:"Log in to Prismic"})]})},E=t(5632),N=t.n(E),F=t(2754),I=t(34543),M=t(62230),P=t(85244),H=t(98240),W=t(6277);t(25977);var A={primary:"_1ecs97dbc8 _1ecs97dbjl _1ecs97dbc2 _1ecs97dbjf _1ecs97dbca _1ecs97dbjn",secondary:"_1ecs97daji _1ecs97dah3 _1ecs97dajc _1ecs97dagx _1ecs97dajk _1ecs97dah5"},B={normal:"ovkapw1",smallBold:"ovkapw2",inherit:"ovkapw3 _1ecs97df47"},G=function(e){var n=e.children,t=e.color,a=e.endIcon,o=e.href,c=e.textVariant,l=void 0===c?"smallBold":c,d=(0,H.Z)(e,["children","color","endIcon","href","textVariant"]);return(0,s.jsxs)("a",(0,P.Z)((0,M.Z)({href:o,target:"_blank",rel:"noreferrer"},d),{className:(0,W.Z)("ovkapw0 _1ecs97dez0 _1ecs97df41 _1ecs97dez2 _1ecs97dez8",A[void 0===t?"primary":t]),children:[(0,s.jsx)(i.xv,{component:"span",color:"inherit",variant:l,children:n}),(0,r.isValidElement)(a)?(0,r.cloneElement)(a,{className:(0,W.Z)(a.props.className,"_1ecs97dfhw",B[l])}):null]}))},L=t(39092),U=function(){var e,n=(e=(0,l.v9)(function(e){return{repoName:(0,L.MY)(e)}}).repoName,"https://".concat(e,".prismic.io/documents/working"));return(0,s.jsxs)(F.R$,{style:{alignSelf:"center",marginTop:i.TV.size[72]},children:[(0,s.jsx)(F.u2,{children:(0,s.jsx)(i.Ee,{src:"/blank-slate-changes-uptodate.png",sizing:"cover"})}),(0,s.jsxs)(F.T9,{children:[(0,s.jsx)(F._T,{children:"Everything up-to-date"}),(0,s.jsx)(F.nf,{children:"You have no changes staged. Your changes appear here after you have saved them, while they're waiting to be pushed to the Page Builder. Ready to get going?"}),(0,s.jsxs)(F.Qj,{children:[(0,s.jsx)(i.zx,{onClick:function(){N().push("/")},children:"Create a page type"}),(0,s.jsx)(G,{endIcon:(0,s.jsx)(I.AlO,{}),textVariant:"normal",href:n,children:"Create content"})]})]})]})},V=t(67764),Y=t(32665),X=t(3098),q=t(56577),Q=t(24340),$=t(77174),J=t(49471),K=t(40432),ee=t(78656),en=function(e){var n=e.ctName,t=e.numberOfDocuments,i=e.link,r=e.isOverLimit;return(0,s.jsxs)(u.Zb,{sx:{mb:12},variant:"drawerCard","data-cy":"AssociatedDocumentsCard-".concat(n),children:[(0,s.jsxs)(u.kC,{sx:{flexDirection:"column"},children:[(0,s.jsx)(u.xv,{children:n}),(0,s.jsxs)(u.xv,{sx:{color:"textClear",fontSize:"12px",lineHeight:"16px"},children:[t," documents"]})]}),(0,s.jsx)(u.rU,{href:i,target:"_blank",variant:"cardSmall",sx:{color:void 0!==r&&r?"danger":"purple08"},children:"View documents"})]})},et=function(e){var n=e.format,t=e.id,i=e.name;return(0,s.jsxs)(u.Zb,{sx:{mb:12},variant:"drawerCard","data-cy":"CustomTypesReferencesCard-".concat(i),children:[(0,s.jsxs)(u.kC,{sx:{flexDirection:"column"},children:[(0,s.jsx)(u.xv,{children:i}),(0,s.jsx)(u.xv,{sx:{color:"textClear",fontSize:"12px",lineHeight:"16px"},children:"Missing Slices"})]}),(0,s.jsxs)(u.rU,{href:j.cd[n].getBuilderPagePathname(t),target:"_blank",variant:"cardSmall",children:["View ",ee.$[n].name({start:!1,plural:!1})]},t)]})},es=t(79797),ei=t(54132),er=function(e){var n=e.isOpen,t=e.title,i=e.footer,r=e.explanations,a=(0,w.Z)().closeModals;return(0,s.jsx)(es.Z,{placement:"right",open:n,level:null,onClose:a,width:496,children:(0,s.jsx)(ei.Z,{radius:"0px",bodySx:{bg:"white",padding:24,flex:1,display:"flex",flexDirection:"column",overflow:"scroll"},footerSx:{p:0},sx:{flexDirection:"column",display:"flex",height:"100%",border:"none"},borderFooter:!0,Header:function(){return(0,s.jsxs)(u.kC,{sx:{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,s.jsx)(u.kC,{sx:{alignItems:"center"},children:(0,s.jsx)(u.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:t})}),(0,s.jsx)(u.x8,{type:"button",onClick:function(){return a()}})]})},Footer:function(){return(0,s.jsx)(u.kC,{sx:{flexDirection:"column",justifyContent:"center",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:"white",padding:20},children:i})},children:r})})},ea=function(e){var n=e.onToggle,t=e.isConfirmed,i=e.sx;return(0,s.jsxs)(u.kC,{sx:(0,M.Z)({borderRadius:6,flexDirection:"column",backgroundColor:"grey03",padding:12,width:"100%"},i),children:[(0,s.jsx)(u.xv,{sx:{fontWeight:"bold",mb:2},children:"Are you sure to proceed?"}),(0,s.jsxs)(u.__,{sx:{mt:"4px",py:1},variant:"large",children:[(0,s.jsx)(u.XZ,{defaultChecked:t,onChange:n,variant:"forms.checkbox.dark"}),"Delete these Documents"]})]})},eo=function(e){var n=e.pushChanges,t=(0,r.useState)(!1),i=t[0],a=t[1],o=(0,l.v9)(function(e){return{isDeleteDocumentsDrawerOpen:(0,$.gP)(e,Q.q.SOFT_DELETE_DOCUMENTS_DRAWER),remoteOnlyCustomTypes:(0,J.Ch)(e).filter(p.yp),modalData:e.pushChanges}}),c=o.isDeleteDocumentsDrawerOpen,d=o.remoteOnlyCustomTypes,h=o.modalData,x=(0,w.Z)(),m=x.closeModals,f=x.openToaster;if(!c)return null;if((null==h?void 0:h.type)!=="SOFT")return f("No change data",K.Jf.ERROR),null;var g=h.details.customTypes.map(function(e){var n,t=d.find(function(n){return(0,p.n5)(n)===e.id});return void 0===t?null:(0,s.jsx)(en,{isOverLimit:!0,ctName:null!==(n=t.remote.label)&&void 0!==n?n:t.remote.id,link:e.url,numberOfDocuments:e.numberOfDocuments},e.id)});return(0,s.jsx)(er,{isOpen:c,title:"Confirm deletion",footer:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ea,{onToggle:function(){a(!i)},isConfirmed:i,sx:{mb:10}}),(0,s.jsx)(q.z,{label:"Push changes",variant:"primary",onClick:function(){m(),n(i)},disabled:!i,sx:{fontWeight:"bold",color:"white",borderRadius:6,width:"100%"}})]}),explanations:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(u.xv,{sx:{fontWeight:"bold",mb:1,lineHeight:"24px"},children:"This action will also delete Documents."}),(0,s.jsxs)(u.xv,{sx:{mb:24},children:[h.details.customTypes.length>1?"These types have":"This type has"," ","associated Documents, which will also be deleted. This might create broken links in your repository."]}),g]})})},ec=function(e){var n=e.pushChanges,t=(0,l.v9)(function(e){return{isDeleteDocumentsDrawerOpen:(0,$.gP)(e,Q.q.HARD_DELETE_DOCUMENTS_DRAWER),remoteOnlyCustomTypes:(0,J.Ch)(e).filter(p.yp),modalData:e.pushChanges}}),i=t.isDeleteDocumentsDrawerOpen,r=t.remoteOnlyCustomTypes,a=t.modalData,o=(0,w.Z)(),c=o.closeModals,d=o.openToaster;if(!i)return null;if((null==a?void 0:a.type)!=="HARD")return d("No change data",K.Jf.ERROR),null;var h=a.details.customTypes.map(function(e){var n,t=r.find(function(n){return(0,p.n5)(n)===e.id});return void 0===t?null:(0,s.jsx)(en,{isOverLimit:!0,ctName:null!==(n=t.remote.label)&&void 0!==n?n:t.remote.id,link:e.url,numberOfDocuments:e.numberOfDocuments},e.id)});return(0,s.jsx)(er,{isOpen:i,title:"Manual action required",footer:(0,s.jsx)(q.z,{label:"Try again",variant:"primary",onClick:function(){c(),n(!1)},sx:{fontWeight:"bold",color:"white",borderRadius:6,width:"100%"}}),explanations:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(u.xv,{sx:{fontWeight:"bold",mb:1,lineHeight:"24px"},children:["Your type",a.details.customTypes.length>1&&"s"," cannot be deleted."]}),(0,s.jsxs)(u.xv,{sx:{mb:24},children:[a.details.customTypes.length>1?"These types have":"This type has"," ","too many associated Documents. Archive and delete these Documents manually and then try deleting the types again."]}),h]})})},el=function(e){var n=e.pushChanges,t=(0,l.v9)(function(e){return{isOpen:(0,$.gP)(e,Q.q.REFERENCES_MISSING_DRAWER),localCustomTypes:(0,J.Ch)(e).filter(p.TG),modalData:e.pushChanges}}),i=t.isOpen,r=t.modalData,a=t.localCustomTypes,o=(0,w.Z)(),c=o.closeModals,d=o.openToaster;if(!i)return null;if((null==r?void 0:r.details)===void 0)return d("No change data",K.Jf.ERROR),null;var h=(null==r?void 0:r.details.customTypes.length)>1,x=r.details.customTypes.map(function(e){var n,t=a.find(function(n){return(0,p.n5)(n)===e.id});return void 0===t?null:(0,s.jsx)(et,{format:t.local.format,id:t.local.id,name:null!==(n=t.local.label)&&void 0!==n?n:t.local.id})});return(0,s.jsx)(er,{isOpen:i,title:"Missing Slices",footer:(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(q.z,{label:"Try again",variant:"primary",onClick:function(){c(),n(!1)},sx:{fontWeight:"bold",color:"white",borderRadius:6,width:"100%"}})}),explanations:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(u.xv,{sx:{fontWeight:"bold",mb:1,lineHeight:"24px"},children:["You have",h?"":" a"," type",h?"s":""," that reference"," ",h?"":"s"," one or more missing Slices"]}),(0,s.jsxs)(u.xv,{sx:{mb:24},children:["Before pushing, remove references to any missing Slices by opening"," ","the affected type",h?"s":""," and clicking the"," ",(0,s.jsx)("b",{children:"Save"})," button."]}),x]})})},ed=function(){var e=(0,V.X)(),n=e.unSyncedSlices,t=e.unSyncedCustomTypes,a=e.modelsStatuses,u=e.authStatus,h=e.isOnline,x=(0,r.useMemo)(function(){var e;return{changedSlices:n.map(function(e){return{slice:e,status:a.slices[e.model.id]}}).filter(function(e){return V.O.includes(e.status)}),changedCustomTypes:t.map(function(e){return(0,p.TG)(e)?e.local:e.remote}).map(function(e){return{customType:e,status:a.customTypes[e.id]}}).filter(function(e){return V.O.includes(e.status)})}},[n,t,a]),m=x.changedSlices,f=x.changedCustomTypes,g=(0,w.Z)(),j=g.pushChanges,v=g.closeModals,y=(0,l.v9)(function(e){return{isSyncing:(0,Y.hg)(e,X.z.CHANGES_PUSH)}}).isSyncing;(0,r.useEffect)(function(){return function(){v()}},[]);var b=n.length+t.length,_=function(e){return j({confirmDeleteDocuments:e,changedSlices:m,changedCustomTypes:f})},C=(0,r.useMemo)(function(){return h?u===Z.t.UNAUTHORIZED||u===Z.t.FORBIDDEN?(0,s.jsx)(R,{authStatus:u}):0===b?(0,s.jsx)(U,{}):(0,s.jsx)(k,{unSyncedSlices:n,unSyncedCustomTypes:t,modelsStatuses:a,authStatus:u,isOnline:h}):(0,s.jsx)(O,{})},[h,u,b,n,t,a,]);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o(),{children:(0,s.jsx)("title",{children:"Changes - Slice Machine"})}),(0,s.jsxs)(d.LN,{children:[(0,s.jsxs)(d.wd,{children:[(0,s.jsx)(d.Cx,{folder:"Changes"}),(0,s.jsx)(d.K2,{children:(0,s.jsx)(i.zx,{onClick:function(){return _(!1)},loading:y,disabled:0===b||!h||u===Z.t.UNAUTHORIZED||u===Z.t.FORBIDDEN||y,"data-cy":"push-changes",children:"Push Changes"})})]}),(0,s.jsx)(d.RN,{children:(0,s.jsxs)(c.xR,{sx:{display:"flex",flexDirection:"column"},children:[C,(0,s.jsx)(eo,{pushChanges:_}),(0,s.jsx)(ec,{pushChanges:_}),(0,s.jsx)(el,{pushChanges:_})]})})]})]})}},2754:function(e,n,t){"use strict";t.d(n,{R$:function(){return d},Qj:function(){return f},T9:function(){return h},nf:function(){return m},u2:function(){return u},_T:function(){return x}});var s=t(67557),i=t(62230),r=t(85244),a=t(98240),o=t(52322),c=t(6277),l=t(22715);t(69143);var d=function(e){var n=e.backgroundImage,t=e.style,l=(0,a.Z)(e,["backgroundImage","style"]),d=void 0!==n;return(0,o.jsx)("article",(0,r.Z)((0,i.Z)({},l),{className:(0,c.Z)("_18bjhbz0 _1ecs97dez0 _1ecs97dez1 _1ecs97dez2 _1ecs97dezb _1ecs97dfiv _1ecs97dfix _1ecs97dfiz _1ecs97d3fg _1ecs97d3mt _1ecs97df0r _1ecs97df23 _1ecs97df2h _1ecs97dezp",(0,s.Z)({},"_18bjhbz1 _1ecs97dezx _1ecs97df4v",d)),style:(0,i.Z)({backgroundImage:d?"url(".concat(n,")"):void 0},t)}))},u=function(e){return(0,o.jsx)("div",(0,r.Z)((0,i.Z)({},e),{className:"_1ecs97dez0 _1ecs97dez1 _1ecs97dez2 _1ecs97dezb _1ecs97d6r8 _1ecs97d6yl _1ecs97df29 _1ecs97df2l _1ecs97dezp"}))},h=function(e){return(0,o.jsx)("div",(0,r.Z)((0,i.Z)({},e),{className:"_18bjhbz3 _1ecs97dez0 _1ecs97dez1 _1ecs97dez2 _1ecs97dezb _1ecs97dffv"}))},x=function(e){return(0,o.jsx)(l.xv,(0,r.Z)((0,i.Z)({},e),{className:"_18bjhbz4"}))},m=function(e){return(0,o.jsx)(l.xv,(0,r.Z)((0,i.Z)({},e),{className:"_18bjhbz5",color:"grey11"}))},f=function(e){return(0,o.jsx)("div",(0,r.Z)((0,i.Z)({},e),{className:"_18bjhbz6 _1ecs97dez0 _1ecs97dez8 _1ecs97dez1 _1ecs97dez2 _1ecs97df95 _1ecs97dfdl",color:"grey"}))}},69143:function(){},25977:function(){}},function(e){e.O(0,[789,123,918,958,80,774,888,179],function(){return e(e.s=21985)}),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[136],{31314:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/slices/[lib]/[sliceName]/[variation]",function(){return t(47914)}])},47914:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return ej}});var i=t(52322),r=t(97729),o=t.n(r),a=t(22715),l=t(2784),s=t(40432),c=t(47560),u=t(38876),d=t(8482),f=t(4092),m=t(2353),p=t(44384),v=t(28173),h=t(90374),x=t(53559),y=function(e){var n=e.variation,t=(0,h.Z)(),r=t.addSliceWidget,o=t.replaceSliceWidget,a=t.reorderSliceWidget,l=t.removeSliceWidget,s=t.updateSliceWidgetMock,y=t.deleteSliceWidgetMock,g=function(e){return function(t){y(n.id,e,t),l(n.id,e,t)}},b=function(e){return function(t){var i=t.apiId,r=t.newKey,a=t.value,l=t.mockValue;l?s(n.id,e,i,r,l):y(n.id,e,r),o(n.id,e,i,r,a)}},j=function(e){return function(t){var i=t.id,o=t.label,a=t.widgetTypeName,l=m[a];l||console.log('Could not find widget with type name "'.concat(a,'". Please contact us!')),r(n.id,e,i,l.create(o))}},S=function(e){return function(t){var i,r;(0,c.uS)(t)||a(n.id,e,t.source.index,null!==(r=null===(i=t.destination)||void 0===i?void 0:i.index)&&void 0!==r?r:void 0)}};return(0,i.jsxs)(v.aV,{children:[(0,i.jsx)(d.Z,{zoneType:"slice",tabId:void 0,title:"Non-Repeatable Zone",dataTip:" The non-repeatable zone\n is for fields<br/> that should appear once, like a<br/>\n section title.\n",fields:n.primary,EditModal:f.Z,widgetsArray:p.Z,onDeleteItem:g(x.Rt.Primary),onSave:b(x.Rt.Primary),onSaveNewField:j(x.Rt.Primary),onDragEnd:S(x.Rt.Primary),poolOfFieldsToCheck:n.primary||[],renderHintBase:function(e){var n=e.item;return"slice.primary".concat((0,u.Ti)(n.key))},renderFieldAccessor:function(e){return"slice.primary".concat((0,u.Ti)(e))},dataCy:"slice-non-repeatable-zone",isRepeatableCustomType:void 0}),(0,i.jsx)(d.Z,{zoneType:"slice",tabId:void 0,isRepeatable:!0,title:"Repeatable Zone",dataTip:"The repeatable zone is for a group<br/>\n of fields that you want to be able to repeat an<br/>\n indeterminate number of times, like FAQs",widgetsArray:p.Z,fields:n.items,EditModal:f.Z,onDeleteItem:g(x.Rt.Items),onSave:b(x.Rt.Items),onSaveNewField:j(x.Rt.Items),onDragEnd:S(x.Rt.Items),poolOfFieldsToCheck:n.items||[],renderHintBase:function(e){var n=e.item;return"item".concat((0,u.Ti)(n.key))},renderFieldAccessor:function(e){return"slice.items[i]".concat((0,u.Ti)(e))},dataCy:"slice-repeatable-zone",isRepeatableCustomType:void 0})]})},g=t(62230),b=t(85244),j=t(81541),S=t(5632),w=t(22710),k=t(99267),C=t(55658),Z=t(63397),I=t(25812),T=t(75289),E=t(54132),R=function(e){var n=e.children,t=e.FooterContent,r=e.HeaderContent,o=e.close,a=e.sx,l=e.headerSx,s=void 0===l?{}:l;return(0,i.jsx)(E.Z,{borderFooter:!0,footerSx:{p:0},bodySx:{pt:2,pb:4,px:4},sx:(0,g.Z)({border:"none"},void 0===a?{}:a),Header:function(e){var n=e.radius;return(0,i.jsxs)(T.kC,{sx:(0,g.Z)({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)}},s),children:[r,o?(0,i.jsx)(T.x8,{onClick:o,type:"button"}):null]})},Footer:t?(0,i.jsxs)(T.kC,{sx:{alignItems:"space-between",bg:"headSection",p:3},children:[(0,i.jsx)(T.xu,{sx:{ml:"auto"}}),t]}):null,children:n})},A=t(36131),N=function(e){var n=e.msg;return(0,i.jsx)(T.xv,{as:"span",sx:{fontSize:12,color:"error",mt:"5px",ml:2},children:n||"Error!"})},L=function(e){var n=e.isOpen,t=e.onClose,r=e.onSubmit,o=e.initialVariation,a=e.variations,s=function(e){var n=e.id,t=e.name,i=e.origin,r=n&&n.length?null:{id:"Required!"},o=a.find(function(e){return e.id===n})?{id:"This id already exists!"}:null,l=t&&t.length?null:{name:"Required!"},s=i.value.length&&a.find(function(e){return e.id===i.value})?null:{id:"You must select an existing variation!"},c=n&&n.length&&!/^[A-Za-z0-9]+([A-Za-z0-9]+)*$/.exec(n)&&{id:"No special characters allowed"};return(0,g.Z)({},r,o,l,s,c)},c=function(e){j(C.e.generateId(e))},u=function(e){O(e),E&&c(e)},d=function(e){L(!1),c(e)},f=function(){m(),t()},m=function(){j(""),O(""),h({}),L(!0),F({value:o.id,label:o.name})},p=(0,l.useState)({}),v=p[0],h=p[1],x=(0,l.useState)(""),y=x[0],j=x[1],S=(0,l.useState)(!0),E=S[0],L=S[1],V=(0,l.useState)(""),_=V[0],O=V[1],D=(0,l.useState)({value:o.id,label:o.name}),B=D[0],F=D[1];function z(){return P.apply(this,arguments)}function P(){return(P=(0,w.Z)(function(){var e,n;return(0,k.__generator)(this,function(t){return Object.keys(e=s({id:y,name:_,origin:B})).length?h(e):(n=a.find(function(e){return e.id===B.value}))&&(r(y,_,n),f()),[2]})})).apply(this,arguments)}return(0,l.useEffect)(function(){m()},[o,n]),(0,i.jsx)(I.Z,{isOpen:n,shouldCloseOnOverlayClick:!0,onRequestClose:function(){return f()},contentLabel:"Widget Form Modal",style:{content:{maxWidth:"700px"}},children:(0,i.jsx)(Z.J9,{initialValues:{id:y,name:_,origin:B},onSubmit:z,children:(0,i.jsx)(Z.l0,{id:"variation-add",onKeyDown:function(e){"Enter"===e.key&&(e.preventDefault(),z())},children:(0,i.jsx)(T.xu,{children:(0,i.jsxs)(R,{sx:{textAlign:"left"},HeaderContent:(0,i.jsx)(T.xv,{as:"h2",children:"Add new Variation"}),FooterContent:(0,i.jsxs)(T.kC,{sx:{justifyContent:"flex-end"},children:[(0,i.jsx)(T.zx,{onClick:f,mr:2,variant:"secondary",children:"Cancel"}),(0,i.jsx)(T.zx,{type:"submit",children:"Submit"})]}),close:f,children:[(0,i.jsxs)(T.xu,{sx:{pb:4,mt:4},children:[(0,i.jsxs)(T.__,{htmlFor:"name",sx:{mb:1},children:["Variation name*",v.name?(0,i.jsx)(N,{msg:v.name}):""]}),(0,i.jsx)(Z.gN,{autoComplete:"off",id:"name",name:"name",placeholder:"e.g. Grid - With Icon",as:T.II,maxLength:30,value:_,onChange:function(e){return u(e.currentTarget.value)}}),(0,i.jsx)(T.xv,{children:"It will appear here in Slice Machine, and in the page editor in Prismic"})]}),(0,i.jsxs)(T.xu,{sx:{pb:4},children:[(0,i.jsxs)(T.__,{htmlFor:"id",sx:{mb:1},children:["Variation ID*",v.id?(0,i.jsx)(N,{msg:v.id}):""]}),(0,i.jsx)(Z.gN,{autoComplete:"off",id:"id",name:"id",placeholder:"e.g. GridWithIcon",as:T.II,maxLength:30,value:y,onChange:function(e){return d(e.currentTarget.value)}}),(0,i.jsx)(T.xv,{children:"It's generated automatically based on the variation name and will appear in the API responses."})]}),(0,i.jsxs)(T.xu,{sx:{pb:4},children:[(0,i.jsx)(T.__,{htmlFor:"origin",sx:{mb:1},children:"Duplicate from"}),(0,i.jsx)(A.ZP,{name:"origin",options:a.map(function(e){return{value:e.id,label:e.name}}),onChange:function(e){e&&F(e)},defaultValue:B,maxMenuHeight:150,theme:function(e){return(0,b.Z)((0,g.Z)({},e),{colors:(0,b.Z)((0,g.Z)({},e.colors),{text:"text",primary:"background"})})}})]})]})})})})})},V=t(13858),_=t(82770),O=t(49451);function D(){return(D=(0,w.Z)(function(e){var n,t,i,r,o,a,l,s,c,u,d,f;return(0,k.__generator)(this,function(n){switch(n.label){case 0:e.setSliceBuilderState({loading:!0,done:!1}),n.label=1;case 1:return n.trys.push([1,7,,8]),[4,(0,_.Ve)(e.component)];case 2:if((t=n.sent().errors).length>0)throw t;return[4,(0,_.Xi)({libraryID:e.component.from,sliceID:e.component.model.id,variationID:e.variation.id})];case 3:if((r=n.sent().errors).length>0)throw r;return[4,(0,_.X$)(e.component.from,e.component.model.id)];case 4:if(a=(o=n.sent()).slice,(l=o.errors).length>0)throw l;if(!a)throw Error("Could not read variation `".concat(e.variation.name,"`"));return[4,(0,_.pL)({libraryID:e.component.from,sliceID:e.component.model.id})];case 5:return s=n.sent().mocks,c=O.Y.getBuilderPagePathname({libraryName:e.component.href,sliceName:a.name,variationId:a.variations[0].id}),[4,e.router.replace(c)];case 6:return n.sent(),e.updateAndSaveSlice((0,b.Z)((0,g.Z)({},e.component),{model:a,mocks:s})),u="".concat(e.component.from,"/").concat(e.component.model.name,"/model.json"),e.setSliceBuilderState({loading:!1,done:!0,error:!1,message:(0,V.kQ)({path:u})}),[3,8];case 7:throw d=n.sent(),f="Could not delete variation `".concat(e.variation.name,"`"),console.error(f,d),e.setSliceBuilderState({loading:!1,done:!0,error:!0,message:f}),d;case 8:return[2]}})})).apply(this,arguments)}var B=function(e){var n=e.isOpen,t=e.onClose,r=e.slice,o=e.variation,l=e.sliceBuilderState,s=e.setSliceBuilderState,c=(0,S.useRouter)(),u=(0,h.Z)().updateAndSaveSlice;return(0,i.jsxs)(a.Vq,{open:n,onOpenChange:function(e){return!e&&t()},size:{width:448,height:"auto"},children:[(0,i.jsx)(a.fK,{icon:"delete",title:"Delete variation"}),(0,i.jsx)(a.cZ,{children:(0,i.jsxs)(a.xu,{flexDirection:"column",children:[(0,i.jsxs)(a.xv,{color:"grey11",sx:{marginBlock:16,marginInline:16},children:["This action will remove the variation from the slice model and delete associated files. When you push your changes, the variation will disappear from your repository. This update will"," ",(0,i.jsx)(F,{children:"not"})," affect your documents until you ",(0,i.jsx)(F,{children:"edit"})," ","them manually."]}),(0,i.jsx)(a.kX,{ok:{text:"Delete",onClick:function(){o&&(0,w.Z)(function(){return(0,k.__generator)(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,function(e){return D.apply(this,arguments)}({component:r,router:c,setSliceBuilderState:s,updateAndSaveSlice:u,variation:o})];case 1:case 2:return e.sent(),[3,3];case 3:return t(),[2]}})})()},loading:l.loading},cancel:{text:"Cancel"},size:"medium"})]})})]})},F=function(e){return(0,i.jsx)(a.xv,(0,b.Z)((0,g.Z)({},e),{color:"inherit",component:"span",variant:"bold"}))};function z(){return(z=(0,w.Z)(function(e){var n,t,i,r,o,a,l,s,c,u,d;return(0,k.__generator)(this,function(n){switch(n.label){case 0:e.setSliceBuilderState({loading:!0,done:!1}),n.label=1;case 1:return n.trys.push([1,6,,7]),[4,(0,_.Ve)(e.component)];case 2:if((t=n.sent().errors).length>0)throw t;return[4,(0,_.eH)(e.component,(0,b.Z)((0,g.Z)({},e.variation),{name:e.variationName}))];case 3:if((r=n.sent().errors).length>0)throw r;return[4,(0,_.X$)(e.component.from,e.component.model.id)];case 4:if(a=(o=n.sent()).slice,(l=o.errors).length>0)throw l;if(!a)throw Error("Could not read variation `".concat(e.variation.name,"`"));return[4,(0,_.pL)({libraryID:e.component.from,sliceID:e.component.model.id})];case 5:return s=n.sent().mocks,e.updateAndSaveSlice((0,b.Z)((0,g.Z)({},e.component),{model:a,mocks:s})),c="".concat(e.component.from,"/").concat(e.component.model.name,"/model.json"),e.setSliceBuilderState({loading:!1,done:!0,error:!1,message:(0,V.kQ)({path:c})}),[3,7];case 6:throw u=n.sent(),d="Could not rename variation `".concat(e.variation.name,"`"),console.error(d,u),e.setSliceBuilderState({loading:!1,done:!0,error:!0,message:d}),u;case 7:return[2]}})})).apply(this,arguments)}var P=function(e){var n,t,r=e.isOpen,o=e.onClose,l=e.slice,s=e.variation,c=e.sliceBuilderState,u=e.setSliceBuilderState,d=(0,h.Z)().updateAndSaveSlice;return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(a.Vq,{open:r,onOpenChange:function(e){return!e&&o()},size:{width:448,height:"auto"},children:[(0,i.jsx)(a.fK,{icon:"edit",title:"Rename variation"}),(0,i.jsx)(a.cZ,{children:(0,i.jsx)(Z.J9,{validateOnChange:!0,validateOnMount:!0,initialValues:{variationName:null!==(n=null==s?void 0:s.name)&&void 0!==n?n:""},validate:function(e){if(0===e.variationName.length)return{variationName:"Cannot be empty"}},onSubmit:(t=(0,w.Z)(function(e){return(0,k.__generator)(this,function(n){switch(n.label){case 0:if(!s)return[2];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,function(e){return z.apply(this,arguments)}({component:l,setSliceBuilderState:u,updateAndSaveSlice:d,variation:s,variationName:e.variationName.trim()})];case 2:case 3:return n.sent(),[3,4];case 4:return o(),[2]}})}),function(e){return t.apply(this,arguments)}),children:function(e){return(0,i.jsxs)("form",{children:[(0,i.jsxs)(a.xu,{flexDirection:"column",gap:8,padding:16,children:[(0,i.jsx)(a.xv,{variant:"normal",color:"grey11",children:"This action will rename the variation in the slice model. When you push your changes, the variation will be renamed in your repository."}),(0,i.jsxs)(a.xu,{flexDirection:"column",gap:4,children:[(0,i.jsxs)("label",{className:"_1ecs97dez4 _1ecs97dez8 _1ecs97df90",children:[(0,i.jsx)(a.xv,{variant:"bold",children:"Variation name*"}),"string"==typeof e.errors.variationName?(0,i.jsx)(a.xv,{variant:"small",color:"tomato10",children:e.errors.variationName}):null]}),(0,i.jsx)(a.yt,{placeholder:"Variation name",error:"string"==typeof e.errors.variationName,value:e.values.variationName,onValueChange:function(n){e.setFieldValue("variationName",n.slice(0,30))}})]})]}),(0,i.jsx)(a.kX,{ok:{text:"Rename",onClick:function(){e.submitForm()},loading:c.loading,disabled:!e.isValid},cancel:{text:"Cancel"},size:"medium"})]})}})})]})})},M=t(84449),K=t(65958),H=t(47731),W=function(e){var n=e.slice,t=e.variation,r=e.sliceBuilderState,o=e.setSliceBuilderState,s=(0,l.useState)(),c=s[0],u=s[1],d=(0,H.H)(),f=d.modalPayload,m=f.sliceFilterFn,p=f.defaultVariationSelector,v=(0,h.Z)(),x=v.copyVariationSlice,y=v.updateSlice,w=(0,S.useRouter)();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(a.xu,{flexDirection:"column",gap:16,children:[n.model.variations.map(function(e){return(0,i.jsx)(K.b,{action:{type:"menu",onRename:function(){u({type:"RENAME_VARIATION",variation:e})},onRemove:function(){u({type:"DELETE_VARIATION",variation:e})},removeDisabled:n.model.variations.length<=1},mode:"navigation",onUpdateScreenshot:function(){d.onOpenModal({sliceFilterFn:function(e){return e},defaultVariationSelector:{sliceID:n.model.id,variationID:e.id}})},replace:!0,selected:e.id===t.id,slice:n,variant:"outlined",variationId:e.id},e.id)}),(0,i.jsxs)(a.xu,{backgroundColor:"grey2",bottom:0,flexDirection:"column",padding:{bottom:40,inline:24},position:"sticky",style:{marginBottom:"-16px"},children:[(0,i.jsx)(a.ph,{sx:{left:0,position:"absolute",right:0}}),(0,i.jsx)(a.zx,{onClick:function(){u({type:"ADD_VARIATION"})},startIcon:"add",sx:{position:"relative"},color:"grey",children:"Add a new variation"})]})]}),(0,i.jsx)(M.Z,{slices:m([n]),defaultVariationSelector:p}),(0,i.jsx)(P,{isOpen:(null==c?void 0:c.type)==="RENAME_VARIATION",onClose:function(){u(void 0)},slice:n,variation:null==c?void 0:c.variation,sliceBuilderState:r,setSliceBuilderState:o}),(0,i.jsx)(B,{isOpen:(null==c?void 0:c.type)==="DELETE_VARIATION",onClose:function(){u(void 0)},slice:n,variation:null==c?void 0:c.variation,sliceBuilderState:r,setSliceBuilderState:o}),(0,i.jsx)(L,{initialVariation:t,isOpen:(null==c?void 0:c.type)==="ADD_VARIATION",onClose:function(){u(void 0)},onSubmit:function(e,t,i){x(e,t,i);var r=C.e.copyValue(i,e,t),a=(0,b.Z)((0,g.Z)({},n),{model:(0,b.Z)((0,g.Z)({},n.model),{variations:(0,j.Z)(n.model.variations).concat([r])})});y(a,o);var l=O.Y.getBuilderPagePathname({libraryName:a.href,sliceName:a.model.name,variationId:r.id});w.replace(l)},variations:n.model.variations})]})},q=t(56580),X=t(75329),J=t(33710),Q=t(42189),Y=t(17036),G=t(39295),$=t(22342),U=function(){return(0,i.jsx)(G.X,{children:(0,i.jsxs)(J.Z,{clickable:!0,place:"bottom",effect:"solid",delayHide:500,id:"simulator-button-tooltip",children:[(0,i.jsx)(T.xv,{as:"b",children:"Framework not supported"}),(0,i.jsx)(T.xv,{as:"p",children:"Slice Simulator does not support your framework yet."})]})})},ee=function(e){var n=e.children,t=e.open,r=e.onClose;return(0,i.jsxs)($.zs,{open:t,trigger:n,onClose:r,children:[(0,i.jsx)($.Ev,{children:"Simulate your slices"}),(0,i.jsx)($.LB,{component:"video",cloudName:"dmtf1daqp",loop:!1,autoPlay:!1,publicId:X.Sn,poster:"/simulator-video-thumbnail.png",controls:!0,onPlay:function(){_.Xe.track({event:"open-video-tutorials",video:X.Sn})}}),(0,i.jsx)($.OJ,{children:"Minimize context-switching by previewing your Slice components in the simulator."}),(0,i.jsx)($.Rp,{children:"Got it"})]})},en=function(){return(0,i.jsx)(G.X,{children:(0,i.jsx)(J.Z,{clickable:!0,place:"bottom",effect:"solid",delayHide:500,id:"simulator-button-tooltip",children:"Save your work in order to simulate"})})},et=function(e){var n=e.isSimulatorAvailableForFramework,t=e.isTouched,r=(0,S.useRouter)(),o=(0,l.useRef)(null),s=(0,h.Z)().setSeenSimulatorToolTip,c=(0,q.v9)(function(e){return{hasSeenSimulatorTooltip:(0,Y.bv)(e)}}).hasSeenSimulatorTooltip;(0,l.useEffect)(function(){var e=o.current;e&&n&&!c&&setTimeout(function(){return J.Z.show(e)},5e3)},[n,c]);var u=function(){if(s(),o.current){var e=o.current;J.Z.hide(e)}},d=n&&!c;return(0,i.jsxs)("span",{"data-tip":!0,"data-tip-disable":!1,"data-for":"simulator-button-tooltip",ref:o,children:[(0,i.jsx)(ee,{open:d,onClose:u,children:(0,i.jsx)(a.zx,{"data-tip":!0,"data-testid":"simulator-open-button",onClick:function(){u(),window.open("".concat(r.asPath,"/simulator"),X.pq)},disabled:!n||t,renderStartIcon:function(){return(0,i.jsx)(Q.z,{color:a.TV.color.greyLight11,height:a.TV.size[24],style:{transform:"scale(calc(4 / 3))"},width:a.TV.size[24]})},color:"grey",children:"Simulate"})}),!1===n?(0,i.jsx)(U,{}):n&&!1===d&&t?(0,i.jsx)(en,{}):null]})},ei=t(22337),er=t(17329),eo=t(81038);function ea(e){return el.apply(this,arguments)}function el(){return(el=(0,w.Z)(function(e){var n,t,i;return(0,k.__generator)(this,function(r){switch(r.label){case 0:return[4,eo.j.customTypes.readCustomType({id:e})];case 1:if(t=(n=r.sent()).errors,i=n.model,t.length>0)throw t;return[2,i]}})})).apply(this,arguments)}var es=t(67445),ec=t(64722),eu=t(20812),ed=function(e){return(0,i.jsxs)("svg",(0,b.Z)((0,g.Z)({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[(0,i.jsx)("path",{d:"M9.5 12L6 9.5L9.5 7V9.5V12Z",fill:"currentColor"}),(0,i.jsx)("path",{d:"M6 9.5H11C14.3 9.5 17 12.2 17 15.5V17.5M6 9.5L9.5 12V9.5V7L6 9.5Z",stroke:"currentColor",strokeLinecap:"round"})]}))},ef=function(){var e,n,t=(e=(0,ec.l)().source,n=(0,es.Ag)(e.query),void 0!==n&&(0,es.ne)(e.asPath,n)?n:void 0);return void 0!==t?(0,i.jsx)(a.SV,{children:(0,i.jsx)(l.Suspense,{children:(0,i.jsx)(a.xu,{bottom:32,justifyContent:"center",position:"fixed",right:0,width:"100vw",children:(0,i.jsx)(em,{sourceCustomTypeId:t})})})}):null},em=function(e){var n,t=(n=e.sourceCustomTypeId,(0,er.QT)(ea,[n])),r=(0,l.useState)(!0),o=r[0],s=r[1],c=(0,S.useRouter)();if(void 0===t||!o)return null;var u=t.format,d=t.id,f=es.cd[u].getBuilderPagePathname(d);return(0,i.jsxs)(a.hE,{density:"compact",color:"dark",children:[(0,i.jsxs)(a.zx,{onClick:function(){c.push(f)},renderStartIcon:function(){return(0,i.jsx)(ed,{})},children:["Return to ",t.label]}),(0,i.jsx)(a.zx,{onClick:function(){s(!1)},renderStartIcon:function(){return(0,i.jsx)(eu.T,{})}})]})},ep=t(39092),ev=t(92521),eh={loading:!1,done:!1},ex=function(e){var n=e.slice,t=e.variation,r=(0,h.Z)().openToaster,o=(0,q.v9)(function(e){return(0,ev.sY)(e,n.from,n.model.id)}),a=(0,l.useState)(eh),c=a[0],u=a[1];return((0,l.useEffect)(function(){o&&u(eh)},[o]),(0,l.useEffect)(function(){if(c.done){var e,n;n=c,n.done&&r(n.message,n.error?s.Jf.ERROR:s.Jf.SUCCESS)}},[c]),t)?(0,i.jsx)(ey,{setState:u,slice:n,variation:t,isTouched:o,state:c}):(0,i.jsx)(ei.LN,{})},ey=function(e){var n=e.setState,t=e.slice,r=e.variation,o=e.isTouched,l=e.state,s=(0,q.v9)(ep.Ql),c=(0,h.Z)().updateSlice;return(0,i.jsxs)(ei.LN,{children:[(0,i.jsxs)(ei.wd,{children:[(0,i.jsx)(ei.Xq,{url:"/slices"}),(0,i.jsx)(ei.Cx,{folder:"Slices",page:t.model.name}),(0,i.jsxs)(ei.K2,{children:[(0,i.jsx)(et,{isSimulatorAvailableForFramework:s,isTouched:!!o}),(0,i.jsx)(a.zx,{loading:l.loading,disabled:!o||l.loading,onClick:function(){c(t,n)},"data-cy":"builder-save-button",children:"Save"})]})]}),(0,i.jsxs)(ei.RN,{children:[(0,i.jsxs)(a.xu,{alignItems:"flex-start",display:"grid",gap:16,gridTemplateColumns:"320px 1fr",children:[(0,i.jsx)(W,{slice:t,variation:r,sliceBuilderState:l,setSliceBuilderState:n}),(0,i.jsx)(y,{variation:r})]}),(0,i.jsx)(ef,{})]})]})},eg=t(28684),eb=(0,t(57880).y)(ex);function ej(){var e=(0,eg.Z)().slice;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(o(),{children:e?(0,i.jsxs)("title",{children:[e.model.name," - Slice Machine"]}):null}),(0,i.jsx)(eb,{})]})}},28684:function(e,n,t){"use strict";var i=t(92521),r=t(90374),o=t(5632),a=t(2784),l=t(56580),s=function(){var e=(0,o.useRouter)(),n=(0,r.Z)().initSliceStore,t=(0,l.v9)(function(n){return{slice:(0,i.tL)(n,e.query.lib,e.query.sliceName)}}).slice;if((0,a.useEffect)(function(){t?n(t):e.replace("/")},[n,t,e]),!t)return{};var s=t.model.variations.find(function(n){return n.id===e.query.variation});return s?{slice:t,variation:s}:(e.replace("/"),{})};n.Z=s},57880:function(e,n,t){"use strict";t.d(n,{y:function(){return l}});var i=t(62230),r=t(52322);t(2784);var o=t(28684),a=t(95583),l=function(e){return function(n){var t=n.pageProps,l=(0,o.Z)(),s=l.slice,c=l.variation;return s&&c?(0,r.jsx)(e,(0,i.Z)({slice:s,variation:c},t)):((0,a.gx)("/"),null)}}},76473:function(e,n,t){"use strict";t.d(n,{y1:function(){return b}});var i=t(2784);function r(){return(r=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e}).apply(this,arguments)}t(52322);var o=["shift","alt","meta","mod","ctrl"],a={esc:"escape",return:"enter",".":"period",",":"comma","-":"slash"," ":"space","`":"backquote","#":"backslash","+":"bracketright",ShiftLeft:"shift",ShiftRight:"shift",AltLeft:"alt",AltRight:"alt",MetaLeft:"meta",MetaRight:"meta",OSLeft:"meta",OSRight:"meta",ControlLeft:"ctrl",ControlRight:"ctrl"};function l(e){return(a[e]||e).trim().toLowerCase().replace(/key|digit|numpad|arrow/,"")}function s(e,n){return void 0===n&&(n=","),e.split(n)}function c(e,n,t){void 0===n&&(n="+");var i,a=e.toLocaleLowerCase().split(n).map(function(e){return l(e)});return r({},{alt:a.includes("alt"),ctrl:a.includes("ctrl")||a.includes("control"),shift:a.includes("shift"),meta:a.includes("meta"),mod:a.includes("mod")},{keys:a.filter(function(e){return!o.includes(e)}),description:t})}"undefined"!=typeof document&&(document.addEventListener("keydown",function(e){void 0!==e.key&&f([l(e.key),l(e.code)])}),document.addEventListener("keyup",function(e){void 0!==e.key&&m([l(e.key),l(e.code)])})),"undefined"!=typeof window&&window.addEventListener("blur",function(){u.clear()});var u=new Set;function d(e){return Array.isArray(e)}function f(e){var n=Array.isArray(e)?e:[e];u.has("meta")&&u.forEach(function(e){var n;return!o.includes(e)&&u.delete(e.toLowerCase())}),n.forEach(function(e){return u.add(e.toLowerCase())})}function m(e){var n=Array.isArray(e)?e:[e];"meta"===e?u.clear():n.forEach(function(e){return u.delete(e.toLowerCase())})}function p(e,n){var t=e.target;void 0===n&&(n=!1);var i=t&&t.tagName;return d(n)?Boolean(i&&n&&n.some(function(e){return e.toLowerCase()===i.toLowerCase()})):Boolean(i&&n&&!0===n)}var v=function(e,n,t){void 0===t&&(t=!1);var i,r,o=n.alt,a=n.meta,s=n.mod,c=n.shift,f=n.ctrl,m=n.keys,p=e.key,v=e.code,h=e.ctrlKey,x=e.metaKey,y=e.shiftKey,g=e.altKey,b=l(v),j=p.toLowerCase();if(!t){if(!g===o&&"alt"!==j||!y===c&&"shift"!==j)return!1;if(s){if(!x&&!h)return!1}else if(!x===a&&"meta"!==j&&"os"!==j||!h===f&&"ctrl"!==j&&"control"!==j)return!1}return!!(m&&1===m.length&&(m.includes(j)||m.includes(b)))||(m?(void 0===r&&(r=","),(d(i=m)?i:i.split(r)).every(function(e){return u.has(e.trim().toLowerCase())})):!m)},h=(0,i.createContext)(void 0),x=(0,i.createContext)({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),y=function(e){e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()},g="undefined"!=typeof window?i.useLayoutEffect:i.useEffect;function b(e,n,t,r){var o,a,u=(0,i.useRef)(null),b=(0,i.useRef)(!1),j=t instanceof Array?r instanceof Array?void 0:r:t,S=d(e)?e.join(null==j?void 0:j.splitKey):e,w=t instanceof Array?t:r instanceof Array?r:void 0,k=(0,i.useCallback)(n,null!=w?w:[]),C=(0,i.useRef)(k);w?C.current=k:C.current=n;var Z=(!function e(n,t){return n&&t&&"object"==typeof n&&"object"==typeof t?Object.keys(n).length===Object.keys(t).length&&Object.keys(n).reduce(function(i,r){return i&&e(n[r],t[r])},!0):n===t}((a=(0,i.useRef)(void 0)).current,j)&&(a.current=j),a.current),I=(0,i.useContext)(x).enabledScopes,T=(0,i.useContext)(h);return g(function(){if((null==Z?void 0:Z.enabled)!==!1&&(e=I,n=null==Z?void 0:Z.scopes,0===e.length&&n?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a <HotkeysProvider>'),!0):!!(!n||e.some(function(e){return n.includes(e)})||e.includes("*")))){var e,n,t=function(e,n){var t,i;if(void 0===n&&(n=!1),!(p(e,["input","textarea","select"])&&!p(e,null==Z?void 0:Z.enableOnFormTags)||null!=Z&&null!=Z.ignoreEventWhen&&Z.ignoreEventWhen(e))){if(null!==u.current&&document.activeElement!==u.current&&!u.current.contains(document.activeElement)){y(e);return}(null==(t=e.target)||!t.isContentEditable||null!=Z&&Z.enableOnContentEditable)&&s(S,null==Z?void 0:Z.splitKey).forEach(function(t){var i,r,o,a,l,s,u,d=c(t,null==Z?void 0:Z.combinationKey);if(v(e,d,null==Z?void 0:Z.ignoreModifiers)||null!=(u=d.keys)&&u.includes("*")){if(n&&b.current)return;if(i=e,r=d,("function"==typeof(o=null==Z?void 0:Z.preventDefault)&&o(i,r)||!0===o)&&i.preventDefault(),a=e,l=d,"function"==typeof(s=null==Z?void 0:Z.enabled)?!s(a,l):!0!==s&&void 0!==s){y(e);return}C.current(e,d),n||(b.current=!0)}})}},i=function(e){void 0!==e.key&&(f(l(e.code)),((null==Z?void 0:Z.keydown)===void 0&&(null==Z?void 0:Z.keyup)!==!0||null!=Z&&Z.keydown)&&t(e))},r=function(e){void 0!==e.key&&(m(l(e.code)),b.current=!1,null!=Z&&Z.keyup&&t(e,!0))},o=u.current||(null==j?void 0:j.document)||document;return o.addEventListener("keyup",r),o.addEventListener("keydown",i),T&&s(S,null==Z?void 0:Z.splitKey).forEach(function(e){return T.addHotkey(c(e,null==Z?void 0:Z.combinationKey,null==Z?void 0:Z.description))}),function(){o.removeEventListener("keyup",r),o.removeEventListener("keydown",i),T&&s(S,null==Z?void 0:Z.splitKey).forEach(function(e){return T.removeHotkey(c(e,null==Z?void 0:Z.combinationKey,null==Z?void 0:Z.description))})}}},[S,Z,I]),u}}},function(e){e.O(0,[789,958,80,482,774,888,179],function(){return e(e.s=31314)}),_N_E=e.O()}]);