1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7639],{15933:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/p/[deployId]",function(){return n(13827)}])},45958:function(e,t,n){"use strict";n.d(t,{w:function(){return d}});var o=n(87800),u=n(76573),l=n(91659),r=n(36118);function d(e){let{children:t}=e;return(0,o.tZ)(u.r,{placeItems:"center",height:"100vh",children:(0,o.BX)(l.g,{alignItems:"center",children:[(0,o.tZ)(r.$,{}),t]})})}},13827:function(e,t,n){"use strict";n.r(t),n.d(t,{Component:function(){return p},default:function(){return c}});var o=n(87800),u=n(58034),l=n(45958),r=n(93623),d=n(86677),i=n(41640),a=n(8802);let s=i.Ry({deployId:i.Z_()});function c(){let e=(0,d.useRouter)();return s.safeParse(e.query).success?(0,o.tZ)(p,{}):(0,o.tZ)(l.w,{})}function p(){let e=(0,d.useRouter)(),{deployId:t}=s.parse(e.query),[n,i]=(0,r.Cf)({deployId:t});if(i)return(0,o.tZ)(l.w,{});if(!n)return(0,o.tZ)(u.xu,{display:"grid",placeItems:"center",h:"100vh",children:"Deployment not found"});let c=(0,a.ff$)(n);return c?(e.replace("/p/".concat(t,"/").concat(c.canonical)),(0,o.tZ)(l.w,{})):(0,o.tZ)(u.xu,{display:"grid",placeItems:"center",h:"100vh",children:"Page not found"})}},93623:function(e,t,n){"use strict";n.d(t,{Cf:function(){return w},MO:function(){return y},N1:function(){return h},fn:function(){return D},hf:function(){return g},js:function(){return b}});var o=n(8802),u=n(76014),l=n(35787),r=n(27378),d=n(92040),i=n(82696),a=n(11500),s=n(21092),c=n(56169),p=n(41640);let f=(0,u.PL)(o.$9H),v=(0,u.Ag)(f,"users/:userId/projects/:projectId/notionDeploys","users/:userId/projects/:projectId/notionDeploys/:deployId"),y=e=>{var t;let{userId:n,projectId:o}=e,[u,d]=(0,r.useState)(!1),[a,s]=(0,r.useState)(null),[c]=(0,l.ky)(n&&o&&a?v.getDocument({userId:n,projectId:o,deployId:a}):null),[p]=(0,l.Kx)(n&&o?v.getCollection({userId:n,projectId:o}):null),f=null!==(t=null==p?void 0:p.docs.find(e=>{var t;return(null===(t=e.data())||void 0===t?void 0:t.deployStatus)==="deployed"}))&&void 0!==t?t:null;return{deployModel:null!=f?f:c,onDeploy:function(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];n&&o&&v.addDocument({pageId:e,includeVideo:t},{userId:n,projectId:o}).then(e=>{s(e.id)})},onDelete:()=>{var e;let t=null!==(e=null==f?void 0:f.id)&&void 0!==e?e:a;n&&o&&t&&(0,i.oe)(v.getDocument({userId:n,projectId:o,deployId:t}))},isOpen:u,open:()=>{d(!0),s(null)},close:()=>d(!1)}},m=(0,u.PL)(o.Y2$),g=(0,u.Ag)(m,"users/:userId/deployments","users/:userId/deployments/:deployId"),I=(0,u.PL)(o.yX2);(0,u.Ag)(I,"users/:userId/deployments/:deployId/pages","users/:userId/deployments/:deployId/pages/:pageId");let h=p.Ry({displayType:p.Km(["single","multi","course"]).default("single"),showVideo:p.O7(),customization:o.Y2$.shape.customization,metadata:o.Y2$.shape.metadata,leadGen:o.Lh1.nullable().default(null)}).refine(e=>"course"!==e.displayType||!!e.showVideo,{path:["showVideo"],message:"Video is required for Course Theme"});function w(e){let{deployId:t}=e,[n,o]=(0,l.z3)((0,i.IO)((0,i.B$)(u.RZ,"deployments").withConverter(m.converter),(0,i.ar)("deployId","==",t)));return[null==n?void 0:n[0],o]}function b(e){let{deployId:t,userId:n}=e,o=(0,r.useRef)(!1);(0,r.useEffect)(()=>{if(!t||!n||o.current)return;o.current=!0;let e=g.getDocument({deployId:t,userId:n});(0,i.r7)(e,"stats.views",(0,i.nP)(1))},[t,n])}let C=(0,c.Q)(o.gV);function D(e){var t;let{project:n,userId:o}=e,c=(0,s.b1)(),{createJob:p}=C({resetOnDone:!0,onDone:e=>{v("complete"===e?"deployed":"error")}}),[f,v]=(0,r.useState)("idle"),[y,m]=(0,l.ky)((null==n?void 0:null===(t=n.data())||void 0===t?void 0:t.deploymentId)?g.getDocument({deployId:n.data().deploymentId,userId:o}):null),I=null==n?void 0:n.id,h=(0,r.useCallback)(async()=>{if(!I||!y)return;let e=(0,i.qs)(u.RZ);(await (0,i.PL)((0,i.IO)(a.y.getCollection({projectId:I,userId:o}),(0,i.Xo)("order")))).forEach(t=>{e.update(t.ref,{content:t.data().content})}),e.delete(y.ref),e.update(n.ref,{deploymentId:null});try{await e.commit()}catch(e){console.error(e)}},[y,I,o]),w=(0,r.useCallback)(async e=>{if(I){v("deploying");try{await p({projectId:I,options:e})}catch(e){console.error(e),v("error")}}},[I,p]),[b]=(0,l.Kx)((null==n?void 0:n.id)?(0,i.IO)(a.y.getCollection({projectId:null==n?void 0:n.id,userId:o}),(0,i.Xo)("order","asc")):null),D=(0,r.useMemo)(()=>null==b?void 0:b.docs.map(e=>({value:e.id,label:e.data().name})),[b]),j=null==c?void 0:c.didPurchase;return{state:f,deployDefaults:(0,r.useMemo)(()=>!m&&(0,d.z)(y)?{displayType:y.data().displayType,customization:{...y.data().customization,public:!j||y.data().customization.public,hideAttribution:!!j&&y.data().customization.hideAttribution},leadGen:y.data().leadGen,showVideo:!!y.data().videoUrl}:m?void 0:{displayType:"multi",customization:{public:!0,hideAttribution:!1,logoUrl:"",pickPages:null,primaryColor:"#000000"},leadGen:null,showVideo:!1},[j,y,m]),didPay:j,billing:c,deploy:w,deployment:y,undeploy:h,fetching:m,deployablePagesOptions:D}}},11500:function(e,t,n){"use strict";n.d(t,{y:function(){return r}});var o=n(8802),u=n(76014);let l=(0,u.PL)(o.LMJ),r=(0,u.Ag)(l,"users/:userId/projects/:projectId/pages","users/:userId/projects/:projectId/pages/:pageId")},38078:function(e,t,n){"use strict";n.d(t,{L:function(){return r}});var o=n(8802),u=n(76014);let l=(0,u.PL)(o.oIs),r=(0,u.Ag)(l,"users/:userId/jobs","users/:userId/jobs/:jobId")},56169:function(e,t,n){"use strict";n.d(t,{C:function(){return a},Q:function(){return i}});var o=n(27378),u=n(35787),l=n(38078),r=n(99010),d=n(82696);function i(e){let t=e.shape.type.value;return function(e){var n,d,i,a,s;let c=(0,r.aF)(),p=c.loading?null:null===(n=c.user)||void 0===n?void 0:n.uid,[f,v]=(0,o.useState)(!1),[y,m]=(0,o.useState)(null),[g]=(0,u.ky)(y&&p?l.L.getDocument({jobId:y,userId:p}):null),I=(0,o.useCallback)(async e=>{y||f||!p||(v(!0),m((await l.L.addDocument({action:{type:t,payload:e},status:"pending"},{userId:p})).id),v(!1))},[p,y,f]),h=["pending","in-progress"].includes((null==g?void 0:null===(d=g.data())||void 0===d?void 0:d.status)||"")||f,w=["complete","error"].includes((null==g?void 0:null===(i=g.data())||void 0===i?void 0:i.status)||""),b=(0,o.useRef)(null==e?void 0:e.onDone);b.current=null==e?void 0:e.onDone;let C=null==e?void 0:e.resetOnDone;return(0,o.useEffect)(()=>
1{if(w&&b.current){var e;b.current(null==g?void 0:null===(e=g.data())||void 0===e?void 0:e.status)}w&&C&&(m(null),v(!1))},[w,C]),{isLoading:h,reset:(0,o.useCallback)(()=>{m(null),v(!1)},[]),job:null==g?void 0:g.data(),status:null==g?void 0:null===(a=g.data())||void 0===a?void 0:a.status,error:null==g?void 0:null===(s=g.data())||void 0===s?void 0:s.error,createJob:I}}}function a(e){var t;let n=e.shape.type.value,u=(0,r.aF)(),i=u.loading?null:null===(t=u.user)||void 0===t?void 0:t.uid;return{createJob:(0,o.useCallback)(async(e,t)=>{if(!i)return null;let o=await l.L.addDocument({action:{type:n,payload:e},status:"pending"},{userId:i});if(t){let e=(0,d.cf)(l.L.getDocument({jobId:o.id,userId:i}),n=>{var o;let u=null===(o=n.data())||void 0===o?void 0:o.status;("complete"===u||"error"===u)&&(t(u),e())})}return o.id},[i,n])}}},76573:function(e,t,n){"use strict";n.d(t,{r:function(){return r}});var o=n(96470),u=n(34398),l=n(24246),r=(0,o.G)(function(e,t){let{templateAreas:n,gap:o,rowGap:r,columnGap:d,column:i,row:a,autoFlow:s,autoRows:c,templateRows:p,autoColumns:f,templateColumns:v,...y}=e;return(0,l.jsx)(u.m.div,{ref:t,__css:{display:"grid",gridTemplateAreas:n,gridGap:o,gridRowGap:r,gridColumnGap:d,gridAutoColumns:f,gridColumn:i,gridRow:a,gridAutoFlow:s,gridAutoRows:c,gridTemplateRows:p,gridTemplateColumns:v},...y})});r.displayName="Grid"}},function(e){e.O(0,[9774,2888,179],function(){return e(e.s=15933)}),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.