text: import{r as t,c as i,d as s,h as e,H as h,e as r}from"./p-d7238df3.js";import"./p-bb99b659.js";import{c as o}from"./p-22971d74.js";import{p as n,d as a,e as l,f as c,s as d}from"./p-d3bbd9d5.js";import{h as u,g as m}from"./p-353a032e.js";import{b as p}from"./p-4e92c885.js";import{c as f,f as v,r as y}from"./p-c90aaa66.js";const k=(t,i,s,e)=>{if(t!==_&&t!==j){if(t===R)return void 0!==s&&void 0!==s.hour?s.hour<12?"AM":"PM":i?i.toUpperCase():"";if(t===X)return void 0!==s&&void 0!==s.hour?s.hour<12?"am":"pm":i||"";if(null==i)return"";if(t===F||t===O||t===L||t===W||t===V||t===z)return S(i);if(t===A)return P(i);if(t===I)return(e.monthNames?e.monthNames:U)[i-1];if(t===N)return(e.monthShortNames?e.monthShortNames:G)[i-1];if(t===H||t===J){if(0===i)return"12";if(i>12&&(i-=12),t===H&&i<10)return"0"+i}return i.toString()}try{return i=new Date(s.year,s.month-1,s.day).getDay(),t===_?(e.dayNames?e.dayNames:Z)[i]:(e.dayShortNames?e.dayShortNames:q)[i]}catch(t){}},b=(t,i,s,e=0,h=0)=>parseInt(`1${P(t)}${S(i)}${S(s)}${S(e)}${S(h)}`,10),M=t=>b(t.year,t.month,t.day,t.hour,t.minute),g=/^(\d{4}|[+\-]\d{6})(?:-(\d{2})(?:-(\d{2}))?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{3}))?)?(?:(Z)|([+\-])(\d{2})(?::(\d{2}))?)?)?$/,D=/^((\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{3}))?)?(?:(Z)|([+\-])(\d{2})(?::(\d{2}))?)?)?$/,x=t=>{let i=null;if(null!=t&&""!==t&&((i=D.exec(t))?(i.unshift(void 0,void 0),i[2]=i[3]=void 0):i=g.exec(t)),null===i)return;for(let t=1;t<8;t++)i[t]=void 0!==i[t]?parseInt(i[t],10):void 0;let s=0;return i[9]&&i[10]&&(s=60*parseInt(i[10],10),i[11]&&(s+=parseInt(i[11],10)),"-"===i[9]&&(s*=-1)),{year:i[1],month:i[2],day:i[3],hour:i[4],minute:i[5],second:i[6],millisecond:i[7],tzOffset:s}},w=(t,i)=>i===R||i===X?t.hour<12?"am":"pm":i===H||i===J?t.hour>12?t.hour-12:0===t.hour?12:t.hour:t[C(i)],C=t=>{for(const i in B)if(B[i].f===t)return B[i].k},$=t=>{let i="";return void 0!==t.year?(i=P(t.year),void 0!==t.month&&(i+="-"+S(t.month),void 0!==t.day&&(i+="-"+S(t.day),void 0!==t.hour&&(i+=`T${S(t.hour)}:${S(t.minute)}:${S(t.second)}`,t.millisecond>0&&(i+="."+E(t.millisecond)),i+=void 0===t.tzOffset?"Z":(t.tzOffset>0?"+":"-")+S(Math.floor(Math.abs(t.tzOffset/60)))+":"+S(t.tzOffset%60))))):void 0!==t.hour&&(i=S(t.hour)+":"+S(t.minute),void 0!==t.second&&(i+=":"+S(t.second),void 0!==t.millisecond&&(i+="."+E(t.millisecond)))),i},T=(t,i)=>{if(null==t)return;let s;return"string"==typeof t&&(t=t.replace(/\[|\]/g,"").split(",")),Array.isArray(t)&&(s=t.map(t=>t.toString().trim())),void 0!==s&&0!==s.length||console.warn(`Invalid "${i}Names". Must be an array of strings, or a comma separated string.`),s},Y=(t,i)=>{let s;return"string"==typeof t&&(t=t.replace(/\[|\]|\s/g,"").split(",")),0===(s=Array.isArray(t)?t.map(t=>parseInt(t,10)).filter(isFinite):[t]).length&&console.warn(`Invalid "${i}Values". Must be an array of numbers, or a comma separated string of numbers.`),s},S=t=>("0"+(void 0!==t?Math.abs(t):"0")).slice(-2),E=t=>("00"+(void 0!==t?Math.abs(t):"0")).slice(-3),P=t=>("000"+(void 0!==t?Math.abs(t):"0")).slice(-4),A="YYYY",F="YY",I="MMMM",N="MMM",O="MM",_="DDDD",j="DDD",L="DD",W="HH",H="hh",J="h",V="mm",z="ss",R="A",X="a",B=[{f:A,k:"year"},{f:I,k:"month"},{f:_,k:"day"},{f:N,k:"month"},{f:j,k:"day"},{f:F,k:"year"},{f:O,k:"month"},{f:L,k:"day"},{f:W,k:"hour"},{f:H,k:"hour"},{f:V,k:"minute"},{f:z,k:"second"},{f:"M",k:"month"},{f:"D",k:"day"},{f:"H",k:"hour"},{f:J,k:"hour"},{f:"m",k:"minute"},{f:"s",k:"second"},{f:R,k:"ampm"},{f:X,k:"ampm"}],Z=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],q=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],U=["January","February","March","April","May","June","July","August","September","October","November","December"],G=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],K=[H,J,V,"m",z,"s"],Q=class{constructor(s){t(this,s),this.inputId=`ion-dt-${st++}`,this.locale={},this.datetimeMin={},this.datetimeMax={},this.datetimeValue={},this.isExpanded=!1,this.name=this.inputId,this.disabled=!1,this.readonly=!1,this.displayFormat="MMM D, YYYY",this.cancelText="Cancel",this.doneText="Done",this.onClick=()=>{this.setFocus(),this.open()},this.onFocus=()=>{this.ionFocus.emit()},this.onBlur=()=>{this.ionBlur.emit()},this.ionCancel=i(this,"ionCancel",7),this.ionChange=i(this,"ionChange",7),this.ionFocus=i(this,"ionFocus",7),this.ionBlur=i(this,"ionBlur",7),this.ionStyle=i(this,"ionStyle",7)}disabledChanged(){this.emitStyle()}valueChanged(){this.updateDatetimeValue(this.value),this.emitStyle(),this.ionChange.emit({value:this.value})}componentWillLoad(){this.locale={monthNames:T(this.monthNames,"monthNames"),monthShortNames:T(this.monthShortNames,"monthShortNames"),dayNames:T(this.dayNames,"dayNames"),dayShortNames:T(this.dayShortNames,"dayShortNames")},this.updateDatetimeValue(this.value),this.emitStyle()}async open(){if(this.disabled||this.isExpanded)return;const t=this.generatePickerOptions(),i=await n.create(t);this.isExpanded=!0,i.onDidDismiss().then(()=>{this.isExpanded=!1,this.setFocus()}),i.addEventListener("ionPickerColChange",async t=>{const s=t.detail,e={};e[s.name]={value:s.options[s.selectedIndex].value},this.updateDatetimeValue(e),i.columns=this.generateColumns()}),await i.present()}emitStyle(){this.ionStyle.emit({interactive:!0,datetime:!0,"has-placeholder":null!=this.placeholder,"has-value":this.hasValue(),"interactive-disabled":this.disabled})}updateDatetimeValue(t){((t,i)=>{if(!i||"string"==typeof i){const t=((t="")=>{null==t&&(t=""),10!==t.length&&7!==t.length||(t+=" ");const i="string"==typeof t&&t.length>0?new Date(t):new Date;return new Date(Date.UTC(i.getFullYear(),i.getMonth(),i.getDate(),i.getHours(),i.getMinutes(),i.getSeconds(),i.getMilliseconds()))})(i);Number.isNaN(t.getTime())||(i=t.toISOString())}if(i&&""!==i){if("string"==typeof i){if(i=x(i))return Object.assign(t,i),!0}else{if(i.year||i.hour||i.month||i.day||i.minute||i.second){i.ampm&&i.hour&&(i.hour.value="pm"===i.ampm.value?12===i.hour.value?12:i.hour.value+12:12===i.hour.value?0:i.hour.value);for(const s of Object.keys(i))t[s]=i[s].value;return!0}if(i.ampm)return i.hour={value:i.hour?i.hour.value:"pm"===i.ampm.value?t.hour<12?t.hour+12:t.hour:t.hour>=12?t.hour-12:t.hour},t.hour=i.hour.value,!0}console.warn(`Error parsing date: "${i}". Please provide a valid ISO 8601 datetime format: https://www.w3.org/TR/NOTE-datetime`)}else for(const i in t)t.hasOwnProperty(i)&&delete t[i]})(this.datetimeValue,t)}generatePickerOptions(){const t=s(this),i=Object.assign({mode:t},this.pickerOptions,{columns:this.generateColumns()}),e=i.buttons;return e&&0!==e.length||(i.buttons=[{text:this.cancelText,role:"cancel",handler:()=>{this.updateDatetimeValue(this.value),this.ionCancel.emit()}},{text:this.doneText,handler:t=>{this.updateDatetimeValue(t);const i=new Date($(this.datetimeValue));this.datetimeValue.tzOffset=-1*i.getTimezoneOffset(),this.value=$(this.datetimeValue)}}]),i}generateColumns(){let t=this.pickerFormat||this.displayFormat||it;if(0===t.length)return[];this.calcMinMax(),-1===(t=t.replace("DDDD","{~}").replace("DDD","{~}")).indexOf("D")&&(t=t.replace("{~}","D"));const i=(t=>{const i=[];t=t.replace(/[^\w\s]/gi," "),B.forEach(i=>{i.f.length>1&&t.indexOf(i.f)>-1&&t.indexOf(i.f+i.f.charAt(0))<0&&(t=t.replace(i.f," "+i.f+" "))});const s=t.split(" ").filter(t=>t.length>0);return s.forEach((t,e)=>{B.forEach(h=>{if(t===h.f){if((t===R||t===X)&&(i.indexOf(J)<0&&i.indexOf(H)<0||-1===K.indexOf(s[e-1])))return;i.push(t)}})}),i})(t=t.replace(/{~}/g,"")).map(t=>{const i=C(t);let s;const e=(s=this[i+"Values"]?Y(this[i+"Values"],i):((t,i,s)=>{const e=[];if(t===A||t===F){if(void 0===s.year||void 0===i.year)throw new Error("min and max year is undefined");for(let t=s.year;t>=i.year;t--)e.push(t)}else if(t===I||t===N||t===O||"M"===t||t===H||t===J)for(let t=1;t<13;t++)e.push(t);else if(t===_||t===j||t===L||"D"===t)for(let t=1;t<32;t++)e.push(t);else if(t===W||"H"===t)for(let t=0;t<24;t++)e.push(t);else if(t===V||"m"===t)for(let t=0;t<60;t++)e.push(t);else if(t===z||"s"===t)for(let t=0;t<60;t++)e.push(t);else t!==R&&t!==X||e.push("am","pm");return e})(t,this.datetimeMin,this.datetimeMax)).map(i=>({value:i,text:k(t,i,void 0,this.locale)})),h=((t,i)=>{const s=w(this.datetimeValue,i);if(void 0!==s)return s;const e=x((new Date).toISOString());return w(e,i)})(0,t),r=e.findIndex(t=>t.value===h);return{name:i,selectedIndex:r>=0?r:0,options:e}}),s=this.datetimeMin,e=this.datetimeMax;return["month","day","hour","minute"].filter(t=>!i.find(i=>i.name===t)).forEach(t=>{s[t]=0,e[t]=0}),this.validateColumns(tt(i))}validateColumns(t){const i=new Date,s=M(this.datetimeMin),e=M(this.datetimeMax),h=t.find(t=>"year"===t.name);let r=i.getFullYear();if(h){h.options.find(t=>t.value===i.getFullYear())||(r=h.options[0].value);const t=h.selectedIndex;if(void 0!==t){const i=h.options[t];i&&(r=i.value)}}const o=this.validateColumn(t,"month",1,s,e,[r,0,0,0,0],[r,12,31,23,59]),n=((t,i)=>4===t||6===t||9===t||11===t?30:2===t?(t=>t%4==0&&t%100!=0||t%400==0)(i)?29:28:31)(o,r),a=this.validateColumn(t,"day",2,s,e,[r,o,0,0,0],[r,o,n,23,59]),l=this.validateColumn(t,"hour",3,s,e,[r,o,a,0,0],[r,o,a,23,59]);return this.validateColumn(t,"minute",4,s,e,[r,o,a,l,0],[r,o,a,l,59]),t}calcMinMax(){const t=(new Date).getFullYear();if(void 0!==this.yearValues){const t=Y(this.yearValues,"year");void 0===this.min&&(this.min=Math.min(...t).toString()),void 0===this.max&&(this.max=Math.max(...t).toString())}else void 0===this.min&&(this.min=(t-100).toString()),void 0===this.max&&(this.max=t.toString());const i=this.datetimeMin=x(this.min),s=this.datetimeMax=x(this.max);i.year=i.year||t,s.year=s.year||t,i.month=i.month||1,s.month=s.month||12,i.day=i.day||1,s.day=s.day||31,i.hour=i.hour||0,s.hour=s.hour||23,i.minute=i.minute||0,s.minute=s.minute||59,i.second=i.second||0,s.second=s.second||59,i.year>s.year&&(console.error("min.year > max.year"),i.year=s.year-100),i.year===s.year&&(i.month>s.month?(console.error("min.month > max.month"),i.month=1):i.month===s.month&&i.day>s.day&&(console.error("min.day > max.day"),i.day=1))}validateColumn(t,i,s,e,h,r,o){const n=t.find(t=>t.name===i);if(!n)return 0;const a=r.slice(),l=o.slice(),c=n.options;let d=c.length-1,u=0;for(let t=0;t<c.length;t++){const i=c[t],n=i.value;a[s]=i.value,l[s]=i.value,(i.disabled=n<r[s]||n>o[s]||b(l[0],l[1],l[2],l[3],l[4])<e||b(a[0],a[1],a[2],a[3],a[4])>h)||(d=Math.min(d,t),u=Math.max(u,t))}const m=n.selectedIndex=f(d,n.selectedIndex,u),p=n.options[m];return p?p.value:0}get text(){if(null!=this.value&&0!==this.value.length)return((t,i,s)=>{if(void 0===i)return;const e=[];let h=!1;if(B.forEach((r,o)=>{if(t.indexOf(r.f)>-1){const n="{"+o+"}",a=k(r.f,i[r.k],i,s);h||void 0===a||null==i[r.k]||(h=!0),e.push(n,a||""),t=t.replace(r.f,n)}}),h){for(let i=0;i<e.length;i+=2)t=t.replace(e[i],e[i+1]);return t}})(this.displayFormat||this.pickerFormat||it,this.datetimeValue,this.locale)}hasValue(){return void 0!==this.text}setFocus(){this.buttonEl&&this.buttonEl.focus()}render(){const{inputId:t,text:i,disabled:r,readonly:o,isExpanded:n,el:a,placeholder:l}=this,c=s(this),d=t+"-lbl",m=v(a),p=void 0===i&&null!=l,f=void 0===i?null!=l?l:"":i;return m&&(m.id=d),y(!0,a,this.name,this.value,this.disabled),e(h,{onClick:this.onClick,role:"combobox","aria-disabled":r?"true":null,"aria-expanded":`${n}`,"aria-haspopup":"true","aria-labelledby":d,class:{[c]:!0,"datetime-disabled":r,"datetime-readonly":o,"datetime-placeholder":p,"in-item":u("ion-item",a)}},e("div",{class:"datetime-text"},f),e("button",{type:"button",onFocus:this.onFocus,onBlur:this.onBlur,disabled:this.disabled,ref:t=>this.buttonEl=t}))}get el(){return r(this)}static get watchers(){return{disabled:["disabledChanged"],value:["valueChanged"]}}static get style(){return":host{padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);display:-ms-flexbox;display:flex;position:relative;min-width:16px;min-height:1.2em;font-family:var(--ion-font-family,inherit);text-overflow:ellipsis;white-space:nowrap;overflow:hidden;z-index:2}\@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}:host(.in-item){position:static}:host(.datetime-placeholder){color:var(--placeholder-color)}:host(.datetime-disabled){opacity:.3;pointer-events:none}:host(.datetime-readonly){pointer-events:none}button{left:0;top:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;position:absolute;width:100%;height:100%;border:0;background:transparent;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none}:host-context([dir=rtl]) button,[dir=rtl] button{left:unset;right:unset;right:0}button::-moz-focus-inner{border:0}.datetime-text{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;-ms-flex:1;flex:1;min-height:inherit;direction:ltr;overflow:inherit}:host-context([dir=rtl]) .datetime-text,[dir=rtl] .datetime-text{direction:rtl}:host{--placeholder-color:var(--ion-color-step-400,#999);--padding-top:10px;--padding-end:8px;--padding-bottom:10px;--padding-start:16px}"}},tt=t=>{const i=[];let s,e;for(let h=0;h<t.length;h++){s=t[h],i.push(0);for(const t of s.options)(e=t.text.length)>i[h]&&(i[h]=e)}return 2===i.length?(e=Math.max(i[0],i[1]),t[0].align="right",t[1].align="left",t[0].optionsWidth=t[1].optionsWidth=`${17*e}px`):3===i.length&&(e=Math.max(i[0],i[2]),t[0].align="right",t[1].columnWidth=`${17*i[1]}px`,t[0].optionsWidth=t[2].optionsWidth=`${17*e}px`,t[2].align="left"),t},it="MMM D, YYYY";let st=0;const et=t=>{const i=o(),s=o(),e=o();return s.addElement(t.querySelector("ion-backdrop")).fromTo("opacity",.01,.26),e.addElement(t.querySelector(".picker-wrapper")).fromTo("transform","translateY(100%)","translateY(0%)"),i.addElement(t).easing("cubic-bezier(.36,.66,.04,1)").duration(400).addAnimation([s,e])},ht=t=>{const i=o(),s=o(),e=o();return s.addElement(t.querySelector("ion-backdrop")).fromTo("opacity",.26,.01),e.addElement(t.querySelector(".picker-wrapper")).fromTo("transform","translateY(0%)","translateY(100%)"),i.addElement(t).easing("cubic-bezier(.36,.66,.04,1)").duration(400).addAnimation([s,e])},rt=class{constructor(e){t(this,e),this.mode=s(this),this.presented=!1,this.keyboardClose=!0,this.buttons=[],this.columns=[],this.duration=0,this.showBackdrop=!0,this.backdropDismiss=!0,this.animated=!0,this.onBackdropTap=()=>{const t=this.buttons.find(t=>"cancel"===t.role);t?this.buttonClick(t):this.dismiss()},this.didPresent=i(this,"ionPickerDidPresent",7),this.willPresent=i(this,"ionPickerWillPresent",7),this.willDismiss=i(this,"ionPickerWillDismiss",7),this.didDismiss=i(this,"ionPickerDidDismiss",7)}async present(){await a(this,"pickerEnter",et,et,void 0),this.duration>0&&(this.durationTimeout=setTimeout(()=>this.dismiss(),this.duration))}dismiss(t,i){return this.durationTimeout&&clearTimeout(this.durationTimeout),l(this,t,i,"pickerLeave",ht,ht)}onDidDismiss(){return c(this.el,"ionPickerDidDismiss")}onWillDismiss(){return c(this.el,"ionPickerWillDismiss")}getColumn(t){return Promise.resolve(this.columns.find(i=>i.name===t))}buttonClick(t){return!1!==d(t.handler,this.getSelected())?this.dismiss():Promise.resolve(!1)}getSelected(){const t={};return this.columns.forEach((i,s)=>{const e=void 0!==i.selectedIndex?i.options[i.selectedIndex]:void 0;t[i.name]={text:e?e.text:void 0,value:e?e.value:void 0,columnIndex:s}}),t}render(){const t=s(this);return e(h,{"aria-modal":"true",class:Object.assign({[t]:!0,[`picker-${t}`]:!0},m(this.cssClass)),style:{zIndex:`${2e4+this.overlayIndex}`},onIonBackdropTap:this.onBackdropTap},e("ion-backdrop",{visible:this.showBackdrop,tappable:this.backdropDismiss}),e("div",{class:"picker-wrapper",role:"dialog"},e("div",{class:"picker-toolbar"},this.buttons.map(t=>e("div",{class:ot(t)},e("button",{type:"button",onClick:()=>this.buttonClick(t),class:nt(t)},t.text)))),e("div",{class:"picker-columns"},e("div",{class:"picker-above-highlight"}),this.presented&&this.columns.map(t=>e("ion-picker-column",{col:t})),e("div",{class:"picker-below-highlight"}))))}get el(){return r(this)}static get style(){return".sc-ion-picker-ios-h{--border-radius:0;--border-style:solid;--min-width:auto;--width:100%;--max-width:500px;--min-height:auto;--max-height:auto;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;left:0;top:0;display:block;position:absolute;width:100%;height:100%;font-family:var(--ion-font-family,inherit);contain:strict;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:1000}[dir=rtl].sc-ion-picker-ios-h, [dir=rtl] .sc-ion-picker-ios-h{left:unset;right:unset;right:0}.overlay-hidden.sc-ion-picker-ios-h{display:none}.picker-wrapper.sc-ion-picker-ios{border-radius:var(--border-radius);left:0;right:0;bottom:0;margin-left:auto;margin-right:auto;margin-top:auto;margin-bottom:auto;-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0);display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:column;flex-direction:column;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);contain:strict;overflow:hidden;z-index:10}\@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){.picker-wrapper.sc-ion-picker-ios{margin-left:unset;margin-right:unset;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}}.picker-toolbar.sc-ion-picker-ios{width:100%;background:transparent;contain:strict;z-index:1}.picker-button.sc-ion-picker-ios{border:0;font-family:inherit}.picker-button.sc-ion-picker-ios:active, .picker-button.sc-ion-picker-ios:focus{outline:none}.picker-columns.sc-ion-picker-ios{display:-ms-flexbox;display:flex;position:relative;-ms-flex-pack:center;justify-content:center;margin-bottom:var(--ion-safe-area-bottom,0);contain:strict;direction:ltr;overflow:hidden}.picker-above-highlight.sc-ion-picker-ios, .picker-below-highlight.sc-ion-picker-ios{display:none;pointer-events:none}.sc-ion-picker-ios-h{--background:var(--ion-background-color,#fff);--border-width:1px 0 0;--border-color:var(--ion-item-border-color,var(--ion-border-color,var(--ion-color-step-250,#c8c7cc)));--height:260px;color:var(--ion-item-color,var(--ion-text-color,#000))}.picker-toolbar.sc-ion-picker-ios{display:-ms-flexbox;display:flex;height:44px;border-bottom:.55px solid var(--border-color)}.picker-toolbar-button.sc-ion-picker-ios{-ms-flex:1;flex:1;text-align:end}.picker-toolbar-button.sc-ion-picker-ios:last-child .picker-button.sc-ion-picker-ios{font-weight:600}.picker-toolbar-button.sc-ion-picker-ios:first-child{font-weight:400;text-align:start}.picker-button.sc-ion-picker-ios, .picker-button.activated.sc-ion-picker-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:1em;padding-right:1em;padding-top:0;padding-bottom:0;height:44px;background:transparent;color:var(--ion-color-primary,#3880ff);font-size:16px}\@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){.picker-button.sc-ion-picker-ios, .picker-button.activated.sc-ion-picker-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:1em;padding-inline-start:1em;-webkit-padding-end:1em;padding-inline-end:1em}}.picker-columns.sc-ion-picker-ios{height:215px;-webkit-perspective:1000px;perspective:1000px}.picker-above-highlight.sc-ion-picker-ios{left:0;top:0;-webkit-transform:translateZ(90px);transform:translateZ(90px);display:block;position:absolute;width:100%;height:81px;border-bottom:1px solid var(--border-color);background:-webkit-gradient(linear,left top,left bottom,color-stop(20%,var(--background,var(--ion-background-color,#fff))),to(rgba(var(--background-rgb,var(--ion-background-color-rgb,255,255,255)),.8)));background:linear-gradient(180deg,var(--background,var(--ion-background-color,#fff)) 20%,rgba(var(--background-rgb,var(--ion-background-color-rgb,255,255,255)),.8));z-index:10}[dir=rtl].sc-ion-picker-ios-h .picker-above-highlight.sc-ion-picker-ios, [dir=rtl] .sc-ion-picker-ios-h .picker-above-highlight.sc-ion-picker-ios, [dir=rtl].sc-ion-picker-ios .picker-above-highlight.sc-ion-picker-ios{left:unset;right:unset;right:0}.picker-below-highlight.sc-ion-picker-ios{left:0;top:115px;-webkit-transform:translateZ(90px);transform:translateZ(90px);display:block;position:absolute;width:100%;height:119px;border-top:1px solid var(--border-color);background:-webkit-gradient(linear,left bottom,left top,color-stop(30%,var(--background,var(--ion-background-color,#fff))),to(rgba(var(--background-rgb,var(--ion-background-color-rgb,255,255,255)),.8)));background:linear-gradient(0deg,var(--background,var(--ion-background-color,#fff)) 30%,rgba(var(--background-rgb,var(--ion-background-color-rgb,255,255,255)),.8));z-index:11}[dir=rtl].sc-ion-picker-ios-h .picker-below-highlight.sc-ion-picker-ios, [dir=rtl] .sc-ion-picker-ios-h .picker-below-highlight.sc-ion-picker-ios, [dir=rtl].sc-ion-picker-ios .picker-below-highlight.sc-ion-picker-ios{left:unset;right:unset;right:0}"}},ot=t=>({[`picker-toolbar-${t.role}`]:void 0!==t.role,"picker-toolbar-button":!0}),nt=t=>Object.assign({"picker-button":!0,"ion-activatable":!0},m(t.cssClass)),at=class{constructor(s){t(this,s),this.optHeight=0,this.rotateFactor=0,this.scaleFactor=1,this.velocity=0,this.y=0,this.noAnimate=!0,this.ionPickerColChange=i(this,"ionPickerColChange",7)}colChanged(){this.refresh()}componentWillLoad(){let t=0,i=.81;"ios"===s(this)&&(t=-.46,i=1),this.rotateFactor=t,this.scaleFactor=i}async componentDidLoad(){const t=this.optsEl;t&&(this.optHeight=t.firstElementChild?t.firstElementChild.clientHeight:0),this.refresh(),this.gesture=(await __sc_import_ionic("./p-2c4a5477.js")).createGesture({el:this.el,gestureName:"picker-swipe",gesturePriority:100,threshold:0,onStart:t=>this.onStart(t),onMove:t=>this.onMove(t),onEnd:t=>this.onEnd(t)}),this.gesture.setDisabled(!1),this.tmrId=setTimeout(()=>{this.noAnimate=!1,this.refresh(!0)},250)}componentDidUnload(){cancelAnimationFrame(this.rafId),clearTimeout(this.tmrId),this.gesture&&(this.gesture.destroy(),this.gesture=void 0)}emitColChange(){this.ionPickerColChange.emit(this.col)}setSelected(t,i){const s=t>-1?-t*this.optHeight:0;this.velocity=0,cancelAnimationFrame(this.rafId),this.update(s,i,!0),this.emitColChange()}update(t,i,s){if(!this.optsEl)return;let e=0,h=0;const{col:r,rotateFactor:o}=this,n=r.selectedIndex=this.indexForY(-t),a=0===i?"":i+"ms",l=`scale(${this.scaleFactor})`,c=this.optsEl.children;for(let s=0;s<c.length;s++){const d=c[s],u=r.options[s],m=s*this.optHeight+t;let p="";if(0!==o){const t=m*o;Math.abs(t)<=90?(e=0,h=90,p=`rotateX(${t}deg) `):e=-9999}else h=0,e=m;const f=n===s;p+=`translate3d(0px,${e}px,${h}px) `,1===this.scaleFactor||f||(p+=l),this.noAnimate?(u.duration=0,d.style.transitionDuration=""):i!==u.duration&&(u.duration=i,d.style.transitionDuration=a),p!==u.transform&&(u.transform=p,d.style.transform=p),f!==u.selected&&(u.selected=f,f?d.classList.add(lt):d.classList.remove(lt))}this.col.prevSelected=n,s&&(this.y=t),this.lastIndex!==n&&(p(),this.lastIndex=n)}decelerate(){if(0!==this.velocity){this.velocity*=ct,this.velocity=this.velocity>0?Math.max(this.velocity,1):Math.min(this.velocity,-1);let t=this.y+this.velocity;t>this.minY?(t=this.minY,this.velocity=0):t<this.maxY&&(t=this.maxY,this.velocity=0),this.update(t,0,!0),Math.round(t)%this.optHeight!=0||Math.abs(this.velocity)>1?this.rafId=requestAnimationFrame(()=>this.decelerate()):(this.velocity=0,this.emitColChange())}else if(this.y%this.optHeight!=0){const t=Math.abs(this.y%this.optHeight);this.velocity=t>this.optHeight/2?1:-1,this.decelerate()}}indexForY(t){return Math.min(Math.max(Math.abs(Math.round(t/this.optHeight)),0),this.col.options.length-1)}onStart(t){t.event.preventDefault(),t.event.stopPropagation(),cancelAnimationFrame(this.rafId);const i=this.col.options;let s=i.length-1,e=0;for(let t=0;t<i.length;t++)i[t].disabled||(s=Math.min(s,t),e=Math.max(e,t));this.minY=-s*this.optHeight,this.maxY=-e*this.optHeight}onMove(t){t.event.preventDefault(),t.event.stopPropagation();let i=this.y+t.deltaY;i>this.minY?(i=Math.pow(i,.8),this.bounceFrom=i):i<this.maxY?(i+=Math.pow(this.maxY-i,.9),this.bounceFrom=i):this.bounceFrom=0,this.update(i,0,!1)}onEnd(t){if(this.bounceFrom>0)return this.update(this.minY,100,!0),void this.emitColChange();if(this.bounceFrom<0)return this.update(this.maxY,100,!0),void this.emitColChange();if(this.velocity=f(-dt,23*t.velocityY,dt),0===this.velocity&&0===t.deltaY){const i=t.event.target.closest(".picker-opt");i&&i.hasAttribute("opt-index")&&this.setSelected(parseInt(i.getAttribute("opt-index"),10),ut)}else this.y+=t.deltaY,this.decelerate()}refresh(t){let i=this.col.options.length-1,s=0;const e=this.col.options;for(let t=0;t<e.length;t++)e[t].disabled||(i=Math.min(i,t),s=Math.max(s,t));if(0!==this.velocity)return;const h=f(i,this.col.selectedIndex||0,s);if(this.col.prevSelected!==h||t){const t=h*this.optHeight*-1;this.velocity=0,this.update(t,ut,!0)}}render(){const t=this.col,i=s(this);return e(h,{class:{[i]:!0,"picker-col":!0,"picker-opts-left":"left"===this.col.align,"picker-opts-right":"right"===this.col.align},style:{"max-width":this.col.columnWidth}},t.prefix&&e("div",{class:"picker-prefix",style:{width:t.prefixWidth}},t.prefix),e("div",{class:"picker-opts",style:{maxWidth:t.optionsWidth},ref:t=>this.optsEl=t},t.options.map((t,i)=>e("button",{type:"button",class:{"picker-opt":!0,"picker-opt-disabled":!!t.disabled},"opt-index":i},t.text))),t.suffix&&e("div",{class:"picker-suffix",style:{width:t.suffixWidth}},t.suffix))}get el(){return r(this)}static get watchers(){return{col:["colChanged"]}}static get style(){return".picker-col{display:-ms-flexbox;display:flex;position:relative;-ms-flex:1;flex:1;-ms-flex-pack:center;justify-content:center;height:100%;-webkit-box-sizing:content-box;box-sizing:content-box;contain:content}.picker-opts{position:relative;-ms-flex:1;flex:1;max-width:100%}.picker-opt{left:0;top:0;display:block;position:absolute;width:100%;border:0;text-align:center;text-overflow:ellipsis;white-space:nowrap;contain:strict;overflow:hidden;will-change:transform}:host-context([dir=rtl]) .picker-opt,[dir=rtl] .picker-opt{left:unset;right:unset;right:0}.picker-opt.picker-opt-disabled{pointer-events:none}.picker-opt-disabled{opacity:0}.picker-opts-left{-ms-flex-pack:start;justify-content:flex-start}.picker-opts-right{-ms-flex-pack:end;justify-content:flex-end}.picker-opt:active,.picker-opt:focus{outline:none}.picker-prefix{text-align:end}.picker-prefix,.picker-suffix{position:relative;-ms-flex:1;flex:1;white-space:nowrap}.picker-suffix{text-align:start}.picker-col{padding-left:4px;padding-right:4px;padding-top:0;padding-bottom:0;-webkit-transform-style:preserve-3d;transform-style:preserve-3d}\@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){.picker-col{padding-left:unset;padding-right:unset;-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px}}.picker-opts,.picker-prefix,.picker-suffix{top:77px;pointer-events:none}.picker-opt,.picker-opts,.picker-prefix,.picker-suffix{-webkit-transform-style:preserve-3d;transform-style:preserve-3d;color:inherit;font-size:20px;line-height:42px}.picker-opt{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;-webkit-transform-origin:center center;transform-origin:center center;height:46px;-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out;background:transparent;-webkit-backface-visibility:hidden;backface-visibility:hidden;pointer-events:auto}:host-context([dir=rtl]) .picker-opt,[dir=rtl] .picker-opt{-webkit-transform-origin:calc(100% - center) center;transform-origin:calc(100% - center) center}"}},lt="picker-opt-selected",ct=.97,dt=90,ut=150;export{Q as ion_datetime,rt as ion_picker,at as ion_picker_column};