ados-rcm 1.1.691 → 1.1.693

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -477,7 +477,7 @@ received: ${n.quality}
477
477
  received: ${n.imageType}
478
478
  -> using default image/jpeg`),n.imageType="image/jpeg")}function Cz(n,e){n.keepImageTypes??(n.keepImageTypes=[]),n.keepImageTypes&&!Array.isArray(n.keepImageTypes)&&(e.warn(`quill.imageCompressor: [config error] 'keepImageTypes' is required to be a "array", received: ${n.keepImageTypes} -> using default []`),n.keepImageTypes=[]),n.ignoreImageTypes??(n.ignoreImageTypes=[]),n.ignoreImageTypes&&!Array.isArray(n.ignoreImageTypes)&&(e.warn(`quill.imageCompressor: [config error] 'ignoreImageTypes' is required to be a "array", received: ${n.ignoreImageTypes} -> using default []`),n.ignoreImageTypes=[])}function _z(n,e){n.handleOnPaste&&typeof n.handleOnPaste!="boolean"&&typeof n.handleOnPaste!="function"&&(e.warn(`quill.imageCompressor: [config error] 'handlePaste' is required to be a "boolean" or a "function", received: ${n.ignoreImageTypes} -> using default true`),n.handleOnPaste=!0),n.insertIntoEditor&&typeof n.insertIntoEditor!="function"&&(e.warn(`quill.imageCompressor: [config error] 'insertIntoEditor' is required to be a "function", received: ${n.insertIntoEditor} -> using default undefined`),n.insertIntoEditor=void 0)}function Lw(n){return!!/^image\/(gif|jpe?g|a?png|svg|webp|bmp)/i.exec(n)}class Sz{constructor(e,t,r,i){Te(this,"localDrag",!1);this.quill=e,this.onNewDataUrl=t,this.logger=r,this.handleOnPaste=i,this.quill.root.addEventListener("dragstart",o=>this.handleDragStart(o),!1),this.quill.root.addEventListener("dragend",o=>this.handleDragEnd(o),!1),this.quill.root.addEventListener("drop",o=>this.handleDrop(o),!0),this.handleOnPaste!==!1&&this.quill.root.addEventListener("paste",o=>this.handlePaste(o),!0)}handleDragStart(e){this.localDrag=!0}handleDragEnd(e){this.localDrag=!1}async handleDrop(e){var l,a,u,g;if(this.localDrag)return;e.preventDefault();const t=document.getSelection();if(t&&document.caretPositionFromPoint){const m=document.caretPositionFromPoint(e.clientX,e.clientY);m&&t.setBaseAndExtent(m.offsetNode,m.offset,m.offsetNode,m.offset)}this.logger.log("handleDrop",{evt:e});const r=(l=e.dataTransfer)==null?void 0:l.files,i=Array.from(r||[]).filter(m=>Lw(m.type));if(i.length>0){e.stopPropagation(),this.logger.log("handleDrop","found files",{evt:e,files:r,imageFiles:i}),await this.pasteFilesIntoQuill(i);return}if((a=e.dataTransfer)!=null&&a.items){e.stopPropagation(),this.logger.log("handleDrop","found items",{evt:e,files:r,imageFiles:i}),await this.handleDataTransferList((u=e.dataTransfer)==null?void 0:u.items,e);return}const o=(g=e.dataTransfer)==null?void 0:g.getData("URL");if(this.logger.log("handleDrop","trying getData('URL')",{draggedUrl:o}),o){const m=await(await fetch(o)).blob();this.logger.log("handleDrop","blob from drag event",{evt:e,files:r,imageFiles:i}),await this.pasteFilesIntoQuill([m])}}async handlePaste(e){var t;typeof this.handleOnPaste=="function"&&!this.handleOnPaste(e)||await this.handleDataTransferList((t=e.clipboardData)==null?void 0:t.items,e)}async handleDataTransferList(e,t){const r=Array.from(e||[]),i=r.filter(a=>a.kind==="file"&&Lw(a.type)),o=r.map(a=>({type:a.type,kind:a.kind}));if(this.logger.log("handleDataTransferList",{fileTypes:o,imageCount:i.length}),!i.length)return;t.preventDefault(),t.stopPropagation();const l=i.map(a=>a.getAsFile());await this.pasteFilesIntoQuill(l)}async pasteFilesIntoQuill(e){this.logger.log(" pasteFilesIntoQuill",`pasting ${e.length} images...`),await Promise.all(e.map(async(t,r)=>{if(!t)return;const i=await R4(t);this.logger.log(" pasteFilesIntoQuill",`pasting image (${r})`),this.onNewDataUrl(i)})),this.logger.log(" pasteFilesIntoQuill","done")}}class Fp{constructor(e,t){Te(this,"quill");Te(this,"range");Te(this,"options");Te(this,"imageDrop");Te(this,"fileHolder");Te(this,"Logger");this.quill=e,this.options=t||{};const r=!!t.debug,i=!!t.suppressErrorLogging;this.Logger=new pz(r,i),yz(t,this.Logger);const o=async a=>{this.Logger.log("onImageDrop",{dataUrl:a});const u=await this.downscaleImageFromUrl(a);this.insertToEditor(u,Fp.b64toBlob(u))};this.imageDrop=new Sz(e,o,this.Logger,typeof this.options.handleOnPaste=="function"?this.options.handleOnPaste:this.options.handleOnPaste!==!1),this.Logger.log("fileChanged",{options:t,quill:e,debug:r});const l=this.quill.getModule("toolbar");l?l.addHandler("image",()=>this.selectLocalImage()):this.Logger.error("Quill toolbar module not found! need { toolbar: // options } in Quill.modules for image icon to sit in")}static b64toBlob(e){const t=atob(e.split(",")[1]),r=e.slice(5).split(";")[0],i=new ArrayBuffer(t.length);let o=new Uint8Array(i);for(let l=0;l<t.length;l++)o[l]=t.charCodeAt(l);return new Blob([i],{type:r})}destroy(){this.imageDrop&&console.warn("ImageDrop instance cleanup")}selectLocalImage(e){this.range=this.quill.getSelection(),this.fileHolder=document.createElement("input"),this.fileHolder.setAttribute("type","file"),this.fileHolder.setAttribute("accept","image/*"),this.fileHolder.setAttribute("style","visibility:hidden"),this.fileHolder.onchange=()=>this.fileChanged().then(()=>e&&e()),document.body.appendChild(this.fileHolder),this.fileHolder.click(),window.requestAnimationFrame(()=>{this.fileHolder&&document.body.removeChild(this.fileHolder)})}async fileChanged(e){var l;const t=e||((l=this.fileHolder)==null?void 0:l.files);if(!(t!=null&&t.length))return;const r=t[0];if(this.Logger.log("fileChanged",{file:r}),!r)return;const i=await R4(r),o=await this.downscaleImageFromUrl(i);this.insertToEditor(o,Fp.b64toBlob(o))}async downscaleImageFromUrl(e){const t=await bz(this.Logger,e,{maxWidth:this.options.maxWidth,maxHeight:this.options.maxHeight,imageType:this.options.imageType,keepImageTypes:this.options.keepImageTypes,ignoreImageTypes:this.options.ignoreImageTypes,imageQuality:this.options.quality});return this.Logger.log("downscaleImageFromUrl",{dataUrl:e,dataUrlCompressed:t}),t}insertToEditor(e,t){if(this.options.insertIntoEditor)this.options.insertIntoEditor(e,t,this.quill);else{this.Logger.log("insertToEditor",{url:e}),this.range=this.quill.getSelection();const r=this.range;if(!r)return;this.logFileSize(e),this.quill.insertEmbed(r.index,"image",`${e}`,"user"),r.index++,this.quill.setSelection(r,"api")}}logFileSize(e){const i=(Math.round((e.length-"data:image/png;base64,".length)*3/4)/1024).toFixed(0);this.Logger.log("estimated img size: "+i+" kb")}}window.imageCompressor=Fp;const Bp={OVERLAY:"ql-image-resizer-overlay",HANDLE:"ql-image-resizer-handle",DISPLAY:"ql-image-resizer-display",TOOLBAR:"ql-image-resizer-toolbar",TOOLBAR_BUTTON:"ql-image-resizer-toolbar-button"},Zd={BACKSPACE:8,DELETE:46,LEFT:37,UP:38,RIGHT:39,DOWN:40},D0=(n,e)=>{const t=n?"top":"bottom",r=e?"left":"right",i=n===e?"nwse-resize":"nesw-resize";return{[t]:"-5px",[r]:"-5px",cursor:i}},Tz={tl:D0(!0,!0),tr:D0(!0,!1),bl:D0(!1,!0),br:D0(!1,!1)},Az={modules:["DisplaySize","Toolbar","Resize","Keyboard"],embedTags:["VIDEO","IFRAME"],tools:["left","center","right","justify"],contentOptions:[{attribute:["width"],limit:{minWidth:100},blotName:"image"},{attribute:["width","height"],limit:{minWidth:200,ratio:.5625},blotName:"video"}]},Ez=Ke.import("formats/image");class q0 extends Ez{static get ATTRIBUTES(){return["alt","height","width","class","style","data-align"]}static formats(e){return this.ATTRIBUTES.reduce((t,r)=>(e.hasAttribute(r)&&(t[r]=e.getAttribute(r)??""),t),{})}format(e,t){this.constructor.ATTRIBUTES.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}}Te(q0,"blotName","image"),Te(q0,"tagName","img"),Te(q0,"scope",Qn.INLINE);Ke.register("formats/image",q0,!0);class Xp{constructor(e){Te(this,"resizer");Te(this,"quill");Te(this,"overlay");Te(this,"activeEle");Te(this,"blot");Te(this,"options");Te(this,"requestUpdate");this.resizer=e,this.quill=e.quill,this.overlay=e.overlay,this.activeEle=e.activeEle,this.blot=e.blot,this.options=e.options,this.requestUpdate=()=>e.onUpdate(!0)}onCreate(){}onDestroy(){}onUpdate(){}}class Rz extends Xp{constructor(){super(...arguments);Te(this,"display")}onCreate(){var t;this.display=document.createElement("div"),this.display.className=af[Bp.DISPLAY],(t=this.overlay)==null||t.appendChild(this.display)}onUpdate(){if(!this.display||!this.activeEle)return;const[t,r]=[this.activeEle.offsetWidth,this.activeEle.offsetHeight];this.display.innerHTML=`${t} &times; ${r}`,this.positionDisplay(t,r)}positionDisplay(t,r){var a;if(!this.display)return;const i=this.display.getBoundingClientRect(),o=t>120&&r>30,l=((a=this.activeEle)==null?void 0:a.style.float)==="right";Object.assign(this.display.style,{right:o?"4px":l?"auto":`-${i.width+4}px`,bottom:o?"4px":`-${i.height+4}px`,left:o?"auto":l?`-${i.width+4}px`:"auto"})}}class Iz extends Xp{constructor(){super(...arguments);Te(this,"boxes",[]);Te(this,"dragBox",null);Te(this,"dragStartX",0);Te(this,"dragStartY",0);Te(this,"contentOption");Te(this,"preDragSize",{width:0,height:0});Te(this,"naturalSize",[0,0]);Te(this,"handleDragProxy",null);Te(this,"handleMouseupProxy",null);Te(this,"handleMousedown",t=>{!this.blot||!this.activeEle||(this.dragBox=t.target,this.dragStartX=t.clientX,this.dragStartY=t.clientY,this.preDragSize={width:this.activeEle.offsetWidth,height:this.activeEle.offsetHeight},this.naturalSize=this.getNaturalSize(),this.setCursor(window.getComputedStyle(this.dragBox).cursor),this.handleDragProxy=this.handleDrag.bind(this),this.handleMouseupProxy=this.handleMouseup.bind(this),document.addEventListener("mousemove",this.handleDragProxy,!0),document.addEventListener("mouseup",this.handleMouseupProxy,!0))});Te(this,"handleMouseup",t=>{if(!this.activeEle||!this.blot||!this.contentOption)return;const r=this.calcSize(t,this.contentOption.limit);Object.assign(this.activeEle,r),Object.assign(this.activeEle.style,{width:null,height:null}),this.setCursor(""),this.removeEventListeners()});Te(this,"handleDrag",t=>{!this.activeEle||!this.blot||!this.contentOption||(Object.assign(this.activeEle.style,this.calcSize(t,{...this.contentOption.limit,unit:!0})),this.requestUpdate())});Te(this,"handleDoubleClick",t=>{if(!this.blot||!this.activeEle||!this.contentOption)return;t.stopPropagation();const[r,i]=this.naturalSize,o={};this.contentOption.attribute.includes("width")&&(o.width=r),this.contentOption.attribute.includes("height")&&(o.height=i);const l=this.applyConstraints(o,this.contentOption.limit);Object.assign(this.activeEle,l),this.requestUpdate()})}onCreate(){!this.blot||!this.options.contentOptions||(this.contentOption=this.options.contentOptions.find(t=>t.blotName===this.blot.statics.blotName),this.boxes=[],["tl","tr","br","bl"].forEach(this.addBox.bind(this)))}onDestroy(){this.setCursor("")}addBox(t){var i;const r=document.createElement("div");r.className=`${af[Bp.HANDLE]} ${t}`,r.addEventListener("mousedown",this.handleMousedown,!1),r.addEventListener("dblclick",this.handleDoubleClick,!1),Object.assign(r.style,Tz[t]),(i=this.overlay)==null||i.appendChild(r),this.boxes.push(r)}removeEventListeners(){this.handleDragProxy&&(document.removeEventListener("mousemove",this.handleDragProxy,!0),this.handleDragProxy=null),this.handleMouseupProxy&&(document.removeEventListener("mouseup",this.handleMouseupProxy,!0),this.handleMouseupProxy=null)}calcSize(t,r={}){var u;if(!this.dragBox||!this.activeEle)return{};const i=t.clientX-this.dragStartX,o=t.clientY-this.dragStartY,l=this.dragBox===this.boxes[0]||this.dragBox===this.boxes[3]?-1:1,a={};return(u=this.contentOption)!=null&&u.attribute?this.contentOption.attribute.forEach(g=>a[g]=this.preDragSize[g]):a.width=this.preDragSize.width,a.width&&(a.width=Math.round(this.preDragSize.width+i*l)),a.height&&(a.height=Math.round(this.preDragSize.height+o*l)),this.applyConstraints(a,r)}applyConstraints(t,r={}){const i=typeof t.width=="string"?parseInt(t.width,10):t.width||0,o=typeof t.height=="string"?parseInt(t.height,10):t.height||0;let l=i,a=o;if(r.ratio){l=this.applyLimit(l,r.minWidth,r.maxWidth),a=l*r.ratio;const g=this.applyLimit(a,r.minHeight,r.maxHeight);g!==a&&(a=g,l=a/r.ratio)}else i&&(l=this.applyLimit(l,r.minWidth,r.maxWidth)),o&&(a=this.applyLimit(a,r.minHeight,r.maxHeight));const u={};return t.width!==void 0&&(u.width=r.unit?`${l}px`:l),t.height!==void 0&&(u.height=r.unit?`${a}px`:a),u}applyLimit(t,r,i){let o=t;return r!==void 0&&(o=Math.max(r,o)),i!==void 0&&(o=Math.min(i,o)),o}getNaturalSize(){if(!this.activeEle)return[0,0];const t=this.activeEle.getAttribute("data-size");if(!t){const r=this.activeEle,i=[r.offsetWidth,r.offsetHeight];return r.setAttribute("data-size",i.join(",")),i}return t.split(",").map(Number)}setCursor(t){[document.body,this.activeEle].forEach(r=>r&&(r.style.cursor=t))}}const jd=class jd extends Xp{constructor(){super(...arguments);Te(this,"keyboardProxy",null)}static injectInit(t){var i;const r=(i=t.keyboard)==null?void 0:i.bindings;r&&[jd.keys.LEFT,jd.keys.RIGHT].forEach(o=>(r[o]||[]).unshift(jd.makeArrowHandler(o)))}static makeArrowHandler(t){const r=t===jd.keys.LEFT;return{key:t,shiftKey:!1,altKey:null,[r?"prefix":"suffix"]:/^$/,handler(i){const o=this.quill;if(!o.resizer)return!0;let l=i.index;const a=t===jd.keys.RIGHT,[u]=o.getLine(l+(r?-1:0));if(!u)return!0;if(o.resizer.judgeShow(u))return!1;const g=o.getIndex(u);if(a&&g+u.length()-1===l)return!0;a&&(l+=i.length+1);const[m]=o.getLeaf(l);if(!m)return!0;const x=m.offset(m.parent),w=m.constructor&&"scope"in m.constructor&&m.constructor.scope===Qn.BLOCK_BLOT;if(r&&(w&&l===x||l===0||l===g))return!0;let _=m;if(r&&x===0){const[S]=o.getLeaf(l-1);S&&(_=S)}return!_||!o.resizer.judgeShow(_)}}}onCreate(){this.keyboardProxy=this.keyboardHandle.bind(this),document.addEventListener("keydown",this.keyboardProxy,!0)}onDestroy(){this.keyboardProxy&&document.removeEventListener("keydown",this.keyboardProxy,!0)}keyboardHandle(t){if(t.defaultPrevented||t.shiftKey||t.ctrlKey||t.altKey||!this.activeEle)return;const r=t.keyCode;let i=this.blot.offset(this.quill.scroll),o=null,l=!1;r===Zd.BACKSPACE||r===Zd.DELETE?(this.handleDelete(),l=!0):r>=Zd.LEFT&&r<=Zd.DOWN&&([i,o]=this.handleArrowKeys(r,i),l=!0),l&&(t.stopPropagation(),t.preventDefault()),!(o&&this.resizer.judgeShow(o,o.domNode))&&(this.quill.setSelection(i),this.resizer.hide())}handleDelete(){this.blot&&(this.blot.deleteAt(0,1),this.blot.parent.optimize({}))}handleArrowKeys(t,r){let i=null;return t===Zd.RIGHT?r+=this.blot.length()||1:t===Zd.UP?(r=this.getOtherLineIndex(-1),i=this.quill.getLeaf(r)[0]):t===Zd.DOWN&&(r=this.getOtherLineIndex(1),i=this.quill.getLeaf(r)[0]),[r,i]}getOtherLineIndex(t){if(!this.blot)return 0;const r=this.blot.offset(this.quill.scroll),[i]=this.quill.getLine(r);if(!i)return r;const o=this.blot.offset(i)+1,l=t>0?i.next:i.prev;if(!l)return r;let a=l.length();return l.statics.blotName==="block"&&a--,l.offset(this.quill.scroll)+Math.min(a,o)}};Te(jd,"keys",Zd);let vv=jd;const f1=class f1 extends Xp{constructor(t){super(t);Te(this,"toolbar");Te(this,"blot");this.blot=t.blot}createStyleTool(t,r){const i={left:{float:"left"},right:{float:"right"},center:{display:"block",margin:"0 auto",float:"none"},justify:{display:"block",float:"none",margin:"0",width:"100%"}};return{icon:t,apply:o=>{const l=i[r];Object.assign(o.style,l),o.setAttribute("data-align",r)},isApplied:o=>{const l=o.style;switch(r){case"center":return l.float==="none";case"justify":return l.display==="block"&&l.width==="100%";case"left":case"right":return l.float===r;default:return!1}}}}onCreate(){var t;this.toolbar=document.createElement("div"),this.toolbar.className=af[Bp.TOOLBAR],(t=this.overlay)==null||t.appendChild(this.toolbar),Object.keys(f1.Tools).forEach(r=>{const i=r;f1.Tools[i]=this.createStyleTool(f1.Tools[i].icon,i)}),this._addToolbarButtons()}_addToolbarButtons(){if(!this.toolbar||!this.activeEle)return;const{Tools:t}=this.constructor;this.options.tools.forEach(r=>{const i=r,o=t[i];if(!o)return;const l=document.createElement("button");l.type="button",l.className=af[Bp.TOOLBAR_BUTTON],l.innerHTML=a1.renderToString(M.jsx(uo,{icon:o.icon,size:"xs"})),l.setAttribute("data-tool",i),o.isApplied&&o.isApplied.call(this,this.activeEle)&&(l.style.backgroundColor="var(--AEditor_Addon_Secondary_color)"),this.addButtonClickHandler(l,o),this.toolbar.appendChild(l)})}addButtonClickHandler(t,r){!this.activeEle||!this.blot||t.addEventListener("click",i=>{var l;if(i.stopPropagation(),r.handler&&r.handler.call(this,i,t,this.activeEle)!==!0)return;const o=r.isApplied&&r.isApplied.call(this,this.activeEle);return this.toolbar&&Array.from(this.toolbar.querySelectorAll("button")).forEach(a=>a.style.backgroundColor=""),o?(this.activeEle.style.cssText="",this.activeEle.setAttribute("data-align","")):(t.style.backgroundColor="var(--AEditor_Addon_Secondary_color)",(l=r.apply)==null||l.call(r,this.activeEle)),this.requestUpdate(),!1})}};Te(f1,"Tools",{left:{icon:"AlignLeft"},center:{icon:"AlignCenter"},right:{icon:"AlignRight"},justify:{icon:"AlignJustify"}});let cm=f1;class I4{constructor(e,t={}){Te(this,"quill");Te(this,"options");Te(this,"moduleClasses");Te(this,"modules",[]);Te(this,"blot");Te(this,"selectedBlots",[]);Te(this,"embedClassName","");Te(this,"activeEle");Te(this,"overlay");Te(this,"updateFromModule",!1);Te(this,"hideProxy",null);Te(this,"updateOverlayPositionProxy",null);var i;e.resizer=this,this.quill=e;const r=t.modules?[...t.modules]:null;this.options={...Az,...t},r&&(this.options.modules=r),document.execCommand("enableObjectResizing",!1,"false"),this.moduleClasses=this.options.modules,this.quill.root.addEventListener("mousedown",this.handleClick.bind(this),!1),this.quill.on("text-change",this.handleChange.bind(this)),this.quill.container.style.position=this.quill.container.style.position||"relative",this.quill.on("selection-change",this.addBlotsSelectedClass.bind(this)),vv.injectInit(this.quill),(i=this.options.embedTags)!=null&&i.length&&this.initializeEmbed()}initializeModules(){this.modules.forEach(e=>e.onDestroy()),this.modules=[],this.modules=this.moduleClasses.map(e=>new(this.constructor.Modules[e]||e)(this)),this.modules.forEach(e=>e.onCreate()),this.repositionElements(),this.modules.forEach(e=>e.onUpdate())}initializeEmbed(){if(!this.options.embedTags.length)return;this.embedClassName=`ql-${Array.from({length},()=>[Math.floor(Math.random()*62)]).join("")}`;const e=[""].concat(this.options.embedTags).join(`, .${this.embedClassName} `).slice(2)+"{pointer-events: none;}",t=document.createElement("style");t.textContent=e,this.quill.container.appendChild(t),this.quill.root.classList.add(this.embedClassName)}onUpdate(e){this.updateFromModule=!!e,this.repositionElements(),this.modules.forEach(t=>t.onUpdate())}handleClick(e){if(this.overlay&&(e.target===this.overlay||this.overlay.contains(e.target)))return;let t=e.target;if(t=this.getEventTarget(e,t),t!=null&&t.tagName){const r=this.quill.scroll.find(t);if(r&&this.judgeShow(r,t)){e.preventDefault();return}}this.activeEle&&this.hide()}getEventTarget(e,t){var o;const r=(o=this.options.embedTags)==null?void 0:o.join();if(!r)return t;const i=this.quill.root;return(t===i||t.querySelectorAll(r).length)&&(i.classList.remove(this.embedClassName),t=document.elementFromPoint(e.clientX,e.clientY),i.classList.add(this.embedClassName)),t}judgeShow(e,t){if(!e||!this.options.contentOptions)return!1;!t&&e.domNode&&(t=e.domNode);const r=this.options.contentOptions.find(o=>o.blotName===e.statics.blotName);if(!r)return!1;if(this.activeEle===t)return!0;const i=r.limit||{};return!i.minWidth||i.minWidth&&t.offsetWidth>=i.minWidth?(this.activeEle&&this.hide(),this.activeEle=t,this.blot=e,this.showOverlay(),this.initializeModules(),!0):!1}handleChange(e,t,r){if(this.updateFromModule){this.updateFromModule=!1;return}r!=="user"||!this.overlay||!this.activeEle||this.onUpdate()}showOverlay(){this.overlay&&this.hideOverlay(),this.quill.setSelection(null),[document.body,this.quill.root].forEach(e=>e.style.userSelect="none"),this.overlay=document.createElement("div"),this.overlay.className=`${af[Bp.OVERLAY]}`,this.overlay.addEventListener("wheel",e=>{e.preventDefault(),e.stopPropagation(),this.quill.root.scrollTop+=e.deltaY*.5},{passive:!1}),this.quill.container.appendChild(this.overlay),this.hideProxy=()=>this.activeEle&&this.hide(),this.updateOverlayPositionProxy=()=>this.overlay&&(this.overlay.style.marginTop=-1*this.quill.root.scrollTop+"px"),this.quill.root.addEventListener("input",this.hideProxy,!0),this.quill.root.addEventListener("scroll",this.updateOverlayPositionProxy),this.repositionElements()}hideOverlay(){this.overlay&&(this.quill.container.removeChild(this.overlay),this.overlay=void 0,this.hideProxy&&this.quill.root.removeEventListener("input",this.hideProxy,!0),this.updateOverlayPositionProxy&&this.quill.root.removeEventListener("scroll",this.updateOverlayPositionProxy),[document.body,this.quill.root].forEach(e=>e.style.userSelect=""))}repositionElements(){if(!this.overlay||!this.activeEle)return;const e=this.quill.container,t=this.activeEle.getBoundingClientRect(),r=e.getBoundingClientRect();Object.assign(this.overlay.style,{left:`${t.left-r.left-1+e.scrollLeft}px`,top:`${t.top-r.top+this.quill.root.scrollTop}px`,width:`${t.width}px`,height:`${t.height}px`,marginTop:-1*this.quill.root.scrollTop+"px"})}addBlotsSelectedClass(e){if(!e){this.selectedBlots=[];return}try{const t=i=>{var o;return["image","iframe","video"].includes((o=i.statics)==null?void 0:o.blotName)},r=this.quill.scroll.descendants(t,e.index,e.length);this.selectedBlots=r.filter(i=>!i.statics||!this.options.contentOptions?!1:!!this.options.contentOptions.find(o=>o.blotName===i.statics.blotName))}catch{}}hide(){this.hideOverlay(),this.modules.forEach(e=>e.onDestroy()),this.modules=[],this.activeEle=void 0,this.blot=void 0}}Te(I4,"Modules",{Base:Xp,DisplaySize:Rz,Toolbar:cm,Resize:Iz,Keyboard:vv});const N0=Ke.import("delta"),kz=Ke.import("modules/clipboard");function Mz(n){let e=Number.parseFloat(n.getAttribute("width")||String(Ss.colDefaultWidth));if(Number.isNaN(e)){const t=n.style.width;e=t?Number.parseFloat(t):n.offsetWidth}return e}function Lz(n,e){const t=new Array(e).fill(Ss.colDefaultWidth),r=Array.from(n.querySelectorAll("tr"));for(const i of r){const o=Array.from(i.querySelectorAll("td"));for(const[l,a]of o.entries())if(l<e){const u=Mz(a);t[l]=u||t[l]}else break}return t}class Oz extends kz{constructor(t,r){super(t,r);Te(this,"tableId",Na());Te(this,"rowId",Na());Te(this,"colIds",[]);Te(this,"rowspanCount",[]);Te(this,"cellCount",0);Te(this,"colCount",0);Te(this,"STYLE_PROPERTIES",["color","background","background-color","mso-pattern","border","border-color","border-top","border-right","border-bottom","border-left"]);this.quill=t,this.addMatcher("table",this.matchTable.bind(this)),this.addMatcher("colgroup",this.matchColgroup.bind(this)),this.addMatcher("col",this.matchCol.bind(this)),this.addMatcher("tr",this.matchTr.bind(this)),this.addMatcher("td",this.matchTd.bind(this)),this.addMatcher("th",this.matchTd.bind(this)),this.addMatcher("caption",this.matchCaption.bind(this))}matchTable(t,r){if(r.ops.length===0)return r;const i=[],o=[];let l=-1;for(let g=0;g<r.ops.length;g++){const{attributes:m,insert:x}=r.ops[g],{table:w,[je.tableCell]:_,...S}=m||{},R=ng.isObject(x)&&x[je.tableCol];R?o.push({insert:x}):i.push({attributes:S,insert:x}),!(S!=null&&S[je.tableCellInner])&&!R&&(l=g)}const u=Lz(t,this.colIds.length).reduce((g,m,x)=>(o[x]?g.push(o[x]):g.push({insert:{[je.tableCol]:{tableId:this.tableId,colId:this.colIds[x],width:m,full:!0}}}),g),[]);return i.splice(l+1,0,...u),this.tableId=Na(),this.colIds=[],this.rowspanCount=[],this.cellCount=0,this.colCount=0,new N0(i)}matchColgroup(t,r){const i=[];for(let o=0;o<r.ops.length;o++){const l=r.ops[o];l&&ng.isObject(l.insert)&&l.insert[je.tableCol]&&i.push(l)}return new N0(i)}matchCol(t){this.colIds[this.colCount]=Na();const r=new N0().insert({[je.tableCol]:Object.assign(kg.value(t),{tableId:this.tableId,colId:this.colIds[this.colCount]})});return this.colCount+=1,r}matchTr(t,r){this.rowId=Na(),this.cellCount=0;for(const[i,o]of this.rowspanCount.entries())o.rowspan>0&&(o.rowspan-=1),o.rowspan<=0&&(this.rowspanCount[i]={rowspan:0,colspan:0});return r}matchTd(t,r){const i=t,o=Nf.formats(i);if(!this.colIds[this.cellCount]||!this.rowspanCount[this.cellCount])for(let m=this.cellCount;m>=0;m--)this.colIds[m]||(this.colIds[m]=Na()),this.rowspanCount[m]||(this.rowspanCount[m]={rowspan:0,colspan:0});const{colspan:l}=this.rowspanCount[this.cellCount];this.cellCount+=l,o.rowspan>0&&(this.rowspanCount[this.cellCount]={rowspan:o.rowspan,colspan:o.colspan});const a=this.colIds[this.cellCount];this.cellCount+=o.colspan;const u=Object.assign(o,{tableId:this.tableId,rowId:this.rowId,colId:a});this.handleBorderNoneStyles(i,u);const g=[];for(const m of r.ops){const{attributes:x={},...w}=m,{[je.tableCell]:_,...S}=x;g.push({...w,attributes:{...S,[je.tableCellInner]:u}})}return(g.length<=0||!ng.isString(g[g.length-1].insert)||!g[g.length-1].insert.endsWith(`
