slice-machine-ui 2.20.5-alpha.jp-import-slice-base.2 → 2.20.5-alpha.jp-import-slices-2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/out/404.html +1 -1
  2. package/out/_next/static/-Yjs5UmgvuB8nY3BLb3TK/_buildManifest.js +1 -0
  3. package/out/_next/static/chunks/21-f3962d02eda0a46e.js +1 -0
  4. package/out/_next/static/chunks/{248-84a5987f0499b074.js → 248-2902bda47821f37b.js} +1 -1
  5. package/out/_next/static/chunks/{630-2bf927bca082a191.js → 630-4fe1e982234bd925.js} +1 -1
  6. package/out/_next/static/chunks/633-2d20c3e815c79c7f.js +1 -0
  7. package/out/_next/static/chunks/{647-aa094286bc248d52.js → 647-a29bee23cb9ac7a2.js} +1 -1
  8. package/out/_next/static/chunks/660-e3d7a5444ab7391e.js +1 -0
  9. package/out/_next/static/chunks/6611d287.1714222015f895ea.js +28 -0
  10. package/out/_next/static/chunks/{882-48d61b2fabee28d8.js → 882-8ab59c0c72307c87.js} +1 -1
  11. package/out/_next/static/chunks/pages/{_app-651bb3e76e35a633.js → _app-89df34df01f52931.js} +217 -217
  12. package/out/_next/static/chunks/pages/{changelog-8514e0696e90a1b2.js → changelog-bc83e25e8d316ca9.js} +1 -1
  13. package/out/_next/static/chunks/pages/{changes-e66094f57453cf9c.js → changes-6f371ebe52dbe76a.js} +1 -1
  14. package/out/_next/static/chunks/pages/custom-types/{[customTypeId]-273e9a82c085b596.js → [customTypeId]-80defa14b6ea36f7.js} +1 -1
  15. package/out/_next/static/chunks/pages/{labs-56fd818a63553497.js → labs-16d118a80936d583.js} +1 -1
  16. package/out/_next/static/chunks/pages/page-types/{[pageTypeId]-3fa7667de1a790d9.js → [pageTypeId]-f4ff9ad74b44bf09.js} +1 -1
  17. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/{simulator-8c70298caf51bed0.js → simulator-873c0c89aaf50b3c.js} +1 -1
  18. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/{[variation]-22ffa2561ac66557.js → [variation]-0e9aa745ed9fe1ec.js} +1 -1
  19. package/out/_next/static/chunks/pages/slices-93fc784c443a996c.js +1 -0
  20. package/out/_next/static/chunks/{webpack-24ddb02bea621501.js → webpack-e986dd216b883a74.js} +1 -1
  21. package/out/_next/static/css/b30fbbc3ed00a725.css +1 -0
  22. package/out/changelog.html +1 -1
  23. package/out/changes.html +1 -1
  24. package/out/custom-types/[customTypeId].html +1 -1
  25. package/out/custom-types.html +1 -1
  26. package/out/index.html +1 -1
  27. package/out/labs.html +1 -1
  28. package/out/page-types/[pageTypeId].html +1 -1
  29. package/out/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
  30. package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
  31. package/out/slices.html +1 -1
  32. package/package.json +6 -6
  33. package/src/features/customTypes/customTypesBuilder/ImportSlicesFromLibraryModal/ImportSlicesFromLibraryModal.tsx +104 -285
  34. package/src/features/customTypes/customTypesBuilder/ImportSlicesFromLibraryModal/LibrarySlicesTab.tsx +125 -0
  35. package/src/features/customTypes/customTypesBuilder/ImportSlicesFromLibraryModal/LocalSlicesTab.tsx +67 -0
  36. package/src/features/customTypes/customTypesBuilder/ImportSlicesFromLibraryModal/ReuseExistingSlicesContext.tsx +279 -0
  37. package/src/features/customTypes/customTypesBuilder/ImportSlicesFromLibraryModal/hooks/useImportSlicesFromGithub.ts +7 -4
  38. package/src/features/customTypes/customTypesBuilder/SliceZoneBlankSlate.tsx +4 -18
  39. package/src/features/customTypes/customTypesBuilder/shared/getSubmitButtonLabel.ts +3 -5
  40. package/src/features/customTypes/customTypesBuilder/sliceCreationOptions.tsx +0 -14
  41. package/src/legacy/lib/builders/CustomTypeBuilder/SliceZone/UpdateSliceZoneModalList.tsx +1 -3
  42. package/src/legacy/lib/builders/CustomTypeBuilder/SliceZone/index.tsx +26 -79
  43. package/src/pages/slices.tsx +0 -30
  44. package/out/_next/static/CGK-vfrV6JByBnDLoS7iE/_buildManifest.js +0 -1
  45. package/out/_next/static/chunks/422-c7a16d95b75c9e1c.js +0 -1
  46. package/out/_next/static/chunks/489-c9535ef34da63d1a.js +0 -1
  47. package/out/_next/static/chunks/585-c89bb2471e85b9f8.js +0 -1
  48. package/out/_next/static/chunks/954-bedaaabf664584a0.js +0 -1
  49. package/out/_next/static/chunks/a6495ab1.00190ac98e794d8f.js +0 -28
  50. package/out/_next/static/chunks/pages/slices-76679cf064761d2b.js +0 -1
  51. package/out/_next/static/css/bc89f2cd4e4781f5.css +0 -1
  52. package/src/legacy/lib/builders/CustomTypeBuilder/SliceZone/UpdateSliceZoneModal.tsx +0 -72
  53. /package/out/_next/static/{CGK-vfrV6JByBnDLoS7iE → -Yjs5UmgvuB8nY3BLb3TK}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[647],{77630:function(e,t,n){n.d(t,{AK:function(){return v},E3:function(){return p},EN:function(){return f},F$:function(){return x},H8:function(){return C},HO:function(){return h},L4:function(){return g},N3:function(){return c},Tr:function(){return d},Ue:function(){return I},eK:function(){return S},gR:function(){return b},j5:function(){return a},mf:function(){return m},vB:function(){return y},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 s(e){return l(e).find(e=>{let[t,n]=e;return Object.values(n).some(e=>"UID"===e.type)})}function a(e){var t;let[n,r]=null!==(t=s(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}),s=r.flatMap(e=>{let[t,n]=e;return Object.keys(n).filter(e=>n[e].type===o.SlicesFieldType)}),a=i;do n="slices".concat(0!==a?a.toString():""),a++;while(s.includes(n));return n}(e,t);return{...e,json:{...e.json,[t]:{...e.json[t],[n]:{type:o.SlicesFieldType,fieldset:"Slice Zone"}}}}}function p(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:s}=e,a=i.json[l];if(void 0===a)return i;let c=Object.keys(a).find(e=>a[e].type===o.SlicesFieldType);if(void 0===c)return i;let u=a[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:{},s);return{...i,json:{...i.json,[l]:{...a,[c]:{...u,config:{...u.config,choices:d}}}}}}function m(e){let t={...e,format:"page"},n=l(e)[0];if(n){let[e]=n;t=d(t,e)}return t}function y(e,t){return{...e,json:{...e.json,[t]:{}}}}function x(e,t){let n=(0,r.ud)(e.json,t);return{...e,json:n}}function h(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],s=u(t,n),a={...Object.fromEntries(Object.entries(l).filter(e=>{let[t,n]=e;return n.type!==o.SlicesFieldType})),[i]:r};if(void 0!==s){let[e,t]=s;a[e]=t}return T({customType:t,sectionId:n,updatedSection:a})}function v(e){let{customType:t,sectionId:n,fieldId:o}=e,i=(0,r.ud)(t.json[n],o);return T({customType:t,sectionId:n,updatedSection:i})}function g(e){let{customType:t,sectionId:n,previousFieldId:r,newFieldId:o,newField:i}=e,l=w({fields:t.json[n],previousFieldId:r,newFieldId:o,newField:i});return T({customType:t,sectionId:n,updatedSection:l})}function b(e){let{customType:t,sectionId:n,sourceIndex:r,destinationIndex:i}=e,l=t.json[n],s=u(t,n),a=Object.fromEntries(Object.entries(l).filter(e=>{let[t,n]=e;return n.type!==o.SlicesFieldType})),c="page"===t.format&&t.repeatable,d=Object.fromEntries(Object.entries(a).filter(e=>{let[t,n]=e;return"UID"!==n.type})),p=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:c?d:a,sourceIndex:r,destinationIndex:i});if(void 0!==s){let[e,t]=s;p[e]=t}let f=Object.entries(p),m=Object.entries(a).find(e=>{let[t,n]=e;return"UID"===n.type});m&&f.unshift(m);let y=Object.fromEntries(f);return T({customType:t,sectionId:n,updatedSection:c?y:p})}function C(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 S(e,t){var n,r;let[o]=null!==(n=s(t))&&void 0!==n?n:[],[i,l]=null!==(r=a(t))&&void 0!==r?r:[];if(!l||void 0===i||void 0===o)return t;let c=w({fields:t.json[o],previousFieldId:i,newFieldId:i,newField:{...l,config:{...l.config,label:e}}});return T({customType:t,sectionId:o,updatedSection:c})}function T(e){let{customType:t,sectionId:n,updatedSection:r}=e;return{...t,json:{...t.json,[n]:r}}}function w(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?{...O,...R}:!1===r?k:"page"===o?{...N,...R}:F;return{format:o,id:t,json:i,label:n,repeatable:r,status:!0}}let k={Main:{}},O={Main:{slices:{config:{choices:{}},fieldset:"Slice Zone",type:"Slices"}}},F={Main:{uid:{type:"UID",config:{label:"UID"}}}},N={Main:{...F.Main,...O.Main}},R={"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"}}}},60867:function(e,t,n){n.d(t,{_:function(){return N}});var r=n(52322),o=n(11699),i=n(5632),l=n(2784),s=n(65186),a=n(59326),c=n(75289),u=n(88932),d=n(80148),p=n(98564);async function f(e){let{customType:t,onSuccess:n}=e,r=p.$[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 m=n(33986),y=n(30527),x=n(55862),h=n(54597);let j=e=>{var t;let{customType:n,format:o,onClose:i,onDeleteCustomTypeSuccess:u}=e,d=p.$[o],[j,v]=(0,l.useState)(!1),{deleteCustomTypeSuccess:g}=(0,h.Z)(),b=async()=>{v(!0),await f({customType:n,onSuccess:()=>g(n.id)}),u()},{theme:C}=(0,a.B7)();return(0,r.jsx)(x.Z,{isOpen:!0,shouldCloseOnOverlayClick:!0,style:{content:{maxWidth:612}},onRequestClose:()=>i(),children:(0,r.jsx)(y.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)(s.$vK,{size:20,color:null===(t=C.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)(m.z,{label:"Cancel",variant:"secondary",onClick:()=>i(),sx:{mr:"10px",fontWeight:"bold",color:"grey12",borderRadius:6}}),void 0!==n&&(0,r.jsx)(m.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=p.$[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(68968),C=n(78254),S=n(59532),T=n(46999);let w=e=>{var t,n;let{isChangesLocal:o,customType:i,format:s,onClose:a,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:m}=(0,h.Z)(),{syncChanges:y}=(0,b.g)(),[x,j]=(0,l.useState)(!1),w=async e=>{j(!0),o&&u?u({customType:{...i,label:e.customTypeName}}):await g({model:i,newLabel:e.customTypeName,onSuccess:e=>{m(e),y()}}),j(!1),a()},{customTypeLabels:I}=(0,v.v9)(e=>({customTypeLabels:(0,C.YS)(e)})),k=p.$[s];return(0,r.jsx)(S.Z,{isOpen:!0,testId:"rename-custom-type-modal",widthInPx:"530px",formId:"rename-custom-type-modal-".concat(f),buttonLabel:"Rename",close:a,onSubmit:e=>void w(e),initialValues:{customTypeName:d},isLoading:x,content:{title:"Rename a ".concat(k.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(k.name({start:!0,plural:!1})," name is already taken.")),["update","insert"].includes(t.toLowerCase())&&(n.customTypeName='Name "'.concat(t,'" is reserved for Slice Machine use.')),Object.keys(n).length>0?n:void 0},children:e=>{let{errors:t}=e;return(0,r.jsx)(c.xu,{children:(0,r.jsx)(T.W,{name:"customTypeName",label:"".concat(k.name({start:!0,plural:!1})," Name"),placeholder:"A display name for the ".concat(k.name({start:!1,plural:!1})),error:t.customTypeName,testId:"custom-type-name-input"})})}})};var I=n(94160),k=n(77630);async function O(e,t){let n=p.$[e.format];try{let r=(0,k.mf)(e),{errors:o}=await (0,I.KA)({customType: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 F=n(59294);let N=e=>{let{format:t,customType:n,isChangesLocal:s,setLocalCustomType:a}=e,c=(0,i.useRouter)(),{saveCustomTypeSuccess:u}=(0,h.Z)(),[d,p]=(0,l.useState)(!1),[f,m]=(0,l.useState)(!1),[y,x]=(0,l.useState)(!1),v=async()=>{x(!0),await O(n,u);let e=F.cd.custom.getBuilderPagePathname(n.id);if(c.asPath===e){let e=F.cd.page.getBuilderPagePathname(n.id);c.replace(e),x(!1)}else x(!1)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(o.ar,{children:[(0,r.jsx)(o.av,{disabled:y,children:(0,r.jsx)(o.aZ,{color:"grey","data-testid":"editDropdown",hiddenLabel:"Custom type actions",icon:"moreVert",loading:y,variant:"solid"})}),(0,r.jsxs)(o.as,{align:"end",children:[(0,r.jsx)(o.at,{startIcon:(0,r.jsx)(o.aX,{name:"edit"}),onSelect:()=>{m(!0)},children:"Rename"}),"custom"===t&&!s&&(0,r.jsx)(o.at,{startIcon:(0,r.jsx)(o.aX,{name:"driveFileMove"}),onSelect:()=>void v(),children:"Convert to page type"}),(0,r.jsx)(o.at,{color:"tomato",startIcon:(0,r.jsx)(o.aX,{name:"delete"}),onSelect:()=>{p(!0)},children:"Remove"})]})]}),d?(0,r.jsx)(j,{format:t,customType:n,onClose:()=>p(!1),onDeleteCustomTypeSuccess:()=>{var e;let{tablePagePathname:t}=F.cd[null!==(e=n.format)&&void 0!==e?e:"custom"];c.asPath!==t?c.replace(t):p(!1)}}):null,f?(0,r.jsx)(w,{format:t,customType:n,isChangesLocal:s,onClose:()=>m(!1),setLocalCustomType:a}):null]})}},50477:function(e,t,n){n.d(t,{NG:function(){return a},xU:function(){return l}});var r=n(18566),o=n(2784),i=n(80148);function l(e){let t=(0,o.useCallback)(t=>(0,r.VA)(s,[e],t),[e]);return{customTypes:(0,r.QT)(s,[e]),updateCustomTypes:t}}async function s(e){let{errors:t,models:n}=await i.managerClient.customTypes.readAllCustomTypes(e?{format:e}:void 0);if(t.length>0)throw t;return n.map(e=>{let{model:t}=e;return t})}function a(e){(0,r.gw)(s,[]),(0,r.gw)(s,[e])}},33986:function(e,t,n){n.d(t,{z:function(){return a}});var r=n(52322),o=n(2784),i=n(75289);let l=(e,t)=>e?"".concat(e,"-").concat(t):"",s=e=>{switch(e){case"white":case"secondaryMedium":case"secondarySmall":case"secondary":return"#1A1523";default:return"grey01"}},a=(0,o.forwardRef)((e,t)=>{let{label:n,Icon:o,type:a,form:c,isLoading:u=!1,disabled:d=!1,onClick:p,sx:f={},iconSize:m=16,iconFill:y,variant:x="primary",...h}=e;return(0,r.jsx)(i.zx,{ref:t,sx:{...f,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",...u?{cursor:"wait !important"}:{}},type:a,form:c,disabled:d||u,onClick:u?void 0:p,variant:x,...h,children:u?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.$j,{size:m,color:s(x),"data-testid":l(h["data-testid"],"spinner")}),o&&n]}):(0,r.jsxs)(r.Fragment,{children:[o&&(0,r.jsx)(o,{size:m,fill:y,"data-testid":l(h["data-testid"],"icon")}),n]})})})},46999:function(e,t,n){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:s,testId:a,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,...a?{"data-testid":a}:null}),s?(0,r.jsx)(i.xv,{"data-testid":a?"".concat(a,"-error"):"input-error",sx:{color:"error",mt:1},children:s}):null]})}},59532:function(e,t,n){var r=n(52322),o=n(63397),i=n(37149),l=n.n(i),s=n(75289),a=n(33986),c=n(55862),u=n(30527);function d(e){let{children:t}=e,n=(0,u.W)();return(0,r.jsx)(s.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:p,validate:f,onSubmit:m,widthInPx:y,initialValues:x,content:{title:h},cardProps:j,omitFooter:v=!1,isLoading:g=!1,buttonLabel:b="Save",testId:C,actionMessage:S}=e;return l().setAppElement("#__next"),(0,r.jsx)(c.Z,{isOpen:i,shouldCloseOnOverlayClick:!0,onRequestClose:n,contentLabel:h,style:{content:{width:null!=y?y:"900px"}},children:(0,r.jsx)(o.J9,{initialValues:x,validate:e=>f?f(e):void 0,onSubmit:e=>{m(e)},children:e=>{let{isValid:i,isSubmitting:l,values:c,errors:f,touched:m,setFieldValue:y,setValues:x}=e;return(0,r.jsx)(o.l0,{id:p,...null!=C?{"data-testid":C}: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)(s.X6,{sx:{fontSize:"20px"},children:h}),(0,r.jsx)(s.x8,{type:"button",onClick:n})]}),Footer:v?null:(0,r.jsxs)(s.kC,{sx:{alignItems:"space-between"},children:[(0,r.jsx)(s.kC,{sx:{fontSize:"14px",alignItems:"center"},children:"function"==typeof S?S(e):S}),(0,r.jsxs)(s.kC,{sx:{ml:"auto"},children:[(0,r.jsx)(s.zx,{mr:2,type:"button",onClick:n,variant:"secondary",disabled:l||g,children:"Cancel"}),(0,r.jsx)(a.z,{label:b,form:p,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:m,setFieldValue:y,setValues:x})})})}})})}}}]);
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[647],{77630:function(e,t,n){n.d(t,{AK:function(){return v},E3:function(){return p},EN:function(){return f},F$:function(){return x},H8:function(){return C},HO:function(){return h},L4:function(){return g},N3:function(){return c},Tr:function(){return d},Ue:function(){return I},eK:function(){return S},gR:function(){return b},j5:function(){return a},mf:function(){return m},vB:function(){return y},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 s(e){return l(e).find(e=>{let[t,n]=e;return Object.values(n).some(e=>"UID"===e.type)})}function a(e){var t;let[n,r]=null!==(t=s(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}),s=r.flatMap(e=>{let[t,n]=e;return Object.keys(n).filter(e=>n[e].type===o.SlicesFieldType)}),a=i;do n="slices".concat(0!==a?a.toString():""),a++;while(s.includes(n));return n}(e,t);return{...e,json:{...e.json,[t]:{...e.json[t],[n]:{type:o.SlicesFieldType,fieldset:"Slice Zone"}}}}}function p(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:s}=e,a=i.json[l];if(void 0===a)return i;let c=Object.keys(a).find(e=>a[e].type===o.SlicesFieldType);if(void 0===c)return i;let u=a[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:{},s);return{...i,json:{...i.json,[l]:{...a,[c]:{...u,config:{...u.config,choices:d}}}}}}function m(e){let t={...e,format:"page"},n=l(e)[0];if(n){let[e]=n;t=d(t,e)}return t}function y(e,t){return{...e,json:{...e.json,[t]:{}}}}function x(e,t){let n=(0,r.ud)(e.json,t);return{...e,json:n}}function h(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],s=u(t,n),a={...Object.fromEntries(Object.entries(l).filter(e=>{let[t,n]=e;return n.type!==o.SlicesFieldType})),[i]:r};if(void 0!==s){let[e,t]=s;a[e]=t}return T({customType:t,sectionId:n,updatedSection:a})}function v(e){let{customType:t,sectionId:n,fieldId:o}=e,i=(0,r.ud)(t.json[n],o);return T({customType:t,sectionId:n,updatedSection:i})}function g(e){let{customType:t,sectionId:n,previousFieldId:r,newFieldId:o,newField:i}=e,l=w({fields:t.json[n],previousFieldId:r,newFieldId:o,newField:i});return T({customType:t,sectionId:n,updatedSection:l})}function b(e){let{customType:t,sectionId:n,sourceIndex:r,destinationIndex:i}=e,l=t.json[n],s=u(t,n),a=Object.fromEntries(Object.entries(l).filter(e=>{let[t,n]=e;return n.type!==o.SlicesFieldType})),c="page"===t.format&&t.repeatable,d=Object.fromEntries(Object.entries(a).filter(e=>{let[t,n]=e;return"UID"!==n.type})),p=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:c?d:a,sourceIndex:r,destinationIndex:i});if(void 0!==s){let[e,t]=s;p[e]=t}let f=Object.entries(p),m=Object.entries(a).find(e=>{let[t,n]=e;return"UID"===n.type});m&&f.unshift(m);let y=Object.fromEntries(f);return T({customType:t,sectionId:n,updatedSection:c?y:p})}function C(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 S(e,t){var n,r;let[o]=null!==(n=s(t))&&void 0!==n?n:[],[i,l]=null!==(r=a(t))&&void 0!==r?r:[];if(!l||void 0===i||void 0===o)return t;let c=w({fields:t.json[o],previousFieldId:i,newFieldId:i,newField:{...l,config:{...l.config,label:e}}});return T({customType:t,sectionId:o,updatedSection:c})}function T(e){let{customType:t,sectionId:n,updatedSection:r}=e;return{...t,json:{...t.json,[n]:r}}}function w(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?{...O,...R}:!1===r?k:"page"===o?{...N,...R}:F;return{format:o,id:t,json:i,label:n,repeatable:r,status:!0}}let k={Main:{}},O={Main:{slices:{config:{choices:{}},fieldset:"Slice Zone",type:"Slices"}}},F={Main:{uid:{type:"UID",config:{label:"UID"}}}},N={Main:{...F.Main,...O.Main}},R={"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"}}}},60867:function(e,t,n){n.d(t,{_:function(){return N}});var r=n(52322),o=n(18337),i=n(5632),l=n(2784),s=n(65186),a=n(59326),c=n(75289),u=n(88932),d=n(80148),p=n(98564);async function f(e){let{customType:t,onSuccess:n}=e,r=p.$[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 m=n(33986),y=n(30527),x=n(55862),h=n(54597);let j=e=>{var t;let{customType:n,format:o,onClose:i,onDeleteCustomTypeSuccess:u}=e,d=p.$[o],[j,v]=(0,l.useState)(!1),{deleteCustomTypeSuccess:g}=(0,h.Z)(),b=async()=>{v(!0),await f({customType:n,onSuccess:()=>g(n.id)}),u()},{theme:C}=(0,a.B7)();return(0,r.jsx)(x.Z,{isOpen:!0,shouldCloseOnOverlayClick:!0,style:{content:{maxWidth:612}},onRequestClose:()=>i(),children:(0,r.jsx)(y.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)(s.$vK,{size:20,color:null===(t=C.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)(m.z,{label:"Cancel",variant:"secondary",onClick:()=>i(),sx:{mr:"10px",fontWeight:"bold",color:"grey12",borderRadius:6}}),void 0!==n&&(0,r.jsx)(m.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=p.$[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(68968),C=n(78254),S=n(59532),T=n(46999);let w=e=>{var t,n;let{isChangesLocal:o,customType:i,format:s,onClose:a,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:m}=(0,h.Z)(),{syncChanges:y}=(0,b.g)(),[x,j]=(0,l.useState)(!1),w=async e=>{j(!0),o&&u?u({customType:{...i,label:e.customTypeName}}):await g({model:i,newLabel:e.customTypeName,onSuccess:e=>{m(e),y()}}),j(!1),a()},{customTypeLabels:I}=(0,v.v9)(e=>({customTypeLabels:(0,C.YS)(e)})),k=p.$[s];return(0,r.jsx)(S.Z,{isOpen:!0,testId:"rename-custom-type-modal",widthInPx:"530px",formId:"rename-custom-type-modal-".concat(f),buttonLabel:"Rename",close:a,onSubmit:e=>void w(e),initialValues:{customTypeName:d},isLoading:x,content:{title:"Rename a ".concat(k.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(k.name({start:!0,plural:!1})," name is already taken.")),["update","insert"].includes(t.toLowerCase())&&(n.customTypeName='Name "'.concat(t,'" is reserved for Slice Machine use.')),Object.keys(n).length>0?n:void 0},children:e=>{let{errors:t}=e;return(0,r.jsx)(c.xu,{children:(0,r.jsx)(T.W,{name:"customTypeName",label:"".concat(k.name({start:!0,plural:!1})," Name"),placeholder:"A display name for the ".concat(k.name({start:!1,plural:!1})),error:t.customTypeName,testId:"custom-type-name-input"})})}})};var I=n(94160),k=n(77630);async function O(e,t){let n=p.$[e.format];try{let r=(0,k.mf)(e),{errors:o}=await (0,I.KA)({customType: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 F=n(59294);let N=e=>{let{format:t,customType:n,isChangesLocal:s,setLocalCustomType:a}=e,c=(0,i.useRouter)(),{saveCustomTypeSuccess:u}=(0,h.Z)(),[d,p]=(0,l.useState)(!1),[f,m]=(0,l.useState)(!1),[y,x]=(0,l.useState)(!1),v=async()=>{x(!0),await O(n,u);let e=F.cd.custom.getBuilderPagePathname(n.id);if(c.asPath===e){let e=F.cd.page.getBuilderPagePathname(n.id);c.replace(e),x(!1)}else x(!1)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(o.ar,{children:[(0,r.jsx)(o.av,{disabled:y,children:(0,r.jsx)(o.aZ,{color:"grey","data-testid":"editDropdown",hiddenLabel:"Custom type actions",icon:"moreVert",loading:y,variant:"solid"})}),(0,r.jsxs)(o.as,{align:"end",children:[(0,r.jsx)(o.at,{startIcon:(0,r.jsx)(o.aX,{name:"edit"}),onSelect:()=>{m(!0)},children:"Rename"}),"custom"===t&&!s&&(0,r.jsx)(o.at,{startIcon:(0,r.jsx)(o.aX,{name:"driveFileMove"}),onSelect:()=>void v(),children:"Convert to page type"}),(0,r.jsx)(o.at,{color:"tomato",startIcon:(0,r.jsx)(o.aX,{name:"delete"}),onSelect:()=>{p(!0)},children:"Remove"})]})]}),d?(0,r.jsx)(j,{format:t,customType:n,onClose:()=>p(!1),onDeleteCustomTypeSuccess:()=>{var e;let{tablePagePathname:t}=F.cd[null!==(e=n.format)&&void 0!==e?e:"custom"];c.asPath!==t?c.replace(t):p(!1)}}):null,f?(0,r.jsx)(w,{format:t,customType:n,isChangesLocal:s,onClose:()=>m(!1),setLocalCustomType:a}):null]})}},50477:function(e,t,n){n.d(t,{NG:function(){return a},xU:function(){return l}});var r=n(18566),o=n(2784),i=n(80148);function l(e){let t=(0,o.useCallback)(t=>(0,r.VA)(s,[e],t),[e]);return{customTypes:(0,r.QT)(s,[e]),updateCustomTypes:t}}async function s(e){let{errors:t,models:n}=await i.managerClient.customTypes.readAllCustomTypes(e?{format:e}:void 0);if(t.length>0)throw t;return n.map(e=>{let{model:t}=e;return t})}function a(e){(0,r.gw)(s,[]),(0,r.gw)(s,[e])}},33986:function(e,t,n){n.d(t,{z:function(){return a}});var r=n(52322),o=n(2784),i=n(75289);let l=(e,t)=>e?"".concat(e,"-").concat(t):"",s=e=>{switch(e){case"white":case"secondaryMedium":case"secondarySmall":case"secondary":return"#1A1523";default:return"grey01"}},a=(0,o.forwardRef)((e,t)=>{let{label:n,Icon:o,type:a,form:c,isLoading:u=!1,disabled:d=!1,onClick:p,sx:f={},iconSize:m=16,iconFill:y,variant:x="primary",...h}=e;return(0,r.jsx)(i.zx,{ref:t,sx:{...f,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",...u?{cursor:"wait !important"}:{}},type:a,form:c,disabled:d||u,onClick:u?void 0:p,variant:x,...h,children:u?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.$j,{size:m,color:s(x),"data-testid":l(h["data-testid"],"spinner")}),o&&n]}):(0,r.jsxs)(r.Fragment,{children:[o&&(0,r.jsx)(o,{size:m,fill:y,"data-testid":l(h["data-testid"],"icon")}),n]})})})},46999:function(e,t,n){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:s,testId:a,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,...a?{"data-testid":a}:null}),s?(0,r.jsx)(i.xv,{"data-testid":a?"".concat(a,"-error"):"input-error",sx:{color:"error",mt:1},children:s}):null]})}},59532:function(e,t,n){var r=n(52322),o=n(63397),i=n(37149),l=n.n(i),s=n(75289),a=n(33986),c=n(55862),u=n(30527);function d(e){let{children:t}=e,n=(0,u.W)();return(0,r.jsx)(s.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:p,validate:f,onSubmit:m,widthInPx:y,initialValues:x,content:{title:h},cardProps:j,omitFooter:v=!1,isLoading:g=!1,buttonLabel:b="Save",testId:C,actionMessage:S}=e;return l().setAppElement("#__next"),(0,r.jsx)(c.Z,{isOpen:i,shouldCloseOnOverlayClick:!0,onRequestClose:n,contentLabel:h,style:{content:{width:null!=y?y:"900px"}},children:(0,r.jsx)(o.J9,{initialValues:x,validate:e=>f?f(e):void 0,onSubmit:e=>{m(e)},children:e=>{let{isValid:i,isSubmitting:l,values:c,errors:f,touched:m,setFieldValue:y,setValues:x}=e;return(0,r.jsx)(o.l0,{id:p,...null!=C?{"data-testid":C}: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)(s.X6,{sx:{fontSize:"20px"},children:h}),(0,r.jsx)(s.x8,{type:"button",onClick:n})]}),Footer:v?null:(0,r.jsxs)(s.kC,{sx:{alignItems:"space-between"},children:[(0,r.jsx)(s.kC,{sx:{fontSize:"14px",alignItems:"center"},children:"function"==typeof S?S(e):S}),(0,r.jsxs)(s.kC,{sx:{ml:"auto"},children:[(0,r.jsx)(s.zx,{mr:2,type:"button",onClick:n,variant:"secondary",disabled:l||g,children:"Cancel"}),(0,r.jsx)(a.z,{label:b,form:p,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:m,setFieldValue:y,setValues:x})})})}})})}}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[660],{10660:function(e,t,n){"use strict";n.d(t,{H:function(){return tu}});var i=n(52322),a=n(18337),o=n(97729),l=n.n(o),r=n(5632),s=n(2784),c=n(56580),d=n(43388),m=n(77630),h=n(23094),u=n(59294),p=n(58446),f=n(74217),g=n(94160),x=n(68968),b=n(23710),y=n(54597),v=n(98564);let j=(0,s.createContext)(void 0);function S(e){let{children:t,initialCustomType:n}=e,[a,o]=(0,s.useState)(n),l=(0,m.y6)(a),r=v.$[l],{actionQueueStatus:c,setNextAction:d}=(0,b.c)({errorMessage:r.autoSaveFailed}),{refreshState:h}=(0,y.Z)(),u=(0,f.R9)(h),{syncChanges:p}=(0,x.g)(),S=(0,s.useCallback)(e=>{let{customType:t,onSaveCallback:n,updateMeta:i}=e;o(t),d(async()=>{let{errors:e}=await (0,g.KA)({customType:t,updateMeta:i});if(e.length>0)throw e;u(await (0,g.y0)()),p(),null==n||n()})},[d,u,p]),w=(0,s.useMemo)(()=>({actionQueueStatus:c,customType:a,setCustomType:S}),[c,a,S]);return(0,i.jsx)(j.Provider,{value:w,children:"function"==typeof t?t(w):t})}function w(){let e=(0,s.useContext)(j);if(!e)throw Error("CustomTypeProvider not found");return e}var C=n(30195);function I(){var e;let[t,n]=(0,s.useState)(!1),{customType:o,setCustomType:l}=w(),[r,c]=null!==(e=(0,m.j5)(o))&&void 0!==e?e:[],d=c?(0,m.N3)(c):"",[h,u]=(0,s.useState)(null!=d?d:""),[p,g]=(0,s.useState)();(0,f.pQ)(t,()=>{t||(u(null!=d?d:""),g(void 0))});let x=(0,s.useCallback)(()=>(0,i.jsx)(a.aX,{name:c?"language":"add",size:"small",color:"grey11"}),[c]);return(0,i.jsxs)(a.ae,{open:t,onOpenChange:n,size:"small",trigger:(0,i.jsx)(a.E,{color:"grey",textColor:"placeholder",textWeight:"normal",renderStartIcon:x,sx:{marginInline:"auto"},children:c?d:"Add an UID"}),children:[(0,i.jsx)(a.al,{title:"Edit the UID label"}),(0,i.jsx)(a.aj,{children:(0,i.jsxs)(a.aJ,{onSubmit:function(){p||(l({customType:c?(0,m.eK)(h,o):(0,m.H8)(h,o)}),n(!1))},children:[(0,i.jsx)(a.D,{flexDirection:"column",padding:16,gap:4,children:(0,i.jsx)(a.aM,{type:"text",label:"Label *",placeholder:"UID",value:h,onValueChange:function(e){u(e),g(function(e){let t=D.safeParse(e,{errorMap:k});if(t.error)return t.error.errors[0].message}(e))},error:p,description:"A label for the UID"})}),(0,i.jsxs)(a.ah,{children:[(0,i.jsx)(a.ai,{size:"medium"}),(0,i.jsx)(a.af,{type:"submit",size:"medium",disabled:!!p,children:"Save"})]})]})})]})}let D=C.z.string().max(35).min(1),k=e=>{switch(e.code){case C.z.ZodIssueCode.too_big:return{message:"The label can't be longer than ".concat(e.maximum," characters")};case C.z.ZodIssueCode.too_small:return{message:"This field is required"};default:return{message:"Invalid value"}}};var T=n(94840),_=n(59532),A=n(63397),E=n(75289);let L=e=>{let{name:t,label:n,placeholder:a,error:o,...l}=e;return(0,i.jsxs)(E.xu,{mb:3,children:[(0,i.jsx)(E.__,{htmlFor:t,mb:2,children:n}),(0,i.jsx)(A.gN,{name:t,type:"text",placeholder:a,as:E.II,autoComplete:"off",...l}),o?(0,i.jsx)(E.xv,{sx:{color:"error",mt:1},children:o}):null]})};var z=e=>{let{isOpen:t,onSubmit:n,close:a,tabIds:o}=e;return(0,i.jsx)(_.Z,{isOpen:t,widthInPx:"530px",formId:"create-tab",close:a,onSubmit:e=>{n(e),a()},initialValues:{id:""},validate:e=>{let{id:t}=e;return t?o.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)(L,{name:"id",label:"New Tab ID",placeholder:"A label for selecting the tab (i.e. not used in the API)",error:t.id})}})},N=e=>{let{isOpen:t,onSubmit:n,close:a}=e;return(0,i.jsx)(_.Z,{omitFooter:!0,isOpen:t,widthInPx:"530px",formId:"create-tab",close:a,cardProps:{bodySx:{p:0}},onSubmit:e=>{n(e),a()},initialValues:{},content:{title:"Remove Tab"},children:()=>(0,i.jsxs)(E.xu,{sx:{px:4,py:4},children:[(0,i.jsx)(E.X6,{as:"h4",children:"Remove this tab?"}),(0,i.jsx)(E.xv,{as:"p",color:"textClear",sx:{mt:2},children:"This action cannot be undone."}),(0,i.jsx)(E.zx,{type:"button",variant:"buttons.actionDelete",sx:{mt:3},onClick:()=>{n({}),a()},children:"Yes, remove tab"})]})})},P=e=>{let{isOpen:t,onSubmit:n,close:a,tabIds:o,initialTabKey:l}=e;return(0,i.jsx)(_.Z,{omitFooter:!0,isOpen:t,widthInPx:"530px",formId:"create-tab",close:a,cardProps:{bodySx:{p:0}},onSubmit:e=>{n(e),a()},initialValues:{id:l},validate:e=>{let{id:t}=e;return t?o.includes(t.toLowerCase())?{id:"Tab exists already"}:void 0:{id:"Tab ID is required"}},content:{title:"Rename Tab"},children:e=>{let{errors:t,values:o,setFieldValue:l,isValid:r}=e;return(0,i.jsxs)(E.xu,{sx:{px:4,py:4},children:[(0,i.jsx)(L,{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=>{o.id!==e.target.value&&l("id",e.target.value.trim())},onChange:e=>{l("id",e.target.value)}}),(0,i.jsx)(E.zx,{type:"button",sx:{mt:3,width:"100%"},disabled:!r,onClick:()=>{o.id&&o.id.length&&n({id:o.id.trim()}),a()},children:"Save"})]})}})},M=n(28316),F=n(88932),O=n(35289),U=n(87446),Z=n(45440),G=n(16086),B=n(358),R=n(5495),H=n(39302),K=n(3285),V=n(40141),X=n(65077),q=n(21446);let W=(e,t)=>{switch(e){case"custom_type":case"page_type":return"Add to ".concat(t)}};var Y=n(80148),$=n(74686),J=n(88866);async function Q(e,t,n){let i=Array(e.length),a=0,o=Array(Math.min(t,e.length)).fill(null).map(async()=>{for(;;){let t=a++;if(t>=e.length)break;i[t]=await n(e[t],t)}});return await Promise.all(o),i}class ee{getHeaders(){let e={Accept:"application/vnd.github.v3+json"};return void 0!==this.token&&(e.Authorization="Bearer ".concat(this.token)),e}async request(e,t){let n="".concat(this.baseUrl).concat(e),i=await fetch(n,{...t,headers:{...this.getHeaders(),...null==t?void 0:t.headers}});if(!i.ok)throw Error("GitHub API request failed: ".concat(i.status," ").concat(i.statusText));return i.json()}async getDefaultBranch(){let e=await this.request("/repos/".concat(this.owner,"/").concat(this.repo));return C.z.object({default_branch:C.z.string()}).parse(e).default_branch}async getFileContents(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=await this.request("/repos/".concat(this.owner,"/").concat(this.repo,"/contents/").concat(e,"?ref=").concat(t)),a=C.z.object({content:C.z.string(),encoding:C.z.string()}).parse(i);if("base64"!==a.encoding)throw Error("Unexpected encoding for ".concat(e,": ").concat(a.encoding));let o=atob(a.content.replace(/\s/g,""));if(!n)return o;{let e=new Uint8Array(o.length);for(let t=0;t<o.length;t++)e[t]=o.charCodeAt(t);return e.buffer}}async getDirectoryContents(e){let t=await this.request("/repos/".concat(this.owner,"/").concat(this.repo,"/contents/").concat(e));return C.z.array(C.z.object({name:C.z.string(),type:C.z.string(),path:C.z.string()})).parse(t)}async searchCode(e){let{path:t,filename:n}=e,i=[];void 0!==t&&i.push("path:".concat(t)),void 0!==n&&i.push("filename:".concat(n)),i.push("repo:".concat(this.owner,"/").concat(this.repo));let a="/search/code?q=".concat(encodeURIComponent(i.join(" "))),o=await this.request(a);return C.z.object({items:C.z.array(C.z.object({path:C.z.string(),name:C.z.string()})).optional(),total_count:C.z.number().optional()}).parse(o)}async getSliceLibraries(e){let t=await this.request("/repos/".concat(this.owner,"/").concat(this.repo,"/contents/slicemachine.config.json?ref=").concat(e)),n=C.z.object({content:C.z.string().optional(),encoding:C.z.string().optional()}).parse(t);if("string"==typeof n.content){let e=atob(n.content.replace(/\s/g,""));return C.z.object({libraries:C.z.array(C.z.string())}).parse(JSON.parse(e)).libraries}throw Error("No content found in slicemachine.config.json")}constructor(e){this.baseUrl="https://api.github.com",this.owner=e.owner,this.repo=e.repo,this.token=e.token}}let et=e=>{let t=e.match(/github\.com\/([^\/]+)\/([^\/]+)(?:\/|$)/);if(!t)throw Error("Invalid GitHub URL format");let[,n,i]=t;return{owner:n,repo:i.replace(/\.git$/,"")}},en=async e=>{let{owner:t,repo:n}=e;return new ee({owner:t,repo:n}).getDefaultBranch()},ei=async e=>{let{owner:t,repo:n,branch:i}=e;return new ee({owner:t,repo:n}).getSliceLibraries(i)},ea=async e=>{let{owner:t,repo:n,branch:i,libraries:a}=e,o=new ee({owner:t,repo:n}),l=[];for(let e of(console.log("Fetching slices from ".concat(a.length," library/libraries:"),a),a)){let t=e.replace(/^\.\//,""),n=[],a=!1;try{n=(await o.getDirectoryContents(t)).filter(e=>"dir"===e.type).map(e=>({name:e.name,path:e.path}))}catch(n){a=!0;let t=n instanceof Error?n.message:String(n);t.includes("403")?console.warn("GitHub API returned 403 for ".concat(e,", trying direct discovery...")):console.warn("GitHub API error for ".concat(e,", trying direct discovery..."),t)}if(a&&0===n.length){console.log("Attempting to discover slices using GitHub Search API for ".concat(e,"..."));try{let i=await o.searchCode({path:t,filename:"model.json"});if(i.items&&i.items.length>0){let a=new Set;for(let e of i.items){let t=e.path.split("/");if(t.length>=2){let e=t[t.length-2];e&&!a.has(e)&&a.add(e)}}n=Array.from(a).map(e=>({name:e,path:"".concat(t,"/").concat(e)})),console.log("Discovered ".concat(n.length," slice(s) via GitHub Search API for library ").concat(e))}else console.warn("GitHub Search API found no model.json files in ".concat(e))}catch(n){let t=n instanceof Error?n.message:String(n);t.includes("403")?console.warn("GitHub Search API also returned 403. Cannot discover slices without API access."):console.warn("Error using GitHub Search API for ".concat(e,":"),t)}}if(0===n.length){console.warn("No slices found in library ".concat(e,". The repository may be private or require authentication."));continue}console.log("Processing ".concat(n.length," slice(s) in library ").concat(e));let r=async e=>{try{let t,n,a,r;let s=await o.getFileContents("".concat(e.path,"/model.json"),i,!1);if("string"!=typeof s){console.warn("Failed to fetch model.json for slice: ".concat(e.name," - unexpected content type"));return}let c=J.SharedSlice.decode(JSON.parse(s));if("Left"===c._tag){console.warn("Failed to decode model.json for slice: ".concat(e.name));return}let d=c.right,m=[];try{m=await eo({api:o,branch:i,directoryPath:e.path}),console.log("Fetched ".concat(m.length," file(s) for slice ").concat(e.name,":"),m.map(e=>"".concat(e.path).concat(e.isBinary?" (binary)":"")))}catch(t){console.warn("Failed to fetch files for slice ".concat(e.name,":"),t instanceof Error?t.message:String(t))}for(let i of m)if(void 0===t&&i.path.match(/^index\.(tsx?|jsx?|vue|svelte)$/)&&"string"==typeof i.contents&&(t=i.contents),"mocks.json"===i.path&&"string"==typeof i.contents)try{let t=$.SharedSliceContent.decode(JSON.parse(i.contents));if("Left"===t._tag)console.warn("Failed to decode mocks.json for slice: ".concat(e.name));else{let e=t.right;Array.isArray(e)&&e.length>0&&(n=e)}}catch(t){console.warn("Failed to decode mocks.json for slice: ".concat(e.name))}let h={};void 0!==d.variations&&d.variations.length>0&&(await Promise.allSettled(d.variations.map(async t=>{try{let n="".concat(e.path,"/screenshot-").concat(t.id,".png"),l=await o.getFileContents(n,i,!0);if(l instanceof ArrayBuffer){let e=new Blob([l],{type:"image/png"}),n=new File([e],"screenshot-".concat(t.id,".png"),{type:"image/png"});h[t.id]=n,void 0===a&&void 0!==d.variations[0]&&t.id===d.variations[0].id&&(a=URL.createObjectURL(e),r=n)}}catch(e){console.warn("Failed to fetch screenshot for variation ".concat(t.id,":"),e instanceof Error?e.message:String(e))}}))).forEach((e,t)=>{if("rejected"===e.status){var n;console.warn("Failed to fetch screenshot for variation ".concat(null===(n=d.variations[t])||void 0===n?void 0:n.id,":"),e.reason instanceof Error?e.reason.message:String(e.reason))}});let u=null!=r?r:new File([],"".concat(d.name,".json"),{type:"application/json"}),p={image:u,thumbnailUrl:null!=a?a:URL.createObjectURL(u),model:d,files:m,componentContents:t,mocks:n,screenshots:Object.keys(h).length>0?h:void 0};l.push(p)}catch(t){console.warn("Error fetching slice ".concat(e.name,":"),t instanceof Error?t.message:String(t))}};await Q(n,6,r)}return l},eo=async e=>{let{api:t,branch:n,directoryPath:i}=e,a=[],o=!1;try{let e=await t.getDirectoryContents(i);o=!0;let l=e.filter(e=>"file"===e.type),r=e.filter(e=>"dir"===e.type);for(let e of(await Q(l,8,async e=>{if("model.json"===e.name)return null;try{let i=[".png",".jpg",".jpeg",".gif",".svg",".ico",".webp"].some(t=>e.name.toLowerCase().endsWith(t)),a=await t.getFileContents(e.path,n,i);return{path:e.name,contents:a,isBinary:i}}catch(t){return console.warn("Failed to fetch file ".concat(e.path,":"),t instanceof Error?t.message:String(t)),null}})))e&&a.push(e);for(let e of r)for(let i of(await eo({api:t,branch:n,directoryPath:e.path})))a.push({...i,path:"".concat(e.name,"/").concat(i.path)})}catch(e){console.warn("GitHub API failed for directory ".concat(i,", trying Search API..."),e instanceof Error?e.message:String(e))}if(!o)try{console.log("Using GitHub Search API to find all files in ".concat(i,"..."));let e=await t.searchCode({path:i});if(e.items&&e.items.length>0){for(let o of(console.log("Found ".concat(e.items.length," file(s) via Search API for ").concat(i)),await Q(e.items,8,async e=>{try{if("model.json"===e.name)return null;let a=e.path.startsWith(i+"/")?e.path.slice(i.length+1):e.name,o=[".png",".jpg",".jpeg",".gif",".svg",".ico",".webp",".woff",".woff2",".ttf",".eot",".otf",".pdf",".zip",".gz"].some(t=>e.name.toLowerCase().endsWith(t)),l=await t.getFileContents(e.path,n,o);return{path:a,contents:l,isBinary:o}}catch(t){return console.warn("Error fetching file ".concat(e.path,":"),t instanceof Error?t.message:String(t)),null}})))o&&a.push(o);console.log("Fetched ".concat(a.length," file(s) from ").concat(i," via Search API"))}else console.warn("GitHub Search API found no files in ".concat(i))}catch(t){let e=t instanceof Error?t.message:String(t);e.includes("403")?console.warn("GitHub Search API returned 403 for ".concat(i,". Cannot fetch files without API access.")):console.warn("Error using GitHub Search API for ".concat(i,":"),e)}return a};function el(){let[e,t]=(0,s.useState)(!1),[n,i]=(0,s.useState)([]);return{isLoadingSlices:e,slices:n,resetSlices:()=>{i([]),t(!1)},handleImportFromGithub:async e=>{try{let n;t(!0);let{owner:a,repo:o}=et(e);if(!a||!o)throw F.Am.error("Invalid GitHub URL format"),t(!1),Error("Invalid GitHub URL format");let l=await en({owner:a,repo:o});try{n=await ei({owner:a,repo:o,branch:l})}catch(e){throw console.error("Failed to fetch slicemachine.config.json:",e),F.Am.error("Failed to fetch slicemachine.config.json: ".concat(e instanceof Error?e.message:"Unknown error")),t(!1),e}if(0===n.length)throw console.warn("No libraries were found in the SM config."),t(!1),F.Am.error("No libraries were found in the SM config."),Error("No libraries were found in the SM config.");let r=await ea({owner:a,repo:o,branch:l,libraries:n});if(0===r.length)throw F.Am.error("Error fetching slices from the repository"),t(!1),Error("No slices were found in the libraries.");return i(r),t(!1),F.Am.success("Found ".concat(r.length," slice(s) from ").concat(n.length," library/libraries")),r}catch(e){return console.error("Error importing from GitHub:",e),F.Am.error("Error importing from GitHub: ".concat(e instanceof Error?e.message:"Unknown error")),t(!1),[]}}}}var er=n(98250);async function es(e){let{libraries:t=[]}=await Y.managerClient.project.getSliceMachineConfig(),n=t[0];if(!n)throw Error("No library found in the config.");await Q(e,3,async e=>{let{errors:t}=await Y.managerClient.slices.createSlice({libraryID:n,model:e.model,componentContents:e.componentContents});if(t.length)throw Error("Failed to create slice ".concat(e.model.id,"."))});let i=await Q(e,3,async e=>{let{model:t,image:i,langSmithUrl:a,mocks:o,files:l,screenshots:r}=e;if(o&&Array.isArray(o)&&o.length>0){let{errors:e}=await Y.managerClient.slices.updateSliceMocks({libraryID:n,sliceID:t.id,mocks:o});e.length&&console.warn("Failed to update mocks for slice ".concat(t.id,":"),e)}return r&&Object.keys(r).length>0?await Promise.all(Object.entries(r).map(async e=>{let[i,a]=e;a.size>0&&await Y.managerClient.slices.updateSliceScreenshot({libraryID:n,sliceID:t.id,variationID:i,data:a})})):i.size>0&&void 0!==t.variations&&t.variations.length>0&&await Y.managerClient.slices.updateSliceScreenshot({libraryID:n,sliceID:t.id,variationID:t.variations[0].id,data:i}),console.log("About to write files for slice ".concat(t.id,":"),l?"".concat(l.length," file(s) - ").concat(l.map(e=>e.path).join(", ")):"no files"),l&&l.length>0?await ec({libraryID:n,sliceID:t.id,files:l}):console.warn("No files to write for slice ".concat(t.id,". Files:"),l),{model:t,langSmithUrl:a}});return{library:n,slices:i}}async function ec(e){let{libraryID:t,sliceID:n,files:i}=e;if(0===i.length)return;let a=i.filter(e=>"mocks.json"!==e.path&&!e.path.startsWith("screenshot-")&&!e.path.match(/^index\.(tsx?|jsx?|vue|svelte)$/));if(console.log("Writing ".concat(a.length," additional file(s) for slice ").concat(n,":"),a.map(e=>e.path)),0!==a.length)try{let e=a.map(e=>{if(e.isBinary)return{path:e.path,contents:e.contents,isBinary:!0};if("string"==typeof e.contents)return{path:e.path,contents:e.contents,isBinary:!1};throw Error("Unexpected file contents type for ".concat(e.path))}),i=await Y.managerClient.slices.writeSliceFiles({libraryID:t,sliceID:n,files:e});i.errors.length>0?console.error("Errors writing files for slice ".concat(n,":"),i.errors.map(e=>{var t;return null!==(t=e.message)&&void 0!==t?t:String(e)})):console.log("Successfully wrote ".concat(a.length," file(s) for slice ").concat(n))}catch(e){console.error("Error writing files for slice ".concat(n,":"),e instanceof Error?e.message:String(e))}}let ed=(0,s.createContext)(void 0);function em(e){let{children:t}=e,[n,a]=(0,s.useState)([]),[o,l]=(0,s.useState)([]),[r,c]=(0,s.useState)(!1),{syncChanges:d}=(0,x.g)(),{createSliceSuccess:m,updateSliceMockSuccess:h}=(0,y.Z)(),{completeStep:u}=(0,er.k)(),p=(0,s.useRef)(crypto.randomUUID()),f=(0,s.useCallback)(e=>{a(t=>t.some(t=>t.model.id===e.model.id)?t.filter(t=>t.model.id!==e.model.id):[...t,e])},[]),b=(0,s.useCallback)(e=>{l(t=>t.some(t=>t.model.id===e.model.id)?t.filter(t=>t.model.id!==e.model.id):[...t,e])},[]),v=(0,s.useCallback)(e=>{l(e)},[]),j=(0,s.useCallback)(()=>{a([]),l([]),p.current=crypto.randomUUID()},[]),S=(0,s.useCallback)(async e=>{let{existingSlices:t,location:i,resetSlices:a}=e;if(0===n.length+o.length)throw F.Am.error("Please select at least one slice"),Error("No slices selected");let l=n.map(e=>e.model),r=o.map(e=>({image:e.image,model:e.model,files:e.files,componentContents:e.componentContents,mocks:e.mocks,screenshots:e.screenshots}));if(!(r.length>0))return j(),{slices:l};{let e=[],n=[...t.current,...l];for(let t of r){let i=function(e){let{existingSlices:t,newSlices:n,slice:i}=e,a=new Set,o=new Set;for(let{id:e,name:n}of t)a.add(e),o.add(n.toLowerCase());for(let e of n)a.add(e.model.id),o.add(e.model.name.toLowerCase());let l=i.id,r=2;for(;a.has(l);)l="".concat(i.id,"_").concat(r),r++;let s=i.name;for(r=2;o.has(s.toLowerCase());)s="".concat(i.name).concat(r),r++;return{...i,id:l,name:s}}({existingSlices:n,newSlices:e,slice:t.model});e.push({...t,model:i})}let o=p.current;c(!0);try{let{slices:t,library:n}=await es(e);if(o!==p.current)throw Error("Modal instance changed");await new Promise(e=>setTimeout(e,100));let s=(await (0,g.y0)()).libraries.map(t=>t.name!==n?t:{...t,components:t.components.map(t=>{let n=e.find(e=>e.model.id===t.model.id),i=t.mocks&&t.mocks.length>0?t.mocks:null==n?void 0:n.mocks;return{...t,mocks:null!=i?i:t.mocks}})});for(let e of(m(s),r))e.mocks&&Array.isArray(e.mocks)&&e.mocks.length>0&&h({libraryID:n,sliceID:e.model.id,mocks:e.mocks});d();let f=[...l,...t.map(e=>e.model)];for(let{model:e}of(c(!1),j(),a(),u("createSlice"),t))g.Xe.track({event:"slice:created",id:e.id,name:e.name,library:n,location:i,mode:"import"});return{slices:f,library:n}}catch(e){if(o!==p.current)throw e;throw c(!1),F.Am.error("An unexpected error happened while adding slices."),e}}},[n,o,d,m,h,u,j]),w=n.length+o.length;return(0,i.jsx)(ed.Provider,{value:{selectedLocalSlices:n,selectedLibrarySlices:o,toggleLocalSlice:f,toggleLibrarySlice:b,setAllLibrarySlices:v,reset:j,submit:S,isSubmitting:r,totalSelected:w},children:t})}function eh(){let e=(0,s.useContext)(ed);if(void 0===e)throw Error("useReuseExistingSlicesContext must be used within ReuseExistingSlicesProvider");return e}var eu=n(62434);function ep(e){let{thumbnailUrl:t,model:n,selected:o=!0,onSelectedChange:l}=e,r=(0,i.jsxs)(i.Fragment,{children:[void 0!==t&&t?(0,i.jsx)(eu.ZB,{src:t}):(0,i.jsx)(eu.ZB,{component:"div"}),(0,i.jsx)(eu.eW,{title:n.name,action:(0,i.jsx)("div",{onClick:e=>e.stopPropagation(),children:(0,i.jsx)(a.U,{checked:o,onCheckedChange:l})})})]});return(0,i.jsx)(eu.Zb,{interactive:!0,onClick:()=>{l(!o)},checked:o,size:"small",children:r})}function ef(){let[e,t]=(0,s.useState)(""),{isLoadingSlices:n,handleImportFromGithub:o,slices:l}=el(),{selectedLibrarySlices:r,toggleLibrarySlice:c,setAllLibrarySlices:d}=eh(),{allSelected:m,someSelected:h}=(0,s.useMemo)(()=>0===l.length?{allSelected:!1,someSelected:!1}:{allSelected:l.every(e=>r.some(t=>t.model.id===e.model.id)),someSelected:l.some(e=>r.some(t=>t.model.id===e.model.id))},[l,r]),u=async()=>{d(await o(e))};if(0===l.length)return(0,i.jsx)(a.D,{padding:16,height:"100%",flexDirection:"column",gap:16,children:(0,i.jsx)(a.D,{flexDirection:"column",gap:8,children:(0,i.jsxs)(a.D,{display:"flex",flexDirection:"column",gap:8,padding:16,border:!0,borderRadius:8,children:[(0,i.jsx)(a.bL,{color:"grey11",children:"Import from GitHub"}),(0,i.jsx)(a.bN,{placeholder:"https://github.com/username/repository",value:e,onValueChange:t}),(0,i.jsx)(a.E,{onClick:()=>void u(),disabled:!e.trim()||n,loading:n,color:"purple",children:n?"Loading slices...":"Import from GitHub"})]})})});let p="Select all slices";return m?p="Selected all slices (".concat(r.length,")"):h&&(p="".concat(r.length," of ").concat(l.length," selected")),(0,i.jsxs)(a.D,{flexDirection:"column",flexGrow:1,minHeight:0,children:[(0,i.jsx)(a.D,{padding:{block:12,inline:16},alignItems:"center",gap:8,children:(0,i.jsx)(a.aR,{value:p,children:(0,i.jsx)(a.U,{checked:m,indeterminate:h&&!m,onCheckedChange:e=>{e?d(l):d([])}})})}),(0,i.jsx)(a.bn,{stableScrollbar:!1,children:(0,i.jsx)(a.D,{display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gap:16,padding:{inline:16,bottom:16},children:l.map(e=>{let t=r.some(t=>t.model.id===e.model.id);return(0,i.jsx)(ep,{model:e.model,thumbnailUrl:e.thumbnailUrl,selected:t,onSelectedChange:()=>{c(e)}},e.model.id)})})})]})}var eg=n(51507);function ex(e){let{availableSlices:t}=e,{selectedLocalSlices:n,toggleLocalSlice:o}=eh();return 0===t.length?(0,i.jsx)(a.D,{padding:16,height:"100%",flexDirection:"column",gap:16,children:(0,i.jsx)(a.D,{flexDirection:"column",gap:8,children:(0,i.jsx)(a.D,{display:"flex",flexDirection:"column",gap:8,padding:16,alignItems:"center",justifyContent:"center",children:"No local slices available"})})}):(0,i.jsx)(a.bn,{stableScrollbar:!1,children:(0,i.jsx)(a.D,{display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gap:16,flexGrow:1,padding:16,minHeight:0,children:t.map(e=>{let t=n.some(t=>t.model.id===e.model.id);return(0,i.jsx)(eg.b,{action:{type:"checkbox"},mode:"selection",onSelectedChange:()=>{o(e)},selected:t,slice:e,variant:"outlined"},"".concat(e.from,"-").concat(e.model.name))})})})}function eb(e){let{open:t,location:n,typeName:o,availableSlices:l=[],onSuccess:r,onClose:c}=e,[d,m]=(0,s.useState)("local"),h=function(e){let{open:t}=e,n=(0,s.useRef)([]);return(0,s.useEffect)(()=>{t&&(n.current=[],Y.managerClient.slices.readAllSlices().then(e=>{n.current=e.models.map(e=>{let{model:t}=e;return t})}).catch(()=>null))},[t]),n}({open:t}),{resetSlices:u}=el(),{submit:p,isSubmitting:f,totalSelected:g,reset:x}=eh(),b=async()=>{try{let e=await p({existingSlices:h,location:n,resetSlices:u});r(e)}catch(e){}};return(0,i.jsxs)(a.ae,{open:t,onOpenChange:e=>{e||f||(c(),x(),u(),m("local"))},children:[(0,i.jsx)(a.al,{title:"Reuse an existing slice"}),(0,i.jsxs)(a.aj,{gap:0,children:[(0,i.jsx)(a.ak,{hidden:!0,children:"Select existing slices or import slices from a GitHub repository"}),(0,i.jsxs)(a.D,{flexDirection:"column",flexGrow:1,minHeight:0,children:[(0,i.jsxs)(a.D,{justifyContent:"space-between",padding:16,border:{bottom:!0},children:[(0,i.jsxs)(a.D,{gap:8,children:[(0,i.jsx)(a.bD,{selected:"local"===d,onClick:()=>m("local"),children:"Local Slices"}),(0,i.jsx)(a.bD,{selected:"library"===d,onClick:()=>m("library"),children:"Library Slices"})]}),"library"===d&&"<repo-select>"]}),(0,i.jsx)(ey,{selected:"local"===d,children:(0,i.jsx)(ex,{availableSlices:l})}),(0,i.jsx)(ey,{selected:"library"===d,children:(0,i.jsx)(ef,{})})]}),(0,i.jsxs)(a.ah,{children:[(0,i.jsx)(a.ai,{disabled:f,size:"medium"}),(0,i.jsxs)(a.af,{disabled:0===g,loading:f,onClick:()=>void b(),size:"medium",children:[W(n,o)," (",g,")"]})]})]})]})}function ey(e){let{children:t,selected:n}=e;return n?(0,i.jsx)(a.D,{display:"flex",flexDirection:"column",flexGrow:1,minHeight:0,children:t}):(0,i.jsx)(a.D,{display:"none",minHeight:0,children:t})}function ev(e){return(0,i.jsx)(em,{children:(0,i.jsx)(eb,{...e})})}var ej=n(27213);let eS=e=>{let{openCreateSliceModal:t,openCreateSliceFromImageModal:n,openUpdateSliceZoneModal:o,openSlicesTemplatesModal:l,isSlicesTemplatesSupported:r}=e,s=(0,ej.F)({menuType:"ActionList"});return(0,i.jsxs)(a.s,{"data-testid":"slice-zone-blank-slate",sx:{width:648},children:[(0,i.jsx)(a.x,{lineColor:"purple9",backgroundColor:"purple5",name:"add",size:"large"}),(0,i.jsx)(a.z,{size:"big",children:"Add slices"}),(0,i.jsx)(a.w,{children:"Slices are reusable website sections. You can use them on different pages and write unique content for each. Each slice has its own component in your code."}),(0,i.jsx)(a.v,{children:(0,i.jsxs)(a.A,{children:[(0,i.jsx)(a.b,{renderStartIcon:()=>s.fromImage.BackgroundIcon,onClick:n,description:s.fromImage.description,children:s.fromImage.title}),(0,i.jsx)(a.b,{renderStartIcon:()=>s.fromScratch.BackgroundIcon,onClick:t,description:s.fromScratch.description,children:s.fromScratch.title}),r&&(0,i.jsx)(a.b,{renderStartIcon:()=>s.fromTemplate.BackgroundIcon,onClick:l,description:s.fromTemplate.description,children:s.fromTemplate.title}),(0,i.jsx)(a.b,{renderStartIcon:()=>s.fromExisting.BackgroundIcon,onClick:o,description:s.fromExisting.description,children:s.fromExisting.title})]})})]})};function ew(e){let{customType:t,tabId:n,slices:i}=e,a={...t};return i.forEach(e=>{a={...a,tabs:a.tabs.map(t=>t.key===n&&t.sliceZone?{...t,sliceZone:{key:t.sliceZone.key,value:[{key:e.id,value:e},...t.sliceZone.value]}}:t)}}),g.Xe.track({event:"custom-type:slice-zone-updated",customTypeId:t.id}),a}var eC=n(18566);async function eI(){try{let{templates:e,errors:t}=await Y.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,n]=e;return[t,URL.createObjectURL(n)]}))}))}catch(e){return[]}}var eD=n(6256),ek=n(39204),eT=n(7723),e_=n(33986),eA=n(30527),eE=n(55862);let eL=e=>{let{deleteSliceZone:t,closeDeleteSliceZoneModal:n}=e;return(0,i.jsx)(eE.Z,{isOpen:!0,shouldCloseOnOverlayClick:!0,style:{content:{maxWidth:612}},onRequestClose:n,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)(E.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)(E.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:"Do you really want to delete Slice Zone?"}),(0,i.jsx)(E.x8,{type:"button",onClick:n})]}),Footer:()=>(0,i.jsxs)(E.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)(e_.z,{label:"Cancel",variant:"secondary",onClick:n,sx:{mr:"10px",fontWeight:"bold",color:"grey12",borderRadius:6}}),(0,i.jsx)(e_.z,{label:"Delete",variant:"danger",onClick:t,sx:{minHeight:39,minWidth:78}})]}),children:(0,i.jsx)(E.nv,{children:"You're about to delete Slice Zone."})})})};var ez=n(84879),eN=n(63908),eP=n(63019),eM=n(65375),eF=n.n(eM);let eO=e=>{var t;let{isOpen:n,close:o,onSubmit:l,isLoading:r,slice:d,libraries:m}=e,{remoteSlices:h}=(0,c.v9)(e=>({remoteSlices:(0,eT.sT)(e)})),u={from:null===(t=m[0])||void 0===t?void 0:t.name,sliceName:(0,B.MP)(d.key)},[p,g]=(0,s.useState)(u),[x,b]=(0,s.useState)();function y(e){g(e),b((0,eP.h)(e,m,h))}return(0,f.pQ)(n,()=>{n||(g(u),b(void 0))}),(0,i.jsxs)(a.ae,{open:n,onOpenChange:e=>!e&&o(),size:{width:448,height:"auto"},children:[(0,i.jsx)(a.al,{title:"Upgrade slice"}),(0,i.jsx)(a.aj,{children:(0,i.jsx)(a.aJ,{onSubmit:function(){x&&Object.keys(x).length>0||l({libraryID:p.from,sliceID:p.sliceName})},children:(0,i.jsxs)(a.D,{flexDirection:"column",children:[(0,i.jsxs)(a.bn,{className:eF().scrollArea,children:[(0,i.jsx)(a.bL,{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)(a.bL,{variant:"normal",color:"grey11",children:"This will not migrate your component. You will need to do that manually."}),(0,i.jsxs)(a.D,{flexDirection:"column",gap:4,children:[(0,i.jsx)(a.aM,{label:"Slice name *",placeholder:"Pascalised Slice API ID (e.g. ".concat((0,B.MP)(d.key),")"),error:null==x?void 0:x.sliceName,value:p.sliceName,onValueChange:e=>y({...p,sliceName:e.slice(0,30)}),"data-testid":"slice-name-input"}),(0,i.jsx)(a.bL,{variant:"normal",color:"grey11",children:"A display name for the slice"})]}),(0,i.jsxs)(a.D,{flexDirection:"column",gap:4,children:[(0,i.jsx)("label",{className:eF().label,children:(0,i.jsx)(a.bL,{variant:"bold",children:"Slice library *"})}),(0,i.jsx)(a.bq,{size:"medium",color:"grey",startIcon:"folder",flexContent:!0,value:p.from,onValueChange:e=>{e&&y({...p,from:e})},children:m.map(e=>(0,i.jsx)(a.bt,{value:e.name,children:e.name},e.name))}),(0,i.jsx)(a.bL,{variant:"normal",color:"grey11",children:"The library where we'll store your slice"})]})]}),(0,i.jsxs)(a.ah,{children:[(0,i.jsx)(a.ai,{size:"medium"}),(0,i.jsx)(a.af,{type:"submit",size:"medium",loading:r,disabled:x&&Object.keys(x).length>0,children:"Upgrade"})]})]})})})]})};var eU=n(96009),eZ=n.n(eU);let eG=e=>{var t,n;let{isOpen:o,close:l,onSubmit:r,isLoading:c,slice:d,sliceName:m,libraries:h,localSharedSlices:u}=e,p={libraryID:null===(t=u[0])||void 0===t?void 0:t.from,sliceID:null===(n=u[0])||void 0===n?void 0:n.model.id,variationID:eZ()(d.key),variationName:m},[g,x]=(0,s.useState)(!0),[b,y]=(0,s.useState)(p),[v,j]=(0,s.useState)({});function S(e){y(e),j(eB(e,h))}return(0,f.pQ)(o,()=>{o||(y(p),j({}))}),(0,i.jsxs)(a.ae,{open:o,onOpenChange:e=>!e&&l(),size:{width:448,height:"auto"},children:[(0,i.jsx)(a.al,{title:"Convert to slice variation"}),(0,i.jsx)(a.aj,{children:(0,i.jsx)(a.aJ,{onSubmit:function(){Object.keys(v).length>0||r(b)},children:(0,i.jsxs)(a.D,{display:"flex",flexDirection:"column",children:[(0,i.jsxs)(a.bn,{className:eF().scrollArea,children:[(0,i.jsx)(a.bL,{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)(a.D,{display:"flex",flexDirection:"column",gap:4,children:[(0,i.jsxs)("label",{className:eF().label,children:[(0,i.jsx)(a.bL,{variant:"bold",children:"Target slice *"}),"string"==typeof v.libraryID?(0,i.jsx)(a.bL,{variant:"small",color:"tomato10",children:v.libraryID}):null,"string"==typeof v.sliceID?(0,i.jsx)(a.bL,{variant:"small",color:"tomato10",children:v.sliceID}):null]}),(0,i.jsx)(a.bq,{size:"medium",color:"grey",startIcon:"viewDay",flexContent:!0,value:"".concat(b.libraryID,"::").concat(b.sliceID),onValueChange:e=>{if(e){let[t,n]=e.split("::");S({...b,libraryID:t,sliceID:n})}},children:u.map(e=>(0,i.jsxs)(a.bt,{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)(a.bL,{variant:"normal",color:"grey11",children:"Choose the slice to which you would like to add this variation."})]}),(0,i.jsx)(a.D,{display:"flex",flexDirection:"column",gap:4,children:(0,i.jsx)(a.aM,{label:"Variation name *",placeholder:m,error:v.variationName,value:b.variationName,onValueChange:e=>{let t={...b,variationName:e.slice(0,30)};g&&(t.variationID=eZ()(t.variationName)),S(t)},"data-testid":"variation-name-input"})}),(0,i.jsx)(a.D,{display:"flex",flexDirection:"column",gap:4,children:(0,i.jsx)(a.aM,{label:"ID *",placeholder:eZ()(d.key),error:v.variationID,value:b.variationID,onValueChange:e=>{x(!1),S({...b,variationID:e.slice(0,30)})},"data-testid":"variation-id-input"})})]}),(0,i.jsxs)(a.ah,{children:[(0,i.jsx)(a.ai,{size:"medium"}),(0,i.jsx)(a.af,{type:"submit",size:"medium",loading:c,disabled:Object.keys(v).length>0,children:"Convert"})]})]})})})]})},eB=(e,t)=>{let n={};e.libraryID||(n.libraryID="Cannot be empty.");let i=t.find(t=>t.path===e.libraryID);n.libraryID||i||(n.libraryID="Does not exist."),e.sliceID||(n.sliceID="Cannot be empty.");let a=null==i?void 0:i.components.find(t=>t.model.id===e.sliceID);if(n.sliceID||a||(n.sliceID="Does not exist."),e.variationName||(n.variationName="Cannot be empty."),e.variationID){var o;(null!==(o=null==a?void 0:a.model.variations.map(e=>e.id))&&void 0!==o?o:[]).includes(e.variationID)&&(n.variationID="Slice variation ID is already taken.")}else n.variationID="Cannot be empty.";return n},eR=e=>{var t,n;let{isOpen:o,close:l,onSubmit:r,isLoading:c,identicalSlices:d}=e,m=null!==(n=null===(t=d[0])||void 0===t?void 0:t.path)&&void 0!==n?n:"",[h,u]=(0,s.useState)(m),[p,g]=(0,s.useState)();return(0,f.pQ)(o,()=>{o||(u(m),g(void 0))}),(0,i.jsxs)(a.ae,{open:o,onOpenChange:e=>!e&&l(),size:{width:448,height:"auto"},children:[(0,i.jsx)(a.al,{title:"Merge with an existing slice"}),(0,i.jsx)(a.aj,{children:(0,i.jsx)(a.aJ,{onSubmit:function(){if(p)return;let[e,t,n]=h.split("::");r({libraryID:e,sliceID:t,variationID:n})},children:(0,i.jsxs)(a.D,{display:"flex",flexDirection:"column",children:[(0,i.jsxs)(a.bn,{className:eF().scrollArea,children:[(0,i.jsx)(a.bL,{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)(a.D,{display:"flex",flexDirection:"column",gap:4,children:[(0,i.jsxs)("label",{className:eF().label,children:[(0,i.jsx)(a.bL,{variant:"bold",children:"Target slice*"}),"string"==typeof p?(0,i.jsx)(a.bL,{variant:"small",color:"tomato10",children:p}):null]}),(0,i.jsx)(a.bq,{size:"medium",color:"grey",startIcon:"viewDay",flexContent:!0,value:h,onValueChange:function(e){u(e),e||g("Cannot be empty.")},children:d.map(e=>(0,i.jsx)(a.bt,{value:e.path,children:e.path.split("::").join(" > ")},e.path))}),(0,i.jsx)(a.bL,{variant:"normal",color:"grey11",children:"Choose a slice that you would like to merge this into."})]})]}),(0,i.jsxs)(a.ah,{children:[(0,i.jsx)(a.ai,{size:"medium"}),(0,i.jsx)(a.af,{type:"submit",size:"medium",loading:c,disabled:!!p,children:"Merge"})]})]})})})]})},eH=e=>{var t;let{slice:n,path:o}=e,{refreshState:l}=(0,y.Z)(),[r,d]=(0,s.useState)(!1),[m,h]=(0,s.useState)(),{setCustomType:u}=w(),{libraries:p}=(0,c.v9)(e=>({libraries:(0,eT.Sd)(e)})),f="Slice"===n.value.type&&null!==(t=n.value.fieldset)&&void 0!==t?t:n.key,x=p.filter(e=>e.isLocal),b=x.map(e=>e.components).flat(),v=eK(n,f,b),j=async e=>{var t,i,a;if(!m)return;d(!0),g.Xe.track({event:"legacy-slice:converted",id:e.sliceID,variation:null!==(t=e.variationID)&&void 0!==t?t:"default",library:e.libraryID,conversionType:m});let{errors:r}=await Y.managerClient.slices.convertLegacySliceToSharedSlice({model:n.value,src:{...o,sliceID:n.key},dest:{libraryID:e.libraryID,sliceID:e.sliceID,variationName:null!==(i=e.variationName)&&void 0!==i?i:"Default",variationID:null!==(a=e.variationID)&&void 0!==a?a:"default"}});if(r.length)throw console.error("Could not convert slice `".concat(f,"`"),r),F.Am.error("Could not convert slice `".concat(f,"`")),r;let{model:s,errors:c}=await Y.managerClient.customTypes.readCustomType({id:o.customTypeID});if(c.length||!s){console.error("Could not refresh custom type view `".concat(o.customTypeID,"`"),c),F.Am.error("Could not refresh custom type view `".concat(o.customTypeID,"`"));return}switch(l(await (0,g.y0)()),d(!1),h(void 0),m){case"as_new_slice":F.Am.success("".concat(f," has been upgraded to a new slice ").concat(e.libraryID," > ").concat(e.sliceID));break;case"as_new_variation":F.Am.success("".concat(f," has been converted as a variation of ").concat(e.libraryID," > ").concat(e.sliceID));break;default:F.Am.success("".concat(f," has been merged with ").concat(e.libraryID," > ").concat(e.sliceID))}u({customType:s})},S={path:o,slice:n,sliceName:f,libraries:x,localSharedSlices:b,identicalSlices:v,close:()=>h(void 0),onSubmit:j,isLoading:r};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(a.ar,{children:[(0,i.jsx)(a.av,{children:(0,i.jsx)(a.E,{"data-testid":"convert-legacy-slice",startIcon:"refresh",endIcon:"arrowDropDown",size:"medium",color:"grey",children:"Migrate legacy slice"})}),(0,i.jsxs)(a.as,{align:"start",children:[(0,i.jsx)(a.at,{startIcon:(0,i.jsx)(a.aX,{name:"folder",size:"large"}),description:"Use it with new types",onSelect:()=>h("as_new_slice"),children:"Upgrade slice"}),(0,i.jsx)(a.at,{startIcon:(0,i.jsx)(a.aX,{name:"viewDay",size:"large"}),description:"Add it to another slice",onSelect:()=>h("as_new_variation"),disabled:!b.length,children:"Convert to slice variation"}),(0,i.jsx)(a.at,{startIcon:(0,i.jsx)(a.aX,{name:"driveFileMove",size:"large"}),description:"Combine identical slices",onSelect:()=>h("merge_with_identical"),disabled:!v.length,children:"Merge with another slice"})]})]}),(0,i.jsx)(eO,{...S,isOpen:"as_new_slice"===m}),(0,i.jsx)(eG,{...S,isOpen:"as_new_variation"===m}),(0,i.jsx)(eR,{...S,isOpen:"merge_with_identical"===m})]})},eK=(e,t,n)=>(0,s.useMemo)(()=>{let i=[],a=(0,eN.ux)(e.value,t);for(let e of n)for(let t of e.model.variations){let n=(0,eN.ux)(t,e.model.name);a.primary===n.primary&&a.items===n.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,n]),eV=e=>{let{slice:t,path:n}=e,[o]=(0,ez.E)("legacySliceUpgrader"),l=o.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)(eu.Zb,{children:[(0,i.jsx)(eu.ZB,{component:"div",children:(0,i.jsx)(a.D,{alignItems:"center",justifyContent:"center",children:(0,i.jsx)(a.bL,{color:"grey11",component:"span",children:"No screenshot available"})})}),(0,i.jsxs)(eu.T$,{children:[(0,i.jsx)(a.c3,{content:l,side:"bottom",children:(0,i.jsx)(a.m,{color:"purple",title:"Legacy Slice"})}),o.enabled?(0,i.jsx)(eH,{slice:t,path:n}):null]}),(0,i.jsx)(eu.eW,{subtitle:"1 variation",title:(0,eN.Dj)(t.value)})]})};var eX=n(21151);let eq=e=>{let{slices:t,format:n,path:a,onRemoveSharedSlice:o}=e,l=t.some(e=>"SharedSlice"!==e.type),r=v.$[n],[c]=(0,ez.E)("legacySliceUpgrader");return(0,s.useEffect)(()=>{l&&(c.enabled?F.Am.info("This ".concat(r.name({start:!1,plural:!1})," contains legacy slices that can be upgraded.")):F.Am.warning("This ".concat(r.name({start:!1,plural:!1})," contains slices that are incompatible.")))},[l]),(0,i.jsx)(eX.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)(eV,{slice:t,path:a})}{let t=e.payload;return(0,i.jsx)(eg.b,{action:{type:"remove",onRemove:()=>{o(t.model.id)}},mode:"navigation",slice:t,variant:"solid"})}},sx:{padding:"16px"}})};async function eW(e){try{let{templateIDs:t,localLibrariesNames:n,location:i,onSuccess:a}=e,{data:o,errors:l}=await Y.managerClient.sliceTemplateLibrary.createSlices({templateIDs:t});if(l.length>0||void 0===o)throw l;o.sliceIDs.forEach((e,a)=>{g.Xe.track({event:"slice:created",id:e,name:e,library:n[0],location:i,mode:"template",sliceTemplate:t[a]})}),await a(o.sliceIDs)}catch(t){let e="Internal Error: Slice(s) not created";console.error(e,t),F.Am.error(e)}}var eY=n(26109),e$=e=>{let{availableSlices:t,values:n}=e;return(0,i.jsx)(A.F2,{name:"sliceKeys",render:e=>(0,i.jsx)(eX.Z,{gridTemplateMinPx:"200px",elems:t,defineElementKey:e=>"".concat(e.from,"-").concat(e.model.name),renderElem:t=>{let a=n.sliceKeys.includes(t.model.id);return(0,i.jsx)(eg.b,{action:{type:"checkbox"},mode:"selection",onSelectedChange:i=>{i?e.push(t.model.id):e.remove(n.sliceKeys.indexOf(t.model.id))},selected:a,slice:t,variant:"outlined"})}})})};let eJ=e=>{let{formId:t,close:n,onSuccess:a,availableSlicesTemplates:o,localLibraries:l,location:r}=e,{createSliceSuccess:s}=(0,y.Z)();return(0,i.jsx)(_.Z,{isOpen:!0,buttonLabel:"Add",formId:t,close:n,onSubmit:e=>{let{sliceKeys:t}=e;eW({templateIDs:t,localLibrariesNames:l.map(e=>e.name),location:r,onSuccess:async e=>{s((await (0,g.y0)()).libraries),a(await Promise.all(e.map(async e=>(await Y.managerClient.slices.readSlice({libraryID:l[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)(E.xv,{sx:{color:"error"},children:t.sliceKeys}):void 0},children:e=>{let{values:t}=e;return(0,i.jsx)(e$,{values:t,availableSlices:o.map(e=>({extension:"",fileName:"",from:"",href:"",pathToSlice:"",model:eY.id.toSM(e.model),screenshots:Object.entries(e.screenshots).reduce((e,t)=>({...e,[t[0]]:{url:t[1]}}),{})}))})}})},eQ=(e,t)=>{let n=(t||[]).reduce((e,t)=>[...e,...t.components],[]),{slicesInSliceZone:i,notFound:a}=e.value.reduce((e,t)=>{let{key:i,value:a}=t;if("SharedSlice"===a.type){let t=n.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:a}}]}},{slicesInSliceZone:[],notFound:[]});return{availableSlices:n,slicesInSliceZone:i,notFound:a}};var e0=e=>{var t,n;let{customType:o,onCreateSliceZone:l,onDeleteSliceZone:r,onRemoveSharedSlice:d,sliceZone:m,tabId:h}=e,u=(0,eC.QT)(eI,[]),[p,f]=(0,s.useState)(!1),[x,b]=(0,s.useState)(!1),[v,j]=(0,s.useState)(!1),[S,C]=(0,s.useState)(!1),{remoteSlices:I,libraries:D}=(0,c.v9)(e=>({remoteSlices:(0,eT.sT)(e),libraries:(0,eT.Sd)(e),slices:(0,eT.xC)(e)})),{setCustomType:k}=w(),{completeStep:_}=(0,er.k)(),{openLoginModal:A}=(0,y.Z)(),E=(0,ej.F)({menuType:"Dropdown"}),L=D.filter(e=>e.isLocal),{availableSlices:z,slicesInSliceZone:N,notFound:P}=(0,s.useMemo)(()=>m?eQ(m,D):{availableSlices:[],slicesInSliceZone:[],notFound:[]},[m,D]),[M,U]=(0,s.useState)(!1);(0,s.useEffect)(()=>{(null==P?void 0:P.length)&&P.forEach(e=>{let{key:t}=e;d(t)})},[P]);let Z=N.filter(e=>"SharedSlice"===e.type).map(e=>e.payload),G=z.filter(e=>!Z.some(t=>t.model.id===e.model.id)),B=()=>{b(!0)},R=()=>{j(!0)},H=async()=>{await Y.managerClient.user.checkIsLoggedIn()?C(!0):A()},K=()=>{f(!0),g.Xe.track({event:"custom-type:open-add-from-templates",customTypeId:o.id,customTypeFormat:o.format})},V=()=>{b(!1)},W=()=>{j(!1)},$=()=>{C(!1)},J=()=>{f(!1)};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(O.Bu,{actions:m?(0,i.jsxs)(a.ar,{children:[(0,i.jsx)(a.av,{children:(0,i.jsx)(a.E,{color:"purple",startIcon:"add","data-testid":"add-new-slice-dropdown",children:"Add"})}),(0,i.jsxs)(a.as,{align:"end",children:[(0,i.jsx)(a.at,{renderStartIcon:()=>E.fromImage.BackgroundIcon,onSelect:()=>void H(),description:E.fromImage.description,children:E.fromImage.title}),(0,i.jsx)(a.at,{renderStartIcon:()=>E.fromScratch.BackgroundIcon,onSelect:R,description:E.fromScratch.description,children:E.fromScratch.title}),u.length>0?(0,i.jsx)(a.at,{onSelect:K,renderStartIcon:()=>E.fromTemplate.BackgroundIcon,description:E.fromTemplate.description,children:E.fromTemplate.title}):void 0,(0,i.jsx)(a.at,{onSelect:B,renderStartIcon:()=>E.fromExisting.BackgroundIcon,description:E.fromExisting.description,children:E.fromExisting.title})]})]}):void 0,toggle:"page"!==o.format||"Main"!==h?(0,i.jsx)(a.bC,{checked:!!m,onCheckedChange:e=>{e?l():U(!0)},size:"small","data-testid":"slice-zone-switch"}):void 0,children:"Slices"}),m?N.length>0?(0,i.jsx)(X.xR,{children:(0,i.jsx)(eq,{slices:N,format:o.format,path:{customTypeID:o.id,tabID:h,sliceZoneID:null!==(t=null==m?void 0:m.key)&&void 0!==t?t:""},onRemoveSharedSlice:d})}):(0,i.jsx)(a.D,{flexDirection:"column",flexGrow:1,justifyContent:"center",alignItems:"center",padding:{block:32},children:(0,i.jsx)(eS,{openUpdateSliceZoneModal:B,openCreateSliceModal:R,openCreateSliceFromImageModal:()=>void H(),openSlicesTemplatesModal:K,projectHasAvailableSlices:G.length>0,isSlicesTemplatesSupported:u.length>0})}):void 0,(0,i.jsx)(ev,{open:x,location:"".concat(o.format,"_type"),typeName:null!==(n=o.label)&&void 0!==n?n:o.id,availableSlices:G,onSuccess:e=>{let{slices:t}=e,n=ew({customType:o,tabId:h,slices:t});k({customType:T.Dc.fromSM(n),onSaveCallback:()=>{F.Am.success("Slices successfully added")}}),_("createSlice"),V()},onClose:V}),p&&(0,i.jsx)(eJ,{formId:"tab-slicezone-form-".concat(h),availableSlicesTemplates:u,localLibraries:L,location:"".concat(o.format,"_type"),onSuccess:e=>{let t=ew({customType:o,tabId:h,slices:e});k({customType:T.Dc.fromSM(t),onSaveCallback:()=>{F.Am.success((0,i.jsx)(ek.GX,{message:"Slice template(s) added to slice zone and created at: ",path:"".concat(L[0].name,"/")}))}}),_("createSlice"),J()},close:J}),M&&(0,i.jsx)(eL,{closeDeleteSliceZoneModal:()=>{U(!1)},deleteSliceZone:()=>{r(),U(!1)}}),(null==L?void 0:L.length)!==0&&v&&(0,i.jsx)(eD.c,{onSuccess:e=>{let t=ew({customType:o,tabId:h,slices:[e]});k({customType:T.Dc.fromSM(t),onSaveCallback:()=>{F.Am.success((0,i.jsx)(ek.GX,{message:"New slice added to slice zone and created at: ",path:"".concat(L[0].name,"/")}))}}),W()},localLibraries:L,location:"".concat(o.format,"_type"),remoteSlices:I,onClose:W}),(0,i.jsx)(q.S,{open:S,location:"".concat(o.format,"_type"),onSuccess:e=>{let{slices:t,library:n}=e,a=ew({customType:o,tabId:h,slices:t});k({customType:T.Dc.fromSM(a),onSaveCallback:()=>{F.Am.success((0,i.jsx)(ek.GX,{message:"Slice(s) added to slice zone and created at: ",path:n}))}}),$()},onClose:$})]})};let e1=[Z.C.UID,Z.C.Image,Z.C.Text,Z.C.StructuredText,Z.C.Link,Z.C.Select,Z.C.Boolean,Z.C.Number,Z.C.Color,Z.C.Date,Z.C.Table,Z.C.Embed,Z.C.Timestamp,Z.C.GeoPoint,Z.C.ContentRelationship,Z.C.LinkToMedia,Z.C.Group,Z.C.NestedGroup];var e6=e=>{var t,n,o,l;let{tabId:r}=e,{customType:c,setCustomType:d}=w(),h=T.Dc.toSM(c),u=null===(t=h.tabs.find(e=>e.key===r))||void 0===t?void 0:t.sliceZone,p=null!==(o=null===(n=h.tabs.find(e=>e.key===r))||void 0===n?void 0:n.value)&&void 0!==o?o:[],f="page"===h.format&&h.repeatable?p.filter(e=>"uid"!==e.key):p,g=h.tabs.reduce((e,t)=>[...e,...t.value],[]),x=e=>{var t;let{apiId:n,value:i}=e,a=null===(t=i.config)||void 0===t?void 0:t.label;if((0,G.Ss)(Z.C,i.type)||null==a)return;if("Range"===i.type||"IntegrationFields"===i.type||"Separator"===i.type)throw Error("Unsupported Field Type: ".concat(i.type));let o=Z.C[i.type];try{o.schema.validateSync(i,{stripUnknown:!1})}catch(e){throw Error('Add field: Model is invalid for field "'.concat(i.type,'".'))}let l=T.L$.fromSM(i);d({customType:(0,m.xS)({customType:c,newField:l,newFieldId:n,sectionId:r}),onSaveCallback:()=>{F.Am.success("".concat("Group"===i.type?"Group":"Field"," added"))}}),(0,R.V)({id:n,field:l})},b=e=>{let{apiId:t,newKey:n,value:i,inGroupFieldAction:a,updateMeta:o}=e;if((0,G.Ss)(Z.C,i.type))return;let l=T.L$.fromSM(i);d({customType:(0,m.L4)({customType:c,previousFieldId:t,newFieldId:n,newField:l,sectionId:r}),onSaveCallback:()=>{"add"===a&&F.Am.success("Field added")},updateMeta:o}),a||(0,H.Z)({previousId:t,id:n,field:l})};return(0,i.jsx)(U.h,{children:(0,i.jsx)(s.Suspense,{fallback:(0,i.jsx)(a.D,{padding:32,children:(0,i.jsx)(a.bg,{})}),children:(0,i.jsxs)(O.aV,{border:!1,style:{flexGrow:1},children:[(0,i.jsx)(V.Z,{zoneType:"customType",zoneTypeFormat:null!==(l=c.format)&&void 0!==l?l:"custom",tabId:r,title:"Static zone",dataTip:"",fields:f,poolOfFieldsToCheck:g,showHints:!0,EditModal:K.Z,widgetsArray:e1,onDeleteItem:e=>{d({customType:(0,m.AK)({customType:c,fieldId:e,sectionId:r})})},onSave:e=>""===e.apiId?x({...e,apiId:e.newKey}):b(e),onDragEnd:e=>{if((0,G.uS)(e))return;let{source:t,destination:n}=e;if(!n)return;let i=(0,m.gR)({customType:c,sourceIndex:t.index,destinationIndex:n.index,sectionId:r});(0,M.flushSync)(()=>d({customType:i}))},renderHintBase:e=>{let{item:t}=e;return"data".concat((0,B.Ti)(t.key))},renderFieldAccessor:e=>"data".concat((0,B.Ti)(e)),testId:"static-zone-content",isRepeatableCustomType:c.repeatable}),(0,i.jsx)(e0,{customType:h,tabId:r,sliceZone:u,onRemoveSharedSlice:e=>{d({customType:(0,m.EN)({customType:c,sectionId:r,sliceId:e})})},onCreateSliceZone:()=>{d({customType:(0,m.Tr)(c,r)})},onDeleteSliceZone:()=>{d({customType:(0,m.E3)(c,r)})}})]})})})};let e4=()=>{var e,t,n;let{customType:o,setCustomType:l}=w(),r=T.Dc.toSM(o),[c,d]=(0,s.useState)(null===(e=r.tabs[0])||void 0===e?void 0:e.key),[h,u]=(0,s.useState)(),p=(null===(n=r.tabs.find(e=>e.key===c))||void 0===n?void 0:null===(t=n.sliceZone)||void 0===t?void 0:t.value.length)===0;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(a.c9,{sx:p?{flexGrow:1}:void 0,children:["page"===o.format?(0,i.jsx)(a.ca,{title:o.repeatable?(0,i.jsx)(I,{}):void 0}):void 0,(0,i.jsxs)(a.cb,{onValueChange:d,value:c,children:[(0,i.jsx)(a.cd,{onAddNewTab:()=>{u({type:"CREATE_CUSTOM_TYPE_TAB"})},children:r.tabs.map(e=>(0,i.jsx)(a.ce,{menu:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(a.at,{onSelect:()=>{u({type:"UPDATE_CUSTOM_TYPE_TAB",tabKey:e.key})},startIcon:(0,i.jsx)(a.aX,{name:"edit"}),children:"Rename"}),(0,i.jsx)(a.at,{color:"tomato",disabled:function(e){if(r.tabs.length<=1)return!0;let t=r.tabs.find(e=>e.value.find(e=>"uid"===e.key));return"page"===o.format&&o.repeatable&&(null==t?void 0:t.key)===e}(e.key),onSelect:()=>{u({type:"DELETE_CUSTOM_TYPE_TAB",tabKey:e.key})},startIcon:(0,i.jsx)(a.aX,{name:"delete"}),children:"Remove"})]}),value:e.key,children:e.key},e.key))}),r.tabs.map(e=>(0,i.jsx)(a.cc,{value:e.key,children:(0,i.jsx)(e6,{tabId:e.key})},e.key))]})]}),(null==h?void 0:h.type)==="CREATE_CUSTOM_TYPE_TAB"?(0,i.jsx)(z,{close:()=>{u(void 0)},isOpen:!0,onSubmit:e=>{let{id:t}=e;l({customType:(0,m.vB)(o,t)}),d(t)},tabIds:r.tabs.map(e=>e.key.toLowerCase())}):void 0,(null==h?void 0:h.type)==="UPDATE_CUSTOM_TYPE_TAB"?(0,i.jsx)(P,{close:()=>{u(void 0)},initialTabKey:h.tabKey,isOpen:!0,onSubmit:e=>{let{id:t}=e;l({customType:(0,m.HO)(o,h.tabKey,t)}),c===h.tabKey&&d(t)},tabIds:r.tabs.filter(e=>e.key!==h.tabKey).map(e=>e.key.toLowerCase())}):void 0,(null==h?void 0:h.type)==="DELETE_CUSTOM_TYPE_TAB"?(0,i.jsx)(N,{close:()=>{u(void 0)},isOpen:!0,onSubmit:()=>{if(l({customType:(0,m.F$)(o,h.tabKey)}),c===h.tabKey){var e;let t=null===(e=r.tabs.find(e=>e.key!==h.tabKey))||void 0===e?void 0:e.key;void 0!==t&&d(t)}}}):void 0]})};var e8=n(16442),e3=n(78254),e2=n(60867),e5=n(11166),e9=n(34919),e7=n.n(e9);let te=e=>{let{tabs:t,...n}=e;return(0,i.jsxs)(e5.fC,{...n,className:e7().root,defaultValue:t[0].label,orientation:"vertical",children:[(0,i.jsx)(e5.aV,{className:e7().list,"aria-label":"content tabs",children:t.map((e,t)=>{let{label:n}=e;return(0,i.jsx)(e5.xz,{className:e7().trigger,value:n,children:(0,i.jsx)(a.bL,{className:e7().triggerText,component:"span",color:"inherit",children:n})},"".concat(n,"-trig").concat(t+1))})}),t.map((e,t)=>{let{label:n,content:o}=e;return(0,i.jsx)(e5.VY,{className:e7().content,value:n,children:(0,i.jsx)(a.bn,{className:e7().scrollArea,children:o})},"".concat(n,"-content").concat(t+1))})]})};var tt=n(25661),tn=n(88241),ti=n(32554),ta=n(44621),to=n.n(ta);let tl=e=>{var t,n;let{inline:o,...l}=e,r=(0,ti.p)();if(!0===o)return(0,i.jsx)("code",{...l,className:to().inlineCode});let s=(()=>{var e,t,n,i,a;if((null===(t=l.node)||void 0===t?void 0:null===(e=t.data)||void 0===e?void 0:e.meta)!==void 0){let e=null===(i=l.node)||void 0===i?void 0:null===(n=i.data)||void 0===n?void 0:n.meta;return{fileName:e.substring(1,e.length-1),language:null===(a=l.className)||void 0===a?void 0:a.split("-")[1]}}return null})(),c=null===(t=/language-(\w+)/.exec(null!==(n=l.className)&&void 0!==n?n:""))||void 0===t?void 0:t[1];return(0,i.jsx)(a.W,{...l,onCopy:()=>{g.Xe.track({event:"page-type:copy-snippet",framework:r})},language:c,code:String(l.children).replace(/\n$/,""),title:null==s?void 0:s.fileName})},tr=e=>{let{markdown:t}=e;return(0,i.jsx)(tt.D,{children:t,linkTarget:"_blank",remarkPlugins:[tn.Z],components:{code:e=>(0,i.jsx)(tl,{...e}),h1:e=>(0,i.jsx)(a.bL,{children:e.children,component:"h1",variant:"h1"}),h2:e=>(0,i.jsx)(a.bL,{children:e.children,component:"h2",variant:"h2"}),h3:e=>(0,i.jsx)(a.bL,{children:e.children,component:"h3",variant:"h3"}),h4:e=>(0,i.jsx)(a.bL,{children:e.children,component:"h4",variant:"h4"}),h5:e=>(0,i.jsx)(a.bL,{children:e.children,component:"h4",variant:"h4"}),p:e=>(0,i.jsx)(a.bL,{className:to().section,children:e.children,component:"p",variant:"normal"}),pre:e=>(0,i.jsx)(a.bL,{className:to().section,children:e.children,component:"pre",variant:"normal"})}})};async function ts(e){let t=JSON.parse(e),{errors:n,documentation:i}=await Y.managerClient.documentation.read({kind:t.kind,data:t.data});if(n.length>0)throw n;return i}var tc=n(65480),td=n.n(tc);let tm=e=>{var t;let{model:n}=e,o=(0,ti.p)(),l=(t={kind:"PageSnippet",data:{model:n}},(0,eC.QT)(ts,[JSON.stringify(t)])),{completeStep:r}=(0,er.k)();return 0===l.length?null:(0,i.jsxs)(a.ae,{size:"small",trigger:(0,i.jsx)(a.E,{color:"grey",onClick:()=>{r("codePage"),g.Xe.track({event:"page-type:open-snippet",framework:o})},startIcon:"code",children:"Page snippet"}),children:[(0,i.jsx)(a.al,{icon:"code",title:"Page snippet"}),(0,i.jsx)("section",{className:td().content,children:l.length>1?(0,i.jsx)(te,{style:{flex:1},tabs:l.map((e,t)=>{let{label:n,content:a}=e;return{label:null!=n?n:"Tab ".concat(t+1),content:(0,i.jsx)(tr,{markdown:a})}})}):(0,i.jsx)(a.bn,{style:{flex:1,padding:16},children:(0,i.jsx)(tr,{markdown:l[0].content})})})]})},th=e=>{let{model:t}=e;return(0,i.jsx)("div",{children:(0,i.jsx)(U.h,{children:(0,i.jsx)(s.Suspense,{fallback:(0,i.jsx)(a.E,{color:"grey",startIcon:"code",children:"Page snippet"}),children:(0,i.jsx)(tm,{model:t})})})})},tu=()=>{let e=(0,r.useRouter)(),{selectedCustomType:t}=(0,c.v9)(t=>({selectedCustomType:(0,e3.Jk)(t,(0,u.Ag)(e.query))}));return((0,s.useEffect)(()=>{t&&(0,e8.TG)(t)||e.replace("/")},[t,e]),t&&(0,e8.TG)(t))?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l(),{children:(0,i.jsxs)("title",{children:[t.local.label," - Slice Machine"]})}),(0,i.jsx)(tp,{customType:t.local})]}):(0,i.jsx)(p.LN,{})},tp=e=>{let{customType:t}=e;return null===t?(0,i.jsx)(p.LN,{}):(0,i.jsx)(p.LN,{children:(0,i.jsx)(S,{initialCustomType:T.Dc.fromSM(t),children:e=>{var n;let{actionQueueStatus:o,customType:l,setCustomType:r}=e,s=(0,m.y6)(l),c=u.cd[t.format],f=v.$[t.format];return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(p.wd,{children:[(0,i.jsx)(p.Xq,{url:c.tablePagePathname}),(0,i.jsxs)(p.Cx,{children:[(0,i.jsx)(d.g,{children:f.name({start:!0,plural:!0})}),(0,i.jsx)(d.g,{active:!0,children:null!==(n=l.label)&&void 0!==n?n:l.id})]}),(0,i.jsxs)(p.K2,{children:[(0,i.jsx)(h.X,{status:o}),"page"===l.format?(0,i.jsx)(th,{model:l}):void 0,(0,i.jsx)(e2._,{isChangesLocal:!0,format:s,customType:l,setLocalCustomType:r})]})]}),(0,i.jsx)(p.RN,{children:(0,i.jsx)(a.D,{flexDirection:"column",minWidth:0,children:(0,i.jsx)(e4,{})})})]})}})})}},84879:function(e,t,n){"use strict";n.d(t,{E:function(){return l}});var i=n(18566),a=n(80148);async function o(){return a.managerClient.project.getSliceMachineConfig()}function l(e){var t,n;let[l,r]=[(0,i.QT)(o,[]),async e=>{await a.managerClient.project.writeSliceMachineConfig({config:e}),(0,i.VA)(o,[],e)}],s=async t=>{let n={...l,labs:{...l.labs}};t?n.labs[e]=t:e in n.labs&&delete n.labs[e],0===Object.keys(n.labs).length&&delete n.labs,await r(n)};return[{enabled:null!==(n=null==l?void 0:null===(t=l.labs)||void 0===t?void 0:t[e])&&void 0!==n&&n},s]}},34919: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"}},65480:function(e){e.exports={content:"PageSnippetDialog_content__jIN6d"}},44621:function(e){e.exports={section:"MarkdownRenderer_section__uNS1M",inlineCode:"MarkdownRenderer_inlineCode__lmGTi"}},65375:function(e){e.exports={scrollArea:"ConvertLegacySliceButton_scrollArea__xf3vM",label:"ConvertLegacySliceButton_label__BK0Gd"}}}]);