slice-machine-ui 2.2.1-alpha.lg-advanced-groups.13 → 2.2.1-alpha.lg-advanced-groups.15

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 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/3c76d732d00eda61.css" as="style"/><link rel="stylesheet" href="/_next/static/css/3c76d732d00eda61.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-c67a75d1b6f99dc8.js"></script><script src="/_next/static/chunks/webpack-2f903acb0cccbf9e.js" defer=""></script><script src="/_next/static/chunks/framework-cdccea7a52cc6e81.js" defer=""></script><script src="/_next/static/chunks/main-207ecb3e9b995dd9.js" defer=""></script><script src="/_next/static/chunks/pages/_app-4bf415026a203cb2.js" defer=""></script><script src="/_next/static/chunks/pages/_error-6aa4c7b8478d35e3.js" defer=""></script><script src="/_next/static/4DYTka2oTmOfbdWtHHd8E/_buildManifest.js" defer=""></script><script src="/_next/static/4DYTka2oTmOfbdWtHHd8E/_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":"4DYTka2oTmOfbdWtHHd8E","runtimeConfig":{"sentryEnvironment":"alpha"},"nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
1
+ <!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/3c76d732d00eda61.css" as="style"/><link rel="stylesheet" href="/_next/static/css/3c76d732d00eda61.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-c67a75d1b6f99dc8.js"></script><script src="/_next/static/chunks/webpack-2f903acb0cccbf9e.js" defer=""></script><script src="/_next/static/chunks/framework-cdccea7a52cc6e81.js" defer=""></script><script src="/_next/static/chunks/main-207ecb3e9b995dd9.js" defer=""></script><script src="/_next/static/chunks/pages/_app-706f55eb234a6d05.js" defer=""></script><script src="/_next/static/chunks/pages/_error-6aa4c7b8478d35e3.js" defer=""></script><script src="/_next/static/po3Ww6YmJ2ZYMUPv4n7qB/_buildManifest.js" defer=""></script><script src="/_next/static/po3Ww6YmJ2ZYMUPv4n7qB/_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":"po3Ww6YmJ2ZYMUPv4n7qB","runtimeConfig":{"sentryEnvironment":"alpha"},"nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[574],{85513:function(e,t,n){"use strict";n.d(t,{aV:function(){return u},Bu:function(){return f}});var i=n(62230),r=n(85244),o=n(98240),l=n(52322),a=n(7729),s=n(6277),c=n(41350),d=n.n(c),u=function(e){var t=e.border,n=(0,o.Z)(e,["border"]);return(0,l.jsx)("div",(0,r.Z)((0,i.Z)({},n),{className:(0,s.Z)(d().root,(void 0===t||t)&&d()["root-border"])}))},f=function(e){var t=e.actions,n=e.children,s=e.toggle,c=(0,o.Z)(e,["actions","children","toggle"]);return(0,l.jsxs)("div",(0,r.Z)((0,i.Z)({},c),{className:d().header,children:[(0,l.jsx)(a.xv,{color:"grey11",component:"span",noWrap:!0,variant:"bold",children:n}),s,Boolean(t)?(0,l.jsx)("div",{className:d().headerActions,children:t}):null]}))}},90104:function(e,t,n){"use strict";n.d(t,{X:function(){return o}});var i=n(52322),r=n(7729),o=function(e){var t,n=e.status;switch(n){case"pending":t={icon:(0,i.jsx)(r._3,{color:"grey11"}),text:"Saving..."};break;case"failed":t={icon:(0,i.jsx)(r.I5,{name:"close",color:"tomato11",size:"medium"}),text:"Failed to save"};break;case"done":t={icon:(0,i.jsx)(r.I5,{name:"check",color:"green11",size:"medium"}),text:"Auto-saved"}}return(0,i.jsxs)(r.xu,{gap:8,alignItems:"center",children:[t.icon,(0,i.jsx)(r.xv,{color:"grey11",children:t.text})]})}},51279:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var i=n(62230),r=n(52322),o=n(61183);n(2784);var l=n(59326),a=n(75289),s=function(e){return{subLanguage:"xml",contains:[e.COMMENT("<!--","-->",{relevance:10}),{begin:/^(\s*)(<script(\s*context="module")?>)/gm,end:/^(\s*)(<\/script>)/gm,subLanguage:"javascript",excludeBegin:!0,excludeEnd:!0,contains:[{begin:/^(\s*)(\$:)/gm,end:/(\s*)/gm,className:"keyword"},]},{begin:/^(\s*)(<style.*>)/gm,end:/^(\s*)(<\/style>)/gm,subLanguage:"css",excludeBegin:!0,excludeEnd:!0},{begin:/\{/gm,end:/\}/gm,subLanguage:"javascript",contains:[{begin:/[\{]/,end:/[\}]/,skip:!0},{begin:/([#:\/@])(if|else|each|await|then|catch|debug|html)/gm,className:"keyword",relevance:10},]},]}};o.Z.registerLanguage("svelte",s);var c=["javascript","bash","xml","html","json"],d=function(e){var t,n=e.children,s=e.lang,d=e.sx,u=e.codeStyle,f=e.codeClass,p=e.Header,x=(0,l.B7)().theme,m=s?o.Z.highlight(n,{language:"vue"===s?"html":s}).value:o.Z.highlightAuto(n,c).value;return(0,r.jsxs)(a.kC,{as:"pre",sx:d,children:[p?(0,r.jsx)(p,{}):null,(0,r.jsx)("code",{className:"hljs".concat(f?" ".concat(f):""),style:(0,i.Z)({overflowX:"auto",padding:"3px 5px",borderRadius:"6px",border:"1px solid",borderColor:String(null===(t=x.colors)||void 0===t?void 0:t.textClear)},u),dangerouslySetInnerHTML:{__html:m}})]})}},26950:function(e,t,n){"use strict";n.d(t,{J:function(){return c},k:function(){return s}});var i=n(62230),r=n(85244),o=n(98240),l=n(52322);n(2784);var a=n(75289),s=function(e){var t=e.children,n=e.sx,s=(0,o.Z)(e,["children","sx"]);return(0,l.jsx)(a.xu,(0,r.Z)((0,i.Z)({sx:(0,i.Z)({display:["block","block","flex"],flexWrap:"wrap",justifyContent:"space-between"},n)},s),{children:t}))},c=function(e){var t=e.children,n=e.cols;return(0,l.jsx)(a.xu,{sx:{flex:"0 ".concat(100/(void 0===n?2:n)-1,"%"),mb:1},children:t})}},35549:function(e,t,n){"use strict";n.d(t,{$w:function(){return i},Hq:function(){return u},tM:function(){return d}});var i,r=n(62230),o=n(85244),l=n(52322),a=n(63397);n(2784);var s,c=n(75289);(s=i||(i={}))[s.ERROR=0]="ERROR",s[s.DISABLED=1]="DISABLED",s[s.WARNING=2]="WARNING";var d=function(e){var t={"&::placeholder":{color:"#C9D0D8"}};switch(e){case i.DISABLED:return(0,o.Z)((0,r.Z)({},t),{border:"1px solid #E6E6EA",backgroundColor:"#F3F5F7"});case i.ERROR:return(0,o.Z)((0,r.Z)({},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 i.WARNING:return(0,o.Z)((0,r.Z)({},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}},u=function(e){var t=e.sx,n=e.field,s=e.meta,u=e.formField,f=e.fieldName,p=e.fields,x=e.initialValues,m=e.isDisabled,h=s.error?i.ERROR:m||u.disabled?i.DISABLED:void 0;return(0,l.jsxs)(c.xu,{sx:void 0===t?{}:t,children:[(0,l.jsxs)(c.__,{variant:"label.primary",htmlFor:f,children:[u.label||f,s.touched&&s.error?(0,l.jsx)(c.xv,{as:"span",variant:"text.labelError",children:s.error}):null]}),(0,l.jsx)(a.gN,(0,o.Z)((0,r.Z)({id:f,name:f,type:"text",placeholder:u.placeholder||u.label||f},u.fieldLevelValidation&&x?{validate:function(e){return u.fieldLevelValidation&&u.fieldLevelValidation({value:e,fields:p,initialId:x.id})}}:null,n),{as:c.II,sx:d(h),disabled:m||u.disabled}))]})}},20180:function(e,t,n){"use strict";n.d(t,{kp:function(){return c},sP:function(){return u},w8:function(){return f},Hq:function(){return p.Hq}});var i=n(62230),r=n(85244),o=n(52322),l=n(63397),a=n(2784),s=n(75289),c=function(e){var t=e.field,n=e.meta,c=e.fieldName,d=e.label,u=e.focusOnNewEntry,f=void 0===u||u,p=e.inputPlaceholder,x=e.buttonLabel,m=(0,a.useState)(n.value.length),h=m[0],v=m[1],g=(0,a.useRef)(Array(n.value.length));return(0,a.useEffect)(function(){g.current=g.current.slice(0,n.value.length)},[n.value.length]),(0,a.useEffect)(function(){var e=g.current.length;f&&e>h&&g.current[e-1].focus(),v(e)},[g.current.length,f,h]),(0,o.jsxs)(a.Fragment,{children:[(0,o.jsxs)(s.__,{variant:"label.primary",htmlFor:c,children:[d,n.touched&&n.error?(0,o.jsx)(s.xv,{as:"span",variant:"text.labelError",children:n.error}):null]}),(0,o.jsx)(l.F2,(0,r.Z)((0,i.Z)({name:c,id:c},t),{render:function(e){return(0,o.jsxs)("div",{children:[t.value&&t.value.length>0?t.value.map(function(t,n){return(0,o.jsxs)(s.kC,{my:2,children:[(0,o.jsx)(s.II,{placeholder:p,name:"".concat(c,".").concat(n),value:t,ref:function(e){return g.current[n]=e},onChange:function(t){var i=t.target.value;return e.replace(n,i)}}),(0,o.jsx)(s.zx,{ml:2,type:"button",variant:"secondary",onClick:function(){return e.remove(n)},children:"-"})]},"".concat(c,"-").concat(+n+1))}):null,(0,o.jsx)(s.zx,{type:"button",onClick:function(){return e.insert(t.value.length,"")},children:x})]})}}))]})},d=n(98240),u=function(e){e.initialValues;var t=e.meta,n=e.label,a=e.fieldName,c=e.onChange,u=(0,d.Z)(e,["initialValues","meta","label","fieldName","onChange"]);return(0,o.jsxs)(s.__,(0,r.Z)((0,i.Z)({variant:"label.border"},u),{children:[(0,o.jsx)(l.gN,{as:s.XZ,type:"checkbox",name:a,onChange:function(){return c(!t.value)},checked:t.value}),n]}))},f=function(e){var t=e.field,n=e.label,i=e.defaultValue,r=e.onChange,l=e.controlledValue,s=e.setControlledValue,c=e.buildControlledValue,d=(0,a.useState)(i||t.defaultValue||!1),f=d[0],p=d[1];return(0,a.useEffect)(function(){c?s(c(l,f)):s(c)},[f,l,c]),(0,o.jsx)(u,{meta:{value:f},fieldName:t.name,onChange:function(e){return p(e)&&r&&r(e)},label:"function"==typeof n?n(l,f):n})},p=n(35549)},82004:function(e,t,n){"use strict";var i=n(62230),r=n(85244),o=n(98240),l=n(52322),a=n(2784),s=n(75289),c=(0,a.forwardRef)(function(e,t){var n=e.children,a=e.Component,c=void 0===a?s.kC:a,d=e.sx,u=(0,o.Z)(e,["children","Component","sx"]);return(0,l.jsx)(c,(0,r.Z)((0,i.Z)({as:"li",sx:(0,i.Z)({p:3,mx:3,alignItems:"center",variant:"styles.listItem"},void 0===d?{}:d),ref:t},u),{children:n}))});t.Z=c},1225:function(e,t,n){"use strict";n.d(t,{Z:function(){return j}});var i=n(62230),r=n(85244),o=n(52322),l=n(5446),a=n(2784),s=n(40023),c=n(951),d=n(8799),u=n(18978),f=n(59326),p=n(75289),x=n(82004),m=n(26474),h=n(98240),v=n(33710),g=n(79401),b=function(e){var t=e.text,n=e.as,l=e.sx,s=(0,h.Z)(e,["text","as","sx"]),c=(0,a.useRef)(null),d=(0,a.useState)(null),u=d[0],f=d[1],x=function(){f(c.current&&c.current.offsetWidth<c.current.scrollWidth)};return(0,a.useEffect)(function(){return x(),window.addEventListener("resize",x),function(){window.removeEventListener("resize",x)}},[]),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.xv,(0,r.Z)((0,i.Z)({"data-for":t,"data-tip":!0,sx:(0,i.Z)({flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},void 0===l?{}:l),as:n,ref:c},s),{children:t})),u&&(0,o.jsx)(g.X,{children:(0,o.jsx)(v.Z,{id:t,type:"dark",multiline:!0,border:!0,borderColor:"black",place:"bottom",effect:"solid",children:t})})]})},y=function(e){var t,n,i=e.text,r=e.sliceFieldName,l=e.theme,a=e.WidgetIcon;return(0,o.jsxs)(p.kC,{sx:{alignItems:"center",position:"relative"},children:[(0,o.jsx)(a,{size:28,style:{color:null===(t=l.colors)||void 0===t?void 0:t.primary,marginRight:"8px",borderRadius:"4px",padding:"4px",border:"2px solid",borderColor:null===(n=l.colors)||void 0===n?void 0:n.primary}}),(0,o.jsx)(b,{text:i,as:"p",sx:{py:0,px:1,fontWeight:"label",fontSize:"15px"},"data-testid":"field-name"}),(0,o.jsx)(p.xv,{as:"p",sx:{display:["none","none","initial"],fontSize:"14px",ml:1,color:"textClear"},"data-testid":"field-id",children:r})]})},j=function(e){var t=e.item,n=e.index,h=e.deleteItem,v=e.enterEditMode,g=e.modelFieldName,b=e.renderFieldAccessor,j=e.HintElement,Z=e.CustomEditElement,C=e.CustomEditElements,k=e.widget,I=e.draggableId,S=e.testId,w=e.isRepeatableCustomType,E=e.children,F=(0,f.B7)().theme,T=t.key,_=t.value,A=_.config,N=_.type;return(0,o.jsx)(a.Fragment,{children:(0,o.jsx)(s._l,{draggableId:I,index:n,children:function(e){var s,f,I,_,M;return(0,o.jsx)(a.Fragment,{children:(0,o.jsxs)(x.Z,(0,r.Z)((0,i.Z)({"data-testid":S,ref:e.innerRef},e.draggableProps),{Component:p.xu,sx:{p:0,mx:0,my:3},children:[(0,o.jsxs)(p.kC,{sx:{width:"100%"},children:[(0,o.jsx)(m.Z,(0,i.Z)({label:"Reorder slice field (drag and drop)",Icon:u.Fm7,color:null===(s=F.colors)||void 0===s?void 0:s.icons,mr:1,mt:3},e.dragHandleProps)),(0,o.jsxs)(p.xu,{sx:{bg:"headSection",width:"100%",borderRadius:"3px",border:function(e){var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.borders))}},children:[(0,o.jsxs)(p.kC,{sx:{p:3,alignItems:"center",justifyContent:"space-between",width:"100%"},children:[(0,o.jsx)(y,{theme:F,text:(null==A?void 0:A.label)||T,sliceFieldName:b&&b(T),WidgetIcon:k.Meta.icon}),(0,o.jsxs)(p.kC,{children:[C||null,Z||(0,o.jsx)(m.Z,{size:22,Icon:c.$iz,label:"Edit field",sx:{cursor:"pointer",color:null===(f=F.colors)||void 0===f?void 0:f.icons},onClick:function(){return v([T,t.value],g,n)}}),!(!0===w&&"UID"==N)&&(0,o.jsxs)(l.v2,{children:[(0,o.jsx)(l.j2,{className:"sliceMenuButton","data-testid":"field-menu-button",style:{padding:"0",cursor:"pointer",width:"32px",height:"32px",border:"none",background:"transparent",outline:"0"},children:(0,o.jsx)(d.FQA,{size:20,color:null===(I=F.colors)||void 0===I?void 0:I.icons,style:{pointerEvents:"none"}})}),(0,o.jsx)(l.qy,{style:{background:null===(_=F.colors)||void 0===_?void 0:_.gray,border:"1px solid",borderRadius:"3px",borderColor:null===(M=F.colors)||void 0===M?void 0:M.borders,outline:"0"},children:(0,o.jsx)(l.sN,{style:{padding:"6px",cursor:"pointer"},onSelect:function(){return h(T)},children:"Delete field"})})]})]})]}),j||null]})]}),E]}))})}})})}},26474:function(e,t,n){"use strict";var i=n(62230),r=n(85244),o=n(98240),l=n(52322),a=n(75289),s=function(e,t){return t?{border:function(e){var t=e.colors;return"1px solid ".concat(t.error)}}:e?{border:function(e){var t=e.colors;return"1px solid ".concat(t.primary)}}:{border:function(e){var t=e.colors;return"1px solid ".concat(t.borders)}}},c=function(e){var t=e.sx,n=e.onClick,c=e.label,d=e.Icon,u=e.error,f=e.size,p=void 0===f?16:f,x=e.fitButton,m=e.active,h=e.useActive,v=e.activeSx,g=(0,o.Z)(e,["sx","onClick","label","Icon","error","size","fitButton","active","useActive","activeSx"]);return(0,l.jsx)(a.hU,(0,r.Z)((0,i.Z)({onClick:void 0===n?function(){return null}:n,"aria-label":c,type:"button",sx:(0,i.Z)({},void 0!==x&&x?{width:p,height:p}:null,void 0!==h&&h&&(void 0===v?s:v)(void 0!==m&&m,void 0===u?null:u),void 0===t?null:t)},g),{children:(0,l.jsx)(d,{size:p})}))};t.Z=c},79474:function(e,t,n){"use strict";var i=n(62230),r=n(17064),o=n(52322),l=n(63397),a=n(2784),s=n(75289),c=n(20180),d=n(33413),u=function(e){var t=e.fieldName,n=e.formField,u=e.fields,f=e.initialValues,p=(0,r.Z)((0,l.U$)(t),3),x=p[0],m=p[1],h=p[2],v=n.component;return(0,o.jsx)(s.xu,{sx:(0,i.Z)({mt:2,alignItems:"center"},n.type===d.h.CHECKBOX?{display:"flex",height:"130%"}:null),children:v?(0,o.jsx)(v,{meta:m,field:x,helpers:h,fieldName:t,formField:n,initialValues:f}):(0,o.jsxs)(a.Fragment,{children:[n.type===d.h.INPUT?(0,o.jsx)(c.Hq,{meta:m,field:x,fields:u,formField:n,fieldName:t,initialValues:f}):null,n.type===d.h.CHECKBOX&&(0,o.jsx)(c.sP,{meta:m,label:n.label,fieldName:t,initialValues:f,onChange:function(e){return h.setValue(e)}})]})})};t.Z=u},1411:function(e,t,n){"use strict";n.d(t,{Z:function(){return B}});var i=n(62230),r=n(85244),o=n(17064),l=n(52322),a=n(37149),s=n.n(a),c=n(59326),d=n(75289),u=n(65413),f=n(2784),p=n(92928),x=n(2978),m=n(98240),h=function(e){var t=e.children,n=(0,m.Z)(e,["children"]);return(0,l.jsx)(d.xu,(0,r.Z)((0,i.Z)({as:"ul",sx:{p:0,m:0,px:function(e){return"calc(".concat(e.space[3],"px + 8px)")},borderBottom:"1px solid #DFE1E5",position:"relative"}},n),{children:t}))};h.tabsRole="TabList";var v=function(e){var t=e.children,n=(0,m.Z)(e,["children"]),o=(0,c.B7)().theme;return(0,l.jsx)(p.OK,(0,r.Z)((0,i.Z)({},n),{style:(0,i.Z)({margin:"0 32px 0 0",top:"0",padding:"8px 0px",border:"none",bottom:"-1px",opacity:"0.8",transition:"all 150ms cubic-bezier(0.215,0.60,0.355,1)",borderRadius:"0"},n.selected?{borderBottom:"3px solid ".concat(o.colors.primary),color:o.colors.text,fontWeight:"500",opacity:"1",backgroundColor:"transparent"}:{borderBottom:"3px solid transparent"}),children:t}))};v.tabsRole="Tab";var g=function(e){var t=e.children,n=e.Footer,r=e.Header,o=e.tabs,a=e.bodySx,s=e.footerSx,c=e.defaultIndex,u=void 0===c?0:c,m=(0,f.useState)(u),g=m[0],b=m[1];return(0,l.jsx)(x.Z,{borderFooter:!0,footerSx:(0,i.Z)({p:0},s),bodySx:(0,i.Z)({p:0},a),sx:{border:"none"},Header:r,Footer:n,children:(0,l.jsxs)(p.mQ,{defaultIndex:u,onSelect:function(e){return b(e)},children:[(0,l.jsx)(h,{children:(o||[]).map(function(e){return(0,l.jsx)(v,{children:e},e)})}),f.Children.map(t,function(e,t){return(0,l.jsx)(d.xu,{sx:{p:function(e){return"calc(".concat(e.space[3],"px + 8px)")},display:t===g?"block":"none"},children:(0,l.jsx)(p.x4,{children:e})})})]})})},b=(0,f.memo)(g),y=n(26950),j=function(e){var t,n,i=e.text,r=e.sliceFieldName,o=e.theme,a=e.WidgetIcon;return(0,l.jsxs)(d.kC,{sx:{alignItems:"center"},children:[(0,l.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,l.jsx)(d.xv,{as:"p","data-testid":"item-header-text",sx:{py:0,px:1,fontWeight:"label",fontSize:"15px"},children:i}),(0,l.jsx)(d.xv,{as:"p",sx:{display:["none","none","initial"],fontSize:"14px",ml:1,color:"textClear"},children:r})]})},Z=n(28199),C=n(86163),k=n(5632),I=n(65186),S=n(25978),w=function(){var e=(0,k.useRouter)();return(0,l.jsxs)(d.xu,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",padding:"60px"},children:[(0,l.jsx)(I.wr$,{size:48,color:"#C9D0D8"}),(0,l.jsx)(d.xu,{sx:{height:"12px"}}),(0,l.jsx)(d.xv,{color:"text",sx:{fontWeight:600,fontSize:"24px",lineHeight:"32px",textAlign:"center"},children:"Your mock data has moved"}),(0,l.jsx)(d.xu,{sx:{height:"8px"}}),(0,l.jsx)(d.xv,{color:"text",sx:{fontWeight:400,fontSize:"14px",lineHeight:"24px",textAlign:"center"},children:"You can now edit directly your mock data in the new Slice Simulator."}),(0,l.jsx)(d.xu,{sx:{height:"24px"}}),(0,l.jsx)(d.zx,{onClick:function(t){t.preventDefault(),window.open("".concat(e.asPath,"/simulator"),S.pq)},children:"Go to the Slice Simulator"})]})},E=n(19869),F=n(50535),T=n(69114),_=n(79474),A=n(67557),N=n(77033),M=n(63397),R=function(e){var t=e.formId,n=e.initialValues,a=e.validationSchema,s=e.onSave,c=e.FormFields,u=e.children;return(0,l.jsx)(d.xu,{children:(0,l.jsx)(M.J9,{initialValues:n,validationSchema:a,onSubmit:function(e,t){var n;s({newKey:e.id,value:Object.entries((0,m.Z)(e,["id"])).reduce(function(e,t){var n=(0,o.Z)(t,2),l=n[0],a=n[1];if((void 0===a?"undefined":(0,N.Z)(a))!==Boolean&&!a){var s,d=null===(s=c[l])||void 0===s?void 0:s.defaultValue;if(void 0!==d)return(0,r.Z)((0,i.Z)({},e),(0,A.Z)({},l,d))}return(0,r.Z)((0,i.Z)({},e),(0,A.Z)({},l,a))},{})})},children:function(e){return(0,l.jsx)(M.l0,{id:t,children:u((0,r.Z)((0,i.Z)({},e),{initialValues:n}))})}})})},L=(0,f.memo)(R);s().setAppElement("#__next");var B=function(e){var t=e.close,n=e.data,a=e.fields,s=e.onSave,f=e.zoneType,p=(0,c.B7)().theme;if(!n.isOpen)return null;var x=(0,o.Z)(n.field,2),m=x[0],h=x[1],v=(0,T.t)(E.C,h.config,h.type);if(!v)return(0,l.jsxs)("div",{children:[h.type," not found"]});var g=v.Meta.icon,k=v.FormFields,I=v.Form,S=v.schema,A=(0,i.Z)({},(0,C.f7)((0,F.B9)(k,"id")),v.prepareInitialValues?v.prepareInitialValues(h.config):h.config),N=function(){try{return{res:S.validateSync({type:h.type,config:A},{stripUnknown:!0})}}catch(e){return{err:e}}}(),M=N.res,R=N.err;R&&(console.error("[EditModal] Failed to validate field of type ".concat(h.type,".\n Please update model.json accordingly.")),console.error(R));var B={id:m,config:M?M.config:A},O=(0,o.Z)(k.id.validate.matches,2),V=O[0],q=O[1],z=u.object().shape({id:u.string().matches(V,q).min(3).max(35).required(),config:S.fields.config}),D="".concat("edit-modal-form","-").concat(Math.random().toString());return(0,l.jsx)(Z.Z,{isOpen:!0,shouldCloseOnOverlayClick:!0,onRequestClose:t,contentLabel:"Widget Form Modal",children:(0,l.jsx)(L,{apiId:m,formId:D,initialValues:B,validationSchema:z,FormFields:k,onSave:function(e){var n=e.newKey,r=e.value;s({apiId:m,newKey:n,value:(0,i.Z)({},h,r)}),t()},children:function(e){var n=e.values,s=n.id,c=n.config.label,u=e.isValid,x=e.isSubmitting,m=e.initialValues,h=I?(0,l.jsx)(I,(0,r.Z)((0,i.Z)({},e),{fields:a}),"field-model-tab-content"):(0,l.jsx)(y.k,{children:Object.entries(k).map(function(e){var t=(0,o.Z)(e,2),n=t[0],i=t[1];return(0,l.jsx)(y.J,{children:(0,l.jsx)(_.Z,{fieldName:(0,C.lm)(n),formField:i,fields:a,initialValues:m})},n)})},"field-model-tab-content"),v=["Field Model"],Z=[h];if("slice"===f){var S=(0,l.jsx)(d.xu,{children:(0,l.jsx)(w,{})},"mock-data-tab-content");v.push("Mock Data"),Z.push(S)}return(0,l.jsx)(b,{borderFooter:!0,footerSx:{position:"sticky",bottom:0,p:0},tabs:v,Header:function(e){var n=e.radius;return(0,l.jsxs)(d.kC,{sx:{position:"sticky",zIndex:1,top:0,p:3,bg:"headSection",alignItems:"center",justifyContent:"space-between",borderTopLeftRadius:n,borderTopRightRadius:n},children:[(0,l.jsx)(j,{theme:p,text:c||s,WidgetIcon:g}),(0,l.jsx)(d.x8,{onClick:t,type:"button"})]})},Footer:(0,l.jsxs)(d.kC,{sx:{position:"sticky",bottom:0,alignItems:"space-between",bg:"headSection",p:3},children:[(0,l.jsx)(d.xu,{sx:{ml:"auto"}}),(0,l.jsx)(d.zx,{mr:2,type:"button",onClick:t,variant:"secondary",children:"Cancel"}),(0,l.jsx)(d.zx,{form:D,type:"submit",disabled:!u&&x,sx:{fontWeight:"400",paddingBlock:"8px",paddingInline:"16px",fontSize:"14px",borderRadius:"4px"},children:"Done"})]}),children:Z})}})})}},14424:function(e,t,n){"use strict";n.d(t,{Z:function(){return x}});var i=n(62230),r=n(85244),o=n(52322),l=n(37149),a=n.n(l),s=n(75289),c=n(2978),d=n(26950),u=n(28199),f=n(59326),p=function(e){var t=e.title,n=e.description,i=e.icon,r=e.onSelect,l=(0,f.B7)().theme;return(0,o.jsxs)(s.kC,{sx:{p:3,my:2,alignItems:"center",cursor:"pointer",borderRadius:"3px",border:function(e){var t;return"1px solid ".concat(null===(t=e.colors)||void 0===t?void 0:t.borders)},"&:hover":{border:function(e){var t=e.colors;return"1px solid ".concat(t.primary)},boxShadow:"0 0 0 3px rgba(81, 99, 186, 0.2)"}},"data-testid":t,onClick:r,children:[(0,o.jsx)(i,{label:'Select field of type "'.concat(t,'"'),style:{color:l.colors.primary,marginRight:"8px",borderRadius:"4px",padding:"5px",border:"2px solid",borderColor:l.colors.primary},size:32}),(0,o.jsxs)(s.xu,{ml:1,children:[(0,o.jsx)(s.X6,{as:"h4",sx:{fontSize:1},children:(0,o.jsx)("b",{children:t})}),(0,o.jsx)(s.xv,{as:"p",variant:"xs",children:n})]})]})};a().setAppElement("#__next");var x=function(e){var t=e.data,n=e.close,l=e.onSelect,a=e.widgetsArray;return t.isOpen?(0,o.jsx)(u.Z,{isOpen:!0,shouldCloseOnOverlayClick:!0,onRequestClose:n,contentLabel:"Widget Form Modal",children:(0,o.jsx)(c.Z,{borderFooter:!0,footerSx:{p:3},bodySx:{pt:2,pb:4,px:4},sx:{border:"none"},Header:function(e){var t=e.radius;return(0,o.jsxs)(s.kC,{sx:{position:"sticky",top:0,zIndex:1,p:3,pl:4,bg:"headSection",alignItems:"center",justifyContent:"space-between",borderTopLeftRadius:t,borderTopRightRadius:t,borderBottom:function(e){var t;return"1px solid ".concat(null===(t=e.colors)||void 0===t?void 0:t.borders)}},children:[(0,o.jsx)(s.X6,{children:"Add a new field"}),(0,o.jsx)(s.x8,{onClick:n})]})},children:(0,o.jsx)(d.k,{children:a.filter(function(e){return e}).map(function(e){var t=e.Meta,n=e.TYPE_NAME,a=e.CUSTOM_NAME;return(0,o.jsx)(d.J,{children:(0,o.jsx)(p,(0,r.Z)((0,i.Z)({},t),{onSelect:function(){return l(a||n)}}))},a||n)})})})}):null}},63928:function(e,t,n){"use strict";n.d(t,{Z:function(){return v}});var i=n(22710),r=n(99267),o=n(52322),l=n(2784),a=n(49857),s=n(7604),c=n(77245),d=n(8799),u=n(65186),f=n(59326),p=n(75289),x=n(51279),m={position:"relative",top:"3px"},h=function(e){var t,n,i,r=e.code,a=e.lang,s=(0,f.B7)().theme,h=(0,l.useState)(!1),v=h[0],g=h[1],b=function(){r&&navigator.clipboard.writeText(r).then(function(){g(!0),setTimeout(function(){g(!1)},1200)})};return r?(0,o.jsxs)(p.kC,{sx:{p:2,px:3,alignItems:"center",borderTop:"1px solid",borderColor:"borders",justifyContent:"space-between"},children:[(0,o.jsxs)(p.kC,{sx:{alignItems:"center",display:["none","none","flex"],maxWidth:"80%"},children:[(0,o.jsx)(d.vcz,{size:26,color:null==s?void 0:null===(t=s.colors)||void 0===t?void 0:t.icons,style:{border:"1px solid",borderColor:null==s?void 0:null===(n=s.colors)||void 0===n?void 0:n.borders,borderRadius:"3px",padding:"4px",marginRight:"2px"}}),(0,o.jsx)(x.Z,{sx:{margin:"0px 8px",border:"none",borderRadius:"3px",fontSize:"13px"},lang:a,children:r})]}),(0,o.jsx)(p.xu,{children:(0,o.jsxs)(p.zx,{"aria-label":v?"Code snippet copied":"Copy code snippet",onClick:b,variant:"textButton",children:[v?(0,o.jsx)(u.HhX,{size:16,color:null==s?void 0:null===(i=s.colors)||void 0===i?void 0:i.success,style:m}):(0,o.jsx)(c.LhG,{size:16,style:m}),(0,o.jsx)(p.xv,{as:"span",sx:{display:["none","inline","none","inline"]},children:"\xa0Copy"})]})})]}):null},v=function(e){var t=e.show,n=e.renderHintBase,l=e.item,c=e.isNestedGroup,d=n({item:l}),u=(0,a.ZP)(d,(0,i.Z)(function(){return(0,r.__generator)(this,function(e){switch(e.label){case 0:return[4,s.j.snippets.readSnippets({fieldPath:d.split("."),model:l.value,isNestedGroup:c})];case 1:return[2,e.sent()]}})})),f=u.data,p=u.error;if(p&&console.error(p),!f||p)return null;var x=f.snippets||[];return x[0]?(0,o.jsx)("div",{style:{display:t?"initial":"none"},children:(0,o.jsx)(h,{code:x[0].code,lang:x[0].language})}):null}},8033:function(e,t,n){"use strict";n.d(t,{Z:function(){return Z}});var i=n(62230),r=n(85244),o=n(98240),l=n(52322),a=n(7729),s=n(63397),c=n(2784),d=n(75289),u=n(59326),f=n(35549),p=n(86163),x=n(58428),m=n(19869),h=n(55197),v=n(18978),g=n(33710),b=n(79401),y=function(e){var t=e.error;return t?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(b.X,{children:(0,l.jsx)(g.Z,{type:"light",multiline:!0,border:!0,borderColor:"tomato"})}),(0,l.jsx)(v.Zlu,{color:"tomato","data-tip":t,style:{position:"absolute",right:"8px"},size:16})]}):null},j=function(e){var t=e.innerRef,n=(0,o.Z)(e,["innerRef"]);return(0,l.jsx)(d.II,(0,r.Z)((0,i.Z)({},n),{ref:t}))},Z=function(e){var t=e.widgetTypeName,n=e.fields,o=e.onSave,v=e.onCancelNewField,g=(0,c.useRef)(null),b=(0,u.B7)().theme,Z=(0,c.useState)(!0),C=Z[0],k=Z[1];(0,c.useEffect)(function(){g.current&&g.current.focus()},[g]);var I=m.C[t];if(!I)return console.error('Widget of type "'.concat(t,'" not found. This is a problem on our side!')),(0,l.jsx)("div",{children:"Unexpected error. Contact us for more info."});var S=I.FormFields,w=I.Meta.icon,E={id:S.id,label:S.label},F=(0,r.Z)((0,i.Z)({},(0,p.f7)(E),"UID"===t?{id:"uid"}:{}),{widgetTypeName:t}),T=(0,p.gc)(E),_=function(e,t,n){n(C&&!E.id.disabled?(0,r.Z)((0,i.Z)({},t),{label:e.target.value,id:(0,h.lV)(e.target.value)}):(0,r.Z)((0,i.Z)({},t),{label:e.target.value}))},A=function(e,t){t("id",e.target.value),k(!1)};return(0,l.jsx)(s.J9,{onSubmit:o,validationSchema:T,initialValues:F,children:function(e){var t,o,c=e.errors,u=e.values,p=e.setValues,m=e.setFieldValue,h=e.submitForm;return(0,l.jsx)(s.l0,{"data-testid":"new-field-form",children:(0,l.jsxs)(d.kC,{as:"li",sx:{bg:"white",p:3,px:3,mx:0,ml:"34px",alignItems:"center",variant:"styles.listItem",border:function(e){var t,n;return"1px solid ".concat((null===(t=e.colors)||void 0===t?void 0:null===(n=t.borders)||void 0===n?void 0:n.toString())||"")},flexWrap:"wrap",gap:"12px",justifyContent:"flex-start"},children:[(0,l.jsx)(w,{style:{color:null===(t=b.colors)||void 0===t?void 0:t.primary,borderRadius:"4px",padding:"4px",border:"2px solid",borderColor:null===(o=b.colors)||void 0===o?void 0:o.primary},size:28}),(0,l.jsxs)(d.kC,{sx:{alignItems:"center",flexGrow:1,gap:2,position:"relative"},children:[(0,l.jsx)(d.xv,{as:"p",sx:{fontWeight:500,whiteSpace:"nowrap"},children:"Field Name"}),(0,l.jsx)(s.gN,{onChange:function(e){return _(e,u,p)},onKeyDown:function(e){"Enter"===e.key&&h()},name:"label",placeholder:"Field Name",type:"text",validate:function(e){if(!e.length)return"This field is required"},as:j,innerRef:g,sx:(0,r.Z)((0,i.Z)({},(0,f.tM)(E.label.disabled?f.$w.DISABLED:c.label?f.$w.ERROR:void 0)),{flexGrow:1,minWidth:"128px",width:"initial"}),"aria-label":"label-input","data-testid":"new-field-name-input"}),(0,l.jsx)(y,{error:c.label})]}),(0,l.jsxs)(d.kC,{sx:{alignItems:"center",flexGrow:1,gap:2,position:"relative"},children:[(0,l.jsx)(d.xv,{as:"p",sx:{fontWeight:500,whiteSpace:"nowrap"},children:"Field ID"}),(0,l.jsx)(s.gN,{onChange:function(e){return A(e,m)},onKeyDown:function(e){"Enter"===e.key&&h()},name:"id",placeholder:"e.g. buttonLink",type:"text",disabled:E.id.disabled,validate:function(e){return(0,x.u)({value:e,fields:n,initialId:null})},as:j,sx:(0,r.Z)((0,i.Z)({},(0,f.tM)(E.id.disabled?f.$w.DISABLED:c.id?f.$w.ERROR:void 0)),{flexGrow:1,minWidth:"128px",width:"initial"}),"data-testid":"new-field-id-input"}),(0,l.jsx)(y,{error:c.id})]}),(0,l.jsxs)(d.kC,{sx:{gap:2},children:[(0,l.jsx)(a.zx,{onClick:v,color:"grey",children:"Cancel"}),(0,l.jsx)(a.zx,{onClick:function(){h()},children:"Add"})]})]})})}})}},75843:function(e,t,n){"use strict";n.d(t,{Z:function(){return F}});var i=n(62230),r=n(85244),o=n(17064),l=n(81541),a=n(52322),s=n(7729),c=n(13980),d=n(2784),u=n(65077),f=n(12189),p=n(85513),x=n(21112),m=n(14424),h=n(40023),v=n(75289),g=n(82004),b=n(1225),y=n(19869),j=n(69114),Z=n(63928),C=function(e){var t=e.fields,n=e.title,o=e.tabId,l=e.enterEditMode,s=e.enterSelectMode,c=e.onDragEnd,d=e.renderFieldAccessor,u=e.onDeleteItem,f=e.onSave,p=e.showHints,x=e.newField,m=e.renderHintBase,C=e.isRepeatable,k=e.testId,I=e.isRepeatableCustomType;return(0,a.jsx)(h.Z5,{onDragEnd:c,children:(0,a.jsx)(h.bK,{droppableId:n,children:function(e,n){return(0,a.jsxs)(v.xu,(0,r.Z)((0,i.Z)({as:"ul",ref:e.innerRef},e.droppableProps),{"data-testid":k,sx:{paddingInline:"16px !important"},children:[t.map(function(e,t){var c=e.value,x=c.config,h=c.type,k=(0,j.t)(y.C,x,h);if(!k)return(0,a.jsx)(g.Z,{children:(0,a.jsxs)(v.xv,{children:['Field type "',h,'" not supported']})});var S={item:e,index:t,tabId:o,widget:k,showHints:p,key:e.key,enterSelectMode:s,renderFieldAccessor:d,enterEditMode:l,parentSnapshot:n,deleteItem:u,saveItem:f,draggableId:"list-item-".concat(e.key),isRepeatableCustomType:I,testId:"list-item-".concat(e.key)},w=(0,a.jsx)(Z.Z,{item:e,show:p,isRepeatable:C,renderHintBase:m,Widgets:y.C,typeName:k.CUSTOM_NAME||k.TYPE_NAME});if(k.CustomListItem){var E=k.CustomListItem;return(0,a.jsx)(E,(0,r.Z)((0,i.Z)({},S),{HintElement:w}))}return(0,a.jsx)(b.Z,(0,r.Z)((0,i.Z)({},S),{HintElement:w}))}),e.placeholder,x]}))}})})},k=n(8033),I=n(73539),S=n.n(I),w=function(e){var t=e.zoneType,n=e.heading,i=void 0===n?"Your ".concat(t," has no fields yet"):n,r=e.onActionClick,o=e.actionTestId;return(0,a.jsxs)("div",{className:S().root,children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(s.xv,{variant:"bold",children:i}),(0,a.jsx)(s.xv,{color:"grey11",children:"A field is an input for content (e.g. text, images, links)."})]}),(0,a.jsx)(s.zx,{color:"grey",onClick:function(){return r()},"data-testid":o,startIcon:"add",children:"Add a field"})]})},E=function(e){var t,n,c=e.zoneType,h=e.zoneTypeFormat,v=e.tabId,g=e.title,b=e.fields,y=e.poolOfFieldsToCheck,j=e.widgetsArray,Z=e.isRepeatable,I=e.onDeleteItem,S=e.onSaveNewField,E=e.onDragEnd,F=e.EditModal,T=e.onSave,_=e.dataTip,A=e.renderHintBase,N=e.renderFieldAccessor,M=e.testId,R=e.isRepeatableCustomType,L=e.emptyStateHeading,B=e.emptyStateActionTestId,O=Object.entries(y).find(function(e){return"UID"===(0,o.Z)(e,2)[1].value.type})?j.filter(function(e){return"UID"!==e.TYPE_NAME}):j,V=(0,d.useState)(!1),q=V[0],z=V[1],D=(0,d.useState)({isOpen:!1}),P=D[0],H=D[1],J=(0,d.useState)({isOpen:!1}),G=J[0],W=J[1],U=(0,d.useState)(null),$=U[0],Y=U[1],K=function(e){H({isOpen:!0,field:e});var t=(0,o.Z)(e,2),n=t[0],i=t[1];f.Xe.track({event:"field:settings-opened",id:n,name:i.config.label,type:i.type,isInAGroup:!1,contentType:(0,x.T)(window.location.pathname)})},X=function(){W({isOpen:!0})},Q=function(){H({isOpen:!1})},ee=function(){return W({isOpen:!1})},et=function(e){Y({widgetTypeName:e,fields:b}),W({isOpen:!1})},en=function(){return Y(null)};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(p.Bu,{actions:b.length>0?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(s.xv,{color:"grey11",component:"span",noWrap:!0,children:"Show code snippets?"}),(0,a.jsx)(s.rs,{checked:q,onCheckedChange:z,size:"small",style:{flexShrink:0},"data-testid":"code-snippets-switch"}),(0,a.jsx)(s.zx,{"data-testid":"add-".concat(Z?"Repeatable":"Static","-field"),onClick:X,startIcon:"add",color:"grey",disabled:null!==$,children:"Add a field"})]}):void 0,children:g}),0!==b.length||$?b.length>0||$?(0,a.jsx)(u.xR,{children:(0,a.jsx)(C,{tabId:v,isRepeatable:Z,fields:b,showHints:q,dataTip:_,title:g,renderFieldAccessor:N,renderHintBase:A,enterEditMode:K,enterSelectMode:X,onDragEnd:E,onDeleteItem:I,onSave:T,testId:M,isRepeatableCustomType:R,newField:$&&(0,a.jsx)(k.Z,(0,r.Z)((0,i.Z)({},$),{fields:y||b,onSave:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];S.apply(void 0,(0,l.Z)(t)),Y(null)},onCancelNewField:en}))})}):void 0:(0,a.jsx)(w,{zoneType:(t=c,n=h,"customType"===t?"page"===n?"page type":"custom type":t),heading:L,onActionClick:function(){return X()},actionTestId:B}),(0,a.jsx)(F,{data:P,close:Q,onSave:T,fields:y,zoneType:c}),(0,a.jsx)(m.Z,{data:G,close:ee,onSelect:et,widgetsArray:O})]})};E.propTypes={isRepeatable:c.bool,title:c.string.isRequired,dataTip:c.string.isRequired,onSave:c.func.isRequired,onSaveNewField:c.func.isRequired,onDragEnd:c.func.isRequired,onDeleteItem:c.func.isRequired,poolOfFieldsToCheck:(0,c.arrayOf)((0,c.shape)({key:c.string,value:c.object})),renderHintBase:c.func.isRequired,renderFieldAccessor:c.func.isRequired,widgetsArray:c.array.isRequired,fields:(0,c.arrayOf)((0,c.shape)({key:c.string.isRequired,value:(0,c.shape)({config:c.object,fields:c.array,type:c.string.isRequired})}))};var F=E},69114:function(e,t,n){"use strict";n.d(t,{t:function(){return r}});var i=n(59050),r=function(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 r;return null!==(r=e.Group)&&void 0!==r?r:e.NestedGroup}return e[n]}},58428:function(e,t,n){"use strict";n.d(t,{J:function(){return l},u:function(){return o}});var i=n(25978),r=n(77362),o=function(e){var t=e.value,n=e.fields,i=e.initialId;return t?n.find(function(e){return e.key===t})&&t!==i?'Field "'.concat(t,'" already exists.'):void 0:"Field is required"},l={label:(0,r.II)("Label",{required:"This field is required",max:!0},void 0,void 0,"Label for content creators (defaults to field type)"),id:(0,r.II)("API ID*",{min:!0,max:!0,required:"This field is required",matches:[i.xo,"No special characters allowed (except _)"]},o,void 0,"A unique identifier for the field (e.g. buttonLink)"),placeholder:(0,r.II)("Placeholder",{required:"This field is required",max:[100,"String is too long. Max: 100"]},void 0,void 0,"Placeholder text for content creators")}},77362:function(e,t,n){"use strict";n.d(t,{II:function(){return c},Jg:function(){return o}});var i=n(86163),r=n(33413),o=function(e){var t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=!(arguments.length>2)||void 0===arguments[2]||arguments[2];return{type:r.h.CHECKBOX,validate:{required:(0,i.MJ)(t,s)},required:t,label:e,defaultValue:n,yupType:"boolean"}},l=[3,"String is too short. Min: 3"],a=[35,"String is too long. Max: 35"],s=["Field is required"],c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{min:l,max:a,required:s},n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,c=arguments.length>4?arguments[4]:void 0,d=t||{},u=d.min,f=d.max,p=d.required,x=d.matches;return{type:r.h.INPUT,label:e,validate:{required:(0,i.MJ)(p,s),min:(0,i.MJ)(u,l),max:(0,i.MJ)(f,a),matches:x},defaultValue:o,fieldLevelValidation:n,yupType:"string",placeholder:c}}},86163:function(e,t,n){"use strict";n.d(t,{MJ:function(){return u},f7:function(){return f},gc:function(){return p},lm:function(){return d}});var i=n(67557),r=n(62230),o=n(85244),l=n(17064),a=n(81541),s=n(65413),c=n(33413),d=function(e){return"id"===e?"id":"config.".concat(e)},u=function(e,t){return Array.isArray(e)?e:"boolean"==typeof e&&e?t:null},f=function(e){return Object.entries(e).reduce(function(e,t){var n,a=(0,l.Z)(t,2),s=a[0],d=null===(n=a[1]).defaultValue?void 0:void 0!==n.defaultValue?n.defaultValue:n.type===c.h.CHECKBOX||(n.type===c.h.INPUT?"":n.type===c.h.SELECT?[]:void 0);return void 0!==d?(0,o.Z)((0,r.Z)({},e),(0,i.Z)({},s,d)):e},{})},p=function(e){return s.object().shape(Object.entries(e).filter(function(e){return e}).reduce(function(e,t){var n=(0,l.Z)(t,2),c=n[0],d=n[1],u=d.validate,f=d.yupType;if(!u)return e;if("function"==typeof u)return(0,o.Z)((0,r.Z)({},e),(0,i.Z)({},c,u(c,d)));var p=s[f]();return Object.entries(u).filter(function(e){return e&&e[1]}).forEach(function(e){var t,n=(0,l.Z)(e,2),i=n[0],r=n[1];if(r&&p[i]){p=(t=p)[i].apply(t,(0,a.Z)(Array.isArray(r)?r:[r]));return}console.warn('Invalid Yup validator for field "'.concat(c,'"'))}),(0,o.Z)((0,r.Z)({},e),(0,i.Z)({},c,p))},{})).required().default(void 0).noUnknown(!0)}},33413:function(e,t,n){"use strict";var i,r;n.d(t,{h:function(){return i}}),(r=i||(i={})).CHECKBOX="checkbox",r.INPUT="input",r.SELECT="select"},19869:function(e,t,n){"use strict";n.d(t,{C:function(){return tv}});var i,r,o=n(62230),l=n(52322),a=n(13002),s=n(85244),c=n(65186),d=n(65413),u=n(17064),f=n(75289),p=n(26950),x=n(79474),m=n(86163),h=n(58428),v=n(77362),g=(0,s.Z)((0,o.Z)({},h.J),{repeat:(0,v.Jg)("Repeatable",!1,!0)}),b=function(e){var t=e.initialValues,n=e.fields,i=e.values,r=e.setFieldValue,o=i.config.repeat;return(0,l.jsxs)(p.k,{children:[Object.entries(g).filter(function(e){return"repeat"!==(0,u.Z)(e,1)[0]}).map(function(e){var i=(0,u.Z)(e,2),r=i[0],o=i[1];return(0,l.jsx)(p.J,{children:(0,l.jsx)(x.Z,{fieldName:(0,m.lm)(r),formField:o,fields:n,initialValues:t})},r)}),(0,l.jsx)(p.J,{children:(0,l.jsx)(f.xu,{sx:{mt:2,alignItems:"center",display:"flex",height:"130%"},children:(0,l.jsxs)(f.__,{variant:"label.border",sx:{mb:0},children:[(0,l.jsx)(f.XZ,{checked:o,onChange:function(){return r("config.repeat",!o)}}),"Repeatable"]})})})]})},y={icon:c.cC1,title:"Group",description:"A repeatable set of fields"};function j(e){var t,n=e.schemaTypeRegex,i=e.customListItem,r=e.customName;return{Meta:y,Form:b,FormFields:g,schema:d.object().shape({type:d.string().matches(n,{excludeEmptyString:!0}).required(),config:d.object().shape({fields:d.array(),label:d.string(),placeholder:d.string(),repeat:d.boolean().optional()})}),create:function(e){return{type:"Group",config:{label:e,repeat:!0,fields:[]}}},CustomListItem:i,TYPE_NAME:"Group",CUSTOM_NAME:r}}var Z=n(98240),C=n(81541),k=n(2784),I=n(40023),S=n(28316),w=n(12189),E=n(1225),F=n(1411),T=n(14424),_=n(63928),A=n(8033),N=n(69114),M=n(63987),R=n(50535),L=n(55197),B=n(21112),O=function(e){var t=e.tabId,n=e.widget,a=e.Widgets,c=e.widgetsArray,d=e.isNestedGroupItem,p=void 0!==d&&d,x=(e.parentSnapshot,e.showHints),m=e.isRepeatable,h=e.item,v=e.draggableId,g=e.saveItem,b=e.HintElement,y=(0,Z.Z)(e,["tabId","widget","Widgets","widgetsArray","isNestedGroupItem","parentSnapshot","showHints","isRepeatable","item","draggableId","saveItem","HintElement"]),j=(0,k.useState)(!1),O=j[0],V=j[1],q=(0,k.useState)(null),z=q[0],D=q[1],P=(0,k.useState)({isOpen:!1}),H=P[0],J=P[1],G=function(e){D({widgetTypeName:e}),V(!1)},W=function(){D(null)},U=function(){J({isOpen:!1})},$=function(e){var t,n,o,l,s=e.id,c=e.label,d=a[e.widgetTypeName].create(c),u=(t={group:M.Fl.fromSM(h.value),fieldId:s,field:d},null!==(n=(i=l=structuredClone(t.group)).config)&&void 0!==n||(i.config={}),null!==(o=(r=l.config).fields)&&void 0!==o||(r.fields={}),l.config.fields[t.fieldId]=t.field,l);g({apiId:h.key,newKey:h.key,value:M.Fl.toSM(u)}),w.Xe.track({event:"field:added",id:s,name:c,type:d.type,isInAGroup:!0,contentType:(0,B.T)(window.location.pathname)})},Y=function(e){var t,n=e.apiId,i=e.newKey,r=e.value,o=function(e){var t,n,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(var r in i.config.fields={},e.group.config.fields)r===e.previousFieldId?i.config.fields[e.newFieldId]=e.field:i.config.fields[r]=e.group.config.fields[r];return i}({group:M.Fl.fromSM(h.value),previousFieldId:n,newFieldId:i,field:(null===(t=r.config)||void 0===t?void 0:t.fields)?M.Fl.fromSM(r):r});g({apiId:h.key,newKey:h.key,value:M.Fl.toSM(o)})},K=function(e){if(!(0,R.uS)(e)){var t=e.source,n=e.destination;if(n){var i=t.index,r=n.index,o=function(e){var t,n=structuredClone(e.group);if(!(null===(t=n.config)||void 0===t?void 0:t.fields))return n;var i=Object.entries(n.config.fields),r=(0,u.Z)(i.splice(e.sourceIndex,1),1)[0];return i.splice(e.destinationIndex,0,r),n.config.fields=Object.fromEntries(i),n}({group:M.Fl.fromSM(h.value),sourceIndex:i,destinationIndex:r});(0,S.flushSync)(function(){g({apiId:h.key,newKey:h.key,value:M.Fl.toSM(o)})})}}},X=function(e){var t,n,i,r,o=(t={group:M.Fl.fromSM(h.value),fieldId:e},null===(n=(r=structuredClone(t.group)).config)||void 0===n||null===(i=n.fields)||void 0===i||delete i[t.fieldId],r);g({apiId:h.key,newKey:h.key,value:M.Fl.toSM(o)})},Q=function(e){J({isOpen:!0,field:e});var t=(0,u.Z)(e,2),n=t[0],i=t[1];w.Xe.track({event:"field:settings-opened",id:n,name:i.config.label,type:i.type,isInAGroup:!0,contentType:(0,B.T)(window.location.pathname)})};return(0,l.jsxs)(k.Fragment,{children:[(0,l.jsx)(E.Z,(0,s.Z)((0,o.Z)({item:h,widget:n,draggableId:v},y),{HintElement:b,CustomEditElements:[(0,l.jsx)(f.zx,{mr:2,variant:"buttons.darkSmall",onClick:function(){return V(!0)},children:"Add Field"},"custom-edit-element-".concat(h.key)),],children:(0,l.jsx)(f.xu,{sx:{ml:4},children:(0,l.jsx)(I.Z5,{onDragEnd:K,children:(0,l.jsx)(I.bK,{droppableId:"".concat(t,"-").concat(h.key,"-zone"),children:function(e){return(0,l.jsxs)("ul",(0,s.Z)((0,o.Z)({ref:e.innerRef},e.droppableProps),{children:[h.value.config.fields.map(function(e,t){var n=e.value,i=n.config,r=n.type,c=(0,N.t)(a,i,r);if(!c)return null;var d={item:e,index:t,widget:c,key:e.key,enterEditMode:Q,deleteItem:X,saveItem:Y,showHints:x,renderFieldAccessor:function(t){return"item".concat((0,L.Ti)(e.key))},draggableId:"group-".concat(h.key,"-").concat(e.key,"-").concat(t),testId:"list-item-group-".concat(h.key,"-").concat(e.key)},u=(0,l.jsx)(_.Z,{item:e,show:x,isRepeatable:m,renderHintBase:function(e){var t=e.item;return"".concat(p?"subItem":"item").concat((0,L.Ti)(t.key))},isNestedGroup:c.CUSTOM_NAME===tu,Widgets:a,typeName:c.CUSTOM_NAME||c.TYPE_NAME});if(c.CustomListItem){var f=c.CustomListItem;return(0,l.jsx)(f,(0,s.Z)((0,o.Z)({},d),{HintElement:u}))}return(0,l.jsx)(E.Z,(0,s.Z)((0,o.Z)({},d),{HintElement:u}))}),e.placeholder,z&&(0,l.jsx)(A.Z,(0,s.Z)((0,o.Z)({},z),{fields:h.value.config.fields||[],onSave:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];$.apply(void 0,(0,C.Z)(t)),D(null)},onCancelNewField:W}))]}))}})})})})),(0,l.jsx)(T.Z,{data:{isOpen:O},close:function(){return V(!1)},onSelect:G,widgetsArray:c}),(0,l.jsx)(F.Z,{data:H,close:U,onSave:Y,fields:h.value.config.fields})]})},V=n(8799),q={icon:V.XGl,title:"Boolean",description:"An input that is either true or false"},z={label:h.J.label,id:h.J.id,placeholder_false:(0,v.II)("False Placeholder",{required:!1},null,"false","Value the content creator sees (Output as 'false' in the API)."),placeholder_true:(0,v.II)("True Placeholder",{required:!1},null,"true","Value the content creator sees (Output as 'true' in the API)"),default_value:(0,v.Jg)("Default to true")},D=d.object().shape({type:d.string().matches(/^Boolean$/,{excludeEmptyString:!0}).required(),config:(0,m.gc)((0,R.B9)(z,"id"))}),P={icon:c.jqW,title:"Color",description:"A color picker"},H=(0,R.zg)("Color"),J=H.TYPE_NAME,G=H.FormFields,W=H.schema,U=n(56580),$=n(93290),Y=n(7781),K=n(34543),X=(0,s.Z)((0,o.Z)({},h.J),{allowTargetBlank:(0,v.Jg)("Allow target blank",!1,!1)}),Q=function(e){var t=e.initialValues,n=e.fields;return(0,l.jsx)(p.k,{children:Object.entries(X).map(function(e){var i=(0,u.Z)(e,2),r=i[0],o=i[1];return(0,l.jsx)(p.J,{children:(0,l.jsx)(x.Z,{fieldName:(0,m.lm)(r),formField:o,fields:n,initialValues:t})},r)})})},ee={icon:K.eR7,title:"Link",description:"A link to web, media or Prismic document"},et=d.object().shape({label:d.string().optional(),useAsTitle:d.boolean().optional(),placeholder:d.string().optional(),select:d.string().optional().oneOf(["media","document","web",null]).nullable(),customtypes:d.array(d.string()).strict().optional(),masks:d.array(d.string()).optional(),tags:d.array(d.string()).optional(),allowTargetBlank:d.boolean().strict().optional()}).required().default(void 0).noUnknown(!0),en=d.object().shape({type:d.string().matches(/^Link$/,{excludeEmptyString:!0}).required(),config:et.optional()}),ei=n(36131),er={label:h.J.label,id:h.J.id,customtypes:{validate:function(){return d.array().of(d.string())}}},eo=function(e){var t=e.initialValues,n=e.values,i=e.fields,r=e.setFieldValue,a=(0,U.v9)(Y.Ch).filter($.TG),c=a.map(function(e){return{value:e.local.id,label:e.local.label}}),d=n.config.customtypes?n.config.customtypes.map(function(e){var t=a.find(function(t){return t.local.id===e});return{value:null==t?void 0:t.local.id,label:null==t?void 0:t.local.label}}):null;return(0,l.jsxs)(p.k,{children:[Object.entries(er).filter(function(e){return"customtypes"!==e[0]}).map(function(e){var n=(0,u.Z)(e,2),r=n[0],o=n[1];return(0,l.jsx)(p.J,{children:(0,l.jsx)(x.Z,{fieldName:(0,m.lm)(r),formField:o,fields:i,initialValues:t})},r)}),(0,l.jsx)(p.J,{children:(0,l.jsxs)(f.xu,{sx:{mt:2,alignItems:"center"},children:[(0,l.jsx)(f.__,{htmlFor:"origin",mb:"1",children:"Types"}),(0,l.jsx)(ei.ZP,{isMulti:!0,name:"origin",options:c,onChange:function(e){e&&r("config.customtypes",e.map(function(e){return e.value}))},value:d,theme:function(e){return(0,s.Z)((0,o.Z)({},e),{colors:(0,s.Z)((0,o.Z)({},e.colors),{text:"text",primary:"background"})})}})]})})]})},el={icon:c.I2R,title:"Content Relationship",description:"Define content relations & internal links"},ea=et.shape({label:d.string().max(35,"String is too long. Max: 35"),select:d.string().required().matches(/^document$/,{excludeEmptyString:!0}),customtypes:d.array(d.string()).strict().optional()}),es=d.object().shape({type:d.string().matches(/^Link$/,{excludeEmptyString:!0}).required(),config:ea}),ec=(0,R.zg)("Date"),ed=ec.FormFields,eu=ec.schema,ef={icon:c.f$3,title:"Date",description:"A calendar date picker"},ep=(0,R.zg)("Embed"),ex=ep.FormFields,em=ep.schema,eh={icon:K.xqv,title:"Embed",description:"Embed videos, songs, tweets, slides, …"},ev={label:h.J.label,id:h.J.id},eg=d.object().shape({type:d.string().matches(/^GeoPoint$/,{excludeEmptyString:!0}).required(),config:d.object().shape({label:d.string()}).required().default(void 0).noUnknown(!0)}),eb={icon:c.c7Z,title:"GeoPoint",description:"A field for storing geo-coordinates"},ey=n(63397),ej=n(20180),eZ=n(26474),eC=function(e){var t=e.onClick,n=e.error,i=e.onDelete,r=e.active,a=e.text,s=e.sx;return(0,l.jsx)(eZ.Z,{useActive:!0,fitButton:!0,error:n,onClick:t,active:r,sx:(0,o.Z)({position:"relative",width:"64px",height:"64px"},s),Icon:function(){return(0,l.jsxs)(k.Fragment,{children:[(0,l.jsxs)(f.kC,{sx:{flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[(0,l.jsx)(V.jnY,{size:22}),(0,l.jsx)(f.xv,{mt:1,children:a})]}),i?(0,l.jsx)(f.Ct,{onClick:i,variant:"circle-right",children:(0,l.jsx)(c.B4e,{})}):null]})}})},ek=function(e){var t=e.onClick;return(0,l.jsx)(eZ.Z,{fitButton:!0,onClick:t,sx:{width:"64px",height:"64px",border:function(e){var t=e.colors;return"1px solid ".concat(String(null==t?void 0:t.borders))}},Icon:function(){return(0,l.jsx)(f.kC,{sx:{flexDirection:"column",justifyContent:"center",alignItems:"center"},children:(0,l.jsx)(V.iTs,{size:34,color:"#5263BA","aria-label":"Add a thumbnail"})})}})},eI=function(e){var t=e.prefix,n=e.required,i=e.display,r=(0,u.Z)((0,ey.U$)(t),2),o=(r[0],r[1]),a=void 0!==n&&n?"*":"";return i?(0,l.jsxs)(k.Fragment,{children:[(0,l.jsx)(eS,{name:"".concat(t,".name"),label:"Name".concat(a),placeholder:"main",sx:{mb:3},isConstraint:"config.constraint"===t,meta:o}),(0,l.jsx)(ew,{name:"".concat(t,".width"),label:"Width (px)".concat(a),placeholder:" ",sx:{mb:3}}),(0,l.jsx)(ew,{name:"".concat(t,".height"),label:"Height (px)".concat(a),placeholder:" "})]}):null},eS=function(e){var t=e.name,n=e.label,i=e.placeholder,r=e.meta,a=e.isConstraint,c=(0,Z.Z)(e,["name","label","placeholder","meta","isConstraint"]),d=(0,u.Z)((0,ey.U$)(t),1)[0];return(0,l.jsx)(ej.Hq,(0,s.Z)((0,o.Z)({},c),{fieldName:t,meta:r,formField:{label:n,placeholder:i},field:a?{value:"main",readOnly:!0}:{value:d.value},variant:a?"disabled":"primary"}))},ew=function(e){var t=e.name,n=e.label,i=e.placeholder,r=(0,Z.Z)(e,["name","label","placeholder"]),a=(0,u.Z)((0,ey.U$)(t),2),c=a[0],d=a[1];return(0,l.jsx)(ej.Hq,(0,s.Z)((0,o.Z)({},r),{fieldName:t,formField:{label:n,placeholder:i},meta:d,field:{min:0,type:"number",value:c.value||"",onKeyDown:function(e){("e"===e.key||"-"===e.key||"+"===e.key)&&e.preventDefault()}}}))},eE=function(){return d.number().nullable().transform(function(e,t){return""===t?null:e})},eF={label:h.J.label,id:h.J.id,constraint:{validate:function(){return d.object().defined().shape({width:eE(),height:eE()})}},thumbnails:{validate:function(){return d.array().defined().of(d.object().test({name:"Thumbnails",message:"Must set name and width or height at minimum",test:function(e){if(!e.name)return!1;var t="number"==typeof e.width&&e.width,n="number"==typeof e.height&&e.height;return e.name&&(t||n)}}))}}},eT={name:"",width:"",height:""},e_=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.width,n=e.height,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!i||t||n?t||n?"".concat(t||"auto","x").concat(n||"auto"):"...":"auto"},eA=function(e){var t=e.initialValues,n=e.values,i=e.errors,r=e.fields,a=e.touched,c=(0,k.useState)(0),d=c[0],h=c[1],v=n.config,g=v.thumbnails,b=v.constraint;return(0,k.useEffect)(function(){h(g.length)},[g.length]),(0,l.jsxs)(p.k,{children:[Object.entries(eF).map(function(e){var n=(0,u.Z)(e,2),i=n[0],o=n[1];return(0,l.jsx)(p.J,{children:(0,l.jsx)(x.Z,{fieldName:(0,m.lm)(i),formField:o,fields:r,initialValues:t})},i)}),(0,l.jsxs)(p.J,{children:[(0,l.jsx)(f.__,{htmlFor:"thumbnails",variant:"label.primary",sx:{mt:1,display:"flex",alignItems:"center"},children:"Responsive views*"}),(0,l.jsx)(f.Zb,{p:3,children:(0,l.jsx)(ey.F2,{name:"config.thumbnails",render:function(t){var n=t.push,r=t.remove;return(0,l.jsxs)(k.Fragment,{children:[(0,l.jsxs)(f.kC,{mb:3,children:[(0,l.jsx)(eC,{active:0===d,text:e_(b,!0),sx:{mr:2},onClick:function(){return h(0)}}),g.map(function(e,t){return(0,l.jsx)(eC,{sx:{mr:3},active:d===+t+1,text:e_(e),error:!!i.thumbnails&&!!a.thumbnails&&!!a.thumbnails[t]&&!!i.thumbnails&&!!i.thumbnails[t],onDelete:function(){return r(t)},onClick:function(){return h(+t+1)}},"thumbnail-button-".concat(+t+1))}),(0,l.jsx)(ek,{onClick:function(){n(eT)}})]}),(0,l.jsx)(eI,(0,s.Z)((0,o.Z)({},e),{display:0===d,prefix:"config.constraint"})),g.map(function(t,n){return(0,k.createElement)(eI,(0,s.Z)((0,o.Z)({},e),{required:!0,key:"thumbnail-".concat(+n+1),display:d===+n+1,prefix:"config.thumbnails[".concat(n,"]")}))})]})}})})]})]})},eN=d.object().shape({type:d.string().matches(/^Image$/,{excludeEmptyString:!0}).required(),config:(0,m.gc)((0,R.B9)(eF,"id"))}),eM={icon:V.jnY,title:"Image",description:"A responsive image field with constraints"},eR=(0,o.Z)({},h.J),eL=function(e){var t=e.initialValues,n=e.fields;return(0,l.jsx)(p.k,{children:Object.entries(eR).map(function(e){var i=(0,u.Z)(e,2),r=i[0],o=i[1];return(0,l.jsx)(p.J,{children:(0,l.jsx)(x.Z,{fieldName:(0,m.lm)(r),formField:o,fields:n,initialValues:t})},r)})})},eB={icon:c.x2k,title:"Link to media",description:"A link to files, document and media"},eO=et.shape({select:d.string().required().matches(/^media$/,{excludeEmptyString:!0})}),eV=d.object().shape({type:d.string().matches(/^Link$/,{excludeEmptyString:!0}).required(),config:eO.optional()}),eq=n(951),ez=(0,R.zg)("Number"),eD=ez.FormFields,eP=ez.schema,eH={icon:eq.JUs,title:"Number",description:"A number input field"},eJ=n(33413),eG=function(e){return"use first value as default ".concat(e?'("'.concat(e,'")'):"")},eW=function(e,t){return t?e:void 0},eU=(0,s.Z)((0,o.Z)({},h.J),{default_value:{type:eJ.h.CHECKBOX,yupType:"string",defaultValue:null,validate:function(){return d.string().test({name:"default_value",message:'Default value is not part of field "options" in Select',test:function(e){return void 0===e||this.parent&&this.parent.options&&this.parent.options.find(function(t){return t===e})}})},component:function(e){var t,n=null===(t=(0,ey.u6)().values.config)||void 0===t?void 0:t.options[0];return(0,l.jsx)(ej.w8,(0,s.Z)((0,o.Z)({},e),{defaultValue:e.field.value,controlledValue:n,setControlledValue:e.helpers.setValue,buildControlledValue:eW,label:eG}))}},options:{yupType:"array",defaultValue:["1","2"],validate:{required:["Select requires a minimum of 2 options"],min:[2,"Choose at least 2 options"],test:{name:"non-empty values",message:"Values cannot be empty",test:function(e){return!e.some(function(e){return!e||!e.length})}}},component:function(e){return(0,l.jsx)(ej.kp,(0,o.Z)({label:"Options",inputPlaceholder:"Select option output in API (e.g. 'blueTheme')",buttonLabel:"Add option"},e))}}}),e$={icon:c.dzP,title:"Select",description:"A dropdown field of options for content creators."},eY=d.object().shape({type:d.string().matches(/^Select$/,{excludeEmptyString:!0}).required(),config:(0,m.gc)((0,R.B9)(eU,"id"))}),eK=n(47927),eX=n(76635),eQ=function(e){return function(t){var n=t.size;return(0,l.jsx)("span",{style:{fontSize:n},children:e})}},e0=[{value:"paragraph",label:"P",icon:eQ("p")},{value:"preformatted",label:"PRE",icon:eQ("pre")},{value:"heading1",label:"H1",icon:eQ("h1")},{value:"heading2",label:"H2",icon:eQ("h2")},{value:"heading3",label:"H3",icon:eQ("h3")},{value:"heading4",label:"H4",icon:eQ("h4")},{value:"heading5",label:"H5",icon:eQ("h5")},{value:"heading6",label:"H6",icon:eQ("h6")},{value:"strong",label:"Strong",icon:eQ((0,l.jsx)("b",{children:"b"}))},{value:"em",label:"em",icon:eQ((0,l.jsx)("em",{style:{fontFamily:"serif"},children:"I"}))},{value:"hyperlink",label:"hyperlink",icon:eQ((0,l.jsx)(K.eR7,{}))},{value:"image",label:"image",icon:eQ((0,l.jsx)(K.LFN,{}))},{value:"embed",label:"embed",icon:eQ((0,l.jsx)(K.xqv,{}))},{value:"list-item",label:"list",icon:eQ((0,l.jsx)(K.SnF,{}))},{value:"o-list-item",label:"o",icon:eQ((0,l.jsx)(V.KyO,{}))},{value:"rtl",label:"rtl",icon:eQ("rtl")},],e2=e0.map(function(e){return e.value}),e1=function(e){return!e2.find(function(t){return!e.includes(t)})},e3=function(e){var t=e.split(",");return e0.reduce(function(e,n){var i=n.value;return t.includes(i)?(0,C.Z)(e).concat([i]):e},[])};function e4(e,t){return(0,eK.has)("parent",e)&&(0,eX.isObject)(e.parent)&&(0,eK.has)(t,e.parent)&&(0,eX.isString)(e.parent[t])?e.parent[t]:null}function e5(e){return function(){return d.string().test({name:e,message:"Options cannot be empty",test:function(t,n){var i=e4(n,e),r=e4(n,"single"===e?"multi":"single");return!!r&&"string"==typeof r||"string"==typeof i&&(!!i&&!!i.length||!!r&&!!r.length)&&!i.split(",").find(function(e){return!e2.includes(e)})}})}}var e8,e9=(0,s.Z)((0,o.Z)({},h.J),{allowTargetBlank:(0,v.Jg)("Allow target blank for links"),single:{validate:e5("single")},multi:{validate:e5("multi")}}),e6=["config.single","config.multi"],e7=function(e){var t,n=e.initialValues,i=e.values,r=e.errors,o=e.fields,a=e.setFieldValue,s=i.config,c=s.single,d=s.multi,h=c?e3(c):d&&e3(d)||e2,v=(0,k.useState)(!c),g=v[0],b=v[1],y=(0,k.useState)(h),j=y[0],Z=y[1];return(0,k.useEffect)(function(){var e=g?1:0;a(e6[e],j.join(",")),setTimeout(function(){a(e6[1-e],void 0)},100)},[g,j]),(0,l.jsxs)(p.k,{children:[Object.entries(e9).map(function(e){var t=(0,u.Z)(e,2),i=t[0],r=t[1];return(0,l.jsx)(p.J,{children:(0,l.jsx)(x.Z,{fieldName:(0,m.lm)(i),formField:r,fields:o,initialValues:n})},i)}),(0,l.jsxs)(p.J,{children:[(0,l.jsxs)(f.__,{htmlFor:"accept",variant:"label.primary",sx:{mt:1,display:"flex",alignItems:"center"},children:["Accept*",(0,l.jsx)(f.zx,{type:"button",variant:"buttons.textButton",onClick:function(){if(e1(j))return Z([]);Z(e2)},children:e1(j)?"Unselect All":"Select all"})]}),e0.map(function(e){return(0,l.jsx)(eZ.Z,{fitButton:!0,useActive:!0,label:e.label,size:14,Icon:e.icon,sx:{p:"16px",mb:2,mr:2,variant:"buttons.selectIcon"},active:j.includes(e.value),onClick:function(){if(j.find(function(t){return t===e.value}))return Z(j.filter(function(t){return t!==e.value}));Z((0,C.Z)(j).concat([e.value]))}},e.value)}),(null===(t=r.config)||void 0===t?void 0:t[g?"multi":"single"])?(0,l.jsx)(f.xu,{sx:{position:"absolute"},children:(0,l.jsx)(f.xv,{as:"span",variant:"text.labelError",pl:0,children:r.config[g?"multi":"single"]})}):null]}),(0,l.jsx)(p.J,{children:(0,l.jsx)(f.kC,{sx:{mt:2,alignItems:"center",height:"100%"},children:(0,l.jsxs)(f.__,{variant:"label.border",children:[(0,l.jsx)(f.XZ,{checked:g,onChange:function(){return b(!g)}}),"Allow multiple paragraphs"]})})})]})},te={icon:c.BAW,title:"Rich Text",description:"A rich text field with formatting options"},tt=d.object().shape({type:d.string().matches(/^StructuredText$/,{excludeEmptyString:!0}).required(),config:(0,m.gc)((0,R.B9)((0,o.Z)({},e9,{labels:{yupType:"array",validate:{}}}),"id"))}),tn=h.J,ti=d.object().shape({type:d.string().matches(/^Text$/,{excludeEmptyString:!0}).required(),config:(0,m.gc)((0,R.B9)(tn,"id"))}),tr={icon:c.SQS,title:"Key Text",description:"A simple text string field"},to=h.J,tl=d.object().shape({type:d.string().matches(/^Timestamp$/,{excludeEmptyString:!0}).required(),config:(0,m.gc)((0,R.B9)(to,"id"))}),ta={icon:c.f$3,title:"Timestamp",description:"A calendar date picker with time"},ts={label:h.J.label,id:(0,s.Z)((0,o.Z)({},h.J.id),{validate:{required:"This field is required",matches:[/^uid$/,"Api ID must be 'uid' for this field."]},disabled:!0}),placeholder:h.J.placeholder},tc=d.object().shape({type:d.string().matches(/^UID$/,{excludeEmptyString:!0}).required(),config:(0,m.gc)((0,R.B9)(ts,"id"))}),td={Boolean:{TYPE_NAME:"Boolean",create:function(e){return{type:"Boolean",config:{label:e,default_value:!1,placeholder_true:"true",placeholder_false:"false"}}},Meta:q,schema:D,FormFields:z},Color:{create:function(e){return{type:"Color",config:{label:e,placeholder:""}}},FormFields:G,TYPE_NAME:J,schema:W,Meta:P},ContentRelationship:{create:function(e){return{type:"Link",config:{label:e,select:"document"}}},Meta:el,schema:es,TYPE_NAME:"Link",FormFields:er,CUSTOM_NAME:"ContentRelationship",Form:eo,prepareInitialValues:function(e){var t=(0,U.v9)(Y.Ch).filter($.TG);return(null==e?void 0:e.customtypes)?(0,s.Z)((0,o.Z)({},e),{customtypes:e.customtypes.filter(function(e){return t.find(function(t){return t.local.id===e})})}):e}},Date:{create:function(e){return{type:"Date",config:{label:e,placeholder:""}}},FormFields:ed,TYPE_NAME:"Date",schema:eu,Meta:ef},Embed:{create:function(e){return{type:"Embed",config:{label:e,placeholder:""}}},FormFields:ex,TYPE_NAME:"Embed",schema:em,Meta:eh},GeoPoint:{create:function(e){return{type:"GeoPoint",config:{label:e}}},FormFields:ev,TYPE_NAME:"GeoPoint",schema:eg,Meta:eb},Image:{Meta:eM,Form:eA,schema:eN,create:function(e){return{type:"Image",config:{label:e,constraint:{},thumbnails:[]}}},FormFields:eF,TYPE_NAME:"Image"},Link:{Meta:ee,FormFields:X,schema:en,Form:Q,create:function(e){return{type:"Link",config:{label:e,placeholder:"",select:null}}},TYPE_NAME:"Link"},LinkToMedia:{Meta:eB,FormFields:eR,schema:eV,Form:eL,create:function(e){return{type:"Link",config:{label:e,placeholder:"",select:"media"}}},TYPE_NAME:"Link",CUSTOM_NAME:"LinkToMedia"},Number:{create:function(e){return{type:"Number",config:{label:e,placeholder:""}}},FormFields:eD,TYPE_NAME:"Number",schema:eP,Meta:eH},Select:{FormFields:eU,create:function(e){return{type:"Select",config:{label:e,placeholder:"",options:["1","2"]}}},schema:eY,Meta:e$,TYPE_NAME:"Select"},StructuredText:{create:function(e){return{type:"StructuredText",config:{label:e,placeholder:"",allowTargetBlank:!0,multi:e2.join(",")}}},FormFields:e9,Meta:te,schema:tt,TYPE_NAME:"StructuredText",Form:e7},Text:{create:function(e){return{type:"Text",config:{label:e,placeholder:""}}},Meta:tr,schema:ti,TYPE_NAME:"Text",FormFields:tn},Timestamp:{create:function(e){return{type:"Timestamp",config:{label:e,placeholder:""}}},schema:tl,FormFields:to,TYPE_NAME:"Timestamp",Meta:ta},UID:{create:function(e){return{type:"UID",config:{label:e,placeholder:""}}},Meta:{icon:c.izl,title:"UID",description:"Unique Identifier"},schema:tc,TYPE_NAME:"UID",FormFields:ts}},tu="NestedGroup",tf=[td.StructuredText,td.Image,td.Link,td.LinkToMedia,td.ContentRelationship,td.Select,td.Boolean,td.Date,td.Timestamp,td.Embed,td.Number,td.GeoPoint,td.Color,td.Text,],tp=j({schemaTypeRegex:/^NestedGroup$/,customListItem:function(e){return(0,l.jsx)(O,(0,o.Z)({Widgets:td,widgetsArray:tf,isNestedGroupItem:!0},e))},customName:tu}),tx=(0,s.Z)((0,o.Z)({},td),{NestedGroup:tp}),tm=[tx.NestedGroup,tx.StructuredText,tx.Image,tx.Link,tx.LinkToMedia,tx.ContentRelationship,tx.Select,tx.Boolean,tx.Date,tx.Timestamp,tx.Embed,tx.Number,tx.GeoPoint,tx.Color,tx.Text,],th=j({schemaTypeRegex:/^Group$/,customListItem:function(e){var t,n={eligible:(null==(t=(0,a.L)("slicemachine-nested-groups"))?void 0:t.value)==="on"}.eligible?tm:tm.filter(function(e){return"NestedGroup"!==e.CUSTOM_NAME});return(0,l.jsx)(O,(0,o.Z)({Widgets:tx,widgetsArray:n},e))}}),tv=(0,o.Z)({Group:th,NestedGroup:tp},td)},50535:function(e,t,n){"use strict";n.d(t,{B9:function(){return s},Ss:function(){return d},uS:function(){return c},zg:function(){return u}});var i=n(98240),r=n(9849),o=n(65413),l=n(86163),a=n(58428),s=function(e,t){return e[t],(0,i.Z)(e,[t].map(r.Z))},c=function(e){return!e.destination||e.source.index===e.destination.index||e.source.droppableId!==e.destination.droppableId},d=function(e,t){return!e[t]&&(console.log('Could not find widget with type name "'.concat(t,'".')),!0)},u=function(e){return{TYPE_NAME:e,FormFields:a.J,schema:o.object().shape({type:o.string().test({name:"type",test:function(t){return t===e}}),config:(0,l.gc)(s(a.J,"id"))}),create:function(){return{type:e,config:(0,l.f7)(s(a.J,"id"))}}}}},21112: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}})},41350:function(e){e.exports={flex:"List_flex__v0QQS",row:"List_row__sBVx1 List_flex__v0QQS",root:"List_root__f9klF List_flex__v0QQS","root-border":"List_root-border__2nh4p",child:"List_child__O_eM9 List_row__sBVx1 List_flex__v0QQS",header:"List_header__J5e8m List_child__O_eM9 List_row__sBVx1 List_flex__v0QQS",headerActions:"List_headerActions__FqUvW List_row__sBVx1 List_flex__v0QQS",item:"List_item__t5SQz List_child__O_eM9 List_row__sBVx1 List_flex__v0QQS"}},73539:function(e){e.exports={root:"ZoneEmptyState_root__K6dwt"}}}]);