1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9818],{58789:function(t,u,l){l.r(u),l.d(u,{default:function(){return LmAuthForm}});var d=l(85893),f=l(67294),h=l(11231),p=l(83321),m=l(89041),extendStatics=function(t,u){return(extendStatics=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,u){t.__proto__=u}||function(t,u){for(var l in u)Object.prototype.hasOwnProperty.call(u,l)&&(t[l]=u[l])})(t,u)},__assign=function(){return(__assign=Object.assign||function(t){for(var u,l=1,d=arguments.length;l<d;l++)for(var f in u=arguments[l])Object.prototype.hasOwnProperty.call(u,f)&&(t[f]=u[f]);return t}).apply(this,arguments)},v="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==l.g?l.g:"undefined"!=typeof self?self:{};function i(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function o(t,u){return t(u={exports:{}},u.exports),u.exports}var _=o(function(t,u){Object.defineProperty(u,"__esModule",{value:!0});var l=function(){function e(){var t=this;this.locked=new Map,this.addToLocked=function(u,l){var d=t.locked.get(u);void 0===d?void 0===l?t.locked.set(u,[]):t.locked.set(u,[l]):void 0!==l&&(d.unshift(l),t.locked.set(u,d))},this.isLocked=function(u){return t.locked.has(u)},this.lock=function(u){return new Promise(function(l,d){t.isLocked(u)?t.addToLocked(u,l):(t.addToLocked(u),l())})},this.unlock=function(u){var l=t.locked.get(u);if(void 0!==l&&0!==l.length){var d=l.pop();t.locked.set(u,l),void 0!==d&&setTimeout(d,0)}else t.locked.delete(u)}}return e.getInstance=function(){return void 0===e.instance&&(e.instance=new e),e.instance},e}();u.default=function(){return l.getInstance()}});i(_);var g=i(o(function(t,u){var l=v&&v.__awaiter||function(t,u,l,d){return new(l||(l=Promise))(function(f,h){function s(t){try{c(d.next(t))}catch(t){h(t)}}function r(t){try{c(d.throw(t))}catch(t){h(t)}}function c(t){t.done?f(t.value):new l(function(u){u(t.value)}).then(s,r)}c((d=d.apply(t,u||[])).next())})},d=v&&v.__generator||function(t,u){var l,d,f,h,p={label:0,sent:function(){if(1&f[0])throw f[1];return f[1]},trys:[],ops:[]};return h={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(h[Symbol.iterator]=function(){return this}),h;function r(h){return function(m){return function(h){if(l)throw TypeError("Generator is already executing.");for(;p;)try{if(l=1,d&&(f=2&h[0]?d.return:h[0]?d.throw||((f=d.return)&&f.call(d),0):d.next)&&!(f=f.call(d,h[1])).done)return f;switch(d=0,f&&(h=[2&h[0],f.value]),h[0]){case 0:case 1:f=h;break;case 4:return p.label++,{value:h[1],done:!1};case 5:p.label++,d=h[1],h=[0];continue;case 7:h=p.ops.pop(),p.trys.pop();continue;default:if(!(f=(f=p.trys).length>0&&f[f.length-1])&&(6===h[0]||2===h[0])){p=0;continue}if(3===h[0]&&(!f||h[1]>f[0]&&h[1]<f[3])){p.label=h[1];break}if(6===h[0]&&p.label<f[1]){p.label=f[1],f=h;break}if(f&&p.label<f[2]){p.label=f[2],p.ops.push(h);break}f[2]&&p.ops.pop(),p.trys.pop();continue}h=u.call(t,p)}catch(t){h=[6,t],d=0}finally{l=f=0}if(5&h[0])throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}([h,m])}}};Object.defineProperty(u,"__esModule",{value:!0});var f="browser-tabs-lock-key";function r(t){return new Promise(function(u){return setTimeout(u,t)})}function c(t){for(var u="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",l="",d=0;d<t;d++)l+=u[Math.floor(Math.random()*u.length)];return l}var h=function(){function e(){this.acquiredIatSet=new Set,this.id=Date.now().toString()+c(15),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),void 0===e.waiters&&(e.waiters=[])}return e.prototype.acquireLock=function(t,u){return void 0===u&&(u=5e3),l(this,void 0,void 0,function(){var l,h,p,m,v,_;return d(this,function(d){switch(d.label){case 0:l=Date.now()+c(4),h=Date.now()+u,p=f+"-"+t,m=window.localStorage,d.label=1;case 1:return Date.now()<h?[4,r(30)]:[3,8];case 2:return d.sent(),null!==m.getItem(p)?[3,5]:(v=this.id+"-"+t+"-"+l,[4,r(Math.floor(25*Math.random()))]);case 3:return d.sent(),m.setItem(p,JSON.stringify({id:this.id,iat:l,timeoutKey:v,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,r(30)];case 4:return d.sent(),null!==(_=m.getItem(p))&&(_=JSON.parse(_)).id===this.id&&_.iat===l?(this.acquiredIatSet.add(l),this.refreshLockWhileAcquired(p,l),[2,!0]):[3,7];case 5:return e.lockCorrector(),[4,this.waitForSomethingToChange(h)];case 6:d.sent(),d.label=7;case 7:return l=Date.now()+c(4),[3,1];case 8:return[2,!1]}})})},e.prototype.refreshLockWhileAcquired=function(t,u){return l(this,void 0,void 0,function(){var f=this;return d(this,function(h){return setTimeout(function(){return l(f,void 0,void 0,function(){var l,f;return d(this,function(d){switch(d.label){case 0:return[4,_.default().lock(u)];case 1:return d.sent(),this.acquiredIatSet.has(u)?null===(f=(l=window.localStorage).getItem(t))?_.default().unlock(u):((f=JSON.parse(f)).timeRefreshed=Date.now(),l.setItem(t,JSON.stringify(f)),_.default().unlock(u),this.refreshLockWhileAcquired(t,u)):_.default().unlock(u),[2]}})})},1e3),[2]})})},e.prototype.waitForSomethingToChange=function(t){return l(this,void 0,void 0,function(){return d(this,function(u){switch(u.label){case 0:return[4,new Promise(function(u){var l=!1,d=Date.now(),f=!1;function s(){if(f||(window.removeEventListener("storage",s),e.removeFromWaiting(s),clearTimeout(h),f=!0),!l){l=!0;var t=50-(Date.now()-d);t>0?setTimeout(u,t):u()}}window.addEventListener("storage",s),e.addToWaiting(s);var h=setTimeout(s,Math.max(0,t-Date.now()))})];case 1:return u.sent(),[2]}})})},e.addToWaiting=function(t){this.removeFromWaiting(t),void 0!==e.waiters&&e.waiters.push(t)},e.removeFromWaiting=function(t){void 0!==e.waiters&&(e.waiters=e.waiters.filter(function(u){return u!==t}))},e.notifyWaiters=function(){void 0!==e.waiters&&e.waiters.slice().forEac
1h(function(t){return t()})},e.prototype.releaseLock=function(t){return l(this,void 0,void 0,function(){return d(this,function(u){switch(u.label){case 0:return[4,this.releaseLock__private__(t)];case 1:return[2,u.sent()]}})})},e.prototype.releaseLock__private__=function(t){return l(this,void 0,void 0,function(){var u,l,h;return d(this,function(d){switch(d.label){case 0:return u=window.localStorage,l=f+"-"+t,null===(h=u.getItem(l))?[2]:(h=JSON.parse(h)).id!==this.id?[3,2]:[4,_.default().lock(h.iat)];case 1:d.sent(),this.acquiredIatSet.delete(h.iat),u.removeItem(l),_.default().unlock(h.iat),e.notifyWaiters(),d.label=2;case 2:return[2]}})})},e.lockCorrector=function(){for(var t=Date.now()-5e3,u=window.localStorage,l=Object.keys(u),d=!1,h=0;h<l.length;h++){var p=l[h];if(p.includes(f)){var m=u.getItem(p);null!==m&&(void 0===(m=JSON.parse(m)).timeRefreshed&&m.timeAcquired<t||void 0!==m.timeRefreshed&&m.timeRefreshed<t)&&(u.removeItem(p),d=!0)}}d&&e.notifyWaiters()},e.waiters=void 0,e}();u.default=h})),w=o(function(t,u){var l=v&&v.__assign||function(){return(l=Object.assign||function(t){for(var u,l=1,d=arguments.length;l<d;l++)for(var f in u=arguments[l])Object.prototype.hasOwnProperty.call(u,f)&&(t[f]=u[f]);return t}).apply(this,arguments)};function n(t,u){if(!u)return"";var l="; "+t;return!0===u?l:l+"="+u}function a(t,u,l){return encodeURIComponent(t).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(u).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+function(t){if("number"==typeof t.expires){var u=new Date;u.setMilliseconds(u.getMilliseconds()+864e5*t.expires),t.expires=u}return n("Expires",t.expires?t.expires.toUTCString():"")+n("Domain",t.domain)+n("Path",t.path)+n("Secure",t.secure)+n("SameSite",t.sameSite)}(l)}function s(t){for(var u={},l=t?t.split("; "):[],d=/(%[\dA-F]{2})+/gi,f=0;f<l.length;f++){var h=l[f].split("="),p=h.slice(1).join("=");'"'===p.charAt(0)&&(p=p.slice(1,-1));try{u[h[0].replace(d,decodeURIComponent)]=p.replace(d,decodeURIComponent)}catch(t){}}return u}function r(){return s(document.cookie)}function c(t,u,d){document.cookie=a(t,u,l({path:"/"},d))}u.__esModule=!0,u.encode=a,u.parse=s,u.getAll=r,u.get=function(t){return r()[t]},u.set=c,u.remove=function(t,u){c(t,"",l(l({},u),{expires:-1}))}});i(w),w.encode,w.parse,w.getAll,w.get,w.set,w.remove,new g;var stub=function(){throw Error("You forgot to wrap your component in <Auth0Provider>.")},b=__assign(__assign({},{isAuthenticated:!1,isLoading:!0}),{buildAuthorizeUrl:stub,buildLogoutUrl:stub,getAccessTokenSilently:stub,getAccessTokenWithPopup:stub,getIdTokenClaims:stub,loginWithRedirect:stub,loginWithPopup:stub,logout:stub,handleRedirectCallback:stub}),y=(0,f.createContext)(b),k=function(t){function OAuthError(u,l){var d=t.call(this,l||u)||this;return d.error=u,d.error_description=l,Object.setPrototypeOf(d,OAuthError.prototype),d}return!function(t,u){if("function"!=typeof u&&null!==u)throw TypeError("Class extends value "+String(u)+" is not a constructor or null");function __(){this.constructor=t}extendStatics(t,u),t.prototype=null===u?Object.create(u):(__.prototype=u.prototype,new __)}(OAuthError,t),OAuthError}(Error),normalizeErrorFn=function(t){return function(u){return"error"in u?new k(u.error,u.error_description):u instanceof Error?u:Error(t)}};normalizeErrorFn("Login failed"),normalizeErrorFn("Get access token failed");var S=l(17396),E=l(62936),A=l(11163);function LmAuthForm(t){var u,l,v,_;let{content:g}=t,w=(0,A.useRouter)(),b=(0,E.v)(),k=w.locale,T=(void 0===_&&(_=y),(0,f.useContext)(_)),[x,I]=(0,f.useState)(!1),L={email:(null==b?void 0:b.email)||"",given_name:(null==b?void 0:b.firstName)||"",family_name:(null==b?void 0:b.lastName)||""},O={de:{email:"Email",given_name:"Vorname",family_name:"Nachname",submit:"Aktualisieren",error_required:"Bitte das Pflichtfeld ausf\xfcllen",error_email:"Das ist keine g\xfcltige Email-Adresse",email_helper:"Die Email Adresse kann nicht ver\xe4ndert werden."},en:{email:"Email",given_name:"First Name",family_name:"Surname",submit:"Update",error_required:"This field is required",error_email:"This is not a valid email address",email_helper:"The email can not be changed."}},C=k||"de",parseError=t=>{switch(t.type){case"required":return O[C].error_required;case"pattern":return O[C].error_email;default:return t.message}},onSuccess=async t=>{I(!0);let u=new URLSearchParams;if(u.append("sub",null==b?void 0:b.sub),Object.keys(t).forEach(l=>{u.append(l,t[l])}),!T)return;let l=await T.getAccessTokenSilently();try{await fetch("".concat(S.Ay.api,"/api/update-user?").concat(u.toString()),{headers:{Authorization:"Bearer ".concat(l)}})}catch(t){console.error(t)}I(!1)};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(h.FormContainer,{onSuccess:onSuccess,defaultValues:L,children:[(0,d.jsx)(h.TextFieldElement,{name:"given_name",fullWidth:!0,required:!0,parseError:parseError,margin:"normal",variant:"outlined",label:O[C].given_name}),(0,d.jsx)(h.TextFieldElement,{name:"family_name",fullWidth:!0,parseError:parseError,required:!0,margin:"normal",variant:"outlined",label:O[C].family_name}),(0,d.jsx)(h.TextFieldElement,{name:"email",type:"email",fullWidth:!0,margin:"normal",variant:"outlined",parseError:parseError,disabled:!0,helperText:O[C].email_helper,label:O[C].email}),(null===(u=g.account_update_button)||void 0===u?void 0:u.length)?g.account_update_button.map(t=>(0,d.jsx)(m.b,{content:t,type:"submit",disabled:x},t._uid)):(0,d.jsx)(p.Z,{type:"submit",fullWidth:!0,color:"primary",disabled:x,children:O[C].submit})]}),null===(l=g.account_delete_body)||void 0===l?void 0:l.map(t=>(0,d.jsx)(m.b,{content:t},t._uid)),null===(v=g.account_delete_button)||void 0===v?void 0:v.map(t=>(0,d.jsx)(m.b,{content:t,disabled:x,onClick:async()=>
1{if(I(!0),!T)return;let t=await T.getAccessTokenSilently();try{await fetch("".concat(S.Ay.api,"/api/delete-user?sub=").concat((null==b?void 0:b.sub)||""),{headers:{Authorization:"Bearer ".concat(t)}})}catch(t){console.error(t)}I(!1),window.location.reload()}},t._uid))]})}},62936:function(t,u,l){l.d(u,{v:function(){return useUserData}});var d=l(31104),f=l(15463);let h=(0,d.ZP)()(t=>({actions:{setUser:u=>t({user:u})}})),useUserData=()=>h(t=>t.user,f.Z)},17396:function(t,u,l){l.d(u,{Ay:function(){return f},e0:function(){return hasAuth0Credentials}}),l(44488);var d=l(83454);let hasAuth0Credentials=(t,u)=>{let l=u[d.env.NEXT_PUBLIC_AUTH_PERMISSION]||[];return console.log(l,t,u.email),!!t.includes("any")&&!!u||!!l.length&&t.find(t=>l.find(u=>d.env.NEXT_PUBLIC_AUTH_PERMISSION_KEY?u[d.env.NEXT_PUBLIC_AUTH_PERMISSION_KEY]===t:u===t))},f={api:d.env.NEXT_PUBLIC_AUTH_API}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.