slice-machine-ui 1.19.2-dev-in-app-guide.5 → 1.19.2-dev-in-app-guide.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/404.html +1 -1
- package/out/_next/static/O_QsTwJGs5cAXzckXHQzY/_buildManifest.js +1 -0
- package/out/_next/static/chunks/{18539003-371d86ea83e7293b.js → 18539003-5d8b6a04053638af.js} +2 -2
- package/out/_next/static/chunks/{482-39cef3a713901788.js → 482-30c0f114c7213fa3.js} +1 -1
- package/out/_next/static/chunks/{125-f0e2eb84ee39757a.js → 505-fa47e200ac3a012d.js} +1 -1
- package/out/_next/static/chunks/{550-e72c08c598051224.js → 550-abf97d3008006056.js} +1 -1
- package/out/_next/static/chunks/{80-821a0b5d4ad61185.js → 80-72d903b2a0bd5dc3.js} +1 -1
- package/out/_next/static/chunks/{840-884e41a48b92e5d3.js → 840-8cec2bbd104111f2.js} +1 -1
- package/out/_next/static/chunks/{904-55ff54caf14254dc.js → 904-a20282f9e2845a25.js} +1 -1
- package/out/_next/static/chunks/958-4f19a7620ce3d103.js +1 -0
- package/out/_next/static/chunks/pages/{_app-e3d1985fca0112ba.js → _app-369daf018e231728.js} +44 -44
- package/out/_next/static/chunks/pages/{changes-e388be4457a43c3a.js → changes-494c71511b2e8989.js} +1 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/{simulator-dda1f32608129e23.js → simulator-7189378fc568f0da.js} +1 -1
- package/out/_next/static/css/31841735992dea23.css +1 -0
- package/out/_next/static/css/58a89606d9ca9093.css +1 -0
- package/out/_next/static/css/5d18ccf403d4649a.css +1 -0
- package/out/_next/static/css/{51597cd1f01c4889.css → 78250665d395ea50.css} +1 -1
- package/out/_next/static/css/{16b41648cd1de03b.css → b0be58d878c0fac3.css} +1 -1
- package/out/_next/static/css/e48f99beffa085f5.css +1 -0
- package/out/changelog.html +1 -1
- package/out/changes.html +1 -1
- package/out/custom-types/[customTypeId].html +1 -1
- package/out/custom-types.html +1 -1
- package/out/index.html +1 -1
- package/out/labs.html +1 -1
- package/out/page-types/[pageTypeId].html +1 -1
- package/out/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
- package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
- package/out/slices.html +1 -1
- package/package.json +7 -7
- package/pages/_app.tsx +3 -3
- package/src/components/Counter/Counter.tsx +0 -2
- package/src/features/inAppGuide/InAppGuideDialog.tsx +7 -29
- package/src/features/inAppGuide/inAppGuideContent.tsx +5 -7
- package/out/_next/static/Ag1OooC7pLkPY26EuNBXB/_buildManifest.js +0 -1
- package/out/_next/static/chunks/958-be627006594efb21.js +0 -1
- package/out/_next/static/css/3e88bd24e38f18d0.css +0 -1
- package/out/_next/static/css/636d0d830ddba7ef.css +0 -1
- package/out/_next/static/css/6e4843007ff41825.css +0 -1
- package/out/_next/static/css/867d8d7ab4a75762.css +0 -1
- /package/out/_next/static/{Ag1OooC7pLkPY26EuNBXB → O_QsTwJGs5cAXzckXHQzY}/_ssgManifest.js +0 -0
package/out/_next/static/chunks/pages/{changes-e388be4457a43c3a.js → changes-494c71511b2e8989.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[849],{21985:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/changes",function(){return t(4920)}])},56577:function(e,n,t){"use strict";t.d(n,{z:function(){return u}});var s=t(62230),i=t(85244),r=t(98240),a=t(52322),o=t(2784),l=t(75289),c=function(e,n){return e?"".concat(e,"-").concat(n):""},d=function(e){switch(e){case"white":case"secondaryMedium":case"secondarySmall":case"secondary":return"#1A1523";default:return"grey01"}},u=(0,o.forwardRef)(function(e,n){var t=e.label,o=e.Icon,u=e.type,x=e.form,h=e.isLoading,m=void 0!==h&&h,f=e.disabled,p=e.onClick,g=e.sx,j=e.iconSize,v=void 0===j?16:j,y=e.iconFill,b=e.variant,_=void 0===b?"primary":b,C=(0,r.Z)(e,["label","Icon","type","form","isLoading","disabled","onClick","sx","iconSize","iconFill","variant"]);return(0,a.jsx)(l.zx,(0,i.Z)((0,s.Z)({ref:n,sx:(0,s.Z)((0,i.Z)((0,s.Z)({},void 0===g?{}:g),{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"}),m?{cursor:"wait !important"}:{}),type:u,form:x,disabled:void 0!==f&&f||m,onClick:m?void 0:p,variant:_},C),{children:m?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(l.$j,{size:v,color:d(_),"data-cy":c(C["data-cy"],"spinner")}),o&&t]}):(0,a.jsxs)(a.Fragment,{children:[o&&(0,a.jsx)(o,{size:v,fill:y,"data-cy":c(C["data-cy"],"icon")}),t]})}))})},59469:function(e,n,t){"use strict";var s=t(62230),i=t(52322),r=t(75289);n.Z=function(e){var n=e.elems,t=e.renderElem,a=e.defineElementKey,o=e.gridTemplateMinPx,l=e.gridGap,c=e.sx;return(0,i.jsx)(r.xu,{as:"section",sx:(0,s.Z)({display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(".concat(void 0===o?"320px":o,", 1fr))"),gridGap:void 0===l?"16px":l,pt:2},c),children:n.map(function(e,n){return e?(0,i.jsx)("span",{children:t(e,n)},"".concat(a(e),"-").concat(n+1)):null})})}},4920:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return ed}});var s=t(52322),i=t(22715),r=t(2784),a=t(97729),o=t.n(a),l=t(65077),c=t(56580),d=t(22031),u=t(75289),x=t(951),h=function(e){var n=e.children;return(0,s.jsx)(u.kC,{sx:{alignItems:"center",justifyContent:"space-between",mt:"8px",bg:"grey02",borderRadius:4,padding:"12px 16px"},children:n})},m=t(39097),f=t.n(m),p=t(7819),g=t(34728),j=t(67445),v=function(e){var n=e.ct,t=e.status,i=e.authStatus,r=e.isOnline;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(u.xu,{as:"td",style:{width:"40%"},children:(0,s.jsx)(u.xv,{sx:{fontWeight:500},children:n.label})}),(0,s.jsx)(u.xu,{as:"td",style:{width:"40%"},children:n.id}),(0,s.jsx)(u.xu,{as:"td",style:{width:"20%"},children:(0,s.jsx)(g.O,{authStatus:i,isOnline:r,modelStatus:t,modelType:"CustomType"})})]})},y=function(e){var n=e.customTypes,t=e.modelsStatuses,i=e.authStatus,r=e.isOnline;return(0,s.jsxs)(u.xu,{as:"table","data-legacy-component":!0,children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{className:"transparent small",children:[(0,s.jsx)(u.xu,{as:"th",sx:{width:"40%",fontWeight:600},children:"Name"}),(0,s.jsx)(u.xu,{as:"th",sx:{width:"40%",fontWeight:600},children:"API ID"}),(0,s.jsx)(u.xu,{as:"th",sx:{width:"20%",fontWeight:600},children:"Status"})]})}),(0,s.jsx)("tbody",{children:n.map(function(e){return(0,p.TG)(e)?(0,s.jsx)(f(),{passHref:!0,href:j.cd[e.local.format].getBuilderPagePathname(e.local.id),legacyBehavior:!0,children:(0,s.jsx)("tr",{tabIndex:0,children:(0,s.jsx)(v,{ct:e.local,status:t.customTypes[e.local.id],authStatus:i,isOnline:r,modelsStatuses:t},e.local.id)})},e.local.id):(0,s.jsx)("tr",{tabIndex:0,className:"disabled",children:(0,s.jsx)(v,{ct:e.remote,status:t.customTypes[e.remote.id],authStatus:i,isOnline:r,modelsStatuses:t},e.remote.id)})})})]})},b=t(59469),_=t(84449),C=t(5479),S=t(47731),T=t(32681),D=t(65958),k=function(e){var n=e.unSyncedCustomTypes,t=e.unSyncedSlices,i=e.modelsStatuses,r=e.authStatus,a=e.isOnline,o=(0,S.H)(),l=o.modalPayload,c=o.onOpenModal,d=l.sliceFilterFn,m=l.defaultVariationSelector,f=t.filter(function(e){return i.slices[e.model.id]!==T.G.Deleted});return(0,s.jsxs)(s.Fragment,{children:[n.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(h,{children:(0,s.jsxs)(u.xu,{children:[(0,s.jsx)(u.xv,{variant:"heading",children:"Types"}),(0,s.jsx)(u.xv,{variant:"grey",sx:{ml:"8px"},children:n.length})]})}),(0,s.jsx)(y,{customTypes:n,modelsStatuses:i,authStatus:r,isOnline:a})]}),t.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(u.xu,{sx:{mb:"8px"},children:(0,s.jsxs)(h,{children:[(0,s.jsxs)(u.xu,{children:[(0,s.jsx)(u.xv,{variant:"heading",children:"Slices"}),(0,s.jsx)(u.xv,{variant:"grey",sx:{ml:"8px"},children:t.length})]}),(0,s.jsxs)(u.xu,{children:[t.some(function(e){return(0,C.cx)(e)>0&&i.slices[e.model.id]!==T.G.Deleted})&&(0,s.jsxs)(u.xv,{sx:{mr:3,color:"warning02",fontSize:"12px",lineHeight:"16px",fontWeight:600},children:[(0,s.jsx)(x.sQg,{size:16,style:{marginRight:"4px",position:"relative",top:"3px"}}),"Missing Screenshots"]}),(0,s.jsxs)(u.zx,{variant:"darkSmall",onClick:function(){return c({sliceFilterFn:function(e){return e}})},children:[(0,s.jsx)(x.hOO,{style:{color:"#FFF",fontSize:"15px",position:"relative",top:"3px",marginRight:"4px"}})," ","Update all screenshots"]})]})]})}),(0,s.jsx)(b.Z,{gridGap:"32px 16px",elems:t,gridTemplateMinPx:"305px",defineElementKey:function(e){return e.model.name},renderElem:function(e){var n=i.slices[e.model.id];return(0,s.jsx)(D.b,{action:{type:"status",authStatus:r,isOnline:a,modelStatus:n},isDeleted:n===T.G.Deleted,mode:"navigation",onUpdateScreenshot:function(){c({sliceFilterFn:function(n){return n.filter(function(n){return n.model.id===e.model.id})}})},slice:e,variant:"solid"})}}),(0,s.jsx)(_.Z,{slices:d(f),defaultVariationSelector:m})]})]})},O=t(91914),w=function(){return(0,s.jsx)(u.kC,{sx:{justifyContent:"center",alignItems:"center",flex:1},children:(0,s.jsxs)(u.kC,{sx:{flexDirection:"column",alignItems:"center",transform:"translateY(-50%)"},children:[(0,s.jsx)(O.wQ1,{size:48}),(0,s.jsx)(u.xv,{sx:{fontWeight:600,fontSize:"24px",lineHeight:"32px",mb:"8px",mt:"2px"},children:"No internet connection"}),(0,s.jsx)(u.xv,{sx:{fontSize:"13px",lineHeight:"24px"},children:"You need a stable internet connection to review and push changes"})]})})},Z=t(90374),E=function(){var e=(0,Z.Z)().openLoginModal;return(0,s.jsx)(u.kC,{sx:{justifyContent:"center",alignItems:"center",flex:1},children:(0,s.jsxs)(u.kC,{sx:{flexDirection:"column",alignItems:"center",transform:"translateY(-50%)"},children:[(0,s.jsx)(u.xv,{sx:{fontWeight:600,fontSize:"24px",lineHeight:"32px",mb:"8px",mt:"2px"},children:"Could not access your repository"}),(0,s.jsx)(u.xv,{sx:{fontSize:"13px",lineHeight:"24px"},children:"You need to log in to Prismic in order to push your changes."}),(0,s.jsx)(u.zx,{sx:{mt:"24px"},onClick:function(){return e()},children:"Log in to Prismic"})]})})},R=t(5632),N=t.n(R),z=t(2754),F=t(34543),I=t(62230),M=t(85244),H=t(98240),P=t(6277);t(25977);var W={primary:"_1ecs97daq8 _1ecs97daxl _1ecs97daq2 _1ecs97daxf _1ecs97daqa _1ecs97daxn",secondary:"_1ecs97da16 _1ecs97d9yr _1ecs97da10 _1ecs97d9yl _1ecs97da18 _1ecs97d9yt"},A={normal:"ovkapw1",smallBold:"ovkapw2",inherit:"ovkapw3 _1ecs97decl"},q=function(e){var n=e.children,t=e.color,a=e.endIcon,o=e.href,l=e.textVariant,c=void 0===l?"smallBold":l,d=(0,H.Z)(e,["children","color","endIcon","href","textVariant"]);return(0,s.jsxs)("a",(0,M.Z)((0,I.Z)({href:o,target:"_blank",rel:"noreferrer"},d),{className:(0,P.Z)("ovkapw0 _1ecs97de7i _1ecs97decf _1ecs97de7k _1ecs97de7q",W[void 0===t?"primary":t]),children:[(0,s.jsx)(i.xv,{component:"span",color:"inherit",variant:c,children:n}),(0,r.isValidElement)(a)?(0,r.cloneElement)(a,{className:(0,P.Z)(a.props.className,"_1ecs97depq",A[c])}):null]}))},B=t(39092),G=function(){var e,n=(e=(0,c.v9)(function(e){return{repoName:(0,B.MY)(e)}}).repoName,"https://".concat(e,".prismic.io/documents/working"));return(0,s.jsxs)(z.R$,{style:{alignSelf:"center",marginTop:i.TV.size[72]},children:[(0,s.jsx)(z.u2,{children:(0,s.jsx)(i.Ee,{src:"/blank-slate-changes-uptodate.png",sizing:"cover"})}),(0,s.jsxs)(z.T9,{children:[(0,s.jsx)(z._T,{children:"Everything up-to-date"}),(0,s.jsx)(z.nf,{children:"You have no changes staged. Your changes appear here after you have saved them, while they're waiting to be pushed to the Page Builder. Ready to get going?"}),(0,s.jsxs)(z.Qj,{children:[(0,s.jsx)(i.zx,{onClick:function(){N().push("/")},children:"Create a page type"}),(0,s.jsx)(q,{endIcon:(0,s.jsx)(F.AlO,{}),textVariant:"normal",href:n,children:"Create content"})]})]})]})},U=t(79096),L=t(67764),V=t(32665),Y=t(3098),X=t(56577),Q=t(24340),$=t(77174),J=t(49471),K=t(40432),ee=t(78656),en=function(e){var n=e.ctName,t=e.numberOfDocuments,i=e.link,r=e.isOverLimit;return(0,s.jsxs)(u.Zb,{sx:{mb:12},variant:"drawerCard","data-cy":"AssociatedDocumentsCard-".concat(n),children:[(0,s.jsxs)(u.kC,{sx:{flexDirection:"column"},children:[(0,s.jsx)(u.xv,{children:n}),(0,s.jsxs)(u.xv,{sx:{color:"textClear",fontSize:"12px",lineHeight:"16px"},children:[t," documents"]})]}),(0,s.jsx)(u.rU,{href:i,target:"_blank",variant:"cardSmall",sx:{color:void 0!==r&&r?"danger":"purple08"},children:"View documents"})]})},et=function(e){var n=e.format,t=e.id,i=e.name;return(0,s.jsxs)(u.Zb,{sx:{mb:12},variant:"drawerCard","data-cy":"CustomTypesReferencesCard-".concat(i),children:[(0,s.jsxs)(u.kC,{sx:{flexDirection:"column"},children:[(0,s.jsx)(u.xv,{children:i}),(0,s.jsx)(u.xv,{sx:{color:"textClear",fontSize:"12px",lineHeight:"16px"},children:"Missing Slices"})]}),(0,s.jsxs)(u.rU,{href:j.cd[n].getBuilderPagePathname(t),target:"_blank",variant:"cardSmall",children:["View ",ee.$[n].name({start:!1,plural:!1})]},t)]})},es=t(79797),ei=t(54132),er=function(e){var n=e.isOpen,t=e.title,i=e.footer,r=e.explanations,a=(0,Z.Z)().closeModals;return(0,s.jsx)(es.Z,{placement:"right",open:n,level:null,onClose:a,width:496,children:(0,s.jsx)(ei.Z,{radius:"0px",bodySx:{bg:"white",padding:24,flex:1,display:"flex",flexDirection:"column",overflow:"scroll"},footerSx:{p:0},sx:{flexDirection:"column",display:"flex",height:"100%",border:"none"},borderFooter:!0,Header:function(){return(0,s.jsxs)(u.kC,{sx:{p:"16px",alignItems:"center",justifyContent:"space-between",borderBottom:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.borders))}},children:[(0,s.jsx)(u.kC,{sx:{alignItems:"center"},children:(0,s.jsx)(u.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:t})}),(0,s.jsx)(u.x8,{type:"button",onClick:function(){return a()}})]})},Footer:function(){return(0,s.jsx)(u.kC,{sx:{flexDirection:"column",justifyContent:"center",alignItems:"center",paddingRight:16,borderTop:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.darkBorders))},backgroundColor:"white",padding:20},children:i})},children:r})})},ea=function(e){var n=e.onToggle,t=e.isConfirmed,i=e.sx;return(0,s.jsxs)(u.kC,{sx:(0,I.Z)({borderRadius:6,flexDirection:"column",backgroundColor:"grey03",padding:12,width:"100%"},i),children:[(0,s.jsx)(u.xv,{sx:{fontWeight:"bold",mb:2},children:"Are you sure to proceed?"}),(0,s.jsxs)(u.__,{sx:{mt:"4px",py:1},variant:"large",children:[(0,s.jsx)(u.XZ,{defaultChecked:t,onChange:n,variant:"forms.checkbox.dark"}),"Delete these Documents"]})]})},eo=function(e){var n=e.pushChanges,t=(0,r.useState)(!1),i=t[0],a=t[1],o=(0,c.v9)(function(e){return{isDeleteDocumentsDrawerOpen:(0,$.gP)(e,Q.q.SOFT_DELETE_DOCUMENTS_DRAWER),remoteOnlyCustomTypes:(0,J.Ch)(e).filter(p.yp),modalData:e.pushChanges}}),l=o.isDeleteDocumentsDrawerOpen,d=o.remoteOnlyCustomTypes,x=o.modalData,h=(0,Z.Z)(),m=h.closeModals,f=h.openToaster;if(!l)return null;if((null==x?void 0:x.type)!=="SOFT")return f("No change data",K.Jf.ERROR),null;var g=x.details.customTypes.map(function(e){var n,t=d.find(function(n){return(0,p.n5)(n)===e.id});return void 0===t?null:(0,s.jsx)(en,{isOverLimit:!0,ctName:null!==(n=t.remote.label)&&void 0!==n?n:t.remote.id,link:e.url,numberOfDocuments:e.numberOfDocuments},e.id)});return(0,s.jsx)(er,{isOpen:l,title:"Confirm deletion",footer:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ea,{onToggle:function(){a(!i)},isConfirmed:i,sx:{mb:10}}),(0,s.jsx)(X.z,{label:"Push changes",variant:"primary",onClick:function(){m(),n(i)},disabled:!i,sx:{fontWeight:"bold",color:"white",borderRadius:6,width:"100%"}})]}),explanations:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(u.xv,{sx:{fontWeight:"bold",mb:1,lineHeight:"24px"},children:"This action will also delete Documents."}),(0,s.jsxs)(u.xv,{sx:{mb:24},children:[x.details.customTypes.length>1?"These types have":"This type has"," ","associated Documents, which will also be deleted. This might create broken links in your repository."]}),g]})})},el=function(e){var n=e.pushChanges,t=(0,c.v9)(function(e){return{isDeleteDocumentsDrawerOpen:(0,$.gP)(e,Q.q.HARD_DELETE_DOCUMENTS_DRAWER),remoteOnlyCustomTypes:(0,J.Ch)(e).filter(p.yp),modalData:e.pushChanges}}),i=t.isDeleteDocumentsDrawerOpen,r=t.remoteOnlyCustomTypes,a=t.modalData,o=(0,Z.Z)(),l=o.closeModals,d=o.openToaster;if(!i)return null;if((null==a?void 0:a.type)!=="HARD")return d("No change data",K.Jf.ERROR),null;var x=a.details.customTypes.map(function(e){var n,t=r.find(function(n){return(0,p.n5)(n)===e.id});return void 0===t?null:(0,s.jsx)(en,{isOverLimit:!0,ctName:null!==(n=t.remote.label)&&void 0!==n?n:t.remote.id,link:e.url,numberOfDocuments:e.numberOfDocuments},e.id)});return(0,s.jsx)(er,{isOpen:i,title:"Manual action required",footer:(0,s.jsx)(X.z,{label:"Try again",variant:"primary",onClick:function(){l(),n(!1)},sx:{fontWeight:"bold",color:"white",borderRadius:6,width:"100%"}}),explanations:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(u.xv,{sx:{fontWeight:"bold",mb:1,lineHeight:"24px"},children:["Your type",a.details.customTypes.length>1&&"s"," cannot be deleted."]}),(0,s.jsxs)(u.xv,{sx:{mb:24},children:[a.details.customTypes.length>1?"These types have":"This type has"," ","too many associated Documents. Archive and delete these Documents manually and then try deleting the types again."]}),x]})})},ec=function(e){var n=e.pushChanges,t=(0,c.v9)(function(e){return{isOpen:(0,$.gP)(e,Q.q.REFERENCES_MISSING_DRAWER),localCustomTypes:(0,J.Ch)(e).filter(p.TG),modalData:e.pushChanges}}),i=t.isOpen,r=t.modalData,a=t.localCustomTypes,o=(0,Z.Z)(),l=o.closeModals,d=o.openToaster;if(!i)return null;if((null==r?void 0:r.details)===void 0)return d("No change data",K.Jf.ERROR),null;var x=(null==r?void 0:r.details.customTypes.length)>1,h=r.details.customTypes.map(function(e){var n,t=a.find(function(n){return(0,p.n5)(n)===e.id});return void 0===t?null:(0,s.jsx)(et,{format:t.local.format,id:t.local.id,name:null!==(n=t.local.label)&&void 0!==n?n:t.local.id})});return(0,s.jsx)(er,{isOpen:i,title:"Missing Slices",footer:(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(X.z,{label:"Try again",variant:"primary",onClick:function(){l(),n(!1)},sx:{fontWeight:"bold",color:"white",borderRadius:6,width:"100%"}})}),explanations:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(u.xv,{sx:{fontWeight:"bold",mb:1,lineHeight:"24px"},children:["You have",x?"":" a"," type",x?"s":""," that reference"," ",x?"":"s"," one or more missing Slices"]}),(0,s.jsxs)(u.xv,{sx:{mb:24},children:["Before pushing, remove references to any missing Slices by opening"," ","the affected type",x?"s":""," and clicking the"," ",(0,s.jsx)("b",{children:"Save"})," button."]}),h]})})},ed=function(){var e=(0,L.X)(),n=e.unSyncedSlices,t=e.unSyncedCustomTypes,a=e.modelsStatuses,u=e.authStatus,x=e.isOnline,h=(0,r.useMemo)(function(){var e;return{changedSlices:n.map(function(e){return{slice:e,status:a.slices[e.model.id]}}).filter(function(e){return L.O.includes(e.status)}),changedCustomTypes:t.map(function(e){return(0,p.TG)(e)?e.local:e.remote}).map(function(e){return{customType:e,status:a.customTypes[e.id]}}).filter(function(e){return L.O.includes(e.status)})}},[n,t,a]),m=h.changedSlices,f=h.changedCustomTypes,g=(0,Z.Z)(),j=g.pushChanges,v=g.closeModals,y=(0,c.v9)(function(e){return{isSyncing:(0,V.hg)(e,Y.z.CHANGES_PUSH)}}).isSyncing;(0,r.useEffect)(function(){return function(){v()}},[]);var b=n.length+t.length,_=function(e){return j({confirmDeleteDocuments:e,changedSlices:m,changedCustomTypes:f})},C=(0,r.useMemo)(function(){return x?u===U.t.UNAUTHORIZED||u===U.t.FORBIDDEN?(0,s.jsx)(E,{}):0===b?(0,s.jsx)(G,{}):(0,s.jsx)(k,{unSyncedSlices:n,unSyncedCustomTypes:t,modelsStatuses:a,authStatus:u,isOnline:x}):(0,s.jsx)(w,{})},[x,u,b,n,t,a,]);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o(),{children:(0,s.jsx)("title",{children:"Changes - Slice Machine"})}),(0,s.jsxs)(d.LN,{children:[(0,s.jsxs)(d.wd,{children:[(0,s.jsx)(d.Cx,{folder:"Changes"}),(0,s.jsx)(d.K2,{children:(0,s.jsx)(i.zx,{onClick:function(){return _(!1)},loading:y,disabled:0===b||!x||u===U.t.UNAUTHORIZED||u===U.t.FORBIDDEN||y,"data-cy":"push-changes",children:"Push Changes"})})]}),(0,s.jsx)(d.RN,{children:(0,s.jsxs)(l.xR,{sx:{display:"flex",flexDirection:"column"},children:[C,(0,s.jsx)(eo,{pushChanges:_}),(0,s.jsx)(el,{pushChanges:_}),(0,s.jsx)(ec,{pushChanges:_})]})})]})]})}},2754:function(e,n,t){"use strict";t.d(n,{R$:function(){return d},Qj:function(){return f},T9:function(){return x},nf:function(){return m},u2:function(){return u},_T:function(){return h}});var s=t(67557),i=t(62230),r=t(85244),a=t(98240),o=t(52322),l=t(6277),c=t(22715);t(41236);var d=function(e){var n=e.backgroundImage,t=e.style,c=(0,a.Z)(e,["backgroundImage","style"]),d=void 0!==n;return(0,o.jsx)("article",(0,r.Z)((0,i.Z)({},c),{className:(0,l.Z)("_18bjhbz0 _1ecs97de7i _1ecs97de7j _1ecs97de7k _1ecs97de7t _1ecs97deqn _1ecs97deqp _1ecs97deqr _1ecs97d39c _1ecs97d3gp _1ecs97de99 _1ecs97deal _1ecs97deaz _1ecs97de87",(0,s.Z)({},"_18bjhbz1 _1ecs97de8f _1ecs97ded9",d)),style:(0,i.Z)({backgroundImage:d?"url(".concat(n,")"):void 0},t)}))},u=function(e){return(0,o.jsx)("div",(0,r.Z)((0,i.Z)({},e),{className:"_1ecs97de7i _1ecs97de7j _1ecs97de7k _1ecs97de7t _1ecs97d6f0 _1ecs97d6md _1ecs97dear _1ecs97deb3 _1ecs97de87"}))},x=function(e){return(0,o.jsx)("div",(0,r.Z)((0,i.Z)({},e),{className:"_18bjhbz3 _1ecs97de7i _1ecs97de7j _1ecs97de7k _1ecs97de7t _1ecs97denu"}))},h=function(e){return(0,o.jsx)(c.xv,(0,r.Z)((0,i.Z)({},e),{className:"_18bjhbz4"}))},m=function(e){return(0,o.jsx)(c.xv,(0,r.Z)((0,i.Z)({},e),{className:"_18bjhbz5",color:"grey11"}))},f=function(e){return(0,o.jsx)(c.hE,(0,r.Z)((0,i.Z)({},e),{className:"_18bjhbz6 _1ecs97dehj _1ecs97de7q _1ecs97delp",size:"medium",variant:"secondary"}))}},41236:function(){},25977:function(){}},function(e){e.O(0,[789,123,918,958,80,774,888,179],function(){return e(e.s=21985)}),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[849],{21985:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/changes",function(){return t(4920)}])},56577:function(e,n,t){"use strict";t.d(n,{z:function(){return u}});var s=t(62230),i=t(85244),r=t(98240),o=t(52322),a=t(2784),l=t(75289),c=function(e,n){return e?"".concat(e,"-").concat(n):""},d=function(e){switch(e){case"white":case"secondaryMedium":case"secondarySmall":case"secondary":return"#1A1523";default:return"grey01"}},u=(0,a.forwardRef)(function(e,n){var t=e.label,a=e.Icon,u=e.type,x=e.form,h=e.isLoading,f=void 0!==h&&h,m=e.disabled,p=e.onClick,g=e.sx,j=e.iconSize,v=void 0===j?16:j,y=e.iconFill,b=e.variant,_=void 0===b?"primary":b,C=(0,r.Z)(e,["label","Icon","type","form","isLoading","disabled","onClick","sx","iconSize","iconFill","variant"]);return(0,o.jsx)(l.zx,(0,i.Z)((0,s.Z)({ref:n,sx:(0,s.Z)((0,i.Z)((0,s.Z)({},void 0===g?{}:g),{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"}),f?{cursor:"wait !important"}:{}),type:u,form:x,disabled:void 0!==m&&m||f,onClick:f?void 0:p,variant:_},C),{children:f?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(l.$j,{size:v,color:d(_),"data-cy":c(C["data-cy"],"spinner")}),a&&t]}):(0,o.jsxs)(o.Fragment,{children:[a&&(0,o.jsx)(a,{size:v,fill:y,"data-cy":c(C["data-cy"],"icon")}),t]})}))})},59469:function(e,n,t){"use strict";var s=t(62230),i=t(52322),r=t(75289);n.Z=function(e){var n=e.elems,t=e.renderElem,o=e.defineElementKey,a=e.gridTemplateMinPx,l=e.gridGap,c=e.sx;return(0,i.jsx)(r.xu,{as:"section",sx:(0,s.Z)({display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(".concat(void 0===a?"320px":a,", 1fr))"),gridGap:void 0===l?"16px":l,pt:2},c),children:n.map(function(e,n){return e?(0,i.jsx)("span",{children:t(e,n)},"".concat(o(e),"-").concat(n+1)):null})})}},4920:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return ed}});var s=t(52322),i=t(22715),r=t(2784),o=t(97729),a=t.n(o),l=t(65077),c=t(56580),d=t(22031),u=t(75289),x=t(951),h=function(e){var n=e.children;return(0,s.jsx)(u.kC,{sx:{alignItems:"center",justifyContent:"space-between",mt:"8px",bg:"grey02",borderRadius:4,padding:"12px 16px"},children:n})},f=t(39097),m=t.n(f),p=t(7819),g=t(34728),j=t(67445),v=function(e){var n=e.ct,t=e.status,i=e.authStatus,r=e.isOnline;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(u.xu,{as:"td",style:{width:"40%"},children:(0,s.jsx)(u.xv,{sx:{fontWeight:500},children:n.label})}),(0,s.jsx)(u.xu,{as:"td",style:{width:"40%"},children:n.id}),(0,s.jsx)(u.xu,{as:"td",style:{width:"20%"},children:(0,s.jsx)(g.O,{authStatus:i,isOnline:r,modelStatus:t,modelType:"CustomType"})})]})},y=function(e){var n=e.customTypes,t=e.modelsStatuses,i=e.authStatus,r=e.isOnline;return(0,s.jsxs)(u.xu,{as:"table","data-legacy-component":!0,children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{className:"transparent small",children:[(0,s.jsx)(u.xu,{as:"th",sx:{width:"40%",fontWeight:600},children:"Name"}),(0,s.jsx)(u.xu,{as:"th",sx:{width:"40%",fontWeight:600},children:"API ID"}),(0,s.jsx)(u.xu,{as:"th",sx:{width:"20%",fontWeight:600},children:"Status"})]})}),(0,s.jsx)("tbody",{children:n.map(function(e){return(0,p.TG)(e)?(0,s.jsx)(m(),{passHref:!0,href:j.cd[e.local.format].getBuilderPagePathname(e.local.id),legacyBehavior:!0,children:(0,s.jsx)("tr",{tabIndex:0,children:(0,s.jsx)(v,{ct:e.local,status:t.customTypes[e.local.id],authStatus:i,isOnline:r,modelsStatuses:t},e.local.id)})},e.local.id):(0,s.jsx)("tr",{tabIndex:0,className:"disabled",children:(0,s.jsx)(v,{ct:e.remote,status:t.customTypes[e.remote.id],authStatus:i,isOnline:r,modelsStatuses:t},e.remote.id)})})})]})},b=t(59469),_=t(84449),C=t(5479),S=t(47731),T=t(32681),D=t(65958),k=function(e){var n=e.unSyncedCustomTypes,t=e.unSyncedSlices,i=e.modelsStatuses,r=e.authStatus,o=e.isOnline,a=(0,S.H)(),l=a.modalPayload,c=a.onOpenModal,d=l.sliceFilterFn,f=l.defaultVariationSelector,m=t.filter(function(e){return i.slices[e.model.id]!==T.G.Deleted});return(0,s.jsxs)(s.Fragment,{children:[n.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(h,{children:(0,s.jsxs)(u.xu,{children:[(0,s.jsx)(u.xv,{variant:"heading",children:"Types"}),(0,s.jsx)(u.xv,{variant:"grey",sx:{ml:"8px"},children:n.length})]})}),(0,s.jsx)(y,{customTypes:n,modelsStatuses:i,authStatus:r,isOnline:o})]}),t.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(u.xu,{sx:{mb:"8px"},children:(0,s.jsxs)(h,{children:[(0,s.jsxs)(u.xu,{children:[(0,s.jsx)(u.xv,{variant:"heading",children:"Slices"}),(0,s.jsx)(u.xv,{variant:"grey",sx:{ml:"8px"},children:t.length})]}),(0,s.jsxs)(u.xu,{children:[t.some(function(e){return(0,C.cx)(e)>0&&i.slices[e.model.id]!==T.G.Deleted})&&(0,s.jsxs)(u.xv,{sx:{mr:3,color:"warning02",fontSize:"12px",lineHeight:"16px",fontWeight:600},children:[(0,s.jsx)(x.sQg,{size:16,style:{marginRight:"4px",position:"relative",top:"3px"}}),"Missing Screenshots"]}),(0,s.jsxs)(u.zx,{variant:"darkSmall",onClick:function(){return c({sliceFilterFn:function(e){return e}})},children:[(0,s.jsx)(x.hOO,{style:{color:"#FFF",fontSize:"15px",position:"relative",top:"3px",marginRight:"4px"}})," ","Update all screenshots"]})]})]})}),(0,s.jsx)(b.Z,{gridGap:"32px 16px",elems:t,gridTemplateMinPx:"305px",defineElementKey:function(e){return e.model.name},renderElem:function(e){var n=i.slices[e.model.id];return(0,s.jsx)(D.b,{action:{type:"status",authStatus:r,isOnline:o,modelStatus:n},isDeleted:n===T.G.Deleted,mode:"navigation",onUpdateScreenshot:function(){c({sliceFilterFn:function(n){return n.filter(function(n){return n.model.id===e.model.id})}})},slice:e,variant:"solid"})}}),(0,s.jsx)(_.Z,{slices:d(m),defaultVariationSelector:f})]})]})},w=t(91914),O=function(){return(0,s.jsx)(u.kC,{sx:{justifyContent:"center",alignItems:"center",flex:1},children:(0,s.jsxs)(u.kC,{sx:{flexDirection:"column",alignItems:"center",transform:"translateY(-50%)"},children:[(0,s.jsx)(w.wQ1,{size:48}),(0,s.jsx)(u.xv,{sx:{fontWeight:600,fontSize:"24px",lineHeight:"32px",mb:"8px",mt:"2px"},children:"No internet connection"}),(0,s.jsx)(u.xv,{sx:{fontSize:"13px",lineHeight:"24px"},children:"You need a stable internet connection to review and push changes"})]})})},Z=t(90374),E=function(){var e=(0,Z.Z)().openLoginModal;return(0,s.jsx)(u.kC,{sx:{justifyContent:"center",alignItems:"center",flex:1},children:(0,s.jsxs)(u.kC,{sx:{flexDirection:"column",alignItems:"center",transform:"translateY(-50%)"},children:[(0,s.jsx)(u.xv,{sx:{fontWeight:600,fontSize:"24px",lineHeight:"32px",mb:"8px",mt:"2px"},children:"Could not access your repository"}),(0,s.jsx)(u.xv,{sx:{fontSize:"13px",lineHeight:"24px"},children:"You need to log in to Prismic in order to push your changes."}),(0,s.jsx)(u.zx,{sx:{mt:"24px"},onClick:function(){return e()},children:"Log in to Prismic"})]})})},R=t(5632),N=t.n(R),z=t(2754),F=t(34543),I=t(62230),M=t(85244),H=t(98240),P=t(6277);t(25977);var W={primary:"_1ecs97dbfw _1ecs97dbn9 _1ecs97dbfq _1ecs97dbn3 _1ecs97dbfy _1ecs97dbnb",secondary:"_1ecs97dan6 _1ecs97dakr _1ecs97dan0 _1ecs97dakl _1ecs97dan8 _1ecs97dakt"},A={normal:"ovkapw1",smallBold:"ovkapw2",inherit:"ovkapw3 _1ecs97df9o"},B=function(e){var n=e.children,t=e.color,o=e.endIcon,a=e.href,l=e.textVariant,c=void 0===l?"smallBold":l,d=(0,H.Z)(e,["children","color","endIcon","href","textVariant"]);return(0,s.jsxs)("a",(0,M.Z)((0,I.Z)({href:a,target:"_blank",rel:"noreferrer"},d),{className:(0,P.Z)("ovkapw0 _1ecs97df4i _1ecs97df9i _1ecs97df4k _1ecs97df4q",W[void 0===t?"primary":t]),children:[(0,s.jsx)(i.xv,{component:"span",color:"inherit",variant:c,children:n}),(0,r.isValidElement)(o)?(0,r.cloneElement)(o,{className:(0,P.Z)(o.props.className,"_1ecs97dfmt",A[c])}):null]}))},G=t(39092),U=function(){var e,n=(e=(0,c.v9)(function(e){return{repoName:(0,G.MY)(e)}}).repoName,"https://".concat(e,".prismic.io/documents/working"));return(0,s.jsxs)(z.R$,{style:{alignSelf:"center",marginTop:i.TV.size[72]},children:[(0,s.jsx)(z.u2,{children:(0,s.jsx)(i.Ee,{src:"/blank-slate-changes-uptodate.png",sizing:"cover"})}),(0,s.jsxs)(z.T9,{children:[(0,s.jsx)(z._T,{children:"Everything up-to-date"}),(0,s.jsx)(z.nf,{children:"You have no changes staged. Your changes appear here after you have saved them, while they're waiting to be pushed to the Page Builder. Ready to get going?"}),(0,s.jsxs)(z.Qj,{children:[(0,s.jsx)(i.zx,{onClick:function(){N().push("/")},children:"Create a page type"}),(0,s.jsx)(B,{endIcon:(0,s.jsx)(F.AlO,{}),textVariant:"normal",href:n,children:"Create content"})]})]})]})},L=t(79096),V=t(67764),Y=t(32665),q=t(3098),X=t(56577),Q=t(24340),$=t(77174),J=t(49471),K=t(40432),ee=t(78656),en=function(e){var n=e.ctName,t=e.numberOfDocuments,i=e.link,r=e.isOverLimit;return(0,s.jsxs)(u.Zb,{sx:{mb:12},variant:"drawerCard","data-cy":"AssociatedDocumentsCard-".concat(n),children:[(0,s.jsxs)(u.kC,{sx:{flexDirection:"column"},children:[(0,s.jsx)(u.xv,{children:n}),(0,s.jsxs)(u.xv,{sx:{color:"textClear",fontSize:"12px",lineHeight:"16px"},children:[t," documents"]})]}),(0,s.jsx)(u.rU,{href:i,target:"_blank",variant:"cardSmall",sx:{color:void 0!==r&&r?"danger":"purple08"},children:"View documents"})]})},et=function(e){var n=e.format,t=e.id,i=e.name;return(0,s.jsxs)(u.Zb,{sx:{mb:12},variant:"drawerCard","data-cy":"CustomTypesReferencesCard-".concat(i),children:[(0,s.jsxs)(u.kC,{sx:{flexDirection:"column"},children:[(0,s.jsx)(u.xv,{children:i}),(0,s.jsx)(u.xv,{sx:{color:"textClear",fontSize:"12px",lineHeight:"16px"},children:"Missing Slices"})]}),(0,s.jsxs)(u.rU,{href:j.cd[n].getBuilderPagePathname(t),target:"_blank",variant:"cardSmall",children:["View ",ee.$[n].name({start:!1,plural:!1})]},t)]})},es=t(79797),ei=t(54132),er=function(e){var n=e.isOpen,t=e.title,i=e.footer,r=e.explanations,o=(0,Z.Z)().closeModals;return(0,s.jsx)(es.Z,{placement:"right",open:n,level:null,onClose:o,width:496,children:(0,s.jsx)(ei.Z,{radius:"0px",bodySx:{bg:"white",padding:24,flex:1,display:"flex",flexDirection:"column",overflow:"scroll"},footerSx:{p:0},sx:{flexDirection:"column",display:"flex",height:"100%",border:"none"},borderFooter:!0,Header:function(){return(0,s.jsxs)(u.kC,{sx:{p:"16px",alignItems:"center",justifyContent:"space-between",borderBottom:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.borders))}},children:[(0,s.jsx)(u.kC,{sx:{alignItems:"center"},children:(0,s.jsx)(u.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:t})}),(0,s.jsx)(u.x8,{type:"button",onClick:function(){return o()}})]})},Footer:function(){return(0,s.jsx)(u.kC,{sx:{flexDirection:"column",justifyContent:"center",alignItems:"center",paddingRight:16,borderTop:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.darkBorders))},backgroundColor:"white",padding:20},children:i})},children:r})})},eo=function(e){var n=e.onToggle,t=e.isConfirmed,i=e.sx;return(0,s.jsxs)(u.kC,{sx:(0,I.Z)({borderRadius:6,flexDirection:"column",backgroundColor:"grey03",padding:12,width:"100%"},i),children:[(0,s.jsx)(u.xv,{sx:{fontWeight:"bold",mb:2},children:"Are you sure to proceed?"}),(0,s.jsxs)(u.__,{sx:{mt:"4px",py:1},variant:"large",children:[(0,s.jsx)(u.XZ,{defaultChecked:t,onChange:n,variant:"forms.checkbox.dark"}),"Delete these Documents"]})]})},ea=function(e){var n=e.pushChanges,t=(0,r.useState)(!1),i=t[0],o=t[1],a=(0,c.v9)(function(e){return{isDeleteDocumentsDrawerOpen:(0,$.gP)(e,Q.q.SOFT_DELETE_DOCUMENTS_DRAWER),remoteOnlyCustomTypes:(0,J.Ch)(e).filter(p.yp),modalData:e.pushChanges}}),l=a.isDeleteDocumentsDrawerOpen,d=a.remoteOnlyCustomTypes,x=a.modalData,h=(0,Z.Z)(),f=h.closeModals,m=h.openToaster;if(!l)return null;if((null==x?void 0:x.type)!=="SOFT")return m("No change data",K.Jf.ERROR),null;var g=x.details.customTypes.map(function(e){var n,t=d.find(function(n){return(0,p.n5)(n)===e.id});return void 0===t?null:(0,s.jsx)(en,{isOverLimit:!0,ctName:null!==(n=t.remote.label)&&void 0!==n?n:t.remote.id,link:e.url,numberOfDocuments:e.numberOfDocuments},e.id)});return(0,s.jsx)(er,{isOpen:l,title:"Confirm deletion",footer:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eo,{onToggle:function(){o(!i)},isConfirmed:i,sx:{mb:10}}),(0,s.jsx)(X.z,{label:"Push changes",variant:"primary",onClick:function(){f(),n(i)},disabled:!i,sx:{fontWeight:"bold",color:"white",borderRadius:6,width:"100%"}})]}),explanations:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(u.xv,{sx:{fontWeight:"bold",mb:1,lineHeight:"24px"},children:"This action will also delete Documents."}),(0,s.jsxs)(u.xv,{sx:{mb:24},children:[x.details.customTypes.length>1?"These types have":"This type has"," ","associated Documents, which will also be deleted. This might create broken links in your repository."]}),g]})})},el=function(e){var n=e.pushChanges,t=(0,c.v9)(function(e){return{isDeleteDocumentsDrawerOpen:(0,$.gP)(e,Q.q.HARD_DELETE_DOCUMENTS_DRAWER),remoteOnlyCustomTypes:(0,J.Ch)(e).filter(p.yp),modalData:e.pushChanges}}),i=t.isDeleteDocumentsDrawerOpen,r=t.remoteOnlyCustomTypes,o=t.modalData,a=(0,Z.Z)(),l=a.closeModals,d=a.openToaster;if(!i)return null;if((null==o?void 0:o.type)!=="HARD")return d("No change data",K.Jf.ERROR),null;var x=o.details.customTypes.map(function(e){var n,t=r.find(function(n){return(0,p.n5)(n)===e.id});return void 0===t?null:(0,s.jsx)(en,{isOverLimit:!0,ctName:null!==(n=t.remote.label)&&void 0!==n?n:t.remote.id,link:e.url,numberOfDocuments:e.numberOfDocuments},e.id)});return(0,s.jsx)(er,{isOpen:i,title:"Manual action required",footer:(0,s.jsx)(X.z,{label:"Try again",variant:"primary",onClick:function(){l(),n(!1)},sx:{fontWeight:"bold",color:"white",borderRadius:6,width:"100%"}}),explanations:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(u.xv,{sx:{fontWeight:"bold",mb:1,lineHeight:"24px"},children:["Your type",o.details.customTypes.length>1&&"s"," cannot be deleted."]}),(0,s.jsxs)(u.xv,{sx:{mb:24},children:[o.details.customTypes.length>1?"These types have":"This type has"," ","too many associated Documents. Archive and delete these Documents manually and then try deleting the types again."]}),x]})})},ec=function(e){var n=e.pushChanges,t=(0,c.v9)(function(e){return{isOpen:(0,$.gP)(e,Q.q.REFERENCES_MISSING_DRAWER),localCustomTypes:(0,J.Ch)(e).filter(p.TG),modalData:e.pushChanges}}),i=t.isOpen,r=t.modalData,o=t.localCustomTypes,a=(0,Z.Z)(),l=a.closeModals,d=a.openToaster;if(!i)return null;if((null==r?void 0:r.details)===void 0)return d("No change data",K.Jf.ERROR),null;var x=(null==r?void 0:r.details.customTypes.length)>1,h=r.details.customTypes.map(function(e){var n,t=o.find(function(n){return(0,p.n5)(n)===e.id});return void 0===t?null:(0,s.jsx)(et,{format:t.local.format,id:t.local.id,name:null!==(n=t.local.label)&&void 0!==n?n:t.local.id})});return(0,s.jsx)(er,{isOpen:i,title:"Missing Slices",footer:(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(X.z,{label:"Try again",variant:"primary",onClick:function(){l(),n(!1)},sx:{fontWeight:"bold",color:"white",borderRadius:6,width:"100%"}})}),explanations:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(u.xv,{sx:{fontWeight:"bold",mb:1,lineHeight:"24px"},children:["You have",x?"":" a"," type",x?"s":""," that reference"," ",x?"":"s"," one or more missing Slices"]}),(0,s.jsxs)(u.xv,{sx:{mb:24},children:["Before pushing, remove references to any missing Slices by opening"," ","the affected type",x?"s":""," and clicking the"," ",(0,s.jsx)("b",{children:"Save"})," button."]}),h]})})},ed=function(){var e=(0,V.X)(),n=e.unSyncedSlices,t=e.unSyncedCustomTypes,o=e.modelsStatuses,u=e.authStatus,x=e.isOnline,h=(0,r.useMemo)(function(){var e;return{changedSlices:n.map(function(e){return{slice:e,status:o.slices[e.model.id]}}).filter(function(e){return V.O.includes(e.status)}),changedCustomTypes:t.map(function(e){return(0,p.TG)(e)?e.local:e.remote}).map(function(e){return{customType:e,status:o.customTypes[e.id]}}).filter(function(e){return V.O.includes(e.status)})}},[n,t,o]),f=h.changedSlices,m=h.changedCustomTypes,g=(0,Z.Z)(),j=g.pushChanges,v=g.closeModals,y=(0,c.v9)(function(e){return{isSyncing:(0,Y.hg)(e,q.z.CHANGES_PUSH)}}).isSyncing;(0,r.useEffect)(function(){return function(){v()}},[]);var b=n.length+t.length,_=function(e){return j({confirmDeleteDocuments:e,changedSlices:f,changedCustomTypes:m})},C=(0,r.useMemo)(function(){return x?u===L.t.UNAUTHORIZED||u===L.t.FORBIDDEN?(0,s.jsx)(E,{}):0===b?(0,s.jsx)(U,{}):(0,s.jsx)(k,{unSyncedSlices:n,unSyncedCustomTypes:t,modelsStatuses:o,authStatus:u,isOnline:x}):(0,s.jsx)(O,{})},[x,u,b,n,t,o,]);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a(),{children:(0,s.jsx)("title",{children:"Changes - Slice Machine"})}),(0,s.jsxs)(d.LN,{children:[(0,s.jsxs)(d.wd,{children:[(0,s.jsx)(d.Cx,{folder:"Changes"}),(0,s.jsx)(d.K2,{children:(0,s.jsx)(i.zx,{onClick:function(){return _(!1)},loading:y,disabled:0===b||!x||u===L.t.UNAUTHORIZED||u===L.t.FORBIDDEN||y,"data-cy":"push-changes",children:"Push Changes"})})]}),(0,s.jsx)(d.RN,{children:(0,s.jsxs)(l.xR,{sx:{display:"flex",flexDirection:"column"},children:[C,(0,s.jsx)(ea,{pushChanges:_}),(0,s.jsx)(el,{pushChanges:_}),(0,s.jsx)(ec,{pushChanges:_})]})})]})]})}},2754:function(e,n,t){"use strict";t.d(n,{R$:function(){return d},Qj:function(){return m},T9:function(){return x},nf:function(){return f},u2:function(){return u},_T:function(){return h}});var s=t(67557),i=t(62230),r=t(85244),o=t(98240),a=t(52322),l=t(6277),c=t(22715);t(69143);var d=function(e){var n=e.backgroundImage,t=e.style,c=(0,o.Z)(e,["backgroundImage","style"]),d=void 0!==n;return(0,a.jsx)("article",(0,r.Z)((0,i.Z)({},c),{className:(0,l.Z)("_18bjhbz0 _1ecs97df4i _1ecs97df4j _1ecs97df4k _1ecs97df4t _1ecs97dfnq _1ecs97dfns _1ecs97dfnu _1ecs97d3go _1ecs97d3o1 _1ecs97df69 _1ecs97df7l _1ecs97df7z _1ecs97df57",(0,s.Z)({},"_18bjhbz1 _1ecs97df5f _1ecs97dfac",d)),style:(0,i.Z)({backgroundImage:d?"url(".concat(n,")"):void 0},t)}))},u=function(e){return(0,a.jsx)("div",(0,r.Z)((0,i.Z)({},e),{className:"_1ecs97df4i _1ecs97df4j _1ecs97df4k _1ecs97df4t _1ecs97d6to _1ecs97d711 _1ecs97df7r _1ecs97df83 _1ecs97df57"}))},x=function(e){return(0,a.jsx)("div",(0,r.Z)((0,i.Z)({},e),{className:"_18bjhbz3 _1ecs97df4i _1ecs97df4j _1ecs97df4k _1ecs97df4t _1ecs97dfkx"}))},h=function(e){return(0,a.jsx)(c.xv,(0,r.Z)((0,i.Z)({},e),{className:"_18bjhbz4"}))},f=function(e){return(0,a.jsx)(c.xv,(0,r.Z)((0,i.Z)({},e),{className:"_18bjhbz5",color:"grey11"}))},m=function(e){return(0,a.jsx)(c.hE,(0,r.Z)((0,i.Z)({},e),{className:"_18bjhbz6 _1ecs97dfem _1ecs97df4q _1ecs97dfis",size:"medium",variant:"secondary"}))}},69143:function(){},25977:function(){}},function(e){e.O(0,[789,123,918,958,80,774,888,179],function(){return e(e.s=21985)}),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[33],{30755:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/slices/[lib]/[sliceName]/[variation]/simulator",function(){return t(23261)}])},56577:function(e,n,t){"use strict";t.d(n,{z:function(){return d}});var r=t(62230),i=t(85244),o=t(98240),s=t(52322),c=t(2784),a=t(75289),l=function(e,n){return e?"".concat(e,"-").concat(n):""},u=function(e){switch(e){case"white":case"secondaryMedium":case"secondarySmall":case"secondary":return"#1A1523";default:return"grey01"}},d=(0,c.forwardRef)(function(e,n){var t=e.label,c=e.Icon,d=e.type,x=e.form,f=e.isLoading,h=void 0!==f&&f,p=e.disabled,v=e.onClick,m=e.sx,g=e.iconSize,b=void 0===g?16:g,C=e.iconFill,j=e.variant,S=void 0===j?"primary":j,k=(0,o.Z)(e,["label","Icon","type","form","isLoading","disabled","onClick","sx","iconSize","iconFill","variant"]);return(0,s.jsx)(a.zx,(0,i.Z)((0,r.Z)({ref:n,sx:(0,r.Z)((0,i.Z)((0,r.Z)({},void 0===m?{}:m),{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"}),h?{cursor:"wait !important"}:{}),type:d,form:x,disabled:void 0!==p&&p||h,onClick:h?void 0:v,variant:S},k),{children:h?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a.$j,{size:b,color:u(S),"data-cy":l(k["data-cy"],"spinner")}),c&&t]}):(0,s.jsxs)(s.Fragment,{children:[c&&(0,s.jsx)(c,{size:b,fill:C,"data-cy":l(k["data-cy"],"icon")}),t]})}))})},61931:function(e,n,t){"use strict";t.d(n,{q:function(){return l}});var r=t(62230),i=t(52322),o=t(2784),s=t(75289),c=t(65186),a=(0,o.memo)(function(e){var n=e.src;return(0,i.jsx)(s.Ee,{src:n,alt:"Preview image",sx:{maxHeight:"100%"}})}),l=function(e){var n=e.src,t=e.sx;return(0,i.jsx)(s.kC,{sx:(0,r.Z)({position:"relative",alignItems:"center",justifyContent:"center",overflow:"hidden",backgroundImage:"url(/pattern.png)",backgroundColor:"headSection",backgroundRepeat:"repeat",backgroundSize:"20px",borderRadius:"4px"},t),children:void 0!==n?(0,i.jsx)(a,{src:n}):(0,i.jsxs)(s.xv,{sx:{display:"flex",flexDirection:"column",alignItems:"center"},children:[(0,i.jsx)(c.eJU,{}),"You have no screenshot yet."]})})}},23261:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return eS}});var r,i,o,s,c=t(52322),a=t(97729),l=t.n(a),u=t(62230),d=t(85244),x=t(2784),f=t(71463),h=t(22715),p=t(75289),v=t(65077),m=t(5632),g=t.n(m),b=t(56577),C=t(19909),j=function(e){var n=e.defaultValue,t=e.variations,r=e.MenuItemAction,i=e.onChange;return(0,c.jsxs)(p.xu,{sx:{py:0,flexDirection:"column",backgroundColor:"headSection",overflow:"auto",display:"flex",borderRadius:"4px",border:function(e){var n;return"1px solid ".concat(null===(n=e.colors)||void 0===n?void 0:n.borders)},boxShadow:"0 10px 10px rgba(0, 0, 0, 0.05)",maxHeight:340,minWidth:250,maxWidth:350,color:"text"},children:[(0,c.jsxs)(p.xv,{sx:{p:3,fontSize:12,color:"textClear"},children:[t.length," VARIATION",t.length>1?"S":""]}),(0,c.jsxs)(p.kC,{sx:{p:0,flexDirection:"column"},children:[t.map(function(e){return(0,c.jsx)(S,{value:e,isActive:e.id===n.id,onClick:i},e.id)}),r||null]})]})},S=function(e){var n=e.value,t=e.isActive,r=e.onClick;return(0,c.jsx)(p.xu,{sx:{px:3,py:2,color:t?"primary":"",cursor:"pointer",borderLeft:function(e){var n=e.colors;return"2px solid ".concat(t?null==n?void 0:n.primary:null==n?void 0:n.background)},borderRadius:0,bg:"background",":hover":{bg:"hoverBackground",borderLeft:function(e){var n=e.colors;return"2px solid ".concat(null==n?void 0:n.primary)}}},onClick:function(){return r(n)},children:n.name})},k=t(75100),y=function(e){var n=e.buttonSx,t=e.defaultValue,r=e.variations,i=e.onNewVariation,o=e.onChange,s=e.sx,a=e.disabled,l=(0,x.useState)(!1),d=l[0],f=l[1],h=(0,x.useState)(t||r[0]),v=h[0],m=h[1];(0,x.useEffect)(function(){t&&m(t)},[t]);var g=function(e){f(!1),m(e),setTimeout(function(){return o(e)},210)},b=(0,c.jsx)(p.xu,{sx:{p:2},children:(0,c.jsx)(p.zx,{variant:"transparent",sx:{color:"text"},onClick:function(){f(!1),i&&i()},children:"+ Add new variation"})});return(0,c.jsx)(p.xu,{sx:s,children:(0,c.jsx)(C.Popover,{align:"start",isOpen:d,onClickOutside:function(){return f(!1)},positions:["bottom"],padding:10,content:function(){return(0,c.jsx)(j,{defaultValue:v,variations:r,onChange:g,MenuItemAction:i?b:void 0})},containerClassName:"variationSelectorContainer",children:(0,c.jsxs)(p.zx,{sx:(0,u.Z)({},n),variant:"dropDownButton",onClick:function(){return f(!d)},disabled:a,children:[v.name," ",d?(0,c.jsx)(k.bOz,{size:"16px","aria-label":"Collapse variations"}):(0,c.jsx)(k.mEq,{size:"16px","aria-label":"Expand variations"})]})})})},E=function(e){return(0,c.jsxs)("svg",(0,d.Z)((0,u.Z)({viewBox:"0 0 72 72",xmlns:"http://www.w3.org/2000/svg"},e),{children:[(0,c.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M51.3304 19.693C50.9182 18.9787 50.2527 18.6526 50.2527 18.6526L64.7906 10.2077C65.5266 9.78011 66.4679 10.0339 66.8929 10.7745C67.3179 11.5151 67.0657 12.4622 66.3294 12.8898L52.639 20.8424C52.639 20.8424 51.7428 20.4072 51.3304 19.693Z",fill:"current"}),(0,c.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M47.6775 54.7814C58.0794 48.7394 61.6433 35.3572 55.6378 24.8917C54.7801 23.397 53.7736 22.0427 52.6481 20.8367L32.9428 32.2832C32.2068 32.7108 31.2655 32.457 30.8405 31.7165C30.4155 30.9757 30.6677 30.0287 31.4039 29.6011L50.2693 18.6425C43.486 13.2668 33.8645 12.2736 25.9299 16.8827C15.5282 22.9249 11.9642 36.3071 17.9697 46.7727C18.8274 48.2671 19.8339 49.6216 20.9595 50.8276L41.1791 39.0822C41.9151 38.6546 42.8564 38.9086 43.2814 39.6492C43.7064 40.3897 43.4542 41.3368 42.7182 41.7644L23.3384 53.0217C30.1217 58.3975 39.7432 59.3906 47.6775 54.7814Z",fill:"current"}),(0,c.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.20645 61.7656C4.78145 61.0248 5.03367 60.078 5.76978 59.6502L20.9371 50.8398C20.9371 50.8398 21.8578 51.2406 22.3053 51.7062C22.7528 52.1717 23.361 53.0078 23.361 53.0078L7.30887 62.3323C6.57274 62.7599 5.63144 62.5061 5.20645 61.7656Z",fill:"current"})]}))},w=t(56580),I=t(52039),_=function(e,n,t){if(!n){g().push("/".concat(e.href,"/").concat(e.model.name));return}var r,i,o,s,c,a,l,u,d,x=(i=(r={lib:e.href,sliceName:e.model.name,variationId:null==n?void 0:n.id,isSimulator:t}).lib,o=r.sliceName,s=r.variationId,a=void 0===(c=r.options)?{}:c,l=r.isSimulator,u="/slices/[lib]/[sliceName]/[variation]".concat(l?"/simulator":""),d="/slices/".concat(i,"/").concat(o,"/").concat(s).concat(l?"/simulator":""),{href:u,as:d,options:a,all:[u,d,a]});g().push(x.href,x.as,x.options)},D=function(e){var n=e.slice,t=e.variation,r=e.isDisplayEditor,i=e.toggleIsDisplayEditor,o=e.onSaveMock,s=e.actionsDisabled,a=(0,w.v9)(function(e){return{savingMock:(0,I.S3)(e)}}).savingMock;return(0,c.jsxs)(p.kC,{sx:{p:"16px",display:"flex",bg:"grey07",gridTemplateRows:"1fr",borderBottom:"1px solid #DCDBDD",justifyContent:"space-between"},children:[(0,c.jsxs)(p.kC,{sx:{alignItems:"center"},children:[(0,c.jsx)(E,{height:"20px",width:"20px",fill:"#1A1523"}),(0,c.jsx)(p.xv,{sx:{ml:2,mr:"12px",fontSize:"14px",color:"#1A1523",fontWeight:"600",letterSpacing:"-0.15px"},children:n.model.name}),(0,c.jsx)(y,{defaultValue:t,variations:n.model.variations,onChange:function(e){return _(n,e,!0)},disabled:n.model.variations.length<=1||s})]}),(0,c.jsxs)(p.kC,{sx:{alignItems:"center",justifyContent:"space-between"},children:[(0,c.jsx)(p.kC,{sx:{alignItems:"center",justifyContent:"space-around"},children:(0,c.jsxs)(p.kC,{sx:{alignItems:"center",mr:4},children:[(0,c.jsx)(p.__,{htmlFor:"show-mock-editor",sx:{color:"#6F6E77",lineHeight:"16px",fontSize:"12px",fontWeight:"600",letterSpacing:"0px"},children:"Editor"}),(0,c.jsx)(p.rs,{id:"show-mock-editor",checked:r,onChange:i,disabled:s})]})}),(0,c.jsx)(b.z,{"data-cy":"save-mock",onClick:o,label:"Save mock content",disabled:a||s,variant:"primary",sx:{borderRadius:"6px",color:"#F1EEFE",fontWeight:"bold",border:"1px solid #5842C3",backgroundColor:"#6E56CF",boxShadow:"0px 1px 0px rgba(0, 0, 0, 0.04)","&:hover":{"&:not([disabled])":{backgroundColor:"#5842C3"}}}})]})]})},Z=t(82770),F=t(39092),R=function(e){var n=e.defaultValue,t=e.options,r=e.onChange;return(0,c.jsx)(p.xu,{sx:{py:0,flexDirection:"column",backgroundColor:"headSection",overflow:"auto",display:"flex",borderRadius:"6px",border:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.darkBorder))},boxShadow:"0 10px 10px rgba(0, 0, 0, 0.05)",maxHeight:340,minWidth:180,maxWidth:350,color:"text"},children:(0,c.jsx)(p.kC,{sx:{p:0,flexDirection:"column"},children:t.map(function(e){return(0,c.jsx)(z,{value:e,isActive:e===n,onClick:r})})})})},z=function(e){var n=e.value,t=e.isActive,r=e.onClick;return(0,c.jsx)(p.xu,{sx:{p:2,cursor:"pointer",fontSize:"14px",borderRadius:0,bg:t?"hoverBackground":"background",":hover":{bg:"hoverBackground"}},onClick:function(){return r(n)},children:n})},N=function(e){var n=e.buttonSx,t=e.currentValue,r=e.options,i=e.onChange,o=e.disabled,s=(0,x.useState)(!1),a=s[0],l=s[1],u=function(e){l(!1),setTimeout(function(){return i(e)},210)};return(0,c.jsx)(p.xu,{children:(0,c.jsx)(C.Popover,{align:"start",isOpen:a,onClickOutside:function(){return l(!1)},positions:["bottom"],padding:2,content:function(){return(0,c.jsx)(R,{defaultValue:t,options:r,onChange:u})},children:(0,c.jsxs)(p.zx,{sx:n,variant:"dropDownButton",onClick:function(){return l(!a)},disabled:o,children:[t," ",a?(0,c.jsx)(k.bOz,{size:"24px"}):(0,c.jsx)(k.mEq,{size:"24px"})]})})})},O=t(67557);(s=r||(r={})).DESKTOP="Desktop",s.TABLET="Tablet",s.MOBILE="Mobile",s.CUSTOM="Custom";var T=(i={},(0,O.Z)(i,r.DESKTOP,{width:1280,height:800}),(0,O.Z)(i,r.TABLET,{width:1080,height:810}),(0,O.Z)(i,r.MOBILE,{width:390,height:844}),i),A=function(e){var n=e.label,t=e.startValue,r=e.onChange,i=e.sx,o=e.disabled,s=["e","-","+",",","."];return(0,c.jsxs)(p.kC,{sx:(0,u.Z)({alignItems:"center"},i),children:[(0,c.jsx)(p.__,{sx:{backgroundColor:"grey07",border:"transparent",borderRight:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.darkBorder))},borderRadius:"6px 0px 0px 6px",width:26,height:30,color:"greyIcon",fontWeight:"bold",fontSize:"14px",alignItems:"center",justifyContent:"center",position:"absolute",ml:"1px"},htmlFor:"".concat(n,"-screensize-input"),children:n}),(0,c.jsx)(p.II,{type:"number",name:"".concat(n,"-screensize-input"),disabled:o,sx:{width:80,height:32,p:0,border:"1px solid #E4E2E4",borderRadius:"6px","&::-webkit-outer-spin-button,&::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:0},color:"greyIcon",textAlign:"center",paddingLeft:26,"&:disabled":{cursor:"not-allowed","&:hover":{border:"1px solid #E4E2E4"},"&:active":{border:"1px solid #E4E2E4",boxShadow:"none"}}},onChange:r,value:t,min:"0",onKeyDown:function(e){s.includes(e.key)&&e.preventDefault()}})]})},L=function(e){var n=e.handleScreenSizeChange,t=e.screenDimensions,i=e.actionsDisabled,o=(0,x.useState)(r.DESKTOP),s=o[0],a=o[1],l=function(e){a(e),e!==r.CUSTOM&&n(T[e])},f=function(e){var t=Object.values(T).findIndex(function(n){return JSON.stringify(n)===JSON.stringify(e)}),i=t<0?r.CUSTOM:Object.keys(T)[t];a(i),n(e)};return(0,c.jsx)(p.kC,{sx:{alignItems:"center",pb:"16px",justifyContent:"space-between",variant:"small"},children:(0,c.jsxs)(p.kC,{sx:{alignItems:"center",flex:1},children:[(0,c.jsx)(N,{options:Object.values(r),onChange:l,buttonSx:{alignSelf:"start"},currentValue:s,disabled:i}),(0,c.jsx)(A,{label:"W",startValue:t.width.toString(),onChange:function(e){f((0,d.Z)((0,u.Z)({},t),{width:Number(e.target.value)}))},disabled:i,sx:{mx:2}}),(0,c.jsx)(k.eSQ,{size:16,color:"#6F6E77"}),(0,c.jsx)(A,{label:"H",startValue:t.height.toString(),onChange:function(e){f((0,d.Z)((0,u.Z)({},t),{height:Number(e.target.value)}))},disabled:i,sx:{ml:2}})]})})},M=t(25812),U=t(77174),P=t(24340),W=t(90374),B=t(54132),H=t(61931),V=function(e){var n=e.sliceName,t=e.screenshotUrl,r=(0,w.v9)(function(e){return{isScreenshotModalOpen:(0,U.gP)(e,P.q.SCREENSHOT_PREVIEW)}}).isScreenshotModalOpen,i=(0,W.Z)().closeModals;return(0,c.jsx)(M.Z,{isOpen:r,shouldCloseOnOverlayClick:!0,contentLabel:"Screenshot Preview",portalClassName:"ScreenshotPreviewModal",onRequestClose:i,children:(0,c.jsx)(B.Z,{radius:"0px",bodySx:{p:0,bg:"#FFF",position:"relative",height:"100%",padding:16},footerSx:{position:"sticky",bottom:0,p:0},sx:{border:"none"},Header:function(){return(0,c.jsxs)(p.kC,{sx:{position:"sticky",top:0,zIndex:1,p:"16px",alignItems:"center",justifyContent:"space-between",borderBottom:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.borders))}},children:[(0,c.jsxs)(p.X6,{sx:{fontSize:"14px"},children:["Screenshot Preview for ",n]}),(0,c.jsx)(p.x8,{type:"button",onClick:function(){return i()}})]})},Footer:function(){return(0,c.jsx)(p.kC,{style:{justifyContent:"flex-end",height:64,alignItems:"center",paddingRight:16,borderTop:"1px solid #DCDBDD"},children:(0,c.jsx)(p.zx,{variant:"secondary",sx:{fontWeight:600},onClick:function(){return i()},children:"Close"})})},children:(0,c.jsx)(H.q,{src:t,sx:{height:"320px"}})})})},q=t(25242),X=t(81541),G=function(e,n,t){var r=(0,x.useState)(e()),i=r[0],o=r[1],s=(0,x.useRef)(Date.now());return(0,x.useEffect)(function(){var t=setTimeout(function(){Date.now()-s.current>=n&&(o(e()),s.current=Date.now())},n-(Date.now()-s.current));return function(){clearTimeout(t)}},[n].concat((0,X.Z)(t))),i},K=t(22710),Y=t(17064),J=t(99267),Q=t(16),$=function(e){var n,t,r,i,o,s,a,l=e.apiContent,d=e.screenDimensions,f=e.simulatorUrl,h=e.dryRun,v=e.isScreenshot,m=void 0!==v&&v,g=(0,Y.Z)((t=(n=(0,x.useState)())[0],r=n[1],i=(0,x.useRef)(),o=(0,x.useRef)(),a=(0,x.useCallback)((s=(0,K.Z)(function(e){var n,t,s,c;return(0,J.__generator)(this,function(a){switch(a.label){case 0:if(null===(n=i.current)||void 0===n||n.disconnect(),null===(t=o.current)||void 0===t||t.disconnect(),r(void 0),!(null!=e))return[3,4];i.current=new Q.SH(e),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,i.current.connect()];case 2:var l;return a.sent(),r(i.current),l=(0,K.Z)(function(){var e;return(0,J.__generator)(this,function(n){switch(n.label){case 0:return r(void 0),[4,null===(e=i.current)||void 0===e?void 0:e.connect({},!0)];case 1:return n.sent(),r(i.current),[2]}})}),s=function(){return l.apply(this,arguments)},o.current=new MutationObserver(function(e){e.forEach(function(e){"src"===e.attributeName&&s().catch(function(e){throw e})})}),o.current.observe(e,{attributeFilter:["src"]}),[3,4];case 3:return c=a.sent(),console.error(c),[3,4];case 4:return[2]}})}),function(e){return s.apply(this,arguments)}),[]),[t,a]),2),b=g[0],C=g[1],j=(0,W.Z)(),S=j.connectToSimulatorSuccess,k=j.connectToSimulatorFailure;(0,x.useEffect)(function(){var e;if(!f){k();return}if(void 0!==b){if(!b.connected){k(),console.warn("Trying to use a disconnected simulator client.");return}(e=(0,K.Z)(function(){return(0,J.__generator)(this,function(e){switch(e.label){case 0:return[4,b.setSliceZone([l])];case 1:return e.sent(),[2]}})}),function(){return e.apply(this,arguments)})().then(function(){S()}).catch(function(){k()})}},[b,l,f]);var y,E,w,I,_,D,Z,F,R,z=(0,x.useState)(),N=z[0],O=z[1],T=(y=function(e){var n;O({height:e.blockSize,width:e.inlineSize})},w=(0,x.useRef)(),(0,x.useCallback)(function(e){var n;null===(n=w.current)||void 0===n||n.disconnect(),null!==e&&(w.current=new ResizeObserver(function(n){var t,r=(0,Y.Z)(n,1)[0].contentRect;y({blockSize:r.height,inlineSize:r.width},e)}),w.current.observe(e))},[]));return(0,c.jsx)(p.kC,{ref:T,sx:(0,u.Z)({alignItems:"center",backgroundColor:"headSection",backgroundImage:"url(/pattern.png)",backgroundRepeat:"repeat",backgroundSize:"10px",border:m?void 0:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.darkBorder))},borderRadius:m?void 0:8,display:"flex",height:"100%",justifyContent:"center",overflow:"hidden"},void 0!==h&&h?{display:"none"}:{}),children:f?(0,c.jsx)("iframe",{ref:C,src:f,style:(0,u.Z)({border:"none",maxHeight:"".concat(d.height,"px"),maxWidth:"".concat(d.width,"px"),minHeight:"".concat(d.height,"px"),minWidth:"".concat(d.width,"px"),overflowY:"auto"},N?{transform:"scale(".concat((I=d,_=N,D=I.height,Z=I.width,F=_.height,R=_.width,Z>R||D>F?Z-R>D-F?R/Z:F/D:1),")")}:{display:"none"})}):null})},ee=function(e){var n=e.children,t=e.sx;return(0,c.jsx)(p.kC,{sx:(0,u.Z)({bg:"grey07",height:"90%",width:"100%",justifyContent:"center",alignItems:"center",zIndex:"1"},t),children:(0,c.jsx)(p.kC,{sx:{marginTop:"-128px",justifyContent:"center",flexDirection:"column",alignItems:"center"},children:n})})},en=t(85819),et=function(e){var n=e.onRetrigger;return(0,c.jsxs)(ee,{children:[(0,c.jsx)(p.Ee,{src:"/iframe-not-running.png",sx:{width:"320px"}}),(0,c.jsx)(p.xv,{sx:{color:"textClear",mb:2,fontSize:"14px",lineHeight:"24px",fontWeight:"600"},children:"Slice Machine can't render your Slice"}),(0,c.jsxs)(p.xv,{sx:{color:"failedConnectText",maxWidth:"400px",textAlign:"center",fontSize:"12px",lineHeight:"22px"},children:["Ensure your website's development server is running by typing",(0,c.jsx)("br",{}),(0,c.jsx)(p.xv,{as:"code",variant:"styles.inlineCode",sx:{padding:"4px",borderRadius:"6px"},children:"npm run dev"}),"\xa0 in your terminal at the root of your website directory.",(0,c.jsx)("br",{})," If that doesn't work, see the\xa0",(0,c.jsx)(p.rU,{target:"_blank",href:"https://prismic.io/docs/slice-machine",sx:{color:"link"},children:"troubleshooting instructions."})]}),(0,c.jsx)(b.z,{onClick:n,label:"Refresh",Icon:en.Fer,iconSize:20,iconFill:"#6F6E77",variant:"secondaryMedium",sx:{mt:"16px"}})]})},er=t(98240),ei=t(92928),eo=t(33402),es=t(59326),ec=t(86741),ea=t(65186),el=function(e){var n=e.children;return(0,c.jsx)(p.xu,{as:"code",sx:{bg:"rgba(0, 0, 0, 0.05)",borderRadius:3,padding:"2px 4px"},children:n})},eu=function(e){var n,t=e.children,r=(0,er.Z)(e,["children"]),i=(0,es.B7)().theme,o=(0,x.useState)(!1),s=o[0],a=o[1],l=(0,x.useRef)(null),f=function(){l.current&&navigator.clipboard.writeText(l.current.innerText).then(function(){a(!0),setTimeout(function(){a(!1)},1200)}).catch(function(){})};return(0,c.jsxs)(p.xu,(0,d.Z)((0,u.Z)({},r),{sx:{backgroundColor:"codeBlockBackground",borderRadius:8},children:[(0,c.jsxs)(p.kC,{sx:{px:"26px",py:"22px",color:"#FFF",flexDirection:"row",justifyContent:"space-between",alignItems:"center",borderBottom:"1px solid rgba(111, 110, 119, 0.2)"},children:[(0,c.jsx)(p.kC,{sx:{alignItems:"center"}}),(0,c.jsxs)(p.zx,{onClick:f,variant:"transparent",sx:{display:"flex",justifyContent:"center",alignItems:"center",p:0,fontSize:"12px",color:"#FFF"},children:["Copy\xa0",s?(0,c.jsx)(ea.HhX,{size:16,color:String(null==i?void 0:null===(n=i.colors)||void 0===n?void 0:n.success)}):(0,c.jsx)(ea.Fqs,{size:16,style:{marginLeft:"8px"}})]})]}),(0,c.jsx)(p.xu,{ref:l,as:"pre",sx:{color:"#c9d1d9",padding:"16px 20px",overflow:"auto"},children:t})]}))},ed={code:function(e){var n=e.children;return(0,c.jsx)(el,{children:n})},pre:function(e){var n=e.children,t=(0,er.Z)(e,["children"]);return(0,c.jsx)(eu,(0,d.Z)((0,u.Z)({},t),{children:n}))}},ex=function(e){var n=e.html,t=e.components,r=void 0===t?{}:t,i={replace:function(e){if((0,eo.Z)(e,ec.W_)&&e.attribs){var n=(0,ec.du)(e.children,i),t=(0,u.Z)({},r,ed)[e.name];if(t)return(0,c.jsx)(t,(0,d.Z)((0,u.Z)({name:e.name},e.attribs),{children:n}))}}};return(0,c.jsx)(c.Fragment,{children:(0,ec.ZP)(n,i)})},ef=function(e){var n=e.children.split("`").map(function(e,n){return n%2==1?(0,c.jsx)(el,{children:e}):e});return(0,c.jsx)(c.Fragment,{children:n})},eh=function(e){var n=e.number,t=e.title,r=e.excerpt,i=(0,er.Z)(e,["number","title","excerpt"]);return(0,c.jsx)(ei.OK,(0,d.Z)((0,u.Z)({className:"react-tabs__vertical__tab",selectedClassName:"react-tabs__vertical__tab--selected"},i),{children:(0,c.jsxs)(p.kC,{sx:{alignItems:"flex-start"},children:[(0,c.jsx)(ev,{number:n}),(0,c.jsxs)(p.xu,{sx:{ml:3,alignSelf:"center"},children:[(0,c.jsx)(p.X6,{as:"h4",sx:{color:"whiteButtonText",fontSize:"14px",fontWeight:"600"},children:(0,c.jsx)(ef,{children:t})}),r&&(0,c.jsx)(p.xv,{as:"p",sx:{mt:2,color:"textClear",fontSize:"13px",lineHeight:"24px"},children:(0,c.jsx)(ef,{children:r})})]})]})}))};eh.tabsRole="Tab";var ep,ev=function(e){var n=e.number;return(0,c.jsx)(p.kC,{sx:{height:"32px",width:"32px",alignItems:"center",justifyContent:"center",border:"1px solid #E4E2E4",borderRadius:"6px",bg:"grey07",color:"textClear",flexShrink:"0",fontSize:"13px"},children:n})},em=function(e){var n=e.isOpen,t=(0,w.v9)(function(e){return{isSimulatorAvailableForFramework:(0,F.Ql)(e),setupSteps:(0,I.qe)(e)}}),r=t.isSimulatorAvailableForFramework,i=t.setupSteps||[];return(0,x.useEffect)(function(){n&&Z.Xe.track({event:"slice-simulator:setup"})},[n]),(0,c.jsx)(M.Z,{isOpen:n,children:(0,c.jsx)(B.Z,{bodySx:{p:0,bg:"grey07",height:4===i.length?"640px":"480px"},Header:function(e){var n=e.radius;return(0,c.jsx)(p.kC,{sx:{position:"sticky",top:0,zIndex:1,p:"16px",pl:4,bg:"grey07",alignItems:"center",justifyContent:"space-between",borderTopLeftRadius:n,borderTopRightRadius:n,borderBottom:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.borders))}},children:(0,c.jsx)(p.X6,{sx:{fontSize:"14px",fontWeight:"600"},as:"h5",children:"Set up the simulator"})})},children:(0,c.jsxs)(ei.mQ,{defaultFocus:!0,className:"react-tabs__vertical",children:[(0,c.jsx)(ei.td,{className:"react-tabs__vertical__tab-list",children:i.map(function(e,n){return(0,c.jsx)(eh,{number:n+1,title:e.title,excerpt:e.description},e.title)})}),r?(0,c.jsx)(c.Fragment,{children:i.map(function(e){return(0,c.jsx)(ei.x4,{selectedClassName:"react-tabs__vertical__tab-panel--selected",className:"react-tabs__vertical__tab-panel",children:(0,c.jsx)(ex,{html:e.body})},e.title)})}):(0,c.jsx)(ei.x4,{selectedClassName:"react-tabs__vertical__tab-panel--selected",className:"react-tabs__vertical__tab-panel",children:"Framework not supported."})]})})})},eg=t(53559);(ep=o||(o={})).LOADING_SETUP="LOADING_SETUP",ep.LOADING_IFRAME="LOADING_IFRAME",ep.FAILED_SETUP="FAILED_SETUP",ep.FAILED_CONNECT="FAILED_CONNECT",ep.SUCCESS="SUCCESS";var eb=function(e){var n,t,i=e.slice,s=e.variation,a=(0,W.Z)(),l=a.checkSimulatorSetup,m=a.connectToSimulatorIframe,g=a.saveSliceMock,b=(0,w.v9)(function(e){return{simulatorUrl:(0,F.x0)(e),iframeStatus:(0,I.NL)(e),manifestStatus:(0,I.tD)(e).manifest,isWaitingForIFrameCheck:(0,I.oM)(e),endpoints:(0,F.gZ)(e)}}),C=b.simulatorUrl,j=b.iframeStatus,S=b.manifestStatus,k=b.isWaitingForIFrameCheck,y=b.endpoints,E=(0,x.useMemo)(function(){return{embedsUrl:y.PrismicOembed,env:"prod",unsplashUrl:y.PrismicUnsplash}},[y.PrismicOembed,y.PrismicUnsplash]),_=(0,x.useRef)(null),R=(0,x.useCallback)(function(){return l()},[]);(0,x.useEffect)(function(){l(),Z.Xe.track({event:"slice-simulator:open"})},[]);var z=(0,x.useRef)(!1);(0,x.useEffect)(function(){z.current=!0},[]);var N=function(e){z.current&&(z.current=!1,Z.Xe.track({event:"editor:widget-used",sliceId:e}))},O="ko"===S?o.FAILED_SETUP:"ok"===S?k||!j?o.LOADING_IFRAME:"ok"!==j?o.FAILED_CONNECT:o.SUCCESS:(0,o.LOADING_SETUP);(0,x.useEffect)(function(){if(O===o.FAILED_SETUP&&!_.current){var e=setInterval(function(){R()},3e3);_.current=e}},[O]),(0,x.useEffect)(function(){"ok"===S&&(_.current&&clearInterval(_.current),m())},[S]),(0,x.useEffect)(function(){O===o.FAILED_CONNECT&&Z.Xe.track({event:"slice-simulator:is-not-running"})},[O]),(0,x.useEffect)(function(){O===o.SUCCESS&&eo(!0)},[O]);var A=function(){m()},M=(0,x.useState)(T[r.DESKTOP]),U=M[0],P=M[1],B=(0,x.useMemo)(function(){return eg.id.fromSM(i.model)},[i.model]),H=(0,x.useState)(null),X=H[0],K=H[1],Y=(0,x.useMemo)(function(){var e,n;return(null==X?void 0:X.variation)===s.id?X:(null===(e=i.mocks)||void 0===e?void 0:e.find(function(e){return e.variation===s.id}))||{__TYPE__:"SharedSliceContent",variation:n=s.id,primary:{},items:[]}},[X,s.id]),J=(0,x.useMemo)(function(){return(0,q.renderSliceMock)(B,Y).id},[]),Q=(0,x.useCallback)(function(){return function(){return(0,d.Z)((0,u.Z)({},(0,q.renderSliceMock)(B,Y)),{id:J})}},[B,Y]),en=G(Q,800,[B,Y,]),er=(0,x.useState)(!1),ei=er[0],eo=er[1];return(0,c.jsxs)(p.kC,{sx:{flexDirection:"column",height:"100vh"},children:[(0,c.jsx)(em,{isOpen:O===o.FAILED_SETUP}),(0,c.jsx)(D,{slice:i,variation:s,isDisplayEditor:ei,actionsDisabled:O!==o.SUCCESS,toggleIsDisplayEditor:function(){return eo(!ei)},onSaveMock:function(){return X&&g({libraryID:i.from,sliceID:i.model.id,mocks:(i.mocks||[]).filter(function(e){return e.variation!==X.variation}).concat(X)})}}),(0,c.jsx)(p.xu,{sx:{flex:1,bg:"grey07",p:3,display:"flex",flexDirection:"column",height:"calc(100% - 73px - 16px)"},children:(0,c.jsxs)(p.kC,{sx:{flex:1,flexDirection:"row",position:"relative",width:"100%",height:"100%"},children:[(0,c.jsxs)(v.xR,{sx:{display:"flex",height:"100%",flexDirection:"column",flex:1,minWidth:0},children:[(0,c.jsx)(L,{handleScreenSizeChange:P,screenDimensions:U,actionsDisabled:O!==o.SUCCESS}),O===o.FAILED_CONNECT?(0,c.jsx)(et,{onRetrigger:A}):null,O===o.SUCCESS?(0,c.jsx)($,{apiContent:en,screenDimensions:U,simulatorUrl:C}):(0,c.jsx)(c.Fragment,{children:O===o.LOADING_IFRAME?(0,c.jsxs)(ee,{children:[(0,c.jsx)(p.$j,{variant:"styles.spinner"}),(0,c.jsx)($,{apiContent:en,screenDimensions:U,simulatorUrl:C,dryRun:!0})]}):null})]}),O===o.SUCCESS?(0,c.jsx)(p.xu,{className:"editor",sx:(0,u.Z)({marginLeft:"16px",maxWidth:"440px",minWidth:"440px",overflowY:"auto"},ei?{display:"flex",flexDirection:"column"}:{display:"none"}),children:(0,c.jsx)(h.SV,{renderError:function(){return(0,c.jsx)(h.Iq,{title:"Editor error",description:"An error occurred while rendering the editor."})},children:(0,c.jsx)(x.Suspense,{children:(0,c.jsx)(f.kS,{config:E,content:Y,onContentChange:function(e){K(e),N(i.model.id)},sharedSlice:B},s.id)})})}):null]})}),!!(null===(n=i.screenshots[s.id])||void 0===n?void 0:n.url)&&(0,c.jsx)(V,{sliceName:i.model.name,screenshotUrl:null===(t=i.screenshots[s.id])||void 0===t?void 0:t.url})]})},eC=t(28684),ej=(0,t(57880).y)(eb);function eS(){var e=(0,eC.Z)().slice;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(l(),{children:(0,c.jsxs)("title",{children:[e?"Simulator: ".concat(e.model.name):"Simulator"," - Slice Machine"]})}),(0,c.jsx)(ej,{})]})}},28684:function(e,n,t){"use strict";var r=t(92521),i=t(90374),o=t(5632),s=t(2784),c=t(56580),a=function(){var e=(0,o.useRouter)(),n=(0,i.Z)().initSliceStore,t=(0,c.v9)(function(n){return{slice:(0,r.tL)(n,e.query.lib,e.query.sliceName)}}).slice;if((0,s.useEffect)(function(){t?n(t):e.replace("/")},[n,t,e]),!t)return{};var a=t.model.variations.find(function(n){return n.id===e.query.variation});return a?{slice:t,variation:a}:(e.replace("/"),{})};n.Z=a},57880:function(e,n,t){"use strict";t.d(n,{y:function(){return c}});var r=t(62230),i=t(52322);t(2784);var o=t(28684),s=t(95583),c=function(e){return function(n){var t=n.pageProps,c=(0,o.Z)(),a=c.slice,l=c.variation;return a&&l?(0,i.jsx)(e,(0,r.Z)({slice:a,variation:l},t)):((0,s.gx)("/"),null)}}}},function(e){e.O(0,[789,872,851,125,774,888,179],function(){return e(e.s=30755)}),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[33],{30755:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/slices/[lib]/[sliceName]/[variation]/simulator",function(){return t(23261)}])},56577:function(e,n,t){"use strict";t.d(n,{z:function(){return d}});var r=t(62230),i=t(85244),o=t(98240),s=t(52322),c=t(2784),a=t(75289),l=function(e,n){return e?"".concat(e,"-").concat(n):""},u=function(e){switch(e){case"white":case"secondaryMedium":case"secondarySmall":case"secondary":return"#1A1523";default:return"grey01"}},d=(0,c.forwardRef)(function(e,n){var t=e.label,c=e.Icon,d=e.type,x=e.form,f=e.isLoading,h=void 0!==f&&f,p=e.disabled,v=e.onClick,m=e.sx,g=e.iconSize,b=void 0===g?16:g,C=e.iconFill,j=e.variant,S=void 0===j?"primary":j,k=(0,o.Z)(e,["label","Icon","type","form","isLoading","disabled","onClick","sx","iconSize","iconFill","variant"]);return(0,s.jsx)(a.zx,(0,i.Z)((0,r.Z)({ref:n,sx:(0,r.Z)((0,i.Z)((0,r.Z)({},void 0===m?{}:m),{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"}),h?{cursor:"wait !important"}:{}),type:d,form:x,disabled:void 0!==p&&p||h,onClick:h?void 0:v,variant:S},k),{children:h?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a.$j,{size:b,color:u(S),"data-cy":l(k["data-cy"],"spinner")}),c&&t]}):(0,s.jsxs)(s.Fragment,{children:[c&&(0,s.jsx)(c,{size:b,fill:C,"data-cy":l(k["data-cy"],"icon")}),t]})}))})},61931:function(e,n,t){"use strict";t.d(n,{q:function(){return l}});var r=t(62230),i=t(52322),o=t(2784),s=t(75289),c=t(65186),a=(0,o.memo)(function(e){var n=e.src;return(0,i.jsx)(s.Ee,{src:n,alt:"Preview image",sx:{maxHeight:"100%"}})}),l=function(e){var n=e.src,t=e.sx;return(0,i.jsx)(s.kC,{sx:(0,r.Z)({position:"relative",alignItems:"center",justifyContent:"center",overflow:"hidden",backgroundImage:"url(/pattern.png)",backgroundColor:"headSection",backgroundRepeat:"repeat",backgroundSize:"20px",borderRadius:"4px"},t),children:void 0!==n?(0,i.jsx)(a,{src:n}):(0,i.jsxs)(s.xv,{sx:{display:"flex",flexDirection:"column",alignItems:"center"},children:[(0,i.jsx)(c.eJU,{}),"You have no screenshot yet."]})})}},23261:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return eS}});var r,i,o,s,c=t(52322),a=t(97729),l=t.n(a),u=t(62230),d=t(85244),x=t(2784),f=t(71463),h=t(22715),p=t(75289),v=t(65077),m=t(5632),g=t.n(m),b=t(56577),C=t(19909),j=function(e){var n=e.defaultValue,t=e.variations,r=e.MenuItemAction,i=e.onChange;return(0,c.jsxs)(p.xu,{sx:{py:0,flexDirection:"column",backgroundColor:"headSection",overflow:"auto",display:"flex",borderRadius:"4px",border:function(e){var n;return"1px solid ".concat(null===(n=e.colors)||void 0===n?void 0:n.borders)},boxShadow:"0 10px 10px rgba(0, 0, 0, 0.05)",maxHeight:340,minWidth:250,maxWidth:350,color:"text"},children:[(0,c.jsxs)(p.xv,{sx:{p:3,fontSize:12,color:"textClear"},children:[t.length," VARIATION",t.length>1?"S":""]}),(0,c.jsxs)(p.kC,{sx:{p:0,flexDirection:"column"},children:[t.map(function(e){return(0,c.jsx)(S,{value:e,isActive:e.id===n.id,onClick:i},e.id)}),r||null]})]})},S=function(e){var n=e.value,t=e.isActive,r=e.onClick;return(0,c.jsx)(p.xu,{sx:{px:3,py:2,color:t?"primary":"",cursor:"pointer",borderLeft:function(e){var n=e.colors;return"2px solid ".concat(t?null==n?void 0:n.primary:null==n?void 0:n.background)},borderRadius:0,bg:"background",":hover":{bg:"hoverBackground",borderLeft:function(e){var n=e.colors;return"2px solid ".concat(null==n?void 0:n.primary)}}},onClick:function(){return r(n)},children:n.name})},k=t(75100),y=function(e){var n=e.buttonSx,t=e.defaultValue,r=e.variations,i=e.onNewVariation,o=e.onChange,s=e.sx,a=e.disabled,l=(0,x.useState)(!1),d=l[0],f=l[1],h=(0,x.useState)(t||r[0]),v=h[0],m=h[1];(0,x.useEffect)(function(){t&&m(t)},[t]);var g=function(e){f(!1),m(e),setTimeout(function(){return o(e)},210)},b=(0,c.jsx)(p.xu,{sx:{p:2},children:(0,c.jsx)(p.zx,{variant:"transparent",sx:{color:"text"},onClick:function(){f(!1),i&&i()},children:"+ Add new variation"})});return(0,c.jsx)(p.xu,{sx:s,children:(0,c.jsx)(C.Popover,{align:"start",isOpen:d,onClickOutside:function(){return f(!1)},positions:["bottom"],padding:10,content:function(){return(0,c.jsx)(j,{defaultValue:v,variations:r,onChange:g,MenuItemAction:i?b:void 0})},containerClassName:"variationSelectorContainer",children:(0,c.jsxs)(p.zx,{sx:(0,u.Z)({},n),variant:"dropDownButton",onClick:function(){return f(!d)},disabled:a,children:[v.name," ",d?(0,c.jsx)(k.bOz,{size:"16px","aria-label":"Collapse variations"}):(0,c.jsx)(k.mEq,{size:"16px","aria-label":"Expand variations"})]})})})},E=function(e){return(0,c.jsxs)("svg",(0,d.Z)((0,u.Z)({viewBox:"0 0 72 72",xmlns:"http://www.w3.org/2000/svg"},e),{children:[(0,c.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M51.3304 19.693C50.9182 18.9787 50.2527 18.6526 50.2527 18.6526L64.7906 10.2077C65.5266 9.78011 66.4679 10.0339 66.8929 10.7745C67.3179 11.5151 67.0657 12.4622 66.3294 12.8898L52.639 20.8424C52.639 20.8424 51.7428 20.4072 51.3304 19.693Z",fill:"current"}),(0,c.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M47.6775 54.7814C58.0794 48.7394 61.6433 35.3572 55.6378 24.8917C54.7801 23.397 53.7736 22.0427 52.6481 20.8367L32.9428 32.2832C32.2068 32.7108 31.2655 32.457 30.8405 31.7165C30.4155 30.9757 30.6677 30.0287 31.4039 29.6011L50.2693 18.6425C43.486 13.2668 33.8645 12.2736 25.9299 16.8827C15.5282 22.9249 11.9642 36.3071 17.9697 46.7727C18.8274 48.2671 19.8339 49.6216 20.9595 50.8276L41.1791 39.0822C41.9151 38.6546 42.8564 38.9086 43.2814 39.6492C43.7064 40.3897 43.4542 41.3368 42.7182 41.7644L23.3384 53.0217C30.1217 58.3975 39.7432 59.3906 47.6775 54.7814Z",fill:"current"}),(0,c.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.20645 61.7656C4.78145 61.0248 5.03367 60.078 5.76978 59.6502L20.9371 50.8398C20.9371 50.8398 21.8578 51.2406 22.3053 51.7062C22.7528 52.1717 23.361 53.0078 23.361 53.0078L7.30887 62.3323C6.57274 62.7599 5.63144 62.5061 5.20645 61.7656Z",fill:"current"})]}))},w=t(56580),I=t(52039),_=function(e,n,t){if(!n){g().push("/".concat(e.href,"/").concat(e.model.name));return}var r,i,o,s,c,a,l,u,d,x=(i=(r={lib:e.href,sliceName:e.model.name,variationId:null==n?void 0:n.id,isSimulator:t}).lib,o=r.sliceName,s=r.variationId,a=void 0===(c=r.options)?{}:c,l=r.isSimulator,u="/slices/[lib]/[sliceName]/[variation]".concat(l?"/simulator":""),d="/slices/".concat(i,"/").concat(o,"/").concat(s).concat(l?"/simulator":""),{href:u,as:d,options:a,all:[u,d,a]});g().push(x.href,x.as,x.options)},D=function(e){var n=e.slice,t=e.variation,r=e.isDisplayEditor,i=e.toggleIsDisplayEditor,o=e.onSaveMock,s=e.actionsDisabled,a=(0,w.v9)(function(e){return{savingMock:(0,I.S3)(e)}}).savingMock;return(0,c.jsxs)(p.kC,{sx:{p:"16px",display:"flex",bg:"grey07",gridTemplateRows:"1fr",borderBottom:"1px solid #DCDBDD",justifyContent:"space-between"},children:[(0,c.jsxs)(p.kC,{sx:{alignItems:"center"},children:[(0,c.jsx)(E,{height:"20px",width:"20px",fill:"#1A1523"}),(0,c.jsx)(p.xv,{sx:{ml:2,mr:"12px",fontSize:"14px",color:"#1A1523",fontWeight:"600",letterSpacing:"-0.15px"},children:n.model.name}),(0,c.jsx)(y,{defaultValue:t,variations:n.model.variations,onChange:function(e){return _(n,e,!0)},disabled:n.model.variations.length<=1||s})]}),(0,c.jsxs)(p.kC,{sx:{alignItems:"center",justifyContent:"space-between"},children:[(0,c.jsx)(p.kC,{sx:{alignItems:"center",justifyContent:"space-around"},children:(0,c.jsxs)(p.kC,{sx:{alignItems:"center",mr:4},children:[(0,c.jsx)(p.__,{htmlFor:"show-mock-editor",sx:{color:"#6F6E77",lineHeight:"16px",fontSize:"12px",fontWeight:"600",letterSpacing:"0px"},children:"Editor"}),(0,c.jsx)(p.rs,{id:"show-mock-editor",checked:r,onChange:i,disabled:s})]})}),(0,c.jsx)(b.z,{"data-cy":"save-mock",onClick:o,label:"Save mock content",disabled:a||s,variant:"primary",sx:{borderRadius:"6px",color:"#F1EEFE",fontWeight:"bold",border:"1px solid #5842C3",backgroundColor:"#6E56CF",boxShadow:"0px 1px 0px rgba(0, 0, 0, 0.04)","&:hover":{"&:not([disabled])":{backgroundColor:"#5842C3"}}}})]})]})},Z=t(82770),F=t(39092),R=function(e){var n=e.defaultValue,t=e.options,r=e.onChange;return(0,c.jsx)(p.xu,{sx:{py:0,flexDirection:"column",backgroundColor:"headSection",overflow:"auto",display:"flex",borderRadius:"6px",border:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.darkBorder))},boxShadow:"0 10px 10px rgba(0, 0, 0, 0.05)",maxHeight:340,minWidth:180,maxWidth:350,color:"text"},children:(0,c.jsx)(p.kC,{sx:{p:0,flexDirection:"column"},children:t.map(function(e){return(0,c.jsx)(z,{value:e,isActive:e===n,onClick:r})})})})},z=function(e){var n=e.value,t=e.isActive,r=e.onClick;return(0,c.jsx)(p.xu,{sx:{p:2,cursor:"pointer",fontSize:"14px",borderRadius:0,bg:t?"hoverBackground":"background",":hover":{bg:"hoverBackground"}},onClick:function(){return r(n)},children:n})},N=function(e){var n=e.buttonSx,t=e.currentValue,r=e.options,i=e.onChange,o=e.disabled,s=(0,x.useState)(!1),a=s[0],l=s[1],u=function(e){l(!1),setTimeout(function(){return i(e)},210)};return(0,c.jsx)(p.xu,{children:(0,c.jsx)(C.Popover,{align:"start",isOpen:a,onClickOutside:function(){return l(!1)},positions:["bottom"],padding:2,content:function(){return(0,c.jsx)(R,{defaultValue:t,options:r,onChange:u})},children:(0,c.jsxs)(p.zx,{sx:n,variant:"dropDownButton",onClick:function(){return l(!a)},disabled:o,children:[t," ",a?(0,c.jsx)(k.bOz,{size:"24px"}):(0,c.jsx)(k.mEq,{size:"24px"})]})})})},O=t(67557);(s=r||(r={})).DESKTOP="Desktop",s.TABLET="Tablet",s.MOBILE="Mobile",s.CUSTOM="Custom";var T=(i={},(0,O.Z)(i,r.DESKTOP,{width:1280,height:800}),(0,O.Z)(i,r.TABLET,{width:1080,height:810}),(0,O.Z)(i,r.MOBILE,{width:390,height:844}),i),A=function(e){var n=e.label,t=e.startValue,r=e.onChange,i=e.sx,o=e.disabled,s=["e","-","+",",","."];return(0,c.jsxs)(p.kC,{sx:(0,u.Z)({alignItems:"center"},i),children:[(0,c.jsx)(p.__,{sx:{backgroundColor:"grey07",border:"transparent",borderRight:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.darkBorder))},borderRadius:"6px 0px 0px 6px",width:26,height:30,color:"greyIcon",fontWeight:"bold",fontSize:"14px",alignItems:"center",justifyContent:"center",position:"absolute",ml:"1px"},htmlFor:"".concat(n,"-screensize-input"),children:n}),(0,c.jsx)(p.II,{type:"number",name:"".concat(n,"-screensize-input"),disabled:o,sx:{width:80,height:32,p:0,border:"1px solid #E4E2E4",borderRadius:"6px","&::-webkit-outer-spin-button,&::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:0},color:"greyIcon",textAlign:"center",paddingLeft:26,"&:disabled":{cursor:"not-allowed","&:hover":{border:"1px solid #E4E2E4"},"&:active":{border:"1px solid #E4E2E4",boxShadow:"none"}}},onChange:r,value:t,min:"0",onKeyDown:function(e){s.includes(e.key)&&e.preventDefault()}})]})},L=function(e){var n=e.handleScreenSizeChange,t=e.screenDimensions,i=e.actionsDisabled,o=(0,x.useState)(r.DESKTOP),s=o[0],a=o[1],l=function(e){a(e),e!==r.CUSTOM&&n(T[e])},f=function(e){var t=Object.values(T).findIndex(function(n){return JSON.stringify(n)===JSON.stringify(e)}),i=t<0?r.CUSTOM:Object.keys(T)[t];a(i),n(e)};return(0,c.jsx)(p.kC,{sx:{alignItems:"center",pb:"16px",justifyContent:"space-between",variant:"small"},children:(0,c.jsxs)(p.kC,{sx:{alignItems:"center",flex:1},children:[(0,c.jsx)(N,{options:Object.values(r),onChange:l,buttonSx:{alignSelf:"start"},currentValue:s,disabled:i}),(0,c.jsx)(A,{label:"W",startValue:t.width.toString(),onChange:function(e){f((0,d.Z)((0,u.Z)({},t),{width:Number(e.target.value)}))},disabled:i,sx:{mx:2}}),(0,c.jsx)(k.eSQ,{size:16,color:"#6F6E77"}),(0,c.jsx)(A,{label:"H",startValue:t.height.toString(),onChange:function(e){f((0,d.Z)((0,u.Z)({},t),{height:Number(e.target.value)}))},disabled:i,sx:{ml:2}})]})})},M=t(25812),U=t(77174),P=t(24340),W=t(90374),B=t(54132),H=t(61931),V=function(e){var n=e.sliceName,t=e.screenshotUrl,r=(0,w.v9)(function(e){return{isScreenshotModalOpen:(0,U.gP)(e,P.q.SCREENSHOT_PREVIEW)}}).isScreenshotModalOpen,i=(0,W.Z)().closeModals;return(0,c.jsx)(M.Z,{isOpen:r,shouldCloseOnOverlayClick:!0,contentLabel:"Screenshot Preview",portalClassName:"ScreenshotPreviewModal",onRequestClose:i,children:(0,c.jsx)(B.Z,{radius:"0px",bodySx:{p:0,bg:"#FFF",position:"relative",height:"100%",padding:16},footerSx:{position:"sticky",bottom:0,p:0},sx:{border:"none"},Header:function(){return(0,c.jsxs)(p.kC,{sx:{position:"sticky",top:0,zIndex:1,p:"16px",alignItems:"center",justifyContent:"space-between",borderBottom:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.borders))}},children:[(0,c.jsxs)(p.X6,{sx:{fontSize:"14px"},children:["Screenshot Preview for ",n]}),(0,c.jsx)(p.x8,{type:"button",onClick:function(){return i()}})]})},Footer:function(){return(0,c.jsx)(p.kC,{style:{justifyContent:"flex-end",height:64,alignItems:"center",paddingRight:16,borderTop:"1px solid #DCDBDD"},children:(0,c.jsx)(p.zx,{variant:"secondary",sx:{fontWeight:600},onClick:function(){return i()},children:"Close"})})},children:(0,c.jsx)(H.q,{src:t,sx:{height:"320px"}})})})},q=t(25242),X=t(81541),G=function(e,n,t){var r=(0,x.useState)(e()),i=r[0],o=r[1],s=(0,x.useRef)(Date.now());return(0,x.useEffect)(function(){var t=setTimeout(function(){Date.now()-s.current>=n&&(o(e()),s.current=Date.now())},n-(Date.now()-s.current));return function(){clearTimeout(t)}},[n].concat((0,X.Z)(t))),i},K=t(22710),Y=t(17064),J=t(99267),Q=t(16),$=function(e){var n,t,r,i,o,s,a,l=e.apiContent,d=e.screenDimensions,f=e.simulatorUrl,h=e.dryRun,v=e.isScreenshot,m=void 0!==v&&v,g=(0,Y.Z)((t=(n=(0,x.useState)())[0],r=n[1],i=(0,x.useRef)(),o=(0,x.useRef)(),a=(0,x.useCallback)((s=(0,K.Z)(function(e){var n,t,s,c;return(0,J.__generator)(this,function(a){switch(a.label){case 0:if(null===(n=i.current)||void 0===n||n.disconnect(),null===(t=o.current)||void 0===t||t.disconnect(),r(void 0),!(null!=e))return[3,4];i.current=new Q.SH(e),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,i.current.connect()];case 2:var l;return a.sent(),r(i.current),l=(0,K.Z)(function(){var e;return(0,J.__generator)(this,function(n){switch(n.label){case 0:return r(void 0),[4,null===(e=i.current)||void 0===e?void 0:e.connect({},!0)];case 1:return n.sent(),r(i.current),[2]}})}),s=function(){return l.apply(this,arguments)},o.current=new MutationObserver(function(e){e.forEach(function(e){"src"===e.attributeName&&s().catch(function(e){throw e})})}),o.current.observe(e,{attributeFilter:["src"]}),[3,4];case 3:return c=a.sent(),console.error(c),[3,4];case 4:return[2]}})}),function(e){return s.apply(this,arguments)}),[]),[t,a]),2),b=g[0],C=g[1],j=(0,W.Z)(),S=j.connectToSimulatorSuccess,k=j.connectToSimulatorFailure;(0,x.useEffect)(function(){var e;if(!f){k();return}if(void 0!==b){if(!b.connected){k(),console.warn("Trying to use a disconnected simulator client.");return}(e=(0,K.Z)(function(){return(0,J.__generator)(this,function(e){switch(e.label){case 0:return[4,b.setSliceZone([l])];case 1:return e.sent(),[2]}})}),function(){return e.apply(this,arguments)})().then(function(){S()}).catch(function(){k()})}},[b,l,f]);var y,E,w,I,_,D,Z,F,R,z=(0,x.useState)(),N=z[0],O=z[1],T=(y=function(e){var n;O({height:e.blockSize,width:e.inlineSize})},w=(0,x.useRef)(),(0,x.useCallback)(function(e){var n;null===(n=w.current)||void 0===n||n.disconnect(),null!==e&&(w.current=new ResizeObserver(function(n){var t,r=(0,Y.Z)(n,1)[0].contentRect;y({blockSize:r.height,inlineSize:r.width},e)}),w.current.observe(e))},[]));return(0,c.jsx)(p.kC,{ref:T,sx:(0,u.Z)({alignItems:"center",backgroundColor:"headSection",backgroundImage:"url(/pattern.png)",backgroundRepeat:"repeat",backgroundSize:"10px",border:m?void 0:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.darkBorder))},borderRadius:m?void 0:8,display:"flex",height:"100%",justifyContent:"center",overflow:"hidden"},void 0!==h&&h?{display:"none"}:{}),children:f?(0,c.jsx)("iframe",{ref:C,src:f,style:(0,u.Z)({border:"none",maxHeight:"".concat(d.height,"px"),maxWidth:"".concat(d.width,"px"),minHeight:"".concat(d.height,"px"),minWidth:"".concat(d.width,"px"),overflowY:"auto"},N?{transform:"scale(".concat((I=d,_=N,D=I.height,Z=I.width,F=_.height,R=_.width,Z>R||D>F?Z-R>D-F?R/Z:F/D:1),")")}:{display:"none"})}):null})},ee=function(e){var n=e.children,t=e.sx;return(0,c.jsx)(p.kC,{sx:(0,u.Z)({bg:"grey07",height:"90%",width:"100%",justifyContent:"center",alignItems:"center",zIndex:"1"},t),children:(0,c.jsx)(p.kC,{sx:{marginTop:"-128px",justifyContent:"center",flexDirection:"column",alignItems:"center"},children:n})})},en=t(85819),et=function(e){var n=e.onRetrigger;return(0,c.jsxs)(ee,{children:[(0,c.jsx)(p.Ee,{src:"/iframe-not-running.png",sx:{width:"320px"}}),(0,c.jsx)(p.xv,{sx:{color:"textClear",mb:2,fontSize:"14px",lineHeight:"24px",fontWeight:"600"},children:"Slice Machine can't render your Slice"}),(0,c.jsxs)(p.xv,{sx:{color:"failedConnectText",maxWidth:"400px",textAlign:"center",fontSize:"12px",lineHeight:"22px"},children:["Ensure your website's development server is running by typing",(0,c.jsx)("br",{}),(0,c.jsx)(p.xv,{as:"code",variant:"styles.inlineCode",sx:{padding:"4px",borderRadius:"6px"},children:"npm run dev"}),"\xa0 in your terminal at the root of your website directory.",(0,c.jsx)("br",{})," If that doesn't work, see the\xa0",(0,c.jsx)(p.rU,{target:"_blank",href:"https://prismic.io/docs/slice-machine",sx:{color:"link"},children:"troubleshooting instructions."})]}),(0,c.jsx)(b.z,{onClick:n,label:"Refresh",Icon:en.Fer,iconSize:20,iconFill:"#6F6E77",variant:"secondaryMedium",sx:{mt:"16px"}})]})},er=t(98240),ei=t(92928),eo=t(33402),es=t(59326),ec=t(86741),ea=t(65186),el=function(e){var n=e.children;return(0,c.jsx)(p.xu,{as:"code",sx:{bg:"rgba(0, 0, 0, 0.05)",borderRadius:3,padding:"2px 4px"},children:n})},eu=function(e){var n,t=e.children,r=(0,er.Z)(e,["children"]),i=(0,es.B7)().theme,o=(0,x.useState)(!1),s=o[0],a=o[1],l=(0,x.useRef)(null),f=function(){l.current&&navigator.clipboard.writeText(l.current.innerText).then(function(){a(!0),setTimeout(function(){a(!1)},1200)}).catch(function(){})};return(0,c.jsxs)(p.xu,(0,d.Z)((0,u.Z)({},r),{sx:{backgroundColor:"codeBlockBackground",borderRadius:8},children:[(0,c.jsxs)(p.kC,{sx:{px:"26px",py:"22px",color:"#FFF",flexDirection:"row",justifyContent:"space-between",alignItems:"center",borderBottom:"1px solid rgba(111, 110, 119, 0.2)"},children:[(0,c.jsx)(p.kC,{sx:{alignItems:"center"}}),(0,c.jsxs)(p.zx,{onClick:f,variant:"transparent",sx:{display:"flex",justifyContent:"center",alignItems:"center",p:0,fontSize:"12px",color:"#FFF"},children:["Copy\xa0",s?(0,c.jsx)(ea.HhX,{size:16,color:String(null==i?void 0:null===(n=i.colors)||void 0===n?void 0:n.success)}):(0,c.jsx)(ea.Fqs,{size:16,style:{marginLeft:"8px"}})]})]}),(0,c.jsx)(p.xu,{ref:l,as:"pre",sx:{color:"#c9d1d9",padding:"16px 20px",overflow:"auto"},children:t})]}))},ed={code:function(e){var n=e.children;return(0,c.jsx)(el,{children:n})},pre:function(e){var n=e.children,t=(0,er.Z)(e,["children"]);return(0,c.jsx)(eu,(0,d.Z)((0,u.Z)({},t),{children:n}))}},ex=function(e){var n=e.html,t=e.components,r=void 0===t?{}:t,i={replace:function(e){if((0,eo.Z)(e,ec.W_)&&e.attribs){var n=(0,ec.du)(e.children,i),t=(0,u.Z)({},r,ed)[e.name];if(t)return(0,c.jsx)(t,(0,d.Z)((0,u.Z)({name:e.name},e.attribs),{children:n}))}}};return(0,c.jsx)(c.Fragment,{children:(0,ec.ZP)(n,i)})},ef=function(e){var n=e.children.split("`").map(function(e,n){return n%2==1?(0,c.jsx)(el,{children:e}):e});return(0,c.jsx)(c.Fragment,{children:n})},eh=function(e){var n=e.number,t=e.title,r=e.excerpt,i=(0,er.Z)(e,["number","title","excerpt"]);return(0,c.jsx)(ei.OK,(0,d.Z)((0,u.Z)({className:"react-tabs__vertical__tab",selectedClassName:"react-tabs__vertical__tab--selected"},i),{children:(0,c.jsxs)(p.kC,{sx:{alignItems:"flex-start"},children:[(0,c.jsx)(ev,{number:n}),(0,c.jsxs)(p.xu,{sx:{ml:3,alignSelf:"center"},children:[(0,c.jsx)(p.X6,{as:"h4",sx:{color:"whiteButtonText",fontSize:"14px",fontWeight:"600"},children:(0,c.jsx)(ef,{children:t})}),r&&(0,c.jsx)(p.xv,{as:"p",sx:{mt:2,color:"textClear",fontSize:"13px",lineHeight:"24px"},children:(0,c.jsx)(ef,{children:r})})]})]})}))};eh.tabsRole="Tab";var ep,ev=function(e){var n=e.number;return(0,c.jsx)(p.kC,{sx:{height:"32px",width:"32px",alignItems:"center",justifyContent:"center",border:"1px solid #E4E2E4",borderRadius:"6px",bg:"grey07",color:"textClear",flexShrink:"0",fontSize:"13px"},children:n})},em=function(e){var n=e.isOpen,t=(0,w.v9)(function(e){return{isSimulatorAvailableForFramework:(0,F.Ql)(e),setupSteps:(0,I.qe)(e)}}),r=t.isSimulatorAvailableForFramework,i=t.setupSteps||[];return(0,x.useEffect)(function(){n&&Z.Xe.track({event:"slice-simulator:setup"})},[n]),(0,c.jsx)(M.Z,{isOpen:n,children:(0,c.jsx)(B.Z,{bodySx:{p:0,bg:"grey07",height:4===i.length?"640px":"480px"},Header:function(e){var n=e.radius;return(0,c.jsx)(p.kC,{sx:{position:"sticky",top:0,zIndex:1,p:"16px",pl:4,bg:"grey07",alignItems:"center",justifyContent:"space-between",borderTopLeftRadius:n,borderTopRightRadius:n,borderBottom:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.borders))}},children:(0,c.jsx)(p.X6,{sx:{fontSize:"14px",fontWeight:"600"},as:"h5",children:"Set up the simulator"})})},children:(0,c.jsxs)(ei.mQ,{defaultFocus:!0,className:"react-tabs__vertical",children:[(0,c.jsx)(ei.td,{className:"react-tabs__vertical__tab-list",children:i.map(function(e,n){return(0,c.jsx)(eh,{number:n+1,title:e.title,excerpt:e.description},e.title)})}),r?(0,c.jsx)(c.Fragment,{children:i.map(function(e){return(0,c.jsx)(ei.x4,{selectedClassName:"react-tabs__vertical__tab-panel--selected",className:"react-tabs__vertical__tab-panel",children:(0,c.jsx)(ex,{html:e.body})},e.title)})}):(0,c.jsx)(ei.x4,{selectedClassName:"react-tabs__vertical__tab-panel--selected",className:"react-tabs__vertical__tab-panel",children:"Framework not supported."})]})})})},eg=t(53559);(ep=o||(o={})).LOADING_SETUP="LOADING_SETUP",ep.LOADING_IFRAME="LOADING_IFRAME",ep.FAILED_SETUP="FAILED_SETUP",ep.FAILED_CONNECT="FAILED_CONNECT",ep.SUCCESS="SUCCESS";var eb=function(e){var n,t,i=e.slice,s=e.variation,a=(0,W.Z)(),l=a.checkSimulatorSetup,m=a.connectToSimulatorIframe,g=a.saveSliceMock,b=(0,w.v9)(function(e){return{simulatorUrl:(0,F.x0)(e),iframeStatus:(0,I.NL)(e),manifestStatus:(0,I.tD)(e).manifest,isWaitingForIFrameCheck:(0,I.oM)(e),endpoints:(0,F.gZ)(e)}}),C=b.simulatorUrl,j=b.iframeStatus,S=b.manifestStatus,k=b.isWaitingForIFrameCheck,y=b.endpoints,E=(0,x.useMemo)(function(){return{embedsUrl:y.PrismicOembed,env:"prod",unsplashUrl:y.PrismicUnsplash}},[y.PrismicOembed,y.PrismicUnsplash]),_=(0,x.useRef)(null),R=(0,x.useCallback)(function(){return l()},[]);(0,x.useEffect)(function(){l(),Z.Xe.track({event:"slice-simulator:open"})},[]);var z=(0,x.useRef)(!1);(0,x.useEffect)(function(){z.current=!0},[]);var N=function(e){z.current&&(z.current=!1,Z.Xe.track({event:"editor:widget-used",sliceId:e}))},O="ko"===S?o.FAILED_SETUP:"ok"===S?k||!j?o.LOADING_IFRAME:"ok"!==j?o.FAILED_CONNECT:o.SUCCESS:(0,o.LOADING_SETUP);(0,x.useEffect)(function(){if(O===o.FAILED_SETUP&&!_.current){var e=setInterval(function(){R()},3e3);_.current=e}},[O]),(0,x.useEffect)(function(){"ok"===S&&(_.current&&clearInterval(_.current),m())},[S]),(0,x.useEffect)(function(){O===o.FAILED_CONNECT&&Z.Xe.track({event:"slice-simulator:is-not-running"})},[O]),(0,x.useEffect)(function(){O===o.SUCCESS&&eo(!0)},[O]);var A=function(){m()},M=(0,x.useState)(T[r.DESKTOP]),U=M[0],P=M[1],B=(0,x.useMemo)(function(){return eg.id.fromSM(i.model)},[i.model]),H=(0,x.useState)(null),X=H[0],K=H[1],Y=(0,x.useMemo)(function(){var e,n;return(null==X?void 0:X.variation)===s.id?X:(null===(e=i.mocks)||void 0===e?void 0:e.find(function(e){return e.variation===s.id}))||{__TYPE__:"SharedSliceContent",variation:n=s.id,primary:{},items:[]}},[X,s.id]),J=(0,x.useMemo)(function(){return(0,q.renderSliceMock)(B,Y).id},[]),Q=(0,x.useCallback)(function(){return function(){return(0,d.Z)((0,u.Z)({},(0,q.renderSliceMock)(B,Y)),{id:J})}},[B,Y]),en=G(Q,800,[B,Y,]),er=(0,x.useState)(!1),ei=er[0],eo=er[1];return(0,c.jsxs)(p.kC,{sx:{flexDirection:"column",height:"100vh"},children:[(0,c.jsx)(em,{isOpen:O===o.FAILED_SETUP}),(0,c.jsx)(D,{slice:i,variation:s,isDisplayEditor:ei,actionsDisabled:O!==o.SUCCESS,toggleIsDisplayEditor:function(){return eo(!ei)},onSaveMock:function(){return X&&g({libraryID:i.from,sliceID:i.model.id,mocks:(i.mocks||[]).filter(function(e){return e.variation!==X.variation}).concat(X)})}}),(0,c.jsx)(p.xu,{sx:{flex:1,bg:"grey07",p:3,display:"flex",flexDirection:"column",height:"calc(100% - 73px - 16px)"},children:(0,c.jsxs)(p.kC,{sx:{flex:1,flexDirection:"row",position:"relative",width:"100%",height:"100%"},children:[(0,c.jsxs)(v.xR,{sx:{display:"flex",height:"100%",flexDirection:"column",flex:1,minWidth:0},children:[(0,c.jsx)(L,{handleScreenSizeChange:P,screenDimensions:U,actionsDisabled:O!==o.SUCCESS}),O===o.FAILED_CONNECT?(0,c.jsx)(et,{onRetrigger:A}):null,O===o.SUCCESS?(0,c.jsx)($,{apiContent:en,screenDimensions:U,simulatorUrl:C}):(0,c.jsx)(c.Fragment,{children:O===o.LOADING_IFRAME?(0,c.jsxs)(ee,{children:[(0,c.jsx)(p.$j,{variant:"styles.spinner"}),(0,c.jsx)($,{apiContent:en,screenDimensions:U,simulatorUrl:C,dryRun:!0})]}):null})]}),O===o.SUCCESS?(0,c.jsx)(p.xu,{className:"editor",sx:(0,u.Z)({marginLeft:"16px",maxWidth:"440px",minWidth:"440px",overflowY:"auto"},ei?{display:"flex",flexDirection:"column"}:{display:"none"}),children:(0,c.jsx)(h.SV,{renderError:function(){return(0,c.jsx)(h.Iq,{title:"Editor error",description:"An error occurred while rendering the editor."})},children:(0,c.jsx)(x.Suspense,{children:(0,c.jsx)(f.kS,{config:E,content:Y,onContentChange:function(e){K(e),N(i.model.id)},sharedSlice:B},s.id)})})}):null]})}),!!(null===(n=i.screenshots[s.id])||void 0===n?void 0:n.url)&&(0,c.jsx)(V,{sliceName:i.model.name,screenshotUrl:null===(t=i.screenshots[s.id])||void 0===t?void 0:t.url})]})},eC=t(28684),ej=(0,t(57880).y)(eb);function eS(){var e=(0,eC.Z)().slice;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(l(),{children:(0,c.jsxs)("title",{children:[e?"Simulator: ".concat(e.model.name):"Simulator"," - Slice Machine"]})}),(0,c.jsx)(ej,{})]})}},28684:function(e,n,t){"use strict";var r=t(92521),i=t(90374),o=t(5632),s=t(2784),c=t(56580),a=function(){var e=(0,o.useRouter)(),n=(0,i.Z)().initSliceStore,t=(0,c.v9)(function(n){return{slice:(0,r.tL)(n,e.query.lib,e.query.sliceName)}}).slice;if((0,s.useEffect)(function(){t?n(t):e.replace("/")},[n,t,e]),!t)return{};var a=t.model.variations.find(function(n){return n.id===e.query.variation});return a?{slice:t,variation:a}:(e.replace("/"),{})};n.Z=a},57880:function(e,n,t){"use strict";t.d(n,{y:function(){return c}});var r=t(62230),i=t(52322);t(2784);var o=t(28684),s=t(95583),c=function(e){return function(n){var t=n.pageProps,c=(0,o.Z)(),a=c.slice,l=c.variation;return a&&l?(0,i.jsx)(e,(0,r.Z)({slice:a,variation:l},t)):((0,s.gx)("/"),null)}}}},function(e){e.O(0,[789,872,851,505,774,888,179],function(){return e(e.s=30755)}),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._1k08lzu3{height:calc(var(--_7j49md4k) - var(--_7j49mdh))}._1k08lzu5{height:calc(var(--_7j49md49) - var(--_7j49md45));width:calc(var(--_7j49md49) - var(--_7j49md45))}._1k08lzu7{box-shadow:inset 0 calc(-1 * var(--_7j49mdh)) 0 0 var(--_7j49md1d);height:calc(var(--_7j49md4k) - var(--_7j49mdh));-ms-overflow-style:none;scrollbar-width:none}._1k08lzu7::-webkit-scrollbar{display:none}._1k08lzu3+._1k08lzu6>._1k08lzu7{padding-top:var(--_7j49mdh)}._1k08lzu8:last-child:before,:not(:is(:focus,:hover,[data-state=active]))+._1k08lzu8:before{content:"";background-color:var(--_7j49md1e);bottom:var(--_7j49md51);height:var(--_7j49md4g);left:calc(-1 * var(--_7j49md4x));position:absolute;width:var(--_7j49mdh)}._1k08lzu9{max-width:256px}._1k08lzu9[data-state=active]{color:var(--_7j49md1j)}._1k08lzu9:is(:focus,:hover,[data-state=active]):before{content:"";background-color:var(--_7j49md19);border-color:var(--_7j49md1d);border-top-left-radius:var(--_7j49md7);border-top-right-radius:var(--_7j49md7);border-style:var(--_7j49mdf) var(--_7j49mdf) var(--_7j49mdd);border-width:var(--_7j49mdh);box-sizing:border-box;height:calc(var(--_7j49md4q) + var(--_7j49mdh));left:calc(-1 * var(--_7j49mdh));position:absolute;top:calc(-1 * var(--_7j49mdh));width:calc(var(--_7j49md4q) + var(--_7j49mdh))}._1k08lzub{margin-right:calc(-1 * var(--_7j49md51))}:is(:focus,:hover,[data-state=active])>._1k08lzub{visibility:visible}._1k08lzub:has(>[data-state=open]){visibility:visible}._1k08lzuc{box-shadow:inset 0 calc(-1 * var(--_7j49mdh)) 0 0 var(--_7j49md1d),0 calc(-1 * var(--_7j49mdh)) 0 0 var(--_7j49md1a)}._1k08lzud[data-state=inactive]{display:none}:is(._1k08lzu2,._1k08lzud)>._2a96i71{border-radius:var(--_7j49md3);border-style:var(--_7j49mdd)}._2a96i72:last-child{border-bottom-color:var(--_7j49md3l)}._1k08lzud>._2a96i71>._2a96i73:not(:first-child){margin-top:var(--_7j49md54)}._1nkpwww0{border-radius:3px}.kedahr2{height:240px}.kedahr3{height:320px}.kedahr6:focus-visible{box-shadow:0 0 0 4px rgba(123,101,220,.1)}.kedahr6[data-disabled]{opacity:var(--_7j49md40)}.kedahr6:not([data-disabled]){cursor:var(--_7j49md3o)}.kedahr7{order:0}.kedahr4>.kedahr7{padding:calc(var(--_7j49md56) - var(--_7j49mdh))}.kedahr5>.kedahr7{background-color:var(--_7j49md1a);margin-inline:calc(var(--_7j49md54) - var(--_7j49mdh));margin-top:calc(var(--_7j49md54) - var(--_7j49mdh));padding:var(--_7j49md54)}.kedahr9:not([src]){visibility:hidden}.kedahra:before{content:"";background-color:var(--_7j49md1j);inset:var(--_7j49md4w);opacity:var(--_7j49md3y);position:absolute}.kedahr6:focus-visible .kedahra,.kedahr6:not([data-disabled]) .kedahr7:hover>.kedahra{visibility:visible}.kedahr6:not([data-disabled]) .kedahra:has(:focus-visible){visibility:visible}.kedahr4>.kedahrb{background-color:var(--_7j49md18)}.kedahr4>.kedahrb:not(:first-child){border-top-color:var(--_7j49md1d);border-top-style:inherit;border-top-width:inherit}.kedahrc{order:1}.kedahr4>.kedahrc{padding-left:calc(var(--_7j49md53) - var(--_7j49mdh));padding-right:calc(var(--_7j49md51) - var(--_7j49mdh))}.kedahr5>.kedahrc{padding-inline:calc(var(--_7j49md54) - var(--_7j49mdh))}.kedahrd{order:2}.kedahr4>.kedahrd{padding-inline:calc(var(--_7j49md53) - var(--_7j49mdh))}.kedahr5>.kedahrd{padding-inline:calc(var(--_7j49md54) - var(--_7j49mdh))}.kedahre{margin-bottom:calc((1.5rem - 1rem) / 2)}.kedahrf{background-color:#ebe7fe;color:#5746af}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._1nkpwww0{border-radius:3px}.kedahr2{height:240px}.kedahr3{height:320px}.kedahr6:focus-visible{box-shadow:0 0 0 4px rgba(123,101,220,.1)}.kedahr6[data-disabled]{opacity:var(--_7j49md40)}.kedahr6:not([data-disabled]){cursor:var(--_7j49md3o)}.kedahr7{order:0}.kedahr4>.kedahr7{padding:calc(var(--_7j49md56) - var(--_7j49mdh))}.kedahr5>.kedahr7{background-color:var(--_7j49md1a);margin-inline:calc(var(--_7j49md54) - var(--_7j49mdh));margin-top:calc(var(--_7j49md54) - var(--_7j49mdh));padding:var(--_7j49md54)}.kedahr9:not([src]){visibility:hidden}.kedahra:before{content:"";background-color:var(--_7j49md1j);inset:var(--_7j49md4w);opacity:var(--_7j49md3y);position:absolute}.kedahr6:focus-visible .kedahra,.kedahr6:not([data-disabled]) .kedahr7:hover>.kedahra{visibility:visible}.kedahr6:not([data-disabled]) .kedahra:has(:focus-visible){visibility:visible}.kedahr4>.kedahrb{background-color:var(--_7j49md18)}.kedahr4>.kedahrb:not(:first-child){border-top-color:var(--_7j49md1d);border-top-style:inherit;border-top-width:inherit}.kedahrc{order:1}.kedahr4>.kedahrc{padding-left:calc(var(--_7j49md53) - var(--_7j49mdh));padding-right:calc(var(--_7j49md51) - var(--_7j49mdh))}.kedahr5>.kedahrc{padding-inline:calc(var(--_7j49md54) - var(--_7j49mdh))}.kedahrd{order:2}.kedahr4>.kedahrd{padding-inline:calc(var(--_7j49md53) - var(--_7j49mdh))}.kedahr5>.kedahrd{padding-inline:calc(var(--_7j49md54) - var(--_7j49mdh))}.kedahre{margin-bottom:calc((1.5rem - 1rem) / 2)}.kedahrf{background-color:#ebe7fe;color:#5746af}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._1k08lzu3{height:calc(var(--_7j49md4k) - var(--_7j49mdh))}._1k08lzu5{height:calc(var(--_7j49md49) - var(--_7j49md45));width:calc(var(--_7j49md49) - var(--_7j49md45))}._1k08lzu7{box-shadow:inset 0 calc(-1 * var(--_7j49mdh)) 0 0 var(--_7j49md1d);height:calc(var(--_7j49md4k) - var(--_7j49mdh));-ms-overflow-style:none;scrollbar-width:none}._1k08lzu7::-webkit-scrollbar{display:none}._1k08lzu3+._1k08lzu6>._1k08lzu7{padding-top:var(--_7j49mdh)}._1k08lzu8:last-child:before,:not(:is(:focus,:hover,[data-state=active]))+._1k08lzu8:before{content:"";background-color:var(--_7j49md1e);bottom:var(--_7j49md51);height:var(--_7j49md4g);left:calc(-1 * var(--_7j49md4x));position:absolute;width:var(--_7j49mdh)}._1k08lzu9{max-width:256px}._1k08lzu9[data-state=active]{color:var(--_7j49md1j)}._1k08lzu9:is(:focus,:hover,[data-state=active]):before{content:"";background-color:var(--_7j49md19);border-color:var(--_7j49md1d);border-top-left-radius:var(--_7j49md7);border-top-right-radius:var(--_7j49md7);border-style:var(--_7j49mdf) var(--_7j49mdf) var(--_7j49mdd);border-width:var(--_7j49mdh);box-sizing:border-box;height:calc(var(--_7j49md4q) + var(--_7j49mdh));left:calc(-1 * var(--_7j49mdh));position:absolute;top:calc(-1 * var(--_7j49mdh));width:calc(var(--_7j49md4q) + var(--_7j49mdh))}._1k08lzub{margin-right:calc(-1 * var(--_7j49md51))}:is(:focus,:hover,[data-state=active])>._1k08lzub{visibility:visible}._1k08lzub:has(>[data-state=open]){visibility:visible}._1k08lzuc{box-shadow:inset 0 calc(-1 * var(--_7j49mdh)) 0 0 var(--_7j49md1d),0 calc(-1 * var(--_7j49mdh)) 0 0 var(--_7j49md1a)}._1k08lzud[data-state=inactive]{display:none}:is(._1k08lzu2,._1k08lzud)>._2a96i71{border-radius:var(--_7j49md3);border-style:var(--_7j49mdd)}._2a96i72:last-child{border-bottom-color:var(--_7j49md3l)}._1k08lzud>._2a96i71>._2a96i73:not(:first-child){margin-top:var(--_7j49md54)}._18bjhbz0{max-width:498px;min-height:400px;background-color:var(--_7j49md18)}._18bjhbz1{background-size:cover;background-color:transparent;border-radius:var(--_7j49md3);border-style:var(--_7j49mdd);height:100%;max-width:100%}._18bjhbz1 ._18bjhbz3{padding:64px}._18bjhbz4{font-size:18px;font-weight:600;line-height:32px}._18bjhbz5{font-weight:400;line-height:24px}._18bjhbz1 ._18bjhbz5{max-width:464px;align-self:center}._18bjhbz1 ._18bjhbz6{justify-content:center}.kedahr2{height:240px}.kedahr3{height:320px}.kedahr6:focus-visible{box-shadow:0 0 0 4px rgba(123,101,220,.1)}.kedahr6[data-disabled]{opacity:var(--_7j49md40)}.kedahr6:not([data-disabled]){cursor:var(--_7j49md3o)}.kedahr7{order:0}.kedahr4>.kedahr7{padding:calc(var(--_7j49md56) - var(--_7j49mdh))}.kedahr5>.kedahr7{background-color:var(--_7j49md1a);margin-inline:calc(var(--_7j49md54) - var(--_7j49mdh));margin-top:calc(var(--_7j49md54) - var(--_7j49mdh));padding:var(--_7j49md54)}.kedahr9:not([src]){visibility:hidden}.kedahra:before{content:"";background-color:var(--_7j49md1j);inset:var(--_7j49md4w);opacity:var(--_7j49md3y);position:absolute}.kedahr6:focus-visible .kedahra,.kedahr6:not([data-disabled]) .kedahr7:hover>.kedahra{visibility:visible}.kedahr6:not([data-disabled]) .kedahra:has(:focus-visible){visibility:visible}.kedahr4>.kedahrb{background-color:var(--_7j49md18)}.kedahr4>.kedahrb:not(:first-child){border-top-color:var(--_7j49md1d);border-top-style:inherit;border-top-width:inherit}.kedahrc{order:1}.kedahr4>.kedahrc{padding-left:calc(var(--_7j49md53) - var(--_7j49mdh));padding-right:calc(var(--_7j49md51) - var(--_7j49mdh))}.kedahr5>.kedahrc{padding-inline:calc(var(--_7j49md54) - var(--_7j49mdh))}.kedahrd{order:2}.kedahr4>.kedahrd{padding-inline:calc(var(--_7j49md53) - var(--_7j49mdh))}.kedahr5>.kedahrd{padding-inline:calc(var(--_7j49md54) - var(--_7j49mdh))}.kedahre{margin-bottom:calc((1.5rem - 1rem) / 2)}.kedahrf{background-color:#ebe7fe;color:#5746af}._76k20u4:not(:last-child){margin-right:var(--_7j49md54)}._76k20u4[data-state=active]{box-shadow:inset 0 -1px 0 0 currentColor,0 1px 0 0 currentColor;color:var(--_7j49md3f)}._76k20u5{line-height:32px}._76k20u6{flex:1 1}._76k20u6[data-state=inactive]{display:none}._8uty130{line-height:32px}._3uvawd0{grid-area:content;overflow:hidden}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
._1nkpwww0{border-radius:3px}.kedahr2{height:240px}.kedahr3{height:320px}.kedahr6:focus-visible{box-shadow:0 0 0 4px rgba(123,101,220,.1)}.kedahr6[data-disabled]{opacity:var(--
|
|
1
|
+
._1nkpwww0{border-radius:3px}.kedahr2{height:240px}.kedahr3{height:320px}.kedahr6:focus-visible{box-shadow:0 0 0 4px rgba(123,101,220,.1)}.kedahr6[data-disabled]{opacity:var(--_7j49md40)}.kedahr6:not([data-disabled]){cursor:var(--_7j49md3o)}.kedahr7{order:0}.kedahr4>.kedahr7{padding:calc(var(--_7j49md56) - var(--_7j49mdh))}.kedahr5>.kedahr7{background-color:var(--_7j49md1a);margin-inline:calc(var(--_7j49md54) - var(--_7j49mdh));margin-top:calc(var(--_7j49md54) - var(--_7j49mdh));padding:var(--_7j49md54)}.kedahr9:not([src]){visibility:hidden}.kedahra:before{content:"";background-color:var(--_7j49md1j);inset:var(--_7j49md4w);opacity:var(--_7j49md3y);position:absolute}.kedahr6:focus-visible .kedahra,.kedahr6:not([data-disabled]) .kedahr7:hover>.kedahra{visibility:visible}.kedahr6:not([data-disabled]) .kedahra:has(:focus-visible){visibility:visible}.kedahr4>.kedahrb{background-color:var(--_7j49md18)}.kedahr4>.kedahrb:not(:first-child){border-top-color:var(--_7j49md1d);border-top-style:inherit;border-top-width:inherit}.kedahrc{order:1}.kedahr4>.kedahrc{padding-left:calc(var(--_7j49md53) - var(--_7j49mdh));padding-right:calc(var(--_7j49md51) - var(--_7j49mdh))}.kedahr5>.kedahrc{padding-inline:calc(var(--_7j49md54) - var(--_7j49mdh))}.kedahrd{order:2}.kedahr4>.kedahrd{padding-inline:calc(var(--_7j49md53) - var(--_7j49mdh))}.kedahr5>.kedahrd{padding-inline:calc(var(--_7j49md54) - var(--_7j49mdh))}.kedahre{margin-bottom:calc((1.5rem - 1rem) / 2)}.kedahrf{background-color:#ebe7fe;color:#5746af}._18bjhbz0{max-width:498px;min-height:400px;background-color:var(--_7j49md18)}._18bjhbz1{background-size:cover;background-color:transparent;border-radius:var(--_7j49md3);border-style:var(--_7j49mdd);height:100%;max-width:100%}._18bjhbz1 ._18bjhbz3{padding:64px}._18bjhbz4{font-size:18px;font-weight:600;line-height:32px}._18bjhbz5{font-weight:400;line-height:24px}._18bjhbz1 ._18bjhbz5{max-width:464px;align-self:center}._18bjhbz1 ._18bjhbz6{justify-content:center}.ovkapw0:focus-visible{outline:none;-webkit-text-decoration-line:underline;text-decoration-line:underline}.ovkapw1{font-size:1.2rem;width:18px;height:18px}.ovkapw2{font-size:1rem;width:16px;height:16px}.ovkapw3{font-size:inherit;width:inherit;height:inherit}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.gdfsm51{border-collapse:collapse;table-layout:fixed}.gdfsm55{vertical-align:middle}.gdfsm55:first-child{padding-right:var(--
|
|
1
|
+
.gdfsm51{border-collapse:collapse;table-layout:fixed}.gdfsm55{vertical-align:middle}.gdfsm55:first-child{padding-right:var(--_7j49md4w);width:var(--_7j49md4i)}.gdfsm55:last-child{padding-left:var(--_7j49md4w);padding-right:var(--_7j49md54);width:var(--_7j49md4k)}.gdfsm52 .gdfsm55{font-size:12px;font-weight:500}.gdfsm53 .gdfsm55{border-top-style:var(--_7j49mdf);font-size:14px}.gdfsm53 .gdfsm55:nth-child(2){color:var(--_7j49md1j);font-weight:600}.gdfsm52 .gdfsm55:first-child>.gdfsm56{padding-left:var(--_7j49md50)}:is(.gdfsm53,.gdfsm52) .gdfsm55:not(:first-child):not(:last-child)>.gdfsm56{display:revert;overflow-x:hidden;text-overflow:ellipsis;white-space:nowrap}._18bjhbz0{max-width:498px;min-height:400px;background-color:var(--_7j49md18)}._18bjhbz1{background-size:cover;background-color:transparent;border-radius:var(--_7j49md3);border-style:var(--_7j49mdd);height:100%;max-width:100%}._18bjhbz1 ._18bjhbz3{padding:64px}._18bjhbz4{font-size:18px;font-weight:600;line-height:32px}._18bjhbz5{font-weight:400;line-height:24px}._18bjhbz1 ._18bjhbz5{max-width:464px;align-self:center}._18bjhbz1 ._18bjhbz6{justify-content:center}
|