react-timezone-range-picker 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/StartEndTimePanel/index.d.ts.map +1 -1
- package/dist/index.cjs.js +11 -11
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +301 -303
- package/dist/index.es.js.map +1 -1
- package/dist/util/dateTime.d.ts +2 -2
- package/dist/util/dateTime.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/StartEndTimePanel/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAa3B,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAKxC,UAAU,kBAAkB;IAC1B,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,QAAA,MAAM,iBAAiB,EAAE,EAAE,CAAC,kBAAkB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/StartEndTimePanel/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAa3B,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAKxC,UAAU,kBAAkB;IAC1B,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,QAAA,MAAM,iBAAiB,EAAE,EAAE,CAAC,kBAAkB,CA2G7C,CAAC;AAEF,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
|
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react"),w=require("@mantine/core"),oe=require("@mantine/dates");function
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react"),w=require("@mantine/core"),oe=require("@mantine/dates");function Ee(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var be={exports:{}},ue={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var Re;function dt(){if(Re)return ue;Re=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,s,i){var a=null;if(i!==void 0&&(a=""+i),s.key!==void 0&&(a=""+s.key),"key"in s){i={};for(var c in s)c!=="key"&&(i[c]=s[c])}else i=s;return s=i.ref,{$$typeof:e,type:n,key:a,ref:s!==void 0?s:null,props:i}}return ue.Fragment=t,ue.jsx=r,ue.jsxs=r,ue}var le={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var Ye;function ft(){return Ye||(Ye=1,process.env.NODE_ENV!=="production"&&(function(){function e(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===
|
|
17
|
+
*/var Ye;function ft(){return Ye||(Ye=1,process.env.NODE_ENV!=="production"&&(function(){function e(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===z?null:o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case b:return"Fragment";case S:return"Profiler";case y:return"StrictMode";case Y:return"Suspense";case $:return"SuspenseList";case N:return"Activity"}if(typeof o=="object")switch(typeof o.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),o.$$typeof){case O:return"Portal";case R:return(o.displayName||"Context")+".Provider";case C:return(o._context.displayName||"Context")+".Consumer";case K:var x=o.render;return o=o.displayName,o||(o=x.displayName||x.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case V:return x=o.displayName||null,x!==null?x:e(o.type)||"Memo";case L:x=o._payload,o=o._init;try{return e(o(x))}catch{}}return null}function t(o){return""+o}function r(o){try{t(o);var x=!1}catch{x=!0}if(x){x=console;var M=x.error,I=typeof Symbol=="function"&&Symbol.toStringTag&&o[Symbol.toStringTag]||o.constructor.name||"Object";return M.call(x,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",I),t(o)}}function n(o){if(o===b)return"<>";if(typeof o=="object"&&o!==null&&o.$$typeof===L)return"<...>";try{var x=e(o);return x?"<"+x+">":"<...>"}catch{return"<...>"}}function s(){var o=A.A;return o===null?null:o.getOwner()}function i(){return Error("react-stack-top-frame")}function a(o){if(Q.call(o,"key")){var x=Object.getOwnPropertyDescriptor(o,"key").get;if(x&&x.isReactWarning)return!1}return o.key!==void 0}function c(o,x){function M(){v||(v=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",x))}M.isReactWarning=!0,Object.defineProperty(o,"key",{get:M,configurable:!0})}function u(){var o=e(this.type);return h[o]||(h[o]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),o=this.props.ref,o!==void 0?o:null}function m(o,x,M,I,q,H,X,p){return M=H.ref,o={$$typeof:P,type:o,key:x,props:H,_owner:q},(M!==void 0?M:null)!==null?Object.defineProperty(o,"ref",{enumerable:!1,get:u}):Object.defineProperty(o,"ref",{enumerable:!1,value:null}),o._store={},Object.defineProperty(o._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(o,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(o,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:X}),Object.defineProperty(o,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:p}),Object.freeze&&(Object.freeze(o.props),Object.freeze(o)),o}function D(o,x,M,I,q,H,X,p){var _=x.children;if(_!==void 0)if(I)if(re(_)){for(I=0;I<_.length;I++)g(_[I]);Object.freeze&&Object.freeze(_)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else g(_);if(Q.call(x,"key")){_=e(o);var W=Object.keys(x).filter(function(Z){return Z!=="key"});I=0<W.length?"{key: someKey, "+W.join(": ..., ")+": ...}":"{key: someKey}",F[_+I]||(W=0<W.length?"{"+W.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
18
|
let props = %s;
|
|
19
19
|
<%s {...props} />
|
|
20
20
|
React keys must be passed directly to JSX without using spread:
|
|
21
21
|
let props = %s;
|
|
22
|
-
<%s key={someKey} {...props} />`,I,_,W,_),F[_+I]=!0)}if(_=null,M!==void 0&&(r(M),_=""+M),a(
|
|
22
|
+
<%s key={someKey} {...props} />`,I,_,W,_),F[_+I]=!0)}if(_=null,M!==void 0&&(r(M),_=""+M),a(x)&&(r(x.key),_=""+x.key),"key"in x){M={};for(var U in x)U!=="key"&&(M[U]=x[U])}else M=x;return _&&c(M,typeof o=="function"?o.displayName||o.name||"Unknown":o),m(o,_,H,q,s(),M,X,p)}function g(o){typeof o=="object"&&o!==null&&o.$$typeof===P&&o._store&&(o._store.validated=1)}var j=f,P=Symbol.for("react.transitional.element"),O=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),R=Symbol.for("react.context"),K=Symbol.for("react.forward_ref"),Y=Symbol.for("react.suspense"),$=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),N=Symbol.for("react.activity"),z=Symbol.for("react.client.reference"),A=j.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q=Object.prototype.hasOwnProperty,re=Array.isArray,E=console.createTask?console.createTask:function(){return null};j={react_stack_bottom_frame:function(o){return o()}};var v,h={},k=j.react_stack_bottom_frame.bind(j,i)(),T=E(n(i)),F={};le.Fragment=b,le.jsx=function(o,x,M,I,q){var H=1e4>A.recentlyCreatedOwnerStacks++;return D(o,x,M,!1,I,q,H?Error("react-stack-top-frame"):k,H?E(n(o)):T)},le.jsxs=function(o,x,M,I,q){var H=1e4>A.recentlyCreatedOwnerStacks++;return D(o,x,M,!0,I,q,H?Error("react-stack-top-frame"):k,H?E(n(o)):T)}})()),le}var Ke;function mt(){return Ke||(Ke=1,process.env.NODE_ENV==="production"?be.exports=dt():be.exports=ft()),be.exports}var d=mt();function ht(e,t){var r=f.useRef(!1),n=f.useRef(),s=f.useRef(e),i=f.useCallback(function(){return r.current},[]),a=f.useCallback(function(){r.current=!1,n.current&&clearTimeout(n.current),n.current=setTimeout(function(){r.current=!0,s.current()},t)},[t]),c=f.useCallback(function(){r.current=null,n.current&&clearTimeout(n.current)},[]);return f.useEffect(function(){s.current=e},[e]),f.useEffect(function(){return a(),c},[t]),[i,c,a]}function tt(e,t,r){r===void 0&&(r=[]);var n=ht(e,t),s=n[0],i=n[1],a=n[2];return f.useEffect(a,r),[s,i]}function rt(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=rt(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function nt(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=rt(e))&&(n&&(n+=" "),n+=t);return n}const yt="_row_550mo_1",de={row:yt,"row-dark":"_row-dark_550mo_5","row-light":"_row-light_550mo_12","row-selected-dark":"_row-selected-dark_550mo_19","row-selected-light":"_row-selected-light_550mo_27"},Ie=()=>{const{colorScheme:e}=w.useMantineColorScheme(),t=w.useMantineTheme();return{colorScheme:e,theme:t}},Ue=({name:e,longName:t,currentTime:r,utcOffset:n,selectedTimezone:s,isBrowserTimezone:i=!1,handleTimezoneMouseClick:a=void 0})=>{const{colorScheme:c}=Ie(),u=()=>{i||a({name:e,longName:t,utcOffset:n})};return d.jsxs(w.Flex,{direction:"column",className:nt(de.row,i?void 0:c==="dark"?de["row-dark"]:de["row-light"],s?.name===e?c==="dark"?de["row-selected-dark"]:de["row-selected-light"]:void 0),onClick:u,children:[d.jsxs(w.Flex,{justify:"space-between",children:[d.jsx(w.Text,{size:"sm",children:e}),d.jsxs(w.Text,{size:"sm",children:[r," • UTC",n]})]}),d.jsx(w.Text,{size:"sm",children:t})]})};/**
|
|
23
23
|
* @license @tabler/icons-react v3.35.0 - MIT
|
|
24
24
|
*
|
|
25
25
|
* This source code is licensed under the MIT license.
|
|
@@ -29,35 +29,35 @@ React keys must be passed directly to JSX without using spread:
|
|
|
29
29
|
*
|
|
30
30
|
* This source code is licensed under the MIT license.
|
|
31
31
|
* See the LICENSE file in the root directory of this source tree.
|
|
32
|
-
*/const
|
|
32
|
+
*/const ce=(e,t,r,n)=>{const s=f.forwardRef(({color:i="currentColor",size:a=24,stroke:c=2,title:u,className:m,children:D,...g},j)=>f.createElement("svg",{ref:j,...Tt[e],width:a,height:a,className:["tabler-icon",`tabler-icon-${t}`,m].join(" "),...e==="filled"?{fill:i}:{strokeWidth:c,stroke:i},...g},[u&&f.createElement("title",{key:"svg-title"},u),...n.map(([P,O])=>f.createElement(P,O)),...Array.isArray(D)?D:[D]]));return s.displayName=`${r}`,s};/**
|
|
33
33
|
* @license @tabler/icons-react v3.35.0 - MIT
|
|
34
34
|
*
|
|
35
35
|
* This source code is licensed under the MIT license.
|
|
36
36
|
* See the LICENSE file in the root directory of this source tree.
|
|
37
|
-
*/const pt=[["path",{d:"M4 7a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12z",key:"svg-0"}],["path",{d:"M16 3v4",key:"svg-1"}],["path",{d:"M8 3v4",key:"svg-2"}],["path",{d:"M4 11h16",key:"svg-3"}],["path",{d:"M11 15h1",key:"svg-4"}],["path",{d:"M12 15v3",key:"svg-5"}]],
|
|
37
|
+
*/const pt=[["path",{d:"M4 7a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12z",key:"svg-0"}],["path",{d:"M16 3v4",key:"svg-1"}],["path",{d:"M8 3v4",key:"svg-2"}],["path",{d:"M4 11h16",key:"svg-3"}],["path",{d:"M11 15h1",key:"svg-4"}],["path",{d:"M12 15v3",key:"svg-5"}]],Ce=ce("outline","calendar","Calendar",pt);/**
|
|
38
38
|
* @license @tabler/icons-react v3.35.0 - MIT
|
|
39
39
|
*
|
|
40
40
|
* This source code is licensed under the MIT license.
|
|
41
41
|
* See the LICENSE file in the root directory of this source tree.
|
|
42
|
-
*/const bt=[["path",{d:"M9 6l6 6l-6 6",key:"svg-0"}]],
|
|
42
|
+
*/const bt=[["path",{d:"M9 6l6 6l-6 6",key:"svg-0"}]],_e=ce("outline","chevron-right","ChevronRight",bt);/**
|
|
43
43
|
* @license @tabler/icons-react v3.35.0 - MIT
|
|
44
44
|
*
|
|
45
45
|
* This source code is licensed under the MIT license.
|
|
46
46
|
* See the LICENSE file in the root directory of this source tree.
|
|
47
|
-
*/const vt=[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M12 7v5l3 3",key:"svg-1"}]],
|
|
47
|
+
*/const vt=[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M12 7v5l3 3",key:"svg-1"}]],we=ce("outline","clock","Clock",vt);/**
|
|
48
48
|
* @license @tabler/icons-react v3.35.0 - MIT
|
|
49
49
|
*
|
|
50
50
|
* This source code is licensed under the MIT license.
|
|
51
51
|
* See the LICENSE file in the root directory of this source tree.
|
|
52
|
-
*/const
|
|
52
|
+
*/const xt=[["path",{d:"M4 6h16",key:"svg-0"}],["path",{d:"M6 12h12",key:"svg-1"}],["path",{d:"M9 18h6",key:"svg-2"}]],gt=ce("outline","filter-2","Filter2",xt);/**
|
|
53
53
|
* @license @tabler/icons-react v3.35.0 - MIT
|
|
54
54
|
*
|
|
55
55
|
* This source code is licensed under the MIT license.
|
|
56
56
|
* See the LICENSE file in the root directory of this source tree.
|
|
57
|
-
*/const St=[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M3.6 9h16.8",key:"svg-1"}],["path",{d:"M3.6 15h16.8",key:"svg-2"}],["path",{d:"M11.5 3a17 17 0 0 0 0 18",key:"svg-3"}],["path",{d:"M12.5 3a17 17 0 0 1 0 18",key:"svg-4"}]],$t=
|
|
57
|
+
*/const St=[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M3.6 9h16.8",key:"svg-1"}],["path",{d:"M3.6 15h16.8",key:"svg-2"}],["path",{d:"M11.5 3a17 17 0 0 0 0 18",key:"svg-3"}],["path",{d:"M12.5 3a17 17 0 0 1 0 18",key:"svg-4"}]],$t=ce("outline","world","World",St);/**
|
|
58
58
|
* @license @tabler/icons-react v3.35.0 - MIT
|
|
59
59
|
*
|
|
60
60
|
* This source code is licensed under the MIT license.
|
|
61
61
|
* See the LICENSE file in the root directory of this source tree.
|
|
62
|
-
*/const kt=[["path",{d:"M16 2c.183 0 .355 .05 .502 .135l.033 .02c.28 .177 .465 .49 .465 .845v1h1a3 3 0 0 1 2.995 2.824l.005 .176v12a3 3 0 0 1 -2.824 2.995l-.176 .005h-12a3 3 0 0 1 -2.995 -2.824l-.005 -.176v-12a3 3 0 0 1 2.824 -2.995l.176 -.005h1v-1a1 1 0 0 1 .514 -.874l.093 -.046l.066 -.025l.1 -.029l.107 -.019l.12 -.007q .083 0 .161 .013l.122 .029l.04 .012l.06 .023c.328 .135 .568 .44 .61 .806l.007 .117v1h6v-1a1 1 0 0 1 1 -1m3 7h-14v9.625c0 .705 .386 1.286 .883 1.366l.117 .009h12c.513 0 .936 -.53 .993 -1.215l.007 -.16z",key:"svg-0"}],["path",{d:"M9.015 13a1 1 0 0 1 -1 1a1.001 1.001 0 1 1 -.005 -2c.557 0 1.005 .448 1.005 1",key:"svg-1"}],["path",{d:"M13.015 13a1 1 0 0 1 -1 1a1.001 1.001 0 1 1 -.005 -2c.557 0 1.005 .448 1.005 1",key:"svg-2"}],["path",{d:"M17.02 13a1 1 0 0 1 -1 1a1.001 1.001 0 1 1 -.005 -2c.557 0 1.005 .448 1.005 1",key:"svg-3"}],["path",{d:"M12.02 15a1 1 0 0 1 0 2a1.001 1.001 0 1 1 -.005 -2z",key:"svg-4"}],["path",{d:"M9.015 16a1 1 0 0 1 -1 1a1.001 1.001 0 1 1 -.005 -2c.557 0 1.005 .448 1.005 1",key:"svg-5"}]],Dt=ae("filled","calendar-week-filled","CalendarWeekFilled",kt),jt=({searchText:e,setSearchText:t})=>l.jsx(w.Input,{placeholder:"Timezone search (Asia, Tokyo, +09:00, etc)",leftSection:l.jsx(xt,{stroke:2}),value:e,onChange:r=>t(r.currentTarget.value)});var De={exports:{}},wt=De.exports,We;function Et(){return We||(We=1,(function(e,t){(function(r,n){e.exports=n()})(wt,(function(){var r=1e3,n=6e4,s=36e5,i="millisecond",a="second",c="minute",u="hour",m="day",D="week",x="month",j="quarter",P="year",O="date",b="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,S=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,C={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(E){var v=["th","st","nd","rd"],h=E%100;return"["+E+(v[(h-20)%10]||v[h]||v[0])+"]"}},z=function(E,v,h){var k=String(E);return!k||k.length>=v?E:""+Array(v+1-k.length).join(h)+E},K={s:z,z:function(E){var v=-E.utcOffset(),h=Math.abs(v),k=Math.floor(h/60),T=h%60;return(v<=0?"+":"-")+z(k,2,"0")+":"+z(T,2,"0")},m:function E(v,h){if(v.date()<h.date())return-E(h,v);var k=12*(h.year()-v.year())+(h.month()-v.month()),T=v.clone().add(k,x),F=h-T<0,o=v.clone().add(k+(F?-1:1),x);return+(-(k+(h-T)/(F?T-o:o-T))||0)},a:function(E){return E<0?Math.ceil(E)||0:Math.floor(E)},p:function(E){return{M:x,y:P,w:D,d:m,D:O,h:u,m:c,s:a,ms:i,Q:j}[E]||String(E||"").toLowerCase().replace(/s$/,"")},u:function(E){return E===void 0}},Y="en",$={};$[Y]=C;var V="$isDayjsObject",L=function(E){return E instanceof Q||!(!E||!E[V])},N=function E(v,h,k){var T;if(!v)return Y;if(typeof v=="string"){var F=v.toLowerCase();$[F]&&(T=F),h&&($[F]=h,T=F);var o=v.split("-");if(!T&&o.length>1)return E(o[0])}else{var g=v.name;$[g]=v,T=g}return!k&&T&&(Y=T),T||!k&&Y},R=function(E,v){if(L(E))return E.clone();var h=typeof v=="object"?v:{};return h.date=E,h.args=arguments,new Q(h)},A=K;A.l=N,A.i=L,A.w=function(E,v){return R(E,{locale:v.$L,utc:v.$u,x:v.$x,$offset:v.$offset})};var Q=(function(){function E(h){this.$L=N(h.locale,null,!0),this.parse(h),this.$x=this.$x||h.x||{},this[V]=!0}var v=E.prototype;return v.parse=function(h){this.$d=(function(k){var T=k.date,F=k.utc;if(T===null)return new Date(NaN);if(A.u(T))return new Date;if(T instanceof Date)return new Date(T);if(typeof T=="string"&&!/Z$/i.test(T)){var o=T.match(y);if(o){var g=o[2]-1||0,M=(o[7]||"0").substring(0,3);return F?new Date(Date.UTC(o[1],g,o[3]||1,o[4]||0,o[5]||0,o[6]||0,M)):new Date(o[1],g,o[3]||1,o[4]||0,o[5]||0,o[6]||0,M)}}return new Date(T)})(h),this.init()},v.init=function(){var h=this.$d;this.$y=h.getFullYear(),this.$M=h.getMonth(),this.$D=h.getDate(),this.$W=h.getDay(),this.$H=h.getHours(),this.$m=h.getMinutes(),this.$s=h.getSeconds(),this.$ms=h.getMilliseconds()},v.$utils=function(){return A},v.isValid=function(){return this.$d.toString()!==b},v.isSame=function(h,k){var T=R(h);return this.startOf(k)<=T&&T<=this.endOf(k)},v.isAfter=function(h,k){return R(h)<this.startOf(k)},v.isBefore=function(h,k){return this.endOf(k)<R(h)},v.$g=function(h,k,T){return A.u(h)?this[k]:this.set(T,h)},v.unix=function(){return Math.floor(this.valueOf()/1e3)},v.valueOf=function(){return this.$d.getTime()},v.startOf=function(h,k){var T=this,F=!!A.u(k)||k,o=A.p(h),g=function(W,U){var Z=A.w(T.$u?Date.UTC(T.$y,U,W):new Date(T.$y,U,W),T);return F?Z:Z.endOf(m)},M=function(W,U){return A.w(T.toDate()[W].apply(T.toDate("s"),(F?[0,0,0,0]:[23,59,59,999]).slice(U)),T)},I=this.$W,q=this.$M,H=this.$D,X="set"+(this.$u?"UTC":"");switch(o){case P:return F?g(1,0):g(31,11);case x:return F?g(1,q):g(0,q+1);case D:var p=this.$locale().weekStart||0,_=(I<p?I+7:I)-p;return g(F?H-_:H+(6-_),q);case m:case O:return M(X+"Hours",0);case u:return M(X+"Minutes",1);case c:return M(X+"Seconds",2);case a:return M(X+"Milliseconds",3);default:return this.clone()}},v.endOf=function(h){return this.startOf(h,!1)},v.$set=function(h,k){var T,F=A.p(h),o="set"+(this.$u?"UTC":""),g=(T={},T[m]=o+"Date",T[O]=o+"Date",T[x]=o+"Month",T[P]=o+"FullYear",T[u]=o+"Hours",T[c]=o+"Minutes",T[a]=o+"Seconds",T[i]=o+"Milliseconds",T)[F],M=F===m?this.$D+(k-this.$W):k;if(F===x||F===P){var I=this.clone().set(O,1);I.$d[g](M),I.init(),this.$d=I.set(O,Math.min(this.$D,I.daysInMonth())).$d}else g&&this.$d[g](M);return this.init(),this},v.set=function(h,k){return this.clone().$set(h,k)},v.get=function(h){return this[A.p(h)]()},v.add=function(h,k){var T,F=this;h=Number(h);var o=A.p(k),g=function(q){var H=R(F);return A.w(H.date(H.date()+Math.round(q*h)),F)};if(o===x)return this.set(x,this.$M+h);if(o===P)return this.set(P,this.$y+h);if(o===m)return g(1);if(o===D)return g(7);var M=(T={},T[c]=n,T[u]=s,T[a]=r,T)[o]||1,I=this.$d.getTime()+h*M;return A.w(I,this)},v.subtract=function(h,k){return this.add(-1*h,k)},v.format=function(h){var k=this,T=this.$locale();if(!this.isValid())return T.invalidDate||b;var F=h||"YYYY-MM-DDTHH:mm:ssZ",o=A.z(this),g=this.$H,M=this.$m,I=this.$M,q=T.weekdays,H=T.months,X=T.meridiem,p=function(U,Z,ee,G){return U&&(U[Z]||U(k,F))||ee[Z].slice(0,G)},_=function(U){return A.s(g%12||12,U,"0")},W=X||function(U,Z,ee){var G=U<12?"AM":"PM";return ee?G.toLowerCase():G};return F.replace(S,(function(U,Z){return Z||(function(ee){switch(ee){case"YY":return String(k.$y).slice(-2);case"YYYY":return A.s(k.$y,4,"0");case"M":return I+1;case"MM":return A.s(I+1,2,"0");case"MMM":return p(T.monthsShort,I,H,3);case"MMMM":return p(H,I);case"D":return k.$D;case"DD":return A.s(k.$D,2,"0");case"d":return String(k.$W);case"dd":return p(T.weekdaysMin,k.$W,q,2);case"ddd":return p(T.weekdaysShort,k.$W,q,3);case"dddd":return q[k.$W];case"H":return String(g);case"HH":return A.s(g,2,"0");case"h":return _(1);case"hh":return _(2);case"a":return W(g,M,!0);case"A":return W(g,M,!1);case"m":return String(M);case"mm":return A.s(M,2,"0");case"s":return String(k.$s);case"ss":return A.s(k.$s,2,"0");case"SSS":return A.s(k.$ms,3,"0");case"Z":return o}return null})(U)||o.replace(":","")}))},v.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},v.diff=function(h,k,T){var F,o=this,g=A.p(k),M=R(h),I=(M.utcOffset()-this.utcOffset())*n,q=this-M,H=function(){return A.m(o,M)};switch(g){case P:F=H()/12;break;case x:F=H();break;case j:F=H()/3;break;case D:F=(q-I)/6048e5;break;case m:F=(q-I)/864e5;break;case u:F=q/s;break;case c:F=q/n;break;case a:F=q/r;break;default:F=q}return T?F:A.a(F)},v.daysInMonth=function(){return this.endOf(x).$D},v.$locale=function(){return $[this.$L]},v.locale=function(h,k){if(!h)return this.$L;var T=this.clone(),F=N(h,k,!0);return F&&(T.$L=F),T},v.clone=function(){return A.w(this.$d,this)},v.toDate=function(){return new Date(this.valueOf())},v.toJSON=function(){return this.isValid()?this.toISOString():null},v.toISOString=function(){return this.$d.toISOString()},v.toString=function(){return this.$d.toUTCString()},E})(),re=Q.prototype;return R.prototype=re,[["$ms",i],["$s",a],["$m",c],["$H",u],["$W",m],["$M",x],["$y",P],["$D",O]].forEach((function(E){re[E[1]]=function(v){return this.$g(v,E[0],E[1])}})),R.extend=function(E,v){return E.$i||(E(v,Q,R),E.$i=!0),R},R.locale=N,R.isDayjs=L,R.unix=function(E){return R(1e3*E)},R.en=$[Y],R.Ls=$,R.p={},R}))})(De)),De.exports}var _t=Et();const d=_e(_t);var je={exports:{}},Ot=je.exports,qe;function Ct(){return qe||(qe=1,(function(e,t){(function(r,n){e.exports=n()})(Ot,(function(){var r="minute",n=/[+-]\d\d(?::?\d\d)?/g,s=/([+-]|\d\d)/g;return function(i,a,c){var u=a.prototype;c.utc=function(b){var y={date:b,utc:!0,args:arguments};return new a(y)},u.utc=function(b){var y=c(this.toDate(),{locale:this.$L,utc:!0});return b?y.add(this.utcOffset(),r):y},u.local=function(){return c(this.toDate(),{locale:this.$L,utc:!1})};var m=u.parse;u.parse=function(b){b.utc&&(this.$u=!0),this.$utils().u(b.$offset)||(this.$offset=b.$offset),m.call(this,b)};var D=u.init;u.init=function(){if(this.$u){var b=this.$d;this.$y=b.getUTCFullYear(),this.$M=b.getUTCMonth(),this.$D=b.getUTCDate(),this.$W=b.getUTCDay(),this.$H=b.getUTCHours(),this.$m=b.getUTCMinutes(),this.$s=b.getUTCSeconds(),this.$ms=b.getUTCMilliseconds()}else D.call(this)};var x=u.utcOffset;u.utcOffset=function(b,y){var S=this.$utils().u;if(S(b))return this.$u?0:S(this.$offset)?x.call(this):this.$offset;if(typeof b=="string"&&(b=(function(Y){Y===void 0&&(Y="");var $=Y.match(n);if(!$)return null;var V=(""+$[0]).match(s)||["-",0,0],L=V[0],N=60*+V[1]+ +V[2];return N===0?0:L==="+"?N:-N})(b),b===null))return this;var C=Math.abs(b)<=16?60*b:b;if(C===0)return this.utc(y);var z=this.clone();if(y)return z.$offset=C,z.$u=!1,z;var K=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(z=this.local().add(C+K,r)).$offset=C,z.$x.$localOffset=K,z};var j=u.format;u.format=function(b){var y=b||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return j.call(this,y)},u.valueOf=function(){var b=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*b},u.isUTC=function(){return!!this.$u},u.toISOString=function(){return this.toDate().toISOString()},u.toString=function(){return this.toDate().toUTCString()};var P=u.toDate;u.toDate=function(b){return b==="s"&&this.$offset?c(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():P.call(this)};var O=u.diff;u.diff=function(b,y,S){if(b&&this.$u===b.$u)return O.call(this,b,y,S);var C=this.local(),z=c(b).local();return O.call(C,z,y,S)}}}))})(je)),je.exports}var Mt=Ct();const Ft=_e(Mt);var we={exports:{}},Pt=we.exports,Ne;function Vt(){return Ne||(Ne=1,(function(e,t){(function(r,n){e.exports=n()})(Pt,(function(){var r={year:0,month:1,day:2,hour:3,minute:4,second:5},n={};return function(s,i,a){var c,u=function(j,P,O){O===void 0&&(O={});var b=new Date(j),y=(function(S,C){C===void 0&&(C={});var z=C.timeZoneName||"short",K=S+"|"+z,Y=n[K];return Y||(Y=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:S,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:z}),n[K]=Y),Y})(P,O);return y.formatToParts(b)},m=function(j,P){for(var O=u(j,P),b=[],y=0;y<O.length;y+=1){var S=O[y],C=S.type,z=S.value,K=r[C];K>=0&&(b[K]=parseInt(z,10))}var Y=b[3],$=Y===24?0:Y,V=b[0]+"-"+b[1]+"-"+b[2]+" "+$+":"+b[4]+":"+b[5]+":000",L=+j;return(a.utc(V).valueOf()-(L-=L%1e3))/6e4},D=i.prototype;D.tz=function(j,P){j===void 0&&(j=c);var O,b=this.utcOffset(),y=this.toDate(),S=y.toLocaleString("en-US",{timeZone:j}),C=Math.round((y-new Date(S))/1e3/60),z=15*-Math.round(y.getTimezoneOffset()/15)-C;if(!Number(z))O=this.utcOffset(0,P);else if(O=a(S,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(z,!0),P){var K=O.utcOffset();O=O.add(b-K,"minute")}return O.$x.$timezone=j,O},D.offsetName=function(j){var P=this.$x.$timezone||a.tz.guess(),O=u(this.valueOf(),P,{timeZoneName:j}).find((function(b){return b.type.toLowerCase()==="timezonename"}));return O&&O.value};var x=D.startOf;D.startOf=function(j,P){if(!this.$x||!this.$x.$timezone)return x.call(this,j,P);var O=a(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return x.call(O,j,P).tz(this.$x.$timezone,!0)},a.tz=function(j,P,O){var b=O&&P,y=O||P||c,S=m(+a(),y);if(typeof j!="string")return a(j).tz(y);var C=(function($,V,L){var N=$-60*V*1e3,R=m(N,L);if(V===R)return[N,V];var A=m(N-=60*(R-V)*1e3,L);return R===A?[N,R]:[$-60*Math.min(R,A)*1e3,Math.max(R,A)]})(a.utc(j,b).valueOf(),S,y),z=C[0],K=C[1],Y=a(z).utcOffset(K);return Y.$x.$timezone=y,Y},a.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},a.tz.setDefault=function(j){c=j}}}))})(we)),we.exports}var At=Vt();const It=_e(At),Lt=(e,t="en-US")=>new Intl.DateTimeFormat(t,{timeZone:e,timeZoneName:"long"}).formatToParts(new Date).find(r=>r.type==="timeZoneName")?.value||"",Rt=e=>{const t=e[0]==="-"?-1:1,[r,n]=e.slice(1).split(":").map(Number);return t*(r*60+n)};d.extend(Ft);d.extend(It);const zt=()=>Intl.supportedValuesOf("timeZone").map(t=>{const r=d().tz(t).format("Z");return{name:t,longName:Lt(t),currentTime:d().tz(t).format("h:mm A"),utcOffset:r,offsetMinutes:Rt(r)}}).sort((t,r)=>t.offsetMinutes-r.offsetMinutes),Yt={"list-container":"_list-container_jrnm0_5"},Le={"form-container":"_form-container_1xxf4_1"},st=f.createContext(void 0),ot=()=>{const e=f.useContext(st);if(!e)throw new Error("usePopoverContext must be used within a PopoverProvider");return e},Kt=({children:e})=>{const[t,r]=f.useState(!1),n=()=>{r(!1)};return l.jsx(st.Provider,{value:{popoverOpened:t,setPopoverOpened:r,closePopover:n},children:e})},Re=()=>{const{theme:e}=Ie(),{closePopover:t}=ot();return l.jsx(w.Flex,{justify:"flex-end",children:l.jsxs(w.Flex,{columnGap:16,children:[l.jsx(w.Button,{size:"xs",variant:"subtle",color:e.primaryColor,onClick:t,children:"Cancel"}),l.jsx(w.Button,{type:"submit",size:"xs",color:e.primaryColor,children:"Apply"})]})})},te="YYYY/MM/DD",Te="HH:mm:ss",fe=()=>d().format(Te),it=()=>d().format(te),Ut=e=>d().add(e,"day").format(te),Wt=e=>e&&d().tz(e).format("Z"),qt=e=>`${d(e.startDate).format(te)} ${e.startTime} - ${d(e.endDate).format(te)} ${e.endTime} (${Wt(e.timezone.name)})`,ne=(e,t,r,n)=>{const s=d(`${e} ${t}`).subtract(r,n);return{date:s.format(te),time:s.format(Te)}},se=(e,t,r,n)=>{const s=d(`${e} ${t}`).add(r,n);return{date:s.format(te),time:s.format(Te)}},he=(e,t,r)=>d.tz(`${e} ${t}`,`${te} ${Te}`,r).utc().toISOString(),ye=(e,t)=>{const r=d.utc(e).tz(t);return{date:r.format(te),time:r.format(Te)}},at=({tzRange:e})=>{const[t,r]=f.useState(e.timezone),[n,s]=f.useState([]),[i,a]=f.useState(""),c=f.useMemo(()=>zt(),[]);f.useEffect(()=>{s(c)},[]),tt(()=>{if(i===""){s(c);return}s(c.filter(x=>x.name.toLowerCase().includes(i.toLocaleLowerCase())||x.longName.toLowerCase().includes(i.toLocaleLowerCase())||x.currentTime.toLowerCase().includes(i.toLocaleLowerCase())||x.utcOffset.toLowerCase().includes(i.toLocaleLowerCase())))},250,[i]);const u=x=>{r(x)},m=x=>{if(x.preventDefault(),!t?.name||!e.timezone.name||!e.startDate||!e.startTime||!e.endDate||!e.endTime)return;const j=he(e.startDate,e.startTime,e.timezone.name),P=he(e.endDate,e.endTime,e.timezone.name),O=ye(j,t.name),b=ye(P,t.name);e.onApply({startDate:O.date,startTime:O.time,endDate:b.date,endTime:b.time,timezone:t||{name:null,longName:null,utcOffset:null}})},D=x=>x?d().tz(x).format("h:mm A"):"";return l.jsxs("form",{className:Le["form-container"],onSubmit:m,children:[l.jsxs(w.Flex,{direction:"column",style:{height:"calc(100% - 40px)"},children:[l.jsx(w.Box,{style:{width:"95%"},mx:"auto",children:l.jsx(jt,{searchText:i,setSearchText:a})}),l.jsxs(w.Box,{style:{overflowY:"scroll"},children:[l.jsx(w.Text,{fw:600,px:12,children:"My Location"}),l.jsx(w.Flex,{direction:"column",children:l.jsx(Ue,{isBrowserTimezone:!0,name:e.timezone?.name,longName:e.timezone?.longName,currentTime:D(e.timezone?.name),utcOffset:e.timezone?.utcOffset,selectedTimezone:t})}),l.jsx(w.Text,{fw:600,px:12,children:"Locations"}),l.jsx(w.Flex,{direction:"column",className:Yt["list-container"],children:n.map((x,j)=>l.jsx(Ue,{name:x.name,longName:x.longName,currentTime:x.currentTime,utcOffset:x.utcOffset,selectedTimezone:t,handleTimezoneMouseClick:u},j))})]})]}),l.jsx(w.Box,{px:12,children:l.jsx(Re,{})})]})},ge={"sidebar-container":"_sidebar-container_e18ka_1","sidebar-row":"_sidebar-row_e18ka_5"},He=e=>[{label:"Today",searchKey:"today",startTime:d().tz(e).startOf("day").format(),endTime:d().tz(e).endOf("day").format()},{label:"Tomorrow",searchKey:"tomorrow",startTime:d().tz(e).add(1,"day").startOf("day").format(),endTime:d().tz(e).add(1,"day").endOf("day").format()},{label:"Yesterday",searchKey:"yesterday",startTime:d().tz(e).subtract(1,"day").startOf("day").format(),endTime:d().tz(e).subtract(1,"day").endOf("day").format(),lineBreak:!0},{label:"Last 15 seconds",searchKey:"-15s",startTime:d().tz(e).subtract(15,"second").format(),endTime:d().tz(e).format()},{label:"Last 30 seconds",searchKey:"-30s",startTime:d().tz(e).subtract(30,"second").format(),endTime:d().tz(e).format()},{label:"Next 15 seconds",searchKey:"+15s",startTime:d().tz(e).format(),endTime:d().tz(e).add(15,"second").format()},{label:"Next 30 seconds",searchKey:"+30s",startTime:d().tz(e).format(),endTime:d().tz(e).add(30,"second").format(),lineBreak:!0},{label:"Last 5 minutes",searchKey:"-5m",startTime:d().tz(e).subtract(5,"minute").format(),endTime:d().tz(e).format()},{label:"Last 10 minutes",searchKey:"-10m",startTime:d().tz(e).subtract(10,"minute").format(),endTime:d().tz(e).format()},{label:"Last 15 minutes",searchKey:"-15m",startTime:d().tz(e).subtract(15,"minute").format(),endTime:d().tz(e).format()},{label:"Last 30 minutes",searchKey:"-30m",startTime:d().tz(e).subtract(30,"minute").format(),endTime:d().tz(e).format()},{label:"Last 45 minutes",searchKey:"-45m",startTime:d().tz(e).subtract(45,"minute").format(),endTime:d().tz(e).format()},{label:"Next 5 minutes",searchKey:"+5m",startTime:d().tz(e).format(),endTime:d().tz(e).add(5,"minute").format()},{label:"Next 10 minutes",searchKey:"+10m",startTime:d().tz(e).format(),endTime:d().tz(e).add(10,"minute").format()},{label:"Next 15 minutes",searchKey:"+15m",startTime:d().tz(e).format(),endTime:d().tz(e).add(15,"minute").format()},{label:"Next 30 minutes",searchKey:"+30m",startTime:d().tz(e).format(),endTime:d().tz(e).add(30,"minute").format()},{label:"Next 45 minutes",searchKey:"+45m",startTime:d().tz(e).format(),endTime:d().tz(e).add(45,"minute").format(),lineBreak:!0},{label:"Last 1 hour",searchKey:"-1h",startTime:d().tz(e).subtract(1,"hour").format(),endTime:d().tz(e).format()},{label:"Last 3 hours",searchKey:"-3h",startTime:d().tz(e).subtract(3,"hour").format(),endTime:d().tz(e).format()},{label:"Last 6 hours",searchKey:"-6h",startTime:d().tz(e).subtract(6,"hour").format(),endTime:d().tz(e).format()},{label:"Last 12 hours",searchKey:"-12h",startTime:d().tz(e).subtract(12,"hour").format(),endTime:d().tz(e).format()},{label:"Next 1 hour",searchKey:"+1h",startTime:d().tz(e).format(),endTime:d().tz(e).add(1,"hour").format()},{label:"Next 3 hours",searchKey:"+3h",startTime:d().tz(e).format(),endTime:d().tz(e).add(3,"hour").format()},{label:"Next 6 hours",searchKey:"+6h",startTime:d().tz(e).format(),endTime:d().tz(e).add(6,"hour").format()},{label:"Next 12 hours",searchKey:"+12h",startTime:d().tz(e).format(),endTime:d().tz(e).add(12,"hour").format(),lineBreak:!0},{label:"Last 1 day",searchKey:"-1d",startTime:d().tz(e).subtract(1,"day").format(),endTime:d().tz(e).format()},{label:"Last 2 days",searchKey:"-2d",startTime:d().tz(e).subtract(2,"day").format(),endTime:d().tz(e).format()},{label:"Last 7 days",searchKey:"-7d",startTime:d().tz(e).subtract(7,"day").format(),endTime:d().tz(e).format()},{label:"Last 14 days",searchKey:"-14d",startTime:d().tz(e).subtract(14,"day").format(),endTime:d().tz(e).format()},{label:"Last 30 days",searchKey:"-30d",startTime:d().tz(e).subtract(30,"day").format(),endTime:d().tz(e).format()},{label:"Next 1 day",searchKey:"+1d",startTime:d().tz(e).format(),endTime:d().tz(e).add(1,"day").format()},{label:"Next 2 days",searchKey:"+2d",startTime:d().tz(e).format(),endTime:d().tz(e).add(2,"day").format()},{label:"Next 7 days",searchKey:"+7d",startTime:d().tz(e).format(),endTime:d().tz(e).add(7,"day").format()},{label:"Next 14 days",searchKey:"+14d",startTime:d().tz(e).format(),endTime:d().tz(e).add(14,"day").format()},{label:"Next 30 days",searchKey:"+30d",startTime:d().tz(e).format(),endTime:d().tz(e).add(30,"day").format()}],xe={"relative-time-panel-container":"_relative-time-panel-container_jsk5z_1","time-row":"_time-row_jsk5z_6","time-row-dark":"_time-row-dark_jsk5z_10","time-row-light":"_time-row-light_jsk5z_16"},Nt=({tzRange:e})=>{const[t,r]=f.useState([]),[n,s]=f.useState(""),{colorScheme:i}=Ie();f.useEffect(()=>{if(e.timezone.name!==null){const c=He(e.timezone.name);r(c)}},[e.timezone]),tt(()=>{if(n===""){r(He(e.timezone.name));return}const c=t.filter(u=>u.searchKey.includes(n));r(c)},250,[n]);const a=c=>{const[u,m]=c.startTime.split("T"),[D,x]=c.endTime.split("T");e.onApply({startDate:u,startTime:m.slice(0,8),endDate:D,endTime:x.slice(0,8),timezone:e.timezone})};return l.jsxs(l.Fragment,{children:[l.jsx(w.Box,{style:{width:"90%"},mx:"auto",children:l.jsx(w.Input,{placeholder:"Relative time (15m, 1h, 1d, 1w)",value:n,onChange:c=>s(c.currentTarget.value)})}),l.jsx(w.Flex,{direction:"column",className:xe["relative-time-panel-container"],children:t.map(c=>l.jsxs(w.Flex,{align:"center",justify:"space-between",className:nt(i==="dark"?xe["time-row-dark"]:xe["time-row-light"],xe["time-row"]),py:4,px:12,mb:c.lineBreak?8:0,onClick:()=>a(c),children:[l.jsx(w.Text,{size:"sm",children:c.label}),l.jsx(w.Text,{size:"xs",c:"#5f6368",children:c.searchKey})]},c.label))})]})},Ht=({setSelectedPanel:e,tzRange:t})=>l.jsxs(w.Box,{className:ge["sidebar-container"],flex:1,children:[l.jsx(Nt,{tzRange:t}),l.jsxs(w.Flex,{direction:"column",rowGap:16,py:8,style:{borderTop:"1px solid #ddd"},children:[l.jsxs(w.Flex,{className:ge["sidebar-row"],justify:"space-between",align:"center",px:12,onClick:()=>e(me.START_END_TIME),children:[l.jsxs(w.Flex,{align:"center",children:[l.jsx(Dt,{stroke:1.5}),l.jsx(w.Text,{size:"sm",children:"Start and end times"})]}),l.jsx(Oe,{stroke:1.5})]}),l.jsxs(w.Flex,{className:ge["sidebar-row"],justify:"space-between",align:"center",px:12,onClick:()=>e(me.AROUND_TIME),children:[l.jsxs(w.Flex,{align:"center",children:[l.jsx(Ee,{stroke:1.5}),l.jsx(w.Text,{size:"sm",children:"Around a time"})]}),l.jsx(Oe,{stroke:1.5})]}),l.jsxs(w.Flex,{className:ge["sidebar-row"],justify:"space-between",align:"center",px:12,onClick:()=>e(me.TIMEZONE),children:[l.jsxs(w.Flex,{align:"center",children:[l.jsx($t,{stroke:1.5}),l.jsx(w.Text,{size:"sm",children:"Time zone"})]}),l.jsx(Oe,{stroke:1.5})]})]})]});var ct=(e=>(e.ThirtySeconds="± 30 seconds",e.OneMinute="± 1 minute",e.FifteenMinutes="± 15 minutes",e.ThirtyMinutes="± 30 minutes",e.OneHour="± 1 hour",e.OneDay="± 1 day",e))(ct||{});const Bt=["± 30 seconds","± 1 minute","± 15 minutes","± 30 minutes","± 1 hour","± 1 day"],Zt=(e,t,r)=>{switch(r){case"± 30 seconds":const n=ne(e,t,30,"second"),s=se(e,t,30,"second");return{startDate:n.date,startTime:n.time,endDate:s.date,endTime:s.time};case"± 1 minute":const i=ne(e,t,1,"minute"),a=se(e,t,1,"minute");return{startDate:i.date,startTime:i.time,endDate:a.date,endTime:a.time};case"± 15 minutes":const c=ne(e,t,15,"minute"),u=se(e,t,15,"minute");return{startDate:c.date,startTime:c.time,endDate:u.date,endTime:u.time};case"± 30 minutes":const m=ne(e,t,30,"minute"),D=se(e,t,30,"minute");return{startDate:m.date,startTime:m.time,endDate:D.date,endTime:D.time};case"± 1 hour":const x=ne(e,t,1,"hour"),j=se(e,t,1,"hour");return{startDate:x.date,startTime:x.time,endDate:j.date,endTime:j.time};case"± 1 day":const P=ne(e,t,1,"day"),O=se(e,t,1,"day");return{startDate:P.date,startTime:P.time,endDate:O.date,endTime:O.time};default:return{startDate:e,startTime:t,endDate:e,endTime:t}}};function Jt(e){if(!/^[0-9a-zA-Z-]+$/.test(e))throw new Error(`[@mantine/use-form] Form name "${e}" is invalid, it should contain only letters, numbers and dashes`)}const Gt=typeof window<"u"?f.useLayoutEffect:f.useEffect;function J(e,t){Gt(()=>{if(e)return window.addEventListener(e,t),()=>window.removeEventListener(e,t)},[e])}function Xt(e,t){e&&Jt(e),J(`mantine-form:${e}:set-field-value`,r=>t.setFieldValue(r.detail.path,r.detail.value)),J(`mantine-form:${e}:set-values`,r=>t.setValues(r.detail)),J(`mantine-form:${e}:set-initial-values`,r=>t.setInitialValues(r.detail)),J(`mantine-form:${e}:set-errors`,r=>t.setErrors(r.detail)),J(`mantine-form:${e}:set-field-error`,r=>t.setFieldError(r.detail.path,r.detail.error)),J(`mantine-form:${e}:clear-field-error`,r=>t.clearFieldError(r.detail)),J(`mantine-form:${e}:clear-errors`,t.clearErrors),J(`mantine-form:${e}:reset`,t.reset),J(`mantine-form:${e}:validate`,t.validate),J(`mantine-form:${e}:validate-field`,r=>t.validateField(r.detail)),J(`mantine-form:${e}:reorder-list-item`,r=>t.reorderListItem(r.detail.path,r.detail.payload)),J(`mantine-form:${e}:remove-list-item`,r=>t.removeListItem(r.detail.path,r.detail.index)),J(`mantine-form:${e}:insert-list-item`,r=>t.insertListItem(r.detail.path,r.detail.item,r.detail.index)),J(`mantine-form:${e}:set-dirty`,r=>t.setDirty(r.detail)),J(`mantine-form:${e}:set-touched`,r=>t.setTouched(r.detail)),J(`mantine-form:${e}:reset-dirty`,r=>t.resetDirty(r.detail)),J(`mantine-form:${e}:reset-touched`,t.resetTouched)}function Qt(e){return t=>{if(!t)e(t);else if(typeof t=="function")e(t);else if(typeof t=="object"&&"nativeEvent"in t){const{currentTarget:r}=t;r instanceof HTMLInputElement?r.type==="checkbox"?e(r.checked):e(r.value):(r instanceof HTMLTextAreaElement||r instanceof HTMLSelectElement)&&e(r.value)}else e(t)}}function Fe(e){return e===null||typeof e!="object"?{}:Object.keys(e).reduce((t,r)=>{const n=e[r];return n!=null&&n!==!1&&(t[r]=n),t},{})}function er(e){const[t,r]=f.useState(Fe(e)),n=f.useRef(t),s=f.useCallback(u=>{r(m=>{const D=Fe(typeof u=="function"?u(m):u);return n.current=D,D})},[]),i=f.useCallback(()=>s({}),[]),a=f.useCallback(u=>{n.current[u]!==void 0&&s(m=>{const D={...m};return delete D[u],D})},[t]),c=f.useCallback((u,m)=>{m==null||m===!1?a(u):n.current[u]!==m&&s(D=>({...D,[u]:m}))},[t]);return{errorsState:t,setErrors:s,clearErrors:i,setFieldError:c,clearFieldError:a}}function Pe(e,t){if(t===null||typeof t!="object")return{};const r={...t};return Object.keys(t).forEach(n=>{n.includes(`${String(e)}.`)&&delete r[n]}),r}function Be(e,t){const r=e.substring(t.length+1).split(".")[0];return parseInt(r,10)}function Ze(e,t,r,n){if(t===void 0)return r;const s=`${String(e)}`;let i=r;n===-1&&(i=Pe(`${s}.${t}`,i));const a={...i},c=new Set;return Object.entries(i).filter(([u])=>{if(!u.startsWith(`${s}.`))return!1;const m=Be(u,s);return Number.isNaN(m)?!1:m>=t}).forEach(([u,m])=>{const D=Be(u,s),x=u.replace(`${s}.${D}`,`${s}.${D+n}`);a[x]=m,c.add(x),c.has(u)||delete a[u]}),a}function tr(e,{from:t,to:r},n){const s=`${e}.${t}`,i=`${e}.${r}`,a={...n},c=new Set;return Object.keys(n).forEach(u=>{if(c.has(u))return;let m,D;if(u.startsWith(s)?(m=u,D=u.replace(s,i)):u.startsWith(i)&&(m=u.replace(i,s),D=u),m&&D){const x=a[m],j=a[D];j===void 0?delete a[m]:a[m]=j,x===void 0?delete a[D]:a[D]=x,c.add(m),c.add(D)}}),a}function Je(e,t,r){typeof r.value=="object"&&(r.value=ie(r.value)),!r.enumerable||r.get||r.set||!r.configurable||!r.writable||t==="__proto__"?Object.defineProperty(e,t,r):e[t]=r.value}function ie(e){if(typeof e!="object")return e;var t=0,r,n,s,i=Object.prototype.toString.call(e);if(i==="[object Object]"?s=Object.create(e.__proto__||null):i==="[object Array]"?s=Array(e.length):i==="[object Set]"?(s=new Set,e.forEach(function(a){s.add(ie(a))})):i==="[object Map]"?(s=new Map,e.forEach(function(a,c){s.set(ie(c),ie(a))})):i==="[object Date]"?s=new Date(+e):i==="[object RegExp]"?s=new RegExp(e.source,e.flags):i==="[object DataView]"?s=new e.constructor(ie(e.buffer)):i==="[object ArrayBuffer]"?s=e.slice(0):i.slice(-6)==="Array]"&&(s=new e.constructor(e)),s){for(n=Object.getOwnPropertySymbols(e);t<n.length;t++)Je(s,n[t],Object.getOwnPropertyDescriptor(e,n[t]));for(t=0,n=Object.getOwnPropertyNames(e);t<n.length;t++)Object.hasOwnProperty.call(s,r=n[t])&&s[r]===e[r]||Je(s,r,Object.getOwnPropertyDescriptor(e,r))}return s||e}function ut(e){return typeof e!="string"?[]:e.split(".")}function B(e,t){const r=ut(e);if(r.length===0||typeof t!="object"||t===null)return;let n=t[r[0]];for(let s=1;s<r.length&&n!=null;s+=1)n=n[r[s]];return n}function pe(e,t,r){const n=ut(e);if(n.length===0)return r;const s=ie(r);if(n.length===1)return s[n[0]]=t,s;let i=s[n[0]];for(let a=1;a<n.length-1;a+=1){if(i===void 0)return s;i=i[n[a]]}return i[n[n.length-1]]=t,s}function rr(e,{from:t,to:r},n){const s=B(e,n);if(!Array.isArray(s))return n;const i=[...s],a=s[t];return i.splice(t,1),i.splice(r,0,a),pe(e,i,n)}function nr(e,t,r,n){const s=B(e,n);if(!Array.isArray(s))return n;const i=[...s];return i.splice(typeof r=="number"?r:i.length,0,t),pe(e,i,n)}function sr(e,t,r){const n=B(e,r);return Array.isArray(n)?pe(e,n.filter((s,i)=>i!==t),r):r}function or(e,t,r,n){const s=B(e,n);if(!Array.isArray(s)||s.length<=r)return n;const i=[...s];return i[r]=t,pe(e,i,n)}function ir({$values:e,$errors:t,$status:r}){const n=f.useCallback((c,u)=>{r.clearFieldDirty(c),t.setErrors(m=>tr(c,u,m)),e.setValues({values:rr(c,u,e.refValues.current),updateState:!0})},[]),s=f.useCallback((c,u)=>{r.clearFieldDirty(c),t.setErrors(m=>Ze(c,u,m,-1)),e.setValues({values:sr(c,u,e.refValues.current),updateState:!0})},[]),i=f.useCallback((c,u,m)=>{r.clearFieldDirty(c),t.setErrors(D=>Ze(c,m,D,1)),e.setValues({values:nr(c,u,m,e.refValues.current),updateState:!0})},[]),a=f.useCallback((c,u,m)=>{r.clearFieldDirty(c),e.setValues({values:or(c,m,u,e.refValues.current),updateState:!0})},[]);return{reorderListItem:n,removeListItem:s,insertListItem:i,replaceListItem:a}}var Ce,Ge;function ar(){return Ge||(Ge=1,Ce=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,s,i;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(s=n;s--!==0;)if(!e(t[s],r[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(i=Object.keys(t),n=i.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[s]))return!1;for(s=n;s--!==0;){var a=i[s];if(!e(t[a],r[a]))return!1}return!0}return t!==t&&r!==r}),Ce}var cr=ar();const Se=_e(cr);function de(e,t){const r=Object.keys(e);if(typeof t=="string"){const n=r.filter(s=>s.startsWith(`${t}.`));return e[t]||n.some(s=>e[s])||!1}return r.some(n=>e[n])}function ur({initialDirty:e,initialTouched:t,mode:r,$values:n}){const[s,i]=f.useState(t),[a,c]=f.useState(e),u=f.useRef(t),m=f.useRef(e),D=f.useCallback($=>{const V=typeof $=="function"?$(u.current):$;u.current=V,r==="controlled"&&i(V)},[]),x=f.useCallback(($,V=!1)=>{const L=typeof $=="function"?$(m.current):$;m.current=L,(r==="controlled"||V)&&c(L)},[]),j=f.useCallback(()=>D({}),[]),P=f.useCallback($=>{const V=$?{...n.refValues.current,...$}:n.refValues.current;n.setValuesSnapshot(V),x({})},[]),O=f.useCallback(($,V)=>{D(L=>de(L,$)===V?L:{...L,[$]:V})},[]),b=f.useCallback(($,V,L)=>{x(N=>de(N,$)===V?N:{...N,[$]:V},L)},[]),y=f.useCallback(($,V)=>{const L=de(m.current,$),N=!Se(B($,n.getValuesSnapshot()),V),R=Pe($,m.current);R[$]=N,x(R,L!==N)},[]),S=f.useCallback($=>de(u.current,$),[]),C=f.useCallback($=>x(V=>{if(typeof $!="string")return V;const L=Pe($,V);return delete L[$],Se(L,V)?V:L}),[]),z=f.useCallback($=>{if($){const L=B($,m.current);if(typeof L=="boolean")return L;const N=B($,n.refValues.current),R=B($,n.valuesSnapshot.current);return!Se(N,R)}return Object.keys(m.current).length>0?de(m.current):!Se(n.refValues.current,n.valuesSnapshot.current)},[]),K=f.useCallback(()=>m.current,[]),Y=f.useCallback(()=>u.current,[]);return{touchedState:s,dirtyState:a,touchedRef:u,dirtyRef:m,setTouched:D,setDirty:x,resetDirty:P,resetTouched:j,isTouched:S,setFieldTouched:O,setFieldDirty:b,setTouchedState:i,setDirtyState:c,clearFieldDirty:C,isDirty:z,getDirty:K,getTouched:Y,setCalculatedFieldDirty:y}}function lr({initialValues:e,onValuesChange:t,mode:r}){const n=f.useRef(!1),[s,i]=f.useState(e||{}),a=f.useRef(s),c=f.useRef(s),u=f.useCallback(({values:y,subscribers:S,updateState:C=!0,mergeWithPreviousValues:z=!0})=>{const K=a.current,Y=y instanceof Function?y(a.current):y,$=z?{...K,...Y}:Y;a.current=$,C&&(i($),r==="uncontrolled"&&(a.current=$)),t?.($,K),S?.filter(Boolean).forEach(V=>V({updatedValues:$,previousValues:K}))},[t]),m=f.useCallback(y=>{const S=B(y.path,a.current),C=y.value instanceof Function?y.value(S):y.value;if(S!==C){const z=a.current,K=pe(y.path,C,a.current);u({values:K,updateState:y.updateState}),y.subscribers?.filter(Boolean).forEach(Y=>Y({path:y.path,updatedValues:K,previousValues:z}))}},[u]),D=f.useCallback(y=>{c.current=y},[]),x=f.useCallback((y,S)=>{n.current||(n.current=!0,u({values:y,updateState:r==="controlled"}),D(y),S())},[u]),j=f.useCallback(()=>{u({values:c.current,updateState:!0,mergeWithPreviousValues:!1})},[u]),P=f.useCallback(()=>a.current,[]),O=f.useCallback(()=>c.current,[]),b=f.useCallback((y,S)=>{const C=B(y,c.current);typeof C>"u"||m({path:y,value:C,updateState:r==="controlled",subscribers:S})},[m,r]);return{initialized:n,stateValues:s,refValues:a,valuesSnapshot:c,setValues:u,setFieldValue:m,resetValues:j,setValuesSnapshot:D,initialize:x,getValues:P,getValuesSnapshot:O,resetField:b}}function dr({$status:e,cascadeUpdates:t}){const r=f.useRef({}),n=f.useCallback((i,a)=>{f.useEffect(()=>(r.current[i]=r.current[i]||[],r.current[i].push(a),()=>{r.current[i]=r.current[i].filter(c=>c!==a)}),[a])},[]),s=f.useCallback(i=>{const a=r.current[i]?.map(c=>u=>c({previousValue:B(i,u.previousValues),value:B(i,u.updatedValues),touched:e.isTouched(i),dirty:e.isDirty(i)}))??[];if(t)for(const c in r.current)(c.startsWith(`${i}.`)||i.startsWith(`${c}.`))&&a.push(...r.current[c].map(u=>m=>u({previousValue:B(c,m.previousValues),value:B(c,m.updatedValues),touched:e.isTouched(c),dirty:e.isDirty(c)})));return a},[]);return{subscribers:r,watch:n,getFieldSubscribers:s}}function Xe(e,t){return e?`${e}-${t.toString()}`:t.toString()}const $e=Symbol("root-rule");function Qe(e){const t=Fe(e);return{hasErrors:Object.keys(t).length>0,errors:t}}function Ve(e,t,r="",n={}){return typeof e!="object"||e===null?n:Object.keys(e).reduce((s,i)=>{const a=e[i],c=`${r===""?"":`${r}.`}${i}`,u=B(c,t);let m=!1;return typeof a=="function"&&(s[c]=a(u,t,c)),typeof a=="object"&&Array.isArray(u)&&(m=!0,u.forEach((D,x)=>Ve(a,t,`${c}.${x}`,s)),$e in a&&(s[c]=a[$e](u,t,c))),typeof a=="object"&&typeof u=="object"&&u!==null&&(m||Ve(a,t,c,s),$e in a&&(s[c]=a[$e](u,t,c))),s},n)}function Ae(e,t){return Qe(typeof e=="function"?e(t):Ve(e,t))}function ke(e,t,r){if(typeof e!="string")return{hasError:!1,error:null};const n=Ae(t,r),s=Object.keys(n.errors).find(i=>e.split(".").every((a,c)=>a===i.split(".")[c]));return{hasError:!!s,error:s?n.errors[s]:null}}const fr="__MANTINE_FORM_INDEX__";function et(e,t){return t?typeof t=="boolean"?t:Array.isArray(t)?t.includes(e.replace(/[.][0-9]+/g,`.${fr}`)):!1:!1}function lt({name:e,mode:t="controlled",initialValues:r,initialErrors:n={},initialDirty:s={},initialTouched:i={},clearInputErrorOnChange:a=!0,validateInputOnChange:c=!1,validateInputOnBlur:u=!1,onValuesChange:m,transformValues:D=(y=>y),enhanceGetInputProps:x,validate:j,onSubmitPreventDefault:P="always",touchTrigger:O="change",cascadeUpdates:b=!1}={}){const y=er(n),S=lr({initialValues:r,onValuesChange:m,mode:t}),C=ur({initialDirty:s,initialTouched:i,$values:S,mode:t}),z=ir({$values:S,$errors:y,$status:C}),K=dr({$status:C,cascadeUpdates:b}),[Y,$]=f.useState(0),[V,L]=f.useState({}),[N,R]=f.useState(!1),A=f.useCallback(()=>{S.resetValues(),y.clearErrors(),C.resetDirty(),C.resetTouched(),t==="uncontrolled"&&$(p=>p+1)},[]),Q=f.useCallback(p=>{a&&y.clearErrors(),t==="uncontrolled"&&$(_=>_+1),Object.keys(K.subscribers.current).forEach(_=>{const W=B(_,S.refValues.current),U=B(_,p);W!==U&&K.getFieldSubscribers(_).forEach(Z=>Z({previousValues:p,updatedValues:S.refValues.current}))})},[a]),re=f.useCallback(p=>{const _=S.refValues.current;S.initialize(p,()=>t==="uncontrolled"&&$(W=>W+1)),Q(_)},[Q]),E=f.useCallback((p,_,W)=>{const U=et(p,c),Z=_ instanceof Function?_(B(p,S.refValues.current)):_;C.setCalculatedFieldDirty(p,Z),O==="change"&&C.setFieldTouched(p,!0),!U&&a&&y.clearFieldError(p),S.setFieldValue({path:p,value:_,updateState:t==="controlled",subscribers:[...K.getFieldSubscribers(p),U?ee=>{const G=ke(p,j,ee.updatedValues);G.hasError?y.setFieldError(p,G.error):y.clearFieldError(p)}:null,W?.forceUpdate!==!1&&t!=="controlled"?()=>L(ee=>({...ee,[p]:(ee[p]||0)+1})):null]})},[m,j]),v=f.useCallback(p=>{const _=S.refValues.current;S.setValues({values:p,updateState:t==="controlled"}),Q(_)},[m,Q]),h=f.useCallback(()=>{const p=Ae(j,S.refValues.current);return y.setErrors(p.errors),p},[j]),k=f.useCallback(p=>{const _=ke(p,j,S.refValues.current);return _.hasError?y.setFieldError(p,_.error):y.clearFieldError(p),_},[j]),T=(p,{type:_="input",withError:W=!0,withFocus:U=!0,...Z}={})=>{const G={onChange:Qt(be=>E(p,be,{forceUpdate:!1})),"data-path":Xe(e,p)};return W&&(G.error=y.errorsState[p]),_==="checkbox"?G[t==="controlled"?"checked":"defaultChecked"]=B(p,S.refValues.current):G[t==="controlled"?"value":"defaultValue"]=B(p,S.refValues.current),U&&(G.onFocus=()=>C.setFieldTouched(p,!0),G.onBlur=()=>{if(et(p,u)){const be=ke(p,j,S.refValues.current);be.hasError?y.setFieldError(p,be.error):y.clearFieldError(p)}}),Object.assign(G,x?.({inputProps:G,field:p,options:{type:_,withError:W,withFocus:U,...Z},form:X}))},F=(p,_)=>W=>{P==="always"&&W?.preventDefault();const U=h();if(U.hasErrors)P==="validation-failed"&&W?.preventDefault(),_?.(U.errors,S.refValues.current,W);else{const Z=p?.(D(S.refValues.current),W);Z instanceof Promise&&(R(!0),Z.finally(()=>R(!1)))}},o=p=>D(p||S.refValues.current),g=f.useCallback(p=>{p.preventDefault(),A()},[]),M=f.useCallback(p=>p?!ke(p,j,S.refValues.current).hasError:!Ae(j,S.refValues.current).hasErrors,[j]),I=p=>`${Y}-${String(p)}-${V[String(p)]||0}`,q=f.useCallback(p=>document.querySelector(`[data-path="${Xe(e,p)}"]`),[]),H=f.useCallback(p=>{S.resetField(p,[t!=="controlled"?()=>L(_=>({..._,[p]:(_[p]||0)+1})):null])},[S.resetField,t,L]),X={watch:K.watch,initialized:S.initialized.current,values:t==="uncontrolled"?S.refValues.current:S.stateValues,getValues:S.getValues,getInitialValues:S.getValuesSnapshot,setInitialValues:S.setValuesSnapshot,resetField:H,initialize:re,setValues:v,setFieldValue:E,submitting:N,setSubmitting:R,errors:y.errorsState,setErrors:y.setErrors,setFieldError:y.setFieldError,clearFieldError:y.clearFieldError,clearErrors:y.clearErrors,resetDirty:C.resetDirty,setTouched:C.setTouched,setDirty:C.setDirty,isTouched:C.isTouched,resetTouched:C.resetTouched,isDirty:C.isDirty,getTouched:C.getTouched,getDirty:C.getDirty,reorderListItem:z.reorderListItem,insertListItem:z.insertListItem,removeListItem:z.removeListItem,replaceListItem:z.replaceListItem,reset:A,validate:h,validateField:k,getInputProps:T,onSubmit:F,onReset:g,isValid:M,getTransformedValues:o,key:I,getInputNode:q};return Xt(e,X),X}const mr=({tzRange:e})=>{const t=lt({initialValues:{date:it(),time:fe(),duration:ct.OneDay},validate:{date:n=>n?null:"Date is required",time:n=>n?null:"Time is required",duration:n=>n?null:"Duration is required"}}),r=n=>{if(!e.timezone.name)return;const s=he(n.date,n.time,e.timezone.name),i=ye(s,e.timezone.name),{startDate:a,startTime:c,endDate:u,endTime:m}=Zt(i.date,i.time,n.duration);e.onApply({startDate:a,startTime:c,endDate:u,endTime:m,timezone:e.timezone})};return l.jsx(w.Flex,{direction:"column",flex:2,justify:"space-between",style:{height:"100%"},px:12,children:l.jsxs("form",{className:Le["form-container"],onSubmit:t.onSubmit(r),children:[l.jsxs(w.Box,{children:[l.jsx(w.Text,{fw:600,children:"Around a time"}),l.jsxs(w.Flex,{direction:"column",gap:8,mt:12,children:[l.jsx(oe.DatePickerInput,{label:"Pick date",placeholder:"Pick date",...t.getInputProps("date"),popoverProps:{withinPortal:!1},valueFormat:te,leftSection:l.jsx(Me,{stroke:1.5})},t.key("date")),l.jsx(oe.TimeInput,{label:"Pick time",placeholder:"Pick time",withSeconds:!0,...t.getInputProps("time"),leftSection:l.jsx(Ee,{stroke:1.5}),rightSection:l.jsx(w.Text,{style:{fontSize:12,fontStyle:"italic",textAlign:"right"},children:e.timezone?.longName}),rightSectionWidth:180,rightSectionProps:{style:{paddingRight:1}}},t.key("time")),l.jsx(w.Select,{label:"Duration",placeholder:"Pick value",data:Bt,...t.getInputProps("duration"),comboboxProps:{withinPortal:!1}},t.key("duration"))]})]}),l.jsx(Re,{})]})})},hr=({tzRange:e})=>{const t=lt({mode:"uncontrolled",initialValues:{startDate:it(),startTime:fe(),endDate:Ut(30),endTime:fe()},validate:{startDate:n=>n?null:"Start date is required",startTime:n=>n?null:"Start time is required",endDate:(n,s)=>{if(!n)return"End date is required";const i=d(`${s.startDate} ${s.startTime}`),a=d(`${n} ${s.endTime}`);return a.isAfter(i)||a.isSame(i)?null:"End time must be after start time"},endTime:(n,s)=>{if(!n)return"End time is required";const i=d(`${s.startDate} ${s.startTime}`),a=d(`${s.endDate} ${n}`);return a.isAfter(i)||a.isSame(i)?null:"End time must be after start time"}}}),r=n=>{if(!e.timezone.name)return;const s=he(n.startDate,n.startTime,e.timezone.name),i=he(n.endDate,n.endTime,e.timezone.name),a=ye(s,e.timezone.name),c=ye(i,e.timezone.name);e.onApply({startDate:a.date,startTime:a.time,endDate:c.date,endTime:c.time,timezone:e.timezone})};return l.jsx(w.Flex,{direction:"column",flex:2,style:{height:"100%"},px:12,children:l.jsxs("form",{className:Le["form-container"],onSubmit:t.onSubmit(r),children:[l.jsxs(w.Box,{children:[l.jsx(w.Text,{fw:600,children:"Start and end times"}),l.jsxs(w.Flex,{direction:"column",gap:8,mt:12,children:[l.jsx(oe.DatePickerInput,{label:"Start time",...t.getInputProps("startDate"),popoverProps:{withinPortal:!1},valueFormat:te,leftSection:l.jsx(Me,{stroke:1.5})},t.key("startDate")),l.jsx(oe.TimeInput,{withSeconds:!0,defaultValue:fe(),...t.getInputProps("startTime"),leftSection:l.jsx(Ee,{stroke:1.5}),rightSection:l.jsx(w.Text,{style:{fontSize:12,fontStyle:"italic"},children:e.timezone?.longName}),rightSectionWidth:180,rightSectionProps:{style:{paddingRight:1}}},t.key("startTime")),l.jsx(oe.DatePickerInput,{label:"End time",...t.getInputProps("endDate"),popoverProps:{withinPortal:!1},valueFormat:te,leftSection:l.jsx(Me,{stroke:1.5})},t.key("endDate")),l.jsx(oe.TimeInput,{withSeconds:!0,defaultValue:fe(),...t.getInputProps("endTime"),leftSection:l.jsx(Ee,{stroke:1.5}),rightSection:l.jsx(w.Text,{style:{fontSize:12,fontStyle:"italic"},children:e.timezone?.longName}),rightSectionWidth:180,rightSectionProps:{style:{paddingRight:1}}},t.key("endTime"))]})]}),l.jsx(Re,{})]})})};var me=(e=>(e.START_END_TIME="Start and end times",e.AROUND_TIME="Around a time",e.TIMEZONE="Time zone",e))(me||{});const yr=e=>{const[t,r]=f.useState("Start and end times"),{popoverOpened:n,setPopoverOpened:s}=ot(),i=()=>{switch(t){case"Start and end times":return l.jsx(hr,{tzRange:e});case"Around a time":return l.jsx(mr,{tzRange:e});case"Time zone":return l.jsx(at,{tzRange:e});default:return null}},a=()=>{s(u=>!u)},c=f.useMemo(()=>qt(e),[e.startDate,e.startTime,e.endDate,e.endTime,e.timezone]);return l.jsxs(w.Popover,{position:"bottom",shadow:"md",opened:n,onChange:s,children:[l.jsx(w.Popover.Target,{children:l.jsx(w.Button,{onClick:a,style:e.buttonStyle||{},children:c})}),l.jsx(w.Popover.Dropdown,{style:{width:700,height:400,padding:0},py:8,children:l.jsxs(w.Flex,{style:{height:"100%"},children:[l.jsx(Ht,{tzRange:e,setSelectedPanel:r}),i()]})})]})},Tr=e=>l.jsx(Kt,{children:l.jsx(yr,{...e})});exports.Panel=me;exports.TimezonePanel=at;exports.TimezoneRangePicker=Tr;
|
|
62
|
+
*/const kt=[["path",{d:"M16 2c.183 0 .355 .05 .502 .135l.033 .02c.28 .177 .465 .49 .465 .845v1h1a3 3 0 0 1 2.995 2.824l.005 .176v12a3 3 0 0 1 -2.824 2.995l-.176 .005h-12a3 3 0 0 1 -2.995 -2.824l-.005 -.176v-12a3 3 0 0 1 2.824 -2.995l.176 -.005h1v-1a1 1 0 0 1 .514 -.874l.093 -.046l.066 -.025l.1 -.029l.107 -.019l.12 -.007q .083 0 .161 .013l.122 .029l.04 .012l.06 .023c.328 .135 .568 .44 .61 .806l.007 .117v1h6v-1a1 1 0 0 1 1 -1m3 7h-14v9.625c0 .705 .386 1.286 .883 1.366l.117 .009h12c.513 0 .936 -.53 .993 -1.215l.007 -.16z",key:"svg-0"}],["path",{d:"M9.015 13a1 1 0 0 1 -1 1a1.001 1.001 0 1 1 -.005 -2c.557 0 1.005 .448 1.005 1",key:"svg-1"}],["path",{d:"M13.015 13a1 1 0 0 1 -1 1a1.001 1.001 0 1 1 -.005 -2c.557 0 1.005 .448 1.005 1",key:"svg-2"}],["path",{d:"M17.02 13a1 1 0 0 1 -1 1a1.001 1.001 0 1 1 -.005 -2c.557 0 1.005 .448 1.005 1",key:"svg-3"}],["path",{d:"M12.02 15a1 1 0 0 1 0 2a1.001 1.001 0 1 1 -.005 -2z",key:"svg-4"}],["path",{d:"M9.015 16a1 1 0 0 1 -1 1a1.001 1.001 0 1 1 -.005 -2c.557 0 1.005 .448 1.005 1",key:"svg-5"}]],Dt=ce("filled","calendar-week-filled","CalendarWeekFilled",kt),jt=({searchText:e,setSearchText:t})=>d.jsx(w.Input,{placeholder:"Timezone search (Asia, Tokyo, +09:00, etc)",leftSection:d.jsx(gt,{stroke:2}),value:e,onChange:r=>t(r.currentTarget.value)});var ke={exports:{}},wt=ke.exports,We;function Et(){return We||(We=1,(function(e,t){(function(r,n){e.exports=n()})(wt,(function(){var r=1e3,n=6e4,s=36e5,i="millisecond",a="second",c="minute",u="hour",m="day",D="week",g="month",j="quarter",P="year",O="date",b="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,S=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,C={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(E){var v=["th","st","nd","rd"],h=E%100;return"["+E+(v[(h-20)%10]||v[h]||v[0])+"]"}},R=function(E,v,h){var k=String(E);return!k||k.length>=v?E:""+Array(v+1-k.length).join(h)+E},K={s:R,z:function(E){var v=-E.utcOffset(),h=Math.abs(v),k=Math.floor(h/60),T=h%60;return(v<=0?"+":"-")+R(k,2,"0")+":"+R(T,2,"0")},m:function E(v,h){if(v.date()<h.date())return-E(h,v);var k=12*(h.year()-v.year())+(h.month()-v.month()),T=v.clone().add(k,g),F=h-T<0,o=v.clone().add(k+(F?-1:1),g);return+(-(k+(h-T)/(F?T-o:o-T))||0)},a:function(E){return E<0?Math.ceil(E)||0:Math.floor(E)},p:function(E){return{M:g,y:P,w:D,d:m,D:O,h:u,m:c,s:a,ms:i,Q:j}[E]||String(E||"").toLowerCase().replace(/s$/,"")},u:function(E){return E===void 0}},Y="en",$={};$[Y]=C;var V="$isDayjsObject",L=function(E){return E instanceof Q||!(!E||!E[V])},N=function E(v,h,k){var T;if(!v)return Y;if(typeof v=="string"){var F=v.toLowerCase();$[F]&&(T=F),h&&($[F]=h,T=F);var o=v.split("-");if(!T&&o.length>1)return E(o[0])}else{var x=v.name;$[x]=v,T=x}return!k&&T&&(Y=T),T||!k&&Y},z=function(E,v){if(L(E))return E.clone();var h=typeof v=="object"?v:{};return h.date=E,h.args=arguments,new Q(h)},A=K;A.l=N,A.i=L,A.w=function(E,v){return z(E,{locale:v.$L,utc:v.$u,x:v.$x,$offset:v.$offset})};var Q=(function(){function E(h){this.$L=N(h.locale,null,!0),this.parse(h),this.$x=this.$x||h.x||{},this[V]=!0}var v=E.prototype;return v.parse=function(h){this.$d=(function(k){var T=k.date,F=k.utc;if(T===null)return new Date(NaN);if(A.u(T))return new Date;if(T instanceof Date)return new Date(T);if(typeof T=="string"&&!/Z$/i.test(T)){var o=T.match(y);if(o){var x=o[2]-1||0,M=(o[7]||"0").substring(0,3);return F?new Date(Date.UTC(o[1],x,o[3]||1,o[4]||0,o[5]||0,o[6]||0,M)):new Date(o[1],x,o[3]||1,o[4]||0,o[5]||0,o[6]||0,M)}}return new Date(T)})(h),this.init()},v.init=function(){var h=this.$d;this.$y=h.getFullYear(),this.$M=h.getMonth(),this.$D=h.getDate(),this.$W=h.getDay(),this.$H=h.getHours(),this.$m=h.getMinutes(),this.$s=h.getSeconds(),this.$ms=h.getMilliseconds()},v.$utils=function(){return A},v.isValid=function(){return this.$d.toString()!==b},v.isSame=function(h,k){var T=z(h);return this.startOf(k)<=T&&T<=this.endOf(k)},v.isAfter=function(h,k){return z(h)<this.startOf(k)},v.isBefore=function(h,k){return this.endOf(k)<z(h)},v.$g=function(h,k,T){return A.u(h)?this[k]:this.set(T,h)},v.unix=function(){return Math.floor(this.valueOf()/1e3)},v.valueOf=function(){return this.$d.getTime()},v.startOf=function(h,k){var T=this,F=!!A.u(k)||k,o=A.p(h),x=function(W,U){var Z=A.w(T.$u?Date.UTC(T.$y,U,W):new Date(T.$y,U,W),T);return F?Z:Z.endOf(m)},M=function(W,U){return A.w(T.toDate()[W].apply(T.toDate("s"),(F?[0,0,0,0]:[23,59,59,999]).slice(U)),T)},I=this.$W,q=this.$M,H=this.$D,X="set"+(this.$u?"UTC":"");switch(o){case P:return F?x(1,0):x(31,11);case g:return F?x(1,q):x(0,q+1);case D:var p=this.$locale().weekStart||0,_=(I<p?I+7:I)-p;return x(F?H-_:H+(6-_),q);case m:case O:return M(X+"Hours",0);case u:return M(X+"Minutes",1);case c:return M(X+"Seconds",2);case a:return M(X+"Milliseconds",3);default:return this.clone()}},v.endOf=function(h){return this.startOf(h,!1)},v.$set=function(h,k){var T,F=A.p(h),o="set"+(this.$u?"UTC":""),x=(T={},T[m]=o+"Date",T[O]=o+"Date",T[g]=o+"Month",T[P]=o+"FullYear",T[u]=o+"Hours",T[c]=o+"Minutes",T[a]=o+"Seconds",T[i]=o+"Milliseconds",T)[F],M=F===m?this.$D+(k-this.$W):k;if(F===g||F===P){var I=this.clone().set(O,1);I.$d[x](M),I.init(),this.$d=I.set(O,Math.min(this.$D,I.daysInMonth())).$d}else x&&this.$d[x](M);return this.init(),this},v.set=function(h,k){return this.clone().$set(h,k)},v.get=function(h){return this[A.p(h)]()},v.add=function(h,k){var T,F=this;h=Number(h);var o=A.p(k),x=function(q){var H=z(F);return A.w(H.date(H.date()+Math.round(q*h)),F)};if(o===g)return this.set(g,this.$M+h);if(o===P)return this.set(P,this.$y+h);if(o===m)return x(1);if(o===D)return x(7);var M=(T={},T[c]=n,T[u]=s,T[a]=r,T)[o]||1,I=this.$d.getTime()+h*M;return A.w(I,this)},v.subtract=function(h,k){return this.add(-1*h,k)},v.format=function(h){var k=this,T=this.$locale();if(!this.isValid())return T.invalidDate||b;var F=h||"YYYY-MM-DDTHH:mm:ssZ",o=A.z(this),x=this.$H,M=this.$m,I=this.$M,q=T.weekdays,H=T.months,X=T.meridiem,p=function(U,Z,te,G){return U&&(U[Z]||U(k,F))||te[Z].slice(0,G)},_=function(U){return A.s(x%12||12,U,"0")},W=X||function(U,Z,te){var G=U<12?"AM":"PM";return te?G.toLowerCase():G};return F.replace(S,(function(U,Z){return Z||(function(te){switch(te){case"YY":return String(k.$y).slice(-2);case"YYYY":return A.s(k.$y,4,"0");case"M":return I+1;case"MM":return A.s(I+1,2,"0");case"MMM":return p(T.monthsShort,I,H,3);case"MMMM":return p(H,I);case"D":return k.$D;case"DD":return A.s(k.$D,2,"0");case"d":return String(k.$W);case"dd":return p(T.weekdaysMin,k.$W,q,2);case"ddd":return p(T.weekdaysShort,k.$W,q,3);case"dddd":return q[k.$W];case"H":return String(x);case"HH":return A.s(x,2,"0");case"h":return _(1);case"hh":return _(2);case"a":return W(x,M,!0);case"A":return W(x,M,!1);case"m":return String(M);case"mm":return A.s(M,2,"0");case"s":return String(k.$s);case"ss":return A.s(k.$s,2,"0");case"SSS":return A.s(k.$ms,3,"0");case"Z":return o}return null})(U)||o.replace(":","")}))},v.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},v.diff=function(h,k,T){var F,o=this,x=A.p(k),M=z(h),I=(M.utcOffset()-this.utcOffset())*n,q=this-M,H=function(){return A.m(o,M)};switch(x){case P:F=H()/12;break;case g:F=H();break;case j:F=H()/3;break;case D:F=(q-I)/6048e5;break;case m:F=(q-I)/864e5;break;case u:F=q/s;break;case c:F=q/n;break;case a:F=q/r;break;default:F=q}return T?F:A.a(F)},v.daysInMonth=function(){return this.endOf(g).$D},v.$locale=function(){return $[this.$L]},v.locale=function(h,k){if(!h)return this.$L;var T=this.clone(),F=N(h,k,!0);return F&&(T.$L=F),T},v.clone=function(){return A.w(this.$d,this)},v.toDate=function(){return new Date(this.valueOf())},v.toJSON=function(){return this.isValid()?this.toISOString():null},v.toISOString=function(){return this.$d.toISOString()},v.toString=function(){return this.$d.toUTCString()},E})(),re=Q.prototype;return z.prototype=re,[["$ms",i],["$s",a],["$m",c],["$H",u],["$W",m],["$M",g],["$y",P],["$D",O]].forEach((function(E){re[E[1]]=function(v){return this.$g(v,E[0],E[1])}})),z.extend=function(E,v){return E.$i||(E(v,Q,z),E.$i=!0),z},z.locale=N,z.isDayjs=L,z.unix=function(E){return z(1e3*E)},z.en=$[Y],z.Ls=$,z.p={},z}))})(ke)),ke.exports}var _t=Et();const l=Ee(_t);var De={exports:{}},Ot=De.exports,qe;function Ct(){return qe||(qe=1,(function(e,t){(function(r,n){e.exports=n()})(Ot,(function(){var r="minute",n=/[+-]\d\d(?::?\d\d)?/g,s=/([+-]|\d\d)/g;return function(i,a,c){var u=a.prototype;c.utc=function(b){var y={date:b,utc:!0,args:arguments};return new a(y)},u.utc=function(b){var y=c(this.toDate(),{locale:this.$L,utc:!0});return b?y.add(this.utcOffset(),r):y},u.local=function(){return c(this.toDate(),{locale:this.$L,utc:!1})};var m=u.parse;u.parse=function(b){b.utc&&(this.$u=!0),this.$utils().u(b.$offset)||(this.$offset=b.$offset),m.call(this,b)};var D=u.init;u.init=function(){if(this.$u){var b=this.$d;this.$y=b.getUTCFullYear(),this.$M=b.getUTCMonth(),this.$D=b.getUTCDate(),this.$W=b.getUTCDay(),this.$H=b.getUTCHours(),this.$m=b.getUTCMinutes(),this.$s=b.getUTCSeconds(),this.$ms=b.getUTCMilliseconds()}else D.call(this)};var g=u.utcOffset;u.utcOffset=function(b,y){var S=this.$utils().u;if(S(b))return this.$u?0:S(this.$offset)?g.call(this):this.$offset;if(typeof b=="string"&&(b=(function(Y){Y===void 0&&(Y="");var $=Y.match(n);if(!$)return null;var V=(""+$[0]).match(s)||["-",0,0],L=V[0],N=60*+V[1]+ +V[2];return N===0?0:L==="+"?N:-N})(b),b===null))return this;var C=Math.abs(b)<=16?60*b:b;if(C===0)return this.utc(y);var R=this.clone();if(y)return R.$offset=C,R.$u=!1,R;var K=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(R=this.local().add(C+K,r)).$offset=C,R.$x.$localOffset=K,R};var j=u.format;u.format=function(b){var y=b||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return j.call(this,y)},u.valueOf=function(){var b=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*b},u.isUTC=function(){return!!this.$u},u.toISOString=function(){return this.toDate().toISOString()},u.toString=function(){return this.toDate().toUTCString()};var P=u.toDate;u.toDate=function(b){return b==="s"&&this.$offset?c(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():P.call(this)};var O=u.diff;u.diff=function(b,y,S){if(b&&this.$u===b.$u)return O.call(this,b,y,S);var C=this.local(),R=c(b).local();return O.call(C,R,y,S)}}}))})(De)),De.exports}var Mt=Ct();const Ft=Ee(Mt);var je={exports:{}},Pt=je.exports,Ne;function Vt(){return Ne||(Ne=1,(function(e,t){(function(r,n){e.exports=n()})(Pt,(function(){var r={year:0,month:1,day:2,hour:3,minute:4,second:5},n={};return function(s,i,a){var c,u=function(j,P,O){O===void 0&&(O={});var b=new Date(j),y=(function(S,C){C===void 0&&(C={});var R=C.timeZoneName||"short",K=S+"|"+R,Y=n[K];return Y||(Y=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:S,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:R}),n[K]=Y),Y})(P,O);return y.formatToParts(b)},m=function(j,P){for(var O=u(j,P),b=[],y=0;y<O.length;y+=1){var S=O[y],C=S.type,R=S.value,K=r[C];K>=0&&(b[K]=parseInt(R,10))}var Y=b[3],$=Y===24?0:Y,V=b[0]+"-"+b[1]+"-"+b[2]+" "+$+":"+b[4]+":"+b[5]+":000",L=+j;return(a.utc(V).valueOf()-(L-=L%1e3))/6e4},D=i.prototype;D.tz=function(j,P){j===void 0&&(j=c);var O,b=this.utcOffset(),y=this.toDate(),S=y.toLocaleString("en-US",{timeZone:j}),C=Math.round((y-new Date(S))/1e3/60),R=15*-Math.round(y.getTimezoneOffset()/15)-C;if(!Number(R))O=this.utcOffset(0,P);else if(O=a(S,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(R,!0),P){var K=O.utcOffset();O=O.add(b-K,"minute")}return O.$x.$timezone=j,O},D.offsetName=function(j){var P=this.$x.$timezone||a.tz.guess(),O=u(this.valueOf(),P,{timeZoneName:j}).find((function(b){return b.type.toLowerCase()==="timezonename"}));return O&&O.value};var g=D.startOf;D.startOf=function(j,P){if(!this.$x||!this.$x.$timezone)return g.call(this,j,P);var O=a(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return g.call(O,j,P).tz(this.$x.$timezone,!0)},a.tz=function(j,P,O){var b=O&&P,y=O||P||c,S=m(+a(),y);if(typeof j!="string")return a(j).tz(y);var C=(function($,V,L){var N=$-60*V*1e3,z=m(N,L);if(V===z)return[N,V];var A=m(N-=60*(z-V)*1e3,L);return z===A?[N,z]:[$-60*Math.min(z,A)*1e3,Math.max(z,A)]})(a.utc(j,b).valueOf(),S,y),R=C[0],K=C[1],Y=a(R).utcOffset(K);return Y.$x.$timezone=y,Y},a.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},a.tz.setDefault=function(j){c=j}}}))})(je)),je.exports}var At=Vt();const It=Ee(At),Lt=(e,t="en-US")=>new Intl.DateTimeFormat(t,{timeZone:e,timeZoneName:"long"}).formatToParts(new Date).find(r=>r.type==="timeZoneName")?.value||"",zt=e=>{const t=e[0]==="-"?-1:1,[r,n]=e.slice(1).split(":").map(Number);return t*(r*60+n)};l.extend(Ft);l.extend(It);const Rt=()=>Intl.supportedValuesOf("timeZone").map(t=>{const r=l().tz(t).format("Z");return{name:t,longName:Lt(t),currentTime:l().tz(t).format("h:mm A"),utcOffset:r,offsetMinutes:zt(r)}}).sort((t,r)=>t.offsetMinutes-r.offsetMinutes),Yt={"list-container":"_list-container_jrnm0_5"},Le={"form-container":"_form-container_1xxf4_1"},st=f.createContext(void 0),ot=()=>{const e=f.useContext(st);if(!e)throw new Error("usePopoverContext must be used within a PopoverProvider");return e},Kt=({children:e})=>{const[t,r]=f.useState(!1),n=()=>{r(!1)};return d.jsx(st.Provider,{value:{popoverOpened:t,setPopoverOpened:r,closePopover:n},children:e})},ze=()=>{const{theme:e}=Ie(),{closePopover:t}=ot();return d.jsx(w.Flex,{justify:"flex-end",children:d.jsxs(w.Flex,{columnGap:16,children:[d.jsx(w.Button,{size:"xs",variant:"subtle",color:e.primaryColor,onClick:t,children:"Cancel"}),d.jsx(w.Button,{type:"submit",size:"xs",color:e.primaryColor,children:"Apply"})]})})},ee="YYYY/MM/DD",ae="HH:mm:ss",Me=e=>e.timezone.name?l().tz(e.timezone.name).format(ae):l().format(ae),it=e=>e.timezone.name?l().tz(e.timezone.name).format(ee):l().format(ee),Ut=e=>l().add(e,"day").format(ee),Wt=e=>e&&l().tz(e).format("Z"),qt=e=>`${l(e.startDate).format(ee)} ${e.startTime} - ${l(e.endDate).format(ee)} ${e.endTime} (${Wt(e.timezone.name)})`,ne=(e,t,r,n)=>{const s=l(`${e} ${t}`).subtract(r,n);return{date:s.format(ee),time:s.format(ae)}},se=(e,t,r,n)=>{const s=l(`${e} ${t}`).add(r,n);return{date:s.format(ee),time:s.format(ae)}},he=(e,t,r)=>l.tz(`${e} ${t}`,`${ee} ${ae}`,r).utc().toISOString(),ye=(e,t)=>{const r=l.utc(e).tz(t);return{date:r.format(ee),time:r.format(ae)}},at=({tzRange:e})=>{const[t,r]=f.useState(e.timezone),[n,s]=f.useState([]),[i,a]=f.useState(""),c=f.useMemo(()=>Rt(),[]);f.useEffect(()=>{s(c)},[]),tt(()=>{if(i===""){s(c);return}s(c.filter(g=>g.name.toLowerCase().includes(i.toLocaleLowerCase())||g.longName.toLowerCase().includes(i.toLocaleLowerCase())||g.currentTime.toLowerCase().includes(i.toLocaleLowerCase())||g.utcOffset.toLowerCase().includes(i.toLocaleLowerCase())))},250,[i]);const u=g=>{r(g)},m=g=>{if(g.preventDefault(),!t?.name||!e.timezone.name||!e.startDate||!e.startTime||!e.endDate||!e.endTime)return;const j=he(e.startDate,e.startTime,e.timezone.name),P=he(e.endDate,e.endTime,e.timezone.name),O=ye(j,t.name),b=ye(P,t.name);e.onApply({startDate:O.date,startTime:O.time,endDate:b.date,endTime:b.time,timezone:t||{name:null,longName:null,utcOffset:null}})},D=g=>g?l().tz(g).format("h:mm A"):"";return d.jsxs("form",{className:Le["form-container"],onSubmit:m,children:[d.jsxs(w.Flex,{direction:"column",style:{height:"calc(100% - 40px)"},children:[d.jsx(w.Box,{style:{width:"95%"},mx:"auto",children:d.jsx(jt,{searchText:i,setSearchText:a})}),d.jsxs(w.Box,{style:{overflowY:"scroll"},children:[d.jsx(w.Text,{fw:600,px:12,children:"My Location"}),d.jsx(w.Flex,{direction:"column",children:d.jsx(Ue,{isBrowserTimezone:!0,name:e.timezone?.name,longName:e.timezone?.longName,currentTime:D(e.timezone?.name),utcOffset:e.timezone?.utcOffset,selectedTimezone:t})}),d.jsx(w.Text,{fw:600,px:12,children:"Locations"}),d.jsx(w.Flex,{direction:"column",className:Yt["list-container"],children:n.map((g,j)=>d.jsx(Ue,{name:g.name,longName:g.longName,currentTime:g.currentTime,utcOffset:g.utcOffset,selectedTimezone:t,handleTimezoneMouseClick:u},j))})]})]}),d.jsx(w.Box,{px:12,children:d.jsx(ze,{})})]})},ve={"sidebar-container":"_sidebar-container_e18ka_1","sidebar-row":"_sidebar-row_e18ka_5"},He=e=>[{label:"Today",searchKey:"today",startTime:l().tz(e).startOf("day").format(),endTime:l().tz(e).endOf("day").format()},{label:"Tomorrow",searchKey:"tomorrow",startTime:l().tz(e).add(1,"day").startOf("day").format(),endTime:l().tz(e).add(1,"day").endOf("day").format()},{label:"Yesterday",searchKey:"yesterday",startTime:l().tz(e).subtract(1,"day").startOf("day").format(),endTime:l().tz(e).subtract(1,"day").endOf("day").format(),lineBreak:!0},{label:"Last 15 seconds",searchKey:"-15s",startTime:l().tz(e).subtract(15,"second").format(),endTime:l().tz(e).format()},{label:"Last 30 seconds",searchKey:"-30s",startTime:l().tz(e).subtract(30,"second").format(),endTime:l().tz(e).format()},{label:"Next 15 seconds",searchKey:"+15s",startTime:l().tz(e).format(),endTime:l().tz(e).add(15,"second").format()},{label:"Next 30 seconds",searchKey:"+30s",startTime:l().tz(e).format(),endTime:l().tz(e).add(30,"second").format(),lineBreak:!0},{label:"Last 5 minutes",searchKey:"-5m",startTime:l().tz(e).subtract(5,"minute").format(),endTime:l().tz(e).format()},{label:"Last 10 minutes",searchKey:"-10m",startTime:l().tz(e).subtract(10,"minute").format(),endTime:l().tz(e).format()},{label:"Last 15 minutes",searchKey:"-15m",startTime:l().tz(e).subtract(15,"minute").format(),endTime:l().tz(e).format()},{label:"Last 30 minutes",searchKey:"-30m",startTime:l().tz(e).subtract(30,"minute").format(),endTime:l().tz(e).format()},{label:"Last 45 minutes",searchKey:"-45m",startTime:l().tz(e).subtract(45,"minute").format(),endTime:l().tz(e).format()},{label:"Next 5 minutes",searchKey:"+5m",startTime:l().tz(e).format(),endTime:l().tz(e).add(5,"minute").format()},{label:"Next 10 minutes",searchKey:"+10m",startTime:l().tz(e).format(),endTime:l().tz(e).add(10,"minute").format()},{label:"Next 15 minutes",searchKey:"+15m",startTime:l().tz(e).format(),endTime:l().tz(e).add(15,"minute").format()},{label:"Next 30 minutes",searchKey:"+30m",startTime:l().tz(e).format(),endTime:l().tz(e).add(30,"minute").format()},{label:"Next 45 minutes",searchKey:"+45m",startTime:l().tz(e).format(),endTime:l().tz(e).add(45,"minute").format(),lineBreak:!0},{label:"Last 1 hour",searchKey:"-1h",startTime:l().tz(e).subtract(1,"hour").format(),endTime:l().tz(e).format()},{label:"Last 3 hours",searchKey:"-3h",startTime:l().tz(e).subtract(3,"hour").format(),endTime:l().tz(e).format()},{label:"Last 6 hours",searchKey:"-6h",startTime:l().tz(e).subtract(6,"hour").format(),endTime:l().tz(e).format()},{label:"Last 12 hours",searchKey:"-12h",startTime:l().tz(e).subtract(12,"hour").format(),endTime:l().tz(e).format()},{label:"Next 1 hour",searchKey:"+1h",startTime:l().tz(e).format(),endTime:l().tz(e).add(1,"hour").format()},{label:"Next 3 hours",searchKey:"+3h",startTime:l().tz(e).format(),endTime:l().tz(e).add(3,"hour").format()},{label:"Next 6 hours",searchKey:"+6h",startTime:l().tz(e).format(),endTime:l().tz(e).add(6,"hour").format()},{label:"Next 12 hours",searchKey:"+12h",startTime:l().tz(e).format(),endTime:l().tz(e).add(12,"hour").format(),lineBreak:!0},{label:"Last 1 day",searchKey:"-1d",startTime:l().tz(e).subtract(1,"day").format(),endTime:l().tz(e).format()},{label:"Last 2 days",searchKey:"-2d",startTime:l().tz(e).subtract(2,"day").format(),endTime:l().tz(e).format()},{label:"Last 7 days",searchKey:"-7d",startTime:l().tz(e).subtract(7,"day").format(),endTime:l().tz(e).format()},{label:"Last 14 days",searchKey:"-14d",startTime:l().tz(e).subtract(14,"day").format(),endTime:l().tz(e).format()},{label:"Last 30 days",searchKey:"-30d",startTime:l().tz(e).subtract(30,"day").format(),endTime:l().tz(e).format()},{label:"Next 1 day",searchKey:"+1d",startTime:l().tz(e).format(),endTime:l().tz(e).add(1,"day").format()},{label:"Next 2 days",searchKey:"+2d",startTime:l().tz(e).format(),endTime:l().tz(e).add(2,"day").format()},{label:"Next 7 days",searchKey:"+7d",startTime:l().tz(e).format(),endTime:l().tz(e).add(7,"day").format()},{label:"Next 14 days",searchKey:"+14d",startTime:l().tz(e).format(),endTime:l().tz(e).add(14,"day").format()},{label:"Next 30 days",searchKey:"+30d",startTime:l().tz(e).format(),endTime:l().tz(e).add(30,"day").format()}],xe={"relative-time-panel-container":"_relative-time-panel-container_jsk5z_1","time-row":"_time-row_jsk5z_6","time-row-dark":"_time-row-dark_jsk5z_10","time-row-light":"_time-row-light_jsk5z_16"},Nt=({tzRange:e})=>{const[t,r]=f.useState([]),[n,s]=f.useState(""),{colorScheme:i}=Ie();f.useEffect(()=>{if(e.timezone.name!==null){const c=He(e.timezone.name);r(c)}},[e.timezone]),tt(()=>{if(n===""){r(He(e.timezone.name));return}const c=t.filter(u=>u.searchKey.includes(n));r(c)},250,[n]);const a=c=>{const[u,m]=c.startTime.split("T"),[D,g]=c.endTime.split("T");e.onApply({startDate:u,startTime:m.slice(0,8),endDate:D,endTime:g.slice(0,8),timezone:e.timezone})};return d.jsxs(d.Fragment,{children:[d.jsx(w.Box,{style:{width:"90%"},mx:"auto",children:d.jsx(w.Input,{placeholder:"Relative time (15m, 1h, 1d, 1w)",value:n,onChange:c=>s(c.currentTarget.value)})}),d.jsx(w.Flex,{direction:"column",className:xe["relative-time-panel-container"],children:t.map(c=>d.jsxs(w.Flex,{align:"center",justify:"space-between",className:nt(i==="dark"?xe["time-row-dark"]:xe["time-row-light"],xe["time-row"]),py:4,px:12,mb:c.lineBreak?8:0,onClick:()=>a(c),children:[d.jsx(w.Text,{size:"sm",children:c.label}),d.jsx(w.Text,{size:"xs",c:"#5f6368",children:c.searchKey})]},c.label))})]})},Ht=({setSelectedPanel:e,tzRange:t})=>d.jsxs(w.Box,{className:ve["sidebar-container"],flex:1,children:[d.jsx(Nt,{tzRange:t}),d.jsxs(w.Flex,{direction:"column",rowGap:16,py:8,style:{borderTop:"1px solid #ddd"},children:[d.jsxs(w.Flex,{className:ve["sidebar-row"],justify:"space-between",align:"center",px:12,onClick:()=>e(me.START_END_TIME),children:[d.jsxs(w.Flex,{align:"center",children:[d.jsx(Dt,{stroke:1.5}),d.jsx(w.Text,{size:"sm",children:"Start and end times"})]}),d.jsx(_e,{stroke:1.5})]}),d.jsxs(w.Flex,{className:ve["sidebar-row"],justify:"space-between",align:"center",px:12,onClick:()=>e(me.AROUND_TIME),children:[d.jsxs(w.Flex,{align:"center",children:[d.jsx(we,{stroke:1.5}),d.jsx(w.Text,{size:"sm",children:"Around a time"})]}),d.jsx(_e,{stroke:1.5})]}),d.jsxs(w.Flex,{className:ve["sidebar-row"],justify:"space-between",align:"center",px:12,onClick:()=>e(me.TIMEZONE),children:[d.jsxs(w.Flex,{align:"center",children:[d.jsx($t,{stroke:1.5}),d.jsx(w.Text,{size:"sm",children:"Time zone"})]}),d.jsx(_e,{stroke:1.5})]})]})]});var ct=(e=>(e.ThirtySeconds="± 30 seconds",e.OneMinute="± 1 minute",e.FifteenMinutes="± 15 minutes",e.ThirtyMinutes="± 30 minutes",e.OneHour="± 1 hour",e.OneDay="± 1 day",e))(ct||{});const Bt=["± 30 seconds","± 1 minute","± 15 minutes","± 30 minutes","± 1 hour","± 1 day"],Zt=(e,t,r)=>{switch(r){case"± 30 seconds":const n=ne(e,t,30,"second"),s=se(e,t,30,"second");return{startDate:n.date,startTime:n.time,endDate:s.date,endTime:s.time};case"± 1 minute":const i=ne(e,t,1,"minute"),a=se(e,t,1,"minute");return{startDate:i.date,startTime:i.time,endDate:a.date,endTime:a.time};case"± 15 minutes":const c=ne(e,t,15,"minute"),u=se(e,t,15,"minute");return{startDate:c.date,startTime:c.time,endDate:u.date,endTime:u.time};case"± 30 minutes":const m=ne(e,t,30,"minute"),D=se(e,t,30,"minute");return{startDate:m.date,startTime:m.time,endDate:D.date,endTime:D.time};case"± 1 hour":const g=ne(e,t,1,"hour"),j=se(e,t,1,"hour");return{startDate:g.date,startTime:g.time,endDate:j.date,endTime:j.time};case"± 1 day":const P=ne(e,t,1,"day"),O=se(e,t,1,"day");return{startDate:P.date,startTime:P.time,endDate:O.date,endTime:O.time};default:return{startDate:e,startTime:t,endDate:e,endTime:t}}};function Jt(e){if(!/^[0-9a-zA-Z-]+$/.test(e))throw new Error(`[@mantine/use-form] Form name "${e}" is invalid, it should contain only letters, numbers and dashes`)}const Gt=typeof window<"u"?f.useLayoutEffect:f.useEffect;function J(e,t){Gt(()=>{if(e)return window.addEventListener(e,t),()=>window.removeEventListener(e,t)},[e])}function Xt(e,t){e&&Jt(e),J(`mantine-form:${e}:set-field-value`,r=>t.setFieldValue(r.detail.path,r.detail.value)),J(`mantine-form:${e}:set-values`,r=>t.setValues(r.detail)),J(`mantine-form:${e}:set-initial-values`,r=>t.setInitialValues(r.detail)),J(`mantine-form:${e}:set-errors`,r=>t.setErrors(r.detail)),J(`mantine-form:${e}:set-field-error`,r=>t.setFieldError(r.detail.path,r.detail.error)),J(`mantine-form:${e}:clear-field-error`,r=>t.clearFieldError(r.detail)),J(`mantine-form:${e}:clear-errors`,t.clearErrors),J(`mantine-form:${e}:reset`,t.reset),J(`mantine-form:${e}:validate`,t.validate),J(`mantine-form:${e}:validate-field`,r=>t.validateField(r.detail)),J(`mantine-form:${e}:reorder-list-item`,r=>t.reorderListItem(r.detail.path,r.detail.payload)),J(`mantine-form:${e}:remove-list-item`,r=>t.removeListItem(r.detail.path,r.detail.index)),J(`mantine-form:${e}:insert-list-item`,r=>t.insertListItem(r.detail.path,r.detail.item,r.detail.index)),J(`mantine-form:${e}:set-dirty`,r=>t.setDirty(r.detail)),J(`mantine-form:${e}:set-touched`,r=>t.setTouched(r.detail)),J(`mantine-form:${e}:reset-dirty`,r=>t.resetDirty(r.detail)),J(`mantine-form:${e}:reset-touched`,t.resetTouched)}function Qt(e){return t=>{if(!t)e(t);else if(typeof t=="function")e(t);else if(typeof t=="object"&&"nativeEvent"in t){const{currentTarget:r}=t;r instanceof HTMLInputElement?r.type==="checkbox"?e(r.checked):e(r.value):(r instanceof HTMLTextAreaElement||r instanceof HTMLSelectElement)&&e(r.value)}else e(t)}}function Fe(e){return e===null||typeof e!="object"?{}:Object.keys(e).reduce((t,r)=>{const n=e[r];return n!=null&&n!==!1&&(t[r]=n),t},{})}function er(e){const[t,r]=f.useState(Fe(e)),n=f.useRef(t),s=f.useCallback(u=>{r(m=>{const D=Fe(typeof u=="function"?u(m):u);return n.current=D,D})},[]),i=f.useCallback(()=>s({}),[]),a=f.useCallback(u=>{n.current[u]!==void 0&&s(m=>{const D={...m};return delete D[u],D})},[t]),c=f.useCallback((u,m)=>{m==null||m===!1?a(u):n.current[u]!==m&&s(D=>({...D,[u]:m}))},[t]);return{errorsState:t,setErrors:s,clearErrors:i,setFieldError:c,clearFieldError:a}}function Pe(e,t){if(t===null||typeof t!="object")return{};const r={...t};return Object.keys(t).forEach(n=>{n.includes(`${String(e)}.`)&&delete r[n]}),r}function Be(e,t){const r=e.substring(t.length+1).split(".")[0];return parseInt(r,10)}function Ze(e,t,r,n){if(t===void 0)return r;const s=`${String(e)}`;let i=r;n===-1&&(i=Pe(`${s}.${t}`,i));const a={...i},c=new Set;return Object.entries(i).filter(([u])=>{if(!u.startsWith(`${s}.`))return!1;const m=Be(u,s);return Number.isNaN(m)?!1:m>=t}).forEach(([u,m])=>{const D=Be(u,s),g=u.replace(`${s}.${D}`,`${s}.${D+n}`);a[g]=m,c.add(g),c.has(u)||delete a[u]}),a}function tr(e,{from:t,to:r},n){const s=`${e}.${t}`,i=`${e}.${r}`,a={...n},c=new Set;return Object.keys(n).forEach(u=>{if(c.has(u))return;let m,D;if(u.startsWith(s)?(m=u,D=u.replace(s,i)):u.startsWith(i)&&(m=u.replace(i,s),D=u),m&&D){const g=a[m],j=a[D];j===void 0?delete a[m]:a[m]=j,g===void 0?delete a[D]:a[D]=g,c.add(m),c.add(D)}}),a}function Je(e,t,r){typeof r.value=="object"&&(r.value=ie(r.value)),!r.enumerable||r.get||r.set||!r.configurable||!r.writable||t==="__proto__"?Object.defineProperty(e,t,r):e[t]=r.value}function ie(e){if(typeof e!="object")return e;var t=0,r,n,s,i=Object.prototype.toString.call(e);if(i==="[object Object]"?s=Object.create(e.__proto__||null):i==="[object Array]"?s=Array(e.length):i==="[object Set]"?(s=new Set,e.forEach(function(a){s.add(ie(a))})):i==="[object Map]"?(s=new Map,e.forEach(function(a,c){s.set(ie(c),ie(a))})):i==="[object Date]"?s=new Date(+e):i==="[object RegExp]"?s=new RegExp(e.source,e.flags):i==="[object DataView]"?s=new e.constructor(ie(e.buffer)):i==="[object ArrayBuffer]"?s=e.slice(0):i.slice(-6)==="Array]"&&(s=new e.constructor(e)),s){for(n=Object.getOwnPropertySymbols(e);t<n.length;t++)Je(s,n[t],Object.getOwnPropertyDescriptor(e,n[t]));for(t=0,n=Object.getOwnPropertyNames(e);t<n.length;t++)Object.hasOwnProperty.call(s,r=n[t])&&s[r]===e[r]||Je(s,r,Object.getOwnPropertyDescriptor(e,r))}return s||e}function ut(e){return typeof e!="string"?[]:e.split(".")}function B(e,t){const r=ut(e);if(r.length===0||typeof t!="object"||t===null)return;let n=t[r[0]];for(let s=1;s<r.length&&n!=null;s+=1)n=n[r[s]];return n}function Te(e,t,r){const n=ut(e);if(n.length===0)return r;const s=ie(r);if(n.length===1)return s[n[0]]=t,s;let i=s[n[0]];for(let a=1;a<n.length-1;a+=1){if(i===void 0)return s;i=i[n[a]]}return i[n[n.length-1]]=t,s}function rr(e,{from:t,to:r},n){const s=B(e,n);if(!Array.isArray(s))return n;const i=[...s],a=s[t];return i.splice(t,1),i.splice(r,0,a),Te(e,i,n)}function nr(e,t,r,n){const s=B(e,n);if(!Array.isArray(s))return n;const i=[...s];return i.splice(typeof r=="number"?r:i.length,0,t),Te(e,i,n)}function sr(e,t,r){const n=B(e,r);return Array.isArray(n)?Te(e,n.filter((s,i)=>i!==t),r):r}function or(e,t,r,n){const s=B(e,n);if(!Array.isArray(s)||s.length<=r)return n;const i=[...s];return i[r]=t,Te(e,i,n)}function ir({$values:e,$errors:t,$status:r}){const n=f.useCallback((c,u)=>{r.clearFieldDirty(c),t.setErrors(m=>tr(c,u,m)),e.setValues({values:rr(c,u,e.refValues.current),updateState:!0})},[]),s=f.useCallback((c,u)=>{r.clearFieldDirty(c),t.setErrors(m=>Ze(c,u,m,-1)),e.setValues({values:sr(c,u,e.refValues.current),updateState:!0})},[]),i=f.useCallback((c,u,m)=>{r.clearFieldDirty(c),t.setErrors(D=>Ze(c,m,D,1)),e.setValues({values:nr(c,u,m,e.refValues.current),updateState:!0})},[]),a=f.useCallback((c,u,m)=>{r.clearFieldDirty(c),e.setValues({values:or(c,m,u,e.refValues.current),updateState:!0})},[]);return{reorderListItem:n,removeListItem:s,insertListItem:i,replaceListItem:a}}var Oe,Ge;function ar(){return Ge||(Ge=1,Oe=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,s,i;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(s=n;s--!==0;)if(!e(t[s],r[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(i=Object.keys(t),n=i.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[s]))return!1;for(s=n;s--!==0;){var a=i[s];if(!e(t[a],r[a]))return!1}return!0}return t!==t&&r!==r}),Oe}var cr=ar();const ge=Ee(cr);function fe(e,t){const r=Object.keys(e);if(typeof t=="string"){const n=r.filter(s=>s.startsWith(`${t}.`));return e[t]||n.some(s=>e[s])||!1}return r.some(n=>e[n])}function ur({initialDirty:e,initialTouched:t,mode:r,$values:n}){const[s,i]=f.useState(t),[a,c]=f.useState(e),u=f.useRef(t),m=f.useRef(e),D=f.useCallback($=>{const V=typeof $=="function"?$(u.current):$;u.current=V,r==="controlled"&&i(V)},[]),g=f.useCallback(($,V=!1)=>{const L=typeof $=="function"?$(m.current):$;m.current=L,(r==="controlled"||V)&&c(L)},[]),j=f.useCallback(()=>D({}),[]),P=f.useCallback($=>{const V=$?{...n.refValues.current,...$}:n.refValues.current;n.setValuesSnapshot(V),g({})},[]),O=f.useCallback(($,V)=>{D(L=>fe(L,$)===V?L:{...L,[$]:V})},[]),b=f.useCallback(($,V,L)=>{g(N=>fe(N,$)===V?N:{...N,[$]:V},L)},[]),y=f.useCallback(($,V)=>{const L=fe(m.current,$),N=!ge(B($,n.getValuesSnapshot()),V),z=Pe($,m.current);z[$]=N,g(z,L!==N)},[]),S=f.useCallback($=>fe(u.current,$),[]),C=f.useCallback($=>g(V=>{if(typeof $!="string")return V;const L=Pe($,V);return delete L[$],ge(L,V)?V:L}),[]),R=f.useCallback($=>{if($){const L=B($,m.current);if(typeof L=="boolean")return L;const N=B($,n.refValues.current),z=B($,n.valuesSnapshot.current);return!ge(N,z)}return Object.keys(m.current).length>0?fe(m.current):!ge(n.refValues.current,n.valuesSnapshot.current)},[]),K=f.useCallback(()=>m.current,[]),Y=f.useCallback(()=>u.current,[]);return{touchedState:s,dirtyState:a,touchedRef:u,dirtyRef:m,setTouched:D,setDirty:g,resetDirty:P,resetTouched:j,isTouched:S,setFieldTouched:O,setFieldDirty:b,setTouchedState:i,setDirtyState:c,clearFieldDirty:C,isDirty:R,getDirty:K,getTouched:Y,setCalculatedFieldDirty:y}}function lr({initialValues:e,onValuesChange:t,mode:r}){const n=f.useRef(!1),[s,i]=f.useState(e||{}),a=f.useRef(s),c=f.useRef(s),u=f.useCallback(({values:y,subscribers:S,updateState:C=!0,mergeWithPreviousValues:R=!0})=>{const K=a.current,Y=y instanceof Function?y(a.current):y,$=R?{...K,...Y}:Y;a.current=$,C&&(i($),r==="uncontrolled"&&(a.current=$)),t?.($,K),S?.filter(Boolean).forEach(V=>V({updatedValues:$,previousValues:K}))},[t]),m=f.useCallback(y=>{const S=B(y.path,a.current),C=y.value instanceof Function?y.value(S):y.value;if(S!==C){const R=a.current,K=Te(y.path,C,a.current);u({values:K,updateState:y.updateState}),y.subscribers?.filter(Boolean).forEach(Y=>Y({path:y.path,updatedValues:K,previousValues:R}))}},[u]),D=f.useCallback(y=>{c.current=y},[]),g=f.useCallback((y,S)=>{n.current||(n.current=!0,u({values:y,updateState:r==="controlled"}),D(y),S())},[u]),j=f.useCallback(()=>{u({values:c.current,updateState:!0,mergeWithPreviousValues:!1})},[u]),P=f.useCallback(()=>a.current,[]),O=f.useCallback(()=>c.current,[]),b=f.useCallback((y,S)=>{const C=B(y,c.current);typeof C>"u"||m({path:y,value:C,updateState:r==="controlled",subscribers:S})},[m,r]);return{initialized:n,stateValues:s,refValues:a,valuesSnapshot:c,setValues:u,setFieldValue:m,resetValues:j,setValuesSnapshot:D,initialize:g,getValues:P,getValuesSnapshot:O,resetField:b}}function dr({$status:e,cascadeUpdates:t}){const r=f.useRef({}),n=f.useCallback((i,a)=>{f.useEffect(()=>(r.current[i]=r.current[i]||[],r.current[i].push(a),()=>{r.current[i]=r.current[i].filter(c=>c!==a)}),[a])},[]),s=f.useCallback(i=>{const a=r.current[i]?.map(c=>u=>c({previousValue:B(i,u.previousValues),value:B(i,u.updatedValues),touched:e.isTouched(i),dirty:e.isDirty(i)}))??[];if(t)for(const c in r.current)(c.startsWith(`${i}.`)||i.startsWith(`${c}.`))&&a.push(...r.current[c].map(u=>m=>u({previousValue:B(c,m.previousValues),value:B(c,m.updatedValues),touched:e.isTouched(c),dirty:e.isDirty(c)})));return a},[]);return{subscribers:r,watch:n,getFieldSubscribers:s}}function Xe(e,t){return e?`${e}-${t.toString()}`:t.toString()}const Se=Symbol("root-rule");function Qe(e){const t=Fe(e);return{hasErrors:Object.keys(t).length>0,errors:t}}function Ve(e,t,r="",n={}){return typeof e!="object"||e===null?n:Object.keys(e).reduce((s,i)=>{const a=e[i],c=`${r===""?"":`${r}.`}${i}`,u=B(c,t);let m=!1;return typeof a=="function"&&(s[c]=a(u,t,c)),typeof a=="object"&&Array.isArray(u)&&(m=!0,u.forEach((D,g)=>Ve(a,t,`${c}.${g}`,s)),Se in a&&(s[c]=a[Se](u,t,c))),typeof a=="object"&&typeof u=="object"&&u!==null&&(m||Ve(a,t,c,s),Se in a&&(s[c]=a[Se](u,t,c))),s},n)}function Ae(e,t){return Qe(typeof e=="function"?e(t):Ve(e,t))}function $e(e,t,r){if(typeof e!="string")return{hasError:!1,error:null};const n=Ae(t,r),s=Object.keys(n.errors).find(i=>e.split(".").every((a,c)=>a===i.split(".")[c]));return{hasError:!!s,error:s?n.errors[s]:null}}const fr="__MANTINE_FORM_INDEX__";function et(e,t){return t?typeof t=="boolean"?t:Array.isArray(t)?t.includes(e.replace(/[.][0-9]+/g,`.${fr}`)):!1:!1}function lt({name:e,mode:t="controlled",initialValues:r,initialErrors:n={},initialDirty:s={},initialTouched:i={},clearInputErrorOnChange:a=!0,validateInputOnChange:c=!1,validateInputOnBlur:u=!1,onValuesChange:m,transformValues:D=(y=>y),enhanceGetInputProps:g,validate:j,onSubmitPreventDefault:P="always",touchTrigger:O="change",cascadeUpdates:b=!1}={}){const y=er(n),S=lr({initialValues:r,onValuesChange:m,mode:t}),C=ur({initialDirty:s,initialTouched:i,$values:S,mode:t}),R=ir({$values:S,$errors:y,$status:C}),K=dr({$status:C,cascadeUpdates:b}),[Y,$]=f.useState(0),[V,L]=f.useState({}),[N,z]=f.useState(!1),A=f.useCallback(()=>{S.resetValues(),y.clearErrors(),C.resetDirty(),C.resetTouched(),t==="uncontrolled"&&$(p=>p+1)},[]),Q=f.useCallback(p=>{a&&y.clearErrors(),t==="uncontrolled"&&$(_=>_+1),Object.keys(K.subscribers.current).forEach(_=>{const W=B(_,S.refValues.current),U=B(_,p);W!==U&&K.getFieldSubscribers(_).forEach(Z=>Z({previousValues:p,updatedValues:S.refValues.current}))})},[a]),re=f.useCallback(p=>{const _=S.refValues.current;S.initialize(p,()=>t==="uncontrolled"&&$(W=>W+1)),Q(_)},[Q]),E=f.useCallback((p,_,W)=>{const U=et(p,c),Z=_ instanceof Function?_(B(p,S.refValues.current)):_;C.setCalculatedFieldDirty(p,Z),O==="change"&&C.setFieldTouched(p,!0),!U&&a&&y.clearFieldError(p),S.setFieldValue({path:p,value:_,updateState:t==="controlled",subscribers:[...K.getFieldSubscribers(p),U?te=>{const G=$e(p,j,te.updatedValues);G.hasError?y.setFieldError(p,G.error):y.clearFieldError(p)}:null,W?.forceUpdate!==!1&&t!=="controlled"?()=>L(te=>({...te,[p]:(te[p]||0)+1})):null]})},[m,j]),v=f.useCallback(p=>{const _=S.refValues.current;S.setValues({values:p,updateState:t==="controlled"}),Q(_)},[m,Q]),h=f.useCallback(()=>{const p=Ae(j,S.refValues.current);return y.setErrors(p.errors),p},[j]),k=f.useCallback(p=>{const _=$e(p,j,S.refValues.current);return _.hasError?y.setFieldError(p,_.error):y.clearFieldError(p),_},[j]),T=(p,{type:_="input",withError:W=!0,withFocus:U=!0,...Z}={})=>{const G={onChange:Qt(pe=>E(p,pe,{forceUpdate:!1})),"data-path":Xe(e,p)};return W&&(G.error=y.errorsState[p]),_==="checkbox"?G[t==="controlled"?"checked":"defaultChecked"]=B(p,S.refValues.current):G[t==="controlled"?"value":"defaultValue"]=B(p,S.refValues.current),U&&(G.onFocus=()=>C.setFieldTouched(p,!0),G.onBlur=()=>{if(et(p,u)){const pe=$e(p,j,S.refValues.current);pe.hasError?y.setFieldError(p,pe.error):y.clearFieldError(p)}}),Object.assign(G,g?.({inputProps:G,field:p,options:{type:_,withError:W,withFocus:U,...Z},form:X}))},F=(p,_)=>W=>{P==="always"&&W?.preventDefault();const U=h();if(U.hasErrors)P==="validation-failed"&&W?.preventDefault(),_?.(U.errors,S.refValues.current,W);else{const Z=p?.(D(S.refValues.current),W);Z instanceof Promise&&(z(!0),Z.finally(()=>z(!1)))}},o=p=>D(p||S.refValues.current),x=f.useCallback(p=>{p.preventDefault(),A()},[]),M=f.useCallback(p=>p?!$e(p,j,S.refValues.current).hasError:!Ae(j,S.refValues.current).hasErrors,[j]),I=p=>`${Y}-${String(p)}-${V[String(p)]||0}`,q=f.useCallback(p=>document.querySelector(`[data-path="${Xe(e,p)}"]`),[]),H=f.useCallback(p=>{S.resetField(p,[t!=="controlled"?()=>L(_=>({..._,[p]:(_[p]||0)+1})):null])},[S.resetField,t,L]),X={watch:K.watch,initialized:S.initialized.current,values:t==="uncontrolled"?S.refValues.current:S.stateValues,getValues:S.getValues,getInitialValues:S.getValuesSnapshot,setInitialValues:S.setValuesSnapshot,resetField:H,initialize:re,setValues:v,setFieldValue:E,submitting:N,setSubmitting:z,errors:y.errorsState,setErrors:y.setErrors,setFieldError:y.setFieldError,clearFieldError:y.clearFieldError,clearErrors:y.clearErrors,resetDirty:C.resetDirty,setTouched:C.setTouched,setDirty:C.setDirty,isTouched:C.isTouched,resetTouched:C.resetTouched,isDirty:C.isDirty,getTouched:C.getTouched,getDirty:C.getDirty,reorderListItem:R.reorderListItem,insertListItem:R.insertListItem,removeListItem:R.removeListItem,replaceListItem:R.replaceListItem,reset:A,validate:h,validateField:k,getInputProps:T,onSubmit:F,onReset:x,isValid:M,getTransformedValues:o,key:I,getInputNode:q};return Xt(e,X),X}const mr=({tzRange:e})=>{const t=lt({initialValues:{date:e.startDate??it(e),time:e.startTime??Me(e),duration:ct.OneDay},validate:{date:n=>n?null:"Date is required",time:n=>n?null:"Time is required",duration:n=>n?null:"Duration is required"}}),r=n=>{if(!e.timezone.name)return;const s=he(n.date,n.time,e.timezone.name),i=ye(s,e.timezone.name),{startDate:a,startTime:c,endDate:u,endTime:m}=Zt(i.date,i.time,n.duration);e.onApply({startDate:a,startTime:c,endDate:u,endTime:m,timezone:e.timezone})};return d.jsx(w.Flex,{direction:"column",flex:2,justify:"space-between",style:{height:"100%"},px:12,children:d.jsxs("form",{className:Le["form-container"],onSubmit:t.onSubmit(r),children:[d.jsxs(w.Box,{children:[d.jsx(w.Text,{fw:600,children:"Around a time"}),d.jsxs(w.Flex,{direction:"column",gap:8,mt:12,children:[d.jsx(oe.DatePickerInput,{label:"Pick date",placeholder:"Pick date",...t.getInputProps("date"),popoverProps:{withinPortal:!1},valueFormat:ee,leftSection:d.jsx(Ce,{stroke:1.5})},t.key("date")),d.jsx(oe.TimeInput,{label:"Pick time",placeholder:"Pick time",withSeconds:!0,...t.getInputProps("time"),leftSection:d.jsx(we,{stroke:1.5}),rightSection:d.jsx(w.Text,{style:{fontSize:12,fontStyle:"italic",textAlign:"right"},children:e.timezone?.longName}),rightSectionWidth:180,rightSectionProps:{style:{paddingRight:1}}},t.key("time")),d.jsx(w.Select,{label:"Duration",placeholder:"Pick value",data:Bt,...t.getInputProps("duration"),comboboxProps:{withinPortal:!1}},t.key("duration"))]})]}),d.jsx(ze,{})]})})},hr=({tzRange:e})=>{const t=lt({mode:"uncontrolled",initialValues:{startDate:e.startDate??it(e),startTime:e.startTime??Me(e),endDate:e.endDate??Ut(30),endTime:e.endTime??Me(e)},validate:{startDate:n=>n?null:"Start date is required",startTime:n=>n?null:"Start time is required",endDate:(n,s)=>{if(!n)return"End date is required";const i=l(`${s.startDate} ${s.startTime}`),a=l(`${n} ${s.endTime}`);return a.isAfter(i)||a.isSame(i)?null:"End time must be after start time"},endTime:(n,s)=>{if(!n)return"End time is required";const i=l(`${s.startDate} ${s.startTime}`),a=l(`${s.endDate} ${n}`);return a.isAfter(i)||a.isSame(i)?null:"End time must be after start time"}}}),r=n=>{if(!e.timezone.name)return;const s=he(n.startDate,n.startTime,e.timezone.name),i=he(n.endDate,n.endTime,e.timezone.name),a=ye(s,e.timezone.name),c=ye(i,e.timezone.name);e.onApply({startDate:a.date,startTime:a.time,endDate:c.date,endTime:c.time,timezone:e.timezone})};return d.jsx(w.Flex,{direction:"column",flex:2,style:{height:"100%"},px:12,children:d.jsxs("form",{className:Le["form-container"],onSubmit:t.onSubmit(r),children:[d.jsxs(w.Box,{children:[d.jsx(w.Text,{fw:600,children:"Start and end times"}),d.jsxs(w.Flex,{direction:"column",gap:8,mt:12,children:[d.jsx(oe.DatePickerInput,{label:"Start time",...t.getInputProps("startDate"),popoverProps:{withinPortal:!1},valueFormat:ee,leftSection:d.jsx(Ce,{stroke:1.5})},t.key("startDate")),d.jsx(oe.TimeInput,{withSeconds:!0,...t.getInputProps("startTime"),leftSection:d.jsx(we,{stroke:1.5}),rightSection:d.jsx(w.Text,{style:{fontSize:12,fontStyle:"italic"},children:e.timezone?.longName}),rightSectionWidth:180,rightSectionProps:{style:{paddingRight:1}}},t.key("startTime")),d.jsx(oe.DatePickerInput,{label:"End time",...t.getInputProps("endDate"),popoverProps:{withinPortal:!1},valueFormat:ee,leftSection:d.jsx(Ce,{stroke:1.5})},t.key("endDate")),d.jsx(oe.TimeInput,{withSeconds:!0,...t.getInputProps("endTime"),leftSection:d.jsx(we,{stroke:1.5}),rightSection:d.jsx(w.Text,{style:{fontSize:12,fontStyle:"italic"},children:e.timezone?.longName}),rightSectionWidth:180,rightSectionProps:{style:{paddingRight:1}}},t.key("endTime"))]})]}),d.jsx(ze,{})]})})};var me=(e=>(e.START_END_TIME="Start and end times",e.AROUND_TIME="Around a time",e.TIMEZONE="Time zone",e))(me||{});const yr=e=>{const[t,r]=f.useState("Start and end times"),{popoverOpened:n,setPopoverOpened:s}=ot(),i=()=>{switch(t){case"Start and end times":return d.jsx(hr,{tzRange:e});case"Around a time":return d.jsx(mr,{tzRange:e});case"Time zone":return d.jsx(at,{tzRange:e});default:return null}},a=()=>{s(u=>!u)},c=f.useMemo(()=>qt(e),[e.startDate,e.startTime,e.endDate,e.endTime,e.timezone]);return d.jsxs(w.Popover,{position:"bottom",shadow:"md",opened:n,onChange:s,children:[d.jsx(w.Popover.Target,{children:d.jsx(w.Button,{onClick:a,style:e.buttonStyle||{},children:c})}),d.jsx(w.Popover.Dropdown,{style:{width:700,height:400,padding:0},py:8,children:d.jsxs(w.Flex,{style:{height:"100%"},children:[d.jsx(Ht,{tzRange:e,setSelectedPanel:r}),i()]})})]})},Tr=e=>d.jsx(Kt,{children:d.jsx(yr,{...e})});exports.Panel=me;exports.TimezonePanel=at;exports.TimezoneRangePicker=Tr;
|
|
63
63
|
//# sourceMappingURL=index.cjs.js.map
|