mirror of
https://gh.wpcy.net/https://github.com/LJPc-solutions/freescout-calendar-module.git
synced 2026-05-29 01:34:15 +08:00
9 lines
No EOL
186 KiB
JavaScript
9 lines
No EOL
186 KiB
JavaScript
/*!
|
||
* TOAST UI Calendar 2nd Edition
|
||
* @version 2.1.3 | Mon May 06 2024
|
||
* @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
|
||
* @license MIT
|
||
*/
|
||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("tui-date-picker")):"function"==typeof define&&define.amd?define(["tui-date-picker"],t):"object"==typeof exports?exports.tui=t(require("tui-date-picker")):(e.tui=e.tui||{},e.tui.Calendar=t(e.tui.DatePicker))}(this,(function(e){return function(){var t={651:function(e){
|
||
/*! @license DOMPurify 2.5.2 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.5.2/LICENSE */
|
||
e.exports=function(){"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,n){return t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(e,n)}function n(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function o(e,r,i){return o=n()?Reflect.construct:function(e,n,o){var r=[null];r.push.apply(r,n);var i=new(Function.bind.apply(e,r));return o&&t(i,o.prototype),i},o.apply(null,arguments)}function r(e){return i(e)||a(e)||l(e)||c()}function i(e){if(Array.isArray(e))return s(e)}function a(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function l(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function c(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u=Object.hasOwnProperty,d=Object.setPrototypeOf,p=Object.isFrozen,f=Object.getPrototypeOf,m=Object.getOwnPropertyDescriptor,h=Object.freeze,g=Object.seal,v=Object.create,y="undefined"!=typeof Reflect&&Reflect,_=y.apply,w=y.construct;_||(_=function(e,t,n){return e.apply(t,n)}),h||(h=function(e){return e}),g||(g=function(e){return e}),w||(w=function(e,t){return o(e,r(t))});var b=A(Array.prototype.forEach),D=A(Array.prototype.pop),k=A(Array.prototype.push),C=A(String.prototype.toLowerCase),S=A(String.prototype.toString),x=A(String.prototype.match),E=A(String.prototype.replace),I=A(String.prototype.indexOf),N=A(String.prototype.trim),M=A(RegExp.prototype.test),T=O(TypeError);function A(e){return function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return _(e,t,o)}}function O(e){return function(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return w(e,n)}}function P(e,t,n){var o;n=null!==(o=n)&&void 0!==o?o:C,d&&d(e,null);for(var r=t.length;r--;){var i=t[r];if("string"==typeof i){var a=n(i);a!==i&&(p(t)||(t[r]=a),i=a)}e[i]=!0}return e}function R(e){var t,n=v(null);for(t in e)!0===_(u,e,[t])&&(n[t]=e[t]);return n}function L(e,t){for(;null!==e;){var n=m(e,t);if(n){if(n.get)return A(n.get);if("function"==typeof n.value)return A(n.value)}e=f(e)}function o(e){return console.warn("fallback value for",e),null}return o}var H=h(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),F=h(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),W=h(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),z=h(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),B=h(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),$=h(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),G=h(["#text"]),U=h(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),j=h(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Y=h(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),V=h(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),X=g(/\{\{[\w\W]*|[\w\W]*\}\}/gm),q=g(/<%[\w\W]*|[\w\W]*%>/gm),K=g(/\${[\w\W]*}/gm),Z=g(/^data-[\-\w.\u00B7-\uFFFF]/),J=g(/^aria-[\-\w]+$/),Q=g(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ee=g(/^(?:\w+script|data):/i),te=g(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ne=g(/^html$/i),oe=g(/^[a-z][.\w]*(-[.\w]+)+$/i),re=function(){return"undefined"==typeof window?null:window},ie=function(t,n){if("object"!==e(t)||"function"!=typeof t.createPolicy)return null;var o=null,r="data-tt-policy-suffix";n.currentScript&&n.currentScript.hasAttribute(r)&&(o=n.currentScript.getAttribute(r));var i="dompurify"+(o?"#"+o:"");try{return t.createPolicy(i,{createHTML:function(e){return e},createScriptURL:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+i+" could not be created."),null}};function ae(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:re(),n=function(e){return ae(e)};if(n.version="2.5.2",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;var o=t.document,i=t.document,a=t.DocumentFragment,l=t.HTMLTemplateElement,s=t.Node,c=t.Element,u=t.NodeFilter,d=t.NamedNodeMap,p=void 0===d?t.NamedNodeMap||t.MozNamedAttrMap:d,f=t.HTMLFormElement,m=t.DOMParser,g=t.trustedTypes,v=c.prototype,y=L(v,"cloneNode"),_=L(v,"nextSibling"),w=L(v,"childNodes"),A=L(v,"parentNode");if("function"==typeof l){var O=i.createElement("template");O.content&&O.content.ownerDocument&&(i=O.content.ownerDocument)}var le=ie(g,o),se=le?le.createHTML(""):"",ce=i,ue=ce.implementation,de=ce.createNodeIterator,pe=ce.createDocumentFragment,fe=ce.getElementsByTagName,me=o.importNode,he={};try{he=R(i).documentMode?i.documentMode:{}}catch(e){}var ge={};n.isSupported="function"==typeof A&&ue&&void 0!==ue.createHTMLDocument&&9!==he;var ve,ye,_e=X,we=q,be=K,De=Z,ke=J,Ce=ee,Se=te,xe=oe,Ee=Q,Ie=null,Ne=P({},[].concat(r(H),r(F),r(W),r(B),r(G))),Me=null,Te=P({},[].concat(r(U),r(j),r(Y),r(V))),Ae=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Oe=null,Pe=null,Re=!0,Le=!0,He=!1,Fe=!0,We=!1,ze=!0,Be=!1,$e=!1,Ge=!1,Ue=!1,je=!1,Ye=!1,Ve=!0,Xe=!1,qe="user-content-",Ke=!0,Ze=!1,Je={},Qe=null,et=P({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),tt=null,nt=P({},["audio","video","img","source","image","track"]),ot=null,rt=P({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),it="http://www.w3.org/1998/Math/MathML",at="http://www.w3.org/2000/svg",lt="http://www.w3.org/1999/xhtml",st=lt,ct=!1,ut=null,dt=P({},[it,at,lt],S),pt=["application/xhtml+xml","text/html"],ft="text/html",mt=null,ht=255,gt=i.createElement("form"),vt=function(e){return e instanceof RegExp||e instanceof Function},yt=function(t){mt&&mt===t||(t&&"object"===e(t)||(t={}),t=R(t),ve=ve=-1===pt.indexOf(t.PARSER_MEDIA_TYPE)?ft:t.PARSER_MEDIA_TYPE,ye="application/xhtml+xml"===ve?S:C,Ie="ALLOWED_TAGS"in t?P({},t.ALLOWED_TAGS,ye):Ne,Me="ALLOWED_ATTR"in t?P({},t.ALLOWED_ATTR,ye):Te,ut="ALLOWED_NAMESPACES"in t?P({},t.ALLOWED_NAMESPACES,S):dt,ot="ADD_URI_SAFE_ATTR"in t?P(R(rt),t.ADD_URI_SAFE_ATTR,ye):rt,tt="ADD_DATA_URI_TAGS"in t?P(R(nt),t.ADD_DATA_URI_TAGS,ye):nt,Qe="FORBID_CONTENTS"in t?P({},t.FORBID_CONTENTS,ye):et,Oe="FORBID_TAGS"in t?P({},t.FORBID_TAGS,ye):{},Pe="FORBID_ATTR"in t?P({},t.FORBID_ATTR,ye):{},Je="USE_PROFILES"in t&&t.USE_PROFILES,Re=!1!==t.ALLOW_ARIA_ATTR,Le=!1!==t.ALLOW_DATA_ATTR,He=t.ALLOW_UNKNOWN_PROTOCOLS||!1,Fe=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,We=t.SAFE_FOR_TEMPLATES||!1,ze=!1!==t.SAFE_FOR_XML,Be=t.WHOLE_DOCUMENT||!1,Ue=t.RETURN_DOM||!1,je=t.RETURN_DOM_FRAGMENT||!1,Ye=t.RETURN_TRUSTED_TYPE||!1,Ge=t.FORCE_BODY||!1,Ve=!1!==t.SANITIZE_DOM,Xe=t.SANITIZE_NAMED_PROPS||!1,Ke=!1!==t.KEEP_CONTENT,Ze=t.IN_PLACE||!1,Ee=t.ALLOWED_URI_REGEXP||Ee,st=t.NAMESPACE||lt,Ae=t.CUSTOM_ELEMENT_HANDLING||{},t.CUSTOM_ELEMENT_HANDLING&&vt(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Ae.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&vt(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Ae.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Ae.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),We&&(Le=!1),je&&(Ue=!0),Je&&(Ie=P({},r(G)),Me=[],!0===Je.html&&(P(Ie,H),P(Me,U)),!0===Je.svg&&(P(Ie,F),P(Me,j),P(Me,V)),!0===Je.svgFilters&&(P(Ie,W),P(Me,j),P(Me,V)),!0===Je.mathMl&&(P(Ie,B),P(Me,Y),P(Me,V))),t.ADD_TAGS&&(Ie===Ne&&(Ie=R(Ie)),P(Ie,t.ADD_TAGS,ye)),t.ADD_ATTR&&(Me===Te&&(Me=R(Me)),P(Me,t.ADD_ATTR,ye)),t.ADD_URI_SAFE_ATTR&&P(ot,t.ADD_URI_SAFE_ATTR,ye),t.FORBID_CONTENTS&&(Qe===et&&(Qe=R(Qe)),P(Qe,t.FORBID_CONTENTS,ye)),Ke&&(Ie["#text"]=!0),Be&&P(Ie,["html","head","body"]),Ie.table&&(P(Ie,["tbody"]),delete Oe.tbody),h&&h(t),mt=t)},_t=P({},["mi","mo","mn","ms","mtext"]),wt=P({},["foreignobject","annotation-xml"]),bt=P({},["title","style","font","a","script"]),Dt=P({},F);P(Dt,W),P(Dt,z);var kt=P({},B);P(kt,$);var Ct=function(e){var t=A(e);t&&t.tagName||(t={namespaceURI:st,tagName:"template"});var n=C(e.tagName),o=C(t.tagName);return!!ut[e.namespaceURI]&&(e.namespaceURI===at?t.namespaceURI===lt?"svg"===n:t.namespaceURI===it?"svg"===n&&("annotation-xml"===o||_t[o]):Boolean(Dt[n]):e.namespaceURI===it?t.namespaceURI===lt?"math"===n:t.namespaceURI===at?"math"===n&&wt[o]:Boolean(kt[n]):e.namespaceURI===lt?!(t.namespaceURI===at&&!wt[o])&&!(t.namespaceURI===it&&!_t[o])&&!kt[n]&&(bt[n]||!Dt[n]):!("application/xhtml+xml"!==ve||!ut[e.namespaceURI]))},St=function(e){k(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=se}catch(t){e.remove()}}},xt=function(e,t){try{k(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){k(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!Me[e])if(Ue||je)try{St(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},Et=function(e){var t,n;if(Ge)e="<remove></remove>"+e;else{var o=x(e,/^[\r\n\t ]+/);n=o&&o[0]}"application/xhtml+xml"===ve&&st===lt&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var r=le?le.createHTML(e):e;if(st===lt)try{t=(new m).parseFromString(r,ve)}catch(e){}if(!t||!t.documentElement){t=ue.createDocument(st,"template",null);try{t.documentElement.innerHTML=ct?se:r}catch(e){}}var a=t.body||t.documentElement;return e&&n&&a.insertBefore(i.createTextNode(n),a.childNodes[0]||null),st===lt?fe.call(t,Be?"html":"body")[0]:Be?t.documentElement:a},It=function(e){return de.call(e.ownerDocument||e,e,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null,!1)},Nt=function(e){return e instanceof f&&(void 0!==e.__depth&&"number"!=typeof e.__depth||void 0!==e.__removalCount&&"number"!=typeof e.__removalCount||"string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof p)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Mt=function(t){return"object"===e(s)?t instanceof s:t&&"object"===e(t)&&"number"==typeof t.nodeType&&"string"==typeof t.nodeName},Tt=function(e,t,o){ge[e]&&b(ge[e],(function(e){e.call(n,t,o,mt)}))},At=function(e){var t;if(Tt("beforeSanitizeElements",e,null),Nt(e))return St(e),!0;if(M(/[\u0080-\uFFFF]/,e.nodeName))return St(e),!0;var o=ye(e.nodeName);if(Tt("uponSanitizeElement",e,{tagName:o,allowedTags:Ie}),e.hasChildNodes()&&!Mt(e.firstElementChild)&&(!Mt(e.content)||!Mt(e.content.firstElementChild))&&M(/<[/\w]/g,e.innerHTML)&&M(/<[/\w]/g,e.textContent))return St(e),!0;if("select"===o&&M(/<template/i,e.innerHTML))return St(e),!0;if(7===e.nodeType)return St(e),!0;if(ze&&8===e.nodeType&&M(/<[/\w]/g,e.data))return St(e),!0;if(!Ie[o]||Oe[o]){if(!Oe[o]&&Pt(o)){if(Ae.tagNameCheck instanceof RegExp&&M(Ae.tagNameCheck,o))return!1;if(Ae.tagNameCheck instanceof Function&&Ae.tagNameCheck(o))return!1}if(Ke&&!Qe[o]){var r=A(e)||e.parentNode,i=w(e)||e.childNodes;if(i&&r)for(var a=i.length-1;a>=0;--a){var l=y(i[a],!0);l.__removalCount=(e.__removalCount||0)+1,r.insertBefore(l,_(e))}}return St(e),!0}return e instanceof c&&!Ct(e)?(St(e),!0):"noscript"!==o&&"noembed"!==o&&"noframes"!==o||!M(/<\/no(script|embed|frames)/i,e.innerHTML)?(We&&3===e.nodeType&&(t=e.textContent,t=E(t,_e," "),t=E(t,we," "),t=E(t,be," "),e.textContent!==t&&(k(n.removed,{element:e.cloneNode()}),e.textContent=t)),Tt("afterSanitizeElements",e,null),!1):(St(e),!0)},Ot=function(e,t,n){if(Ve&&("id"===t||"name"===t)&&(n in i||n in gt))return!1;if(Le&&!Pe[t]&&M(De,t));else if(Re&&M(ke,t));else if(!Me[t]||Pe[t]){if(!(Pt(e)&&(Ae.tagNameCheck instanceof RegExp&&M(Ae.tagNameCheck,e)||Ae.tagNameCheck instanceof Function&&Ae.tagNameCheck(e))&&(Ae.attributeNameCheck instanceof RegExp&&M(Ae.attributeNameCheck,t)||Ae.attributeNameCheck instanceof Function&&Ae.attributeNameCheck(t))||"is"===t&&Ae.allowCustomizedBuiltInElements&&(Ae.tagNameCheck instanceof RegExp&&M(Ae.tagNameCheck,n)||Ae.tagNameCheck instanceof Function&&Ae.tagNameCheck(n))))return!1}else if(ot[t]);else if(M(Ee,E(n,Se,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==I(n,"data:")||!tt[e])if(He&&!M(Ce,E(n,Se,"")));else if(n)return!1;return!0},Pt=function(e){return"annotation-xml"!==e&&x(e,xe)},Rt=function(t){var o,r,i,a;Tt("beforeSanitizeAttributes",t,null);var l=t.attributes;if(l){var s={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Me};for(a=l.length;a--;){var c=o=l[a],u=c.name,d=c.namespaceURI;if(r="value"===u?o.value:N(o.value),i=ye(u),s.attrName=i,s.attrValue=r,s.keepAttr=!0,s.forceKeepAttr=void 0,Tt("uponSanitizeAttribute",t,s),r=s.attrValue,!s.forceKeepAttr&&(xt(u,t),s.keepAttr))if(Fe||!M(/\/>/i,r)){We&&(r=E(r,_e," "),r=E(r,we," "),r=E(r,be," "));var p=ye(t.nodeName);if(Ot(p,i,r)){if(!Xe||"id"!==i&&"name"!==i||(xt(u,t),r=qe+r),le&&"object"===e(g)&&"function"==typeof g.getAttributeType)if(d);else switch(g.getAttributeType(p,i)){case"TrustedHTML":r=le.createHTML(r);break;case"TrustedScriptURL":r=le.createScriptURL(r)}try{d?t.setAttributeNS(d,u,r):t.setAttribute(u,r),D(n.removed)}catch(e){}}}else xt(u,t)}Tt("afterSanitizeAttributes",t,null)}},Lt=function e(t){var n,o=It(t);for(Tt("beforeSanitizeShadowDOM",t,null);n=o.nextNode();)if(Tt("uponSanitizeShadowNode",n,null),!At(n)){var r=A(n);1===n.nodeType&&(r&&r.__depth?n.__depth=(n.__removalCount||0)+r.__depth+1:n.__depth=1),n.__depth>=ht&&St(n),n.content instanceof a&&(n.content.__depth=n.__depth,e(n.content)),Rt(n)}Tt("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(r){var i,l,c,u,d,p=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((ct=!r)&&(r="\x3c!--\x3e"),"string"!=typeof r&&!Mt(r)){if("function"!=typeof r.toString)throw T("toString is not a function");if("string"!=typeof(r=r.toString()))throw T("dirty is not a string, aborting")}if(!n.isSupported){if("object"===e(t.toStaticHTML)||"function"==typeof t.toStaticHTML){if("string"==typeof r)return t.toStaticHTML(r);if(Mt(r))return t.toStaticHTML(r.outerHTML)}return r}if($e||yt(p),n.removed=[],"string"==typeof r&&(Ze=!1),Ze){if(r.nodeName){var f=ye(r.nodeName);if(!Ie[f]||Oe[f])throw T("root node is forbidden and cannot be sanitized in-place")}}else if(r instanceof s)1===(l=(i=Et("\x3c!----\x3e")).ownerDocument.importNode(r,!0)).nodeType&&"BODY"===l.nodeName||"HTML"===l.nodeName?i=l:i.appendChild(l);else{if(!Ue&&!We&&!Be&&-1===r.indexOf("<"))return le&&Ye?le.createHTML(r):r;if(!(i=Et(r)))return Ue?null:Ye?se:""}i&&Ge&&St(i.firstChild);for(var m=It(Ze?r:i);c=m.nextNode();)if((3!==c.nodeType||c!==u)&&!At(c)){var h=A(c);1===c.nodeType&&(h&&h.__depth?c.__depth=(c.__removalCount||0)+h.__depth+1:c.__depth=1),c.__depth>=ht&&St(c),c.content instanceof a&&(c.content.__depth=c.__depth,Lt(c.content)),Rt(c),u=c}if(u=null,Ze)return r;if(Ue){if(je)for(d=pe.call(i.ownerDocument);i.firstChild;)d.appendChild(i.firstChild);else d=i;return(Me.shadowroot||Me.shadowrootmod)&&(d=me.call(o,d,!0)),d}var g=Be?i.outerHTML:i.innerHTML;return Be&&Ie["!doctype"]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&M(ne,i.ownerDocument.doctype.name)&&(g="<!DOCTYPE "+i.ownerDocument.doctype.name+">\n"+g),We&&(g=E(g,_e," "),g=E(g,we," "),g=E(g,be," ")),le&&Ye?le.createHTML(g):g},n.setConfig=function(e){yt(e),$e=!0},n.clearConfig=function(){mt=null,$e=!1},n.isValidAttribute=function(e,t,n){mt||yt({});var o=ye(e),r=ye(t);return Ot(o,r,n)},n.addHook=function(e,t){"function"==typeof t&&(ge[e]=ge[e]||[],k(ge[e],t))},n.removeHook=function(e){if(ge[e])return D(ge[e])},n.removeHooks=function(e){ge[e]&&(ge[e]=[])},n.removeAllHooks=function(){ge={}},n}return ae()}()},897:function(e,t,n){e.exports=window.DOMPurify||(window.DOMPurify=n(651).default||n(651))},129:function(e,t,n){"use strict";var o=n(395);e.exports=function(e,t,n){var r,i=[];for(o(t)&&(t=e||0,e=0),t*=r=(n=n||1)<0?-1:1;e*r<t;e+=n)i.push(e);return i}},177:function(e,t,n){"use strict";var o=n(174),r=n(436),i=n(792);e.exports=function(e,t,n){o(e)?r(e,t,n):i(e,t,n)}},436:function(e){"use strict";e.exports=function(e,t,n){var o=0,r=e.length;for(n=n||null;o<r&&!1!==t.call(n,e[o],o,e);o+=1);}},792:function(e){"use strict";e.exports=function(e,t,n){var o;for(o in n=n||null,e)if(e.hasOwnProperty(o)&&!1===t.call(n,e[o],o,e))break}},363:function(e,t,n){"use strict";var o=n(582),r=n(745),i=n(450),a=n(460),l=n(174),s=n(991),c=n(177),u=/\s+/g;function d(){this.events=null,this.contexts=null}d.mixin=function(e){o(e.prototype,d.prototype)},d.prototype._getHandlerItem=function(e,t){var n={handler:e};return t&&(n.context=t),n},d.prototype._safeEvent=function(e){var t,n=this.events;return n||(n=this.events={}),e&&((t=n[e])||(t=[],n[e]=t),n=t),n},d.prototype._safeContext=function(){var e=this.contexts;return e||(e=this.contexts=[]),e},d.prototype._indexOfContext=function(e){for(var t=this._safeContext(),n=0;t[n];){if(e===t[n][0])return n;n+=1}return-1},d.prototype._memorizeContext=function(e){var t,n;r(e)&&(t=this._safeContext(),(n=this._indexOfContext(e))>-1?t[n][1]+=1:t.push([e,1]))},d.prototype._forgetContext=function(e){var t,n;r(e)&&(t=this._safeContext(),(n=this._indexOfContext(e))>-1&&(t[n][1]-=1,t[n][1]<=0&&t.splice(n,1)))},d.prototype._bindEvent=function(e,t,n){var o=this._safeEvent(e);this._memorizeContext(n),o.push(this._getHandlerItem(t,n))},d.prototype.on=function(e,t,n){var o=this;i(e)?(e=e.split(u),c(e,(function(e){o._bindEvent(e,t,n)}))):a(e)&&(n=t,c(e,(function(e,t){o.on(t,e,n)})))},d.prototype.once=function(e,t,n){var o=this;if(a(e))return n=t,void c(e,(function(e,t){o.once(t,e,n)}));this.on(e,(function r(){t.apply(n,arguments),o.off(e,r,n)}),n)},d.prototype._spliceMatches=function(e,t){var n,o=0;if(l(e))for(n=e.length;o<n;o+=1)!0===t(e[o])&&(e.splice(o,1),n-=1,o-=1)},d.prototype._matchHandler=function(e){var t=this;return function(n){var o=e===n.handler;return o&&t._forgetContext(n.context),o}},d.prototype._matchContext=function(e){var t=this;return function(n){var o=e===n.context;return o&&t._forgetContext(n.context),o}},d.prototype._matchHandlerAndContext=function(e,t){var n=this;return function(o){var r=e===o.handler,i=t===o.context,a=r&&i;return a&&n._forgetContext(o.context),a}},d.prototype._offByEventName=function(e,t){var n=this,o=s(t),r=n._matchHandler(t);e=e.split(u),c(e,(function(e){var t=n._safeEvent(e);o?n._spliceMatches(t,r):(c(t,(function(e){n._forgetContext(e.context)})),n.events[e]=[])}))},d.prototype._offByHandler=function(e){var t=this,n=this._matchHandler(e);c(this._safeEvent(),(function(e){t._spliceMatches(e,n)}))},d.prototype._offByObject=function(e,t){var n,o=this;this._indexOfContext(e)<0?c(e,(function(e,t){o.off(t,e)})):i(t)?(n=this._matchContext(e),o._spliceMatches(this._safeEvent(t),n)):s(t)?(n=this._matchHandlerAndContext(t,e),c(this._safeEvent(),(function(e){o._spliceMatches(e,n)}))):(n=this._matchContext(e),c(this._safeEvent(),(function(e){o._spliceMatches(e,n)})))},d.prototype.off=function(e,t){i(e)?this._offByEventName(e,t):arguments.length?s(e)?this._offByHandler(e):a(e)&&this._offByObject(e,t):(this.events={},this.contexts=[])},d.prototype.fire=function(e){this.invoke.apply(this,arguments)},d.prototype.invoke=function(e){var t,n,o,r;if(!this.hasListener(e))return!0;for(t=this._safeEvent(e),n=Array.prototype.slice.call(arguments,1),o=0;t[o];){if(!1===(r=t[o]).handler.apply(r.context,n))return!1;o+=1}return!0},d.prototype.hasListener=function(e){return this.getListenerLength(e)>0},d.prototype.getListenerLength=function(e){return this._safeEvent(e).length},e.exports=d},582:function(e){"use strict";e.exports=function(e,t){var n,o,r,i,a=Object.prototype.hasOwnProperty;for(r=1,i=arguments.length;r<i;r+=1)for(o in n=arguments[r])a.call(n,o)&&(e[o]=n[o]);return e}},645:function(e,t,n){"use strict";var o=n(792);e.exports=function(e,t){var n=document.createElement("img"),r="";return o(t,(function(e,t){r+="&"+t+"="+e})),r=r.substring(1),n.src=e+"?"+r,n.style.display="none",document.body.appendChild(n),document.body.removeChild(n),n}},229:function(e,t,n){"use strict";var o=n(395),r=n(645),i=6048e5;e.exports=function(e,t){var n=location.hostname,a="TOAST UI "+e+" for "+n+": Statistics",l=window.localStorage.getItem(a);(o(window.tui)||!1!==window.tui.usageStatistics)&&(l&&!function(e){return(new Date).getTime()-e>i}(l)||(window.localStorage.setItem(a,(new Date).getTime()),setTimeout((function(){"interactive"!==document.readyState&&"complete"!==document.readyState||r("https://www.google-analytics.com/collect",{v:1,t:"event",tid:t,cid:n,dp:n,dh:e,el:e,ec:"use"})}),1e3)))}},174:function(e){"use strict";e.exports=function(e){return e instanceof Array}},499:function(e){"use strict";e.exports=function(e){return"boolean"==typeof e||e instanceof Boolean}},745:function(e,t,n){"use strict";var o=n(395),r=n(870);e.exports=function(e){return!o(e)&&!r(e)}},991:function(e){"use strict";e.exports=function(e){return e instanceof Function}},870:function(e){"use strict";e.exports=function(e){return null===e}},90:function(e){"use strict";e.exports=function(e){return"number"==typeof e||e instanceof Number}},460:function(e){"use strict";e.exports=function(e){return e===Object(e)}},450:function(e){"use strict";e.exports=function(e){return"string"==typeof e||e instanceof String}},395:function(e){"use strict";e.exports=function(e){return void 0===e}},411:function(t){"use strict";t.exports=e}},n={};function o(e){var r=n[e];if(void 0!==r)return r.exports;var i=n[e]={exports:{}};return t[e].call(i.exports,i,i.exports,o),i.exports}o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,{a:t}),t},o.d=function(e,t){for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var r={};return function(){"use strict";o.d(r,{default:function(){return bu}});var e,t,n,i,a,l,s,c,u,d,p,f={},m=[],h=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,g=Array.isArray;function v(e,t){for(var n in t)e[n]=t[n];return e}function y(e){var t=e.parentNode;t&&t.removeChild(e)}function _(t,n,o){var r,i,a,l={};for(a in n)"key"==a?r=n[a]:"ref"==a?i=n[a]:l[a]=n[a];if(arguments.length>2&&(l.children=arguments.length>3?e.call(arguments,2):o),"function"==typeof t&&null!=t.defaultProps)for(a in t.defaultProps)void 0===l[a]&&(l[a]=t.defaultProps[a]);return w(t,l,r,i,null)}function w(e,o,r,i,a){var l={type:e,props:o,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==a?++n:a,__i:-1,__u:0};return null==a&&null!=t.vnode&&t.vnode(l),l}function b(e){return e.children}function D(e,t){this.props=e,this.context=t}function k(e,t){if(null==t)return e.__?k(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?k(e):null}function C(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return C(e)}}function S(e){(!e.__d&&(e.__d=!0)&&i.push(e)&&!x.__r++||a!==t.debounceRendering)&&((a=t.debounceRendering)||l)(x)}function x(){var e,n,o,r,a,l,c,u;for(i.sort(s);e=i.shift();)e.__d&&(n=i.length,r=void 0,l=(a=(o=e).__v).__e,c=[],u=[],o.__P&&((r=v({},a)).__v=a.__v+1,t.vnode&&t.vnode(r),R(o.__P,r,a,o.__n,void 0!==o.__P.ownerSVGElement,32&a.__u?[l]:null,c,null==l?k(a):l,!!(32&a.__u),u),r.__v=a.__v,r.__.__k[r.__i]=r,L(c,r,u),r.__e!=l&&C(r)),i.length>n&&i.sort(s));x.__r=0}function E(e,t,n,o,r,i,a,l,s,c,u){var d,p,h,g,v,y=o&&o.__k||m,_=t.length;for(n.__d=s,I(n,t,y),s=n.__d,d=0;d<_;d++)null!=(h=n.__k[d])&&"boolean"!=typeof h&&"function"!=typeof h&&(p=-1===h.__i?f:y[h.__i]||f,h.__i=d,R(e,h,p,r,i,a,l,s,c,u),g=h.__e,h.ref&&p.ref!=h.ref&&(p.ref&&F(p.ref,null,h),u.push(h.ref,h.__c||g,h)),null==v&&null!=g&&(v=g),65536&h.__u||p.__k===h.__k?(s&&!s.isConnected&&(s=k(p)),s=N(h,s,e)):"function"==typeof h.type&&void 0!==h.__d?s=h.__d:g&&(s=g.nextSibling),h.__d=void 0,h.__u&=-196609);n.__d=s,n.__e=v}function I(e,t,n){var o,r,i,a,l,s=t.length,c=n.length,u=c,d=0;for(e.__k=[],o=0;o<s;o++)a=o+d,null!=(r=e.__k[o]=null==(r=t[o])||"boolean"==typeof r||"function"==typeof r?null:"string"==typeof r||"number"==typeof r||"bigint"==typeof r||r.constructor==String?w(null,r,null,null,null):g(r)?w(b,{children:r},null,null,null):void 0===r.constructor&&r.__b>0?w(r.type,r.props,r.key,r.ref?r.ref:null,r.__v):r)?(r.__=e,r.__b=e.__b+1,l=T(r,n,a,u),r.__i=l,i=null,-1!==l&&(u--,(i=n[l])&&(i.__u|=131072)),null==i||null===i.__v?(-1==l&&d--,"function"!=typeof r.type&&(r.__u|=65536)):l!==a&&(l===a+1?d++:l>a?u>s-a?d+=l-a:d--:l<a?l==a-1&&(d=l-a):d=0,l!==o+d&&(r.__u|=65536))):(i=n[a])&&null==i.key&&i.__e&&!(131072&i.__u)&&(i.__e==e.__d&&(e.__d=k(i)),W(i,i,!1),n[a]=null,u--);if(u)for(o=0;o<c;o++)null!=(i=n[o])&&!(131072&i.__u)&&(i.__e==e.__d&&(e.__d=k(i)),W(i,i))}function N(e,t,n){var o,r;if("function"==typeof e.type){for(o=e.__k,r=0;o&&r<o.length;r++)o[r]&&(o[r].__=e,t=N(o[r],t,n));return t}e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8===t.nodeType);return t}function M(e,t){return t=t||[],null==e||"boolean"==typeof e||(g(e)?e.some((function(e){M(e,t)})):t.push(e)),t}function T(e,t,n,o){var r=e.key,i=e.type,a=n-1,l=n+1,s=t[n];if(null===s||s&&r==s.key&&i===s.type&&!(131072&s.__u))return n;if(o>(null==s||131072&s.__u?0:1))for(;a>=0||l<t.length;){if(a>=0){if((s=t[a])&&!(131072&s.__u)&&r==s.key&&i===s.type)return a;a--}if(l<t.length){if((s=t[l])&&!(131072&s.__u)&&r==s.key&&i===s.type)return l;l++}}return-1}function A(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||h.test(t)?n:n+"px"}function O(e,t,n,o,r){var i;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof o&&(e.style.cssText=o=""),o)for(t in o)n&&t in n||A(e.style,t,"");if(n)for(t in n)o&&n[t]===o[t]||A(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])i=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase()in e||"onFocusOut"===t||"onFocusIn"===t?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?o?n.u=o.u:(n.u=c,e.addEventListener(t,i?d:u,i)):e.removeEventListener(t,i?d:u,i);else{if(r)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,n))}}function P(e){return function(n){if(this.l){var o=this.l[n.type+e];if(null==n.t)n.t=c++;else if(n.t<o.u)return;return o(t.event?t.event(n):n)}}}function R(e,n,o,r,i,a,l,s,c,u){var d,p,f,m,h,y,_,w,k,C,S,x,I,N,M,T=n.type;if(void 0!==n.constructor)return null;128&o.__u&&(c=!!(32&o.__u),a=[s=n.__e=o.__e]),(d=t.__b)&&d(n);e:if("function"==typeof T)try{if(w=n.props,k=(d=T.contextType)&&r[d.__c],C=d?k?k.props.value:d.__:r,o.__c?_=(p=n.__c=o.__c).__=p.__E:("prototype"in T&&T.prototype.render?n.__c=p=new T(w,C):(n.__c=p=new D(w,C),p.constructor=T,p.render=z),k&&k.sub(p),p.props=w,p.state||(p.state={}),p.context=C,p.__n=r,f=p.__d=!0,p.__h=[],p._sb=[]),null==p.__s&&(p.__s=p.state),null!=T.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=v({},p.__s)),v(p.__s,T.getDerivedStateFromProps(w,p.__s))),m=p.props,h=p.state,p.__v=n,f)null==T.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(null==T.getDerivedStateFromProps&&w!==m&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(w,C),!p.__e&&(null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(w,p.__s,C)||n.__v===o.__v)){for(n.__v!==o.__v&&(p.props=w,p.state=p.__s,p.__d=!1),n.__e=o.__e,n.__k=o.__k,n.__k.forEach((function(e){e&&(e.__=n)})),S=0;S<p._sb.length;S++)p.__h.push(p._sb[S]);p._sb=[],p.__h.length&&l.push(p);break e}null!=p.componentWillUpdate&&p.componentWillUpdate(w,p.__s,C),null!=p.componentDidUpdate&&p.__h.push((function(){p.componentDidUpdate(m,h,y)}))}if(p.context=C,p.props=w,p.__P=e,p.__e=!1,x=t.__r,I=0,"prototype"in T&&T.prototype.render){for(p.state=p.__s,p.__d=!1,x&&x(n),d=p.render(p.props,p.state,p.context),N=0;N<p._sb.length;N++)p.__h.push(p._sb[N]);p._sb=[]}else do{p.__d=!1,x&&x(n),d=p.render(p.props,p.state,p.context),p.state=p.__s}while(p.__d&&++I<25);p.state=p.__s,null!=p.getChildContext&&(r=v(v({},r),p.getChildContext())),f||null==p.getSnapshotBeforeUpdate||(y=p.getSnapshotBeforeUpdate(m,h)),E(e,g(M=null!=d&&d.type===b&&null==d.key?d.props.children:d)?M:[M],n,o,r,i,a,l,s,c,u),p.base=n.__e,n.__u&=-161,p.__h.length&&l.push(p),_&&(p.__E=p.__=null)}catch(e){n.__v=null,c||null!=a?(n.__e=s,n.__u|=c?160:32,a[a.indexOf(s)]=null):(n.__e=o.__e,n.__k=o.__k),t.__e(e,n,o)}else null==a&&n.__v===o.__v?(n.__k=o.__k,n.__e=o.__e):n.__e=H(o.__e,n,o,r,i,a,l,c,u);(d=t.diffed)&&d(n)}function L(e,n,o){n.__d=void 0;for(var r=0;r<o.length;r++)F(o[r],o[++r],o[++r]);t.__c&&t.__c(n,e),e.some((function(n){try{e=n.__h,n.__h=[],e.some((function(e){e.call(n)}))}catch(e){t.__e(e,n.__v)}}))}function H(t,n,o,r,i,a,l,s,c){var u,d,p,m,h,v,_,w=o.props,b=n.props,D=n.type;if("svg"===D&&(i=!0),null!=a)for(u=0;u<a.length;u++)if((h=a[u])&&"setAttribute"in h==!!D&&(D?h.localName===D:3===h.nodeType)){t=h,a[u]=null;break}if(null==t){if(null===D)return document.createTextNode(b);t=i?document.createElementNS("http://www.w3.org/2000/svg",D):document.createElement(D,b.is&&b),a=null,s=!1}if(null===D)w===b||s&&t.data===b||(t.data=b);else{if(a=a&&e.call(t.childNodes),w=o.props||f,!s&&null!=a)for(w={},u=0;u<t.attributes.length;u++)w[(h=t.attributes[u]).name]=h.value;for(u in w)if(h=w[u],"children"==u);else if("dangerouslySetInnerHTML"==u)p=h;else if("key"!==u&&!(u in b)){if("value"==u&&"defaultValue"in b||"checked"==u&&"defaultChecked"in b)continue;O(t,u,null,h,i)}for(u in b)h=b[u],"children"==u?m=h:"dangerouslySetInnerHTML"==u?d=h:"value"==u?v=h:"checked"==u?_=h:"key"===u||s&&"function"!=typeof h||w[u]===h||O(t,u,h,w[u],i);if(d)s||p&&(d.__html===p.__html||d.__html===t.innerHTML)||(t.innerHTML=d.__html),n.__k=[];else if(p&&(t.innerHTML=""),E(t,g(m)?m:[m],n,o,r,i&&"foreignObject"!==D,a,l,a?a[0]:o.__k&&k(o,0),s,c),null!=a)for(u=a.length;u--;)null!=a[u]&&y(a[u]);s||(u="value",void 0!==v&&(v!==t[u]||"progress"===D&&!v||"option"===D&&v!==w[u])&&O(t,u,v,w[u],!1),u="checked",void 0!==_&&_!==t[u]&&O(t,u,_,w[u],!1))}return t}function F(e,n,o){try{"function"==typeof e?e(n):e.current=n}catch(e){t.__e(e,o)}}function W(e,n,o){var r,i;if(t.unmount&&t.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||F(r,null,n)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){t.__e(e,n)}r.base=r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&W(r[i],n,o||"function"!=typeof e.type);o||null==e.__e||y(e.__e),e.__c=e.__=e.__e=e.__d=void 0}function z(e,t,n){return this.constructor(e,n)}function B(n,o,r){var i,a,l,s;t.__&&t.__(n,o),a=(i="function"==typeof r)?null:r&&r.__k||o.__k,l=[],s=[],R(o,n=(!i&&r||o).__k=_(b,null,[n]),a||f,f,void 0!==o.ownerSVGElement,!i&&r?[r]:a?null:o.firstChild?e.call(o.childNodes):null,l,!i&&r?r:a?a.__e:o.firstChild,i,s),L(l,n,s)}function $(t,n,o){var r,i,a,l,s=v({},t.props);for(a in t.type&&t.type.defaultProps&&(l=t.type.defaultProps),n)"key"==a?r=n[a]:"ref"==a?i=n[a]:s[a]=void 0===n[a]&&void 0!==l?l[a]:n[a];return arguments.length>2&&(s.children=arguments.length>3?e.call(arguments,2):o),w(t.type,s,r||t.key,i||t.ref,null)}function G(e,t){var n={__c:t="__cC"+p++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,o;return this.getChildContext||(n=[],(o={})[t]=this,this.getChildContext=function(){return o},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,S(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}e=m.slice,t={__e:function(e,t,n,o){for(var r,i,a;t=t.__;)if((r=t.__c)&&!r.__)try{if((i=r.constructor)&&null!=i.getDerivedStateFromError&&(r.setState(i.getDerivedStateFromError(e)),a=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(e,o||{}),a=r.__d),a)return r.__E=r}catch(t){e=t}throw e}},n=0,D.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=v({},this.state),"function"==typeof e&&(e=e(v({},n),this.props)),e&&v(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),S(this))},D.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),S(this))},D.prototype.render=b,i=[],l="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,s=function(e,t){return e.__v.__b-t.__v.__b},x.__r=0,c=0,u=P(!1),d=P(!0),p=0;var U,j,Y,V,X=0,q=[],K=[],Z=t,J=Z.__b,Q=Z.__r,ee=Z.diffed,te=Z.__c,ne=Z.unmount,oe=Z.__;function re(e,t){Z.__h&&Z.__h(j,e,X||t),X=0;var n=j.__H||(j.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:K}),n.__[e]}function ie(e){return X=1,ae(_e,e)}function ae(e,t,n){var o=re(U++,2);if(o.t=e,!o.__c&&(o.__=[n?n(t):_e(void 0,t),function(e){var t=o.__N?o.__N[0]:o.__[0],n=o.t(t,e);t!==n&&(o.__N=[n,o.__[1]],o.__c.setState({}))}],o.__c=j,!j.u)){var r=function(e,t,n){if(!o.__c.__H)return!0;var r=o.__c.__H.__.filter((function(e){return!!e.__c}));if(r.every((function(e){return!e.__N})))return!i||i.call(this,e,t,n);var a=!1;return r.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(a=!0)}})),!(!a&&o.__c.props===e)&&(!i||i.call(this,e,t,n))};j.u=!0;var i=j.shouldComponentUpdate,a=j.componentWillUpdate;j.componentWillUpdate=function(e,t,n){if(this.__e){var o=i;i=void 0,r(e,t,n),i=o}a&&a.call(this,e,t,n)},j.shouldComponentUpdate=r}return o.__N||o.__}function le(e,t){var n=re(U++,3);!Z.__s&&ye(n.__H,t)&&(n.__=e,n.i=t,j.__H.__h.push(n))}function se(e,t){var n=re(U++,4);!Z.__s&&ye(n.__H,t)&&(n.__=e,n.i=t,j.__h.push(n))}function ce(e){return X=5,ue((function(){return{current:e}}),[])}function ue(e,t){var n=re(U++,7);return ye(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function de(e,t){return X=8,ue((function(){return e}),t)}function pe(e){var t=j.context[e.__c],n=re(U++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(j)),t.props.value):e.__}function fe(){for(var e;e=q.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(ge),e.__H.__h.forEach(ve),e.__H.__h=[]}catch(t){e.__H.__h=[],Z.__e(t,e.__v)}}Z.__b=function(e){j=null,J&&J(e)},Z.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),oe&&oe(e,t)},Z.__r=function(e){Q&&Q(e),U=0;var t=(j=e.__c).__H;t&&(Y===j?(t.__h=[],j.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=K,e.__N=e.i=void 0}))):(t.__h.forEach(ge),t.__h.forEach(ve),t.__h=[],U=0)),Y=j},Z.diffed=function(e){ee&&ee(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==q.push(t)&&V===Z.requestAnimationFrame||((V=Z.requestAnimationFrame)||he)(fe)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==K&&(e.__=e.__V),e.i=void 0,e.__V=K}))),Y=j=null},Z.__c=function(e,t){t.some((function(e){try{e.__h.forEach(ge),e.__h=e.__h.filter((function(e){return!e.__||ve(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],Z.__e(n,e.__v)}})),te&&te(e,t)},Z.unmount=function(e){ne&&ne(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{ge(e)}catch(e){t=e}})),n.__H=void 0,t&&Z.__e(t,n.__v))};var me="function"==typeof requestAnimationFrame;function he(e){var t,n=function(){clearTimeout(o),me&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(n,100);me&&(t=requestAnimationFrame(n))}function ge(e){var t=j,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),j=t}function ve(e){var t=j;e.__c=e.__(),j=t}function ye(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function _e(e,t){return"function"==typeof t?t(e):t}function we(e){for(var t=arguments.length,n=Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];throw Error("[Immer] minified error nr: "+e+(n.length?" "+n.map((function(e){return"'"+e+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function be(e){return!!e&&!!e[lt]}function De(e){var t;return!!e&&(function(e){if(!e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;var n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===st}(e)||Array.isArray(e)||!!e[at]||!!(null===(t=e.constructor)||void 0===t?void 0:t[at])||Ne(e)||Me(e))}function ke(e,t,n){void 0===n&&(n=!1),0===Ce(e)?(n?Object.keys:ct)(e).forEach((function(o){n&&"symbol"==typeof o||t(o,e[o],e)})):e.forEach((function(n,o){return t(o,n,e)}))}function Ce(e){var t=e[lt];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:Ne(e)?2:Me(e)?3:0}function Se(e,t){return 2===Ce(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function xe(e,t){return 2===Ce(e)?e.get(t):e[t]}function Ee(e,t,n){var o=Ce(e);2===o?e.set(t,n):3===o?e.add(n):e[t]=n}function Ie(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function Ne(e){return nt&&e instanceof Map}function Me(e){return ot&&e instanceof Set}function Te(e){return e.o||e.t}function Ae(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=ut(e);delete t[lt];for(var n=ct(t),o=0;o<n.length;o++){var r=n[o],i=t[r];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(t[r]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[r]})}return Object.create(Object.getPrototypeOf(e),t)}function Oe(e,t){return void 0===t&&(t=!1),Re(e)||be(e)||!De(e)||(Ce(e)>1&&(e.set=e.add=e.clear=e.delete=Pe),Object.freeze(e),t&&ke(e,(function(e,t){return Oe(t,!0)}),!0)),e}function Pe(){we(2)}function Re(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function Le(e){var t=dt[e];return t||we(18,e),t}function He(){return et}function Fe(e,t){t&&(Le("Patches"),e.u=[],e.s=[],e.v=t)}function We(e){ze(e),e.p.forEach($e),e.p=null}function ze(e){e===et&&(et=e.l)}function Be(e){return et={p:[],l:et,h:e,m:!0,_:0}}function $e(e){var t=e[lt];0===t.i||1===t.i?t.j():t.g=!0}function Ge(e,t){t._=t.p.length;var n=t.p[0],o=void 0!==e&&e!==n;return t.h.O||Le("ES5").S(t,e,o),o?(n[lt].P&&(We(t),we(4)),De(e)&&(e=Ue(t,e),t.l||Ye(t,e)),t.u&&Le("Patches").M(n[lt].t,e,t.u,t.s)):e=Ue(t,n,[]),We(t),t.u&&t.v(t.u,t.s),e!==it?e:void 0}function Ue(e,t,n){if(Re(t))return t;var o=t[lt];if(!o)return ke(t,(function(r,i){return je(e,o,t,r,i,n)}),!0),t;if(o.A!==e)return t;if(!o.P)return Ye(e,o.t,!0),o.t;if(!o.I){o.I=!0,o.A._--;var r=4===o.i||5===o.i?o.o=Ae(o.k):o.o,i=r,a=!1;3===o.i&&(i=new Set(r),r.clear(),a=!0),ke(i,(function(t,i){return je(e,o,r,t,i,n,a)})),Ye(e,r,!1),n&&e.u&&Le("Patches").N(o,n,e.u,e.s)}return o.o}function je(e,t,n,o,r,i,a){if(be(r)){var l=Ue(e,r,i&&t&&3!==t.i&&!Se(t.R,o)?i.concat(o):void 0);if(Ee(n,o,l),!be(l))return;e.m=!1}else a&&n.add(r);if(De(r)&&!Re(r)){if(!e.h.D&&e._<1)return;Ue(e,r),t&&t.A.l||Ye(e,r)}}function Ye(e,t,n){void 0===n&&(n=!1),!e.l&&e.h.D&&e.m&&Oe(t,n)}function Ve(e,t){var n=e[lt];return(n?Te(n):e)[t]}function Xe(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var o=Object.getOwnPropertyDescriptor(n,t);if(o)return o;n=Object.getPrototypeOf(n)}}function qe(e){e.P||(e.P=!0,e.l&&qe(e.l))}function Ke(e){e.o||(e.o=Ae(e.t))}function Ze(e,t,n){var o=Ne(t)?Le("MapSet").F(t,n):Me(t)?Le("MapSet").T(t,n):e.O?function(e,t){var n=Array.isArray(e),o={i:n?1:0,A:t?t.A:He(),P:!1,I:!1,R:{},l:t,t:e,k:null,o:null,j:null,C:!1},r=o,i=pt;n&&(r=[o],i=ft);var a=Proxy.revocable(r,i),l=a.revoke,s=a.proxy;return o.k=s,o.j=l,s}(t,n):Le("ES5").J(t,n);return(n?n.A:He()).p.push(o),o}function Je(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return Ae(e)}var Qe,et,tt="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),nt="undefined"!=typeof Map,ot="undefined"!=typeof Set,rt="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,it=tt?Symbol.for("immer-nothing"):((Qe={})["immer-nothing"]=!0,Qe),at=tt?Symbol.for("immer-draftable"):"__$immer_draftable",lt=tt?Symbol.for("immer-state"):"__$immer_state",st=("undefined"!=typeof Symbol&&Symbol.iterator,""+Object.prototype.constructor),ct="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,ut=Object.getOwnPropertyDescriptors||function(e){var t={};return ct(e).forEach((function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)})),t},dt={},pt={get:function(e,t){if(t===lt)return e;var n=Te(e);if(!Se(n,t))return function(e,t,n){var o,r=Xe(t,n);return r?"value"in r?r.value:null===(o=r.get)||void 0===o?void 0:o.call(e.k):void 0}(e,n,t);var o=n[t];return e.I||!De(o)?o:o===Ve(e.t,t)?(Ke(e),e.o[t]=Ze(e.A.h,o,e)):o},has:function(e,t){return t in Te(e)},ownKeys:function(e){return Reflect.ownKeys(Te(e))},set:function(e,t,n){var o=Xe(Te(e),t);if(null==o?void 0:o.set)return o.set.call(e.k,n),!0;if(!e.P){var r=Ve(Te(e),t),i=null==r?void 0:r[lt];if(i&&i.t===n)return e.o[t]=n,e.R[t]=!1,!0;if(Ie(n,r)&&(void 0!==n||Se(e.t,t)))return!0;Ke(e),qe(e)}return e.o[t]===n&&(void 0!==n||t in e.o)||Number.isNaN(n)&&Number.isNaN(e.o[t])||(e.o[t]=n,e.R[t]=!0),!0},deleteProperty:function(e,t){return void 0!==Ve(e.t,t)||t in e.t?(e.R[t]=!1,Ke(e),qe(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=Te(e),o=Reflect.getOwnPropertyDescriptor(n,t);return o?{writable:!0,configurable:1!==e.i||"length"!==t,enumerable:o.enumerable,value:n[t]}:o},defineProperty:function(){we(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){we(12)}},ft={};ke(pt,(function(e,t){ft[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),ft.deleteProperty=function(e,t){return ft.set.call(this,e,t,void 0)},ft.set=function(e,t,n){return pt.set.call(this,e[0],t,n,e[0])};var mt=function(){function e(e){var t=this;this.O=rt,this.D=!0,this.produce=function(e,n,o){if("function"==typeof e&&"function"!=typeof n){var r=n;n=e;var i=t;return function(e){var t=this;void 0===e&&(e=r);for(var o=arguments.length,a=Array(o>1?o-1:0),l=1;l<o;l++)a[l-1]=arguments[l];return i.produce(e,(function(e){var o;return(o=n).call.apply(o,[t,e].concat(a))}))}}var a;if("function"!=typeof n&&we(6),void 0!==o&&"function"!=typeof o&&we(7),De(e)){var l=Be(t),s=Ze(t,e,void 0),c=!0;try{a=n(s),c=!1}finally{c?We(l):ze(l)}return"undefined"!=typeof Promise&&a instanceof Promise?a.then((function(e){return Fe(l,o),Ge(e,l)}),(function(e){throw We(l),e})):(Fe(l,o),Ge(a,l))}if(!e||"object"!=typeof e){if(void 0===(a=n(e))&&(a=e),a===it&&(a=void 0),t.D&&Oe(a,!0),o){var u=[],d=[];Le("Patches").M(e,a,u,d),o(u,d)}return a}we(21,e)},this.produceWithPatches=function(e,n){if("function"==typeof e)return function(n){for(var o=arguments.length,r=Array(o>1?o-1:0),i=1;i<o;i++)r[i-1]=arguments[i];return t.produceWithPatches(n,(function(t){return e.apply(void 0,[t].concat(r))}))};var o,r,i=t.produce(e,n,(function(e,t){o=e,r=t}));return"undefined"!=typeof Promise&&i instanceof Promise?i.then((function(e){return[e,o,r]})):[i,o,r]},"boolean"==typeof(null==e?void 0:e.useProxies)&&this.setUseProxies(e.useProxies),"boolean"==typeof(null==e?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze)}var t=e.prototype;return t.createDraft=function(e){De(e)||we(8),be(e)&&(e=function(e){return be(e)||we(22,e),function e(t){if(!De(t))return t;var n,o=t[lt],r=Ce(t);if(o){if(!o.P&&(o.i<4||!Le("ES5").K(o)))return o.t;o.I=!0,n=Je(t,r),o.I=!1}else n=Je(t,r);return ke(n,(function(t,r){o&&xe(o.t,t)===r||Ee(n,t,e(r))})),3===r?new Set(n):n}(e)}(e));var t=Be(this),n=Ze(this,e,void 0);return n[lt].C=!0,ze(t),n},t.finishDraft=function(e,t){var n=(e&&e[lt]).A;return Fe(n,t),Ge(void 0,n)},t.setAutoFreeze=function(e){this.D=e},t.setUseProxies=function(e){e&&!rt&&we(20),this.O=e},t.applyPatches=function(e,t){var n;for(n=t.length-1;n>=0;n--){var o=t[n];if(0===o.path.length&&"replace"===o.op){e=o.value;break}}n>-1&&(t=t.slice(n+1));var r=Le("Patches").$;return be(e)?r(e,t):this.produce(e,(function(e){return r(e,t)}))},e}(),ht=new mt,gt=ht.produce,vt=(ht.produceWithPatches.bind(ht),ht.setAutoFreeze.bind(ht),ht.setUseProxies.bind(ht),ht.applyPatches.bind(ht),ht.createDraft.bind(ht),ht.finishDraft.bind(ht),gt),yt=o(129),_t=o.n(yt);const wt="0",bt=24,Dt=2,kt=3,Ct=27,St=5,xt=280,Et=44,It=12,Nt=12,Mt="12px 17px 0",Tt=2,At=72,Ot={color:"#000",backgroundColor:"#a1b56c",dragBackgroundColor:"#a1b56c",borderColor:"#000"},Pt=2,Rt=9;var Lt=o(450),Ht=o.n(Lt);const Ft="toastui-calendar-";function Wt(){const e=[];for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return n.forEach((t=>{t&&(Ht()(t)?e.push(t):Object.keys(t).forEach((n=>{t[n]&&e.push(n)})))})),e.map((e=>`${Ft}${e}`)).join(" ")}function zt(e){return`${e}%`}function Bt(e){return`${e}px`}function $t(e){const t=e.match(/(\d+)%/),n=e.match(/(-?)\s?(\d+)px/);return{percent:t?parseInt(t[1],10):0,px:n?parseInt(`${n[1]}${n[2]}`,10):0}}function Gt(e,t){const n=e.model.getColors();return Object.keys(Ot).reduce(((e,o)=>{const r=o;return e[r]=n[r]??t[r]??Ot[r],e}),{})}const Ut=/^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(\.)?([0-9]+)?([+-]\d\d(?::?\d\d)?|\s*Z)?$/;function jt(){throw new Error("This operation is not supported.")}function Yt(e){const t=function(e){const t=Ut.exec(e);if(t){const[,e,n,o,r,i,a,,l,s]=t;return{y:Number(e),M:Number(n)-1,d:Number(o),h:Number(r),m:Number(i),s:Number(a),ms:Number(l)||0,zoneInfo:s}}return null}(e);if(t&&!t.zoneInfo){const{y:e,M:n,d:o,h:r,m:i,s:a,ms:l}=t;return new Date(e,n,o,r,i,a,l)}return null}class Vt{constructor(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const[o]=t;o instanceof Date?this.d=new Date(o.getTime()):Ht()(o)&&1===t.length&&(this.d=Yt(o)),this.d||(this.d=new Date(...t))}setTimezoneOffset(){jt()}setTimezoneName(){jt()}clone(){return new Vt(this.d)}toDate(){return new Date(this.d.getTime())}toString(){return this.d.toString()}}["getTime","getTimezoneOffset","getFullYear","getMonth","getDate","getHours","getMinutes","getSeconds","getMilliseconds","getDay"].forEach((e=>{Vt.prototype[e]=function(){return this.d[e](...arguments)}})),["setTime","setFullYear","setMonth","setDate","setHours","setMinutes","setSeconds","setMilliseconds"].forEach((e=>{Vt.prototype[e]=function(){return this.d[e](...arguments)}}));class Xt extends Vt{clone(){return new Xt(this.d)}getTimezoneOffset(){return 0}}["FullYear","Month","Date","Hours","Minutes","Seconds","Milliseconds","Day"].forEach((e=>{const t=`get${e}`;Xt.prototype[t]=function(){return this.d[`getUTC${e}`](...arguments)}})),["FullYear","Month","Date","Hours","Minutes","Seconds","Milliseconds"].forEach((e=>{const t=`set${e}`;Xt.prototype[t]=function(){return this.d[`setUTC${e}`](...arguments)}}));const qt="@toast-ui/calendar: ";class Kt extends Error{constructor(e){super(`${qt}Invalid IANA Timezone Name - ${e}`),this.name="InvalidTimezoneNameError"}}class Zt extends Error{constructor(e){super(`${qt}Invalid DateTime Format - ${e}`),this.name="InvalidDateTimeFormatError"}}class Jt extends Error{constructor(e){super(`${qt}Invalid View Type - ${e}`),this.name="InvalidViewTypeError"}}const Qt={error:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];console.error(`${qt}${e}`,...n)},warn:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];console.warn(`${qt}${e}`,...n)}};var en=o(395),tn=o.n(en),nn=o(499),on=o.n(nn),rn=o(90),an=o.n(rn),ln=o(460),sn=o.n(ln);function cn(e){return tn()(e)||null===e}function un(e){return!cn(e)}function dn(e){return"function"==typeof e}let pn=Vt;function fn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new pn(...t)}function mn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new bn;if(!dn(Intl?.DateTimeFormat?.prototype?.formatToParts))return Qt.warn("Intl.DateTimeFormat is not fully supported. So It will return the local timezone offset only.\nYou can use a polyfill to fix this issue."),-t.toDate().getTimezoneOffset();yn(e);const n=function(e,t){const n=function(e){if(gn[e])return gn[e];const t=new Intl.DateTimeFormat("en-US",{timeZone:e,hourCycle:"h23",hour12:!1,year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"});return gn[e]=t,t}(t);return n.formatToParts(e.toDate()).reduce(((e,t)=>{const n=_n[t.type];return un(n)&&(e[n]=parseInt(t.value,10)),e}),[])}(t,e),o=function(e){const[t,n,o,r,i,a]=e,l=n-1;return new Date(Date.UTC(t,l,o,r%24,i,a))}(n);return Math.round((o.getTime()-t.getTime())/60/1e3)}function hn(e,t){t&&yn(t);const n=new bn(e.getFullYear(),0,1),o=new bn(e.getFullYear(),6,1);return t?Math.max(-mn(t,n),-mn(t,o))!==-mn(t,e):Math.max(n.getTimezoneOffset(),o.getTimezoneOffset())!==e.toDate().getTimezoneOffset()}const gn={},vn={};function yn(e){if(vn[e])return!0;try{return Intl.DateTimeFormat("en-US",{timeZone:e}),vn[e]=!0,!0}catch{throw new Kt(e)}}const _n={year:0,month:1,day:2,hour:3,minute:4,second:5};function wn(e){return(-(new Date).getTimezoneOffset()-e)*zn}class bn{tzOffset=null;constructor(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t[0]instanceof bn?this.d=fn(t[0].getTime()):this.d=fn(...t)}toString(){return this.d.toString()}addFullYear(e){return this.setFullYear(this.getFullYear()+e),this}addMonth(e){return this.setMonth(this.getMonth()+e),this}addDate(e){return this.setDate(this.getDate()+e),this}addHours(e){return this.setHours(this.getHours()+e),this}addMinutes(e){return this.setMinutes(this.getMinutes()+e),this}addSeconds(e){return this.setSeconds(this.getSeconds()+e),this}addMilliseconds(e){return this.setMilliseconds(this.getMilliseconds()+e),this}setWithRaw(e,t,n,o,r,i,a){return this.setFullYear(e,t,n),this.setHours(o,r,i,a),this}toDate(){return this.d.toDate()}valueOf(){return this.getTime()}getTimezoneOffset(){return this.tzOffset??this.d.getTimezoneOffset()}getTime(){return this.d.getTime()}getFullYear(){return this.d.getFullYear()}getMonth(){return this.d.getMonth()}getDate(){return this.d.getDate()}getHours(){return this.d.getHours()}getMinutes(){return this.d.getMinutes()}getSeconds(){return this.d.getSeconds()}getMilliseconds(){return this.d.getMilliseconds()}getDay(){return this.d.getDay()}setTime(e){return this.d.setTime(e)}setFullYear(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getMonth(),n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.getDate();return this.d.setFullYear(e,t,n)}setMonth(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getDate();return this.d.setMonth(e,t)}setDate(e){return this.d.setDate(e)}setHours(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getMinutes(),n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.getSeconds(),o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.getMilliseconds();return this.d.setHours(e,t,n,o)}setMinutes(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getSeconds(),n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.getMilliseconds();return this.d.setMinutes(e,t,n)}setSeconds(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getMilliseconds();return this.d.setSeconds(e,t)}setMilliseconds(e){return this.d.setMilliseconds(e)}tz(e){if("Local"===e)return new bn(this.getTime());const t=Ht()(e)?mn(e,this):e,n=new bn(this.getTime()-wn(t));return n.tzOffset=t,n}local(e){if(un(e)){const t=Ht()(e)?mn(e,this):e;return new bn(this.getTime()+wn(t))}return new bn(this.getTime()+(un(this.tzOffset)?wn(this.tzOffset):0))}}function Dn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return sn()(t)?(Object.keys(t).forEach((n=>{const o=n,r=n;Array.isArray(t[r])||!sn()(e[o])||!sn()(t[r])||t[r]instanceof bn?e[o]=t[r]:e[o]=Dn(e[o],t[r])})),e):e}const kn=["top","left","width","height","exceedLeft","exceedRight","croppedStart","croppedEnd","goingDurationHeight","modelDurationHeight","comingDurationHeight","duplicateEvents","duplicateEventIndex","duplicateStarts","duplicateEnds","duplicateLeft","duplicateWidth","collapse","isMain"];class Cn{top=0;left=0;width=0;height=0;exceedLeft=!1;exceedRight=!1;croppedStart=!1;croppedEnd=!1;goingDurationHeight=0;modelDurationHeight=100;comingDurationHeight=0;duplicateEvents=[];duplicateEventIndex=-1;duplicateLeft="";duplicateWidth="";collapse=!1;isMain=!1;constructor(e){this.model=e}getUIProps(){return function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];return n.reduce(((t,n)=>(e.hasOwnProperty(n)&&(t[n]=e[n]),t)),{})}(this,...kn)}setUIProps(e){Object.assign(this,e)}getStarts(){return this.renderStarts?this.renderStarts:this.model.getStarts()}getEnds(){return this.renderEnds?this.renderEnds:this.model.getEnds()}cid(){return this.model.cid()}valueOf(){return this.model}duration(){return this.model.duration()}collidesWith(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=[];[this,e].forEach((e=>{e instanceof Cn&&e.duplicateEvents.length>0?n.push({start:e.duplicateStarts,end:e.duplicateEnds,goingDuration:0,comingDuration:0}):n.push({start:e.getStarts(),end:e.getEnds(),goingDuration:e.valueOf().goingDuration,comingDuration:e.valueOf().comingDuration})}));const[o,r]=n;return uo({start:o.start.getTime(),end:o.end.getTime(),targetStart:r.start.getTime(),targetEnd:r.end.getTime(),goingDuration:o.goingDuration,comingDuration:o.comingDuration,targetGoingDuration:r.goingDuration,targetComingDuration:r.comingDuration,usingTravelTime:t})}clone(){const e=this.getUIProps(),t=new Cn(this.model);return t.setUIProps(e),this.renderStarts&&(t.renderStarts=new bn(this.renderStarts)),this.renderEnds&&(t.renderEnds=new bn(this.renderEnds)),t}}function Sn(e,t){const n=String(e),o=String(t);return n===o?0:n>o?1:-1}var xn={bsearch:function(e,t,n,o){let r,i,a,l=0,s=e.length-1;for(o=o||Sn;l<=s;)if(r=(l+s)/2|0,i=n?n(e[r]):e[r],a=o(i,t),a<0)l=r+1;else{if(!(a>0))return r;s=r-1}return~s},compare:{event:{asc:function(e,t){const n=e instanceof Cn?e.model:e,o=t instanceof Cn?t.model:t,r=function(e,t){return e!==t?e?-1:1:0}(n.isAllday||n.hasMultiDates,o.isAllday||o.hasMultiDates);if(r)return r;const i=Xn(e.getStarts(),t.getStarts());if(i)return i;const a=e.duration(),l=t.duration();return a<l?1:a>l?-1:n.cid()-o.cid()}},num:{asc:function(e,t){return Number(e)-Number(t)}}}};function En(e){return e[0]}function In(e){return e[e.length-1]}function Nn(e,t){for(let n=e.length-1;n>=0;n-=1)if(t(e[n]))return n;return-1}function Mn(e,t){return e>0?Array.from({length:e},(()=>Array.isArray(t)?t.slice():t)):[]}let Tn=function(e){return e[e.SUN=0]="SUN",e[e.MON=1]="MON",e[e.TUE=2]="TUE",e[e.WED=3]="WED",e[e.THU=4]="THU",e[e.FRI=5]="FRI",e[e.SAT=6]="SAT",e}({});const An=7,On=/^(\d{4}[-|/]*\d{2}[-|/]*\d{2})\s?(\d{2}:\d{2}:\d{2})?$/,Pn={millisecondsTo:{},millisecondsFrom:{}},Rn=[24,60,60,1e3];function Ln(e,t){let n="",o=0;if(String(e).length>t)return String(e);for(;o<t-1;o+=1)n+="0";return(n+e).slice(-1*t)}function Hn(e){let t=e.getHours();return 0===t&&(t=12),t>12&&(t%=12),t}const Fn={YYYYMMDD(e){return[e.getFullYear(),Ln(e.getMonth()+1,2),Ln(e.getDate(),2)].join("")},YYYY(e){return String(e.getFullYear())},MM(e){return Ln(e.getMonth()+1,2)},DD(e){return Ln(e.getDate(),2)},"HH:mm":function(e){const t=e.getHours(),n=e.getMinutes();return`${Ln(t,2)}:${Ln(n,2)}`},"hh:mm":function(e){const t=Hn(e),n=e.getMinutes();return`${Ln(t,2)}:${Ln(n,2)}`},hh(e){const t=Hn(e);return String(t)},tt(e){return e.getHours()<12?"am":"pm"}},Wn=864e5,zn=6e4,Bn=20*zn,$n=18e5;function Gn(e,t){let n=t;return Object.entries(Fn).forEach((t=>{let[o,r]=t;n=n.replace(o,r(e))})),n}function Un(e,t){const n=Pn.millisecondsFrom,o=e+t;if(n[o])return n[o];const r=function(e,t,n){const o={date:0,hour:1,minute:2,second:3};return!(e in o)||isNaN(t)?0:[t].concat(Rn.slice(o[e])).reduce(n)}(e,t,((e,t)=>e*t));return r?(n[o]=r,n[o]):0}function jn(e){const t=e?new bn(e):new bn;return t.setHours(0,0,0,0),t}function Yn(e,t,n){const o=e.getTime(),r=t.getTime(),i=new bn(e),a=[];let l=o;for(;l<=r&&r>=i.getTime();)a.push(new bn(i)),l+=n,i.addMilliseconds(n);return a}function Vn(e){return new bn(e)}function Xn(e,t){const n=e.getTime(),o=t.getTime();return n<o?-1:n>o?1:0}function qn(e,t){return function(e,t){return function(e,t){return e.getFullYear()===t.getFullYear()}(e,t)&&e.getMonth()===t.getMonth()}(e,t)&&e.getDate()===t.getDate()}function Kn(e,t){return 1===Xn(e,t)?e:t}function Zn(e,t){return-1===Xn(e,t)?e:t}function Jn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;const n=e.match(On);let o,r,i;if(!n)throw new Zt(e);if(e.length>8){o=~e.indexOf("/")?"/":"-";const t=n.splice(1);r=t[0].split(o),i=t[1]?t[1].split(":"):[0,0,0]}else{const[e]=n;r=[e.substr(0,4),e.substr(4,2),e.substr(6,2)],i=[0,0,0]}return(new bn).setWithRaw(Number(r[0]),Number(r[1])+t,Number(r[2]),Number(i[0]),Number(i[1]),Number(i[2]),0)}function Qn(e){const t=e?new bn(e):new bn;return t.setHours(23,59,59,999),t}function eo(e){return e===Tn.SUN||e===Tn.SAT}function to(e){return e===Tn.SUN}function no(e){return e===Tn.SAT}function oo(e){const t=new bn(e);return t.setDate(1),t.setHours(0,0,0,0),t}function ro(e,t,n,o){const r=100/e,i=e>5?100/(e-1):r;let a=0;const l=_t()(n,An).concat(_t()(e)).slice(0,An);t=!o&&t;const s=l.map((n=>{let o=t?i:r;e>5&&t&&eo(n)&&(o=i/2);const l={width:o,left:a};return a+=o,l})),{length:c}=s,u=Mn(c,Mn(c,0));return s.forEach(((e,t)=>{let{width:n}=e;for(let e=0;e<=t;e+=1)for(let o=t;o<c;o+=1)u[e][o]+=n})),u[0][c-1]=100,{rowStyleInfo:s,cellWidthMap:u.map((e=>e.map(zt)))}}function io(e,t){const n=Vn(e);return n.setMilliseconds(e.getMilliseconds()+t),n}function ao(e,t){const n=Vn(e);return n.setMinutes(e.getMinutes()+t),n}function lo(e,t){const n=Vn(e);return n.setHours(...t.split(":").map(Number)),n}function so(e,t){const n=Vn(e);return n.setDate(e.getDate()+t),n}function co(e,t){const n=new bn(e.getFullYear(),e.getMonth(),e.getDate()).getTime(),o=new bn(t.getFullYear(),t.getMonth(),t.getDate()).getTime();return Math.round((n-o)/Wn)}function uo(e){let{start:t,end:n,targetStart:o,targetEnd:r,goingDuration:i,comingDuration:a,targetGoingDuration:l,targetComingDuration:s,usingTravelTime:c}=e;return Math.abs(n-t)<Bn&&(n+=Bn),Math.abs(n-t)<Bn&&(n+=Bn),c&&(t-=Un("minute",i),n+=Un("minute",a),o-=Un("minute",l),r+=Un("minute",s)),function(e,t,n,o){return n>e&&n<t||o>e&&o<t||n<=e&&o>=t}(t,n,o,r)}const po=function(){const e=function(){let e=0;return{next(){return e+=1,e}}}();return()=>e.next()}();function fo(e){return e.__fe_id||(e.__fe_id=po()),e.__fe_id}class mo{id="";calendarId="";title="";body="";isAllday=!1;start=new bn;end=new bn;goingDuration=0;comingDuration=0;location="";attendees=[];category="time";dueDateClass="";recurrenceRule="";state="Busy";isVisible=!0;isPending=!1;isFocused=!1;isReadOnly=!1;isPrivate=!1;customStyle={};raw=null;hasMultiDates=!1;constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};fo(this),this.init(e)}static schema={required:["title"],dateRange:["start","end"]};init(){let{id:e="",calendarId:t="",title:n="",body:o="",isAllday:r=!1,start:i=new bn,end:a=new bn,goingDuration:l=0,comingDuration:s=0,location:c="",attendees:u=[],category:d="time",dueDateClass:p="",recurrenceRule:f="",state:m="Busy",isVisible:h=!0,isPending:g=!1,isFocused:v=!1,isReadOnly:y=!1,isPrivate:_=!1,color:w,backgroundColor:b,dragBackgroundColor:D,borderColor:k,customStyle:C={},raw:S=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.id=e,this.calendarId=t,this.title=n,this.body=o,this.isAllday="allday"===d||r,this.goingDuration=l,this.comingDuration=s,this.location=c,this.attendees=u,this.category=d,this.dueDateClass=p,this.recurrenceRule=f,this.state=m,this.isVisible=h,this.isPending=g,this.isFocused=v,this.isReadOnly=y,this.isPrivate=_,this.color=w,this.backgroundColor=b,this.dragBackgroundColor=D,this.borderColor=k,this.customStyle=C,this.raw=S,this.isAllday?this.setAlldayPeriod(i,a):this.setTimePeriod(i,a),"milestone"!==d&&"task"!==d||(this.start=new bn(this.end))}setAlldayPeriod(e,t){let n,o;n=Ht()(e)?Jn(e.substring(0,10)):new bn(e||Date.now()),o=Ht()(t)?Jn(t.substring(0,10)):new bn(t||this.start),this.start=n,this.start.setHours(0,0,0),this.end=o||new bn(this.start),this.end.setHours(23,59,59)}setTimePeriod(e,t){this.start=new bn(e||Date.now()),this.end=new bn(t||this.start),t||this.end.setMinutes(this.end.getMinutes()+30),this.hasMultiDates=this.end.getTime()-this.start.getTime()>Wn}getStarts(){return this.start}getEnds(){return this.end}cid(){return fo(this)}equals(e){return this.id===e.id&&(this.title===e.title&&(this.body===e.body&&(this.isAllday===e.isAllday&&(0===Xn(this.getStarts(),e.getStarts())&&(0===Xn(this.getEnds(),e.getEnds())&&(this.color===e.color&&(this.backgroundColor===e.backgroundColor&&(this.dragBackgroundColor===e.dragBackgroundColor&&this.borderColor===e.borderColor))))))))}duration(){const e=Number(this.getStarts()),t=Number(this.getEnds());let n;return n=this.isAllday?Number(Qn(t))-Number(jn(e)):t-e,n}valueOf(){return this}collidesWith(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e=e instanceof Cn?e.model:e,uo({start:Number(this.getStarts()),end:Number(this.getEnds()),targetStart:Number(e.getStarts()),targetEnd:Number(e.getEnds()),goingDuration:this.goingDuration,comingDuration:this.comingDuration,targetGoingDuration:e.goingDuration,targetComingDuration:e.comingDuration,usingTravelTime:t})}toEventObject(){return{id:this.id,calendarId:this.calendarId,__cid:this.cid(),title:this.title,body:this.body,isAllday:this.isAllday,start:this.start,end:this.end,goingDuration:this.goingDuration,comingDuration:this.comingDuration,location:this.location,attendees:this.attendees,category:this.category,dueDateClass:this.dueDateClass,recurrenceRule:this.recurrenceRule,state:this.state,isVisible:this.isVisible,isPending:this.isPending,isFocused:this.isFocused,isReadOnly:this.isReadOnly,isPrivate:this.isPrivate,color:this.color,backgroundColor:this.backgroundColor,dragBackgroundColor:this.dragBackgroundColor,borderColor:this.borderColor,customStyle:this.customStyle,raw:this.raw}}getColors(){return{color:this.color,backgroundColor:this.backgroundColor,dragBackgroundColor:this.dragBackgroundColor,borderColor:this.borderColor}}}function ho(e){let{model:t}=e;const{category:n,isAllday:o,hasMultiDates:r}=t;return"time"===n&&!o&&!r}class go{internalMap=new Map;constructor(e){dn(e)&&(this.getItemID=e)}static and(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const{length:o}=t;return e=>{for(let n=0;n<o;n+=1)if(!t[n].call(null,e))return!1;return!0}}static or(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const{length:o}=t;return o?e=>{let n=t[0].call(null,e);for(let r=1;r<o;r+=1)n=n||t[r].call(null,e);return n}:()=>!1}getItemID(e){return e?._id??""}getFirstItem(){return this.internalMap.values().next().value}add(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.forEach((e=>{const t=this.getItemID(e);this.internalMap.set(t,e)})),this}remove(){const e=[];for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return n.forEach((t=>{const n=Ht()(t)||an()(t)?t:this.getItemID(t);this.internalMap.has(n)&&(e.push(this.internalMap.get(n)),this.internalMap.delete(n))})),1===e.length?e[0]:e}has(e){const t=Ht()(e)||an()(e)?e:this.getItemID(e);return this.internalMap.has(t)}get(e){const t=Ht()(e)||an()(e)?e:this.getItemID(e);return this.internalMap.get(t)??null}doWhenHas(e,t){const n=this.internalMap.get(e);cn(n)||t(n)}filter(e){const t=new go;return this.hasOwnProperty("getItemID")&&(t.getItemID=this.getItemID),this.internalMap.forEach((n=>{!0===e(n)&&t.add(n)})),t}groupBy(e){const t={};return this.internalMap.forEach((n=>{let o=dn(e)?e(n):n[e];dn(o)&&(o=o.call(n)),t[o]??=new go(this.getItemID),t[o].add(n)})),t}find(e){let t=null;const n=this.internalMap.values();let o=n.next();for(;!1===o.done;){if(e(o.value)){t=o.value;break}o=n.next()}return t}sort(e){return this.toArray().sort(e)}each(e){const t=this.internalMap.entries();let n=t.next();for(;!1===n.done;){const[o,r]=n.value;if(!1===e(r,o))break;n=t.next()}}clear(){this.internalMap.clear()}toArray(){return Array.from(this.internalMap.values())}get size(){return this.internalMap.size}}function vo(){const e=new go((e=>e.cid()));return arguments.length&&e.add(...arguments),e}function yo(e,t){return Yn(jn(e),Qn(t),Wn)}function _o(e){const{model:t}=e;return(n=t).isAllday||"time"===n.category&&Number(n.end)-Number(n.start)>Wn?"allday":t.category;var n}function wo(e,t){yo(t.getStarts(),t.getEnds()).forEach((n=>{const o=Gn(n,"YYYYMMDD");(e[o]=e[o]||[]).push(t.cid())}))}function bo(e,t){const n=t.cid();Object.values(e).forEach((e=>{const t=e.indexOf(n);~t&&e.splice(t,1)}))}function Do(e,t){return function(e,t){return e.events.add(t),wo(e.idsOfDay,t),t}(e,new mo(t))}function ko(){return{calendar:{calendars:arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],events:vo(),idsOfDay:{}}}}function Co(e){return{createEvents:t=>e(vt((e=>{!function(e){(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).map((t=>Do(e,t)))}(e.calendar,t)}))),updateEvent:t=>{let{event:n,eventData:o}=t;return e(vt((e=>{!function(e,t,n,o){const{idsOfDay:r}=e,i=e.events.find((e=>function(e,t,n){return e.id===t&&e.calendarId===n}(e,t,n)));!!i&&(i.init({...i,...o}),bo(r,i),wo(r,i))}(e.calendar,n.id,n.calendarId,o)})))},deleteEvent:t=>e(vt((e=>{!function(e,t){bo(e.idsOfDay,t),e.events.remove(t)}(e.calendar,t)}))),clearEvents:()=>e(vt((e=>{var t;(t=e.calendar).idsOfDay={},t.events.clear()}))),setCalendars:t=>e(vt((e=>{e.calendar.calendars=t}))),setCalendarColor:(t,n)=>e(vt((e=>{const o=e.calendar.calendars.map((e=>e.id===t?{...e,...n}:e)),r=vo(...e.calendar.events.toArray().map((e=>(e.calendarId===t&&(e.color=n.color??e.color,e.backgroundColor=n.backgroundColor??e.backgroundColor,e.borderColor=n.borderColor??e.borderColor,e.dragBackgroundColor=n.dragBackgroundColor??e.dragBackgroundColor),e))));e.calendar.calendars=o,e.calendar.events=r}))),setCalendarVisibility:(t,n)=>e(vt((e=>{const o=e.calendar.events.toArray();e.calendar.events=vo(...o.map((e=>(t.includes(e.calendarId)&&(e.isVisible=n),e))))})))}}let So=function(e){return e[e.IDLE=0]="IDLE",e[e.INIT=1]="INIT",e[e.DRAGGING=2]="DRAGGING",e[e.CANCELED=3]="CANCELED",e}({});function xo(){return{dnd:{draggingItemType:null,draggingState:So.IDLE,initX:null,initY:null,x:null,y:null,draggingEventUIModel:null}}}function Eo(e){return{initDrag:t=>{e(vt((e=>{e.dnd={...e.dnd,...t,draggingState:So.INIT}})))},setDragging:t=>{e(vt((e=>{e.dnd={...e.dnd,...t,draggingState:So.DRAGGING}})))},cancelDrag:()=>{e(vt((e=>{e.dnd=xo().dnd,e.dnd.draggingState=So.CANCELED})))},reset:()=>{e(vt((e=>{e.dnd=xo().dnd})))},setDraggingEventUIModel:t=>{e(vt((e=>{e.dnd.draggingEventUIModel=t?.clone()??null})))}}}function Io(e){return{setGridSelection:(t,n)=>{e(vt((e=>{e.gridSelection[t]=n})))},addGridSelection:(t,n)=>{e(vt((e=>{"dayGridMonth"===t&&n&&(e.gridSelection.accumulated[t]=[...e.gridSelection.accumulated[t],n],e.gridSelection.dayGridMonth=null)})))},clearAll:()=>e(vt((e=>{e.gridSelection={dayGridMonth:null,dayGridWeek:null,timeGrid:null,accumulated:{dayGridMonth:[]}}})))}}const No=3,Mo=-1;function To(e,t,n){return Object.keys(e).reduce(((n,o)=>o===t?n:n-e[o].height-No),n)}function Ao(e){return{setLastPanelType:t=>{e(vt((e=>{e.weekViewLayout.lastPanelType=t,t&&(e.weekViewLayout.dayGridRows[t].height=To(e.weekViewLayout.dayGridRows,t,e.layout))})))},updateLayoutHeight:t=>e(vt((e=>{const{lastPanelType:n}=e.weekViewLayout;e.layout=t,n&&(e.weekViewLayout.dayGridRows[n].height=To(e.weekViewLayout.dayGridRows,n,t))}))),updateDayGridRowHeight:t=>{let{rowName:n,height:o}=t;return e(vt((e=>{const{lastPanelType:t}=e.weekViewLayout;e.weekViewLayout.dayGridRows[n]={height:o},t&&(e.weekViewLayout.dayGridRows[t].height=To(e.weekViewLayout.dayGridRows,t,e.layout))})))},updateDayGridRowHeightByDiff:t=>{let{rowName:n,diff:o}=t;return e(vt((e=>{const{lastPanelType:t}=e.weekViewLayout,r=e.weekViewLayout.dayGridRows?.[n]?.height??At;e.weekViewLayout.dayGridRows[n]={height:r+o},t&&(e.weekViewLayout.dayGridRows[t].height=To(e.weekViewLayout.dayGridRows,t,e.layout))})))},setSelectedDuplicateEventCid:t=>e(vt((e=>{e.weekViewLayout.selectedDuplicateEventCid=t??Mo})))}}function Oo(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Po=["sun","mon","tue","wed","thu","fri","sat"],Ro=e=>Po[e];function Lo(e,t){return e.map((e=>{const n=e.getDay(),o=t.length>0?t[n]:Oo(Ro(n));return{date:e.getDate(),day:e.getDay(),dayName:o,isToday:!0,renderDate:"date",dateInstance:e}}))}function Ho(e){if(!e)return!1;const t={getDuplicateEvents:(e,t)=>t.filter((t=>t.title===e.title&&0===Xn(t.start,e.start)&&0===Xn(t.end,e.end))).sort(((e,t)=>e.calendarId>t.calendarId?1:-1)),getMainEvent:e=>In(e)};return on()(e)?t:{...t,...e}}function Fo(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t={startDayOfWeek:Tn.SUN,dayNames:[],narrowWeekend:!1,workweek:!1,showNowIndicator:!0,showTimezoneCollapseButton:!1,timezonesCollapsed:!1,hourStart:0,hourEnd:24,eventView:!0,taskView:!0,collapseDuplicateEvents:!1,...e};return t.collapseDuplicateEvents=Ho(t.collapseDuplicateEvents),t}function Wo(){return{zones:[],...arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}}}function zo(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t={dayNames:[],visibleWeeksCount:0,workweek:!1,narrowWeekend:!1,startDayOfWeek:Tn.SUN,isAlways6Weeks:!0,visibleEventCount:6,...e};return 0===t.dayNames.length&&(t.dayNames=Po.slice()),t}function Bo(e){return on()(e)?{enableDblClick:e,enableClick:e}:{enableDblClick:!0,enableClick:!0,...e}}const $o=e=>!!e.isVisible;function Go(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{options:{defaultView:e.defaultView??"week",useFormPopup:e.useFormPopup??!1,useDetailPopup:e.useDetailPopup??!1,isReadOnly:e.isReadOnly??!1,week:Fo(e.week),month:zo(e.month),gridSelection:Bo(e.gridSelection),usageStatistics:e.usageStatistics??!0,eventFilter:e.eventFilter??$o,timezone:Wo(e.timezone)}}}function Uo(e){return{setOptions:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e(vt((e=>{t.gridSelection&&(t.gridSelection=Bo(t.gridSelection)),t.week?.collapseDuplicateEvents&&(t.week.collapseDuplicateEvents=Ho(t.week.collapseDuplicateEvents)),Dn(e.options,t)})))}}}let jo=function(e){return e.SeeMore="seeMore",e.Form="form",e.Detail="detail",e}({});function Yo(e){return{showSeeMorePopup:t=>e(vt((e=>{e.popup[jo.SeeMore]=t,e.popup[jo.Form]=null,e.popup[jo.Detail]=null}))),showFormPopup:t=>e(vt((e=>{e.popup[jo.Form]=t,e.popup[jo.SeeMore]=null,e.popup[jo.Detail]=null}))),showDetailPopup:(t,n)=>e(vt((e=>{e.popup[jo.Detail]=t,e.popup[jo.Form]=null,n||(e.popup[jo.SeeMore]=null)}))),hideSeeMorePopup:()=>e(vt((e=>{e.popup[jo.SeeMore]=null}))),hideFormPopup:()=>e(vt((e=>{e.popup[jo.Form]=null}))),hideDetailPopup:()=>e(vt((e=>{e.popup[jo.Detail]=null}))),hideAllPopup:()=>e(vt((e=>{e.popup[jo.SeeMore]=null,e.popup[jo.Form]=null,e.popup[jo.Detail]=null})))}}const Vo=()=>{},Xo=/^auto$|^$|%/;function qo(e,t){let n=e.style[t];if((!n||"auto"===n)&&document.defaultView){const o=document.defaultView.getComputedStyle(e,null);n=o?o[t]:null}return"auto"===n?null:n}function Ko(e){return Ht()(e)?Xo.test(e):null===e}function Zo(e){const t=qo(e,"width"),n=qo(e,"height");if((Ko(t)||Ko(n))&&e.getBoundingClientRect){const{width:t,height:n}=e.getBoundingClientRect();return{width:t||e.offsetWidth,height:n||e.offsetHeight}}return{width:parseFloat(t??"0"),height:parseFloat(n??"0")}}const Jo=("undefined"==typeof Element?Vo:Element).prototype;Jo.matches||Jo.webkitMatchesSelector||Jo.msMatchesSelector;function Qo(e){return e.replace(/<([^>]+)>/gi,"")}const er=60,tr={milestone(e){return _(b,null,_("span",{className:Wt("icon","ic-milestone")}),_("span",{style:{backgroundColor:e.backgroundColor}},Qo(e.title)))},milestoneTitle(){return _("span",{className:Wt("left-content")},"Milestone")},task(e){return`#${e.title}`},taskTitle(){return _("span",{className:Wt("left-content")},"Task")},alldayTitle(){return _("span",{className:Wt("left-content")},"All Day")},allday(e){return Qo(e.title)},time(e){const{start:t,title:n}=e;return t?_("span",null,_("strong",null,Gn(t,"HH:mm"))," ",_("span",null,Qo(n))):Qo(n)},goingDuration(e){const{goingDuration:t}=e,n=Math.floor(t/er),o=t%er;return`GoingTime ${Ln(n,2)}:${Ln(o,2)}`},comingDuration(e){const{comingDuration:t}=e,n=Math.floor(t/er),o=t%er;return`ComingTime ${Ln(n,2)}:${Ln(o,2)}`},monthMoreTitleDate(e){const{date:t,day:n}=e,o=Wt("more-title-date"),r=Wt("more-title-day"),i=Oo(Ro(n));return _(b,null,_("span",{className:o},t),_("span",{className:r},i))},monthMoreClose(){return""},monthGridHeader(e){const t=parseInt(e.date.split("-")[2],10);return _("span",{className:Wt("weekday-grid-date",{"weekday-grid-date-decorator":e.isToday})},t)},monthGridHeaderExceed(e){return _("span",{className:Wt("weekday-grid-more-events")},e," more")},monthGridFooter(e){return""},monthGridFooterExceed(e){return""},monthDayName(e){return e.label},weekDayName(e){const t=Wt("day-name__date"),n=Wt("day-name__name");return _(b,null,_("span",{className:t},e.date)," ",_("span",{className:n},e.dayName))},weekGridFooterExceed(e){return`+${e}`},collapseBtnTitle(){return _("span",{className:Wt("collapse-btn-icon")})},timezoneDisplayLabel(e){let{displayLabel:t,timezoneOffset:n}=e;if(cn(t)&&un(n)){const e=n<0?"-":"+",t=Math.abs(n/er),o=Math.abs(n%er);return`GMT${e}${Ln(t,2)}:${Ln(o,2)}`}return t},timegridDisplayPrimaryTime(e){const{time:t}=e;return Gn(t,"hh tt")},timegridDisplayTime(e){const{time:t}=e;return Gn(t,"HH:mm")},timegridNowIndicatorLabel(e){const{time:t,format:n="HH:mm"}=e;return Gn(t,n)},popupIsAllday(){return"All day"},popupStateFree(){return"Free"},popupStateBusy(){return"Busy"},titlePlaceholder(){return"Subject"},locationPlaceholder(){return"Location"},startDatePlaceholder(){return"Start date"},endDatePlaceholder(){return"End date"},popupSave(){return"Save"},popupUpdate(){return"Update"},popupEdit(){return"Edit"},popupDelete(){return"Delete"},popupDetailTitle(e){let{title:t}=e;return t},popupDetailDate(e){let{isAllday:t,start:n,end:o}=e;const r="YYYY.MM.DD",i="hh:mm tt",a=`${r} ${i}`,l=Gn(n,t?r:i),s=qn(n,o)?i:a;return t?`${l}${qn(n,o)?"":` - ${Gn(o,r)}`}`:`${Gn(n,a)} - ${Gn(o,s)}`},popupDetailLocation(e){let{location:t}=e;return t},popupDetailAttendees(e){let{attendees:t=[]}=e;return t.join(", ")},popupDetailState(e){let{state:t}=e;return t||"Busy"},popupDetailRecurrenceRule(e){let{recurrenceRule:t}=e;return t},popupDetailBody(e){let{body:t}=e;return t}};function nr(){return{template:{...tr,...arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}}}}function or(e){return{setTemplate:t=>e(vt((e=>{e.template={...e.template,...t}})))}}function rr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"week";const t=new bn;return t.setHours(0,0,0,0),{view:{currentView:e,renderDate:t}}}function ir(e){return{changeView:t=>e(vt((e=>{e.view.currentView=t}))),setRenderDate:t=>e(vt((e=>{e.view.renderDate=jn(t)})))}}const ar=tn()(window)||!window.navigator?le:se;function lr(){const e=G(null);return{StoreProvider:function(t){let{children:n,store:o}=t;return _(e.Provider,{value:o,children:n})},useStore:function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object.is;const o=pe(e);if(cn(o))throw new Error("StoreProvider is not found");const[,r]=ae((e=>e+1),0),i=o.getState(),a=ce(i),l=ce(t),s=ce(n),c=ce(!1),u=ce();let d;tn()(u.current)&&(u.current=t(i));let p=!1;(a.current!==i||l.current!==t||s.current!==n||c.current)&&(d=t(i),p=!n(u.current,d)),ar((()=>{p&&(u.current=d),a.current=i,l.current=t,s.current=n,c.current=!1}));const f=ce(i);return ar((()=>{const e=()=>{try{const e=o.getState(),t=l.current(e);!s.current(u.current,t)&&(a.current=e,u.current=d,r())}catch(e){console.error("[toastui-calendar] failed to update state",e?.message),c.current=!0,r()}},t=o.subscribe(e);return o.getState()!==f.current&&e(),t}),[]),p?d:u.current},useInternalStore:()=>{const t=pe(e);if(cn(t))throw new Error("StoreProvider is not found");return ue((()=>t),[t])}}}function sr(e){let t;const n=new Set,o=e=>{const o=e(t);if(o!==t){const e=t;t={...t,...o},n.forEach((n=>n(t,e)))}},r=()=>t,i={setState:o,getState:r,subscribe:(e,o,r)=>{let i=e;if(o){let n=o(t);const a=r??Object.is;i=()=>{const r=o(t);if(!a(n,r)){const t=n;n=r,e(n,t)}}}return n.add(i),()=>n.delete(i)},clearListeners:()=>n.clear()};return t=e(o,r,i),i}const cr=function(){return sr((e=>t=>({...Go(e),...nr(e.template),popup:{[jo.SeeMore]:null,[jo.Form]:null,[jo.Detail]:null},layout:500,weekViewLayout:{lastPanelType:null,dayGridRows:{},selectedDuplicateEventCid:Mo},...ko(e.calendars),...rr(e.defaultView),...xo(),gridSelection:{dayGridMonth:null,dayGridWeek:null,timeGrid:null,accumulated:{dayGridMonth:[]}},dispatch:{options:Uo(t),popup:Yo(t),weekViewLayout:Ao(t),calendar:Co(t),view:ir(t),dnd:Eo(t),gridSelection:Io(t),template:or(t)}}))(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}))},{StoreProvider:ur,useStore:dr,useInternalStore:pr}=lr();function fr(e){return dr(de((t=>e?t.dispatch[e]:t.dispatch),[e]))}function mr(e){return t=>t[e]}mr("popup");const hr=mr("calendar"),gr=mr("weekViewLayout"),vr=mr("template"),yr=mr("view"),_r=mr("options"),wr=mr("dnd");var br=o(897),Dr=o.n(br);const kr="data-target-temp";function Cr(e){let{template:t,param:n,as:o="div"}=e;const r=dr(vr)[t];if(cn(r))return null;const i=r(n);return Ht()(i)?_(o,{className:Wt(`template-${t}`),dangerouslySetInnerHTML:{__html:(a=i,Dr().sanitize(a))}}):$(i,{className:`${i.props.className??""} ${Wt(`template-${t}`)}`});var a}const Sr=G(null),xr=Sr.Provider,Er=()=>{const e=pe(Sr);if(!e)throw new Error("useEventBus must be used within a EventBusProvider");return e},Ir=e=>e.options?.timezone?.zones?.[0]?.timezoneName??"Local",Nr=e=>e.options?.timezone?.customOffsetCalculator,Mr=e=>e.options.timezone.zones??[];function Tr(){const e=dr(Nr),t=un(e);return de((function(n){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new bn;return o.tz(t?e(n,o.getTime()):n)}),[e,t])}function Ar(){const e=dr(Ir),t=Tr(),n=de((()=>t(e)),[e,t]);return[e,n]}function Or(e){let{dayName:t,style:n,type:o,theme:r}=e;const i=Er(),[,a]=Ar(),l=a(),{day:s}=t,c="week"===o?function(e){let{dayName:t,theme:n,today:o}=e;const{day:r,dateInstance:i}=t,a=qn(o,i),l=!a&&i<o;return to(r)?n.common.holiday.color:l?n.week?.pastDay.color:no(r)?n.common.saturday.color:a?n.week?.today.color:n.common.dayName.color}({dayName:t,theme:r,today:l}):function(e){let{dayName:t,theme:n}=e;const{day:o}=t;return to(o)?n.common.holiday.color:no(o)?n.common.saturday.color:n.common.dayName.color}({dayName:t,theme:r}),u=`${o}DayName`;return _("div",{className:Wt("day-name-item",o),style:n},_("span",{className:Wt({[`holiday-${Ro(s)}`]:eo(s)}),style:{color:c},onClick:()=>{(function(e,t){return"week"===e})(o)&&i.fire("clickDayName",{date:Gn(t.dateInstance,"YYYY-MM-DD")})},"data-testid":`dayName-${o}-${Ro(s)}`},_(Cr,{template:u,param:t})))}const Pr=mr("common"),Rr=(mr("week"),mr("month")),Lr=e=>e.week.dayGridLeft,Hr=e=>e.week.timeGridLeft,Fr=e=>e.month.moreView,Wr=e=>e.month.gridCell,zr={border:"1px solid #e5e5e5",backgroundColor:"white",holiday:{color:"#ff4040"},saturday:{color:"#333"},dayName:{color:"#333"},today:{color:"#fff"},gridSelection:{backgroundColor:"rgba(81, 92, 230, 0.05)",border:"1px solid #515ce6"}},Br={dayName:{borderLeft:"none",borderTop:"1px solid #e5e5e5",borderBottom:"1px solid #e5e5e5",backgroundColor:"inherit"},weekend:{backgroundColor:"inherit"},today:{color:"inherit",backgroundColor:"rgba(81, 92, 230, 0.05)"},pastDay:{color:"#bbb"},panelResizer:{border:"1px solid #e5e5e5"},dayGrid:{borderRight:"1px solid #e5e5e5",backgroundColor:"inherit"},dayGridLeft:{borderRight:"1px solid #e5e5e5",backgroundColor:"inherit",width:"72px"},timeGrid:{borderRight:"1px solid #e5e5e5"},timeGridLeft:{backgroundColor:"inherit",borderRight:"1px solid #e5e5e5",width:"72px"},timeGridLeftAdditionalTimezone:{backgroundColor:"white"},timeGridHalfHourLine:{borderBottom:"none"},timeGridHourLine:{borderBottom:"1px solid #e5e5e5"},nowIndicatorLabel:{color:"#515ce6"},nowIndicatorPast:{border:"1px dashed #515ce6"},nowIndicatorBullet:{backgroundColor:"#515ce6"},nowIndicatorToday:{border:"1px solid #515ce6"},nowIndicatorFuture:{border:"none"},pastTime:{color:"#bbb"},futureTime:{color:"#333"},gridSelection:{color:"#515ce6"}},$r={dayName:{borderLeft:"none",backgroundColor:"inherit"},holidayExceptThisMonth:{color:"rgba(255, 64, 64, 0.4)"},dayExceptThisMonth:{color:"rgba(51, 51, 51, 0.4)"},weekend:{backgroundColor:"inherit"},moreView:{border:"1px solid #d5d5d5",boxShadow:"0 2px 6px 0 rgba(0, 0, 0, 0.1)",backgroundColor:"white",width:null,height:null},gridCell:{headerHeight:31,footerHeight:null},moreViewTitle:{backgroundColor:"inherit"}};function Gr(){return{common:Dn(zr,arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})}}function Ur(e){return{setTheme:t=>{e(vt((e=>{e.common=Dn(e.common,t.common),e.week=Dn(e.week,t.week),e.month=Dn(e.month,t.month)})))},setCommonTheme:t=>{e(vt((e=>{e.common=Dn(e.common,t)})))},setWeekTheme:t=>{e(vt((e=>{e.week=Dn(e.week,t)})))},setMonthTheme:t=>{e(vt((e=>{e.month=Dn(e.month,t)})))}}}function jr(){return{month:Dn($r,arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})}}function Yr(){return{week:Dn(Br,arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})}}const Vr=function(){return sr(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=>({...Gr(e?.common),...Yr(e?.week),...jr(e?.month),dispatch:{...Ur(t)}})}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}))},{StoreProvider:Xr,useInternalStore:qr,useStore:Kr}=lr();function Zr(){return Kr(Rr)}function Jr(e){return{common:{saturday:e.common.saturday,holiday:e.common.holiday,today:e.common.today,dayName:e.common.dayName},week:{pastDay:e.week.pastDay,today:e.week.today,dayName:e.week.dayName}}}function Qr(e){return{common:{saturday:e.common.saturday,holiday:e.common.holiday,today:e.common.today,dayName:e.common.dayName},month:{dayName:e.month.dayName}}}function ei(e){let{dayNames:t,marginLeft:n=wt,rowStyleInfo:o,type:r="month"}=e;const i=Kr("month"===r?Qr:Jr),{backgroundColor:a="white",borderLeft:l=null,...s}=i[r]?.dayName??{},{borderTop:c=null,borderBottom:u=null}=s;return _("div",{"data-testid":`grid-header-${r}`,className:Wt("day-names",r),style:{backgroundColor:a,borderTop:c,borderBottom:u}},_("div",{className:Wt("day-name-container"),style:{marginLeft:n}},t.map(((e,t)=>_(Or,{type:r,key:`dayNames-${e.day}`,dayName:e,style:{width:zt(o[t].width),left:zt(o[t].left),borderLeft:l},theme:i})))))}const ti=6;let ni=function(e){return e.header="header",e.footer="footer",e}({});function oi(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=[];let o;return e.length?(n[0]=[e[0].cid()],e.slice(1).forEach(((r,i)=>{o=e.slice(0,i+1).reverse();const a=o.find((e=>r.collidesWith(e,t)));a?n.slice().reverse().some((e=>!!~e.indexOf(a.cid())&&(e.push(r.cid()),!0))):n.push([r.cid()])})),n):n}function ri(e,t){let{length:n}=e;for(;n>0;)if(n-=1,!tn()(e[n][t]))return n;return-1}function ii(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const o=[];return t.forEach((t=>{const r=[[]];t.forEach((t=>{const o=e.get(t);let i,a,l=0,s=!1;for(;!s;)a=ri(r,l),-1===a?(r[0].push(o),s=!0):o.collidesWith(r[a][l],n)||(i=a+1,tn()(r[i])&&(r[i]=[]),r[i][l]=o,s=!0),l+=1})),o.push(r)})),o}function ai(e,t){return n=>{const o=n.getStarts();return!(n.getEnds()<e||o>t)}}function li(e,t,n,o){const r=Yn(e,t,Wn).map((e=>Gn(e,"YYYYMMDD")));n.forEach((e=>{e.forEach((e=>{e.forEach(((e,t)=>{if(!e)return;const n=Gn(e.getStarts(),"YYYYMMDD"),i=Yn(jn(e.getStarts()),Qn(e.getEnds()),Wn).length;e.top=t,e.left=r.indexOf(n),e.width=i,o?.(e)}))}))}))}function si(e,t,n){return n.getStarts()<e&&(n.exceedLeft=!0,n.renderStarts=new bn(e)),n.getEnds()>t&&(n.exceedRight=!0,n.renderEnds=new bn(t)),n}function ci(e,t,n){return n instanceof go?(n.each((n=>(si(e,t,n),!0))),null):si(e,t,n)}function ui(e){const t=new go((e=>e.cid()));return e.each((function(e){t.add(new Cn(e))})),t}function di(e){let{model:t}=e;return t.isAllday||t.hasMultiDates}function pi(e){return!di(e)}function fi(e){e.top=e.top||0,e.top+=1}function mi(e,t){const n=t.filter(di),o=t.filter(pi).sort(xn.compare.event.asc),r={};o.forEach((t=>{const o=Gn(t.getStarts(),"YYYYMMDD");let i=r[o];tn()(i)&&(i=r[o]=function(e,t,n){const o=[];return e[t].forEach((e=>{n.doWhenHas(e,(e=>{o.push(e.top)}))})),o.length>0?Math.max(...o):0}(e,o,n)),r[o]=t.top=i+1}))}function hi(e,t){const{start:n,end:o,andFilters:r=[],alldayFirstMode:i=!1}=t,{events:a,idsOfDay:l}=e,s=go.and(...[ai(n,o)].concat(r)),c=ui(a.filter(s));!function(e){e.each((e=>{const{model:t}=e,n=t.getStarts(),o=t.getEnds();t.hasMultiDates=!qn(n,o),!t.isAllday&&t.hasMultiDates&&(e.renderStarts=jn(n),e.renderEnds=Qn(o))}))}(c),function(e,t,n){n.each((n=>{(n.model.isAllday||n.model.hasMultiDates)&&ci(jn(e),Qn(t),n)}))}(n,o,c);const u=c.sort(xn.compare.event.asc),d=!1,p=ii(c,oi(u,d),d);return li(n,o,p,fi),i?mi(l,c):function(e,t){const n=t.filter(di),o=t.filter(pi).sort(xn.compare.event.asc),r={};o.forEach((t=>{const o=Gn(t.getStarts(),"YYYYMMDD");let i=r[o];if(tn()(i)&&(i=r[o]=[],e[o].forEach((e=>{n.doWhenHas(e,(e=>{i.push(e.top)}))}))),i.indexOf(t.top)>=0){const e=Math.max(...i)+1;for(let n=1;n<=e&&(t.top=n,!(i.indexOf(t.top)<0));n+=1);}i.push(t.top)}))}(l,c),p}function gi(e,t){return 0===e&&24===t?e=>e.sort(xn.compare.event.asc):n=>{return n.filter((o=e,r=t,e=>{const t=e.getStarts(),n=e.getEnds(),i=t.getTime(),a=n.getTime(),l=t.getFullYear(),s=t.getMonth(),c=t.getDate(),u=new bn(l,s,c).setHours(o),d=new bn(l,s,c).setHours(r);return i>=u&&i<d||a>u&&a<=d||i<u&&a>u||a>d&&i<d})).sort(xn.compare.event.asc);var o,r}}function vi(e,t){const{start:n,end:o,uiModelTimeColl:r,hourStart:i,hourEnd:a}=t,l=function(e,t,n,o){const r={};return yo(t,n).forEach((t=>{const n=Gn(t,"YYYYMMDD"),i=e[n],a=r[n]=new go((e=>e.cid()));i&&i.length&&i.forEach((e=>{o.doWhenHas(e,(e=>{a.add(e)}))}))}),{}),r}(e,n,o,r),s={},c=gi(i,a),u=!0;return Object.entries(l).forEach((e=>{let[t,n]=e;const o=ii(n,oi(c(n),u),u);s[t]=o})),s}function yi(e,t,n){if(!n||!n.size)return[];!function(e){e.each((e=>{const{model:t}=e;t.hasMultiDates=!0,e.renderStarts=jn(t.getStarts()),e.renderEnds=Qn(t.getEnds())}))}(n),ci(e,t,n);const o=n.sort(xn.compare.event.asc),r=!0,i=ii(n,oi(o,r),r);return li(e,t,i),i}function _i(e,t,n){const o=Math.max(e,...t);return Math.min(o,...n)}function wi(e,t,n){return t*n/e}function bi(e,t,n){return t<=e&&e<=n}const Di=22;function ki(e,t){e.forEach((e=>{e.forEach((e=>{e.forEach(((e,n)=>{t(e,n)}))}))}))}function Ci(e,t){return n=>{let{top:o}=n;return e>=o*t}}function Si(e,t,n){return e.filter(function(e,t){return n=>{let{top:o}=n;return e<o*t}}(t,n)).length}function xi(e,t,n){const o=(e=>e.filter((e=>eo(e.getDay()))).length)(e),r=e.length,i=o===r,a=n/(t&&!i?2*r-o:r),l=e.map((e=>{const n=e.getDay();return!t||i||eo(n)?a:2*a})),s=l.reduce(((e,t,n)=>n?[...e,e[n-1]+l[n-1]]:[0]),[]);return{widthList:l,leftList:s}}function Ei(e,t,n){return e.reduce(((e,o,r)=>t<=r&&r<=n?e+o:e),0)}function Ii(e,t){return t.findIndex((t=>e>=jn(t)&&e<=Qn(t)))}const Ni=(e,t,n,o)=>{const{widthList:r}=xi(n,o,100);return{left:e?Ei(r,0,e-1):0,width:Ei(r,e??0,t<0?n.length-1:t)}},Mi=(e,t,n,o)=>{const{widthList:r}=xi(n,o,100);let i=0,a=n.length-1;return n.forEach(((n,o)=>{n<=e&&(i=o),n<=t&&(a=o)})),{width:Ei(r,i,a),left:i?Ei(r,0,i-1):0}};function Ti(e,t,n){const{idsOfDay:o}=t,r=hi(t,{start:e[0],end:Qn(e[e.length-1])}),i=[];ki(r,(t=>{const o=t.model.cid();i[o]=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=e.getStarts(),r=e.getEnds(),{width:i,left:a}=Mi(o,r,t,n);return e.width=i,e.left=a,e}(t,e,n)}));const a=Object.keys(o).reduce(((e,t)=>{const n=o[t];return e[t]=n.map((e=>i[e])).filter((e=>!!e)),e}),{});return{uiModels:Object.values(i),gridDateEventModelMap:a}}const Ai=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return ki(e,(e=>{const o=e.getStarts(),r=e.getEnds(),{width:i,left:a}=Mi(o,r,t,n);e.width=i,e.left=a,e.top+=1})),Pi(e)},Oi=e=>e.filter((e=>!!e));function Pi(e){return e.flatMap((e=>e.flatMap((e=>Oi(e)))))}const Ri=(e,t,n)=>{let{narrowWeekend:o,hourStart:r,hourEnd:i,weekStartDate:a,weekEndDate:l}=n;const s=function(e,t){const{start:n,end:o,panels:r,andFilters:i=[],options:a}=t,{events:l,idsOfDay:s}=e,c=a?.hourStart??0,u=a?.hourEnd??24,d=go.and(...[ai(n,o)].concat(i)),p=ui(l.filter(d)).groupBy(_o);return r.reduce(((e,t)=>{const{name:r,type:i}=t;return cn(p[r])?e:{...e,[r]:"daygrid"===i?yi(n,o,p[r]):vi(s,{start:n,end:o,uiModelTimeColl:p[r],hourStart:c,hourEnd:u})}}),{milestone:[],task:[],allday:[],time:{}})}(t,{start:a,end:l,panels:[{name:"milestone",type:"daygrid",show:!0},{name:"task",type:"daygrid",show:!0},{name:"allday",type:"daygrid",show:!0},{name:"time",type:"timegrid",show:!0}],andFilters:[],options:{hourStart:r,hourEnd:i}});return Object.keys(s).reduce(((t,n)=>{const r=s[n];return{...t,[n]:Array.isArray(r)?Ai(r,e,o):(i=r,Array.from(new Set(Object.values(i).reduce(((e,t)=>e.concat(...Pi(t))),[]))))};var i}),{milestone:[],allday:[],task:[],time:[]})};function Li(e,t){let{workweek:n=!1,visibleWeeksCount:o=0,startDayOfWeek:r=0,isAlways6Weeks:i=!0}=t;const a=new bn(e),l=o>0,s=l?a:oo(a),c=function(e,t){const n=Vn(e);return n.setDate(e.getDate()-t),n}(s,s.getDay()-r+(s.getDay()<r?An:0)),u=c.getDay(),d=function(e){const t=oo(e);return t.setMonth(t.getMonth()+1),t.setDate(t.getDate()-1),t.setHours(23,59,59,999),t}(a).getDate(),p=co(c,s),f=d+Math.abs(p);let m=ti;return l?m=o:!1===i&&(m=Math.ceil(f/An)),_t()(0,m).map((e=>_t()(0,An).reduce(((t,o)=>{const r=e*An+o;if(!n||n&&!eo((r+u)%An)){const e=so(c,r);t.push(e)}return t}),[])))}function Hi(e,t){let{startDayOfWeek:n=Tn.SUN,workweek:o}=t;const r=jn(e),i=r.getDay()-n;return(i>=0?_t()(-i,An-i):_t()(-An-i,-i)).reduce(((e,t)=>{const n=so(r,t);return o&&eo(n.getDay())||e.push(n),e}),[])}function Fi(e,t){const n=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=e.length,o=n>5&&t,r=o?100/(n-1):100/n;return e.map((e=>{const t=o&&eo(e.getDay())?r/2:r;return{date:e,width:t}})).reduce(((e,t,n)=>{const o=e[n-1];return e.push({...t,left:0===n?0:o.left+o.width}),e}),[])}(e,t.narrowWeekend??!1),o=2*(t.hourEnd-t.hourStart),r=100/o;return{columns:n,rows:_t()(o).map(((e,n)=>{const o=n%2==1,i=t.hourStart+Math.floor(e/2),a=`${i}:${o?"30":"00"}`.padStart(5,"0"),l=(o?`${i+1}:00`:`${i}:30`).padStart(5,"0");return{top:r*n,height:r,startTime:a,endTime:l}}))}}function Wi(e){let{rowsCount:t,columnsCount:n,container:o,narrowWeekend:r=!1,startDayOfWeek:i=Tn.SUN}=e;if(cn(o))return()=>null;const a=_t()(i,i+n).map((e=>e%An)),l=r?a.filter((e=>eo(e))).length:0;return function(e){const{left:i,top:s,width:c,height:u}=o.getBoundingClientRect(),[d,p]=function(e,t){let{clientX:n,clientY:o}=e,{left:r,top:i,clientLeft:a,clientTop:l}=t;return[n-r-a,o-i-l]}(e,{left:i,top:s,clientLeft:o.clientLeft,clientTop:o.clientTop});if(d<0||p<0||d>c||p>u)return null;const f=r?c/(n-l+1):c/n,m=a.map((e=>r&&eo(e)?f/2:f)),h=[];m.forEach(((e,t)=>{0===t?h.push(0):h.push(h[t-1]+m[t-1])}));return{columnIndex:Nn(h,(e=>d>=e)),rowIndex:(g=t,v=u,y=p,_i(Math.floor(wi(v,g,y)),[0],[g-1]))};var g,v,y}}function zi(e){return e.common.gridSelection}function Bi(e){let{type:t,gridSelectionData:n,weekDates:o,narrowWeekend:r}=e;const{backgroundColor:i,border:a}=Kr(zi),{startCellIndex:l,endCellIndex:s}=n,{left:c,width:u}=Ni(Math.min(l,s),Math.max(l,s),o,r),d={left:zt(c),width:zt(u),height:zt(100),backgroundColor:i,border:a};return u>0?_("div",{className:Wt(t,"grid-selection"),style:d}):null}function $i(e,t,n){return{startColumnIndex:n?t.columnIndex:e.columnIndex,startRowIndex:n?t.rowIndex:e.rowIndex,endColumnIndex:n?e.columnIndex:t.columnIndex,endRowIndex:n?e.rowIndex:t.rowIndex}}const Gi={sortSelection:(e,t)=>$i(e,t,e.columnIndex>t.columnIndex||e.columnIndex===t.columnIndex&&e.rowIndex>t.rowIndex),getDateFromCollection:(e,t)=>{const n=e;return[lo(n.columns[t.startColumnIndex].date,n.rows[t.startRowIndex].startTime),lo(n.columns[t.endColumnIndex].date,n.rows[t.endRowIndex].endTime)]},calculateSelection:function(e,t,n){if(cn(e))return null;const{startColumnIndex:o,endColumnIndex:r,endRowIndex:i,startRowIndex:a}=e;if(!bi(t,o,r))return null;const l={startRowIndex:a,endRowIndex:i,isSelectingMultipleColumns:o!==r,isStartingColumn:t===o};return o<t&&t<r?(l.startRowIndex=0,l.endRowIndex=n):o!==r&&(o===t?l.endRowIndex=n:r===t&&(l.startRowIndex=0)),l}};const Ui={sortSelection:(e,t)=>$i(e,t,e.rowIndex>t.rowIndex||e.rowIndex===t.rowIndex&&e.columnIndex>t.columnIndex),getDateFromCollection:(e,t)=>{const n=e;return[n[t.startRowIndex][t.startColumnIndex],n[t.endRowIndex][t.endColumnIndex]]},calculateSelection:function(e,t,n){if(!(un(e)&&un(t)&&un(n)))return null;const{startRowIndex:o,startColumnIndex:r,endRowIndex:i,endColumnIndex:a}=e;if(!bi(t,Math.min(o,i),Math.max(o,i)))return null;let l=r,s=a;return o<t&&(l=0),i>t&&(s=n-1),{startCellIndex:l,endCellIndex:s}}};const ji={sortSelection:(e,t)=>$i(e,t,e.columnIndex>t.columnIndex),getDateFromCollection:(e,t)=>{const n=e;return[n[t.startColumnIndex],n[t.endColumnIndex]]},calculateSelection:function(e){return un(e)?{startCellIndex:e.startColumnIndex,endCellIndex:e.endColumnIndex}:null}};function Yi(e){return ji.calculateSelection(e.gridSelection.dayGridWeek)}function Vi(e){let{weekDates:t,narrowWeekend:n}=e;const o=dr(Yi);return cn(o)?null:_(Bi,{type:"allday",gridSelectionData:o,weekDates:t,narrowWeekend:n})}function Xi(e,t){for(var n in t)e[n]=t[n];return e}function qi(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var o in t)if("__source"!==o&&e[o]!==t[o])return!0;return!1}function Ki(e,t){this.props=e,this.context=t}function Zi(e,t){function n(e){var n=this.props.ref,o=n==e.ref;return!o&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!o:qi(this.props,e)}function o(t){return this.shouldComponentUpdate=n,_(e,t)}return o.displayName="Memo("+(e.displayName||e.name)+")",o.prototype.isReactComponent=!0,o.__f=!0,o}(Ki.prototype=new D).isPureReactComponent=!0,Ki.prototype.shouldComponentUpdate=function(e,t){return qi(this.props,e)||qi(this.state,t)};var Ji=t.__b;t.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Ji&&Ji(e)};var Qi="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function ea(e){function t(t){var n=Xi({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=Qi,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var ta=t.__e;t.__e=function(e,t,n,o){if(e.then)for(var r,i=t;i=i.__;)if((r=i.__c)&&r.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),r.__c(e,t);ta(e,t,n,o)};var na=t.unmount;function oa(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),e.__c.__H=null),null!=(e=Xi({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return oa(e,t,n)}))),e}function ra(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return ra(e,t,n)})),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function ia(){this.__u=0,this.t=null,this.__b=null}function aa(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function la(){this.u=null,this.o=null}t.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),na&&na(e)},(ia.prototype=new D).__c=function(e,t){var n=t.__c,o=this;null==o.t&&(o.t=[]),o.t.push(n);var r=aa(o.__v),i=!1,a=function(){i||(i=!0,n.__R=null,r?r(l):l())};n.__R=a;var l=function(){if(! --o.__u){if(o.state.__a){var e=o.state.__a;o.__v.__k[0]=ra(e,e.__c.__P,e.__c.__O)}var t;for(o.setState({__a:o.__b=null});t=o.t.pop();)t.forceUpdate()}};o.__u++||32&t.__u||o.setState({__a:o.__b=o.__v.__k[0]}),e.then(a,a)},ia.prototype.componentWillUnmount=function(){this.t=[]},ia.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=oa(this.__b,n,o.__O=o.__P)}this.__b=null}var r=t.__a&&_(b,null,e.fallback);return r&&(r.__u&=-33),[_(b,null,t.__a?null:e.children),r]};var sa=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!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 ca(e){return this.getChildContext=function(){return e.context},e.children}function ua(e){var t=this,n=e.i;t.componentWillUnmount=function(){B(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),t.l||(t.i=n,t.l={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)}}),B(_(ca,{context:t.context},e.__v),t.l)}function da(e,t){var n=_(ua,{__v:e,i:t});return n.containerInfo=t,n}(la.prototype=new D).__a=function(e){var t=this,n=aa(t.__v),o=t.o.get(e);return o[0]++,function(r){var i=function(){t.props.revealOrder?(o.push(r),sa(t,e,o)):r()};n?n(i):i()}},la.prototype.render=function(e){this.u=null,this.o=new Map;var t=M(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},la.prototype.componentDidUpdate=la.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){sa(e,n,t)}))};var pa="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,fa=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|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]/,ma=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,ha=/[A-Z0-9]/g,ga="undefined"!=typeof document,va=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};D.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(D.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var ya=t.event;function _a(){}function wa(){return this.cancelBubble}function ba(){return this.defaultPrevented}t.event=function(e){return ya&&(e=ya(e)),e.persist=_a,e.isPropagationStopped=wa,e.isDefaultPrevented=ba,e.nativeEvent=e};var Da={enumerable:!1,configurable:!0,get:function(){return this.class}},ka=t.vnode;t.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,o={};for(var r in t){var i=t[r];if(!("value"===r&&"defaultValue"in t&&null==i||ga&&"children"===r&&"noscript"===n||"class"===r||"className"===r)){var a=r.toLowerCase();"defaultValue"===r&&"value"in t&&null==t.value?r="value":"download"===r&&!0===i?i="":"translate"===a&&"no"===i?i=!1:"ondoubleclick"===a?r="ondblclick":"onchange"!==a||"input"!==n&&"textarea"!==n||va(t.type)?"onfocus"===a?r="onfocusin":"onblur"===a?r="onfocusout":ma.test(r)?r=a:-1===n.indexOf("-")&&fa.test(r)?r=r.replace(ha,"-$&").toLowerCase():null===i&&(i=void 0):a=r="oninput","oninput"===a&&o[r=a]&&(r="oninputCapture"),o[r]=i}}"select"==n&&o.multiple&&Array.isArray(o.value)&&(o.value=M(t.children).forEach((function(e){e.props.selected=-1!=o.value.indexOf(e.props.value)}))),"select"==n&&null!=o.defaultValue&&(o.value=M(t.children).forEach((function(e){e.props.selected=o.multiple?-1!=o.defaultValue.indexOf(e.props.value):o.defaultValue==e.props.value}))),t.class&&!t.className?(o.class=t.class,Object.defineProperty(o,"className",Da)):(t.className&&!t.class||t.class&&t.className)&&(o.class=o.className=t.className),e.props=o}(e),e.$$typeof=pa,ka&&ka(e)};var Ca=t.__r;t.__r=function(e){Ca&&Ca(e),e.__c};var Sa=t.diffed;t.diffed=function(e){Sa&&Sa(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value),null};function xa(e){return!!e.__k&&(B(null,e),!0)}function Ea(e){let{index:t,exceedCount:n,isClicked:o,onClickExceedCount:r}=e;const i={display:o?"none":""};return n&&!o?_("span",{className:Wt("weekday-exceed-in-week"),onClick:()=>r(t),style:i},_(Cr,{template:"weekGridFooterExceed",param:n})):null}function Ia(e){let{isClicked:t,isClickedIndex:n,onClickCollapseButton:o}=e;return t&&n?_("span",{className:Wt("weekday-exceed-in-week"),onClick:o},_(Cr,{template:"collapseBtnTitle"})):null}function Na(e){let{width:t,left:n,index:o,exceedCount:r,isClicked:i,onClickExceedCount:a,isClickedIndex:l,onClickCollapseButton:s,isLastCell:c}=e;const{borderRight:u,backgroundColor:d}=Kr(de((e=>e.week.dayGrid),[])),p={width:t,left:n,borderRight:c?"none":u,backgroundColor:d};return _("div",{className:Wt("panel-grid"),style:p},_(Ea,{index:o,exceedCount:r,isClicked:i,onClickExceedCount:a}),_(Ia,{isClickedIndex:l,isClicked:i,onClickCollapseButton:s}))}const Ma=Zi((function(e){let{uiModels:t,weekDates:n,narrowWeekend:o,height:r,clickedIndex:i,isClickedCount:a,onClickExceedCount:l,onClickCollapseButton:s}=e;const{widthList:c,leftList:u}=xi(n,o,100),d=n.length-1;return _(b,null,n.map(((e,n)=>{const o=zt(c[n]),p=zt(u[n]);var f;const m=Si(t.filter((f=e,e=>{const t=jn(e.getStarts()),n=jn(e.getEnds());return t<=f&&f<=n})),r,Di+2),h=n===i,g=n===d;return _(Na,{key:`panel-grid-${e.getDate()}`,width:o,left:p,index:n,exceedCount:m,isClicked:a,onClickExceedCount:l,isClickedIndex:h,onClickCollapseButton:s,isLastCell:g})})))}));function Ta(e){let{onMouseDown:t}=e;return _("span",{className:`${Wt("weekday-resize-handle")} ${Wt("handle-y")}`,onMouseDown:t,"data-testid":"horizontal-event-resize-icon"},_("i",{className:`${Wt("icon")} ${Wt("ic-handle-y")}`}))}const Aa=G(null),Oa=Aa.Provider,Pa=()=>{const e=pe(Aa);if(tn()(e))throw new Error("LayoutContainerProvider is not found");return e},Ra="panelResizer",La={resizeEvent:(e,t)=>`event/${e}/resize/${t}`,moveEvent:(e,t)=>`event/${e}/move/${t}`,gridSelection:e=>`gridSelection/${e}`};function Ha(e){return dr(de((t=>t.calendar.calendars.find((t=>t.id===e))),[e]))}function Fa(e){const t=Ha(e?.calendarId??null);return ue((()=>({color:t?.color,borderColor:t?.borderColor,backgroundColor:t?.backgroundColor,dragBackgroundColor:t?.dragBackgroundColor})),[t])}let Wa=function(e){return e.ESCAPE="Escape",e}({});const za={[Wa.ESCAPE]:27},Ba=3;function $a(e,t){const n=pr(),o=ce(e),r=ce(t);le((()=>{o.current=e,r.current=t}),[e,t]),le((()=>n.subscribe((e=>r.current(e)),(e=>o.current(e)))),[e,n])}function Ga(e){let{onInit:t,onDragStart:n,onDrag:o,onMouseUp:r,onPressESCKey:i}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{initDrag:a,setDragging:l,cancelDrag:s,reset:c}=fr("dnd"),u=ce(pr().getState().dnd);$a(wr,(e=>{u.current=e}));const[d,p]=ie(!1),f=ce(null),m=ce(null),h=ce(null),g=de((n=>{0===n.button&&(n.currentTarget&&(n.currentTarget.ondragstart=function(){return!1}),n.preventDefault(),p(!0),a({draggingItemType:e,initX:n.clientX,initY:n.clientY}),t?.(n,u.current))}),[t,e,a]),v=de((t=>{const{initX:r,initY:i,draggingState:a,draggingItemType:s}=u.current;if(s!==e)return p(!1),void c();if(!un(r)||!un(i)||function(e,t,n,o){return Math.abs(e-n)>=Ba||Math.abs(t-o)>=Ba}(r,i,t.clientX,t.clientY)){if(a<=So.INIT)return l({x:t.clientX,y:t.clientY}),void n?.(t,u.current);l({x:t.clientX,y:t.clientY}),o?.(t,u.current)}}),[e,o,n,l,c]),y=de((e=>{e.stopPropagation(),d&&(r?.(e,u.current),p(!1),c())}),[d,r,c]),_=de((e=>{(function(e,t){return e.key?e.key===t:e.keyCode===za[t]})(e,Wa.ESCAPE)&&(p(!1),s(),i?.(e,u.current))}),[i,s]);return le((()=>{f.current=v,m.current=y,h.current=_}),[_,v,y]),le((()=>{const e=e=>f.current?.(e),t=e=>m.current?.(e),n=e=>h.current?.(e);return d?(document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),document.addEventListener("keydown",n),()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t),document.removeEventListener("keydown",n)}):Vo}),[d,c]),g}function Ua(e,t){return e?t:void 0}function ja(e){return{vertical:e?5:2,horizontal:8}}function Ya(e,t){const n=e?0:"2px",o=t?0:"2px";return`${n} ${o} ${o} ${n}`}function Va(e){let{model:t}=e;return`${t.calendarId?`${t.calendarId}-`:""}${t.id?`${t.id}-`:""}${t.title}`}const Xa={eventBody:Wt("weekday-event"),eventTitle:Wt("weekday-event-title"),eventDot:Wt("weekday-event-dot"),moveEvent:Wt("dragging--move-event"),resizeEvent:Wt("dragging--resize-horizontal-event")};function qa(e){let{flat:t=!1,uiModel:n,eventHeight:o,headerHeight:r,resizingWidth:i=null,movingLeft:a=null}=e;const{currentView:l}=dr(yr),{useDetailPopup:s,isReadOnly:c}=dr(_r),{setDraggingEventUIModel:u}=fr("dnd"),{showDetailPopup:d}=fr("popup"),p=Pa(),f=Er(),m=Fa(n.model),[h,g]=ie(!1),v=ce(null),{isReadOnly:y,id:w,calendarId:b}=n.model,D=un(i)||un(a),k=!c&&!y&&!D,C=e=>{u(n),p?.classList.add(e)},S=e=>{g(!1),p?.classList.remove(e)};$a(wr,(e=>{let{draggingEventUIModel:t,draggingState:o}=e;o!==So.DRAGGING||t?.cid()!==n.cid()||D?g(!1):g(!0)})),le((()=>{D||f.fire("afterRenderEvent",n.model.toEventObject())}),[]);const x=Ga(La.resizeEvent("dayGrid",`${n.cid()}`),{onDragStart:()=>C(Xa.resizeEvent),onMouseUp:()=>S(Xa.resizeEvent),onPressESCKey:()=>S(Xa.resizeEvent)}),E=Ga(La.moveEvent("dayGrid",`${n.cid()}`),{onDragStart:()=>{k&&C(Xa.moveEvent)},onMouseUp:(e,o)=>{let{draggingState:r}=o;S(Xa.moveEvent);const i=r<=So.INIT;i&&s&&v.current&&d({event:n.model,eventRect:v.current.getBoundingClientRect()},t),i&&f.fire("clickEvent",{event:n.model.toEventObject(),nativeEvent:e})},onPressESCKey:()=>S(Xa.moveEvent)}),I=!h&&"month"===l&&"time"===n.model.category&&qn(n.model.start,n.model.end),N=!k||t||h||n.exceedRight,M=function(e){let{flat:t,uiModel:n,resizingWidth:o,movingLeft:r,eventHeight:i,headerHeight:a}=e;const{top:l,left:s,width:c,model:u}=n,d=ja(t),p=t?{}:{width:o||zt(c),left:zt(r??s),top:(l-1)*(i+d.vertical)+a,position:"absolute"};return Object.assign(p,u.customStyle)}({uiModel:n,eventHeight:o,headerHeight:r,flat:t,movingLeft:a,resizingWidth:i}),T=function(e){let{uiModel:t,flat:n,eventHeight:o,isDraggingTarget:r,calendarColor:i}=e;const{exceedLeft:a,exceedRight:l}=t,{color:s,backgroundColor:c,dragBackgroundColor:u,borderColor:d}=Gt(t,i),p={color:s,backgroundColor:r?u:c,borderLeft:a?"none":`3px solid ${d}`,borderRadius:Ya(a,l),overflow:"hidden",height:o,lineHeight:Bt(o),opacity:r?.5:1},f=ja(n);return n?{marginTop:f.vertical,...p}:{marginLeft:a?0:f.horizontal,marginRight:l?0:f.horizontal,...p}}({uiModel:n,flat:t,eventHeight:o,isDraggingTarget:h,calendarColor:m});return _("div",{className:Wt("weekday-event-block",{"weekday-exceed-left":n.exceedLeft,"weekday-exceed-right":n.exceedRight}),style:M,"data-testid":Ua(k,Va(n)),"data-calendar-id":b,"data-event-id":w,ref:v},_("div",{className:Xa.eventBody,style:{...T,backgroundColor:I?null:T.backgroundColor,borderLeft:I?null:T.borderLeft},onMouseDown:e=>{e.stopPropagation(),E(e)}},I?_("span",{className:Xa.eventDot,style:{backgroundColor:T.backgroundColor}}):null,_("span",{className:Xa.eventTitle},_(Cr,{template:n.model.category,param:n.model})),N?null:_(Ta,{onMouseDown:e=>{e.stopPropagation(),k&&x(e)}})))}function Ka(e,t){const n=ce(e);le((()=>{n.current=e}),[e]),le((()=>{t&&n.current()}),[t])}function Za(e){const[t,n]=ie(null);$a(wr,(t=>{if(un(t.x)&&un(t.y)){const o=e({clientX:t.x,clientY:t.y});o&&n(o)}}));return[t,de((()=>n(null)),[])]}const Ja=(e,t,n)=>{return cn(e)?null:(o=e,new RegExp(`^event/${t}/${n}/\\d+$`).test(o)?In(e.split("/")):null);var o};function Qa(e,t){const[n,o]=ie(!1),[r,i]=ie(!1),[a,l]=ie(null);$a(wr,(n=>{let{draggingItemType:r,draggingEventUIModel:s,draggingState:c}=n;const u=Ja(r,e,t),d=Number(u)===s?.cid(),p=c===So.IDLE,f=c===So.CANCELED;cn(a)&&d&&l(s),un(a)&&(p||f)&&(o(!0),i(f))}));return{isDraggingEnd:n,isDraggingCanceled:r,draggingEvent:a,clearDraggingEvent:()=>{l(null),o(!1),i(!1)}}}function el(e){let{rowStyleInfo:t,gridPositionFinder:n}=e;const{movingEvent:o,movingLeft:r}=function(e){let{rowStyleInfo:t,gridPositionFinder:n}=e;const o=Er(),{isDraggingEnd:r,isDraggingCanceled:i,draggingEvent:a,clearDraggingEvent:l}=Qa("dayGrid","move"),s=ce(null),[c,u]=Za(n),{columnIndex:d}=c??{},p=ue((()=>cn(a)?null:t.findIndex((e=>{let{left:t}=e;return t===a.left}))),[t,a]),f=ue((()=>{if(cn(d)||cn(s.current)||cn(p))return null;const e=p+d-s.current;return e<0?-t[-e].left:t[e].left}),[d,t,p]);return le((()=>{cn(s.current)&&un(d)&&(s.current=d)}),[d]),Ka((()=>{if(!i&&un(a)&&un(d)&&un(f)&&d!==s.current&&un(s.current)){const e=d-s.current,t=new bn(a.model.getStarts()),n=new bn(a.model.getEnds());t.addDate(e),n.addDate(e),o.fire("beforeUpdateEvent",{event:a.model.toEventObject(),changes:{start:t,end:n}})}l(),u(),s.current=null}),r),ue((()=>({movingEvent:a,movingLeft:f})),[f,a])}({rowStyleInfo:t,gridPositionFinder:n});return cn(o)?null:_(qa,{uiModel:o,eventHeight:Di,headerHeight:0,movingLeft:r})}function tl(e){let{weekDates:t,gridColWidthMap:n,gridPositionFinder:o}=e;const r=Er(),{isDraggingEnd:i,isDraggingCanceled:a,draggingEvent:l,clearDraggingEvent:s}=Qa("dayGrid","resize"),[c,u]=Za(o),{columnIndex:d}=c??{},p=ue((()=>{return l?(n=t,{start:Ii((e=l).getStarts(),n),end:Ii(e.getEnds(),n)}):{start:-1,end:-1};var e,n}),[t,l]),f=ue((()=>p.start>-1&&un(d)?n[p.start][d]:null),[d,n,p.start]);return Ka((()=>{if(!a&&un(l)&&un(d)&&p.start<=d&&p.end!==d){const e=t[d];r.fire("beforeUpdateEvent",{event:l.model.toEventObject(),changes:{end:e}})}u(),s()}),i),ue((()=>({resizingEvent:l,resizingWidth:f})),[f,l])}function nl(e){let{weekDates:t,gridColWidthMap:n,gridPositionFinder:o}=e;const{resizingEvent:r,resizingWidth:i}=tl({weekDates:t,gridColWidthMap:n,gridPositionFinder:o});return cn(r)?null:_(qa,{uiModel:r,eventHeight:Di,headerHeight:0,resizingWidth:i})}function ol(){const[e,t]=ie(null);return[e,de((e=>{e&&t(e)}),[])]}function rl(e,t){const[n,o]=ie(0),[r,i]=ie(!1),{updateDayGridRowHeight:a}=fr("weekViewLayout");return{clickedIndex:n,isClickedCount:r,onClickExceedCount:de((n=>{i(!0),o(n),a({rowName:t,height:(e+1)*Di})}),[t,e,a]),onClickCollapseButton:de((()=>{i(!1),a({rowName:t,height:At})}),[t,a])}}function il(e){let{onClick:t,onDblClick:n,delay:o=300}=e;const r=ce(Vo),i=e=>{r.current=e},a=()=>{r.current()};le((()=>a),[]);return[e=>{a(),function(e,t,n){let o;const r=i=>{if(o||(o=i),i-o>=t)return e(),void n(Vo);const a=requestAnimationFrame(r);n((()=>cancelAnimationFrame(a)))},i=requestAnimationFrame(r);n((()=>cancelAnimationFrame(i)))}(t.bind(null,e),o,i)},e=>{a(),n(e)}]}const al={dayGridMonth:"month",dayGridWeek:"allday",timeGrid:"time"};function ll(e){let{type:t,selectionSorter:n,dateGetter:o,dateCollection:r,gridPositionFinder:i}=e;const{useFormPopup:a,gridSelection:l}=dr(_r),{enableDblClick:s,enableClick:c}=l,{setGridSelection:u,addGridSelection:d,clearAll:p}=fr("gridSelection"),{hideAllPopup:f,showFormPopup:m}=fr("popup"),h=Er(),g=Pa(),[v,y]=ie(null),[_,w]=ie(null),b=ce(!1),D=ce(null);$a(de((e=>e.gridSelection[t]),[t]),(e=>{D.current=e})),$a(wr,(e=>{let{draggingState:t,draggingItemType:n}=e;b.current=n===k&&t>=So.INIT}));const k=La.gridSelection(t),C=e=>{const o=i(e);un(_)&&un(o)&&u(t,n(_,o))},[S,x]=il({onClick:e=>{c&&E(e,!0)},onDblClick:e=>{s&&E(e,!0)},delay:250}),E=(e,n)=>{if(n&&C(e),un(D.current)){const[n,i]=function(e,t){return e<t?[e,t]:[t,e]}(...o(r,D.current));if(a&&un(v)){const o={top:(e.clientY+v.y)/2,left:(e.clientX+v.x)/2};m({isCreationPopup:!0,title:"",location:"",start:n,end:i,isAllday:"timeGrid"!==t,isPrivate:!1,popupArrowPointPosition:o,close:p})}const l=`.${Wt(al[t])}.${Wt("grid-selection")}`,s=Array.from(g?.querySelectorAll(l)??[]);h.fire("selectDateTime",{start:n.toDate(),end:i.toDate(),isAllday:"timeGrid"!==t,nativeEvent:e,gridSelectionElements:s})}},I=de((()=>{y(null),w(null),u(t,null)}),[u,t]),N=Ga(k,{onInit:e=>{a&&(y({x:e.clientX,y:e.clientY}),f());const n=i(e);un(n)&&w(n),a||d(t,D.current)},onDragStart:e=>{C(e)},onDrag:e=>{b.current&&C(e)},onMouseUp:(e,t)=>{let{draggingState:n}=t;e.stopPropagation();const o=n<=So.INIT;o?(e=>{const t=e.detail<=1;(c||s&&!t)&&(c?t?S(e):x(e):E(e,!0))})(e):E(e,o)},onPressESCKey:I});return le((()=>I),[I]),N}const sl="alldayTitle";function cl(e){let{events:t,weekDates:n,height:o=At,options:r={},rowStyleInfo:i,gridColWidthMap:a}=e;const{isReadOnly:l}=dr(_r),s=Kr(Lr),[c,u]=ol(),{narrowWeekend:d=!1,startDayOfWeek:p=Tn.SUN}=r,f=ue((()=>Math.max(0,...t.map((e=>{let{top:t}=e;return t})))),[t]),m=ue((()=>Wi({container:c,rowsCount:1,columnsCount:n.length,narrowWeekend:d,startDayOfWeek:p})),[c,n.length,d,p]),{clickedIndex:h,isClickedCount:g,onClickExceedCount:v,onClickCollapseButton:y}=rl(f,"allday"),w=ue((()=>t.filter(Ci(o,Di+Tt)).map((e=>_(qa,{key:`allday-DayEvent-${e.cid()}`,uiModel:e,eventHeight:Di,headerHeight:0})))),[t,o]),D=ll({type:"dayGridWeek",gridPositionFinder:m,dateCollection:n,selectionSorter:ji.sortSelection,dateGetter:ji.getDateFromCollection});return _(b,null,_("div",{className:Wt("panel-title"),style:s},_(Cr,{template:sl,param:"alldayTitle"})),_("div",{className:Wt("allday-panel"),ref:u,onMouseDown:e=>{const t=e.target;!l&&t.classList.contains(Wt("panel-grid"))&&D(e)}},_("div",{className:Wt("panel-grid-wrapper")},_(Ma,{uiModels:t,weekDates:n,narrowWeekend:d,height:o,clickedIndex:h,isClickedCount:g,onClickExceedCount:v,onClickCollapseButton:y})),_("div",{className:Wt("panel-allday-events")},w),_(nl,{weekDates:n,gridPositionFinder:m,gridColWidthMap:a}),_(el,{rowStyleInfo:i,gridPositionFinder:m}),_(Vi,{weekDates:n,narrowWeekend:d})))}function ul(e){let{events:t,weekDates:n,category:o,height:r=At,options:i={}}=e;const a=Kr(Lr),l=ue((()=>Math.max(0,...t.map((e=>{let{top:t}=e;return t})))),[t]),{narrowWeekend:s=!1}=i,c=`${o}Title`,{clickedIndex:u,isClickedCount:d,onClickExceedCount:p,onClickCollapseButton:f}=rl(l,o),m=ue((()=>t.filter(Ci(r,Di+Tt)).map((e=>_(qa,{key:`${o}-DayEvent-${e.cid()}`,uiModel:e,eventHeight:Di,headerHeight:0})))),[o,t,r]);return _(b,null,_("div",{className:Wt("panel-title"),style:a},_(Cr,{template:c,param:o})),_("div",{className:Wt("allday-panel")},_("div",{className:Wt("panel-grid-wrapper")},_(Ma,{uiModels:t,weekDates:n,narrowWeekend:s,height:r,clickedIndex:u,isClickedCount:d,onClickExceedCount:p,onClickCollapseButton:f})),_("div",{className:Wt(`panel-${o}-events`)},m)))}const dl={detailItem:Wt("detail-item"),detailItemIndent:Wt("detail-item","detail-item-indent"),detailItemSeparate:Wt("detail-item","detail-item-separate"),sectionDetail:Wt("popup-section","section-detail"),content:Wt("content"),locationIcon:Wt("icon","ic-location-b"),repeatIcon:Wt("icon","ic-repeat-b"),userIcon:Wt("icon","ic-user-b"),stateIcon:Wt("icon","ic-state-b"),calendarDotIcon:Wt("icon","calendar-dot")};function pl(e){let{event:t}=e;const{location:n,recurrenceRule:o,attendees:r,state:i,calendarId:a,body:l}=t,s=Ha(a);return _("div",{className:dl.sectionDetail},n&&_("div",{className:dl.detailItem},_("span",{className:dl.locationIcon}),_("span",{className:dl.content},_(Cr,{template:"popupDetailLocation",param:t,as:"span"}))),o&&_("div",{className:dl.detailItem},_("span",{className:dl.repeatIcon}),_("span",{className:dl.content},_(Cr,{template:"popupDetailRecurrenceRule",param:t,as:"span"}))),r&&_("div",{className:dl.detailItemIndent},_("span",{className:dl.userIcon}),_("span",{className:dl.content},_(Cr,{template:"popupDetailAttendees",param:t,as:"span"}))),i&&_("div",{className:dl.detailItem},_("span",{className:dl.stateIcon}),_("span",{className:dl.content},_(Cr,{template:"popupDetailState",param:t,as:"span"}))),s&&_("div",{className:dl.detailItem},_("span",{className:dl.calendarDotIcon,style:{backgroundColor:s?.backgroundColor??""}}),_("span",{className:dl.content},s?.name??"")),l&&_("div",{className:dl.detailItemSeparate},_("span",{className:dl.content},_(Cr,{template:"popupDetailBody",param:t,as:"span"}))))}const fl={sectionHeader:Wt("popup-section","section-header"),content:Wt("content"),eventTitle:Wt("event-title")};function ml(e){let{event:t}=e;return _("div",{className:fl.sectionHeader},_("div",{className:fl.eventTitle},_(Cr,{template:"popupDetailTitle",param:t,as:"span"})),_("div",{className:fl.content},_(Cr,{template:"popupDetailDate",param:t,as:"span"})))}const hl=Wt("see-more-popup-slot"),gl=Wt("event-form-popup-slot"),vl=Wt("event-detail-popup-slot"),yl=8,_l=["isPrivate","isAllday","isPending","isFocused","isVisible","isReadOnly"];let wl=function(e){return e.right="right",e.left="left",e}({}),bl=function(e){return e.top="top",e.bottom="bottom",e}({});const Dl=G(null);function kl(e){let{children:t}=e;const[n,o]=ol(),[r,i]=ol(),[a,l]=ol(),[s,c]=ol(),u={container:n,seeMorePopupSlot:r,formPopupSlot:a,detailPopupSlot:s};return _(Dl.Provider,{value:u},t,_("div",{ref:o,className:Wt("floating-layer")},_("div",{ref:i,className:hl}),_("div",{ref:l,className:gl}),_("div",{ref:c,className:vl})))}const Cl=e=>{const t=pe(Dl);if(tn()(t))throw new Error("FloatingLayerProvider is not found");return t?.[e]??null};function Sl(e,t,n){return e+n.height>t.top+t.height}function xl(e,t,n){return e+n.width>t.left+t.width}const El=e=>e.popup[jo.Form],Il=e=>e.popup[jo.Detail],Nl=e=>e.popup[jo.SeeMore],Ml={popupContainer:Wt("popup-container"),detailContainer:Wt("detail-container"),topLine:Wt("popup-top-line"),border:Wt("popup-arrow-border"),fill:Wt("popup-arrow-fill"),sectionButton:Wt("popup-section","section-button"),content:Wt("content"),editIcon:Wt("icon","ic-edit"),deleteIcon:Wt("icon","ic-delete"),editButton:Wt("edit-button"),deleteButton:Wt("delete-button"),verticalLine:Wt("vertical-line")};function Tl(){const{useFormPopup:e}=dr(_r),t=dr(Il),{event:n,eventRect:o}=t??{},{showFormPopup:r,hideDetailPopup:i}=fr("popup"),a=Fa(n),l=Pa(),s=Cl("detailPopupSlot"),c=Er(),u=ce(null),[d,p]=ie({}),[f,m]=ie(0),[h,g]=ie(wl.left),v=ue((()=>Wt("popup-arrow",{right:h===wl.right,left:h===wl.left})),[h]);if(se((()=>{if(u.current&&o&&l){const e=l.getBoundingClientRect(),t=u.current.getBoundingClientRect(),[n,r]=function(e,t,n){let o=e.top+e.height/2-n.height/2,r=e.left+e.width;return Sl(o,t,n)&&(o=t.top+t.height-n.height),xl(r,t,n)&&(r=e.left-n.width),[Math.max(o,t.top)+window.scrollY,Math.max(r,t.left)+window.scrollX]}(o,e,t),{top:i,direction:a}=function(e,t,n){return{top:e.top+e.height/2+window.scrollY,direction:e.left+e.width+n.width>t.left+t.width?wl.right:wl.left}}(o,e,t);p({top:n,left:r}),m(i-n-yl),g(a)}}),[o,l]),cn(n)||cn(o)||cn(s))return null;const{title:y="",isAllday:w=!1,start:b=new bn,end:D=new bn,location:k,state:C,isReadOnly:S,isPrivate:x}=n,E={top:o.top+o.height/2,left:o.left+o.width/2};return da(_("div",{role:"dialog",className:Ml.popupContainer,ref:u,style:d},_("div",{className:Ml.detailContainer},_(ml,{event:n}),_(pl,{event:n}),!S&&_("div",{className:Ml.sectionButton},_("button",{type:"button",className:Ml.editButton,onClick:()=>{e?r({isCreationPopup:!1,event:n,title:y,location:k,start:b,end:D,isAllday:w,isPrivate:x,eventState:C,popupArrowPointPosition:E}):c.fire("beforeUpdateEvent",{event:n.toEventObject(),changes:{}})}},_("span",{className:Ml.editIcon}),_("span",{className:Ml.content},_(Cr,{template:"popupEdit",as:"span"}))),_("div",{className:Ml.verticalLine}),_("button",{type:"button",className:Ml.deleteButton,onClick:()=>{c.fire("beforeDeleteEvent",n.toEventObject()),i()}},_("span",{className:Ml.deleteIcon}),_("span",{className:Ml.content},_(Cr,{template:"popupDelete",as:"span"}))))),_("div",{className:Ml.topLine,style:{backgroundColor:a.backgroundColor}}),_("div",{className:v},_("div",{className:Ml.border,style:{top:f}},_("div",{className:Ml.fill})))),s)}const Al={dropdownMenu:Wt("dropdown-menu"),dropdownMenuItem:Wt("dropdown-menu-item"),dotIcon:Wt("icon","dot"),content:Wt("content")};function Ol(e){let{index:t,name:n,backgroundColor:o,onClick:r}=e;return _("li",{className:Al.dropdownMenuItem,onClick:e=>r(e,t)},_("span",{className:Al.dotIcon,style:{backgroundColor:o}}),_("span",{className:Al.content},n))}function Pl(e){let{calendars:t,setOpened:n,onChangeIndex:o}=e;const r=(e,t)=>{e.stopPropagation(),n(!1),o(t)};return _("ul",{className:Al.dropdownMenu},t.map(((e,t)=>{let{name:n,backgroundColor:o="000"}=e;return _(Ol,{key:`dropdown-${n}-${t}`,index:t,name:n,backgroundColor:o,onClick:r})})))}function Rl(e){let{children:t,classNames:n=[],onClick:o=Vo}=e;return _("div",{className:Wt("popup-section",...n),onClick:o},t)}function Ll(){const[e,t]=ie(!1);return{isOpened:e,setOpened:t,toggleDropdown:()=>t((e=>!e))}}let Hl=function(e){return e.init="init",e.setCalendarId="setCalendarId",e.setTitle="setTitle",e.setLocation="setLocation",e.setPrivate="setPrivate",e.setAllday="setAllday",e.setState="setState",e.reset="reset",e}({});const Fl={title:"",location:"",isAllday:!1,isPrivate:!1,state:"Busy"};function Wl(e,t){switch(t.type){case Hl.init:return{...Fl,...t.event};case Hl.setCalendarId:return{...e,calendarId:t.calendarId};case Hl.setTitle:return{...e,title:t.title};case Hl.setLocation:return{...e,location:t.location};case Hl.setPrivate:return{...e,isPrivate:t.isPrivate};case Hl.setAllday:return{...e,isAllday:t.isAllday};case Hl.setState:return{...e,state:t.state};case Hl.reset:return{...e,...Fl};default:return e}}const zl={popupSection:["dropdown-section","calendar-section"],popupSectionItem:Wt("popup-section-item","popup-button"),dotIcon:Wt("icon","dot"),content:Wt("content","event-calendar")};function Bl(e){let{calendars:t,selectedCalendarId:n,formStateDispatch:o}=e;const{isOpened:r,setOpened:i,toggleDropdown:a}=Ll(),l=t.find((e=>e.id===n)),{backgroundColor:s="",name:c=""}=l??{};return _(Rl,{onClick:a,classNames:zl.popupSection},_("button",{type:"button",className:zl.popupSectionItem},_("span",{className:zl.dotIcon,style:{backgroundColor:s}}),_("span",{className:zl.content},c),_("span",{className:Wt("icon","ic-dropdown-arrow",{open:r})})),r&&_(Pl,{calendars:t,setOpened:i,onChangeIndex:e=>o({type:Hl.setCalendarId,calendarId:t[e].id})}))}const $l={closeButton:Wt("popup-button","popup-close"),closeIcon:Wt("icon","ic-close")};function Gl(e){let{type:t,close:n}=e;const{hideAllPopup:o}=fr("popup");return _("button",{type:"button",className:$l.closeButton,onClick:()=>{o(),dn(n)&&n()}},"moreEvents"===t?_(Cr,{template:"monthMoreClose"}):_("i",{className:$l.closeIcon}))}const Ul={confirmButton:Wt("popup-button","popup-confirm")};function jl(e){let{children:t}=e;return _("button",{type:"submit",className:Ul.confirmButton},_("span",null,t))}var Yl=o(411),Vl=o.n(Yl);function Xl(e){let{template:t,model:n,defaultValue:o=""}=e;const r=dr(vr)[t];if(cn(r))return o;let i=r(n);return Ht()(i)||(i=o),i}const ql={datePickerContainer:Wt("datepicker-container"),datePicker:Wt("popup-section-item","popup-date-picker"),allday:Wt("popup-section-item","popup-section-allday"),dateIcon:Wt("icon","ic-date"),dateDash:Wt("popup-date-dash"),content:Wt("content")},Kl=ea((function(e,t){let{start:n,end:o,isAllday:r=!1,formStateDispatch:i}=e;const{usageStatistics:a}=dr(_r),l=ce(null),s=ce(null),c=ce(null),u=ce(null),d=Xl({template:"startDatePlaceholder",defaultValue:"Start Date"}),p=Xl({template:"endDatePlaceholder",defaultValue:"End Date"});return le((()=>{if(l.current&&s.current&&c.current&&u.current){const e=new bn(n),i=new bn(o);r&&(e.setHours(12,0,0),i.setHours(13,0,0)),t.current=Vl().createRangePicker({startpicker:{date:e.toDate(),input:s.current,container:l.current},endpicker:{date:i.toDate(),input:u.current,container:c.current},format:r?"yyyy-MM-dd":"yyyy-MM-dd HH:mm",timePicker:!r&&{showMeridiem:!1,usageStatistics:a},usageStatistics:a})}}),[n,o,r,a,t]),_(Rl,null,_("div",{className:ql.datePicker},_("span",{className:ql.dateIcon}),_("input",{name:"start",className:ql.content,placeholder:d,ref:s}),_("div",{className:ql.datePickerContainer,ref:l})),_("span",{className:ql.dateDash},"-"),_("div",{className:ql.datePicker},_("span",{className:ql.dateIcon}),_("input",{name:"end",className:ql.content,placeholder:p,ref:u}),_("div",{className:ql.datePickerContainer,ref:c})),_("div",{className:ql.allday,onClick:()=>i({type:Hl.setAllday,isAllday:!r})},_("span",{className:Wt("icon",{"ic-checkbox-normal":!r,"ic-checkbox-checked":r})}),_("span",{className:ql.content},_(Cr,{template:"popupIsAllday"})),_("input",{name:"isAllday",type:"checkbox",className:Wt("hidden-input"),value:r?"true":"false",checked:r})))})),Zl=["Busy","Free"],Jl={popupSectionItem:Wt("popup-section-item","dropdown-menu-item"),dropdownMenu:Wt("dropdown-menu"),icon:Wt("icon"),content:Wt("content")};function Ql(e){let{setOpened:t,setEventState:n}=e;return _("ul",{className:Jl.dropdownMenu},Zl.map((e=>_("li",{key:e,className:Jl.popupSectionItem,onClick:o=>((e,o)=>{e.stopPropagation(),t(!1),n(o)})(o,e)},_("span",{className:Jl.icon}),_("span",{className:Jl.content},_(Cr,"Busy"===e?{template:"popupStateBusy"}:{template:"popupStateFree"}))))))}const es={popupSection:["dropdown-section","state-section"],popupSectionItem:Wt("popup-section-item","popup-button"),stateIcon:Wt("icon","ic-state"),arrowIcon:Wt("icon","ic-dropdown-arrow"),content:Wt("content","event-state")};function ts(e){let{eventState:t="Busy",formStateDispatch:n}=e;const{isOpened:o,setOpened:r,toggleDropdown:i}=Ll();return _(Rl,{onClick:i,classNames:es.popupSection},_("button",{type:"button",className:es.popupSectionItem},_("span",{className:es.stateIcon}),_("span",{className:es.content},_(Cr,"Busy"===t?{template:"popupStateBusy"}:{template:"popupStateFree"})),_("span",{className:es.arrowIcon})),o&&_(Ql,{setOpened:r,setEventState:e=>n({type:Hl.setState,state:e})}))}const ns={popupSectionItem:Wt("popup-section-item","popup-section-location"),locationIcon:Wt("icon","ic-location"),content:Wt("content")};function os(e){let{location:t,formStateDispatch:n}=e;const o=Xl({template:"locationPlaceholder",defaultValue:"Location"});return _(Rl,null,_("div",{className:ns.popupSectionItem},_("span",{className:ns.locationIcon}),_("input",{name:"location",className:ns.content,placeholder:o,value:t,onChange:e=>{n({type:Hl.setLocation,location:e.currentTarget.value})}})))}const rs={popupSectionItem:Wt("popup-section-item","popup-section-title"),privateButton:Wt("popup-section-item","popup-section-private","popup-button"),titleIcon:Wt("icon","ic-title"),content:Wt("content")};function is(e){let{title:t,isPrivate:n=!1,formStateDispatch:o}=e;const r=Xl({template:"titlePlaceholder",defaultValue:"Subject"});return _(Rl,null,_("div",{className:rs.popupSectionItem},_("span",{className:rs.titleIcon}),_("input",{name:"title",className:rs.content,placeholder:r,value:t,onChange:e=>{o({type:Hl.setTitle,title:e.currentTarget.value})},required:!0})),_("button",{type:"button",className:rs.privateButton,onClick:()=>o({type:Hl.setPrivate,isPrivate:!n})},_("span",{className:Wt("icon",{"ic-private":n,"ic-public":!n})}),_("input",{name:"isPrivate",type:"checkbox",className:Wt("hidden-input"),value:n?"true":"false",checked:n})))}const as={popupContainer:Wt("popup-container"),formContainer:Wt("form-container"),popupArrowBorder:Wt("popup-arrow-border"),popupArrowFill:Wt("popup-arrow-fill")};function ls(){const{calendars:e}=dr(hr),{hideAllPopup:t}=fr("popup"),n=dr(El),{start:o,end:r,popupArrowPointPosition:i,close:a,isCreationPopup:l,event:s}=n??{},c=Er(),u=Cl("formPopupSlot"),[d,p]=(f=e[0]?.id,ae(Wl,{calendarId:f,...Fl}));var f;const m=ce(null),h=ce(null),[g,v]=ie({}),[y,w]=ie(0),[b,D]=ie(bl.bottom),k=Pa(),C=ue((()=>Wt("popup-arrow",{top:b===bl.top,bottom:b===bl.bottom})),[b]);if(se((()=>{if(h.current&&i&&k){const e=k.getBoundingClientRect(),t=h.current.getBoundingClientRect(),{top:n,left:o,direction:r}=function(e,t,n){let o=e.top-n.height-yl,r=e.left-n.width/2,i=bl.bottom;return o<t.top&&(i=bl.top,o=e.top+yl),Sl(o,t,n)&&(o=t.top+t.height-n.height),xl(r,t,n)&&(r=t.left+t.width-n.width),{top:o+window.scrollY,left:Math.max(r,t.left)+window.scrollX,direction:i}}(i,e,t),a=i.left-o;v({left:o,top:n}),w(a),D(r)}}),[k,i]),le((()=>{un(n)&&un(s)&&p({type:Hl.init,event:{title:n.title,location:n.location,isAllday:n.isAllday,isPrivate:n.isPrivate,calendarId:s.calendarId,state:n.eventState}})}),[e,s,p,n]),le((()=>{cn(n)&&p({type:Hl.reset})}),[p,n]),cn(o)||cn(r)||cn(u))return null;return da(_("div",{role:"dialog",className:as.popupContainer,ref:h,style:g},_("form",{onSubmit:e=>{e.preventDefault();const n=new FormData(e.target),o={...d};if(n.forEach(((e,t)=>{o[t]=function(e){return-1!==_l.indexOf(e)}(t)?"true"===e:e})),o.start=new bn(m.current?.getStartDate()),o.end=new bn(m.current?.getEndDate()),l)c.fire("beforeCreateEvent",o);else if(s){const e=function(e,t){return Object.entries(t).reduce(((t,n)=>{let[o,r]=n;const i=o;return e[i]instanceof bn?0!==Xn(e[i],r)&&(t[i]=r):e[i]!==r&&(t[i]=r),t}),{})}(s,o);c.fire("beforeUpdateEvent",{event:s.toEventObject(),changes:e})}t()}},_("div",{className:as.formContainer},e?.length?_(Bl,{selectedCalendarId:d.calendarId,calendars:e,formStateDispatch:p}):_(Rl,null),_(is,{title:d.title,isPrivate:d.isPrivate,formStateDispatch:p}),_(os,{location:d.location,formStateDispatch:p}),_(Kl,{start:o,end:r,isAllday:d.isAllday,formStateDispatch:p,ref:m}),_(ts,{eventState:d.state,formStateDispatch:p}),_(Gl,{type:"form",close:a}),_(Rl,null,_(jl,null,_(Cr,l?{template:"popupSave"}:{template:"popupUpdate"})))),_("div",{className:C},_("div",{className:as.popupArrowBorder,style:{left:y}},_("div",{className:as.popupArrowFill}))))),u)}function ss(e){return Object.values(e.popup).find((e=>un(e)))}function cs(){const e=dr(ss),{hideAllPopup:t}=fr("popup"),n=un(e);return _("div",{className:Wt("popup-overlay"),style:{display:n?"block":"none"},onClick:n=>{n.stopPropagation(),e?.close?.(),t()}})}const us={container:Wt("see-more-container"),seeMore:Wt("see-more"),header:Wt("see-more-header"),list:Wt("month-more-list")};function ds(){const e=dr(Nl),{date:t,events:n=[],popupPosition:o}=e??{},{moreView:r,moreViewTitle:i}=Zr(),a=Cl("seeMorePopupSlot"),l=Er(),s=ce(null),c=cn(t)||cn(o)||cn(a);if(le((()=>{!c&&s.current&&l.fire("clickMoreEventsBtn",{date:t.toDate(),target:s.current})}),[t,l,c]),c)return null;const u={height:Et,marginBottom:It,padding:Mt,backgroundColor:i.backgroundColor},d={ymd:Gn(t,"YYYY-MM-DD"),day:t.getDay(),date:t.getDate().toString().padStart(2,"0")},p={height:`calc(100% - ${Et+It+Nt}px)`};return da(_("div",{role:"dialog",className:us.container,style:o,ref:s},_("div",{className:us.seeMore,style:r},_("div",{className:us.header,style:u},_(Cr,{template:"monthMoreTitleDate",param:d}),_(Gl,{type:"moreEvents"})),_("div",{className:us.list,style:p},n.map((e=>_(qa,{key:`see-more-event-item-${e.cid()}`,uiModel:e,eventHeight:bt,headerHeight:Et,flat:!0})))))),a)}function ps(e,t){const n={height:zt(100)};return e&&(n.width=e),t&&(n.height=t),n}function fs(e){let{children:t,width:n,height:o,className:r="",autoAdjustPanels:i=!1}=e;const{backgroundColor:a}=Kr(Pr),[l,s]=ol(),{setLastPanelType:c,updateLayoutHeight:u}=fr("weekViewLayout"),d=ue((()=>`${Wt("layout")} ${r}`),[r]);return se((()=>{if(l){const e=()=>u(l.offsetHeight);return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}return Vo}),[l,u]),se((()=>{if(l&&i){const e=M(t),n=e[e.length-1];Ht()(n)||an()(n)||cn(n)||c(n.props.name)}}),[t,c,i,l]),_(Oa,{value:l},_("div",{ref:s,className:d,style:{...ps(n,o),backgroundColor:a}},l?t:null),_(ls,null),_(Tl,null),_(ds,null),_(cs,null))}function ms(e){let{name:t,height:n}=e;const o=function(e,t){return{height:e,width:"100%",cursor:"row-resize",borderTop:t,borderBottom:t}}(n,Kr(de((e=>e.week.panelResizer.border),[]))),r={...o,display:"none",border:"none",backgroundColor:"#999"},[i,a]=ie(r),l=ce(null),{updateDayGridRowHeightByDiff:s}=fr("weekViewLayout"),c=Ga(Ra,{onDragStart:e=>{l.current={left:e.pageX,top:e.pageY}},onDrag:e=>{if(l.current){const t=e.pageY-l.current.top;a((e=>({...e,top:t,display:null})))}},onMouseUp:e=>{if(l.current){const n=e.pageY-l.current.top;l.current=null,a(r),s({rowName:t,diff:n})}}});return _("div",{style:{position:"relative"}},_("div",{className:Wt("panel-resizer"),style:o,onMouseDown:c}),_("div",{className:Wt("panel-resizer-guide"),style:i}))}function hs(e,t){return t?Math.min(t,e):e}const gs=ea((function(e,t){let{name:n,initialWidth:o=At,initialHeight:r=At,overflowX:i,overflowY:a,maxExpandableWidth:l,maxExpandableHeight:s,minHeight:c,maxHeight:u,minWidth:d,maxWidth:p,resizerWidth:f=No,resizerHeight:m=No,resizable:h,children:g}=e;const{updateDayGridRowHeight:v}=fr("weekViewLayout"),{height:y}=dr(de((e=>e.weekViewLayout.dayGridRows[n]??{}),[n])),w=y??r;se((()=>{v({rowName:n,height:r})}),[r,n,v]);const D=function(e){let{initialHeight:t,initialWidth:n,overflowX:o,overflowY:r,maxExpandableWidth:i,maxExpandableHeight:a,minHeight:l,maxHeight:s,minWidth:c,maxWidth:u}=e;const d={};return n&&(d.width=hs(n,i),d.height="100%"),t&&(d.width="100%",d.height=hs(t,a)),o&&(d.overflowX="auto"),r&&(d.overflowY="auto"),{...d,minHeight:l,maxHeight:s,minWidth:c,maxWidth:u}}({initialWidth:o,initialHeight:w,overflowX:i,overflowY:a,maxExpandableWidth:l,maxExpandableHeight:s,minHeight:c,maxHeight:u,minWidth:d,maxWidth:p}),k=ue((()=>cn(h)||on()(h)?!!h:h.includes(n)),[h,n]);return _(b,null,_("div",{className:Wt("panel",n),style:D,ref:t},g),k?_(ms,{name:n,width:f,height:m}):null)})),vs="timegrid",ys=e=>`${vs}-${e}`,_s={second:"HH:mm:ss",minute:"HH:mm",hour:"HH:mm",date:"HH:mm",month:"MM.DD",year:"YYYY.MM.DD"},ws={time:Wt("event-time"),content:Wt("event-time-content"),travelTime:Wt("travel-time"),resizeHandleX:Wt("resize-handler-x"),moveEvent:Wt("dragging--move-event"),resizeEvent:Wt("dragging--resize-vertical-event")};function bs(e,t){return Ht()(e)?e:e>=0?`calc(${zt(e)} - ${t}px)`:""}function Ds(e){let{uiModel:t,isDraggingTarget:n,hasNextStartTime:o,calendarColor:r,minHeight:i}=e;const{top:a,left:l,height:s,width:c,duplicateLeft:u,duplicateWidth:d,goingDurationHeight:p,modelDurationHeight:f,comingDurationHeight:m,croppedStart:h,croppedEnd:g}=t,v="white",y=function(e){const{percent:t,px:n}=$t(`${e}`);return e>0||t>0||n>0?Pt:0}(l),{color:_,backgroundColor:w,borderColor:b,dragBackgroundColor:D}=Gt(t,r),k={width:bs(d||c,y),height:`calc(${zt(Math.max(s,i))} - 2px)`,top:zt(a),left:u||zt(l),borderRadius:2,borderLeft:`3px solid ${b}`,marginLeft:y,color:_,backgroundColor:n?D:w,opacity:n?.5:1,zIndex:o?1:0},C={height:zt(p),borderBottom:`1px dashed ${v}`},S={height:zt(f)},x={height:zt(m),borderTop:`1px dashed ${v}`};return h&&(k.borderTopLeftRadius=0,k.borderTopRightRadius=0),g&&(k.borderBottomLeftRadius=0,k.borderBottomRightRadius=0),{containerStyle:k,goingDurationStyle:C,modelDurationStyle:S,comingDurationStyle:x}}function ks(e){let{uiModel:t,nextStartTime:n,isResizingGuide:o=!1,minHeight:r=0}=e;const{useDetailPopup:i,isReadOnly:a,week:l}=dr(_r),s=Fa(t.model),{collapseDuplicateEvents:c}=l,u=Pa(),{showDetailPopup:d}=fr("popup"),{setDraggingEventUIModel:p}=fr("dnd"),{setSelectedDuplicateEventCid:f}=fr("weekViewLayout"),m=Er(),h=ce(null),[g,v]=ie(!1),{model:y,goingDurationHeight:w,modelDurationHeight:b,comingDurationHeight:D,croppedEnd:k}=t,{id:C,calendarId:S,customStyle:x}=y,E=un(n),{containerStyle:I,goingDurationStyle:N,modelDurationStyle:M,comingDurationStyle:T}=Ds({uiModel:t,isDraggingTarget:g,hasNextStartTime:E,calendarColor:s,minHeight:r}),A=E||o;$a(wr,(e=>{let{draggingEventUIModel:n,draggingState:r}=e;r!==So.DRAGGING||n?.cid()!==t.cid()||E||o?v(!1):v(!0)})),le((()=>{o||m.fire("afterRenderEvent",t.model.toEventObject())}),[]);const O=e=>{p(t),u?.classList.add(e)},P=e=>{v(!1),u?.classList.remove(e)},R=Ga(La.moveEvent("timeGrid",`${t.cid()}`),{onDragStart:()=>{H&&O(ws.moveEvent)},onMouseUp:(e,n)=>{let{draggingState:o}=n;P(ws.moveEvent);const r=o<=So.INIT;if(r&&c){const e=t.duplicateEvents.length>0?t.cid():Mo;f(e)}r&&i&&h.current&&d({event:t.model,eventRect:h.current.getBoundingClientRect()},!1),r&&m.fire("clickEvent",{event:t.model.toEventObject(),nativeEvent:e})},onPressESCKey:()=>P(ws.moveEvent)}),L=Ga(La.resizeEvent("timeGrid",`${t.cid()}`),{onDragStart:()=>O(ws.resizeEvent),onMouseUp:()=>P(ws.resizeEvent),onPressESCKey:()=>P(ws.resizeEvent)}),H=function(e){let{uiModel:t,isReadOnlyCalendar:n,isDraggingTarget:o,hasNextStartTime:r}=e;const{model:i}=t;return!(n||i.isReadOnly||o||r)}({uiModel:t,isReadOnlyCalendar:a,isDraggingTarget:g,hasNextStartTime:E}),F=H&&!k;return _("div",{"data-testid":`${A?"guide-":""}time-event-${y.title}-${t.cid()}`,"data-calendar-id":S,"data-event-id":C,className:ws.time,style:{...I,...x},onMouseDown:e=>{e.stopPropagation(),R(e)},ref:h},w?_("div",{className:ws.travelTime,style:N},_(Cr,{template:"goingDuration",param:y})):null,b?_("div",{className:ws.content,style:M},_(Cr,{template:"time",param:{...y.toEventObject(),start:E?n:y.start}})):null,D?_("div",{className:ws.travelTime,style:T},_(Cr,{template:"comingDuration",param:y})):null,F?_("div",{className:ws.resizeHandleX,onMouseDown:e=>{e.stopPropagation(),L(e)}}):null)}function Cs(e){let{top:t,height:n,text:o}=e;const{backgroundColor:r,border:i}=Kr(de((e=>e.common.gridSelection),[])),a=Kr(de((e=>e.week.gridSelection.color),[])),l={top:zt(t),height:zt(n),backgroundColor:r,border:i};return _("div",{className:Wt("time","grid-selection"),style:l,"data-testid":`time-grid-selection-${t}-${n}`},o.length>0?_("span",{className:Wt("grid-selection-label"),style:{color:a}},o):null)}function Ss(e){let{columnIndex:t,timeGridRows:n}=e;const o=dr(de((e=>Gi.calculateSelection(e.gridSelection.timeGrid,t,n.length-1)),[t,n])),r=ue((()=>{if(!o)return null;const{startRowIndex:e,endRowIndex:t,isStartingColumn:r,isSelectingMultipleColumns:i}=o,{top:a,startTime:l}=n[e],{top:s,height:c,endTime:u}=n[t];let d=`${l} - ${u}`;return i&&(d=r?l:""),{top:a,height:s+c-a,text:d}}),[o,n]);return cn(r)?null:_(Cs,r)}function xs(e){let{gridPositionFinder:t,totalUIModels:n,columnIndex:o,timeGridData:r}=e;const i=function(e){let{gridPositionFinder:t,totalUIModels:n,columnIndex:o,timeGridData:r}=e;const i=Er(),{isDraggingEnd:a,isDraggingCanceled:l,draggingEvent:s,clearDraggingEvent:c}=Qa("timeGrid","resize"),[u,d]=Za(t),[p,f]=ie(null),m=de((()=>{f(null),c(),d()}),[d,c]),h=ue((()=>{if(cn(s))return null;const{columns:e,rows:t}=r,o=n.map((e=>e.filter((e=>e.cid()===s.cid())))),i=(t,n)=>o=>{const i=lo(e[n].date,o.startTime),a=lo(r.columns[n].date,o.endTime);return i<=t&&t<a},a=o.findIndex((e=>e.length>0)),l=o[a][0],{goingDuration:c=0}=l.model,u=ao(l.getStarts(),-c),d=Math.max(t.findIndex(i(u,a)),0),p=Nn(o,(e=>e.length>0)),f=o[p][0],{comingDuration:m=0}=f.model,h=ao(f.getStarts(),m);let g=t.findIndex(i(h,p));return g=g>=0?g:t.length-1,{eventStartDateColumnIndex:a,eventStartDateRowIndex:d,eventEndDateColumnIndex:p,eventEndDateRowIndex:g,resizeTargetUIModelColumns:o}}),[s,r,n]),g=un(h)&&un(s)&&un(u),v=ue((()=>h?r.rows[0].height:0),[h,r.rows]);return le((()=>{if(g){const{eventStartDateRowIndex:e,eventStartDateColumnIndex:t,eventEndDateColumnIndex:n}=h;if(o===n&&t===n){const t=s.clone(),{height:n,goingDurationHeight:o,comingDurationHeight:i}=t,a=Math.max(v+o*n/100+i*n/100,r.rows[u.rowIndex].top-r.rows[e].top+v),l=o*n/a,c=i*n/a;t.setUIProps({height:a,goingDurationHeight:l,comingDurationHeight:c,modelDurationHeight:100-(l+c)}),f(t)}}}),[h,g,o,u,s,r.rows,v]),le((()=>{if(g){const{resizeTargetUIModelColumns:e,eventStartDateColumnIndex:t,eventEndDateColumnIndex:n}=h;if((o===t||o===n)&&t!==n){let n;o===t?n=e[o][0].clone():(n=s.clone(),n.setUIProps({height:r.rows[u.rowIndex].top+v})),f(n)}}}),[h,g,o,u,s,r.rows,v]),Ka((()=>{if(!l&&un(h)&&un(u)&&un(s)&&h.eventEndDateColumnIndex===o){const{comingDuration:e=0}=s.model,t=ao(lo(r.columns[o].date,r.rows[u.rowIndex].endTime),-e),n=ao(s.getStarts(),30);i.fire("beforeUpdateEvent",{event:s.model.toEventObject(),changes:{end:Kn(n,t)}})}m()}),a),p}({gridPositionFinder:t,totalUIModels:n,columnIndex:o,timeGridData:r});return cn(i)?null:_(ks,{uiModel:i,isResizingGuide:!0})}const Es={column:Wt("column"),backgrounds:Wt("background-events"),events:Wt("events")};function Is(e){let{eventUIModels:t,minEventHeight:n}=e;return _("div",{className:Es.events,style:{marginRight:8}},t.map((e=>_(ks,{key:`${e.valueOf()}-${e.cid()}`,uiModel:e,minHeight:n}))))}function Ns(e){return{defaultBackgroundColor:e.week.dayGrid.backgroundColor,todayBackgroundColor:e.week.today.backgroundColor,weekendBackgroundColor:e.week.weekend.backgroundColor}}const Ms=Zi((function(e){let{columnDate:t,columnWidth:n,columnIndex:o,totalUIModels:r,gridPositionFinder:i,timeGridData:a,isLastColumn:l}=e;const{rows:s}=a,c=Kr(de((e=>e.week.timeGrid.borderRight),[])),u=Kr(Ns),[,d]=Ar(),p=function(e){let{today:t,columnDate:n,defaultBackgroundColor:o,todayBackgroundColor:r,weekendBackgroundColor:i}=e;const a=qn(t,n),l=eo(n.getDay());return a?r:l?i:o}({today:d(),columnDate:t,...u}),f={width:n,backgroundColor:p,borderRight:l?"none":c},m=r[o],h=s[0].height;return _("div",{className:Es.column,style:f,"data-testid":`timegrid-column-${t.getDay()}`},_(Is,{eventUIModels:m,minEventHeight:h}),_(xs,{gridPositionFinder:i,totalUIModels:r,columnIndex:o,timeGridData:a}),_(Ss,{columnIndex:o,timeGridRows:s}))}));function Ts(e){return{halfHourLineBorder:e.week.timeGridHalfHourLine.borderBottom,hourLineBorder:e.week.timeGridHourLine.borderBottom}}const As=Zi((function(e){let{timeGridRows:t}=e;const{halfHourLineBorder:n,hourLineBorder:o}=Kr(Ts);return _("div",{className:Wt("gridlines")},t.map(((e,t)=>{const r=t%2==0;return _("div",{key:`gridline-${e.startTime}-${e.endTime}`,className:Wt("gridline-half"),style:{top:zt(e.top),height:zt(e.height),borderBottom:r?n:o},"data-testid":`gridline-${e.startTime}-${e.endTime}`})})))})),Os=30;function Ps(e,t){const n=e.getHours()-t,o=e.getMinutes();return 2*n+Math.floor(o/Os)}const Rs=e=>e.dnd.initX,Ls=e=>e.dnd.initY;function Hs(e){let{gridPositionFinder:t,timeGridData:n}=e;const o=dr(Rs),r=dr(Ls),i=Er(),{isDraggingEnd:a,isDraggingCanceled:l,draggingEvent:s,clearDraggingEvent:c}=Qa("timeGrid","move"),[u,d]=Za(t),p=ce(null);le((()=>{un(o)&&un(r)&&(p.current=t({clientX:o,clientY:r}))}),[t,o,r]);const f=ue((()=>cn(p.current)||cn(u)?null:{columnDiff:u.columnIndex-p.current.columnIndex,rowDiff:u.rowIndex-p.current.rowIndex}),[u]),m=ue((()=>cn(s)?null:s.getStarts()),[s]),h=de((()=>{d(),c(),p.current=null}),[d,c]),g=ue((()=>cn(f)||cn(m)?null:io(m,f.rowDiff*$n+f.columnDiff*Wn)),[f,m]),v=ue((()=>{if(cn(s)||cn(u)||cn(f))return null;const e=s.clone(),{top:t,height:o}=function(e){let{draggingEvent:t,columnDiff:n,rowDiff:o,timeGridDataRows:r,currentDate:i}=e;const a=r[0].height,l=a*r.length,s=o*$n+n*Wn,c=Number(r[0].startTime.split(":")[0]),{goingDuration:u=0,comingDuration:d=0}=t.model,p=ao(t.getStarts(),-u),f=ao(t.getEnds(),d),m=io(p,s),h=io(f,s),g=Math.max(Ps(m,c),0),v=Math.min(Ps(h,c),r.length-1),y=m.getFullYear()<i.getFullYear()||m.getMonth()<i.getMonth()||m.getDate()<i.getDate(),_=h.getFullYear()>i.getFullYear()||h.getMonth()>i.getMonth()||h.getDate()>i.getDate(),w=v-(y?0:g);return{top:y?0:r[g].top,height:_?l:Math.max(w,1)*a}}({draggingEvent:e,columnDiff:f.columnDiff,rowDiff:f.rowDiff,timeGridDataRows:n.rows,currentDate:n.columns[u.columnIndex].date});return e.setUIProps({left:n.columns[u.columnIndex].left,width:n.columns[u.columnIndex].width,top:t,height:o}),e}),[u,s,f,n.columns,n.rows]);return Ka((()=>{if(!l&&un(s)&&un(u)&&un(f)&&un(g)&&(0!==f.rowDiff||0!==f.columnDiff)){const e=s.duration(),t=io(g,e);i.fire("beforeUpdateEvent",{event:s.model.toEventObject(),changes:{start:g,end:t}})}h()}),a),{movingEvent:v,nextStartTime:g}}function Fs(e){let{gridPositionFinder:t,timeGridData:n}=e;const{movingEvent:o,nextStartTime:r}=Hs({gridPositionFinder:t,timeGridData:n});return cn(o)?null:_(ks,{uiModel:o,nextStartTime:r})}const Ws={NOW_INDICATOR:"timegrid-now-indicator",NOW_INDICATOR_LABEL:"timegrid-now-indicator-label"},zs={line:Wt(ys("now-indicator")),left:Wt(ys("now-indicator-left")),marker:Wt(ys("now-indicator-marker")),today:Wt(ys("now-indicator-today")),right:Wt(ys("now-indicator-right"))};function Bs(e){return{pastBorder:e.week.nowIndicatorPast.border,todayBorder:e.week.nowIndicatorToday.border,futureBorder:e.week.nowIndicatorFuture.border,bulletBackgroundColor:e.week.nowIndicatorBullet.backgroundColor}}function $s(e){let{top:t,columnWidth:n,columnCount:o,columnIndex:r}=e;const{pastBorder:i,todayBorder:a,futureBorder:l,bulletBackgroundColor:s}=Kr(Bs),c=Pa(),u=Er(),d=ce(null),p={left:zt(n*r),width:zt(n*r)},f={left:zt(n*(r+1)),width:zt(n*(o-r+1))};return le((()=>{const e=e=>{const t=c?.querySelector(`.${Wt("panel")}.${Wt("time")}`)??null;if(t&&d.current){const{offsetHeight:n}=t,{offsetTop:o}=d.current,r=o-n/2;t.scrollTo?t.scrollTo({top:r,behavior:e}):t.scrollTop=r}};return u.on("scrollToNow",e),()=>u.off("scrollToNow",e)}),[u,c]),le((()=>{u.fire("scrollToNow","smooth")}),[u]),_("div",{ref:d,className:zs.line,style:{top:zt(t)},"data-testid":Ws.NOW_INDICATOR},_("div",{className:zs.left,style:{width:p.width,borderTop:i}}),_("div",{className:zs.marker,style:{left:p.left,backgroundColor:s}}),_("div",{className:zs.today,style:{left:p.left,width:zt(n),borderTop:a}}),_("div",{className:zs.right,style:{left:f.left,borderTop:l}}))}const Gs={now:ys("current-time"),dayDifference:ys("day-difference")};function Us(e){let{unit:t,top:n,now:o,zonedNow:r}=e;const i=Kr(de((e=>e.week.nowIndicatorLabel.color),[])),a=ue((()=>co(r,o)),[r,o]),l={unit:t,time:r,format:_s[t]};return _("div",{className:Wt(Gs.now),style:{top:zt(n),color:i},"data-testid":Ws.NOW_INDICATOR_LABEL},0!==a&&_("span",{className:Wt(Gs.dayDifference)},`[${a>0?"+":"-"}${Math.abs(a)}]`),_(Cr,{template:"timegridNowIndicatorLabel",param:l,as:"span"}))}const js=e=>e.options.month.visibleEventCount??6,Ys=e=>e.options.week.showNowIndicator,Vs=e=>e.options.week.showTimezoneCollapseButton??!1,Xs=e=>e.options.week.timezonesCollapsed??!1,qs={timeColumn:ys("time-column"),hourRows:ys("hour-rows"),time:ys("time"),timeLabel:ys("time-label"),first:ys("time-first"),last:ys("time-last"),hidden:ys("time-hidden")};function Ks(e){return{primaryTimezoneBackgroundColor:e.week.timeGridLeft.backgroundColor,subTimezoneBackgroundColor:e.week.timeGridLeftAdditionalTimezone.backgroundColor}}function Zs(e){return{pastTimeColor:e.week.pastTime.color,futureTimeColor:e.week.futureTime.color}}function Js(e){let{rowsInfo:t,isPrimary:n,borderRight:o,width:r,nowIndicatorState:i}=e;const a=dr(Ys),{primaryTimezoneBackgroundColor:l,subTimezoneBackgroundColor:s}=Kr(Ks),{pastTimeColor:c,futureTimeColor:u}=Kr(Zs),d=un(i)?ao(i.now,t[0].diffFromPrimaryTimezone??0):null,p=n?l:s;return _("div",{role:"rowgroup",className:Wt(qs.hourRows),style:{width:zt(r),borderRight:o,backgroundColor:p}},t.map((e=>{let{date:t,top:o,className:r}=e;const i=un(d)&&t<d?c:u;return _("div",{key:t.getTime(),className:r,style:{top:zt(o),color:i},role:"row"},_(Cr,{template:`timegridDisplay${n?"Primary":""}Time`,param:{time:t},as:"span"}))})),a&&un(i)&&un(d)&&_(Us,{unit:"hour",top:i.top,now:i.now,zonedNow:d}))}const Qs=Zi((function(e){let{timeGridRows:t,nowIndicatorState:n}=e;const o=dr(Ys),r=dr(Mr),i=dr(Xs),a=Tr(),{width:l,borderRight:s}=Kr(Hr),c=ue((()=>t.filter(((e,n)=>n%2==0||n===t.length-1))),[t]),u=de(((e,t,r)=>{const i=0===t,a=t===c.length-1,l=Wt(qs.time,{[qs.first]:i,[qs.last]:a,[qs.hidden]:(e=>{let{top:t,height:r}=e;if(!o||cn(n))return!1;const i=n.top;return t-r<=i&&i<=t+r})(e)});let s=lo(new bn,a?e.endTime:e.startTime);return un(r)&&(s=ao(s,r)),{date:s,top:e.top,className:l,diffFromPrimaryTimezone:r}}),[c,n,o]),[d,...p]=r,f=p.length>0?100/(p.length+1):100,m=c.map(((e,t)=>u(e,t))),h=ue((()=>0===p.length?[]:p.reverse().map((e=>{const{timezoneName:t}=e,n=a(d.timezoneName).getTimezoneOffset(),o=a(t).getTimezoneOffset()-n;return c.map(((e,t)=>u(e,t,o)))}))),[u,p,d,c,a]);return _("div",{className:Wt(qs.timeColumn),style:{width:l},"data-testid":"timegrid-time-column"},!i&&h.map((e=>_(Js,{key:e[0].diffFromPrimaryTimezone,rowsInfo:e,isPrimary:!1,borderRight:s,width:f,nowIndicatorState:n}))),_(Js,{rowsInfo:m,isPrimary:!0,borderRight:s,width:i?100:f,nowIndicatorState:n}))}));function ec(e,t,n){const o=t.getTime(),r=n.getTime(),i=_i(e.getTime(),[o],[r])-o;return _i(wi(r-o,100,i),[0],[100])}function tc(e,t,n,o){const r=ec(e,n,o);return{top:r,height:ec(t,n,o)-r}}const nc=1;function oc(e,t){return n=>{const{goingDuration:o=0,comingDuration:r=0}=n.model,i=ao(n.getStarts(),-o);return!(ao(n.getEnds(),r)<=e||i>=t)}}function rc(e,t){const{startColumnTime:n,endColumnTime:o,baseWidth:r,columnIndex:i,renderStart:a,renderEnd:l}=t,{duplicateEvents:s}=e,{top:c,height:u}=tc(a,l,n,o),d={top:c,left:r*i,width:r,height:Math.max(nc,u),duplicateLeft:"",duplicateWidth:""};s.length>0&&(d.duplicateLeft=function(e,t){const{duplicateEvents:n,duplicateEventIndex:o}=e,r=n[o-1];let i=t;if(r){const{percent:e,px:t}=$t(`${r.duplicateLeft}`),{percent:n,px:o}=$t(`${r.duplicateWidth}`),a=e+n,l=t+o+Pt;i=0!==a?`calc(${zt(a)} ${l>0?"+":"-"} ${Bt(Math.abs(l))})`:Bt(l)}else i=zt(i);return i}(e,d.left),d.duplicateWidth=function(e,t){const{collapse:n}=e;return n?`${Rt}px`:`calc(${zt(t)} - ${Bt((Rt+Pt)*(e.duplicateEvents.length-1)+Pt)})`}(e,d.width)),e.setUIProps(d)}function ic(e){let{uiModel:t,columnIndex:n,baseWidth:o,startColumnTime:r,endColumnTime:i,isDuplicateEvent:a=!1}=e;if(!a&&t.duplicateEvents.length>0)return void t.duplicateEvents.forEach((e=>{ic({uiModel:e,columnIndex:n,baseWidth:o,startColumnTime:r,endColumnTime:i,isDuplicateEvent:!0})}));const l=function(e,t,n,o,r){const{goingDuration:i=0,comingDuration:a=0}=e.model,l=e.getStarts(),s=e.getEnds(),c=ao(l,-i),u=ao(s,a);return{baseWidth:n,columnIndex:t,modelStart:l,modelEnd:s,renderStart:Kn(c,o),renderEnd:Zn(u,r),goingStart:c,comingEnd:u,startColumnTime:o,endColumnTime:r,duplicateEvents:e.duplicateEvents}}(t,n,o,r,i);rc(t,l),function(e,t){const{renderStart:n,renderEnd:o,modelStart:r,modelEnd:i}=t,{goingDuration:a=0,comingDuration:l=0}=e.model;let s=100;if(a>0){const{height:t}=tc(n,r,n,o);e.goingDurationHeight=t,s-=t}if(l>0){const{height:t}=tc(i,o,n,o);e.comingDurationHeight=t,s-=t}e.modelDurationHeight=s}(t,l),function(e,t){const{goingStart:n,comingEnd:o,startColumnTime:r,endColumnTime:i}=t;n<r&&(e.croppedStart=!0),o>i&&(e.croppedEnd=!0)}(t,l)}function ac(e,t,n,o,r){const i=e.filter(ho).filter(oc(t,n)).sort(xn.compare.event.asc);r&&function(e,t,n){const{getDuplicateEvents:o,getMainEvent:r}=t,i=e.map((e=>e.model.toEventObject()));e.forEach((t=>{if(t.collapse||t.duplicateEvents.length>0)return;const a=o(t.model.toEventObject(),i);if(a.length<=1)return;const l=r(a),s=a.map((t=>e.find((e=>e.cid()===t.__cid)))),c=!!(n>Mo&&a.find((e=>e.__cid===n))),u=a.reduce(((e,t)=>{let{start:n,goingDuration:o}=t;return Zn(e,ao(n,-o))}),a[0].start),d=a.reduce(((e,t)=>{let{end:n,comingDuration:o}=t;return Kn(e,ao(n,o))}),a[0].end);s.forEach(((e,t)=>{const o=e.cid()===l.__cid,r=!(c&&e.cid()===n||!c&&o);e.setUIProps({duplicateEvents:s,duplicateEventIndex:t,collapse:r,isMain:o,duplicateStarts:u,duplicateEnds:d})}))}))}(i,r,o);const a=i.filter((e=>!e.collapse)),l=!0;return ii(vo(...a),oi(a,l),l).forEach((e=>{const o=Math.max(...e.map((e=>e.length))),r=Math.round(100/o);e.forEach((e=>{e.forEach(((e,o)=>{ic({uiModel:e,columnIndex:o,baseWidth:r,startColumnTime:t,endColumnTime:n})}))}))})),i}const lc={timegrid:Wt(vs),scrollArea:Wt(ys("scroll-area"))};function sc(e){let{timeGridData:t,events:n}=e;const{isReadOnly:o,week:{narrowWeekend:r,startDayOfWeek:i,collapseDuplicateEvents:a}}=dr(_r),l=dr(Ys),s=dr((e=>e.weekViewLayout.selectedDuplicateEventCid)),[,c]=Ar(),u=function(){const e=ce(!0);return le((()=>()=>{e.current=!1}),[]),de((()=>e.current),[])}(),{width:d}=Kr(Hr),[p,f]=ie(null),{columns:m,rows:h}=t,g=m.length-1,v=ue((()=>m.map((e=>{let{date:t}=e;return n.filter(oc(jn(t),Qn(t))).map((e=>e.clone()))})).map(((e,t)=>ac(e,lo(m[t].date,En(h).startTime),lo(m[t].date,In(h).endTime),s,a)))),[m,h,n,s,a]),y=ue((()=>{const e=c(),n=m.findIndex((t=>qn(t.date,e)));if(n<0)return null;return{startTime:lo(m[n].date,t.rows[0].startTime),endTime:lo(m[n].date,In(t.rows).endTime),currentDateIndex:n}}),[m,c,t.rows]),[w,b]=ol(),D=ue((()=>Wi({rowsCount:h.length,columnsCount:m.length,container:w,narrowWeekend:r,startDayOfWeek:i})),[m.length,w,r,h.length,i]),k=ll({type:"timeGrid",gridPositionFinder:D,selectionSorter:Gi.sortSelection,dateGetter:Gi.getDateFromCollection,dateCollection:t}),C=de((()=>{if(un(y)){const{startTime:e,endTime:t}=y,n=c();e<=n&&n<=t&&f({top:ec(n,e,t),now:n})}}),[y,c]);return se((()=>{u()&&((y?.currentDateIndex??-1)>=0?C():f(null))}),[y,u,C]),function(e,t){const n=ce(e);le((()=>{n.current=e}),[e]),le((()=>{const e=t??-1;if(e>0){const t=setInterval((()=>n.current()),e);return()=>clearInterval(t)}}),[t])}(C,un(y)?zn:null),_("div",{className:lc.timegrid},_("div",{className:lc.scrollArea},_(Qs,{timeGridRows:h,nowIndicatorState:p}),_("div",{className:Wt("columns"),style:{left:d},ref:b,onMouseDown:Ua(!o,k)},_(As,{timeGridRows:h}),_(Fs,{gridPositionFinder:D,timeGridData:t}),m.map(((e,n)=>_(Ms,{key:e.date.toString(),timeGridData:t,columnDate:e.date,columnWidth:zt(e.width),columnIndex:n,totalUIModels:v,gridPositionFinder:D,isLastColumn:n===g}))),l&&un(y)&&un(p)?_($s,{top:p.top,columnWidth:m[0].width,columnCount:m.length,columnIndex:y.currentDateIndex}):null)))}function cc(e){let{isCollapsed:t}=e;const n=Er(),o=Wt("icon",{"ic-arrow-right":t,"ic-arrow-left":!t});return _("button",{className:Wt(ys("timezone-collapse-button")),"aria-expanded":!t,onClick:()=>n.fire("clickTimezonesCollapseBtn",t)},_("span",{className:o,role:"img"}))}function uc(){return uc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},uc.apply(this,arguments)}function dc(e){let{label:t,offset:n,tooltip:o,width:r=100,left:i}=e;return _("div",{title:o,className:Wt(ys("timezone-label")),style:{width:zt(r),height:zt(100),left:zt(i)},role:"gridcell"},_(Cr,{template:"timezoneDisplayLabel",param:{displayLabel:t,timezoneOffset:n},as:"span"}))}function pc(e){let{top:t}=e;const n=dr(Mr),{width:o}=Kr(Hr),r=Tr(),{showTimezoneCollapseButton:i,timezonesCollapsed:a}=function(){const e=dr(Vs),t=dr(Xs);return ue((()=>({showTimezoneCollapseButton:e,timezonesCollapsed:t})),[e,t])}();if(n.length<=1)return null;const l=n.map((e=>{let{displayLabel:t,timezoneName:n,tooltip:o}=e;return tn()(t)?{label:null,offset:r(n).getTimezoneOffset(),tooltip:o??n}:{label:t,offset:null,tooltip:o??n}})),[s,...c]=l,u=c.reverse(),d=100/(a?1:n.length);return _("div",{style:{top:t,width:o},role:"columnheader",className:Wt("timezone-labels-slot")},!a&&u.map(((e,t)=>_(dc,uc({key:`subTimezone-${e.label??e.offset}`,width:d,left:d*t},e)))),i&&_(cc,{isCollapsed:a}),_(dc,uc({width:d,left:d*u.length},s)))}const fc={MONTH:"month",WEEK:"week",DAY:"day"},mc=["milestone","task"],hc=["allday","time"];function gc(e,t){const n=[];return!0===e?n.push(...mc):Array.isArray(e)&&n.push(...e),!0===t?n.push(...hc):Array.isArray(t)&&n.push(...t),n}function vc(e){const t=dr(Ir),n=Tr();return ue((()=>{if("Local"===t)return e;const o=hn(new bn),{timedEvents:r=vo(),totalEvents:i=vo()}=e.groupBy((e=>"time"===e.category?"timedEvents":"totalEvents"));return r.each((e=>{const r=(a=e,Object.assign(Object.create(Object.getPrototypeOf(a)),a));var a;let l=n(t,r.start),s=n(t,r.end);o?(hn(l)||(l=l.addHours(1)),hn(s)||(s=s.addHours(1))):(hn(l)&&(l=l.addHours(-1)),hn(s)&&(s=s.addHours(-1))),r.start=l,r.end=s,i.add(r)})),i}),[e,t,n])}function yc(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];const r=vc(ue((()=>e.events.filter(go.and(...n))),[e.events,n]));return ue((()=>({...e,events:r})),[e,r])}function _c(e,t){$a(wr,(n=>{let{y:o,draggingItemType:r,draggingState:i}=n;if(un(e)&&function(e){return/^(event|gridSelection)\/timeGrid/.test(e??"")}(r)&&i===So.DRAGGING&&un(o)){const{offsetTop:n,offsetHeight:r,scrollHeight:i}=e,a=Math.floor(i/t),l=n+r;if(o<n+a){const t=o-(n+a);e.scrollTop=Math.max(0,e.scrollTop+t)}else if(o>l-a){const t=o-(l-a);e.scrollTop=Math.min(r,e.scrollTop+t)}}}))}function wc(e){return e.weekViewLayout?.dayGridRows?.time?.height}function bc(e){const t=dr(wc),[n,o]=ie(null);return se((()=>{un(t)&&e&&o(e.offsetTop)}),[t,e]),n}function Dc(e){let{rowIndex:t,weekDates:n,narrowWeekend:o}=e;const r=dr(de((e=>e.gridSelection.accumulated.dayGridMonth.map((e=>Ui.calculateSelection(e,t,n.length)))),[t,n]));return _("div",{className:Wt("accumulated-grid-selection")},r.map((e=>e?_(Bi,{type:"accumulated",gridSelectionData:e,weekDates:n,narrowWeekend:o}):null)))}function kc(e){let{type:t,number:n,onClickButton:o,className:r}=e;const{reset:i}=fr("dnd");return _("button",{type:"button",onMouseDown:e=>{e.stopPropagation()},onClick:()=>{i(),o()},className:r},_(Cr,{template:`monthGrid${t===ni.header?"Header":"Footer"}Exceed`,param:n}))}function Cc(e){let{date:t,theme:n,renderDate:o,isToday:r}=e;const i=t.getDay(),a=o.getMonth()===t.getMonth(),{common:{holiday:l,saturday:s,today:c,dayName:u},month:{dayExceptThisMonth:d,holidayExceptThisMonth:p}}=n;return r?c.color:to(i)?a?l.color:p.color:no(i)?a?s.color:d.color:a?u.color:d.color}function Sc(){const e=Kr(Pr),t=Zr();return ue((()=>({common:e,month:t})),[e,t])}function xc(e){let{type:t=ni.header,exceedCount:n=0,date:o,onClickExceedCount:r}=e;const{renderDate:i}=dr(yr),[,a]=Ar(),l=Sc(),s=l.month.gridCell[`${t}Height`],c=Gn(o,"YYYYMMDD"),u=Gn(a(),"YYYYMMDD"),d=c===u,p={date:Gn(o,"YYYY-MM-DD"),day:o.getDay(),hiddenEventCount:n,isOtherMonth:o.getMonth()!==i.getMonth(),isToday:c===u,month:o.getMonth(),ymd:c},f={color:Cc({date:o,theme:l,isToday:d,renderDate:i})},m=`monthGrid${Oo(t)}`;return cn(s)?null:_("div",{className:Wt(`grid-cell-${t}`),style:{height:s}},_("span",{className:Wt("grid-cell-date"),style:f},_(Cr,{template:m,param:p})),n?_(kc,{type:t,number:n,onClickButton:r,className:Wt("grid-cell-more-events")}):null)}function Ec(e){let{layoutContainer:t,cell:n,popupSize:o}=e;const r=function(e,t,n){const{width:o,height:r,left:i,top:a}=t,{width:l,height:s}=e,c=i+o,u=a+r;let d=n.left+n.width/2-l/2,{top:p}=n;const f=d+l>c,m=p+s>u;return d<i&&(d=i),f&&(d=c-l),p<a&&(p=a),m&&(p=u-s),{top:p+window.scrollY,left:d+window.scrollX}}(o,t.getBoundingClientRect(),n.getBoundingClientRect());return{...o,...r}}function Ic(e,t,n){const{width:o,height:r}=Kr(Fr),[i,a]=ol(),[l,s]=ie(null);return le((()=>{if(n&&t&&i){const a=function(e){let{grid:t,offsetWidth:n,eventLength:o,layerSize:r}=e;const i=Zo(t).height+2*St;let a=n+2*St;const{width:l,height:s}=r;a=Math.max(a,xt);let c=Et+It+St;const u=bt+Dt;return c+=o<=10?u*o:10*u,l&&(a=l),s&&(c=s),(isNaN(c)||c<i)&&(c=i),{width:a,height:c}}({grid:t,offsetWidth:i.offsetWidth,eventLength:e,layerSize:{width:o,height:r}}),l=Ec({cell:i,layoutContainer:n,popupSize:a});s(l)}}),[n,i,e,t,o,r]),{popupPosition:l,containerRefCallback:a}}function Nc(e){return e.month.weekend.backgroundColor}function Mc(e){let{date:t,events:n=[],style:o,parentContainer:r,contentAreaHeight:i}=e;const a=Pa(),{showSeeMorePopup:l}=fr("popup"),s=Kr(Nc),{popupPosition:c,containerRefCallback:u}=Ic(n.length,r,a),d=de((()=>{c&&l({date:t,popupPosition:c,events:n})}),[t,n,c,l]),p=Si(n,i,bt+Dt);return _("div",{className:Wt("daygrid-cell"),style:{...o,backgroundColor:eo(t.getDay())?s:"inherit"},ref:u},_(xc,{type:ni.header,exceedCount:p,date:t,onClickExceedCount:d}),_(xc,{type:ni.footer,exceedCount:p,date:t,onClickExceedCount:d}))}const Tc=Zi((function(e){let{week:t,rowInfo:n,gridDateEventModelMap:o={},contentAreaHeight:r}=e;const[i,a]=ol(),l=Kr(de((e=>e.common.border),[]));return _("div",{className:Wt("weekday-grid"),style:{borderTop:l},ref:a},t.map(((e,t)=>{const a=e.getDay(),{width:l,left:s}=n[t],c=Gn(jn(e),"YYYYMMDD");return _(Mc,{key:`daygrid-cell-${a}`,date:e,style:{width:zt(l),left:zt(s)},parentContainer:i,events:o[c],contentAreaHeight:r})})))}));function Ac(e){let{weekDates:t,narrowWeekend:n,rowIndex:o}=e;const r=dr(de((e=>Ui.calculateSelection(e.gridSelection.dayGridMonth,o,t.length)),[o,t.length]));return cn(r)?null:_(Bi,{type:"month",gridSelectionData:r,weekDates:t,narrowWeekend:n})}const Oc=Zi((function(e){let{contentAreaHeight:t,eventHeight:n=Di,events:o,name:r,className:i}=e;const{headerHeight:a}=Kr(Wr),l=o.filter(Ci(t,n+Dt)).map((e=>_(qa,{key:`${r}-DayEvent-${e.cid()}`,uiModel:e,eventHeight:n,headerHeight:a??Ct})));return _("div",{className:i},l)}));function Pc(e){let{dateMatrix:t,gridPositionFinder:n,rowInfo:o,rowIndex:r}=e;const i=function(e){let{dateMatrix:t,rowInfo:n,gridPositionFinder:o,rowIndex:r}=e;const i=Er(),{isDraggingEnd:a,isDraggingCanceled:l,draggingEvent:s,clearDraggingEvent:c}=Qa("dayGrid","move"),[u,d]=Za(o),p=ue((()=>{let e=null;return s&&u?.rowIndex===r&&(e=s,e.left=n[u?.columnIndex??0].left,e.width=n[u?.columnIndex??0].width),e}),[s,u?.rowIndex,u?.columnIndex,r,n]);return Ka((()=>{if(!l&&un(p)&&un(u)){const e=p.model.getStarts(),n=p.duration(),o=co(t[u.rowIndex][u.columnIndex],e)*Wn,r=new bn(e.getTime()+o),a=new bn(r.getTime()+n);i.fire("beforeUpdateEvent",{event:p.model.toEventObject(),changes:{start:r,end:a}})}c(),d()}),a),p}({dateMatrix:t,rowInfo:o,gridPositionFinder:n,rowIndex:r});return cn(i)?null:_(qa,{uiModel:i,movingLeft:i.left,eventHeight:Di,headerHeight:kt+Ct})}function Rc(e,t){return{startColumnIndex:Math.max(Ii(e.getStarts(),t),0),endColumnIndex:Ii(e.getEnds(),t)}}function Lc(e){let{dateMatrix:t,cellWidthMap:n,gridPositionFinder:o,renderedUIModels:r,rowIndex:i}=e;const a=function(e){let{dateMatrix:t,gridPositionFinder:n,renderedUIModels:o,cellWidthMap:r,rowIndex:i}=e;const a=Er(),{isDraggingEnd:l,isDraggingCanceled:s,draggingEvent:c,clearDraggingEvent:u}=Qa("dayGrid","resize"),[d,p]=Za(n),[f,m]=ie(null),h=de((()=>{m(null),p(),u()}),[p,u]),g=ue((()=>{if(cn(c))return null;const e=o.map((e=>{let{uiModels:t}=e;return t.filter((e=>e.cid()===c.cid()))})),n=e.findIndex((e=>e.length>0)),r=Nn(e,(e=>e.length>0)),i=Rc(e[n][0],t[n]),a=Rc(e[r][0],t[r]);return{eventStartDateColumnIndex:i.startColumnIndex,eventStartDateRowIndex:n,eventEndDateColumnIndex:a.endColumnIndex,eventEndDateRowIndex:r,resizeTargetUIModelRows:e}}),[t,o,c]),v=un(g)&&un(c)&&un(d);return le((()=>{if(v&&i===g.eventStartDateRowIndex){const{eventStartDateRowIndex:e,eventStartDateColumnIndex:n}=g,o=g.resizeTargetUIModelRows[e][0].clone();let a;e===d.rowIndex?a=r[n][Math.max(n,d.columnIndex)]:e>d.rowIndex?a=r[n][n]:(a=r[n][t[i].length-1],o.setUIProps({exceedRight:!0})),m([o,a])}}),[g,v,r,d,t,i]),le((()=>{if(v&&g.eventStartDateRowIndex<i&&i<d.rowIndex){const e=c.clone();e.setUIProps({left:0,exceedLeft:!0,exceedRight:!0}),m([e,"100%"])}}),[g,v,d,c,i]),le((()=>{if(v&&g.eventStartDateRowIndex<d.rowIndex&&i===d.rowIndex){const e=c.clone();e.setUIProps({left:0,exceedLeft:!0}),m([e,r[0][d.columnIndex]])}}),[g,v,r,d,c,i]),le((()=>{v&&i>g.eventStartDateRowIndex&&i>d.rowIndex&&m(null)}),[v,d,g,i]),Ka((()=>{if(v){const{eventStartDateColumnIndex:e,eventStartDateRowIndex:n}=g;if(!s&&(d.rowIndex===n&&d.columnIndex>=e||d.rowIndex>n)){const e=t[d.rowIndex][d.columnIndex];a.fire("beforeUpdateEvent",{event:c.model.toEventObject(),changes:{end:e}})}}h()}),l),f}({dateMatrix:t,gridPositionFinder:o,cellWidthMap:n,renderedUIModels:r,rowIndex:i});if(cn(a))return null;const[l,s]=a;return _("div",{className:Wt("weekday-events")},_(qa,{key:`resizing-event-${l.cid()}`,uiModel:l,eventHeight:bt,headerHeight:kt+Ct,resizingWidth:s}))}const Hc=100;function Fc(e){let{dateMatrix:t=[],rowInfo:n=[],cellWidthMap:o=[]}=e;const[r,i]=ol(),a=dr(hr),{ref:l,cellContentAreaHeight:s}=function(e){const t=dr(js),{headerHeight:n,footerHeight:o}=Kr(Wr),r=ce(null),[i,a]=ie(0);return le((()=>{if(r.current){const i=Zo(r.current).height-(kt+(n??Ct))-(o??0),l=t*(e+Dt);a(Math.min(i,l))}}),[o,n,e,t]),{ref:r,cellContentAreaHeight:i}}(bt),{eventFilter:c,month:u,isReadOnly:d}=dr(_r),{narrowWeekend:p,startDayOfWeek:f}=u,m=Hc/t.length,h=ue((()=>Wi({container:r,rowsCount:t.length,columnsCount:t[0].length,narrowWeekend:p,startDayOfWeek:f})),[t,r,p,f]),g=yc(a,c),v=ue((()=>t.map((e=>Ti(e,g,p)))),[g,t,p]);return _("div",{ref:i,onMouseDown:Ua(!d,ll({type:"dayGridMonth",gridPositionFinder:h,dateCollection:t,dateGetter:Ui.getDateFromCollection,selectionSorter:Ui.sortSelection})),className:Wt("month-daygrid")},t.map(((e,r)=>{const{uiModels:i,gridDateEventModelMap:a}=v[r];return _("div",{key:`dayGrid-events-${r}`,className:Wt("month-week-item"),style:{height:zt(m)},ref:l},_("div",{className:Wt("weekday")},_(Tc,{gridDateEventModelMap:a,week:e,rowInfo:n,contentAreaHeight:s}),_(Oc,{name:"month",events:i,contentAreaHeight:s,eventHeight:bt,className:Wt("weekday-events")}),_(Ac,{weekDates:e,narrowWeekend:p,rowIndex:r}),_(Dc,{rowIndex:r,weekDates:e,narrowWeekend:p})),_(Lc,{dateMatrix:t,gridPositionFinder:h,rowIndex:r,cellWidthMap:o,renderedUIModels:v}),_(Pc,{dateMatrix:t,gridPositionFinder:h,rowIndex:r,rowInfo:n}))})))}const Wc={month:function(){const e=dr(_r),{renderDate:t}=dr(yr),n=function(e){const{dayNames:t,startDayOfWeek:n,workweek:o}=e.month,r=[...Array(7)].map(((e,t)=>(n+t)%7)),i=r.map((e=>({day:e,label:Oo(t[e])})));return i.filter((e=>!o||!eo(e.day)))}(e),o=e.month,{narrowWeekend:r,startDayOfWeek:i,workweek:a}=o,l=ue((()=>Li(t,o)),[o,t]),{rowStyleInfo:s,cellWidthMap:c}=ue((()=>ro(n.length,r,i,a)),[n.length,r,i,a]),u=s.map(((e,t)=>({...e,date:l[0][t]})));return _(fs,{className:Wt("month")},_(ei,{type:"month",dayNames:n,options:o,rowStyleInfo:s}),_(Fc,{dateMatrix:l,rowInfo:u,cellWidthMap:c}))},week:function(){const{options:e,calendar:t,gridRowLayout:n,lastPanelType:o,renderDate:r}=function(){const e=dr(_r),t=dr(hr),{dayGridRows:n,lastPanelType:o}=dr(gr),{renderDate:r}=dr(yr);return ue((()=>({options:e,calendar:t,gridRowLayout:n,lastPanelType:o,renderDate:r})),[t,n,o,e,r])}(),i=Kr(de((e=>e.week.dayGridLeft.width),[])),a=dr(Ir),[l,s]=ol(),c=e.week,{narrowWeekend:u,startDayOfWeek:d,workweek:p,hourStart:f,hourEnd:m,eventView:h,taskView:g}=c,v=ue((()=>Hi(r,c)),[r,c]),y=Lo(v,e.week?.dayNames??[]),{rowStyleInfo:w,cellWidthMap:b}=ro(v.length,u,d,p),D=yc(t,e.eventFilter),k=ue((()=>{const[e,t]="Local"===a?[jn(En(v)),Qn(In(v))]:[jn(so(En(v),-1)),Qn(so(In(v),1))];return Ri(v,D,{narrowWeekend:u,hourStart:f,hourEnd:m,weekStartDate:e,weekEndDate:t})}),[D,m,f,u,a,v]),C=ue((()=>Fi(v,{hourStart:f,hourEnd:m,narrowWeekend:u})),[m,f,u,v]),S=gc(g,h),x=S.map((e=>{if("time"===e)return null;const t=e;return _(gs,{name:t,key:t,resizable:t!==o},"allday"===t?_(cl,{events:k[t],rowStyleInfo:w,gridColWidthMap:b,weekDates:v,height:n[t]?.height,options:c}):_(ul,{category:t,events:k[t],weekDates:v,height:n[t]?.height,options:c,gridColWidthMap:b}))})),E=ue((()=>S.includes("time")),[S]);_c(l,C.rows.length);const I=bc(l);return _(fs,{className:Wt("week-view"),autoAdjustPanels:!0},_(gs,{name:"week-view-day-names",initialHeight:44},_(ei,{type:"week",dayNames:y,marginLeft:i,options:c,rowStyleInfo:w})),x,E?_(gs,{name:"time",autoSize:1,ref:s},_(sc,{events:k.time,timeGridData:C}),_(pc,{top:I})):null)},day:function(){const{calendar:e,options:t,gridRowLayout:n,lastPanelType:o,renderDate:r}=function(){const e=dr(hr),t=dr(_r),{dayGridRows:n,lastPanelType:o}=dr(gr),{renderDate:r}=dr(yr);return ue((()=>({calendar:e,options:t,gridRowLayout:n,lastPanelType:o,renderDate:r})),[e,t,n,o,r])}(),i=dr(Ir),a=Kr(de((e=>e.week.dayGridLeft.width),[])),[l,s]=ol(),c=t.week,{narrowWeekend:u,startDayOfWeek:d,workweek:p,hourStart:f,hourEnd:m,eventView:h,taskView:g}=c,v=ue((()=>[r]),[r]),y=Lo(v,t.week?.dayNames??[]),{rowStyleInfo:w,cellWidthMap:b}=ro(v.length,u,d,p),D=yc(e,t.eventFilter),k=ue((()=>{const[e,t]="Local"===i?[jn(v[0]),Qn(v[0])]:[jn(so(v[0],-1)),Qn(so(v[0],1))];return Ri(v,D,{narrowWeekend:u,hourStart:f,hourEnd:m,weekStartDate:e,weekEndDate:t})}),[D,v,m,f,u,i]),C=ue((()=>Fi(v,{hourStart:f,hourEnd:m,narrowWeekend:u})),[v,m,f,u]),S=gc(g,h),x=S.map((e=>{if("time"===e)return null;const t=e;return _(gs,{key:t,name:t,resizable:t!==o},"allday"===t?_(cl,{events:k[t],rowStyleInfo:w,gridColWidthMap:b,weekDates:v,height:n[t]?.height,options:c}):_(ul,{category:t,events:k[t],weekDates:v,height:n[t]?.height,options:c,gridColWidthMap:b}))}));_c(l,C.rows.length);const E=bc(l);return _(fs,{className:Wt("day-view"),autoAdjustPanels:!0},_(gs,{name:"day-view-day-names",initialHeight:43},_(ei,{type:"week",dayNames:y,marginLeft:a,rowStyleInfo:w})),x,S.includes("time")?_(gs,{name:"time",autoSize:1,ref:s},_(sc,{events:k.time,timeGridData:C}),_(pc,{top:E})):null)}};function zc(){const{currentView:e}=dr(yr);return _(ue((()=>Wc[e]||(()=>null)),[e]),null)}var Bc=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|^--/i,$c=/^(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/,Gc=/[\s\n\\/='"\0<>]/,Uc=/^xlink:?./,jc=/["&<]/;function Yc(e){if(!1===jc.test(e+=""))return e;for(var t=0,n=0,o="",r="";n<e.length;n++){switch(e.charCodeAt(n)){case 34:r=""";break;case 38:r="&";break;case 60:r="<";break;default:continue}n!==t&&(o+=e.slice(t,n)),o+=r,t=n+1}return n!==t&&(o+=e.slice(t,n)),o}var Vc=function(e,t){return String(e).replace(/(\n+)/g,"$1"+(t||"\t"))},Xc=function(e,t,n){return String(e).length>(t||40)||!n&&-1!==String(e).indexOf("\n")||-1!==String(e).indexOf("<")},qc={},Kc=/([A-Z])/g;function Zc(e){var t="";for(var n in e){var o=e[n];null!=o&&""!==o&&(t&&(t+=" "),t+="-"==n[0]?n:qc[n]||(qc[n]=n.replace(Kc,"-$1").toLowerCase()),t="number"==typeof o&&!1===Bc.test(n)?t+": "+o+"px;":t+": "+o+";")}return t||void 0}function Jc(e,t){return Array.isArray(t)?t.reduce(Jc,e):null!=t&&!1!==t&&e.push(t),e}function Qc(){this.__d=!0}function eu(e,t){return{__v:e,context:t,props:e.props,setState:Qc,forceUpdate:Qc,__d:!0,__h:[]}}function tu(e,t){var n=e.contextType,o=n&&t[n.__c];return null!=n?o?o.props.value:n.__:t}var nu=[];function ou(e,n,o,r,i,a){if(null==e||"boolean"==typeof e)return"";if("object"!=typeof e)return"function"==typeof e?"":Yc(e);var l=o.pretty,s=l&&"string"==typeof l?l:"\t";if(Array.isArray(e)){for(var c="",u=0;u<e.length;u++)l&&u>0&&(c+="\n"),c+=ou(e[u],n,o,r,i,a);return c}if(void 0!==e.constructor)return"";var d,p=e.type,f=e.props,m=!1;if("function"==typeof p){if(m=!0,!o.shallow||!r&&!1!==o.renderRootComponent){if(p===b){var h=[];return Jc(h,e.props.children),ou(h,n,o,!1!==o.shallowHighOrder,i,a)}var g,v=e.__c=eu(e,n);t.__b&&t.__b(e);var y=t.__r;if(p.prototype&&"function"==typeof p.prototype.render){var _=tu(p,n);(v=e.__c=new p(f,_)).__v=e,v._dirty=v.__d=!0,v.props=f,null==v.state&&(v.state={}),null==v._nextState&&null==v.__s&&(v._nextState=v.__s=v.state),v.context=_,p.getDerivedStateFromProps?v.state=Object.assign({},v.state,p.getDerivedStateFromProps(v.props,v.state)):v.componentWillMount&&(v.componentWillMount(),v.state=v._nextState!==v.state?v._nextState:v.__s!==v.state?v.__s:v.state),y&&y(e),g=v.render(v.props,v.state,v.context)}else for(var w=tu(p,n),D=0;v.__d&&D++<25;)v.__d=!1,y&&y(e),g=p.call(e.__c,f,w);return v.getChildContext&&(n=Object.assign({},n,v.getChildContext())),t.diffed&&t.diffed(e),ou(g,n,o,!1!==o.shallowHighOrder,i,a)}p=(d=p).displayName||d!==Function&&d.name||function(e){var t=(Function.prototype.toString.call(e).match(/^\s*function\s+([^( ]+)/)||"")[1];if(!t){for(var n=-1,o=nu.length;o--;)if(nu[o]===e){n=o;break}n<0&&(n=nu.push(e)-1),t="UnnamedComponent"+n}return t}(d)}var k,C,S="<"+p;if(f){var x=Object.keys(f);o&&!0===o.sortAttributes&&x.sort();for(var E=0;E<x.length;E++){var I=x[E],N=f[I];if("children"!==I){if(!Gc.test(I)&&(o&&o.allAttributes||"key"!==I&&"ref"!==I&&"__self"!==I&&"__source"!==I)){if("defaultValue"===I)I="value";else if("defaultChecked"===I)I="checked";else if("defaultSelected"===I)I="selected";else if("className"===I){if(void 0!==f.class)continue;I="class"}else i&&Uc.test(I)&&(I=I.toLowerCase().replace(/^xlink:?/,"xlink:"));if("htmlFor"===I){if(f.for)continue;I="for"}"style"===I&&N&&"object"==typeof N&&(N=Zc(N)),"a"===I[0]&&"r"===I[1]&&"boolean"==typeof N&&(N=String(N));var M=o.attributeHook&&o.attributeHook(I,N,n,o,m);if(M||""===M)S+=M;else if("dangerouslySetInnerHTML"===I)C=N&&N.__html;else if("textarea"===p&&"value"===I)k=N;else if((N||0===N||""===N)&&"function"!=typeof N){if(!(!0!==N&&""!==N||(N=I,o&&o.xml))){S=S+" "+I;continue}if("value"===I){if("select"===p){a=N;continue}"option"===p&&a==N&&void 0===f.selected&&(S+=" selected")}S=S+" "+I+'="'+Yc(N)+'"'}}}else k=N}}if(l){var T=S.replace(/\n\s*/," ");T===S||~T.indexOf("\n")?l&&~S.indexOf("\n")&&(S+="\n"):S=T}if(S+=">",Gc.test(p))throw new Error(p+" is not a valid HTML tag name in "+S);var A,O=$c.test(p)||o.voidElements&&o.voidElements.test(p),P=[];if(C)l&&Xc(C)&&(C="\n"+s+Vc(C,s)),S+=C;else if(null!=k&&Jc(A=[],k).length){for(var R=l&&~S.indexOf("\n"),L=!1,H=0;H<A.length;H++){var F=A[H];if(null!=F&&!1!==F){var W=ou(F,n,o,!0,"svg"===p||"foreignObject"!==p&&i,a);if(l&&!R&&Xc(W)&&(R=!0),W)if(l){var z=W.length>0&&"<"!=W[0];L&&z?P[P.length-1]+=W:P.push(W),L=z}else P.push(W)}}if(l&&R)for(var B=P.length;B--;)P[B]="\n"+s+Vc(P[B],s)}if(P.length||C)S+=P.join("");else if(o&&o.xml)return S.substring(0,S.length-1)+" />";return!O||A||C?(l&&~S.indexOf("\n")&&(S+="\n"),S=S+"</"+p+">"):S=S.replace(/>$/," />"),S}var ru={shallow:!0};au.render=au;var iu=[];function au(e,n,o){n=n||{};var r=t.__s;t.__s=!0;var i,a=_(b,null);return a.__k=[e],i=o&&(o.pretty||o.voidElements||o.sortAttributes||o.shallow||o.allAttributes||o.xml||o.attributeHook)?ou(e,n,o):pu(e,n,!1,void 0,a),t.__c&&t.__c(e,iu),t.__s=r,iu.length=0,i}function lu(e){return null==e||"boolean"==typeof e?null:"string"==typeof e||"number"==typeof e||"bigint"==typeof e?_(null,null,e):e}function su(e,t){return"className"===e?"class":"htmlFor"===e?"for":"defaultValue"===e?"value":"defaultChecked"===e?"checked":"defaultSelected"===e?"selected":t&&Uc.test(e)?e.toLowerCase().replace(/^xlink:?/,"xlink:"):e}function cu(e,t){return"style"===e&&null!=t&&"object"==typeof t?Zc(t):"a"===e[0]&&"r"===e[1]&&"boolean"==typeof t?String(t):t}var uu=Array.isArray,du=Object.assign;function pu(e,n,o,r,i){if(null==e||!0===e||!1===e||""===e)return"";if("object"!=typeof e)return"function"==typeof e?"":Yc(e);if(uu(e)){var a="";i.__k=e;for(var l=0;l<e.length;l++)a+=pu(e[l],n,o,r,i),e[l]=lu(e[l]);return a}if(void 0!==e.constructor)return"";e.__=i,t.__b&&t.__b(e);var s=e.type,c=e.props;if("function"==typeof s){var u;if(s===b)u=c.children;else{u=s.prototype&&"function"==typeof s.prototype.render?function(e,n){var o=e.type,r=tu(o,n),i=new o(e.props,r);e.__c=i,i.__v=e,i.__d=!0,i.props=e.props,null==i.state&&(i.state={}),null==i.__s&&(i.__s=i.state),i.context=r,o.getDerivedStateFromProps?i.state=du({},i.state,o.getDerivedStateFromProps(i.props,i.state)):i.componentWillMount&&(i.componentWillMount(),i.state=i.__s!==i.state?i.__s:i.state);var a=t.__r;return a&&a(e),i.render(i.props,i.state,i.context)}(e,n):function(e,n){var o,r=eu(e,n),i=tu(e.type,n);e.__c=r;for(var a=t.__r,l=0;r.__d&&l++<25;)r.__d=!1,a&&a(e),o=e.type.call(r,e.props,i);return o}(e,n);var d=e.__c;d.getChildContext&&(n=du({},n,d.getChildContext()))}var p=pu(u=null!=u&&u.type===b&&null==u.key?u.props.children:u,n,o,r,e);return t.diffed&&t.diffed(e),e.__=void 0,t.unmount&&t.unmount(e),p}var f,m,h="<";if(h+=s,c)for(var g in f=c.children,c){var v=c[g];if(!("key"===g||"ref"===g||"__self"===g||"__source"===g||"children"===g||"className"===g&&"class"in c||"htmlFor"===g&&"for"in c||Gc.test(g)))if(v=cu(g=su(g,o),v),"dangerouslySetInnerHTML"===g)m=v&&v.__html;else if("textarea"===s&&"value"===g)f=v;else if((v||0===v||""===v)&&"function"!=typeof v){if(!0===v||""===v){v=g,h=h+" "+g;continue}if("value"===g){if("select"===s){r=v;continue}"option"!==s||r!=v||"selected"in c||(h+=" selected")}h=h+" "+g+'="'+Yc(v)+'"'}}var y=h;if(h+=">",Gc.test(s))throw new Error(s+" is not a valid HTML tag name in "+h);var _="",w=!1;if(m)_+=m,w=!0;else if("string"==typeof f)_+=Yc(f),w=!0;else if(uu(f)){e.__k=f;for(var D=0;D<f.length;D++){var k=f[D];if(f[D]=lu(k),null!=k&&!1!==k){var C=pu(k,n,"svg"===s||"foreignObject"!==s&&o,r,e);C&&(_+=C,w=!0)}}}else if(null!=f&&!1!==f&&!0!==f){e.__k=[lu(f)];var S=pu(f,n,"svg"===s||"foreignObject"!==s&&o,r,e);S&&(_+=S,w=!0)}if(t.diffed&&t.diffed(e),e.__=void 0,t.unmount&&t.unmount(e),w)h+=_;else if($c.test(s))return y+" />";return h+"</"+s+">"}au.shallowRender=function(e,t){return au(e,t,ru)};var fu=au,mu=o(229),hu=o.n(mu);function gu(e){let{theme:t,store:n,eventBus:o,children:r}=e;return _(xr,{value:o},_(Xr,{store:t},_(ur,{store:n},_(kl,null,r))))}var vu=o(363),yu=o.n(vu);class _u extends(yu()){on(e,t){return super.on(e,t),this}off(e,t){return super.off(e,t),this}fire(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];return super.fire(e,...n),this}once(e,t){return super.once(e,t),this}}class wu{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.container=Ht()(e)?document?.querySelector(e)??null:e,this.theme=Vr(t.theme),this.eventBus=new _u,this.store=cr(t),this.renderRange=this.calculateRenderRange(jn()),Dr().addHook("beforeSanitizeAttributes",(e=>{if("A"===e.tagName){const t=e.getAttribute("target");t?e.setAttribute(kr,t):e.setAttribute("target","_self")}})),Dr().addHook("afterSanitizeAttributes",(e=>{"A"===e.tagName&&e.hasAttribute(kr)&&(e.setAttribute("target",e.getAttribute(kr)),e.removeAttribute(kr),"_blank"===e.getAttribute("target")&&e.setAttribute("rel","noopener"))})),!0===this.getStoreState().options.usageStatistics&&hu()("calendar","UA-129951699-1")}getStoreState(e){const t=this.store.getState();return e?t[e]:t}getStoreDispatchers(e){const t=this.store.getState().dispatch;return e?t[e]:t}destroy(){this.container&&xa(this.container),this.store.clearListeners(),this.theme.clearListeners(),this.eventBus.off(),Dr().removeAllHooks();for(const e in this)this.hasOwnProperty(e)&&delete this[e]}calculateMonthRenderDate(e){let{renderDate:t,offset:n,monthOptions:o}=e,r=new bn(t);const{visibleWeeksCount:i}=o;r=i>0?so(r,7*n*i):function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const n=Vn(e);if(0!==t){const e=n.getDate(),o=new bn(n.getTime());if(o.setMonth(n.getMonth()+t+1,0),e>=o.getDate())return o;n.setFullYear(o.getFullYear(),o.getMonth(),e)}return n}(r,n);const a=Li(r,o),[[l]]=a;return{renderDate:r,renderRange:{start:l,end:In(In(a))}}}calculateWeekRenderDate(e){let{renderDate:t,offset:n,weekOptions:o}=e;const r=new bn(t);r.addDate(7*n);const i=Hi(r,o),[a]=i;return{renderDate:r,renderRange:{start:a,end:In(i)}}}calculateDayRenderDate(e){let{renderDate:t,offset:n}=e;const o=new bn(t);o.addDate(n);return{renderDate:o,renderRange:{start:jn(o),end:Qn(o)}}}move(e){if(cn(e))return;const{currentView:t,renderDate:n}=this.getStoreState().view,{options:o}=this.getStoreState(),{setRenderDate:r}=this.getStoreDispatchers().view,i=new bn(n);let a={renderDate:i,renderRange:{start:new bn(i),end:new bn(i)}};"month"===t?a=this.calculateMonthRenderDate({renderDate:n,offset:e,monthOptions:o.month}):"week"===t?a=this.calculateWeekRenderDate({renderDate:n,offset:e,weekOptions:o.week}):"day"===t&&(a=this.calculateDayRenderDate({renderDate:n,offset:e})),r(a.renderDate),this.renderRange=a.renderRange}createEvents(e){const{createEvents:t}=this.getStoreDispatchers("calendar");t(e)}getEventModel(e,t){const{events:n}=this.getStoreState("calendar");return n.find((n=>{let{id:o,calendarId:r}=n;return o===e&&r===t}))}getEvent(e,t){return this.getEventModel(e,t)?.toEventObject()??null}updateEvent(e,t,n){const{updateEvent:o}=this.getStoreDispatchers("calendar"),r=this.getEventModel(e,t);r&&o({event:r,eventData:n})}deleteEvent(e,t){const{deleteEvent:n}=this.getStoreDispatchers("calendar"),o=this.getEventModel(e,t);o&&n(o)}setCalendarVisibility(e,t){const{setCalendarVisibility:n}=this.getStoreDispatchers("calendar");n(Array.isArray(e)?e:[e],t)}render(){return un(this.container)&&B(_(gu,{theme:this.theme,store:this.store,eventBus:this.eventBus},this.getComponent()),this.container),this}renderToString(){return fu(_(gu,{theme:this.theme,store:this.store,eventBus:this.eventBus},this.getComponent()))}clear(){const{clearEvents:e}=this.getStoreDispatchers("calendar");e()}scrollToNow(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"auto";this.eventBus.fire("scrollToNow",e)}calculateRenderRange(e){const{currentView:t}=this.getStoreState().view,{options:n}=this.getStoreState(),o=new bn(e);let r={start:new bn(o),end:new bn(o)};return"month"===t?r=this.calculateMonthRenderDate({renderDate:e,offset:0,monthOptions:n.month}).renderRange:"week"===t?r=this.calculateWeekRenderDate({renderDate:e,offset:0,weekOptions:n.week}).renderRange:"day"===t&&(r=this.calculateDayRenderDate({renderDate:e,offset:0}).renderRange),r}today(){const{setRenderDate:e}=this.getStoreDispatchers().view,t=new bn;e(t),this.renderRange=this.calculateRenderRange(t)}setDate(e){const{setRenderDate:t}=this.getStoreDispatchers("view"),n=new bn(e);t(n),this.renderRange=this.calculateRenderRange(n)}next(){this.move(1)}prev(){this.move(-1)}setCalendarColor(e,t){const{setCalendarColor:n}=this.getStoreDispatchers().calendar;n(e,t)}changeView(e){const{changeView:t}=this.getStoreDispatchers("view");t(e),this.renderRange=this.calculateRenderRange(this.getDate())}getElement(e,t){return this.getEvent(e,t)&&this.container?this.container.querySelector(`[data-event-id="${e}"][data-calendar-id="${t}"]`):null}setTheme(e){const{setTheme:t}=this.theme.getState().dispatch;t(e)}getOptions(){const{options:e,template:t}=this.getStoreState(),{dispatch:n,...o}=this.theme.getState();return{...e,template:t,theme:o}}setOptions(e){const{theme:t,template:n,...o}=e,{setTheme:r}=this.theme.getState().dispatch,{options:{setOptions:i},template:{setTemplate:a}}=this.getStoreDispatchers();un(t)&&r(t),un(n)&&a(n),i(o)}getDate(){const{renderDate:e}=this.getStoreState().view;return e}getDateRangeStart(){return this.renderRange.start}getDateRangeEnd(){return this.renderRange.end}getViewName(){const{currentView:e}=this.getStoreState("view");return e}setCalendars(e){const{setCalendars:t}=this.getStoreDispatchers().calendar;t(e)}openFormPopup(e){const{showFormPopup:t}=this.getStoreDispatchers().popup,n=new mo(e),{title:o,location:r,start:i,end:a,isAllday:l,isPrivate:s,state:c}=n;t({isCreationPopup:!0,event:n,title:o,location:r,start:i,end:a,isAllday:l,isPrivate:s,eventState:c})}clearGridSelections(){const{clearAll:e}=this.getStoreDispatchers().gridSelection;e()}fire(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];return this.eventBus.fire(e,...n),this}off(e,t){return this.eventBus.off(e,t),this}on(e,t){return this.eventBus.on(e,t),this}once(e,t){return this.eventBus.once(e,t),this}}var bu=class extends wu{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(e,t);const{defaultView:n="week"}=t;if(o=n,!Object.values(fc).find((e=>e===o)))throw new Jt(n);var o;this.render()}getComponent(){return _(zc,null)}}}(),r=r.default}()})); |