diff --git a/Changelog.md b/Changelog.md
index b1587b590108c9faff1bce5e50a0a5014929c1bf..b0ed7a26c4bcd9ccbd2c05560e18768e25549821 100644
--- a/Changelog.md
+++ b/Changelog.md
@@ -2,6 +2,11 @@
 
 All notable changes to this project will be documented in this file.
 
+## [0.82] - 2025-01-22
+- Fix data download in case of survey responses that haven't been initialized for NRENs
+- Add navigation to the survey pages for admins
+- Add back validateWebsiteUrl validation function for the 2023 survey
+
 ## [0.81] - 2025-01-22
 - Harden get_response_data for moving responses from a previous survey to a new survey year.
 - Moved response data now satisfies the dependencies of the new survey. If a question would be hidden in the new survey, the data for that question is removed.
diff --git a/compendium-frontend/src/survey/SurveyContainerComponent.tsx b/compendium-frontend/src/survey/SurveyContainerComponent.tsx
index c887e0e323072eee3f130df4341b7b5cf7488c3e..c516fc305cc9d6e16925a157f26b687136fc99eb 100644
--- a/compendium-frontend/src/survey/SurveyContainerComponent.tsx
+++ b/compendium-frontend/src/survey/SurveyContainerComponent.tsx
@@ -1,4 +1,4 @@
-import React, { useEffect, useState, useCallback } from "react";
+import React, { useEffect, useState, useCallback, useContext } from "react";
 import { Container } from "react-bootstrap";
 import toast, { Toaster } from "react-hot-toast";
 import { Model, Serializer } from "survey-core";
@@ -12,7 +12,8 @@ import './survey.scss';
 import useMatomo from "../matomo/UseMatomo";
 import { FunctionFactory } from "survey-core";
 import { validationFunctions } from "./validation/validation";
