import{r as p}from"./index-BP8_t0zE.js";import{g as O,u as S,s as v}from"./TextField-n0Myx-gm.js";import{T as h}from"./Typography-E7d16C50.js";import{u as _}from"./Button-C3j8Wgdd.js";var l=function(){return l=Object.assign||function(e){for(var n,r=1,t=arguments.length;r<t;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},l.apply(this,arguments)},L=function(e,n){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(r[t]=e[t]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,t=Object.getOwnPropertySymbols(e);a<t.length;a++)n.indexOf(t[a])<0&&Object.prototype.propertyIsEnumerable.call(e,t[a])&&(r[t[a]]=e[t[a]]);return r},w=function(e){var n=e.className,r=e.emptyText,t=e.locales,a=e.options,u=e.showTime,f=u===void 0?!1:u,d=e.showDate,c=d===void 0?!0:d,g=e.transform,D=g===void 0?x:g,y=L(e,["className","emptyText","locales","options","showTime","showDate","transform"]),T=_();if(!f&&!c)throw new Error("<DateField> cannot have showTime and showDate false at the same time");var i=S(e);if(i==null||i==="")return r?p.createElement(h,l({component:"span",variant:"body2",className:n},v(y)),r&&T(r,{_:r})):null;var o=D(i),s="";if(o)if(f&&c)s=m?o.toLocaleString(t,a):o.toLocaleString();else if(c){var b=a??(typeof i=="string"&&i.length<=10?{timeZone:"UTC"}:void 0);s=m?o.toLocaleDateString(t,b):o.toLocaleDateString()}else f&&(s=m?o.toLocaleTimeString(t,a):o.toLocaleTimeString());return p.createElement(h,l({component:"span",variant:"body2",className:n},v(y)),s)};w.displayName="DateFieldImpl";var P=O(w),x=function(e){return e instanceof Date?e:typeof e=="string"||typeof e=="number"?new Date(e):void 0},m=function(){try{new Date().toLocaleString("i")}catch(e){return e instanceof RangeError}return!1}();export{P as D};
