"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6956],{36956:function(n,e,i){i.r(e),i.d(e,{Column:function(){return he},GuidePage:function(){return we},GuideWrapper:function(){return ge},ImageWrapper:function(){return fe},Intro:function(){return ve},MetaWrapper:function(){return pe},__N_SSP:function(){return me},default:function(){return ye}});var t=i(26042),o=i(69396),r=i(828),a=i(7297),l=i(85893),d=i(67294),s=i(87379),c=i(45697),u=i.n(c),m=(i(50615),"app.containers.GuidePage"),g={inThisArticle:"".concat(m,".inThisArticle"),comments:"".concat(m,".comments"),next:"".concat(m,".next"),previous:"".concat(m,".previous")},f=i(59220),p=i(98485),v=i(76957),h=i(26349),x=i(23351),j=i(36434),w=i(8293),y=i(49637),b=i(99534),Z=i(46066),C=i(92879),k=i(67814),I=i(19558),_=i(11163),M="app.components.Step",S={comments:"".concat(M,".comments"),addComment:"".concat(M,".addComment"),step:"".concat(M,".step")},R=i(40039),T=i(41347),A=i(64802),q=i(61590),P=i(42414),E=i(39915),D=i(42097),G=i(97742),L=i(29059),N=i(45816),O=i(65735);function z(){var n=(0,a.Z)(["\n display: block;\n position: ",";\n ",";\n width: 12px;\n height: 12px;\n color: ",";\n vertical-align: middle;\n text-align: center;\n border-radius: 50%;\n ","\n @media print {\n top: 0.5em;\n }\n"]);return z=function(){return n},n}function V(){var n=(0,a.Z)(["\n ","\n vertical-align: middle;\n display: block;\n width: 24px;\n text-align: center;\n position: ",";\n ",";\n color: ",";\n svg {\n width: 24px;\n }\n @media print {\n top: 0.5em;\n }\n"]);return V=function(){return n},n}var F={red:"#AA0A3C",orange:"#ff9024",yellow:"#f3e00e",green:"#16dc81",light_blue:"#15a1d6",blue:"#2343e8",violet:"#dc54b7",black:"black"},H=s.default.span.withConfig({componentId:"sc-1fc92787-0"})(z(),(function(n){return n.relative?"relative":"absolute"}),(function(n){return n.relative&&"cursor: pointer;"}),(function(n){return F[n.color]}),(function(n){return!n.relative&&"left: 5px; top: 1em;"})),B=s.default.span.withConfig({componentId:"sc-1fc92787-1"})(V(),(function(n){return!n.relative&&"left: 0; top: 1em;"}),(function(n){return n.relative?"relative":"absolute"}),(function(n){return n.relative&&"cursor: pointer;"}),(function(n){return n.color||"black"})),$={note:O.sqG,caution:O.eHv,reminder:O.RP7};function K(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=n.color,i=void 0===e?"black":e,t=n.icon,o=n.onClick,r=n.relative,a=void 0!==r&&r;if(t){var d=$[t];return(0,l.jsx)(B,{color:"caution"===t?"red":"black",onClick:o,relative:a,children:(0,l.jsx)(k.G,{icon:d,className:"caution"===t?"fa-beat":"",size:"lg"})})}return(0,l.jsx)(H,{color:i,onClick:o,relative:a,children:"\u2b22"})}K.propTypes={color:u().string,icon:u().string};var U=K;function W(){var n=(0,a.Z)(["\n margin-left: ","px;\n position: relative;\n padding: 1em 0 0 30px;\n width: auto;\n word-break: break-word;\n color: ",";\n p {\n margin-top: 0;\n }\n @media print {\n padding-top: 0.5em;\n }\n"]);return W=function(){return n},n}var Y=s.default.div.withConfig({componentId:"sc-4c3ecd73-0"})(W(),(function(n){var e=n.level;return 30*(void 0===e?0:e)}),(function(n){return"caution"===n.icon?"red":"inherit"}));i(98322),i(98745),i(72641);function J(){var n=(0,a.Z)(["\n margin-bottom: 2em;\n border-bottom: 1px solid #ccc;\n padding-bottom: 1em;\n min-height: 400px;\n position: relative;\n @media print {\n page-break-inside: avoid;\n border-bottom: none;\n padding-top: 2em;\n padding-bottom: 0;\n margin-bottom: 0;\n }\n"]);return J=function(){return n},n}function Q(){var n=(0,a.Z)(["\n display: flex;\n margin-bottom: 1em;\n @media screen and (max-width: 40em) {\n flex-direction: column;\n }\n @media print {\n ",";\n }\n"]);return Q=function(){return n},n}function X(){var n=(0,a.Z)(["\n color: ",";\n position: absolute;\n right: 0;\n bottom: -1.25em;\n cursor: pointer;\n padding: 0.5em 0 0.5em 1em;\n border: none;\n background: white;\n outline: none;\n"]);return X=function(){return n},n}function nn(){var n=(0,a.Z)(["\n display: block;\n opacity: 0;\n position: absolute;\n z-index: 10;\n left: 5px;\n top: 5px;\n transition: opacity 500ms;\n color: #333;\n border: 1px solid #888;\n cursor: pointer;\n background-color: white;\n border-radius: 4px;\n padding: 2px 5px;\n\n svg {\n width: 1em;\n }\n"]);return nn=function(){return n},n}function en(){var n=(0,a.Z)(["\n position: relative;\n margin-right: 10px;\n width: 60%;\n img {\n cursor: pointer;\n }\n &:hover {\n "," {\n opacity: 1;\n }\n }\n @media screen and (max-width: 40em) {\n width: 100%;\n margin-right: 0;\n margin-bottom: 1em;\n }\n @media print {\n max-width: 100%;\n margin-right: 0;\n ",";\n margin-bottom: 1em;\n display: flex;\n justify-content: center;\n }\n"]);return en=function(){return n},n}function tn(){var n=(0,a.Z)(["\n width: ",";\n @media screen and (max-width: 40em) {\n width: 100%;\n }\n @media print {\n ",";\n }\n"]);return tn=function(){return n},n}function on(){var n=(0,a.Z)(["\n margin-left: 1em;\n font-weight: normal;\n"]);return on=function(){return n},n}function rn(){var n=(0,a.Z)(["\n display: none;\n max-width: 100%;\n width: 100%;\n justify-content: center;\n max-height: 300px;\n height: auto;\n & > * {\n flex: 1;\n }\n img {\n border: 1px solid #333;\n }\n @media print {\n display: flex;\n }\n"]);return rn=function(){return n},n}function an(){var n=(0,a.Z)(["\n color: #000;\n @media print {\n -webkit-print-color-adjust: exact;\n background-color: #cecece;\n padding: 0.5em;\n }\n"]);return an=function(){return n},n}var ln=s.default.article.withConfig({componentId:"sc-4844fe4f-0"})(J()),dn=s.default.div.withConfig({componentId:"sc-4844fe4f-1"})(Q(),(function(n){return n.mediaCount>1?"flex-direction: column":"flex-direction: row"})),sn=s.default.button.withConfig({componentId:"sc-4844fe4f-2"})(X(),(function(n){return n.isMainColor?"#fa6831":"#8C8C8C"})),cn=s.default.span.withConfig({componentId:"sc-4844fe4f-3"})(nn()),un=s.default.div.withConfig({componentId:"sc-4844fe4f-4"})(en(),cn,(function(n){return n.mediaCount>1?"width: auto":"width: 50%; margin-right: 1em"})),mn=s.default.div.withConfig({componentId:"sc-4844fe4f-5"})(tn(),(function(n){return n.hasMedia?"40%":"100%"}),(function(n){return n.mediaCount>1?"width: 100%":"width: 50%"})),gn=s.default.span.withConfig({componentId:"sc-4844fe4f-6"})(on()),fn=s.default.div.withConfig({componentId:"sc-4844fe4f-7"})(rn()),pn=(0,s.default)(w.H2).withConfig({componentId:"sc-4844fe4f-8"})(an());function vn(n){var e=n.meta,i=void 0===e?{}:e,o=n.id,r=n.title,a=i||{},d=a.level,s=void 0===d?0:d,c=(0,b.Z)(a,["level"]);return(0,l.jsxs)(Y,{level:s,icon:c.icon,children:[(0,l.jsx)(U,(0,t.Z)({},c)),(0,j.Hl)(r,!0)]},o)}function hn(n){return n.child&&n.child.original?n.child.original:n.original}function xn(n){var e=n.id,i=n.lines,a=n.title,s=n.translation_status,c=n.media,u=n.iterator,m=n.comments,g=(n.slug,n.isAdmin),f=void 0!==g&&g,p=n.language,v=n.guideSlug,x=n.categorySlug,y=n.forceCommentsOpen,b=void 0!==y&&y,M=(n.printQuality,function(n,e){n.preventDefault(),W(!0),Q(e)}),O=c.gallery,z=c.video,V=c.image,F=c.yt_video,H=(0,d.useState)(!1),B=H[0],$=H[1],K=(0,d.useState)(!1),U=K[0],W=K[1],Y=(0,d.useState)(0),J=Y[0],Q=Y[1],X=(0,r.Z)((0,q.dd)(!1),3),nn=X[0],en=X[1],tn=X[2],on=O?function(n){return{dots:!0,dotsClass:"slick-dots slick-thumb",arrows:!0,speed:500,slidesToShow:1,slidesToScroll:1,customPaging:function(e){return(0,l.jsx)("a",{style:{maxWidth:"100px",display:"block"},href:"#".concat(e),children:(0,l.jsx)(D.Z,{image:n&&n[e],size:"medium"})},e)}}}(O):{},rn=((0,_.useRouter)(),(0,d.useRef)(null));return(0,d.useEffect)((function(){parseInt(window.location.hash.substr(1),0)===e&&rn.current&&setTimeout((function(){return(0,j.eU)(rn.current,-260,!1)}),100)}),[]),(0,l.jsxs)(P.Z,{id:e.toString(),children:[(0,l.jsxs)(ln,{ref:rn,onMouseEnter:en,onMouseLeave:tn,children:[(0,l.jsx)(N.Z,{href:"#".concat(e),activeClassName:"selected",isActive:function(){return window.location.hash===e},children:(0,l.jsxs)(pn,{children:[(0,l.jsx)(h.Z,{index:S.step})," ",u," ",(0,l.jsx)(gn,{children:a}),(0,l.jsx)(L.Z,{language:p,status:s})]})}),(0,l.jsxs)(dn,{mediaCount:(null===O||void 0===O?void 0:O.length)||0,children:[F?(0,l.jsx)(un,{children:(0,l.jsx)("iframe",{src:F.replace(/(youtube\.com\/watch\?v=|youtu\.be\/)(.+)/i,"youtube.com/embed/$2"),width:"100%",height:"400",frameBorder:0,allow:"autoplay; encrypted-media",allowFullScreen:!0})}):z?(0,l.jsx)(un,{children:(0,l.jsx)(D.Z,{image:c})}):O?(0,l.jsxs)(un,{mediaCount:O.length,children:[(0,l.jsxs)(w.jT,{children:[(0,l.jsx)(Z.Z,(0,o.Z)((0,t.Z)({},on),{children:O.map((function(n,e){return(0,l.jsxs)("div",{children:[(0,l.jsx)(cn,{onClick:function(n){return M(n,e)},children:(0,l.jsx)(k.G,{icon:I.N7,color:"#333"})}),(0,l.jsx)(D.Z,{image:n,alt:a,size:"medium",onClick:function(n){return M(n,e)}})]},null===n||void 0===n?void 0:n.medium)}))})),U&&(0,l.jsx)(C.Z,{reactModalProps:{shouldReturnFocusAfterClose:!1},mainSrc:hn(O[J]),nextSrc:hn(O[(J+1)%O.length]),prevSrc:hn(O[(J+O.length-1)%O.length]),onCloseRequest:function(){return W(!1)},onMovePrevRequest:function(){return Q((J+O.length-1)%O.length)},onMoveNextRequest:function(){return Q((J+1)%O.length)}})]}),(0,l.jsx)(fn,{children:O.map((function(n,e){return(0,l.jsx)(D.Z,{image:n,alt:a,size:"original",adaptive:!0,onClick:function(n){return M(n,e)}},n.id)}))})]}):(0,l.jsxs)(un,{children:[(0,l.jsx)(cn,{children:(0,l.jsx)(k.G,{icon:I.N7,color:"#333"})}),(0,l.jsx)(D.Z,{image:V,alt:a,size:"medium"},null===V||void 0===V?void 0:V.medium)]}),(0,l.jsx)(G.Z,{children:(0,l.jsx)(mn,{hasMedia:V||z||O||F,mediaCount:(null===O||void 0===O?void 0:O.length)||0,children:i&&(null===i||void 0===i?void 0:i.length)?i.map(vn):(0,l.jsx)(T.Z,{})})})]}),(0,l.jsx)(w.jT,{children:m?(0,l.jsxs)(sn,{onClick:function(){return $(!B)},isMainColor:!0,children:[(0,l.jsx)(R.qt,{width:20})," ",m," ",(0,l.jsx)(h.Z,{index:S.comments})]}):(0,l.jsxs)(sn,{onClick:function(){return $(!B)},isMainColor:!1,children:[(0,l.jsx)(R.qt,{width:20})," ",(0,l.jsx)(h.Z,{index:S.addComment})]})}),nn&&f&&(0,l.jsx)(E.Z,{url:"/admin/guide/".concat(x?"".concat(x,"/"):"").concat(v,"/steps/").concat(e),children:"Edit"})]}),(0,l.jsx)(A.Z,{open:B||b,parentId:e,commentsOpen:!0})]})}xn.propTypes={lines:u().array,title:u().string.isRequired,slug:u().string.isRequired,iterator:u().number,comments:u().number,media:u().object,language:u().string.isRequired,id:u().number,isAdmin:u().bool.isRequired,guideSlug:u().string};var jn=xn,wn=i(64487),yn=i(32143);function bn(){var n=(0,a.Z)(["\n position: absolute;\n right: 110px;\n top: 5px;\n @media print {\n display: none;\n }\n "]);return bn=function(){return n},n}var Zn=(0,s.default)(yn.I4).withConfig({componentId:"sc-ccb8285e-0"})(bn()),Cn={cache:"no-store",redirect:"follow",referrer:"no-referrer"},kn=function(){var n=(0,d.useState)(!1),e=n[0],i=n[1],t=(0,_.useRouter)(),o=(0,d.useCallback)((function(){var n="en"===t.locale?"":"/".concat(t.locale),e="".concat(n).concat(t.asPath);i(!0),fetch("/revalidateFrontendPages?token=yi43HoaNty6aTMMygo6cCzFnzeFM7SB8&revalidate=true&path=".concat(e),Cn).then((function(n){i(!1),location.reload()})).catch((function(n){i(!1),wn.Tb(n)}))}),[]);return(0,l.jsx)(Zn,{onClick:function(){return o()},children:e?"Clearing cache...":"Clear Cache"})};kn.propTypes={};var In=i(96498),_n=i(96241),Mn="app.component.GuideMeta",Sn={difficulty:"".concat(Mn,".difficulty"),requiredTime:"".concat(Mn,".requiredTime"),steps:"".concat(Mn,".steps"),comments:"".concat(Mn,".comments"),veryEasy:"".concat(Mn,".veryEasy"),easy:"".concat(Mn,".easy"),moderate:"".concat(Mn,".moderate"),difficult:"".concat(Mn,".difficult"),veryDifficult:"".concat(Mn,".veryDifficult"),availableLanguages:"".concat(Mn,".availableLanguages")},Rn=i(38983),Tn="app.components.PdfButton",An={fullVersion:"".concat(Tn,".fullVersion"),mmuVariantA:"".concat(Tn,".mmuVariantA"),mmuVariantB:"".concat(Tn,".mmuVariantB"),mmuVariantC:"".concat(Tn,".mmuVariantC"),download:"".concat(Tn,".download"),title:"".concat(Tn,".title")},qn=i(88593),Pn=i(94586);function En(){var n=(0,a.Z)(["\n display: flex;\n justify-content: space-between;\n width: 100%;\n padding: 1em;\n background-color: white;\n margin-bottom: 0.6em;\n align-items: center;\n overflow: visible;\n border: 1px solid ",";\n &:last-child {\n margin-bottom: 0;\n }\n svg {\n width: 1.125em;\n display: inline;\n }\n"]);return En=function(){return n},n}var Dn=s.default.div.withConfig({componentId:"sc-53767b0b-0"})(En(),(0,Pn.E)("lightGrey")),Gn=i(27588);function Ln(){var n=(0,a.Z)(["\n position: absolute;\n top: 100%;\n right: 0;\n width: auto;\n white-space: nowrap;\n word-break: keep-all;\n max-width: 300%;\n background-color: white;\n z-index: 30;\n padding: 0 0.75em;\n border: 1px solid ",";\n text-align: right;\n a {\n display: block;\n padding-right: 1.5em;\n }\n"]);return Ln=function(){return n},n}function Nn(){var n=(0,a.Z)(["\n display: inline-block;\n position: relative;\n z-index: 25;\n float: right;\n margin-left: 1em;\n"]);return Nn=function(){return n},n}var On=(0,s.default)(qn.ZP).withConfig({componentId:"sc-4edb6cd7-0"})(Ln(),(0,Pn.E)("lightGrey")),zn=s.default.div.withConfig({componentId:"sc-4edb6cd7-1"})(Nn());function Vn(n){var e=n.category,i=n.language,o=(0,r.Z)((0,q.dd)(!1),3),a=o[0],s=o[1],c=o[2],u=(0,q.um)({category:e,language:i}),m=(0,d.useRef)();return(0,q.O3)(m,(function(){c()})),u&&u.length?(0,l.jsxs)(zn,{ref:m,children:[(0,l.jsxs)(yn.VM,{onClick:a?c:s,children:[(0,l.jsx)(FormattedMessage,(0,t.Z)({},messages.download)),(0,l.jsx)(k.G,{icon:Gn.q7,size:"1x",style:{marginLeft:"0.5em"}})]}),a&&(0,l.jsx)(On,{children:null===u||void 0===u?void 0:u.map((function(n){return(0,l.jsx)(qn.HC,{subMenu:!0,children:(0,l.jsxs)("a",{href:n.url,target:"_blank",children:[(0,l.jsx)(FormattedMessage,(0,t.Z)({},messages[n.type])),(0,l.jsx)(k.G,{icon:Gn.q7,style:{marginLeft:"0.5em"}})]})})}))})]}):null}Vn.propTypes={category:u().string.isRequired,language:u().string.isRequired};function Fn(n){var e,i=n.category,t=n.language,o=(0,r.Z)((0,q.dd)(!1),3),a=o[0],s=o[1],c=o[2],u=(0,q.um)({category:i,language:t}),m=(0,q.aF)().t,g=(0,d.useRef)();(0,q.O3)(g,(function(){c()}));var f=null!==(e=null===u||void 0===u?void 0:u.length)&&void 0!==e?e:0;return f?f>1?(0,l.jsxs)(Dn,{children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(k.G,{icon:O.gSj}),"\xa0 Download as PDF"]}),(0,l.jsx)("strong",{children:(0,l.jsxs)("div",{ref:g,style:{position:"relative"},children:[(0,l.jsxs)(yn.VM,{onClick:a?c:s,style:{padding:0},children:["See all variants (",f,")",(0,l.jsx)(k.G,{icon:O.eW2,size:"1x",style:{marginLeft:"0.5em"}})]}),a&&(0,l.jsx)(On,{children:null===u||void 0===u?void 0:u.map((function(n){return(0,l.jsx)(qn.HC,{subMenu:!0,children:(0,l.jsxs)("a",{href:n.url,download:(e=m(An[n.type]),"string"!==typeof e?"":e.replace(/[\s\\\/\.]/g,"_")),target:"_blank",children:[(0,l.jsx)(h.Z,{index:An[n.type]}),(0,l.jsx)(k.G,{icon:O.q7m,style:{marginLeft:"0.5em"}})]})});var e}))})]})})]},"pdf"):(0,l.jsxs)(Dn,{children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(k.G,{icon:O.gSj}),"\xa0",(0,l.jsx)(h.Z,{index:An.title})]}),(0,l.jsx)("strong",{children:(0,l.jsx)(yn.Q_,{href:u[0].url,target:"_blank",style:{padding:0},children:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(h.Z,{index:An.download}),(0,l.jsx)(k.G,{icon:O.q7m,size:"1x",style:{marginLeft:"0.5em"}})]})})})]}):null}Fn.propTypes={category:u().string.isRequired,language:u().string.isRequired};var Hn=Fn;function Bn(){var n=(0,a.Z)(["\n text-align: right;\n display: flex;\n flex-wrap: wrap;\n width: 150px;\n justify-content: flex-end;\n @media screen and (min-width: 72em) {\n width: 60%;\n }\n"]);return Bn=function(){return n},n}function $n(){var n=(0,a.Z)(["\n color: ",";\n"]);return $n=function(){return n},n}var Kn=s.default.div.withConfig({componentId:"sc-d5d61e4f-0"})(Bn()),Un=s.default.strong.withConfig({componentId:"sc-d5d61e4f-1"})($n(),(function(n){return n.col||"inherit"})),Wn={"Very easy":"#57b524",Easy:"#8cb532",Moderate:"#d7a500",Difficult:"#e83014","Very difficult":"#e80b24"};function Yn(n){var e,i=n.category,t=n.difficulty,o=n.hideDownloads,r=(n.required_time,n.stepCount),a=(n.commentCount,n.translations),d=(0,_.useRouter)().locale,s=t||"Very easy";return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(Dn,{children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(k.G,{icon:In.qA}),"\xa0",(0,l.jsx)(h.Z,{index:Sn.difficulty})]}),(0,l.jsx)(Un,{col:Wn[s],children:(0,l.jsx)(h.Z,{index:Sn[(e=s||"",e.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g,(function(n,e){return e.toUpperCase()})))]})})]},"difficulty"),(0,l.jsxs)(Dn,{children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(k.G,{icon:_n.Zr}),"\xa0",(0,l.jsx)(h.Z,{index:Sn.steps})]}),(0,l.jsx)(Un,{children:r})]},"steps"),!o&&(0,l.jsx)(Hn,{category:i,language:d}),(0,l.jsxs)(Dn,{children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(R.qt,{width:15,style:{margin:0}}),"\xa0",(0,l.jsx)(h.Z,{index:Sn.availableLanguages})]}),(0,l.jsx)(Kn,{children:(0,l.jsx)(Rn.p,{postType:"guide",translations:a,language:d})})]},"availableLanguages")]})}Yn.propTypes={difficulty:u().string,required_time:u().string,stepCount:u().number,commentCount:u().number,hideDownloads:u().bool};var Jn=Yn,Qn=i(58591),Xn=i(83338),ne=i(19478),ee=i(50205),ie=i(78147),te=i(75622),oe=i(46907);function re(){var n=(0,a.Z)(["\n display: flex;\n margin-bottom: 3em;\n @media screen and (max-width: 48em) {\n flex-direction: column;\n & > div {\n width: 100% !important;\n }\n }\n"]);return re=function(){return n},n}function ae(){var n=(0,a.Z)(["\n width: 40%;\n margin-right: 1em;\n border: 1px solid #ddd;\n @media screen and (max-width: 48em) {\n width: 100%;\n margin-bottom: 1em;\n margin-right: 0;\n }\n"]);return ae=function(){return n},n}function le(){var n=(0,a.Z)(["\n width: 60%;\n @media screen and (max-width: 48em) {\n width: 100%;\n }\n"]);return le=function(){return n},n}function de(){var n=(0,a.Z)(["\n text-align: center;\n display: none;\n @media print {\n display: block;\n page-break-after: always;\n page-break-before: always;\n }\n"]);return de=function(){return n},n}function se(){var n=(0,a.Z)(["\n position: relative;\n @media screen and (min-width: 64em) {\n padding-left: 2em;\n }\n"]);return se=function(){return n},n}function ce(){var n=(0,a.Z)(["\n display: inline-block;\n float: left;\n"]);return ce=function(){return n},n}function ue(){var n=(0,a.Z)(["\n display: inline-block;\n float: right;\n"]);return ue=function(){return n},n}var me=!0,ge=s.default.div.withConfig({componentId:"sc-faa9a1ad-0"})(re()),fe=s.default.div.withConfig({componentId:"sc-faa9a1ad-1"})(ae()),pe=s.default.div.withConfig({componentId:"sc-faa9a1ad-2"})(le()),ve=s.default.div.withConfig({componentId:"sc-faa9a1ad-3"})(de()),he=(0,s.default)(w.JX).withConfig({componentId:"sc-faa9a1ad-4"})(se()),xe=s.default.a.withConfig({componentId:"sc-faa9a1ad-5"})(ce()),je=s.default.a.withConfig({componentId:"sc-faa9a1ad-6"})(ue());function we(n){var e,i,a,s,c,u,m,p=n.swrFallback,b=n.language,Z=n.global,C=(n.referer,n.userData),k=(0,d.useContext)(f.kn),I=k.roles,_=k.isPreview,M=k.isLoggedIn,S=k.password,R=(0,d.useContext)(f.qU).dispatch,P=(0,r.Z)((0,q._)(!1),2),D=P[0],G=P[1],N=(0,q.kx)(I).isInAnyRole,O=N([ie.K$.AUTHOR,ie.K$.ADMIN,ie.K$.EMPLOYEE,ie.K$.COMMENT_ADMIN]),z=v.ZP.guides.withSWR({fallback:p,middleware:function(n){var e,i,r;return(0,o.Z)((0,t.Z)({},null===n||void 0===n||null===(e=n.data)||void 0===e?void 0:e[0]),{previous_item:(null===n||void 0===n||null===(i=n.info)||void 0===i?void 0:i.previous_item)||null,next_item:(null===n||void 0===n||null===(r=n.info)||void 0===r?void 0:r.next_item)||null})}}),V=z.data,F=z.isLoading,H=(z.refetch,v.ZP.categories.withSWR({fallback:p,middleware:function(n){return{data:n,categoriesBySlug:(0,j.Um)(n)}}})),B=H.data,$=(null===V||void 0===V?void 0:V.categories)&&(null===V||void 0===V?void 0:V.categories[0]),K=$&&(null===B||void 0===B?void 0:B.data)?(0,j.NJ)(B.data,$):[],U=K&&K[K.length-1],W=(null===V||void 0===V?void 0:V.title)?(0,j.Hl)(null===V||void 0===V?void 0:V.title):"",Y=v.ZP.steps.withSWR({fallback:p}),J=Y.data,Q=Y.isLoading,X=v.ZP.guides.withSWR({fallback:p.siblings,extractDataProp:!0}),nn=X.data,en=(X.isLoading,(0,d.useMemo)((function(){return(null===J||void 0===J?void 0:J.length)?J.reduce((function(n,e){return e.updated>n||null===n?e.updated:n}),null):null===V||void 0===V?void 0:V.updated}),[V,J])),tn=(0,d.useMemo)((function(){var n,e,i=[];if((null===V||void 0===V||null===(n=V.tags)||void 0===n?void 0:n.length)&&(null===Z||void 0===Z?void 0:Z.tagsBySlug)){var r=Z.tagsBySlug[null===V||void 0===V?void 0:V.tags[0]];i.push({title:null===r||void 0===r?void 0:r.name,link:(0,j.Y4)({language:b,item:(0,o.Z)((0,t.Z)({},r),{type:"tag"})})})}return(null===V||void 0===V||null===(e=V.categories)||void 0===e?void 0:e.length)&&K&&K.reverse().forEach((function(n){i.push({title:n.title,link:(0,j.Y4)({language:b,item:(0,o.Z)((0,t.Z)({},n),{type:"category"})})})})),i.push({title:W}),i}),[V]),on=U&&Z&&(null===Z||void 0===Z||null===(e=Z.data)||void 0===e||null===(i=e.assembly_categories)||void 0===i?void 0:i.includes(U.id)),rn=(0,d.useMemo)((function(){var n;return(null===V||void 0===V?void 0:V.translations_info)?null===(n=Object.keys(null===V||void 0===V?void 0:V.translations_info))||void 0===n?void 0:n.reduce((function(n,e){var i;return n[e]="/".concat(e,"/guide/").concat(null===(i=null===V||void 0===V?void 0:V.translations_info[e])||void 0===i?void 0:i.slug,"/"),n}),{}):null}),[V]);return F?(0,l.jsx)(T.Z,{occupySpace:!0}):(null===V||void 0===V?void 0:V.title)||F?(0,l.jsxs)(Qn.Z,{global:Z,translations:V.translations_info,children:[(0,l.jsx)(ee.Z,{title:"".concat(V.parent?"".concat(V.parent.title," | "):"").concat(W),description:(null===V||void 0===V?void 0:V.excerpt)||(null===V||void 0===V?void 0:V.content.substring(0,1e3))||(null===J||void 0===J?void 0:J.map((function(n,e){return"".concat(e+1,". ").concat(n.title)})).join(", ")),image:null===(a=V.media)||void 0===a?void 0:a.image,locales:rn,translations:V.translations_info}),(0,l.jsx)(w.jT,{children:(0,l.jsx)(w.UB,{height:10,children:(0,l.jsxs)(w.im,{style:{width:"100%"},children:[(0,l.jsx)(y.Z,{items:tn,language:b}),(0,l.jsxs)("h1",{style:{textAlign:"center"},children:[W,(0,l.jsx)(L.Z,{language:b,status:V.translation_status})]}),O&&(0,l.jsxs)("small",{children:["ID ",V.id]}),N([ie.K$.AUTHOR,ie.K$.ADMIN])&&(0,l.jsx)(E.Z,{url:"/admin/guide/".concat(on?"".concat(null===V||void 0===V||null===(s=V.categories)||void 0===s?void 0:s[0],"/"):"").concat(null===V||void 0===V?void 0:V.slug)}),N([ie.K$.AUTHOR,ie.K$.ADMIN,ie.K$.COMMENT_ADMIN])&&(0,l.jsxs)(w.VM,{onClick:function(){return G(!D)},style:{float:"right"},children:[D?"Hide":"Expand"," all comments"]})]})})}),(0,l.jsx)(w.ln,{borderBottom:!0,children:(0,l.jsxs)(w.im,{children:[(0,l.jsxs)("div",{style:{display:"flex",alignItems:"flex-start"},children:[(0,l.jsx)(Xn.Z,{categories:(null===U||void 0===U?void 0:U.childrens)&&(_?U.childrens:[B.categoriesBySlug[V.categories[0]]]),catSlug:$,itemSlug:V.slug,siblings:nn,itemType:"guides",language:b,items:J,offset:260,isPreview:_,labelRender:function(n,e){return"".concat(e+1,". ").concat(n.title)}}),(0,l.jsxs)(he,{cols:12,children:[(0,l.jsxs)(ve,{children:[(0,l.jsxs)("h1",{children:[W,(0,l.jsx)(L.Z,{language:b,status:V.translation_status})]}),(0,l.jsx)(w.Ee,{image:null===(c=V.media)||void 0===c?void 0:c.image,alt:V.title})]}),(0,l.jsxs)(w.jT,{children:[(0,l.jsx)(ne.Z,{language:b,tags:V.tags,allTags:null===Z||void 0===Z?void 0:Z.tagsBySlug,updated:en}),(0,l.jsxs)(ge,{children:[V.media&&V.media.image&&(0,l.jsx)(fe,{children:(0,l.jsx)(w.Ee,{image:V.media.image,alt:V.title})}),(0,l.jsxs)(pe,{children:[V.meta&&(null===(u=Object.keys(V.meta))||void 0===u?void 0:u.length)&&(0,l.jsx)(Jn,(0,o.Z)((0,t.Z)({},V.meta),{hideDownloads:!0===V.password,category:$,translations:V.translations_info,commentCount:null===J||void 0===J||null===(m=J.data)||void 0===m?void 0:m.reduce((function(n,e){return n+e.comments}),V.comments),language:b,stepCount:J?J.length:0})),V.content&&(0,j.Hl)(V.content)]})]})]}),(0,l.jsxs)(te.Z,{onReload:function(n){return R({type:"setPassword",payload:n})},slug:V.slug,enteredPassword:S,password:(null===V||void 0===V?void 0:V.password)||"",badPassword:null===V||void 0===V?void 0:V.bad_password,isAdmin:O,children:[Q&&!J&&(0,l.jsx)(T.Z,{}),null===J||void 0===J?void 0:J.map((function(n,e){var i;return(0,d.createElement)(jn,(0,o.Z)((0,t.Z)({},n),{key:n.id,iterator:e+1,isLoggedIn:M,language:b,isAdmin:N([ie.K$.AUTHOR,ie.K$.ADMIN]),guideSlug:null===V||void 0===V?void 0:V.slug,categorySlug:on?null===V||void 0===V||null===(i=V.categories)||void 0===i?void 0:i[0]:"",forceCommentsOpen:D}))}))]}),(0,l.jsxs)(w.jT,{children:[on&&V.previous_item&&(0,l.jsx)(xe,{href:"/".concat(b)+(0,j.Y4)({language:b,item:V.previous_item}),children:(0,l.jsxs)(w.ei,{children:["\xab ",(0,l.jsx)(h.Z,{index:g.previous})]})}),on&&V.next_item&&(0,l.jsx)(je,{href:"/".concat(b)+(0,j.Y4)({language:b,item:V.next_item}),children:(0,l.jsxs)(w.ei,{style:{marginLeft:V.previous_item?"inherit":"auto"},children:[(0,l.jsx)(h.Z,{index:g.next})," \xbb"]})})]})]})]}),(0,l.jsx)(x.Z,{entityType:"guide",entityId:null===V||void 0===V?void 0:V.id})]})}),(0,l.jsx)(w.jT,{children:(0,l.jsxs)(w.im,{width:600,children:[(0,l.jsxs)("h3",{style:{textAlign:"center",margin:"2em auto"},children:[V.comments_count," ",(0,l.jsx)(h.Z,{index:g.comments})]}),V.id&&(0,l.jsx)(A.Z,{open:!0,parentId:V.id,commentsOpen:!0,visibleItems:10})]})})]}):(0,l.jsx)(Qn.Z,{global:Z,children:(0,l.jsx)(oe.rs,{globalState:{isPreview:_,isLoggedIn:M,userData:C}})})}we.propTypes={language:u().string.isRequired,swrFallback:u().object.isRequired};var ye=(0,p.Z)(we)}}]); //# sourceMappingURL=6956-c7e5af931dbf295f.js.map