1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9218],{39218:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return Pe}});var i,a,o=n(16835),r=n(50029),l=n(59499),s=n(87794),c=n.n(s),d=n(67294),u=n(19521),p=n(72587),v=(0,u.iv)(["background-color:#050607;position:fixed;width:auto;height:auto;top:5px;right:15px;z-index:210;border:1px solid black;border-radius:1em;box-shadow:5px 5px 5px #666;opacity:0.95;padding:0.5em;box-sizing:border-box;transition:width ease 0.3s;width:180px;&.is-collapsed{width:43px;.form-control > div,.nva-instant-preview__deploy-wrapper,.nva-instant-preview__login{display:none;}}.form-control{margin:0 auto;font-family:sans-serif;font-size:12pt;display:flex;box-sizing:border-box;flex-direction:column;}.nva-instant-preview__label-wrapper,.nva-instant-preview__controls-wrapper{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:8px;label{font-size:0.9em;color:#9b9b9c;font-weight:bold;white-space:nowrap;}}input{width:55px;}button{background:transparent;border:1px solid #9b9b9c;border-radius:5px;color:white;padding:5px 8px;font-size:0.9em;display:flex;align-items:center;height:34px;width:150px;justify-content:space-between;&:hover{cursor:pointer;}&.submit{width:115px;}&.edit{width:100px;}.image-container{position:static;width:auto;height:auto;}}.nva-instant-preview__env{margin:0 auto 0 0;color:#18c964;font-size:1.25rem;}.nva-instant-preview__login{display:flex;gap:8px;align-items:center;justify-content:end;margin:16px 25px 0 auto;p{color:#fff;margin:0;}button{gap:8px;width:auto;}}.nva-instant-preview__deploy-buttons-wrapper{display:flex;gap:8px;}.nva-instant-preview__deploy-button-group{position:relative;display:flex;> button:first-of-type{border-top-right-radius:0;border-bottom-right-radius:0;}> button:last-of-type{border-top-left-radius:0;border-bottom-left-radius:0;border-left:none;}dialog{top:100%;left:unset;right:0;margin:0;padding:16px;border:1px solid #9b9b9c;border-radius:5px;box-sizing:border-box;> div{display:flex;justify-content:end;gap:8px;}p{font-size:var(--g-font-size-caption);line-height:var(--g-line-height-caption);text-align:right;color:hsl(var(--g-color-error));margin:0 0 8px;}}}.nva-instant-preview-v2__deploy-button-group{position:relative;display:flex;button:nth-last-child(n + 2):first-of-type{border-top-right-radius:0;border-bottom-right-radius:0;}button:nth-last-child(n + 2):last-of-type{border-top-left-radius:0;border-bottom-left-radius:0;border-left:none;}dialog{top:100%;left:unset;right:0;margin:0;padding:16px;border:1px solid #9b9b9c;border-radius:5px;box-sizing:border-box;> div{display:flex;justify-content:end;gap:8px;}p{font-size:var(--g-font-size-caption);line-height:var(--g-line-height-caption);text-align:right;color:hsl(var(--g-color-error));margin:0 0 8px;}}}.nva-instant-preview__deploy-buttons{display:flex;align-items:end;flex-direction:column;button{position:relative;gap:8px;width:auto;}}.nva-instant-preview__button{&.is-loading{pointer-events:none;color:transparent;&::after{content:'';position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:14px;height:14px;border-radius:50%;border:2px solid #fff;border-color:#fff transparent #fff transparent;animation:turn 1.2s linear infinite;}@keyframes turn{0%{transform:translate(-50%,-50%) rotate(0deg);}100%{transform:translate(-50%,-50%) rotate(360deg);}}img{opacity:0;}}&.has-error{border-color:hsl(var(--g-color-error));color:hsl(var(--g-color-error));img{opacity:0;}picture{position:relative;display:block;&::after{content:'';display:block;width:14px;height:14px;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);background:url(/svg/error.svg) no-repeat center;}}}&:disabled{opacity:0.5;pointer-events:none;}}.nva-instant-preview__button--dark{color:#050607;border:1px solid #050607;&.is-loading::after{border-color:#050607 transparent #050607 transparent;}}.nva-instant-preview__button--text{color:#050607;border:none;}.nva-instant-preview__deploy-datetime{width:180px;padding:7px 8px;border-radius:5px;border:1px solid #9b9b9c;margin-bottom:8px;box-sizing:border-box;}.nva-instant-preview__deploy-datetime-picker > div{pointer-events:none;}.nva-instant-preview__deploy-link{color:#35b0fd;display:flex;align-items:center;gap:4px;div{width:fit-content;}}.nva-instant-preview__deploy-wrapper{display:flex;flex-direction:column;align-items:center;}.nva-instant-preview__deploy-status{font-size:var(--g-font-size-caption);line-height:var(--g-line-height-caption);color:hsl(var(--g-color-success-300));margin:0;&.is-error{color:hsl(var(--g-color-error));}}@media (max-width:","){.nva-instant-preview__deploy-wrapper,.nva-instant-preview__login{display:none;}}@media (min-width:","){width:auto;.form-control{flex-direction:row;}.nva-instant-preview__label-wrapper,.nva-instant-preview__controls-wrapper{flex-direction:row;label{font-size:0.9em;color:#9b9b9c;font-weight:bold;}}.nva-instant-preview__info{color:white;width:100%;table{border-collapse:collapse;width:100%;}thead tr,tr:not(:last-child){border-bottom:1px solid #9b9b9c;}th,td{padding:4px;width:33.33%;vertical-align:top;}th{font-weight:700;text-align:left;}td ul{padding:0;}td li{display:flex;align-items:center;justify-content:space-between;width:100%;margin-bottom:4px;&:last-child{margin-bottom:0;}}button{border:none;padding:0;width:fit-content;height:fit-content;}}.nva-instant-preview__deploy-wrapper{display:flex;align-items:end;gap:16px;}.nva-instant-preview__deploy{display:flex;align-items:center;justify-content:flex-end;
1gap:16px;margin-top:16px;width:100%;}}"],p.dr.md,p.j$.md),g=u.ZP.div.withConfig({componentId:"sc-12tyh7p-0"})(["width:100vw;height:100vh;position:fixed;top:0;left:0;z-index:300;background:rgba(0,0,0,0.90);display:flex;justify-content:center;align-items:center;.lds-dual-ring{display:inline-block;width:80px;height:80px;&:after{content:' ';display:block;width:64px;height:64px;border-radius:50%;border:6px solid #fff;border-color:#fff transparent #fff transparent;animation:lds-dual-ring 1.2s linear infinite;}}@keyframes lds-dual-ring{0%{transform:rotate(0deg);}100%{transform:rotate(360deg);}}"]),f=u.ZP.div.withConfig({componentId:"sc-12tyh7p-1"})(["border-bottom:1px solid #9b9b9c;margin:10px 0;height:0;width:100%;@media (min-width:","){border-bottom:none;border-right:1px solid #9b9b9c;display:inline;margin:0 10px;height:100%;width:0;}"],p.ZP.mobile),h=u.ZP.span.withConfig({componentId:"sc-12tyh7p-2"})(["background:transparent;border:1px solid #9b9b9c;display:inline-block;height:34px;border-radius:5px;padding:0;align-items:center;display:flex;box-sizing:border-box;& > span{color:#9b9b9c;font-size:0.9em;}& > input{background:transparent;font-size:1em;border:none;text-align:right;color:white;&:focus{outline:none;}}"]),b=u.ZP.button.withConfig({componentId:"sc-12tyh7p-3"})(["&&{border:none;margin:0;padding:0;width:auto;display:flex;justify-content:center;align-items:center;}"]),_=n(64106),m=n(11163),w="ISR_SITE",S=(i={REVALIDATE_PATH:"REVALIDATE_PATH",SYNC_APP:"SYNC_APP",PUBLISHING:"PUBLISHING",STAGING:"STAGING"},(0,l.Z)(i,"PUBLISHING","PUBLISHING"),(0,l.Z)(i,"PUBLISHING_SCHEDULED","PUBLISHING_SCHEDULED"),(0,l.Z)(i,"CREATE_STAGE","CREATE_STAGE"),i),y=(a={},(0,l.Z)(a,S.REVALIDATE_PATH,"revalidate"),(0,l.Z)(a,S.SYNC_APP,"sync"),(0,l.Z)(a,S.PUBLISHING,"publishing"),(0,l.Z)(a,S.STAGING,"staging"),(0,l.Z)(a,S.CREATE_STAGE,"createStage"),a),I={revalidate:"",sync:"",publishing:"",staging:"",createStage:""},E="",P="is-loading",N="has-error",T="STAGE",x="WIP",A="LOCKED",C=n(38788),O=n(24161),R=n(34155);function L(){var e,t;return null===(e=window)||void 0===e||null===(t=e.location)||void 0===t?void 0:t.pathname.replace(/:\d*/,"").replace("//","/")}var U="America/Los_Angeles",k=new Intl.DateTimeFormat("en-US",{timeZone:U,timeZoneName:"shortGeneric",hour:"numeric",minute:"numeric",year:"numeric",month:"numeric",day:"numeric",hour12:!1});function D(e){var t=new Date(e);return k.format(t)}function j(e){var t=new Date(e.toLocaleString("en-US",{timeZone:U})),n=e.getTime()-t.getTime();return new Date(e.getTime()-n)}function H(){return(H=(0,r.Z)(c().mark((function e(t){var i,a,o,r,l,s,d,u,p,v,g,f,h,b,_,m;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.action,a=t.getSiteId,o=t.schedule,r=t.actions,l=t.getUserEmail,s=t.onSuccess,d=t.onFail,u=r.dispatchStateClasses,p=r.setMessage,v=r.setError,u({type:i,payload:P}),e.next=5,n.e(2856).then(n.bind(n,52856));case 5:return g=e.sent.default,f={siteId:a(),userEmail:l(),process:i,platform:"INSTANT_PREVIEW",triggeredAt:o},i===S.REVALIDATE_PATH&&(f.path=null===(h=window)||void 0===h||null===(b=h.location)||void 0===b?void 0:b.pathname.replace(/:\d*/,"").replace("//","/")),e.prev=8,e.next=11,g({url:"".concat(R.env.NEXT_PUBLIC_ORCHESTRATOR_API_URL,"/orchestrator"),method:"post",headers:{"Content-Type":"application/json","Ocp-Apim-Subscription-Key":R.env.NEXT_PUBLIC_ORCHESTRATOR_API_KEY},data:f});case 11:return _=e.sent,p(_.data.message),u({type:i,payload:E}),s&&s({action:i,payload:f,data:_.data}),e.abrupt("return",_);case 18:return e.prev=18,e.t0=e.catch(8),console.error("Error while applying ".concat(i," action"),e.t0),v(!0),p((null===(m=e.t0.response)||void 0===m?void 0:m.data.message)||e.t0.message),u({type:i,payload:N}),d&&d({action:i}),e.abrupt("return",e.t0);case 26:case"end":return e.stop()}}),e,null,[[8,18]])})))).apply(this,arguments)}function V(){return(V=(0,r.Z)(c().mark((function e(t){var i,a,o,r,l,s,d,u,p,v,g,f,h,b,_,m,w;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.action,a=t.getSiteId,o=t.schedule,r=t.actions,l=t.getUserEmail,s=t.onSuccess,d=t.onFail,u=t.environment,p=r.dispatchStateClasses,v=r.setMessage,g
1=r.setError,p({type:i,payload:P}),e.next=5,n.e(2856).then(n.bind(n,52856));case 5:return f=e.sent.default,h={siteId:a(),userEmail:l(),process:i,platform:"INSTANT_PREVIEW",triggeredAt:o,environment:u},i===S.REVALIDATE_PATH&&(h.path=null===(b=window)||void 0===b||null===(_=b.location)||void 0===_?void 0:_.pathname.replace(/:\d*/,"").replace("//","/")),e.prev=8,e.next=11,f({url:"".concat(R.env.NEXT_PUBLIC_ORCHESTRATOR_API_URL,"/orchestratorV2"),method:"post",headers:{"Content-Type":"application/json","Ocp-Apim-Subscription-Key":R.env.NEXT_PUBLIC_ORCHESTRATOR_API_KEY},data:h});case 11:return m=e.sent,v(m.data.message),p({type:i,payload:E}),s&&s({action:i,payload:h,data:m.data}),e.abrupt("return",m);case 18:return e.prev=18,e.t0=e.catch(8),console.error("Error while applying ".concat(i," action"),e.t0),g(!0),v((null===(w=e.t0.response)||void 0===w?void 0:w.data.message)||e.t0.message),p({type:i,payload:N}),d&&d({action:i}),e.abrupt("return",e.t0);case 26:case"end":return e.stop()}}),e,null,[[8,18]])})))).apply(this,arguments)}function B(e){return Z.apply(this,arguments)}function Z(){return(Z=(0,r.Z)(c().mark((function e(t){var i,a,o,r,l,s,d;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.id,a=t.setScheduled,o=t.onSuccess,r=t.onFail,e.next=3,n.e(2856).then(n.bind(n,52856));case 3:return l=e.sent.default,e.prev=4,e.next=7,l({url:"".concat(R.env.NEXT_PUBLIC_ORCHESTRATOR_API_URL,"/cancelScheduledProcess?id=").concat(i),method:"put",headers:{"Content-Type":"application/json","Ocp-Apim-Subscription-Key":R.env.NEXT_PUBLIC_ORCHESTRATOR_API_KEY}});case 7:e.sent,a((function(e){return e.filter((function(e){return e.Id!==i}))})),o&&o(),e.next=16;break;case 12:e.prev=12,e.t0=e.catch(4),console.error("Error while cancelling scheduled process",e.t0),r&&r({message:(null===e.t0||void 0===e.t0||null===(s=e.t0.response)||void 0===s||null===(d=s.data)||void 0===d?void 0:d.message)||e.t0.message});case 16:case"end":return e.stop()}}),e,null,[[4,12]])})))).apply(this,arguments)}var W=n(27812),G=n(30120),z=d.createElement,X=function(e){var t=e.action,n=e.stateClasses,i=e.isOpen,a=e.setIsOpen,o=e.runDeployAction,r=e.setScheduled,l=(0,d.useRef)(null),s=(0,d.useState)(""),c=s[0],u=s[1],p=function(e){var t=e.payload,n=e.data;r&&r((function(e){var i;return[].concat((0,W.Z)(e),[{Id:null===n||void 0===n||null===(i=n.result)||void 0===i?void 0:i.Id,TriggeredAt:t.triggeredAt}])})),a(!1)};return z("dialog",{open:i},z("div",null,z("input",{ref:l,className:"nva-instant-preview__deploy-datetime",type:"datetime-local",min:j(new Date).toISOString().slice(0,16)})),c&&z("p",{clasName:"nva-instant-preview__deploy-status is-error"},c),z("div",null,z("button",{className:"nva-instant-preview__button nva-instant-preview__button--text",type:"button",onClick:function(){return a(!1)}},"Close"),z("button",{className:"nva-instant-preview__button nva-instant-preview__button--dark ".concat(n[y[t]]),type:"button",onClick:function(){return function(e,n){if(!e)return n("Date is missing");var i=new Date(e);if(isNaN(i))return n("Date is invalid");var a=new Date;if(i.toISOString()<a.toISOString())return n("Date or time must be greater");n(""),o(t,i,p)}(G.ou.fromISO(l.current.value,{zone:U}).toString(),u)}},"Schedule")))},Y=d.createElement,M=function(e){var t=e.name,n=e.size,i=void 0===n?20:n;return Y(_.Z,{alt:"",src:"/svg/".concat(t,".svg"),width:i,height:i})},K=n(34155),F=d.createElement;function $(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function q(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$(Object(n),!0).forEach((function(t){(0,l.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var J=S.REVALIDATE_PATH,Q=S.SYNC_APP;function ee(e,t){return q(q({},e),{},(0,l.Z)({},y[t.type],t.payload))}var te=function(e){var t,n,i,a,o=e.getSiteId,r=e.deployMode,l=e.siteInfo,s=e.loading,c=e.setSiteInfo,u=e.scheduledRevalidate,p=e.setScheduledRevalidate,v=e.scheduledSync,g=e.setScheduledSync,f=(0,d.useReducer)(ee,I),h=f[0],b=f[1],_=(0,d.useState)(""),m=_[0],S=_[1],y=(0,d.useState)(!1),E=y[0],P=y[1],N=(0,d.useState)(!1),T=N[0],x=N[1],A=(0,d.useState)(!1),O
1=A[0],R=A[1],L=(null===l||void 0===l||null===(t=l.lastPath)||void 0===t?void 0:t.ExecutedAt)||(null===l||void 0===l||null===(n=l.lastPath)||void 0===n?void 0:n.CreatedAt),U={dispatchStateClasses:b,setMessage:S,setError:P},k=(0,C.useMsal)().accounts,j=function(){return k.length>0?k[0].username:""},V=function(e){e.action===J&&c(q(q({},l),{},{lastPath:{CreatedAt:(new Date).toISOString()}}))},Z=function(e,t,n){return function(e){return H.apply(this,arguments)}({action:e,schedule:t,getSiteId:o,actions:U,getUserEmail:j,onSuccess:n,onFail:null})},W=function(e){return/^(?:f|ht)tps?\:\/\//.test(e)||(e="http://"+e),e};return r===w&&F("div",{className:"nva-instant-preview__deploy-wrapper"},F("div",{className:"nva-instant-preview__deploy"},K.env.NEXT_PUBLIC_ORCHESTRATOR_API_URL.includes("api-uat")&&F("p",{className:"nva-instant-preview__env"},"UAT"),K.env.NEXT_PUBLIC_ORCHESTRATOR_API_URL.includes("api-dev")&&F("p",{className:"nva-instant-preview__env"},"DEV"),(null===l||void 0===l?void 0:l.URL)&&F("a",{className:"nva-instant-preview__deploy-link",href:W(null===l||void 0===l?void 0:l.URL),target:"blank",title:W(null===l||void 0===l?void 0:l.URL)},"Go to site",F(M,{name:"open-in-new",size:16})),F("div",{className:"nva-instant-preview__deploy-buttons"},F("div",{className:"nva-instant-preview__deploy-buttons-wrapper"},F("div",{className:"nva-instant-preview__deploy-button-group"},F("button",{className:"nva-instant-preview__button ".concat(h.revalidate),onClick:function(){return Z(J,null,V)},title:"Regenarate page to see the new content (ISR)",type:"button"},F(M,{name:"revalidate"}),"Regenarate Page"),F("button",{className:"nva-instant-preview__button",onClick:function(){x(!T),R(!1)},title:"Schedule regenarate page to see the new content (ISR)",type:"button"},F(M,{name:"schedule"})),F(X,{action:J,stateClasses:h,isOpen:T,setIsOpen:x,runDeployAction:Z,setScheduled:p})),F("div",{className:"nva-instant-preview__deploy-button-group"},F("button",{className:"nva-instant-preview__button ".concat(h.sync),onClick:function(){return Z(Q)},title:"Rebuild site using the last code updates",type:"button"},F(M,{name:"sync"}),"Sync App"),F("button",{className:"nva-instant-preview__button",onClick:function(){R(!O),x(!1)},title:"Schedule rebuild site using the last code updates",type:"button"},F(M,{name:"schedule"})),F(X,{action:Q,stateClasses:h,isOpen:O,setIsOpen:R,runDeployAction:Z,setScheduled:g}))))),m&&F("p",{className:"nva-instant-preview__deploy-status ".concat(E?"is-error":"")},m),F("div",{className:"nva-instant-preview__info"},F("table",null,F("thead",null,F("tr",null,F("th",null),F("th",null,"Last"),F("th",null,"Scheduled"))),F("tbody",null,F("tr",null,F("th",null,"Regenerate Page:"),F("td",null,L>(null===l||void 0===l||null===(i=l.lastSyncApp)||void 0===i?void 0:i.CreatedAt)?D(L):""),F("td",null,F("ul",null,u.map((function(e){return F("li",{key:e.Id},D(e.TriggeredAt),F("button",{type:"button",onClick:function(){return B({id:e.Id,setScheduled:p})}},F(M,{name:"delete",size:16})))}))))),F("tr",null,F("th",null,"Sync App:"),F("td",null,null!==l&&void 0!==l&&null!==(a=l.lastSyncApp)&&void 0!==a&&a.CreatedAt?D(l.lastSyncApp.CreatedAt):""),F("td",null,F("ul",null,v.map((function(e){return F("li",{key:e.Id},D(e.TriggeredAt),F("button",{type:"button",onClick:function(){return B({id:e.Id,setScheduled:g})}},F(M,{name:"delete",size:16})))})))))))),s&&F("p",null,"Loading..."))},ne=n(34155),ie=d.createElement;function ae(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function oe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ae(Object(n),!0).forEach((function(t){(0,l.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ae(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var re=S.REVALIDATE_PATH,le=S.PUBLISHING_SCHEDULED,se=S.PUBLISHING,ce=S.STAGING,de=S.CREATE_STAGE;function ue(e,t){return oe(oe({},e),{},(0,l.Z)({},y[t.type],t.payload))}var pe=function(e){var t,n,i,a,o=e.getSiteId,r=e.siteInfo,l=e.loading,s=e.setSiteInfo,c=e.scheduledPublishing,u=e.setScheduledPublishing,p=(0,d.useReducer)(ue,I),v=p[0],g=p[1],f=(0,d.useState)(""),h=f[0],b=f[1],_=(0,d.useState)(!1),m=_[0],w=_[1],S=(0,d.useState)(!1),y=(S[0],S[1]),E=(0,d.useState)(!1),P=(E[0],E[1]),N=(0,d.useState)(!1),O
1=N[0],R=N[1],L=(0,d.useState)(!1),U=(L[0],L[1]),k=(0,d.useState)(0),j=k[0],H=k[1],Z=(0,d.useState)(!1),W=Z[0],G=Z[1],z=(0,d.useState)(!1),Y=z[0],K=z[1],F=((null===r||void 0===r||null===(t=r.lastPath)||void 0===t?void 0:t.ExecutedAt)||(null===r||void 0===r||null===(n=r.lastPath)||void 0===n||n.CreatedAt),{dispatchStateClasses:g,setMessage:b,setError:w}),$=(0,C.useMsal)().accounts;console.log("scheduledPublishing",c);var q=function(){return $.length>0?$[0].username:""},J=function(e){e.action===re&&s(oe(oe({},r),{},{lastPath:{CreatedAt:(new Date).toISOString()}}))},Q=function(e,t,n){return function(e){return V.apply(this,arguments)}({action:e,schedule:t,getSiteId:o,actions:F,getUserEmail:q,onSuccess:n,onFail:null,environment:ne.env.NEXT_PUBLIC_INSTANT_PREVIEW_VERSION})},ee=function(e){var t,n;/^(?:f|ht)tps?\:\/\//.test(e)||(e="https://"+e),e.endsWith("/")&&(e=e.slice(0,-1));var i=null===(t=window)||void 0===t||null===(n=t.location)||void 0===n?void 0:n.pathname.replace(/:\d*/,"").replace("//","/");return i.startsWith("/")&&(i=i.slice(1)),i.endsWith("/")&&(i=i.slice(0,-1)),"".concat(e,"/").concat(i)};(0,d.useEffect)((function(){te(),ae(),r&&(r.StatusLock!==A?ne.env.NEXT_PUBLIC_INSTANT_PREVIEW_VERSION!==x||r.HasWIP?ne.env.NEXT_PUBLIC_INSTANT_PREVIEW_VERSION!==T||r.HasStaging?b(""):b("Staging site not found. You can create one using the Stage Site button."):b("WIP site not found. Create a WIP version in the Contentful Website Record first."):b("Site is locked. Go to Contentful to unlock."))}),[r]);var te=function(){r&&(ne.env.NEXT_PUBLIC_INSTANT_PREVIEW_VERSION!==x||r.HasWIP)&&(ne.env.NEXT_PUBLIC_INSTANT_PREVIEW_VERSION!==T||r.HasStaging)?K(!1):K(!0)},ae=function(){r&&r.StatusLock!==A?G(!1):G(!0)},pe=function(){b("Schedule cancelled successfully"),w(!1)},ve=function(e){var t=e.message;b("Error while trying to cancel the schedule - ".concat(t)),w(!0)};return ie("div",{className:"nva-instant-preview__deploy-wrapper"},ie("div",{className:"nva-instant-preview__deploy"},ie("p",{className:"nva-instant-preview__env"},ne.env.NEXT_PUBLIC_INSTANT_PREVIEW_ENV),ne.env.NEXT_PUBLIC_INSTANT_PREVIEW_VERSION===x&&ie("p",{className:"nva-instant-preview__env"},x),(null===r||void 0===r?void 0:r.URL)&&ie("a",{className:"nva-instant-preview__deploy-link",href:ee(null===r||void 0===r?void 0:r.URL),target:"blank",title:ee(null===r||void 0===r?void 0:r.URL)},"Go to site",ie(M,{name:"open-in-new",size:16})),ne.env.NEXT_PUBLIC_INSTANT_PREVIEW_VERSION===T&&(null===r||void 0===r?void 0:r.HasStaging)&&ie("a",{className:"nva-instant-preview__deploy-link",href:ee(null===r||void 0===r?void 0:r.StagingURL),target:"blank",title:ee(null===r||void 0===r?void 0:r.StagingURL)},"Go to stage site",ie(M,{name:"open-in-new",size:16})),ne.env.NEXT_PUBLIC_INSTANT_PREVIEW_VERSION===x&&(null===r||void 0===r?void 0:r.HasWIP)&&ie("a",{className:"nva-instant-preview__deploy-link",href:ee(null===r||void 0===r?void 0:r.WipURL),target:"blank",title:ee(null===r||void 0===r?void 0:r.WipURL)},"Go to WIP site",ie(M,{name:"open-in-new",size:16})),ie("div",{className:"nva-instant-preview__deploy-buttons"},ie("div",{className:"nva-instant-preview__deploy-buttons-wrapper"},ie("div",{className:"nva-instant-preview-v2__deploy-button-group"},ie("button",{className:"nva-instant-preview__button ".concat(v.revalidate),onClick:function(){return Q(re,null,J)},title:"Regenarate page to see the new content (ISR)",disabled:Y,type:"button"},ie(M,{name:"revalidate"}),"Update Page")),(ne.env.NEXT_PUBLIC_INSTANT_PREVIEW_VERSION===x||ne.env.NEXT_PUBLIC_INSTANT_PREVIEW_VERSION===T)&&ie("div",{className:"nva-instant-preview-v2__deploy-button-group"},ie("button",{className:"nva-instant-preview__button ".concat(Y?v.createStage:v.staging),onClick:function(){Q(Y?de:ce,null,J)},title:"Create stage site.",type:"button"},ie(M,{name:"stage"}),"Stage Site")),ne.env.NEXT_PUBLIC_INSTANT_PREVIEW_VERSION===T&&ie("div",{className:"nva-instant-preview-v2__deploy-button-group"},ie("button",{className:"nva-instant-preview__button ".concat(v.publishing),onClick:function(){0===j?(H(1),setTimeout((function(){return H(0)}),5e3)):Q(se,null,J)},title:"Publish changes to production site.",disabled:W,type:"button"},ie(M,{name:"publish"}),0===j?"Publish Site":"Click again to confirm"),ie("button",{className:"nva-instant-preview__button",onClick:function(){R(!O),P(!1),y(!1),U(!1)},title:"Schedule publish changes to production site.",disabled:(null===c||void 0===c?void 0:c.length)>0||W,type:"button"},ie(M,{name:"schedule"})),ie(X,{action:le,stateClasses:v,isOpen:O,setIsOpen:R,runDeployAction:Q,setScheduled:u}))))),h&&ie("p",{className:"nva-instant-preview__deploy-status ".concat(m?"is-error":"")},h),(null===c||void 0===c||null===(i=c[0])||void 0===i?void 0:i.TriggeredAt)&&ie("div",{className:"nva-instant-preview__info"},ie("table",null,ie("thead",null,ie("tr",null,ie("th",null),ie("th",null,"Scheduled"))),ie("tbody",null,ie("tr",null,ie("th",null,"Publishing:"),ie("td",null,ie("ul",null,ie("li",null,D(null===c||void 0===c||null===(a=c[0])||void 0===a?void 0:a.TriggeredAt),ie("button",{className:"nva-instant-preview__button",type:"button",onClick:function(){var e;return B({id:null===c||void 0===c||null===(e=c[0])||void 0===e?void 0:e.Id,setScheduled:u,onSuccess:pe,onFail:ve})},disabled:W},ie(M,{name:"delete",size:16}
1))))))))),l&&ie("p",null,"Loading..."))},ve=n(34155),ge=d.createElement,fe=S.REVALIDATE_PATH,he=S.SYNC_APP,be=S.PUBLISHING_SCHEDULED;function _e(){var e=(0,C.useMsal)().instance;return ge("div",{className:"nva-instant-preview__login"},ge("p",{className:"u-caption"},"Please, make sure to permit pop-ups in your browser settings in order to login"),ge("button",{type:"button",onClick:function(){return e.loginPopup()}},ge(_.Z,{alt:"",src:"/svg/login.svg",width:20,height:20}),"Login"))}var me=function(e){var t=e.getSiteId,i=(0,d.useState)(null),a=i[0],o=i[1],l=(0,d.useState)(null),s=l[0],u=l[1],p=(0,d.useState)(!1),v=p[0],g=p[1],f=(0,d.useState)([]),h=f[0],b=f[1],_=(0,d.useState)([]),m=_[0],w=_[1],S=(0,d.useState)([]),y=S[0],I=S[1],E=(0,d.useRef)(null);if(!(""===ve.env.NEXT_PUBLIC_DEPLOY_CONTROLS_ALLOWED_SITES.trim()||ve.env.NEXT_PUBLIC_DEPLOY_CONTROLS_ALLOWED_SITES.split(",").includes(t().toString())))return null;var P={auth:{clientId:ve.env.NEXT_PUBLIC_LOGIN_CLIENT_ID,authority:ve.env.NEXT_PUBLIC_LOGIN_AUTHORITY,redirectUri:window.location.origin},cache:{cacheLocation:"localStorage",storeAuthStateInCookie:!1}};return E.current=E.current||new O.PublicClientApplication(P),(0,d.useEffect)((function(){g(!1),E.current.initialize().then((function(){var e=E.current.getAllAccounts();e.length>0&&E.current.setActiveAccount(e[0]),E.current.addEventCallback((function(e){if(e.eventType===O.EventType.LOGIN_SUCCESS&&e.payload.account){var t=e.payload.account;E.current.setActiveAccount(t)}}))})),(0,r.Z)(c().mark((function e(){var i;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!s){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,n.e(2856).then(n.bind(n,52856));case 4:i=e.sent.default,g(!0),i({url:"".concat(ve.env.NEXT_PUBLIC_ORCHESTRATOR_API_URL,"/getSiteInfo?siteId=").concat(t(),"&lastSyncApp=true&path=").concat(L(),"&includeScheduledProcessesPending=true"),method:"get",headers:{"Ocp-Apim-Subscription-Key":ve.env.NEXT_PUBLIC_ORCHESTRATOR_API_KEY}}).then((function(e){var t,n,i,a,r,l;o(null===e||void 0===e?void 0:e.data.DeployMode),u(null===e||void 0===e?void 0:e.data),b((null===e||void 0===e||null===(t=e.data)||void 0===t||null===(n=t.scheduledProcessPending)||void 0===n?void 0:n.filter((function(e){return e.Process===fe})))||[]),w((null===e||void 0===e||null===(i=e.data)||void 0===i||null===(a=i.scheduledProcessPending)||void 0===a?void 0:a.filter((function(e){return e.Process===he})))||[]),I((null===e||void 0===e||null===(r=e.data)||void 0===r||null===(l=r.scheduledProcessPending)||void 0===l?void 0:l.filter((function(e){return e.Process===be})))||[]),g(!1)})).catch((function(e){console.error("error while trying to get the site info",e),g(!1)}));case 7:case"end":return e.stop()}}),e)})))()}),[]),ge(C.MsalProvider,{instance:E.current},ge(C.AuthenticatedTemplate,null,!ve.env.NEXT_PUBLIC_USE_ORCHESTRATOR_V2&&ge(te,{getSiteId:t,deployMode:a,siteInfo:s,loading:v,setSiteInfo:u,scheduledRevalidate:h,scheduledSync:m,setScheduledRevalidate:b,setScheduledSync:w}),ve.env.NEXT_PUBLIC_USE_ORCHESTRATOR_V2&&ge(pe,{getSiteId:t,siteInfo:s,loading:v,setSiteInfo:u,setScheduledPublishing:I,scheduledPublishing:y})),ge(C.UnauthenticatedTemplate,null,ge(_e,null)))},we=n(34155),Se=d.createElement;function ye(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Ie(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ye(Object(n),!0).forEach((function(t){(0,l.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ye(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ee=u.ZP.section.withConfig({componentId:"sc-br6vf1-0"})(["",";"],v),Pe=(0,u.ZP)((function(){var e=(0,d.useState)({siteId:""}),t=e[0],i=e[1],a=(0,d.useState)(!0),s=a[0],u=a[1],p=(0,d.useState)(!1),v=p[0],w=p[1];(0,m.useRouter)();if("false"===new URLSearchParams(window.location.search).get("showIPcontrols"))return Se(d.Fragment,null);var S=function(e){if(e.preventDefault(),null!==t&&void 0!==t&&t.siteId){var n,a;w(!0),i((function(e){return Ie({},e)}));var o=(null===(n=window)||void 0===n||null===(a=n.location)||void 0===a?void 0:a.origin)+"/:"+(null===t||void 0===t?void 0:t.siteId);console.log("handleSubmit",o),window.location.href=o}},y=function(){var e=(0,r.Z)(c().mark((function e(t){var a,o,r;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.preventDefault(),w(!0),i((function(e){return Ie({},e)})),r="/api/revalidate/?url=".concat(encodeURIComponent(null===(a=window)||void 0===a||null===(o=a.location)||void 0===o?void 0:o.pathname)),console.log("handleRefresh",r),e.next=7,n.e(2856).then(n.bind(n,52856));case 7:(0,e.sent.default)({url:r,method:"get"}).then((function(e){var t,n,i;(console.log("success",null===e||void 0===e?void 0:e.data),null!==(t=window)&&void 0!==t&&t.location)&&(null===(n=window)||void 0===n||null===(i=n.location)||void 0===i||i.reload())})).catch((function(e){console.log("fail",e)}));case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),I=function(){var e,t,n,i;return null!==(e=localStorage)&&void 0!==e&&e.getItem("instantPreviewSiteId")?parseInt(null===(t=localStorage)||void 0===t?void 0:t.getItem("instantPreviewSiteId")):parseInt(null===(n=we)||void 0===we||null===(i=n.env)||void 0===i?void 0:"107")},E=function(){var e,t;return null!==(e=localStorage)&&void 0!==e&&e.getItem("instantPreviewEdit")?null===(t=localStorage)||void 0===t?void 0:t.getItem("instantPreviewEdit"):null},P=function(){var e,t;return null!==(e=localStorage)&&void 0!==e&&e.getItem("instantPreviewWebsite")?null===(t=localStorage)||void 0===t?void 0:t.getItem("instantPreviewWebsite"):null};return(0,d.useEffect)((function(){i({siteId:I()});var e=function(){i({siteId:I()})};window.addEventListener("instantpreview:updated",e);var t=function(e){for(var t=e.target;t&&"A"!==t.tagName;)t=t.parentElement;if(t&&"A"===t.tagName){var n=t.getAttribute("href"),i=I();if(!(!n||n.startsWith("http")||n.startsWith("#")||n.startsWith("mailto:")||n.startsWith("tel:")||n.includes(":".concat(i))||n.includes(":"))){var a=n.split("#"),r=(0,o.Z)(a,2),l=r[0],s=r[1],c=l.split("?"),d=(0,o.Z)(c,2),u=d[0],p=d[1],v=u+":"+i;p&&(v+="?"+p),s&&(v+="#"+s),e.preventDefault(),window.location.href=v}}};return document.addEventListener("click",t,!0),function(){document.removeEventListener("click",t,!0),window.removeEventListener("instantpreview:updated",e)}}),[]),Se(Ee,{className:"nva-instant-preview ".concat(s?"is-opened":"is-collapsed")},Se("form",{onSubmit:S,className:"nva-instant-preview__form"},Se("div",{className:"form-control"},Se("div",{className:"nva-instant-preview__label-wrapper"},Se("label",null,"Instant Preview"),Se(f,null)),Se("div",{className:"nva-instant-preview__controls-wrapper"},Se(h,null,Se("input",{className:"nva-instant-preview__input-site-id",type:"number",name:"siteId",placeholder:"Site ID",value:t.siteId,onChange:function(e){var t=e.target,n=t.name,a=t.value;i((function(e){return Ie(Ie({},e),{},(0,l.Z)({},n,a))}))}}
1)),Se("button",{onClick:S,type:"submit",title:"Apply the new Site ID",className:"nva-instant-preview__submit-site-id submit"},Se(_.Z,{alt:"Apply the new Site ID",src:"/svg/eye.svg",width:20,height:20}),"View Site"),Se("button",{className:"nva-instant-preview__refresh-button",onClick:y,title:"Refresh the page to see the new content"},Se(_.Z,{alt:"Refresh the page to see the new content",src:"/svg/eye.svg",width:20,height:20}),"View Changes"),Se("button",{className:"nva-instant-preview__edit-button edit",onClick:function(e){e.preventDefault();var t=E();t&&window.open(t,"_blank")},title:"Edit current entry page in Contentful"},"Edit Page"),Se("button",{className:"nva-instant-preview__edit-button edit",onClick:function(e){e.preventDefault();var t=P();t&&window.open(t,"_blank")},title:"Edit Website entry in Contentful"},"Edit Site")),Se(b,{className:"nva-instant-preview__expand-button",type:"button",onClick:function(){u((function(e){return!e}))},title:"Expand or collapse"},Se(_.Z,{alt:"Expand or collapse",src:"/svg/".concat(s?"arrow-right":"arrow-left",".svg"),width:25,height:25}))),Se(me,{getSiteId:I})),v&&Se(g,null,Se("div",{className:"lds-dual-ring"})))})).withConfig({componentId:"sc-br6vf1-1"})(["",";"],v)},24161:function(){},38788:function(){}}]);
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.