diff --git a/video-gen-admin/dist/assets/index-HLrSzVLG.js b/video-gen-admin/dist/assets/index-C8W5sIyJ.js similarity index 99% rename from video-gen-admin/dist/assets/index-HLrSzVLG.js rename to video-gen-admin/dist/assets/index-C8W5sIyJ.js index f914b6f2..20086752 100644 --- a/video-gen-admin/dist/assets/index-HLrSzVLG.js +++ b/video-gen-admin/dist/assets/index-C8W5sIyJ.js @@ -437,7 +437,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `,{[i8.blotName]:t}),e.insert(n)),new o6.default);let n=this.quill.root.ownerDocument.createElement(`div`);return n.classList.add(i8.className),n.innerHTML=f0e(this.options.hljs,t,e),O8(this.quill.scroll,n,[(e,t)=>{let n=H8.value(e);return n?t.compose(new o6.default().retain(t.length(),{[U8.blotName]:n})):t}],[(e,n)=>e.data.split(` `).reduce((e,n,r)=>(r!==0&&e.insert(` `,{[i8.blotName]:t}),e.insert(n)),n)],new WeakMap)}};K8.DEFAULTS={hljs:window.hljs,interval:1e3,languages:[{key:`plain`,label:`Plain`},{key:`bash`,label:`Bash`},{key:`cpp`,label:`C++`},{key:`cs`,label:`C#`},{key:`css`,label:`CSS`},{key:`diff`,label:`Diff`},{key:`xml`,label:`HTML/XML`},{key:`java`,label:`Java`},{key:`javascript`,label:`JavaScript`},{key:`markdown`,label:`Markdown`},{key:`php`,label:`PHP`},{key:`python`,label:`Python`},{key:`ruby`,label:`Ruby`},{key:`sql`,label:`SQL`}]};var q8=class e extends f6{static blotName=`table`;static tagName=`TD`;static create(e){let t=super.create();return e?t.setAttribute(`data-row`,e):t.setAttribute(`data-row`,Z8()),t}static formats(e){if(e.hasAttribute(`data-row`))return e.getAttribute(`data-row`)}cellOffset(){return this.parent?this.parent.children.indexOf(this):-1}format(t,n){t===e.blotName&&n?this.domNode.setAttribute(`data-row`,n):super.format(t,n)}row(){return this.parent}rowOffset(){return this.row()?this.row().rowOffset():-1}table(){return this.row()&&this.row().table()}},J8=class extends q6{static blotName=`table-row`;static tagName=`TR`;checkMerge(){if(super.checkMerge()&&this.next.children.head!=null){let e=this.children.head.formats(),t=this.children.tail.formats(),n=this.next.children.head.formats(),r=this.next.children.tail.formats();return e.table===t.table&&e.table===n.table&&e.table===r.table}return!1}optimize(e){super.optimize(e),this.children.forEach(e=>{if(e.next==null)return;let t=e.formats(),n=e.next.formats();if(t.table!==n.table){let t=this.splitAfter(e);t&&t.optimize(),this.prev&&this.prev.optimize()}})}rowOffset(){return this.parent?this.parent.children.indexOf(this):-1}table(){return this.parent&&this.parent.parent}},Y8=class extends q6{static blotName=`table-body`;static tagName=`TBODY`},X8=class extends q6{static blotName=`table-container`;static tagName=`TABLE`;balanceCells(){let e=this.descendants(J8),t=e.reduce((e,t)=>Math.max(t.children.length,e),0);e.forEach(e=>{Array(t-e.children.length).fill(0).forEach(()=>{let t;e.children.head!=null&&(t=q8.formats(e.children.head.domNode));let n=this.scroll.create(q8.blotName,t);e.appendChild(n),n.optimize()})})}cells(e){return this.rows().map(t=>t.children.at(e))}deleteColumn(e){let[t]=this.descendant(Y8);t==null||t.children.head==null||t.children.forEach(t=>{t.children.at(e)?.remove()})}insertColumn(e){let[t]=this.descendant(Y8);t==null||t.children.head==null||t.children.forEach(t=>{let n=t.children.at(e),r=q8.formats(t.children.head.domNode),i=this.scroll.create(q8.blotName,r);t.insertBefore(i,n)})}insertRow(e){let[t]=this.descendant(Y8);if(t==null||t.children.head==null)return;let n=Z8(),r=this.scroll.create(J8.blotName);t.children.head.children.forEach(()=>{let e=this.scroll.create(q8.blotName,n);r.appendChild(e)});let i=t.children.at(e);t.insertBefore(r,i)}rows(){let e=this.children.head;return e==null?[]:e.children.map(e=>e)}};X8.allowedChildren=[Y8],Y8.requiredContainer=X8,Y8.allowedChildren=[J8],J8.requiredContainer=Y8,J8.allowedChildren=[q8],q8.requiredContainer=J8;function Z8(){return`row-${Math.random().toString(36).slice(2,6)}`}var p0e=class extends M6{static register(){B6.register(q8),B6.register(J8),B6.register(Y8),B6.register(X8)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(X8).forEach(e=>{e.balanceCells()})}deleteColumn(){let[e,,t]=this.getTable();t!=null&&(e.deleteColumn(t.cellOffset()),this.quill.update(B6.sources.USER))}deleteRow(){let[,e]=this.getTable();e!=null&&(e.remove(),this.quill.update(B6.sources.USER))}deleteTable(){let[e]=this.getTable();if(e==null)return;let t=e.offset();e.remove(),this.quill.update(B6.sources.USER),this.quill.setSelection(t,B6.sources.SILENT)}getTable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.quill.getSelection();if(e==null)return[null,null,null,-1];let[t,n]=this.quill.getLine(e.index);if(t==null||t.statics.blotName!==q8.blotName)return[null,null,null,-1];let r=t.parent;return[r.parent.parent,r,t,n]}insertColumn(e){let t=this.quill.getSelection();if(!t)return;let[n,r,i]=this.getTable(t);if(i==null)return;let a=i.cellOffset();n.insertColumn(a+e),this.quill.update(B6.sources.USER);let o=r.rowOffset();e===0&&(o+=1),this.quill.setSelection(t.index+o,t.length,B6.sources.SILENT)}insertColumnLeft(){this.insertColumn(0)}insertColumnRight(){this.insertColumn(1)}insertRow(e){let t=this.quill.getSelection();if(!t)return;let[n,r,i]=this.getTable(t);if(i==null)return;let a=r.rowOffset();n.insertRow(a+e),this.quill.update(B6.sources.USER),e>0?this.quill.setSelection(t,B6.sources.SILENT):this.quill.setSelection(t.index+r.children.length,t.length,B6.sources.SILENT)}insertRowAbove(){this.insertRow(0)}insertRowBelow(){this.insertRow(1)}insertTable(e,t){let n=this.quill.getSelection();if(n==null)return;let r=Array(e).fill(0).reduce(e=>{let n=Array(t).fill(` -`).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.leftr.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