slice-machine-ui 2.9.2-beta.2 → 2.9.2-beta.4
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.
- package/out/404.html +1 -1
- package/out/_next/static/chunks/150-eab557690a3d3df6.js +1 -0
- package/out/_next/static/chunks/372-92310a383394bd51.js +1 -0
- package/out/_next/static/chunks/639-424b570eee9a37fb.js +1 -0
- package/out/_next/static/chunks/764-af46a341da795d13.js +1 -0
- package/out/_next/static/chunks/{772-ed8f3990453f05fe.js → 772-936f6233f8a2b1f1.js} +1 -1
- package/out/_next/static/chunks/882-1fd1fbf0fe97a211.js +1 -0
- package/out/_next/static/chunks/pages/{_app-7003611f73120dc1.js → _app-b280f3be893de784.js} +64 -64
- package/out/_next/static/chunks/pages/{changelog-1087db6178013180.js → changelog-3de3687d3807f3d5.js} +1 -1
- package/out/_next/static/chunks/pages/changes-993e3e52efb5de1f.js +1 -0
- package/out/_next/static/chunks/pages/{labs-b3a8a0fa91d4b67b.js → labs-20347ab849300143.js} +1 -1
- package/out/_next/static/chunks/pages/{settings-3113f0d4d26dfada.js → settings-1cf976f9042cdde7.js} +1 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-d5df6446669f32d9.js +1 -0
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-a49a9a15b7d7f2cb.js +1 -0
- package/out/_next/static/chunks/pages/slices-b95fc968e8f1b2d2.js +1 -0
- package/out/_next/static/css/dd42e99c28b686f9.css +1 -0
- package/out/_next/static/e1hGloQkSwlrJnoIbdTxo/_buildManifest.js +1 -0
- package/out/changelog.html +1 -1
- package/out/changes.html +1 -1
- package/out/custom-types/[customTypeId].html +1 -1
- package/out/custom-types.html +1 -1
- package/out/index.html +1 -1
- package/out/labs.html +1 -1
- package/out/page-types/[pageTypeId].html +1 -1
- package/out/settings.html +1 -1
- package/out/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
- package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
- package/out/slices.html +1 -1
- package/package.json +6 -6
- package/src/features/customTypes/customTypesBuilder/PageSnippetDialog/PageSnippetDialog.tsx +3 -0
- package/src/features/onboarding/SliceMachineOnboardingGuide/SliceMachineOnboardingGuide.tsx +17 -3
- package/src/features/onboarding/useOnboarding.ts +36 -8
- package/src/features/onboarding/useSharedOnboardingExperiment.ts +1 -1
- package/src/legacy/components/AuthInstructions/index.jsx +22 -18
- package/src/legacy/components/Card/Default.jsx +25 -19
- package/src/legacy/components/Card/WithTabs/index.jsx +1 -1
- package/src/legacy/components/Card/index.tsx +43 -46
- package/src/legacy/components/ConfigErrors/index.jsx +23 -22
- package/src/legacy/components/DeleteCTModal/index.tsx +3 -3
- package/src/legacy/components/DeleteSliceModal/index.tsx +3 -3
- package/src/legacy/components/Forms/CreateCustomTypeModal/CreateCustomTypeModal.tsx +4 -0
- package/src/legacy/components/Forms/CreateSliceModal/CreateSliceModal.tsx +3 -0
- package/src/legacy/components/ModalFormCard/index.tsx +29 -20
- package/src/legacy/components/ScreenshotChangesModal/index.tsx +28 -19
- package/src/legacy/components/ScreenshotPreviewModal/index.tsx +3 -3
- package/src/legacy/components/SliceMachineDrawer/index.tsx +3 -3
- package/src/legacy/components/Warnings/index.jsx +50 -45
- package/src/legacy/lib/builders/CustomTypeBuilder/SliceZone/DeleteSliceZoneModal.tsx +3 -3
- package/src/legacy/lib/builders/CustomTypeBuilder/SliceZone/index.tsx +4 -0
- package/src/legacy/lib/builders/common/EditModal/index.jsx +24 -17
- package/src/pages/changes.tsx +4 -0
- package/out/_next/static/N4L1qG2wTelLcv7q1u6zD/_buildManifest.js +0 -1
- package/out/_next/static/chunks/150-50ba55dc830fed3d.js +0 -1
- package/out/_next/static/chunks/372-8a30b6213f74cec4.js +0 -1
- package/out/_next/static/chunks/639-175fa5cb82faf87c.js +0 -1
- package/out/_next/static/chunks/764-b227a29a47c620de.js +0 -1
- package/out/_next/static/chunks/882-52e400abbe47296c.js +0 -1
- package/out/_next/static/chunks/pages/changes-15ac7bd12a3861ec.js +0 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-dde04caa311e3119.js +0 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-5e6dbc213e2cb436.js +0 -1
- package/out/_next/static/chunks/pages/slices-a2bd37c062dfe13d.js +0 -1
- package/out/_next/static/css/6dd94025935d0fdd.css +0 -1
- /package/out/_next/static/{N4L1qG2wTelLcv7q1u6zD → e1hGloQkSwlrJnoIbdTxo}/_ssgManifest.js +0 -0
package/out/404.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/dd42e99c28b686f9.css" as="style"/><link rel="stylesheet" href="/_next/static/css/dd42e99c28b686f9.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js"></script><script src="/_next/static/chunks/webpack-2f903acb0cccbf9e.js" defer=""></script><script src="/_next/static/chunks/framework-a31bc948075f7bde.js" defer=""></script><script src="/_next/static/chunks/main-8e15d66b38d840e9.js" defer=""></script><script src="/_next/static/chunks/pages/_app-b280f3be893de784.js" defer=""></script><script src="/_next/static/chunks/pages/_error-1b183d3cf5ea03f9.js" defer=""></script><script src="/_next/static/e1hGloQkSwlrJnoIbdTxo/_buildManifest.js" defer=""></script><script src="/_next/static/e1hGloQkSwlrJnoIbdTxo/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":404}},"page":"/_error","query":{},"buildId":"e1hGloQkSwlrJnoIbdTxo","runtimeConfig":{"sentryEnvironment":"beta"},"nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[150],{9150:function(e,t,l){"use strict";l.d(t,{H:function(){return e4}});var i=l(52322),n=l(33760),a=l(97729),r=l.n(a),o=l(5632),s=l(2784),c=l(56580),d=l(23335),u=l(93216),m=l(6697),x=l(63447),h=l(74830),p=l(74217),v=l(93188),y=l(80546),f=l(43874),j=l(41067),b=l(77507);let g=(0,s.createContext)(void 0);function C(e){let{children:t,initialCustomType:l}=e,[n,a]=(0,s.useState)(l),r=(0,u.y6)(n),o=b.$[r],{actionQueueStatus:c,setNextAction:d}=(0,f.c)({errorMessage:o.autoSaveFailed}),{saveCustomTypeSuccess:m}=(0,j.Z)(),x=(0,p.R9)(m),{syncChanges:h}=(0,y.g)(),C=(0,s.useCallback)((e,t)=>{a(e),d(async()=>{let{errors:l}=await (0,v.KA)(e);if(l.length>0)throw l;x(e),h(),null==t||t()})},[d,x,h]),S=(0,s.useMemo)(()=>({actionQueueStatus:c,customType:n,setCustomType:C}),[c,n,C]);return(0,i.jsx)(g.Provider,{value:S,children:"function"==typeof t?t(S):t})}function S(){let e=(0,s.useContext)(g);if(!e)throw Error("CustomTypeProvider not found");return e}var I=l(30195);function w(){var e;let[t,l]=(0,s.useState)(!1),{customType:a,setCustomType:r}=S(),[o,c]=null!==(e=(0,u.j5)(a))&&void 0!==e?e:[],d=c?(0,u.N3)(c):"",[m,x]=(0,s.useState)(null!=d?d:""),[h,v]=(0,s.useState)();(0,p.pQ)(t,()=>{t||(x(null!=d?d:""),v(void 0))});let y=(0,s.useCallback)(()=>(0,i.jsx)(n.I5,{name:c?"language":"add",size:"small",color:"grey11"}),[c]);return(0,i.jsxs)(n.Vq,{open:t,onOpenChange:l,size:"small",trigger:(0,i.jsx)(n.zx,{color:"grey",textColor:"placeholder",textWeight:"normal",renderStartIcon:y,sx:{marginInline:"auto"},children:c?d:"Add an UID"}),children:[(0,i.jsx)(n.fK,{title:"Edit the UID label"}),(0,i.jsx)(n.cZ,{children:(0,i.jsxs)(n.l0,{onSubmit:function(){h||(r(c?(0,u.eK)(m,a):(0,u.H8)(m,a)),l(!1))},children:[(0,i.jsx)(n.xu,{flexDirection:"column",padding:16,gap:4,children:(0,i.jsx)(n.yt,{type:"text",label:"Label *",placeholder:"UID",value:m,onValueChange:function(e){x(e),v(function(e){let t=T.safeParse(e,{errorMap:k});if(t.error)return t.error.errors[0].message}(e))},error:h,description:"A label for the UID"})}),(0,i.jsxs)(n.kX,{children:[(0,i.jsx)(n.PO,{size:"medium"}),(0,i.jsx)(n._d,{size:"medium",disabled:!!h,children:"Save"})]})]})})]})}let T=I.z.string().max(35).min(1),k=e=>{switch(e.code){case I.z.ZodIssueCode.too_big:return{message:"The label can't be longer than ".concat(e.maximum," characters")};case I.z.ZodIssueCode.too_small:return{message:"This field is required"};default:return{message:"Invalid value"}}};var _=l(95799),D=l(1490),N=l(63397),A=l(75289);let E=e=>{let{name:t,label:l,placeholder:n,error:a,...r}=e;return(0,i.jsxs)(A.xu,{mb:3,children:[(0,i.jsx)(A.__,{htmlFor:t,mb:2,children:l}),(0,i.jsx)(N.gN,{name:t,type:"text",placeholder:n,as:A.II,autoComplete:"off",...r}),a?(0,i.jsx)(A.xv,{sx:{color:"error",mt:1},children:a}):null]})};var M=e=>{let{isOpen:t,onSubmit:l,close:n,tabIds:a}=e;return(0,i.jsx)(D.Z,{isOpen:t,widthInPx:"530px",formId:"create-tab",close:n,onSubmit:e=>{l(e),n()},initialValues:{id:""},validate:e=>{let{id:t}=e;return t?a.includes(t.toLowerCase())?{id:"Tab exists already"}:void 0:{id:"Tab ID is required"}},content:{title:"Add Tab"},children:e=>{let{errors:t}=e;return(0,i.jsx)(E,{name:"id",label:"New Tab ID",placeholder:"A label for selecting the tab (i.e. not used in the API)",error:t.id})}})},Z=e=>{let{isOpen:t,onSubmit:l,close:n}=e;return(0,i.jsx)(D.Z,{omitFooter:!0,isOpen:t,widthInPx:"530px",formId:"create-tab",close:n,cardProps:{bodySx:{p:0}},onSubmit:e=>{l(e),n()},initialValues:{},content:{title:"Remove Tab"},children:()=>(0,i.jsxs)(A.xu,{sx:{px:4,py:4},children:[(0,i.jsx)(A.X6,{as:"h4",children:"Remove this tab?"}),(0,i.jsx)(A.xv,{as:"p",color:"textClear",sx:{mt:2},children:"This action cannot be undone."}),(0,i.jsx)(A.zx,{type:"button",variant:"buttons.actionDelete",sx:{mt:3},onClick:()=>{l({}),n()},children:"Yes, remove tab"})]})})},z=e=>{let{isOpen:t,onSubmit:l,close:n,tabIds:a,initialTabKey:r}=e;return(0,i.jsx)(D.Z,{omitFooter:!0,isOpen:t,widthInPx:"530px",formId:"create-tab",close:n,cardProps:{bodySx:{p:0}},onSubmit:e=>{l(e),n()},initialValues:{id:r},validate:e=>{let{id:t}=e;return t?a.includes(t.toLowerCase())?{id:"Tab exists already"}:void 0:{id:"Tab ID is required"}},content:{title:"Rename Tab"},children:e=>{let{errors:t,values:a,setFieldValue:r,isValid:o}=e;return(0,i.jsxs)(A.xu,{sx:{px:4,py:4},children:[(0,i.jsx)(E,{name:"id",label:"Rename Tab ID",placeholder:"A label for selecting the tab (i.e. not used in the API)",error:t.id,onBlur:e=>{a.id!==e.target.value&&r("id",e.target.value.trim())},onChange:e=>{r("id",e.target.value)}}),(0,i.jsx)(A.zx,{type:"button",sx:{mt:3,width:"100%"},disabled:!o,onClick:()=>{a.id&&a.id.length&&l({id:a.id.trim()}),n()},children:"Save"})]})}})},V=l(28316),L=l(88932),O=l(80775),P=l(30988),F=l(67875),K=l(85357),H=l(99510),R=l(46622),U=l(64602),B=l(18183),X=l(65077),G=l(28574);let Q=e=>(0,i.jsxs)("svg",{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"})]}),Y=e=>{let{openCreateSliceModal:t,openUpdateSliceZoneModal:l,openSlicesTemplatesModal:a,projectHasAvailableSlices:r,isSlicesTemplatesSupported:o}=e;return(0,i.jsx)(n.xu,{flexGrow:1,justifyContent:"center","data-testid":"slice-zone-blank-slate",children:(0,i.jsx)(G.R$,{backgroundImage:"/blank-slate-slice-zone.png",children:(0,i.jsxs)(G.T9,{children:[(0,i.jsx)(n.xu,{justifyContent:"center",padding:{bottom:16},children:(0,i.jsx)(Q,{})}),(0,i.jsx)(G._T,{children:"Add slices"}),(0,i.jsx)(G.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)(G.Qj,{children:(0,i.jsxs)(n.S0,{children:[(0,i.jsx)(n.F8,{startIcon:"add",onClick:t,description:"Start from scratch.",children:"Create new"}),o?(0,i.jsx)(n.F8,{startIcon:"contentCopy",onClick:a,description:"Select from premade examples.",endAdornment:(0,i.jsx)(n.Ct,{color:"purple",title:"New"}),children:"Use template"}):void 0,r?(0,i.jsx)(n.F8,{startIcon:"folder",onClick:l,description:"Select from your own slices.",children:"Select existing"}):void 0]})})]})})})};var $=l(65856);function q(e){let{customType:t,tabId:l,slices:i}=e,n={...t};return i.forEach(e=>{n={...n,tabs:n.tabs.map(t=>t.key===l&&t.sliceZone?{...t,sliceZone:{key:t.sliceZone.key,value:[{key:e.id,value:e},...t.sliceZone.value]}}:t)}}),v.Xe.track({event:"custom-type:slice-zone-updated",customTypeId:t.id}),n}var W=l(18566),J=l(70647);async function ee(){try{let{templates:e,errors:t}=await J.managerClient.sliceTemplateLibrary.readLibrary({});if(t.length>0)throw t;return e.map(e=>({model:e.model,screenshots:Object.fromEntries(Object.entries(e.screenshots).map(e=>{let[t,l]=e;return[t,URL.createObjectURL(l)]}))}))}catch(e){return[]}}var et=l(17889),el=l(91133),ei=l(68916),en=l(47861),ea=l(76805),er=l(11104);let eo=e=>{let{deleteSliceZone:t,closeDeleteSliceZoneModal:l}=e;return(0,i.jsx)(er.Z,{isOpen:!0,shouldCloseOnOverlayClick:!0,style:{content:{maxWidth:612}},onRequestClose:l,children:(0,i.jsx)(ea.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:(0,i.jsxs)(A.kC,{sx:{position:"sticky",top:0,zIndex:1,p:"16px",alignItems:"center",justifyContent:"space-between",borderBottom:e=>{var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.borders))}},children:[(0,i.jsx)(A.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:"Do you really want to delete Slice Zone?"}),(0,i.jsx)(A.x8,{type:"button",onClick:l})]}),Footer:()=>(0,i.jsxs)(A.kC,{sx:{justifyContent:"flex-end",height:64,alignItems:"center",paddingRight:16,borderTop:e=>{var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.darkBorders))},backgroundColor:"gray"},children:[(0,i.jsx)(en.z,{label:"Cancel",variant:"secondary",onClick:l,sx:{mr:"10px",fontWeight:"bold",color:"grey12",borderRadius:6}}),(0,i.jsx)(en.z,{label:"Delete",variant:"danger",onClick:t,sx:{minHeight:39,minWidth:78}})]}),children:(0,i.jsx)(A.nv,{children:"You're about to delete Slice Zone."})})})};var es=l(61502),ec=l(80218),ed=l(3181),eu=l(99923),em=l(17766),ex=l.n(em);let eh=e=>{var t;let{isOpen:l,close:a,onSubmit:r,isLoading:o,slice:d,libraries:u}=e,{remoteSlices:m}=(0,c.v9)(e=>({remoteSlices:(0,ei.sT)(e)})),x={from:null===(t=u[0])||void 0===t?void 0:t.name,sliceName:(0,H.MP)(d.key)},[h,v]=(0,s.useState)(x),[y,f]=(0,s.useState)();function j(e){v(e),f((0,eu.h)(e,u,m))}return(0,p.pQ)(l,()=>{l||(v(x),f(void 0))}),(0,i.jsxs)(n.Vq,{open:l,onOpenChange:e=>!e&&a(),size:{width:448,height:"auto"},children:[(0,i.jsx)(n.fK,{title:"Upgrade slice"}),(0,i.jsx)(n.cZ,{children:(0,i.jsx)(n.l0,{onSubmit:function(){y&&Object.keys(y).length>0||r({libraryID:h.from,sliceID:h.sliceName})},children:(0,i.jsxs)(n.xu,{flexDirection:"column",children:[(0,i.jsxs)(n.xr,{className:ex().scrollArea,children:[(0,i.jsx)(n.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)(n.xv,{variant:"normal",color:"grey11",children:"This will not migrate your component. You will need to do that manually."}),(0,i.jsxs)(n.xu,{flexDirection:"column",gap:4,children:[(0,i.jsx)(n.yt,{label:"Slice name *",placeholder:"Pascalised Slice API ID (e.g. ".concat((0,H.MP)(d.key),")"),error:null==y?void 0:y.sliceName,value:h.sliceName,onValueChange:e=>j({...h,sliceName:e.slice(0,30)}),"data-testid":"slice-name-input"}),(0,i.jsx)(n.xv,{variant:"normal",color:"grey11",children:"A display name for the slice"})]}),(0,i.jsxs)(n.xu,{flexDirection:"column",gap:4,children:[(0,i.jsx)("label",{className:ex().label,children:(0,i.jsx)(n.xv,{variant:"bold",children:"Slice library *"})}),(0,i.jsx)(n.Ph,{size:"medium",color:"grey",startIcon:"folder",flexContent:!0,value:h.from,onValueChange:e=>{e&&j({...h,from:e})},children:u.map(e=>(0,i.jsx)(n.Ql,{value:e.name,children:e.name},e.name))}),(0,i.jsx)(n.xv,{variant:"normal",color:"grey11",children:"The library where we'll store your slice"})]})]}),(0,i.jsxs)(n.kX,{children:[(0,i.jsx)(n.PO,{size:"medium"}),(0,i.jsx)(n._d,{size:"medium",loading:o,disabled:y&&Object.keys(y).length>0,children:"Upgrade"})]})]})})})]})};var ep=l(96009),ev=l.n(ep);let ey=e=>{var t,l;let{isOpen:a,close:r,onSubmit:o,isLoading:c,slice:d,sliceName:u,libraries:m,localSharedSlices:x}=e,h={libraryID:null===(t=x[0])||void 0===t?void 0:t.from,sliceID:null===(l=x[0])||void 0===l?void 0:l.model.id,variationID:ev()(d.key),variationName:u},[v,y]=(0,s.useState)(!0),[f,j]=(0,s.useState)(h),[b,g]=(0,s.useState)({});function C(e){j(e),g(ef(e,m))}return(0,p.pQ)(a,()=>{a||(j(h),g({}))}),(0,i.jsxs)(n.Vq,{open:a,onOpenChange:e=>!e&&r(),size:{width:448,height:"auto"},children:[(0,i.jsx)(n.fK,{title:"Convert to slice variation"}),(0,i.jsx)(n.cZ,{children:(0,i.jsx)(n.l0,{onSubmit:function(){Object.keys(b).length>0||o(f)},children:(0,i.jsxs)(n.xu,{display:"flex",flexDirection:"column",children:[(0,i.jsxs)(n.xr,{className:ex().scrollArea,children:[(0,i.jsx)(n.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)(n.xu,{display:"flex",flexDirection:"column",gap:4,children:[(0,i.jsxs)("label",{className:ex().label,children:[(0,i.jsx)(n.xv,{variant:"bold",children:"Target slice *"}),"string"==typeof b.libraryID?(0,i.jsx)(n.xv,{variant:"small",color:"tomato10",children:b.libraryID}):null,"string"==typeof b.sliceID?(0,i.jsx)(n.xv,{variant:"small",color:"tomato10",children:b.sliceID}):null]}),(0,i.jsx)(n.Ph,{size:"medium",color:"grey",startIcon:"viewDay",flexContent:!0,value:"".concat(f.libraryID,"::").concat(f.sliceID),onValueChange:e=>{if(e){let[t,l]=e.split("::");C({...f,libraryID:t,sliceID:l})}},children:x.map(e=>(0,i.jsxs)(n.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)(n.xv,{variant:"normal",color:"grey11",children:"Choose the slice to which you would like to add this variation."})]}),(0,i.jsx)(n.xu,{display:"flex",flexDirection:"column",gap:4,children:(0,i.jsx)(n.yt,{label:"Variation name *",placeholder:u,error:b.variationName,value:f.variationName,onValueChange:e=>{let t={...f,variationName:e.slice(0,30)};v&&(t.variationID=ev()(t.variationName)),C(t)},"data-testid":"variation-name-input"})}),(0,i.jsx)(n.xu,{display:"flex",flexDirection:"column",gap:4,children:(0,i.jsx)(n.yt,{label:"ID *",placeholder:ev()(d.key),error:b.variationID,value:f.variationID,onValueChange:e=>{y(!1),C({...f,variationID:e.slice(0,30)})},"data-testid":"variation-id-input"})})]}),(0,i.jsxs)(n.kX,{children:[(0,i.jsx)(n.PO,{size:"medium"}),(0,i.jsx)(n._d,{size:"medium",loading:c,disabled:Object.keys(b).length>0,children:"Convert"})]})]})})})]})},ef=(e,t)=>{let l={};e.libraryID||(l.libraryID="Cannot be empty.");let i=t.find(t=>t.path===e.libraryID);l.libraryID||i||(l.libraryID="Does not exist."),e.sliceID||(l.sliceID="Cannot be empty.");let n=null==i?void 0:i.components.find(t=>t.model.id===e.sliceID);if(l.sliceID||n||(l.sliceID="Does not exist."),e.variationName||(l.variationName="Cannot be empty."),e.variationID){var a;(null!==(a=null==n?void 0:n.model.variations.map(e=>e.id))&&void 0!==a?a:[]).includes(e.variationID)&&(l.variationID="Slice variation ID is already taken.")}else l.variationID="Cannot be empty.";return l},ej=e=>{var t,l;let{isOpen:a,close:r,onSubmit:o,isLoading:c,identicalSlices:d}=e,u=null!==(l=null===(t=d[0])||void 0===t?void 0:t.path)&&void 0!==l?l:"",[m,x]=(0,s.useState)(u),[h,v]=(0,s.useState)();return(0,p.pQ)(a,()=>{a||(x(u),v(void 0))}),(0,i.jsxs)(n.Vq,{open:a,onOpenChange:e=>!e&&r(),size:{width:448,height:"auto"},children:[(0,i.jsx)(n.fK,{title:"Merge with an existing slice"}),(0,i.jsx)(n.cZ,{children:(0,i.jsx)(n.l0,{onSubmit:function(){if(h)return;let[e,t,l]=m.split("::");o({libraryID:e,sliceID:t,variationID:l})},children:(0,i.jsxs)(n.xu,{display:"flex",flexDirection:"column",children:[(0,i.jsxs)(n.xr,{className:ex().scrollArea,children:[(0,i.jsx)(n.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)(n.xu,{display:"flex",flexDirection:"column",gap:4,children:[(0,i.jsxs)("label",{className:ex().label,children:[(0,i.jsx)(n.xv,{variant:"bold",children:"Target slice*"}),"string"==typeof h?(0,i.jsx)(n.xv,{variant:"small",color:"tomato10",children:h}):null]}),(0,i.jsx)(n.Ph,{size:"medium",color:"grey",startIcon:"viewDay",flexContent:!0,value:m,onValueChange:function(e){x(e),e||v("Cannot be empty.")},children:d.map(e=>(0,i.jsx)(n.Ql,{value:e.path,children:e.path.split("::").join(" > ")},e.path))}),(0,i.jsx)(n.xv,{variant:"normal",color:"grey11",children:"Choose a slice that you would like to merge this into."})]})]}),(0,i.jsxs)(n.kX,{children:[(0,i.jsx)(n.PO,{size:"medium"}),(0,i.jsx)(n._d,{size:"medium",loading:c,disabled:!!h,children:"Merge"})]})]})})})]})},eb=e=>{var t;let{slice:l,path:a}=e,{refreshState:r}=(0,j.Z)(),[o,d]=(0,s.useState)(!1),[u,m]=(0,s.useState)(),{setCustomType:x}=S(),{libraries:h}=(0,c.v9)(e=>({libraries:(0,ei.Sd)(e)})),p="Slice"===l.value.type&&null!==(t=l.value.fieldset)&&void 0!==t?t:l.key,y=h.filter(e=>e.isLocal),f=y.map(e=>e.components).flat(),b=eg(l,p,f),g=async e=>{var t,i,n;if(!u)return;d(!0),v.Xe.track({event:"legacy-slice:converted",id:e.sliceID,variation:null!==(t=e.variationID)&&void 0!==t?t:"default",library:e.libraryID,conversionType:u});let{errors:o}=await J.managerClient.slices.convertLegacySliceToSharedSlice({model:l.value,src:{...a,sliceID:l.key},dest:{libraryID:e.libraryID,sliceID:e.sliceID,variationName:null!==(i=e.variationName)&&void 0!==i?i:"Default",variationID:null!==(n=e.variationID)&&void 0!==n?n:"default"}});if(o.length)throw console.error("Could not convert slice `".concat(p,"`"),o),L.Am.error("Could not convert slice `".concat(p,"`")),o;let{model:s,errors:c}=await J.managerClient.customTypes.readCustomType({id:a.customTypeID});if(c.length||!s){console.error("Could not refresh custom type view `".concat(a.customTypeID,"`"),c),L.Am.error("Could not refresh custom type view `".concat(a.customTypeID,"`"));return}switch(r(await (0,v.y0)()),d(!1),m(void 0),u){case"as_new_slice":L.Am.success("".concat(p," has been upgraded to a new slice ").concat(e.libraryID," > ").concat(e.sliceID));break;case"as_new_variation":L.Am.success("".concat(p," has been converted as a variation of ").concat(e.libraryID," > ").concat(e.sliceID));break;default:L.Am.success("".concat(p," has been merged with ").concat(e.libraryID," > ").concat(e.sliceID))}x(s)},C={path:a,slice:l,sliceName:p,libraries:y,localSharedSlices:f,identicalSlices:b,close:()=>m(void 0),onSubmit:g,isLoading:o};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(n.h_,{children:[(0,i.jsx)(n.$F,{children:(0,i.jsx)(n.zx,{"data-testid":"convert-legacy-slice",startIcon:"refresh",endIcon:"arrowDropDown",size:"medium",color:"grey",children:"Migrate legacy slice"})}),(0,i.jsxs)(n.AW,{align:"start",children:[(0,i.jsx)(n.Xi,{startIcon:(0,i.jsx)(n.I5,{name:"folder",size:"large"}),description:"Use it with new types",onSelect:()=>m("as_new_slice"),children:"Upgrade slice"}),(0,i.jsx)(n.Xi,{startIcon:(0,i.jsx)(n.I5,{name:"viewDay",size:"large"}),description:"Add it to another slice",onSelect:()=>m("as_new_variation"),disabled:!f.length,children:"Convert to slice variation"}),(0,i.jsx)(n.Xi,{startIcon:(0,i.jsx)(n.I5,{name:"driveFileMove",size:"large"}),description:"Combine identical slices",onSelect:()=>m("merge_with_identical"),disabled:!b.length,children:"Merge with another slice"})]})]}),(0,i.jsx)(eh,{...C,isOpen:"as_new_slice"===u}),(0,i.jsx)(ey,{...C,isOpen:"as_new_variation"===u}),(0,i.jsx)(ej,{...C,isOpen:"merge_with_identical"===u})]})},eg=(e,t,l)=>(0,s.useMemo)(()=>{let i=[],n=(0,ed.ux)(e.value,t);for(let e of l)for(let t of e.model.variations){let l=(0,ed.ux)(t,e.model.name);n.primary===l.primary&&n.items===l.items&&i.push({libraryID:e.from,sliceID:e.model.id,variationID:t.id,path:"".concat(e.from,"::").concat(e.model.id,"::").concat(t.id)})}return i},[e,t,l]),eC=e=>{let{slice:t,path:l}=e,[a]=(0,es.E)("legacySliceUpgrader"),r=a.enabled?"This Slice was created with the Legacy Builder. It needs to be converted first to be used within Slice Machine.":"This Slice was created with the Legacy Builder, and is incompatible with Slice Machine. You cannot edit, push, or delete it in Slice Machine. In order to proceed, manually remove the Slice from your type model. Then create a new Slice with the same fields using Slice Machine.";return(0,i.jsxs)(ec.Zb,{children:[(0,i.jsx)(ec.ZB,{component:"div",children:(0,i.jsx)(n.xu,{alignItems:"center",justifyContent:"center",children:(0,i.jsx)(n.xv,{color:"grey11",component:"span",children:"No screenshot available"})})}),(0,i.jsxs)(ec.T$,{children:[(0,i.jsx)(n.u,{content:r,side:"bottom",children:(0,i.jsx)(n.Ct,{color:"purple",title:"Legacy Slice"})}),a.enabled?(0,i.jsx)(eb,{slice:t,path:l}):null]}),(0,i.jsx)(ec.eW,{subtitle:"1 variation",title:(0,ed.Dj)(t.value)})]})};var eS=l(53850),eI=l(42849);let ew=e=>{let{slices:t,format:l,path:n,onRemoveSharedSlice:a}=e,r=t.some(e=>"SharedSlice"!==e.type),o=b.$[l],[c]=(0,es.E)("legacySliceUpgrader");return(0,s.useEffect)(()=>{r&&(c.enabled?L.Am.info("This ".concat(o.name({start:!1,plural:!1})," contains legacy slices that can be upgraded.")):L.Am.warning("This ".concat(o.name({start:!1,plural:!1})," contains slices that are incompatible.")))},[r]),(0,i.jsx)(eI.Z,{elems:t,defineElementKey:e=>"SharedSlice"!==e.type?e.payload.key:e.payload.model.name,renderElem:e=>{if("SharedSlice"!==e.type){let t=e.payload;return(0,i.jsx)(eC,{slice:t,path:n})}{let t=e.payload;return(0,i.jsx)(eS.b,{action:{type:"remove",onRemove:()=>{a(t.model.id)}},mode:"navigation",slice:t,variant:"solid"})}},sx:{padding:"16px"}})};async function eT(e){try{let{templateIDs:t,localLibrariesNames:l,onSuccess:i}=e,{data:n,errors:a}=await J.managerClient.sliceTemplateLibrary.createSlices({templateIDs:t});if(a.length>0||void 0===n)throw a;n.sliceIDs.forEach((e,i)=>{v.Xe.track({event:"slice:created",id:e,name:e,library:l[0],sliceTemplate:t[i]})}),await i(n.sliceIDs)}catch(t){let e="Internal Error: Slice(s) not created";console.error(e,t),L.Am.error(e)}}var ek=l(80410);let e_=[{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"}}}];var eD=e=>{let{availableSlices:t,values:l,placeholderSlices:n}=e;return(0,i.jsx)(N.F2,{name:"sliceKeys",render:e=>(0,i.jsx)(eI.Z,{gridTemplateMinPx:"200px",elems:t,defineElementKey:e=>"".concat(e.from,"-").concat(e.model.name),renderElem:t=>{var a;let r=null!==(a=null==n?void 0:n.some(e=>e.model.id===t.model.id))&&void 0!==a&&a,o=l.sliceKeys.includes(t.model.id);return(0,i.jsx)(eS.b,{action:{type:"checkbox"},isComingSoon:r,mode:"selection",onSelectedChange:i=>{i?e.push(t.model.id):e.remove(l.sliceKeys.indexOf(t.model.id))},selected:o,slice:t,variant:"outlined"})}})})};let eN=e=>{let{formId:t,close:l,onSuccess:n,availableSlicesTemplates:a,localLibraries:r}=e,{createSliceSuccess:o}=(0,j.Z)();return(0,i.jsx)(D.Z,{isOpen:!0,buttonLabel:"Add",formId:t,close:l,onSubmit:e=>{let{sliceKeys:t}=e;eT({templateIDs:t,localLibrariesNames:r.map(e=>e.name),onSuccess:async e=>{o((await (0,v.y0)()).libraries),n(await Promise.all(e.map(async e=>(await J.managerClient.slices.readSlice({libraryID:r[0].name,sliceID:e})).model).filter(e=>void 0!==e)))}})},initialValues:{sliceKeys:[]},content:{title:"Use template slices"},validate:e=>{if(0===e.sliceKeys.length)return{sliceKeys:"Select at least one template to add"}},actionMessage:e=>{let{errors:t}=e;return void 0!==t.sliceKeys?(0,i.jsx)(A.xv,{sx:{color:"error"},children:t.sliceKeys}):void 0},children:e=>{let{values:t}=e;return(0,i.jsx)(eD,{values:t,placeholderSlices:e_,availableSlices:[...a.map(e=>({extension:"",fileName:"",from:"",href:"",pathToSlice:"",model:ek.id.toSM(e.model),screenshots:Object.entries(e.screenshots).reduce((e,t)=>({...e,[t[0]]:{url:t[1]}}),{})})),...e_]})}})};var eA=e=>{let{formId:t,close:l,onSubmit:n,availableSlices:a}=e;return(0,i.jsx)(D.Z,{isOpen:!0,buttonLabel:"Add",formId:t,close:l,onSubmit:e=>{let{sliceKeys:t}=e;n(t.map(e=>{var t;return null===(t=a.find(t=>t.model.id===e))||void 0===t?void 0:t.model}).filter(e=>void 0!==e))},initialValues:{sliceKeys:[]},content:{title:"Select existing slices"},testId:"update-slices-modal",validate:e=>{if(0===e.sliceKeys.length)return{sliceKeys:"Select at least one slice to add"}},actionMessage:e=>{let{errors:t}=e;return void 0!==t.sliceKeys?(0,i.jsx)(A.xv,{sx:{color:"error"},children:t.sliceKeys}):void 0},children:e=>{let{values:t}=e;return(0,i.jsx)(eD,{values:t,availableSlices:a})}})};let eE=(e,t)=>{let l=(t||[]).reduce((e,t)=>[...e,...t.components],[]),{slicesInSliceZone:i,notFound:n}=e.value.reduce((e,t)=>{let{key:i,value:n}=t;if("SharedSlice"===n.type){let t=l.find(e=>e.model.id===i);return t?{...e,slicesInSliceZone:[...e.slicesInSliceZone,{type:"SharedSlice",payload:t}]}:{...e,notFound:[...e.notFound,{key:i}]}}return{...e,slicesInSliceZone:[...e.slicesInSliceZone,{type:"Slice",payload:{key:i,value:n}}]}},{slicesInSliceZone:[],notFound:[]});return{availableSlices:l,slicesInSliceZone:i,notFound:n}};var eM=e=>{var t;let{customType:l,onCreateSliceZone:a,onDeleteSliceZone:r,onRemoveSharedSlice:o,sliceZone:d,tabId:u}=e,m=(0,W.QT)(ee,[]),[x,h]=(0,s.useState)(!1),[p,y]=(0,s.useState)(!1),[f,j]=(0,s.useState)(!1),{remoteSlices:b,libraries:g}=(0,c.v9)(e=>({remoteSlices:(0,ei.sT)(e),libraries:(0,ei.Sd)(e),slices:(0,ei.xC)(e)})),{setCustomType:C}=S(),{completeStep:I}=(0,$.k)(),w=g.filter(e=>e.isLocal),{availableSlices:T,slicesInSliceZone:k,notFound:D}=(0,s.useMemo)(()=>d?eE(d,g):{availableSlices:[],slicesInSliceZone:[],notFound:[]},[d,g]),[N,A]=(0,s.useState)(!1);(0,s.useEffect)(()=>{(null==D?void 0:D.length)&&D.forEach(e=>{let{key:t}=e;o(t)})},[D]);let E=k.filter(e=>"SharedSlice"===e.type).map(e=>e.payload),M=T.filter(e=>!E.some(t=>t.model.id===e.model.id)),Z=()=>{y(!0)},z=()=>{j(!0)},V=()=>{h(!0),v.Xe.track({event:"custom-type:open-add-from-templates",customTypeId:l.id,customTypeFormat:l.format})},P=()=>{y(!1)},F=()=>{j(!1)},K=()=>{h(!1)};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(O.Bu,{actions:d?(0,i.jsxs)(n.h_,{children:[(0,i.jsx)(n.$F,{children:(0,i.jsx)(n.zx,{color:"purple",startIcon:"add","data-testid":"add-new-slice-dropdown",children:"Add"})}),(0,i.jsxs)(n.AW,{align:"end",children:[(0,i.jsx)(n.Xi,{startIcon:(0,i.jsx)(n.I5,{name:"add",size:"large"}),onSelect:z,description:"Start from scratch.",children:"Create new"}),m.length>0?(0,i.jsx)(n.Xi,{onSelect:V,startIcon:(0,i.jsx)(n.I5,{name:"contentCopy",size:"large"}),description:"Select from premade examples.",endAdornment:(0,i.jsx)(n.xv,{color:"inherit",component:"kbd",children:(0,i.jsx)(n.Ct,{color:"purple",title:"New"})}),children:"Use template"}):void 0,M.length>0?(0,i.jsx)(n.Xi,{onSelect:Z,startIcon:(0,i.jsx)(n.I5,{name:"folder",size:"large"}),description:"Select from your own slices.",children:"Select existing"}):void 0]})]}):void 0,toggle:"page"!==l.format||"Main"!==u?(0,i.jsx)(n.rs,{checked:!!d,onCheckedChange:e=>{e?a():A(!0)},size:"small","data-testid":"slice-zone-switch"}):void 0,children:"Slices"}),d?k.length>0?(0,i.jsx)(X.xR,{children:(0,i.jsx)(ew,{slices:k,format:l.format,path:{customTypeID:l.id,tabID:u,sliceZoneID:null!==(t=null==d?void 0:d.key)&&void 0!==t?t:""},onRemoveSharedSlice:o})}):(0,i.jsx)(Y,{openUpdateSliceZoneModal:Z,openCreateSliceModal:z,openSlicesTemplatesModal:V,projectHasAvailableSlices:M.length>0,isSlicesTemplatesSupported:m.length>0}):void 0,p&&(0,i.jsx)(eA,{formId:"tab-slicezone-form-".concat(u),availableSlices:M,onSubmit:e=>{let t=q({customType:l,tabId:u,slices:e});C(_.Dc.fromSM(t),()=>{L.Am.success("Slice(s) added to slice zone")}),I("createSlice"),P()},close:P}),x&&(0,i.jsx)(eN,{formId:"tab-slicezone-form-".concat(u),availableSlicesTemplates:m,localLibraries:w,onSuccess:e=>{let t=q({customType:l,tabId:u,slices:e});C(_.Dc.fromSM(t),()=>{L.Am.success((0,i.jsx)(el.GX,{message:"Slice template(s) added to slice zone and created at: ",path:"".concat(w[0].name,"/")}))}),I("createSlice"),K()},close:K}),N&&(0,i.jsx)(eo,{closeDeleteSliceZoneModal:()=>{A(!1)},deleteSliceZone:()=>{r(),A(!1)}}),(null==w?void 0:w.length)!==0&&f&&(0,i.jsx)(et.c,{onSuccess:e=>{let t=q({customType:l,tabId:u,slices:[e]});C(_.Dc.fromSM(t),()=>{L.Am.success((0,i.jsx)(el.GX,{message:"New slice added to slice zone and created at: ",path:"".concat(w[0].name,"/")}))}),F()},localLibraries:w,remoteSlices:b,onClose:F})]})};let eZ=[F.C.UID,F.C.Image,F.C.Text,F.C.StructuredText,F.C.Link,F.C.Select,F.C.Boolean,F.C.Number,F.C.Color,F.C.Date,F.C.Embed,F.C.Timestamp,F.C.GeoPoint,F.C.ContentRelationship,F.C.LinkToMedia,F.C.Group,F.C.NestedGroup];var ez=e=>{var t,l,a,r;let{tabId:o}=e,{customType:c,setCustomType:d}=S(),m=_.Dc.toSM(c),x=null===(t=m.tabs.find(e=>e.key===o))||void 0===t?void 0:t.sliceZone,h=null!==(a=null===(l=m.tabs.find(e=>e.key===o))||void 0===l?void 0:l.value)&&void 0!==a?a:[],p="page"===m.format&&m.repeatable?h.filter(e=>"uid"!==e.key):h,y=m.tabs.reduce((e,t)=>[...e,...t.value],[]),f=e=>{var t,l;let{apiId:i,value:n}=e,a=null===(t=n.config)||void 0===t?void 0:t.label;if((0,K.Ss)(F.C,n.type)||null==a)return;if("Range"===n.type||"IntegrationFields"===n.type||"Separator"===n.type)throw Error("Unsupported Field Type: ".concat(n.type));let r=F.C[n.type];try{r.schema.validateSync(n,{stripUnknown:!1})}catch(e){throw Error('Add field: Model is invalid for field "'.concat(n.type,'".'))}let s=_.L$.fromSM(n);d((0,u.xS)({customType:c,newField:s,newFieldId:i,sectionId:o}),()=>{L.Am.success("".concat("Group"===n.type?"Group":"Field"," added"))}),v.Xe.track({event:"field:added",id:i,name:a,type:s.type,isInAGroup:!1,contentType:(0,R.T)(window.location.pathname),..."Link"===s.type&&{allowText:null===(l=s.config)||void 0===l?void 0:l.allowText}})},j=e=>{let{apiId:t,newKey:l,value:i,isNewGroupField:n}=e;if((0,K.Ss)(F.C,i.type))return;let a=_.L$.fromSM(i);d((0,u.L4)({customType:c,previousFieldId:t,newFieldId:l,newField:a,sectionId:o}),()=>{!0===n&&L.Am.success("Field added")})};return(0,i.jsx)(P.S,{children:(0,i.jsx)(s.Suspense,{fallback:(0,i.jsx)(n.xu,{padding:32,children:(0,i.jsx)(n._3,{})}),children:(0,i.jsxs)(O.aV,{border:!1,style:{flexGrow:1},children:[(0,i.jsx)(B.Z,{zoneType:"customType",zoneTypeFormat:null!==(r=c.format)&&void 0!==r?r:"custom",tabId:o,title:"Static zone",dataTip:"",fields:p,poolOfFieldsToCheck:y,showHints:!0,EditModal:U.Z,widgetsArray:eZ,onDeleteItem:e=>{d((0,u.AK)({customType:c,fieldId:e,sectionId:o}))},onSave:e=>""===e.apiId?f({...e,apiId:e.newKey}):j(e),onDragEnd:e=>{if((0,K.uS)(e))return;let{source:t,destination:l}=e;if(!l)return;let i=(0,u.gR)({customType:c,sourceIndex:t.index,destinationIndex:l.index,sectionId:o});(0,V.flushSync)(()=>d(i))},renderHintBase:e=>{let{item:t}=e;return"data".concat((0,H.Ti)(t.key))},renderFieldAccessor:e=>"data".concat((0,H.Ti)(e)),testId:"static-zone-content",isRepeatableCustomType:c.repeatable}),(0,i.jsx)(eM,{customType:m,tabId:o,sliceZone:x,onRemoveSharedSlice:e=>{d((0,u.EN)({customType:c,sectionId:o,sliceId:e}))},onCreateSliceZone:()=>{d((0,u.Tr)(c,o))},onDeleteSliceZone:()=>{d((0,u.E3)(c,o))}})]})})})};let eV=()=>{var e,t,l;let{customType:a,setCustomType:r}=S(),o=_.Dc.toSM(a),[c,d]=(0,s.useState)(null===(e=o.tabs[0])||void 0===e?void 0:e.key),[m,x]=(0,s.useState)(),h=(null===(l=o.tabs.find(e=>e.key===c))||void 0===l?void 0:null===(t=l.sliceZone)||void 0===t?void 0:t.value.length)===0;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(n.Rz,{sx:h?{flexGrow:1}:void 0,children:["page"===a.format?(0,i.jsx)(n.py,{title:a.repeatable?(0,i.jsx)(w,{}):void 0}):void 0,(0,i.jsxs)(n.KC,{onValueChange:d,value:c,children:[(0,i.jsx)(n.mY,{onAddNewTab:()=>{x({type:"CREATE_CUSTOM_TYPE_TAB"})},children:o.tabs.map(e=>(0,i.jsx)(n.wf,{menu:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.Xi,{onSelect:()=>{x({type:"UPDATE_CUSTOM_TYPE_TAB",tabKey:e.key})},startIcon:(0,i.jsx)(n.I5,{name:"edit"}),children:"Rename"}),(0,i.jsx)(n.Xi,{color:"tomato",disabled:function(e){if(o.tabs.length<=1)return!0;let t=o.tabs.find(e=>e.value.find(e=>"uid"===e.key));return"page"===a.format&&a.repeatable&&(null==t?void 0:t.key)===e}(e.key),onSelect:()=>{x({type:"DELETE_CUSTOM_TYPE_TAB",tabKey:e.key})},startIcon:(0,i.jsx)(n.I5,{name:"delete"}),children:"Remove"})]}),value:e.key,children:e.key},e.key))}),o.tabs.map(e=>(0,i.jsx)(n.e$,{value:e.key,children:(0,i.jsx)(ez,{tabId:e.key})},e.key))]})]}),(null==m?void 0:m.type)==="CREATE_CUSTOM_TYPE_TAB"?(0,i.jsx)(M,{close:()=>{x(void 0)},isOpen:!0,onSubmit:e=>{let{id:t}=e;r((0,u.vB)(a,t)),d(t)},tabIds:o.tabs.map(e=>e.key.toLowerCase())}):void 0,(null==m?void 0:m.type)==="UPDATE_CUSTOM_TYPE_TAB"?(0,i.jsx)(z,{close:()=>{x(void 0)},initialTabKey:m.tabKey,isOpen:!0,onSubmit:e=>{let{id:t}=e;r((0,u.HO)(a,m.tabKey,t)),c===m.tabKey&&d(t)},tabIds:o.tabs.filter(e=>e.key!==m.tabKey).map(e=>e.key.toLowerCase())}):void 0,(null==m?void 0:m.type)==="DELETE_CUSTOM_TYPE_TAB"?(0,i.jsx)(Z,{close:()=>{x(void 0)},isOpen:!0,onSubmit:()=>{if(r((0,u.F$)(a,m.tabKey)),c===m.tabKey){var e;let t=null===(e=o.tabs.find(e=>e.key!==m.tabKey))||void 0===e?void 0:e.key;void 0!==t&&d(t)}}}):void 0]})};var eL=l(1744),eO=l(40572),eP=l(64910),eF=l(9975),eK=l(41329),eH=l.n(eK);let eR=e=>{let{tabs:t,...l}=e;return(0,i.jsxs)(eF.fC,{...l,className:eH().root,defaultValue:t[0].label,orientation:"vertical",children:[(0,i.jsx)(eF.aV,{className:eH().list,"aria-label":"content tabs",children:t.map((e,t)=>{let{label:l}=e;return(0,i.jsx)(eF.xz,{className:eH().trigger,value:l,children:(0,i.jsx)(n.xv,{className:eH().triggerText,component:"span",color:"inherit",children:l})},"".concat(l,"-trig").concat(t+1))})}),t.map((e,t)=>{let{label:l,content:a}=e;return(0,i.jsx)(eF.VY,{className:eH().content,value:l,children:(0,i.jsx)(n.xr,{className:eH().scrollArea,children:a})},"".concat(l,"-content").concat(t+1))})]})};var eU=l(11290),eB=l(88241),eX=l(58133),eG=l(37628),eQ=l.n(eG);let eY=e=>{var t,l;let{inline:a,...r}=e,o=(0,eX.p)();if(!0===a)return(0,i.jsx)("code",{...r,className:eQ().inlineCode});let s=(()=>{var e,t,l,i,n;if((null===(t=r.node)||void 0===t?void 0:null===(e=t.data)||void 0===e?void 0:e.meta)!==void 0){let e=null===(i=r.node)||void 0===i?void 0:null===(l=i.data)||void 0===l?void 0:l.meta;return{fileName:e.substring(1,e.length-1),language:null===(n=r.className)||void 0===n?void 0:n.split("-")[1]}}return null})(),c=null===(t=/language-(\w+)/.exec(null!==(l=r.className)&&void 0!==l?l:""))||void 0===t?void 0:t[1];return(0,i.jsx)(n.dn,{...r,onCopy:()=>{v.Xe.track({event:"page-type:copy-snippet",framework:o})},language:c,code:String(r.children).replace(/\n$/,""),title:null==s?void 0:s.fileName})},e$=e=>{let{markdown:t}=e;return(0,i.jsx)(eU.D,{children:t,linkTarget:"_blank",remarkPlugins:[eB.Z],components:{code:e=>(0,i.jsx)(eY,{...e}),h1:e=>(0,i.jsx)(n.xv,{children:e.children,component:"h1",variant:"h1"}),h2:e=>(0,i.jsx)(n.xv,{children:e.children,component:"h2",variant:"h2"}),h3:e=>(0,i.jsx)(n.xv,{children:e.children,component:"h3",variant:"h3"}),h4:e=>(0,i.jsx)(n.xv,{children:e.children,component:"h4",variant:"h4"}),h5:e=>(0,i.jsx)(n.xv,{children:e.children,component:"h4",variant:"h4"}),p:e=>(0,i.jsx)(n.xv,{className:eQ().section,children:e.children,component:"p",variant:"normal"}),pre:e=>(0,i.jsx)(n.xv,{className:eQ().section,children:e.children,component:"pre",variant:"normal"})}})};async function eq(e){let t=JSON.parse(e),{errors:l,documentation:i}=await J.managerClient.documentation.read({kind:t.kind,data:t.data});if(l.length>0)throw l;return i}var eW=l(83321),eJ=l.n(eW);let e0=e=>{var t;let{model:l}=e,a=(0,eX.p)(),r=(t={kind:"PageSnippet",data:{model:l}},(0,W.QT)(eq,[JSON.stringify(t)])),{completeStep:o}=(0,$.k)();return 0===r.length?null:(0,i.jsxs)(n.Vq,{size:"small",trigger:(0,i.jsx)(n.zx,{color:"grey",onClick:()=>{o("codePage"),v.Xe.track({event:"page-type:open-snippet",framework:a})},startIcon:"code",children:"Page snippet"}),children:[(0,i.jsx)(n.fK,{icon:"code",title:"Page snippet"}),(0,i.jsx)("section",{className:eJ().content,children:r.length>1?(0,i.jsx)(eR,{style:{flex:1},tabs:r.map((e,t)=>{let{label:l,content:n}=e;return{label:null!=l?l:"Tab ".concat(t+1),content:(0,i.jsx)(e$,{markdown:n})}})}):(0,i.jsx)(n.xr,{style:{flex:1,padding:16},children:(0,i.jsx)(e$,{markdown:r[0].content})})})]})},e1=e=>{let{model:t}=e;return(0,i.jsx)("div",{children:(0,i.jsx)(P.S,{children:(0,i.jsx)(s.Suspense,{fallback:(0,i.jsx)(n.zx,{color:"grey",startIcon:"code",children:"Page snippet"}),children:(0,i.jsx)(e0,{model:t})})})})},e4=()=>{let e=(0,o.useRouter)(),{selectedCustomType:t}=(0,c.v9)(t=>({selectedCustomType:(0,eO.Jk)(t,(0,x.Ag)(e.query))}));return((0,s.useEffect)(()=>{t&&(0,eL.TG)(t)||e.replace("/")},[t,e]),t&&(0,eL.TG)(t))?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r(),{children:(0,i.jsxs)("title",{children:[t.local.label," - Slice Machine"]})}),(0,i.jsx)(e5,{customType:t.local})]}):(0,i.jsx)(h.LN,{})},e5=e=>{let{customType:t}=e;return null===t?(0,i.jsx)(h.LN,{}):(0,i.jsx)(h.LN,{children:(0,i.jsx)(C,{initialCustomType:_.Dc.fromSM(t),children:e=>{var l;let{actionQueueStatus:a,customType:r,setCustomType:o}=e,s=(0,u.y6)(r),c=x.cd[t.format],p=b.$[t.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:p.name({start:!0,plural:!0})}),(0,i.jsx)(d.g,{active:!0,children:null!==(l=r.label)&&void 0!==l?l:r.id})]}),(0,i.jsxs)(h.K2,{children:[(0,i.jsx)(m.X,{status:a}),"page"===r.format?(0,i.jsx)(e1,{model:r}):void 0,(0,i.jsx)(eP._,{isChangesLocal:!0,format:s,customType:r,setLocalCustomType:o})]})]}),(0,i.jsx)(h.RN,{children:(0,i.jsx)(n.xu,{flexDirection:"column",minWidth:0,children:(0,i.jsx)(eV,{})})})]})}})})}},61502:function(e,t,l){"use strict";l.d(t,{E:function(){return n}});var i=l(29806);function n(e){var t,l;let[n,a]=(0,i.f)(),r=async t=>{let l={...n,labs:{...n.labs}};t?l.labs[e]=t:e in l.labs&&delete l.labs[e],0===Object.keys(l.labs).length&&delete l.labs,await a(l)};return[{enabled:null!==(l=null==n?void 0:null===(t=n.labs)||void 0===t?void 0:t[e])&&void 0!==l&&l},r]}},29806:function(e,t,l){"use strict";l.d(t,{f:function(){return a}});var i=l(18566),n=l(70647);function a(){return[(0,i.QT)(r,[]),async e=>{await n.managerClient.project.writeSliceMachineConfig({config:e}),(0,i.VA)(r,[],e)}]}async function r(){return n.managerClient.project.getSliceMachineConfig()}},17889:function(e,t,l){"use strict";l.d(t,{c:function(){return j}});var i=l(52322),n=l(2784),a=l(36131),r=l(75289),o=l(93188),s=l(65856),c=l(88932),d=l(3181),u=l(99510),m=l(70647);async function x(e){let{sliceName:t,libraryName:l,onSuccess:i}=e;try{let e=(0,d.fo)(t),{errors:n}=await m.managerClient.slices.createSlice({libraryID:l,model:e});if(n.length>0)throw n;o.Xe.track({event:"slice:created",id:(0,u.MP)(t),name:t,library:l}),await i(e)}catch(l){let e="An unexpected error happened while creating slice ".concat(t,".");console.error(e,l),c.Am.error(e)}}var h=l(80546),p=l(1490),v=l(41067),y=l(28801),f=l(99923);let j=e=>{let{onClose:t,onSuccess:l,localLibraries:c,remoteSlices:d}=e,{createSliceSuccess:u}=(0,v.Z)(),[m,j]=(0,n.useState)(!1),{syncChanges:b}=(0,h.g)(),{completeStep:g}=(0,s.k)(),C=async e=>{let t=e.sliceName,i=e.from;j(!0),await x({sliceName:t,libraryName:i,onSuccess:async e=>{u((await (0,o.y0)()).libraries),l(e,i),b(),g("createSlice")}})};return(0,i.jsx)(p.Z,{testId:"create-slice-modal",isOpen:!0,widthInPx:"530px",isLoading:m,formId:"create-new-slice",close:t,buttonLabel:"Create",onSubmit:e=>{C(e)},initialValues:{sliceName:"",from:c[0].name},validate:e=>(0,f.h)(e,c,d),content:{title:"Create a new slice"},children:e=>{let{touched:t,values:l,setFieldValue:n,errors:o}=e;return(0,i.jsxs)(r.xu,{children:[(0,i.jsx)(y.W,{name:"sliceName",label:"Slice Name",placeholder:"Pascalised Slice API ID (e.g. TextBlock)",error:t.sliceName?o.sliceName:void 0,testId:"slice-name-input"}),(0,i.jsx)(r.__,{htmlFor:"from",sx:{mb:2},children:"Target Library"}),(0,i.jsx)(a.ZP,{name:"from",options:c.map(e=>({value:e.name,label:e.name})),onChange:e=>e?void n("from",e.value):null,defaultValue:{value:l.from,label:l.from},styles:{option:e=>({...e,color:"#161618"})},theme:e=>({...e,colors:{...e.colors,primary:"#E9E8EA"}}),menuPortalTarget:document.body})]})}})}},99923:function(e,t,l){"use strict";l.d(t,{h:function(){return s}});var i=l(96009),n=l.n(i),a=l(74600),r=l.n(a),o=l(17186);function s(e,t,l){let{sliceName:i}=e;return i?o.xo.exec(i)?r()(n()(i)).replace(/\s/gm,"")!==i.trim()?{sliceName:"Value has to be PascalCased"}:i.match(/^\d/)?{sliceName:"Value cannot start with a number"}:o.lS.includes(i)?{sliceName:"".concat(i," is reserved for Slice Machine use")}:[...t.flatMap(e=>e.components.map(e=>e.model.name)),...l.map(e=>e.name)].includes(i)?{sliceName:"Slice name is already taken."}:void 0:{sliceName:"No special characters allowed"}:{sliceName:"Cannot be empty"}}},42849:function(e,t,l){"use strict";var i=l(52322),n=l(75289);t.Z=function(e){let{elems:t,renderElem:l,defineElementKey:a,gridTemplateMinPx:r="320px",gridGap:o="16px",sx:s}=e;return(0,i.jsx)(n.xu,{as:"section",sx:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(".concat(r,", 1fr))"),gridGap:o,pt:2,...s},children:t.map((e,t)=>e?(0,i.jsx)("span",{children:l(e,t)},"".concat(a(e),"-").concat(t+1)):null)})}},41329:function(e){e.exports={flex:"ContentTabs_flex__T21Oc",column:"ContentTabs_column__1f8b8 ContentTabs_flex__T21Oc",root:"ContentTabs_root__Gn3Zg ContentTabs_column__1f8b8 ContentTabs_flex__T21Oc",list:"ContentTabs_list__rAZtl ContentTabs_flex__T21Oc",trigger:"ContentTabs_trigger__cTyPN ContentTabs_column__1f8b8 ContentTabs_flex__T21Oc",triggerText:"ContentTabs_triggerText__p_ZBl",content:"ContentTabs_content__H1Stj ContentTabs_column__1f8b8 ContentTabs_flex__T21Oc",scrollArea:"ContentTabs_scrollArea__DuDcQ"}},83321:function(e){e.exports={content:"PageSnippetDialog_content__jIN6d"}},37628:function(e){e.exports={section:"MarkdownRenderer_section__uNS1M",inlineCode:"MarkdownRenderer_inlineCode__lmGTi"}},17766:function(e){e.exports={scrollArea:"ConvertLegacySliceButton_scrollArea__xf3vM",label:"ConvertLegacySliceButton_label__BK0Gd"}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[372],{28574:function(e,t,n){"use strict";n.d(t,{R$:function(){return s},Qj:function(){return f},T9:function(){return u},nf:function(){return m},u2:function(){return c},_T:function(){return d}});var r=n(52322),o=n(33760),i=n(6277),l=n(43217),a=n.n(l);let s=e=>{let{backgroundImage:t,style:n,...o}=e,l=void 0!==t;return(0,r.jsx)("article",{...o,className:(0,i.W)(a().root,{[a().withBackground]:l}),style:{backgroundImage:l?"url(".concat(t,")"):void 0,...n}})},c=e=>(0,r.jsx)("div",{...e,className:a().image}),u=e=>(0,r.jsx)("div",{...e,className:a().content}),d=e=>(0,r.jsx)(o.xv,{...e,variant:"h3"}),m=e=>(0,r.jsx)(o.xv,{...e,color:"grey11"}),f=e=>(0,r.jsx)("div",{...e,className:a().actions,color:"grey"})},93216:function(e,t,n){"use strict";n.d(t,{AK:function(){return v},E3:function(){return m},EN:function(){return f},F$:function(){return h},H8:function(){return S},HO:function(){return y},L4:function(){return g},N3:function(){return c},Tr:function(){return d},Ue:function(){return I},eK:function(){return k},gR:function(){return b},j5:function(){return s},mf:function(){return p},vB:function(){return x},xS:function(){return j},y6:function(){return i}});var r=n(98863),o=n(88866);function i(e){var t;return null!==(t=e.format)&&void 0!==t?t:"custom"}function l(e){return Object.entries(e.json)}function a(e){return l(e).find(e=>{let[t,n]=e;return Object.values(n).some(e=>"UID"===e.type)})}function s(e){var t;let[n,r]=null!==(t=a(e))&&void 0!==t?t:[];return Object.entries(null!=r?r:{}).find(e=>{let[t,n]=e;return"UID"===n.type})}function c(e){var t,n;return null!==(n=null==e?void 0:null===(t=e.config)||void 0===t?void 0:t.label)&&void 0!==n?n:void 0}function u(e,t){let n=e.json[t];if(void 0!==n)return Object.entries(n).find(e=>{let[t,n]=e;return n.type===o.SlicesFieldType})}function d(e,t){if(function(e,t){var n;let r=u(e,t),[o,i]=null!=r?r:[];return null!==(n=null==i?void 0:i.config)&&void 0!==n?n:void 0}(e,t))return e;let n=function(e,t){let n;let r=l(e),i=r.findIndex(e=>{let[n]=e;return n===t}),a=r.flatMap(e=>{let[t,n]=e;return Object.keys(n).filter(e=>n[e].type===o.SlicesFieldType)}),s=i;do n="slices".concat(0!==s?s.toString():""),s++;while(a.includes(n));return n}(e,t);return{...e,json:{...e.json,[t]:{...e.json[t],[n]:{type:o.SlicesFieldType,fieldset:"Slice Zone"}}}}}function m(e,t){let n=e.json[t];if(void 0===n)return e;let i=Object.keys(n).find(e=>n[e].type===o.SlicesFieldType);if(void 0===i)return e;let l=(0,r.ud)(n,i);return{...e,json:{...e.json,[t]:l}}}function f(e){var t,n;let{customType:i,sectionId:l,sliceId:a}=e,s=i.json[l];if(void 0===s)return i;let c=Object.keys(s).find(e=>s[e].type===o.SlicesFieldType);if(void 0===c)return i;let u=s[c];if(u.type!==o.SlicesFieldType)return i;let d=(0,r.ud)(null!==(n=null===(t=u.config)||void 0===t?void 0:t.choices)&&void 0!==n?n:{},a);return{...i,json:{...i.json,[l]:{...s,[c]:{...u,config:{...u.config,choices:d}}}}}}function p(e){let t={...e,format:"page"},n=l(e)[0];if(n){let[e]=n;t=d(t,e)}return t}function x(e,t){return{...e,json:{...e.json,[t]:{}}}}function h(e,t){let n=(0,r.ud)(e.json,t);return{...e,json:n}}function y(e,t,n){if(t===n)return e;let r=Object.keys(e.json).reduce((r,o)=>(o===t?r[n]=e.json[o]:r[o]=e.json[o],r),{});return{...e,json:r}}function j(e){let{customType:t,sectionId:n,newField:r,newFieldId:i}=e,l=t.json[n],a=u(t,n),s={...Object.fromEntries(Object.entries(l).filter(e=>{let[t,n]=e;return n.type!==o.SlicesFieldType})),[i]:r};if(void 0!==a){let[e,t]=a;s[e]=t}return _({customType:t,sectionId:n,updatedSection:s})}function v(e){let{customType:t,sectionId:n,fieldId:o}=e,i=(0,r.ud)(t.json[n],o);return _({customType:t,sectionId:n,updatedSection:i})}function g(e){let{customType:t,sectionId:n,previousFieldId:r,newFieldId:o,newField:i}=e,l=C({fields:t.json[n],previousFieldId:r,newFieldId:o,newField:i});return _({customType:t,sectionId:n,updatedSection:l})}function b(e){let{customType:t,sectionId:n,sourceIndex:r,destinationIndex:i}=e,l=t.json[n],a=u(t,n),s=function(e){let{fields:t,sourceIndex:n,destinationIndex:r}=e,o=Object.entries(t),[i]=o.splice(n,1);return o.splice(r,0,i),Object.fromEntries(o)}({fields:Object.fromEntries(Object.entries(l).filter(e=>{let[t,n]=e;return n.type!==o.SlicesFieldType})),sourceIndex:r,destinationIndex:i});if(void 0!==a){let[e,t]=a;s[e]=t}return _({customType:t,sectionId:n,updatedSection:s})}function S(e,t){let n=l(t)[0],[r]=null!=n?n:[];return void 0===r?t:j({customType:t,sectionId:r,newField:{type:"UID",config:{label:e}},newFieldId:"uid"})}function k(e,t){var n,r;let[o]=null!==(n=a(t))&&void 0!==n?n:[],[i,l]=null!==(r=s(t))&&void 0!==r?r:[];if(!l||void 0===i||void 0===o)return t;let c=C({fields:t.json[o],previousFieldId:i,newFieldId:i,newField:{...l,config:{...l.config,label:e}}});return _({customType:t,sectionId:o,updatedSection:c})}function _(e){let{customType:t,sectionId:n,updatedSection:r}=e;return{...t,json:{...t.json,[n]:r}}}function C(e){let{fields:t,previousFieldId:n,newFieldId:r,newField:o}=e;return Object.entries(t).reduce((e,t)=>{let[i,l]=t;return i===n?e[r]=o:i!==r&&(e[i]=l),e},{})}function I(e){let{id:t,label:n,repeatable:r,format:o}=e,i=!1===r&&"page"===o?{...T,...B}:!1===r?w:"page"===o?{...F,...B}:O;return{format:o,id:t,json:i,label:n,repeatable:r,status:!0}}let w={Main:{}},T={Main:{slices:{config:{choices:{}},fieldset:"Slice Zone",type:"Slices"}}},O={Main:{uid:{type:"UID",config:{label:"UID"}}}},F={Main:{...O.Main,...T.Main}},B={"SEO & Metadata":{meta_title:{config:{label:"Meta Title",placeholder:"A title of the page used for social media and search engines"},type:"Text"},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"}}}},64910:function(e,t,n){"use strict";n.d(t,{_:function(){return F}});var r=n(52322),o=n(33760),i=n(5632),l=n(2784),a=n(65186),s=n(59326),c=n(75289),u=n(88932),d=n(70647),m=n(77507);async function f(e){let{customType:t,onSuccess:n}=e,r=m.$[t.format];try{let{errors:e}=await d.managerClient.customTypes.deleteCustomType({id:t.id});if(e.length>0)throw e;n(),u.Am.success("".concat(r.name({start:!0,plural:!1})," deleted"))}catch(t){let e="Internal Error: ".concat(r.name({start:!0,plural:!1})," could not be deleted");console.error(e,t),u.Am.error(e)}}var p=n(47861),x=n(76805),h=n(11104),y=n(41067);let j=e=>{var t;let{customType:n,format:o,onClose:i,onDeleteCustomTypeSuccess:u}=e,d=m.$[o],[j,v]=(0,l.useState)(!1),{deleteCustomTypeSuccess:g}=(0,y.Z)(),b=async()=>{v(!0),await f({customType:n,onSuccess:()=>g(n.id)}),u()},{theme:S}=(0,s.B7)();return(0,r.jsx)(h.Z,{isOpen:!0,shouldCloseOnOverlayClick:!0,style:{content:{maxWidth:612}},onRequestClose:()=>i(),children:(0,r.jsx)(x.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:(0,r.jsxs)(c.kC,{sx:{position:"sticky",top:0,zIndex:1,p:"16px",alignItems:"center",justifyContent:"space-between",borderBottom:e=>{var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.borders))}},children:[(0,r.jsxs)(c.kC,{sx:{alignItems:"center"},children:[(0,r.jsx)(a.$vK,{size:20,color:null===(t=S.colors)||void 0===t?void 0:t.greyIcon}),(0,r.jsxs)(c.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:["Delete"," ",d.name({start:!1,plural:!1})]})]}),(0,r.jsx)(c.x8,{type:"button",onClick:()=>i()})]}),Footer:()=>(0,r.jsxs)(c.kC,{sx:{justifyContent:"flex-end",height:64,alignItems:"center",paddingRight:16,borderTop:e=>{var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.darkBorders))},backgroundColor:"gray"},children:[(0,r.jsx)(p.z,{label:"Cancel",variant:"secondary",onClick:()=>i(),sx:{mr:"10px",fontWeight:"bold",color:"grey12",borderRadius:6}}),void 0!==n&&(0,r.jsx)(p.z,{label:"Delete",variant:"danger",isLoading:j,onClick:()=>void b(),sx:{minHeight:39,minWidth:78}})]}),children:(0,r.jsxs)("div",{children:["This action will immediately make the following change:",(0,r.jsx)("ul",{children:(0,r.jsxs)("li",{children:["Delete the"," ",(0,r.jsxs)(c.xv,{sx:{fontWeight:"bold"},children:["customtypes/",null==n?void 0:n.id,"/"]})," ","directory."]})}),"The next time you push your changes to Prismic, the following change will happen:",(0,r.jsx)("ul",{children:(0,r.jsxs)("li",{children:["Remove the"," ",d.name({start:!1,plural:!1})," and any associated Documents from your repository."]})})]})})})};var v=n(56580);async function g(e){let{model:t,newLabel:n,onSuccess:r}=e,o=m.$[t.format];try{let e={...t,label:n},{errors:i}=await d.managerClient.customTypes.renameCustomType({model:e});if(i.length>0)throw i;r(e),u.Am.success("".concat(o.name({start:!0,plural:!1})," renamed"))}catch(t){let e="Internal Error: ".concat(o.name({start:!0,plural:!1})," could not be renamed");console.error(e,t),u.Am.error(e)}}var b=n(80546),S=n(40572),k=n(1490),_=n(28801);let C=e=>{var t,n;let{isChangesLocal:o,customType:i,format:a,onClose:s,setLocalCustomType:u}=e,d=null!==(t=null==i?void 0:i.label)&&void 0!==t?t:"",f=null!==(n=null==i?void 0:i.id)&&void 0!==n?n:"",{renameCustomTypeSuccess:p}=(0,y.Z)(),{syncChanges:x}=(0,b.g)(),[h,j]=(0,l.useState)(!1),C=async e=>{j(!0),o&&u?u({...i,label:e.customTypeName}):await g({model:i,newLabel:e.customTypeName,onSuccess:e=>{p(e),x()}}),j(!1),s()},{customTypeLabels:I}=(0,v.v9)(e=>({customTypeLabels:(0,S.YS)(e)})),w=m.$[a];return(0,r.jsx)(k.Z,{isOpen:!0,testId:"rename-custom-type-modal",widthInPx:"530px",formId:"rename-custom-type-modal-".concat(f),buttonLabel:"Rename",close:s,onSubmit:e=>void C(e),initialValues:{customTypeName:d},isLoading:h,content:{title:"Rename a ".concat(w.name({start:!1,plural:!1}))},validate:e=>{let{customTypeName:t}=e,n={};return t&&t.length||(n.customTypeName="Cannot be empty."),void 0!=n.customTypeName&&I.includes(t)&&d!==t&&(n.customTypeName="".concat(w.name({start:!0,plural:!1})," name is already taken.")),Object.keys(n).length>0?n:void 0},children:e=>{let{errors:t}=e;return(0,r.jsx)(c.xu,{children:(0,r.jsx)(_.W,{name:"customTypeName",label:"".concat(w.name({start:!0,plural:!1})," Name"),placeholder:"A display name for the ".concat(w.name({start:!1,plural:!1})),error:t.customTypeName,testId:"custom-type-name-input"})})}})};var I=n(93188),w=n(93216);async function T(e,t){let n=m.$[e.format];try{let r=(0,w.mf)(e),{errors:o}=await (0,I.KA)(r);if(o.length>0)throw o;t(r),u.Am.success("".concat(n.name({start:!0,plural:!1})," converted to page type"))}catch(t){let e="Internal Error: ".concat(n.name({start:!0,plural:!1})," not converted to page type");console.error(e,t),u.Am.error(e)}}var O=n(63447);let F=e=>{let{format:t,customType:n,isChangesLocal:a,setLocalCustomType:s}=e,c=(0,i.useRouter)(),{saveCustomTypeSuccess:u}=(0,y.Z)(),[d,m]=(0,l.useState)(!1),[f,p]=(0,l.useState)(!1),[x,h]=(0,l.useState)(!1),v=async()=>{h(!0),await T(n,u);let e=O.cd.custom.getBuilderPagePathname(n.id);if(c.asPath===e){let e=O.cd.page.getBuilderPagePathname(n.id);c.replace(e),h(!1)}else h(!1)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(o.h_,{modal:!0,children:[(0,r.jsx)(o.$F,{disabled:x,children:(0,r.jsx)(o.hU,{color:"grey","data-testid":"editDropdown",hiddenLabel:"Custom type actions",icon:"moreVert",loading:x,variant:"solid"})}),(0,r.jsxs)(o.AW,{align:"end",children:[(0,r.jsx)(o.Xi,{startIcon:(0,r.jsx)(o.I5,{name:"edit"}),onSelect:()=>{p(!0)},children:"Rename"}),"custom"===t&&!a&&(0,r.jsx)(o.Xi,{startIcon:(0,r.jsx)(o.I5,{name:"driveFileMove"}),onSelect:()=>void v(),children:"Convert to page type"}),(0,r.jsx)(o.Xi,{color:"tomato",startIcon:(0,r.jsx)(o.I5,{name:"delete"}),onSelect:()=>{m(!0)},children:"Remove"})]})]}),d?(0,r.jsx)(j,{format:t,customType:n,onClose:()=>m(!1),onDeleteCustomTypeSuccess:()=>{var e;let{tablePagePathname:t}=O.cd[null!==(e=n.format)&&void 0!==e?e:"custom"];c.asPath!==t?c.replace(t):m(!1)}}):null,f?(0,r.jsx)(C,{format:t,customType:n,isChangesLocal:a,onClose:()=>p(!1),setLocalCustomType:s}):null]})}},47861:function(e,t,n){"use strict";n.d(t,{z:function(){return s}});var r=n(52322),o=n(2784),i=n(75289);let l=(e,t)=>e?"".concat(e,"-").concat(t):"",a=e=>{switch(e){case"white":case"secondaryMedium":case"secondarySmall":case"secondary":return"#1A1523";default:return"grey01"}},s=(0,o.forwardRef)((e,t)=>{let{label:n,Icon:o,type:s,form:c,isLoading:u=!1,disabled:d=!1,onClick:m,sx:f={},iconSize:p=16,iconFill:x,variant:h="primary",...y}=e;return(0,r.jsx)(i.zx,{ref:t,sx:{...f,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",...u?{cursor:"wait !important"}:{}},type:s,form:c,disabled:d||u,onClick:u?void 0:m,variant:h,...y,children:u?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.$j,{size:p,color:a(h),"data-testid":l(y["data-testid"],"spinner")}),o&&n]}):(0,r.jsxs)(r.Fragment,{children:[o&&(0,r.jsx)(o,{size:p,fill:x,"data-testid":l(y["data-testid"],"icon")}),n]})})})},28801:function(e,t,n){"use strict";n.d(t,{W:function(){return l}});var r=n(52322),o=n(63397);n(2784);var i=n(75289);let l=e=>{let{name:t,label:n,placeholder:l,error:a,testId:s,onChange:c}=e;return(0,r.jsxs)(i.xu,{mb:3,children:[(0,r.jsx)(i.__,{htmlFor:t,mb:2,children:n}),(0,r.jsx)(o.gN,{name:t,type:"text",placeholder:l,as:i.II,autoComplete:"off",...c?{onChange:c}:null,...s?{"data-testid":s}:null}),a?(0,r.jsx)(i.xv,{"data-testid":s?"".concat(s,"-error"):"input-error",sx:{color:"error",mt:1},children:a}):null]})}},1490:function(e,t,n){"use strict";var r=n(52322),o=n(63397),i=n(37149),l=n.n(i),a=n(75289),s=n(47861),c=n(11104),u=n(76805);function d(e){let{children:t}=e,n=(0,u.W)();return(0,r.jsx)(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:e=>{var t;return"1px solid ".concat(null===(t=e.colors)||void 0===t?void 0:t.borders)}},children:t})}t.Z=function(e){let{children:t,close:n,isOpen:i,formId:m,validate:f,onSubmit:p,widthInPx:x,initialValues:h,content:{title:y},cardProps:j,omitFooter:v=!1,isLoading:g=!1,buttonLabel:b="Save",testId:S,actionMessage:k}=e;return l().setAppElement("#__next"),(0,r.jsx)(c.Z,{isOpen:i,shouldCloseOnOverlayClick:!0,onRequestClose:n,contentLabel:y,style:{content:{width:null!=x?x:"900px"}},children:(0,r.jsx)(o.J9,{initialValues:h,validate:e=>f?f(e):void 0,onSubmit:e=>{p(e)},children:e=>{let{isValid:i,isSubmitting:l,values:c,errors:f,touched:p,setFieldValue:x,setValues:h}=e;return(0,r.jsx)(o.l0,{id:m,...null!=S?{"data-testid":S}:null,children:(0,r.jsx)(u.Z,{borderFooter:!0,footerSx:{p:3,position:"sticky",bottom:0,background:"gray"},bodySx:{px:4,py:4},sx:{border:"none"},...j,Header:(0,r.jsxs)(d,{children:[(0,r.jsx)(a.X6,{sx:{fontSize:"20px"},children:y}),(0,r.jsx)(a.x8,{type:"button",onClick:n})]}),Footer:v?null:(0,r.jsxs)(a.kC,{sx:{alignItems:"space-between"},children:[(0,r.jsx)(a.kC,{sx:{fontSize:"14px",alignItems:"center"},children:"function"==typeof k?k(e):k}),(0,r.jsxs)(a.kC,{sx:{ml:"auto"},children:[(0,r.jsx)(a.zx,{mr:2,type:"button",onClick:n,variant:"secondary",disabled:l||g,children:"Cancel"}),(0,r.jsx)(s.z,{label:b,form:m,type:"submit",disabled:!i||l||g,isLoading:l||g,sx:{fontWeight:"400",paddingBlock:"8px",paddingInline:"16px",fontSize:"14px",borderRadius:"4px"}})]})]}),children:t({isValid:i,isSubmitting:l,values:c,errors:f,touched:p,setFieldValue:x,setValues:h})})})}})})}},43217:function(e){e.exports={column:"BlankSlate_column__genEe",root:"BlankSlate_root__CmSqW BlankSlate_column__genEe",fadeIn:"BlankSlate_fadeIn__mAfi5",withBackground:"BlankSlate_withBackground__mLYij",image:"BlankSlate_image__Jn90S BlankSlate_column__genEe",content:"BlankSlate_content__0Yt2d BlankSlate_column__genEe",desc:"BlankSlate_desc___Dl7e",actions:"BlankSlate_actions__OYRj4"}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[639],{76787:function(e,i,t){"use strict";t.d(i,{H:function(){return s}});var r=t(2784),n=t(41067);let s=()=>{let{openScreenshotsModal:e}=(0,n.Z)(),[i,t]=(0,r.useState)({sliceFilterFn:e=>e});return{modalPayload:i,onOpenModal:i=>{t(i),e()}}}},39283:function(e,i,t){"use strict";t.d(i,{Z:function(){return O}});var r,n,s=t(52322),l=t(2784),o=t(951),a=t(75100),d=t(56580),c=t(75289),x=t(39800),u=t.n(x);let p=e=>{let{children:i}=e;return(0,s.jsx)("kbd",{className:u().root,children:i})},h=e=>(0,s.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,s.jsxs)("g",{clipPath:"url(#clip0_5065_192538)",children:[(0,s.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,s.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,s.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,s.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,s.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,s.jsx)("defs",{children:(0,s.jsx)("clipPath",{id:"clip0_5065_192538",children:(0,s.jsx)("rect",{width:"10.6688",height:"16",fill:"white",transform:"translate(7 4)"})})})]});var f=t(76805),v=t(11104),j=t(27078),m=t(46962),g=t(41067);(r=n||(n={})).Mac="Mac",r.Linux="Linux",r.Windows="Windows";let b=()=>{let{userAgent:e}=navigator,i="Linux";return Object.values(n).forEach(t=>{e.includes(t)&&(i=t)}),i};var C=t(76473),y=t(88932),w=t(93188);async function F(e){let{variationId:i,slice:t,file:r,method:n}=e;try{let e=new FormData;e.append("file",r),e.append("libraryName",t.from),e.append("sliceName",t.model.name),e.append("variationId",i);let{errors:s,url:l}=await (0,w.XQ)({libraryName:t.from,sliceId:t.model.id,variationId:i,file:r});if(s.length>0)throw s;return w.Xe.track({event:"screenshot-taken",type:"custom",method:n}),{...t,screenshots:{...t.screenshots,[i]:{url:l}}}}catch(i){let e="Screenshot not saved";console.error(e,i),y.Am.error(e)}}var E=t(23240),k=t(17186);let D=e=>{let{inputFile:i,handleFile:t,children:r,isDragActive:n}=e;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(c.__,{htmlFor:"input-file",variant:"buttons.white",sx:{p:2,px:0,display:"flex",justifyContent:"center",width:200,alignItems:"center",flex:1},children:r||"Select file"}),(0,s.jsx)("input",{id:"input-file",type:"file",ref:i,style:{display:"none"},accept:k.nG.map(e=>"image/".concat(e)).join(","),onChange:e=>{var i;t(null===(i=e.target.files)||void 0===i?void 0:i[0],n)}})]})},I=()=>(0,s.jsx)(c.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,s.jsxs)(c.kC,{variant:"boxes.centered",sx:{border:"1px dashed #6E56CF",height:"100%",width:"100%",borderRadius:"4px"},children:[(0,s.jsx)(S,{isActive:!0}),(0,s.jsx)(c.xv,{sx:{my:2},children:"Drop file here"}),(0,s.jsx)(c.xv,{variant:"secondary",children:"Maximum upload size file: 128Mb"})]})}),S=e=>{let{isActive:i}=e;return(0,s.jsx)(c.kC,{sx:{p:1,borderRadius:"50%",bg:i?"#F1EEFE":"#EDECEE",alignItems:"center",justifyContent:"center",width:"48px",height:"48px"},children:(0,s.jsx)(o.IEK,{style:{color:i?"#6E56CF":"#6F6E77",fontSize:"34px"}})})};var R=e=>{let{variationID:i,slice:t,imageTypes:r=k.nG,onUploadSuccess:n}=e,o=t.screenshots[i],{saveSliceCustomScreenshotSuccess:a}=(0,g.Z)(),[d,x]=(0,l.useState)(!1),[u,p]=(0,l.useState)(!1),[h,f]=(0,l.useState)(!1);(0,C.y1)(["meta+v","ctrl+v"],()=>void w(),[i,t]);let{FileInputRenderer:v,fileInputProps:j}=function(e){let{onHandleFile:i}=e,t=(0,l.useRef)(null),r=async(e,r)=>{e&&(await i(e,r),(null==t?void 0:t.current)&&(t.current.value=""))};return{handleFile:r,inputFile:t,FileInputRenderer:D,fileInputProps:{inputFile:t,handleFile:r}}}({onHandleFile:async(e,r)=>{f(!0);let s=await F({slice:t,file:e,method:r?"dragAndDrop":"upload",variationId:i});p(!1);let l=null==s?void 0:s.screenshots[i];l&&(a(i,l,s),n&&n(s)),f(!1)}}),m=async e=>{if(e.size>128e6)return y.Am.error("File is too big. Max file size: 128Mb.");f(!0);let r=await F({slice:t,file:e,method:"dragAndDrop",variationId:i}),s=null==r?void 0:r.screenshots[i];s&&(a(i,s,r),n&&n(r)),f(!1)},b="function"==typeof navigator.clipboard.read,w=async()=>{if(b)try{let e=await navigator.clipboard.read();if(void 0!==e[0]){let i=e[0].types.find(e=>r.map(e=>"image/".concat(e)).includes(e));if(void 0!==i){let t=await e[0].getType(i),r=new File([t],"file");return m(r)}}}catch(e){console.error("Could not paste file",e)}},R=e=>i=>{i.preventDefault(),x(e)},H=e=>i=>{i.preventDefault(),p(e)};return(0,s.jsxs)(c.kC,{as:"form",variant:"boxes.centered",sx:{bg:"#F9F8F9",position:"relative",borderRadius:"6px",height:"320px"},onDragEnter:R(!0),onDragLeave:R(!1),onDragOver:R(!0),onMouseEnter:H(!0),onMouseLeave:H(!1),onSubmit:e=>e.preventDefault(),onDrop:e=>{var i;e.preventDefault(),x(!1);let t=null===(i=e.dataTransfer.files)||void 0===i?void 0:i[0];if(void 0!==t)return r.some(e=>"image/".concat(e)===t.type)?void m(t):y.Am.error("Only files of type ".concat(r.join(", ")," are accepted."))},children:[h?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(c.$j,{}),(0,s.jsx)(c.xv,{sx:{my:2},children:"Uploading file ..."})]}):null,h||void 0===o?null:(0,s.jsx)(E.q,{src:o.url,sx:{width:"100%",height:"100%",maxHeight:"100%",backdropFilter:"blur(5px)"}}),h?null:(0,s.jsx)(c.kC,{sx:{p:2,position:"absolute",width:"100%",height:"100%",borderRadius:"6px",background:"#F9F8F9B2",justifyContent:"center",alignItems:"center",visibility:u||void 0===o?"visible":"hidden"},children:(0,s.jsx)(c.kC,{variant:"boxes.centered",sx:{border:"1px dashed #6E56CF",height:"100%",width:"100%",borderRadius:"4px"},children:(0,s.jsxs)(c.kC,{sx:{width:"100%",justifyContent:"center",alignItems:"center",flexDirection:"column"},children:[(0,s.jsx)(S,{isActive:d}),(0,s.jsx)(c.xv,{sx:{my:2},children:b?"Paste, drop or ...":"Drop or ..."}),(0,s.jsx)(v,{...j,isDragActive:d}),(0,s.jsx)(c.xv,{sx:{color:"greyIcon",mt:1},children:"Maximum file size: 128Mb"})]})})}),d?(0,s.jsx)(I,{}):null]})};let H=()=>{let e=b(),i=[n.Windows,n.Linux].includes(e)?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(p,{children:"ctrl"})," + ",(0,s.jsx)(p,{children:"shift"})," + ",(0,s.jsx)(p,{children:"c"})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(p,{children:"cmd"})," + ",(0,s.jsx)(p,{children:"shift"})," + ",(0,s.jsx)(p,{children:"c"})]});return(0,s.jsxs)(c.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,s.jsx)(h,{}),(0,s.jsxs)("div",{children:["Use\xa0",i," to copy any frame as .png, then just paste it here"]})]})},M=e=>{let{isValid:i}=e;return(0,s.jsx)(c.kC,{sx:{p:2,border:"1px solid #E4E2E4",borderRadius:"6px",bg:"#FFF"},children:i?(0,s.jsx)(o.Ypm,{style:{fontSize:"16px"}}):(0,s.jsx)(a.j6O,{style:{fontSize:"16px",color:"#ED811C"}})})},_=e=>{let{slice:i,onSelectVariation:t,variationSelector:r}=e;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(c.X6,{as:"h4",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:i.model.name}),(0,s.jsx)(c.xu,{children:(0,s.jsx)(c.xu,{as:"ul",sx:{pl:0,my:3},children:i.model.variations.map(e=>{let{sliceID:n,variationID:l}=r,o=n===i.model.id&&l===e.id;return(0,s.jsx)(c.xu,{as:"li",sx:{listStyle:"none",my:2,p:2,cursor:"pointer",borderRadius:"4px",...o&&{bg:"#EDECEE",fontWeight:"500"},":hover":{bg:"#EDECEE"}},onClick:()=>t({sliceID:i.model.id,variationID:e.id}),children:(0,s.jsxs)(c.kC,{sx:{alignItems:"center"},children:[(0,s.jsx)(M,{isValid:!!i.screenshots[e.id]}),(0,s.jsx)(c.xv,{sx:{ml:2},children:e.name})]})},"".concat(i.model.id,"-").concat(e.id))})})})]})},z=(e,i)=>e||(i.length?{sliceID:i[0].model.id,variationID:i[0].model.variations[0].id}:void 0);function A(e){let{children:i}=e,t=(0,f.W)();return(0,s.jsx)(c.kC,{sx:{position:"sticky",top:0,zIndex:1,background:"gray",p:"16px",alignItems:"center",justifyContent:"space-between",borderTopLeftRadius:t,borderTopRightRadius:t,borderBottom:e=>{var i;return"1px solid ".concat(String(null===(i=e.colors)||void 0===i?void 0:i.borders))}},children:i})}var O=e=>{let{slices:i,defaultVariationSelector:t,onUploadSuccess:r}=e,{closeModals:n}=(0,g.Z)(),{isOpen:o}=(0,d.v9)(e=>({isOpen:(0,j.gP)(e,m.q.SCREENSHOTS)})),[a,x]=(0,l.useState)(z(t,i));if((0,l.useEffect)(()=>{x(z(t,i))},[null==t?void 0:t.sliceID,null==t?void 0:t.variationID,o]),0===i.length||!a)return null;let u="function"==typeof navigator.clipboard.read;return(0,s.jsx)(v.Z,{isOpen:o,shouldCloseOnOverlayClick:!0,onRequestClose:()=>n(),children:(0,s.jsx)(f.Z,{radius:"0px",bodySx:{p:0,bg:"#FFF",position:"relative"},sx:{border:"none"},Header:(0,s.jsxs)(A,{children:[(0,s.jsx)(c.X6,{sx:{fontSize:"20px"},children:"Slice screenshots"}),(0,s.jsx)(c.x8,{type:"button",onClick:()=>n()})]}),Footer:null,children:(0,s.jsxs)(c.xu,{sx:{display:"flex",flexWrap:"wrap",height:"100%"},children:[(0,s.jsx)(c.xu,{sx:{p:3,bg:"grey07",flexGrow:1,overflow:"auto",maxHeight:"100%",flexBasis:"sidebar"},children:i.map((e,i)=>(0,s.jsx)(_,{slice:e,variationSelector:a,onSelectVariation:x},"".concat(e.model.id,"-").concat(i)))}),(0,s.jsxs)(c.kC,{as:"main",sx:{p:3,flexGrow:99999,flexBasis:0,flexDirection:"column",minWidth:320,gap:"8px"},children:[u?(0,s.jsx)(H,{}):void 0,(()=>{let e=i.find(e=>e.model.id===a.sliceID);return e?(0,s.jsx)(R,{variationID:a.variationID,slice:e,onUploadSuccess:r}):null})()]})]})})})}},23240:function(e,i,t){"use strict";t.d(i,{q:function(){return a}});var r=t(52322),n=t(2784),s=t(65186),l=t(75289);let o=(0,n.memo)(e=>{let{src:i}=e;return(0,r.jsx)(l.Ee,{src:i,alt:"Preview image",sx:{maxHeight:"100%"}})}),a=e=>{let{src:i,sx:t}=e;return(0,r.jsx)(l.kC,{sx:{position:"relative",alignItems:"center",justifyContent:"center",overflow:"hidden",backgroundImage:"url(/pattern.png)",backgroundColor:"headSection",backgroundRepeat:"repeat",backgroundSize:"20px",borderRadius:"4px",...t},children:void 0!==i?(0,r.jsx)(o,{src:i}):(0,r.jsxs)(l.xv,{sx:{display:"flex",flexDirection:"column",alignItems:"center"},children:[(0,r.jsx)(s.eJU,{}),"You have no screenshot yet."]})})}},39800:function(e){e.exports={root:"Kbd_root__LRA1F"}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[764],{5726:function(e,l,t){t.d(l,{F:function(){return Z}});var r=t(52322),n=t(33760),a=t(97729),s=t.n(a),c=t(2784),i=t(23335),o=t(30988),d=t(77507),u=t(74830),x=t(5632),h=t(56580),p=t(75289),j=t(93216),m=t(88932),g=t(93188),f=t(91133);async function v(e){let{id:l,label:t,repeatable:r,format:n,onSuccess:a}=e,s=d.$[n],c=(0,j.Ue)({id:l,label:t,repeatable:r,format:n});try{let{errors:e}=await (0,g.KA)(c);if(e.length>0)throw e;g.Xe.track({event:"custom-type:created",id:c.id,name:t,format:n,type:r?"repeatable":"single",origin:"table"}),await a(c),m.Am.success((0,f.GX)({message:"".concat(s.name({start:!0,plural:!1})," saved successfully at "),path:"./customtypes/".concat(c.id,"/index.json")}))}catch(l){let e="Internal Error: ".concat(s.name({start:!0,plural:!1})," not saved");console.error(e,l),m.Am.error(e)}}var b=t(63447),y=t(65856),C=t(80546),S=t(1490),w=t(17186),k=t(99510),I=t(40572),R=t(41067),z=t(28801),L=t(63397);let T=e=>{let{selected:l,...t}=e;return(0,r.jsx)(p.kC,{sx:{p:"24px",mb:3,alignItems:"top",cursor:"pointer",borderRadius:"6px",backgroundColor:"grayLight",boxShadow:l?e=>{var l;return"0 0 0 2px ".concat(String(null===(l=e.colors)||void 0===l?void 0:l.primary))}:"none","&:hover":{boxShadow:e=>{var l;return"0 0 0 2px ".concat(String(null===(l=e.colors)||void 0===l?void 0:l.primary))}}},...t})},_=e=>{let{format:l}=e,[t,,n]=(0,L.U$)("repeatable"),a=d.$[l];return(0,r.jsxs)(p.xu,{mb:2,children:[(0,r.jsxs)(T,{selected:t.value,onClick:()=>n.setValue(!0),children:[(0,r.jsx)(p.Y8,{checked:t.value,onChange:()=>{},"data-testid":"repeatable-type-radio-btn"}),(0,r.jsxs)(p.xu,{sx:{marginLeft:2},children:["Reusable type",(0,r.jsx)(p.xu,{as:"p",sx:{fontSize:"12px",color:"textClear",mt:1},children:a.hintRepeatable})]})]}),(0,r.jsxs)(T,{selected:!t.value,onClick:()=>n.setValue(!1),children:[(0,r.jsx)(p.Y8,{checked:!t.value,onChange:()=>{},"data-testid":"single-type-radio-btn"}),(0,r.jsxs)(p.xu,{sx:{marginLeft:2},children:["Single type",(0,r.jsx)(p.xu,{as:"p",sx:{fontSize:"12px",color:"textClear",mt:1},children:a.hintSingle})]})]})]})},N=e=>{let{format:l,isCreating:t,isOpen:n,origin:a="table",onCreateChange:s,onOpenChange:i}=e,{createCustomTypeSuccess:o}=(0,R.Z)(),{completeStep:u}=(0,y.k)(),{customTypeIds:m,customTypeLabels:g}=(0,h.v9)(e=>({customTypeIds:(0,I.W6)(e),customTypeLabels:(0,I.YS)(e)})),f=d.$[l],[L,T]=(0,c.useState)(!0),{syncChanges:N}=(0,C.g)(),A=(0,x.useRouter)(),P=async e=>{let{id:t,label:r,repeatable:n}=e;s(!0),await v({format:l,id:t,label:r,origin:a,repeatable:n,onSuccess:async e=>{o(e);let l=(0,j.y6)(e),r=b.cd[l];T(!0),await A.push({pathname:r.getBuilderPagePathname(t)}),N(),"page"===l&&u("createPageType")}}),s(!1),i(!1)},D=(e,l,t)=>{t(L?{...l,label:e.target.value,id:(0,k.lV)(e.target.value)}:{...l,label:e.target.value})},E=(e,l)=>{l("id",e.target.value),T(!1)};return(0,r.jsx)(S.Z,{testId:"create-ct-modal",isOpen:n,widthInPx:"530px",formId:"create-custom-type",buttonLabel:"Create",close:()=>{i(!1),T(!0)},onSubmit:e=>{P(e)},isLoading:t,initialValues:{repeatable:!0,id:"",label:""},validate:e=>{let{id:l,label:t}=e,r={};return t&&t.length||(r.label="Cannot be empty."),!r.label&&g.includes(t)&&(r.label="".concat(f.name({start:!0,plural:!1})," name is already taken.")),l&&l.length||(r.id="ID cannot be empty."),r.id||!l||w.xo.exec(l)||(r.id="Invalid id: No special characters allowed."),!r.id&&l&&m.map(e=>e.toLowerCase()).includes(l)&&(r.id='ID "'.concat(l,'" exists already.')),Object.keys(r).length>0?r:void 0},content:{title:"Create a new ".concat(f.name({start:!1,plural:!1}))},children:e=>{let{errors:t,setValues:n,setFieldValue:a,values:s,touched:c}=e;return(0,r.jsxs)(p.xu,{children:[(0,r.jsx)(_,{format:l}),(0,r.jsx)(z.W,{name:"label",label:"".concat(f.name({start:!0,plural:!1})," Name"),testId:"ct-name-input",placeholder:"A display name for the ".concat(f.name({start:!1,plural:!1})),error:c.label?t.label:void 0,onChange:e=>D(e,s,n)}),(0,r.jsx)(z.W,{name:"id",testId:"ct-id-input",label:"".concat(f.name({start:!0,plural:!1})," ID"),placeholder:f.inputPlaceholder,error:c.id?t.id:void 0,onChange:e=>E(e,a)})]})}})};var A=t(28574);let P=e=>(0,r.jsxs)("svg",{viewBox:"0 0 20 24",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,r.jsx)("path",{d:"m2 24h16c1.1046 0 2-.8954 2-2v-17l-5-5h-13c-1.10457 0-2 .89543-2 2v20c0 1.1046.89543 2 2 2z",fill:"#6e56cf"}),(0,r.jsx)("path",{d:"m17 5h3l-5-5v3c0 1.10457.8954 2 2 2z",fill:"#9e8cfc"}),(0,r.jsx)("path",{d:"m10.0912 8c-2.8118 0-5.0912 2.2794-5.0912 5.0912s2.2794 5.0912 5.0912 5.0912c1.8851 0 3.5303-1.0247 4.4098-2.5452.1553-.2684.2868-.5523.3916-.8489.092-.2604-.0444-.5461-.3048-.6381-.2603-.092-.546.0445-.638.3048-.0841.238-.1897.4659-.3144.6815-.7081 1.2241-2.0305 2.0459-3.5442 2.0459-2.2595 0-4.0912-1.8317-4.0912-4.0912s1.8317-4.0912 4.0912-4.0912c1.3566 0 2.5595.66 3.3043 1.6782h-1.7739c-.2761 0-.5.2239-.5.5 0 .2762.2239.5.5.5h2.6782c.2762 0 .5-.2238.5-.5v-2.6782c0-.2761-.2238-.5-.5-.5-.2761 0-.5.2239-.5.5v1.1032c-.9281-.9865-2.2462-1.6032-3.7086-1.6032z",fill:"#fff"})]}),D=e=>(0,r.jsxs)("svg",{viewBox:"0 0 20 24",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,r.jsx)("path",{d:"m2 24h16c1.1046 0 2-.8954 2-2v-17l-5-5h-13c-1.10457 0-2 .89543-2 2v20c0 1.1046.89543 2 2 2z",fill:"#6e56cf",fillRule:"nonzero"}),(0,r.jsx)("path",{d:"m17 5h3l-5-5v3c0 1.10457.8954 2 2 2z",fill:"#9e8cfc",fillRule:"nonzero"}),(0,r.jsx)("path",{d:"m8.0869 10.6818.5758-2.3031c.0556-.2226.2556-.3787.485-.3787.3253 0 .564.3057.4851.6213l-.5151 2.0605h2.6055l.5758-2.3031c.0557-.2226.2557-.3787.4851-.3787.3253 0 .564.3057.4851.6213l-.5152 2.0605h2.246c.2761 0 .5.2239.5.5 0 .2762-.2239.5-.5.5h-2.496l-.6591 2.6364h2.1551c.2761 0 .5.2238.5.5 0 .2761-.2239.5-.5.5h-2.4051l-.5757 2.3031c-.0557.2226-.2557.3787-.4851.3787-.3253 0-.564-.3057-.4851-.6213l.5152-2.0605h-2.6056l-.5758 2.3031c-.0556.2226-.2556.3787-.4851.3787-.3253 0-.5639-.3057-.485-.6213l.5151-2.0605h-1.9278c-.2761 0-.5-.2239-.5-.5 0-.2762.2239-.5.5-.5h2.1778l.6591-2.6364h-1.8369c-.2761 0-.5-.2238-.5-.5 0-.2761.2239-.5.5-.5zm2.7273 3.6364.659-2.6364h-2.6055l-.6591 2.6364z",fill:"#fff"})]});var E=t(64910),W=t(18566),$=t(95799),O=t(1744),B=t(70647);async function M(e){let{errors:l,models:t}=await B.managerClient.customTypes.readAllCustomTypes({format:e});if(l.length>0)throw l;return t.map(e=>{let{model:l}=e;return l})}let V=e=>{let{format:l,isCreatingCustomType:t,openCreateCustomTypeModal:a}=e,s=(0,x.useRouter)(),{customTypes:i,updateCustomTypes:o}=function(e){let l=(0,c.useCallback)(l=>(0,W.VA)(M,[e],l),[e]);return{customTypes:(0,W.QT)(M,[e]),updateCustomTypes:l}}(l),u=i.sort((e,l)=>e.id.localeCompare(l.id)),p=b.cd[l],j=d.$[l];return(!function(e,l,t){let{storeCustomTypes:r}=(0,h.v9)(e=>({storeCustomTypes:(0,I.Ch)(e).filter(O.TG)}));(0,c.useEffect)(()=>{let n=r.filter(e=>{let{local:t}=e;return t.format===l});(n.length!==e.length||n.some(l=>{let t=e.find(e=>e.id===l.local.id);return!t||JSON.stringify($.Dc.fromSM(l.local))!==JSON.stringify(t)}))&&t(n.map(e=>{let{local:l}=e;return $.Dc.fromSM(l)}))},[l,t,e,r])}(i,l,o),0===u.length)?(0,r.jsxs)(A.R$,{"data-testid":"blank-slate",style:{alignSelf:"center",marginTop:n.rS.space[72]},children:[(0,r.jsx)(A.u2,{children:(0,r.jsx)(n.Ee,{src:p.blankSlateImage,sizing:"cover"})}),(0,r.jsxs)(A.T9,{children:[(0,r.jsx)(A._T,{children:j.name({start:!0,plural:!0})}),(0,r.jsx)(A.nf,{children:j.blankSlateDescription}),(0,r.jsx)(A.Qj,{children:(0,r.jsx)(n.zx,{onClick:a,loading:t,children:"Create"})})]})]}):(0,r.jsx)("div",{children:(0,r.jsxs)(n.iA,{columnLayout:"28px 1fr 1fr 1fr 42px",children:[(0,r.jsx)(n.ss,{children:(0,r.jsxs)(n.SC,{children:[(0,r.jsx)(n.pj,{children:(0,r.jsx)(n.I5,{name:"notes",size:"medium"})}),(0,r.jsx)(n.pj,{children:(0,r.jsx)(n.xv,{color:"grey11",variant:"small",children:"Label"})}),(0,r.jsx)(n.pj,{children:(0,r.jsx)(n.xv,{color:"grey11",variant:"small",children:"API ID"})}),(0,r.jsx)(n.pj,{children:(0,r.jsx)(n.xv,{color:"grey11",variant:"small",children:"Limit"})}),(0,r.jsx)(n.pj,{})]})}),(0,r.jsx)(n.RM,{children:u.map(e=>{let{repeatable:t,label:a,id:c}=e;return(0,r.jsxs)(n.SC,{onClick:()=>{s.push(b.cd[l].getBuilderPagePathname(c))},children:[(0,r.jsx)(n.pj,{children:t?(0,r.jsx)(P,{width:n.rS.space[20]}):(0,r.jsx)(D,{width:n.rS.space[20]})}),(0,r.jsx)(n.pj,{children:(0,r.jsx)(n.xv,{variant:"bold",noWrap:!0,children:a})}),(0,r.jsx)(n.pj,{children:(0,r.jsx)(n.xv,{color:"grey11",noWrap:!0,children:c})}),(0,r.jsx)(n.pj,{children:(0,r.jsx)(n.xv,{color:"grey11",noWrap:!0,children:t?"Reusable":"Single"})}),(0,r.jsx)(n.pj,{children:(0,r.jsx)(E._,{isChangesLocal:!1,format:l,customType:e})})]},c)})})]})})},Z=e=>{let{format:l}=e,t=d.$[l],[a,x]=(0,c.useState)(!1),[h,p]=(0,c.useState)(!1);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s(),{children:(0,r.jsxs)("title",{children:[t.name({start:!0,plural:!0})," - Slice Machine"]})}),(0,r.jsx)(o.S,{renderError:()=>(0,r.jsx)(u.LN,{children:(0,r.jsx)(u.RN,{children:(0,r.jsx)(n.xu,{alignItems:"center",justifyContent:"center",children:(0,r.jsx)(n.Iq,{title:"Request failed",description:"An error occurred while fetching your ".concat(t.name({start:!1,plural:!0}),".")})})})}),children:(0,r.jsx)(c.Suspense,{fallback:(0,r.jsxs)(u.LN,{children:[(0,r.jsxs)(u.wd,{children:[(0,r.jsx)(u.Cx,{children:(0,r.jsx)(i.g,{children:t.name({start:!0,plural:!0})})}),(0,r.jsx)(u.K2,{children:(0,r.jsx)(n.zx,{disabled:!0,startIcon:"add",children:"Create"})})]}),(0,r.jsx)(u.RN,{children:(0,r.jsx)(n._3,{})})]}),children:(0,r.jsxs)(u.LN,{children:[(0,r.jsxs)(u.wd,{children:[(0,r.jsx)(u.Cx,{children:(0,r.jsx)(i.g,{children:t.name({start:!0,plural:!0})})}),(0,r.jsx)(u.K2,{children:(0,r.jsx)(n.zx,{"data-testid":"create-ct",loading:a,onClick:()=>{p(!0)},startIcon:"add",children:"Create"})})]}),(0,r.jsx)(u.RN,{children:(0,r.jsxs)(n.xu,{flexDirection:"column",children:[(0,r.jsx)(V,{format:l,isCreatingCustomType:a,openCreateCustomTypeModal:()=>{p(!0)}}),(0,r.jsx)(N,{format:l,isCreating:a,isOpen:h,onCreateChange:x,onOpenChange:p})]})})]})})})]})}},76805:function(e,l,t){t.d(l,{Z:function(){return o},W:function(){return i}});var r=t(52322),n=t(2784),a=t(75289);let s=e=>{let{bg:l,background:t,sx:n,withRadius:s,radius:c,children:i}=e;return(0,r.jsx)(a.xu,{sx:{p:4,bg:l||t,...s?{borderBottomLeftRadius:c,borderBottomRightRadius:c}:null,...n},children:i})},c=(0,n.createContext)("6px"),i=()=>(0,n.useContext)(c),o=e=>{let{Header:l=null,SubHeader:t=null,Body:n=null,Footer:i=null,borderFooter:o=!1,radius:d="6px",bodySx:u={},footerSx:x={},sx:h=null,bg:p,background:j,children:m,...g}=e;return(0,r.jsx)(c.Provider,{value:d,children:(0,r.jsxs)(a.Zb,{sx:{border:e=>{var l;return"1px solid ".concat(String(null===(l=e.colors)||void 0===l?void 0:l.borders))},borderRadius:d,...h},...g,children:[l||null,t||null,(0,r.jsxs)(s,{bg:p,background:j,sx:u,withRadius:!i,children:[n?(0,r.jsx)(n,{}):null,m||null]}),i?(0,r.jsx)(s,{bg:p,background:j,sx:{...o?{borderTop:e=>{let{colors:l}=e;return"1px solid ".concat(String(null==l?void 0:l.borders))}}:null,...x},radius:d,withRadius:!0,children:"object"==typeof i?i:(0,r.jsx)(i,{})}):null]})})}},17186:function(e,l,t){t.d(l,{Sn:function(){return c},lS:function(){return r},nG:function(){return n},pq:function(){return i},rd:function(){return s},xo:function(){return a}});let r=["components"],n=["png","jpg","jpeg"],a=/^[A-Za-z0-9]+(?:_[A-Za-z0-9]+)*$/,s="placeholders/What_are_Slices_mrvome",c="SM_HELP_VIDEOS/mock_data",i="slice-machine-simulator"}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[772],{80218:function(e,t,n){"use strict";n.d(t,{Zb:function(){return c},T$:function(){return m},eW:function(){return _},ZB:function(){return u},Lm:function(){return h}});var o=n(52322),r=n(50002),i=n(33760),a=n(6277),l=n(2784),d=n(66243),s=n.n(d);let c=e=>{let{checked:t=!1,size:n="medium",variant:i="solid",interactive:d,disabled:c,onClick:u,href:m,component:_="a",replace:h,...C}=e,v={...C,className:(0,a.W)(s().root,s()["size-".concat(n)],s()[i],{[s().interactive]:e.interactive}),"data-state":!0===t?"checked":void 0};return!0===e.interactive&&void 0===e.href?(0,o.jsx)("div",{...v,"data-disabled":!0===e.disabled?"":void 0,onClick:t=>{if(!0===e.disabled||void 0===e.onClick)return;let n=t.target;(0,r.JY)(n)===t.currentTarget&&e.onClick(t)},tabIndex:!0===e.disabled?void 0:0}):!0===e.interactive?(0,l.createElement)(_,{...v,href:e.href,onClick:e=>{let t=e.target;(0,r.JY)(t)!==e.currentTarget&&e.preventDefault()},..."a"===_?{}:{replace:e.replace}}):(0,o.jsx)("div",{...v})},u=e=>{let{className:t,component:n="img",overlay:r,...i}=e;return(0,o.jsxs)("div",{className:s().media,children:[(0,l.createElement)(n,{...i,className:(0,a.W)(s()["mediaComponent-".concat(n)],t)}),r?(0,o.jsx)("div",{className:s().mediaOverlay,children:r}):void 0]})},m=e=>(0,o.jsx)("div",{...e,className:s().actions}),_=e=>{let{action:t,subtitle:n,title:r,...a}=e;return(0,o.jsxs)("div",{...a,className:s().footer,children:[(0,o.jsxs)("div",{className:s().footerTexts,children:[(0,o.jsx)(i.xv,{component:"span",noWrap:!0,variant:"bold",children:r}),(0,o.jsx)(i.xv,{color:"grey11",component:"span",noWrap:!0,variant:"small",children:n})]}),t]})},h=e=>{let{children:t,...n}=e;return(0,o.jsx)("div",{...n,className:s().status,children:(0,o.jsx)(i.xv,{align:"center",color:"inherit",component:"span",noWrap:!0,variant:"smallBold",children:t})})}},51159:function(e,t,n){"use strict";n.d(t,{O:function(){return l}});var o=n(52322),r=n(33760),i=n(5274),a=n(58161);let l=e=>{let{badgeColor:t,badgeTitle:n,tooltipContent:l}=function(e){let t=d[e.modelType];switch(e.modelStatus){case i.GJ.New:return{badgeColor:"green",badgeTitle:"New",tooltipContent:"This ".concat(t," exists only locally. Upon sync, it will be pushed to your remote repository.")};case i.GJ.Modified:return{badgeColor:"amber",badgeTitle:"Modified",tooltipContent:"This ".concat(t," has been modified locally. Upon sync, changes will be pushed to your remote repository.")};case i.GJ.Synced:return{badgeColor:"purple",badgeTitle:"Synced",tooltipContent:"This ".concat(t," is in sync with the remote repository.")};case i.GJ.Deleted:return{badgeColor:"tomato",badgeTitle:"Deleted",tooltipContent:"This ".concat(t," has been deleted locally.")};case i.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===a.t.UNAUTHORIZED)return{badgeColor:"grey",badgeTitle:"Unknown",tooltipContent:"Data from the remote repository could not be fetched (not connected to Prismic)."};if(e.authStatus===a.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);return(0,o.jsx)(r.u,{content:l,side:"bottom",children:(0,o.jsx)(r.Ct,{color:t,title:n})})},d={CustomType:"type",Slice:"slice"}},53850:function(e,t,n){"use strict";n.d(t,{b:function(){return C}});var o=n(52322),r=n(33760),i=n(39097),a=n.n(i),l=n(80218),d=n(3181),s=n(51159),c=n(89513);let u=e=>(0,o.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,o.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=e=>({hash:e.hash}),_=e=>e?Object.entries(e).reduce((e,t)=>{let[n,o]=t;return o.hash?{...e,[n]:{...o,...m(o)}}:e},{}):{},h={build:e=>({...e,screenshots:_(e.screenshots)}),variation(e,t){if(e.model.variations.length)return t?e.model.variations.find(e=>e.id===t):e.model.variations[0]}},C=e=>{let t;let{action:n,isComingSoon:i=!1,isDeleted:m=!1,onUpdateScreenshot:_,selected:C=!1,slice:x,variant:b,variationId:f}=e,g=h.variation(x,f);if(!g)return null;let j=(0,d.d7)(x,g),y=i||m,k=!y&&!!_,S="outlined"===b,T=void 0!==f;return t="selection"===e.mode?{disabled:y,interactive:!0,onClick:()=>{e.onSelectedChange(!C)}}:y?{interactive:!1}:{component:a(),href:c.Y.getBuilderPagePathname({libraryName:x.href,sliceName:x.model.name,variationId:g.id}),interactive:!0,replace:e.replace},(0,o.jsxs)(l.Zb,{"aria-label":"".concat(x.model.name," ").concat(g.name," slice card"),checked:C,"data-testid":"shared-slice-card",...t,..."outlined"===b?{size:"small",variant:"outlined"}:{},children:[void 0!==j?(0,o.jsx)(l.ZB,{alt:"Preview image",overlay:k&&!S?(0,o.jsx)(r.xu,{alignItems:"center",justifyContent:"center",children:(0,o.jsx)(v,{onClick:_})}):void 0,src:j}):(0,o.jsx)(l.ZB,{component:"div",children:(0,o.jsxs)(r.xu,{alignItems:"center",flexDirection:"column",gap:8,justifyContent:"center",children:[(0,o.jsx)(r.xv,{color:"grey11",component:"span",children:"No screenshot available"}),k&&!S?(0,o.jsx)(v,{onClick:_}):void 0]})}),(0,o.jsx)(l.eW,{action:"checkbox"===n.type&&"selection"===e.mode?(0,o.jsx)("div",{onClick:e=>e.stopPropagation(),children:(0,o.jsx)(r.XZ,{checked:C,disabled:y,onCheckedChange:e.onSelectedChange})}):"menu"===n.type?(0,o.jsxs)(r.h_,{modal:!0,children:[(0,o.jsx)(r.$F,{disabled:y,children:(0,o.jsx)(r.hU,{hiddenLabel:"Slice actions",icon:"moreVert"})}),(0,o.jsxs)(r.AW,{align:"end","data-testid":"slice-action-icon-dropdown",children:[k&&S?(0,o.jsx)(r.Xi,{onSelect:_,startIcon:(0,o.jsx)(u,{}),children:"Update screenshot"}):void 0,(0,o.jsx)(r.Xi,{onSelect:n.onRename,startIcon:(0,o.jsx)(r.I5,{name:"edit"}),children:"Rename"}),!0===n.removeDisabled&&T?(0,o.jsx)(r.u,{content:"The slice needs to have at least one variation.",side:"bottom",stableMount:!0,children:(0,o.jsx)(p,{disabled:!0,onSelect:n.onRemove})}):(0,o.jsx)(p,{disabled:!0===n.removeDisabled,onSelect:n.onRemove})]})]}):"remove"===n.type?(0,o.jsx)(r.hU,{icon:"close",onClick:()=>!y&&n.onRemove(),hiddenLabel:"Remove slice"}):"status"===n.type?(0,o.jsx)(s.O,{authStatus:n.authStatus,isOnline:n.isOnline,modelStatus:n.modelStatus,modelType:"Slice"}):void 0,subtitle:(0,o.jsxs)(o.Fragment,{children:[T?g.id:"".concat(x.model.variations.length," variation").concat(x.model.variations.length>1?"s":""),i?(0,o.jsxs)(r.xv,{color:"purple11",component:"span",variant:"small",children:[" ","• (coming soon)"]}):void 0]}),title:T?g.name:x.model.name}),k&&!T&&(0,d.cx)(x)>0?(0,o.jsx)(l.Lm,{children:"Missing screenshot"}):void 0]})},v=e=>(0,o.jsx)(r.zx,{onClick:e.onClick,renderStartIcon:()=>(0,o.jsx)(u,{color:r.rS.color.grey11}),color:"grey",children:"Update screenshot"}),p=e=>(0,o.jsx)(r.Xi,{...e,color:"tomato",startIcon:(0,o.jsx)(r.I5,{name:"delete"}),children:"Delete"})},89513:function(e,t,n){"use strict";n.d(t,{Y:function(){return o}});let o={getBuilderPagePathname:e=>"/slices/".concat(e.libraryName.replaceAll("/","--"),"/").concat(e.sliceName,"/").concat(e.variationId)}},76805:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var o=n(52322);n(2784);var r=n(75289);let i=e=>{let{bg:t,background:n,sx:i,withRadius:a,radius:l,children:d}=e;return(0,o.jsx)(r.xu,{sx:{p:4,bg:t||n,...a?{borderBottomLeftRadius:l,borderBottomRightRadius:l}:null,...i},children:d})};var a=e=>{let{Header:t=null,SubHeader:n=null,Body:a=null,Footer:l=null,borderFooter:d=!1,radius:s="6px",bodySx:c={},footerSx:u={},sx:m=null,bg:_,background:h,children:C,...v}=e;return(0,o.jsxs)(r.Zb,{sx:{border:e=>{var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.borders))},borderRadius:s,...m},...v,children:[t?"object"==typeof t?t:(0,o.jsx)(t,{radius:s}):null,n?(0,o.jsx)(n,{radius:s}):null,(0,o.jsxs)(i,{bg:_,background:h,sx:c,withRadius:!l,children:[a?(0,o.jsx)(a,{}):null,C||null]}),l?(0,o.jsx)(i,{bg:_,background:h,sx:{...d?{borderTop:e=>{let{colors:t}=e;return"1px solid ".concat(String(null==t?void 0:t.borders))}}:null,...u},radius:s,withRadius:!0,children:"object"==typeof l?l:(0,o.jsx)(l,{})}):null]})}},17186:function(e,t,n){"use strict";n.d(t,{Sn:function(){return l},lS:function(){return o},nG:function(){return r},pq:function(){return d},rd:function(){return a},xo:function(){return i}});let o=["components"],r=["png","jpg","jpeg"],i=/^[A-Za-z0-9]+(?:_[A-Za-z0-9]+)*$/,a="placeholders/What_are_Slices_mrvome",l="SM_HELP_VIDEOS/mock_data",d="slice-machine-simulator"},66243:function(e){e.exports={flex:"Card_flex__opby1",grid:"Card_grid__VAvIS",column:"Card_column__W4ACG Card_flex__opby1",root:"Card_root__YVuvU Card_column__W4ACG Card_flex__opby1","size-small":"Card_size-small__aIlxd","size-medium":"Card_size-medium__xegz0",solid:"Card_solid__GNGar",outlined:"Card_outlined__W_dxI",interactive:"Card_interactive__rXw5L",media:"Card_media__l0kHL Card_column__W4ACG Card_flex__opby1","mediaComponent-div":"Card_mediaComponent-div__Y2_PZ Card_grid__VAvIS","mediaComponent-img":"Card_mediaComponent-img__ezOTu",mediaOverlay:"Card_mediaOverlay__Aa__Q Card_grid__VAvIS",nonMedia:"Card_nonMedia__Fv3Mz Card_flex__opby1",actions:"Card_actions__XdhOt Card_nonMedia__Fv3Mz Card_flex__opby1",footer:"Card_footer__U0HS1 Card_nonMedia__Fv3Mz Card_flex__opby1",footerTexts:"Card_footerTexts__rTXup Card_column__W4ACG Card_flex__opby1",status:"Card_status__PNN2a Card_column__W4ACG Card_flex__opby1"}}}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[772],{80218:function(e,t,n){"use strict";n.d(t,{Zb:function(){return c},T$:function(){return m},eW:function(){return _},ZB:function(){return u},Lm:function(){return h}});var o=n(52322),r=n(50002),i=n(33760),a=n(6277),l=n(2784),d=n(66243),s=n.n(d);let c=e=>{let{checked:t=!1,size:n="medium",variant:i="solid",interactive:d,disabled:c,onClick:u,href:m,component:_="a",replace:h,...C}=e,x={...C,className:(0,a.W)(s().root,s()["size-".concat(n)],s()[i],{[s().interactive]:e.interactive}),"data-state":!0===t?"checked":void 0};return!0===e.interactive&&void 0===e.href?(0,o.jsx)("div",{...x,"data-disabled":!0===e.disabled?"":void 0,onClick:t=>{if(!0===e.disabled||void 0===e.onClick)return;let n=t.target;(0,r.JY)(n)===t.currentTarget&&e.onClick(t)},tabIndex:!0===e.disabled?void 0:0}):!0===e.interactive?(0,l.createElement)(_,{...x,href:e.href,onClick:e=>{let t=e.target;(0,r.JY)(t)!==e.currentTarget&&e.preventDefault()},..."a"===_?{}:{replace:e.replace}}):(0,o.jsx)("div",{...x})},u=e=>{let{className:t,component:n="img",overlay:r,...i}=e;return(0,o.jsxs)("div",{className:s().media,children:[(0,l.createElement)(n,{...i,className:(0,a.W)(s()["mediaComponent-".concat(n)],t)}),r?(0,o.jsx)("div",{className:s().mediaOverlay,children:r}):void 0]})},m=e=>(0,o.jsx)("div",{...e,className:s().actions}),_=e=>{let{action:t,subtitle:n,title:r,...a}=e;return(0,o.jsxs)("div",{...a,className:s().footer,children:[(0,o.jsxs)("div",{className:s().footerTexts,children:[(0,o.jsx)(i.xv,{component:"span",noWrap:!0,variant:"bold",children:r}),(0,o.jsx)(i.xv,{color:"grey11",component:"span",noWrap:!0,variant:"small",children:n})]}),t]})},h=e=>{let{children:t,...n}=e;return(0,o.jsx)("div",{...n,className:s().status,children:(0,o.jsx)(i.xv,{align:"center",color:"inherit",component:"span",noWrap:!0,variant:"smallBold",children:t})})}},51159:function(e,t,n){"use strict";n.d(t,{O:function(){return l}});var o=n(52322),r=n(33760),i=n(5274),a=n(58161);let l=e=>{let{badgeColor:t,badgeTitle:n,tooltipContent:l}=function(e){let t=d[e.modelType];switch(e.modelStatus){case i.GJ.New:return{badgeColor:"green",badgeTitle:"New",tooltipContent:"This ".concat(t," exists only locally. Upon sync, it will be pushed to your remote repository.")};case i.GJ.Modified:return{badgeColor:"amber",badgeTitle:"Modified",tooltipContent:"This ".concat(t," has been modified locally. Upon sync, changes will be pushed to your remote repository.")};case i.GJ.Synced:return{badgeColor:"purple",badgeTitle:"Synced",tooltipContent:"This ".concat(t," is in sync with the remote repository.")};case i.GJ.Deleted:return{badgeColor:"tomato",badgeTitle:"Deleted",tooltipContent:"This ".concat(t," has been deleted locally.")};case i.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===a.t.UNAUTHORIZED)return{badgeColor:"grey",badgeTitle:"Unknown",tooltipContent:"Data from the remote repository could not be fetched (not connected to Prismic)."};if(e.authStatus===a.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);return(0,o.jsx)(r.u,{content:l,side:"bottom",children:(0,o.jsx)(r.Ct,{color:t,title:n})})},d={CustomType:"type",Slice:"slice"}},53850:function(e,t,n){"use strict";n.d(t,{b:function(){return C}});var o=n(52322),r=n(33760),i=n(39097),a=n.n(i),l=n(80218),d=n(3181),s=n(51159),c=n(89513);let u=e=>(0,o.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,o.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=e=>({hash:e.hash}),_=e=>e?Object.entries(e).reduce((e,t)=>{let[n,o]=t;return o.hash?{...e,[n]:{...o,...m(o)}}:e},{}):{},h={build:e=>({...e,screenshots:_(e.screenshots)}),variation(e,t){if(e.model.variations.length)return t?e.model.variations.find(e=>e.id===t):e.model.variations[0]}},C=e=>{let t;let{action:n,isComingSoon:i=!1,isDeleted:m=!1,onUpdateScreenshot:_,selected:C=!1,slice:p,variant:b,variationId:f}=e,g=h.variation(p,f);if(!g)return null;let j=(0,d.d7)(p,g),y=i||m,k=!y&&!!_,S="outlined"===b,T=void 0!==f;return t="selection"===e.mode?{disabled:y,interactive:!0,onClick:()=>{e.onSelectedChange(!C)}}:y?{interactive:!1}:{component:a(),href:c.Y.getBuilderPagePathname({libraryName:p.href,sliceName:p.model.name,variationId:g.id}),interactive:!0,replace:e.replace},(0,o.jsxs)(l.Zb,{"aria-label":"".concat(p.model.name," ").concat(g.name," slice card"),checked:C,"data-testid":"shared-slice-card",...t,..."outlined"===b?{size:"small",variant:"outlined"}:{},children:[void 0!==j?(0,o.jsx)(l.ZB,{alt:"Preview image",overlay:k&&!S?(0,o.jsx)(r.xu,{alignItems:"center",justifyContent:"center",children:(0,o.jsx)(x,{onClick:_})}):void 0,src:j}):(0,o.jsx)(l.ZB,{component:"div",children:(0,o.jsxs)(r.xu,{alignItems:"center",flexDirection:"column",gap:8,justifyContent:"center",children:[(0,o.jsx)(r.xv,{color:"grey11",component:"span",children:"No screenshot available"}),k&&!S?(0,o.jsx)(x,{onClick:_}):void 0]})}),(0,o.jsx)(l.eW,{action:"checkbox"===n.type&&"selection"===e.mode?(0,o.jsx)("div",{onClick:e=>e.stopPropagation(),children:(0,o.jsx)(r.XZ,{checked:C,disabled:y,onCheckedChange:e.onSelectedChange})}):"menu"===n.type?(0,o.jsxs)(r.h_,{modal:!0,children:[(0,o.jsx)(r.$F,{disabled:y,children:(0,o.jsx)(r.hU,{hiddenLabel:"Slice actions",icon:"moreVert"})}),(0,o.jsxs)(r.AW,{align:"end","data-testid":"slice-action-icon-dropdown",children:[k&&S?(0,o.jsx)(r.Xi,{onSelect:_,startIcon:(0,o.jsx)(u,{}),children:"Update screenshot"}):void 0,(0,o.jsx)(r.Xi,{onSelect:n.onRename,startIcon:(0,o.jsx)(r.I5,{name:"edit"}),children:"Rename"}),!0===n.removeDisabled&&T?(0,o.jsx)(r.u,{content:"The slice needs to have at least one variation.",side:"bottom",stableMount:!0,children:(0,o.jsx)(v,{disabled:!0,onSelect:n.onRemove})}):(0,o.jsx)(v,{disabled:!0===n.removeDisabled,onSelect:n.onRemove})]})]}):"remove"===n.type?(0,o.jsx)(r.hU,{icon:"close",onClick:()=>!y&&n.onRemove(),hiddenLabel:"Remove slice"}):"status"===n.type?(0,o.jsx)(s.O,{authStatus:n.authStatus,isOnline:n.isOnline,modelStatus:n.modelStatus,modelType:"Slice"}):void 0,subtitle:(0,o.jsxs)(o.Fragment,{children:[T?g.id:"".concat(p.model.variations.length," variation").concat(p.model.variations.length>1?"s":""),i?(0,o.jsxs)(r.xv,{color:"purple11",component:"span",variant:"small",children:[" ","• (coming soon)"]}):void 0]}),title:T?g.name:p.model.name}),k&&!T&&(0,d.cx)(p)>0?(0,o.jsx)(l.Lm,{children:"Missing screenshot"}):void 0]})},x=e=>(0,o.jsx)(r.zx,{onClick:e.onClick,renderStartIcon:()=>(0,o.jsx)(u,{color:r.rS.color.grey11}),color:"grey",children:"Update screenshot"}),v=e=>(0,o.jsx)(r.Xi,{...e,color:"tomato",startIcon:(0,o.jsx)(r.I5,{name:"delete"}),children:"Delete"})},89513:function(e,t,n){"use strict";n.d(t,{Y:function(){return o}});let o={getBuilderPagePathname:e=>"/slices/".concat(e.libraryName.replaceAll("/","--"),"/").concat(e.sliceName,"/").concat(e.variationId)}},76805:function(e,t,n){"use strict";n.d(t,{Z:function(){return s},W:function(){return d}});var o=n(52322),r=n(2784),i=n(75289);let a=e=>{let{bg:t,background:n,sx:r,withRadius:a,radius:l,children:d}=e;return(0,o.jsx)(i.xu,{sx:{p:4,bg:t||n,...a?{borderBottomLeftRadius:l,borderBottomRightRadius:l}:null,...r},children:d})},l=(0,r.createContext)("6px"),d=()=>(0,r.useContext)(l),s=e=>{let{Header:t=null,SubHeader:n=null,Body:r=null,Footer:d=null,borderFooter:s=!1,radius:c="6px",bodySx:u={},footerSx:m={},sx:_=null,bg:h,background:C,children:x,...v}=e;return(0,o.jsx)(l.Provider,{value:c,children:(0,o.jsxs)(i.Zb,{sx:{border:e=>{var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.borders))},borderRadius:c,..._},...v,children:[t||null,n||null,(0,o.jsxs)(a,{bg:h,background:C,sx:u,withRadius:!d,children:[r?(0,o.jsx)(r,{}):null,x||null]}),d?(0,o.jsx)(a,{bg:h,background:C,sx:{...s?{borderTop:e=>{let{colors:t}=e;return"1px solid ".concat(String(null==t?void 0:t.borders))}}:null,...m},radius:c,withRadius:!0,children:"object"==typeof d?d:(0,o.jsx)(d,{})}):null]})})}},17186:function(e,t,n){"use strict";n.d(t,{Sn:function(){return l},lS:function(){return o},nG:function(){return r},pq:function(){return d},rd:function(){return a},xo:function(){return i}});let o=["components"],r=["png","jpg","jpeg"],i=/^[A-Za-z0-9]+(?:_[A-Za-z0-9]+)*$/,a="placeholders/What_are_Slices_mrvome",l="SM_HELP_VIDEOS/mock_data",d="slice-machine-simulator"},66243:function(e){e.exports={flex:"Card_flex__opby1",grid:"Card_grid__VAvIS",column:"Card_column__W4ACG Card_flex__opby1",root:"Card_root__YVuvU Card_column__W4ACG Card_flex__opby1","size-small":"Card_size-small__aIlxd","size-medium":"Card_size-medium__xegz0",solid:"Card_solid__GNGar",outlined:"Card_outlined__W_dxI",interactive:"Card_interactive__rXw5L",media:"Card_media__l0kHL Card_column__W4ACG Card_flex__opby1","mediaComponent-div":"Card_mediaComponent-div__Y2_PZ Card_grid__VAvIS","mediaComponent-img":"Card_mediaComponent-img__ezOTu",mediaOverlay:"Card_mediaOverlay__Aa__Q Card_grid__VAvIS",nonMedia:"Card_nonMedia__Fv3Mz Card_flex__opby1",actions:"Card_actions__XdhOt Card_nonMedia__Fv3Mz Card_flex__opby1",footer:"Card_footer__U0HS1 Card_nonMedia__Fv3Mz Card_flex__opby1",footerTexts:"Card_footerTexts__rTXup Card_column__W4ACG Card_flex__opby1",status:"Card_status__PNN2a Card_column__W4ACG Card_flex__opby1"}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[882],{80775:function(e,t,n){"use strict";n.d(t,{aV:function(){return s},Bu:function(){return d}});var i=n(52322),l=n(33760),r=n(6277),o=n(13938),a=n.n(o);let s=e=>{let{border:t=!0,...n}=e;return(0,i.jsx)("div",{...n,className:(0,r.Z)(a().root,t&&a()["root-border"])})},d=e=>{let{actions:t,children:n,toggle:r,...o}=e;return(0,i.jsxs)("div",{...o,className:a().header,children:[(0,i.jsx)(l.xv,{color:"grey11",component:"span",noWrap:!0,variant:"bold",children:n}),r,t?(0,i.jsx)("div",{className:a().headerActions,children:t}):null]})}},87782:function(e,t,n){"use strict";n.d(t,{J9:function(){return i},U:function(){return r},XU:function(){return a},fF:function(){return l}});let i=[{name:"Image",description:"A responsive image.",icon:"image",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295520/DEV_TOOLS/SM_FIELDS/Type_Image_zyatxy.png",type:"Image"},{name:"Text",description:"A text string without formatting.",icon:"title",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295529/DEV_TOOLS/SM_FIELDS/Type_Key_Text_xrqf45.png",type:"Text"},{name:"Rich Text",description:"Text with formatting options.",icon:"textFields",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295530/DEV_TOOLS/SM_FIELDS/Type_Rich_Text_fxdyar.png",type:"StructuredText"},{name:"Boolean",description:"A true or false toggle.",icon:"toggleOff",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295526/DEV_TOOLS/SM_FIELDS/Type_Boolean_cbwg8k.png",type:"Boolean"},{name:"Number",description:"An integer or float.",icon:"pin",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295522/DEV_TOOLS/SM_FIELDS/Type_Number_o3olop.png",type:"Number"},{name:"Select",description:"A dropdown of options.",icon:"arrowDropDownCircle",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295527/DEV_TOOLS/SM_FIELDS/Type_Select_bedjei.png",type:"Select"},{name:"Link",description:"A link to a website, asset, or document.",icon:"link",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295528/DEV_TOOLS/SM_FIELDS/Type_Link_bgslgy.png",type:"Link"},{name:"Link To Media",description:"A link to a media asset.",icon:"attachFile",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295519/DEV_TOOLS/SM_FIELDS/Type_LinkToMedia_m2p0ce.png",type:"Link",variant:"LinkToMedia"},{name:"Color",description:"A color in hex format.",icon:"colorLens",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295521/DEV_TOOLS/SM_FIELDS/Type_Color_nyoeit.png",type:"Color"},{name:"Date",description:"A date without time.",icon:"dateRange",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295525/DEV_TOOLS/SM_FIELDS/Type_Date_dsuaeq.png",type:"Date"},{name:"Timestamp",description:"A date and time.",icon:"schedule",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295524/DEV_TOOLS/SM_FIELDS/Type_Timestamp_fkr5iw.png",type:"Timestamp"},{name:"Embed",description:"A video, song, or oEmbed link.",icon:"code",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295523/DEV_TOOLS/SM_FIELDS/Type_Embed_wwssvd.png",type:"Embed"},{name:"Geopoint",description:"A geographical coordinate.",icon:"place",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295522/DEV_TOOLS/SM_FIELDS/Type_GeoPoint_lpq0sm.png",type:"GeoPoint"},{name:"Content Relationship",description:"A reference to a Prismic document.",icon:"settingsEthernet",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295527/DEV_TOOLS/SM_FIELDS/Type_Content_RelationShip_s4z4nh.png",type:"Link",variant:"ContentRelationship"}],l={name:"UID",description:"Unique Identifier",icon:"tag",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295519/DEV_TOOLS/SM_FIELDS/Type_UID_hrwzug.png",type:"UID"},r={name:"Repeatable Group",description:"A set of fields that editors can repeat.",icon:"createNewFolder",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721314577/DEV_TOOLS/SM_FIELDS/Type_Group_uwwco0.png",type:"Group"},o={...r,variant:"NestedGroup"},a=[...i,l,r,o]},6697:function(e,t,n){"use strict";n.d(t,{X:function(){return r}});var i=n(52322),l=n(33760);let r=e=>{let t;let{status:n}=e;switch(n){case"pending":t={icon:(0,i.jsx)(l._3,{color:"grey11"}),text:"Saving..."};break;case"failed":t={icon:(0,i.jsx)(l.I5,{name:"close",color:"tomato11",size:"medium"}),text:"Failed to save"};break;case"done":t={icon:(0,i.jsx)(l.I5,{name:"check",color:"green11",size:"medium"}),text:"Auto-saved"}}return(0,i.jsxs)(l.xu,{gap:8,alignItems:"center",children:[t.icon,(0,i.jsx)(l.xv,{color:"grey11",children:t.text})]})}},81271:function(e,t,n){"use strict";n.d(t,{S:function(){return o}});var i=n(52322),l=n(33760),r=n(87782);function o(e){let{open:t,onOpenChange:n,disabled:o=!1,onSelectField:s,fields:d,triggerDataTestId:c="add-field",trigger:u}=e,p=d.filter(e=>r.J9.some(t=>t.name===e.name)||e.name===r.fF.name),m=d.find(e=>e.name===r.U.name);return(0,i.jsxs)(l.h_,{open:t,onOpenChange:n,children:[(0,i.jsx)(l.$F,{disabled:o,children:null!=u?u:(0,i.jsx)(l.zx,{startIcon:"add",color:"grey","data-testid":c,children:"Add a field"})}),(0,i.jsxs)(l.AW,{align:"end",maxHeight:400,collisionPadding:8,children:[(0,i.jsx)(l.Ju,{children:"Single fields"}),p.map(e=>(0,i.jsx)(a,{field:e,onSelectField:s},e.name)),m&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l.Ju,{children:"Set of fields"}),(0,i.jsx)(a,{field:m,onSelectField:s})]})]})]})}function a(e){let{field:t,onSelectField:n}=e,{type:r,variant:o,name:a,icon:s,description:d,thumbnail:c}=t;return(0,i.jsx)(l.Xi,{startIcon:(0,i.jsx)(l.I5,{name:s,size:"large"}),description:d,onSelect:()=>n(null!=o?o:r),renderTooltip:e=>(0,i.jsx)(l.u,{visible:!0,variant:"custom",content:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l.Ee,{src:c,borderRadius:4,sx:{height:170,width:278},animateOnLoad:!1}),(0,i.jsx)(l.xv,{color:"white",children:"How it will look for content editors."})]}),align:"start",side:"left",sideOffset:4,animation:"none",children:e}),children:a},"".concat(r).concat(o?"-".concat(o):""))}},47760:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var i=n(52322),l=n(61183);n(2784);var r=n(59326),o=n(75289);l.Z.registerLanguage("svelte",e=>({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}]}]}));let a=["javascript","bash","xml","html","json"];var s=e=>{var t;let{children:n,lang:s,sx:d,codeStyle:c,codeClass:u,Header:p}=e,{theme:m}=(0,r.B7)(),x=s?l.Z.highlight(n,{language:"vue"===s?"html":s}).value:l.Z.highlightAuto(n,a).value;return(0,i.jsxs)(o.kC,{as:"pre",sx:d,children:[p?(0,i.jsx)(p,{}):null,(0,i.jsx)("code",{className:"hljs".concat(u?" ".concat(u):""),style:{overflowX:"auto",padding:"3px 5px",borderRadius:"6px",border:"1px solid",borderColor:String(null===(t=m.colors)||void 0===t?void 0:t.textClear),...c},dangerouslySetInnerHTML:{__html:x}})]})}},28325:function(e,t,n){"use strict";n.d(t,{J:function(){return o},k:function(){return r}});var i=n(52322);n(2784);var l=n(75289);let r=e=>{let{children:t,sx:n,...r}=e;return(0,i.jsx)(l.xu,{sx:{display:["block","block","flex"],flexWrap:"wrap",justifyContent:"space-between",...n},...r,children:t})},o=e=>{let{children:t,cols:n=2}=e;return(0,i.jsx)(l.xu,{sx:{flex:"0 ".concat(100/n-1,"%"),mb:1},children:t})}},81699:function(e,t,n){"use strict";n.d(t,{kp:function(){return d},sP:function(){return c},w8:function(){return u},Hq:function(){return m}});var i,l,r=n(52322),o=n(63397),a=n(2784),s=n(75289),d=e=>{let{field:t,meta:n,fieldName:i,label:l,focusOnNewEntry:d=!0,inputPlaceholder:c,buttonLabel:u}=e,[p,m]=(0,a.useState)(n.value.length),x=(0,a.useRef)(Array(n.value.length));return(0,a.useEffect)(()=>{x.current=x.current.slice(0,n.value.length)},[n.value.length]),(0,a.useEffect)(()=>{let e=x.current.length;d&&e>p&&x.current[e-1].focus(),m(e)},[x.current.length,d,p]),(0,r.jsxs)(a.Fragment,{children:[(0,r.jsxs)(s.__,{variant:"label.primary",htmlFor:i,children:[l,n.touched&&n.error?(0,r.jsx)(s.xv,{as:"span",variant:"text.labelError",children:n.error}):null]}),(0,r.jsx)(o.F2,{name:i,id:i,...t,render:e=>(0,r.jsxs)("div",{children:[t.value&&t.value.length>0?t.value.map((t,n)=>(0,r.jsxs)(s.kC,{my:2,children:[(0,r.jsx)(s.II,{placeholder:c,name:"".concat(i,".").concat(n),value:t,ref:e=>x.current[n]=e,onChange:t=>{let{target:{value:i}}=t;return e.replace(n,i)}}),(0,r.jsx)(s.zx,{ml:2,type:"button",variant:"secondary",onClick:()=>e.remove(n),children:"-"})]},"".concat(i,"-").concat(+n+1))):null,(0,r.jsx)(s.zx,{type:"button",onClick:()=>e.insert(t.value.length,""),children:u})]})})]})},c=e=>{let{initialValues:t,meta:n,label:i,fieldName:l,onChange:a,...d}=e;return(0,r.jsxs)(s.__,{variant:"label.border",...d,children:[(0,r.jsx)(o.gN,{as:s.XZ,type:"checkbox",name:l,onChange:()=>a(!n.value),checked:n.value}),i]})},u=e=>{let{field:t,label:n,defaultValue:i,onChange:l,controlledValue:o,setControlledValue:s,buildControlledValue:d}=e,[u,p]=(0,a.useState)(i||t.defaultValue||!1);return(0,a.useEffect)(()=>{d?s(d(o,u)):s(d)},[u,o,d]),(0,r.jsx)(c,{meta:{value:u},fieldName:t.name,onChange:e=>p(e)&&l&&l(e),label:"function"==typeof n?n(o,u):n})};(i=l||(l={}))[i.ERROR=0]="ERROR",i[i.DISABLED=1]="DISABLED",i[i.WARNING=2]="WARNING";let p=e=>{let t={"&::placeholder":{color:"#C9D0D8"}};switch(e){case 1:return{...t,border:"1px solid #E6E6EA",backgroundColor:"#F3F5F7"};case 0:return{...t,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 2:return{...t,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 t}},m=e=>{let{sx:t={},field:n,meta:i,formField:l,fieldName:a,fields:d,initialValues:c,isDisabled:u,autoFocus:m}=e,x=i.error?0:u||l.disabled?1:void 0;return(0,r.jsxs)(s.xu,{sx:t,children:[(0,r.jsxs)(s.__,{variant:"label.primary",htmlFor:a,children:[l.label||a,i.touched&&i.error?(0,r.jsx)(s.xv,{as:"span",variant:"text.labelError",children:i.error}):null]}),(0,r.jsx)(o.gN,{id:a,name:a,type:"text",placeholder:l.placeholder||l.label||a,...l.fieldLevelValidation&&c?{validate:e=>l.fieldLevelValidation&&l.fieldLevelValidation({value:e,fields:d,initialId:c.id})}:null,...n,as:s.II,sx:p(x),disabled:u||l.disabled,autoFocus:null!=m?m:l.autoFocus})]})}},89753:function(e,t,n){"use strict";var i=n(52322),l=n(2784),r=n(75289);let o=(0,l.forwardRef)((e,t)=>{let{children:n,Component:l=r.kC,sx:o={},...a}=e;return(0,i.jsx)(l,{as:"li",sx:{p:3,mx:3,alignItems:"center",variant:"styles.listItem",...o},ref:t,...a,children:n})});t.Z=o},4687:function(e,t,n){"use strict";n.d(t,{Z:function(){return y}});var i=n(52322),l=n(5446),r=n(2784),o=n(40023),a=n(951),s=n(8799),d=n(18978),c=n(59326),u=n(75289),p=n(89753),m=n(96666),x=n(33710),h=n(28316),f=n(65077);let g=e=>{let{children:t}=e;return(0,h.createPortal)((0,i.jsx)(f.xR,{children:t}),document.body)},v=e=>{let{text:t,as:n,sx:l={},...o}=e,a=(0,r.useRef)(null),[s,d]=(0,r.useState)(null),c=()=>{d(a.current&&a.current.offsetWidth<a.current.scrollWidth)};return(0,r.useEffect)(()=>(c(),window.addEventListener("resize",c),()=>{window.removeEventListener("resize",c)}),[]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(u.xv,{"data-for":t,"data-tip":!0,sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...l},as:n,ref:a,...o,children:t}),s&&(0,i.jsx)(g,{children:(0,i.jsx)(x.Z,{id:t,type:"dark",multiline:!0,border:!0,borderColor:"black",place:"bottom",effect:"solid",children:t})})]})};var b=e=>{var t,n;let{text:l,sliceFieldName:r,theme:o,WidgetIcon:a}=e;return(0,i.jsxs)(u.kC,{sx:{alignItems:"center",position:"relative"},children:[(0,i.jsx)(a,{size:28,style:{color:null===(t=o.colors)||void 0===t?void 0:t.primary,marginRight:"8px",borderRadius:"4px",padding:"4px",border:"2px solid",borderColor:null===(n=o.colors)||void 0===n?void 0:n.primary}}),(0,i.jsx)(v,{text:l,as:"p",sx:{py:0,px:1,fontWeight:"label",fontSize:"15px"},"data-testid":"field-name"}),(0,i.jsx)(u.xv,{as:"p",sx:{display:["none","none","initial"],fontSize:"14px",ml:1,color:"textClear"},"data-testid":"field-id",children:r})]})},y=function(e){let{item:t,index:n,deleteItem:x,enterEditMode:h,modelFieldName:f,renderFieldAccessor:g,HintElement:v,CustomEditElement:y,CustomEditElements:j,widget:_,draggableId:S,testId:k,isRepeatableCustomType:I,children:T}=e,{theme:F}=(0,c.B7)(),{key:E,value:{config:C,type:w}}=t;return(0,i.jsx)(r.Fragment,{children:(0,i.jsx)(o._l,{draggableId:S,index:n,children:e=>{var o,c,S,L,M;return(0,i.jsx)(r.Fragment,{children:(0,i.jsxs)(p.Z,{"data-testid":k,ref:e.innerRef,...e.draggableProps,Component:u.xu,sx:{p:0,mx:0,my:3},children:[(0,i.jsxs)(u.kC,{sx:{width:"100%"},children:[(0,i.jsx)(m.Z,{label:"Reorder slice field (drag and drop)",Icon:d.Fm7,color:null===(o=F.colors)||void 0===o?void 0:o.icons,mr:1,mt:3,...e.dragHandleProps}),(0,i.jsxs)(u.xu,{sx:{bg:"headSection",width:"100%",borderRadius:"3px",border:e=>{var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.borders))}},children:[(0,i.jsxs)(u.kC,{sx:{p:3,alignItems:"center",justifyContent:"space-between",width:"100%"},children:[(0,i.jsx)(b,{theme:F,text:(null==C?void 0:C.label)||E,sliceFieldName:g&&g(E),WidgetIcon:_.Meta.icon}),(0,i.jsxs)(u.kC,{children:[j||null,y||(0,i.jsx)(m.Z,{size:22,Icon:a.$iz,label:"Edit field",sx:{cursor:"pointer",color:null===(c=F.colors)||void 0===c?void 0:c.icons},onClick:()=>h([E,t.value],f,n)}),!(!0===I&&"UID"==w)&&(0,i.jsxs)(l.v2,{children:[(0,i.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,i.jsx)(s.FQA,{size:20,color:null===(S=F.colors)||void 0===S?void 0:S.icons,style:{pointerEvents:"none"}})}),(0,i.jsx)(l.qy,{style:{background:null===(L=F.colors)||void 0===L?void 0:L.gray,border:"1px solid",borderRadius:"3px",borderColor:null===(M=F.colors)||void 0===M?void 0:M.borders,outline:"0"},children:(0,i.jsx)(l.sN,{style:{padding:"6px",cursor:"pointer"},onSelect:()=>x(E),children:"Delete field"})})]})]})]}),v||null]})]}),T]})})}})})}},96666:function(e,t,n){"use strict";var i=n(52322),l=n(75289);let r=(e,t)=>t?{border:e=>{let{colors:t}=e;return"1px solid ".concat(t.error)}}:e?{border:e=>{let{colors:t}=e;return"1px solid ".concat(t.primary)}}:{border:e=>{let{colors:t}=e;return"1px solid ".concat(t.borders)}};t.Z=e=>{let{sx:t=null,onClick:n=()=>null,label:o,Icon:a,error:s=null,size:d=16,fitButton:c=!1,active:u=!1,useActive:p=!1,activeSx:m=r,...x}=e;return(0,i.jsx)(l.hU,{onClick:n,"aria-label":o,type:"button",sx:{...c?{width:d,height:d}:null,...p&&m(u,s),...t},...x,children:(0,i.jsx)(a,{size:d})})}},4205:function(e,t,n){"use strict";var i=n(52322),l=n(63397),r=n(2784),o=n(75289),a=n(81699),s=n(1646);t.Z=e=>{let{fieldName:t,formField:n,fields:d,initialValues:c,autoFocus:u}=e,[p,m,x]=(0,l.U$)(t),h=n.component;return(0,i.jsx)(o.xu,{sx:{mt:2,alignItems:"center",...n.type===s.h.CHECKBOX?{display:"flex",height:"130%"}:null},children:h?(0,i.jsx)(h,{meta:m,field:p,helpers:x,fieldName:t,formField:n,initialValues:c}):(0,i.jsxs)(r.Fragment,{children:[n.type===s.h.INPUT?(0,i.jsx)(a.Hq,{meta:m,field:p,fields:d,formField:n,fieldName:t,initialValues:c,autoFocus:u}):null,n.type===s.h.CHECKBOX&&(0,i.jsx)(a.sP,{meta:m,label:n.label,fieldName:t,initialValues:c,onChange:e=>x.setValue(e)})]})})}},64602:function(e,t,n){"use strict";n.d(t,{Z:function(){return M}});var i=n(52322),l=n(37149),r=n.n(l),o=n(59326),a=n(75289),s=n(65413),d=n(76805),c=n(2784),u=n(92928);let p=e=>{let{children:t,...n}=e;return(0,i.jsx)(a.xu,{as:"ul",sx:{p:0,m:0,px:e=>"calc(".concat(e.space[3],"px + 8px)"),borderBottom:"1px solid #DFE1E5",position:"relative"},...n,children:t})};p.tabsRole="TabList";let m=e=>{let{children:t,...n}=e,{theme:l}=(0,o.B7)();return(0,i.jsx)(u.OK,{...n,style:{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",...n.selected?{borderBottom:"3px solid ".concat(l.colors.primary),color:l.colors.text,fontWeight:"500",opacity:"1",backgroundColor:"transparent"}:{borderBottom:"3px solid transparent"}},children:t})};m.tabsRole="Tab";var x=(0,c.memo)(e=>{let{children:t,Footer:n,Header:l,tabs:r,bodySx:o,footerSx:s,defaultIndex:x=0}=e,[h,f]=(0,c.useState)(x);return(0,i.jsx)(d.Z,{borderFooter:!0,footerSx:{p:0,...s},bodySx:{p:0,...o},sx:{border:"none"},Header:l,Footer:n,children:(0,i.jsxs)(u.mQ,{defaultIndex:x,onSelect:e=>f(e),children:[(0,i.jsx)(p,{children:(r||[]).map(e=>(0,i.jsx)(m,{children:e},e))}),c.Children.map(t,(e,t)=>(0,i.jsx)(a.xu,{sx:{p:e=>"calc(".concat(e.space[3],"px + 8px)"),display:t===h?"block":"none"},children:(0,i.jsx)(u.x4,{children:e})}))]})})}),h=n(28325),f=e=>{var t,n;let{text:l,sliceFieldName:r,theme:o,WidgetIcon:s}=e;return(0,i.jsxs)(a.kC,{sx:{alignItems:"center"},children:[(0,i.jsx)(s,{size:28,style:{color:null===(t=o.colors)||void 0===t?void 0:t.primary,marginRight:"8px",borderRadius:"4px",padding:"4px",border:"2px solid",borderColor:null===(n=o.colors)||void 0===n?void 0:n.primary}}),(0,i.jsx)(a.xv,{as:"p","data-testid":"item-header-text",sx:{py:0,px:1,fontWeight:"label",fontSize:"15px"},children:l}),(0,i.jsx)(a.xv,{as:"p",sx:{display:["none","none","initial"],fontSize:"14px",ml:1,color:"textClear"},children:r})]})},g=n(11104),v=n(22863),b=n(5632),y=n(65186),j=n(17186);let _=()=>{let e=(0,b.useRouter)();return(0,i.jsxs)(a.xu,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",padding:"60px"},children:[(0,i.jsx)(y.wr$,{size:48,color:"#C9D0D8"}),(0,i.jsx)(a.xu,{sx:{height:"12px"}}),(0,i.jsx)(a.xv,{color:"text",sx:{fontWeight:600,fontSize:"24px",lineHeight:"32px",textAlign:"center"},children:"Your mock data has moved"}),(0,i.jsx)(a.xu,{sx:{height:"8px"}}),(0,i.jsx)(a.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,i.jsx)(a.xu,{sx:{height:"24px"}}),(0,i.jsx)(a.zx,{onClick:t=>{t.preventDefault(),window.open("".concat(e.asPath,"/simulator"),j.pq)},children:"Go to the Slice Simulator"})]})};var S=n(67875),k=n(85357),I=n(38369),T=n(4205),F=n(63397),E=n(99510);function C(){let[{value:e}]=(0,F.U$)("config.label"),[{value:t},n,i]=(0,F.U$)("id"),l=(0,c.useRef)(null!=n.initialValue&&n.initialValue.length>0);(0,c.useEffect)(()=>{l.current||null==e||i.setValue((0,E.lV)(e),!1)},[e]),(0,c.useEffect)(()=>{let n=null==t||0===t.length;if(l.current){if(!n)return;l.current=!1}else n||null!=e&&t===(0,E.lV)(e)||(l.current=!0)},[t])}var w=(0,c.memo)(e=>{let{formId:t,initialValues:n,validationSchema:l,onSave:r,FormFields:o,children:s}=e;return(0,i.jsx)(a.xu,{children:(0,i.jsx)(F.J9,{initialValues:n,validationSchema:l,onSubmit:(e,t)=>{let{id:n,...i}=e;r({newKey:n,value:Object.entries(i).reduce((e,t)=>{let[n,i]=t;if(typeof i!==Boolean&&!i){var l;let t=null===(l=o[n])||void 0===l?void 0:l.defaultValue;if(void 0!==t)return{...e,[n]:t}}return{...e,[n]:i}},{})})},children:e=>(0,i.jsxs)(F.l0,{id:t,children:[(0,i.jsx)(C,{}),s({...e,initialValues:n})]})})})});function L(e){let{children:t}=e,n=(0,d.W)();return(0,i.jsx)(a.kC,{sx:{position:"sticky",zIndex:1,top:0,p:3,bg:"headSection",alignItems:"center",justifyContent:"space-between",borderTopLeftRadius:n,borderTopRightRadius:n},children:t})}r().setAppElement("#__next");var M=e=>{let{close:t,data:n,fields:l,onSave:r,zoneType:d}=e,{theme:c}=(0,o.B7)();if(!n.isOpen)return null;let{field:[u,p]}=n,m=(0,I.t)(S.C,p.config,p.type);if(!m)return(0,i.jsxs)("div",{children:[p.type," not found"]});let{Meta:{icon:b},FormFields:y,Form:j,schema:F}=m,E={...(0,v.f7)((0,k.B9)(y,"id")),...m.prepareInitialValues?m.prepareInitialValues(p.config):p.config},{res:C,err:M}=(()=>{try{return{res:F.validateSync({type:p.type,config:E},{stripUnknown:!0})}}catch(e){return{err:e}}})();M&&(console.error("[EditModal] Failed to validate field of type ".concat(p.type,".\n Please update model.json accordingly.")),console.error(M));let O={id:u,config:C?C.config:E},[N,A]=y.id.validate.matches,D=s.object().shape({id:s.string().matches(N,A).min(3).max(35).required(),config:F.fields.config}),q="".concat("edit-modal-form","-").concat(Math.random().toString());return(0,i.jsx)(g.Z,{isOpen:!0,shouldCloseOnOverlayClick:!0,onRequestClose:t,contentLabel:"Widget Form Modal",children:(0,i.jsx)(w,{apiId:u,formId:q,initialValues:O,validationSchema:D,FormFields:y,onSave:e=>{let{newKey:n,value:i}=e;r({apiId:u,newKey:n,value:{...p,...i}}),t()},children:e=>{let{values:{id:n,config:{label:r}},isValid:o,isSubmitting:s,initialValues:p}=e,m=j?(0,i.jsx)(j,{...e,fields:l},"field-model-tab-content"):(0,i.jsx)(h.k,{children:Object.entries(y).map(e=>{let[t,n]=e;return(0,i.jsx)(h.J,{children:(0,i.jsx)(T.Z,{fieldName:(0,v.lm)(t),formField:n,fields:l,initialValues:p,autoFocus:""===u&&void 0})},t)})},"field-model-tab-content"),g=["Field Model"],S=[m];if("slice"===d){let e=(0,i.jsx)(a.xu,{children:(0,i.jsx)(_,{})},"mock-data-tab-content");g.push("Mock Data"),S.push(e)}return(0,i.jsx)(x,{borderFooter:!0,footerSx:{position:"sticky",bottom:0,p:0},tabs:g,Header:(0,i.jsxs)(L,{children:[(0,i.jsx)(f,{theme:c,text:r||n,WidgetIcon:b}),(0,i.jsx)(a.x8,{onClick:t,type:"button"})]}),Footer:(0,i.jsxs)(a.kC,{sx:{position:"sticky",bottom:0,alignItems:"space-between",bg:"headSection",p:3},children:[(0,i.jsx)(a.xu,{sx:{ml:"auto"}}),(0,i.jsx)(a.zx,{mr:2,type:"button",onClick:t,variant:"secondary",children:"Cancel"}),(0,i.jsx)(a.zx,{form:q,type:"submit",disabled:!o&&s,sx:{fontWeight:"400",paddingBlock:"8px",paddingInline:"16px",fontSize:"14px",borderRadius:"4px"},children:"Done"})]}),children:S})}})})}},56309:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}});var i=n(52322),l=n(2784),r=n(49857),o=n(70647),a=n(77245),s=n(8799),d=n(65186),c=n(59326),u=n(75289),p=n(47760);let m={position:"relative",top:"3px"};var x=e=>{var t,n,r;let{code:o,lang:x}=e,{theme:h}=(0,c.B7)(),[f,g]=(0,l.useState)(!1);return o?(0,i.jsxs)(u.kC,{sx:{p:2,px:3,alignItems:"center",borderTop:"1px solid",borderColor:"borders",justifyContent:"space-between"},children:[(0,i.jsxs)(u.kC,{sx:{alignItems:"center",display:["none","none","flex"],maxWidth:"80%"},children:[(0,i.jsx)(s.vcz,{size:26,color:null==h?void 0:null===(t=h.colors)||void 0===t?void 0:t.icons,style:{border:"1px solid",borderColor:null==h?void 0:null===(n=h.colors)||void 0===n?void 0:n.borders,borderRadius:"3px",padding:"4px",marginRight:"2px"}}),(0,i.jsx)(p.Z,{sx:{margin:"0px 8px",border:"none",borderRadius:"3px",fontSize:"13px"},lang:x,children:o})]}),(0,i.jsx)(u.xu,{children:(0,i.jsxs)(u.zx,{"aria-label":f?"Code snippet copied":"Copy code snippet",onClick:()=>{o&&navigator.clipboard.writeText(o).then(()=>{g(!0),setTimeout(()=>{g(!1)},1200)})},variant:"textButton",children:[f?(0,i.jsx)(d.HhX,{size:16,color:null==h?void 0:null===(r=h.colors)||void 0===r?void 0:r.success,style:m}):(0,i.jsx)(a.LhG,{size:16,style:m}),(0,i.jsx)(u.xv,{as:"span",sx:{display:["none","inline","none","inline"]},children:"\xa0Copy"})]})})]}):null},h=e=>{let{show:t,renderHintBase:n,item:l,hintItemName:a}=e,s=n({item:l}),{data:d,error:c}=(0,r.ZP)(s,async()=>await o.managerClient.snippets.readSnippets({fieldPath:s.split("."),model:l.value,itemName:a}));if(c&&console.error(c),!d||c)return null;let u=d.snippets||[];return u[0]?(0,i.jsx)("div",{style:{display:t?"initial":"none"},children:(0,i.jsx)(x,{code:u[0].code,lang:u[0].language})}):null}},18183:function(e,t,n){"use strict";n.d(t,{Z:function(){return M}});var i=n(52322),l=n(33760),r=n(13980),o=n(2784),a=n(65077),s=n(93188),d=n(80775),c=n(87782),u=n(81271);function p(e){let{open:t,onOpenChange:n,onConfirm:r}=e;return(0,i.jsxs)(l.Vq,{open:t,onOpenChange:n,size:"small",children:[(0,i.jsx)(l.fK,{title:"Static zone"}),(0,i.jsx)(l.cZ,{children:(0,i.jsx)(l.xr,{children:(0,i.jsxs)(l.xu,{as:"article",flexDirection:"column",padding:16,gap:4,children:[(0,i.jsx)(l.xv,{sx:{marginBottom:4},color:"purple9",variant:"smallBold",children:"About"}),(0,i.jsx)(l.xv,{variant:"h3",children:"What is the static zone?"}),(0,i.jsx)(l.xv,{color:"grey11",children:"The static zone in Prismic page types contain fields that are always present on the page. Use it for essential information like a page's title, page design settings, or metadata. Unlike slices, which can be added or removed, static zone fields remain fixed."}),(0,i.jsx)(l.nk,{src:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1723540305/DEV_TOOLS/STATES/Explication_vide%CC%81o_zone_statique_phibeq.mp4",sizing:"contain",autoPlay:!0,loop:!0})]})})}),(0,i.jsx)(l.kX,{children:(0,i.jsx)(l._d,{size:"medium",sx:{flexGrow:1},onClick:()=>{r(),n(!1)},children:"Got it"})})]})}var m=n(4315);let x=(0,o.forwardRef)((e,t)=>{var n;return(0,i.jsx)(l.zx,{...e,ref:t,startIcon:"add",color:"grey","aria-label":"Add a field","data-testid":null!==(n=e["data-testid"])&&void 0!==n?n:"add-field"})});function h(e){let{zoneTypeFormat:t,...n}=e;return"page"===t?(0,i.jsx)(g,{...n}):(0,i.jsx)(v,{...n})}let f=(0,i.jsx)("div",{style:{position:"absolute",bottom:0,right:0}});function g(e){let{disabled:t,fields:n,triggerDataTestId:r,onSelectField:a}=e,[s,d]=(0,o.useState)(!1),[c,h]=(0,o.useState)(!1),[g,v]=(0,m.V)("staticFieldsInfoDialogDismissed",!1);return(0,i.jsxs)(l.xu,{position:"relative",children:[(0,i.jsx)(x,{onClick:()=>{g?d(!0):h(!0)},"data-testid":r}),(0,i.jsx)(p,{open:c,onOpenChange:e=>{h(e),e||d(!0)},onConfirm:()=>v(!0)}),(0,i.jsx)(u.S,{open:s,onOpenChange:d,disabled:t,onSelectField:a,fields:n,trigger:f})]})}function v(e){let{disabled:t,fields:n,triggerDataTestId:l,onSelectField:r}=e;return(0,i.jsx)(u.S,{disabled:t,onSelectField:r,fields:n,trigger:(0,i.jsx)(x,{"data-testid":l})})}var b=n(67875),y=n(46622),j=n(40023),_=n(75289),S=n(89753),k=n(4687),I=n(38369),T=n(56309),F=e=>{let{fields:t,title:n,tabId:l,enterEditMode:r,enterSelectMode:o,onDragEnd:a,renderFieldAccessor:s,onDeleteItem:d,onSave:c,showHints:u,renderHintBase:p,isRepeatable:m,testId:x,isRepeatableCustomType:h}=e;return(0,i.jsx)(j.Z5,{onDragEnd:a,children:(0,i.jsx)(j.bK,{droppableId:n,children:(e,n)=>(0,i.jsxs)(_.xu,{as:"ul",ref:e.innerRef,...e.droppableProps,"data-testid":x,sx:{paddingInline:"16px !important"},children:[t.map((e,t)=>{let{value:{config:a,type:x}}=e,f=(0,I.t)(b.C,a,x);if(!f)return(0,i.jsx)(S.Z,{children:(0,i.jsxs)(_.xv,{children:['Field type "',x,'" not supported']})});let g={item:e,index:t,tabId:l,widget:f,showHints:u,key:e.key,enterSelectMode:o,renderFieldAccessor:s,enterEditMode:r,parentSnapshot:n,deleteItem:d,saveItem:c,draggableId:"list-item-".concat(e.key),isRepeatableCustomType:h,testId:"list-item-".concat(e.key)},v=(0,i.jsx)(T.Z,{item:e,show:u,isRepeatable:m,renderHintBase:p,hintItemName:f.hintItemName,Widgets:b.C,typeName:f.CUSTOM_NAME||f.TYPE_NAME});if(f.CustomListItem){let{CustomListItem:e}=f;return(0,i.jsx)(e,{...g,HintElement:v})}return(0,i.jsx)(k.Z,{...g,HintElement:v})}),e.placeholder]})})})},E=n(83288),C=n.n(E);let w=e=>{let{zoneType:t,heading:n="Your ".concat(t," has no fields yet"),action:r}=e;return(0,i.jsxs)("div",{className:C().root,children:[(0,i.jsxs)("div",{children:[(0,i.jsx)(l.xv,{variant:"bold",children:n}),(0,i.jsx)(l.xv,{color:"grey11",children:"A field is an input for content (e.g. text, images, links)."})]}),r]})},L=e=>{let t,{zoneType:n,zoneTypeFormat:r,tabId:p,title:m,fields:x,poolOfFieldsToCheck:f,widgetsArray:g,isRepeatable:v,onDeleteItem:j,onDragEnd:_,EditModal:S,onSave:k,dataTip:I,renderHintBase:T,renderFieldAccessor:E,testId:C,isRepeatableCustomType:L,emptyStateHeading:M}=e,O=(()=>{let e=!!Object.entries(f).find(e=>{let[,{value:t}]=e;return"UID"===t.type}),t=g.filter(e=>{let{TYPE_NAME:t}=e;return"UID"!==t});return e?t:[...t,g.find(e=>{let{TYPE_NAME:t}=e;return"UID"===t})]})(),[N,A]=(0,o.useState)(!1),[D,q]=(0,o.useState)({isOpen:!1}),R={onSelectField:e=>{q({isOpen:!0,field:["",b.C[e].create("")]})},fields:O.filter(Boolean).map(e=>{let{TYPE_NAME:t,CUSTOM_NAME:n}=e;return c.XU.find(e=>e.type===t&&(void 0===n||e.variant===n))}),triggerDataTestId:v?"add-field-in-items":void 0};return"slice"===n&&x.length>0?t=(0,i.jsx)(u.S,{...R}):"customType"===n&&(t=(0,i.jsx)(h,{...R,zoneTypeFormat:r})),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(d.Bu,{actions:(0,i.jsxs)(i.Fragment,{children:[x.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l.xv,{color:"grey11",component:"span",noWrap:!0,children:"Show code snippets?"}),(0,i.jsx)(l.rs,{checked:N,onCheckedChange:A,size:"small",style:{flexShrink:0},"data-testid":"code-snippets-switch"})]}),t]}),children:m}),0===x.length&&"slice"===n?(0,i.jsx)(w,{zoneType:"customType"===n?"page"===r?"page type":"custom type":n,heading:M,action:(0,i.jsx)(u.S,{...R})}):x.length>0?(0,i.jsx)(a.xR,{children:(0,i.jsx)(F,{tabId:p,isRepeatable:v,fields:x,showHints:N,dataTip:I,title:m,renderFieldAccessor:E,renderHintBase:T,enterEditMode:e=>{q({isOpen:!0,field:e});let[t,n]=e;s.Xe.track({event:"field:settings-opened",id:t,name:n.config.label,type:n.type,isInAGroup:!1,contentType:(0,y.T)(window.location.pathname)})},onDragEnd:_,onDeleteItem:j,onSave:k,testId:C,isRepeatableCustomType:L})}):void 0,(0,i.jsx)(S,{data:D,close:()=>{q({isOpen:!1})},onSave:k,fields:f,zoneType:n})]})};L.propTypes={isRepeatable:r.bool,title:r.string.isRequired,dataTip:r.string.isRequired,onSave:r.func.isRequired,onDragEnd:r.func.isRequired,onDeleteItem:r.func.isRequired,poolOfFieldsToCheck:(0,r.arrayOf)((0,r.shape)({key:r.string,value:r.object})),renderHintBase:r.func.isRequired,renderFieldAccessor:r.func.isRequired,widgetsArray:r.array.isRequired,fields:(0,r.arrayOf)((0,r.shape)({key:r.string.isRequired,value:(0,r.shape)({config:r.object,fields:r.array,type:r.string.isRequired})}))};var M=L},38369:function(e,t,n){"use strict";n.d(t,{t:function(){return l}});var i=n(59050);let l=(e,t,n)=>{if("Link"===n)switch(null==t?void 0:t.select){case"document":return e.ContentRelationship;case"media":return e.LinkToMedia;default:return e.Link}if(n===i.GroupFieldType){var l;return null!==(l=e.Group)&&void 0!==l?l:e.NestedGroup}return e[n]}},25273:function(e,t,n){"use strict";n.d(t,{Jp:function(){return o},OR:function(){return r}});var i=n(17186),l=n(37429);let r={label:(0,l.II)("Label",{required:"This field is required",max:!0},void 0,void 0,"Label for content creators (defaults to field type)",!0),id:(0,l.II)("API ID*",{min:!0,max:!0,required:"This field is required",matches:[i.xo,"No special characters allowed (except _)"]},e=>{let{value:t,fields:n,initialId:i}=e;return t?n.find(e=>{let{key:n}=e;return n===t})&&t!==i?'Field "'.concat(t,'" already exists.'):void 0:"Field is required"},void 0,"A unique identifier for the field (e.g. buttonLink)")},o={...r,placeholder:(0,l.II)("Placeholder",{required:"This field is required",max:[100,"String is too long. Max: 100"]},void 0,void 0,"Placeholder text for content creators")}},37429:function(e,t,n){"use strict";n.d(t,{II:function(){return d},Jg:function(){return r}});var i=n(22863),l=n(1646);let r=function(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=!(arguments.length>2)||void 0===arguments[2]||arguments[2];return{type:l.h.CHECKBOX,validate:{required:(0,i.MJ)(t,s)},required:t,label:e,defaultValue:n,yupType:"boolean"}},o=[3,"String is too short. Min: 3"],a=[35,"String is too long. Max: 35"],s=["Field is required"],d=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{min:o,max:a,required:s},n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,d=arguments.length>4?arguments[4]:void 0,c=arguments.length>5&&void 0!==arguments[5]&&arguments[5],{min:u,max:p,required:m,matches:x}=t||{};return{type:l.h.INPUT,label:e,validate:{required:(0,i.MJ)(m,s),min:(0,i.MJ)(u,o),max:(0,i.MJ)(p,a),matches:x},defaultValue:r,fieldLevelValidation:n,yupType:"string",placeholder:d,autoFocus:c}}},22863:function(e,t,n){"use strict";n.d(t,{MJ:function(){return a},f7:function(){return s},gc:function(){return d},lm:function(){return o}});var i=n(65413),l=n(1646);let r=e=>null===e.defaultValue?void 0:void 0!==e.defaultValue?e.defaultValue:e.type===l.h.CHECKBOX||(e.type===l.h.INPUT?"":e.type===l.h.SELECT?[]:void 0),o=e=>"id"===e?"id":"config.".concat(e),a=(e,t)=>Array.isArray(e)?e:"boolean"==typeof e&&e?t:null,s=e=>Object.entries(e).reduce((e,t)=>{let[n,i]=t,l=r(i);return void 0!==l?{...e,[n]:l}:e},{}),d=e=>i.object().shape(Object.entries(e).filter(e=>e).reduce((e,t)=>{let[n,l]=t,{validate:r,yupType:o}=l;if(!r)return e;if("function"==typeof r)return{...e,[n]:r(n,l)};let a=i[o]();return Object.entries(r).filter(e=>e&&e[1]).forEach(e=>{let[t,i]=e;if(i&&a[t]){a=a[t](...Array.isArray(i)?i:[i]);return}console.warn('Invalid Yup validator for field "'.concat(n,'"'))}),{...e,[n]:a}},{})).required().default(void 0).noUnknown(!0)},1646:function(e,t,n){"use strict";var i,l;n.d(t,{h:function(){return i}}),(l=i||(i={})).CHECKBOX="checkbox",l.INPUT="input",l.SELECT="select"},67875:function(e,t,n){"use strict";n.d(t,{C:function(){return to}});var i=n(52322),l=n(53085),r=n(65186),o=n(65413),a=n(75289),s=n(28325),d=n(4205),c=n(22863),u=n(25273),p=n(37429);let m={...u.OR,repeat:(0,p.Jg)("Repeatable",!1,!0)};var x=e=>{let{initialValues:t,fields:n,values:l,setFieldValue:r}=e,{config:{repeat:o}}=l;return(0,i.jsxs)(s.k,{children:[Object.entries(m).filter(e=>{let[t]=e;return"repeat"!==t}).map(e=>{let[l,r]=e;return(0,i.jsx)(s.J,{children:(0,i.jsx)(d.Z,{fieldName:(0,c.lm)(l),formField:r,fields:n,initialValues:t})},l)}),(0,i.jsx)(s.J,{children:(0,i.jsx)(a.xu,{sx:{mt:2,alignItems:"center",display:"flex",height:"130%"},children:(0,i.jsxs)(a.__,{variant:"label.border",sx:{mb:0},children:[(0,i.jsx)(a.XZ,{checked:o,onChange:()=>r("config.repeat",!o)}),"Repeatable"]})})})]})};let h={icon:r.iy3},f=e=>o.object().shape({type:o.string().matches(e,{excludeEmptyString:!0}).required(),config:o.object().shape({fields:o.array(),label:o.string(),repeat:o.boolean().optional()})});function g(e){let{schemaTypeRegex:t,customListItem:n,customName:i,hintItemName:l}=e;return{Meta:h,Form:x,FormFields:m,schema:f(t),create:e=>({type:"Group",config:{label:e,repeat:!0,fields:[]}}),CustomListItem:n,TYPE_NAME:"Group",CUSTOM_NAME:i,hintItemName:l}}var v=n(59050),b=n(2784),y=n(40023),j=n(28316),_=n(93188),S=n(87782),k=n(81271),I=n(4687),T=n(64602),F=n(56309),E=n(38369),C=n(2439),w=n(85357),L=n(99510),M=n(46622);let O=e=>{let{tabId:t,widget:n,Widgets:l,widgetsArray:r,hintBase:o,parentSnapshot:s,showHints:d,isRepeatable:c,item:u,draggableId:p,saveItem:m,HintElement:x,...h}=e,[f,g]=(0,b.useState)({isOpen:!1}),O=e=>{var t,n;let{apiId:i,value:l}=e,r=null===(t=l.config)||void 0===t?void 0:t.label,o=function(e){var t,n,i;let l=structuredClone(e.group);return null!==(n=l.config)&&void 0!==n||(l.config={}),null!==(i=(t=l.config).fields)&&void 0!==i||(t.fields={}),l.config.fields[e.fieldId]=e.field,l}({group:C.Fl.fromSM(u.value),fieldId:i,field:l});m({apiId:u.key,newKey:u.key,value:C.Fl.toSM(o),isNewGroupField:!0}),_.Xe.track({event:"field:added",id:i,name:r,type:l.type,isInAGroup:!0,contentType:(0,M.T)(window.location.pathname),..."Link"===l.type&&{allowText:null===(n=l.config)||void 0===n?void 0:n.allowText}})},N=e=>{let{apiId:t,newKey:n,value:i}=e,l=function(e){var t,n;let i=structuredClone(e.group);if(!(null===(t=i.config)||void 0===t?void 0:t.fields)||!(null===(n=e.group.config)||void 0===n?void 0:n.fields))return i;for(let t in i.config.fields={},e.group.config.fields)t===e.previousFieldId?i.config.fields[e.newFieldId]=e.field:i.config.fields[t]=e.group.config.fields[t];return i}({group:C.Fl.fromSM(u.value),previousFieldId:t,newFieldId:n,field:i.type===v.GroupFieldType?C.Fl.fromSM(i):i});m({apiId:u.key,newKey:u.key,value:C.Fl.toSM(l)})},A=e=>{let t=function(e){var t,n;let i=structuredClone(e.group);return null===(n=i.config)||void 0===n||null===(t=n.fields)||void 0===t||delete t[e.fieldId],i}({group:C.Fl.fromSM(u.value),fieldId:e});m({apiId:u.key,newKey:u.key,value:C.Fl.toSM(t)})},D=e=>{g({isOpen:!0,field:e});let[t,n]=e;_.Xe.track({event:"field:settings-opened",id:t,name:n.config.label,type:n.type,isInAGroup:!0,contentType:(0,M.T)(window.location.pathname)})};return(0,i.jsxs)(b.Fragment,{children:[(0,i.jsx)(I.Z,{item:u,widget:n,draggableId:p,...h,HintElement:x,CustomEditElements:[(0,i.jsx)(k.S,{onSelectField:e=>{g({isOpen:!0,field:["",l[e].create("")]})},fields:r.filter(Boolean).map(e=>{let{TYPE_NAME:t,CUSTOM_NAME:n}=e,i=S.XU.find(e=>e.type===t&&(void 0===n||e.variant===n));if(!i)throw Error("Field not found for widget: ".concat(t," - ").concat(n));return i})},"add-field-dropdown")],children:(0,i.jsx)(a.xu,{sx:{ml:4},children:(0,i.jsx)(y.Z5,{onDragEnd:e=>{if((0,w.uS)(e))return;let{source:t,destination:n}=e;if(!n)return;let{index:i}=t,{index:l}=n,r=function(e){var t;let n=structuredClone(e.group);if(!(null===(t=n.config)||void 0===t?void 0:t.fields))return n;let i=Object.entries(n.config.fields),[l]=i.splice(e.sourceIndex,1);return i.splice(e.destinationIndex,0,l),n.config.fields=Object.fromEntries(i),n}({group:C.Fl.fromSM(u.value),sourceIndex:i,destinationIndex:l});(0,j.flushSync)(()=>{m({apiId:u.key,newKey:u.key,value:C.Fl.toSM(r)})})},children:(0,i.jsx)(y.bK,{droppableId:"".concat(t,"-").concat(u.key,"-zone"),children:e=>(0,i.jsxs)("ul",{ref:e.innerRef,...e.droppableProps,children:[u.value.config.fields.map((e,t)=>{let{value:{config:n,type:r}}=e,a=(0,E.t)(l,n,r);if(!a)return null;let s={item:e,index:t,widget:a,key:e.key,enterEditMode:D,deleteItem:A,saveItem:N,showHints:d,renderFieldAccessor:t=>"item".concat((0,L.Ti)(e.key)),draggableId:"group-".concat(u.key,"-").concat(e.key,"-").concat(t),testId:"list-item-group-".concat(u.key,"-").concat(e.key)},p=(0,i.jsx)(F.Z,{item:e,show:d,isRepeatable:c,renderHintBase:e=>{let{item:t}=e;return"".concat(o).concat((0,L.Ti)(t.key))},hintItemName:a.hintItemName,Widgets:l,typeName:a.CUSTOM_NAME||a.TYPE_NAME});if(a.CustomListItem){let{CustomListItem:e}=a;return(0,i.jsx)(e,{...s,HintElement:p})}return(0,i.jsx)(I.Z,{...s,HintElement:p})}),e.placeholder]})})})})}),(0,i.jsx)(T.Z,{data:f,close:()=>{g({isOpen:!1})},onSave:e=>""===e.apiId?O({...e,apiId:e.newKey}):N(e),fields:u.value.config.fields})]})},N={icon:r.hs8},A={label:u.Jp.label,id:u.Jp.id,placeholder_false:(0,p.II)("False Placeholder",{required:!1},null,"false","Value the content creator sees (Output as 'false' in the API)."),placeholder_true:(0,p.II)("True Placeholder",{required:!1},null,"true","Value the content creator sees (Output as 'true' in the API)"),default_value:(0,p.Jg)("Default to true")},D=o.object().shape({type:o.string().matches(/^Boolean$/,{excludeEmptyString:!0}).required(),config:(0,c.gc)((0,w.B9)(A,"id"))}),q={icon:r.U8L},{TYPE_NAME:R,FormFields:z,schema:B}=(0,w.zg)("Color");var V=n(56580),J=n(1744),P=n(40572),Z=n(33760);function G(e){let{allowText:t,height:n=130,setFieldValue:l}=e;return(0,i.jsx)(s.J,{children:(0,i.jsx)(a.kC,{sx:{mt:2,alignItems:"center",height:"".concat(n,"%")},children:(0,i.jsx)(a.__,{variant:"label.border",children:(0,i.jsxs)(Z.xu,{display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%",children:[(0,i.jsxs)(a.kC,{children:[(0,i.jsx)(a.XZ,{checked:t,onChange:e=>{l("config.allowText",e.target.checked)}}),"Allow display text"]}),(0,i.jsx)(Z.u,{content:"Allow editors to customize the link display text",align:"end",zIndexHack:!0,children:(0,i.jsx)(Z.I5,{name:"alert",size:"medium",color:"grey11"})})]})})})})}let U={...u.Jp,allowTargetBlank:(0,p.Jg)("Allow target blank",!1,!0)},H={icon:r.$l_},W=o.object().shape({label:o.string().optional(),useAsTitle:o.boolean().optional(),placeholder:o.string().optional(),select:o.string().optional().oneOf(["media","document","web",null]).nullable(),customtypes:o.array(o.string()).strict().optional(),masks:o.array(o.string()).optional(),tags:o.array(o.string()).optional(),allowTargetBlank:o.boolean().strict().optional(),allowText:o.boolean().strict().optional()}).required().default(void 0).noUnknown(!0),$=o.object().shape({type:o.string().matches(/^Link$/,{excludeEmptyString:!0}).required(),config:W.optional()});var K=n(36131);let Y={label:u.Jp.label,id:u.Jp.id,customtypes:{validate:()=>o.array().of(o.string())}},X={icon:r.I2R},Q=W.shape({label:o.string().max(35,"String is too long. Max: 35"),select:o.string().required().matches(/^document$/,{excludeEmptyString:!0}),customtypes:o.array(o.string()).strict().optional()}),ee=o.object().shape({type:o.string().matches(/^Link$/,{excludeEmptyString:!0}).required(),config:Q}),{FormFields:et,schema:en}=(0,w.zg)("Date"),ei={icon:r.f$3},{FormFields:el,schema:er}=(0,w.zg)("Embed"),eo={icon:r.xoN},ea={label:u.Jp.label,id:u.Jp.id},es=o.object().shape({type:o.string().matches(/^GeoPoint$/,{excludeEmptyString:!0}).required(),config:o.object().shape({label:o.string()}).required().default(void 0).noUnknown(!0)}),ed={icon:r.lPv};var ec=n(63397),eu=n(8799),ep=n(81699),em=n(96666);let ex=e=>{let{onClick:t,error:n,onDelete:l,active:o,text:s,sx:d}=e;return(0,i.jsx)(em.Z,{useActive:!0,fitButton:!0,error:n,onClick:t,active:o,sx:{position:"relative",width:"64px",height:"64px",...d},Icon:()=>(0,i.jsxs)(b.Fragment,{children:[(0,i.jsxs)(a.kC,{sx:{flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[(0,i.jsx)(eu.jnY,{size:22}),(0,i.jsx)(a.xv,{mt:1,children:s})]}),l?(0,i.jsx)(a.Ct,{onClick:l,variant:"circle-right",children:(0,i.jsx)(r.B4e,{})}):null]})})},eh=e=>{let{onClick:t}=e;return(0,i.jsx)(em.Z,{fitButton:!0,onClick:t,sx:{width:"64px",height:"64px",border:e=>{let{colors:t}=e;return"1px solid ".concat(String(null==t?void 0:t.borders))}},Icon:()=>(0,i.jsx)(a.kC,{sx:{flexDirection:"column",justifyContent:"center",alignItems:"center"},children:(0,i.jsx)(eu.iTs,{size:34,color:"#5263BA","aria-label":"Add a thumbnail"})})})},ef=e=>{let{prefix:t,required:n=!1,display:l}=e,[r,o]=(0,ec.U$)(t),a=n?"*":"";return l?(0,i.jsxs)(b.Fragment,{children:[(0,i.jsx)(eg,{name:"".concat(t,".name"),label:"Name".concat(a),placeholder:"main",sx:{mb:3},isConstraint:"config.constraint"===t,meta:o}),(0,i.jsx)(ev,{name:"".concat(t,".width"),label:"Width (px)".concat(a),placeholder:" ",sx:{mb:3}}),(0,i.jsx)(ev,{name:"".concat(t,".height"),label:"Height (px)".concat(a),placeholder:" "})]}):null},eg=e=>{let{name:t,label:n,placeholder:l,meta:r,isConstraint:o,...a}=e,[s]=(0,ec.U$)(t);return(0,i.jsx)(ep.Hq,{...a,fieldName:t,meta:r,formField:{label:n,placeholder:l},field:o?{value:"main",readOnly:!0}:{value:s.value},variant:o?"disabled":"primary"})},ev=e=>{let{name:t,label:n,placeholder:l,...r}=e,[o,a]=(0,ec.U$)(t);return(0,i.jsx)(ep.Hq,{...r,fieldName:t,formField:{label:n,placeholder:l},meta:a,field:{min:0,type:"number",value:o.value||"",onKeyDown:e=>{("e"===e.key||"-"===e.key||"+"===e.key)&&e.preventDefault()}}})},eb=()=>o.number().nullable().transform((e,t)=>""===t?null:e),ey={label:u.Jp.label,id:u.Jp.id,constraint:{validate:()=>o.object().defined().shape({width:eb(),height:eb()})},thumbnails:{validate:()=>o.array().defined().of(o.object().test({name:"Thumbnails",message:"Must set name and width or height at minimum",test:function(e){if(!e.name)return!1;let t="number"==typeof e.width&&e.width,n="number"==typeof e.height&&e.height;return e.name&&(t||n)}}))}},ej={name:"",width:"",height:""},e_=function(){let{width:e,height:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!n||e||t?e||t?"".concat(e||"auto","x").concat(t||"auto"):"...":"auto"},eS=o.object().shape({type:o.string().matches(/^Image$/,{excludeEmptyString:!0}).required(),config:(0,c.gc)((0,w.B9)(ey,"id"))}),ek={icon:r.Fwj},eI={...u.Jp},eT={icon:r._b$},eF=W.shape({select:o.string().required().matches(/^media$/,{excludeEmptyString:!0})}),eE=o.object().shape({type:o.string().matches(/^Link$/,{excludeEmptyString:!0}).required(),config:eF.optional()}),{FormFields:eC,schema:ew}=(0,w.zg)("Number"),eL={icon:r.KZU};var eM=n(1646);let eO=e=>"use first value as default ".concat(e?'("'.concat(e,'")'):""),eN=(e,t)=>t?e:void 0,eA={...u.Jp,default_value:{type:eM.h.CHECKBOX,yupType:"string",defaultValue:null,validate:function(){return o.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(t=>t===e)}})},component:e=>{var t;let{values:n}=(0,ec.u6)(),l=null===(t=n.config)||void 0===t?void 0:t.options[0];return(0,i.jsx)(ep.w8,{...e,defaultValue:e.field.value,controlledValue:l,setControlledValue:e.helpers.setValue,buildControlledValue:eN,label:eO})}},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:e=>!e.some(e=>!e||!e.length)}},component:e=>(0,i.jsx)(ep.kp,{label:"Options",inputPlaceholder:"Select option output in API (e.g. 'blueTheme')",buttonLabel:"Add option",...e})}},eD={icon:r.nwY},eq=o.object().shape({type:o.string().matches(/^Select$/,{excludeEmptyString:!0}).required(),config:(0,c.gc)((0,w.B9)(eA,"id"))});var eR=n(47927),ez=n(29259),eB=n.n(ez),eV=n(85505),eJ=n.n(eV),eP=n(34543);let eZ=e=>t=>{let{size:n}=t;return(0,i.jsx)("span",{style:{fontSize:n},children:e})},eG=[{value:"paragraph",label:"P",icon:eZ("p")},{value:"preformatted",label:"PRE",icon:eZ("pre")},{value:"heading1",label:"H1",icon:eZ("h1")},{value:"heading2",label:"H2",icon:eZ("h2")},{value:"heading3",label:"H3",icon:eZ("h3")},{value:"heading4",label:"H4",icon:eZ("h4")},{value:"heading5",label:"H5",icon:eZ("h5")},{value:"heading6",label:"H6",icon:eZ("h6")},{value:"strong",label:"Strong",icon:eZ((0,i.jsx)("b",{children:"b"}))},{value:"em",label:"em",icon:eZ((0,i.jsx)("em",{style:{fontFamily:"serif"},children:"I"}))},{value:"hyperlink",label:"hyperlink",icon:eZ((0,i.jsx)(eP.eR7,{}))},{value:"image",label:"image",icon:eZ((0,i.jsx)(eP.LFN,{}))},{value:"embed",label:"embed",icon:eZ((0,i.jsx)(eP.xqv,{}))},{value:"list-item",label:"list",icon:eZ((0,i.jsx)(eP.SnF,{}))},{value:"o-list-item",label:"o",icon:eZ((0,i.jsx)(eu.KyO,{}))},{value:"rtl",label:"rtl",icon:eZ("rtl")}],eU=eG.map(e=>e.value),eH=e=>!eU.find(t=>!e.includes(t)),eW=e=>{let t=e.split(",");return eG.reduce((e,n)=>{let{value:i}=n;return t.includes(i)?[...e,i]:e},[])};function e$(e,t){return(0,eR.has)("parent",e)&&eB()(e.parent)&&(0,eR.has)(t,e.parent)&&eJ()(e.parent[t])?e.parent[t]:null}function eK(e){return()=>o.string().test({name:e,message:"Options cannot be empty",test:function(t,n){let i="single"===e?"multi":"single",l=e$(n,e),r=e$(n,i);return!!r&&"string"==typeof r||!("string"!=typeof l||(!l||!l.length)&&(!r||!r.length)||l.split(",").find(e=>!eU.includes(e)))}})}let eY={...u.Jp,allowTargetBlank:(0,p.Jg)("Allow target blank for links"),single:{validate:eK("single")},multi:{validate:eK("multi")}},eX=["config.single","config.multi"],eQ={icon:r.BAW},e0=o.object().shape({type:o.string().matches(/^StructuredText$/,{excludeEmptyString:!0}).required(),config:(0,c.gc)((0,w.B9)({...eY,labels:{yupType:"array",validate:{}}},"id"))}),e1=u.Jp,e2=o.object().shape({type:o.string().matches(/^Text$/,{excludeEmptyString:!0}).required(),config:(0,c.gc)((0,w.B9)(e1,"id"))}),e3={icon:r.SQS},e5=u.Jp,e6=o.object().shape({type:o.string().matches(/^Timestamp$/,{excludeEmptyString:!0}).required(),config:(0,c.gc)((0,w.B9)(e5,"id"))}),e7={icon:r.k71},e8={label:u.Jp.label,id:{...u.Jp.id,validate:{required:"This field is required",matches:[/^uid$/,"Api ID must be 'uid' for this field."]},disabled:!0},placeholder:u.Jp.placeholder},e9=o.object().shape({type:o.string().matches(/^UID$/,{excludeEmptyString:!0}).required(),config:(0,c.gc)((0,w.B9)(e8,"id"))}),e4={Boolean:{TYPE_NAME:"Boolean",create:e=>({type:"Boolean",config:{label:e,default_value:!1,placeholder_true:"true",placeholder_false:"false"}}),Meta:N,schema:D,FormFields:A},Color:{create:e=>({type:"Color",config:{label:e,placeholder:""}}),FormFields:z,TYPE_NAME:R,schema:B,Meta:q},ContentRelationship:{create:e=>({type:"Link",config:{label:e,select:"document"}}),Meta:X,schema:ee,TYPE_NAME:"Link",FormFields:Y,CUSTOM_NAME:"ContentRelationship",Form:e=>{let{initialValues:t,values:n,fields:l,setFieldValue:r}=e,o=(0,V.v9)(P.Ch).filter(J.TG),u=o.map(e=>({value:e.local.id,label:e.local.label})),p=n.config.customtypes?n.config.customtypes.map(e=>{let t=o.find(t=>t.local.id===e);return{value:null==t?void 0:t.local.id,label:null==t?void 0:t.local.label}}):null;return(0,i.jsxs)(s.k,{children:[Object.entries(Y).filter(e=>"customtypes"!==e[0]).map(e=>{let[n,r]=e;return(0,i.jsx)(s.J,{children:(0,i.jsx)(d.Z,{fieldName:(0,c.lm)(n),formField:r,fields:l,initialValues:t})},n)}),(0,i.jsx)(s.J,{children:(0,i.jsxs)(a.xu,{sx:{mt:2,alignItems:"center"},children:[(0,i.jsx)(a.__,{htmlFor:"origin",mb:"1",children:"Types"}),(0,i.jsx)(K.ZP,{isMulti:!0,name:"origin",options:u,onChange:e=>{e&&r("config.customtypes",e.map(e=>{let{value:t}=e;return t}))},value:p,theme:e=>({...e,colors:{...e.colors,text:"text",primary:"background"}})})]})})]})},prepareInitialValues:e=>{let t=(0,V.v9)(P.Ch).filter(J.TG);return(null==e?void 0:e.customtypes)?{...e,customtypes:e.customtypes.filter(e=>t.find(t=>t.local.id===e))}:e}},Date:{create:e=>({type:"Date",config:{label:e,placeholder:""}}),FormFields:et,TYPE_NAME:"Date",schema:en,Meta:ei},Embed:{create:e=>({type:"Embed",config:{label:e,placeholder:""}}),FormFields:el,TYPE_NAME:"Embed",schema:er,Meta:eo},GeoPoint:{create:e=>({type:"GeoPoint",config:{label:e}}),FormFields:ea,TYPE_NAME:"GeoPoint",schema:es,Meta:ed},Image:{Meta:ek,Form:e=>{let{initialValues:t,values:n,errors:l,fields:r,touched:o}=e,[u,p]=(0,b.useState)(0),{config:{thumbnails:m,constraint:x}}=n;return(0,b.useEffect)(()=>{p(m.length)},[m.length]),(0,i.jsxs)(s.k,{children:[Object.entries(ey).map(e=>{let[n,l]=e;return(0,i.jsx)(s.J,{children:(0,i.jsx)(d.Z,{fieldName:(0,c.lm)(n),formField:l,fields:r,initialValues:t})},n)}),(0,i.jsxs)(s.J,{children:[(0,i.jsx)(a.__,{htmlFor:"thumbnails",variant:"label.primary",sx:{mt:1,display:"flex",alignItems:"center"},children:"Responsive views*"}),(0,i.jsx)(a.Zb,{p:3,children:(0,i.jsx)(ec.F2,{name:"config.thumbnails",render:t=>{let{push:n,remove:r}=t;return(0,i.jsxs)(b.Fragment,{children:[(0,i.jsxs)(a.kC,{mb:3,children:[(0,i.jsx)(ex,{active:0===u,text:e_(x,!0),sx:{mr:2},onClick:()=>p(0)}),m.map((e,t)=>(0,i.jsx)(ex,{sx:{mr:3},active:u===+t+1,text:e_(e),error:!!l.thumbnails&&!!o.thumbnails&&!!o.thumbnails[t]&&!!l.thumbnails&&!!l.thumbnails[t],onDelete:()=>r(t),onClick:()=>p(+t+1)},"thumbnail-button-".concat(+t+1))),(0,i.jsx)(eh,{onClick:()=>{n(ej)}})]}),(0,i.jsx)(ef,{...e,display:0===u,prefix:"config.constraint"}),m.map((t,n)=>(0,b.createElement)(ef,{...e,required:!0,key:"thumbnail-".concat(+n+1),display:u===+n+1,prefix:"config.thumbnails[".concat(n,"]")}))]})}})})]})]})},schema:eS,create:e=>({type:"Image",config:{label:e,constraint:{},thumbnails:[]}}),FormFields:ey,TYPE_NAME:"Image"},Link:{Meta:H,FormFields:U,schema:$,Form:e=>{let{initialValues:t,values:n,fields:l,setFieldValue:r}=e,{config:{allowText:o}}=n;return(0,i.jsxs)(s.k,{children:[Object.entries(u.Jp).map(e=>{let[n,r]=e;return(0,i.jsx)(s.J,{children:(0,i.jsx)(d.Z,{fieldName:(0,c.lm)(n),formField:r,fields:l,initialValues:t})},n)}),(0,i.jsx)(s.J,{}),(0,i.jsx)(s.J,{children:(0,i.jsxs)(a.xu,{sx:{mt:2},children:[(0,i.jsx)(a.__,{htmlFor:"allowTargetBlank",variant:"label.primary",sx:{display:"flex",alignItems:"center"},children:"Link properties"}),(0,i.jsx)(d.Z,{fieldName:(0,c.lm)("allowTargetBlank"),formField:(0,p.Jg)("Allow target blank",!1,!0),fields:l,initialValues:t})]})},"allowTargetBlank"),(0,i.jsx)(G,{allowText:o,height:127,setFieldValue:r})]})},create:e=>({type:"Link",config:{label:e,placeholder:"",select:null,allowText:!0}}),TYPE_NAME:"Link"},LinkToMedia:{Meta:eT,FormFields:eI,schema:eE,Form:e=>{let{initialValues:t,values:n,fields:l,setFieldValue:r}=e,{config:{allowText:o}}=n;return(0,i.jsxs)(s.k,{children:[Object.entries(eI).map(e=>{let[n,r]=e;return(0,i.jsx)(s.J,{children:(0,i.jsx)(d.Z,{fieldName:(0,c.lm)(n),formField:r,fields:l,initialValues:t})},n)}),(0,i.jsx)(G,{allowText:o,setFieldValue:r})]})},create:e=>({type:"Link",config:{label:e,placeholder:"",select:"media",allowText:!0}}),TYPE_NAME:"Link",CUSTOM_NAME:"LinkToMedia"},Number:{create:e=>({type:"Number",config:{label:e,placeholder:""}}),FormFields:eC,TYPE_NAME:"Number",schema:ew,Meta:eL},Select:{FormFields:eA,create:e=>({type:"Select",config:{label:e,placeholder:"",options:["1","2"]}}),schema:eq,Meta:eD,TYPE_NAME:"Select"},StructuredText:{create:e=>({type:"StructuredText",config:{label:e,placeholder:"",allowTargetBlank:!0,multi:eU.join(",")}}),FormFields:eY,Meta:eQ,schema:e0,TYPE_NAME:"StructuredText",Form:e=>{var t;let{initialValues:n,values:l,errors:r,fields:o,setFieldValue:u}=e,{config:{single:p,multi:m}}=l,x=p?eW(p):m?eW(m):eU,[h,f]=(0,b.useState)(!p),[g,v]=(0,b.useState)(x);return(0,b.useEffect)(()=>{let e=h?1:0;u(eX[e],g.join(",")),setTimeout(()=>{u(eX[1-e],void 0)},100)},[h,g]),(0,i.jsxs)(s.k,{children:[Object.entries(eY).map(e=>{let[t,l]=e;return(0,i.jsx)(s.J,{children:(0,i.jsx)(d.Z,{fieldName:(0,c.lm)(t),formField:l,fields:o,initialValues:n})},t)}),(0,i.jsxs)(s.J,{children:[(0,i.jsxs)(a.__,{htmlFor:"accept",variant:"label.primary",sx:{mt:1,display:"flex",alignItems:"center"},children:["Accept*",(0,i.jsx)(a.zx,{type:"button",variant:"buttons.textButton",onClick:()=>{if(eH(g))return v([]);v(eU)},children:eH(g)?"Unselect All":"Select all"})]}),eG.map(e=>(0,i.jsx)(em.Z,{fitButton:!0,useActive:!0,label:e.label,size:14,Icon:e.icon,sx:{p:"16px",mb:2,mr:2,variant:"buttons.selectIcon"},active:g.includes(e.value),onClick:()=>{if(g.find(t=>t===e.value))return v(g.filter(t=>t!==e.value));v([...g,e.value])}},e.value)),(null===(t=r.config)||void 0===t?void 0:t[h?"multi":"single"])?(0,i.jsx)(a.xu,{sx:{position:"absolute"},children:(0,i.jsx)(a.xv,{as:"span",variant:"text.labelError",pl:0,children:r.config[h?"multi":"single"]})}):null]}),(0,i.jsx)(s.J,{children:(0,i.jsx)(a.kC,{sx:{mt:2,alignItems:"center",height:"100%"},children:(0,i.jsxs)(a.__,{variant:"label.border",children:[(0,i.jsx)(a.XZ,{checked:h,onChange:()=>f(!h)}),"Allow multiple paragraphs"]})})})]})}},Text:{create:e=>({type:"Text",config:{label:e,placeholder:""}}),Meta:e3,schema:e2,TYPE_NAME:"Text",FormFields:e1},Timestamp:{create:e=>({type:"Timestamp",config:{label:e,placeholder:""}}),schema:e6,FormFields:e5,TYPE_NAME:"Timestamp",Meta:e7},UID:{create:e=>({type:"UID",config:{label:e,placeholder:""}}),Meta:{icon:r.XN7},schema:e9,TYPE_NAME:"UID",FormFields:e8}},te=[e4.Image,e4.Text,e4.StructuredText,e4.Link,e4.Select,e4.Boolean,e4.Number,e4.Color,e4.Date,e4.Embed,e4.Timestamp,e4.GeoPoint,e4.ContentRelationship,e4.LinkToMedia],tt="subItem",tn=g({schemaTypeRegex:/^NestedGroup$/,customListItem:e=>(0,i.jsx)(O,{Widgets:e4,widgetsArray:te,hintBase:tt,...e}),customName:"NestedGroup",hintItemName:tt}),ti={...e4,NestedGroup:tn},tl=[ti.Image,ti.Text,ti.StructuredText,ti.Link,ti.Select,ti.Boolean,ti.Number,ti.Color,ti.Date,ti.Embed,ti.Timestamp,ti.GeoPoint,ti.ContentRelationship,ti.LinkToMedia,ti.NestedGroup],tr="item",to={Group:g({schemaTypeRegex:/^Group$/,customListItem:e=>{let t=function(){let e=(0,l.L)("slicemachine-nested-groups");return{eligible:(null==e?void 0:e.value)==="on"}}().eligible?tl:tl.filter(e=>"NestedGroup"!==e.CUSTOM_NAME);return(0,i.jsx)(O,{Widgets:ti,widgetsArray:t,hintBase:tr,...e})},hintItemName:tr}),NestedGroup:tn,...e4}},85357:function(e,t,n){"use strict";n.d(t,{B9:function(){return o},Ss:function(){return s},uS:function(){return a},zg:function(){return d}});var i=n(65413),l=n(22863),r=n(25273);let o=(e,t)=>{let{[t]:n,...i}=e;return i},a=e=>!e.destination||e.source.index===e.destination.index||e.source.droppableId!==e.destination.droppableId,s=(e,t)=>!e[t]&&(console.log('Could not find widget with type name "'.concat(t,'".')),!0),d=e=>({TYPE_NAME:e,FormFields:r.Jp,schema:i.object().shape({type:i.string().test({name:"type",test:function(t){return t===e}}),config:(0,l.gc)(o(r.Jp,"id"))}),create:()=>({type:e,config:(0,l.f7)(o(r.Jp,"id"))})})},46622:function(e,t,n){"use strict";function i(e){if(e.startsWith("/slices/"))return"slice";if(e.startsWith("/custom-types/"))return"custom type";if(e.startsWith("/page-types/"))return"page type";throw Error("Did not detect a content type from: ".concat(e))}n.d(t,{T:function(){return i}})},13938:function(e){e.exports={flex:"List_flex__b6acG",row:"List_row__zKnOI List_flex__b6acG",root:"List_root__m_SiQ List_flex__b6acG","root-border":"List_root-border__UW3vp",child:"List_child__MJ49i List_row__zKnOI List_flex__b6acG",header:"List_header__T0WM5 List_child__MJ49i List_row__zKnOI List_flex__b6acG",headerActions:"List_headerActions__mNgLY List_row__zKnOI List_flex__b6acG",item:"List_item__LMBx4 List_child__MJ49i List_row__zKnOI List_flex__b6acG"}},83288:function(e){e.exports={root:"ZoneEmptyState_root__DAfG2"}}}]);
|