@wkly/datetime-picker 11.0.0 → 11.1.0
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.
- package/README.md +8 -4
- package/bundles/wkly-datetime-picker.umd.js +18 -13
- package/bundles/wkly-datetime-picker.umd.js.map +1 -1
- package/bundles/wkly-datetime-picker.umd.min.js +1 -1
- package/bundles/wkly-datetime-picker.umd.min.js.map +1 -1
- package/esm2015/field.component.css.shim.ngstyle.js +1 -1
- package/esm2015/field.component.js +1 -1
- package/esm2015/picker.component.js +18 -13
- package/fesm2015/wkly-datetime-picker.js +18 -13
- package/fesm2015/wkly-datetime-picker.js.map +1 -1
- package/package.json +23 -5
- package/picker.component.d.ts +1 -0
- package/wkly-datetime-picker.metadata.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@angular/forms"),require("@wkly/core"),require("@wkly/adapters"),require("@wkly/presentation")):"function"==typeof define&&define.amd?define("@wkly/datetime-picker",["exports","@angular/core","@angular/common","@angular/forms","@wkly/core","@wkly/adapters","@wkly/presentation"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wkly=e.wkly||{},e.wkly["datetime-picker"]={}),e.ng.core,e.ng.common,e.ng.forms,e.core,e.adapters,e.presentation)}(this,(function(e,t,i,n,r,o,s){"use strict";var a=function(e,t){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])})(e,t)};function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}Object.create;function c(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],n=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function p(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,r,o=i.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){r={error:e}}finally{try{n&&!n.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return s}Object.create;"function"==typeof SuppressedError&&SuppressedError;var u,h,d,y,f,k,b,v,g,m,P,w,W,I,D,K,O,C,x,S,T,M,E,j,L,V,R,A,z,H,N,F,_,B,Y=this&&this.__decorate||function(e,t,i,n){var r,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,i,s):r(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s},U=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},$=new t.InjectionToken("WKLY_CLOCK",{providedIn:"root",factory:function(){return{now:function(){return new Date}}}}),q=new t.InjectionToken("WKLY_CONFIG",{providedIn:"root",factory:function(){return{}}}),G=new t.InjectionToken("WKLY_LOCALIZATION",{providedIn:"root",factory:function(){return{}}}),J=new t.InjectionToken("WKLY_TRANSLATIONS",{providedIn:"root",factory:function(){return{}}}),Z=function(){this[u]="datetime",this[h]=null,this[y]="",this[f]=null,this[k]={kind:"full-month"},this[b]="locale",this[v]=!1,this[g]=1,this[m]=1,this[P]=null,this[w]=null,this[W]=null,this[I]=null,this[D]=null,this[K]=!1,this[O]=!1,this[C]=!1,this[x]="locale",this[S]=null,this[T]=256,this[M]=s.DEFAULT_OVERSCAN_WEEKS,this[E]=null,this[j]=null,this[L]=null,this[V]=!0,this[R]=[],this[A]=null,this[z]=new t.EventEmitter,this[H]=new t.EventEmitter(!0),this[N]=new t.EventEmitter,this[F]=new t.EventEmitter,this[_]=new t.EventEmitter(!0),this[B]=new t.EventEmitter};u=s.WklyPickerInputsPropertyKeys.Mode,h=s.WklyPickerInputsPropertyKeys.Value,d=s.WklyPickerInputsPropertyKeys.CalendarAdapter,y=s.WklyPickerInputsPropertyKeys.Locale,f=s.WklyPickerInputsPropertyKeys.WeekOffset,k=s.WklyPickerInputsPropertyKeys.ViewportPreset,b=s.WklyPickerInputsPropertyKeys.HourCycle,v=s.WklyPickerInputsPropertyKeys.ShowSeconds,g=s.WklyPickerInputsPropertyKeys.MinuteStep,m=s.WklyPickerInputsPropertyKeys.SecondStep,P=s.WklyPickerInputsPropertyKeys.Min,w=s.WklyPickerInputsPropertyKeys.Max,W=s.WklyPickerInputsPropertyKeys.IsDateDisabled,I=s.WklyPickerInputsPropertyKeys.IsTimeDisabled,D=s.WklyPickerInputsPropertyKeys.RangeValidator,K=s.WklyPickerInputsPropertyKeys.AllowRangeAcrossDisabled,O=s.WklyPickerInputsPropertyKeys.Required,C=s.WklyPickerInputsPropertyKeys.Disabled,x=s.WklyPickerInputsPropertyKeys.WeekLabelMode,S=s.WklyPickerInputsPropertyKeys.WeekLabelFormatter,T=s.WklyPickerInputsPropertyKeys.WeekCacheSize,M=s.WklyPickerInputsPropertyKeys.OverscanWeeks,E=s.WklyPickerInputsPropertyKeys.AriaLabel,j=s.WklyPickerInputsPropertyKeys.AriaDescribedBy,L=s.WklyPickerInputsPropertyKeys.InitialEpochDay,V=s.WklyPickerInputsPropertyKeys.CloseOnBackdrop,R=s.WklyPickerInputsPropertyKeys.Validators,A=s.WklyPickerInputsPropertyKeys.Translations,z=s.WklyPickerOutputsPropertyKeys.ValueChange,H=s.WklyPickerOutputsPropertyKeys.ValidationChange,N=s.WklyPickerOutputsPropertyKeys.Opened,F=s.WklyPickerOutputsPropertyKeys.Closed,_=s.WklyPickerOutputsPropertyKeys.ViewportChange,B=s.WklyPickerOutputsPropertyKeys.ViewModeChange,Z.decorators=[{type:t.Directive,args:[{inputs:["mode","value","calendarAdapter","locale","weekOffset","viewportPreset","hourCycle","showSeconds","minuteStep","secondStep","min","max","isDateDisabled","isTimeDisabled","rangeValidator","allowRangeAcrossDisabled","required","disabled","weekLabelMode","weekLabelFormatter","weekCacheSize","overscanWeeks","ariaLabel","ariaDescribedBy","initialEpochDay","closeOnBackdrop","validators","translations"],outputs:["valueChange","validationChange","opened","closed","viewportChange","viewModeChange"]}]}],Y([t.Input(),U("design:type",String)],Z.prototype,u,void 0),Y([t.Input(),U("design:type",Object)],Z.prototype,h,void 0),Y([t.Input(),U("design:type",Object)],Z.prototype,d,void 0),Y([t.Input(),U("design:type",String)],Z.prototype,y,void 0),Y([t.Input(),U("design:type",Object)],Z.prototype,f,void 0),Y([t.Input(),U("design:type",Object)],Z.prototype,k,void 0),Y([t.Input(),U("design:type",String)],Z.prototype,b,void 0),Y([t.Input(),U("design:type",Boolean)],Z.prototype,v,void 0),Y([t.Input(),U("design:type",Number)],Z.prototype,g,void 0),Y([t.Input(),U("design:type",Number)],Z.prototype,m,void 0),Y([t.Input(),U("design:type",Object)],Z.prototype,P,void 0),Y([t.Input(),U("design:type",Object)],Z.prototype,w,void 0),Y([t.Input(),U("design:type",Object)],Z.prototype,W,void 0),Y([t.Input(),U("design:type",Object)],Z.prototype,I,void 0),Y([t.Input(),U("design:type",Object)],Z.prototype,D,void 0),Y([t.Input(),U("design:type",Object)],Z.prototype,K,void 0),Y([t.Input(),U("design:type",Object)],Z.prototype,O,void 0),Y([t.Input(),U("design:type",Object)],Z.prototype,C,void 0),Y([t.Input(),U("design:type",String)],Z.prototype,x,void 0),Y([t.Input(),U("design:type",Object)],Z.prototype,S,void 0),Y([t.Input(),U("design:type",Object)],Z.prototype,T,void 0),Y([t.Input(),U("design:type",Object)],Z.prototype,M,void 0),Y([t.Input(),U("design:type",Object)],Z.prototype,E,void 0),Y([t.Input(),U("design:type",Object)],Z.prototype,j,void 0),Y([t.Input(),U("design:type",Object)],Z.prototype,L,void 0),Y([t.Input(),U("design:type",Object)],Z.prototype,V,void 0),Y([t.Input(),U("design:type",Array)],Z.prototype,R,void 0),Y([t.Input(),U("design:type",Object)],Z.prototype,A,void 0),Y([t.Output(),U("design:type",Object)],Z.prototype,z,void 0),Y([t.Output(),U("design:type",Object)],Z.prototype,H,void 0),Y([t.Output(),U("design:type",Object)],Z.prototype,N,void 0),Y([t.Output(),U("design:type",Object)],Z.prototype,F,void 0),Y([t.Output(),U("design:type",Object)],Z.prototype,_,void 0),Y([t.Output(),U("design:type",Object)],Z.prototype,B,void 0);var X=function(e){function t(t,n,r,o,a,l,c,p){var u=e.call(this)||this;return u.defaultLocale=t,u.defaults=n,u.clock=r,u.strings=o,u.defaultTranslations=a,u.host=c,u.changeDetector=p,u.presentation="inline",u.viewMode="calendar",u.endView="date",u.effectiveLocale="en-US",u.effectiveOffset=0,u.effectiveHourCycle="h24",u.direction="ltr",u.rows=[],u.weekdays=[],u.drafts=[],u.errors=[],u.today=0,u.focused=0,u.anchorWeek=0,u.firstWeek=0,u.visibleCount=6,u.rowHeight=76,u.scrollHeight=152076,u.paddingTop=0,u.initialized=!1,u.compact=!1,u.WklyPickerInputsPropertyKeys=s.WklyPickerInputsPropertyKeys,u.baseWeek=0,u.firstSupportedDay=0,u.lastSupportedDay=0,u.firstSupportedWeek=0,u.lastSupportedWeek=0,u.initialMonth="",u.clipMonth=!1,u.browser=!1,u.destroyed=!1,u.snapPending=!1,u.onChange=function(){},u.onTouched=function(){},u.validatorChanged=function(){},u.configErrors=[],u.pendingValue=null,u.emittedValue=null,u.manualDateEndpoint=0,u.browser=i.isPlatformBrowser(l),u}return l(t,e),t.prototype.ngOnInit=function(){this.initialize()},t.prototype.ngOnChanges=function(e){if(this.initialized){if(1===Object.keys(e).length&&e[s.WklyPickerInputsPropertyKeys.Value]&&this.emittedValue===JSON.stringify(this[s.WklyPickerInputsPropertyKeys.Value]))return void(this.emittedValue=null);var t=this.focused;this.configure(),e[s.WklyPickerInputsPropertyKeys.Value]||e[s.WklyPickerInputsPropertyKeys.Mode]||e[s.WklyPickerInputsPropertyKeys.CalendarAdapter]?(this.load(this[s.WklyPickerInputsPropertyKeys.Value]),this.position(this.focused,!0)):(this.check(),e[s.WklyPickerInputsPropertyKeys.ViewportPreset]?this.position(t,!0):this.scrollToEpochDay(t))}},t.prototype.initialize=function(){if(!this.initialized){this.configure();var e=this[s.WklyPickerInputsPropertyKeys.InitialEpochDay];this.today=this.browser?Math.floor(this.clock.now().getTime()/864e5):null===e?0:e,this.focused=null===e?void 0===this.defaults.initialEpochDay?this.today:this.defaults.initialEpochDay:e,this.load(this[s.WklyPickerInputsPropertyKeys.Value]),this.initialized=!0,this.position(this.focused,!0)}},t.prototype.configure=function(){var e,t,n=this;this.configErrors=[],[s.WklyPickerInputsPropertyKeys.ShowSeconds,s.WklyPickerInputsPropertyKeys.AllowRangeAcrossDisabled,s.WklyPickerInputsPropertyKeys.Required,s.WklyPickerInputsPropertyKeys.Disabled,s.WklyPickerInputsPropertyKeys.CloseOnBackdrop].forEach((function(e){return n[e]=s.coerceBoolean(n[e])})),this.effectiveLocale=this[s.WklyPickerInputsPropertyKeys.Locale]||this.defaults.locale||this.defaultLocale,this.direction=/^(ar|he|fa|ur)(-|$)/.test(this.effectiveLocale)?"rtl":"ltr",this.adapter=this[s.WklyPickerInputsPropertyKeys.CalendarAdapter]||new o.WklyGregorianCalendarAdapter(this.effectiveLocale);try{var a=void 0;try{a=i.getLocaleFirstDayOfWeek(this.effectiveLocale)}catch(e){}if(this.effectiveOffset=o.resolveWeekOffset(this.effectiveLocale,this[s.WklyPickerInputsPropertyKeys.WeekOffset],this.defaults.weekOffset,a),r.integer(this[s.WklyPickerInputsPropertyKeys.WeekCacheSize]),r.integer(this[s.WklyPickerInputsPropertyKeys.OverscanWeeks]),this[s.WklyPickerInputsPropertyKeys.WeekCacheSize]<0||this[s.WklyPickerInputsPropertyKeys.OverscanWeeks]<0||this[s.WklyPickerInputsPropertyKeys.OverscanWeeks]>50)throw new RangeError;if(!["datetime","date","time","datetime-range","date-range","time-range"].includes(this[s.WklyPickerInputsPropertyKeys.Mode]))throw new RangeError;var l=this[s.WklyPickerInputsPropertyKeys.ViewportPreset];if("weeks"===l.kind&&(r.integer(l.visibleWeekCount),l.visibleWeekCount<1||l.visibleWeekCount>52))throw new RangeError;if("full-month-and-around"===l.kind)try{for(var p=c([l.extraWeeksBefore||0,l.extraWeeksAfter||0]),u=p.next();!u.done;u=p.next()){var h=u.value;if(r.integer(h),h<0||h>52)throw new RangeError}}catch(t){e={error:t}}finally{try{u&&!u.done&&(t=p.return)&&t.call(p)}finally{if(e)throw e.error}}this.generator=r.createWeekGenerator({weekOffset:this.effectiveOffset,cacheSize:this[s.WklyPickerInputsPropertyKeys.WeekCacheSize]})}catch(e){this.configErrors.push(o.error("configuration-error",this[s.WklyPickerInputsPropertyKeys.WeekOffset])),this.generator=r.createWeekGenerator(),this.effectiveOffset=0}this.setSupportedScrollRange(),this.effectiveHourCycle="h12"===this[s.WklyPickerInputsPropertyKeys.HourCycle]||"locale"===this[s.WklyPickerInputsPropertyKeys.HourCycle]&&new Intl.DateTimeFormat(this.effectiveLocale,{hour:"numeric",timeZone:"UTC"}).resolvedOptions().hour12?"h12":"h24",this.weekdays=Array.from({length:7},(function(e,t){return n.adapter.formatWeekday(n.effectiveOffset+t,"short")}))},t.prototype.setSupportedScrollRange=function(){var e=this,t=p(this.adapter.supportedEpochDayRange,2),i=t[0],n=t[1],o=p(this.adapter.supportedYearRange,2),s=o[0],a=o[1],l=function(t){return e.adapter.epochDayToDate(t).year};if(l(i)<s){for(var c=i,u=n;c<u;){l(h=Math.floor((c+u)/2))<s?c=h+1:u=h}i=c}if(l(n)>a){for(c=i,u=n;c<u;){var h;l(h=Math.ceil((c+u)/2))>a?u=h-1:c=h}n=c}if(i>n||l(i)<s||l(i)>a||l(n)<s||l(n)>a)throw new RangeError("No supported days within the calendar year range");this.firstSupportedDay=i,this.lastSupportedDay=n,this.firstSupportedWeek=r.absoluteWeekOf(i,this.effectiveOffset),this.lastSupportedWeek=r.absoluteWeekOf(n,this.effectiveOffset)},t.prototype.clampFirstWeek=function(e){var t=Math.max(this.firstSupportedWeek,this.lastSupportedWeek-this.visibleCount+1);return Math.max(this.firstSupportedWeek,Math.min(t,e))},t.prototype.ngAfterViewInit=function(){var e=this;this.resetScroll(),this.browser&&"undefined"!=typeof ResizeObserver&&(this.observer=new ResizeObserver((function(){e.compact=e.host.nativeElement.clientWidth<338;var t=e.host.nativeElement.querySelector(".week-row"),i=t?parseFloat(getComputedStyle(t).height):0;i&&i!==e.rowHeight&&(e.rowHeight=i,e.scrollHeight=2001*e.rowHeight,e.renderRows(),e.resetScroll())})),this.observer.observe(this.host.nativeElement))},t.prototype.ngOnDestroy=function(){this.destroyed=!0,this.observer&&this.observer.disconnect(),this.scrollEndTimer&&clearTimeout(this.scrollEndTimer),this.generator&&this.generator.clearCache()},t.prototype.t=function(e){return s.resolveWklyTranslation(e,this.effectiveLocale,this[s.WklyPickerInputsPropertyKeys.Translations]||this.defaultTranslations,this.strings)},Object.defineProperty(t.prototype,"isRange",{get:function(){return this[s.WklyPickerInputsPropertyKeys.Mode].endsWith("-range")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasDate",{get:function(){return!this[s.WklyPickerInputsPropertyKeys.Mode].startsWith("time")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasTime",{get:function(){return"date"!==this[s.WklyPickerInputsPropertyKeys.Mode]&&"date-range"!==this[s.WklyPickerInputsPropertyKeys.Mode]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"submitVisible",{get:function(){return"transient"===this.presentation&&("date"!==this[s.WklyPickerInputsPropertyKeys.Mode]||"manual"===this.viewMode)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"title",{get:function(){try{var e=this.adapter.epochDayToDate(Math.max(this.firstSupportedDay,Math.min(this.lastSupportedDay,r.firstEpochDayOf(this.anchorWeek,this.effectiveOffset))));return this.adapter.formatMonth(e)+" "+this.adapter.formatYear(e)}catch(e){return""}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canSubmit",{get:function(){return!this[s.WklyPickerInputsPropertyKeys.Disabled]&&!this.errors.length&&null!==this.pendingValue},enumerable:!1,configurable:!0}),t.prototype.blank=function(e){var t=Math.max(this.firstSupportedDay,Math.min(this.lastSupportedDay,e));return{date:this.adapter.epochDayToDate(t),hour:0,minute:0,second:0,present:!1}},t.prototype.load=function(e){var t=this;this.drafts=[this.blank(this.focused),this.blank(this.focused)];var i=o.validateSelection(e,this,this.adapter);null===e||i.length||("string"==typeof e?[e]:e).forEach((function(e,i){var n=o.decodeIso(e);t.drafts[i]={date:t.hasDate?t.adapter.epochDayToDate(n.epochDay):t.blank(t.today).date,hour:n.hour,minute:n.minute,second:n.second,present:!0},0===i&&t.hasDate&&(t.focused=n.epochDay)}));i.length?(this.pendingValue=null,this.report(i)):this.check()},t.prototype.writeValue=function(e){this[s.WklyPickerInputsPropertyKeys.Value]=e,this.initialized&&(this.load(e),this.position(this.focused,!0))},t.prototype.registerOnChange=function(e){this.onChange=e},t.prototype.registerOnTouched=function(e){this.onTouched=e},t.prototype.setDisabledState=function(e){this[s.WklyPickerInputsPropertyKeys.Disabled]=e},t.prototype.validate=function(e){return this.errors.length?{wkly:this.errors}:null},t.prototype.registerOnValidatorChange=function(e){this.validatorChanged=e},t.prototype.touched=function(){var e=this;Promise.resolve().then((function(){return e.onTouched()}))},t.prototype.report=function(e){var t=JSON.stringify(this.errors)!==JSON.stringify(e);this.errors=e,t&&(this[s.WklyPickerOutputsPropertyKeys.ValidationChange].emit(e),this.validatorChanged())},t.prototype.check=function(){var e=s.validateDrafts({drafts:this.drafts,configErrors:this.configErrors,adapter:this.adapter,selection:this,mode:this[s.WklyPickerInputsPropertyKeys.Mode],isRange:this.isRange,hasDate:this.hasDate,hasTime:this.hasTime,showSeconds:this[s.WklyPickerInputsPropertyKeys.ShowSeconds],required:this[s.WklyPickerInputsPropertyKeys.Required]});this.pendingValue=e.pendingValue,this.report(e.errors)},t.prototype.trackDraft=function(e){return e},t.prototype.orderDrafts=function(){var e=this;if(this.isRange&&this.drafts.every((function(e){return e.present}))&&!this.drafts.some((function(e){return void 0!==e.unsupportedEpochDay})))try{var t=this.drafts[0],i=this.drafts[1],n=function(t){return 86400*e.adapter.dateToEpochDay(t.date)+3600*(t.hour||0)+60*(t.minute||0)+(t.second||0)};n(t)>n(i)&&(this.drafts=[i,t])}catch(e){}},t.prototype.finish=function(){this[s.WklyPickerInputsPropertyKeys.Disabled]||(this.orderDrafts(),"manual"===this.viewMode&&this.hasDate&&this.positionOnManualDate(),this.check(),"inline"===this.presentation&&this.canSubmit&&this.commit())},t.prototype.commit=function(){if(this.canSubmit){var e=this.pendingValue;JSON.stringify(e)!==JSON.stringify(this[s.WklyPickerInputsPropertyKeys.Value])&&(this[s.WklyPickerInputsPropertyKeys.Value]=e,this.emittedValue=JSON.stringify(e),this.onChange(e),this[s.WklyPickerOutputsPropertyKeys.ValueChange].emit(e)),this.onTouched()}},t.prototype.submit=function(e){void 0===e&&(e="submit"),this.check(),this.canSubmit&&(this.commit(),"transient"===this.presentation&&this[s.WklyPickerOutputsPropertyKeys.Closed].emit(e))},t.prototype.cancel=function(e){void 0===e&&(e="close-button"),this[s.WklyPickerInputsPropertyKeys.Disabled]||(this.load(this[s.WklyPickerInputsPropertyKeys.Value]),this.onTouched(),this[s.WklyPickerOutputsPropertyKeys.Closed].emit(e))},t.prototype.now=function(){var e=this;if(!this[s.WklyPickerInputsPropertyKeys.Disabled]){var t=this.clock.now(),i=Math.floor(t.getTime()/864e5);this.drafts=[0,1].map((function(n){return Object.assign(Object.assign({},e.clockDraft(i,t)),{present:0===n||e.isRange})})),this.hasDate&&(i<this.firstSupportedDay||i>this.lastSupportedDay)?this.report([o.error("unsupported-adapter-date",i)]):(this.focused=i,this.position(i,!0),this.check(),this.submit("now"))}},t.prototype.clockDraft=function(e,t){return Object.assign(Object.assign({},this.blank(e)),{hour:t.getUTCHours(),minute:Math.floor(t.getUTCMinutes()/this[s.WklyPickerInputsPropertyKeys.MinuteStep])*this[s.WklyPickerInputsPropertyKeys.MinuteStep],second:this[s.WklyPickerInputsPropertyKeys.ShowSeconds]?Math.floor(t.getUTCSeconds()/this[s.WklyPickerInputsPropertyKeys.SecondStep])*this[s.WklyPickerInputsPropertyKeys.SecondStep]:0})},t.prototype.initializeManualRange=function(){if(this.isRange&&this.hasDate&&!this.drafts.every((function(e){return e.present}))){var e=this.drafts.find((function(e){return e.present}));if(!e){if(null!==this[s.WklyPickerInputsPropertyKeys.Value])return;var t=this.clock.now(),i=this[s.WklyPickerInputsPropertyKeys.InitialEpochDay],n=null===i?void 0===this.defaults.initialEpochDay?Math.floor(t.getTime()/864e5):this.defaults.initialEpochDay:i;e=Object.assign(Object.assign({},this.clockDraft(n,t)),{present:!0})}var r=e;this.drafts=this.drafts.map((function(e){return e.present?e:Object.assign(Object.assign({},r),{date:Object.assign({},r.date)})})),this.finish(),this.changeDetector.markForCheck()}},t.prototype.toggleView=function(){var e=this;!this[s.WklyPickerInputsPropertyKeys.Disabled]&&this.hasDate&&(this.viewMode="calendar"===this.viewMode?"manual":"calendar","manual"===this.viewMode&&this.initializeManualRange(),"calendar"===this.viewMode&&this.positionOnManualDate(),this[s.WklyPickerOutputsPropertyKeys.ViewModeChange].emit(this.viewMode),"calendar"===this.viewMode&&setTimeout((function(){return e.resetScroll()})))},t.prototype.positionOnManualDate=function(){var e=this.drafts[this.manualDateEndpoint];if(e&&e.present)try{var t=this.adapter.dateToEpochDay(e.date);this.focused=t,this.position(t,!0)}catch(t){try{var i=this.adapter.dateToEpochDay(Object.assign(Object.assign({},e.date),{day:1}));this.focused=i,this.position(i,!0)}catch(e){}}},t.prototype.months=function(e){try{return this.adapter.getMonths(e.date.year).map((function(e){return e.label}))}catch(e){return[]}},t.prototype.monthCount=function(e){return this.months(e).length||12},Object.defineProperty(t.prototype,"inDays",{get:function(){return s.draftDayDifference(this.drafts,this.adapter)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inDaysLabel",{get:function(){var e=this.inDays;return this.t("inDays").replace(/{{\s*days\s*}}/g,null===e?this.t("daysUnavailable"):new Intl.NumberFormat(this.effectiveLocale,{useGrouping:!1}).format(e))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"resultingEndDate",{get:function(){try{var e=this.drafts[1];return void 0!==e.unsupportedEpochDay||this.adapter.validateDate(e.date).length?"":[this.adapter.formatDay(e.date),this.adapter.formatMonth(e.date),this.adapter.formatYear(e.date)].join(" ")}catch(e){return""}},enumerable:!1,configurable:!0}),t.prototype.toggleEndView=function(e){this[s.WklyPickerInputsPropertyKeys.Disabled]||(this.endView=e)},t.prototype.days=function(e){this[s.WklyPickerInputsPropertyKeys.Disabled]||(this.manualDateEndpoint=1,s.setDraftDayDifference(this.drafts,this.adapter,e),this.check())},t.prototype.field=function(e,t,i){var n;if(!this[s.WklyPickerInputsPropertyKeys.Disabled]){var r=this.drafts[e];if(r.present=!0,"day"===t||"year"===t||"month"===t){this.manualDateEndpoint=e,delete r.unsupportedEpochDay;var o=Object.assign(Object.assign({},r.date),((n={})[t]=i,n));if("month"===t){var a=void 0;try{a=this.adapter.getMonths(o.year).find((function(e){return e.month===i}))}catch(e){}o=Object.assign(Object.assign({},o),{monthCode:a?a.monthCode:""})}if("year"===t&&null!==i)try{(a=this.adapter.getMonths(i).find((function(e){return e.monthCode===o.monthCode})))&&(o=Object.assign(Object.assign({},o),{month:a.month}))}catch(e){}r.date=o}else"hour"===t&&"h12"===this.effectiveHourCycle?r.hour=null===i?null:i>=1&&i<=12?i%12+((r.hour||0)>=12?12:0):24+i:r[t]=i;this.check()}},t.prototype.displayHour=function(e){return null===e.hour?null:"h12"===this.effectiveHourCycle?e.hour%12||12:e.hour},t.prototype.period=function(e,t){this[s.WklyPickerInputsPropertyKeys.Disabled]||("24"===t?this.effectiveHourCycle="h24":(this.effectiveHourCycle="h12",this.drafts[e].hour=(this.drafts[e].hour||0)%12+("pm"===t?12:0),this.drafts[e].present=!0,this.finish()))},t.prototype.selected=function(e){var t=this;return this.drafts.some((function(i){try{return i.present&&t.adapter.dateToEpochDay(i.date)===e}catch(e){return!1}}))},t.prototype.inRange=function(e){if(!this.isRange||!this.drafts.every((function(e){return e.present})))return!1;try{var t=this.adapter.dateToEpochDay(this.drafts[0].date),i=this.adapter.dateToEpochDay(this.drafts[1].date);return e>Math.min(t,i)&&e<Math.max(t,i)}catch(e){return!1}},t.prototype.dayDisabled=function(e){var t,i;if(e<this.firstSupportedDay||e>this.lastSupportedDay)return!0;try{var n=this.adapter.epochDayToDate(e),r=this[s.WklyPickerInputsPropertyKeys.IsDateDisabled];if(r&&r(e,{mode:this[s.WklyPickerInputsPropertyKeys.Mode],endpoint:this.isRange?(null===(t=this.drafts[0])||void 0===t?void 0:t.present)&&!(null===(i=this.drafts[1])||void 0===i?void 0:i.present)?"end":"start":"single",calendarDate:n}))return!0;var a=this[s.WklyPickerInputsPropertyKeys.Min],l=this[s.WklyPickerInputsPropertyKeys.Max];return!!(a&&e<o.decodeIso(a).epochDay)||!!(l&&e>o.decodeIso(l).epochDay)}catch(e){return!0}},t.prototype.select=function(e){if(!this[s.WklyPickerInputsPropertyKeys.Disabled]&&!this.dayDisabled(e)){this.focused=e;var t=this.isRange&&this.drafts[0].present&&!this.drafts[1].present?1:0;this.isRange&&0===t&&(this.drafts[1].present=!1),delete this.drafts[t].unsupportedEpochDay,this.drafts[t].date=this.adapter.epochDayToDate(e),this.drafts[t].present=!0,this.orderDrafts(),this.renderRows(),this.finish(),"transient"===this.presentation&&"date"===this[s.WklyPickerInputsPropertyKeys.Mode]&&"calendar"===this.viewMode&&this.submit("auto-submit")}},t.prototype.key=function(e,t){var i=0;if("ArrowLeft"===e.key&&(i=-1),"ArrowRight"===e.key&&(i=1),"ArrowUp"===e.key&&(i=-7),"ArrowDown"===e.key&&(i=7),"PageUp"===e.key&&(i=-7*(e.shiftKey?this.visibleCount:1)),"PageDown"===e.key&&(i=7*(e.shiftKey?this.visibleCount:1)),"Home"===e.key&&(e.preventDefault(),this.scrollToEpochDay(this.today,{focus:!0})),i){e.preventDefault();var n=t+i;n>=this.firstSupportedDay&&n<=this.lastSupportedDay&&this.scrollToEpochDay(n,{focus:!0})}},t.prototype.position=function(e,t,i){void 0===t&&(t=!1),void 0===i&&(i={}),e=Math.max(this.firstSupportedDay,Math.min(this.lastSupportedDay,e)),this.anchorWeek=r.absoluteWeekOf(e,this.effectiveOffset);var n=this[s.WklyPickerInputsPropertyKeys.ViewportPreset];if(this.clipMonth=t&&"full-month"===n.kind,t&&"weeks"!==n.kind){var o=this.adapter.epochDayToDate(e);this.initialMonth=o.year+"/"+o.monthCode;var a=p(s.calendarMonthBounds(this.adapter,e),2),l=a[0],c=a[1];if(this.firstWeek=r.absoluteWeekOf(l,this.effectiveOffset),this.visibleCount=r.absoluteWeekOf(c,this.effectiveOffset)-this.firstWeek+1,"full-month-and-around"===n.kind&&!this.configErrors.length){var u=n.extraWeeksBefore||0,h=n.extraWeeksAfter||0;this.firstWeek-=u,this.visibleCount+=u+h}}else"weeks"===n.kind&&(this.visibleCount=this.configErrors.length?6:n.visibleWeekCount),this.firstWeek=this.anchorWeek-("start"===i.align?0:"end"===i.align?this.visibleCount-1:Math.floor(this.visibleCount/2));this.firstWeek=this.clampFirstWeek(this.firstWeek),this.baseWeek=this.firstWeek-1e3,this.renderRows(),this.changeDetector.detectChanges(),this.resetScroll()},t.prototype.resetScroll=function(){this.scroller&&(this.scroller.nativeElement.scrollTop=Math.round(1e3*this.rowHeight))},t.prototype.scroll=function(e){var t=e.target;this.snapPending=!0,this.scheduleSnap();var i=t.scrollTop/this.rowHeight-1e3,n=1e3+Math.sign(i)*Math.round(Math.abs(i)),r=this.baseWeek+n,o=this.clampFirstWeek(r);if(r!==o&&(t.scrollTop=Math.round((o-this.baseWeek)*this.rowHeight)),o!==this.firstWeek){if(this.clipMonth=!1,this.firstWeek=o,this.anchorWeek=o+Math.floor(this.visibleCount/2),n<100||n>1900){var s=t.scrollTop-(o-this.baseWeek)*this.rowHeight;this.baseWeek=o-1e3,t.scrollTop=Math.round(1e3*this.rowHeight+s)}this.renderRows()}},t.prototype.scheduleSnap=function(){var e=this;this.scrollEndTimer&&clearTimeout(this.scrollEndTimer),this.scrollEndTimer=setTimeout((function(){return e.snapWeek()}),200)},t.prototype.snapWeek=function(){if(this.scrollEndTimer&&clearTimeout(this.scrollEndTimer),this.scrollEndTimer=void 0,this.snapPending&&this.scroller){this.snapPending=!1;var e=this.scroller.nativeElement,t=Math.round((this.firstWeek-this.baseWeek)*this.rowHeight);e.scrollTop!==t&&(e.scrollTop=t)}},t.prototype.showFirstWeek=function(e){var t=this.clampFirstWeek(e);t!==this.firstWeek&&(this.clipMonth=!1,this.firstWeek=t,this.anchorWeek=t+Math.floor(this.visibleCount/2),this.baseWeek=t-1e3,this.renderRows(),this.resetScroll())},t.prototype.canMoveWeek=function(e){return this.clampFirstWeek(this.firstWeek+e)!==this.firstWeek},t.prototype.moveWeek=function(e){this[s.WklyPickerInputsPropertyKeys.Disabled]||this.showFirstWeek(this.firstWeek+e)},t.prototype.renderRows=function(){var e=this,t=Math.max(0,Math.min(50,this[s.WklyPickerInputsPropertyKeys.OverscanWeeks]||0)),i=this.firstWeek-t;this.paddingTop=(i-this.baseWeek)*this.rowHeight,this.rows=s.createWeekRows({generator:this.generator,adapter:this.adapter,startWeek:i,count:this.visibleCount+2*t,firstVisibleWeek:this.firstWeek,firstSupportedDay:this.firstSupportedDay,lastSupportedDay:this.lastSupportedDay,clipMonth:this.clipMonth,initialMonth:this.initialMonth,weekLabelMode:this[s.WklyPickerInputsPropertyKeys.WeekLabelMode],weekLabelFormatter:this[s.WklyPickerInputsPropertyKeys.WeekLabelFormatter]||null,isDayDisabled:function(t){return e.dayDisabled(t)}}),this[s.WklyPickerOutputsPropertyKeys.ViewportChange].emit({firstVisibleAbsoluteWeek:this.firstWeek,lastVisibleAbsoluteWeek:this.firstWeek+this.visibleCount-1,anchorAbsoluteWeek:this.anchorWeek})},t.prototype.trackCell=function(e,t){return t.epochDay},t.prototype.trackRow=function(e,t){return t.week.absoluteWeek},t.prototype.scrollToEpochDay=function(e,t){void 0===t&&(t={}),r.integer(e),this.adapter.epochDayToDate(e),e=Math.max(this.firstSupportedDay,Math.min(this.lastSupportedDay,e)),t.focus&&(this.focused=e),this.position(e,!1,t),t.select&&this.select(e),t.focus&&this.focusDay()},t.prototype.scrollToAbsoluteWeek=function(e,t){void 0===t&&(t={});var i=r.firstEpochDayOf(e,this.effectiveOffset);this.scrollToEpochDay(e===this.firstSupportedWeek?Math.max(i,this.firstSupportedDay):i,t)},t.prototype.scrollToCalendarDate=function(e,t){void 0===t&&(t={}),this.scrollToEpochDay(this.adapter.dateToEpochDay(e),t)},t.prototype.scrollToValue=function(e,t){void 0===t&&(t={}),this.scrollToEpochDay(o.decodeIso(e).epochDay,t)},t.prototype.focusDay=function(){var e=this;this.browser&&setTimeout((function(){var t;if(!e.destroyed){e.changeDetector.detectChanges();var i=e.host.nativeElement.querySelector('[data-day="'+e.focused+'"]'),n=e.host.nativeElement.querySelector("button:not(:disabled),input:not(:disabled)");null===(t=i||n)||void 0===t||t.focus({preventScroll:!0})}}))},t}(Z);X.decorators=[{type:t.Component,args:[{selector:"wkly-datetime-picker",template:'<section\n class="wkly"\n [attr.dir]="direction"\n [attr.aria-label]="\n this[WklyPickerInputsPropertyKeys.AriaLabel] || \'Date and time picker\'\n "\n [attr.aria-describedby]="this[WklyPickerInputsPropertyKeys.AriaDescribedBy]"\n (focusout)="touched()"\n>\n <header class="toolbar">\n <button\n *ngIf="hasDate"\n type="button"\n [disabled]="this[WklyPickerInputsPropertyKeys.Disabled]"\n [attr.aria-label]="t(viewMode === \'calendar\' ? \'manual\' : \'calendar\')"\n (click)="toggleView()"\n >\n {{ viewMode === "calendar" ? "☷" : "▦" }}\n </button>\n <span *ngIf="hasDate" class="year-control">{{ title }}</span>\n <span class="spacer"></span\n ><button\n type="button"\n class="now"\n [disabled]="this[WklyPickerInputsPropertyKeys.Disabled]"\n (click)="now()"\n >\n {{ t("now") }}\n </button>\n <button\n *ngIf="presentation === \'transient\'"\n type="button"\n [disabled]="this[WklyPickerInputsPropertyKeys.Disabled]"\n [attr.aria-label]="t(\'close\')"\n (click)="cancel()"\n >\n ×\n </button>\n </header>\n <ng-container *ngIf="hasDate && viewMode === \'calendar\'">\n <div\n role="grid"\n [attr.aria-label]="\n this[WklyPickerInputsPropertyKeys.AriaLabel] || \'Calendar\'\n "\n [attr.aria-multiselectable]="isRange"\n >\n <div\n role="row"\n class="week-head"\n [class.no-label]="\n compact ||\n (this[WklyPickerInputsPropertyKeys.WeekLabelMode] === \'hidden\' &&\n !this[WklyPickerInputsPropertyKeys.WeekLabelFormatter])\n "\n >\n <span\n *ngIf="\n !compact &&\n (this[WklyPickerInputsPropertyKeys.WeekLabelMode] !== \'hidden\' ||\n this[WklyPickerInputsPropertyKeys.WeekLabelFormatter])\n "\n role="columnheader"\n aria-label="Week"\n ></span\n ><span *ngFor="let day of weekdays" role="columnheader">{{ day }}</span>\n </div>\n <div\n #scroller\n class="week-scroll"\n [style.height.px]="visibleCount * rowHeight"\n (scroll)="scroll($event)"\n (scrollend)="snapWeek()"\n >\n <div [style.height.px]="scrollHeight" class="scroll-space">\n <div class="rows" [style.top.px]="paddingTop">\n <div\n *ngFor="let row of rows; trackBy: trackRow"\n role="row"\n class="week-row"\n [class.no-label]="\n compact ||\n (this[WklyPickerInputsPropertyKeys.WeekLabelMode] ===\n \'hidden\' &&\n !this[WklyPickerInputsPropertyKeys.WeekLabelFormatter])\n "\n >\n <span\n *ngIf="\n !compact &&\n (this[WklyPickerInputsPropertyKeys.WeekLabelMode] !==\n \'hidden\' ||\n this[WklyPickerInputsPropertyKeys.WeekLabelFormatter])\n "\n role="rowheader"\n class="week-number"\n >{{ row.label }}</span\n >\n <div\n *ngFor="\n let cell of row.cells;\n let dayIndex = index;\n trackBy: trackCell\n "\n role="gridcell"\n [attr.data-weekday-index]="dayIndex"\n [attr.aria-colindex]="\n dayIndex +\n (compact ||\n (this[WklyPickerInputsPropertyKeys.WeekLabelMode] ===\n \'hidden\' &&\n !this[WklyPickerInputsPropertyKeys.WeekLabelFormatter])\n ? 1\n : 2)\n "\n [attr.aria-selected]="selected(cell.epochDay)"\n [attr.aria-disabled]="\n cell.disabled || this[WklyPickerInputsPropertyKeys.Disabled]\n "\n [class.range]="inRange(cell.epochDay)"\n [class.hidden]="cell.hidden"\n [class.odd-month]="cell.date && cell.date.month % 2 === 1"\n >\n <span [class]="\'annotation annotation--\' + dayIndex">{{\n cell.annotation\n }}</span>\n <button\n type="button"\n class="day"\n [attr.data-day]="cell.epochDay"\n [attr.aria-label]="cell.accessible"\n [attr.aria-current]="cell.epochDay === today ? \'date\' : null"\n [attr.aria-disabled]="\n cell.disabled || this[WklyPickerInputsPropertyKeys.Disabled]\n "\n [attr.tabindex]="\n !cell.hidden && cell.epochDay === focused ? 0 : -1\n "\n [class.selected]="selected(cell.epochDay)"\n [class.today]="cell.epochDay === today"\n (focus)="focused = cell.epochDay"\n (click)="select(cell.epochDay)"\n (keydown)="key($event, cell.epochDay)"\n >\n {{ cell.label }}\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class="week-navigation">\n <button\n type="button"\n [disabled]="\n this[WklyPickerInputsPropertyKeys.Disabled] || !canMoveWeek(-1)\n "\n [attr.aria-label]="t(\'previous\')"\n (click)="moveWeek(-1)"\n >\n ↑</button\n ><span>{{ title }}</span\n ><button\n type="button"\n [disabled]="\n this[WklyPickerInputsPropertyKeys.Disabled] || !canMoveWeek(1)\n "\n [attr.aria-label]="t(\'next\')"\n (click)="moveWeek(1)"\n >\n ↓\n </button>\n </div>\n </ng-container>\n <ng-container\n *ngFor="let draft of drafts; let i = index; trackBy: trackDraft"\n >\n <fieldset\n *ngIf="(i === 0 || isRange) && (hasTime || viewMode === \'manual\')"\n [disabled]="this[WklyPickerInputsPropertyKeys.Disabled]"\n [attr.aria-label]="isRange ? t(i === 0 ? \'start\' : \'end\') : null"\n >\n <legend *ngIf="isRange">\n <ng-container\n *ngIf="\n i === 1 && hasDate && viewMode === \'manual\';\n else endpointLabel\n "\n >\n <span class="end-view-toggle">\n <button\n type="button"\n [disabled]="this[WklyPickerInputsPropertyKeys.Disabled]"\n [attr.aria-pressed]="endView === \'date\'"\n (click)="toggleEndView(\'date\')"\n >\n {{ t("end") }}\n </button>\n <button\n type="button"\n [disabled]="this[WklyPickerInputsPropertyKeys.Disabled]"\n [attr.aria-pressed]="endView === \'days\'"\n (click)="toggleEndView(\'days\')"\n >\n {{ inDaysLabel }}\n </button>\n </span>\n </ng-container>\n <ng-template #endpointLabel>{{\n t(i === 0 ? "start" : "end")\n }}</ng-template>\n </legend>\n <div\n *ngIf="\n i === 1 && hasDate && viewMode === \'manual\' && endView === \'days\'\n "\n class="date-fields in-days-fields"\n >\n <span class="resulting-end-date" [attr.aria-label]="t(\'endDate\')">{{\n resultingEndDate\n }}</span>\n <wkly-field\n [label]="t(\'days\')"\n [hideLabel]="true"\n [previousLabel]="t(\'daysPrevious\')"\n [nextLabel]="t(\'daysNext\')"\n [locale]="effectiveLocale"\n [value]="inDays"\n [min]="-9999"\n [max]="9999"\n [disabled]="this[WklyPickerInputsPropertyKeys.Disabled]"\n [invalid]="!!errors.length"\n (valueChange)="days($event)"\n (complete)="finish()"\n ></wkly-field>\n </div>\n <div\n *ngIf="\n hasDate && viewMode === \'manual\' && (i === 0 || endView === \'date\')\n "\n class="date-fields"\n >\n <wkly-field\n [label]="t(\'day\')"\n [locale]="effectiveLocale"\n [value]="draft.date.day"\n [min]="1"\n [max]="31"\n [disabled]="this[WklyPickerInputsPropertyKeys.Disabled]"\n [invalid]="!!errors.length"\n (valueChange)="field(i, \'day\', $event)"\n (complete)="finish()"\n ></wkly-field>\n <wkly-field\n [label]="t(\'month\')"\n [locale]="effectiveLocale"\n [value]="draft.date.month"\n [min]="1"\n [max]="monthCount(draft)"\n [labels]="months(draft)"\n [disabled]="this[WklyPickerInputsPropertyKeys.Disabled]"\n [invalid]="!!errors.length"\n (valueChange)="field(i, \'month\', $event)"\n (complete)="finish()"\n ></wkly-field>\n <wkly-field\n [label]="t(\'year\')"\n [locale]="effectiveLocale"\n [value]="draft.date.year"\n [min]="adapter.supportedYearRange[0]"\n [max]="adapter.supportedYearRange[1]"\n [disabled]="this[WklyPickerInputsPropertyKeys.Disabled]"\n [invalid]="!!errors.length"\n (valueChange)="field(i, \'year\', $event)"\n (complete)="finish()"\n ></wkly-field>\n </div>\n <div\n *ngIf="hasTime"\n class="time-fields"\n [class.seconds]="this[WklyPickerInputsPropertyKeys.ShowSeconds]"\n >\n <wkly-field\n [label]="t(\'hour\')"\n [locale]="effectiveLocale"\n [value]="displayHour(draft)"\n [min]="effectiveHourCycle === \'h12\' ? 1 : 0"\n [max]="effectiveHourCycle === \'h12\' ? 12 : 23"\n [disabled]="this[WklyPickerInputsPropertyKeys.Disabled]"\n [invalid]="!!errors.length"\n (valueChange)="field(i, \'hour\', $event)"\n (complete)="finish()"\n ></wkly-field>\n <wkly-field\n [label]="t(\'minute\')"\n [locale]="effectiveLocale"\n [value]="draft.minute"\n [max]="59"\n [step]="\n this[WklyPickerInputsPropertyKeys.MinuteStep] > 0 &&\n 60 % this[WklyPickerInputsPropertyKeys.MinuteStep] === 0\n ? this[WklyPickerInputsPropertyKeys.MinuteStep]\n : 1\n "\n [disabled]="this[WklyPickerInputsPropertyKeys.Disabled]"\n [invalid]="!!errors.length"\n (valueChange)="field(i, \'minute\', $event)"\n (complete)="finish()"\n ></wkly-field>\n <wkly-field\n *ngIf="this[WklyPickerInputsPropertyKeys.ShowSeconds]"\n [label]="t(\'second\')"\n [locale]="effectiveLocale"\n [value]="draft.second"\n [max]="59"\n [step]="\n this[WklyPickerInputsPropertyKeys.SecondStep] > 0 &&\n 60 % this[WklyPickerInputsPropertyKeys.SecondStep] === 0\n ? this[WklyPickerInputsPropertyKeys.SecondStep]\n : 1\n "\n [disabled]="this[WklyPickerInputsPropertyKeys.Disabled]"\n [invalid]="!!errors.length"\n (valueChange)="field(i, \'second\', $event)"\n (complete)="finish()"\n ></wkly-field>\n <div class="period">\n <button\n *ngIf="\n effectiveHourCycle === \'h12\' ||\n this[WklyPickerInputsPropertyKeys.HourCycle] === \'switchable\'\n "\n type="button"\n [disabled]="this[WklyPickerInputsPropertyKeys.Disabled]"\n [attr.aria-pressed]="\n effectiveHourCycle === \'h12\' && (draft.hour || 0) < 12\n "\n (click)="period(i, \'am\')"\n >\n {{ t("am") }}</button\n ><button\n type="button"\n [disabled]="\n this[WklyPickerInputsPropertyKeys.Disabled] ||\n this[WklyPickerInputsPropertyKeys.HourCycle] !== \'switchable\'\n "\n [attr.aria-pressed]="effectiveHourCycle === \'h24\'"\n (click)="period(i, \'24\')"\n >\n 24</button\n ><button\n *ngIf="\n effectiveHourCycle === \'h12\' ||\n this[WklyPickerInputsPropertyKeys.HourCycle] === \'switchable\'\n "\n type="button"\n [disabled]="this[WklyPickerInputsPropertyKeys.Disabled]"\n [attr.aria-pressed]="\n effectiveHourCycle === \'h12\' && (draft.hour || 0) >= 12\n "\n (click)="period(i, \'pm\')"\n >\n {{ t("pm") }}\n </button>\n </div>\n </div>\n </fieldset>\n </ng-container>\n <div class="validation" role="status" aria-live="polite">\n <p *ngFor="let err of errors">! {{ t(err.messageKey) }}</p>\n </div>\n <footer *ngIf="submitVisible">\n <button\n type="button"\n class="confirm"\n [disabled]="!canSubmit"\n (click)="submit()"\n >\n {{ t("confirm") }}\n </button>\n </footer>\n</section>\n',providers:[{provide:n.NG_VALUE_ACCESSOR,useExisting:t.forwardRef((function(){return X})),multi:!0},{provide:n.NG_VALIDATORS,useExisting:t.forwardRef((function(){return X})),multi:!0}],styles:[':host{display:block;width:100%;box-sizing:border-box;--wkly-background-color:#fff;--wkly-background-color-alternate:#fafafa;--wkly-text-color:#192c28;--wkly-muted-color:#52635e;--wkly-border-color:#dce5e1;--wkly-accent-color:#176c55;--wkly-accent-color-alternate:#6ea494;--wkly-accent-text-color:#fff;--wkly-range-color:#e5f1ee;--wkly-error-color:#b42318;--wkly-focus-color:#245bd6;--wkly-size-multiplier:1;--wkly-size-unit:3.5em;color:var(--wkly-text-color);font:14px/1.4 system-ui,sans-serif;container-type:inline-size}.wkly{background:var(--wkly-background-color);border:1px solid var(--wkly-border-color);border-radius:14px;overflow:hidden;min-width:0;font-size:calc(14px * clamp(1, var(--wkly-size-multiplier), 1.5))}button{font:inherit;color:inherit;min-width:var(--wkly-size-unit);min-height:var(--wkly-size-unit);border:0;background:transparent;border-radius:8px;cursor:pointer}button:hover:not(:disabled):not([aria-disabled=true]){background:var(--wkly-accent-color-alternate)}button:disabled,button[aria-disabled=true]{opacity:.4;cursor:default}button:focus-visible{outline:2px solid var(--wkly-focus-color);outline-offset:-2px}.toolbar{display:flex;align-items:center;padding:8px;gap:3px;border-bottom:1px solid var(--wkly-border-color)}.spacer{flex:1}.year-control{padding:0 6px;font-weight:650;text-align:start;line-height:1.2}.now{color:var(--wkly-accent-color);font-weight:650}.week-head,.week-row{display:grid;grid-template-columns:28px repeat(7,minmax(0,1fr))}.week-head{font-size:.85em;color:var(--wkly-muted-color);height:34px;align-items:center;text-align:center}.week-row{height:calc(var(--wkly-size-unit) * clamp(1, var(--wkly-size-multiplier), 1));align-items:end}.no-label{grid-template-columns:repeat(7,minmax(0,1fr))}.week-scroll{overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;overflow-anchor:none;scrollbar-width:thin;max-height:65vh;touch-action:pan-y}.scroll-space{position:relative}.rows{position:absolute;left:0;right:0}.week-number{font-size:.85em;text-align:center;align-self:end;line-height:var(--wkly-size-unit);color:var(--wkly-muted-color)}[role=gridcell]{position:relative;min-width:0;height:var(--wkly-size-unit);text-align:center}[role=gridcell].odd-month:not(.range):not(.today){background:var(--wkly-background-color-alternate)}.day{width:100%;min-width:0;height:var(--wkly-size-unit);padding:0;border-radius:8px}.annotation{position:absolute;bottom:.25em;white-space:nowrap;font-size:1.25em;font-weight:650;line-height:1;pointer-events:none;z-index:1;color:var(--wkly-muted-color);color:color-mix(in srgb,var(--wkly-muted-color) 50%,transparent);text-shadow:0 0 2px --wkly-background-color,0 0 4px --wkly-background-color}.odd-month .annotation{text-shadow:0 0 2px --wkly-background-color-alternate,0 0 4px --wkly-background-color-alternate}.annotation:empty{display:none}.annotation--0{inset-inline-start:10%;bottom:1.75em}.annotation--1{inset-inline-start:-5%}.annotation--2{inset-inline-start:-20%}.annotation--3{inset-inline-start:-50%;inset-inline-end:-50%}.annotation--4{inset-inline-end:-20%}.annotation--5{inset-inline-end:-5%}.annotation--6{inset-inline-end:10%}.range{background:var(--wkly-range-color)}.day.selected{background:var(--wkly-accent-color);color:var(--wkly-accent-text-color);font-weight:700}.today:after{content:"";display:block;width:5px;height:5px;background:currentColor;border-radius:50%;position:absolute;bottom:2px;left:calc(50% - 2px)}.today{font-weight:750;box-shadow:inset 0 0 0 1px var(--wkly-accent-color)}.hidden{visibility:hidden}.week-navigation{display:flex;align-items:center;justify-content:space-between;border-top:1px solid var(--wkly-border-color);font-size:.85em;color:var(--wkly-muted-color)}fieldset{border:0;padding:0 12px;margin:0;min-width:0}legend{padding-top:.85em;font-weight:650;color:var(--wkly-accent-color)}.date-fields{display:grid;grid-template-columns:1fr 2fr 1.4fr;gap:7px;padding:12px 0}.end-view-toggle{display:inline-flex}.end-view-toggle button{min-height:0;min-width:0;padding:0 6px;border-radius:0;line-height:inherit}.end-view-toggle button:first-child{padding-inline-start:0}.end-view-toggle button+button{border-inline-start:1px solid var(--wkly-text-color)}.end-view-toggle button[aria-pressed=false]{color:var(--wkly-muted-color);font-weight:400}.in-days-fields{grid-template-columns:minmax(0,1fr);gap:0;text-align:center}.resulting-end-date{font-size:11px;color:var(--wkly-muted-color);height:1.4em;margin-bottom:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.time-fields{display:grid;grid-template-columns:1fr 1fr 52px;gap:8px;padding:14px 0;border-top:1px solid var(--wkly-border-color)}.time-fields.seconds{grid-template-columns:1fr 1fr 1fr 48px}.period{display:flex;flex-direction:column;justify-content:center;gap:2px;padding-top:1.25em}.period button{font-size:.85em}.period [aria-pressed=true]{background:var(--wkly-range-color);box-shadow:inset 0 0 0 1px var(--wkly-accent-color);font-weight:700}.validation{color:var(--wkly-error-color);font-size:.85em}.validation p{margin:.5em .85em}footer{padding:12px;border-top:1px solid var(--wkly-border-color)}.confirm{background:var(--wkly-accent-color);color:var(--wkly-accent-text-color);width:100%;font-weight:650}.confirm:hover:not(:disabled){background:var(--wkly-accent-color-alternate)}@media (forced-colors:active){.day.selected{outline:2px solid Highlight}.range{border-bottom:2px solid Highlight}.today{outline:1px dashed CanvasText}}@media (prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;animation:none!important}}']}]}],X.ctorParameters=function(){return[{type:String,decorators:[{type:t.Inject,args:[t.LOCALE_ID]}]},{type:void 0,decorators:[{type:t.Inject,args:[q]}]},{type:void 0,decorators:[{type:t.Inject,args:[$]}]},{type:void 0,decorators:[{type:t.Inject,args:[G]}]},{type:void 0,decorators:[{type:t.Inject,args:[J]}]},{type:Object,decorators:[{type:t.Inject,args:[t.PLATFORM_ID]}]},{type:t.ElementRef},{type:t.ChangeDetectorRef}]},X.propDecorators={scroller:[{type:t.ViewChild,args:["scroller"]}]};var Q=function(){function e(e,t,i,n,r){this.resolver=e,this.injector=t,this.app=i,this.document=n,this.platform=r}return e.prototype.open=function(e,t,n,r){var o=this;if(void 0===n&&(n=!0),!i.isPlatformBrowser(this.platform))throw new Error("Picker presentations can only open in a browser");var s=this.document.createElement("dialog");s.setAttribute("aria-label","Date and time picker"),Object.assign(s.style,{padding:"0",border:"0",borderRadius:"14px",width:"min(390px, 100vw)",maxWidth:"100vw",maxHeight:"94vh",background:"transparent"});var a=this.resolver.resolveComponentFactory(X).create(r||this.injector);a.instance.presentation="transient",s.appendChild(a.location.nativeElement),this.document.body.appendChild(s),this.app.attachView(a.hostView);var l=function(e){e.preventDefault(),t("escape")},c=function(e){if(n&&e.target===s){var i=s.getBoundingClientRect();(e.clientX<i.left||e.clientX>i.right||e.clientY<i.top||e.clientY>i.bottom)&&t("backdrop")}},p=function(e){if("Tab"===e.key){var t=Array.from(s.querySelectorAll('button:not(:disabled),input:not(:disabled),[tabindex="0"]')).filter((function(e){return e.tabIndex>=0&&e.getClientRects().length&&"hidden"!==getComputedStyle(e).visibility})),i=t[0],n=t[t.length-1];i&&(e.shiftKey?o.document.activeElement===i:o.document.activeElement===n)&&(e.preventDefault(),(e.shiftKey?n:i).focus())}};return s.addEventListener("cancel",l),s.addEventListener("click",c),s.addEventListener("keydown",p),s.showModal(),{component:a,destroy:function(){s.removeEventListener("cancel",l),s.removeEventListener("click",c),s.removeEventListener("keydown",p),s.close(),o.app.detachView(a.hostView),a.destroy(),s.remove(),e.focus()}}},e}();Q.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new Q(t.ɵɵinject(t.ComponentFactoryResolver),t.ɵɵinject(t.INJECTOR),t.ɵɵinject(t.ApplicationRef),t.ɵɵinject(i.DOCUMENT),t.ɵɵinject(t.PLATFORM_ID))},token:Q,providedIn:"root"}),Q.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],Q.ctorParameters=function(){return[{type:t.ComponentFactoryResolver},{type:t.Injector},{type:t.ApplicationRef},{type:Document,decorators:[{type:t.Inject,args:[i.DOCUMENT]}]},{type:Object,decorators:[{type:t.Inject,args:[t.PLATFORM_ID]}]}]};var ee=function(e){function t(t){var i=e.call(this)||this;return i.element=t,i.ref=null,i.subscriptions=[],i.errors=[],i.change=function(){},i.touched=function(){},i.validation=function(){},i}return l(t,e),t.prototype.open=function(){var e=this;if(!this[s.WklyPickerInputsPropertyKeys.Disabled]&&!this.ref){this.ref=this.create();var t=this.ref.component.instance;this.copy(),this.subscriptions=[t[s.WklyPickerOutputsPropertyKeys.ValueChange].subscribe((function(t){e[s.WklyPickerInputsPropertyKeys.Value]=t,e.change(t),e[s.WklyPickerOutputsPropertyKeys.ValueChange].emit(t),e.display()})),t[s.WklyPickerOutputsPropertyKeys.ValidationChange].subscribe((function(t){e.errors=t,e[s.WklyPickerOutputsPropertyKeys.ValidationChange].emit(t),e.validation()})),t[s.WklyPickerOutputsPropertyKeys.Closed].subscribe((function(t){return e.close(t)})),t[s.WklyPickerOutputsPropertyKeys.ViewportChange].subscribe((function(t){return e[s.WklyPickerOutputsPropertyKeys.ViewportChange].emit(t)})),t[s.WklyPickerOutputsPropertyKeys.ViewModeChange].subscribe((function(t){return e[s.WklyPickerOutputsPropertyKeys.ViewModeChange].emit(t)}))],this.ref.component.changeDetectorRef.detectChanges(),t.focusDay(),this[s.WklyPickerOutputsPropertyKeys.Opened].emit()}},t.prototype.key=function(e){"Enter"!==e.key&&" "!==e.key&&"ArrowDown"!==e.key||(e.preventDefault(),this.open())},t.prototype.blur=function(){this.touched()},t.prototype.close=function(e){if(void 0===e&&(e="programmatic"),this.ref){var t=this.ref;this.ref=null,this.subscriptions.forEach((function(e){return e.unsubscribe()})),this.subscriptions=[],t.destroy(),this.touched(),this[s.WklyPickerOutputsPropertyKeys.Closed].emit(e)}},t.prototype.ngOnChanges=function(){var e,t=this;[s.WklyPickerInputsPropertyKeys.ShowSeconds,s.WklyPickerInputsPropertyKeys.AllowRangeAcrossDisabled,s.WklyPickerInputsPropertyKeys.Required,s.WklyPickerInputsPropertyKeys.Disabled,s.WklyPickerInputsPropertyKeys.CloseOnBackdrop].forEach((function(e){return t[e]=s.coerceBoolean(t[e])})),this.checkValue(),this.display(),this.ref&&(this.copy(),this.ref.component.instance.ngOnChanges(((e={})[s.WklyPickerInputsPropertyKeys.Value]=!0,e)),this.ref.component.changeDetectorRef.detectChanges())},t.prototype.ngOnDestroy=function(){this.close()},t.prototype.copy=function(){var e,t;if(this.ref)try{for(var i=c(s.INPUT_NAMES),n=i.next();!n.done;n=i.next()){var r=n.value;this.ref.component.instance[r]=this[r]}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}},t.prototype.display=function(){var e=this.element.nativeElement;if("INPUT"===e.tagName){e.readOnly=!0;var t=this[s.WklyPickerInputsPropertyKeys.Value];e.value=null===t?"":"string"==typeof t?t:t.join(" — "),e.disabled=this[s.WklyPickerInputsPropertyKeys.Disabled],e.setAttribute("aria-haspopup","dialog")}},t.prototype.checkValue=function(){this.errors=o.validateSelection(this[s.WklyPickerInputsPropertyKeys.Value],this,this[s.WklyPickerInputsPropertyKeys.CalendarAdapter]||new o.WklyGregorianCalendarAdapter(this[s.WklyPickerInputsPropertyKeys.Locale]||"en-US")),this[s.WklyPickerOutputsPropertyKeys.ValidationChange].emit(this.errors),this.validation()},t.prototype.writeValue=function(e){this[s.WklyPickerInputsPropertyKeys.Value]=e,this.checkValue(),this.display(),this.ref&&this.ref.component.instance.writeValue(e)},t.prototype.registerOnChange=function(e){this.change=e},t.prototype.registerOnTouched=function(e){this.touched=e},t.prototype.setDisabledState=function(e){this[s.WklyPickerInputsPropertyKeys.Disabled]=e,this.display(),this.ref&&this.ref.component.instance.setDisabledState(e)},t.prototype.validate=function(){return this.errors.length?{wkly:this.errors}:null},t.prototype.registerOnValidatorChange=function(e){this.validation=e},t.prototype.scrollToEpochDay=function(e,t){var i;this.open(),null===(i=this.ref)||void 0===i||i.component.instance.scrollToEpochDay(e,t)},t.prototype.scrollToAbsoluteWeek=function(e,t){var i;this.open(),null===(i=this.ref)||void 0===i||i.component.instance.scrollToAbsoluteWeek(e,t)},t.prototype.scrollToCalendarDate=function(e,t){var i;this.open(),null===(i=this.ref)||void 0===i||i.component.instance.scrollToCalendarDate(e,t)},t.prototype.scrollToValue=function(e,t){var i;this.open(),null===(i=this.ref)||void 0===i||i.component.instance.scrollToValue(e,t)},t}(Z);ee.decorators=[{type:t.Directive}],ee.ctorParameters=function(){return[{type:t.ElementRef}]},ee.propDecorators={open:[{type:t.HostListener,args:["click"]}],key:[{type:t.HostListener,args:["keydown",["$event"]]}],blur:[{type:t.HostListener,args:["blur"]}]};var te=function(e){function t(t,i,n){var r=e.call(this,t)||this;return r.service=i,r.triggerInjector=n,r}return l(t,e),t.prototype.create=function(){var e=this;return this.service.open(this.element.nativeElement,(function(t){return e.close(t)}),this[s.WklyPickerInputsPropertyKeys.CloseOnBackdrop],this.triggerInjector)},t}(ee);te.decorators=[{type:t.Directive,args:[{selector:"[wklyDateTimePickerDialog]",exportAs:"wklyDialog",providers:[{provide:n.NG_VALUE_ACCESSOR,useExisting:t.forwardRef((function(){return te})),multi:!0},{provide:n.NG_VALIDATORS,useExisting:t.forwardRef((function(){return te})),multi:!0}]}]}],te.ctorParameters=function(){return[{type:t.ElementRef},{type:Q},{type:t.Injector}]};var ie=function(){function e(){this.value=0,this.label="",this.hideLabel=!1,this.previousLabel="",this.nextLabel="",this.min=0,this.max=59,this.step=1,this.locale="en-US",this.disabled=!1,this.invalid=!1,this.labels=null,this.valueChange=new t.EventEmitter,this.complete=new t.EventEmitter,this.before=null,this.touchY=0,this.touchSteps=0,this.touchChanged=!1,this.typed=null,this.inputTimer=null,this.wheelTimer=null}return Object.defineProperty(e.prototype,"display",{get:function(){return null!==this.typed?this.typed:null===this.value?"":this.labels?this.labels[this.value-this.min]||String(this.value):new Intl.NumberFormat(this.locale,{useGrouping:!1,minimumIntegerDigits:this.max<60?2:1}).format(this.value)},enumerable:!1,configurable:!0}),e.prototype.ngOnChanges=function(e){if(e.value&&this.min<0&&null!==this.typed){var t=""===this.typed||"-"===this.typed?null:Number(this.typed);this.value!==t&&(this.cancelInput(),this.typed=null)}},e.prototype.ngOnDestroy=function(){this.cancelInput(),null!==this.wheelTimer&&clearTimeout(this.wheelTimer)},e.prototype.next=function(e){var t=Math.floor((this.max-this.min)/this.step)+1;return this.min+r.floorMod(Math.floor(((null===this.value?this.min:this.value)-this.min)/this.step)+e,t)*this.step},e.prototype.neighbor=function(e){var t=this.next(e);return this.labels?this.labels[t-this.min]||"":new Intl.NumberFormat(this.locale,{useGrouping:!1}).format(t)},e.prototype.stepBy=function(e){this.disabled||(this.scrollBy(e),this.complete.emit())},e.prototype.begin=function(e){this.before=this.value,e.target.select()},e.prototype.type=function(e){var t=this;if(!this.disabled){var i=e.target,n=i.value,r=Array.from(n).every((function(e){return 1===o.normalizeDigits(e).length}));if(this.min<0&&!this.labels){var s=n.replace(/[\u200e\u200f\u061c]/g,"").replace(/\u2212/g,"-"),a=o.normalizeDigits(s);this.typed=i.value=(s.startsWith("-")?"-":"")+a,this.value=""===a?null:Math.max(this.min,Math.min(this.max,Number(this.typed))),null!==this.value&&Number(this.typed)!==this.value&&(this.typed=i.value=String(this.value))}else if(r){var l=o.normalizeDigits(n);this.typed=i.value=this.min>=0&&this.max<100?l.slice(-2):l,this.value=""===this.typed?null:Number(this.typed)}else if(this.labels){var c=n.trim().toLocaleLowerCase(this.locale);this.typed=n;var p=this.labels.map((function(e,t){return{label:e,index:t}})).filter((function(e){return e.label.toLocaleLowerCase(t.locale).includes(c)}));this.value=1===p.length?this.min+p[0].index:null}else this.typed=i.value=o.normalizeDigits(n),this.value=""===this.typed?null:Number(this.typed);this.valueChange.emit(this.value),this.cancelInput(),!r&&this.labels&&null!==this.value&&this.complete.emit(),this.inputTimer=setTimeout((function(){t.inputTimer=null,t.typed=null,t.disabled||t.complete.emit()}),1e3)}},e.prototype.key=function(e){"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),this.cancelInput(),this.typed=null,this.value=this.before,this.valueChange.emit(this.before),e.target.value=this.display,e.target.blur()),"Enter"===e.key&&(e.preventDefault(),e.stopPropagation(),this.finish());var t="ArrowUp"===e.key?-1:"ArrowDown"===e.key?1:"PageUp"===e.key?-5:"PageDown"===e.key?5:0;t&&(e.preventDefault(),this.stepBy(t))},e.prototype.finish=function(){this.cancelInput(),this.typed=null,this.complete.emit()},e.prototype.wheel=function(e){var t=this;this.disabled||Math.abs(e.deltaY)<1||(e.preventDefault(),this.scrollBy(e.deltaY>0?1:-1),null!==this.wheelTimer&&clearTimeout(this.wheelTimer),this.wheelTimer=setTimeout((function(){t.wheelTimer=null,t.complete.emit()}),140))},e.prototype.touchStart=function(e){this.touchY=e.touches[0].clientY,this.touchSteps=0,this.touchChanged=!1},e.prototype.touchMove=function(e){this.applyTouchY(e.touches[0].clientY)},e.prototype.touchEnd=function(e){this.applyTouchY(e.changedTouches[0].clientY),this.touchChanged&&this.complete.emit(),this.touchChanged=!1},e.prototype.cancelInput=function(){null!==this.inputTimer&&clearTimeout(this.inputTimer),this.inputTimer=null},e.prototype.scrollBy=function(e){!this.disabled&&e&&(this.cancelInput(),this.typed=null,this.value=this.next(e),this.valueChange.emit(this.value))},e.prototype.applyTouchY=function(e){if(!this.disabled){var t=this.touchY-e,i=Math.abs(t)>16?Math.sign(t)*Math.max(1,Math.round(Math.abs(t)/40)):0,n=i-this.touchSteps;n&&(this.scrollBy(n),this.touchSteps=i,this.touchChanged=!0)}},e}();ie.decorators=[{type:t.Component,args:[{selector:"wkly-field",template:'<div\n class="field"\n (wheel)="wheel($event)"\n (touchstart)="touchStart($event)"\n (touchmove)="touchMove($event)"\n (touchend)="touchEnd($event)"\n (touchcancel)="touchEnd($event)"\n>\n <span *ngIf="!hideLabel" class="label">{{ label }}</span>\n <button\n type="button"\n [disabled]="disabled"\n [attr.aria-label]="previousLabel || label + \': previous\'"\n (click)="stepBy(-1)"\n >\n {{ neighbor(-1) }}\n </button>\n <input\n [attr.aria-label]="label"\n [attr.aria-invalid]="invalid"\n [disabled]="disabled"\n [value]="display"\n [attr.inputmode]="labels ? \'text\' : min < 0 ? \'text\' : \'numeric\'"\n autocomplete="off"\n (focus)="begin($event)"\n (input)="type($event)"\n (blur)="finish()"\n (keydown)="key($event)"\n />\n <button\n type="button"\n [disabled]="disabled"\n [attr.aria-label]="nextLabel || label + \': next\'"\n (click)="stepBy(1)"\n >\n {{ neighbor(1) }}\n </button>\n</div>\n',styles:[".field{display:flex;flex-direction:column;align-items:stretch;min-width:0;text-align:center;touch-action:pan-x}.label{font-size:11px;color:var(--wkly-muted-color,#54616e);margin-bottom:4px}button,input{font:inherit;box-sizing:border-box;min-height:44px;width:100%;border:0;text-align:center;background:transparent;color:inherit;border-radius:7px}button{color:var(--wkly-muted-color,#54616e);cursor:pointer}input{font-size:18px;font-weight:650;background:var(--wkly-range-color,#e5f1ee);border-block:2px solid var(--wkly-accent-color,#176c55)}input[aria-invalid=true]{border-color:var(--wkly-error-color,#b42318)}:focus-visible{outline:2px solid var(--wkly-focus-color,#124ee0);outline-offset:1px}button:disabled,input:disabled{opacity:.45}button:hover:not(:disabled){background:var(--wkly-range-color,#e5f1ee)}"]}]}],ie.propDecorators={value:[{type:t.Input}],label:[{type:t.Input}],hideLabel:[{type:t.Input}],previousLabel:[{type:t.Input}],nextLabel:[{type:t.Input}],min:[{type:t.Input}],max:[{type:t.Input}],step:[{type:t.Input}],locale:[{type:t.Input}],disabled:[{type:t.Input}],invalid:[{type:t.Input}],labels:[{type:t.Input}],valueChange:[{type:t.Output}],complete:[{type:t.Output}]};var ne=function(){};ne.decorators=[{type:t.NgModule,args:[{imports:[i.CommonModule],declarations:[X,te,ie],entryComponents:[X],exports:[X,te]}]}],Object.keys(s).forEach((function(t){"default"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return s[t]}})})),e.WKLY_CLOCK=$,e.WKLY_CONFIG=q,e.WKLY_LOCALIZATION=G,e.WKLY_TRANSLATIONS=J,e.WklyDateTimePickerComponent=X,e.WklyDateTimePickerDialogDirective=te,e.WklyDateTimePickerDialogService=Q,e.WklyDateTimePickerModule=ne,e.WklyFieldComponent=ie,e.WklyPickerInputs=Z,e.WklyTriggerBase=ee,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@angular/forms"),require("@wkly/core"),require("@wkly/adapters"),require("@wkly/presentation")):"function"==typeof define&&define.amd?define("@wkly/datetime-picker",["exports","@angular/core","@angular/common","@angular/forms","@wkly/core","@wkly/adapters","@wkly/presentation"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wkly=e.wkly||{},e.wkly["datetime-picker"]={}),e.ng.core,e.ng.common,e.ng.forms,e.core,e.adapters,e.presentation)}(this,(function(e,t,i,n,r,o,s){"use strict";var a=function(e,t){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])})(e,t)};function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}Object.create;function c(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],n=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function p(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,r,o=i.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){r={error:e}}finally{try{n&&!n.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return s}Object.create;"function"==typeof SuppressedError&&SuppressedError;var h,u,d,y,f,k,b,v,g,m,P,w,W,I,D,K,O,C,x,S,T,M,E,j,L,V,R,A,z,H,N,F,_,B,Y=this&&this.__decorate||function(e,t,i,n){var r,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,i,s):r(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s},U=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},$=new t.InjectionToken("WKLY_CLOCK",{providedIn:"root",factory:function(){return{now:function(){return new Date}}}}),q=new t.InjectionToken("WKLY_CONFIG",{providedIn:"root",factory:function(){return{}}}),G=new t.InjectionToken("WKLY_LOCALIZATION",{providedIn:"root",factory:function(){return{}}}),J=new t.InjectionToken("WKLY_TRANSLATIONS",{providedIn:"root",factory:function(){return{}}}),Z=function(){this[h]="datetime",this[u]=null,this[y]="",this[f]=null,this[k]={kind:"full-month"},this[b]="locale",this[v]=!1,this[g]=1,this[m]=1,this[P]=null,this[w]=null,this[W]=null,this[I]=null,this[D]=null,this[K]=!1,this[O]=!1,this[C]=!1,this[x]="locale",this[S]=null,this[T]=256,this[M]=s.DEFAULT_OVERSCAN_WEEKS,this[E]=null,this[j]=null,this[L]=null,this[V]=!0,this[R]=[],this[A]=null,this[z]=new t.EventEmitter,this[H]=new t.EventEmitter(!0),this[N]=new t.EventEmitter,this[F]=new t.EventEmitter,this[_]=new t.EventEmitter(!0),this[B]=new t.EventEmitter};h=s.WklyPickerInputsPropertyKeys.Mode,u=s.WklyPickerInputsPropertyKeys.Value,d=s.WklyPickerInputsPropertyKeys.CalendarAdapter,y=s.WklyPickerInputsPropertyKeys.Locale,f=s.WklyPickerInputsPropertyKeys.WeekOffset,k=s.WklyPickerInputsPropertyKeys.ViewportPreset,b=s.WklyPickerInputsPropertyKeys.HourCycle,v=s.WklyPickerInputsPropertyKeys.ShowSeconds,g=s.WklyPickerInputsPropertyKeys.MinuteStep,m=s.WklyPickerInputsPropertyKeys.SecondStep,P=s.WklyPickerInputsPropertyKeys.Min,w=s.WklyPickerInputsPropertyKeys.Max,W=s.WklyPickerInputsPropertyKeys.IsDateDisabled,I=s.WklyPickerInputsPropertyKeys.IsTimeDisabled,D=s.WklyPickerInputsPropertyKeys.RangeValidator,K=s.WklyPickerInputsPropertyKeys.AllowRangeAcrossDisabled,O=s.WklyPickerInputsPropertyKeys.Required,C=s.WklyPickerInputsPropertyKeys.Disabled,x=s.WklyPickerInputsPropertyKeys.WeekLabelMode,S=s.WklyPickerInputsPropertyKeys.WeekLabelFormatter,T=s.WklyPickerInputsPropertyKeys.WeekCacheSize,M=s.WklyPickerInputsPropertyKeys.OverscanWeeks,E=s.WklyPickerInputsPropertyKeys.AriaLabel,j=s.WklyPickerInputsPropertyKeys.AriaDescribedBy,L=s.WklyPickerInputsPropertyKeys.InitialEpochDay,V=s.WklyPickerInputsPropertyKeys.CloseOnBackdrop,R=s.WklyPickerInputsPropertyKeys.Validators,A=s.WklyPickerInputsPropertyKeys.Translations,z=s.WklyPickerOutputsPropertyKeys.ValueChange,H=s.WklyPickerOutputsPropertyKeys.ValidationChange,N=s.WklyPickerOutputsPropertyKeys.Opened,F=s.WklyPickerOutputsPropertyKeys.Closed,_=s.WklyPickerOutputsPropertyKeys.ViewportChange,B=s.WklyPickerOutputsPropertyKeys.ViewModeChange,Z.decorators=[{type:t.Directive,args:[{inputs:["mode","value","calendarAdapter","locale","weekOffset","viewportPreset","hourCycle","showSeconds","minuteStep","secondStep","min","max","isDateDisabled","isTimeDisabled","rangeValidator","allowRangeAcrossDisabled","required","disabled","weekLabelMode","weekLabelFormatter","weekCacheSize","overscanWeeks","ariaLabel","ariaDescribedBy","initialEpochDay","closeOnBackdrop","validators","translations"],outputs:["valueChange","validationChange","opened","closed","viewportChange","viewModeChange"]}]}],Y([t.Input(),U("design:type",String)],Z.prototype,h,void 0),Y([t.Input(),U("design:type",Object)],Z.prototype,u,void 0),Y([t.Input(),U("design:type",Object)],Z.prototype,d,void 0),Y([t.Input(),U("design:type",String)],Z.prototype,y,void 0),Y([t.Input(),U("design:type",Object)],Z.prototype,f,void 0),Y([t.Input(),U("design:type",Object)],Z.prototype,k,void 0),Y([t.Input(),U("design:type",String)],Z.prototype,b,void 0),Y([t.Input(),U("design:type",Boolean)],Z.prototype,v,void 0),Y([t.Input(),U("design:type",Number)],Z.prototype,g,void 0),Y([t.Input(),U("design:type",Number)],Z.prototype,m,void 0),Y([t.Input(),U("design:type",Object)],Z.prototype,P,void 0),Y([t.Input(),U("design:type",Object)],Z.prototype,w,void 0),Y([t.Input(),U("design:type",Object)],Z.prototype,W,void 0),Y([t.Input(),U("design:type",Object)],Z.prototype,I,void 0),Y([t.Input(),U("design:type",Object)],Z.prototype,D,void 0),Y([t.Input(),U("design:type",Object)],Z.prototype,K,void 0),Y([t.Input(),U("design:type",Object)],Z.prototype,O,void 0),Y([t.Input(),U("design:type",Object)],Z.prototype,C,void 0),Y([t.Input(),U("design:type",String)],Z.prototype,x,void 0),Y([t.Input(),U("design:type",Object)],Z.prototype,S,void 0),Y([t.Input(),U("design:type",Object)],Z.prototype,T,void 0),Y([t.Input(),U("design:type",Object)],Z.prototype,M,void 0),Y([t.Input(),U("design:type",Object)],Z.prototype,E,void 0),Y([t.Input(),U("design:type",Object)],Z.prototype,j,void 0),Y([t.Input(),U("design:type",Object)],Z.prototype,L,void 0),Y([t.Input(),U("design:type",Object)],Z.prototype,V,void 0),Y([t.Input(),U("design:type",Array)],Z.prototype,R,void 0),Y([t.Input(),U("design:type",Object)],Z.prototype,A,void 0),Y([t.Output(),U("design:type",Object)],Z.prototype,z,void 0),Y([t.Output(),U("design:type",Object)],Z.prototype,H,void 0),Y([t.Output(),U("design:type",Object)],Z.prototype,N,void 0),Y([t.Output(),U("design:type",Object)],Z.prototype,F,void 0),Y([t.Output(),U("design:type",Object)],Z.prototype,_,void 0),Y([t.Output(),U("design:type",Object)],Z.prototype,B,void 0);var X=function(e){function t(t,n,r,o,a,l,c,p){var h=e.call(this)||this;return h.defaultLocale=t,h.defaults=n,h.clock=r,h.strings=o,h.defaultTranslations=a,h.host=c,h.changeDetector=p,h.presentation="inline",h.viewMode="calendar",h.endView="date",h.effectiveLocale="en-US",h.effectiveOffset=0,h.effectiveHourCycle="h24",h.direction="ltr",h.rows=[],h.weekdays=[],h.drafts=[],h.errors=[],h.today=0,h.focused=0,h.anchorWeek=0,h.firstWeek=0,h.visibleCount=6,h.rowHeight=76,h.scrollHeight=152076,h.paddingTop=0,h.initialized=!1,h.compact=!1,h.WklyPickerInputsPropertyKeys=s.WklyPickerInputsPropertyKeys,h.baseWeek=0,h.firstSupportedDay=0,h.lastSupportedDay=0,h.firstSupportedWeek=0,h.lastSupportedWeek=0,h.initialMonth="",h.clipMonth=!1,h.browser=!1,h.destroyed=!1,h.snapPending=!1,h.onChange=function(){},h.onTouched=function(){},h.validatorChanged=function(){},h.configErrors=[],h.pendingValue=null,h.emittedValue=null,h.manualDateEndpoint=0,h.browser=i.isPlatformBrowser(l),h}return l(t,e),t.prototype.ngOnInit=function(){this.initialize()},t.prototype.ngOnChanges=function(e){if(this.initialized){if(1===Object.keys(e).length&&e[s.WklyPickerInputsPropertyKeys.Value]&&this.emittedValue===JSON.stringify(this[s.WklyPickerInputsPropertyKeys.Value]))return void(this.emittedValue=null);var t=this.focused;this.configure(),e[s.WklyPickerInputsPropertyKeys.Value]||e[s.WklyPickerInputsPropertyKeys.Mode]||e[s.WklyPickerInputsPropertyKeys.CalendarAdapter]?(this.load(this[s.WklyPickerInputsPropertyKeys.Value]),this.position(this.focused,!0)):(this.check(),e[s.WklyPickerInputsPropertyKeys.ViewportPreset]?this.position(t,!0):this.scrollToEpochDay(t))}},t.prototype.initialize=function(){if(!this.initialized){this.configure();var e=this[s.WklyPickerInputsPropertyKeys.InitialEpochDay];this.today=this.browser?Math.floor(this.clock.now().getTime()/864e5):null===e?0:e,this.focused=null===e?void 0===this.defaults.initialEpochDay?this.today:this.defaults.initialEpochDay:e,this.load(this[s.WklyPickerInputsPropertyKeys.Value]),this.initialized=!0,this.position(this.focused,!0)}},t.prototype.configure=function(){var e,t,n=this;this.configErrors=[],[s.WklyPickerInputsPropertyKeys.ShowSeconds,s.WklyPickerInputsPropertyKeys.AllowRangeAcrossDisabled,s.WklyPickerInputsPropertyKeys.Required,s.WklyPickerInputsPropertyKeys.Disabled,s.WklyPickerInputsPropertyKeys.CloseOnBackdrop].forEach((function(e){return n[e]=s.coerceBoolean(n[e])})),this.effectiveLocale=this[s.WklyPickerInputsPropertyKeys.Locale]||this.defaults.locale||this.defaultLocale,this.direction=/^(ar|he|fa|ur)(-|$)/.test(this.effectiveLocale)?"rtl":"ltr",this.adapter=this[s.WklyPickerInputsPropertyKeys.CalendarAdapter]||new o.WklyGregorianCalendarAdapter(this.effectiveLocale);try{var a=void 0;try{a=i.getLocaleFirstDayOfWeek(this.effectiveLocale)}catch(e){}if(this.effectiveOffset=o.resolveWeekOffset(this.effectiveLocale,this[s.WklyPickerInputsPropertyKeys.WeekOffset],this.defaults.weekOffset,a),r.integer(this[s.WklyPickerInputsPropertyKeys.WeekCacheSize]),r.integer(this[s.WklyPickerInputsPropertyKeys.OverscanWeeks]),this[s.WklyPickerInputsPropertyKeys.WeekCacheSize]<0||this[s.WklyPickerInputsPropertyKeys.OverscanWeeks]<0||this[s.WklyPickerInputsPropertyKeys.OverscanWeeks]>50)throw new RangeError;if(!["datetime","date","time","datetime-range","date-range","time-range"].includes(this[s.WklyPickerInputsPropertyKeys.Mode]))throw new RangeError;var l=this[s.WklyPickerInputsPropertyKeys.ViewportPreset];if("weeks"===l.kind&&(r.integer(l.visibleWeekCount),l.visibleWeekCount<1||l.visibleWeekCount>52))throw new RangeError;if("full-month-and-around"===l.kind)try{for(var p=c([l.extraWeeksBefore||0,l.extraWeeksAfter||0]),h=p.next();!h.done;h=p.next()){var u=h.value;if(r.integer(u),u<0||u>52)throw new RangeError}}catch(t){e={error:t}}finally{try{h&&!h.done&&(t=p.return)&&t.call(p)}finally{if(e)throw e.error}}this.generator=r.createWeekGenerator({weekOffset:this.effectiveOffset,cacheSize:this[s.WklyPickerInputsPropertyKeys.WeekCacheSize]})}catch(e){this.configErrors.push(o.error("configuration-error",this[s.WklyPickerInputsPropertyKeys.WeekOffset])),this.generator=r.createWeekGenerator(),this.effectiveOffset=0}this.setSupportedScrollRange();var d=this[s.WklyPickerInputsPropertyKeys.HourCycle];"switchable"===d&&this.configuredHourCycle===d||(this.effectiveHourCycle="h12"===d||"locale"===d&&new Intl.DateTimeFormat(this.effectiveLocale,{hour:"numeric",timeZone:"UTC"}).resolvedOptions().hour12?"h12":"h24"),this.configuredHourCycle=d,this.weekdays=Array.from({length:7},(function(e,t){return n.adapter.formatWeekday(n.effectiveOffset+t,"short")}))},t.prototype.setSupportedScrollRange=function(){var e=this,t=p(this.adapter.supportedEpochDayRange,2),i=t[0],n=t[1],o=p(this.adapter.supportedYearRange,2),s=o[0],a=o[1],l=function(t){return e.adapter.epochDayToDate(t).year};if(l(i)<s){for(var c=i,h=n;c<h;){l(u=Math.floor((c+h)/2))<s?c=u+1:h=u}i=c}if(l(n)>a){for(c=i,h=n;c<h;){var u;l(u=Math.ceil((c+h)/2))>a?h=u-1:c=u}n=c}if(i>n||l(i)<s||l(i)>a||l(n)<s||l(n)>a)throw new RangeError("No supported days within the calendar year range");this.firstSupportedDay=i,this.lastSupportedDay=n,this.firstSupportedWeek=r.absoluteWeekOf(i,this.effectiveOffset),this.lastSupportedWeek=r.absoluteWeekOf(n,this.effectiveOffset)},t.prototype.clampFirstWeek=function(e){var t=Math.max(this.firstSupportedWeek,this.lastSupportedWeek-this.visibleCount+1);return Math.max(this.firstSupportedWeek,Math.min(t,e))},t.prototype.ngAfterViewInit=function(){var e=this;this.resetScroll(),this.browser&&"undefined"!=typeof ResizeObserver&&(this.observer=new ResizeObserver((function(){e.compact=e.host.nativeElement.clientWidth<338;var t=e.host.nativeElement.querySelector(".week-row"),i=t?parseFloat(getComputedStyle(t).height):0;i&&i!==e.rowHeight&&(e.rowHeight=i,e.scrollHeight=2001*e.rowHeight,e.renderRows(),e.resetScroll())})),this.observer.observe(this.host.nativeElement))},t.prototype.ngOnDestroy=function(){this.destroyed=!0,this.observer&&this.observer.disconnect(),this.scrollEndTimer&&clearTimeout(this.scrollEndTimer),this.generator&&this.generator.clearCache()},t.prototype.t=function(e){return s.resolveWklyTranslation(e,this.effectiveLocale,this[s.WklyPickerInputsPropertyKeys.Translations]||this.defaultTranslations,this.strings)},Object.defineProperty(t.prototype,"isRange",{get:function(){return this[s.WklyPickerInputsPropertyKeys.Mode].endsWith("-range")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasDate",{get:function(){return!this[s.WklyPickerInputsPropertyKeys.Mode].startsWith("time")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasTime",{get:function(){return"date"!==this[s.WklyPickerInputsPropertyKeys.Mode]&&"date-range"!==this[s.WklyPickerInputsPropertyKeys.Mode]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"submitVisible",{get:function(){return"transient"===this.presentation&&("date"!==this[s.WklyPickerInputsPropertyKeys.Mode]||"manual"===this.viewMode)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"title",{get:function(){try{var e=this.adapter.epochDayToDate(Math.max(this.firstSupportedDay,Math.min(this.lastSupportedDay,r.firstEpochDayOf(this.anchorWeek,this.effectiveOffset))));return this.adapter.formatMonth(e)+" "+this.adapter.formatYear(e)}catch(e){return""}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canSubmit",{get:function(){return!this[s.WklyPickerInputsPropertyKeys.Disabled]&&!this.errors.length&&null!==this.pendingValue},enumerable:!1,configurable:!0}),t.prototype.blank=function(e){var t=Math.max(this.firstSupportedDay,Math.min(this.lastSupportedDay,e));return{date:this.adapter.epochDayToDate(t),hour:0,minute:0,second:0,present:!1}},t.prototype.load=function(e){var t=this;this.drafts=[this.blank(this.focused),this.blank(this.focused)];var i=o.validateSelection(e,this,this.adapter);null===e||i.length||("string"==typeof e?[e]:e).forEach((function(e,i){var n=o.decodeIso(e);t.drafts[i]={date:t.hasDate?t.adapter.epochDayToDate(n.epochDay):t.blank(t.today).date,hour:n.hour,minute:n.minute,second:n.second,present:!0},0===i&&t.hasDate&&(t.focused=n.epochDay)}));i.length?(this.pendingValue=null,this.report(i)):this.check()},t.prototype.writeValue=function(e){this[s.WklyPickerInputsPropertyKeys.Value]=e,this.initialized&&(this.load(e),this.position(this.focused,!0))},t.prototype.registerOnChange=function(e){this.onChange=e},t.prototype.registerOnTouched=function(e){this.onTouched=e},t.prototype.setDisabledState=function(e){this[s.WklyPickerInputsPropertyKeys.Disabled]=e},t.prototype.validate=function(e){return this.errors.length?{wkly:this.errors}:null},t.prototype.registerOnValidatorChange=function(e){this.validatorChanged=e},t.prototype.touched=function(){var e=this;Promise.resolve().then((function(){return e.onTouched()}))},t.prototype.report=function(e){var t=JSON.stringify(this.errors)!==JSON.stringify(e);this.errors=e,t&&(this[s.WklyPickerOutputsPropertyKeys.ValidationChange].emit(e),this.validatorChanged())},t.prototype.check=function(){var e=s.validateDrafts({drafts:this.drafts,configErrors:this.configErrors,adapter:this.adapter,selection:this,mode:this[s.WklyPickerInputsPropertyKeys.Mode],isRange:this.isRange,hasDate:this.hasDate,hasTime:this.hasTime,showSeconds:this[s.WklyPickerInputsPropertyKeys.ShowSeconds],required:this[s.WklyPickerInputsPropertyKeys.Required]});this.pendingValue=e.pendingValue,this.report(e.errors)},t.prototype.trackDraft=function(e){return e},t.prototype.orderDrafts=function(){var e=this;if(this.isRange&&this.drafts.every((function(e){return e.present}))&&!this.drafts.some((function(e){return void 0!==e.unsupportedEpochDay})))try{var t=this.drafts[0],i=this.drafts[1],n=function(t){return 86400*e.adapter.dateToEpochDay(t.date)+3600*(t.hour||0)+60*(t.minute||0)+(t.second||0)};n(t)>n(i)&&(this.drafts=[i,t])}catch(e){}},t.prototype.finish=function(){this[s.WklyPickerInputsPropertyKeys.Disabled]||(this.orderDrafts(),"manual"===this.viewMode&&this.hasDate&&this.positionOnManualDate(),this.check(),"inline"===this.presentation&&this.canSubmit&&this.commit())},t.prototype.commit=function(){if(this.canSubmit){var e=this.pendingValue;JSON.stringify(e)!==JSON.stringify(this[s.WklyPickerInputsPropertyKeys.Value])&&(this[s.WklyPickerInputsPropertyKeys.Value]=e,this.emittedValue=JSON.stringify(e),this.onChange(e),this[s.WklyPickerOutputsPropertyKeys.ValueChange].emit(e)),this.onTouched()}},t.prototype.submit=function(e){void 0===e&&(e="submit"),this.check(),this.canSubmit&&(this.commit(),"transient"===this.presentation&&this[s.WklyPickerOutputsPropertyKeys.Closed].emit(e))},t.prototype.cancel=function(e){void 0===e&&(e="close-button"),this[s.WklyPickerInputsPropertyKeys.Disabled]||(this.load(this[s.WklyPickerInputsPropertyKeys.Value]),this.onTouched(),this[s.WklyPickerOutputsPropertyKeys.Closed].emit(e))},t.prototype.now=function(){var e=this;if(!this[s.WklyPickerInputsPropertyKeys.Disabled]){var t=this.clock.now(),i=Math.floor(t.getTime()/864e5);this.drafts=[0,1].map((function(n){return Object.assign(Object.assign({},e.clockDraft(i,t)),{present:0===n||e.isRange})})),this.hasDate&&(i<this.firstSupportedDay||i>this.lastSupportedDay)?this.report([o.error("unsupported-adapter-date",i)]):(this.focused=i,this.position(i,!0),this.check(),this.submit("now"))}},t.prototype.clockDraft=function(e,t){return Object.assign(Object.assign({},this.blank(e)),{hour:t.getUTCHours(),minute:Math.floor(t.getUTCMinutes()/this[s.WklyPickerInputsPropertyKeys.MinuteStep])*this[s.WklyPickerInputsPropertyKeys.MinuteStep],second:this[s.WklyPickerInputsPropertyKeys.ShowSeconds]?Math.floor(t.getUTCSeconds()/this[s.WklyPickerInputsPropertyKeys.SecondStep])*this[s.WklyPickerInputsPropertyKeys.SecondStep]:0})},t.prototype.initializeManualRange=function(){if(this.isRange&&this.hasDate&&!this.drafts.every((function(e){return e.present}))){var e=this.drafts.find((function(e){return e.present}));if(!e){if(null!==this[s.WklyPickerInputsPropertyKeys.Value])return;var t=this.clock.now(),i=this[s.WklyPickerInputsPropertyKeys.InitialEpochDay],n=null===i?void 0===this.defaults.initialEpochDay?Math.floor(t.getTime()/864e5):this.defaults.initialEpochDay:i;e=Object.assign(Object.assign({},this.clockDraft(n,t)),{present:!0})}var r=e;this.drafts=this.drafts.map((function(e){return e.present?e:Object.assign(Object.assign({},r),{date:Object.assign({},r.date)})})),this.finish(),this.changeDetector.markForCheck()}},t.prototype.toggleView=function(){var e=this;!this[s.WklyPickerInputsPropertyKeys.Disabled]&&this.hasDate&&(this.viewMode="calendar"===this.viewMode?"manual":"calendar","manual"===this.viewMode&&this.initializeManualRange(),"calendar"===this.viewMode&&this.positionOnManualDate(),this[s.WklyPickerOutputsPropertyKeys.ViewModeChange].emit(this.viewMode),"calendar"===this.viewMode&&setTimeout((function(){return e.resetScroll()})))},t.prototype.positionOnManualDate=function(){var e=this.drafts[this.manualDateEndpoint];if(e&&e.present)try{var t=this.adapter.dateToEpochDay(e.date);this.focused=t,this.position(t,!0)}catch(t){try{var i=this.adapter.dateToEpochDay(Object.assign(Object.assign({},e.date),{day:1}));this.focused=i,this.position(i,!0)}catch(e){}}},t.prototype.months=function(e){try{return this.adapter.getMonths(e.date.year).map((function(e){return e.label}))}catch(e){return[]}},t.prototype.monthCount=function(e){return this.months(e).length||12},Object.defineProperty(t.prototype,"inDays",{get:function(){return s.draftDayDifference(this.drafts,this.adapter)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inDaysLabel",{get:function(){var e=this.inDays;return this.t("inDays").replace(/{{\s*days\s*}}/g,null===e?this.t("daysUnavailable"):new Intl.NumberFormat(this.effectiveLocale,{useGrouping:!1}).format(e))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"resultingEndDate",{get:function(){try{var e=this.drafts[1];return void 0!==e.unsupportedEpochDay||this.adapter.validateDate(e.date).length?"":[this.adapter.formatDay(e.date),this.adapter.formatMonth(e.date),this.adapter.formatYear(e.date)].join(" ")}catch(e){return""}},enumerable:!1,configurable:!0}),t.prototype.toggleEndView=function(e){this[s.WklyPickerInputsPropertyKeys.Disabled]||(this.endView=e)},t.prototype.days=function(e){this[s.WklyPickerInputsPropertyKeys.Disabled]||(this.manualDateEndpoint=1,s.setDraftDayDifference(this.drafts,this.adapter,e),this.check())},t.prototype.field=function(e,t,i){var n;if(!this[s.WklyPickerInputsPropertyKeys.Disabled]){var r=this.drafts[e];if(r.present=!0,"day"===t||"year"===t||"month"===t){this.manualDateEndpoint=e,delete r.unsupportedEpochDay;var o=Object.assign(Object.assign({},r.date),((n={})[t]=i,n));if("month"===t){var a=void 0;try{a=this.adapter.getMonths(o.year).find((function(e){return e.month===i}))}catch(e){}o=Object.assign(Object.assign({},o),{monthCode:a?a.monthCode:""})}if("year"===t&&null!==i)try{(a=this.adapter.getMonths(i).find((function(e){return e.monthCode===o.monthCode})))&&(o=Object.assign(Object.assign({},o),{month:a.month}))}catch(e){}r.date=o}else"hour"===t&&"h12"===this.effectiveHourCycle?r.hour=null===i?null:i>=1&&i<=12?i%12+((r.hour||0)>=12?12:0):24+i:r[t]=i;this.check()}},t.prototype.displayHour=function(e){return null===e.hour?null:"h12"===this.effectiveHourCycle?e.hour%12||12:e.hour},t.prototype.period=function(e,t){this[s.WklyPickerInputsPropertyKeys.Disabled]||("24"===t?this.effectiveHourCycle="h24":(this.effectiveHourCycle="h12",this.drafts[e].hour=(this.drafts[e].hour||0)%12+("pm"===t?12:0),this.drafts[e].present=!0,this.finish()))},t.prototype.selected=function(e){var t=this;return this.drafts.some((function(i){try{return i.present&&t.adapter.dateToEpochDay(i.date)===e}catch(e){return!1}}))},t.prototype.inRange=function(e){if(!this.isRange||!this.drafts.every((function(e){return e.present})))return!1;try{var t=this.adapter.dateToEpochDay(this.drafts[0].date),i=this.adapter.dateToEpochDay(this.drafts[1].date);return e>Math.min(t,i)&&e<Math.max(t,i)}catch(e){return!1}},t.prototype.dayDisabled=function(e){var t,i;if(e<this.firstSupportedDay||e>this.lastSupportedDay)return!0;try{var n=this.adapter.epochDayToDate(e),r=this[s.WklyPickerInputsPropertyKeys.IsDateDisabled];if(r&&r(e,{mode:this[s.WklyPickerInputsPropertyKeys.Mode],endpoint:this.isRange?(null===(t=this.drafts[0])||void 0===t?void 0:t.present)&&!(null===(i=this.drafts[1])||void 0===i?void 0:i.present)?"end":"start":"single",calendarDate:n}))return!0;var a=this[s.WklyPickerInputsPropertyKeys.Min],l=this[s.WklyPickerInputsPropertyKeys.Max];return!!(a&&e<o.decodeIso(a).epochDay)||!!(l&&e>o.decodeIso(l).epochDay)}catch(e){return!0}},t.prototype.select=function(e){if(!this[s.WklyPickerInputsPropertyKeys.Disabled]&&!this.dayDisabled(e)){this.focused=e;var t=this.isRange&&this.drafts[0].present&&!this.drafts[1].present?1:0;this.isRange&&0===t&&(this.drafts[1].present=!1),delete this.drafts[t].unsupportedEpochDay,this.drafts[t].date=this.adapter.epochDayToDate(e),this.drafts[t].present=!0,this.orderDrafts(),this.renderRows(),this.finish(),"transient"===this.presentation&&"date"===this[s.WklyPickerInputsPropertyKeys.Mode]&&"calendar"===this.viewMode&&this.submit("auto-submit")}},t.prototype.key=function(e,t){var i=0;if("ArrowLeft"===e.key&&(i=-1),"ArrowRight"===e.key&&(i=1),"ArrowUp"===e.key&&(i=-7),"ArrowDown"===e.key&&(i=7),"PageUp"===e.key&&(i=-7*(e.shiftKey?this.visibleCount:1)),"PageDown"===e.key&&(i=7*(e.shiftKey?this.visibleCount:1)),"Home"===e.key&&(e.preventDefault(),this.scrollToEpochDay(this.today,{focus:!0})),i){e.preventDefault();var n=t+i;n>=this.firstSupportedDay&&n<=this.lastSupportedDay&&this.scrollToEpochDay(n,{focus:!0})}},t.prototype.position=function(e,t,i){void 0===t&&(t=!1),void 0===i&&(i={}),e=Math.max(this.firstSupportedDay,Math.min(this.lastSupportedDay,e)),this.anchorWeek=r.absoluteWeekOf(e,this.effectiveOffset);var n=this[s.WklyPickerInputsPropertyKeys.ViewportPreset];if(this.clipMonth=t&&"full-month"===n.kind,t&&"weeks"!==n.kind){var o=this.adapter.epochDayToDate(e);this.initialMonth=o.year+"/"+o.monthCode;var a=p(s.calendarMonthBounds(this.adapter,e),2),l=a[0],c=a[1];if(this.firstWeek=r.absoluteWeekOf(l,this.effectiveOffset),this.visibleCount=r.absoluteWeekOf(c,this.effectiveOffset)-this.firstWeek+1,"full-month-and-around"===n.kind&&!this.configErrors.length){var h=n.extraWeeksBefore||0,u=n.extraWeeksAfter||0;this.firstWeek-=h,this.visibleCount+=h+u}}else"weeks"===n.kind&&(this.visibleCount=this.configErrors.length?6:n.visibleWeekCount),this.firstWeek=this.anchorWeek-("start"===i.align?0:"end"===i.align?this.visibleCount-1:Math.floor(this.visibleCount/2));this.firstWeek=this.clampFirstWeek(this.firstWeek),this.baseWeek=this.firstWeek-1e3,this.renderRows(),this.changeDetector.detectChanges(),this.resetScroll()},t.prototype.resetScroll=function(){this.scroller&&(this.scroller.nativeElement.scrollTop=Math.round(1e3*this.rowHeight))},t.prototype.scroll=function(e){var t=e.target;this.snapPending=!0,this.scheduleSnap();var i=t.scrollTop/this.rowHeight-1e3,n=1e3+Math.sign(i)*Math.round(Math.abs(i)),r=this.baseWeek+n,o=this.clampFirstWeek(r);if(r!==o&&(t.scrollTop=Math.round((o-this.baseWeek)*this.rowHeight)),o!==this.firstWeek){if(this.clipMonth=!1,this.firstWeek=o,this.anchorWeek=o+Math.floor(this.visibleCount/2),n<100||n>1900){var s=t.scrollTop-(o-this.baseWeek)*this.rowHeight;this.baseWeek=o-1e3,t.scrollTop=Math.round(1e3*this.rowHeight+s)}this.renderRows()}},t.prototype.scheduleSnap=function(){var e=this;this.scrollEndTimer&&clearTimeout(this.scrollEndTimer),this.scrollEndTimer=setTimeout((function(){return e.snapWeek()}),200)},t.prototype.snapWeek=function(){if(this.scrollEndTimer&&clearTimeout(this.scrollEndTimer),this.scrollEndTimer=void 0,this.snapPending&&this.scroller){this.snapPending=!1;var e=this.scroller.nativeElement,t=Math.round((this.firstWeek-this.baseWeek)*this.rowHeight);e.scrollTop!==t&&(e.scrollTop=t)}},t.prototype.showFirstWeek=function(e){var t=this.clampFirstWeek(e);t!==this.firstWeek&&(this.clipMonth=!1,this.firstWeek=t,this.anchorWeek=t+Math.floor(this.visibleCount/2),this.baseWeek=t-1e3,this.renderRows(),this.resetScroll())},t.prototype.canMoveWeek=function(e){return this.clampFirstWeek(this.firstWeek+e)!==this.firstWeek},t.prototype.moveWeek=function(e){this[s.WklyPickerInputsPropertyKeys.Disabled]||this.showFirstWeek(this.firstWeek+e)},t.prototype.renderRows=function(){var e=this,t=Math.max(0,Math.min(50,this[s.WklyPickerInputsPropertyKeys.OverscanWeeks]||0)),i=this.firstWeek-t;this.paddingTop=(i-this.baseWeek)*this.rowHeight,this.rows=s.createWeekRows({generator:this.generator,adapter:this.adapter,startWeek:i,count:this.visibleCount+2*t,firstVisibleWeek:this.firstWeek,firstSupportedDay:this.firstSupportedDay,lastSupportedDay:this.lastSupportedDay,clipMonth:this.clipMonth,initialMonth:this.initialMonth,weekLabelMode:this[s.WklyPickerInputsPropertyKeys.WeekLabelMode],weekLabelFormatter:this[s.WklyPickerInputsPropertyKeys.WeekLabelFormatter]||null,isDayDisabled:function(t){return e.dayDisabled(t)}}),this[s.WklyPickerOutputsPropertyKeys.ViewportChange].emit({firstVisibleAbsoluteWeek:this.firstWeek,lastVisibleAbsoluteWeek:this.firstWeek+this.visibleCount-1,anchorAbsoluteWeek:this.anchorWeek})},t.prototype.trackCell=function(e,t){return t.epochDay},t.prototype.trackRow=function(e,t){return t.week.absoluteWeek},t.prototype.scrollToEpochDay=function(e,t){void 0===t&&(t={}),r.integer(e),this.adapter.epochDayToDate(e),e=Math.max(this.firstSupportedDay,Math.min(this.lastSupportedDay,e)),t.focus&&(this.focused=e),this.position(e,!1,t),t.select&&this.select(e),t.focus&&this.focusDay()},t.prototype.scrollToAbsoluteWeek=function(e,t){void 0===t&&(t={});var i=r.firstEpochDayOf(e,this.effectiveOffset);this.scrollToEpochDay(e===this.firstSupportedWeek?Math.max(i,this.firstSupportedDay):i,t)},t.prototype.scrollToCalendarDate=function(e,t){void 0===t&&(t={}),this.scrollToEpochDay(this.adapter.dateToEpochDay(e),t)},t.prototype.scrollToValue=function(e,t){void 0===t&&(t={}),this.scrollToEpochDay(o.decodeIso(e).epochDay,t)},t.prototype.focusDay=function(){var e=this;this.browser&&setTimeout((function(){var t;if(!e.destroyed){e.changeDetector.detectChanges();var i=e.host.nativeElement.querySelector('[data-day="'+e.focused+'"]'),n=e.host.nativeElement.querySelector("button:not(:disabled),input:not(:disabled)");null===(t=i||n)||void 0===t||t.focus({preventScroll:!0})}}))},t}(Z);X.decorators=[{type:t.Component,args:[{selector:"wkly-datetime-picker",template:'<section\n class="wkly"\n [attr.dir]="direction"\n [attr.aria-label]="\n this[WklyPickerInputsPropertyKeys.AriaLabel] || \'Date and time picker\'\n "\n [attr.aria-describedby]="this[WklyPickerInputsPropertyKeys.AriaDescribedBy]"\n (focusout)="touched()"\n>\n <header class="toolbar">\n <button\n *ngIf="hasDate"\n type="button"\n [disabled]="this[WklyPickerInputsPropertyKeys.Disabled]"\n [attr.aria-label]="t(viewMode === \'calendar\' ? \'manual\' : \'calendar\')"\n (click)="toggleView()"\n >\n {{ viewMode === "calendar" ? "☷" : "▦" }}\n </button>\n <span *ngIf="hasDate" class="year-control">{{ title }}</span>\n <span class="spacer"></span\n ><button\n type="button"\n class="now"\n [disabled]="this[WklyPickerInputsPropertyKeys.Disabled]"\n (click)="now()"\n >\n {{ t("now") }}\n </button>\n <button\n *ngIf="presentation === \'transient\'"\n type="button"\n [disabled]="this[WklyPickerInputsPropertyKeys.Disabled]"\n [attr.aria-label]="t(\'close\')"\n (click)="cancel()"\n >\n ×\n </button>\n </header>\n <ng-container *ngIf="hasDate && viewMode === \'calendar\'">\n <div\n role="grid"\n [attr.aria-label]="\n this[WklyPickerInputsPropertyKeys.AriaLabel] || \'Calendar\'\n "\n [attr.aria-multiselectable]="isRange"\n >\n <div\n role="row"\n class="week-head"\n [class.no-label]="\n compact ||\n (this[WklyPickerInputsPropertyKeys.WeekLabelMode] === \'hidden\' &&\n !this[WklyPickerInputsPropertyKeys.WeekLabelFormatter])\n "\n >\n <span\n *ngIf="\n !compact &&\n (this[WklyPickerInputsPropertyKeys.WeekLabelMode] !== \'hidden\' ||\n this[WklyPickerInputsPropertyKeys.WeekLabelFormatter])\n "\n role="columnheader"\n aria-label="Week"\n ></span\n ><span *ngFor="let day of weekdays" role="columnheader">{{ day }}</span>\n </div>\n <div\n #scroller\n class="week-scroll"\n [style.height.px]="visibleCount * rowHeight"\n (scroll)="scroll($event)"\n (scrollend)="snapWeek()"\n >\n <div [style.height.px]="scrollHeight" class="scroll-space">\n <div class="rows" [style.top.px]="paddingTop">\n <div\n *ngFor="let row of rows; trackBy: trackRow"\n role="row"\n class="week-row"\n [class.no-label]="\n compact ||\n (this[WklyPickerInputsPropertyKeys.WeekLabelMode] ===\n \'hidden\' &&\n !this[WklyPickerInputsPropertyKeys.WeekLabelFormatter])\n "\n >\n <span\n *ngIf="\n !compact &&\n (this[WklyPickerInputsPropertyKeys.WeekLabelMode] !==\n \'hidden\' ||\n this[WklyPickerInputsPropertyKeys.WeekLabelFormatter])\n "\n role="rowheader"\n class="week-number"\n >{{ row.label }}</span\n >\n <div\n *ngFor="\n let cell of row.cells;\n let dayIndex = index;\n trackBy: trackCell\n "\n role="gridcell"\n [attr.data-weekday-index]="dayIndex"\n [attr.aria-colindex]="\n dayIndex +\n (compact ||\n (this[WklyPickerInputsPropertyKeys.WeekLabelMode] ===\n \'hidden\' &&\n !this[WklyPickerInputsPropertyKeys.WeekLabelFormatter])\n ? 1\n : 2)\n "\n [attr.aria-selected]="selected(cell.epochDay)"\n [attr.aria-disabled]="\n cell.disabled || this[WklyPickerInputsPropertyKeys.Disabled]\n "\n [class.range]="inRange(cell.epochDay)"\n [class.hidden]="cell.hidden"\n [class.odd-month]="cell.date && cell.date.month % 2 === 1"\n >\n <span [class]="\'annotation annotation--\' + dayIndex">{{\n cell.annotation\n }}</span>\n <button\n type="button"\n class="day"\n [attr.data-day]="cell.epochDay"\n [attr.aria-label]="cell.accessible"\n [attr.aria-current]="cell.epochDay === today ? \'date\' : null"\n [attr.aria-disabled]="\n cell.disabled || this[WklyPickerInputsPropertyKeys.Disabled]\n "\n [attr.tabindex]="\n !cell.hidden && cell.epochDay === focused ? 0 : -1\n "\n [class.selected]="selected(cell.epochDay)"\n [class.today]="cell.epochDay === today"\n (focus)="focused = cell.epochDay"\n (click)="select(cell.epochDay)"\n (keydown)="key($event, cell.epochDay)"\n >\n {{ cell.label }}\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class="week-navigation">\n <button\n type="button"\n [disabled]="\n this[WklyPickerInputsPropertyKeys.Disabled] || !canMoveWeek(-1)\n "\n [attr.aria-label]="t(\'previous\')"\n (click)="moveWeek(-1)"\n >\n ↑</button\n ><span>{{ title }}</span\n ><button\n type="button"\n [disabled]="\n this[WklyPickerInputsPropertyKeys.Disabled] || !canMoveWeek(1)\n "\n [attr.aria-label]="t(\'next\')"\n (click)="moveWeek(1)"\n >\n ↓\n </button>\n </div>\n </ng-container>\n <ng-container\n *ngFor="let draft of drafts; let i = index; trackBy: trackDraft"\n >\n <fieldset\n *ngIf="(i === 0 || isRange) && (hasTime || viewMode === \'manual\')"\n [disabled]="this[WklyPickerInputsPropertyKeys.Disabled]"\n [attr.aria-label]="isRange ? t(i === 0 ? \'start\' : \'end\') : null"\n >\n <legend *ngIf="isRange">\n <ng-container\n *ngIf="\n i === 1 && hasDate && viewMode === \'manual\';\n else endpointLabel\n "\n >\n <span class="end-view-toggle">\n <button\n type="button"\n [disabled]="this[WklyPickerInputsPropertyKeys.Disabled]"\n [attr.aria-pressed]="endView === \'date\'"\n (click)="toggleEndView(\'date\')"\n >\n {{ t("end") }}\n </button>\n <button\n type="button"\n [disabled]="this[WklyPickerInputsPropertyKeys.Disabled]"\n [attr.aria-pressed]="endView === \'days\'"\n (click)="toggleEndView(\'days\')"\n >\n {{ inDaysLabel }}\n </button>\n </span>\n </ng-container>\n <ng-template #endpointLabel>{{\n t(i === 0 ? "start" : "end")\n }}</ng-template>\n </legend>\n <div\n *ngIf="\n i === 1 && hasDate && viewMode === \'manual\' && endView === \'days\'\n "\n class="date-fields in-days-fields"\n >\n <span class="resulting-end-date" [attr.aria-label]="t(\'endDate\')">{{\n resultingEndDate\n }}</span>\n <wkly-field\n [label]="t(\'days\')"\n [hideLabel]="true"\n [previousLabel]="t(\'daysPrevious\')"\n [nextLabel]="t(\'daysNext\')"\n [locale]="effectiveLocale"\n [value]="inDays"\n [min]="-9999"\n [max]="9999"\n [disabled]="this[WklyPickerInputsPropertyKeys.Disabled]"\n [invalid]="!!errors.length"\n (valueChange)="days($event)"\n (complete)="finish()"\n ></wkly-field>\n </div>\n <div\n *ngIf="\n hasDate && viewMode === \'manual\' && (i === 0 || endView === \'date\')\n "\n class="date-fields"\n >\n <wkly-field\n [label]="t(\'day\')"\n [locale]="effectiveLocale"\n [value]="draft.date.day"\n [min]="1"\n [max]="31"\n [disabled]="this[WklyPickerInputsPropertyKeys.Disabled]"\n [invalid]="!!errors.length"\n (valueChange)="field(i, \'day\', $event)"\n (complete)="finish()"\n ></wkly-field>\n <wkly-field\n [label]="t(\'month\')"\n [locale]="effectiveLocale"\n [value]="draft.date.month"\n [min]="1"\n [max]="monthCount(draft)"\n [labels]="months(draft)"\n [disabled]="this[WklyPickerInputsPropertyKeys.Disabled]"\n [invalid]="!!errors.length"\n (valueChange)="field(i, \'month\', $event)"\n (complete)="finish()"\n ></wkly-field>\n <wkly-field\n [label]="t(\'year\')"\n [locale]="effectiveLocale"\n [value]="draft.date.year"\n [min]="adapter.supportedYearRange[0]"\n [max]="adapter.supportedYearRange[1]"\n [disabled]="this[WklyPickerInputsPropertyKeys.Disabled]"\n [invalid]="!!errors.length"\n (valueChange)="field(i, \'year\', $event)"\n (complete)="finish()"\n ></wkly-field>\n </div>\n <div\n *ngIf="hasTime"\n class="time-fields"\n [class.seconds]="this[WklyPickerInputsPropertyKeys.ShowSeconds]"\n >\n <wkly-field\n [label]="t(\'hour\')"\n [locale]="effectiveLocale"\n [value]="displayHour(draft)"\n [min]="effectiveHourCycle === \'h12\' ? 1 : 0"\n [max]="effectiveHourCycle === \'h12\' ? 12 : 23"\n [disabled]="this[WklyPickerInputsPropertyKeys.Disabled]"\n [invalid]="!!errors.length"\n (valueChange)="field(i, \'hour\', $event)"\n (complete)="finish()"\n ></wkly-field>\n <wkly-field\n [label]="t(\'minute\')"\n [locale]="effectiveLocale"\n [value]="draft.minute"\n [max]="59"\n [step]="\n this[WklyPickerInputsPropertyKeys.MinuteStep] > 0 &&\n 60 % this[WklyPickerInputsPropertyKeys.MinuteStep] === 0\n ? this[WklyPickerInputsPropertyKeys.MinuteStep]\n : 1\n "\n [disabled]="this[WklyPickerInputsPropertyKeys.Disabled]"\n [invalid]="!!errors.length"\n (valueChange)="field(i, \'minute\', $event)"\n (complete)="finish()"\n ></wkly-field>\n <wkly-field\n *ngIf="this[WklyPickerInputsPropertyKeys.ShowSeconds]"\n [label]="t(\'second\')"\n [locale]="effectiveLocale"\n [value]="draft.second"\n [max]="59"\n [step]="\n this[WklyPickerInputsPropertyKeys.SecondStep] > 0 &&\n 60 % this[WklyPickerInputsPropertyKeys.SecondStep] === 0\n ? this[WklyPickerInputsPropertyKeys.SecondStep]\n : 1\n "\n [disabled]="this[WklyPickerInputsPropertyKeys.Disabled]"\n [invalid]="!!errors.length"\n (valueChange)="field(i, \'second\', $event)"\n (complete)="finish()"\n ></wkly-field>\n <div class="period">\n <button\n *ngIf="\n effectiveHourCycle === \'h12\' ||\n this[WklyPickerInputsPropertyKeys.HourCycle] === \'switchable\'\n "\n type="button"\n [disabled]="this[WklyPickerInputsPropertyKeys.Disabled]"\n [attr.aria-pressed]="\n effectiveHourCycle === \'h12\' && (draft.hour || 0) < 12\n "\n (click)="period(i, \'am\')"\n >\n {{ t("am") }}</button\n ><button\n type="button"\n [disabled]="\n this[WklyPickerInputsPropertyKeys.Disabled] ||\n this[WklyPickerInputsPropertyKeys.HourCycle] !== \'switchable\'\n "\n [attr.aria-pressed]="effectiveHourCycle === \'h24\'"\n (click)="period(i, \'24\')"\n >\n 24</button\n ><button\n *ngIf="\n effectiveHourCycle === \'h12\' ||\n this[WklyPickerInputsPropertyKeys.HourCycle] === \'switchable\'\n "\n type="button"\n [disabled]="this[WklyPickerInputsPropertyKeys.Disabled]"\n [attr.aria-pressed]="\n effectiveHourCycle === \'h12\' && (draft.hour || 0) >= 12\n "\n (click)="period(i, \'pm\')"\n >\n {{ t("pm") }}\n </button>\n </div>\n </div>\n </fieldset>\n </ng-container>\n <div class="validation" role="status" aria-live="polite">\n <p *ngFor="let err of errors">! {{ t(err.messageKey) }}</p>\n </div>\n <footer *ngIf="submitVisible">\n <button\n type="button"\n class="confirm"\n [disabled]="!canSubmit"\n (click)="submit()"\n >\n {{ t("confirm") }}\n </button>\n </footer>\n</section>\n',providers:[{provide:n.NG_VALUE_ACCESSOR,useExisting:t.forwardRef((function(){return X})),multi:!0},{provide:n.NG_VALIDATORS,useExisting:t.forwardRef((function(){return X})),multi:!0}],styles:[':host{display:block;width:100%;box-sizing:border-box;--wkly-background-color:#fff;--wkly-background-color-alternate:#fafafa;--wkly-text-color:#192c28;--wkly-muted-color:#52635e;--wkly-border-color:#dce5e1;--wkly-accent-color:#176c55;--wkly-accent-color-alternate:#6ea494;--wkly-accent-text-color:#fff;--wkly-range-color:#e5f1ee;--wkly-error-color:#b42318;--wkly-focus-color:#245bd6;--wkly-size-multiplier:1;--wkly-size-unit:3.5em;color:var(--wkly-text-color);font:14px/1.4 system-ui,sans-serif;container-type:inline-size}.wkly{background:var(--wkly-background-color);border:1px solid var(--wkly-border-color);border-radius:14px;overflow:hidden;min-width:0;font-size:calc(14px * clamp(1, var(--wkly-size-multiplier), 1.5))}button{font:inherit;color:inherit;min-width:var(--wkly-size-unit);min-height:var(--wkly-size-unit);border:0;background:transparent;border-radius:8px;cursor:pointer}@media (hover:hover) and (pointer:fine){button:hover:not(:disabled):not([aria-disabled=true]):not(.selected){background:var(--wkly-accent-color-alternate)}}button:disabled,button[aria-disabled=true]{opacity:.4;cursor:default}button:focus-visible{outline:2px solid var(--wkly-focus-color);outline-offset:-2px}.toolbar{display:flex;align-items:center;padding:8px;gap:3px;border-bottom:1px solid var(--wkly-border-color)}.spacer{flex:1}.year-control{padding:0 6px;font-weight:650;text-align:start;line-height:1.2}.now{color:var(--wkly-accent-color);font-weight:650}.week-head,.week-row{display:grid;grid-template-columns:28px repeat(7,minmax(0,1fr))}.week-head{font-size:.85em;color:var(--wkly-muted-color);height:34px;align-items:center;text-align:center}.week-row{height:calc(var(--wkly-size-unit) * clamp(1, var(--wkly-size-multiplier), 1));align-items:end}.no-label{grid-template-columns:repeat(7,minmax(0,1fr))}.week-scroll{overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;overflow-anchor:none;scrollbar-width:thin;max-height:65vh;touch-action:pan-y}.scroll-space{position:relative}.rows{position:absolute;left:0;right:0}.week-number{font-size:.85em;text-align:center;align-self:end;line-height:var(--wkly-size-unit);color:var(--wkly-muted-color)}[role=gridcell]{position:relative;min-width:0;height:var(--wkly-size-unit);text-align:center}[role=gridcell].odd-month:not(.range):not(.today){background:var(--wkly-background-color-alternate)}.day{width:100%;min-width:0;height:var(--wkly-size-unit);padding:0;border-radius:8px}.annotation{position:absolute;bottom:.25em;white-space:nowrap;font-size:1.25em;font-weight:650;line-height:1;pointer-events:none;z-index:1;color:var(--wkly-muted-color);color:color-mix(in srgb,var(--wkly-muted-color) 50%,transparent);text-shadow:0 0 2px --wkly-background-color,0 0 4px --wkly-background-color}.odd-month .annotation{text-shadow:0 0 2px --wkly-background-color-alternate,0 0 4px --wkly-background-color-alternate}.annotation:empty{display:none}.annotation--0{inset-inline-start:10%;bottom:1.75em}.annotation--1{inset-inline-start:-5%}.annotation--2{inset-inline-start:-20%}.annotation--3{inset-inline-start:-50%;inset-inline-end:-50%}.annotation--4{inset-inline-end:-20%}.annotation--5{inset-inline-end:-5%}.annotation--6{inset-inline-end:10%}.range{background:var(--wkly-range-color)}.day.selected{background:var(--wkly-accent-color);color:var(--wkly-accent-text-color);font-weight:700}.today:after{content:"";display:block;width:5px;height:5px;background:currentColor;border-radius:50%;position:absolute;bottom:2px;left:calc(50% - 2px)}.today{font-weight:750;box-shadow:inset 0 0 0 1px var(--wkly-accent-color)}.hidden{visibility:hidden}.week-navigation{display:flex;align-items:center;justify-content:space-between;border-top:1px solid var(--wkly-border-color);font-size:.85em;color:var(--wkly-muted-color)}fieldset{border:0;padding:0 12px;margin:0;min-width:0}legend{padding-top:.85em;font-weight:650;color:var(--wkly-accent-color)}.date-fields{display:grid;grid-template-columns:1fr 2fr 1.4fr;gap:7px;padding:12px 0}.end-view-toggle{display:inline-flex}.end-view-toggle button{min-height:0;min-width:0;padding:0 6px;border-radius:0;line-height:inherit}.end-view-toggle button:first-child{padding-inline-start:0}.end-view-toggle button+button{border-inline-start:1px solid var(--wkly-text-color)}.end-view-toggle button[aria-pressed=false]{color:var(--wkly-muted-color);font-weight:400}.in-days-fields{grid-template-columns:minmax(0,1fr);gap:0;text-align:center}.resulting-end-date{font-size:11px;color:var(--wkly-muted-color);height:1.4em;margin-bottom:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.time-fields{display:grid;grid-template-columns:1fr 1fr 52px;gap:8px;padding:14px 0;border-top:1px solid var(--wkly-border-color)}.time-fields.seconds{grid-template-columns:1fr 1fr 1fr 48px}.period{display:flex;flex-direction:column;justify-content:center;gap:2px;padding-top:1.25em}.period button{font-size:.85em}.period [aria-pressed=true]{background:var(--wkly-range-color);box-shadow:inset 0 0 0 1px var(--wkly-accent-color);font-weight:700}.validation{color:var(--wkly-error-color);font-size:.85em}.validation p{margin:.5em .85em}footer{padding:12px;border-top:1px solid var(--wkly-border-color)}.confirm{background:var(--wkly-accent-color);color:var(--wkly-accent-text-color);width:100%;font-weight:650}@media (forced-colors:active){.day.selected{outline:2px solid Highlight}.range{border-bottom:2px solid Highlight}.today{outline:1px dashed CanvasText}}@media (prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;animation:none!important}}']}]}],X.ctorParameters=function(){return[{type:String,decorators:[{type:t.Inject,args:[t.LOCALE_ID]}]},{type:void 0,decorators:[{type:t.Inject,args:[q]}]},{type:void 0,decorators:[{type:t.Inject,args:[$]}]},{type:void 0,decorators:[{type:t.Inject,args:[G]}]},{type:void 0,decorators:[{type:t.Inject,args:[J]}]},{type:Object,decorators:[{type:t.Inject,args:[t.PLATFORM_ID]}]},{type:t.ElementRef},{type:t.ChangeDetectorRef}]},X.propDecorators={scroller:[{type:t.ViewChild,args:["scroller"]}]};var Q=function(){function e(e,t,i,n,r){this.resolver=e,this.injector=t,this.app=i,this.document=n,this.platform=r}return e.prototype.open=function(e,t,n,r){var o=this;if(void 0===n&&(n=!0),!i.isPlatformBrowser(this.platform))throw new Error("Picker presentations can only open in a browser");var s=this.document.createElement("dialog");s.setAttribute("aria-label","Date and time picker"),Object.assign(s.style,{padding:"0",border:"0",borderRadius:"14px",width:"min(390px, 100vw)",maxWidth:"100vw",maxHeight:"94vh",background:"transparent"});var a=this.resolver.resolveComponentFactory(X).create(r||this.injector);a.instance.presentation="transient",s.appendChild(a.location.nativeElement),this.document.body.appendChild(s),this.app.attachView(a.hostView);var l=function(e){e.preventDefault(),t("escape")},c=function(e){if(n&&e.target===s){var i=s.getBoundingClientRect();(e.clientX<i.left||e.clientX>i.right||e.clientY<i.top||e.clientY>i.bottom)&&t("backdrop")}},p=function(e){if("Tab"===e.key){var t=Array.from(s.querySelectorAll('button:not(:disabled),input:not(:disabled),[tabindex="0"]')).filter((function(e){return e.tabIndex>=0&&e.getClientRects().length&&"hidden"!==getComputedStyle(e).visibility})),i=t[0],n=t[t.length-1];i&&(e.shiftKey?o.document.activeElement===i:o.document.activeElement===n)&&(e.preventDefault(),(e.shiftKey?n:i).focus())}};return s.addEventListener("cancel",l),s.addEventListener("click",c),s.addEventListener("keydown",p),s.showModal(),{component:a,destroy:function(){s.removeEventListener("cancel",l),s.removeEventListener("click",c),s.removeEventListener("keydown",p),s.close(),o.app.detachView(a.hostView),a.destroy(),s.remove(),e.focus()}}},e}();Q.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new Q(t.ɵɵinject(t.ComponentFactoryResolver),t.ɵɵinject(t.INJECTOR),t.ɵɵinject(t.ApplicationRef),t.ɵɵinject(i.DOCUMENT),t.ɵɵinject(t.PLATFORM_ID))},token:Q,providedIn:"root"}),Q.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],Q.ctorParameters=function(){return[{type:t.ComponentFactoryResolver},{type:t.Injector},{type:t.ApplicationRef},{type:Document,decorators:[{type:t.Inject,args:[i.DOCUMENT]}]},{type:Object,decorators:[{type:t.Inject,args:[t.PLATFORM_ID]}]}]};var ee=function(e){function t(t){var i=e.call(this)||this;return i.element=t,i.ref=null,i.subscriptions=[],i.errors=[],i.change=function(){},i.touched=function(){},i.validation=function(){},i}return l(t,e),t.prototype.open=function(){var e=this;if(!this[s.WklyPickerInputsPropertyKeys.Disabled]&&!this.ref){this.ref=this.create();var t=this.ref.component.instance;this.copy(),this.subscriptions=[t[s.WklyPickerOutputsPropertyKeys.ValueChange].subscribe((function(t){e[s.WklyPickerInputsPropertyKeys.Value]=t,e.change(t),e[s.WklyPickerOutputsPropertyKeys.ValueChange].emit(t),e.display()})),t[s.WklyPickerOutputsPropertyKeys.ValidationChange].subscribe((function(t){e.errors=t,e[s.WklyPickerOutputsPropertyKeys.ValidationChange].emit(t),e.validation()})),t[s.WklyPickerOutputsPropertyKeys.Closed].subscribe((function(t){return e.close(t)})),t[s.WklyPickerOutputsPropertyKeys.ViewportChange].subscribe((function(t){return e[s.WklyPickerOutputsPropertyKeys.ViewportChange].emit(t)})),t[s.WklyPickerOutputsPropertyKeys.ViewModeChange].subscribe((function(t){return e[s.WklyPickerOutputsPropertyKeys.ViewModeChange].emit(t)}))],this.ref.component.changeDetectorRef.detectChanges(),t.focusDay(),this[s.WklyPickerOutputsPropertyKeys.Opened].emit()}},t.prototype.key=function(e){"Enter"!==e.key&&" "!==e.key&&"ArrowDown"!==e.key||(e.preventDefault(),this.open())},t.prototype.blur=function(){this.touched()},t.prototype.close=function(e){if(void 0===e&&(e="programmatic"),this.ref){var t=this.ref;this.ref=null,this.subscriptions.forEach((function(e){return e.unsubscribe()})),this.subscriptions=[],t.destroy(),this.touched(),this[s.WklyPickerOutputsPropertyKeys.Closed].emit(e)}},t.prototype.ngOnChanges=function(){var e,t=this;[s.WklyPickerInputsPropertyKeys.ShowSeconds,s.WklyPickerInputsPropertyKeys.AllowRangeAcrossDisabled,s.WklyPickerInputsPropertyKeys.Required,s.WklyPickerInputsPropertyKeys.Disabled,s.WklyPickerInputsPropertyKeys.CloseOnBackdrop].forEach((function(e){return t[e]=s.coerceBoolean(t[e])})),this.checkValue(),this.display(),this.ref&&(this.copy(),this.ref.component.instance.ngOnChanges(((e={})[s.WklyPickerInputsPropertyKeys.Value]=!0,e)),this.ref.component.changeDetectorRef.detectChanges())},t.prototype.ngOnDestroy=function(){this.close()},t.prototype.copy=function(){var e,t;if(this.ref)try{for(var i=c(s.INPUT_NAMES),n=i.next();!n.done;n=i.next()){var r=n.value;this.ref.component.instance[r]=this[r]}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}},t.prototype.display=function(){var e=this.element.nativeElement;if("INPUT"===e.tagName){e.readOnly=!0;var t=this[s.WklyPickerInputsPropertyKeys.Value];e.value=null===t?"":"string"==typeof t?t:t.join(" — "),e.disabled=this[s.WklyPickerInputsPropertyKeys.Disabled],e.setAttribute("aria-haspopup","dialog")}},t.prototype.checkValue=function(){this.errors=o.validateSelection(this[s.WklyPickerInputsPropertyKeys.Value],this,this[s.WklyPickerInputsPropertyKeys.CalendarAdapter]||new o.WklyGregorianCalendarAdapter(this[s.WklyPickerInputsPropertyKeys.Locale]||"en-US")),this[s.WklyPickerOutputsPropertyKeys.ValidationChange].emit(this.errors),this.validation()},t.prototype.writeValue=function(e){this[s.WklyPickerInputsPropertyKeys.Value]=e,this.checkValue(),this.display(),this.ref&&this.ref.component.instance.writeValue(e)},t.prototype.registerOnChange=function(e){this.change=e},t.prototype.registerOnTouched=function(e){this.touched=e},t.prototype.setDisabledState=function(e){this[s.WklyPickerInputsPropertyKeys.Disabled]=e,this.display(),this.ref&&this.ref.component.instance.setDisabledState(e)},t.prototype.validate=function(){return this.errors.length?{wkly:this.errors}:null},t.prototype.registerOnValidatorChange=function(e){this.validation=e},t.prototype.scrollToEpochDay=function(e,t){var i;this.open(),null===(i=this.ref)||void 0===i||i.component.instance.scrollToEpochDay(e,t)},t.prototype.scrollToAbsoluteWeek=function(e,t){var i;this.open(),null===(i=this.ref)||void 0===i||i.component.instance.scrollToAbsoluteWeek(e,t)},t.prototype.scrollToCalendarDate=function(e,t){var i;this.open(),null===(i=this.ref)||void 0===i||i.component.instance.scrollToCalendarDate(e,t)},t.prototype.scrollToValue=function(e,t){var i;this.open(),null===(i=this.ref)||void 0===i||i.component.instance.scrollToValue(e,t)},t}(Z);ee.decorators=[{type:t.Directive}],ee.ctorParameters=function(){return[{type:t.ElementRef}]},ee.propDecorators={open:[{type:t.HostListener,args:["click"]}],key:[{type:t.HostListener,args:["keydown",["$event"]]}],blur:[{type:t.HostListener,args:["blur"]}]};var te=function(e){function t(t,i,n){var r=e.call(this,t)||this;return r.service=i,r.triggerInjector=n,r}return l(t,e),t.prototype.create=function(){var e=this;return this.service.open(this.element.nativeElement,(function(t){return e.close(t)}),this[s.WklyPickerInputsPropertyKeys.CloseOnBackdrop],this.triggerInjector)},t}(ee);te.decorators=[{type:t.Directive,args:[{selector:"[wklyDateTimePickerDialog]",exportAs:"wklyDialog",providers:[{provide:n.NG_VALUE_ACCESSOR,useExisting:t.forwardRef((function(){return te})),multi:!0},{provide:n.NG_VALIDATORS,useExisting:t.forwardRef((function(){return te})),multi:!0}]}]}],te.ctorParameters=function(){return[{type:t.ElementRef},{type:Q},{type:t.Injector}]};var ie=function(){function e(){this.value=0,this.label="",this.hideLabel=!1,this.previousLabel="",this.nextLabel="",this.min=0,this.max=59,this.step=1,this.locale="en-US",this.disabled=!1,this.invalid=!1,this.labels=null,this.valueChange=new t.EventEmitter,this.complete=new t.EventEmitter,this.before=null,this.touchY=0,this.touchSteps=0,this.touchChanged=!1,this.typed=null,this.inputTimer=null,this.wheelTimer=null}return Object.defineProperty(e.prototype,"display",{get:function(){return null!==this.typed?this.typed:null===this.value?"":this.labels?this.labels[this.value-this.min]||String(this.value):new Intl.NumberFormat(this.locale,{useGrouping:!1,minimumIntegerDigits:this.max<60?2:1}).format(this.value)},enumerable:!1,configurable:!0}),e.prototype.ngOnChanges=function(e){if(e.value&&this.min<0&&null!==this.typed){var t=""===this.typed||"-"===this.typed?null:Number(this.typed);this.value!==t&&(this.cancelInput(),this.typed=null)}},e.prototype.ngOnDestroy=function(){this.cancelInput(),null!==this.wheelTimer&&clearTimeout(this.wheelTimer)},e.prototype.next=function(e){var t=Math.floor((this.max-this.min)/this.step)+1;return this.min+r.floorMod(Math.floor(((null===this.value?this.min:this.value)-this.min)/this.step)+e,t)*this.step},e.prototype.neighbor=function(e){var t=this.next(e);return this.labels?this.labels[t-this.min]||"":new Intl.NumberFormat(this.locale,{useGrouping:!1}).format(t)},e.prototype.stepBy=function(e){this.disabled||(this.scrollBy(e),this.complete.emit())},e.prototype.begin=function(e){this.before=this.value,e.target.select()},e.prototype.type=function(e){var t=this;if(!this.disabled){var i=e.target,n=i.value,r=Array.from(n).every((function(e){return 1===o.normalizeDigits(e).length}));if(this.min<0&&!this.labels){var s=n.replace(/[\u200e\u200f\u061c]/g,"").replace(/\u2212/g,"-"),a=o.normalizeDigits(s);this.typed=i.value=(s.startsWith("-")?"-":"")+a,this.value=""===a?null:Math.max(this.min,Math.min(this.max,Number(this.typed))),null!==this.value&&Number(this.typed)!==this.value&&(this.typed=i.value=String(this.value))}else if(r){var l=o.normalizeDigits(n);this.typed=i.value=this.min>=0&&this.max<100?l.slice(-2):l,this.value=""===this.typed?null:Number(this.typed)}else if(this.labels){var c=n.trim().toLocaleLowerCase(this.locale);this.typed=n;var p=this.labels.map((function(e,t){return{label:e,index:t}})).filter((function(e){return e.label.toLocaleLowerCase(t.locale).includes(c)}));this.value=1===p.length?this.min+p[0].index:null}else this.typed=i.value=o.normalizeDigits(n),this.value=""===this.typed?null:Number(this.typed);this.valueChange.emit(this.value),this.cancelInput(),!r&&this.labels&&null!==this.value&&this.complete.emit(),this.inputTimer=setTimeout((function(){t.inputTimer=null,t.typed=null,t.disabled||t.complete.emit()}),1e3)}},e.prototype.key=function(e){"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),this.cancelInput(),this.typed=null,this.value=this.before,this.valueChange.emit(this.before),e.target.value=this.display,e.target.blur()),"Enter"===e.key&&(e.preventDefault(),e.stopPropagation(),this.finish());var t="ArrowUp"===e.key?-1:"ArrowDown"===e.key?1:"PageUp"===e.key?-5:"PageDown"===e.key?5:0;t&&(e.preventDefault(),this.stepBy(t))},e.prototype.finish=function(){this.cancelInput(),this.typed=null,this.complete.emit()},e.prototype.wheel=function(e){var t=this;this.disabled||Math.abs(e.deltaY)<1||(e.preventDefault(),this.scrollBy(e.deltaY>0?1:-1),null!==this.wheelTimer&&clearTimeout(this.wheelTimer),this.wheelTimer=setTimeout((function(){t.wheelTimer=null,t.complete.emit()}),140))},e.prototype.touchStart=function(e){this.touchY=e.touches[0].clientY,this.touchSteps=0,this.touchChanged=!1},e.prototype.touchMove=function(e){this.applyTouchY(e.touches[0].clientY)},e.prototype.touchEnd=function(e){this.applyTouchY(e.changedTouches[0].clientY),this.touchChanged&&this.complete.emit(),this.touchChanged=!1},e.prototype.cancelInput=function(){null!==this.inputTimer&&clearTimeout(this.inputTimer),this.inputTimer=null},e.prototype.scrollBy=function(e){!this.disabled&&e&&(this.cancelInput(),this.typed=null,this.value=this.next(e),this.valueChange.emit(this.value))},e.prototype.applyTouchY=function(e){if(!this.disabled){var t=this.touchY-e,i=Math.abs(t)>16?Math.sign(t)*Math.max(1,Math.round(Math.abs(t)/40)):0,n=i-this.touchSteps;n&&(this.scrollBy(n),this.touchSteps=i,this.touchChanged=!0)}},e}();ie.decorators=[{type:t.Component,args:[{selector:"wkly-field",template:'<div\n class="field"\n (wheel)="wheel($event)"\n (touchstart)="touchStart($event)"\n (touchmove)="touchMove($event)"\n (touchend)="touchEnd($event)"\n (touchcancel)="touchEnd($event)"\n>\n <span *ngIf="!hideLabel" class="label">{{ label }}</span>\n <button\n type="button"\n [disabled]="disabled"\n [attr.aria-label]="previousLabel || label + \': previous\'"\n (click)="stepBy(-1)"\n >\n {{ neighbor(-1) }}\n </button>\n <input\n [attr.aria-label]="label"\n [attr.aria-invalid]="invalid"\n [disabled]="disabled"\n [value]="display"\n [attr.inputmode]="labels ? \'text\' : min < 0 ? \'text\' : \'numeric\'"\n autocomplete="off"\n (focus)="begin($event)"\n (input)="type($event)"\n (blur)="finish()"\n (keydown)="key($event)"\n />\n <button\n type="button"\n [disabled]="disabled"\n [attr.aria-label]="nextLabel || label + \': next\'"\n (click)="stepBy(1)"\n >\n {{ neighbor(1) }}\n </button>\n</div>\n',styles:[".field{display:flex;flex-direction:column;align-items:stretch;min-width:0;text-align:center;touch-action:pan-x}.label{font-size:11px;color:var(--wkly-muted-color,#54616e);margin-bottom:4px}button,input{font:inherit;box-sizing:border-box;min-height:44px;width:100%;border:0;text-align:center;background:transparent;color:inherit;border-radius:7px}button{color:var(--wkly-muted-color,#54616e);cursor:pointer}input{font-size:18px;font-weight:650;background:var(--wkly-range-color,#e5f1ee);border-block:2px solid var(--wkly-accent-color,#176c55)}input[aria-invalid=true]{border-color:var(--wkly-error-color,#b42318)}:focus-visible{outline:2px solid var(--wkly-focus-color,#124ee0);outline-offset:1px}button:disabled,input:disabled{opacity:.45}@media (hover:hover) and (pointer:fine){button:hover:not(:disabled){background:var(--wkly-range-color,#e5f1ee)}}"]}]}],ie.propDecorators={value:[{type:t.Input}],label:[{type:t.Input}],hideLabel:[{type:t.Input}],previousLabel:[{type:t.Input}],nextLabel:[{type:t.Input}],min:[{type:t.Input}],max:[{type:t.Input}],step:[{type:t.Input}],locale:[{type:t.Input}],disabled:[{type:t.Input}],invalid:[{type:t.Input}],labels:[{type:t.Input}],valueChange:[{type:t.Output}],complete:[{type:t.Output}]};var ne=function(){};ne.decorators=[{type:t.NgModule,args:[{imports:[i.CommonModule],declarations:[X,te,ie],entryComponents:[X],exports:[X,te]}]}],Object.keys(s).forEach((function(t){"default"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return s[t]}})})),e.WKLY_CLOCK=$,e.WKLY_CONFIG=q,e.WKLY_LOCALIZATION=G,e.WKLY_TRANSLATIONS=J,e.WklyDateTimePickerComponent=X,e.WklyDateTimePickerDialogDirective=te,e.WklyDateTimePickerDialogService=Q,e.WklyDateTimePickerModule=ne,e.WklyFieldComponent=ie,e.WklyPickerInputs=Z,e.WklyTriggerBase=ee,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
2
2
|
//# sourceMappingURL=wkly-datetime-picker.umd.min.js.map
|