instead.`);if(this.lastDeltaChangeSet&&e.value===this.lastDeltaChangeSet)throw Error("You are passing the `delta` object from the `onChange` event back as `value`. You most probably want `editor.getContents()` instead. See: https://github.com/zenoamaro/react-quill#using-deltas")}shouldComponentUpdate(e,t){if(this.validateProps(e),!this.editor||this.state.generation!==t.generation)return!0;if(`value`in e){let t=this.getEditorContents(),n=e.value??``;this.isEqualValue(n,t)||this.setEditorContents(this.editor,n)}return e.readOnly!==this.props.readOnly&&this.setEditorReadOnly(this.editor,e.readOnly),[...this.cleanProps,...this.dirtyProps].some(t=>!D3(e[t],this.props[t]))}shouldComponentRegenerate(e){return this.dirtyProps.some(t=>!D3(e[t],this.props[t]))}componentDidMount(){this.instantiateEditor(),this.setEditorContents(this.editor,this.getEditorContents())}componentWillUnmount(){this.destroyEditor()}componentDidUpdate(e,t){if(this.editor&&this.shouldComponentRegenerate(e)){let e=this.editor.getContents(),t=this.editor.getSelection();this.regenerationSnapshot={delta:e,selection:t},this.setState({generation:this.state.generation+1}),this.destroyEditor()}if(this.editor&&e.placeholder!==this.props.placeholder&&(this.editor.root.dataset.placeholder=this.props.placeholder||``),this.state.generation!==t.generation){let{delta:e,selection:t}=this.regenerationSnapshot;delete this.regenerationSnapshot,this.instantiateEditor();let n=this.editor;n.setContents(e),g5(()=>this.setEditorSelection(n,t))}}instantiateEditor(){this.editor?this.hookEditor(this.editor):this.editor=this.createEditor(this.getEditingArea(),this.getEditorConfig())}destroyEditor(){if(!this.editor)return;this.unhookEditor(this.editor);let e=this.props.modules?.toolbar;if(!(typeof e==`object`&&e&&`container`in e&&typeof e.container==`string`||typeof e==`string`)){let e=this.containerRef.current?.querySelector(`.ql-toolbar`);e&&e.remove()}delete this.editor}isControlled(){return`value`in this.props}getEditorConfig(){return{bounds:this.props.bounds,formats:this.props.formats,modules:this.props.modules,placeholder:this.props.placeholder,readOnly:this.props.readOnly,tabIndex:this.props.tabIndex,theme:this.props.theme}}getEditor(){if(!this.editor)throw Error(`Accessing non-instantiated editor`);return this.editor}createEditor(e,t){let n=new m5(e,t);return t.tabIndex!=null&&this.setEditorTabIndex(n,t.tabIndex),this.hookEditor(n),n}hookEditor(e){this.unprivilegedEditor=this.makeUnprivilegedEditor(e),e.on(`editor-change`,this.onEditorChange)}unhookEditor(e){e.off(`editor-change`,this.onEditorChange)}getEditorContents(){return this.value}getEditorSelection(){return this.selection}isDelta(e){return e&&e.ops}isEqualValue(e,t){return this.isDelta(e)&&this.isDelta(t)?D3(e.ops,t.ops):D3(e,t)}setEditorContents(e,t){this.value=t;let n=this.getEditorSelection();typeof t==`string`?e.setContents(e.clipboard.convert({html:t})):e.setContents(t),g5(()=>this.setEditorSelection(e,n))}setEditorSelection(e,t){if(this.selection=t,t){let n=e.getLength();t.index=Math.max(0,Math.min(t.index,n-1)),t.length=Math.max(0,Math.min(t.length,n-1-t.index)),e.setSelection(t)}}setEditorTabIndex(e,t){e?.scroll?.domNode&&(e.scroll.domNode.tabIndex=t)}setEditorReadOnly(e,t){t?e.disable():e.enable()}makeUnprivilegedEditor(e){let t=e;return{getHTML:()=>t.root.innerHTML,getSemanticHTML:t.getSemanticHTML.bind(t),getLength:t.getLength.bind(t),getText:t.getText.bind(t),getContents:t.getContents.bind(t),getSelection:t.getSelection.bind(t),getBounds:t.getBounds.bind(t)}}getEditingArea(){let e=this.editingAreaRef.current;if(!e)throw Error(`Cannot find element for editing area`);if(e.nodeType===3)throw Error(`Editing area cannot be a text node`);return e}renderEditingArea(){let{children:e,preserveWhitespace:t}=this.props,{generation:n}=this.state;return C.Children.count(e)?C.cloneElement(C.Children.only(e),{key:n,ref:this.editingAreaRef}):t?(0,Q.jsx)(`pre`,{ref:this.editingAreaRef},n):(0,Q.jsx)(`div`,{ref:this.editingAreaRef},n)}render(){return(0,Q.jsx)(`div`,{ref:this.containerRef,id:this.props.id,style:this.props.style,className:`quill ${this.props.className??``}`,onKeyPress:this.props.onKeyPress,onKeyDown:this.props.onKeyDown,onKeyUp:this.props.onKeyUp,children:this.renderEditingArea()},this.state.generation)}onEditorChangeText(e,t,n,r){if(!this.editor)return;let i=this.isDelta(this.value)?r.getContents():this.props.useSemanticHTML===!1?r.getHTML():r.getSemanticHTML();i!==this.getEditorContents()&&(this.lastDeltaChangeSet=t,this.value=i,this.props.onChange?.(e,t,n,r))}onEditorChangeSelection(e,t,n){if(!this.editor)return;let r=this.getEditorSelection(),i=!r&&e,a=r&&!e;D3(e,r)||(this.selection=e,this.props.onChangeSelection?.(e,t,n),i?this.props.onFocus?.(e,t,n):a&&this.props.onBlur?.(r,t,n))}focus(){this.editor&&this.editor.focus()}blur(){this.editor&&(this.selection=null,this.editor.blur())}};h5.displayName=`React Quill`,h5.Quill=m5,h5.defaultProps={theme:`snow`,modules:{},readOnly:!1};function g5(e){Promise.resolve().then(e)}var _5=h5,v5={toolbar:[[{header:[1,2,3,!1]}],[{color:[]},{background:[]}],[`bold`,`italic`,`underline`,`strike`],[{list:`ordered`},{list:`bullet`}],[{align:[]}],[`link`,`image`],[`clean`]]},I0e=()=>{let[e,t]=(0,C.useState)([]),[n,r]=(0,C.useState)(!1),[i,a]=(0,C.useState)([]),[o,s]=(0,C.useState)(!1),[c]=Y.useForm(),[l,u]=(0,C.useState)({open:!1,notifId:``,title:``}),[d,f]=(0,C.useState)([]),[p,m]=(0,C.useState)(!1),[h,g]=(0,C.useState)(1),[_,v]=(0,C.useState)(10),[y,b]=(0,C.useState)(0),[x,S]=(0,C.useState)(``),[w,T]=(0,C.useState)(null),[E,D]=(0,C.useState)(!1),[O,k]=(0,C.useState)(!1),A=async()=>{r(!0);try{let e=await dJe(h,_),n=(await F0(1,1e3)).items||[],r={};n.forEach(e=>{r[e.id]=e.username}),t((e.items||[]).map(e=>({id:e.id,title:e.title,content:e.content,type:e.type,targetUserId:e.userId||null,target:e.userId?r[e.userId]||e.userId:`全部用户`,createdAt:e.createdAt}))),b(e.total||0),a(n.map(e=>({id:e.id,username:e.username})))}catch{X.error(`加载通知列表失败`)}finally{r(!1)}},j=async()=>{k(!0);try{let e=(await R0()).find(e=>e.key===`site_banner`);e?(S(e.value||``),T(e.id)):(S(``),T(null))}catch{}finally{k(!1)}};(0,C.useEffect)(()=>{A()},[h,_]),(0,C.useEffect)(()=>{j()},[]);let M=(e,t)=>{g(e),v(t)},N=async()=>{try{let e=await c.validateFields();await fJe({title:e.title,content:e.content,type:e.type||`system`,target_user_id:e.target_user_id||void 0}),X.success(`消息已发送`),s(!1),c.resetFields(),A()}catch{}},P=async e=>{try{await pJe(e),X.success(`已删除`),A()}catch(e){X.error(e?.message||`删除失败`)}},F=async(e,t)=>{u({open:!0,notifId:e,title:t}),m(!0);try{f((await mJe(e)).items||[])}catch{X.error(`加载已读列表失败`)}finally{m(!1)}},I=async()=>{let e=x.trim();if(!e){X.error(`请输入横幅内容`);return}D(!0);try{w?await z0(w,e):T((await B0(`site_banner`,e,`全局活动通知横幅内容`)).id);try{await V0()}catch{}X.success(`活动横幅已保存,所有用户将重新看到该横幅`)}catch(e){X.error(e?.message||`保存失败`)}finally{D(!1)}},L=async()=>{try{let e=await V0();X.success(`横幅已重新展示(版本 → ${e.site_banner_version})`)}catch(e){X.error(e?.message||`操作失败`)}},R=e=>{switch(e){case`system`:return`blue`;case`credit`:return`orange`;case`promo`:return`purple`;default:return`default`}};return(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(oO,{items:[{key:`notifications`,label:(0,Q.jsxs)(`span`,{children:[(0,Q.jsx)(_z,{style:{marginRight:6}}),`消息推送`]}),children:(0,Q.jsxs)(cO,{variant:`outlined`,style:{borderRadius:12,border:`1px solid #f0f0f5`},children:[(0,Q.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,marginBottom:16},children:[(0,Q.jsxs)(CA,{children:[(0,Q.jsx)(_z,{style:{fontSize:18,color:`#6366f1`}}),(0,Q.jsx)(Z.Text,{strong:!0,style:{fontSize:16},children:`消息推送管理`}),(0,Q.jsxs)(iI,{color:`purple`,children:[`共 `,y,` 条消息`]})]}),(0,Q.jsx)(LS,{type:`primary`,icon:(0,Q.jsx)(LD,{}),onClick:()=>s(!0),style:{borderRadius:8},children:`发送新消息`})]}),(0,Q.jsx)(QF,{columns:[{title:`标题`,dataIndex:`title`,width:200,render:e=>(0,Q.jsx)(Z.Text,{strong:!0,children:e})},{title:`内容`,dataIndex:`content`,ellipsis:!0,render:e=>(0,Q.jsx)(`div`,{style:{maxWidth:300},dangerouslySetInnerHTML:{__html:e}})},{title:`类型`,dataIndex:`type`,width:80,render:e=>(0,Q.jsx)(iI,{color:R(e),children:{system:`系统`,credit:`积分`,promo:`活动`}[e]||e})},{title:`发送目标`,dataIndex:`target`,width:120,render:e=>(0,Q.jsx)(iI,{color:e===`全部用户`?`green`:`blue`,children:e})},{title:`发送时间`,dataIndex:`createdAt`,width:160,render:e=>C2(e)},{title:`操作`,key:`action`,width:180,render:(e,t)=>(0,Q.jsxs)(CA,{size:4,children:[(0,Q.jsx)(LS,{type:`link`,size:`small`,icon:(0,Q.jsx)(jj,{}),onClick:()=>F(t.id,t.title),children:`已读`}),(0,Q.jsx)(kM,{title:`确定删除该消息?`,onConfirm:()=>P(t.id),children:(0,Q.jsx)(LS,{type:`link`,danger:!0,size:`small`,icon:(0,Q.jsx)(oI,{}),children:`删除`})})]})}],dataSource:e,rowKey:`id`,loading:n,pagination:{current:h,pageSize:_,total:y,onChange:M,showSizeChanger:!0,showTotal:e=>`共 ${e} 条消息`},scroll:{x:900}})]})},{key:`banner`,label:(0,Q.jsxs)(`span`,{children:[(0,Q.jsx)(lY,{style:{marginRight:6}}),`活动横幅`]}),children:(0,Q.jsxs)(cO,{variant:`outlined`,style:{borderRadius:12,border:`1px solid #f0f0f5`},children:[(0,Q.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,marginBottom:20},children:[(0,Q.jsx)(`div`,{style:{width:40,height:40,borderRadius:10,background:`rgba(99,102,241,0.08)`,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:18,color:`#6366f1`},children:(0,Q.jsx)(lY,{})}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(Z.Text,{strong:!0,style:{fontSize:16},children:`全局活动横幅设置`}),(0,Q.jsx)(Z.Text,{type:`secondary`,style:{fontSize:13,display:`block`},children:`设置后将在用户前台页面顶部显示活动通知横幅,支持富文本格式`})]})]}),(0,Q.jsxs)(`div`,{style:{marginBottom:16},children:[(0,Q.jsx)(Z.Text,{strong:!0,style:{display:`block`,marginBottom:8},children:`横幅内容`}),O?(0,Q.jsx)(`div`,{style:{padding:`40px 0`,textAlign:`center`,color:`#94a3b8`},children:`加载中...`}):(0,Q.jsx)(_5,{theme:`snow`,value:x,onChange:S,modules:v5,placeholder:`请输入横幅内容(支持富文本:加粗、变色、链接等)`,style:{height:200,marginBottom:48}})]}),(0,Q.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,gap:12},children:[(0,Q.jsx)(LS,{icon:(0,Q.jsx)(lY,{}),onClick:L,size:`large`,style:{borderRadius:8,minWidth:160},children:`重新展示横幅`}),(0,Q.jsx)(LS,{type:`primary`,icon:(0,Q.jsx)(EZ,{}),onClick:I,loading:E,size:`large`,style:{borderRadius:8,minWidth:140},children:`保存横幅`})]}),(0,Q.jsx)(Z.Text,{type:`secondary`,style:{fontSize:12,display:`block`,marginTop:8},children:`💡 点击「重新展示横幅」将强制所有已关闭横幅的用户再次看到;修改内容并保存也会自动重新展示。`}),x&&(0,Q.jsxs)(`div`,{style:{marginTop:24},children:[(0,Q.jsx)(Z.Text,{strong:!0,style:{display:`block`,marginBottom:8},children:`前台预览`}),(0,Q.jsxs)(`div`,{style:{borderRadius:12,overflow:`hidden`,background:`linear-gradient(135deg, #f3e8ff 0%, #ede9fe 50%, #e0e7ff 100%)`,border:`1px solid rgba(139, 92, 246, 0.15)`,padding:`10px 16px`,display:`flex`,alignItems:`center`,gap:10},children:[(0,Q.jsx)(`div`,{style:{width:28,height:28,borderRadius:8,background:`rgba(139, 92, 246, 0.12)`,display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0},children:(0,Q.jsx)(lY,{style:{color:`#7c3aed`,fontSize:14}})}),(0,Q.jsx)(`div`,{style:{color:`#5b21b6`,fontSize:14,fontWeight:500,lineHeight:1.5,flex:1},dangerouslySetInnerHTML:{__html:x}})]})]})]})}],defaultActiveKey:`notifications`}),(0,Q.jsx)(TM,{title:(0,Q.jsxs)(CA,{children:[(0,Q.jsx)(zZ,{}),`发送消息`]}),open:o,onOk:N,onCancel:()=>{s(!1),c.resetFields()},okText:`发送`,cancelText:`取消`,width:520,children:(0,Q.jsxs)(Y,{form:c,layout:`vertical`,style:{marginTop:16},children:[(0,Q.jsx)(Y.Item,{name:`title`,label:`消息标题`,rules:[{required:!0,message:`请输入标题`}],children:(0,Q.jsx)(Bj,{placeholder:`请输入消息标题`,size:`large`})}),(0,Q.jsx)(Y.Item,{name:`content`,label:`消息内容`,rules:[{required:!0,validator:(e,t)=>t&&t!==`
`?Promise.resolve():Promise.reject(`请输入内容`)}],children:(0,Q.jsx)(_5,{theme:`snow`,modules:v5,placeholder:`请输入消息内容(支持富文本:加粗、斜体、颜色、链接等)`,style:{height:180,marginBottom:40}})}),(0,Q.jsxs)(`div`,{style:{display:`flex`,gap:16},children:[(0,Q.jsx)(Y.Item,{name:`type`,label:`消息类型`,style:{flex:1},initialValue:`system`,rules:[{required:!0}],children:(0,Q.jsx)(sb,{size:`large`,options:[{value:`system`,label:`系统通知`},{value:`credit`,label:`积分通知`},{value:`promo`,label:`活动通知`}]})}),(0,Q.jsx)(Y.Item,{name:`target_user_id`,label:`发送目标`,style:{flex:1},extra:`留空则发送给全部用户`,children:(0,Q.jsx)(sb,{size:`large`,allowClear:!0,placeholder:`全部用户`,options:i.map(e=>({value:e.id,label:e.username}))})})]})]})}),(0,Q.jsx)(TM,{title:(0,Q.jsxs)(CA,{children:[(0,Q.jsx)(E$,{}),`已读用户 — `,l.title]}),open:l.open,onCancel:()=>{u({open:!1,notifId:``,title:``}),f([])},footer:null,width:480,children:p?(0,Q.jsx)(`div`,{style:{textAlign:`center`,padding:40},children:`加载中...`}):d.length===0?(0,Q.jsx)(Ky,{description:`暂无用户已读`,style:{padding:`40px 0`}}):(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`div`,{style:{marginBottom:12,color:`#64748b`,fontSize:13},children:[`共 `,d.length,` 人已读`]}),(0,Q.jsx)(QF,{dataSource:d,rowKey:`userId`,pagination:!1,size:`small`,columns:[{title:`用户名`,dataIndex:`username`,render:e=>(0,Q.jsx)(Z.Text,{strong:!0,children:e})},{title:`已读时间`,dataIndex:`readAt`,width:180,render:e=>C2(e)}]})]})})]})},L0e=o(((e,t)=>{var n={version:`1.15.0`};n[437]=(function(){for(var e=`\0\x07\b
+`).join(``);return e.insert(n,{table:Z8()})},new o6.default().retain(n.index));this.quill.updateContents(r,B6.sources.USER),this.quill.setSelection(n.index,B6.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(B6.events.SCROLL_OPTIMIZE,e=>{e.some(e=>[`TD`,`TR`,`TBODY`,`TABLE`].includes(e.target.tagName)?(this.quill.once(B6.events.TEXT_CHANGE,(e,t,n)=>{n===B6.sources.USER&&this.balanceTables()}),!0):!1)})}},Q8=x6(`quill:toolbar`),$8=class extends M6{constructor(e,t){if(super(e,t),Array.isArray(this.options.container)){let t=document.createElement(`div`);t.setAttribute(`role`,`toolbar`),m0e(t,this.options.container),e.container?.parentNode?.insertBefore(t,e.container),this.container=t}else typeof this.options.container==`string`?this.container=document.querySelector(this.options.container):this.container=this.options.container;if(!(this.container instanceof HTMLElement)){Q8.error(`Container required for toolbar`,this.options);return}this.container.classList.add(`ql-toolbar`),this.controls=[],this.handlers={},this.options.handlers&&Object.keys(this.options.handlers).forEach(e=>{let t=this.options.handlers?.[e];t&&this.addHandler(e,t)}),Array.from(this.container.querySelectorAll(`button, select`)).forEach(e=>{this.attach(e)}),this.quill.on(B6.events.EDITOR_CHANGE,()=>{let[e]=this.quill.selection.getRange();this.update(e)})}addHandler(e,t){this.handlers[e]=t}attach(e){let t=Array.from(e.classList).find(e=>e.indexOf(`ql-`)===0);if(!t)return;if(t=t.slice(3),e.tagName===`BUTTON`&&e.setAttribute(`type`,`button`),this.handlers[t]==null&&this.quill.scroll.query(t)==null){Q8.warn(`ignoring attaching to nonexistent format`,t,e);return}let n=e.tagName===`SELECT`?`change`:`click`;e.addEventListener(n,n=>{let r;if(e.tagName===`SELECT`){if(e.selectedIndex<0)return;let t=e.options[e.selectedIndex];r=t.hasAttribute(`selected`)?!1:t.value||!1}else r=e.classList.contains(`ql-active`)?!1:e.value||!e.hasAttribute(`value`),n.preventDefault();this.quill.focus();let[i]=this.quill.selection.getRange();if(this.handlers[t]!=null)this.handlers[t].call(this,r);else if(this.quill.scroll.query(t).prototype instanceof Q3){if(r=prompt(`Enter ${t}`),!r)return;this.quill.updateContents(new o6.default().retain(i.index).delete(i.length).insert({[t]:r}),B6.sources.USER)}else this.quill.format(t,r,B6.sources.USER);this.update(i)}),this.controls.push([t,e])}update(e){let t=e==null?{}:this.quill.getFormat(e);this.controls.forEach(n=>{let[r,i]=n;if(i.tagName===`SELECT`){let n=null;if(e==null)n=null;else if(t[r]==null)n=i.querySelector(`option[selected]`);else if(!Array.isArray(t[r])){let e=t[r];typeof e==`string`&&(e=e.replace(/"/g,`\\"`)),n=i.querySelector(`option[value="${e}"]`)}n==null?(i.value=``,i.selectedIndex=-1):n.selected=!0}else if(e==null)i.classList.remove(`ql-active`),i.setAttribute(`aria-pressed`,`false`);else if(i.hasAttribute(`value`)){let e=t[r],n=e===i.getAttribute(`value`)||e!=null&&e.toString()===i.getAttribute(`value`)||e==null&&!i.getAttribute(`value`);i.classList.toggle(`ql-active`,n),i.setAttribute(`aria-pressed`,n.toString())}else{let e=t[r]!=null;i.classList.toggle(`ql-active`,e),i.setAttribute(`aria-pressed`,e.toString())}})}};$8.DEFAULTS={};function e5(e,t,n){let r=document.createElement(`button`);r.setAttribute(`type`,`button`),r.classList.add(`ql-${t}`),r.setAttribute(`aria-pressed`,`false`),n==null?r.setAttribute(`aria-label`,t):(r.value=n,r.setAttribute(`aria-label`,`${t}: ${n}`)),e.appendChild(r)}function m0e(e,t){Array.isArray(t[0])||(t=[t]),t.forEach(t=>{let n=document.createElement(`span`);n.classList.add(`ql-formats`),t.forEach(e=>{if(typeof e==`string`)e5(n,e);else{let t=Object.keys(e)[0],r=e[t];Array.isArray(r)?h0e(n,t,r):e5(n,t,r)}}),e.appendChild(n)})}function h0e(e,t,n){let r=document.createElement(`select`);r.classList.add(`ql-${t}`),n.forEach(e=>{let t=document.createElement(`option`);e===!1?t.setAttribute(`selected`,`selected`):t.setAttribute(`value`,String(e)),r.appendChild(t)}),e.appendChild(r)}$8.DEFAULTS={container:null,handlers:{clean(){let e=this.quill.getSelection();if(e!=null)if(e.length===0){let e=this.quill.getFormat();Object.keys(e).forEach(e=>{this.quill.scroll.query(e,k3.INLINE)!=null&&this.quill.format(e,!1,B6.sources.USER)})}else this.quill.removeFormat(e.index,e.length,B6.sources.USER)},direction(e){let{align:t}=this.quill.getFormat();e===`rtl`&&t==null?this.quill.format(`align`,`right`,B6.sources.USER):!e&&t===`right`&&this.quill.format(`align`,!1,B6.sources.USER),this.quill.format(`direction`,e,B6.sources.USER)},indent(e){let t=this.quill.getSelection(),n=this.quill.getFormat(t),r=parseInt(n.indent||0,10);if(e===`+1`||e===`-1`){let t=e===`+1`?1:-1;n.direction===`rtl`&&(t*=-1),this.quill.format(`indent`,r+t,B6.sources.USER)}},link(e){e===!0&&(e=prompt(`Enter link URL:`)),this.quill.format(`link`,e,B6.sources.USER)},list(e){let t=this.quill.getSelection(),n=this.quill.getFormat(t);e===`check`?n.list===`checked`||n.list===`unchecked`?this.quill.format(`list`,!1,B6.sources.USER):this.quill.format(`list`,`unchecked`,B6.sources.USER):this.quill.format(`list`,e,B6.sources.USER)}}};var g0e=`
`,_0e=`
`,v0e=`
`,y0e=`
`,b0e=`
`,x0e=`
`,S0e=`
`,C0e=`
`,t5=`
`,n5={align:{"":g0e,center:_0e,right:v0e,justify:y0e},background:b0e,blockquote:x0e,bold:S0e,clean:C0e,code:t5,"code-block":t5,color:`
`,direction:{"":`
`,rtl:`
`},formula:`
`,header:{1:`
`,2:`
`,3:`
`,4:`
`,5:`
`,6:`
`},italic:`
`,image:`
`,indent:{"+1":`
`,"-1":`
`},link:`
`,list:{bullet:`
`,check:`
`,ordered:`
`},script:{sub:`
`,super:`
`},strike:`
`,table:`
`,underline:`
`,video:`
`},w0e=`
`,r5=0;function i5(e,t){e.setAttribute(t,`${e.getAttribute(t)!==`true`}`)}var a5=class{constructor(e){this.select=e,this.container=document.createElement(`span`),this.buildPicker(),this.select.style.display=`none`,this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener(`mousedown`,()=>{this.togglePicker()}),this.label.addEventListener(`keydown`,e=>{switch(e.key){case`Enter`:this.togglePicker();break;case`Escape`:this.escape(),e.preventDefault();break;default:}}),this.select.addEventListener(`change`,this.update.bind(this))}togglePicker(){this.container.classList.toggle(`ql-expanded`),i5(this.label,`aria-expanded`),i5(this.options,`aria-hidden`)}buildItem(e){let t=document.createElement(`span`);t.tabIndex=`0`,t.setAttribute(`role`,`button`),t.classList.add(`ql-picker-item`);let n=e.getAttribute(`value`);return n&&t.setAttribute(`data-value`,n),e.textContent&&t.setAttribute(`data-label`,e.textContent),t.addEventListener(`click`,()=>{this.selectItem(t,!0)}),t.addEventListener(`keydown`,e=>{switch(e.key){case`Enter`:this.selectItem(t,!0),e.preventDefault();break;case`Escape`:this.escape(),e.preventDefault();break;default:}}),t}buildLabel(){let e=document.createElement(`span`);return e.classList.add(`ql-picker-label`),e.innerHTML=w0e,e.tabIndex=`0`,e.setAttribute(`role`,`button`),e.setAttribute(`aria-expanded`,`false`),this.container.appendChild(e),e}buildOptions(){let e=document.createElement(`span`);e.classList.add(`ql-picker-options`),e.setAttribute(`aria-hidden`,`true`),e.tabIndex=`-1`,e.id=`ql-picker-options-${r5}`,r5+=1,this.label.setAttribute(`aria-controls`,e.id),this.options=e,Array.from(this.select.options).forEach(t=>{let n=this.buildItem(t);e.appendChild(n),t.selected===!0&&this.selectItem(n)}),this.container.appendChild(e)}buildPicker(){Array.from(this.select.attributes).forEach(e=>{this.container.setAttribute(e.name,e.value)}),this.container.classList.add(`ql-picker`),this.label=this.buildLabel(),this.buildOptions()}escape(){this.close(),setTimeout(()=>this.label.focus(),1)}close(){this.container.classList.remove(`ql-expanded`),this.label.setAttribute(`aria-expanded`,`false`),this.options.setAttribute(`aria-hidden`,`true`)}selectItem(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=this.container.querySelector(`.ql-selected`);e!==n&&(n?.classList.remove(`ql-selected`),e!=null&&(e.classList.add(`ql-selected`),this.select.selectedIndex=Array.from(e.parentNode.children).indexOf(e),e.hasAttribute(`data-value`)?this.label.setAttribute(`data-value`,e.getAttribute(`data-value`)):this.label.removeAttribute(`data-value`),e.hasAttribute(`data-label`)?this.label.setAttribute(`data-label`,e.getAttribute(`data-label`)):this.label.removeAttribute(`data-label`),t&&(this.select.dispatchEvent(new Event(`change`)),this.close())))}update(){let e;if(this.select.selectedIndex>-1){let t=this.container.querySelector(`.ql-picker-options`).children[this.select.selectedIndex];e=this.select.options[this.select.selectedIndex],this.selectItem(t)}else this.selectItem(null);let t=e!=null&&e!==this.select.querySelector(`option[selected]`);this.label.classList.toggle(`ql-active`,t)}},o5=class extends a5{constructor(e,t){super(e),this.label.innerHTML=t,this.container.classList.add(`ql-color-picker`),Array.from(this.container.querySelectorAll(`.ql-picker-item`)).slice(0,7).forEach(e=>{e.classList.add(`ql-primary`)})}buildItem(e){let t=super.buildItem(e);return t.style.backgroundColor=e.getAttribute(`value`)||``,t}selectItem(e,t){super.selectItem(e,t);let n=this.label.querySelector(`.ql-color-label`),r=e&&e.getAttribute(`data-value`)||``;n&&(n.tagName===`line`?n.style.stroke=r:n.style.fill=r)}},s5=class extends a5{constructor(e,t){super(e),this.container.classList.add(`ql-icon-picker`),Array.from(this.container.querySelectorAll(`.ql-picker-item`)).forEach(e=>{e.innerHTML=t[e.getAttribute(`data-value`)||``]}),this.defaultItem=this.container.querySelector(`.ql-selected`),this.selectItem(this.defaultItem)}selectItem(e,t){super.selectItem(e,t);let n=e||this.defaultItem;if(n!=null){if(this.label.innerHTML===n.innerHTML)return;this.label.innerHTML=n.innerHTML}}},T0e=e=>{let{overflowY:t}=getComputedStyle(e,null);return t!==`visible`&&t!==`clip`},c5=class{constructor(e,t){this.quill=e,this.boundsContainer=t||document.body,this.root=e.addContainer(`ql-tooltip`),this.root.innerHTML=this.constructor.TEMPLATE,T0e(this.quill.root)&&this.quill.root.addEventListener(`scroll`,()=>{this.root.style.marginTop=`${-1*this.quill.root.scrollTop}px`}),this.hide()}hide(){this.root.classList.add(`ql-hidden`)}position(e){let t=e.left+e.width/2-this.root.offsetWidth/2,n=e.bottom+this.quill.root.scrollTop;this.root.style.left=`${t}px`,this.root.style.top=`${n}px`,this.root.classList.remove(`ql-flip`);let r=this.boundsContainer.getBoundingClientRect(),i=this.root.getBoundingClientRect(),a=0;if(i.right>r.right&&(a=r.right-i.right,this.root.style.left=`${t+a}px`),i.left
r.bottom){let t=i.bottom-i.top,r=e.bottom-e.top+t;this.root.style.top=`${n-r}px`,this.root.classList.add(`ql-flip`)}return a}show(){this.root.classList.remove(`ql-editing`),this.root.classList.remove(`ql-hidden`)}},E0e=[!1,`center`,`right`,`justify`],D0e=`#000000.#e60000.#ff9900.#ffff00.#008a00.#0066cc.#9933ff.#ffffff.#facccc.#ffebcc.#ffffcc.#cce8cc.#cce0f5.#ebd6ff.#bbbbbb.#f06666.#ffc266.#ffff66.#66b966.#66a3e0.#c285ff.#888888.#a10000.#b26b00.#b2b200.#006100.#0047b2.#6b24b2.#444444.#5c0000.#663d00.#666600.#003700.#002966.#3d1466`.split(`.`),O0e=[!1,`serif`,`monospace`],k0e=[`1`,`2`,`3`,!1],A0e=[`small`,!1,`large`,`huge`],l5=class extends F6{constructor(e,t){super(e,t);let n=t=>{if(!document.body.contains(e.root)){document.body.removeEventListener(`click`,n);return}this.tooltip!=null&&!this.tooltip.root.contains(t.target)&&document.activeElement!==this.tooltip.textbox&&!this.quill.hasFocus()&&this.tooltip.hide(),this.pickers!=null&&this.pickers.forEach(e=>{e.container.contains(t.target)||e.close()})};e.emitter.listenDOM(`click`,document.body,n)}addModule(e){let t=super.addModule(e);return e===`toolbar`&&this.extendToolbar(t),t}buildButtons(e,t){Array.from(e).forEach(e=>{(e.getAttribute(`class`)||``).split(/\s+/).forEach(n=>{if(n.startsWith(`ql-`)&&(n=n.slice(3),t[n]!=null))if(n===`direction`)e.innerHTML=t[n][``]+t[n].rtl;else if(typeof t[n]==`string`)e.innerHTML=t[n];else{let r=e.value||``;r!=null&&t[n][r]&&(e.innerHTML=t[n][r])}})})}buildPickers(e,t){this.pickers=Array.from(e).map(e=>{if(e.classList.contains(`ql-align`)&&(e.querySelector(`option`)??d5(e,E0e),typeof t.align==`object`))return new s5(e,t.align);if(e.classList.contains(`ql-background`)||e.classList.contains(`ql-color`)){let n=e.classList.contains(`ql-background`)?`background`:`color`;return e.querySelector(`option`)??d5(e,D0e,n===`background`?`#ffffff`:`#000000`),new o5(e,t[n])}return e.querySelector(`option`)??(e.classList.contains(`ql-font`)?d5(e,O0e):e.classList.contains(`ql-header`)?d5(e,k0e):e.classList.contains(`ql-size`)&&d5(e,A0e)),new a5(e)}),this.quill.on(C6.events.EDITOR_CHANGE,()=>{this.pickers.forEach(e=>{e.update()})})}};l5.DEFAULTS=O3({},F6.DEFAULTS,{modules:{toolbar:{handlers:{formula(){this.quill.theme.tooltip.edit(`formula`)},image(){let e=this.container.querySelector(`input.ql-image[type=file]`);e??(e=document.createElement(`input`),e.setAttribute(`type`,`file`),e.setAttribute(`accept`,this.quill.uploader.options.mimetypes.join(`, `)),e.classList.add(`ql-image`),e.addEventListener(`change`,()=>{let t=this.quill.getSelection(!0);this.quill.uploader.upload(t,e.files),e.value=``}),this.container.appendChild(e)),e.click()},video(){this.quill.theme.tooltip.edit(`video`)}}}}});var u5=class extends c5{constructor(e,t){super(e,t),this.textbox=this.root.querySelector(`input[type="text"]`),this.listen()}listen(){this.textbox.addEventListener(`keydown`,e=>{e.key===`Enter`?(this.save(),e.preventDefault()):e.key===`Escape`&&(this.cancel(),e.preventDefault())})}cancel(){this.hide(),this.restoreFocus()}edit(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:`link`,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(this.root.classList.remove(`ql-hidden`),this.root.classList.add(`ql-editing`),this.textbox==null)return;t==null?e!==this.root.getAttribute(`data-mode`)&&(this.textbox.value=``):this.textbox.value=t;let n=this.quill.getBounds(this.quill.selection.savedRange);n!=null&&this.position(n),this.textbox.select(),this.textbox.setAttribute(`placeholder`,this.textbox.getAttribute(`data-${e}`)||``),this.root.setAttribute(`data-mode`,e)}restoreFocus(){this.quill.focus({preventScroll:!0})}save(){let{value:e}=this.textbox;switch(this.root.getAttribute(`data-mode`)){case`link`:{let{scrollTop:t}=this.quill.root;this.linkRange?(this.quill.formatText(this.linkRange,`link`,e,C6.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format(`link`,e,C6.sources.USER)),this.quill.root.scrollTop=t;break}case`video`:e=j0e(e);case`formula`:{if(!e)break;let t=this.quill.getSelection(!0);if(t!=null){let n=t.index+t.length;this.quill.insertEmbed(n,this.root.getAttribute(`data-mode`),e,C6.sources.USER),this.root.getAttribute(`data-mode`)===`formula`&&this.quill.insertText(n+1,` `,C6.sources.USER),this.quill.setSelection(n+2,C6.sources.USER)}break}default:}this.textbox.value=``,this.hide()}};function j0e(e){let t=e.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||e.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return t?`${t[1]||`https`}://www.youtube.com/embed/${t[2]}?showinfo=0`:(t=e.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?`${t[1]||`https`}://player.vimeo.com/video/${t[2]}/`:e}function d5(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;t.forEach(t=>{let r=document.createElement(`option`);t===n?r.setAttribute(`selected`,`selected`):r.setAttribute(`value`,String(t)),e.appendChild(r)})}var M0e=[[`bold`,`italic`,`link`],[{header:1},{header:2},`blockquote`]],N0e=class extends u5{static TEMPLATE=[` `,``].join(``);constructor(e,t){super(e,t),this.quill.on(C6.events.EDITOR_CHANGE,(e,t,n,r)=>{if(e===C6.events.SELECTION_CHANGE)if(t!=null&&t.length>0&&r===C6.sources.USER){this.show(),this.root.style.left=`0px`,this.root.style.width=``,this.root.style.width=`${this.root.offsetWidth}px`;let e=this.quill.getLines(t.index,t.length);if(e.length===1){let e=this.quill.getBounds(t);e!=null&&this.position(e)}else{let n=e[e.length-1],r=this.quill.getIndex(n),i=Math.min(n.length()-1,t.index+t.length-r),a=this.quill.getBounds(new T6(r,i));a!=null&&this.position(a)}}else document.activeElement!==this.textbox&&this.quill.hasFocus()&&this.hide()})}listen(){super.listen(),this.root.querySelector(`.ql-close`).addEventListener(`click`,()=>{this.root.classList.remove(`ql-editing`)}),this.quill.on(C6.events.SCROLL_OPTIMIZE,()=>{setTimeout(()=>{if(this.root.classList.contains(`ql-hidden`))return;let e=this.quill.getSelection();if(e!=null){let t=this.quill.getBounds(e);t!=null&&this.position(t)}},1)})}cancel(){this.show()}position(e){let t=super.position(e),n=this.root.querySelector(`.ql-tooltip-arrow`);return n.style.marginLeft=``,t!==0&&(n.style.marginLeft=`${-1*t-n.offsetWidth/2}px`),t}},f5=class extends l5{constructor(e,t){t.modules.toolbar!=null&&t.modules.toolbar.container==null&&(t.modules.toolbar.container=M0e),super(e,t),this.quill.container.classList.add(`ql-bubble`)}extendToolbar(e){this.tooltip=new N0e(this.quill,this.options.bounds),e.container!=null&&(this.tooltip.root.appendChild(e.container),this.buildButtons(e.container.querySelectorAll(`button`),n5),this.buildPickers(e.container.querySelectorAll(`select`),n5))}};f5.DEFAULTS=O3({},l5.DEFAULTS,{modules:{toolbar:{handlers:{link(e){e?this.quill.theme.tooltip.edit():this.quill.format(`link`,!1,B6.sources.USER)}}}}});var P0e=[[{header:[`1`,`2`,`3`,!1]}],[`bold`,`italic`,`underline`,`link`],[{list:`ordered`},{list:`bullet`}],[`clean`]],F0e=class extends u5{static TEMPLATE=[` `,` `,` `,` `].join(``);preview=this.root.querySelector(`a.ql-preview`);listen(){super.listen(),this.root.querySelector(`a.ql-action`).addEventListener(`click`,e=>{this.root.classList.contains(`ql-editing`)?this.save():this.edit(`link`,this.preview.textContent),e.preventDefault()}),this.root.querySelector(`a.ql-remove`).addEventListener(`click`,e=>{if(this.linkRange!=null){let e=this.linkRange;this.restoreFocus(),this.quill.formatText(e,`link`,!1,C6.sources.USER),delete this.linkRange}e.preventDefault(),this.hide()}),this.quill.on(C6.events.SELECTION_CHANGE,(e,t,n)=>{if(e!=null){if(e.length===0&&n===C6.sources.USER){let[t,n]=this.quill.scroll.descendant(R8,e.index);if(t!=null){this.linkRange=new T6(e.index-n,t.length());let r=R8.formats(t.domNode);this.preview.textContent=r,this.preview.setAttribute(`href`,r),this.show();let i=this.quill.getBounds(this.linkRange);i!=null&&this.position(i);return}}else delete this.linkRange;this.hide()}})}show(){super.show(),this.root.removeAttribute(`data-mode`)}},p5=class extends l5{constructor(e,t){t.modules.toolbar!=null&&t.modules.toolbar.container==null&&(t.modules.toolbar.container=P0e),super(e,t),this.quill.container.classList.add(`ql-snow`)}extendToolbar(e){e.container!=null&&(e.container.classList.add(`ql-snow`),this.buildButtons(e.container.querySelectorAll(`button`),n5),this.buildPickers(e.container.querySelectorAll(`select`),n5),this.tooltip=new F0e(this.quill,this.options.bounds),e.container.querySelector(`.ql-link`)&&this.quill.keyboard.addBinding({key:`k`,shortKey:!0},(t,n)=>{e.handlers.link.call(e,!n.format.link)}))}};p5.DEFAULTS=O3({},l5.DEFAULTS,{modules:{toolbar:{handlers:{link(e){if(e){let e=this.quill.getSelection();if(e==null||e.length===0)return;let t=this.quill.getText(e);/^\S+@\S+\.\S+$/.test(t)&&t.indexOf(`mailto:`)!==0&&(t=`mailto:${t}`);let{tooltip:n}=this.quill.theme;n.edit(`link`,t)}else this.quill.format(`link`,!1,B6.sources.USER)}}}}}),P8.register({"attributors/attribute/direction":s8,"attributors/class/align":Q6,"attributors/class/background":m1e,"attributors/class/color":p1e,"attributors/class/direction":c8,"attributors/class/font":d8,"attributors/class/size":p8,"attributors/style/align":$6,"attributors/style/background":n8,"attributors/style/color":t8,"attributors/style/direction":l8,"attributors/style/font":f8,"attributors/style/size":m8},!0),P8.register({"formats/align":Q6,"formats/direction":c8,"formats/indent":n0e,"formats/background":n8,"formats/color":t8,"formats/font":d8,"formats/size":p8,"formats/blockquote":r0e,"formats/code-block":i8,"formats/header":i0e,"formats/list":I8,"formats/bold":L8,"formats/code":a8,"formats/italic":a0e,"formats/link":R8,"formats/script":o0e,"formats/strike":s0e,"formats/underline":c0e,"formats/formula":l0e,"formats/image":u0e,"formats/video":d0e,"modules/syntax":K8,"modules/table":p0e,"modules/toolbar":$8,"themes/bubble":f5,"themes/snow":p5,"ui/icons":n5,"ui/picker":a5,"ui/icon-picker":s5,"ui/color-picker":o5,"ui/tooltip":c5},!0);var m5=P8,h5=class extends C.Component{constructor(e){super(e),this.editingAreaRef=(0,C.createRef)(),this.containerRef=(0,C.createRef)(),this.dirtyProps=[`modules`,`formats`,`bounds`,`theme`,`children`],this.cleanProps=[`id`,`className`,`style`,`placeholder`,`tabIndex`,`onChange`,`onChangeSelection`,`onFocus`,`onBlur`,`onKeyPress`,`onKeyDown`,`onKeyUp`,`useSemanticHTML`],this.state={generation:0},this.selection=null,this.onEditorChange=(e,t,n,r)=>{e===`text-change`?this.onEditorChangeText?.(this.props.useSemanticHTML===!1?this.editor.root.innerHTML:this.editor.getSemanticHTML(),t,r,this.unprivilegedEditor):e===`selection-change`&&this.onEditorChangeSelection?.(t,r,this.unprivilegedEditor)};let t=this.isControlled()?e.value:e.defaultValue;this.value=t??``}validateProps(e){if(C.Children.count(e.children)>1)throw Error(`The Quill editing area can only be composed of a single React element.`);if(C.Children.count(e.children)&&C.Children.only(e.children)?.type===`textarea`)throw Error(`Quill does not support editing on a