@kizenapps/cli 1.10.0-0a9fae5 → 1.10.0
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/README.md +172 -15
- package/dist/THIRD-PARTY-NOTICES.txt +4342 -0
- package/dist/index.js +24 -24
- package/dist/index.js.map +1 -1
- package/dist/viewer/assets/AppDetailPage-D9xr-bY8.js +1 -0
- package/dist/viewer/assets/{CodeStepsPage-BjnqiAQX.js → CodeStepsPage-CvCrJCQn.js} +1 -1
- package/dist/viewer/assets/{ConfigurationPage-XUysfO8v.js → ConfigurationPage-5qOX-sx0.js} +1 -1
- package/dist/viewer/assets/IconReferencePage-BxPfyqlV.js +1 -0
- package/dist/viewer/assets/SandboxPage-DuCHX1FY.js +1 -0
- package/dist/viewer/assets/{SecretsPage-BwDfBKbY.js → SecretsPage-Da55-e_S.js} +1 -1
- package/dist/viewer/assets/{SourceBrowserPage-D9z0jLNw.js → SourceBrowserPage-DluS8U4q.js} +1 -1
- package/dist/viewer/assets/blockDimensions-BhWxVVcK.js +1 -0
- package/dist/viewer/assets/{index-C570aZ49.js → index-Du4zThGL.js} +2 -2
- package/dist/viewer/assets/index-MRuQEa3q.css +2 -0
- package/dist/viewer/assets/{useCompleteSetup-3RGdCYrc.js → useCompleteSetup-DUHoBgca.js} +1 -1
- package/dist/viewer/assets/{usePluginConfig-XFnehL_S.js → usePluginConfig-C8d13THZ.js} +1 -1
- package/dist/viewer/assets/validIcons-D8mhuO5s.js +1 -0
- package/dist/viewer/index.html +2 -2
- package/package.json +27 -8
- package/dist/viewer/assets/AppDetailPage-CKDgNuvS.js +0 -1
- package/dist/viewer/assets/IconReferencePage-CN9Tha2W.js +0 -1
- package/dist/viewer/assets/SandboxPage-DbMklAzy.js +0 -1
- package/dist/viewer/assets/blockDimensions-XngD6WWh.js +0 -1
- package/dist/viewer/assets/fa-pro-icons-B6J9phvt.js +0 -1
- package/dist/viewer/assets/iconMap-B-cS2yrx.js +0 -1
- package/dist/viewer/assets/index-CortCmDi.css +0 -2
- /package/dist/viewer/assets/{CodeViewer-DpJLTTab.js → CodeViewer-CVECJY4e.js} +0 -0
- /package/dist/viewer/assets/{VersionsPage-CRnStnQ-.js → VersionsPage-yNilRkEf.js} +0 -0
- /package/dist/viewer/assets/{WhenBadge-Dm7YHpxd.js → WhenBadge-B7s7fns2.js} +0 -0
- /package/dist/viewer/assets/{formatBytes-BV6bvmhE.js → formatBytes-BXYIMbyB.js} +0 -0
- /package/dist/viewer/assets/{setupAssistant-C-3V_Vj3.js → setupAssistant-DtI9NWXr.js} +0 -0
- /package/dist/viewer/assets/{useLocalStorage-BZr9ZJI5.js → useLocalStorage-wp83IS34.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{A as t,D as n,F as r,I as i,M as a,N as o,P as s,T as c,c as l,i as u,l as d,m as f,o as p,s as m,t as h}from"./fa-core-BSqLAjHu.js";import{n as g}from"./react-C5hrIo29.js";import{t as _}from"./useParams-D3awshYI.js";import{t as v}from"./useQuery-JKMI40WO.js";import{n as y,r as b}from"./BootstrapContext-CS2e3X9Y.js";import{_ as x,b as S,d as C,f as w,g as T,i as E,l as D,m as O,n as k,o as A,p as j,r as ee,t as te,u as ne,v as re,x as ie,y as ae}from"./useCompleteSetup-DUHoBgca.js";import{t as oe}from"./bundleQuery-BE1Gb8Ii.js";import{n as se}from"./CredentialsContext-Cwl_xyt_.js";import{N as ce,a as le,i as ue,m as de,n as fe,o as pe,r as me,s as he}from"./api--Ax6VWLq.js";import{n as ge}from"./SidebarContext-q5sbcZXM.js";import{n as _e,t as ve}from"./Dialog-C3QoiHOt.js";import{c as ye,i as be,l as xe,n as Se,r as Ce,s as we,t as Te,u as Ee}from"./storageKeys-DPq6kaaE.js";import{t as M}from"./Card-Sa52PGkn.js";import{t as De}from"./Tooltip-JYkgiL8J.js";import{n as Oe,r as ke,t as Ae}from"./blockDimensions-BhWxVVcK.js";import{t as je}from"./useLocalStorage-wp83IS34.js";import{t as Me}from"./usePluginConfig-C8d13THZ.js";import{n as Ne,t as Pe}from"./WhenBadge-B7s7fns2.js";var N=e(i(),1),Fe=g(),P=r(),Ie=new Intl.Segmenter(void 0,{granularity:`grapheme`}),Le=e=>{for(let{segment:t}of Ie.segment(e))return t},Re=36,ze=20,Be=9e3,Ve=({frameId:e,side:t,color:n,zIndex:r,onClick:i,CustomIcon:a,circleIcon:o,when:s,whenEnabled:c})=>{let l=document.getElementById(`${e}-trigger-${t}`);if(!l)return null;let u=a?``:o,d=u?ke(u)?`Open frame — icon: ${u}`:`Open frame — “${u}” is not a recognized icon name`:`Open frame`,f=s&&c!=null?(0,P.jsx)(De,{text:s,children:(0,P.jsx)(`span`,{className:`absolute -top-0.5 -right-0.5 h-2.5 w-2.5 rounded-full border-2 border-white ${c?`bg-green-500`:`bg-amber-500`}`})}):null;return(0,Fe.createPortal)((0,P.jsxs)(`button`,{className:`relative pointer-events-auto flex h-10 w-10 items-center justify-center rounded-full border border-black/10 shadow-lg`,style:{backgroundColor:n,zIndex:r},onClick:i,onPointerDown:e=>{e.stopPropagation()},title:d,children:[a?(0,P.jsx)(a,{className:`h-6 w-6 rounded-full object-cover`}):(0,P.jsx)(`span`,{className:`font-mono text-[11px] uppercase text-white`,children:Le(u)??`▲`}),f]}),l)},He=({frame:e,framesEnabled:t,whenState:n})=>{let r=`${e.plugin_api_name}-${e.api_name}`,i=e.when,[a,o]=(0,N.useState)(null);(0,N.useEffect)(()=>{i&&he(i,n??{}).then(o).catch(()=>{o(null)})},[i,n]);let s=ge(),[c,l]=(0,N.useState)(window.innerHeight);(0,N.useEffect)(()=>{let e=new ResizeObserver(()=>{l(window.innerHeight)});return e.observe(document.body),()=>{e.disconnect()}},[]);let{circleProps:u,parentProps:d,draggableProps:f,pending:p,indicator:m,outputUIRef:h,scopedCss:g,sanitizedHtml:_,interactableScriptRef:v,hideHeader:y,setMinimized:b,dragHandleClassName:x,isFixed:S,isCircle:C,minimized:w,height:T,dragging:E,frameOffset:D,scriptUIRef:O}=ae({currentWindow:e,pathname:`/sandbox`,id:r,frameHeaderSize:Re,defaultPositionGap:ze,viewportHeight:c,hiddenByModal:!1}),k=Be+Math.max(0,D),A=be(r),j=(()=>{try{let e=localStorage.getItem(A);return e?JSON.parse(e):null}catch{return null}})(),ee=(0,N.useRef)(null),[te,ne]=(0,N.useState)(j??f.position),re=(0,N.useRef)(j!==null),ie=f.position;(0,N.useEffect)(()=>{re.current||ne({x:ie.x,y:ie.y})},[ie.x,ie.y]);let oe=(0,N.useCallback)(e=>{if(f.disabled||!e.target.closest(`.${x}`))return;e.preventDefault(),f.onStart();let t=e.clientX,n=e.clientY,r=te.x,i=te.y,a=e=>{ne({x:r+e.clientX-t,y:i+e.clientY-n})},o=e=>{document.removeEventListener(`pointermove`,a),document.removeEventListener(`pointerup`,o);let s={x:r+e.clientX-t,y:i+e.clientY-n};localStorage.setItem(A,JSON.stringify(s)),re.current=!0,f.onStop(e,{node:ee.current})};document.addEventListener(`pointermove`,a),document.addEventListener(`pointerup`,o)},[f,x,te,A]);return(0,P.jsxs)(P.Fragment,{children:[C&&!u.hidden&&(0,P.jsx)(Ve,{frameId:r,side:u.side,color:u.circleColor,zIndex:k,onClick:u.onClick,CustomIcon:u.CustomIcon,circleIcon:u.circleIcon,...i?{when:i,whenEnabled:a}:{}}),(0,P.jsxs)(`div`,{ref:ee,className:d.className,style:{position:`fixed`,left:Math.min(te.x,window.innerWidth-s-(e.width??300)),top:te.y,width:e.width??300,zIndex:k,borderRadius:6,overflow:`hidden`,border:`1px solid rgba(0,0,0,0.1)`,boxShadow:`0 4px 20px rgba(0,0,0,0.1)`,backgroundColor:`white`,opacity:d.hidden||!t?0:1,pointerEvents:d.hidden||!t?`none`:`auto`},onPointerDown:oe,children:[(p||m===`block`)&&(0,P.jsx)(`div`,{className:`absolute inset-0 z-10 flex items-center justify-center bg-white/80 font-mono text-[11px] text-neutral-400`,children:`loading…`}),!y&&(0,P.jsxs)(`div`,{className:`flex select-none items-center border-b border-black/8`,style:{height:Re,backgroundColor:e.header_color??`#fafafa`,color:e.header_text_color??`#1a1a1a`},children:[(0,P.jsxs)(`div`,{className:`${x} flex h-full flex-1 items-center gap-2 overflow-hidden px-3 ${S?``:`cursor-grab active:cursor-grabbing`}`,children:[!S&&(0,P.jsx)(`span`,{className:`shrink-0 font-mono text-[11px] opacity-30`,children:`⠿`}),(0,P.jsx)(`span`,{className:`truncate font-mono text-[12px] font-medium`,children:e.title})]}),(0,P.jsx)(`button`,{className:`flex h-full shrink-0 items-center px-3 font-mono text-[11px] transition-colors hover:bg-black/5`,onClick:()=>{b(!w)},onMouseDown:e=>{e.stopPropagation()},onPointerDown:e=>{e.stopPropagation()},title:w?`Expand`:`Collapse`,children:w?`↑`:`↓`})]}),(0,P.jsxs)(`div`,{style:{height:w?0:T,overflow:`hidden`,transition:`height ${String(T*5e-4)}s ease`},children:[e.type===`script`&&(0,P.jsxs)(`div`,{className:`h-full w-full`,style:{pointerEvents:E||d.hidden||!t?`none`:`auto`},children:[(0,P.jsx)(`div`,{className:`h-full w-full`,ref:O}),(0,P.jsx)(`style`,{children:g})]}),e.type===`html`&&_&&(0,P.jsxs)(`div`,{ref:v,className:`overflow-auto bg-white`,style:{height:T,pointerEvents:E||d.hidden||!t?`none`:`auto`},children:[(0,P.jsx)(`div`,{dangerouslySetInnerHTML:{__html:_}}),(0,P.jsx)(`div`,{ref:h}),(0,P.jsx)(`style`,{children:g})]}),e.type===`iframe`&&(0,P.jsx)(`div`,{className:`h-full w-full`,style:{pointerEvents:E||d.hidden||!t?`none`:`auto`},children:(0,P.jsx)(`div`,{className:`h-full w-full`,ref:O})})]})]})]})};function Ue(e){let t=ue(),{apiKey:n,businessId:r}=se(),i=y(),[a,o]=je(e,null),[s,c]=(0,N.useState)(()=>a?.name??``),[l,u]=(0,N.useState)(``),d=(0,N.useRef)(null);(0,N.useEffect)(()=>(d.current&&clearTimeout(d.current),d.current=setTimeout(()=>{u(s)},300),()=>{d.current&&clearTimeout(d.current)}),[s]);let f=v({queryKey:[`custom-objects`,r,l],queryFn:async()=>{let e=new URLSearchParams({page_size:`20`});l&&e.set(`search`,l);let n=await t(`/custom-objects?${e.toString()}`);if(!n.ok)throw Error(`Failed to fetch custom objects (${String(n.status)})`);return await n.json()},enabled:n!==``&&l.length>=1,staleTime:3e4});return{selectedObject:a,setSelectedObject:o,objectSearch:s,setObjectSearch:c,objectsQuery:f,objectOptions:(()=>{let e=f.data?.results.map(e=>({id:e.id,label:e.object_name}))??[],t=i?.business.client_object;return t?.access&&(!l||t.object_name.toLowerCase().includes(l.toLowerCase()))&&e.unshift({id:t.id,label:t.object_name}),e})()}}function We(e,t){let n=Object.values(e).find(e=>e.name===t);return typeof n?.value==`string`?n.value:``}function Ge(e,t){if(t){let t=We(e.fields,`first_name`),n=We(e.fields,`last_name`),r=We(e.fields,`email`),i=[t,n].filter(Boolean).join(` `);return i?`${i} (${r})`:r||e.id}let n=Object.values(e.fields).find(e=>e.name===`display_name`);return typeof n?.value==`string`?n.value:e.id}function Ke(e,t=``){let n=Ue(xe(e,t)),{selectedObject:r}=n,i=ue(),{apiKey:a}=se(),o=y(),[s,c]=je(ye(e,t),null),[l,u]=(0,N.useState)(()=>s?.label??``),[d,f]=(0,N.useState)(``),p=(0,N.useRef)(null);(0,N.useEffect)(()=>(p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{f(l)},300),()=>{p.current&&clearTimeout(p.current)}),[l]);let m=v({queryKey:[`entity-records`,r?.id,d],queryFn:async()=>{let e=new URLSearchParams({page_size:`20`});d&&e.set(`search`,d);let t=await i(`/records/${r?.id??``}/search?${e.toString()}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:`{}`});if(!t.ok)throw Error(`Failed to search records (${String(t.status)})`);return await t.json()},enabled:a!==``&&r!==null,staleTime:3e4}),h=r?.id===o?.business.client_object?.id,g=m.data?.results.map(e=>({id:e.id,label:Ge(e,h)}))??[];return{...n,selectedEntity:s,setSelectedEntity:c,entitySearch:l,setEntitySearch:u,entitiesQuery:m,entityOptions:g}}var qe=120,Je=e=>e instanceof Error?e.message:typeof e==`object`&&e&&`message`in e?String(e.message):String(e),Ye=e=>{if(e===void 0)return{compact:`no return value`,full:`undefined`,empty:!0};if(typeof e==`string`)return{compact:e===``?`""`:e,full:e,empty:e===``};if(typeof e==`number`||typeof e==`boolean`||e===null){let t=String(e);return{compact:t,full:t,empty:!1}}try{return{compact:JSON.stringify(e),full:JSON.stringify(e,null,2),empty:!1}}catch{return{compact:`[unserializable value]`,full:`[unserializable value]`,empty:!1}}},Xe=e=>e.length>qe?`${e.slice(0,qe)}…`:e,Ze=({result:e})=>{let[t,n]=(0,N.useState)(!1),r=(0,N.useRef)(null),i=ne();(0,N.useEffect)(()=>()=>{r.current&&clearTimeout(r.current)},[]);let a=e.kind===`error`,{compact:c,full:l,empty:d}=a?{compact:e.message,full:e.message,empty:!1}:Ye(e.value);return(0,P.jsx)(De,{text:t?`Copied!`:l,children:(0,P.jsxs)(`span`,{role:`button`,tabIndex:-1,title:`Click to copy`,onClick:e=>{e.stopPropagation(),navigator.clipboard.writeText(l).then(()=>{n(!0),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{n(!1)},1200)}).catch(e=>{console.error(`Failed to copy to clipboard:`,e),i({message:`Could not copy to clipboard`,variant:`failure`})})},className:`inline-flex max-w-[240px] cursor-pointer items-center gap-1 rounded-full border px-2 py-0.5 font-mono text-[10px] transition-colors ${t?`border-emerald-300 bg-emerald-100 text-emerald-800`:a?`border-red-200 bg-red-50 text-red-700 hover:bg-red-100`:d?`border-black/8 bg-neutral-50 text-neutral-400 hover:bg-neutral-100`:`border-emerald-200 bg-emerald-50 text-emerald-700 hover:bg-emerald-100`}`,children:[(0,P.jsx)(s,{icon:t?u:a?o:h,className:`shrink-0 text-[9px] opacity-70`}),(0,P.jsx)(`span`,{className:`min-w-0 truncate`,children:t?`Copied!`:Xe(c)})]})})},Qe=({action:e,objectId:t,entityId:n,actionObjectId:r,actionEntityId:i,pluginApiName:a,configArgs:o,disabled:s})=>{let[c,l]=(0,N.useState)(null),[u,{pending:d}]=ie({objectId:t,entityId:n,onError:t=>{console.error(`[js-action] ${e.api_name}:`,t),l({kind:`error`,message:Je(t)})}}),f={id:e.api_name,api_name:e.api_name,plugin_api_name:a};return(0,P.jsxs)(`button`,{onClick:()=>{let a={objectId:t,entityId:n};r&&i&&(a.actionObjectId=r,a.actionEntityId=i),l(null),u(e.script,o,f,a).then(e=>{l({kind:`value`,value:e})})},disabled:s===!0||d,className:`relative flex flex-col items-start rounded border border-black/8 bg-white px-3 py-1.5 text-left transition-colors hover:bg-black/5 disabled:opacity-50`,children:[(0,P.jsx)(`span`,{className:`font-mono text-[12px] text-neutral-800`,children:e.name}),e.hint_object_name&&(0,P.jsxs)(`span`,{className:`font-mono text-[10px] text-neutral-400`,children:[`for: `,e.hint_object_name]}),c&&(0,P.jsx)(Ze,{result:c}),(0,P.jsx)(A,{visible:d})]})},$e=({actions:e,pluginApiName:t,configArgs:n})=>{let{apiKey:r}=se(),{selectedObject:i,setSelectedObject:a,objectSearch:o,setObjectSearch:s,objectsQuery:c,objectOptions:l,selectedEntity:u,setSelectedEntity:d,entitySearch:f,setEntitySearch:p,entitiesQuery:m,entityOptions:h}=Ke(t),{selectedObject:g,setSelectedObject:_,objectSearch:v,setObjectSearch:y,objectsQuery:b,objectOptions:x,selectedEntity:S,setSelectedEntity:C,entitySearch:w,setEntitySearch:T,entitiesQuery:E,entityOptions:D}=Ke(t,`action`);if(!r)return(0,P.jsx)(`p`,{className:`mt-1 text-[12px] text-neutral-400`,children:`Configure API credentials in Dev Tools to use JS action templates.`});let O=i!==null&&u!==null,k=g!==null&&S!==null;return(0,P.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,P.jsxs)(`div`,{className:`flex gap-3`,children:[(0,P.jsx)(`div`,{className:`flex-1`,children:(0,P.jsx)(j,{label:`Custom Object`,value:o,onChange:e=>{s(e),i&&(a(null),d(null),p(``))},onSelect:(e,t)=>{a({id:e,name:t}),s(t),d(null),p(``)},options:l,loading:c.isFetching,placeholder:`Search custom objects…`})}),(0,P.jsx)(`div`,{className:`flex-1`,children:(0,P.jsx)(j,{label:`Record`,value:f,onChange:e=>{p(e),u&&d(null)},onSelect:(e,t)=>{d({id:e,label:t}),p(t)},options:h,loading:m.isFetching,placeholder:`Search records…`,disabled:i===null})})]}),(0,P.jsxs)(`div`,{className:`flex gap-3`,children:[(0,P.jsx)(`div`,{className:`flex-1`,children:(0,P.jsx)(j,{label:`Related Object (optional)`,value:v,onChange:e=>{y(e),g&&(_(null),C(null),T(``))},onSelect:(e,t)=>{_({id:e,name:t}),y(t),C(null),T(``)},options:x,loading:b.isFetching,placeholder:`Search custom objects…`})}),(0,P.jsx)(`div`,{className:`flex-1`,children:(0,P.jsx)(j,{label:`Action Record (optional)`,value:w,onChange:e=>{T(e),S&&C(null)},onSelect:(e,t)=>{C({id:e,label:t}),T(t)},options:D,loading:E.isFetching,placeholder:`Search records…`,disabled:g===null})})]}),(0,P.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.map(e=>(0,P.jsx)(Qe,{action:e,objectId:i?.id??``,entityId:u?.id??``,actionObjectId:g?.id,actionEntityId:S?.id,pluginApiName:t,configArgs:n,disabled:!O},e.api_name))},O?`${i.id}-${u.id}-${k?`${g.id}-${S.id}`:`-`}`:`no-selection`)]})},et=({adornment:e,objectId:t,entityId:n,pluginApiName:r,fieldValue:i,configArgs:a,disabled:o,whenState:s})=>{let[c,l]=(0,N.useState)(null),[u,{pending:d}]=ie({objectId:t,entityId:n,onError:t=>{console.error(`[data-adornment] ${e.field_type}:`,t),l({kind:`error`,message:Je(t)})}}),f={id:e.config.tooltip||e.field_type,api_name:e.field_type,plugin_api_name:r};return(0,P.jsxs)(`button`,{onClick:()=>{let r={value:i,fieldId:``,fieldType:e.field_type,objectId:t,entityId:n,...a};l(null),u(e.script,r,f).then(e=>{l({kind:`value`,value:e})})},disabled:o===!0||d,className:`relative flex flex-col items-start rounded border border-black/8 bg-white px-3 py-1.5 text-left transition-colors hover:bg-black/5 disabled:opacity-50`,children:[(0,P.jsxs)(`span`,{className:`flex items-center gap-1.5 font-mono text-[12px] text-neutral-800`,children:[e.config.color&&(0,P.jsx)(`span`,{className:`h-3 w-4 shrink-0 rounded-sm border border-black/10`,style:{backgroundColor:e.config.color}}),e.config.icon&&(0,P.jsx)(Oe,{name:e.config.icon,className:`text-[10px]`}),e.config.tooltip||e.field_type]}),(0,P.jsx)(`span`,{className:`font-mono text-[10px] text-neutral-400`,children:e.field_type}),e.when&&s&&(0,P.jsx)(Pe,{when:e.when,whenState:s}),c&&(0,P.jsx)(Ze,{result:c}),(0,P.jsx)(A,{visible:d})]})},tt=({adornments:e,pluginApiName:t,configArgs:n,whenState:r})=>{let{apiKey:i}=se(),{selectedObject:a,setSelectedObject:o,objectSearch:s,setObjectSearch:c,objectsQuery:l,objectOptions:u,selectedEntity:d,setSelectedEntity:f,entitySearch:p,setEntitySearch:m,entitiesQuery:h,entityOptions:g}=Ke(t),[_,v]=(0,N.useState)({});if(!i)return(0,P.jsx)(`p`,{className:`mt-1 text-[12px] text-neutral-400`,children:`Configure API credentials in Dev Tools to use data adornments.`});let y=a!==null&&d!==null,b=e.reduce((e,t)=>{let n=t.field_type;return e[n]??=[],e[n].push(t),e},{});return(0,P.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,P.jsxs)(`div`,{className:`flex gap-3`,children:[(0,P.jsx)(`div`,{className:`flex-1`,children:(0,P.jsx)(j,{label:`Custom Object`,value:s,onChange:e=>{c(e),a&&(o(null),f(null),m(``))},onSelect:(e,t)=>{o({id:e,name:t}),c(t),f(null),m(``)},options:u,loading:l.isFetching,placeholder:`Search custom objects…`})}),(0,P.jsx)(`div`,{className:`flex-1`,children:(0,P.jsx)(j,{label:`Record`,value:p,onChange:e=>{m(e),d&&f(null)},onSelect:(e,t)=>{f({id:e,label:t}),m(t)},options:g,loading:h.isFetching,placeholder:`Search records…`,disabled:a===null})})]}),(0,P.jsx)(`div`,{className:`flex flex-col gap-3`,children:Object.entries(b).map(([e,i])=>(0,P.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,P.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,P.jsx)(`label`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-500`,children:e}),(0,P.jsx)(`input`,{type:`text`,className:`w-full rounded border border-black/10 bg-white px-2.5 py-1.5 font-mono text-[12px] text-neutral-800 focus:border-neutral-400 focus:outline-none`,placeholder:`${e} value…`,value:_[e]??``,onChange:t=>{v(n=>({...n,[e]:t.target.value}))}})]}),(0,P.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:i.map((i,o)=>(0,P.jsx)(et,{adornment:i,objectId:a?.id??``,entityId:d?.id??``,pluginApiName:t,fieldValue:_[e]??``,configArgs:n,disabled:!y,...r?{whenState:r}:{}},o))})]},e))},y?`${a.id}-${d.id}`:`no-selection`)]})},nt=`kizen-app-context`,rt=`session_data_key`,it=200,at=new Set,F=[];function ot(){for(let e of at)e()}function st(e){return at.add(e),()=>{at.delete(e)}}function ct(){return F}function lt(){F=[],ot()}function ut(e){F=[...F.length>=it?F.slice(F.length-it+1):F,e],ot()}function dt(e,t){for(let n=F.length-1;n>=0;--n){let r=F[n];if(r?.sessionDataKey===e){let e=F.slice();e[n]={...r,status:t},F=e,ot();return}}}function ft(e){try{let t=new URL(e,window.location.origin).searchParams.get(rt);return t?.startsWith(`${nt}-`)?t:void 0}catch{return}}function pt(e){return new TextEncoder().encode(JSON.stringify(e)).length}function mt(e){return/^https?:\/\//i.test(e)}function ht(e){return e===void 0?{}:{payload:e,byteSize:pt(e)}}function gt(e){let t=ft(e);t&&ut({id:crypto.randomUUID(),timestamp:Date.now(),url:e,target:`_self`,sessionDataKey:t,status:`delivered`,...ht(de(e))})}function _t(e,t){let n=ft(e);if(n){let r=sessionStorage.getItem(n),i=de(e);r!==null&&queueMicrotask(()=>{try{sessionStorage.setItem(n,r)}catch{}}),ut({id:crypto.randomUUID(),timestamp:Date.now(),url:e,target:t,sessionDataKey:n,status:`delivered`,...ht(i)});return}mt(e)&&ut({id:crypto.randomUUID(),timestamp:Date.now(),url:e,target:t,status:`ignoredExternal`})}var vt=({url:e,sessionDataKey:t})=>{let[n,r]=(0,N.useState)(()=>de(e)),[i,a]=(0,N.useState)(!1),o=(0,N.useCallback)(()=>{r(de(e))},[e]),s=(0,N.useCallback)(()=>{pe(e),dt(t,`consumed`),r(void 0),a(!0)},[e,t]),c=(0,N.useCallback)(()=>{le(e),dt(t,`cleared`),r(void 0),a(!0)},[e,t]);return(0,P.jsxs)(`div`,{className:`flex flex-col gap-3 p-6 font-mono text-[11px]`,children:[(0,P.jsx)(`div`,{className:`text-neutral-400`,children:e}),(0,P.jsx)(`div`,{className:`text-[13px] font-medium text-neutral-700`,children:`Simulated Kizen destination page`}),(0,P.jsx)(`div`,{className:`text-neutral-400`,children:`Not a routable page in this plugin — this stands in for the Kizen page the plugin navigated to, so you can inspect the navigation context it received.`}),n?(0,P.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2 text-neutral-500`,children:[(0,P.jsx)(`span`,{className:`rounded bg-neutral-100 px-1.5 py-0.5 uppercase tracking-widest text-[9px] text-neutral-500`,children:`context`}),(0,P.jsxs)(`span`,{children:[pt(n),` bytes`]})]}),(0,P.jsx)(`pre`,{className:`overflow-auto rounded border border-black/10 bg-neutral-50 p-2 text-[11px] leading-5 text-neutral-700`,children:JSON.stringify(n,null,2)})]}):(0,P.jsx)(`div`,{className:`rounded border border-black/8 bg-neutral-50 px-2 py-1.5 text-neutral-500`,children:i?`context cleared — a re-visit or back-nav would see no context`:`no context found for this key`}),(0,P.jsxs)(`div`,{className:`flex gap-2`,children:[(0,P.jsx)(`button`,{onClick:s,disabled:!n,className:`rounded border border-black/10 bg-white px-2 py-1 text-neutral-700 transition-colors hover:bg-black/5 disabled:opacity-40`,children:`Consume`}),(0,P.jsx)(`button`,{onClick:c,disabled:!n,className:`rounded border border-black/10 bg-white px-2 py-1 text-neutral-700 transition-colors hover:bg-black/5 disabled:opacity-40`,children:`Clear`}),(0,P.jsx)(`button`,{onClick:o,className:`rounded border border-black/10 bg-white px-2 py-1 text-neutral-700 transition-colors hover:bg-black/5`,children:`Re-read`})]})]})},yt={delivered:`bg-green-100 text-green-700`,consumed:`bg-blue-100 text-blue-700`,cleared:`bg-neutral-200 text-neutral-600`,ignoredExternal:`bg-amber-100 text-amber-700`},bt={delivered:`delivered`,consumed:`consumed`,cleared:`cleared`,ignoredExternal:`ignored (external)`};function xt(e){return new Date(e).toTimeString().slice(0,8)}var St=({event:e})=>{let[t,n]=(0,N.useState)(!1),r=e.payload!==void 0;return(0,P.jsxs)(`div`,{className:`border-b border-black/5 py-2 last:border-b-0`,children:[(0,P.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,P.jsx)(`span`,{className:`text-neutral-400`,children:xt(e.timestamp)}),(0,P.jsx)(`span`,{className:`rounded bg-neutral-100 px-1.5 py-0.5 uppercase tracking-widest text-[9px] text-neutral-500`,children:e.target}),(0,P.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-neutral-700`,children:e.url}),(0,P.jsx)(`span`,{className:`rounded px-1.5 py-0.5 uppercase tracking-widest text-[9px] ${yt[e.status]}`,children:bt[e.status]})]}),(0,P.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-3 text-[10px] text-neutral-400`,children:[(0,P.jsxs)(`span`,{children:[`context: `,r?`yes`:`no`]}),e.sessionDataKey!==void 0&&(0,P.jsxs)(`span`,{className:`font-mono`,children:[`key: `,e.sessionDataKey]}),e.byteSize!==void 0&&(0,P.jsxs)(`span`,{children:[e.byteSize,` bytes`]}),r&&(0,P.jsx)(`button`,{onClick:()=>{n(e=>!e)},className:`text-neutral-500 underline decoration-dotted hover:text-neutral-700`,children:t?`hide payload`:`show payload`})]}),t&&r&&(0,P.jsx)(`pre`,{className:`mt-1.5 overflow-auto rounded border border-black/10 bg-neutral-50 p-2 text-[11px] leading-5 text-neutral-700`,children:JSON.stringify(e.payload,null,2)})]})},Ct=()=>{let e=(0,N.useSyncExternalStore)(st,ct);return e.length===0?(0,P.jsxs)(`p`,{className:`m-0 text-[12px] text-neutral-400`,children:[`No navigations captured yet. Call`,` `,(0,P.jsxs)(`code`,{className:`rounded bg-neutral-100 px-1 font-mono text-[11px]`,children:[`this.openWindow('/some/path', '_self', `,`{`,` … `,`}`,`)`]}),` `,`from any script to send a navigation context and see it here.`]}):(0,P.jsxs)(`div`,{className:`flex flex-col gap-1 font-mono text-[11px]`,children:[(0,P.jsx)(`div`,{className:`flex justify-end`,children:(0,P.jsx)(`button`,{onClick:lt,className:`text-[11px] text-neutral-400 hover:text-neutral-700`,children:`clear log`})}),e.slice().reverse().map(e=>(0,P.jsx)(St,{event:e},e.id))]})},wt=({page:e,isActive:t})=>(0,P.jsx)(E,{page:e,style:{display:t?`block`:`none`},className:`h-full w-full`,contentClassName:`p-3`,iframeAllow:w}),Tt=`integration:route-change`;function Et(e,t){return e.find(e=>e.api_name===t||t.endsWith(`${e.plugin_api_name}/${e.api_name}`))}function Dt(e){let t=e.search(/[?#]/);return t===-1?e:e.slice(0,t)}function Ot(e){let t=e.indexOf(`#`),n=t===-1?``:e.slice(t),r=t===-1?e:e.slice(0,t),i=r.indexOf(`?`),a=i===-1?``:r.slice(i);return{pathname:`/${i===-1?r:r.slice(0,i)}`,search:a,hash:n}}var kt=({tab:e})=>{if(/^https?:\/\//i.test(e.url))return(0,P.jsx)(`iframe`,{src:e.url,className:`h-full w-full border-0`,title:e.title,allow:w});let t=ft(e.url);return t?(0,P.jsx)(vt,{url:e.url,sessionDataKey:t}):(0,P.jsxs)(`div`,{className:`flex flex-col gap-2 p-6 font-mono text-[11px]`,children:[(0,P.jsx)(`div`,{className:`text-neutral-400`,children:e.url}),(0,P.jsx)(`div`,{className:`mt-1 text-[13px] font-medium text-neutral-500`,children:`Page not found`}),(0,P.jsxs)(`div`,{className:`text-neutral-400`,children:[`No routable page with path`,` `,(0,P.jsx)(`code`,{className:`rounded bg-neutral-100 px-1`,children:Dt(e.url)}),` is defined in this plugin.`]})]})};function At(e){try{let t=new URL(e);return t.hostname===``?t.pathname.split(`/`).filter(Boolean).pop()??e:t.hostname}catch{let t=Dt(e);return t.split(`/`).filter(Boolean).pop()??t}}var jt=(0,N.forwardRef)(({pages:e},t)=>{let[n,r]=(0,N.useState)(`home`),[i,a]=(0,N.useState)({entries:[``],index:0}),[o,s]=(0,N.useState)([]),[c,l]=(0,N.useState)({}),u=(0,N.useRef)(0),d=(0,N.useRef)(null),[f,p]=(0,N.useState)(!1),[m,h]=(0,N.useState)(!1),g=(0,N.useCallback)(()=>{let e=d.current;e&&(p(e.scrollLeft>0),h(e.scrollLeft+e.clientWidth<e.scrollWidth-1))},[]);(0,N.useEffect)(()=>{let e=d.current;if(!e)return;g(),e.addEventListener(`scroll`,g);let t=new ResizeObserver(g);return t.observe(e),()=>{e.removeEventListener(`scroll`,g),t.disconnect()}},[g]);let _=i.entries[i.index]??``,v=n===`home`?_:n,y=(0,N.useRef)(!0);(0,N.useEffect)(()=>{if(y.current){y.current=!1;return}let{pathname:e,search:t,hash:n}=Ot(v);window.dispatchEvent(new CustomEvent(Tt,{detail:{location:{host:window.location.host,origin:window.location.origin,port:window.location.port,protocol:window.location.protocol,pathname:e,search:t,hash:n,href:`${window.location.origin}${e}${t}${n}`}}}))},[v]);let b=n===`home`&&i.index>0,x=n===`home`&&i.index<i.entries.length-1,S=(0,N.useCallback)((t,n)=>{let i=t.replace(/^\/+/,``),o=Et(e,Dt(i));o?(r(o.api_name),l(e=>({...e,[o.api_name]:(e[o.api_name]??0)+1}))):(r(`home`),a(e=>{if(!n?.replace&&e.entries[e.index]===i)return e;if(n?.replace){let t=[...e.entries];return t[e.index]=i,{entries:t,index:e.index}}let t=[...e.entries.slice(0,e.index+1),i];return{entries:t,index:t.length-1}}))},[e]),C=(0,N.useCallback)(t=>{let n=Et(e,Dt(t.replace(/^\/+/,``)));if(n){r(n.api_name),l(e=>({...e,[n.api_name]:(e[n.api_name]??0)+1}));return}u.current+=1;let i=`__tab_${String(u.current)}`;s(e=>[...e,{id:i,url:t,title:At(t)}]),r(i)},[e]),w=(0,N.useCallback)(e=>{s(t=>t.filter(t=>t.id!==e)),n===e&&r(`home`)},[n]);(0,N.useImperativeHandle)(t,()=>({navigate:S,openNewTab:C}),[S,C]);let T=o.find(e=>e.id===n)??null,E=ft(_),[D,O]=(0,N.useState)(!1),k=(0,N.useSyncExternalStore)(st,()=>ct().length);return(0,P.jsxs)(`div`,{className:`mt-1.5 overflow-hidden rounded border border-black/10 bg-white`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-black/8 bg-neutral-50 px-3 py-1.5`,children:[(0,P.jsxs)(`div`,{className:`flex shrink-0 gap-1`,children:[(0,P.jsx)(`div`,{className:`h-3 w-3 rounded-full bg-red-400/60`}),(0,P.jsx)(`div`,{className:`h-3 w-3 rounded-full bg-yellow-400/60`}),(0,P.jsx)(`div`,{className:`h-3 w-3 rounded-full bg-green-400/60`})]}),(0,P.jsx)(`button`,{onClick:()=>{a(e=>({...e,index:e.index-1}))},disabled:!b,className:`px-0.5 font-mono text-[15px] leading-none transition-colors ${b?`text-neutral-600 hover:text-neutral-900`:`cursor-default text-neutral-300`}`,children:`‹`}),(0,P.jsx)(`button`,{onClick:()=>{a(e=>({...e,index:e.index+1}))},disabled:!x,className:`px-0.5 font-mono text-[15px] leading-none transition-colors ${x?`text-neutral-600 hover:text-neutral-900`:`cursor-default text-neutral-300`}`,children:`›`}),(0,P.jsx)(`div`,{className:`min-w-0 flex-1 truncate rounded border border-black/8 bg-white px-2 py-0.5 font-mono text-[11px] text-neutral-400`,children:T?T.url:`app://sandbox/${v}`}),(0,P.jsxs)(`button`,{onClick:()=>{O(e=>!e)},title:`Navigation context log`,className:`flex shrink-0 items-center gap-1 rounded border border-black/8 px-1.5 py-0.5 font-mono text-[10px] transition-colors ${D?`bg-neutral-200 text-neutral-700`:`bg-white text-neutral-400 hover:text-neutral-700`}`,children:[`context`,k>0&&(0,P.jsx)(`span`,{className:`rounded bg-neutral-500 px-1 text-[9px] leading-4 text-white`,children:k})]})]}),(0,P.jsxs)(`div`,{className:`relative border-b border-black/8 bg-neutral-50`,children:[f&&(0,P.jsx)(`div`,{className:`pointer-events-none absolute inset-y-0 left-0 z-10 flex items-center pl-1 pr-6 bg-gradient-to-r from-neutral-50 to-transparent`,children:(0,P.jsx)(`span`,{className:`font-mono text-[13px] leading-none text-neutral-400`,children:`‹`})}),m&&(0,P.jsx)(`div`,{className:`pointer-events-none absolute inset-y-0 right-0 z-10 flex items-center pl-6 pr-1 bg-gradient-to-l from-neutral-50 to-transparent`,children:(0,P.jsx)(`span`,{className:`font-mono text-[13px] leading-none text-neutral-400`,children:`›`})}),(0,P.jsx)(`div`,{ref:d,className:`overflow-x-auto`,children:(0,P.jsxs)(`div`,{className:`flex min-w-max`,children:[(0,P.jsx)(`button`,{onClick:()=>{r(`home`)},className:`border-r border-black/8 px-3 py-1.5 font-mono text-[11px] transition-colors ${n===`home`?`bg-white font-medium text-neutral-900`:`text-neutral-500 hover:bg-black/5`}`,children:`home`}),e.map(e=>(0,P.jsxs)(`button`,{onClick:()=>{r(e.api_name)},className:`border-r border-black/8 px-3 py-1.5 font-mono text-[11px] transition-colors ${n===e.api_name?`bg-white font-medium text-neutral-900`:`text-neutral-500 hover:bg-black/5`}`,children:[e.toolbar_icon&&(0,P.jsx)(Oe,{name:e.toolbar_icon,className:`mr-1 text-[9px]`}),e.name]},e.api_name)),o.map(e=>(0,P.jsxs)(`div`,{className:`flex items-center border-r border-black/8 ${n===e.id?`bg-white`:`hover:bg-black/5`}`,children:[(0,P.jsx)(`button`,{onClick:()=>{r(e.id)},className:`py-1.5 pl-3 pr-1 font-mono text-[11px] transition-colors ${n===e.id?`font-medium text-neutral-900`:`text-neutral-500`}`,children:e.title}),(0,P.jsx)(`button`,{onClick:()=>{w(e.id)},className:`px-1.5 py-1.5 font-mono text-[11px] text-neutral-300 transition-colors hover:text-neutral-600`,children:`×`})]},e.id))]})})]}),(0,P.jsxs)(`div`,{className:`relative h-[500px] overflow-hidden`,children:[n===`home`&&_===``&&(0,P.jsxs)(`div`,{className:`flex flex-col gap-2 p-6 font-mono text-[11px]`,children:[(0,P.jsx)(`div`,{className:`text-neutral-400`,children:`app://sandbox/`}),(0,P.jsx)(`div`,{className:`mt-1 text-[13px] font-medium text-neutral-700`,children:`App Homepage`}),(0,P.jsx)(`div`,{className:`text-neutral-400`,children:e.length>0?`This is the index page of your app. Navigate to a routable page using the tabs above.`:`This app has no routable pages defined. Add a routable_page artifact to your plugin to see it here.`})]}),n===`home`&&_!==``&&(E?(0,P.jsx)(vt,{url:_,sessionDataKey:E},_):(0,P.jsxs)(`div`,{className:`flex flex-col gap-2 p-6 font-mono text-[11px]`,children:[(0,P.jsxs)(`div`,{className:`text-neutral-400`,children:[`app://sandbox/`,Dt(_)]}),(0,P.jsx)(`div`,{className:`mt-1 text-[13px] font-medium text-neutral-500`,children:`Page not found`}),(0,P.jsxs)(`div`,{className:`text-neutral-400`,children:[`No routable page with api_name`,` `,(0,P.jsx)(`code`,{className:`rounded bg-neutral-100 px-1`,children:Dt(_)}),` `,`is defined in this plugin.`]})]})),e.map(e=>(0,P.jsx)(wt,{page:e,isActive:n===e.api_name},`${e.api_name}-${String(c[e.api_name]??0)}`)),o.map(e=>(0,P.jsx)(`div`,{style:{display:n===e.id?`block`:`none`},className:`h-full w-full`,children:(0,P.jsx)(kt,{tab:e})},e.id)),(0,P.jsxs)(`div`,{className:`absolute inset-y-0 right-0 z-10 flex w-80 max-w-full flex-col border-l border-black/10 bg-white shadow-lg transition-transform duration-200 ${D?`translate-x-0`:`translate-x-full`}`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between border-b border-black/8 bg-neutral-50 px-3 py-1.5`,children:[(0,P.jsx)(`span`,{className:`text-[10px] font-semibold uppercase tracking-widest text-neutral-600`,children:`Navigation Context`}),(0,P.jsx)(`button`,{onClick:()=>{O(!1)},className:`px-1 font-mono text-[13px] leading-none text-neutral-300 transition-colors hover:text-neutral-600`,children:`×`})]}),(0,P.jsx)(`div`,{className:`flex-1 overflow-y-auto p-3`,children:(0,P.jsx)(Ct,{})})]})]})]})});jt.displayName=`RoutablePageBrowser`;var Mt=({item:e,whenState:t})=>{let n={...e,name:e.label,type:`script`},[r,i]=(0,N.useState)(null),[a,{pending:o}]=S({onError:t=>{console.error(`[toolbar] ${e.api_name}:`,t),i({kind:`error`,message:Je(t)})},plugin:n}),s=e.when;return(0,P.jsxs)(`button`,{onClick:()=>{i(null),a(e.script,e.args).then(e=>{i({kind:`value`,value:e})})},disabled:o,className:`relative flex flex-col items-start rounded border border-black/8 bg-white px-3 py-1.5 font-mono text-[12px] text-neutral-800 transition-colors hover:bg-black/5 disabled:opacity-50`,children:[(0,P.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[e.color&&(0,P.jsx)(`span`,{className:`h-3 w-4 shrink-0 rounded-sm border border-black/10`,style:{backgroundColor:e.color}}),e.icon&&(0,P.jsx)(Oe,{name:e.icon,className:`text-[10px]`}),(0,P.jsx)(`span`,{children:e.label})]}),s&&t&&(0,P.jsx)(Pe,{when:s,whenState:t}),r&&(0,P.jsx)(Ze,{result:r}),(0,P.jsx)(A,{visible:o})]})},Nt=({item:e,objectId:t,pluginApiName:n,configArgs:r,disabled:i,whenState:a})=>{let[o,{pending:s}]=ie({objectId:t,entityId:``,onError:t=>{console.error(`[object-settings] ${e.api_name}:`,t)}}),c={id:e.api_name,api_name:e.api_name,plugin_api_name:n};return(0,P.jsxs)(`button`,{onClick:()=>{o(e.script,r,c)},disabled:i===!0||s,className:`relative flex flex-col items-start rounded border border-black/8 bg-white px-3 py-1.5 text-left transition-colors hover:bg-black/5 disabled:opacity-50`,children:[(0,P.jsx)(`span`,{className:`font-mono text-[12px] text-neutral-800`,children:e.label}),e.when&&a&&(0,P.jsx)(Pe,{when:e.when,whenState:a}),(0,P.jsx)(A,{visible:s})]})},Pt=({items:e,pluginApiName:t,configArgs:n,whenState:r})=>{let{apiKey:i}=se(),{selectedObject:a,setSelectedObject:o,objectSearch:s,setObjectSearch:c,objectsQuery:l,objectOptions:u}=Ue(we(t));return i?(0,P.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,P.jsx)(`div`,{className:`w-64`,children:(0,P.jsx)(j,{label:`Custom Object`,value:s,onChange:e=>{c(e),a&&o(null)},onSelect:(e,t)=>{o({id:e,name:t}),c(t)},options:u,loading:l.isFetching,placeholder:`Search custom objects…`})}),(0,P.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.map(e=>(0,P.jsx)(Nt,{item:e,objectId:a?.id??``,pluginApiName:t,configArgs:n,disabled:a===null,...r?{whenState:r}:{}},e.api_name))},a?.id??`no-selection`)]}):(0,P.jsx)(`p`,{className:`mt-1 text-[12px] text-neutral-400`,children:`Configure API credentials in Dev Tools to use object settings menu items.`})},Ft=`h-8 rounded border border-black/10 bg-white px-2.5 font-mono text-[12px] text-neutral-800 focus:border-neutral-400 focus:outline-none w-full`,It=`block text-[11px] font-semibold uppercase tracking-widest text-neutral-600 mb-1`,Lt=e=>e===`GET`?`bg-green-50 text-green-700`:e===`DELETE`?`bg-red-50 text-red-700`:e===`POST`?`bg-blue-50 text-blue-700`:`bg-amber-50 text-amber-700`;function Rt(e,t){try{let n=localStorage.getItem(Ee(e,t));return n?JSON.parse(n):[]}catch{return[]}}function zt(e,t,n,r){let i=n.path===``||n.path.startsWith(`/`)?n.path:`/${n.path}`,a=`${n.method}:${i}`,o=r.filter(e=>`${e.method}:${e.path}`!==a),s=[{...n,path:i,id:String(Date.now())},...o].slice(0,10);try{localStorage.setItem(Ee(e,t),JSON.stringify(s))}catch{}return s}var Bt=({response:e})=>{let{status:t,elapsedMs:n,contentType:r,body:i}=e,a=t===0?`bg-neutral-100 text-neutral-500`:t<300?`bg-green-50 text-green-700`:t<400?`bg-yellow-50 text-yellow-700`:`bg-red-50 text-red-700`,o=i;if(r.includes(`application/json`))try{o=JSON.stringify(JSON.parse(i),null,2)}catch{}return(0,P.jsxs)(`div`,{className:`mt-3 flex flex-col gap-2`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsx)(`span`,{className:`rounded px-2 py-0.5 text-[11px] font-semibold ${a}`,children:t===0?`Error`:t}),n>0&&(0,P.jsxs)(`span`,{className:`rounded bg-neutral-100 px-2 py-0.5 text-[11px] text-neutral-500`,children:[n,`ms`]})]}),(0,P.jsx)(`pre`,{className:`max-h-72 overflow-auto rounded border border-black/5 bg-neutral-50 p-3 font-mono text-[11px] leading-relaxed text-neutral-700 whitespace-pre-wrap break-all`,children:o||`(empty response)`})]})},Vt=({headers:e,onChange:t})=>{let r=()=>{t([...e,{id:String(Date.now()),key:``,value:``}])},i=n=>{t(e.filter(e=>e.id!==n))},a=(n,r,i)=>{t(e.map(e=>e.id===n?{...e,[r]:i}:e))};return(0,P.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,P.jsx)(`label`,{className:It,children:`Custom Headers`}),e.length>0&&(0,P.jsx)(`div`,{className:`grid grid-cols-[1fr_1fr_auto] gap-1 mb-1`,children:e.map(e=>(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`input`,{className:Ft,placeholder:`Header name`,value:e.key,onChange:t=>{a(e.id,`key`,t.target.value)}},`${e.id}-key`),(0,P.jsx)(`input`,{className:Ft,placeholder:`Value`,value:e.value,onChange:t=>{a(e.id,`value`,t.target.value)}},`${e.id}-val`),(0,P.jsx)(`button`,{type:`button`,className:`px-1.5 text-neutral-400 hover:text-red-500`,onClick:()=>{i(e.id)},children:(0,P.jsx)(s,{icon:o,className:`text-[11px]`})},`${e.id}-rm`)]}))}),(0,P.jsxs)(`button`,{type:`button`,className:`flex items-center gap-1 text-[11px] text-neutral-400 hover:text-neutral-700 self-start`,onClick:r,children:[(0,P.jsx)(s,{icon:n,className:`text-[10px]`}),`Add header`]})]})},Ht=({service:e,pluginApiName:n})=>{let r=ue(),{environment:i}=se(),a=fe[i],[o,l]=(0,N.useState)(`GET`),[u,f]=(0,N.useState)(``),[p,m]=(0,N.useState)([]),[h,g]=(0,N.useState)(``),[_,v]=(0,N.useState)(!1),[y,x]=(0,N.useState)(null),[S,C]=(0,N.useState)(()=>Rt(n,e.service_name)),[w,T]=(0,N.useState)(!1),E=(0,N.useRef)(null);(0,N.useEffect)(()=>{if(!w)return;let e=e=>{E.current&&!E.current.contains(e.target)&&T(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[w]);let D=[`POST`,`PUT`,`PATCH`].includes(o),O=u===``||u.startsWith(`/`)?u:`/${u}`,k=`/external-integrations/proxy/${n}/${e.service_name}${O||`/`}`,A=`${a}${k}`,j=e=>{l(e.method),f(e.path),m(e.headers),g(e.body),T(!1)},ee=()=>{localStorage.removeItem(Ee(n,e.service_name)),C([]),T(!1)},te=async()=>{if(!_){C(zt(n,e.service_name,{method:o,path:u,headers:p,body:h},S)),v(!0),x(null);try{let e=Object.fromEntries(p.filter(e=>e.key.trim()).map(e=>[e.key.trim(),e.value])),t=performance.now(),n=await r(k,{method:o,headers:{...D&&h.trim()?{"Content-Type":`application/json`}:{},...e},...D&&h.trim()?{body:h}:{}}),i=Math.round(performance.now()-t),a=n.headers.get(`content-type`)??``,s=await n.text();x({status:n.status,elapsedMs:i,contentType:a,body:s})}catch(e){x({status:0,elapsedMs:0,contentType:``,body:String(e)})}finally{v(!1)}}};return(0,P.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,P.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,P.jsxs)(`div`,{className:`flex flex-col gap-1 shrink-0`,children:[(0,P.jsx)(`label`,{className:It,children:`Method`}),(0,P.jsx)(`select`,{className:`h-8 w-28 rounded border border-black/10 bg-white px-2 font-mono text-[12px] text-neutral-800 focus:border-neutral-400 focus:outline-none`,value:o,onChange:e=>{l(e.target.value)},children:[`GET`,`POST`,`PUT`,`PATCH`,`DELETE`].map(e=>(0,P.jsx)(`option`,{value:e,children:e},e))})]}),(0,P.jsxs)(`div`,{className:`relative flex flex-col gap-1 flex-1 min-w-0`,ref:E,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,P.jsx)(`label`,{className:It,children:`Path`}),S.length>0&&(0,P.jsxs)(`button`,{type:`button`,className:`flex items-center gap-1 text-[11px] text-neutral-400 hover:text-neutral-700`,onClick:()=>{T(e=>!e)},title:`Request history`,children:[(0,P.jsx)(s,{icon:d,className:`text-[10px]`}),(0,P.jsx)(`span`,{children:S.length})]})]}),(0,P.jsx)(`input`,{className:Ft,placeholder:`/path/to/endpoint`,value:u,onChange:e=>{f(e.target.value)},onKeyDown:e=>{e.key===`Enter`&&te()}}),(0,P.jsx)(`span`,{className:`font-mono text-[10px] text-neutral-400 truncate`,children:A}),(0,P.jsxs)(b,{anchorRef:E,open:w&&S.length>0,children:[S.map(e=>(0,P.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-2 px-3 py-1.5 text-left hover:bg-neutral-50`,onClick:()=>{j(e)},children:[(0,P.jsx)(`span`,{className:`shrink-0 rounded px-1.5 py-0.5 font-mono text-[10px] font-semibold ${Lt(e.method)}`,children:e.method}),(0,P.jsx)(`span`,{className:`flex-1 truncate font-mono text-[11px] text-neutral-700`,children:e.path||`/`}),e.headers.filter(e=>e.key.trim()).length>0&&(0,P.jsxs)(`span`,{className:`shrink-0 text-[10px] text-neutral-400`,children:[e.headers.filter(e=>e.key.trim()).length,`h`]}),e.body.trim()&&(0,P.jsx)(`span`,{className:`shrink-0 text-[10px] text-neutral-400`,children:`body`})]},e.id)),(0,P.jsx)(`div`,{className:`border-t border-black/5 px-3 py-1.5 text-right`,children:(0,P.jsx)(`button`,{type:`button`,className:`text-[11px] text-neutral-400 hover:text-neutral-700`,onClick:ee,children:`clear history`})})]})]}),(0,P.jsxs)(`div`,{className:`flex flex-col gap-1 shrink-0`,children:[(0,P.jsx)(`span`,{className:`invisible ${It}`,children:`\xA0`}),(0,P.jsxs)(`button`,{type:`button`,disabled:_,className:`h-8 flex items-center gap-1.5 rounded bg-neutral-800 px-3 text-[12px] font-medium text-white hover:bg-neutral-700 disabled:opacity-50`,onClick:()=>{te()},children:[_?(0,P.jsx)(s,{icon:t,className:`animate-spin text-[11px]`}):(0,P.jsx)(s,{icon:c,className:`text-[11px]`}),`Send`]})]})]}),(0,P.jsx)(Vt,{headers:p,onChange:m}),D&&(0,P.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,P.jsx)(`label`,{className:It,children:`Request Body`}),(0,P.jsx)(`textarea`,{className:`rounded border border-black/10 bg-white px-2.5 py-1.5 font-mono text-[12px] text-neutral-800 focus:border-neutral-400 focus:outline-none w-full resize-y`,rows:5,placeholder:`{"key": "value"}`,value:h,onChange:e=>{g(e.target.value)}})]}),y!==null&&(0,P.jsx)(Bt,{response:y})]})},Ut=e=>e===`oauth`?`rounded bg-blue-50 px-1.5 py-0.5 text-[11px] font-mono text-blue-700`:e===`no_auth`?`rounded bg-neutral-100 px-1.5 py-0.5 text-[11px] font-mono text-neutral-500`:`rounded bg-amber-50 px-1.5 py-0.5 text-[11px] font-mono text-amber-700`,Wt=({label:e,children:t})=>(0,P.jsxs)(`div`,{className:`flex items-baseline gap-2 text-[12px]`,children:[(0,P.jsx)(`span`,{className:`w-28 shrink-0 text-[11px] font-semibold uppercase tracking-widest text-neutral-600`,children:e}),t]}),Gt=({service:e})=>(0,P.jsxs)(`div`,{className:`flex flex-col gap-1.5 pb-4 mb-4 border-b border-black/5`,children:[(0,P.jsxs)(Wt,{label:`Name`,children:[(0,P.jsx)(`span`,{className:`text-neutral-800 font-medium`,children:e.display_name}),(0,P.jsx)(`span`,{className:`rounded bg-neutral-100 px-1.5 py-0.5 font-mono text-[11px] text-neutral-500`,children:e.service_name})]}),(0,P.jsxs)(Wt,{label:`Auth`,children:[(0,P.jsx)(`span`,{className:Ut(e.auth_type),children:e.auth_type}),e.auth_level&&(0,P.jsx)(`span`,{className:`text-[11px] text-neutral-400`,children:e.auth_level})]}),(0,P.jsx)(Wt,{label:`Base URL`,children:(0,P.jsx)(`span`,{className:`font-mono text-[11px] text-neutral-600 break-all`,children:e.base_service_url||(0,P.jsx)(`em`,{className:`text-neutral-400`,children:`none`})})}),e.auth_credentials?.scopes&&(0,P.jsx)(Wt,{label:`Scopes`,children:(0,P.jsx)(`span`,{className:`font-mono text-[11px] text-neutral-600 break-all leading-relaxed`,children:e.auth_credentials.scopes})}),e.auth_credentials?.authorize_url&&(0,P.jsx)(Wt,{label:`Auth URL`,children:(0,P.jsx)(`span`,{className:`font-mono text-[11px] text-neutral-600 break-all`,children:e.auth_credentials.authorize_url})}),e.required_entitlement?(0,P.jsx)(Wt,{label:`Entitlement`,children:(0,P.jsx)(`span`,{className:`font-mono text-[11px] text-neutral-500`,children:e.required_entitlement})}):null]}),Kt=({services:e,pluginApiName:t,isInstalled:n})=>{let[r,i]=(0,N.useState)(0),a=e[r]??e[0];return a?(0,P.jsxs)(M,{className:`!p-0 overflow-hidden`,children:[(0,P.jsxs)(`div`,{className:`border-b border-black/10 px-5 py-3`,children:[(0,P.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-600`,children:`Services`}),(0,P.jsx)(`p`,{className:`mt-1 text-[12px] text-neutral-400`,children:`Make proxied requests to external services through Kizen's integration layer.`})]}),(0,P.jsx)(`div`,{className:`flex border-b border-black/10 overflow-x-auto`,children:e.map((e,t)=>(0,P.jsx)(`button`,{type:`button`,onClick:()=>{i(t)},className:`shrink-0 px-4 py-2.5 text-[12px] font-medium border-b-2 transition-colors ${t===r?`border-neutral-800 text-neutral-900`:`border-transparent text-neutral-400 hover:text-neutral-700`}`,children:e.display_name},e.service_name))}),(0,P.jsxs)(`div`,{className:`p-5 flex flex-col gap-4`,children:[(0,P.jsx)(Gt,{service:a}),n?(0,P.jsx)(Ht,{service:a,pluginApiName:t},a.service_name):(0,P.jsxs)(`div`,{className:`flex items-start gap-2 rounded border border-amber-200/60 bg-amber-50 px-3 py-2.5 text-[12px] text-amber-800`,children:[(0,P.jsx)(s,{icon:l,className:`mt-0.5 text-[11px]`}),(0,P.jsx)(`span`,{children:`Please install the plugin in order to test.`})]})]})]}):null},qt,I,Jt,Yt,Xt,Zt,Qt,$t,en,tn={},nn=[],rn=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function an(e,t){for(var n in t)e[n]=t[n];return e}function on(e){var t=e.parentNode;t&&t.removeChild(e)}function L(e,t,n){var r,i,a,o={};for(a in t)a==`key`?r=t[a]:a==`ref`?i=t[a]:o[a]=t[a];if(arguments.length>2&&(o.children=arguments.length>3?qt.call(arguments,2):n),typeof e==`function`&&e.defaultProps!=null)for(a in e.defaultProps)o[a]===void 0&&(o[a]=e.defaultProps[a]);return sn(e,o,r,i,null)}function sn(e,t,n,r,i){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:i??++Jt};return i==null&&I.vnode!=null&&I.vnode(a),a}function R(){return{current:null}}function z(e){return e.children}function cn(e,t,n,r,i){for(var a in n)a===`children`||a===`key`||a in t||un(e,a,null,n[a],r);for(a in t)i&&typeof t[a]!=`function`||a===`children`||a===`key`||a===`value`||a===`checked`||n[a]===t[a]||un(e,a,t[a],n[a],r)}function ln(e,t,n){t[0]===`-`?e.setProperty(t,n??``):e[t]=n==null?``:typeof n!=`number`||rn.test(t)?n:n+`px`}function un(e,t,n,r,i){var a;n:if(t===`style`)if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||ln(e.style,t,``);if(n)for(t in n)r&&n[t]===r[t]||ln(e.style,t,n[t])}else if(t[0]===`o`&&t[1]===`n`)a=t!==(t=t.replace(/Capture$/,``)),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||={},e.l[t+a]=n,n?r||e.addEventListener(t,a?fn:dn,a):e.removeEventListener(t,a?fn:dn,a);else if(t!==`dangerouslySetInnerHTML`){if(i)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!==`width`&&t!==`height`&&t!==`href`&&t!==`list`&&t!==`form`&&t!==`tabIndex`&&t!==`download`&&t in e)try{e[t]=n??``;break n}catch{}typeof n==`function`||(n==null||!1===n&&t.indexOf(`-`)==-1?e.removeAttribute(t):e.setAttribute(t,n))}}function dn(e){Xt=!0;try{return this.l[e.type+!1](I.event?I.event(e):e)}finally{Xt=!1}}function fn(e){Xt=!0;try{return this.l[e.type+!0](I.event?I.event(e):e)}finally{Xt=!1}}function B(e,t){this.props=e,this.context=t}function pn(e,t){if(t==null)return e.__?pn(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?pn(e):null}function mn(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return mn(e)}}function hn(e){Xt?setTimeout(e):$t(e)}function gn(e){(!e.__d&&(e.__d=!0)&&Zt.push(e)&&!_n.__r++||Qt!==I.debounceRendering)&&((Qt=I.debounceRendering)||hn)(_n)}function _n(){var e,t,n,r,i,a,o,s;for(Zt.sort(function(e,t){return e.__v.__b-t.__v.__b});e=Zt.shift();)e.__d&&(t=Zt.length,r=void 0,i=void 0,o=(a=(n=e).__v).__e,(s=n.__P)&&(r=[],(i=an({},a)).__v=a.__v+1,Cn(s,a,i,n.__n,s.ownerSVGElement!==void 0,a.__h==null?null:[o],r,o??pn(a),a.__h),wn(r,a),a.__e!=o&&mn(a)),Zt.length>t&&Zt.sort(function(e,t){return e.__v.__b-t.__v.__b}));_n.__r=0}function vn(e,t,n,r,i,a,o,s,c,l){var u,d,f,p,m,h,g,_=r&&r.__k||nn,v=_.length;for(n.__k=[],u=0;u<t.length;u++)if((p=n.__k[u]=(p=t[u])==null||typeof p==`boolean`?null:typeof p==`string`||typeof p==`number`||typeof p==`bigint`?sn(null,p,null,null,p):Array.isArray(p)?sn(z,{children:p},null,null,null):p.__b>0?sn(p.type,p.props,p.key,p.ref?p.ref:null,p.__v):p)!=null){if(p.__=n,p.__b=n.__b+1,(f=_[u])===null||f&&p.key==f.key&&p.type===f.type)_[u]=void 0;else for(d=0;d<v;d++){if((f=_[d])&&p.key==f.key&&p.type===f.type){_[d]=void 0;break}f=null}Cn(e,p,f||=tn,i,a,o,s,c,l),m=p.__e,(d=p.ref)&&f.ref!=d&&(g||=[],f.ref&&g.push(f.ref,null,p),g.push(d,p.__c||m,p)),m==null?c&&f.__e==c&&c.parentNode!=e&&(c=pn(f)):(h??=m,typeof p.type==`function`&&p.__k===f.__k?p.__d=c=yn(p,c,e):c=xn(e,p,f,_,m,c),typeof n.type==`function`&&(n.__d=c))}for(n.__e=h,u=v;u--;)_[u]!=null&&(typeof n.type==`function`&&_[u].__e!=null&&_[u].__e==n.__d&&(n.__d=Sn(r).nextSibling),Dn(_[u],_[u]));if(g)for(u=0;u<g.length;u++)En(g[u],g[++u],g[++u])}function yn(e,t,n){for(var r,i=e.__k,a=0;i&&a<i.length;a++)(r=i[a])&&(r.__=e,t=typeof r.type==`function`?yn(r,t,n):xn(n,r,r,i,r.__e,t));return t}function bn(e,t){return t||=[],e==null||typeof e==`boolean`||(Array.isArray(e)?e.some(function(e){bn(e,t)}):t.push(e)),t}function xn(e,t,n,r,i,a){var o,s,c;if(t.__d!==void 0)o=t.__d,t.__d=void 0;else if(n==null||i!=a||i.parentNode==null)n:if(a==null||a.parentNode!==e)e.appendChild(i),o=null;else{for(s=a,c=0;(s=s.nextSibling)&&c<r.length;c+=1)if(s==i)break n;e.insertBefore(i,a),o=a}return o===void 0?i.nextSibling:o}function Sn(e){var t,n,r;if(e.type==null||typeof e.type==`string`)return e.__e;if(e.__k){for(t=e.__k.length-1;t>=0;t--)if((n=e.__k[t])&&(r=Sn(n)))return r}return null}function Cn(e,t,n,r,i,a,o,s,c){var l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w=t.type;if(t.constructor!==void 0)return null;n.__h!=null&&(c=n.__h,s=t.__e=n.__e,t.__h=null,a=[s]),(l=I.__b)&&l(t);try{n:if(typeof w==`function`){if(g=t.props,_=(l=w.contextType)&&r[l.__c],v=l?_?_.props.value:l.__:r,n.__c?h=(u=t.__c=n.__c).__=u.__E:(`prototype`in w&&w.prototype.render?t.__c=u=new w(g,v):(t.__c=u=new B(g,v),u.constructor=w,u.render=On),_&&_.sub(u),u.props=g,u.state||={},u.context=v,u.__n=r,d=u.__d=!0,u.__h=[],u._sb=[]),u.__s??=u.state,w.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=an({},u.__s)),an(u.__s,w.getDerivedStateFromProps(g,u.__s))),f=u.props,p=u.state,u.__v=t,d)w.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(w.getDerivedStateFromProps==null&&g!==f&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(g,v),!u.__e&&u.shouldComponentUpdate!=null&&!1===u.shouldComponentUpdate(g,u.__s,v)||t.__v===n.__v){for(t.__v!==n.__v&&(u.props=g,u.state=u.__s,u.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(e){e&&(e.__=t)}),y=0;y<u._sb.length;y++)u.__h.push(u._sb[y]);u._sb=[],u.__h.length&&o.push(u);break n}u.componentWillUpdate!=null&&u.componentWillUpdate(g,u.__s,v),u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(f,p,m)})}if(u.context=v,u.props=g,u.__P=e,b=I.__r,x=0,`prototype`in w&&w.prototype.render){for(u.state=u.__s,u.__d=!1,b&&b(t),l=u.render(u.props,u.state,u.context),S=0;S<u._sb.length;S++)u.__h.push(u._sb[S]);u._sb=[]}else do u.__d=!1,b&&b(t),l=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++x<25);u.state=u.__s,u.getChildContext!=null&&(r=an(an({},r),u.getChildContext())),d||u.getSnapshotBeforeUpdate==null||(m=u.getSnapshotBeforeUpdate(f,p)),C=l!=null&&l.type===z&&l.key==null?l.props.children:l,vn(e,Array.isArray(C)?C:[C],t,n,r,i,a,o,s,c),u.base=t.__e,t.__h=null,u.__h.length&&o.push(u),h&&(u.__E=u.__=null),u.__e=!1}else a==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=Tn(n.__e,t,n,r,i,a,o,c);(l=I.diffed)&&l(t)}catch(e){t.__v=null,(c||a!=null)&&(t.__e=s,t.__h=!!c,a[a.indexOf(s)]=null),I.__e(e,t,n)}}function wn(e,t){I.__c&&I.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){I.__e(e,t.__v)}})}function Tn(e,t,n,r,i,a,o,s){var c,l,u,d=n.props,f=t.props,p=t.type,m=0;if(p===`svg`&&(i=!0),a!=null){for(;m<a.length;m++)if((c=a[m])&&`setAttribute`in c==!!p&&(p?c.localName===p:c.nodeType===3)){e=c,a[m]=null;break}}if(e==null){if(p===null)return document.createTextNode(f);e=i?document.createElementNS(`http://www.w3.org/2000/svg`,p):document.createElement(p,f.is&&f),a=null,s=!1}if(p===null)d===f||s&&e.data===f||(e.data=f);else{if(a&&=qt.call(e.childNodes),l=(d=n.props||tn).dangerouslySetInnerHTML,u=f.dangerouslySetInnerHTML,!s){if(a!=null)for(d={},m=0;m<e.attributes.length;m++)d[e.attributes[m].name]=e.attributes[m].value;(u||l)&&(u&&(l&&u.__html==l.__html||u.__html===e.innerHTML)||(e.innerHTML=u&&u.__html||``))}if(cn(e,f,d,i,s),u)t.__k=[];else if(m=t.props.children,vn(e,Array.isArray(m)?m:[m],t,n,r,i&&p!==`foreignObject`,a,o,a?a[0]:n.__k&&pn(n,0),s),a!=null)for(m=a.length;m--;)a[m]!=null&&on(a[m]);s||(`value`in f&&(m=f.value)!==void 0&&(m!==e.value||p===`progress`&&!m||p===`option`&&m!==d.value)&&un(e,`value`,m,d.value,!1),`checked`in f&&(m=f.checked)!==void 0&&m!==e.checked&&un(e,`checked`,m,d.checked,!1))}return e}function En(e,t,n){try{typeof e==`function`?e(t):e.current=t}catch(e){I.__e(e,n)}}function Dn(e,t,n){var r,i;if(I.unmount&&I.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||En(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){I.__e(e,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&Dn(r[i],t,n||typeof e.type!=`function`);n||e.__e==null||on(e.__e),e.__=e.__e=e.__d=void 0}function On(e,t,n){return this.constructor(e,n)}function kn(e,t,n){var r,i,a;I.__&&I.__(e,t),i=(r=typeof n==`function`)?null:n&&n.__k||t.__k,a=[],Cn(t,e=(!r&&n||t).__k=L(z,null,[e]),i||tn,tn,t.ownerSVGElement!==void 0,!r&&n?[n]:i?null:t.firstChild?qt.call(t.childNodes):null,a,!r&&n?n:i?i.__e:t.firstChild,r),wn(a,e)}function An(e,t){var n={__c:t=`__cC`+ en++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some(function(e){e.__e=!0,gn(e)})},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}qt=nn.slice,I={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=i.__d),o)return i.__E=i}catch(t){e=t}throw e}},Jt=0,Yt=function(e){return e!=null&&e.constructor===void 0},Xt=!1,B.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=an({},this.state);typeof e==`function`&&(e=e(an({},n),this.props)),e&&an(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),gn(this))},B.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),gn(this))},B.prototype.render=z,Zt=[],$t=typeof Promise==`function`?Promise.prototype.then.bind(Promise.resolve()):setTimeout,_n.__r=0,en=0;var V,jn,Mn,Nn=[],Pn=[],Fn=I.__b,In=I.__r,Ln=I.diffed,Rn=I.__c,zn=I.unmount;function Bn(){for(var e;e=Nn.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Un),e.__H.__h.forEach(Wn),e.__H.__h=[]}catch(t){e.__H.__h=[],I.__e(t,e.__v)}}I.__b=function(e){V=null,Fn&&Fn(e)},I.__r=function(e){In&&In(e);var t=(V=e.__c).__H;t&&(jn===V?(t.__h=[],V.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.__V=Pn,e.__N=e.i=void 0})):(t.__h.forEach(Un),t.__h.forEach(Wn),t.__h=[])),jn=V},I.diffed=function(e){Ln&&Ln(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Nn.push(t)!==1&&Mn===I.requestAnimationFrame||((Mn=I.requestAnimationFrame)||Hn)(Bn)),t.__H.__.forEach(function(e){e.i&&(e.__H=e.i),e.__V!==Pn&&(e.__=e.__V),e.i=void 0,e.__V=Pn})),jn=V=null},I.__c=function(e,t){t.some(function(e){try{e.__h.forEach(Un),e.__h=e.__h.filter(function(e){return!e.__||Wn(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],I.__e(n,e.__v)}}),Rn&&Rn(e,t)},I.unmount=function(e){zn&&zn(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{Un(e)}catch(e){t=e}}),n.__H=void 0,t&&I.__e(t,n.__v))};var Vn=typeof requestAnimationFrame==`function`;function Hn(e){var t,n=function(){clearTimeout(r),Vn&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);Vn&&(t=requestAnimationFrame(n))}function Un(e){var t=V,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),V=t}function Wn(e){var t=V;e.__c=e.__(),V=t}function Gn(e,t){for(var n in t)e[n]=t[n];return e}function Kn(e,t){for(var n in e)if(n!==`__source`&&!(n in t))return!0;for(var r in t)if(r!==`__source`&&e[r]!==t[r])return!0;return!1}function qn(e){this.props=e}(qn.prototype=new B).isPureReactComponent=!0,qn.prototype.shouldComponentUpdate=function(e,t){return Kn(this.props,e)||Kn(this.state,t)};var Jn=I.__b;I.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Jn&&Jn(e)},typeof Symbol<`u`&&Symbol.for;var Yn=I.__e;I.__e=function(e,t,n,r){if(e.then){for(var i,a=t;a=a.__;)if((i=a.__c)&&i.__c)return t.__e??(t.__e=n.__e,t.__k=n.__k),i.__c(e,t)}Yn(e,t,n,r)};var Xn=I.unmount;function Zn(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(e){typeof e.__c==`function`&&e.__c()}),e.__c.__H=null),(e=Gn({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(e){return Zn(e,t,n)})),e}function Qn(e,t,n){return e&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(e){return Qn(e,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.insertBefore(e.__e,e.__d),e.__c.__e=!0,e.__c.__P=n)),e}function $n(){this.__u=0,this.t=null,this.__b=null}function er(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function tr(){this.u=null,this.o=null}I.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&!0===e.__h&&(e.type=null),Xn&&Xn(e)},($n.prototype=new B).__c=function(e,t){var n=t.__c,r=this;r.t??=[],r.t.push(n);var i=er(r.__v),a=!1,o=function(){a||(a=!0,n.__R=null,i?i(s):s())};n.__R=o;var s=function(){if(!--r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=Qn(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.t.pop();)t.forceUpdate()}},c=!0===t.__h;r.__u++||c||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(o,o)},$n.prototype.componentWillUnmount=function(){this.t=[]},$n.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement(`div`),r=this.__v.__k[0].__c;this.__v.__k[0]=Zn(this.__b,n,r.__O=r.__P)}this.__b=null}var i=t.__a&&L(z,null,e.fallback);return i&&(i.__h=null),[L(z,null,t.__a?null:e.children),i]};var nr=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!==`t`||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};function rr(e){return this.getChildContext=function(){return e.context},e.children}function ir(e){var t=this,n=e.i;t.componentWillUnmount=function(){kn(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),e.__v?(t.l||=(t.i=n,{nodeType:1,parentNode:n,childNodes:[],appendChild:function(e){this.childNodes.push(e),t.i.appendChild(e)},insertBefore:function(e,n){this.childNodes.push(e),t.i.appendChild(e)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.i.removeChild(e)}}),kn(L(rr,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}function ar(e,t){var n=L(ir,{__v:e,i:t});return n.containerInfo=t,n}(tr.prototype=new B).__a=function(e){var t=this,n=er(t.__v),r=t.o.get(e);return r[0]++,function(i){var a=function(){t.props.revealOrder?(r.push(i),nr(t,e,r)):i()};n?n(a):a()}},tr.prototype.render=function(e){this.u=null,this.o=new Map;var t=bn(e.children);e.revealOrder&&e.revealOrder[0]===`b`&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},tr.prototype.componentDidUpdate=tr.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,n){nr(e,n,t)})};var or=typeof Symbol<`u`&&Symbol.for&&Symbol.for(`react.element`)||60103,sr=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,cr=typeof document<`u`,lr=function(e){return(typeof Symbol<`u`&&typeof Symbol()==`symbol`?/fil|che|rad/i:/fil|che|ra/i).test(e)};B.prototype.isReactComponent={},[`componentWillMount`,`componentWillReceiveProps`,`componentWillUpdate`].forEach(function(e){Object.defineProperty(B.prototype,e,{configurable:!0,get:function(){return this[`UNSAFE_`+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var ur=I.event;function dr(){}function fr(){return this.cancelBubble}function pr(){return this.defaultPrevented}I.event=function(e){return ur&&(e=ur(e)),e.persist=dr,e.isPropagationStopped=fr,e.isDefaultPrevented=pr,e.nativeEvent=e};var mr={configurable:!0,get:function(){return this.class}},hr=I.vnode;I.vnode=function(e){var t=e.type,n=e.props,r=n;if(typeof t==`string`){var i=t.indexOf(`-`)===-1;for(var a in r={},n){var o=n[a];cr&&a===`children`&&t===`noscript`||a===`value`&&`defaultValue`in n&&o==null||(a===`defaultValue`&&`value`in n&&n.value==null?a=`value`:a===`download`&&!0===o?o=``:/ondoubleclick/i.test(a)?a=`ondblclick`:/^onchange(textarea|input)/i.test(a+t)&&!lr(n.type)?a=`oninput`:/^onfocus$/i.test(a)?a=`onfocusin`:/^onblur$/i.test(a)?a=`onfocusout`:/^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(a)?a=a.toLowerCase():i&&sr.test(a)?a=a.replace(/[A-Z0-9]/g,`-$&`).toLowerCase():o===null&&(o=void 0),/^oninput$/i.test(a)&&(a=a.toLowerCase(),r[a]&&(a=`oninputCapture`)),r[a]=o)}t==`select`&&r.multiple&&Array.isArray(r.value)&&(r.value=bn(n.children).forEach(function(e){e.props.selected=r.value.indexOf(e.props.value)!=-1})),t==`select`&&r.defaultValue!=null&&(r.value=bn(n.children).forEach(function(e){e.props.selected=r.multiple?r.defaultValue.indexOf(e.props.value)!=-1:r.defaultValue==e.props.value})),e.props=r,n.class!=n.className&&(mr.enumerable=`className`in n,n.className!=null&&(r.class=n.className),Object.defineProperty(r,`className`,mr))}e.$$typeof=or,hr&&hr(e)};var gr=I.__r;I.__r=function(e){gr&&gr(e),e.__c};var _r=[],vr=new Map;function yr(e){_r.push(e),vr.forEach(t=>{Cr(t,e)})}function br(e){e.isConnected&&e.getRootNode&&xr(e.getRootNode())}function xr(e){let t=vr.get(e);if(!t||!t.isConnected){if(t=e.querySelector(`style[data-fullcalendar]`),!t){t=document.createElement(`style`),t.setAttribute(`data-fullcalendar`,``);let n=Tr();n&&(t.nonce=n);let r=e===document?document.head:e,i=e===document?r.querySelector(`script,link[rel=stylesheet],link[as=style],style`):r.firstChild;r.insertBefore(t,i)}vr.set(e,t),Sr(t)}}function Sr(e){for(let t of _r)Cr(e,t)}function Cr(e,t){let{sheet:n}=e,r=n.cssRules.length;t.split(`}`).forEach((e,t)=>{e=e.trim(),e&&n.insertRule(e+`}`,r+t)})}var wr;function Tr(){return wr===void 0&&(wr=Er()),wr}function Er(){let e=document.querySelector(`meta[name="csp-nonce"]`);if(e&&e.hasAttribute(`content`))return e.getAttribute(`content`);let t=document.querySelector(`script[nonce]`);return t&&t.nonce||``}typeof document<`u`&&xr(document),yr(`:root{--fc-small-font-size:.85em;--fc-page-bg-color:#fff;--fc-neutral-bg-color:hsla(0,0%,82%,.3);--fc-neutral-text-color:grey;--fc-border-color:#ddd;--fc-button-text-color:#fff;--fc-button-bg-color:#2c3e50;--fc-button-border-color:#2c3e50;--fc-button-hover-bg-color:#1e2b37;--fc-button-hover-border-color:#1a252f;--fc-button-active-bg-color:#1a252f;--fc-button-active-border-color:#151e27;--fc-event-bg-color:#3788d8;--fc-event-border-color:#3788d8;--fc-event-text-color:#fff;--fc-event-selected-overlay-color:rgba(0,0,0,.25);--fc-more-link-bg-color:#d0d0d0;--fc-more-link-text-color:inherit;--fc-event-resizer-thickness:8px;--fc-event-resizer-dot-total-width:8px;--fc-event-resizer-dot-border-width:1px;--fc-non-business-color:hsla(0,0%,84%,.3);--fc-bg-event-color:#8fdf82;--fc-bg-event-opacity:0.3;--fc-highlight-color:rgba(188,232,241,.3);--fc-today-bg-color:rgba(255,220,40,.15);--fc-now-indicator-color:red}.fc-not-allowed,.fc-not-allowed .fc-event{cursor:not-allowed}.fc{display:flex;flex-direction:column;font-size:1em}.fc,.fc *,.fc :after,.fc :before{box-sizing:border-box}.fc table{border-collapse:collapse;border-spacing:0;font-size:1em}.fc th{text-align:center}.fc td,.fc th{padding:0;vertical-align:top}.fc a[data-navlink]{cursor:pointer}.fc a[data-navlink]:hover{text-decoration:underline}.fc-direction-ltr{direction:ltr;text-align:left}.fc-direction-rtl{direction:rtl;text-align:right}.fc-theme-standard td,.fc-theme-standard th{border:1px solid var(--fc-border-color)}.fc-liquid-hack td,.fc-liquid-hack th{position:relative}@font-face{font-family:fcicons;font-style:normal;font-weight:400;src:url("data:application/x-font-ttf;charset=utf-8;base64,AAEAAAALAIAAAwAwT1MvMg8SBfAAAAC8AAAAYGNtYXAXVtKNAAABHAAAAFRnYXNwAAAAEAAAAXAAAAAIZ2x5ZgYydxIAAAF4AAAFNGhlYWQUJ7cIAAAGrAAAADZoaGVhB20DzAAABuQAAAAkaG10eCIABhQAAAcIAAAALGxvY2ED4AU6AAAHNAAAABhtYXhwAA8AjAAAB0wAAAAgbmFtZXsr690AAAdsAAABhnBvc3QAAwAAAAAI9AAAACAAAwPAAZAABQAAApkCzAAAAI8CmQLMAAAB6wAzAQkAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAABAAADpBgPA/8AAQAPAAEAAAAABAAAAAAAAAAAAAAAgAAAAAAADAAAAAwAAABwAAQADAAAAHAADAAEAAAAcAAQAOAAAAAoACAACAAIAAQAg6Qb//f//AAAAAAAg6QD//f//AAH/4xcEAAMAAQAAAAAAAAAAAAAAAQAB//8ADwABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQAAAAAAAAAAAAIAADc5AQAAAAABAWIAjQKeAskAEwAAJSc3NjQnJiIHAQYUFwEWMjc2NCcCnuLiDQ0MJAz/AA0NAQAMJAwNDcni4gwjDQwM/wANIwz/AA0NDCMNAAAAAQFiAI0CngLJABMAACUBNjQnASYiBwYUHwEHBhQXFjI3AZ4BAA0N/wAMJAwNDeLiDQ0MJAyNAQAMIw0BAAwMDSMM4uINIwwNDQAAAAIA4gC3Ax4CngATACcAACUnNzY0JyYiDwEGFB8BFjI3NjQnISc3NjQnJiIPAQYUHwEWMjc2NCcB87e3DQ0MIw3VDQ3VDSMMDQ0BK7e3DQ0MJAzVDQ3VDCQMDQ3zuLcMJAwNDdUNIwzWDAwNIwy4twwkDA0N1Q0jDNYMDA0jDAAAAgDiALcDHgKeABMAJwAAJTc2NC8BJiIHBhQfAQcGFBcWMjchNzY0LwEmIgcGFB8BBwYUFxYyNwJJ1Q0N1Q0jDA0Nt7cNDQwjDf7V1Q0N1QwkDA0Nt7cNDQwkDLfWDCMN1Q0NDCQMt7gMIw0MDNYMIw3VDQ0MJAy3uAwjDQwMAAADAFUAAAOrA1UAMwBoAHcAABMiBgcOAQcOAQcOARURFBYXHgEXHgEXHgEzITI2Nz4BNz4BNz4BNRE0JicuAScuAScuASMFITIWFx4BFx4BFx4BFREUBgcOAQcOAQcOASMhIiYnLgEnLgEnLgE1ETQ2Nz4BNz4BNz4BMxMhMjY1NCYjISIGFRQWM9UNGAwLFQkJDgUFBQUFBQ4JCRULDBgNAlYNGAwLFQkJDgUFBQUFBQ4JCRULDBgN/aoCVgQIBAQHAwMFAQIBAQIBBQMDBwQECAT9qgQIBAQHAwMFAQIBAQIBBQMDBwQECASAAVYRGRkR/qoRGRkRA1UFBAUOCQkVDAsZDf2rDRkLDBUJCA4FBQUFBQUOCQgVDAsZDQJVDRkLDBUJCQ4FBAVVAgECBQMCBwQECAX9qwQJAwQHAwMFAQICAgIBBQMDBwQDCQQCVQUIBAQHAgMFAgEC/oAZEhEZGRESGQAAAAADAFUAAAOrA1UAMwBoAIkAABMiBgcOAQcOAQcOARURFBYXHgEXHgEXHgEzITI2Nz4BNz4BNz4BNRE0JicuAScuAScuASMFITIWFx4BFx4BFx4BFREUBgcOAQcOAQcOASMhIiYnLgEnLgEnLgE1ETQ2Nz4BNz4BNz4BMxMzFRQWMzI2PQEzMjY1NCYrATU0JiMiBh0BIyIGFRQWM9UNGAwLFQkJDgUFBQUFBQ4JCRULDBgNAlYNGAwLFQkJDgUFBQUFBQ4JCRULDBgN/aoCVgQIBAQHAwMFAQIBAQIBBQMDBwQECAT9qgQIBAQHAwMFAQIBAQIBBQMDBwQECASAgBkSEhmAERkZEYAZEhIZgBEZGREDVQUEBQ4JCRUMCxkN/asNGQsMFQkIDgUFBQUFBQ4JCBUMCxkNAlUNGQsMFQkJDgUEBVUCAQIFAwIHBAQIBf2rBAkDBAcDAwUBAgICAgEFAwMHBAMJBAJVBQgEBAcCAwUCAQL+gIASGRkSgBkSERmAEhkZEoAZERIZAAABAOIAjQMeAskAIAAAExcHBhQXFjI/ARcWMjc2NC8BNzY0JyYiDwEnJiIHBhQX4uLiDQ0MJAzi4gwkDA0N4uINDQwkDOLiDCQMDQ0CjeLiDSMMDQ3h4Q0NDCMN4uIMIw0MDOLiDAwNIwwAAAABAAAAAQAAa5n0y18PPPUACwQAAAAAANivOVsAAAAA2K85WwAAAAADqwNVAAAACAACAAAAAAAAAAEAAAPA/8AAAAQAAAAAAAOrAAEAAAAAAAAAAAAAAAAAAAALBAAAAAAAAAAAAAAAAgAAAAQAAWIEAAFiBAAA4gQAAOIEAABVBAAAVQQAAOIAAAAAAAoAFAAeAEQAagCqAOoBngJkApoAAQAAAAsAigADAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAA4ArgABAAAAAAABAAcAAAABAAAAAAACAAcAYAABAAAAAAADAAcANgABAAAAAAAEAAcAdQABAAAAAAAFAAsAFQABAAAAAAAGAAcASwABAAAAAAAKABoAigADAAEECQABAA4ABwADAAEECQACAA4AZwADAAEECQADAA4APQADAAEECQAEAA4AfAADAAEECQAFABYAIAADAAEECQAGAA4AUgADAAEECQAKADQApGZjaWNvbnMAZgBjAGkAYwBvAG4Ac1ZlcnNpb24gMS4wAFYAZQByAHMAaQBvAG4AIAAxAC4AMGZjaWNvbnMAZgBjAGkAYwBvAG4Ac2ZjaWNvbnMAZgBjAGkAYwBvAG4Ac1JlZ3VsYXIAUgBlAGcAdQBsAGEAcmZjaWNvbnMAZgBjAGkAYwBvAG4Ac0ZvbnQgZ2VuZXJhdGVkIGJ5IEljb01vb24uAEYAbwBuAHQAIABnAGUAbgBlAHIAYQB0AGUAZAAgAGIAeQAgAEkAYwBvAE0AbwBvAG4ALgAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=") format("truetype")}.fc-icon{speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:inline-block;font-family:fcicons!important;font-style:normal;font-variant:normal;font-weight:400;height:1em;line-height:1;text-align:center;text-transform:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:1em}.fc-icon-chevron-left:before{content:"\\e900"}.fc-icon-chevron-right:before{content:"\\e901"}.fc-icon-chevrons-left:before{content:"\\e902"}.fc-icon-chevrons-right:before{content:"\\e903"}.fc-icon-minus-square:before{content:"\\e904"}.fc-icon-plus-square:before{content:"\\e905"}.fc-icon-x:before{content:"\\e906"}.fc .fc-button{border-radius:0;font-family:inherit;font-size:inherit;line-height:inherit;margin:0;overflow:visible;text-transform:none}.fc .fc-button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}.fc .fc-button{-webkit-appearance:button}.fc .fc-button:not(:disabled){cursor:pointer}.fc .fc-button{background-color:transparent;border:1px solid transparent;border-radius:.25em;display:inline-block;font-size:1em;font-weight:400;line-height:1.5;padding:.4em .65em;text-align:center;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:middle}.fc .fc-button:hover{text-decoration:none}.fc .fc-button:focus{box-shadow:0 0 0 .2rem rgba(44,62,80,.25);outline:0}.fc .fc-button:disabled{opacity:.65}.fc .fc-button-primary{background-color:var(--fc-button-bg-color);border-color:var(--fc-button-border-color);color:var(--fc-button-text-color)}.fc .fc-button-primary:hover{background-color:var(--fc-button-hover-bg-color);border-color:var(--fc-button-hover-border-color);color:var(--fc-button-text-color)}.fc .fc-button-primary:disabled{background-color:var(--fc-button-bg-color);border-color:var(--fc-button-border-color);color:var(--fc-button-text-color)}.fc .fc-button-primary:focus{box-shadow:0 0 0 .2rem rgba(76,91,106,.5)}.fc .fc-button-primary:not(:disabled).fc-button-active,.fc .fc-button-primary:not(:disabled):active{background-color:var(--fc-button-active-bg-color);border-color:var(--fc-button-active-border-color);color:var(--fc-button-text-color)}.fc .fc-button-primary:not(:disabled).fc-button-active:focus,.fc .fc-button-primary:not(:disabled):active:focus{box-shadow:0 0 0 .2rem rgba(76,91,106,.5)}.fc .fc-button .fc-icon{font-size:1.5em;vertical-align:middle}.fc .fc-button-group{display:inline-flex;position:relative;vertical-align:middle}.fc .fc-button-group>.fc-button{flex:1 1 auto;position:relative}.fc .fc-button-group>.fc-button.fc-button-active,.fc .fc-button-group>.fc-button:active,.fc .fc-button-group>.fc-button:focus,.fc .fc-button-group>.fc-button:hover{z-index:1}.fc-direction-ltr .fc-button-group>.fc-button:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0;margin-left:-1px}.fc-direction-ltr .fc-button-group>.fc-button:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.fc-direction-rtl .fc-button-group>.fc-button:not(:first-child){border-bottom-right-radius:0;border-top-right-radius:0;margin-right:-1px}.fc-direction-rtl .fc-button-group>.fc-button:not(:last-child){border-bottom-left-radius:0;border-top-left-radius:0}.fc .fc-toolbar{align-items:center;display:flex;justify-content:space-between}.fc .fc-toolbar.fc-header-toolbar{margin-bottom:1.5em}.fc .fc-toolbar.fc-footer-toolbar{margin-top:1.5em}.fc .fc-toolbar-title{font-size:1.75em;margin:0}.fc-direction-ltr .fc-toolbar>*>:not(:first-child){margin-left:.75em}.fc-direction-rtl .fc-toolbar>*>:not(:first-child){margin-right:.75em}.fc-direction-rtl .fc-toolbar-ltr{flex-direction:row-reverse}.fc .fc-scroller{-webkit-overflow-scrolling:touch;position:relative}.fc .fc-scroller-liquid{height:100%}.fc .fc-scroller-liquid-absolute{bottom:0;left:0;position:absolute;right:0;top:0}.fc .fc-scroller-harness{direction:ltr;overflow:hidden;position:relative}.fc .fc-scroller-harness-liquid{height:100%}.fc-direction-rtl .fc-scroller-harness>.fc-scroller{direction:rtl}.fc-theme-standard .fc-scrollgrid{border:1px solid var(--fc-border-color)}.fc .fc-scrollgrid,.fc .fc-scrollgrid table{table-layout:fixed;width:100%}.fc .fc-scrollgrid table{border-left-style:hidden;border-right-style:hidden;border-top-style:hidden}.fc .fc-scrollgrid{border-bottom-width:0;border-collapse:separate;border-right-width:0}.fc .fc-scrollgrid-liquid{height:100%}.fc .fc-scrollgrid-section,.fc .fc-scrollgrid-section table,.fc .fc-scrollgrid-section>td{height:1px}.fc .fc-scrollgrid-section-liquid>td{height:100%}.fc .fc-scrollgrid-section>*{border-left-width:0;border-top-width:0}.fc .fc-scrollgrid-section-footer>*,.fc .fc-scrollgrid-section-header>*{border-bottom-width:0}.fc .fc-scrollgrid-section-body table,.fc .fc-scrollgrid-section-footer table{border-bottom-style:hidden}.fc .fc-scrollgrid-section-sticky>*{background:var(--fc-page-bg-color);position:sticky;z-index:3}.fc .fc-scrollgrid-section-header.fc-scrollgrid-section-sticky>*{top:0}.fc .fc-scrollgrid-section-footer.fc-scrollgrid-section-sticky>*{bottom:0}.fc .fc-scrollgrid-sticky-shim{height:1px;margin-bottom:-1px}.fc-sticky{position:sticky}.fc .fc-view-harness{flex-grow:1;position:relative}.fc .fc-view-harness-active>.fc-view{bottom:0;left:0;position:absolute;right:0;top:0}.fc .fc-col-header-cell-cushion{display:inline-block;padding:2px 4px}.fc .fc-bg-event,.fc .fc-highlight,.fc .fc-non-business{bottom:0;left:0;position:absolute;right:0;top:0}.fc .fc-non-business{background:var(--fc-non-business-color)}.fc .fc-bg-event{background:var(--fc-bg-event-color);opacity:var(--fc-bg-event-opacity)}.fc .fc-bg-event .fc-event-title{font-size:var(--fc-small-font-size);font-style:italic;margin:.5em}.fc .fc-highlight{background:var(--fc-highlight-color)}.fc .fc-cell-shaded,.fc .fc-day-disabled{background:var(--fc-neutral-bg-color)}a.fc-event,a.fc-event:hover{text-decoration:none}.fc-event.fc-event-draggable,.fc-event[href]{cursor:pointer}.fc-event .fc-event-main{position:relative;z-index:2}.fc-event-dragging:not(.fc-event-selected){opacity:.75}.fc-event-dragging.fc-event-selected{box-shadow:0 2px 7px rgba(0,0,0,.3)}.fc-event .fc-event-resizer{display:none;position:absolute;z-index:4}.fc-event-selected .fc-event-resizer,.fc-event:hover .fc-event-resizer{display:block}.fc-event-selected .fc-event-resizer{background:var(--fc-page-bg-color);border-color:inherit;border-radius:calc(var(--fc-event-resizer-dot-total-width)/2);border-style:solid;border-width:var(--fc-event-resizer-dot-border-width);height:var(--fc-event-resizer-dot-total-width);width:var(--fc-event-resizer-dot-total-width)}.fc-event-selected .fc-event-resizer:before{bottom:-20px;content:"";left:-20px;position:absolute;right:-20px;top:-20px}.fc-event-selected,.fc-event:focus{box-shadow:0 2px 5px rgba(0,0,0,.2)}.fc-event-selected:before,.fc-event:focus:before{bottom:0;content:"";left:0;position:absolute;right:0;top:0;z-index:3}.fc-event-selected:after,.fc-event:focus:after{background:var(--fc-event-selected-overlay-color);bottom:-1px;content:"";left:-1px;position:absolute;right:-1px;top:-1px;z-index:1}.fc-h-event{background-color:var(--fc-event-bg-color);border:1px solid var(--fc-event-border-color);display:block}.fc-h-event .fc-event-main{color:var(--fc-event-text-color)}.fc-h-event .fc-event-main-frame{display:flex}.fc-h-event .fc-event-time{max-width:100%;overflow:hidden}.fc-h-event .fc-event-title-container{flex-grow:1;flex-shrink:1;min-width:0}.fc-h-event .fc-event-title{display:inline-block;left:0;max-width:100%;overflow:hidden;right:0;vertical-align:top}.fc-h-event.fc-event-selected:before{bottom:-10px;top:-10px}.fc-direction-ltr .fc-daygrid-block-event:not(.fc-event-start),.fc-direction-rtl .fc-daygrid-block-event:not(.fc-event-end){border-bottom-left-radius:0;border-left-width:0;border-top-left-radius:0}.fc-direction-ltr .fc-daygrid-block-event:not(.fc-event-end),.fc-direction-rtl .fc-daygrid-block-event:not(.fc-event-start){border-bottom-right-radius:0;border-right-width:0;border-top-right-radius:0}.fc-h-event:not(.fc-event-selected) .fc-event-resizer{bottom:0;top:0;width:var(--fc-event-resizer-thickness)}.fc-direction-ltr .fc-h-event:not(.fc-event-selected) .fc-event-resizer-start,.fc-direction-rtl .fc-h-event:not(.fc-event-selected) .fc-event-resizer-end{cursor:w-resize;left:calc(var(--fc-event-resizer-thickness)*-.5)}.fc-direction-ltr .fc-h-event:not(.fc-event-selected) .fc-event-resizer-end,.fc-direction-rtl .fc-h-event:not(.fc-event-selected) .fc-event-resizer-start{cursor:e-resize;right:calc(var(--fc-event-resizer-thickness)*-.5)}.fc-h-event.fc-event-selected .fc-event-resizer{margin-top:calc(var(--fc-event-resizer-dot-total-width)*-.5);top:50%}.fc-direction-ltr .fc-h-event.fc-event-selected .fc-event-resizer-start,.fc-direction-rtl .fc-h-event.fc-event-selected .fc-event-resizer-end{left:calc(var(--fc-event-resizer-dot-total-width)*-.5)}.fc-direction-ltr .fc-h-event.fc-event-selected .fc-event-resizer-end,.fc-direction-rtl .fc-h-event.fc-event-selected .fc-event-resizer-start{right:calc(var(--fc-event-resizer-dot-total-width)*-.5)}.fc .fc-popover{box-shadow:0 2px 6px rgba(0,0,0,.15);position:absolute;z-index:9999}.fc .fc-popover-header{align-items:center;display:flex;flex-direction:row;justify-content:space-between;padding:3px 4px}.fc .fc-popover-title{margin:0 2px}.fc .fc-popover-close{cursor:pointer;font-size:1.1em;opacity:.65}.fc-theme-standard .fc-popover{background:var(--fc-page-bg-color);border:1px solid var(--fc-border-color)}.fc-theme-standard .fc-popover-header{background:var(--fc-neutral-bg-color)}`);var Dr=class{constructor(e){this.drainedOption=e,this.isRunning=!1,this.isDirty=!1,this.pauseDepths={},this.timeoutId=0}request(e){this.isDirty=!0,this.isPaused()||(this.clearTimeout(),e==null?this.tryDrain():this.timeoutId=setTimeout(this.tryDrain.bind(this),e))}pause(e=``){let{pauseDepths:t}=this;t[e]=(t[e]||0)+1,this.clearTimeout()}resume(e=``,t){let{pauseDepths:n}=this;e in n&&(t?delete n[e]:(--n[e],n[e]<=0&&delete n[e]),this.tryDrain())}isPaused(){return Object.keys(this.pauseDepths).length}tryDrain(){if(!this.isRunning&&!this.isPaused()){for(this.isRunning=!0;this.isDirty;)this.isDirty=!1,this.drained();this.isRunning=!1}}clear(){this.clearTimeout(),this.isDirty=!1,this.pauseDepths={}}clearTimeout(){this.timeoutId&&=(clearTimeout(this.timeoutId),0)}drained(){this.drainedOption&&this.drainedOption()}};function Or(e){e.parentNode&&e.parentNode.removeChild(e)}function kr(e,t){if(e.closest)return e.closest(t);if(!document.documentElement.contains(e))return null;do{if(Ar(e,t))return e;e=e.parentElement||e.parentNode}while(e!==null&&e.nodeType===1);return null}function Ar(e,t){return(e.matches||e.matchesSelector||e.msMatchesSelector).call(e,t)}function jr(e,t){let n=e instanceof HTMLElement?[e]:e,r=[];for(let e=0;e<n.length;e+=1){let i=n[e].querySelectorAll(t);for(let e=0;e<i.length;e+=1)r.push(i[e])}return r}var Mr=/(top|left|right|bottom|width|height)$/i;function Nr(e,t){for(let n in t)Pr(e,n,t[n])}function Pr(e,t,n){n==null?e.style[t]=``:typeof n==`number`&&Mr.test(t)?e.style[t]=`${n}px`:e.style[t]=n}function Fr(e){return e.composedPath?.call(e)[0]??e.target}var Ir=0;function Lr(){return Ir+=1,`fc-dom-`+Ir}function Rr(e,t){return n=>{let r=kr(n.target,e);r&&t.call(r,n,r)}}function zr(e,t,n,r){let i=Rr(n,r);return e.addEventListener(t,i),()=>{e.removeEventListener(t,i)}}function Br(e,t,n,r){let i;return zr(e,`mouseover`,t,(e,t)=>{if(t!==i){i=t,n(e,t);let a=e=>{i=null,r(e,t),t.removeEventListener(`mouseleave`,a)};t.addEventListener(`mouseleave`,a)}})}function Vr(e){return Object.assign({onClick:e},Hr(e))}function Hr(e){return{tabIndex:0,onKeyDown(t){(t.key===`Enter`||t.key===` `)&&(e(t),t.preventDefault())}}}var Ur=0;function Wr(){return Ur+=1,String(Ur)}function Gr(e){let t=[],n=[],r,i;for(typeof e==`string`?n=e.split(/\s*,\s*/):typeof e==`function`?n=[e]:Array.isArray(e)&&(n=e),r=0;r<n.length;r+=1)i=n[r],typeof i==`string`?t.push(i.charAt(0)===`-`?{field:i.substring(1),order:-1}:{field:i,order:1}):typeof i==`function`&&t.push({func:i});return t}function Kr(e,t,n){let r,i;for(r=0;r<n.length;r+=1)if(i=qr(e,t,n[r]),i)return i;return 0}function qr(e,t,n){return n.func?n.func(e,t):Jr(e[n.field],t[n.field])*(n.order||1)}function Jr(e,t){return!e&&!t?0:t==null?-1:e==null?1:typeof e==`string`||typeof t==`string`?String(e).localeCompare(String(t)):e-t}function Yr(e,t){let n=String(e);return`000`.substr(0,t-n.length)+n}function Xr(e,t,n){return typeof e==`function`?e(...t):typeof e==`string`?t.reduce((e,t,n)=>e.replace(`$`+n,t||``),e):n}function Zr(e){return e%1==0}function Qr(e){let t=e.querySelector(`.fc-scrollgrid-shrink-frame`),n=e.querySelector(`.fc-scrollgrid-shrink-cushion`);if(!t)throw Error(`needs fc-scrollgrid-shrink-frame className`);if(!n)throw Error(`needs fc-scrollgrid-shrink-cushion className`);return e.getBoundingClientRect().width-t.getBoundingClientRect().width+n.getBoundingClientRect().width}var $r=[`years`,`months`,`days`,`milliseconds`],ei=/^(-?)(?:(\d+)\.)?(\d+):(\d\d)(?::(\d\d)(?:\.(\d\d\d))?)?/;function H(e,t){return typeof e==`string`?ti(e):typeof e==`object`&&e?ni(e):typeof e==`number`?ni({[t||`milliseconds`]:e}):null}function ti(e){let t=ei.exec(e);if(t){let e=t[1]?-1:1;return{years:0,months:0,days:e*(t[2]?parseInt(t[2],10):0),milliseconds:e*((t[3]?parseInt(t[3],10):0)*60*60*1e3+(t[4]?parseInt(t[4],10):0)*60*1e3+(t[5]?parseInt(t[5],10):0)*1e3+(t[6]?parseInt(t[6],10):0))}}return null}function ni(e){let t={years:e.years||e.year||0,months:e.months||e.month||0,days:e.days||e.day||0,milliseconds:(e.hours||e.hour||0)*60*60*1e3+(e.minutes||e.minute||0)*60*1e3+(e.seconds||e.second||0)*1e3+(e.milliseconds||e.millisecond||e.ms||0)},n=e.weeks||e.week;return n&&(t.days+=n*7,t.specifiedWeeks=!0),t}function ri(e,t){return e.years===t.years&&e.months===t.months&&e.days===t.days&&e.milliseconds===t.milliseconds}function ii(e,t){return{years:e.years+t.years,months:e.months+t.months,days:e.days+t.days,milliseconds:e.milliseconds+t.milliseconds}}function ai(e,t){return{years:e.years-t.years,months:e.months-t.months,days:e.days-t.days,milliseconds:e.milliseconds-t.milliseconds}}function oi(e,t){return{years:e.years*t,months:e.months*t,days:e.days*t,milliseconds:e.milliseconds*t}}function si(e){return li(e)/365}function ci(e){return li(e)/30}function li(e){return U(e)/864e5}function U(e){return e.years*(365*864e5)+e.months*(30*864e5)+e.days*864e5+e.milliseconds}function ui(e,t){let n=null;for(let r=0;r<$r.length;r+=1){let i=$r[r];if(t[i]){let r=e[i]/t[i];if(!Zr(r)||n!==null&&n!==r)return null;n=r}else if(e[i])return null}return n}function di(e){let t=e.milliseconds;if(t){if(t%1e3!=0)return{unit:`millisecond`,value:t};if(t%(1e3*60)!=0)return{unit:`second`,value:t/1e3};if(t%(1e3*60*60)!=0)return{unit:`minute`,value:t/(1e3*60)};if(t)return{unit:`hour`,value:t/(1e3*60*60)}}return e.days?e.specifiedWeeks&&e.days%7==0?{unit:`week`,value:e.days/7}:{unit:`day`,value:e.days}:e.months?{unit:`month`,value:e.months}:e.years?{unit:`year`,value:e.years}:{unit:`millisecond`,value:0}}function fi(e,t,n){if(e===t)return!0;let r=e.length,i;if(r!==t.length)return!1;for(i=0;i<r;i+=1)if(!(n?n(e[i],t[i]):e[i]===t[i]))return!1;return!0}var pi=[`sun`,`mon`,`tue`,`wed`,`thu`,`fri`,`sat`];function mi(e,t){let n=Mi(e);return n[2]+=t*7,K(n)}function W(e,t){let n=Mi(e);return n[2]+=t,K(n)}function hi(e,t){let n=Mi(e);return n[6]+=t,K(n)}function gi(e,t){return _i(e,t)/7}function _i(e,t){return(t.valueOf()-e.valueOf())/(1e3*60*60*24)}function vi(e,t){return(t.valueOf()-e.valueOf())/(1e3*60*60)}function yi(e,t){return(t.valueOf()-e.valueOf())/(1e3*60)}function bi(e,t){return(t.valueOf()-e.valueOf())/1e3}function xi(e,t){let n=G(e),r=G(t);return{years:0,months:0,days:Math.round(_i(n,r)),milliseconds:t.valueOf()-r.valueOf()-(e.valueOf()-n.valueOf())}}function Si(e,t){let n=Ci(e,t);return n!==null&&n%7==0?n/7:null}function Ci(e,t){return Pi(e)===Pi(t)?Math.round(_i(e,t)):null}function G(e){return K([e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()])}function wi(e){return K([e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours()])}function Ti(e){return K([e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes()])}function Ei(e){return K([e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds()])}function Di(e,t,n){let r=e.getUTCFullYear(),i=Oi(e,r,t,n);if(i<1)return Oi(e,r-1,t,n);let a=Oi(e,r+1,t,n);return a>=1?Math.min(i,a):i}function Oi(e,t,n,r){let i=K([t,0,1+ki(t,n,r)]),a=G(e),o=Math.round(_i(i,a));return Math.floor(o/7)+1}function ki(e,t,n){let r=7+t-n;return-((7+K([e,0,r]).getUTCDay()-t)%7)+r-1}function Ai(e){return[e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()]}function ji(e){return new Date(e[0],e[1]||0,e[2]==null?1:e[2],e[3]||0,e[4]||0,e[5]||0)}function Mi(e){return[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()]}function K(e){return e.length===1&&(e=e.concat([0])),new Date(Date.UTC(...e))}function Ni(e){return!isNaN(e.valueOf())}function Pi(e){return e.getUTCHours()*1e3*60*60+e.getUTCMinutes()*1e3*60+e.getUTCSeconds()*1e3+e.getUTCMilliseconds()}function Fi(e,t,n=!1){let r=e.toISOString();return r=r.replace(`.000`,``),n&&(r=r.replace(`T00:00:00Z`,``)),r.length>10&&(t==null?r=r.replace(`Z`,``):t!==0&&(r=r.replace(`Z`,zi(t,!0)))),r}function Ii(e){return e.toISOString().replace(/T.*$/,``)}function Li(e){return e.toISOString().match(/^\d{4}-\d{2}/)[0]}function Ri(e){return Yr(e.getUTCHours(),2)+`:`+Yr(e.getUTCMinutes(),2)+`:`+Yr(e.getUTCSeconds(),2)}function zi(e,t=!1){let n=e<0?`-`:`+`,r=Math.abs(e),i=Math.floor(r/60),a=Math.round(r%60);return t?`${n+Yr(i,2)}:${Yr(a,2)}`:`GMT${n}${i}${a?`:${Yr(a,2)}`:``}`}function q(e,t,n){let r,i;return function(...a){if(!r)i=e.apply(this,a);else if(!fi(r,a)){n&&n(i);let r=e.apply(this,a);(!t||!t(r,i))&&(i=r)}return r=a,i}}function Bi(e,t,n){let r,i;return a=>{if(!r)i=e.call(this,a);else if(!X(r,a)){n&&n(i);let r=e.call(this,a);(!t||!t(r,i))&&(i=r)}return r=a,i}}var Vi={week:3,separator:9,omitZeroMinute:9,meridiem:9,omitCommas:9},Hi={timeZoneName:7,era:6,year:5,month:4,day:2,weekday:2,hour:1,minute:1,second:1},Ui=/\s*([ap])\.?m\.?/i,Wi=/,/g,Gi=/\s+/g,Ki=/\u200e/g,qi=/UTC|GMT/,Ji=class{constructor(e){let t={},n={},r=9;for(let i in e)i in Vi?(n[i]=e[i],Vi[i]<9&&(r=Math.min(Vi[i],r))):(t[i]=e[i],i in Hi&&(r=Math.min(Hi[i],r)));this.standardDateProps=t,this.extendedSettings=n,this.smallestUnitNum=r,this.buildFormattingFunc=q(Yi)}format(e,t){return this.buildFormattingFunc(this.standardDateProps,this.extendedSettings,t)(e)}formatRange(e,t,n,r){let{standardDateProps:i,extendedSettings:a}=this,o=ta(e.marker,t.marker,n.calendarSystem);if(!o)return this.format(e,n);let s=o;s>1&&(i.year===`numeric`||i.year===`2-digit`)&&(i.month===`numeric`||i.month===`2-digit`)&&(i.day===`numeric`||i.day===`2-digit`)&&(s=1);let c=this.format(e,n),l=this.format(t,n);if(c===l)return c;let u=Yi(na(i,s),a,n),d=u(e),f=u(t),p=ra(c,d,l,f),m=a.separator||r||n.defaultSeparator||``;return p?p.before+d+m+f+p.after:c+m+l}getSmallestUnit(){switch(this.smallestUnitNum){case 7:case 6:case 5:return`year`;case 4:return`month`;case 3:return`week`;case 2:return`day`;default:return`time`}}};function Yi(e,t,n){let r=Object.keys(e).length;return r===1&&e.timeZoneName===`short`?e=>zi(e.timeZoneOffset):r===0&&t.week?e=>ea(n.computeWeekNumber(e.marker),n.weekText,n.weekTextLong,n.locale,t.week):Xi(e,t,n)}function Xi(e,t,n){e=Object.assign({},e),t=Object.assign({},t),Zi(e,t),e.timeZone=`UTC`;let r=new Intl.DateTimeFormat(n.locale.codes,e),i;if(t.omitZeroMinute){let t=Object.assign({},e);delete t.minute,i=new Intl.DateTimeFormat(n.locale.codes,t)}return a=>{let{marker:o}=a,s;return s=i&&!o.getUTCMinutes()?i:r,Qi(s.format(o),a,e,t,n)}}function Zi(e,t){e.timeZoneName&&(e.hour||=`2-digit`,e.minute||=`2-digit`),e.timeZoneName===`long`&&(e.timeZoneName=`short`),t.omitZeroMinute&&(e.second||e.millisecond)&&delete t.omitZeroMinute}function Qi(e,t,n,r,i){return e=e.replace(Ki,``),n.timeZoneName===`short`&&(e=$i(e,i.timeZone===`UTC`||t.timeZoneOffset==null?`UTC`:zi(t.timeZoneOffset))),r.omitCommas&&(e=e.replace(Wi,``).trim()),r.omitZeroMinute&&(e=e.replace(`:00`,``)),r.meridiem===!1?e=e.replace(Ui,``).trim():r.meridiem===`narrow`?e=e.replace(Ui,(e,t)=>t.toLocaleLowerCase()):r.meridiem===`short`?e=e.replace(Ui,(e,t)=>`${t.toLocaleLowerCase()}m`):r.meridiem===`lowercase`&&(e=e.replace(Ui,e=>e.toLocaleLowerCase())),e=e.replace(Gi,` `),e=e.trim(),e}function $i(e,t){let n=!1;return e=e.replace(qi,()=>(n=!0,t)),n||(e+=` ${t}`),e}function ea(e,t,n,r,i){let a=[];return i===`long`?a.push(n):(i===`short`||i===`narrow`)&&a.push(t),(i===`long`||i===`short`)&&a.push(` `),a.push(r.simpleNumberFormat.format(e)),r.options.direction===`rtl`&&a.reverse(),a.join(``)}function ta(e,t,n){return n.getMarkerYear(e)===n.getMarkerYear(t)?n.getMarkerMonth(e)===n.getMarkerMonth(t)?n.getMarkerDay(e)===n.getMarkerDay(t)?Pi(e)===Pi(t)?0:1:2:4:5}function na(e,t){let n={};for(let r in e)(!(r in Hi)||Hi[r]<=t)&&(n[r]=e[r]);return n}function ra(e,t,n,r){let i=0;for(;i<e.length;){let a=e.indexOf(t,i);if(a===-1)break;let o=e.substr(0,a);i=a+t.length;let s=e.substr(i),c=0;for(;c<n.length;){let e=n.indexOf(r,c);if(e===-1)break;let t=n.substr(0,e);c=e+r.length;let i=n.substr(c);if(o===t&&s===i)return{before:o,after:s}}}return null}function ia(e,t){let n=t.markerToArray(e.marker);return{marker:e.marker,timeZoneOffset:e.timeZoneOffset,array:n,year:n[0],month:n[1],day:n[2],hour:n[3],minute:n[4],second:n[5],millisecond:n[6]}}function aa(e,t,n,r){let i=ia(e,n.calendarSystem);return{date:i,start:i,end:t?ia(t,n.calendarSystem):null,timeZone:n.timeZone,localeCodes:n.locale.codes,defaultSeparator:r||n.defaultSeparator}}var oa=class{constructor(e){this.cmdStr=e}format(e,t,n){return t.cmdFormatter(this.cmdStr,aa(e,null,t,n))}formatRange(e,t,n,r){return n.cmdFormatter(this.cmdStr,aa(e,t,n,r))}},sa=class{constructor(e){this.func=e}format(e,t,n){return this.func(aa(e,null,t,n))}formatRange(e,t,n,r){return this.func(aa(e,t,n,r))}};function J(e){return typeof e==`object`&&e?new Ji(e):typeof e==`string`?new oa(e):typeof e==`function`?new sa(e):null}var ca={navLinkDayClick:Y,navLinkWeekClick:Y,duration:H,bootstrapFontAwesome:Y,buttonIcons:Y,customButtons:Y,defaultAllDayEventDuration:H,defaultTimedEventDuration:H,nextDayThreshold:H,scrollTime:H,scrollTimeReset:Boolean,slotMinTime:H,slotMaxTime:H,dayPopoverFormat:J,slotDuration:H,snapDuration:H,headerToolbar:Y,footerToolbar:Y,defaultRangeSeparator:String,titleRangeSeparator:String,forceEventDuration:Boolean,dayHeaders:Boolean,dayHeaderFormat:J,dayHeaderClassNames:Y,dayHeaderContent:Y,dayHeaderDidMount:Y,dayHeaderWillUnmount:Y,dayCellClassNames:Y,dayCellContent:Y,dayCellDidMount:Y,dayCellWillUnmount:Y,initialView:String,aspectRatio:Number,weekends:Boolean,weekNumberCalculation:Y,weekNumbers:Boolean,weekNumberClassNames:Y,weekNumberContent:Y,weekNumberDidMount:Y,weekNumberWillUnmount:Y,editable:Boolean,viewClassNames:Y,viewDidMount:Y,viewWillUnmount:Y,nowIndicator:Boolean,nowIndicatorSnap:Y,nowIndicatorClassNames:Y,nowIndicatorContent:Y,nowIndicatorDidMount:Y,nowIndicatorWillUnmount:Y,showNonCurrentDates:Boolean,lazyFetching:Boolean,startParam:String,endParam:String,timeZoneParam:String,timeZone:String,locales:Y,locale:Y,themeSystem:String,dragRevertDuration:Number,dragScroll:Boolean,allDayMaintainDuration:Boolean,unselectAuto:Boolean,dropAccept:Y,eventOrder:Gr,eventOrderStrict:Boolean,handleWindowResize:Boolean,windowResizeDelay:Number,longPressDelay:Number,eventDragMinDistance:Number,expandRows:Boolean,height:Y,contentHeight:Y,direction:String,weekNumberFormat:J,eventResizableFromStart:Boolean,displayEventTime:Boolean,displayEventEnd:Boolean,weekText:String,weekTextLong:String,progressiveEventRendering:Boolean,businessHours:Y,initialDate:Y,now:Y,eventDataTransform:Y,stickyHeaderDates:Y,stickyFooterScrollbar:Y,viewHeight:Y,defaultAllDay:Boolean,eventSourceFailure:Y,eventSourceSuccess:Y,eventDisplay:String,eventStartEditable:Boolean,eventDurationEditable:Boolean,eventOverlap:Y,eventConstraint:Y,eventAllow:Y,eventBackgroundColor:String,eventBorderColor:String,eventTextColor:String,eventColor:String,eventClassNames:Y,eventContent:Y,eventDidMount:Y,eventWillUnmount:Y,selectConstraint:Y,selectOverlap:Y,selectAllow:Y,droppable:Boolean,unselectCancel:String,slotLabelFormat:Y,slotLaneClassNames:Y,slotLaneContent:Y,slotLaneDidMount:Y,slotLaneWillUnmount:Y,slotLabelClassNames:Y,slotLabelContent:Y,slotLabelDidMount:Y,slotLabelWillUnmount:Y,dayMaxEvents:Y,dayMaxEventRows:Y,dayMinWidth:Number,slotLabelInterval:H,allDayText:String,allDayClassNames:Y,allDayContent:Y,allDayDidMount:Y,allDayWillUnmount:Y,slotMinWidth:Number,navLinks:Boolean,eventTimeFormat:J,rerenderDelay:Number,moreLinkText:Y,moreLinkHint:Y,selectMinDistance:Number,selectable:Boolean,selectLongPressDelay:Number,eventLongPressDelay:Number,selectMirror:Boolean,eventMaxStack:Number,eventMinHeight:Number,eventMinWidth:Number,eventShortHeight:Number,slotEventOverlap:Boolean,plugins:Y,firstDay:Number,dayCount:Number,dateAlignment:String,dateIncrement:H,hiddenDays:Y,fixedWeekCount:Boolean,validRange:Y,visibleRange:Y,titleFormat:Y,eventInteractive:Boolean,noEventsText:String,viewHint:Y,navLinkHint:Y,closeHint:String,timeHint:String,eventHint:String,moreLinkClick:Y,moreLinkClassNames:Y,moreLinkContent:Y,moreLinkDidMount:Y,moreLinkWillUnmount:Y,monthStartFormat:J,handleCustomRendering:Y,customRenderingMetaMap:Y,customRenderingReplaces:Boolean},la={eventDisplay:`auto`,defaultRangeSeparator:` - `,titleRangeSeparator:` – `,defaultTimedEventDuration:`01:00:00`,defaultAllDayEventDuration:{day:1},forceEventDuration:!1,nextDayThreshold:`00:00:00`,dayHeaders:!0,initialView:``,aspectRatio:1.35,headerToolbar:{start:`title`,center:``,end:`today prev,next`},weekends:!0,weekNumbers:!1,weekNumberCalculation:`local`,editable:!1,nowIndicator:!1,scrollTime:`06:00:00`,scrollTimeReset:!0,slotMinTime:`00:00:00`,slotMaxTime:`24:00:00`,showNonCurrentDates:!0,lazyFetching:!0,startParam:`start`,endParam:`end`,timeZoneParam:`timeZone`,timeZone:`local`,locales:[],locale:``,themeSystem:`standard`,dragRevertDuration:500,dragScroll:!0,allDayMaintainDuration:!1,unselectAuto:!0,dropAccept:`*`,eventOrder:`start,-duration,allDay,title`,dayPopoverFormat:{month:`long`,day:`numeric`,year:`numeric`},handleWindowResize:!0,windowResizeDelay:100,longPressDelay:1e3,eventDragMinDistance:5,expandRows:!1,navLinks:!1,selectable:!1,eventMinHeight:15,eventMinWidth:30,eventShortHeight:30,monthStartFormat:{month:`long`,day:`numeric`},nowIndicatorSnap:`auto`},ua={datesSet:Y,eventsSet:Y,eventAdd:Y,eventChange:Y,eventRemove:Y,windowResize:Y,eventClick:Y,eventMouseEnter:Y,eventMouseLeave:Y,select:Y,unselect:Y,loading:Y,_unmount:Y,_beforeprint:Y,_afterprint:Y,_noEventDrop:Y,_noEventResize:Y,_resize:Y,_scrollRequest:Y},da={buttonText:Y,buttonHints:Y,views:Y,plugins:Y,initialEvents:Y,events:Y,eventSources:Y},fa={headerToolbar:pa,footerToolbar:pa,buttonText:pa,buttonHints:pa,buttonIcons:pa,dateIncrement:pa,plugins:ma,events:ma,eventSources:ma,resources:ma};function pa(e,t){return typeof e==`object`&&typeof t==`object`&&e&&t?X(e,t):e===t}function ma(e,t){return Array.isArray(e)&&Array.isArray(t)?fi(e,t):e===t}var ha={type:String,component:Y,buttonText:String,buttonTextKey:String,dateProfileGeneratorClass:Y,usesMinMaxTime:Boolean,classNames:Y,content:Y,didMount:Y,willUnmount:Y};function ga(e){return ya(e,fa)}function _a(e,t){let n={},r={};for(let r in t)r in e&&(n[r]=t[r](e[r]));for(let n in e)n in t||(r[n]=e[n]);return{refined:n,extra:r}}function Y(e){return e}var{hasOwnProperty:va}=Object.prototype;function ya(e,t){let n={};if(t){for(let r in t)if(t[r]===pa){let t=[];for(let i=e.length-1;i>=0;--i){let a=e[i][r];if(typeof a==`object`&&a)t.unshift(a);else if(a!==void 0){n[r]=a;break}}t.length&&(n[r]=ya(t))}}for(let t=e.length-1;t>=0;--t){let r=e[t];for(let e in r)e in n||(n[e]=r[e])}return n}function ba(e,t){let n={};for(let r in e)t(e[r],r)&&(n[r]=e[r]);return n}function xa(e,t){let n={};for(let r in e)n[r]=t(e[r],r);return n}function Sa(e){let t={};for(let n of e)t[n]=!0;return t}function Ca(e){let t=[];for(let n in e)t.push(e[n]);return t}function X(e,t){if(e===t)return!0;for(let n in e)if(va.call(e,n)&&!(n in t))return!1;for(let n in t)if(va.call(t,n)&&e[n]!==t[n])return!1;return!0}var wa=/^on[A-Z]/;function Ta(e,t){let n=Ea(e,t);for(let e of n)if(!wa.test(e))return!1;return!0}function Ea(e,t){let n=[];for(let r in e)va.call(e,r)&&(r in t||n.push(r));for(let r in t)va.call(t,r)&&e[r]!==t[r]&&n.push(r);return n}function Da(e,t,n={}){if(e===t)return!0;for(let r in t)if(!(r in e&&Oa(e[r],t[r],n[r])))return!1;for(let n in e)if(!(n in t))return!1;return!0}function Oa(e,t,n){return e===t||n===!0?!0:n?n(e,t):!1}function ka(e,t=0,n,r=1){let i=[];n??=Object.keys(e).length;for(let a=t;a<n;a+=r){let t=e[a];t!==void 0&&i.push(t)}return i}var Aa={};function ja(e,t){Aa[e]=t}function Ma(e){return new Aa[e]}ja(`gregory`,class{getMarkerYear(e){return e.getUTCFullYear()}getMarkerMonth(e){return e.getUTCMonth()}getMarkerDay(e){return e.getUTCDate()}arrayToMarker(e){return K(e)}markerToArray(e){return Mi(e)}});var Na=/^\s*(\d{4})(-?(\d{2})(-?(\d{2})([T ](\d{2}):?(\d{2})(:?(\d{2})(\.(\d+))?)?(Z|(([-+])(\d{2})(:?(\d{2}))?))?)?)?)?$/;function Pa(e){let t=Na.exec(e);if(t){let e=new Date(Date.UTC(Number(t[1]),t[3]?Number(t[3])-1:0,Number(t[5]||1),Number(t[7]||0),Number(t[8]||0),Number(t[10]||0),t[12]?Number(`0.${t[12]}`)*1e3:0));if(Ni(e)){let n=null;return t[13]&&(n=(t[15]===`-`?-1:1)*(Number(t[16]||0)*60+Number(t[18]||0))),{marker:e,isTimeUnspecified:!t[6],timeZoneOffset:n}}}return null}var Fa=class{constructor(e){let t=this.timeZone=e.timeZone,n=t!==`local`&&t!==`UTC`;e.namedTimeZoneImpl&&n&&(this.namedTimeZoneImpl=new e.namedTimeZoneImpl(t)),this.canComputeOffset=!!(!n||this.namedTimeZoneImpl),this.calendarSystem=Ma(e.calendarSystem),this.locale=e.locale,this.weekDow=e.locale.week.dow,this.weekDoy=e.locale.week.doy,e.weekNumberCalculation===`ISO`&&(this.weekDow=1,this.weekDoy=4),typeof e.firstDay==`number`&&(this.weekDow=e.firstDay),typeof e.weekNumberCalculation==`function`&&(this.weekNumberFunc=e.weekNumberCalculation),this.weekText=e.weekText==null?e.locale.options.weekText:e.weekText,this.weekTextLong=(e.weekTextLong==null?e.locale.options.weekTextLong:e.weekTextLong)||this.weekText,this.cmdFormatter=e.cmdFormatter,this.defaultSeparator=e.defaultSeparator}createMarker(e){let t=this.createMarkerMeta(e);return t===null?null:t.marker}createNowMarker(){return this.canComputeOffset?this.timestampToMarker(new Date().valueOf()):K(Ai(new Date))}createMarkerMeta(e){if(typeof e==`string`)return this.parse(e);let t=null;return typeof e==`number`?t=this.timestampToMarker(e):e instanceof Date?(e=e.valueOf(),isNaN(e)||(t=this.timestampToMarker(e))):Array.isArray(e)&&(t=K(e)),t===null||!Ni(t)?null:{marker:t,isTimeUnspecified:!1,forcedTzo:null}}parse(e){let t=Pa(e);if(t===null)return null;let{marker:n}=t,r=null;return t.timeZoneOffset!==null&&(this.canComputeOffset?n=this.timestampToMarker(n.valueOf()-t.timeZoneOffset*60*1e3):r=t.timeZoneOffset),{marker:n,isTimeUnspecified:t.isTimeUnspecified,forcedTzo:r}}getYear(e){return this.calendarSystem.getMarkerYear(e)}getMonth(e){return this.calendarSystem.getMarkerMonth(e)}getDay(e){return this.calendarSystem.getMarkerDay(e)}add(e,t){let n=this.calendarSystem.markerToArray(e);return n[0]+=t.years,n[1]+=t.months,n[2]+=t.days,n[6]+=t.milliseconds,this.calendarSystem.arrayToMarker(n)}subtract(e,t){let n=this.calendarSystem.markerToArray(e);return n[0]-=t.years,n[1]-=t.months,n[2]-=t.days,n[6]-=t.milliseconds,this.calendarSystem.arrayToMarker(n)}addYears(e,t){let n=this.calendarSystem.markerToArray(e);return n[0]+=t,this.calendarSystem.arrayToMarker(n)}addMonths(e,t){let n=this.calendarSystem.markerToArray(e);return n[1]+=t,this.calendarSystem.arrayToMarker(n)}diffWholeYears(e,t){let{calendarSystem:n}=this;return Pi(e)===Pi(t)&&n.getMarkerDay(e)===n.getMarkerDay(t)&&n.getMarkerMonth(e)===n.getMarkerMonth(t)?n.getMarkerYear(t)-n.getMarkerYear(e):null}diffWholeMonths(e,t){let{calendarSystem:n}=this;return Pi(e)===Pi(t)&&n.getMarkerDay(e)===n.getMarkerDay(t)?n.getMarkerMonth(t)-n.getMarkerMonth(e)+(n.getMarkerYear(t)-n.getMarkerYear(e))*12:null}greatestWholeUnit(e,t){let n=this.diffWholeYears(e,t);return n===null?(n=this.diffWholeMonths(e,t),n===null?(n=Si(e,t),n===null?(n=Ci(e,t),n===null?(n=vi(e,t),Zr(n)?{unit:`hour`,value:n}:(n=yi(e,t),Zr(n)?{unit:`minute`,value:n}:(n=bi(e,t),Zr(n)?{unit:`second`,value:n}:{unit:`millisecond`,value:t.valueOf()-e.valueOf()}))):{unit:`day`,value:n}):{unit:`week`,value:n}):{unit:`month`,value:n}):{unit:`year`,value:n}}countDurationsBetween(e,t,n){let r;return n.years&&(r=this.diffWholeYears(e,t),r!==null)?r/si(n):n.months&&(r=this.diffWholeMonths(e,t),r!==null)?r/ci(n):n.days&&(r=Ci(e,t),r!==null)?r/li(n):(t.valueOf()-e.valueOf())/U(n)}startOf(e,t){return t===`year`?this.startOfYear(e):t===`month`?this.startOfMonth(e):t===`week`?this.startOfWeek(e):t===`day`?G(e):t===`hour`?wi(e):t===`minute`?Ti(e):t===`second`?Ei(e):null}startOfYear(e){return this.calendarSystem.arrayToMarker([this.calendarSystem.getMarkerYear(e)])}startOfMonth(e){return this.calendarSystem.arrayToMarker([this.calendarSystem.getMarkerYear(e),this.calendarSystem.getMarkerMonth(e)])}startOfWeek(e){return this.calendarSystem.arrayToMarker([this.calendarSystem.getMarkerYear(e),this.calendarSystem.getMarkerMonth(e),e.getUTCDate()-(e.getUTCDay()-this.weekDow+7)%7])}computeWeekNumber(e){return this.weekNumberFunc?this.weekNumberFunc(this.toDate(e)):Di(e,this.weekDow,this.weekDoy)}format(e,t,n={}){return t.format({marker:e,timeZoneOffset:n.forcedTzo==null?this.offsetForMarker(e):n.forcedTzo},this)}formatRange(e,t,n,r={}){return r.isEndExclusive&&(t=hi(t,-1)),n.formatRange({marker:e,timeZoneOffset:r.forcedStartTzo==null?this.offsetForMarker(e):r.forcedStartTzo},{marker:t,timeZoneOffset:r.forcedEndTzo==null?this.offsetForMarker(t):r.forcedEndTzo},this,r.defaultSeparator)}formatIso(e,t={}){let n=null;return t.omitTimeZoneOffset||(n=t.forcedTzo==null?this.offsetForMarker(e):t.forcedTzo),Fi(e,n,t.omitTime)}timestampToMarker(e){return this.timeZone===`local`?K(Ai(new Date(e))):this.timeZone===`UTC`||!this.namedTimeZoneImpl?new Date(e):K(this.namedTimeZoneImpl.timestampToArray(e))}offsetForMarker(e){return this.timeZone===`local`?-ji(Mi(e)).getTimezoneOffset():this.timeZone===`UTC`?0:this.namedTimeZoneImpl?this.namedTimeZoneImpl.offsetForArray(Mi(e)):null}toDate(e,t){return this.timeZone===`local`?ji(Mi(e)):this.timeZone===`UTC`?new Date(e.valueOf()):this.namedTimeZoneImpl?new Date(e.valueOf()-this.namedTimeZoneImpl.offsetForArray(Mi(e))*1e3*60):new Date(e.valueOf()-(t||0))}},Ia=class{constructor(e){this.iconOverrideOption&&this.setIconOverride(e[this.iconOverrideOption])}setIconOverride(e){let t,n;if(typeof e==`object`&&e){for(n in t=Object.assign({},this.iconClasses),e)t[n]=this.applyIconOverridePrefix(e[n]);this.iconClasses=t}else e===!1&&(this.iconClasses={})}applyIconOverridePrefix(e){let t=this.iconOverridePrefix;return t&&e.indexOf(t)!==0&&(e=t+e),e}getClass(e){return this.classes[e]||``}getIconClass(e,t){let n;return n=t&&this.rtlIconClasses&&this.rtlIconClasses[e]||this.iconClasses[e],n?`${this.baseIconClass} ${n}`:``}getCustomButtonIconClass(e){let t;return this.iconOverrideCustomButtonOption&&(t=e[this.iconOverrideCustomButtonOption],t)?`${this.baseIconClass} ${this.applyIconOverridePrefix(t)}`:``}};Ia.prototype.classes={},Ia.prototype.iconClasses={},Ia.prototype.baseIconClass=``,Ia.prototype.iconOverridePrefix=``;function La(e){e();let t=I.debounceRendering,n=[];function r(e){n.push(e)}for(I.debounceRendering=r,kn(L(Ra,{}),document.createElement(`div`));n.length;)n.shift()();I.debounceRendering=t}var Ra=class extends B{render(){return L(`div`,{})}componentDidMount(){this.setState({})}};function za(e){let t=An(e),n=t.Provider;return t.Provider=function(){let e=!this.getChildContext,t=n.apply(this,arguments);if(e){let e=[];this.shouldComponentUpdate=t=>{this.props.value!==t.value&&e.forEach(e=>{e.context=t.value,e.forceUpdate()})},this.sub=t=>{e.push(t);let n=t.componentWillUnmount;t.componentWillUnmount=()=>{e.splice(e.indexOf(t),1),n&&n.call(t)}}}return t},t}var Ba=class{constructor(e,t,n,r){this.execFunc=e,this.emitter=t,this.scrollTime=n,this.scrollTimeReset=r,this.handleScrollRequest=e=>{this.queuedRequest=Object.assign({},this.queuedRequest||{},e),this.drain()},t.on(`_scrollRequest`,this.handleScrollRequest),this.fireInitialScroll()}detach(){this.emitter.off(`_scrollRequest`,this.handleScrollRequest)}update(e){e&&this.scrollTimeReset?this.fireInitialScroll():this.drain()}fireInitialScroll(){this.handleScrollRequest({time:this.scrollTime})}drain(){this.queuedRequest&&this.execFunc(this.queuedRequest)&&(this.queuedRequest=null)}},Va=za({});function Ha(e,t,n,r,i,a,o,s,c,l,u,d,f,p){return{dateEnv:i,nowManager:a,options:n,pluginHooks:s,emitter:u,dispatch:c,getCurrentData:l,calendarApi:d,viewSpec:e,viewApi:t,dateProfileGenerator:r,theme:o,isRtl:n.direction===`rtl`,addResizeHandler(e){u.on(`_resize`,e)},removeResizeHandler(e){u.off(`_resize`,e)},createScrollResponder(e){return new Ba(e,u,H(n.scrollTime),n.scrollTimeReset)},registerInteractiveComponent:f,unregisterInteractiveComponent:p}}var Ua=class extends B{shouldComponentUpdate(e,t){return!Da(this.props,e,this.propEquality)||!Da(this.state,t,this.stateEquality)}safeSetState(e){Da(this.state,Object.assign(Object.assign({},this.state),e),this.stateEquality)||this.setState(e)}};Ua.addPropsEquality=Wa,Ua.addStateEquality=Ga,Ua.contextType=Va,Ua.prototype.propEquality={},Ua.prototype.stateEquality={};var Z=class extends Ua{};Z.contextType=Va;function Wa(e){let t=Object.create(this.prototype.propEquality);Object.assign(t,e),this.prototype.propEquality=t}function Ga(e){let t=Object.create(this.prototype.stateEquality);Object.assign(t,e),this.prototype.stateEquality=t}function Q(e,t){typeof e==`function`?e(t):e&&(e.current=t)}var Ka=class extends Z{constructor(){super(...arguments),this.id=Wr(),this.queuedDomNodes=[],this.currentDomNodes=[],this.handleEl=e=>{let{options:t}=this.context,{generatorName:n}=this.props;(!t.customRenderingReplaces||!qa(n,t))&&this.updateElRef(e)},this.updateElRef=e=>{this.props.elRef&&Q(this.props.elRef,e)}}render(){let{props:e,context:t}=this,{options:n}=t,{customGenerator:r,defaultGenerator:i,renderProps:a}=e,o=Ja(e,[],this.handleEl),s=!1,c,l=[],u;if(r!=null){let e=typeof r==`function`?r(a,L):r;if(e===!0)s=!0;else{let t=e&&typeof e==`object`;t&&`html`in e?o.dangerouslySetInnerHTML={__html:e.html}:t&&`domNodes`in e?l=Array.prototype.slice.call(e.domNodes):(t?Yt(e):typeof e!=`function`)?c=e:u=e}}else s=!qa(e.generatorName,n);return s&&i&&(c=i(a)),this.queuedDomNodes=l,this.currentGeneratorMeta=u,L(e.elTag,o,c)}componentDidMount(){this.applyQueueudDomNodes(),this.triggerCustomRendering(!0)}componentDidUpdate(){this.applyQueueudDomNodes(),this.triggerCustomRendering(!0)}componentWillUnmount(){this.triggerCustomRendering(!1)}triggerCustomRendering(e){let{props:t,context:n}=this,{handleCustomRendering:r,customRenderingMetaMap:i}=n.options;if(r){let n=this.currentGeneratorMeta??i?.[t.generatorName];n&&r(Object.assign(Object.assign({id:this.id,isActive:e,containerEl:this.base,reportNewContainerEl:this.updateElRef,generatorMeta:n},t),{elClasses:(t.elClasses||[]).filter(Ya)}))}}applyQueueudDomNodes(){let{queuedDomNodes:e,currentDomNodes:t}=this,n=this.base;if(!fi(e,t)){t.forEach(Or);for(let t of e)n.appendChild(t);this.currentDomNodes=e}}};Ka.addPropsEquality({elClasses:fi,elStyle:X,elAttrs:Ta,renderProps:X});function qa(e,t){return!!(t.handleCustomRendering&&e&&t.customRenderingMetaMap?.[e])}function Ja(e,t,n){let r=Object.assign(Object.assign({},e.elAttrs),{ref:n});return(e.elClasses||t)&&(r.className=(e.elClasses||[]).concat(t||[]).concat(r.className||[]).filter(Boolean).join(` `)),e.elStyle&&(r.style=e.elStyle),r}function Ya(e){return!!e}var Xa=za(0),$=class extends B{constructor(){super(...arguments),this.InnerContent=Za.bind(void 0,this),this.handleEl=e=>{this.el=e,this.props.elRef&&(Q(this.props.elRef,e),e&&this.didMountMisfire&&this.componentDidMount())}}render(){let{props:e}=this,t=Qa(e.classNameGenerator,e.renderProps);if(e.children){let n=Ja(e,t,this.handleEl),r=e.children(this.InnerContent,e.renderProps,n);return e.elTag?L(e.elTag,n,r):r}else return L(Ka,Object.assign(Object.assign({},e),{elRef:this.handleEl,elTag:e.elTag||`div`,elClasses:(e.elClasses||[]).concat(t),renderId:this.context}))}componentDidMount(){var e,t;this.el?(t=(e=this.props).didMount)==null||t.call(e,Object.assign(Object.assign({},this.props.renderProps),{el:this.el})):this.didMountMisfire=!0}componentWillUnmount(){var e,t;(t=(e=this.props).willUnmount)==null||t.call(e,Object.assign(Object.assign({},this.props.renderProps),{el:this.el}))}};$.contextType=Xa;function Za(e,t){let n=e.props;return L(Ka,Object.assign({renderProps:n.renderProps,generatorName:n.generatorName,customGenerator:n.customGenerator,defaultGenerator:n.defaultGenerator,renderId:e.context},t))}function Qa(e,t){let n=typeof e==`function`?e(t):e||[];return typeof n==`string`?[n]:n}var $a=class extends Z{render(){let{props:e,context:t}=this,{options:n}=t,r={view:t.viewApi};return L($,{elRef:e.elRef,elTag:e.elTag||`div`,elAttrs:e.elAttrs,elClasses:[...eo(e.viewSpec),...e.elClasses||[]],elStyle:e.elStyle,renderProps:r,classNameGenerator:n.viewClassNames,generatorName:void 0,didMount:n.viewDidMount,willUnmount:n.viewWillUnmount},()=>e.children)}};function eo(e){return[`fc-${e.type}-view`,`fc-view`]}function to(e,t){let n=null,r=null;return e.start&&(n=t.createMarker(e.start)),e.end&&(r=t.createMarker(e.end)),!n&&!r||n&&r&&r<n?null:{start:n,end:r}}function no(e,t){let n=[],{start:r}=t,i,a;for(e.sort(ro),i=0;i<e.length;i+=1)a=e[i],a.start>r&&n.push({start:r,end:a.start}),a.end>r&&(r=a.end);return r<t.end&&n.push({start:r,end:t.end}),n}function ro(e,t){return e.start.valueOf()-t.start.valueOf()}function io(e,t){let{start:n,end:r}=e,i=null;return t.start!==null&&(n=n===null?t.start:new Date(Math.max(n.valueOf(),t.start.valueOf()))),t.end!=null&&(r=r===null?t.end:new Date(Math.min(r.valueOf(),t.end.valueOf()))),(n===null||r===null||n<r)&&(i={start:n,end:r}),i}function ao(e,t){return(e.end===null||t.start===null||e.end>t.start)&&(e.start===null||t.end===null||e.start<t.end)}function oo(e,t){return(e.start===null||t>=e.start)&&(e.end===null||t<e.end)}function so(e,t){return t.start!=null&&e<t.start?t.start:t.end!=null&&e>=t.end?new Date(t.end.valueOf()-1):e}function co(e){let t=Math.floor(_i(e.start,e.end))||1,n=G(e.start);return{start:n,end:W(n,t)}}function lo(e,t=H(0)){let n=null,r=null;if(e.end){r=G(e.end);let n=e.end.valueOf()-r.valueOf();n&&n>=U(t)&&(r=W(r,1))}return e.start&&(n=G(e.start),r&&r<=n&&(r=W(n,1))),{start:n,end:r}}function uo(e,t,n,r){return r===`year`?H(n.diffWholeYears(e,t),`year`):r===`month`?H(n.diffWholeMonths(e,t),`month`):xi(e,t)}var fo=class{constructor(e){this.props=e,this.initHiddenDays()}buildPrev(e,t,n){let{dateEnv:r}=this.props,i=r.subtract(r.startOf(t,e.currentRangeUnit),e.dateIncrement);return this.build(i,-1,n)}buildNext(e,t,n){let{dateEnv:r}=this.props,i=r.add(r.startOf(t,e.currentRangeUnit),e.dateIncrement);return this.build(i,1,n)}build(e,t,n=!0){let{props:r}=this,i,a,o,s,c,l;return i=this.buildValidRange(),i=this.trimHiddenDays(i),n&&(e=so(e,i)),a=this.buildCurrentRangeInfo(e,t),o=/^(year|month|week|day)$/.test(a.unit),s=this.buildRenderRange(this.trimHiddenDays(a.range),a.unit,o),s=this.trimHiddenDays(s),c=s,r.showNonCurrentDates||(c=io(c,a.range)),c=this.adjustActiveRange(c),c=io(c,i),l=ao(a.range,i),oo(s,e)||(e=s.start),{currentDate:e,validRange:i,currentRange:a.range,currentRangeUnit:a.unit,isRangeAllDay:o,activeRange:c,renderRange:s,slotMinTime:r.slotMinTime,slotMaxTime:r.slotMaxTime,isValid:l,dateIncrement:this.buildDateIncrement(a.duration)}}buildValidRange(){let e=this.props.validRangeInput,t=typeof e==`function`?e.call(this.props.calendarApi,this.props.dateEnv.toDate(this.props.nowManager.getDateMarker())):e;return this.refineRange(t)||{start:null,end:null}}buildCurrentRangeInfo(e,t){let{props:n}=this,r=null,i=null,a=null,o;return n.duration?(r=n.duration,i=n.durationUnit,a=this.buildRangeFromDuration(e,t,r,i)):(o=this.props.dayCount)?(i=`day`,a=this.buildRangeFromDayCount(e,t,o)):(a=this.buildCustomVisibleRange(e))?i=n.dateEnv.greatestWholeUnit(a.start,a.end).unit:(r=this.getFallbackDuration(),i=di(r).unit,a=this.buildRangeFromDuration(e,t,r,i)),{duration:r,unit:i,range:a}}getFallbackDuration(){return H({day:1})}adjustActiveRange(e){let{dateEnv:t,usesMinMaxTime:n,slotMinTime:r,slotMaxTime:i}=this.props,{start:a,end:o}=e;return n&&(li(r)<0&&(a=G(a),a=t.add(a,r)),li(i)>1&&(o=G(o),o=W(o,-1),o=t.add(o,i))),{start:a,end:o}}buildRangeFromDuration(e,t,n,r){let{dateEnv:i,dateAlignment:a}=this.props,o,s,c;if(!a){let{dateIncrement:e}=this.props;a=e&&U(e)<U(n)?di(e).unit:r}li(n)<=1&&this.isHiddenDay(o)&&(o=this.skipHiddenDays(o,t),o=G(o));function l(){o=i.startOf(e,a),s=i.add(o,n),c={start:o,end:s}}return l(),this.trimHiddenDays(c)||(e=this.skipHiddenDays(e,t),l()),c}buildRangeFromDayCount(e,t,n){let{dateEnv:r,dateAlignment:i}=this.props,a=0,o=e,s;i&&(o=r.startOf(o,i)),o=G(o),o=this.skipHiddenDays(o,t),s=o;do s=W(s,1),this.isHiddenDay(s)||(a+=1);while(a<n);return{start:o,end:s}}buildCustomVisibleRange(e){let{props:t}=this,n=t.visibleRangeInput,r=typeof n==`function`?n.call(t.calendarApi,t.dateEnv.toDate(e)):n,i=this.refineRange(r);return i&&(i.start==null||i.end==null)?null:i}buildRenderRange(e,t,n){return e}buildDateIncrement(e){let{dateIncrement:t}=this.props,n;return t||((n=this.props.dateAlignment)?H(1,n):e||H({days:1}))}refineRange(e){if(e){let t=to(e,this.props.dateEnv);return t&&=lo(t),t}return null}initHiddenDays(){let e=this.props.hiddenDays||[],t=[],n=0,r;for(this.props.weekends===!1&&e.push(0,6),r=0;r<7;r+=1)(t[r]=e.indexOf(r)!==-1)||(n+=1);if(!n)throw Error(`invalid hiddenDays`);this.isHiddenDayHash=t}trimHiddenDays(e){let{start:t,end:n}=e;return t&&=this.skipHiddenDays(t),n&&=this.skipHiddenDays(n,-1,!0),t==null||n==null||t<n?{start:t,end:n}:null}isHiddenDay(e){return e instanceof Date&&(e=e.getUTCDay()),this.isHiddenDayHash[e]}skipHiddenDays(e,t=1,n=!1){for(;this.isHiddenDayHash[(e.getUTCDay()+(n?t:0)+7)%7];)e=W(e,t);return e}};function po(e,t,n,r){return{instanceId:Wr(),defId:e,range:t,forcedStartTzo:n??null,forcedEndTzo:r??null}}function mo(e,t,n,r){for(let i=0;i<r.length;i+=1){let a=r[i].parse(e,n);if(a){let{allDay:n}=e;return n??(n=t,n??(n=a.allDayGuess,n??=!1)),{allDay:n,duration:a.duration,typeData:a.typeData,typeId:i}}}return null}function ho(e,t,n){let{dateEnv:r,pluginHooks:i,options:a}=n,{defs:o,instances:s}=e;s=ba(s,e=>!o[e.defId].recurringDef);for(let e in o){let n=o[e];if(n.recurringDef){let{duration:o}=n.recurringDef;o||=n.allDay?a.defaultAllDayEventDuration:a.defaultTimedEventDuration;let c=go(n,o,t,r,i.recurringTypes);for(let t of c){let n=po(e,{start:t,end:r.add(t,o)});s[n.instanceId]=n}}}return{defs:o,instances:s}}function go(e,t,n,r,i){let a=i[e.recurringDef.typeId].expand(e.recurringDef.typeData,{start:r.subtract(n.start,t),end:n.end},r);return e.allDay&&(a=a.map(G)),a}var _o={id:String,groupId:String,title:String,url:String,interactive:Boolean},vo={start:Y,end:Y,date:Y,allDay:Boolean},yo=Object.assign(Object.assign(Object.assign({},_o),vo),{extendedProps:Y});function bo(e,t,n,r,i=So(n),a,o){let{refined:s,extra:c}=xo(e,n,i),l=To(t,n),u=mo(s,l,n.dateEnv,n.pluginHooks.recurringTypes);if(u){let e=Co(s,c,t?t.sourceId:``,u.allDay,!!u.duration,n,a);return e.recurringDef={typeId:u.typeId,typeData:u.typeData,duration:u.duration},{def:e,instance:null}}let d=wo(s,l,n,r);if(d){let e=Co(s,c,t?t.sourceId:``,d.allDay,d.hasEnd,n,a),r=po(e.defId,d.range,d.forcedStartTzo,d.forcedEndTzo);return o&&e.publicId&&o[e.publicId]&&(r.instanceId=o[e.publicId]),{def:e,instance:r}}return null}function xo(e,t,n=So(t)){return _a(e,n)}function So(e){return Object.assign(Object.assign(Object.assign({},Io),yo),e.pluginHooks.eventRefiners)}function Co(e,t,n,r,i,a,o){let s={title:e.title||``,groupId:e.groupId||``,publicId:e.id||``,url:e.url||``,recurringDef:null,defId:(o&&e.id?o[e.id]:``)||Wr(),sourceId:n,allDay:r,hasEnd:i,interactive:e.interactive,ui:Ro(e,a),extendedProps:Object.assign(Object.assign({},e.extendedProps||{}),t)};for(let t of a.pluginHooks.eventDefMemberAdders)Object.assign(s,t(e));return Object.freeze(s.ui.classNames),Object.freeze(s.extendedProps),s}function wo(e,t,n,r){let{allDay:i}=e,a,o=null,s=!1,c,l=null,u=e.start==null?e.date:e.start;if(a=n.dateEnv.createMarkerMeta(u),a)o=a.marker;else if(!r)return null;return e.end!=null&&(c=n.dateEnv.createMarkerMeta(e.end)),i??=t??((!a||a.isTimeUnspecified)&&(!c||c.isTimeUnspecified)),i&&o&&(o=G(o)),c&&(l=c.marker,i&&(l=G(l)),o&&l<=o&&(l=null)),l?s=!0:r||(s=n.options.forceEventDuration||!1,l=n.dateEnv.add(o,i?n.options.defaultAllDayEventDuration:n.options.defaultTimedEventDuration)),{allDay:i,hasEnd:s,range:{start:o,end:l},forcedStartTzo:a?a.forcedTzo:null,forcedEndTzo:c?c.forcedTzo:null}}function To(e,t){let n=null;return e&&(n=e.defaultAllDay),n??=t.options.defaultAllDay,n}function Eo(e,t,n,r,i,a){let o=Ao(),s=So(n);for(let c of e){let e=bo(c,t,n,r,s,i,a);e&&Do(e,o)}return o}function Do(e,t=Ao()){return t.defs[e.def.defId]=e.def,e.instance&&(t.instances[e.instance.instanceId]=e.instance),t}function Oo(e,t){let n=e.instances[t];if(n){let t=e.defs[n.defId],r=Mo(e,e=>ko(t,e));return r.defs[t.defId]=t,r.instances[n.instanceId]=n,r}return Ao()}function ko(e,t){return!!(e.groupId&&e.groupId===t.groupId)}function Ao(){return{defs:{},instances:{}}}function jo(e,t){return{defs:Object.assign(Object.assign({},e.defs),t.defs),instances:Object.assign(Object.assign({},e.instances),t.instances)}}function Mo(e,t){let n=ba(e.defs,t);return{defs:n,instances:ba(e.instances,e=>n[e.defId])}}function No(e,t){let{defs:n,instances:r}=e,i={},a={};for(let e in n)t.defs[e]||(i[e]=n[e]);for(let e in r)!t.instances[e]&&i[r[e].defId]&&(a[e]=r[e]);return{defs:i,instances:a}}function Po(e,t){return Array.isArray(e)?Eo(e,null,t,!0):typeof e==`object`&&e?Eo([e],null,t,!0):e==null?null:String(e)}function Fo(e){return Array.isArray(e)?e:typeof e==`string`?e.split(/\s+/):[]}var Io={display:String,editable:Boolean,startEditable:Boolean,durationEditable:Boolean,constraint:Y,overlap:Y,allow:Y,className:Fo,classNames:Fo,color:String,backgroundColor:String,borderColor:String,textColor:String},Lo={display:null,startEditable:null,durationEditable:null,constraints:[],overlap:null,allows:[],backgroundColor:``,borderColor:``,textColor:``,classNames:[]};function Ro(e,t){let n=Po(e.constraint,t);return{display:e.display||null,startEditable:e.startEditable==null?e.editable:e.startEditable,durationEditable:e.durationEditable==null?e.editable:e.durationEditable,constraints:n==null?[]:[n],overlap:e.overlap==null?null:e.overlap,allows:e.allow==null?[]:[e.allow],backgroundColor:e.backgroundColor||e.color||``,borderColor:e.borderColor||e.color||``,textColor:e.textColor||``,classNames:(e.className||[]).concat(e.classNames||[])}}function zo(e){return e.reduce(Bo,Lo)}function Bo(e,t){return{display:t.display==null?e.display:t.display,startEditable:t.startEditable==null?e.startEditable:t.startEditable,durationEditable:t.durationEditable==null?e.durationEditable:t.durationEditable,constraints:e.constraints.concat(t.constraints),overlap:typeof t.overlap==`boolean`?t.overlap:e.overlap,allows:e.allows.concat(t.allows),backgroundColor:t.backgroundColor||e.backgroundColor,borderColor:t.borderColor||e.borderColor,textColor:t.textColor||e.textColor,classNames:e.classNames.concat(t.classNames)}}var Vo={id:String,defaultAllDay:Boolean,url:String,format:String,events:Y,eventDataTransform:Y,success:Y,failure:Y};function Ho(e,t,n=Uo(t)){let r;if(typeof e==`string`?r={url:e}:typeof e==`function`||Array.isArray(e)?r={events:e}:typeof e==`object`&&e&&(r=e),r){let{refined:i,extra:a}=_a(r,n),o=Wo(i,t);if(o)return{_raw:e,isFetching:!1,latestFetchId:``,fetchRange:null,defaultAllDay:i.defaultAllDay,eventDataTransform:i.eventDataTransform,success:i.success,failure:i.failure,publicId:i.id||``,sourceId:Wr(),sourceDefId:o.sourceDefId,meta:o.meta,ui:Ro(i,t),extendedProps:a}}return null}function Uo(e){return Object.assign(Object.assign(Object.assign({},Io),Vo),e.pluginHooks.eventSourceRefiners)}function Wo(e,t){let n=t.pluginHooks.eventSourceDefs;for(let t=n.length-1;t>=0;--t){let r=n[t].parseMeta(e);if(r)return{sourceDefId:t,meta:r}}return null}function Go(e,t,n,r,i){switch(t.type){case`RECEIVE_EVENTS`:return Ko(e,n[t.sourceId],t.fetchId,t.fetchRange,t.rawEvents,i);case`RESET_RAW_EVENTS`:return qo(e,n[t.sourceId],t.rawEvents,r.activeRange,i);case`ADD_EVENTS`:return Xo(e,t.eventStore,r?r.activeRange:null,i);case`RESET_EVENTS`:return t.eventStore;case`MERGE_EVENTS`:return jo(e,t.eventStore);case`PREV`:case`NEXT`:case`CHANGE_DATE`:case`CHANGE_VIEW_TYPE`:return r?ho(e,r.activeRange,i):e;case`REMOVE_EVENTS`:return No(e,t.eventStore);case`REMOVE_EVENT_SOURCE`:return Qo(e,t.sourceId);case`REMOVE_ALL_EVENT_SOURCES`:return Mo(e,e=>!e.sourceId);case`REMOVE_ALL_EVENTS`:return Ao();default:return e}}function Ko(e,t,n,r,i,a){if(t&&n===t.latestFetchId){let n=Eo(Jo(i,t,a),t,a);return r&&(n=ho(n,r,a)),jo(Qo(e,t.sourceId),n)}return e}function qo(e,t,n,r,i){let{defIdMap:a,instanceIdMap:o}=$o(e);return ho(Eo(Jo(n,t,i),t,i,!1,a,o),r,i)}function Jo(e,t,n){let r=n.options.eventDataTransform,i=t?t.eventDataTransform:null;return i&&(e=Yo(e,i)),r&&(e=Yo(e,r)),e}function Yo(e,t){let n;if(!t)n=e;else{n=[];for(let r of e){let e=t(r);e?n.push(e):e??n.push(r)}}return n}function Xo(e,t,n,r){return n&&(t=ho(t,n,r)),jo(e,t)}function Zo(e,t,n){let{defs:r}=e;return{defs:r,instances:xa(e.instances,e=>r[e.defId].allDay?e:Object.assign(Object.assign({},e),{range:{start:n.createMarker(t.toDate(e.range.start,e.forcedStartTzo)),end:n.createMarker(t.toDate(e.range.end,e.forcedEndTzo))},forcedStartTzo:n.canComputeOffset?null:e.forcedStartTzo,forcedEndTzo:n.canComputeOffset?null:e.forcedEndTzo}))}}function Qo(e,t){return Mo(e,e=>e.sourceId!==t)}function $o(e){let{defs:t,instances:n}=e,r={},i={};for(let e in t){let{publicId:n}=t[e];n&&(r[n]=e)}for(let e in n){let{publicId:r}=t[n[e].defId];r&&(i[r]=e)}return{defIdMap:r,instanceIdMap:i}}var es=class{constructor(){this.handlers={},this.thisContext=null}setThisContext(e){this.thisContext=e}setOptions(e){this.options=e}on(e,t){ts(this.handlers,e,t)}off(e,t){ns(this.handlers,e,t)}trigger(e,...t){let n=this.handlers[e]||[],r=this.options&&this.options[e],i=[].concat(r||[],n);for(let e of i)e.apply(this.thisContext,t)}hasHandlers(e){return!!(this.handlers[e]&&this.handlers[e].length||this.options&&this.options[e])}};function ts(e,t,n){(e[t]||(e[t]=[])).push(n)}function ns(e,t,n){n?e[t]&&(e[t]=e[t].filter(e=>e!==n)):delete e[t]}var rs={startTime:`09:00`,endTime:`17:00`,daysOfWeek:[1,2,3,4,5],display:`inverse-background`,classNames:`fc-non-business`,groupId:`_businessHours`};function is(e,t){return Eo(as(e),null,t)}function as(e){let t;return t=e===!0?[{}]:Array.isArray(e)?e.filter(e=>e.daysOfWeek):typeof e==`object`&&e?[e]:[],t=t.map(e=>Object.assign(Object.assign({},rs),e)),t}function os(e,t,n){n.emitter.trigger(`select`,Object.assign(Object.assign({},cs(e,n)),{jsEvent:t?t.origEvent:null,view:n.viewApi||n.calendarApi.view}))}function ss(e,t){t.emitter.trigger(`unselect`,{jsEvent:e?e.origEvent:null,view:t.viewApi||t.calendarApi.view})}function cs(e,t){let n={};for(let r of t.pluginHooks.dateSpanTransforms)Object.assign(n,r(e,t));return Object.assign(n,Is(e,t.dateEnv)),n}function ls(e,t,n){let{dateEnv:r,options:i}=n,a=t;return e?(a=G(a),a=r.add(a,i.defaultAllDayEventDuration)):a=r.add(a,i.defaultTimedEventDuration),a}function us(e,t,n,r){let i=xs(e.defs,t),a=Ao();for(let t in e.defs){let o=e.defs[t];a.defs[t]=ds(o,i[t],n,r)}for(let t in e.instances){let o=e.instances[t],s=a.defs[o.defId];a.instances[t]=fs(o,s,i[o.defId],n,r)}return a}function ds(e,t,n,r){let i=n.standardProps||{};i.hasEnd==null&&t.durationEditable&&(n.startDelta||n.endDelta)&&(i.hasEnd=!0);let a=Object.assign(Object.assign(Object.assign({},e),i),{ui:Object.assign(Object.assign({},e.ui),i.ui)});n.extendedProps&&(a.extendedProps=Object.assign(Object.assign({},a.extendedProps),n.extendedProps));for(let e of r.pluginHooks.eventDefMutationAppliers)e(a,n,r);return!a.hasEnd&&r.options.forceEventDuration&&(a.hasEnd=!0),a}function fs(e,t,n,r,i){let{dateEnv:a}=i,o=r.standardProps&&r.standardProps.allDay===!0,s=r.standardProps&&r.standardProps.hasEnd===!1,c=Object.assign({},e);return o&&(c.range=co(c.range)),r.datesDelta&&n.startEditable&&(c.range={start:a.add(c.range.start,r.datesDelta),end:a.add(c.range.end,r.datesDelta)}),r.startDelta&&n.durationEditable&&(c.range={start:a.add(c.range.start,r.startDelta),end:c.range.end}),r.endDelta&&n.durationEditable&&(c.range={start:c.range.start,end:a.add(c.range.end,r.endDelta)}),s&&(c.range={start:c.range.start,end:ls(t.allDay,c.range.start,i)}),t.allDay&&(c.range={start:G(c.range.start),end:G(c.range.end)}),c.range.end<c.range.start&&(c.range.end=ls(t.allDay,c.range.start,i)),c}var ps=class{constructor(e,t){this.context=e,this.internalEventSource=t}remove(){this.context.dispatch({type:`REMOVE_EVENT_SOURCE`,sourceId:this.internalEventSource.sourceId})}refetch(){this.context.dispatch({type:`FETCH_EVENT_SOURCES`,sourceIds:[this.internalEventSource.sourceId],isRefetch:!0})}get id(){return this.internalEventSource.publicId}get url(){return this.internalEventSource.meta.url}get format(){return this.internalEventSource.meta.format}},ms=class e{constructor(e,t,n){this._context=e,this._def=t,this._instance=n||null}setProp(e,t){if(e in vo)console.warn(`Could not set date-related prop 'name'. Use one of the date-related methods instead.`);else if(e===`id`)t=_o[e](t),this.mutate({standardProps:{publicId:t}});else if(e in _o)t=_o[e](t),this.mutate({standardProps:{[e]:t}});else if(e in Io){let n=Io[e](t);n=e===`color`?{backgroundColor:t,borderColor:t}:e===`editable`?{startEditable:t,durationEditable:t}:{[e]:t},this.mutate({standardProps:{ui:n}})}else console.warn(`Could not set prop '${e}'. Use setExtendedProp instead.`)}setExtendedProp(e,t){this.mutate({extendedProps:{[e]:t}})}setStart(e,t={}){let{dateEnv:n}=this._context,r=n.createMarker(e);if(r&&this._instance){let e=this._instance.range,i=uo(e.start,r,n,t.granularity);t.maintainDuration?this.mutate({datesDelta:i}):this.mutate({startDelta:i})}}setEnd(e,t={}){let{dateEnv:n}=this._context,r;if(!(e!=null&&(r=n.createMarker(e),!r))&&this._instance)if(r){let e=uo(this._instance.range.end,r,n,t.granularity);this.mutate({endDelta:e})}else this.mutate({standardProps:{hasEnd:!1}})}setDates(e,t,n={}){let{dateEnv:r}=this._context,i={allDay:n.allDay},a=r.createMarker(e),o;if(a&&!(t!=null&&(o=r.createMarker(t),!o))&&this._instance){let e=this._instance.range;n.allDay===!0&&(e=co(e));let t=uo(e.start,a,r,n.granularity);if(o){let a=uo(e.end,o,r,n.granularity);ri(t,a)?this.mutate({datesDelta:t,standardProps:i}):this.mutate({startDelta:t,endDelta:a,standardProps:i})}else i.hasEnd=!1,this.mutate({datesDelta:t,standardProps:i})}}moveStart(e){let t=H(e);t&&this.mutate({startDelta:t})}moveEnd(e){let t=H(e);t&&this.mutate({endDelta:t})}moveDates(e){let t=H(e);t&&this.mutate({datesDelta:t})}setAllDay(e,t={}){let n={allDay:e},{maintainDuration:r}=t;r??=this._context.options.allDayMaintainDuration,this._def.allDay!==e&&(n.hasEnd=r),this.mutate({standardProps:n})}formatRange(e){let{dateEnv:t}=this._context,n=this._instance,r=J(e);return this._def.hasEnd?t.formatRange(n.range.start,n.range.end,r,{forcedStartTzo:n.forcedStartTzo,forcedEndTzo:n.forcedEndTzo}):t.format(n.range.start,r,{forcedTzo:n.forcedStartTzo})}mutate(t){let n=this._instance;if(n){let r=this._def,i=this._context,{eventStore:a}=i.getCurrentData(),o=Oo(a,n.instanceId);o=us(o,{"":{display:``,startEditable:!0,durationEditable:!0,constraints:[],overlap:null,allows:[],backgroundColor:``,borderColor:``,textColor:``,classNames:[]}},t,i);let s=new e(i,r,n);this._def=o.defs[r.defId],this._instance=o.instances[n.instanceId],i.dispatch({type:`MERGE_EVENTS`,eventStore:o}),i.emitter.trigger(`eventChange`,{oldEvent:s,event:this,relatedEvents:gs(o,i,n),revert(){i.dispatch({type:`RESET_EVENTS`,eventStore:a})}})}}remove(){let e=this._context,t=hs(this);e.dispatch({type:`REMOVE_EVENTS`,eventStore:t}),e.emitter.trigger(`eventRemove`,{event:this,relatedEvents:[],revert(){e.dispatch({type:`MERGE_EVENTS`,eventStore:t})}})}get source(){let{sourceId:e}=this._def;return e?new ps(this._context,this._context.getCurrentData().eventSources[e]):null}get start(){return this._instance?this._context.dateEnv.toDate(this._instance.range.start):null}get end(){return this._instance&&this._def.hasEnd?this._context.dateEnv.toDate(this._instance.range.end):null}get startStr(){let e=this._instance;return e?this._context.dateEnv.formatIso(e.range.start,{omitTime:this._def.allDay,forcedTzo:e.forcedStartTzo}):``}get endStr(){let e=this._instance;return e&&this._def.hasEnd?this._context.dateEnv.formatIso(e.range.end,{omitTime:this._def.allDay,forcedTzo:e.forcedEndTzo}):``}get id(){return this._def.publicId}get groupId(){return this._def.groupId}get allDay(){return this._def.allDay}get title(){return this._def.title}get url(){return this._def.url}get display(){return this._def.ui.display||`auto`}get startEditable(){return this._def.ui.startEditable}get durationEditable(){return this._def.ui.durationEditable}get constraint(){return this._def.ui.constraints[0]||null}get overlap(){return this._def.ui.overlap}get allow(){return this._def.ui.allows[0]||null}get backgroundColor(){return this._def.ui.backgroundColor}get borderColor(){return this._def.ui.borderColor}get textColor(){return this._def.ui.textColor}get classNames(){return this._def.ui.classNames}get extendedProps(){return this._def.extendedProps}toPlainObject(e={}){let t=this._def,{ui:n}=t,{startStr:r,endStr:i}=this,a={allDay:t.allDay};return t.title&&(a.title=t.title),r&&(a.start=r),i&&(a.end=i),t.publicId&&(a.id=t.publicId),t.groupId&&(a.groupId=t.groupId),t.url&&(a.url=t.url),n.display&&n.display!==`auto`&&(a.display=n.display),e.collapseColor&&n.backgroundColor&&n.backgroundColor===n.borderColor?a.color=n.backgroundColor:(n.backgroundColor&&(a.backgroundColor=n.backgroundColor),n.borderColor&&(a.borderColor=n.borderColor)),n.textColor&&(a.textColor=n.textColor),n.classNames.length&&(a.classNames=n.classNames),Object.keys(t.extendedProps).length&&(e.collapseExtendedProps?Object.assign(a,t.extendedProps):a.extendedProps=t.extendedProps),a}toJSON(){return this.toPlainObject()}};function hs(e){let t=e._def,n=e._instance;return{defs:{[t.defId]:t},instances:n?{[n.instanceId]:n}:{}}}function gs(e,t,n){let{defs:r,instances:i}=e,a=[],o=n?n.instanceId:``;for(let e in i){let n=i[e],s=r[n.defId];n.instanceId!==o&&a.push(new ms(t,s,n))}return a}function _s(e,t,n,r){let i={},a={},o={},s=[],c=[],l=xs(e.defs,t);for(let t in e.defs){let n=e.defs[t];l[n.defId].display===`inverse-background`&&(n.groupId?(i[n.groupId]=[],o[n.groupId]||(o[n.groupId]=n)):a[t]=[])}for(let t in e.instances){let o=e.instances[t],u=e.defs[o.defId],d=l[u.defId],f=o.range,p=!u.allDay&&r?lo(f,r):f,m=io(p,n);m&&(d.display===`inverse-background`?u.groupId?i[u.groupId].push(m):a[o.defId].push(m):d.display!==`none`&&(d.display===`background`?s:c).push({def:u,ui:d,instance:o,range:m,isStart:p.start&&p.start.valueOf()===m.start.valueOf(),isEnd:p.end&&p.end.valueOf()===m.end.valueOf()}))}for(let e in i){let t=i[e],r=no(t,n);for(let t of r){let n=o[e],r=l[n.defId];s.push({def:n,ui:r,instance:null,range:t,isStart:!1,isEnd:!1})}}for(let t in a){let r=a[t],i=no(r,n);for(let n of i)s.push({def:e.defs[t],ui:l[t],instance:null,range:n,isStart:!1,isEnd:!1})}return{bg:s,fg:c}}function vs(e){return e.ui.display===`background`||e.ui.display===`inverse-background`}function ys(e,t){e.fcSeg=t}function bs(e){return e.fcSeg||e.parentNode.fcSeg||null}function xs(e,t){return xa(e,e=>Ss(e,t))}function Ss(e,t){let n=[];return t[``]&&n.push(t[``]),t[e.defId]&&n.push(t[e.defId]),n.push(e.ui),zo(n)}function Cs(e,t){let n=e.map(ws);return n.sort((e,n)=>Kr(e,n,t)),n.map(e=>e._seg)}function ws(e){let{eventRange:t}=e,n=t.def,r=t.instance?t.instance.range:t.range,i=r.start?r.start.valueOf():0,a=r.end?r.end.valueOf():0;return Object.assign(Object.assign(Object.assign({},n.extendedProps),n),{id:n.publicId,start:i,end:a,duration:a-i,allDay:Number(n.allDay),_seg:e})}function Ts(e,t){let{pluginHooks:n}=t,r=n.isDraggableTransformers,{def:i,ui:a}=e.eventRange,o=a.startEditable;for(let e of r)o=e(o,i,a,t);return o}function Es(e,t){return e.isStart&&e.eventRange.ui.durationEditable&&t.options.eventResizableFromStart}function Ds(e,t){return e.isEnd&&e.eventRange.ui.durationEditable}function Os(e,t,n,r,i,a,o){let{dateEnv:s,options:c}=n,{displayEventTime:l,displayEventEnd:u}=c,d=e.eventRange.def,f=e.eventRange.instance;l??=r!==!1,u??=i!==!1;let p=f.range.start,m=f.range.end,h=a||e.start||e.eventRange.range.start,g=o||e.end||e.eventRange.range.end,_=G(p).valueOf()===G(h).valueOf(),v=G(hi(m,-1)).valueOf()===G(hi(g,-1)).valueOf();return l&&!d.allDay&&(_||v)?(h=_?p:h,g=v?m:g,u&&d.hasEnd?s.formatRange(h,g,t,{forcedStartTzo:a?null:f.forcedStartTzo,forcedEndTzo:o?null:f.forcedEndTzo}):s.format(h,t,{forcedTzo:a?null:f.forcedStartTzo})):``}function ks(e,t,n){let r=e.eventRange.range;return{isPast:r.end<=(n||t.start),isFuture:r.start>=(n||t.end),isToday:t&&oo(t,r.start)}}function As(e){let t=[`fc-event`];return e.isMirror&&t.push(`fc-event-mirror`),e.isDraggable&&t.push(`fc-event-draggable`),(e.isStartResizable||e.isEndResizable)&&t.push(`fc-event-resizable`),e.isDragging&&t.push(`fc-event-dragging`),e.isResizing&&t.push(`fc-event-resizing`),e.isSelected&&t.push(`fc-event-selected`),e.isStart&&t.push(`fc-event-start`),e.isEnd&&t.push(`fc-event-end`),e.isPast&&t.push(`fc-event-past`),e.isToday&&t.push(`fc-event-today`),e.isFuture&&t.push(`fc-event-future`),t}function js(e){return e.instance?e.instance.instanceId:`${e.def.defId}:${e.range.start.toISOString()}`}function Ms(e,t){let{def:n,instance:r}=e.eventRange,{url:i}=n;if(i)return{href:i};let{emitter:a,options:o}=t,{eventInteractive:s}=o;return s??(s=n.interactive,s??=!!a.hasHandlers(`eventClick`)),s?Hr(e=>{a.trigger(`eventClick`,{el:e.target,event:new ms(t,n,r),jsEvent:e,view:t.viewApi})}):{}}var Ns={start:Y,end:Y,allDay:Boolean};function Ps(e,t,n){let r=Fs(e,t),{range:i}=r;if(!i.start)return null;if(!i.end){if(n==null)return null;i.end=t.add(i.start,n)}return r}function Fs(e,t){let{refined:n,extra:r}=_a(e,Ns),i=n.start?t.createMarkerMeta(n.start):null,a=n.end?t.createMarkerMeta(n.end):null,{allDay:o}=n;return o??=i&&i.isTimeUnspecified&&(!a||a.isTimeUnspecified),Object.assign({range:{start:i?i.marker:null,end:a?a.marker:null},allDay:o},r)}function Is(e,t){return Object.assign(Object.assign({},Rs(e.range,t,e.allDay)),{allDay:e.allDay})}function Ls(e,t,n){return Object.assign(Object.assign({},Rs(e,t,n)),{timeZone:t.timeZone})}function Rs(e,t,n){return{start:t.toDate(e.start),end:t.toDate(e.end),startStr:t.formatIso(e.start,{omitTime:n}),endStr:t.formatIso(e.end,{omitTime:n})}}function zs(e,t,n){let r=xo({editable:!1},n),i=Co(r.refined,r.extra,``,e.allDay,!0,n);return{def:i,ui:Ss(i,t),instance:po(i.defId,e.range),range:e.range,isStart:!0,isEnd:!0}}function Bs(e,t,n){let r=!1,i=function(e){r||(r=!0,t(e))},a=function(e){r||(r=!0,n(e))},o=e(i,a);o&&typeof o.then==`function`&&o.then(i,a)}var Vs=class extends Error{constructor(e,t){super(e),this.response=t}};function Hs(e,t,n){e=e.toUpperCase();let r={method:e};return e===`GET`?t+=(t.indexOf(`?`)===-1?`?`:`&`)+new URLSearchParams(n):(r.body=new URLSearchParams(n),r.headers={"Content-Type":`application/x-www-form-urlencoded`}),fetch(t,r).then(e=>{if(e.ok)return e.json().then(t=>[t,e],()=>{throw new Vs(`Failure parsing JSON`,e)});throw new Vs(`Request failed`,e)})}var Us;function Ws(){return Us??=Gs(),Us}function Gs(){if(typeof document>`u`)return!0;let e=document.createElement(`div`);e.style.position=`absolute`,e.style.top=`0px`,e.style.left=`0px`,e.innerHTML=`<table><tr><td><div></div></td></tr></table>`,e.querySelector(`table`).style.height=`100px`,e.querySelector(`div`).style.height=`100%`,document.body.appendChild(e);let t=e.querySelector(`div`).offsetHeight>0;return document.body.removeChild(e),t}var Ks=class extends Z{constructor(){super(...arguments),this.state={forPrint:!1},this.handleBeforePrint=()=>{La(()=>{this.setState({forPrint:!0})})},this.handleAfterPrint=()=>{La(()=>{this.setState({forPrint:!1})})}}render(){let{props:e}=this,{options:t}=e,{forPrint:n}=this.state,r=n||t.height===`auto`||t.contentHeight===`auto`,i=!r&&t.height!=null?t.height:``,a=[`fc`,n?`fc-media-print`:`fc-media-screen`,`fc-direction-${t.direction}`,e.theme.getClass(`root`)];return Ws()||a.push(`fc-liquid-hack`),e.children(a,i,r,n)}componentDidMount(){let{emitter:e}=this.props;e.on(`_beforeprint`,this.handleBeforePrint),e.on(`_afterprint`,this.handleAfterPrint)}componentWillUnmount(){let{emitter:e}=this.props;e.off(`_beforeprint`,this.handleBeforePrint),e.off(`_afterprint`,this.handleAfterPrint)}},qs=class{constructor(e){this.component=e.component,this.isHitComboAllowed=e.isHitComboAllowed||null}destroy(){}};function Js(e,t){return{component:e,el:t.el,useEventCenter:t.useEventCenter==null?!0:t.useEventCenter,isHitComboAllowed:t.isHitComboAllowed||null}}var Ys={},Xs=class extends B{constructor(e,t){super(e,t),this.handleRefresh=()=>{let e=this.computeTiming();e.state.nowDate.valueOf()!==this.state.nowDate.valueOf()&&this.setState(e.state),this.clearTimeout(),this.setTimeout(e.waitMs)},this.handleVisibilityChange=()=>{document.hidden||this.handleRefresh()},this.state=this.computeTiming().state}render(){let{props:e,state:t}=this;return e.children(t.nowDate,t.todayRange)}componentDidMount(){this.setTimeout(),this.context.nowManager.addResetListener(this.handleRefresh),document.addEventListener(`visibilitychange`,this.handleVisibilityChange)}componentDidUpdate(e){e.unit!==this.props.unit&&(this.clearTimeout(),this.setTimeout())}componentWillUnmount(){this.clearTimeout(),this.context.nowManager.removeResetListener(this.handleRefresh),document.removeEventListener(`visibilitychange`,this.handleVisibilityChange)}computeTiming(){let{props:e,context:t}=this,n=t.nowManager.getDateMarker(),{nowIndicatorSnap:r}=t.options;r===`auto`&&(r=/year|month|week|day/.test(e.unit)||(e.unitValue||1)===1);let i,a;return r?(i=t.dateEnv.startOf(n,e.unit),a=t.dateEnv.add(i,H(1,e.unit)).valueOf()-n.valueOf()):(i=n,a=1e3*60),a=Math.min(1e3*60*60*24,a),{state:{nowDate:i,todayRange:Zs(i)},waitMs:a}}setTimeout(e=this.computeTiming().waitMs){this.timeoutId=setTimeout(()=>{let e=this.computeTiming();this.setState(e.state,()=>{this.setTimeout(e.waitMs)})},e)}clearTimeout(){this.timeoutId&&clearTimeout(this.timeoutId)}};Xs.contextType=Va;function Zs(e){let t=G(e);return{start:t,end:W(t,1)}}var Qs=class{getCurrentData(){return this.currentDataManager.getCurrentData()}dispatch(e){this.currentDataManager.dispatch(e)}get view(){return this.getCurrentData().viewApi}batchRendering(e){e()}updateSize(){this.trigger(`_resize`,!0)}setOption(e,t){this.dispatch({type:`SET_OPTION`,optionName:e,rawOptionValue:t})}getOption(e){return this.currentDataManager.currentCalendarOptionsInput[e]}getAvailableLocaleCodes(){return Object.keys(this.getCurrentData().availableRawLocales)}on(e,t){let{currentDataManager:n}=this;n.currentCalendarOptionsRefiners[e]?n.emitter.on(e,t):console.warn(`Unknown listener name '${e}'`)}off(e,t){this.currentDataManager.emitter.off(e,t)}trigger(e,...t){this.currentDataManager.emitter.trigger(e,...t)}changeView(e,t){this.batchRendering(()=>{if(this.unselect(),t)if(t.start&&t.end)this.dispatch({type:`CHANGE_VIEW_TYPE`,viewType:e}),this.dispatch({type:`SET_OPTION`,optionName:`visibleRange`,rawOptionValue:t});else{let{dateEnv:n}=this.getCurrentData();this.dispatch({type:`CHANGE_VIEW_TYPE`,viewType:e,dateMarker:n.createMarker(t)})}else this.dispatch({type:`CHANGE_VIEW_TYPE`,viewType:e})})}zoomTo(e,t){let n=this.getCurrentData(),r;t||=`day`,r=n.viewSpecs[t]||this.getUnitViewSpec(t),this.unselect(),r?this.dispatch({type:`CHANGE_VIEW_TYPE`,viewType:r.type,dateMarker:e}):this.dispatch({type:`CHANGE_DATE`,dateMarker:e})}getUnitViewSpec(e){let{viewSpecs:t,toolbarConfig:n}=this.getCurrentData(),r=[].concat(n.header?n.header.viewsWithButtons:[],n.footer?n.footer.viewsWithButtons:[]),i,a;for(let e in t)r.push(e);for(i=0;i<r.length;i+=1)if(a=t[r[i]],a&&a.singleUnit===e)return a;return null}prev(){this.unselect(),this.dispatch({type:`PREV`})}next(){this.unselect(),this.dispatch({type:`NEXT`})}prevYear(){let e=this.getCurrentData();this.unselect(),this.dispatch({type:`CHANGE_DATE`,dateMarker:e.dateEnv.addYears(e.currentDate,-1)})}nextYear(){let e=this.getCurrentData();this.unselect(),this.dispatch({type:`CHANGE_DATE`,dateMarker:e.dateEnv.addYears(e.currentDate,1)})}today(){let e=this.getCurrentData();this.unselect(),this.dispatch({type:`CHANGE_DATE`,dateMarker:e.nowManager.getDateMarker()})}gotoDate(e){let t=this.getCurrentData();this.unselect(),this.dispatch({type:`CHANGE_DATE`,dateMarker:t.dateEnv.createMarker(e)})}incrementDate(e){let t=this.getCurrentData(),n=H(e);n&&(this.unselect(),this.dispatch({type:`CHANGE_DATE`,dateMarker:t.dateEnv.add(t.currentDate,n)}))}getDate(){let e=this.getCurrentData();return e.dateEnv.toDate(e.currentDate)}formatDate(e,t){let{dateEnv:n}=this.getCurrentData();return n.format(n.createMarker(e),J(t))}formatRange(e,t,n){let{dateEnv:r}=this.getCurrentData();return r.formatRange(r.createMarker(e),r.createMarker(t),J(n),n)}formatIso(e,t){let{dateEnv:n}=this.getCurrentData();return n.formatIso(n.createMarker(e),{omitTime:t})}select(e,t){let n;n=t==null?e.start==null?{start:e,end:null}:e:{start:e,end:t};let r=this.getCurrentData(),i=Ps(n,r.dateEnv,H({days:1}));i&&(this.dispatch({type:`SELECT_DATES`,selection:i}),os(i,null,r))}unselect(e){let t=this.getCurrentData();t.dateSelection&&(this.dispatch({type:`UNSELECT_DATES`}),ss(e,t))}addEvent(e,t){if(e instanceof ms){let t=e._def,n=e._instance;return this.getCurrentData().eventStore.defs[t.defId]||(this.dispatch({type:`ADD_EVENTS`,eventStore:Do({def:t,instance:n})}),this.triggerEventAdd(e)),e}let n=this.getCurrentData(),r;if(t instanceof ps)r=t.internalEventSource;else if(typeof t==`boolean`)t&&([r]=Ca(n.eventSources));else if(t!=null){let e=this.getEventSourceById(t);if(!e)return console.warn(`Could not find an event source with ID "${t}"`),null;r=e.internalEventSource}let i=bo(e,r,n,!1);if(i){let e=new ms(n,i.def,i.def.recurringDef?null:i.instance);return this.dispatch({type:`ADD_EVENTS`,eventStore:Do(i)}),this.triggerEventAdd(e),e}return null}triggerEventAdd(e){let{emitter:t}=this.getCurrentData();t.trigger(`eventAdd`,{event:e,relatedEvents:[],revert:()=>{this.dispatch({type:`REMOVE_EVENTS`,eventStore:hs(e)})}})}getEventById(e){let t=this.getCurrentData(),{defs:n,instances:r}=t.eventStore;e=String(e);for(let i in n){let a=n[i];if(a.publicId===e){if(a.recurringDef)return new ms(t,a,null);for(let e in r){let n=r[e];if(n.defId===a.defId)return new ms(t,a,n)}}}return null}getEvents(){let e=this.getCurrentData();return gs(e.eventStore,e)}removeAllEvents(){this.dispatch({type:`REMOVE_ALL_EVENTS`})}getEventSources(){let e=this.getCurrentData(),t=e.eventSources,n=[];for(let r in t)n.push(new ps(e,t[r]));return n}getEventSourceById(e){let t=this.getCurrentData(),n=t.eventSources;e=String(e);for(let r in n)if(n[r].publicId===e)return new ps(t,n[r]);return null}addEventSource(e){let t=this.getCurrentData();if(e instanceof ps)return t.eventSources[e.internalEventSource.sourceId]||this.dispatch({type:`ADD_EVENT_SOURCES`,sources:[e.internalEventSource]}),e;let n=Ho(e,t);return n?(this.dispatch({type:`ADD_EVENT_SOURCES`,sources:[n]}),new ps(t,n)):null}removeAllEventSources(){this.dispatch({type:`REMOVE_ALL_EVENT_SOURCES`})}refetchEvents(){this.dispatch({type:`FETCH_EVENT_SOURCES`,isRefetch:!0})}scrollToTime(e){let t=H(e);t&&this.trigger(`_scrollRequest`,{time:t})}};function $s(e,t){let n={left:Math.max(e.left,t.left),right:Math.min(e.right,t.right),top:Math.max(e.top,t.top),bottom:Math.min(e.bottom,t.bottom)};return n.left<n.right&&n.top<n.bottom?n:!1}var ec=Ao(),tc=class{constructor(){this.getKeysForEventDefs=q(this._getKeysForEventDefs),this.splitDateSelection=q(this._splitDateSpan),this.splitEventStore=q(this._splitEventStore),this.splitIndividualUi=q(this._splitIndividualUi),this.splitEventDrag=q(this._splitInteraction),this.splitEventResize=q(this._splitInteraction),this.eventUiBuilders={}}splitProps(e){let t=this.getKeyInfo(e),n=this.getKeysForEventDefs(e.eventStore),r=this.splitDateSelection(e.dateSelection),i=this.splitIndividualUi(e.eventUiBases,n),a=this.splitEventStore(e.eventStore,n),o=this.splitEventDrag(e.eventDrag),s=this.splitEventResize(e.eventResize),c={};this.eventUiBuilders=xa(t,(e,t)=>this.eventUiBuilders[t]||q(nc));for(let n in t){let l=t[n],u=a[n]||ec,d=this.eventUiBuilders[n];c[n]={businessHours:l.businessHours||e.businessHours,dateSelection:r[n]||null,eventStore:u,eventUiBases:d(e.eventUiBases[``],l.ui,i[n]),eventSelection:u.instances[e.eventSelection]?e.eventSelection:``,eventDrag:o[n]||null,eventResize:s[n]||null}}return c}_splitDateSpan(e){let t={};if(e){let n=this.getKeysForDateSpan(e);for(let r of n)t[r]=e}return t}_getKeysForEventDefs(e){return xa(e.defs,e=>this.getKeysForEventDef(e))}_splitEventStore(e,t){let{defs:n,instances:r}=e,i={};for(let e in n)for(let r of t[e])i[r]||(i[r]=Ao()),i[r].defs[e]=n[e];for(let e in r){let n=r[e];for(let r of t[n.defId])i[r]&&(i[r].instances[e]=n)}return i}_splitIndividualUi(e,t){let n={};for(let r in e)if(r)for(let i of t[r])n[i]||(n[i]={}),n[i][r]=e[r];return n}_splitInteraction(e){let t={};if(e){let n=this._splitEventStore(e.affectedEvents,this._getKeysForEventDefs(e.affectedEvents)),r=this._getKeysForEventDefs(e.mutatedEvents),i=this._splitEventStore(e.mutatedEvents,r),a=r=>{t[r]||(t[r]={affectedEvents:n[r]||ec,mutatedEvents:i[r]||ec,isEvent:e.isEvent})};for(let e in n)a(e);for(let e in i)a(e)}return t}};function nc(e,t,n){let r=[];e&&r.push(e),t&&r.push(t);let i={"":zo(r)};return n&&Object.assign(i,n),i}function rc(e,t,n,r){return{dow:e.getUTCDay(),isDisabled:!!(r&&(!r.activeRange||!oo(r.activeRange,e))),isOther:!!(r&&!oo(r.currentRange,e)),isToday:!!(t&&oo(t,e)),isPast:!!(n?e<n:t&&e<t.start),isFuture:!!(n?e>n:t&&e>=t.end)}}function ic(e,t){let n=[`fc-day`,`fc-day-${pi[e.dow]}`];return e.isDisabled?n.push(`fc-day-disabled`):(e.isToday&&(n.push(`fc-day-today`),n.push(t.getClass(`today`))),e.isPast&&n.push(`fc-day-past`),e.isFuture&&n.push(`fc-day-future`),e.isOther&&n.push(`fc-day-other`)),n}var ac=J({year:`numeric`,month:`long`,day:`numeric`}),oc=J({week:`long`});function sc(e,t,n=`day`,r=!0){let{dateEnv:i,options:a,calendarApi:o}=e,s=i.format(t,n===`week`?oc:ac);if(a.navLinks){let e=i.toDate(t),c=e=>{let r=n===`day`?a.navLinkDayClick:n===`week`?a.navLinkWeekClick:null;typeof r==`function`?r.call(o,i.toDate(t),e):(typeof r==`string`&&(n=r),o.zoomTo(t,n))};return Object.assign({title:Xr(a.navLinkHint,[s,e],s),"data-navlink":``},r?Vr(c):{onClick:c})}return{"aria-label":s}}var cc;function lc(){return cc||=uc(),cc}function uc(){let e=document.createElement(`div`);e.style.overflow=`scroll`,e.style.position=`absolute`,e.style.top=`-9999px`,e.style.left=`-9999px`,document.body.appendChild(e);let t=dc(e);return document.body.removeChild(e),t}function dc(e){return{x:e.offsetHeight-e.clientHeight,y:e.offsetWidth-e.clientWidth}}function fc(e){let t=pc(e),n=e.getBoundingClientRect();for(let e of t){let t=$s(n,e.getBoundingClientRect());if(t)n=t;else return null}return n}function pc(e){let t=[];for(;e instanceof HTMLElement;){let n=window.getComputedStyle(e);if(n.position===`fixed`)break;/(auto|scroll)/.test(n.overflow+n.overflowY+n.overflowX)&&t.push(e),e=e.parentNode}return t}var mc=class{constructor(e,t,n,r){this.els=t;let i=this.originClientRect=e.getBoundingClientRect();n&&this.buildElHorizontals(i.left),r&&this.buildElVerticals(i.top)}buildElHorizontals(e){let t=[],n=[];for(let r of this.els){let i=r.getBoundingClientRect();t.push(i.left-e),n.push(i.right-e)}this.lefts=t,this.rights=n}buildElVerticals(e){let t=[],n=[];for(let r of this.els){let i=r.getBoundingClientRect();t.push(i.top-e),n.push(i.bottom-e)}this.tops=t,this.bottoms=n}leftToIndex(e){let{lefts:t,rights:n}=this,r=t.length,i;for(i=0;i<r;i+=1)if(e>=t[i]&&e<n[i])return i}topToIndex(e){let{tops:t,bottoms:n}=this,r=t.length,i;for(i=0;i<r;i+=1)if(e>=t[i]&&e<n[i])return i}getWidth(e){return this.rights[e]-this.lefts[e]}getHeight(e){return this.bottoms[e]-this.tops[e]}similarTo(e){return hc(this.tops||[],e.tops||[])&&hc(this.bottoms||[],e.bottoms||[])&&hc(this.lefts||[],e.lefts||[])&&hc(this.rights||[],e.rights||[])}};function hc(e,t){let n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(Math.round(e[r])!==Math.round(t[r]))return!1;return!0}var gc=class extends Z{constructor(){super(...arguments),this.uid=Wr()}prepareHits(){}queryHit(e,t,n,r){return null}isValidSegDownEl(e){return!this.props.eventDrag&&!this.props.eventResize&&!kr(e,`.fc-event-mirror`)}isValidDateDownEl(e){return!kr(e,`.fc-event:not(.fc-bg-event)`)&&!kr(e,`.fc-more-link`)&&!kr(e,`a[data-navlink]`)&&!kr(e,`.fc-popover`)}},_c=class{constructor(e=e=>e.thickness||1){this.getEntryThickness=e,this.strictOrder=!1,this.allowReslicing=!1,this.maxCoord=-1,this.maxStackCnt=-1,this.levelCoords=[],this.entriesByLevel=[],this.stackCnts={}}addSegs(e){let t=[];for(let n of e)this.insertEntry(n,t);return t}insertEntry(e,t){let n=this.findInsertion(e);this.isInsertionValid(n,e)?this.insertEntryAt(e,n):this.handleInvalidInsertion(n,e,t)}isInsertionValid(e,t){return(this.maxCoord===-1||e.levelCoord+this.getEntryThickness(t)<=this.maxCoord)&&(this.maxStackCnt===-1||e.stackCnt<this.maxStackCnt)}handleInvalidInsertion(e,t,n){if(this.allowReslicing&&e.touchingEntry){let r=Object.assign(Object.assign({},t),{span:Sc(t.span,e.touchingEntry.span)});n.push(r),this.splitEntry(t,e.touchingEntry,n)}else n.push(t)}splitEntry(e,t,n){let r=e.span,i=t.span;r.start<i.start&&this.insertEntry({index:e.index,thickness:e.thickness,span:{start:r.start,end:i.start}},n),r.end>i.end&&this.insertEntry({index:e.index,thickness:e.thickness,span:{start:i.end,end:r.end}},n)}insertEntryAt(e,t){let{entriesByLevel:n,levelCoords:r}=this;t.lateral===-1?(Cc(r,t.level,t.levelCoord),Cc(n,t.level,[e])):Cc(n[t.level],t.lateral,e),this.stackCnts[yc(e)]=t.stackCnt}findInsertion(e){let{levelCoords:t,entriesByLevel:n,strictOrder:r,stackCnts:i}=this,a=t.length,o=0,s=-1,c=-1,l=null,u=0;for(let d=0;d<a;d+=1){let a=t[d];if(!r&&a>=o+this.getEntryThickness(e))break;let f=n[d],p,m=wc(f,e.span.start,vc),h=m[0]+m[1];for(;(p=f[h])&&p.span.start<e.span.end;){let e=a+this.getEntryThickness(p);e>o&&(o=e,l=p,s=d,c=h),e===o&&(u=Math.max(u,i[yc(p)]+1)),h+=1}}let d=0;if(l)for(d=s+1;d<a&&t[d]<o;)d+=1;let f=-1;return d<a&&t[d]===o&&(f=wc(n[d],e.span.end,vc)[0]),{touchingLevel:s,touchingLateral:c,touchingEntry:l,stackCnt:u,levelCoord:o,level:d,lateral:f}}toRects(){let{entriesByLevel:e,levelCoords:t}=this,n=e.length,r=[];for(let i=0;i<n;i+=1){let n=e[i],a=t[i];for(let e of n)r.push(Object.assign(Object.assign({},e),{thickness:this.getEntryThickness(e),levelCoord:a}))}return r}};function vc(e){return e.span.end}function yc(e){return e.index+`:`+e.span.start}function bc(e){let t=[];for(let n of e){let e=[],r={span:n.span,entries:[n]};for(let n of t)Sc(n.span,r.span)?r={entries:n.entries.concat(r.entries),span:xc(n.span,r.span)}:e.push(n);e.push(r),t=e}return t}function xc(e,t){return{start:Math.min(e.start,t.start),end:Math.max(e.end,t.end)}}function Sc(e,t){let n=Math.max(e.start,t.start),r=Math.min(e.end,t.end);return n<r?{start:n,end:r}:null}function Cc(e,t,n){e.splice(t,0,n)}function wc(e,t,n){let r=0,i=e.length;if(!i||t<n(e[r]))return[0,0];if(t>n(e[i-1]))return[i,0];for(;r<i;){let a=Math.floor(r+(i-r)/2),o=n(e[a]);if(t<o)i=a;else if(t>o)r=a+1;else return[a,1]}return[r,0]}function Tc(e,t){return J(!e||t>10?{weekday:`short`}:t>1?{weekday:`short`,month:`numeric`,day:`numeric`,omitCommas:!0}:{weekday:`long`})}var Ec=`fc-col-header-cell`;function Dc(e){return e.text}var Oc=class extends Z{render(){let{dateEnv:e,options:t,theme:n,viewApi:r}=this.context,{props:i}=this,{date:a,dateProfile:o}=i,s=rc(a,i.todayRange,null,o),c=[Ec].concat(ic(s,n)),l=e.format(a,i.dayHeaderFormat),u=!s.isDisabled&&i.colCnt>1?sc(this.context,a):{},d=e.toDate(a);e.namedTimeZoneImpl&&(d=hi(d,36e5));let f=Object.assign(Object.assign(Object.assign({date:d,view:r},i.extraRenderProps),{text:l}),s);return L($,{elTag:`th`,elClasses:c,elAttrs:Object.assign({role:`columnheader`,colSpan:i.colSpan,"data-date":s.isDisabled?void 0:Ii(a)},i.extraDataAttrs),renderProps:f,generatorName:`dayHeaderContent`,customGenerator:t.dayHeaderContent,defaultGenerator:Dc,classNameGenerator:t.dayHeaderClassNames,didMount:t.dayHeaderDidMount,willUnmount:t.dayHeaderWillUnmount},e=>L(`div`,{className:`fc-scrollgrid-sync-inner`},!s.isDisabled&&L(e,{elTag:`a`,elAttrs:u,elClasses:[`fc-col-header-cell-cushion`,i.isSticky&&`fc-sticky`]})))}},kc=J({weekday:`long`}),Ac=class extends Z{render(){let{props:e}=this,{dateEnv:t,theme:n,viewApi:r,options:i}=this.context,a=W(new Date(2592e5),e.dow),o={dow:e.dow,isDisabled:!1,isFuture:!1,isPast:!1,isToday:!1,isOther:!1},s=t.format(a,e.dayHeaderFormat),c=Object.assign(Object.assign(Object.assign(Object.assign({date:a},o),{view:r}),e.extraRenderProps),{text:s});return L($,{elTag:`th`,elClasses:[Ec,...ic(o,n),...e.extraClassNames||[]],elAttrs:Object.assign({role:`columnheader`,colSpan:e.colSpan},e.extraDataAttrs),renderProps:c,generatorName:`dayHeaderContent`,customGenerator:i.dayHeaderContent,defaultGenerator:Dc,classNameGenerator:i.dayHeaderClassNames,didMount:i.dayHeaderDidMount,willUnmount:i.dayHeaderWillUnmount},n=>L(`div`,{className:`fc-scrollgrid-sync-inner`},L(n,{elTag:`a`,elClasses:[`fc-col-header-cell-cushion`,e.isSticky&&`fc-sticky`],elAttrs:{"aria-label":t.format(a,kc)}})))}},jc=class extends Z{constructor(){super(...arguments),this.createDayHeaderFormatter=q(Mc)}render(){let{context:e}=this,{dates:t,dateProfile:n,datesRepDistinctDays:r,renderIntro:i}=this.props,a=this.createDayHeaderFormatter(e.options.dayHeaderFormat,r,t.length);return L(Xs,{unit:`day`},(e,o)=>L(`tr`,{role:`row`},i&&i(`day`),t.map(e=>r?L(Oc,{key:e.toISOString(),date:e,dateProfile:n,todayRange:o,colCnt:t.length,dayHeaderFormat:a}):L(Ac,{key:e.getUTCDay(),dow:e.getUTCDay(),dayHeaderFormat:a}))))}};function Mc(e,t,n){return e||Tc(t,n)}var Nc=class{constructor(e,t){let n=e.start,{end:r}=e,i=[],a=[],o=-1;for(;n<r;)t.isHiddenDay(n)?i.push(o+.5):(o+=1,i.push(o),a.push(n)),n=W(n,1);this.dates=a,this.indices=i,this.cnt=a.length}sliceRange(e){let t=this.getDateDayIndex(e.start),n=this.getDateDayIndex(W(e.end,-1)),r=Math.max(0,t),i=Math.min(this.cnt-1,n);return r=Math.ceil(r),i=Math.floor(i),r<=i?{firstIndex:r,lastIndex:i,isStart:t===r,isEnd:n===i}:null}getDateDayIndex(e){let{indices:t}=this,n=Math.floor(_i(this.dates[0],e));return n<0?t[0]-1:n>=t.length?t[t.length-1]+1:t[n]}},Pc=class{constructor(e,t){let{dates:n}=e,r,i,a;if(t){for(i=n[0].getUTCDay(),r=1;r<n.length&&n[r].getUTCDay()!==i;r+=1);a=Math.ceil(n.length/r)}else a=1,r=n.length;this.rowCnt=a,this.colCnt=r,this.daySeries=e,this.cells=this.buildCells(),this.headerDates=this.buildHeaderDates()}buildCells(){let e=[];for(let t=0;t<this.rowCnt;t+=1){let n=[];for(let e=0;e<this.colCnt;e+=1)n.push(this.buildCell(t,e));e.push(n)}return e}buildCell(e,t){let n=this.daySeries.dates[e*this.colCnt+t];return{key:n.toISOString(),date:n}}buildHeaderDates(){let e=[];for(let t=0;t<this.colCnt;t+=1)e.push(this.cells[0][t].date);return e}sliceRange(e){let{colCnt:t}=this,n=this.daySeries.sliceRange(e),r=[];if(n){let{firstIndex:e,lastIndex:i}=n,a=e;for(;a<=i;){let o=Math.floor(a/t),s=Math.min((o+1)*t,i+1);r.push({row:o,firstCol:a%t,lastCol:(s-1)%t,isStart:n.isStart&&a===e,isEnd:n.isEnd&&s-1===i}),a=s}}return r}},Fc=class{constructor(){this.sliceBusinessHours=q(this._sliceBusinessHours),this.sliceDateSelection=q(this._sliceDateSpan),this.sliceEventStore=q(this._sliceEventStore),this.sliceEventDrag=q(this._sliceInteraction),this.sliceEventResize=q(this._sliceInteraction),this.forceDayIfListItem=!1}sliceProps(e,t,n,r,...i){let{eventUiBases:a}=e,o=this.sliceEventStore(e.eventStore,a,t,n,...i);return{dateSelectionSegs:this.sliceDateSelection(e.dateSelection,t,n,a,r,...i),businessHourSegs:this.sliceBusinessHours(e.businessHours,t,n,r,...i),fgEventSegs:o.fg,bgEventSegs:o.bg,eventDrag:this.sliceEventDrag(e.eventDrag,a,t,n,...i),eventResize:this.sliceEventResize(e.eventResize,a,t,n,...i),eventSelection:e.eventSelection}}sliceNowDate(e,t,n,r,...i){return this._sliceDateSpan({range:{start:e,end:hi(e,1)},allDay:!1},t,n,{},r,...i)}_sliceBusinessHours(e,t,n,r,...i){return e?this._sliceEventStore(ho(e,Ic(t,!!n),r),{},t,n,...i).bg:[]}_sliceEventStore(e,t,n,r,...i){if(e){let a=_s(e,t,Ic(n,!!r),r);return{bg:this.sliceEventRanges(a.bg,i),fg:this.sliceEventRanges(a.fg,i)}}return{bg:[],fg:[]}}_sliceInteraction(e,t,n,r,...i){if(!e)return null;let a=_s(e.mutatedEvents,t,Ic(n,!!r),r);return{segs:this.sliceEventRanges(a.fg,i),affectedInstances:e.affectedEvents.instances,isEvent:e.isEvent}}_sliceDateSpan(e,t,n,r,i,...a){if(!e)return[];let o=Ic(t,!!n),s=io(e.range,o);if(s){e=Object.assign(Object.assign({},e),{range:s});let t=zs(e,r,i),n=this.sliceRange(e.range,...a);for(let e of n)e.eventRange=t;return n}return[]}sliceEventRanges(e,t){let n=[];for(let r of e)n.push(...this.sliceEventRange(r,t));return n}sliceEventRange(e,t){let n=e.range;this.forceDayIfListItem&&e.ui.display===`list-item`&&(n={start:n.start,end:W(n.start,1)});let r=this.sliceRange(n,...t);for(let t of r)t.eventRange=e,t.isStart=e.isStart&&t.isStart,t.isEnd=e.isEnd&&t.isEnd;return r}};function Ic(e,t){let n=e.activeRange;return t?n:{start:hi(n.start,e.slotMinTime.milliseconds),end:hi(n.end,e.slotMaxTime.milliseconds-864e5)}}var Lc=/^(visible|hidden)$/,Rc=class extends Z{constructor(){super(...arguments),this.handleEl=e=>{this.el=e,Q(this.props.elRef,e)}}render(){let{props:e}=this,{liquid:t,liquidIsAbsolute:n}=e,r=t&&n,i=[`fc-scroller`];return t&&(n?i.push(`fc-scroller-liquid-absolute`):i.push(`fc-scroller-liquid`)),L(`div`,{ref:this.handleEl,className:i.join(` `),style:{overflowX:e.overflowX,overflowY:e.overflowY,left:r&&-(e.overcomeLeft||0)||``,right:r&&-(e.overcomeRight||0)||``,bottom:r&&-(e.overcomeBottom||0)||``,marginLeft:!r&&-(e.overcomeLeft||0)||``,marginRight:!r&&-(e.overcomeRight||0)||``,marginBottom:!r&&-(e.overcomeBottom||0)||``,maxHeight:e.maxHeight||``}},e.children)}needsXScrolling(){if(Lc.test(this.props.overflowX))return!1;let{el:e}=this,t=this.el.getBoundingClientRect().width-this.getYScrollbarWidth(),{children:n}=e;for(let e=0;e<n.length;e+=1)if(n[e].getBoundingClientRect().width>t)return!0;return!1}needsYScrolling(){if(Lc.test(this.props.overflowY))return!1;let{el:e}=this,t=this.el.getBoundingClientRect().height-this.getXScrollbarWidth(),{children:n}=e;for(let e=0;e<n.length;e+=1)if(n[e].getBoundingClientRect().height>t)return!0;return!1}getXScrollbarWidth(){return Lc.test(this.props.overflowX)?0:this.el.offsetHeight-this.el.clientHeight}getYScrollbarWidth(){return Lc.test(this.props.overflowY)?0:this.el.offsetWidth-this.el.clientWidth}},zc=class{constructor(e){this.masterCallback=e,this.currentMap={},this.depths={},this.callbackMap={},this.handleValue=(e,t)=>{let{depths:n,currentMap:r}=this,i=!1,a=!1;e===null?(--n[t],n[t]||(delete r[t],delete this.callbackMap[t],i=!0)):(i=t in r,r[t]=e,n[t]=(n[t]||0)+1,a=!0),this.masterCallback&&(i&&this.masterCallback(null,String(t)),a&&this.masterCallback(e,String(t)))}}createRef(e){let t=this.callbackMap[e];return t||=this.callbackMap[e]=t=>{this.handleValue(t,String(e))},t}collect(e,t,n){return ka(this.currentMap,e,t,n)}getAll(){return Ca(this.currentMap)}};function Bc(e){let t=jr(e,`.fc-scrollgrid-shrink`),n=0;for(let e of t)n=Math.max(n,Qr(e));return Math.ceil(n)}function Vc(e,t){return e.liquid&&t.liquid}function Hc(e,t){return t.maxHeight!=null||Vc(e,t)}function Uc(e,t,n,r){let{expandRows:i}=n;return typeof t.content==`function`?t.content(n):L(`table`,{role:`presentation`,className:[t.tableClassName,e.syncRowHeights?`fc-scrollgrid-sync-table`:``].join(` `),style:{minWidth:n.tableMinWidth,width:n.clientWidth,height:i?n.clientHeight:``}},n.tableColGroupNode,L(r?`thead`:`tbody`,{role:`presentation`},typeof t.rowContent==`function`?t.rowContent(n):t.rowContent))}function Wc(e,t){return fi(e,t,X)}function Gc(e,t){let n=[];for(let r of e){let e=r.span||1;for(let i=0;i<e;i+=1)n.push(L(`col`,{style:{width:r.width===`shrink`?Kc(t):r.width||``,minWidth:r.minWidth||``}}))}return L(`colgroup`,{},...n)}function Kc(e){return e??4}function qc(e){for(let t of e)if(t.width===`shrink`)return!0;return!1}function Jc(e,t){let n=[`fc-scrollgrid`,t.theme.getClass(`table`)];return e&&n.push(`fc-scrollgrid-liquid`),n}function Yc(e,t){let n=[`fc-scrollgrid-section`,`fc-scrollgrid-section-${e.type}`,e.className];return t&&e.liquid&&e.maxHeight==null&&n.push(`fc-scrollgrid-section-liquid`),e.isSticky&&n.push(`fc-scrollgrid-section-sticky`),n}function Xc(e){return L(`div`,{className:`fc-scrollgrid-sticky-shim`,style:{width:e.clientWidth,minWidth:e.tableMinWidth}})}function Zc(e){let{stickyHeaderDates:t}=e;return(t==null||t===`auto`)&&(t=e.height===`auto`||e.viewHeight===`auto`),t}function Qc(e){let{stickyFooterScrollbar:t}=e;return(t==null||t===`auto`)&&(t=e.height===`auto`||e.viewHeight===`auto`),t}var $c=class extends Z{constructor(){super(...arguments),this.processCols=q(e=>e,Wc),this.renderMicroColGroup=q(Gc),this.scrollerRefs=new zc,this.scrollerElRefs=new zc(this._handleScrollerEl.bind(this)),this.state={shrinkWidth:null,forceYScrollbars:!1,scrollerClientWidths:{},scrollerClientHeights:{}},this.handleSizing=()=>{this.safeSetState(Object.assign({shrinkWidth:this.computeShrinkWidth()},this.computeScrollerDims()))}}render(){let{props:e,state:t,context:n}=this,r=e.sections||[],i=this.processCols(e.cols),a=this.renderMicroColGroup(i,t.shrinkWidth),o=Jc(e.liquid,n);e.collapsibleWidth&&o.push(`fc-scrollgrid-collapsible`);let s=r.length,c=0,l,u=[],d=[],f=[];for(;c<s&&(l=r[c]).type===`header`;)u.push(this.renderSection(l,a,!0)),c+=1;for(;c<s&&(l=r[c]).type===`body`;)d.push(this.renderSection(l,a,!1)),c+=1;for(;c<s&&(l=r[c]).type===`footer`;)f.push(this.renderSection(l,a,!0)),c+=1;let p=!Ws(),m={role:`rowgroup`};return L(`table`,{role:`grid`,className:o.join(` `),style:{height:e.height}},!!(!p&&u.length)&&L(`thead`,m,...u),!!(!p&&d.length)&&L(`tbody`,m,...d),!!(!p&&f.length)&&L(`tfoot`,m,...f),p&&L(`tbody`,m,...u,...d,...f))}renderSection(e,t,n){return`outerContent`in e?L(z,{key:e.key},e.outerContent):L(`tr`,{key:e.key,role:`presentation`,className:Yc(e,this.props.liquid).join(` `)},this.renderChunkTd(e,t,e.chunk,n))}renderChunkTd(e,t,n,r){if(`outerContent`in n)return n.outerContent;let{props:i}=this,{forceYScrollbars:a,scrollerClientWidths:o,scrollerClientHeights:s}=this.state,c=Hc(i,e),l=Vc(i,e),u=i.liquid?a?`scroll`:c?`auto`:`hidden`:`visible`,d=e.key,f=Uc(e,n,{tableColGroupNode:t,tableMinWidth:``,clientWidth:!i.collapsibleWidth&&o[d]!==void 0?o[d]:null,clientHeight:s[d]===void 0?null:s[d],expandRows:e.expandRows,syncRowHeights:!1,rowSyncHeights:[],reportRowHeightChange:()=>{}},r);return L(r?`th`:`td`,{ref:n.elRef,role:`presentation`},L(`div`,{className:`fc-scroller-harness${l?` fc-scroller-harness-liquid`:``}`},L(Rc,{ref:this.scrollerRefs.createRef(d),elRef:this.scrollerElRefs.createRef(d),overflowY:u,overflowX:i.liquid?`hidden`:`visible`,maxHeight:e.maxHeight,liquid:l,liquidIsAbsolute:!0},f)))}_handleScrollerEl(e,t){let n=el(this.props.sections,t);n&&Q(n.chunk.scrollerElRef,e)}componentDidMount(){this.handleSizing(),this.context.addResizeHandler(this.handleSizing)}componentDidUpdate(){this.handleSizing()}componentWillUnmount(){this.context.removeResizeHandler(this.handleSizing)}computeShrinkWidth(){return qc(this.props.cols)?Bc(this.scrollerElRefs.getAll()):0}computeScrollerDims(){let e=lc(),{scrollerRefs:t,scrollerElRefs:n}=this,r=!1,i={},a={};for(let e in t.currentMap){let n=t.currentMap[e];if(n&&n.needsYScrolling()){r=!0;break}}for(let t of this.props.sections){let o=t.key,s=n.currentMap[o];if(s){let t=s.parentNode;i[o]=Math.floor(t.getBoundingClientRect().width-(r?e.y:0)),a[o]=Math.floor(t.getBoundingClientRect().height)}}return{forceYScrollbars:r,scrollerClientWidths:i,scrollerClientHeights:a}}};$c.addStateEquality({scrollerClientWidths:X,scrollerClientHeights:X});function el(e,t){for(let n of e)if(n.key===t)return n;return null}var tl=class extends Z{constructor(){super(...arguments),this.buildPublicEvent=q((e,t,n)=>new ms(e,t,n)),this.handleEl=e=>{this.el=e,Q(this.props.elRef,e),e&&ys(e,this.props.seg)}}render(){let{props:e,context:t}=this,{options:n}=t,{seg:r}=e,{eventRange:i}=r,{ui:a}=i,o={event:this.buildPublicEvent(t,i.def,i.instance),view:t.viewApi,timeText:e.timeText,textColor:a.textColor,backgroundColor:a.backgroundColor,borderColor:a.borderColor,isDraggable:!e.disableDragging&&Ts(r,t),isStartResizable:!e.disableResizing&&Es(r,t),isEndResizable:!e.disableResizing&&Ds(r),isMirror:!!(e.isDragging||e.isResizing||e.isDateSelecting),isStart:!!r.isStart,isEnd:!!r.isEnd,isPast:!!e.isPast,isFuture:!!e.isFuture,isToday:!!e.isToday,isSelected:!!e.isSelected,isDragging:!!e.isDragging,isResizing:!!e.isResizing};return L($,{elRef:this.handleEl,elTag:e.elTag,elAttrs:e.elAttrs,elClasses:[...As(o),...r.eventRange.ui.classNames,...e.elClasses||[]],elStyle:e.elStyle,renderProps:o,generatorName:`eventContent`,customGenerator:n.eventContent,defaultGenerator:e.defaultGenerator,classNameGenerator:n.eventClassNames,didMount:n.eventDidMount,willUnmount:n.eventWillUnmount},e.children)}componentDidUpdate(e){this.el&&this.props.seg!==e.seg&&ys(this.el,this.props.seg)}},nl=class extends Z{render(){let{props:e,context:t}=this,{options:n}=t,{seg:r}=e,{ui:i}=r.eventRange,a=Os(r,n.eventTimeFormat||e.defaultTimeFormat,t,e.defaultDisplayEventTime,e.defaultDisplayEventEnd);return L(tl,Object.assign({},e,{elTag:`a`,elStyle:{borderColor:i.borderColor,backgroundColor:i.backgroundColor},elAttrs:Ms(r,t),defaultGenerator:rl,timeText:a}),(e,t)=>L(z,null,L(e,{elTag:`div`,elClasses:[`fc-event-main`],elStyle:{color:t.textColor}}),!!t.isStartResizable&&L(`div`,{className:`fc-event-resizer fc-event-resizer-start`}),!!t.isEndResizable&&L(`div`,{className:`fc-event-resizer fc-event-resizer-end`})))}};nl.addPropsEquality({seg:X});function rl(e){return L(`div`,{className:`fc-event-main-frame`},e.timeText&&L(`div`,{className:`fc-event-time`},e.timeText),L(`div`,{className:`fc-event-title-container`},L(`div`,{className:`fc-event-title fc-sticky`},e.event.title||L(z,null,`\xA0`))))}var il=e=>L(Va.Consumer,null,t=>{let{options:n}=t,r={isAxis:e.isAxis,date:t.dateEnv.toDate(e.date),view:t.viewApi};return L($,{elRef:e.elRef,elTag:e.elTag||`div`,elAttrs:e.elAttrs,elClasses:e.elClasses,elStyle:e.elStyle,renderProps:r,generatorName:`nowIndicatorContent`,customGenerator:n.nowIndicatorContent,classNameGenerator:n.nowIndicatorClassNames,didMount:n.nowIndicatorDidMount,willUnmount:n.nowIndicatorWillUnmount},e.children)}),al=J({day:`numeric`}),ol=class extends Z{constructor(){super(...arguments),this.refineRenderProps=Bi(cl)}render(){let{props:e,context:t}=this,{options:n}=t,r=this.refineRenderProps({date:e.date,dateProfile:e.dateProfile,todayRange:e.todayRange,isMonthStart:e.isMonthStart||!1,showDayNumber:e.showDayNumber,extraRenderProps:e.extraRenderProps,viewApi:t.viewApi,dateEnv:t.dateEnv,monthStartFormat:n.monthStartFormat});return L($,{elRef:e.elRef,elTag:e.elTag,elAttrs:Object.assign(Object.assign({},e.elAttrs),r.isDisabled?{}:{"data-date":Ii(e.date)}),elClasses:[...ic(r,t.theme),...e.elClasses||[]],elStyle:e.elStyle,renderProps:r,generatorName:`dayCellContent`,customGenerator:n.dayCellContent,defaultGenerator:e.defaultGenerator,classNameGenerator:r.isDisabled?void 0:n.dayCellClassNames,didMount:n.dayCellDidMount,willUnmount:n.dayCellWillUnmount},e.children)}};function sl(e){return!!(e.dayCellContent||qa(`dayCellContent`,e))}function cl(e){let{date:t,dateEnv:n,dateProfile:r,isMonthStart:i}=e,a=rc(t,e.todayRange,null,r),o=e.showDayNumber?n.format(t,i?e.monthStartFormat:al):``;return Object.assign(Object.assign(Object.assign({date:n.toDate(t),view:e.viewApi},a),{isMonthStart:i,dayNumberText:o}),e.extraRenderProps)}var ll=class extends Z{render(){let{props:e}=this,{seg:t}=e;return L(tl,{elTag:`div`,elClasses:[`fc-bg-event`],elStyle:{backgroundColor:t.eventRange.ui.backgroundColor},defaultGenerator:ul,seg:t,timeText:``,isDragging:!1,isResizing:!1,isDateSelecting:!1,isSelected:!1,isPast:e.isPast,isFuture:e.isFuture,isToday:e.isToday,disableDragging:!0,disableResizing:!0})}};function ul(e){let{title:t}=e.event;return t&&L(`div`,{className:`fc-event-title`},e.event.title)}function dl(e){return L(`div`,{className:`fc-${e}`})}var fl=e=>L(Va.Consumer,null,t=>{let{dateEnv:n,options:r}=t,{date:i}=e,a=r.weekNumberFormat||e.defaultFormat,o={num:n.computeWeekNumber(i),text:n.format(i,a),date:i};return L($,{elRef:e.elRef,elTag:e.elTag,elAttrs:e.elAttrs,elClasses:e.elClasses,elStyle:e.elStyle,renderProps:o,generatorName:`weekNumberContent`,customGenerator:r.weekNumberContent,defaultGenerator:pl,classNameGenerator:r.weekNumberClassNames,didMount:r.weekNumberDidMount,willUnmount:r.weekNumberWillUnmount},e.children)});function pl(e){return e.text}var ml=10,hl=class extends Z{constructor(){super(...arguments),this.state={titleId:Lr()},this.handleRootEl=e=>{this.rootEl=e,this.props.elRef&&Q(this.props.elRef,e)},this.handleDocumentMouseDown=e=>{let t=Fr(e);this.rootEl.contains(t)||this.handleCloseClick()},this.handleDocumentKeyDown=e=>{e.key===`Escape`&&this.handleCloseClick()},this.handleCloseClick=()=>{let{onClose:e}=this.props;e&&e()}}render(){let{theme:e,options:t}=this.context,{props:n,state:r}=this,i=[`fc-popover`,e.getClass(`popover`)].concat(n.extraClassNames||[]);return ar(L(`div`,Object.assign({},n.extraAttrs,{id:n.id,className:i.join(` `),"aria-labelledby":r.titleId,ref:this.handleRootEl}),L(`div`,{className:`fc-popover-header `+e.getClass(`popoverHeader`)},L(`span`,{className:`fc-popover-title`,id:r.titleId},n.title),L(`span`,{className:`fc-popover-close `+e.getIconClass(`close`),title:t.closeHint,onClick:this.handleCloseClick})),L(`div`,{className:`fc-popover-body `+e.getClass(`popoverContent`)},n.children)),n.parentEl)}componentDidMount(){document.addEventListener(`mousedown`,this.handleDocumentMouseDown),document.addEventListener(`keydown`,this.handleDocumentKeyDown),this.updateSize()}componentWillUnmount(){document.removeEventListener(`mousedown`,this.handleDocumentMouseDown),document.removeEventListener(`keydown`,this.handleDocumentKeyDown)}updateSize(){let{isRtl:e}=this.context,{alignmentEl:t,alignGridTop:n}=this.props,{rootEl:r}=this,i=fc(t);if(i){let a=r.getBoundingClientRect(),o=n?kr(t,`.fc-scrollgrid`).getBoundingClientRect().top:i.top,s=e?i.right-a.width:i.left;o=Math.max(o,ml),s=Math.min(s,document.documentElement.clientWidth-ml-a.width),s=Math.max(s,ml);let c=r.offsetParent.getBoundingClientRect();Nr(r,{top:o-c.top,left:s-c.left})}}},gl=class extends gc{constructor(){super(...arguments),this.handleRootEl=e=>{this.rootEl=e,e?this.context.registerInteractiveComponent(this,{el:e,useEventCenter:!1}):this.context.unregisterInteractiveComponent(this)}}render(){let{options:e,dateEnv:t}=this.context,{props:n}=this,{startDate:r,todayRange:i,dateProfile:a}=n,o=t.format(r,e.dayPopoverFormat);return L(ol,{elRef:this.handleRootEl,date:r,dateProfile:a,todayRange:i},(t,r,i)=>L(hl,{elRef:i.ref,id:n.id,title:o,extraClassNames:[`fc-more-popover`].concat(i.className||[]),extraAttrs:i,parentEl:n.parentEl,alignmentEl:n.alignmentEl,alignGridTop:n.alignGridTop,onClose:n.onClose},sl(e)&&L(t,{elTag:`div`,elClasses:[`fc-more-popover-misc`]}),n.children))}queryHit(e,t,n,r){let{rootEl:i,props:a}=this;return e>=0&&e<n&&t>=0&&t<r?{dateProfile:a.dateProfile,dateSpan:Object.assign({allDay:!a.forceTimed,range:{start:a.startDate,end:a.endDate}},a.extraDateSpan),dayEl:i,rect:{left:0,top:0,right:n,bottom:r},layer:1}:null}},_l=class extends Z{constructor(){super(...arguments),this.state={isPopoverOpen:!1,popoverId:Lr()},this.handleLinkEl=e=>{this.linkEl=e,this.props.elRef&&Q(this.props.elRef,e)},this.handleClick=e=>{let{props:t,context:n}=this,{moreLinkClick:r}=n.options,i=yl(t).start;function a(e){let{def:t,instance:r,range:i}=e.eventRange;return{event:new ms(n,t,r),start:n.dateEnv.toDate(i.start),end:n.dateEnv.toDate(i.end),isStart:e.isStart,isEnd:e.isEnd}}typeof r==`function`&&(r=r({date:i,allDay:!!t.allDayDate,allSegs:t.allSegs.map(a),hiddenSegs:t.hiddenSegs.map(a),jsEvent:e,view:n.viewApi})),!r||r===`popover`?this.setState({isPopoverOpen:!0}):typeof r==`string`&&n.calendarApi.zoomTo(i,r)},this.handlePopoverClose=()=>{this.setState({isPopoverOpen:!1})}}render(){let{props:e,state:t}=this;return L(Va.Consumer,null,n=>{let{viewApi:r,options:i,calendarApi:a}=n,{moreLinkText:o}=i,{moreCnt:s}=e,c=yl(e),l=typeof o==`function`?o.call(a,s):`+${s} ${o}`,u=Xr(i.moreLinkHint,[s],l),d={num:s,shortText:`+${s}`,text:l,view:r};return L(z,null,!!e.moreCnt&&L($,{elTag:e.elTag||`a`,elRef:this.handleLinkEl,elClasses:[...e.elClasses||[],`fc-more-link`],elStyle:e.elStyle,elAttrs:Object.assign(Object.assign(Object.assign({},e.elAttrs),Vr(this.handleClick)),{title:u,"aria-expanded":t.isPopoverOpen,"aria-controls":t.isPopoverOpen?t.popoverId:``}),renderProps:d,generatorName:`moreLinkContent`,customGenerator:i.moreLinkContent,defaultGenerator:e.defaultGenerator||vl,classNameGenerator:i.moreLinkClassNames,didMount:i.moreLinkDidMount,willUnmount:i.moreLinkWillUnmount},e.children),t.isPopoverOpen&&L(gl,{id:t.popoverId,startDate:c.start,endDate:c.end,dateProfile:e.dateProfile,todayRange:e.todayRange,extraDateSpan:e.extraDateSpan,parentEl:this.parentEl,alignmentEl:e.alignmentElRef?e.alignmentElRef.current:this.linkEl,alignGridTop:e.alignGridTop,forceTimed:e.forceTimed,onClose:this.handlePopoverClose},e.popoverContent()))})}componentDidMount(){this.updateParentEl()}componentDidUpdate(){this.updateParentEl()}updateParentEl(){this.linkEl&&(this.parentEl=kr(this.linkEl,`.fc-view-harness`))}};function vl(e){return e.text}function yl(e){if(e.allDayDate)return{start:e.allDayDate,end:W(e.allDayDate,1)};let{hiddenSegs:t}=e;return{start:bl(t),end:Sl(t)}}function bl(e){return e.reduce(xl).eventRange.range.start}function xl(e,t){return e.eventRange.range.start<t.eventRange.range.start?e:t}function Sl(e){return e.reduce(Cl).eventRange.range.end}function Cl(e,t){return e.eventRange.range.end>t.eventRange.range.end?e:t}var wl=class{constructor(){this.handlers=[]}set(e){this.currentValue=e;for(let t of this.handlers)t(e)}subscribe(e){this.handlers.push(e),this.currentValue!==void 0&&e(this.currentValue)}},Tl=class extends wl{constructor(){super(...arguments),this.map=new Map}handle(e){let{map:t}=this,n=!1;e.isActive?(t.set(e.id,e),n=!0):t.has(e.id)&&(t.delete(e.id),n=!0),n&&this.set(t)}},El=[],Dl={code:`en`,week:{dow:0,doy:4},direction:`ltr`,buttonText:{prev:`prev`,next:`next`,prevYear:`prev year`,nextYear:`next year`,year:`year`,today:`today`,month:`month`,week:`week`,day:`day`,list:`list`},weekText:`W`,weekTextLong:`Week`,closeHint:`Close`,timeHint:`Time`,eventHint:`Event`,allDayText:`all-day`,moreLinkText:`more`,noEventsText:`No events to display`},Ol=Object.assign(Object.assign({},Dl),{buttonHints:{prev:`Previous $0`,next:`Next $0`,today(e,t){return t===`day`?`Today`:`This ${e}`}},viewHint:`$0 view`,navLinkHint:`Go to $0`,moreLinkHint(e){return`Show ${e} more event${e===1?``:`s`}`}});function kl(e){let t=e.length>0?e[0].code:`en`,n=El.concat(e),r={en:Ol};for(let e of n)r[e.code]=e;return{map:r,defaultCode:t}}function Al(e,t){return typeof e==`object`&&!Array.isArray(e)?Nl(e.code,[e.code],e):jl(e,t)}function jl(e,t){let n=[].concat(e||[]);return Nl(e,n,Ml(n,t)||Ol)}function Ml(e,t){for(let n=0;n<e.length;n+=1){let r=e[n].toLocaleLowerCase().split(`-`);for(let e=r.length;e>0;--e){let n=r.slice(0,e).join(`-`);if(t[n])return t[n]}}return null}function Nl(e,t,n){let r=ya([Dl,n],[`buttonText`]);delete r.code;let{week:i}=r;return delete r.week,{codeArg:e,codes:t,week:i,simpleNumberFormat:new Intl.NumberFormat(e),options:r}}function Pl(e){return{id:Wr(),name:e.name,premiumReleaseDate:e.premiumReleaseDate?new Date(e.premiumReleaseDate):void 0,deps:e.deps||[],reducers:e.reducers||[],isLoadingFuncs:e.isLoadingFuncs||[],contextInit:[].concat(e.contextInit||[]),eventRefiners:e.eventRefiners||{},eventDefMemberAdders:e.eventDefMemberAdders||[],eventSourceRefiners:e.eventSourceRefiners||{},isDraggableTransformers:e.isDraggableTransformers||[],eventDragMutationMassagers:e.eventDragMutationMassagers||[],eventDefMutationAppliers:e.eventDefMutationAppliers||[],dateSelectionTransformers:e.dateSelectionTransformers||[],datePointTransforms:e.datePointTransforms||[],dateSpanTransforms:e.dateSpanTransforms||[],views:e.views||{},viewPropsTransformers:e.viewPropsTransformers||[],isPropsValid:e.isPropsValid||null,externalDefTransforms:e.externalDefTransforms||[],viewContainerAppends:e.viewContainerAppends||[],eventDropTransformers:e.eventDropTransformers||[],componentInteractions:e.componentInteractions||[],calendarInteractions:e.calendarInteractions||[],themeClasses:e.themeClasses||{},eventSourceDefs:e.eventSourceDefs||[],cmdFormatter:e.cmdFormatter,recurringTypes:e.recurringTypes||[],namedTimeZonedImpl:e.namedTimeZonedImpl,initialView:e.initialView||``,elementDraggingImpl:e.elementDraggingImpl,optionChangeHandlers:e.optionChangeHandlers||{},scrollGridImpl:e.scrollGridImpl||null,listenerRefiners:e.listenerRefiners||{},optionRefiners:e.optionRefiners||{},propSetHandlers:e.propSetHandlers||{}}}function Fl(e,t){let n={},r={premiumReleaseDate:void 0,reducers:[],isLoadingFuncs:[],contextInit:[],eventRefiners:{},eventDefMemberAdders:[],eventSourceRefiners:{},isDraggableTransformers:[],eventDragMutationMassagers:[],eventDefMutationAppliers:[],dateSelectionTransformers:[],datePointTransforms:[],dateSpanTransforms:[],views:{},viewPropsTransformers:[],isPropsValid:null,externalDefTransforms:[],viewContainerAppends:[],eventDropTransformers:[],componentInteractions:[],calendarInteractions:[],themeClasses:{},eventSourceDefs:[],cmdFormatter:null,recurringTypes:[],namedTimeZonedImpl:null,initialView:``,elementDraggingImpl:null,optionChangeHandlers:{},scrollGridImpl:null,listenerRefiners:{},optionRefiners:{},propSetHandlers:{}};function i(e){for(let t of e){let e=t.name,a=n[e];a===void 0?(n[e]=t.id,i(t.deps),r=Ll(r,t)):a!==t.id&&console.warn(`Duplicate plugin '${e}'`)}}return e&&i(e),i(t),r}function Il(){let e=[],t=[],n;return(r,i)=>((!n||!fi(r,e)||!fi(i,t))&&(n=Fl(r,i)),e=r,t=i,n)}function Ll(e,t){return{premiumReleaseDate:Rl(e.premiumReleaseDate,t.premiumReleaseDate),reducers:e.reducers.concat(t.reducers),isLoadingFuncs:e.isLoadingFuncs.concat(t.isLoadingFuncs),contextInit:e.contextInit.concat(t.contextInit),eventRefiners:Object.assign(Object.assign({},e.eventRefiners),t.eventRefiners),eventDefMemberAdders:e.eventDefMemberAdders.concat(t.eventDefMemberAdders),eventSourceRefiners:Object.assign(Object.assign({},e.eventSourceRefiners),t.eventSourceRefiners),isDraggableTransformers:e.isDraggableTransformers.concat(t.isDraggableTransformers),eventDragMutationMassagers:e.eventDragMutationMassagers.concat(t.eventDragMutationMassagers),eventDefMutationAppliers:e.eventDefMutationAppliers.concat(t.eventDefMutationAppliers),dateSelectionTransformers:e.dateSelectionTransformers.concat(t.dateSelectionTransformers),datePointTransforms:e.datePointTransforms.concat(t.datePointTransforms),dateSpanTransforms:e.dateSpanTransforms.concat(t.dateSpanTransforms),views:Object.assign(Object.assign({},e.views),t.views),viewPropsTransformers:e.viewPropsTransformers.concat(t.viewPropsTransformers),isPropsValid:t.isPropsValid||e.isPropsValid,externalDefTransforms:e.externalDefTransforms.concat(t.externalDefTransforms),viewContainerAppends:e.viewContainerAppends.concat(t.viewContainerAppends),eventDropTransformers:e.eventDropTransformers.concat(t.eventDropTransformers),calendarInteractions:e.calendarInteractions.concat(t.calendarInteractions),componentInteractions:e.componentInteractions.concat(t.componentInteractions),themeClasses:Object.assign(Object.assign({},e.themeClasses),t.themeClasses),eventSourceDefs:e.eventSourceDefs.concat(t.eventSourceDefs),cmdFormatter:t.cmdFormatter||e.cmdFormatter,recurringTypes:e.recurringTypes.concat(t.recurringTypes),namedTimeZonedImpl:t.namedTimeZonedImpl||e.namedTimeZonedImpl,initialView:e.initialView||t.initialView,elementDraggingImpl:e.elementDraggingImpl||t.elementDraggingImpl,optionChangeHandlers:Object.assign(Object.assign({},e.optionChangeHandlers),t.optionChangeHandlers),scrollGridImpl:t.scrollGridImpl||e.scrollGridImpl,listenerRefiners:Object.assign(Object.assign({},e.listenerRefiners),t.listenerRefiners),optionRefiners:Object.assign(Object.assign({},e.optionRefiners),t.optionRefiners),propSetHandlers:Object.assign(Object.assign({},e.propSetHandlers),t.propSetHandlers)}}function Rl(e,t){return e===void 0?t:t===void 0?e:new Date(Math.max(e.valueOf(),t.valueOf()))}var zl=class extends Ia{};zl.prototype.classes={root:`fc-theme-standard`,tableCellShaded:`fc-cell-shaded`,buttonGroup:`fc-button-group`,button:`fc-button fc-button-primary`,buttonActive:`fc-button-active`},zl.prototype.baseIconClass=`fc-icon`,zl.prototype.iconClasses={close:`fc-icon-x`,prev:`fc-icon-chevron-left`,next:`fc-icon-chevron-right`,prevYear:`fc-icon-chevrons-left`,nextYear:`fc-icon-chevrons-right`},zl.prototype.rtlIconClasses={prev:`fc-icon-chevron-right`,next:`fc-icon-chevron-left`,prevYear:`fc-icon-chevrons-right`,nextYear:`fc-icon-chevrons-left`},zl.prototype.iconOverrideOption=`buttonIcons`,zl.prototype.iconOverrideCustomButtonOption=`icon`,zl.prototype.iconOverridePrefix=`fc-icon-`;function Bl(e,t){let n={},r;for(r in e)Vl(r,n,e,t);for(r in t)Vl(r,n,e,t);return n}function Vl(e,t,n,r){if(t[e])return t[e];let i=Hl(e,t,n,r);return i&&(t[e]=i),i}function Hl(e,t,n,r){let i=n[e],a=r[e],o=e=>i&&i[e]!==null?i[e]:a&&a[e]!==null?a[e]:null,s=o(`component`),c=o(`superType`),l=null;if(c){if(c===e)throw Error(`Can't have a custom view type that references itself`);l=Vl(c,t,n,r)}return!s&&l&&(s=l.component),s?{type:e,component:s,defaults:Object.assign(Object.assign({},l?l.defaults:{}),i?i.rawOptions:{}),overrides:Object.assign(Object.assign({},l?l.overrides:{}),a?a.rawOptions:{})}:null}function Ul(e){return xa(e,Wl)}function Wl(e){let t=typeof e==`function`?{component:e}:e,{component:n}=t;return t.content?n=Gl(t):n&&!(n.prototype instanceof Z)&&(n=Gl(Object.assign(Object.assign({},t),{content:n}))),{superType:t.type,component:n,rawOptions:t}}function Gl(e){return t=>L(Va.Consumer,null,n=>L($,{elTag:`div`,elClasses:eo(n.viewSpec),renderProps:Object.assign(Object.assign({},t),{nextDayThreshold:n.options.nextDayThreshold}),generatorName:void 0,customGenerator:e.content,classNameGenerator:e.classNames,didMount:e.didMount,willUnmount:e.willUnmount}))}function Kl(e,t,n,r){let i=Ul(e),a=Ul(t.views);return xa(Bl(i,a),e=>ql(e,a,t,n,r))}function ql(e,t,n,r,i){let a=e.overrides.duration||e.defaults.duration||r.duration||n.duration,o=null,s=``,c=``,l={};if(a&&(o=Yl(a),o)){let e=di(o);s=e.unit,e.value===1&&(c=s,l=t[s]?t[s].rawOptions:{})}let u=t=>{let n=t.buttonText||{},r=e.defaults.buttonTextKey;return r!=null&&n[r]!=null?n[r]:n[e.type]==null?n[c]==null?null:n[c]:n[e.type]},d=t=>{let n=t.buttonHints||{},r=e.defaults.buttonTextKey;return r!=null&&n[r]!=null?n[r]:n[e.type]==null?n[c]==null?null:n[c]:n[e.type]};return{type:e.type,component:e.component,duration:o,durationUnit:s,singleUnit:c,optionDefaults:e.defaults,optionOverrides:Object.assign(Object.assign({},l),e.overrides),buttonTextOverride:u(r)||u(n)||e.overrides.buttonText,buttonTextDefault:u(i)||e.defaults.buttonText||u(la)||e.type,buttonTitleOverride:d(r)||d(n)||e.overrides.buttonHint,buttonTitleDefault:d(i)||e.defaults.buttonHint||d(la)}}var Jl={};function Yl(e){let t=JSON.stringify(e),n=Jl[t];return n===void 0&&(n=H(e),Jl[t]=n),n}function Xl(e,t){switch(t.type){case`CHANGE_VIEW_TYPE`:e=t.viewType}return e}function Zl(e,t){switch(t.type){case`CHANGE_DATE`:return t.dateMarker;default:return e}}function Ql(e,t,n){let r=e.initialDate;return r==null?n.getDateMarker():t.createMarker(r)}function $l(e,t){switch(t.type){case`SET_OPTION`:return Object.assign(Object.assign({},e),{[t.optionName]:t.rawOptionValue});default:return e}}function eu(e,t,n,r){let i;switch(t.type){case`CHANGE_VIEW_TYPE`:return r.build(t.dateMarker||n);case`CHANGE_DATE`:return r.build(t.dateMarker);case`PREV`:if(i=r.buildPrev(e,n),i.isValid)return i;break;case`NEXT`:if(i=r.buildNext(e,n),i.isValid)return i;break}return e}function tu(e,t,n){let r=t?t.activeRange:null;return au({},pu(e,n),r,n)}function nu(e,t,n,r){let i=n?n.activeRange:null;switch(t.type){case`ADD_EVENT_SOURCES`:return au(e,t.sources,i,r);case`REMOVE_EVENT_SOURCE`:return ou(e,t.sourceId);case`PREV`:case`NEXT`:case`CHANGE_DATE`:case`CHANGE_VIEW_TYPE`:return n?su(e,i,r):e;case`FETCH_EVENT_SOURCES`:return lu(e,t.sourceIds?Sa(t.sourceIds):fu(e,r),i,t.isRefetch||!1,r);case`RECEIVE_EVENTS`:case`RECEIVE_EVENT_ERROR`:return du(e,t.sourceId,t.fetchId,t.fetchRange);case`REMOVE_ALL_EVENT_SOURCES`:return{};default:return e}}function ru(e,t,n){let r=t?t.activeRange:null;return lu(e,fu(e,n),r,!0,n)}function iu(e){for(let t in e)if(e[t].isFetching)return!0;return!1}function au(e,t,n,r){let i={};for(let e of t)i[e.sourceId]=e;return n&&(i=su(i,n,r)),Object.assign(Object.assign({},e),i)}function ou(e,t){return ba(e,e=>e.sourceId!==t)}function su(e,t,n){return lu(e,ba(e,e=>cu(e,t,n)),t,!1,n)}function cu(e,t,n){return mu(e,n)?!n.options.lazyFetching||!e.fetchRange||e.isFetching||t.start<e.fetchRange.start||t.end>e.fetchRange.end:!e.latestFetchId}function lu(e,t,n,r,i){let a={};for(let o in e){let s=e[o];t[o]?a[o]=uu(s,n,r,i):a[o]=s}return a}function uu(e,t,n,r){let{options:i,calendarApi:a}=r,o=r.pluginHooks.eventSourceDefs[e.sourceDefId],s=Wr();return o.fetch({eventSource:e,range:t,isRefetch:n,context:r},n=>{let{rawEvents:o}=n;i.eventSourceSuccess&&(o=i.eventSourceSuccess.call(a,o,n.response)||o),e.success&&(o=e.success.call(a,o,n.response)||o),r.dispatch({type:`RECEIVE_EVENTS`,sourceId:e.sourceId,fetchId:s,fetchRange:t,rawEvents:o})},n=>{let o=!1;i.eventSourceFailure&&(i.eventSourceFailure.call(a,n),o=!0),e.failure&&(e.failure(n),o=!0),o||console.warn(n.message,n),r.dispatch({type:`RECEIVE_EVENT_ERROR`,sourceId:e.sourceId,fetchId:s,fetchRange:t,error:n})}),Object.assign(Object.assign({},e),{isFetching:!0,latestFetchId:s})}function du(e,t,n,r){let i=e[t];return i&&n===i.latestFetchId?Object.assign(Object.assign({},e),{[t]:Object.assign(Object.assign({},i),{isFetching:!1,fetchRange:r})}):e}function fu(e,t){return ba(e,e=>mu(e,t))}function pu(e,t){let n=Uo(t),r=[].concat(e.eventSources||[]),i=[];e.initialEvents&&r.unshift(e.initialEvents),e.events&&r.unshift(e.events);for(let e of r){let r=Ho(e,t,n);r&&i.push(r)}return i}function mu(e,t){return!t.pluginHooks.eventSourceDefs[e.sourceDefId].ignoreRange}function hu(e,t){switch(t.type){case`UNSELECT_DATES`:return null;case`SELECT_DATES`:return t.selection;default:return e}}function gu(e,t){switch(t.type){case`UNSELECT_EVENT`:return``;case`SELECT_EVENT`:return t.eventInstanceId;default:return e}}function _u(e,t){let n;switch(t.type){case`UNSET_EVENT_DRAG`:return null;case`SET_EVENT_DRAG`:return n=t.state,{affectedEvents:n.affectedEvents,mutatedEvents:n.mutatedEvents,isEvent:n.isEvent};default:return e}}function vu(e,t){let n;switch(t.type){case`UNSET_EVENT_RESIZE`:return null;case`SET_EVENT_RESIZE`:return n=t.state,{affectedEvents:n.affectedEvents,mutatedEvents:n.mutatedEvents,isEvent:n.isEvent};default:return e}}function yu(e,t,n,r,i){return{header:e.headerToolbar?bu(e.headerToolbar,e,t,n,r,i):null,footer:e.footerToolbar?bu(e.footerToolbar,e,t,n,r,i):null}}function bu(e,t,n,r,i,a){let o={},s=[],c=!1;for(let l in e){let u=e[l],d=xu(u,t,n,r,i,a);o[l]=d.widgets,s.push(...d.viewsWithButtons),c||=d.hasTitle}return{sectionWidgets:o,viewsWithButtons:s,hasTitle:c}}function xu(e,t,n,r,i,a){let o=t.direction===`rtl`,s=t.customButtons||{},c=n.buttonText||{},l=t.buttonText||{},u=n.buttonHints||{},d=t.buttonHints||{},f=e?e.split(` `):[],p=[],m=!1;return{widgets:f.map(e=>e.split(`,`).map(e=>{if(e===`title`)return m=!0,{buttonName:e};let n,f,h,g,_,v;if(n=s[e])h=e=>{n.click&&n.click.call(e.target,e,e.target)},(g=r.getCustomButtonIconClass(n))||(g=r.getIconClass(e,o))||(_=n.text),v=n.hint||n.text;else if(f=i[e]){p.push(e),h=()=>{a.changeView(e)},(_=f.buttonTextOverride)||(g=r.getIconClass(e,o))||(_=f.buttonTextDefault);let n=f.buttonTextOverride||f.buttonTextDefault;v=Xr(f.buttonTitleOverride||f.buttonTitleDefault||t.viewHint,[n,e],n)}else if(a[e])if(h=()=>{a[e]()},(_=c[e])||(g=r.getIconClass(e,o))||(_=l[e]),e===`prevYear`||e===`nextYear`){let t=e===`prevYear`?`prev`:`next`;v=Xr(u[t]||d[t],[l.year||`year`,`year`],l[e])}else v=t=>Xr(u[e]||d[e],[l[t]||t,t],l[e]);return{buttonName:e,buttonClick:h,buttonIcon:g,buttonText:_,buttonHint:v}})),viewsWithButtons:p,hasTitle:m}}var Su=class{constructor(e,t,n){this.type=e,this.getCurrentData=t,this.dateEnv=n}get calendar(){return this.getCurrentData().calendarApi}get title(){return this.getCurrentData().viewTitle}get activeStart(){return this.dateEnv.toDate(this.getCurrentData().dateProfile.activeRange.start)}get activeEnd(){return this.dateEnv.toDate(this.getCurrentData().dateProfile.activeRange.end)}get currentStart(){return this.dateEnv.toDate(this.getCurrentData().dateProfile.currentRange.start)}get currentEnd(){return this.dateEnv.toDate(this.getCurrentData().dateProfile.currentRange.end)}getOption(e){return this.getCurrentData().options[e]}},Cu=Pl({name:`array-event-source`,eventSourceDefs:[{ignoreRange:!0,parseMeta(e){return Array.isArray(e.events)?e.events:null},fetch(e,t){t({rawEvents:e.eventSource.meta})}}]}),wu=Pl({name:`func-event-source`,eventSourceDefs:[{parseMeta(e){return typeof e.events==`function`?e.events:null},fetch(e,t,n){let{dateEnv:r}=e.context,i=e.eventSource.meta;Bs(i.bind(null,Ls(e.range,r)),e=>t({rawEvents:e}),n)}}]}),Tu=Pl({name:`json-event-source`,eventSourceRefiners:{method:String,extraParams:Y,startParam:String,endParam:String,timeZoneParam:String},eventSourceDefs:[{parseMeta(e){return e.url&&(e.format===`json`||!e.format)?{url:e.url,format:`json`,method:(e.method||`GET`).toUpperCase(),extraParams:e.extraParams,startParam:e.startParam,endParam:e.endParam,timeZoneParam:e.timeZoneParam}:null},fetch(e,t,n){let{meta:r}=e.eventSource,i=Eu(r,e.range,e.context);Hs(r.method,r.url,i).then(([e,n])=>{t({rawEvents:e,response:n})},n)}}]});function Eu(e,t,n){let{dateEnv:r,options:i}=n,a,o,s,c,l={};return a=e.startParam,a??=i.startParam,o=e.endParam,o??=i.endParam,s=e.timeZoneParam,s??=i.timeZoneParam,c=typeof e.extraParams==`function`?e.extraParams():e.extraParams||{},Object.assign(l,c),l[a]=r.formatIso(t.start),l[o]=r.formatIso(t.end),r.timeZone!==`local`&&(l[s]=r.timeZone),l}var Du=Pl({name:`simple-recurring-event`,recurringTypes:[{parse(e,t){if(e.daysOfWeek||e.startTime||e.endTime||e.startRecur||e.endRecur){let n={daysOfWeek:e.daysOfWeek||null,startTime:e.startTime||null,endTime:e.endTime||null,startRecur:e.startRecur?t.createMarker(e.startRecur):null,endRecur:e.endRecur?t.createMarker(e.endRecur):null,dateEnv:t},r;return e.duration&&(r=e.duration),!r&&e.startTime&&e.endTime&&(r=ai(e.endTime,e.startTime)),{allDayGuess:!e.startTime&&!e.endTime,duration:r,typeData:n}}return null},expand(e,t,n){let r=io(t,{start:e.startRecur,end:e.endRecur});return r?Ou(e.daysOfWeek,e.startTime,e.dateEnv,n,r):[]}}],eventRefiners:{daysOfWeek:Y,startTime:H,endTime:H,duration:H,startRecur:Y,endRecur:Y}});function Ou(e,t,n,r,i){let a=e?Sa(e):null,o=G(i.start),s=i.end,c=[];for(t&&(t.milliseconds<0?s=W(s,1):t.milliseconds>=1e3*60*60*24&&(o=W(o,-1)));o<s;){let e;(!a||a[o.getUTCDay()])&&(e=t?r.add(o,t):o,c.push(r.createMarker(n.toDate(e)))),o=W(o,1)}return c}var ku=Pl({name:`change-handler`,optionChangeHandlers:{events(e,t){Au([e],t)},eventSources:Au}});function Au(e,t){let n=Ca(t.getCurrentData().eventSources);if(n.length===1&&e.length===1&&Array.isArray(n[0]._raw)&&Array.isArray(e[0])){t.dispatch({type:`RESET_RAW_EVENTS`,sourceId:n[0].sourceId,rawEvents:e[0]});return}let r=[];for(let t of e){let e=!1;for(let r=0;r<n.length;r+=1)if(n[r]._raw===t){n.splice(r,1),e=!0;break}e||r.push(t)}for(let e of n)t.dispatch({type:`REMOVE_EVENT_SOURCE`,sourceId:e.sourceId});for(let e of r)t.calendarApi.addEventSource(e)}function ju(e,t){t.emitter.trigger(`datesSet`,Object.assign(Object.assign({},Ls(e.activeRange,t.dateEnv)),{view:t.viewApi}))}function Mu(e,t){let{emitter:n}=t;n.hasHandlers(`eventsSet`)&&n.trigger(`eventsSet`,gs(e,t))}var Nu=[Cu,wu,Tu,Du,ku,Pl({name:`misc`,isLoadingFuncs:[e=>iu(e.eventSources)],propSetHandlers:{dateProfile:ju,eventStore:Mu}})],Pu=class{constructor(e,t){this.runTaskOption=e,this.drainedOption=t,this.queue=[],this.delayedRunner=new Dr(this.drain.bind(this))}request(e,t){this.queue.push(e),this.delayedRunner.request(t)}pause(e){this.delayedRunner.pause(e)}resume(e,t){this.delayedRunner.resume(e,t)}drain(){let{queue:e}=this;for(;e.length;){let t=[],n;for(;n=e.shift();)this.runTask(n),t.push(n);this.drained(t)}}runTask(e){this.runTaskOption&&this.runTaskOption(e)}drained(e){this.drainedOption&&this.drainedOption(e)}};function Fu(e,t,n){let r;return r=/^(year|month)$/.test(e.currentRangeUnit)?e.currentRange:e.activeRange,n.formatRange(r.start,r.end,J(t.titleFormat||Iu(e)),{isEndExclusive:e.isRangeAllDay,defaultSeparator:t.titleRangeSeparator})}function Iu(e){let{currentRangeUnit:t}=e;if(t===`year`)return{year:`numeric`};if(t===`month`)return{year:`numeric`,month:`long`};let n=Ci(e.currentRange.start,e.currentRange.end);return n!==null&&n>1?{year:`numeric`,month:`short`,day:`numeric`}:{year:`numeric`,month:`long`,day:`numeric`}}var Lu=class{constructor(){this.resetListeners=new Set}handleInput(e,t){let n=this.dateEnv;if(e!==n&&(typeof t==`function`?this.nowFn=t:n||(this.nowAnchorDate=e.toDate(t?e.createMarker(t):e.createNowMarker()),this.nowAnchorQueried=Date.now()),this.dateEnv=e,n))for(let e of this.resetListeners.values())e()}getDateMarker(){return this.nowAnchorDate?this.dateEnv.timestampToMarker(this.nowAnchorDate.valueOf()+(Date.now()-this.nowAnchorQueried)):this.dateEnv.createMarker(this.nowFn())}addResetListener(e){this.resetListeners.add(e)}removeResetListener(e){this.resetListeners.delete(e)}},Ru=class{constructor(e){this.computeCurrentViewData=q(this._computeCurrentViewData),this.organizeRawLocales=q(kl),this.buildLocale=q(Al),this.buildPluginHooks=Il(),this.buildDateEnv=q(zu),this.buildTheme=q(Bu),this.parseToolbars=q(yu),this.buildViewSpecs=q(Kl),this.buildDateProfileGenerator=Bi(Vu),this.buildViewApi=q(Hu),this.buildViewUiProps=Bi(Gu),this.buildEventUiBySource=q(Uu,X),this.buildEventUiBases=q(Wu),this.parseContextBusinessHours=Bi(qu),this.buildTitle=q(Fu),this.nowManager=new Lu,this.emitter=new es,this.actionRunner=new Pu(this._handleAction.bind(this),this.updateData.bind(this)),this.currentCalendarOptionsInput={},this.currentCalendarOptionsRefined={},this.currentViewOptionsInput={},this.currentViewOptionsRefined={},this.currentCalendarOptionsRefiners={},this.optionsForRefining=[],this.optionsForHandling=[],this.getCurrentData=()=>this.data,this.dispatch=e=>{this.actionRunner.request(e)},this.props=e,this.actionRunner.pause(),this.nowManager=new Lu;let t={},n=this.computeOptionsData(e.optionOverrides,t,e.calendarApi),r=n.calendarOptions.initialView||n.pluginHooks.initialView,i=this.computeCurrentViewData(r,n,e.optionOverrides,t);e.calendarApi.currentDataManager=this,this.emitter.setThisContext(e.calendarApi),this.emitter.setOptions(i.options);let a={nowManager:this.nowManager,dateEnv:n.dateEnv,options:n.calendarOptions,pluginHooks:n.pluginHooks,calendarApi:e.calendarApi,dispatch:this.dispatch,emitter:this.emitter,getCurrentData:this.getCurrentData},o=Ql(n.calendarOptions,n.dateEnv,this.nowManager),s=i.dateProfileGenerator.build(o);oo(s.activeRange,o)||(o=s.currentRange.start);for(let e of n.pluginHooks.contextInit)e(a);let c=tu(n.calendarOptions,s,a),l={dynamicOptionOverrides:t,currentViewType:r,currentDate:o,dateProfile:s,businessHours:this.parseContextBusinessHours(a),eventSources:c,eventUiBases:{},eventStore:Ao(),renderableEventStore:Ao(),dateSelection:null,eventSelection:``,eventDrag:null,eventResize:null,selectionConfig:this.buildViewUiProps(a).selectionConfig},u=Object.assign(Object.assign({},a),l);for(let e of n.pluginHooks.reducers)Object.assign(l,e(null,null,u));Ku(l,a)&&this.emitter.trigger(`loading`,!0),this.state=l,this.updateData(),this.actionRunner.resume()}resetOptions(e,t){let{props:n}=this;t===void 0?n.optionOverrides=e:(n.optionOverrides=Object.assign(Object.assign({},n.optionOverrides||{}),e),this.optionsForRefining.push(...t)),(t===void 0||t.length)&&this.actionRunner.request({type:`NOTHING`})}_handleAction(e){let{props:t,state:n,emitter:r}=this,i=$l(n.dynamicOptionOverrides,e),a=this.computeOptionsData(t.optionOverrides,i,t.calendarApi),o=Xl(n.currentViewType,e),s=this.computeCurrentViewData(o,a,t.optionOverrides,i);t.calendarApi.currentDataManager=this,r.setThisContext(t.calendarApi),r.setOptions(s.options);let c={nowManager:this.nowManager,dateEnv:a.dateEnv,options:a.calendarOptions,pluginHooks:a.pluginHooks,calendarApi:t.calendarApi,dispatch:this.dispatch,emitter:r,getCurrentData:this.getCurrentData},{currentDate:l,dateProfile:u}=n;this.data&&this.data.dateProfileGenerator!==s.dateProfileGenerator&&(u=s.dateProfileGenerator.build(l)),l=Zl(l,e),u=eu(u,e,l,s.dateProfileGenerator),(e.type===`PREV`||e.type===`NEXT`||!oo(u.currentRange,l))&&(l=u.currentRange.start);let d=nu(n.eventSources,e,u,c),f=Go(n.eventStore,e,d,u,c),p=iu(d)&&!s.options.progressiveEventRendering&&n.renderableEventStore||f,{eventUiSingleBase:m,selectionConfig:h}=this.buildViewUiProps(c),g=this.buildEventUiBySource(d),_=this.buildEventUiBases(p.defs,m,g),v={dynamicOptionOverrides:i,currentViewType:o,currentDate:l,dateProfile:u,eventSources:d,eventStore:f,renderableEventStore:p,selectionConfig:h,eventUiBases:_,businessHours:this.parseContextBusinessHours(c),dateSelection:hu(n.dateSelection,e),eventSelection:gu(n.eventSelection,e),eventDrag:_u(n.eventDrag,e),eventResize:vu(n.eventResize,e)},y=Object.assign(Object.assign({},c),v);for(let t of a.pluginHooks.reducers)Object.assign(v,t(n,e,y));let b=Ku(n,c),x=Ku(v,c);!b&&x?r.trigger(`loading`,!0):b&&!x&&r.trigger(`loading`,!1),this.state=v,t.onAction&&t.onAction(e)}updateData(){let{props:e,state:t}=this,n=this.data,r=this.computeOptionsData(e.optionOverrides,t.dynamicOptionOverrides,e.calendarApi),i=this.computeCurrentViewData(t.currentViewType,r,e.optionOverrides,t.dynamicOptionOverrides),a=this.data=Object.assign(Object.assign(Object.assign({nowManager:this.nowManager,viewTitle:this.buildTitle(t.dateProfile,i.options,r.dateEnv),calendarApi:e.calendarApi,dispatch:this.dispatch,emitter:this.emitter,getCurrentData:this.getCurrentData},r),i),t),o=r.pluginHooks.optionChangeHandlers,s=n&&n.calendarOptions,c=r.calendarOptions;if(s&&s!==c){s.timeZone!==c.timeZone&&(t.eventSources=a.eventSources=ru(a.eventSources,t.dateProfile,a),t.eventStore=a.eventStore=Zo(a.eventStore,n.dateEnv,a.dateEnv),t.renderableEventStore=a.renderableEventStore=Zo(a.renderableEventStore,n.dateEnv,a.dateEnv));for(let e in o)(this.optionsForHandling.indexOf(e)!==-1||s[e]!==c[e])&&o[e](c[e],a)}this.optionsForHandling=[],e.onData&&e.onData(a)}computeOptionsData(e,t,n){if(!this.optionsForRefining.length&&e===this.stableOptionOverrides&&t===this.stableDynamicOptionOverrides)return this.stableCalendarOptionsData;let{refinedOptions:r,pluginHooks:i,localeDefaults:a,availableLocaleData:o,extra:s}=this.processRawCalendarOptions(e,t);Ju(s);let c=this.buildDateEnv(r.timeZone,r.locale,r.weekNumberCalculation,r.firstDay,r.weekText,i,o,r.defaultRangeSeparator),l=this.buildViewSpecs(i.views,this.stableOptionOverrides,this.stableDynamicOptionOverrides,a),u=this.buildTheme(r,i);return this.stableCalendarOptionsData={calendarOptions:r,pluginHooks:i,dateEnv:c,viewSpecs:l,theme:u,toolbarConfig:this.parseToolbars(r,this.stableOptionOverrides,u,l,n),localeDefaults:a,availableRawLocales:o.map}}processRawCalendarOptions(e,t){let{locales:n,locale:r}=ga([la,e,t]),i=this.organizeRawLocales(n),a=i.map,o=this.buildLocale(r||i.defaultCode,a).options,s=this.buildPluginHooks(e.plugins||[],Nu),c=this.currentCalendarOptionsRefiners=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},ca),ua),da),s.listenerRefiners),s.optionRefiners),l={},u=ga([la,o,e,t]),d={},f=this.currentCalendarOptionsInput,p=this.currentCalendarOptionsRefined,m=!1;for(let e in u)this.optionsForRefining.indexOf(e)===-1&&(u[e]===f[e]||fa[e]&&e in f&&fa[e](f[e],u[e]))?d[e]=p[e]:c[e]?(d[e]=c[e](u[e]),m=!0):l[e]=f[e];return m&&(this.currentCalendarOptionsInput=u,this.currentCalendarOptionsRefined=d,this.stableOptionOverrides=e,this.stableDynamicOptionOverrides=t),this.optionsForHandling.push(...this.optionsForRefining),this.optionsForRefining=[],{rawOptions:this.currentCalendarOptionsInput,refinedOptions:this.currentCalendarOptionsRefined,pluginHooks:s,availableLocaleData:i,localeDefaults:o,extra:l}}_computeCurrentViewData(e,t,n,r){let i=t.viewSpecs[e];if(!i)throw Error(`viewType "${e}" is not available. Please make sure you've loaded all neccessary plugins`);let{refinedOptions:a,extra:o}=this.processRawViewOptions(i,t.pluginHooks,t.localeDefaults,n,r);return Ju(o),this.nowManager.handleInput(t.dateEnv,a.now),{viewSpec:i,options:a,dateProfileGenerator:this.buildDateProfileGenerator({dateProfileGeneratorClass:i.optionDefaults.dateProfileGeneratorClass,nowManager:this.nowManager,duration:i.duration,durationUnit:i.durationUnit,usesMinMaxTime:i.optionDefaults.usesMinMaxTime,dateEnv:t.dateEnv,calendarApi:this.props.calendarApi,slotMinTime:a.slotMinTime,slotMaxTime:a.slotMaxTime,showNonCurrentDates:a.showNonCurrentDates,dayCount:a.dayCount,dateAlignment:a.dateAlignment,dateIncrement:a.dateIncrement,hiddenDays:a.hiddenDays,weekends:a.weekends,validRangeInput:a.validRange,visibleRangeInput:a.visibleRange,fixedWeekCount:a.fixedWeekCount}),viewApi:this.buildViewApi(e,this.getCurrentData,t.dateEnv)}}processRawViewOptions(e,t,n,r,i){let a=ga([la,e.optionDefaults,n,r,e.optionOverrides,i]),o=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},ca),ua),da),ha),t.listenerRefiners),t.optionRefiners),s={},c=this.currentViewOptionsInput,l=this.currentViewOptionsRefined,u=!1,d={};for(let e in a)a[e]===c[e]||fa[e]&&fa[e](a[e],c[e])?s[e]=l[e]:(a[e]===this.currentCalendarOptionsInput[e]||fa[e]&&fa[e](a[e],this.currentCalendarOptionsInput[e])?e in this.currentCalendarOptionsRefined&&(s[e]=this.currentCalendarOptionsRefined[e]):o[e]?s[e]=o[e](a[e]):d[e]=a[e],u=!0);return u&&(this.currentViewOptionsInput=a,this.currentViewOptionsRefined=s),{rawOptions:this.currentViewOptionsInput,refinedOptions:this.currentViewOptionsRefined,extra:d}}};function zu(e,t,n,r,i,a,o,s){let c=Al(t||o.defaultCode,o.map);return new Fa({calendarSystem:`gregory`,timeZone:e,namedTimeZoneImpl:a.namedTimeZonedImpl,locale:c,weekNumberCalculation:n,firstDay:r,weekText:i,cmdFormatter:a.cmdFormatter,defaultSeparator:s})}function Bu(e,t){return new(t.themeClasses[e.themeSystem]||zl)(e)}function Vu(e){return new(e.dateProfileGeneratorClass||fo)(e)}function Hu(e,t,n){return new Su(e,t,n)}function Uu(e){return xa(e,e=>e.ui)}function Wu(e,t,n){let r={"":t};for(let t in e){let i=e[t];i.sourceId&&n[i.sourceId]&&(r[t]=n[i.sourceId])}return r}function Gu(e){let{options:t}=e;return{eventUiSingleBase:Ro({display:t.eventDisplay,editable:t.editable,startEditable:t.eventStartEditable,durationEditable:t.eventDurationEditable,constraint:t.eventConstraint,overlap:typeof t.eventOverlap==`boolean`?t.eventOverlap:void 0,allow:t.eventAllow,backgroundColor:t.eventBackgroundColor,borderColor:t.eventBorderColor,textColor:t.eventTextColor,color:t.eventColor},e),selectionConfig:Ro({constraint:t.selectConstraint,overlap:typeof t.selectOverlap==`boolean`?t.selectOverlap:void 0,allow:t.selectAllow},e)}}function Ku(e,t){for(let n of t.pluginHooks.isLoadingFuncs)if(n(e))return!0;return!1}function qu(e){return is(e.options.businessHours,e)}function Ju(e,t){for(let n in e)console.warn(`Unknown option '${n}'`+(t?` for view '${t}'`:``))}var Yu=class extends Z{render(){return L(`div`,{className:`fc-toolbar-chunk`},...this.props.widgetGroups.map(e=>this.renderWidgetGroup(e)))}renderWidgetGroup(e){let{props:t}=this,{theme:n}=this.context,r=[],i=!0;for(let a of e){let{buttonName:e,buttonClick:o,buttonText:s,buttonIcon:c,buttonHint:l}=a;if(e===`title`)i=!1,r.push(L(`h2`,{className:`fc-toolbar-title`,id:t.titleId},t.title));else{let i=e===t.activeButton,a=!t.isTodayEnabled&&e===`today`||!t.isPrevEnabled&&e===`prev`||!t.isNextEnabled&&e===`next`,u=[`fc-${e}-button`,n.getClass(`button`)];i&&u.push(n.getClass(`buttonActive`)),r.push(L(`button`,{type:`button`,title:typeof l==`function`?l(t.navUnit):l,disabled:a,"aria-pressed":i,className:u.join(` `),onClick:o},s||(c?L(`span`,{className:c,role:`img`}):``)))}}return r.length>1?L(`div`,{className:i&&n.getClass(`buttonGroup`)||``},...r):r[0]}},Xu=class extends Z{render(){let{model:e,extraClassName:t}=this.props,n=!1,r,i,a=e.sectionWidgets,o=a.center;return a.left?(n=!0,r=a.left):r=a.start,a.right?(n=!0,i=a.right):i=a.end,L(`div`,{className:[t||``,`fc-toolbar`,n?`fc-toolbar-ltr`:``].join(` `)},this.renderSection(`start`,r||[]),this.renderSection(`center`,o||[]),this.renderSection(`end`,i||[]))}renderSection(e,t){let{props:n}=this;return L(Yu,{key:e,widgetGroups:t,title:n.title,navUnit:n.navUnit,activeButton:n.activeButton,isTodayEnabled:n.isTodayEnabled,isPrevEnabled:n.isPrevEnabled,isNextEnabled:n.isNextEnabled,titleId:n.titleId})}},Zu=class extends Z{constructor(){super(...arguments),this.state={availableWidth:null},this.handleEl=e=>{this.el=e,Q(this.props.elRef,e),this.updateAvailableWidth()},this.handleResize=()=>{this.updateAvailableWidth()}}render(){let{props:e,state:t}=this,{aspectRatio:n}=e,r=[`fc-view-harness`,n||e.liquid||e.height?`fc-view-harness-active`:`fc-view-harness-passive`],i=``,a=``;return n?t.availableWidth===null?a=`${1/n*100}%`:i=t.availableWidth/n:i=e.height||``,L(`div`,{"aria-labelledby":e.labeledById,ref:this.handleEl,className:r.join(` `),style:{height:i,paddingBottom:a}},e.children)}componentDidMount(){this.context.addResizeHandler(this.handleResize)}componentWillUnmount(){this.context.removeResizeHandler(this.handleResize)}updateAvailableWidth(){this.el&&this.props.aspectRatio&&this.setState({availableWidth:this.el.offsetWidth})}},Qu=class extends qs{constructor(e){super(e),this.handleSegClick=(e,t)=>{let{component:n}=this,{context:r}=n,i=bs(t);if(i&&n.isValidSegDownEl(e.target)){let a=kr(e.target,`.fc-event-forced-url`),o=a?a.querySelector(`a[href]`).href:``;r.emitter.trigger(`eventClick`,{el:t,event:new ms(n.context,i.eventRange.def,i.eventRange.instance),jsEvent:e,view:r.viewApi}),o&&!e.defaultPrevented&&(window.location.href=o)}},this.destroy=zr(e.el,`click`,`.fc-event`,this.handleSegClick)}},$u=class extends qs{constructor(e){super(e),this.handleEventElRemove=e=>{e===this.currentSegEl&&this.handleSegLeave(null,this.currentSegEl)},this.handleSegEnter=(e,t)=>{bs(t)&&(this.currentSegEl=t,this.triggerEvent(`eventMouseEnter`,e,t))},this.handleSegLeave=(e,t)=>{this.currentSegEl&&(this.currentSegEl=null,this.triggerEvent(`eventMouseLeave`,e,t))},this.removeHoverListeners=Br(e.el,`.fc-event`,this.handleSegEnter,this.handleSegLeave)}destroy(){this.removeHoverListeners()}triggerEvent(e,t,n){let{component:r}=this,{context:i}=r,a=bs(n);(!t||r.isValidSegDownEl(t.target))&&i.emitter.trigger(e,{el:n,event:new ms(i,a.eventRange.def,a.eventRange.instance),jsEvent:t,view:i.viewApi})}},ed=class extends Ua{constructor(){super(...arguments),this.buildViewContext=q(Ha),this.buildViewPropTransformers=q(nd),this.buildToolbarProps=q(td),this.headerRef=R(),this.footerRef=R(),this.interactionsStore={},this.state={viewLabelId:Lr()},this.registerInteractiveComponent=(e,t)=>{let n=Js(e,t),r=[Qu,$u].concat(this.props.pluginHooks.componentInteractions).map(e=>new e(n));this.interactionsStore[e.uid]=r,Ys[e.uid]=n},this.unregisterInteractiveComponent=e=>{let t=this.interactionsStore[e.uid];if(t){for(let e of t)e.destroy();delete this.interactionsStore[e.uid]}delete Ys[e.uid]},this.resizeRunner=new Dr(()=>{this.props.emitter.trigger(`_resize`,!0),this.props.emitter.trigger(`windowResize`,{view:this.props.viewApi})}),this.handleWindowResize=e=>{let{options:t}=this.props;t.handleWindowResize&&e.target===window&&this.resizeRunner.request(t.windowResizeDelay)}}render(){let{props:e}=this,{toolbarConfig:t,options:n}=e,r=!1,i=``,a;e.isHeightAuto||e.forPrint?i=``:n.height==null?n.contentHeight==null?a=Math.max(n.aspectRatio,.5):i=n.contentHeight:r=!0;let o=this.buildViewContext(e.viewSpec,e.viewApi,e.options,e.dateProfileGenerator,e.dateEnv,e.nowManager,e.theme,e.pluginHooks,e.dispatch,e.getCurrentData,e.emitter,e.calendarApi,this.registerInteractiveComponent,this.unregisterInteractiveComponent),s=t.header&&t.header.hasTitle?this.state.viewLabelId:void 0;return L(Va.Provider,{value:o},L(Xs,{unit:`day`},n=>{let o=this.buildToolbarProps(e.viewSpec,e.dateProfile,e.dateProfileGenerator,e.currentDate,n,e.viewTitle);return L(z,null,t.header&&L(Xu,Object.assign({ref:this.headerRef,extraClassName:`fc-header-toolbar`,model:t.header,titleId:s},o)),L(Zu,{liquid:r,height:i,aspectRatio:a,labeledById:s},this.renderView(e),this.buildAppendContent()),t.footer&&L(Xu,Object.assign({ref:this.footerRef,extraClassName:`fc-footer-toolbar`,model:t.footer,titleId:``},o)))}))}componentDidMount(){let{props:e}=this;this.calendarInteractions=e.pluginHooks.calendarInteractions.map(t=>new t(e)),window.addEventListener(`resize`,this.handleWindowResize);let{propSetHandlers:t}=e.pluginHooks;for(let n in t)t[n](e[n],e)}componentDidUpdate(e){let{props:t}=this,{propSetHandlers:n}=t.pluginHooks;for(let r in n)t[r]!==e[r]&&n[r](t[r],t)}componentWillUnmount(){window.removeEventListener(`resize`,this.handleWindowResize),this.resizeRunner.clear();for(let e of this.calendarInteractions)e.destroy();this.props.emitter.trigger(`_unmount`)}buildAppendContent(){let{props:e}=this;return L(z,{},...e.pluginHooks.viewContainerAppends.map(t=>t(e)))}renderView(e){let{pluginHooks:t}=e,{viewSpec:n}=e,r={dateProfile:e.dateProfile,businessHours:e.businessHours,eventStore:e.renderableEventStore,eventUiBases:e.eventUiBases,dateSelection:e.dateSelection,eventSelection:e.eventSelection,eventDrag:e.eventDrag,eventResize:e.eventResize,isHeightAuto:e.isHeightAuto,forPrint:e.forPrint},i=this.buildViewPropTransformers(t.viewPropsTransformers);for(let t of i)Object.assign(r,t.transform(r,e));let a=n.component;return L(a,Object.assign({},r))}};function td(e,t,n,r,i,a){let o=n.build(i,void 0,!1),s=n.buildPrev(t,r,!1),c=n.buildNext(t,r,!1);return{title:a,activeButton:e.type,navUnit:e.singleUnit,isTodayEnabled:o.isValid&&!oo(t.currentRange,i),isPrevEnabled:s.isValid,isNextEnabled:c.isValid}}function nd(e){return e.map(e=>new e)}var rd=class extends Qs{constructor(e,t={}){super(),this.isRendering=!1,this.isRendered=!1,this.currentClassNames=[],this.customContentRenderId=0,this.handleAction=e=>{switch(e.type){case`SET_EVENT_DRAG`:case`SET_EVENT_RESIZE`:this.renderRunner.tryDrain()}},this.handleData=e=>{this.currentData=e,this.renderRunner.request(e.calendarOptions.rerenderDelay)},this.handleRenderRequest=()=>{if(this.isRendering){this.isRendered=!0;let{currentData:e}=this;La(()=>{kn(L(Ks,{options:e.calendarOptions,theme:e.theme,emitter:e.emitter},(t,n,r,i)=>(this.setClassNames(t),this.setHeight(n),L(Xa.Provider,{value:this.customContentRenderId},L(ed,Object.assign({isHeightAuto:r,forPrint:i},e))))),this.el)})}else this.isRendered&&(this.isRendered=!1,kn(null,this.el),this.setClassNames([]),this.setHeight(``))},br(e),this.el=e,this.renderRunner=new Dr(this.handleRenderRequest),new Ru({optionOverrides:t,calendarApi:this,onAction:this.handleAction,onData:this.handleData})}render(){let e=this.isRendering;e?this.customContentRenderId+=1:this.isRendering=!0,this.renderRunner.request(),e&&this.updateSize()}destroy(){this.isRendering&&(this.isRendering=!1,this.renderRunner.request())}updateSize(){La(()=>{super.updateSize()})}batchRendering(e){this.renderRunner.pause(`batchRendering`),e(),this.renderRunner.resume(`batchRendering`)}pauseRendering(){this.renderRunner.pause(`pauseRendering`)}resumeRendering(){this.renderRunner.resume(`pauseRendering`,!0)}resetOptions(e,t){this.currentDataManager.resetOptions(e,t)}setClassNames(e){if(!fi(e,this.currentClassNames)){let{classList:t}=this.el;for(let e of this.currentClassNames)t.remove(e);for(let n of e)t.add(n);this.currentClassNames=e}}setHeight(e){Pr(this.el,`height`,e)}},id=parseInt(`19.2.5`.split(`.`)[0])<18,ad=class extends N.Component{constructor(){super(...arguments),this.elRef=(0,N.createRef)(),this.isUpdating=!1,this.isUnmounting=!1,this.state={customRenderingMap:new Map},this.requestResize=()=>{this.isUnmounting||(this.cancelResize(),this.resizeId=requestAnimationFrame(()=>{this.doResize()}))}}render(){let e=[];for(let t of this.state.customRenderingMap.values())e.push(N.createElement(od,{key:t.id,customRendering:t}));return N.createElement(`div`,{ref:this.elRef},e)}componentDidMount(){this.isUnmounting=!1;let e=new Tl;this.handleCustomRendering=e.handle.bind(e),this.calendar=new rd(this.elRef.current,Object.assign(Object.assign({},this.props),{handleCustomRendering:this.handleCustomRendering})),this.calendar.render(),this.calendar.on(`_beforeprint`,()=>{(0,Fe.flushSync)(()=>{})});let t;e.subscribe(e=>{let n=Date.now(),r=!t;(id||r||this.isUpdating||this.isUnmounting||n-t<100?sd:Fe.flushSync)(()=>{this.setState({customRenderingMap:e},()=>{t=n,r?this.doResize():this.requestResize()})})})}componentDidUpdate(){this.isUpdating=!0,this.calendar.resetOptions(Object.assign(Object.assign({},this.props),{handleCustomRendering:this.handleCustomRendering})),this.isUpdating=!1}componentWillUnmount(){this.isUnmounting=!0,this.cancelResize(),this.calendar.destroy()}doResize(){this.calendar.updateSize()}cancelResize(){this.resizeId!==void 0&&(cancelAnimationFrame(this.resizeId),this.resizeId=void 0)}getApi(){return this.calendar}};ad.act=sd;var od=class extends N.PureComponent{render(){let{customRendering:e}=this.props,{generatorMeta:t}=e;return(0,Fe.createPortal)(typeof t==`function`?t(e.renderProps):t,e.containerEl)}};function sd(e){e()}var cd=class extends gc{constructor(){super(...arguments),this.headerElRef=R()}renderSimpleLayout(e,t){let{props:n,context:r}=this,i=[],a=Zc(r.options);return e&&i.push({type:`header`,key:`header`,isSticky:a,chunk:{elRef:this.headerElRef,tableClassName:`fc-col-header`,rowContent:e}}),i.push({type:`body`,key:`body`,liquid:!0,chunk:{content:t}}),L($a,{elClasses:[`fc-daygrid`],viewSpec:r.viewSpec},L($c,{liquid:!n.isHeightAuto&&!n.forPrint,collapsibleWidth:n.forPrint,cols:[],sections:i}))}renderHScrollLayout(e,t,n,r){let i=this.context.pluginHooks.scrollGridImpl;if(!i)throw Error(`No ScrollGrid implementation`);let{props:a,context:o}=this,s=!a.forPrint&&Zc(o.options),c=!a.forPrint&&Qc(o.options),l=[];return e&&l.push({type:`header`,key:`header`,isSticky:s,chunks:[{key:`main`,elRef:this.headerElRef,tableClassName:`fc-col-header`,rowContent:e}]}),l.push({type:`body`,key:`body`,liquid:!0,chunks:[{key:`main`,content:t}]}),c&&l.push({type:`footer`,key:`footer`,isSticky:!0,chunks:[{key:`main`,content:Xc}]}),L($a,{elClasses:[`fc-daygrid`],viewSpec:o.viewSpec},L(i,{liquid:!a.isHeightAuto&&!a.forPrint,forPrint:a.forPrint,collapsibleWidth:a.forPrint,colGroups:[{cols:[{span:n,minWidth:r}]}],sections:l}))}};function ld(e,t){let n=[];for(let e=0;e<t;e+=1)n[e]=[];for(let t of e)n[t.row].push(t);return n}function ud(e,t){let n=[];for(let e=0;e<t;e+=1)n[e]=[];for(let t of e)n[t.firstCol].push(t);return n}function dd(e,t){let n=[];if(e){for(let r=0;r<t;r+=1)n[r]={affectedInstances:e.affectedInstances,isEvent:e.isEvent,segs:[]};for(let t of e.segs)n[t.row].segs.push(t)}else for(let e=0;e<t;e+=1)n[e]=null;return n}var fd=J({hour:`numeric`,minute:`2-digit`,omitZeroMinute:!0,meridiem:`narrow`});function pd(e){let{display:t}=e.eventRange.ui;return t===`list-item`||t===`auto`&&!e.eventRange.def.allDay&&e.firstCol===e.lastCol&&e.isStart&&e.isEnd}var md=class extends Z{render(){let{props:e}=this;return L(nl,Object.assign({},e,{elClasses:[`fc-daygrid-event`,`fc-daygrid-block-event`,`fc-h-event`],defaultTimeFormat:fd,defaultDisplayEventEnd:e.defaultDisplayEventEnd,disableResizing:!e.seg.eventRange.def.allDay}))}},hd=class extends Z{render(){let{props:e,context:t}=this,{options:n}=t,{seg:r}=e,i=Os(r,n.eventTimeFormat||fd,t,!0,e.defaultDisplayEventEnd);return L(tl,Object.assign({},e,{elTag:`a`,elClasses:[`fc-daygrid-event`,`fc-daygrid-dot-event`],elAttrs:Ms(e.seg,t),defaultGenerator:gd,timeText:i,isResizing:!1,isDateSelecting:!1}))}};function gd(e){return L(z,null,L(`div`,{className:`fc-daygrid-event-dot`,style:{borderColor:e.borderColor||e.backgroundColor}}),e.timeText&&L(`div`,{className:`fc-event-time`},e.timeText),L(`div`,{className:`fc-event-title`},e.event.title||L(z,null,`\xA0`)))}var _d=class extends Z{constructor(){super(...arguments),this.compileSegs=q(vd)}render(){let{props:e}=this,{allSegs:t,invisibleSegs:n}=this.compileSegs(e.singlePlacements);return L(_l,{elClasses:[`fc-daygrid-more-link`],dateProfile:e.dateProfile,todayRange:e.todayRange,allDayDate:e.allDayDate,moreCnt:e.moreCnt,allSegs:t,hiddenSegs:n,alignmentElRef:e.alignmentElRef,alignGridTop:e.alignGridTop,extraDateSpan:e.extraDateSpan,popoverContent:()=>{let n=(e.eventDrag?e.eventDrag.affectedInstances:null)||(e.eventResize?e.eventResize.affectedInstances:null)||{};return L(z,null,t.map(t=>{let r=t.eventRange.instance.instanceId;return L(`div`,{className:`fc-daygrid-event-harness`,key:r,style:{visibility:n[r]?`hidden`:``}},pd(t)?L(hd,Object.assign({seg:t,isDragging:!1,isSelected:r===e.eventSelection,defaultDisplayEventEnd:!1},ks(t,e.todayRange))):L(md,Object.assign({seg:t,isDragging:!1,isResizing:!1,isDateSelecting:!1,isSelected:r===e.eventSelection,defaultDisplayEventEnd:!1},ks(t,e.todayRange))))}))}})}};function vd(e){let t=[],n=[];for(let r of e)t.push(r.seg),r.isVisible||n.push(r.seg);return{allSegs:t,invisibleSegs:n}}var yd=J({week:`narrow`}),bd=class extends gc{constructor(){super(...arguments),this.rootElRef=R(),this.state={dayNumberId:Lr()},this.handleRootEl=e=>{Q(this.rootElRef,e),Q(this.props.elRef,e)}}render(){let{context:e,props:t,state:n,rootElRef:r}=this,{options:i,dateEnv:a}=e,{date:o,dateProfile:s}=t,c=t.showDayNumber&&Sd(o,s.currentRange,a);return L(ol,{elTag:`td`,elRef:this.handleRootEl,elClasses:[`fc-daygrid-day`,...t.extraClassNames||[]],elAttrs:Object.assign(Object.assign(Object.assign({},t.extraDataAttrs),t.showDayNumber?{"aria-labelledby":n.dayNumberId}:{}),{role:`gridcell`}),defaultGenerator:xd,date:o,dateProfile:s,todayRange:t.todayRange,showDayNumber:t.showDayNumber,isMonthStart:c,extraRenderProps:t.extraRenderProps},(a,s)=>L(`div`,{ref:t.innerElRef,className:`fc-daygrid-day-frame fc-scrollgrid-sync-inner`,style:{minHeight:t.minHeight}},t.showWeekNumber&&L(fl,{elTag:`a`,elClasses:[`fc-daygrid-week-number`],elAttrs:sc(e,o,`week`),date:o,defaultFormat:yd}),!s.isDisabled&&(t.showDayNumber||sl(i)||t.forceDayTop)?L(`div`,{className:`fc-daygrid-day-top`},L(a,{elTag:`a`,elClasses:[`fc-daygrid-day-number`,c&&`fc-daygrid-month-start`],elAttrs:Object.assign(Object.assign({},sc(e,o)),{id:n.dayNumberId})})):t.showDayNumber?L(`div`,{className:`fc-daygrid-day-top`,style:{visibility:`hidden`}},L(`a`,{className:`fc-daygrid-day-number`},`\xA0`)):void 0,L(`div`,{className:`fc-daygrid-day-events`,ref:t.fgContentElRef},t.fgContent,L(`div`,{className:`fc-daygrid-day-bottom`,style:{marginTop:t.moreMarginTop}},L(_d,{allDayDate:o,singlePlacements:t.singlePlacements,moreCnt:t.moreCnt,alignmentElRef:r,alignGridTop:!t.showDayNumber,extraDateSpan:t.extraDateSpan,dateProfile:t.dateProfile,eventSelection:t.eventSelection,eventDrag:t.eventDrag,eventResize:t.eventResize,todayRange:t.todayRange}))),L(`div`,{className:`fc-daygrid-day-bg`},t.bgContent)))}};function xd(e){return e.dayNumberText||L(z,null,`\xA0`)}function Sd(e,t,n){let{start:r,end:i}=t,a=hi(i,-1),o=n.getYear(r),s=n.getMonth(r),c=n.getYear(a),l=n.getMonth(a);return!(o===c&&s===l)&&(e.valueOf()===r.valueOf()||n.getDay(e)===1&&e.valueOf()<i.valueOf())}function Cd(e){return e.eventRange.instance.instanceId+`:`+e.firstCol}function wd(e){return Cd(e)+`:`+e.lastCol}function Td(e,t,n,r,i,a,o){let s=new kd(t=>i[e[t.index].eventRange.instance.instanceId+`:`+t.span.start+`:`+(t.span.end-1)]||1);s.allowReslicing=!0,s.strictOrder=r,t===!0||n===!0?(s.maxCoord=a,s.hiddenConsumes=!0):typeof t==`number`?s.maxStackCnt=t:typeof n==`number`&&(s.maxStackCnt=n,s.hiddenConsumes=!0);let c=[],l=[];for(let t=0;t<e.length;t+=1){let n=e[t];i[wd(n)]==null?l.push(n):c.push({index:t,span:{start:n.firstCol,end:n.lastCol+1}})}let u=s.addSegs(c),{singleColPlacements:d,multiColPlacements:f,leftoverMargins:p}=Ed(s.toRects(),e,o),m=[],h=[];for(let e of l){f[e.firstCol].push({seg:e,isVisible:!1,isAbsolute:!0,absoluteTop:0,marginTop:0});for(let t=e.firstCol;t<=e.lastCol;t+=1)d[t].push({seg:Od(e,t,t+1,o),isVisible:!1,isAbsolute:!1,absoluteTop:0,marginTop:0})}for(let e=0;e<o.length;e+=1)m.push(0);for(let t of u){let n=e[t.index],r=t.span;f[r.start].push({seg:Od(n,r.start,r.end,o),isVisible:!1,isAbsolute:!0,absoluteTop:0,marginTop:0});for(let e=r.start;e<r.end;e+=1)m[e]+=1,d[e].push({seg:Od(n,e,e+1,o),isVisible:!1,isAbsolute:!1,absoluteTop:0,marginTop:0})}for(let e=0;e<o.length;e+=1)h.push(p[e]);return{singleColPlacements:d,multiColPlacements:f,moreCnts:m,moreMarginTops:h}}function Ed(e,t,n){let r=Dd(e,n.length),i=[],a=[],o=[];for(let e=0;e<n.length;e+=1){let s=r[e],c=[],l=0,u=0;for(let r of s){let i=t[r.index];c.push({seg:Od(i,e,e+1,n),isVisible:!0,isAbsolute:!1,absoluteTop:r.levelCoord,marginTop:r.levelCoord-l}),l=r.levelCoord+r.thickness}let d=[];l=0,u=0;for(let r of s){let i=t[r.index],a=r.span.end-r.span.start>1,o=r.span.start===e;u+=r.levelCoord-l,l=r.levelCoord+r.thickness,a?(u+=r.thickness,o&&d.push({seg:Od(i,r.span.start,r.span.end,n),isVisible:!0,isAbsolute:!0,absoluteTop:r.levelCoord,marginTop:0})):o&&(d.push({seg:Od(i,r.span.start,r.span.end,n),isVisible:!0,isAbsolute:!1,absoluteTop:r.levelCoord,marginTop:u}),u=0)}i.push(c),a.push(d),o.push(u)}return{singleColPlacements:i,multiColPlacements:a,leftoverMargins:o}}function Dd(e,t){let n=[];for(let e=0;e<t;e+=1)n.push([]);for(let t of e)for(let e=t.span.start;e<t.span.end;e+=1)n[e].push(t);return n}function Od(e,t,n,r){if(e.firstCol===t&&e.lastCol===n-1)return e;let i=e.eventRange,a=i.range,o=io(a,{start:r[t].date,end:W(r[n-1].date,1)});return Object.assign(Object.assign({},e),{firstCol:t,lastCol:n-1,eventRange:{def:i.def,ui:Object.assign(Object.assign({},i.ui),{durationEditable:!1}),instance:i.instance,range:o},isStart:e.isStart&&o.start.valueOf()===a.start.valueOf(),isEnd:e.isEnd&&o.end.valueOf()===a.end.valueOf()})}var kd=class extends _c{constructor(){super(...arguments),this.hiddenConsumes=!1,this.forceHidden={}}addSegs(e){let t=super.addSegs(e),{entriesByLevel:n}=this,r=e=>!this.forceHidden[yc(e)];for(let e=0;e<n.length;e+=1)n[e]=n[e].filter(r);return t}handleInvalidInsertion(e,t,n){let{entriesByLevel:r,forceHidden:i}=this,{touchingEntry:a,touchingLevel:o,touchingLateral:s}=e;if(this.hiddenConsumes&&a){let e=yc(a);if(!i[e])if(this.allowReslicing){let e=Object.assign(Object.assign({},a),{span:Sc(a.span,t.span)}),c=yc(e);i[c]=!0,r[o][s]=e,n.push(e),this.splitEntry(a,t,n)}else i[e]=!0,n.push(a)}super.handleInvalidInsertion(e,t,n)}},Ad=class extends gc{constructor(){super(...arguments),this.cellElRefs=new zc,this.frameElRefs=new zc,this.fgElRefs=new zc,this.segHarnessRefs=new zc,this.rootElRef=R(),this.state={framePositions:null,maxContentHeight:null,segHeights:{}},this.handleResize=e=>{e&&this.updateSizing(!0)}}render(){let{props:e,state:t,context:n}=this,{options:r}=n,i=e.cells.length,a=ud(e.businessHourSegs,i),o=ud(e.bgEventSegs,i),s=ud(this.getHighlightSegs(),i),c=ud(this.getMirrorSegs(),i),{singleColPlacements:l,multiColPlacements:u,moreCnts:d,moreMarginTops:f}=Td(Cs(e.fgEventSegs,r.eventOrder),e.dayMaxEvents,e.dayMaxEventRows,r.eventOrderStrict,t.segHeights,t.maxContentHeight,e.cells),p=e.eventDrag&&e.eventDrag.affectedInstances||e.eventResize&&e.eventResize.affectedInstances||{};return L(`tr`,{ref:this.rootElRef,role:`row`},e.renderIntro&&e.renderIntro(),e.cells.map((t,n)=>{let r=this.renderFgSegs(n,e.forPrint?l[n]:u[n],e.todayRange,p),i=this.renderFgSegs(n,jd(c[n],u),e.todayRange,{},!!e.eventDrag,!!e.eventResize,!1);return L(bd,{key:t.key,elRef:this.cellElRefs.createRef(t.key),innerElRef:this.frameElRefs.createRef(t.key),dateProfile:e.dateProfile,date:t.date,showDayNumber:e.showDayNumbers,showWeekNumber:e.showWeekNumbers&&n===0,forceDayTop:e.showWeekNumbers,todayRange:e.todayRange,eventSelection:e.eventSelection,eventDrag:e.eventDrag,eventResize:e.eventResize,extraRenderProps:t.extraRenderProps,extraDataAttrs:t.extraDataAttrs,extraClassNames:t.extraClassNames,extraDateSpan:t.extraDateSpan,moreCnt:d[n],moreMarginTop:f[n],singlePlacements:l[n],fgContentElRef:this.fgElRefs.createRef(t.key),fgContent:L(z,null,L(z,null,r),L(z,null,i)),bgContent:L(z,null,this.renderFillSegs(s[n],`highlight`),this.renderFillSegs(a[n],`non-business`),this.renderFillSegs(o[n],`bg-event`)),minHeight:e.cellMinHeight})}))}componentDidMount(){this.updateSizing(!0),this.context.addResizeHandler(this.handleResize)}componentDidUpdate(e,t){let n=this.props;this.updateSizing(!X(e,n))}componentWillUnmount(){this.context.removeResizeHandler(this.handleResize)}getHighlightSegs(){let{props:e}=this;return e.eventDrag&&e.eventDrag.segs.length?e.eventDrag.segs:e.eventResize&&e.eventResize.segs.length?e.eventResize.segs:e.dateSelectionSegs}getMirrorSegs(){let{props:e}=this;return e.eventResize&&e.eventResize.segs.length?e.eventResize.segs:[]}renderFgSegs(e,t,n,r,i,a,o){let{context:s}=this,{eventSelection:c}=this.props,{framePositions:l}=this.state,u=this.props.cells.length===1,d=i||a||o,f=[];if(l)for(let e of t){let{seg:t}=e,{instanceId:p}=t.eventRange.instance,m=e.isVisible&&!r[p],h=e.isAbsolute,g=``,_=``;h&&(s.isRtl?(_=0,g=l.lefts[t.lastCol]-l.lefts[t.firstCol]):(g=0,_=l.rights[t.firstCol]-l.rights[t.lastCol])),f.push(L(`div`,{className:`fc-daygrid-event-harness`+(h?` fc-daygrid-event-harness-abs`:``),key:Cd(t),ref:d?null:this.segHarnessRefs.createRef(wd(t)),style:{visibility:m?``:`hidden`,marginTop:h?``:e.marginTop,top:h?e.absoluteTop:``,left:g,right:_}},pd(t)?L(hd,Object.assign({seg:t,isDragging:i,isSelected:p===c,defaultDisplayEventEnd:u},ks(t,n))):L(md,Object.assign({seg:t,isDragging:i,isResizing:a,isDateSelecting:o,isSelected:p===c,defaultDisplayEventEnd:u},ks(t,n)))))}return f}renderFillSegs(e,t){let{isRtl:n}=this.context,{todayRange:r}=this.props,{framePositions:i}=this.state,a=[];if(i)for(let o of e){let e=n?{right:0,left:i.lefts[o.lastCol]-i.lefts[o.firstCol]}:{left:0,right:i.rights[o.firstCol]-i.rights[o.lastCol]};a.push(L(`div`,{key:js(o.eventRange),className:`fc-daygrid-bg-harness`,style:e},t===`bg-event`?L(ll,Object.assign({seg:o},ks(o,r))):dl(t)))}return L(z,{},...a)}updateSizing(e){let{props:t,state:n,frameElRefs:r}=this;if(!t.forPrint&&t.clientWidth!==null){if(e){let e=t.cells.map(e=>r.currentMap[e.key]);if(e.length){let t=this.rootElRef.current,r=new mc(t,e,!0,!1);(!n.framePositions||!n.framePositions.similarTo(r))&&this.setState({framePositions:new mc(t,e,!0,!1)})}}let i=this.state.segHeights,a=this.querySegHeights(),o=t.dayMaxEvents===!0||t.dayMaxEventRows===!0;this.safeSetState({segHeights:Object.assign(Object.assign({},i),a),maxContentHeight:o?this.computeMaxContentHeight():null})}}querySegHeights(){let e=this.segHarnessRefs.currentMap,t={};for(let n in e){let r=Math.round(e[n].getBoundingClientRect().height);t[n]=Math.max(t[n]||0,r)}return t}computeMaxContentHeight(){let e=this.props.cells[0].key,t=this.cellElRefs.currentMap[e],n=this.fgElRefs.currentMap[e];return t.getBoundingClientRect().bottom-n.getBoundingClientRect().top}getCellEls(){let e=this.cellElRefs.currentMap;return this.props.cells.map(t=>e[t.key])}};Ad.addStateEquality({segHeights:X});function jd(e,t){if(!e.length)return[];let n=Md(t);return e.map(e=>({seg:e,isVisible:!0,isAbsolute:!0,absoluteTop:n[e.eventRange.instance.instanceId],marginTop:0}))}function Md(e){let t={};for(let n of e)for(let e of n)t[e.seg.eventRange.instance.instanceId]=e.absoluteTop;return t}var Nd=class extends gc{constructor(){super(...arguments),this.splitBusinessHourSegs=q(ld),this.splitBgEventSegs=q(Pd),this.splitFgEventSegs=q(ld),this.splitDateSelectionSegs=q(ld),this.splitEventDrag=q(dd),this.splitEventResize=q(dd),this.rowRefs=new zc}render(){let{props:e,context:t}=this,n=e.cells.length,r=this.splitBusinessHourSegs(e.businessHourSegs,n),i=this.splitBgEventSegs(e.bgEventSegs,n),a=this.splitFgEventSegs(e.fgEventSegs,n),o=this.splitDateSelectionSegs(e.dateSelectionSegs,n),s=this.splitEventDrag(e.eventDrag,n),c=this.splitEventResize(e.eventResize,n),l=n>=7&&e.clientWidth?e.clientWidth/t.options.aspectRatio/6:null;return L(Xs,{unit:`day`},(t,u)=>L(z,null,e.cells.map((t,d)=>L(Ad,{ref:this.rowRefs.createRef(d),key:t.length?t[0].date.toISOString():d,showDayNumbers:n>1,showWeekNumbers:e.showWeekNumbers,todayRange:u,dateProfile:e.dateProfile,cells:t,renderIntro:e.renderRowIntro,businessHourSegs:r[d],eventSelection:e.eventSelection,bgEventSegs:i[d],fgEventSegs:a[d],dateSelectionSegs:o[d],eventDrag:s[d],eventResize:c[d],dayMaxEvents:e.dayMaxEvents,dayMaxEventRows:e.dayMaxEventRows,clientWidth:e.clientWidth,clientHeight:e.clientHeight,cellMinHeight:l,forPrint:e.forPrint}))))}componentDidMount(){this.registerInteractiveComponent()}componentDidUpdate(){this.registerInteractiveComponent()}registerInteractiveComponent(){if(!this.rootEl){let e=this.rowRefs.currentMap[0].getCellEls()[0],t=e?e.closest(`.fc-daygrid-body`):null;t&&(this.rootEl=t,this.context.registerInteractiveComponent(this,{el:t,isHitComboAllowed:this.props.isHitComboAllowed}))}}componentWillUnmount(){this.rootEl&&=(this.context.unregisterInteractiveComponent(this),null)}prepareHits(){this.rowPositions=new mc(this.rootEl,this.rowRefs.collect().map(e=>e.getCellEls()[0]),!1,!0),this.colPositions=new mc(this.rootEl,this.rowRefs.currentMap[0].getCellEls(),!0,!1)}queryHit(e,t){let{colPositions:n,rowPositions:r}=this,i=n.leftToIndex(e),a=r.topToIndex(t);if(a!=null&&i!=null){let e=this.props.cells[a][i];return{dateProfile:this.props.dateProfile,dateSpan:Object.assign({range:this.getCellRange(a,i),allDay:!0},e.extraDateSpan),dayEl:this.getCellEl(a,i),rect:{left:n.lefts[i],right:n.rights[i],top:r.tops[a],bottom:r.bottoms[a]},layer:0}}return null}getCellEl(e,t){return this.rowRefs.currentMap[e].getCellEls()[t]}getCellRange(e,t){let n=this.props.cells[e][t].date;return{start:n,end:W(n,1)}}};function Pd(e,t){return ld(e.filter(Fd),t)}function Fd(e){return e.eventRange.def.allDay}var Id=class extends gc{constructor(){super(...arguments),this.elRef=R(),this.needsScrollReset=!1}render(){let{props:e}=this,{dayMaxEventRows:t,dayMaxEvents:n,expandRows:r}=e,i=n===!0||t===!0;i&&!r&&(i=!1,t=null,n=null);let a=[`fc-daygrid-body`,i?`fc-daygrid-body-balanced`:`fc-daygrid-body-unbalanced`,r?``:`fc-daygrid-body-natural`];return L(`div`,{ref:this.elRef,className:a.join(` `),style:{width:e.clientWidth,minWidth:e.tableMinWidth}},L(`table`,{role:`presentation`,className:`fc-scrollgrid-sync-table`,style:{width:e.clientWidth,minWidth:e.tableMinWidth,height:r?e.clientHeight:``}},e.colGroupNode,L(`tbody`,{role:`presentation`},L(Nd,{dateProfile:e.dateProfile,cells:e.cells,renderRowIntro:e.renderRowIntro,showWeekNumbers:e.showWeekNumbers,clientWidth:e.clientWidth,clientHeight:e.clientHeight,businessHourSegs:e.businessHourSegs,bgEventSegs:e.bgEventSegs,fgEventSegs:e.fgEventSegs,dateSelectionSegs:e.dateSelectionSegs,eventSelection:e.eventSelection,eventDrag:e.eventDrag,eventResize:e.eventResize,dayMaxEvents:n,dayMaxEventRows:t,forPrint:e.forPrint,isHitComboAllowed:e.isHitComboAllowed}))))}componentDidMount(){this.requestScrollReset()}componentDidUpdate(e){e.dateProfile===this.props.dateProfile?this.flushScrollReset():this.requestScrollReset()}requestScrollReset(){this.needsScrollReset=!0,this.flushScrollReset()}flushScrollReset(){if(this.needsScrollReset&&this.props.clientWidth){let e=Ld(this.elRef.current,this.props.dateProfile);if(e){let t=e.closest(`.fc-daygrid-body`),n=t.closest(`.fc-scroller`),r=e.getBoundingClientRect().top-t.getBoundingClientRect().top;n.scrollTop=r?r+1:0}this.needsScrollReset=!1}}};function Ld(e,t){let n;return t.currentRangeUnit.match(/year|month/)&&(n=e.querySelector(`[data-date="${Li(t.currentDate)}-01"]`)),n||=e.querySelector(`[data-date="${Ii(t.currentDate)}"]`),n}var Rd=class extends Fc{constructor(){super(...arguments),this.forceDayIfListItem=!0}sliceRange(e,t){return t.sliceRange(e)}},zd=class extends gc{constructor(){super(...arguments),this.slicer=new Rd,this.tableRef=R()}render(){let{props:e,context:t}=this;return L(Id,Object.assign({ref:this.tableRef},this.slicer.sliceProps(e,e.dateProfile,e.nextDayThreshold,t,e.dayTableModel),{dateProfile:e.dateProfile,cells:e.dayTableModel.cells,colGroupNode:e.colGroupNode,tableMinWidth:e.tableMinWidth,renderRowIntro:e.renderRowIntro,dayMaxEvents:e.dayMaxEvents,dayMaxEventRows:e.dayMaxEventRows,showWeekNumbers:e.showWeekNumbers,expandRows:e.expandRows,headerAlignElRef:e.headerAlignElRef,clientWidth:e.clientWidth,clientHeight:e.clientHeight,forPrint:e.forPrint}))}},Bd=class extends cd{constructor(){super(...arguments),this.buildDayTableModel=q(Vd),this.headerRef=R(),this.tableRef=R()}render(){let{options:e,dateProfileGenerator:t}=this.context,{props:n}=this,r=this.buildDayTableModel(n.dateProfile,t),i=e.dayHeaders&&L(jc,{ref:this.headerRef,dateProfile:n.dateProfile,dates:r.headerDates,datesRepDistinctDays:r.rowCnt===1}),a=t=>L(zd,{ref:this.tableRef,dateProfile:n.dateProfile,dayTableModel:r,businessHours:n.businessHours,dateSelection:n.dateSelection,eventStore:n.eventStore,eventUiBases:n.eventUiBases,eventSelection:n.eventSelection,eventDrag:n.eventDrag,eventResize:n.eventResize,nextDayThreshold:e.nextDayThreshold,colGroupNode:t.tableColGroupNode,tableMinWidth:t.tableMinWidth,dayMaxEvents:e.dayMaxEvents,dayMaxEventRows:e.dayMaxEventRows,showWeekNumbers:e.weekNumbers,expandRows:!n.isHeightAuto,headerAlignElRef:this.headerElRef,clientWidth:t.clientWidth,clientHeight:t.clientHeight,forPrint:n.forPrint});return e.dayMinWidth?this.renderHScrollLayout(i,a,r.colCnt,e.dayMinWidth):this.renderSimpleLayout(i,a)}};function Vd(e,t){return new Pc(new Nc(e.renderRange,t),/year|month|week/.test(e.currentRangeUnit))}var Hd=class extends fo{buildRenderRange(e,t,n){let r=super.buildRenderRange(e,t,n),{props:i}=this;return Ud({currentRange:r,snapToWeek:/^(year|month)$/.test(t),fixedWeekCount:i.fixedWeekCount,dateEnv:i.dateEnv})}};function Ud(e){let{dateEnv:t,currentRange:n}=e,{start:r,end:i}=n,a;if(e.snapToWeek&&(r=t.startOfWeek(r),a=t.startOfWeek(i),a.valueOf()!==i.valueOf()&&(i=mi(a,1))),e.fixedWeekCount){let e=t.startOfWeek(t.startOfMonth(W(n.end,-1))),r=Math.ceil(gi(e,i));i=mi(i,6-r)}return{start:r,end:i}}yr(`:root{--fc-daygrid-event-dot-width:8px}.fc-daygrid-day-events:after,.fc-daygrid-day-events:before,.fc-daygrid-day-frame:after,.fc-daygrid-day-frame:before,.fc-daygrid-event-harness:after,.fc-daygrid-event-harness:before{clear:both;content:"";display:table}.fc .fc-daygrid-body{position:relative;z-index:1}.fc .fc-daygrid-day.fc-day-today{background-color:var(--fc-today-bg-color)}.fc .fc-daygrid-day-frame{min-height:100%;position:relative}.fc .fc-daygrid-day-top{display:flex;flex-direction:row-reverse}.fc .fc-day-other .fc-daygrid-day-top{opacity:.3}.fc .fc-daygrid-day-number{padding:4px;position:relative;z-index:4}.fc .fc-daygrid-month-start{font-size:1.1em;font-weight:700}.fc .fc-daygrid-day-events{margin-top:1px}.fc .fc-daygrid-body-balanced .fc-daygrid-day-events{left:0;position:absolute;right:0}.fc .fc-daygrid-body-unbalanced .fc-daygrid-day-events{min-height:2em;position:relative}.fc .fc-daygrid-body-natural .fc-daygrid-day-events{margin-bottom:1em}.fc .fc-daygrid-event-harness{position:relative}.fc .fc-daygrid-event-harness-abs{left:0;position:absolute;right:0;top:0}.fc .fc-daygrid-bg-harness{bottom:0;position:absolute;top:0}.fc .fc-daygrid-day-bg .fc-non-business{z-index:1}.fc .fc-daygrid-day-bg .fc-bg-event{z-index:2}.fc .fc-daygrid-day-bg .fc-highlight{z-index:3}.fc .fc-daygrid-event{margin-top:1px;z-index:6}.fc .fc-daygrid-event.fc-event-mirror{z-index:7}.fc .fc-daygrid-day-bottom{font-size:.85em;margin:0 2px}.fc .fc-daygrid-day-bottom:after,.fc .fc-daygrid-day-bottom:before{clear:both;content:"";display:table}.fc .fc-daygrid-more-link{border-radius:3px;cursor:pointer;line-height:1;margin-top:1px;max-width:100%;overflow:hidden;padding:2px;position:relative;white-space:nowrap;z-index:4}.fc .fc-daygrid-more-link:hover{background-color:rgba(0,0,0,.1)}.fc .fc-daygrid-week-number{background-color:var(--fc-neutral-bg-color);color:var(--fc-neutral-text-color);min-width:1.5em;padding:2px;position:absolute;text-align:center;top:0;z-index:5}.fc .fc-more-popover .fc-popover-body{min-width:220px;padding:10px}.fc-direction-ltr .fc-daygrid-event.fc-event-start,.fc-direction-rtl .fc-daygrid-event.fc-event-end{margin-left:2px}.fc-direction-ltr .fc-daygrid-event.fc-event-end,.fc-direction-rtl .fc-daygrid-event.fc-event-start{margin-right:2px}.fc-direction-ltr .fc-daygrid-more-link{float:left}.fc-direction-ltr .fc-daygrid-week-number{border-radius:0 0 3px 0;left:0}.fc-direction-rtl .fc-daygrid-more-link{float:right}.fc-direction-rtl .fc-daygrid-week-number{border-radius:0 0 0 3px;right:0}.fc-liquid-hack .fc-daygrid-day-frame{position:static}.fc-daygrid-event{border-radius:3px;font-size:var(--fc-small-font-size);position:relative;white-space:nowrap}.fc-daygrid-block-event .fc-event-time{font-weight:700}.fc-daygrid-block-event .fc-event-time,.fc-daygrid-block-event .fc-event-title{padding:1px}.fc-daygrid-dot-event{align-items:center;display:flex;padding:2px 0}.fc-daygrid-dot-event .fc-event-title{flex-grow:1;flex-shrink:1;font-weight:700;min-width:0;overflow:hidden}.fc-daygrid-dot-event.fc-event-mirror,.fc-daygrid-dot-event:hover{background:rgba(0,0,0,.1)}.fc-daygrid-dot-event.fc-event-selected:before{bottom:-10px;top:-10px}.fc-daygrid-event-dot{border:calc(var(--fc-daygrid-event-dot-width)/2) solid var(--fc-event-border-color);border-radius:calc(var(--fc-daygrid-event-dot-width)/2);box-sizing:content-box;height:0;margin:0 4px;width:0}.fc-direction-ltr .fc-daygrid-event .fc-event-time{margin-right:3px}.fc-direction-rtl .fc-daygrid-event .fc-event-time{margin-left:3px}`);var Wd=Pl({name:`@fullcalendar/daygrid`,initialView:`dayGridMonth`,views:{dayGrid:{component:Bd,dateProfileGeneratorClass:Hd},dayGridDay:{type:`dayGrid`,duration:{days:1}},dayGridWeek:{type:`dayGrid`,duration:{weeks:1}},dayGridMonth:{type:`dayGrid`,duration:{months:1},fixedWeekCount:!0},dayGridYear:{type:`dayGrid`,duration:{years:1}}}}),Gd=class extends tc{getKeyInfo(){return{allDay:{},timed:{}}}getKeysForDateSpan(e){return e.allDay?[`allDay`]:[`timed`]}getKeysForEventDef(e){return e.allDay?vs(e)?[`timed`,`allDay`]:[`allDay`]:[`timed`]}},Kd=J({hour:`numeric`,minute:`2-digit`,omitZeroMinute:!0,meridiem:`short`});function qd(e){let t=[`fc-timegrid-slot`,`fc-timegrid-slot-label`,e.isLabeled?`fc-scrollgrid-shrink`:`fc-timegrid-slot-minor`];return L(Va.Consumer,null,n=>{if(!e.isLabeled)return L(`td`,{className:t.join(` `),"data-time":e.isoTimeStr});let{dateEnv:r,options:i,viewApi:a}=n,o=i.slotLabelFormat==null?Kd:Array.isArray(i.slotLabelFormat)?J(i.slotLabelFormat[0]):J(i.slotLabelFormat),s={level:0,time:e.time,date:r.toDate(e.date),view:a,text:r.format(e.date,o)};return L($,{elTag:`td`,elClasses:t,elAttrs:{"data-time":e.isoTimeStr},renderProps:s,generatorName:`slotLabelContent`,customGenerator:i.slotLabelContent,defaultGenerator:Jd,classNameGenerator:i.slotLabelClassNames,didMount:i.slotLabelDidMount,willUnmount:i.slotLabelWillUnmount},e=>L(`div`,{className:`fc-timegrid-slot-label-frame fc-scrollgrid-shrink-frame`},L(e,{elTag:`div`,elClasses:[`fc-timegrid-slot-label-cushion`,`fc-scrollgrid-shrink-cushion`]})))})}function Jd(e){return e.text}var Yd=class extends Z{render(){return this.props.slatMetas.map(e=>L(`tr`,{key:e.key},L(qd,Object.assign({},e))))}},Xd=J({week:`short`}),Zd=5,Qd=class extends gc{constructor(){super(...arguments),this.allDaySplitter=new Gd,this.headerElRef=R(),this.rootElRef=R(),this.scrollerElRef=R(),this.state={slatCoords:null},this.handleScrollTopRequest=e=>{let t=this.scrollerElRef.current;t&&(t.scrollTop=e)},this.renderHeadAxis=(e,t=``)=>{let{options:n}=this.context,{dateProfile:r}=this.props,i=r.renderRange,a=_i(i.start,i.end)===1?sc(this.context,i.start,`week`):{};return n.weekNumbers&&e===`day`?L(fl,{elTag:`th`,elClasses:[`fc-timegrid-axis`,`fc-scrollgrid-shrink`],elAttrs:{"aria-hidden":!0},date:i.start,defaultFormat:Xd},e=>L(`div`,{className:[`fc-timegrid-axis-frame`,`fc-scrollgrid-shrink-frame`,`fc-timegrid-axis-frame-liquid`].join(` `),style:{height:t}},L(e,{elTag:`a`,elClasses:[`fc-timegrid-axis-cushion`,`fc-scrollgrid-shrink-cushion`,`fc-scrollgrid-sync-inner`],elAttrs:a}))):L(`th`,{"aria-hidden":!0,className:`fc-timegrid-axis`},L(`div`,{className:`fc-timegrid-axis-frame`,style:{height:t}}))},this.renderTableRowAxis=e=>{let{options:t,viewApi:n}=this.context;return L($,{elTag:`td`,elClasses:[`fc-timegrid-axis`,`fc-scrollgrid-shrink`],elAttrs:{"aria-hidden":!0},renderProps:{text:t.allDayText,view:n},generatorName:`allDayContent`,customGenerator:t.allDayContent,defaultGenerator:$d,classNameGenerator:t.allDayClassNames,didMount:t.allDayDidMount,willUnmount:t.allDayWillUnmount},t=>L(`div`,{className:[`fc-timegrid-axis-frame`,`fc-scrollgrid-shrink-frame`,e==null?` fc-timegrid-axis-frame-liquid`:``].join(` `),style:{height:e}},L(t,{elTag:`span`,elClasses:[`fc-timegrid-axis-cushion`,`fc-scrollgrid-shrink-cushion`,`fc-scrollgrid-sync-inner`]})))},this.handleSlatCoords=e=>{this.setState({slatCoords:e})}}renderSimpleLayout(e,t,n){let{context:r,props:i}=this,a=[],o=Zc(r.options);return e&&a.push({type:`header`,key:`header`,isSticky:o,chunk:{elRef:this.headerElRef,tableClassName:`fc-col-header`,rowContent:e}}),t&&(a.push({type:`body`,key:`all-day`,chunk:{content:t}}),a.push({type:`body`,key:`all-day-divider`,outerContent:L(`tr`,{role:`presentation`,className:`fc-scrollgrid-section`},L(`td`,{className:`fc-timegrid-divider `+r.theme.getClass(`tableCellShaded`)}))})),a.push({type:`body`,key:`body`,liquid:!0,expandRows:!!r.options.expandRows,chunk:{scrollerElRef:this.scrollerElRef,content:n}}),L($a,{elRef:this.rootElRef,elClasses:[`fc-timegrid`],viewSpec:r.viewSpec},L($c,{liquid:!i.isHeightAuto&&!i.forPrint,collapsibleWidth:i.forPrint,cols:[{width:`shrink`}],sections:a}))}renderHScrollLayout(e,t,n,r,i,a,o){let s=this.context.pluginHooks.scrollGridImpl;if(!s)throw Error(`No ScrollGrid implementation`);let{context:c,props:l}=this,u=!l.forPrint&&Zc(c.options),d=!l.forPrint&&Qc(c.options),f=[];e&&f.push({type:`header`,key:`header`,isSticky:u,syncRowHeights:!0,chunks:[{key:`axis`,rowContent:e=>L(`tr`,{role:`presentation`},this.renderHeadAxis(`day`,e.rowSyncHeights[0]))},{key:`cols`,elRef:this.headerElRef,tableClassName:`fc-col-header`,rowContent:e}]}),t&&(f.push({type:`body`,key:`all-day`,syncRowHeights:!0,chunks:[{key:`axis`,rowContent:e=>L(`tr`,{role:`presentation`},this.renderTableRowAxis(e.rowSyncHeights[0]))},{key:`cols`,content:t}]}),f.push({key:`all-day-divider`,type:`body`,outerContent:L(`tr`,{role:`presentation`,className:`fc-scrollgrid-section`},L(`td`,{colSpan:2,className:`fc-timegrid-divider `+c.theme.getClass(`tableCellShaded`)}))}));let p=c.options.nowIndicator;return f.push({type:`body`,key:`body`,liquid:!0,expandRows:!!c.options.expandRows,chunks:[{key:`axis`,content:e=>L(`div`,{className:`fc-timegrid-axis-chunk`},L(`table`,{"aria-hidden":!0,style:{height:e.expandRows?e.clientHeight:``}},e.tableColGroupNode,L(`tbody`,null,L(Yd,{slatMetas:a}))),L(`div`,{className:`fc-timegrid-now-indicator-container`},L(Xs,{unit:p?`minute`:`day`},e=>{let t=p&&o&&o.safeComputeTop(e);return typeof t==`number`?L(il,{elClasses:[`fc-timegrid-now-indicator-arrow`],elStyle:{top:t},isAxis:!0,date:e}):null})))},{key:`cols`,scrollerElRef:this.scrollerElRef,content:n}]}),d&&f.push({key:`footer`,type:`footer`,isSticky:!0,chunks:[{key:`axis`,content:Xc},{key:`cols`,content:Xc}]}),L($a,{elRef:this.rootElRef,elClasses:[`fc-timegrid`],viewSpec:c.viewSpec},L(s,{liquid:!l.isHeightAuto&&!l.forPrint,forPrint:l.forPrint,collapsibleWidth:!1,colGroups:[{width:`shrink`,cols:[{width:`shrink`}]},{cols:[{span:r,minWidth:i}]}],sections:f}))}getAllDayMaxEventProps(){let{dayMaxEvents:e,dayMaxEventRows:t}=this.context.options;return(e===!0||t===!0)&&(e=void 0,t=Zd),{dayMaxEvents:e,dayMaxEventRows:t}}};function $d(e){return e.text}var ef=class{constructor(e,t,n){this.positions=e,this.dateProfile=t,this.slotDuration=n}safeComputeTop(e){let{dateProfile:t}=this;if(oo(t.currentRange,e)){let n=G(e),r=e.valueOf()-n.valueOf();if(r>=U(t.slotMinTime)&&r<U(t.slotMaxTime))return this.computeTimeTop(H(r))}return null}computeDateTop(e,t){return t||=G(e),this.computeTimeTop(H(e.valueOf()-t.valueOf()))}computeTimeTop(e){let{positions:t,dateProfile:n}=this,r=t.els.length,i=(e.milliseconds-U(n.slotMinTime))/U(this.slotDuration),a,o;return i=Math.max(0,i),i=Math.min(r,i),a=Math.floor(i),a=Math.min(a,r-1),o=i-a,t.tops[a]+t.getHeight(a)*o}},tf=class extends Z{render(){let{props:e,context:t}=this,{options:n}=t,{slatElRefs:r}=e;return L(`tbody`,null,e.slatMetas.map((i,a)=>{let o={time:i.time,date:t.dateEnv.toDate(i.date),view:t.viewApi};return L(`tr`,{key:i.key,ref:r.createRef(i.key)},e.axis&&L(qd,Object.assign({},i)),L($,{elTag:`td`,elClasses:[`fc-timegrid-slot`,`fc-timegrid-slot-lane`,!i.isLabeled&&`fc-timegrid-slot-minor`],elAttrs:{"data-time":i.isoTimeStr},renderProps:o,generatorName:`slotLaneContent`,customGenerator:n.slotLaneContent,classNameGenerator:n.slotLaneClassNames,didMount:n.slotLaneDidMount,willUnmount:n.slotLaneWillUnmount}))}))}},nf=class extends Z{constructor(){super(...arguments),this.rootElRef=R(),this.slatElRefs=new zc}render(){let{props:e,context:t}=this;return L(`div`,{ref:this.rootElRef,className:`fc-timegrid-slots`},L(`table`,{"aria-hidden":!0,className:t.theme.getClass(`table`),style:{minWidth:e.tableMinWidth,width:e.clientWidth,height:e.minHeight}},e.tableColGroupNode,L(tf,{slatElRefs:this.slatElRefs,axis:e.axis,slatMetas:e.slatMetas})))}componentDidMount(){this.updateSizing()}componentDidUpdate(){this.updateSizing()}componentWillUnmount(){this.props.onCoords&&this.props.onCoords(null)}updateSizing(){let{context:e,props:t}=this;t.onCoords&&t.clientWidth!==null&&this.rootElRef.current.offsetHeight&&t.onCoords(new ef(new mc(this.rootElRef.current,rf(this.slatElRefs.currentMap,t.slatMetas),!1,!0),this.props.dateProfile,e.options.slotDuration))}};function rf(e,t){return t.map(t=>e[t.key])}function af(e,t){let n=[],r;for(r=0;r<t;r+=1)n.push([]);if(e)for(r=0;r<e.length;r+=1)n[e[r].col].push(e[r]);return n}function of(e,t){let n=[];if(e){for(let r=0;r<t;r+=1)n[r]={affectedInstances:e.affectedInstances,isEvent:e.isEvent,segs:[]};for(let t of e.segs)n[t.col].segs.push(t)}else for(let e=0;e<t;e+=1)n[e]=null;return n}var sf=class extends Z{render(){let{props:e}=this;return L(_l,{elClasses:[`fc-timegrid-more-link`],elStyle:{top:e.top,bottom:e.bottom},allDayDate:null,moreCnt:e.hiddenSegs.length,allSegs:e.hiddenSegs,hiddenSegs:e.hiddenSegs,extraDateSpan:e.extraDateSpan,dateProfile:e.dateProfile,todayRange:e.todayRange,popoverContent:()=>Cf(e.hiddenSegs,e),defaultGenerator:cf,forceTimed:!0},e=>L(e,{elTag:`div`,elClasses:[`fc-timegrid-more-link-inner`,`fc-sticky`]}))}};function cf(e){return e.shortText}function lf(e,t,n){let r=new _c;t!=null&&(r.strictOrder=t),n!=null&&(r.maxStackCnt=n);let i=bc(r.addSegs(e)),a=uf(r);return a=hf(a,1),{segRects:gf(a),hiddenGroups:i}}function uf(e){let{entriesByLevel:t}=e,n=_f((e,t)=>e+`:`+t,(r,i)=>{let a=df(mf(e,r,i),n),o=t[r][i];return[Object.assign(Object.assign({},o),{nextLevelNodes:a[0]}),o.thickness+a[1]]});return df(t.length?{level:0,lateralStart:0,lateralEnd:t[0].length}:null,n)[0]}function df(e,t){if(!e)return[[],0];let{level:n,lateralStart:r,lateralEnd:i}=e,a=r,o=[];for(;a<i;)o.push(t(n,a)),a+=1;return o.sort(ff),[o.map(pf),o[0][1]]}function ff(e,t){return t[1]-e[1]}function pf(e){return e[0]}function mf(e,t,n){let{levelCoords:r,entriesByLevel:i}=e,a=i[t][n],o=r[t]+a.thickness,s=r.length,c=t;for(;c<s&&r[c]<o;c+=1);for(;c<s;c+=1){let e=i[c],t,n=wc(e,a.span.start,vc),r=n[0]+n[1],o=r;for(;(t=e[o])&&t.span.start<a.span.end;)o+=1;if(r<o)return{level:c,lateralStart:r,lateralEnd:o}}return null}function hf(e,t){let n=_f((e,t,n)=>yc(e),(e,r,i)=>{let{nextLevelNodes:a,thickness:o}=e,s=o+i,c=o/s,l,u=[];if(!a.length)l=t;else for(let e of a)if(l===void 0){let t=n(e,r,s);l=t[0],u.push(t[1])}else{let t=n(e,l,0);u.push(t[1])}let d=(l-r)*c;return[l-d,Object.assign(Object.assign({},e),{thickness:d,nextLevelNodes:u})]});return e.map(e=>n(e,0,0)[1])}function gf(e){let t=[],n=_f((e,t,n)=>yc(e),(e,n,i)=>{let a=Object.assign(Object.assign({},e),{levelCoord:n,stackDepth:i,stackForward:0});return t.push(a),a.stackForward=r(e.nextLevelNodes,n+e.thickness,i+1)+1});function r(e,t,r){let i=0;for(let a of e)i=Math.max(n(a,t,r),i);return i}return r(e,0,0),t}function _f(e,t){let n={};return(...r)=>{let i=e(...r);return i in n?n[i]:n[i]=t(...r)}}function vf(e,t,n=null,r=0){let i=[];if(n)for(let a=0;a<e.length;a+=1){let o=e[a],s=n.computeDateTop(o.start,t),c=Math.max(s+(r||0),n.computeDateTop(o.end,t));i.push({start:Math.round(s),end:Math.round(c)})}return i}function yf(e,t,n,r){let i=[],a=[];for(let n=0;n<e.length;n+=1){let r=t[n];r?i.push({index:n,thickness:1,span:r}):a.push(e[n])}let{segRects:o,hiddenGroups:s}=lf(i,n,r),c=[];for(let t of o)c.push({seg:e[t.index],rect:t});for(let e of a)c.push({seg:e,rect:null});return{segPlacements:c,hiddenGroups:s}}var bf=J({hour:`numeric`,minute:`2-digit`,meridiem:!1}),xf=class extends Z{render(){return L(nl,Object.assign({},this.props,{elClasses:[`fc-timegrid-event`,`fc-v-event`,this.props.isShort&&`fc-timegrid-event-short`],defaultTimeFormat:bf}))}},Sf=class extends Z{constructor(){super(...arguments),this.sortEventSegs=q(Cs)}render(){let{props:e,context:t}=this,{options:n}=t,r=n.selectMirror,i=e.eventDrag&&e.eventDrag.segs||e.eventResize&&e.eventResize.segs||r&&e.dateSelectionSegs||[],a=e.eventDrag&&e.eventDrag.affectedInstances||e.eventResize&&e.eventResize.affectedInstances||{},o=this.sortEventSegs(e.fgEventSegs,n.eventOrder);return L(ol,{elTag:`td`,elRef:e.elRef,elClasses:[`fc-timegrid-col`,...e.extraClassNames||[]],elAttrs:Object.assign({role:`gridcell`},e.extraDataAttrs),date:e.date,dateProfile:e.dateProfile,todayRange:e.todayRange,extraRenderProps:e.extraRenderProps},t=>L(`div`,{className:`fc-timegrid-col-frame`},L(`div`,{className:`fc-timegrid-col-bg`},this.renderFillSegs(e.businessHourSegs,`non-business`),this.renderFillSegs(e.bgEventSegs,`bg-event`),this.renderFillSegs(e.dateSelectionSegs,`highlight`)),L(`div`,{className:`fc-timegrid-col-events`},this.renderFgSegs(o,a,!1,!1,!1)),L(`div`,{className:`fc-timegrid-col-events`},this.renderFgSegs(i,{},!!e.eventDrag,!!e.eventResize,!!r,`mirror`)),L(`div`,{className:`fc-timegrid-now-indicator-container`},this.renderNowIndicator(e.nowIndicatorSegs)),sl(n)&&L(t,{elTag:`div`,elClasses:[`fc-timegrid-col-misc`]})))}renderFgSegs(e,t,n,r,i,a){let{props:o}=this;return o.forPrint?Cf(e,o):this.renderPositionedFgSegs(e,t,n,r,i,a)}renderPositionedFgSegs(e,t,n,r,i,a){let{eventMaxStack:o,eventShortHeight:s,eventOrderStrict:c,eventMinHeight:l}=this.context.options,{date:u,slatCoords:d,eventSelection:f,todayRange:p,nowDate:m}=this.props,h=n||r||i,{segPlacements:g,hiddenGroups:_}=yf(e,vf(e,u,d,l),c,o);return L(z,null,this.renderHiddenGroups(_,e),g.map(e=>{let{seg:o,rect:c}=e,l=o.eventRange.instance.instanceId,u=h||!!(!t[l]&&c),d=wf(c&&c.span),g=!h&&c?this.computeSegHStyle(c):{left:0,right:0},_=!!c&&c.stackForward>0,v=!!c&&c.span.end-c.span.start<s;return L(`div`,{className:`fc-timegrid-event-harness`+(_?` fc-timegrid-event-harness-inset`:``),key:a||l,style:Object.assign(Object.assign({visibility:u?``:`hidden`},d),g)},L(xf,Object.assign({seg:o,isDragging:n,isResizing:r,isDateSelecting:i,isSelected:l===f,isShort:v},ks(o,p,m))))}))}renderHiddenGroups(e,t){let{extraDateSpan:n,dateProfile:r,todayRange:i,nowDate:a,eventSelection:o,eventDrag:s,eventResize:c}=this.props;return L(z,null,e.map(e=>{let l=wf(e.span),u=Tf(e.entries,t);return L(sf,{key:Fi(bl(u)),hiddenSegs:u,top:l.top,bottom:l.bottom,extraDateSpan:n,dateProfile:r,todayRange:i,nowDate:a,eventSelection:o,eventDrag:s,eventResize:c})}))}renderFillSegs(e,t){let{props:n,context:r}=this;return L(z,null,vf(e,n.date,n.slatCoords,r.options.eventMinHeight).map((r,i)=>{let a=e[i];return L(`div`,{key:js(a.eventRange),className:`fc-timegrid-bg-harness`,style:wf(r)},t===`bg-event`?L(ll,Object.assign({seg:a},ks(a,n.todayRange,n.nowDate))):dl(t))}))}renderNowIndicator(e){let{slatCoords:t,date:n}=this.props;return t?e.map((e,r)=>L(il,{key:r,elClasses:[`fc-timegrid-now-indicator-line`],elStyle:{top:t.computeDateTop(e.start,n)},isAxis:!1,date:n})):null}computeSegHStyle(e){let{isRtl:t,options:n}=this.context,r=n.slotEventOverlap,i=e.levelCoord,a=e.levelCoord+e.thickness,o,s;r&&(a=Math.min(1,i+(a-i)*2)),t?(o=1-a,s=i):(o=i,s=1-a);let c={zIndex:e.stackDepth+1,left:o*100+`%`,right:s*100+`%`};return r&&!e.stackForward&&(c[t?`marginLeft`:`marginRight`]=20),c}};function Cf(e,{todayRange:t,nowDate:n,eventSelection:r,eventDrag:i,eventResize:a}){let o=(i?i.affectedInstances:null)||(a?a.affectedInstances:null)||{};return L(z,null,e.map(e=>{let i=e.eventRange.instance.instanceId;return L(`div`,{key:i,style:{visibility:o[i]?`hidden`:``}},L(xf,Object.assign({seg:e,isDragging:!1,isResizing:!1,isDateSelecting:!1,isSelected:i===r,isShort:!1},ks(e,t,n))))}))}function wf(e){return e?{top:e.start,bottom:-e.end}:{top:``,bottom:``}}function Tf(e,t){return e.map(e=>t[e.index])}var Ef=class extends Z{constructor(){super(...arguments),this.splitFgEventSegs=q(af),this.splitBgEventSegs=q(af),this.splitBusinessHourSegs=q(af),this.splitNowIndicatorSegs=q(af),this.splitDateSelectionSegs=q(af),this.splitEventDrag=q(of),this.splitEventResize=q(of),this.rootElRef=R(),this.cellElRefs=new zc}render(){let{props:e,context:t}=this,n=t.options.nowIndicator&&e.slatCoords&&e.slatCoords.safeComputeTop(e.nowDate),r=e.cells.length,i=this.splitFgEventSegs(e.fgEventSegs,r),a=this.splitBgEventSegs(e.bgEventSegs,r),o=this.splitBusinessHourSegs(e.businessHourSegs,r),s=this.splitNowIndicatorSegs(e.nowIndicatorSegs,r),c=this.splitDateSelectionSegs(e.dateSelectionSegs,r),l=this.splitEventDrag(e.eventDrag,r),u=this.splitEventResize(e.eventResize,r);return L(`div`,{className:`fc-timegrid-cols`,ref:this.rootElRef},L(`table`,{role:`presentation`,style:{minWidth:e.tableMinWidth,width:e.clientWidth}},e.tableColGroupNode,L(`tbody`,{role:`presentation`},L(`tr`,{role:`row`},e.axis&&L(`td`,{"aria-hidden":!0,className:`fc-timegrid-col fc-timegrid-axis`},L(`div`,{className:`fc-timegrid-col-frame`},L(`div`,{className:`fc-timegrid-now-indicator-container`},typeof n==`number`&&L(il,{elClasses:[`fc-timegrid-now-indicator-arrow`],elStyle:{top:n},isAxis:!0,date:e.nowDate})))),e.cells.map((t,n)=>L(Sf,{key:t.key,elRef:this.cellElRefs.createRef(t.key),dateProfile:e.dateProfile,date:t.date,nowDate:e.nowDate,todayRange:e.todayRange,extraRenderProps:t.extraRenderProps,extraDataAttrs:t.extraDataAttrs,extraClassNames:t.extraClassNames,extraDateSpan:t.extraDateSpan,fgEventSegs:i[n],bgEventSegs:a[n],businessHourSegs:o[n],nowIndicatorSegs:s[n],dateSelectionSegs:c[n],eventDrag:l[n],eventResize:u[n],slatCoords:e.slatCoords,eventSelection:e.eventSelection,forPrint:e.forPrint}))))))}componentDidMount(){this.updateCoords()}componentDidUpdate(){this.updateCoords()}updateCoords(){let{props:e}=this;e.onColCoords&&e.clientWidth!==null&&e.onColCoords(new mc(this.rootElRef.current,Df(this.cellElRefs.currentMap,e.cells),!0,!1))}};function Df(e,t){return t.map(t=>e[t.key])}var Of=class extends gc{constructor(){super(...arguments),this.processSlotOptions=q(kf),this.state={slatCoords:null},this.handleRootEl=e=>{e?this.context.registerInteractiveComponent(this,{el:e,isHitComboAllowed:this.props.isHitComboAllowed}):this.context.unregisterInteractiveComponent(this)},this.handleScrollRequest=e=>{let{onScrollTopRequest:t}=this.props,{slatCoords:n}=this.state;if(t&&n){if(e.time){let r=n.computeTimeTop(e.time);r=Math.ceil(r),r&&(r+=1),t(r)}return!0}return!1},this.handleColCoords=e=>{this.colCoords=e},this.handleSlatCoords=e=>{this.setState({slatCoords:e}),this.props.onSlatCoords&&this.props.onSlatCoords(e)}}render(){let{props:e,state:t}=this;return L(`div`,{className:`fc-timegrid-body`,ref:this.handleRootEl,style:{width:e.clientWidth,minWidth:e.tableMinWidth}},L(nf,{axis:e.axis,dateProfile:e.dateProfile,slatMetas:e.slatMetas,clientWidth:e.clientWidth,minHeight:e.expandRows?e.clientHeight:``,tableMinWidth:e.tableMinWidth,tableColGroupNode:e.axis?e.tableColGroupNode:null,onCoords:this.handleSlatCoords}),L(Ef,{cells:e.cells,axis:e.axis,dateProfile:e.dateProfile,businessHourSegs:e.businessHourSegs,bgEventSegs:e.bgEventSegs,fgEventSegs:e.fgEventSegs,dateSelectionSegs:e.dateSelectionSegs,eventSelection:e.eventSelection,eventDrag:e.eventDrag,eventResize:e.eventResize,todayRange:e.todayRange,nowDate:e.nowDate,nowIndicatorSegs:e.nowIndicatorSegs,clientWidth:e.clientWidth,tableMinWidth:e.tableMinWidth,tableColGroupNode:e.tableColGroupNode,slatCoords:t.slatCoords,onColCoords:this.handleColCoords,forPrint:e.forPrint}))}componentDidMount(){this.scrollResponder=this.context.createScrollResponder(this.handleScrollRequest)}componentDidUpdate(e){this.scrollResponder.update(e.dateProfile!==this.props.dateProfile)}componentWillUnmount(){this.scrollResponder.detach()}queryHit(e,t){let{dateEnv:n,options:r}=this.context,{colCoords:i}=this,{dateProfile:a}=this.props,{slatCoords:o}=this.state,{snapDuration:s,snapsPerSlot:c}=this.processSlotOptions(this.props.slotDuration,r.snapDuration),l=i.leftToIndex(e),u=o.positions.topToIndex(t);if(l!=null&&u!=null){let e=this.props.cells[l],r=o.positions.tops[u],d=o.positions.getHeight(u),f=(t-r)/d,p=Math.floor(f*c),m=u*c+p,h=this.props.cells[l].date,g=ii(a.slotMinTime,oi(s,m)),_=n.add(h,g),v=n.add(_,s);return{dateProfile:a,dateSpan:Object.assign({range:{start:_,end:v},allDay:!1},e.extraDateSpan),dayEl:i.els[l],rect:{left:i.lefts[l],right:i.rights[l],top:r,bottom:r+d},layer:0}}return null}};function kf(e,t){let n=t||e,r=ui(e,n);return r===null&&(n=e,r=1),{snapDuration:n,snapsPerSlot:r}}var Af=class extends Fc{sliceRange(e,t){let n=[];for(let r=0;r<t.length;r+=1){let i=io(e,t[r]);i&&n.push({start:i.start,end:i.end,isStart:i.start.valueOf()===e.start.valueOf(),isEnd:i.end.valueOf()===e.end.valueOf(),col:r})}return n}},jf=class extends gc{constructor(){super(...arguments),this.buildDayRanges=q(Mf),this.slicer=new Af,this.timeColsRef=R()}render(){let{props:e,context:t}=this,{dateProfile:n,dayTableModel:r}=e,{nowIndicator:i,nextDayThreshold:a}=t.options,o=this.buildDayRanges(r,n,t.dateEnv);return L(Xs,{unit:i?`minute`:`day`},(s,c)=>L(Of,Object.assign({ref:this.timeColsRef},this.slicer.sliceProps(e,n,null,t,o),{forPrint:e.forPrint,axis:e.axis,dateProfile:n,slatMetas:e.slatMetas,slotDuration:e.slotDuration,cells:r.cells[0],tableColGroupNode:e.tableColGroupNode,tableMinWidth:e.tableMinWidth,clientWidth:e.clientWidth,clientHeight:e.clientHeight,expandRows:e.expandRows,nowDate:s,nowIndicatorSegs:i&&this.slicer.sliceNowDate(s,n,a,t,o),todayRange:c,onScrollTopRequest:e.onScrollTopRequest,onSlatCoords:e.onSlatCoords})))}};function Mf(e,t,n){let r=[];for(let i of e.headerDates)r.push({start:n.add(i,t.slotMinTime),end:n.add(i,t.slotMaxTime)});return r}var Nf=[{hours:1},{minutes:30},{minutes:15},{seconds:30},{seconds:15}];function Pf(e,t,n,r,i){let a=new Date(0),o=e,s=H(0),c=n||Ff(r),l=[];for(;U(o)<U(t);){let e=i.add(a,o),t=ui(s,c)!==null;l.push({date:e,time:o,key:e.toISOString(),isoTimeStr:Ri(e),isLabeled:t}),o=ii(o,r),s=ii(s,r)}return l}function Ff(e){let t,n,r;for(t=Nf.length-1;t>=0;--t)if(n=H(Nf[t]),r=ui(n,e),r!==null&&r>1)return n;return e}var If=class extends Qd{constructor(){super(...arguments),this.buildTimeColsModel=q(Lf),this.buildSlatMetas=q(Pf)}render(){let{options:e,dateEnv:t,dateProfileGenerator:n}=this.context,{props:r}=this,{dateProfile:i}=r,a=this.buildTimeColsModel(i,n),o=this.allDaySplitter.splitProps(r),s=this.buildSlatMetas(i.slotMinTime,i.slotMaxTime,e.slotLabelInterval,e.slotDuration,t),{dayMinWidth:c}=e,l=!c,u=c,d=e.dayHeaders&&L(jc,{dates:a.headerDates,dateProfile:i,datesRepDistinctDays:!0,renderIntro:l?this.renderHeadAxis:null}),f=e.allDaySlot!==!1&&(t=>L(zd,Object.assign({},o.allDay,{dateProfile:i,dayTableModel:a,nextDayThreshold:e.nextDayThreshold,tableMinWidth:t.tableMinWidth,colGroupNode:t.tableColGroupNode,renderRowIntro:l?this.renderTableRowAxis:null,showWeekNumbers:!1,expandRows:!1,headerAlignElRef:this.headerElRef,clientWidth:t.clientWidth,clientHeight:t.clientHeight,forPrint:r.forPrint},this.getAllDayMaxEventProps()))),p=t=>L(jf,Object.assign({},o.timed,{dayTableModel:a,dateProfile:i,axis:l,slotDuration:e.slotDuration,slatMetas:s,forPrint:r.forPrint,tableColGroupNode:t.tableColGroupNode,tableMinWidth:t.tableMinWidth,clientWidth:t.clientWidth,clientHeight:t.clientHeight,onSlatCoords:this.handleSlatCoords,expandRows:t.expandRows,onScrollTopRequest:this.handleScrollTopRequest}));return u?this.renderHScrollLayout(d,f,p,a.colCnt,c,s,this.state.slatCoords):this.renderSimpleLayout(d,f,p)}};function Lf(e,t){return new Pc(new Nc(e.renderRange,t),!1)}yr(`.fc-v-event{background-color:var(--fc-event-bg-color);border:1px solid var(--fc-event-border-color);display:block}.fc-v-event .fc-event-main{color:var(--fc-event-text-color);height:100%}.fc-v-event .fc-event-main-frame{display:flex;flex-direction:column;height:100%}.fc-v-event .fc-event-time{flex-grow:0;flex-shrink:0;max-height:100%;overflow:hidden}.fc-v-event .fc-event-title-container{flex-grow:1;flex-shrink:1;min-height:0}.fc-v-event .fc-event-title{bottom:0;max-height:100%;overflow:hidden;top:0}.fc-v-event:not(.fc-event-start){border-top-left-radius:0;border-top-right-radius:0;border-top-width:0}.fc-v-event:not(.fc-event-end){border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-width:0}.fc-v-event.fc-event-selected:before{left:-10px;right:-10px}.fc-v-event .fc-event-resizer-start{cursor:n-resize}.fc-v-event .fc-event-resizer-end{cursor:s-resize}.fc-v-event:not(.fc-event-selected) .fc-event-resizer{height:var(--fc-event-resizer-thickness);left:0;right:0}.fc-v-event:not(.fc-event-selected) .fc-event-resizer-start{top:calc(var(--fc-event-resizer-thickness)/-2)}.fc-v-event:not(.fc-event-selected) .fc-event-resizer-end{bottom:calc(var(--fc-event-resizer-thickness)/-2)}.fc-v-event.fc-event-selected .fc-event-resizer{left:50%;margin-left:calc(var(--fc-event-resizer-dot-total-width)/-2)}.fc-v-event.fc-event-selected .fc-event-resizer-start{top:calc(var(--fc-event-resizer-dot-total-width)/-2)}.fc-v-event.fc-event-selected .fc-event-resizer-end{bottom:calc(var(--fc-event-resizer-dot-total-width)/-2)}.fc .fc-timegrid .fc-daygrid-body{z-index:2}.fc .fc-timegrid-divider{padding:0 0 2px}.fc .fc-timegrid-body{min-height:100%;position:relative;z-index:1}.fc .fc-timegrid-axis-chunk{position:relative}.fc .fc-timegrid-axis-chunk>table,.fc .fc-timegrid-slots{position:relative;z-index:1}.fc .fc-timegrid-slot{border-bottom:0;height:1.5em}.fc .fc-timegrid-slot:empty:before{content:"\\00a0"}.fc .fc-timegrid-slot-minor{border-top-style:dotted}.fc .fc-timegrid-slot-label-cushion{display:inline-block;white-space:nowrap}.fc .fc-timegrid-slot-label{vertical-align:middle}.fc .fc-timegrid-axis-cushion,.fc .fc-timegrid-slot-label-cushion{padding:0 4px}.fc .fc-timegrid-axis-frame-liquid{height:100%}.fc .fc-timegrid-axis-frame{align-items:center;display:flex;justify-content:flex-end;overflow:hidden}.fc .fc-timegrid-axis-cushion{flex-shrink:0;max-width:60px}.fc-direction-ltr .fc-timegrid-slot-label-frame{text-align:right}.fc-direction-rtl .fc-timegrid-slot-label-frame{text-align:left}.fc-liquid-hack .fc-timegrid-axis-frame-liquid{bottom:0;height:auto;left:0;position:absolute;right:0;top:0}.fc .fc-timegrid-col.fc-day-today{background-color:var(--fc-today-bg-color)}.fc .fc-timegrid-col-frame{min-height:100%;position:relative}.fc-media-screen.fc-liquid-hack .fc-timegrid-col-frame{bottom:0;height:auto;left:0;position:absolute;right:0;top:0}.fc-media-screen .fc-timegrid-cols{bottom:0;left:0;position:absolute;right:0;top:0}.fc-media-screen .fc-timegrid-cols>table{height:100%}.fc-media-screen .fc-timegrid-col-bg,.fc-media-screen .fc-timegrid-col-events,.fc-media-screen .fc-timegrid-now-indicator-container{left:0;position:absolute;right:0;top:0}.fc .fc-timegrid-col-bg{z-index:2}.fc .fc-timegrid-col-bg .fc-non-business{z-index:1}.fc .fc-timegrid-col-bg .fc-bg-event{z-index:2}.fc .fc-timegrid-col-bg .fc-highlight{z-index:3}.fc .fc-timegrid-bg-harness{left:0;position:absolute;right:0}.fc .fc-timegrid-col-events{z-index:3}.fc .fc-timegrid-now-indicator-container{bottom:0;overflow:hidden}.fc-direction-ltr .fc-timegrid-col-events{margin:0 2.5% 0 2px}.fc-direction-rtl .fc-timegrid-col-events{margin:0 2px 0 2.5%}.fc-timegrid-event-harness{position:absolute}.fc-timegrid-event-harness>.fc-timegrid-event{bottom:0;left:0;position:absolute;right:0;top:0}.fc-timegrid-event-harness-inset .fc-timegrid-event,.fc-timegrid-event.fc-event-mirror,.fc-timegrid-more-link{box-shadow:0 0 0 1px var(--fc-page-bg-color)}.fc-timegrid-event,.fc-timegrid-more-link{border-radius:3px;font-size:var(--fc-small-font-size)}.fc-timegrid-event{margin-bottom:1px}.fc-timegrid-event .fc-event-main{padding:1px 1px 0}.fc-timegrid-event .fc-event-time{font-size:var(--fc-small-font-size);margin-bottom:1px;white-space:nowrap}.fc-timegrid-event-short .fc-event-main-frame{flex-direction:row;overflow:hidden}.fc-timegrid-event-short .fc-event-time:after{content:"\\00a0-\\00a0"}.fc-timegrid-event-short .fc-event-title{font-size:var(--fc-small-font-size)}.fc-timegrid-more-link{background:var(--fc-more-link-bg-color);color:var(--fc-more-link-text-color);cursor:pointer;margin-bottom:1px;position:absolute;z-index:9999}.fc-timegrid-more-link-inner{padding:3px 2px;top:0}.fc-direction-ltr .fc-timegrid-more-link{right:0}.fc-direction-rtl .fc-timegrid-more-link{left:0}.fc .fc-timegrid-now-indicator-arrow,.fc .fc-timegrid-now-indicator-line{pointer-events:none}.fc .fc-timegrid-now-indicator-line{border-color:var(--fc-now-indicator-color);border-style:solid;border-width:1px 0 0;left:0;position:absolute;right:0;z-index:4}.fc .fc-timegrid-now-indicator-arrow{border-color:var(--fc-now-indicator-color);border-style:solid;margin-top:-5px;position:absolute;z-index:4}.fc-direction-ltr .fc-timegrid-now-indicator-arrow{border-bottom-color:transparent;border-top-color:transparent;border-width:5px 0 5px 6px;left:0}.fc-direction-rtl .fc-timegrid-now-indicator-arrow{border-bottom-color:transparent;border-top-color:transparent;border-width:5px 6px 5px 0;right:0}`);var Rf=Pl({name:`@fullcalendar/timegrid`,initialView:`timeGridWeek`,optionRefiners:{allDaySlot:Boolean},views:{timeGrid:{component:If,usesMinMaxTime:!0,allDaySlot:!0,slotDuration:`00:30:00`,slotEventOverlap:!0},timeGridDay:{type:`timeGrid`,duration:{days:1}},timeGridWeek:{type:`timeGrid`,duration:{weeks:1}}}}),zf=e=>`${String(e.getFullYear())}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`,Bf=e=>{let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return Math.abs(t)%360},Vf=e=>`hsl(${String(Bf(e))}, 65%, 45%)`,Hf=(e,t,n)=>`${e}::${t}::${n}`,Uf=Ce,Wf=(e,t)=>{let n=new Date(e);return t?n.toLocaleDateString():`${n.toLocaleDateString()} ${n.toLocaleTimeString()}`},Gf=({event:e,sourceName:t,sourceApiName:n,calendarName:r,onClose:i})=>(0,P.jsx)(ve,{open:!0,size:`lg`,onBackdropClick:i,header:(0,P.jsx)(_e,{title:e.title,onClose:i}),children:(0,P.jsxs)(`div`,{className:`max-h-[70vh] space-y-3 overflow-y-auto px-5 py-4 text-[12px] text-neutral-700`,children:[(0,P.jsxs)(`div`,{className:`grid grid-cols-[100px_1fr] gap-y-1.5`,children:[(0,P.jsx)(`span`,{className:`text-neutral-400`,children:`Start`}),(0,P.jsx)(`span`,{children:Wf(e.start_time,e.all_day??!1)}),(0,P.jsx)(`span`,{className:`text-neutral-400`,children:`End`}),(0,P.jsx)(`span`,{children:Wf(e.end_time,e.all_day??!1)}),(0,P.jsx)(`span`,{className:`text-neutral-400`,children:`All day`}),(0,P.jsx)(`span`,{children:e.all_day===!0?`yes`:`no`}),e.busy!==void 0&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`span`,{className:`text-neutral-400`,children:`Busy`}),(0,P.jsx)(`span`,{children:e.busy?`yes`:`no`})]}),(0,P.jsx)(`span`,{className:`text-neutral-400`,children:`Calendar`}),(0,P.jsx)(`span`,{children:r}),(0,P.jsx)(`span`,{className:`text-neutral-400`,children:`Source`}),(0,P.jsxs)(`span`,{children:[t,` `,(0,P.jsxs)(`span`,{className:`text-neutral-400`,children:[`(`,n,`)`]})]}),(0,P.jsx)(`span`,{className:`text-neutral-400`,children:`Event id`}),(0,P.jsx)(`span`,{className:`truncate`,children:e.id}),e.activity_id!==void 0&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`span`,{className:`text-neutral-400`,children:`Activity id`}),(0,P.jsx)(`span`,{className:`truncate`,children:e.activity_id})]}),e.url!==void 0&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`span`,{className:`text-neutral-400`,children:`URL`}),(0,P.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer`,className:`flex items-center gap-1 truncate text-blue-600 hover:underline`,children:[e.url,(0,P.jsx)(s,{icon:f,className:`text-[10px]`})]})]})]}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`div`,{className:`mb-1 text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Raw payload`}),(0,P.jsx)(`pre`,{className:`max-h-[40vh] overflow-auto rounded bg-neutral-50 p-3 text-[11px] leading-relaxed text-neutral-800`,children:JSON.stringify(e,null,2)})]})]})}),Kf=({calendarSources:e,pluginApiName:n,whenState:r})=>{let i=(0,N.useRef)(null),[o,c]=(0,N.useState)(`dayGridMonth`),[l,u]=(0,N.useState)(``),{calendars:d,errorServices:f,isLoading:h}=x(!0,e),g=(0,N.useMemo)(()=>{let t=new Map;for(let e of Object.values(d))for(let n of e){let e=t.get(n.source.api_name);e?e.calendars.push(n.calendar):t.set(n.source.api_name,{source:n.source,calendars:[n.calendar]})}for(let n of e)t.has(n.api_name)||t.set(n.api_name,{source:n,calendars:[]});return Array.from(t.values())},[d,e]),[_,v]=(0,N.useState)(()=>{try{let e=localStorage.getItem(Uf(n));if(e)return new Set(JSON.parse(e))}catch{}return new Set}),y=(0,N.useRef)(!1);(0,N.useEffect)(()=>{if(y.current||h)return;if(localStorage.getItem(Uf(n))!==null){y.current=!0;return}let e=new Set;for(let{source:t,calendars:n}of g)for(let r of n)r.default===!0&&e.add(Hf(t.plugin_api_name,t.api_name,r.id));e.size>0&&v(e),y.current=!0},[h,g,n]),(0,N.useEffect)(()=>{localStorage.setItem(Uf(n),JSON.stringify(Array.from(_)))},[_,n]);let b=(0,N.useCallback)((e,t,n)=>{v(r=>{let i=Hf(e,t,n),a=new Set(r);return a.has(i)?a.delete(i):a.add(i),a})},[]),S=(0,N.useMemo)(()=>{let e=[];for(let{source:t,calendars:n}of g)for(let r of n)_.has(Hf(t.plugin_api_name,t.api_name,r.id))&&e.push({source:t,calendar:r});return e},[g,_]),[C,w]=(0,N.useState)(()=>{let e=new Date,t=new Date(e.getFullYear(),e.getMonth(),1),n=new Date(e.getFullYear(),e.getMonth()+1,0);return{rangeStart:zf(t),rangeEnd:zf(n)}}),E=(0,N.useCallback)(e=>{let t=new Date(e.end.getTime()-1);w({rangeStart:zf(e.start),rangeEnd:zf(t)}),u(e.view.title),c(e.view.type)},[]),{events:D,sources:O,isLoading:k}=T(S,C),A=(0,N.useMemo)(()=>{if(!D||typeof D!=`object`)return[];let e=D,t=[];for(let[n,r]of Object.entries(e)){let e=O[n];if(!e)continue;let i=Vf(e.source.api_name);for(let a of r??[])t.push({id:`${e.source.api_name}::${n}::${a.id}`,title:a.title,start:new Date(a.start_time),end:new Date(a.end_time),allDay:a.all_day??!1,backgroundColor:i,borderColor:i,extendedProps:{raw:a,sourceName:e.source.name,sourceApiName:e.source.api_name,calendarName:e.calendar.name}})}return t},[D,O]),[j,ee]=(0,N.useState)(null),te=(0,N.useCallback)(e=>{let t=e.event.extendedProps;ee({event:t.raw,sourceName:t.sourceName,sourceApiName:t.sourceApiName,calendarName:t.calendarName})},[]),ne=h||k,re=(0,N.useCallback)(e=>(0,P.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1 overflow-hidden px-1 py-px`,children:[e.timeText&&(0,P.jsx)(`span`,{className:`shrink-0 font-mono text-[9px] opacity-70`,children:e.timeText}),(0,P.jsx)(`span`,{className:`truncate font-mono text-[10px] font-medium leading-none`,children:e.event.title})]}),[]),ie=(0,N.useMemo)(()=>new Set(f.filter(e=>!!e)),[f]);return(0,P.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,P.jsx)(`div`,{className:`flex flex-col gap-3`,children:g.map(({source:e,calendars:t})=>{let n=ie.has(e.plugin_api_name);return(0,P.jsxs)(`div`,{className:`rounded border border-black/8 bg-neutral-50/60`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-black/5 px-3 py-2`,children:[(0,P.jsx)(`span`,{className:`h-3 w-3 shrink-0 rounded-full`,style:{backgroundColor:Vf(e.api_name)}}),(0,P.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,P.jsx)(`div`,{className:`truncate text-[12px] font-semibold text-neutral-800`,children:e.name}),(0,P.jsx)(`div`,{className:`truncate font-mono text-[10px] text-neutral-400`,children:e.api_name}),(()=>{let t=e.when;return t&&r?(0,P.jsx)(Pe,{when:t,whenState:r}):null})()]})]}),n&&(0,P.jsxs)(`div`,{className:`flex items-start gap-2 border-b border-amber-200/60 bg-amber-50 px-3 py-2 text-[11px] text-amber-800`,children:[(0,P.jsx)(s,{icon:a,className:`mt-0.5 text-[10px]`}),(0,P.jsx)(`span`,{children:`Auth error — the calendar script returned an authError flag. Check bundle config / credentials.`})]}),(0,P.jsx)(`div`,{className:`divide-y divide-black/5`,children:t.length===0?(0,P.jsx)(`div`,{className:`px-3 py-2 text-[11px] italic text-neutral-400`,children:h?`Loading calendars…`:`No calendars returned.`}):t.map(t=>{let n=Hf(e.plugin_api_name,e.api_name,t.id);return(0,P.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-2 px-3 py-1.5 hover:bg-black/5`,children:[(0,P.jsx)(`input`,{type:`checkbox`,checked:_.has(n),onChange:()=>{b(e.plugin_api_name,e.api_name,t.id)},className:`mt-0.5 h-3.5 w-3.5 accent-neutral-800`}),(0,P.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,P.jsxs)(`div`,{className:`truncate text-[12px] text-neutral-800`,children:[t.name,t.default===!0&&(0,P.jsx)(`span`,{className:`ml-1.5 rounded bg-neutral-200 px-1 py-0.5 text-[9px] uppercase tracking-wider text-neutral-500`,children:`default`})]}),t.description!==void 0&&t.description!==``&&(0,P.jsx)(`div`,{className:`truncate text-[10px] text-neutral-400`,children:t.description}),(0,P.jsx)(`div`,{className:`truncate font-mono text-[10px] text-neutral-400`,children:t.id})]})]},t.id)})})]},`${e.plugin_api_name}::${e.api_name}`)})}),(0,P.jsxs)(`div`,{className:`relative`,children:[(0,P.jsxs)(`div`,{className:`mb-2 flex items-center justify-between font-mono`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,P.jsx)(`button`,{onClick:()=>{i.current?.getApi().prev()},className:`rounded border border-black/10 bg-white px-2 py-1 text-[11px] text-neutral-600 hover:bg-black/5`,"aria-label":`Previous`,children:(0,P.jsx)(s,{icon:p})}),(0,P.jsx)(`button`,{onClick:()=>{i.current?.getApi().next()},className:`rounded border border-black/10 bg-white px-2 py-1 text-[11px] text-neutral-600 hover:bg-black/5`,"aria-label":`Next`,children:(0,P.jsx)(s,{icon:m})}),(0,P.jsx)(`button`,{onClick:()=>{i.current?.getApi().today()},className:`ml-1 rounded border border-black/10 bg-white px-2.5 py-1 text-[11px] text-neutral-600 hover:bg-black/5`,children:`Today`})]}),(0,P.jsx)(`span`,{className:`text-[13px] font-semibold text-neutral-800`,children:l}),(0,P.jsx)(`div`,{className:`flex items-center gap-0.5 rounded border border-black/10 bg-white p-0.5`,children:[{view:`dayGridMonth`,label:`Month`},{view:`timeGridWeek`,label:`Week`},{view:`timeGridDay`,label:`Day`}].map(({view:e,label:t})=>(0,P.jsx)(`button`,{onClick:()=>{i.current?.getApi().changeView(e)},className:`rounded px-2.5 py-0.5 text-[11px] transition-colors ${o===e?`bg-neutral-900 text-white`:`text-neutral-500 hover:text-neutral-800`}`,children:t},e))})]}),ne&&(0,P.jsxs)(`div`,{className:`pointer-events-none absolute right-0 top-0 z-10 flex items-center gap-1.5 rounded bg-white/90 px-2 py-1 text-[10px] text-neutral-500 shadow-sm`,children:[(0,P.jsx)(s,{icon:t,spin:!0}),`Loading…`]}),(0,P.jsx)(`div`,{className:`fc-kizen`,children:(0,P.jsx)(ad,{ref:i,plugins:[Wd,Rf],initialView:`dayGridMonth`,headerToolbar:!1,datesSet:E,events:A,eventContent:re,eventClick:te,height:800,nowIndicator:!0,dayMaxEvents:4,weekends:!0,firstDay:0})})]}),j&&(0,P.jsx)(Gf,{event:j.event,sourceName:j.sourceName,sourceApiName:j.sourceApiName,calendarName:j.calendarName,onClose:()=>{ee(null)}})]})},qf=12,Jf=(e,t,n)=>Math.min(Math.max(e,t),n),Yf=`text-[11px] font-semibold uppercase tracking-widest text-neutral-600`,Xf=(e,t,n)=>{let r=Ae(e),i=r.minW,a=Math.min(r.maxW,qf),o=r.minH,s=r.maxH,c=Math.round(i*t),l=Math.max(c,Math.round(a*t)),u=Math.round(o*t);return{minWidth:c,maxWidth:l,minHeight:u,maxHeight:Jf(Math.round(s*t),u,Math.max(n,u)),cellSize:t}},Zf=(0,N.forwardRef)(({block:e,args:t,instanceId:n},r)=>{let{scriptUIRef:i,outputUIRef:a,scopedCss:o,sanitizedHtml:s,interactableScriptRef:c,iframeURL:l,pending:u,runEventScript:d}=re({block:e,args:t,instanceId:n});(0,N.useImperativeHandle)(r,()=>({runEventScript:d}),[d]);let f=e.type??`script`;return(0,P.jsxs)(`div`,{className:`relative h-full w-full`,children:[u&&(0,P.jsx)(`div`,{className:`absolute inset-0 z-10 flex items-center justify-center bg-white/80 font-mono text-[11px] text-neutral-400`,children:`loading…`}),f===`script`&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`div`,{ref:i,className:`h-full w-full overflow-auto`}),(0,P.jsx)(`style`,{children:o})]}),f===`html`&&(0,P.jsxs)(`div`,{ref:c,className:`h-full overflow-auto`,children:[s&&(0,P.jsx)(`div`,{dangerouslySetInnerHTML:{__html:s}}),(0,P.jsx)(`div`,{ref:a}),(0,P.jsx)(`style`,{children:o})]}),f===`iframe`&&l&&(0,P.jsx)(`iframe`,{src:l,className:`h-full w-full border-0`,title:e.name,name:e.plugin_api_name})]})});Zf.displayName=`PluginBlockFrame`;var Qf=({label:e,active:t,onClick:n})=>(0,P.jsx)(`button`,{onClick:n,className:`rounded px-2 py-0.5 text-[11px] font-medium transition-colors ${t?`bg-neutral-700 text-neutral-100`:`bg-neutral-100 text-neutral-600 hover:bg-neutral-200`}`,children:e}),$f=({block:e,pluginApiName:t,configArgs:n,whenState:r})=>{let i=(0,N.useRef)(null),a=(0,N.useRef)(null),o=(0,N.useRef)(null),[s,c]=(0,N.useState)(0),[l,u]=(0,N.useState)(window.innerHeight),[d,f]=(0,N.useState)(0),p=s>0?s/qf:0,m=(0,N.useMemo)(()=>Xf(e,p,l),[e,p,l]),[h,g]=je(Se(t,e.api_name),null),_=(0,N.useMemo)(()=>({w:h?Jf(h.w,m.minWidth,m.maxWidth):m.minWidth,h:h?Jf(h.h,m.minHeight,m.maxHeight):m.minHeight}),[h,m]),[v,y]=(0,N.useState)(_);(0,N.useLayoutEffect)(()=>{let e=i.current;if(!e)return;let t=()=>{c(e.clientWidth)};t();let n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect()}},[]),(0,N.useEffect)(()=>{let e=()=>{u(window.innerHeight)};return window.addEventListener(`resize`,e),()=>{window.removeEventListener(`resize`,e)}},[]),(0,N.useLayoutEffect)(()=>{let e=a.current;e&&(e.style.width=`${String(_.w)}px`,e.style.height=`${String(_.h)}px`,y(_))},[_]),(0,N.useEffect)(()=>{let e=a.current;if(!e)return;let t=new ResizeObserver(e=>{let t=e[0];if(!t)return;let n=t.borderBoxSize[0];y({w:Math.round(n?.inlineSize??t.contentRect.width),h:Math.round(n?.blockSize??t.contentRect.height)})});return t.observe(e),()=>{t.disconnect()}},[]);let b=e.when,x=Ne(b,r),S=(0,N.useMemo)(()=>n,[n]),C=(0,N.useMemo)(()=>({plugin_api_name:t,api_name:e.api_name,name:e.name,type:e.type??`script`,script:e.script,styles:e.styles,args:S,...e.event_scripts===void 0?{}:{event_scripts:e.event_scripts},...e.html===void 0?{}:{html:e.html},...e.iframe_url===void 0?{}:{iframe_url:e.iframe_url}}),[e,t,S]),w=`${t}::${e.api_name}::${String(d)}`,T=(0,N.useMemo)(()=>Object.keys(e.event_scripts??{}),[e.event_scripts]),E=p>0,D=()=>{(v.w!==_.w||v.h!==_.h)&&g(v)},O=e=>{g({w:Jf(e.w,m.minWidth,m.maxWidth),h:Jf(e.h,m.minHeight,m.maxHeight)})},k=e.types??[],A=p>0?Math.max(1,Math.round(v.w/p)):0,j=p>0?Math.max(1,Math.round(v.h/p)):0;return(0,P.jsxs)(`div`,{className:`rounded border border-black/10 bg-white`,children:[(0,P.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-black/8 px-3 py-2`,children:[(0,P.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,P.jsx)(`div`,{className:`truncate text-[13px] font-medium text-neutral-900`,children:e.name}),(0,P.jsx)(`div`,{className:`truncate font-mono text-[11px] text-neutral-400`,children:e.api_name})]}),k.map(e=>(0,P.jsx)(`span`,{className:`shrink-0 rounded bg-blue-50 px-1.5 py-0.5 text-[10px] font-semibold text-blue-600`,children:e},e)),b&&(0,P.jsxs)(`span`,{title:b,className:`shrink-0 rounded px-1.5 py-0.5 text-[10px] font-semibold ${x===null?`bg-neutral-100 text-neutral-500`:x?`bg-green-100 text-green-700`:`bg-amber-100 text-amber-700`}`,children:[`when `,x===null?`?`:x?`enabled`:`disabled`]})]}),(0,P.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-black/8 bg-neutral-50 px-3 py-2`,children:[(0,P.jsx)(`span`,{className:Yf,children:`Size`}),(0,P.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[(0,P.jsx)(Qf,{label:`Min`,active:_.w===m.minWidth&&_.h===m.minHeight,onClick:()=>{O({w:m.minWidth,h:m.minHeight})}}),(0,P.jsx)(Qf,{label:`Max`,active:_.w===m.maxWidth&&_.h===m.maxHeight,onClick:()=>{O({w:m.maxWidth,h:m.maxHeight})}})]}),(0,P.jsxs)(`span`,{className:`ml-auto font-mono text-[11px] text-neutral-400`,children:[v.w,`×`,v.h,`px ≈ `,A,`×`,j,` grid`]}),(0,P.jsx)(`button`,{onClick:()=>{f(e=>e+1)},className:`rounded bg-neutral-100 px-2 py-0.5 text-[11px] font-medium text-neutral-600 transition-colors hover:bg-neutral-200`,title:`Re-run the block script`,children:`reload`})]}),T.length>0&&(0,P.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-black/8 bg-neutral-50 px-3 py-2`,children:[(0,P.jsx)(`span`,{className:Yf,children:`Event scripts`}),(0,P.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:T.map(e=>(0,P.jsx)(`button`,{disabled:!E,onClick:()=>o.current?.runEventScript(e),className:`rounded bg-neutral-100 px-2 py-0.5 font-mono text-[11px] font-medium text-neutral-600 transition-colors hover:bg-neutral-200 disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:bg-neutral-100`,title:`Run the ${e} event script (via runBlockScript)`,children:e},e))})]}),(0,P.jsx)(`div`,{className:`p-3`,style:{backgroundColor:`#fafafa`,backgroundImage:`linear-gradient(45deg,#f0f0f0 25%,transparent 25%,transparent 75%,#f0f0f0 75%),linear-gradient(45deg,#f0f0f0 25%,transparent 25%,transparent 75%,#f0f0f0 75%)`,backgroundSize:`16px 16px`,backgroundPosition:`0 0,8px 8px`},children:(0,P.jsx)(`div`,{ref:i,className:`flex justify-center`,children:(0,P.jsx)(`div`,{ref:a,onPointerUp:D,style:{minWidth:m.minWidth,maxWidth:m.maxWidth,minHeight:m.minHeight,maxHeight:m.maxHeight,resize:`both`},className:`overflow-hidden rounded border border-black/10 bg-white shadow-sm`,children:p>0&&(0,P.jsx)(Zf,{ref:o,block:C,args:S,instanceId:w},d)})})})]})},ep=({blocks:e,pluginApiName:t,configArgs:n,whenState:r})=>e.length===0?(0,P.jsx)(`p`,{className:`text-[12px] text-neutral-400`,children:`No content blocks are defined in this plugin.`}):(0,P.jsx)(`div`,{className:`flex flex-col gap-4`,children:e.map(e=>(0,P.jsx)($f,{block:e,pluginApiName:t,configArgs:n,whenState:r},e.api_name))}),tp=56,np=()=>(0,P.jsxs)(`div`,{className:`flex items-start gap-2 rounded border border-amber-200/60 bg-amber-50 px-3 py-2.5 text-[12px] text-amber-800`,children:[(0,P.jsx)(s,{icon:l,className:`mt-0.5 text-[11px]`}),(0,P.jsx)(`span`,{children:`Please install the plugin in order to test.`})]}),rp=({browserRef:e,routablePages:t,configArgs:n,whenState:r})=>{let{apiName:i}=_({strict:!1}),a=ge(),[o,s]=je(Te.sandboxFramesEnabled,!1),c=s,{data:l,isLoading:u,isError:d}=v(oe),f=y();if(u)return(0,P.jsx)(M,{children:(0,P.jsx)(`p`,{className:`m-0 text-[13px] text-neutral-400`,children:`Fetching bundle.json…`})});if(d)return(0,P.jsx)(M,{children:(0,P.jsx)(`p`,{className:`m-0 text-[13px] text-red-700`,children:`Could not load bundle.json.`})});let p=l?.find(e=>e.api_name===i);if(!p)return(0,P.jsx)(M,{children:(0,P.jsxs)(`p`,{className:`m-0 text-[13px] text-neutral-500`,children:[`No app found with api_name`,` `,(0,P.jsx)(`code`,{className:`rounded bg-neutral-100 px-1 py-0.5`,children:i}),`.`]})});let m=p.artifacts.floating_frames.map(e=>({...e,plugin_api_name:p.api_name,args:n})),h=p.artifacts.toolbar_items.map(e=>({...e,plugin_api_name:p.api_name,args:n})),g=p.artifacts.js_action_templates.map(e=>({...e,plugin_api_name:p.api_name,args:n})),b=p.artifacts.object_settings_menu_items.map(e=>({...e,plugin_api_name:p.api_name,args:n})),x=p.artifacts.data_adornments.map(e=>({...e,plugin_api_name:p.api_name,args:n})),S=p.artifacts.calendar_sources.map(e=>({...e,plugin_api_name:p.api_name,args:n})),C=p.artifacts.custom_blocks,w=h.length>0||g.length>0||b.length>0||x.length>0,T=f?.enabled_plugin_apps.some(e=>e.api_name===p.api_name)??!1;return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`div`,{style:{paddingRight:m.length>0?tp:0},children:(0,P.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,P.jsxs)(`div`,{className:`flex flex-col gap-6 xl:flex-row xl:items-start`,children:[w&&(0,P.jsxs)(`div`,{className:`flex flex-col gap-4 xl:flex-1 xl:min-w-0`,children:[h.length>0&&(0,P.jsxs)(M,{children:[(0,P.jsxs)(`div`,{className:`mb-3`,children:[(0,P.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-600`,children:`Toolbar Items`}),(0,P.jsx)(`p`,{className:`mt-1 text-[12px] text-neutral-400`,children:`Click a button to run its script in the context of a generic app view.`})]}),(0,P.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:h.map(e=>(0,P.jsx)(Mt,{item:e,whenState:r},e.api_name))})]}),g.length>0&&(0,P.jsxs)(M,{children:[(0,P.jsxs)(`div`,{className:`mb-3`,children:[(0,P.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-600`,children:`JS Action Templates`}),(0,P.jsx)(`p`,{className:`mt-1 text-[12px] text-neutral-400`,children:`Select a record and trigger a JS action to test its script with real data.`})]}),(0,P.jsx)($e,{actions:g,pluginApiName:p.api_name,configArgs:n})]}),b.length>0&&(0,P.jsxs)(M,{children:[(0,P.jsxs)(`div`,{className:`mb-3`,children:[(0,P.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-600`,children:`Object Settings Menu Items`}),(0,P.jsx)(`p`,{className:`mt-1 text-[12px] text-neutral-400`,children:`Select a custom object and click an item to run its script against that object.`})]}),(0,P.jsx)(Pt,{items:b,pluginApiName:p.api_name,configArgs:n,whenState:r})]}),x.length>0&&(0,P.jsxs)(M,{children:[(0,P.jsxs)(`div`,{className:`mb-3`,children:[(0,P.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-600`,children:`Data Adornments`}),(0,P.jsx)(`p`,{className:`mt-1 text-[12px] text-neutral-400`,children:`Select an object and record, then click an adornment to run its script against a specific field value.`})]}),(0,P.jsx)(tt,{adornments:x,pluginApiName:p.api_name,configArgs:n,whenState:r})]})]}),(0,P.jsxs)(`div`,{className:`min-w-0 flex-1 flex flex-col gap-4`,children:[(0,P.jsxs)(M,{children:[(0,P.jsxs)(`div`,{className:`mb-3`,children:[(0,P.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-600`,children:`Routable Pages`}),(0,P.jsx)(`p`,{className:`mt-1 text-[12px] text-neutral-400`,children:t.length>0?`Navigate between pages as they would appear when embedded in Kizen.`:`No routable pages are defined in this plugin.`})]}),(0,P.jsx)(jt,{ref:e,pages:t})]}),S.length>0&&(0,P.jsxs)(M,{children:[(0,P.jsxs)(`div`,{className:`mb-3`,children:[(0,P.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-600`,children:`Calendar Sources`}),(0,P.jsxs)(`p`,{className:`mt-1 text-[12px] text-neutral-400`,children:[`Pick calendars from each source and navigate the grid to run its`,` `,(0,P.jsx)(`code`,{className:`rounded bg-neutral-100 px-1 font-mono text-[11px]`,children:`calendars_script`}),` `,`and`,` `,(0,P.jsx)(`code`,{className:`rounded bg-neutral-100 px-1 font-mono text-[11px]`,children:`events_script`}),`. Click an event to inspect the raw payload.`]})]}),T?(0,P.jsx)(Kf,{calendarSources:S,pluginApiName:p.api_name,whenState:r}):(0,P.jsx)(np,{})]}),C.length>0&&(0,P.jsxs)(M,{children:[(0,P.jsxs)(`div`,{className:`mb-3`,children:[(0,P.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-600`,children:`Content Blocks`}),(0,P.jsx)(`p`,{className:`mt-1 text-[12px] text-neutral-400`,children:`Preview each block as it renders on a dashboard, homepage, or chart group. Resize within the block’s declared grid constraints, or use a preset, to test how its script handles different dimensions. Dashboard-provided args (dateFilter, teamFilter, objectId) aren’t simulated here — blocks that read them will see undefined.`})]}),(0,P.jsx)(ep,{blocks:C,pluginApiName:p.api_name,configArgs:n,whenState:r})]})]})]}),(p.services?.length??0)>0&&(0,P.jsx)(Kt,{services:p.services??[],pluginApiName:p.api_name,isInstalled:T})]})}),m.length>0&&(0,P.jsxs)(`div`,{className:`pointer-events-none fixed inset-0`,children:[(0,P.jsxs)(`div`,{className:`absolute inset-y-0 flex w-14 flex-col-reverse items-center gap-2 border-l border-black/8 bg-white/60 pb-4 backdrop-blur-sm`,style:{right:a},children:[m.map(e=>(0,P.jsxs)(`div`,{className:`flex flex-col items-center`,children:[(0,P.jsx)(`div`,{id:`${e.plugin_api_name}-${e.api_name}-trigger-left`}),(0,P.jsx)(`div`,{id:`${e.plugin_api_name}-${e.api_name}-trigger-right`})]},e.api_name)),(0,P.jsx)(`strong`,{className:`text-[9px] uppercase tracking-widest text-neutral-400`,children:`Frames`}),(0,P.jsxs)(`label`,{className:`flex flex-col items-center gap-0.5 cursor-pointer pointer-events-auto`,children:[(0,P.jsx)(`input`,{type:`checkbox`,className:`h-3 w-3 cursor-pointer accent-neutral-600`,checked:o,onChange:e=>{c(e.target.checked)}}),(0,P.jsxs)(`span`,{className:`text-[8px] uppercase tracking-widest text-neutral-400 text-center leading-tight`,children:[`enable`,(0,P.jsx)(`br`,{}),`frames`]})]})]}),m.map(e=>(0,P.jsx)(He,{frame:e,framesEnabled:o,whenState:r},e.api_name))]})]})},ip=()=>{let{showToast:e,clearToasts:n}=C(),[r,i]=(0,N.useState)(!1),[a,o]=(0,N.useState)(!1),c=(0,N.useRef)(null);(0,N.useEffect)(()=>{let e=window.open;return window.open=(e,t)=>{let n=String(e??``);return _t(n,typeof t==`string`&&t?t:`_blank`),c.current?.openNewTab(n),null},()=>{window.open=e}},[]);let{apiName:l}=_({strict:!1}),{data:u}=v(oe),d=y(),f=ue(),p=(0,N.useMemo)(()=>ce(f),[f]),{environment:m}=se(),h=fe[m],g=(0,N.useMemo)(()=>u?.find(e=>e.api_name===l),[u,l]),b=g?.base_config,{configArgs:x,userConfigs:S,whenState:w,refreshConfig:T}=Me(l,b,g?.config_template),E=te(`business`,T),D=(0,N.useMemo)(()=>g?g.artifacts.routable_pages.map(e=>({...e,plugin_api_name:g.api_name,args:x})):[],[g,x]),A=()=>{i(!0),o(!0)},j=()=>{i(!1),o(!1)},ne=()=>{i(!1),o(!1)},{onMonitoringException:re,dialog:ie}=k();return d?(0,P.jsx)(O,{appPath:h,user:{id:d.team.user,crm_client_id:``},business:d.business,userConfigs:S,clientObject:d.business.client_object?{id:d.business.client_object.id,objectName:d.business.client_object.object_name}:void 0,teamMember:d.team,onNavigate:(e,t)=>{gt(e),c.current?.navigate(e,t)},performFileUpload:({file:e})=>new Promise((t,n)=>{let r=new FileReader;r.onload=()=>{t({url:r.result})},r.onerror=n,r.readAsDataURL(e)}),monitoringExceptionHelper:re,performRequest:me(p),onCompleteSetup:E,modal:{showing:r,show:a,showPrompt:A,onConfirm:j,onHide:ne},showToast:e,clearToasts:n,children:({showPluginModal:e,derivedModalState:t,pluginApiName:n})=>(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(rp,{browserRef:c,routablePages:D,configArgs:x,whenState:w}),(0,P.jsx)(ee,{show:e,config:t.config,pluginApiName:n,onConfirm:t.props.onConfirm,onHide:t.props.onHide,pages:D}),ie]})}):(0,P.jsx)(s,{icon:t,className:`animate-spin text-neutral-400`,size:`2x`})},ap=()=>(0,P.jsx)(D,{children:(0,P.jsx)(ip,{})});export{ap as SandboxPage};
|