@ionic/core 9.0.14 → 9.0.15-nightly.20261126

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.
Files changed (82) hide show
  1. package/components/index.js +1 -1
  2. package/components/ion-action-sheet.js +1 -1
  3. package/components/ion-alert.js +1 -1
  4. package/components/ion-content.js +1 -1
  5. package/components/ion-datetime.js +1 -1
  6. package/components/ion-loading.js +1 -1
  7. package/components/ion-menu.js +1 -1
  8. package/components/ion-modal.js +1 -1
  9. package/components/ion-popover.js +1 -1
  10. package/components/ion-select-modal.js +1 -1
  11. package/components/ion-select-popover.js +1 -1
  12. package/components/ion-select.js +1 -1
  13. package/components/ion-toast.js +1 -1
  14. package/components/{p-CB9IiUSo.js → p-8KzDdVGg.js} +1 -1
  15. package/components/{p-DRTHzs2D.js → p-B3sthsuC.js} +1 -1
  16. package/components/{p-C-egLJs7.js → p-B9WD9GEd.js} +1 -1
  17. package/components/{p-vU3qJ6VA.js → p-BG4RtAZT.js} +1 -1
  18. package/components/p-BI0fCetH.js +4 -0
  19. package/components/{p-DCqB6VKV.js → p-CATz3x_G.js} +1 -1
  20. package/components/p-CkGvoxlv.js +4 -0
  21. package/components/{p-Dnw1qYup.js → p-Cot8b0Ud.js} +1 -1
  22. package/components/{p-dQRWGlyU.js → p-Dc297fYS.js} +1 -1
  23. package/dist/cjs/{index-CuWyDtHj.js → index-DeuODCYU.js} +1 -1
  24. package/dist/cjs/index.cjs.js +2 -2
  25. package/dist/cjs/ion-action-sheet.cjs.entry.js +2 -2
  26. package/dist/cjs/ion-alert.cjs.entry.js +7 -5
  27. package/dist/cjs/ion-app_8.cjs.entry.js +2 -2
  28. package/dist/cjs/ion-datetime.cjs.entry.js +1 -1
  29. package/dist/cjs/ion-loading.cjs.entry.js +2 -2
  30. package/dist/cjs/ion-menu_3.cjs.entry.js +2 -2
  31. package/dist/cjs/ion-modal.cjs.entry.js +2 -2
  32. package/dist/cjs/ion-popover.cjs.entry.js +2 -2
  33. package/dist/cjs/ion-select-modal.cjs.entry.js +1 -1
  34. package/dist/cjs/ion-select_3.cjs.entry.js +1 -1
  35. package/dist/cjs/ion-toast.cjs.entry.js +6 -4
  36. package/dist/cjs/{overlay-focus-boundary-D9-g1MNP.js → overlay-focus-boundary-ChtKRiQh.js} +1 -1
  37. package/dist/cjs/{overlays-DGefLyN2.js → overlays-DQ_xxwyU.js} +30 -0
  38. package/dist/collection/components/alert/alert.js +6 -4
  39. package/dist/collection/components/toast/toast.js +6 -4
  40. package/dist/collection/utils/overlays.js +29 -0
  41. package/dist/docs.json +1 -1
  42. package/dist/esm/{index-C_t3NkxF.js → index-BcYECvUu.js} +1 -1
  43. package/dist/esm/index.js +2 -2
  44. package/dist/esm/ion-action-sheet.entry.js +2 -2
  45. package/dist/esm/ion-alert.entry.js +7 -5
  46. package/dist/esm/ion-app_8.entry.js +2 -2
  47. package/dist/esm/ion-datetime.entry.js +1 -1
  48. package/dist/esm/ion-loading.entry.js +2 -2
  49. package/dist/esm/ion-menu_3.entry.js +2 -2
  50. package/dist/esm/ion-modal.entry.js +2 -2
  51. package/dist/esm/ion-popover.entry.js +2 -2
  52. package/dist/esm/ion-select-modal.entry.js +1 -1
  53. package/dist/esm/ion-select_3.entry.js +1 -1
  54. package/dist/esm/ion-toast.entry.js +6 -4
  55. package/dist/esm/{overlay-focus-boundary-C04QMmsL.js → overlay-focus-boundary-Y7bUWprL.js} +1 -1
  56. package/dist/esm/{overlays-IKvNe-3C.js → overlays-eLEPzRwt.js} +30 -1
  57. package/dist/ionic/index.esm.js +1 -1
  58. package/dist/ionic/ionic.esm.js +1 -1
  59. package/dist/ionic/{p-2af6e96d.entry.js → p-12390e17.entry.js} +1 -1
  60. package/dist/ionic/{p-9d18ce91.entry.js → p-14c5aaaf.entry.js} +1 -1
  61. package/dist/ionic/{p-17f1bb8d.entry.js → p-26830217.entry.js} +1 -1
  62. package/dist/ionic/{p-57eb421d.entry.js → p-3359e788.entry.js} +1 -1
  63. package/dist/ionic/p-5b6e4b8f.entry.js +4 -0
  64. package/dist/ionic/{p-84c4684b.entry.js → p-8bbbce87.entry.js} +1 -1
  65. package/dist/ionic/{p-95e63cdc.entry.js → p-91c95a24.entry.js} +1 -1
  66. package/dist/ionic/p-9ec0ef9a.entry.js +4 -0
  67. package/dist/ionic/{p-CDg1wDHC.js → p-CbBiIQxG.js} +1 -1
  68. package/dist/ionic/{p-Bywjvc3Y.js → p-DXP3e75r.js} +1 -1
  69. package/dist/ionic/{p-e760443e.entry.js → p-c3cd03d0.entry.js} +1 -1
  70. package/dist/ionic/{p-29e158ee.entry.js → p-cf171eff.entry.js} +1 -1
  71. package/dist/ionic/{p-B-J0WNxH.js → p-e91gX-0O.js} +1 -1
  72. package/dist/ionic/{p-661c34d1.entry.js → p-f5af160c.entry.js} +1 -1
  73. package/dist/types/components/alert/alert.d.ts +1 -0
  74. package/dist/types/components/toast/toast.d.ts +1 -0
  75. package/dist/types/utils/overlays.d.ts +12 -0
  76. package/hydrate/index.js +39 -6
  77. package/hydrate/index.mjs +39 -6
  78. package/package.json +1 -1
  79. package/components/p-C46T-8zV.js +0 -4
  80. package/components/p-CdDNVOXF.js +0 -4
  81. package/dist/ionic/p-62b7db81.entry.js +0 -4
  82. package/dist/ionic/p-81a842f7.entry.js +0 -4
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * (C) Ionic http://ionicframework.com - MIT License
3
3
  */