479
479
  `))&&g.push({insert:`
480
- `,attributes:{[je.tableCellInner]:u}}),new N0(g)}handleBorderNoneStyles(t,r){if(!(r!=null&&r.style))return;["border",...["top","right","bottom","left"].flatMap(o=>[`border-${o}`,`border-${o}-style`])].filter(o=>t.style[o]==="none").forEach(o=>r.style=r.style.replaceAll(new RegExp(`${o}:none;?`,"g"),""))}convert({html:t,text:r},i={}){if(t){const a=new DOMParser().parseFromString(t,"text/html");this.preprocessTableHtml(a),this.mergeClassStylesToInline(a),t=a.body.innerHTML}const o=super.convert({html:t,text:r},i);if(i[je.tableCellInner])for(const l of o.ops){if(ng.isObject(l.insert)&&l.insert[je.tableCol]){l.insert="";continue}l.attributes||(l.attributes={}),l.attributes[je.tableCellInner]=i[je.tableCellInner]}return o}parseStyleWithFilter(t,r){if(!t)return{};const i={};let o="",l="",a=!0,u=0;for(let g=0;g<t.length;g++){const m=t[g];m===":"&&a?(o=t.substring(u,g).trim(),u=g+1,a=!1):m===";"&&(!a&&o&&(l=t.substring(u,g).trim(),(!r||r(o))&&(i[o]=l)),u=g+1,a=!0)}return!a&&o&&u<t.length&&(l=t.substring(u).trim(),(!r||r(o))&&(i[o]=l)),i}mergeClassStylesToInline(t){var r;try{const i=t.querySelectorAll("td[class], th[class]");if(i.length===0)return;const o=new Set;for(const m of i)(m.getAttribute("class")||"").split(/\s+/).filter(Boolean).forEach(w=>o.add(w));if(o.size===0)return;const l=t.querySelectorAll("style");if(l.length===0)return;const a=Array.from(l).map(m=>m.textContent||"").join("");if(!a)return;const u={},g=m=>this.STYLE_PROPERTIES.some(x=>m.startsWith(x));for(const m of o){const x=new RegExp(`\\.${m}[^{]*{([^}]*)}`,"g");let w;for(;(w=x.exec(a))!==null;){const _=w[1],S=this.parseStyleWithFilter(_),R={};let I=!1;for(const O in S)g(O)&&(R[O]=S[O],I=!0);I&&(u[m]=R)}}if(Object.keys(u).length===0)return;for(let m=0;m<i.length;m++){const x=i[m],w=((r=x.getAttribute("class"))==null?void 0:r.split(/\s+/).filter(Boolean))||[],_=x.getAttribute("style")||"",S=this.parseStyleWithFilter(_);let R=!1;for(const I of w){const O=u[I];if(O)for(const P in O)S[P]||(S[P]=O[P],R=!0)}if(R){let I="";for(const O in S)I+=O+":"+S[O]+";";I&&x.setAttribute("style",I)}x.removeAttribute("class")}}catch(i){console.error("스타일 처리 오류",i)}}matchCaption(t,r){for(let i=0;i<r.ops.length;i++){const o=r.ops[i],{attributes:l}=o;l&&l[je.tableCaption]&&(l[je.tableCaption].tableId=this.tableId,o.attributes=l)}return r}preprocessTableHtml(t){try{const r=t.querySelectorAll("table");for(const i of Array.from(r))i.querySelectorAll("tr").length!==0&&(this.cleanupTableStyles(i),this.applyRowspanHeights(i),this.fixRowspanCells(i));this.mergeClassStylesToInline(t)}catch(r){console.error("테이블 전처리 오류",r)}}cleanupTableStyles(t){const r=t.querySelectorAll("td, th, tr, colgroup");for(const i of r){const o=i;o.removeAttribute("height");const l=o.getAttribute("style");if(l){const a=l.replace(/height\s*:[^;]*;?/gi,"").trim();o.setAttribute("style",a||"")}}}applyRowspanHeights(t){const i=t.querySelectorAll("td, th");t.style.borderCollapse="collapse";for(const o of i){const l=o,u=parseInt(l.getAttribute("rowspan")||"1")*24,g=l.getAttribute("style")||"",m=g+(g?"; ":"")+`height: ${u}px`;l.setAttribute("style",m)}}fixRowspanCells(t){const r=t.querySelectorAll("tr");if(r.length<=1)return;const i=[],o=new Map;for(let l=0;l<r.length;l++){const u=r[l].querySelectorAll("td, th");if(u.length===0&&l<r.length-1){i.push(l);continue}for(const g of Array.from(u)){const m=parseInt(g.getAttribute("rowspan")||"1");if(m>1)for(let x=1;x<m;x++){const w=l+x;if(w>=r.length)break;o.has(w)||o.set(w,[]),o.get(w).push(g)}}}i.length>0&&this.processEmptyRows(i,r,o)}processEmptyRows(t,r,i){for(const o of t){const l=i.get(o);if(l)for(const a of l){const u=parseInt(a.getAttribute("rowspan")||"1");u>1&&a.setAttribute("rowspan",(u-1).toString())}}for(const o of t.reverse())r[o].remove()}}class Pz extends E4{fixUnusuaDeletelTable(){}mergeCells(e){if(!this.table||!this.tableSelection)return;const t=this.tableSelection.selectedTds||[];if(t.length>1&&(e=t),!e||e.length<=1)return;const r=Kl(e[0],je.tableMain),i=r.getRows(),o=e.map(w=>{if(!w||!w.parent||!w.parent.domNode)return null;const _=w.parent.domNode;if(!_)return null;const S=i.findIndex(O=>O.rowId===w.rowId);if(S===-1)return null;const R=w.getColumnIndex();if(R===-1)return null;const I=_.getBoundingClientRect();return!I||I.width===0||I.height===0?null:{td:w,rowIndex:S,colIndex:R,rowspan:w.rowspan,colspan:w.colspan,visualLeft:I.left,visualRight:I.right,visualTop:I.top,visualBottom:I.bottom}}).filter(Boolean);if(o.length<=1)return;o.sort((w,_)=>w.visualTop-_.visualTop||w.visualLeft-_.visualLeft);const l=o[0],a=l.td,u=Math.max(...o.map(w=>w.rowIndex+w.rowspan-1)),g=Math.max(...o.map(w=>w.colIndex+w.colspan-1)),m=u-l.rowIndex+1,x=g-l.colIndex+1;for(const w of o)w.td!==a&&(w.td.moveChildren(a),w.td.parent.remove());a.rowspan=m,a.colspan=x,this.fixTableByRemove(r)}}Ke.register({"modules/imageCompress":Fp,"modules/resize":I4,"modules/tableUp":Pz,"modules/magicUrl":aF,"formats/divider":am,"modules/clipboard":Oz,"modules/copy":hz,"modules/toggleFullscreen":o4},!0);const u1={KB:1024,QUALITY:.7,IMAGE_SIZES:new Map},Dz={getCharLength:n=>Array.from(n).length,calculateTextSize:n=>{if(!n.ops||n.ops.length===0)return 0;let e=0;for(const t of n.ops)if(typeof t.insert=="string")e+=new TextEncoder().encode(t.insert).length-1;else if(typeof t.insert=="object"&&t.insert.image){const r=t.insert.image;r&&(e+=u1.IMAGE_SIZES.get(r)||Math.ceil(r.length*u1.QUALITY))}return e}},Nz=n=>{const{type:e="Primary",editorRef:t,useValue:r,useError:i,placeholder:o,tabIndex:l,autoFocus:a,editorProps:u,style:g,minHeight:m,maxHeight:x,contentHeight:w,contentMaxHeight:_=1e3,toolbarSize:S="Med",toolbarType:R="Default",readOnly:I,limitPosition:O="Bottom",maxLength:P,size:H=100,editorClassName:W,editorStyle:Y,noImageResize:B,...ee}=n,[{wrapId:D,wrapProps:J,labelProps:fe,...Z},te]=zg(ee),ne=z.useMemo(()=>e==="ReadOnly"||I,[e,I]),ue=z.useMemo(()=>w?20:0,[w]),[se,j]=z.useState(S==="Med"?40:50),re=z.useMemo(()=>ne?0:se,[ne,se]),[ge,ve]=z.useMemo(()=>!i||ne||O==="Top"?[0,0]:[20,6],[i,ne,O]),oe=z.useMemo(()=>ge+ve,[ge,ve]),[K,he]=z.useState(w),[Ae,He]=z.useState(!1),[xe,Fe]=z.useState(!1),Me=z.useRef(null),Be=z.useRef(0),ke=z.useRef(0),Re=z.useMemo(()=>Z.label?24:0,[Z.label]),ze=z.useMemo(()=>R==="Title",[R]),Xe=z.useMemo(()=>w||m||ze,[w,m,ze]),Le=z.useMemo(()=>Xe?"fit-content":x?x+Re:`calc(100% - ${Re}px)`,[Xe,x,Re]),ht=z.useMemo(()=>{if(w){if(K)switch(e){case"ReadOnly":return K;case"Raw":return K+oe;default:return K+re+oe}}else return},[w,K,e,re,oe]),Qe=z.useMemo(()=>{if(!(!x||x<=re+oe))switch(e){case"ReadOnly":return x;case"Raw":return x-oe;default:return x-re-oe}},[e,re,oe,x]),ot=z.useMemo(()=>{if(m&&w){const ft=Math.min(m-re-oe,w);return ne?ft:ft+re+oe}else return m||(w?void 0:`calc(100% - ${Re}px)`)},[m,w,Re,re,oe,ne]),tt=z.useMemo(()=>(Array.isArray(Z.errorMessage)?Z.errorMessage.some(Boolean):!!Z.errorMessage)?"Error":e,[Z.errorMessage,e]),rt=z.useCallback(ft=>{let Lt=ft;Lt=p7.sanitize(ft);const _t=document.createElement("div");return _t.innerHTML=Lt,new Ke(_t,{readOnly:!0}).getContents()},[]),[dt,Mt]=Do(r,""),[Bt,Ft]=z.useState(()=>rt(dt));z.useEffect(()=>{Mt===void 0&&Ft(rt(dt))},[rt,Mt,dt]);const Jt=z.useMemo(()=>M.jsx(Fz,{htmlDelta:Bt,isReadonly:ne,limit:H*u1.KB,useError:i}),[Bt,ne,H,i]),pn=z.useRef(null),zt=z.useRef([]),[vn,Ht]=z.useState(!0);z.useEffect(()=>{const ft=setTimeout(()=>Ht(!1),0);return()=>{clearTimeout(ft),zt.current.forEach(Lt=>Lt()),zt.current=[]}},[]);const wn=z.useCallback((ft,Lt)=>{if(!w)return Lt;const _t=m?m-re-oe:w,Wt=Math.max(_t,0),an=x?x-re-oe:_;return Math.min(an,Math.max(Wt,Lt+ft))},[w,m,re,oe,x,_]),ut=z.useCallback(ft=>{if(!Ae||!w)return;const Lt=ft.clientY-ke.current,_t=wn(Lt,Be.current);K!==_t&&he(_t),ft.preventDefault(),ft.stopPropagation()},[Ae,w,wn,K]),at=z.useCallback(ft=>{He(!1),Fe(!1),document.removeEventListener("mousemove",ut),document.removeEventListener("mouseup",at),ft.preventDefault(),ft.stopPropagation()},[ut]),gt=z.useCallback(ft=>{if(!w)return;if(ft.detail===2){he(w);return}K===void 0?(he(w),Be.current=w):Be.current=K,He(!0),Fe(!0),ke.current=ft.clientY;const Lt=Wt=>{if(!w)return;const an=Wt.clientY-ke.current,xt=wn(an,Be.current);he(xt),Wt.preventDefault(),Wt.stopPropagation()},_t=Wt=>{He(!1),Fe(!1),document.removeEventListener("mousemove",Lt),document.removeEventListener("mouseup",_t),Wt.preventDefault(),Wt.stopPropagation()};document.addEventListener("mousemove",Lt),document.addEventListener("mouseup",_t),ft.preventDefault(),ft.stopPropagation()},[w,K,wn]),It=z.useCallback((ft,Lt,_t,Wt)=>{if(_t!=="user"&&_t!=="api")return;const an=Wt.getContents(),xt=Wt.getLength()-1,Ot=P!==void 0&&xt>P,rn=cr=>cr.replace(/\s{2,}/g,En=>"&nbsp;".repeat(En.length)),mn=ft.replace(/^<p><br><\/p>$/,"").trim(),Cn=rn(mn);if(!Ot){Ft(an),Mt==null||Mt(Cn);return}const Xt=ln(an,P);Ft(Xt);const xn=new Ke(document.createElement("div"));xn.setContents(Xt);const Nn=rn(xn.root.innerHTML.replace(/^<p><br><\/p>$/,"").trim());Mt==null||Mt(Nn)},[P,Mt]),ln=(ft,Lt)=>{var an,xt,Ot;if(!ft.ops)return ft;const _t=new Jn;let Wt=0;for(const rn of ft.ops){if(Wt>=Lt)break;if(rn.insert&&typeof rn.insert=="string"){const mn=rn.insert,Cn=Lt-Wt;if(mn.length<=Cn)(an=_t.ops)==null||an.push(rn),Wt+=mn.length;else{const Xt={...rn,insert:mn.substring(0,Cn)};(xt=_t.ops)==null||xt.push(Xt),Wt+=Cn;break}}else Wt<Lt&&((Ot=_t.ops)==null||Ot.push(rn),Wt+=1)}return _t},sn=z.useCallback(ft=>{var an,xt;const Lt=ft.getEditor().container;if(!Lt)return null;const _t=(an=Lt.closest(".AEditorContainer"))==null?void 0:an.querySelector(".ql-toolbar");return _t||((xt=Lt.parentElement)==null?void 0:xt.querySelector(".ql-toolbar"))||null},[]),nn=z.useCallback((ft,Lt,_t,Wt)=>{if(!ft)return;const an=_t;ft.addEventListener(Lt,an,Wt),zt.current.push(()=>ft.removeEventListener(Lt,an,Wt))},[]),Ue=z.useCallback((ft,Lt,_t)=>{const Wt=Lt.getFormat();ft.forEach(an=>{if(Wt[an]){const xt=Wt[an],Ot=`.ql-${an}`,rn=_t.querySelector(`${Ot} .ql-picker-label`),mn=_t.querySelectorAll(`${Ot} .ql-picker-item`),Cn=Array.from(mn).find(Xt=>Xt.getAttribute("data-value")===xt);Cn&&(Cn.classList.add("ql-selected"),rn==null||rn.classList.add("ql-active"))}})},[]),Ce=z.useCallback(ft=>{if(!ft.length)return;const Wt=ft[0].target.getBoundingClientRect(),an=Math.ceil(Wt.height);j(xt=>Math.abs(xt-an)<.1?xt:an)},[]),Ze=z.useCallback((ft,Lt)=>{if(ft.key!=="Backspace")return;const _t=Lt.getSelection(!1);if(!_t||_t.length>0)return;const Wt=_t.index;if(Wt<=0)return;const[an]=Lt.getLine(Wt);if(an&&Wt===Lt.getIndex(an)||Lt.getFormat(Wt,1).link)return;const xt=Lt.getFormat(Wt-1,1);if(xt.link){ft.preventDefault();let Ot=Wt-1;for(;Ot>0&&Lt.getFormat(Ot-1,1).link===xt.link;)Ot--;const[rn]=Lt.scroll.descendant(mn=>{var Cn;return((Cn=mn==null?void 0:mn.statics)==null?void 0:Cn.blotName)==="link"},Ot);if(rn!=null&&rn.domNode){const mn=(rn.domNode.textContent||"").length;Lt.removeFormat(Ot,mn)}}},[]),Ct=z.useCallback(()=>({clipboard:{matchers:[["img",()=>!1],["table",()=>!1],["iframe",()=>!1],["video",()=>!1],["h1, h2, h3, h4, h5, h6",()=>!1],["blockquote",()=>!1],["hr",()=>!1]]},copy:{isTitleMode:!0},keyboard:{bindings:{enter:{key:"Enter",handler:()=>!1},newline:{key:"Enter",shiftKey:!0,handler:()=>!1},tab:{key:"Tab",handler:()=>!1},"remove-newline":{key:"Backspace",collapsed:!0,format:["blockquote","list","code-block"],offset:0,handler:function(ft){const{blockquote:Lt,list:_t,["code-block"]:Wt}=ft.getFormat();return Lt||_t||Wt?(ft.format("blockquote",!1),ft.format("list",!1),ft.format("code-block",!1),!1):!0}}}},magicUrl:!0,toolbar:{container:[["bold","italic","underline","strike",{color:[]},{background:[]},"clean"]]}}),[]),Qt=z.useCallback(()=>({clipboard:{},copy:{},keyboard:{},magicUrl:!0,toggleFullscreen:{type:tt,maximize:a1.renderToString(M.jsx(uo,{icon:"Maximize",size:S==="Med"?"sm":"md"})),minimize:a1.renderToString(M.jsx(uo,{icon:"Minimize",size:S==="Med"?"sm":"md"}))},imageCompress:{quality:u1.QUALITY,imageType:"image/jpeg",maxWidth:1500,maxHeight:1500,debug:!1,handleOnPaste:ft=>{var Lt,_t;try{const Wt=(Lt=ft.clipboardData)==null?void 0:Lt.items;if(!Wt)return!0;const an=Array.from(Wt).some(rn=>{const mn=rn.type.toLowerCase();return mn.includes("Excel")||mn.includes("text/html")}),xt=(_t=ft.clipboardData)==null?void 0:_t.getData("text/html"),Ot=xt&&(xt.includes("<table")||xt.includes("<tbody")||xt.includes("<td"));return!(an||Ot)}catch(Wt){return console.warn("Error in handleOnPaste:",Wt),!0}},insertIntoEditor:(ft,Lt,_t)=>{u1.IMAGE_SIZES.has(ft)||u1.IMAGE_SIZES.set(ft,Lt.size);const Wt=_t.getSelection();Wt&&_t.insertEmbed(Wt.index,"image",ft,Ke.sources.USER)}},...!ne&&{...!B&&{resize:{}},table:!1,tableUp:{fullSwitch:!1,icon:a1.renderToString(M.jsx(uo,{icon:"Table",size:S==="Med"?"sm":"md",strokeWidth:2.5})),resize:ZB,resizeScale:XB,customSelect:ez,selection:JB,fixUnusuaDeletelTable:!1,selectionOptions:{tableMenu:YB,tableMenuOptions:{localstorageKey:"used-color",tipText:!0,tools:[io.InsertCaption,io.InsertTop,io.InsertRight,io.InsertBottom,io.InsertLeft,io.Break,io.MergeCell,io.SplitCell,io.Break,io.DeleteRow,io.DeleteColumn,io.DeleteTable,io.Break,io.BackgroundColor,io.BorderColor,io.Break,io.CopyCell,io.CutCell,io.Break,io.SwitchWidth]}},texts:{fullCheckboxText:Nr.AEditor["Insert Full Width Table"],customBtnText:Nr.AEditor.Custom,confirmText:Nr.AEditor.Confirm,cancelText:Nr.AEditor.Cancel,rowText:Nr.AEditor.Row,colText:Nr.AEditor.Column,CopyCell:Nr.AEditor["Copy Cell"],CutCell:Nr.AEditor["Cut Cell"],notPositiveNumberError:Nr.AEditor["Not Positive Number Error"],custom:Nr.AEditor.Custom,clear:Nr.AEditor.Clear,transparent:Nr.AEditor.Transparent,perWidthInsufficient:Nr.AEditor.perWidthInsufficient,InsertTop:Nr.AEditor["Insert Row Top"],InsertRight:Nr.AEditor["Insert Column Right"],InsertBottom:Nr.AEditor["Insert Row Bottom"],InsertLeft:Nr.AEditor["Insert Column Left"],MergeCell:Nr.AEditor["Merge Cell"],SplitCell:Nr.AEditor["Split Cell"],DeleteRow:Nr.AEditor["Delete Row"],DeleteColumn:Nr.AEditor["Delete Column"],DeleteTable:Nr.AEditor["Delete Table"],BackgroundColor:Nr.AEditor["Set Background Color"],BorderColor:Nr.AEditor["Set Border Color"],SwitchWidth:Nr.AEditor["Switch Table Width"],InsertCaption:Nr.AEditor["Insert Table Caption"]}},toolbar:{container:[[{header:[1,2,3,!1,4]}],["bold","italic","underline","strike","blockquote","divider",{[E4.toolName]:[]},{color:[]},{background:[]}],[{list:"ordered"},{list:"bullet"},{indent:"-1"},{indent:"+1"},{align:[]}],["link","image","video"],["clean"]],handlers:{divider:function(){const ft=this.quill,Lt=ft.getSelection(!0);if(!Lt)return;const _t=Math.min(Lt.index+1,ft.getLength()-1);ft.insertEmbed(_t,"divider",!0,Ke.sources.USER),setTimeout(()=>ft.setSelection(Math.min(_t+1,ft.getLength()-1),0,Ke.sources.SILENT),0)}}}}}),[ne,B,S,tt]),Vt=z.useMemo(()=>ze?Ct():Qt(),[ze,Ct,Qt]),bn=z.useCallback(ft=>{if(!ft)return;const Lt=ft.getEditor();if(!Lt)return;const _t=Lt.root,Wt=sn(ft);_t&&W&&_t.classList.add(...W.split(" ")),_t&&Y&&Object.entries(Y).forEach(([xt,Ot])=>{const rn=xt.replace(/([A-Z])/g,mn=>`-${mn[0].toLowerCase()}`);_t.style[rn]=Ot}),nn(_t,"keydown",xt=>Ze(xt,Lt));const an=new ResizeObserver(Ce);if(Wt){an.observe(Wt),zt.current.push(()=>an.disconnect());const xt=["header","color","background"];xt.forEach(Ot=>{const rn=Wt.querySelector(`.ql-${Ot} .ql-picker-label`);rn&&nn(rn,"click",()=>Ue(xt,Lt,Wt))})}},[sn,W,Y,nn,Ce,Ze,Ue]),hn=z.useCallback(ft=>{if(zt.current.forEach(_t=>_t()),zt.current=[],pn.current=ft,!ft){ng.isFunction(t)?t(null):t!=null&&t.current&&(t.current=null);return}const Lt=ft;Lt.copyContent=_t=>{ft.getEditor().getModule("copy").copyContent(_t)},ng.isFunction(t)?t(Lt):t&&(t.current=Lt),bn(ft)},[t,bn]);return M.jsx(sg,{wrapId:D,...Z,label:M.jsxs(vl,{style:{gap:4},children:[Z.label,O==="Top"&&Jt]}),labelProps:{...fe,style:{minHeight:Z.label?20:void 0,marginBottom:Z.label?4:0,...fe==null?void 0:fe.style}},wrapProps:{...J,className:bt.clsx(J==null?void 0:J.className,!Xe&&af.AEditorWrapper),style:{...J==null?void 0:J.style,height:Le}},children:M.jsxs(Wi,{...te,className:bt.clsx(te.className,af.AEditorContainer,vn&&"NoTransition"),style:{...g,height:ht,minHeight:ot},children:[M.jsx(Pv,{...u,ref:hn,preserveWhitespace:!0,modules:Vt,placeholder:o,readOnly:ne,theme:"snow",value:Bt,className:bt.clsx(u==null?void 0:u.className,af.AEditor,af[tt],ze&&"Title",vn&&"NoTransition"),style:{...u==null?void 0:u.style,maxHeight:Qe?Qe+re:void 0,"--icon-size":`${S==="Med"?20:24}px`,"--editor-padding":ze?"8px 12px":"12px","--toolbar-padding":`${S==="Med"?7.5:12.5}px`,"--content-height":ze?"fit-content":K?`${K}px`:"100%","--content-max-height":Qe?`${Qe}px`:"100%","--default-text":`'${Nr.AEditor.Default}'`,"--visit-url-text":`'${Nr.AEditor["Visit URL:"]}'`,"--enter-link-text":`'${Nr.AEditor["Enter link:"]}'`,"--enter-video-text":`'${Nr.AEditor["Enter video:"]}'`,"--edit-text":`'${Nr.AEditor.Edit}'`,"--save-text":`'${Nr.AEditor.Save}'`,"--remove-text":`'${Nr.AEditor.Remove}'`,"--arrow-background":`url("data:image/svg+xml,${encodeURIComponent(a1.renderToString(M.jsx(uo,{icon:"EditorArrow"})))}`,"--title-color-picker-row":ze?1:4,"--title-header-font-size":`${S==="Med"?12:14}px`},onChange:It}),w&&M.jsxs(M.Fragment,{children:[M.jsx("div",{ref:Me,className:bt.clsx(af.Resizer,vn&&"NoTransition"),style:{height:ue,bottom:i&&!ne?oe:0},onMouseDown:gt}),M.jsx("div",{children:`${Math.round(K)}px`,className:bt.clsx(af.Indicator,"NoSelect","Label1",vn&&"NoTransition"),style:{height:ue,bottom:i&&!ne?oe:0,display:xe?"flex":"none"}})]}),M.jsx("div",{children:Jt,className:bt.clsx(af.LimitContainer,"NoSelect",vn&&"NoTransition"),style:{marginTop:ve,minHeight:ge,display:O==="Bottom"?"flex":"none"}})]})})},Fz=n=>{const e=Vn.c(17),{htmlDelta:t,limit:r,useError:i,isReadonly:o}=n,[l,a]=Do(i,!1),u=Dz.calculateTextSize(t);let g,m;if(e[0]!==u||e[1]!==r||e[2]!==a?(g=()=>{a&&a(u>r)},m=[u,r,a],e[0]=u,e[1]=r,e[2]=a,e[3]=g,e[4]=m):(g=e[3],m=e[4]),z.useEffect(g,m),!i||o)return null;let x;e[5]!==l?(x=bt.clsx(l&&af.Error),e[5]=l,e[6]=x):x=e[6];let w;e[7]!==u?(w=Lg(u),e[7]=u,e[8]=w):w=e[8];let _;e[9]!==x||e[10]!==w?(_=M.jsx("span",{className:x,children:w}),e[9]=x,e[10]=w,e[11]=_):_=e[11];let S;e[12]!==r?(S=Lg(r),e[12]=r,e[13]=S):S=e[13];let R;return e[14]!==_||e[15]!==S?(R=M.jsxs(nd,{className:af.Limit,children:["(",_," / ",S,")"]}),e[14]=_,e[15]=S,e[16]=R):R=e[16],R};function Bz(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return z.useMemo(()=>r=>{e.forEach(i=>i(r))},e)}const zv=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function N1(n){const e=Object.prototype.toString.call(n);return e==="[object Window]"||e==="[object global]"}function jm(n){return"nodeType"in n}function uf(n){var e,t;return n?N1(n)?n:jm(n)&&(e=(t=n.ownerDocument)==null?void 0:t.defaultView)!=null?e:window:window}function $m(n){const{Document:e}=uf(n);return n instanceof e}function Kp(n){return N1(n)?!1:n instanceof uf(n).HTMLElement}function k4(n){return n instanceof uf(n).SVGElement}function F1(n){return n?N1(n)?n.document:jm(n)?$m(n)?n:Kp(n)||k4(n)?n.ownerDocument:document:document:document}const ld=zv?z.useLayoutEffect:z.useEffect;function e2(n){const e=z.useRef(n);return ld(()=>{e.current=n}),z.useCallback(function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return e.current==null?void 0:e.current(...r)},[])}function zz(){const n=z.useRef(null),e=z.useCallback((r,i)=>{n.current=setInterval(r,i)},[]),t=z.useCallback(()=>{n.current!==null&&(clearInterval(n.current),n.current=null)},[]);return[e,t]}function zp(n,e){e===void 0&&(e=[n]);const t=z.useRef(n);return ld(()=>{t.current!==n&&(t.current=n)},e),t}function Jp(n,e){const t=z.useRef();return z.useMemo(()=>{const r=n(t.current);return t.current=r,r},[...e])}function bv(n){const e=e2(n),t=z.useRef(null),r=z.useCallback(i=>{i!==t.current&&(e==null||e(i,t.current)),t.current=i},[]);return[t,r]}function um(n){const e=z.useRef();return z.useEffect(()=>{e.current=n},[n]),e.current}let Pb={};function Qp(n,e){return z.useMemo(()=>{if(e)return e;const t=Pb[n]==null?0:Pb[n]+1;return Pb[n]=t,n+"-"+t},[n,e])}function M4(n){return function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return r.reduce((o,l)=>{const a=Object.entries(l);for(const[u,g]of a){const m=o[u];m!=null&&(o[u]=m+n*g)}return o},{...e})}}const m1=M4(1),yv=M4(-1);function Hz(n){return"clientX"in n&&"clientY"in n}function t2(n){if(!n)return!1;const{KeyboardEvent:e}=uf(n.target);return e&&n instanceof e}function Wz(n){if(!n)return!1;const{TouchEvent:e}=uf(n.target);return e&&n instanceof e}function fm(n){if(Wz(n)){if(n.touches&&n.touches.length){const{clientX:e,clientY:t}=n.touches[0];return{x:e,y:t}}else if(n.changedTouches&&n.changedTouches.length){const{clientX:e,clientY:t}=n.changedTouches[0];return{x:e,y:t}}}return Hz(n)?{x:n.clientX,y:n.clientY}:null}const Hp=Object.freeze({Translate:{toString(n){if(!n)return;const{x:e,y:t}=n;return"translate3d("+(e?Math.round(e):0)+"px, "+(t?Math.round(t):0)+"px, 0)"}},Scale:{toString(n){if(!n)return;const{scaleX:e,scaleY:t}=n;return"scaleX("+e+") scaleY("+t+")"}},Transform:{toString(n){if(n)return[Hp.Translate.toString(n),Hp.Scale.toString(n)].join(" ")}},Transition:{toString(n){let{property:e,duration:t,easing:r}=n;return e+" "+t+"ms "+r}}}),Ow="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Uz(n){return n.matches(Ow)?n:n.querySelector(Ow)}const Gz={display:"none"};function Yz(n){let{id:e,value:t}=n;return z.createElement("div",{id:e,style:Gz},t)}function Vz(n){let{id:e,announcement:t,ariaLiveType:r="assertive"}=n;const i={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return z.createElement("div",{id:e,style:i,role:"status","aria-live":r,"aria-atomic":!0},t)}function Zz(){const[n,e]=z.useState("");return{announce:z.useCallback(r=>{r!=null&&e(r)},[]),announcement:n}}const L4=z.createContext(null);function Xz(n){const e=z.useContext(L4);z.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of <DndContext>");return e(n)},[n,e])}function Kz(){const[n]=z.useState(()=>new Set),e=z.useCallback(r=>(n.add(r),()=>n.delete(r)),[n]);return[z.useCallback(r=>{let{type:i,event:o}=r;n.forEach(l=>{var a;return(a=l[i])==null?void 0:a.call(l,o)})},[n]),e]}const Jz={draggable:`
480
+ `,attributes:{[je.tableCellInner]:u}}),new N0(g)}handleBorderNoneStyles(t,r){if(!(r!=null&&r.style))return;["border",...["top","right","bottom","left"].flatMap(o=>[`border-${o}`,`border-${o}-style`])].filter(o=>t.style[o]==="none").forEach(o=>r.style=r.style.replaceAll(new RegExp(`${o}:none;?`,"g"),""))}convert({html:t,text:r},i={}){if(t){const a=new DOMParser().parseFromString(t,"text/html");this.preprocessTableHtml(a),this.mergeClassStylesToInline(a),t=a.body.innerHTML}const o=super.convert({html:t,text:r},i);if(i[je.tableCellInner])for(const l of o.ops){if(ng.isObject(l.insert)&&l.insert[je.tableCol]){l.insert="";continue}l.attributes||(l.attributes={}),l.attributes[je.tableCellInner]=i[je.tableCellInner]}return o}parseStyleWithFilter(t,r){if(!t)return{};const i={};let o="",l="",a=!0,u=0;for(let g=0;g<t.length;g++){const m=t[g];m===":"&&a?(o=t.substring(u,g).trim(),u=g+1,a=!1):m===";"&&(!a&&o&&(l=t.substring(u,g).trim(),(!r||r(o))&&(i[o]=l)),u=g+1,a=!0)}return!a&&o&&u<t.length&&(l=t.substring(u).trim(),(!r||r(o))&&(i[o]=l)),i}mergeClassStylesToInline(t){var r;try{const i=t.querySelectorAll("td[class], th[class]");if(i.length===0)return;const o=new Set;for(const m of i)(m.getAttribute("class")||"").split(/\s+/).filter(Boolean).forEach(w=>o.add(w));if(o.size===0)return;const l=t.querySelectorAll("style");if(l.length===0)return;const a=Array.from(l).map(m=>m.textContent||"").join("");if(!a)return;const u={},g=m=>this.STYLE_PROPERTIES.some(x=>m.startsWith(x));for(const m of o){const x=new RegExp(`\\.${m}[^{]*{([^}]*)}`,"g");let w;for(;(w=x.exec(a))!==null;){const _=w[1],S=this.parseStyleWithFilter(_),R={};let I=!1;for(const O in S)g(O)&&(R[O]=S[O],I=!0);I&&(u[m]=R)}}if(Object.keys(u).length===0)return;for(let m=0;m<i.length;m++){const x=i[m],w=((r=x.getAttribute("class"))==null?void 0:r.split(/\s+/).filter(Boolean))||[],_=x.getAttribute("style")||"",S=this.parseStyleWithFilter(_);let R=!1;for(const I of w){const O=u[I];if(O)for(const P in O)S[P]||(S[P]=O[P],R=!0)}if(R){let I="";for(const O in S)I+=O+":"+S[O]+";";I&&x.setAttribute("style",I)}x.removeAttribute("class")}}catch(i){console.error("스타일 처리 오류",i)}}matchCaption(t,r){for(let i=0;i<r.ops.length;i++){const o=r.ops[i],{attributes:l}=o;l&&l[je.tableCaption]&&(l[je.tableCaption].tableId=this.tableId,o.attributes=l)}return r}preprocessTableHtml(t){try{const r=t.querySelectorAll("table");for(const i of Array.from(r))i.querySelectorAll("tr").length!==0&&(this.cleanupTableStyles(i),this.applyRowspanHeights(i),this.fixRowspanCells(i));this.mergeClassStylesToInline(t)}catch(r){console.error("테이블 전처리 오류",r)}}cleanupTableStyles(t){const r=t.querySelectorAll("td, th, tr, colgroup");for(const i of r){const o=i;o.removeAttribute("height");const l=o.getAttribute("style");if(l){const a=l.replace(/height\s*:[^;]*;?/gi,"").trim();o.setAttribute("style",a||"")}}}applyRowspanHeights(t){const i=t.querySelectorAll("td, th");t.style.borderCollapse="collapse";for(const o of i){const l=o,u=parseInt(l.getAttribute("rowspan")||"1")*24,g=l.getAttribute("style")||"",m=g+(g?"; ":"")+`height: ${u}px`;l.setAttribute("style",m)}}fixRowspanCells(t){const r=t.querySelectorAll("tr");if(r.length<=1)return;const i=[],o=new Map;for(let l=0;l<r.length;l++){const u=r[l].querySelectorAll("td, th");if(u.length===0&&l<r.length-1){i.push(l);continue}for(const g of Array.from(u)){const m=parseInt(g.getAttribute("rowspan")||"1");if(m>1)for(let x=1;x<m;x++){const w=l+x;if(w>=r.length)break;o.has(w)||o.set(w,[]),o.get(w).push(g)}}}i.length>0&&this.processEmptyRows(i,r,o)}processEmptyRows(t,r,i){for(const o of t){const l=i.get(o);if(l)for(const a of l){const u=parseInt(a.getAttribute("rowspan")||"1");u>1&&a.setAttribute("rowspan",(u-1).toString())}}for(const o of t.reverse())r[o].remove()}}class Pz extends E4{fixUnusuaDeletelTable(){}mergeCells(e){if(!this.table||!this.tableSelection)return;const t=this.tableSelection.selectedTds||[];if(t.length>1&&(e=t),!e||e.length<=1)return;const r=Kl(e[0],je.tableMain),i=r.getRows(),o=e.map(w=>{if(!w||!w.parent||!w.parent.domNode)return null;const _=w.parent.domNode;if(!_)return null;const S=i.findIndex(O=>O.rowId===w.rowId);if(S===-1)return null;const R=w.getColumnIndex();if(R===-1)return null;const I=_.getBoundingClientRect();return!I||I.width===0||I.height===0?null:{td:w,rowIndex:S,colIndex:R,rowspan:w.rowspan,colspan:w.colspan,visualLeft:I.left,visualRight:I.right,visualTop:I.top,visualBottom:I.bottom}}).filter(Boolean);if(o.length<=1)return;o.sort((w,_)=>w.visualTop-_.visualTop||w.visualLeft-_.visualLeft);const l=o[0],a=l.td,u=Math.max(...o.map(w=>w.rowIndex+w.rowspan-1)),g=Math.max(...o.map(w=>w.colIndex+w.colspan-1)),m=u-l.rowIndex+1,x=g-l.colIndex+1;for(const w of o)w.td!==a&&(w.td.moveChildren(a),w.td.parent.remove());a.rowspan=m,a.colspan=x,this.fixTableByRemove(r)}}Ke.register({"modules/imageCompress":Fp,"modules/resize":I4,"modules/tableUp":Pz,"modules/magicUrl":aF,"formats/divider":am,"modules/clipboard":Oz,"modules/copy":hz,"modules/toggleFullscreen":o4},!0);const u1={KB:1024,QUALITY:.7,IMAGE_SIZES:new Map},Dz={getCharLength:n=>Array.from(n).length,calculateTextSize:n=>{if(!n.ops||n.ops.length===0)return 0;let e=0;for(const t of n.ops)if(typeof t.insert=="string")e+=new TextEncoder().encode(t.insert).length-1;else if(typeof t.insert=="object"&&t.insert.image){const r=t.insert.image;r&&(e+=u1.IMAGE_SIZES.get(r)||Math.ceil(r.length*u1.QUALITY))}return e}},Nz=n=>{const{type:e="Primary",editorRef:t,useValue:r,useError:i,placeholder:o,tabIndex:l,autoFocus:a,editorProps:u,style:g,minHeight:m,maxHeight:x,contentHeight:w,contentMaxHeight:_=1e3,toolbarSize:S="Med",toolbarType:R="Default",readOnly:I,limitPosition:O="Bottom",maxLength:P,size:H=100,editorClassName:W,editorStyle:Y,noImageResize:B,...ee}=n,[{wrapId:D,wrapProps:J,labelProps:fe,...Z},te]=zg(ee),ne=z.useMemo(()=>e==="ReadOnly"||I,[e,I]),ue=z.useMemo(()=>w?20:0,[w]),[se,j]=z.useState(S==="Med"?40:50),re=z.useMemo(()=>ne?0:se,[ne,se]),[ge,ve]=z.useMemo(()=>!i||ne||O==="Top"?[0,0]:[20,6],[i,ne,O]),oe=z.useMemo(()=>ge+ve,[ge,ve]),[K,he]=z.useState(w),[Ae,He]=z.useState(!1),[xe,Fe]=z.useState(!1),Me=z.useRef(null),Be=z.useRef(0),ke=z.useRef(0),Re=z.useMemo(()=>Z.label?24:0,[Z.label]),ze=z.useMemo(()=>R==="Title",[R]),Xe=z.useMemo(()=>!!w||ze,[w,ze]),Le=z.useMemo(()=>Xe?"fit-content":x?x+Re:`calc(100% - ${Re}px)`,[Xe,x,Re]),ht=z.useMemo(()=>{if(!w)return m?"100%":void 0;if(K)switch(e){case"ReadOnly":return K;case"Raw":return K+oe;default:return K+re+oe}},[w,K,m,e,re,oe]),Qe=z.useMemo(()=>{if(!(!x||x<=re+oe))switch(e){case"ReadOnly":return x;case"Raw":return x-oe;default:return x-re-oe}},[e,re,oe,x]),ot=z.useMemo(()=>{if(m&&w){const ft=Math.min(m-re-oe,w);return ne?ft:ft+re+oe}else return m||(w?void 0:`calc(100% - ${Re}px)`)},[m,w,Re,re,oe,ne]),tt=z.useMemo(()=>(Array.isArray(Z.errorMessage)?Z.errorMessage.some(Boolean):!!Z.errorMessage)?"Error":e,[Z.errorMessage,e]),rt=z.useCallback(ft=>{let Lt=ft;Lt=p7.sanitize(ft);const _t=document.createElement("div");return _t.innerHTML=Lt,new Ke(_t,{readOnly:!0}).getContents()},[]),[dt,Mt]=Do(r,""),[Bt,Ft]=z.useState(()=>rt(dt));z.useEffect(()=>{Mt===void 0&&Ft(rt(dt))},[rt,Mt,dt]);const Jt=z.useMemo(()=>M.jsx(Fz,{htmlDelta:Bt,isReadonly:ne,limit:H*u1.KB,useError:i}),[Bt,ne,H,i]),pn=z.useRef(null),zt=z.useRef([]),[vn,Ht]=z.useState(!0);z.useEffect(()=>{const ft=setTimeout(()=>Ht(!1),0);return()=>{clearTimeout(ft),zt.current.forEach(Lt=>Lt()),zt.current=[]}},[]);const wn=z.useCallback((ft,Lt)=>{if(!w)return Lt;const _t=m?m-re-oe:w,Wt=Math.max(_t,0),an=x?x-re-oe:_;return Math.min(an,Math.max(Wt,Lt+ft))},[w,m,re,oe,x,_]),ut=z.useCallback(ft=>{if(!Ae||!w)return;const Lt=ft.clientY-ke.current,_t=wn(Lt,Be.current);K!==_t&&he(_t),ft.preventDefault(),ft.stopPropagation()},[Ae,w,wn,K]),at=z.useCallback(ft=>{He(!1),Fe(!1),document.removeEventListener("mousemove",ut),document.removeEventListener("mouseup",at),ft.preventDefault(),ft.stopPropagation()},[ut]),gt=z.useCallback(ft=>{if(!w)return;if(ft.detail===2){he(w);return}K===void 0?(he(w),Be.current=w):Be.current=K,He(!0),Fe(!0),ke.current=ft.clientY;const Lt=Wt=>{if(!w)return;const an=Wt.clientY-ke.current,xt=wn(an,Be.current);he(xt),Wt.preventDefault(),Wt.stopPropagation()},_t=Wt=>{He(!1),Fe(!1),document.removeEventListener("mousemove",Lt),document.removeEventListener("mouseup",_t),Wt.preventDefault(),Wt.stopPropagation()};document.addEventListener("mousemove",Lt),document.addEventListener("mouseup",_t),ft.preventDefault(),ft.stopPropagation()},[w,K,wn]),It=z.useCallback((ft,Lt,_t,Wt)=>{if(_t!=="user"&&_t!=="api")return;const an=Wt.getContents(),xt=Wt.getLength()-1,Ot=P!==void 0&&xt>P,rn=cr=>cr.replace(/\s{2,}/g,En=>"&nbsp;".repeat(En.length)),mn=ft.replace(/^<p><br><\/p>$/,"").trim(),Cn=rn(mn);if(!Ot){Ft(an),Mt==null||Mt(Cn);return}const Xt=ln(an,P);Ft(Xt);const xn=new Ke(document.createElement("div"));xn.setContents(Xt);const Nn=rn(xn.root.innerHTML.replace(/^<p><br><\/p>$/,"").trim());Mt==null||Mt(Nn)},[P,Mt]),ln=(ft,Lt)=>{var an,xt,Ot;if(!ft.ops)return ft;const _t=new Jn;let Wt=0;for(const rn of ft.ops){if(Wt>=Lt)break;if(rn.insert&&typeof rn.insert=="string"){const mn=rn.insert,Cn=Lt-Wt;if(mn.length<=Cn)(an=_t.ops)==null||an.push(rn),Wt+=mn.length;else{const Xt={...rn,insert:mn.substring(0,Cn)};(xt=_t.ops)==null||xt.push(Xt),Wt+=Cn;break}}else Wt<Lt&&((Ot=_t.ops)==null||Ot.push(rn),Wt+=1)}return _t},sn=z.useCallback(ft=>{var an,xt;const Lt=ft.getEditor().container;if(!Lt)return null;const _t=(an=Lt.closest(".AEditorContainer"))==null?void 0:an.querySelector(".ql-toolbar");return _t||((xt=Lt.parentElement)==null?void 0:xt.querySelector(".ql-toolbar"))||null},[]),nn=z.useCallback((ft,Lt,_t,Wt)=>{if(!ft)return;const an=_t;ft.addEventListener(Lt,an,Wt),zt.current.push(()=>ft.removeEventListener(Lt,an,Wt))},[]),Ue=z.useCallback((ft,Lt,_t)=>{const Wt=Lt.getFormat();ft.forEach(an=>{if(Wt[an]){const xt=Wt[an],Ot=`.ql-${an}`,rn=_t.querySelector(`${Ot} .ql-picker-label`),mn=_t.querySelectorAll(`${Ot} .ql-picker-item`),Cn=Array.from(mn).find(Xt=>Xt.getAttribute("data-value")===xt);Cn&&(Cn.classList.add("ql-selected"),rn==null||rn.classList.add("ql-active"))}})},[]),Ce=z.useCallback(ft=>{if(!ft.length)return;const Wt=ft[0].target.getBoundingClientRect(),an=Math.ceil(Wt.height);j(xt=>Math.abs(xt-an)<.1?xt:an)},[]),Ze=z.useCallback((ft,Lt)=>{if(ft.key!=="Backspace")return;const _t=Lt.getSelection(!1);if(!_t||_t.length>0)return;const Wt=_t.index;if(Wt<=0)return;const[an]=Lt.getLine(Wt);if(an&&Wt===Lt.getIndex(an)||Lt.getFormat(Wt,1).link)return;const xt=Lt.getFormat(Wt-1,1);if(xt.link){ft.preventDefault();let Ot=Wt-1;for(;Ot>0&&Lt.getFormat(Ot-1,1).link===xt.link;)Ot--;const[rn]=Lt.scroll.descendant(mn=>{var Cn;return((Cn=mn==null?void 0:mn.statics)==null?void 0:Cn.blotName)==="link"},Ot);if(rn!=null&&rn.domNode){const mn=(rn.domNode.textContent||"").length;Lt.removeFormat(Ot,mn)}}},[]),Ct=z.useCallback(()=>({clipboard:{matchers:[["img",()=>!1],["table",()=>!1],["iframe",()=>!1],["video",()=>!1],["h1, h2, h3, h4, h5, h6",()=>!1],["blockquote",()=>!1],["hr",()=>!1]]},copy:{isTitleMode:!0},keyboard:{bindings:{enter:{key:"Enter",handler:()=>!1},newline:{key:"Enter",shiftKey:!0,handler:()=>!1},tab:{key:"Tab",handler:()=>!1},"remove-newline":{key:"Backspace",collapsed:!0,format:["blockquote","list","code-block"],offset:0,handler:function(ft){const{blockquote:Lt,list:_t,["code-block"]:Wt}=ft.getFormat();return Lt||_t||Wt?(ft.format("blockquote",!1),ft.format("list",!1),ft.format("code-block",!1),!1):!0}}}},magicUrl:!0,toolbar:{container:[["bold","italic","underline","strike",{color:[]},{background:[]},"clean"]]}}),[]),Qt=z.useCallback(()=>({clipboard:{},copy:{},keyboard:{},magicUrl:!0,toggleFullscreen:{type:tt,maximize:a1.renderToString(M.jsx(uo,{icon:"Maximize",size:S==="Med"?"sm":"md"})),minimize:a1.renderToString(M.jsx(uo,{icon:"Minimize",size:S==="Med"?"sm":"md"}))},imageCompress:{quality:u1.QUALITY,imageType:"image/jpeg",maxWidth:1500,maxHeight:1500,debug:!1,handleOnPaste:ft=>{var Lt,_t;try{const Wt=(Lt=ft.clipboardData)==null?void 0:Lt.items;if(!Wt)return!0;const an=Array.from(Wt).some(rn=>{const mn=rn.type.toLowerCase();return mn.includes("Excel")||mn.includes("text/html")}),xt=(_t=ft.clipboardData)==null?void 0:_t.getData("text/html"),Ot=xt&&(xt.includes("<table")||xt.includes("<tbody")||xt.includes("<td"));return!(an||Ot)}catch(Wt){return console.warn("Error in handleOnPaste:",Wt),!0}},insertIntoEditor:(ft,Lt,_t)=>{u1.IMAGE_SIZES.has(ft)||u1.IMAGE_SIZES.set(ft,Lt.size);const Wt=_t.getSelection();Wt&&_t.insertEmbed(Wt.index,"image",ft,Ke.sources.USER)}},...!ne&&{...!B&&{resize:{}},table:!1,tableUp:{fullSwitch:!1,icon:a1.renderToString(M.jsx(uo,{icon:"Table",size:S==="Med"?"sm":"md",strokeWidth:2.5})),resize:ZB,resizeScale:XB,customSelect:ez,selection:JB,fixUnusuaDeletelTable:!1,selectionOptions:{tableMenu:YB,tableMenuOptions:{localstorageKey:"used-color",tipText:!0,tools:[io.InsertCaption,io.InsertTop,io.InsertRight,io.InsertBottom,io.InsertLeft,io.Break,io.MergeCell,io.SplitCell,io.Break,io.DeleteRow,io.DeleteColumn,io.DeleteTable,io.Break,io.BackgroundColor,io.BorderColor,io.Break,io.CopyCell,io.CutCell,io.Break,io.SwitchWidth]}},texts:{fullCheckboxText:Nr.AEditor["Insert Full Width Table"],customBtnText:Nr.AEditor.Custom,confirmText:Nr.AEditor.Confirm,cancelText:Nr.AEditor.Cancel,rowText:Nr.AEditor.Row,colText:Nr.AEditor.Column,CopyCell:Nr.AEditor["Copy Cell"],CutCell:Nr.AEditor["Cut Cell"],notPositiveNumberError:Nr.AEditor["Not Positive Number Error"],custom:Nr.AEditor.Custom,clear:Nr.AEditor.Clear,transparent:Nr.AEditor.Transparent,perWidthInsufficient:Nr.AEditor.perWidthInsufficient,InsertTop:Nr.AEditor["Insert Row Top"],InsertRight:Nr.AEditor["Insert Column Right"],InsertBottom:Nr.AEditor["Insert Row Bottom"],InsertLeft:Nr.AEditor["Insert Column Left"],MergeCell:Nr.AEditor["Merge Cell"],SplitCell:Nr.AEditor["Split Cell"],DeleteRow:Nr.AEditor["Delete Row"],DeleteColumn:Nr.AEditor["Delete Column"],DeleteTable:Nr.AEditor["Delete Table"],BackgroundColor:Nr.AEditor["Set Background Color"],BorderColor:Nr.AEditor["Set Border Color"],SwitchWidth:Nr.AEditor["Switch Table Width"],InsertCaption:Nr.AEditor["Insert Table Caption"]}},toolbar:{container:[[{header:[1,2,3,!1,4]}],["bold","italic","underline","strike","blockquote","divider",{[E4.toolName]:[]},{color:[]},{background:[]}],[{list:"ordered"},{list:"bullet"},{indent:"-1"},{indent:"+1"},{align:[]}],["link","image","video"],["clean"]],handlers:{divider:function(){const ft=this.quill,Lt=ft.getSelection(!0);if(!Lt)return;const _t=Math.min(Lt.index+1,ft.getLength()-1);ft.insertEmbed(_t,"divider",!0,Ke.sources.USER),setTimeout(()=>ft.setSelection(Math.min(_t+1,ft.getLength()-1),0,Ke.sources.SILENT),0)}}}}}),[ne,B,S,tt]),Vt=z.useMemo(()=>ze?Ct():Qt(),[ze,Ct,Qt]),bn=z.useCallback(ft=>{if(!ft)return;const Lt=ft.getEditor();if(!Lt)return;const _t=Lt.root,Wt=sn(ft);_t&&W&&_t.classList.add(...W.split(" ")),_t&&Y&&Object.entries(Y).forEach(([xt,Ot])=>{const rn=xt.replace(/([A-Z])/g,mn=>`-${mn[0].toLowerCase()}`);_t.style[rn]=Ot}),nn(_t,"keydown",xt=>Ze(xt,Lt));const an=new ResizeObserver(Ce);if(Wt){an.observe(Wt),zt.current.push(()=>an.disconnect());const xt=["header","color","background"];xt.forEach(Ot=>{const rn=Wt.querySelector(`.ql-${Ot} .ql-picker-label`);rn&&nn(rn,"click",()=>Ue(xt,Lt,Wt))})}},[sn,W,Y,nn,Ce,Ze,Ue]),hn=z.useCallback(ft=>{if(zt.current.forEach(_t=>_t()),zt.current=[],pn.current=ft,!ft){ng.isFunction(t)?t(null):t!=null&&t.current&&(t.current=null);return}const Lt=ft;Lt.copyContent=_t=>{ft.getEditor().getModule("copy").copyContent(_t)},ng.isFunction(t)?t(Lt):t&&(t.current=Lt),bn(ft)},[t,bn]);return M.jsx(sg,{wrapId:D,...Z,label:M.jsxs(vl,{style:{gap:4},children:[Z.label,O==="Top"&&Jt]}),labelProps:{...fe,style:{minHeight:Z.label?20:void 0,marginBottom:Z.label?4:0,...fe==null?void 0:fe.style}},wrapProps:{...J,className:bt.clsx(J==null?void 0:J.className,!Xe&&af.AEditorWrapper),style:{...J==null?void 0:J.style,height:Le}},children:M.jsxs(Wi,{...te,className:bt.clsx(te.className,af.AEditorContainer,vn&&"NoTransition"),style:{...g,height:ht,minHeight:ot},children:[M.jsx(Pv,{...u,ref:hn,preserveWhitespace:!0,modules:Vt,placeholder:o,readOnly:ne,theme:"snow",value:Bt,className:bt.clsx(u==null?void 0:u.className,af.AEditor,af[tt],ze&&"Title",vn&&"NoTransition"),style:{...u==null?void 0:u.style,maxHeight:Qe?Qe+re:void 0,"--icon-size":`${S==="Med"?20:24}px`,"--editor-padding":ze?"8px 12px":"12px","--toolbar-padding":`${S==="Med"?7.5:12.5}px`,"--content-height":ze?"fit-content":K?`${K}px`:"100%","--content-max-height":Qe?`${Qe}px`:"100%","--default-text":`'${Nr.AEditor.Default}'`,"--visit-url-text":`'${Nr.AEditor["Visit URL:"]}'`,"--enter-link-text":`'${Nr.AEditor["Enter link:"]}'`,"--enter-video-text":`'${Nr.AEditor["Enter video:"]}'`,"--edit-text":`'${Nr.AEditor.Edit}'`,"--save-text":`'${Nr.AEditor.Save}'`,"--remove-text":`'${Nr.AEditor.Remove}'`,"--arrow-background":`url("data:image/svg+xml,${encodeURIComponent(a1.renderToString(M.jsx(uo,{icon:"EditorArrow"})))}`,"--title-color-picker-row":ze?1:4,"--title-header-font-size":`${S==="Med"?12:14}px`},onChange:It}),w&&M.jsxs(M.Fragment,{children:[M.jsx("div",{ref:Me,className:bt.clsx(af.Resizer,vn&&"NoTransition"),style:{height:ue,bottom:i&&!ne?oe:0},onMouseDown:gt}),M.jsx("div",{children:`${Math.round(K)}px`,className:bt.clsx(af.Indicator,"NoSelect","Label1",vn&&"NoTransition"),style:{height:ue,bottom:i&&!ne?oe:0,display:xe?"flex":"none"}})]}),M.jsx("div",{children:Jt,className:bt.clsx(af.LimitContainer,"NoSelect",vn&&"NoTransition"),style:{marginTop:ve,minHeight:ge,display:O==="Bottom"?"flex":"none"}})]})})},Fz=n=>{const e=Vn.c(17),{htmlDelta:t,limit:r,useError:i,isReadonly:o}=n,[l,a]=Do(i,!1),u=Dz.calculateTextSize(t);let g,m;if(e[0]!==u||e[1]!==r||e[2]!==a?(g=()=>{a&&a(u>r)},m=[u,r,a],e[0]=u,e[1]=r,e[2]=a,e[3]=g,e[4]=m):(g=e[3],m=e[4]),z.useEffect(g,m),!i||o)return null;let x;e[5]!==l?(x=bt.clsx(l&&af.Error),e[5]=l,e[6]=x):x=e[6];let w;e[7]!==u?(w=Lg(u),e[7]=u,e[8]=w):w=e[8];let _;e[9]!==x||e[10]!==w?(_=M.jsx("span",{className:x,children:w}),e[9]=x,e[10]=w,e[11]=_):_=e[11];let S;e[12]!==r?(S=Lg(r),e[12]=r,e[13]=S):S=e[13];let R;return e[14]!==_||e[15]!==S?(R=M.jsxs(nd,{className:af.Limit,children:["(",_," / ",S,")"]}),e[14]=_,e[15]=S,e[16]=R):R=e[16],R};function Bz(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return z.useMemo(()=>r=>{e.forEach(i=>i(r))},e)}const zv=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function N1(n){const e=Object.prototype.toString.call(n);return e==="[object Window]"||e==="[object global]"}function jm(n){return"nodeType"in n}function uf(n){var e,t;return n?N1(n)?n:jm(n)&&(e=(t=n.ownerDocument)==null?void 0:t.defaultView)!=null?e:window:window}function $m(n){const{Document:e}=uf(n);return n instanceof e}function Kp(n){return N1(n)?!1:n instanceof uf(n).HTMLElement}function k4(n){return n instanceof uf(n).SVGElement}function F1(n){return n?N1(n)?n.document:jm(n)?$m(n)?n:Kp(n)||k4(n)?n.ownerDocument:document:document:document}const ld=zv?z.useLayoutEffect:z.useEffect;function e2(n){const e=z.useRef(n);return ld(()=>{e.current=n}),z.useCallback(function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return e.current==null?void 0:e.current(...r)},[])}function zz(){const n=z.useRef(null),e=z.useCallback((r,i)=>{n.current=setInterval(r,i)},[]),t=z.useCallback(()=>{n.current!==null&&(clearInterval(n.current),n.current=null)},[]);return[e,t]}function zp(n,e){e===void 0&&(e=[n]);const t=z.useRef(n);return ld(()=>{t.current!==n&&(t.current=n)},e),t}function Jp(n,e){const t=z.useRef();return z.useMemo(()=>{const r=n(t.current);return t.current=r,r},[...e])}function bv(n){const e=e2(n),t=z.useRef(null),r=z.useCallback(i=>{i!==t.current&&(e==null||e(i,t.current)),t.current=i},[]);return[t,r]}function um(n){const e=z.useRef();return z.useEffect(()=>{e.current=n},[n]),e.current}let Pb={};function Qp(n,e){return z.useMemo(()=>{if(e)return e;const t=Pb[n]==null?0:Pb[n]+1;return Pb[n]=t,n+"-"+t},[n,e])}function M4(n){return function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return r.reduce((o,l)=>{const a=Object.entries(l);for(const[u,g]of a){const m=o[u];m!=null&&(o[u]=m+n*g)}return o},{...e})}}const m1=M4(1),yv=M4(-1);function Hz(n){return"clientX"in n&&"clientY"in n}function t2(n){if(!n)return!1;const{KeyboardEvent:e}=uf(n.target);return e&&n instanceof e}function Wz(n){if(!n)return!1;const{TouchEvent:e}=uf(n.target);return e&&n instanceof e}function fm(n){if(Wz(n)){if(n.touches&&n.touches.length){const{clientX:e,clientY:t}=n.touches[0];return{x:e,y:t}}else if(n.changedTouches&&n.changedTouches.length){const{clientX:e,clientY:t}=n.changedTouches[0];return{x:e,y:t}}}return Hz(n)?{x:n.clientX,y:n.clientY}:null}const Hp=Object.freeze({Translate:{toString(n){if(!n)return;const{x:e,y:t}=n;return"translate3d("+(e?Math.round(e):0)+"px, "+(t?Math.round(t):0)+"px, 0)"}},Scale:{toString(n){if(!n)return;const{scaleX:e,scaleY:t}=n;return"scaleX("+e+") scaleY("+t+")"}},Transform:{toString(n){if(n)return[Hp.Translate.toString(n),Hp.Scale.toString(n)].join(" ")}},Transition:{toString(n){let{property:e,duration:t,easing:r}=n;return e+" "+t+"ms "+r}}}),Ow="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Uz(n){return n.matches(Ow)?n:n.querySelector(Ow)}const Gz={display:"none"};function Yz(n){let{id:e,value:t}=n;return z.createElement("div",{id:e,style:Gz},t)}function Vz(n){let{id:e,announcement:t,ariaLiveType:r="assertive"}=n;const i={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return z.createElement("div",{id:e,style:i,role:"status","aria-live":r,"aria-atomic":!0},t)}function Zz(){const[n,e]=z.useState("");return{announce:z.useCallback(r=>{r!=null&&e(r)},[]),announcement:n}}const L4=z.createContext(null);function Xz(n){const e=z.useContext(L4);z.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of <DndContext>");return e(n)},[n,e])}function Kz(){const[n]=z.useState(()=>new Set),e=z.useCallback(r=>(n.add(r),()=>n.delete(r)),[n]);return[z.useCallback(r=>{let{type:i,event:o}=r;n.forEach(l=>{var a;return(a=l[i])==null?void 0:a.call(l,o)})},[n]),e]}const Jz={draggable:`
481
481
  To pick up a draggable item, press the space bar.
482
482
  While dragging, use the arrow keys to move the item.
483
483
  Press space again to drop the item in its new position, or press escape to cancel.
package/dist/index.es.js CHANGED
@@ -48971,19 +48971,18 @@ const d1 = {
48971
48971
  wrapProps: K,
48972
48972
  labelProps: ue,
48973
48973
  ...V
48974
- }, ee] = F1($), te = St(() => e === "ReadOnly" || I, [e, I]), ce = St(() => w ? 20 : 0, [w]), [le, q] = yn(T === "Med" ? 40 : 50), ne = St(() => te ? 0 : le, [te, le]), [de, pe] = St(() => !i || te || O === "Top" ? [0, 0] : [20, 6], [i, te, O]), ie = St(() => de + pe, [de, pe]), [X, fe] = yn(w), [Se, ze] = yn(!1), [me, Ne] = yn(!1), ke = xn(null), Fe = xn(0), Ie = xn(0), Ee = St(() => V.label ? 24 : 0, [V.label]), Be = St(() => R === "Title", [R]), Ze = St(() => w || m || Be, [w, m, Be]), Le = St(() => Ze ? "fit-content" : x ? x + Ee : `calc(100% - ${Ee}px)`, [Ze, x, Ee]), ft = St(() => {
48975
- if (w) {
48976
- if (X)
48977
- switch (e) {
48978
- case "ReadOnly":
48979
- return X;
48980
- case "Raw":
48981
- return X + ie;
48982
- default:
48983
- return X + ne + ie;
48984
- }
48985
- } else return;
48986
- }, [w, X, e, ne, ie]), Je = St(() => {
48974
+ }, ee] = F1($), te = St(() => e === "ReadOnly" || I, [e, I]), ce = St(() => w ? 20 : 0, [w]), [le, q] = yn(T === "Med" ? 40 : 50), ne = St(() => te ? 0 : le, [te, le]), [de, pe] = St(() => !i || te || O === "Top" ? [0, 0] : [20, 6], [i, te, O]), ie = St(() => de + pe, [de, pe]), [X, fe] = yn(w), [Se, ze] = yn(!1), [me, Ne] = yn(!1), ke = xn(null), Fe = xn(0), Ie = xn(0), Ee = St(() => V.label ? 24 : 0, [V.label]), Be = St(() => R === "Title", [R]), Ze = St(() => !!w || Be, [w, Be]), Le = St(() => Ze ? "fit-content" : x ? x + Ee : `calc(100% - ${Ee}px)`, [Ze, x, Ee]), ft = St(() => {
48975
+ if (!w) return m ? "100%" : void 0;
48976
+ if (X)
48977
+ switch (e) {
48978
+ case "ReadOnly":
48979
+ return X;
48980
+ case "Raw":
48981
+ return X + ie;
48982
+ default:
48983
+ return X + ne + ie;
48984
+ }
48985
+ }, [w, X, m, e, ne, ie]), Je = St(() => {
48987
48986
  if (!(!x || x <= ne + ie))
48988
48987
  switch (e) {
48989
48988
  case "ReadOnly":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ados-rcm",
3
- "version": "1.1.691",
3
+ "version": "1.1.693",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "type": "module",