ados-rcm 1.1.398 → 1.1.400
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
@@ -344,11 +344,11 @@ Error generating stack: `+d.message+`
|
|
344
344
|
`,"user"),this.quill.setSelection(i+1,0),t.index=i+1}else{const l=this.quill.getLine(t.index)[0];l&&l.length()>1?(this.quill.insertText(t.index,`
|
345
345
|
|
346
346
|
`,"user"),t.index+=2):(this.quill.insertText(t.index,`
|
347
|
-
`,"user"),t.index+=1)}}findTableParent(e){let t=e;for(;t;){if(t.domNode&&t.domNode.tagName==="TABLE")return t;t=t.parent}return null}hidePicker(){this.removeTooltip(),this.picker&&(this.picker.remove(),this.picker=null),this.tableButton&&this.tableButton.classList.remove("ql-expanded")}}var Du={},Zb;function WP(){if(Zb)return Du;Zb=1;var r=Hs;if(process.env.NODE_ENV==="production")Du.createRoot=r.createRoot,Du.hydrateRoot=r.hydrateRoot;else{var e=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Du.createRoot=function(t,n){e.usingClientEntryPoint=!0;try{return r.createRoot(t,n)}finally{e.usingClientEntryPoint=!1}},Du.hydrateRoot=function(t,n,i){e.usingClientEntryPoint=!0;try{return r.hydrateRoot(t,n,i)}finally{e.usingClientEntryPoint=!1}}}return Du}var VP=WP();const Kb=al(VP);class GP{constructor(e,t){lt(this,"DEFAULTS",{maxRowCount:-1});lt(this,"quill");lt(this,"options");lt(this,"position",null);lt(this,"table");lt(this,"selectedCell",null);lt(this,"menuRoot",null);lt(this,"helperTextElement",null);lt(this,"scrollTimeout",null);lt(this,"SCROLL_DEBOUNCE_TIME",80);lt(this,"lastSelectedCellRef",null);lt(this,"boundDocClickHandler",this.hideMenu.bind(this));lt(this,"boundEditorChangeHandler",this.editorChangeHandler.bind(this));lt(this,"boundContextMenuHandler",this.contextMenuHandler.bind(this));lt(this,"boundCopyHandler",this.copyHandler.bind(this));lt(this,"boundScrollHandler",this.handleScroll.bind(this));lt(this,"boundPasteHandler",this.pasteHandler.bind(this));lt(this,"menuItems",[]);lt(this,"positionCache",new Map);lt(this,"POSITION_CACHE_LIFETIME",1e3);lt(this,"reactRoot",null);if(this.quill=e,this.options={...this.DEFAULTS,...t},this.table=e.getModule("table"),!this.table){console.error('"table" module not found');return}this.initializeMenuItems(),this.overrideTableMethods(),this.initializeHelperText(),this.attachEventListeners()}initializeMenuItems(){this.menuItems=[{handler:()=>{(!(this.options.maxRowCount!==void 0&&this.options.maxRowCount>0)||this.getColCount()<(this.options.maxRowCount||0))&&this.table.insertColumnRight()},icon:Ns.renderToString(m.jsx(jr,{icon:"AddColRight"})),title:hn.AEditor["Insert Column Right"]},{handler:()=>{(!(this.options.maxRowCount!==void 0&&this.options.maxRowCount>0)||this.getColCount()<(this.options.maxRowCount||0))&&this.table.insertColumnLeft()},icon:Ns.renderToString(m.jsx(jr,{icon:"AddColLeft"})),title:hn.AEditor["Insert Column Left"]},{handler:()=>{this.table.insertRowAbove()},icon:Ns.renderToString(m.jsx(jr,{icon:"AddRowAbove"})),title:hn.AEditor["Insert Row Top"]},{handler:()=>{this.table.insertRowBelow()},icon:Ns.renderToString(m.jsx(jr,{icon:"AddRowBelow"})),title:hn.AEditor["Insert Row Bottom"]},{handler:()=>{this.table.deleteColumn()},icon:Ns.renderToString(m.jsx(jr,{icon:"RemoveCol"})),title:hn.AEditor["Delete Column"]},{handler:()=>{this.table.deleteRow()},icon:Ns.renderToString(m.jsx(jr,{icon:"RemoveRow"})),title:hn.AEditor["Delete Row"]},{handler:()=>{this.table.deleteTable()},icon:Ns.renderToString(m.jsx(jr,{icon:"Trash"})),title:hn.AEditor["Delete Table"]}]}overrideTableMethods(){const e=this.table.insertTable;this.table.insertTable=(...n)=>{const i=e.apply(this.table,n),l=this.quill.getSelection();return l&&(this.quill.focus(),setTimeout(()=>this.detectButton(l),0)),i};const t=this.table.deleteTable;this.table.deleteTable=(...n)=>{const i=t.apply(this.table,n);return this.cleanupTableUI(),i}}initializeHelperText(){this.helperTextElement=document.createElement("div"),this.helperTextElement.className=Fn["ql-tableui-helper"];const e=document.createElement("span");e.className=Pe.clsx("Caption1",Fn["ql-tableui-helper__text"],"NoSelect"),e.textContent=hn.AEditor["Right click to open properties"];const t=document.createElement("span");t.className=Fn["ql-tableui-helper__icon"],t.innerHTML=Ns.renderToString(m.jsx(jr,{icon:"MoreHorizontal",size:"xs"})),t.addEventListener("click",n=>{n.preventDefault(),n.stopPropagation(),this.menuRoot?this.hideMenu():this.showMenu()}),this.helperTextElement.appendChild(e),this.helperTextElement.appendChild(t),this.helperTextElement.style.display="none",this.quill.container.appendChild(this.helperTextElement)}attachEventListeners(){this.quill.on("editor-change",this.boundEditorChangeHandler),this.quill.root.addEventListener("contextmenu",this.boundContextMenuHandler),this.quill.root.addEventListener("copy",this.boundCopyHandler),this.quill.root.addEventListener("paste",this.boundPasteHandler),window.addEventListener("scroll",this.boundScrollHandler,!0)}removeEventListeners(){this.quill.off("editor-change",this.boundEditorChangeHandler),this.quill.root.removeEventListener("contextmenu",this.boundContextMenuHandler),this.quill.root.removeEventListener("copy",this.boundCopyHandler),this.quill.root.removeEventListener("paste",this.boundPasteHandler),document.removeEventListener("click",this.boundDocClickHandler),window.removeEventListener("scroll",this.boundScrollHandler,!0)}editorChangeHandler(e,t,n,i){e==="selection-change"&&this.detectButton(t)}contextMenuHandler(e){return this.isTable()?(e.preventDefault(),this.showMenu(),!1):!0}copyHandler(e){if(!this.selectedCell||!e.clipboardData)return;e.preventDefault();const t=this.selectedCell.textContent||"";e.clipboardData.setData("text/plain",t)}isTable(e){return e=e||this.quill.getSelection(),e?!!(this.quill.getFormat(e.index).table&&!e.length):!1}getColCount(e){if(e=e||this.quill.getSelection(),!e)return 0;const[t]=this.table.getTable(e);return t?t.rows().reduce((n,i)=>Math.max(i.children.length,n),0):0}showMenu(){if(this.menuRoot){this.hideMenu();return}if(!this.selectedCell)return;this.menuRoot||(this.menuRoot=document.createElement("div"),document.body.appendChild(this.menuRoot));const e=this.getBoundingRectWithCache(this.selectedCell),t=window.innerWidth,n=window.innerHeight,i=E.memo(({item:u,index:h})=>m.jsxs("div",{className:Fn["ql-tableui-options__item"],onClick:this.createItemClickHandler(u),children:[m.jsx("span",{className:Fn["ql-tableui-options__item-icon"],dangerouslySetInnerHTML:{__html:u.icon}}),m.jsx("span",{className:Fn["ql-tableui-options__item-text"],children:u.title})]},h)),l=()=>m.jsx("div",{className:Fn["ql-tableui-options"],style:{position:"fixed",visibility:"hidden",zIndex:1e4},children:this.menuItems.map((u,h)=>m.jsx(i,{item:u,index:h},h))});try{Kb.createRoot?(this.reactRoot=Kb.createRoot(this.menuRoot),this.reactRoot.render(m.jsx(l,{}))):Hs.render(m.jsx(l,{}),this.menuRoot)}catch{Hs.render(m.jsx(l,{}),this.menuRoot)}document.addEventListener("click",this.boundDocClickHandler),requestAnimationFrame(()=>{if(!this.menuRoot)return;const u=this.menuRoot.firstElementChild;if(u){const h=u.getBoundingClientRect();let g=e.bottom+window.scrollY,v=e.left+window.scrollX;v+h.width>t&&(v=e.right-h.width+window.scrollX),g+h.height>n+window.scrollY&&(g=e.top-h.height+window.scrollY),u.style.top=`${g}px`,u.style.left=`${v}px`,u.style.visibility="visible"}})}hideMenu(){this.menuRoot&&(document.removeEventListener("click",this.boundDocClickHandler),this.reactRoot?(this.reactRoot.unmount(),this.reactRoot=null):Hs.unmountComponentAtNode(this.menuRoot),this.menuRoot.remove(),this.menuRoot=null)}detectButton(e){if(e)if(this.isTable(e)){const[t,n]=this.quill.getLine(e.index);if(!t||!t.domNode)return;const i=t.domNode,l=`${i.tagName}-${i.offsetLeft}-${i.offsetTop}`;this.selectedCell===i||this.lastSelectedCellRef===l||(this.clearAllTableCellOutlines(),i.style.outline="2px solid var(--acent-brand)",i.style.outlineOffset="-1px",this.selectedCell=i,this.lastSelectedCellRef=l),this.showHelperText();const h=this.quill.container.getBoundingClientRect(),g=i.getBoundingClientRect(),v={bottom:g.bottom-h.top,height:g.height,left:g.left-h.left,right:g.right-h.left,top:g.top-h.top,width:g.width,x:g.x,y:g.y,toJSON:()=>JSON.stringify(v)};this.position&&(this.position.top!==v.top||this.position.left!==v.left)&&this.hideMenu(),this.position=v}else this.cleanupTableUI()}clearAllTableCellOutlines(){this.selectedCell&&(this.selectedCell.style.removeProperty("outline"),this.selectedCell.style.removeProperty("outline-offset"),this.selectedCell=null),this.quill.root.querySelectorAll("td, th").forEach(t=>{t instanceof HTMLElement&&(t.style.removeProperty("outline"),t.style.removeProperty("outline-offset"))}),this.lastSelectedCellRef=null}showHelperText(){if(!this.selectedCell||!this.helperTextElement)return;const e=this.quill.getSelection();if(!e)return;const[t]=this.table.getTable(e);if(!t||!t.domNode)return;const i=t.domNode.getBoundingClientRect(),l=this.quill.container.getBoundingClientRect();if(!(i.bottom<l.top+5||i.top>l.bottom-5)){let h=i.top-l.top-20;i.top<l.top&&(h=5),this.helperTextElement.style.display="block",this.helperTextElement.style.left=`${i.left-l.left}px`,this.helperTextElement.style.top=`${h}px`}else this.helperTextElement.style.display="none"}removeHelperText(){this.helperTextElement&&(this.helperTextElement.style.display="none")}handleScroll(){this.removeHelperText(),this.hideMenu(),this.scrollTimeout&&clearTimeout(this.scrollTimeout),this.scrollTimeout=setTimeout(()=>{const e=this.quill.getSelection();e&&this.isTable(e)&&this.detectButton(e),this.scrollTimeout=null},this.SCROLL_DEBOUNCE_TIME)}destroy(){this.removeEventListeners(),this.cleanupTableUI(),this.helperTextElement&&this.helperTextElement.remove(),this.scrollTimeout&&(clearTimeout(this.scrollTimeout),this.scrollTimeout=null),this.positionCache.clear(),this.reactRoot=null,this.selectedCell=null,this.helperTextElement=null,this.position=null,this.options=this.DEFAULTS,this.menuRoot=null,this.table=null}createItemClickHandler(e){return t=>{t.preventDefault(),t.stopPropagation(),this.quill.focus(),e.handler(),this.hideMenu(),this.detectButton(this.quill.getSelection())}}getBoundingRectWithCache(e){const t=Date.now(),n=this.positionCache.get(e);if(n&&t-n.timestamp<this.POSITION_CACHE_LIFETIME)return n.rect;const i=e.getBoundingClientRect();return this.positionCache.set(e,{rect:i,timestamp:t}),i}pasteHandler(){this.clearAllTableCellOutlines(),setTimeout(()=>{const e=this.quill.getSelection();e&&this.detectButton(e)},0)}cleanupTableUI(){this.removeHelperText(),this.clearAllTableCellOutlines(),this.hideMenu(),this.lastSelectedCellRef=null}}const ZP=()=>{const r=[1,2,3,!1,4],e=Ue.import("ui/icons");e.table=Ns.renderToString(m.jsx(jr,{icon:"Table",strokeWidth:2.5})),e.divider=Ns.renderToString(m.jsx(jr,{icon:"Minus",strokeWidth:2.5}));const t=Ue.import("blots/block/embed");class n extends t{static create(l){const u=super.create(l);return u.style.border="var(--AEditor_Addon_Primary_border)",u.style.borderBottom="none",u.style.transition="border var(--Transition)",u}}return lt(n,"blotName","divider"),lt(n,"tagName","hr"),Ue.register({"modules/imageCompress":lO,"modules/resize":dO,"modules/tablePicker":UP,"modules/tableUI":GP,"formats/header":JP(r),"formats/divider":n},!0),{header:r,FORMAT_DEFAULT:["bold","italic","underline","strike","blockquote","table","size","header","color","background","indent","list","align","image","link","video","divider"],FORMAT_TITLE:["bold","italic","underline","strike","color","background"],TOOLBAR_DEFAULT:[[{header:r}],["bold","italic","underline","strike","blockquote","divider","table",{color:[]},{background:[]}],[{list:"ordered"},{list:"bullet"},{indent:"-1"},{indent:"+1"},{align:[]}],["link","image","video"],["clean"]],TOOLBAR_TITLE:[["bold","italic","underline","strike",{color:[]},{background:[]},"clean"]]}};let Vg=null;const KP=()=>(Vg||(Vg=ZP()),Vg),ls=r=>Array.from(r).length,YP=r=>r.ops?r.ops.reduce((e,t)=>typeof t.insert=="string"?e+t.insert.replace(/\n/g,"").split("").reduce((n,i)=>n+(i.charCodeAt(0)<=127?1:3),0):typeof t.insert=="object"&&t.insert.image?e+t.insert.image.length:e,0):0;function XP(r){return Array.isArray(r)?r.filter(Boolean).length>0:!!r}function JP(r){const e=Ue.import("formats/header");return e.whitelist=r,e}const QP=E.memo(r=>{const{onEnterPress:e,errorMessage:t,type:n="Primary",editorRef:i,useValue:l,useError:u,placeholder:h,tabIndex:g,autoFocus:v,editorProps:L,wrapProps:T,helperText:C,label:_,labelProps:x,wrapType:D,style:w,minHeight:b,maxHeight:R,contentHeight:O,contentMaxHeight:q=1e3,toolbarSize:H="Med",toolbarType:z="Default",readOnly:Y,limitPosition:ue="Bottom",maxLength:Q,editorClassName:de,editorStyle:j,...ne}=r,J=E.useMemo(()=>KP(),[]),X=E.useMemo(()=>n==="ReadOnly"||Y,[n,Y]),ie=E.useMemo(()=>O?20:0,[O]),[fe,ye]=E.useState(H==="Med"?40:50),se=E.useMemo(()=>X?0:fe,[X,fe]),[be,ve]=E.useMemo(()=>Q||!u||X||ue==="Top"?[0,0]:[20,6],[Q,u,X,ue]),ge=E.useMemo(()=>be+ve,[be,ve]),[Ee,Oe]=E.useState(O),[Xe,Ae]=E.useState(!1),[it,pt]=E.useState(!1),et=E.useRef(null),Ze=E.useRef(0),je=E.useRef(0),Ie=E.useMemo(()=>_?24:0,[_]),le=E.useMemo(()=>z==="Title"?!0:void 0,[z]),ke=E.useMemo(()=>O||b||le,[O,b,le]),Te=E.useMemo(()=>ke?"fit-content":R?R+Ie:`calc(100% - ${Ie}px)`,[ke,R,Ie]),Ve=E.useMemo(()=>{if(O){if(Ee)switch(n){case"ReadOnly":return Ee;case"Raw":return Ee+ge;default:return Ee+se+ge}}else return},[O,Ee,n,se,ge]),tt=E.useMemo(()=>{if(!(!R||R<=se+ge))switch(n){case"ReadOnly":return R;case"Raw":return R-ge;default:return R-se-ge}},[n,se,ge,R]),yt=E.useMemo(()=>{if(b&&O){const Ke=Math.min(b-se-ge,O);return X?Ke:Ke+se+ge}else return b||(O?void 0:`calc(100% - ${Ie}px)`)},[b,O,Ie,se,ge,X]),Tt=E.useMemo(()=>XP(t)?"Error":n,[t,n]),[_t,It]=cn(l,""),[Lt,ft]=cn(u,!1),[ut,kt]=E.useState(()=>{if(!_t)return new Gt;const Ke=document.createElement("div");return Ke.innerHTML=_t,new Ue(Ke,{readOnly:!0}).getContents()}),Me=E.useCallback(YP,[]),ht=E.useMemo(()=>Math.floor(5e4*.68234)*3,[]),xt=E.useMemo(()=>m.jsx(eN,{calculateSize:Me,error:Lt,htmlDelta:ut,limit:ht,useError:u,isReadonly:X}),[Me,Lt,ut,X,ht,u]),Dt=E.useMemo(()=>({clipboard:{matchVisual:!1,...le&&{matchers:[["img",()=>!1],["table",()=>!1],["iframe",()=>!1],["video",()=>!1],["h1, h2, h3, h4, h5, h6",()=>({})],["blockquote",()=>({})]]}},keyboard:le?{bindings:{Enter:{key:"Enter",handler:Ke=>{if(e&&It){const Le=Ke.root.innerHTML;e(Le)}return!1}}}}:{bindings:{}},imageCompress:{quality:.5},...!X&&{resize:{locale:{altTip:hn.AEditor["Image size adjust"],center:hn.AEditor.Center,floatLeft:hn.AEditor.floatLeft,floatRight:hn.AEditor.floatRight,inputTip:hn.AEditor["Input on mouse down"],restore:hn.AEditor.Restore}},...!le&&{table:!0,tablePicker:!0,tableUI:!0},toolbar:{container:le?J.TOOLBAR_TITLE:J.TOOLBAR_DEFAULT,handlers:{divider:function(){const Ke=this.quill,Le=Ke.getSelection(!0);if(!Le||le)return;const dt=Ke.getModule("table"),St=dt&&!!dt.getTable(Le)[0];St||Ke.insertText(Le.index,`
|
347
|
+
`,"user"),t.index+=1)}}findTableParent(e){let t=e;for(;t;){if(t.domNode&&t.domNode.tagName==="TABLE")return t;t=t.parent}return null}hidePicker(){this.removeTooltip(),this.picker&&(this.picker.remove(),this.picker=null),this.tableButton&&this.tableButton.classList.remove("ql-expanded")}}var Du={},Zb;function WP(){if(Zb)return Du;Zb=1;var r=Hs;if(process.env.NODE_ENV==="production")Du.createRoot=r.createRoot,Du.hydrateRoot=r.hydrateRoot;else{var e=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Du.createRoot=function(t,n){e.usingClientEntryPoint=!0;try{return r.createRoot(t,n)}finally{e.usingClientEntryPoint=!1}},Du.hydrateRoot=function(t,n,i){e.usingClientEntryPoint=!0;try{return r.hydrateRoot(t,n,i)}finally{e.usingClientEntryPoint=!1}}}return Du}var VP=WP();const Kb=al(VP);class GP{constructor(e,t){lt(this,"DEFAULTS",{maxRowCount:-1});lt(this,"quill");lt(this,"options");lt(this,"position",null);lt(this,"table");lt(this,"selectedCell",null);lt(this,"menuRoot",null);lt(this,"helperTextElement",null);lt(this,"scrollTimeout",null);lt(this,"SCROLL_DEBOUNCE_TIME",80);lt(this,"lastSelectedCellRef",null);lt(this,"boundDocClickHandler",this.hideMenu.bind(this));lt(this,"boundEditorChangeHandler",this.editorChangeHandler.bind(this));lt(this,"boundContextMenuHandler",this.contextMenuHandler.bind(this));lt(this,"boundCopyHandler",this.copyHandler.bind(this));lt(this,"boundScrollHandler",this.handleScroll.bind(this));lt(this,"boundPasteHandler",this.pasteHandler.bind(this));lt(this,"menuItems",[]);lt(this,"positionCache",new Map);lt(this,"POSITION_CACHE_LIFETIME",1e3);lt(this,"reactRoot",null);if(this.quill=e,this.options={...this.DEFAULTS,...t},this.table=e.getModule("table"),!this.table){console.error('"table" module not found');return}this.initializeMenuItems(),this.overrideTableMethods(),this.initializeHelperText(),this.attachEventListeners()}initializeMenuItems(){this.menuItems=[{handler:()=>{(!(this.options.maxRowCount!==void 0&&this.options.maxRowCount>0)||this.getColCount()<(this.options.maxRowCount||0))&&this.table.insertColumnRight()},icon:Ns.renderToString(m.jsx(jr,{icon:"AddColRight"})),title:hn.AEditor["Insert Column Right"]},{handler:()=>{(!(this.options.maxRowCount!==void 0&&this.options.maxRowCount>0)||this.getColCount()<(this.options.maxRowCount||0))&&this.table.insertColumnLeft()},icon:Ns.renderToString(m.jsx(jr,{icon:"AddColLeft"})),title:hn.AEditor["Insert Column Left"]},{handler:()=>{this.table.insertRowAbove()},icon:Ns.renderToString(m.jsx(jr,{icon:"AddRowAbove"})),title:hn.AEditor["Insert Row Top"]},{handler:()=>{this.table.insertRowBelow()},icon:Ns.renderToString(m.jsx(jr,{icon:"AddRowBelow"})),title:hn.AEditor["Insert Row Bottom"]},{handler:()=>{this.table.deleteColumn()},icon:Ns.renderToString(m.jsx(jr,{icon:"RemoveCol"})),title:hn.AEditor["Delete Column"]},{handler:()=>{this.table.deleteRow()},icon:Ns.renderToString(m.jsx(jr,{icon:"RemoveRow"})),title:hn.AEditor["Delete Row"]},{handler:()=>{this.table.deleteTable()},icon:Ns.renderToString(m.jsx(jr,{icon:"Trash"})),title:hn.AEditor["Delete Table"]}]}overrideTableMethods(){const e=this.table.insertTable;this.table.insertTable=(...n)=>{const i=e.apply(this.table,n),l=this.quill.getSelection();return l&&(this.quill.focus(),setTimeout(()=>this.detectButton(l),0)),i};const t=this.table.deleteTable;this.table.deleteTable=(...n)=>{const i=t.apply(this.table,n);return this.cleanupTableUI(),i}}initializeHelperText(){this.helperTextElement=document.createElement("div"),this.helperTextElement.className=Fn["ql-tableui-helper"];const e=document.createElement("span");e.className=Pe.clsx("Caption1",Fn["ql-tableui-helper__text"],"NoSelect"),e.textContent=hn.AEditor["Right click to open properties"];const t=document.createElement("span");t.className=Fn["ql-tableui-helper__icon"],t.innerHTML=Ns.renderToString(m.jsx(jr,{icon:"MoreHorizontal",size:"xs"})),t.addEventListener("click",n=>{n.preventDefault(),n.stopPropagation(),this.menuRoot?this.hideMenu():this.showMenu()}),this.helperTextElement.appendChild(e),this.helperTextElement.appendChild(t),this.helperTextElement.style.display="none",this.quill.container.appendChild(this.helperTextElement)}attachEventListeners(){this.quill.on("editor-change",this.boundEditorChangeHandler),this.quill.root.addEventListener("contextmenu",this.boundContextMenuHandler),this.quill.root.addEventListener("copy",this.boundCopyHandler),this.quill.root.addEventListener("paste",this.boundPasteHandler),window.addEventListener("scroll",this.boundScrollHandler,!0)}removeEventListeners(){this.quill.off("editor-change",this.boundEditorChangeHandler),this.quill.root.removeEventListener("contextmenu",this.boundContextMenuHandler),this.quill.root.removeEventListener("copy",this.boundCopyHandler),this.quill.root.removeEventListener("paste",this.boundPasteHandler),document.removeEventListener("click",this.boundDocClickHandler),window.removeEventListener("scroll",this.boundScrollHandler,!0)}editorChangeHandler(e,t,n,i){e==="selection-change"&&this.detectButton(t)}contextMenuHandler(e){return this.isTable()?(e.preventDefault(),this.showMenu(),!1):!0}copyHandler(e){if(!this.selectedCell||!e.clipboardData)return;e.preventDefault();const t=this.selectedCell.textContent||"";e.clipboardData.setData("text/plain",t)}isTable(e){return e=e||this.quill.getSelection(),e?!!(this.quill.getFormat(e.index).table&&!e.length):!1}getColCount(e){if(e=e||this.quill.getSelection(),!e)return 0;const[t]=this.table.getTable(e);return t?t.rows().reduce((n,i)=>Math.max(i.children.length,n),0):0}showMenu(){if(this.menuRoot){this.hideMenu();return}if(!this.selectedCell)return;this.menuRoot||(this.menuRoot=document.createElement("div"),document.body.appendChild(this.menuRoot));const e=this.getBoundingRectWithCache(this.selectedCell),t=window.innerWidth,n=window.innerHeight,i=E.memo(({item:u,index:h})=>m.jsxs("div",{className:Fn["ql-tableui-options__item"],onClick:this.createItemClickHandler(u),children:[m.jsx("span",{className:Fn["ql-tableui-options__item-icon"],dangerouslySetInnerHTML:{__html:u.icon}}),m.jsx("span",{className:Fn["ql-tableui-options__item-text"],children:u.title})]},h)),l=()=>m.jsx("div",{className:Fn["ql-tableui-options"],style:{position:"fixed",visibility:"hidden",zIndex:1e4},children:this.menuItems.map((u,h)=>m.jsx(i,{item:u,index:h},h))});try{Kb.createRoot?(this.reactRoot=Kb.createRoot(this.menuRoot),this.reactRoot.render(m.jsx(l,{}))):Hs.render(m.jsx(l,{}),this.menuRoot)}catch{Hs.render(m.jsx(l,{}),this.menuRoot)}document.addEventListener("click",this.boundDocClickHandler),requestAnimationFrame(()=>{if(!this.menuRoot)return;const u=this.menuRoot.firstElementChild;if(u){const h=u.getBoundingClientRect();let g=e.bottom+window.scrollY,v=e.left+window.scrollX;v+h.width>t&&(v=e.right-h.width+window.scrollX),g+h.height>n+window.scrollY&&(g=e.top-h.height+window.scrollY),u.style.top=`${g}px`,u.style.left=`${v}px`,u.style.visibility="visible"}})}hideMenu(){this.menuRoot&&(document.removeEventListener("click",this.boundDocClickHandler),this.reactRoot?(this.reactRoot.unmount(),this.reactRoot=null):Hs.unmountComponentAtNode(this.menuRoot),this.menuRoot.remove(),this.menuRoot=null)}detectButton(e){if(e)if(this.isTable(e)){const[t,n]=this.quill.getLine(e.index);if(!t||!t.domNode)return;const i=t.domNode,l=`${i.tagName}-${i.offsetLeft}-${i.offsetTop}`;this.selectedCell===i||this.lastSelectedCellRef===l||(this.clearAllTableCellOutlines(),i.style.outline="2px solid var(--acent-brand)",i.style.outlineOffset="-1px",this.selectedCell=i,this.lastSelectedCellRef=l),this.showHelperText();const h=this.quill.container.getBoundingClientRect(),g=i.getBoundingClientRect(),v={bottom:g.bottom-h.top,height:g.height,left:g.left-h.left,right:g.right-h.left,top:g.top-h.top,width:g.width,x:g.x,y:g.y,toJSON:()=>JSON.stringify(v)};this.position&&(this.position.top!==v.top||this.position.left!==v.left)&&this.hideMenu(),this.position=v}else this.cleanupTableUI()}clearAllTableCellOutlines(){this.selectedCell&&(this.selectedCell.style.removeProperty("outline"),this.selectedCell.style.removeProperty("outline-offset"),this.selectedCell=null),this.quill.root.querySelectorAll("td, th").forEach(t=>{t instanceof HTMLElement&&(t.style.removeProperty("outline"),t.style.removeProperty("outline-offset"))}),this.lastSelectedCellRef=null}showHelperText(){if(!this.selectedCell||!this.helperTextElement)return;const e=this.quill.getSelection();if(!e)return;const[t]=this.table.getTable(e);if(!t||!t.domNode)return;const i=t.domNode.getBoundingClientRect(),l=this.quill.container.getBoundingClientRect();if(!(i.bottom<l.top+5||i.top>l.bottom-5)){let h=i.top-l.top-20;i.top<l.top&&(h=5),this.helperTextElement.style.display="block",this.helperTextElement.style.left=`${i.left-l.left}px`,this.helperTextElement.style.top=`${h}px`}else this.helperTextElement.style.display="none"}removeHelperText(){this.helperTextElement&&(this.helperTextElement.style.display="none")}handleScroll(){this.removeHelperText(),this.hideMenu(),this.scrollTimeout&&clearTimeout(this.scrollTimeout),this.scrollTimeout=setTimeout(()=>{const e=this.quill.getSelection();e&&this.isTable(e)&&this.detectButton(e),this.scrollTimeout=null},this.SCROLL_DEBOUNCE_TIME)}destroy(){this.removeEventListeners(),this.cleanupTableUI(),this.helperTextElement&&this.helperTextElement.remove(),this.scrollTimeout&&(clearTimeout(this.scrollTimeout),this.scrollTimeout=null),this.positionCache.clear(),this.reactRoot=null,this.selectedCell=null,this.helperTextElement=null,this.position=null,this.options=this.DEFAULTS,this.menuRoot=null,this.table=null}createItemClickHandler(e){return t=>{t.preventDefault(),t.stopPropagation(),this.quill.focus(),e.handler(),this.hideMenu(),this.detectButton(this.quill.getSelection())}}getBoundingRectWithCache(e){const t=Date.now(),n=this.positionCache.get(e);if(n&&t-n.timestamp<this.POSITION_CACHE_LIFETIME)return n.rect;const i=e.getBoundingClientRect();return this.positionCache.set(e,{rect:i,timestamp:t}),i}pasteHandler(e){if(!this.selectedCell||!e.clipboardData)return;const n=e.clipboardData.getData("text/html");if(n&&n.trim()!==""){const i=this.quill.getSelection();if(i){const[l]=this.table.getTable(i);if(l){e.preventDefault();try{this.quill.clipboard.dangerouslyPasteHTML(i.index,n,"user"),setTimeout(()=>{const u=this.quill.getSelection();u&&this.detectButton(u)},0);return}catch(u){console.error("테이블 셀에 HTML 붙여넣기 중 오류 발생:",u)}}}}this.clearAllTableCellOutlines(),setTimeout(()=>{const i=this.quill.getSelection();i&&this.detectButton(i)},0)}cleanupTableUI(){this.removeHelperText(),this.clearAllTableCellOutlines(),this.hideMenu(),this.lastSelectedCellRef=null}}const ZP=()=>{const r=[1,2,3,!1,4],e=Ue.import("ui/icons");e.table=Ns.renderToString(m.jsx(jr,{icon:"Table",strokeWidth:2.5})),e.divider=Ns.renderToString(m.jsx(jr,{icon:"Minus",strokeWidth:2.5}));const t=Ue.import("blots/block/embed");class n extends t{static create(l){const u=super.create(l);return u.style.border="var(--AEditor_Addon_Primary_border)",u.style.borderBottom="none",u.style.transition="border var(--Transition)",u}}return lt(n,"blotName","divider"),lt(n,"tagName","hr"),Ue.register({"modules/imageCompress":lO,"modules/resize":dO,"modules/tablePicker":UP,"modules/tableUI":GP,"formats/header":JP(r),"formats/divider":n},!0),{header:r,FORMAT_DEFAULT:["bold","italic","underline","strike","blockquote","table","size","header","color","background","indent","list","align","image","link","video","divider"],FORMAT_TITLE:["bold","italic","underline","strike","color","background"],TOOLBAR_DEFAULT:[[{header:r}],["bold","italic","underline","strike","blockquote","divider","table",{color:[]},{background:[]}],[{list:"ordered"},{list:"bullet"},{indent:"-1"},{indent:"+1"},{align:[]}],["link","image","video"],["clean"]],TOOLBAR_TITLE:[["bold","italic","underline","strike",{color:[]},{background:[]},"clean"]]}};let Vg=null;const KP=()=>(Vg||(Vg=ZP()),Vg),ls=r=>Array.from(r).length,YP=r=>r.ops?r.ops.reduce((e,t)=>typeof t.insert=="string"?e+t.insert.replace(/\n/g,"").split("").reduce((n,i)=>n+(i.charCodeAt(0)<=127?1:3),0):typeof t.insert=="object"&&t.insert.image?e+t.insert.image.length:e,0):0;function XP(r){return Array.isArray(r)?r.filter(Boolean).length>0:!!r}function JP(r){const e=Ue.import("formats/header");return e.whitelist=r,e}const QP=E.memo(r=>{const{onEnterPress:e,errorMessage:t,type:n="Primary",editorRef:i,useValue:l,useError:u,placeholder:h,tabIndex:g,autoFocus:v,editorProps:L,wrapProps:T,helperText:C,label:_,labelProps:x,wrapType:D,style:w,minHeight:b,maxHeight:R,contentHeight:O,contentMaxHeight:q=1e3,toolbarSize:H="Med",toolbarType:z="Default",readOnly:Y,limitPosition:ue="Bottom",maxLength:Q,editorClassName:de,editorStyle:j,...ne}=r,J=E.useMemo(()=>KP(),[]),X=E.useMemo(()=>n==="ReadOnly"||Y,[n,Y]),ie=E.useMemo(()=>O?20:0,[O]),[fe,ye]=E.useState(H==="Med"?40:50),se=E.useMemo(()=>X?0:fe,[X,fe]),[be,ve]=E.useMemo(()=>Q||!u||X||ue==="Top"?[0,0]:[20,6],[Q,u,X,ue]),ge=E.useMemo(()=>be+ve,[be,ve]),[Ee,Oe]=E.useState(O),[Xe,Ae]=E.useState(!1),[it,pt]=E.useState(!1),et=E.useRef(null),Ze=E.useRef(0),je=E.useRef(0),Ie=E.useMemo(()=>_?24:0,[_]),le=E.useMemo(()=>z==="Title"?!0:void 0,[z]),ke=E.useMemo(()=>O||b||le,[O,b,le]),Te=E.useMemo(()=>ke?"fit-content":R?R+Ie:`calc(100% - ${Ie}px)`,[ke,R,Ie]),Ve=E.useMemo(()=>{if(O){if(Ee)switch(n){case"ReadOnly":return Ee;case"Raw":return Ee+ge;default:return Ee+se+ge}}else return},[O,Ee,n,se,ge]),tt=E.useMemo(()=>{if(!(!R||R<=se+ge))switch(n){case"ReadOnly":return R;case"Raw":return R-ge;default:return R-se-ge}},[n,se,ge,R]),yt=E.useMemo(()=>{if(b&&O){const Ke=Math.min(b-se-ge,O);return X?Ke:Ke+se+ge}else return b||(O?void 0:`calc(100% - ${Ie}px)`)},[b,O,Ie,se,ge,X]),Tt=E.useMemo(()=>XP(t)?"Error":n,[t,n]),[_t,It]=cn(l,""),[Lt,ft]=cn(u,!1),[ut,kt]=E.useState(()=>{if(!_t)return new Gt;const Ke=document.createElement("div");return Ke.innerHTML=_t,new Ue(Ke,{readOnly:!0}).getContents()}),Me=E.useCallback(YP,[]),ht=E.useMemo(()=>Math.floor(5e4*.68234)*3,[]),xt=E.useMemo(()=>m.jsx(eN,{calculateSize:Me,error:Lt,htmlDelta:ut,limit:ht,useError:u,isReadonly:X}),[Me,Lt,ut,X,ht,u]),Dt=E.useMemo(()=>({clipboard:{matchVisual:!1,...le&&{matchers:[["img",()=>!1],["table",()=>!1],["iframe",()=>!1],["video",()=>!1],["h1, h2, h3, h4, h5, h6",()=>({})],["blockquote",()=>({})]]}},keyboard:le?{bindings:{Enter:{key:"Enter",handler:Ke=>{if(e&&It){const Le=Ke.root.innerHTML;e(Le)}return!1}}}}:{bindings:{}},imageCompress:{quality:.5},...!X&&{resize:{locale:{altTip:hn.AEditor["Image size adjust"],center:hn.AEditor.Center,floatLeft:hn.AEditor.floatLeft,floatRight:hn.AEditor.floatRight,inputTip:hn.AEditor["Input on mouse down"],restore:hn.AEditor.Restore}},...!le&&{table:!0,tablePicker:!0,tableUI:!0},toolbar:{container:le?J.TOOLBAR_TITLE:J.TOOLBAR_DEFAULT,handlers:{divider:function(){const Ke=this.quill,Le=Ke.getSelection(!0);if(!Le||le)return;const dt=Ke.getModule("table"),St=dt&&!!dt.getTable(Le)[0];St||Ke.insertText(Le.index,`
|
348
348
|
`,Ue.sources.USER);const mt=St?0:1,Nt=Math.min(Le.index+mt,Ke.getLength()-1);Ke.insertEmbed(Nt,"divider",!0,Ue.sources.USER),setTimeout(()=>{const er=Math.min(Nt+1,Ke.getLength()-1);Ke.setSelection(er,0,Ue.sources.SILENT)},0)}}}}}),[X,le,e,It,J]),qt=E.useCallback(Ke=>{if(!Xe||!O)return;const Le=Ke.clientY-je.current,dt=b?b-se-ge:O,St=Math.max(dt,0),mt=R?R-se-ge:q,Nt=Math.min(mt,Math.max(St,Ze.current+Le));Ee!==Nt&&Oe(Nt),Ke.preventDefault(),Ke.stopPropagation()},[Xe,O,q,b,R,se,ge,Ee]),$e=E.useCallback(Ke=>{Ae(!1),pt(!1),document.removeEventListener("mousemove",qt),document.removeEventListener("mouseup",$e),Ke.preventDefault(),Ke.stopPropagation()},[qt]),Rt=E.useCallback(Ke=>{if(!O)return;if(Ke.detail===2){Oe(O);return}Ee===void 0?(Oe(O),Ze.current=O):Ze.current=Ee,Ae(!0),pt(!0),je.current=Ke.clientY;const Le=St=>{if(!O)return;const mt=St.clientY-je.current,Nt=b?b-se-ge:O,er=Math.max(Nt,0),ar=R?R-se-ge:q,Ft=Math.min(ar,Math.max(er,Ze.current+mt));Oe(Ft),St.preventDefault(),St.stopPropagation()},dt=St=>{Ae(!1),pt(!1),document.removeEventListener("mousemove",Le),document.removeEventListener("mouseup",dt),St.preventDefault(),St.stopPropagation()};document.addEventListener("mousemove",Le),document.addEventListener("mouseup",dt),Ke.preventDefault(),Ke.stopPropagation()},[O,Ee,b,R,se,ge,q]),zt=E.useCallback((Ke,Le,dt,St)=>{var ar;if(!It)return;const mt=St.getContents(),Nt=St.getHTML(),er=((ar=mt.ops)==null?void 0:ar.length)===1&&mt.ops[0].insert===`
|
349
349
|
`;ft&&ft(Me(mt)>ht),It(er?"":Nt),kt(mt)},[Me,ht,ft,It]),_r=E.useMemo(()=>H==="Med"?7.5:12.5,[H]),Lr=E.useCallback(Ke=>{var mt,Nt;const Le=Ke.getEditor().container;if(!Le)return null;const dt=(mt=Le.closest(".AEditorContainer"))==null?void 0:mt.querySelector(".ql-toolbar");return dt||((Nt=Le.parentElement)==null?void 0:Nt.querySelector(".ql-toolbar"))||null},[]),Cr=E.useRef([]);E.useEffect(()=>()=>{Cr.current.forEach(Ke=>Ke()),Cr.current=[]},[]);const pe=E.useCallback((Ke,Le,dt,St)=>{if(!Ke)return;const mt=dt;Ke.addEventListener(Le,mt,St),Cr.current.push(()=>{Ke.removeEventListener(Le,mt,St)})},[]),re=E.useCallback(Ke=>{if(!Ke)return;const Le=Ke.getEditor();if(!Le)return;const dt=Le.root;dt&&de&&dt.classList.add(...de.split(" ")),dt&&j&&Object.entries(j).forEach(([Ft,Bt])=>{const nr=Ft.replace(/([A-Z])/g,Ye=>`-${Ye[0].toLowerCase()}`);dt.style[nr]=Bt});const St={input:Ft=>{const Bt=Ft.target;if(!Bt)return;const nr=parseInt(Bt.value,10);isNaN(nr)},keyDown:Ft=>{if(Ft.key!=="Delete"&&Ft.key!=="Backspace"&&Ft.key!=="Enter")return;const Bt=document.querySelector("#editor-resizer");Bt&&(Bt.style.display="none")},formatExpand:Ft=>{const Bt=Le.getFormat(),nr=Lr(Ke);nr&&Ft.forEach(Ye=>{if(Bt[Ye]){const Ct=Bt[Ye],vt=`.ql-${Ye}`,Ne=nr.querySelector(`${vt} .ql-picker-label`),wt=nr.querySelectorAll(`${vt} .ql-picker-item`),K=Array.from(wt).find(Fe=>Fe.getAttribute("data-value")===Ct);K&&(K.classList.add("ql-selected"),Ne==null||Ne.classList.add("ql-active"))}})},resizeToolbar:Ft=>{if(!Ft.length)return;const Ye=Ft[0].target.getBoundingClientRect(),Ct=Math.ceil(Ye.height);ye(vt=>Math.abs(vt-Ct)<.1?vt:Ct)}},mt=Ft=>{const Bt=Ft.target;if(Bt.tagName==="IMG")try{const nr=Ue.find(Bt);if(nr){const Ye=Le.getIndex(nr);queueMicrotask(()=>{Le.setSelection(Ye,1,Ue.sources.USER)}),Ft.preventDefault(),Ft.stopPropagation()}}catch(nr){console.error("이미지 선택 중 오류:",nr)}},Nt=Lr(Ke),er=new ResizeObserver(St.resizeToolbar);Nt&&(er.observe(Nt),Cr.current.push(()=>er.disconnect()));const ar=["header","color","background"];return ar.forEach(Ft=>{const Bt=Nt==null?void 0:Nt.querySelector(`.ql-${Ft} .ql-picker-label`);Bt&&pe(Bt,"click",()=>St.formatExpand(ar))}),dt&&(pe(dt,"keydown",St.keyDown),pe(dt,"click",mt)),()=>{}},[Lr,pe,de,j]),ze=E.useCallback(Ke=>{if(!Ke||!Q)return;const Le=Ke.getEditor();if(!Le)return;let dt=!1,St="",mt=null,Nt=0;const er=Bt=>Bt.replace(/[\r\n\u2028\u2029]+/g," ").replace(/\s+/g," "),ar=Bt=>{dt||(mt&&window.cancelAnimationFrame(mt),mt=window.requestAnimationFrame(()=>{dt=!0;try{Bt()}finally{dt=!1,mt=null}}))},Ft=[];if(le){const Bt=Ne=>{if(Ne.key==="Enter")return Ne.preventDefault(),e&&e(Le.root.innerHTML),!1},nr=()=>{const Ne=Le.getText().slice(0,-1);if(Ne===St)return;const wt=/[\r\n\u2028\u2029]/.test(Ne),K=ls(Ne)>Q;if(wt||K){const Fe=Le.getSelection(),rt=Le.getFormat();Nt=Fe?Fe.index:0;let bt=Ne;if(wt&&(bt=er(bt)),K&&(bt=Array.from(bt).slice(0,Q).join("")),bt!==Ne){const Wt=new Gt().insert(bt+`
|
350
350
|
`);Le.setContents(Wt),Object.keys(rt).length>0&&Le.formatText(0,bt.length,rt);const Yt=Math.min(Nt,bt.length);Le.setSelection(Yt,0)}St=bt}else St=Ne},Ye=Ne=>{Ne.preventDefault();const wt=Ne.clipboardData;if(!wt)return;const K=Le.getSelection();if(!K)return;const Fe=Le.getText().slice(0,-1),rt=K.index>0?Fe.substring(0,K.index):"",bt=K.index+K.length<Fe.length?Fe.substring(K.index+K.length):"",Wt=er(wt.getData("text/plain")),Yt=rt+Wt+bt;if(ls(Yt)<=Q)K.length>0&&Le.deleteText(K.index,K.length),Le.insertText(K.index,Wt),Le.setSelection(K.index+ls(Wt),0);else{const $t=Q-(ls(rt)+ls(bt));if($t<=0)return;const ir=Array.from(Wt).slice(0,$t).join("");Le.updateContents(new Gt().retain(K.index).delete(K.length).insert(ir)),Le.setSelection(K.index+ls(ir),0)}ar(()=>{const $t=Le.getText().slice(0,-1);if(/[\r\n\u2028\u2029]/.test($t)){const ir=er($t),or=Le.getFormat();Le.setContents(new Gt().insert(ir+`
|
351
|
-
`)),Object.keys(or).length>0&&Le.formatText(0,ir.length,or);const dr=Math.min(K.index+ls(Wt),ir.length);Le.setSelection(dr,0),St=ir}else St=$t})},Ct=Ne=>{(Ne.inputType==="insertLineBreak"||Ne.inputType==="insertText"&&Ne.data&&/[\r\n\u2028\u2029]/.test(Ne.data))&&Ne.preventDefault()},vt=()=>{ar(nr)};pe(Le.root,"keydown",Bt),pe(Le.root,"paste",Ye),pe(Le.root,"beforeinput",Ct),Le.on("text-change",vt),Ft.push(()=>{pe(Le.root,"keydown",Bt),pe(Le.root,"paste",Ye),pe(Le.root,"beforeinput",Ct),Le.off("text-change",vt),mt&&window.cancelAnimationFrame(mt)}),ar(nr)}else{const Bt=()=>{const Ne=Le.getText();if(ls(Ne)-1<=Q)return;const K=Le.getSelection(),Fe=Le.getContents();Nt=K?K.index:0;let rt=0,bt=0;for(const Et of Fe.ops||[])if(typeof Et.insert=="string"){const $t=Array.from(Et.insert);for(const ir of $t){if(rt>=Q)break;rt++,bt+=ir.length}if(rt>=Q)break}else Et.insert&&(rt+=1);const Wt=Ne.substring(0,bt);Le.setText(Wt);const Yt=Math.min(Nt,Wt.length);Le.setSelection(Yt,0)},nr=(Ne,wt)=>{const K=Le.getSelection();if(!K)return!0;const Fe=Le.getText(),rt=ls(Fe)-1,bt=K.length>0?ls(Fe.substring(K.index,K.index+K.length)):0,Wt=Q-(rt-bt);if(ls(wt)<=Wt)return!0;if(Ne.preventDefault(),Ne.type==="paste"){const Et=K.index,$t=Array.from(wt).slice(0,Wt).join(""),ir=new Gt;K.length?ir.retain(Et).delete(K.length):ir.retain(Et),ir.insert($t),Le.updateContents(ir,Ue.sources.USER),requestAnimationFrame(()=>{const or=Et+ls($t);or<=Le.getLength()&&Le.setSelection(or,0)})}return!1},Ye=()=>{ar(Bt)},Ct=Ne=>{Ne.inputType.startsWith("insert")&&nr(Ne,Ne.data||"")},vt=Ne=>{const wt=Ne.clipboardData;if(wt){const K=er(wt.getData("text/plain"));nr(Ne,K)}};Le.on("text-change",Ye),pe(Le.root,"beforeinput",Ct,{capture:!0}),pe(Le.root,"paste",vt,{capture:!0}),Ft.push(()=>{Le.off("text-change",Ye),pe(Le.root,"beforeinput",Ct,{capture:!0}),pe(Le.root,"paste",vt,{capture:!0}),mt&&window.cancelAnimationFrame(mt)})}return()=>Ft.forEach(Bt=>Bt())},[Q,le,e,pe]),st=E.useCallback(Ke=>{typeof i=="function"?i(Ke):i&&(i.current=Ke),Ke&&(re(Ke),ze(Ke))},[i,re,ze]);return m.jsx(ec,{helperText:C,wrapType:D,labelProps:{...x,style:{minHeight:_?20:void 0,marginBottom:_?4:0}},errorMessage:t,label:m.jsxs(Sn,{style:{gap:4},children:[_,!Q&&ue==="Top"&&xt]}),wrapProps:{...T,className:Pe.clsx(T==null?void 0:T.className,!ke&&Fn.AEditorWrapper),style:{...T==null?void 0:T.style,height:Te}},children:m.jsxs($r,{...ne,className:Pe.clsx(ne.className,Fn.AEditorContainer),style:{...w,height:Ve,minHeight:yt},children:[m.jsx(Sh,{...L,ref:st,className:Pe.clsx(L==null?void 0:L.className,Fn.AEditor,Fn[Tt],le&&"Title"),formats:le?J.FORMAT_TITLE:J.FORMAT_DEFAULT,modules:Dt,placeholder:h,readOnly:X,theme:"snow",value:ut,style:{maxHeight:tt?tt+se:void 0,"--icon-size":`${H==="Med"?18:24}px`,"--editor-padding":le?"8px 12px":"12px","--toolbar-padding":`${_r}px`,"--content-height":le?"34px":Ee?`${Ee}px`:"100%","--content-max-height":tt?`${tt}px`:"100%","--default-text":`'${hn.AEditor.Default}'`,"--arrow-background":`url("data:image/svg+xml,${encodeURIComponent(Ns.renderToString(m.jsx(jr,{icon:"EditorArrow"})))}`,"--title-color-picker-width":le?"780px":"142px"},onChange:zt}),O&&m.jsxs(m.Fragment,{children:[m.jsx("div",{ref:et,className:Fn.Resizer,style:{height:ie,bottom:u&&!X?ge:0},onMouseDown:Rt}),it&&m.jsx("div",{className:Pe.clsx(Fn.Indicator,"NoSelect","Label1"),style:{height:ie,bottom:u&&!X?ge:0},children:`${Math.round(Ee)}px`})]}),m.jsx("div",{className:Pe.clsx(Fn.LimitContainer,"NoSelect"),style:{marginTop:ve,minHeight:be,display:!Q&&ue==="Bottom"?"flex":"none"},children:xt})]})})},(r,e)=>r.errorMessage===e.errorMessage&&r.type===e.type&&r.useValue===e.useValue&&r.useError===e.useError&&r.placeholder===e.placeholder&&r.readOnly===e.readOnly&&r.maxLength===e.maxLength&&r.contentHeight===e.contentHeight&&r.minHeight===e.minHeight&&r.maxHeight===e.maxHeight&&r.toolbarSize===e.toolbarSize&&r.toolbarType===e.toolbarType&&r.limitPosition===e.limitPosition&&r.editorClassName===e.editorClassName&&r.editorStyle===e.editorStyle),eN=E.memo(({calculateSize:r,error:e,htmlDelta:t,limit:n,useError:i,isReadonly:l})=>!i||l?null:m.jsxs(nl,{className:Fn.Limit,children:["(",m.jsx("span",{className:e?Fn.Error:void 0,children:Gc(r(t))})," / ",Gc(n),")"]}));function rh(r,e){Array.isArray(r)||(r=[r]);for(const t of r){if(e(t))return t;if(!t.children||t.children.length<1)continue;const n=rh(t.children,e);if(n)return n}}function cd(r,e){Array.isArray(r)||(r=[r]);for(const t of r)e(t),!(!t.children||t.children.length<1)&&cd(t.children,e)}function uS(r,e){Array.isArray(r)||(r=[r]);const t=[];return cd(r,(n,i)=>t.push(e(n,i))),t}function fS(r,e){Array.isArray(r)||(r=[r]);for(const t of r){if(!e(t))return!1;if(!(!t.children||t.children.length<1)&&!fS(t.children,e))return!1}return!0}function tN(r,e){Array.isArray(r)||(r=[r]);const t=[];return cd(r,(n,i)=>{e(n,i)&&t.push(n)}),t}function rN(r){Array.isArray(r)||(r=[r]);let e=0;return cd(r,()=>e++),e}function nN(r,e,t,n){if(n(e,t))return null;Array.isArray(r)||(r=[r]);const i=rh(r,u=>{var h;return(h=u.children)==null?void 0:h.some(g=>n(g,e))}),l=rh(r,u=>{var h;return(h=u.children)==null?void 0:h.some(g=>n(g,t))});if(i===void 0&&l===void 0){const u=r.findIndex(g=>n(g,e)),h=r.findIndex(g=>n(g,t));return r.splice(u,1),r.splice(h,0,e),[...r]}else if(i!==void 0&&l!==void 0&&n(i,l)&&i.children){const u=i.children.findIndex(g=>n(g,e)),h=i.children.findIndex(g=>n(g,t));return u===void 0||h===void 0?null:(i.children.splice(u,1),i.children.splice(h,0,e),i.children=[...i.children],[...r])}return null}function iN(r,e,t){const n=[],i=[...e];for(;i.length>0;){const l=i.shift();if(l&&!n.find(u=>t(u,l))&&(n.push(l),!(!l.children||l.children.length<1)))for(const u of l.children)i.push(u)}return n}function oN(r,e,t){Array.isArray(r)||(r=[r]);const n=uS(r,u=>u),i=[],l=[...e];for(;l.length>0;){const u=l.shift();if(!u||i.find(g=>t(g,u)))continue;i.push(u);const h=n.find(g=>{var v;return(v=g.children)==null?void 0:v.some(L=>t(L,u))});h&&l.push(h)}return i}const tl={find:rh,forEach:cd,map:uS,every:fS,filter:tN,length:rN,replace:nN,descendants:iN,ancestors:oN},sN="_AWrap_f5le3_1",aN="_AContainer_f5le3_10",lN="_ATree_f5le3_18",cN="_ATreeBody_f5le3_30",uN="_CoverBorder_f5le3_36",fN="_InsertBorder_f5le3_45",dN="_ATreeHeader_f5le3_76",hN="_ATreeBodyHeader_f5le3_82",pN="_ATreeBodyHeaderResources_f5le3_92",gN="_ATreeItem_f5le3_98",mN="_IsSelectUsed_f5le3_114",vN="_IsSelected_f5le3_117",yN="_IsSearchSelected_f5le3_122",bN="_IsHovered_f5le3_133",_N="_CheckBox_f5le3_137",xN="_Indents_f5le3_149",SN="_ExpandIcon_f5le3_156",CN="_Content_f5le3_168",wN="_RightSticky_f5le3_177",AN="_SearchInputWrap_f5le3_188",TN="_SearchInput_f5le3_188",EN="_RightAddon_f5le3_200",kN="_RightAddonIcon_f5le3_211",RN="_Loader_f5le3_218",dn={AWrap:sN,AContainer:aN,ATree:lN,ATreeBody:cN,CoverBorder:uN,InsertBorder:fN,ATreeHeader:dN,ATreeBodyHeader:hN,ATreeBodyHeaderResources:pN,ATreeItem:gN,IsSelectUsed:mN,IsSelected:vN,IsSearchSelected:yN,IsHovered:bN,CheckBox:_N,Indents:xN,ExpandIcon:SN,Content:CN,RightSticky:wN,SearchInputWrap:AN,SearchInput:TN,RightAddon:EN,RightAddonIcon:kN,Loader:RN},IN=r=>{const{isEqual:e,item:t,selectDisabled:n,selectUnused:i,isParentDisabled:l,indents:u,extIndents:h,useExpand:g,useSelect:v,useSearch:L,onDragStart:T,onDragOver:C,onDragEnd:_,showCheckbox:x,icons:D,iconWidth:w,isSelectMulti:b,isDraggable:R,isParentCheckHovered:O,hoverdItem:q,onMouseOver:H,onMouseLeave:z,ContentRenderer:Y,TreeItemRenderer:ue,RightStickyAddon:Q,resources:de,containerRef:j,TreeItemStyle:ne,TreeItemClassName:J,searchItemStyle:X,searchItemClassName:ie,height:fe}=r,{children:ye}=E.useMemo(()=>t,[t]),[se,be]=E.useMemo(()=>g,[g]),[ve,ge]=E.useMemo(()=>v,[v]),[Ee,Oe]=E.useMemo(()=>L,[L]),Xe=E.useMemo(()=>i?i(t):!1,[i,t]),Ae=E.useMemo(()=>!n||l?l:n(t),[n,l,t]),it=E.useMemo(()=>se.some($e=>e($e,t)),[se,e,t]),pt=E.useMemo(()=>!ye||ye.length<1?"noChild":it?"expanded":"collapsed",[ye,it]),et=E.useMemo(()=>{const $e=D[pt];return cm.includes($e)?m.jsx(jr,{style:{width:w,height:w},icon:$e}):$e},[D,w,pt]),Ze=E.useCallback($e=>{!be||pt==="noChild"||(be(it?se.filter(Rt=>!e(Rt,t)):[...se,t]),$e.stopPropagation())},[be,se,it,t,e,pt]),je=E.useMemo(()=>ve.some($e=>e($e,t)),[ve,e,t]),Ie=E.useCallback(()=>{!ge||Ae||(ge(b?je?ve.filter($e=>!e($e,t)):[...ve,t]:[t]),Ee&&Oe&&Ee.items.some($e=>e($e,t))&&Oe({...Ee,item:t}))},[b,Ae,je,Ee,Oe,ge,e,ve,t]),le=E.useMemo(()=>Ee==null?void 0:Ee.items.some($e=>e($e,t)),[Ee,e,t]),ke=E.useMemo(()=>le&&(Ee==null?void 0:Ee.item)&&e(Ee.item,t),[le,Ee,e,t]),Te=E.useRef(null);E.useEffect(()=>{setTimeout(()=>{if(ke&&Te.current&&j.current){const{top:$e,bottom:Rt}=Te.current.getBoundingClientRect(),{top:zt,bottom:_r}=j.current.getBoundingClientRect();($e<zt||Rt>_r)&&Te.current.scrollIntoView({behavior:"smooth",block:"center"})}},10)},[j,ke]);const[Ve,tt]=E.useState(!1),yt=E.useCallback(()=>!Ae&&tt(!0),[Ae]),Tt=E.useCallback(()=>!Ae&&tt(!1),[Ae]),_t=E.useMemo(()=>tl.map(t,$e=>$e).filter($e=>!(n!=null&&n($e))&&!(i!=null&&i($e))),[n,i,t]),It=E.useMemo(()=>!x||!b?!1:je&&_t.some($e=>ve.some(Rt=>e($e,Rt)))&&_t.some($e=>!ve.some(Rt=>e($e,Rt))),[x,b,je,_t,e,ve]),Lt=E.useMemo(()=>x?b?_t.every($e=>ve.some(Rt=>e($e,Rt))):ve.some($e=>e($e,t)):!1,[x,b,_t,t,e,ve]),ft=E.useCallback(()=>{if(!(!ge||Ae))if(b)if(je){const $e=ve.filter(Rt=>!(i!=null&&i(Rt))&&!(n!=null&&n(Rt))&&_t.some(zt=>e(zt,Rt)));$e.length>0&&ge(ve.filter(Rt=>!$e.some(zt=>e(Rt,zt))))}else{const $e=_t.filter(Rt=>!(i!=null&&i(Rt))&&!(n!=null&&n(Rt))&&!ve.some(zt=>e(zt,Rt)));$e.length>0&&ge([...ve,...$e])}else ge([t])},[Ae,n,i,b,ge,e,je,ve,_t,t]),ut=E.useCallback($e=>{Ae||ft(),$e.stopPropagation()},[Ae,ft]),kt=E.useMemo(()=>{if(!x||!b||Ae)return"";if(je){const Rt=ve.filter(zt=>!(i!=null&&i(zt))&&!(n!=null&&n(zt))&&_t.some(_r=>e(_r,zt)));if(Rt.length>0)return de["deselect n"](Rt.length)}const $e=_t.filter(Rt=>!(i!=null&&i(Rt))&&!(n!=null&&n(Rt))&&!ve.some(zt=>e(zt,Rt)));return de["select n"]($e.length)},[n,i,de,Ae,x,b,je,_t,e,ve]),Me=E.useMemo(()=>Ir.getContent(Q,r),[Q,r]),ht=E.useMemo(()=>Ir.getContent(ne,r),[r,ne]),xt=E.useMemo(()=>Ir.getContent(J,r),[r,J]),Dt=E.useMemo(()=>Ir.getContent(ie,r),[r,ie]),qt=E.useMemo(()=>Ir.getContent(X,r),[r,X]);return m.jsxs(E.Fragment,{children:[m.jsxs($r,{className:Pe.clsx(dn.ATreeItem,je&&dn.IsSelected,!Ae&&(Ve||O)&&dn.IsHovered,le&&dn.IsSearched,ke&&(Dt||dn.IsSearchSelected),!Xe&&dn.IsSelectUsed,"NoSelect",xt),style:{...ht,...ke&&qt,"--ATreeItem_height":`${fe}px`},draggable:R,onDragStart:()=>T==null?void 0:T(t),onDragEnter:$e=>C==null?void 0:C($e,t),onDragEnd:$e=>_==null?void 0:_($e,t),onClick:Ie,abaseRef:Te,isDisabled:Ae,onMouseOver:$e=>H==null?void 0:H($e,t),onMouseLeave:$e=>z==null?void 0:z($e,t),children:[x&&m.jsx(Gu,{style:{visibility:Ae||Xe?"hidden":"visible",zIndex:Ae||Xe?0:2},className:dn.CheckBox,useCheck:[+Lt,ft],onClick:ut,isIndeterminate:It,onMouseOver:yt,onMouseOut:Tt,tooltip:kt,isDisabled:Ae}),m.jsx("div",{className:dn.Indents,style:{paddingLeft:x?0:r.icons.noChild?12:0},children:u.map(($e,Rt)=>{const zt=Rt===u.length-1;return m.jsx(D2,{value:$e,map:{Collapsed:h?h({iconWidth:w}).collapsed:m.jsx(MN,{iconWidth:w}),Expanded:h?h({iconWidth:w,isLast:zt}).expanded:m.jsx(LN,{iconWidth:w,isLast:zt}),IsLast:h?h({iconWidth:w}).isLast:m.jsx(DN,{iconWidth:w})}},Rt)})}),et&&m.jsx("div",{className:dn.ExpandIcon,style:{width:w,minWidth:w,maxWidth:w},onClick:Ze,children:et}),m.jsx("div",{className:Pe.clsx(dn.Content,"NoSelect"),children:m.jsx(Y,{isEqual:e,item:t,indents:u,extIndents:h,useExpand:g,useSelect:v,useSearch:L,onDragStart:T,onDragOver:C,onDragEnd:_,showCheckbox:x,icons:D,iconWidth:w,isSelectMulti:b,isDraggable:R,isParentCheckHovered:b&&(Ve||O),hoverdItem:q,onMouseOver:H,onMouseLeave:z,ContentRenderer:Y,TreeItemRenderer:ue,RightStickyAddon:Q,resources:de,containerRef:j,TreeItemStyle:ne,TreeItemClassName:J,searchItemClassName:Dt,searchItemStyle:X,height:fe})}),Me&&m.jsx("div",{className:dn.RightSticky,children:Me})]}),it&&(ye==null?void 0:ye.map(($e,Rt)=>m.jsx(ue,{isEqual:e,item:$e,selectDisabled:n,selectUnused:i,indents:[...u.map(zt=>zt==="IsLast"?"Collapsed":zt),Rt===ye.length-1?"IsLast":"Expanded"],extIndents:h,ContentRenderer:Y,useExpand:g,useSelect:v,useSearch:L,onDragStart:T,onDragOver:C,onDragEnd:_,showCheckbox:x,icons:D,iconWidth:w,isSelectMulti:b,isDraggable:R,isParentCheckHovered:b&&(Ve||O),hoverdItem:q,onMouseOver:H,onMouseLeave:z,TreeItemRenderer:ue,RightStickyAddon:Q,resources:de,containerRef:j,TreeItemStyle:ne,TreeItemClassName:J,searchItemClassName:Dt,searchItemStyle:X,height:fe},Rt)))]})},LN=({iconWidth:r,isLast:e})=>m.jsx("div",{style:{width:r/8*3,height:"100%",borderLeft:"var(--ATree_Indent_border)",marginLeft:r/2,marginRight:r/8,boxSizing:"border-box",transition:"border-color var(--Transition)"},children:e&&m.jsx("div",{style:{borderBottom:"var(--ATree_Indent_border)",height:"50%",transition:"border-color var(--Transition)"}})}),MN=({iconWidth:r})=>m.jsx("div",{style:{width:r,height:"100%",borderLeft:"none",marginLeft:0,transition:"border-color var(--Transition)"}}),DN=({iconWidth:r})=>m.jsx("div",{style:{width:r/8*3,height:"50%",borderLeft:"var(--ATree_Indent_border)",borderBottom:"var(--ATree_Indent_border)",marginLeft:r/2,marginRight:r/8,boxSizing:"border-box",transition:"border-color var(--Transition)"}}),ON=r=>{const{isEqual:e,searchResult:t,initSearch:n,searchUp:i,searchDown:l,searchEnter:u,isDisabled:h,isLoading:g,resources:v,maxLength:L,autoFocus:T}=r,C=E.useCallback(D=>{D.key==="Enter"?u():D.key==="ArrowDown"?l():D.key==="ArrowUp"&&i(),D.preventDefault(),D.stopPropagation()},[l,u,i]),_=E.useCallback(D=>{n(D)},[n]),x=E.useMemo(()=>h||g?-1:void 0,[h,g]);return m.jsx(tc,{className:dn.SearchInput,wrapProps:{className:dn.SearchInputWrap},isDisabled:h,tabIndex:x,useValue:[(t==null?void 0:t.keyword)??"",_],onKeyDown:C,placeholder:v["Search(Placeholder)"],RightAddon:m.jsx(PN,{isEqual:e,searchResult:t,searchUp:i,searchDown:l,searchEnter:u,resources:v}),maxLength:L,autoFocus:T})},PN=r=>{const{isEqual:e,searchResult:t,searchUp:n,searchDown:i,searchEnter:l,resources:u}=r,h=E.useMemo(()=>!t||t.items.length<1?0:t.items.findIndex(x=>t.item&&e(x,t.item))+1,[t,e]),g=E.useMemo(()=>!t||t.items.length<1?0:t.items.length,[t]),v=E.useMemo(()=>h<2,[h]),L=E.useMemo(()=>h>=g,[h,g]),T=E.useCallback(x=>{x.stopPropagation(),!v&&n()},[n,v]),C=E.useCallback(x=>{x.stopPropagation(),!L&&i()},[i,L]),_=E.useCallback(x=>{x.stopPropagation(),l()},[l]);return m.jsx("div",{className:Pe.clsx(dn.RightAddon,"NoSelect"),children:t?m.jsxs(m.Fragment,{children:[h,"/",g,m.jsx($r,{onClick:T,isDisabled:v,children:m.jsx(jr,{className:dn.RightAddonIcon,icon:"ArrowUp",mask:""})}),m.jsx($r,{onClick:C,isDisabled:L,children:m.jsx(jr,{className:dn.RightAddonIcon,icon:"ArrowDown"})})]}):m.jsx(xi,{type:"Raw",className:dn.RightAddonIcon,style:{marginRight:4},icon:"Search",onClick:_,tooltip:u["Search(Button)"]})})},NN=r=>{var nr;const{pk:e,selectDisabled:t,selectUnused:n,useItems:i,useExpand:l,useSelect:u,useSearch:h,showCheckbox:g,iconWidth:v=24,icons:L={noChild:"Folder",collapsed:"FolderCopy",expanded:"FolderOpen"},indents:T,isSelectMulti:C=!1,noSearch:_=!1,isDraggable:x,noSyncSearchSelect:D=!1,actionRef:w,placeholder:b,searchPredicate:R=jN,isDisabled:O,isLoading:q,ContentRenderer:H=FN,TreeItemRenderer:z=IN,RightStickyAddon:Y,TopRightAddon:ue,TreeTopAddon:Q,resources:de,maxLength:j,autoFocus:ne,TreeItemStyle:J,TreeItemClassName:X,OverflowPadding:ie,insertBorder:fe,width:ye,searchItemClassName:se,searchItemStyle:be,height:ve=40,...ge}=r,Ee=E.useMemo(()=>({...hn.ATree,...de}),[de]),Oe=E.useCallback((Ye,Ct)=>e!==void 0?Array.isArray(e)?e.every(vt=>rl.isEqual(Ye[vt],Ct[vt])):rl.isEqual(Ye[e],Ct[e]):rl.isEqual(Ye,Ct),[e]),Xe=E.useRef(null),[Ae,it]=cn(i,[]),pt=E.useMemo(()=>tl.map(Ae,Ye=>Ye),[Ae]),[et,Ze]=cn(l,[]),[je,Ie]=cn(u,[]),[le,ke]=cn(h,void 0),Te=E.useCallback(Ye=>{if(O||!Ze||et.some(Ne=>Oe(Ne,Ye)))return;const Ct=[];let vt=Ye;for(;vt;){const Ne=vt;et.find(wt=>Oe(wt,Ne))||Ct.push(Ne),vt=pt.find(wt=>{var K;return(K=wt.children)==null?void 0:K.some(Fe=>Oe(Fe,Ne))})}Ze([...et,...Ct])},[et,O,Oe,Ze,pt]),Ve=E.useCallback(()=>{!Ze||O||Ze([...pt])},[pt,O,Ze]),tt=E.useCallback(()=>{!Ze||O||Ze([])},[Ze,O]),yt=E.useCallback(Ye=>{!Ie||O||n!=null&&n(Ye)||(Ie([Ye]),Te(Ye))},[Ie,O,n,Te]),Tt=E.useCallback(Ye=>{if(!ke||O)return;if(!Ye||_){ke(void 0),D||Ie==null||Ie([]);return}const Ct=tl.filter(Ae,Ne=>R(Ye,Ne));let vt;if(Ct.find(Ne=>(le==null?void 0:le.item)&&Oe(Ne,le.item))?vt=le==null?void 0:le.item:Ct.length>0&&(vt=Ct[0]),ke({keyword:Ye,items:Ct,item:vt}),vt&&Te(vt),Ie&&!D)if(C)Ie(Ct);else{const Ne=Ct.find(wt=>vt&&Oe(wt,vt));Ie(Ne?[Ne]:[])}},[Ae,O,Oe,R,ke,Ie,Te,D,_,C,le]),_t=E.useRef(!1);E.useEffect(()=>{_t.current=!0},[Ae]),E.useEffect(()=>{le&&_t.current&&(Tt(le.keyword),_t.current=!1)},[Tt,le]);const It=E.useCallback(()=>{if(!le||!ke||O)return;let Ye=le.items.findIndex(Ct=>le.item&&Oe(Ct,le.item))-1;Ye<0||(ke({...le,item:le.items[Ye]}),Te(le.items[Ye]),D||yt(le.items[Ye]))},[le,Te,ke,O,yt,Oe,D]),Lt=E.useCallback(()=>{if(!le||!ke||O)return;let Ye=le.items.findIndex(Ct=>le.item&&Oe(Ct,le.item))+1;Ye>=le.items.length||(ke({...le,item:le.items[Ye]}),Te(le.items[Ye]),D||yt(le.items[Ye]))},[le,Te,O,ke,yt,Oe,D]),ft=E.useCallback(()=>{if(!le||!ke||O)return;let Ye=le.items.findIndex(vt=>le.item&&Oe(vt,le.item));if(!D||n!=null&&n(le.items[Ye])){Lt();return}if(je.some(vt=>le.item&&Oe(vt,le.item))){let vt=Ye+1;const Ne=le.items[vt];if(vt>=le.items.length)return;ke({...le,item:Ne}),yt(Ne)}else yt(le.items[Ye])},[le,ke,O,je,D,Lt,Oe,yt,n]),[ut,kt]=E.useState(!1),Me=E.useCallback(()=>kt(!0),[]),ht=E.useCallback(()=>kt(!1),[]),xt=E.useMemo(()=>n?tl.map(Ae,Ye=>Ye).filter(Ye=>!n(Ye)):t?tl.map(Ae,Ye=>Ye).filter(Ye=>!t(Ye)):tl.map(Ae,Ye=>Ye),[n,t,Ae]),Dt=E.useMemo(()=>!g||!C?!1:je.length>0&&xt.length>je.length,[g,C,je,xt]),qt=E.useMemo(()=>!g||!C?!1:je.length>0&&xt.length===je.length,[g,C,je,xt]),$e=E.useCallback(()=>{if(!Ie||!C||O)return;const Ye=je.filter(Ct=>!(n!=null&&n(Ct))&&!(t!=null&&t(Ct))&&xt.some(vt=>Oe(vt,Ct)));if(Ye.length>0)Ie(je.filter(Ct=>!Ye.some(vt=>Oe(Ct,vt))));else{const Ct=xt.filter(vt=>!(n!=null&&n(vt))&&!(t!=null&&t(vt))&&!je.some(Ne=>Oe(Ne,vt)));Ct.length>0&&Ie([...je,...Ct])}},[C,O,n,t,Ie,je,xt,Oe]),Rt=E.useMemo(()=>{if(!g||!C||O)return"";const Ye=je.filter(Ct=>!(n!=null&&n(Ct))&&!(t!=null&&t(Ct))&&xt.some(vt=>Oe(vt,Ct)));if(Ye.length>0)return Ee["deselect n"](Ye.length);{const Ct=xt.filter(vt=>!(n!=null&&n(vt))&&!(t!=null&&t(vt))&&!je.some(Ne=>Oe(Ne,vt)));return Ee["select n"](Ct.length)}},[n,t,O,Ee,g,C,xt,je,Oe]),[zt,_r]=E.useState(null),[Lr,Cr]=E.useState(null),pe=E.useCallback(Ye=>{!x||O||_r(Ye)},[O,x]),re=E.useCallback((Ye,Ct)=>{if(!x||O||!zt||(Ye.preventDefault(),Ye.stopPropagation(),Cr(Ct),!it))return;const vt=tl.replace(Ae,zt,Ct,Oe);vt&&it(vt)},[x,Ae,zt,O,it,Oe]),ze=E.useCallback(()=>{if(!x||O||!zt||!Lr||!it||Oe(zt,Lr))return;const Ye=tl.replace(Ae,zt,Lr,Oe);Ye&&(it(Ye),_r(null))},[x,it,Ae,zt,Lr,Oe,O]);E.useEffect(()=>{var Ye;g||(Ye=Xe.current)==null||Ye.scrollTo(0,0)},[g,Xe]),E.useEffect(()=>{!C&&je.length>1&&(Ie==null||Ie([je[je.length-1]]))},[C,Ie,je]),E.useEffect(()=>{w&&(w.current={expandAll:Ve,collapseAll:tt})},[w,Ve,tt]),E.useEffect(()=>{if(!t||!Ie)return;const Ye=je.filter(Ct=>!t(Ct));je.length!==Ye.length&&Ie(Ye)},[t,je,Ie]),E.useEffect(()=>{if(!n||!Ie)return;const Ye=je.filter(Ct=>!n(Ct));je.length!==Ye.length&&Ie(Ye)},[n,je,Ie]),E.useEffect(()=>{ke&&ke(void 0)},[ke]);const[st,Ke]=E.useState(!1);E.useEffect(()=>{Ke(Ye=>!Ye)},[Ae]);const[Le,dt]=E.useState(null),St=E.useCallback((Ye,Ct)=>{O||(Ye.stopPropagation(),Ye.preventDefault(),dt(Ct))},[O]),mt=E.useCallback((Ye,Ct)=>{Le===null||O||Oe(Ct,Le)&&(Ye.stopPropagation(),Ye.preventDefault(),dt(null))},[Le,O,Oe]),Nt=E.useRef(null),[er,ar]=E.useState(!1),[Ft,Bt]=E.useState((nr=Nt.current)==null?void 0:nr.scrollHeight);return E.useEffect(()=>{if(et.length<0)return;const Ye=Xe.current,Ct=Nt.current,vt=Ye.clientHeight<Ct.clientHeight;Bt(vt?Ct.scrollHeight:Ye.clientHeight),ar(vt)},[et]),m.jsxs($r,{...ge,isDisabled:O,className:Pe.clsx(ge.className,dn.AWrap),children:[(!_||ue)&&m.jsxs(Sn,{className:dn.ATreeHeader,children:[!_&&m.jsx(ON,{isEqual:Oe,searchResult:le,initSearch:Tt,searchUp:It,searchDown:Lt,searchEnter:ft,isLoading:q,isDisabled:O,resources:Ee,maxLength:j,autoFocus:ne}),!_&&ue&&m.jsx(mn,{w:8}),ue]}),(!_||ue||g&&C||x)&&m.jsx(mm,{isLoading:q&&Ae.length!==0}),(g&&C||x)&&m.jsxs("div",{className:Pe.clsx(dn.ATreeBodyHeader,"NoSelect"),children:[g&&m.jsx(Gu,{className:dn.CheckBox,useCheck:[+qt,()=>$e()],isIndeterminate:Dt,onMouseOver:Me,onMouseOut:ht,isDisabled:O,tooltip:Rt}),Ee.Items,m.jsx(Jc,{}),m.jsxs("div",{className:Pe.clsx(dn.ATreeBodyHeaderResources,"NoSelect"),style:{marginRight:er?8:0},children:[m.jsx("span",{children:g&&Ee["*Click row for single select"]}),m.jsx("span",{children:x&&Ee["*Change order to row drag"]})]})]}),m.jsx("div",{ref:Xe,className:Pe.clsx(ge.className,dn.AContainer),children:m.jsxs("div",{className:dn.ATree,style:{minWidth:ye||"fit-content",marginRight:ie&&er?8:0},children:[m.jsxs("div",{ref:Nt,className:dn.ATreeBody,children:[Ae.length===0?q?m.jsx(BN,{text:Ee["Loading Contents..."]}):b:Q,Ae.map((Ye,Ct)=>m.jsx(z,{isEqual:Oe,indents:[],extIndents:T,item:Ye,selectDisabled:t,selectUnused:n,isParentDisabled:O,useExpand:[et,Ze],useSelect:[je,Ie],useSearch:[le,ke],onDragStart:pe,onDragOver:re,onDragEnd:ze,showCheckbox:g,icons:L,iconWidth:v,isSelectMulti:C,isDraggable:x,isParentCheckHovered:C&&ut,ContentRenderer:H,TreeItemRenderer:z,RightStickyAddon:Y,resources:Ee,containerRef:Xe,TreeItemStyle:J,TreeItemClassName:X,hoverdItem:Le,onMouseOver:St,onMouseLeave:mt,searchItemClassName:se,searchItemStyle:be,height:ve},`${Ct}${st}`))]}),fe&&m.jsxs(m.Fragment,{children:[m.jsx("div",{className:dn.CoverBorder}),m.jsx("div",{className:dn.InsertBorder,style:{"--InsertBorder_height":`${ve}px`,height:er?Ft:"100%"}})]})]})})]})},FN=r=>{const{item:e}=r,t={};return tr.keys(e).forEach(n=>{n!=="children"&&(t[n]=e[n])}),JSON.stringify(t)};function jN(r,e){return tr.some(e,(t,n)=>{var i;return(i=tr.stringify(n))==null?void 0:i.toLowerCase().includes(r.toLowerCase())})}const BN=r=>{const{text:e}=r;return m.jsxs(Sn,{className:Pe.clsx(dn.Loader,"NoSelect"),children:[m.jsx(jr,{icon:"Spinner",style:{height:40},height:40,width:40}),m.jsx(U2,{text:e})]})};var Gg,Yb;function rf(){return Yb||(Yb=1,Gg=TypeError),Gg}const HN={},qN=Object.freeze(Object.defineProperty({__proto__:null,default:HN},Symbol.toStringTag,{value:"Module"})),zN=t4(qN);var Zg,Xb;function Ch(){if(Xb)return Zg;Xb=1;var r=typeof Map=="function"&&Map.prototype,e=Object.getOwnPropertyDescriptor&&r?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,t=r&&e&&typeof e.get=="function"?e.get:null,n=r&&Map.prototype.forEach,i=typeof Set=="function"&&Set.prototype,l=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,u=i&&l&&typeof l.get=="function"?l.get:null,h=i&&Set.prototype.forEach,g=typeof WeakMap=="function"&&WeakMap.prototype,v=g?WeakMap.prototype.has:null,L=typeof WeakSet=="function"&&WeakSet.prototype,T=L?WeakSet.prototype.has:null,C=typeof WeakRef=="function"&&WeakRef.prototype,_=C?WeakRef.prototype.deref:null,x=Boolean.prototype.valueOf,D=Object.prototype.toString,w=Function.prototype.toString,b=String.prototype.match,R=String.prototype.slice,O=String.prototype.replace,q=String.prototype.toUpperCase,H=String.prototype.toLowerCase,z=RegExp.prototype.test,Y=Array.prototype.concat,ue=Array.prototype.join,Q=Array.prototype.slice,de=Math.floor,j=typeof BigInt=="function"?BigInt.prototype.valueOf:null,ne=Object.getOwnPropertySymbols,J=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,X=typeof Symbol=="function"&&typeof Symbol.iterator=="object",ie=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===X||!0)?Symbol.toStringTag:null,fe=Object.prototype.propertyIsEnumerable,ye=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(pe){return pe.__proto__}:null);function se(pe,re){if(pe===1/0||pe===-1/0||pe!==pe||pe&&pe>-1e3&&pe<1e3||z.call(/e/,re))return re;var ze=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof pe=="number"){var st=pe<0?-de(-pe):de(pe);if(st!==pe){var Ke=String(st),Le=R.call(re,Ke.length+1);return O.call(Ke,ze,"$&_")+"."+O.call(O.call(Le,/([0-9]{3})/g,"$&_"),/_$/,"")}}return O.call(re,ze,"$&_")}var be=zN,ve=be.custom,ge=Te(ve)?ve:null,Ee={__proto__:null,double:'"',single:"'"},Oe={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};Zg=function pe(re,ze,st,Ke){var Le=ze||{};if(yt(Le,"quoteStyle")&&!yt(Ee,Le.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(yt(Le,"maxStringLength")&&(typeof Le.maxStringLength=="number"?Le.maxStringLength<0&&Le.maxStringLength!==1/0:Le.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var dt=yt(Le,"customInspect")?Le.customInspect:!0;if(typeof dt!="boolean"&&dt!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(yt(Le,"indent")&&Le.indent!==null&&Le.indent!==" "&&!(parseInt(Le.indent,10)===Le.indent&&Le.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(yt(Le,"numericSeparator")&&typeof Le.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var St=Le.numericSeparator;if(typeof re>"u")return"undefined";if(re===null)return"null";if(typeof re=="boolean")return re?"true":"false";if(typeof re=="string")return xt(re,Le);if(typeof re=="number"){if(re===0)return 1/0/re>0?"0":"-0";var mt=String(re);return St?se(re,mt):mt}if(typeof re=="bigint"){var Nt=String(re)+"n";return St?se(re,Nt):Nt}var er=typeof Le.depth>"u"?5:Le.depth;if(typeof st>"u"&&(st=0),st>=er&&er>0&&typeof re=="object")return pt(re)?"[Array]":"[Object]";var ar=_r(Le,st);if(typeof Ke>"u")Ke=[];else if(It(Ke,re)>=0)return"[Circular]";function Ft(or,dr,Ur){if(dr&&(Ke=Q.call(Ke),Ke.push(dr)),Ur){var vr={depth:Le.depth};return yt(Le,"quoteStyle")&&(vr.quoteStyle=Le.quoteStyle),pe(or,vr,st+1,Ke)}return pe(or,Le,st+1,Ke)}if(typeof re=="function"&&!Ze(re)){var Bt=_t(re),nr=Cr(re,Ft);return"[Function"+(Bt?": "+Bt:" (anonymous)")+"]"+(nr.length>0?" { "+ue.call(nr,", ")+" }":"")}if(Te(re)){var Ye=X?O.call(String(re),/^(Symbol\(.*\))_[^)]*$/,"$1"):J.call(re);return typeof re=="object"&&!X?qt(Ye):Ye}if(ht(re)){for(var Ct="<"+H.call(String(re.nodeName)),vt=re.attributes||[],Ne=0;Ne<vt.length;Ne++)Ct+=" "+vt[Ne].name+"="+Xe(Ae(vt[Ne].value),"double",Le);return Ct+=">",re.childNodes&&re.childNodes.length&&(Ct+="..."),Ct+="</"+H.call(String(re.nodeName))+">",Ct}if(pt(re)){if(re.length===0)return"[]";var wt=Cr(re,Ft);return ar&&!zt(wt)?"["+Lr(wt,ar)+"]":"[ "+ue.call(wt,", ")+" ]"}if(je(re)){var K=Cr(re,Ft);return!("cause"in Error.prototype)&&"cause"in re&&!fe.call(re,"cause")?"{ ["+String(re)+"] "+ue.call(Y.call("[cause]: "+Ft(re.cause),K),", ")+" }":K.length===0?"["+String(re)+"]":"{ ["+String(re)+"] "+ue.call(K,", ")+" }"}if(typeof re=="object"&&dt){if(ge&&typeof re[ge]=="function"&&be)return be(re,{depth:er-st});if(dt!=="symbol"&&typeof re.inspect=="function")return re.inspect()}if(Lt(re)){var Fe=[];return n&&n.call(re,function(or,dr){Fe.push(Ft(dr,re,!0)+" => "+Ft(or,re))}),Rt("Map",t.call(re),Fe,ar)}if(kt(re)){var rt=[];return h&&h.call(re,function(or){rt.push(Ft(or,re))}),Rt("Set",u.call(re),rt,ar)}if(ft(re))return $e("WeakMap");if(Me(re))return $e("WeakSet");if(ut(re))return $e("WeakRef");if(le(re))return qt(Ft(Number(re)));if(Ve(re))return qt(Ft(j.call(re)));if(ke(re))return qt(x.call(re));if(Ie(re))return qt(Ft(String(re)));if(typeof window<"u"&&re===window)return"{ [object Window] }";if(typeof globalThis<"u"&&re===globalThis||typeof _i<"u"&&re===_i)return"{ [object globalThis] }";if(!et(re)&&!Ze(re)){var bt=Cr(re,Ft),Wt=ye?ye(re)===Object.prototype:re instanceof Object||re.constructor===Object,Yt=re instanceof Object?"":"null prototype",Et=!Wt&&ie&&Object(re)===re&&ie in re?R.call(Tt(re),8,-1):Yt?"Object":"",$t=Wt||typeof re.constructor!="function"?"":re.constructor.name?re.constructor.name+" ":"",ir=$t+(Et||Yt?"["+ue.call(Y.call([],Et||[],Yt||[]),": ")+"] ":"");return bt.length===0?ir+"{}":ar?ir+"{"+Lr(bt,ar)+"}":ir+"{ "+ue.call(bt,", ")+" }"}return String(re)};function Xe(pe,re,ze){var st=ze.quoteStyle||re,Ke=Ee[st];return Ke+pe+Ke}function Ae(pe){return O.call(String(pe),/"/g,""")}function it(pe){return!ie||!(typeof pe=="object"&&(ie in pe||typeof pe[ie]<"u"))}function pt(pe){return Tt(pe)==="[object Array]"&&it(pe)}function et(pe){return Tt(pe)==="[object Date]"&&it(pe)}function Ze(pe){return Tt(pe)==="[object RegExp]"&&it(pe)}function je(pe){return Tt(pe)==="[object Error]"&&it(pe)}function Ie(pe){return Tt(pe)==="[object String]"&&it(pe)}function le(pe){return Tt(pe)==="[object Number]"&&it(pe)}function ke(pe){return Tt(pe)==="[object Boolean]"&&it(pe)}function Te(pe){if(X)return pe&&typeof pe=="object"&&pe instanceof Symbol;if(typeof pe=="symbol")return!0;if(!pe||typeof pe!="object"||!J)return!1;try{return J.call(pe),!0}catch{}return!1}function Ve(pe){if(!pe||typeof pe!="object"||!j)return!1;try{return j.call(pe),!0}catch{}return!1}var tt=Object.prototype.hasOwnProperty||function(pe){return pe in this};function yt(pe,re){return tt.call(pe,re)}function Tt(pe){return D.call(pe)}function _t(pe){if(pe.name)return pe.name;var re=b.call(w.call(pe),/^function\s*([\w$]+)/);return re?re[1]:null}function It(pe,re){if(pe.indexOf)return pe.indexOf(re);for(var ze=0,st=pe.length;ze<st;ze++)if(pe[ze]===re)return ze;return-1}function Lt(pe){if(!t||!pe||typeof pe!="object")return!1;try{t.call(pe);try{u.call(pe)}catch{return!0}return pe instanceof Map}catch{}return!1}function ft(pe){if(!v||!pe||typeof pe!="object")return!1;try{v.call(pe,v);try{T.call(pe,T)}catch{return!0}return pe instanceof WeakMap}catch{}return!1}function ut(pe){if(!_||!pe||typeof pe!="object")return!1;try{return _.call(pe),!0}catch{}return!1}function kt(pe){if(!u||!pe||typeof pe!="object")return!1;try{u.call(pe);try{t.call(pe)}catch{return!0}return pe instanceof Set}catch{}return!1}function Me(pe){if(!T||!pe||typeof pe!="object")return!1;try{T.call(pe,T);try{v.call(pe,v)}catch{return!0}return pe instanceof WeakSet}catch{}return!1}function ht(pe){return!pe||typeof pe!="object"?!1:typeof HTMLElement<"u"&&pe instanceof HTMLElement?!0:typeof pe.nodeName=="string"&&typeof pe.getAttribute=="function"}function xt(pe,re){if(pe.length>re.maxStringLength){var ze=pe.length-re.maxStringLength,st="... "+ze+" more character"+(ze>1?"s":"");return xt(R.call(pe,0,re.maxStringLength),re)+st}var Ke=Oe[re.quoteStyle||"single"];Ke.lastIndex=0;var Le=O.call(O.call(pe,Ke,"\\$1"),/[\x00-\x1f]/g,Dt);return Xe(Le,"single",re)}function Dt(pe){var re=pe.charCodeAt(0),ze={8:"b",9:"t",10:"n",12:"f",13:"r"}[re];return ze?"\\"+ze:"\\x"+(re<16?"0":"")+q.call(re.toString(16))}function qt(pe){return"Object("+pe+")"}function $e(pe){return pe+" { ? }"}function Rt(pe,re,ze,st){var Ke=st?Lr(ze,st):ue.call(ze,", ");return pe+" ("+re+") {"+Ke+"}"}function zt(pe){for(var re=0;re<pe.length;re++)if(It(pe[re],`
|
351
|
+
`)),Object.keys(or).length>0&&Le.formatText(0,ir.length,or);const dr=Math.min(K.index+ls(Wt),ir.length);Le.setSelection(dr,0),St=ir}else St=$t})},Ct=Ne=>{(Ne.inputType==="insertLineBreak"||Ne.inputType==="insertText"&&Ne.data&&/[\r\n\u2028\u2029]/.test(Ne.data))&&Ne.preventDefault()},vt=()=>{ar(nr)};pe(Le.root,"keydown",Bt),pe(Le.root,"paste",Ye),pe(Le.root,"beforeinput",Ct),Le.on("text-change",vt),Ft.push(()=>{pe(Le.root,"keydown",Bt),pe(Le.root,"paste",Ye),pe(Le.root,"beforeinput",Ct),Le.off("text-change",vt),mt&&window.cancelAnimationFrame(mt)}),ar(nr)}else{const Bt=()=>{const Ne=Le.getText();if(ls(Ne)-1<=Q)return;const K=Le.getSelection(),Fe=Le.getContents();Nt=K?K.index:0;let rt=0,bt=0;for(const Et of Fe.ops||[])if(typeof Et.insert=="string"){const $t=Array.from(Et.insert);for(const ir of $t){if(rt>=Q)break;rt++,bt+=ir.length}if(rt>=Q)break}else Et.insert&&(rt+=1);const Wt=Ne.substring(0,bt);Le.setText(Wt);const Yt=Math.min(Nt,Wt.length);Le.setSelection(Yt,0)},nr=(Ne,wt)=>{const K=Le.getSelection();if(!K)return!0;const Fe=Le.getText(),rt=ls(Fe)-1,bt=K.length>0?ls(Fe.substring(K.index,K.index+K.length)):0,Wt=Q-(rt-bt);if(ls(wt)<=Wt)return!0;if(Ne.preventDefault(),Ne.type==="paste"){const Et=K.index,$t=Array.from(wt).slice(0,Wt).join(""),ir=new Gt;K.length?ir.retain(Et).delete(K.length):ir.retain(Et),ir.insert($t),Le.updateContents(ir,Ue.sources.USER),requestAnimationFrame(()=>{const or=Et+ls($t);or<=Le.getLength()&&Le.setSelection(or,0)})}return!1},Ye=()=>{ar(Bt)},Ct=Ne=>{Ne.inputType.startsWith("insert")&&nr(Ne,Ne.data||"")},vt=Ne=>{const wt=Ne.clipboardData;if(wt){const K=er(wt.getData("text/plain"));nr(Ne,K)}};Le.on("text-change",Ye),pe(Le.root,"beforeinput",Ct,{capture:!0}),pe(Le.root,"paste",vt,{capture:!0}),Ft.push(()=>{Le.off("text-change",Ye),pe(Le.root,"beforeinput",Ct,{capture:!0}),pe(Le.root,"paste",vt,{capture:!0}),mt&&window.cancelAnimationFrame(mt)})}return()=>Ft.forEach(Bt=>Bt())},[Q,le,e,pe]),st=E.useCallback(Ke=>{typeof i=="function"?i(Ke):i&&(i.current=Ke),Ke&&(re(Ke),ze(Ke))},[i,re,ze]);return m.jsx(ec,{helperText:C,wrapType:D,labelProps:{...x,style:{minHeight:_?20:void 0,marginBottom:_?4:0}},errorMessage:t,label:m.jsxs(Sn,{style:{gap:4},children:[_,!Q&&ue==="Top"&&xt]}),wrapProps:{...T,className:Pe.clsx(T==null?void 0:T.className,!ke&&Fn.AEditorWrapper),style:{...T==null?void 0:T.style,height:Te}},children:m.jsxs($r,{...ne,className:Pe.clsx(ne.className,Fn.AEditorContainer),style:{...w,height:Ve,minHeight:yt},children:[m.jsx(Sh,{...L,ref:st,className:Pe.clsx(L==null?void 0:L.className,Fn.AEditor,Fn[Tt],le&&"Title"),formats:le?J.FORMAT_TITLE:J.FORMAT_DEFAULT,modules:Dt,placeholder:h,readOnly:X,theme:"snow",value:ut,style:{...L==null?void 0:L.style,maxHeight:tt?tt+se:void 0,"--icon-size":`${H==="Med"?18:24}px`,"--editor-padding":le?"8px 12px":"12px","--toolbar-padding":`${_r}px`,"--content-height":le?"34px":Ee?`${Ee}px`:"100%","--content-max-height":tt?`${tt}px`:"100%","--default-text":`'${hn.AEditor.Default}'`,"--arrow-background":`url("data:image/svg+xml,${encodeURIComponent(Ns.renderToString(m.jsx(jr,{icon:"EditorArrow"})))}`,"--title-color-picker-width":le?"780px":"142px"},onChange:zt}),O&&m.jsxs(m.Fragment,{children:[m.jsx("div",{ref:et,className:Fn.Resizer,style:{height:ie,bottom:u&&!X?ge:0},onMouseDown:Rt}),it&&m.jsx("div",{className:Pe.clsx(Fn.Indicator,"NoSelect","Label1"),style:{height:ie,bottom:u&&!X?ge:0},children:`${Math.round(Ee)}px`})]}),m.jsx("div",{className:Pe.clsx(Fn.LimitContainer,"NoSelect"),style:{marginTop:ve,minHeight:be,display:!Q&&ue==="Bottom"?"flex":"none"},children:xt})]})})},(r,e)=>r.errorMessage===e.errorMessage&&r.type===e.type&&r.useValue===e.useValue&&r.useError===e.useError&&r.placeholder===e.placeholder&&r.readOnly===e.readOnly&&r.maxLength===e.maxLength&&r.contentHeight===e.contentHeight&&r.minHeight===e.minHeight&&r.maxHeight===e.maxHeight&&r.toolbarSize===e.toolbarSize&&r.toolbarType===e.toolbarType&&r.limitPosition===e.limitPosition&&r.editorClassName===e.editorClassName&&r.editorStyle===e.editorStyle),eN=E.memo(({calculateSize:r,error:e,htmlDelta:t,limit:n,useError:i,isReadonly:l})=>!i||l?null:m.jsxs(nl,{className:Fn.Limit,children:["(",m.jsx("span",{className:e?Fn.Error:void 0,children:Gc(r(t))})," / ",Gc(n),")"]}));function rh(r,e){Array.isArray(r)||(r=[r]);for(const t of r){if(e(t))return t;if(!t.children||t.children.length<1)continue;const n=rh(t.children,e);if(n)return n}}function cd(r,e){Array.isArray(r)||(r=[r]);for(const t of r)e(t),!(!t.children||t.children.length<1)&&cd(t.children,e)}function uS(r,e){Array.isArray(r)||(r=[r]);const t=[];return cd(r,(n,i)=>t.push(e(n,i))),t}function fS(r,e){Array.isArray(r)||(r=[r]);for(const t of r){if(!e(t))return!1;if(!(!t.children||t.children.length<1)&&!fS(t.children,e))return!1}return!0}function tN(r,e){Array.isArray(r)||(r=[r]);const t=[];return cd(r,(n,i)=>{e(n,i)&&t.push(n)}),t}function rN(r){Array.isArray(r)||(r=[r]);let e=0;return cd(r,()=>e++),e}function nN(r,e,t,n){if(n(e,t))return null;Array.isArray(r)||(r=[r]);const i=rh(r,u=>{var h;return(h=u.children)==null?void 0:h.some(g=>n(g,e))}),l=rh(r,u=>{var h;return(h=u.children)==null?void 0:h.some(g=>n(g,t))});if(i===void 0&&l===void 0){const u=r.findIndex(g=>n(g,e)),h=r.findIndex(g=>n(g,t));return r.splice(u,1),r.splice(h,0,e),[...r]}else if(i!==void 0&&l!==void 0&&n(i,l)&&i.children){const u=i.children.findIndex(g=>n(g,e)),h=i.children.findIndex(g=>n(g,t));return u===void 0||h===void 0?null:(i.children.splice(u,1),i.children.splice(h,0,e),i.children=[...i.children],[...r])}return null}function iN(r,e,t){const n=[],i=[...e];for(;i.length>0;){const l=i.shift();if(l&&!n.find(u=>t(u,l))&&(n.push(l),!(!l.children||l.children.length<1)))for(const u of l.children)i.push(u)}return n}function oN(r,e,t){Array.isArray(r)||(r=[r]);const n=uS(r,u=>u),i=[],l=[...e];for(;l.length>0;){const u=l.shift();if(!u||i.find(g=>t(g,u)))continue;i.push(u);const h=n.find(g=>{var v;return(v=g.children)==null?void 0:v.some(L=>t(L,u))});h&&l.push(h)}return i}const tl={find:rh,forEach:cd,map:uS,every:fS,filter:tN,length:rN,replace:nN,descendants:iN,ancestors:oN},sN="_AWrap_f5le3_1",aN="_AContainer_f5le3_10",lN="_ATree_f5le3_18",cN="_ATreeBody_f5le3_30",uN="_CoverBorder_f5le3_36",fN="_InsertBorder_f5le3_45",dN="_ATreeHeader_f5le3_76",hN="_ATreeBodyHeader_f5le3_82",pN="_ATreeBodyHeaderResources_f5le3_92",gN="_ATreeItem_f5le3_98",mN="_IsSelectUsed_f5le3_114",vN="_IsSelected_f5le3_117",yN="_IsSearchSelected_f5le3_122",bN="_IsHovered_f5le3_133",_N="_CheckBox_f5le3_137",xN="_Indents_f5le3_149",SN="_ExpandIcon_f5le3_156",CN="_Content_f5le3_168",wN="_RightSticky_f5le3_177",AN="_SearchInputWrap_f5le3_188",TN="_SearchInput_f5le3_188",EN="_RightAddon_f5le3_200",kN="_RightAddonIcon_f5le3_211",RN="_Loader_f5le3_218",dn={AWrap:sN,AContainer:aN,ATree:lN,ATreeBody:cN,CoverBorder:uN,InsertBorder:fN,ATreeHeader:dN,ATreeBodyHeader:hN,ATreeBodyHeaderResources:pN,ATreeItem:gN,IsSelectUsed:mN,IsSelected:vN,IsSearchSelected:yN,IsHovered:bN,CheckBox:_N,Indents:xN,ExpandIcon:SN,Content:CN,RightSticky:wN,SearchInputWrap:AN,SearchInput:TN,RightAddon:EN,RightAddonIcon:kN,Loader:RN},IN=r=>{const{isEqual:e,item:t,selectDisabled:n,selectUnused:i,isParentDisabled:l,indents:u,extIndents:h,useExpand:g,useSelect:v,useSearch:L,onDragStart:T,onDragOver:C,onDragEnd:_,showCheckbox:x,icons:D,iconWidth:w,isSelectMulti:b,isDraggable:R,isParentCheckHovered:O,hoverdItem:q,onMouseOver:H,onMouseLeave:z,ContentRenderer:Y,TreeItemRenderer:ue,RightStickyAddon:Q,resources:de,containerRef:j,TreeItemStyle:ne,TreeItemClassName:J,searchItemStyle:X,searchItemClassName:ie,height:fe}=r,{children:ye}=E.useMemo(()=>t,[t]),[se,be]=E.useMemo(()=>g,[g]),[ve,ge]=E.useMemo(()=>v,[v]),[Ee,Oe]=E.useMemo(()=>L,[L]),Xe=E.useMemo(()=>i?i(t):!1,[i,t]),Ae=E.useMemo(()=>!n||l?l:n(t),[n,l,t]),it=E.useMemo(()=>se.some($e=>e($e,t)),[se,e,t]),pt=E.useMemo(()=>!ye||ye.length<1?"noChild":it?"expanded":"collapsed",[ye,it]),et=E.useMemo(()=>{const $e=D[pt];return cm.includes($e)?m.jsx(jr,{style:{width:w,height:w},icon:$e}):$e},[D,w,pt]),Ze=E.useCallback($e=>{!be||pt==="noChild"||(be(it?se.filter(Rt=>!e(Rt,t)):[...se,t]),$e.stopPropagation())},[be,se,it,t,e,pt]),je=E.useMemo(()=>ve.some($e=>e($e,t)),[ve,e,t]),Ie=E.useCallback(()=>{!ge||Ae||(ge(b?je?ve.filter($e=>!e($e,t)):[...ve,t]:[t]),Ee&&Oe&&Ee.items.some($e=>e($e,t))&&Oe({...Ee,item:t}))},[b,Ae,je,Ee,Oe,ge,e,ve,t]),le=E.useMemo(()=>Ee==null?void 0:Ee.items.some($e=>e($e,t)),[Ee,e,t]),ke=E.useMemo(()=>le&&(Ee==null?void 0:Ee.item)&&e(Ee.item,t),[le,Ee,e,t]),Te=E.useRef(null);E.useEffect(()=>{setTimeout(()=>{if(ke&&Te.current&&j.current){const{top:$e,bottom:Rt}=Te.current.getBoundingClientRect(),{top:zt,bottom:_r}=j.current.getBoundingClientRect();($e<zt||Rt>_r)&&Te.current.scrollIntoView({behavior:"smooth",block:"center"})}},10)},[j,ke]);const[Ve,tt]=E.useState(!1),yt=E.useCallback(()=>!Ae&&tt(!0),[Ae]),Tt=E.useCallback(()=>!Ae&&tt(!1),[Ae]),_t=E.useMemo(()=>tl.map(t,$e=>$e).filter($e=>!(n!=null&&n($e))&&!(i!=null&&i($e))),[n,i,t]),It=E.useMemo(()=>!x||!b?!1:je&&_t.some($e=>ve.some(Rt=>e($e,Rt)))&&_t.some($e=>!ve.some(Rt=>e($e,Rt))),[x,b,je,_t,e,ve]),Lt=E.useMemo(()=>x?b?_t.every($e=>ve.some(Rt=>e($e,Rt))):ve.some($e=>e($e,t)):!1,[x,b,_t,t,e,ve]),ft=E.useCallback(()=>{if(!(!ge||Ae))if(b)if(je){const $e=ve.filter(Rt=>!(i!=null&&i(Rt))&&!(n!=null&&n(Rt))&&_t.some(zt=>e(zt,Rt)));$e.length>0&&ge(ve.filter(Rt=>!$e.some(zt=>e(Rt,zt))))}else{const $e=_t.filter(Rt=>!(i!=null&&i(Rt))&&!(n!=null&&n(Rt))&&!ve.some(zt=>e(zt,Rt)));$e.length>0&&ge([...ve,...$e])}else ge([t])},[Ae,n,i,b,ge,e,je,ve,_t,t]),ut=E.useCallback($e=>{Ae||ft(),$e.stopPropagation()},[Ae,ft]),kt=E.useMemo(()=>{if(!x||!b||Ae)return"";if(je){const Rt=ve.filter(zt=>!(i!=null&&i(zt))&&!(n!=null&&n(zt))&&_t.some(_r=>e(_r,zt)));if(Rt.length>0)return de["deselect n"](Rt.length)}const $e=_t.filter(Rt=>!(i!=null&&i(Rt))&&!(n!=null&&n(Rt))&&!ve.some(zt=>e(zt,Rt)));return de["select n"]($e.length)},[n,i,de,Ae,x,b,je,_t,e,ve]),Me=E.useMemo(()=>Ir.getContent(Q,r),[Q,r]),ht=E.useMemo(()=>Ir.getContent(ne,r),[r,ne]),xt=E.useMemo(()=>Ir.getContent(J,r),[r,J]),Dt=E.useMemo(()=>Ir.getContent(ie,r),[r,ie]),qt=E.useMemo(()=>Ir.getContent(X,r),[r,X]);return m.jsxs(E.Fragment,{children:[m.jsxs($r,{className:Pe.clsx(dn.ATreeItem,je&&dn.IsSelected,!Ae&&(Ve||O)&&dn.IsHovered,le&&dn.IsSearched,ke&&(Dt||dn.IsSearchSelected),!Xe&&dn.IsSelectUsed,"NoSelect",xt),style:{...ht,...ke&&qt,"--ATreeItem_height":`${fe}px`},draggable:R,onDragStart:()=>T==null?void 0:T(t),onDragEnter:$e=>C==null?void 0:C($e,t),onDragEnd:$e=>_==null?void 0:_($e,t),onClick:Ie,abaseRef:Te,isDisabled:Ae,onMouseOver:$e=>H==null?void 0:H($e,t),onMouseLeave:$e=>z==null?void 0:z($e,t),children:[x&&m.jsx(Gu,{style:{visibility:Ae||Xe?"hidden":"visible",zIndex:Ae||Xe?0:2},className:dn.CheckBox,useCheck:[+Lt,ft],onClick:ut,isIndeterminate:It,onMouseOver:yt,onMouseOut:Tt,tooltip:kt,isDisabled:Ae}),m.jsx("div",{className:dn.Indents,style:{paddingLeft:x?0:r.icons.noChild?12:0},children:u.map(($e,Rt)=>{const zt=Rt===u.length-1;return m.jsx(D2,{value:$e,map:{Collapsed:h?h({iconWidth:w}).collapsed:m.jsx(MN,{iconWidth:w}),Expanded:h?h({iconWidth:w,isLast:zt}).expanded:m.jsx(LN,{iconWidth:w,isLast:zt}),IsLast:h?h({iconWidth:w}).isLast:m.jsx(DN,{iconWidth:w})}},Rt)})}),et&&m.jsx("div",{className:dn.ExpandIcon,style:{width:w,minWidth:w,maxWidth:w},onClick:Ze,children:et}),m.jsx("div",{className:Pe.clsx(dn.Content,"NoSelect"),children:m.jsx(Y,{isEqual:e,item:t,indents:u,extIndents:h,useExpand:g,useSelect:v,useSearch:L,onDragStart:T,onDragOver:C,onDragEnd:_,showCheckbox:x,icons:D,iconWidth:w,isSelectMulti:b,isDraggable:R,isParentCheckHovered:b&&(Ve||O),hoverdItem:q,onMouseOver:H,onMouseLeave:z,ContentRenderer:Y,TreeItemRenderer:ue,RightStickyAddon:Q,resources:de,containerRef:j,TreeItemStyle:ne,TreeItemClassName:J,searchItemClassName:Dt,searchItemStyle:X,height:fe})}),Me&&m.jsx("div",{className:dn.RightSticky,children:Me})]}),it&&(ye==null?void 0:ye.map(($e,Rt)=>m.jsx(ue,{isEqual:e,item:$e,selectDisabled:n,selectUnused:i,indents:[...u.map(zt=>zt==="IsLast"?"Collapsed":zt),Rt===ye.length-1?"IsLast":"Expanded"],extIndents:h,ContentRenderer:Y,useExpand:g,useSelect:v,useSearch:L,onDragStart:T,onDragOver:C,onDragEnd:_,showCheckbox:x,icons:D,iconWidth:w,isSelectMulti:b,isDraggable:R,isParentCheckHovered:b&&(Ve||O),hoverdItem:q,onMouseOver:H,onMouseLeave:z,TreeItemRenderer:ue,RightStickyAddon:Q,resources:de,containerRef:j,TreeItemStyle:ne,TreeItemClassName:J,searchItemClassName:Dt,searchItemStyle:X,height:fe},Rt)))]})},LN=({iconWidth:r,isLast:e})=>m.jsx("div",{style:{width:r/8*3,height:"100%",borderLeft:"var(--ATree_Indent_border)",marginLeft:r/2,marginRight:r/8,boxSizing:"border-box",transition:"border-color var(--Transition)"},children:e&&m.jsx("div",{style:{borderBottom:"var(--ATree_Indent_border)",height:"50%",transition:"border-color var(--Transition)"}})}),MN=({iconWidth:r})=>m.jsx("div",{style:{width:r,height:"100%",borderLeft:"none",marginLeft:0,transition:"border-color var(--Transition)"}}),DN=({iconWidth:r})=>m.jsx("div",{style:{width:r/8*3,height:"50%",borderLeft:"var(--ATree_Indent_border)",borderBottom:"var(--ATree_Indent_border)",marginLeft:r/2,marginRight:r/8,boxSizing:"border-box",transition:"border-color var(--Transition)"}}),ON=r=>{const{isEqual:e,searchResult:t,initSearch:n,searchUp:i,searchDown:l,searchEnter:u,isDisabled:h,isLoading:g,resources:v,maxLength:L,autoFocus:T}=r,C=E.useCallback(D=>{D.key==="Enter"?u():D.key==="ArrowDown"?l():D.key==="ArrowUp"&&i(),D.preventDefault(),D.stopPropagation()},[l,u,i]),_=E.useCallback(D=>{n(D)},[n]),x=E.useMemo(()=>h||g?-1:void 0,[h,g]);return m.jsx(tc,{className:dn.SearchInput,wrapProps:{className:dn.SearchInputWrap},isDisabled:h,tabIndex:x,useValue:[(t==null?void 0:t.keyword)??"",_],onKeyDown:C,placeholder:v["Search(Placeholder)"],RightAddon:m.jsx(PN,{isEqual:e,searchResult:t,searchUp:i,searchDown:l,searchEnter:u,resources:v}),maxLength:L,autoFocus:T})},PN=r=>{const{isEqual:e,searchResult:t,searchUp:n,searchDown:i,searchEnter:l,resources:u}=r,h=E.useMemo(()=>!t||t.items.length<1?0:t.items.findIndex(x=>t.item&&e(x,t.item))+1,[t,e]),g=E.useMemo(()=>!t||t.items.length<1?0:t.items.length,[t]),v=E.useMemo(()=>h<2,[h]),L=E.useMemo(()=>h>=g,[h,g]),T=E.useCallback(x=>{x.stopPropagation(),!v&&n()},[n,v]),C=E.useCallback(x=>{x.stopPropagation(),!L&&i()},[i,L]),_=E.useCallback(x=>{x.stopPropagation(),l()},[l]);return m.jsx("div",{className:Pe.clsx(dn.RightAddon,"NoSelect"),children:t?m.jsxs(m.Fragment,{children:[h,"/",g,m.jsx($r,{onClick:T,isDisabled:v,children:m.jsx(jr,{className:dn.RightAddonIcon,icon:"ArrowUp",mask:""})}),m.jsx($r,{onClick:C,isDisabled:L,children:m.jsx(jr,{className:dn.RightAddonIcon,icon:"ArrowDown"})})]}):m.jsx(xi,{type:"Raw",className:dn.RightAddonIcon,style:{marginRight:4},icon:"Search",onClick:_,tooltip:u["Search(Button)"]})})},NN=r=>{var nr;const{pk:e,selectDisabled:t,selectUnused:n,useItems:i,useExpand:l,useSelect:u,useSearch:h,showCheckbox:g,iconWidth:v=24,icons:L={noChild:"Folder",collapsed:"FolderCopy",expanded:"FolderOpen"},indents:T,isSelectMulti:C=!1,noSearch:_=!1,isDraggable:x,noSyncSearchSelect:D=!1,actionRef:w,placeholder:b,searchPredicate:R=jN,isDisabled:O,isLoading:q,ContentRenderer:H=FN,TreeItemRenderer:z=IN,RightStickyAddon:Y,TopRightAddon:ue,TreeTopAddon:Q,resources:de,maxLength:j,autoFocus:ne,TreeItemStyle:J,TreeItemClassName:X,OverflowPadding:ie,insertBorder:fe,width:ye,searchItemClassName:se,searchItemStyle:be,height:ve=40,...ge}=r,Ee=E.useMemo(()=>({...hn.ATree,...de}),[de]),Oe=E.useCallback((Ye,Ct)=>e!==void 0?Array.isArray(e)?e.every(vt=>rl.isEqual(Ye[vt],Ct[vt])):rl.isEqual(Ye[e],Ct[e]):rl.isEqual(Ye,Ct),[e]),Xe=E.useRef(null),[Ae,it]=cn(i,[]),pt=E.useMemo(()=>tl.map(Ae,Ye=>Ye),[Ae]),[et,Ze]=cn(l,[]),[je,Ie]=cn(u,[]),[le,ke]=cn(h,void 0),Te=E.useCallback(Ye=>{if(O||!Ze||et.some(Ne=>Oe(Ne,Ye)))return;const Ct=[];let vt=Ye;for(;vt;){const Ne=vt;et.find(wt=>Oe(wt,Ne))||Ct.push(Ne),vt=pt.find(wt=>{var K;return(K=wt.children)==null?void 0:K.some(Fe=>Oe(Fe,Ne))})}Ze([...et,...Ct])},[et,O,Oe,Ze,pt]),Ve=E.useCallback(()=>{!Ze||O||Ze([...pt])},[pt,O,Ze]),tt=E.useCallback(()=>{!Ze||O||Ze([])},[Ze,O]),yt=E.useCallback(Ye=>{!Ie||O||n!=null&&n(Ye)||(Ie([Ye]),Te(Ye))},[Ie,O,n,Te]),Tt=E.useCallback(Ye=>{if(!ke||O)return;if(!Ye||_){ke(void 0),D||Ie==null||Ie([]);return}const Ct=tl.filter(Ae,Ne=>R(Ye,Ne));let vt;if(Ct.find(Ne=>(le==null?void 0:le.item)&&Oe(Ne,le.item))?vt=le==null?void 0:le.item:Ct.length>0&&(vt=Ct[0]),ke({keyword:Ye,items:Ct,item:vt}),vt&&Te(vt),Ie&&!D)if(C)Ie(Ct);else{const Ne=Ct.find(wt=>vt&&Oe(wt,vt));Ie(Ne?[Ne]:[])}},[Ae,O,Oe,R,ke,Ie,Te,D,_,C,le]),_t=E.useRef(!1);E.useEffect(()=>{_t.current=!0},[Ae]),E.useEffect(()=>{le&&_t.current&&(Tt(le.keyword),_t.current=!1)},[Tt,le]);const It=E.useCallback(()=>{if(!le||!ke||O)return;let Ye=le.items.findIndex(Ct=>le.item&&Oe(Ct,le.item))-1;Ye<0||(ke({...le,item:le.items[Ye]}),Te(le.items[Ye]),D||yt(le.items[Ye]))},[le,Te,ke,O,yt,Oe,D]),Lt=E.useCallback(()=>{if(!le||!ke||O)return;let Ye=le.items.findIndex(Ct=>le.item&&Oe(Ct,le.item))+1;Ye>=le.items.length||(ke({...le,item:le.items[Ye]}),Te(le.items[Ye]),D||yt(le.items[Ye]))},[le,Te,O,ke,yt,Oe,D]),ft=E.useCallback(()=>{if(!le||!ke||O)return;let Ye=le.items.findIndex(vt=>le.item&&Oe(vt,le.item));if(!D||n!=null&&n(le.items[Ye])){Lt();return}if(je.some(vt=>le.item&&Oe(vt,le.item))){let vt=Ye+1;const Ne=le.items[vt];if(vt>=le.items.length)return;ke({...le,item:Ne}),yt(Ne)}else yt(le.items[Ye])},[le,ke,O,je,D,Lt,Oe,yt,n]),[ut,kt]=E.useState(!1),Me=E.useCallback(()=>kt(!0),[]),ht=E.useCallback(()=>kt(!1),[]),xt=E.useMemo(()=>n?tl.map(Ae,Ye=>Ye).filter(Ye=>!n(Ye)):t?tl.map(Ae,Ye=>Ye).filter(Ye=>!t(Ye)):tl.map(Ae,Ye=>Ye),[n,t,Ae]),Dt=E.useMemo(()=>!g||!C?!1:je.length>0&&xt.length>je.length,[g,C,je,xt]),qt=E.useMemo(()=>!g||!C?!1:je.length>0&&xt.length===je.length,[g,C,je,xt]),$e=E.useCallback(()=>{if(!Ie||!C||O)return;const Ye=je.filter(Ct=>!(n!=null&&n(Ct))&&!(t!=null&&t(Ct))&&xt.some(vt=>Oe(vt,Ct)));if(Ye.length>0)Ie(je.filter(Ct=>!Ye.some(vt=>Oe(Ct,vt))));else{const Ct=xt.filter(vt=>!(n!=null&&n(vt))&&!(t!=null&&t(vt))&&!je.some(Ne=>Oe(Ne,vt)));Ct.length>0&&Ie([...je,...Ct])}},[C,O,n,t,Ie,je,xt,Oe]),Rt=E.useMemo(()=>{if(!g||!C||O)return"";const Ye=je.filter(Ct=>!(n!=null&&n(Ct))&&!(t!=null&&t(Ct))&&xt.some(vt=>Oe(vt,Ct)));if(Ye.length>0)return Ee["deselect n"](Ye.length);{const Ct=xt.filter(vt=>!(n!=null&&n(vt))&&!(t!=null&&t(vt))&&!je.some(Ne=>Oe(Ne,vt)));return Ee["select n"](Ct.length)}},[n,t,O,Ee,g,C,xt,je,Oe]),[zt,_r]=E.useState(null),[Lr,Cr]=E.useState(null),pe=E.useCallback(Ye=>{!x||O||_r(Ye)},[O,x]),re=E.useCallback((Ye,Ct)=>{if(!x||O||!zt||(Ye.preventDefault(),Ye.stopPropagation(),Cr(Ct),!it))return;const vt=tl.replace(Ae,zt,Ct,Oe);vt&&it(vt)},[x,Ae,zt,O,it,Oe]),ze=E.useCallback(()=>{if(!x||O||!zt||!Lr||!it||Oe(zt,Lr))return;const Ye=tl.replace(Ae,zt,Lr,Oe);Ye&&(it(Ye),_r(null))},[x,it,Ae,zt,Lr,Oe,O]);E.useEffect(()=>{var Ye;g||(Ye=Xe.current)==null||Ye.scrollTo(0,0)},[g,Xe]),E.useEffect(()=>{!C&&je.length>1&&(Ie==null||Ie([je[je.length-1]]))},[C,Ie,je]),E.useEffect(()=>{w&&(w.current={expandAll:Ve,collapseAll:tt})},[w,Ve,tt]),E.useEffect(()=>{if(!t||!Ie)return;const Ye=je.filter(Ct=>!t(Ct));je.length!==Ye.length&&Ie(Ye)},[t,je,Ie]),E.useEffect(()=>{if(!n||!Ie)return;const Ye=je.filter(Ct=>!n(Ct));je.length!==Ye.length&&Ie(Ye)},[n,je,Ie]),E.useEffect(()=>{ke&&ke(void 0)},[ke]);const[st,Ke]=E.useState(!1);E.useEffect(()=>{Ke(Ye=>!Ye)},[Ae]);const[Le,dt]=E.useState(null),St=E.useCallback((Ye,Ct)=>{O||(Ye.stopPropagation(),Ye.preventDefault(),dt(Ct))},[O]),mt=E.useCallback((Ye,Ct)=>{Le===null||O||Oe(Ct,Le)&&(Ye.stopPropagation(),Ye.preventDefault(),dt(null))},[Le,O,Oe]),Nt=E.useRef(null),[er,ar]=E.useState(!1),[Ft,Bt]=E.useState((nr=Nt.current)==null?void 0:nr.scrollHeight);return E.useEffect(()=>{if(et.length<0)return;const Ye=Xe.current,Ct=Nt.current,vt=Ye.clientHeight<Ct.clientHeight;Bt(vt?Ct.scrollHeight:Ye.clientHeight),ar(vt)},[et]),m.jsxs($r,{...ge,isDisabled:O,className:Pe.clsx(ge.className,dn.AWrap),children:[(!_||ue)&&m.jsxs(Sn,{className:dn.ATreeHeader,children:[!_&&m.jsx(ON,{isEqual:Oe,searchResult:le,initSearch:Tt,searchUp:It,searchDown:Lt,searchEnter:ft,isLoading:q,isDisabled:O,resources:Ee,maxLength:j,autoFocus:ne}),!_&&ue&&m.jsx(mn,{w:8}),ue]}),(!_||ue||g&&C||x)&&m.jsx(mm,{isLoading:q&&Ae.length!==0}),(g&&C||x)&&m.jsxs("div",{className:Pe.clsx(dn.ATreeBodyHeader,"NoSelect"),children:[g&&m.jsx(Gu,{className:dn.CheckBox,useCheck:[+qt,()=>$e()],isIndeterminate:Dt,onMouseOver:Me,onMouseOut:ht,isDisabled:O,tooltip:Rt}),Ee.Items,m.jsx(Jc,{}),m.jsxs("div",{className:Pe.clsx(dn.ATreeBodyHeaderResources,"NoSelect"),style:{marginRight:er?8:0},children:[m.jsx("span",{children:g&&Ee["*Click row for single select"]}),m.jsx("span",{children:x&&Ee["*Change order to row drag"]})]})]}),m.jsx("div",{ref:Xe,className:Pe.clsx(ge.className,dn.AContainer),children:m.jsxs("div",{className:dn.ATree,style:{minWidth:ye||"fit-content",marginRight:ie&&er?8:0},children:[m.jsxs("div",{ref:Nt,className:dn.ATreeBody,children:[Ae.length===0?q?m.jsx(BN,{text:Ee["Loading Contents..."]}):b:Q,Ae.map((Ye,Ct)=>m.jsx(z,{isEqual:Oe,indents:[],extIndents:T,item:Ye,selectDisabled:t,selectUnused:n,isParentDisabled:O,useExpand:[et,Ze],useSelect:[je,Ie],useSearch:[le,ke],onDragStart:pe,onDragOver:re,onDragEnd:ze,showCheckbox:g,icons:L,iconWidth:v,isSelectMulti:C,isDraggable:x,isParentCheckHovered:C&&ut,ContentRenderer:H,TreeItemRenderer:z,RightStickyAddon:Y,resources:Ee,containerRef:Xe,TreeItemStyle:J,TreeItemClassName:X,hoverdItem:Le,onMouseOver:St,onMouseLeave:mt,searchItemClassName:se,searchItemStyle:be,height:ve},`${Ct}${st}`))]}),fe&&m.jsxs(m.Fragment,{children:[m.jsx("div",{className:dn.CoverBorder}),m.jsx("div",{className:dn.InsertBorder,style:{"--InsertBorder_height":`${ve}px`,height:er?Ft:"100%"}})]})]})})]})},FN=r=>{const{item:e}=r,t={};return tr.keys(e).forEach(n=>{n!=="children"&&(t[n]=e[n])}),JSON.stringify(t)};function jN(r,e){return tr.some(e,(t,n)=>{var i;return(i=tr.stringify(n))==null?void 0:i.toLowerCase().includes(r.toLowerCase())})}const BN=r=>{const{text:e}=r;return m.jsxs(Sn,{className:Pe.clsx(dn.Loader,"NoSelect"),children:[m.jsx(jr,{icon:"Spinner",style:{height:40},height:40,width:40}),m.jsx(U2,{text:e})]})};var Gg,Yb;function rf(){return Yb||(Yb=1,Gg=TypeError),Gg}const HN={},qN=Object.freeze(Object.defineProperty({__proto__:null,default:HN},Symbol.toStringTag,{value:"Module"})),zN=t4(qN);var Zg,Xb;function Ch(){if(Xb)return Zg;Xb=1;var r=typeof Map=="function"&&Map.prototype,e=Object.getOwnPropertyDescriptor&&r?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,t=r&&e&&typeof e.get=="function"?e.get:null,n=r&&Map.prototype.forEach,i=typeof Set=="function"&&Set.prototype,l=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,u=i&&l&&typeof l.get=="function"?l.get:null,h=i&&Set.prototype.forEach,g=typeof WeakMap=="function"&&WeakMap.prototype,v=g?WeakMap.prototype.has:null,L=typeof WeakSet=="function"&&WeakSet.prototype,T=L?WeakSet.prototype.has:null,C=typeof WeakRef=="function"&&WeakRef.prototype,_=C?WeakRef.prototype.deref:null,x=Boolean.prototype.valueOf,D=Object.prototype.toString,w=Function.prototype.toString,b=String.prototype.match,R=String.prototype.slice,O=String.prototype.replace,q=String.prototype.toUpperCase,H=String.prototype.toLowerCase,z=RegExp.prototype.test,Y=Array.prototype.concat,ue=Array.prototype.join,Q=Array.prototype.slice,de=Math.floor,j=typeof BigInt=="function"?BigInt.prototype.valueOf:null,ne=Object.getOwnPropertySymbols,J=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,X=typeof Symbol=="function"&&typeof Symbol.iterator=="object",ie=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===X||!0)?Symbol.toStringTag:null,fe=Object.prototype.propertyIsEnumerable,ye=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(pe){return pe.__proto__}:null);function se(pe,re){if(pe===1/0||pe===-1/0||pe!==pe||pe&&pe>-1e3&&pe<1e3||z.call(/e/,re))return re;var ze=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof pe=="number"){var st=pe<0?-de(-pe):de(pe);if(st!==pe){var Ke=String(st),Le=R.call(re,Ke.length+1);return O.call(Ke,ze,"$&_")+"."+O.call(O.call(Le,/([0-9]{3})/g,"$&_"),/_$/,"")}}return O.call(re,ze,"$&_")}var be=zN,ve=be.custom,ge=Te(ve)?ve:null,Ee={__proto__:null,double:'"',single:"'"},Oe={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};Zg=function pe(re,ze,st,Ke){var Le=ze||{};if(yt(Le,"quoteStyle")&&!yt(Ee,Le.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(yt(Le,"maxStringLength")&&(typeof Le.maxStringLength=="number"?Le.maxStringLength<0&&Le.maxStringLength!==1/0:Le.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var dt=yt(Le,"customInspect")?Le.customInspect:!0;if(typeof dt!="boolean"&&dt!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(yt(Le,"indent")&&Le.indent!==null&&Le.indent!==" "&&!(parseInt(Le.indent,10)===Le.indent&&Le.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(yt(Le,"numericSeparator")&&typeof Le.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var St=Le.numericSeparator;if(typeof re>"u")return"undefined";if(re===null)return"null";if(typeof re=="boolean")return re?"true":"false";if(typeof re=="string")return xt(re,Le);if(typeof re=="number"){if(re===0)return 1/0/re>0?"0":"-0";var mt=String(re);return St?se(re,mt):mt}if(typeof re=="bigint"){var Nt=String(re)+"n";return St?se(re,Nt):Nt}var er=typeof Le.depth>"u"?5:Le.depth;if(typeof st>"u"&&(st=0),st>=er&&er>0&&typeof re=="object")return pt(re)?"[Array]":"[Object]";var ar=_r(Le,st);if(typeof Ke>"u")Ke=[];else if(It(Ke,re)>=0)return"[Circular]";function Ft(or,dr,Ur){if(dr&&(Ke=Q.call(Ke),Ke.push(dr)),Ur){var vr={depth:Le.depth};return yt(Le,"quoteStyle")&&(vr.quoteStyle=Le.quoteStyle),pe(or,vr,st+1,Ke)}return pe(or,Le,st+1,Ke)}if(typeof re=="function"&&!Ze(re)){var Bt=_t(re),nr=Cr(re,Ft);return"[Function"+(Bt?": "+Bt:" (anonymous)")+"]"+(nr.length>0?" { "+ue.call(nr,", ")+" }":"")}if(Te(re)){var Ye=X?O.call(String(re),/^(Symbol\(.*\))_[^)]*$/,"$1"):J.call(re);return typeof re=="object"&&!X?qt(Ye):Ye}if(ht(re)){for(var Ct="<"+H.call(String(re.nodeName)),vt=re.attributes||[],Ne=0;Ne<vt.length;Ne++)Ct+=" "+vt[Ne].name+"="+Xe(Ae(vt[Ne].value),"double",Le);return Ct+=">",re.childNodes&&re.childNodes.length&&(Ct+="..."),Ct+="</"+H.call(String(re.nodeName))+">",Ct}if(pt(re)){if(re.length===0)return"[]";var wt=Cr(re,Ft);return ar&&!zt(wt)?"["+Lr(wt,ar)+"]":"[ "+ue.call(wt,", ")+" ]"}if(je(re)){var K=Cr(re,Ft);return!("cause"in Error.prototype)&&"cause"in re&&!fe.call(re,"cause")?"{ ["+String(re)+"] "+ue.call(Y.call("[cause]: "+Ft(re.cause),K),", ")+" }":K.length===0?"["+String(re)+"]":"{ ["+String(re)+"] "+ue.call(K,", ")+" }"}if(typeof re=="object"&&dt){if(ge&&typeof re[ge]=="function"&&be)return be(re,{depth:er-st});if(dt!=="symbol"&&typeof re.inspect=="function")return re.inspect()}if(Lt(re)){var Fe=[];return n&&n.call(re,function(or,dr){Fe.push(Ft(dr,re,!0)+" => "+Ft(or,re))}),Rt("Map",t.call(re),Fe,ar)}if(kt(re)){var rt=[];return h&&h.call(re,function(or){rt.push(Ft(or,re))}),Rt("Set",u.call(re),rt,ar)}if(ft(re))return $e("WeakMap");if(Me(re))return $e("WeakSet");if(ut(re))return $e("WeakRef");if(le(re))return qt(Ft(Number(re)));if(Ve(re))return qt(Ft(j.call(re)));if(ke(re))return qt(x.call(re));if(Ie(re))return qt(Ft(String(re)));if(typeof window<"u"&&re===window)return"{ [object Window] }";if(typeof globalThis<"u"&&re===globalThis||typeof _i<"u"&&re===_i)return"{ [object globalThis] }";if(!et(re)&&!Ze(re)){var bt=Cr(re,Ft),Wt=ye?ye(re)===Object.prototype:re instanceof Object||re.constructor===Object,Yt=re instanceof Object?"":"null prototype",Et=!Wt&&ie&&Object(re)===re&&ie in re?R.call(Tt(re),8,-1):Yt?"Object":"",$t=Wt||typeof re.constructor!="function"?"":re.constructor.name?re.constructor.name+" ":"",ir=$t+(Et||Yt?"["+ue.call(Y.call([],Et||[],Yt||[]),": ")+"] ":"");return bt.length===0?ir+"{}":ar?ir+"{"+Lr(bt,ar)+"}":ir+"{ "+ue.call(bt,", ")+" }"}return String(re)};function Xe(pe,re,ze){var st=ze.quoteStyle||re,Ke=Ee[st];return Ke+pe+Ke}function Ae(pe){return O.call(String(pe),/"/g,""")}function it(pe){return!ie||!(typeof pe=="object"&&(ie in pe||typeof pe[ie]<"u"))}function pt(pe){return Tt(pe)==="[object Array]"&&it(pe)}function et(pe){return Tt(pe)==="[object Date]"&&it(pe)}function Ze(pe){return Tt(pe)==="[object RegExp]"&&it(pe)}function je(pe){return Tt(pe)==="[object Error]"&&it(pe)}function Ie(pe){return Tt(pe)==="[object String]"&&it(pe)}function le(pe){return Tt(pe)==="[object Number]"&&it(pe)}function ke(pe){return Tt(pe)==="[object Boolean]"&&it(pe)}function Te(pe){if(X)return pe&&typeof pe=="object"&&pe instanceof Symbol;if(typeof pe=="symbol")return!0;if(!pe||typeof pe!="object"||!J)return!1;try{return J.call(pe),!0}catch{}return!1}function Ve(pe){if(!pe||typeof pe!="object"||!j)return!1;try{return j.call(pe),!0}catch{}return!1}var tt=Object.prototype.hasOwnProperty||function(pe){return pe in this};function yt(pe,re){return tt.call(pe,re)}function Tt(pe){return D.call(pe)}function _t(pe){if(pe.name)return pe.name;var re=b.call(w.call(pe),/^function\s*([\w$]+)/);return re?re[1]:null}function It(pe,re){if(pe.indexOf)return pe.indexOf(re);for(var ze=0,st=pe.length;ze<st;ze++)if(pe[ze]===re)return ze;return-1}function Lt(pe){if(!t||!pe||typeof pe!="object")return!1;try{t.call(pe);try{u.call(pe)}catch{return!0}return pe instanceof Map}catch{}return!1}function ft(pe){if(!v||!pe||typeof pe!="object")return!1;try{v.call(pe,v);try{T.call(pe,T)}catch{return!0}return pe instanceof WeakMap}catch{}return!1}function ut(pe){if(!_||!pe||typeof pe!="object")return!1;try{return _.call(pe),!0}catch{}return!1}function kt(pe){if(!u||!pe||typeof pe!="object")return!1;try{u.call(pe);try{t.call(pe)}catch{return!0}return pe instanceof Set}catch{}return!1}function Me(pe){if(!T||!pe||typeof pe!="object")return!1;try{T.call(pe,T);try{v.call(pe,v)}catch{return!0}return pe instanceof WeakSet}catch{}return!1}function ht(pe){return!pe||typeof pe!="object"?!1:typeof HTMLElement<"u"&&pe instanceof HTMLElement?!0:typeof pe.nodeName=="string"&&typeof pe.getAttribute=="function"}function xt(pe,re){if(pe.length>re.maxStringLength){var ze=pe.length-re.maxStringLength,st="... "+ze+" more character"+(ze>1?"s":"");return xt(R.call(pe,0,re.maxStringLength),re)+st}var Ke=Oe[re.quoteStyle||"single"];Ke.lastIndex=0;var Le=O.call(O.call(pe,Ke,"\\$1"),/[\x00-\x1f]/g,Dt);return Xe(Le,"single",re)}function Dt(pe){var re=pe.charCodeAt(0),ze={8:"b",9:"t",10:"n",12:"f",13:"r"}[re];return ze?"\\"+ze:"\\x"+(re<16?"0":"")+q.call(re.toString(16))}function qt(pe){return"Object("+pe+")"}function $e(pe){return pe+" { ? }"}function Rt(pe,re,ze,st){var Ke=st?Lr(ze,st):ue.call(ze,", ");return pe+" ("+re+") {"+Ke+"}"}function zt(pe){for(var re=0;re<pe.length;re++)if(It(pe[re],`
|
352
352
|
`)>=0)return!1;return!0}function _r(pe,re){var ze;if(pe.indent===" ")ze=" ";else if(typeof pe.indent=="number"&&pe.indent>0)ze=ue.call(Array(pe.indent+1)," ");else return null;return{base:ze,prev:ue.call(Array(re+1),ze)}}function Lr(pe,re){if(pe.length===0)return"";var ze=`
|
353
353
|
`+re.prev+re.base;return ze+ue.call(pe,","+ze)+`
|
354
354
|
`+re.prev}function Cr(pe,re){var ze=pt(pe),st=[];if(ze){st.length=pe.length;for(var Ke=0;Ke<pe.length;Ke++)st[Ke]=yt(pe,Ke)?re(pe[Ke],pe):""}var Le=typeof ne=="function"?ne(pe):[],dt;if(X){dt={};for(var St=0;St<Le.length;St++)dt["$"+Le[St]]=Le[St]}for(var mt in pe)yt(pe,mt)&&(ze&&String(Number(mt))===mt&&mt<pe.length||X&&dt["$"+mt]instanceof Symbol||(z.call(/[^\w$]/,mt)?st.push(re(mt,pe)+": "+re(pe[mt],pe)):st.push(mt+": "+re(pe[mt],pe))));if(typeof ne=="function")for(var Nt=0;Nt<Le.length;Nt++)fe.call(pe,Le[Nt])&&st.push("["+re(Le[Nt])+"]: "+re(pe[Le[Nt]],pe));return st}return Zg}var Kg,Jb;function $N(){if(Jb)return Kg;Jb=1;var r=Ch(),e=rf(),t=function(h,g,v){for(var L=h,T;(T=L.next)!=null;L=T)if(T.key===g)return L.next=T.next,v||(T.next=h.next,h.next=T),T},n=function(h,g){if(h){var v=t(h,g);return v&&v.value}},i=function(h,g,v){var L=t(h,g);L?L.value=v:h.next={key:g,next:h.next,value:v}},l=function(h,g){return h?!!t(h,g):!1},u=function(h,g){if(h)return t(h,g,!0)};return Kg=function(){var g,v={assert:function(L){if(!v.has(L))throw new e("Side channel does not contain "+r(L))},delete:function(L){var T=g&&g.next,C=u(g,L);return C&&T&&T===C&&(g=void 0),!!C},get:function(L){return n(g,L)},has:function(L){return l(g,L)},set:function(L,T){g||(g={next:void 0}),i(g,L,T)}};return v},Kg}var Yg,Qb;function dS(){return Qb||(Qb=1,Yg=Object),Yg}var Xg,e_;function UN(){return e_||(e_=1,Xg=Error),Xg}var Jg,t_;function WN(){return t_||(t_=1,Jg=EvalError),Jg}var Qg,r_;function VN(){return r_||(r_=1,Qg=RangeError),Qg}var e1,n_;function GN(){return n_||(n_=1,e1=ReferenceError),e1}var t1,i_;function ZN(){return i_||(i_=1,t1=SyntaxError),t1}var r1,o_;function KN(){return o_||(o_=1,r1=URIError),r1}var n1,s_;function YN(){return s_||(s_=1,n1=Math.abs),n1}var i1,a_;function XN(){return a_||(a_=1,i1=Math.floor),i1}var o1,l_;function JN(){return l_||(l_=1,o1=Math.max),o1}var s1,c_;function QN(){return c_||(c_=1,s1=Math.min),s1}var a1,u_;function eF(){return u_||(u_=1,a1=Math.pow),a1}var l1,f_;function tF(){return f_||(f_=1,l1=Math.round),l1}var c1,d_;function rF(){return d_||(d_=1,c1=Number.isNaN||function(e){return e!==e}),c1}var u1,h_;function nF(){if(h_)return u1;h_=1;var r=rF();return u1=function(t){return r(t)||t===0?t:t<0?-1:1},u1}var f1,p_;function iF(){return p_||(p_=1,f1=Object.getOwnPropertyDescriptor),f1}var d1,g_;function hS(){if(g_)return d1;g_=1;var r=iF();if(r)try{r([],"length")}catch{r=null}return d1=r,d1}var h1,m_;function oF(){if(m_)return h1;m_=1;var r=Object.defineProperty||!1;if(r)try{r({},"a",{value:1})}catch{r=!1}return h1=r,h1}var p1,v_;function sF(){return v_||(v_=1,p1=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[t]=i;for(var l in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var u=Object.getOwnPropertySymbols(e);if(u.length!==1||u[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var h=Object.getOwnPropertyDescriptor(e,t);if(h.value!==i||h.enumerable!==!0)return!1}return!0}),p1}var g1,y_;function aF(){if(y_)return g1;y_=1;var r=typeof Symbol<"u"&&Symbol,e=sF();return g1=function(){return typeof r!="function"||typeof Symbol!="function"||typeof r("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},g1}var m1,b_;function pS(){return b_||(b_=1,m1=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),m1}var v1,__;function gS(){if(__)return v1;__=1;var r=dS();return v1=r.getPrototypeOf||null,v1}var y1,x_;function lF(){if(x_)return y1;x_=1;var r="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,t=Math.max,n="[object Function]",i=function(g,v){for(var L=[],T=0;T<g.length;T+=1)L[T]=g[T];for(var C=0;C<v.length;C+=1)L[C+g.length]=v[C];return L},l=function(g,v){for(var L=[],T=v,C=0;T<g.length;T+=1,C+=1)L[C]=g[T];return L},u=function(h,g){for(var v="",L=0;L<h.length;L+=1)v+=h[L],L+1<h.length&&(v+=g);return v};return y1=function(g){var v=this;if(typeof v!="function"||e.apply(v)!==n)throw new TypeError(r+v);for(var L=l(arguments,1),T,C=function(){if(this instanceof T){var b=v.apply(this,i(L,arguments));return Object(b)===b?b:this}return v.apply(g,i(L,arguments))},_=t(0,v.length-L.length),x=[],D=0;D<_;D++)x[D]="$"+D;if(T=Function("binder","return function ("+u(x,",")+"){ return binder.apply(this,arguments); }")(C),v.prototype){var w=function(){};w.prototype=v.prototype,T.prototype=new w,w.prototype=null}return T},y1}var b1,S_;function wh(){if(S_)return b1;S_=1;var r=lF();return b1=Function.prototype.bind||r,b1}var _1,C_;function zm(){return C_||(C_=1,_1=Function.prototype.call),_1}var x1,w_;function mS(){return w_||(w_=1,x1=Function.prototype.apply),x1}var S1,A_;function cF(){return A_||(A_=1,S1=typeof Reflect<"u"&&Reflect&&Reflect.apply),S1}var C1,T_;function uF(){if(T_)return C1;T_=1;var r=wh(),e=mS(),t=zm(),n=cF();return C1=n||r.call(t,e),C1}var w1,E_;function vS(){if(E_)return w1;E_=1;var r=wh(),e=rf(),t=zm(),n=uF();return w1=function(l){if(l.length<1||typeof l[0]!="function")throw new e("a function is required");return n(r,t,l)},w1}var A1,k_;function fF(){if(k_)return A1;k_=1;var r=vS(),e=hS(),t;try{t=[].__proto__===Array.prototype}catch(u){if(!u||typeof u!="object"||!("code"in u)||u.code!=="ERR_PROTO_ACCESS")throw u}var n=!!t&&e&&e(Object.prototype,"__proto__"),i=Object,l=i.getPrototypeOf;return A1=n&&typeof n.get=="function"?r([n.get]):typeof l=="function"?function(h){return l(h==null?h:i(h))}:!1,A1}var T1,R_;function dF(){if(R_)return T1;R_=1;var r=pS(),e=gS(),t=fF();return T1=r?function(i){return r(i)}:e?function(i){if(!i||typeof i!="object"&&typeof i!="function")throw new TypeError("getProto: not an object");return e(i)}:t?function(i){return t(i)}:null,T1}var E1,I_;function hF(){if(I_)return E1;I_=1;var r=Function.prototype.call,e=Object.prototype.hasOwnProperty,t=wh();return E1=t.call(r,e),E1}var k1,L_;function $m(){if(L_)return k1;L_=1;var r,e=dS(),t=UN(),n=WN(),i=VN(),l=GN(),u=ZN(),h=rf(),g=KN(),v=YN(),L=XN(),T=JN(),C=QN(),_=eF(),x=tF(),D=nF(),w=Function,b=function(Ze){try{return w('"use strict"; return ('+Ze+").constructor;")()}catch{}},R=hS(),O=oF(),q=function(){throw new h},H=R?function(){try{return arguments.callee,q}catch{try{return R(arguments,"callee").get}catch{return q}}}():q,z=aF()(),Y=dF(),ue=gS(),Q=pS(),de=mS(),j=zm(),ne={},J=typeof Uint8Array>"u"||!Y?r:Y(Uint8Array),X={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?r:ArrayBuffer,"%ArrayIteratorPrototype%":z&&Y?Y([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":ne,"%AsyncGenerator%":ne,"%AsyncGeneratorFunction%":ne,"%AsyncIteratorPrototype%":ne,"%Atomics%":typeof Atomics>"u"?r:Atomics,"%BigInt%":typeof BigInt>"u"?r:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?r:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":t,"%eval%":eval,"%EvalError%":n,"%Float16Array%":typeof Float16Array>"u"?r:Float16Array,"%Float32Array%":typeof Float32Array>"u"?r:Float32Array,"%Float64Array%":typeof Float64Array>"u"?r:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?r:FinalizationRegistry,"%Function%":w,"%GeneratorFunction%":ne,"%Int8Array%":typeof Int8Array>"u"?r:Int8Array,"%Int16Array%":typeof Int16Array>"u"?r:Int16Array,"%Int32Array%":typeof Int32Array>"u"?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":z&&Y?Y(Y([][Symbol.iterator]())):r,"%JSON%":typeof JSON=="object"?JSON:r,"%Map%":typeof Map>"u"?r:Map,"%MapIteratorPrototype%":typeof Map>"u"||!z||!Y?r:Y(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":e,"%Object.getOwnPropertyDescriptor%":R,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?r:Promise,"%Proxy%":typeof Proxy>"u"?r:Proxy,"%RangeError%":i,"%ReferenceError%":l,"%Reflect%":typeof Reflect>"u"?r:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?r:Set,"%SetIteratorPrototype%":typeof Set>"u"||!z||!Y?r:Y(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":z&&Y?Y(""[Symbol.iterator]()):r,"%Symbol%":z?Symbol:r,"%SyntaxError%":u,"%ThrowTypeError%":H,"%TypedArray%":J,"%TypeError%":h,"%Uint8Array%":typeof Uint8Array>"u"?r:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?r:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?r:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?r:Uint32Array,"%URIError%":g,"%WeakMap%":typeof WeakMap>"u"?r:WeakMap,"%WeakRef%":typeof WeakRef>"u"?r:WeakRef,"%WeakSet%":typeof WeakSet>"u"?r:WeakSet,"%Function.prototype.call%":j,"%Function.prototype.apply%":de,"%Object.defineProperty%":O,"%Object.getPrototypeOf%":ue,"%Math.abs%":v,"%Math.floor%":L,"%Math.max%":T,"%Math.min%":C,"%Math.pow%":_,"%Math.round%":x,"%Math.sign%":D,"%Reflect.getPrototypeOf%":Q};if(Y)try{null.error}catch(Ze){var ie=Y(Y(Ze));X["%Error.prototype%"]=ie}var fe=function Ze(je){var Ie;if(je==="%AsyncFunction%")Ie=b("async function () {}");else if(je==="%GeneratorFunction%")Ie=b("function* () {}");else if(je==="%AsyncGeneratorFunction%")Ie=b("async function* () {}");else if(je==="%AsyncGenerator%"){var le=Ze("%AsyncGeneratorFunction%");le&&(Ie=le.prototype)}else if(je==="%AsyncIteratorPrototype%"){var ke=Ze("%AsyncGenerator%");ke&&Y&&(Ie=Y(ke.prototype))}return X[je]=Ie,Ie},ye={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},se=wh(),be=hF(),ve=se.call(j,Array.prototype.concat),ge=se.call(de,Array.prototype.splice),Ee=se.call(j,String.prototype.replace),Oe=se.call(j,String.prototype.slice),Xe=se.call(j,RegExp.prototype.exec),Ae=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,it=/\\(\\)?/g,pt=function(je){var Ie=Oe(je,0,1),le=Oe(je,-1);if(Ie==="%"&&le!=="%")throw new u("invalid intrinsic syntax, expected closing `%`");if(le==="%"&&Ie!=="%")throw new u("invalid intrinsic syntax, expected opening `%`");var ke=[];return Ee(je,Ae,function(Te,Ve,tt,yt){ke[ke.length]=tt?Ee(yt,it,"$1"):Ve||Te}),ke},et=function(je,Ie){var le=je,ke;if(be(ye,le)&&(ke=ye[le],le="%"+ke[0]+"%"),be(X,le)){var Te=X[le];if(Te===ne&&(Te=fe(le)),typeof Te>"u"&&!Ie)throw new h("intrinsic "+je+" exists, but is not available. Please file an issue!");return{alias:ke,name:le,value:Te}}throw new u("intrinsic "+je+" does not exist!")};return k1=function(je,Ie){if(typeof je!="string"||je.length===0)throw new h("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof Ie!="boolean")throw new h('"allowMissing" argument must be a boolean');if(Xe(/^%?[^%]*%?$/,je)===null)throw new u("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var le=pt(je),ke=le.length>0?le[0]:"",Te=et("%"+ke+"%",Ie),Ve=Te.name,tt=Te.value,yt=!1,Tt=Te.alias;Tt&&(ke=Tt[0],ge(le,ve([0,1],Tt)));for(var _t=1,It=!0;_t<le.length;_t+=1){var Lt=le[_t],ft=Oe(Lt,0,1),ut=Oe(Lt,-1);if((ft==='"'||ft==="'"||ft==="`"||ut==='"'||ut==="'"||ut==="`")&&ft!==ut)throw new u("property names with quotes must have matching quotes");if((Lt==="constructor"||!It)&&(yt=!0),ke+="."+Lt,Ve="%"+ke+"%",be(X,Ve))tt=X[Ve];else if(tt!=null){if(!(Lt in tt)){if(!Ie)throw new h("base intrinsic for "+je+" exists, but the property is not available.");return}if(R&&_t+1>=le.length){var kt=R(tt,Lt);It=!!kt,It&&"get"in kt&&!("originalValue"in kt.get)?tt=kt.get:tt=tt[Lt]}else It=be(tt,Lt),tt=tt[Lt];It&&!yt&&(X[Ve]=tt)}}return tt},k1}var R1,M_;function yS(){if(M_)return R1;M_=1;var r=$m(),e=vS(),t=e([r("%String.prototype.indexOf%")]);return R1=function(i,l){var u=r(i,!!l);return typeof u=="function"&&t(i,".prototype.")>-1?e([u]):u},R1}var I1,D_;function bS(){if(D_)return I1;D_=1;var r=$m(),e=yS(),t=Ch(),n=rf(),i=r("%Map%",!0),l=e("Map.prototype.get",!0),u=e("Map.prototype.set",!0),h=e("Map.prototype.has",!0),g=e("Map.prototype.delete",!0),v=e("Map.prototype.size",!0);return I1=!!i&&function(){var T,C={assert:function(_){if(!C.has(_))throw new n("Side channel does not contain "+t(_))},delete:function(_){if(T){var x=g(T,_);return v(T)===0&&(T=void 0),x}return!1},get:function(_){if(T)return l(T,_)},has:function(_){return T?h(T,_):!1},set:function(_,x){T||(T=new i),u(T,_,x)}};return C},I1}var L1,O_;function pF(){if(O_)return L1;O_=1;var r=$m(),e=yS(),t=Ch(),n=bS(),i=rf(),l=r("%WeakMap%",!0),u=e("WeakMap.prototype.get",!0),h=e("WeakMap.prototype.set",!0),g=e("WeakMap.prototype.has",!0),v=e("WeakMap.prototype.delete",!0);return L1=l?function(){var T,C,_={assert:function(x){if(!_.has(x))throw new i("Side channel does not contain "+t(x))},delete:function(x){if(l&&x&&(typeof x=="object"||typeof x=="function")){if(T)return v(T,x)}else if(n&&C)return C.delete(x);return!1},get:function(x){return l&&x&&(typeof x=="object"||typeof x=="function")&&T?u(T,x):C&&C.get(x)},has:function(x){return l&&x&&(typeof x=="object"||typeof x=="function")&&T?g(T,x):!!C&&C.has(x)},set:function(x,D){l&&x&&(typeof x=="object"||typeof x=="function")?(T||(T=new l),h(T,x,D)):n&&(C||(C=n()),C.set(x,D))}};return _}:n,L1}var M1,P_;function gF(){if(P_)return M1;P_=1;var r=rf(),e=Ch(),t=$N(),n=bS(),i=pF(),l=i||n||t;return M1=function(){var h,g={assert:function(v){if(!g.has(v))throw new r("Side channel does not contain "+e(v))},delete:function(v){return!!h&&h.delete(v)},get:function(v){return h&&h.get(v)},has:function(v){return!!h&&h.has(v)},set:function(v,L){h||(h=l()),h.set(v,L)}};return g},M1}var D1,N_;function Um(){if(N_)return D1;N_=1;var r=String.prototype.replace,e=/%20/g,t={RFC1738:"RFC1738",RFC3986:"RFC3986"};return D1={default:t.RFC3986,formatters:{RFC1738:function(n){return r.call(n,e,"+")},RFC3986:function(n){return String(n)}},RFC1738:t.RFC1738,RFC3986:t.RFC3986},D1}var O1,F_;function _S(){if(F_)return O1;F_=1;var r=Um(),e=Object.prototype.hasOwnProperty,t=Array.isArray,n=function(){for(var w=[],b=0;b<256;++b)w.push("%"+((b<16?"0":"")+b.toString(16)).toUpperCase());return w}(),i=function(b){for(;b.length>1;){var R=b.pop(),O=R.obj[R.prop];if(t(O)){for(var q=[],H=0;H<O.length;++H)typeof O[H]<"u"&&q.push(O[H]);R.obj[R.prop]=q}}},l=function(b,R){for(var O=R&&R.plainObjects?{__proto__:null}:{},q=0;q<b.length;++q)typeof b[q]<"u"&&(O[q]=b[q]);return O},u=function w(b,R,O){if(!R)return b;if(typeof R!="object"&&typeof R!="function"){if(t(b))b.push(R);else if(b&&typeof b=="object")(O&&(O.plainObjects||O.allowPrototypes)||!e.call(Object.prototype,R))&&(b[R]=!0);else return[b,R];return b}if(!b||typeof b!="object")return[b].concat(R);var q=b;return t(b)&&!t(R)&&(q=l(b,O)),t(b)&&t(R)?(R.forEach(function(H,z){if(e.call(b,z)){var Y=b[z];Y&&typeof Y=="object"&&H&&typeof H=="object"?b[z]=w(Y,H,O):b.push(H)}else b[z]=H}),b):Object.keys(R).reduce(function(H,z){var Y=R[z];return e.call(H,z)?H[z]=w(H[z],Y,O):H[z]=Y,H},q)},h=function(b,R){return Object.keys(R).reduce(function(O,q){return O[q]=R[q],O},b)},g=function(w,b,R){var O=w.replace(/\+/g," ");if(R==="iso-8859-1")return O.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(O)}catch{return O}},v=1024,L=function(b,R,O,q,H){if(b.length===0)return b;var z=b;if(typeof b=="symbol"?z=Symbol.prototype.toString.call(b):typeof b!="string"&&(z=String(b)),O==="iso-8859-1")return escape(z).replace(/%u[0-9a-f]{4}/gi,function(J){return"%26%23"+parseInt(J.slice(2),16)+"%3B"});for(var Y="",ue=0;ue<z.length;ue+=v){for(var Q=z.length>=v?z.slice(ue,ue+v):z,de=[],j=0;j<Q.length;++j){var ne=Q.charCodeAt(j);if(ne===45||ne===46||ne===95||ne===126||ne>=48&&ne<=57||ne>=65&&ne<=90||ne>=97&&ne<=122||H===r.RFC1738&&(ne===40||ne===41)){de[de.length]=Q.charAt(j);continue}if(ne<128){de[de.length]=n[ne];continue}if(ne<2048){de[de.length]=n[192|ne>>6]+n[128|ne&63];continue}if(ne<55296||ne>=57344){de[de.length]=n[224|ne>>12]+n[128|ne>>6&63]+n[128|ne&63];continue}j+=1,ne=65536+((ne&1023)<<10|Q.charCodeAt(j)&1023),de[de.length]=n[240|ne>>18]+n[128|ne>>12&63]+n[128|ne>>6&63]+n[128|ne&63]}Y+=de.join("")}return Y},T=function(b){for(var R=[{obj:{o:b},prop:"o"}],O=[],q=0;q<R.length;++q)for(var H=R[q],z=H.obj[H.prop],Y=Object.keys(z),ue=0;ue<Y.length;++ue){var Q=Y[ue],de=z[Q];typeof de=="object"&&de!==null&&O.indexOf(de)===-1&&(R.push({obj:z,prop:Q}),O.push(de))}return i(R),b},C=function(b){return Object.prototype.toString.call(b)==="[object RegExp]"},_=function(b){return!b||typeof b!="object"?!1:!!(b.constructor&&b.constructor.isBuffer&&b.constructor.isBuffer(b))},x=function(b,R){return[].concat(b,R)},D=function(b,R){if(t(b)){for(var O=[],q=0;q<b.length;q+=1)O.push(R(b[q]));return O}return R(b)};return O1={arrayToObject:l,assign:h,combine:x,compact:T,decode:g,encode:L,isBuffer:_,isRegExp:C,maybeMap:D,merge:u},O1}var P1,j_;function mF(){if(j_)return P1;j_=1;var r=gF(),e=_S(),t=Um(),n=Object.prototype.hasOwnProperty,i={brackets:function(w){return w+"[]"},comma:"comma",indices:function(w,b){return w+"["+b+"]"},repeat:function(w){return w}},l=Array.isArray,u=Array.prototype.push,h=function(D,w){u.apply(D,l(w)?w:[w])},g=Date.prototype.toISOString,v=t.default,L={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:e.encode,encodeValuesOnly:!1,filter:void 0,format:v,formatter:t.formatters[v],indices:!1,serializeDate:function(w){return g.call(w)},skipNulls:!1,strictNullHandling:!1},T=function(w){return typeof w=="string"||typeof w=="number"||typeof w=="boolean"||typeof w=="symbol"||typeof w=="bigint"},C={},_=function D(w,b,R,O,q,H,z,Y,ue,Q,de,j,ne,J,X,ie,fe,ye){for(var se=w,be=ye,ve=0,ge=!1;(be=be.get(C))!==void 0&&!ge;){var Ee=be.get(w);if(ve+=1,typeof Ee<"u"){if(Ee===ve)throw new RangeError("Cyclic object value");ge=!0}typeof be.get(C)>"u"&&(ve=0)}if(typeof Q=="function"?se=Q(b,se):se instanceof Date?se=ne(se):R==="comma"&&l(se)&&(se=e.maybeMap(se,function(Ve){return Ve instanceof Date?ne(Ve):Ve})),se===null){if(H)return ue&&!ie?ue(b,L.encoder,fe,"key",J):b;se=""}if(T(se)||e.isBuffer(se)){if(ue){var Oe=ie?b:ue(b,L.encoder,fe,"key",J);return[X(Oe)+"="+X(ue(se,L.encoder,fe,"value",J))]}return[X(b)+"="+X(String(se))]}var Xe=[];if(typeof se>"u")return Xe;var Ae;if(R==="comma"&&l(se))ie&&ue&&(se=e.maybeMap(se,ue)),Ae=[{value:se.length>0?se.join(",")||null:void 0}];else if(l(Q))Ae=Q;else{var it=Object.keys(se);Ae=de?it.sort(de):it}var pt=Y?String(b).replace(/\./g,"%2E"):String(b),et=O&&l(se)&&se.length===1?pt+"[]":pt;if(q&&l(se)&&se.length===0)return et+"[]";for(var Ze=0;Ze<Ae.length;++Ze){var je=Ae[Ze],Ie=typeof je=="object"&&je&&typeof je.value<"u"?je.value:se[je];if(!(z&&Ie===null)){var le=j&&Y?String(je).replace(/\./g,"%2E"):String(je),ke=l(se)?typeof R=="function"?R(et,le):et:et+(j?"."+le:"["+le+"]");ye.set(w,ve);var Te=r();Te.set(C,ye),h(Xe,D(Ie,ke,R,O,q,H,z,Y,R==="comma"&&ie&&l(se)?null:ue,Q,de,j,ne,J,X,ie,fe,Te))}}return Xe},x=function(w){if(!w)return L;if(typeof w.allowEmptyArrays<"u"&&typeof w.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof w.encodeDotInKeys<"u"&&typeof w.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(w.encoder!==null&&typeof w.encoder<"u"&&typeof w.encoder!="function")throw new TypeError("Encoder has to be a function.");var b=w.charset||L.charset;if(typeof w.charset<"u"&&w.charset!=="utf-8"&&w.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var R=t.default;if(typeof w.format<"u"){if(!n.call(t.formatters,w.format))throw new TypeError("Unknown format option provided.");R=w.format}var O=t.formatters[R],q=L.filter;(typeof w.filter=="function"||l(w.filter))&&(q=w.filter);var H;if(w.arrayFormat in i?H=w.arrayFormat:"indices"in w?H=w.indices?"indices":"repeat":H=L.arrayFormat,"commaRoundTrip"in w&&typeof w.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var z=typeof w.allowDots>"u"?w.encodeDotInKeys===!0?!0:L.allowDots:!!w.allowDots;return{addQueryPrefix:typeof w.addQueryPrefix=="boolean"?w.addQueryPrefix:L.addQueryPrefix,allowDots:z,allowEmptyArrays:typeof w.allowEmptyArrays=="boolean"?!!w.allowEmptyArrays:L.allowEmptyArrays,arrayFormat:H,charset:b,charsetSentinel:typeof w.charsetSentinel=="boolean"?w.charsetSentinel:L.charsetSentinel,commaRoundTrip:!!w.commaRoundTrip,delimiter:typeof w.delimiter>"u"?L.delimiter:w.delimiter,encode:typeof w.encode=="boolean"?w.encode:L.encode,encodeDotInKeys:typeof w.encodeDotInKeys=="boolean"?w.encodeDotInKeys:L.encodeDotInKeys,encoder:typeof w.encoder=="function"?w.encoder:L.encoder,encodeValuesOnly:typeof w.encodeValuesOnly=="boolean"?w.encodeValuesOnly:L.encodeValuesOnly,filter:q,format:R,formatter:O,serializeDate:typeof w.serializeDate=="function"?w.serializeDate:L.serializeDate,skipNulls:typeof w.skipNulls=="boolean"?w.skipNulls:L.skipNulls,sort:typeof w.sort=="function"?w.sort:null,strictNullHandling:typeof w.strictNullHandling=="boolean"?w.strictNullHandling:L.strictNullHandling}};return P1=function(D,w){var b=D,R=x(w),O,q;typeof R.filter=="function"?(q=R.filter,b=q("",b)):l(R.filter)&&(q=R.filter,O=q);var H=[];if(typeof b!="object"||b===null)return"";var z=i[R.arrayFormat],Y=z==="comma"&&R.commaRoundTrip;O||(O=Object.keys(b)),R.sort&&O.sort(R.sort);for(var ue=r(),Q=0;Q<O.length;++Q){var de=O[Q],j=b[de];R.skipNulls&&j===null||h(H,_(j,de,z,Y,R.allowEmptyArrays,R.strictNullHandling,R.skipNulls,R.encodeDotInKeys,R.encode?R.encoder:null,R.filter,R.sort,R.allowDots,R.serializeDate,R.format,R.formatter,R.encodeValuesOnly,R.charset,ue))}var ne=H.join(R.delimiter),J=R.addQueryPrefix===!0?"?":"";return R.charsetSentinel&&(R.charset==="iso-8859-1"?J+="utf8=%26%2310003%3B&":J+="utf8=%E2%9C%93&"),ne.length>0?J+ne:""},P1}var N1,B_;function vF(){if(B_)return N1;B_=1;var r=_S(),e=Object.prototype.hasOwnProperty,t=Array.isArray,n={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:r.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},i=function(C){return C.replace(/&#(\d+);/g,function(_,x){return String.fromCharCode(parseInt(x,10))})},l=function(C,_,x){if(C&&typeof C=="string"&&_.comma&&C.indexOf(",")>-1)return C.split(",");if(_.throwOnLimitExceeded&&x>=_.arrayLimit)throw new RangeError("Array limit exceeded. Only "+_.arrayLimit+" element"+(_.arrayLimit===1?"":"s")+" allowed in an array.");return C},u="utf8=%26%2310003%3B",h="utf8=%E2%9C%93",g=function(_,x){var D={__proto__:null},w=x.ignoreQueryPrefix?_.replace(/^\?/,""):_;w=w.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var b=x.parameterLimit===1/0?void 0:x.parameterLimit,R=w.split(x.delimiter,x.throwOnLimitExceeded?b+1:b);if(x.throwOnLimitExceeded&&R.length>b)throw new RangeError("Parameter limit exceeded. Only "+b+" parameter"+(b===1?"":"s")+" allowed.");var O=-1,q,H=x.charset;if(x.charsetSentinel)for(q=0;q<R.length;++q)R[q].indexOf("utf8=")===0&&(R[q]===h?H="utf-8":R[q]===u&&(H="iso-8859-1"),O=q,q=R.length);for(q=0;q<R.length;++q)if(q!==O){var z=R[q],Y=z.indexOf("]="),ue=Y===-1?z.indexOf("="):Y+1,Q,de;ue===-1?(Q=x.decoder(z,n.decoder,H,"key"),de=x.strictNullHandling?null:""):(Q=x.decoder(z.slice(0,ue),n.decoder,H,"key"),de=r.maybeMap(l(z.slice(ue+1),x,t(D[Q])?D[Q].length:0),function(ne){return x.decoder(ne,n.decoder,H,"value")})),de&&x.interpretNumericEntities&&H==="iso-8859-1"&&(de=i(String(de))),z.indexOf("[]=")>-1&&(de=t(de)?[de]:de);var j=e.call(D,Q);j&&x.duplicates==="combine"?D[Q]=r.combine(D[Q],de):(!j||x.duplicates==="last")&&(D[Q]=de)}return D},v=function(C,_,x,D){var w=0;if(C.length>0&&C[C.length-1]==="[]"){var b=C.slice(0,-1).join("");w=Array.isArray(_)&&_[b]?_[b].length:0}for(var R=D?_:l(_,x,w),O=C.length-1;O>=0;--O){var q,H=C[O];if(H==="[]"&&x.parseArrays)q=x.allowEmptyArrays&&(R===""||x.strictNullHandling&&R===null)?[]:r.combine([],R);else{q=x.plainObjects?{__proto__:null}:{};var z=H.charAt(0)==="["&&H.charAt(H.length-1)==="]"?H.slice(1,-1):H,Y=x.decodeDotInKeys?z.replace(/%2E/g,"."):z,ue=parseInt(Y,10);!x.parseArrays&&Y===""?q={0:R}:!isNaN(ue)&&H!==Y&&String(ue)===Y&&ue>=0&&x.parseArrays&&ue<=x.arrayLimit?(q=[],q[ue]=R):Y!=="__proto__"&&(q[Y]=R)}R=q}return R},L=function(_,x,D,w){if(_){var b=D.allowDots?_.replace(/\.([^.[]+)/g,"[$1]"):_,R=/(\[[^[\]]*])/,O=/(\[[^[\]]*])/g,q=D.depth>0&&R.exec(b),H=q?b.slice(0,q.index):b,z=[];if(H){if(!D.plainObjects&&e.call(Object.prototype,H)&&!D.allowPrototypes)return;z.push(H)}for(var Y=0;D.depth>0&&(q=O.exec(b))!==null&&Y<D.depth;){if(Y+=1,!D.plainObjects&&e.call(Object.prototype,q[1].slice(1,-1))&&!D.allowPrototypes)return;z.push(q[1])}if(q){if(D.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+D.depth+" and strictDepth is true");z.push("["+b.slice(q.index)+"]")}return v(z,x,D,w)}},T=function(_){if(!_)return n;if(typeof _.allowEmptyArrays<"u"&&typeof _.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof _.decodeDotInKeys<"u"&&typeof _.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(_.decoder!==null&&typeof _.decoder<"u"&&typeof _.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof _.charset<"u"&&_.charset!=="utf-8"&&_.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof _.throwOnLimitExceeded<"u"&&typeof _.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var x=typeof _.charset>"u"?n.charset:_.charset,D=typeof _.duplicates>"u"?n.duplicates:_.duplicates;if(D!=="combine"&&D!=="first"&&D!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var w=typeof _.allowDots>"u"?_.decodeDotInKeys===!0?!0:n.allowDots:!!_.allowDots;return{allowDots:w,allowEmptyArrays:typeof _.allowEmptyArrays=="boolean"?!!_.allowEmptyArrays:n.allowEmptyArrays,allowPrototypes:typeof _.allowPrototypes=="boolean"?_.allowPrototypes:n.allowPrototypes,allowSparse:typeof _.allowSparse=="boolean"?_.allowSparse:n.allowSparse,arrayLimit:typeof _.arrayLimit=="number"?_.arrayLimit:n.arrayLimit,charset:x,charsetSentinel:typeof _.charsetSentinel=="boolean"?_.charsetSentinel:n.charsetSentinel,comma:typeof _.comma=="boolean"?_.comma:n.comma,decodeDotInKeys:typeof _.decodeDotInKeys=="boolean"?_.decodeDotInKeys:n.decodeDotInKeys,decoder:typeof _.decoder=="function"?_.decoder:n.decoder,delimiter:typeof _.delimiter=="string"||r.isRegExp(_.delimiter)?_.delimiter:n.delimiter,depth:typeof _.depth=="number"||_.depth===!1?+_.depth:n.depth,duplicates:D,ignoreQueryPrefix:_.ignoreQueryPrefix===!0,interpretNumericEntities:typeof _.interpretNumericEntities=="boolean"?_.interpretNumericEntities:n.interpretNumericEntities,parameterLimit:typeof _.parameterLimit=="number"?_.parameterLimit:n.parameterLimit,parseArrays:_.parseArrays!==!1,plainObjects:typeof _.plainObjects=="boolean"?_.plainObjects:n.plainObjects,strictDepth:typeof _.strictDepth=="boolean"?!!_.strictDepth:n.strictDepth,strictNullHandling:typeof _.strictNullHandling=="boolean"?_.strictNullHandling:n.strictNullHandling,throwOnLimitExceeded:typeof _.throwOnLimitExceeded=="boolean"?_.throwOnLimitExceeded:!1}};return N1=function(C,_){var x=T(_);if(C===""||C===null||typeof C>"u")return x.plainObjects?{__proto__:null}:{};for(var D=typeof C=="string"?g(C,x):C,w=x.plainObjects?{__proto__:null}:{},b=Object.keys(D),R=0;R<b.length;++R){var O=b[R],q=L(O,D[O],x,typeof C=="string");w=r.merge(w,q,x)}return x.allowSparse===!0?w:r.compact(w)},N1}var F1,H_;function yF(){if(H_)return F1;H_=1;var r=mF(),e=vF(),t=Um();return F1={formats:t,parse:e,stringify:r},F1}var bF=yF();const _F=al(bF),sm={StoredContexts:{},defaultHandler:()=>{}},xS={Init:()=>{},Create:r=>{const e=r.method+r.url;return sm.StoredContexts[e]=r,xF(r)},FetchBaseUrl:()=>window.location.href,useDefaultHandler:r=>{sm.defaultHandler=r}};function xF(r){const e=`[${r.method}] ${r.url}`;return{Call:async n=>{let{url:i,method:l,stream:u,paramType:h}=r;const{po:g,onStream:v,onStreamEnd:L,noDefaultHandle:T=[]}=n??{};(h==="query"||l==="GET")&&g!==void 0&&(i+="?"+_F.stringify(g,{arrayFormat:"comma"}));const C={method:l,headers:{Accept:"application/json;charset=UTF-8","X-Requested-With":"XMLHttpRequest","Cache-Control":"no-cache",Pragma:"no-cache",crossDomain:"true"}};if(h==="form"){const D=new FormData;if(g!==void 0)for(const w in g){const b=g[w];D.append(w,b)}C.body=D}else(h==="body"||h===void 0&&r.method!=="GET")&&(C.body=JSON.stringify(g),C.headers["Content-Type"]="application/json;charset=UTF-8");let _={errorCode:0,message:""};const x=Date.now();i=xS.FetchBaseUrl()+i;try{let D=await fetch(i,C);if(D.ok===!1)return _.errorCode=D.status,_.message=D.statusText,_;{const w=new TextDecoder("utf-8");if(u){if(D.body){let b=D.body.getReader(),R="";for(;;){const O=await b.read();if(O.done)break;const q=w.decode(O.value).trim();R+=q;let H=null;try{const z=q.split("\0");let Y=z[z.length-1];for(let ue=z.length-2;ue>=0;ue--)if(z[ue].trim().length!==0){Y=z[ue];break}H=await JSON.parse(Y)}catch{try{const Y=R.split("\0");let ue=Y[Y.length-1];for(let Q=Y.length-2;Q>=0;Q--)if(Y[Q].trim().length!==0){ue=Y[Q];break}H=await JSON.parse(ue)}catch{}}if(H!=null&&(Object.keys(H).includes("err_code")?_.errorCode=H.err_code:(_.errorCode=0,_.data=H,R="",O.done?L==null||L(_.data):v==null||v(_.data))),O.done)break}}}else if(D.body){const R=await D.body.getReader().read(),O=w.decode(R.value);if(O==="null")return _;{let q=await JSON.parse(O.replaceAll("\0",""));Object.keys(q).includes("err_code")?(_.errorCode=q.err_code,_.message=q.err_msg):_.data=q}}}}catch(D){console.warn(D),_.errorCode=-1,_.message=D.message}return console.debug(`${e} ${Date.now()-x}ms`),T!==!0&&await sm.defaultHandler(_,T),_}}}async function SF(r){const e=new Promise((t,n)=>{const i=new FileReader;i.onloadend=()=>{i.result?typeof i.result=="string"?t(i.result):n(new Error("Failed to convert file to Base64: Invalid result type.")):n(new Error("Failed to convert file to Base64: Empty result."))},i.onerror=n,i.readAsDataURL(r)});try{return await e}catch{return}}function CF(r,e){var h,g;const t=r.split(","),n=(g=(h=t[0])==null?void 0:h.match(/:(.*?);/))==null?void 0:g[1],i=atob(t[1]);let l=i.length;const u=new Uint8Array(l);for(;l--;)u[l]=i.charCodeAt(l);return new File([u],e,{type:n})}const wF={toBase64:SF,toFile:CF};exports.ABase=$r;exports.ABaseStyleKeys=o2;exports.AButton=hi;exports.AButtonStyleKeys=a2;exports.AButtonTypes=r5;exports.ACheckBox=Gu;exports.ACheckBoxStyleKeys=f2;exports.AChip=dm;exports.AChipKeys=I2;exports.AChips=y6;exports.AClock=L6;exports.AColFrame=M2;exports.ADatePicker=gm;exports.ADatePickerStyleKeys=x2;exports.ADatePickerTypes=iE;exports.ADateRangePicker=hm;exports.ADateRangePickerStyleKeys=S2;exports.ADialog=hE;exports.ADialogStyleKeys=d2;exports.ADialogTypes=dE;exports.ADivideFrame=s6;exports.AEditor=QP;exports.AEditorStyleKeys=u2;exports.AFileBox=wE;exports.AFileBoxStyleKeys=y2;exports.AFileUploader=jE;exports.AFloatMenu=N2;exports.AFloatMenuKeys=T2;exports.AFrameStyleKeys=A2;exports.AGrow=Jc;exports.AIcon=jr;exports.AIconButton=xi;exports.AIconButtonStyleKeys=C2;exports.AIconButtonTypes=n5;exports.AIconHOC=j4;exports.AIcons=cm;exports.AInput=tc;exports.AInputStyleKeys=l2;exports.AInputTypes=U6;exports.AListView=KE;exports.AListViewStyleKeys=b2;exports.ALoadingBorder=mm;exports.ALoadingBorderKeys=E2;exports.AMultiSelect=C8;exports.AMultiSelectStyleKeys=p2;exports.ANumInput=UE;exports.AOverflowFrame=nl;exports.ARadioSelect=l8;exports.ARadioSelectKeys=R2;exports.ARowFrame=Sn;exports.ASelect=Zc;exports.ASelectStyleKeys=h2;exports.ASelectTypes=oT;exports.ASpace=mn;exports.AStepper=j8;exports.AStepperStyleKeys=_2;exports.ASwitch=J_;exports.ASwitchFrame=D2;exports.ASwitchStyleKeys=m2;exports.ATab=B2;exports.ATabStyleKeys=v2;exports.ATabTypes=Y8;exports.ATable=nR;exports.ATableStyleKeys=w2;exports.AText=U2;exports.ATextArea=pR;exports.ATextAreaStyleKeys=c2;exports.ATextAreaTypes=hR;exports.AThemeButton=z5;exports.AThemes=Nf;exports.ATooltip=X_;exports.ATooltipStyleKeys=s2;exports.ATree=NN;exports.ATreeStyleKeys=g2;exports.AWrap=ec;exports.AWrapKeys=k2;exports.AWrapTypes=S5;exports.ApiContext=xS;exports.BodyStyleKeys=i2;exports.CreateADC=bE;exports.DefaultOptionRenderer=j2;exports.EDir12=Qu;exports.EDir4=bi;exports.FileSizeTrans=Gc;exports.Icons=nh;exports.IsCursorPointer=W_;exports.IsFixedShape=U_;exports.IsInteractive=V_;exports.NoSelect=$_;exports.Resources=hn;exports.SetResources=m5;exports.alphanumericRegex=_6;exports.bound=Pf;exports.cbF=Ir;exports.changeSemanticMode=fm;exports.componentStyleKeys=O5;exports.createEvent=Vc;exports.dateF=Kt;exports.defaultPredicate=q2;exports.dlgF=_E;exports.emailIdRegex=S6;exports.emailRegex=x6;exports.fileF=wF;exports.getMonthsOptions=Zf;exports.getYearsOptions=pm;exports.hangulRegex=w6;exports.hexRegex=C6;exports.noHanguljamoRegex=T6;exports.noSpaceRegex=A6;exports.numF=F2;exports.objF=tr;exports.paletteKeys=Q_;exports.paletteModes=ih;exports.passwordRegex=k6;exports.refinedDesignTokens=Si;exports.sF=Pe;exports.semanticKeys=r2;exports.semanticModes=Vu;exports.setDir12Style=um;exports.setDir12StyleElem=K_;exports.specialCharRegex=E6;exports.strF=P2;exports.tableF=el;exports.treeF=tl;exports.useADialogCore=vE;exports.useADialogCores=mE;exports.useEvent=$2;exports.useInit=H2;exports.useValues=cn;exports.uuidRegex=R6;
|
package/dist/index.es.js
CHANGED
@@ -30907,10 +30907,30 @@ class gM {
|
|
30907
30907
|
const i = e.getBoundingClientRect();
|
30908
30908
|
return this.positionCache.set(e, { rect: i, timestamp: t }), i;
|
30909
30909
|
}
|
30910
|
-
pasteHandler() {
|
30910
|
+
pasteHandler(e) {
|
30911
|
+
if (!this.selectedCell || !e.clipboardData) return;
|
30912
|
+
const n = e.clipboardData.getData("text/html");
|
30913
|
+
if (n && n.trim() !== "") {
|
30914
|
+
const i = this.quill.getSelection();
|
30915
|
+
if (i) {
|
30916
|
+
const [l] = this.table.getTable(i);
|
30917
|
+
if (l) {
|
30918
|
+
e.preventDefault();
|
30919
|
+
try {
|
30920
|
+
this.quill.clipboard.dangerouslyPasteHTML(i.index, n, "user"), setTimeout(() => {
|
30921
|
+
const u = this.quill.getSelection();
|
30922
|
+
u && this.detectButton(u);
|
30923
|
+
}, 0);
|
30924
|
+
return;
|
30925
|
+
} catch (u) {
|
30926
|
+
console.error("테이블 셀에 HTML 붙여넣기 중 오류 발생:", u);
|
30927
|
+
}
|
30928
|
+
}
|
30929
|
+
}
|
30930
|
+
}
|
30911
30931
|
this.clearAllTableCellOutlines(), setTimeout(() => {
|
30912
|
-
const
|
30913
|
-
|
30932
|
+
const i = this.quill.getSelection();
|
30933
|
+
i && this.detectButton(i);
|
30914
30934
|
}, 0);
|
30915
30935
|
}
|
30916
30936
|
cleanupTableUI() {
|
@@ -31417,6 +31437,7 @@ const Hj = yn.memo(
|
|
31417
31437
|
theme: "snow",
|
31418
31438
|
value: ft,
|
31419
31439
|
style: {
|
31440
|
+
...I == null ? void 0 : I.style,
|
31420
31441
|
maxHeight: rt ? rt + oe : void 0,
|
31421
31442
|
"--icon-size": `${B === "Med" ? 18 : 24}px`,
|
31422
31443
|
"--editor-padding": ae ? "8px 12px" : "12px",
|