4
- import{c as t,a as e,r as a,d as i,w as n,i as o,h as r,f as s,g as d}from"./p-BChJkQUV.js";import{startFocusVisible as l}from"./p-BmVRXR1y.js";import{r as h,g as c,a as p}from"./p-CADDaXTY.js";import{F as m}from"./p-Bywjvc3Y.js";import{i as y}from"./p-Dj4J3LkD.js";import{c as u}from"./p-byZM6qHV.js";import{b,d as g,e as x,f,c as v}from"./p-ByzJUXRA.js";import{b as w}from"./p-lyN9SGmn.js";import{r as k,g as C,a as P,b as D,c as $,d as j,e as z,f as T,h as A,i as O,j as V,k as I,l as S,m as M,n as W,o as E,p as B,v as R,q as L,s as F,t as G,u as H,w as U,x as q,y as Z,z as J,A as Y,B as N,C as Q,D as X,E as _,F as K,G as tt,H as et,I as at,J as it,K as nt,L as ot,M as rt,N as st,O as dt,P as lt,Q as ht}from"./p-4pBCJlqh.js";import"./p-DvQi_1Am.js";import"./p-B_gJaBk0.js";const ct=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59],pt=[0,1,2,3,4,5,6,7,8,9,10,11],mt=[0,1,2,3,4,5,6,7,8,9,10,11],yt=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23],ut=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,0],bt=(t,e,a="h12",i,n,o,r)=>{const s=j(t,a),d=M(s);let l=(t=>{switch(t){case"h11":return pt;case"h12":return mt;case"h23":return yt;case"h24":return ut;default:throw new Error(`Invalid hour cycle "${t}"`)}})(s),h=ct,c=!0,p=!0;if(o&&(l=l.filter((t=>o.includes(t)))),r&&(h=h.filter((t=>r.includes(t)))),i)if(I(e,i)){if(void 0!==i.hour&&(l=l.filter((t=>(d?t:"pm"===e.ampm?(t+12)%24:t)>=i.hour)),c=i.hour<13),void 0!==i.minute){let t=!1;void 0!==i.hour&&void 0!==e.hour&&e.hour>i.hour&&(t=!0),h=h.filter((e=>!!t||e>=i.minute))}}else V(e,i)&&(l=[],h=[],c=p=!1);return n&&(I(e,n)?(void 0!==n.hour&&(l=l.filter((t=>(d?t:"pm"===e.ampm?(t+12)%24:t)<=n.hour)),p=n.hour>=12),void 0!==n.minute&&e.hour===n.hour&&(h=h.filter((t=>t<=n.minute)))):S(e,n)&&(l=[],h=[],c=p=!1)),{hours:l,minutes:h,am:c,pm:p}},gt=(t,e)=>{const a={month:t.month,year:t.year,day:t.day};if(void 0!==e&&(t.month!==e.month||t.year!==e.year)){const i={month:e.month,year:e.year,day:e.day};return V(i,a)?[i,a,C(t)]:[P(t),a,i]}return[P(t),a,C(t)]},xt=(t,e,a,i,n,o={day:"numeric"})=>{const{month:r,year:s}=e,d=[],l=W(r,s),h=null!=i?.day&&i.year===s&&i.month===r?i.day:l,c=null!=a?.day&&a.year===s&&a.month===r?a.day:1;if(void 0!==n){let e=n;e=e.filter((t=>t>=c&&t<=h)),e.forEach((e=>{const a=new Date(`${r}/${e}/${s} GMT+0000`),i=new Intl.DateTimeFormat(t,{...o,timeZone:"UTC"}).format(a);d.push({text:i,value:e})}))}else for(let e=c;e<=h;e++){const a=new Date(`${r}/${e}/${s} GMT+0000`),i=new Intl.DateTimeFormat(t,{...o,timeZone:"UTC"}).format(a);d.push({text:i,value:e})}return d},ft=(t,e)=>t.month===e.month&&t.year===e.year?[t]:[t,...ft(C(t),e)],vt=(t,e,a,i)=>null===t.day||void 0!==i&&!i.includes(t.day)||!(!e||!V(t,e))||!(!a||!S(t,a)),wt=(t,e,a,i,n,o,r)=>{const s=void 0!==(Array.isArray(a)?a:[a]).find((t=>I(e,t))),d=I(e,i);return{disabled:vt(e,n,o,r),isActive:s,isToday:d,ariaSelected:s?"true":null,ariaLabel:B(t,d,e),text:null!=e.day?E(t,e):null}},kt=(t,{minParts:e,maxParts:a})=>!!((t,e,a)=>!!(e&&e.year>t)||!!(a&&a.year<t))(t.year,e,a)||!!(e&&V(t,e)||a&&S(t,a)),Ct=(t,a)=>{(a?.date?.timeZone||a?.date?.timeZoneName||a?.time?.timeZone||a?.time?.timeZoneName)&&e('[ion-datetime] - "timeZone" and "timeZoneName" are not supported in "formatOptions".',t)},Pt=(t,a,i)=>{if(i)switch(a){case"date":case"month-year":case"month":case"year":void 0===i.date&&e(`[ion-datetime] - The '${a}' presentation requires a date object in formatOptions.`,t);break;case"time":void 0===i.time&&e("[ion-datetime] - The 'time' presentation requires a time object in formatOptions.",t);break;case"date-time":case"time-date":void 0===i.date&&void 0===i.time&&e(`[ion-datetime] - The '${a}' presentation requires either a date or time object (or both) in formatOptions.`,t)}},Dt=class{constructor(t){new.target===Dt&&a(this,t),this.ionCancel=i(this,"ionCancel",7),this.ionChange=i(this,"ionChange",7),this.ionValueChange=i(this,"ionValueChange",7),this.ionFocus=i(this,"ionFocus",7),this.ionBlur=i(this,"ionBlur",7),this.ionStyle=i(this,"ionStyle",7),this.ionRender=i(this,"ionRender",7),this.inputId="ion-dt-"+$t++,this.hasUnconfirmedSelection=!1,this.prevPresentation=null,this.showMonthAndYear=!1,this.activeParts=[],this.workingParts={month:5,day:28,year:2021,hour:13,minute:52,ampm:"pm",isAdjacentDay:!1},this.isTimePopoverOpen=!1,this.name=this.inputId,this.disabled=!1,this.readonly=!1,this.showAdjacentDays=!1,this.presentation="date-time",this.cancelText="Cancel",this.doneText="Done",this.clearText="Clear",this.locale="default",this.firstDayOfWeek=0,this.multiple=!1,this.showDefaultTitle=!1,this.showDefaultButtons=!1,this.showClearButton=!1,this.showDefaultTimeLabel=!0,this.size="fixed",this.preferWheel=!1,this.warnIfIncorrectValueUsage=()=>{const{multiple:t,value:a}=this;!t&&Array.isArray(a)&&e(`[ion-datetime] - An array of values was passed, but multiple is "false". This is incorrect usage and may result in unexpected behaviors. To dismiss this warning, pass a string to the "value" property when multiple="false".\n\n Value Passed: [${a.map((t=>`'${t}'`)).join(", ")}]\n`,this.el)},this.setValue=t=>{this.value=t,this.ionChange.emit({value:t})},this.getActivePartsWithFallback=()=>{const{defaultParts:t}=this;return this.getActivePart()??t},this.getActivePart=()=>{const{activeParts:t}=this;return Array.isArray(t)?t[0]:t},this.closeParentOverlay=t=>{const e=this.el.closest("ion-modal, ion-popover");return e&&e.dismiss(void 0,t),null!==e},this.setWorkingParts=t=>{this.workingParts={...t}},this.setActiveParts=(t,e=!1)=>{if(this.readonly)return;this.hasUnconfirmedSelection=!0;const{multiple:a,minParts:i,maxParts:n,activeParts:o}=this,r=R(t,i,n);if(this.setWorkingParts(r),a){const t=Array.isArray(o)?o:[o];this.activeParts=e?t.filter((t=>!I(t,r))):[...t,r]}else this.activeParts={...r};null!==this.el.querySelector('[slot="buttons"]')||this.showDefaultButtons||this.confirm()},this.initializeKeyboardListeners=()=>{const t=this.calendarBodyRef;if(!t)return;const e=this.el.shadowRoot,a=t.querySelector(".calendar-month:nth-of-type(2)"),i=new MutationObserver((e=>{const i=e[0];!i.oldValue?.includes("ion-focused")&&t.classList.contains("ion-focused")&&this.focusWorkingDay(a)}));i.observe(t,{attributeFilter:["class"],attributeOldValue:!0}),this.destroyKeyboardMO=()=>{i?.disconnect()},t.addEventListener("keydown",(t=>{const i=e.activeElement;if(!i||!i.classList.contains("calendar-day"))return;const n=L(i);let o;switch(t.key){case"ArrowDown":t.preventDefault(),o=Y(n);break;case"ArrowUp":t.preventDefault(),o=J(n);break;case"ArrowRight":t.preventDefault(),o=Z(n);break;case"ArrowLeft":t.preventDefault(),o=q(n);break;case"Home":t.preventDefault(),o=U(n);break;case"End":t.preventDefault(),o=H(n);break;case"PageUp":t.preventDefault(),o=t.shiftKey?G(n):P(n);break;case"PageDown":t.preventDefault(),o=t.shiftKey?F(n):C(n);break;default:return}vt(o,this.minParts,this.maxParts)||(this.setWorkingParts({...this.workingParts,...o}),requestAnimationFrame((()=>this.focusWorkingDay(a))))}))},this.focusWorkingDay=t=>{const{day:e,month:a,year:i}=this.workingParts,n=new Date(`${a}/1/${i}`).getDay();if(null===e)return;const o=t.querySelector(`.calendar-day-wrapper:nth-of-type(${(n>=this.firstDayOfWeek?n-this.firstDayOfWeek:7-(this.firstDayOfWeek-n))+e}) .calendar-day`);o&&o.focus()},this.processMinParts=()=>{const{min:t,defaultParts:e}=this;this.minParts=void 0!==t?N(t,e):void 0},this.processMaxParts=()=>{const{max:t,defaultParts:e}=this;this.maxParts=void 0!==t?Q(t,e):void 0},this.initializeCalendarListener=()=>{const t=this.calendarBodyRef;if(!t)return;const e=t.querySelectorAll(".calendar-month"),a=e[0],i=e[1],o=e[2],r="ios"===w(this)&&"undefined"!=typeof navigator&&navigator.maxTouchPoints>1;n((()=>{t.scrollLeft=a.clientWidth*(y(this.el)?-1:1);const e=e=>{const i=t.getBoundingClientRect(),n=(y(this.el)?t.scrollLeft>=-2:t.scrollLeft<=2)?a:o,r=n.getBoundingClientRect();if(Math.abs(r.x-i.x)>2)return;const{forceRenderDate:s}=this;return void 0!==s?{month:s.month,year:s.year,day:s.day}:n===a?P(e):n===o?C(e):void 0},s=()=>{r&&(t.style.removeProperty("pointer-events"),l=!1);const a=e(this.workingParts);if(!a)return;const{month:o,day:s,year:d}=a;kt({month:o,year:d,day:null},{minParts:{...this.minParts,day:null},maxParts:{...this.maxParts,day:null}})||(t.style.setProperty("overflow","hidden"),n((()=>{this.setWorkingParts({...this.workingParts,month:o,day:s,year:d}),t.scrollLeft=i.clientWidth*(y(this.el)?-1:1),t.style.removeProperty("overflow"),this.resolveForceDateScrolling&&this.resolveForceDateScrolling();const e=this.el.shadowRoot.activeElement;e&&e.classList.contains("calendar-day")&&e.closest(".calendar-body")?.focus()})))};let d,l=!1;const h=()=>{d&&clearTimeout(d),!l&&r&&(t.style.setProperty("pointer-events","none"),l=!0),d=setTimeout(s,50)};t.addEventListener("scroll",h),this.destroyCalendarListener=()=>{t.removeEventListener("scroll",h)}}))},this.destroyInteractionListeners=()=>{const{destroyCalendarListener:t,destroyKeyboardMO:e}=this;void 0!==t&&t(),void 0!==e&&e()},this.ensureReadyIfVisible=()=>{this.el.classList.contains("datetime-ready")||this.hasLayoutBox()&&this.markReady()},this.hasLayoutBox=()=>{const{width:t,height:e}=this.el.getBoundingClientRect();return t>0&&e>0},this.markReady=()=>{this.el.classList.contains("datetime-ready")||(this.initializeListeners(),n((()=>{this.el.classList.add("datetime-ready")})))},this.loadTimeoutCleanup=()=>{this.loadTimeout&&(clearTimeout(this.loadTimeout),this.loadTimeout=void 0)},this.processValue=(t,e=!0)=>{this.hasUnconfirmedSelection=!1;const a=null!=t&&""!==t&&(!Array.isArray(t)||t.length>0),i=a?X(t):this.defaultParts,{minParts:n,maxParts:o,workingParts:r,el:s}=this;if(this.warnIfIncorrectValueUsage(),!i)return;a&&_(i,n,o);const d=Array.isArray(i)?i[i.length-1]:i,l=tt(d,n,o),{month:h,day:c,year:p,hour:m,minute:y}=l,u=K(m);this.activeParts=a?Array.isArray(i)?[...i]:{month:h,day:c,year:p,hour:m,minute:y,ampm:u}:[];const b=void 0!==h&&h!==r.month||void 0!==p&&p!==r.year,g=s.classList.contains("datetime-ready"),{isGridStyle:x,showMonthAndYear:f}=this;x&&b&&g&&!f&&e?this.animateToDate(l):this.setWorkingParts({month:h,day:c,year:p,hour:m,minute:y,ampm:u})},this.animateToDate=async t=>{const{workingParts:e}=this;this.forceRenderDate=t;const a=new Promise((t=>{this.resolveForceDateScrolling=t}));V(t,e)?this.prevMonth():this.nextMonth(),await a,this.resolveForceDateScrolling=void 0,this.forceRenderDate=void 0},this.onFocus=()=>{this.ionFocus.emit()},this.onBlur=()=>{this.ionBlur.emit()},this.hasValue=()=>null!=this.value,this.nextMonth=()=>{const t=this.calendarBodyRef;if(!t)return;const e=t.querySelector(".calendar-month:last-of-type");if(!e)return;const a=2*e.offsetWidth,i=o.getBoolean("animated",!0)?"smooth":"instant";t.scrollTo({top:0,left:a*(y(this.el)?-1:1),behavior:i})},this.prevMonth=()=>{const t=this.calendarBodyRef;if(!t)return;const e=t.querySelector(".calendar-month:first-of-type");if(!e)return;const a=2*e.offsetWidth,i=o.getBoolean("animated",!0)?"smooth":"instant";t.scrollTo({top:0,left:a*(y(this.el)?1:-1),behavior:i})},this.toggleMonthAndYearView=()=>{this.showMonthAndYear=!this.showMonthAndYear}}formatOptionsChanged(){const{el:t,formatOptions:e,presentation:a}=this;Pt(t,a,e),Ct(t,e)}disabledChanged(){this.emitStyle()}minChanged(){this.processMinParts()}maxChanged(){this.processMaxParts()}presentationChanged(){const{el:t,formatOptions:e,presentation:a}=this;Pt(t,a,e)}get isGridStyle(){const{presentation:t,preferWheel:e}=this;return("date"===t||"date-time"===t||"time-date"===t)&&!e}yearValuesChanged(){this.parsedYearValues=et(this.yearValues)}monthValuesChanged(){this.parsedMonthValues=et(this.monthValues)}dayValuesChanged(){this.parsedDayValues=et(this.dayValues)}hourValuesChanged(){this.parsedHourValues=et(this.hourValues)}minuteValuesChanged(){this.parsedMinuteValues=et(this.minuteValues)}async valueChanged(){const{value:t}=this;this.hasValue()&&this.processValue(t),this.emitStyle(),this.ionValueChange.emit({value:t})}async confirm(t=!1){const{isCalendarPicker:e,activeParts:a,preferWheel:i,workingParts:n}=this;if(void 0!==a||!e){const t=Array.isArray(a);this.setValue(t&&0===a.length?i?at(n):void 0:at(a))}this.hasUnconfirmedSelection=!1,t&&this.closeParentOverlay(zt)}async reset(t){this.processValue(t)}async cancel(t=!1){this.ionCancel.emit(),t&&this.closeParentOverlay(jt)||this.processValue(this.value)}async getDefaultPart(){return this.defaultParts}get isCalendarPicker(){const{presentation:t}=this;return"date"===t||"date-time"===t||"time-date"===t}connectedCallback(){this.clearFocusVisible=l(this.el).destroy,this.loadTimeout=setTimeout((()=>{this.ensureReadyIfVisible()}),100),this.initializeOverlayPresentListener()}disconnectedCallback(){this.clearFocusVisible&&(this.clearFocusVisible(),this.clearFocusVisible=void 0),this.loadTimeoutCleanup(),this.destroyOverlayPresentListener&&(this.destroyOverlayPresentListener(),this.destroyOverlayPresentListener=void 0)}initializeOverlayPresentListener(){const t=this.el.closest("ion-modal, ion-popover");if(!t)return;const e="ION-MODAL"===t.tagName?"ionModalWillPresent":"ionPopoverWillPresent",a=e=>{e.target===t&&this.hasUnconfirmedSelection&&this.processValue(this.value,!1)};t.addEventListener(e,a),this.destroyOverlayPresentListener=()=>t.removeEventListener(e,a)}initializeListeners(){this.initializeCalendarListener(),this.initializeKeyboardListeners()}componentDidLoad(){const{el:t,intersectionTrackerRef:e}=this,a=new IntersectionObserver((t=>{t[t.length-1].isIntersecting&&this.markReady()}),{threshold:.01,root:t});h((()=>a?.observe(e))),this.loadTimeoutCleanup(),this.loadTimeout=setTimeout((()=>{this.ensureReadyIfVisible()}),100);const i=new IntersectionObserver((t=>{t[t.length-1].isIntersecting||this.hasLayoutBox()||(this.destroyInteractionListeners(),this.showMonthAndYear=!1,n((()=>{this.el.classList.remove("datetime-ready")})))}),{threshold:0,root:t});h((()=>i?.observe(e)));const o=c(this.el);o.addEventListener("ionFocus",(t=>t.stopPropagation())),o.addEventListener("ionBlur",(t=>t.stopPropagation()))}componentDidRender(){const{presentation:t,prevPresentation:e,calendarBodyRef:a,minParts:i,preferWheel:n,forceRenderDate:o}=this,r=!n&&["date-time","time-date","date"].includes(t);if(void 0!==i&&r&&a){const t=a.querySelector(".calendar-month:nth-of-type(1)");t&&void 0===o&&(a.scrollLeft=t.clientWidth*(y(this.el)?-1:1))}null!==e?t!==e&&(this.prevPresentation=t,this.destroyInteractionListeners(),this.initializeListeners(),this.showMonthAndYear=!1,h((()=>{this.ionRender.emit()}))):this.prevPresentation=t}componentWillLoad(){const{el:t,formatOptions:a,highlightedDates:i,multiple:n,presentation:o,preferWheel:r}=this;n&&("date"!==o&&e('[ion-datetime] - Multiple date selection is only supported for presentation="date".',t),r&&e('[ion-datetime] - Multiple date selection is not supported with preferWheel="true".',t)),void 0!==i&&("date"!==o&&"date-time"!==o&&"time-date"!==o&&e("[ion-datetime] - The highlightedDates property is only supported with the date, date-time, and time-date presentations.",t),r&&e('[ion-datetime] - The highlightedDates property is not supported with preferWheel="true".',t)),a&&(Pt(t,o,a),Ct(t,a));const s=this.parsedHourValues=et(this.hourValues),d=this.parsedMinuteValues=et(this.minuteValues),l=this.parsedMonthValues=et(this.monthValues),h=this.parsedYearValues=et(this.yearValues),c=this.parsedDayValues=et(this.dayValues),p=this.todayParts=X(k(new Date).toISOString());this.processMinParts(),this.processMaxParts(),this.defaultParts=it({refParts:p,monthValues:l,dayValues:c,yearValues:h,hourValues:s,minuteValues:d,minParts:this.minParts,maxParts:this.maxParts}),this.processValue(this.value),this.emitStyle()}emitStyle(){this.ionStyle.emit({interactive:!0,datetime:!0,"interactive-disabled":this.disabled})}renderFooter(){const{disabled:t,readonly:e,showDefaultButtons:a,showClearButton:i}=this,n=t||e;if(null===this.el.querySelector('[slot="buttons"]')&&!a&&!i)return;const o=()=>{this.reset(),this.setValue(void 0)};return r("div",{class:"datetime-footer"},r("div",{class:"datetime-buttons"},r("div",{class:{"datetime-action-buttons":!0,"has-clear-button":this.showClearButton}},r("slot",{name:"buttons"},r("ion-buttons",null,a&&r("ion-button",{id:"cancel-button",color:this.color,onClick:()=>this.cancel(!0),disabled:n},this.cancelText),r("div",{class:"datetime-action-buttons-container"},i&&r("ion-button",{id:"clear-button",color:this.color,onClick:()=>o(),disabled:n},this.clearText),a&&r("ion-button",{id:"confirm-button",color:this.color,onClick:()=>this.confirm(!0),disabled:n},this.doneText)))))))}renderWheelPicker(t=this.presentation){const e="time-date"===t?[this.renderTimePickerColumns(t),this.renderDatePickerColumns(t)]:[this.renderDatePickerColumns(t),this.renderTimePickerColumns(t)];return r("ion-picker",{class:m},e)}renderDatePickerColumns(t){return"date-time"===t||"time-date"===t?this.renderCombinedDatePickerColumn():this.renderIndividualDatePickerColumns(t)}renderCombinedDatePickerColumn(){const{defaultParts:e,disabled:a,workingParts:i,locale:n,minParts:o,maxParts:s,todayParts:d,isDateEnabled:l}=this,h=gt(i),c=h[h.length-1];h[0].day=1,c.day=W(c.month,c.year);const p=((t,e,a,i,n,o)=>{let r=[],s=[],d=ft(a,i);return o&&(d=d.filter((({month:t})=>o.includes(t)))),d.forEach((o=>{const d={month:o.month,day:null,year:o.year},l=xt(t,d,a,i,n,{month:"short",day:"numeric",weekday:"short"}),h=[],c=[];l.forEach((a=>{const i=I({...d,day:a.value},e);c.push({text:i?D(t):a.text,value:`${d.year}-${d.month}-${a.value}`}),h.push({month:d.month,year:d.year,day:a.value})})),s=[...s,...h],r=[...r,...c]})),{parts:s,items:r}})(n,d,void 0!==o&&S(o,h[0])?o:h[0],void 0!==s&&V(s,c)?s:c,this.parsedDayValues,this.parsedMonthValues);let m=p.items;const y=p.parts;l&&(m=m.map(((e,a)=>{const i=y[a];let n;try{n=!l(at(i))}catch(e){t("[ion-datetime] - Exception thrown from provided `isDateEnabled` function. Please check your function and try again.",e)}return{...e,disabled:n}})));const u=null!==i.day?`${i.year}-${i.month}-${i.day}`:`${e.year}-${e.month}-${e.day}`;return r("ion-picker-column",{part:Tt,"aria-label":"Select a date",class:"date-column",color:this.color,disabled:a,value:u,onIonChange:t=>{const{value:e}=t.detail,a=y.find((({month:t,day:a,year:i})=>e===`${i}-${t}-${a}`)),i=this.getActivePartsWithFallback();this.setWorkingParts({...this.workingParts,...a}),this.setActiveParts({...i,...a}),t.stopPropagation()}},m.map((t=>r("ion-picker-column-option",{color:this.color,part:t.value===u?`${At} ${Ot}`:At,key:t.value,disabled:t.disabled,value:t.value},t.text))))}renderIndividualDatePickerColumns(e){const{workingParts:a,isDateEnabled:i}=this,n="year"!==e&&"time"!==e?((t,e,a,i,n,o={month:"long"})=>{const{year:r}=e,s=[];if(void 0!==n){let e=n;void 0!==i?.month&&i.year===r&&(e=e.filter((t=>t<=i.month))),void 0!==a?.month&&a.year===r&&(e=e.filter((t=>t>=a.month))),e.forEach((e=>{const a=new Date(`${e}/1/${r} GMT+0000`),i=new Intl.DateTimeFormat(t,{...o,timeZone:"UTC"}).format(a);s.push({text:i,value:e})}))}else{const e=i&&i.year===r?i.month:12;for(let i=a&&a.year===r?a.month:1;i<=e;i++){const e=new Date(`${i}/1/${r} GMT+0000`),a=new Intl.DateTimeFormat(t,{...o,timeZone:"UTC"}).format(e);s.push({text:a,value:i})}}return s})(this.locale,a,this.minParts,this.maxParts,this.parsedMonthValues):[];let o="date"===e?xt(this.locale,a,this.minParts,this.maxParts,this.parsedDayValues):[];i&&(o=o.map((e=>{const{value:n}=e,o="string"==typeof n?parseInt(n):n,r={month:a.month,day:o,year:a.year};let s;try{s=!i(at(r))}catch(e){t("[ion-datetime] - Exception thrown from provided `isDateEnabled` function. Please check your function and try again.",e)}return{...e,disabled:s}})));const r="month"!==e&&"time"!==e?((t,e,a,i,n)=>{let o=[];if(void 0!==n)o=n,void 0!==i?.year&&(o=o.filter((t=>t<=i.year))),void 0!==a?.year&&(o=o.filter((t=>t>=a.year)));else{const{year:t}=e,n=i?.year??t;for(let e=a?.year??t-100;e<=n;e++)o.push(e)}return o.map((a=>({text:$(t,{year:a,month:e.month,day:e.day}),value:a})))})(this.locale,this.defaultParts,this.minParts,this.maxParts,this.parsedYearValues):[];let s=[];return s=nt(this.locale,{month:"numeric",day:"numeric"})?[this.renderMonthPickerColumn(n),this.renderDayPickerColumn(o),this.renderYearPickerColumn(r)]:[this.renderDayPickerColumn(o),this.renderMonthPickerColumn(n),this.renderYearPickerColumn(r)],s}renderDayPickerColumn(t){if(0===t.length)return[];const{disabled:e,workingParts:a}=this,i=(null!==a.day?a.day:this.defaultParts.day)??void 0;return r("ion-picker-column",{part:Tt,"aria-label":"Select a day",class:"day-column",color:this.color,disabled:e,value:i,onIonChange:t=>{const e=this.getActivePartsWithFallback();this.setWorkingParts({...this.workingParts,day:t.detail.value}),this.setActiveParts({...e,day:t.detail.value}),t.stopPropagation()}},t.map((t=>r("ion-picker-column-option",{color:this.color,part:t.value===i?`${At} ${Ot}`:At,key:t.value,disabled:t.disabled,value:t.value},t.text))))}renderMonthPickerColumn(t){if(0===t.length)return[];const{disabled:e,workingParts:a}=this;return r("ion-picker-column",{part:Tt,"aria-label":"Select a month",class:"month-column",color:this.color,disabled:e,value:a.month,onIonChange:t=>{const e=this.getActivePartsWithFallback();this.setWorkingParts({...this.workingParts,month:t.detail.value}),this.multiple||this.setActiveParts({...e,month:t.detail.value}),t.stopPropagation()}},t.map((t=>r("ion-picker-column-option",{color:this.color,part:t.value===a.month?`${At} ${Ot}`:At,key:t.value,disabled:t.disabled,value:t.value},t.text))))}renderYearPickerColumn(t){if(0===t.length)return[];const{disabled:e,workingParts:a}=this;return r("ion-picker-column",{part:Tt,"aria-label":"Select a year",class:"year-column",color:this.color,disabled:e,value:a.year,onIonChange:t=>{const e=this.getActivePartsWithFallback();this.setWorkingParts({...this.workingParts,year:t.detail.value}),this.multiple||this.setActiveParts({...e,year:t.detail.value}),t.stopPropagation()}},t.map((t=>r("ion-picker-column-option",{color:this.color,part:t.value===a.year?`${At} ${Ot}`:At,key:t.value,disabled:t.disabled,value:t.value},t.text))))}renderTimePickerColumns(t){if(["date","month","month-year","year"].includes(t))return[];const e=void 0!==this.getActivePart(),{hoursData:a,minutesData:i,dayPeriodData:n}=((t,e,a,i,n,o,r)=>{const s=j(t,this.hourCycle),d=M(s),{hours:l,minutes:h,am:c,pm:p}=bt(t,e,s,i,n,o,r),m=l.map((t=>({text:T(t,s),value:z(t,d,e.ampm)}))),y=h.map((t=>({text:A(t),value:t}))),u=[];return c&&!d&&u.push({text:O(t,"am"),value:"am"}),p&&!d&&u.push({text:O(t,"pm"),value:"pm"}),{minutesData:y,hoursData:m,dayPeriodData:u}})(this.locale,this.workingParts,0,e?this.minParts:void 0,e?this.maxParts:void 0,this.parsedHourValues,this.parsedMinuteValues);return[this.renderHourPickerColumn(a),this.renderMinutePickerColumn(i),this.renderDayPeriodPickerColumn(n)]}renderHourPickerColumn(t){const{disabled:e}=this;if(0===t.length)return[];const a=this.getActivePartsWithFallback();return r("ion-picker-column",{part:Tt,"aria-label":"Select an hour",color:this.color,disabled:e,value:a.hour,numericInput:!0,onIonChange:t=>{this.setWorkingParts({...this.workingParts,hour:t.detail.value}),this.setActiveParts({...this.getActivePartsWithFallback(),hour:t.detail.value}),t.stopPropagation()}},t.map((t=>r("ion-picker-column-option",{color:this.color,part:t.value===a.hour?`${At} ${Ot}`:At,key:t.value,disabled:t.disabled,value:t.value},t.text))))}renderMinutePickerColumn(t){const{disabled:e}=this;if(0===t.length)return[];const a=this.getActivePartsWithFallback();return r("ion-picker-column",{part:Tt,"aria-label":"Select a minute",color:this.color,disabled:e,value:a.minute,numericInput:!0,onIonChange:t=>{this.setWorkingParts({...this.workingParts,minute:t.detail.value}),this.setActiveParts({...this.getActivePartsWithFallback(),minute:t.detail.value}),t.stopPropagation()}},t.map((t=>r("ion-picker-column-option",{color:this.color,part:t.value===a.minute?`${At} ${Ot}`:At,key:t.value,disabled:t.disabled,value:t.value},t.text))))}renderDayPeriodPickerColumn(t){const{disabled:e}=this;if(0===t.length)return[];const a=this.getActivePartsWithFallback(),i=ot(this.locale);return r("ion-picker-column",{part:Tt,"aria-label":"Select a day period",style:i?{order:"-1"}:{},color:this.color,disabled:e,value:a.ampm,onIonChange:t=>{const e=this.workingParts,a=rt(e,t.detail.value);this.setWorkingParts({...e,ampm:t.detail.value,hour:a}),this.setActiveParts({...this.getActivePartsWithFallback(),ampm:t.detail.value,hour:a}),t.stopPropagation()}},t.map((t=>r("ion-picker-column-option",{color:this.color,part:t.value===a.ampm?`${At} ${Ot}`:At,key:t.value,disabled:t.disabled,value:t.value},t.text))))}renderWheelView(t){const{locale:e}=this,a=nt(e)?"month-first":"year-first";return r("div",{class:{[`wheel-order-${a}`]:!0}},this.renderWheelPicker(t))}renderCalendarHeader(t){const{disabled:e}=this,a="ios"===t?b:g,i="ios"===t?x:f,n=e||((t,e,a)=>{const i={...P(this.workingParts),day:null};return kt(i,{minParts:e,maxParts:a})})(0,this.minParts,this.maxParts),o=e||((t,e)=>{const a={...C(this.workingParts),day:null};return kt(a,{maxParts:e})})(0,this.maxParts),s=y(this.el)?"rtl":"ltr";return r("div",{class:"calendar-header",part:"calendar-header"},r("div",{class:"calendar-action-buttons"},r("div",{class:"calendar-month-year"},r("button",{class:{"calendar-month-year-toggle":!0,"ion-activatable":!0,"ion-focusable":!0},part:"month-year-button",disabled:e,"aria-label":this.showMonthAndYear?"Hide year picker":"Show year picker",onClick:()=>this.toggleMonthAndYearView()},r("span",{id:"toggle-wrapper"},st(this.locale,this.workingParts),r("ion-icon",{dir:s,"aria-hidden":"true",icon:this.showMonthAndYear?a:i,lazy:!1,flipRtl:!0})),"md"===t&&r("ion-ripple-effect",null))),r("div",{class:"calendar-next-prev"},r("ion-buttons",null,r("ion-button",{"aria-label":"Previous month",disabled:n,onClick:()=>this.prevMonth(),part:"navigation-button previous-button"},r("ion-icon",{dir:s,"aria-hidden":"true",slot:"icon-only",icon:v,lazy:!1,flipRtl:!0})),r("ion-button",{"aria-label":"Next month",disabled:o,onClick:()=>this.nextMonth(),part:"navigation-button next-button"},r("ion-icon",{dir:s,"aria-hidden":"true",slot:"icon-only",icon:x,lazy:!1,flipRtl:!0}))))),r("div",{class:"calendar-days-of-week","aria-hidden":"true",part:"calendar-days-of-week"},((t,e,a=0)=>{const i=new Intl.DateTimeFormat(this.locale,{weekday:"ios"===e?"short":"narrow"}),n=new Date("11/01/2020"),o=[];for(let t=a;t<a+7;t++){const e=new Date(n);e.setDate(e.getDate()+t),o.push(i.format(e))}return o})(0,t,this.firstDayOfWeek%7).map((t=>r("div",{class:"day-of-week"},t)))))}renderMonth(e,a){const{disabled:i,readonly:n}=this,o=void 0===this.parsedYearValues||this.parsedYearValues.includes(a),s=void 0===this.parsedMonthValues||this.parsedMonthValues.includes(e),d=!o||!s,l=i||n,h=i||kt({month:e,year:a,day:null},{minParts:{...this.minParts,day:null},maxParts:{...this.maxParts,day:null}}),c=this.workingParts.month===e&&this.workingParts.year===a,p=this.getActivePartsWithFallback();return r("div",{"aria-hidden":c?null:"true",class:{"calendar-month":!0,"calendar-month-disabled":!c&&h}},r("div",{class:"calendar-month-grid"},((t,e,a,i=!1)=>{const n=W(t,e);let o;o=1===t?W(12,e-1):W(t-1,e);const r=new Date(`${t}/1/${e}`).getDay(),s=r>=a?r-(a+1):6-(a-r);let d=[];for(let t=1;t<=n;t++)d.push({day:t,dayOfWeek:(s+t)%7,isAdjacentDay:!1});if(i){for(let t=0;t<=s;t++)d=[{day:o-t,dayOfWeek:(o-t)%7,isAdjacentDay:!0},...d];const t=41-(n+s);for(let e=0;e<t;e++)d.push({day:e+1,dayOfWeek:(n+s+e)%7,isAdjacentDay:!0})}else for(let t=0;t<=s;t++)d=[{day:null,dayOfWeek:null,isAdjacentDay:!1},...d];return d})(e,a,this.firstDayOfWeek%7,this.showAdjacentDays).map(((i,n)=>{const{day:o,dayOfWeek:s,isAdjacentDay:h}=i,{el:c,highlightedDates:m,isDateEnabled:y,multiple:u,showAdjacentDays:b}=this;let g=e,x=a;b&&h&&null!==o&&(o>20?1===e?(x=a-1,g=12):g=e-1:o<15&&(12===e?(x=a+1,g=1):g=e+1));const f={month:g,day:o,year:x,isAdjacentDay:h},v=null===o,{isActive:w,isToday:k,ariaLabel:C,ariaSelected:P,disabled:D,text:$}=wt(this.locale,f,this.activeParts,this.todayParts,this.minParts,this.maxParts,this.parsedDayValues),j=at(f);let z=d||D;if(!z&&void 0!==y)try{z=!y(j)}catch(e){t("[ion-datetime] - Exception thrown from provided `isDateEnabled` function. Please check your function and try again.",c,e)}const T=z&&l,A=z||l;let O,V;return void 0===m||w||null===o||h||(O=((e,a,i)=>{if(Array.isArray(e)){const t=a.split("T")[0],i=e.find((e=>e.date===t));if(i)return{textColor:i.textColor,backgroundColor:i.backgroundColor,border:i.border}}else try{return e(a)}catch(e){t("[ion-datetime] - Exception thrown from provided `highlightedDates` callback. Please check your function and try again.",i,e)}})(m,j,c)),v||h?h&&(V="calendar-day"+(z?" disabled":"")):V=`calendar-day${w?" active":""}${k?" today":""}${z?" disabled":""}`,r("div",{class:"calendar-day-wrapper"},r("button",{ref:t=>{t&&(t.style.setProperty("color",`${O?O.textColor:""}`,"important"),t.style.setProperty("background-color",`${O?O.backgroundColor:""}`,"important"),t.style.setProperty("border",`${O?O.border:""}`,"important"))},tabindex:"-1","data-day":o,"data-month":g,"data-year":x,"data-index":n,"data-day-of-week":s,disabled:A,class:{"calendar-day-padding":v,"calendar-day":!0,"calendar-day-active":w,"calendar-day-constrained":T,"calendar-day-today":k,"calendar-day-adjacent-day":h},part:V,"aria-hidden":v?"true":null,"aria-selected":P,"aria-label":C,onClick:()=>{v||(h?(this.el.blur(),this.activeParts={...p,...f},this.animateToDate(f),this.confirm()):(this.setWorkingParts({...this.workingParts,...f}),u?this.setActiveParts(f,w):this.setActiveParts({...p,...f})))}},$))}))))}renderCalendarBody(){return r("div",{class:"calendar-body ion-focusable",ref:t=>this.calendarBodyRef=t,tabindex:"0"},gt(this.workingParts,this.forceRenderDate).map((({month:t,year:e})=>this.renderMonth(t,e))))}renderCalendar(t){return r("div",{class:"datetime-calendar",key:"datetime-calendar"},this.renderCalendarHeader(t),this.renderCalendarBody())}renderTimeLabel(){if(null!==this.el.querySelector('[slot="time-label"]')||this.showDefaultTimeLabel)return r("slot",{name:"time-label"},"Time")}renderTimeOverlay(){const{disabled:t,hourCycle:e,isTimePopoverOpen:a,locale:i,formatOptions:n}=this,o=j(i,e),s=this.getActivePartsWithFallback();return[r("div",{class:"time-header"},this.renderTimeLabel()),r("button",{class:{"time-body":!0,"time-body-active":a},part:"time-button"+(a?" active":""),"aria-expanded":"false","aria-haspopup":"true",disabled:t,onClick:async t=>{const{popoverRef:e}=this;e&&(this.isTimePopoverOpen=!0,e.present(new CustomEvent("ionShadowTarget",{detail:{ionShadowTarget:t.target}})),await e.onWillDismiss(),this.isTimePopoverOpen=!1)}},dt(i,s,o,n?.time)),r("ion-popover",{alignment:"center",translucent:!0,overlayIndex:1,arrow:!1,onWillPresent:t=>{t.target.querySelectorAll("ion-picker-column").forEach((t=>t.scrollActiveItemIntoView()))},style:{"--offset-y":"-10px","--min-width":"fit-content"},keyboardEvents:!0,ref:t=>this.popoverRef=t},this.renderWheelPicker("time"))]}getHeaderSelectedDateText(){const{activeParts:e,formatOptions:a,multiple:i,titleSelectedDatesFormatter:n}=this,o=Array.isArray(e);let r;if(i&&o&&1!==e.length){if(r=`${e.length} days`,void 0!==n)try{r=n(at(e))}catch(e){t("[ion-datetime] - Exception in provided `titleSelectedDatesFormatter`:",e)}}else r=lt(this.locale,this.getActivePartsWithFallback(),a?.date??{weekday:"short",month:"short",day:"numeric"});return r}renderHeader(t=!0){if(null!==this.el.querySelector('[slot="title"]')||this.showDefaultTitle)return r("div",{class:"datetime-header",part:"datetime-header"},r("div",{class:"datetime-title",part:"datetime-title"},r("slot",{name:"title"},"Select Date")),t&&r("div",{class:"datetime-selected-date",part:"datetime-selected-date"},this.getHeaderSelectedDateText()))}renderTime(){const{presentation:t}=this;return r("div",{class:"datetime-time"},"time"===t?this.renderWheelPicker():this.renderTimeOverlay())}renderCalendarViewMonthYearPicker(){return r("div",{class:"datetime-year"},this.renderWheelView("month-year"))}renderDatetime(t){const{presentation:e,preferWheel:a}=this;if(a&&("date"===e||"date-time"===e||"time-date"===e))return[this.renderHeader(!1),this.renderWheelView(),this.renderFooter()];switch(e){case"date-time":return[this.renderHeader(),this.renderCalendar(t),this.renderCalendarViewMonthYearPicker(),this.renderTime(),this.renderFooter()];case"time-date":return[this.renderHeader(),this.renderTime(),this.renderCalendar(t),this.renderCalendarViewMonthYearPicker(),this.renderFooter()];case"time":return[this.renderHeader(!1),this.renderTime(),this.renderFooter()];case"month":case"month-year":case"year":return[this.renderHeader(!1),this.renderWheelView(),this.renderFooter()];default:return[this.renderHeader(),this.renderCalendar(t),this.renderCalendarViewMonthYearPicker(),this.renderFooter()]}}render(){const{name:t,value:e,disabled:a,el:i,color:n,readonly:o,showMonthAndYear:d,preferWheel:l,presentation:h,size:c,isGridStyle:m}=this,y=w(this),b="year"===h||"month"===h||"month-year"===h,g=d||b,x=d&&!b,f=("date"===h||"date-time"===h||"time-date"===h)&&l;return p(!0,i,t,ht(e),a),r(s,{key:"465c9c22bccabc4a82ea4054c536c6086b85ddf9","aria-disabled":a?"true":null,onFocus:this.onFocus,onBlur:this.onBlur,class:{...u(n,{[y]:!0,"datetime-readonly":o,"datetime-disabled":a,"show-month-and-year":g,"month-year-picker-open":x,[`datetime-presentation-${h}`]:!0,[`datetime-size-${c}`]:!0,"datetime-prefer-wheel":f,"datetime-grid":m})}},r("div",{key:"9732b003440a0ca23520bc8a09e73125d88fd565",class:"intersection-tracker",ref:t=>this.intersectionTrackerRef=t}),this.renderDatetime(y))}get el(){return d(this)}static get watchers(){return{formatOptions:[{formatOptionsChanged:0}],disabled:[{disabledChanged:0}],min:[{minChanged:0}],max:[{maxChanged:0}],presentation:[{presentationChanged:0}],yearValues:[{yearValuesChanged:0}],monthValues:[{monthValuesChanged:0}],dayValues:[{dayValuesChanged:0}],hourValues:[{hourValuesChanged:0}],minuteValues:[{minuteValuesChanged:0}],value:[{valueChanged:0}]}}};let $t=0;const jt="datetime-cancel",zt="datetime-confirm",Tt="wheel",At="wheel-item",Ot="active";Dt.style={ios:':host{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;background:var(--background);overflow:hidden}:host(.datetime-size-fixed){width:auto;height:auto}:host(.datetime-size-fixed:not(.datetime-prefer-wheel)){max-width:350px}:host(.datetime-size-fixed.datetime-prefer-wheel){min-width:350px;max-width:-webkit-max-content;max-width:-moz-max-content;max-width:max-content}:host(.datetime-size-cover){width:100%}:host .calendar-body,:host .datetime-year{opacity:0}:host(:not(.datetime-ready)) .datetime-year{position:absolute;pointer-events:none}:host(.datetime-ready) .calendar-body{opacity:1}:host(.datetime-ready) .datetime-year{display:none;opacity:1}:host .wheel-order-year-first .day-column{-ms-flex-order:3;order:3;text-align:end}:host .wheel-order-year-first .month-column{-ms-flex-order:2;order:2;text-align:end}:host .wheel-order-year-first .year-column{-ms-flex-order:1;order:1;text-align:start}:host .datetime-calendar,:host .datetime-year{display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-flow:column;flex-flow:column}:host(.show-month-and-year) .datetime-year{display:-ms-flexbox;display:flex}:host(.show-month-and-year) .calendar-next-prev,:host(.show-month-and-year) .calendar-days-of-week,:host(.show-month-and-year) .calendar-body,:host(.show-month-and-year) .datetime-time{display:none}:host(.month-year-picker-open) .datetime-footer{display:none}:host(.datetime-disabled){pointer-events:none}:host(.datetime-disabled) .calendar-days-of-week,:host(.datetime-disabled) .datetime-time{opacity:0.4}:host(.datetime-readonly){pointer-events:none;}:host(.datetime-readonly) .calendar-action-buttons,:host(.datetime-readonly) .calendar-body,:host(.datetime-readonly) .datetime-year{pointer-events:initial}:host(.datetime-readonly) .calendar-day[disabled]:not(.calendar-day-constrained),:host(.datetime-readonly) .datetime-action-buttons ion-button[disabled]{opacity:1}:host .datetime-header .datetime-title{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}:host .datetime-action-buttons.has-clear-button{width:100%}:host .datetime-action-buttons ion-buttons{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host .datetime-action-buttons ion-button{--color:var(--ion-color-primary, #0054e9)}.datetime-action-buttons .datetime-action-buttons-container{display:-ms-flexbox;display:flex}:host .calendar-action-buttons{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host .calendar-action-buttons ion-button{--background:transparent}:host .calendar-days-of-week{display:grid;grid-template-columns:repeat(7, 1fr);text-align:center}.calendar-days-of-week .day-of-week{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:0;margin-bottom:0}:host .calendar-body{display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-webkit-scroll-snap-type:x mandatory;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;overflow-x:scroll;overflow-y:hidden;scrollbar-width:none;outline:none}:host .calendar-body .calendar-month{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;scroll-snap-align:start;scroll-snap-stop:always;-ms-flex-negative:0;flex-shrink:0;width:100%}:host .calendar-body .calendar-month-disabled{scroll-snap-align:none}:host .calendar-body::-webkit-scrollbar{display:none}:host .calendar-body .calendar-month-grid{display:grid;grid-template-columns:repeat(7, 1fr)}:host .calendar-day-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;min-width:0;min-height:0;overflow:visible}.calendar-day{border-radius:50%;-webkit-padding-start:0px;padding-inline-start:0px;-webkit-padding-end:0px;padding-inline-end:0px;padding-top:0px;padding-bottom:0px;-webkit-margin-start:0px;margin-inline-start:0px;-webkit-margin-end:0px;margin-inline-end:0px;margin-top:0px;margin-bottom:0px;display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border:none;outline:none;background:none;color:currentColor;font-family:var(--ion-font-family, inherit);cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;z-index:0}:host .calendar-day[disabled]{pointer-events:none;opacity:0.4}.calendar-day:not(.calendar-day-adjacent-day):focus{background:rgba(var(--ion-color-primary-rgb, 0, 84, 233), 0.2);-webkit-box-shadow:0px 0px 0px 4px rgba(var(--ion-color-primary-rgb, 0, 84, 233), 0.2);box-shadow:0px 0px 0px 4px rgba(var(--ion-color-primary-rgb, 0, 84, 233), 0.2)}:host(.ion-color) .calendar-day:not(.calendar-day-adjacent-day):focus{background:rgba(var(--ion-color-base-rgb), 0.2);-webkit-box-shadow:0px 0px 0px 4px rgba(var(--ion-color-base-rgb), 0.2);box-shadow:0px 0px 0px 4px rgba(var(--ion-color-base-rgb), 0.2)}:host .datetime-time{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host(.datetime-presentation-time) .datetime-time{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0}:host ion-popover{--height:200px}:host .time-header{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .time-body{border-radius:8px;-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px;padding-top:6px;padding-bottom:6px;display:-ms-flexbox;display:flex;border:none;background:var(--ion-color-step-300, var(--ion-background-color-step-300, #edeef0));color:var(--ion-text-color, #000);font-family:inherit;font-size:inherit;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none}:host .time-body-active{color:var(--ion-color-primary, #0054e9)}:host(.ion-color) .time-body-active{color:var(--ion-color-base)}:host(.in-item){position:static}:host(.show-month-and-year) .calendar-action-buttons .calendar-month-year-toggle{color:var(--ion-color-primary, #0054e9)}:host(.ion-color.show-month-and-year) .calendar-action-buttons .calendar-month-year-toggle{color:var(--ion-color-base)}.calendar-month-year{min-width:0}.calendar-month-year-toggle{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;position:relative;border:0;outline:none;background:transparent;cursor:pointer;z-index:1}.calendar-month-year-toggle::after{left:0;right:0;top:0;bottom:0;position:absolute;content:"";opacity:0;-webkit-transition:opacity 15ms linear, background-color 15ms linear;transition:opacity 15ms linear, background-color 15ms linear;z-index:-1}.calendar-month-year-toggle.ion-focused::after{background:currentColor}.calendar-month-year-toggle:disabled{opacity:0.3;pointer-events:none}.calendar-month-year-toggle ion-icon{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:0;padding-inline-end:0;padding-top:0;padding-bottom:0;-ms-flex-negative:0;flex-shrink:0}.calendar-month-year-toggle #toggle-wrapper{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center}ion-picker{--highlight-background:var(--wheel-highlight-background);--highlight-border-radius:var(--wheel-highlight-border-radius);--fade-background-rgb:var(--wheel-fade-background-rgb)}:host{--background:var(--ion-color-light, #f4f5f8);--background-rgb:var(--ion-color-light-rgb, 244, 245, 248);--title-color:var(--ion-color-step-600, var(--ion-text-color-step-400, #666666))}:host(.datetime-presentation-date-time:not(.datetime-prefer-wheel)),:host(.datetime-presentation-time-date:not(.datetime-prefer-wheel)),:host(.datetime-presentation-date:not(.datetime-prefer-wheel)){min-height:350px}:host .datetime-header{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:16px;padding-bottom:16px;border-bottom:0.55px solid var(--ion-color-step-200, var(--ion-background-color-step-200, #cccccc));font-size:min(0.875rem, 22.4px)}:host .datetime-header .datetime-title{color:var(--title-color)}:host .datetime-header .datetime-selected-date{margin-top:10px}.calendar-month-year-toggle{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:0px;padding-bottom:0px;min-height:44px;font-size:min(1rem, 25.6px);font-weight:600}.calendar-month-year-toggle.ion-focused::after{opacity:0.15}.calendar-month-year-toggle #toggle-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:8px;margin-inline-end:8px;margin-top:10px;margin-bottom:10px}:host .calendar-action-buttons .calendar-month-year-toggle ion-icon,:host .calendar-action-buttons ion-buttons ion-button{color:var(--ion-color-primary, #0054e9)}:host(.ion-color) .calendar-action-buttons .calendar-month-year-toggle ion-icon,:host(.ion-color) .calendar-action-buttons ion-buttons ion-button{color:var(--ion-color-base)}:host .calendar-action-buttons ion-buttons{-ms-flex-align:stretch;align-items:stretch;height:100%}:host .calendar-action-buttons ion-buttons ion-button{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}:host .calendar-days-of-week{-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px;padding-top:0;padding-bottom:0;color:var(--ion-color-step-300, var(--ion-text-color-step-700, #b3b3b3));font-size:min(0.75rem, 19.2px);font-weight:600;line-height:24px;text-transform:uppercase}@supports (border-radius: mod(1px, 1px)){.calendar-days-of-week .day-of-week{width:clamp(20px, calc(mod(min(1rem, 24px), 24px) * 10), 100%);height:24px;overflow:hidden}.calendar-day{border-radius:max(8px, mod(min(1rem, 24px), 24px) * 10)}}@supports ((border-radius: mod(1px, 1px)) and (background: -webkit-named-image(apple-pay-logo-black)) and (not (contain-intrinsic-size: none))) or (not (border-radius: mod(1px, 1px))){.calendar-days-of-week .day-of-week{width:auto;height:auto;overflow:initial}.calendar-day{border-radius:32px}}:host .calendar-body .calendar-month .calendar-month-grid{-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px;padding-top:8px;padding-bottom:8px;-ms-flex-align:center;align-items:center;height:calc(100% - 16px)}:host .calendar-day-wrapper{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px;padding-top:4px;padding-bottom:4px;height:0;min-height:1rem}:host .calendar-day{width:40px;min-width:40px;height:40px;font-size:min(1.25rem, 32px)}.calendar-day.calendar-day-active{background:rgba(var(--ion-color-primary-rgb, 0, 84, 233), 0.2);font-size:min(1.375rem, 35.2px)}:host(.ion-color) .calendar-day.calendar-day-active{background:rgba(var(--ion-color-base-rgb), 0.2)}:host .calendar-day.calendar-day-today{color:var(--ion-color-primary, #0054e9)}:host(.ion-color) .calendar-day.calendar-day-today{color:var(--ion-color-base)}:host .calendar-day.calendar-day-active,:host .calendar-day.calendar-day-adjacent-day.calendar-day-active{color:var(--ion-color-primary, #0054e9);font-weight:600}:host(.ion-color) .calendar-day.calendar-day-active,:host(.ion-color) .calendar-day.calendar-day-adjacent-day.calendar-day-active{color:var(--ion-color-base)}:host .calendar-day.calendar-day-today.calendar-day-active{background:var(--ion-color-primary, #0054e9);color:var(--ion-color-primary-contrast, #fff)}:host(.ion-color) .calendar-day.calendar-day-today.calendar-day-active{background:var(--ion-color-base);color:var(--ion-color-contrast)}:host .calendar-day.calendar-day-adjacent-day{color:var(--ion-color-step-300, var(--ion-text-color-step-700, #b3b3b3))}:host .datetime-time{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:8px;padding-bottom:16px;font-size:min(1rem, 25.6px)}:host .datetime-time .time-header{font-weight:600}:host .datetime-buttons{-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px;padding-top:8px;padding-bottom:8px;border-top:0.55px solid var(--ion-color-step-200, var(--ion-background-color-step-200, #cccccc))}:host .datetime-buttons ::slotted(ion-buttons),:host .datetime-buttons ion-buttons{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between}:host .datetime-action-buttons{width:100%}',md:':host{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;background:var(--background);overflow:hidden}:host(.datetime-size-fixed){width:auto;height:auto}:host(.datetime-size-fixed:not(.datetime-prefer-wheel)){max-width:350px}:host(.datetime-size-fixed.datetime-prefer-wheel){min-width:350px;max-width:-webkit-max-content;max-width:-moz-max-content;max-width:max-content}:host(.datetime-size-cover){width:100%}:host .calendar-body,:host .datetime-year{opacity:0}:host(:not(.datetime-ready)) .datetime-year{position:absolute;pointer-events:none}:host(.datetime-ready) .calendar-body{opacity:1}:host(.datetime-ready) .datetime-year{display:none;opacity:1}:host .wheel-order-year-first .day-column{-ms-flex-order:3;order:3;text-align:end}:host .wheel-order-year-first .month-column{-ms-flex-order:2;order:2;text-align:end}:host .wheel-order-year-first .year-column{-ms-flex-order:1;order:1;text-align:start}:host .datetime-calendar,:host .datetime-year{display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-flow:column;flex-flow:column}:host(.show-month-and-year) .datetime-year{display:-ms-flexbox;display:flex}:host(.show-month-and-year) .calendar-next-prev,:host(.show-month-and-year) .calendar-days-of-week,:host(.show-month-and-year) .calendar-body,:host(.show-month-and-year) .datetime-time{display:none}:host(.month-year-picker-open) .datetime-footer{display:none}:host(.datetime-disabled){pointer-events:none}:host(.datetime-disabled) .calendar-days-of-week,:host(.datetime-disabled) .datetime-time{opacity:0.4}:host(.datetime-readonly){pointer-events:none;}:host(.datetime-readonly) .calendar-action-buttons,:host(.datetime-readonly) .calendar-body,:host(.datetime-readonly) .datetime-year{pointer-events:initial}:host(.datetime-readonly) .calendar-day[disabled]:not(.calendar-day-constrained),:host(.datetime-readonly) .datetime-action-buttons ion-button[disabled]{opacity:1}:host .datetime-header .datetime-title{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}:host .datetime-action-buttons.has-clear-button{width:100%}:host .datetime-action-buttons ion-buttons{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host .datetime-action-buttons ion-button{--color:var(--ion-color-primary, #0054e9)}.datetime-action-buttons .datetime-action-buttons-container{display:-ms-flexbox;display:flex}:host .calendar-action-buttons{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host .calendar-action-buttons ion-button{--background:transparent}:host .calendar-days-of-week{display:grid;grid-template-columns:repeat(7, 1fr);text-align:center}.calendar-days-of-week .day-of-week{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:0;margin-bottom:0}:host .calendar-body{display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-webkit-scroll-snap-type:x mandatory;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;overflow-x:scroll;overflow-y:hidden;scrollbar-width:none;outline:none}:host .calendar-body .calendar-month{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;scroll-snap-align:start;scroll-snap-stop:always;-ms-flex-negative:0;flex-shrink:0;width:100%}:host .calendar-body .calendar-month-disabled{scroll-snap-align:none}:host .calendar-body::-webkit-scrollbar{display:none}:host .calendar-body .calendar-month-grid{display:grid;grid-template-columns:repeat(7, 1fr)}:host .calendar-day-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;min-width:0;min-height:0;overflow:visible}.calendar-day{border-radius:50%;-webkit-padding-start:0px;padding-inline-start:0px;-webkit-padding-end:0px;padding-inline-end:0px;padding-top:0px;padding-bottom:0px;-webkit-margin-start:0px;margin-inline-start:0px;-webkit-margin-end:0px;margin-inline-end:0px;margin-top:0px;margin-bottom:0px;display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border:none;outline:none;background:none;color:currentColor;font-family:var(--ion-font-family, inherit);cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;z-index:0}:host .calendar-day[disabled]{pointer-events:none;opacity:0.4}.calendar-day:not(.calendar-day-adjacent-day):focus{background:rgba(var(--ion-color-primary-rgb, 0, 84, 233), 0.2);-webkit-box-shadow:0px 0px 0px 4px rgba(var(--ion-color-primary-rgb, 0, 84, 233), 0.2);box-shadow:0px 0px 0px 4px rgba(var(--ion-color-primary-rgb, 0, 84, 233), 0.2)}:host(.ion-color) .calendar-day:not(.calendar-day-adjacent-day):focus{background:rgba(var(--ion-color-base-rgb), 0.2);-webkit-box-shadow:0px 0px 0px 4px rgba(var(--ion-color-base-rgb), 0.2);box-shadow:0px 0px 0px 4px rgba(var(--ion-color-base-rgb), 0.2)}:host .datetime-time{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host(.datetime-presentation-time) .datetime-time{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0}:host ion-popover{--height:200px}:host .time-header{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .time-body{border-radius:8px;-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px;padding-top:6px;padding-bottom:6px;display:-ms-flexbox;display:flex;border:none;background:var(--ion-color-step-300, var(--ion-background-color-step-300, #edeef0));color:var(--ion-text-color, #000);font-family:inherit;font-size:inherit;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none}:host .time-body-active{color:var(--ion-color-primary, #0054e9)}:host(.ion-color) .time-body-active{color:var(--ion-color-base)}:host(.in-item){position:static}:host(.show-month-and-year) .calendar-action-buttons .calendar-month-year-toggle{color:var(--ion-color-primary, #0054e9)}:host(.ion-color.show-month-and-year) .calendar-action-buttons .calendar-month-year-toggle{color:var(--ion-color-base)}.calendar-month-year{min-width:0}.calendar-month-year-toggle{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;position:relative;border:0;outline:none;background:transparent;cursor:pointer;z-index:1}.calendar-month-year-toggle::after{left:0;right:0;top:0;bottom:0;position:absolute;content:"";opacity:0;-webkit-transition:opacity 15ms linear, background-color 15ms linear;transition:opacity 15ms linear, background-color 15ms linear;z-index:-1}.calendar-month-year-toggle.ion-focused::after{background:currentColor}.calendar-month-year-toggle:disabled{opacity:0.3;pointer-events:none}.calendar-month-year-toggle ion-icon{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:0;padding-inline-end:0;padding-top:0;padding-bottom:0;-ms-flex-negative:0;flex-shrink:0}.calendar-month-year-toggle #toggle-wrapper{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center}ion-picker{--highlight-background:var(--wheel-highlight-background);--highlight-border-radius:var(--wheel-highlight-border-radius);--fade-background-rgb:var(--wheel-fade-background-rgb)}:host{--background:var(--ion-color-step-100, var(--ion-background-color-step-100, #ffffff));--title-color:var(--ion-color-primary-contrast, #fff)}:host(.ion-color){--title-color:var(--ion-color-contrast)}:host .datetime-header{-webkit-padding-start:20px;padding-inline-start:20px;-webkit-padding-end:20px;padding-inline-end:20px;padding-top:20px;padding-bottom:20px;background:var(--ion-color-primary, #0054e9);color:var(--title-color)}:host(.ion-color) .datetime-header{background:var(--ion-color-base)}:host .datetime-header .datetime-title{font-size:0.75rem;text-transform:uppercase}:host .datetime-header .datetime-selected-date{margin-top:30px;font-size:2.125rem}:host .calendar-action-buttons ion-button{--color:var(--ion-color-step-650, var(--ion-text-color-step-350, #595959))}.calendar-month-year-toggle{-webkit-padding-start:20px;padding-inline-start:20px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:12px;padding-bottom:12px;min-height:48px;background:transparent;color:var(--ion-color-step-650, var(--ion-text-color-step-350, #595959));z-index:1}.calendar-month-year-toggle.ion-focused::after{opacity:0.04}.calendar-month-year-toggle ion-ripple-effect{color:currentColor}@media (any-hover: hover){.calendar-month-year-toggle.ion-activatable:not(.ion-focused):hover::after{background:currentColor;opacity:0.04}}:host .calendar-days-of-week{-webkit-padding-start:10px;padding-inline-start:10px;-webkit-padding-end:10px;padding-inline-end:10px;padding-top:0px;padding-bottom:0px;color:var(--ion-color-step-500, var(--ion-text-color-step-500, gray));font-size:0.875rem;line-height:36px}:host .calendar-body .calendar-month .calendar-month-grid{-webkit-padding-start:10px;padding-inline-start:10px;-webkit-padding-end:10px;padding-inline-end:10px;padding-top:4px;padding-bottom:4px;grid-template-rows:repeat(6, 1fr)}:host .calendar-day{width:42px;min-width:42px;height:42px;font-size:0.875rem}:host .calendar-day.calendar-day-today{border:1px solid var(--ion-color-primary, #0054e9);color:var(--ion-color-primary, #0054e9)}:host(.ion-color) .calendar-day.calendar-day-today{border:1px solid var(--ion-color-base);color:var(--ion-color-base)}:host .calendar-day.calendar-day-active,:host .calendar-day.calendar-day-adjacent-day.calendar-day-active{color:var(--ion-color-primary-contrast, #fff)}:host(.ion-color) .calendar-day.calendar-day-active,:host(.ion-color) .calendar-day.calendar-day-adjacent-day.calendar-day-active{color:var(--ion-color-contrast)}.calendar-day.calendar-day-active,.calendar-day.calendar-day-active:focus{border:1px solid var(--ion-color-primary, #0054e9);background:var(--ion-color-primary, #0054e9)}:host(.ion-color) .calendar-day.calendar-day-active,:host(.ion-color) .calendar-day.calendar-day-active:focus{border:1px solid var(--ion-color-base);background:var(--ion-color-base)}:host .calendar-day.calendar-day-adjacent-day{color:var(--ion-color-step-500, var(--ion-text-color-step-500, gray))}:host .datetime-time{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:8px;padding-bottom:8px}:host .time-header{color:var(--ion-color-step-650, var(--ion-text-color-step-350, #595959))}:host(.datetime-presentation-month) .datetime-year,:host(.datetime-presentation-year) .datetime-year,:host(.datetime-presentation-month-year) .datetime-year{margin-top:20px;margin-bottom:20px}:host .datetime-buttons{-webkit-padding-start:10px;padding-inline-start:10px;-webkit-padding-end:10px;padding-inline-end:10px;padding-top:10px;padding-bottom:10px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end}'};export{Dt as ion_datetime}
4
+ import{c as t,a as e,r as a,d as i,w as n,i as o,h as r,f as s,g as d}from"./p-BChJkQUV.js";import{startFocusVisible as l}from"./p-BmVRXR1y.js";import{r as h,g as c,a as p}from"./p-CADDaXTY.js";import{F as m}from"./p-DXP3e75r.js";import{i as y}from"./p-Dj4J3LkD.js";import{c as u}from"./p-byZM6qHV.js";import{b,d as g,e as x,f,c as v}from"./p-ByzJUXRA.js";import{b as w}from"./p-lyN9SGmn.js";import{r as k,g as C,a as P,b as D,c as $,d as j,e as z,f as T,h as A,i as O,j as V,k as I,l as S,m as M,n as W,o as E,p as B,v as R,q as L,s as F,t as G,u as H,w as U,x as q,y as Z,z as J,A as N,B as Y,C as X,D as Q,E as _,F as K,G as tt,H as et,I as at,J as it,K as nt,L as ot,M as rt,N as st,O as dt,P as lt,Q as ht}from"./p-4pBCJlqh.js";import"./p-DvQi_1Am.js";import"./p-B_gJaBk0.js";const ct=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59],pt=[0,1,2,3,4,5,6,7,8,9,10,11],mt=[0,1,2,3,4,5,6,7,8,9,10,11],yt=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23],ut=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,0],bt=(t,e,a="h12",i,n,o,r)=>{const s=j(t,a),d=M(s);let l=(t=>{switch(t){case"h11":return pt;case"h12":return mt;case"h23":return yt;case"h24":return ut;default:throw new Error(`Invalid hour cycle "${t}"`)}})(s),h=ct,c=!0,p=!0;if(o&&(l=l.filter((t=>o.includes(t)))),r&&(h=h.filter((t=>r.includes(t)))),i)if(I(e,i)){if(void 0!==i.hour&&(l=l.filter((t=>(d?t:"pm"===e.ampm?(t+12)%24:t)>=i.hour)),c=i.hour<13),void 0!==i.minute){let t=!1;void 0!==i.hour&&void 0!==e.hour&&e.hour>i.hour&&(t=!0),h=h.filter((e=>!!t||e>=i.minute))}}else V(e,i)&&(l=[],h=[],c=p=!1);return n&&(I(e,n)?(void 0!==n.hour&&(l=l.filter((t=>(d?t:"pm"===e.ampm?(t+12)%24:t)<=n.hour)),p=n.hour>=12),void 0!==n.minute&&e.hour===n.hour&&(h=h.filter((t=>t<=n.minute)))):S(e,n)&&(l=[],h=[],c=p=!1)),{hours:l,minutes:h,am:c,pm:p}},gt=(t,e)=>{const a={month:t.month,year:t.year,day:t.day};if(void 0!==e&&(t.month!==e.month||t.year!==e.year)){const i={month:e.month,year:e.year,day:e.day};return V(i,a)?[i,a,C(t)]:[P(t),a,i]}return[P(t),a,C(t)]},xt=(t,e,a,i,n,o={day:"numeric"})=>{const{month:r,year:s}=e,d=[],l=W(r,s),h=null!=i?.day&&i.year===s&&i.month===r?i.day:l,c=null!=a?.day&&a.year===s&&a.month===r?a.day:1;if(void 0!==n){let e=n;e=e.filter((t=>t>=c&&t<=h)),e.forEach((e=>{const a=new Date(`${r}/${e}/${s} GMT+0000`),i=new Intl.DateTimeFormat(t,{...o,timeZone:"UTC"}).format(a);d.push({text:i,value:e})}))}else for(let e=c;e<=h;e++){const a=new Date(`${r}/${e}/${s} GMT+0000`),i=new Intl.DateTimeFormat(t,{...o,timeZone:"UTC"}).format(a);d.push({text:i,value:e})}return d},ft=(t,e)=>t.month===e.month&&t.year===e.year?[t]:[t,...ft(C(t),e)],vt=(t,e,a,i)=>null===t.day||void 0!==i&&!i.includes(t.day)||!(!e||!V(t,e))||!(!a||!S(t,a)),wt=(t,e,a,i,n,o,r)=>{const s=void 0!==(Array.isArray(a)?a:[a]).find((t=>I(e,t))),d=I(e,i);return{disabled:vt(e,n,o,r),isActive:s,isToday:d,ariaSelected:s?"true":null,ariaLabel:B(t,d,e),text:null!=e.day?E(t,e):null}},kt=(t,{minParts:e,maxParts:a})=>!!((t,e,a)=>!!(e&&e.year>t)||!!(a&&a.year<t))(t.year,e,a)||!!(e&&V(t,e)||a&&S(t,a)),Ct=(t,a)=>{(a?.date?.timeZone||a?.date?.timeZoneName||a?.time?.timeZone||a?.time?.timeZoneName)&&e('[ion-datetime] - "timeZone" and "timeZoneName" are not supported in "formatOptions".',t)},Pt=(t,a,i)=>{if(i)switch(a){case"date":case"month-year":case"month":case"year":void 0===i.date&&e(`[ion-datetime] - The '${a}' presentation requires a date object in formatOptions.`,t);break;case"time":void 0===i.time&&e("[ion-datetime] - The 'time' presentation requires a time object in formatOptions.",t);break;case"date-time":case"time-date":void 0===i.date&&void 0===i.time&&e(`[ion-datetime] - The '${a}' presentation requires either a date or time object (or both) in formatOptions.`,t)}},Dt=class{constructor(t){new.target===Dt&&a(this,t),this.ionCancel=i(this,"ionCancel",7),this.ionChange=i(this,"ionChange",7),this.ionValueChange=i(this,"ionValueChange",7),this.ionFocus=i(this,"ionFocus",7),this.ionBlur=i(this,"ionBlur",7),this.ionStyle=i(this,"ionStyle",7),this.ionRender=i(this,"ionRender",7),this.inputId="ion-dt-"+$t++,this.hasUnconfirmedSelection=!1,this.prevPresentation=null,this.showMonthAndYear=!1,this.activeParts=[],this.workingParts={month:5,day:28,year:2021,hour:13,minute:52,ampm:"pm",isAdjacentDay:!1},this.isTimePopoverOpen=!1,this.name=this.inputId,this.disabled=!1,this.readonly=!1,this.showAdjacentDays=!1,this.presentation="date-time",this.cancelText="Cancel",this.doneText="Done",this.clearText="Clear",this.locale="default",this.firstDayOfWeek=0,this.multiple=!1,this.showDefaultTitle=!1,this.showDefaultButtons=!1,this.showClearButton=!1,this.showDefaultTimeLabel=!0,this.size="fixed",this.preferWheel=!1,this.warnIfIncorrectValueUsage=()=>{const{multiple:t,value:a}=this;!t&&Array.isArray(a)&&e(`[ion-datetime] - An array of values was passed, but multiple is "false". This is incorrect usage and may result in unexpected behaviors. To dismiss this warning, pass a string to the "value" property when multiple="false".\n\n Value Passed: [${a.map((t=>`'${t}'`)).join(", ")}]\n`,this.el)},this.setValue=t=>{this.value=t,this.ionChange.emit({value:t})},this.getActivePartsWithFallback=()=>{const{defaultParts:t}=this;return this.getActivePart()??t},this.getActivePart=()=>{const{activeParts:t}=this;return Array.isArray(t)?t[0]:t},this.closeParentOverlay=t=>{const e=this.el.closest("ion-modal, ion-popover");return e&&e.dismiss(void 0,t),null!==e},this.setWorkingParts=t=>{this.workingParts={...t}},this.setActiveParts=(t,e=!1)=>{if(this.readonly)return;this.hasUnconfirmedSelection=!0;const{multiple:a,minParts:i,maxParts:n,activeParts:o}=this,r=R(t,i,n);if(this.setWorkingParts(r),a){const t=Array.isArray(o)?o:[o];this.activeParts=e?t.filter((t=>!I(t,r))):[...t,r]}else this.activeParts={...r};null!==this.el.querySelector('[slot="buttons"]')||this.showDefaultButtons||this.confirm()},this.initializeKeyboardListeners=()=>{const t=this.calendarBodyRef;if(!t)return;const e=this.el.shadowRoot,a=t.querySelector(".calendar-month:nth-of-type(2)"),i=new MutationObserver((e=>{const i=e[0];!i.oldValue?.includes("ion-focused")&&t.classList.contains("ion-focused")&&this.focusWorkingDay(a)}));i.observe(t,{attributeFilter:["class"],attributeOldValue:!0}),this.destroyKeyboardMO=()=>{i?.disconnect()},t.addEventListener("keydown",(t=>{const i=e.activeElement;if(!i||!i.classList.contains("calendar-day"))return;const n=L(i);let o;switch(t.key){case"ArrowDown":t.preventDefault(),o=N(n);break;case"ArrowUp":t.preventDefault(),o=J(n);break;case"ArrowRight":t.preventDefault(),o=Z(n);break;case"ArrowLeft":t.preventDefault(),o=q(n);break;case"Home":t.preventDefault(),o=U(n);break;case"End":t.preventDefault(),o=H(n);break;case"PageUp":t.preventDefault(),o=t.shiftKey?G(n):P(n);break;case"PageDown":t.preventDefault(),o=t.shiftKey?F(n):C(n);break;default:return}vt(o,this.minParts,this.maxParts)||(this.setWorkingParts({...this.workingParts,...o}),requestAnimationFrame((()=>this.focusWorkingDay(a))))}))},this.focusWorkingDay=t=>{const{day:e,month:a,year:i}=this.workingParts,n=new Date(`${a}/1/${i}`).getDay();if(null===e)return;const o=t.querySelector(`.calendar-day-wrapper:nth-of-type(${(n>=this.firstDayOfWeek?n-this.firstDayOfWeek:7-(this.firstDayOfWeek-n))+e}) .calendar-day`);o&&o.focus()},this.processMinParts=()=>{const{min:t,defaultParts:e}=this;this.minParts=void 0!==t?Y(t,e):void 0},this.processMaxParts=()=>{const{max:t,defaultParts:e}=this;this.maxParts=void 0!==t?X(t,e):void 0},this.initializeCalendarListener=()=>{const t=this.calendarBodyRef;if(!t)return;const e=t.querySelectorAll(".calendar-month"),a=e[0],i=e[1],o=e[2],r="ios"===w(this)&&"undefined"!=typeof navigator&&navigator.maxTouchPoints>1;n((()=>{t.scrollLeft=a.clientWidth*(y(this.el)?-1:1);const e=e=>{const i=t.getBoundingClientRect(),n=(y(this.el)?t.scrollLeft>=-2:t.scrollLeft<=2)?a:o,r=n.getBoundingClientRect();if(Math.abs(r.x-i.x)>2)return;const{forceRenderDate:s}=this;return void 0!==s?{month:s.month,year:s.year,day:s.day}:n===a?P(e):n===o?C(e):void 0},s=()=>{r&&(t.style.removeProperty("pointer-events"),l=!1);const a=e(this.workingParts);if(!a)return;const{month:o,day:s,year:d}=a;kt({month:o,year:d,day:null},{minParts:{...this.minParts,day:null},maxParts:{...this.maxParts,day:null}})||(t.style.setProperty("overflow","hidden"),n((()=>{this.setWorkingParts({...this.workingParts,month:o,day:s,year:d}),t.scrollLeft=i.clientWidth*(y(this.el)?-1:1),t.style.removeProperty("overflow"),this.resolveForceDateScrolling&&this.resolveForceDateScrolling();const e=this.el.shadowRoot.activeElement;e&&e.classList.contains("calendar-day")&&e.closest(".calendar-body")?.focus()})))};let d,l=!1;const h=()=>{d&&clearTimeout(d),!l&&r&&(t.style.setProperty("pointer-events","none"),l=!0),d=setTimeout(s,50)};t.addEventListener("scroll",h),this.destroyCalendarListener=()=>{t.removeEventListener("scroll",h)}}))},this.destroyInteractionListeners=()=>{const{destroyCalendarListener:t,destroyKeyboardMO:e}=this;void 0!==t&&t(),void 0!==e&&e()},this.ensureReadyIfVisible=()=>{this.el.classList.contains("datetime-ready")||this.hasLayoutBox()&&this.markReady()},this.hasLayoutBox=()=>{const{width:t,height:e}=this.el.getBoundingClientRect();return t>0&&e>0},this.markReady=()=>{this.el.classList.contains("datetime-ready")||(this.initializeListeners(),n((()=>{this.el.classList.add("datetime-ready")})))},this.loadTimeoutCleanup=()=>{this.loadTimeout&&(clearTimeout(this.loadTimeout),this.loadTimeout=void 0)},this.processValue=(t,e=!0)=>{this.hasUnconfirmedSelection=!1;const a=null!=t&&""!==t&&(!Array.isArray(t)||t.length>0),i=a?Q(t):this.defaultParts,{minParts:n,maxParts:o,workingParts:r,el:s}=this;if(this.warnIfIncorrectValueUsage(),!i)return;a&&_(i,n,o);const d=Array.isArray(i)?i[i.length-1]:i,l=tt(d,n,o),{month:h,day:c,year:p,hour:m,minute:y}=l,u=K(m);this.activeParts=a?Array.isArray(i)?[...i]:{month:h,day:c,year:p,hour:m,minute:y,ampm:u}:[];const b=void 0!==h&&h!==r.month||void 0!==p&&p!==r.year,g=s.classList.contains("datetime-ready"),{isGridStyle:x,showMonthAndYear:f}=this;x&&b&&g&&!f&&e?this.animateToDate(l):this.setWorkingParts({month:h,day:c,year:p,hour:m,minute:y,ampm:u})},this.animateToDate=async t=>{const{workingParts:e}=this;this.forceRenderDate=t;const a=new Promise((t=>{this.resolveForceDateScrolling=t}));V(t,e)?this.prevMonth():this.nextMonth(),await a,this.resolveForceDateScrolling=void 0,this.forceRenderDate=void 0},this.onFocus=()=>{this.ionFocus.emit()},this.onBlur=()=>{this.ionBlur.emit()},this.hasValue=()=>null!=this.value,this.nextMonth=()=>{const t=this.calendarBodyRef;if(!t)return;const e=t.querySelector(".calendar-month:last-of-type");if(!e)return;const a=2*e.offsetWidth,i=o.getBoolean("animated",!0)?"smooth":"instant";t.scrollTo({top:0,left:a*(y(this.el)?-1:1),behavior:i})},this.prevMonth=()=>{const t=this.calendarBodyRef;if(!t)return;const e=t.querySelector(".calendar-month:first-of-type");if(!e)return;const a=2*e.offsetWidth,i=o.getBoolean("animated",!0)?"smooth":"instant";t.scrollTo({top:0,left:a*(y(this.el)?1:-1),behavior:i})},this.toggleMonthAndYearView=()=>{this.showMonthAndYear=!this.showMonthAndYear}}formatOptionsChanged(){const{el:t,formatOptions:e,presentation:a}=this;Pt(t,a,e),Ct(t,e)}disabledChanged(){this.emitStyle()}minChanged(){this.processMinParts()}maxChanged(){this.processMaxParts()}presentationChanged(){const{el:t,formatOptions:e,presentation:a}=this;Pt(t,a,e)}get isGridStyle(){const{presentation:t,preferWheel:e}=this;return("date"===t||"date-time"===t||"time-date"===t)&&!e}yearValuesChanged(){this.parsedYearValues=et(this.yearValues)}monthValuesChanged(){this.parsedMonthValues=et(this.monthValues)}dayValuesChanged(){this.parsedDayValues=et(this.dayValues)}hourValuesChanged(){this.parsedHourValues=et(this.hourValues)}minuteValuesChanged(){this.parsedMinuteValues=et(this.minuteValues)}async valueChanged(){const{value:t}=this;this.hasValue()&&this.processValue(t),this.emitStyle(),this.ionValueChange.emit({value:t})}async confirm(t=!1){const{isCalendarPicker:e,activeParts:a,preferWheel:i,workingParts:n}=this;if(void 0!==a||!e){const t=Array.isArray(a);this.setValue(t&&0===a.length?i?at(n):void 0:at(a))}this.hasUnconfirmedSelection=!1,t&&this.closeParentOverlay(zt)}async reset(t){this.processValue(t)}async cancel(t=!1){this.ionCancel.emit(),t&&this.closeParentOverlay(jt)||this.processValue(this.value)}async getDefaultPart(){return this.defaultParts}get isCalendarPicker(){const{presentation:t}=this;return"date"===t||"date-time"===t||"time-date"===t}connectedCallback(){this.clearFocusVisible=l(this.el).destroy,this.loadTimeout=setTimeout((()=>{this.ensureReadyIfVisible()}),100),this.initializeOverlayPresentListener()}disconnectedCallback(){this.clearFocusVisible&&(this.clearFocusVisible(),this.clearFocusVisible=void 0),this.loadTimeoutCleanup(),this.destroyOverlayPresentListener&&(this.destroyOverlayPresentListener(),this.destroyOverlayPresentListener=void 0)}initializeOverlayPresentListener(){const t=this.el.closest("ion-modal, ion-popover");if(!t)return;const e="ION-MODAL"===t.tagName?"ionModalWillPresent":"ionPopoverWillPresent",a=e=>{e.target===t&&this.hasUnconfirmedSelection&&this.processValue(this.value,!1)};t.addEventListener(e,a),this.destroyOverlayPresentListener=()=>t.removeEventListener(e,a)}initializeListeners(){this.initializeCalendarListener(),this.initializeKeyboardListeners()}componentDidLoad(){const{el:t,intersectionTrackerRef:e}=this,a=new IntersectionObserver((t=>{t[t.length-1].isIntersecting&&this.markReady()}),{threshold:.01,root:t});h((()=>a?.observe(e))),this.loadTimeoutCleanup(),this.loadTimeout=setTimeout((()=>{this.ensureReadyIfVisible()}),100);const i=new IntersectionObserver((t=>{t[t.length-1].isIntersecting||this.hasLayoutBox()||(this.destroyInteractionListeners(),this.showMonthAndYear=!1,n((()=>{this.el.classList.remove("datetime-ready")})))}),{threshold:0,root:t});h((()=>i?.observe(e)));const o=c(this.el);o.addEventListener("ionFocus",(t=>t.stopPropagation())),o.addEventListener("ionBlur",(t=>t.stopPropagation()))}componentDidRender(){const{presentation:t,prevPresentation:e,calendarBodyRef:a,minParts:i,preferWheel:n,forceRenderDate:o}=this,r=!n&&["date-time","time-date","date"].includes(t);if(void 0!==i&&r&&a){const t=a.querySelector(".calendar-month:nth-of-type(1)");t&&void 0===o&&(a.scrollLeft=t.clientWidth*(y(this.el)?-1:1))}null!==e?t!==e&&(this.prevPresentation=t,this.destroyInteractionListeners(),this.initializeListeners(),this.showMonthAndYear=!1,h((()=>{this.ionRender.emit()}))):this.prevPresentation=t}componentWillLoad(){const{el:t,formatOptions:a,highlightedDates:i,multiple:n,presentation:o,preferWheel:r}=this;n&&("date"!==o&&e('[ion-datetime] - Multiple date selection is only supported for presentation="date".',t),r&&e('[ion-datetime] - Multiple date selection is not supported with preferWheel="true".',t)),void 0!==i&&("date"!==o&&"date-time"!==o&&"time-date"!==o&&e("[ion-datetime] - The highlightedDates property is only supported with the date, date-time, and time-date presentations.",t),r&&e('[ion-datetime] - The highlightedDates property is not supported with preferWheel="true".',t)),a&&(Pt(t,o,a),Ct(t,a));const s=this.parsedHourValues=et(this.hourValues),d=this.parsedMinuteValues=et(this.minuteValues),l=this.parsedMonthValues=et(this.monthValues),h=this.parsedYearValues=et(this.yearValues),c=this.parsedDayValues=et(this.dayValues),p=this.todayParts=Q(k(new Date).toISOString());this.processMinParts(),this.processMaxParts(),this.defaultParts=it({refParts:p,monthValues:l,dayValues:c,yearValues:h,hourValues:s,minuteValues:d,minParts:this.minParts,maxParts:this.maxParts}),this.processValue(this.value),this.emitStyle()}emitStyle(){this.ionStyle.emit({interactive:!0,datetime:!0,"interactive-disabled":this.disabled})}renderFooter(){const{disabled:t,readonly:e,showDefaultButtons:a,showClearButton:i}=this,n=t||e;if(null===this.el.querySelector('[slot="buttons"]')&&!a&&!i)return;const o=()=>{this.reset(),this.setValue(void 0)};return r("div",{class:"datetime-footer"},r("div",{class:"datetime-buttons"},r("div",{class:{"datetime-action-buttons":!0,"has-clear-button":this.showClearButton}},r("slot",{name:"buttons"},r("ion-buttons",null,a&&r("ion-button",{id:"cancel-button",color:this.color,onClick:()=>this.cancel(!0),disabled:n},this.cancelText),r("div",{class:"datetime-action-buttons-container"},i&&r("ion-button",{id:"clear-button",color:this.color,onClick:()=>o(),disabled:n},this.clearText),a&&r("ion-button",{id:"confirm-button",color:this.color,onClick:()=>this.confirm(!0),disabled:n},this.doneText)))))))}renderWheelPicker(t=this.presentation){const e="time-date"===t?[this.renderTimePickerColumns(t),this.renderDatePickerColumns(t)]:[this.renderDatePickerColumns(t),this.renderTimePickerColumns(t)];return r("ion-picker",{class:m},e)}renderDatePickerColumns(t){return"date-time"===t||"time-date"===t?this.renderCombinedDatePickerColumn():this.renderIndividualDatePickerColumns(t)}renderCombinedDatePickerColumn(){const{defaultParts:e,disabled:a,workingParts:i,locale:n,minParts:o,maxParts:s,todayParts:d,isDateEnabled:l}=this,h=gt(i),c=h[h.length-1];h[0].day=1,c.day=W(c.month,c.year);const p=((t,e,a,i,n,o)=>{let r=[],s=[],d=ft(a,i);return o&&(d=d.filter((({month:t})=>o.includes(t)))),d.forEach((o=>{const d={month:o.month,day:null,year:o.year},l=xt(t,d,a,i,n,{month:"short",day:"numeric",weekday:"short"}),h=[],c=[];l.forEach((a=>{const i=I({...d,day:a.value},e);c.push({text:i?D(t):a.text,value:`${d.year}-${d.month}-${a.value}`}),h.push({month:d.month,year:d.year,day:a.value})})),s=[...s,...h],r=[...r,...c]})),{parts:s,items:r}})(n,d,void 0!==o&&S(o,h[0])?o:h[0],void 0!==s&&V(s,c)?s:c,this.parsedDayValues,this.parsedMonthValues);let m=p.items;const y=p.parts;l&&(m=m.map(((e,a)=>{const i=y[a];let n;try{n=!l(at(i))}catch(e){t("[ion-datetime] - Exception thrown from provided `isDateEnabled` function. Please check your function and try again.",e)}return{...e,disabled:n}})));const u=null!==i.day?`${i.year}-${i.month}-${i.day}`:`${e.year}-${e.month}-${e.day}`;return r("ion-picker-column",{part:Tt,"aria-label":"Select a date",class:"date-column",color:this.color,disabled:a,value:u,onIonChange:t=>{const{value:e}=t.detail,a=y.find((({month:t,day:a,year:i})=>e===`${i}-${t}-${a}`)),i=this.getActivePartsWithFallback();this.setWorkingParts({...this.workingParts,...a}),this.setActiveParts({...i,...a}),t.stopPropagation()}},m.map((t=>r("ion-picker-column-option",{color:this.color,part:t.value===u?`${At} ${Ot}`:At,key:t.value,disabled:t.disabled,value:t.value},t.text))))}renderIndividualDatePickerColumns(e){const{workingParts:a,isDateEnabled:i}=this,n="year"!==e&&"time"!==e?((t,e,a,i,n,o={month:"long"})=>{const{year:r}=e,s=[];if(void 0!==n){let e=n;void 0!==i?.month&&i.year===r&&(e=e.filter((t=>t<=i.month))),void 0!==a?.month&&a.year===r&&(e=e.filter((t=>t>=a.month))),e.forEach((e=>{const a=new Date(`${e}/1/${r} GMT+0000`),i=new Intl.DateTimeFormat(t,{...o,timeZone:"UTC"}).format(a);s.push({text:i,value:e})}))}else{const e=i&&i.year===r?i.month:12;for(let i=a&&a.year===r?a.month:1;i<=e;i++){const e=new Date(`${i}/1/${r} GMT+0000`),a=new Intl.DateTimeFormat(t,{...o,timeZone:"UTC"}).format(e);s.push({text:a,value:i})}}return s})(this.locale,a,this.minParts,this.maxParts,this.parsedMonthValues):[];let o="date"===e?xt(this.locale,a,this.minParts,this.maxParts,this.parsedDayValues):[];i&&(o=o.map((e=>{const{value:n}=e,o="string"==typeof n?parseInt(n):n,r={month:a.month,day:o,year:a.year};let s;try{s=!i(at(r))}catch(e){t("[ion-datetime] - Exception thrown from provided `isDateEnabled` function. Please check your function and try again.",e)}return{...e,disabled:s}})));const r="month"!==e&&"time"!==e?((t,e,a,i,n)=>{let o=[];if(void 0!==n)o=n,void 0!==i?.year&&(o=o.filter((t=>t<=i.year))),void 0!==a?.year&&(o=o.filter((t=>t>=a.year)));else{const{year:t}=e,n=i?.year??t;for(let e=a?.year??t-100;e<=n;e++)o.push(e)}return o.map((a=>({text:$(t,{year:a,month:e.month,day:e.day}),value:a})))})(this.locale,this.defaultParts,this.minParts,this.maxParts,this.parsedYearValues):[];let s=[];return s=nt(this.locale,{month:"numeric",day:"numeric"})?[this.renderMonthPickerColumn(n),this.renderDayPickerColumn(o),this.renderYearPickerColumn(r)]:[this.renderDayPickerColumn(o),this.renderMonthPickerColumn(n),this.renderYearPickerColumn(r)],s}renderDayPickerColumn(t){if(0===t.length)return[];const{disabled:e,workingParts:a}=this,i=(null!==a.day?a.day:this.defaultParts.day)??void 0;return r("ion-picker-column",{part:Tt,"aria-label":"Select a day",class:"day-column",color:this.color,disabled:e,value:i,onIonChange:t=>{const e=this.getActivePartsWithFallback();this.setWorkingParts({...this.workingParts,day:t.detail.value}),this.setActiveParts({...e,day:t.detail.value}),t.stopPropagation()}},t.map((t=>r("ion-picker-column-option",{color:this.color,part:t.value===i?`${At} ${Ot}`:At,key:t.value,disabled:t.disabled,value:t.value},t.text))))}renderMonthPickerColumn(t){if(0===t.length)return[];const{disabled:e,workingParts:a}=this;return r("ion-picker-column",{part:Tt,"aria-label":"Select a month",class:"month-column",color:this.color,disabled:e,value:a.month,onIonChange:t=>{const e=this.getActivePartsWithFallback();this.setWorkingParts({...this.workingParts,month:t.detail.value}),this.multiple||this.setActiveParts({...e,month:t.detail.value}),t.stopPropagation()}},t.map((t=>r("ion-picker-column-option",{color:this.color,part:t.value===a.month?`${At} ${Ot}`:At,key:t.value,disabled:t.disabled,value:t.value},t.text))))}renderYearPickerColumn(t){if(0===t.length)return[];const{disabled:e,workingParts:a}=this;return r("ion-picker-column",{part:Tt,"aria-label":"Select a year",class:"year-column",color:this.color,disabled:e,value:a.year,onIonChange:t=>{const e=this.getActivePartsWithFallback();this.setWorkingParts({...this.workingParts,year:t.detail.value}),this.multiple||this.setActiveParts({...e,year:t.detail.value}),t.stopPropagation()}},t.map((t=>r("ion-picker-column-option",{color:this.color,part:t.value===a.year?`${At} ${Ot}`:At,key:t.value,disabled:t.disabled,value:t.value},t.text))))}renderTimePickerColumns(t){if(["date","month","month-year","year"].includes(t))return[];const e=void 0!==this.getActivePart(),{hoursData:a,minutesData:i,dayPeriodData:n}=((t,e,a,i,n,o,r)=>{const s=j(t,this.hourCycle),d=M(s),{hours:l,minutes:h,am:c,pm:p}=bt(t,e,s,i,n,o,r),m=l.map((t=>({text:T(t,s),value:z(t,d,e.ampm)}))),y=h.map((t=>({text:A(t),value:t}))),u=[];return c&&!d&&u.push({text:O(t,"am"),value:"am"}),p&&!d&&u.push({text:O(t,"pm"),value:"pm"}),{minutesData:y,hoursData:m,dayPeriodData:u}})(this.locale,this.workingParts,0,e?this.minParts:void 0,e?this.maxParts:void 0,this.parsedHourValues,this.parsedMinuteValues);return[this.renderHourPickerColumn(a),this.renderMinutePickerColumn(i),this.renderDayPeriodPickerColumn(n)]}renderHourPickerColumn(t){const{disabled:e}=this;if(0===t.length)return[];const a=this.getActivePartsWithFallback();return r("ion-picker-column",{part:Tt,"aria-label":"Select an hour",color:this.color,disabled:e,value:a.hour,numericInput:!0,onIonChange:t=>{this.setWorkingParts({...this.workingParts,hour:t.detail.value}),this.setActiveParts({...this.getActivePartsWithFallback(),hour:t.detail.value}),t.stopPropagation()}},t.map((t=>r("ion-picker-column-option",{color:this.color,part:t.value===a.hour?`${At} ${Ot}`:At,key:t.value,disabled:t.disabled,value:t.value},t.text))))}renderMinutePickerColumn(t){const{disabled:e}=this;if(0===t.length)return[];const a=this.getActivePartsWithFallback();return r("ion-picker-column",{part:Tt,"aria-label":"Select a minute",color:this.color,disabled:e,value:a.minute,numericInput:!0,onIonChange:t=>{this.setWorkingParts({...this.workingParts,minute:t.detail.value}),this.setActiveParts({...this.getActivePartsWithFallback(),minute:t.detail.value}),t.stopPropagation()}},t.map((t=>r("ion-picker-column-option",{color:this.color,part:t.value===a.minute?`${At} ${Ot}`:At,key:t.value,disabled:t.disabled,value:t.value},t.text))))}renderDayPeriodPickerColumn(t){const{disabled:e}=this;if(0===t.length)return[];const a=this.getActivePartsWithFallback(),i=ot(this.locale);return r("ion-picker-column",{part:Tt,"aria-label":"Select a day period",style:i?{order:"-1"}:{},color:this.color,disabled:e,value:a.ampm,onIonChange:t=>{const e=this.workingParts,a=rt(e,t.detail.value);this.setWorkingParts({...e,ampm:t.detail.value,hour:a}),this.setActiveParts({...this.getActivePartsWithFallback(),ampm:t.detail.value,hour:a}),t.stopPropagation()}},t.map((t=>r("ion-picker-column-option",{color:this.color,part:t.value===a.ampm?`${At} ${Ot}`:At,key:t.value,disabled:t.disabled,value:t.value},t.text))))}renderWheelView(t){const{locale:e}=this,a=nt(e)?"month-first":"year-first";return r("div",{class:{[`wheel-order-${a}`]:!0}},this.renderWheelPicker(t))}renderCalendarHeader(t){const{disabled:e}=this,a="ios"===t?b:g,i="ios"===t?x:f,n=e||((t,e,a)=>{const i={...P(this.workingParts),day:null};return kt(i,{minParts:e,maxParts:a})})(0,this.minParts,this.maxParts),o=e||((t,e)=>{const a={...C(this.workingParts),day:null};return kt(a,{maxParts:e})})(0,this.maxParts),s=y(this.el)?"rtl":"ltr";return r("div",{class:"calendar-header",part:"calendar-header"},r("div",{class:"calendar-action-buttons"},r("div",{class:"calendar-month-year"},r("button",{class:{"calendar-month-year-toggle":!0,"ion-activatable":!0,"ion-focusable":!0},part:"month-year-button",disabled:e,"aria-label":this.showMonthAndYear?"Hide year picker":"Show year picker",onClick:()=>this.toggleMonthAndYearView()},r("span",{id:"toggle-wrapper"},st(this.locale,this.workingParts),r("ion-icon",{dir:s,"aria-hidden":"true",icon:this.showMonthAndYear?a:i,lazy:!1,flipRtl:!0})),"md"===t&&r("ion-ripple-effect",null))),r("div",{class:"calendar-next-prev"},r("ion-buttons",null,r("ion-button",{"aria-label":"Previous month",disabled:n,onClick:()=>this.prevMonth(),part:"navigation-button previous-button"},r("ion-icon",{dir:s,"aria-hidden":"true",slot:"icon-only",icon:v,lazy:!1,flipRtl:!0})),r("ion-button",{"aria-label":"Next month",disabled:o,onClick:()=>this.nextMonth(),part:"navigation-button next-button"},r("ion-icon",{dir:s,"aria-hidden":"true",slot:"icon-only",icon:x,lazy:!1,flipRtl:!0}))))),r("div",{class:"calendar-days-of-week","aria-hidden":"true",part:"calendar-days-of-week"},((t,e,a=0)=>{const i=new Intl.DateTimeFormat(this.locale,{weekday:"ios"===e?"short":"narrow"}),n=new Date("11/01/2020"),o=[];for(let t=a;t<a+7;t++){const e=new Date(n);e.setDate(e.getDate()+t),o.push(i.format(e))}return o})(0,t,this.firstDayOfWeek%7).map((t=>r("div",{class:"day-of-week"},t)))))}renderMonth(e,a){const{disabled:i,readonly:n}=this,o=void 0===this.parsedYearValues||this.parsedYearValues.includes(a),s=void 0===this.parsedMonthValues||this.parsedMonthValues.includes(e),d=!o||!s,l=i||n,h=i||kt({month:e,year:a,day:null},{minParts:{...this.minParts,day:null},maxParts:{...this.maxParts,day:null}}),c=this.workingParts.month===e&&this.workingParts.year===a,p=this.getActivePartsWithFallback();return r("div",{"aria-hidden":c?null:"true",class:{"calendar-month":!0,"calendar-month-disabled":!c&&h}},r("div",{class:"calendar-month-grid"},((t,e,a,i=!1)=>{const n=W(t,e);let o;o=1===t?W(12,e-1):W(t-1,e);const r=new Date(`${t}/1/${e}`).getDay(),s=r>=a?r-(a+1):6-(a-r);let d=[];for(let t=1;t<=n;t++)d.push({day:t,dayOfWeek:(s+t)%7,isAdjacentDay:!1});if(i){for(let t=0;t<=s;t++)d=[{day:o-t,dayOfWeek:(o-t)%7,isAdjacentDay:!0},...d];const t=41-(n+s);for(let e=0;e<t;e++)d.push({day:e+1,dayOfWeek:(n+s+e)%7,isAdjacentDay:!0})}else for(let t=0;t<=s;t++)d=[{day:null,dayOfWeek:null,isAdjacentDay:!1},...d];return d})(e,a,this.firstDayOfWeek%7,this.showAdjacentDays).map(((i,n)=>{const{day:o,dayOfWeek:s,isAdjacentDay:h}=i,{el:c,highlightedDates:m,isDateEnabled:y,multiple:u,showAdjacentDays:b}=this;let g=e,x=a;b&&h&&null!==o&&(o>20?1===e?(x=a-1,g=12):g=e-1:o<15&&(12===e?(x=a+1,g=1):g=e+1));const f={month:g,day:o,year:x,isAdjacentDay:h},v=null===o,{isActive:w,isToday:k,ariaLabel:C,ariaSelected:P,disabled:D,text:$}=wt(this.locale,f,this.activeParts,this.todayParts,this.minParts,this.maxParts,this.parsedDayValues),j=at(f);let z=d||D;if(!z&&void 0!==y)try{z=!y(j)}catch(e){t("[ion-datetime] - Exception thrown from provided `isDateEnabled` function. Please check your function and try again.",c,e)}const T=z&&l,A=z||l;let O,V;return void 0===m||w||null===o||h||(O=((e,a,i)=>{if(Array.isArray(e)){const t=a.split("T")[0],i=e.find((e=>e.date===t));if(i)return{textColor:i.textColor,backgroundColor:i.backgroundColor,border:i.border}}else try{return e(a)}catch(e){t("[ion-datetime] - Exception thrown from provided `highlightedDates` callback. Please check your function and try again.",i,e)}})(m,j,c)),v||h?h&&(V="calendar-day"+(z?" disabled":"")):V=`calendar-day${w?" active":""}${k?" today":""}${z?" disabled":""}`,r("div",{class:"calendar-day-wrapper"},r("button",{ref:t=>{t&&(t.style.setProperty("color",`${O?O.textColor:""}`,"important"),t.style.setProperty("background-color",`${O?O.backgroundColor:""}`,"important"),t.style.setProperty("border",`${O?O.border:""}`,"important"))},tabindex:"-1","data-day":o,"data-month":g,"data-year":x,"data-index":n,"data-day-of-week":s,disabled:A,class:{"calendar-day-padding":v,"calendar-day":!0,"calendar-day-active":w,"calendar-day-constrained":T,"calendar-day-today":k,"calendar-day-adjacent-day":h},part:V,"aria-hidden":v?"true":null,"aria-selected":P,"aria-label":C,onClick:()=>{v||(h?(this.el.blur(),this.activeParts={...p,...f},this.animateToDate(f),this.confirm()):(this.setWorkingParts({...this.workingParts,...f}),u?this.setActiveParts(f,w):this.setActiveParts({...p,...f})))}},$))}))))}renderCalendarBody(){return r("div",{class:"calendar-body ion-focusable",ref:t=>this.calendarBodyRef=t,tabindex:"0"},gt(this.workingParts,this.forceRenderDate).map((({month:t,year:e})=>this.renderMonth(t,e))))}renderCalendar(t){return r("div",{class:"datetime-calendar",key:"datetime-calendar"},this.renderCalendarHeader(t),this.renderCalendarBody())}renderTimeLabel(){if(null!==this.el.querySelector('[slot="time-label"]')||this.showDefaultTimeLabel)return r("slot",{name:"time-label"},"Time")}renderTimeOverlay(){const{disabled:t,hourCycle:e,isTimePopoverOpen:a,locale:i,formatOptions:n}=this,o=j(i,e),s=this.getActivePartsWithFallback();return[r("div",{class:"time-header"},this.renderTimeLabel()),r("button",{class:{"time-body":!0,"time-body-active":a},part:"time-button"+(a?" active":""),"aria-expanded":"false","aria-haspopup":"true",disabled:t,onClick:async t=>{const{popoverRef:e}=this;e&&(this.isTimePopoverOpen=!0,e.present(new CustomEvent("ionShadowTarget",{detail:{ionShadowTarget:t.target}})),await e.onWillDismiss(),this.isTimePopoverOpen=!1)}},dt(i,s,o,n?.time)),r("ion-popover",{alignment:"center",translucent:!0,overlayIndex:1,arrow:!1,onWillPresent:t=>{t.target.querySelectorAll("ion-picker-column").forEach((t=>t.scrollActiveItemIntoView()))},style:{"--offset-y":"-10px","--min-width":"fit-content"},keyboardEvents:!0,ref:t=>this.popoverRef=t},this.renderWheelPicker("time"))]}getHeaderSelectedDateText(){const{activeParts:e,formatOptions:a,multiple:i,titleSelectedDatesFormatter:n}=this,o=Array.isArray(e);let r;if(i&&o&&1!==e.length){if(r=`${e.length} days`,void 0!==n)try{r=n(at(e))}catch(e){t("[ion-datetime] - Exception in provided `titleSelectedDatesFormatter`:",e)}}else r=lt(this.locale,this.getActivePartsWithFallback(),a?.date??{weekday:"short",month:"short",day:"numeric"});return r}renderHeader(t=!0){if(null!==this.el.querySelector('[slot="title"]')||this.showDefaultTitle)return r("div",{class:"datetime-header",part:"datetime-header"},r("div",{class:"datetime-title",part:"datetime-title"},r("slot",{name:"title"},"Select Date")),t&&r("div",{class:"datetime-selected-date",part:"datetime-selected-date"},this.getHeaderSelectedDateText()))}renderTime(){const{presentation:t}=this;return r("div",{class:"datetime-time"},"time"===t?this.renderWheelPicker():this.renderTimeOverlay())}renderCalendarViewMonthYearPicker(){return r("div",{class:"datetime-year"},this.renderWheelView("month-year"))}renderDatetime(t){const{presentation:e,preferWheel:a}=this;if(a&&("date"===e||"date-time"===e||"time-date"===e))return[this.renderHeader(!1),this.renderWheelView(),this.renderFooter()];switch(e){case"date-time":return[this.renderHeader(),this.renderCalendar(t),this.renderCalendarViewMonthYearPicker(),this.renderTime(),this.renderFooter()];case"time-date":return[this.renderHeader(),this.renderTime(),this.renderCalendar(t),this.renderCalendarViewMonthYearPicker(),this.renderFooter()];case"time":return[this.renderHeader(!1),this.renderTime(),this.renderFooter()];case"month":case"month-year":case"year":return[this.renderHeader(!1),this.renderWheelView(),this.renderFooter()];default:return[this.renderHeader(),this.renderCalendar(t),this.renderCalendarViewMonthYearPicker(),this.renderFooter()]}}render(){const{name:t,value:e,disabled:a,el:i,color:n,readonly:o,showMonthAndYear:d,preferWheel:l,presentation:h,size:c,isGridStyle:m}=this,y=w(this),b="year"===h||"month"===h||"month-year"===h,g=d||b,x=d&&!b,f=("date"===h||"date-time"===h||"time-date"===h)&&l;return p(!0,i,t,ht(e),a),r(s,{key:"465c9c22bccabc4a82ea4054c536c6086b85ddf9","aria-disabled":a?"true":null,onFocus:this.onFocus,onBlur:this.onBlur,class:{...u(n,{[y]:!0,"datetime-readonly":o,"datetime-disabled":a,"show-month-and-year":g,"month-year-picker-open":x,[`datetime-presentation-${h}`]:!0,[`datetime-size-${c}`]:!0,"datetime-prefer-wheel":f,"datetime-grid":m})}},r("div",{key:"9732b003440a0ca23520bc8a09e73125d88fd565",class:"intersection-tracker",ref:t=>this.intersectionTrackerRef=t}),this.renderDatetime(y))}get el(){return d(this)}static get watchers(){return{formatOptions:[{formatOptionsChanged:0}],disabled:[{disabledChanged:0}],min:[{minChanged:0}],max:[{maxChanged:0}],presentation:[{presentationChanged:0}],yearValues:[{yearValuesChanged:0}],monthValues:[{monthValuesChanged:0}],dayValues:[{dayValuesChanged:0}],hourValues:[{hourValuesChanged:0}],minuteValues:[{minuteValuesChanged:0}],value:[{valueChanged:0}]}}};let $t=0;const jt="datetime-cancel",zt="datetime-confirm",Tt="wheel",At="wheel-item",Ot="active";Dt.style={ios:':host{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;background:var(--background);overflow:hidden}:host(.datetime-size-fixed){width:auto;height:auto}:host(.datetime-size-fixed:not(.datetime-prefer-wheel)){max-width:350px}:host(.datetime-size-fixed.datetime-prefer-wheel){min-width:350px;max-width:-webkit-max-content;max-width:-moz-max-content;max-width:max-content}:host(.datetime-size-cover){width:100%}:host .calendar-body,:host .datetime-year{opacity:0}:host(:not(.datetime-ready)) .datetime-year{position:absolute;pointer-events:none}:host(.datetime-ready) .calendar-body{opacity:1}:host(.datetime-ready) .datetime-year{display:none;opacity:1}:host .wheel-order-year-first .day-column{-ms-flex-order:3;order:3;text-align:end}:host .wheel-order-year-first .month-column{-ms-flex-order:2;order:2;text-align:end}:host .wheel-order-year-first .year-column{-ms-flex-order:1;order:1;text-align:start}:host .datetime-calendar,:host .datetime-year{display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-flow:column;flex-flow:column}:host(.show-month-and-year) .datetime-year{display:-ms-flexbox;display:flex}:host(.show-month-and-year) .calendar-next-prev,:host(.show-month-and-year) .calendar-days-of-week,:host(.show-month-and-year) .calendar-body,:host(.show-month-and-year) .datetime-time{display:none}:host(.month-year-picker-open) .datetime-footer{display:none}:host(.datetime-disabled){pointer-events:none}:host(.datetime-disabled) .calendar-days-of-week,:host(.datetime-disabled) .datetime-time{opacity:0.4}:host(.datetime-readonly){pointer-events:none;}:host(.datetime-readonly) .calendar-action-buttons,:host(.datetime-readonly) .calendar-body,:host(.datetime-readonly) .datetime-year{pointer-events:initial}:host(.datetime-readonly) .calendar-day[disabled]:not(.calendar-day-constrained),:host(.datetime-readonly) .datetime-action-buttons ion-button[disabled]{opacity:1}:host .datetime-header .datetime-title{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}:host .datetime-action-buttons.has-clear-button{width:100%}:host .datetime-action-buttons ion-buttons{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host .datetime-action-buttons ion-button{--color:var(--ion-color-primary, #0054e9)}.datetime-action-buttons .datetime-action-buttons-container{display:-ms-flexbox;display:flex}:host .calendar-action-buttons{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host .calendar-action-buttons ion-button{--background:transparent}:host .calendar-days-of-week{display:grid;grid-template-columns:repeat(7, 1fr);text-align:center}.calendar-days-of-week .day-of-week{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:0;margin-bottom:0}:host .calendar-body{display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-webkit-scroll-snap-type:x mandatory;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;overflow-x:scroll;overflow-y:hidden;scrollbar-width:none;outline:none}:host .calendar-body .calendar-month{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;scroll-snap-align:start;scroll-snap-stop:always;-ms-flex-negative:0;flex-shrink:0;width:100%}:host .calendar-body .calendar-month-disabled{scroll-snap-align:none}:host .calendar-body::-webkit-scrollbar{display:none}:host .calendar-body .calendar-month-grid{display:grid;grid-template-columns:repeat(7, 1fr)}:host .calendar-day-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;min-width:0;min-height:0;overflow:visible}.calendar-day{border-radius:50%;-webkit-padding-start:0px;padding-inline-start:0px;-webkit-padding-end:0px;padding-inline-end:0px;padding-top:0px;padding-bottom:0px;-webkit-margin-start:0px;margin-inline-start:0px;-webkit-margin-end:0px;margin-inline-end:0px;margin-top:0px;margin-bottom:0px;display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border:none;outline:none;background:none;color:currentColor;font-family:var(--ion-font-family, inherit);cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;z-index:0}:host .calendar-day[disabled]{pointer-events:none;opacity:0.4}.calendar-day:not(.calendar-day-adjacent-day):focus{background:rgba(var(--ion-color-primary-rgb, 0, 84, 233), 0.2);-webkit-box-shadow:0px 0px 0px 4px rgba(var(--ion-color-primary-rgb, 0, 84, 233), 0.2);box-shadow:0px 0px 0px 4px rgba(var(--ion-color-primary-rgb, 0, 84, 233), 0.2)}:host(.ion-color) .calendar-day:not(.calendar-day-adjacent-day):focus{background:rgba(var(--ion-color-base-rgb), 0.2);-webkit-box-shadow:0px 0px 0px 4px rgba(var(--ion-color-base-rgb), 0.2);box-shadow:0px 0px 0px 4px rgba(var(--ion-color-base-rgb), 0.2)}:host .datetime-time{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host(.datetime-presentation-time) .datetime-time{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0}:host ion-popover{--height:200px}:host .time-header{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .time-body{border-radius:8px;-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px;padding-top:6px;padding-bottom:6px;display:-ms-flexbox;display:flex;border:none;background:var(--ion-color-step-300, var(--ion-background-color-step-300, #edeef0));color:var(--ion-text-color, #000);font-family:inherit;font-size:inherit;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none}:host .time-body-active{color:var(--ion-color-primary, #0054e9)}:host(.ion-color) .time-body-active{color:var(--ion-color-base)}:host(.in-item){position:static}:host(.show-month-and-year) .calendar-action-buttons .calendar-month-year-toggle{color:var(--ion-color-primary, #0054e9)}:host(.ion-color.show-month-and-year) .calendar-action-buttons .calendar-month-year-toggle{color:var(--ion-color-base)}.calendar-month-year{min-width:0}.calendar-month-year-toggle{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;position:relative;border:0;outline:none;background:transparent;cursor:pointer;z-index:1}.calendar-month-year-toggle::after{left:0;right:0;top:0;bottom:0;position:absolute;content:"";opacity:0;-webkit-transition:opacity 15ms linear, background-color 15ms linear;transition:opacity 15ms linear, background-color 15ms linear;z-index:-1}.calendar-month-year-toggle.ion-focused::after{background:currentColor}.calendar-month-year-toggle:disabled{opacity:0.3;pointer-events:none}.calendar-month-year-toggle ion-icon{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:0;padding-inline-end:0;padding-top:0;padding-bottom:0;-ms-flex-negative:0;flex-shrink:0}.calendar-month-year-toggle #toggle-wrapper{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center}ion-picker{--highlight-background:var(--wheel-highlight-background);--highlight-border-radius:var(--wheel-highlight-border-radius);--fade-background-rgb:var(--wheel-fade-background-rgb)}:host{--background:var(--ion-color-light, #f4f5f8);--background-rgb:var(--ion-color-light-rgb, 244, 245, 248);--title-color:var(--ion-color-step-600, var(--ion-text-color-step-400, #666666))}:host(.datetime-presentation-date-time:not(.datetime-prefer-wheel)),:host(.datetime-presentation-time-date:not(.datetime-prefer-wheel)),:host(.datetime-presentation-date:not(.datetime-prefer-wheel)){min-height:350px}:host .datetime-header{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:16px;padding-bottom:16px;border-bottom:0.55px solid var(--ion-color-step-200, var(--ion-background-color-step-200, #cccccc));font-size:min(0.875rem, 22.4px)}:host .datetime-header .datetime-title{color:var(--title-color)}:host .datetime-header .datetime-selected-date{margin-top:10px}.calendar-month-year-toggle{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:0px;padding-bottom:0px;min-height:44px;font-size:min(1rem, 25.6px);font-weight:600}.calendar-month-year-toggle.ion-focused::after{opacity:0.15}.calendar-month-year-toggle #toggle-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:8px;margin-inline-end:8px;margin-top:10px;margin-bottom:10px}:host .calendar-action-buttons .calendar-month-year-toggle ion-icon,:host .calendar-action-buttons ion-buttons ion-button{color:var(--ion-color-primary, #0054e9)}:host(.ion-color) .calendar-action-buttons .calendar-month-year-toggle ion-icon,:host(.ion-color) .calendar-action-buttons ion-buttons ion-button{color:var(--ion-color-base)}:host .calendar-action-buttons ion-buttons{-ms-flex-align:stretch;align-items:stretch;height:100%}:host .calendar-action-buttons ion-buttons ion-button{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}:host .calendar-days-of-week{-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px;padding-top:0;padding-bottom:0;color:var(--ion-color-step-300, var(--ion-text-color-step-700, #b3b3b3));font-size:min(0.75rem, 19.2px);font-weight:600;line-height:24px;text-transform:uppercase}@supports (border-radius: mod(1px, 1px)){.calendar-days-of-week .day-of-week{width:clamp(20px, calc(mod(min(1rem, 24px), 24px) * 10), 100%);height:24px;overflow:hidden}.calendar-day{border-radius:max(8px, mod(min(1rem, 24px), 24px) * 10)}}@supports ((border-radius: mod(1px, 1px)) and (background: -webkit-named-image(apple-pay-logo-black)) and (not (contain-intrinsic-size: none))) or (not (border-radius: mod(1px, 1px))){.calendar-days-of-week .day-of-week{width:auto;height:auto;overflow:initial}.calendar-day{border-radius:32px}}:host .calendar-body .calendar-month .calendar-month-grid{-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px;padding-top:8px;padding-bottom:8px;-ms-flex-align:center;align-items:center;height:calc(100% - 16px)}:host .calendar-day-wrapper{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px;padding-top:4px;padding-bottom:4px;height:0;min-height:1rem}:host .calendar-day{width:40px;min-width:40px;height:40px;font-size:min(1.25rem, 32px)}.calendar-day.calendar-day-active{background:rgba(var(--ion-color-primary-rgb, 0, 84, 233), 0.2);font-size:min(1.375rem, 35.2px)}:host(.ion-color) .calendar-day.calendar-day-active{background:rgba(var(--ion-color-base-rgb), 0.2)}:host .calendar-day.calendar-day-today{color:var(--ion-color-primary, #0054e9)}:host(.ion-color) .calendar-day.calendar-day-today{color:var(--ion-color-base)}:host .calendar-day.calendar-day-active,:host .calendar-day.calendar-day-adjacent-day.calendar-day-active{color:var(--ion-color-primary, #0054e9);font-weight:600}:host(.ion-color) .calendar-day.calendar-day-active,:host(.ion-color) .calendar-day.calendar-day-adjacent-day.calendar-day-active{color:var(--ion-color-base)}:host .calendar-day.calendar-day-today.calendar-day-active{background:var(--ion-color-primary, #0054e9);color:var(--ion-color-primary-contrast, #fff)}:host(.ion-color) .calendar-day.calendar-day-today.calendar-day-active{background:var(--ion-color-base);color:var(--ion-color-contrast)}:host .calendar-day.calendar-day-adjacent-day{color:var(--ion-color-step-300, var(--ion-text-color-step-700, #b3b3b3))}:host .datetime-time{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:8px;padding-bottom:16px;font-size:min(1rem, 25.6px)}:host .datetime-time .time-header{font-weight:600}:host .datetime-buttons{-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px;padding-top:8px;padding-bottom:8px;border-top:0.55px solid var(--ion-color-step-200, var(--ion-background-color-step-200, #cccccc))}:host .datetime-buttons ::slotted(ion-buttons),:host .datetime-buttons ion-buttons{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between}:host .datetime-action-buttons{width:100%}',md:':host{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;background:var(--background);overflow:hidden}:host(.datetime-size-fixed){width:auto;height:auto}:host(.datetime-size-fixed:not(.datetime-prefer-wheel)){max-width:350px}:host(.datetime-size-fixed.datetime-prefer-wheel){min-width:350px;max-width:-webkit-max-content;max-width:-moz-max-content;max-width:max-content}:host(.datetime-size-cover){width:100%}:host .calendar-body,:host .datetime-year{opacity:0}:host(:not(.datetime-ready)) .datetime-year{position:absolute;pointer-events:none}:host(.datetime-ready) .calendar-body{opacity:1}:host(.datetime-ready) .datetime-year{display:none;opacity:1}:host .wheel-order-year-first .day-column{-ms-flex-order:3;order:3;text-align:end}:host .wheel-order-year-first .month-column{-ms-flex-order:2;order:2;text-align:end}:host .wheel-order-year-first .year-column{-ms-flex-order:1;order:1;text-align:start}:host .datetime-calendar,:host .datetime-year{display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-flow:column;flex-flow:column}:host(.show-month-and-year) .datetime-year{display:-ms-flexbox;display:flex}:host(.show-month-and-year) .calendar-next-prev,:host(.show-month-and-year) .calendar-days-of-week,:host(.show-month-and-year) .calendar-body,:host(.show-month-and-year) .datetime-time{display:none}:host(.month-year-picker-open) .datetime-footer{display:none}:host(.datetime-disabled){pointer-events:none}:host(.datetime-disabled) .calendar-days-of-week,:host(.datetime-disabled) .datetime-time{opacity:0.4}:host(.datetime-readonly){pointer-events:none;}:host(.datetime-readonly) .calendar-action-buttons,:host(.datetime-readonly) .calendar-body,:host(.datetime-readonly) .datetime-year{pointer-events:initial}:host(.datetime-readonly) .calendar-day[disabled]:not(.calendar-day-constrained),:host(.datetime-readonly) .datetime-action-buttons ion-button[disabled]{opacity:1}:host .datetime-header .datetime-title{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}:host .datetime-action-buttons.has-clear-button{width:100%}:host .datetime-action-buttons ion-buttons{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host .datetime-action-buttons ion-button{--color:var(--ion-color-primary, #0054e9)}.datetime-action-buttons .datetime-action-buttons-container{display:-ms-flexbox;display:flex}:host .calendar-action-buttons{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host .calendar-action-buttons ion-button{--background:transparent}:host .calendar-days-of-week{display:grid;grid-template-columns:repeat(7, 1fr);text-align:center}.calendar-days-of-week .day-of-week{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:0;margin-bottom:0}:host .calendar-body{display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-webkit-scroll-snap-type:x mandatory;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;overflow-x:scroll;overflow-y:hidden;scrollbar-width:none;outline:none}:host .calendar-body .calendar-month{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;scroll-snap-align:start;scroll-snap-stop:always;-ms-flex-negative:0;flex-shrink:0;width:100%}:host .calendar-body .calendar-month-disabled{scroll-snap-align:none}:host .calendar-body::-webkit-scrollbar{display:none}:host .calendar-body .calendar-month-grid{display:grid;grid-template-columns:repeat(7, 1fr)}:host .calendar-day-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;min-width:0;min-height:0;overflow:visible}.calendar-day{border-radius:50%;-webkit-padding-start:0px;padding-inline-start:0px;-webkit-padding-end:0px;padding-inline-end:0px;padding-top:0px;padding-bottom:0px;-webkit-margin-start:0px;margin-inline-start:0px;-webkit-margin-end:0px;margin-inline-end:0px;margin-top:0px;margin-bottom:0px;display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border:none;outline:none;background:none;color:currentColor;font-family:var(--ion-font-family, inherit);cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;z-index:0}:host .calendar-day[disabled]{pointer-events:none;opacity:0.4}.calendar-day:not(.calendar-day-adjacent-day):focus{background:rgba(var(--ion-color-primary-rgb, 0, 84, 233), 0.2);-webkit-box-shadow:0px 0px 0px 4px rgba(var(--ion-color-primary-rgb, 0, 84, 233), 0.2);box-shadow:0px 0px 0px 4px rgba(var(--ion-color-primary-rgb, 0, 84, 233), 0.2)}:host(.ion-color) .calendar-day:not(.calendar-day-adjacent-day):focus{background:rgba(var(--ion-color-base-rgb), 0.2);-webkit-box-shadow:0px 0px 0px 4px rgba(var(--ion-color-base-rgb), 0.2);box-shadow:0px 0px 0px 4px rgba(var(--ion-color-base-rgb), 0.2)}:host .datetime-time{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host(.datetime-presentation-time) .datetime-time{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0}:host ion-popover{--height:200px}:host .time-header{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .time-body{border-radius:8px;-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px;padding-top:6px;padding-bottom:6px;display:-ms-flexbox;display:flex;border:none;background:var(--ion-color-step-300, var(--ion-background-color-step-300, #edeef0));color:var(--ion-text-color, #000);font-family:inherit;font-size:inherit;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none}:host .time-body-active{color:var(--ion-color-primary, #0054e9)}:host(.ion-color) .time-body-active{color:var(--ion-color-base)}:host(.in-item){position:static}:host(.show-month-and-year) .calendar-action-buttons .calendar-month-year-toggle{color:var(--ion-color-primary, #0054e9)}:host(.ion-color.show-month-and-year) .calendar-action-buttons .calendar-month-year-toggle{color:var(--ion-color-base)}.calendar-month-year{min-width:0}.calendar-month-year-toggle{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;position:relative;border:0;outline:none;background:transparent;cursor:pointer;z-index:1}.calendar-month-year-toggle::after{left:0;right:0;top:0;bottom:0;position:absolute;content:"";opacity:0;-webkit-transition:opacity 15ms linear, background-color 15ms linear;transition:opacity 15ms linear, background-color 15ms linear;z-index:-1}.calendar-month-year-toggle.ion-focused::after{background:currentColor}.calendar-month-year-toggle:disabled{opacity:0.3;pointer-events:none}.calendar-month-year-toggle ion-icon{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:0;padding-inline-end:0;padding-top:0;padding-bottom:0;-ms-flex-negative:0;flex-shrink:0}.calendar-month-year-toggle #toggle-wrapper{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center}ion-picker{--highlight-background:var(--wheel-highlight-background);--highlight-border-radius:var(--wheel-highlight-border-radius);--fade-background-rgb:var(--wheel-fade-background-rgb)}:host{--background:var(--ion-color-step-100, var(--ion-background-color-step-100, #ffffff));--title-color:var(--ion-color-primary-contrast, #fff)}:host(.ion-color){--title-color:var(--ion-color-contrast)}:host .datetime-header{-webkit-padding-start:20px;padding-inline-start:20px;-webkit-padding-end:20px;padding-inline-end:20px;padding-top:20px;padding-bottom:20px;background:var(--ion-color-primary, #0054e9);color:var(--title-color)}:host(.ion-color) .datetime-header{background:var(--ion-color-base)}:host .datetime-header .datetime-title{font-size:0.75rem;text-transform:uppercase}:host .datetime-header .datetime-selected-date{margin-top:30px;font-size:2.125rem}:host .calendar-action-buttons ion-button{--color:var(--ion-color-step-650, var(--ion-text-color-step-350, #595959))}.calendar-month-year-toggle{-webkit-padding-start:20px;padding-inline-start:20px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:12px;padding-bottom:12px;min-height:48px;background:transparent;color:var(--ion-color-step-650, var(--ion-text-color-step-350, #595959));z-index:1}.calendar-month-year-toggle.ion-focused::after{opacity:0.04}.calendar-month-year-toggle ion-ripple-effect{color:currentColor}@media (any-hover: hover){.calendar-month-year-toggle.ion-activatable:not(.ion-focused):hover::after{background:currentColor;opacity:0.04}}:host .calendar-days-of-week{-webkit-padding-start:10px;padding-inline-start:10px;-webkit-padding-end:10px;padding-inline-end:10px;padding-top:0px;padding-bottom:0px;color:var(--ion-color-step-500, var(--ion-text-color-step-500, gray));font-size:0.875rem;line-height:36px}:host .calendar-body .calendar-month .calendar-month-grid{-webkit-padding-start:10px;padding-inline-start:10px;-webkit-padding-end:10px;padding-inline-end:10px;padding-top:4px;padding-bottom:4px;grid-template-rows:repeat(6, 1fr)}:host .calendar-day{width:42px;min-width:42px;height:42px;font-size:0.875rem}:host .calendar-day.calendar-day-today{border:1px solid var(--ion-color-primary, #0054e9);color:var(--ion-color-primary, #0054e9)}:host(.ion-color) .calendar-day.calendar-day-today{border:1px solid var(--ion-color-base);color:var(--ion-color-base)}:host .calendar-day.calendar-day-active,:host .calendar-day.calendar-day-adjacent-day.calendar-day-active{color:var(--ion-color-primary-contrast, #fff)}:host(.ion-color) .calendar-day.calendar-day-active,:host(.ion-color) .calendar-day.calendar-day-adjacent-day.calendar-day-active{color:var(--ion-color-contrast)}.calendar-day.calendar-day-active,.calendar-day.calendar-day-active:focus{border:1px solid var(--ion-color-primary, #0054e9);background:var(--ion-color-primary, #0054e9)}:host(.ion-color) .calendar-day.calendar-day-active,:host(.ion-color) .calendar-day.calendar-day-active:focus{border:1px solid var(--ion-color-base);background:var(--ion-color-base)}:host .calendar-day.calendar-day-adjacent-day{color:var(--ion-color-step-500, var(--ion-text-color-step-500, gray))}:host .datetime-time{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:8px;padding-bottom:8px}:host .time-header{color:var(--ion-color-step-650, var(--ion-text-color-step-350, #595959))}:host(.datetime-presentation-month) .datetime-year,:host(.datetime-presentation-year) .datetime-year,:host(.datetime-presentation-month-year) .datetime-year{margin-top:20px;margin-bottom:20px}:host .datetime-buttons{-webkit-padding-start:10px;padding-inline-start:10px;-webkit-padding-end:10px;padding-inline-end:10px;padding-top:10px;padding-bottom:10px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end}'};export{Dt as ion_datetime}
@@ -10,6 +10,7 @@ export declare class Alert implements ComponentInterface, OverlayInterface {
10
10
  private readonly delegateController;
11
11
  private readonly lockController;
12
12
  private readonly triggerController;
13
+ private readonly cancelButtonController;
13
14
  private customHTMLEnabled;
14
15
  private activeId?;
15
16
  private inputType?;
@@ -19,6 +19,7 @@ export declare class Toast implements ComponentInterface, OverlayInterface {
19
19
  private readonly delegateController;
20
20
  private readonly lockController;
21
21
  private readonly triggerController;
22
+ private readonly cancelButtonController;
22
23
  private customHTMLEnabled;
23
24
  private durationTimeout?;
24
25
  private gesture?;
@@ -162,5 +162,17 @@ export declare const createTriggerController: () => {
162
162
  addClickListener: (el: HTMLIonOverlayElement, trigger: string) => void;
163
163
  removeClickListener: () => void;
164
164
  };
165
+ /**
166
+ * Tracks which cancel button was pressed. Alert and toast render every
167
+ * cancel button they are given, and the cancel handler runs after the
168
+ * dismiss starts, so the pressed button must be stored to run its handler
169
+ * instead of the first cancel button's.
170
+ */
171
+ export declare const createCancelButtonController: <T extends {
172
+ role?: string;
173
+ }>() => {
174
+ setPressedButton: (button: T) => void;
175
+ getCancelButton: (buttons: T[]) => T | undefined;
176
+ };
165
177
  export declare const FOCUS_TRAP_DISABLE_CLASS = "ion-disable-focus-trap";
166
178
  export {};
package/hydrate/index.js CHANGED
@@ -9125,6 +9125,35 @@ const createTriggerController = () => {
9125
9125
  removeClickListener,
9126
9126
  };
9127
9127
  };
9128
+ /**
9129
+ * Tracks which cancel button was pressed. Alert and toast render every
9130
+ * cancel button they are given, and the cancel handler runs after the
9131
+ * dismiss starts, so the pressed button must be stored to run its handler
9132
+ * instead of the first cancel button's.
9133
+ */
9134
+ const createCancelButtonController = () => {
9135
+ let pressedButton;
9136
+ /**
9137
+ * Stores the pressed cancel button. Call it before dismissing the overlay.
9138
+ */
9139
+ const setPressedButton = (button) => {
9140
+ pressedButton = button;
9141
+ };
9142
+ /**
9143
+ * Returns the pressed cancel button and clears it. When no button was
9144
+ * pressed, such as on a backdrop tap or a dismiss() call with the cancel
9145
+ * role, it returns the first cancel button.
9146
+ */
9147
+ const getCancelButton = (buttons) => {
9148
+ const button = pressedButton ?? buttons.find((b) => b.role === 'cancel');
9149
+ pressedButton = undefined;
9150
+ return button;
9151
+ };
9152
+ return {
9153
+ setPressedButton,
9154
+ getCancelButton,
9155
+ };
9156
+ };
9128
9157
  const FOCUS_TRAP_DISABLE_CLASS = 'ion-disable-focus-trap';
9129
9158
 
9130
9159
  /**
@@ -11246,6 +11275,7 @@ class Alert {
11246
11275
  this.delegateController = createDelegateController(this);
11247
11276
  this.lockController = createLockController();
11248
11277
  this.triggerController = createTriggerController();
11278
+ this.cancelButtonController = createCancelButtonController();
11249
11279
  this.customHTMLEnabled = config.get('innerHTMLTemplatesEnabled', ENABLE_HTML_CONTENT_DEFAULT);
11250
11280
  this.processedInputs = [];
11251
11281
  this.processedButtons = [];
@@ -11301,7 +11331,7 @@ class Alert {
11301
11331
  this.dispatchCancelHandler = (ev) => {
11302
11332
  const role = ev.detail.role;
11303
11333
  if (isCancel(role)) {
11304
- const cancelButton = this.processedButtons.find((b) => b.role === 'cancel');
11334
+ const cancelButton = this.cancelButtonController.getCancelButton(this.processedButtons);
11305
11335
  this.callButtonHandler(cancelButton);
11306
11336
  }
11307
11337
  };
@@ -11551,6 +11581,7 @@ class Alert {
11551
11581
  const role = button.role;
11552
11582
  const values = this.getValues();
11553
11583
  if (isCancel(role)) {
11584
+ this.cancelButtonController.setPressedButton(button);
11554
11585
  return this.dismiss({ values }, role);
11555
11586
  }
11556
11587
  const returnData = await this.callButtonHandler(button, values);
@@ -11781,14 +11812,14 @@ class Alert {
11781
11812
  * If neither are defined, do not set aria-labelledby.
11782
11813
  */
11783
11814
  const ariaLabelledBy = header && subHeader ? `${hdrId} ${subHdrId}` : header ? hdrId : subHeader ? subHdrId : null;
11784
- return (hAsync(Host, { key: 'b650ede6e9475db0ee22f3b144178cc35bbb37bc', tabindex: "-1", style: {
11815
+ return (hAsync(Host, { key: '34098847a42a4a3d8247f5ecd5104aa70f4e0776', tabindex: "-1", style: {
11785
11816
  zIndex: `${20000 + overlayIndex}`,
11786
11817
  }, class: {
11787
11818
  ...getClassMap(this.cssClass),
11788
11819
  [mode]: true,
11789
11820
  'overlay-hidden': true,
11790
11821
  'alert-translucent': this.translucent,
11791
- }, onIonAlertWillDismiss: this.dispatchCancelHandler, onIonBackdropTap: this.onBackdropTap }, hAsync("ion-backdrop", { key: 'a2f5f314c9f87ebc5c20b2d618587a8254deb8f2', tappable: this.backdropDismiss }), hAsync(OverlayFocusBoundary, { key: '9b5b9d5c65cf1849c1c1736d185bb4acc992df50', overlay: this.el, edge: "start" }), hAsync("div", { key: '9a7bc59ef57f54a3466a092c25dad4ad72298fef', class: "alert-wrapper ion-overlay-wrapper", role: role, "aria-modal": "true", "aria-labelledby": ariaLabelledBy, "aria-describedby": message !== undefined ? msgId : null, tabindex: "0", ref: (el) => (this.wrapperEl = el), ...htmlAttributes }, hAsync("div", { key: 'e6a4843f8efc9f26a03278b0b853ee3ab769c91f', class: "alert-head" }, header && (hAsync("h2", { key: 'c9979c124fe9f2515b0dcf98f2944cfc34682338', id: hdrId, class: "alert-title" }, header)), subHeader && !header && (hAsync("h2", { key: 'a7454486d3c2ff3d1088a235e679bb193cd326ac', id: subHdrId, class: "alert-sub-title" }, subHeader)), subHeader && header && (hAsync("h3", { key: '594862f712d17033f6f897295958ad283dc57a5d', id: subHdrId, class: "alert-sub-title" }, subHeader))), this.renderAlertMessage(msgId), this.renderAlertInputs(), this.renderAlertButtons()), hAsync(OverlayFocusBoundary, { key: '03987719e8d60d3bd7792ed303471dd341e23b34', overlay: this.el, edge: "end" })));
11822
+ }, onIonAlertWillDismiss: this.dispatchCancelHandler, onIonBackdropTap: this.onBackdropTap }, hAsync("ion-backdrop", { key: '6cefbd420bea2968a71d618749f02dfc8645e1be', tappable: this.backdropDismiss }), hAsync(OverlayFocusBoundary, { key: '13312a9087025a187561c9ced86e59eea48901b6', overlay: this.el, edge: "start" }), hAsync("div", { key: 'feb0349ea7f0d3e5a3bda45d5d7d99e82ea06fcf', class: "alert-wrapper ion-overlay-wrapper", role: role, "aria-modal": "true", "aria-labelledby": ariaLabelledBy, "aria-describedby": message !== undefined ? msgId : null, tabindex: "0", ref: (el) => (this.wrapperEl = el), ...htmlAttributes }, hAsync("div", { key: '2fe1d07b673707ea22322e1b932edcb529ee8599', class: "alert-head" }, header && (hAsync("h2", { key: 'bcc3b1808b02fc5c1fbd5ac44f70dabe49f487d1', id: hdrId, class: "alert-title" }, header)), subHeader && !header && (hAsync("h2", { key: 'e0848101ade1b499bdf66610a2084cba18fd9acf', id: subHdrId, class: "alert-sub-title" }, subHeader)), subHeader && header && (hAsync("h3", { key: 'aaef7c1d72e80828ae4a70edf12c08d3d80193f3', id: subHdrId, class: "alert-sub-title" }, subHeader))), this.renderAlertMessage(msgId), this.renderAlertInputs(), this.renderAlertButtons()), hAsync(OverlayFocusBoundary, { key: '19287f879b40d1c5e5f99b800a63e2b4f5d1b717', overlay: this.el, edge: "end" })));
11792
11823
  }
