PageSourceSearch

https://app.leichteralsdudenkst.de/chunk-Dk7Bvm6j.js

js leichteralsdudenkst.de collected 2026-10-04 02:41:31 UTC 6,047 bytes, 1 lines download raw bytes

1import {g,aW as w,iF as W,iG as k,aU as H$1,B as wi,C as Ce,aV as J$1,aX as q,O as On,es as qE,iH as d,a0 as U,b3 as r,f as qS,fd as Xi,H as yt,L as gv,aE as fM,bu as Hd,i as ta,Q as QM,P as Pd,Z as Zv,aF as sh,ar as yM,aG as ah,aA as oM,bv as $d,u as uT,G as Gd,ak as jv,aB as iM,I as eM,N as tM,j as Vv,dc as Gm}from'./main-DQKPBURG.js';var P=(o,a)=>a.schoolId;function Z(o,a){if(o&1&&(ta(0,"span",10),Vv(1,"img",13),Pd()),o&2){let e=yM().$implicit;uT(),jv("src",e.icon,Gm)("alt",e.name);}}function H(o,a){if(o&1&&(ta(0,"div",11),QM(1),Pd()),o&2){let e=yM().$implicit;uT(),Gd(" ",e.name.charAt(0).toUpperCase()," ");}}function J(o,a){if(o&1){let e=fM();ta(0,"button",9),Zv("click",function(){let i=sh(e).$implicit,h=yM(2);return ah(h.selectSchool(i))}),eM(1,Z,2,2,"span",10)(2,H,2,1,"div",11),ta(3,"span",12),QM(4),Pd()();}if(o&2){let e=a.$implicit,t=yM(2);jv("disabled",t.loading()!==null),uT(),tM(e.icon?1:2),uT(3),Gd(" ",e.name," ");}}function Q(o,a){if(o&1){let e=fM();Hd(0),ta(1,"div",1)(2,"div",2)(3,"div",3)(4,"h2",4),QM(5),Pd(),ta(6,"p",5),QM(7),Pd(),ta(8,"mspot-select",6),Zv("selectionChange",function(i){sh(e);let h=yM();return ah(h.onSortChange(i))}),Pd()(),ta(9,"div",7),oM(10,J,5,3,"button",8,P),Pd()()(),$d();}if(o&2){let e=a.$implicit,t=yM();uT(5),Gd(" ",e("otp.schoolSelect.title")," "),uT(2),Gd(" ",e("otp.schoolSelect.description")," "),uT(),jv("items",t.sortingMethods)("value",t.selectedSort()),uT(2),iM(t.schools());}}var pe=(()=>{class o{constructor(){this._clientAuthService=g(w),this._clientSchoolListService=g(W),this._maService=g(k),this._router=g(H$1),this._noti=g(wi),this._transloco=g(Ce),this._authManager=g(J$1),this._mobileStorage=g(q),this.sortingMethods=[{id:"name",name:"Name (A-Z)"},{id:"lastUsed",name:"Last used"}],this.schools=On([]),this.loading=On(null),this.selectedSort=On("lastUsed"),this._sortRequestId=0;}async ngOnInit(){let e=await this._clientSchoolListService.getStoredSchoolsWithFreshMetadata();if(!e||e.length===0){this._router.navigate(["/auth/generic-client/email"]);return}this.schools.set(e);let t=this._transloco.translate("otp.schoolSelect.sortingMethods.name"),i=this._transloco.translate("otp.schoolSelect.sortingMethods.lastUsed");this.sortingMethods=[{id:"name",name:t},{id:"lastUsed",name:i}],await this._applySort(this.selectedSort());}async selectSchool(e){if(!this.loading()){this.loading.set(e.schoolId);try{await this._mobileStorage.setLastSelectedSchool(e.schoolId),await this._mobileStorage.setStoredSchoolId(e.schoolId,e.url),await qE(this._maService.syncMaByUrl(e.url,!0));let t=await this._clientAuthService.getOtpLoginToken();if(!t){this.loading.set(null),this._router.navigate(["/auth/generic-client/email"]);return}await this._authManager.authenticateWithSchool(e.schoolId,e.tenantId,t),this.loading.set(null),this._router.navigateByUrl("/library");}catch(t){this.loading.set(null),await this._handleAuthError(t);}}}async _handleAuthError(e){if(e instanceof d)switch(e.kind){case "sso-token-invalid":await this._clientAuthService.clearOtpAuthorization(),await this._mobileStorage.clearStoredSchoolId(),this._noti.errorIntl("auth.schoolSelect.sessionExpired",{},5e3),this._router.navigate(["/auth/generic-client/email"]);return;case "school-inactive":this._noti.errorIntl("auth.schoolSelect.schoolInactive",{},5e3);return;case "school-not-listed-for-mobile-apps":this._noti.errorIntl("auth.schoolSelect.schoolNotListedForMobileApps",{},5e3);return;case "network-error":this._noti.errorIntl("auth.schoolSelect.error",{},5e3);return}this._noti.errorIntl("auth.schoolSelect.error",{},5e3);}async resetSchoolAndEmail(){if(U.isNativePlatform())try{await r.signOut();}catch{}await this._clientAuthService.clearOtpAuthorization(),await this._mobileStorage.clearStoredSchoolId(),this._router.navigate(["/auth/generic-client/email"]);}async onSortChange(e){this.selectedSort.set(e),await this._applySort(e);}async _applySort(e){this._sortRequestId+=1;let t=this._sortRequestId,i=[...this.schools()].sort((_,W)=>_.name.localeCompare(W.name));if(e!=="lastUsed"){this.schools.set(i);return}let h=await this._mobileStorage.getLastSelectedSchool();if(t!==this._sortRequestId)return;if(!h){this.schools.set(i);return}let b=i.findIndex(_=>_.schoolId===h);if(b===-1){this.schools.set(i);return}let[K]=i.splice(b,1);this.schools.set([K,...i]);}static{this.\u0275fac=function(t){return new(t||o)};}static{this.\u0275cmp=qS({type:o,selectors:[["appc-generic-client-school-select"]],decls:1,vars:0,consts:[[4,"transloco"],[1,"h-full"],[1,"flex","h-full","flex-col"],[1,"sticky","top-0","z-10","bg-backgrounds-surface-raised","pb-6"],[1,"mb-2","mt-1","text-2xl","font-semibold","text-text-strong"],[1,"mb-6","text-sm","text-text-subtle"],["itemValueKey","id","itemDisplayKey","name",1,"text-sm","text-text-subtle","md:max-w-md",3,"selectionChange","items","value"],[1,"mx-auto","grid","min-h-0","w-full","max-w-sm","flex-1","grid-cols-2","content-start","gap-3","overflow-y-auto","pb-2"],["type","button",1,"flex","flex-col","items-center","gap-3","rounded-xl","border","border-borders-primary","bg-backgrounds-surface-raised","p-4","text-left","transition-colors","hover:border-borders-secondary","hover:bg-backgrounds-
1hover","disabled:opacity-60",3,"disabled"],["type","button",1,"flex","flex-col","items-center","gap-3","rounded-xl","border","border-borders-primary","bg-backgrounds-surface-raised","p-4","text-left","transition-colors","hover:border-borders-secondary","hover:bg-backgrounds-hover","disabled:opacity-60",3,"click","disabled"],[1,"flex","h-14","w-14","items-center","justify-center","overflow-hidden","rounded-2xl"],[1,"flex","h-14","w-14","items-center","justify-center","rounded-lg","bg-backgrounds-subtle","text-lg","font-semibold","text-text-default"],[1,"line-clamp-2","w-full","text-center","text-sm","font-medium","leading-tight","text-text-strong"],[1,"h-full","w-full","object-cover",3,"src","alt"]],template:function(t,i){t&1&&gv(0,Q,12,4,"ng-container",0);},dependencies:[Xi,yt],encapsulation:2});}}return o})();export{pe as GenericClientSchoolSelectComponent};

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.