-
+import SurveySidebar from "./management/SurveySidebar";
+import { userContext } from "../providers/UserProvider";
 
 interface ValidationQuestion {
     name?: string;
@@ -25,6 +26,28 @@ const questionOverrides = {
     data_protection_contact: (...args) => true, // don't validate the contact field, anything goes..
 }
 
+function oldValidateWebsiteUrl(params) {
+    let value = params[0];
+    if ((value == undefined || value == null || value == '')) {
+        return true;
+    }
+    try {
+        value = value.trim();
+        if (value.includes(" ")) {
+            return false;
+        }
+        // if there's not a protocol, add one for the test
+        if (!value.includes(":/")) {
+            value = "https://" + value;
+        }
+
+        const url = new URL(value);
+        return !!url
+    } catch (err) {
+        return false;
+    }
+}
+
 function validateQuestion(this: { question: ValidationQuestion, row?: any }, params: any) {
     try {
         const question = this.question;
@@ -58,22 +81,27 @@ function validateQuestion(this: { question: ValidationQuestion, row?: any }, par
     }
 }
 
-
-
-
 Serializer.addProperty("itemvalue", "customDescription:text");
 Serializer.addProperty("question", "hideCheckboxLabels:boolean");
 
-
 function SurveyContainerComponent({ loadFrom }) {
     const [surveyModel, setSurveyModel] = useState<Model>();  // note that this is never updated and we abuse that fact by adding extra state to the surveyModel
     const { year, nren } = useParams();  // nren stays empty for inspect and try
     const [error, setError] = useState<string>('loading survey...');
+    const { user } = useContext(userContext);
+
+    const loggedIn = !!user.id;
+    const isAdmin = loggedIn ? user.permissions.admin : false;
 
     if (!FunctionFactory.Instance.hasFunction("validateQuestion")) {
         FunctionFactory.Instance.register("validateQuestion", validateQuestion);
     }
 
+    if (!FunctionFactory.Instance.hasFunction("validateWebsiteUrl")) {
+        FunctionFactory.Instance.register("validateWebsiteUrl", oldValidateWebsiteUrl);
+    }
+
+
     const { trackPageView } = useMatomo();
 
     const beforeUnloadListener = useCallback((event) => {
@@ -276,13 +304,16 @@ function SurveyContainerComponent({ loadFrom }) {
     }
 
     return (
-        <Container className="survey-container">
-            <Toaster />
-            <Prompt message="Are you sure you want to leave this page? Information you've entered may not be saved." when={() => { return surveyModel.mode == 'edit' && !!nren; }} onPageExit={onPageExitThroughRouter} />
-            <SurveyNavigationComponent surveyModel={surveyModel} surveyActions={surveyActions} year={year} nren={nren}>
-                <SurveyComponent surveyModel={surveyModel} />
-            </SurveyNavigationComponent>
-        </Container>
+        <>
+            {isAdmin ? <SurveySidebar /> : null}
+            <Container className="survey-container">
+                <Toaster />
+                <Prompt message="Are you sure you want to leave this page? Information you've entered may not be saved." when={() => { return surveyModel.mode == 'edit' && !!nren; }} onPageExit={onPageExitThroughRouter} />
+                <SurveyNavigationComponent surveyModel={surveyModel} surveyActions={surveyActions} year={year} nren={nren}>
+                    <SurveyComponent surveyModel={surveyModel} />
+                </SurveyNavigationComponent>
+            </Container>
+        </>
     );
 }
 
diff --git a/compendium_v2/routes/data_download.py b/compendium_v2/routes/data_download.py
index 214043e4dce186edd2ba70a565591afa19c50eee..bd394ddcbe9a84bfc1e7c0ce3dd1c3e3e75191d5 100644
--- a/compendium_v2/routes/data_download.py
+++ b/compendium_v2/routes/data_download.py
@@ -99,7 +99,7 @@ def fetch_survey_comments():
             'A NREN': response.nren.name,
             'A Year': response.survey_year,
         }
-        for key, val in response.answers['data'].items():
+        for key, val in response.answers.get('data', {}).items():
             if key.endswith('_comments'):
                 data[key] = val
         if len(data) > 2:  # only return responses with comments
diff --git a/compendium_v2/static/bundle.js b/compendium_v2/static/bundle.js
index 43394eb5375529660db5fd0f06783cf5904b7717..c51d526f11ef07f343a5ca0c377a53ae2d9a98fd 100644
--- a/compendium_v2/static/bundle.js
+++ b/compendium_v2/static/bundle.js
@@ -169,4 +169,4 @@ to {
   > * {
     pointer-events: auto;
   }
-`,cO=({reverseOrder:t,position:n="top-center",toastOptions:r,gutter:o,children:i,containerStyle:s,containerClassName:a})=>{let{toasts:l,handlers:u}=(t=>{let{toasts:n,pausedAt:r}=((t={})=>{let[n,r]=(0,e.useState)(D_);(0,e.useEffect)((()=>(N_.push(r),()=>{let e=N_.indexOf(r);e>-1&&N_.splice(e,1)})),[n]);let o=n.toasts.map((e=>{var n,r,o;return{...t,...t[e.type],...e,removeDelay:e.removeDelay||(null==(n=t[e.type])?void 0:n.removeDelay)||(null==t?void 0:t.removeDelay),duration:e.duration||(null==(r=t[e.type])?void 0:r.duration)||(null==t?void 0:t.duration)||M_[e.type],style:{...t.style,...null==(o=t[e.type])?void 0:o.style,...e.style}}}));return{...n,toasts:o}})(t);(0,e.useEffect)((()=>{if(r)return;let e=Date.now(),t=n.map((t=>{if(t.duration===1/0)return;let n=(t.duration||0)+t.pauseDuration-(e-t.createdAt);if(!(n<0))return setTimeout((()=>F_.dismiss(t.id)),n);t.visible&&F_.dismiss(t.id)}));return()=>{t.forEach((e=>e&&clearTimeout(e)))}}),[n,r]);let o=(0,e.useCallback)((()=>{r&&L_({type:6,time:Date.now()})}),[r]),i=(0,e.useCallback)(((e,t)=>{let{reverseOrder:r=!1,gutter:o=8,defaultPosition:i}=t||{},s=n.filter((t=>(t.position||i)===(e.position||i)&&t.height)),a=s.findIndex((t=>t.id===e.id)),l=s.filter(((e,t)=>t<a&&e.visible)).length;return s.filter((e=>e.visible)).slice(...r?[l+1]:[0,l]).reduce(((e,t)=>e+(t.height||0)+o),0)}),[n]);return(0,e.useEffect)((()=>{n.forEach((e=>{if(e.dismissed)((e,t=1e3)=>{if(H_.has(e))return;let n=setTimeout((()=>{H_.delete(e),L_({type:4,toastId:e})}),t);H_.set(e,n)})(e.id,e.removeDelay);else{let t=H_.get(e.id);t&&(clearTimeout(t),H_.delete(e.id))}}))}),[n]),{toasts:n,handlers:{updateHeight:q_,startPause:B_,endPause:o,calculateOffset:i}}})(r);return e.createElement("div",{id:"_rht_toaster",style:{position:"fixed",zIndex:9999,top:16,left:16,right:16,bottom:16,pointerEvents:"none",...s},className:a,onMouseEnter:u.startPause,onMouseLeave:u.endPause},l.map((r=>{let s=r.position||n,a=((e,t)=>{let n=e.includes("top"),r=n?{top:0}:{bottom:0},o=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:k_()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...o}})(s,u.calculateOffset(r,{reverseOrder:t,gutter:o,defaultPosition:n}));return e.createElement(lO,{id:r.id,key:r.id,onHeightUpdate:u.updateHeight,className:r.visible?uO:"",style:a},"custom"===r.type?R_(r.message,r):i?i(r):e.createElement(aO,{toast:r,position:s}))})))},pO=F_,hO=n(522),dO=n(136),fO=function(e){return e.Unverified="unverified",e.Verified="verified",e.Edited="edited",e}({}),mO=function(e){return e.closed="closed",e.open="open",e.preview="preview",e.published="published",e}({});function gO(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return yO(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?yO(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,i=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw i}}}}function yO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function vO(e,t){if(0==t.column.indexValue&&"item"in t.row){var n,r,o=t.row.item;void 0!==o.customDescription&&(null===(n=t.htmlElement.parentElement)||void 0===n||n.children[0].children[0].setAttribute("description",o.customDescription),null===(r=t.htmlElement.parentElement)||void 0===r||r.children[0].children[0].classList.add("survey-tooltip"))}}function bO(e,t){t.question.hideCheckboxLabels&&(t.cssClasses.root+=" hidden-checkbox-labels")}function CO(e,t){var n,r='[data-name="'+t.question.name+'"]',o=null===(n=document.querySelector(r))||void 0===n?void 0:n.querySelector("h5");o&&!o.classList.contains("sv-header-flex")&&t.question.updateElementCss()}function wO(e,t){if("description"===t.name){var n=t.text;if(n.length){for(var r=["e.g.","i.e.","etc.","vs."],o=0,i=r;o<i.length;o++){var s=i[o];n.includes(s)&&(n=n.replace(s,s.slice(0,-1)))}for(var a=n.split(". "),l=0;l<a.length;l++)if(0!=a[l].length){var u,c=gO(r);try{for(c.s();!(u=c.n()).done;){var p=u.value;a[l].includes(p.slice(0,-1))&&(a[l]=a[l].replace(p.slice(0,-1),p))}}catch(e){c.e(e)}finally{c.f()}}var h=a.map((function(e){return e.length?"<p>".concat((t=e).includes("*")?t.split("*").map((function(e,t){return 0==t?e:1==t?"<ul><li>".concat(e,"</li>"):"<li>".concat(e,"</li>")})).join("")+"</ul>":t.endsWith(".")?t:t+".","</p>"):null;var t})).join("");t.html=h}}}function xO(e,t,n){var r;n.verificationStatus.set(e.name,t);var o=document.createElement("button");o.type="button",o.className="sv-action-bar-item verification",o.innerHTML=t,t==fO.Unverified?(o.innerHTML="No change from previous year",o.className+=" verification-required",o.onclick=function(){"display"!=n.mode&&(e.validate(),xO(e,fO.Verified,n))}):(o.innerHTML="Answer updated",o.className+=" verification-ok");var i='[data-name="'+e.name+'"]',s=null===(r=document.querySelector(i))||void 0===r?void 0:r.querySelector("h5"),a=null==s?void 0:s.querySelector(".verification");a?a.replaceWith(o):null==s||s.appendChild(o)}const EO=function(t){var n=t.surveyModel,r=(0,e.useCallback)((function(e,t){var r,o=n.verificationStatus.get(t.question.name),i=null===(r=t.question)||void 0===r?void 0:r.readOnly;o&&!i?xO(t.question,o,n):i&&function(e){var t,n=!!e.visibleIf,r='[data-name="'+e.name+'"]',o=document.querySelector(r),i=null==o?void 0:o.querySelector("h5");if(n)o.style.display="none";else{i&&(i.style.textDecoration="line-through");var s=null===(t=document.querySelector(r))||void 0===t?void 0:t.querySelector(".sv-question__content");s&&(s.style.display="none")}}(t.question)}),[n]),o=(0,e.useCallback)((function(e,t){n.verificationStatus.get(t.question.name)==fO.Unverified&&xO(t.question,fO.Edited,n)}),[n]);return n.css.question.title.includes("sv-header-flex")||(n.css.question.title="sv-title sv-question__title sv-header-flex",n.css.question.titleOnError="sv-question__title--error sv-error-color-fix"),n.onAfterRenderQuestion.hasFunc(r)||(n.onAfterRenderQuestion.add(r),n.onAfterRenderQuestion.add(CO)),n.onValueChanged.hasFunc(o)||n.onValueChanged.add(o),n.onUpdateQuestionCssClasses.hasFunc(bO)||n.onUpdateQuestionCssClasses.add(bO),n.onMatrixAfterCellRender.hasFunc(vO)||n.onMatrixAfterCellRender.add(vO),n.onTextMarkdown.hasFunc(wO)||n.onTextMarkdown.add(wO),e.createElement(dO.Survey,{model:n})};function PO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function SO(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?PO(Object(n),!0).forEach((function(t){vn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PO(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const _O=function(t){var n=t.surveyModel,r=t.pageNoSetter,o=Qt((0,e.useState)([]),2),i=o[0],s=o[1],a=function(e){return!(null===e.value||void 0===e.value||""===e.value||"checkbox"===e.getType()&&0==e.value.length||"multipletext"===e.getType()&&(1===Object.keys(e.value).length&&void 0===Object.values(e.value)[0]||0===Object.keys(e.value).length))};(0,e.useEffect)((function(){var e=function(e){if(e&&e.pages){var t=[];e.pages.forEach((function(n){var r=n.questions.filter((function(e){return e.startWithNewLine})),o=r.length,i=r.filter(a).length,s=o-i,l=i/o;t.push({completionPercentage:100*l,unansweredPercentage:s/o*100,totalPages:e.pages.length,pageTitle:n.title})})),s(t)}};n.onValueChanged.add((function(t){e(t)})),e(n)}),[n]);var l={height:"0.5rem",transition:"width 0.3s ease"};return e.createElement(Qn,{className:"survey-progress"},e.createElement(Gn,null,i.map((function(t,o){return e.createElement(Kn,{xs:12,md:!0,key:o,onClick:function(){return r(o)},style:{cursor:"pointer",margin:"0.5rem"}},e.createElement("div",null,e.createElement("span",{style:{whiteSpace:"nowrap",fontSize:"1.5rem",marginRight:"0.25rem",fontWeight:"bold",color:"#2db394"}},o+1),e.createElement("span",{style:SO({whiteSpace:"nowrap"},n.currentPageNo==o&&{fontWeight:"bold"})},t.pageTitle),e.createElement("div",{style:{display:"flex",flexWrap:"wrap"}},e.createElement("div",{style:SO(SO({},l),{},{width:"".concat(t.completionPercentage,"%"),backgroundColor:"#262261"})}),e.createElement("div",{style:SO(SO({},l),{},{width:"".concat(t.unansweredPercentage,"%"),backgroundColor:"#cdcdcd"})}))))}))))},OO=function(t){var n=t.surveyModel,r=t.surveyActions,o=t.year,i=t.nren,s=t.children,a=Qt((0,e.useState)(0),2),l=a[0],u=a[1],c=Qt((0,e.useState)(!1),2),p=c[0],h=c[1],d=Qt((0,e.useState)(""),2),f=d[0],m=d[1],g=Qt((0,e.useState)(""),2),y=g[0],v=g[1],b=(0,e.useContext)(tn).user,C=(0,e.useCallback)((function(){h("edit"==n.mode),m(n.lockedBy),u(n.currentPageNo),v(n.status)}),[n]);(0,e.useEffect)((function(){C()}),[C]);var w=function(e){u(e),n.currentPageNo=e},x=function(){w(n.currentPageNo+1)},E=function(){var e=Kt(Zt().mark((function e(t){return Zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r[t]();case 2:C();case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),P=function(e,t){return S(e,(function(){return E(t)}))},S=function(t,n){return e.createElement("button",{className:"sv-btn sv-btn--navigation",onClick:n},t)},_="Save and stop editing",O="Save progress",T="Start editing",V="Complete Survey",R=function(){return e.createElement("div",{className:"survey-edit-buttons-block"},!p&&!f&&n.editAllowed&&P(T,"startEdit"),!p&&f&&f==b.name&&P("Discard any unsaved changes and release your lock","releaseLock"),p&&P(O,"save"),p&&P(_,"saveAndStopEdit"),p&&P(V,"complete"),l!==n.visiblePages.length-1&&S("Next Section",x))};return e.createElement(Qn,null,e.createElement(Gn,{className:"survey-content"},e.createElement("h2",null,e.createElement("span",{className:"survey-title"},o," Compendium Survey "),e.createElement("span",{className:"survey-title-nren"}," ",i," "),e.createElement("span",null," - ",y)),e.createElement("div",{style:{marginTop:"1rem",textAlign:"justify"}},e.createElement("p",null,"To get started, click “",T,"” to end read-only mode. Different people from your NREN (Compendium administrators) can contribute to the survey if needed, but agreement should be reached internally before completing the survey as the administration team will treat responses as a single source of truth from the NREN. You can start editing only when nobody else from your NREN is currently working on the survey."),e.createElement("p",null,e.createElement("b",null,"In a small change, the survey now asks about this calendar year, i.e. ",o)," (or the current financial year if your budget or staffing data does not match the calendar year). For network questions, please provide data from the 12 months preceding you answering the question. Where available, the survey questions are pre-filled with answers from the previous survey. You can edit the pre-filled answer to provide new information, or press the “no change from previous year” button."),e.createElement("p",null,"Press the “",O,"“ or “",_,"“ button to save all answers in the survey. When you reach the last section of the survey (Services), you will find a “",V,"“ button which saves all answers in the survey and lets the Compendium team know that your answers are ready to be published. As long as the survey remains open, any Compendium administrator from your NREN can add answers or amend existing ones, even after using the “",V,"“ button."),e.createElement("p",null,"Some fields require specific data, such as numerical data, valid http-addresses, and in some questions, the answer has to add up to 100%. If an answer does not fulfil the set criteria, the question will turn pink and an error message will appear. Fields can be left blank if you prefer not to answer a question. If you notice any errors after the survey was closed, please contact us for correcting those.")),e.createElement("p",null,"Thank you for taking the time to fill in the ",o," Compendium Survey. Any questions or requests can be sent to ",e.createElement("a",{href:"mailto:Partner-Relations@geant.org"},e.createElement("span",null,"Partner-Relations@geant.org"))),p&&e.createElement(e.Fragment,null,e.createElement("br",null),e.createElement("b",null,"Remember to click “",_,"” before leaving the page."))),e.createElement(Gn,null,R()),e.createElement(Gn,{className:"survey-content"},!p&&e.createElement("div",{className:"survey-edit-explainer"},!f&&n.editAllowed&&"The survey is in read-only mode; click the “Start editing“ button to begin editing the answers.",!f&&!n.editAllowed&&"The survey is in read-only mode and can not be edited by you.",f&&f!=b.name&&"The survey is in read-only mode and currently being edited by: "+f+". To start editing the survey, ask them to complete their edits.",f&&f==b.name&&'The survey is in read-only mode because you started editing in another tab, browser or device. To start editing the survey, either complete those edits or click the "Discard any unsaved changes" button.')),e.createElement(Gn,null,e.createElement(_O,{surveyModel:n,pageNoSetter:w}),s),e.createElement(Gn,null,R()))},TO=function(t){var n=t.when,r=t.onPageExit;return function(t){let{router:n,basename:r}=tt("useBlocker"),o=nt("useBlocker"),[i,s]=e.useState(""),a=e.useCallback((e=>{if("function"!=typeof t)return!!t;if("/"===r)return t(e);let{currentLocation:n,nextLocation:o,historyAction:i}=e;return t({currentLocation:{...n,pathname:O(n.pathname,r)||n.pathname},nextLocation:{...o,pathname:O(o.pathname,r)||o.pathname},historyAction:i})}),[r,t]);e.useEffect((()=>{let e=String(++ot);return s(e),()=>n.deleteBlocker(e)}),[n]),e.useEffect((()=>{""!==i&&n.getBlocker(i,a)}),[n,i,a]),i&&o.blockers.has(i)&&o.blockers.get(i)}((function(){if(n()){var e=window.confirm(t.message);return e&&r(),!e}return!1})),e.createElement("div",null)};var VO={validateWebsiteUrl:function(e){if(!(arguments.length>1&&void 0!==arguments[1]&&arguments[1]||null!=e&&null!=e&&""!=e))return!0;try{return!(e=e.trim()).includes(" ")&&(e.includes(":/")||(e="https://"+e),!!new URL(e))}catch(e){return!1}}},RO={data_protection_contact:function(){return!0}};function IO(e){try{var t,n=this.question,r=e[0]||void 0;t=n.data&&"name"in n.data?n.data.name:n.name;var o=n.value,i=RO[t];if(i)return i.apply(void 0,[o].concat(fn(e.slice(1))));var s=VO[r];if(!s)throw new Error("Validation function ".concat(r," not found for question ").concat(t));return s.apply(void 0,[o].concat(fn(e.slice(1))))}catch(e){return console.error(e),!1}}hO.Serializer.addProperty("itemvalue","customDescription:text"),hO.Serializer.addProperty("question","hideCheckboxLabels:boolean");const kO=function(t){var n=t.loadFrom,r=Qt((0,e.useState)(),2),o=r[0],i=r[1],s=function(){let{matches:t}=e.useContext(qe),n=t[t.length-1];return n?n.params:{}}(),a=s.year,l=s.nren,u=Qt((0,e.useState)("loading survey..."),2),c=u[0],p=u[1];hO.FunctionFactory.Instance.hasFunction("validateQuestion")||hO.FunctionFactory.Instance.register("validateQuestion",IO);var h=Vr().trackPageView,d=(0,e.useCallback)((function(e){return e.preventDefault(),e.returnValue=""}),[]),f=(0,e.useCallback)((function(){window.navigator.sendBeacon("/api/response/unlock/"+a+"/"+l)}),[]),m=(0,e.useCallback)((function(){window.navigator.sendBeacon("/api/response/unlock/"+a+"/"+l),removeEventListener("beforeunload",d,{capture:!0}),removeEventListener("pagehide",f)}),[]);if((0,e.useEffect)((function(){function e(){return(e=Kt(Zt().mark((function e(){var t,r,o,s;return Zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(n+a+(l?"/"+l:""));case 2:return t=e.sent,e.next=5,t.json();case 5:if(r=e.sent,t.ok){e.next=12;break}if(!("message"in r)){e.next=11;break}throw new Error(r.message);case 11:throw new Error("Request failed with status ".concat(t.status));case 12:for(s in(o=new hO.Model(r.model)).setVariable("surveyyear",a),o.setVariable("previousyear",parseInt(a)-1),o.showNavigationButtons=!1,o.requiredText="",o.verificationStatus=new Map,r.verification_status)o.verificationStatus.set(s,r.verification_status[s]);o.data=r.data,o.clearIncorrectValues(!0),o.currentPageNo=r.page,o.mode=r.mode,o.lockedBy=r.locked_by,o.status=r.status,o.editAllowed=r.edit_allowed,i(o);case 27:case"end":return e.stop()}}),e)})))).apply(this,arguments)}(function(){return e.apply(this,arguments)})().catch((function(e){return p("Error when loading survey: "+e.message)})).then((function(){h({documentTitle:"Survey for ".concat(l," (").concat(a,")")})}))}),[]),!o)return c;var g,y,v,b,C,w=function(){var e=Kt(Zt().mark((function e(t,n){var r,i,s;return Zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(l){e.next=2;break}return e.abrupt("return","Saving not available in inpect/try mode");case 2:return r={lock_uuid:t.lockUUID,new_state:n,data:t.data,page:t.currentPageNo,verification_status:Object.fromEntries(t.verificationStatus)},e.prev=3,e.next=6,fetch("/api/response/save/"+a+"/"+l,{method:"POST",headers:{"Content-Type":"application/json; charset=utf-8"},body:JSON.stringify(r)});case 6:return i=e.sent,e.next=9,i.json();case 9:if(s=e.sent,i.ok){e.next=12;break}return e.abrupt("return",s.message);case 12:o.mode=s.mode,o.lockedBy=s.locked_by,o.status=s.status,e.next=20;break;case 17:return e.prev=17,e.t0=e.catch(3),e.abrupt("return","Unknown Error: "+e.t0.message);case 20:case"end":return e.stop()}}),e,null,[[3,17]])})));return function(t,n){return e.apply(this,arguments)}}(),x=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n="",r=function(e,t){e.verificationStatus.get(t.name)==fO.Unverified&&(""==n&&(n=t.name),t.error='Please verify that last years data is correct by editing the answer or pressing the "No change from previous year" button!')};t&&o.onValidateQuestion.add(r);var i=e();return t&&o.onValidateQuestion.remove(r),i||pO("Validation failed!"),i},E={save:(C=Kt(Zt().mark((function e(){var t;return Zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(x(o.validate.bind(o,!0,!0),!1)){e.next=4;break}return pO("Please correct the invalid fields before saving!"),e.abrupt("return");case 4:return e.next=6,w(o,"editing");case 6:t=e.sent,pO(t?"Failed saving survey: "+t:"Survey saved!");case 8:case"end":return e.stop()}}),e)}))),function(){return C.apply(this,arguments)}),complete:(b=Kt(Zt().mark((function e(){var t;return Zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!x(o.validate.bind(o,!0,!0))){e.next=6;break}return e.next=4,w(o,"completed");case 4:(t=e.sent)?pO("Failed completing survey: "+t):(pO("Survey completed!"),removeEventListener("beforeunload",d,{capture:!0}),removeEventListener("pagehide",f));case 6:case"end":return e.stop()}}),e)}))),function(){return b.apply(this,arguments)}),saveAndStopEdit:(v=Kt(Zt().mark((function e(){var t;return Zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(x(o.validate.bind(o,!0,!0),!1)){e.next=4;break}return pO("Please correct the invalid fields before saving."),e.abrupt("return");case 4:return e.next=6,w(o,"readonly");case 6:(t=e.sent)?pO("Failed saving survey: "+t):(pO("Survey saved!"),removeEventListener("beforeunload",d,{capture:!0}),removeEventListener("pagehide",f));case 8:case"end":return e.stop()}}),e)}))),function(){return v.apply(this,arguments)}),startEdit:(y=Kt(Zt().mark((function e(){var t,n,r;return Zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("/api/response/lock/"+a+"/"+l,{method:"POST"});case 2:return t=e.sent,e.next=5,t.json();case 5:if(n=e.sent,t.ok){e.next=9;break}return pO("Failed starting edit: "+n.message),e.abrupt("return");case 9:for(r in addEventListener("pagehide",f),addEventListener("beforeunload",d,{capture:!0}),n.verification_status)o.verificationStatus.set(r,n.verification_status[r]);if(o.data=n.data,o.clearIncorrectValues(!0),o.mode=n.mode,o.lockedBy=n.locked_by,o.lockUUID=n.lock_uuid,o.status=n.status,x(o.validate.bind(o,!0,!0),!1)){e.next=22;break}return pO("Some fields are invalid, please correct them."),e.abrupt("return");case 22:case"end":return e.stop()}}),e)}))),function(){return y.apply(this,arguments)}),releaseLock:(g=Kt(Zt().mark((function e(){var t,n;return Zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("/api/response/unlock/"+a+"/"+l,{method:"POST"});case 2:return t=e.sent,e.next=5,t.json();case 5:if(n=e.sent,t.ok){e.next=9;break}return pO("Failed releasing lock: "+n.message),e.abrupt("return");case 9:o.mode=n.mode,o.lockedBy=n.locked_by,o.status=n.status;case 12:case"end":return e.stop()}}),e)}))),function(){return g.apply(this,arguments)}),validatePage:function(){x(o.validatePage.bind(o))&&pO("Page validation successful!")}};return e.createElement(Qn,{className:"survey-container"},e.createElement(cO,null),e.createElement(TO,{message:"Are you sure you want to leave this page? Information you've entered may not be saved.",when:function(){return"edit"==o.mode&&!!l},onPageExit:m}),e.createElement(OO,{surveyModel:o,surveyActions:E,year:a,nren:l},e.createElement(EO,{surveyModel:o})))},AO=function(...e){return e.filter((e=>null!=e)).reduce(((e,t)=>{if("function"!=typeof t)throw new Error("Invalid Argument Type, must only provide functions, undefined, or null.");return null===e?t:function(...n){e.apply(this,n),t.apply(this,n)}}),null)},NO={height:["marginTop","marginBottom"],width:["marginLeft","marginRight"]};function DO(e,t){const n=t[`offset${e[0].toUpperCase()}${e.slice(1)}`],r=NO[e];return n+parseInt(bo(t,r[0]),10)+parseInt(bo(t,r[1]),10)}const LO={[li]:"collapse",[pi]:"collapsing",[ui]:"collapsing",[ci]:"collapse show"},MO=e.forwardRef((({onEnter:t,onEntering:n,onEntered:r,onExit:o,onExiting:i,className:s,children:a,dimension:l="height",in:u=!1,timeout:c=300,mountOnEnter:p=!1,unmountOnExit:h=!1,appear:d=!1,getDimensionValue:f=DO,...m},g)=>{const y="function"==typeof l?l():l,v=(0,e.useMemo)((()=>AO((e=>{e.style[y]="0"}),t)),[y,t]),b=(0,e.useMemo)((()=>AO((e=>{const t=`scroll${y[0].toUpperCase()}${y.slice(1)}`;e.style[y]=`${e[t]}px`}),n)),[y,n]),C=(0,e.useMemo)((()=>AO((e=>{e.style[y]=null}),r)),[y,r]),w=(0,e.useMemo)((()=>AO((e=>{e.style[y]=`${f(y,e)}px`,yi(e)}),o)),[o,f,y]),x=(0,e.useMemo)((()=>AO((e=>{e.style[y]=null}),i)),[y,i]);return(0,Mn.jsx)(bi,{ref:g,addEndListener:gi,...m,"aria-expanded":m.role?u:null,onEnter:v,onEntering:b,onEntered:C,onExit:w,onExiting:x,childRef:qo(a),in:u,timeout:c,mountOnEnter:p,unmountOnExit:h,appear:d,children:(t,n)=>e.cloneElement(a,{...n,className:Ln()(s,a.props.className,LO[t],"width"===y&&"collapse-horizontal")})})}));function jO(e,t){return Array.isArray(e)?e.includes(t):e===t}const FO=e.createContext({});FO.displayName="AccordionContext";const qO=FO,BO=e.forwardRef((({as:t="div",bsPrefix:n,className:r,children:o,eventKey:i,...s},a)=>{const{activeEventKey:l}=(0,e.useContext)(qO);return n=Bn(n,"accordion-collapse"),(0,Mn.jsx)(MO,{ref:a,in:jO(l,i),...s,className:Ln()(r,n),children:(0,Mn.jsx)(t,{children:e.Children.only(o)})})}));BO.displayName="AccordionCollapse";const HO=BO,zO=e.createContext({eventKey:""});zO.displayName="AccordionItemContext";const UO=zO,WO=e.forwardRef((({as:t="div",bsPrefix:n,className:r,onEnter:o,onEntering:i,onEntered:s,onExit:a,onExiting:l,onExited:u,...c},p)=>{n=Bn(n,"accordion-body");const{eventKey:h}=(0,e.useContext)(UO);return(0,Mn.jsx)(HO,{eventKey:h,onEnter:o,onEntering:i,onEntered:s,onExit:a,onExiting:l,onExited:u,children:(0,Mn.jsx)(t,{ref:p,...c,className:Ln()(r,n)})})}));WO.displayName="AccordionBody";const QO=WO,$O=e.forwardRef((({as:t="button",bsPrefix:n,className:r,onClick:o,...i},s)=>{n=Bn(n,"accordion-button");const{eventKey:a}=(0,e.useContext)(UO),l=function(t,n){const{activeEventKey:r,onSelect:o,alwaysOpen:i}=(0,e.useContext)(qO);return e=>{let s=t===r?null:t;i&&(s=Array.isArray(r)?r.includes(t)?r.filter((e=>e!==t)):[...r,t]:[t]),null==o||o(s,e),null==n||n(e)}}(a,o),{activeEventKey:u}=(0,e.useContext)(qO);return"button"===t&&(i.type="button"),(0,Mn.jsx)(t,{ref:s,onClick:l,...i,"aria-expanded":Array.isArray(u)?u.includes(a):a===u,className:Ln()(r,n,!jO(u,a)&&"collapsed")})}));$O.displayName="AccordionButton";const GO=$O,YO=e.forwardRef((({as:e="h2","aria-controls":t,bsPrefix:n,className:r,children:o,onClick:i,...s},a)=>(n=Bn(n,"accordion-header"),(0,Mn.jsx)(e,{ref:a,...s,className:Ln()(r,n),children:(0,Mn.jsx)(GO,{onClick:i,"aria-controls":t,children:o})}))));YO.displayName="AccordionHeader";const KO=YO,JO=e.forwardRef((({as:t="div",bsPrefix:n,className:r,eventKey:o,...i},s)=>{n=Bn(n,"accordion-item");const a=(0,e.useMemo)((()=>({eventKey:o})),[o]);return(0,Mn.jsx)(UO.Provider,{value:a,children:(0,Mn.jsx)(t,{ref:s,...i,className:Ln()(r,n)})})}));JO.displayName="AccordionItem";const ZO=JO,XO=e.forwardRef(((t,n)=>{const{as:r="div",activeKey:o,bsPrefix:i,className:s,onSelect:a,flush:l,alwaysOpen:u,...c}=TE(t,{activeKey:"onSelect"}),p=Bn(i,"accordion"),h=(0,e.useMemo)((()=>({activeEventKey:o,onSelect:a,alwaysOpen:u})),[o,a,u]);return(0,Mn.jsx)(qO.Provider,{value:h,children:(0,Mn.jsx)(r,{ref:n,...c,className:Ln()(s,p,l&&`${p}-flush`)})})}));XO.displayName="Accordion";const eT=Object.assign(XO,{Button:GO,Collapse:HO,Item:ZO,Header:KO,Body:QO}),tT=e.forwardRef((({bsPrefix:e,variant:t,animation:n="border",size:r,as:o="div",className:i,...s},a)=>{const l=`${e=Bn(e,"spinner")}-${n}`;return(0,Mn.jsx)(o,{ref:a,...s,className:Ln()(i,l,r&&`${l}-${r}`,t&&`text-${t}`)})}));tT.displayName="Spinner";const nT=tT;function rT(e){return jr({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M362.6 192.9L345 174.8c-.7-.8-1.8-1.2-2.8-1.2-1.1 0-2.1.4-2.8 1.2l-122 122.9-44.4-44.4c-.8-.8-1.8-1.2-2.8-1.2-1 0-2 .4-2.8 1.2l-17.8 17.8c-1.6 1.6-1.6 4.1 0 5.7l56 56c3.6 3.6 8 5.7 11.7 5.7 5.3 0 9.9-3.9 11.6-5.5h.1l133.7-134.4c1.4-1.7 1.4-4.2-.1-5.7z"},child:[]},{tag:"path",attr:{d:"M256 76c48.1 0 93.3 18.7 127.3 52.7S436 207.9 436 256s-18.7 93.3-52.7 127.3S304.1 436 256 436c-48.1 0-93.3-18.7-127.3-52.7S76 304.1 76 256s18.7-93.3 52.7-127.3S207.9 76 256 76m0-28C141.1 48 48 141.1 48 256s93.1 208 208 208 208-93.1 208-208S370.9 48 256 48z"},child:[]}]})(e)}function oT(e){return jr({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 48C141.1 48 48 141.1 48 256s93.1 208 208 208 208-93.1 208-208S370.9 48 256 48zm106.5 150.5L228.8 332.8h-.1c-1.7 1.7-6.3 5.5-11.6 5.5-3.8 0-8.1-2.1-11.7-5.7l-56-56c-1.6-1.6-1.6-4.1 0-5.7l17.8-17.8c.8-.8 1.8-1.2 2.8-1.2 1 0 2 .4 2.8 1.2l44.4 44.4 122-122.9c.8-.8 1.8-1.2 2.8-1.2 1.1 0 2.1.4 2.8 1.2l17.5 18.1c1.8 1.7 1.8 4.2.2 5.8z"},child:[]}]})(e)}function iT(e){return jr({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M331.3 308.7L278.6 256l52.7-52.7c6.2-6.2 6.2-16.4 0-22.6-6.2-6.2-16.4-6.2-22.6 0L256 233.4l-52.7-52.7c-6.2-6.2-15.6-7.1-22.6 0-7.1 7.1-6 16.6 0 22.6l52.7 52.7-52.7 52.7c-6.7 6.7-6.4 16.3 0 22.6 6.4 6.4 16.4 6.2 22.6 0l52.7-52.7 52.7 52.7c6.2 6.2 16.4 6.2 22.6 0 6.3-6.2 6.3-16.4 0-22.6z"},child:[]},{tag:"path",attr:{d:"M256 76c48.1 0 93.3 18.7 127.3 52.7S436 207.9 436 256s-18.7 93.3-52.7 127.3S304.1 436 256 436c-48.1 0-93.3-18.7-127.3-52.7S76 304.1 76 256s18.7-93.3 52.7-127.3S207.9 76 256 76m0-28C141.1 48 48 141.1 48 256s93.1 208 208 208 208-93.1 208-208S370.9 48 256 48z"},child:[]}]})(e)}function sT(e){return jr({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 48C141.1 48 48 141.1 48 256s93.1 208 208 208 208-93.1 208-208S370.9 48 256 48zm52.7 283.3L256 278.6l-52.7 52.7c-6.2 6.2-16.4 6.2-22.6 0-3.1-3.1-4.7-7.2-4.7-11.3 0-4.1 1.6-8.2 4.7-11.3l52.7-52.7-52.7-52.7c-3.1-3.1-4.7-7.2-4.7-11.3 0-4.1 1.6-8.2 4.7-11.3 6.2-6.2 16.4-6.2 22.6 0l52.7 52.7 52.7-52.7c6.2-6.2 16.4-6.2 22.6 0 6.2 6.2 6.2 16.4 0 22.6L278.6 256l52.7 52.7c6.2 6.2 6.2 16.4 0 22.6-6.2 6.3-16.4 6.3-22.6 0z"},child:[]}]})(e)}const aT=function(t){var n=t.status;return{completed:e.createElement(oT,{title:n,size:24,color:"green"}),started:e.createElement(rT,{title:n,size:24,color:"rgb(217, 117, 10)"}),"did not respond":e.createElement(sT,{title:n,size:24,color:"red"}),"not started":e.createElement(iT,{title:n,size:24})}[n]||n};var lT=n(543);function uT(t){var n=t.text,r=t.helpText,o=t.onClick,i=t.enabled,s=Qt((0,e.useState)(!1),2),a=s[0],l=s[1],u=function(){var e=Kt(Zt().mark((function e(){return Zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!a){e.next=2;break}return e.abrupt("return");case 2:return l(!0),e.prev=3,e.next=6,o();case 6:return e.prev=6,l(!1),e.finish(6);case 9:case"end":return e.stop()}}),e,null,[[3,,6,9]])})));return function(){return e.apply(this,arguments)}}();return e.createElement(Rs,{onClick:u,disabled:!i,style:{pointerEvents:"auto",marginLeft:".5rem"},title:r},a&&e.createElement(nT,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"}),n)}const cT=function(){var t=Qt((0,e.useState)([]),2),n=t[0],r=t[1],o=(0,e.useRef)(!1);function i(e,t,n){return s.apply(this,arguments)}function s(){return s=Kt(Zt().mark((function e(t,n,o){var i,s,a,l=arguments;return Zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=l.length>3&&void 0!==l[3]&&l[3],e.prev=1,i&&(t+="?dry_run=1"),e.next=5,fetch(t,{method:"POST"});case 5:return s=e.sent,e.next=8,s.json();case 8:a=e.sent,s.ok?(a.message&&console.log(a.message),i||pO(o),l_().then((function(e){r(e)}))):pO(n+a.message),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(1),pO(n+e.t0.message);case 15:case"end":return e.stop()}}),e,null,[[1,12]])}))),s.apply(this,arguments)}function a(){return(a=Kt(Zt().mark((function e(){return Zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i("/api/survey/new","Failed creating new survey: ","Created new survey");case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function l(e,t){return u.apply(this,arguments)}function u(){return u=Kt(Zt().mark((function e(t,n){var r,s=arguments;return Zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=s.length>2&&void 0!==s[2]&&s[2],!o.current){e.next=4;break}return pO("Wait for status update to be finished..."),e.abrupt("return");case 4:return o.current=!0,e.next=7,i("/api/survey/"+n+"/"+t,"Error while updating "+t+" survey status to "+n+": ",t+" survey status updated to "+n,r);case 7:o.current=!1;case 8:case"end":return e.stop()}}),e)}))),u.apply(this,arguments)}function c(){return(c=Kt(Zt().mark((function e(t,n){return Zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i("/api/response/unlock/"+t+"/"+n,"Error while unlocking "+n+" "+t+" survey response: ",n+" "+t+" survey response unlocked");case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}(0,e.useEffect)((function(){l_().then((function(e){r(e)}))}),[]);var p=n.length>0&&n.every((function(e){return e.status==mO.published})),h=window.location.origin+"/data?preview";return e.createElement(e.Fragment,null,e.createElement(h_,null),e.createElement(Qn,{className:"py-5 grey-container"},e.createElement(Qn,{style:{maxWidth:"100rem"}},e.createElement(Gn,null,e.createElement(cO,null),e.createElement(Rs,{onClick:function(){return a.apply(this,arguments)},disabled:!p,style:{pointerEvents:"auto",width:"10rem",margin:"1rem"},title:"Create a new survey for the next year. Only possible if all current surveys are published."},"start new survey"),e.createElement(eT,{defaultActiveKey:"0"},n.map((function(t,n){return e.createElement(eT.Item,{eventKey:n.toString(),key:t.year},e.createElement(eT.Header,null,t.year," - ",t.status),e.createElement(eT.Body,null,e.createElement("div",{style:{marginLeft:".5rem",marginBottom:"1rem"}},e.createElement(Lt,{to:"/survey/admin/edit/".concat(t.year),target:"_blank"},e.createElement(Rs,{style:{marginLeft:".5rem"},title:"Open the survey for inspection with all questions visible and any visibleIf logic added to the title."},"Inspect Survey")),e.createElement(Lt,{to:"/survey/admin/try/".concat(t.year),target:"_blank"},e.createElement(Rs,{style:{marginLeft:".5rem"},title:"Open the survey exactly as the nrens will see it, but without any nren data."},"Try Survey")),e.createElement(uT,{text:"Mark as open",helpText:"Allow the NRENs to respond to this survey. Only 1 survey may be open at a time, and (pre)-published surveys cannot be opened anymore.",enabled:t.status==mO.closed,onClick:function(){return l(t.year,"open")}}),e.createElement(uT,{text:"Mark as closed",helpText:"Do not allow the NRENs to respond to this survey anymore. Only surveys with status open can be closed.",enabled:t.status==mO.open,onClick:function(){return l(t.year,"close")}}),e.createElement(uT,{text:"Preview results",helpText:"Publish all completed survey responses to the compendium website for preview by admins. This is only possible if the survey is closed or previewed already.",enabled:t.status==mO.closed||t.status==mO.preview,onClick:function(){return l(t.year,"preview")}}),e.createElement(uT,{text:"Publish results (dry run)",helpText:"Performs a dry-run of the publish operation, without actually publishing the results. Changes are logged in the browser console (F12).",enabled:t.status==mO.preview||t.status==mO.published,onClick:function(){return l(t.year,"publish",!0)}}),e.createElement(uT,{text:"Publish results",helpText:"Publish or re-publish all completed survey responses to the compendium website. This is only possible if the survey is in preview or published already.",enabled:t.status==mO.preview||t.status==mO.published,onClick:function(){return l(t.year,"publish")}}),t.status==mO.preview&&e.createElement("span",null,"  Preview link: ",e.createElement("a",{href:h},h))),e.createElement(cP,null,e.createElement("colgroup",null,e.createElement("col",{style:{width:"10%"}}),e.createElement("col",{style:{width:"20%"}}),e.createElement("col",{style:{width:"20%"}}),e.createElement("col",{style:{width:"30%"}}),e.createElement("col",{style:{width:"20%"}})),e.createElement("thead",null,e.createElement("tr",null,e.createElement("th",null,"NREN"),e.createElement("th",null,"Status"),e.createElement("th",null,"Lock"),e.createElement("th",null,"Management Notes"),e.createElement("th",null,"Actions"))),e.createElement("tbody",null,t.responses.map((function(n){return e.createElement("tr",{key:n.nren.id},e.createElement("td",null,n.nren.name),e.createElement("td",null,e.createElement(aT,{status:n.status})),e.createElement("td",{style:{textWrap:"wrap",wordWrap:"break-word",maxWidth:"10rem"}},n.lock_description),e.createElement("td",null,"notes"in n&&e.createElement("textarea",{onInput:(0,lT.debounce)((function(e){return r=t.year,o=n.nren.id,i=e.target.value,void fetch("/api/survey/"+r+"/"+o+"/notes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({notes:i||""})}).then(function(){var e=Kt(Zt().mark((function e(t){var n;return Zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.json();case 2:n=e.sent,t.ok?pO.success("Notes saved"):pO.error("Failed saving notes: "+n.message||0);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){pO.error("Failed saving notes: "+e)}));var r,o,i}),1e3),style:{minWidth:"100%",minHeight:"5rem"},placeholder:"Notes for this survey",defaultValue:n.notes||""})),e.createElement("td",null,e.createElement(Lt,{to:"/survey/response/".concat(t.year,"/").concat(n.nren.name),target:"_blank"},e.createElement(Rs,{style:{pointerEvents:"auto",margin:".5rem"},title:"Open the responses of the NREN."},"open")),e.createElement(Rs,{onClick:function(){return function(e,t){return c.apply(this,arguments)}(t.year,n.nren.name)},disabled:""==n.lock_description,style:{pointerEvents:"auto"},title:"Remove the lock from the survey so that another person can open the survey for editing. WARNING: The person that currently has the lock will not be able to save their changes anymore once someone else starts editing!"},"remove lock")))}))))))})))))))},pT=e.forwardRef((({className:e,bsPrefix:t,as:n="span",...r},o)=>(t=Bn(t,"input-group-text"),(0,Mn.jsx)(n,{ref:o,className:Ln()(e,t),...r}))));pT.displayName="InputGroupText";const hT=pT,dT=e.forwardRef((({bsPrefix:t,size:n,hasValidation:r,className:o,as:i="div",...s},a)=>{t=Bn(t,"input-group");const l=(0,e.useMemo)((()=>({})),[]);return(0,Mn.jsx)(WE.Provider,{value:l,children:(0,Mn.jsx)(i,{ref:a,...s,className:Ln()(o,t,n&&`${t}-${n}`,r&&"has-validation")})})}));dT.displayName="InputGroup";const fT=Object.assign(dT,{Text:hT,Radio:e=>(0,Mn.jsx)(hT,{children:(0,Mn.jsx)(Ji,{type:"radio",...e})}),Checkbox:e=>(0,Mn.jsx)(hT,{children:(0,Mn.jsx)(Ji,{type:"checkbox",...e})})});function mT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function gT(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?mT(Object(n),!0).forEach((function(t){vn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mT(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function yT(){return(yT=Kt(Zt().mark((function e(){var t;return Zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch("/api/user/list");case 3:return t=e.sent,e.next=6,t.json();case 6:return e.abrupt("return",e.sent);case 9:return e.prev=9,e.t0=e.catch(0),e.abrupt("return",[]);case 12:case"end":return e.stop()}}),e,null,[[0,9]])})))).apply(this,arguments)}function vT(){return(vT=Kt(Zt().mark((function e(){var t;return Zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch("/api/nren/list");case 3:return t=e.sent,e.next=6,t.json();case 6:return e.abrupt("return",e.sent);case 9:return e.prev=9,e.t0=e.catch(0),e.abrupt("return",[]);case 12:case"end":return e.stop()}}),e,null,[[0,9]])})))).apply(this,arguments)}function bT(){return(bT=Kt(Zt().mark((function e(t,n){var r,o,i,s;return Zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=gT({id:t},n),o={method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)},e.next=4,fetch("/api/user/".concat(t),o);case 4:return i=e.sent,e.next=7,i.json();case 7:if(s=e.sent,i.ok){e.next=10;break}throw new Error(s.message);case 10:return pO.success(s.message),e.abrupt("return",s.user);case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function CT(e){return wT.apply(this,arguments)}function wT(){return(wT=Kt(Zt().mark((function e(t){var n,r,o;return Zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(window.confirm("Are you sure you want to delete ".concat(t.name," (").concat(t.email,")?"))){e.next=3;break}return e.abrupt("return",!1);case 3:return n={method:"DELETE",headers:{"Content-Type":"application/json"}},e.next=6,fetch("/api/user/".concat(t.id),n);case 6:return r=e.sent,e.next=9,r.json();case 9:if(o=e.sent,r.ok){e.next=12;break}throw new Error(o.message);case 12:return pO.success(o.message),e.abrupt("return",!0);case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var xT=function(e,t){return"admin"!==e.role&&"admin"===t.role?1:"admin"===e.role&&"admin"!==t.role?-1:"user"===e.role&&"user"!==t.role?1:"user"===t.role&&"user"!==e.role?-1:!e.permissions.active&&t.permissions.active?1:e.permissions.active&&!t.permissions.active?-1:e.name.localeCompare(t.name)};const ET=function(){var t,n=Qt((0,e.useState)([]),2),r=n[0],o=n[1],i=Qt((0,e.useState)([]),2),s=i[0],a=i[1],l=(0,e.useContext)(tn),u=l.user,c=l.setUser,p=Qt((0,e.useState)({column:"ID",asc:!0}),2),h=p[0],d=p[1],f=Qt((0,e.useState)(""),2),m=f[0],g=f[1],y=function(t){var n=(0,e.useContext)(Rn),r=n.getConfig,o=n.setConfig,i=r(t);return vn(vn({},t,i),"setConfig",(function(e,n){return o(t,e,n)}))}("user_management"),v=y.setConfig,b=y.user_management,C=function(e){if(!b)return!0;var t=b.shownColumns;if(!t)return!0;var n=t[e];return null==n||n};(0,e.useEffect)((function(){(function(){return yT.apply(this,arguments)})().then((function(e){o(e)})),function(){return vT.apply(this,arguments)}().then((function(e){a(e.sort((function(e,t){return e.name.localeCompare(t.name)})))}))}),[]);var w=function(e,t){var n=r.findIndex((function(e){return e.id===t.id})),i=fn(r),s=e.target.name,a={};a[s]="active"===s?e.target.checked:e.target.value,function(e,t){return bT.apply(this,arguments)}(t.id,a).then((function(e){e.id===u.id?c(e):(i[n]=e,o(i))})).catch((function(e){pO.error(e.message)}))},x=function(e){return function(t,n){var r=t[e],o=n[e];if("nrens"===e)return 0===t.nrens.length&&0===n.nrens.length?xT(t,n):0===t.nrens.length?-1:0===n.nrens.length?1:t.nrens[0].localeCompare(n.nrens[0]);if("string"!=typeof r||"string"!=typeof o)return xT(t,n);var i=r.localeCompare(o);return 0===i?xT(t,n):i}},E=["ID","Active","Role","Email","Full Name","OIDC Sub","NREN","Actions"],P=vn(vn(vn(vn(vn({},E[1],(function(e,t){return e.permissions.active&&!t.permissions.active?1:!e.permissions.active&&t.permissions.active?-1:xT(e,t)})),E[2],x("role")),E[3],x("email")),E[4],x("name")),E[6],x("nrens")),S={};Array.from(Object.keys(P)).includes(h.column)?S[h.column]={"aria-sort":h.asc?"ascending":"descending"}:S[E[0]]={"aria-sort":h.asc?"ascending":"descending"};var _=null!==(t=P[h.column])&&void 0!==t?t:xT,O=m?r.filter((function(e){return e.email.includes(m)||e.name.includes(m)})):r,T=O.filter((function(e){return e.id!==u.id})).sort(_);return h.asc||T.reverse(),e.createElement(e.Fragment,null,e.createElement(h_,null),e.createElement(cO,null),e.createElement(Qn,{className:"py-5 grey-container"},e.createElement(Gn,{className:"d-flex justify-content-center align-items-center flex-column"},e.createElement("div",{className:"text-center w-100 mb-3"},e.createElement("h3",null,"User Management Page")),e.createElement(eT,{className:"mb-3",style:{width:"30rem"}},e.createElement(eT.Item,{eventKey:"0"},e.createElement(eT.Header,null,e.createElement("span",{className:"me-2"},"Column Visibility"),e.createElement("small",{className:"text-muted"},"Choose which columns to display")),e.createElement(eT.Body,null,e.createElement(Ps.Control,{as:"div",className:"p-3"},e.createElement("small",{className:"text-muted mb-2 d-block"},"Select which columns you want to display in the table below. Unchecked columns will be hidden."),e.createElement("div",{className:"d-grid",style:{gridTemplateColumns:"repeat(auto-fill, minmax(150px, 1fr))",gap:"10px"}},E.map((function(t){return e.createElement(Ps.Check,{key:t,type:"checkbox",id:"column-".concat(t),label:t,checked:C(t),onChange:function(e){return function(e,t){var n=null!=b?b:{},r=null==n?void 0:n.shownColumns;v(gT(gT({},n),{},r?{shownColumns:gT(gT({},r),{},vn({},e,t))}:{shownColumns:vn({},e,t)}))}(t,e.target.checked)}})}))))))),e.createElement(fT,{className:"mb-3",style:{width:"30rem"}},e.createElement(fT.Text,{id:"search-text"},"Search"),e.createElement(Ps.Control,{placeholder:"Search by email/name","aria-label":"Search",onInput:(0,lT.debounce)((function(e){return g(e.target.value)}),200)}),e.createElement(Rs,{variant:"outline-secondary",onClick:function(){g("")}},"Clear"))),e.createElement("div",{className:"d-flex justify-content-center"},e.createElement("div",{style:{maxWidth:"100rem"}},e.createElement(cP,{className:"user-management-table",bordered:!0},e.createElement("colgroup",null,C(E[0])&&e.createElement("col",{span:1,style:{width:"8rem"}}),C(E[1])&&e.createElement("col",{span:1,style:{width:"3rem"}}),C(E[2])&&e.createElement("col",{span:1,style:{width:"4.5rem"}}),C(E[3])&&e.createElement("col",{span:1,style:{width:"7rem"}}),C(E[4])&&e.createElement("col",{span:1,style:{width:"5rem"}}),C(E[5])&&e.createElement("col",{span:1,style:{width:"5rem"}}),C(E[6])&&e.createElement("col",{span:1,style:{width:"6rem"}}),C(E[7])&&e.createElement("col",{span:1,style:{width:"3rem"}})),e.createElement("thead",null,e.createElement("tr",null,E.map((function(t){return C(t)&&e.createElement("th",SE({key:t},S[t],{onClick:function(){return function(e){e===h.column?d({column:e,asc:!h.asc}):d({column:e,asc:!0})}(t)},className:"sortable fixed-column",style:{border:"1px solid #ddd"}}),t)})))),e.createElement("tbody",null,(m?[]:[u]).concat(T).map((function(t){return e.createElement("tr",{key:t.id,style:{fontWeight:t.id==u.id?"bold":"normal"}},C(E[0])&&e.createElement("td",{style:{border:"1px dotted #ddd"}},t.id),C(E[1])&&e.createElement("td",{style:{border:"1px dotted #ddd"}},t.id==u.id?e.createElement(DC,null):e.createElement("input",{type:"checkbox",name:"active",checked:t.permissions.active,onChange:function(e){return w(e,t)}})),C(E[2])&&e.createElement("td",{style:{border:"1px dotted #ddd"}},t.id==u.id?t.role.charAt(0).toUpperCase()+t.role.slice(1):e.createElement("select",{name:"role",defaultValue:t.role,onChange:function(e){return w(e,t)},style:{width:"100%"}},e.createElement("option",{value:"admin"},"Admin"),e.createElement("option",{value:"user"},"User"),e.createElement("option",{value:"observer"},"Observer"))),C(E[3])&&e.createElement("td",{style:{border:"1px dotted #ddd"}},t.email),C(E[4])&&e.createElement("td",{style:{border:"1px dotted #ddd"}},t.name),C(E[5])&&e.createElement("td",{style:{border:"1px dotted #ddd"}},t.oidc_sub),C(E[6])&&e.createElement("td",{style:{border:"1px dotted #ddd"}},e.createElement("select",{name:"nren",multiple:!1,value:t.nrens.length>0?(n=t.nrens[0],null===(i=s.find((function(e){return e.id==n||e.name==n})))||void 0===i?void 0:i.id):"",onChange:function(e){return w(e,t)}},e.createElement("option",{value:""},"Select NREN"),s.map((function(t){return e.createElement("option",{key:t.id,value:t.id},t.name)})))),C(E[7])&&e.createElement("td",{style:{border:"1px dotted #ddd"}},t.id!==u.id&&e.createElement(Rs,{variant:"danger",onClick:Kt(Zt().mark((function e(){return Zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.id!==u.id){e.next=3;break}return pO.error("You cannot delete yourself"),e.abrupt("return");case 3:return e.next=5,CT(t);case 5:e.sent&&o(r.filter((function(e){return e.id!==t.id})));case 7:case"end":return e.stop()}}),e)})))},"Delete")));var n,i}))))))))};var PT,ST=function(){var t="/"!==ze().pathname;return e.createElement(e.Fragment,null,e.createElement(kn,null,e.createElement(Zn,null),e.createElement("main",{className:"grow"},t?e.createElement(ht,null):e.createElement(Rr,null)),e.createElement(Is,null)),e.createElement(tr,null))},_T=(PT=[{path:"",element:e.createElement(ST,null),children:[{path:"/budget",element:e.createElement(lP,null)},{path:"/funding",element:e.createElement(KP,null)},{path:"/employment",element:e.createElement(rS,{key:"staffgraph"})},{path:"/traffic-ratio",element:e.createElement(e_,null)},{path:"/roles",element:e.createElement(rS,{roles:!0,key:"staffgraphroles"})},{path:"/employee-count",element:e.createElement(oS,null)},{path:"/charging",element:e.createElement(dP,null)},{path:"/suborganisations",element:e.createElement(sS,null)},{path:"/parentorganisation",element:e.createElement(JP,null)},{path:"/ec-projects",element:e.createElement(mP,null)},{path:"/policy",element:e.createElement(gS,null)},{path:"/traffic-volume",element:e.createElement(n_,null)},{path:"/data",element:e.createElement(to,null)},{path:"/institutions-urls",element:e.createElement(SS,null)},{path:"/connected-proportion",element:e.createElement(VS,{page:An.ConnectedProportion,key:An.ConnectedProportion})},{path:"/connectivity-level",element:e.createElement(VS,{page:An.ConnectivityLevel,key:An.ConnectivityLevel})},{path:"/connectivity-growth",element:e.createElement(VS,{page:An.ConnectivityGrowth,key:An.ConnectivityGrowth})},{path:"/connection-carrier",element:e.createElement(VS,{page:An.ConnectionCarrier,key:An.ConnectionCarrier})},{path:"/connectivity-load",element:e.createElement(VS,{page:An.ConnectivityLoad,key:An.ConnectivityLoad})},{path:"/commercial-charging-level",element:e.createElement(VS,{page:An.CommercialChargingLevel,key:An.CommercialChargingLevel})},{path:"/commercial-connectivity",element:e.createElement(VS,{page:An.CommercialConnectivity,key:An.CommercialConnectivity})},{path:"/network-services",element:e.createElement(a_,{category:Nn.network_services,key:Nn.network_services})},{path:"/isp-support-services",element:e.createElement(a_,{category:Nn.isp_support,key:Nn.isp_support})},{path:"/security-services",element:e.createElement(a_,{category:Nn.security,key:Nn.security})},{path:"/identity-services",element:e.createElement(a_,{category:Nn.identity,key:Nn.identity})},{path:"/collaboration-services",element:e.createElement(a_,{category:Nn.collaboration,key:Nn.collaboration})},{path:"/multimedia-services",element:e.createElement(a_,{category:Nn.multimedia,key:Nn.multimedia})},{path:"/storage-and-hosting-services",element:e.createElement(a_,{category:Nn.storage_and_hosting,key:Nn.storage_and_hosting})},{path:"/professional-services",element:e.createElement(a_,{category:Nn.professional_services,key:Nn.professional_services})},{path:"/dark-fibre-lease",element:e.createElement(FS,{national:!0,key:"darkfibrenational"})},{path:"/dark-fibre-lease-international",element:e.createElement(FS,{key:"darkfibreinternational"})},{path:"/dark-fibre-installed",element:e.createElement(qS,null)},{path:"/remote-campuses",element:e.createElement(kS,null)},{path:"/eosc-listings",element:e.createElement(mS,null)},{path:"/fibre-light",element:e.createElement(zS,null)},{path:"/monitoring-tools",element:e.createElement(WS,null)},{path:"/pert-team",element:e.createElement(JS,null)},{path:"/passive-monitoring",element:e.createElement(KS,null)},{path:"/alien-wave",element:e.createElement(AS,null)},{path:"/alien-wave-internal",element:e.createElement(NS,null)},{path:"/external-connections",element:e.createElement(HS,null)},{path:"/ops-automation",element:e.createElement(YS,null)},{path:"/network-automation",element:e.createElement(DS,null)},{path:"/traffic-stats",element:e.createElement(t_,null)},{path:"/weather-map",element:e.createElement(r_,null)},{path:"/network-map",element:e.createElement($S,null)},{path:"/nfv",element:e.createElement(QS,null)},{path:"/certificate-providers",element:e.createElement(jS,null)},{path:"/siem-vendors",element:e.createElement(ZS,null)},{path:"/capacity-largest-link",element:e.createElement(MS,null)},{path:"/capacity-core-ip",element:e.createElement(LS,null)},{path:"/non-rne-peers",element:e.createElement(GS,null)},{path:"/iru-duration",element:e.createElement(US,null)},{path:"/audits",element:e.createElement(aS,null)},{path:"/business-continuity",element:e.createElement(lS,null)},{path:"/crisis-management",element:e.createElement(hS,null)},{path:"/crisis-exercise",element:e.createElement(pS,null)},{path:"/central-procurement",element:e.createElement(uS,null)},{path:"/security-control",element:e.createElement(yS,null)},{path:"/services-offered",element:e.createElement(xS,null)},{path:"/service-management-framework",element:e.createElement(bS,null)},{path:"/service-level-targets",element:e.createElement(vS,null)},{path:"/corporate-strategy",element:e.createElement(cS,null)},{path:"survey/admin/surveys",element:e.createElement(cT,null)},{path:"survey/admin/users",element:e.createElement(ET,null)},{path:"survey/admin/inspect/:year",element:e.createElement(kO,{loadFrom:"/api/response/inspect/"})},{path:"survey/admin/try/:year",element:e.createElement(kO,{loadFrom:"/api/response/try/"})},{path:"survey/response/:year/:nren",element:e.createElement(kO,{loadFrom:"/api/response/load/"})},{path:"survey/*",element:e.createElement(d_,null)},{path:"*",element:e.createElement(Rr,null)}]}],function(e){const t=e.window?e.window:"undefined"!=typeof window?window:void 0,n=void 0!==t&&void 0!==t.document&&void 0!==t.document.createElement;o(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r,s,l,u=e.mapRouteProperties||Y,f={},m=p(e.routes,u,void 0,f),g=e.basename||"/",y=e.dataStrategy||ae,v=e.patchRoutesOnNavigation,b={...e.future},C=null,w=new Set,x=null,E=null,P=null,S=null!=e.hydrationData,_=h(m,e.history.location,g),T=null;if(null==_&&!v){let t=be(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=ve(m);_=n,T={[r.id]:t}}if(_&&!e.hydrationData&&Ze(_,m,e.history.location.pathname).active&&(_=null),_)if(_.some((e=>e.route.lazy)))s=!1;else if(_.some((e=>e.route.loader))){let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null;if(n){let e=_.findIndex((e=>void 0!==n[e.route.id]));s=_.slice(0,e+1).every((e=>!ne(e.route,t,n)))}else s=_.every((e=>!ne(e.route,t,n)))}else s=!0;else{s=!1,_=[];let t=Ze(null,m,e.history.location.pathname);t.active&&t.matches&&(_=t.matches)}let V,R,I={historyAction:e.history.action,location:e.history.location,matches:_,initialized:s,navigation:U,restoreScrollPosition:null==e.hydrationData&&null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||T,fetchers:new Map,blockers:new Map},k="POP",A=!1,N=!1,D=new Map,L=null,j=!1,F=!1,q=new Set,B=new Map,H=0,$=-1,J=new Map,ee=new Set,re=new Map,oe=new Map,se=new Set,he=new Map,de=null;function we(e,t={}){I={...I,...e};let n=[],r=[];I.fetchers.forEach(((e,t)=>{"idle"===e.state&&(se.has(t)?n.push(t):r.push(t))})),se.forEach((e=>{I.fetchers.has(e)||B.has(e)||n.push(e)})),[...w].forEach((e=>e(I,{deletedFetchers:n,viewTransitionOpts:t.viewTransitionOpts,flushSync:!0===t.flushSync}))),n.forEach((e=>Be(e))),r.forEach((e=>I.fetchers.delete(e)))}function Se(t,n,{flushSync:o}={}){let i,s=null!=I.actionData&&null!=I.navigation.formMethod&&Oe(I.navigation.formMethod)&&"loading"===I.navigation.state&&!0!==t.state?._isRedirect;i=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:s?I.actionData:null;let a=n.loaderData?me(I.loaderData,n.loaderData,n.matches||[],n.errors):I.loaderData,l=I.blockers;l.size>0&&(l=new Map(l),l.forEach(((e,t)=>l.set(t,Q))));let u,c=!0===A||null!=I.navigation.formMethod&&Oe(I.navigation.formMethod)&&!0!==t.state?._isRedirect;if(r&&(m=r,r=void 0),j||"POP"===k||("PUSH"===k?e.history.push(t,t.state):"REPLACE"===k&&e.history.replace(t,t.state)),"POP"===k){let e=D.get(I.location.pathname);e&&e.has(t.pathname)?u={currentLocation:I.location,nextLocation:t}:D.has(t.pathname)&&(u={currentLocation:t,nextLocation:I.location})}else if(N){let e=D.get(I.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),D.set(I.location.pathname,e)),u={currentLocation:I.location,nextLocation:t}}we({...n,actionData:i,loaderData:a,historyAction:k,location:t,initialized:!0,navigation:U,revalidation:"idle",restoreScrollPosition:Je(t,n.matches||I.matches),preventScrollReset:c,blockers:l},{viewTransitionOpts:u,flushSync:!0===o}),k="POP",A=!1,N=!1,j=!1,F=!1,de?.resolve(),de=null}async function _e(t,n,o){V&&V.abort(),V=null,k=t,j=!0===(o&&o.startUninterruptedRevalidation),function(e,t){if(x&&P){let n=Ke(e,t);x[n]=P()}}(I.location,I.matches),A=!0===(o&&o.preventScrollReset),N=!0===(o&&o.enableViewTransition);let i=r||m,s=o&&o.overrideNavigation,a=h(i,n,g),l=!0===(o&&o.flushSync),u=Ze(a,i,n.pathname);if(u.active&&u.matches&&(a=u.matches),!a){let{error:e,notFoundMatches:t,route:r}=Ye(n.pathname);return void Se(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:l})}if(I.initialized&&!F&&function(e,t){return e.pathname===t.pathname&&e.search===t.search&&(""===e.hash?""!==t.hash:e.hash===t.hash||""!==t.hash)}(I.location,n)&&!(o&&o.submission&&Oe(o.submission.formMethod)))return void Se(n,{matches:a},{flushSync:l});V=new AbortController;let c,p=pe(e.history,n,V.signal,o&&o.submission);if(o&&o.pendingError)c=[ye(a).route.id,{type:"error",error:o.pendingError}];else if(o&&o.submission&&Oe(o.submission.formMethod)){let t=await async function(e,t,n,r,o,i={}){Me();let s,a=function(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}(t,n);if(we({navigation:a},{flushSync:!0===i.flushSync}),o){let n=await Xe(r,t.pathname,e.signal);if("aborted"===n.type)return{shortCircuited:!0};if("error"===n.type){let e=ye(n.partialMatches).route.id;return{matches:n.partialMatches,pendingActionResult:[e,{type:"error",error:n.error}]}}if(!n.matches){let{notFoundMatches:e,error:n,route:r}=Ye(t.pathname);return{matches:e,pendingActionResult:[r.id,{type:"error",error:n}]}}r=n.matches}let l=Ve(r,t);if(l.route.action||l.route.lazy){if(s=(await De("action",I,e,[l],r,null))[l.route.id],e.signal.aborted)return{shortCircuited:!0}}else s={type:"error",error:be(405,{method:e.method,pathname:t.pathname,routeId:l.route.id})};if(Pe(s)){let t;return t=i&&null!=i.replace?i.replace:ce(s.response.headers.get("Location"),new URL(e.url),g)===I.location.pathname+I.location.search,await Ne(e,s,!0,{submission:n,replace:t}),{shortCircuited:!0}}if(Ee(s)){let e=ye(r,l.route.id);return!0!==(i&&i.replace)&&(k="PUSH"),{matches:r,pendingActionResult:[e.route.id,s]}}return{matches:r,pendingActionResult:[l.route.id,s]}}(p,n,o.submission,a,u.active,{replace:o.replace,flushSync:l});if(t.shortCircuited)return;if(t.pendingActionResult){let[e,r]=t.pendingActionResult;if(Ee(r)&&M(r.error)&&404===r.error.status)return V=null,void Se(n,{matches:t.matches,loaderData:{},errors:{[e]:r.error}})}a=t.matches||a,c=t.pendingActionResult,s=Ie(n,o.submission),l=!1,u.active=!1,p=pe(e.history,p.url,p.signal)}let{shortCircuited:d,matches:f,loaderData:y,errors:v}=await async function(t,n,o,i,s,a,l,u,c,p,h){let d=s||Ie(n,a),f=a||l||Re(d),y=!j&&!c;if(i){if(y){let e=Te(h);we({navigation:d,...void 0!==e?{actionData:e}:{}},{flushSync:p})}let e=await Xe(o,n.pathname,t.signal);if("aborted"===e.type)return{shortCircuited:!0};if("error"===e.type){let t=ye(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}if(!e.matches){let{error:e,notFoundMatches:t,route:r}=Ye(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}o=e.matches}let v=r||m,[b,C]=te(e.history,I,o,f,n,!0===c,F,q,se,re,ee,v,g,h);if($=++H,0===b.length&&0===C.length){let e=Ue();return Se(n,{matches:o,loaderData:{},errors:h&&Ee(h[1])?{[h[0]]:h[1].error}:null,...ge(h),...e?{fetchers:new Map(I.fetchers)}:{}},{flushSync:p}),{shortCircuited:!0}}if(y){let e={};if(!i){e.navigation=d;let t=Te(h);void 0!==t&&(e.actionData=t)}C.length>0&&(e.fetchers=function(e){return e.forEach((e=>{let t=I.fetchers.get(e.key),n=ke(void 0,t?t.data:void 0);I.fetchers.set(e.key,n)})),new Map(I.fetchers)}(C)),we(e,{flushSync:p})}C.forEach((e=>{He(e.key),e.controller&&B.set(e.key,e.controller)}));let w=()=>C.forEach((e=>He(e.key)));V&&V.signal.addEventListener("abort",w);let{loaderResults:x,fetcherResults:E}=await Le(I,o,b,C,t);if(t.signal.aborted)return{shortCircuited:!0};V&&V.signal.removeEventListener("abort",w),C.forEach((e=>B.delete(e.key)));let P=Ce(x);if(P)return await Ne(t,P.result,!0,{replace:u}),{shortCircuited:!0};if(P=Ce(E),P)return ee.add(P.key),await Ne(t,P.result,!0,{replace:u}),{shortCircuited:!0};let{loaderData:S,errors:_}=fe(I,o,x,h,C,E);c&&I.errors&&(_={...I.errors,..._});let O=Ue(),T=We($);return{matches:o,loaderData:S,errors:_,...O||T||C.length>0?{fetchers:new Map(I.fetchers)}:{}}}(p,n,a,u.active,s,o&&o.submission,o&&o.fetcherSubmission,o&&o.replace,o&&!0===o.initialHydration,l,c);d||(V=null,Se(n,{matches:f||a,...ge(c),loaderData:y,errors:v}))}function Te(e){return e&&!Ee(e[1])?{[e[0]]:e[1].data}:I.actionData?0===Object.keys(I.actionData).length?null:I.actionData:void 0}async function Ne(r,i,s,{submission:l,fetcherSubmission:u,preventScrollReset:c,replace:p}={}){i.response.headers.has("X-Remix-Revalidate")&&(F=!0);let h=i.response.headers.get("Location");o(h,"Expected a Location header on the redirect Response"),h=ce(h,new URL(r.url),g);let d=a(I.location,h,{_isRedirect:!0});if(n){let n=!1;if(i.response.headers.has("X-Remix-Reload-Document"))n=!0;else if(G.test(h)){const r=e.history.createURL(h);n=r.origin!==t.location.origin||null==O(r.pathname,g)}if(n)return void(p?t.location.replace(h):t.location.assign(h))}V=null;let f=!0===p||i.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:m,formAction:y,formEncType:v}=I.navigation;!l&&!u&&m&&y&&v&&(l=Re(I.navigation));let b=l||u;if(z.has(i.response.status)&&b&&Oe(b.formMethod))await _e(f,d,{submission:{...b,formAction:h},preventScrollReset:c||A,enableViewTransition:s?N:void 0});else{let e=Ie(d,l);await _e(f,d,{overrideNavigation:e,fetcherSubmission:u,preventScrollReset:c||A,enableViewTransition:s?N:void 0})}}async function De(e,t,n,r,s,a){let l,p={};try{l=await async function(e,t,n,r,s,a,l,u,p,h){let d=a.map((e=>e.route.lazy?async function(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let s=n[e.id];o(s,"No route found in manifest");let a={};for(let e in r){let t=void 0!==s[e]&&"hasErrorBoundary"!==e;i(!t,`Route "${s.id}" has a static property "${e}" defined but its lazy function is also returning a value for this property. The lazy route property "${e}" will be ignored.`),t||c.has(e)||(a[e]=r[e])}Object.assign(s,a),Object.assign(s,{...t(s),lazy:void 0})}(e.route,p,u):void 0)),f=a.map(((e,n)=>{let o=d[n],i=s.some((t=>t.route.id===e.route.id));return{...e,shouldLoad:i,resolve:async n=>(n&&"GET"===r.method&&(e.route.lazy||e.route.loader)&&(i=!0),i?async function(e,t,n,r,o,i){let s,a,l=r=>{let s,l=new Promise(((e,t)=>s=t));a=()=>s(),t.signal.addEventListener("abort",a);let u=o=>"function"!=typeof r?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${e}" [routeId: ${n.route.id}]`)):r({request:t,params:n.params,context:i},...void 0!==o?[o]:[]),c=(async()=>{try{return{type:"data",result:await(o?o((e=>u(e))):u())}}catch(e){return{type:"error",result:e}}})();return Promise.race([c,l])};try{let o=n.route[e];if(r)if(o){let e,[t]=await Promise.all([l(o).catch((t=>{e=t})),r]);if(void 0!==e)throw e;s=t}else{if(await r,o=n.route[e],!o){if("action"===e){let e=new URL(t.url),r=e.pathname+e.search;throw be(405,{method:t.method,pathname:r,routeId:n.route.id})}return{type:"data",result:void 0}}s=await l(o)}else{if(!o){let e=new URL(t.url);throw be(404,{pathname:e.pathname+e.search})}s=await l(o)}}catch(e){return{type:"error",result:e}}finally{a&&t.signal.removeEventListener("abort",a)}return s}(t,r,e,o,n,h):Promise.resolve({type:"data",result:void 0}))}})),m=await e({matches:f,request:r,params:a[0].params,fetcherKey:l,context:h});try{await Promise.all(d)}catch(e){}return m}(y,e,0,n,r,s,a,f,u)}catch(e){return r.forEach((t=>{p[t.route.id]={type:"error",error:e}})),p}for(let[e,t]of Object.entries(l))if(xe(t)){let r=t.result;p[e]={type:"redirect",response:ue(r,n,e,s,g)}}else p[e]=await le(t);return p}async function Le(t,n,r,o,i){let s=De("loader",0,i,r,n,null),a=Promise.all(o.map((async t=>{if(t.matches&&t.match&&t.controller){let n=(await De("loader",0,pe(e.history,t.path,t.controller.signal),[t.match],t.matches,t.key))[t.match.route.id];return{[t.key]:n}}return Promise.resolve({[t.key]:{type:"error",error:be(404,{pathname:t.path})}})})));return{loaderResults:await s,fetcherResults:(await a).reduce(((e,t)=>Object.assign(e,t)),{})}}function Me(){F=!0,re.forEach(((e,t)=>{B.has(t)&&q.add(t),He(t)}))}function je(e,t,n={}){I.fetchers.set(e,t),we({fetchers:new Map(I.fetchers)},{flushSync:!0===(n&&n.flushSync)})}function Fe(e,t,n,r={}){let o=ye(I.matches,t);Be(e),we({errors:{[o.route.id]:n},fetchers:new Map(I.fetchers)},{flushSync:!0===(r&&r.flushSync)})}function qe(e){return oe.set(e,(oe.get(e)||0)+1),se.has(e)&&se.delete(e),I.fetchers.get(e)||W}function Be(e){let t=I.fetchers.get(e);!B.has(e)||t&&"loading"===t.state&&J.has(e)||He(e),re.delete(e),J.delete(e),ee.delete(e),se.delete(e),q.delete(e),I.fetchers.delete(e)}function He(e){let t=B.get(e);t&&(t.abort(),B.delete(e))}function ze(e){for(let t of e){let e=Ae(qe(t).data);I.fetchers.set(t,e)}}function Ue(){let e=[],t=!1;for(let n of ee){let r=I.fetchers.get(n);o(r,`Expected fetcher: ${n}`),"loading"===r.state&&(ee.delete(n),e.push(n),t=!0)}return ze(e),t}function We(e){let t=[];for(let[n,r]of J)if(r<e){let e=I.fetchers.get(n);o(e,`Expected fetcher: ${n}`),"loading"===e.state&&(He(n),J.delete(n),t.push(n))}return ze(t),t.length>0}function Qe(e){I.blockers.delete(e),he.delete(e)}function $e(e,t){let n=I.blockers.get(e)||Q;o("unblocked"===n.state&&"blocked"===t.state||"blocked"===n.state&&"blocked"===t.state||"blocked"===n.state&&"proceeding"===t.state||"blocked"===n.state&&"unblocked"===t.state||"proceeding"===n.state&&"unblocked"===t.state,`Invalid blocker state transition: ${n.state} -> ${t.state}`);let r=new Map(I.blockers);r.set(e,t),we({blockers:r})}function Ge({currentLocation:e,nextLocation:t,historyAction:n}){if(0===he.size)return;he.size>1&&i(!1,"A router only supports one blocker at a time");let r=Array.from(he.entries()),[o,s]=r[r.length-1],a=I.blockers.get(o);return a&&"proceeding"===a.state?void 0:s({currentLocation:e,nextLocation:t,historyAction:n})?o:void 0}function Ye(e){let t=be(404,{pathname:e}),n=r||m,{matches:o,route:i}=ve(n);return{notFoundMatches:o,route:i,error:t}}function Ke(e,t){if(E){return E(e,t.map((e=>function(e,t){let{route:n,pathname:r,params:o}=e;return{id:n.id,pathname:r,params:o,data:t[n.id],handle:n.handle}}(e,I.loaderData))))||e.key}return e.key}function Je(e,t){if(x){let n=Ke(e,t),r=x[n];if("number"==typeof r)return r}return null}function Ze(e,t,n){if(v){if(!e)return{active:!0,matches:d(t,n,g,!0)||[]};if(Object.keys(e[0].params).length>0)return{active:!0,matches:d(t,n,g,!0)}}return{active:!1,matches:null}}async function Xe(e,t,n){if(!v)return{type:"success",matches:e};let o=e;for(;;){let e=null==r,i=r||m,s=f;try{await v({path:t,matches:o,patch:(e,t)=>{n.aborted||ie(e,t,i,s,u)}})}catch(e){return{type:"error",error:e,partialMatches:o}}finally{e&&!n.aborted&&(m=[...m])}if(n.aborted)return{type:"aborted"};let a=h(i,t,g);if(a)return{type:"success",matches:a};let l=d(i,t,g,!0);if(!l||o.length===l.length&&o.every(((e,t)=>e.route.id===l[t].route.id)))return{type:"success",matches:null};o=l}}return l={get basename(){return g},get future(){return b},get state(){return I},get routes(){return m},get window(){return t},initialize:function(){if(C=e.history.listen((({action:t,location:n,delta:r})=>{if(R)return R(),void(R=void 0);i(0===he.size||null!=r,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs.  This can also happen if you are using createHashRouter and the user manually changes the URL.");let o=Ge({currentLocation:I.location,nextLocation:n,historyAction:t});if(o&&null!=r){let t=new Promise((e=>{R=e}));return e.history.go(-1*r),void $e(o,{state:"blocked",location:n,proceed(){$e(o,{state:"proceeding",proceed:void 0,reset:void 0,location:n}),t.then((()=>e.history.go(r)))},reset(){let e=new Map(I.blockers);e.set(o,Q),we({blockers:e})}})}return _e(t,n)})),n){!function(e,t){try{let n=e.sessionStorage.getItem(K);if(n){let e=JSON.parse(n);for(let[n,r]of Object.entries(e||{}))r&&Array.isArray(r)&&t.set(n,new Set(r||[]))}}catch(e){}}(t,D);let e=()=>function(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(K,JSON.stringify(n))}catch(e){i(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}(t,D);t.addEventListener("pagehide",e),L=()=>t.removeEventListener("pagehide",e)}return I.initialized||_e("POP",I.location,{initialHydration:!0}),l},subscribe:function(e){return w.add(e),()=>w.delete(e)},enableScrollRestoration:function(e,t,n){if(x=e,P=t,E=n||null,!S&&I.navigation===U){S=!0;let e=Je(I.location,I.matches);null!=e&&we({restoreScrollPosition:e})}return()=>{x=null,P=null,E=null}},navigate:async function t(n,r){if("number"==typeof n)return void e.history.go(n);let o=Z(I.location,I.matches,g,n,r?.fromRouteId,r?.relative),{path:i,submission:s,error:l}=X(!1,o,r),u=I.location,c=a(I.location,i,r&&r.state);c={...c,...e.history.encodeLocation(c)};let p=r&&null!=r.replace?r.replace:void 0,h="PUSH";!0===p?h="REPLACE":!1===p||null!=s&&Oe(s.formMethod)&&s.formAction===I.location.pathname+I.location.search&&(h="REPLACE");let d=r&&"preventScrollReset"in r?!0===r.preventScrollReset:void 0,f=!0===(r&&r.flushSync),m=Ge({currentLocation:u,nextLocation:c,historyAction:h});m?$e(m,{state:"blocked",location:c,proceed(){$e(m,{state:"proceeding",proceed:void 0,reset:void 0,location:c}),t(n,r)},reset(){let e=new Map(I.blockers);e.set(m,Q),we({blockers:e})}}):await _e(h,c,{submission:s,pendingError:l,preventScrollReset:d,replace:r&&r.replace,enableViewTransition:r&&r.viewTransition,flushSync:f})},fetch:async function(t,n,i,s){He(t);let a=!0===(s&&s.flushSync),l=r||m,u=Z(I.location,I.matches,g,i,n,s?.relative),c=h(l,u,g),p=Ze(c,l,u);if(p.active&&p.matches&&(c=p.matches),!c)return void Fe(t,n,be(404,{pathname:u}),{flushSync:a});let{path:d,submission:f,error:y}=X(!0,u,s);if(y)return void Fe(t,n,y,{flushSync:a});let v=Ve(c,d),b=!0===(s&&s.preventScrollReset);f&&Oe(f.formMethod)?await async function(t,n,i,s,a,l,u,c,p){function d(e){if(!e.route.action&&!e.route.lazy){let e=be(405,{method:p.formMethod,pathname:i,routeId:n});return Fe(t,n,e,{flushSync:u}),!0}return!1}if(Me(),re.delete(t),!l&&d(s))return;let f=I.fetchers.get(t);je(t,function(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}(p,f),{flushSync:u});let y=new AbortController,v=pe(e.history,i,y.signal,p);if(l){let e=await Xe(a,i,v.signal);if("aborted"===e.type)return;if("error"===e.type)return void Fe(t,n,e.error,{flushSync:u});if(!e.matches)return void Fe(t,n,be(404,{pathname:i}),{flushSync:u});if(d(s=Ve(a=e.matches,i)))return}B.set(t,y);let b=H,C=(await De("action",0,v,[s],a,t))[s.route.id];if(v.signal.aborted)return void(B.get(t)===y&&B.delete(t));if(se.has(t)){if(Pe(C)||Ee(C))return void je(t,Ae(void 0))}else{if(Pe(C))return B.delete(t),$>b?void je(t,Ae(void 0)):(ee.add(t),je(t,ke(p)),Ne(v,C,!1,{fetcherSubmission:p,preventScrollReset:c}));if(Ee(C))return void Fe(t,n,C.error)}let w=I.navigation.location||I.location,x=pe(e.history,w,y.signal),E=r||m,P="idle"!==I.navigation.state?h(E,I.navigation.location,g):I.matches;o(P,"Didn't find any matches after fetcher action");let S=++H;J.set(t,S);let _=ke(p,C.data);I.fetchers.set(t,_);let[O,T]=te(e.history,I,P,p,w,!1,F,q,se,re,ee,E,g,[s.route.id,C]);T.filter((e=>e.key!==t)).forEach((e=>{let t=e.key,n=I.fetchers.get(t),r=ke(void 0,n?n.data:void 0);I.fetchers.set(t,r),He(t),e.controller&&B.set(t,e.controller)})),we({fetchers:new Map(I.fetchers)});let R=()=>T.forEach((e=>He(e.key)));y.signal.addEventListener("abort",R);let{loaderResults:A,fetcherResults:N}=await Le(0,P,O,T,x);if(y.signal.aborted)return;y.signal.removeEventListener("abort",R),J.delete(t),B.delete(t),T.forEach((e=>B.delete(e.key)));let D=Ce(A);if(D)return Ne(x,D.result,!1,{preventScrollReset:c});if(D=Ce(N),D)return ee.add(D.key),Ne(x,D.result,!1,{preventScrollReset:c});let{loaderData:L,errors:M}=fe(I,P,A,void 0,T,N);if(I.fetchers.has(t)){let e=Ae(C.data);I.fetchers.set(t,e)}We(S),"loading"===I.navigation.state&&S>$?(o(k,"Expected pending action"),V&&V.abort(),Se(I.navigation.location,{matches:P,loaderData:L,errors:M,fetchers:new Map(I.fetchers)})):(we({errors:M,loaderData:me(I.loaderData,L,P,M),fetchers:new Map(I.fetchers)}),F=!1)}(t,n,d,v,c,p.active,a,b,f):(re.set(t,{routeId:n,path:d}),await async function(t,n,r,o,i,s,a,l,u){let c=I.fetchers.get(t);je(t,ke(u,c?c.data:void 0),{flushSync:a});let p=new AbortController,h=pe(e.history,r,p.signal);if(s){let e=await Xe(i,r,h.signal);if("aborted"===e.type)return;if("error"===e.type)return void Fe(t,n,e.error,{flushSync:a});if(!e.matches)return void Fe(t,n,be(404,{pathname:r}),{flushSync:a});o=Ve(i=e.matches,r)}B.set(t,p);let d=H,f=(await De("loader",0,h,[o],i,t))[o.route.id];if(B.get(t)===p&&B.delete(t),!h.signal.aborted){if(!se.has(t))return Pe(f)?$>d?void je(t,Ae(void 0)):(ee.add(t),void await Ne(h,f,!1,{preventScrollReset:l})):void(Ee(f)?Fe(t,n,f.error):je(t,Ae(f.data)));je(t,Ae(void 0))}}(t,n,d,v,c,p.active,a,b,f))},revalidate:function(){de||(de=function(){let e,t,n=new Promise(((r,o)=>{e=async e=>{r(e);try{await n}catch(e){}},t=async e=>{o(e);try{await n}catch(e){}}}));return{promise:n,resolve:e,reject:t}}()),Me(),we({revalidation:"loading"});let e=de.promise;return"submitting"===I.navigation.state?e:"idle"===I.navigation.state?(_e(I.historyAction,I.location,{startUninterruptedRevalidation:!0}),e):(_e(k||I.historyAction,I.navigation.location,{overrideNavigation:I.navigation,enableViewTransition:!0===N}),e)},createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:qe,deleteFetcher:function(e){let t=(oe.get(e)||0)-1;t<=0?(oe.delete(e),se.add(e)):oe.set(e,t),we({fetchers:new Map(I.fetchers)})},dispose:function(){C&&C(),L&&L(),w.clear(),V&&V.abort(),I.fetchers.forEach(((e,t)=>Be(t))),I.blockers.forEach(((e,t)=>Qe(t)))},getBlocker:function(e,t){let n=I.blockers.get(e)||Q;return he.get(e)!==t&&he.set(e,t),n},deleteBlocker:Qe,patchRoutes:function(e,t){let n=null==r;ie(e,t,r||m,f,u),n&&(m=[...m],we({}))},_internalFetchControllers:B,_internalSetRoutes:function(e){f={},r=p(e,u,void 0,f)}},l}({basename:undefined,future:undefined,history:function(e={}){return function(e,t,n,i={}){let{window:u=document.defaultView,v5Compat:c=!1}=i,p=u.history,h="POP",d=null,f=m();function m(){return(p.state||{idx:null}).idx}function g(){h="POP";let e=m(),t=null==e?null:e-f;f=e,d&&d({action:h,location:v.location,delta:t})}function y(e){let t="null"!==u.location.origin?u.location.origin:u.location.href,n="string"==typeof e?e:l(e);return n=n.replace(/ $/,"%20"),o(t,`No window.location.(origin|href) available to create URL for href: ${n}`),new URL(n,t)}null==f&&(f=0,p.replaceState({...p.state,idx:f},""));let v={get action(){return h},get location(){return e(u,p)},listen(e){if(d)throw new Error("A history only accepts one active listener");return u.addEventListener(r,g),d=e,()=>{u.removeEventListener(r,g),d=null}},createHref:e=>t(u,e),createURL:y,encodeLocation(e){let t=y(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){h="PUSH";let r=a(v.location,e,t);n&&n(r,e),f=m()+1;let o=s(r,f),i=v.createHref(r);try{p.pushState(o,"",i)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;u.location.assign(i)}c&&d&&d({action:h,location:v.location,delta:1})},replace:function(e,t){h="REPLACE";let r=a(v.location,e,t);n&&n(r,e),f=m();let o=s(r,f),i=v.createHref(r);p.replaceState(o,"",i),c&&d&&d({action:h,location:v.location,delta:0})},go:e=>p.go(e)};return v}((function(e,t){let{pathname:n,search:r,hash:o}=e.location;return a("",{pathname:n,search:r,hash:o},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){return"string"==typeof t?t:l(t)}),null,e)}({window:undefined}),hydrationData:function(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:Nt(e.errors)}),e}(),routes:PT,mapRouteProperties:function(t){let n={hasErrorBoundary:t.hasErrorBoundary||null!=t.ErrorBoundary||null!=t.errorElement};return t.Component&&(t.element&&i(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(n,{element:e.createElement(t.Component),Component:void 0})),t.HydrateFallback&&(t.hydrateFallbackElement&&i(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(n,{hydrateFallbackElement:e.createElement(t.HydrateFallback),HydrateFallback:void 0})),t.ErrorBoundary&&(t.errorElement&&i(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(n,{errorElement:e.createElement(t.ErrorBoundary),ErrorBoundary:void 0})),n},dataStrategy:undefined,patchRoutesOnNavigation:undefined,window:undefined}).initialize());const OT=function(){return e.createElement("div",{className:"app"},e.createElement(zt,{router:_T}))};var TT=document.getElementById("root");(0,t.createRoot)(TT).render(e.createElement(e.StrictMode,null,e.createElement(OT,null)))})()})();
\ No newline at end of file
+`,cO=({reverseOrder:t,position:n="top-center",toastOptions:r,gutter:o,children:i,containerStyle:s,containerClassName:a})=>{let{toasts:l,handlers:u}=(t=>{let{toasts:n,pausedAt:r}=((t={})=>{let[n,r]=(0,e.useState)(D_);(0,e.useEffect)((()=>(N_.push(r),()=>{let e=N_.indexOf(r);e>-1&&N_.splice(e,1)})),[n]);let o=n.toasts.map((e=>{var n,r,o;return{...t,...t[e.type],...e,removeDelay:e.removeDelay||(null==(n=t[e.type])?void 0:n.removeDelay)||(null==t?void 0:t.removeDelay),duration:e.duration||(null==(r=t[e.type])?void 0:r.duration)||(null==t?void 0:t.duration)||M_[e.type],style:{...t.style,...null==(o=t[e.type])?void 0:o.style,...e.style}}}));return{...n,toasts:o}})(t);(0,e.useEffect)((()=>{if(r)return;let e=Date.now(),t=n.map((t=>{if(t.duration===1/0)return;let n=(t.duration||0)+t.pauseDuration-(e-t.createdAt);if(!(n<0))return setTimeout((()=>F_.dismiss(t.id)),n);t.visible&&F_.dismiss(t.id)}));return()=>{t.forEach((e=>e&&clearTimeout(e)))}}),[n,r]);let o=(0,e.useCallback)((()=>{r&&L_({type:6,time:Date.now()})}),[r]),i=(0,e.useCallback)(((e,t)=>{let{reverseOrder:r=!1,gutter:o=8,defaultPosition:i}=t||{},s=n.filter((t=>(t.position||i)===(e.position||i)&&t.height)),a=s.findIndex((t=>t.id===e.id)),l=s.filter(((e,t)=>t<a&&e.visible)).length;return s.filter((e=>e.visible)).slice(...r?[l+1]:[0,l]).reduce(((e,t)=>e+(t.height||0)+o),0)}),[n]);return(0,e.useEffect)((()=>{n.forEach((e=>{if(e.dismissed)((e,t=1e3)=>{if(H_.has(e))return;let n=setTimeout((()=>{H_.delete(e),L_({type:4,toastId:e})}),t);H_.set(e,n)})(e.id,e.removeDelay);else{let t=H_.get(e.id);t&&(clearTimeout(t),H_.delete(e.id))}}))}),[n]),{toasts:n,handlers:{updateHeight:q_,startPause:B_,endPause:o,calculateOffset:i}}})(r);return e.createElement("div",{id:"_rht_toaster",style:{position:"fixed",zIndex:9999,top:16,left:16,right:16,bottom:16,pointerEvents:"none",...s},className:a,onMouseEnter:u.startPause,onMouseLeave:u.endPause},l.map((r=>{let s=r.position||n,a=((e,t)=>{let n=e.includes("top"),r=n?{top:0}:{bottom:0},o=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:k_()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...o}})(s,u.calculateOffset(r,{reverseOrder:t,gutter:o,defaultPosition:n}));return e.createElement(lO,{id:r.id,key:r.id,onHeightUpdate:u.updateHeight,className:r.visible?uO:"",style:a},"custom"===r.type?R_(r.message,r):i?i(r):e.createElement(aO,{toast:r,position:s}))})))},pO=F_,hO=n(522),dO=n(136),fO=function(e){return e.Unverified="unverified",e.Verified="verified",e.Edited="edited",e}({}),mO=function(e){return e.closed="closed",e.open="open",e.preview="preview",e.published="published",e}({});function gO(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return yO(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?yO(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,i=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw i}}}}function yO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function vO(e,t){if(0==t.column.indexValue&&"item"in t.row){var n,r,o=t.row.item;void 0!==o.customDescription&&(null===(n=t.htmlElement.parentElement)||void 0===n||n.children[0].children[0].setAttribute("description",o.customDescription),null===(r=t.htmlElement.parentElement)||void 0===r||r.children[0].children[0].classList.add("survey-tooltip"))}}function bO(e,t){t.question.hideCheckboxLabels&&(t.cssClasses.root+=" hidden-checkbox-labels")}function CO(e,t){var n,r='[data-name="'+t.question.name+'"]',o=null===(n=document.querySelector(r))||void 0===n?void 0:n.querySelector("h5");o&&!o.classList.contains("sv-header-flex")&&t.question.updateElementCss()}function wO(e,t){if("description"===t.name){var n=t.text;if(n.length){for(var r=["e.g.","i.e.","etc.","vs."],o=0,i=r;o<i.length;o++){var s=i[o];n.includes(s)&&(n=n.replace(s,s.slice(0,-1)))}for(var a=n.split(". "),l=0;l<a.length;l++)if(0!=a[l].length){var u,c=gO(r);try{for(c.s();!(u=c.n()).done;){var p=u.value;a[l].includes(p.slice(0,-1))&&(a[l]=a[l].replace(p.slice(0,-1),p))}}catch(e){c.e(e)}finally{c.f()}}var h=a.map((function(e){return e.length?"<p>".concat((t=e).includes("*")?t.split("*").map((function(e,t){return 0==t?e:1==t?"<ul><li>".concat(e,"</li>"):"<li>".concat(e,"</li>")})).join("")+"</ul>":t.endsWith(".")?t:t+".","</p>"):null;var t})).join("");t.html=h}}}function xO(e,t,n){var r;n.verificationStatus.set(e.name,t);var o=document.createElement("button");o.type="button",o.className="sv-action-bar-item verification",o.innerHTML=t,t==fO.Unverified?(o.innerHTML="No change from previous year",o.className+=" verification-required",o.onclick=function(){"display"!=n.mode&&(e.validate(),xO(e,fO.Verified,n))}):(o.innerHTML="Answer updated",o.className+=" verification-ok");var i='[data-name="'+e.name+'"]',s=null===(r=document.querySelector(i))||void 0===r?void 0:r.querySelector("h5"),a=null==s?void 0:s.querySelector(".verification");a?a.replaceWith(o):null==s||s.appendChild(o)}const EO=function(t){var n=t.surveyModel,r=(0,e.useCallback)((function(e,t){var r,o=n.verificationStatus.get(t.question.name),i=null===(r=t.question)||void 0===r?void 0:r.readOnly;o&&!i?xO(t.question,o,n):i&&function(e){var t,n=!!e.visibleIf,r='[data-name="'+e.name+'"]',o=document.querySelector(r),i=null==o?void 0:o.querySelector("h5");if(n)o.style.display="none";else{i&&(i.style.textDecoration="line-through");var s=null===(t=document.querySelector(r))||void 0===t?void 0:t.querySelector(".sv-question__content");s&&(s.style.display="none")}}(t.question)}),[n]),o=(0,e.useCallback)((function(e,t){n.verificationStatus.get(t.question.name)==fO.Unverified&&xO(t.question,fO.Edited,n)}),[n]);return n.css.question.title.includes("sv-header-flex")||(n.css.question.title="sv-title sv-question__title sv-header-flex",n.css.question.titleOnError="sv-question__title--error sv-error-color-fix"),n.onAfterRenderQuestion.hasFunc(r)||(n.onAfterRenderQuestion.add(r),n.onAfterRenderQuestion.add(CO)),n.onValueChanged.hasFunc(o)||n.onValueChanged.add(o),n.onUpdateQuestionCssClasses.hasFunc(bO)||n.onUpdateQuestionCssClasses.add(bO),n.onMatrixAfterCellRender.hasFunc(vO)||n.onMatrixAfterCellRender.add(vO),n.onTextMarkdown.hasFunc(wO)||n.onTextMarkdown.add(wO),e.createElement(dO.Survey,{model:n})};function PO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function SO(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?PO(Object(n),!0).forEach((function(t){vn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PO(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const _O=function(t){var n=t.surveyModel,r=t.pageNoSetter,o=Qt((0,e.useState)([]),2),i=o[0],s=o[1],a=function(e){return!(null===e.value||void 0===e.value||""===e.value||"checkbox"===e.getType()&&0==e.value.length||"multipletext"===e.getType()&&(1===Object.keys(e.value).length&&void 0===Object.values(e.value)[0]||0===Object.keys(e.value).length))};(0,e.useEffect)((function(){var e=function(e){if(e&&e.pages){var t=[];e.pages.forEach((function(n){var r=n.questions.filter((function(e){return e.startWithNewLine})),o=r.length,i=r.filter(a).length,s=o-i,l=i/o;t.push({completionPercentage:100*l,unansweredPercentage:s/o*100,totalPages:e.pages.length,pageTitle:n.title})})),s(t)}};n.onValueChanged.add((function(t){e(t)})),e(n)}),[n]);var l={height:"0.5rem",transition:"width 0.3s ease"};return e.createElement(Qn,{className:"survey-progress"},e.createElement(Gn,null,i.map((function(t,o){return e.createElement(Kn,{xs:12,md:!0,key:o,onClick:function(){return r(o)},style:{cursor:"pointer",margin:"0.5rem"}},e.createElement("div",null,e.createElement("span",{style:{whiteSpace:"nowrap",fontSize:"1.5rem",marginRight:"0.25rem",fontWeight:"bold",color:"#2db394"}},o+1),e.createElement("span",{style:SO({whiteSpace:"nowrap"},n.currentPageNo==o&&{fontWeight:"bold"})},t.pageTitle),e.createElement("div",{style:{display:"flex",flexWrap:"wrap"}},e.createElement("div",{style:SO(SO({},l),{},{width:"".concat(t.completionPercentage,"%"),backgroundColor:"#262261"})}),e.createElement("div",{style:SO(SO({},l),{},{width:"".concat(t.unansweredPercentage,"%"),backgroundColor:"#cdcdcd"})}))))}))))},OO=function(t){var n=t.surveyModel,r=t.surveyActions,o=t.year,i=t.nren,s=t.children,a=Qt((0,e.useState)(0),2),l=a[0],u=a[1],c=Qt((0,e.useState)(!1),2),p=c[0],h=c[1],d=Qt((0,e.useState)(""),2),f=d[0],m=d[1],g=Qt((0,e.useState)(""),2),y=g[0],v=g[1],b=(0,e.useContext)(tn).user,C=(0,e.useCallback)((function(){h("edit"==n.mode),m(n.lockedBy),u(n.currentPageNo),v(n.status)}),[n]);(0,e.useEffect)((function(){C()}),[C]);var w=function(e){u(e),n.currentPageNo=e},x=function(){w(n.currentPageNo+1)},E=function(){var e=Kt(Zt().mark((function e(t){return Zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r[t]();case 2:C();case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),P=function(e,t){return S(e,(function(){return E(t)}))},S=function(t,n){return e.createElement("button",{className:"sv-btn sv-btn--navigation",onClick:n},t)},_="Save and stop editing",O="Save progress",T="Start editing",V="Complete Survey",R=function(){return e.createElement("div",{className:"survey-edit-buttons-block"},!p&&!f&&n.editAllowed&&P(T,"startEdit"),!p&&f&&f==b.name&&P("Discard any unsaved changes and release your lock","releaseLock"),p&&P(O,"save"),p&&P(_,"saveAndStopEdit"),p&&P(V,"complete"),l!==n.visiblePages.length-1&&S("Next Section",x))};return e.createElement(Qn,null,e.createElement(Gn,{className:"survey-content"},e.createElement("h2",null,e.createElement("span",{className:"survey-title"},o," Compendium Survey "),e.createElement("span",{className:"survey-title-nren"}," ",i," "),e.createElement("span",null," - ",y)),e.createElement("div",{style:{marginTop:"1rem",textAlign:"justify"}},e.createElement("p",null,"To get started, click “",T,"” to end read-only mode. Different people from your NREN (Compendium administrators) can contribute to the survey if needed, but agreement should be reached internally before completing the survey as the administration team will treat responses as a single source of truth from the NREN. You can start editing only when nobody else from your NREN is currently working on the survey."),e.createElement("p",null,e.createElement("b",null,"In a small change, the survey now asks about this calendar year, i.e. ",o)," (or the current financial year if your budget or staffing data does not match the calendar year). For network questions, please provide data from the 12 months preceding you answering the question. Where available, the survey questions are pre-filled with answers from the previous survey. You can edit the pre-filled answer to provide new information, or press the “no change from previous year” button."),e.createElement("p",null,"Press the “",O,"“ or “",_,"“ button to save all answers in the survey. When you reach the last section of the survey (Services), you will find a “",V,"“ button which saves all answers in the survey and lets the Compendium team know that your answers are ready to be published. As long as the survey remains open, any Compendium administrator from your NREN can add answers or amend existing ones, even after using the “",V,"“ button."),e.createElement("p",null,"Some fields require specific data, such as numerical data, valid http-addresses, and in some questions, the answer has to add up to 100%. If an answer does not fulfil the set criteria, the question will turn pink and an error message will appear. Fields can be left blank if you prefer not to answer a question. If you notice any errors after the survey was closed, please contact us for correcting those.")),e.createElement("p",null,"Thank you for taking the time to fill in the ",o," Compendium Survey. Any questions or requests can be sent to ",e.createElement("a",{href:"mailto:Partner-Relations@geant.org"},e.createElement("span",null,"Partner-Relations@geant.org"))),p&&e.createElement(e.Fragment,null,e.createElement("br",null),e.createElement("b",null,"Remember to click “",_,"” before leaving the page."))),e.createElement(Gn,null,R()),e.createElement(Gn,{className:"survey-content"},!p&&e.createElement("div",{className:"survey-edit-explainer"},!f&&n.editAllowed&&"The survey is in read-only mode; click the “Start editing“ button to begin editing the answers.",!f&&!n.editAllowed&&"The survey is in read-only mode and can not be edited by you.",f&&f!=b.name&&"The survey is in read-only mode and currently being edited by: "+f+". To start editing the survey, ask them to complete their edits.",f&&f==b.name&&'The survey is in read-only mode because you started editing in another tab, browser or device. To start editing the survey, either complete those edits or click the "Discard any unsaved changes" button.')),e.createElement(Gn,null,e.createElement(_O,{surveyModel:n,pageNoSetter:w}),s),e.createElement(Gn,null,R()))},TO=function(t){var n=t.when,r=t.onPageExit;return function(t){let{router:n,basename:r}=tt("useBlocker"),o=nt("useBlocker"),[i,s]=e.useState(""),a=e.useCallback((e=>{if("function"!=typeof t)return!!t;if("/"===r)return t(e);let{currentLocation:n,nextLocation:o,historyAction:i}=e;return t({currentLocation:{...n,pathname:O(n.pathname,r)||n.pathname},nextLocation:{...o,pathname:O(o.pathname,r)||o.pathname},historyAction:i})}),[r,t]);e.useEffect((()=>{let e=String(++ot);return s(e),()=>n.deleteBlocker(e)}),[n]),e.useEffect((()=>{""!==i&&n.getBlocker(i,a)}),[n,i,a]),i&&o.blockers.has(i)&&o.blockers.get(i)}((function(){if(n()){var e=window.confirm(t.message);return e&&r(),!e}return!1})),e.createElement("div",null)};var VO={validateWebsiteUrl:function(e){if(!(arguments.length>1&&void 0!==arguments[1]&&arguments[1]||null!=e&&null!=e&&""!=e))return!0;try{return!(e=e.trim()).includes(" ")&&(e.includes(":/")||(e="https://"+e),!!new URL(e))}catch(e){return!1}}},RO={data_protection_contact:function(){return!0}};function IO(e){var t=e[0];if(null==t||null==t||""==t)return!0;try{return!(t=t.trim()).includes(" ")&&(t.includes(":/")||(t="https://"+t),!!new URL(t))}catch(e){return!1}}function kO(e){try{var t,n=this.question,r=e[0]||void 0;t=n.data&&"name"in n.data?n.data.name:n.name;var o=n.value,i=RO[t];if(i)return i.apply(void 0,[o].concat(fn(e.slice(1))));var s=VO[r];if(!s)throw new Error("Validation function ".concat(r," not found for question ").concat(t));return s.apply(void 0,[o].concat(fn(e.slice(1))))}catch(e){return console.error(e),!1}}hO.Serializer.addProperty("itemvalue","customDescription:text"),hO.Serializer.addProperty("question","hideCheckboxLabels:boolean");const AO=function(t){var n=t.loadFrom,r=Qt((0,e.useState)(),2),o=r[0],i=r[1],s=function(){let{matches:t}=e.useContext(qe),n=t[t.length-1];return n?n.params:{}}(),a=s.year,l=s.nren,u=Qt((0,e.useState)("loading survey..."),2),c=u[0],p=u[1],h=(0,e.useContext)(tn).user,d=!!h.id&&h.permissions.admin;hO.FunctionFactory.Instance.hasFunction("validateQuestion")||hO.FunctionFactory.Instance.register("validateQuestion",kO),hO.FunctionFactory.Instance.hasFunction("validateWebsiteUrl")||hO.FunctionFactory.Instance.register("validateWebsiteUrl",IO);var f=Vr().trackPageView,m=(0,e.useCallback)((function(e){return e.preventDefault(),e.returnValue=""}),[]),g=(0,e.useCallback)((function(){window.navigator.sendBeacon("/api/response/unlock/"+a+"/"+l)}),[]),y=(0,e.useCallback)((function(){window.navigator.sendBeacon("/api/response/unlock/"+a+"/"+l),removeEventListener("beforeunload",m,{capture:!0}),removeEventListener("pagehide",g)}),[]);if((0,e.useEffect)((function(){function e(){return(e=Kt(Zt().mark((function e(){var t,r,o,s;return Zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(n+a+(l?"/"+l:""));case 2:return t=e.sent,e.next=5,t.json();case 5:if(r=e.sent,t.ok){e.next=12;break}if(!("message"in r)){e.next=11;break}throw new Error(r.message);case 11:throw new Error("Request failed with status ".concat(t.status));case 12:for(s in(o=new hO.Model(r.model)).setVariable("surveyyear",a),o.setVariable("previousyear",parseInt(a)-1),o.showNavigationButtons=!1,o.requiredText="",o.verificationStatus=new Map,r.verification_status)o.verificationStatus.set(s,r.verification_status[s]);o.data=r.data,o.clearIncorrectValues(!0),o.currentPageNo=r.page,o.mode=r.mode,o.lockedBy=r.locked_by,o.status=r.status,o.editAllowed=r.edit_allowed,i(o);case 27:case"end":return e.stop()}}),e)})))).apply(this,arguments)}(function(){return e.apply(this,arguments)})().catch((function(e){return p("Error when loading survey: "+e.message)})).then((function(){f({documentTitle:"Survey for ".concat(l," (").concat(a,")")})}))}),[]),!o)return c;var v,b,C,w,x,E=function(){var e=Kt(Zt().mark((function e(t,n){var r,i,s;return Zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(l){e.next=2;break}return e.abrupt("return","Saving not available in inpect/try mode");case 2:return r={lock_uuid:t.lockUUID,new_state:n,data:t.data,page:t.currentPageNo,verification_status:Object.fromEntries(t.verificationStatus)},e.prev=3,e.next=6,fetch("/api/response/save/"+a+"/"+l,{method:"POST",headers:{"Content-Type":"application/json; charset=utf-8"},body:JSON.stringify(r)});case 6:return i=e.sent,e.next=9,i.json();case 9:if(s=e.sent,i.ok){e.next=12;break}return e.abrupt("return",s.message);case 12:o.mode=s.mode,o.lockedBy=s.locked_by,o.status=s.status,e.next=20;break;case 17:return e.prev=17,e.t0=e.catch(3),e.abrupt("return","Unknown Error: "+e.t0.message);case 20:case"end":return e.stop()}}),e,null,[[3,17]])})));return function(t,n){return e.apply(this,arguments)}}(),P=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n="",r=function(e,t){e.verificationStatus.get(t.name)==fO.Unverified&&(""==n&&(n=t.name),t.error='Please verify that last years data is correct by editing the answer or pressing the "No change from previous year" button!')};t&&o.onValidateQuestion.add(r);var i=e();return t&&o.onValidateQuestion.remove(r),i||pO("Validation failed!"),i},S={save:(x=Kt(Zt().mark((function e(){var t;return Zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(P(o.validate.bind(o,!0,!0),!1)){e.next=4;break}return pO("Please correct the invalid fields before saving!"),e.abrupt("return");case 4:return e.next=6,E(o,"editing");case 6:t=e.sent,pO(t?"Failed saving survey: "+t:"Survey saved!");case 8:case"end":return e.stop()}}),e)}))),function(){return x.apply(this,arguments)}),complete:(w=Kt(Zt().mark((function e(){var t;return Zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!P(o.validate.bind(o,!0,!0))){e.next=6;break}return e.next=4,E(o,"completed");case 4:(t=e.sent)?pO("Failed completing survey: "+t):(pO("Survey completed!"),removeEventListener("beforeunload",m,{capture:!0}),removeEventListener("pagehide",g));case 6:case"end":return e.stop()}}),e)}))),function(){return w.apply(this,arguments)}),saveAndStopEdit:(C=Kt(Zt().mark((function e(){var t;return Zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(P(o.validate.bind(o,!0,!0),!1)){e.next=4;break}return pO("Please correct the invalid fields before saving."),e.abrupt("return");case 4:return e.next=6,E(o,"readonly");case 6:(t=e.sent)?pO("Failed saving survey: "+t):(pO("Survey saved!"),removeEventListener("beforeunload",m,{capture:!0}),removeEventListener("pagehide",g));case 8:case"end":return e.stop()}}),e)}))),function(){return C.apply(this,arguments)}),startEdit:(b=Kt(Zt().mark((function e(){var t,n,r;return Zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("/api/response/lock/"+a+"/"+l,{method:"POST"});case 2:return t=e.sent,e.next=5,t.json();case 5:if(n=e.sent,t.ok){e.next=9;break}return pO("Failed starting edit: "+n.message),e.abrupt("return");case 9:for(r in addEventListener("pagehide",g),addEventListener("beforeunload",m,{capture:!0}),n.verification_status)o.verificationStatus.set(r,n.verification_status[r]);if(o.data=n.data,o.clearIncorrectValues(!0),o.mode=n.mode,o.lockedBy=n.locked_by,o.lockUUID=n.lock_uuid,o.status=n.status,P(o.validate.bind(o,!0,!0),!1)){e.next=22;break}return pO("Some fields are invalid, please correct them."),e.abrupt("return");case 22:case"end":return e.stop()}}),e)}))),function(){return b.apply(this,arguments)}),releaseLock:(v=Kt(Zt().mark((function e(){var t,n;return Zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("/api/response/unlock/"+a+"/"+l,{method:"POST"});case 2:return t=e.sent,e.next=5,t.json();case 5:if(n=e.sent,t.ok){e.next=9;break}return pO("Failed releasing lock: "+n.message),e.abrupt("return");case 9:o.mode=n.mode,o.lockedBy=n.locked_by,o.status=n.status;case 12:case"end":return e.stop()}}),e)}))),function(){return v.apply(this,arguments)}),validatePage:function(){P(o.validatePage.bind(o))&&pO("Page validation successful!")}};return e.createElement(e.Fragment,null,d?e.createElement(h_,null):null,e.createElement(Qn,{className:"survey-container"},e.createElement(cO,null),e.createElement(TO,{message:"Are you sure you want to leave this page? Information you've entered may not be saved.",when:function(){return"edit"==o.mode&&!!l},onPageExit:y}),e.createElement(OO,{surveyModel:o,surveyActions:S,year:a,nren:l},e.createElement(EO,{surveyModel:o}))))},NO=function(...e){return e.filter((e=>null!=e)).reduce(((e,t)=>{if("function"!=typeof t)throw new Error("Invalid Argument Type, must only provide functions, undefined, or null.");return null===e?t:function(...n){e.apply(this,n),t.apply(this,n)}}),null)},DO={height:["marginTop","marginBottom"],width:["marginLeft","marginRight"]};function LO(e,t){const n=t[`offset${e[0].toUpperCase()}${e.slice(1)}`],r=DO[e];return n+parseInt(bo(t,r[0]),10)+parseInt(bo(t,r[1]),10)}const MO={[li]:"collapse",[pi]:"collapsing",[ui]:"collapsing",[ci]:"collapse show"},jO=e.forwardRef((({onEnter:t,onEntering:n,onEntered:r,onExit:o,onExiting:i,className:s,children:a,dimension:l="height",in:u=!1,timeout:c=300,mountOnEnter:p=!1,unmountOnExit:h=!1,appear:d=!1,getDimensionValue:f=LO,...m},g)=>{const y="function"==typeof l?l():l,v=(0,e.useMemo)((()=>NO((e=>{e.style[y]="0"}),t)),[y,t]),b=(0,e.useMemo)((()=>NO((e=>{const t=`scroll${y[0].toUpperCase()}${y.slice(1)}`;e.style[y]=`${e[t]}px`}),n)),[y,n]),C=(0,e.useMemo)((()=>NO((e=>{e.style[y]=null}),r)),[y,r]),w=(0,e.useMemo)((()=>NO((e=>{e.style[y]=`${f(y,e)}px`,yi(e)}),o)),[o,f,y]),x=(0,e.useMemo)((()=>NO((e=>{e.style[y]=null}),i)),[y,i]);return(0,Mn.jsx)(bi,{ref:g,addEndListener:gi,...m,"aria-expanded":m.role?u:null,onEnter:v,onEntering:b,onEntered:C,onExit:w,onExiting:x,childRef:qo(a),in:u,timeout:c,mountOnEnter:p,unmountOnExit:h,appear:d,children:(t,n)=>e.cloneElement(a,{...n,className:Ln()(s,a.props.className,MO[t],"width"===y&&"collapse-horizontal")})})}));function FO(e,t){return Array.isArray(e)?e.includes(t):e===t}const qO=e.createContext({});qO.displayName="AccordionContext";const BO=qO,HO=e.forwardRef((({as:t="div",bsPrefix:n,className:r,children:o,eventKey:i,...s},a)=>{const{activeEventKey:l}=(0,e.useContext)(BO);return n=Bn(n,"accordion-collapse"),(0,Mn.jsx)(jO,{ref:a,in:FO(l,i),...s,className:Ln()(r,n),children:(0,Mn.jsx)(t,{children:e.Children.only(o)})})}));HO.displayName="AccordionCollapse";const zO=HO,UO=e.createContext({eventKey:""});UO.displayName="AccordionItemContext";const WO=UO,QO=e.forwardRef((({as:t="div",bsPrefix:n,className:r,onEnter:o,onEntering:i,onEntered:s,onExit:a,onExiting:l,onExited:u,...c},p)=>{n=Bn(n,"accordion-body");const{eventKey:h}=(0,e.useContext)(WO);return(0,Mn.jsx)(zO,{eventKey:h,onEnter:o,onEntering:i,onEntered:s,onExit:a,onExiting:l,onExited:u,children:(0,Mn.jsx)(t,{ref:p,...c,className:Ln()(r,n)})})}));QO.displayName="AccordionBody";const $O=QO,GO=e.forwardRef((({as:t="button",bsPrefix:n,className:r,onClick:o,...i},s)=>{n=Bn(n,"accordion-button");const{eventKey:a}=(0,e.useContext)(WO),l=function(t,n){const{activeEventKey:r,onSelect:o,alwaysOpen:i}=(0,e.useContext)(BO);return e=>{let s=t===r?null:t;i&&(s=Array.isArray(r)?r.includes(t)?r.filter((e=>e!==t)):[...r,t]:[t]),null==o||o(s,e),null==n||n(e)}}(a,o),{activeEventKey:u}=(0,e.useContext)(BO);return"button"===t&&(i.type="button"),(0,Mn.jsx)(t,{ref:s,onClick:l,...i,"aria-expanded":Array.isArray(u)?u.includes(a):a===u,className:Ln()(r,n,!FO(u,a)&&"collapsed")})}));GO.displayName="AccordionButton";const YO=GO,KO=e.forwardRef((({as:e="h2","aria-controls":t,bsPrefix:n,className:r,children:o,onClick:i,...s},a)=>(n=Bn(n,"accordion-header"),(0,Mn.jsx)(e,{ref:a,...s,className:Ln()(r,n),children:(0,Mn.jsx)(YO,{onClick:i,"aria-controls":t,children:o})}))));KO.displayName="AccordionHeader";const JO=KO,ZO=e.forwardRef((({as:t="div",bsPrefix:n,className:r,eventKey:o,...i},s)=>{n=Bn(n,"accordion-item");const a=(0,e.useMemo)((()=>({eventKey:o})),[o]);return(0,Mn.jsx)(WO.Provider,{value:a,children:(0,Mn.jsx)(t,{ref:s,...i,className:Ln()(r,n)})})}));ZO.displayName="AccordionItem";const XO=ZO,eT=e.forwardRef(((t,n)=>{const{as:r="div",activeKey:o,bsPrefix:i,className:s,onSelect:a,flush:l,alwaysOpen:u,...c}=TE(t,{activeKey:"onSelect"}),p=Bn(i,"accordion"),h=(0,e.useMemo)((()=>({activeEventKey:o,onSelect:a,alwaysOpen:u})),[o,a,u]);return(0,Mn.jsx)(BO.Provider,{value:h,children:(0,Mn.jsx)(r,{ref:n,...c,className:Ln()(s,p,l&&`${p}-flush`)})})}));eT.displayName="Accordion";const tT=Object.assign(eT,{Button:YO,Collapse:zO,Item:XO,Header:JO,Body:$O}),nT=e.forwardRef((({bsPrefix:e,variant:t,animation:n="border",size:r,as:o="div",className:i,...s},a)=>{const l=`${e=Bn(e,"spinner")}-${n}`;return(0,Mn.jsx)(o,{ref:a,...s,className:Ln()(i,l,r&&`${l}-${r}`,t&&`text-${t}`)})}));nT.displayName="Spinner";const rT=nT;function oT(e){return jr({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M362.6 192.9L345 174.8c-.7-.8-1.8-1.2-2.8-1.2-1.1 0-2.1.4-2.8 1.2l-122 122.9-44.4-44.4c-.8-.8-1.8-1.2-2.8-1.2-1 0-2 .4-2.8 1.2l-17.8 17.8c-1.6 1.6-1.6 4.1 0 5.7l56 56c3.6 3.6 8 5.7 11.7 5.7 5.3 0 9.9-3.9 11.6-5.5h.1l133.7-134.4c1.4-1.7 1.4-4.2-.1-5.7z"},child:[]},{tag:"path",attr:{d:"M256 76c48.1 0 93.3 18.7 127.3 52.7S436 207.9 436 256s-18.7 93.3-52.7 127.3S304.1 436 256 436c-48.1 0-93.3-18.7-127.3-52.7S76 304.1 76 256s18.7-93.3 52.7-127.3S207.9 76 256 76m0-28C141.1 48 48 141.1 48 256s93.1 208 208 208 208-93.1 208-208S370.9 48 256 48z"},child:[]}]})(e)}function iT(e){return jr({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 48C141.1 48 48 141.1 48 256s93.1 208 208 208 208-93.1 208-208S370.9 48 256 48zm106.5 150.5L228.8 332.8h-.1c-1.7 1.7-6.3 5.5-11.6 5.5-3.8 0-8.1-2.1-11.7-5.7l-56-56c-1.6-1.6-1.6-4.1 0-5.7l17.8-17.8c.8-.8 1.8-1.2 2.8-1.2 1 0 2 .4 2.8 1.2l44.4 44.4 122-122.9c.8-.8 1.8-1.2 2.8-1.2 1.1 0 2.1.4 2.8 1.2l17.5 18.1c1.8 1.7 1.8 4.2.2 5.8z"},child:[]}]})(e)}function sT(e){return jr({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M331.3 308.7L278.6 256l52.7-52.7c6.2-6.2 6.2-16.4 0-22.6-6.2-6.2-16.4-6.2-22.6 0L256 233.4l-52.7-52.7c-6.2-6.2-15.6-7.1-22.6 0-7.1 7.1-6 16.6 0 22.6l52.7 52.7-52.7 52.7c-6.7 6.7-6.4 16.3 0 22.6 6.4 6.4 16.4 6.2 22.6 0l52.7-52.7 52.7 52.7c6.2 6.2 16.4 6.2 22.6 0 6.3-6.2 6.3-16.4 0-22.6z"},child:[]},{tag:"path",attr:{d:"M256 76c48.1 0 93.3 18.7 127.3 52.7S436 207.9 436 256s-18.7 93.3-52.7 127.3S304.1 436 256 436c-48.1 0-93.3-18.7-127.3-52.7S76 304.1 76 256s18.7-93.3 52.7-127.3S207.9 76 256 76m0-28C141.1 48 48 141.1 48 256s93.1 208 208 208 208-93.1 208-208S370.9 48 256 48z"},child:[]}]})(e)}function aT(e){return jr({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 48C141.1 48 48 141.1 48 256s93.1 208 208 208 208-93.1 208-208S370.9 48 256 48zm52.7 283.3L256 278.6l-52.7 52.7c-6.2 6.2-16.4 6.2-22.6 0-3.1-3.1-4.7-7.2-4.7-11.3 0-4.1 1.6-8.2 4.7-11.3l52.7-52.7-52.7-52.7c-3.1-3.1-4.7-7.2-4.7-11.3 0-4.1 1.6-8.2 4.7-11.3 6.2-6.2 16.4-6.2 22.6 0l52.7 52.7 52.7-52.7c6.2-6.2 16.4-6.2 22.6 0 6.2 6.2 6.2 16.4 0 22.6L278.6 256l52.7 52.7c6.2 6.2 6.2 16.4 0 22.6-6.2 6.3-16.4 6.3-22.6 0z"},child:[]}]})(e)}const lT=function(t){var n=t.status;return{completed:e.createElement(iT,{title:n,size:24,color:"green"}),started:e.createElement(oT,{title:n,size:24,color:"rgb(217, 117, 10)"}),"did not respond":e.createElement(aT,{title:n,size:24,color:"red"}),"not started":e.createElement(sT,{title:n,size:24})}[n]||n};var uT=n(543);function cT(t){var n=t.text,r=t.helpText,o=t.onClick,i=t.enabled,s=Qt((0,e.useState)(!1),2),a=s[0],l=s[1],u=function(){var e=Kt(Zt().mark((function e(){return Zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!a){e.next=2;break}return e.abrupt("return");case 2:return l(!0),e.prev=3,e.next=6,o();case 6:return e.prev=6,l(!1),e.finish(6);case 9:case"end":return e.stop()}}),e,null,[[3,,6,9]])})));return function(){return e.apply(this,arguments)}}();return e.createElement(Rs,{onClick:u,disabled:!i,style:{pointerEvents:"auto",marginLeft:".5rem"},title:r},a&&e.createElement(rT,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"}),n)}const pT=function(){var t=Qt((0,e.useState)([]),2),n=t[0],r=t[1],o=(0,e.useRef)(!1);function i(e,t,n){return s.apply(this,arguments)}function s(){return s=Kt(Zt().mark((function e(t,n,o){var i,s,a,l=arguments;return Zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=l.length>3&&void 0!==l[3]&&l[3],e.prev=1,i&&(t+="?dry_run=1"),e.next=5,fetch(t,{method:"POST"});case 5:return s=e.sent,e.next=8,s.json();case 8:a=e.sent,s.ok?(a.message&&console.log(a.message),i||pO(o),l_().then((function(e){r(e)}))):pO(n+a.message),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(1),pO(n+e.t0.message);case 15:case"end":return e.stop()}}),e,null,[[1,12]])}))),s.apply(this,arguments)}function a(){return(a=Kt(Zt().mark((function e(){return Zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i("/api/survey/new","Failed creating new survey: ","Created new survey");case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function l(e,t){return u.apply(this,arguments)}function u(){return u=Kt(Zt().mark((function e(t,n){var r,s=arguments;return Zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=s.length>2&&void 0!==s[2]&&s[2],!o.current){e.next=4;break}return pO("Wait for status update to be finished..."),e.abrupt("return");case 4:return o.current=!0,e.next=7,i("/api/survey/"+n+"/"+t,"Error while updating "+t+" survey status to "+n+": ",t+" survey status updated to "+n,r);case 7:o.current=!1;case 8:case"end":return e.stop()}}),e)}))),u.apply(this,arguments)}function c(){return(c=Kt(Zt().mark((function e(t,n){return Zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i("/api/response/unlock/"+t+"/"+n,"Error while unlocking "+n+" "+t+" survey response: ",n+" "+t+" survey response unlocked");case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}(0,e.useEffect)((function(){l_().then((function(e){r(e)}))}),[]);var p=n.length>0&&n.every((function(e){return e.status==mO.published})),h=window.location.origin+"/data?preview";return e.createElement(e.Fragment,null,e.createElement(h_,null),e.createElement(Qn,{className:"py-5 grey-container"},e.createElement(Qn,{style:{maxWidth:"100rem"}},e.createElement(Gn,null,e.createElement(cO,null),e.createElement(Rs,{onClick:function(){return a.apply(this,arguments)},disabled:!p,style:{pointerEvents:"auto",width:"10rem",margin:"1rem"},title:"Create a new survey for the next year. Only possible if all current surveys are published."},"start new survey"),e.createElement(tT,{defaultActiveKey:"0"},n.map((function(t,n){return e.createElement(tT.Item,{eventKey:n.toString(),key:t.year},e.createElement(tT.Header,null,t.year," - ",t.status),e.createElement(tT.Body,null,e.createElement("div",{style:{marginLeft:".5rem",marginBottom:"1rem"}},e.createElement(Lt,{to:"/survey/admin/edit/".concat(t.year),target:"_blank"},e.createElement(Rs,{style:{marginLeft:".5rem"},title:"Open the survey for inspection with all questions visible and any visibleIf logic added to the title."},"Inspect Survey")),e.createElement(Lt,{to:"/survey/admin/try/".concat(t.year),target:"_blank"},e.createElement(Rs,{style:{marginLeft:".5rem"},title:"Open the survey exactly as the nrens will see it, but without any nren data."},"Try Survey")),e.createElement(cT,{text:"Mark as open",helpText:"Allow the NRENs to respond to this survey. Only 1 survey may be open at a time, and (pre)-published surveys cannot be opened anymore.",enabled:t.status==mO.closed,onClick:function(){return l(t.year,"open")}}),e.createElement(cT,{text:"Mark as closed",helpText:"Do not allow the NRENs to respond to this survey anymore. Only surveys with status open can be closed.",enabled:t.status==mO.open,onClick:function(){return l(t.year,"close")}}),e.createElement(cT,{text:"Preview results",helpText:"Publish all completed survey responses to the compendium website for preview by admins. This is only possible if the survey is closed or previewed already.",enabled:t.status==mO.closed||t.status==mO.preview,onClick:function(){return l(t.year,"preview")}}),e.createElement(cT,{text:"Publish results (dry run)",helpText:"Performs a dry-run of the publish operation, without actually publishing the results. Changes are logged in the browser console (F12).",enabled:t.status==mO.preview||t.status==mO.published,onClick:function(){return l(t.year,"publish",!0)}}),e.createElement(cT,{text:"Publish results",helpText:"Publish or re-publish all completed survey responses to the compendium website. This is only possible if the survey is in preview or published already.",enabled:t.status==mO.preview||t.status==mO.published,onClick:function(){return l(t.year,"publish")}}),t.status==mO.preview&&e.createElement("span",null,"  Preview link: ",e.createElement("a",{href:h},h))),e.createElement(cP,null,e.createElement("colgroup",null,e.createElement("col",{style:{width:"10%"}}),e.createElement("col",{style:{width:"20%"}}),e.createElement("col",{style:{width:"20%"}}),e.createElement("col",{style:{width:"30%"}}),e.createElement("col",{style:{width:"20%"}})),e.createElement("thead",null,e.createElement("tr",null,e.createElement("th",null,"NREN"),e.createElement("th",null,"Status"),e.createElement("th",null,"Lock"),e.createElement("th",null,"Management Notes"),e.createElement("th",null,"Actions"))),e.createElement("tbody",null,t.responses.map((function(n){return e.createElement("tr",{key:n.nren.id},e.createElement("td",null,n.nren.name),e.createElement("td",null,e.createElement(lT,{status:n.status})),e.createElement("td",{style:{textWrap:"wrap",wordWrap:"break-word",maxWidth:"10rem"}},n.lock_description),e.createElement("td",null,"notes"in n&&e.createElement("textarea",{onInput:(0,uT.debounce)((function(e){return r=t.year,o=n.nren.id,i=e.target.value,void fetch("/api/survey/"+r+"/"+o+"/notes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({notes:i||""})}).then(function(){var e=Kt(Zt().mark((function e(t){var n;return Zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.json();case 2:n=e.sent,t.ok?pO.success("Notes saved"):pO.error("Failed saving notes: "+n.message||0);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){pO.error("Failed saving notes: "+e)}));var r,o,i}),1e3),style:{minWidth:"100%",minHeight:"5rem"},placeholder:"Notes for this survey",defaultValue:n.notes||""})),e.createElement("td",null,e.createElement(Lt,{to:"/survey/response/".concat(t.year,"/").concat(n.nren.name),target:"_blank"},e.createElement(Rs,{style:{pointerEvents:"auto",margin:".5rem"},title:"Open the responses of the NREN."},"open")),e.createElement(Rs,{onClick:function(){return function(e,t){return c.apply(this,arguments)}(t.year,n.nren.name)},disabled:""==n.lock_description,style:{pointerEvents:"auto"},title:"Remove the lock from the survey so that another person can open the survey for editing. WARNING: The person that currently has the lock will not be able to save their changes anymore once someone else starts editing!"},"remove lock")))}))))))})))))))},hT=e.forwardRef((({className:e,bsPrefix:t,as:n="span",...r},o)=>(t=Bn(t,"input-group-text"),(0,Mn.jsx)(n,{ref:o,className:Ln()(e,t),...r}))));hT.displayName="InputGroupText";const dT=hT,fT=e.forwardRef((({bsPrefix:t,size:n,hasValidation:r,className:o,as:i="div",...s},a)=>{t=Bn(t,"input-group");const l=(0,e.useMemo)((()=>({})),[]);return(0,Mn.jsx)(WE.Provider,{value:l,children:(0,Mn.jsx)(i,{ref:a,...s,className:Ln()(o,t,n&&`${t}-${n}`,r&&"has-validation")})})}));fT.displayName="InputGroup";const mT=Object.assign(fT,{Text:dT,Radio:e=>(0,Mn.jsx)(dT,{children:(0,Mn.jsx)(Ji,{type:"radio",...e})}),Checkbox:e=>(0,Mn.jsx)(dT,{children:(0,Mn.jsx)(Ji,{type:"checkbox",...e})})});function gT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function yT(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gT(Object(n),!0).forEach((function(t){vn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gT(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function vT(){return(vT=Kt(Zt().mark((function e(){var t;return Zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch("/api/user/list");case 3:return t=e.sent,e.next=6,t.json();case 6:return e.abrupt("return",e.sent);case 9:return e.prev=9,e.t0=e.catch(0),e.abrupt("return",[]);case 12:case"end":return e.stop()}}),e,null,[[0,9]])})))).apply(this,arguments)}function bT(){return(bT=Kt(Zt().mark((function e(){var t;return Zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch("/api/nren/list");case 3:return t=e.sent,e.next=6,t.json();case 6:return e.abrupt("return",e.sent);case 9:return e.prev=9,e.t0=e.catch(0),e.abrupt("return",[]);case 12:case"end":return e.stop()}}),e,null,[[0,9]])})))).apply(this,arguments)}function CT(){return(CT=Kt(Zt().mark((function e(t,n){var r,o,i,s;return Zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=yT({id:t},n),o={method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)},e.next=4,fetch("/api/user/".concat(t),o);case 4:return i=e.sent,e.next=7,i.json();case 7:if(s=e.sent,i.ok){e.next=10;break}throw new Error(s.message);case 10:return pO.success(s.message),e.abrupt("return",s.user);case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function wT(e){return xT.apply(this,arguments)}function xT(){return(xT=Kt(Zt().mark((function e(t){var n,r,o;return Zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(window.confirm("Are you sure you want to delete ".concat(t.name," (").concat(t.email,")?"))){e.next=3;break}return e.abrupt("return",!1);case 3:return n={method:"DELETE",headers:{"Content-Type":"application/json"}},e.next=6,fetch("/api/user/".concat(t.id),n);case 6:return r=e.sent,e.next=9,r.json();case 9:if(o=e.sent,r.ok){e.next=12;break}throw new Error(o.message);case 12:return pO.success(o.message),e.abrupt("return",!0);case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ET=function(e,t){return"admin"!==e.role&&"admin"===t.role?1:"admin"===e.role&&"admin"!==t.role?-1:"user"===e.role&&"user"!==t.role?1:"user"===t.role&&"user"!==e.role?-1:!e.permissions.active&&t.permissions.active?1:e.permissions.active&&!t.permissions.active?-1:e.name.localeCompare(t.name)};const PT=function(){var t,n=Qt((0,e.useState)([]),2),r=n[0],o=n[1],i=Qt((0,e.useState)([]),2),s=i[0],a=i[1],l=(0,e.useContext)(tn),u=l.user,c=l.setUser,p=Qt((0,e.useState)({column:"ID",asc:!0}),2),h=p[0],d=p[1],f=Qt((0,e.useState)(""),2),m=f[0],g=f[1],y=function(t){var n=(0,e.useContext)(Rn),r=n.getConfig,o=n.setConfig,i=r(t);return vn(vn({},t,i),"setConfig",(function(e,n){return o(t,e,n)}))}("user_management"),v=y.setConfig,b=y.user_management,C=function(e){if(!b)return!0;var t=b.shownColumns;if(!t)return!0;var n=t[e];return null==n||n};(0,e.useEffect)((function(){(function(){return vT.apply(this,arguments)})().then((function(e){o(e)})),function(){return bT.apply(this,arguments)}().then((function(e){a(e.sort((function(e,t){return e.name.localeCompare(t.name)})))}))}),[]);var w=function(e,t){var n=r.findIndex((function(e){return e.id===t.id})),i=fn(r),s=e.target.name,a={};a[s]="active"===s?e.target.checked:e.target.value,function(e,t){return CT.apply(this,arguments)}(t.id,a).then((function(e){e.id===u.id?c(e):(i[n]=e,o(i))})).catch((function(e){pO.error(e.message)}))},x=function(e){return function(t,n){var r=t[e],o=n[e];if("nrens"===e)return 0===t.nrens.length&&0===n.nrens.length?ET(t,n):0===t.nrens.length?-1:0===n.nrens.length?1:t.nrens[0].localeCompare(n.nrens[0]);if("string"!=typeof r||"string"!=typeof o)return ET(t,n);var i=r.localeCompare(o);return 0===i?ET(t,n):i}},E=["ID","Active","Role","Email","Full Name","OIDC Sub","NREN","Actions"],P=vn(vn(vn(vn(vn({},E[1],(function(e,t){return e.permissions.active&&!t.permissions.active?1:!e.permissions.active&&t.permissions.active?-1:ET(e,t)})),E[2],x("role")),E[3],x("email")),E[4],x("name")),E[6],x("nrens")),S={};Array.from(Object.keys(P)).includes(h.column)?S[h.column]={"aria-sort":h.asc?"ascending":"descending"}:S[E[0]]={"aria-sort":h.asc?"ascending":"descending"};var _=null!==(t=P[h.column])&&void 0!==t?t:ET,O=m?r.filter((function(e){return e.email.includes(m)||e.name.includes(m)})):r,T=O.filter((function(e){return e.id!==u.id})).sort(_);return h.asc||T.reverse(),e.createElement(e.Fragment,null,e.createElement(h_,null),e.createElement(cO,null),e.createElement(Qn,{className:"py-5 grey-container"},e.createElement(Gn,{className:"d-flex justify-content-center align-items-center flex-column"},e.createElement("div",{className:"text-center w-100 mb-3"},e.createElement("h3",null,"User Management Page")),e.createElement(tT,{className:"mb-3",style:{width:"30rem"}},e.createElement(tT.Item,{eventKey:"0"},e.createElement(tT.Header,null,e.createElement("span",{className:"me-2"},"Column Visibility"),e.createElement("small",{className:"text-muted"},"Choose which columns to display")),e.createElement(tT.Body,null,e.createElement(Ps.Control,{as:"div",className:"p-3"},e.createElement("small",{className:"text-muted mb-2 d-block"},"Select which columns you want to display in the table below. Unchecked columns will be hidden."),e.createElement("div",{className:"d-grid",style:{gridTemplateColumns:"repeat(auto-fill, minmax(150px, 1fr))",gap:"10px"}},E.map((function(t){return e.createElement(Ps.Check,{key:t,type:"checkbox",id:"column-".concat(t),label:t,checked:C(t),onChange:function(e){return function(e,t){var n=null!=b?b:{},r=null==n?void 0:n.shownColumns;v(yT(yT({},n),{},r?{shownColumns:yT(yT({},r),{},vn({},e,t))}:{shownColumns:vn({},e,t)}))}(t,e.target.checked)}})}))))))),e.createElement(mT,{className:"mb-3",style:{width:"30rem"}},e.createElement(mT.Text,{id:"search-text"},"Search"),e.createElement(Ps.Control,{placeholder:"Search by email/name","aria-label":"Search",onInput:(0,uT.debounce)((function(e){return g(e.target.value)}),200)}),e.createElement(Rs,{variant:"outline-secondary",onClick:function(){g("")}},"Clear"))),e.createElement("div",{className:"d-flex justify-content-center"},e.createElement("div",{style:{maxWidth:"100rem"}},e.createElement(cP,{className:"user-management-table",bordered:!0},e.createElement("colgroup",null,C(E[0])&&e.createElement("col",{span:1,style:{width:"8rem"}}),C(E[1])&&e.createElement("col",{span:1,style:{width:"3rem"}}),C(E[2])&&e.createElement("col",{span:1,style:{width:"4.5rem"}}),C(E[3])&&e.createElement("col",{span:1,style:{width:"7rem"}}),C(E[4])&&e.createElement("col",{span:1,style:{width:"5rem"}}),C(E[5])&&e.createElement("col",{span:1,style:{width:"5rem"}}),C(E[6])&&e.createElement("col",{span:1,style:{width:"6rem"}}),C(E[7])&&e.createElement("col",{span:1,style:{width:"3rem"}})),e.createElement("thead",null,e.createElement("tr",null,E.map((function(t){return C(t)&&e.createElement("th",SE({key:t},S[t],{onClick:function(){return function(e){e===h.column?d({column:e,asc:!h.asc}):d({column:e,asc:!0})}(t)},className:"sortable fixed-column",style:{border:"1px solid #ddd"}}),t)})))),e.createElement("tbody",null,(m?[]:[u]).concat(T).map((function(t){return e.createElement("tr",{key:t.id,style:{fontWeight:t.id==u.id?"bold":"normal"}},C(E[0])&&e.createElement("td",{style:{border:"1px dotted #ddd"}},t.id),C(E[1])&&e.createElement("td",{style:{border:"1px dotted #ddd"}},t.id==u.id?e.createElement(DC,null):e.createElement("input",{type:"checkbox",name:"active",checked:t.permissions.active,onChange:function(e){return w(e,t)}})),C(E[2])&&e.createElement("td",{style:{border:"1px dotted #ddd"}},t.id==u.id?t.role.charAt(0).toUpperCase()+t.role.slice(1):e.createElement("select",{name:"role",defaultValue:t.role,onChange:function(e){return w(e,t)},style:{width:"100%"}},e.createElement("option",{value:"admin"},"Admin"),e.createElement("option",{value:"user"},"User"),e.createElement("option",{value:"observer"},"Observer"))),C(E[3])&&e.createElement("td",{style:{border:"1px dotted #ddd"}},t.email),C(E[4])&&e.createElement("td",{style:{border:"1px dotted #ddd"}},t.name),C(E[5])&&e.createElement("td",{style:{border:"1px dotted #ddd"}},t.oidc_sub),C(E[6])&&e.createElement("td",{style:{border:"1px dotted #ddd"}},e.createElement("select",{name:"nren",multiple:!1,value:t.nrens.length>0?(n=t.nrens[0],null===(i=s.find((function(e){return e.id==n||e.name==n})))||void 0===i?void 0:i.id):"",onChange:function(e){return w(e,t)}},e.createElement("option",{value:""},"Select NREN"),s.map((function(t){return e.createElement("option",{key:t.id,value:t.id},t.name)})))),C(E[7])&&e.createElement("td",{style:{border:"1px dotted #ddd"}},t.id!==u.id&&e.createElement(Rs,{variant:"danger",onClick:Kt(Zt().mark((function e(){return Zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.id!==u.id){e.next=3;break}return pO.error("You cannot delete yourself"),e.abrupt("return");case 3:return e.next=5,wT(t);case 5:e.sent&&o(r.filter((function(e){return e.id!==t.id})));case 7:case"end":return e.stop()}}),e)})))},"Delete")));var n,i}))))))))};var ST,_T=function(){var t="/"!==ze().pathname;return e.createElement(e.Fragment,null,e.createElement(kn,null,e.createElement(Zn,null),e.createElement("main",{className:"grow"},t?e.createElement(ht,null):e.createElement(Rr,null)),e.createElement(Is,null)),e.createElement(tr,null))},OT=(ST=[{path:"",element:e.createElement(_T,null),children:[{path:"/budget",element:e.createElement(lP,null)},{path:"/funding",element:e.createElement(KP,null)},{path:"/employment",element:e.createElement(rS,{key:"staffgraph"})},{path:"/traffic-ratio",element:e.createElement(e_,null)},{path:"/roles",element:e.createElement(rS,{roles:!0,key:"staffgraphroles"})},{path:"/employee-count",element:e.createElement(oS,null)},{path:"/charging",element:e.createElement(dP,null)},{path:"/suborganisations",element:e.createElement(sS,null)},{path:"/parentorganisation",element:e.createElement(JP,null)},{path:"/ec-projects",element:e.createElement(mP,null)},{path:"/policy",element:e.createElement(gS,null)},{path:"/traffic-volume",element:e.createElement(n_,null)},{path:"/data",element:e.createElement(to,null)},{path:"/institutions-urls",element:e.createElement(SS,null)},{path:"/connected-proportion",element:e.createElement(VS,{page:An.ConnectedProportion,key:An.ConnectedProportion})},{path:"/connectivity-level",element:e.createElement(VS,{page:An.ConnectivityLevel,key:An.ConnectivityLevel})},{path:"/connectivity-growth",element:e.createElement(VS,{page:An.ConnectivityGrowth,key:An.ConnectivityGrowth})},{path:"/connection-carrier",element:e.createElement(VS,{page:An.ConnectionCarrier,key:An.ConnectionCarrier})},{path:"/connectivity-load",element:e.createElement(VS,{page:An.ConnectivityLoad,key:An.ConnectivityLoad})},{path:"/commercial-charging-level",element:e.createElement(VS,{page:An.CommercialChargingLevel,key:An.CommercialChargingLevel})},{path:"/commercial-connectivity",element:e.createElement(VS,{page:An.CommercialConnectivity,key:An.CommercialConnectivity})},{path:"/network-services",element:e.createElement(a_,{category:Nn.network_services,key:Nn.network_services})},{path:"/isp-support-services",element:e.createElement(a_,{category:Nn.isp_support,key:Nn.isp_support})},{path:"/security-services",element:e.createElement(a_,{category:Nn.security,key:Nn.security})},{path:"/identity-services",element:e.createElement(a_,{category:Nn.identity,key:Nn.identity})},{path:"/collaboration-services",element:e.createElement(a_,{category:Nn.collaboration,key:Nn.collaboration})},{path:"/multimedia-services",element:e.createElement(a_,{category:Nn.multimedia,key:Nn.multimedia})},{path:"/storage-and-hosting-services",element:e.createElement(a_,{category:Nn.storage_and_hosting,key:Nn.storage_and_hosting})},{path:"/professional-services",element:e.createElement(a_,{category:Nn.professional_services,key:Nn.professional_services})},{path:"/dark-fibre-lease",element:e.createElement(FS,{national:!0,key:"darkfibrenational"})},{path:"/dark-fibre-lease-international",element:e.createElement(FS,{key:"darkfibreinternational"})},{path:"/dark-fibre-installed",element:e.createElement(qS,null)},{path:"/remote-campuses",element:e.createElement(kS,null)},{path:"/eosc-listings",element:e.createElement(mS,null)},{path:"/fibre-light",element:e.createElement(zS,null)},{path:"/monitoring-tools",element:e.createElement(WS,null)},{path:"/pert-team",element:e.createElement(JS,null)},{path:"/passive-monitoring",element:e.createElement(KS,null)},{path:"/alien-wave",element:e.createElement(AS,null)},{path:"/alien-wave-internal",element:e.createElement(NS,null)},{path:"/external-connections",element:e.createElement(HS,null)},{path:"/ops-automation",element:e.createElement(YS,null)},{path:"/network-automation",element:e.createElement(DS,null)},{path:"/traffic-stats",element:e.createElement(t_,null)},{path:"/weather-map",element:e.createElement(r_,null)},{path:"/network-map",element:e.createElement($S,null)},{path:"/nfv",element:e.createElement(QS,null)},{path:"/certificate-providers",element:e.createElement(jS,null)},{path:"/siem-vendors",element:e.createElement(ZS,null)},{path:"/capacity-largest-link",element:e.createElement(MS,null)},{path:"/capacity-core-ip",element:e.createElement(LS,null)},{path:"/non-rne-peers",element:e.createElement(GS,null)},{path:"/iru-duration",element:e.createElement(US,null)},{path:"/audits",element:e.createElement(aS,null)},{path:"/business-continuity",element:e.createElement(lS,null)},{path:"/crisis-management",element:e.createElement(hS,null)},{path:"/crisis-exercise",element:e.createElement(pS,null)},{path:"/central-procurement",element:e.createElement(uS,null)},{path:"/security-control",element:e.createElement(yS,null)},{path:"/services-offered",element:e.createElement(xS,null)},{path:"/service-management-framework",element:e.createElement(bS,null)},{path:"/service-level-targets",element:e.createElement(vS,null)},{path:"/corporate-strategy",element:e.createElement(cS,null)},{path:"survey/admin/surveys",element:e.createElement(pT,null)},{path:"survey/admin/users",element:e.createElement(PT,null)},{path:"survey/admin/inspect/:year",element:e.createElement(AO,{loadFrom:"/api/response/inspect/"})},{path:"survey/admin/try/:year",element:e.createElement(AO,{loadFrom:"/api/response/try/"})},{path:"survey/response/:year/:nren",element:e.createElement(AO,{loadFrom:"/api/response/load/"})},{path:"survey/*",element:e.createElement(d_,null)},{path:"*",element:e.createElement(Rr,null)}]}],function(e){const t=e.window?e.window:"undefined"!=typeof window?window:void 0,n=void 0!==t&&void 0!==t.document&&void 0!==t.document.createElement;o(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r,s,l,u=e.mapRouteProperties||Y,f={},m=p(e.routes,u,void 0,f),g=e.basename||"/",y=e.dataStrategy||ae,v=e.patchRoutesOnNavigation,b={...e.future},C=null,w=new Set,x=null,E=null,P=null,S=null!=e.hydrationData,_=h(m,e.history.location,g),T=null;if(null==_&&!v){let t=be(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=ve(m);_=n,T={[r.id]:t}}if(_&&!e.hydrationData&&Ze(_,m,e.history.location.pathname).active&&(_=null),_)if(_.some((e=>e.route.lazy)))s=!1;else if(_.some((e=>e.route.loader))){let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null;if(n){let e=_.findIndex((e=>void 0!==n[e.route.id]));s=_.slice(0,e+1).every((e=>!ne(e.route,t,n)))}else s=_.every((e=>!ne(e.route,t,n)))}else s=!0;else{s=!1,_=[];let t=Ze(null,m,e.history.location.pathname);t.active&&t.matches&&(_=t.matches)}let V,R,I={historyAction:e.history.action,location:e.history.location,matches:_,initialized:s,navigation:U,restoreScrollPosition:null==e.hydrationData&&null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||T,fetchers:new Map,blockers:new Map},k="POP",A=!1,N=!1,D=new Map,L=null,j=!1,F=!1,q=new Set,B=new Map,H=0,$=-1,J=new Map,ee=new Set,re=new Map,oe=new Map,se=new Set,he=new Map,de=null;function we(e,t={}){I={...I,...e};let n=[],r=[];I.fetchers.forEach(((e,t)=>{"idle"===e.state&&(se.has(t)?n.push(t):r.push(t))})),se.forEach((e=>{I.fetchers.has(e)||B.has(e)||n.push(e)})),[...w].forEach((e=>e(I,{deletedFetchers:n,viewTransitionOpts:t.viewTransitionOpts,flushSync:!0===t.flushSync}))),n.forEach((e=>Be(e))),r.forEach((e=>I.fetchers.delete(e)))}function Se(t,n,{flushSync:o}={}){let i,s=null!=I.actionData&&null!=I.navigation.formMethod&&Oe(I.navigation.formMethod)&&"loading"===I.navigation.state&&!0!==t.state?._isRedirect;i=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:s?I.actionData:null;let a=n.loaderData?me(I.loaderData,n.loaderData,n.matches||[],n.errors):I.loaderData,l=I.blockers;l.size>0&&(l=new Map(l),l.forEach(((e,t)=>l.set(t,Q))));let u,c=!0===A||null!=I.navigation.formMethod&&Oe(I.navigation.formMethod)&&!0!==t.state?._isRedirect;if(r&&(m=r,r=void 0),j||"POP"===k||("PUSH"===k?e.history.push(t,t.state):"REPLACE"===k&&e.history.replace(t,t.state)),"POP"===k){let e=D.get(I.location.pathname);e&&e.has(t.pathname)?u={currentLocation:I.location,nextLocation:t}:D.has(t.pathname)&&(u={currentLocation:t,nextLocation:I.location})}else if(N){let e=D.get(I.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),D.set(I.location.pathname,e)),u={currentLocation:I.location,nextLocation:t}}we({...n,actionData:i,loaderData:a,historyAction:k,location:t,initialized:!0,navigation:U,revalidation:"idle",restoreScrollPosition:Je(t,n.matches||I.matches),preventScrollReset:c,blockers:l},{viewTransitionOpts:u,flushSync:!0===o}),k="POP",A=!1,N=!1,j=!1,F=!1,de?.resolve(),de=null}async function _e(t,n,o){V&&V.abort(),V=null,k=t,j=!0===(o&&o.startUninterruptedRevalidation),function(e,t){if(x&&P){let n=Ke(e,t);x[n]=P()}}(I.location,I.matches),A=!0===(o&&o.preventScrollReset),N=!0===(o&&o.enableViewTransition);let i=r||m,s=o&&o.overrideNavigation,a=h(i,n,g),l=!0===(o&&o.flushSync),u=Ze(a,i,n.pathname);if(u.active&&u.matches&&(a=u.matches),!a){let{error:e,notFoundMatches:t,route:r}=Ye(n.pathname);return void Se(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:l})}if(I.initialized&&!F&&function(e,t){return e.pathname===t.pathname&&e.search===t.search&&(""===e.hash?""!==t.hash:e.hash===t.hash||""!==t.hash)}(I.location,n)&&!(o&&o.submission&&Oe(o.submission.formMethod)))return void Se(n,{matches:a},{flushSync:l});V=new AbortController;let c,p=pe(e.history,n,V.signal,o&&o.submission);if(o&&o.pendingError)c=[ye(a).route.id,{type:"error",error:o.pendingError}];else if(o&&o.submission&&Oe(o.submission.formMethod)){let t=await async function(e,t,n,r,o,i={}){Me();let s,a=function(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}(t,n);if(we({navigation:a},{flushSync:!0===i.flushSync}),o){let n=await Xe(r,t.pathname,e.signal);if("aborted"===n.type)return{shortCircuited:!0};if("error"===n.type){let e=ye(n.partialMatches).route.id;return{matches:n.partialMatches,pendingActionResult:[e,{type:"error",error:n.error}]}}if(!n.matches){let{notFoundMatches:e,error:n,route:r}=Ye(t.pathname);return{matches:e,pendingActionResult:[r.id,{type:"error",error:n}]}}r=n.matches}let l=Ve(r,t);if(l.route.action||l.route.lazy){if(s=(await De("action",I,e,[l],r,null))[l.route.id],e.signal.aborted)return{shortCircuited:!0}}else s={type:"error",error:be(405,{method:e.method,pathname:t.pathname,routeId:l.route.id})};if(Pe(s)){let t;return t=i&&null!=i.replace?i.replace:ce(s.response.headers.get("Location"),new URL(e.url),g)===I.location.pathname+I.location.search,await Ne(e,s,!0,{submission:n,replace:t}),{shortCircuited:!0}}if(Ee(s)){let e=ye(r,l.route.id);return!0!==(i&&i.replace)&&(k="PUSH"),{matches:r,pendingActionResult:[e.route.id,s]}}return{matches:r,pendingActionResult:[l.route.id,s]}}(p,n,o.submission,a,u.active,{replace:o.replace,flushSync:l});if(t.shortCircuited)return;if(t.pendingActionResult){let[e,r]=t.pendingActionResult;if(Ee(r)&&M(r.error)&&404===r.error.status)return V=null,void Se(n,{matches:t.matches,loaderData:{},errors:{[e]:r.error}})}a=t.matches||a,c=t.pendingActionResult,s=Ie(n,o.submission),l=!1,u.active=!1,p=pe(e.history,p.url,p.signal)}let{shortCircuited:d,matches:f,loaderData:y,errors:v}=await async function(t,n,o,i,s,a,l,u,c,p,h){let d=s||Ie(n,a),f=a||l||Re(d),y=!j&&!c;if(i){if(y){let e=Te(h);we({navigation:d,...void 0!==e?{actionData:e}:{}},{flushSync:p})}let e=await Xe(o,n.pathname,t.signal);if("aborted"===e.type)return{shortCircuited:!0};if("error"===e.type){let t=ye(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}if(!e.matches){let{error:e,notFoundMatches:t,route:r}=Ye(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}o=e.matches}let v=r||m,[b,C]=te(e.history,I,o,f,n,!0===c,F,q,se,re,ee,v,g,h);if($=++H,0===b.length&&0===C.length){let e=Ue();return Se(n,{matches:o,loaderData:{},errors:h&&Ee(h[1])?{[h[0]]:h[1].error}:null,...ge(h),...e?{fetchers:new Map(I.fetchers)}:{}},{flushSync:p}),{shortCircuited:!0}}if(y){let e={};if(!i){e.navigation=d;let t=Te(h);void 0!==t&&(e.actionData=t)}C.length>0&&(e.fetchers=function(e){return e.forEach((e=>{let t=I.fetchers.get(e.key),n=ke(void 0,t?t.data:void 0);I.fetchers.set(e.key,n)})),new Map(I.fetchers)}(C)),we(e,{flushSync:p})}C.forEach((e=>{He(e.key),e.controller&&B.set(e.key,e.controller)}));let w=()=>C.forEach((e=>He(e.key)));V&&V.signal.addEventListener("abort",w);let{loaderResults:x,fetcherResults:E}=await Le(I,o,b,C,t);if(t.signal.aborted)return{shortCircuited:!0};V&&V.signal.removeEventListener("abort",w),C.forEach((e=>B.delete(e.key)));let P=Ce(x);if(P)return await Ne(t,P.result,!0,{replace:u}),{shortCircuited:!0};if(P=Ce(E),P)return ee.add(P.key),await Ne(t,P.result,!0,{replace:u}),{shortCircuited:!0};let{loaderData:S,errors:_}=fe(I,o,x,h,C,E);c&&I.errors&&(_={...I.errors,..._});let O=Ue(),T=We($);return{matches:o,loaderData:S,errors:_,...O||T||C.length>0?{fetchers:new Map(I.fetchers)}:{}}}(p,n,a,u.active,s,o&&o.submission,o&&o.fetcherSubmission,o&&o.replace,o&&!0===o.initialHydration,l,c);d||(V=null,Se(n,{matches:f||a,...ge(c),loaderData:y,errors:v}))}function Te(e){return e&&!Ee(e[1])?{[e[0]]:e[1].data}:I.actionData?0===Object.keys(I.actionData).length?null:I.actionData:void 0}async function Ne(r,i,s,{submission:l,fetcherSubmission:u,preventScrollReset:c,replace:p}={}){i.response.headers.has("X-Remix-Revalidate")&&(F=!0);let h=i.response.headers.get("Location");o(h,"Expected a Location header on the redirect Response"),h=ce(h,new URL(r.url),g);let d=a(I.location,h,{_isRedirect:!0});if(n){let n=!1;if(i.response.headers.has("X-Remix-Reload-Document"))n=!0;else if(G.test(h)){const r=e.history.createURL(h);n=r.origin!==t.location.origin||null==O(r.pathname,g)}if(n)return void(p?t.location.replace(h):t.location.assign(h))}V=null;let f=!0===p||i.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:m,formAction:y,formEncType:v}=I.navigation;!l&&!u&&m&&y&&v&&(l=Re(I.navigation));let b=l||u;if(z.has(i.response.status)&&b&&Oe(b.formMethod))await _e(f,d,{submission:{...b,formAction:h},preventScrollReset:c||A,enableViewTransition:s?N:void 0});else{let e=Ie(d,l);await _e(f,d,{overrideNavigation:e,fetcherSubmission:u,preventScrollReset:c||A,enableViewTransition:s?N:void 0})}}async function De(e,t,n,r,s,a){let l,p={};try{l=await async function(e,t,n,r,s,a,l,u,p,h){let d=a.map((e=>e.route.lazy?async function(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let s=n[e.id];o(s,"No route found in manifest");let a={};for(let e in r){let t=void 0!==s[e]&&"hasErrorBoundary"!==e;i(!t,`Route "${s.id}" has a static property "${e}" defined but its lazy function is also returning a value for this property. The lazy route property "${e}" will be ignored.`),t||c.has(e)||(a[e]=r[e])}Object.assign(s,a),Object.assign(s,{...t(s),lazy:void 0})}(e.route,p,u):void 0)),f=a.map(((e,n)=>{let o=d[n],i=s.some((t=>t.route.id===e.route.id));return{...e,shouldLoad:i,resolve:async n=>(n&&"GET"===r.method&&(e.route.lazy||e.route.loader)&&(i=!0),i?async function(e,t,n,r,o,i){let s,a,l=r=>{let s,l=new Promise(((e,t)=>s=t));a=()=>s(),t.signal.addEventListener("abort",a);let u=o=>"function"!=typeof r?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${e}" [routeId: ${n.route.id}]`)):r({request:t,params:n.params,context:i},...void 0!==o?[o]:[]),c=(async()=>{try{return{type:"data",result:await(o?o((e=>u(e))):u())}}catch(e){return{type:"error",result:e}}})();return Promise.race([c,l])};try{let o=n.route[e];if(r)if(o){let e,[t]=await Promise.all([l(o).catch((t=>{e=t})),r]);if(void 0!==e)throw e;s=t}else{if(await r,o=n.route[e],!o){if("action"===e){let e=new URL(t.url),r=e.pathname+e.search;throw be(405,{method:t.method,pathname:r,routeId:n.route.id})}return{type:"data",result:void 0}}s=await l(o)}else{if(!o){let e=new URL(t.url);throw be(404,{pathname:e.pathname+e.search})}s=await l(o)}}catch(e){return{type:"error",result:e}}finally{a&&t.signal.removeEventListener("abort",a)}return s}(t,r,e,o,n,h):Promise.resolve({type:"data",result:void 0}))}})),m=await e({matches:f,request:r,params:a[0].params,fetcherKey:l,context:h});try{await Promise.all(d)}catch(e){}return m}(y,e,0,n,r,s,a,f,u)}catch(e){return r.forEach((t=>{p[t.route.id]={type:"error",error:e}})),p}for(let[e,t]of Object.entries(l))if(xe(t)){let r=t.result;p[e]={type:"redirect",response:ue(r,n,e,s,g)}}else p[e]=await le(t);return p}async function Le(t,n,r,o,i){let s=De("loader",0,i,r,n,null),a=Promise.all(o.map((async t=>{if(t.matches&&t.match&&t.controller){let n=(await De("loader",0,pe(e.history,t.path,t.controller.signal),[t.match],t.matches,t.key))[t.match.route.id];return{[t.key]:n}}return Promise.resolve({[t.key]:{type:"error",error:be(404,{pathname:t.path})}})})));return{loaderResults:await s,fetcherResults:(await a).reduce(((e,t)=>Object.assign(e,t)),{})}}function Me(){F=!0,re.forEach(((e,t)=>{B.has(t)&&q.add(t),He(t)}))}function je(e,t,n={}){I.fetchers.set(e,t),we({fetchers:new Map(I.fetchers)},{flushSync:!0===(n&&n.flushSync)})}function Fe(e,t,n,r={}){let o=ye(I.matches,t);Be(e),we({errors:{[o.route.id]:n},fetchers:new Map(I.fetchers)},{flushSync:!0===(r&&r.flushSync)})}function qe(e){return oe.set(e,(oe.get(e)||0)+1),se.has(e)&&se.delete(e),I.fetchers.get(e)||W}function Be(e){let t=I.fetchers.get(e);!B.has(e)||t&&"loading"===t.state&&J.has(e)||He(e),re.delete(e),J.delete(e),ee.delete(e),se.delete(e),q.delete(e),I.fetchers.delete(e)}function He(e){let t=B.get(e);t&&(t.abort(),B.delete(e))}function ze(e){for(let t of e){let e=Ae(qe(t).data);I.fetchers.set(t,e)}}function Ue(){let e=[],t=!1;for(let n of ee){let r=I.fetchers.get(n);o(r,`Expected fetcher: ${n}`),"loading"===r.state&&(ee.delete(n),e.push(n),t=!0)}return ze(e),t}function We(e){let t=[];for(let[n,r]of J)if(r<e){let e=I.fetchers.get(n);o(e,`Expected fetcher: ${n}`),"loading"===e.state&&(He(n),J.delete(n),t.push(n))}return ze(t),t.length>0}function Qe(e){I.blockers.delete(e),he.delete(e)}function $e(e,t){let n=I.blockers.get(e)||Q;o("unblocked"===n.state&&"blocked"===t.state||"blocked"===n.state&&"blocked"===t.state||"blocked"===n.state&&"proceeding"===t.state||"blocked"===n.state&&"unblocked"===t.state||"proceeding"===n.state&&"unblocked"===t.state,`Invalid blocker state transition: ${n.state} -> ${t.state}`);let r=new Map(I.blockers);r.set(e,t),we({blockers:r})}function Ge({currentLocation:e,nextLocation:t,historyAction:n}){if(0===he.size)return;he.size>1&&i(!1,"A router only supports one blocker at a time");let r=Array.from(he.entries()),[o,s]=r[r.length-1],a=I.blockers.get(o);return a&&"proceeding"===a.state?void 0:s({currentLocation:e,nextLocation:t,historyAction:n})?o:void 0}function Ye(e){let t=be(404,{pathname:e}),n=r||m,{matches:o,route:i}=ve(n);return{notFoundMatches:o,route:i,error:t}}function Ke(e,t){if(E){return E(e,t.map((e=>function(e,t){let{route:n,pathname:r,params:o}=e;return{id:n.id,pathname:r,params:o,data:t[n.id],handle:n.handle}}(e,I.loaderData))))||e.key}return e.key}function Je(e,t){if(x){let n=Ke(e,t),r=x[n];if("number"==typeof r)return r}return null}function Ze(e,t,n){if(v){if(!e)return{active:!0,matches:d(t,n,g,!0)||[]};if(Object.keys(e[0].params).length>0)return{active:!0,matches:d(t,n,g,!0)}}return{active:!1,matches:null}}async function Xe(e,t,n){if(!v)return{type:"success",matches:e};let o=e;for(;;){let e=null==r,i=r||m,s=f;try{await v({path:t,matches:o,patch:(e,t)=>{n.aborted||ie(e,t,i,s,u)}})}catch(e){return{type:"error",error:e,partialMatches:o}}finally{e&&!n.aborted&&(m=[...m])}if(n.aborted)return{type:"aborted"};let a=h(i,t,g);if(a)return{type:"success",matches:a};let l=d(i,t,g,!0);if(!l||o.length===l.length&&o.every(((e,t)=>e.route.id===l[t].route.id)))return{type:"success",matches:null};o=l}}return l={get basename(){return g},get future(){return b},get state(){return I},get routes(){return m},get window(){return t},initialize:function(){if(C=e.history.listen((({action:t,location:n,delta:r})=>{if(R)return R(),void(R=void 0);i(0===he.size||null!=r,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs.  This can also happen if you are using createHashRouter and the user manually changes the URL.");let o=Ge({currentLocation:I.location,nextLocation:n,historyAction:t});if(o&&null!=r){let t=new Promise((e=>{R=e}));return e.history.go(-1*r),void $e(o,{state:"blocked",location:n,proceed(){$e(o,{state:"proceeding",proceed:void 0,reset:void 0,location:n}),t.then((()=>e.history.go(r)))},reset(){let e=new Map(I.blockers);e.set(o,Q),we({blockers:e})}})}return _e(t,n)})),n){!function(e,t){try{let n=e.sessionStorage.getItem(K);if(n){let e=JSON.parse(n);for(let[n,r]of Object.entries(e||{}))r&&Array.isArray(r)&&t.set(n,new Set(r||[]))}}catch(e){}}(t,D);let e=()=>function(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(K,JSON.stringify(n))}catch(e){i(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}(t,D);t.addEventListener("pagehide",e),L=()=>t.removeEventListener("pagehide",e)}return I.initialized||_e("POP",I.location,{initialHydration:!0}),l},subscribe:function(e){return w.add(e),()=>w.delete(e)},enableScrollRestoration:function(e,t,n){if(x=e,P=t,E=n||null,!S&&I.navigation===U){S=!0;let e=Je(I.location,I.matches);null!=e&&we({restoreScrollPosition:e})}return()=>{x=null,P=null,E=null}},navigate:async function t(n,r){if("number"==typeof n)return void e.history.go(n);let o=Z(I.location,I.matches,g,n,r?.fromRouteId,r?.relative),{path:i,submission:s,error:l}=X(!1,o,r),u=I.location,c=a(I.location,i,r&&r.state);c={...c,...e.history.encodeLocation(c)};let p=r&&null!=r.replace?r.replace:void 0,h="PUSH";!0===p?h="REPLACE":!1===p||null!=s&&Oe(s.formMethod)&&s.formAction===I.location.pathname+I.location.search&&(h="REPLACE");let d=r&&"preventScrollReset"in r?!0===r.preventScrollReset:void 0,f=!0===(r&&r.flushSync),m=Ge({currentLocation:u,nextLocation:c,historyAction:h});m?$e(m,{state:"blocked",location:c,proceed(){$e(m,{state:"proceeding",proceed:void 0,reset:void 0,location:c}),t(n,r)},reset(){let e=new Map(I.blockers);e.set(m,Q),we({blockers:e})}}):await _e(h,c,{submission:s,pendingError:l,preventScrollReset:d,replace:r&&r.replace,enableViewTransition:r&&r.viewTransition,flushSync:f})},fetch:async function(t,n,i,s){He(t);let a=!0===(s&&s.flushSync),l=r||m,u=Z(I.location,I.matches,g,i,n,s?.relative),c=h(l,u,g),p=Ze(c,l,u);if(p.active&&p.matches&&(c=p.matches),!c)return void Fe(t,n,be(404,{pathname:u}),{flushSync:a});let{path:d,submission:f,error:y}=X(!0,u,s);if(y)return void Fe(t,n,y,{flushSync:a});let v=Ve(c,d),b=!0===(s&&s.preventScrollReset);f&&Oe(f.formMethod)?await async function(t,n,i,s,a,l,u,c,p){function d(e){if(!e.route.action&&!e.route.lazy){let e=be(405,{method:p.formMethod,pathname:i,routeId:n});return Fe(t,n,e,{flushSync:u}),!0}return!1}if(Me(),re.delete(t),!l&&d(s))return;let f=I.fetchers.get(t);je(t,function(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}(p,f),{flushSync:u});let y=new AbortController,v=pe(e.history,i,y.signal,p);if(l){let e=await Xe(a,i,v.signal);if("aborted"===e.type)return;if("error"===e.type)return void Fe(t,n,e.error,{flushSync:u});if(!e.matches)return void Fe(t,n,be(404,{pathname:i}),{flushSync:u});if(d(s=Ve(a=e.matches,i)))return}B.set(t,y);let b=H,C=(await De("action",0,v,[s],a,t))[s.route.id];if(v.signal.aborted)return void(B.get(t)===y&&B.delete(t));if(se.has(t)){if(Pe(C)||Ee(C))return void je(t,Ae(void 0))}else{if(Pe(C))return B.delete(t),$>b?void je(t,Ae(void 0)):(ee.add(t),je(t,ke(p)),Ne(v,C,!1,{fetcherSubmission:p,preventScrollReset:c}));if(Ee(C))return void Fe(t,n,C.error)}let w=I.navigation.location||I.location,x=pe(e.history,w,y.signal),E=r||m,P="idle"!==I.navigation.state?h(E,I.navigation.location,g):I.matches;o(P,"Didn't find any matches after fetcher action");let S=++H;J.set(t,S);let _=ke(p,C.data);I.fetchers.set(t,_);let[O,T]=te(e.history,I,P,p,w,!1,F,q,se,re,ee,E,g,[s.route.id,C]);T.filter((e=>e.key!==t)).forEach((e=>{let t=e.key,n=I.fetchers.get(t),r=ke(void 0,n?n.data:void 0);I.fetchers.set(t,r),He(t),e.controller&&B.set(t,e.controller)})),we({fetchers:new Map(I.fetchers)});let R=()=>T.forEach((e=>He(e.key)));y.signal.addEventListener("abort",R);let{loaderResults:A,fetcherResults:N}=await Le(0,P,O,T,x);if(y.signal.aborted)return;y.signal.removeEventListener("abort",R),J.delete(t),B.delete(t),T.forEach((e=>B.delete(e.key)));let D=Ce(A);if(D)return Ne(x,D.result,!1,{preventScrollReset:c});if(D=Ce(N),D)return ee.add(D.key),Ne(x,D.result,!1,{preventScrollReset:c});let{loaderData:L,errors:M}=fe(I,P,A,void 0,T,N);if(I.fetchers.has(t)){let e=Ae(C.data);I.fetchers.set(t,e)}We(S),"loading"===I.navigation.state&&S>$?(o(k,"Expected pending action"),V&&V.abort(),Se(I.navigation.location,{matches:P,loaderData:L,errors:M,fetchers:new Map(I.fetchers)})):(we({errors:M,loaderData:me(I.loaderData,L,P,M),fetchers:new Map(I.fetchers)}),F=!1)}(t,n,d,v,c,p.active,a,b,f):(re.set(t,{routeId:n,path:d}),await async function(t,n,r,o,i,s,a,l,u){let c=I.fetchers.get(t);je(t,ke(u,c?c.data:void 0),{flushSync:a});let p=new AbortController,h=pe(e.history,r,p.signal);if(s){let e=await Xe(i,r,h.signal);if("aborted"===e.type)return;if("error"===e.type)return void Fe(t,n,e.error,{flushSync:a});if(!e.matches)return void Fe(t,n,be(404,{pathname:r}),{flushSync:a});o=Ve(i=e.matches,r)}B.set(t,p);let d=H,f=(await De("loader",0,h,[o],i,t))[o.route.id];if(B.get(t)===p&&B.delete(t),!h.signal.aborted){if(!se.has(t))return Pe(f)?$>d?void je(t,Ae(void 0)):(ee.add(t),void await Ne(h,f,!1,{preventScrollReset:l})):void(Ee(f)?Fe(t,n,f.error):je(t,Ae(f.data)));je(t,Ae(void 0))}}(t,n,d,v,c,p.active,a,b,f))},revalidate:function(){de||(de=function(){let e,t,n=new Promise(((r,o)=>{e=async e=>{r(e);try{await n}catch(e){}},t=async e=>{o(e);try{await n}catch(e){}}}));return{promise:n,resolve:e,reject:t}}()),Me(),we({revalidation:"loading"});let e=de.promise;return"submitting"===I.navigation.state?e:"idle"===I.navigation.state?(_e(I.historyAction,I.location,{startUninterruptedRevalidation:!0}),e):(_e(k||I.historyAction,I.navigation.location,{overrideNavigation:I.navigation,enableViewTransition:!0===N}),e)},createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:qe,deleteFetcher:function(e){let t=(oe.get(e)||0)-1;t<=0?(oe.delete(e),se.add(e)):oe.set(e,t),we({fetchers:new Map(I.fetchers)})},dispose:function(){C&&C(),L&&L(),w.clear(),V&&V.abort(),I.fetchers.forEach(((e,t)=>Be(t))),I.blockers.forEach(((e,t)=>Qe(t)))},getBlocker:function(e,t){let n=I.blockers.get(e)||Q;return he.get(e)!==t&&he.set(e,t),n},deleteBlocker:Qe,patchRoutes:function(e,t){let n=null==r;ie(e,t,r||m,f,u),n&&(m=[...m],we({}))},_internalFetchControllers:B,_internalSetRoutes:function(e){f={},r=p(e,u,void 0,f)}},l}({basename:undefined,future:undefined,history:function(e={}){return function(e,t,n,i={}){let{window:u=document.defaultView,v5Compat:c=!1}=i,p=u.history,h="POP",d=null,f=m();function m(){return(p.state||{idx:null}).idx}function g(){h="POP";let e=m(),t=null==e?null:e-f;f=e,d&&d({action:h,location:v.location,delta:t})}function y(e){let t="null"!==u.location.origin?u.location.origin:u.location.href,n="string"==typeof e?e:l(e);return n=n.replace(/ $/,"%20"),o(t,`No window.location.(origin|href) available to create URL for href: ${n}`),new URL(n,t)}null==f&&(f=0,p.replaceState({...p.state,idx:f},""));let v={get action(){return h},get location(){return e(u,p)},listen(e){if(d)throw new Error("A history only accepts one active listener");return u.addEventListener(r,g),d=e,()=>{u.removeEventListener(r,g),d=null}},createHref:e=>t(u,e),createURL:y,encodeLocation(e){let t=y(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){h="PUSH";let r=a(v.location,e,t);n&&n(r,e),f=m()+1;let o=s(r,f),i=v.createHref(r);try{p.pushState(o,"",i)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;u.location.assign(i)}c&&d&&d({action:h,location:v.location,delta:1})},replace:function(e,t){h="REPLACE";let r=a(v.location,e,t);n&&n(r,e),f=m();let o=s(r,f),i=v.createHref(r);p.replaceState(o,"",i),c&&d&&d({action:h,location:v.location,delta:0})},go:e=>p.go(e)};return v}((function(e,t){let{pathname:n,search:r,hash:o}=e.location;return a("",{pathname:n,search:r,hash:o},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){return"string"==typeof t?t:l(t)}),null,e)}({window:undefined}),hydrationData:function(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:Nt(e.errors)}),e}(),routes:ST,mapRouteProperties:function(t){let n={hasErrorBoundary:t.hasErrorBoundary||null!=t.ErrorBoundary||null!=t.errorElement};return t.Component&&(t.element&&i(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(n,{element:e.createElement(t.Component),Component:void 0})),t.HydrateFallback&&(t.hydrateFallbackElement&&i(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(n,{hydrateFallbackElement:e.createElement(t.HydrateFallback),HydrateFallback:void 0})),t.ErrorBoundary&&(t.errorElement&&i(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(n,{errorElement:e.createElement(t.ErrorBoundary),ErrorBoundary:void 0})),n},dataStrategy:undefined,patchRoutesOnNavigation:undefined,window:undefined}).initialize());const TT=function(){return e.createElement("div",{className:"app"},e.createElement(zt,{router:OT}))};var VT=document.getElementById("root");(0,t.createRoot)(VT).render(e.createElement(e.StrictMode,null,e.createElement(TT,null)))})()})();
\ No newline at end of file
diff --git a/setup.py b/setup.py
index 896c3dec4a1d72cce81b5c3b8528b1588a799f2c..8169cd56e71f27ed4c372db74b9583dc63235faf 100644
--- a/setup.py
+++ b/setup.py
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
 
 setup(
     name='compendium-v2',
-    version="0.81",
+    version="0.82",
     author='GEANT',
     author_email='swd@geant.org',
     description='Flask and React project for displaying '