import{al as rr,am as JL}from"./index-fb87886b.js";var sr={exports:{}};sr.exports;(function(Ce,Me){(function(to){const Ye=to.zh=to.zh||{};Ye.dictionary=Object.assign(Ye.dictionary||{},{"%0 of %1":"%0/%1",Accept:"接受","Align cell text to the bottom":"向下對齊","Align cell text to the center":"置中對齊","Align cell text to the left":"靠左對齊","Align cell text to the middle":"置中對齊","Align cell text to the right":"靠右對齊","Align cell text to the top":"向上對齊","Align table to the left":"靠左對齊","Align table to the right":"靠右對齊",Alignment:"對齊",Aquamarine:"淺綠色",Background:"背景顏色",Big:"大",Black:"黑色","Block quote":"段落引用","Block styles":"區塊樣式",Blue:"藍色",Bold:"粗體",Border:"邊框","Break text":"上及下","Bulleted List":"符號清單","Bulleted list styles toolbar":"無序清單工具列",Cancel:"取消","Caption for image: %0":"影像標題:%0","Caption for the image":"影像的標題","Cell properties":"儲存格屬性","Center table":"置中對齊","Centered image":"置中圖片","Change image text alternative":"修改圖片的替代文字","Choose heading":"選取標題",Circle:"空心圓點",Clear:"清除","Click to edit block":"點擊來編輯區塊",Code:"代碼",Color:"文字顏色","Color picker":"顏色選擇",Column:"欄",Dashed:"虛線",Decimal:"數字","Decimal with leading zero":"0開頭的數字","Decrease indent":"減少縮排",Default:"預設","Delete column":"刪除欄","Delete row":"刪除列","Dim grey":"淡灰色",Dimensions:"尺寸",Disc:"實心圓點","Document colors":"文件顏色",Dotted:"點線",Double:"雙線",Downloadable:"可下載","Drag to move":"拖曳來移動","Dropdown toolbar":"下拉選單","Edit block":"編輯區塊","Edit link":"編輯連結","Editor block content toolbar":"編輯器區塊內容工具列","Editor contextual toolbar":"編輯器關聯式工具列","Editor editing area: %0":"編輯器編輯區:%0","Editor toolbar":"編輯器工具","Enter image caption":"輸入圖片說明","Enter table caption":"輸入表標題","Font Background Color":"前景顏色","Font Color":"字體顏色","Font Family":"字型","Font Size":"字體大小","Full size image":"完整尺寸圖片",Green:"綠色",Grey:"灰色",Groove:"內凹線","Header column":"標題欄","Header row":"標題列",Heading:"標題","Heading 1":"標題 1","Heading 2":"標題 2","Heading 3":"標題 3","Heading 4":"標題 4","Heading 5":"標題 5","Heading 6":"標題 6",Height:"高度",HEX:"十六進位","Horizontal text alignment toolbar":"水平對齊","HTML object":"HTML 物件",Huge:"特大","Image resize list":"圖片縮放清單","Image toolbar":"圖片工具","image widget":"圖片小工具","In line":"行中","Increase indent":"增加縮排",Insert:"插入","Insert column left":"插入左方欄","Insert column right":"插入右方欄","Insert image":"插入圖片","Insert image via URL":"使用連結插入圖片","Insert media":"插入影音","Insert paragraph after block":"在這個區塊後面插入一個段落","Insert paragraph before block":"在這個區塊前面插入一個段落","Insert row above":"插入上方列","Insert row below":"插入下方列","Insert table":"插入表格",Inset:"內邊線",Italic:"斜體","Justify cell text":"分散對齊","Left aligned image":"向左對齊圖片","Light blue":"亮藍色","Light green":"亮綠色","Light grey":"亮灰色",Link:"連結","Link image":"圖片連結","Link URL":"連結˙ URL","List properties":"清單屬性","Lower-latin":"小寫拉丁字母","Lower–roman":"小寫羅馬數字","Media toolbar":"影音工具","Media URL":"影音網址","media widget":"影音小工具","Merge cell down":"合併下方儲存格","Merge cell left":"合併左方儲存格","Merge cell right":"合併右方儲存格","Merge cell up":"合併上方儲存格","Merge cells":"合併儲存格","Multiple styles":"多重樣式",Next:"下一","No results found":"找不到結果","No searchable items":"沒有可搜尋的項目",None:"無","Numbered List":"有序清單","Numbered list styles toolbar":"有序清單工具列","Open in a new tab":"在新視窗開啟","Open link in new tab":"在新視窗開啟連結","Open media in new tab":"在新分頁打開媒體",Orange:"橘色",Original:"原始圖片",Outset:"外框線",Padding:"儲存格留白",Paragraph:"段落","Paste the media URL in the input.":"在輸入框貼上影音網址。","Press Enter to type after or press Shift + Enter to type before the widget":"按下 Enter 在小工具後輸入,或按下 Shift + Enter 在小工具前輸入",Previous:"上一",Purple:"紫色",Red:"紅色",Redo:"重做","Remove color":"移除顏色","Replace from computer":"從電腦替換","Replace image":"替換圖片","Replace image from computer":"從電腦替換圖片","Resize image":"縮放圖片","Resize image to %0":"縮放圖片到 %0","Resize image to the original size":"縮放圖片到原始尺寸","Restore default":"重設至預設值","Reversed order":"反轉順序","Rich Text Editor":"富文本編輯器",Ridge:"凸起線","Right aligned image":"向右對齊圖片",Row:"列",Save:"儲存","Select all":"選取全部","Select column":"選擇欄","Select row":"選擇列","Show more items":"顯示更多","Side image":"側邊圖片",Small:"小",Solid:"實線",Source:"原始碼","Split cell horizontally":"水平分割儲存格","Split cell vertically":"垂直分割儲存格",Square:"方形","Start at":"起始於","Start index must be greater than 0.":"起始索引須大於 0。",Strikethrough:"刪除線",Style:"樣式",Styles:"樣式",Subscript:"下標",Superscript:"上標","Table alignment toolbar":"表格對齊","Table cell text alignment":"儲存格文字對齊","Table properties":"表格屬性","Table toolbar":"表格工具","Text alternative":"替代文字","Text styles":"文字樣式",'The color is invalid. Try "#FF0000" or "rgb(255,0,0)" or "red".':'顏色代碼錯誤。試試看 "#FF0000" 或 "rgb(255, 0, 0)" 或 "red"。',"The URL must not be empty.":"網址不能空白。",'The value is invalid. Try "10px" or "2em" or simply "2".':'尺寸代碼錯誤。試試看 "10px" 或 "2em" 或簡單寫 "2"。',"This link has no URL":"此連結沒有URL","This media URL is not supported.":"不支援此影音網址。",Tiny:"特小","Tip: Paste the URL into the content to embed faster.":"提示:在內容貼上網址更快崁入。","To-do List":"代辦清單","Toggle caption off":"關閉表標題","Toggle caption on":"開啟表標題","Toggle the circle list style":"切換為空心圓點標示","Toggle the decimal list style":"切換為數字標示","Toggle the decimal with leading zero list style":"切換為0開頭的數字標示","Toggle the disc list style":"切換為實心圓點標示","Toggle the lower–latin list style":"切換為小寫拉丁文字標示","Toggle the lower–roman list style":"切換為小寫羅馬數字標示","Toggle the square list style":"切換為方形標示","Toggle the upper–latin list style":"切換為大寫拉丁文字標示","Toggle the upper–roman list style":"切換為大寫羅馬數字標示",Turquoise:"藍綠色","Type or paste your content here.":"在此輸入或貼上你的內容。","Type your title":"輸入你的標題",Underline:"底線",Undo:"取消",Unlink:"移除連結",Update:"更新","Update image URL":"更新圖片連結","Upload failed":"上傳失敗","Upload from computer":"從電腦上傳","Upload image from computer":"從電腦上傳圖片","Upload in progress":"正在上傳","Upper-latin":"大寫拉丁字母","Upper-roman":"大寫羅馬數字","Vertical text alignment toolbar":"垂直對齊",White:"白色","Widget toolbar":"小工具",Width:"寬度","Wrap text":"文繞圖",Yellow:"黃色"}),Ye.getPluralForm=function(L){return 0}})(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));/*!
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md.
*/(function(Ye,L){Ce.exports=L()})(self,()=>(()=>{var to={8168:(C,v,h)=>{const _=h(8874),x={};for(const g of Object.keys(_))x[_[g]]=g;const k={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};C.exports=k;for(const g of Object.keys(k)){if(!("channels"in k[g]))throw new Error("missing channels property: "+g);if(!("labels"in k[g]))throw new Error("missing channel labels property: "+g);if(k[g].labels.length!==k[g].channels)throw new Error("channel and label counts mismatch: "+g);const{channels:f,labels:A}=k[g];delete k[g].channels,delete k[g].labels,Object.defineProperty(k[g],"channels",{value:f}),Object.defineProperty(k[g],"labels",{value:A})}k.rgb.hsl=function(g){const f=g[0]/255,A=g[1]/255,y=g[2]/255,E=Math.min(f,A,y),I=Math.max(f,A,y),N=I-E;let F,W;I===E?F=0:f===I?F=(A-y)/N:A===I?F=2+(y-f)/N:y===I&&(F=4+(f-A)/N),F=Math.min(F*60,360),F<0&&(F+=360);const j=(E+I)/2;return I===E?W=0:j<=.5?W=N/(I+E):W=N/(2-I-E),[F,W*100,j*100]},k.rgb.hsv=function(g){let f,A,y,E,I;const N=g[0]/255,F=g[1]/255,W=g[2]/255,j=Math.max(N,F,W),$=j-Math.min(N,F,W),Z=function(ot){return(j-ot)/6/$+1/2};return $===0?(E=0,I=0):(I=$/j,f=Z(N),A=Z(F),y=Z(W),N===j?E=y-A:F===j?E=.3333333333333333+f-y:W===j&&(E=.6666666666666666+A-f),E<0?E+=1:E>1&&(E-=1)),[E*360,I*100,j*100]},k.rgb.hwb=function(g){const f=g[0],A=g[1];let y=g[2];const E=k.rgb.hsl(g)[0],I=1/255*Math.min(f,Math.min(A,y));return y=1-.00392156862745098*Math.max(f,Math.max(A,y)),[E,I*100,y*100]},k.rgb.cmyk=function(g){const f=g[0]/255,A=g[1]/255,y=g[2]/255,E=Math.min(1-f,1-A,1-y),I=(1-f-E)/(1-E)||0,N=(1-A-E)/(1-E)||0,F=(1-y-E)/(1-E)||0;return[I*100,N*100,F*100,E*100]};function D(g,f){return(g[0]-f[0])**2+(g[1]-f[1])**2+(g[2]-f[2])**2}k.rgb.keyword=function(g){const f=x[g];if(f)return f;let A=1/0,y;for(const E of Object.keys(_)){const I=_[E],N=D(g,I);N.04045?((f+.055)/1.055)**2.4:f/12.92,A=A>.04045?((A+.055)/1.055)**2.4:A/12.92,y=y>.04045?((y+.055)/1.055)**2.4:y/12.92;const E=f*.4124+A*.3576+y*.1805,I=f*.2126+A*.7152+y*.0722,N=f*.0193+A*.1192+y*.9505;return[E*100,I*100,N*100]},k.rgb.lab=function(g){const f=k.rgb.xyz(g);let A=f[0],y=f[1],E=f[2];A/=95.047,y/=100,E/=108.883,A=A>.008856?A**.3333333333333333:7.787*A+.13793103448275862,y=y>.008856?y**.3333333333333333:7.787*y+.13793103448275862,E=E>.008856?E**.3333333333333333:7.787*E+.13793103448275862;const I=116*y-16,N=500*(A-y),F=200*(y-E);return[I,N,F]},k.hsl.rgb=function(g){const f=g[0]/360,A=g[1]/100,y=g[2]/100;let E,I,N;if(A===0)return N=y*255,[N,N,N];y<.5?E=y*(1+A):E=y+A-y*A;const F=2*y-E,W=[0,0,0];for(let j=0;j<3;j++)I=f+.3333333333333333*-(j-1),I<0&&I++,I>1&&I--,6*I<1?N=F+(E-F)*6*I:2*I<1?N=E:3*I<2?N=F+(E-F)*(.6666666666666666-I)*6:N=F,W[j]=N*255;return W},k.hsl.hsv=function(g){const f=g[0];let A=g[1]/100,y=g[2]/100,E=A;const I=Math.max(y,.01);y*=2,A*=y<=1?y:2-y,E*=I<=1?I:2-I;const N=(y+A)/2,F=y===0?2*E/(I+E):2*A/(y+A);return[f,F*100,N*100]},k.hsv.rgb=function(g){const f=g[0]/60,A=g[1]/100;let y=g[2]/100;const E=Math.floor(f)%6,I=f-Math.floor(f),N=255*y*(1-A),F=255*y*(1-A*I),W=255*y*(1-A*(1-I));switch(y*=255,E){case 0:return[y,W,N];case 1:return[F,y,N];case 2:return[N,y,W];case 3:return[N,F,y];case 4:return[W,N,y];case 5:return[y,N,F]}},k.hsv.hsl=function(g){const f=g[0],A=g[1]/100,y=g[2]/100,E=Math.max(y,.01);let I,N;N=(2-A)*y;const F=(2-A)*E;return I=A*E,I/=F<=1?F:2-F,I=I||0,N/=2,[f,I*100,N*100]},k.hwb.rgb=function(g){const f=g[0]/360;let A=g[1]/100,y=g[2]/100;const E=A+y;let I;E>1&&(A/=E,y/=E);const N=Math.floor(6*f),F=1-y;I=6*f-N,N&1&&(I=1-I);const W=A+I*(F-A);let j,$,Z;switch(N){default:case 6:case 0:j=F,$=W,Z=A;break;case 1:j=W,$=F,Z=A;break;case 2:j=A,$=F,Z=W;break;case 3:j=A,$=W,Z=F;break;case 4:j=W,$=A,Z=F;break;case 5:j=F,$=A,Z=W;break}return[j*255,$*255,Z*255]},k.cmyk.rgb=function(g){const f=g[0]/100,A=g[1]/100,y=g[2]/100,E=g[3]/100,I=1-Math.min(1,f*(1-E)+E),N=1-Math.min(1,A*(1-E)+E),F=1-Math.min(1,y*(1-E)+E);return[I*255,N*255,F*255]},k.xyz.rgb=function(g){const f=g[0]/100,A=g[1]/100,y=g[2]/100;let E,I,N;return E=f*3.2406+A*-1.5372+y*-.4986,I=f*-.9689+A*1.8758+y*.0415,N=f*.0557+A*-.204+y*1.057,E=E>.0031308?1.055*E**.4166666666666667-.055:E*12.92,I=I>.0031308?1.055*I**.4166666666666667-.055:I*12.92,N=N>.0031308?1.055*N**.4166666666666667-.055:N*12.92,E=Math.min(Math.max(0,E),1),I=Math.min(Math.max(0,I),1),N=Math.min(Math.max(0,N),1),[E*255,I*255,N*255]},k.xyz.lab=function(g){let f=g[0],A=g[1],y=g[2];f/=95.047,A/=100,y/=108.883,f=f>.008856?f**.3333333333333333:7.787*f+.13793103448275862,A=A>.008856?A**.3333333333333333:7.787*A+.13793103448275862,y=y>.008856?y**.3333333333333333:7.787*y+.13793103448275862;const E=116*A-16,I=500*(f-A),N=200*(A-y);return[E,I,N]},k.lab.xyz=function(g){const f=g[0],A=g[1],y=g[2];let E,I,N;I=(f+16)/116,E=A/500+I,N=I-y/200;const F=I**3,W=E**3,j=N**3;return I=F>.008856?F:(I-.13793103448275862)/7.787,E=W>.008856?W:(E-.13793103448275862)/7.787,N=j>.008856?j:(N-.13793103448275862)/7.787,E*=95.047,I*=100,N*=108.883,[E,I,N]},k.lab.lch=function(g){const f=g[0],A=g[1],y=g[2];let E;E=Math.atan2(y,A)*360/2/Math.PI,E<0&&(E+=360);const N=Math.sqrt(A*A+y*y);return[f,N,E]},k.lch.lab=function(g){const f=g[0],A=g[1],E=g[2]/360*2*Math.PI,I=A*Math.cos(E),N=A*Math.sin(E);return[f,I,N]},k.rgb.ansi16=function(g,f=null){const[A,y,E]=g;let I=f===null?k.rgb.hsv(g)[2]:f;if(I=Math.round(I/50),I===0)return 30;let N=30+(Math.round(E/255)<<2|Math.round(y/255)<<1|Math.round(A/255));return I===2&&(N+=60),N},k.hsv.ansi16=function(g){return k.rgb.ansi16(k.hsv.rgb(g),g[2])},k.rgb.ansi256=function(g){const f=g[0],A=g[1],y=g[2];return f===A&&A===y?f<8?16:f>248?231:Math.round((f-8)/247*24)+232:16+36*Math.round(f/255*5)+6*Math.round(A/255*5)+Math.round(y/255*5)},k.ansi16.rgb=function(g){let f=g%10;if(f===0||f===7)return g>50&&(f+=3.5),f=f/10.5*255,[f,f,f];const A=(~~(g>50)+1)*.5,y=(f&1)*A*255,E=(f>>1&1)*A*255,I=(f>>2&1)*A*255;return[y,E,I]},k.ansi256.rgb=function(g){if(g>=232){const I=(g-232)*10+8;return[I,I,I]}g-=16;let f;const A=Math.floor(g/36)/5*255,y=Math.floor((f=g%36)/6)/5*255,E=f%6/5*255;return[A,y,E]},k.rgb.hex=function(g){const A=(((Math.round(g[0])&255)<<16)+((Math.round(g[1])&255)<<8)+(Math.round(g[2])&255)).toString(16).toUpperCase();return"000000".substring(A.length)+A},k.hex.rgb=function(g){const f=g.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!f)return[0,0,0];let A=f[0];f[0].length===3&&(A=A.split("").map(F=>F+F).join(""));const y=parseInt(A,16),E=y>>16&255,I=y>>8&255,N=y&255;return[E,I,N]},k.rgb.hcg=function(g){const f=g[0]/255,A=g[1]/255,y=g[2]/255,E=Math.max(Math.max(f,A),y),I=Math.min(Math.min(f,A),y),N=E-I;let F,W;return N<1?F=I/(1-N):F=0,N<=0?W=0:E===f?W=(A-y)/N%6:E===A?W=2+(y-f)/N:W=4+(f-A)/N,W/=6,W%=1,[W*360,N*100,F*100]},k.hsl.hcg=function(g){const f=g[1]/100,A=g[2]/100,y=A<.5?2*f*A:2*f*(1-A);let E=0;return y<1&&(E=(A-.5*y)/(1-y)),[g[0],y*100,E*100]},k.hsv.hcg=function(g){const f=g[1]/100,A=g[2]/100,y=f*A;let E=0;return y<1&&(E=(A-y)/(1-y)),[g[0],y*100,E*100]},k.hcg.rgb=function(g){const f=g[0]/360,A=g[1]/100,y=g[2]/100;if(A===0)return[y*255,y*255,y*255];const E=[0,0,0],I=f%1*6,N=I%1,F=1-N;let W=0;switch(Math.floor(I)){case 0:E[0]=1,E[1]=N,E[2]=0;break;case 1:E[0]=F,E[1]=1,E[2]=0;break;case 2:E[0]=0,E[1]=1,E[2]=N;break;case 3:E[0]=0,E[1]=F,E[2]=1;break;case 4:E[0]=N,E[1]=0,E[2]=1;break;default:E[0]=1,E[1]=0,E[2]=F}return W=(1-A)*y,[(A*E[0]+W)*255,(A*E[1]+W)*255,(A*E[2]+W)*255]},k.hcg.hsv=function(g){const f=g[1]/100,A=g[2]/100,y=f+A*(1-f);let E=0;return y>0&&(E=f/y),[g[0],E*100,y*100]},k.hcg.hsl=function(g){const f=g[1]/100,y=g[2]/100*(1-f)+.5*f;let E=0;return y>0&&y<.5?E=f/(2*y):y>=.5&&y<1&&(E=f/(2*(1-y))),[g[0],E*100,y*100]},k.hcg.hwb=function(g){const f=g[1]/100,A=g[2]/100,y=f+A*(1-f);return[g[0],(y-f)*100,(1-y)*100]},k.hwb.hcg=function(g){const f=g[1]/100,y=1-g[2]/100,E=y-f;let I=0;return E<1&&(I=(y-E)/(1-E)),[g[0],E*100,I*100]},k.apple.rgb=function(g){return[g[0]/65535*255,g[1]/65535*255,g[2]/65535*255]},k.rgb.apple=function(g){return[g[0]/255*65535,g[1]/255*65535,g[2]/255*65535]},k.gray.rgb=function(g){return[g[0]/100*255,g[0]/100*255,g[0]/100*255]},k.gray.hsl=function(g){return[0,0,g[0]]},k.gray.hsv=k.gray.hsl,k.gray.hwb=function(g){return[0,100,g[0]]},k.gray.cmyk=function(g){return[0,0,0,g[0]]},k.gray.lab=function(g){return[g[0],0,0]},k.gray.hex=function(g){const f=Math.round(g[0]/100*255)&255,y=((f<<16)+(f<<8)+f).toString(16).toUpperCase();return"000000".substring(y.length)+y},k.rgb.gray=function(g){return[(g[0]+g[1]+g[2])/3/255*100]}},2085:(C,v,h)=>{const _=h(8168),x=h(4111),k={},D=Object.keys(_);function g(A){const y=function(...E){const I=E[0];return I==null?I:(I.length>1&&(E=I),A(E))};return"conversion"in A&&(y.conversion=A.conversion),y}function f(A){const y=function(...E){const I=E[0];if(I==null)return I;I.length>1&&(E=I);const N=A(E);if(typeof N=="object")for(let F=N.length,W=0;W
").replace(/\r?\n/g,"
").replace(/\t/g," ").replace(/^\s/," ").replace(/\s$/," ").replace(/\s\s/g," "),(o.includes("
")||o.includes("
"))&&(o=`
${o}
`),o}function jT(o){return o.replace(/(\s+)<\/span>/g,(t,e)=>e.length==1?" ":e).replace(//g,"")}const Dm=["figcaption","li"],Sm=["ol","ul"];function Tm(o){if(o.is("$text")||o.is("$textProxy"))return o.data;if(o.is("element","img")&&o.hasAttribute("alt"))return o.getAttribute("alt");if(o.is("element","br"))return` `;let t="",e=null;for(const n of o.getChildren())t+=FT(n,e)+Tm(n),e=n;return t}function FT(o,t){return t?o.is("element","li")&&!o.isEmpty&&o.getChild(0).is("containerElement")||Sm.includes(o.name)&&Sm.includes(t.name)?` `:!o.is("containerElement")&&!t.is("containerElement")?"":Dm.includes(o.name)||Dm.includes(t.name)?` `:` `:""}class De extends M{static get pluginName(){return"ClipboardPipeline"}init(){this.editor.editing.view.addObserver(Uo),this._setupPasteDrop(),this._setupCopyCut()}_fireOutputTransformationEvent(t,e,n){const i=this.editor.model.getSelectedContent(e);this.fire("outputTransformation",{dataTransfer:t,content:i,method:n})}_setupPasteDrop(){const t=this.editor,e=t.model,n=t.editing.view,i=n.document;this.listenTo(i,"clipboardInput",(r,s)=>{s.method=="paste"&&!t.model.canEditAt(t.model.document.selection)&&r.stop()},{priority:"highest"}),this.listenTo(i,"clipboardInput",(r,s)=>{const a=s.dataTransfer;let c;if(s.content)c=s.content;else{let d="";a.getData("text/html")?d=jT(a.getData("text/html")):a.getData("text/plain")&&(d=RT(a.getData("text/plain"))),c=this.editor.data.htmlProcessor.toView(d)}const l=new Ot(this,"inputTransformation");this.fire(l,{content:c,dataTransfer:a,targetRanges:s.targetRanges,method:s.method}),l.stop.called&&r.stop(),n.scrollToTheSelection()},{priority:"low"}),this.listenTo(this,"inputTransformation",(r,s)=>{if(s.content.isEmpty)return;const c=this.editor.data.toModel(s.content,"$clipboardHolder");c.childCount!=0&&(r.stop(),e.change(()=>{this.fire("contentInsertion",{content:c,method:s.method,dataTransfer:s.dataTransfer,targetRanges:s.targetRanges})}))},{priority:"low"}),this.listenTo(this,"contentInsertion",(r,s)=>{s.resultRange=e.insertContent(s.content)},{priority:"low"})}_setupCopyCut(){const t=this.editor,e=t.model.document,i=t.editing.view.document,r=(s,a)=>{const c=a.dataTransfer;a.preventDefault(),this._fireOutputTransformationEvent(c,e.selection,s.name)};this.listenTo(i,"copy",r,{priority:"low"}),this.listenTo(i,"cut",(s,a)=>{t.model.canEditAt(t.model.document.selection)?r(s,a):a.preventDefault()},{priority:"low"}),this.listenTo(this,"outputTransformation",(s,a)=>{const c=t.data.toView(a.content);i.fire("clipboardOutput",{dataTransfer:a.dataTransfer,content:c,method:a.method})},{priority:"low"}),this.listenTo(i,"clipboardOutput",(s,a)=>{a.content.isEmpty||(a.dataTransfer.setData("text/html",this.editor.data.htmlProcessor.toData(a.content)),a.dataTransfer.setData("text/plain",Tm(a.content))),a.method=="cut"&&t.model.deleteContent(e.selection)},{priority:"low"})}}class VT extends ct(){constructor(){super(...arguments),this._stack=[]}add(t,e){const n=this._stack,i=n[0];this._insertDescriptor(t);const r=n[0];i!==r&&!Ta(i,r)&&this.fire("change:top",{oldDescriptor:i,newDescriptor:r,writer:e})}remove(t,e){const n=this._stack,i=n[0];this._removeDescriptor(t);const r=n[0];i!==r&&!Ta(i,r)&&this.fire("change:top",{oldDescriptor:i,newDescriptor:r,writer:e})}_insertDescriptor(t){const e=this._stack,n=e.findIndex(r=>r.id===t.id);if(Ta(t,e[n]))return;n>-1&&e.splice(n,1);let i=0;for(;e[i]&&HT(e[i],t);)i++;e.splice(i,0,t)}_removeDescriptor(t){const e=this._stack,n=e.findIndex(i=>i.id===t);n>-1&&e.splice(n,1)}}function Ta(o,t){return o&&t&&o.priority==t.priority&&Wi(o.classes)==Wi(t.classes)}function HT(o,t){return o.priority>t.priority?!0:o.priority