PageSourceSearch

https://www.leverkusen.de/assets/component-scheduling-BdMkiINx.js

js leverkusen.de collected 2026-10-02 07:35:35 UTC 12,445 bytes, 1 lines download raw bytes

1var M=Object.defineProperty;var w=(i,e,t)=>e in i?M(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var n=(i,e,t)=>w(i,typeof e!="symbol"?e+"":e,t);const a=(i,e)=>{const t=e.querySelector(i);if(!t)throw new Error(`Element with selector: ${i} not found`);return t},E=(i,e)=>{const t=e.querySelectorAll(i);if(t.length===0)throw new Error(`Elements with selector: ${i} not found`);return t},m=i=>i<10?`0${i}`:`${i}`,p=i=>{const e=i.getFullYear(),t=m(i.getMonth()+1),s=m(i.getDate());return`${e}-${t}-${s}`},O=i=>{const e=m(i.getHours()),t=m(i.getMinutes());return`${e}:${t}`},I=(i=0)=>p(v(i,0)),C=(i=0)=>O(v(0,i)),v=(i=0,e=0)=>{const t=new Date;return i!==0&&t.setDate(t.getDate()+i),t.setMinutes(0,0,0),t.setHours(t.getHours()+1),e!==0&&t.setHours(t.getHours()+e),t},T=i=>{const e=i.value.trim(),t=/^(\d{4})-(\d{2})-(\d{2})$/,s=/^(\d{2})\.(\d{2})\.(\d{4})$/;let h,l,u;const y=e.match(t);if(y)h=Number(y[1]),l=Number(y[2]),u=Number(y[3]);else{const D=e.match(s);if(!D)return NaN;u=Number(D[1]),l=Number(D[2]),h=Number(D[3])}const g=new Date(h,l-1,u,0,0,0,0).getTime();return Number.isNaN(g)?NaN:g},o=i=>{i.classList.add("SPu-hidden"),i.setAttribute("aria-hidden","true")},r=i=>{i.classList.remove("SPu-hidden"),i.setAttribute("aria-hidden","false")},d=i=>{i.value=""},f=i=>!!(i!=null&&i.value),k=i=>!f(i),c=class c{constructor(e,t){n(this,"el");n(this,"config");n(this,"elData");n(this,"elSingleDay");n(this,"elMultiDay");n(this,"elIterationDay");n(this,"elFullDay");n(this,"elBeginDateLabel",null);n(this,"elBeginDateLabelText",null);n(this,"beginDate");n(this,"endDateContainer");n(this,"endDate");n(this,"beginTimeContainer");n(this,"endTimeContainer");n(this,"beginTime");n(this,"endTime");n(this,"elIterationCountContainer");n(this,"elIterationEndContainer");n(this,"elIterationEndOnDate");n(this,"elIterationEndOnCount");n(this,"elIterationTypeAndIntervalContainer");n(this,"elIterationDowContainer");n(this,"elIterationMonthlyTypeContainer");n(this,"elIterationMonthlyByDay");n(this,"elIterationMonthlyByOccurrence");n(this,"elIterationMonthlyDomContainer");n(this,"elIterationMonthlyOccurrenceContainer");n(this,"iterationCount");n(this,"iterationType");n(this,"iterationInterval");n(this,"iterationDow");n(this,"iterationMonthlyDom");n(this,"iterationMonthlyOom");n(this,"iterationMonthlyDow");this.el=e,this.config={...c.defaultConfig,...t,translation:{...c.defaultConfig.translation,...t.translation},defaultConfig:{...c.defaultConfig.defaultConfig,...t.defaultConfig}},this.elData=a("input[type='hidden']",this.el),this.elSingleDay=a("[data-sp-scheduling-single] input",this.el),this.elMultiDay=a("[data-sp-scheduling-multi] input",this.el),this.elIterationDay=a("[data-sp-scheduling-iteration] input",this.el),this.elFullDay=a("[data-sp-scheduling-fullday] input",this.el);const s=a("[data-sp-scheduling-startdate]",this.el);s&&(this.elBeginDateLabel=a("label",s),this.elBeginDateLabelText=this.config.translation.dateFrom),this.beginDate=a("[data-sp-scheduling-startdate] input",this.el),this.endDateContainer=a("[data-sp-scheduling-enddate]",this.el),this.endDate=a("[data-sp-scheduling-enddate] input",this.el),this.beginTimeContainer=a("[data-sp-scheduling-starttime]",this.el),this.endTimeContainer=a("[data-sp-scheduling-endtime]",this.el),this.beginTime=a("[data-sp-scheduling-starttime] input",this.el),this.endTime=a("[data-sp-scheduling-endtime] input",this.el),this.elIterationCountContainer=a("[data-sp-scheduling-iterationcount]",this.el),this.elIterationEndContainer=a("[data-sp-scheduling-iterationend]",this.el),this.elIterationEndOnDate=a("[data-sp-scheduling-iterationendondate] input",this.el),this.elIterationEndOnCount=a("[data-sp-scheduling-iterationendoncount] input",this.el),this.elIterationTypeAndIntervalContainer=a("[data-sp-scheduling-iterationtypeandinterval]",this.el),this.elIterationDowContainer=a("[data-sp-scheduling-iterationdow]",this.el),this.elIterationMonthlyTypeContainer=a("[data-sp-scheduling-iterationmonthlytype]",this.el),this.elIterationMonthlyByDay=a("[data-sp-scheduling-iterationmonthlybyday] input",this.el),this.elIterationMonthlyByOccurrence=a("[data-sp-scheduling-iterationmonthlybyoccurrence] input",this.el),this.elIterationMonthlyDomContainer=a("[data-sp-scheduling-iterationmonthlydom]",this.el),this.elIterationMonthlyOccurrenceContainer=a("[data-sp-scheduling-iterationmonthlyoccurrence]",this.el),this.iterationCount=a("[data-sp-scheduling-iterationcount] input",this.el),this.iterationType=a("[data-sp-scheduling-iterationType] select",this.el),this.iterationInterval=a("[data-sp-scheduling-iterationinterval] input",this.el),this.iterationDow=E("[data-sp-scheduling-iterationdow] input",this.el),this.iterationMonthlyDom=a("[data-sp-scheduling-iterationmonthlydom] 
1input",this.el),this.iterationMonthlyOom=a("[data-sp-scheduling-iterationmonthlyoom] select",this.el),this.iterationMonthlyDow=a("[data-sp-scheduling-iterationmonthlydow] select",this.el),this.processContentChange=this.processContentChange.bind(this),this.init()}get schedulingContainer(){return this.el}get schedulingOptions(){return this.config}hideEndDateElements(e=!0){o(this.endDateContainer),e&&d(this.endDate)}showEndDateContainer(){r(this.endDateContainer)}hideAllIterationElements(){o(this.elIterationCountContainer),o(this.elIterationEndContainer),o(this.elIterationTypeAndIntervalContainer),o(this.elIterationDowContainer),o(this.elIterationMonthlyTypeContainer),o(this.elIterationMonthlyDomContainer),o(this.elIterationMonthlyOccurrenceContainer)}hideTimeContainers(){o(this.beginTimeContainer),o(this.endTimeContainer)}resetTimeElements(){d(this.beginTime),d(this.endTime)}showTimeContainers(){r(this.beginTimeContainer),r(this.endTimeContainer)}adjustDateBasedOnType(e,t){(e==="single"||e==="multi"||t)&&(this.adjustDateFromLabel(e,t),e==="single"?(this.hideAllIterationElements(),this.hideEndDateElements(!1)):e==="multi"?(this.hideAllIterationElements(),this.showEndDateContainer()):t&&this.handleIterationElements(e))}handleIterationElements(e){this.hideAllIterationElements(),r(this.elIterationTypeAndIntervalContainer),r(this.elIterationEndContainer);const t=this.getIterationEndType();console.log("endType",t),t==="date"?(this.showEndDateContainer(),o(this.elIterationCountContainer),d(this.iterationCount)):t==="count"?(r(this.elIterationCountContainer),this.hideEndDateElements()):(this.hideEndDateElements(),o(this.elIterationCountContainer),d(this.iterationCount)),this.showAdditionalIterationElements(e)}getIterationEndType(){return this.elIterationEndOnDate.checked?"date":this.elIterationEndOnCount.checked?"count":null}showAdditionalIterationElements(e){e==="weekly"?r(this.elIterationDowContainer):e==="monthlyByDay"?(r(this.elIterationMonthlyTypeContainer),r(this.elIterationMonthlyDomContainer)):e==="monthlyByOccurrence"&&(r(this.elIterationMonthlyTypeContainer),r(this.elIterationMonthlyOccurrenceContainer))}handleFullDayOption(){this.elFullDay.checked?(this.hideTimeContainers(),this.resetTimeElements()):this.showTimeContainers()}resetEndDateIfSameAsBeginDate(){this.beginDate.value===this.endDate.value&&this.endDate.value!==""&&d(this.endDate)}storeData(){this.elData.value=JSON.stringify(this.buildDataToStore())}buildDataToStore(){const e={},t={},s=this.getScheduleType(!0);return s&&(e.type=s,e.isFullDay=k(this.beginTime),this.populateDateFields(e),e.isFullDay||this.populateTimeFields(e),this.isIteration(s)&&this.populateRepetitionFields(s,t,e)),e}populateDateFields(e){this.beginDate.value!==""&&(e.beginDate=T(this.beginDate)),e.beginDate&&this.endDate.value!==""&&(e.endDate=T(this.endDate))}populateTimeFields(e){this.beginTime.value!==""&&e.beginDate&&(e.beginTime=this.beginTime.value),this.endTime.value!==""&&(e.endTime=this.endTime.value)}populateRepetitionFields(e,t,s){const h=s.endDate;if(h)t.date=h;else{const u=Number.parseInt(this.iterationCount.value,10);Number.isNaN(u)||(t.count=u)}const l=Number.parseInt(this.iterationInterval.value,10);if(t.interval=Number.isNaN(l)?1:l,e==="weekly")t.dow=this.getIterationDaysOfWeek().join(",");else if(e==="monthlyByDay"){const u=Number.parseInt(this.iterationMonthlyDom.value,10);Number.isNaN(u)||(t.dom=u)}else e==="monthlyByOccurrence"&&(t.oom=this.iterationMonthlyOom.value,t.dow=this.iterationMonthlyDow.value);s.repetition=t}getScheduleType(e){return this.elSingleDay.checked?this.elSingleDay.value:this.elMultiDay.checked?this.determineMultiDayType(e):this.elIterationDay.checked?this.determineIterationType():""}determineMultiDayType(e){return e===!0?this.endDate.value!==""?this.elMultiDay.value:"single":this.elMultiDay.value}determineIterationType(){const e=this.getIterationType();return e==="daily"||e==="weekly"?e:e==="monthly"?this.getIterationMonthlyType():""}getIterationType(){return this.iterationType.value}getIterationMonthlyType(){return this.elIterationMonthlyByDay.checked?"monthlyByDay":this.elIterationMonthlyByOccurrence.checked?"monthlyByOccurrence":""}getIterationDaysOfWeek(){const e=[];
1return Object.values(this.iterationDow).forEach(t=>{t.checked&&e.push(t.value)}),e}checkIterationDaysOfWeek(e){return Object.values(this.iterationDow).forEach(t=>{e.includes(t.value)&&(t.checked=!0)}),e}isIteration(e){return e==="daily"||e==="weekly"||e==="monthlyByDay"||e==="monthlyByOccurrence"}adjustDateFromLabel(e,t){const{date:s,dateFrom:h}=this.config.translation,l=e==="single"?s:e==="multi"||t?h:null;this.elBeginDateLabel&&this.elBeginDateLabelText&&l!==null&&l!==this.elBeginDateLabelText&&(this.elBeginDateLabel.innerHTML=this.elBeginDateLabel.innerHTML.replace(this.elBeginDateLabelText,l),this.elBeginDateLabelText=l)}setDefaults(){const{defaultConfig:e}=this.config,{type:t,isFullDay:s,setCurrentDate:h,setCurrentTime:l}=e;this.elSingleDay.checked=t==="single",this.elMultiDay.checked=t==="multi",this.elIterationDay.checked=t==="iteration",this.elFullDay.checked=s,h&&(this.beginDate.value=I(),this.endDate.value=I(1)),l&&(this.beginTime.value=C(),this.endTime.value=C(1))}loadData(){const e=this.loadDataFromStore();if(!e){this.setDefaults();return}e.type&&(e.type==="single"?this.elSingleDay.checked=!0:e.type==="multi"?this.elMultiDay.checked=!0:this.isIteration(e.type)&&e.repetition&&(this.elIterationDay.checked=!0,typeof e.repetition.count=="number"?(this.elIterationEndOnCount.checked=!0,this.iterationCount.value=String(e.repetition.count)):typeof e.repetition.date=="number"&&(this.elIterationEndOnDate.checked=!0,this.endDate.value=p(new Date(e.repetition.date))),this.iterationInterval.value=String(e.repetition.interval??1),e.type==="daily"?this.iterationType.value="daily":e.type==="weekly"?(this.iterationType.value="weekly",e.repetition.dow&&this.checkIterationDaysOfWeek(e.repetition.dow.split(","))):e.type==="monthlyByDay"?(this.iterationType.value="monthly",this.elIterationMonthlyByDay.checked=!0,typeof e.repetition.dom=="number"&&(this.iterationMonthlyDom.value=String(e.repetition.dom))):e.type==="monthlyByOccurrence"&&(this.iterationType.value="monthly",this.elIterationMonthlyByOccurrence.checked=!0,e.repetition.oom&&(this.iterationMonthlyOom.value=e.repetition.oom),e.repetition.dow&&(this.iterationMonthlyDow.value=e.repetition.dow)))),typeof e.isFullDay=="boolean"&&(this.elFullDay.checked=e.isFullDay),typeof e.beginDate=="number"&&(this.beginDate.value=p(new Date(e.beginDate))),typeof e.endDate=="number"&&(this.endDate.value=p(new Date(e.endDate))),typeof e.beginTime=="string"&&(this.beginTime.value=e.beginTime),typeof e.endTime=="string"&&(this.endTime.value=e.endTime)}hasDataInStore(){return f(this.elData)}loadDataFromStore(){try{const e=JSON.parse(this.elData.value);return e!=null&&e.type&&(e==null?void 0:e.beginDate)!=null?e:null}catch{return null}}registerListeners(){this.el.addEventListener("change",this.processContentChange)}removeListeners(){this.el.removeEventListener("change",this.processContentChange)}processView(){const e=this.getScheduleType(),t=this.isIteration(e);this.adjustDateBasedOnType(e,t),this.handleFullDayOption(),this.resetEndDateIfSameAsBeginDate()}processContentChange(e){this.processView(),this.storeData()}init(){this.registerListeners(),this.hasDataInStore()?this.loadData():this.setDefaults(),this.processView(),this.storeData()}destroy(){this.removeListeners()}};n(c,"defaultConfig",{dataElement:"sp_scheduling-input",translation:{date:"Datum",dateFrom:"Datum von"},defaultConfig:{type:"single",isFullDay:!1,setCurrentDate:!1,setCurrentTime:!1}});let b=c;export{b as Scheduling};

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.