import{c as Br,r as E,d as pe,R as U,e as Wn,f as Ln,m as Hn,_ as Pt,g as Gr,P as $,h as Ur,k as qn,q as cr,l as Bn,n as It,o as ur,p as dr,t as Gn,v as Un,w as Kn,x as Kr,y as Zn,z as Jn,A as Et,D as fr,E as pr,F as Zr,G as Vn,b as Y,H as Yn,a as Je,j as d,T as K,J as zt,K as At,L as Xn,M as ae,N as Qn,Q as ea,S as ta,U as Jr,V as A,W as ra,X as na,Y as Vr,B as Se,Z as aa,u as Yr,$ as ue,a0 as oa,a1 as Xr,a2 as vr,a3 as sa,a4 as la,a5 as ia,a6 as ca,a7 as ua,a8 as da,a9 as fa,aa as pa,ab as Qr,ac as va,ad as ha,ae as xt,af as Dt,ag as ma,ah as hr,ai as mr,aj as Wt,ak as Ne,al as gr,am as ga,an as ya,ao as Sa,ap as yr,aq as en,ar as tn,as as be,at as G,au as ba,av as de,aw as wa,ax as Ea,ay as q,az as ve,aA as he,aB as xa,aC as me,aD as we,aE as Ee,aF as ge,aG as Ve,aH as Da,aI as $e,aJ as Ca,aK as rn,aL as Ra,aM as Lt,aN as ka,aO as Ma,aP as $a,aQ as Ta,aR as _a,aS as Ht,aT as ja,aU as Oa,aV as Na,aW as Pa,aX as Ia,aY as za,aZ as Aa,a_ as Fa,a$ as Wa,b0 as La,b1 as Sr,b2 as Ha,b3 as qa,b4 as br,b5 as Ba,b6 as Ga,b7 as je,b8 as Ua,b9 as wr,ba as Ka,bb as Za,bc as Ja,bd as Va,be as Ct,bf as Ya}from"./index-AbGWey75.js";/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Xa=[["path",{d:"M12 9h.01",key:"svg-0"}],["path",{d:"M11 12h1v4h1",key:"svg-1"}],["path",{d:"M12 3c7.2 0 9 1.8 9 9s-1.8 9 -9 9s-9 -1.8 -9 -9s1.8 -9 9 -9z",key:"svg-2"}]],Qa=Br("outline","info-square-rounded","InfoSquareRounded",Xa);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const eo=[["path",{d:"M17 17h2a2 2 0 0 0 2 -2v-4a2 2 0 0 0 -2 -2h-14a2 2 0 0 0 -2 2v4a2 2 0 0 0 2 2h2",key:"svg-0"}],["path",{d:"M17 9v-4a2 2 0 0 0 -2 -2h-6a2 2 0 0 0 -2 2v4",key:"svg-1"}],["path",{d:"M7 13m0 2a2 2 0 0 1 2 -2h6a2 2 0 0 1 2 2v4a2 2 0 0 1 -2 2h-6a2 2 0 0 1 -2 -2z",key:"svg-2"}]],to=Br("outline","printer","Printer",eo);function ro(r,n,o){var t=E.useRef(r!==void 0),e=E.useState(n),a=e[0],s=e[1],i=r!==void 0,l=t.current;return t.current=i,!i&&l&&a!==n&&s(n),[i?r:a,E.useCallback(function(u){for(var c=arguments.length,f=new Array(c>1?c-1:0),p=1;p<c;p++)f[p-1]=arguments[p];o&&o.apply(void 0,[u].concat(f)),s(u)},[o])]}function nn(r){const n=E.useRef(null);return E.useEffect(()=>{n.current=r}),n.current}function no(){const[,r]=E.useReducer(n=>!n,!1);return r}function ao(r,n,o,t=!1){const e=pe(o);E.useEffect(()=>{const a=typeof r=="function"?r():r;return a.addEventListener(n,e,t),()=>a.removeEventListener(n,e,t)},[r])}function oo(r,n,o=!1){const t=E.useCallback(()=>document,[]);return ao(t,r,n,o)}var qt=U.createContext(null),so=function(){};function an(r){r===void 0&&(r={});var n=E.useContext(qt),o=Wn(),t=o[0],e=o[1],a=E.useRef(!1),s=r,i=s.flip,l=s.offset,u=s.rootCloseEvent,c=s.fixed,f=c===void 0?!1:c,p=s.popperConfig,m=p===void 0?{}:p,v=s.usePopper,g=v===void 0?!!n:v,h=(n==null?void 0:n.show)==null?!!r.show:n.show,S=(n==null?void 0:n.alignEnd)==null?r.alignEnd:n.alignEnd;h&&!a.current&&(a.current=!0);var w=function(O){n==null||n.toggle(!1,O)},b=n||{},y=b.drop,x=b.setMenu,D=b.menuElement,R=b.toggleElement,k=S?"bottom-end":"bottom-start";y==="up"?k=S?"top-end":"top-start":y==="right"?k=S?"right-end":"right-start":y==="left"&&(k=S?"left-end":"left-start");var j=Ln(R,D,Hn({placement:k,enabled:!!(g&&h),enableEvents:h,offset:l,flip:i,fixed:f,arrowElement:t,popperConfig:m})),M=Pt({ref:x||so,"aria-labelledby":R==null?void 0:R.id},j.attributes.popper,{style:j.styles.popper}),C={show:h,alignEnd:S,hasShown:a.current,toggle:n==null?void 0:n.toggle,popper:g?j:null,arrowProps:g?Pt({ref:e},j.attributes.arrow,{style:j.styles.arrow}):{}};return Gr(D,w,{clickTrigger:u,disabled:!h}),[M,C]}var lo={children:$.func.isRequired,show:$.bool,alignEnd:$.bool,flip:$.bool,usePopper:$.oneOf([!0,!1]),popperConfig:$.object,rootCloseEvent:$.string},io={usePopper:!0};function Ye(r){var n=r.children,o=Ur(r,["children"]),t=an(o),e=t[0],a=t[1];return U.createElement(U.Fragment,null,a.hasShown?n(e,a):null)}Ye.displayName="ReactOverlaysDropdownMenu";Ye.propTypes=lo;Ye.defaultProps=io;var Er=function(){};function on(){var r=E.useContext(qt)||{},n=r.show,o=n===void 0?!1:n,t=r.toggle,e=t===void 0?Er:t,a=r.setToggle,s=E.useCallback(function(i){e(!o,i)},[o,e]);return[{ref:a||Er,onClick:s,"aria-haspopup":!0,"aria-expanded":!!o},{show:o,toggle:e}]}var co={children:$.func.isRequired};function Bt(r){var n=r.children,o=on(),t=o[0],e=o[1];return U.createElement(U.Fragment,null,n(t,e))}Bt.displayName="ReactOverlaysDropdownToggle";Bt.propTypes=co;var uo={children:$.node,drop:$.oneOf(["up","left","right","down"]),focusFirstItemOnShow:$.oneOf([!1,!0,"keyboard"]),itemSelector:$.string,alignEnd:$.bool,show:$.bool,defaultShow:$.bool,onToggle:$.func};function xr(){var r=no(),n=E.useRef(null),o=E.useCallback(function(t){n.current=t,r()},[r]);return[n,o]}function Ie(r){var n=r.drop,o=r.alignEnd,t=r.defaultShow,e=r.show,a=r.onToggle,s=r.itemSelector,i=s===void 0?"* > *":s,l=r.focusFirstItemOnShow,u=r.children,c=ro(e,t,a),f=c[0],p=c[1],m=xr(),v=m[0],g=m[1],h=v.current,S=xr(),w=S[0],b=S[1],y=w.current,x=nn(f),D=E.useRef(null),R=E.useRef(!1),k=E.useCallback(function(O,N){p(O,N)},[p]),j=E.useMemo(function(){return{toggle:k,drop:n,show:f,alignEnd:o,menuElement:h,toggleElement:y,setMenu:g,setToggle:b}},[k,n,f,o,h,y,g,b]);h&&x&&!f&&(R.current=h.contains(document.activeElement));var M=pe(function(){y&&y.focus&&y.focus()}),C=pe(function(){var O=D.current,N=l;if(N==null&&(N=v.current&&qn(v.current,"[role=menu]")?"keyboard":!1),!(N===!1||N==="keyboard"&&!/^key.+$/.test(O))){var P=cr(v.current,i)[0];P&&P.focus&&P.focus()}});E.useEffect(function(){f?C():R.current&&(R.current=!1,M())},[f,R,M,C]),E.useEffect(function(){D.current=null});var _=function(N,P){if(!v.current)return null;var I=cr(v.current,i),H=I.indexOf(N)+P;return H=Math.max(0,Math.min(H,I.length)),I[H]};return oo("keydown",function(O){var N,P,I=O.key,H=O.target,J=(N=v.current)==null?void 0:N.contains(H),te=(P=w.current)==null?void 0:P.contains(H),ce=/input|textarea/i.test(H.tagName);if(!(ce&&(I===" "||I!=="Escape"&&J))&&!(!J&&!te)&&!(!v.current&&I==="Tab"))switch(D.current=O.type,I){case"ArrowUp":{var T=_(H,-1);T&&T.focus&&T.focus(),O.preventDefault();return}case"ArrowDown":if(O.preventDefault(),!f)p(!0,O);else{var F=_(H,1);F&&F.focus&&F.focus()}return;case"Tab":Bn(document,"keyup",function(Z){var re;(Z.key==="Tab"&&!Z.target||!((re=v.current)!=null&&re.contains(Z.target)))&&p(!1,O)},{once:!0});break;case"Escape":O.preventDefault(),O.stopPropagation(),p(!1,O);break}}),U.createElement(qt.Provider,{value:j},u)}Ie.displayName="ReactOverlaysDropdown";Ie.propTypes=uo;Ie.Menu=Ye;Ie.Toggle=Bt;function fo(r){const n=E.useRef(r);return n.current=r,n}function po(r){const n=fo(r);E.useEffect(()=>()=>n.current(),[])}function vo(r){return r&&r.tagName.toLowerCase()==="body"}function ho(r){var n=It(r)?ur():ur(r),o=It(r)||n.defaultView;return n.body.clientWidth<o.innerWidth}function mo(r){var n=It(r);return n||vo(r)?ho(r):r.scrollHeight>r.clientHeight}var go=["template","script","style"],yo=function(n){var o=n.nodeType,t=n.tagName;return o===1&&go.indexOf(t.toLowerCase())===-1},sn=function(n,o,t){[].forEach.call(n.children,function(e){o.indexOf(e)===-1&&yo(e)&&t(e)})};function Ze(r,n){n&&(r?n.setAttribute("aria-hidden","true"):n.removeAttribute("aria-hidden"))}function So(r,n){var o=n.dialog,t=n.backdrop;sn(r,[o,t],function(e){return Ze(!0,e)})}function bo(r,n){var o=n.dialog,t=n.backdrop;sn(r,[o,t],function(e){return Ze(!1,e)})}function wo(r,n){var o=-1;return r.some(function(t,e){return n(t,e)?(o=e,!0):!1}),o}var Gt=function(){function r(o){var t=o===void 0?{}:o,e=t.hideSiblingNodes,a=e===void 0?!0:e,s=t.handleContainerOverflow,i=s===void 0?!0:s;this.hideSiblingNodes=void 0,this.handleContainerOverflow=void 0,this.modals=void 0,this.containers=void 0,this.data=void 0,this.scrollbarSize=void 0,this.hideSiblingNodes=a,this.handleContainerOverflow=i,this.modals=[],this.containers=[],this.data=[],this.scrollbarSize=Kn()}var n=r.prototype;return n.isContainerOverflowing=function(t){var e=this.data[this.containerIndexFromModal(t)];return e&&e.overflowing},n.containerIndexFromModal=function(t){return wo(this.data,function(e){return e.modals.indexOf(t)!==-1})},n.setContainerStyle=function(t,e){var a={overflow:"hidden"};t.style={overflow:e.style.overflow,paddingRight:e.style.paddingRight},t.overflowing&&(a.paddingRight=parseInt(dr(e,"paddingRight")||"0",10)+this.scrollbarSize+"px"),dr(e,a)},n.removeContainerStyle=function(t,e){Object.assign(e.style,t.style)},n.add=function(t,e,a){var s=this.modals.indexOf(t),i=this.containers.indexOf(e);if(s!==-1)return s;if(s=this.modals.length,this.modals.push(t),this.hideSiblingNodes&&So(e,t),i!==-1)return this.data[i].modals.push(t),s;var l={modals:[t],classes:a?a.split(/\s+/):[],overflowing:mo(e)};return this.handleContainerOverflow&&this.setContainerStyle(l,e),l.classes.forEach(Gn.bind(null,e)),this.containers.push(e),this.data.push(l),s},n.remove=function(t){var e=this.modals.indexOf(t);if(e!==-1){var a=this.containerIndexFromModal(t),s=this.data[a],i=this.containers[a];if(s.modals.splice(s.modals.indexOf(t),1),this.modals.splice(e,1),s.modals.length===0)s.classes.forEach(Un.bind(null,i)),this.handleContainerOverflow&&this.removeContainerStyle(s,i),this.hideSiblingNodes&&bo(i,t),this.containers.splice(a,1),this.data.splice(a,1);else if(this.hideSiblingNodes){var l=s.modals[s.modals.length-1],u=l.backdrop,c=l.dialog;Ze(!1,c),Ze(!1,u)}}},n.isTopModal=function(t){return!!this.modals.length&&this.modals[this.modals.length-1]===t},r}(),Rt;function Eo(){return Rt||(Rt=new Gt),Rt}function xo(r){var n=r||Eo(),o=E.useRef({dialog:null,backdrop:null});return Object.assign(o.current,{add:function(e,a){return n.add(o.current,e,a)},remove:function(){return n.remove(o.current)},isTopModal:function(){return n.isTopModal(o.current)},setDialogRef:E.useCallback(function(t){o.current.dialog=t},[]),setBackdropRef:E.useCallback(function(t){o.current.backdrop=t},[])})}var Ut=E.forwardRef(function(r,n){var o=r.show,t=o===void 0?!1:o,e=r.role,a=e===void 0?"dialog":e,s=r.className,i=r.style,l=r.children,u=r.backdrop,c=u===void 0?!0:u,f=r.keyboard,p=f===void 0?!0:f,m=r.onBackdropClick,v=r.onEscapeKeyDown,g=r.transition,h=r.backdropTransition,S=r.autoFocus,w=S===void 0?!0:S,b=r.enforceFocus,y=b===void 0?!0:b,x=r.restoreFocus,D=x===void 0?!0:x,R=r.restoreFocusOptions,k=r.renderDialog,j=r.renderBackdrop,M=j===void 0?function(W){return U.createElement("div",W)}:j,C=r.manager,_=r.container,O=r.containerClassName,N=r.onShow,P=r.onHide,I=P===void 0?function(){}:P,H=r.onExit,J=r.onExited,te=r.onExiting,ce=r.onEnter,T=r.onEntering,F=r.onEntered,Z=Ur(r,["show","role","className","style","children","backdrop","keyboard","onBackdropClick","onEscapeKeyDown","transition","backdropTransition","autoFocus","enforceFocus","restoreFocus","restoreFocusOptions","renderDialog","renderBackdrop","manager","container","containerClassName","onShow","onHide","onExit","onExited","onExiting","onEnter","onEntering","onEntered"]),re=Kr(_),Q=xo(C),Nn=Zn(),Pn=nn(t),nr=E.useState(!t),_e=nr[0],mt=nr[1],Le=E.useRef(null);E.useImperativeHandle(n,function(){return Q},[Q]),Jn&&!Pn&&t&&(Le.current=Et()),!g&&!t&&!_e?mt(!0):t&&_e&&mt(!1);var ar=pe(function(){if(Q.add(re,O),St.current=fr(document,"keydown",An),yt.current=fr(document,"focus",function(){return setTimeout(In)},!0),N&&N(),w){var W=Et(document);Q.dialog&&W&&!pr(Q.dialog,W)&&(Le.current=W,Q.dialog.focus())}}),gt=pe(function(){if(Q.remove(),St.current==null||St.current(),yt.current==null||yt.current(),D){var W;(W=Le.current)==null||W.focus==null||W.focus(R),Le.current=null}});E.useEffect(function(){!t||!re||ar()},[t,re,ar]),E.useEffect(function(){_e&&gt()},[_e,gt]),po(function(){gt()});var In=pe(function(){if(!(!y||!Nn()||!Q.isTopModal())){var W=Et();Q.dialog&&W&&!pr(Q.dialog,W)&&Q.dialog.focus()}}),zn=pe(function(W){W.target===W.currentTarget&&(m==null||m(W),c===!0&&I())}),An=pe(function(W){p&&W.keyCode===27&&Q.isTopModal()&&(v==null||v(W),W.defaultPrevented||I())}),yt=E.useRef(),St=E.useRef(),Fn=function(){mt(!0);for(var lr=arguments.length,ir=new Array(lr),qe=0;qe<lr;qe++)ir[qe]=arguments[qe];J==null||J.apply(void 0,ir)},bt=g;if(!re||!(t||bt&&!_e))return null;var or=Pt({role:a,ref:Q.setDialogRef,"aria-modal":a==="dialog"?!0:void 0},Z,{style:i,className:s,tabIndex:-1}),wt=k?k(or):U.createElement("div",or,U.cloneElement(l,{role:"document"}));bt&&(wt=U.createElement(bt,{appear:!0,unmountOnExit:!0,in:!!t,onExit:H,onExiting:te,onExited:Fn,onEnter:ce,onEntering:T,onEntered:F},wt));var He=null;if(c){var sr=h;He=M({ref:Q.setBackdropRef,onClick:zn}),sr&&(He=U.createElement(sr,{appear:!0,in:!!t},He))}return U.createElement(U.Fragment,null,Zr.createPortal(U.createElement(U.Fragment,null,He,wt),re))}),Do={show:$.bool,container:$.any,onShow:$.func,onHide:$.func,backdrop:$.oneOfType([$.bool,$.oneOf(["static"])]),renderDialog:$.func,renderBackdrop:$.func,onEscapeKeyDown:$.func,onBackdropClick:$.func,containerClassName:$.string,keyboard:$.bool,transition:$.elementType,backdropTransition:$.elementType,autoFocus:$.bool,enforceFocus:$.bool,restoreFocus:$.bool,restoreFocusOptions:$.shape({preventScroll:$.bool}),onEnter:$.func,onEntering:$.func,onEntered:$.func,onExit:$.func,onExiting:$.func,onExited:$.func,manager:$.instanceOf(Gt)};Ut.displayName="Modal";Ut.propTypes=Do;const Co=Object.assign(Ut,{Manager:Gt});var Ro={container:$.any,onRendered:$.func},Kt=function(n){var o=n.container,t=n.children,e=n.onRendered,a=Kr(o,e);return a?U.createElement(U.Fragment,null,Zr.createPortal(t,a)):null};Kt.displayName="Portal";Kt.propTypes=Ro;const ko=Object.freeze(Object.defineProperty({__proto__:null,Dropdown:Ie,Modal:Co,Overlay:Vn,Portal:Kt,useDropdownMenu:an,useDropdownToggle:on,useRootClose:Gr},Symbol.toStringTag,{value:"Module"})),Mo=()=>{const r=Y(Yn),n=Je();return d.jsxs(d.Fragment,{children:[d.jsx(K,{className:"section-title",children:zt("settings.generalSettings.appearanceSection.label")}),d.jsx(At,{mt:10,fz:12,checked:r,onChange:o=>n(Xn(o.currentTarget.checked)),label:zt("settings.generalSettings.appearanceSection.description")})]})},$o=r=>{const{open:n,isEdit:o=!1,onClose:t,selectedCategory:e,onSubmit:a}=r,{t:s}=ae(),i=Qn({initialValues:{Name:"",Color:ta(aa)},validate:{Name:ea({min:2,max:50},s("validations.categoryName"))},validateInputOnChange:!0}),l=c=>{i.setFieldValue("Color",c)};E.useEffect(()=>{o&&e&&(i.setFieldValue("Name",e.Name),i.setFieldValue("Color",e.Color))},[e,o]);const u=E.useCallback(c=>{a(o?{...c,Id:(e==null?void 0:e.Id)||0}:c),t()},[t,a,e,o]);return d.jsx(Jr,{keepMounted:!1,opened:n,onClose:t,title:s(o?"settings.generalSettings.categorySection.categoryModal.editCategory":"settings.generalSettings.categorySection.action"),children:d.jsx("form",{onSubmit:i.onSubmit(c=>u(c)),children:d.jsxs(A,{children:[d.jsx(A,{mt:13,mb:24,children:d.jsx(ra,{maxLength:51,placeholder:s("settings.generalSettings.categorySection.categoryModal.categoryName"),maw:500,"data-autofocus":!0,...i.getInputProps("Name")})}),d.jsx(A,{children:d.jsx(A,{w:220,children:d.jsx(na,{color:i.getInputProps("Color").value,handleChange:l,disabled:!1})})}),d.jsxs(Vr,{gap:10,mt:24,justify:"flex-end",children:[d.jsx(Se,{variant:"outline",onClick:t,children:s("buttons.cancel")}),d.jsx(Se,{type:"submit",children:s(o?"buttons.save":"buttons.create")})]})]})})})},To=r=>{const{Color:n,Name:o,Id:t,handleEditCategory:e,handleDeleteCategory:a}=r,{isMobile:s}=Yr();return d.jsxs(A,{my:5,className:"categoryItem",children:[d.jsxs(ue,{align:"center",justify:"flex-start",children:[d.jsx(oa,{style:{color:n},size:20}),d.jsx(Xr,{label:o,disabled:o.length<40,children:d.jsx(K,{maw:s?220:400,truncate:!0,className:"categoryText",ml:5,children:o})})]}),d.jsxs(ue,{align:"center",gap:5,children:[d.jsx(vr,{onClick:e,variant:"subtle",children:d.jsx(sa,{size:"22"})}),d.jsx(vr,{onClick:()=>a({Id:t,Name:o,Color:n}),variant:"subtle",children:d.jsx(la,{size:"22"})})]})]})},_o=()=>{const[r,n]=E.useState(!1),[o,t]=E.useState(!1),[e,a]=E.useState(!1),s=Y(ia),i=Je(),{t:l}=ae(),[u,c]=E.useState({Color:"",Name:"",Id:0,Order:0,IconId:null}),f=E.useCallback(()=>{n(!0)},[]),p=E.useCallback(w=>{a(!0),n(!0),c(w)},[]),m=E.useCallback(w=>{t(!0),c(w)},[]),v=E.useCallback(()=>{n(!1),a(!1)},[]),g=E.useCallback(w=>{i(ca({data:{...w,Order:0,IconId:null},isEditMode:e}))},[e,i]),h=()=>{i(pa(u.Id)),t(!1)},S=()=>{t(!1)};return d.jsxs(d.Fragment,{children:[d.jsx(K,{className:"section-title",children:l("settings.generalSettings.categorySection.label")}),d.jsx(A,{my:0,className:"categories",maw:500,children:s.length===0?d.jsx(K,{pt:8,pb:8,className:"category-section-empty",c:"dimmed",size:"sm",children:l("settings.generalSettings.categorySection.emptyState")}):d.jsx(d.Fragment,{children:s.map((w,b)=>d.jsx(To,{...w,handleEditCategory:()=>p(w),handleDeleteCategory:m},b))})}),d.jsx(Se,{maw:200,mb:20,leftSection:d.jsx(ua,{size:"1em"}),variant:"default",onClick:f,children:l("settings.generalSettings.categorySection.action")}),r&&d.jsx($o,{isEdit:e,selectedCategory:u,open:r,onClose:v,onSubmit:g}),d.jsx(da,{opened:o,handleConfirm:h,handleCancel:S,data:fa})]})},jo=()=>{const r=Je(),n=Y(Qr),{t:o}=ae(),{Timezone:t}=n,[e,a]=E.useState((t==null?void 0:t.SecondEnabled)??!1),s=Y(va),i=Y(ha),[l,u]=E.useState((t==null?void 0:t.Id)??void 0),[c,f]=E.useState((t==null?void 0:t.SecondId)??void 0),p=E.useCallback(async h=>{a(h.target.checked),c&&l&&(await r(xt({data:{Id:l,SecondEnabled:h.target.checked,SecondId:c}})),r(Dt({...n,Timezone:{...n.Timezone,SecondEnabled:h.target.checked}})))},[c,l,r,n]),m=E.useCallback(async h=>{await r(ma({data:{AskTimezoneChange:h.target.checked}}))},[r]),v=h=>{mr.isNil(h)||(u(Number(h)),r(xt({data:{Id:Number(h),SecondEnabled:e,SecondId:c}})),r(Dt({...n,Timezone:{...n.Timezone,Id:Number(h)}})))},g=h=>{mr.isNil(h)||(f(Number(h)),l&&r(xt({data:{Id:l,SecondEnabled:e,SecondId:Number(h)}})),r(Dt({...n,Timezone:{...n.Timezone,SecondId:Number(h)}})))};return d.jsxs(d.Fragment,{children:[d.jsx(K,{className:"section-title",children:o("settings.generalSettings.timeZoneSection.label")}),d.jsxs(A,{my:10,maw:500,children:[d.jsx(A,{my:10,children:d.jsx(At,{styles:{label:{cursor:"pointer"},labelWrapper:{width:"auto !important"}},fz:"12px",label:o("settings.generalSettings.timeZoneSection.showAdditionalTimeZoneLabel"),checked:e,onChange:p})}),d.jsxs(ue,{align:"center",mb:10,children:[d.jsx(K,{mr:10,fz:"12px",fw:400,c:"dimmed",children:o("settings.generalSettings.timeZoneSection.mainTimeZoneLabel")}),d.jsx(Xr,{label:o("settings.generalSettings.timeZoneSection.timezoneInfo"),children:d.jsx(Qa,{size:20,stroke:1.5,color:"gray"})})]}),d.jsx(A,{maw:530,children:d.jsx(hr,{disabled:!0,description:o("settings.generalSettings.timeZoneSection.description"),onChange:v,value:String(l),placeholder:o("settings.generalSettings.timeZoneSection.mainTimeZoneLabel")})})]}),e&&d.jsxs(A,{my:10,maw:500,children:[d.jsx(K,{mb:10,size:"sm",fz:"12px",fw:400,c:"dimmed",children:o("settings.generalSettings.timeZoneSection.additionalTimeZonesLabel")}),d.jsx(A,{children:d.jsx(hr,{onChange:g,value:String(c),placeholder:o("settings.generalSettings.timeZoneSection.additionalTimeZonesLabel")})})]}),d.jsx(A,{my:10,children:d.jsx(At,{styles:{label:{cursor:"pointer"},labelWrapper:{width:"auto !important"}},fz:"12px",disabled:i==="pending",label:o("settings.generalSettings.timeZoneSection.askAboutTimeZone"),checked:!!s,onChange:m})})]})},Xe=E.forwardRef(({children:r,pages:n=1},o)=>{const{t}=ae();return d.jsxs(A,{w:"100%",bg:"gray",h:"80vh",py:20,style:{overflow:"auto"},children:[d.jsx(A,{style:{position:"absolute",right:45,bottom:20,zIndex:9},children:d.jsxs(K,{fz:30,style:{fontWeight:"700",textShadow:"2px 2px 4px rgba(0, 0, 0, 0.3)"},children:[t("printEvent.pages")," ",n]})}),d.jsx(A,{w:"100%",style:{padding:"0px 40px"},children:d.jsx(A,{className:"landscape-print",w:"100%",ref:o,children:r})})]})}),Oo=(r,n,o,t)=>o<2?null:o>=3||o===2&&!t?`${r} - ${n}`:r,ln=r=>{const n=r.view,o=Y(Wt),{event:t,printStyle:e}=r,{title:a,resource:s}=t,{participantInfo:i,location:l}=s,{attendingType:u}=i,c=u===Ne.NotVisit?"line-through":"unset",{eventTimeStart:f,eventTimeEnd:p}=E.useMemo(()=>({eventTimeStart:gr(t.start,"HH:mm"),eventTimeEnd:gr(t.end,"HH:mm")}),[t.start,t.end]),m=r.linesEvent||1,v="xs";return d.jsxs(A,{mt:m===2?"-2px":0,children:[d.jsx(ue,{align:n==="month"?"center":"start",children:d.jsxs(K,{lineClamp:m>3?m-2:1,className:ga("event-title",{"white-space":n!=="month"}),td:c,fz:v,style:{lineHeight:1.3},children:[a||zt("placeholders.defaultEventTitle"),n!=="month"&&d.jsxs(d.Fragment,{children:[m<2?`, ${f} - ${p}`:"",m<2&&l?`, ${l}`:""]})]})}),n==="month"||s.isAllDayWithoutTime||m===1?null:d.jsx(d.Fragment,{children:d.jsx(A,{mt:-3,children:d.jsxs(K,{fz:v,style:{whiteSpace:"break-spaces"},children:[Oo(f,p,m,l),u===Ne.Maybe&&e!=="default"&&d.jsx(ue,{style:{borderRadius:2,justifyContent:"center",alignItems:"center",position:"absolute",right:5,bottom:3},w:14,bg:e==="line"?o[t.resource.categoryId]||t.resource.mainColor:"black",children:d.jsx(ya,{size:14,color:e==="blackWhite"?"white":"black"})})]})})})]})},cn=(r,n,o)=>t=>({style:{borderRadius:"6px",color:"#343a40",...No(t,r,n,o)}}),No=(r,n,o,t)=>{const{resource:e}=r,{mainColor:a,categoryId:s,participantInfo:i}=e,{attendingType:l}=i;Sa(yr(r.start),yr(r.end),"day");const u=n[s]||a,c=t==="default"?u:"white",f={borderWidth:t==="default"?1:2,borderStyle:"solid",boxShadow:"none",borderColor:t==="blackWhite"?"black":u};return l===Ne.Maybe?t==="default"?{...f,backgroundColor:c,backgroundImage:`repeating-linear-gradient(
        45deg,
        #ffffff,
        #ffffff 5px,
        ${c} 5px,
        ${c} 10px
      )`}:{...f,backgroundColor:"white"}:l===Ne.NotVisit?{...f,background:"#fff",textDecoration:"line-through"}:t==="line"?{...f,background:"white"}:l===Ne.WillVisit||l===null?{...f,background:c}:{...f,borderTopColor:c,borderBottomColor:c,borderRightColor:c,borderLeftColor:c,background:"#fff",color:c}},Zt=({printStyle:r,calendarEvents:n,view:o,date:t,hourStart:e,hourEnd:a})=>{const{i18n:s}=ae(),i=s.language,l=Y(Wt),u=E.useCallback(c=>cn(l,be.WEEK,r)(c),[l,r]);return d.jsx(en,{eventPropGetter:u,components:{event:c=>d.jsx(ln,{printStyle:r,view:o,...c})},dayLayoutAlgorithm:"no-overlap",culture:i==="ru"?"ru-RU":"en-GB",events:n,defaultView:o,view:o,date:t,style:{width:"100%",height:"100%"},localizer:tn.localizer,step:30,views:{day:!0,week:!0,work_week:!0,month:!0},toolbar:!1,showAllEvents:!0,min:e,max:a})},Po=r=>G.fromJSDate(r).startOf("week").set({weekday:1}).toJSDate(),Io=r=>G.fromJSDate(r).endOf("week").set({weekday:7}).toJSDate(),Dr=(r,n)=>G.fromJSDate(r).setLocale(n==="ru"?"ru":"en").toFormat("ccc, dd LLL yyyy"),zo=E.forwardRef((r,n)=>{const{startDate:o,endDate:t,calendarEvents:e,activeCalendars:a,orientation:s,timezone:i,printStyle:l,hourStart:u,hourEnd:c,view:f=be.WEEK}=r,{i18n:p}=ae(),m=p.language,[v,g]=E.useState([]);return E.useEffect(()=>{const h=[];let S=G.fromJSDate(Po(o));const w=G.fromJSDate(Io(t));for(;S<=w;){const b=S.toJSDate(),y=S.plus({days:6}).toJSDate();h.push({weekStart:b,weekEnd:y}),S=S.plus({weeks:1})}g(h)},[o,t]),d.jsx(Xe,{pages:v.length,ref:n,children:v.map(({weekStart:h,weekEnd:S})=>d.jsxs("div",{className:`print-calendar calendar-${s}`,children:[d.jsxs(A,{display:"flex",style:{justifyContent:"space-between"},mb:2,children:[a,d.jsxs(K,{fz:12,style:{marginLeft:8,maxWidth:"50%"},className:"print-time",children:[Dr(h,m)," – ",Dr(S,m),i&&` - ${i}`]})]}),d.jsx(Zt,{printStyle:l,calendarEvents:e,view:f,date:h,hourStart:u,hourEnd:c})]},h.toString()))})}),Ao=(r,n)=>G.fromJSDate(r).setLocale(n==="ru"?"ru":"en").toFormat("ccc, dd LLL yyyy"),Fo=E.forwardRef((r,n)=>{const{startDate:o,endDate:t,calendarEvents:e,activeCalendars:a,orientation:s,timezone:i,printStyle:l,hourStart:u,hourEnd:c}=r,{i18n:f}=ae(),p=f.language,[m,v]=E.useState([]);return E.useEffect(()=>{const g=[];let h=new Date(o);for(;h<=t;)g.push(new Date(h)),h.setDate(h.getDate()+1);v(g)},[o,t]),d.jsx(Xe,{pages:m.length,ref:n,children:m.map(g=>d.jsxs("div",{className:`print-calendar calendar-${s}`,children:[d.jsxs(A,{display:"flex",style:{justifyContent:"space-between"},mb:2,children:[a,d.jsxs(K,{fz:12,style:{whiteSpace:"nowrap",marginLeft:8},children:[Ao(g,p),i&&` - ${i}`]})]}),d.jsx(Zt,{printStyle:l,calendarEvents:e,view:be.DAY,date:g,hourStart:u,hourEnd:c})]},g.toString()))})}),Cr=(r,n)=>G.fromJSDate(r).setLocale(n==="ru"?"ru":"en").toFormat("ccc, dd LLL yyyy"),Wo=E.forwardRef((r,n)=>{const{startDate:o,endDate:t,calendarEvents:e,activeCalendars:a,orientation:s,timezone:i,printStyle:l}=r,{i18n:u}=ae(),c=u.language,[f,p]=E.useState([]);return E.useEffect(()=>{const m=[];let v=G.fromJSDate(o).startOf("month");const g=G.fromJSDate(t).endOf("month");for(;v<=g;){const h=v.toJSDate(),S=v.endOf("month").toJSDate();m.push({monthStart:h,monthEnd:S}),v=v.plus({months:1})}p(m)},[o,t]),d.jsx(Xe,{pages:f.length,ref:n,children:f.map(({monthStart:m,monthEnd:v})=>d.jsxs("div",{className:`print-calendar calendar-${s}`,children:[d.jsxs(A,{display:"flex",style:{justifyContent:"space-between"},mb:2,children:[a,d.jsxs(K,{fz:12,style:{whiteSpace:"nowrap",marginLeft:8},children:[Cr(m,c)," – ",Cr(v,c),i&&` - ${i}`]})]}),d.jsx(Zt,{printStyle:l,calendarEvents:e,view:be.MONTH,date:m})]},m.toString()))})});var Jt={},un={exports:{}},dn={exports:{}};(function(r){function n(o){if(Array.isArray(o))return o}r.exports=n,r.exports.__esModule=!0,r.exports.default=r.exports})(dn);var Lo=dn.exports,fn={exports:{}};(function(r){function n(o,t){var e=o==null?null:typeof Symbol<"u"&&o[Symbol.iterator]||o["@@iterator"];if(e!=null){var a,s,i,l,u=[],c=!0,f=!1;try{if(i=(e=e.call(o)).next,t===0){if(Object(e)!==e)return;c=!1}else for(;!(c=(a=i.call(e)).done)&&(u.push(a.value),u.length!==t);c=!0);}catch(p){f=!0,s=p}finally{try{if(!c&&e.return!=null&&(l=e.return(),Object(l)!==l))return}finally{if(f)throw s}}return u}}r.exports=n,r.exports.__esModule=!0,r.exports.default=r.exports})(fn);var Ho=fn.exports,pn={exports:{}};(function(r){function n(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}r.exports=n,r.exports.__esModule=!0,r.exports.default=r.exports})(pn);var qo=pn.exports;(function(r){var n=Lo,o=Ho,t=ba,e=qo;function a(s,i){return n(s)||o(s,i)||t(s,i)||e()}r.exports=a,r.exports.__esModule=!0,r.exports.default=r.exports})(un);var Vt=un.exports;const Bo=de(wa),vn=de(Ea);var Qe={},et={};Object.defineProperty(et,"__esModule",{value:!0});et.getSlotMetrics=hn;var Rr=function(n){var o=n.min,t=n.max,e=n.step,a=n.slots,s=n.localizer;return"".concat(+s.startOf(o,"minutes"))+"".concat(+s.startOf(t,"minutes"))+"".concat(e,"-").concat(a)};function hn(r){for(var n=r.min,o=r.max,t=r.step,e=r.timeslots,a=r.localizer,s=Rr({step:t,localizer:a}),i=1+a.getTotalMin(n,o),l=a.getMinutesFromMidnight(n),u=Math.ceil((i-1)/(t*e)),c=u*e,f=new Array(u),p=new Array(c),m=0;m<u;m++){f[m]=new Array(e);for(var v=0;v<e;v++){var g=m*e+v,h=g*t;p[g]=f[m][v]=a.getSlotDate(n,l,h)}}var S=p.length*t;p.push(a.getSlotDate(n,l,S));function w(b){var y=a.diff(n,b,"minutes")+a.getDstOffset(n,b);return Math.min(y,i)}return{groups:f,update:function(y){return Rr(y)!==s?hn(y):this},dateIsInGroup:function(y,x){var D=f[x+1];return a.inRange(y,f[x][0],D?D[0]:o,"minutes")},nextSlot:function(y){var x=p[Math.min(p.indexOf(y)+1,p.length-1)];return x===y&&(x=a.add(y,t,"minutes")),x},closestSlotToPosition:function(y){var x=Math.min(p.length-1,Math.max(0,Math.floor(y*c)));return p[x]},closestSlotFromPoint:function(y,x){var D=Math.abs(x.top-x.bottom);return this.closestSlotToPosition((y.y-x.top)/D)},closestSlotFromDate:function(y){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(a.lt(y,n,"minutes"))return p[0];if(a.gt(y,o,"minutes"))return p[p.length-1];var D=a.diff(n,y,"minutes");return p[(D-D%t)/t+x]},startsBeforeDay:function(y){return a.lt(y,n,"day")},startsAfterDay:function(y){return a.gt(y,o,"day")},startsBefore:function(y){return a.lt(a.merge(n,y),n,"minutes")},startsAfter:function(y){return a.gt(a.merge(o,y),o,"minutes")},getRange:function(y,x,D,R){D||(y=a.min(o,a.max(n,y))),R||(x=a.min(o,a.max(n,x)));var k=w(y),j=w(x),M=j>t*c&&!a.eq(o,x)?(k-t)/(t*c)*100:k/(t*c)*100,C=(j-k)/t;return{top:M,height:j/(t*c)*100-M,start:w(y),startDate:y,end:w(x),endDate:x,linesEvent:C}},getCurrentTimePosition:function(y){var x=w(y),D=x/(t*c)*100;return D}}}var ye={};Object.defineProperty(ye,"__esModule",{value:!0});ye.instanceId=Zo;ye.isFirstFocusedRender=Jo;ye.notify=Ko;var Go=0;function Uo(r){return""+(r+ ++Go)}function Ko(r,n){r&&r.apply(null,[].concat(n))}function Zo(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return r.__id||(r.__id=Uo("rw_")),(r.props.id||r.__id)+n}function Jo(r){return r._firstFocus||r.state.focused&&(r._firstFocus=!0)}var Yt={},tt={},Xt=q.default;Object.defineProperty(tt,"__esModule",{value:!0});tt.default=rs;var Vo=Xt(ve),Yo=Xt(he),Xo=Xt(xa),Qo=function(){function r(n,o){var t=o.accessors,e=o.slotMetrics;(0,Vo.default)(this,r);var a=e.getRange(t.start(n),t.end(n)),s=a.start,i=a.startDate,l=a.end,u=a.endDate,c=a.top,f=a.height,p=a.linesEvent;this.start=s,this.end=l,this.startMs=+i,this.endMs=+u,this.top=c,this.height=f,this.data=n,this.linesEvent=p}return(0,Yo.default)(r,[{key:"_width",get:function(){if(this.rows){var o=this.rows.reduce(function(e,a){return Math.max(e,a.leaves.length+1)},0)+1;return 100/o}if(this.leaves){var t=100-this.container._width;return t/(this.leaves.length+1)}return this.row._width}},{key:"width",get:function(){var o=this._width,t=Math.min(100,this._width*1.7);if(this.rows)return t;if(this.leaves)return this.leaves.length>0?t:o;var e=this.row.leaves,a=e.indexOf(this);return a===e.length-1?o:t}},{key:"xOffset",get:function(){if(this.rows)return 0;if(this.leaves)return this.container._width;var o=this.row,t=o.leaves,e=o.xOffset,a=o._width,s=t.indexOf(this)+1;return e+s*a}}]),r}();function es(r,n,o){return Math.abs(n.start-r.start)<o||n.start>r.start&&n.start<r.end}function ts(r){for(var n=(0,Xo.default)(r,["startMs",function(i){return-i.endMs}]),o=[];n.length>0;){var t=n.shift();o.push(t);for(var e=0;e<n.length;e++){var a=n[e];if(!(t.endMs>a.startMs)){if(e>0){var s=n.splice(e,1)[0];o.push(s)}break}}}return o}function rs(r){for(var n=r.events,o=r.minimumStartDifference,t=r.slotMetrics,e=r.accessors,a=n.map(function(c){return new Qo(c,{slotMetrics:t,accessors:e})}),s=ts(a),i=[],l=function(){var f=s[u],p=i.find(function(g){return g.end>f.start||Math.abs(f.start-g.start)<o});if(!p)return f.rows=[],i.push(f),1;f.container=p;for(var m=null,v=p.rows.length-1;!m&&v>=0;v--)es(p.rows[v],f,o)&&(m=p.rows[v]);m?(m.leaves.push(f),f.row=m):(f.leaves=[],p.rows.push(f))},u=0;u<s.length;u++)l();return s.map(function(c){return{event:c.data,linesEvent:c.linesEvent,style:{top:c.top,height:c.height,width:c.width,xOffset:Math.max(0,c.xOffset)}}})}var Qt={},ns=q.default;Object.defineProperty(Qt,"__esModule",{value:!0});Qt.default=os;var as=ns(tt);function mn(r,n,o){for(var t=0;t<r.friends.length;++t)if(!(o.indexOf(r.friends[t])>-1)){n=n>r.friends[t].idx?n:r.friends[t].idx,o.push(r.friends[t]);var e=mn(r.friends[t],n,o);n=n>e?n:e}return n}function os(r){var n=r.events,o=r.minimumStartDifference,t=r.slotMetrics,e=r.accessors,a=(0,as.default)({events:n,minimumStartDifference:o,slotMetrics:t,accessors:e});a.sort(function(P,I){return P=P.style,I=I.style,P.top!==I.top?P.top>I.top?1:-1:P.top+P.height<I.top+I.height?1:-1});for(var s=0;s<a.length;++s)a[s].friends=[],delete a[s].style.left,delete a[s].style.left,delete a[s].idx,delete a[s].size;for(var i=0;i<a.length-1;++i)for(var l=a[i],u=l.style.top,c=l.style.top+l.style.height,f=i+1;f<a.length;++f){var p=a[f],m=p.style.top,v=p.style.top+p.style.height;(m>=u&&v<=c||v>u&&v<=c||m>=u&&m<c)&&(l.friends.push(p),p.friends.push(l))}for(var g=0;g<a.length;++g){for(var h=a[g],S=[],w=0;w<100;++w)S.push(1);for(var b=0;b<h.friends.length;++b)h.friends[b].idx!==void 0&&(S[h.friends[b].idx]=0);h.idx=S.indexOf(1)}for(var y=0;y<a.length;++y){var x=0;if(!a[y].size){var D=[],R=mn(a[y],0,D);x=100/(R+1),a[y].size=x;for(var k=0;k<D.length;++k)D[k].size=x}}for(var j=0;j<a.length;++j){var M=a[j];M.style.left=M.idx*M.size;for(var C=0,_=0;_<M.friends.length;++_){var O=M.friends[_].idx;C=C>O?C:O}C<=M.idx&&(M.size=100-M.idx*M.size);var N=M.idx===0?0:3;M.style.width="calc(".concat(M.size,"% - ").concat(N,"px)"),M.style.height="calc(".concat(M.style.height,"% - 2px)"),M.style.xOffset="calc(".concat(M.style.left,"% + ").concat(N,"px)")}return a}var gn=q.default;Object.defineProperty(Yt,"__esModule",{value:!0});Yt.getStyledEvents=cs;var ss=gn(tt),ls=gn(Qt),kr={overlap:ss.default,"no-overlap":ls.default};function is(r){return!!(r&&r.constructor&&r.call&&r.apply)}function cs(r){r.events,r.minimumStartDifference,r.slotMetrics,r.accessors;var n=r.dayLayoutAlgorithm,o=n;return n in kr&&(o=kr[n]),is(o)?o.apply(this,arguments):[]}var ze={},rt={},Ae={};Object.defineProperty(Ae,"__esModule",{value:!0});Ae.default=void 0;function us(r){return r.children}Ae.default=us;var ds=q.default;Object.defineProperty(rt,"__esModule",{value:!0});rt.default=void 0;var fs=ds(Ae);rt.default=fs.default;var ps=me.default,xe=q.default;Object.defineProperty(ze,"__esModule",{value:!0});ze.default=void 0;var vs=xe(ve),hs=xe(he),ms=xe(we),gs=xe(Ee),ys=xe(ge);xe(Ve);var Be=ps(E),Ss=xe(rt),bs=ze.default=function(r){(0,ms.default)(o,r);var n=(0,gs.default)(o);function o(){return(0,vs.default)(this,o),n.apply(this,arguments)}return(0,hs.default)(o,[{key:"render",value:function(){var e=this.props,a=e.renderSlot,s=e.resource,i=e.group,l=e.getters,u=e.components,c=u===void 0?{}:u,f=c.timeSlotWrapper,p=f===void 0?Ss.default:f,m=l?l.slotGroupProp(i):{};return Be.default.createElement("div",Object.assign({className:"rbc-timeslot-group"},m),i.map(function(v,g){var h=l?l.slotProp(v,s):{};return Be.default.createElement(p,{key:g,value:v,resource:s},Be.default.createElement("div",Object.assign({},h,{className:(0,ys.default)("rbc-time-slot",h.className)}),a&&a(v,g)))}))}}]),o}(Be.Component);bs.propTypes={};var nt={},ws=q.default;Object.defineProperty(nt,"__esModule",{value:!0});nt.default=void 0;var Ft=ws(E),Es=function(n){var o=n.children,t=n.className,e=n.style,a=n.innerRef;return Ft.default.createElement("div",{className:t,style:e,ref:a},o)};nt.default=Ft.default.forwardRef(function(r,n){return Ft.default.createElement(Es,Object.assign({},r,{innerRef:n}))});var oe=q.default,at=me.default;Object.defineProperty(Qe,"__esModule",{value:!0});Qe.default=void 0;var Mr=oe(Da),De=oe($e),xs=oe(ve),Ds=oe(he),Cs=oe(Ca),Rs=oe(we),ks=oe(Ee),le=at(E),$r=oe(ge),Ge=at(rn),Ms=at(et),$s=Lt,Ue=ye,Ts=at(Yt),_s=oe(ze),js=oe(Ra),Os=oe(nt),Ns=["dayProp"],Ps=["eventContainerWrapper"],yn=function(r){(0,Rs.default)(o,r);var n=(0,ks.default)(o);function o(){var t;(0,xs.default)(this,o);for(var e=arguments.length,a=new Array(e),s=0;s<e;s++)a[s]=arguments[s];return t=n.call.apply(n,[this].concat(a)),t.state={selecting:!1,timeIndicatorPosition:null},t.intervalTriggered=!1,t.renderEvents=function(i){var l=i.events,u=i.isBackgroundEvent,c=t.props,f=c.rtl,p=c.selected,m=c.accessors,v=c.localizer,g=c.getters,h=c.components,S=c.step,w=c.timeslots,b=c.dayLayoutAlgorithm,y=c.resizable,x=(0,Cs.default)(t),D=x.slotMetrics,R=v.messages,k=Ts.getStyledEvents({events:l,accessors:m,slotMetrics:D,minimumStartDifference:Math.ceil(S*w/2),dayLayoutAlgorithm:b});return k.map(function(j,M){var C=j.event,_=j.linesEvent,O=j.style,N=m.end(C),P=m.start(C),I="eventTimeRangeFormat",H,J=D.startsBeforeDay(P),te=D.startsAfterDay(N);J?I="eventTimeRangeEndFormat":te&&(I="eventTimeRangeStartFormat"),J&&te?H=R.allDay:H=v.format({start:P,end:N},I);var ce=J||D.startsBefore(P),T=te||D.startsAfter(N);return le.default.createElement(js.default,{style:O,event:C,label:H,key:"evt_"+M,getters:g,rtl:f,linesEvent:_,components:h,continuesPrior:ce,continuesAfter:T,accessors:m,resource:t.props.resource,selected:(0,$s.isSelected)(C,p),onClick:function(Z){return t._select((0,De.default)((0,De.default)({},C),{},{sourceResource:t.props.resource}),Z)},onDoubleClick:function(Z){return t._doubleClick(C,Z)},isBackgroundEvent:u,onKeyPress:function(Z){return t._keyPress(C,Z)},resizable:y})})},t._selectable=function(){var i=t.containerRef.current,l=t.props,u=l.longPressThreshold,c=l.localizer,f=t._selector=new Ge.default(function(){return i},{longPressThreshold:u}),p=function(h){var S=t.props.onSelecting,w=t.state||{},b=m(h),y=b.startDate,x=b.endDate;S&&(c.eq(w.startDate,y,"minutes")&&c.eq(w.endDate,x,"minutes")||S({start:y,end:x,resourceId:t.props.resource})===!1)||(t.state.start!==b.start||t.state.end!==b.end||t.state.selecting!==b.selecting)&&t.setState(b)},m=function(h){var S=t.slotMetrics.closestSlotFromPoint(h,(0,Ge.getBoundsForNode)(i));t.state.selecting||(t._initialSlot=S);var w=t._initialSlot;c.lte(w,S)?S=t.slotMetrics.nextSlot(S):c.gt(w,S)&&(w=t.slotMetrics.nextSlot(w));var b=t.slotMetrics.getRange(c.min(w,S),c.max(w,S));return(0,De.default)((0,De.default)({},b),{},{selecting:!0,top:"".concat(b.top,"%"),height:"".concat(b.height,"%")})},v=function(h,S){if(!(0,Ge.isEvent)(t.containerRef.current,h)){var w=m(h),b=w.startDate,y=w.endDate;t._selectSlot({startDate:b,endDate:y,action:S,box:h})}t.setState({selecting:!1})};f.on("selecting",p),f.on("selectStart",p),f.on("beforeSelect",function(g){if(t.props.selectable==="ignoreEvents")return!(0,Ge.isEvent)(t.containerRef.current,g)}),f.on("click",function(g){return v(g,"click")}),f.on("doubleClick",function(g){return v(g,"doubleClick")}),f.on("select",function(g){t.state.selecting&&(t._selectSlot((0,De.default)((0,De.default)({},t.state),{},{action:"select",bounds:g})),t.setState({selecting:!1}))}),f.on("reset",function(){t.state.selecting&&t.setState({selecting:!1})})},t._teardownSelectable=function(){t._selector&&(t._selector.teardown(),t._selector=null)},t._selectSlot=function(i){for(var l=i.startDate,u=i.endDate,c=i.action,f=i.bounds,p=i.box,m=l,v=[];t.props.localizer.lte(m,u);)v.push(m),m=new Date(+m+t.props.step*60*1e3);(0,Ue.notify)(t.props.onSelectSlot,{slots:v,start:l,end:u,resourceId:t.props.resource,action:c,bounds:f,box:p})},t._select=function(){for(var i=arguments.length,l=new Array(i),u=0;u<i;u++)l[u]=arguments[u];(0,Ue.notify)(t.props.onSelectEvent,l)},t._doubleClick=function(){for(var i=arguments.length,l=new Array(i),u=0;u<i;u++)l[u]=arguments[u];(0,Ue.notify)(t.props.onDoubleClickEvent,l)},t._keyPress=function(){for(var i=arguments.length,l=new Array(i),u=0;u<i;u++)l[u]=arguments[u];(0,Ue.notify)(t.props.onKeyPressEvent,l)},t.slotMetrics=Ms.getSlotMetrics(t.props),t.containerRef=(0,le.createRef)(),t}return(0,Ds.default)(o,[{key:"componentDidMount",value:function(){this.props.selectable&&this._selectable(),this.props.isNow&&this.setTimeIndicatorPositionUpdateInterval()}},{key:"componentWillUnmount",value:function(){this._teardownSelectable(),this.clearTimeIndicatorInterval()}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){e.selectable&&!this.props.selectable&&this._selectable(),!e.selectable&&this.props.selectable&&this._teardownSelectable(),this.slotMetrics=this.slotMetrics.update(e)}},{key:"componentDidUpdate",value:function(e,a){var s=this.props,i=s.getNow,l=s.isNow,u=s.localizer,c=s.date,f=s.min,p=s.max,m=u.neq(e.getNow(),i(),"minutes");if(e.isNow!==l||m){if(this.clearTimeIndicatorInterval(),l){var v=!m&&u.eq(e.date,c,"minutes")&&a.timeIndicatorPosition===this.state.timeIndicatorPosition;this.setTimeIndicatorPositionUpdateInterval(v)}}else l&&(u.neq(e.min,f,"minutes")||u.neq(e.max,p,"minutes"))&&this.positionTimeIndicator()}},{key:"setTimeIndicatorPositionUpdateInterval",value:function(){var e=this,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;!this.intervalTriggered&&!a&&this.positionTimeIndicator(),this._timeIndicatorTimeout=window.setTimeout(function(){e.intervalTriggered=!0,e.positionTimeIndicator(),e.setTimeIndicatorPositionUpdateInterval()},6e4)}},{key:"clearTimeIndicatorInterval",value:function(){this.intervalTriggered=!1,window.clearTimeout(this._timeIndicatorTimeout)}},{key:"positionTimeIndicator",value:function(){var e=this.props,a=e.min,s=e.max,i=e.getNow,l=i();if(l>=a&&l<=s){var u=this.slotMetrics.getCurrentTimePosition(l);this.intervalTriggered=!0,this.setState({timeIndicatorPosition:u})}else this.clearTimeIndicatorInterval()}},{key:"render",value:function(){var e=this.props,a=e.date,s=e.max,i=e.rtl,l=e.isNow,u=e.resource,c=e.accessors,f=e.localizer,p=e.getters,m=p.dayProp,v=(0,Mr.default)(p,Ns),g=e.components,h=g.eventContainerWrapper,S=(0,Mr.default)(g,Ps),w=this.slotMetrics,b=this.state,y=b.selecting,x=b.top,D=b.height,R=b.startDate,k=b.endDate,j={start:R,end:k},M=m(s),C=M.className,_=M.style,O=S.dayColumnWrapper||Os.default;return le.default.createElement(O,{ref:this.containerRef,date:a,style:_,className:(0,$r.default)(C,"rbc-day-slot","rbc-time-column",l&&"rbc-now",l&&"rbc-today",y&&"rbc-slot-selecting"),slotMetrics:w},w.groups.map(function(N,P){return le.default.createElement(_s.default,{key:P,group:N,resource:u,getters:v,components:S})}),le.default.createElement(h,{localizer:f,resource:u,accessors:c,getters:v,components:S,slotMetrics:w},le.default.createElement("div",{className:(0,$r.default)("rbc-events-container",i&&"rtl")},this.renderEvents({events:this.props.backgroundEvents,isBackgroundEvent:!0}),this.renderEvents({events:this.props.events}))),y&&le.default.createElement("div",{className:"rbc-slot-selection",style:{top:x,height:D}},le.default.createElement("span",null,f.format(j,"selectRangeFormat"))),l&&this.intervalTriggered&&le.default.createElement("div",{className:"rbc-current-time-indicator",style:{top:"".concat(this.state.timeIndicatorPosition,"%")}}))}}]),o}(le.default.Component);yn.defaultProps={dragThroughEvents:!0,timeslots:2};Qe.default=yn;var ot={},Is=me.default,er=q.default;Object.defineProperty(ot,"__esModule",{value:!0});ot.default=void 0;var zs=er(Vt),ie=Is(E),As=er(ge),Fs=et,Ws=er(ze);function Ls(r){var n=r.min,o=r.max,t=r.localizer;return t.getTimezoneOffset(n)!==t.getTimezoneOffset(o)?{start:t.add(n,-1,"day"),end:t.add(o,-1,"day")}:{start:n,end:o}}var Hs=function(n){var o=n.min,t=n.max,e=n.timeslots,a=n.step,s=n.localizer,i=n.getNow,l=n.resource,u=n.components,c=n.getters,f=n.gutterRef,p=u.timeGutterWrapper,m=(0,ie.useMemo)(function(){return Ls({min:o,max:t,localizer:s})},[o==null?void 0:o.toISOString(),t==null?void 0:t.toISOString(),s]),v=m.start,g=m.end,h=(0,ie.useState)((0,Fs.getSlotMetrics)({min:v,max:g,timeslots:e,step:a,localizer:s})),S=(0,zs.default)(h,2),w=S[0],b=S[1];(0,ie.useEffect)(function(){w&&b(w.update({min:v,max:g,timeslots:e,step:a,localizer:s}))},[v==null?void 0:v.toISOString(),g==null?void 0:g.toISOString(),e,a]);var y=(0,ie.useCallback)(function(x,D){if(D)return null;var R=w.dateIsInGroup(i(),D);return ie.default.createElement("span",{className:(0,As.default)("rbc-label",R&&"rbc-now")},s.format(x,"timeGutterFormat"))},[w,s,i]);return ie.default.createElement(p,{slotMetrics:w},ie.default.createElement("div",{className:"rbc-time-gutter rbc-time-column",ref:f},w.groups.map(function(x,D){return ie.default.createElement(Ws.default,{key:D,group:x,resource:l,components:u,renderSlot:y,getters:c})})))};ot.default=ie.default.forwardRef(function(r,n){return ie.default.createElement(Hs,Object.assign({gutterRef:n},r))});var st={};const qs=de(ka);var lt={};const Bs=de(Ma),Gs=de($a);var it={},Sn=me.default,Te=q.default;Object.defineProperty(it,"__esModule",{value:!0});it.default=void 0;var Tr=Te($e),Us=Te(ve),Ks=Te(he),Zs=Te(we),Js=Te(Ee),Oe=Sn(E),Vs=Te(ge),_r=ye,kt=Lt,Ce=Sn(rn),Ys=function(r){(0,Zs.default)(o,r);var n=(0,Js.default)(o);function o(t,e){var a;return(0,Us.default)(this,o),a=n.call(this,t,e),a.state={selecting:!1},a.containerRef=(0,Oe.createRef)(),a}return(0,Ks.default)(o,[{key:"componentDidMount",value:function(){this.props.selectable&&this._selectable()}},{key:"componentWillUnmount",value:function(){this._teardownSelectable()}},{key:"componentDidUpdate",value:function(e){!e.selectable&&this.props.selectable&&this._selectable(),e.selectable&&!this.props.selectable&&this._teardownSelectable()}},{key:"render",value:function(){var e=this.props,a=e.range,s=e.getNow,i=e.getters,l=e.date,u=e.components.dateCellWrapper,c=e.localizer,f=this.state,p=f.selecting,m=f.startIdx,v=f.endIdx,g=s();return Oe.default.createElement("div",{className:"rbc-row-bg",ref:this.containerRef},a.map(function(h,S){var w=p&&S>=m&&S<=v,b=i.dayProp(h),y=b.className,x=b.style;return Oe.default.createElement(u,{key:S,value:h,range:a},Oe.default.createElement("div",{style:x,className:(0,Vs.default)("rbc-day-bg",y,w&&"rbc-selected-cell",c.isSameDate(h,g)&&"rbc-today",l&&c.neq(l,h,"month")&&"rbc-off-range-bg")}))}))}},{key:"_selectable",value:function(){var e=this,a=this.containerRef.current,s=this._selector=new Ce.default(this.props.container,{longPressThreshold:this.props.longPressThreshold}),i=function(u,c){if(!(0,Ce.isEvent)(a,u)&&!(0,Ce.isShowMore)(a,u)){var f=(0,Ce.getBoundsForNode)(a),p=e.props,m=p.range,v=p.rtl;if((0,kt.pointInBox)(f,u)){var g=(0,kt.getSlotAtX)(f,u.x,v,m.length);e._selectSlot({startIdx:g,endIdx:g,action:c,box:u})}}e._initial={},e.setState({selecting:!1})};s.on("selecting",function(l){var u=e.props,c=u.range,f=u.rtl,p=-1,m=-1;if(e.state.selecting||((0,_r.notify)(e.props.onSelectStart,[l]),e._initial={x:l.x,y:l.y}),s.isSelected(a)){var v=(0,Ce.getBoundsForNode)(a),g=(0,kt.dateCellSelection)(e._initial,v,l,c.length,f);p=g.startIdx,m=g.endIdx}e.setState({selecting:!0,startIdx:p,endIdx:m})}),s.on("beforeSelect",function(l){if(e.props.selectable==="ignoreEvents")return!(0,Ce.isEvent)(e.containerRef.current,l)}),s.on("click",function(l){return i(l,"click")}),s.on("doubleClick",function(l){return i(l,"doubleClick")}),s.on("select",function(l){e._selectSlot((0,Tr.default)((0,Tr.default)({},e.state),{},{action:"select",bounds:l})),e._initial={},e.setState({selecting:!1}),(0,_r.notify)(e.props.onSelectEnd,[e.state])})}},{key:"_teardownSelectable",value:function(){this._selector&&(this._selector.teardown(),this._selector=null)}},{key:"_selectSlot",value:function(e){var a=e.endIdx,s=e.startIdx,i=e.action,l=e.bounds,u=e.box;a!==-1&&s!==-1&&this.props.onSelectSlot&&this.props.onSelectSlot({start:s,end:a,action:i,bounds:l,box:u,resourceId:this.props.resourceId})}}]),o}(Oe.default.Component);it.default=Ys;var ct={},fe=q.default;Object.defineProperty(ct,"__esModule",{value:!0});ct.default=void 0;var Xs=fe($e),Qs=fe(ve),el=fe(he),tl=fe(we),rl=fe(Ee),Mt=fe(E),nl=fe(ge),ke=fe(Ta),al=Ht,ol=fe(_a),bn=function(n,o){return n.left<=o&&n.right>=o},jr=function(n,o){return n.filter(function(t){return bn(t,o)}).length},wn=function(r){(0,tl.default)(o,r);var n=(0,rl.default)(o);function o(){return(0,Qs.default)(this,o),n.apply(this,arguments)}return(0,el.default)(o,[{key:"render",value:function(){for(var e=this.props,a=e.segments,s=e.slotMetrics.slots,i=(0,al.eventLevels)(a).levels[0],l=1,u=1,c=[];l<=s;){var f="_lvl_"+l,p=i.filter(function(b){return bn(b,l)})[0]||{},m=p.event,v=p.left,g=p.right,h=p.span;if(!m){l++;continue}var S=Math.max(0,v-u);if(this.canRenderSlotEvent(v,h)){var w=ke.default.renderEvent(this.props,m);S&&c.push(ke.default.renderSpan(s,S,f+"_gap")),c.push(ke.default.renderSpan(s,h,f,w)),u=l=g+1}else S&&c.push(ke.default.renderSpan(s,S,f+"_gap")),c.push(ke.default.renderSpan(s,1,f,this.renderShowMore(a,l))),u=l=l+1}return Mt.default.createElement("div",{className:"rbc-row"},c)}},{key:"canRenderSlotEvent",value:function(e,a){var s=this.props.segments;return(0,ol.default)(e,e+a).every(function(i){var l=jr(s,i);return l===1})}},{key:"renderShowMore",value:function(e,a){var s=this,i=this.props.localizer,l=jr(e,a);return l?Mt.default.createElement("button",{type:"button",key:"sm_"+a,className:(0,nl.default)("rbc-button-link","rbc-show-more"),onClick:function(c){return s.showMore(a,c)}},i.messages.showMore(l)):!1}},{key:"showMore",value:function(e,a){a.preventDefault(),a.stopPropagation(),this.props.onShowMore(e,a.target)}}]),o}(Mt.default.Component);wn.defaultProps=(0,Xs.default)({},ke.default.defaultProps);ct.default=wn;var ut={},sl=q.default;Object.defineProperty(ut,"__esModule",{value:!0});ut.default=void 0;var ll=sl(E),il=function(n){var o=n.children;return ll.default.createElement("div",{className:"rbc-row-content-scroll-container"},o)};ut.default=il;var tr={},En=q.default;Object.defineProperty(tr,"__esModule",{value:!0});tr.getSlotMetrics=xn;var Or=En($e),cl=En(vn),Ke=Ht,ul=function(n,o){return n.left<=o&&n.right>=o},dl=function(n,o){return n[0].range===o[0].range&&n[0].events===o[0].events&&n[0].maxRows===o[0].maxRows};function xn(){return(0,cl.default)(function(r){for(var n=r.range,o=r.events,t=r.maxRows,e=r.minRows,a=r.accessors,s=r.localizer,i=r.maxRowsStatic,l=(0,Ke.endOfRange)({dateRange:n,localizer:s}),u=l.first,c=l.last,f=o.map(function(w){return(0,Ke.eventSegments)(w,n,a,s)}),p=(0,Ke.eventLevels)(f,Math.max(t-1,1)),m=p.levels,v=p.extra,g=(0,Ke.eventLevels)(f,Math.max(i-1,1)),h=g.extra,S=v.length>0?e-1:e;m.length<S;)m.push([]);return{first:u,last:c,extraStatic:h,levels:m,extra:v,range:n,slots:n.length,clone:function(b){var y=xn();return y((0,Or.default)((0,Or.default)({},r),b))},getDateForSlot:function(b){return n[b]},getSlotForDate:function(b){return n.find(function(y){return s.isSameDate(y,b)})},getEventsForSlot:function(b){return f.filter(function(y){return ul(y,b)}).map(function(y){return y.event})},continuesPrior:function(b){return s.continuesPrior(a.start(b),u)},continuesAfter:function(b){var y=a.start(b),x=a.end(b);return s.continuesAfter(y,x,c)}}},dl)}var Dn=me.default,ee=q.default;Object.defineProperty(lt,"__esModule",{value:!0});lt.default=void 0;var Nr=ee($e),fl=ee(ve),pl=ee(he),vl=ee(we),hl=ee(Ee),z=Dn(E),$t=ee(ge),Tt=ee(Bs),ml=ee(Gs),gl=ee(it),yl=ee(ja),Sl=ee(ct),bl=ee(Ae),wl=ee(ut),El=Dn(tr),Cn=function(r){(0,vl.default)(o,r);var n=(0,hl.default)(o);function o(){var t;(0,fl.default)(this,o);for(var e=arguments.length,a=new Array(e),s=0;s<e;s++)a[s]=arguments[s];return t=n.call.apply(n,[this].concat(a)),t.handleSelectSlot=function(i){var l=t.props,u=l.range,c=l.onSelectSlot;c(u.slice(i.start,i.end+1),i)},t.handleShowMore=function(i,l){if(t.props.isAllDay)t.setState({showAllEvents:!t.state.showAllEvents});else{var u=t.props,c=u.range,f=u.onShowMore,p=t.slotMetrics(t.props),m=(0,ml.default)(t.containerRef.current,".rbc-row-bg")[0],v;m&&(v=m.children[i-1]);var g=p.getEventsForSlot(i);f(g,c[i-1],v,i,l)}},t.getContainer=function(){var i=t.props.container;return i?i():t.containerRef.current},t.renderHeadingCell=function(i,l){var u=t.props,c=u.renderHeader,f=u.getNow,p=u.localizer;return c({date:i,key:"header_".concat(l),className:(0,$t.default)("rbc-date-cell",p.isSameDate(i,f())&&"rbc-now")})},t.renderDummy=function(){var i=t.props,l=i.className,u=i.range,c=i.renderHeader,f=i.showAllEvents;return z.default.createElement("div",{className:l,ref:t.containerRef},z.default.createElement("div",{className:(0,$t.default)("rbc-row-content",f&&"rbc-row-content-scrollable")},c&&z.default.createElement("div",{className:"rbc-row",ref:t.headingRowRef},u.map(t.renderHeadingCell)),z.default.createElement("div",{className:"rbc-row",ref:t.eventRowRef},z.default.createElement("div",{className:"rbc-row-segment"},z.default.createElement("div",{className:"rbc-event"},z.default.createElement("div",{className:"rbc-event-content"}," "))))))},t.containerRef=(0,z.createRef)(),t.headingRowRef=(0,z.createRef)(),t.eventRowRef=(0,z.createRef)(),t.state={showAllEvents:!1},t.slotMetrics=El.getSlotMetrics(),t.eventHeight=0,t}return(0,pl.default)(o,[{key:"getRowLimit",value:function(){var e,a=this.eventRowRef.current?(0,Tt.default)(this.eventRowRef.current):this.eventHeight;this.eventHeight=a;var s=(e=this.headingRowRef)!==null&&e!==void 0&&e.current?(0,Tt.default)(this.headingRowRef.current):0,i=(0,Tt.default)(this.containerRef.current)-s,l=Math.max(Math.floor(i/(a+1)),1);return l}},{key:"render",value:function(){var e=this.props,a=e.date,s=e.rtl,i=e.range,l=e.className,u=e.selected,c=e.selectable,f=e.renderForMeasure,p=e.accessors,m=e.getters,v=e.components,g=e.getNow,h=e.renderHeader,S=e.onSelect,w=e.localizer,b=e.onSelectStart,y=e.onSelectEnd,x=e.onDoubleClick,D=e.onKeyPress,R=e.resourceId,k=e.longPressThreshold,j=e.isAllDay,M=e.resizable,C=e.showAllEvents;if(f)return this.renderDummy();var _=this.slotMetrics((0,Nr.default)((0,Nr.default)({},this.props),{},{maxRows:this.state.showAllEvents?1/0:this.props.maxRows,maxRowsStatic:this.props.maxRows})),O=_.levels,N=_.extra,P=_.extraStatic,I=C?wl.default:bl.default,H=v.weekWrapper,J={selected:u,accessors:p,getters:m,localizer:w,components:v,onSelect:S,onDoubleClick:x,onKeyPress:D,resourceId:R,slotMetrics:_,resizable:M};return z.default.createElement("div",{className:l,role:"rowgroup",ref:this.containerRef},P.length>1&&z.default.createElement("div",{onClick:this.handleShowMore,className:"chevron-show-more"},z.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",className:"icon icon-tabler ".concat(this.state.showAllEvents?"icon-tabler-chevron-up":"icon-tabler-chevron-down"),width:"20",height:"20",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},z.default.createElement("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),this.state.showAllEvents?z.default.createElement("path",{d:"M6 15l6 -6l6 6"}):z.default.createElement("path",{d:"M6 9l6 6l6 -6"}))),z.default.createElement(gl.default,{localizer:w,date:a,getNow:g,rtl:s,range:i,selectable:c,container:this.getContainer,getters:m,onSelectStart:b,onSelectEnd:y,onSelectSlot:this.handleSelectSlot,components:v,longPressThreshold:k,resourceId:R}),z.default.createElement("div",{className:(0,$t.default)("rbc-row-content",C&&"rbc-row-content-scrollable"),role:"row"},h&&z.default.createElement("div",{className:"rbc-row ",ref:this.headingRowRef},i.map(this.renderHeadingCell)),z.default.createElement("div",null,z.default.createElement(I,null,z.default.createElement(H,Object.assign({isAllDay:j},J,{rtl:this.props.rtl}),O.map(function(te,ce){return z.default.createElement(yl.default,Object.assign({key:ce,segments:te},J))}),!!N.length&&z.default.createElement(Sl.default,Object.assign({segments:N,onShowMore:this.handleShowMore},J)))))))}}]),o}(z.default.Component);Cn.defaultProps={minRows:0,maxRows:1/0};lt.default=Cn;var dt={},Rn=q.default;Object.defineProperty(dt,"__esModule",{value:!0});dt.default=void 0;Rn(Ve);var xl=Rn(E),kn=function(n){var o=n.label;return xl.default.createElement("span",{role:"columnheader","aria-sort":"none"},o)};kn.propTypes={};dt.default=kn;var ft={},Dl=q.default;Object.defineProperty(ft,"__esModule",{value:!0});ft.default=void 0;var Pr=Dl(E),Cl=function(n){var o=n.label;return Pr.default.createElement(Pr.default.Fragment,null,o)};ft.default=Cl;var se=q.default;Object.defineProperty(st,"__esModule",{value:!0});st.default=void 0;var Rl=se(Vt),kl=se(ve),Ml=se(he),$l=se(we),Tl=se(Ee),Ir=se(ge),_l=se(qs),V=se(E),zr=se(lt),jl=se(dt),Ol=se(ft),Nl=ye,Pl=function(r){(0,$l.default)(o,r);var n=(0,Tl.default)(o);function o(){var t;(0,kl.default)(this,o);for(var e=arguments.length,a=new Array(e),s=0;s<e;s++)a[s]=arguments[s];return t=n.call.apply(n,[this].concat(a)),t.handleHeaderClick=function(i,l,u){u.preventDefault(),(0,Nl.notify)(t.props.onDrillDown,[i,l])},t.renderRow=function(i){var l=t.props,u=l.events,c=l.rtl,f=l.selectable,p=l.getNow,m=l.range,v=l.getters,g=l.localizer,h=l.accessors,S=l.components,w=l.resizable,b=h.resourceId(i),y=i?u.filter(function(x){return h.resource(x)===b}):u;return V.default.createElement(zr.default,{isAllDay:!0,rtl:c,getNow:p,minRows:2,maxRows:t.props.allDayMaxRows+1,range:m,events:y,resourceId:b,className:"rbc-allday-cell",selectable:f,selected:t.props.selected,components:S,accessors:h,getters:v,localizer:g,onSelect:t.props.onSelectEvent,onShowMore:t.props.onShowMore,onDoubleClick:t.props.onDoubleClickEvent,onKeyPress:t.props.onKeyPressEvent,onSelectSlot:t.props.onSelectSlot,longPressThreshold:t.props.longPressThreshold,resizable:w})},t}return(0,Ml.default)(o,[{key:"renderHeaderCells",value:function(e){var a=this,s=this.props,i=s.localizer,l=s.getDrilldownView,u=s.getNow,c=s.getters.dayProp,f=s.components.header,p=f===void 0?jl.default:f,m=u();return e.map(function(v,g){var h=l(v),S=i.format(v,"dayFormat"),w=c(v),b=w.className,y=w.style,x=V.default.createElement(p,{date:v,label:S,localizer:i});return V.default.createElement("div",{key:g,style:y,className:(0,Ir.default)("rbc-header",b,i.isSameDate(v,m)&&"rbc-today")},h?V.default.createElement("button",{type:"button",className:"rbc-button-link",onClick:function(R){return a.handleHeaderClick(v,h,R)}},x):V.default.createElement("span",null,x))})}},{key:"render",value:function(){var e=this,a=this.props,s=a.width,i=a.rtl,l=a.resources,u=a.range,c=a.events,f=a.getNow,p=a.accessors,m=a.selectable,v=a.components,g=a.getters,h=a.scrollRef,S=a.localizer,w=a.isOverflowing,b=a.components,y=b.timeGutterHeader,x=b.resourceHeader,D=x===void 0?Ol.default:x,R=a.resizable,k={};w&&(k[i?"marginLeft":"marginRight"]="".concat((0,_l.default)()-1,"px"));var j=l.groupEvents(c);return V.default.createElement("div",{style:k,ref:h,className:(0,Ir.default)("rbc-time-header",w&&"rbc-overflowing")},V.default.createElement("div",{className:"rbc-label rbc-time-header-gutter",style:{width:s,minWidth:s,maxWidth:s}},y&&V.default.createElement(y,null)),l.map(function(M,C){var _=(0,Rl.default)(M,2),O=_[0],N=_[1];return V.default.createElement("div",{className:"rbc-time-header-content",key:O||C},N&&V.default.createElement("div",{className:"rbc-row rbc-row-resource",key:"resource_".concat(C)},V.default.createElement("div",{className:"rbc-header"},V.default.createElement(D,{index:C,label:p.resourceTitle(N),resource:N}))),V.default.createElement("div",{className:"rbc-row rbc-time-header-cell".concat(u.length<=1?" rbc-time-header-cell-single-day":"")},e.renderHeaderCells(u)),V.default.createElement(zr.default,{isAllDay:!0,rtl:i,getNow:f,minRows:2,maxRows:e.props.allDayMaxRows+1,range:u,events:j.get(O)||[],resourceId:N&&O,className:"rbc-allday-cell",selectable:m,selected:e.props.selected,components:v,accessors:p,getters:g,localizer:S,onSelect:e.props.onSelectEvent,onShowMore:e.props.onShowMore,onDoubleClick:e.props.onDoubleClickEvent,onKeyPress:e.props.onKeyPressEvent,onSelectSlot:e.props.onSelectSlot,longPressThreshold:e.props.longPressThreshold,resizable:R}))}))}}]),o}(V.default.Component);st.default=Pl;var pt={};const Il=de(ko);var vt={};const zl=de(Oa);var rr={};Object.defineProperty(rr,"__esModule",{value:!0});rr.default=Fl;var Al=E;function Fl(r){var n=r.ref,o=r.callback;(0,Al.useEffect)(function(){var t=function(a){n.current&&!n.current.contains(a.target)&&o()};return document.addEventListener("mousedown",t),function(){document.removeEventListener("mousedown",t)}},[n,o])}var ht=q.default,Wl=me.default;Object.defineProperty(vt,"__esModule",{value:!0});vt.default=void 0;var Me=Wl(E),B=ht(Ve),_t=ht(zl),Ll=ht(rr),Hl=ht(Na),ql=Lt;function Bl(r){var n=r.target,o=r.offset,t=r.container,e=r.box,a=(0,_t.default)(n),s=a.top,i=a.left,l=a.width,u=a.height,c=(0,_t.default)(t),f=c.top,p=c.left,m=c.width,v=c.height,g=(0,_t.default)(e),h=g.width,S=g.height,w=f+v,b=p+m,y=s+S,x=i+h,D=o.x,R=o.y,k=y>w?s-S-R:s+R+u,j=x>b?i+D-h+l:i+D;return{topOffset:k,leftOffset:j}}function Gl(r){var n=r.containerRef,o=r.accessors,t=r.getters,e=r.selected,a=r.components,s=r.localizer,i=r.position,l=r.show,u=r.events,c=r.slotStart,f=r.slotEnd,p=r.onSelect,m=r.onDoubleClick,v=r.onKeyPress,g=r.handleDragStart,h=r.popperRef,S=r.target,w=r.offset;(0,Ll.default)({ref:h,callback:l}),(0,Me.useLayoutEffect)(function(){var x=Bl({target:S,offset:w,container:n.current,box:h.current}),D=x.topOffset,R=x.leftOffset;h.current.style.top="".concat(D,"px"),h.current.style.left="".concat(R,"px")},[w.x,w.y,S]);var b=i.width,y={minWidth:b+b/2};return Me.default.createElement("div",{style:y,className:"rbc-overlay",ref:h},Me.default.createElement("div",{className:"rbc-overlay-header"},s.format(c,"dayHeaderFormat")),u.map(function(x,D){return Me.default.createElement(Hl.default,{key:D,type:"popup",localizer:s,event:x,getters:t,onSelect:p,accessors:o,components:a,onDoubleClick:m,onKeyPress:v,continuesPrior:s.lt(o.end(x),c,"day"),continuesAfter:s.gte(o.start(x),f,"day"),slotStart:c,slotEnd:f,selected:(0,ql.isSelected)(x,e),draggable:!0,onDragStart:function(){return g(x)},onDragEnd:function(){return l()}})}))}var Mn=Me.default.forwardRef(function(r,n){return Me.default.createElement(Gl,Object.assign({},r,{popperRef:n}))});Mn.propTypes={accessors:B.default.object.isRequired,getters:B.default.object.isRequired,selected:B.default.object,components:B.default.object.isRequired,localizer:B.default.object.isRequired,position:B.default.object.isRequired,show:B.default.func.isRequired,events:B.default.array.isRequired,slotStart:B.default.instanceOf(Date).isRequired,slotEnd:B.default.instanceOf(Date),onSelect:B.default.func,onDoubleClick:B.default.func,onKeyPress:B.default.func,handleDragStart:B.default.func,style:B.default.object,offset:B.default.shape({x:B.default.number,y:B.default.number})};vt.default=Mn;var $n=q.default,Ul=me.default;Object.defineProperty(pt,"__esModule",{value:!0});pt.default=void 0;var Pe=Ul(E),L=$n(Ve),Kl=Il,Zl=$n(vt);function Jl(r){var n=r.containerRef,o=r.popupOffset,t=o===void 0?5:o,e=r.overlay,a=r.accessors,s=r.localizer,i=r.components,l=r.getters,u=r.selected,c=r.handleSelectEvent,f=r.handleDoubleClickEvent,p=r.handleKeyPressEvent,m=r.handleDragStart,v=r.onHide,g=r.overlayDisplay,h=(0,Pe.useRef)(null);if(!e.position)return null;var S=t;isNaN(t)||(S={x:t,y:t});var w=e.position,b=e.events,y=e.date,x=e.end;return Pe.default.createElement(Kl.Overlay,{rootClose:!0,flip:!0,show:!0,placement:"bottom",onHide:v,target:e.target},function(D){var R=D.props;return Pe.default.createElement(Zl.default,Object.assign({},R,{containerRef:n,ref:h,target:e.target,offset:S,accessors:a,getters:l,selected:u,components:i,localizer:s,position:w,show:g,events:b,slotStart:y,slotEnd:x,onSelect:c,onDoubleClick:f,onKeyPress:p,handleDragStart:m}))})}var Tn=Pe.default.forwardRef(function(r,n){return Pe.default.createElement(Jl,Object.assign({},r,{containerRef:n}))});Tn.propTypes={popupOffset:L.default.oneOfType([L.default.number,L.default.shape({x:L.default.number,y:L.default.number})]),overlay:L.default.shape({position:L.default.object,events:L.default.array,date:L.default.instanceOf(Date),end:L.default.instanceOf(Date)}),accessors:L.default.object.isRequired,localizer:L.default.object.isRequired,components:L.default.object.isRequired,getters:L.default.object.isRequired,selected:L.default.object,handleSelectEvent:L.default.func,handleDoubleClickEvent:L.default.func,handleKeyPressEvent:L.default.func,handleDragStart:L.default.func,onHide:L.default.func,overlayDisplay:L.default.func};pt.default=Tn;const Vl=de(Pa),Yl=de(Ia);var Fe={};Object.defineProperty(Fe,"__esModule",{value:!0});Fe.NONE=void 0;Fe.default=Xl;var jt=Fe.NONE={};function Xl(r,n){return{map:function(t){return r?r.map(function(e,a){return t([n.resourceId(e),e],a)}):[t([jt,null],0)]},groupEvents:function(t){var e=new Map;return r?(t.forEach(function(a){var s=n.resource(a)||jt;if(Array.isArray(s))s.forEach(function(l){var u=e.get(l)||[];u.push(a),e.set(l,u)});else{var i=e.get(s)||[];i.push(a),e.set(s,i)}}),e):(e.set(jt,t),e)}}}var _n=me.default,X=q.default;Object.defineProperty(Jt,"__esModule",{value:!0});var jn=Jt.default=void 0,Ql=X(Vt),Ar=X($e),ei=X(ve),ti=X(he),ri=X(we),ni=X(Ee),ne=_n(E),ai=X(ge),Ot=_n(Bo),oi=X(vn),si=X(Qe),li=X(ot),ii=X(st),ci=X(pt),ui=X(Vl),di=X(Yl),fi=za,Nt=Ht,Re=ye,pi=X(Fe),vi=jn=Jt.default=function(r){(0,ri.default)(o,r);var n=(0,ni.default)(o);function o(t){var e;return(0,ei.default)(this,o),e=n.call(this,t),e.handleScroll=function(a){e.scrollRef.current&&(e.scrollRef.current.scrollLeft=a.target.scrollLeft)},e.handleResize=function(){Ot.cancel(e.rafHandle),e.rafHandle=Ot.request(e.checkOverflow)},e.handleKeyPressEvent=function(){e.clearSelection();for(var a=arguments.length,s=new Array(a),i=0;i<a;i++)s[i]=arguments[i];(0,Re.notify)(e.props.onKeyPressEvent,s)},e.handleSelectEvent=function(){e.clearSelection();for(var a=arguments.length,s=new Array(a),i=0;i<a;i++)s[i]=arguments[i];(0,Re.notify)(e.props.onSelectEvent,s)},e.handleDoubleClickEvent=function(){e.clearSelection();for(var a=arguments.length,s=new Array(a),i=0;i<a;i++)s[i]=arguments[i];(0,Re.notify)(e.props.onDoubleClickEvent,s)},e.handleShowMore=function(a,s,i,l,u){var c=e.props,f=c.popup,p=c.onDrillDown,m=c.onShowMore,v=c.getDrilldownView,g=c.doShowMoreDrillDown;if(e.clearSelection(),f){var h=(0,di.default)(i,e.containerRef.current);e.setState({overlay:{date:s,events:a,position:(0,Ar.default)((0,Ar.default)({},h),{},{width:"200px"}),target:u}})}else g&&(0,Re.notify)(p,[s,v(s)||fi.views.DAY]);(0,Re.notify)(m,[a,s,l])},e.handleSelectAllDaySlot=function(a,s){var i=e.props.onSelectSlot,l=new Date(a[0]),u=new Date(a[a.length-1]);u.setDate(a[a.length-1].getDate()+1),(0,Re.notify)(i,{slots:a,start:l,end:u,action:s.action,resourceId:s.resourceId})},e.overlayDisplay=function(){e.setState({overlay:null})},e.checkOverflow=function(){if(!e._updatingOverflow){var a=e.contentRef.current,s=a.scrollHeight>a.clientHeight;e.state.isOverflowing!==s&&(e._updatingOverflow=!0,e.setState({isOverflowing:s},function(){e._updatingOverflow=!1}))}},e.memoizedResources=(0,oi.default)(function(a,s){return(0,pi.default)(a,s)}),e.state={gutterWidth:void 0,isOverflowing:null},e.scrollRef=ne.default.createRef(),e.contentRef=ne.default.createRef(),e.containerRef=ne.default.createRef(),e._scrollRatio=null,e.gutterRef=(0,ne.createRef)(),e}return(0,ti.default)(o,[{key:"getSnapshotBeforeUpdate",value:function(){return this.checkOverflow(),null}},{key:"componentDidMount",value:function(){this.props.width==null&&this.measureGutter(),this.calculateScroll(),this.applyScroll(),window.addEventListener("resize",this.handleResize)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.handleResize),Ot.cancel(this.rafHandle),this.measureGutterAnimationFrameRequest&&window.cancelAnimationFrame(this.measureGutterAnimationFrameRequest)}},{key:"componentDidUpdate",value:function(){this.applyScroll()}},{key:"renderEvents",value:function(e,a,s,i){var l=this,u=this.props,c=u.min,f=u.max,p=u.components,m=u.accessors,v=u.localizer,g=u.dayLayoutAlgorithm,h=this.memoizedResources(this.props.resources,m),S=h.groupEvents(a),w=h.groupEvents(s);return h.map(function(b,y){var x=(0,Ql.default)(b,2),D=x[0],R=x[1];return e.map(function(k,j){var M=(S.get(D)||[]).filter(function(_){return v.inRange(k,m.start(_),m.end(_),"day")}),C=(w.get(D)||[]).filter(function(_){return v.inRange(k,m.start(_),m.end(_),"day")});return ne.default.createElement(si.default,Object.assign({},l.props,{localizer:v,min:v.merge(k,c),max:v.merge(k,f),resource:R&&D,components:p,isNow:v.isSameDate(k,i),key:y+"-"+j,date:k,events:M,backgroundEvents:C,dayLayoutAlgorithm:g}))})})}},{key:"render",value:function(){var e,a=this.props,s=a.events,i=a.backgroundEvents,l=a.range,u=a.width,c=a.rtl,f=a.selected,p=a.getNow,m=a.resources,v=a.components,g=a.accessors,h=a.getters,S=a.localizer,w=a.min,b=a.max,y=a.showMultiDayTimes,x=a.longPressThreshold,D=a.resizable;u=u||this.state.gutterWidth;var R=l[0],k=l[l.length-1];this.slots=l.length;var j=[],M=[],C=[];return s.forEach(function(_){if((0,Nt.inRange)(_,R,k,g,S)){var O=g.start(_),N=g.end(_);g.allDay(_)||S.startAndEndAreDateOnly(O,N)||!y&&!S.isSameDate(O,N)?j.push(_):M.push(_)}}),i.forEach(function(_){(0,Nt.inRange)(_,R,k,g,S)&&C.push(_)}),j.sort(function(_,O){return(0,Nt.sortEvents)(_,O,g,S)}),ne.default.createElement("div",{className:(0,ai.default)("rbc-time-view",m&&"rbc-time-view-resources"),ref:this.containerRef},ne.default.createElement(ii.default,{range:l,events:j,width:u,rtl:c,getNow:p,localizer:S,selected:f,allDayMaxRows:this.props.showAllEvents?1/0:(e=this.props.allDayMaxRows)!==null&&e!==void 0?e:1/0,resources:this.memoizedResources(m,g),selectable:this.props.selectable,accessors:g,getters:h,components:v,scrollRef:this.scrollRef,isOverflowing:this.state.isOverflowing,longPressThreshold:x,onSelectSlot:this.handleSelectAllDaySlot,onSelectEvent:this.handleSelectEvent,onShowMore:this.handleShowMore,onDoubleClickEvent:this.props.onDoubleClickEvent,onKeyPressEvent:this.props.onKeyPressEvent,onDrillDown:this.props.onDrillDown,getDrilldownView:this.props.getDrilldownView,resizable:D}),this.props.popup&&this.renderOverlay(),ne.default.createElement("div",{ref:this.contentRef,className:"rbc-time-content",onScroll:this.handleScroll},ne.default.createElement(li.default,{date:R,ref:this.gutterRef,localizer:S,min:S.merge(R,w),max:S.merge(R,b),step:this.props.step,getNow:this.props.getNow,timeslots:this.props.timeslots,components:v,className:"rbc-time-gutter",getters:h}),this.renderEvents(l,M,C,p())))}},{key:"renderOverlay",value:function(){var e,a,s=this,i=(e=(a=this.state)===null||a===void 0?void 0:a.overlay)!==null&&e!==void 0?e:{},l=this.props,u=l.accessors,c=l.localizer,f=l.components,p=l.getters,m=l.selected,v=l.popupOffset,g=l.handleDragStart,h=function(){return s.setState({overlay:null})};return ne.default.createElement(ci.default,{overlay:i,accessors:u,localizer:c,components:f,getters:p,selected:m,popupOffset:v,ref:this.containerRef,handleKeyPressEvent:this.handleKeyPressEvent,handleSelectEvent:this.handleSelectEvent,handleDoubleClickEvent:this.handleDoubleClickEvent,handleDragStart:g,show:!!i.position,overlayDisplay:this.overlayDisplay,onHide:h})}},{key:"clearSelection",value:function(){clearTimeout(this._selectTimer),this._pendingSelection=[]}},{key:"measureGutter",value:function(){var e=this;this.measureGutterAnimationFrameRequest&&window.cancelAnimationFrame(this.measureGutterAnimationFrameRequest),this.measureGutterAnimationFrameRequest=window.requestAnimationFrame(function(){var a,s=(a=e.gutterRef)!==null&&a!==void 0&&a.current?(0,ui.default)(e.gutterRef.current):void 0;s&&e.state.gutterWidth!==s&&e.setState({gutterWidth:s})})}},{key:"applyScroll",value:function(){if(this._scrollRatio!=null&&this.props.enableAutoScroll===!0){var e=this.contentRef.current;e.scrollTop=e.scrollHeight*this._scrollRatio,this._scrollRatio=null}}},{key:"calculateScroll",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props,a=e.min,s=e.max,i=e.scrollToTime,l=e.localizer,u=l.diff(l.merge(i,a),i,"milliseconds"),c=l.diff(a,s,"milliseconds");this._scrollRatio=u/c}}]),o}(ne.Component);vi.defaultProps={step:30,timeslots:2};const Fr=(r,n)=>G.fromJSDate(r).setLocale(n==="ru"?"ru":"en").toFormat("ccc, dd LLL yyyy"),We=({date:r,localizer:n,max:o=n.endOf(new Date,"day"),min:t=n.startOf(new Date,"day"),scrollToTime:e=n.startOf(new Date,"day"),endDate:a,...s})=>{const i=E.useMemo(()=>We.range(r,{localizer:n,endDate:a}),[r,n,a]);return d.jsx(jn,{date:r,localizer:n,max:o,min:t,range:i,scrollToTime:e,...s})};We.range=(r,{localizer:n,endDate:o})=>{let t=r;const e=[];for(;n.lte(t,o,"day");)e.push(t),t=n.add(t,1,"day");return e};We.navigate=r=>r;We.title=()=>"";const hi=E.forwardRef((r,n)=>{const{startDate:o,endDate:t,calendarEvents:e,activeCalendars:a,orientation:s,timezone:i,printStyle:l,hourStart:u,hourEnd:c}=r,{i18n:f}=ae(),p=f.language,[m,v]=E.useState([]);E.useEffect(()=>{const S=Math.ceil(G.fromJSDate(t).diff(G.fromJSDate(o),"days").days)+1,w=S>7?4:1,y=Math.ceil(S/7),x=Math.max(w,Math.floor(S/y)),D=[];let R=G.fromJSDate(o);for(let k=0;k<y;k++){const j=R.toJSDate(),M=k===0?S-x*(y-1):x,C=R.plus({days:M-1}).toJSDate();D.push({segmentStart:j,segmentEnd:C}),R=R.plus({days:M})}v(D)},[o,t]);const g=Y(Wt),h=E.useCallback(S=>cn(g,be.WEEK,l)(S),[g,l]);return d.jsx(Xe,{pages:m.length,ref:n,children:m.map(({segmentStart:S,segmentEnd:w})=>d.jsxs("div",{className:`print-calendar calendar-${s}`,children:[d.jsxs(A,{display:"flex",style:{justifyContent:"space-between"},mb:2,children:[a,d.jsxs(K,{fz:12,style:{whiteSpace:"nowrap",marginLeft:8},children:[Fr(S,p)," –"," ",Fr(w,p),i&&` - ${i}`]})]}),d.jsx(en,{eventPropGetter:h,components:{event:b=>d.jsx(ln,{printStyle:l,view:be.WEEK,...b})},dayLayoutAlgorithm:"no-overlap",culture:p==="ru"?"ru-RU":"en-GB",events:e,defaultView:be.WEEK,date:S,style:{width:"100%",height:"95%"},localizer:tn.localizer,views:{month:!0,week:We},toolbar:!1,min:u,max:c,endDate:w})]},S.toString()))})}),Wr=()=>{const r=G.now(),n=r.startOf("week"),o=r.endOf("week").startOf("day");return[n.toJSDate(),o.toJSDate()]},On=(r,n,o)=>G.fromObject({year:1970,month:1,day:1,hour:r,minute:n,second:0},{zone:o}).setZone("local").toJSDate(),Lr=(r,n)=>n?On(+r,0,n):new Date(1970,1,1,+r,0,0),Hr=(r,n)=>n?On(+r==0?23:+r,+r==0?59:0,n):new Date(1970,1,1,+r==0?23:+r,+r==0?59:0,0),qr=r=>{const n=Array.from({length:23},(o,t)=>({label:`${(t+1).toString().padStart(2,"0")}:00`,value:(t+1).toString()}));return r?n.push({label:"00:00",value:"0"}):n.unshift({label:"00:00",value:"0"}),n},mi=(r,n,o)=>{const t=G.fromJSDate(r).toFormat("HH:mm");return t>=n&&t<=o},gi=r=>{const{open:n,onClose:o}=r,{i18n:t,t:e}=ae(),a=E.useRef(null),[s,i]=E.useState(),[l,u]=E.useState("landscape"),[c,f]=E.useState("default"),[p,m]=E.useState("week"),[v,g]=E.useState(Wr),[h,S]=E.useState(Wr),[w,b]=E.useState("0"),[y,x]=E.useState("0"),D=Y(Aa),R=Y(Fa),k=Y(Qr),j=Y(Wa),M=Y(La),C=k.Timezone?j[k.Timezone.Id]:null,_=Je(),O=D.filter(T=>T.isActive),N=d.jsx(K,{fz:12,children:O.map((T,F)=>d.jsxs(E.Fragment,{children:[d.jsx(K,{span:!0,c:c==="blackWhite"?"black":T.color,inherit:!0,children:T.name},T.id),F<O.length-1&&", "]},T.id))}),P=E.useMemo(()=>({activeCalendars:N,calendarEvents:M.filter(T=>mi(T.start,G.fromJSDate(Lr(w,C==null?void 0:C.tzName)).toFormat("HH:mm"),G.fromJSDate(Hr(y,C==null?void 0:C.tzName)).toFormat("HH:mm"))||T.allDay),startDate:h[0],endDate:h[1],timezone:(C==null?void 0:C.label)||"",orientation:l,printStyle:c,hourStart:Lr(w,C==null?void 0:C.tzName),hourEnd:Hr(y,C==null?void 0:C.tzName)}),[N,M,h,C,l,c,w,y]),I=E.useCallback(async()=>{if(!h[0]||!h[1])return;const F={body:{CalendarIds:D.filter(Z=>Z.isActive).reduce((Z,re)=>(re.id&&Z.push(re.id),Z),[]),StartDate:Sr(h[0]),EndDate:Sr(h[1])},calendarsGroup:R,isEdit:!1};await _(Ha(F)).unwrap()},[_,R,h]),H=T=>{const F=[wr(T[0]),wr(T[1])];F[0]&&F[1]&&(S(F),g(F)),g(F)},J=T=>{u(T),s&&document.head.removeChild(s);const F=document.createElement("style");return F.type="text/css",F.innerHTML=`
      @media print {
        @page {
          size: A4 ${T};
        }  
      }
    `,document.head.appendChild(F),i(F),F};E.useEffect(()=>{!h[0]||!h[1]||D.length===0||I()},[h[0],h[1],D]);const te=T=>{T&&(+T>+y&&+y!=0&&x((+T+1).toString()),b(T))},ce=T=>{T&&(+T<+w&&+T!=0&&b((+T-1).toString()),x(T))};return d.jsx(Jr,{size:"95%",centered:!0,keepMounted:!1,opened:n,withCloseButton:!1,onClose:o,padding:0,className:"calendar-preview",children:d.jsxs(A,{display:"flex",w:"100%",children:[d.jsx(A,{style:{position:"absolute",right:0,top:8,zIndex:9},children:d.jsx(Se,{size:"xs",variant:"transparent",onClick:o,children:d.jsx(qa,{size:"24",color:"black"})})}),d.jsxs(A,{w:320,display:"flex",style:{flexDirection:"column"},p:16,children:[d.jsxs(br,{children:[d.jsx(Ba,{fz:20,order:2,fw:400,children:e("printEvent.preview")}),d.jsx(ue,{mb:16,children:d.jsx(Ga,{h:36,locale:t.language,popoverProps:{withinPortal:!0},type:"range",value:v,onChange:H,label:e("printEvent.printRange"),style:{width:"100%",marginBottom:8},valueFormat:"dd DD.MM.YYYY"})}),d.jsx(je,{w:"100%",size:"sm",label:e("printEvent.viewMode"),data:[{value:"auto",label:e("printEvent.autoView")},{value:"day",label:e("calendarViews.day")},{value:"week",label:e("calendarViews.week")},{value:"work_week",label:e("calendarViews.workingWeek")},{value:"month",label:e("calendarViews.month")}],value:p,onChange:T=>m(T)}),d.jsx(je,{w:"100%",size:"sm",label:e("printEvent.orientation"),data:[{value:"landscape",label:e("printEvent.landscape")},{value:"portrait",label:e("printEvent.portrait")}],value:l,onChange:T=>T&&J(T)}),d.jsx(je,{w:"100%",size:"sm",label:e("printEvent.colorStyle"),data:[{value:"default",label:e("printEvent.defaultStyle")},{value:"line",label:e("printEvent.contours")},{value:"blackWhite",label:e("printEvent.blackWhite")}],value:c,onChange:T=>T&&f(T)}),d.jsx(br,{children:d.jsxs(ue,{gap:8,align:"flex-end",children:[d.jsx(je,{label:e("printEvent.timeRange"),data:qr(),value:w,onChange:te}),d.jsx(je,{data:qr(!0),value:y,onChange:ce})]})})]}),d.jsx(Vr,{gap:10,mt:"auto",justify:"flex-end",children:d.jsxs(ue,{gap:8,children:[d.jsx(Se,{variant:"outline",onClick:o,children:e("buttons.cancel")}),d.jsx(Ua,{trigger:()=>d.jsx(Se,{type:"submit",children:e("buttons.print")}),content:()=>a.current,onAfterPrint:o})]})})]}),p==="day"&&d.jsx(Fo,{ref:a,...P}),(p==="week"||p==="work_week")&&d.jsx(zo,{ref:a,view:p,...P}),p==="month"&&d.jsx(Wo,{ref:a,...P}),p==="auto"&&d.jsx(hi,{ref:a,...P})]})})},yi=()=>{const{t:r}=ae(),[n,o]=E.useState(!1),{isMobile:t}=Yr();return t?null:d.jsxs(d.Fragment,{children:[d.jsx(K,{pb:8,className:"section-title",children:r("settings.navBar.printCalendar")}),d.jsx(Se,{maw:200,mb:20,variant:"default",onClick:()=>o(!0),leftSection:d.jsx(to,{size:"1em"}),children:r("settings.navBar.print")}),n&&d.jsx(gi,{open:n,onClose:()=>o(!1)})]})},bi=()=>{const r=Y(Ka),n=Y(Za);return r==="fulfilled"&&n==="fulfilled"?d.jsx(Ja,{withFullPage:!0,children:d.jsxs(Va,{children:[d.jsx(jo,{}),d.jsx(Ct,{h:30}),d.jsx(_o,{}),d.jsx(Ct,{h:30}),d.jsx(Mo,{}),d.jsx(Ct,{h:30}),d.jsx(yi,{})]})}):d.jsx(ue,{w:"100%",h:"calc(100vh - 8rem)",justify:"center",align:"center",children:d.jsx(Ya,{})})};export{bi as default};
