diff --git a/assets/js/controllers/datepicker_controller.js b/assets/js/controllers/datepicker_controller.js index a05f8a8c..d1c98eec 100644 --- a/assets/js/controllers/datepicker_controller.js +++ b/assets/js/controllers/datepicker_controller.js @@ -8,7 +8,7 @@ */ import { Controller } from '@hotwired/stimulus'; -import { TempusDominus } from '@eonasdan/tempus-dominus'; +import Flatpickr from 'flatpickr'; export default class extends Controller { static values = { @@ -20,7 +20,7 @@ export default class extends Controller { this.dispatchEvent('datepicker:pre-connect', { options }); - const datePicker = new TempusDominus(this.element, options); + const datePicker = new Flatpickr(this.element, { ...options, wrap: true }); this.dispatchEvent('datepicker:connect', { datePicker }); } diff --git a/assets/scss/app.scss b/assets/scss/app.scss index ac7b9c00..abaacaa7 100644 --- a/assets/scss/app.scss +++ b/assets/scss/app.scss @@ -7,4 +7,4 @@ * file that was distributed with this source code. */ -@import '@eonasdan/tempus-dominus'; +@import 'flatpickr'; diff --git a/package-lock.json b/package-lock.json index 1317d01f..1ebc977f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,9 +6,9 @@ "": { "license": "MIT", "dependencies": { - "@eonasdan/tempus-dominus": "6.0.0-beta7", "@hotwired/stimulus": "3.0.1", - "@symfony/stimulus-bridge": "3.1.0" + "@symfony/stimulus-bridge": "3.1.0", + "flatpickr": "4.6.13" }, "devDependencies": { "@babel/core": "^7.17", @@ -1624,17 +1624,6 @@ "node": ">=10.0.0" } }, - "node_modules/@eonasdan/tempus-dominus": { - "version": "6.0.0-beta7", - "resolved": "https://registry.npmjs.org/@eonasdan/tempus-dominus/-/tempus-dominus-6.0.0-beta7.tgz", - "integrity": "sha512-XWZUowQ8KoWB0vKdx6gEKCOnaMEg7nBUnjKF7CGtBSw1cgG9V9uwchnK7P1HtgBcRxI9A6jKYp/2q4mA+NBvgg==", - "funding": { - "url": "https://ko-fi.com/eonasdan" - }, - "peerDependencies": { - "@popperjs/core": "^2.10.1" - } - }, "node_modules/@eslint/eslintrc": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.2.2.tgz", @@ -1822,16 +1811,6 @@ "webpack": "^2.0.0 || ^3.0.0 || ^4.0.0 || ^5.0.0" } }, - "node_modules/@popperjs/core": { - "version": "2.11.5", - "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.5.tgz", - "integrity": "sha512-9X2obfABZuDVLCgPK9aX0a/x4jaOEweTTWE2+9sr0Qqqevj2Uv5XorvusThmc9XGYpS9yI+fhh8RTafBtGposw==", - "peer": true, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/popperjs" - } - }, "node_modules/@symfony/stimulus-bridge": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/@symfony/stimulus-bridge/-/stimulus-bridge-3.1.0.tgz", @@ -4977,6 +4956,11 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/flatpickr": { + "version": "4.6.13", + "resolved": "https://registry.npmjs.org/flatpickr/-/flatpickr-4.6.13.tgz", + "integrity": "sha512-97PMG/aywoYpB4IvbvUJi0RQi8vearvU0oov1WW3k0WZPBMrTQVqekSX5CjSG/M4Q3i6A/0FKXC7RyAoAUUSPw==" + }, "node_modules/flatted": { "version": "3.2.5", "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.5.tgz", @@ -11536,12 +11520,6 @@ "integrity": "sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==", "dev": true }, - "@eonasdan/tempus-dominus": { - "version": "6.0.0-beta7", - "resolved": "https://registry.npmjs.org/@eonasdan/tempus-dominus/-/tempus-dominus-6.0.0-beta7.tgz", - "integrity": "sha512-XWZUowQ8KoWB0vKdx6gEKCOnaMEg7nBUnjKF7CGtBSw1cgG9V9uwchnK7P1HtgBcRxI9A6jKYp/2q4mA+NBvgg==", - "requires": {} - }, "@eslint/eslintrc": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.2.2.tgz", @@ -11686,12 +11664,6 @@ "string-width": "^4.2.3" } }, - "@popperjs/core": { - "version": "2.11.5", - "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.5.tgz", - "integrity": "sha512-9X2obfABZuDVLCgPK9aX0a/x4jaOEweTTWE2+9sr0Qqqevj2Uv5XorvusThmc9XGYpS9yI+fhh8RTafBtGposw==", - "peer": true - }, "@symfony/stimulus-bridge": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/@symfony/stimulus-bridge/-/stimulus-bridge-3.1.0.tgz", @@ -14128,6 +14100,11 @@ } } }, + "flatpickr": { + "version": "4.6.13", + "resolved": "https://registry.npmjs.org/flatpickr/-/flatpickr-4.6.13.tgz", + "integrity": "sha512-97PMG/aywoYpB4IvbvUJi0RQi8vearvU0oov1WW3k0WZPBMrTQVqekSX5CjSG/M4Q3i6A/0FKXC7RyAoAUUSPw==" + }, "flatted": { "version": "3.2.5", "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.5.tgz", diff --git a/package.json b/package.json index 3c452892..89e973d7 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "dependencies": { - "@eonasdan/tempus-dominus": "6.0.0-beta7", + "@hotwired/stimulus": "3.0.1", "@symfony/stimulus-bridge": "3.1.0", - "@hotwired/stimulus": "3.0.1" + "flatpickr": "4.6.13" }, "devDependencies": { "@babel/core": "^7.17", diff --git a/src/Bridge/Symfony/Resources/public/430.js b/src/Bridge/Symfony/Resources/public/430.js deleted file mode 100644 index bf0a0a5e..00000000 --- a/src/Bridge/Symfony/Resources/public/430.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[430],{430:function(t,e,s){function i(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function o(t){return t instanceof i(t).Element||t instanceof Element}function n(t){return t instanceof i(t).HTMLElement||t instanceof HTMLElement}function a(t){return"undefined"!=typeof ShadowRoot&&(t instanceof i(t).ShadowRoot||t instanceof ShadowRoot)}s.d(e,{Jz:function(){return qt}});var r=Math.max,c=Math.min,d=Math.round;function l(t,e){void 0===e&&(e=!1);var s=t.getBoundingClientRect(),i=1,o=1;if(n(t)&&e){var a=t.offsetHeight,r=t.offsetWidth;r>0&&(i=d(s.width)/r||1),a>0&&(o=d(s.height)/a||1)}return{width:s.width/i,height:s.height/o,top:s.top/o,right:s.right/i,bottom:s.bottom/o,left:s.left/i,x:s.left/i,y:s.top/o}}function h(t){var e=i(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function p(t){return t?(t.nodeName||"").toLowerCase():null}function u(t){return((o(t)?t.ownerDocument:t.document)||window.document).documentElement}function m(t){return l(u(t)).left+h(t).scrollLeft}function f(t){return i(t).getComputedStyle(t)}function y(t){var e=f(t),s=e.overflow,i=e.overflowX,o=e.overflowY;return/auto|scroll|overlay|hidden/.test(s+o+i)}function v(t,e,s){void 0===s&&(s=!1);var o,a,r=n(e),c=n(e)&&function(t){var e=t.getBoundingClientRect(),s=d(e.width)/t.offsetWidth||1,i=d(e.height)/t.offsetHeight||1;return 1!==s||1!==i}(e),f=u(e),v=l(t,c),g={scrollLeft:0,scrollTop:0},b={x:0,y:0};return(r||!r&&!s)&&(("body"!==p(e)||y(f))&&(g=(o=e)!==i(o)&&n(o)?{scrollLeft:(a=o).scrollLeft,scrollTop:a.scrollTop}:h(o)),n(e)?((b=l(e,!0)).x+=e.clientLeft,b.y+=e.clientTop):f&&(b.x=m(f))),{x:v.left+g.scrollLeft-b.x,y:v.top+g.scrollTop-b.y,width:v.width,height:v.height}}function g(t){var e=l(t),s=t.offsetWidth,i=t.offsetHeight;return Math.abs(e.width-s)<=1&&(s=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:t.offsetLeft,y:t.offsetTop,width:s,height:i}}function b(t){return"html"===p(t)?t:t.assignedSlot||t.parentNode||(a(t)?t.host:null)||u(t)}function w(t){return["html","body","#document"].indexOf(p(t))>=0?t.ownerDocument.body:n(t)&&y(t)?t:w(b(t))}function S(t,e){var s;void 0===e&&(e=[]);var o=w(t),n=o===(null==(s=t.ownerDocument)?void 0:s.body),a=i(o),r=n?[a].concat(a.visualViewport||[],y(o)?o:[]):o,c=e.concat(r);return n?c:c.concat(S(b(r)))}function D(t){return["table","td","th"].indexOf(p(t))>=0}function k(t){return n(t)&&"fixed"!==f(t).position?t.offsetParent:null}function C(t){for(var e=i(t),s=k(t);s&&D(s)&&"static"===f(s).position;)s=k(s);return s&&("html"===p(s)||"body"===p(s)&&"static"===f(s).position)?e:s||function(t){var e=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&n(t)&&"fixed"===f(t).position)return null;var s=b(t);for(a(s)&&(s=s.host);n(s)&&["html","body"].indexOf(p(s))<0;){var i=f(s);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||e&&"filter"===i.willChange||e&&i.filter&&"none"!==i.filter)return s;s=s.parentNode}return null}(t)||e}var _="top",E="bottom",M="right",x="left",O="auto",L=[_,E,M,x],A="start",T="end",H="viewport",V="popper",$=L.reduce((function(t,e){return t.concat([e+"-"+A,e+"-"+T])}),[]),P=[].concat(L,[O]).reduce((function(t,e){return t.concat([e,e+"-"+A,e+"-"+T])}),[]),I=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function N(t){var e=new Map,s=new Set,i=[];function o(t){s.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!s.has(t)){var i=e.get(t);i&&o(i)}})),i.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){s.has(t.name)||o(t)})),i}var j={placement:"bottom",modifiers:[],strategy:"absolute"};function B(){for(var t=arguments.length,e=new Array(t),s=0;s=0?"x":"y"}function U(t){var e,s=t.reference,i=t.element,o=t.placement,n=o?F(o):null,a=o?q(o):null,r=s.x+s.width/2-i.width/2,c=s.y+s.height/2-i.height/2;switch(n){case _:e={x:r,y:s.y-i.height};break;case E:e={x:r,y:s.y+s.height};break;case M:e={x:s.x+s.width,y:c};break;case x:e={x:s.x-i.width,y:c};break;default:e={x:s.x,y:s.y}}var d=n?Y(n):null;if(null!=d){var l="y"===d?"height":"width";switch(a){case A:e[d]=e[d]-(s[l]/2-i[l]/2);break;case T:e[d]=e[d]+(s[l]/2-i[l]/2)}}return e}var R={top:"auto",right:"auto",bottom:"auto",left:"auto"};function J(t){var e,s=t.popper,o=t.popperRect,n=t.placement,a=t.variation,r=t.offsets,c=t.position,l=t.gpuAcceleration,h=t.adaptive,p=t.roundOffsets,m=t.isFixed,y=r.x,v=void 0===y?0:y,g=r.y,b=void 0===g?0:g,w="function"==typeof p?p({x:v,y:b}):{x:v,y:b};v=w.x,b=w.y;var S=r.hasOwnProperty("x"),D=r.hasOwnProperty("y"),k=x,O=_,L=window;if(h){var A=C(s),H="clientHeight",V="clientWidth";if(A===i(s)&&"static"!==f(A=u(s)).position&&"absolute"===c&&(H="scrollHeight",V="scrollWidth"),A=A,n===_||(n===x||n===M)&&a===T)O=E,b-=(m&&A===L&&L.visualViewport?L.visualViewport.height:A[H])-o.height,b*=l?1:-1;if(n===x||(n===_||n===E)&&a===T)k=M,v-=(m&&A===L&&L.visualViewport?L.visualViewport.width:A[V])-o.width,v*=l?1:-1}var $,P=Object.assign({position:c},h&&R),I=!0===p?function(t){var e=t.x,s=t.y,i=window.devicePixelRatio||1;return{x:d(e*i)/i||0,y:d(s*i)/i||0}}({x:v,y:b}):{x:v,y:b};return v=I.x,b=I.y,l?Object.assign({},P,(($={})[O]=D?"0":"",$[k]=S?"0":"",$.transform=(L.devicePixelRatio||1)<=1?"translate("+v+"px, "+b+"px)":"translate3d("+v+"px, "+b+"px, 0)",$)):Object.assign({},P,((e={})[O]=D?b+"px":"",e[k]=S?v+"px":"",e.transform="",e))}var K={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,s=t.options,i=t.name,o=s.offset,n=void 0===o?[0,0]:o,a=P.reduce((function(t,s){return t[s]=function(t,e,s){var i=F(t),o=[x,_].indexOf(i)>=0?-1:1,n="function"==typeof s?s(Object.assign({},e,{placement:t})):s,a=n[0],r=n[1];return a=a||0,r=(r||0)*o,[x,M].indexOf(i)>=0?{x:r,y:a}:{x:a,y:r}}(s,e.rects,n),t}),{}),r=a[e.placement],c=r.x,d=r.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=c,e.modifiersData.popperOffsets.y+=d),e.modifiersData[i]=a}},Q={left:"right",right:"left",bottom:"top",top:"bottom"};function X(t){return t.replace(/left|right|bottom|top/g,(function(t){return Q[t]}))}var G={start:"end",end:"start"};function Z(t){return t.replace(/start|end/g,(function(t){return G[t]}))}function tt(t,e){var s=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(s&&a(s)){var i=e;do{if(i&&t.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function et(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function st(t,e){return e===H?et(function(t){var e=i(t),s=u(t),o=e.visualViewport,n=s.clientWidth,a=s.clientHeight,r=0,c=0;return o&&(n=o.width,a=o.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(r=o.offsetLeft,c=o.offsetTop)),{width:n,height:a,x:r+m(t),y:c}}(t)):o(e)?function(t){var e=l(t);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}(e):et(function(t){var e,s=u(t),i=h(t),o=null==(e=t.ownerDocument)?void 0:e.body,n=r(s.scrollWidth,s.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=r(s.scrollHeight,s.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),c=-i.scrollLeft+m(t),d=-i.scrollTop;return"rtl"===f(o||s).direction&&(c+=r(s.clientWidth,o?o.clientWidth:0)-n),{width:n,height:a,x:c,y:d}}(u(t)))}function it(t,e,s){var i="clippingParents"===e?function(t){var e=S(b(t)),s=["absolute","fixed"].indexOf(f(t).position)>=0&&n(t)?C(t):t;return o(s)?e.filter((function(t){return o(t)&&tt(t,s)&&"body"!==p(t)})):[]}(t):[].concat(e),a=[].concat(i,[s]),d=a[0],l=a.reduce((function(e,s){var i=st(t,s);return e.top=r(i.top,e.top),e.right=c(i.right,e.right),e.bottom=c(i.bottom,e.bottom),e.left=r(i.left,e.left),e}),st(t,d));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function ot(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function nt(t,e){return e.reduce((function(e,s){return e[s]=t,e}),{})}function at(t,e){void 0===e&&(e={});var s=e,i=s.placement,n=void 0===i?t.placement:i,a=s.boundary,r=void 0===a?"clippingParents":a,c=s.rootBoundary,d=void 0===c?H:c,h=s.elementContext,p=void 0===h?V:h,m=s.altBoundary,f=void 0!==m&&m,y=s.padding,v=void 0===y?0:y,g=ot("number"!=typeof v?v:nt(v,L)),b=p===V?"reference":V,w=t.rects.popper,S=t.elements[f?b:p],D=it(o(S)?S:S.contextElement||u(t.elements.popper),r,d),k=l(t.elements.reference),C=U({reference:k,element:w,strategy:"absolute",placement:n}),x=et(Object.assign({},w,C)),O=p===V?x:k,A={top:D.top-O.top+g.top,bottom:O.bottom-D.bottom+g.bottom,left:D.left-O.left+g.left,right:O.right-D.right+g.right},T=t.modifiersData.offset;if(p===V&&T){var $=T[n];Object.keys(A).forEach((function(t){var e=[M,E].indexOf(t)>=0?1:-1,s=[_,E].indexOf(t)>=0?"y":"x";A[t]+=$[s]*e}))}return A}function rt(t,e,s){return r(t,c(e,s))}var ct={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,s=t.options,i=t.name,o=s.mainAxis,n=void 0===o||o,a=s.altAxis,d=void 0!==a&&a,l=s.boundary,h=s.rootBoundary,p=s.altBoundary,u=s.padding,m=s.tether,f=void 0===m||m,y=s.tetherOffset,v=void 0===y?0:y,b=at(e,{boundary:l,rootBoundary:h,padding:u,altBoundary:p}),w=F(e.placement),S=q(e.placement),D=!S,k=Y(w),O="x"===k?"y":"x",L=e.modifiersData.popperOffsets,T=e.rects.reference,H=e.rects.popper,V="function"==typeof v?v(Object.assign({},e.rects,{placement:e.placement})):v,$="number"==typeof V?{mainAxis:V,altAxis:V}:Object.assign({mainAxis:0,altAxis:0},V),P=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,I={x:0,y:0};if(L){if(n){var N,j="y"===k?_:x,B="y"===k?E:M,z="y"===k?"height":"width",W=L[k],U=W+b[j],R=W-b[B],J=f?-H[z]/2:0,K=S===A?T[z]:H[z],Q=S===A?-H[z]:-T[z],X=e.elements.arrow,G=f&&X?g(X):{width:0,height:0},Z=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},tt=Z[j],et=Z[B],st=rt(0,T[z],G[z]),it=D?T[z]/2-J-st-tt-$.mainAxis:K-st-tt-$.mainAxis,ot=D?-T[z]/2+J+st+et+$.mainAxis:Q+st+et+$.mainAxis,nt=e.elements.arrow&&C(e.elements.arrow),ct=nt?"y"===k?nt.clientTop||0:nt.clientLeft||0:0,dt=null!=(N=null==P?void 0:P[k])?N:0,lt=W+ot-dt,ht=rt(f?c(U,W+it-dt-ct):U,W,f?r(R,lt):R);L[k]=ht,I[k]=ht-W}if(d){var pt,ut="x"===k?_:x,mt="x"===k?E:M,ft=L[O],yt="y"===O?"height":"width",vt=ft+b[ut],gt=ft-b[mt],bt=-1!==[_,x].indexOf(w),wt=null!=(pt=null==P?void 0:P[O])?pt:0,St=bt?vt:ft-T[yt]-H[yt]-wt+$.altAxis,Dt=bt?ft+T[yt]+H[yt]-wt-$.altAxis:gt,kt=f&&bt?function(t,e,s){var i=rt(t,e,s);return i>s?s:i}(St,ft,Dt):rt(f?St:vt,ft,f?Dt:gt);L[O]=kt,I[O]=kt-ft}e.modifiersData[i]=I}},requiresIfExists:["offset"]};var dt={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,s=t.state,i=t.name,o=t.options,n=s.elements.arrow,a=s.modifiersData.popperOffsets,r=F(s.placement),c=Y(r),d=[x,M].indexOf(r)>=0?"height":"width";if(n&&a){var l=function(t,e){return ot("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:nt(t,L))}(o.padding,s),h=g(n),p="y"===c?_:x,u="y"===c?E:M,m=s.rects.reference[d]+s.rects.reference[c]-a[c]-s.rects.popper[d],f=a[c]-s.rects.reference[c],y=C(n),v=y?"y"===c?y.clientHeight||0:y.clientWidth||0:0,b=m/2-f/2,w=l[p],S=v-h[d]-l[u],D=v/2-h[d]/2+b,k=rt(w,D,S),O=c;s.modifiersData[i]=((e={})[O]=k,e.centerOffset=k-D,e)}},effect:function(t){var e=t.state,s=t.options.element,i=void 0===s?"[data-popper-arrow]":s;null!=i&&("string"!=typeof i||(i=e.elements.popper.querySelector(i)))&&tt(e.elements.popper,i)&&(e.elements.arrow=i)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function lt(t,e,s){return void 0===s&&(s={x:0,y:0}),{top:t.top-e.height-s.y,right:t.right-e.width+s.x,bottom:t.bottom-e.height+s.y,left:t.left-e.width-s.x}}function ht(t){return[_,M,E,x].some((function(e){return t[e]>=0}))}var pt,ut=z({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,s=t.instance,o=t.options,n=o.scroll,a=void 0===n||n,r=o.resize,c=void 0===r||r,d=i(e.elements.popper),l=[].concat(e.scrollParents.reference,e.scrollParents.popper);return a&&l.forEach((function(t){t.addEventListener("scroll",s.update,W)})),c&&d.addEventListener("resize",s.update,W),function(){a&&l.forEach((function(t){t.removeEventListener("scroll",s.update,W)})),c&&d.removeEventListener("resize",s.update,W)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,s=t.name;e.modifiersData[s]=U({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,s=t.options,i=s.gpuAcceleration,o=void 0===i||i,n=s.adaptive,a=void 0===n||n,r=s.roundOffsets,c=void 0===r||r,d={placement:F(e.placement),variation:q(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:o,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,J(Object.assign({},d,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:a,roundOffsets:c})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,J(Object.assign({},d,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}},{name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var s=e.styles[t]||{},i=e.attributes[t]||{},o=e.elements[t];n(o)&&p(o)&&(Object.assign(o.style,s),Object.keys(i).forEach((function(t){var e=i[t];!1===e?o.removeAttribute(t):o.setAttribute(t,!0===e?"":e)})))}))},effect:function(t){var e=t.state,s={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,s.popper),e.styles=s,e.elements.arrow&&Object.assign(e.elements.arrow.style,s.arrow),function(){Object.keys(e.elements).forEach((function(t){var i=e.elements[t],o=e.attributes[t]||{},a=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:s[t]).reduce((function(t,e){return t[e]="",t}),{});n(i)&&p(i)&&(Object.assign(i.style,a),Object.keys(o).forEach((function(t){i.removeAttribute(t)})))}))}},requires:["computeStyles"]},K,{name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,s=t.options,i=t.name;if(!e.modifiersData[i]._skip){for(var o=s.mainAxis,n=void 0===o||o,a=s.altAxis,r=void 0===a||a,c=s.fallbackPlacements,d=s.padding,l=s.boundary,h=s.rootBoundary,p=s.altBoundary,u=s.flipVariations,m=void 0===u||u,f=s.allowedAutoPlacements,y=e.options.placement,v=F(y),g=c||(v===y||!m?[X(y)]:function(t){if(F(t)===O)return[];var e=X(t);return[Z(t),e,Z(e)]}(y)),b=[y].concat(g).reduce((function(t,s){return t.concat(F(s)===O?function(t,e){void 0===e&&(e={});var s=e,i=s.placement,o=s.boundary,n=s.rootBoundary,a=s.padding,r=s.flipVariations,c=s.allowedAutoPlacements,d=void 0===c?P:c,l=q(i),h=l?r?$:$.filter((function(t){return q(t)===l})):L,p=h.filter((function(t){return d.indexOf(t)>=0}));0===p.length&&(p=h);var u=p.reduce((function(e,s){return e[s]=at(t,{placement:s,boundary:o,rootBoundary:n,padding:a})[F(s)],e}),{});return Object.keys(u).sort((function(t,e){return u[t]-u[e]}))}(e,{placement:s,boundary:l,rootBoundary:h,padding:d,flipVariations:m,allowedAutoPlacements:f}):s)}),[]),w=e.rects.reference,S=e.rects.popper,D=new Map,k=!0,C=b[0],T=0;T=0,j=N?"width":"height",B=at(e,{placement:H,boundary:l,rootBoundary:h,altBoundary:p,padding:d}),z=N?I?M:x:I?E:_;w[j]>S[j]&&(z=X(z));var W=X(z),Y=[];if(n&&Y.push(B[V]<=0),r&&Y.push(B[z]<=0,B[W]<=0),Y.every((function(t){return t}))){C=H,k=!1;break}D.set(H,Y)}if(k)for(var U=function(t){var e=b.find((function(e){var s=D.get(e);if(s)return s.slice(0,t).every((function(t){return t}))}));if(e)return C=e,"break"},R=m?3:1;R>0;R--){if("break"===U(R))break}e.placement!==C&&(e.modifiersData[i]._skip=!0,e.placement=C,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},ct,dt,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,s=t.name,i=e.rects.reference,o=e.rects.popper,n=e.modifiersData.preventOverflow,a=at(e,{elementContext:"reference"}),r=at(e,{altBoundary:!0}),c=lt(a,i),d=lt(r,o,n),l=ht(c),h=ht(d);e.modifiersData[s]={referenceClippingOffsets:c,popperEscapeOffsets:d,isReferenceHidden:l,hasPopperEscaped:h},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":l,"data-popper-escaped":h})}}]});!function(t){t.seconds="seconds",t.minutes="minutes",t.hours="hours",t.date="date",t.month="month",t.year="year"}(pt||(pt={}));const mt={month:"2-digit",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!0},ft={hour:"2-digit",hour12:!1},yt=t=>{switch(t){case"date":return{dateStyle:"short"};case"month":return{month:"numeric",year:"numeric"};case"year":return{year:"numeric"}}};class vt extends Date{constructor(){super(...arguments),this.locale="default",this.nonLeapLadder=[0,31,59,90,120,151,181,212,243,273,304,334],this.leapLadder=[0,31,60,91,121,152,182,213,244,274,305,335]}setLocale(t){return this.locale=t,this}static convert(t,e="default"){if(!t)throw new Error("A date is required");return new vt(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()).setLocale(e)}get clone(){return new vt(this.year,this.month,this.date,this.hours,this.minutes,this.seconds,this.getMilliseconds()).setLocale(this.locale)}startOf(t,e=0){if(void 0===this[t])throw new Error(`Unit '${t}' is not valid`);switch(t){case"seconds":this.setMilliseconds(0);break;case"minutes":this.setSeconds(0,0);break;case"hours":this.setMinutes(0,0,0);break;case"date":this.setHours(0,0,0,0);break;case"weekDay":if(this.startOf(pt.date),this.weekDay===e)break;let t=this.weekDay;0!==e&&0===this.weekDay&&(t=8-e),this.manipulate(e-t,pt.date);break;case"month":this.startOf(pt.date),this.setDate(1);break;case"year":this.startOf(pt.date),this.setMonth(0,1)}return this}endOf(t,e=0){if(void 0===this[t])throw new Error(`Unit '${t}' is not valid`);switch(t){case"seconds":this.setMilliseconds(999);break;case"minutes":this.setSeconds(59,999);break;case"hours":this.setMinutes(59,59,999);break;case"date":this.setHours(23,59,59,999);break;case"weekDay":this.endOf(pt.date),this.manipulate(6+e-this.weekDay,pt.date);break;case"month":this.endOf(pt.date),this.manipulate(1,pt.month),this.setDate(0);break;case"year":this.endOf(pt.date),this.manipulate(1,pt.year),this.setDate(0)}return this}manipulate(t,e){if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);return this[e]+=t,this}format(t,e=this.locale){return new Intl.DateTimeFormat(e,t).format(this)}isBefore(t,e){if(!e)return this.valueOf()t.valueOf();if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);return this.clone.startOf(e).valueOf()>t.clone.startOf(e).valueOf()}isSame(t,e){if(!e)return this.valueOf()===t.valueOf();if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);return t=vt.convert(t),this.clone.startOf(e).valueOf()===t.startOf(e).valueOf()}isBetween(t,e,s,i="()"){if(s&&void 0===this[s])throw new Error(`Unit '${s}' is not valid`);const o="("===i[0],n=")"===i[1];return(o?this.isAfter(t,s):!this.isBefore(t,s))&&(n?this.isBefore(e,s):!this.isAfter(e,s))||(o?this.isBefore(t,s):!this.isAfter(t,s))&&(n?this.isAfter(e,s):!this.isBefore(e,s))}parts(t=this.locale,e={dateStyle:"full",timeStyle:"long"}){const s={};return new Intl.DateTimeFormat(t,e).formatToParts(this).filter((t=>"literal"!==t.type)).forEach((t=>s[t.type]=t.value)),s}get seconds(){return this.getSeconds()}set seconds(t){this.setSeconds(t)}get secondsFormatted(){return this.parts(void 0,mt).second}get minutes(){return this.getMinutes()}set minutes(t){this.setMinutes(t)}get minutesFormatted(){return this.parts(void 0,mt).minute}get hours(){return this.getHours()}set hours(t){this.setHours(t)}get hoursFormatted(){let t=this.parts(void 0,ft).hour;return"24"===t&&(t="00"),t}get twelveHoursFormatted(){return this.parts(void 0,mt).hour}meridiem(t=this.locale){var e;return null===(e=new Intl.DateTimeFormat(t,{hour:"numeric",hour12:!0}).formatToParts(this).find((t=>"dayPeriod"===t.type)))||void 0===e?void 0:e.value}get date(){return this.getDate()}set date(t){this.setDate(t)}get dateFormatted(){return this.parts(void 0,mt).day}get weekDay(){return this.getDay()}get month(){return this.getMonth()}set month(t){const e=new Date(this.year,t+1);e.setDate(0);const s=e.getDate();this.date>s&&(this.date=s),this.setMonth(t)}get monthFormatted(){return this.parts(void 0,mt).month}get year(){return this.getFullYear()}set year(t){this.setFullYear(t)}get week(){const t=this.computeOrdinal(),e=this.getUTCDay();let s=Math.floor((t-e+10)/7);return s<1?s=this.weeksInWeekYear(this.year-1):s>this.weeksInWeekYear(this.year)&&(s=1),s}weeksInWeekYear(t){const e=(t+Math.floor(t/4)-Math.floor(t/100)+Math.floor(t/400))%7,s=t-1,i=(s+Math.floor(s/4)-Math.floor(s/100)+Math.floor(s/400))%7;return 4===e||3===i?53:52}get isLeapYear(){return this.year%4==0&&(this.year%100!=0||this.year%400==0)}computeOrdinal(){return this.date+(this.isLeapYear?this.leapLadder:this.nonLeapLadder)[this.month]}}class gt extends Error{}const bt="tempus-dominus";class wt{}wt.NAME=bt,wt.version="6.0.0-beta7",wt.dataKey="td",wt.events=new class{constructor(){this.key=".td",this.change=`change${this.key}`,this.update=`update${this.key}`,this.error=`error${this.key}`,this.show=`show${this.key}`,this.hide=`hide${this.key}`,this.blur=`blur${this.key}`,this.focus=`focus${this.key}`,this.keyup=`keyup${this.key}`,this.keydown=`keydown${this.key}`}},wt.css=new class{constructor(){this.widget=`${bt}-widget`,this.calendarHeader="calendar-header",this.switch="picker-switch",this.toolbar="toolbar",this.noHighlight="no-highlight",this.sideBySide="timepicker-sbs",this.previous="previous",this.next="next",this.disabled="disabled",this.old="old",this.new="new",this.active="active",this.dateContainer="date-container",this.decadesContainer=`${this.dateContainer}-decades`,this.decade="decade",this.yearsContainer=`${this.dateContainer}-years`,this.year="year",this.monthsContainer=`${this.dateContainer}-months`,this.month="month",this.daysContainer=`${this.dateContainer}-days`,this.day="day",this.calendarWeeks="cw",this.dayOfTheWeek="dow",this.today="today",this.weekend="weekend",this.timeContainer="time-container",this.separator="separator",this.clockContainer=`${this.timeContainer}-clock`,this.hourContainer=`${this.timeContainer}-hour`,this.minuteContainer=`${this.timeContainer}-minute`,this.secondContainer=`${this.timeContainer}-second`,this.hour="hour",this.minute="minute",this.second="second",this.toggleMeridiem="toggleMeridiem",this.show="show",this.collapsing="td-collapsing",this.collapse="td-collapse",this.inline="inline"}},wt.errorMessages=new class{constructor(){this.base="TD:",this.failedToSetInvalidDate="Failed to set invalid date",this.failedToParseInput="Failed parse input field"}unexpectedOption(t){const e=new gt(`${this.base} Unexpected option: ${t} does not match a known option.`);throw e.code=1,e}unexpectedOptions(t){const e=new gt(`${this.base}: ${t.join(", ")}`);throw e.code=1,e}unexpectedOptionValue(t,e,s){const i=new gt(`${this.base} Unexpected option value: ${t} does not accept a value of "${e}". Valid values are: ${s.join(", ")}`);throw i.code=2,i}typeMismatch(t,e,s){const i=new gt(`${this.base} Mismatch types: ${t} has a type of ${e} instead of the required ${s}`);throw i.code=3,i}numbersOutOfRage(t,e,s){const i=new gt(`${this.base} ${t} expected an array of number between ${e} and ${s}.`);throw i.code=4,i}failedToParseDate(t,e,s=!1){const i=new gt(`${this.base} Could not correctly parse "${e}" to a date for ${t}.`);if(i.code=5,!s)throw i;console.warn(i)}mustProvideElement(){const t=new gt(`${this.base} No element was provided.`);throw t.code=6,t}subscribeMismatch(){const t=new gt(`${this.base} The subscribed events does not match the number of callbacks`);throw t.code=7,t}conflictingConfiguration(t){const e=new gt(`${this.base} A configuration value conflicts with another rule. ${t}`);throw e.code=8,e}dateString(){console.warn(`${this.base} Using a string for date options is not recommended unless you specify an ISO string.`)}throwError(t){const e=new gt(`${this.base} ${t}`);throw e.code=9,e}};class St{constructor(){this.cache=new Map}locate(t){const e=this.cache.get(t);if(e)return e;const s=new t;return this.cache.set(t,s),s}}let Dt;const kt=[{name:"calendar",className:wt.css.daysContainer,unit:pt.month,step:1},{name:"months",className:wt.css.monthsContainer,unit:pt.year,step:1},{name:"years",className:wt.css.yearsContainer,unit:pt.year,step:10},{name:"decades",className:wt.css.decadesContainer,unit:pt.year,step:100}];class Ct{constructor(){this.viewDate=new vt,this._currentCalendarViewMode=0,this.minimumCalendarViewMode=0,this.currentView="calendar"}get currentCalendarViewMode(){return this._currentCalendarViewMode}set currentCalendarViewMode(t){this._currentCalendarViewMode=t,this.currentView=kt[t].name}refreshCurrentView(){this.currentView=kt[this.currentCalendarViewMode].name}}class _t{constructor(){this.optionsStore=Dt.locate(Ct)}isValid(t,e){var s;if(this.optionsStore.options.restrictions.disabledDates.length>0&&this._isInDisabledDates(t))return!1;if(this.optionsStore.options.restrictions.enabledDates.length>0&&!this._isInEnabledDates(t))return!1;if(e!==pt.month&&e!==pt.year&&(null===(s=this.optionsStore.options.restrictions.daysOfWeekDisabled)||void 0===s?void 0:s.length)>0&&-1!==this.optionsStore.options.restrictions.daysOfWeekDisabled.indexOf(t.weekDay))return!1;if(this.optionsStore.options.restrictions.minDate&&t.isBefore(this.optionsStore.options.restrictions.minDate,e))return!1;if(this.optionsStore.options.restrictions.maxDate&&t.isAfter(this.optionsStore.options.restrictions.maxDate,e))return!1;if(e===pt.hours||e===pt.minutes||e===pt.seconds){if(this.optionsStore.options.restrictions.disabledHours.length>0&&this._isInDisabledHours(t))return!1;if(this.optionsStore.options.restrictions.enabledHours.length>0&&!this._isInEnabledHours(t))return!1;if(this.optionsStore.options.restrictions.disabledTimeIntervals.length>0)for(let e of this.optionsStore.options.restrictions.disabledTimeIntervals)if(t.isBetween(e.from,e.to))return!1}return!0}_isInDisabledDates(t){if(!this.optionsStore.options.restrictions.disabledDates||0===this.optionsStore.options.restrictions.disabledDates.length)return!1;const e=t.format(yt(pt.date));return this.optionsStore.options.restrictions.disabledDates.map((t=>t.format(yt(pt.date)))).find((t=>t===e))}_isInEnabledDates(t){if(!this.optionsStore.options.restrictions.enabledDates||0===this.optionsStore.options.restrictions.enabledDates.length)return!0;const e=t.format(yt(pt.date));return this.optionsStore.options.restrictions.enabledDates.map((t=>t.format(yt(pt.date)))).find((t=>t===e))}_isInDisabledHours(t){if(!this.optionsStore.options.restrictions.disabledHours||0===this.optionsStore.options.restrictions.disabledHours.length)return!1;const e=t.hours;return this.optionsStore.options.restrictions.disabledHours.find((t=>t===e))}_isInEnabledHours(t){if(!this.optionsStore.options.restrictions.enabledHours||0===this.optionsStore.options.restrictions.enabledHours.length)return!0;const e=t.hours;return this.optionsStore.options.restrictions.enabledHours.find((t=>t===e))}}class Et{constructor(){this.subscribers=[]}subscribe(t){return this.subscribers.push(t),this.unsubscribe.bind(this,this.subscribers.length-1)}unsubscribe(t){this.subscribers.splice(t,1)}emit(t){this.subscribers.forEach((e=>{e(t)}))}destory(){this.subscribers=null,this.subscribers=[]}}class Mt{constructor(){this.triggerEvent=new Et,this.viewUpdate=new Et,this.updateDisplay=new Et,this.action=new Et}destory(){this.triggerEvent.destory(),this.viewUpdate.destory(),this.updateDisplay.destory(),this.action.destory()}}const xt={restrictions:{minDate:void 0,maxDate:void 0,disabledDates:[],enabledDates:[],daysOfWeekDisabled:[],disabledTimeIntervals:[],disabledHours:[],enabledHours:[]},display:{icons:{type:"icons",time:"fa-solid fa-clock",date:"fa-solid fa-calendar",up:"fa-solid fa-arrow-up",down:"fa-solid fa-arrow-down",previous:"fa-solid fa-chevron-left",next:"fa-solid fa-chevron-right",today:"fa-solid fa-calendar-check",clear:"fa-solid fa-trash",close:"fa-solid fa-xmark"},sideBySide:!1,calendarWeeks:!1,viewMode:"calendar",toolbarPlacement:"bottom",keepOpen:!1,buttons:{today:!1,clear:!1,close:!1},components:{calendar:!0,date:!0,month:!0,year:!0,decades:!0,clock:!0,hours:!0,minutes:!0,seconds:!1,useTwentyfourHour:!1},inline:!1},stepping:1,useCurrent:!0,defaultDate:void 0,localization:{today:"Go to today",clear:"Clear selection",close:"Close the picker",selectMonth:"Select Month",previousMonth:"Previous Month",nextMonth:"Next Month",selectYear:"Select Year",previousYear:"Previous Year",nextYear:"Next Year",selectDecade:"Select Decade",previousDecade:"Previous Decade",nextDecade:"Next Decade",previousCentury:"Previous Century",nextCentury:"Next Century",pickHour:"Pick Hour",incrementHour:"Increment Hour",decrementHour:"Decrement Hour",pickMinute:"Pick Minute",incrementMinute:"Increment Minute",decrementMinute:"Decrement Minute",pickSecond:"Pick Second",incrementSecond:"Increment Second",decrementSecond:"Decrement Second",toggleMeridiem:"Toggle Meridiem",selectTime:"Select Time",selectDate:"Select Date",dayViewHeaderFormat:{month:"long",year:"2-digit"},locale:"default",startOfTheWeek:0},keepInvalid:!1,debug:!1,allowInputToggle:!1,viewDate:new vt,multipleDates:!1,multipleDatesSeparator:"; ",promptTimeOnDateChange:!1,promptTimeOnDateChangeTransitionDelay:200,meta:{},container:void 0};class Ot{static deepCopy(t){const e={};return Object.keys(t).forEach((s=>{const i=t[s];e[s]=i,"object"!=typeof i||i instanceof HTMLElement||i instanceof Element||i instanceof Date||Array.isArray(i)||(e[s]=Ot.deepCopy(i))})),e}static objectPath(t,e){return"."===t.charAt(0)&&(t=t.slice(1)),t.split(".").reduce(((t,e)=>Ot.isValue(t)||Ot.isValue(t[e])?t[e]:void 0),e)}static spread(t,e,s,i="",o=""){const n=Object.keys(t).filter((t=>!Object.keys(e).includes(t)));if(n.length>0){const t=Ot.getFlattenDefaultOptions(),e=n.map((e=>{let s=`"${i}.${e}" in not a known option.`,o=t.find((t=>t.includes(e)));return o&&(s+=`Did you mean "${o}"?`),s}));wt.errorMessages.unexpectedOptions(e)}Object.keys(e).forEach((e=>{"."===(i+=`.${e}`).charAt(0)&&(i=i.slice(1));const n=Ot.objectPath(i,xt);let a=typeof t[e],r=typeof n,c=t[e];if(!t.hasOwnProperty(e)){if("undefined"===r||0===(null==c?void 0:c.length)&&Array.isArray(n))return s[e]=n,void(i=i.substring(0,i.lastIndexOf(`.${e}`)));t[e]=n,c=t[e]}s[e]=Ot.processKey(e,c,a,r,i,o),"object"!=typeof n||n instanceof Date||Ot.ignoreProperties.includes(e)||Array.isArray(t[e])||Ot.spread(t[e],n,s[e],i,o),i=i.substring(0,i.lastIndexOf(`.${e}`))}))}static processKey(t,e,s,i,o,n){switch(t){case"defaultDate":{const t=this.dateConversion(e,"defaultDate");if(void 0!==t)return t.setLocale(n),t;wt.errorMessages.typeMismatch("defaultDate",s,"DateTime or Date");break}case"viewDate":{const t=this.dateConversion(e,"viewDate");if(void 0!==t)return t.setLocale(n),t;wt.errorMessages.typeMismatch("viewDate",s,"DateTime or Date");break}case"minDate":{if(void 0===e)return e;const t=this.dateConversion(e,"restrictions.minDate");if(void 0!==t)return t.setLocale(n),t;wt.errorMessages.typeMismatch("restrictions.minDate",s,"DateTime or Date");break}case"maxDate":{if(void 0===e)return e;const t=this.dateConversion(e,"restrictions.maxDate");if(void 0!==t)return t.setLocale(n),t;wt.errorMessages.typeMismatch("restrictions.maxDate",s,"DateTime or Date");break}case"disabledHours":return void 0===e?[]:(this._typeCheckNumberArray("restrictions.disabledHours",e,s),e.filter((t=>t<0||t>24)).length>0&&wt.errorMessages.numbersOutOfRage("restrictions.disabledHours",0,23),e);case"enabledHours":return void 0===e?[]:(this._typeCheckNumberArray("restrictions.enabledHours",e,s),e.filter((t=>t<0||t>24)).length>0&&wt.errorMessages.numbersOutOfRage("restrictions.enabledHours",0,23),e);case"daysOfWeekDisabled":return void 0===e?[]:(this._typeCheckNumberArray("restrictions.daysOfWeekDisabled",e,s),e.filter((t=>t<0||t>6)).length>0&&wt.errorMessages.numbersOutOfRage("restrictions.daysOfWeekDisabled",0,6),e);case"enabledDates":return void 0===e?[]:(this._typeCheckDateArray("restrictions.enabledDates",e,s,n),e);case"disabledDates":return void 0===e?[]:(this._typeCheckDateArray("restrictions.disabledDates",e,s,n),e);case"disabledTimeIntervals":if(void 0===e)return[];Array.isArray(e)||wt.errorMessages.typeMismatch(t,s,"array of { from: DateTime|Date, to: DateTime|Date }");const a=e;for(let e=0;e{const i=`${t}[${e}].${s}`;let o=a[e][s];const r=this.dateConversion(o,i);r||wt.errorMessages.typeMismatch(i,typeof o,"DateTime or Date"),r.setLocale(n),a[e][s]=r}));return a;case"toolbarPlacement":case"type":case"viewMode":const r={toolbarPlacement:["top","bottom","default"],type:["icons","sprites"],viewMode:["clock","calendar","months","years","decades"]}[t];return r.includes(e)||wt.errorMessages.unexpectedOptionValue(o.substring(1),e,r),e;case"meta":case"dayViewHeaderFormat":return e;case"container":return e&&!(e instanceof HTMLElement||e instanceof Element||(null==e?void 0:e.appendChild))&&wt.errorMessages.typeMismatch(o.substring(1),typeof e,"HTMLElement"),e;default:switch(i){case"boolean":return"true"===e||!0===e;case"number":return+e;case"string":return e.toString();case"object":return{};case"function":return e;default:wt.errorMessages.typeMismatch(o,s,i)}}}static _mergeOptions(t,e){var s;const i={},o="default"!==e.localization.locale?e.localization.locale:(null===(s=null==t?void 0:t.localization)||void 0===s?void 0:s.locale)||"default";return Ot.spread(t,e,i,"",o),i}static _dataToOptions(t,e){const s=JSON.parse(JSON.stringify(t.dataset));if((null==s?void 0:s.tdTargetInput)&&delete s.tdTargetInput,(null==s?void 0:s.tdTargetToggle)&&delete s.tdTargetToggle,!s||0===Object.keys(s).length||s.constructor!==DOMStringMap)return e;let i={};const o=t=>{const e={};return Object.keys(t).forEach((t=>{e[t.toLowerCase()]=t})),e},n=(t,e,s,i)=>{const a=o(s)[t[e].toLowerCase()],r={};return void 0===a||(s[a].constructor===Object?(e++,r[a]=n(t,e,s[a],i)):r[a]=i),r},a=o(e);return Object.keys(s).filter((t=>t.startsWith(wt.dataKey))).map((t=>t.substring(2))).forEach((t=>{let o=a[t.toLowerCase()];if(t.includes("_")){const r=t.split("_");o=a[r[0].toLowerCase()],void 0!==o&&e[o].constructor===Object&&(i[o]=n(r,1,e[o],s[`td${t}`]))}else void 0!==o&&(i[o]=s[`td${t}`])})),this._mergeOptions(i,e)}static _dateTypeCheck(t){if(t.constructor.name===vt.name)return t;if(t.constructor.name===Date.name)return vt.convert(t);if("string"==typeof t){const e=new vt(t);return"null"===JSON.stringify(e)?null:e}return null}static _typeCheckDateArray(t,e,s,i="default"){Array.isArray(e)||wt.errorMessages.typeMismatch(t,s,"array of DateTime or Date");for(let s=0;s"number"!=typeof t))||wt.errorMessages.typeMismatch(t,s,"array of numbers")}static dateConversion(t,e){"string"==typeof t&&"input"!==e&&wt.errorMessages.dateString();const s=this._dateTypeCheck(t);return s||wt.errorMessages.failedToParseDate(e,t,"input"===e),s}static getFlattenDefaultOptions(){if(this._flattenDefaults)return this._flattenDefaults;const t=(e,s=[])=>Array.isArray(e)?[]:Object(e)===e?Object.entries(e).flatMap((([e,i])=>t(i,[...s,e]))):s.join(".");return this._flattenDefaults=t(xt),this._flattenDefaults}static _validateConflicts(t){!t.display.sideBySide||t.display.components.clock&&(t.display.components.hours||t.display.components.minutes||t.display.components.seconds)||wt.errorMessages.conflictingConfiguration("Cannot use side by side mode without the clock components"),t.restrictions.minDate&&t.restrictions.maxDate&&(t.restrictions.minDate.isAfter(t.restrictions.maxDate)&&wt.errorMessages.conflictingConfiguration("minDate is after maxDate"),t.restrictions.maxDate.isBefore(t.restrictions.minDate)&&wt.errorMessages.conflictingConfiguration("maxDate is before minDate"))}}Ot.ignoreProperties=["meta","dayViewHeaderFormat","container"],Ot.isValue=t=>null!=t;class Lt{constructor(){this._dates=[],this.optionsStore=Dt.locate(Ct),this.validation=Dt.locate(_t),this._eventEmitters=Dt.locate(Mt)}get picked(){return this._dates}get lastPicked(){return this._dates[this.lastPickedIndex]}get lastPickedIndex(){return 0===this._dates.length?0:this._dates.length-1}formatInput(t){const e=this.optionsStore.options.display.components;return t?t.format({year:e.calendar&&e.year?"numeric":void 0,month:e.calendar&&e.month?"2-digit":void 0,day:e.calendar&&e.date?"2-digit":void 0,hour:e.clock&&e.hours?e.useTwentyfourHour?"2-digit":"numeric":void 0,minute:e.clock&&e.minutes?"2-digit":void 0,second:e.clock&&e.seconds?"2-digit":void 0,hour12:!e.useTwentyfourHour}):""}parseInput(t){return Ot.dateConversion(t,"input")}setFromInput(t,e){if(!t)return void this.setValue(void 0,e);const s=this.parseInput(t);s&&(s.setLocale(this.optionsStore.options.localization.locale),this.setValue(s,e))}add(t){this._dates.push(t)}isPicked(t,e){if(!e)return void 0!==this._dates.find((e=>e===t));const s=yt(e);let i=t.format(s);return void 0!==this._dates.map((t=>t.format(s))).find((t=>t===i))}pickedIndex(t,e){if(!e)return this._dates.indexOf(t);const s=yt(e);let i=t.format(s);return this._dates.map((t=>t.format(s))).indexOf(i)}clear(){this.optionsStore.unset=!0,this._eventEmitters.triggerEvent.emit({type:wt.events.change,date:void 0,oldDate:this.lastPicked,isClear:!0,isValid:!0}),this._dates=[]}static getStartEndYear(t,e){const s=t/10,i=Math.floor(e/t)*t;return[i,i+9*s,Math.floor(e/s)*s]}setValue(t,e){const s=void 0===e,i=!t&&s;let o=this.optionsStore.unset?null:this._dates[e];!o&&!this.optionsStore.unset&&s&&i&&(o=this.lastPicked);const n=()=>{if(!this.optionsStore.input)return;let e=this.formatInput(t);this.optionsStore.options.multipleDates&&(e=this._dates.map((t=>this.formatInput(t))).join(this.optionsStore.options.multipleDatesSeparator)),this.optionsStore.input.value!=e&&(this.optionsStore.input.value=e)};if(t&&(null==o?void 0:o.isSame(t)))n();else{if(!t)return!this.optionsStore.options.multipleDates||1===this._dates.length||i?(this.optionsStore.unset=!0,this._dates=[]):this._dates.splice(e,1),n(),this._eventEmitters.triggerEvent.emit({type:wt.events.change,date:void 0,oldDate:o,isClear:i,isValid:!0}),void this._eventEmitters.updateDisplay.emit("all");if(e=e||0,t=t.clone,1!==this.optionsStore.options.stepping&&(t.minutes=Math.round(t.minutes/this.optionsStore.options.stepping)*this.optionsStore.options.stepping,t.seconds=0),this.validation.isValid(t))return this._dates[e]=t,this.optionsStore.viewDate=t.clone,n(),this.optionsStore.unset=!1,this._eventEmitters.updateDisplay.emit("all"),void this._eventEmitters.triggerEvent.emit({type:wt.events.change,date:t,oldDate:o,isClear:i,isValid:!0});this.optionsStore.options.keepInvalid&&(this._dates[e]=t,this.optionsStore.viewDate=t.clone,n(),this._eventEmitters.triggerEvent.emit({type:wt.events.change,date:t,oldDate:o,isClear:i,isValid:!1})),this._eventEmitters.triggerEvent.emit({type:wt.events.error,reason:wt.errorMessages.failedToSetInvalidDate,date:t,oldDate:o})}}}var At;!function(t){t.next="next",t.previous="previous",t.changeCalendarView="changeCalendarView",t.selectMonth="selectMonth",t.selectYear="selectYear",t.selectDecade="selectDecade",t.selectDay="selectDay",t.selectHour="selectHour",t.selectMinute="selectMinute",t.selectSecond="selectSecond",t.incrementHours="incrementHours",t.incrementMinutes="incrementMinutes",t.incrementSeconds="incrementSeconds",t.decrementHours="decrementHours",t.decrementMinutes="decrementMinutes",t.decrementSeconds="decrementSeconds",t.toggleMeridiem="toggleMeridiem",t.togglePicker="togglePicker",t.showClock="showClock",t.showHours="showHours",t.showMinutes="showMinutes",t.showSeconds="showSeconds",t.clear="clear",t.close="close",t.today="today"}(At||(At={}));var Tt=At;class Ht{constructor(){this.optionsStore=Dt.locate(Ct),this.dates=Dt.locate(Lt),this.validation=Dt.locate(_t)}getPicker(){const t=document.createElement("div");if(t.classList.add(wt.css.daysContainer),t.append(...this._daysOfTheWeek()),this.optionsStore.options.display.calendarWeeks){const e=document.createElement("div");e.classList.add(wt.css.calendarWeeks,wt.css.noHighlight),t.appendChild(e)}for(let e=0;e<42;e++){if(0!==e&&e%7==0&&this.optionsStore.options.display.calendarWeeks){const e=document.createElement("div");e.classList.add(wt.css.calendarWeeks,wt.css.noHighlight),t.appendChild(e)}const s=document.createElement("div");s.setAttribute("data-action",Tt.selectDay),t.appendChild(s)}return t}_update(t,e){const s=t.getElementsByClassName(wt.css.daysContainer)[0],[i,o,n]=s.parentElement.getElementsByClassName(wt.css.calendarHeader)[0].getElementsByTagName("div");o.setAttribute(wt.css.daysContainer,this.optionsStore.viewDate.format(this.optionsStore.options.localization.dayViewHeaderFormat)),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,pt.month),pt.month)?i.classList.remove(wt.css.disabled):i.classList.add(wt.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,pt.month),pt.month)?n.classList.remove(wt.css.disabled):n.classList.add(wt.css.disabled);let a=this.optionsStore.viewDate.clone.startOf(pt.month).startOf("weekDay",this.optionsStore.options.localization.startOfTheWeek).manipulate(12,pt.hours);s.querySelectorAll(`[data-action="${Tt.selectDay}"], .${wt.css.calendarWeeks}`).forEach((t=>{if(this.optionsStore.options.display.calendarWeeks&&t.classList.contains(wt.css.calendarWeeks)){if("#"===t.innerText)return;return void(t.innerText=`${a.week}`)}let s=[];s.push(wt.css.day),a.isBefore(this.optionsStore.viewDate,pt.month)&&s.push(wt.css.old),a.isAfter(this.optionsStore.viewDate,pt.month)&&s.push(wt.css.new),!this.optionsStore.unset&&this.dates.isPicked(a,pt.date)&&s.push(wt.css.active),this.validation.isValid(a,pt.date)||s.push(wt.css.disabled),a.isSame(new vt,pt.date)&&s.push(wt.css.today),0!==a.weekDay&&6!==a.weekDay||s.push(wt.css.weekend),e(pt.date,a,s,t),t.classList.remove(...t.classList),t.classList.add(...s),t.setAttribute("data-value",`${a.year}-${a.monthFormatted}-${a.dateFormatted}`),t.setAttribute("data-day",`${a.date}`),t.innerText=a.format({day:"numeric"}),a.manipulate(1,pt.date)}))}_daysOfTheWeek(){let t=this.optionsStore.viewDate.clone.startOf("weekDay",this.optionsStore.options.localization.startOfTheWeek).startOf(pt.date);const e=[];if(document.createElement("div"),this.optionsStore.options.display.calendarWeeks){const t=document.createElement("div");t.classList.add(wt.css.calendarWeeks,wt.css.noHighlight),t.innerText="#",e.push(t)}for(let s=0;s<7;s++){const s=document.createElement("div");s.classList.add(wt.css.dayOfTheWeek,wt.css.noHighlight),s.innerText=t.format({weekday:"short"}),t.manipulate(1,pt.date),e.push(s)}return e}}class Vt{constructor(){this.optionsStore=Dt.locate(Ct),this.dates=Dt.locate(Lt),this.validation=Dt.locate(_t)}getPicker(){const t=document.createElement("div");t.classList.add(wt.css.monthsContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",Tt.selectMonth),t.appendChild(e)}return t}_update(t,e){const s=t.getElementsByClassName(wt.css.monthsContainer)[0],[i,o,n]=s.parentElement.getElementsByClassName(wt.css.calendarHeader)[0].getElementsByTagName("div");o.setAttribute(wt.css.monthsContainer,this.optionsStore.viewDate.format({year:"numeric"})),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,pt.year),pt.year)?i.classList.remove(wt.css.disabled):i.classList.add(wt.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,pt.year),pt.year)?n.classList.remove(wt.css.disabled):n.classList.add(wt.css.disabled);let a=this.optionsStore.viewDate.clone.startOf(pt.year);s.querySelectorAll(`[data-action="${Tt.selectMonth}"]`).forEach(((t,s)=>{let i=[];i.push(wt.css.month),!this.optionsStore.unset&&this.dates.isPicked(a,pt.month)&&i.push(wt.css.active),this.validation.isValid(a,pt.month)||i.push(wt.css.disabled),e(pt.month,a,i,t),t.classList.remove(...t.classList),t.classList.add(...i),t.setAttribute("data-value",`${s}`),t.innerText=`${a.format({month:"short"})}`,a.manipulate(1,pt.month)}))}}class $t{constructor(){this.optionsStore=Dt.locate(Ct),this.dates=Dt.locate(Lt),this.validation=Dt.locate(_t)}getPicker(){const t=document.createElement("div");t.classList.add(wt.css.yearsContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",Tt.selectYear),t.appendChild(e)}return t}_update(t,e){this._startYear=this.optionsStore.viewDate.clone.manipulate(-1,pt.year),this._endYear=this.optionsStore.viewDate.clone.manipulate(10,pt.year);const s=t.getElementsByClassName(wt.css.yearsContainer)[0],[i,o,n]=s.parentElement.getElementsByClassName(wt.css.calendarHeader)[0].getElementsByTagName("div");o.setAttribute(wt.css.yearsContainer,`${this._startYear.format({year:"numeric"})}-${this._endYear.format({year:"numeric"})}`),this.validation.isValid(this._startYear,pt.year)?i.classList.remove(wt.css.disabled):i.classList.add(wt.css.disabled),this.validation.isValid(this._endYear,pt.year)?n.classList.remove(wt.css.disabled):n.classList.add(wt.css.disabled);let a=this.optionsStore.viewDate.clone.startOf(pt.year).manipulate(-1,pt.year);s.querySelectorAll(`[data-action="${Tt.selectYear}"]`).forEach((t=>{let s=[];s.push(wt.css.year),!this.optionsStore.unset&&this.dates.isPicked(a,pt.year)&&s.push(wt.css.active),this.validation.isValid(a,pt.year)||s.push(wt.css.disabled),e(pt.year,a,s,t),t.classList.remove(...t.classList),t.classList.add(...s),t.setAttribute("data-value",`${a.year}`),t.innerText=a.format({year:"numeric"}),a.manipulate(1,pt.year)}))}}class Pt{constructor(){this.optionsStore=Dt.locate(Ct),this.dates=Dt.locate(Lt),this.validation=Dt.locate(_t)}getPicker(){const t=document.createElement("div");t.classList.add(wt.css.decadesContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",Tt.selectDecade),t.appendChild(e)}return t}_update(t,e){const[s,i]=Lt.getStartEndYear(100,this.optionsStore.viewDate.year);this._startDecade=this.optionsStore.viewDate.clone.startOf(pt.year),this._startDecade.year=s,this._endDecade=this.optionsStore.viewDate.clone.startOf(pt.year),this._endDecade.year=i;const o=t.getElementsByClassName(wt.css.decadesContainer)[0],[n,a,r]=o.parentElement.getElementsByClassName(wt.css.calendarHeader)[0].getElementsByTagName("div");a.setAttribute(wt.css.decadesContainer,`${this._startDecade.format({year:"numeric"})}-${this._endDecade.format({year:"numeric"})}`),this.validation.isValid(this._startDecade,pt.year)?n.classList.remove(wt.css.disabled):n.classList.add(wt.css.disabled),this.validation.isValid(this._endDecade,pt.year)?r.classList.remove(wt.css.disabled):r.classList.add(wt.css.disabled);const c=this.dates.picked.map((t=>t.year));o.querySelectorAll(`[data-action="${Tt.selectDecade}"]`).forEach(((t,s)=>{if(0===s)return t.classList.add(wt.css.old),this._startDecade.year-10<0?(t.textContent=" ",n.classList.add(wt.css.disabled),t.classList.add(wt.css.disabled),void t.setAttribute("data-value","")):(t.innerText=this._startDecade.clone.manipulate(-10,pt.year).format({year:"numeric"}),void t.setAttribute("data-value",`${this._startDecade.year}`));let i=[];i.push(wt.css.decade);const o=this._startDecade.year,a=this._startDecade.year+9;!this.optionsStore.unset&&c.filter((t=>t>=o&&t<=a)).length>0&&i.push(wt.css.active),e("decade",this._startDecade,i,t),t.classList.remove(...t.classList),t.classList.add(...i),t.setAttribute("data-value",`${this._startDecade.year}`),t.innerText=`${this._startDecade.format({year:"numeric"})}`,this._startDecade.manipulate(10,pt.year)}))}}class It{constructor(){this._gridColumns="",this.optionsStore=Dt.locate(Ct),this.dates=Dt.locate(Lt),this.validation=Dt.locate(_t)}getPicker(t){const e=document.createElement("div");return e.classList.add(wt.css.clockContainer),e.append(...this._grid(t)),e}_update(t){const e=t.getElementsByClassName(wt.css.clockContainer)[0],s=(this.dates.lastPicked||this.optionsStore.viewDate).clone;if(e.querySelectorAll(".disabled").forEach((t=>t.classList.remove(wt.css.disabled))),this.optionsStore.options.display.components.hours&&(this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,pt.hours),pt.hours)||e.querySelector(`[data-action=${Tt.incrementHours}]`).classList.add(wt.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,pt.hours),pt.hours)||e.querySelector(`[data-action=${Tt.decrementHours}]`).classList.add(wt.css.disabled),e.querySelector(`[data-time-component=${pt.hours}]`).innerText=this.optionsStore.options.display.components.useTwentyfourHour?s.hoursFormatted:s.twelveHoursFormatted),this.optionsStore.options.display.components.minutes&&(this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,pt.minutes),pt.minutes)||e.querySelector(`[data-action=${Tt.incrementMinutes}]`).classList.add(wt.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,pt.minutes),pt.minutes)||e.querySelector(`[data-action=${Tt.decrementMinutes}]`).classList.add(wt.css.disabled),e.querySelector(`[data-time-component=${pt.minutes}]`).innerText=s.minutesFormatted),this.optionsStore.options.display.components.seconds&&(this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,pt.seconds),pt.seconds)||e.querySelector(`[data-action=${Tt.incrementSeconds}]`).classList.add(wt.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,pt.seconds),pt.seconds)||e.querySelector(`[data-action=${Tt.decrementSeconds}]`).classList.add(wt.css.disabled),e.querySelector(`[data-time-component=${pt.seconds}]`).innerText=s.secondsFormatted),!this.optionsStore.options.display.components.useTwentyfourHour){const t=e.querySelector(`[data-action=${Tt.toggleMeridiem}]`);t.innerText=s.meridiem(),this.validation.isValid(s.clone.manipulate(s.hours>=12?-12:12,pt.hours))?t.classList.remove(wt.css.disabled):t.classList.add(wt.css.disabled)}e.style.gridTemplateAreas=`"${this._gridColumns}"`}_grid(t){this._gridColumns="";const e=[],s=[],i=[],o=document.createElement("div"),n=t(this.optionsStore.options.display.icons.up),a=t(this.optionsStore.options.display.icons.down);o.classList.add(wt.css.separator,wt.css.noHighlight);const r=o.cloneNode(!0);r.innerHTML=":";const c=(t=!1)=>t?r.cloneNode(!0):o.cloneNode(!0);if(this.optionsStore.options.display.components.hours){let t=document.createElement("div");t.setAttribute("title",this.optionsStore.options.localization.incrementHour),t.setAttribute("data-action",Tt.incrementHours),t.appendChild(n.cloneNode(!0)),e.push(t),t=document.createElement("div"),t.setAttribute("title",this.optionsStore.options.localization.pickHour),t.setAttribute("data-action",Tt.showHours),t.setAttribute("data-time-component",pt.hours),s.push(t),t=document.createElement("div"),t.setAttribute("title",this.optionsStore.options.localization.decrementHour),t.setAttribute("data-action",Tt.decrementHours),t.appendChild(a.cloneNode(!0)),i.push(t),this._gridColumns+="a"}if(this.optionsStore.options.display.components.minutes){this._gridColumns+=" a",this.optionsStore.options.display.components.hours&&(e.push(c()),s.push(c(!0)),i.push(c()),this._gridColumns+=" a");let t=document.createElement("div");t.setAttribute("title",this.optionsStore.options.localization.incrementMinute),t.setAttribute("data-action",Tt.incrementMinutes),t.appendChild(n.cloneNode(!0)),e.push(t),t=document.createElement("div"),t.setAttribute("title",this.optionsStore.options.localization.pickMinute),t.setAttribute("data-action",Tt.showMinutes),t.setAttribute("data-time-component",pt.minutes),s.push(t),t=document.createElement("div"),t.setAttribute("title",this.optionsStore.options.localization.decrementMinute),t.setAttribute("data-action",Tt.decrementMinutes),t.appendChild(a.cloneNode(!0)),i.push(t)}if(this.optionsStore.options.display.components.seconds){this._gridColumns+=" a",this.optionsStore.options.display.components.minutes&&(e.push(c()),s.push(c(!0)),i.push(c()),this._gridColumns+=" a");let t=document.createElement("div");t.setAttribute("title",this.optionsStore.options.localization.incrementSecond),t.setAttribute("data-action",Tt.incrementSeconds),t.appendChild(n.cloneNode(!0)),e.push(t),t=document.createElement("div"),t.setAttribute("title",this.optionsStore.options.localization.pickSecond),t.setAttribute("data-action",Tt.showSeconds),t.setAttribute("data-time-component",pt.seconds),s.push(t),t=document.createElement("div"),t.setAttribute("title",this.optionsStore.options.localization.decrementSecond),t.setAttribute("data-action",Tt.decrementSeconds),t.appendChild(a.cloneNode(!0)),i.push(t)}if(!this.optionsStore.options.display.components.useTwentyfourHour){this._gridColumns+=" a";let t=c();e.push(t);let o=document.createElement("button");o.setAttribute("title",this.optionsStore.options.localization.toggleMeridiem),o.setAttribute("data-action",Tt.toggleMeridiem),o.setAttribute("tabindex","-1"),wt.css.toggleMeridiem.includes(",")?o.classList.add(...wt.css.toggleMeridiem.split(",")):o.classList.add(wt.css.toggleMeridiem),t=document.createElement("div"),t.classList.add(wt.css.noHighlight),t.appendChild(o),s.push(t),t=c(),i.push(t)}return this._gridColumns=this._gridColumns.trim(),[...e,...s,...i]}}class Nt{constructor(){this.optionsStore=Dt.locate(Ct),this.validation=Dt.locate(_t)}getPicker(){const t=document.createElement("div");t.classList.add(wt.css.hourContainer);for(let e=0;e<(this.optionsStore.options.display.components.useTwentyfourHour?24:12);e++){const e=document.createElement("div");e.setAttribute("data-action",Tt.selectHour),t.appendChild(e)}return t}_update(t,e){const s=t.getElementsByClassName(wt.css.hourContainer)[0];let i=this.optionsStore.viewDate.clone.startOf(pt.date);s.querySelectorAll(`[data-action="${Tt.selectHour}"]`).forEach((t=>{let s=[];s.push(wt.css.hour),this.validation.isValid(i,pt.hours)||s.push(wt.css.disabled),e(pt.hours,i,s,t),t.classList.remove(...t.classList),t.classList.add(...s),t.setAttribute("data-value",`${i.hours}`),t.innerText=this.optionsStore.options.display.components.useTwentyfourHour?i.hoursFormatted:i.twelveHoursFormatted,i.manipulate(1,pt.hours)}))}}class jt{constructor(){this.optionsStore=Dt.locate(Ct),this.validation=Dt.locate(_t)}getPicker(){const t=document.createElement("div");t.classList.add(wt.css.minuteContainer);let e=1===this.optionsStore.options.stepping?5:this.optionsStore.options.stepping;for(let s=0;s<60/e;s++){const e=document.createElement("div");e.setAttribute("data-action",Tt.selectMinute),t.appendChild(e)}return t}_update(t,e){const s=t.getElementsByClassName(wt.css.minuteContainer)[0];let i=this.optionsStore.viewDate.clone.startOf(pt.hours),o=1===this.optionsStore.options.stepping?5:this.optionsStore.options.stepping;s.querySelectorAll(`[data-action="${Tt.selectMinute}"]`).forEach((t=>{let s=[];s.push(wt.css.minute),this.validation.isValid(i,pt.minutes)||s.push(wt.css.disabled),e(pt.minutes,i,s,t),t.classList.remove(...t.classList),t.classList.add(...s),t.setAttribute("data-value",`${i.minutesFormatted}`),t.innerText=i.minutesFormatted,i.manipulate(o,pt.minutes)}))}}class Bt{constructor(){this.optionsStore=Dt.locate(Ct),this.validation=Dt.locate(_t)}getPicker(){const t=document.createElement("div");t.classList.add(wt.css.secondContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",Tt.selectSecond),t.appendChild(e)}return t}_update(t,e){const s=t.getElementsByClassName(wt.css.secondContainer)[0];let i=this.optionsStore.viewDate.clone.startOf(pt.minutes);s.querySelectorAll(`[data-action="${Tt.selectSecond}"]`).forEach((t=>{let s=[];s.push(wt.css.second),this.validation.isValid(i,pt.seconds)||s.push(wt.css.disabled),e(pt.seconds,i,s,t),t.classList.remove(...t.classList),t.classList.add(...s),t.setAttribute("data-value",`${i.seconds}`),t.innerText=i.secondsFormatted,i.manipulate(5,pt.seconds)}))}}class zt{static toggle(t){t.classList.contains(wt.css.show)?this.hide(t):this.show(t)}static show(t){if(t.classList.contains(wt.css.collapsing)||t.classList.contains(wt.css.show))return;t.style.height="0",t.classList.remove(wt.css.collapse),t.classList.add(wt.css.collapsing),setTimeout((()=>{t.classList.remove(wt.css.collapsing),t.classList.add(wt.css.collapse,wt.css.show),t.style.height=""}),this.getTransitionDurationFromElement(t)),t.style.height=`${t.scrollHeight}px`}static hide(t){if(t.classList.contains(wt.css.collapsing)||!t.classList.contains(wt.css.show))return;t.style.height=`${t.getBoundingClientRect().height}px`;t.offsetHeight,t.classList.remove(wt.css.collapse,wt.css.show),t.classList.add(wt.css.collapsing),t.style.height="",setTimeout((()=>{t.classList.remove(wt.css.collapsing),t.classList.add(wt.css.collapse)}),this.getTransitionDurationFromElement(t))}}zt.getTransitionDurationFromElement=t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:s}=window.getComputedStyle(t);const i=Number.parseFloat(e),o=Number.parseFloat(s);return i||o?(e=e.split(",")[0],s=s.split(",")[0],1e3*(Number.parseFloat(e)+Number.parseFloat(s))):0};class Wt{constructor(){this._isVisible=!1,this._documentClickEvent=t=>{var e;this.optionsStore.options.debug||window.debug||!this._isVisible||t.composedPath().includes(this.widget)||(null===(e=t.composedPath())||void 0===e?void 0:e.includes(this.optionsStore.element))||this.hide()},this._actionsClickEvent=t=>{this._eventEmitters.action.emit({e:t})},this.optionsStore=Dt.locate(Ct),this.validation=Dt.locate(_t),this.dates=Dt.locate(Lt),this.dateDisplay=Dt.locate(Ht),this.monthDisplay=Dt.locate(Vt),this.yearDisplay=Dt.locate($t),this.decadeDisplay=Dt.locate(Pt),this.timeDisplay=Dt.locate(It),this.hourDisplay=Dt.locate(Nt),this.minuteDisplay=Dt.locate(jt),this.secondDisplay=Dt.locate(Bt),this._eventEmitters=Dt.locate(Mt),this._widget=void 0,this._eventEmitters.updateDisplay.subscribe((t=>{this._update(t)}))}get widget(){return this._widget}get isVisible(){return this._isVisible}_update(t){if(this.widget)switch(t){case pt.seconds:this.secondDisplay._update(this.widget,this.paint);break;case pt.minutes:this.minuteDisplay._update(this.widget,this.paint);break;case pt.hours:this.hourDisplay._update(this.widget,this.paint);break;case pt.date:this.dateDisplay._update(this.widget,this.paint);break;case pt.month:this.monthDisplay._update(this.widget,this.paint);break;case pt.year:this.yearDisplay._update(this.widget,this.paint);break;case"clock":if(!this._hasTime)break;this.timeDisplay._update(this.widget),this._update(pt.hours),this._update(pt.minutes),this._update(pt.seconds);break;case"calendar":this._update(pt.date),this._update(pt.year),this._update(pt.month),this.decadeDisplay._update(this.widget,this.paint),this._updateCalendarHeader();break;case"all":this._hasTime&&this._update("clock"),this._hasDate&&this._update("calendar")}}paint(t,e,s,i){}show(){var t,e;if(null==this.widget){if(0==this.dates.picked.length){if(this.optionsStore.options.useCurrent&&!this.optionsStore.options.defaultDate){const e=(new vt).setLocale(this.optionsStore.options.localization.locale);if(!this.optionsStore.options.keepInvalid){let s=0,i=1;for((null===(t=this.optionsStore.options.restrictions.maxDate)||void 0===t?void 0:t.isBefore(e))&&(i=-1);!(this.validation.isValid(e)||(e.manipulate(i,pt.date),s>31));)s++}this.dates.setValue(e)}this.optionsStore.options.defaultDate&&this.dates.setValue(this.optionsStore.options.defaultDate)}this._buildWidget();const s=this._hasTime&&!this._hasDate;if(s&&(this.optionsStore.currentView="clock",this._eventEmitters.action.emit({e:null,action:Tt.showClock})),this.optionsStore.currentCalendarViewMode||(this.optionsStore.currentCalendarViewMode=this.optionsStore.minimumCalendarViewMode),s||(this._hasTime&&zt.hide(this.widget.querySelector(`div.${wt.css.timeContainer}`)),zt.show(this.widget.querySelector(`div.${wt.css.dateContainer}`))),this._hasDate&&this._showMode(),this.optionsStore.options.display.inline)this.optionsStore.element.appendChild(this.widget);else{((null===(e=this.optionsStore.options)||void 0===e?void 0:e.container)||document.body).appendChild(this.widget),this._popperInstance=ut(this.optionsStore.element,this.widget,{modifiers:[{name:"eventListeners",enabled:!0}],placement:"rtl"===document.documentElement.dir?"bottom-end":"bottom-start"})}"clock"==this.optionsStore.options.display.viewMode&&this._eventEmitters.action.emit({e:null,action:Tt.showClock}),this.widget.querySelectorAll("[data-action]").forEach((t=>t.addEventListener("click",this._actionsClickEvent))),this._hasTime&&this.optionsStore.options.display.sideBySide&&(this.timeDisplay._update(this.widget),this.widget.getElementsByClassName(wt.css.clockContainer)[0].style.display="grid")}this.widget.classList.add(wt.css.show),this.optionsStore.options.display.inline||(this._popperInstance.update(),document.addEventListener("click",this._documentClickEvent)),this._eventEmitters.triggerEvent.emit({type:wt.events.show}),this._isVisible=!0}_showMode(t){if(!this.widget)return;if(t){const e=Math.max(this.optionsStore.minimumCalendarViewMode,Math.min(3,this.optionsStore.currentCalendarViewMode+t));if(this.optionsStore.currentCalendarViewMode==e)return;this.optionsStore.currentCalendarViewMode=e}this.widget.querySelectorAll(`.${wt.css.dateContainer} > div:not(.${wt.css.calendarHeader}), .${wt.css.timeContainer} > div:not(.${wt.css.clockContainer})`).forEach((t=>t.style.display="none"));const e=kt[this.optionsStore.currentCalendarViewMode];let s=this.widget.querySelector(`.${e.className}`);switch(e.className){case wt.css.decadesContainer:this.decadeDisplay._update(this.widget,this.paint);break;case wt.css.yearsContainer:this.yearDisplay._update(this.widget,this.paint);break;case wt.css.monthsContainer:this.monthDisplay._update(this.widget,this.paint);break;case wt.css.daysContainer:this.dateDisplay._update(this.widget,this.paint)}s.style.display="grid",this._updateCalendarHeader(),this._eventEmitters.viewUpdate.emit()}_updateCalendarHeader(){const t=[...this.widget.querySelector(`.${wt.css.dateContainer} div[style*="display: grid"]`).classList].find((t=>t.startsWith(wt.css.dateContainer))),[e,s,i]=this.widget.getElementsByClassName(wt.css.calendarHeader)[0].getElementsByTagName("div");switch(t){case wt.css.decadesContainer:e.setAttribute("title",this.optionsStore.options.localization.previousCentury),s.setAttribute("title",""),i.setAttribute("title",this.optionsStore.options.localization.nextCentury);break;case wt.css.yearsContainer:e.setAttribute("title",this.optionsStore.options.localization.previousDecade),s.setAttribute("title",this.optionsStore.options.localization.selectDecade),i.setAttribute("title",this.optionsStore.options.localization.nextDecade);break;case wt.css.monthsContainer:e.setAttribute("title",this.optionsStore.options.localization.previousYear),s.setAttribute("title",this.optionsStore.options.localization.selectYear),i.setAttribute("title",this.optionsStore.options.localization.nextYear);break;case wt.css.daysContainer:e.setAttribute("title",this.optionsStore.options.localization.previousMonth),s.setAttribute("title",this.optionsStore.options.localization.selectMonth),i.setAttribute("title",this.optionsStore.options.localization.nextMonth),s.innerText=this.optionsStore.viewDate.format(this.optionsStore.options.localization.dayViewHeaderFormat)}s.innerText=s.getAttribute(t)}hide(){this.widget&&this._isVisible&&(this.widget.classList.remove(wt.css.show),this._isVisible&&(this._eventEmitters.triggerEvent.emit({type:wt.events.hide,date:this.optionsStore.unset?null:this.dates.lastPicked?this.dates.lastPicked.clone:void 0}),this._isVisible=!1),document.removeEventListener("click",this._documentClickEvent))}toggle(){return this._isVisible?this.hide():this.show()}_dispose(){document.removeEventListener("click",this._documentClickEvent),this.widget&&(this.widget.querySelectorAll("[data-action]").forEach((t=>t.removeEventListener("click",this._actionsClickEvent))),this.widget.parentNode.removeChild(this.widget),this._widget=void 0)}_buildWidget(){const t=document.createElement("div");t.classList.add(wt.css.widget);const e=document.createElement("div");e.classList.add(wt.css.dateContainer),e.append(this.getHeadTemplate(),this.decadeDisplay.getPicker(),this.yearDisplay.getPicker(),this.monthDisplay.getPicker(),this.dateDisplay.getPicker());const s=document.createElement("div");s.classList.add(wt.css.timeContainer),s.appendChild(this.timeDisplay.getPicker(this._iconTag.bind(this))),s.appendChild(this.hourDisplay.getPicker()),s.appendChild(this.minuteDisplay.getPicker()),s.appendChild(this.secondDisplay.getPicker());const i=document.createElement("div");if(i.classList.add(wt.css.toolbar),i.append(...this.getToolbarElements()),this.optionsStore.options.display.inline&&t.classList.add(wt.css.inline),this.optionsStore.options.display.calendarWeeks&&t.classList.add("calendarWeeks"),this.optionsStore.options.display.sideBySide&&this._hasDate&&this._hasTime){t.classList.add(wt.css.sideBySide),"top"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(i);const o=document.createElement("div");return o.classList.add("td-row"),e.classList.add("td-half"),s.classList.add("td-half"),o.appendChild(e),o.appendChild(s),t.appendChild(o),"bottom"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(i),void(this._widget=t)}"top"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(i),this._hasDate&&(this._hasTime&&(e.classList.add(wt.css.collapse),"clock"!==this.optionsStore.options.display.viewMode&&e.classList.add(wt.css.show)),t.appendChild(e)),this._hasTime&&(this._hasDate&&(s.classList.add(wt.css.collapse),"clock"===this.optionsStore.options.display.viewMode&&s.classList.add(wt.css.show)),t.appendChild(s)),"bottom"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(i);const o=document.createElement("div");o.classList.add("arrow"),o.setAttribute("data-popper-arrow",""),t.appendChild(o),this._widget=t}get _hasTime(){return this.optionsStore.options.display.components.clock&&(this.optionsStore.options.display.components.hours||this.optionsStore.options.display.components.minutes||this.optionsStore.options.display.components.seconds)}get _hasDate(){return this.optionsStore.options.display.components.calendar&&(this.optionsStore.options.display.components.year||this.optionsStore.options.display.components.month||this.optionsStore.options.display.components.date)}getToolbarElements(){const t=[];if(this.optionsStore.options.display.buttons.today){const e=document.createElement("div");e.setAttribute("data-action",Tt.today),e.setAttribute("title",this.optionsStore.options.localization.today),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.today)),t.push(e)}if(!this.optionsStore.options.display.sideBySide&&this._hasDate&&this._hasTime){let e,s;"clock"===this.optionsStore.options.display.viewMode?(e=this.optionsStore.options.localization.selectDate,s=this.optionsStore.options.display.icons.date):(e=this.optionsStore.options.localization.selectTime,s=this.optionsStore.options.display.icons.time);const i=document.createElement("div");i.setAttribute("data-action",Tt.togglePicker),i.setAttribute("title",e),i.appendChild(this._iconTag(s)),t.push(i)}if(this.optionsStore.options.display.buttons.clear){const e=document.createElement("div");e.setAttribute("data-action",Tt.clear),e.setAttribute("title",this.optionsStore.options.localization.clear),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.clear)),t.push(e)}if(this.optionsStore.options.display.buttons.close){const e=document.createElement("div");e.setAttribute("data-action",Tt.close),e.setAttribute("title",this.optionsStore.options.localization.close),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.close)),t.push(e)}return t}getHeadTemplate(){const t=document.createElement("div");t.classList.add(wt.css.calendarHeader);const e=document.createElement("div");e.classList.add(wt.css.previous),e.setAttribute("data-action",Tt.previous),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.previous));const s=document.createElement("div");s.classList.add(wt.css.switch),s.setAttribute("data-action",Tt.changeCalendarView);const i=document.createElement("div");return i.classList.add(wt.css.next),i.setAttribute("data-action",Tt.next),i.appendChild(this._iconTag(this.optionsStore.options.display.icons.next)),t.append(e,s,i),t}_iconTag(t){if("sprites"===this.optionsStore.options.display.icons.type){const e=document.createElementNS("http://www.w3.org/2000/svg","svg"),s=document.createElementNS("http://www.w3.org/2000/svg","use");return s.setAttribute("xlink:href",t),s.setAttribute("href",t),e.appendChild(s),e}const e=document.createElement("i");return e.classList.add(...t.split(" ")),e}_rebuild(){const t=this._isVisible;t&&this.hide(),this._dispose(),t&&this.show()}}class Ft{constructor(){this.optionsStore=Dt.locate(Ct),this.dates=Dt.locate(Lt),this.validation=Dt.locate(_t),this.display=Dt.locate(Wt),this._eventEmitters=Dt.locate(Mt),this._eventEmitters.action.subscribe((t=>{this.do(t.e,t.action)}))}do(t,e){var s,i;const o=null==t?void 0:t.currentTarget;if(null===(s=null==o?void 0:o.classList)||void 0===s?void 0:s.contains(wt.css.disabled))return!1;e=e||(null===(i=null==o?void 0:o.dataset)||void 0===i?void 0:i.action);const n=(this.dates.lastPicked||this.optionsStore.viewDate).clone;switch(e){case Tt.next:case Tt.previous:this.handleNextPrevious(e);break;case Tt.changeCalendarView:this.display._showMode(1),this.display._updateCalendarHeader();break;case Tt.selectMonth:case Tt.selectYear:case Tt.selectDecade:const s=+o.dataset.value;switch(e){case Tt.selectMonth:this.optionsStore.viewDate.month=s;break;case Tt.selectYear:case Tt.selectDecade:this.optionsStore.viewDate.year=s}this.optionsStore.currentCalendarViewMode===this.optionsStore.minimumCalendarViewMode?(this.dates.setValue(this.optionsStore.viewDate,this.dates.lastPickedIndex),this.optionsStore.options.display.inline||this.display.hide()):this.display._showMode(-1);break;case Tt.selectDay:const i=this.optionsStore.viewDate.clone;o.classList.contains(wt.css.old)&&i.manipulate(-1,pt.month),o.classList.contains(wt.css.new)&&i.manipulate(1,pt.month),i.date=+o.dataset.day;let a=0;this.optionsStore.options.multipleDates?(a=this.dates.pickedIndex(i,pt.date),-1!==a?this.dates.setValue(null,a):this.dates.setValue(i,this.dates.lastPickedIndex+1)):this.dates.setValue(i,this.dates.lastPickedIndex),this.display._hasTime||this.optionsStore.options.display.keepOpen||this.optionsStore.options.display.inline||this.optionsStore.options.multipleDates||this.display.hide();break;case Tt.selectHour:let r=+o.dataset.value;n.hours>=12&&!this.optionsStore.options.display.components.useTwentyfourHour&&(r+=12),n.hours=r,this.dates.setValue(n,this.dates.lastPickedIndex),this.hideOrClock(t);break;case Tt.selectMinute:n.minutes=+o.dataset.value,this.dates.setValue(n,this.dates.lastPickedIndex),this.hideOrClock(t);break;case Tt.selectSecond:n.seconds=+o.dataset.value,this.dates.setValue(n,this.dates.lastPickedIndex),this.hideOrClock(t);break;case Tt.incrementHours:this.manipulateAndSet(n,pt.hours);break;case Tt.incrementMinutes:this.manipulateAndSet(n,pt.minutes,this.optionsStore.options.stepping);break;case Tt.incrementSeconds:this.manipulateAndSet(n,pt.seconds);break;case Tt.decrementHours:this.manipulateAndSet(n,pt.hours,-1);break;case Tt.decrementMinutes:this.manipulateAndSet(n,pt.minutes,-1*this.optionsStore.options.stepping);break;case Tt.decrementSeconds:this.manipulateAndSet(n,pt.seconds,-1);break;case Tt.toggleMeridiem:this.manipulateAndSet(n,pt.hours,this.dates.lastPicked.hours>=12?-12:12);break;case Tt.togglePicker:o.getAttribute("title")===this.optionsStore.options.localization.selectDate?(o.setAttribute("title",this.optionsStore.options.localization.selectTime),o.innerHTML=this.display._iconTag(this.optionsStore.options.display.icons.time).outerHTML,this.display._updateCalendarHeader(),this.optionsStore.refreshCurrentView()):(o.setAttribute("title",this.optionsStore.options.localization.selectDate),o.innerHTML=this.display._iconTag(this.optionsStore.options.display.icons.date).outerHTML,this.display._hasTime&&(this.do(t,Tt.showClock),this.display._update("clock"))),this.display.widget.querySelectorAll(`.${wt.css.dateContainer}, .${wt.css.timeContainer}`).forEach((t=>zt.toggle(t))),this._eventEmitters.viewUpdate.emit();break;case Tt.showClock:case Tt.showHours:case Tt.showMinutes:case Tt.showSeconds:this.handleShowClockContainers(e);break;case Tt.clear:this.dates.setValue(null),this.display._updateCalendarHeader();break;case Tt.close:this.display.hide();break;case Tt.today:const c=(new vt).setLocale(this.optionsStore.options.localization.locale);this.optionsStore.viewDate=c,this.validation.isValid(c,pt.date)&&this.dates.setValue(c,this.dates.lastPickedIndex)}}handleShowClockContainers(t){if(!this.display._hasTime)return void wt.errorMessages.throwError("Cannot show clock containers when time is disabled.");this.optionsStore.currentView="clock",this.display.widget.querySelectorAll(`.${wt.css.timeContainer} > div`).forEach((t=>t.style.display="none"));let e="";switch(t){case Tt.showClock:e=wt.css.clockContainer,this.display._update("clock");break;case Tt.showHours:e=wt.css.hourContainer,this.display._update(pt.hours);break;case Tt.showMinutes:e=wt.css.minuteContainer,this.display._update(pt.minutes);break;case Tt.showSeconds:e=wt.css.secondContainer,this.display._update(pt.seconds)}this.display.widget.getElementsByClassName(e)[0].style.display="grid"}handleNextPrevious(t){const{unit:e,step:s}=kt[this.optionsStore.currentCalendarViewMode];t===Tt.next?this.optionsStore.viewDate.manipulate(s,e):this.optionsStore.viewDate.manipulate(-1*s,e),this._eventEmitters.viewUpdate.emit(),this.display._showMode()}hideOrClock(t){!this.optionsStore.options.display.components.useTwentyfourHour||this.optionsStore.options.display.components.minutes||this.optionsStore.options.display.keepOpen||this.optionsStore.options.display.inline?this.do(t,Tt.showClock):this.display.hide()}manipulateAndSet(t,e,s=1){const i=t.manipulate(s,e);this.validation.isValid(i,e)&&this.dates.setValue(i,this.dates.lastPickedIndex)}}class qt{constructor(t,e={}){this._subscribers={},this._isDisabled=!1,this._inputChangeEvent=t=>{if(null==t?void 0:t.detail)return;const e=()=>{this.dates.lastPicked&&(this.optionsStore.viewDate=this.dates.lastPicked)},s=this.optionsStore.input.value;if(this.optionsStore.options.multipleDates)try{const t=s.split(this.optionsStore.options.multipleDatesSeparator);for(let e=0;e{var t,e;(null===(t=this.optionsStore.element)||void 0===t?void 0:t.disabled)||(null===(e=this.optionsStore.input)||void 0===e?void 0:e.disabled)||this.toggle()},Dt=new St,this._eventEmitters=Dt.locate(Mt),this.optionsStore=Dt.locate(Ct),this.display=Dt.locate(Wt),this.dates=Dt.locate(Lt),this.actions=Dt.locate(Ft),t||wt.errorMessages.mustProvideElement(),this.optionsStore.element=t,this._initializeOptions(e,xt,!0),this.optionsStore.viewDate.setLocale(this.optionsStore.options.localization.locale),this.optionsStore.unset=!0,this._initializeInput(),this._initializeToggle(),this.optionsStore.options.display.inline&&this.display.show(),this._eventEmitters.triggerEvent.subscribe((t=>{this._triggerEvent(t)})),this._eventEmitters.viewUpdate.subscribe((()=>{this._viewUpdate()}))}get viewDate(){return this.optionsStore.viewDate}updateOptions(t,e=!1){e?this._initializeOptions(t,xt):this._initializeOptions(t,this.optionsStore.options),this.display._rebuild()}toggle(){this._isDisabled||this.display.toggle()}show(){this._isDisabled||this.display.show()}hide(){this.display.hide()}disable(){var t;this._isDisabled=!0,null===(t=this.optionsStore.input)||void 0===t||t.setAttribute("disabled","disabled"),this.display.hide()}enable(){var t;this._isDisabled=!1,null===(t=this.optionsStore.input)||void 0===t||t.removeAttribute("disabled")}clear(){this.optionsStore.input.value="",this.dates.clear()}subscribe(t,e){let s;"string"==typeof t&&(t=[t]),s=Array.isArray(e)?e:[e],t.length!==s.length&&wt.errorMessages.subscribeMismatch();const i=[];for(let e=0;e{e(t)}))}_viewUpdate(){this._triggerEvent({type:wt.events.update,viewDate:this.optionsStore.viewDate.clone})}_unsubscribe(t,e){this._subscribers[t].splice(e,1)}_initializeOptions(t,e,s=!1){var i;let o=Ot.deepCopy(t);o=Ot._mergeOptions(o,e),s&&(o=Ot._dataToOptions(this.optionsStore.element,o)),Ot._validateConflicts(o),o.viewDate=o.viewDate.setLocale(o.localization.locale),this.optionsStore.viewDate.isSame(o.viewDate)||(this.optionsStore.viewDate=o.viewDate),o.display.components.year&&(this.optionsStore.minimumCalendarViewMode=2),o.display.components.month&&(this.optionsStore.minimumCalendarViewMode=1),o.display.components.date&&(this.optionsStore.minimumCalendarViewMode=0),this.optionsStore.currentCalendarViewMode=Math.max(this.optionsStore.minimumCalendarViewMode,this.optionsStore.currentCalendarViewMode),kt[this.optionsStore.currentCalendarViewMode].name!==o.display.viewMode&&(this.optionsStore.currentCalendarViewMode=Math.max(kt.findIndex((t=>t.name===o.display.viewMode)),this.optionsStore.minimumCalendarViewMode)),(null===(i=this.display)||void 0===i?void 0:i.isVisible)&&this.display._update("all"),this.optionsStore.options=o}_initializeInput(){if("INPUT"==this.optionsStore.element.tagName)this.optionsStore.input=this.optionsStore.element;else{let t=this.optionsStore.element.dataset.tdTargetInput;this.optionsStore.input=null==t||"nearest"==t?this.optionsStore.element.querySelector("input"):this.optionsStore.element.querySelector(t)}this.optionsStore.input&&(this.optionsStore.input.addEventListener("change",this._inputChangeEvent),this.optionsStore.options.allowInputToggle&&this.optionsStore.input.addEventListener("click",this._toggleClickEvent),this.optionsStore.input.value&&this._inputChangeEvent())}_initializeToggle(){if(this.optionsStore.options.display.inline)return;let t=this.optionsStore.element.dataset.tdTargetToggle;"nearest"==t&&(t='[data-td-toggle="datetimepicker"]'),this._toggle=null==t?this.optionsStore.element:this.optionsStore.element.querySelector(t),this._toggle.addEventListener("click",this._toggleClickEvent)}_handleAfterChangeEvent(t){var e,s;!this.optionsStore.options.promptTimeOnDateChange||this.optionsStore.options.display.inline||this.optionsStore.options.display.sideBySide||!this.display._hasTime||(null===(e=this.display.widget)||void 0===e?void 0:e.getElementsByClassName(wt.css.show)[0].classList.contains(wt.css.timeContainer))||!t.oldDate&&this.optionsStore.options.useCurrent||t.oldDate&&(null===(s=t.date)||void 0===s?void 0:s.isSame(t.oldDate))||(clearTimeout(this._currentPromptTimeTimeout),this._currentPromptTimeTimeout=setTimeout((()=>{this.display.widget&&this._eventEmitters.action.emit({e:{currentTarget:this.display.widget.querySelector(`.${wt.css.switch} div`)},action:Tt.togglePicker})}),this.optionsStore.options.promptTimeOnDateChangeTransitionDelay))}}const Yt={}}}]); \ No newline at end of file diff --git a/src/Bridge/Symfony/Resources/public/527.js b/src/Bridge/Symfony/Resources/public/527.js new file mode 100644 index 00000000..1f1c9acf --- /dev/null +++ b/src/Bridge/Symfony/Resources/public/527.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[527],{527:function(e,n,t){t.d(n,{Z:function(){return A}});var a=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],i={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:"object"==typeof window&&-1===window.navigator.userAgent.indexOf("MSIE"),ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(e){return"undefined"!=typeof console&&console.warn(e)},getWeek:function(e){var n=new Date(e.getTime());n.setHours(0,0,0,0),n.setDate(n.getDate()+3-(n.getDay()+6)%7);var t=new Date(n.getFullYear(),0,4);return 1+Math.round(((n.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},o={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(e){var n=e%100;if(n>3&&n<21)return"th";switch(n%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},r=o,l=function(e,n){return void 0===n&&(n=2),("000"+e).slice(-1*n)},c=function(e){return!0===e?1:0};function s(e,n){var t;return function(){var a=this,i=arguments;clearTimeout(t),t=setTimeout((function(){return e.apply(a,i)}),n)}}var d=function(e){return e instanceof Array?e:[e]};function u(e,n,t){if(!0===t)return e.classList.add(n);e.classList.remove(n)}function f(e,n,t){var a=window.document.createElement(e);return n=n||"",t=t||"",a.className=n,void 0!==t&&(a.textContent=t),a}function m(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function g(e,n){return n(e)?e:e.parentNode?g(e.parentNode,n):void 0}function p(e,n){var t=f("div","numInputWrapper"),a=f("input","numInput "+e),i=f("span","arrowUp"),o=f("span","arrowDown");if(-1===navigator.userAgent.indexOf("MSIE 9.0")?a.type="number":(a.type="text",a.pattern="\\d*"),void 0!==n)for(var r in n)a.setAttribute(r,n[r]);return t.appendChild(a),t.appendChild(i),t.appendChild(o),t}function h(e){try{return"function"==typeof e.composedPath?e.composedPath()[0]:e.target}catch(n){return e.target}}var v=function(){},D=function(e,n,t){return t.months[n?"shorthand":"longhand"][e]},w={D:v,F:function(e,n,t){e.setMonth(t.months.longhand.indexOf(n))},G:function(e,n){e.setHours((e.getHours()>=12?12:0)+parseFloat(n))},H:function(e,n){e.setHours(parseFloat(n))},J:function(e,n){e.setDate(parseFloat(n))},K:function(e,n,t){e.setHours(e.getHours()%12+12*c(new RegExp(t.amPM[1],"i").test(n)))},M:function(e,n,t){e.setMonth(t.months.shorthand.indexOf(n))},S:function(e,n){e.setSeconds(parseFloat(n))},U:function(e,n){return new Date(1e3*parseFloat(n))},W:function(e,n,t){var a=parseInt(n),i=new Date(e.getFullYear(),0,2+7*(a-1),0,0,0,0);return i.setDate(i.getDate()-i.getDay()+t.firstDayOfWeek),i},Y:function(e,n){e.setFullYear(parseFloat(n))},Z:function(e,n){return new Date(n)},d:function(e,n){e.setDate(parseFloat(n))},h:function(e,n){e.setHours((e.getHours()>=12?12:0)+parseFloat(n))},i:function(e,n){e.setMinutes(parseFloat(n))},j:function(e,n){e.setDate(parseFloat(n))},l:v,m:function(e,n){e.setMonth(parseFloat(n)-1)},n:function(e,n){e.setMonth(parseFloat(n)-1)},s:function(e,n){e.setSeconds(parseFloat(n))},u:function(e,n){return new Date(parseFloat(n))},w:v,y:function(e,n){e.setFullYear(2e3+parseFloat(n))}},b={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},C={Z:function(e){return e.toISOString()},D:function(e,n,t){return n.weekdays.shorthand[C.w(e,n,t)]},F:function(e,n,t){return D(C.n(e,n,t)-1,!1,n)},G:function(e,n,t){return l(C.h(e,n,t))},H:function(e){return l(e.getHours())},J:function(e,n){return void 0!==n.ordinal?e.getDate()+n.ordinal(e.getDate()):e.getDate()},K:function(e,n){return n.amPM[c(e.getHours()>11)]},M:function(e,n){return D(e.getMonth(),!0,n)},S:function(e){return l(e.getSeconds())},U:function(e){return e.getTime()/1e3},W:function(e,n,t){return t.getWeek(e)},Y:function(e){return l(e.getFullYear(),4)},d:function(e){return l(e.getDate())},h:function(e){return e.getHours()%12?e.getHours()%12:12},i:function(e){return l(e.getMinutes())},j:function(e){return e.getDate()},l:function(e,n){return n.weekdays.longhand[e.getDay()]},m:function(e){return l(e.getMonth()+1)},n:function(e){return e.getMonth()+1},s:function(e){return e.getSeconds()},u:function(e){return e.getTime()},w:function(e){return e.getDay()},y:function(e){return String(e.getFullYear()).substring(2)}},M=function(e){var n=e.config,t=void 0===n?i:n,a=e.l10n,r=void 0===a?o:a,l=e.isMobile,c=void 0!==l&&l;return function(e,n,a){var i=a||r;return void 0===t.formatDate||c?n.split("").map((function(n,a,o){return C[n]&&"\\"!==o[a-1]?C[n](e,i,t):"\\"!==n?n:""})).join(""):t.formatDate(e,n,i)}},y=function(e){var n=e.config,t=void 0===n?i:n,a=e.l10n,r=void 0===a?o:a;return function(e,n,a,o){if(0===e||e){var l,c=o||r,s=e;if(e instanceof Date)l=new Date(e.getTime());else if("string"!=typeof e&&void 0!==e.toFixed)l=new Date(e);else if("string"==typeof e){var d=n||(t||i).dateFormat,u=String(e).trim();if("today"===u)l=new Date,a=!0;else if(t&&t.parseDate)l=t.parseDate(e,d);else if(/Z$/.test(u)||/GMT$/.test(u))l=new Date(e);else{for(var f=void 0,m=[],g=0,p=0,h="";g=0?new Date:new Date(t.config.minDate.getTime()),a=T(t.config);n.setHours(a.hours,a.minutes,a.seconds,n.getMilliseconds()),t.selectedDates=[n],t.latestSelectedDateObj=n}void 0!==e&&"blur"!==e.type&&function(e){e.preventDefault();var n="keydown"===e.type,a=h(e),i=a;void 0!==t.amPM&&a===t.amPM&&(t.amPM.textContent=t.l10n.amPM[c(t.amPM.textContent===t.l10n.amPM[0])]);var o=parseFloat(i.getAttribute("min")),r=parseFloat(i.getAttribute("max")),s=parseFloat(i.getAttribute("step")),d=parseInt(i.value,10),u=e.delta||(n?38===e.which?1:-1:0),f=d+s*u;if(void 0!==i.value&&2===i.value.length){var m=i===t.hourElement,g=i===t.minuteElement;fr&&(f=i===t.hourElement?f-r-c(!t.amPM):o,g&&L(void 0,1,t.hourElement)),t.amPM&&m&&(1===s?f+d===23:Math.abs(f-d)>s)&&(t.amPM.textContent=t.l10n.amPM[c(t.amPM.textContent===t.l10n.amPM[0])]),i.value=l(f)}}(e);var i=t._input.value;_(),ye(),t._input.value!==i&&t._debouncedChange()}function _(){if(void 0!==t.hourElement&&void 0!==t.minuteElement){var e,n,a=(parseInt(t.hourElement.value.slice(-2),10)||0)%24,i=(parseInt(t.minuteElement.value,10)||0)%60,o=void 0!==t.secondElement?(parseInt(t.secondElement.value,10)||0)%60:0;void 0!==t.amPM&&(e=a,n=t.amPM.textContent,a=e%12+12*c(n===t.l10n.amPM[1]));var r=void 0!==t.config.minTime||t.config.minDate&&t.minDateHasTime&&t.latestSelectedDateObj&&0===x(t.latestSelectedDateObj,t.config.minDate,!0),l=void 0!==t.config.maxTime||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&0===x(t.latestSelectedDateObj,t.config.maxDate,!0);if(void 0!==t.config.maxTime&&void 0!==t.config.minTime&&t.config.minTime>t.config.maxTime){var s=E(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),d=E(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),u=E(a,i,o);if(u>d&&u=12)]),void 0!==t.secondElement&&(t.secondElement.value=l(a)))}function N(e){var n=h(e),t=parseInt(n.value)+(e.delta||0);(t/1e3>1||"Enter"===e.key&&!/[^\d]/.test(t.toString()))&&ee(t)}function P(e,n,a,i){return n instanceof Array?n.forEach((function(n){return P(e,n,a,i)})):e instanceof Array?e.forEach((function(e){return P(e,n,a,i)})):(e.addEventListener(n,a,i),void t._handlers.push({remove:function(){return e.removeEventListener(n,a,i)}}))}function Y(){De("onChange")}function j(e,n){var a=void 0!==e?t.parseDate(e):t.latestSelectedDateObj||(t.config.minDate&&t.config.minDate>t.now?t.config.minDate:t.config.maxDate&&t.config.maxDate=0&&x(e,t.selectedDates[1])<=0)}(n)&&!be(n)&&r.classList.add("inRange"),t.weekNumbers&&1===t.config.showMonths&&"prevMonthDay"!==e&&i%7==6&&t.weekNumbers.insertAdjacentHTML("beforeend",""+t.config.getWeek(n)+""),De("onDayCreate",r),r}function W(e){e.focus(),"range"===t.config.mode&&oe(e)}function B(e){for(var n=e>0?0:t.config.showMonths-1,a=e>0?t.config.showMonths:-1,i=n;i!=a;i+=e)for(var o=t.daysContainer.children[i],r=e>0?0:o.children.length-1,l=e>0?o.children.length:-1,c=r;c!=l;c+=e){var s=o.children[c];if(-1===s.className.indexOf("hidden")&&ne(s.dateObj))return s}}function J(e,n){var a=o(),i=te(a||document.body),r=void 0!==e?e:i?a:void 0!==t.selectedDateElem&&te(t.selectedDateElem)?t.selectedDateElem:void 0!==t.todayDateElem&&te(t.todayDateElem)?t.todayDateElem:B(n>0?1:-1);void 0===r?t._input.focus():i?function(e,n){for(var a=-1===e.className.indexOf("Month")?e.dateObj.getMonth():t.currentMonth,i=n>0?t.config.showMonths:-1,o=n>0?1:-1,r=a-t.currentMonth;r!=i;r+=o)for(var l=t.daysContainer.children[r],c=a-t.currentMonth===r?e.$i+n:n<0?l.children.length-1:0,s=l.children.length,d=c;d>=0&&d0?s:-1);d+=o){var u=l.children[d];if(-1===u.className.indexOf("hidden")&&ne(u.dateObj)&&Math.abs(e.$i-d)>=Math.abs(n))return W(u)}t.changeMonth(o),J(B(o),0)}(r,n):W(r)}function K(e,n){for(var a=(new Date(e,n,1).getDay()-t.l10n.firstDayOfWeek+7)%7,i=t.utils.getDaysInMonth((n-1+12)%12,e),o=t.utils.getDaysInMonth(n,e),r=window.document.createDocumentFragment(),l=t.config.showMonths>1,c=l?"prevMonthDay hidden":"prevMonthDay",s=l?"nextMonthDay hidden":"nextMonthDay",d=i+1-a,u=0;d<=i;d++,u++)r.appendChild(R("flatpickr-day "+c,new Date(e,n-1,d),0,u));for(d=1;d<=o;d++,u++)r.appendChild(R("flatpickr-day",new Date(e,n,d),0,u));for(var m=o+1;m<=42-a&&(1===t.config.showMonths||u%7!=0);m++,u++)r.appendChild(R("flatpickr-day "+s,new Date(e,n+1,m%o),0,u));var g=f("div","dayContainer");return g.appendChild(r),g}function U(){if(void 0!==t.daysContainer){m(t.daysContainer),t.weekNumbers&&m(t.weekNumbers);for(var e=document.createDocumentFragment(),n=0;n1||"dropdown"!==t.config.monthSelectorType)){var e=function(e){return!(void 0!==t.config.minDate&&t.currentYear===t.config.minDate.getFullYear()&&et.config.maxDate.getMonth())};t.monthsDropdownContainer.tabIndex=-1,t.monthsDropdownContainer.innerHTML="";for(var n=0;n<12;n++)if(e(n)){var a=f("option","flatpickr-monthDropdown-month");a.value=new Date(t.currentYear,n).getMonth().toString(),a.textContent=D(n,t.config.shorthandCurrentMonth,t.l10n),a.tabIndex=-1,t.currentMonth===n&&(a.selected=!0),t.monthsDropdownContainer.appendChild(a)}}}function $(){var e,n=f("div","flatpickr-month"),a=window.document.createDocumentFragment();t.config.showMonths>1||"static"===t.config.monthSelectorType?e=f("span","cur-month"):(t.monthsDropdownContainer=f("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),P(t.monthsDropdownContainer,"change",(function(e){var n=h(e),a=parseInt(n.value,10);t.changeMonth(a-t.currentMonth),De("onMonthChange")})),q(),e=t.monthsDropdownContainer);var i=p("cur-year",{tabindex:"-1"}),o=i.getElementsByTagName("input")[0];o.setAttribute("aria-label",t.l10n.yearAriaLabel),t.config.minDate&&o.setAttribute("min",t.config.minDate.getFullYear().toString()),t.config.maxDate&&(o.setAttribute("max",t.config.maxDate.getFullYear().toString()),o.disabled=!!t.config.minDate&&t.config.minDate.getFullYear()===t.config.maxDate.getFullYear());var r=f("div","flatpickr-current-month");return r.appendChild(e),r.appendChild(i),a.appendChild(r),n.appendChild(a),{container:n,yearElement:o,monthElement:e}}function V(){m(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var e=t.config.showMonths;e--;){var n=$();t.yearElements.push(n.yearElement),t.monthElements.push(n.monthElement),t.monthNav.appendChild(n.container)}t.monthNav.appendChild(t.nextMonthNav)}function Z(){t.weekdayContainer?m(t.weekdayContainer):t.weekdayContainer=f("div","flatpickr-weekdays");for(var e=t.config.showMonths;e--;){var n=f("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(n)}return z(),t.weekdayContainer}function z(){if(t.weekdayContainer){var e=t.l10n.firstDayOfWeek,n=S(t.l10n.weekdays.shorthand);e>0&&e\n "+n.join("")+"\n \n "}}function G(e,n){void 0===n&&(n=!0);var a=n?e:e-t.currentMonth;a<0&&!0===t._hidePrevMonthArrow||a>0&&!0===t._hideNextMonthArrow||(t.currentMonth+=a,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,De("onYearChange"),q()),U(),De("onMonthChange"),Ce())}function Q(e){return t.calendarContainer.contains(e)}function X(e){if(t.isOpen&&!t.config.inline){var n=h(e),a=Q(n),i=!(n===t.input||n===t.altInput||t.element.contains(n)||e.path&&e.path.indexOf&&(~e.path.indexOf(t.input)||~e.path.indexOf(t.altInput)))&&!a&&!Q(e.relatedTarget),o=!t.config.ignoredFocusElements.some((function(e){return e.contains(n)}));i&&o&&(t.config.allowInput&&t.setDate(t._input.value,!1,t.config.altInput?t.config.altFormat:t.config.dateFormat),void 0!==t.timeContainer&&void 0!==t.minuteElement&&void 0!==t.hourElement&&""!==t.input.value&&void 0!==t.input.value&&C(),t.close(),t.config&&"range"===t.config.mode&&1===t.selectedDates.length&&t.clear(!1))}}function ee(e){if(!(!e||t.config.minDate&&et.config.maxDate.getFullYear())){var n=e,a=t.currentYear!==n;t.currentYear=n||t.currentYear,t.config.maxDate&&t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth=Math.min(t.config.maxDate.getMonth(),t.currentMonth):t.config.minDate&&t.currentYear===t.config.minDate.getFullYear()&&(t.currentMonth=Math.max(t.config.minDate.getMonth(),t.currentMonth)),a&&(t.redraw(),De("onYearChange"),q())}}function ne(e,n){var a;void 0===n&&(n=!0);var i=t.parseDate(e,void 0,n);if(t.config.minDate&&i&&x(i,t.config.minDate,void 0!==n?n:!t.minDateHasTime)<0||t.config.maxDate&&i&&x(i,t.config.maxDate,void 0!==n?n:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&0===t.config.disable.length)return!0;if(void 0===i)return!1;for(var o=!!t.config.enable,r=null!==(a=t.config.enable)&&void 0!==a?a:t.config.disable,l=0,c=void 0;l=c.from.getTime()&&i.getTime()<=c.to.getTime())return o}return!o}function te(e){return void 0!==t.daysContainer&&(-1===e.className.indexOf("hidden")&&-1===e.className.indexOf("flatpickr-disabled")&&t.daysContainer.contains(e))}function ae(e){var n=e.target===t._input,a=t._input.value.trimEnd()!==Me();!n||!a||e.relatedTarget&&Q(e.relatedTarget)||t.setDate(t._input.value,!0,e.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function ie(n){var a=h(n),i=t.config.wrap?e.contains(a):a===t._input,r=t.config.allowInput,l=t.isOpen&&(!r||!i),c=t.config.inline&&i&&!r;if(13===n.keyCode&&i){if(r)return t.setDate(t._input.value,!0,a===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),a.blur();t.open()}else if(Q(a)||l||c){var s=!!t.timeContainer&&t.timeContainer.contains(a);switch(n.keyCode){case 13:s?(n.preventDefault(),C(),fe()):me(n);break;case 27:n.preventDefault(),fe();break;case 8:case 46:i&&!t.config.allowInput&&(n.preventDefault(),t.clear());break;case 37:case 39:if(s||i)t.hourElement&&t.hourElement.focus();else{n.preventDefault();var d=o();if(void 0!==t.daysContainer&&(!1===r||d&&te(d))){var u=39===n.keyCode?1:-1;n.ctrlKey?(n.stopPropagation(),G(u),J(B(1),0)):J(void 0,u)}}break;case 38:case 40:n.preventDefault();var f=40===n.keyCode?1:-1;t.daysContainer&&void 0!==a.$i||a===t.input||a===t.altInput?n.ctrlKey?(n.stopPropagation(),ee(t.currentYear-f),J(B(1),0)):s||J(void 0,7*f):a===t.currentYearElement?ee(t.currentYear-f):t.config.enableTime&&(!s&&t.hourElement&&t.hourElement.focus(),C(n),t._debouncedChange());break;case 9:if(s){var m=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter((function(e){return e})),g=m.indexOf(a);if(-1!==g){var p=m[g+(n.shiftKey?-1:1)];n.preventDefault(),(p||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(a)&&n.shiftKey&&(n.preventDefault(),t._input.focus())}}if(void 0!==t.amPM&&a===t.amPM)switch(n.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],_(),ye();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],_(),ye()}(i||Q(a))&&De("onKeyDown",n)}function oe(e,n){if(void 0===n&&(n="flatpickr-day"),1===t.selectedDates.length&&(!e||e.classList.contains(n)&&!e.classList.contains("flatpickr-disabled"))){for(var a=e?e.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),i=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),o=Math.min(a,t.selectedDates[0].getTime()),r=Math.max(a,t.selectedDates[0].getTime()),l=!1,c=0,s=0,d=o;do&&dc)?c=d:d>i&&(!s||d ."+n)).forEach((function(n){var o,r,d,u=n.dateObj.getTime(),f=c>0&&u0&&u>s;if(f)return n.classList.add("notAllowed"),void["inRange","startRange","endRange"].forEach((function(e){n.classList.remove(e)}));l&&!f||(["startRange","inRange","endRange","notAllowed"].forEach((function(e){n.classList.remove(e)})),void 0!==e&&(e.classList.add(a<=t.selectedDates[0].getTime()?"startRange":"endRange"),ia&&u===i&&n.classList.add("endRange"),u>=c&&(0===s||u<=s)&&(r=i,d=a,(o=u)>Math.min(r,d)&&o0||a.getMinutes()>0||a.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter((function(e){return ne(e)})),t.selectedDates.length||"min"!==e||O(a),ye()),t.daysContainer&&(ue(),void 0!==a?t.currentYearElement[e]=a.getFullYear().toString():t.currentYearElement.removeAttribute(e),t.currentYearElement.disabled=!!i&&void 0!==a&&i.getFullYear()===a.getFullYear())}}function ce(){return t.config.wrap?e.querySelector("[data-input]"):e}function se(){"object"!=typeof t.config.locale&&void 0===F.l10ns[t.config.locale]&&t.config.errorHandler(new Error("flatpickr: invalid locale "+t.config.locale)),t.l10n=I(I({},F.l10ns.default),"object"==typeof t.config.locale?t.config.locale:"default"!==t.config.locale?F.l10ns[t.config.locale]:void 0),b.D="("+t.l10n.weekdays.shorthand.join("|")+")",b.l="("+t.l10n.weekdays.longhand.join("|")+")",b.M="("+t.l10n.months.shorthand.join("|")+")",b.F="("+t.l10n.months.longhand.join("|")+")",b.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")",void 0===I(I({},n),JSON.parse(JSON.stringify(e.dataset||{}))).time_24hr&&void 0===F.defaultConfig.time_24hr&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=M(t),t.parseDate=y({config:t.config,l10n:t.l10n})}function de(e){if("function"!=typeof t.config.position){if(void 0!==t.calendarContainer){De("onPreCalendarPosition");var n=e||t._positionElement,a=Array.prototype.reduce.call(t.calendarContainer.children,(function(e,n){return e+n.offsetHeight}),0),i=t.calendarContainer.offsetWidth,o=t.config.position.split(" "),r=o[0],l=o.length>1?o[1]:null,c=n.getBoundingClientRect(),s=window.innerHeight-c.bottom,d="above"===r||"below"!==r&&sa,f=window.pageYOffset+c.top+(d?-a-2:n.offsetHeight+2);if(u(t.calendarContainer,"arrowTop",!d),u(t.calendarContainer,"arrowBottom",d),!t.config.inline){var m=window.pageXOffset+c.left,g=!1,p=!1;"center"===l?(m-=(i-c.width)/2,g=!0):"right"===l&&(m-=i-c.width,p=!0),u(t.calendarContainer,"arrowLeft",!g&&!p),u(t.calendarContainer,"arrowCenter",g),u(t.calendarContainer,"arrowRight",p);var h=window.document.body.offsetWidth-(window.pageXOffset+c.right),v=m+i>window.document.body.offsetWidth,D=h+i>window.document.body.offsetWidth;if(u(t.calendarContainer,"rightMost",v),!t.config.static)if(t.calendarContainer.style.top=f+"px",v)if(D){var w=function(){for(var e=null,n=0;nt.currentMonth+t.config.showMonths-1)&&"range"!==t.config.mode;if(t.selectedDateElem=a,"single"===t.config.mode)t.selectedDates=[i];else if("multiple"===t.config.mode){var r=be(i);r?t.selectedDates.splice(parseInt(r),1):t.selectedDates.push(i)}else"range"===t.config.mode&&(2===t.selectedDates.length&&t.clear(!1,!1),t.latestSelectedDateObj=i,t.selectedDates.push(i),0!==x(i,t.selectedDates[0],!0)&&t.selectedDates.sort((function(e,n){return e.getTime()-n.getTime()})));if(_(),o){var l=t.currentYear!==i.getFullYear();t.currentYear=i.getFullYear(),t.currentMonth=i.getMonth(),l&&(De("onYearChange"),q()),De("onMonthChange")}if(Ce(),U(),ye(),o||"range"===t.config.mode||1!==t.config.showMonths?void 0!==t.selectedDateElem&&void 0===t.hourElement&&t.selectedDateElem&&t.selectedDateElem.focus():W(a),void 0!==t.hourElement&&void 0!==t.hourElement&&t.hourElement.focus(),t.config.closeOnSelect){var c="single"===t.config.mode&&!t.config.enableTime,s="range"===t.config.mode&&2===t.selectedDates.length&&!t.config.enableTime;(c||s)&&fe()}Y()}}t.parseDate=y({config:t.config,l10n:t.l10n}),t._handlers=[],t.pluginElements=[],t.loadedPlugins=[],t._bind=P,t._setHoursFromDate=O,t._positionCalendar=de,t.changeMonth=G,t.changeYear=ee,t.clear=function(e,n){void 0===e&&(e=!0);void 0===n&&(n=!0);t.input.value="",void 0!==t.altInput&&(t.altInput.value="");void 0!==t.mobileInput&&(t.mobileInput.value="");t.selectedDates=[],t.latestSelectedDateObj=void 0,!0===n&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth());if(!0===t.config.enableTime){var a=T(t.config),i=a.hours,o=a.minutes,r=a.seconds;A(i,o,r)}t.redraw(),e&&De("onChange")},t.close=function(){t.isOpen=!1,t.isMobile||(void 0!==t.calendarContainer&&t.calendarContainer.classList.remove("open"),void 0!==t._input&&t._input.classList.remove("active"));De("onClose")},t.onMouseOver=oe,t._createElement=f,t.createDay=R,t.destroy=function(){void 0!==t.config&&De("onDestroy");for(var e=t._handlers.length;e--;)t._handlers[e].remove();if(t._handlers=[],t.mobileInput)t.mobileInput.parentNode&&t.mobileInput.parentNode.removeChild(t.mobileInput),t.mobileInput=void 0;else if(t.calendarContainer&&t.calendarContainer.parentNode)if(t.config.static&&t.calendarContainer.parentNode){var n=t.calendarContainer.parentNode;if(n.lastChild&&n.removeChild(n.lastChild),n.parentNode){for(;n.firstChild;)n.parentNode.insertBefore(n.firstChild,n);n.parentNode.removeChild(n)}}else t.calendarContainer.parentNode.removeChild(t.calendarContainer);t.altInput&&(t.input.type="text",t.altInput.parentNode&&t.altInput.parentNode.removeChild(t.altInput),delete t.altInput);t.input&&(t.input.type=t.input._type,t.input.classList.remove("flatpickr-input"),t.input.removeAttribute("readonly"));["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach((function(e){try{delete t[e]}catch(e){}}))},t.isEnabled=ne,t.jumpToDate=j,t.updateValue=ye,t.open=function(e,n){void 0===n&&(n=t._positionElement);if(!0===t.isMobile){if(e){e.preventDefault();var a=h(e);a&&a.blur()}return void 0!==t.mobileInput&&(t.mobileInput.focus(),t.mobileInput.click()),void De("onOpen")}if(t._input.disabled||t.config.inline)return;var i=t.isOpen;t.isOpen=!0,i||(t.calendarContainer.classList.add("open"),t._input.classList.add("active"),De("onOpen"),de(n));!0===t.config.enableTime&&!0===t.config.noCalendar&&(!1!==t.config.allowInput||void 0!==e&&t.timeContainer.contains(e.relatedTarget)||setTimeout((function(){return t.hourElement.select()}),50))},t.redraw=ue,t.set=function(e,n){if(null!==e&&"object"==typeof e)for(var i in Object.assign(t.config,e),e)void 0!==ge[i]&&ge[i].forEach((function(e){return e()}));else t.config[e]=n,void 0!==ge[e]?ge[e].forEach((function(e){return e()})):a.indexOf(e)>-1&&(t.config[e]=d(n));t.redraw(),ye(!0)},t.setDate=function(e,n,a){void 0===n&&(n=!1);void 0===a&&(a=t.config.dateFormat);if(0!==e&&!e||e instanceof Array&&0===e.length)return t.clear(n);pe(e,a),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),j(void 0,n),O(),0===t.selectedDates.length&&t.clear(!1);ye(n),n&&De("onChange")},t.toggle=function(e){if(!0===t.isOpen)return t.close();t.open(e)};var ge={locale:[se,z],showMonths:[V,w,Z],minDate:[j],maxDate:[j],positionElement:[ve],clickOpens:[function(){!0===t.config.clickOpens?(P(t._input,"focus",t.open),P(t._input,"click",t.open)):(t._input.removeEventListener("focus",t.open),t._input.removeEventListener("click",t.open))}]};function pe(e,n){var a=[];if(e instanceof Array)a=e.map((function(e){return t.parseDate(e,n)}));else if(e instanceof Date||"number"==typeof e)a=[t.parseDate(e,n)];else if("string"==typeof e)switch(t.config.mode){case"single":case"time":a=[t.parseDate(e,n)];break;case"multiple":a=e.split(t.config.conjunction).map((function(e){return t.parseDate(e,n)}));break;case"range":a=e.split(t.l10n.rangeSeparator).map((function(e){return t.parseDate(e,n)}))}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(e)));t.selectedDates=t.config.allowInvalidPreload?a:a.filter((function(e){return e instanceof Date&&ne(e,!1)})),"range"===t.config.mode&&t.selectedDates.sort((function(e,n){return e.getTime()-n.getTime()}))}function he(e){return e.slice().map((function(e){return"string"==typeof e||"number"==typeof e||e instanceof Date?t.parseDate(e,void 0,!0):e&&"object"==typeof e&&e.from&&e.to?{from:t.parseDate(e.from,void 0),to:t.parseDate(e.to,void 0)}:e})).filter((function(e){return e}))}function ve(){t._positionElement=t.config.positionElement||t._input}function De(e,n){if(void 0!==t.config){var a=t.config[e];if(void 0!==a&&a.length>0)for(var i=0;a[i]&&i1||"static"===t.config.monthSelectorType?t.monthElements[n].textContent=D(a.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=a.getMonth().toString(),e.value=a.getFullYear().toString()})),t._hidePrevMonthArrow=void 0!==t.config.minDate&&(t.currentYear===t.config.minDate.getFullYear()?t.currentMonth<=t.config.minDate.getMonth():t.currentYeart.config.maxDate.getMonth():t.currentYear>t.config.maxDate.getFullYear()))}function Me(e){var n=e||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map((function(e){return t.formatDate(e,n)})).filter((function(e,n,a){return"range"!==t.config.mode||t.config.enableTime||a.indexOf(e)===n})).join("range"!==t.config.mode?t.config.conjunction:t.l10n.rangeSeparator)}function ye(e){void 0===e&&(e=!0),void 0!==t.mobileInput&&t.mobileFormatStr&&(t.mobileInput.value=void 0!==t.latestSelectedDateObj?t.formatDate(t.latestSelectedDateObj,t.mobileFormatStr):""),t.input.value=Me(t.config.dateFormat),void 0!==t.altInput&&(t.altInput.value=Me(t.config.altFormat)),!1!==e&&De("onValueUpdate")}function xe(e){var n=h(e),a=t.prevMonthNav.contains(n),i=t.nextMonthNav.contains(n);a||i?G(a?-1:1):t.yearElements.indexOf(n)>=0?n.select():n.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):n.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}return function(){t.element=t.input=e,t.isOpen=!1,function(){var o=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],r=I(I({},JSON.parse(JSON.stringify(e.dataset||{}))),n),l={};t.config.parseDate=r.parseDate,t.config.formatDate=r.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(e){t.config._enable=he(e)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(e){t.config._disable=he(e)}});var c="time"===r.mode;if(!r.dateFormat&&(r.enableTime||c)){var s=F.defaultConfig.dateFormat||i.dateFormat;l.dateFormat=r.noCalendar||c?"H:i"+(r.enableSeconds?":S":""):s+" H:i"+(r.enableSeconds?":S":"")}if(r.altInput&&(r.enableTime||c)&&!r.altFormat){var u=F.defaultConfig.altFormat||i.altFormat;l.altFormat=r.noCalendar||c?"h:i"+(r.enableSeconds?":S K":" K"):u+" h:i"+(r.enableSeconds?":S":"")+" K"}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:le("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:le("max")});var f=function(e){return function(n){t.config["min"===e?"_minTime":"_maxTime"]=t.parseDate(n,"H:i:S")}};Object.defineProperty(t.config,"minTime",{get:function(){return t.config._minTime},set:f("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:f("max")}),"time"===r.mode&&(t.config.noCalendar=!0,t.config.enableTime=!0);Object.assign(t.config,l,r);for(var m=0;m-1?t.config[p]=d(g[p]).map(v).concat(t.config[p]):void 0===r[p]&&(t.config[p]=g[p])}r.altInputClass||(t.config.altInputClass=ce().className+" "+t.config.altInputClass);De("onParseConfig")}(),se(),function(){if(t.input=ce(),!t.input)return void t.config.errorHandler(new Error("Invalid input element specified"));t.input._type=t.input.type,t.input.type="text",t.input.classList.add("flatpickr-input"),t._input=t.input,t.config.altInput&&(t.altInput=f(t.input.nodeName,t.config.altInputClass),t._input=t.altInput,t.altInput.placeholder=t.input.placeholder,t.altInput.disabled=t.input.disabled,t.altInput.required=t.input.required,t.altInput.tabIndex=t.input.tabIndex,t.altInput.type="text",t.input.setAttribute("type","hidden"),!t.config.static&&t.input.parentNode&&t.input.parentNode.insertBefore(t.altInput,t.input.nextSibling));t.config.allowInput||t._input.setAttribute("readonly","readonly");ve()}(),function(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;var e=t.config.defaultDate||("INPUT"!==t.input.nodeName&&"TEXTAREA"!==t.input.nodeName||!t.input.placeholder||t.input.value!==t.input.placeholder?t.input.value:null);e&&pe(e,t.config.dateFormat);t._initialDate=t.selectedDates.length>0?t.selectedDates[0]:t.config.minDate&&t.config.minDate.getTime()>t.now.getTime()?t.config.minDate:t.config.maxDate&&t.config.maxDate.getTime()0&&(t.latestSelectedDateObj=t.selectedDates[0]);void 0!==t.config.minTime&&(t.config.minTime=t.parseDate(t.config.minTime,"H:i"));void 0!==t.config.maxTime&&(t.config.maxTime=t.parseDate(t.config.maxTime,"H:i"));t.minDateHasTime=!!t.config.minDate&&(t.config.minDate.getHours()>0||t.config.minDate.getMinutes()>0||t.config.minDate.getSeconds()>0),t.maxDateHasTime=!!t.config.maxDate&&(t.config.maxDate.getHours()>0||t.config.maxDate.getMinutes()>0||t.config.maxDate.getSeconds()>0)}(),t.utils={getDaysInMonth:function(e,n){return void 0===e&&(e=t.currentMonth),void 0===n&&(n=t.currentYear),1===e&&(n%4==0&&n%100!=0||n%400==0)?29:t.l10n.daysInMonth[e]}},t.isMobile||function(){var e=window.document.createDocumentFragment();if(t.calendarContainer=f("div","flatpickr-calendar"),t.calendarContainer.tabIndex=-1,!t.config.noCalendar){if(e.appendChild((t.monthNav=f("div","flatpickr-months"),t.yearElements=[],t.monthElements=[],t.prevMonthNav=f("span","flatpickr-prev-month"),t.prevMonthNav.innerHTML=t.config.prevArrow,t.nextMonthNav=f("span","flatpickr-next-month"),t.nextMonthNav.innerHTML=t.config.nextArrow,V(),Object.defineProperty(t,"_hidePrevMonthArrow",{get:function(){return t.__hidePrevMonthArrow},set:function(e){t.__hidePrevMonthArrow!==e&&(u(t.prevMonthNav,"flatpickr-disabled",e),t.__hidePrevMonthArrow=e)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(e){t.__hideNextMonthArrow!==e&&(u(t.nextMonthNav,"flatpickr-disabled",e),t.__hideNextMonthArrow=e)}}),t.currentYearElement=t.yearElements[0],Ce(),t.monthNav)),t.innerContainer=f("div","flatpickr-innerContainer"),t.config.weekNumbers){var n=function(){t.calendarContainer.classList.add("hasWeeks");var e=f("div","flatpickr-weekwrapper");e.appendChild(f("span","flatpickr-weekday",t.l10n.weekAbbreviation));var n=f("div","flatpickr-weeks");return e.appendChild(n),{weekWrapper:e,weekNumbers:n}}(),a=n.weekWrapper,i=n.weekNumbers;t.innerContainer.appendChild(a),t.weekNumbers=i,t.weekWrapper=a}t.rContainer=f("div","flatpickr-rContainer"),t.rContainer.appendChild(Z()),t.daysContainer||(t.daysContainer=f("div","flatpickr-days"),t.daysContainer.tabIndex=-1),U(),t.rContainer.appendChild(t.daysContainer),t.innerContainer.appendChild(t.rContainer),e.appendChild(t.innerContainer)}t.config.enableTime&&e.appendChild(function(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var e=T(t.config);t.timeContainer=f("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var n=f("span","flatpickr-time-separator",":"),a=p("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=a.getElementsByTagName("input")[0];var i=p("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});t.minuteElement=i.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=l(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?e.hours:function(e){switch(e%24){case 0:case 12:return 12;default:return e%12}}(e.hours)),t.minuteElement.value=l(t.latestSelectedDateObj?t.latestSelectedDateObj.getMinutes():e.minutes),t.hourElement.setAttribute("step",t.config.hourIncrement.toString()),t.minuteElement.setAttribute("step",t.config.minuteIncrement.toString()),t.hourElement.setAttribute("min",t.config.time_24hr?"0":"1"),t.hourElement.setAttribute("max",t.config.time_24hr?"23":"12"),t.hourElement.setAttribute("maxlength","2"),t.minuteElement.setAttribute("min","0"),t.minuteElement.setAttribute("max","59"),t.minuteElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(a),t.timeContainer.appendChild(n),t.timeContainer.appendChild(i),t.config.time_24hr&&t.timeContainer.classList.add("time24hr");if(t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var o=p("flatpickr-second");t.secondElement=o.getElementsByTagName("input")[0],t.secondElement.value=l(t.latestSelectedDateObj?t.latestSelectedDateObj.getSeconds():e.seconds),t.secondElement.setAttribute("step",t.minuteElement.getAttribute("step")),t.secondElement.setAttribute("min","0"),t.secondElement.setAttribute("max","59"),t.secondElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(f("span","flatpickr-time-separator",":")),t.timeContainer.appendChild(o)}t.config.time_24hr||(t.amPM=f("span","flatpickr-am-pm",t.l10n.amPM[c((t.latestSelectedDateObj?t.hourElement.value:t.config.defaultHour)>11)]),t.amPM.title=t.l10n.toggleTitle,t.amPM.tabIndex=-1,t.timeContainer.appendChild(t.amPM));return t.timeContainer}());u(t.calendarContainer,"rangeMode","range"===t.config.mode),u(t.calendarContainer,"animate",!0===t.config.animate),u(t.calendarContainer,"multiMonth",t.config.showMonths>1),t.calendarContainer.appendChild(e);var o=void 0!==t.config.appendTo&&void 0!==t.config.appendTo.nodeType;if((t.config.inline||t.config.static)&&(t.calendarContainer.classList.add(t.config.inline?"inline":"static"),t.config.inline&&(!o&&t.element.parentNode?t.element.parentNode.insertBefore(t.calendarContainer,t._input.nextSibling):void 0!==t.config.appendTo&&t.config.appendTo.appendChild(t.calendarContainer)),t.config.static)){var r=f("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(r,t.element),r.appendChild(t.element),t.altInput&&r.appendChild(t.altInput),r.appendChild(t.calendarContainer)}t.config.static||t.config.inline||(void 0!==t.config.appendTo?t.config.appendTo:window.document.body).appendChild(t.calendarContainer)}(),function(){t.config.wrap&&["open","close","toggle","clear"].forEach((function(e){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+e+"]"),(function(n){return P(n,"click",t[e])}))}));if(t.isMobile)return void function(){var e=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=f("input",t.input.className+" flatpickr-mobile"),t.mobileInput.tabIndex=1,t.mobileInput.type=e,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr="datetime-local"===e?"Y-m-d\\TH:i:S":"date"===e?"Y-m-d":"H:i:S",t.selectedDates.length>0&&(t.mobileInput.defaultValue=t.mobileInput.value=t.formatDate(t.selectedDates[0],t.mobileFormatStr));t.config.minDate&&(t.mobileInput.min=t.formatDate(t.config.minDate,"Y-m-d"));t.config.maxDate&&(t.mobileInput.max=t.formatDate(t.config.maxDate,"Y-m-d"));t.input.getAttribute("step")&&(t.mobileInput.step=String(t.input.getAttribute("step")));t.input.type="hidden",void 0!==t.altInput&&(t.altInput.type="hidden");try{t.input.parentNode&&t.input.parentNode.insertBefore(t.mobileInput,t.input.nextSibling)}catch(e){}P(t.mobileInput,"change",(function(e){t.setDate(h(e).value,!1,t.mobileFormatStr),De("onChange"),De("onClose")}))}();var e=s(re,50);t._debouncedChange=s(Y,300),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&P(t.daysContainer,"mouseover",(function(e){"range"===t.config.mode&&oe(h(e))}));P(t._input,"keydown",ie),void 0!==t.calendarContainer&&P(t.calendarContainer,"keydown",ie);t.config.inline||t.config.static||P(window,"resize",e);void 0!==window.ontouchstart?P(window.document,"touchstart",X):P(window.document,"mousedown",X);P(window.document,"focus",X,{capture:!0}),!0===t.config.clickOpens&&(P(t._input,"focus",t.open),P(t._input,"click",t.open));void 0!==t.daysContainer&&(P(t.monthNav,"click",xe),P(t.monthNav,["keyup","increment"],N),P(t.daysContainer,"click",me));if(void 0!==t.timeContainer&&void 0!==t.minuteElement&&void 0!==t.hourElement){var n=function(e){return h(e).select()};P(t.timeContainer,["increment"],C),P(t.timeContainer,"blur",C,{capture:!0}),P(t.timeContainer,"click",H),P([t.hourElement,t.minuteElement],["focus","click"],n),void 0!==t.secondElement&&P(t.secondElement,"focus",(function(){return t.secondElement&&t.secondElement.select()})),void 0!==t.amPM&&P(t.amPM,"click",(function(e){C(e)}))}t.config.allowInput&&P(t._input,"blur",ae)}(),(t.selectedDates.length||t.config.noCalendar)&&(t.config.enableTime&&O(t.config.noCalendar?t.latestSelectedDateObj:void 0),ye(!1)),w();var o=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!t.isMobile&&o&&de(),De("onReady")}(),t}function O(e,n){for(var t=Array.prototype.slice.call(e).filter((function(e){return e instanceof HTMLElement})),a=[],i=0;ie.identifier===this.identifier&&e.__stimulusLazyController))||Promise.all([r.e(430),r.e(696)]).then(r.bind(r,696)).then((e=>{this.application.register(this.identifier,e.default)}))}};r.g.sonataApplication.register("datepicker",t)}()}(); \ No newline at end of file +!function(){"use strict";var e,t={678:function(e){e.exports=stimulus}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,r),i.exports}r.m=t,r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.f={},r.e=function(e){return Promise.all(Object.keys(r.f).reduce((function(t,n){return r.f[n](e,t),t}),[]))},r.u=function(e){return e+".js"},r.miniCssF=function(e){},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},e={},r.l=function(t,n,o,i){if(e[t])e[t].push(n);else{var u,a;if(void 0!==o)for(var l=document.getElementsByTagName("script"),s=0;se.identifier===this.identifier&&e.__stimulusLazyController))||Promise.all([r.e(527),r.e(696)]).then(r.bind(r,696)).then((e=>{this.application.register(this.identifier,e.default)}))}};r.g.sonataApplication.register("datepicker",t)}()}(); \ No newline at end of file diff --git a/src/Bridge/Symfony/Resources/public/manifest.json b/src/Bridge/Symfony/Resources/public/manifest.json index e18aceb5..99584031 100644 --- a/src/Bridge/Symfony/Resources/public/manifest.json +++ b/src/Bridge/Symfony/Resources/public/manifest.json @@ -2,5 +2,5 @@ "bundles/sonataform/app.css": "/bundles/sonataform/app.css", "bundles/sonataform/app.js": "/bundles/sonataform/app.js", "bundles/sonataform/696.js": "/bundles/sonataform/696.js", - "bundles/sonataform/430.js": "/bundles/sonataform/430.js" + "bundles/sonataform/527.js": "/bundles/sonataform/527.js" } \ No newline at end of file diff --git a/src/Bridge/Symfony/Resources/views/Form/datepicker.html.twig b/src/Bridge/Symfony/Resources/views/Form/datepicker.html.twig index ea9e7ac5..aa5546b3 100644 --- a/src/Bridge/Symfony/Resources/views/Form/datepicker.html.twig +++ b/src/Bridge/Symfony/Resources/views/Form/datepicker.html.twig @@ -14,7 +14,7 @@ file that was distributed with this source code. class="input-group date" id="dp_{{ id }}" data-controller="datepicker" - data-datepicker-options-value="{{ dp_options|json_encode|escape('html_attr') }}" + data-datepicker-options-value="{{ datepicker_options|json_encode|escape('html_attr') }}" > {% endif %} {% set attr = attr|merge({'data-date-format': moment_format}) %} @@ -41,17 +41,17 @@ file that was distributed with this source code. {% if datepicker_use_button %}
{% endif %} {% set attr = attr|merge({'data-date-format': moment_format}) %} {{ block('datetime_widget') }} {% if datepicker_use_button %} - +
{% endif %} diff --git a/src/Type/BasePickerType.php b/src/Type/BasePickerType.php index f3e3db57..7264dda6 100644 --- a/src/Type/BasePickerType.php +++ b/src/Type/BasePickerType.php @@ -109,23 +109,25 @@ public function finishView(FormView $view, FormInterface $form, array $options): $view->vars['type'] = 'text'; - $dpOptions = []; - foreach ($options as $key => $value) { - if (str_contains($key, 'dp_')) { - // We remove 'dp_' and camelize the options names - $dpKey = substr($key, 3); - $dpKey = preg_replace_callback( - '/_([a-z])/', - static fn (array $c): string => strtoupper($c[1]), - $dpKey - ); - - $dpOptions[$dpKey] = $value; - } - } + // $dpOptions = []; + // foreach ($options as $key => $value) { + // if (str_contains($key, 'dp_')) { + // // We remove 'dp_' and camelize the options names + // $dpKey = substr($key, 3); + // $dpKey = preg_replace_callback( + // '/_([a-z])/', + // static fn (array $c): string => strtoupper($c[1]), + // $dpKey + // ); + + // $dpOptions[$dpKey] = $value; + // } + // } $view->vars['datepicker_use_button'] = isset($options['datepicker_use_button']) && true === $options['datepicker_use_button']; - $view->vars['dp_options'] = $dpOptions; + + // Is this needed? + $view->vars['datepicker_options'] = $options['datepicker_options']; } public function getLocale(): string @@ -148,43 +150,87 @@ protected function getCommonDefaults(): array return [ 'widget' => 'single_text', 'datepicker_use_button' => true, - - 'dp_display' => [ - 'icons' => [ - 'time' => 'fas fa-clock', - 'date' => 'fas fa-calendar', - 'up' => 'fas fa-chevron-up', - 'down' => 'fas fa-chevron-down', - 'previous' => 'fas fa-chevron-left', - 'next' => 'fas fa-chevron-right', - 'today' => 'fas fa-calendar-check', - 'clear' => 'fas fa-trash', - 'close' => 'fas fa-xmark', - ], - 'components' => [ - 'decades' => true, - 'year' => true, - 'month' => true, - 'date' => true, - 'hours' => true, - 'minutes' => true, - 'seconds' => true, - ], - 'buttons' => [ - 'today' => true, - ], - 'sideBySide' => false, - 'calendarWeeks' => false, - 'viewMode' => 'calendar', - ], - 'dp_use_current' => true, - 'dp_restrictions' => [ - // 'minDate' => null, - // 'maxDate' => null, - 'disabledDates' => [], - 'enabledDates' => [], - 'daysOfWeekDisabled' => [], - ], + 'datepicker_options' => [ + // 'altFormat' => 'F j, Y', + // 'altInput' => false, + 'altInputClass' => 'test', + // 'allowInput' => false, + // 'allowValidPreload' => false, + // 'appendTo' => null, // HTML Element (incompatible) + // 'ariaDateFormat' => 'F j, Y', + // 'conjunction' => null, // string + // 'clickOpens' => true, + // 'dateFormat' => 'Y-m-d', + // 'defaultDate' => null, // string / Date / string[] / Date[] + // 'defaultHour' => 12, + // 'defaultMinute' => 0, + // 'disable' => [], // string[] / Date[] / array<{ from: string|Date, to: string|Date }> + // 'disableMobile' => false, + // 'enable' => [], + // 'enableTime' => false, + // 'enableSeconds' => false, + // 'formatDate' => null, // JS Function (incompatible) + // 'hourIncrement' => 1, + // 'inline' => false, + // 'maxDate' => null, // string | Date + // 'minDate' => null, // string | Date + // 'minuteIncrement' => 5, + // 'mode' => 'single', + // 'nextArrow' => '>', + // 'noCalendar' => false, // JS Function (incompatible) + // 'onChange' => null, // JS Function (incompatible) + // 'onClose' => null, // JS Function (incompatible) + // 'onOpen' => null, // JS Function (incompatible) + // 'onReady' => null, // JS Function (incompatible) + // 'parseDate' => null, // JS Function (incompatible) + // 'position' => 'auto', + // 'positionElement' => null, // HTML Element (incompatible) + // 'prevArrow' => '<', + // 'shorthandCurrentMonth' => false, + // 'static' => false, + // 'showMonths' => 1, + // 'time_24hr' => false, + // 'weekNumbers' => false, + // 'wrap' => false, + // 'monthSelectorType' => 'dropdown', + ] + + // 'dp_display' => [ + // 'icons' => [ + // 'time' => 'fas fa-clock', + // 'date' => 'fas fa-calendar', + // 'up' => 'fas fa-chevron-up', + // 'down' => 'fas fa-chevron-down', + // 'previous' => 'fas fa-chevron-left', + // 'next' => 'fas fa-chevron-right', + // 'today' => 'fas fa-calendar-check', + // 'clear' => 'fas fa-trash', + // 'close' => 'fas fa-xmark', + // ], + // 'components' => [ + // 'decades' => true, + // 'year' => true, + // 'month' => true, + // 'date' => true, + // 'hours' => true, + // 'minutes' => true, + // 'seconds' => true, + // ], + // 'buttons' => [ + // 'today' => true, + // ], + // 'sideBySide' => false, + // 'calendarWeeks' => false, + // 'viewMode' => 'calendar', + // ], + // 'dp_use_current' => true, + // 'dp_restrictions' => [ + // // 'minDate' => null, + // // 'maxDate' => null, + // 'disabledDates' => [], + // 'enabledDates' => [], + // 'daysOfWeekDisabled' => [], + // ], // 'dp_default_date' => null, // 'dp_language' => $this->locale, @@ -194,16 +240,16 @@ protected function getCommonDefaults(): array ]; } - private function formatObject(\DateTimeInterface $dateTime, string $format): string - { - $formatter = new \IntlDateFormatter($this->locale, \IntlDateFormatter::NONE, \IntlDateFormatter::NONE); - $formatter->setPattern($format); + // private function formatObject(\DateTimeInterface $dateTime, string $format): string + // { + // $formatter = new \IntlDateFormatter($this->locale, \IntlDateFormatter::NONE, \IntlDateFormatter::NONE); + // $formatter->setPattern($format); - $formatted = $formatter->format($dateTime); - if (!\is_string($formatted)) { - throw new \RuntimeException(sprintf('The format "%s" is invalid.', $format)); - } + // $formatted = $formatter->format($dateTime); + // if (!\is_string($formatted)) { + // throw new \RuntimeException(sprintf('The format "%s" is invalid.', $format)); + // } - return $formatted; - } + // return $formatted; + // } } diff --git a/src/Type/DatePickerType.php b/src/Type/DatePickerType.php index 30578392..1a3584f4 100644 --- a/src/Type/DatePickerType.php +++ b/src/Type/DatePickerType.php @@ -25,9 +25,9 @@ public function configureOptions(OptionsResolver $resolver): void { $defaults = $this->getCommonDefaults(); - $defaults['dp_display']['components']['hours'] = false; - $defaults['dp_display']['components']['minutes'] = false; - $defaults['dp_display']['components']['seconds'] = false; + // $defaults['dp_display']['components']['hours'] = false; + // $defaults['dp_display']['components']['minutes'] = false; + // $defaults['dp_display']['components']['seconds'] = false; $defaults['format'] = DateType::DEFAULT_FORMAT; $defaults['html5'] = false; diff --git a/src/Type/DateRangePickerType.php b/src/Type/DateRangePickerType.php index 4c3ab050..0049ac6b 100644 --- a/src/Type/DateRangePickerType.php +++ b/src/Type/DateRangePickerType.php @@ -28,7 +28,7 @@ public function configureOptions(OptionsResolver $resolver): void 'field_options' => [], 'field_options_start' => [], 'field_options_end' => [ - 'dp_use_current' => false, + // 'dp_use_current' => false, ], 'field_type' => DatePickerType::class, ]); diff --git a/src/Type/DateTimePickerType.php b/src/Type/DateTimePickerType.php index d7e60cc5..9438f738 100644 --- a/src/Type/DateTimePickerType.php +++ b/src/Type/DateTimePickerType.php @@ -26,6 +26,9 @@ public function configureOptions(OptionsResolver $resolver): void $defaults = $this->getCommonDefaults(); // $defaults['dp_minute_stepping'] = 1; + $defaults['datepicker_options']['enableTime'] = true; + $defaults['datepicker_options']['enableSeconds'] = true; + $defaults['format'] = DateTimeType::DEFAULT_DATE_FORMAT; $defaults['date_format'] = null; $defaults['html5'] = false; diff --git a/src/Type/DateTimeRangePickerType.php b/src/Type/DateTimeRangePickerType.php index b1ff4728..68efe59c 100644 --- a/src/Type/DateTimeRangePickerType.php +++ b/src/Type/DateTimeRangePickerType.php @@ -28,7 +28,7 @@ public function configureOptions(OptionsResolver $resolver): void 'field_options' => [], 'field_options_start' => [], 'field_options_end' => [ - 'dp_use_current' => false, + // 'dp_use_current' => false, ], 'field_type' => DateTimePickerType::class, ]);