(self.webpackChunkweb_node=self.webpackChunkweb_node||[]).push([[4858],{nYAh:function(e,t,n){"use strict";n("pNMO"),n("4Brf"),n("0oug"),n("pjDv"),n("yq1k"),n("4mDm"),n("2B1R"),n("+2oP"),n("sMBO"),n("zKZe"),n("07d7"),n("4l63"),n("rB9j"),n("ALS0"),n("JfAA"),n("JTJg"),n("PKPk"),n("3bBZ");var r=n("q1tI"),i=n("NW6w"),o=n("9IBm"),a=n("Eh+D"),s=n("bjJs"),l=n("AtZj"),c=n("lQiI"),u=n("97ST"),f=n("bJwH"),d=n("UbDi"),h=n("d7tj"),p=n("UDbp"),m=n("eDHg"),g=n("4+DD");function v(){return v=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',r=t.head||t.getElementsByTagName("head")[0],i=t.createElement("style");i.id="detectElementResize",i.type="text/css",null!=e&&i.setAttribute("nonce",e),i.styleSheet?i.styleSheet.cssText=n:i.appendChild(t.createTextNode(n)),r.appendChild(i)}}(o),n.__resizeLast__={},n.__resizeListeners__=[],(n.__resizeTriggers__=o.createElement("div")).className="resize-triggers",n.__resizeTriggers__.innerHTML='
',n.appendChild(n.__resizeTriggers__),a(n),n.addEventListener("scroll",s,!0),u&&(n.__resizeTriggers__.__animationListener__=function(e){e.animationName==m&&a(n)},n.__resizeTriggers__.addEventListener(u,n.__resizeTriggers__.__animationListener__))}n.__resizeListeners__.push(i)}},removeResizeListener:function(e,t){if(r)e.detachEvent("onresize",t);else if(e.__resizeListeners__.splice(e.__resizeListeners__.indexOf(t),1),!e.__resizeListeners__.length){e.removeEventListener("scroll",s,!0),e.__resizeTriggers__.__animationListener__&&(e.__resizeTriggers__.removeEventListener(u,e.__resizeTriggers__.__animationListener__),e.__resizeTriggers__.__animationListener__=null);try{e.__resizeTriggers__=!e.removeChild(e.__resizeTriggers__)}catch(n){}}}}}var s=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},l=function(){function e(e,t){for(var n=0;n=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var h=r.forwardRef((function(e,t){var n=e.children,i=e.onClick,a=void 0===i?function(){}:i,c=e.loading,h=void 0!==c&&c,p=e.loadingText,m=e.href,g=e.htmlType,v=void 0===g?"button":g,y=e.className,b=e.size,k=void 0===b?"middle":b,w=e.type,C=void 0===w?"primary":w,x=e.prefix,_=void 0===x?"btn":x,S=e.disabled,E=void 0!==S&&S,O=e.style,T=d(e,s),L=m?"a":"button",P="";switch(k){case"large":P="rounded-[10px] lrg h-[40px] text-[16px] px-[24px] min-w-[100px]";break;case"middle":P=o()("rounded-[8px]","med h-[30px] text-[14px] px-[16px] min-w-[76px]");break;case"small":P="rounded-default sml h-[30px] text-[14px] px-[18px] min-w-[100px]";break;case"tiny":P="rounded-default tny h-[24px] text-[13px] px-[12px] min-w-[60px]";break;case"custom":P="rounded-default custom px-[16px]"}var M=o()("leading-none transition-colors duration-200 ease-in text-center cursor-pointer inline-block relative disabled:cursor-not-allowed",_,y,f(f(f({},"".concat(function(){switch(C){default:case"primary":return"btn-primary bg-primary text-white border border-[transparent] border-solid disabled:bg-btn-disable-color hover:bg-btn-hover-color focus:bg-btn-hover-color active:bg-btn-active-color";case"cancel":return"btn-cancel text-grey-60 border border-grey-10 border-solid disable:text-grey-20 hover:bg-cancel-btn-hover focus:bg-cancel-btn-hover active:bg-cancel-btn-active disabled:bg-[transparent]";case"team":return"bg-team-orange text-white border border-solid border-[transparent] hover:bg-team-orange-hover focus:bg-team-orange-hover disabled:bg-team-orange-disable active:bg-team-orange-active";case"border":return"text-primary border border-solid border-primary hover:border-btn-hover-color hover:text-btn-hover-color hover:bg-primary-5 focus:border-btn-hover-color focus:text-btn-hover-color focus:bg-primary-5 active:border-btn-active-color active:text-btn-active-color active:bg-primary-5";case"pro":return"btn-pro !text-white"}}()),C),"".concat(P),P),"".concat(h),h));return r.createElement(L,l({},T,{style:"tiny"===k?u(u({},O),{},{flexBasis:"60px"}):u({},O),type:m?void 0:v||"button",href:m,onClick:function(e){return a(e)},className:M,disabled:E||h,ref:t}),h?p:n)}));h.displayName="LegacyButton",t.Z=h},yFjn:function(e,t,n){"use strict";n.d(t,{P:function(){return s}});var r=n("q1tI"),i=n("EPMa"),o=n.n(i),a=n("AtZj"),s=function(e){var t=e.isChecked,n=e.checkboxId,i=e.onChange,s=e.style,l=e.disabled,c=(0,r.useCallback)((function(){l||i&&"function"===typeof i&&i(!t)}),[l,t,i]),u=!!t,f=l?"border-grey-20 cursor-not-allowed":u?"border-menu-primary bg-menu-primary":"border-grey-20 hover:border-menu-primary";return r.createElement("span",{className:o()("relative w-[14px] h-[14px] rounded-[4px] flex-none flex justify-center items-center border border-solid",f),onClick:c,style:s},r.createElement(a.Z,{name:"right-panel-all-selected",className:o()("w-[9px] h-[9px] text-white flex-none",u?"visible":"invisible")}),r.createElement("input",{type:"checkbox",id:n,checked:u,onChange:c,className:"left-0 top-0 opacity-0 pointer-events-none",style:{position:"absolute",display:"none"},disabled:l}))}},dXFY:function(e,t,n){"use strict";n("pNMO"),n("4Brf"),n("0oug"),n("gXIK"),n("TeQF"),n("4mDm"),n("7+zs"),n("qePV"),n("5DmW"),n("27RR"),n("tkto"),n("07d7"),n("PKPk"),n("FZtP"),n("3bBZ");var r=n("q1tI"),i=n("EPMa"),o=n.n(i),a=n("yFjn");function s(e){return s="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},s(e)}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?s[0]:c?"#FFFFFF":"#000000":t,m=_((0,i.useState)(d),2),y=m[0],b=m[1],w=(0,p.Z)();return i.createElement(r.Z,{relativeRef:a,hideMenu:o,zIndex:1051,className:"bg-main-background",style:{maxHeight:"none",maxWidth:"none"},placement:"bottom-left",gap:14,gap2:16},i.createElement("div",{style:{padding:"8px 10px"},className:l().picker},i.createElement(u.AI,{disableAlpha:!0,onChange:function(e){return b(e.hex.toUpperCase())},color:y,styles:{default:{picker:{boxShadow:"none",background:"none",fontFamily:"unset"},controls:{alignItems:"center"},body:{padding:"16px 0px 12px"}},disableAlpha:{color:{flex:"none",marginRight:10},swatch:{width:20,height:20,borderRadius:10}}}}),i.createElement("div",{className:"flex justify-end",style:{marginTop:12}},i.createElement(h.Z,{size:"small",onClick:o,color:"transparent"},w.formatMessage({id:"cancel"})),i.createElement("div",{style:{width:12}}),i.createElement(h.Z,{size:"small",onClick:function(){t===y?o():n(y)}},w.formatMessage({id:"save"})))))};var M=function(e){var t=e.relativeRef,n=e.dismiss,o=e.pickColor,a=e.pickedColor,s=e.placement,l=e.gap2,c=e.useInCountdown,u=e.prefixColors,f=e.addNotIncludeThemeColor;return i.createElement(r.Z,{relativeRef:t,hideMenu:n,zIndex:1051,className:"bg-main-background shadow-default dark:shadow-dark-default !max-w-none px-[16px] py-[14px]",style:{maxHeight:"none"},placement:s,gap:10,gap2:l,useNewFixPosition:!0},i.createElement("div",{className:"flex flex-col"},i.createElement(L,{onColorItemClick:o,pickedColor:a,useInCountdown:c,prefixColors:u,addNotIncludeThemeColor:f})))}},QZFz:function(e,t,n){"use strict";n("pNMO"),n("4Brf"),n("0oug"),n("pjDv"),n("4mDm"),n("+2oP"),n("sMBO"),n("07d7"),n("rB9j"),n("ALS0"),n("JfAA"),n("PKPk"),n("3bBZ");var r=n("q1tI"),i=n("EPMa"),o=n.n(i),a=n("Lxla"),s=n("eDHg"),l=n("wOLI"),c=n("+nq8"),u=n("1Cyt"),f=n("NW6w"),d=n("5WEu");function h(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function b(e,t){for(var n=0;nc.offsetWidth&&(c.style.minWidth="".concat(u.offsetWidth,"px"),n.menuRef.current&&n.menuRef.current.forceAlign&&n.menuRef.current.forceAlign()),i&&i(c,u))}if(e){var f=n.getPopupDomNode();if(f&&o){var d=f.querySelector("ul.dropdown-menu-menu"),h=f.querySelector('li[role="menuitem"][class*="-menu-item-selected"], li[class*="-submenu-selected"]');if(d&&h){var p=h.offsetTop-d.offsetHeight/2;d.scrollTop=a?a(p):p}}f&&(null===s||void 0===s||s(f))}else{var m=n.getPopupDomNode();m&&(null===l||void 0===l||l(m))}})),_(n,"getAlignPoint",(function(){var e,t=n.props,r=t.alignPoint,i=t.action;return(r||i&&i.includes("contextMenu"))&&(e=!0),e})),_(n,"getTriggerOtherProps",(function(){var e=n.props;e.minMenuWidthMatchTrigger,e.onVisibleChange,e.onMenuClick,e.children,e.menu,e.menuClassName,e.menuStyle,e.transitionName,e.animation,e.align,e.placement,e.action,e.getMenuContainer,e.visible,e.defaultVisible,e.disabled,e.autoAdjustOverflow,e.onShow,e.onHide,e.scrollToSelected,e.scrollToSelectedTopGetter,e.alignPoint,e.nodePosHandleAfterVisible,e.withAntiscroll;return y(e,h)})),n.state="visible"in e?{visible:e.visible||!1}:{visible:!!e.defaultVisible},n.escListenId=u().uniqueId(),n.menuRef=r.createRef(),n.triggerRef=r.createRef(),n.mouseDownEl=null,n}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&x(e,t)}(t,e),n=t,(o=[{key:"componentDidMount",value:function(){var e=this,t=this.props.action,n=this.state.visible;t.includes("contextMenu")&&this.triggerRef.current&&$(this.triggerRef.current).on("mousedown",(function(){e.onVisibleChange(!1)})),n&&!t.includes("hover")&&(l.jc.subscribe(this.escListenId,"dropdown",this.hide),this.isEscEventExist=!0)}},{key:"componentWillUnmount",value:function(){this.props.action.includes("contextMenu")&&this.triggerRef.current&&$(this.triggerRef.current).off("mousedown"),l.jc.unSubscribe(this.escListenId)}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){var t=e.visible,n=!!t;void 0!==t&&n!==this.state.visible&&this.setState({visible:n})}},{key:"componentDidUpdate",value:function(e,t){var n=this.state.visible,r=this.props.action;t.visible===n||!n||this.isEscEventExist||r.includes("hover")||l.jc.subscribe(this.escListenId,"dropdown",this.hide),t.visible===n||n||l.jc.unSubscribe(this.escListenId)}},{key:"getMenuElement",value:function(){var e=this.props,t=e.menu,n=e.prefixCls,i={prefixCls:"".concat(n,"-menu"),onClick:this.onClick,onMouseDown:this.onMouseDown,tabIndex:-1};return"string"===typeof t.type&&delete i.prefixCls,r.createElement(f.ZP,{autoFocus:!0},r.cloneElement(t,i))}},{key:"getTriggerElement",value:function(){var e=this.props.children,t=this.state.visible,n={ref:this.triggerRef,className:a()(e.props.className,{"dropdown-toggle-active":t})};return r.cloneElement(e,n)}},{key:"getPopupDomNode",value:function(){var e;return null===(e=this.menuRef.current)||void 0===e?void 0:e.popupElement}},{key:"getAlign",value:function(){return this.props.autoAdjustOverflow?{overflow:{adjustX:1,adjustY:1,shiftX:!0,shiftY:!0}}:{overflow:{adjustX:0,adjustY:0}}}},{key:"render",value:function(){var e=this.props,t=e.transitionName,n=e.animation,o=e.align,l=e.placement,c=e.getMenuContainer,u=e.menuClassName,f=e.menuStyle,h=e.disabled,p=e.action,g=v({},f),y=v(v({},o),this.getAlign());if(h)return this.getTriggerElement();var b=this.state.visible;return r.createElement(i.Z,m({},this.getTriggerOtherProps(),{alignPoint:this.getAlignPoint(),ref:this.menuRef,popupClassName:a()(u,d.SIv),popupStyle:g,action:p,popupPlacement:l,popupAlign:y,popupTransitionName:t,popupAnimation:n,popupVisible:b,afterPopupVisibleChange:this.afterVisibleChange,popup:this.getMenuElement(),onPopupVisibleChange:this.onVisibleChange,getPopupContainer:c,builtinPlacements:s}),this.getTriggerElement())}}])&&b(n.prototype,o),c&&b(n,c),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,o,c}(r.Component);_(E,"defaultProps",{minMenuWidthMatchTrigger:!1,prefixCls:"dropdown-menu",action:["click"],menuClassName:"",menuStyle:{},defaultVisible:!1,onVisibleChange:function(e){},placement:"bottomLeft",disabled:!1,destroyPopupOnHide:!0,autoAdjustOverflow:!0,scrollToSelected:!0,withAntiscroll:!1})},PuJ2:function(e,t,n){"use strict";n("pNMO"),n("4Brf"),n("0oug"),n("gXIK"),n("fbCW"),n("4mDm"),n("+2oP"),n("7+zs"),n("qePV"),n("NBAS"),n("ExoC"),n("07d7"),n("SuFq"),n("PKPk"),n("3bBZ");var r=n("q1tI"),i=n("3KU8"),o=n.n(i),a=n("aALo"),s=n("bjJs"),l=n("UDbp"),c=n("EPMa"),u=n.n(c),f=n("xS9v"),d=n("schq"),h=n("4+DD"),p=n("mLa8");function m(e){return m="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},m(e)}function g(e,t){for(var n=0;n1&&"none"===t[0]&&(t=t.slice(1)),n.setState({selected:t}),r&&r({selectedKeys:t})})),w(n,"confirm",(function(){var e=n.props.onConfirm;n.setState({visible:!1}),e&&e({selectedKeys:n.state.selected}),n.defaultSelectedKeys=f.d9(n.state.selected)})),w(n,"cancel",(function(){var e=n.props.onCancel;n.setState({visible:!1,selected:n.defaultSelectedKeys}),e&&e({selectedKeys:n.defaultSelectedKeys})})),n.state={visible:e.defaultVisible,selected:e.selectedKeys},n.defaultSelectedKeys=f.d9(e.selectedKeys),n.confirm=n.confirm.bind(n),n.cancel=n.cancel.bind(n),n.onVisibleChange=n.onVisibleChange.bind(n),n.saveSelected=n.saveSelected.bind(n),n.onShow=n.onShow.bind(n),n.wrapperRef=r.createRef(),n.menuListRef=r.createRef(),n}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&k(e,t)}(t,e),n=t,(i=[{key:"componentDidMount",value:function(){var e=this;setTimeout((function(){e.wrapperRef.current&&h.iD($(e.wrapperRef.current))}))}},{key:"componentDidUpdate",value:function(e,t){var n=this.state.visible,r=this.props.onMenuVisibleChange;n!==t.visible&&r&&r(n)}},{key:"componentWillReceiveProps",value:function(e){var t=e.defaultSelected,n=e.selectedKeys;void 0!==t&&this.setState({selected:t}),n!==this.state.selected&&this.setState({selected:n})}},{key:"componentWillUnmount",value:function(){this.wrapperRef.current&&h.Dh($(this.wrapperRef.current))}},{key:"resetDefaultSelectKeys",value:function(e){this.defaultSelectedKeys=f.d9(e)}},{key:"hideMenu",value:function(){this.setState({visible:!1})}},{key:"showMenu",value:function(){this.setState({visible:!0})}},{key:"onShow",value:function(e){var t=$(e).find(".antiscroll-wrap");h.iD(t),this.props.onShow&&this.props.onShow(e),this.props.keepMenuWidth&&(this.menuListRef.current.style.width=e.getBoundingClientRect().width+"px")}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.selectMenu,i=e.selectListHeader,o=e.confirmText,c=e.cancelText,f=e.className,d=e.selectedKeys,h=e.minMenuWidthMatchTrigger,m=e.placement,g=e.autoAdjustOverflow,v=e.intl,y=e.confirmDisabled,b=e.emptyContent,k=e.menuListClassName,w=e.menuListWrapperClassName,C=e.menuUlClassName,x=e.controlClassName,_=e.ExtraFooterComponent,S=r.createElement(p.ZP,null,r.createElement("div",{className:u()("select-list w-full cursor-pointer",k),ref:this.menuListRef},i,r.createElement("div",{className:u()("list-wrapper antiscroll-wrap",w),ref:this.wrapperRef},n?r.createElement(l.ZP,{className:u()("antiscroll-inner",C),multiple:!0,onSelect:this.saveSelected,onDeselect:this.saveSelected,selectedKeys:d,prefixCls:"option"},n):r.createElement("div",{className:"antiscroll-inner"},b)),_,r.createElement("div",{className:u()("control",null!==x&&void 0!==x?x:"relative p-[12px] border-t border-solid border-grey-10 bg-main-background z-[1]")},r.createElement("div",{className:"btns flex w-full"},r.createElement(a.Z,{type:"cancel",size:"tiny",className:"first:mr-[12px] flex-auto min-w-auto",onClick:this.cancel},c||v.formatMessage({id:"cancel"})),r.createElement(a.Z,{size:"tiny",onClick:this.confirm,disabled:y,className:"btn-confirm flex-auto min-w-auto"},o||v.formatMessage({id:"ok"}))))));return r.createElement(s.Z,{onVisibleChange:this.onVisibleChange,visible:this.state.visible,menu:S,menuClassName:u()("multi-select-menu",f),minMenuWidthMatchTrigger:h,placement:m,autoAdjustOverflow:g,onShow:this.onShow,getMenuContainer:this.props.getMenuContainer,boult:this.props.isBoult,align:this.props.align},t)}}])&&g(n.prototype,i),o&&g(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,i,o}(r.Component);w(x,"propTypes",{minMenuWidthMatchTrigger:o().bool,className:o().string,confirmText:o().string,cancelText:o().string,selectMenu:o().node,emptyContent:o().node,children:o().any,defaultSelected:o().array,defaultVisible:o().bool,selectedKeys:o().array,onCancel:o().func,onConfirm:o().func,onSelectChange:o().func,placement:o().string,onShow:o().func,menuListClassName:o().string,menuListWrapperClassName:o().string,menuUlClassName:o().string,controlClassName:o().string,beforeOnVisibleChange:o().func,onMenuVisibleChange:o().func,preventShowAction:o().func,keepMenuWidth:o().bool,ExtraFooterComponent:o().node}),w(x,"defaultProps",{defaultVisible:!1,selectedKeys:[],minMenuWidthMatchTrigger:!1,placement:"bottomCenter",onShow:function(){},beforeOnVisibleChange:function(){},keepMenuWidth:!1,ExtraFooterComponent:null}),t.Z=(0,d.ZP)(x,{forwardRef:!0})},PLEF:function(e,t,n){"use strict";n("pNMO"),n("4Brf"),n("0oug"),n("gXIK"),n("fbCW"),n("4mDm"),n("2B1R"),n("7+zs"),n("qePV"),n("NBAS"),n("ExoC"),n("07d7"),n("SuFq"),n("PKPk"),n("3bBZ");var r=n("q1tI"),i=n("3KU8"),o=n.n(i),a=n("Eh+D"),s=n("EPMa"),l=n.n(s),c=n("bjJs"),u=n("UDbp"),f=n("4+DD"),d=n("AtZj"),h=n("yhZ0");function p(e){return p="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},p(e)}function m(e,t){for(var n=0;n=0&&(n.scrollTop=t)}))}}}(e)}})}},Kefl:function(e,t,n){"use strict";n("pUFS"),n("PE7j"),n("pNMO"),n("4Brf"),n("0oug"),n("gXIK"),n("ma9I"),n("fbCW"),n("yq1k"),n("4mDm"),n("Junv"),n("7+zs"),n("qePV"),n("NBAS"),n("ExoC"),n("07d7"),n("SuFq"),n("JTJg"),n("PKPk"),n("SYor"),n("GKVU"),n("3bBZ");var r=n("Nr3o"),i=n.n(r),o=n("q1tI"),a=n("i8i4"),s=n("V/jI"),l=n("Mfe1"),c=n("iEvi"),u=n("PcT8"),f=n("DhZW");function d(e,t,n){var r=(0,u.G)(e),i=r.findSpanWithTypeAt(t,"linkText");if(!i)return null;var o=r.findSpanWithTypeAt({line:t.line,ch:i.end+1},"linkHref");if(!o)return null;var a=o.begin+1,s=o.end-1;if(a>=s)return null;var l={line:t.line,ch:a},c={line:t.line,ch:s};return(0,f.V9)(e,l,c)}(0,c.$D)("link",(function(e,t){var n=e.cm,r=t.state.localState||t.state,i=!r.image&&t.string.includes(r.image);return"["!==t.string||!r.linkText||r.linkTitle||i?null:d(n,{line:e.lineNo,ch:t.start},(function(t,n){return e.requestRange(t,n)}))}),!0);var h=n("AqaH"),p=n("aALo"),m=n("pWE6"),g=n("2sNt"),v=n("mLa8"),y=n("EPMa"),b=n.n(y),k=n("RDjN");function w(e){return w="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},w(e)}function C(e,t,n){return t=_(t),function(e,t){if(t&&("object"===w(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,x()?Reflect.construct(t,n||[],_(e).constructor):t.apply(e,n))}function x(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(x=function(){return!!e})()}function _(e){return _=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_(e)}function S(e,t){return S=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},S(e,t)}function E(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function O(e,t){for(var n=0;n1)){if(this.somethingSelected()){var r=(0,l.pw)(n[0]);n[0].head.line!=n[0].anchor.line&&(r=[{line:r[0].line,ch:r[0].ch},{line:r[0].line,ch:99999999}],this.setSelection(r[0],r[1]));var o=this.getRange(r[0],r[1]);e.title=o,e.titleRange=r}else{var a=this.getCursor(),s=this.getLineTokens(a.line),c=(0,m.Rh)(s),u=function(n){if(n&&n.type)if("md-link"===n.type){var r=(0,m.xO)(n.string);if(r)return t.setSelection(i().Pos(a.line,n.start),i().Pos(a.line,n.end)),e.title=r.title,e.url=r.url,!0}else if(n.type.includes("link"))return e.url=n.string,t.setSelection(i().Pos(a.line,n.start),i().Pos(a.line,n.end)),!0;return!1};if(!u(c.find((function(e){return a.ch>=e.start&&a.ch<=e.end}))))u(c.reverse().find((function(e){return a.ch>=e.start&&a.ch<=e.end})))}this.state.linkWidgetActive&&this.state.linkWidgetActive.close();var f=new P(this,e);this.state.linkWidgetActive=f,f.show()}}));var P=function(){return T((function e(t,n){E(this,e),this.cm=t,this.options=n,this.onContainerClick=this.onContainerClick.bind(this),this.onContainerKeyDown=this.onContainerKeyDown.bind(this),this.confirm=this.confirm.bind(this),this.close=this.close.bind(this),this.onRemove=this.onRemove.bind(this)}),[{key:"show",value:function(){var e=this.cm,t=this.options,n=t.title,r=t.url,s=this.smallerSelectionPos(),l=this.getAdjustingScrollTop(s);l>=0&&(this.getScrollElt()[0].scrollTop=l);var c=this.container=document.body,u=e.charCoords(s),f=o.createElement(M,{theme:e.options.theme,title:n,url:r,showRect:u,onConfirm:this.confirm,onCancel:this.close,onRemove:this.onRemove}),d=this.renderingElt=document.createElement("div");c.appendChild(d),this.linkModal=a.render(f,d),i().on(c,"mousedown",this.onContainerClick),i().on(this.modalDom(),"keydown",this.onContainerKeyDown)}},{key:"isCursorVisible",value:function(){return this.getAdjustingScrollTop(this.smallerSelectionPos())<0}},{key:"getScrollElt",value:function(){return $(this.cm.display.input.textarea).parents(".antiscroll-inner").eq(0)}},{key:"getAdjustingScrollTop",value:function(e){return(0,l.Pl)(this.cm,e,this.getScrollElt())}},{key:"modalDom",value:function(){return this.linkModal?this.linkModal.modalRefs.current:null}},{key:"onRemove",value:function(){this.handleAction(!0)}},{key:"close",value:function(){this.cm.state.linkWidgetActive===this&&(this.cm.state.linkWidgetActive=null,i().off(this.container,"mousedown",this.onContainerClick),this.modalDom()&&i().off(this.modalDom(),"keydown",this.onContainerKeyDown),a.unmountComponentAtNode(this.renderingElt),this.cm.hadFocused&&this.isCursorVisible()&&this.cm.focus(),this.cm.somethingSelected()&&this.cm.setCursor(this.cm.getCursor()))}},{key:"confirm",value:function(){this.handleAction(!1)}},{key:"handleAction",value:function(e){var t=this.linkModal.getUrl().trim();if(t){var n=this.cm,r=this.linkModal.getTitle();if(!r){var i=(0,m.WK)(t);if(i){var o=i.taskId,a=s.U2("my_task"),l=(0,g.FOH)(o);(r=l?l.get("title"):a)||(r=a)}else r=t}var u,f=this.options.titleRange,h=e?"".concat(r):"[".concat(r,"](").concat(t,")"),p=null;if(this.cm.somethingSelected()&&(p=n.listSelections()[0]),this.close(),f?(u=f[0],n.replaceRange(h,f[0],f[1],"manualMarkText")):(p&&n.setSelection(p.anchor,p.head),u=this.smallerSelectionPos(),n.replaceSelection(h,void 0,"manualMarkText")),this.cm.setCursor(this.cm.getCursor()),this.cm.focus(),u){var v=d(n,u);v&&(v.on("clear",(function(e,t){(0,c.LX)(e.line)})),v.foldType="link")}}else this.close()}},{key:"smallerSelectionPos",value:function(){return(0,l.pw)(this.cm.listSelections()[0])[0]}},{key:"onContainerClick",value:function(e){this.modalDom()&&(i().contains(this.modalDom(),e.target)||this.close())}},{key:"onContainerKeyDown",value:function(e){switch(e.keyCode){case 13:e.preventDefault(),this.confirm();break;case 27:e.preventDefault(),this.close()}}},{key:"changeFocus",value:function(){var e=document.activeElement===this.titleElt,t=document.activeElement===this.urlElt;(e||t)&&e?this.urlElt.focus():this.titleElt.focus()}}])}(),M=function(e){function t(e){var n;return E(this,t),(n=C(this,t,[e])).modalRefs=o.createRef(),n.titleRefs=o.createRef(),n.urlRefs=o.createRef(),n.onConfirm=n.onConfirm.bind(n),n.onCancel=n.onCancel.bind(n),n.onRemove=n.onRemove.bind(n),n}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&S(e,t)}(t,e),T(t,[{key:"componentDidMount",value:function(){var e=this;this.useEffect();var t=this.props,n=t.title,r=t.url;setTimeout((function(){n?r?e.titleRefs.current&&(e.titleRefs.current.focus(),e.titleRefs.current.select()):e.urlRefs.current&&e.urlRefs.current.focus():e.titleRefs.current&&e.titleRefs.current.focus()}),1)}},{key:"componentDidUpdate",value:function(e,t){this.useEffect()}},{key:"onCancel",value:function(){this.props.onCancel&&this.props.onCancel()}},{key:"onConfirm",value:function(){this.props.onConfirm&&this.props.onConfirm()}},{key:"onRemove",value:function(){this.props.onRemove&&this.props.onRemove()}},{key:"render",value:function(){var e=this.props,t=e.title,n=e.url,r=e.theme,i=e.showRect,a=n?s.U2("edit_link"):s.U2("add_link"),l="px-[12px] rounded-default text-s text-grey placeholder:text-grey-20 border border-solid border-grey-10 dark:bg-[transparent]";return o.createElement(v.ZP,null,o.createElement("div",{className:b()("CodeMirror-link-modal",k.SIv,"".concat(r," absolute overflow-hidden bg-main-background shadow-default dark:shadow-dark-default flex flex-col dark:border dark:border-solid dark:box-content dark:border-grey-10 z-menu")),ref:this.modalRefs,style:{left:i.left,top:i.bottom,borderRadius:12,width:296,height:212}},o.createElement("div",{className:"modal-header flex items-center",style:{padding:"0 20px",height:56}},o.createElement("h1",{className:"modal-title flex-auto font-semibold",style:{fontSize:16,lineHeight:"22px"}},a),o.createElement("a",{className:"modal-close flex-none",onClick:this.onCancel},o.createElement(h.Z,{name:"close",className:"text-grey-40",style:{width:18,height:18}}))),o.createElement("div",{className:"modal-body flex-auto",style:{padding:"0 20px"}},o.createElement("input",{ref:this.titleRefs,className:"link-title input-lrg w-full h-[36px] ".concat(l),type:"text",placeholder:s.U2("text"),defaultValue:t}),o.createElement("input",{ref:this.urlRefs,className:"link-url input-lrg ".concat(l," mt-[12px] w-full h-[36px]"),type:"text",placeholder:s.U2("link"),defaultValue:n,style:{marginTop:10}})),this.renderDefaultFooter()))}},{key:"renderDefaultFooter",value:function(){var e=this.props.title?o.createElement(p.Z,{onClick:this.onRemove,type:"cancel",className:"text-[13px] py-[7px] px-0 min-w-[92px]"},s.U2("remove_link")):o.createElement(p.Z,{onClick:this.onCancel,type:"cancel",className:"text-[13px] py-[7px] px-0 min-w-[92px]"},s.U2("cancel"));return o.createElement("div",{className:"modal-footer flex-none items-center flex justify-end",style:{padding:"0 20px",height:54,marginBottom:4}},e,o.createElement(p.Z,{type:"primary",onClick:this.onConfirm,className:"text-[13px] py-[7px] px-0 min-w-[92px] ml-[10px]",style:{marginLeft:10}},s.U2("confirm")))}},{key:"getTitle",value:function(){return this.titleRefs.current.value}},{key:"getUrl",value:function(){return this.urlRefs.current.value}},{key:"changeFocus",value:function(){var e=this.titleRefs.current,t=this.urlRefs.current,n=document.activeElement===e,r=document.activeElement===t;(n||r)&&n?t.focus():e.focus()}},{key:"useEffect",value:function(){var e=window.innerWidth,t=window.innerHeight,n=this.modalRefs.current,r=this.props.showRect,i=n.getBoundingClientRect();if(i.bottom-t>0){var o=i.bottom-i.top;r.top-(r.bottom-i.top)-o>0&&(n.style.top=r.top-o+"px")}var a=i.right-(e-10);a>0&&(n.style.left=r.left-a-10+"px")}}])}(o.Component);n("pXKo"),n("rE61"),n("pDQq");function D(e){e.state.markedSelection&&e.operation((function(){!function(e){if(!e.somethingSelected())return A(e);if(e.listSelections().length>1)return B(e);var t=e.getCursor("start"),n=e.getCursor("end"),r=e.state.markedSelection;if(!r.length)return R(e,t,n);var i=r[0].find(),o=r[r.length-1].find();if(!i||!o||n.line-t.line<=1||I(t,o.to)>=0||I(n,i.from)<=0)return B(e);for(;I(t,i.from)>0;){r.shift().clear();var a=r[0].find();a&&(i=a)}I(t,i.from)<0&&(i.to.line-t.line<1?(r.shift().clear(),R(e,t,i.to,0)):R(e,t,i.from,0));for(;I(n,o.to)<0;){r.pop().clear();var s=r[r.length-1].find();s&&(o=s)}I(n,o.to)>0&&(n.line-o.from.line<1?(r.pop().clear(),R(e,o.from,n)):R(e,o.to,n))}(e)}))}function j(e){e.state.markedSelection&&e.state.markedSelection.length&&e.operation((function(){A(e)}))}i().defineOption("styleSelectedText",!1,(function(e,t,n){var r=n&&n!=i().Init;t&&!r?(e.state.markedSelection=[],e.state.markedSelectionStyle="string"==typeof t?t:"CodeMirror-selectedtext",B(e),e.on("cursorActivity",D),e.on("change",j)):!t&&r&&(e.off("cursorActivity",D),e.off("change",j),A(e),e.state.markedSelection=e.state.markedSelectionStyle=null)}));var N=i().Pos,I=i().cmpPos;function R(e,t,n,r){if(0!==I(t,n))for(var i=e.state.markedSelection,o=e.state.markedSelectionStyle,a=function(){var a=s===t.line?t:N(s,0),l=s>=n.line,c=l?n:N(s,e.getLine(s).length),u=document.createElement("div"),f=0===e.getLine(s).length&&0===c.ch?function(){var t=e.addLineWidget(c.line,u,{className:b()(o)});return{clear:function(){t.clear()},find:function(){return{from:c,to:c}}}}():e.markText(a,c,{className:o});if(null==r?i.push(f):i.splice(r++,0,f),l)return 1;s+=1},s=t.line;!a(););}function A(e){for(var t=e.state.markedSelection,n=0;nt.index?1:-1}))}})),{list:c,from:i().Pos(r.line,o),to:i().Pos(r.line,a)}})),i().registerHelper("hint","detailPreset",(function(e,t){var n=t.source,r=e.getCursor(),o=t.start,a=t.end,s=t.callback,l=t.text,c=t.needClean,u=t.type;function f(e,t,n){var l=u+n.text;c&&(l=""),e.replaceRange(l,i().Pos(r.line,o),i().Pos(r.line,a),"complete"),setTimeout((function(){"function"===typeof s&&s(t,n)}))}var d=[];return n.forEach((function(e){if((0,Z.B)(e.match,l)){var t={key:e.key,displayText:e.match,text:e.complete,hint:f};d.push(t)}})),0===d.length&&e.closeHint(),{list:d,from:i().Pos(r.line,o),to:i().Pos(r.line,a)}})),i().registerHelper("hint","detailAssignee",(function(e,t){var n=t.source,r=e.getCursor(),o=t.start,a=t.end,s=t.callback,l=t.text,c=t.needClean,u=t.type;function f(e,t,n){var l=u+n.text;c&&(l=""),e.replaceRange(l,i().Pos(r.line,o),i().Pos(r.line,a),"complete"),setTimeout((function(){"function"===typeof s&&s(t,n)}))}var d=[];return n.forEach((function(e,t){var n=e.match.toLowerCase(),r=l.toLowerCase();if(n.includes(r)){var i={index:t,key:e.key,displayText:e.match,avatarUrl:e.avatarUrl,text:e.complete,render:function(e,t,n){var r=document.createElement("div"),i=document.createElement("img");r.className="flex items-center h-full",i.className="avatar med icon-avatar avatar-bd-divider inline-block w-[24px] h-[24px] border border-solid border-grey-10 rounded-full overflow-hidden flex-none",i.src=n.avatarUrl;var o=document.createElement("span");return o.className="truncate",o.innerText=n.displayText,r.appendChild(i),r.appendChild(o),e.appendChild(r),e},hint:f};d.push(i),d.sort((function(e,t){return e.index>t.index?1:-1}))}})),0===d.length&&e.closeHint(),{list:d,from:i().Pos(r.line,o),to:i().Pos(r.line,a)}}));var K=/[\d\w\s\-\:\u4e00-\u9fa5]/;i().registerHelper("hint","detailDate",(function(e,t){var n,r,o=e.getCursor(),a=e.getLine(o.line),s=t.source,l=t.type,c=t.needClean,u=t.callback,f=[];if("number"===typeof t.start&&"number"===typeof t.end)n=t.start,r=t.end;else{for(n=o.ch,r=n;rW.b9.taskContentWordLimit?Y.$Z({text:s.U2("characters_upper_limit")}):(e.replaceRange(d,i().Pos(r.line,o),i().Pos(r.line,a),"complete"),(0,u.G)(e).clearCacheAtLine(r.line),null===(l=e.getOption("ticktickMDFold"))||void 0===l||l.startFoldImmediately())}var f=[];return n.forEach((function(e,t){var n=e.match.toLowerCase(),r=l.toLowerCase();if(n.includes(r)){var i={key:e.key,displayText:e.match,text:e.match,hint:c,className:b()("CodeMirror-hint-detailLinkTask",e.isComplete?"completeStyle":"")};f.push(i)}})),0===f.length&&e.closeHint(),{list:f,from:i().Pos(r.line,o),to:i().Pos(r.line,a)}}));n("AT7j"),n("v87U"),n("TeQF"),n("pjDv"),n("oVuX"),n("sMBO"),n("zKZe"),n("5DmW"),n("27RR"),n("tkto"),n("4l63"),n("JfAA"),n("YGK4"),n("UxlC"),n("LKBx");var H,z=n("Uyqk"),q=n("Ag2S"),V=n("PGqD"),J=n("ylzY"),G=n("rviF");function Q(e){return Q="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},Q(e)}function X(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ee(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n\s|[*+-]\s\[[x| ]\]\s|[*+-]\s|(\d+)([.)]\s))/i,oe=/^(\s*)(>|[*+-] \[[x| ]\]|[*+-]|(\d+)[.)])(\s)$/i,ae=/[*+-]\s/,se=/^(\s*)([*+-]|(\d+)([.)]))(\s)/,le=99999999999999,ce=(0,z.m)();function ue(e,t){if(!1!==e.list){for(var n=!0,r=e.listStack.slice(0);t0;)n+=e;return n}function de(e,t){var n,i;if(e.getOption("disableInput"))return r.Pass;var o=e.getCursor("start"),a=e.getCursor("end");if((null!==(n=e.findMarks(o,a))&&void 0!==n?n:[]).filter((function(e){return"image"===e.foldType})).length>0)return r.Pass;var s=(te(te(te(te(te(te(te(te(te(te(i={},f.s2.quote,"> "),f.s2.unorderedList,"* "),f.s2.numberedList,"1. "),f.s2.uncheckedItem,"- [ ] "),"h1","# "),"h2","## "),"h3","### "),"h4","#### "),"h5","##### "),"h6","###### "),te(i,"text","")),c=!e.curOp;c&&e.startOperation();for(var u=null,d=[],h=o.line;h<=a.line;h+=1){var p=e.getLineTokens(h),m=(0,f.QY)(p);if(m&&m.type!==f.s2.hr){var g=m.type;g===f.s2.header?g="h"+(m.end-m.start-1):g===f.s2.checkedItem&&(g=f.s2.uncheckedItem),h===o.line?u=g:u!==g&&(u=null),d.push({from:{line:h,ch:m.start},to:{line:h,ch:m.end}})}else u=null}if(d.forEach((function(t){e.replaceRange("",t.from,t.to,"manualMarkText")})),null!=t&&u!==t){for(var v=o.line;v<=a.line;v+=1){var y=e.getLine(v).match(/^([\s\t]*)(.*)/);if(y){var b=void 0,k=void 0;"quote"===t||t.startsWith("h")?(b=0,k=s[t]):(b=y[1].length,k=y[1]+s[t]),e.replaceRange(k,{line:v,ch:0},{line:v,ch:b},"manualMarkText"),(0,f.pH)(e,v)}}t===f.s2.numberedList&&(0,l.xJ)(e,o.line,!0)}return o.line!==a.line&&e.setSelection({line:o.line,ch:0},{line:a.line,ch:le},{origin:"+move"}),c&&e.endOperation(),e.focus(),!0}function he(e,t,n,i){var o;if(e.getOption("disableInput"))return r.Pass;if(1!==e.listSelections().length)return r.Pass;var a=e.listSelections()[0],s=ne((0,l.pw)(a),2),c=s[0],u=s[1];if((null!==(o=e.findMarks(c,u))&&void 0!==o?o:[]).filter((function(e){return"image"===e.foldType})).length>0)return r.Pass;for(var f=[],d=u.line-c.line>0,h=c.line;h<=u.line;h+=1){var p={line:h,ch:0},m={line:h,ch:e.getLine(h).length};h===c.line&&(p.ch=c.ch),h===u.line&&(m.ch=u.ch);var g=pe(e,t,p,m,n,i,d);g&&f.push(g)}var v=!e.curOp;v&&e.startOperation();var y=c,b=u,k=f.filter((function(e){return"add"===e.origin}));(k.length>0?k:f).forEach((function(t){y.line===t.selection[0].line&&(y=t.selection[0]),b.line===t.selection[1].line&&(b=t.selection[1]),e.replaceRange(t.replacement,t.from,t.to,"manualMarkText")}));var w=null==n?0:n.length,C=null==i?w:i.length;return y.line===b.line&&b.ch-y.ch===w+C?e.setSelection({line:y.line,ch:y.ch+w},null,"+move"):e.setSelection(y,b,{origin:"+move"}),v&&e.endOperation(),e.focus(),!0}function pe(e,t,n,r,i,o,a){if(n.line!==r.line)throw new Error("startPoint.line is not equal endPoint.line");if(0===e.getLine(n.line).length&&a)return null;var s,l,c,u=e.getLineTokens(n.line),d=(0,f.QY)(u);if(d){if(d.type===f.s2.hr)return null;d.type!==f.s2.code&&(n.ch=Math.max(d.end,n.ch))}for(var h=0;hn.ch)break;if(me(p)[t]){if(!s){s=p;continue}if(p.end>=r.ch){l=p;break}s=void 0}}var m=i,g=null==o?m:o;if(l){r={line:(n={line:n.line,ch:s.start}).line,ch:l.end},c=e.getRange(n,r),"bold"===t?c=c.replace(/^(\*\*|__)([\s\S]*)\1/,"$2"):"italic"===t?c=c.replace(/^(\*|_)([\s\S]*)\1/,"$2"):"strikethrough"===t?c=c.replace(/^(~~)([\s\S]*)\1/,"$2"):"underline"===t?c=c.replace(/^(~)([\s\S]*)\1/,"$2"):"mark"===t?c=c.replace(/^(::)([\s\S]*)\1/,"$2"):"inlineCode"===t&&(c=c.replace(/^(`)([\s\S]*)\1/,"$2"));var v={line:n.line,ch:s.start};return{origin:"remove",replacement:c,from:v,to:{line:n.line,ch:l.end},selection:[v,{line:n.line,ch:v.ch+c.length}]}}c=e.getRange(n,r),"bold"===t?c=(c=c.split("**").join("")).split("__").join(""):"italic"===t?c=(c=c.split("*").join("")).split("_").join(""):"strikethrough"===t?c=c.split("~~").join(""):"mark"===t?c=c.split("::").join(""):"underline"===t?c=c.split("~").join(""):"inlineCode"===t&&(c=c.split("`").join(""));var y=m+c+g;return{origin:"add",replacement:y,from:n,to:r,selection:[n,{line:n.line,ch:n.ch+y.length}]}}function me(e){if(!e.type)return{};var t=e.type.split(" "),n={};return t.forEach((function(e){"formatting-strong"===e?n.bold=!0:"formatting-code"===e?n.inlineCode=!0:"formatting-em"===e?n.italic=!0:"formatting-mark"===e?n.mark=!0:"formatting-underline"===e?n.underline=!0:"formatting-strikethrough"===e&&(n.strikethrough=!0)})),n}function ge(e){de(e,"h4"),setTimeout((function(){e.focus()}))}function ve(e){de(e,"h5"),setTimeout((function(){e.focus()}))}function ye(e){de(e,"h6"),setTimeout((function(){e.focus()}))}function be(e){return e.extendSelectionsBy((function(t){return(0,l.so)(e,t.head)}),{origin:"+move",bias:1})}function ke(e,t,n){var r=e.charCoords(t.head,"div").top+5,i=e.coordsChar({left:0,top:r},"div");return 0!==i.ch?i:(0,l.so)(e,t.head,n)}function we(e,t){if(1!==e.listSelections().length)return r.Pass;var n=xe(e);return n.length>0||t?(e.execCommand("indentMore"),n.forEach((function(t){(0,l.xJ)(e,t.fromLine)})),!0):(e.execCommand("insertTab"),!0)}function Ce(e,t){if(1!==e.listSelections().length)return r.Pass;var n=xe(e);return n.length>0||t?(e.execCommand("indentLess"),n.forEach((function(t){(0,l.xJ)(e,t.fromLine)})),!0):(e.execCommand("insertTab"),!0)}function xe(e){var t=e.listSelections()[0],n=t.head,i=t.anchor;if(!t.empty()&&(0,r.cmpPos)(n,i)>0){var o=[n,i];i=o[0],n=o[1]}else i===n&&(i={ch:n.ch,line:n.line},t.anchor=i);for(var a=[],s=null,l=n.line;l<=i.line;l+=1){if(se.exec(e.getLine(l)))!1!==e.getStateAfter(l).list?s?s.toLine=l:s={fromLine:l,toLine:l}:s&&(a.push(s),s=null);else s&&(a.push(s),s=null)}return s&&a.push(s),a}Object.assign(r.commands,{TickTickNewlineAndContinue:function(e){if(e.getOption("disableInput"))return r.Pass;var t=e.listSelections();if(!t||0===t.length)return r.Pass;var n,i=ne(t,1)[0],o=i.head,a=i.empty(),s=e.getStateAfter(o.line),c=e.getLine(o.line),u=!1,d=!1!==s.list,h=s.quote,p=ie.exec(c),g=/^\s*$/.test(c.slice(0,o.ch)),v=!1;if(a&&(d||h)&&p&&!g)if(u=!0,oe.test(c)){var y=(0,m.lI)(s,e.getOption("indentUnit")),b="";y>1&&(b=fe("\t",y-1)),e.replaceRange(b,{line:o.line,ch:0},{line:o.line,ch:o.ch+1},"manualMarkText")}else{n="\n"+p[1]+((v=!(ae.test(p[2])||p[2].indexOf(">")>=0))?parseInt(p[3],10)+1+p[4]:p[2].replace(/x/i," "))}else if(a&&d&&c.length){var k=e.getOption("indentUnit");if(ue(s,c.length))u=!0,n="\n"+fe("\t",(0,m.lI)(s,k))}if(!u)return e.execCommand("newlineAndIndent"),!0;if(n){e.replaceSelection(n,void 0,"manualMarkText"),v&&(0,l.xJ)(e,o.line);var w=o.line+1;(0,f.pH)(e,w)}return!0},TickTickNewline:function(e){if(e.getOption("disableInput"))return r.Pass;if(1!==e.listSelections().length)return r.Pass;var t=e.listSelections()[0].head,n=e.getStateAfter(t.line),i=e.getLine(t.line),o="\n";return!1!==n.list&&i.length&&ue(n,i.length)&&(o+=fe("\t",(0,m.lI)(n,e.getOption("indentUnit")))),e.replaceSelection(o,void 0,"manualMarkText"),!0},TickTickShiftTab:function(e){return Ce(e,!1)},TickTickTab:function(e){return we(e,!1)},TickTickInlineCode:function(e){he(e,"inlineCode","`")},TickTickFullScreen:function(e){q.vp.dispatch("toggleFullScreen",e)},TickTickBold:function(e){he(e,"bold","**")},TickTickItalic:function(e){he(e,"italic","*")},TickTickStrikethrough:function(e){he(e,"strikethrough","~~")},TickTickUnderline:function(e){he(e,"underline","~")},TickTickHighlight:function(e){he(e,"mark","::")},TickTickHeading1:function(e){de(e,"h1"),setTimeout((function(){e.focus()}))},TickTickHeading2:function(e){de(e,"h2"),setTimeout((function(){e.focus()}))},TickTickHeading3:function(e){de(e,"h3"),setTimeout((function(){e.focus()}))},TickTickHeading4:ge,TickTickHeading5:ve,TickTickHeading6:ye,TickTickUnorderedList:function(e){de(e,f.s2.unorderedList)},TickTickOrderedList:function(e){de(e,f.s2.numberedList)},TickTickBlockquote:function(e){de(e,f.s2.quote)},TickTickItemList:function(e){de(e,f.s2.uncheckedItem)},TickTickShowLink:function(e){return e.getOption("readOnly")||e.getOption("disableInput")?r.Pass:(G.Z.taskDetail("shortcut","add_link"),(0,m._m)(e),!0)},TickTickSeparatorLine:function(e){if(e.getOption("disableInput"))return r.Pass;var t=e.listSelections();if(1!==t.length)return r.Pass;var n=t[0].head.line;return 0===e.getLine(n).trim().length?e.replaceRange("---\n",{line:n,ch:0},{line:n,ch:le},"manualMarkText"):(e.replaceSelection("\n---\n",void 0,"manualMarkText"),n+=1),(0,f.pH)(e,n),e.focus(),!0},TickTickDate:function(e){he(e,"date",J.ZP.editorInsertDateText,""),setTimeout((function(){e.focus()}))},TickTickText:function(e){de(e,"text"),setTimeout((function(){e.focus()}))}});var _e=r.keyMap.default===r.keyMap.macDefault?"Cmd":"Ctrl",Se=te(te({Backspace:function(e){if(e.getOption("disableInput"))return r.Pass;if(1!==e.listSelections().length)return r.Pass;var t=e.listSelections()[0];if(!t.empty())return r.Pass;var n=t.head,i=e.getLine(n.line);if(0===n.line&&0===n.ch&&0===i.length)return e.execCommand("deleteLine"),!0;var o=e.getTokenAt(n),a=" "+o.type+" ",s=a.match(/\sformatting-link-string\s/),c=a.match(/\sformatting-link\s/);if(s||c){var u=(0,f.O0)(e,n,!0);if(!u)return r.Pass;var d=ne(u,2),h=d[0],p=d[1],g=n.line;return s?")"===o.string?(e.replaceRange("",{line:g,ch:h.start-1},{line:g,ch:p.end+1},"manualMarkText"),!0):((0,f.rX)(e,{line:g,ch:p.start},{line:g,ch:p.end}),r.Pass):c?((0,f.rX)(e,{line:g,ch:p.start},{line:g,ch:p.end}),r.Pass):r.Pass}var v=a.match(/\sformatting-list-ol\s/);if(v||a.match(/\sformatting-list-ul\s/)||a.match(/\sformatting-checklist\s/)||a.match(/\sformatting-quote\s/)){var y={line:n.line,ch:o.start},b={line:n.line,ch:o.end};a.match(/\sformatting-checklist\s/)&&(y={line:n.line,ch:o.start-2});var k="\t";return function(e,t){var n=t-1;if(no}(e,n.line)&&(k=""),e.replaceRange(k,y,b,"manualMarkText"),v&&(0,l.xJ)(e,n.line+1),!0}return r.Pass},LeftClick:function(e,t){if(1===t.outside||Math.abs(t.xRel)>10)return r.Pass;var n=e.getTokenAt(t),i=" "+n.type+" ";if(i.match(/\slink\s/)){if(i.match(/\sformatting-link\s/))return r.Pass;var o=null;if(i.match(/\slinkify\s/))o=e.getRange({line:t.line,ch:n.start},{line:t.line,ch:n.end});else{var a=(0,f.O0)(e,t);a&&(o=a[1].string)}if(!o)return!0;var s=(0,m.WK)(o);if(s){var l={taskId:s.taskId,projectId:s.projectId};q.vp.dispatch("onTaskModalChange",l)}else{var c=function(){var e=ce.match(o);if(e){var t=e[0],n=t.url,r=t.raw;return n.replace(r,o)}return o}(),u=e.getOption("openLinkAction");u&&u(c),window.open(c,"_blank")}return!0}return r.Pass}},"".concat(_e,"-LeftClick"),(function(e,t){e.setSelection(t,t,!1)})),"Space",(function(e){!function(e,t){if(e.getOption("disableInput"))return r.Pass;var n=e.listSelections();if(!n||0===n.length)return r.Pass;var i=ne(n,1)[0].head.line;e.replaceSelection(t,void 0,"manualMarkText"),(0,f.pH)(e,i)}(e," ")}));V.IJ&&V.i7&&delete Se.Space,"Cmd"===_e?(Se["Cmd-Backspace"]=function(e){for(var t,n,i=e.doc.sel.ranges,o=[],a=0;a=0;u--)e.replaceRange("",o[u].from,o[u].to,"+delete");c&&e.endOperation()},Se["Cmd-Left"]=function(e){return e.extendSelectionsBy((function(t){return ke(e,t)}),{origin:"+move"})},Se["Ctrl-A"]=be,Se["".concat(_e,"-shift-0")]="TickTickFullScreen"):"Ctrl"===_e&&(Se["".concat(_e,"-alt-0")]="TickTickFullScreen",Se.Home=be);var Ee={"Shift-Enter":function(){}},Oe=ee(ee({},Se),{},(te(te(te(te(te(te(te(te(te(te(H={"Shift-Tab":"TickTickShiftTab",Tab:"TickTickTab"},"".concat(_e,"-["),(function(e){return Ce(e,!0)})),"".concat(_e,"-]"),(function(e){return we(e,!0)})),"Enter","TickTickNewlineAndContinue"),"Shift-Enter","TickTickNewline"),"".concat(_e,"-alt-1"),"TickTickHeading1"),"".concat(_e,"-alt-2"),"TickTickHeading2"),"".concat(_e,"-alt-3"),"TickTickHeading3"),"".concat(_e,"-alt-4"),ge),"".concat(_e,"-alt-5"),ve),"".concat(_e,"-alt-6"),ye),te(te(te(te(te(te(te(te(te(te(H,"".concat(_e,"-shift-8"),"TickTickUnorderedList"),"".concat(_e,"-shift-7"),"TickTickOrderedList"),"".concat(_e,"-shift-U"),"TickTickBlockquote"),"".concat(_e,"-shift-S"),"TickTickItemList"),"".concat(_e,"-B"),"TickTickBold"),"".concat(_e,"-I"),"TickTickItalic"),"".concat(_e,"-shift-X"),"TickTickStrikethrough"),"".concat(_e,"-U"),"TickTickUnderline"),"".concat(_e,"-shift-Y"),"TickTickHighlight"),"".concat(_e,"-K"),"TickTickShowLink"),te(te(H,"".concat(_e,"-alt-C"),"TickTickInlineCode"),"fallthrough","default")));Oe=r.normalizeKeyMap(Oe),r.keyMap.inline=ee(ee({},Ee),{},{fallthrough:"default"}),r.keyMap.ticktickmd=Oe,r.keyMap.tickticklink=ee(ee(ee({},Se),Ee),{},{fallthrough:"default"}),(0,c.$D)("customMarkOpen",(function(e,t){var n="customMarkOpen",r=e.cm;if(!(t.state.localState||t.state)[n])return null;var i={line:e.lineNo,ch:t.start},o=(0,u.G)(r).findSpanWithTypeAt(i,n),a=document.createElement("span");return a.innerText="",r.markText({line:i.line,ch:o.begin},{line:i.line,ch:o.end},{inclusiveLeft:!1,inclusiveRight:!1,selectLeft:!0,selectRight:!1,atomic:!0,replacedWith:a})}),!0),(0,c.$D)("customMarkClose",(function(e,t){var n="customMarkClose",r=e.cm;if(!(t.state.localState||t.state)[n])return null;var i={line:e.lineNo,ch:t.start},o=(0,u.G)(r).findSpanWithTypeAt(i,n),a=document.createElement("span");return a.innerText="",r.markText({line:i.line,ch:o.begin},{line:i.line,ch:o.end},{inclusiveLeft:!1,inclusiveRight:!1,selectLeft:!1,selectRight:!0,atomic:!0,replacedWith:a})}),!0),(0,c.$D)("customMark",(function(e,t){var n="customMark",r=e.cm,i=t.state.localState||t.state;return!i[n]||i.customMarkClose||i.customMarkOpen?null:function(e,t,n,r){var i=(0,u.G)(e).findSpanWithTypeAt(t,n);if(!i)return null;document.createElement("span").innerText="".concat(r.string);var o=r.state.style.background,a=r.state.style.color;return e.markText({line:t.line,ch:i.begin+1},{line:t.line,ch:i.end-1},{css:"background: ".concat(o,"; color: ").concat(a,";")})}(r,{line:e.lineNo,ch:t.start},n,t)}),!0);var Te=n("epob"),Le=n("Es6M"),Pe=n("y8mg"),Me=n.n(Pe);(0,c.$D)("image",(function(e,t){var n=t.state.localState||t.state,r=e.cm,i=r.getOption("renderImageMaker"),o=r.getOption("getAttachment");if(!i)return null;if(/\bformatting-image\b/.test(t.type)){var a,s=e.lineNo,l={line:s,ch:t.start},c={line:s,ch:t.end},u=n.image,f=null,d=null,h=(0,Te.$4)(u),p=(0,Le.FJ)(u).id,m=o({isLinkLike:h,url:u,attachmentId:p});if(console.info("image folder: ",{attachment:m,url:u,attachmentId:p}),null==m)return null;var g="image"!==((null===(a=m.get("fileType"))||void 0===a?void 0:a.toLowerCase())||""),v=document.createElement("span");return v.style.display="inline-block",v.style.marginTop="3px",v.style.marginBottom="3px",v.style.padding="1px 0",v.style.maxWidth="100%",g&&(v.style.width="100%"),i({markerId:Me().uniqueId("cm-marker-image-"),container:v,props:{url:u,removeText:function(){if(null!=f){var e=f.find();if(null!=e){var t=e.from,n=e.to;r.setCursor(t),r.replaceRange("",t,n,"+delete"),r.focus()}}},updateMarker:function(){null!=f&&(d&&clearTimeout(d),d=setTimeout((function(){f.changed()})))},selectMarker:function(){if(null!=f){var e=f.find();r.hasFocus()||(e&&e.from&&r.setCursor(e.from),r.focus()),setTimeout((function(){r.setSelection(e.from,e.to)}))}},isNewTask:r.getOption("isLocal"),isReadOnly:!!r.getOption("disableInput"),getRenderAttachment:o}}),(f=r.markText(l,c,{atomic:!0,clearOnEnter:!1,collapsed:!0,replacedWith:v})).widgetNode.style.display="inline-block",f.widgetNode.style.marginRight="5px",f.widgetNode.style.maxWidth="calc(100% - 5px)",g&&(f.widgetNode.style.width="calc(100% - 5px)"),f}return null}),!0);n("t5UX"),n("TWNs"),n("U3f4"),n("LD7m"),n("EnZy");function De(e){return De="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},De(e)}var je,Ne,Ie=i().Pos;function Re(e,t){for(var n=function(e){var t=e.flags;return null!=t?t:(e.ignoreCase?"i":"")+(e.global?"g":"")+(e.multiline?"m":"")}(e),r=n,i=0;ia);s++){var l=e.getLine(o++);r=null==r?l:r+"\n"+l}i*=2,t.lastIndex=n.ch;var c=t.exec(r);if(c){var u=r.slice(0,c.index).split("\n"),f=c[0].split("\n"),d=n.line+u.length-1,h=u[u.length-1].length;return{from:Ie(d,h),to:Ie(d+f.length-1,1==f.length?h+f[0].length:f[f.length-1].length),match:c}}}}function Fe(e,t,n){for(var r,i=0;i<=e.length;){t.lastIndex=i;var o=t.exec(e);if(!o)break;var a=o.index+o[0].length;if(a>e.length-n)break;(!r||a>r.index+r[0].length)&&(r=o),i=o.index+1}return r}function Ue(e,t,n){t=Re(t,"g");for(var r=n.line,i=n.ch,o=e.firstLine();r>=o;r--,i=-1){var a=e.getLine(r),s=Fe(a,t,i<0?0:a.length-i);if(s)return{from:Ie(r,s.index),to:Ie(r,s.index+s[0].length),match:s}}}function Ke(e,t,n){if(!Ae(t))return Ue(e,t,n);t=Re(t,"gm");for(var r,i=1,o=e.getLine(n.line).length-n.ch,a=n.line,s=e.firstLine();a>=s;){for(var l=0;l=s;l++){var c=e.getLine(a--);r=null==r?c:c+"\n"+r}i*=2;var u=Fe(r,t,o);if(u){var f=r.slice(0,u.index).split("\n"),d=u[0].split("\n"),h=a+f.length,p=f[f.length-1].length;return{from:Ie(h,p),to:Ie(h+d.length-1,1==d.length?p+d[0].length:d[d.length-1].length),match:u}}}}function Ye(e,t,n,r){if(e.length==t.length)return n;for(var i=0,o=n+Math.max(0,e.length-t.length);;){if(i==o)return i;var a=i+o>>1,s=r(e.slice(0,a)).length;if(s==n)return a;s>n?o=a:i=a+1}}function We(e,t,n,r){if(!t.length)return null;var i=r?je:Ne,o=i(t).split(/\r|\n\r?/);e:for(var a=n.line,s=n.ch,l=e.lastLine()+1-o.length;a<=l;a++,s=0){var c=e.getLine(a).slice(s),u=i(c);if(1==o.length){var f=u.indexOf(o[0]);if(-1==f)continue e;n=Ye(c,u,f,i)+s;return{from:Ie(a,Ye(c,u,f,i)+s),to:Ie(a,Ye(c,u,f+o[0].length,i)+s)}}var d=u.length-o[0].length;if(u.slice(d)==o[0]){for(var h=1;h=l;a--,s=-1){var c=e.getLine(a);s>-1&&(c=c.slice(0,s));var u=i(c);if(1==o.length){var f=u.lastIndexOf(o[0]);if(-1==f)continue e;return{from:Ie(a,Ye(c,u,f,i)),to:Ie(a,Ye(c,u,f+o[0].length,i))}}var d=o[o.length-1];if(u.slice(0,d.length)==d){var h=1;for(n=a-o.length+1;h0);)n.push({anchor:r.from(),head:r.to()});n.length&&this.setSelections(n,0)}))},LcUx:function(e,t,n){"use strict";n.d(t,{Z:function(){return J}});n("pNMO"),n("4Brf"),n("0oug"),n("4mDm"),n("5DmW"),n("27RR"),n("NBAS"),n("tkto"),n("ExoC"),n("SuFq"),n("PKPk"),n("3bBZ"),n("gXIK"),n("ma9I"),n("TeQF"),n("fbCW"),n("yq1k"),n("2B1R"),n("+2oP"),n("ToJy"),n("pDQq"),n("7+zs"),n("sMBO"),n("qePV"),n("zKZe"),n("07d7"),n("TWNs"),n("rB9j"),n("LD7m"),n("ALS0"),n("JfAA"),n("JTJg"),n("Rm1S"),n("OM9Z"),n("UxlC"),n("SYor"),n("FZtP");var r=n("q1tI"),i=n("Nr3o"),o=n.n(i),a=n("y8mg"),s=n.n(a),l=n("dmHn"),c=n.n(l),u=n("5WEu"),f=n("MlAn"),d=n("xS9v"),h=n("zoGk"),p=n("V/jI"),m=n("RDjN"),g=n("dvcG"),v=n("EPMa"),y=n.n(v),b=n("AtZj");function k(e){return k="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},k(e)}function w(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function C(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function K(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:this.props;return(null===(e=n.model)||void 0===e||null===(t=e.get)||void 0===t?void 0:t.call(e,"startDate"))||null}},{key:"getDateOptions",value:function(){var e=[],t=p.LO()?h.Z.toMoment():h.Z.toMoment().locale("en"),n=p.LO()?p.U2("today"):"Today",r=p.LO()?p.U2("tomorrow"):"Tomorrow",i=m.WUZ.atomTime,o=(0,O.I4)("MMMD"),a=p.LO()?"":" ",s=u.k8();e.push({match:t.format(o),key:t.startOf("day").format(i),calendar:n});for(var l=h.Z.toMoment().add(1,"days").format(o),c=h.Z.getCurrentInWhichDayOfWeek(),f=h.Z.toMoment(),d=[],g=0;g<7;g++)d.push(f.day(s+g).format("dddd"));for(var v=h.Z.toMoment(),y=1;y<=6-c;y++){var b=void 0;v.add(1,"days"),b=1===y?r:d[c+y],e.push({match:v.format(o),key:v.startOf("day").format(i),calendar:b})}for(var k=0;k<7;k++){v.add(1,"days");var w=l===v.format(o);e.push({match:v.format(o),key:v.startOf("day").format(i),calendar:w?r:(0,N.h3)(v.toDate())+a+d[k]})}var C=h.Z.toMoment().startOf("month").add(1,"month");e.push({match:C.format(o),key:C.format(i),calendar:p.U2("next_month")});var x=h.Z.toMoment();for(var _ in[2,3,4,5,6,7,8,9,10,11,12])x.add(1,"month"),e.push({match:"",key:x.startOf("month").format(i),calendar:x.startOf("month").format(o)});return e}},{key:"autoMatchDate",value:function(e){for(var t=this,n=/[#\uff03!\uff01\uff3e^~\uff5e@\uff20]/,r=/[*\uff0a]/,i=e.getCursor(),a=e.getLine(i.line),s=i.ch,l=i.ch-1;l>-1;l--){if(n.test(a.charAt(l))){l+=1;break}if(r.test(a.charAt(l)))break}l=Math.max(0,l);var c=a.slice(l,s).match(/([*\uff0a])(.*)/)?this.dateOptions.map((function(e){return{match:e.match+" "+e.calendar,hint:(e.calendar||e.match)+" "}})):[];e.showHint({hint:o().hint.date,completeSingle:!1,alignWithWord:!0,start:l+1,end:s,type:"*",source:c,nlpEnabled:!!u.U2("nlpEnabled"),callback:function(n,r){if(D.Z.shortcut("quick_add","set_due_date"),!u.U2("nlpEnabled")){var i=t.doSymbolDateParse({doc:e,text:r.text});t.updateDateChange(i)}}})}},{key:"doNlpDate",value:function(e){if(!this.isQuickDateNlpDisabled()){var t=e.getValue();if(u.U2("nlpEnabled")){var n=this.doSmartDateParse({doc:e,text:t});if(n?this.showToolTip(e):this.closeToolTip(e),null!=this.props.presetDateNlpMode){var r=this.isPresetDateNlpEnabled()&&!n&&null!=this.dateGroup;(n||!this.isPresetDateNlpEnabled()||r)&&this.updateDateChange(n,{shouldRestorePresetDate:r})}else this.updateDateChange(n);this.highlightBlock(e,n,{className:"cm-bold",handleMouseEvents:!0})}}}},{key:"getNlpDisabledText",value:function(e){var t=e.getAllMarks().filter((function(e){return e.markType&&"date"!==e.markType&&"date-disabled"!==e.markType})).map((function(t){return e.getRange(t.find().from,t.find().to)}));return this.nlpDisabledText.concat(t)}},{key:"isPresetDateNlpEnabled",value:function(){var e=this.props,t=e.enablePresetDateNlp,n=e.model;return!!(t&&(null===n||void 0===n?void 0:n.get)&&n.get("startDate"))}},{key:"getPresetDateNlpAnchorDate",value:function(){return this.presetDateNlpAnchorDate||this.getModelStartDate()}},{key:"getPresetDateNlpRefDate",value:function(){if(!this.isPresetDateNlpEnabled())return null;if("dateTime"===this.props.presetDateNlpMode){var e=G(this.getPresetDateNlpAnchorDate());return(t=e)&&c()(t).startOf("day").isAfter(c()().startOf("day"))?e:null}var t;return G(this.getPresetDateNlpAnchorDate())}},{key:"isQuickDateNlpDisabled",value:function(){return this.props.isQuickDateDisabled&&!this.isPresetDateNlpEnabled()}},{key:"filterPresetDateParseResult",value:function(e){if(!e||!this.isPresetDateNlpEnabled())return e;if("dateTime"===this.props.presetDateNlpMode)return e;var t=this.getPresetDateNlpAnchorDate();return t?function(e,t){return Q(e,t.startDate)&&!t.isAllDay}(t,e)?e:null:e}},{key:"filterPresetDateSymbolParseResult",value:function(e){if(!e||!this.isPresetDateNlpEnabled())return e;if("dateTime"===this.props.presetDateNlpMode)return e;var t=this.getPresetDateNlpAnchorDate();return t?Q(t,e.startDate)?e:null:e}},{key:"doSmartDateParse",value:function(e){var t=e.doc,n=e.text,r=this.getPresetDateNlpRefDate(),i=t?d.BY(n,this.getNlpDisabledText(t)):n,o=f.Sg(i,r?{refDate:r}:void 0),a=this.filterPresetDateParseResult(o);return a?(this.buildDateGroupData(a),a):null}},{key:"doSymbolDateParse",value:function(e){var t=this,n=e.text,r=n.match(/([^\s*]+)(?:\s|$)/g)||[];if(null===r)return null;for(var i,o=function(){var e="";if(t.dateOptions.find((function(t){return n.includes(t.calendar)?(e=t.calendar,!0):!(!t.match||!n.includes(t.match))&&(e=t.match,!0)}))){var r=t.filterPresetDateSymbolParseResult(f.JD(e));return r?(t.buildDateGroupData(r),{v:r}):{v:null}}},a=0;a=0){var s=o().Pos(0,a+n+t.length);if(0===e.findMarksAt(s).filter((function(e){return"date-disabled"===e.markType})).length){i={start:a+n,end:a+n+t.length,highlight:t};break}n+=t.length}else n+=t.length}return i})).sort((function(e,t){return e.start>t.start?1:-1})).forEach((function(t){var n=t.start,r=t.end,i=t.highlight,s=a[a.length-1];if(s){var l=o().Pos(0,s.end),c=o().Pos(0,n);s.end+1>n?(s.end=r,s.highlight+=i):e.getRange(l,c)&&0===e.getRange(l,c).replace(" ","").length?(s.end=r,s.highlight+=e.getRange(l,c)+i):a.push({start:n,end:r,highlight:i})}else a.push({start:n,end:r,highlight:i})})),a.forEach((function(t){var r=t.start,i=t.end,a=o().Pos(0,r),s=o().Pos(0,i);e.findMarks(a,s).length||e.markText(a,s,Z({markType:"date"},n))}))}}},{key:"onKeyDown",value:function(e,t){if(t.keyCode===M.Z.backspace){var n=e.getCursor(),r=e.findMarksAt(n);if(r&&r.length){var i=r[0];if("date"===i.markType){if(i.find().from.ch!==n.ch){t.preventDefault();var o=i.find().from,a=i.find().to;this.nlpDisabledText.push(e.getRange(o,a)),i.clear(),e.markText(o,a,{markType:"date-disabled",className:"cm-disable"}),this.doNlpDate(e)}}else if("date-disabled"===i.markType&&i.find().from.ch!==n.ch){var s=i.find().from,l=i.find().to,c=e.getRange(s,l),u=this.nlpDisabledText.indexOf(c);this.nlpDisabledText.splice(u,1),i.clear()}}}}},{key:"onFocusEditor",value:function(e,t){this.isQuickDateNlpDisabled()&&(e.getAllMarks().filter((function(e){return"date"===e.markType||"date-disabled"===e.markType})).forEach((function(e){return e.clear()})),this.closeToolTip(e)),this.props.onFocus&&this.props.onFocus(e,t)}},{key:"onClickEditor",value:function(e,t){e.hasFocus()&&u.U2("nlpEnabled")&&this.unhighlightBlock(e,t),this.props.onClick&&this.props.onClick(e,t)}},{key:"unhighlightBlock",value:function(e,t){var n=e.findMarksAt(t);if(n&&n.length){var r=n[0];if("date"===r.markType&&t.xRel<0){var i=r.find().from,o=r.find().to;this.nlpDisabledText.push(e.getRange(i,o)),r.clear(),e.markText(i,o,{markType:"date-disabled",className:"cm-disable"}),this.doNlpDate(e)}}}},{key:"renderToolTip",value:function(){var e=this.state.toolTipStatus;return e.isAble?r.createElement(j.Z,null,r.createElement(S,{ref:this.toolTipRef,isVisible:e.isVisible,position:e.position},p.U2("smart_parsing_reminder"))):null}},{key:"showToolTip",value:function(e){var t=e.getAllMarks().filter((function(e){return"date"===e.markType})),n=t[0];if(n){var r=n.find(),i=e.charCoords({line:r.from.line,ch:r.from.ch});this.setState({toolTipStatus:Z(Z({},this.state.toolTipStatus),{},{isVisible:!0,position:{left:i.left-34,top:i.bottom+10}})})}}},{key:"closeToolTip",value:function(){this.state.toolTipStatus.isVisible&&(this.setState({toolTipStatus:Z(Z({},this.state.toolTipStatus),{},{isVisible:!1,isAble:!1})}),g.JU(m.PpT.smartDateParsing,"hide"))}},{key:"updateDateChange",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=!!e,r=n?this.buildDateGroupData(e).dateGroup:null;this.dateGroup=r,this.props.onChangeParse&&this.props.onChangeParse("date",{dateGroup:r,shouldRestorePresetDate:!!t.shouldRestorePresetDate})}},{key:"buildDateGroupData",value:function(e){var t=this.props.isSubscribeCalendar,n={startDate:h.Z.toMoment(e.startDate).locale("en").format(m.WUZ.atomTime),dueDate:e.dueDate?h.Z.toMoment(e.dueDate).locale("en").format(m.WUZ.atomTime):t&&e.isAllDay?h.Z.toMoment(e.startDate).locale("en").add(1,"day").format(m.WUZ.atomTime):h.Z.toMoment(e.startDate).locale("en").format(m.WUZ.atomTime),repeatFlag:e.isNative?e.repeat.repeatFlag:(0,T.Fo)({date:e.repeat.date,repeatData:e.repeat}),isAllDay:e.isAllDay,reminders:e.reminder,trigger:"",isFloating:!1,timeZone:E.vN,annoyingAlert:e.annoyingAlert};return e.repeat&&(n.repeatFrom=e.repeat.repeatFrom),e.dateGroup=n,e}},{key:"handleAddData",value:function(e,t,n){var r=e.getAllMarks().filter((function(e){return"date"===e.markType}));if(r.length&&(!u.U2("nlpEnabled")||u.U2("removeDate"))){var i=r.map((function(t){var n=t.find(),r=e.getRange({ch:n.from.ch-1,line:n.from.line},n.from);/[*\uff0a]/.test(r)&&n.from.ch--;var i=e.getRange({ch:n.from.ch-1,line:n.from.line},n.from);/\s/.test(i)&&n.from.ch--;var o=e.getRange(n.to,{ch:n.to.ch+1,line:n.to.line});return/\s/.test(o)&&n.to.ch++,n}));Object.assign(t,{extractPos:(t.extractPos||[]).concat(i)})}return Object.assign(t,{dateGroup:this.dateGroup}),this.props.onAdd&&this.props.onAdd(e,t,n)}},{key:"handleBatchAddData",value:function(e){var t,n,r=this,i=e.map((function(e){var t=e.title;if(r.isQuickDateNlpDisabled())return e;var n=u.U2("nlpEnabled")?r.doSmartDateParse({text:t}):null,i=t;return n?(!u.U2("removeDate")&&u.U2("nlpEnabled")||((n.highlight||[]).forEach((function(e){var t="\\*{0,1}"+e.trim().replace(/\s/g,"\\s");i=i.replace(new RegExp(t),"")})),i=i.replace(/\s+/g," ").replace(/^\s*/g,"")),Object.assign(e,{title:i,dateGroup:n.dateGroup})):e}));return null===(t=(n=this.props).onBatchAdd)||void 0===t?void 0:t.call(n,i)}},{key:"onClickBody",value:function(e){var t=e.target||null;t&&!$(t).closest(this.toolTipRef.current).length&&this.closeToolTip()}}],a&&K(i.prototype,a),l&&K(i,l),Object.defineProperty(i,"prototype",{writable:!1}),i;var i,a,l}(r.Component);return q(t,"defaultProps",{allowAutoMatchDate:!0}),t.displayName="WithDateSetting(".concat(function(e){return e.displayName||e.name||"Component"}(e),")"),r.forwardRef((function(e,n){return r.createElement(t,F({},e,{forwardedRef:n}))}))}function G(e){return I.Z.parseUTCString(e)}function Q(e,t){var n,r,i=G(e),o=function(e){if(!e)return null;var t=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})/.exec(e);return t?new Date(Number(t[1]),Number(t[2])-1,Number(t[3]),Number(t[4]),Number(t[5]),Number(t[6])):null}(t);return!(!i||!o||(n=i,r=o,n.getFullYear()!==r.getFullYear()||n.getMonth()!==r.getMonth()||n.getDate()!==r.getDate()))}},rFuB:function(e,t,n){"use strict";n.d(t,{Z:function(){return O}});n("pNMO"),n("4Brf"),n("0oug"),n("5DmW"),n("27RR"),n("NBAS"),n("tkto"),n("ExoC"),n("SuFq"),n("gXIK"),n("ma9I"),n("TeQF"),n("fbCW"),n("pjDv"),n("yq1k"),n("4mDm"),n("oVuX"),n("2B1R"),n("+2oP"),n("ToJy"),n("7+zs"),n("sMBO"),n("Tskq"),n("qePV"),n("zKZe"),n("07d7"),n("TWNs"),n("rB9j"),n("LD7m"),n("ALS0"),n("JfAA"),n("YGK4"),n("JTJg"),n("PKPk"),n("Rm1S"),n("UxlC"),n("SYor"),n("FZtP"),n("3bBZ");var r=n("q1tI"),i=n("Nr3o"),o=n.n(i),a=n("CGpF"),s=n("1/gw"),l=n("rviF"),c=n("l3/N"),u=["forwardedRef","onChange"];function f(e){return f="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},f(e)}function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,t)||p(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,t){var n="undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=p(e))||t&&e&&"number"===typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function p(e,t){if(e){if("string"===typeof e)return m(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)?m(e,t):void 0}}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function k(e,t){for(var n=0;n0){var o=new RegExp("[".concat(i,"]")+t.replace(a.Z.escapeReg,"\\$1").replace(/\s/g,"\\s")+"(?:/(".concat(r.map((function(e){return"(".concat(e.replace(a.Z.escapeReg,"\\$1").replace(/\s/g,"\\s"),")")})).join("|"),"))?")+"\\s","ig"),s=e.match(o);return s?{reg:o,textMatch:s}:null}}var l="[".concat(i,"]").concat(t.replace(a.Z.escapeReg,"\\$1").replace(/\s/g,"\\s"),"\\s"),f=new RegExp(l,"ig"),d=e.match(f);return d?{reg:f,textMatch:d}:null},f=s(n)||s(r)||{},d=f.textMatch,h=f.reg;if(d&&h)for(var p=0,m=d.length;pt.index?1:-1}))})),r.onUpdateText=r.onUpdateText.bind(r),r.onClickEditor=r.onClickEditor.bind(r),r.onFocusEditor=r.onFocusEditor.bind(r),r.onPasteText=r.onPasteText.bind(r),r.onResetEditor=r.onResetEditor.bind(r),r.onMouseDownEditor=r.onMouseDownEditor.bind(r),r.handleAddData=r.handleAddData.bind(r),r.handleBatchAddData=r.handleBatchAddData.bind(r),r.onTypeKeyChange=r.onTypeKeyChange.bind(r),r.completionData=null,r.isClickHighlightMarker=null,r}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_(e,t)}(O,E),T=O,(L=[{key:"render",value:function(){var t=this.props,n=t.forwardedRef,i=(t.onChange,b(t,u));return r.createElement(r.Fragment,null,r.createElement(e,y({},i,{ref:n,onAdd:this.handleAddData,onBatchAdd:this.handleBatchAddData,onChange:this.onUpdateText,onClick:this.onClickEditor,onMouseDown:this.onMouseDownEditor,onFocus:this.onFocusEditor,onPasteText:this.onPasteText,onReset:this.onResetEditor,onTypeKeyChange:this.onTypeKeyChange})))}},{key:"handleAddData",value:function(e,t,r){var i=this.props,a=i.projectId,s=i.isSubscribeCalendar,l=e.getAllMarks().filter((function(e){return e.markType===n})),c=v({},t);if(l.length){var u,f=l.pop().find(),d=o().Pos(f.to.line,f.to.ch+1),h=e.getRange(f.from,d),p=h.trim().slice(1);if(void 0!==(u=this.completionData&&this.completionData.text&&this.completionData.text.trim()===h.trim()?this.completionData.key:g(p,{projectId:a,isSubscribeCalendar:s}))){c=C(v({},t),{key:u,text:h});var m=e.getRange({ch:f.from.ch-1,line:f.from.line},f.from);/\s/.test(m)&&f.from.ch--;var y=e.getRange(f.to,{ch:f.to.ch+1,line:f.to.line});/\s/.test(y)&&f.to.ch++,Object.assign(c,{extractPos:(c.extractPos||[]).concat([{from:f.from,to:f.to}])})}}return this.props.onAdd&&this.props.onAdd(e,c,r)}},{key:"handleBatchAddData",value:function(e){var t,n,r=this,i=e.map((function(e){var t=/\s$/.test(e.title)?e.title:"".concat(e.title," "),n=r.findMatchFromText(t).pop();if(n){var i=e.title,o=i.slice(0,n.index).concat(i.slice(n.index+n.fingerprint.length));return C(v(v({},e),{},{title:o}),{key:n.id})}return e}));return null===(t=(n=this.props).onBatchAdd)||void 0===t?void 0:t.call(n,i)}},{key:"isDisabled",value:function(){return f&&this.props[f]}},{key:"isCertainSetted",value:function(){return p&&this.props[p]}},{key:"onUpdateText",value:function(e,t){t.origin==="select-".concat(n)||this.isDisabled()||this.autoMatch(e),this.props.onChange&&this.props.onChange(e,t)}},{key:"onResetEditor",value:function(){this.completionData=null}},{key:"onPasteText",value:function(e,t){var n,r=t.startCursor,i=t.endCursor,o=t.text,a=t.newText,s=r.ch,l=s+o.length,c=this.findMatchFromText(a).filter((function(e){return!(e.index+e.fingerprint.length-1l)}));if(c.length){var u=c[c.length-1],f=u.index,d=u.index+u.fingerprint.length;n={from:{line:r.line,ch:f},to:{line:i.line,ch:d}}}return n&&this.highlightMarker(e,n.from,n.to),this.props.onPasteText&&this.props.onPasteText(e,{startCursor:r,endCursor:i,text:o,newText:a})||!!n}},{key:"autoMatch",value:function(e){for(var r=this,u=this.props,f=u.projectId,p=u.isSubscribeCalendar,g="project"===n&&p&&!c.uY(),v=e.getCursor(),y=t({projectId:f,isSubscribeCalendar:p}),b=this.isSupportProjectColumn()?new Map(y.map((function(e){return[e.match,new Set(e.columns.map((function(e){return e.get("name")})))]}))):new Map,k=y.map((function(e){return e.match})).concat(y.map((function(e){return e.match1}))).filter(Boolean),w=e.getLine(v.line),C=v.ch,x=w.slice(0,C),_=new RegExp("([".concat(i,"])([^").concat(i,"]*)$"),"i"),S={index:-1,text:"",prefix:""},E=x,O=function(){var e=_.exec(E);if(!e)return 0;var t=e.index,n=e[2]+S.prefix+S.text;if(!k.find((function(e){if(r.isSupportProjectColumn()){var t=d(n.replace(/\s$/,"").split("/"),2),i=t[0],o=t[1],a=e.includes(i),l=b.get(i)?b.get(i):new Set,c=!o||l.has(o);return a&&c}return(0,s.B)(e,n)||(0,s.B)(e,n.replace(/\s$/,""))})))return 0;S.index=t,S.text=n,S.prefix=e[1],E=x.slice(0,t)};E&&0!==O(););this.isSupportProjectColumn()||g||S.index>-1&&(this.matchPieceText=S.text,e.showHint({hint:m,completeSingle:!1,alignWithWord:!0,text:S.text,start:S.index,end:C,callback:function(t,i){var a=S.prefix+i.text;switch(e.replaceRange(a,t.from,t.to,"select-".concat(n)),r.highlightMarker(e,t.from,o().Pos(t.from.line,t.from.ch+i.text.length+1),{key:i.key,text:a}),n){case"project":l.Z.shortcut("quick_add","add_to_list");break;case"priority":l.Z.shortcut("quick_add","set_priority");break;case"assign":l.Z.shortcut("quick_add","assign_to_member")}},source:y}));var T={start:-1,end:-1};if(S.index>-1)for(var L,P=x.substring(S.index),M="assign"===n?new RegExp("([".concat(i,"])(.*)\\s"),"ig"):new RegExp("([".concat(i,"])([^").concat(i,"]*)\\s"),"ig");null!==(L=M.exec(P));){var D,j=S.index+L.index,N=j+1,I=w.slice(N),R=void 0,A=h(k);try{for(A.s();!(D=A.n()).done;){var B=D.value,Z=B.toLowerCase();if(this.isSupportProjectColumn()){var F=b.get(B)?Array.from(b.get(B)):[];if(F.length>0){var U=new RegExp("^"+B.replace(a.Z.escapeReg,"\\$1").replace(/\s/g,"\\s")+"(?:/(".concat(F.map((function(e){return"(".concat(e.replace(a.Z.escapeReg,"\\$1").replace(/\s/g,"\\s"),")")})).join("|"),"))?")+"\\s","");if(R=I.match(U))break}}var K=new RegExp("^"+Z.replace(a.Z.escapeReg,"\\$1").replace(/\s/g,"\\s")+"\\s","i");if(R=I.match(K))break}}catch(W){A.e(W)}finally{A.f()}R&&(T.start=j,T.end=N+R[0].length)}if(T.start>-1){var Y={from:o().Pos(v.line,T.start),to:o().Pos(v.line,T.end)};this.highlightMarker(e,Y.from,Y.to)}else this.clearMarkers(e,{from:o().Pos(v.line,v.ch-1),to:o().Pos(v.line,v.ch)})}},{key:"onTypeKeyChange",value:function(e,t,r){var i=this.props.onTypeKeyChange;if(r===n){var o=e.getAllMarks().filter((function(e){return e.markType===r}));if(o.length&&(this.updateCompletion(e),o.forEach((function(e){return e.clear()}))),!t){var a,s=e.getValue(),l=s.length,c=e.getCursor(),u=this.findMatchFromText(s).filter((function(e){return!(e.index+e.fingerprint.length-1<0)&&!(e.index>l)}));if(u.length){var f=u[u.length-1],d=f.index,h=f.index+f.fingerprint.length;a={from:{line:c.line,ch:d},to:{line:c.line,ch:h}}}a&&this.highlightMarker(e,a.from,a.to)}}null===i||void 0===i||i(e,t,r)}},{key:"clearMarkers",value:function(e,t){var r=(t?e.findMarks(t.from,t.to):e.getAllMarks()).filter((function(e){return e.markType===n}));r.length&&(this.updateCompletion(e),r.forEach((function(e){return e.clear()})))}},{key:"highlightMarker",value:function(e,t,r,i){var a=e.getAllMarks().filter((function(e){return e.markType===n})),s=a.map((function(e){return e.find()}));a.forEach((function(e){return e.clear()})),this.updateCompletion(e,{from:t,to:r},i);var l="priority"===n&&this.completionData&&Object.prototype.hasOwnProperty.call(this.completionData,"key")?"cm-priority-".concat(this.completionData.key):"",c=o().Pos(r.line,r.ch-1);e.markText(t,c,{className:"cm-bold ".concat(l),markType:n,handleMouseEvents:!0}),s.forEach((function(i){i.from.ch!==t.ch&&i.to.ch!==r.ch&&e.replaceRange("",i.from,{line:i.to.line,ch:i.to.ch+1},"select-".concat(n))}))}},{key:"unhighlightMarker",value:function(e,t){if(e.hasFocus()&&this.isClickHighlightMarker){var r=e.findMarksAt(t);if(r&&r.length){var i=r[0];i.markType===n&&(this.updateCompletion(e),i.clear())}}}},{key:"onMouseDownEditor",value:function(e,t){this.isClickHighlightMarker=$(t.target).hasClass("cm-bold"),this.props.onMouseDown&&this.props.onMouseDown(e,t)}},{key:"onClickEditor",value:function(e,t){this.unhighlightMarker(e,t),this.props.onClick&&this.props.onClick(e,t)}},{key:"onFocusEditor",value:function(e,t){(this.isDisabled()||this.isCertainSetted())&&e.getAllMarks().filter((function(e){return e.markType===n})).forEach((function(e){return e.clear()})),this.props.onFocus&&this.props.onFocus(e,t)}},{key:"updateCompletion",value:function(e,t,r){var i=this.props,o=i.projectId,a=i.isSubscribeCalendar,s=null;if(r)s={key:r.key,text:r.text};else if(t){var l=e.getRange(t.from,t.to).trim().slice(1),c=g(l,{projectId:o,isSubscribeCalendar:a});s=null==c?{}:{key:c,text:l}}this.completionData=s,this.props.onChangeParse&&this.props.onChangeParse(n,s&&s.key)}}])&&k(T.prototype,L),P&&k(T,P),Object.defineProperty(T,"prototype",{writable:!1}),T;var T,L,P}(r.Component);return E.displayName="WithQuickSetting(".concat(function(e){return e.displayName||e.name||"Component"}(e),")"),r.forwardRef((function(e,t){return r.createElement(E,y({},e,{forwardedRef:t}))}))}}},"wR+Z":function(e,t,n){"use strict";n.d(t,{Z:function(){return E}});n("pNMO"),n("4Brf"),n("0oug"),n("pjDv"),n("NBAS"),n("tkto"),n("ExoC"),n("SuFq"),n("JfAA"),n("gXIK"),n("ma9I"),n("TeQF"),n("fbCW"),n("4mDm"),n("oVuX"),n("2B1R"),n("+2oP"),n("ToJy"),n("7+zs"),n("sMBO"),n("Tskq"),n("qePV"),n("zKZe"),n("07d7"),n("5s+n"),n("rB9j"),n("ALS0"),n("YGK4"),n("PKPk"),n("Rm1S"),n("UxlC"),n("SYor"),n("FZtP"),n("3bBZ");var r=n("q1tI"),i=n("Nr3o"),o=n.n(i),a=n("l3/N"),s=n("NMvI"),l=n("fEur"),c=n("5WEu"),u=n("RDjN"),f=n("rviF"),d=n("ylzY"),h=["forwardedRef","onChange"];function p(e){return p="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},p(e)}function m(e){return function(e){if(Array.isArray(e))return g(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"===typeof e)return g(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return g(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function b(e,t){for(var n=0;n|#]+)\s/gi),i=new Map(s.NJ().toArray().map((function(e){return[e.get("name"),s.Gf(e)]})));if(e.getAllMarks().filter((function(e){return"tag"===e.markType})).forEach((function(e){return e.clear()})),r){var a=0;(r||[]).map((function(e){var t=e.trim(),r=n.slice(a).indexOf(t),i={start:a+r,end:a+r+t.length,highlight:t};return a=r+e.length,i})).sort((function(e,t){return e.start>t.start?1:-1})).forEach((function(n){var r=n.start,a=n.end,s=n.highlight,l=o().Pos(0,r),c=o().Pos(0,a);if(!e.findMarks(l,c).length){var u=s.slice(1),f=u.toLowerCase();t.highlightTagBlock(e,l,c,f,i.get(f)||u)}}))}this.updateCompletion(e)}else this.updateCompletion(e)}},{key:"onUpdateText",value:function(e,t){var n=this.props,r=n.isQuickTagDisabled,i=n.onChange;r||(c.YL()&&this.autoMatchTag(e),this.doTagParse(e)),i&&i(e,t)}},{key:"onTypeKeyChange",value:function(e,t,n){var r=this.props,i=r.isQuickTagDisabled,o=r.onTypeKeyChange;"tag"===n&&(e.getAllMarks().filter((function(e){return"tag"===e.markType})).forEach((function(e){return e.clear()})),t||i||!c.YL()?this.updateCompletion(e):this.doTagParse(e)),null===o||void 0===o||o(e,t,n)}},{key:"autoMatchTag",value:function(e){for(var t=/\s/,n=e.getCursor(),r=e.getLine(n.line),i=n.ch-1,a=n.ch;i>-1;i--)if(t.test(r.charAt(i))){i+=1;break}i<0&&(i=0);var l=r.slice(i,a).match(/^[#|\uff03]([^\\\/\*\"\:\?\<\>\|#|\uff03|\s]*)/),c=e.findMarks(o().Pos(n.line,i),o().Pos(n.line,a));if(!l||c.length&&"tag"===c[0].markType)return o().Pass;var u=s.xB(),d=e.getAllMarks().filter((function(e){return"tag"===e.markType})).map((function(t){var n=t.find(),r=e.getRange(n.from,n.to);return(r&&r.trim().slice(1)).toLowerCase()})).filter((function(e){return!!e})),h=new Set(d),p=u.filter((function(e){return!h.has(e.toLowerCase())})).map((function(e){return{match:e,hint:e+" "}})),m=new Set(u.map((function(e){return e.toLowerCase()}))),g=l[1]||"";e.showHint({hint:o().hint.tag,completeSingle:!1,alignWithWord:!0,text:g,start:i,end:a,callback:function(e,t){f.Z.shortcut("quick_add","set_tag")},source:p,originSourceSet:m})}},{key:"unhighlighTagBlock",value:function(e,t){if(!t.xRel){var n=e.findMarksAt(t);if(n&&n.length){var r=n[0];if("tag"===r.markType){var i=r.find().from,o=r.find().to;r.clear(),e.markText(i,o,{markType:"tag-disabled",className:"cm-disable"});var a=e.getCursor();setTimeout((function(){e.setCursor(a)})),this.updateCompletion(e.getDoc())}}}this.props.onClick&&this.props.onClick(e,t)}},{key:"handleAddData",value:function(e,t,n){var r=this.props.onAdd,i=e.getAllMarks().filter((function(e){return"tag"===e.markType})),o=c.YL()?[]:this.getDefaultTags();if(i.length){var a=i.map((function(t){var n=t.find(),r=e.getRange(n.from,n.to);return(r&&r.trim().slice(1)).toLowerCase()})).filter((function(e){return!!e}));if(c.U2("removeTag")){var s=i.map((function(t){var n=t.find(),r=e.getRange({ch:n.from.ch-1,line:n.from.line},n.from);/\s/.test(r)&&n.from.ch--;var i=e.getRange(n.to,{ch:n.to.ch+1,line:n.to.line});return/\s/.test(i)&&n.to.ch++,n})).sort((function(e,t){return e.from.ch-t.from.ch}));Object.assign(t,{extractPos:(t.extractPos||[]).concat(s)})}Object.assign(t,{tags:m(new Set([].concat(m(o),m(a))))})}else o.length&&Object.assign(t,{tags:m(new Set([].concat(m(t.tags||[]),m(o))))});return r&&r(e,t,n)}},{key:"handleBatchAddData",value:function(e){var t=this.props.onBatchAdd,n=this.getDefaultTags();if(!c.YL()){var r=e.map((function(e){return n.length?Object.assign(e,{tags:m(new Set([].concat(m(e.tags||[]),m(n))))}):e}));return null===t||void 0===t?void 0:t(r)}var i=e.map((function(e){for(var t=m(n),r=$.trim(e.title),i=/^#([^\\\/\"#:\*\?<>\|\s]+\s+)|(\s+#[^\\\/\"#:\*\?<>\|\s]+)$|^#([^\\\/\"#:\*\?<>\|\s]+)$|\s+#[^\\\/\"#:\*\?<>\|\s]+\s+/g,o=[],a="",s=0,l=i.exec(r);l;)o.push({fingerprint:l[0],index:l.index}),i.lastIndex-=1,l=i.exec(r);return o.forEach((function(e){var n=e.index,i=e.fingerprint,o=i.trim().slice(1);-1===t.indexOf(o)&&t.push(o.toLowerCase()),s>n&&(s=n),a+=r.slice(s,n),s=n+i.length})),a+=r.slice(s),t.length?Object.assign(e,{tags:t,title:a}):e}));return null===t||void 0===t?void 0:t(i)}},{key:"getDefaultTags",value:function(){var e=[],t=this.props,n=t.groupBy,r=t.columnId,i=t.presetProperties;if(this.props.isQuickTagDisabled)return[];var o=c.bz();if(a.Rq())if(a.kG()&&n===u.X9E.tag){if(r===u.iij)return[];r&&e.push(r)}else{var f=s.Js();e.push(f)}else if(i&&void 0!==i.tags){var d=i.tags;if(null==d)return[];d[0]&&e.push(d[0])}else if(a.rQ())if(l.nQ())if(a.kG()&&n===u.X9E.tag){if(r===u.iij)return[];r&&e.push(r)}else{var h=l.S0();if(h){var p=h.map((function(e){return"#"+e})).join(" ").slice(1);e.push(p)}}else if(a.kG()&&n===u.X9E.tag){if(r===u.iij)return[];r&&e.push(r)}else e.push.apply(e,m(o));else if(a.kG()&&n===u.X9E.tag){if(r===u.iij)return[];r&&e.push(r)}else e.push.apply(e,m(o));return e}}])&&b(i.prototype,p),g&&b(i,g),Object.defineProperty(i,"prototype",{writable:!1}),i;var i,p,g}(r.Component);return t.displayName="WithTagSetting(".concat(function(e){return e.displayName||e.name||"Component"}(e),")"),r.forwardRef((function(e,n){return r.createElement(t,v({},e,{forwardedRef:n}))}))}},Chbu:function(e,t,n){"use strict";n.d(t,{Z:function(){return pe}});n("pNMO"),n("4Brf"),n("0oug"),n("gXIK"),n("TeQF"),n("fbCW"),n("yq1k"),n("4mDm"),n("7+zs"),n("qePV"),n("5DmW"),n("27RR"),n("NBAS"),n("tkto"),n("ExoC"),n("07d7"),n("SuFq"),n("rB9j"),n("ALS0"),n("JTJg"),n("PKPk"),n("UxlC"),n("FZtP"),n("3bBZ");var r=n("y8mg"),i=n.n(r),o=n("EPMa"),a=n.n(o),s=n("Nr3o"),l=n.n(s),c=n("q1tI"),u=n("3KU8"),f=n.n(u),d=n("iEvi"),h=n("pWE6"),p=n("4oOC"),m=n("DhZW"),g=n("Mfe1"),v=n("ylzY"),y=n("/Qhg"),b=n.n(y),k=n("Ag2S"),w=n("PGqD");n("E9XD"),n("SYor"),n("oVuX"),n("TWNs"),n("LD7m"),n("JfAA"),n("Rm1S");function C(e,t){return Array(t+1).join(e)}var x=["ADDRESS","ARTICLE","ASIDE","AUDIO","BLOCKQUOTE","BODY","CANVAS","CENTER","DD","DIR","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","FRAMESET","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","HTML","ISINDEX","LI","MAIN","MENU","NAV","NOFRAMES","NOSCRIPT","OL","OUTPUT","P","PRE","SECTION","TABLE","TBODY","TD","TFOOT","TH","THEAD","TR","UL"];function _(e){return T(e,x)}var S=["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"];function E(e){return T(e,S)}var O=["A","TABLE","THEAD","TBODY","TFOOT","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"];function T(e,t){return t.indexOf(e.nodeName)>=0}function L(e,t){return e.getElementsByTagName&&t.some((function(t){return e.getElementsByTagName(t).length}))}var P={};function M(e){return e?e.replace(/(\n+\s*)+/g,"\n"):""}P.paragraph={filter:["p","div"],replacement:function(e){return"\n\n"+e+"\n\n"}},P.lineBreak={filter:"br",replacement:function(e,t,n){return n.br+"\n"}},P.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function(e,t,n){var r=Number(t.nodeName.charAt(1));return"setext"===n.headingStyle&&r<3?"\n\n"+e+"\n"+C(1===r?"=":"-",e.length)+"\n\n":"\n\n"+C("#",r)+" "+e+"\n\n"}},P.blockquote={filter:"blockquote",replacement:function(e){return"\n\n"+(e=(e=e.replace(/^\n+|\n+$/g,"")).replace(/^/gm,"> "))+"\n\n"}},P.list={filter:["ul","ol"],replacement:function(e,t){var n=t.parentNode;return"LI"===n.nodeName&&n.lastElementChild===t?"\n"+e:"\n\n"+e+"\n\n"}},P.listItem={filter:"li",replacement:function(e,t,n){e=e.replace(/^\n+/,"").replace(/\n+$/,"\n").replace(/\n/gm,"\n ").replace(/(\n )*$/,"");var r=n.bulletListMarker+" ",i=t.parentNode;if("OL"===i.nodeName){var o=i.getAttribute("start"),a=Array.prototype.indexOf.call(i.children,t);r=(o?Number(o)+a:a+1)+". "}return r+e+(t.nextSibling&&!/\n$/.test(e)?"\n":"")}},P.indentedCodeBlock={filter:function(e,t){return"indented"===t.codeBlockStyle&&"PRE"===e.nodeName&&e.firstChild&&"CODE"===e.firstChild.nodeName},replacement:function(e,t,n){return console.log("indent",t),"\n\n "+t.firstChild.textContent.replace(/\n/g,"\n ")+"\n\n"}},P.fencedCodeBlock={filter:function(e,t){return"fenced"===t.codeBlockStyle&&"PRE"===e.nodeName&&e.firstChild&&"CODE"===e.firstChild.nodeName},replacement:function(e,t,n){for(var r,i=((t.firstChild.getAttribute("class")||"").match(/language-(\S+)/)||[null,""])[1],o=t.firstChild.textContent,a=n.fence.charAt(0),s=3,l=new RegExp("^"+a+"{3,}","gm");r=l.exec(o);)r[0].length>=s&&(s=r[0].length+1);var c=C(a,s);return"\n\n"+c+i+"\n"+o.replace(/\n$/,"")+"\n"+c+"\n\n"}},P.horizontalRule={filter:"hr",replacement:function(e,t,n){return"\n\n"+n.hr+"\n\n"}},P.inlineLink={filter:function(e,t){return"inlined"===t.linkStyle&&"A"===e.nodeName&&e.getAttribute("href")},replacement:function(e,t){var n=t.getAttribute("href");n&&(n=n.replace(/([()])/g,"\\$1"));var r=M(t.getAttribute("title"));return r&&(r=' "'+r.replace(/"/g,'\\"')+'"'),"["+e+"]("+n+r+")"}},P.referenceLink={filter:function(e,t){return"referenced"===t.linkStyle&&"A"===e.nodeName&&e.getAttribute("href")},replacement:function(e,t,n){var r,i,o=t.getAttribute("href"),a=M(t.getAttribute("title"));switch(a&&(a=' "'+a+'"'),n.linkReferenceStyle){case"collapsed":r="["+e+"][]",i="["+e+"]: "+o+a;break;case"shortcut":r="["+e+"]",i="["+e+"]: "+o+a;break;default:var s=this.references.length+1;r="["+e+"]["+s+"]",i="["+s+"]: "+o+a}return this.references.push(i),r},references:[],append:function(e){var t="";return this.references.length&&(t="\n\n"+this.references.join("\n")+"\n\n",this.references=[]),t}},P.emphasis={filter:["em","i"],replacement:function(e,t,n){return e.trim()?n.emDelimiter+e+n.emDelimiter:""}},P.strong={filter:["strong","b"],replacement:function(e,t,n){return e.trim()?n.strongDelimiter+e+n.strongDelimiter:""}},P.code={filter:function(e){var t=e.previousSibling||e.nextSibling,n="PRE"===e.parentNode.nodeName&&!t;return"CODE"===e.nodeName&&!n},replacement:function(e){if(!e)return"";e=e.replace(/\r?\n|\r/g," ");for(var t=/^`|^ .*?[^ ].* $|`$/.test(e)?" ":"",n="`",r=e.match(/`+/gm)||[];-1!==r.indexOf(n);)n+="`";return n+t+e+t+n}},P.image={filter:"img",replacement:function(e,t){var n=M(t.getAttribute("alt")),r=t.getAttribute("src")||"",i=M(t.getAttribute("title"));return r?"\n!["+n+"]("+r+(i?' "'+i+'"':"")+")\n":""}};var D=P;function j(e){for(var t in this.options=e,this._keep=[],this._remove=[],this.blankRule={replacement:e.blankReplacement},this.keepReplacement=e.keepReplacement,this.defaultRule={replacement:e.defaultReplacement},this.array=[],e.rules)this.array.push(e.rules[t])}function N(e,t,n){for(var r=0;r-1)return!0}else{if("function"!==typeof r)throw new TypeError("`filter` needs to be a string, array, or function");if(r.call(e,t,n))return!0}}function R(e){var t=e.nextSibling||e.parentNode;return e.parentNode.removeChild(e),t}function A(e,t,n){return e&&e.parentNode===t||n(t)?t.nextSibling||t.parentNode:t.firstChild||t.nextSibling||t.parentNode}j.prototype={add:function(e,t){this.array.unshift(t)},keep:function(e){this._keep.unshift({filter:e,replacement:this.keepReplacement})},remove:function(e){this._remove.unshift({filter:e,replacement:function(){return""}})},forNode:function(e){return e.isBlank?this.blankRule:(t=N(this.array,e,this.options))||(t=N(this._keep,e,this.options))||(t=N(this._remove,e,this.options))?t:this.defaultRule;var t},forEach:function(e){for(var t=0;t'+e+"","text/html").getElementById("turndown-root"):n=e.cloneNode(!0);return B({element:n,isBlock:_,isVoid:E,isPre:t.preformattedCode?W:null}),n}function W(e){return"PRE"===e.nodeName||"CODE"===e.nodeName}function H(e,t){return e.isBlock=_(e),e.isCode="CODE"===e.nodeName||e.parentNode.isCode,e.isBlank=function(e){return!E(e)&&!function(e){return T(e,O)}(e)&&/^\s*$/i.test(e.textContent)&&!function(e){return L(e,S)}(e)&&!function(e){return L(e,O)}(e)}(e),e.flankingWhitespace=function(e,t){if(e.isBlock||t.preformattedCode&&e.isCode)return{leading:"",trailing:""};var n=function(e){var t=e.match(/^(([ \t\r\n]*)(\s*))(?:(?=\S)[\s\S]*\S)?((\s*?)([ \t\r\n]*))$/);return{leading:t[1],leadingAscii:t[2],leadingNonAscii:t[3],trailing:t[4],trailingNonAscii:t[5],trailingAscii:t[6]}}(e.textContent);n.leadingAscii&&z("left",e,t)&&(n.leading=n.leadingNonAscii);n.trailingAscii&&z("right",e,t)&&(n.trailing=n.trailingNonAscii);return{leading:n.leading,trailing:n.trailing}}(e,t),e}function z(e,t,n){var r,i,o;return"left"===e?(r=t.previousSibling,i=/ $/):(r=t.nextSibling,i=/^ /),r&&(3===r.nodeType?o=i.test(r.nodeValue):n.preformattedCode&&"CODE"===r.nodeName?o=!1:1!==r.nodeType||_(r)||(o=i.test(r.textContent))),o}var q=Array.prototype.reduce;function V(e){if(!(this instanceof V))return new V(e);var t={rules:D,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:" ",preformattedCode:!1,blankReplacement:function(e,t){return""},keepReplacement:function(e,t){return t.isBlock?"\n\n"+t.outerHTML+"\n\n":t.outerHTML},defaultReplacement:function(e,t){return e}};this.options=function(e){for(var t=1;t0&&"\n"===e[t-1];)t--;return e.substring(0,t)}(e),r=t.replace(/^\n*/,""),i=Math.max(e.length-n.length,t.length-r.length);return n+"\n".substring(0,i)+r}V.prototype={turndown:function(e){if(!function(e){return null!=e&&("string"===typeof e||e.nodeType&&(1===e.nodeType||9===e.nodeType||11===e.nodeType))}(e))throw new TypeError(e+" is not a string, or an element/document/fragment node.");if(""===e)return"";var t=J.call(this,new Y(e,this.options));return G.call(this,t)},use:function(e){if(Array.isArray(e))for(var t=0;t1&&"string"!==n.items[1].kind)t.stopPropagation(),t.preventDefault();else{var r,i=this.props.handlePaste;if(t.preventDefault(),window.clipboardData&&window.clipboardData.setData)r=n.getData("text");else{r=n.getData("text/plain");try{var o=n.getData("text/html");if(o&&this.isFullMdMode()&&!o.includes("http://schemas.microsoft.com/office/2004/12/omml")){var a=n.getData("text/markdown");if(a)r=a;else if(o){var s=o.replace(/<([a-z][a-z0-9]*)\b[^>]*>/gi,(function(e){return e.replace(/\n/g," ")})).replace(/[\s\S]*<\/head>/gm,"").replace(/