@uxland/primary-shell 5.3.5 → 5.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -317,7 +317,7 @@ Registered bindings:`,re.forEach(function(ne){var oe="Object";ne.implementationT
317
317
  ${template$g(this)}
318
318
  `}static get styles(){return i$B`
319
319
  ${r$H(styles$f)}
320
- `}handleTest(){console.log(this.selectedPeriodDate)}};__decorateClass$n([n$w()],ExportPdfModal.prototype,"selectedRadioOption",2),__decorateClass$n([n$w()],ExportPdfModal.prototype,"text",2),__decorateClass$n([n$w()],ExportPdfModal.prototype,"selectedVisibilityLevelElement",2),__decorateClass$n([n$w()],ExportPdfModal.prototype,"selectedPeriodDate",2),__decorateClass$n([n$w({type:Array})],ExportPdfModal.prototype,"arrayElements",2),ExportPdfModal=__decorateClass$n([t$i("export-pdf-modal")],ExportPdfModal);class ExportToPdfHandler extends ApiBaseHandler{async handle(){try{this.api.interactionService.confirm(void 0,ExportPdfModal,{title:translate("modal.selectExportOption"),confirmButtonText:"Exportar",cancelButtonText:"Cancelar"})}catch(W){this._notifyError(W.message)}}_notifyError(W){this.api.notificationService.error(W||"actions.delete.error")}}class ExportPdf{}let request$b;const bootstrapExportPdf=X=>{request$b=X.registerRequest(ExportPdf,ExportToPdfHandler)},teardownExportPdf=()=>{request$b==null||request$b.dispose()},{addActivityHistoryItems}=activityHistoryCollectionsSlice.actions;class AddHistoryItemsHandler extends StoreBaseHandler{async handle(W){try{const J=validateAndFilterItems(W.items);this.store.dispatch(addActivityHistoryItems({id:W.entityId,items:J,componentFactory:W.componentFactory,searchPredicate:W.searchPredicate}))}catch(J){console.log(J.message)}}}let request$a;const bootstrapAddHistoryItems=X=>{request$a=X.registerRequest(addHistoryItemsCommand,AddHistoryItemsHandler)},teardownAddHistoryItems=()=>{request$a==null||request$a.dispose()},{updateActivityHistoryItem}=activityHistoryCollectionsSlice.actions;class UpdateHistoryItemHandler extends StoreBaseHandler{async handle(W){try{ensureAreValidActivityHistoryItems([W.item]),this.store.dispatch(updateActivityHistoryItem({id:W.entityId,item:W.item}))}catch(J){console.log(J.message)}}}const updateHistoryItemCommand="update_history_item_request";let request$9;const bootstrapUpdateHistoryItem=X=>{request$9=X.registerRequest(updateHistoryItemCommand,UpdateHistoryItemHandler)},teardownUpdateHistoryItem=()=>{request$9==null||request$9.dispose()};function connectedProperty(X,W={}){return createConnectedProperty(store)(X,W)}const activityHistorySearchStringSelector=X=>X.activityHistoryFilters.searchString,isAnyCollectionBusySelector=X=>X.activityHistoryCollections.busy.length>0,isAnyCollectionLoadingWithoutAnyLoaded=X=>{const W=Object.values(X.activityHistoryCollections.collections);return!(W!=null&&W.length)&&isAnyCollectionBusySelector(X)},isSomeCollectionLoadedAndOtherLoading=X=>Object.values(X.activityHistoryCollections.collections)&&isAnyCollectionBusySelector(X);function getUniqueObjects(X,W,J){return Array.from(X.map(te=>({id:W.reduce((re,ne)=>re==null?void 0:re[ne],te),title:J.reduce((re,ne)=>re==null?void 0:re[ne],te)})).filter(te=>typeof te.id=="string"&&typeof te.title=="string").reduce((te,re)=>te.set(re.id,re),new Map).values())}class TrueSpec extends Spec{isSatisfiedBy(){return!0}}class CommonFilterSpec extends Spec{constructor(W){super(),this.commonFilters=W}isSatisfiedBy(W){return this.commonFilters.filter(re=>re.enabled).reduce((re,ne)=>re.and(new ne.spec),new TrueSpec).isSatisfiedBy(W)}}class FalseSpec extends Spec{isSatisfiedBy(){return!1}}class PropPathSpec extends Spec{constructor(W,J){super(),this.propPath=W,this.value=J}isSatisfiedBy(W){return this.propPath.reduce((te,re)=>te==null?void 0:te[re],W)===this.value}}class CustomFilterSpec extends Spec{constructor(W){super(),this.filters=W}isSatisfiedBy(W){const J=this.filters.filter(te=>te.enabled);return J.length===0?!0:J.every(te=>{if(!this.belongsToGroup(W,te))return!0;const re=te.filters.filter(ne=>ne.enabled||ne.singleOption);return re.length===0?!0:re.every(ne=>ne.singleOption?ne.enabled?!0:new PropPathSpec(ne.propPathValue,!1).isSatisfiedBy(W):!ne.enabledValues||ne.enabledValues.length===0?!0:ne.enabledValues.reduce((de,ue)=>de.or(new PropPathSpec(ne.propPathValue,ue)),new FalseSpec).isSatisfiedBy(W))})}belongsToGroup(W,J){return W.type===J.id}}const normalizeStringToNFD=X=>X==null?"":String(X).normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLocaleLowerCase(),propContainsString=(X,W)=>{const J=normalizeStringToNFD(X),te=normalizeStringToNFD(W);return J.toString().toLowerCase().indexOf(te)!==-1||J.toString().indexOf(te)!==-1},commonFieldsSearchPredicate=(X,W)=>{var ue,ce,he,pe,fe,ge,be;const J=((ue=X.professional)==null?void 0:ue.name)&&propContainsString((ce=X.professional)==null?void 0:ce.name,W),te=X.center.description&&propContainsString(X.center.description,W),re=((he=X.professional)==null?void 0:he.speciality.description)&&propContainsString((pe=X.professional)==null?void 0:pe.speciality.description,W),ne=((fe=X.professional)==null?void 0:fe.role.description)&&propContainsString((ge=X.professional)==null?void 0:ge.role.description,W),oe=X.service.description&&propContainsString(X.service.description,W),de=(be=X.diagnostics)==null?void 0:be.some(me=>propContainsString(me.id,W)||propContainsString(me.description,W));return J||te||re||ne||oe||de};class SearchStringSpec extends Spec{constructor(W,J){super(),this.searchString=W,this.searchPredicate=J}isSatisfiedBy(W){var re;if(!((re=this.searchString)!=null&&re.trim()))return!0;const J=commonFieldsSearchPredicate(W,this.searchString),te=this.searchPredicate?this.searchPredicate(this.searchString.toLowerCase(),W):!1;return!!(J||te)}}class TypeSpec extends Spec{constructor(W){super(),this.itemType=W}isSatisfiedBy(W){return(W==null?void 0:W.type)===this.itemType}}class ComposedTypeSpec extends Spec{constructor(W){super(),this.filters=W}isSatisfiedBy(W){return this.filters.filter(re=>re.enabled).map(re=>re.id).reduce((re,ne)=>re.or(new TypeSpec(ne)),new FalseSpec).isSatisfiedBy(W)}}const activityHistoryFiltersSelector=X=>X.activityHistoryFilters.filters,activityHistoryCommonFiltersSelector=createSelector(activityHistoryFiltersSelector,X=>{var W;return((W=X.find(isCommonFilterGroup))==null?void 0:W.filters)||[]}),activityHistoryEnabledCommonFiltersSelector=createSelector(activityHistoryCommonFiltersSelector,X=>X.filter(W=>W.enabled)),areCommonFiltersActive=createSelector(activityHistoryEnabledCommonFiltersSelector,X=>!!X.length),activityHistoryCustomFilterGroupsSelector=createSelector(activityHistoryFiltersSelector,X=>X.filter(isNotCommonFilterGroup).sort(sortBySortProperty)),sortBySortProperty=(X,W)=>Number(X.sort)-Number(W.sort),areCustomFiltersActive=createSelector(activityHistoryCustomFilterGroupsSelector,X=>X.some(W=>W.filters.some(J=>{var te;return(te=J.enabledValues)==null?void 0:te.length}))),activeGroupsWithEnabledFilters=createSelector(activityHistoryCustomFilterGroupsSelector,X=>X.filter(W=>W.enabled).map(({id:W,title:J,enabled:te,sort:re,filters:ne})=>({id:W,title:J,enabled:te,sort:re,filters:ne.filter(oe=>{var de;return(de=oe.enabledValues)==null?void 0:de.length})})).filter(W=>W.filters.length>0)),isSameVisit=(X,W)=>{var ne,oe,de,ue,ce,he,pe,fe,ge,be,me,ve,ye,we;const J=((ne=X.professional)==null?void 0:ne.id)===((oe=W.professional)==null?void 0:oe.id)&&((de=X.professional)==null?void 0:de.role.id)===((ue=W.professional)==null?void 0:ue.role.id)&&((ce=X.professional)==null?void 0:ce.speciality.id)===((he=W.professional)==null?void 0:he.speciality.id),te=((pe=X.ep)==null?void 0:pe.id)===((fe=W.ep)==null?void 0:fe.id)&&((ge=X.up)==null?void 0:ge.id)===((be=W.up)==null?void 0:be.id)&&((me=X.center)==null?void 0:me.id)===((ve=W.center)==null?void 0:ve.id)&&((ye=X.service)==null?void 0:ye.id)===((we=W.service)==null?void 0:we.id),re=new Date(X.date).toDateString()===new Date(W.date).toDateString();return J&&te&&re},withinEightHours=(X,W)=>Math.abs(new Date(X).getTime()-new Date(W).getTime())<=8*60*60*1e3,areSameDiagnostics=(X,W)=>{if(X.length!==W.length)return!1;const J=X.map(re=>re.codi).sort(),te=W.map(re=>re.codi).sort();return J.every((re,ne)=>re===te[ne])},groupActivityHistoryItems=X=>{const W=[];return X==null||X.forEach(J=>{let te=!1;for(const re of W){const ne=re.items[0],oe=re.items[re.items.length-1];if(isSameVisit(ne,J)&&withinEightHours(ne.date,J.date)&&withinEightHours(oe.date,J.date)){re.items.push(J),te=!0;break}}te||W.push({idGroup:Math.random().toString(36).substr(2,9),items:[J]})}),W.forEach(J=>{const te=[],re=[];J.items.forEach(ne=>{var oe;if(((oe=ne.diagnostics)==null?void 0:oe.length)>0){let de=!1;for(const ue of te){const ce=ue.items[0];if(areSameDiagnostics(ce.diagnostics,ne.diagnostics)){ue.items.push(ne),de=!0;break}}de||te.push({idSubGroup:Math.random().toString(36).substr(2,9),items:[ne]})}else re.push(ne)}),J.items=re,J.subGroups=te}),W},sortGroupsByMostRecentDate=X=>{const W=re=>re.reduce((ne,oe)=>{const de=new Date(oe.date);return de>ne?de:ne},new Date(0)),J=re=>re.sort((ne,oe)=>new Date(oe.date)-new Date(ne.date)),te=re=>{let ne=[];return re.items.length>0&&ne.push(W(re.items)),re.subGroups.forEach(oe=>{oe.items.length>0&&ne.push(W(oe.items))}),ne.length>0?new Date(Math.max(...ne)):new Date(0)};return X.forEach(re=>{re.items=J(re.items),re.subGroups.forEach(ne=>{ne.items=J(ne.items)})}),X.sort((re,ne)=>te(ne)-te(re))},activityHistoryCollectionsSelector=X=>X.activityHistoryCollections.collections,mapItemsWithMetadata=(X,W,J,te)=>X.map(re=>({...re,searchPredicate:te,componentFactory:W,type:J})),activityHistoryMappedItems=createSelector(activityHistoryCollectionsSelector,X=>Object.values(X).flatMap(W=>mapItemsWithMetadata(W.items,W.componentFactory,W.id,W.searchPredicate))),customFilterGroupsWithOptionsSelector=createSelector(activityHistoryCustomFilterGroupsSelector,activityHistoryCollectionsSelector,(X,W)=>X.map(te=>{const re=W[te.id];return{...te,filters:te.filters.map(ne=>({...ne,options:(ne.singleOption?[]:getUniqueObjects(re.items,ne.propPathValue,ne.propsPathDescription))||[]}))}})),activityHistoryGroupedItems=createSelector(activityHistoryMappedItems,activityHistorySearchStringSelector,activityHistoryCommonFiltersSelector,activityHistoryCustomFilterGroupsSelector,(X,W,J,te)=>{const re=X.filter(de=>new SearchStringSpec(W,de.searchPredicate).and(new CommonFilterSpec(J)).and(new ComposedTypeSpec(te)).and(new CustomFilterSpec(te)).isSatisfiedBy(de)),ne=groupActivityHistoryItems(re);return sortGroupsByMostRecentDate(ne)}),styles$e=":host{min-height:1px;height:100%}.virtualizer{height:100%;padding-inline:16px}.container{min-height:1px;height:100%}.visit:first-child{margin-top:var(--dss-spacing-md)}.visit{width:calc(100% - var(--dss-spacing-md) - var(--dss-spacing-md));display:flex;flex-direction:column;gap:var(--dss-spacing-md);background-color:#fff;border-radius:var(--dss-radius-sm);padding:var(--dss-spacing-sm);margin-bottom:var(--dss-spacing-md)}.visit .visit__header{display:flex;flex-direction:row;align-items:center;gap:16px}.visit .visit__header .title{flex:1;font-size:14px;line-height:24px;display:flex;flex-direction:row;gap:12px;color:var(--color-neutral-800)}.visit .visit__header .title-date{font-weight:700}.visit .visit__header .title-description{font-weight:600;display:flex;flex-direction:row;gap:4px}.visit .visit__header .highlight{background-color:#ff0;font-weight:700}.visit .visit__items{display:flex;flex-direction:column;gap:16px}.visit .visit__items .item[has-divider]{border-bottom:var(--dss-border-width-sm) solid var(--color-neutral-200)}.visit .visit__items .item[has-divider]:last-of-type{border:none}.visit .diagnostics{display:flex;flex-direction:column;gap:16px;border-bottom:var(--dss-border-width-sm) solid var(--color-neutral-200)}.visit .diagnostics:last-of-type{border:none}.visit .diagnostics .diagnostics__header{display:flex;flex-direction:row;align-items:center;gap:16px}.visit .diagnostics .diagnostics__items{display:flex;flex-direction:column}.visit .diagnostics .diagnostics__items .item[has-divider]{border-bottom:var(--dss-border-width-sm) solid var(--color-neutral-200)}.visit .diagnostics .diagnostics__items .item[has-divider]:last-of-type{border:none}.feedback{width:100%;height:100%;display:flex;align-items:center;justify-content:center}";function toDate(X){const W=Object.prototype.toString.call(X);return X instanceof Date||typeof X=="object"&&W==="[object Date]"?new X.constructor(+X):typeof X=="number"||W==="[object Number]"||typeof X=="string"||W==="[object String]"?new Date(X):new Date(NaN)}function constructFrom(X,W){return X instanceof Date?new X.constructor(W):new Date(W)}function addDays(X,W){const J=toDate(X);return isNaN(W)?constructFrom(X,NaN):(W&&J.setDate(J.getDate()+W),J)}const millisecondsInWeek=6048e5,millisecondsInDay=864e5,millisecondsInMinute=6e4,millisecondsInHour=36e5,millisecondsInSecond=1e3;let defaultOptions={};function getDefaultOptions$1(){return defaultOptions}function startOfWeek(X,W){var de,ue,ce,he;const J=getDefaultOptions$1(),te=(W==null?void 0:W.weekStartsOn)??((ue=(de=W==null?void 0:W.locale)==null?void 0:de.options)==null?void 0:ue.weekStartsOn)??J.weekStartsOn??((he=(ce=J.locale)==null?void 0:ce.options)==null?void 0:he.weekStartsOn)??0,re=toDate(X),ne=re.getDay(),oe=(ne<te?7:0)+ne-te;return re.setDate(re.getDate()-oe),re.setHours(0,0,0,0),re}function startOfISOWeek(X){return startOfWeek(X,{weekStartsOn:1})}function getISOWeekYear(X){const W=toDate(X),J=W.getFullYear(),te=constructFrom(X,0);te.setFullYear(J+1,0,4),te.setHours(0,0,0,0);const re=startOfISOWeek(te),ne=constructFrom(X,0);ne.setFullYear(J,0,4),ne.setHours(0,0,0,0);const oe=startOfISOWeek(ne);return W.getTime()>=re.getTime()?J+1:W.getTime()>=oe.getTime()?J:J-1}function startOfDay(X){const W=toDate(X);return W.setHours(0,0,0,0),W}function getTimezoneOffsetInMilliseconds(X){const W=toDate(X),J=new Date(Date.UTC(W.getFullYear(),W.getMonth(),W.getDate(),W.getHours(),W.getMinutes(),W.getSeconds(),W.getMilliseconds()));return J.setUTCFullYear(W.getFullYear()),+X-+J}function differenceInCalendarDays(X,W){const J=startOfDay(X),te=startOfDay(W),re=+J-getTimezoneOffsetInMilliseconds(J),ne=+te-getTimezoneOffsetInMilliseconds(te);return Math.round((re-ne)/millisecondsInDay)}function startOfISOWeekYear(X){const W=getISOWeekYear(X),J=constructFrom(X,0);return J.setFullYear(W,0,4),J.setHours(0,0,0,0),startOfISOWeek(J)}function isDate(X){return X instanceof Date||typeof X=="object"&&Object.prototype.toString.call(X)==="[object Date]"}function isValid(X){if(!isDate(X)&&typeof X!="number")return!1;const W=toDate(X);return!isNaN(Number(W))}function endOfMonth(X){const W=toDate(X),J=W.getMonth();return W.setFullYear(W.getFullYear(),J+1,0),W.setHours(23,59,59,999),W}function eachDayOfInterval(X,W){const J=toDate(X.start),te=toDate(X.end);let re=+J>+te;const ne=re?+J:+te,oe=re?te:J;oe.setHours(0,0,0,0);let de=1;const ue=[];for(;+oe<=ne;)ue.push(toDate(oe)),oe.setDate(oe.getDate()+de),oe.setHours(0,0,0,0);return re?ue.reverse():ue}function startOfMonth(X){const W=toDate(X);return W.setDate(1),W.setHours(0,0,0,0),W}function startOfYear(X){const W=toDate(X),J=constructFrom(X,0);return J.setFullYear(W.getFullYear(),0,1),J.setHours(0,0,0,0),J}const formatDistanceLocale={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},formatDistance=(X,W,J)=>{let te;const re=formatDistanceLocale[X];return typeof re=="string"?te=re:W===1?te=re.one:te=re.other.replace("{{count}}",W.toString()),J!=null&&J.addSuffix?J.comparison&&J.comparison>0?"in "+te:te+" ago":te};function buildFormatLongFn(X){return(W={})=>{const J=W.width?String(W.width):X.defaultWidth;return X.formats[J]||X.formats[X.defaultWidth]}}const dateFormats={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},timeFormats={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},dateTimeFormats={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},formatLong={date:buildFormatLongFn({formats:dateFormats,defaultWidth:"full"}),time:buildFormatLongFn({formats:timeFormats,defaultWidth:"full"}),dateTime:buildFormatLongFn({formats:dateTimeFormats,defaultWidth:"full"})},formatRelativeLocale={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},formatRelative=(X,W,J,te)=>formatRelativeLocale[X];function buildLocalizeFn(X){return(W,J)=>{const te=J!=null&&J.context?String(J.context):"standalone";let re;if(te==="formatting"&&X.formattingValues){const oe=X.defaultFormattingWidth||X.defaultWidth,de=J!=null&&J.width?String(J.width):oe;re=X.formattingValues[de]||X.formattingValues[oe]}else{const oe=X.defaultWidth,de=J!=null&&J.width?String(J.width):X.defaultWidth;re=X.values[de]||X.values[oe]}const ne=X.argumentCallback?X.argumentCallback(W):W;return re[ne]}}const eraValues={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},quarterValues={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},monthValues={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},dayValues={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},dayPeriodValues={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},formattingDayPeriodValues={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},ordinalNumber=(X,W)=>{const J=Number(X),te=J%100;if(te>20||te<10)switch(te%10){case 1:return J+"st";case 2:return J+"nd";case 3:return J+"rd"}return J+"th"},localize={ordinalNumber,era:buildLocalizeFn({values:eraValues,defaultWidth:"wide"}),quarter:buildLocalizeFn({values:quarterValues,defaultWidth:"wide",argumentCallback:X=>X-1}),month:buildLocalizeFn({values:monthValues,defaultWidth:"wide"}),day:buildLocalizeFn({values:dayValues,defaultWidth:"wide"}),dayPeriod:buildLocalizeFn({values:dayPeriodValues,defaultWidth:"wide",formattingValues:formattingDayPeriodValues,defaultFormattingWidth:"wide"})};function buildMatchFn(X){return(W,J={})=>{const te=J.width,re=te&&X.matchPatterns[te]||X.matchPatterns[X.defaultMatchWidth],ne=W.match(re);if(!ne)return null;const oe=ne[0],de=te&&X.parsePatterns[te]||X.parsePatterns[X.defaultParseWidth],ue=Array.isArray(de)?findIndex(de,pe=>pe.test(oe)):findKey(de,pe=>pe.test(oe));let ce;ce=X.valueCallback?X.valueCallback(ue):ue,ce=J.valueCallback?J.valueCallback(ce):ce;const he=W.slice(oe.length);return{value:ce,rest:he}}}function findKey(X,W){for(const J in X)if(Object.prototype.hasOwnProperty.call(X,J)&&W(X[J]))return J}function findIndex(X,W){for(let J=0;J<X.length;J++)if(W(X[J]))return J}function buildMatchPatternFn(X){return(W,J={})=>{const te=W.match(X.matchPattern);if(!te)return null;const re=te[0],ne=W.match(X.parsePattern);if(!ne)return null;let oe=X.valueCallback?X.valueCallback(ne[0]):ne[0];oe=J.valueCallback?J.valueCallback(oe):oe;const de=W.slice(re.length);return{value:oe,rest:de}}}const matchOrdinalNumberPattern=/^(\d+)(th|st|nd|rd)?/i,parseOrdinalNumberPattern=/\d+/i,matchEraPatterns={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},parseEraPatterns={any:[/^b/i,/^(a|c)/i]},matchQuarterPatterns={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},parseQuarterPatterns={any:[/1/i,/2/i,/3/i,/4/i]},matchMonthPatterns={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},parseMonthPatterns={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},matchDayPatterns={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},parseDayPatterns={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},matchDayPeriodPatterns={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},parseDayPeriodPatterns={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},match={ordinalNumber:buildMatchPatternFn({matchPattern:matchOrdinalNumberPattern,parsePattern:parseOrdinalNumberPattern,valueCallback:X=>parseInt(X,10)}),era:buildMatchFn({matchPatterns:matchEraPatterns,defaultMatchWidth:"wide",parsePatterns:parseEraPatterns,defaultParseWidth:"any"}),quarter:buildMatchFn({matchPatterns:matchQuarterPatterns,defaultMatchWidth:"wide",parsePatterns:parseQuarterPatterns,defaultParseWidth:"any",valueCallback:X=>X+1}),month:buildMatchFn({matchPatterns:matchMonthPatterns,defaultMatchWidth:"wide",parsePatterns:parseMonthPatterns,defaultParseWidth:"any"}),day:buildMatchFn({matchPatterns:matchDayPatterns,defaultMatchWidth:"wide",parsePatterns:parseDayPatterns,defaultParseWidth:"any"}),dayPeriod:buildMatchFn({matchPatterns:matchDayPeriodPatterns,defaultMatchWidth:"any",parsePatterns:parseDayPeriodPatterns,defaultParseWidth:"any"})},enUS={code:"en-US",formatDistance,formatLong,formatRelative,localize,match,options:{weekStartsOn:0,firstWeekContainsDate:1}};function getDayOfYear(X){const W=toDate(X);return differenceInCalendarDays(W,startOfYear(W))+1}function getISOWeek(X){const W=toDate(X),J=+startOfISOWeek(W)-+startOfISOWeekYear(W);return Math.round(J/millisecondsInWeek)+1}function getWeekYear(X,W){var he,pe,fe,ge;const J=toDate(X),te=J.getFullYear(),re=getDefaultOptions$1(),ne=(W==null?void 0:W.firstWeekContainsDate)??((pe=(he=W==null?void 0:W.locale)==null?void 0:he.options)==null?void 0:pe.firstWeekContainsDate)??re.firstWeekContainsDate??((ge=(fe=re.locale)==null?void 0:fe.options)==null?void 0:ge.firstWeekContainsDate)??1,oe=constructFrom(X,0);oe.setFullYear(te+1,0,ne),oe.setHours(0,0,0,0);const de=startOfWeek(oe,W),ue=constructFrom(X,0);ue.setFullYear(te,0,ne),ue.setHours(0,0,0,0);const ce=startOfWeek(ue,W);return J.getTime()>=de.getTime()?te+1:J.getTime()>=ce.getTime()?te:te-1}function startOfWeekYear(X,W){var de,ue,ce,he;const J=getDefaultOptions$1(),te=(W==null?void 0:W.firstWeekContainsDate)??((ue=(de=W==null?void 0:W.locale)==null?void 0:de.options)==null?void 0:ue.firstWeekContainsDate)??J.firstWeekContainsDate??((he=(ce=J.locale)==null?void 0:ce.options)==null?void 0:he.firstWeekContainsDate)??1,re=getWeekYear(X,W),ne=constructFrom(X,0);return ne.setFullYear(re,0,te),ne.setHours(0,0,0,0),startOfWeek(ne,W)}function getWeek(X,W){const J=toDate(X),te=+startOfWeek(J,W)-+startOfWeekYear(J,W);return Math.round(te/millisecondsInWeek)+1}function addLeadingZeros(X,W){const J=X<0?"-":"",te=Math.abs(X).toString().padStart(W,"0");return J+te}const lightFormatters={y(X,W){const J=X.getFullYear(),te=J>0?J:1-J;return addLeadingZeros(W==="yy"?te%100:te,W.length)},M(X,W){const J=X.getMonth();return W==="M"?String(J+1):addLeadingZeros(J+1,2)},d(X,W){return addLeadingZeros(X.getDate(),W.length)},a(X,W){const J=X.getHours()/12>=1?"pm":"am";switch(W){case"a":case"aa":return J.toUpperCase();case"aaa":return J;case"aaaaa":return J[0];case"aaaa":default:return J==="am"?"a.m.":"p.m."}},h(X,W){return addLeadingZeros(X.getHours()%12||12,W.length)},H(X,W){return addLeadingZeros(X.getHours(),W.length)},m(X,W){return addLeadingZeros(X.getMinutes(),W.length)},s(X,W){return addLeadingZeros(X.getSeconds(),W.length)},S(X,W){const J=W.length,te=X.getMilliseconds(),re=Math.trunc(te*Math.pow(10,J-3));return addLeadingZeros(re,W.length)}},dayPeriodEnum={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},formatters={G:function(X,W,J){const te=X.getFullYear()>0?1:0;switch(W){case"G":case"GG":case"GGG":return J.era(te,{width:"abbreviated"});case"GGGGG":return J.era(te,{width:"narrow"});case"GGGG":default:return J.era(te,{width:"wide"})}},y:function(X,W,J){if(W==="yo"){const te=X.getFullYear(),re=te>0?te:1-te;return J.ordinalNumber(re,{unit:"year"})}return lightFormatters.y(X,W)},Y:function(X,W,J,te){const re=getWeekYear(X,te),ne=re>0?re:1-re;if(W==="YY"){const oe=ne%100;return addLeadingZeros(oe,2)}return W==="Yo"?J.ordinalNumber(ne,{unit:"year"}):addLeadingZeros(ne,W.length)},R:function(X,W){const J=getISOWeekYear(X);return addLeadingZeros(J,W.length)},u:function(X,W){const J=X.getFullYear();return addLeadingZeros(J,W.length)},Q:function(X,W,J){const te=Math.ceil((X.getMonth()+1)/3);switch(W){case"Q":return String(te);case"QQ":return addLeadingZeros(te,2);case"Qo":return J.ordinalNumber(te,{unit:"quarter"});case"QQQ":return J.quarter(te,{width:"abbreviated",context:"formatting"});case"QQQQQ":return J.quarter(te,{width:"narrow",context:"formatting"});case"QQQQ":default:return J.quarter(te,{width:"wide",context:"formatting"})}},q:function(X,W,J){const te=Math.ceil((X.getMonth()+1)/3);switch(W){case"q":return String(te);case"qq":return addLeadingZeros(te,2);case"qo":return J.ordinalNumber(te,{unit:"quarter"});case"qqq":return J.quarter(te,{width:"abbreviated",context:"standalone"});case"qqqqq":return J.quarter(te,{width:"narrow",context:"standalone"});case"qqqq":default:return J.quarter(te,{width:"wide",context:"standalone"})}},M:function(X,W,J){const te=X.getMonth();switch(W){case"M":case"MM":return lightFormatters.M(X,W);case"Mo":return J.ordinalNumber(te+1,{unit:"month"});case"MMM":return J.month(te,{width:"abbreviated",context:"formatting"});case"MMMMM":return J.month(te,{width:"narrow",context:"formatting"});case"MMMM":default:return J.month(te,{width:"wide",context:"formatting"})}},L:function(X,W,J){const te=X.getMonth();switch(W){case"L":return String(te+1);case"LL":return addLeadingZeros(te+1,2);case"Lo":return J.ordinalNumber(te+1,{unit:"month"});case"LLL":return J.month(te,{width:"abbreviated",context:"standalone"});case"LLLLL":return J.month(te,{width:"narrow",context:"standalone"});case"LLLL":default:return J.month(te,{width:"wide",context:"standalone"})}},w:function(X,W,J,te){const re=getWeek(X,te);return W==="wo"?J.ordinalNumber(re,{unit:"week"}):addLeadingZeros(re,W.length)},I:function(X,W,J){const te=getISOWeek(X);return W==="Io"?J.ordinalNumber(te,{unit:"week"}):addLeadingZeros(te,W.length)},d:function(X,W,J){return W==="do"?J.ordinalNumber(X.getDate(),{unit:"date"}):lightFormatters.d(X,W)},D:function(X,W,J){const te=getDayOfYear(X);return W==="Do"?J.ordinalNumber(te,{unit:"dayOfYear"}):addLeadingZeros(te,W.length)},E:function(X,W,J){const te=X.getDay();switch(W){case"E":case"EE":case"EEE":return J.day(te,{width:"abbreviated",context:"formatting"});case"EEEEE":return J.day(te,{width:"narrow",context:"formatting"});case"EEEEEE":return J.day(te,{width:"short",context:"formatting"});case"EEEE":default:return J.day(te,{width:"wide",context:"formatting"})}},e:function(X,W,J,te){const re=X.getDay(),ne=(re-te.weekStartsOn+8)%7||7;switch(W){case"e":return String(ne);case"ee":return addLeadingZeros(ne,2);case"eo":return J.ordinalNumber(ne,{unit:"day"});case"eee":return J.day(re,{width:"abbreviated",context:"formatting"});case"eeeee":return J.day(re,{width:"narrow",context:"formatting"});case"eeeeee":return J.day(re,{width:"short",context:"formatting"});case"eeee":default:return J.day(re,{width:"wide",context:"formatting"})}},c:function(X,W,J,te){const re=X.getDay(),ne=(re-te.weekStartsOn+8)%7||7;switch(W){case"c":return String(ne);case"cc":return addLeadingZeros(ne,W.length);case"co":return J.ordinalNumber(ne,{unit:"day"});case"ccc":return J.day(re,{width:"abbreviated",context:"standalone"});case"ccccc":return J.day(re,{width:"narrow",context:"standalone"});case"cccccc":return J.day(re,{width:"short",context:"standalone"});case"cccc":default:return J.day(re,{width:"wide",context:"standalone"})}},i:function(X,W,J){const te=X.getDay(),re=te===0?7:te;switch(W){case"i":return String(re);case"ii":return addLeadingZeros(re,W.length);case"io":return J.ordinalNumber(re,{unit:"day"});case"iii":return J.day(te,{width:"abbreviated",context:"formatting"});case"iiiii":return J.day(te,{width:"narrow",context:"formatting"});case"iiiiii":return J.day(te,{width:"short",context:"formatting"});case"iiii":default:return J.day(te,{width:"wide",context:"formatting"})}},a:function(X,W,J){const re=X.getHours()/12>=1?"pm":"am";switch(W){case"a":case"aa":return J.dayPeriod(re,{width:"abbreviated",context:"formatting"});case"aaa":return J.dayPeriod(re,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return J.dayPeriod(re,{width:"narrow",context:"formatting"});case"aaaa":default:return J.dayPeriod(re,{width:"wide",context:"formatting"})}},b:function(X,W,J){const te=X.getHours();let re;switch(te===12?re=dayPeriodEnum.noon:te===0?re=dayPeriodEnum.midnight:re=te/12>=1?"pm":"am",W){case"b":case"bb":return J.dayPeriod(re,{width:"abbreviated",context:"formatting"});case"bbb":return J.dayPeriod(re,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return J.dayPeriod(re,{width:"narrow",context:"formatting"});case"bbbb":default:return J.dayPeriod(re,{width:"wide",context:"formatting"})}},B:function(X,W,J){const te=X.getHours();let re;switch(te>=17?re=dayPeriodEnum.evening:te>=12?re=dayPeriodEnum.afternoon:te>=4?re=dayPeriodEnum.morning:re=dayPeriodEnum.night,W){case"B":case"BB":case"BBB":return J.dayPeriod(re,{width:"abbreviated",context:"formatting"});case"BBBBB":return J.dayPeriod(re,{width:"narrow",context:"formatting"});case"BBBB":default:return J.dayPeriod(re,{width:"wide",context:"formatting"})}},h:function(X,W,J){if(W==="ho"){let te=X.getHours()%12;return te===0&&(te=12),J.ordinalNumber(te,{unit:"hour"})}return lightFormatters.h(X,W)},H:function(X,W,J){return W==="Ho"?J.ordinalNumber(X.getHours(),{unit:"hour"}):lightFormatters.H(X,W)},K:function(X,W,J){const te=X.getHours()%12;return W==="Ko"?J.ordinalNumber(te,{unit:"hour"}):addLeadingZeros(te,W.length)},k:function(X,W,J){let te=X.getHours();return te===0&&(te=24),W==="ko"?J.ordinalNumber(te,{unit:"hour"}):addLeadingZeros(te,W.length)},m:function(X,W,J){return W==="mo"?J.ordinalNumber(X.getMinutes(),{unit:"minute"}):lightFormatters.m(X,W)},s:function(X,W,J){return W==="so"?J.ordinalNumber(X.getSeconds(),{unit:"second"}):lightFormatters.s(X,W)},S:function(X,W){return lightFormatters.S(X,W)},X:function(X,W,J){const te=X.getTimezoneOffset();if(te===0)return"Z";switch(W){case"X":return formatTimezoneWithOptionalMinutes(te);case"XXXX":case"XX":return formatTimezone(te);case"XXXXX":case"XXX":default:return formatTimezone(te,":")}},x:function(X,W,J){const te=X.getTimezoneOffset();switch(W){case"x":return formatTimezoneWithOptionalMinutes(te);case"xxxx":case"xx":return formatTimezone(te);case"xxxxx":case"xxx":default:return formatTimezone(te,":")}},O:function(X,W,J){const te=X.getTimezoneOffset();switch(W){case"O":case"OO":case"OOO":return"GMT"+formatTimezoneShort(te,":");case"OOOO":default:return"GMT"+formatTimezone(te,":")}},z:function(X,W,J){const te=X.getTimezoneOffset();switch(W){case"z":case"zz":case"zzz":return"GMT"+formatTimezoneShort(te,":");case"zzzz":default:return"GMT"+formatTimezone(te,":")}},t:function(X,W,J){const te=Math.trunc(X.getTime()/1e3);return addLeadingZeros(te,W.length)},T:function(X,W,J){const te=X.getTime();return addLeadingZeros(te,W.length)}};function formatTimezoneShort(X,W=""){const J=X>0?"-":"+",te=Math.abs(X),re=Math.trunc(te/60),ne=te%60;return ne===0?J+String(re):J+String(re)+W+addLeadingZeros(ne,2)}function formatTimezoneWithOptionalMinutes(X,W){return X%60===0?(X>0?"-":"+")+addLeadingZeros(Math.abs(X)/60,2):formatTimezone(X,W)}function formatTimezone(X,W=""){const J=X>0?"-":"+",te=Math.abs(X),re=addLeadingZeros(Math.trunc(te/60),2),ne=addLeadingZeros(te%60,2);return J+re+W+ne}const dateLongFormatter=(X,W)=>{switch(X){case"P":return W.date({width:"short"});case"PP":return W.date({width:"medium"});case"PPP":return W.date({width:"long"});case"PPPP":default:return W.date({width:"full"})}},timeLongFormatter=(X,W)=>{switch(X){case"p":return W.time({width:"short"});case"pp":return W.time({width:"medium"});case"ppp":return W.time({width:"long"});case"pppp":default:return W.time({width:"full"})}},dateTimeLongFormatter=(X,W)=>{const J=X.match(/(P+)(p+)?/)||[],te=J[1],re=J[2];if(!re)return dateLongFormatter(X,W);let ne;switch(te){case"P":ne=W.dateTime({width:"short"});break;case"PP":ne=W.dateTime({width:"medium"});break;case"PPP":ne=W.dateTime({width:"long"});break;case"PPPP":default:ne=W.dateTime({width:"full"});break}return ne.replace("{{date}}",dateLongFormatter(te,W)).replace("{{time}}",timeLongFormatter(re,W))},longFormatters={p:timeLongFormatter,P:dateTimeLongFormatter},dayOfYearTokenRE=/^D+$/,weekYearTokenRE=/^Y+$/,throwTokens=["D","DD","YY","YYYY"];function isProtectedDayOfYearToken(X){return dayOfYearTokenRE.test(X)}function isProtectedWeekYearToken(X){return weekYearTokenRE.test(X)}function warnOrThrowProtectedError(X,W,J){const te=message(X,W,J);if(console.warn(te),throwTokens.includes(X))throw new RangeError(te)}function message(X,W,J){const te=X[0]==="Y"?"years":"days of the month";return`Use \`${X.toLowerCase()}\` instead of \`${X}\` (in \`${W}\`) for formatting ${te} to the input \`${J}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const formattingTokensRegExp$1=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,longFormattingTokensRegExp$1=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,escapedStringRegExp$1=/^'([^]*?)'?$/,doubleQuoteRegExp$1=/''/g,unescapedLatinCharacterRegExp$1=/[a-zA-Z]/;function format(X,W,J){var he,pe,fe,ge;const te=getDefaultOptions$1(),re=te.locale??enUS,ne=te.firstWeekContainsDate??((pe=(he=te.locale)==null?void 0:he.options)==null?void 0:pe.firstWeekContainsDate)??1,oe=te.weekStartsOn??((ge=(fe=te.locale)==null?void 0:fe.options)==null?void 0:ge.weekStartsOn)??0,de=toDate(X);if(!isValid(de))throw new RangeError("Invalid time value");let ue=W.match(longFormattingTokensRegExp$1).map(be=>{const me=be[0];if(me==="p"||me==="P"){const ve=longFormatters[me];return ve(be,re.formatLong)}return be}).join("").match(formattingTokensRegExp$1).map(be=>{if(be==="''")return{isToken:!1,value:"'"};const me=be[0];if(me==="'")return{isToken:!1,value:cleanEscapedString$1(be)};if(formatters[me])return{isToken:!0,value:be};if(me.match(unescapedLatinCharacterRegExp$1))throw new RangeError("Format string contains an unescaped latin alphabet character `"+me+"`");return{isToken:!1,value:be}});re.localize.preprocessor&&(ue=re.localize.preprocessor(de,ue));const ce={firstWeekContainsDate:ne,weekStartsOn:oe,locale:re};return ue.map(be=>{if(!be.isToken)return be.value;const me=be.value;(isProtectedWeekYearToken(me)||isProtectedDayOfYearToken(me))&&warnOrThrowProtectedError(me,W,String(X));const ve=formatters[me[0]];return ve(de,me,re.localize,ce)}).join("")}function cleanEscapedString$1(X){const W=X.match(escapedStringRegExp$1);return W?W[1].replace(doubleQuoteRegExp$1,"'"):X}function getDay(X){return toDate(X).getDay()}function getDefaultOptions(){return Object.assign({},getDefaultOptions$1())}function getISODay(X){let J=toDate(X).getDay();return J===0&&(J=7),J}function transpose(X,W){const J=W instanceof Date?constructFrom(W,0):new W(0);return J.setFullYear(X.getFullYear(),X.getMonth(),X.getDate()),J.setHours(X.getHours(),X.getMinutes(),X.getSeconds(),X.getMilliseconds()),J}const TIMEZONE_UNIT_PRIORITY=10;class Setter{constructor(){zt(this,"subPriority",0)}validate(W,J){return!0}}class ValueSetter extends Setter{constructor(W,J,te,re,ne){super(),this.value=W,this.validateValue=J,this.setValue=te,this.priority=re,ne&&(this.subPriority=ne)}validate(W,J){return this.validateValue(W,this.value,J)}set(W,J,te){return this.setValue(W,J,this.value,te)}}class DateToSystemTimezoneSetter extends Setter{constructor(){super(...arguments);zt(this,"priority",TIMEZONE_UNIT_PRIORITY);zt(this,"subPriority",-1)}set(J,te){return te.timestampIsSet?J:constructFrom(J,transpose(J,Date))}}class Parser{run(W,J,te,re){const ne=this.parse(W,J,te,re);return ne?{setter:new ValueSetter(ne.value,this.validate,this.set,this.priority,this.subPriority),rest:ne.rest}:null}validate(W,J,te){return!0}}class EraParser extends Parser{constructor(){super(...arguments);zt(this,"priority",140);zt(this,"incompatibleTokens",["R","u","t","T"])}parse(J,te,re){switch(te){case"G":case"GG":case"GGG":return re.era(J,{width:"abbreviated"})||re.era(J,{width:"narrow"});case"GGGGG":return re.era(J,{width:"narrow"});case"GGGG":default:return re.era(J,{width:"wide"})||re.era(J,{width:"abbreviated"})||re.era(J,{width:"narrow"})}}set(J,te,re){return te.era=re,J.setFullYear(re,0,1),J.setHours(0,0,0,0),J}}const numericPatterns={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},timezonePatterns={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function mapValue(X,W){return X&&{value:W(X.value),rest:X.rest}}function parseNumericPattern(X,W){const J=W.match(X);return J?{value:parseInt(J[0],10),rest:W.slice(J[0].length)}:null}function parseTimezonePattern(X,W){const J=W.match(X);if(!J)return null;if(J[0]==="Z")return{value:0,rest:W.slice(1)};const te=J[1]==="+"?1:-1,re=J[2]?parseInt(J[2],10):0,ne=J[3]?parseInt(J[3],10):0,oe=J[5]?parseInt(J[5],10):0;return{value:te*(re*millisecondsInHour+ne*millisecondsInMinute+oe*millisecondsInSecond),rest:W.slice(J[0].length)}}function parseAnyDigitsSigned(X){return parseNumericPattern(numericPatterns.anyDigitsSigned,X)}function parseNDigits(X,W){switch(X){case 1:return parseNumericPattern(numericPatterns.singleDigit,W);case 2:return parseNumericPattern(numericPatterns.twoDigits,W);case 3:return parseNumericPattern(numericPatterns.threeDigits,W);case 4:return parseNumericPattern(numericPatterns.fourDigits,W);default:return parseNumericPattern(new RegExp("^\\d{1,"+X+"}"),W)}}function parseNDigitsSigned(X,W){switch(X){case 1:return parseNumericPattern(numericPatterns.singleDigitSigned,W);case 2:return parseNumericPattern(numericPatterns.twoDigitsSigned,W);case 3:return parseNumericPattern(numericPatterns.threeDigitsSigned,W);case 4:return parseNumericPattern(numericPatterns.fourDigitsSigned,W);default:return parseNumericPattern(new RegExp("^-?\\d{1,"+X+"}"),W)}}function dayPeriodEnumToHours(X){switch(X){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function normalizeTwoDigitYear(X,W){const J=W>0,te=J?W:1-W;let re;if(te<=50)re=X||100;else{const ne=te+50,oe=Math.trunc(ne/100)*100,de=X>=ne%100;re=X+oe-(de?100:0)}return J?re:1-re}function isLeapYearIndex(X){return X%400===0||X%4===0&&X%100!==0}class YearParser extends Parser{constructor(){super(...arguments);zt(this,"priority",130);zt(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(J,te,re){const ne=oe=>({year:oe,isTwoDigitYear:te==="yy"});switch(te){case"y":return mapValue(parseNDigits(4,J),ne);case"yo":return mapValue(re.ordinalNumber(J,{unit:"year"}),ne);default:return mapValue(parseNDigits(te.length,J),ne)}}validate(J,te){return te.isTwoDigitYear||te.year>0}set(J,te,re){const ne=J.getFullYear();if(re.isTwoDigitYear){const de=normalizeTwoDigitYear(re.year,ne);return J.setFullYear(de,0,1),J.setHours(0,0,0,0),J}const oe=!("era"in te)||te.era===1?re.year:1-re.year;return J.setFullYear(oe,0,1),J.setHours(0,0,0,0),J}}class LocalWeekYearParser extends Parser{constructor(){super(...arguments);zt(this,"priority",130);zt(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(J,te,re){const ne=oe=>({year:oe,isTwoDigitYear:te==="YY"});switch(te){case"Y":return mapValue(parseNDigits(4,J),ne);case"Yo":return mapValue(re.ordinalNumber(J,{unit:"year"}),ne);default:return mapValue(parseNDigits(te.length,J),ne)}}validate(J,te){return te.isTwoDigitYear||te.year>0}set(J,te,re,ne){const oe=getWeekYear(J,ne);if(re.isTwoDigitYear){const ue=normalizeTwoDigitYear(re.year,oe);return J.setFullYear(ue,0,ne.firstWeekContainsDate),J.setHours(0,0,0,0),startOfWeek(J,ne)}const de=!("era"in te)||te.era===1?re.year:1-re.year;return J.setFullYear(de,0,ne.firstWeekContainsDate),J.setHours(0,0,0,0),startOfWeek(J,ne)}}class ISOWeekYearParser extends Parser{constructor(){super(...arguments);zt(this,"priority",130);zt(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(J,te){return parseNDigitsSigned(te==="R"?4:te.length,J)}set(J,te,re){const ne=constructFrom(J,0);return ne.setFullYear(re,0,4),ne.setHours(0,0,0,0),startOfISOWeek(ne)}}class ExtendedYearParser extends Parser{constructor(){super(...arguments);zt(this,"priority",130);zt(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(J,te){return parseNDigitsSigned(te==="u"?4:te.length,J)}set(J,te,re){return J.setFullYear(re,0,1),J.setHours(0,0,0,0),J}}class QuarterParser extends Parser{constructor(){super(...arguments);zt(this,"priority",120);zt(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(J,te,re){switch(te){case"Q":case"QQ":return parseNDigits(te.length,J);case"Qo":return re.ordinalNumber(J,{unit:"quarter"});case"QQQ":return re.quarter(J,{width:"abbreviated",context:"formatting"})||re.quarter(J,{width:"narrow",context:"formatting"});case"QQQQQ":return re.quarter(J,{width:"narrow",context:"formatting"});case"QQQQ":default:return re.quarter(J,{width:"wide",context:"formatting"})||re.quarter(J,{width:"abbreviated",context:"formatting"})||re.quarter(J,{width:"narrow",context:"formatting"})}}validate(J,te){return te>=1&&te<=4}set(J,te,re){return J.setMonth((re-1)*3,1),J.setHours(0,0,0,0),J}}class StandAloneQuarterParser extends Parser{constructor(){super(...arguments);zt(this,"priority",120);zt(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(J,te,re){switch(te){case"q":case"qq":return parseNDigits(te.length,J);case"qo":return re.ordinalNumber(J,{unit:"quarter"});case"qqq":return re.quarter(J,{width:"abbreviated",context:"standalone"})||re.quarter(J,{width:"narrow",context:"standalone"});case"qqqqq":return re.quarter(J,{width:"narrow",context:"standalone"});case"qqqq":default:return re.quarter(J,{width:"wide",context:"standalone"})||re.quarter(J,{width:"abbreviated",context:"standalone"})||re.quarter(J,{width:"narrow",context:"standalone"})}}validate(J,te){return te>=1&&te<=4}set(J,te,re){return J.setMonth((re-1)*3,1),J.setHours(0,0,0,0),J}}class MonthParser extends Parser{constructor(){super(...arguments);zt(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);zt(this,"priority",110)}parse(J,te,re){const ne=oe=>oe-1;switch(te){case"M":return mapValue(parseNumericPattern(numericPatterns.month,J),ne);case"MM":return mapValue(parseNDigits(2,J),ne);case"Mo":return mapValue(re.ordinalNumber(J,{unit:"month"}),ne);case"MMM":return re.month(J,{width:"abbreviated",context:"formatting"})||re.month(J,{width:"narrow",context:"formatting"});case"MMMMM":return re.month(J,{width:"narrow",context:"formatting"});case"MMMM":default:return re.month(J,{width:"wide",context:"formatting"})||re.month(J,{width:"abbreviated",context:"formatting"})||re.month(J,{width:"narrow",context:"formatting"})}}validate(J,te){return te>=0&&te<=11}set(J,te,re){return J.setMonth(re,1),J.setHours(0,0,0,0),J}}class StandAloneMonthParser extends Parser{constructor(){super(...arguments);zt(this,"priority",110);zt(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(J,te,re){const ne=oe=>oe-1;switch(te){case"L":return mapValue(parseNumericPattern(numericPatterns.month,J),ne);case"LL":return mapValue(parseNDigits(2,J),ne);case"Lo":return mapValue(re.ordinalNumber(J,{unit:"month"}),ne);case"LLL":return re.month(J,{width:"abbreviated",context:"standalone"})||re.month(J,{width:"narrow",context:"standalone"});case"LLLLL":return re.month(J,{width:"narrow",context:"standalone"});case"LLLL":default:return re.month(J,{width:"wide",context:"standalone"})||re.month(J,{width:"abbreviated",context:"standalone"})||re.month(J,{width:"narrow",context:"standalone"})}}validate(J,te){return te>=0&&te<=11}set(J,te,re){return J.setMonth(re,1),J.setHours(0,0,0,0),J}}function setWeek(X,W,J){const te=toDate(X),re=getWeek(te,J)-W;return te.setDate(te.getDate()-re*7),te}class LocalWeekParser extends Parser{constructor(){super(...arguments);zt(this,"priority",100);zt(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(J,te,re){switch(te){case"w":return parseNumericPattern(numericPatterns.week,J);case"wo":return re.ordinalNumber(J,{unit:"week"});default:return parseNDigits(te.length,J)}}validate(J,te){return te>=1&&te<=53}set(J,te,re,ne){return startOfWeek(setWeek(J,re,ne),ne)}}function setISOWeek(X,W){const J=toDate(X),te=getISOWeek(J)-W;return J.setDate(J.getDate()-te*7),J}class ISOWeekParser extends Parser{constructor(){super(...arguments);zt(this,"priority",100);zt(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(J,te,re){switch(te){case"I":return parseNumericPattern(numericPatterns.week,J);case"Io":return re.ordinalNumber(J,{unit:"week"});default:return parseNDigits(te.length,J)}}validate(J,te){return te>=1&&te<=53}set(J,te,re){return startOfISOWeek(setISOWeek(J,re))}}const DAYS_IN_MONTH=[31,28,31,30,31,30,31,31,30,31,30,31],DAYS_IN_MONTH_LEAP_YEAR=[31,29,31,30,31,30,31,31,30,31,30,31];class DateParser extends Parser{constructor(){super(...arguments);zt(this,"priority",90);zt(this,"subPriority",1);zt(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(J,te,re){switch(te){case"d":return parseNumericPattern(numericPatterns.date,J);case"do":return re.ordinalNumber(J,{unit:"date"});default:return parseNDigits(te.length,J)}}validate(J,te){const re=J.getFullYear(),ne=isLeapYearIndex(re),oe=J.getMonth();return ne?te>=1&&te<=DAYS_IN_MONTH_LEAP_YEAR[oe]:te>=1&&te<=DAYS_IN_MONTH[oe]}set(J,te,re){return J.setDate(re),J.setHours(0,0,0,0),J}}class DayOfYearParser extends Parser{constructor(){super(...arguments);zt(this,"priority",90);zt(this,"subpriority",1);zt(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(J,te,re){switch(te){case"D":case"DD":return parseNumericPattern(numericPatterns.dayOfYear,J);case"Do":return re.ordinalNumber(J,{unit:"date"});default:return parseNDigits(te.length,J)}}validate(J,te){const re=J.getFullYear();return isLeapYearIndex(re)?te>=1&&te<=366:te>=1&&te<=365}set(J,te,re){return J.setMonth(0,re),J.setHours(0,0,0,0),J}}function setDay(X,W,J){var pe,fe,ge,be;const te=getDefaultOptions$1(),re=(J==null?void 0:J.weekStartsOn)??((fe=(pe=J==null?void 0:J.locale)==null?void 0:pe.options)==null?void 0:fe.weekStartsOn)??te.weekStartsOn??((be=(ge=te.locale)==null?void 0:ge.options)==null?void 0:be.weekStartsOn)??0,ne=toDate(X),oe=ne.getDay(),ue=(W%7+7)%7,ce=7-re,he=W<0||W>6?W-(oe+ce)%7:(ue+ce)%7-(oe+ce)%7;return addDays(ne,he)}class DayParser extends Parser{constructor(){super(...arguments);zt(this,"priority",90);zt(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(J,te,re){switch(te){case"E":case"EE":case"EEE":return re.day(J,{width:"abbreviated",context:"formatting"})||re.day(J,{width:"short",context:"formatting"})||re.day(J,{width:"narrow",context:"formatting"});case"EEEEE":return re.day(J,{width:"narrow",context:"formatting"});case"EEEEEE":return re.day(J,{width:"short",context:"formatting"})||re.day(J,{width:"narrow",context:"formatting"});case"EEEE":default:return re.day(J,{width:"wide",context:"formatting"})||re.day(J,{width:"abbreviated",context:"formatting"})||re.day(J,{width:"short",context:"formatting"})||re.day(J,{width:"narrow",context:"formatting"})}}validate(J,te){return te>=0&&te<=6}set(J,te,re,ne){return J=setDay(J,re,ne),J.setHours(0,0,0,0),J}}class LocalDayParser extends Parser{constructor(){super(...arguments);zt(this,"priority",90);zt(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(J,te,re,ne){const oe=de=>{const ue=Math.floor((de-1)/7)*7;return(de+ne.weekStartsOn+6)%7+ue};switch(te){case"e":case"ee":return mapValue(parseNDigits(te.length,J),oe);case"eo":return mapValue(re.ordinalNumber(J,{unit:"day"}),oe);case"eee":return re.day(J,{width:"abbreviated",context:"formatting"})||re.day(J,{width:"short",context:"formatting"})||re.day(J,{width:"narrow",context:"formatting"});case"eeeee":return re.day(J,{width:"narrow",context:"formatting"});case"eeeeee":return re.day(J,{width:"short",context:"formatting"})||re.day(J,{width:"narrow",context:"formatting"});case"eeee":default:return re.day(J,{width:"wide",context:"formatting"})||re.day(J,{width:"abbreviated",context:"formatting"})||re.day(J,{width:"short",context:"formatting"})||re.day(J,{width:"narrow",context:"formatting"})}}validate(J,te){return te>=0&&te<=6}set(J,te,re,ne){return J=setDay(J,re,ne),J.setHours(0,0,0,0),J}}class StandAloneLocalDayParser extends Parser{constructor(){super(...arguments);zt(this,"priority",90);zt(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(J,te,re,ne){const oe=de=>{const ue=Math.floor((de-1)/7)*7;return(de+ne.weekStartsOn+6)%7+ue};switch(te){case"c":case"cc":return mapValue(parseNDigits(te.length,J),oe);case"co":return mapValue(re.ordinalNumber(J,{unit:"day"}),oe);case"ccc":return re.day(J,{width:"abbreviated",context:"standalone"})||re.day(J,{width:"short",context:"standalone"})||re.day(J,{width:"narrow",context:"standalone"});case"ccccc":return re.day(J,{width:"narrow",context:"standalone"});case"cccccc":return re.day(J,{width:"short",context:"standalone"})||re.day(J,{width:"narrow",context:"standalone"});case"cccc":default:return re.day(J,{width:"wide",context:"standalone"})||re.day(J,{width:"abbreviated",context:"standalone"})||re.day(J,{width:"short",context:"standalone"})||re.day(J,{width:"narrow",context:"standalone"})}}validate(J,te){return te>=0&&te<=6}set(J,te,re,ne){return J=setDay(J,re,ne),J.setHours(0,0,0,0),J}}function setISODay(X,W){const J=toDate(X),te=getISODay(J),re=W-te;return addDays(J,re)}class ISODayParser extends Parser{constructor(){super(...arguments);zt(this,"priority",90);zt(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(J,te,re){const ne=oe=>oe===0?7:oe;switch(te){case"i":case"ii":return parseNDigits(te.length,J);case"io":return re.ordinalNumber(J,{unit:"day"});case"iii":return mapValue(re.day(J,{width:"abbreviated",context:"formatting"})||re.day(J,{width:"short",context:"formatting"})||re.day(J,{width:"narrow",context:"formatting"}),ne);case"iiiii":return mapValue(re.day(J,{width:"narrow",context:"formatting"}),ne);case"iiiiii":return mapValue(re.day(J,{width:"short",context:"formatting"})||re.day(J,{width:"narrow",context:"formatting"}),ne);case"iiii":default:return mapValue(re.day(J,{width:"wide",context:"formatting"})||re.day(J,{width:"abbreviated",context:"formatting"})||re.day(J,{width:"short",context:"formatting"})||re.day(J,{width:"narrow",context:"formatting"}),ne)}}validate(J,te){return te>=1&&te<=7}set(J,te,re){return J=setISODay(J,re),J.setHours(0,0,0,0),J}}class AMPMParser extends Parser{constructor(){super(...arguments);zt(this,"priority",80);zt(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(J,te,re){switch(te){case"a":case"aa":case"aaa":return re.dayPeriod(J,{width:"abbreviated",context:"formatting"})||re.dayPeriod(J,{width:"narrow",context:"formatting"});case"aaaaa":return re.dayPeriod(J,{width:"narrow",context:"formatting"});case"aaaa":default:return re.dayPeriod(J,{width:"wide",context:"formatting"})||re.dayPeriod(J,{width:"abbreviated",context:"formatting"})||re.dayPeriod(J,{width:"narrow",context:"formatting"})}}set(J,te,re){return J.setHours(dayPeriodEnumToHours(re),0,0,0),J}}class AMPMMidnightParser extends Parser{constructor(){super(...arguments);zt(this,"priority",80);zt(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(J,te,re){switch(te){case"b":case"bb":case"bbb":return re.dayPeriod(J,{width:"abbreviated",context:"formatting"})||re.dayPeriod(J,{width:"narrow",context:"formatting"});case"bbbbb":return re.dayPeriod(J,{width:"narrow",context:"formatting"});case"bbbb":default:return re.dayPeriod(J,{width:"wide",context:"formatting"})||re.dayPeriod(J,{width:"abbreviated",context:"formatting"})||re.dayPeriod(J,{width:"narrow",context:"formatting"})}}set(J,te,re){return J.setHours(dayPeriodEnumToHours(re),0,0,0),J}}class DayPeriodParser extends Parser{constructor(){super(...arguments);zt(this,"priority",80);zt(this,"incompatibleTokens",["a","b","t","T"])}parse(J,te,re){switch(te){case"B":case"BB":case"BBB":return re.dayPeriod(J,{width:"abbreviated",context:"formatting"})||re.dayPeriod(J,{width:"narrow",context:"formatting"});case"BBBBB":return re.dayPeriod(J,{width:"narrow",context:"formatting"});case"BBBB":default:return re.dayPeriod(J,{width:"wide",context:"formatting"})||re.dayPeriod(J,{width:"abbreviated",context:"formatting"})||re.dayPeriod(J,{width:"narrow",context:"formatting"})}}set(J,te,re){return J.setHours(dayPeriodEnumToHours(re),0,0,0),J}}class Hour1to12Parser extends Parser{constructor(){super(...arguments);zt(this,"priority",70);zt(this,"incompatibleTokens",["H","K","k","t","T"])}parse(J,te,re){switch(te){case"h":return parseNumericPattern(numericPatterns.hour12h,J);case"ho":return re.ordinalNumber(J,{unit:"hour"});default:return parseNDigits(te.length,J)}}validate(J,te){return te>=1&&te<=12}set(J,te,re){const ne=J.getHours()>=12;return ne&&re<12?J.setHours(re+12,0,0,0):!ne&&re===12?J.setHours(0,0,0,0):J.setHours(re,0,0,0),J}}class Hour0to23Parser extends Parser{constructor(){super(...arguments);zt(this,"priority",70);zt(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(J,te,re){switch(te){case"H":return parseNumericPattern(numericPatterns.hour23h,J);case"Ho":return re.ordinalNumber(J,{unit:"hour"});default:return parseNDigits(te.length,J)}}validate(J,te){return te>=0&&te<=23}set(J,te,re){return J.setHours(re,0,0,0),J}}class Hour0To11Parser extends Parser{constructor(){super(...arguments);zt(this,"priority",70);zt(this,"incompatibleTokens",["h","H","k","t","T"])}parse(J,te,re){switch(te){case"K":return parseNumericPattern(numericPatterns.hour11h,J);case"Ko":return re.ordinalNumber(J,{unit:"hour"});default:return parseNDigits(te.length,J)}}validate(J,te){return te>=0&&te<=11}set(J,te,re){return J.getHours()>=12&&re<12?J.setHours(re+12,0,0,0):J.setHours(re,0,0,0),J}}class Hour1To24Parser extends Parser{constructor(){super(...arguments);zt(this,"priority",70);zt(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(J,te,re){switch(te){case"k":return parseNumericPattern(numericPatterns.hour24h,J);case"ko":return re.ordinalNumber(J,{unit:"hour"});default:return parseNDigits(te.length,J)}}validate(J,te){return te>=1&&te<=24}set(J,te,re){const ne=re<=24?re%24:re;return J.setHours(ne,0,0,0),J}}class MinuteParser extends Parser{constructor(){super(...arguments);zt(this,"priority",60);zt(this,"incompatibleTokens",["t","T"])}parse(J,te,re){switch(te){case"m":return parseNumericPattern(numericPatterns.minute,J);case"mo":return re.ordinalNumber(J,{unit:"minute"});default:return parseNDigits(te.length,J)}}validate(J,te){return te>=0&&te<=59}set(J,te,re){return J.setMinutes(re,0,0),J}}class SecondParser extends Parser{constructor(){super(...arguments);zt(this,"priority",50);zt(this,"incompatibleTokens",["t","T"])}parse(J,te,re){switch(te){case"s":return parseNumericPattern(numericPatterns.second,J);case"so":return re.ordinalNumber(J,{unit:"second"});default:return parseNDigits(te.length,J)}}validate(J,te){return te>=0&&te<=59}set(J,te,re){return J.setSeconds(re,0),J}}class FractionOfSecondParser extends Parser{constructor(){super(...arguments);zt(this,"priority",30);zt(this,"incompatibleTokens",["t","T"])}parse(J,te){const re=ne=>Math.trunc(ne*Math.pow(10,-te.length+3));return mapValue(parseNDigits(te.length,J),re)}set(J,te,re){return J.setMilliseconds(re),J}}class ISOTimezoneWithZParser extends Parser{constructor(){super(...arguments);zt(this,"priority",10);zt(this,"incompatibleTokens",["t","T","x"])}parse(J,te){switch(te){case"X":return parseTimezonePattern(timezonePatterns.basicOptionalMinutes,J);case"XX":return parseTimezonePattern(timezonePatterns.basic,J);case"XXXX":return parseTimezonePattern(timezonePatterns.basicOptionalSeconds,J);case"XXXXX":return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds,J);case"XXX":default:return parseTimezonePattern(timezonePatterns.extended,J)}}set(J,te,re){return te.timestampIsSet?J:constructFrom(J,J.getTime()-getTimezoneOffsetInMilliseconds(J)-re)}}class ISOTimezoneParser extends Parser{constructor(){super(...arguments);zt(this,"priority",10);zt(this,"incompatibleTokens",["t","T","X"])}parse(J,te){switch(te){case"x":return parseTimezonePattern(timezonePatterns.basicOptionalMinutes,J);case"xx":return parseTimezonePattern(timezonePatterns.basic,J);case"xxxx":return parseTimezonePattern(timezonePatterns.basicOptionalSeconds,J);case"xxxxx":return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds,J);case"xxx":default:return parseTimezonePattern(timezonePatterns.extended,J)}}set(J,te,re){return te.timestampIsSet?J:constructFrom(J,J.getTime()-getTimezoneOffsetInMilliseconds(J)-re)}}class TimestampSecondsParser extends Parser{constructor(){super(...arguments);zt(this,"priority",40);zt(this,"incompatibleTokens","*")}parse(J){return parseAnyDigitsSigned(J)}set(J,te,re){return[constructFrom(J,re*1e3),{timestampIsSet:!0}]}}class TimestampMillisecondsParser extends Parser{constructor(){super(...arguments);zt(this,"priority",20);zt(this,"incompatibleTokens","*")}parse(J){return parseAnyDigitsSigned(J)}set(J,te,re){return[constructFrom(J,re),{timestampIsSet:!0}]}}const parsers={G:new EraParser,y:new YearParser,Y:new LocalWeekYearParser,R:new ISOWeekYearParser,u:new ExtendedYearParser,Q:new QuarterParser,q:new StandAloneQuarterParser,M:new MonthParser,L:new StandAloneMonthParser,w:new LocalWeekParser,I:new ISOWeekParser,d:new DateParser,D:new DayOfYearParser,E:new DayParser,e:new LocalDayParser,c:new StandAloneLocalDayParser,i:new ISODayParser,a:new AMPMParser,b:new AMPMMidnightParser,B:new DayPeriodParser,h:new Hour1to12Parser,H:new Hour0to23Parser,K:new Hour0To11Parser,k:new Hour1To24Parser,m:new MinuteParser,s:new SecondParser,S:new FractionOfSecondParser,X:new ISOTimezoneWithZParser,x:new ISOTimezoneParser,t:new TimestampSecondsParser,T:new TimestampMillisecondsParser},formattingTokensRegExp=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,longFormattingTokensRegExp=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,escapedStringRegExp=/^'([^]*?)'?$/,doubleQuoteRegExp=/''/g,notWhitespaceRegExp=/\S/,unescapedLatinCharacterRegExp=/[a-zA-Z]/;function parse(X,W,J,te){var me,ve,ye,we;const re=getDefaultOptions(),ne=re.locale??enUS,oe=re.firstWeekContainsDate??((ve=(me=re.locale)==null?void 0:me.options)==null?void 0:ve.firstWeekContainsDate)??1,de=re.weekStartsOn??((we=(ye=re.locale)==null?void 0:ye.options)==null?void 0:we.weekStartsOn)??0,ue={firstWeekContainsDate:oe,weekStartsOn:de,locale:ne},ce=[new DateToSystemTimezoneSetter],he=W.match(longFormattingTokensRegExp).map(Se=>{const _e=Se[0];if(_e in longFormatters){const Ce=longFormatters[_e];return Ce(Se,ne.formatLong)}return Se}).join("").match(formattingTokensRegExp),pe=[];for(let Se of he){isProtectedWeekYearToken(Se)&&warnOrThrowProtectedError(Se,W,X),isProtectedDayOfYearToken(Se)&&warnOrThrowProtectedError(Se,W,X);const _e=Se[0],Ce=parsers[_e];if(Ce){const{incompatibleTokens:Le}=Ce;if(Array.isArray(Le)){const Ie=pe.find(Fe=>Le.includes(Fe.token)||Fe.token===_e);if(Ie)throw new RangeError(`The format string mustn't contain \`${Ie.fullToken}\` and \`${Se}\` at the same time`)}else if(Ce.incompatibleTokens==="*"&&pe.length>0)throw new RangeError(`The format string mustn't contain \`${Se}\` and any other token at the same time`);pe.push({token:_e,fullToken:Se});const Pe=Ce.run(X,Se,ne.match,ue);if(!Pe)return constructFrom(J,NaN);ce.push(Pe.setter),X=Pe.rest}else{if(_e.match(unescapedLatinCharacterRegExp))throw new RangeError("Format string contains an unescaped latin alphabet character `"+_e+"`");if(Se==="''"?Se="'":_e==="'"&&(Se=cleanEscapedString(Se)),X.indexOf(Se)===0)X=X.slice(Se.length);else return constructFrom(J,NaN)}}if(X.length>0&&notWhitespaceRegExp.test(X))return constructFrom(J,NaN);const fe=ce.map(Se=>Se.priority).sort((Se,_e)=>_e-Se).filter((Se,_e,Ce)=>Ce.indexOf(Se)===_e).map(Se=>ce.filter(_e=>_e.priority===Se).sort((_e,Ce)=>Ce.subPriority-_e.subPriority)).map(Se=>Se[0]);let ge=toDate(J);if(isNaN(ge.getTime()))return constructFrom(J,NaN);const be={};for(const Se of fe){if(!Se.validate(ge,ue))return constructFrom(J,NaN);const _e=Se.set(ge,be,ue);Array.isArray(_e)?(ge=_e[0],Object.assign(be,_e[1])):ge=_e}return constructFrom(J,ge)}function cleanEscapedString(X){return X.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp,"'")}const notFound="data:image/svg+xml,%3csvg%20width='215'%20height='150'%20viewBox='0%200%20215%20150'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20opacity='0.9'%20d='M135.132%2057.43C96.9221%2047.658%2083.3815%20-29.7048%2026.9734%2012.5083C-13.0511%2042.4595%2011.4691%20115.499%2061.6878%20107.019C92.0822%20101.867%2087.3917%20101.341%20113.129%20115.244C139.231%20129.308%20167.972%20136.397%20195.855%20111.436C210.28%2098.5179%20215.939%2067.0352%20201.939%2050.7417C184.388%2030.3592%20158.485%2063.4098%20135.132%2057.43Z'%20fill='%23EFF7FF'/%3e%3cellipse%20cx='120.5'%20cy='143.5'%20rx='52.5'%20ry='3.5'%20fill='%23F5F5F5'/%3e%3cpath%20d='M121.387%2080.2184C121.995%2079.5948%20122.563%2078.953%20123.09%2078.2959L134.396%2089.3383C135.09%2090.0177%20134.851%2091.389%20133.861%2092.4024C132.872%2093.4159%20131.505%2093.6888%20130.811%2093.0094L119.505%2081.967C120.148%2081.424%20120.777%2080.8407%20121.385%2080.2171L121.387%2080.2184Z'%20fill='%231D1D1D'/%3e%3cpath%20opacity='0.6'%20d='M121.127%2079.9896C132.157%2068.6986%20131.888%2050.5485%20120.527%2039.4502C109.166%2028.3519%2091.0149%2028.5081%2079.9849%2039.799C68.955%2051.09%2069.2233%2069.2401%2080.5843%2080.3385C91.9453%2091.4368%20110.097%2091.2806%20121.127%2079.9896Z'%20fill='%238FC2F5'/%3e%3cpath%20d='M78.0382%2083.0622C90.8729%2095.6382%20111.378%2095.4578%20123.835%2082.6609C136.293%2069.8625%20135.986%2049.2932%20123.15%2036.7173C110.316%2024.1413%2089.8107%2024.3217%2077.3538%2037.1186C64.8956%2049.9169%2065.2022%2070.4862%2078.0382%2083.0622ZM80.642%2080.387C69.289%2069.264%2069.0172%2051.0692%2080.037%2039.749C91.0569%2028.4288%20109.194%2028.2694%20120.547%2039.3938C131.9%2050.5182%20132.171%2068.713%20121.152%2080.0332C110.132%2091.3534%2091.9949%2091.5128%2080.642%2080.3884V80.387Z'%20fill='%237BACFC'/%3e%3cpath%20d='M169.953%20128.522L171.714%20126.696C173.474%20124.871%20173.421%20121.964%20171.595%20120.205L135.013%2084.9265C133.187%2083.1661%20130.281%2083.2205%20128.522%2085.0451L126.761%2086.8711C125.001%2088.6957%20125.055%2091.6028%20126.88%2093.3619L163.462%20128.64C165.287%20130.401%20168.194%20130.346%20169.953%20128.522Z'%20fill='%23656565'/%3e%3cpath%20opacity='0.35'%20d='M88.8399%2071.2315C96.506%2079.2245%20101.258%2078.1642%20100.757%2082.4547C100.256%2086.7452%2091.398%2085.7448%2082.7698%2076.0396C74.1415%2066.3344%2075.0893%2054.9166%2079.8491%2055.2485C84.6089%2055.5803%2080.129%2062.1492%2088.8399%2071.2315Z'%20fill='white'/%3e%3c/svg%3e";/**
320
+ `}handleTest(){console.log(this.selectedPeriodDate)}};__decorateClass$n([n$w()],ExportPdfModal.prototype,"selectedRadioOption",2),__decorateClass$n([n$w()],ExportPdfModal.prototype,"text",2),__decorateClass$n([n$w()],ExportPdfModal.prototype,"selectedVisibilityLevelElement",2),__decorateClass$n([n$w()],ExportPdfModal.prototype,"selectedPeriodDate",2),__decorateClass$n([n$w({type:Array})],ExportPdfModal.prototype,"arrayElements",2),ExportPdfModal=__decorateClass$n([t$i("export-pdf-modal")],ExportPdfModal);class ExportToPdfHandler extends ApiBaseHandler{async handle(){try{this.api.interactionService.confirm(void 0,ExportPdfModal,{title:translate("modal.selectExportOption"),confirmButtonText:"Exportar",cancelButtonText:"Cancelar"})}catch(W){this._notifyError(W.message)}}_notifyError(W){this.api.notificationService.error(W||"actions.delete.error")}}class ExportPdf{}let request$b;const bootstrapExportPdf=X=>{request$b=X.registerRequest(ExportPdf,ExportToPdfHandler)},teardownExportPdf=()=>{request$b==null||request$b.dispose()},{addActivityHistoryItems}=activityHistoryCollectionsSlice.actions;class AddHistoryItemsHandler extends StoreBaseHandler{async handle(W){try{const J=validateAndFilterItems(W.items);this.store.dispatch(addActivityHistoryItems({id:W.entityId,items:J,componentFactory:W.componentFactory,searchPredicate:W.searchPredicate}))}catch(J){console.log(J.message)}}}let request$a;const bootstrapAddHistoryItems=X=>{request$a=X.registerRequest(addHistoryItemsCommand,AddHistoryItemsHandler)},teardownAddHistoryItems=()=>{request$a==null||request$a.dispose()},{updateActivityHistoryItem}=activityHistoryCollectionsSlice.actions;class UpdateHistoryItemHandler extends StoreBaseHandler{async handle(W){try{ensureAreValidActivityHistoryItems([W.item]),this.store.dispatch(updateActivityHistoryItem({id:W.entityId,item:W.item}))}catch(J){console.log(J.message)}}}const updateHistoryItemCommand="update_history_item_request";let request$9;const bootstrapUpdateHistoryItem=X=>{request$9=X.registerRequest(updateHistoryItemCommand,UpdateHistoryItemHandler)},teardownUpdateHistoryItem=()=>{request$9==null||request$9.dispose()};function connectedProperty(X,W={}){return createConnectedProperty(store)(X,W)}const activityHistorySearchStringSelector=X=>X.activityHistoryFilters.searchString,isAnyCollectionBusySelector=X=>X.activityHistoryCollections.busy.length>0,isAnyCollectionLoadingWithoutAnyLoaded=X=>{const W=Object.values(X.activityHistoryCollections.collections);return!(W!=null&&W.length)&&isAnyCollectionBusySelector(X)},isSomeCollectionLoadedAndOtherLoading=X=>Object.values(X.activityHistoryCollections.collections)&&isAnyCollectionBusySelector(X);function getUniqueObjects(X,W,J){return Array.from(X.map(te=>({id:W.reduce((re,ne)=>re==null?void 0:re[ne],te),title:J.reduce((re,ne)=>re==null?void 0:re[ne],te)})).filter(te=>typeof te.id=="string"&&typeof te.title=="string").reduce((te,re)=>te.set(re.id,re),new Map).values())}class TrueSpec extends Spec{isSatisfiedBy(){return!0}}class CommonFilterSpec extends Spec{constructor(W){super(),this.commonFilters=W}isSatisfiedBy(W){return this.commonFilters.filter(re=>re.enabled).reduce((re,ne)=>re.and(new ne.spec),new TrueSpec).isSatisfiedBy(W)}}class FalseSpec extends Spec{isSatisfiedBy(){return!1}}class PropPathSpec extends Spec{constructor(W,J){super(),this.propPath=W,this.value=J}isSatisfiedBy(W){return this.propPath.reduce((te,re)=>te==null?void 0:te[re],W)===this.value}}class CustomFilterSpec extends Spec{constructor(W){super(),this.filters=W}isSatisfiedBy(W){const J=this.filters.filter(te=>te.enabled);return J.length===0?!0:J.every(te=>{if(!this.belongsToGroup(W,te))return!0;const re=te.filters.filter(ne=>ne.enabled||ne.singleOption);return re.length===0?!0:re.every(ne=>ne.singleOption?ne.enabled?!0:new PropPathSpec(ne.propPathValue,!1).isSatisfiedBy(W):!ne.enabledValues||ne.enabledValues.length===0?!0:ne.enabledValues.reduce((de,ue)=>de.or(new PropPathSpec(ne.propPathValue,ue)),new FalseSpec).isSatisfiedBy(W))})}belongsToGroup(W,J){return W.type===J.id}}const normalizeStringToNFD=X=>X==null?"":String(X).normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLocaleLowerCase(),propContainsString=(X,W)=>{const J=normalizeStringToNFD(X),te=normalizeStringToNFD(W);return J.toString().toLowerCase().indexOf(te)!==-1||J.toString().indexOf(te)!==-1},commonFieldsSearchPredicate=(X,W)=>{var ue,ce,he,pe,fe,ge,be;const J=((ue=X.professional)==null?void 0:ue.name)&&propContainsString((ce=X.professional)==null?void 0:ce.name,W),te=X.center.description&&propContainsString(X.center.description,W),re=((he=X.professional)==null?void 0:he.speciality.description)&&propContainsString((pe=X.professional)==null?void 0:pe.speciality.description,W),ne=((fe=X.professional)==null?void 0:fe.role.description)&&propContainsString((ge=X.professional)==null?void 0:ge.role.description,W),oe=X.service.description&&propContainsString(X.service.description,W),de=(be=X.diagnostics)==null?void 0:be.some(me=>propContainsString(me.id,W)||propContainsString(me.description,W));return J||te||re||ne||oe||de};class SearchStringSpec extends Spec{constructor(W,J){super(),this.searchString=W,this.searchPredicate=J}isSatisfiedBy(W){var re;if(!((re=this.searchString)!=null&&re.trim()))return!0;const J=commonFieldsSearchPredicate(W,this.searchString),te=this.searchPredicate?this.searchPredicate(this.searchString.toLowerCase(),W):!1;return!!(J||te)}}class TypeSpec extends Spec{constructor(W){super(),this.itemType=W}isSatisfiedBy(W){return(W==null?void 0:W.type)===this.itemType}}class ComposedTypeSpec extends Spec{constructor(W){super(),this.filters=W}isSatisfiedBy(W){return this.filters.filter(re=>re.enabled).map(re=>re.id).reduce((re,ne)=>re.or(new TypeSpec(ne)),new FalseSpec).isSatisfiedBy(W)}}const activityHistoryFiltersSelector=X=>X.activityHistoryFilters.filters,activityHistoryCommonFiltersSelector=createSelector(activityHistoryFiltersSelector,X=>{var W;return((W=X.find(isCommonFilterGroup))==null?void 0:W.filters)||[]}),activityHistoryEnabledCommonFiltersSelector=createSelector(activityHistoryCommonFiltersSelector,X=>X.filter(W=>W.enabled)),areCommonFiltersActive=createSelector(activityHistoryEnabledCommonFiltersSelector,X=>!!X.length),activityHistoryCustomFilterGroupsSelector=createSelector(activityHistoryFiltersSelector,X=>X.filter(isNotCommonFilterGroup).sort(sortBySortProperty)),sortBySortProperty=(X,W)=>Number(X.sort)-Number(W.sort),areCustomFiltersActive=createSelector(activityHistoryCustomFilterGroupsSelector,X=>X.some(W=>W.filters.some(J=>{var te;return(te=J.enabledValues)==null?void 0:te.length}))),activeGroupsWithEnabledFilters=createSelector(activityHistoryCustomFilterGroupsSelector,X=>X.filter(W=>W.enabled).map(({id:W,title:J,enabled:te,sort:re,filters:ne})=>({id:W,title:J,enabled:te,sort:re,filters:ne.filter(oe=>{var de;return(de=oe.enabledValues)==null?void 0:de.length})})).filter(W=>W.filters.length>0)),isSameVisit=(X,W)=>{var ne,oe,de,ue,ce,he,pe,fe,ge,be,me,ve,ye,we;const J=((ne=X.professional)==null?void 0:ne.id)===((oe=W.professional)==null?void 0:oe.id)&&((de=X.professional)==null?void 0:de.role.id)===((ue=W.professional)==null?void 0:ue.role.id)&&((ce=X.professional)==null?void 0:ce.speciality.id)===((he=W.professional)==null?void 0:he.speciality.id),te=((pe=X.ep)==null?void 0:pe.id)===((fe=W.ep)==null?void 0:fe.id)&&((ge=X.up)==null?void 0:ge.id)===((be=W.up)==null?void 0:be.id)&&((me=X.center)==null?void 0:me.id)===((ve=W.center)==null?void 0:ve.id)&&((ye=X.service)==null?void 0:ye.id)===((we=W.service)==null?void 0:we.id),re=new Date(X.date).toDateString()===new Date(W.date).toDateString();return J&&te&&re},withinEightHours=(X,W)=>Math.abs(new Date(X).getTime()-new Date(W).getTime())<=8*60*60*1e3,areSameDiagnostics=(X,W)=>{if(X.length!==W.length)return!1;const J=X.map(re=>re.codi).sort(),te=W.map(re=>re.codi).sort();return J.every((re,ne)=>re===te[ne])},groupActivityHistoryItems=X=>{const W=[];return X==null||X.forEach(J=>{let te=!1;for(const re of W){const ne=re.items[0],oe=re.items[re.items.length-1];if(isSameVisit(ne,J)&&withinEightHours(ne.date,J.date)&&withinEightHours(oe.date,J.date)){re.items.push(J),te=!0;break}}te||W.push({idGroup:Math.random().toString(36).substr(2,9),items:[J]})}),W.forEach(J=>{const te=[],re=[];J.items.forEach(ne=>{var oe;if(((oe=ne.diagnostics)==null?void 0:oe.length)>0){let de=!1;for(const ue of te){const ce=ue.items[0];if(areSameDiagnostics(ce.diagnostics,ne.diagnostics)){ue.items.push(ne),de=!0;break}}de||te.push({idSubGroup:Math.random().toString(36).substr(2,9),items:[ne]})}else re.push(ne)}),J.items=re,J.subGroups=te}),W},sortGroupsByMostRecentDate=X=>{const W=ne=>ne.reduce((oe,de)=>{const ue=new Date(de.date);return ue>oe?ue:oe},new Date(0)),J=ne=>ne.sort((oe,de)=>new Date(de.date).getTime()-new Date(oe.date).getTime()),te=ne=>W(ne.items),re=ne=>{const oe=ne.items.length>0?[W(ne.items)]:[],de=ne.subGroups.map(te),ue=[...oe,...de];return ue.length>0?new Date(Math.max(...ue.map(ce=>ce.getTime()))):new Date(0)};return X.forEach(ne=>{ne.items=J(ne.items),ne.subGroups.forEach(oe=>{oe.items=J(oe.items)}),ne.subGroups.sort((oe,de)=>te(de).getTime()-te(oe).getTime())}),X.sort((ne,oe)=>re(oe).getTime()-re(ne).getTime())},activityHistoryCollectionsSelector=X=>X.activityHistoryCollections.collections,mapItemsWithMetadata=(X,W,J,te)=>X.map(re=>({...re,searchPredicate:te,componentFactory:W,type:J})),activityHistoryMappedItems=createSelector(activityHistoryCollectionsSelector,X=>Object.values(X).flatMap(W=>mapItemsWithMetadata(W.items,W.componentFactory,W.id,W.searchPredicate))),customFilterGroupsWithOptionsSelector=createSelector(activityHistoryCustomFilterGroupsSelector,activityHistoryCollectionsSelector,(X,W)=>X.map(te=>{const re=W[te.id];return{...te,filters:te.filters.map(ne=>({...ne,options:(ne.singleOption?[]:getUniqueObjects(re.items,ne.propPathValue,ne.propsPathDescription))||[]}))}})),activityHistoryGroupedItems=createSelector(activityHistoryMappedItems,activityHistorySearchStringSelector,activityHistoryCommonFiltersSelector,activityHistoryCustomFilterGroupsSelector,(X,W,J,te)=>{const re=X.filter(de=>new SearchStringSpec(W,de.searchPredicate).and(new CommonFilterSpec(J)).and(new ComposedTypeSpec(te)).and(new CustomFilterSpec(te)).isSatisfiedBy(de)),ne=groupActivityHistoryItems(re);return sortGroupsByMostRecentDate(ne)}),styles$e=":host{min-height:1px;height:100%}.virtualizer{height:100%;padding-inline:16px}.container{min-height:1px;height:100%}.visit:first-child{margin-top:var(--dss-spacing-md)}.visit{width:calc(100% - var(--dss-spacing-md) - var(--dss-spacing-md));display:flex;flex-direction:column;gap:var(--dss-spacing-md);background-color:#fff;border-radius:var(--dss-radius-sm);padding:var(--dss-spacing-sm);margin-bottom:var(--dss-spacing-md)}.visit .visit__header{display:flex;flex-direction:row;align-items:center;gap:16px}.visit .visit__header .title{flex:1;font-size:14px;line-height:24px;display:flex;flex-direction:row;gap:12px;color:var(--color-neutral-800)}.visit .visit__header .title-date{font-weight:700}.visit .visit__header .title-description{font-weight:600;display:flex;flex-direction:row;gap:4px}.visit .visit__header .highlight{background-color:#ff0;font-weight:700}.visit .visit__items{display:flex;flex-direction:column;gap:16px}.visit .visit__items .item[has-divider]{border-bottom:var(--dss-border-width-sm) solid var(--color-neutral-200)}.visit .visit__items .item[has-divider]:last-of-type{border:none}.visit .diagnostics{display:flex;flex-direction:column;gap:16px;border-bottom:var(--dss-border-width-sm) solid var(--color-neutral-200)}.visit .diagnostics:last-of-type{border:none}.visit .diagnostics .diagnostics__header{display:flex;flex-direction:row;align-items:center;gap:16px}.visit .diagnostics .diagnostics__items{display:flex;flex-direction:column}.visit .diagnostics .diagnostics__items .item[has-divider]{border-bottom:var(--dss-border-width-sm) solid var(--color-neutral-200)}.visit .diagnostics .diagnostics__items .item[has-divider]:last-of-type{border:none}.feedback{width:100%;height:100%;display:flex;align-items:center;justify-content:center}";function toDate(X){const W=Object.prototype.toString.call(X);return X instanceof Date||typeof X=="object"&&W==="[object Date]"?new X.constructor(+X):typeof X=="number"||W==="[object Number]"||typeof X=="string"||W==="[object String]"?new Date(X):new Date(NaN)}function constructFrom(X,W){return X instanceof Date?new X.constructor(W):new Date(W)}function addDays(X,W){const J=toDate(X);return isNaN(W)?constructFrom(X,NaN):(W&&J.setDate(J.getDate()+W),J)}const millisecondsInWeek=6048e5,millisecondsInDay=864e5,millisecondsInMinute=6e4,millisecondsInHour=36e5,millisecondsInSecond=1e3;let defaultOptions={};function getDefaultOptions$1(){return defaultOptions}function startOfWeek(X,W){var de,ue,ce,he;const J=getDefaultOptions$1(),te=(W==null?void 0:W.weekStartsOn)??((ue=(de=W==null?void 0:W.locale)==null?void 0:de.options)==null?void 0:ue.weekStartsOn)??J.weekStartsOn??((he=(ce=J.locale)==null?void 0:ce.options)==null?void 0:he.weekStartsOn)??0,re=toDate(X),ne=re.getDay(),oe=(ne<te?7:0)+ne-te;return re.setDate(re.getDate()-oe),re.setHours(0,0,0,0),re}function startOfISOWeek(X){return startOfWeek(X,{weekStartsOn:1})}function getISOWeekYear(X){const W=toDate(X),J=W.getFullYear(),te=constructFrom(X,0);te.setFullYear(J+1,0,4),te.setHours(0,0,0,0);const re=startOfISOWeek(te),ne=constructFrom(X,0);ne.setFullYear(J,0,4),ne.setHours(0,0,0,0);const oe=startOfISOWeek(ne);return W.getTime()>=re.getTime()?J+1:W.getTime()>=oe.getTime()?J:J-1}function startOfDay(X){const W=toDate(X);return W.setHours(0,0,0,0),W}function getTimezoneOffsetInMilliseconds(X){const W=toDate(X),J=new Date(Date.UTC(W.getFullYear(),W.getMonth(),W.getDate(),W.getHours(),W.getMinutes(),W.getSeconds(),W.getMilliseconds()));return J.setUTCFullYear(W.getFullYear()),+X-+J}function differenceInCalendarDays(X,W){const J=startOfDay(X),te=startOfDay(W),re=+J-getTimezoneOffsetInMilliseconds(J),ne=+te-getTimezoneOffsetInMilliseconds(te);return Math.round((re-ne)/millisecondsInDay)}function startOfISOWeekYear(X){const W=getISOWeekYear(X),J=constructFrom(X,0);return J.setFullYear(W,0,4),J.setHours(0,0,0,0),startOfISOWeek(J)}function isDate(X){return X instanceof Date||typeof X=="object"&&Object.prototype.toString.call(X)==="[object Date]"}function isValid(X){if(!isDate(X)&&typeof X!="number")return!1;const W=toDate(X);return!isNaN(Number(W))}function endOfMonth(X){const W=toDate(X),J=W.getMonth();return W.setFullYear(W.getFullYear(),J+1,0),W.setHours(23,59,59,999),W}function eachDayOfInterval(X,W){const J=toDate(X.start),te=toDate(X.end);let re=+J>+te;const ne=re?+J:+te,oe=re?te:J;oe.setHours(0,0,0,0);let de=1;const ue=[];for(;+oe<=ne;)ue.push(toDate(oe)),oe.setDate(oe.getDate()+de),oe.setHours(0,0,0,0);return re?ue.reverse():ue}function startOfMonth(X){const W=toDate(X);return W.setDate(1),W.setHours(0,0,0,0),W}function startOfYear(X){const W=toDate(X),J=constructFrom(X,0);return J.setFullYear(W.getFullYear(),0,1),J.setHours(0,0,0,0),J}const formatDistanceLocale={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},formatDistance=(X,W,J)=>{let te;const re=formatDistanceLocale[X];return typeof re=="string"?te=re:W===1?te=re.one:te=re.other.replace("{{count}}",W.toString()),J!=null&&J.addSuffix?J.comparison&&J.comparison>0?"in "+te:te+" ago":te};function buildFormatLongFn(X){return(W={})=>{const J=W.width?String(W.width):X.defaultWidth;return X.formats[J]||X.formats[X.defaultWidth]}}const dateFormats={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},timeFormats={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},dateTimeFormats={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},formatLong={date:buildFormatLongFn({formats:dateFormats,defaultWidth:"full"}),time:buildFormatLongFn({formats:timeFormats,defaultWidth:"full"}),dateTime:buildFormatLongFn({formats:dateTimeFormats,defaultWidth:"full"})},formatRelativeLocale={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},formatRelative=(X,W,J,te)=>formatRelativeLocale[X];function buildLocalizeFn(X){return(W,J)=>{const te=J!=null&&J.context?String(J.context):"standalone";let re;if(te==="formatting"&&X.formattingValues){const oe=X.defaultFormattingWidth||X.defaultWidth,de=J!=null&&J.width?String(J.width):oe;re=X.formattingValues[de]||X.formattingValues[oe]}else{const oe=X.defaultWidth,de=J!=null&&J.width?String(J.width):X.defaultWidth;re=X.values[de]||X.values[oe]}const ne=X.argumentCallback?X.argumentCallback(W):W;return re[ne]}}const eraValues={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},quarterValues={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},monthValues={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},dayValues={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},dayPeriodValues={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},formattingDayPeriodValues={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},ordinalNumber=(X,W)=>{const J=Number(X),te=J%100;if(te>20||te<10)switch(te%10){case 1:return J+"st";case 2:return J+"nd";case 3:return J+"rd"}return J+"th"},localize={ordinalNumber,era:buildLocalizeFn({values:eraValues,defaultWidth:"wide"}),quarter:buildLocalizeFn({values:quarterValues,defaultWidth:"wide",argumentCallback:X=>X-1}),month:buildLocalizeFn({values:monthValues,defaultWidth:"wide"}),day:buildLocalizeFn({values:dayValues,defaultWidth:"wide"}),dayPeriod:buildLocalizeFn({values:dayPeriodValues,defaultWidth:"wide",formattingValues:formattingDayPeriodValues,defaultFormattingWidth:"wide"})};function buildMatchFn(X){return(W,J={})=>{const te=J.width,re=te&&X.matchPatterns[te]||X.matchPatterns[X.defaultMatchWidth],ne=W.match(re);if(!ne)return null;const oe=ne[0],de=te&&X.parsePatterns[te]||X.parsePatterns[X.defaultParseWidth],ue=Array.isArray(de)?findIndex(de,pe=>pe.test(oe)):findKey(de,pe=>pe.test(oe));let ce;ce=X.valueCallback?X.valueCallback(ue):ue,ce=J.valueCallback?J.valueCallback(ce):ce;const he=W.slice(oe.length);return{value:ce,rest:he}}}function findKey(X,W){for(const J in X)if(Object.prototype.hasOwnProperty.call(X,J)&&W(X[J]))return J}function findIndex(X,W){for(let J=0;J<X.length;J++)if(W(X[J]))return J}function buildMatchPatternFn(X){return(W,J={})=>{const te=W.match(X.matchPattern);if(!te)return null;const re=te[0],ne=W.match(X.parsePattern);if(!ne)return null;let oe=X.valueCallback?X.valueCallback(ne[0]):ne[0];oe=J.valueCallback?J.valueCallback(oe):oe;const de=W.slice(re.length);return{value:oe,rest:de}}}const matchOrdinalNumberPattern=/^(\d+)(th|st|nd|rd)?/i,parseOrdinalNumberPattern=/\d+/i,matchEraPatterns={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},parseEraPatterns={any:[/^b/i,/^(a|c)/i]},matchQuarterPatterns={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},parseQuarterPatterns={any:[/1/i,/2/i,/3/i,/4/i]},matchMonthPatterns={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},parseMonthPatterns={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},matchDayPatterns={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},parseDayPatterns={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},matchDayPeriodPatterns={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},parseDayPeriodPatterns={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},match={ordinalNumber:buildMatchPatternFn({matchPattern:matchOrdinalNumberPattern,parsePattern:parseOrdinalNumberPattern,valueCallback:X=>parseInt(X,10)}),era:buildMatchFn({matchPatterns:matchEraPatterns,defaultMatchWidth:"wide",parsePatterns:parseEraPatterns,defaultParseWidth:"any"}),quarter:buildMatchFn({matchPatterns:matchQuarterPatterns,defaultMatchWidth:"wide",parsePatterns:parseQuarterPatterns,defaultParseWidth:"any",valueCallback:X=>X+1}),month:buildMatchFn({matchPatterns:matchMonthPatterns,defaultMatchWidth:"wide",parsePatterns:parseMonthPatterns,defaultParseWidth:"any"}),day:buildMatchFn({matchPatterns:matchDayPatterns,defaultMatchWidth:"wide",parsePatterns:parseDayPatterns,defaultParseWidth:"any"}),dayPeriod:buildMatchFn({matchPatterns:matchDayPeriodPatterns,defaultMatchWidth:"any",parsePatterns:parseDayPeriodPatterns,defaultParseWidth:"any"})},enUS={code:"en-US",formatDistance,formatLong,formatRelative,localize,match,options:{weekStartsOn:0,firstWeekContainsDate:1}};function getDayOfYear(X){const W=toDate(X);return differenceInCalendarDays(W,startOfYear(W))+1}function getISOWeek(X){const W=toDate(X),J=+startOfISOWeek(W)-+startOfISOWeekYear(W);return Math.round(J/millisecondsInWeek)+1}function getWeekYear(X,W){var he,pe,fe,ge;const J=toDate(X),te=J.getFullYear(),re=getDefaultOptions$1(),ne=(W==null?void 0:W.firstWeekContainsDate)??((pe=(he=W==null?void 0:W.locale)==null?void 0:he.options)==null?void 0:pe.firstWeekContainsDate)??re.firstWeekContainsDate??((ge=(fe=re.locale)==null?void 0:fe.options)==null?void 0:ge.firstWeekContainsDate)??1,oe=constructFrom(X,0);oe.setFullYear(te+1,0,ne),oe.setHours(0,0,0,0);const de=startOfWeek(oe,W),ue=constructFrom(X,0);ue.setFullYear(te,0,ne),ue.setHours(0,0,0,0);const ce=startOfWeek(ue,W);return J.getTime()>=de.getTime()?te+1:J.getTime()>=ce.getTime()?te:te-1}function startOfWeekYear(X,W){var de,ue,ce,he;const J=getDefaultOptions$1(),te=(W==null?void 0:W.firstWeekContainsDate)??((ue=(de=W==null?void 0:W.locale)==null?void 0:de.options)==null?void 0:ue.firstWeekContainsDate)??J.firstWeekContainsDate??((he=(ce=J.locale)==null?void 0:ce.options)==null?void 0:he.firstWeekContainsDate)??1,re=getWeekYear(X,W),ne=constructFrom(X,0);return ne.setFullYear(re,0,te),ne.setHours(0,0,0,0),startOfWeek(ne,W)}function getWeek(X,W){const J=toDate(X),te=+startOfWeek(J,W)-+startOfWeekYear(J,W);return Math.round(te/millisecondsInWeek)+1}function addLeadingZeros(X,W){const J=X<0?"-":"",te=Math.abs(X).toString().padStart(W,"0");return J+te}const lightFormatters={y(X,W){const J=X.getFullYear(),te=J>0?J:1-J;return addLeadingZeros(W==="yy"?te%100:te,W.length)},M(X,W){const J=X.getMonth();return W==="M"?String(J+1):addLeadingZeros(J+1,2)},d(X,W){return addLeadingZeros(X.getDate(),W.length)},a(X,W){const J=X.getHours()/12>=1?"pm":"am";switch(W){case"a":case"aa":return J.toUpperCase();case"aaa":return J;case"aaaaa":return J[0];case"aaaa":default:return J==="am"?"a.m.":"p.m."}},h(X,W){return addLeadingZeros(X.getHours()%12||12,W.length)},H(X,W){return addLeadingZeros(X.getHours(),W.length)},m(X,W){return addLeadingZeros(X.getMinutes(),W.length)},s(X,W){return addLeadingZeros(X.getSeconds(),W.length)},S(X,W){const J=W.length,te=X.getMilliseconds(),re=Math.trunc(te*Math.pow(10,J-3));return addLeadingZeros(re,W.length)}},dayPeriodEnum={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},formatters={G:function(X,W,J){const te=X.getFullYear()>0?1:0;switch(W){case"G":case"GG":case"GGG":return J.era(te,{width:"abbreviated"});case"GGGGG":return J.era(te,{width:"narrow"});case"GGGG":default:return J.era(te,{width:"wide"})}},y:function(X,W,J){if(W==="yo"){const te=X.getFullYear(),re=te>0?te:1-te;return J.ordinalNumber(re,{unit:"year"})}return lightFormatters.y(X,W)},Y:function(X,W,J,te){const re=getWeekYear(X,te),ne=re>0?re:1-re;if(W==="YY"){const oe=ne%100;return addLeadingZeros(oe,2)}return W==="Yo"?J.ordinalNumber(ne,{unit:"year"}):addLeadingZeros(ne,W.length)},R:function(X,W){const J=getISOWeekYear(X);return addLeadingZeros(J,W.length)},u:function(X,W){const J=X.getFullYear();return addLeadingZeros(J,W.length)},Q:function(X,W,J){const te=Math.ceil((X.getMonth()+1)/3);switch(W){case"Q":return String(te);case"QQ":return addLeadingZeros(te,2);case"Qo":return J.ordinalNumber(te,{unit:"quarter"});case"QQQ":return J.quarter(te,{width:"abbreviated",context:"formatting"});case"QQQQQ":return J.quarter(te,{width:"narrow",context:"formatting"});case"QQQQ":default:return J.quarter(te,{width:"wide",context:"formatting"})}},q:function(X,W,J){const te=Math.ceil((X.getMonth()+1)/3);switch(W){case"q":return String(te);case"qq":return addLeadingZeros(te,2);case"qo":return J.ordinalNumber(te,{unit:"quarter"});case"qqq":return J.quarter(te,{width:"abbreviated",context:"standalone"});case"qqqqq":return J.quarter(te,{width:"narrow",context:"standalone"});case"qqqq":default:return J.quarter(te,{width:"wide",context:"standalone"})}},M:function(X,W,J){const te=X.getMonth();switch(W){case"M":case"MM":return lightFormatters.M(X,W);case"Mo":return J.ordinalNumber(te+1,{unit:"month"});case"MMM":return J.month(te,{width:"abbreviated",context:"formatting"});case"MMMMM":return J.month(te,{width:"narrow",context:"formatting"});case"MMMM":default:return J.month(te,{width:"wide",context:"formatting"})}},L:function(X,W,J){const te=X.getMonth();switch(W){case"L":return String(te+1);case"LL":return addLeadingZeros(te+1,2);case"Lo":return J.ordinalNumber(te+1,{unit:"month"});case"LLL":return J.month(te,{width:"abbreviated",context:"standalone"});case"LLLLL":return J.month(te,{width:"narrow",context:"standalone"});case"LLLL":default:return J.month(te,{width:"wide",context:"standalone"})}},w:function(X,W,J,te){const re=getWeek(X,te);return W==="wo"?J.ordinalNumber(re,{unit:"week"}):addLeadingZeros(re,W.length)},I:function(X,W,J){const te=getISOWeek(X);return W==="Io"?J.ordinalNumber(te,{unit:"week"}):addLeadingZeros(te,W.length)},d:function(X,W,J){return W==="do"?J.ordinalNumber(X.getDate(),{unit:"date"}):lightFormatters.d(X,W)},D:function(X,W,J){const te=getDayOfYear(X);return W==="Do"?J.ordinalNumber(te,{unit:"dayOfYear"}):addLeadingZeros(te,W.length)},E:function(X,W,J){const te=X.getDay();switch(W){case"E":case"EE":case"EEE":return J.day(te,{width:"abbreviated",context:"formatting"});case"EEEEE":return J.day(te,{width:"narrow",context:"formatting"});case"EEEEEE":return J.day(te,{width:"short",context:"formatting"});case"EEEE":default:return J.day(te,{width:"wide",context:"formatting"})}},e:function(X,W,J,te){const re=X.getDay(),ne=(re-te.weekStartsOn+8)%7||7;switch(W){case"e":return String(ne);case"ee":return addLeadingZeros(ne,2);case"eo":return J.ordinalNumber(ne,{unit:"day"});case"eee":return J.day(re,{width:"abbreviated",context:"formatting"});case"eeeee":return J.day(re,{width:"narrow",context:"formatting"});case"eeeeee":return J.day(re,{width:"short",context:"formatting"});case"eeee":default:return J.day(re,{width:"wide",context:"formatting"})}},c:function(X,W,J,te){const re=X.getDay(),ne=(re-te.weekStartsOn+8)%7||7;switch(W){case"c":return String(ne);case"cc":return addLeadingZeros(ne,W.length);case"co":return J.ordinalNumber(ne,{unit:"day"});case"ccc":return J.day(re,{width:"abbreviated",context:"standalone"});case"ccccc":return J.day(re,{width:"narrow",context:"standalone"});case"cccccc":return J.day(re,{width:"short",context:"standalone"});case"cccc":default:return J.day(re,{width:"wide",context:"standalone"})}},i:function(X,W,J){const te=X.getDay(),re=te===0?7:te;switch(W){case"i":return String(re);case"ii":return addLeadingZeros(re,W.length);case"io":return J.ordinalNumber(re,{unit:"day"});case"iii":return J.day(te,{width:"abbreviated",context:"formatting"});case"iiiii":return J.day(te,{width:"narrow",context:"formatting"});case"iiiiii":return J.day(te,{width:"short",context:"formatting"});case"iiii":default:return J.day(te,{width:"wide",context:"formatting"})}},a:function(X,W,J){const re=X.getHours()/12>=1?"pm":"am";switch(W){case"a":case"aa":return J.dayPeriod(re,{width:"abbreviated",context:"formatting"});case"aaa":return J.dayPeriod(re,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return J.dayPeriod(re,{width:"narrow",context:"formatting"});case"aaaa":default:return J.dayPeriod(re,{width:"wide",context:"formatting"})}},b:function(X,W,J){const te=X.getHours();let re;switch(te===12?re=dayPeriodEnum.noon:te===0?re=dayPeriodEnum.midnight:re=te/12>=1?"pm":"am",W){case"b":case"bb":return J.dayPeriod(re,{width:"abbreviated",context:"formatting"});case"bbb":return J.dayPeriod(re,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return J.dayPeriod(re,{width:"narrow",context:"formatting"});case"bbbb":default:return J.dayPeriod(re,{width:"wide",context:"formatting"})}},B:function(X,W,J){const te=X.getHours();let re;switch(te>=17?re=dayPeriodEnum.evening:te>=12?re=dayPeriodEnum.afternoon:te>=4?re=dayPeriodEnum.morning:re=dayPeriodEnum.night,W){case"B":case"BB":case"BBB":return J.dayPeriod(re,{width:"abbreviated",context:"formatting"});case"BBBBB":return J.dayPeriod(re,{width:"narrow",context:"formatting"});case"BBBB":default:return J.dayPeriod(re,{width:"wide",context:"formatting"})}},h:function(X,W,J){if(W==="ho"){let te=X.getHours()%12;return te===0&&(te=12),J.ordinalNumber(te,{unit:"hour"})}return lightFormatters.h(X,W)},H:function(X,W,J){return W==="Ho"?J.ordinalNumber(X.getHours(),{unit:"hour"}):lightFormatters.H(X,W)},K:function(X,W,J){const te=X.getHours()%12;return W==="Ko"?J.ordinalNumber(te,{unit:"hour"}):addLeadingZeros(te,W.length)},k:function(X,W,J){let te=X.getHours();return te===0&&(te=24),W==="ko"?J.ordinalNumber(te,{unit:"hour"}):addLeadingZeros(te,W.length)},m:function(X,W,J){return W==="mo"?J.ordinalNumber(X.getMinutes(),{unit:"minute"}):lightFormatters.m(X,W)},s:function(X,W,J){return W==="so"?J.ordinalNumber(X.getSeconds(),{unit:"second"}):lightFormatters.s(X,W)},S:function(X,W){return lightFormatters.S(X,W)},X:function(X,W,J){const te=X.getTimezoneOffset();if(te===0)return"Z";switch(W){case"X":return formatTimezoneWithOptionalMinutes(te);case"XXXX":case"XX":return formatTimezone(te);case"XXXXX":case"XXX":default:return formatTimezone(te,":")}},x:function(X,W,J){const te=X.getTimezoneOffset();switch(W){case"x":return formatTimezoneWithOptionalMinutes(te);case"xxxx":case"xx":return formatTimezone(te);case"xxxxx":case"xxx":default:return formatTimezone(te,":")}},O:function(X,W,J){const te=X.getTimezoneOffset();switch(W){case"O":case"OO":case"OOO":return"GMT"+formatTimezoneShort(te,":");case"OOOO":default:return"GMT"+formatTimezone(te,":")}},z:function(X,W,J){const te=X.getTimezoneOffset();switch(W){case"z":case"zz":case"zzz":return"GMT"+formatTimezoneShort(te,":");case"zzzz":default:return"GMT"+formatTimezone(te,":")}},t:function(X,W,J){const te=Math.trunc(X.getTime()/1e3);return addLeadingZeros(te,W.length)},T:function(X,W,J){const te=X.getTime();return addLeadingZeros(te,W.length)}};function formatTimezoneShort(X,W=""){const J=X>0?"-":"+",te=Math.abs(X),re=Math.trunc(te/60),ne=te%60;return ne===0?J+String(re):J+String(re)+W+addLeadingZeros(ne,2)}function formatTimezoneWithOptionalMinutes(X,W){return X%60===0?(X>0?"-":"+")+addLeadingZeros(Math.abs(X)/60,2):formatTimezone(X,W)}function formatTimezone(X,W=""){const J=X>0?"-":"+",te=Math.abs(X),re=addLeadingZeros(Math.trunc(te/60),2),ne=addLeadingZeros(te%60,2);return J+re+W+ne}const dateLongFormatter=(X,W)=>{switch(X){case"P":return W.date({width:"short"});case"PP":return W.date({width:"medium"});case"PPP":return W.date({width:"long"});case"PPPP":default:return W.date({width:"full"})}},timeLongFormatter=(X,W)=>{switch(X){case"p":return W.time({width:"short"});case"pp":return W.time({width:"medium"});case"ppp":return W.time({width:"long"});case"pppp":default:return W.time({width:"full"})}},dateTimeLongFormatter=(X,W)=>{const J=X.match(/(P+)(p+)?/)||[],te=J[1],re=J[2];if(!re)return dateLongFormatter(X,W);let ne;switch(te){case"P":ne=W.dateTime({width:"short"});break;case"PP":ne=W.dateTime({width:"medium"});break;case"PPP":ne=W.dateTime({width:"long"});break;case"PPPP":default:ne=W.dateTime({width:"full"});break}return ne.replace("{{date}}",dateLongFormatter(te,W)).replace("{{time}}",timeLongFormatter(re,W))},longFormatters={p:timeLongFormatter,P:dateTimeLongFormatter},dayOfYearTokenRE=/^D+$/,weekYearTokenRE=/^Y+$/,throwTokens=["D","DD","YY","YYYY"];function isProtectedDayOfYearToken(X){return dayOfYearTokenRE.test(X)}function isProtectedWeekYearToken(X){return weekYearTokenRE.test(X)}function warnOrThrowProtectedError(X,W,J){const te=message(X,W,J);if(console.warn(te),throwTokens.includes(X))throw new RangeError(te)}function message(X,W,J){const te=X[0]==="Y"?"years":"days of the month";return`Use \`${X.toLowerCase()}\` instead of \`${X}\` (in \`${W}\`) for formatting ${te} to the input \`${J}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const formattingTokensRegExp$1=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,longFormattingTokensRegExp$1=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,escapedStringRegExp$1=/^'([^]*?)'?$/,doubleQuoteRegExp$1=/''/g,unescapedLatinCharacterRegExp$1=/[a-zA-Z]/;function format(X,W,J){var he,pe,fe,ge;const te=getDefaultOptions$1(),re=te.locale??enUS,ne=te.firstWeekContainsDate??((pe=(he=te.locale)==null?void 0:he.options)==null?void 0:pe.firstWeekContainsDate)??1,oe=te.weekStartsOn??((ge=(fe=te.locale)==null?void 0:fe.options)==null?void 0:ge.weekStartsOn)??0,de=toDate(X);if(!isValid(de))throw new RangeError("Invalid time value");let ue=W.match(longFormattingTokensRegExp$1).map(be=>{const me=be[0];if(me==="p"||me==="P"){const ve=longFormatters[me];return ve(be,re.formatLong)}return be}).join("").match(formattingTokensRegExp$1).map(be=>{if(be==="''")return{isToken:!1,value:"'"};const me=be[0];if(me==="'")return{isToken:!1,value:cleanEscapedString$1(be)};if(formatters[me])return{isToken:!0,value:be};if(me.match(unescapedLatinCharacterRegExp$1))throw new RangeError("Format string contains an unescaped latin alphabet character `"+me+"`");return{isToken:!1,value:be}});re.localize.preprocessor&&(ue=re.localize.preprocessor(de,ue));const ce={firstWeekContainsDate:ne,weekStartsOn:oe,locale:re};return ue.map(be=>{if(!be.isToken)return be.value;const me=be.value;(isProtectedWeekYearToken(me)||isProtectedDayOfYearToken(me))&&warnOrThrowProtectedError(me,W,String(X));const ve=formatters[me[0]];return ve(de,me,re.localize,ce)}).join("")}function cleanEscapedString$1(X){const W=X.match(escapedStringRegExp$1);return W?W[1].replace(doubleQuoteRegExp$1,"'"):X}function getDay(X){return toDate(X).getDay()}function getDefaultOptions(){return Object.assign({},getDefaultOptions$1())}function getISODay(X){let J=toDate(X).getDay();return J===0&&(J=7),J}function transpose(X,W){const J=W instanceof Date?constructFrom(W,0):new W(0);return J.setFullYear(X.getFullYear(),X.getMonth(),X.getDate()),J.setHours(X.getHours(),X.getMinutes(),X.getSeconds(),X.getMilliseconds()),J}const TIMEZONE_UNIT_PRIORITY=10;class Setter{constructor(){zt(this,"subPriority",0)}validate(W,J){return!0}}class ValueSetter extends Setter{constructor(W,J,te,re,ne){super(),this.value=W,this.validateValue=J,this.setValue=te,this.priority=re,ne&&(this.subPriority=ne)}validate(W,J){return this.validateValue(W,this.value,J)}set(W,J,te){return this.setValue(W,J,this.value,te)}}class DateToSystemTimezoneSetter extends Setter{constructor(){super(...arguments);zt(this,"priority",TIMEZONE_UNIT_PRIORITY);zt(this,"subPriority",-1)}set(J,te){return te.timestampIsSet?J:constructFrom(J,transpose(J,Date))}}class Parser{run(W,J,te,re){const ne=this.parse(W,J,te,re);return ne?{setter:new ValueSetter(ne.value,this.validate,this.set,this.priority,this.subPriority),rest:ne.rest}:null}validate(W,J,te){return!0}}class EraParser extends Parser{constructor(){super(...arguments);zt(this,"priority",140);zt(this,"incompatibleTokens",["R","u","t","T"])}parse(J,te,re){switch(te){case"G":case"GG":case"GGG":return re.era(J,{width:"abbreviated"})||re.era(J,{width:"narrow"});case"GGGGG":return re.era(J,{width:"narrow"});case"GGGG":default:return re.era(J,{width:"wide"})||re.era(J,{width:"abbreviated"})||re.era(J,{width:"narrow"})}}set(J,te,re){return te.era=re,J.setFullYear(re,0,1),J.setHours(0,0,0,0),J}}const numericPatterns={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},timezonePatterns={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function mapValue(X,W){return X&&{value:W(X.value),rest:X.rest}}function parseNumericPattern(X,W){const J=W.match(X);return J?{value:parseInt(J[0],10),rest:W.slice(J[0].length)}:null}function parseTimezonePattern(X,W){const J=W.match(X);if(!J)return null;if(J[0]==="Z")return{value:0,rest:W.slice(1)};const te=J[1]==="+"?1:-1,re=J[2]?parseInt(J[2],10):0,ne=J[3]?parseInt(J[3],10):0,oe=J[5]?parseInt(J[5],10):0;return{value:te*(re*millisecondsInHour+ne*millisecondsInMinute+oe*millisecondsInSecond),rest:W.slice(J[0].length)}}function parseAnyDigitsSigned(X){return parseNumericPattern(numericPatterns.anyDigitsSigned,X)}function parseNDigits(X,W){switch(X){case 1:return parseNumericPattern(numericPatterns.singleDigit,W);case 2:return parseNumericPattern(numericPatterns.twoDigits,W);case 3:return parseNumericPattern(numericPatterns.threeDigits,W);case 4:return parseNumericPattern(numericPatterns.fourDigits,W);default:return parseNumericPattern(new RegExp("^\\d{1,"+X+"}"),W)}}function parseNDigitsSigned(X,W){switch(X){case 1:return parseNumericPattern(numericPatterns.singleDigitSigned,W);case 2:return parseNumericPattern(numericPatterns.twoDigitsSigned,W);case 3:return parseNumericPattern(numericPatterns.threeDigitsSigned,W);case 4:return parseNumericPattern(numericPatterns.fourDigitsSigned,W);default:return parseNumericPattern(new RegExp("^-?\\d{1,"+X+"}"),W)}}function dayPeriodEnumToHours(X){switch(X){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function normalizeTwoDigitYear(X,W){const J=W>0,te=J?W:1-W;let re;if(te<=50)re=X||100;else{const ne=te+50,oe=Math.trunc(ne/100)*100,de=X>=ne%100;re=X+oe-(de?100:0)}return J?re:1-re}function isLeapYearIndex(X){return X%400===0||X%4===0&&X%100!==0}class YearParser extends Parser{constructor(){super(...arguments);zt(this,"priority",130);zt(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(J,te,re){const ne=oe=>({year:oe,isTwoDigitYear:te==="yy"});switch(te){case"y":return mapValue(parseNDigits(4,J),ne);case"yo":return mapValue(re.ordinalNumber(J,{unit:"year"}),ne);default:return mapValue(parseNDigits(te.length,J),ne)}}validate(J,te){return te.isTwoDigitYear||te.year>0}set(J,te,re){const ne=J.getFullYear();if(re.isTwoDigitYear){const de=normalizeTwoDigitYear(re.year,ne);return J.setFullYear(de,0,1),J.setHours(0,0,0,0),J}const oe=!("era"in te)||te.era===1?re.year:1-re.year;return J.setFullYear(oe,0,1),J.setHours(0,0,0,0),J}}class LocalWeekYearParser extends Parser{constructor(){super(...arguments);zt(this,"priority",130);zt(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(J,te,re){const ne=oe=>({year:oe,isTwoDigitYear:te==="YY"});switch(te){case"Y":return mapValue(parseNDigits(4,J),ne);case"Yo":return mapValue(re.ordinalNumber(J,{unit:"year"}),ne);default:return mapValue(parseNDigits(te.length,J),ne)}}validate(J,te){return te.isTwoDigitYear||te.year>0}set(J,te,re,ne){const oe=getWeekYear(J,ne);if(re.isTwoDigitYear){const ue=normalizeTwoDigitYear(re.year,oe);return J.setFullYear(ue,0,ne.firstWeekContainsDate),J.setHours(0,0,0,0),startOfWeek(J,ne)}const de=!("era"in te)||te.era===1?re.year:1-re.year;return J.setFullYear(de,0,ne.firstWeekContainsDate),J.setHours(0,0,0,0),startOfWeek(J,ne)}}class ISOWeekYearParser extends Parser{constructor(){super(...arguments);zt(this,"priority",130);zt(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(J,te){return parseNDigitsSigned(te==="R"?4:te.length,J)}set(J,te,re){const ne=constructFrom(J,0);return ne.setFullYear(re,0,4),ne.setHours(0,0,0,0),startOfISOWeek(ne)}}class ExtendedYearParser extends Parser{constructor(){super(...arguments);zt(this,"priority",130);zt(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(J,te){return parseNDigitsSigned(te==="u"?4:te.length,J)}set(J,te,re){return J.setFullYear(re,0,1),J.setHours(0,0,0,0),J}}class QuarterParser extends Parser{constructor(){super(...arguments);zt(this,"priority",120);zt(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(J,te,re){switch(te){case"Q":case"QQ":return parseNDigits(te.length,J);case"Qo":return re.ordinalNumber(J,{unit:"quarter"});case"QQQ":return re.quarter(J,{width:"abbreviated",context:"formatting"})||re.quarter(J,{width:"narrow",context:"formatting"});case"QQQQQ":return re.quarter(J,{width:"narrow",context:"formatting"});case"QQQQ":default:return re.quarter(J,{width:"wide",context:"formatting"})||re.quarter(J,{width:"abbreviated",context:"formatting"})||re.quarter(J,{width:"narrow",context:"formatting"})}}validate(J,te){return te>=1&&te<=4}set(J,te,re){return J.setMonth((re-1)*3,1),J.setHours(0,0,0,0),J}}class StandAloneQuarterParser extends Parser{constructor(){super(...arguments);zt(this,"priority",120);zt(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(J,te,re){switch(te){case"q":case"qq":return parseNDigits(te.length,J);case"qo":return re.ordinalNumber(J,{unit:"quarter"});case"qqq":return re.quarter(J,{width:"abbreviated",context:"standalone"})||re.quarter(J,{width:"narrow",context:"standalone"});case"qqqqq":return re.quarter(J,{width:"narrow",context:"standalone"});case"qqqq":default:return re.quarter(J,{width:"wide",context:"standalone"})||re.quarter(J,{width:"abbreviated",context:"standalone"})||re.quarter(J,{width:"narrow",context:"standalone"})}}validate(J,te){return te>=1&&te<=4}set(J,te,re){return J.setMonth((re-1)*3,1),J.setHours(0,0,0,0),J}}class MonthParser extends Parser{constructor(){super(...arguments);zt(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);zt(this,"priority",110)}parse(J,te,re){const ne=oe=>oe-1;switch(te){case"M":return mapValue(parseNumericPattern(numericPatterns.month,J),ne);case"MM":return mapValue(parseNDigits(2,J),ne);case"Mo":return mapValue(re.ordinalNumber(J,{unit:"month"}),ne);case"MMM":return re.month(J,{width:"abbreviated",context:"formatting"})||re.month(J,{width:"narrow",context:"formatting"});case"MMMMM":return re.month(J,{width:"narrow",context:"formatting"});case"MMMM":default:return re.month(J,{width:"wide",context:"formatting"})||re.month(J,{width:"abbreviated",context:"formatting"})||re.month(J,{width:"narrow",context:"formatting"})}}validate(J,te){return te>=0&&te<=11}set(J,te,re){return J.setMonth(re,1),J.setHours(0,0,0,0),J}}class StandAloneMonthParser extends Parser{constructor(){super(...arguments);zt(this,"priority",110);zt(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(J,te,re){const ne=oe=>oe-1;switch(te){case"L":return mapValue(parseNumericPattern(numericPatterns.month,J),ne);case"LL":return mapValue(parseNDigits(2,J),ne);case"Lo":return mapValue(re.ordinalNumber(J,{unit:"month"}),ne);case"LLL":return re.month(J,{width:"abbreviated",context:"standalone"})||re.month(J,{width:"narrow",context:"standalone"});case"LLLLL":return re.month(J,{width:"narrow",context:"standalone"});case"LLLL":default:return re.month(J,{width:"wide",context:"standalone"})||re.month(J,{width:"abbreviated",context:"standalone"})||re.month(J,{width:"narrow",context:"standalone"})}}validate(J,te){return te>=0&&te<=11}set(J,te,re){return J.setMonth(re,1),J.setHours(0,0,0,0),J}}function setWeek(X,W,J){const te=toDate(X),re=getWeek(te,J)-W;return te.setDate(te.getDate()-re*7),te}class LocalWeekParser extends Parser{constructor(){super(...arguments);zt(this,"priority",100);zt(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(J,te,re){switch(te){case"w":return parseNumericPattern(numericPatterns.week,J);case"wo":return re.ordinalNumber(J,{unit:"week"});default:return parseNDigits(te.length,J)}}validate(J,te){return te>=1&&te<=53}set(J,te,re,ne){return startOfWeek(setWeek(J,re,ne),ne)}}function setISOWeek(X,W){const J=toDate(X),te=getISOWeek(J)-W;return J.setDate(J.getDate()-te*7),J}class ISOWeekParser extends Parser{constructor(){super(...arguments);zt(this,"priority",100);zt(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(J,te,re){switch(te){case"I":return parseNumericPattern(numericPatterns.week,J);case"Io":return re.ordinalNumber(J,{unit:"week"});default:return parseNDigits(te.length,J)}}validate(J,te){return te>=1&&te<=53}set(J,te,re){return startOfISOWeek(setISOWeek(J,re))}}const DAYS_IN_MONTH=[31,28,31,30,31,30,31,31,30,31,30,31],DAYS_IN_MONTH_LEAP_YEAR=[31,29,31,30,31,30,31,31,30,31,30,31];class DateParser extends Parser{constructor(){super(...arguments);zt(this,"priority",90);zt(this,"subPriority",1);zt(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(J,te,re){switch(te){case"d":return parseNumericPattern(numericPatterns.date,J);case"do":return re.ordinalNumber(J,{unit:"date"});default:return parseNDigits(te.length,J)}}validate(J,te){const re=J.getFullYear(),ne=isLeapYearIndex(re),oe=J.getMonth();return ne?te>=1&&te<=DAYS_IN_MONTH_LEAP_YEAR[oe]:te>=1&&te<=DAYS_IN_MONTH[oe]}set(J,te,re){return J.setDate(re),J.setHours(0,0,0,0),J}}class DayOfYearParser extends Parser{constructor(){super(...arguments);zt(this,"priority",90);zt(this,"subpriority",1);zt(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(J,te,re){switch(te){case"D":case"DD":return parseNumericPattern(numericPatterns.dayOfYear,J);case"Do":return re.ordinalNumber(J,{unit:"date"});default:return parseNDigits(te.length,J)}}validate(J,te){const re=J.getFullYear();return isLeapYearIndex(re)?te>=1&&te<=366:te>=1&&te<=365}set(J,te,re){return J.setMonth(0,re),J.setHours(0,0,0,0),J}}function setDay(X,W,J){var pe,fe,ge,be;const te=getDefaultOptions$1(),re=(J==null?void 0:J.weekStartsOn)??((fe=(pe=J==null?void 0:J.locale)==null?void 0:pe.options)==null?void 0:fe.weekStartsOn)??te.weekStartsOn??((be=(ge=te.locale)==null?void 0:ge.options)==null?void 0:be.weekStartsOn)??0,ne=toDate(X),oe=ne.getDay(),ue=(W%7+7)%7,ce=7-re,he=W<0||W>6?W-(oe+ce)%7:(ue+ce)%7-(oe+ce)%7;return addDays(ne,he)}class DayParser extends Parser{constructor(){super(...arguments);zt(this,"priority",90);zt(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(J,te,re){switch(te){case"E":case"EE":case"EEE":return re.day(J,{width:"abbreviated",context:"formatting"})||re.day(J,{width:"short",context:"formatting"})||re.day(J,{width:"narrow",context:"formatting"});case"EEEEE":return re.day(J,{width:"narrow",context:"formatting"});case"EEEEEE":return re.day(J,{width:"short",context:"formatting"})||re.day(J,{width:"narrow",context:"formatting"});case"EEEE":default:return re.day(J,{width:"wide",context:"formatting"})||re.day(J,{width:"abbreviated",context:"formatting"})||re.day(J,{width:"short",context:"formatting"})||re.day(J,{width:"narrow",context:"formatting"})}}validate(J,te){return te>=0&&te<=6}set(J,te,re,ne){return J=setDay(J,re,ne),J.setHours(0,0,0,0),J}}class LocalDayParser extends Parser{constructor(){super(...arguments);zt(this,"priority",90);zt(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(J,te,re,ne){const oe=de=>{const ue=Math.floor((de-1)/7)*7;return(de+ne.weekStartsOn+6)%7+ue};switch(te){case"e":case"ee":return mapValue(parseNDigits(te.length,J),oe);case"eo":return mapValue(re.ordinalNumber(J,{unit:"day"}),oe);case"eee":return re.day(J,{width:"abbreviated",context:"formatting"})||re.day(J,{width:"short",context:"formatting"})||re.day(J,{width:"narrow",context:"formatting"});case"eeeee":return re.day(J,{width:"narrow",context:"formatting"});case"eeeeee":return re.day(J,{width:"short",context:"formatting"})||re.day(J,{width:"narrow",context:"formatting"});case"eeee":default:return re.day(J,{width:"wide",context:"formatting"})||re.day(J,{width:"abbreviated",context:"formatting"})||re.day(J,{width:"short",context:"formatting"})||re.day(J,{width:"narrow",context:"formatting"})}}validate(J,te){return te>=0&&te<=6}set(J,te,re,ne){return J=setDay(J,re,ne),J.setHours(0,0,0,0),J}}class StandAloneLocalDayParser extends Parser{constructor(){super(...arguments);zt(this,"priority",90);zt(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(J,te,re,ne){const oe=de=>{const ue=Math.floor((de-1)/7)*7;return(de+ne.weekStartsOn+6)%7+ue};switch(te){case"c":case"cc":return mapValue(parseNDigits(te.length,J),oe);case"co":return mapValue(re.ordinalNumber(J,{unit:"day"}),oe);case"ccc":return re.day(J,{width:"abbreviated",context:"standalone"})||re.day(J,{width:"short",context:"standalone"})||re.day(J,{width:"narrow",context:"standalone"});case"ccccc":return re.day(J,{width:"narrow",context:"standalone"});case"cccccc":return re.day(J,{width:"short",context:"standalone"})||re.day(J,{width:"narrow",context:"standalone"});case"cccc":default:return re.day(J,{width:"wide",context:"standalone"})||re.day(J,{width:"abbreviated",context:"standalone"})||re.day(J,{width:"short",context:"standalone"})||re.day(J,{width:"narrow",context:"standalone"})}}validate(J,te){return te>=0&&te<=6}set(J,te,re,ne){return J=setDay(J,re,ne),J.setHours(0,0,0,0),J}}function setISODay(X,W){const J=toDate(X),te=getISODay(J),re=W-te;return addDays(J,re)}class ISODayParser extends Parser{constructor(){super(...arguments);zt(this,"priority",90);zt(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(J,te,re){const ne=oe=>oe===0?7:oe;switch(te){case"i":case"ii":return parseNDigits(te.length,J);case"io":return re.ordinalNumber(J,{unit:"day"});case"iii":return mapValue(re.day(J,{width:"abbreviated",context:"formatting"})||re.day(J,{width:"short",context:"formatting"})||re.day(J,{width:"narrow",context:"formatting"}),ne);case"iiiii":return mapValue(re.day(J,{width:"narrow",context:"formatting"}),ne);case"iiiiii":return mapValue(re.day(J,{width:"short",context:"formatting"})||re.day(J,{width:"narrow",context:"formatting"}),ne);case"iiii":default:return mapValue(re.day(J,{width:"wide",context:"formatting"})||re.day(J,{width:"abbreviated",context:"formatting"})||re.day(J,{width:"short",context:"formatting"})||re.day(J,{width:"narrow",context:"formatting"}),ne)}}validate(J,te){return te>=1&&te<=7}set(J,te,re){return J=setISODay(J,re),J.setHours(0,0,0,0),J}}class AMPMParser extends Parser{constructor(){super(...arguments);zt(this,"priority",80);zt(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(J,te,re){switch(te){case"a":case"aa":case"aaa":return re.dayPeriod(J,{width:"abbreviated",context:"formatting"})||re.dayPeriod(J,{width:"narrow",context:"formatting"});case"aaaaa":return re.dayPeriod(J,{width:"narrow",context:"formatting"});case"aaaa":default:return re.dayPeriod(J,{width:"wide",context:"formatting"})||re.dayPeriod(J,{width:"abbreviated",context:"formatting"})||re.dayPeriod(J,{width:"narrow",context:"formatting"})}}set(J,te,re){return J.setHours(dayPeriodEnumToHours(re),0,0,0),J}}class AMPMMidnightParser extends Parser{constructor(){super(...arguments);zt(this,"priority",80);zt(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(J,te,re){switch(te){case"b":case"bb":case"bbb":return re.dayPeriod(J,{width:"abbreviated",context:"formatting"})||re.dayPeriod(J,{width:"narrow",context:"formatting"});case"bbbbb":return re.dayPeriod(J,{width:"narrow",context:"formatting"});case"bbbb":default:return re.dayPeriod(J,{width:"wide",context:"formatting"})||re.dayPeriod(J,{width:"abbreviated",context:"formatting"})||re.dayPeriod(J,{width:"narrow",context:"formatting"})}}set(J,te,re){return J.setHours(dayPeriodEnumToHours(re),0,0,0),J}}class DayPeriodParser extends Parser{constructor(){super(...arguments);zt(this,"priority",80);zt(this,"incompatibleTokens",["a","b","t","T"])}parse(J,te,re){switch(te){case"B":case"BB":case"BBB":return re.dayPeriod(J,{width:"abbreviated",context:"formatting"})||re.dayPeriod(J,{width:"narrow",context:"formatting"});case"BBBBB":return re.dayPeriod(J,{width:"narrow",context:"formatting"});case"BBBB":default:return re.dayPeriod(J,{width:"wide",context:"formatting"})||re.dayPeriod(J,{width:"abbreviated",context:"formatting"})||re.dayPeriod(J,{width:"narrow",context:"formatting"})}}set(J,te,re){return J.setHours(dayPeriodEnumToHours(re),0,0,0),J}}class Hour1to12Parser extends Parser{constructor(){super(...arguments);zt(this,"priority",70);zt(this,"incompatibleTokens",["H","K","k","t","T"])}parse(J,te,re){switch(te){case"h":return parseNumericPattern(numericPatterns.hour12h,J);case"ho":return re.ordinalNumber(J,{unit:"hour"});default:return parseNDigits(te.length,J)}}validate(J,te){return te>=1&&te<=12}set(J,te,re){const ne=J.getHours()>=12;return ne&&re<12?J.setHours(re+12,0,0,0):!ne&&re===12?J.setHours(0,0,0,0):J.setHours(re,0,0,0),J}}class Hour0to23Parser extends Parser{constructor(){super(...arguments);zt(this,"priority",70);zt(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(J,te,re){switch(te){case"H":return parseNumericPattern(numericPatterns.hour23h,J);case"Ho":return re.ordinalNumber(J,{unit:"hour"});default:return parseNDigits(te.length,J)}}validate(J,te){return te>=0&&te<=23}set(J,te,re){return J.setHours(re,0,0,0),J}}class Hour0To11Parser extends Parser{constructor(){super(...arguments);zt(this,"priority",70);zt(this,"incompatibleTokens",["h","H","k","t","T"])}parse(J,te,re){switch(te){case"K":return parseNumericPattern(numericPatterns.hour11h,J);case"Ko":return re.ordinalNumber(J,{unit:"hour"});default:return parseNDigits(te.length,J)}}validate(J,te){return te>=0&&te<=11}set(J,te,re){return J.getHours()>=12&&re<12?J.setHours(re+12,0,0,0):J.setHours(re,0,0,0),J}}class Hour1To24Parser extends Parser{constructor(){super(...arguments);zt(this,"priority",70);zt(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(J,te,re){switch(te){case"k":return parseNumericPattern(numericPatterns.hour24h,J);case"ko":return re.ordinalNumber(J,{unit:"hour"});default:return parseNDigits(te.length,J)}}validate(J,te){return te>=1&&te<=24}set(J,te,re){const ne=re<=24?re%24:re;return J.setHours(ne,0,0,0),J}}class MinuteParser extends Parser{constructor(){super(...arguments);zt(this,"priority",60);zt(this,"incompatibleTokens",["t","T"])}parse(J,te,re){switch(te){case"m":return parseNumericPattern(numericPatterns.minute,J);case"mo":return re.ordinalNumber(J,{unit:"minute"});default:return parseNDigits(te.length,J)}}validate(J,te){return te>=0&&te<=59}set(J,te,re){return J.setMinutes(re,0,0),J}}class SecondParser extends Parser{constructor(){super(...arguments);zt(this,"priority",50);zt(this,"incompatibleTokens",["t","T"])}parse(J,te,re){switch(te){case"s":return parseNumericPattern(numericPatterns.second,J);case"so":return re.ordinalNumber(J,{unit:"second"});default:return parseNDigits(te.length,J)}}validate(J,te){return te>=0&&te<=59}set(J,te,re){return J.setSeconds(re,0),J}}class FractionOfSecondParser extends Parser{constructor(){super(...arguments);zt(this,"priority",30);zt(this,"incompatibleTokens",["t","T"])}parse(J,te){const re=ne=>Math.trunc(ne*Math.pow(10,-te.length+3));return mapValue(parseNDigits(te.length,J),re)}set(J,te,re){return J.setMilliseconds(re),J}}class ISOTimezoneWithZParser extends Parser{constructor(){super(...arguments);zt(this,"priority",10);zt(this,"incompatibleTokens",["t","T","x"])}parse(J,te){switch(te){case"X":return parseTimezonePattern(timezonePatterns.basicOptionalMinutes,J);case"XX":return parseTimezonePattern(timezonePatterns.basic,J);case"XXXX":return parseTimezonePattern(timezonePatterns.basicOptionalSeconds,J);case"XXXXX":return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds,J);case"XXX":default:return parseTimezonePattern(timezonePatterns.extended,J)}}set(J,te,re){return te.timestampIsSet?J:constructFrom(J,J.getTime()-getTimezoneOffsetInMilliseconds(J)-re)}}class ISOTimezoneParser extends Parser{constructor(){super(...arguments);zt(this,"priority",10);zt(this,"incompatibleTokens",["t","T","X"])}parse(J,te){switch(te){case"x":return parseTimezonePattern(timezonePatterns.basicOptionalMinutes,J);case"xx":return parseTimezonePattern(timezonePatterns.basic,J);case"xxxx":return parseTimezonePattern(timezonePatterns.basicOptionalSeconds,J);case"xxxxx":return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds,J);case"xxx":default:return parseTimezonePattern(timezonePatterns.extended,J)}}set(J,te,re){return te.timestampIsSet?J:constructFrom(J,J.getTime()-getTimezoneOffsetInMilliseconds(J)-re)}}class TimestampSecondsParser extends Parser{constructor(){super(...arguments);zt(this,"priority",40);zt(this,"incompatibleTokens","*")}parse(J){return parseAnyDigitsSigned(J)}set(J,te,re){return[constructFrom(J,re*1e3),{timestampIsSet:!0}]}}class TimestampMillisecondsParser extends Parser{constructor(){super(...arguments);zt(this,"priority",20);zt(this,"incompatibleTokens","*")}parse(J){return parseAnyDigitsSigned(J)}set(J,te,re){return[constructFrom(J,re),{timestampIsSet:!0}]}}const parsers={G:new EraParser,y:new YearParser,Y:new LocalWeekYearParser,R:new ISOWeekYearParser,u:new ExtendedYearParser,Q:new QuarterParser,q:new StandAloneQuarterParser,M:new MonthParser,L:new StandAloneMonthParser,w:new LocalWeekParser,I:new ISOWeekParser,d:new DateParser,D:new DayOfYearParser,E:new DayParser,e:new LocalDayParser,c:new StandAloneLocalDayParser,i:new ISODayParser,a:new AMPMParser,b:new AMPMMidnightParser,B:new DayPeriodParser,h:new Hour1to12Parser,H:new Hour0to23Parser,K:new Hour0To11Parser,k:new Hour1To24Parser,m:new MinuteParser,s:new SecondParser,S:new FractionOfSecondParser,X:new ISOTimezoneWithZParser,x:new ISOTimezoneParser,t:new TimestampSecondsParser,T:new TimestampMillisecondsParser},formattingTokensRegExp=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,longFormattingTokensRegExp=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,escapedStringRegExp=/^'([^]*?)'?$/,doubleQuoteRegExp=/''/g,notWhitespaceRegExp=/\S/,unescapedLatinCharacterRegExp=/[a-zA-Z]/;function parse(X,W,J,te){var me,ve,ye,we;const re=getDefaultOptions(),ne=re.locale??enUS,oe=re.firstWeekContainsDate??((ve=(me=re.locale)==null?void 0:me.options)==null?void 0:ve.firstWeekContainsDate)??1,de=re.weekStartsOn??((we=(ye=re.locale)==null?void 0:ye.options)==null?void 0:we.weekStartsOn)??0,ue={firstWeekContainsDate:oe,weekStartsOn:de,locale:ne},ce=[new DateToSystemTimezoneSetter],he=W.match(longFormattingTokensRegExp).map(Se=>{const _e=Se[0];if(_e in longFormatters){const Ce=longFormatters[_e];return Ce(Se,ne.formatLong)}return Se}).join("").match(formattingTokensRegExp),pe=[];for(let Se of he){isProtectedWeekYearToken(Se)&&warnOrThrowProtectedError(Se,W,X),isProtectedDayOfYearToken(Se)&&warnOrThrowProtectedError(Se,W,X);const _e=Se[0],Ce=parsers[_e];if(Ce){const{incompatibleTokens:Le}=Ce;if(Array.isArray(Le)){const Ie=pe.find(Fe=>Le.includes(Fe.token)||Fe.token===_e);if(Ie)throw new RangeError(`The format string mustn't contain \`${Ie.fullToken}\` and \`${Se}\` at the same time`)}else if(Ce.incompatibleTokens==="*"&&pe.length>0)throw new RangeError(`The format string mustn't contain \`${Se}\` and any other token at the same time`);pe.push({token:_e,fullToken:Se});const Pe=Ce.run(X,Se,ne.match,ue);if(!Pe)return constructFrom(J,NaN);ce.push(Pe.setter),X=Pe.rest}else{if(_e.match(unescapedLatinCharacterRegExp))throw new RangeError("Format string contains an unescaped latin alphabet character `"+_e+"`");if(Se==="''"?Se="'":_e==="'"&&(Se=cleanEscapedString(Se)),X.indexOf(Se)===0)X=X.slice(Se.length);else return constructFrom(J,NaN)}}if(X.length>0&&notWhitespaceRegExp.test(X))return constructFrom(J,NaN);const fe=ce.map(Se=>Se.priority).sort((Se,_e)=>_e-Se).filter((Se,_e,Ce)=>Ce.indexOf(Se)===_e).map(Se=>ce.filter(_e=>_e.priority===Se).sort((_e,Ce)=>Ce.subPriority-_e.subPriority)).map(Se=>Se[0]);let ge=toDate(J);if(isNaN(ge.getTime()))return constructFrom(J,NaN);const be={};for(const Se of fe){if(!Se.validate(ge,ue))return constructFrom(J,NaN);const _e=Se.set(ge,be,ue);Array.isArray(_e)?(ge=_e[0],Object.assign(be,_e[1])):ge=_e}return constructFrom(J,ge)}function cleanEscapedString(X){return X.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp,"'")}const notFound="data:image/svg+xml,%3csvg%20width='215'%20height='150'%20viewBox='0%200%20215%20150'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20opacity='0.9'%20d='M135.132%2057.43C96.9221%2047.658%2083.3815%20-29.7048%2026.9734%2012.5083C-13.0511%2042.4595%2011.4691%20115.499%2061.6878%20107.019C92.0822%20101.867%2087.3917%20101.341%20113.129%20115.244C139.231%20129.308%20167.972%20136.397%20195.855%20111.436C210.28%2098.5179%20215.939%2067.0352%20201.939%2050.7417C184.388%2030.3592%20158.485%2063.4098%20135.132%2057.43Z'%20fill='%23EFF7FF'/%3e%3cellipse%20cx='120.5'%20cy='143.5'%20rx='52.5'%20ry='3.5'%20fill='%23F5F5F5'/%3e%3cpath%20d='M121.387%2080.2184C121.995%2079.5948%20122.563%2078.953%20123.09%2078.2959L134.396%2089.3383C135.09%2090.0177%20134.851%2091.389%20133.861%2092.4024C132.872%2093.4159%20131.505%2093.6888%20130.811%2093.0094L119.505%2081.967C120.148%2081.424%20120.777%2080.8407%20121.385%2080.2171L121.387%2080.2184Z'%20fill='%231D1D1D'/%3e%3cpath%20opacity='0.6'%20d='M121.127%2079.9896C132.157%2068.6986%20131.888%2050.5485%20120.527%2039.4502C109.166%2028.3519%2091.0149%2028.5081%2079.9849%2039.799C68.955%2051.09%2069.2233%2069.2401%2080.5843%2080.3385C91.9453%2091.4368%20110.097%2091.2806%20121.127%2079.9896Z'%20fill='%238FC2F5'/%3e%3cpath%20d='M78.0382%2083.0622C90.8729%2095.6382%20111.378%2095.4578%20123.835%2082.6609C136.293%2069.8625%20135.986%2049.2932%20123.15%2036.7173C110.316%2024.1413%2089.8107%2024.3217%2077.3538%2037.1186C64.8956%2049.9169%2065.2022%2070.4862%2078.0382%2083.0622ZM80.642%2080.387C69.289%2069.264%2069.0172%2051.0692%2080.037%2039.749C91.0569%2028.4288%20109.194%2028.2694%20120.547%2039.3938C131.9%2050.5182%20132.171%2068.713%20121.152%2080.0332C110.132%2091.3534%2091.9949%2091.5128%2080.642%2080.3884V80.387Z'%20fill='%237BACFC'/%3e%3cpath%20d='M169.953%20128.522L171.714%20126.696C173.474%20124.871%20173.421%20121.964%20171.595%20120.205L135.013%2084.9265C133.187%2083.1661%20130.281%2083.2205%20128.522%2085.0451L126.761%2086.8711C125.001%2088.6957%20125.055%2091.6028%20126.88%2093.3619L163.462%20128.64C165.287%20130.401%20168.194%20130.346%20169.953%20128.522Z'%20fill='%23656565'/%3e%3cpath%20opacity='0.35'%20d='M88.8399%2071.2315C96.506%2079.2245%20101.258%2078.1642%20100.757%2082.4547C100.256%2086.7452%2091.398%2085.7448%2082.7698%2076.0396C74.1415%2066.3344%2075.0893%2054.9166%2079.8491%2055.2485C84.6089%2055.5803%2080.129%2062.1492%2088.8399%2071.2315Z'%20fill='white'/%3e%3c/svg%3e";/**
321
321
  * @license
322
322
  * Copyright 2018 Google LLC
323
323
  * SPDX-License-Identifier: BSD-3-Clause
@@ -341,7 +341,7 @@ Registered bindings:`,re.forEach(function(ne){var oe="Object";ne.implementationT
341
341
  * @license
342
342
  * Copyright 2021 Google LLC
343
343
  * SPDX-License-Identifier: BSD-3-Clause
344
- */const defaultKeyFunction=X=>X,defaultRenderItem=(X,W)=>ke$1`${W}: ${JSON.stringify(X,null,2)}`;class VirtualizeDirective extends $t{constructor(W){if(super(W),this._virtualizer=null,this._first=0,this._last=-1,this._renderItem=(J,te)=>defaultRenderItem(J,te+this._first),this._keyFunction=(J,te)=>defaultKeyFunction(J,te+this._first),this._items=[],W.type!==t$f.CHILD)throw new Error("The virtualize directive can only be used in child expressions")}render(W){W&&this._setFunctions(W);const J=[];if(this._first>=0&&this._last>=this._first)for(let te=this._first;te<=this._last;te++)J.push(this._items[te]);return Qt(J,this._keyFunction,this._renderItem)}update(W,[J]){this._setFunctions(J);const te=this._items!==J.items;return this._items=J.items||[],this._virtualizer?this._updateVirtualizerConfig(W,J):this._initialize(W,J),te?R:this.render()}async _updateVirtualizerConfig(W,J){if(!await this._virtualizer.updateLayoutConfig(J.layout||{})){const re=W.parentNode;this._makeVirtualizer(re,J)}this._virtualizer.items=this._items}_setFunctions(W){const{renderItem:J,keyFunction:te}=W;J&&(this._renderItem=(re,ne)=>J(re,ne+this._first)),te&&(this._keyFunction=(re,ne)=>te(re,ne+this._first))}_makeVirtualizer(W,J){this._virtualizer&&this._virtualizer.disconnected();const{layout:te,scroller:re,items:ne}=J;this._virtualizer=new Virtualizer({hostElement:W,layout:te,scroller:re}),this._virtualizer.items=ne,this._virtualizer.connected()}_initialize(W,J){const te=W.parentNode;te&&te.nodeType===1&&(te.addEventListener("rangeChanged",re=>{this._first=re.first,this._last=re.last,this.setValue(this.render())}),this._makeVirtualizer(te,J))}disconnected(){var W;(W=this._virtualizer)==null||W.disconnected()}reconnected(){var W;(W=this._virtualizer)==null||W.connected()}}const virtualize=e$J(VirtualizeDirective);function shouldShowRole(X){return!X.professional.speciality.description}const hasItemDivider=(X,W)=>{const J=W.findIndex(oe=>oe.id===X.id);if(J===-1)return!1;if(J===W.length-1)return!0;const te=new Date(X.date).getTime(),re=new Date(W[J+1].date).getTime();return Math.abs(re-te)/(1e3*60)>15},template$f=X=>{var W;return X._hasUpdatedOnce?ke$1`
344
+ */const defaultKeyFunction=X=>X,defaultRenderItem=(X,W)=>ke$1`${W}: ${JSON.stringify(X,null,2)}`;class VirtualizeDirective extends $t{constructor(W){if(super(W),this._virtualizer=null,this._first=0,this._last=-1,this._renderItem=(J,te)=>defaultRenderItem(J,te+this._first),this._keyFunction=(J,te)=>defaultKeyFunction(J,te+this._first),this._items=[],W.type!==t$f.CHILD)throw new Error("The virtualize directive can only be used in child expressions")}render(W){W&&this._setFunctions(W);const J=[];if(this._first>=0&&this._last>=this._first)for(let te=this._first;te<=this._last;te++)J.push(this._items[te]);return Qt(J,this._keyFunction,this._renderItem)}update(W,[J]){this._setFunctions(J);const te=this._items!==J.items;return this._items=J.items||[],this._virtualizer?this._updateVirtualizerConfig(W,J):this._initialize(W,J),te?R:this.render()}async _updateVirtualizerConfig(W,J){if(!await this._virtualizer.updateLayoutConfig(J.layout||{})){const re=W.parentNode;this._makeVirtualizer(re,J)}this._virtualizer.items=this._items}_setFunctions(W){const{renderItem:J,keyFunction:te}=W;J&&(this._renderItem=(re,ne)=>J(re,ne+this._first)),te&&(this._keyFunction=(re,ne)=>te(re,ne+this._first))}_makeVirtualizer(W,J){this._virtualizer&&this._virtualizer.disconnected();const{layout:te,scroller:re,items:ne}=J;this._virtualizer=new Virtualizer({hostElement:W,layout:te,scroller:re}),this._virtualizer.items=ne,this._virtualizer.connected()}_initialize(W,J){const te=W.parentNode;te&&te.nodeType===1&&(te.addEventListener("rangeChanged",re=>{this._first=re.first,this._last=re.last,this.setValue(this.render())}),this._makeVirtualizer(te,J))}disconnected(){var W;(W=this._virtualizer)==null||W.disconnected()}reconnected(){var W;(W=this._virtualizer)==null||W.connected()}}const virtualize=e$J(VirtualizeDirective);function shouldShowRole(X){return!X.professional.speciality.description}const hasItemDivider=(X,W)=>{const J=W.findIndex(te=>te.id===X.id);return J===-1?!1:J===W.length-1?!0:!X.diagnostics.length},mergeHistoryItemsAndSubgroups=X=>{const W=X.items.map(te=>({type:"item",date:new Date(te.date),item:te})),J=X.subGroups.map(te=>({type:"subGroup",date:te.items.length?new Date(te.items[0].date):new Date(0),subGroup:te}));return[...W,...J].sort((te,re)=>re.date.getTime()-te.date.getTime())},template$f=X=>{var W;return X._hasUpdatedOnce?ke$1`
345
345
  <div class="container">
346
346
  ${((W=X.historyGroups)==null?void 0:W.length)>0?ke$1`
347
347
  <div class="virtualizer">
@@ -349,15 +349,28 @@ Registered bindings:`,re.forEach(function(ne){var oe="Object";ne.implementationT
349
349
  <div class="visit zIndex${X.historyGroups.length-te}" data-date=${to(((re=J.items[0])==null?void 0:re.date)||((oe=(ne=J.subGroups[0])==null?void 0:ne.items[0])==null?void 0:oe.date))}>
350
350
  ${visitHeaderTemplate(X,J.items[0]||((de=J.subGroups[0])==null?void 0:de.items[0]))}
351
351
  <div class="visit__items">
352
- ${Qt(J.items,ue=>ue.id,ue=>ke$1`<div class="item" ?has-divider=${hasItemDivider(ue,J.items)}>${ue.component}</div> `)}
353
- ${Qt(J.subGroups,ue=>ke$1`
354
- <div class="diagnostics">
355
- ${diagnosticHeaderTemplate(ue.items[0])}
356
- <div class="diagnostics__items">
357
- ${Qt(ue.items,ce=>ce.id,ce=>ke$1`<div class="item" ?has-divider=${hasItemDivider(ce,ue.items)}>${ce==null?void 0:ce.component}</div>`)}
358
- </div>
359
- </div>
360
- `)}
352
+ ${Qt(mergeHistoryItemsAndSubgroups(J),ue=>ue.type==="item"?ue.item.id:ue.subGroup.id,ue=>{if(ue.type==="item"){const he=ue.item;return ke$1`
353
+ <div
354
+ class="item"
355
+ ?has-divider=${hasItemDivider(he,J.items)}
356
+ >
357
+ ${he.component}
358
+ </div>
359
+ `}const ce=ue.subGroup;return ke$1`
360
+ <div class="diagnostics">
361
+ ${diagnosticHeaderTemplate(ce.items[0])}
362
+ <div class="diagnostics__items">
363
+ ${Qt(ce.items,he=>he.id,he=>ke$1`
364
+ <div
365
+ class="item"
366
+ ?has-divider=${hasItemDivider(he,ce.items)}
367
+ >
368
+ ${he.component}
369
+ </div>
370
+ `)}
371
+ </div>
372
+ </div>
373
+ `})}
361
374
  </div>
362
375
  </div>
363
376
  `},scroller:!0})}
@@ -377,7 +390,7 @@ Registered bindings:`,re.forEach(function(ne){var oe="Object";ne.implementationT
377
390
  </div>
378
391
  </div>
379
392
  </div>
380
- `:D$1,renderProfessionalValues=(X,W)=>{const J=shouldShowRole(W),te=[X.highlighted(W.professional.name),J?X.highlighted(W.professional.role.description):null,X.highlighted(W.center.description),X.highlighted(W.professional.speciality.description)].filter(Boolean);return te.map((ne,oe)=>ke$1`${ne}${oe<te.length-1?" | ":""}`)},diagnosticHeaderTemplate=X=>X&&ke$1`
393
+ `:D$1,renderProfessionalValues=(X,W)=>{const J=shouldShowRole(W),te=[X.highlighted(W.professional.name),J?X.highlighted(W.professional.role.description):null,X.highlighted(W.up.description)??X.highlighted(W.center.description),X.highlighted(W.professional.speciality.description),X.highlighted(W.service.description)].filter(Boolean);return te.map((ne,oe)=>ke$1`${ne}${oe<te.length-1?" | ":""}`)},diagnosticHeaderTemplate=X=>X&&ke$1`
381
394
  <div class="diagnostics__header">
382
395
 
383
396
  ${X.diagnostics.filter(W=>W.descripcio!=null&&W.descripcio.trim()!=="").map(W=>{var J;return ke$1`<dss-badge text=${(J=W.descripcio)==null?void 0:J.toUpperCase()} state="info" size="sm" outlined></dss-badge>`})}
@@ -551,7 +564,7 @@ Registered bindings:`,re.forEach(function(ne){var oe="Object";ne.implementationT
551
564
  </div>
552
565
  `;var __defProp$b=Object.defineProperty,__decorateClass$b=(X,W,J,te)=>{for(var re=void 0,ne=X.length-1,oe;ne>=0;ne--)(oe=X[ne])&&(re=oe(W,J,re)||re);return re&&__defProp$b(W,J,re),re};const ji=class ji extends PrimariaRegionHost(h$q){render(){return ke$1`${template$7()}`}firstUpdated(){this._observeMaximizedState()}_observeMaximizedState(){const W=this.renderRoot.querySelector("#content-widgets-region");if(!W)return;new MutationObserver(()=>{const te=W.querySelector("activity-history-main");if(!te)return;const re=te.hasAttribute("maximized")||te.maximized;this._toggleWidgetsVisibility(!re)}).observe(W,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["maximized"]})}_toggleWidgetsVisibility(W){const J=this.renderRoot.querySelector("#widgets-sidebar-region"),te=this.renderRoot.querySelector("#header-widgets-region");J&&(J.style.display=W?"":"none"),te&&(te.style.display=W?"":"none")}};ji.styles=i$B`
553
566
  ${r$H(styles$6)}
554
- `;let ClinicalMonitoring=ji;__decorateClass$b([s$x({targetId:"widgets-sidebar-region",name:clinicalMonitoringRegions.sidebar})],ClinicalMonitoring.prototype,"sidebarRegion"),__decorateClass$b([s$x({targetId:"header-widgets-region",name:clinicalMonitoringRegions.header})],ClinicalMonitoring.prototype,"headerRegion"),__decorateClass$b([s$x({targetId:"content-widgets-region",name:clinicalMonitoringRegions.content})],ClinicalMonitoring.prototype,"contentRegion");const useClinicalMonitoring=X=>{t$i("clinical-monitoring")(ClinicalMonitoring),X.regionManager.registerMainView({id:clinicalMonitoringId,factory:()=>{const W=new ClinicalMonitoring;return Promise.resolve(W)},isDefault:!0}),X.regionManager.registerView(shellRegions.navigationMenu,{id:clinicalMonitoringId,factory:()=>{const W=new PrimariaNavItem({icon:"account_box",label:"Seguiment clínic",callbackFn:()=>{X.regionManager.activateMainView(clinicalMonitoringId),X.broker.publish(shellEvents.openClinicalMonitoringRequested)}});return Promise.resolve(W)},sortHint:"0020"})},disposeClinicalMonitoring=X=>{X.regionManager.removeView(shellRegions.main,clinicalMonitoringId)};var __defProp$a=Object.defineProperty,__getOwnPropDesc$2=Object.getOwnPropertyDescriptor,__decorateClass$a=(X,W,J,te)=>{for(var re=te>1?void 0:te?__getOwnPropDesc$2(W,J):W,ne=X.length-1,oe;ne>=0;ne--)(oe=X[ne])&&(re=(te?oe(W,J,re):oe(re))||re);return te&&re&&__defProp$a(W,J,re),re},__decorateParam$1=(X,W)=>(J,te)=>W(J,te,X);let GetVisitIdHandler=class{constructor(X){this.api=X}async handle(X){try{const W=await this.getVisitId();return console.log("Visit ID obtenido: ",W),W}catch(W){this.api.notificationService.error(W.message);return}}getVisitId(){const X=new URLSearchParams(window.location.search);console.log("Paràmetres de la URL: ",window.location.search);const W=X.get("visit_id");return Promise.resolve(W||void 0)}};GetVisitIdHandler=__decorateClass$a([__decorateParam$1(0,inject(TYPES$1.primaryApi))],GetVisitIdHandler);class GetVisitId{}let request$1;const useGetVisitId=X=>{disposeGetVisitId(),request$1=registerRequest(X,container$1)(GetVisitId,GetVisitIdHandler)},disposeGetVisitId=()=>{request$1==null||request$1.dispose()};var __defProp$9=Object.defineProperty,__getOwnPropDesc$1=Object.getOwnPropertyDescriptor,__decorateClass$9=(X,W,J,te)=>{for(var re=te>1?void 0:te?__getOwnPropDesc$1(W,J):W,ne=X.length-1,oe;ne>=0;ne--)(oe=X[ne])&&(re=(te?oe(W,J,re):oe(re))||re);return te&&re&&__defProp$9(W,J,re),re},__decorateParam=(X,W)=>(J,te)=>W(J,te,X);let FinalizeVisitHandler=class{constructor(X){this.api=X}async handle(X){try{const W=X.visitId;this.api.ecapEventManager.publish("RESOL_VISITA","",{visitId:W})}catch(W){this.api.notificationService.error(W.message)}}};FinalizeVisitHandler=__decorateClass$9([__decorateParam(0,inject(TYPES$1.primaryApi))],FinalizeVisitHandler);class FinalizeVisit{constructor(W){this.visitId=W}}let request;const useFinalizeVisit=X=>{disposeFinalizeVisit(),request=registerRequest(X,container$1)(FinalizeVisit,FinalizeVisitHandler)},disposeFinalizeVisit=()=>{request==null||request.dispose()},useFeatures=X=>{container$1.bind(TYPES$1.primaryApi).toConstantValue(X),useGetUserInfo(X),useExitShell(X),useGetVisitId(X),useFinalizeVisit(X),useClinicalMonitoring(X),X.broker.send(new GetUserInfo)},disposeFeatures=X=>{disposeGetUserInfo(),disposeExitShell(),disposeGetVisitId(),disposeFinalizeVisit(),disposeClinicalMonitoring(X),container$1.unbindAll(),X.regionManager._destroy(),mediatorSettings.resolver.clear()},disposeShell=()=>{disposeFeatures(shellApi)},raiseCloseEvent=()=>{shellApi.ecapEventManager.publish("CLOSE_FORM","",{})},raiseCustomCloseEvent=X=>{shellApi.ecapEventManager.publish(X,"",{})};var shellViews=(X=>(X.shell="primaria-shell",X.error="primaria-error-view",X))(shellViews||{});const styles$5=":host{width:100%;overflow:hidden}#main-switcher{display:inherit}.container{width:100%;height:100%;display:flex;flex-direction:column;background:#fff}.main-container{min-height:1px;height:100%;display:flex}.main-container .sidebar{padding-inline:16px;display:flex;flex-direction:column;justify-content:space-between;align-items:center;background:var(--color-primary-700);width:40px;height:100%;color:#fff}.main-container .sidebar .quick-actions-content{padding-top:24px;padding-bottom:22px;border-radius:8px}.main-container .sidebar .quick-actions-content .create-button-icon-badge{position:relative}.main-container .sidebar .quick-actions-content .create-button-icon-badge dss-notification-badge{position:absolute;top:-7px;right:-6px;z-index:1}.main-container .sidebar .quick-actions-content .create-button-icon-badge dss-icon{position:relative}.main-container .sidebar .icon{margin-left:8px}.main-container .sidebar #menu-region-container{padding-top:24px;min-height:1px;height:100%;width:100%;display:flex;flex-direction:column;gap:4px}.main-container .sidebar .bottom-content{display:flex;flex-direction:column;gap:24px;width:100%}.main-container .sidebar .bottom-content .bottom-content-first{display:flex;flex-direction:column;gap:4px}.main-container .sidebar #quick-actions-region-container{width:100%}.main-container .sidebar[expanded]{width:252px;align-items:flex-start}.main-container .sidebar .create-button-closed{cursor:pointer;background-color:#f0f0f0;color:var(--color-primary-700);border-radius:8px;width:40px;height:40px;display:flex;flex-direction:row;align-items:center;justify-content:center;transition:background-color .3s ease}.main-container .sidebar .create-button-closed:hover{background-color:var(--color-primary-900);color:#fff}.main-container .sidebar .create-button-opened{padding:1px;cursor:pointer;background-color:#f0f0f0;color:var(--color-primary-700);border-radius:8px;gap:8px;font-weight:600;width:220px;height:40px;display:flex;flex-direction:row;align-items:center;transition:background-color .3s ease}.main-container .sidebar .create-button-opened:hover{background-color:var(--color-primary-900);color:#fff}.main-container .content{display:flex;height:100%;width:100%}.main-container #main-region-container{min-height:1px;height:100%;flex:1}.main-container #floating-region-container{position:fixed;z-index:300}.footer{display:flex;height:48px;padding:12px 24px}.footer .footer-logo{align-self:center;display:flex;gap:16px}.divider-opened{width:220px}.divider-closed{width:40px}.toggle-button{margin-bottom:24px}";let t$e="";function f$j(){return t$e}function s$q(X,W){const J=f$j(),te=`${X}${J}`;customElements.define(te,W)}const e$I="*,*:before,*:after{box-sizing:border-box}*{margin:0;padding:0;font-family:var(--font-family)}ul,ol{list-style:none}",o$J={type:Boolean,converter:{fromAttribute:X=>X!==null&&X!=="false",toAttribute:X=>X?"true":null}},n$t={type:Array,converter:{fromAttribute:X=>{if(!X)return[];const W=JSON.parse(X);return Array.isArray(W)?W.map(J=>J.toString()):[W.toString()]},toAttribute:X=>JSON.stringify(X)}},i$x=':host{display:flex;align-items:center}.dss-icon,.material-symbols-rounded{font-family:var(--font-icons);font-size:var(--icon-size-md);font-weight:400;font-style:normal;display:inline-block;line-height:1;text-transform:none;letter-spacing:normal;word-wrap:normal;white-space:nowrap;direction:ltr;-webkit-font-feature-settings:"liga";-webkit-font-smoothing:antialiased;font-variation-settings:"FILL" 0,"wght" 400,"GRAD" 0,"opsz" 24}.dss-icon--fill,.material-symbols-rounded--fill{font-variation-settings:"FILL" 1}.dss-icon--sm{font-size:var(--icon-size-sm)}.dss-icon--md{font-size:var(--icon-size-md)}.dss-icon--lg{font-size:var(--icon-size-lg)}.dss-icon--xl{font-size:var(--icon-size-xl)}.dss-icon-ghost{display:inline-block;height:var(--icon-size-md);width:var(--icon-size-md);overflow:hidden;background-color:transparent}.dss-icon-ghost--sm{height:var(--icon-size-sm);width:var(--icon-size-sm);border-radius:var(--dss-radius-xs)}.dss-icon-ghost--lg{height:var(--icon-size-lg);width:var(--icon-size-lg)}.dss-icon-ghost--xl{height:var(--icon-size-xl);width:var(--icon-size-xl)}',d$o=X=>ke$1`
567
+ `;let ClinicalMonitoring=ji;__decorateClass$b([s$x({targetId:"widgets-sidebar-region",name:clinicalMonitoringRegions.sidebar})],ClinicalMonitoring.prototype,"sidebarRegion"),__decorateClass$b([s$x({targetId:"header-widgets-region",name:clinicalMonitoringRegions.header})],ClinicalMonitoring.prototype,"headerRegion"),__decorateClass$b([s$x({targetId:"content-widgets-region",name:clinicalMonitoringRegions.content})],ClinicalMonitoring.prototype,"contentRegion");const useClinicalMonitoring=X=>{t$i("clinical-monitoring")(ClinicalMonitoring),X.regionManager.registerMainView({id:clinicalMonitoringId,factory:()=>{const W=new ClinicalMonitoring;return Promise.resolve(W)},isDefault:!0}),X.regionManager.registerView(shellRegions.navigationMenu,{id:clinicalMonitoringId,factory:()=>{const W=new PrimariaNavItem({icon:"account_box",label:"Seguiment clínic",callbackFn:()=>{X.regionManager.activateMainView(clinicalMonitoringId),X.broker.publish(shellEvents.openClinicalMonitoringRequested)}});return Promise.resolve(W)},sortHint:"0020"})},disposeClinicalMonitoring=X=>{X.regionManager.removeView(shellRegions.main,clinicalMonitoringId)};var __defProp$a=Object.defineProperty,__getOwnPropDesc$2=Object.getOwnPropertyDescriptor,__decorateClass$a=(X,W,J,te)=>{for(var re=te>1?void 0:te?__getOwnPropDesc$2(W,J):W,ne=X.length-1,oe;ne>=0;ne--)(oe=X[ne])&&(re=(te?oe(W,J,re):oe(re))||re);return te&&re&&__defProp$a(W,J,re),re},__decorateParam$1=(X,W)=>(J,te)=>W(J,te,X);let GetVisitIdHandler=class{constructor(X){this.api=X}async handle(X){try{const W=await this.getVisitId();return console.log("Visit ID obtenido: ",W),W}catch(W){this.api.notificationService.error(W.message);return}}getVisitId(){const X=new URLSearchParams(window.location.search);console.log("Paràmetres de la URL: ",window.location.search);const W=X.get("visit_id");return Promise.resolve(W||void 0)}};GetVisitIdHandler=__decorateClass$a([__decorateParam$1(0,inject(TYPES$1.primaryApi))],GetVisitIdHandler);class GetVisitId{}let request$1;const useGetVisitId=X=>{disposeGetVisitId(),request$1=registerRequest(X,container$1)(GetVisitId,GetVisitIdHandler)},disposeGetVisitId=()=>{request$1==null||request$1.dispose()};var __defProp$9=Object.defineProperty,__getOwnPropDesc$1=Object.getOwnPropertyDescriptor,__decorateClass$9=(X,W,J,te)=>{for(var re=te>1?void 0:te?__getOwnPropDesc$1(W,J):W,ne=X.length-1,oe;ne>=0;ne--)(oe=X[ne])&&(re=(te?oe(W,J,re):oe(re))||re);return te&&re&&__defProp$9(W,J,re),re},__decorateParam=(X,W)=>(J,te)=>W(J,te,X);let FinalizeVisitHandler=class{constructor(X){this.api=X}async handle(X){try{const W=X.visitId;this.api.ecapEventManager.publish("RESOL_VISITA","",{visitId:W})}catch(W){this.api.notificationService.error(W.message)}}};FinalizeVisitHandler=__decorateClass$9([__decorateParam(0,inject(TYPES$1.primaryApi))],FinalizeVisitHandler);class FinalizeVisit{constructor(W){this.visitId=W}}let request;const useFinalizeVisit=X=>{disposeFinalizeVisit(),request=registerRequest(X,container$1)(FinalizeVisit,FinalizeVisitHandler)},disposeFinalizeVisit=()=>{request==null||request.dispose()},useFeatures=X=>{container$1.bind(TYPES$1.primaryApi).toConstantValue(X),useGetUserInfo(X),useExitShell(X),useGetVisitId(X),useFinalizeVisit(X),useClinicalMonitoring(X),X.broker.send(new GetUserInfo)},disposeFeatures=X=>{disposeGetUserInfo(),disposeExitShell(),disposeGetVisitId(),disposeFinalizeVisit(),disposeClinicalMonitoring(X),container$1.unbindAll(),X.regionManager._destroy(),mediatorSettings.resolver.clear()},disposeShell=()=>{disposeFeatures(shellApi)},raiseCloseEvent=()=>{shellApi.ecapEventManager.publish("CLOSE_FORM","",{})},raiseCustomCloseEvent=X=>{shellApi.ecapEventManager.publish(X,"",{})};var shellViews=(X=>(X.shell="primaria-shell",X.error="primaria-error-view",X))(shellViews||{});const styles$5=":host{width:100%;overflow:hidden}#main-switcher{display:inherit}.container{width:100%;height:100%;display:flex;flex-direction:column;background:#fff}.main-container{min-height:1px;height:100%;display:flex}.main-container .sidebar{padding-inline:16px;display:flex;flex-direction:column;justify-content:space-between;align-items:center;background:var(--color-primary-700);width:40px;height:100%;color:#fff}.main-container .sidebar .quick-actions-content{padding-top:24px;padding-bottom:22px;border-radius:8px}.main-container .sidebar .quick-actions-content .create-button-icon-badge{position:relative}.main-container .sidebar .quick-actions-content .create-button-icon-badge dss-notification-badge{position:absolute;top:-7px;right:-6px;z-index:1}.main-container .sidebar .quick-actions-content .create-button-icon-badge dss-icon{position:relative}.main-container .sidebar .icon{margin-left:8px}.main-container .sidebar #menu-region-container{padding-top:24px;min-height:1px;height:100%;width:100%;display:flex;flex-direction:column;gap:4px}.main-container .sidebar .bottom-content{display:flex;flex-direction:column;gap:24px;width:100%}.main-container .sidebar .bottom-content .bottom-content-first{display:flex;flex-direction:column;gap:4px}.main-container .sidebar #quick-actions-region-container{width:100%}.main-container .sidebar[expanded]{width:252px;align-items:flex-start}.main-container .sidebar .create-button-closed{cursor:pointer;background-color:#f0f0f0;color:var(--color-primary-700);border-radius:8px;width:40px;height:40px;display:flex;flex-direction:row;align-items:center;justify-content:center;transition:background-color .3s ease}.main-container .sidebar .create-button-closed:hover{background-color:var(--color-primary-900);color:#fff}.main-container .sidebar .create-button-opened{cursor:pointer;background-color:#f0f0f0;color:var(--color-primary-700);border-radius:8px;gap:8px;font-weight:600;width:220px;height:40px;display:flex;flex-direction:row;align-items:center;transition:background-color .3s ease}.main-container .sidebar .create-button-opened:hover{background-color:var(--color-primary-900);color:#fff}.main-container .content{display:flex;height:100%;width:100%}.main-container #main-region-container{min-height:1px;height:100%;flex:1}.main-container #floating-region-container{position:fixed;z-index:300}.footer{display:flex;height:48px;padding:12px 24px}.footer .footer-logo{align-self:center;display:flex;gap:16px}.divider-opened{width:220px}.divider-closed{width:40px}.toggle-button{margin-bottom:24px}";let t$e="";function f$j(){return t$e}function s$q(X,W){const J=f$j(),te=`${X}${J}`;customElements.define(te,W)}const e$I="*,*:before,*:after{box-sizing:border-box}*{margin:0;padding:0;font-family:var(--font-family)}ul,ol{list-style:none}",o$J={type:Boolean,converter:{fromAttribute:X=>X!==null&&X!=="false",toAttribute:X=>X?"true":null}},n$t={type:Array,converter:{fromAttribute:X=>{if(!X)return[];const W=JSON.parse(X);return Array.isArray(W)?W.map(J=>J.toString()):[W.toString()]},toAttribute:X=>JSON.stringify(X)}},i$x=':host{display:flex;align-items:center}.dss-icon,.material-symbols-rounded{font-family:var(--font-icons);font-size:var(--icon-size-md);font-weight:400;font-style:normal;display:inline-block;line-height:1;text-transform:none;letter-spacing:normal;word-wrap:normal;white-space:nowrap;direction:ltr;-webkit-font-feature-settings:"liga";-webkit-font-smoothing:antialiased;font-variation-settings:"FILL" 0,"wght" 400,"GRAD" 0,"opsz" 24}.dss-icon--fill,.material-symbols-rounded--fill{font-variation-settings:"FILL" 1}.dss-icon--sm{font-size:var(--icon-size-sm)}.dss-icon--md{font-size:var(--icon-size-md)}.dss-icon--lg{font-size:var(--icon-size-lg)}.dss-icon--xl{font-size:var(--icon-size-xl)}.dss-icon-ghost{display:inline-block;height:var(--icon-size-md);width:var(--icon-size-md);overflow:hidden;background-color:transparent}.dss-icon-ghost--sm{height:var(--icon-size-sm);width:var(--icon-size-sm);border-radius:var(--dss-radius-xs)}.dss-icon-ghost--lg{height:var(--icon-size-lg);width:var(--icon-size-lg)}.dss-icon-ghost--xl{height:var(--icon-size-xl);width:var(--icon-size-xl)}',d$o=X=>ke$1`
555
568
 
556
569
  ${X.fontLoaded?ke$1`
557
570
  <i