11793
11824
  get el() { return getElement(this); }
11794
11825
  static get watchers() { return {
@@ -42342,6 +42373,7 @@ class Toast {
42342
42373
  this.delegateController = createDelegateController(this);
42343
42374
  this.lockController = createLockController();
42344
42375
  this.triggerController = createTriggerController();
42376
+ this.cancelButtonController = createCancelButtonController();
42345
42377
  this.customHTMLEnabled = config.get('innerHTMLTemplatesEnabled', ENABLE_HTML_CONTENT_DEFAULT);
42346
42378
  this.presented = false;
42347
42379
  /**
@@ -42395,7 +42427,7 @@ class Toast {
42395
42427
  this.dispatchCancelHandler = (ev) => {
42396
42428
  const role = ev.detail.role;
42397
42429
  if (isCancel(role)) {
42398
- const cancelButton = this.getButtons().find((b) => b.role === 'cancel');
42430
+ const cancelButton = this.cancelButtonController.getCancelButton(this.getButtons());
42399
42431
  this.callButtonHandler(cancelButton);
42400
42432
  }
42401
42433
  };
@@ -42648,6 +42680,7 @@ class Toast {
42648
42680
  async buttonClick(button) {
42649
42681
  const role = button.role;
42650
42682
  if (isCancel(role)) {
42683
+ this.cancelButtonController.setPressedButton(button);
42651
42684
  return this.dismiss(undefined, role);
42652
42685
  }
42653
42686
  const shouldDismiss = await this.callButtonHandler(button);
@@ -42722,14 +42755,14 @@ class Toast {
42722
42755
  if (layout === 'stacked' && startButtons.length > 0 && endButtons.length > 0) {
42723
42756
  printIonWarning('[ion-toast] - This toast is using start and end buttons with the stacked toast layout. We recommend following the best practice of using either start or end buttons with the stacked toast layout.', el);
42724
42757
  }
42725
- return (hAsync(Host, { key: 'e1974e5ea2a134f5447f9b1efcc11a87a6aa744b', tabindex: "-1", ...this.htmlAttributes, style: {
42758
+ return (hAsync(Host, { key: '0f9584d20e110965100fd14f90bb8c22dba885f9', tabindex: "-1", ...this.htmlAttributes, style: {
42726
42759
  zIndex: `${60000 + this.overlayIndex}`,
42727
42760
  }, class: createColorClasses$1(this.color, {
42728
42761
  [mode]: true,
42729
42762
  ...getClassMap(this.cssClass),
42730
42763
  'overlay-hidden': true,
42731
42764
  'toast-translucent': this.translucent,
42732
- }), onIonToastWillDismiss: this.dispatchCancelHandler }, hAsync("div", { key: '966d19ec901fa3cbea1bfc1ca3540bcc3263fd96', class: wrapperClass, part: "wrapper" }, hAsync("div", { key: 'd3449bab878af046678897bc4c35d3f779c7d5e9', class: "toast-container", part: "container" }, this.renderButtons(startButtons, 'start'), this.icon !== undefined && (hAsync("ion-icon", { key: 'cf989fb1908f7a075745c567e504599a091ab5cd', class: "toast-icon", part: "icon", icon: this.icon, lazy: false, "aria-hidden": "true" })), hAsync("div", { key: '33bb13417030085d9d19629e4df4a4492a7f36c9', class: "toast-content", part: "content", role: "status", "aria-atomic": "true", "aria-live": "polite" }, !revealContentToScreenReader && header !== undefined && this.renderHeader('oldHeader', 'true'), !revealContentToScreenReader && message !== undefined && this.renderToastMessage('oldMessage', 'true'), revealContentToScreenReader && header !== undefined && this.renderHeader('header'), revealContentToScreenReader && message !== undefined && this.renderToastMessage('header')), this.renderButtons(endButtons, 'end')))));
42765
+ }), onIonToastWillDismiss: this.dispatchCancelHandler }, hAsync("div", { key: '29d99bb085ce1f000ce6fe6db207502dc020b55b', class: wrapperClass, part: "wrapper" }, hAsync("div", { key: '915ea476bf2cf9bbbd1e555b016202de67150bb5', class: "toast-container", part: "container" }, this.renderButtons(startButtons, 'start'), this.icon !== undefined && (hAsync("ion-icon", { key: 'a07aae4c41aa8abf8f45186267b6c3aceb3cebed', class: "toast-icon", part: "icon", icon: this.icon, lazy: false, "aria-hidden": "true" })), hAsync("div", { key: '4730a5b6b29a28be79649c0882092030f4656477', class: "toast-content", part: "content", role: "status", "aria-atomic": "true", "aria-live": "polite" }, !revealContentToScreenReader && header !== undefined && this.renderHeader('oldHeader', 'true'), !revealContentToScreenReader && message !== undefined && this.renderToastMessage('oldMessage', 'true'), revealContentToScreenReader && header !== undefined && this.renderHeader('header'), revealContentToScreenReader && message !== undefined && this.renderToastMessage('header')), this.renderButtons(endButtons, 'end')))));
42733
42766
  }
42734
42767
  get el() { return getElement(this); }
42735
42768
  static get watchers() { return {
package/hydrate/index.mjs CHANGED
@@ -9123,6 +9123,35 @@ const createTriggerController = () => {
9123
9123
  removeClickListener,
9124
9124
  };
9125
9125
  };
9126
+ /**
9127
+ * Tracks which cancel button was pressed. Alert and toast render every
9128
+ * cancel button they are given, and the cancel handler runs after the
9129
+ * dismiss starts, so the pressed button must be stored to run its handler
9130
+ * instead of the first cancel button's.
9131
+ */
9132
+ const createCancelButtonController = () => {
9133
+ let pressedButton;
9134
+ /**
9135
+ * Stores the pressed cancel button. Call it before dismissing the overlay.
9136
+ */
9137
+ const setPressedButton = (button) => {
9138
+ pressedButton = button;
9139
+ };
9140
+ /**
9141
+ * Returns the pressed cancel button and clears it. When no button was
9142
+ * pressed, such as on a backdrop tap or a dismiss() call with the cancel
9143
+ * role, it returns the first cancel button.
9144
+ */
9145
+ const getCancelButton = (buttons) => {
9146
+ const button = pressedButton ?? buttons.find((b) => b.role === 'cancel');
9147
+ pressedButton = undefined;
9148
+ return button;
9149
+ };
9150
+ return {
9151
+ setPressedButton,
9152
+ getCancelButton,
9153
+ };
9154
+ };
9126
9155
  const FOCUS_TRAP_DISABLE_CLASS = 'ion-disable-focus-trap';
9127
9156
 
9128
9157
  /**
@@ -11244,6 +11273,7 @@ class Alert {
11244
11273
  this.delegateController = createDelegateController(this);
11245
11274
  this.lockController = createLockController();
11246
11275
  this.triggerController = createTriggerController();
11276
+ this.cancelButtonController = createCancelButtonController();
11247
11277
  this.customHTMLEnabled = config.get('innerHTMLTemplatesEnabled', ENABLE_HTML_CONTENT_DEFAULT);
11248
11278
  this.processedInputs = [];
11249
11279
  this.processedButtons = [];
@@ -11299,7 +11329,7 @@ class Alert {
11299
11329
  this.dispatchCancelHandler = (ev) => {
11300
11330
  const role = ev.detail.role;
11301
11331
  if (isCancel(role)) {
11302
- const cancelButton = this.processedButtons.find((b) => b.role === 'cancel');
11332
+ const cancelButton = this.cancelButtonController.getCancelButton(this.processedButtons);
11303
11333
  this.callButtonHandler(cancelButton);
11304
11334
  }
11305
11335
  };
@@ -11549,6 +11579,7 @@ class Alert {
11549
11579
  const role = button.role;
11550
11580
  const values = this.getValues();
11551
11581
  if (isCancel(role)) {
11582
+ this.cancelButtonController.setPressedButton(button);
11552
11583
  return this.dismiss({ values }, role);
11553
11584
  }
11554
11585
  const returnData = await this.callButtonHandler(button, values);
@@ -11779,14 +11810,14 @@ class Alert {
11779
11810
  * If neither are defined, do not set aria-labelledby.
11780
11811
  */
11781
11812
  const ariaLabelledBy = header && subHeader ? `${hdrId} ${subHdrId}` : header ? hdrId : subHeader ? subHdrId : null;
11782
- return (hAsync(Host, { key: 'b650ede6e9475db0ee22f3b144178cc35bbb37bc', tabindex: "-1", style: {
11813
+ return (hAsync(Host, { key: '34098847a42a4a3d8247f5ecd5104aa70f4e0776', tabindex: "-1", style: {
11783
11814
  zIndex: `${20000 + overlayIndex}`,
11784
11815
  }, class: {
11785
11816
  ...getClassMap(this.cssClass),
11786
11817
  [mode]: true,
11787
11818
  'overlay-hidden': true,
11788
11819
  'alert-translucent': this.translucent,
11789
- }, onIonAlertWillDismiss: this.dispatchCancelHandler, onIonBackdropTap: this.onBackdropTap }, hAsync("ion-backdrop", { key: 'a2f5f314c9f87ebc5c20b2d618587a8254deb8f2', tappable: this.backdropDismiss }), hAsync(OverlayFocusBoundary, { key: '9b5b9d5c65cf1849c1c1736d185bb4acc992df50', overlay: this.el, edge: "start" }), hAsync("div", { key: '9a7bc59ef57f54a3466a092c25dad4ad72298fef', class: "alert-wrapper ion-overlay-wrapper", role: role, "aria-modal": "true", "aria-labelledby": ariaLabelledBy, "aria-describedby": message !== undefined ? msgId : null, tabindex: "0", ref: (el) => (this.wrapperEl = el), ...htmlAttributes }, hAsync("div", { key: 'e6a4843f8efc9f26a03278b0b853ee3ab769c91f', class: "alert-head" }, header && (hAsync("h2", { key: 'c9979c124fe9f2515b0dcf98f2944cfc34682338', id: hdrId, class: "alert-title" }, header)), subHeader && !header && (hAsync("h2", { key: 'a7454486d3c2ff3d1088a235e679bb193cd326ac', id: subHdrId, class: "alert-sub-title" }, subHeader)), subHeader && header && (hAsync("h3", { key: '594862f712d17033f6f897295958ad283dc57a5d', id: subHdrId, class: "alert-sub-title" }, subHeader))), this.renderAlertMessage(msgId), this.renderAlertInputs(), this.renderAlertButtons()), hAsync(OverlayFocusBoundary, { key: '03987719e8d60d3bd7792ed303471dd341e23b34', overlay: this.el, edge: "end" })));
11820
+ }, onIonAlertWillDismiss: this.dispatchCancelHandler, onIonBackdropTap: this.onBackdropTap }, hAsync("ion-backdrop", { key: '6cefbd420bea2968a71d618749f02dfc8645e1be', tappable: this.backdropDismiss }), hAsync(OverlayFocusBoundary, { key: '13312a9087025a187561c9ced86e59eea48901b6', overlay: this.el, edge: "start" }), hAsync("div", { key: 'feb0349ea7f0d3e5a3bda45d5d7d99e82ea06fcf', class: "alert-wrapper ion-overlay-wrapper", role: role, "aria-modal": "true", "aria-labelledby": ariaLabelledBy, "aria-describedby": message !== undefined ? msgId : null, tabindex: "0", ref: (el) => (this.wrapperEl = el), ...htmlAttributes }, hAsync("div", { key: '2fe1d07b673707ea22322e1b932edcb529ee8599', class: "alert-head" }, header && (hAsync("h2", { key: 'bcc3b1808b02fc5c1fbd5ac44f70dabe49f487d1', id: hdrId, class: "alert-title" }, header)), subHeader && !header && (hAsync("h2", { key: 'e0848101ade1b499bdf66610a2084cba18fd9acf', id: subHdrId, class: "alert-sub-title" }, subHeader)), subHeader && header && (hAsync("h3", { key: 'aaef7c1d72e80828ae4a70edf12c08d3d80193f3', id: subHdrId, class: "alert-sub-title" }, subHeader))), this.renderAlertMessage(msgId), this.renderAlertInputs(), this.renderAlertButtons()), hAsync(OverlayFocusBoundary, { key: '19287f879b40d1c5e5f99b800a63e2b4f5d1b717', overlay: this.el, edge: "end" })));
11790
11821
  }
11791
11822
  get el() { return getElement(this); }
11792
11823
  static get watchers() { return {
@@ -42340,6 +42371,7 @@ class Toast {
42340
42371
  this.delegateController = createDelegateController(this);
42341
42372
  this.lockController = createLockController();
42342
42373
  this.triggerController = createTriggerController();
42374
+ this.cancelButtonController = createCancelButtonController();
42343
42375
  this.customHTMLEnabled = config.get('innerHTMLTemplatesEnabled', ENABLE_HTML_CONTENT_DEFAULT);
42344
42376
  this.presented = false;
42345
42377
  /**
@@ -42393,7 +42425,7 @@ class Toast {
42393
42425
  this.dispatchCancelHandler = (ev) => {
42394
42426
  const role = ev.detail.role;
42395
42427
  if (isCancel(role)) {
42396
- const cancelButton = this.getButtons().find((b) => b.role === 'cancel');
42428
+ const cancelButton = this.cancelButtonController.getCancelButton(this.getButtons());
42397
42429
  this.callButtonHandler(cancelButton);
42398
42430
  }
42399
42431
  };
@@ -42646,6 +42678,7 @@ class Toast {
42646
42678
  async buttonClick(button) {
42647
42679
  const role = button.role;
42648
42680
  if (isCancel(role)) {
42681
+ this.cancelButtonController.setPressedButton(button);
42649
42682
  return this.dismiss(undefined, role);
42650
42683
  }
42651
42684
  const shouldDismiss = await this.callButtonHandler(button);
@@ -42720,14 +42753,14 @@ class Toast {
42720
42753
  if (layout === 'stacked' && startButtons.length > 0 && endButtons.length > 0) {
42721
42754
  printIonWarning('[ion-toast] - This toast is using start and end buttons with the stacked toast layout. We recommend following the best practice of using either start or end buttons with the stacked toast layout.', el);
42722
42755
  }
42723
- return (hAsync(Host, { key: 'e1974e5ea2a134f5447f9b1efcc11a87a6aa744b', tabindex: "-1", ...this.htmlAttributes, style: {
42756
+ return (hAsync(Host, { key: '0f9584d20e110965100fd14f90bb8c22dba885f9', tabindex: "-1", ...this.htmlAttributes, style: {
42724
42757
  zIndex: `${60000 + this.overlayIndex}`,
42725
42758
  }, class: createColorClasses$1(this.color, {
42726
42759
  [mode]: true,
42727
42760
  ...getClassMap(this.cssClass),
42728
42761
  'overlay-hidden': true,
42729
42762
  'toast-translucent': this.translucent,
42730
- }), onIonToastWillDismiss: this.dispatchCancelHandler }, hAsync("div", { key: '966d19ec901fa3cbea1bfc1ca3540bcc3263fd96', class: wrapperClass, part: "wrapper" }, hAsync("div", { key: 'd3449bab878af046678897bc4c35d3f779c7d5e9', class: "toast-container", part: "container" }, this.renderButtons(startButtons, 'start'), this.icon !== undefined && (hAsync("ion-icon", { key: 'cf989fb1908f7a075745c567e504599a091ab5cd', class: "toast-icon", part: "icon", icon: this.icon, lazy: false, "aria-hidden": "true" })), hAsync("div", { key: '33bb13417030085d9d19629e4df4a4492a7f36c9', class: "toast-content", part: "content", role: "status", "aria-atomic": "true", "aria-live": "polite" }, !revealContentToScreenReader && header !== undefined && this.renderHeader('oldHeader', 'true'), !revealContentToScreenReader && message !== undefined && this.renderToastMessage('oldMessage', 'true'), revealContentToScreenReader && header !== undefined && this.renderHeader('header'), revealContentToScreenReader && message !== undefined && this.renderToastMessage('header')), this.renderButtons(endButtons, 'end')))));
42763
+ }), onIonToastWillDismiss: this.dispatchCancelHandler }, hAsync("div", { key: '29d99bb085ce1f000ce6fe6db207502dc020b55b', class: wrapperClass, part: "wrapper" }, hAsync("div", { key: '915ea476bf2cf9bbbd1e555b016202de67150bb5', class: "toast-container", part: "container" }, this.renderButtons(startButtons, 'start'), this.icon !== undefined && (hAsync("ion-icon", { key: 'a07aae4c41aa8abf8f45186267b6c3aceb3cebed', class: "toast-icon", part: "icon", icon: this.icon, lazy: false, "aria-hidden": "true" })), hAsync("div", { key: '4730a5b6b29a28be79649c0882092030f4656477', class: "toast-content", part: "content", role: "status", "aria-atomic": "true", "aria-live": "polite" }, !revealContentToScreenReader && header !== undefined && this.renderHeader('oldHeader', 'true'), !revealContentToScreenReader && message !== undefined && this.renderToastMessage('oldMessage', 'true'), revealContentToScreenReader && header !== undefined && this.renderHeader('header'), revealContentToScreenReader && message !== undefined && this.renderToastMessage('header')), this.renderButtons(endButtons, 'end')))));
42731
42764
  }
42732
42765
  get el() { return getElement(this); }
42733
42766
  static get watchers() { return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ionic/core",
3
- "version": "9.0.14",
3
+ "version": "9.0.15-nightly.20261126",
4
4
  "description": "Base components for Ionic",
5
5
  "engines": {
6
6
  "node": ">= 16"