import{s as F,c1 as R,aV as v,ah as j,aG as T,E as w,G as H,t as O,f as _,ag as S,y as h,c2 as I,z as g,P,Q as f,aZ as U,a1 as b}from"./index-BPRWoLf4.js";var y=function(u){F(a,u);function a(e){var n=u.call(this,e)||this,t=e.defaultValue,i=e.setPrinstineValue,l=e.delimiter,r=e.format,o=e.valueFormat,d=e.data,p=e.value,s=e.joinValues,m=e.utc;if(t&&p===t){var c=typeof t=="string"?t.split(l):t;i(R.formatValue({startDate:v(c[0],d,o||r),endDate:v(c[1],d,o||r)},o||r,s,l,m))}return n}return a.prototype.componentDidUpdate=function(e){var n=this.props,t=n.defaultValue,i=n.delimiter,l=n.joinValues,r=n.setPrinstineValue,o=n.data,d=n.utc,p=n.format,s=n.valueFormat;if(e.defaultValue!==t){var m=typeof t=="string"?t.split(i):t;r(m?R.formatValue({startDate:v(m[0],o,s||p),endDate:v(m[1],o,s||p)},s||p,l,i,d):void 0)}},a.prototype.getRef=function(e){for(;e&&e.getWrappedInstance;)e=e.getWrappedInstance();this.dateRef=e},a.prototype.dispatchEvent=function(e){var n=this.props,t=n.dispatchEvent;n.data;var i=n.value;t(e,j(this.props,{value:i}))},a.prototype.doAction=function(e,n,t){var i,l,r,o,d=this.props,p=d.resetValue,s=d.formStore,m=d.store,c=d.name;if(e.actionType==="clear"){(i=this.dateRef)===null||i===void 0||i.clear();return}if(e.actionType==="reset"){var V=(r=T((l=s==null?void 0:s.pristine)!==null&&l!==void 0?l:m==null?void 0:m.pristine,c))!==null&&r!==void 0?r:p;(o=this.dateRef)===null||o===void 0||o.reset(V)}},a.prototype.setData=function(e){var n=this.props,t=n.data,i=n.delimiter,l=n.valueFormat,r=n.format,o=n.joinValues,d=n.utc,p=n.onChange;if(typeof e=="string"){var s=typeof e=="string"?e.split(i):e;e=R.formatValue({startDate:v(s[0],t,l||r),endDate:v(s[1],t,l||r)},l||r,o,i,d)}p(e)},a.prototype.handleChange=function(e){return w(this,void 0,void 0,function(){var n,t;return H(this,function(i){return n=this.props,t=n.dispatchEvent,n.data,t("change",j(this.props,{value:e})),this.props.onChange(e),[2]})})},a.prototype.render=function(){var e=this,n,t=this.props,i=t.className;t.style;var l=t.classPrefix;t.defaultValue,t.defaultData;var r=t.minDate,o=t.maxDate,d=t.minDuration,p=t.maxDuration,s=t.data,m=t.format,c=t.valueFormat,V=t.inputFormat,M=t.displayFormat,D=t.env,x=t.mobileUI,C=O(t,["className","style","classPrefix","defaultValue","defaultData","minDate","maxDate","minDuration","maxDuration","data","format","valueFormat","inputFormat","displayFormat","env","mobileUI"]),E=(n=this.props)===null||n===void 0?void 0:n.type;return _.createElement("div",{className:S("".concat(l,"DateRangeControl"),{"is-date":/date-/.test(E),"is-datetime":/datetime-/.test(E)},i)},_.createElement(R,h({},C,{mobileUI:x,classPrefix:l,popOverContainer:x?D==null?void 0:D.getModalContainer:C.popOverContainer||D.getModalContainer,popOverContainerSelector:C.popOverContainerSelector,onRef:this.getRef,data:s,valueFormat:c||m,displayFormat:M||V,minDate:r?v(r,s,c||m):void 0,maxDate:o?v(o,s,c||m):void 0,minDateRaw:r,maxDateRaw:o,minDuration:d?I(d):void 0,maxDuration:p?I(p):void 0,onChange:this.handleChange,onFocus:function(){return e.dispatchEvent("focus")},onBlur:function(){return e.dispatchEvent("blur")}})))},a.defaultProps={format:"X",joinValues:!0,delimiter:",",animation:!0},g([P,f("design:type",Function),f("design:paramtypes",[Object]),f("design:returntype",void 0)],a.prototype,"getRef",null),g([P,f("design:type",Function),f("design:paramtypes",[String]),f("design:returntype",void 0)],a.prototype,"dispatchEvent",null),g([P,f("design:type",Function),f("design:paramtypes",[Object]),f("design:returntype",Promise)],a.prototype,"handleChange",null),g([U(),f("design:type",Function),f("design:paramtypes",[]),f("design:returntype",void 0)],a.prototype,"render",null),a}(_.Component),Y=function(u){F(a,u);function a(){return u!==null&&u.apply(this,arguments)||this}return a.defaultProps=h({},y.defaultProps),a=g([b({type:"input-date-range"})],a),a}(y),z=function(u){F(a,u);function a(){return u!==null&&u.apply(this,arguments)||this}return a.defaultProps=h(h({},y.defaultProps),{inputFormat:"YYYY-MM-DD HH:mm"}),a=g([b({type:"input-datetime-range",sizeMutable:!1})],a),a}(y),G=function(u){F(a,u);function a(){return u!==null&&u.apply(this,arguments)||this}return a.defaultProps=h(h({},y.defaultProps),{format:"HH:mm",inputFormat:"HH:mm",viewMode:"time",ranges:"",shortcuts:""}),a=g([b({type:"input-time-range",sizeMutable:!1})],a),a}(y);export{Y as DateRangeControlRenderer,z as DateTimeRangeControlRenderer,G as TimeRangeControlRenderer,y as default};
