????

Your IP : 52.14.186.84


Current Path : C:/inetpub/vhost/qlhncn.gdtsolutions.vn/www/assets/
Upload File :
Current File : C:/inetpub/vhost/qlhncn.gdtsolutions.vn/www/assets/FormControl-1241e33f.js

var Tx=Object.defineProperty;var Cx=(p,f,l)=>f in p?Tx(p,f,{enumerable:!0,configurable:!0,writable:!0,value:l}):p[f]=l;var Kn=(p,f,l)=>(Cx(p,typeof f!="symbol"?f+"":f,l),l);import{j as x,r as U,P as G,Z as Jv,R as Ii,W as Mi,C as Er,u as si,t as A0,h as zt,m as Cr,l as $o,x as Np,z as Ex,ai as m_,T as yn,D as Ax,k as Sx,ah as Dx,s as jx,E as an,a1 as Tp,aj as Ix,ad as Px,a3 as Mx,ak as S0,al as D0}from"./index-63f91612.js";import{I as uu,i as du,j as xl,M as Sr,A as Ox,u as ww,B as hn,v as kw,C as Ar,n as Rx,R as Zv,x as f_,d as Vx,e as Lx,w as zx,_ as Tr,t as wh,k as _w,g as Bx}from"./reactstrap.modern-db56c8a4.js";import{R as Fx}from"./Required-d6f950f1.js";import{I as fu,b as qx,c as Hx}from"./InputNumber-bbb3e938.js";import{g as $x,I as Ux,a as Wx,P as Kx}from"./InputTime-7fc0744c.js";import{T as Gx}from"./TextArea-ca01d8ce.js";import{D as j0}from"./DropdownList-84c9fae1.js";import{N as Qx,c as Yx,I as Xx,S as Jx,a as p_}from"./Icon-8a6fd507.js";import{S as yw,b as Zx,B as I0,c as g_,a as xw,D as eN}from"./DataSelect-e63eac9d.js";import{a as Tl,i as tN}from"./useTheme-88c8fc58.js";import{_ as nN}from"./classCallCheck-22a738c0.js";import{a as oN}from"./createClass-ba011f43.js";import{m as iN,S as rN,_ as sN,h as aN,a as b_,b as lN,c as cN}from"./Select-7eb08d2a.js";import{D as P0,T as uN}from"./DataTable-f53a5ff2.js";import{F as Xt}from"./FontAwesome4-d45b4e7a.js";import{B as M0}from"./Button-414de42d.js";import{B as dN}from"./ButtonClose-c34d5952.js";import{L as Nw,a as hN,b as mN}from"./SelectPanelMulti-840dd9be.js";import{c as pu,a as v_}from"./withStyles-8b7f6946.js";import{w as Cl}from"./capitalize-7bd4806a.js";import{g as fN,h as w_}from"./OdataUtils-b4c5a51c.js";import{s as O0,c as R0,t as k_,a as pN,d as gN,g as bN,b as vN,e as Ev,m as __,f as wN,h as Av,i as kN}from"./function-f31ac6e8.js";import{F as _N,H as yN}from"./BodyDialog-a84bcf80.js";import{T as xN}from"./TabsBasic-696a6c3d.js";import{D as NN,Q as TN}from"./QuickSearch-f2b7424f.js";import{T as bh,C as CN,D as EN,a as AN,b as SN,c as DN}from"./DialogCustomize-5c5d912b.js";const Cp=p=>{const{disabled:f,name:l,label:h,checked:w,type:k,children:v,hidden_label:N,...S}=p;return x.jsxDEV("label",{className:"radio me-0",children:[x.jsxDEV("input",{...S,type:"radio",name:l,checked:w,disabled:f,className:"me-0",children:v},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Input/Radio.jsx",lineNumber:8,columnNumber:7},globalThis),!N&&x.jsxDEV("span",{className:f?"disabled":"",children:h},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Input/Radio.jsx",lineNumber:11,columnNumber:25},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Input/Radio.jsx",lineNumber:7,columnNumber:5},globalThis)};Cp.propTypes={};Cp.defaultProps={};class jN extends U.Component{constructor(f){super(f),this.state={value:null}}componentDidUpdate(f,l){this.props.value!==this.state.value&&this.setState({value:this.props.value})}render(){const{name:f,disabled:l,data:h}=this.props;return h&&h.map((w,k)=>x.jsxDEV(Cp,{name:f,disabled:l||w.disabled,value:w.value,label:w.label,checked:this.state.value===w.value&&!w.disabled,onChange:v=>{this.state.value!==v.target.value&&(this.setState({value:v.target.value}),this.props.onChange(v.target.value))}},k,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/select/RadioList.jsx",lineNumber:24,columnNumber:11},this))}}class V0 extends U.Component{constructor(f){super(f),this.state={checked:!1}}componentDidMount(){this.setState({checked:this.props.checked})}componentDidUpdate(f){this.props.checked!==this.state.checked&&this.setState({checked:this.props.checked})}render(){return x.jsxDEV("label",{className:"checkbox",children:[x.jsxDEV("input",{type:"checkbox",disabled:this.props.disabled,checked:this.state.checked,onChange:f=>{this.setState({checked:f.target.checked}),this.props.onChange(f.target.checked)}},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Input/InputBoolean.jsx",lineNumber:25,columnNumber:9},this),x.jsxDEV("span",{children:this.props.label},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Input/InputBoolean.jsx",lineNumber:34,columnNumber:9},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Input/InputBoolean.jsx",lineNumber:24,columnNumber:7},this)}}class IN extends U.Component{constructor(l){super(l);Kn(this,"handleChange",(l,h)=>{let{selected:w}=this.state;var k=w.indexOf(l);k<0?w.push(l):w.splice(k,1),this.setState({selected:w}),this.props.onChange(w)});this.state={selected:[]}}componentDidUpdate(l,h){this.props.value!==this.state.selected&&this.setState({selected:this.props.value})}render(){const{name:l,disabled:h,data:w}=this.props;return w&&w.map((k,v)=>x.jsxDEV(V0,{name:l,disabled:h||k.disabled,value:k.value,label:k.label,checked:this.state.selected&&this.state.selected.indexOf(k.value)>=0&&!k.disabled,onChange:N=>this.handleChange(k.value,N)},v,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/select/CheckboxList.jsx",lineNumber:43,columnNumber:11},this))}}class Tw extends U.Component{render(){const{isDetail:f,value:l,invalid:h,onValueChange:w,onKeyDown:k,bsSize:v="sm",style:N,onBlur:S,onFocus:O,decimalScale:C,thousandSeparator:L,decimalSeparator:j,customInput:F,...q}=this.props;return f?x.jsxDEV("div",{style:{textAlign:"right"},children:l===0||l===null?"":Jv(l)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/numberformat/NumberNotSeperator.jsx",lineNumber:27,columnNumber:14},this):x.jsxDEV(Qx,{...q,style:{textAlign:"right",...N},value:l,onValueChange:K=>{w(K)},onBlur:K=>S&&S(K),onKeyDown:k,onFocus:O,customInput:F||uu,bsSize:v,decimalScale:C||2,invalid:h},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/numberformat/NumberNotSeperator.jsx",lineNumber:30,columnNumber:9},this)}}Tw.defaultProps={placeholder:"Nhâp..."};Tw.propTypes={placeholder:G.string};const PN=()=>{const p=new Date().getFullYear();let f=[];for(var l=p-5;l<=p+2;l++)f.push({value:l,label:`Năm ${l}`});return f},MN=p=>{let f=[],l=new Date().getFullYear(),h=l-2,w=l+5;p.minYear&&p.maxYear&&(h=p.minYear,w=p.maxYear);for(let k=h;k<=w;k++)f.push({value:k,label:k});return f};class Cw extends U.Component{render(){const{value:f,onChange:l,isDetail:h,disabled:w,options:k,generateOptions:v}=this.props,N=v?MN(v):PN(),S=f||"";return h?x.jsxDEV("div",{style:{textAlign:"center"},children:S?"Năm "+S:""},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/select/SelectYear.jsx",lineNumber:36,columnNumber:14},this):x.jsxDEV(yw,{disabled:w,value:S,onChange:l,options:k||N,valueRef:"value",labelRef:"label",placeholder:"Chọn năm"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/select/SelectYear.jsx",lineNumber:39,columnNumber:9},this)}}Cw.propTypes={};Cw.defaultProps={placeholder:"Chọn..."};class Ew extends U.Component{render(){const{value:f,onChange:l,disabled:h}=this.props,w=()=>{let k=[];for(var v=1;v<=12;v++)k.push({value:v,label:`Tháng ${v}`});return k};return x.jsxDEV(yw,{disabled:h,value:f||"",onChange:l,options:w(),valueRef:"value",labelRef:"label",placeholder:"Chọn tháng"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/select/SelectMonth.jsx",lineNumber:15,columnNumber:7},this)}}Ew.propTypes={};Ew.defaultProps={placeholder:"Chọn..."};function ON(p){var f=RN();return function(){var h=b_(p),w;if(f){var k=b_(this).constructor;w=Reflect.construct(h,arguments,k)}else w=h.apply(this,arguments);return lN(this,w)}}function RN(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}var VN={cacheOptions:!1,defaultOptions:!1,filterOption:null,isLoading:!1},LN=function(f){var l,h;return h=l=function(w){sN(v,w);var k=ON(v);function v(N){var S;return nN(this,v),S=k.call(this),S.select=void 0,S.lastRequest=void 0,S.mounted=!1,S.optionsCache={},S.handleInputChange=function(O,C){var L=S.props,j=L.cacheOptions,F=L.onInputChange,q=aN(O,C,F);if(!q){delete S.lastRequest,S.setState({inputValue:"",loadedInputValue:"",loadedOptions:[],isLoading:!1,passEmptyOptions:!1});return}if(j&&S.optionsCache[q])S.setState({inputValue:q,loadedInputValue:q,loadedOptions:S.optionsCache[q],isLoading:!1,passEmptyOptions:!1});else{var K=S.lastRequest={};S.setState({inputValue:q,isLoading:!0,passEmptyOptions:!S.state.loadedInputValue},function(){S.loadOptions(q,function(te){S.mounted&&(te&&(S.optionsCache[q]=te),K===S.lastRequest&&(delete S.lastRequest,S.setState({isLoading:!1,loadedInputValue:q,loadedOptions:te||[],passEmptyOptions:!1})))})})}return q},S.state={defaultOptions:Array.isArray(N.defaultOptions)?N.defaultOptions:void 0,inputValue:typeof N.inputValue<"u"?N.inputValue:"",isLoading:N.defaultOptions===!0,loadedOptions:[],passEmptyOptions:!1},S}return oN(v,[{key:"componentDidMount",value:function(){var S=this;this.mounted=!0;var O=this.props.defaultOptions,C=this.state.inputValue;O===!0&&this.loadOptions(C,function(L){if(S.mounted){var j=!!S.lastRequest;S.setState({defaultOptions:L||[],isLoading:j})}})}},{key:"UNSAFE_componentWillReceiveProps",value:function(S){S.cacheOptions!==this.props.cacheOptions&&(this.optionsCache={}),S.defaultOptions!==this.props.defaultOptions&&this.setState({defaultOptions:Array.isArray(S.defaultOptions)?S.defaultOptions:void 0})}},{key:"componentWillUnmount",value:function(){this.mounted=!1}},{key:"focus",value:function(){this.select.focus()}},{key:"blur",value:function(){this.select.blur()}},{key:"loadOptions",value:function(S,O){var C=this.props.loadOptions;if(!C)return O();var L=C(S,O);L&&typeof L.then=="function"&&L.then(O,function(){return O()})}},{key:"render",value:function(){var S=this,O=this.props;O.loadOptions;var C=O.isLoading,L=Tl(O,["loadOptions","isLoading"]),j=this.state,F=j.defaultOptions,q=j.inputValue,K=j.isLoading,te=j.loadedInputValue,se=j.loadedOptions,Z=j.passEmptyOptions,Y=Z?[]:q&&te?se:F||[];return Ii.createElement(f,Mi({},L,{ref:function(ie){S.select=ie},options:Y,isLoading:K||C,onInputChange:this.handleInputChange}))}}]),v}(U.Component),l.defaultProps=VN,h},zN=iN(rN),BN=LN(zN);const FN=BN,qN=(p={},f={},l,h={},w)=>({handleChange:async(N,S,O="",C="",L="onChange")=>{let j={...p};j[N]=S===""||S===void 0?null:S,l(j)},handleValidate:(N=[])=>{N.length&&N.forEach(O=>{f[O].required=!1});const S=Object.values(f).filter(O=>O.required===!0);for(let O=0;O<S.length;O++){const C=S[O],L=C.maxLength,j=C.minLength;let F=p[C.field_name];if(F===null||F===""||F===void 0)return Er('Vui lòng nhập "'+C.title+'"'),!1;if(j&&F.length>j)return Er('Ô "'+C.title+'" phải có ít nhất '+j+" ký tự."),!1;if(L&&F.length>L)return Er('Ô "'+C.title+'" vượt quá số ký tự cho phép. Tối đa '+L+" ký tự."),!1}return!0}}),Sv=si.div`
  margin-bottom: 20px;
  font-weight: bold;
`,HN=si.span`
  position: relative;
  overflow: hidden;
  input.upload {
    position: absolute;
    top: 0;
    right: 0;
    margin: 0;
    padding: 0;
    font-size: 20px;
    cursor: pointer;
    opacity: 0;
    filter: alpha(opacity=0);
  }
`,$N=si(Sr)`
  max-width: 100%;
`,UN=si(kw)`
  thead tr th {
    vertical-align: middle;
    font-size: 12px;
    background-color: yellow;
    border: 1px solid #aaa;
    border-bottom: none;
    text-align: center;
  }
  tbody tr {
    td {
      font-size: 12px;
      border: 1px solid #aaa;
      vertical-align: middle;
    }
  }
`,WN=si(kw)`
  margin-bottom: 0px;
  thead tr th {
    vertical-align: middle;
    font-size: 12px;
    background-color: yellow;
    border: 1px solid #aaa;
    border-bottom: none;
    text-align: center;
    position: sticky;
    top: 0px;
  }
  tbody tr {
    td {
      font-size: 12px;
      border: 1px solid #aaa;
      vertical-align: middle;
    }
  }
`;function KN(p){const{title:f,isClose:l,isOpen:h,zIndex:w,urldownload:k,urlPreImport:v,urlDelete:N,columnsImport:S,theadTableImport:O,urlImport:C,reloadData:L,BaoCao_Id:j,isNew:F}=p,[q,K]=U.useState(""),[te,se]=U.useState(null),[Z,Y]=U.useState(!1),[oe,ie]=U.useState([]),[ge,de]=U.useState(!1),[je,Ie]=U.useState(0),[Pe,ce]=U.useState([]),[ae,be]=U.useState(!1),[ke,_e]=U.useState([]),[Ee,Se]=U.useState([]),Oe=U.useCallback(nt=>{const Ue=nt.target.files[0];K(Ue?Ue.name:""),se(Ue)},[]),rt=U.useCallback(()=>te?!0:(Er("Vui lòng chọn file trước khi import"),!1),[te]),De=U.useCallback(()=>C&&v?!0:(Er("Vui lòng thử lại sau!","Chức năng đang hoàn thiện"),!1),[C,v]),Fe=U.useCallback(()=>{se(null),K(""),Y(!1),ie([]),_e([]),l()},[l]),mt=U.useCallback(async()=>{if(rt()&&De())if(te.name.split(".").pop()==="xlsx"){const Ue=new FormData;Ue.append("file",te),j&&Ue.append("BaoCao_Id",j.ID);const We=await A0(v,"POST",Ue),et=We.filter(we=>we.Error),Ut=We.filter(we=>!we.Error),en=We.filter(we=>we.GhiChu);ce(Ut),We.length===et.length?be(!0):be(!1),et.length?(Ie(et.length),Y(!0),ie(et)):en.length?(_e(en),Se(We)):(zt(C,"POST",JSON.stringify(We),{odata:!1}).then(we=>{Cr("Import thành công").then(()=>{Fe(),L()})}).catch(we=>$o(we,"Import lỗi")),Y(!1),ie([]),Ie(0))}else Er("Vui lòng chọn file .xlsx")},[rt,De,te,j,v,C,Fe,L]),Ne=U.useCallback(()=>{zt(C,"POST",JSON.stringify(Ee),{odata:!1}).then(nt=>{Cr("Import thành công").then(()=>{Fe(),L()})}).catch(()=>$o("Import lỗi","Không thành công")),Y(!1),ie([]),Ie(0)},[Ee,Fe,L,C]),Le=U.useCallback(()=>{de(!ge)},[ge]),qe=U.useCallback(()=>{const nt=Pe.map(Ue=>(delete Ue.MaChuong,delete Ue.MaNganhKinhTe,delete Ue.LoaiDuAn_Name,delete Ue.NhomDuAn_Name,delete Ue.NhomDuAn_Code,delete Ue.LoaiDuAn_Code,{...Ue}));zt(C,"POST",JSON.stringify(nt),{odata:!1}).then(Ue=>{Cr("Import thành công").then(()=>{l(),L()})}).catch(()=>$o("Import lỗi","Không thành công"))},[Pe,l,L,C]),$e=U.useMemo(()=>x.jsxDEV($N,{size:"xl",isOpen:ge,zIndex:w+1,toggle:Le,children:[x.jsxDEV(du,{children:"CHI TIẾT LỖI FILE EXCEL"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:216,columnNumber:9},this),x.jsxDEV(xl,{children:[x.jsxDEV(UN,{size:"sm",bordered:!0,striped:!0,children:[O,x.jsxDEV("tbody",{children:oe.map((nt,Ue)=>x.jsxDEV("tr",{children:S&&S.length&&S.map((We,et)=>{const Ut=nt[We.field];return x.jsxDEV("td",{className:We.align,children:We.render?We.render(nt):Ut},et,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:229,columnNumber:27},this)})},Ue,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:223,columnNumber:19},this))},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:220,columnNumber:13},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:218,columnNumber:11},this),x.jsxDEV("div",{className:"w-100 text-right",style:{color:"red",fontWeight:"bold"},children:"Vui lòng cập nhật file excel rồi sau đó import ạ"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:239,columnNumber:11},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:217,columnNumber:9},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:215,columnNumber:7},this),[ge,Le,oe,w,S,O]),tt=U.useCallback(()=>{Np("Bạn có chắc chắn muốn xóa dữ liệu không","THÔNG BÁO").then(nt=>{nt&&zt(`${N}?baoCao_Id=${j.ID}`,"DELETE",null,{odata:!1}).then(()=>Cr("Xóa thành công").then(()=>L())).catch(Ue=>$o("Xóa không thanh công"))})},[j,L,N]);return x.jsxDEV(U.Fragment,{children:x.jsxDEV(Sr,{size:"xl",isOpen:h,zIndex:w,toggle:Fe,children:[x.jsxDEV(du,{style:{textTransform:"uppercase"},children:f},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:260,columnNumber:9},this),x.jsxDEV(xl,{children:[F&&x.jsxDEV(Ox,{color:"warning",children:"Có mẫu excel mới vui lòng tải về mẫu này rồi import vào ạ"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:262,columnNumber:21},this),x.jsxDEV(Sv,{className:"d-flex align-items-center",children:[x.jsxDEV("span",{style:{color:"#20a8d8"},className:"me-2",children:["Bước 1:"," "]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:264,columnNumber:13},this),x.jsxDEV("span",{className:"d-flex align-items-center",children:["Tải về tập tin",x.jsxDEV("a",{className:"ms-1 me-1",href:k?`/assets/FileMau/${k}`:"#",style:{color:"green"},children:[x.jsxDEV(Xt,{fa:"file-excel-o"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:274,columnNumber:17},this),x.jsxDEV("span",{className:"ms-1",children:["Excel mẫu ",x.jsxDEV("span",{style:{color:"red"},children:F?"(mẫu mới)":""},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:276,columnNumber:29},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:275,columnNumber:17},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:269,columnNumber:15},this),"và điền đầy đủ thông tin vào tập tin Excel vừa mới tải về"]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:267,columnNumber:13},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:263,columnNumber:11},this),x.jsxDEV(Sv,{children:[x.jsxDEV("span",{style:{color:"#20a8d8"},className:"me-1",children:["Bước 2:"," "]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:283,columnNumber:13},this),x.jsxDEV("span",{children:["Chọn tập tin Excel ",x.jsxDEV("span",{style:{color:"#3ea662"},children:"(.xlsx)"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:287,columnNumber:34},this)," đã điền đầy đủ thông tin"]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:286,columnNumber:13},this),x.jsxDEV("div",{children:x.jsxDEV(ww,{children:[x.jsxDEV(uu,{value:q,readOnly:!0,placeholder:"Chọn file..."},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:291,columnNumber:17},this),x.jsxDEV(HN,{className:"btn btn-success",children:[x.jsxDEV("span",{className:"upl",id:"upload",children:[x.jsxDEV(Xt,{fa:"upload"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:294,columnNumber:21},this),x.jsxDEV("span",{className:"ms-2",children:"Tải lên"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:295,columnNumber:21},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:293,columnNumber:19},this),x.jsxDEV("input",{onChange:Oe,accept:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",type:"file",className:"upload up",id:"up"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:297,columnNumber:19},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:292,columnNumber:17},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:290,columnNumber:15},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:289,columnNumber:13},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:282,columnNumber:11},this),ke.length===0&&x.jsxDEV(Sv,{children:[x.jsxDEV("span",{style:{color:"#20a8d8"},className:"me-1",children:["Bước 3:"," "]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:310,columnNumber:15},this),x.jsxDEV("span",{children:["Nhấn nút"," ",x.jsxDEV(hn,{size:"sm",onClick:mt,color:"success",children:[x.jsxDEV(Xt,{fa:"upload"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:316,columnNumber:19},this),x.jsxDEV("span",{className:"ms-1",children:"IMPORT FILE"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:317,columnNumber:19},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:315,columnNumber:17},this)," ","để import dữ liệu vào hệ thống"]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:313,columnNumber:15},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:309,columnNumber:13},this),N&&x.jsxDEV("div",{className:"d-flex align-items-center justify-content-between",style:{color:"darkorange",fontWeight:"bold"},children:[x.jsxDEV("span",{children:[x.jsxDEV(Xt,{fa:"exclamation-triangle"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:329,columnNumber:17},this),x.jsxDEV("span",{className:"ms-1",children:"Lưu ý: Nếu trường hợp import sai dữ liệu của bảng, vui lòng xóa rồi thực lại các bước"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:330,columnNumber:17},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:328,columnNumber:15},this),x.jsxDEV(hn,{onClick:tt,color:"danger",size:"sm",children:[x.jsxDEV(Xt,{fa:"trash"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:335,columnNumber:17},this),x.jsxDEV("span",{className:"ms-1",children:"Xóa dữ liệu"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:336,columnNumber:17},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:334,columnNumber:15},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:324,columnNumber:13},this),ke.length?x.jsxDEV(x.Fragment,{children:[x.jsxDEV("div",{className:"pb-2 d-flex justify-content-between align-items-center",children:[x.jsxDEV("span",{style:{color:"#20a8d8",fontWeight:"bold"},children:"Có thông tin cần được xác định"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:343,columnNumber:17},this),x.jsxDEV(hn,{onClick:Ne,size:"sm",color:"success",children:[x.jsxDEV(Xt,{fa:"upload"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:345,columnNumber:19},this),x.jsxDEV("span",{className:"ms-1",children:"Import vào hệ thống"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:346,columnNumber:19},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:344,columnNumber:17},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:342,columnNumber:15},this),x.jsxDEV("div",{style:{height:"calc(100vh - 365px)",overflow:"auto"},children:x.jsxDEV(WN,{size:"sm",bordered:!0,striped:!0,children:[O,x.jsxDEV("tbody",{children:ke.map((nt,Ue)=>x.jsxDEV("tr",{children:S&&S.length&&S.map((We,et)=>{const Ut=nt[We.field];return x.jsxDEV("td",{className:We.align,children:We.render?We.render(nt):Ut},et,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:361,columnNumber:33},this)})},Ue,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:355,columnNumber:25},this))},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:352,columnNumber:19},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:350,columnNumber:17},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:349,columnNumber:15},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:341,columnNumber:13},this):"",Z&&x.jsxDEV("div",{className:"d-flex align-items-center justify-content-between",children:[x.jsxDEV(hn,{onClick:()=>Le(),className:"text-left",size:"sm",style:{color:"red",fontSize:15},children:["Có ",x.jsxDEV("b",{style:{fontSize:20},children:je},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:384,columnNumber:20},this)," lỗi, Nhấn vào này để xem chi tiết"]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:378,columnNumber:15},this),x.jsxDEV(hn,{disabled:ae,size:"sm",color:"primary",onClick:qe,children:"Vẫn import những dòng dữ liệu không lỗi"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:386,columnNumber:15},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:377,columnNumber:13},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:261,columnNumber:9},this),$e]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:259,columnNumber:7},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:258,columnNumber:5},this)}function GN(p){const{isOpen:f,onClose:l,valueRow:h,isEdit:w}=p,[k,v]=U.useState(""),N=[{field:"Id",type:"string",dataID:!0,hidden:!0},{title:"Họ và tên",field:"HoVaTen",editable:"never"},{title:"Quan hệ với chủ hộ",field:"QLLD_DM_QuanHeVoiChuHo.Name",type:"string",dataRef:["QuanHe"],customCol:!0,editComponent:S=>x.jsxDEV(j0,{url:"QLLD_DM_QuanHeVoiChuHo",valueField:"Id",textField:"Name",value:S.value,onChange:O=>O?S.onChange(O):S.onChange(null)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalChiTietGiaDinh.jsx",lineNumber:33,columnNumber:9},this)}];return U.useEffect(()=>{h!=null&&h.PhanLoaiHo&&Ex(`QLLD_DM_PhanLoaiHo?$filter=Id eq ${h==null?void 0:h.PhanLoaiHo}`,"GET",null).then(S=>{v(S.value[0].Name),m_()}).catch(S=>{m_(),$o(S)})},[h==null?void 0:h.PhanLoaiHo]),x.jsxDEV(Sr,{zIndex:1303,size:"xl",style:{maxWidth:"50rem",marginTop:"5rem"},isOpen:f,toggle:()=>l(!1),children:[x.jsxDEV(du,{toggle:()=>l(!1),children:"Thông Tin Hộ Gia Đình"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalChiTietGiaDinh.jsx",lineNumber:65,columnNumber:7},this),x.jsxDEV(xl,{children:[x.jsxDEV("div",{className:"border-bottom pb-3",children:x.jsxDEV("div",{className:"bg-light p-3",children:[x.jsxDEV("div",{className:"d-flex",children:[x.jsxDEV(Ar,{sm:"4",children:x.jsxDEV("strong",{children:"Mã số hộ gia đình : "},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalChiTietGiaDinh.jsx",lineNumber:71,columnNumber:17},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalChiTietGiaDinh.jsx",lineNumber:70,columnNumber:15},this),x.jsxDEV("span",{children:h!=null&&h.SoDinhDanhHoGD?h==null?void 0:h.SoDinhDanhHoGD:x.jsxDEV(Ar,{children:x.jsxDEV("i",{className:"text-secondary fw-bold",children:"Chưa có"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalChiTietGiaDinh.jsx",lineNumber:78,columnNumber:21},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalChiTietGiaDinh.jsx",lineNumber:77,columnNumber:19},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalChiTietGiaDinh.jsx",lineNumber:73,columnNumber:15},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalChiTietGiaDinh.jsx",lineNumber:69,columnNumber:13},this),x.jsxDEV("div",{className:"d-flex mt-3",children:[x.jsxDEV(Ar,{sm:"4",children:x.jsxDEV("strong",{children:"Phân loại hộ gia đình :"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalChiTietGiaDinh.jsx",lineNumber:85,columnNumber:17},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalChiTietGiaDinh.jsx",lineNumber:84,columnNumber:15},this),x.jsxDEV("span",{children:k},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalChiTietGiaDinh.jsx",lineNumber:87,columnNumber:15},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalChiTietGiaDinh.jsx",lineNumber:83,columnNumber:13},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalChiTietGiaDinh.jsx",lineNumber:68,columnNumber:11},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalChiTietGiaDinh.jsx",lineNumber:67,columnNumber:9},this),x.jsxDEV(P0,{title:"Danh Sách Thành Viên",url:"QLLD_NguoiLaoDong",where:`SoDinhDanhHoGD eq ${(h==null?void 0:h.SoDinhDanhHoGD)!=null?`'${h==null?void 0:h.SoDinhDanhHoGD}'`:null}`,columns:N,selectType:"withColumns",onEdit:w?{}:""},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalChiTietGiaDinh.jsx",lineNumber:91,columnNumber:9},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalChiTietGiaDinh.jsx",lineNumber:66,columnNumber:7},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Modal/ModalChiTietGiaDinh.jsx",lineNumber:58,columnNumber:5},this)}function QN(p){const{children:f,onClose:l,open:h,className:w}=p;return x.jsxDEV(_N,{open:h,onClose:l,className:w,children:x.jsxDEV(yN,{children:f},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/dialog/FullScreenDialogNew.jsx",lineNumber:11,columnNumber:7},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/dialog/FullScreenDialogNew.jsx",lineNumber:10,columnNumber:5},this)}var qo={HoVaTen:{field_name:"HoVaTen",title:"Họ và tên:",type:"label"},NgayThangNamSinh:{field_name:"NgayThangNamSinh",title:"Ngày tháng năm sinh:",type:"date"},Gioitinh:{field_name:"Gioitinh",title:"Giới tính:",type:"label"},SoCCCD:{field_name:"SoCCCD",title:"Số CCCD/CMND/Hộ chiếu:",type:"label"},SoDinhDanh:{field_name:"SoDinhDanh",title:"Số định danh:",type:"label"},DanToc:{field_name:"DanToc",title:"Dân tộc:",type:"label"},TonGiao:{field_name:"TonGiao",title:"Tôn giáo:",type:"label"},QueQuan:{field_name:"QueQuan",title:"Quê quán:",type:"label"},ThuongTru:{field_name:"ThuongTru",title:"Thường trú:",type:"label"},ThonXom_Id:{field_name:"ThonXom_Id",title:"Thôn xóm:",type:"label"},NoiOHienTai:{field_name:"NoiOHienTai",title:"Nơi ở hiện tại:",type:"label"},DiaChiCuThe:{field_name:"DiaChiCuThe",title:"Địa chỉ cụ thể:",type:"label"},QuanHe:{field_name:"QuanHe",title:"Quan hệ với chủ hộ:",type:"data-select",dataSelect:{url:"QLLD_DM_QuanHeVoiChuHo",value_field:"Id",text_field:"Name",placeholder:"Chọn quan hệ với chủ hộ"}},TrinhDoHV:{field_name:"TrinhDoHV",title:"Trình độ học vấn:",type:"label"},TrinhDoCMKT:{field_name:"TrinhDoCMKT",title:"Trình độ chuyên môn kỹ thuật:",type:"label"},TinhTrangHonNhan:{field_name:"TinhTrangHonNhan",title:"Tình trạng hôn nhân:",type:"label"},TinhTrangThamGiaHDKT:{field_name:"TinhTrangThamGiaHDKT",title:"Tình trạng tham gia hoạt động kinh tế:",type:"label"},ThamGiaBHXH:{field_name:"ThamGiaBHXH",title:"Tham gia BHXH:",type:"label"},MaBHXH:{field_name:"MaBHXH",title:"Mã BHXH:",type:"label"}};const YN=Yx(U.createElement("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"}),"Person");var XN=function(f){return{root:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:40,height:40,fontFamily:f.typography.fontFamily,fontSize:f.typography.pxToRem(20),lineHeight:1,borderRadius:"50%",overflow:"hidden",userSelect:"none"},colorDefault:{color:f.palette.background.default,backgroundColor:f.palette.type==="light"?f.palette.grey[400]:f.palette.grey[600]},circle:{},circular:{},rounded:{borderRadius:f.shape.borderRadius},square:{borderRadius:0},img:{width:"100%",height:"100%",textAlign:"center",objectFit:"cover",color:"transparent",textIndent:1e4},fallback:{width:"75%",height:"75%"}}};function JN(p){var f=p.src,l=p.srcSet,h=U.useState(!1),w=h[0],k=h[1];return U.useEffect(function(){if(!(!f&&!l)){k(!1);var v=!0,N=new Image;return N.src=f,N.srcSet=l,N.onload=function(){v&&k("loaded")},N.onerror=function(){v&&k("error")},function(){v=!1}}},[f,l]),w}var L0=U.forwardRef(function(f,l){var h=f.alt,w=f.children,k=f.classes,v=f.className,N=f.component,S=N===void 0?"div":N,O=f.imgProps,C=f.sizes,L=f.src,j=f.srcSet,F=f.variant,q=F===void 0?"circular":F,K=Tl(f,["alt","children","classes","className","component","imgProps","sizes","src","srcSet","variant"]),te=null,se=JN({src:L,srcSet:j}),Z=L||j,Y=Z&&se!=="error";return Y?te=U.createElement("img",Mi({alt:h,src:L,srcSet:j,sizes:C,className:k.img},O)):w!=null?te=w:Z&&h?te=h[0]:te=U.createElement(YN,{className:k.fallback}),U.createElement(S,Mi({className:pu(k.root,k.system,k[q],v,!Y&&k.colorDefault),ref:l},K),te)});L0.propTypes={alt:G.string,children:G.node,classes:v_(G.object,function(p){var f=p.classes;if(f==null)return null;if(f.circle!=null&&f.circle.split(" ").length>1)throw new Error("Material-UI: The `circle` class is deprecated. Use `circular` instead.");return null}),className:G.string,component:G.elementType,imgProps:G.object,sizes:G.string,src:G.string,srcSet:G.string,variant:v_(G.oneOf(["circle","circular","rounded","square"]),function(p){var f=p.variant;if(f==="circle")throw new Error('Material-UI: `variant="circle"` is deprecated. Use `variant="circular"` instead.');return null})};const ZN=Cl(XN,{name:"MuiAvatar"})(L0);var eT={root:{marginBottom:12}},z0=U.forwardRef(function(f,l){return U.createElement(bh,Mi({component:"p",variant:"body1",color:"textSecondary",ref:l},f))});z0.propTypes={children:G.node,classes:G.object};const tT=Cl(eT,{name:"MuiDialogContentText"})(z0);var nT={root:{display:"flex",flexDirection:"column",flexWrap:"wrap"},row:{flexDirection:"row"}},B0=U.forwardRef(function(f,l){var h=f.classes,w=f.className,k=f.row,v=k===void 0?!1:k,N=Tl(f,["classes","className","row"]);return U.createElement("div",Mi({className:pu(h.root,w,v&&h.row),ref:l},N))});B0.propTypes={children:G.node,classes:G.object,className:G.string,row:G.bool};const oT=Cl(nT,{name:"MuiFormGroup"})(B0);var iT={root:{minWidth:56,flexShrink:0},alignItemsFlexStart:{marginTop:8}},F0=U.forwardRef(function(f,l){var h=f.classes,w=f.className,k=Tl(f,["classes","className"]),v=U.useContext(Nw);return U.createElement("div",Mi({className:pu(h.root,w,v.alignItems==="flex-start"&&h.alignItemsFlexStart),ref:l},k))});F0.propTypes={children:G.element.isRequired,classes:G.object,className:G.string};const rT=Cl(iT,{name:"MuiListItemAvatar"})(F0);var sT=function(f){return{root:{minWidth:56,color:f.palette.action.active,flexShrink:0,display:"inline-flex"},alignItemsFlexStart:{marginTop:8}}},q0=U.forwardRef(function(f,l){var h=f.classes,w=f.className,k=Tl(f,["classes","className"]),v=U.useContext(Nw);return U.createElement("div",Mi({className:pu(h.root,w,v.alignItems==="flex-start"&&h.alignItemsFlexStart),ref:l},k))});q0.propTypes={children:G.node,classes:G.object,className:G.string};const aT=Cl(sT,{name:"MuiListItemIcon"})(q0);var lT={root:{flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4},multiline:{marginTop:6,marginBottom:6},dense:{},inset:{paddingLeft:56},primary:{},secondary:{}},H0=U.forwardRef(function(f,l){var h=f.children,w=f.classes,k=f.className,v=f.disableTypography,N=v===void 0?!1:v,S=f.inset,O=S===void 0?!1:S,C=f.primary,L=f.primaryTypographyProps,j=f.secondary,F=f.secondaryTypographyProps,q=Tl(f,["children","classes","className","disableTypography","inset","primary","primaryTypographyProps","secondary","secondaryTypographyProps"]),K=U.useContext(Nw),te=K.dense,se=C??h;se!=null&&se.type!==bh&&!N&&(se=U.createElement(bh,Mi({variant:te?"body2":"body1",className:w.primary,component:"span",display:"block"},L),se));var Z=j;return Z!=null&&Z.type!==bh&&!N&&(Z=U.createElement(bh,Mi({variant:"body2",className:w.secondary,color:"textSecondary",display:"block"},F),Z)),U.createElement("div",Mi({className:pu(w.root,k,te&&w.dense,O&&w.inset,se&&Z&&w.multiline),ref:l},q),se,Z)});H0.propTypes={children:G.node,classes:G.object,className:G.string,disableTypography:G.bool,inset:G.bool,primary:G.node,primaryTypographyProps:G.object,secondary:G.node,secondaryTypographyProps:G.object};const cT=Cl(lT,{name:"MuiListItemText"})(H0);const uT=({getFile:p,reset:f,accept:l,name:h,required:w})=>{const k=U.useRef(),[v,N]=U.useState(null),[S,O]=U.useState(100),[C,L]=U.useState("select"),j=K=>{K.target.files&&K.target.files.length>0&&(N(K.target.files[0]),p(K.target.files[0]))},F=()=>{var K;k!=null&&k.current&&((K=k==null?void 0:k.current)==null||K.click())},q=()=>{k.current.value="",N(null),p(null),O(0),L("select"),f&&f()};return x.jsxDEV("div",{className:"form-input-file-custom",children:[x.jsxDEV("input",{ref:k,name:h,required:w,accept:l||"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",type:"file",onChange:j,style:{display:"none"}},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/ModalImport/InputImport.jsx",lineNumber:33,columnNumber:7},globalThis),!v&&x.jsxDEV("button",{className:"file-btn",onClick:F,children:[x.jsxDEV(Xt,{fa:"upload"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/ModalImport/InputImport.jsx",lineNumber:44,columnNumber:11},globalThis)," Upload File",x.jsxDEV("h6",{children:l?"Chọn File bạn muốn tải lên":"Chọn File Excel của bạn"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/ModalImport/InputImport.jsx",lineNumber:45,columnNumber:11},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/ModalImport/InputImport.jsx",lineNumber:43,columnNumber:9},globalThis),v&&x.jsxDEV(x.Fragment,{children:x.jsxDEV("div",{className:"file-card",children:[x.jsxDEV("div",{className:"icon-file-card",children:x.jsxDEV(Xt,{fa:"trello"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/ModalImport/InputImport.jsx",lineNumber:52,columnNumber:15},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/ModalImport/InputImport.jsx",lineNumber:51,columnNumber:13},globalThis),x.jsxDEV("div",{className:"file-info",children:[x.jsxDEV("div",{style:{flex:1},children:[x.jsxDEV("h6",{children:v==null?void 0:v.name},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/ModalImport/InputImport.jsx",lineNumber:56,columnNumber:17},globalThis),x.jsxDEV("div",{className:"progress-bg",children:x.jsxDEV("div",{className:"progress"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/ModalImport/InputImport.jsx",lineNumber:58,columnNumber:19},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/ModalImport/InputImport.jsx",lineNumber:57,columnNumber:17},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/ModalImport/InputImport.jsx",lineNumber:55,columnNumber:15},globalThis),C==="select"?x.jsxDEV("button",{onClick:q,children:x.jsxDEV(Xt,{fa:"times"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/ModalImport/InputImport.jsx",lineNumber:63,columnNumber:19},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/ModalImport/InputImport.jsx",lineNumber:62,columnNumber:17},globalThis):x.jsxDEV("div",{className:"check-circle",children:C==="uploading"?`${S}%`:C==="done"?x.jsxDEV("span",{class:"material-symbols-outlined",style:{fontSize:"20px"},children:"check"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/ModalImport/InputImport.jsx",lineNumber:70,columnNumber:21},globalThis):null},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/ModalImport/InputImport.jsx",lineNumber:66,columnNumber:17},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/ModalImport/InputImport.jsx",lineNumber:54,columnNumber:13},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/ModalImport/InputImport.jsx",lineNumber:50,columnNumber:11},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/ModalImport/InputImport.jsx",lineNumber:49,columnNumber:9},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/ModalImport/InputImport.jsx",lineNumber:32,columnNumber:5},globalThis)};class dT extends U.Component{constructor(l){super(l);Kn(this,"renderbutton",()=>x.jsxDEV("div",{style:{float:"right"},children:[x.jsxDEV(Zx,{onClick:this.props.close,children:"Hủy"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/DetailDrawer/DetailFormDoanhNghiep.jsx",lineNumber:20,columnNumber:9},this),x.jsxDEV(I0,{size:"sm",type:"submit",children:"Lưu"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/DetailDrawer/DetailFormDoanhNghiep.jsx",lineNumber:21,columnNumber:9},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/DetailDrawer/DetailFormDoanhNghiep.jsx",lineNumber:19,columnNumber:7},this));Kn(this,"submitHandler",l=>{l.preventDefault();let h=new FormData(this.formRef.current);this.props.onSubmit(h)});this.state={file:"",Subject:""},this.formRef=Ii.createRef()}getInputValue(l,h){return this.props.data&&this.props.data[l]?this.props.data[l]:h||""}render(){return x.jsxDEV(CN,{open:this.props.open,handleClose:this.props.close,title:"Đính kèm văn bản",maxWidth:"xs",children:x.jsxDEV(Rx,{innerRef:this.formRef,id:"upload-vanban-form",method:"POST",onSubmit:this.submitHandler,children:[x.jsxDEV("div",{children:[x.jsxDEV("h6",{className:"fw-bold",children:"Tệp tin"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/DetailDrawer/DetailFormDoanhNghiep.jsx",lineNumber:42,columnNumber:13},this),x.jsxDEV("div",{className:"mb-4",children:x.jsxDEV(uT,{name:"file",required:!0,getFile:l=>this.setState({file:l}),accept:"application/pdf"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/DetailDrawer/DetailFormDoanhNghiep.jsx",lineNumber:44,columnNumber:15},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/DetailDrawer/DetailFormDoanhNghiep.jsx",lineNumber:43,columnNumber:13},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/DetailDrawer/DetailFormDoanhNghiep.jsx",lineNumber:41,columnNumber:11},this),this.renderbutton()]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/DetailDrawer/DetailFormDoanhNghiep.jsx",lineNumber:40,columnNumber:9},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/DetailDrawer/DetailFormDoanhNghiep.jsx",lineNumber:39,columnNumber:7},this)}}class $0 extends U.Component{constructor(l){super(l);Kn(this,"uploadVanBan",l=>{let h=this,w=Math.max(...this.state.data.map(k=>k.stt));l.append("target_id",h.props.target_id||null),l.append("target_module",h.props.target_module||null),l.append("ma_tai_khoan",yn.MaTaiKhoan),l.append("created_date",new Date),l.append("stt",w),A0("QuanLyVanBan/Attachment","POST",l).then(function(k){h.getItems(),h.setState({uploading:!1,showPopup:!1})}).catch(function(k){$o(k)})});Kn(this,"addAttachment",async l=>{let h=Math.max(...this.state.data.map(w=>w.stt),1);for(let w=0;w<l.length;w++){let k={target_id:this.props.target_id||null,target_module:this.props.target_module||null,created_by:yn.MaTaiKhoan,created_date:new Date,id_van_ban:l[w],stt:++h};try{await zt("Attachments","POST",JSON.stringify(k))}catch(v){console.log(v)}}this.setState({searching:!1}),this.getItems()});Kn(this,"deleteAttachment",async(l,h)=>{try{await Np("Bạn muốn xóa văn bản sau khỏi danh sách văn bản liên quan","Xác nhận")&&zt(`Attachments(guid'${l}')`,"DELETE",null).then(()=>zt(`VanBans(guid'${h}')`,"DELETE",null).then(()=>this.getItems()))}catch(w){$o(w)}});Kn(this,"popupImage",l=>{var h=document.getElementById("myModal"),w=document.getElementById("img01"),k=document.getElementById("caption");h.style.display="block",w.src=l.src,k.innerHTML=l.alt;var v=document.getElementsByClassName("close")[0];v.onclick=function(){h.style.display="none",w.src="",k.innerHTML=""}});this.uploadVanBan=this.uploadVanBan.bind(this),this.addAttachment=this.addAttachment.bind(this),this.deleteAttachment=this.deleteAttachment.bind(this),this.state={searching:!1,uploading:!1,data:[],LoaiDonVi:null,showPopup:!1}}componentDidMount(){this.getDN(),this.getItems(),console.log(this.props)}getDN(){zt(`DonVis?$filter=MaDonVi eq '${yn.MaDonVi}'`).then(l=>this.setState({LoaiDonVi:l.value[0]?l.value[0].LoaiDonVi:null})).catch(l=>console.log(l))}getItems(){const{isChange:l}=this.props;let h=this;zt(`Attachments?$expand=VanBan&$filter=target_id eq '${this.props.target_id}' and IsAttachment eq ${this.props.IsAttachment??!1}&$orderby=stt`,"GET",null).then(function(w){h.setState({data:w.value},()=>l(h.state.data.length))}).catch(function(w){$o(w.Message||w)})}downloadPDF(l){let h=l.LinkFile.split("/")[3].split(".")[1];Ax(`QuanLyVanBan/Download?id=${l.ID}`,l.Subject+`.${h}`).then().catch(function(w){$o(w)})}getCode(l){let h=[];return l.CodeNumber&&h.push(l.CodeNumber),l.CodeNotation&&h.push(l.CodeNotation),h.join("/")}renderClassName(l){let h="";switch(l.LinkFile.split("/")[3].split(".")[1]){case"pdf":h="fa fa-file-pdf-o colorRed";break;case"xlsx":h="fa fa-file-excel-o colorGreen";break;case"xls":h="fa fa-file-excel-o colorGreen";break;case"docx":h="fa fa-file-word-o colorBlue";break;case"doc":h="fa fa-file-word-o colorBlue";break}return h}render(){const{LoaiDonVi:l}=this.state;return x.jsxDEV("div",{className:"mt-4",children:[x.jsxDEV("div",{className:"clearfix",children:[x.jsxDEV("b",{children:"DANH SÁCH ĐÍNH KÈM"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:174,columnNumber:11},this),x.jsxDEV("div",{className:"pull-right",children:x.jsxDEV(M0,{color:"success",onClick:()=>{this.setState({showPopup:!0})},children:[x.jsxDEV(Xt,{fa:"upload"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:182,columnNumber:15},this)," Tải lên"]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:176,columnNumber:13},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:175,columnNumber:11},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:173,columnNumber:9},this),x.jsxDEV("p",{},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:186,columnNumber:9},this),x.jsxDEV(kw,{size:"sm",className:"table-bordered table-attachment",children:[x.jsxDEV("thead",{children:x.jsxDEV("tr",{children:[x.jsxDEV("th",{children:"#"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:190,columnNumber:15},this),x.jsxDEV("th",{children:"Tiêu đề"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:191,columnNumber:15},this),x.jsxDEV("th",{children:"Thao tác"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:192,columnNumber:15},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:189,columnNumber:13},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:188,columnNumber:11},this),x.jsxDEV("tbody",{children:this.state.data&&this.state.data.length?this.state.data.map((h,w)=>h.VanBan?x.jsxDEV("tr",{children:[x.jsxDEV("td",{className:"td-stt",children:w+1},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:200,columnNumber:21},this),x.jsxDEV("td",{children:[x.jsxDEV("div",{className:"pull-left",children:h.VanBan.LinkFile.split("/")[3].split(".")[1]==="png"||h.VanBan.LinkFile.split("/")[3].split(".")[1]==="jpg"?x.jsxDEV("img",{onClick:k=>this.popupImage(k.target),alt:"",src:Sx+h.VanBan.LinkFile,className:"myImg",width:"50",height:"30"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:205,columnNumber:27},this):x.jsxDEV(Xx,{style:{fontSize:"2rem",marginRight:5},className:this.renderClassName(h.VanBan)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:214,columnNumber:27},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:202,columnNumber:23},this),x.jsxDEV("div",{className:"pull-left",children:l&&l===2?x.jsxDEV("p",{children:h.VanBan.Subject},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:222,columnNumber:27},this):x.jsxDEV(x.Fragment,{children:[x.jsxDEV("div",{className:"small text-muted",children:["Số, ký hiệu: ",this.getCode(h.VanBan)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:225,columnNumber:29},this),x.jsxDEV("div",{children:h.VanBan.Subject},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:226,columnNumber:29},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:224,columnNumber:27},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:220,columnNumber:23},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:201,columnNumber:21},this),x.jsxDEV("td",{className:"td-actions",children:[x.jsxDEV(g_,{color:"primary",icon:"download",onClick:k=>this.downloadPDF(h.VanBan),title:"Tải xuống"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:232,columnNumber:23},this),h.VanBan&&x.jsxDEV(g_,{color:"danger",icon:"times",onClick:k=>this.deleteAttachment(h.id,h.VanBan.ID),title:"Xóa văn bản"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:239,columnNumber:25},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:231,columnNumber:21},this)]},h.id_van_ban,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:199,columnNumber:19},this):null):x.jsxDEV("tr",{children:x.jsxDEV("td",{colSpan:"3",className:"td-noAttachment",children:"Không có văn bản đính kèm"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:252,columnNumber:17},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:251,columnNumber:15},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:195,columnNumber:11},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:187,columnNumber:9},this),this.state.searching?x.jsxDEV(hT,{target_id:this.props.target_id,target_module:this.props.target_module,setClose:()=>this.setState({searching:!1}),onSubmit:this.addAttachment},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:260,columnNumber:11},this):null,this.state.uploading?x.jsxDEV(NN,{mode:"create",onOpen:()=>this.setState({uploading:!0}),onClose:()=>this.setState({uploading:!1}),onSubmit:this.uploadVanBan},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:268,columnNumber:11},this):null,this.state.showPopup?x.jsxDEV(dT,{open:this.state.showPopup,close:()=>this.setState({showPopup:!1}),onSubmit:this.uploadVanBan},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:276,columnNumber:11},this):null,x.jsxDEV("div",{id:"myModal",className:"modal",children:[x.jsxDEV("span",{className:"close",children:"×"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:283,columnNumber:11},this),x.jsxDEV("img",{className:"modal-content",id:"img01",alt:""},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:284,columnNumber:11},this),x.jsxDEV("div",{id:"caption"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:285,columnNumber:11},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:282,columnNumber:9},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:172,columnNumber:7},this)}}$0.propTypes={target_module:G.string.isRequired,target_id:G.string.isRequired,onView:G.func};class Aw extends U.Component{constructor(l){super(l);Kn(this,"handleChange",l=>{this.setState({searchText:l.target.value})});Kn(this,"selectVanBan",l=>{let h=this.state.selected;h.indexOf(l.target.value)>-1?h.splice(h.indexOf(l.target.value),1):h.push(l.target.value)});Kn(this,"submitHandler",l=>{this.props.onSubmit(this.state.selected)});this.updateResult=this.updateResult.bind(this),this.state={searchText:"",result:[],selected:[]}}componentDidMount(){this.updateResult()}updateResult(){let l=this;zt(`VanBans?$select=ID,Subject,CodeNumber,CodeNotation&$filter= DocType ne null and substringof('${l.state.searchText}', Subject) and Attachments/all(a:a/target_id ne '${l.props.target_id}')`).then(function(h){l.setState({result:h.value})}).catch(function(h){$o(h)})}getSize(l){let h=l;if(h<1e3)return h+" bytes";if(h=h/1e3,h<1e3)return h.toFixed(2)+" KB";if(h=h/1e3,h<1e3)return h.toFixed(2)+" MB";if(h=h/1e3,h<1e3)return h.toFixed(2)+" GB"}getCode(l){let h=[];return l.CodeNumber&&h.push(l.CodeNumber),l.CodeNotation&&h.push(l.CodeNotation),"Số, ký hiệu: "+h.join("/")}showResult(){return this.state.result&&this.state.result.length?x.jsxDEV(hN,{dense:!0,children:this.state.result.map((l,h)=>x.jsxDEV(mN,{children:[x.jsxDEV(aT,{children:x.jsxDEV(uu,{id:"vb_"+l.ID,type:"checkbox",value:l.ID,onChange:this.selectVanBan},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/AttachSearch.jsx",lineNumber:73,columnNumber:15},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/AttachSearch.jsx",lineNumber:72,columnNumber:13},this),x.jsxDEV(rT,{children:x.jsxDEV(ZN,{children:x.jsxDEV(Xt,{fa:"file-pdf-o",style:{color:"red"}},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/AttachSearch.jsx",lineNumber:77,columnNumber:17},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/AttachSearch.jsx",lineNumber:76,columnNumber:15},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/AttachSearch.jsx",lineNumber:75,columnNumber:13},this),x.jsxDEV(cT,{primary:l.Subject,secondary:this.getCode(l)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/AttachSearch.jsx",lineNumber:80,columnNumber:13},this)]},h,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/AttachSearch.jsx",lineNumber:71,columnNumber:11},this))},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/AttachSearch.jsx",lineNumber:69,columnNumber:7},this):x.jsxDEV(tT,{children:"* Không tìm thấy văn bản nào"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/AttachSearch.jsx",lineNumber:85,columnNumber:7},this)}render(){return x.jsxDEV(EN,{open:this.props.open,onClose:this.props.setClose,fullWidth:!0,scroll:"paper",maxWidth:"lg",style:{height:"100%"},children:[x.jsxDEV(AN,{children:["Tìm kiếm văn bản",x.jsxDEV(TN,{placeholder:"Nhập thông tin văn bản cần tìm",value:this.state.searchText,onChange:this.handleChange,onSearch:this.updateResult},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/AttachSearch.jsx",lineNumber:108,columnNumber:11},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/AttachSearch.jsx",lineNumber:106,columnNumber:9},this),x.jsxDEV(SN,{children:this.showResult()},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/AttachSearch.jsx",lineNumber:115,columnNumber:9},this),x.jsxDEV(DN,{children:[x.jsxDEV(dN,{color:"danger",onClick:this.props.setClose,children:"Đóng lại"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/AttachSearch.jsx",lineNumber:117,columnNumber:11},this),x.jsxDEV(M0,{color:"primary",onClick:this.submitHandler,children:[x.jsxDEV(Xt,{fa:"paperclip"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/AttachSearch.jsx",lineNumber:121,columnNumber:13},this)," Đính kèm"]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/AttachSearch.jsx",lineNumber:120,columnNumber:11},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/AttachSearch.jsx",lineNumber:116,columnNumber:9},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/VanBan/Attachment/AttachSearch.jsx",lineNumber:98,columnNumber:7},this)}}Aw.propTypes={open:G.bool,setClose:G.func.isRequired,onSubmit:G.func.isRequired};Aw.defaultProps={open:!0};const hT=Aw;var mT=function(f){return{root:{display:"block",backgroundColor:tN(f.palette.text.primary,f.palette.type==="light"?.11:.13),height:"1.2em"},text:{marginTop:0,marginBottom:0,height:"auto",transformOrigin:"0 60%",transform:"scale(1, 0.60)",borderRadius:f.shape.borderRadius,"&:empty:before":{content:'"\\00a0"'}},rect:{},circle:{borderRadius:"50%"},pulse:{animation:"$pulse 1.5s ease-in-out 0.5s infinite"},"@keyframes pulse":{"0%":{opacity:1},"50%":{opacity:.4},"100%":{opacity:1}},wave:{position:"relative",overflow:"hidden","&::after":{animation:"$wave 1.6s linear 0.5s infinite",background:"linear-gradient(90deg, transparent, ".concat(f.palette.action.hover,", transparent)"),content:'""',position:"absolute",transform:"translateX(-100%)",bottom:0,left:0,right:0,top:0}},"@keyframes wave":{"0%":{transform:"translateX(-100%)"},"60%":{transform:"translateX(100%)"},"100%":{transform:"translateX(100%)"}},withChildren:{"& > *":{visibility:"hidden"}},fitContent:{maxWidth:"fit-content"},heightAuto:{height:"auto"}}},U0=U.forwardRef(function(f,l){var h=f.animation,w=h===void 0?"pulse":h,k=f.classes,v=f.className,N=f.component,S=N===void 0?"span":N,O=f.height,C=f.variant,L=C===void 0?"text":C,j=f.width,F=Tl(f,["animation","classes","className","component","height","variant","width"]),q=!!F.children;return U.createElement(S,Mi({ref:l,className:pu(k.root,k[L],v,q&&[k.withChildren,!j&&k.fitContent,!O&&k.heightAuto],w!==!1&&k[w])},F,{style:Mi({width:j,height:O},F.style)}))});U0.propTypes={animation:G.oneOf(["pulse","wave",!1]),children:G.node,classes:G.object.isRequired,className:G.string,component:G.elementType,height:G.oneOfType([G.number,G.string]),variant:G.oneOf(["text","rect","circle"]),width:G.oneOfType([G.number,G.string])};const ew=Cl(mT,{name:"MuiSkeleton"})(U0),gp=({maPhuongXa:p,maThonXom:f})=>{const[l,h]=U.useState(void 0);return U.useEffect(()=>{p&&zt(`PhuongXas?$filter=MaPhuongXa eq '${p}' &$expand=QuanHuyen,QuanHuyen/TinhThanh`).then(({value:[w]})=>{h(`${w.TenPhuongXa}, ${w.QuanHuyen.TenQuanHuyen}, ${w.QuanHuyen.TinhThanh.TenTinhThanh}`),f&&zt(`ThonXoms(${f})`).then(k=>{h(v=>`Thôn ${k==null?void 0:k.Ten}, `+v)})})},[p,f]),l===void 0?x.jsxDEV("div",{children:[x.jsxDEV(ew,{width:250},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/custome/TextHuyenPhuongXa.jsx",lineNumber:24,columnNumber:7},globalThis),x.jsxDEV(ew,{width:100},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/custome/TextHuyenPhuongXa.jsx",lineNumber:25,columnNumber:7},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/custome/TextHuyenPhuongXa.jsx",lineNumber:23,columnNumber:5},globalThis):l};function fT(p){var w,k,v;const{data:f}=p,[,l]=U.useState(0),h=U.useMemo(()=>x.jsxDEV($0,{target_id:f==null?void 0:f.Id,target_module:"NguoiLaoDong",isChange:l},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:13,columnNumber:11},this),[f]);return console.log(f),x.jsxDEV(x.Fragment,{children:x.jsxDEV(Zv,{className:"bg-white p-3 mt-0",children:x.jsxDEV(Ar,{children:[x.jsxDEV(Zv,{children:[x.jsxDEV(Ar,{children:[x.jsxDEV(Lt,{data:qo.HoVaTen,value:f==null?void 0:f.HoVaTen},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:25,columnNumber:15},this),x.jsxDEV(Lt,{data:qo.NgayThangNamSinh,value:f==null?void 0:f.NgayThangNamSinh,isDetail:!0},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:26,columnNumber:15},this),x.jsxDEV(Lt,{data:qo.Gioitinh,value:f==null?void 0:f.QLLD_DM_GioiTinh.Name,isDetail:!0},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:27,columnNumber:15},this),x.jsxDEV(Lt,{data:qo.SoCCCD,value:f==null?void 0:f.SoCCCD},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:28,columnNumber:15},this),x.jsxDEV(Lt,{data:qo.SoDinhDanh,value:f==null?void 0:f.SoDinhDanh},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:29,columnNumber:15},this),x.jsxDEV(Lt,{data:qo.DanToc,value:f!=null&&f.QLLD_DM_DanToc?f==null?void 0:f.QLLD_DM_DanToc.Name:"",isDetail:!0},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:30,columnNumber:15},this),x.jsxDEV(Lt,{data:qo.TonGiao,value:f!=null&&f.QLLD_DM_TonGiao?f==null?void 0:f.QLLD_DM_TonGiao.Name:"",isDetail:!0},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:31,columnNumber:15},this),x.jsxDEV("div",{className:"d-flex row",children:[x.jsxDEV("strong",{className:"col-6 text-small",children:"Quê quán:"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:37,columnNumber:17},this),x.jsxDEV("p",{className:"col-6",children:x.jsxDEV(gp,{maPhuongXa:f==null?void 0:f.QueQuan},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:39,columnNumber:19},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:38,columnNumber:17},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:36,columnNumber:15},this),x.jsxDEV("div",{className:"d-flex row",children:[x.jsxDEV("strong",{className:"col-6 text-small",children:"Thường trú:"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:43,columnNumber:17},this),x.jsxDEV("p",{className:"col-6",children:x.jsxDEV(gp,{maPhuongXa:f==null?void 0:f.ThuongTru,maThonXom:f==null?void 0:f.ThuongTru_ThonXom_Id},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:45,columnNumber:19},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:44,columnNumber:17},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:42,columnNumber:15},this),x.jsxDEV("div",{className:"d-flex row",children:[x.jsxDEV("strong",{className:"col-6 text-small",children:"Nơi ở hiện tại:"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:49,columnNumber:17},this),x.jsxDEV("p",{className:"col-6",children:x.jsxDEV(gp,{maPhuongXa:f==null?void 0:f.NoiOHienTai},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:51,columnNumber:19},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:50,columnNumber:17},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:48,columnNumber:15},this),x.jsxDEV(Lt,{data:qo.DiaChiCuThe,value:f==null?void 0:f.DiaChiCuThe},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:54,columnNumber:15},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:24,columnNumber:13},this),x.jsxDEV(Ar,{children:[x.jsxDEV(Lt,{data:qo.TrinhDoHV,value:f!=null&&f.QLLD_DM_TrinhDoHocVan?f==null?void 0:f.QLLD_DM_TrinhDoHocVan.Name:"",isDetail:!0},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:57,columnNumber:15},this),x.jsxDEV(Lt,{data:{title:"Trình độ học vấn(1/12 - 12/12):",type:"label"},value:f==null?void 0:f.TrinhDoHVText},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:62,columnNumber:15},this),x.jsxDEV(Lt,{data:qo.TrinhDoCMKT,value:f!=null&&f.QLLD_DM_TrinhDoCMKT?f==null?void 0:f.QLLD_DM_TrinhDoCMKT.Name:"",isDetail:!0},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:66,columnNumber:15},this),x.jsxDEV(Lt,{data:qo.TinhTrangHonNhan,value:f!=null&&f.QLLD_DM_TinhTrangHonNhan?f==null?void 0:f.QLLD_DM_TinhTrangHonNhan.Name:"",isDetail:!0},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:71,columnNumber:15},this),x.jsxDEV(Lt,{data:qo.TinhTrangThamGiaHDKT,value:f!=null&&f.QLLD_DM_TinhTrangViecLam?f==null?void 0:f.QLLD_DM_TinhTrangViecLam.Name:"",isDetail:!0},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:76,columnNumber:15},this),x.jsxDEV(Lt,{data:qo.ThamGiaBHXH,value:f!=null&&f.QLLD_DM_ThamGiaBHXH?f==null?void 0:f.QLLD_DM_ThamGiaBHXH.Name:"",isDetail:!0},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:81,columnNumber:15},this),x.jsxDEV(Lt,{data:qo.MaBHXH,value:f==null?void 0:f.MaBHXH},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:86,columnNumber:15},this),x.jsxDEV(Lt,{data:{title:"Số điện thoại:",type:"label"},value:f==null?void 0:f.SoDienThoai},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:87,columnNumber:15},this),x.jsxDEV(Lt,{data:{title:"Chuyên ngành đào tạo:",type:"label"},value:(w=f==null?void 0:f.QLLD_DM_GiaoDucQuocDan)==null?void 0:w.Name},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:88,columnNumber:15},this),x.jsxDEV(Lt,{data:{title:"Nhóm ngành kinh tế:",type:"label"},value:(k=f==null?void 0:f.QLLD_DM_NhomNganhKinhTe1)==null?void 0:k.Name},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:92,columnNumber:15},this),x.jsxDEV(Lt,{data:{title:"Công việc cụ thể:",type:"label"},value:(v=f==null?void 0:f.QLLD_DM_NhomNganhKinhTe)==null?void 0:v.Name},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:96,columnNumber:15},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:56,columnNumber:13},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:23,columnNumber:11},this),f&&h]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:22,columnNumber:9},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:21,columnNumber:7},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:20,columnNumber:5},this)}function pT(p){const{ID:f,isOpen:l,isClose:h}=p,[w,k]=U.useState(),v=U.useCallback(()=>{zt(`QLLD_NguoiLaoDong(${f})?$expand=PhuongXa,PhuongXa1,PhuongXa2,QLLD_DM_GioiTinh,QLLD_DM_DanToc,QLLD_DM_TonGiao,PhuongXa,QLLD_DM_QuanHeVoiChuHo,QLLD_DM_TrinhDoHocVan,QLLD_DM_TrinhDoCMKT,QLLD_DM_TinhTrangHonNhan,QLLD_DM_TinhTrangViecLam,QLLD_DM_ThamGiaBHXH,QLLD_DM_NhomNganhKinhTe,QLLD_DM_NhomNganhKinhTe1,QLLD_DM_GiaoDucQuocDan`,"GET",null).then(S=>k(S))},[f]),N=U.useCallback(()=>{h()},[h]);return U.useEffect(()=>{v()},[v]),x.jsxDEV(gT,{style:{zIndex:"9999"},open:l,onClose:N,children:x.jsxDEV(U.Suspense,{fallback:()=>x.jsxDEV(Dx,{},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/Detail.jsx",lineNumber:35,columnNumber:33},this),children:x.jsxDEV("div",{className:"csdlg-detail",children:x.jsxDEV(xN,{renderButton:x.jsxDEV(hn,{color:"danger",size:"sm",onClick:N,className:"me-2",children:[x.jsxDEV(Xt,{fa:"times-circle"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/Detail.jsx",lineNumber:40,columnNumber:17},this),x.jsxDEV("span",{className:"ms-1",children:"Đóng"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/Detail.jsx",lineNumber:41,columnNumber:17},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/Detail.jsx",lineNumber:39,columnNumber:15},this),isTabNew:!0,setStyle:{activeTab:1,style:{width:"100%"}},setClassName:{activeTab:1,className:"overflowTabBasic"},data:[{TabName:"Thông tin người lao động",TabContent:x.jsxDEV(fT,{data:w,reloadAll:()=>v(w==null?void 0:w.Id)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/Detail.jsx",lineNumber:50,columnNumber:29},this)}]},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/Detail.jsx",lineNumber:37,columnNumber:11},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/Detail.jsx",lineNumber:36,columnNumber:9},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/Detail.jsx",lineNumber:35,columnNumber:7},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/Detail.jsx",lineNumber:34,columnNumber:5},this)}const gT=si(QN)`
  .MuiDialogContent-root {
    overflow: auto !important;
    z-index: 9999 !important;
  }
`,bT=si.div`
  position: absolute;
  top: -12px;
  left: 12px;
  background-color: #fff;
  color: #374dc5;
  font-weight: bold;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1; /* number of lines to show */
  -webkit-box-orient: vertical;
`,vT=si(Sr)`
  .ntable {
    .search {
      top: 10px !important;
      left: 15px !important;
    }
    .ntable-wrap {
      .ntable-inner {
        height: calc(100vh - 200px);
        overflow-y: auto !important;
      }
    }
  }
`,wT=si(ww)`
  .input-group-text {
    transition: 0.3s linear;
    font-size: 12px;
    max-height: 27px;
    font-weight: bold;
    cursor: pointer;
    color: white;
    &:hover {
      opacity: 0.8;
    }
  }
`,kT=U.memo(p=>{const{label:f,onClick:l,selectedItem:h,dataSelect:w,valueDisplay:k,onDelete:v,placeholder:N,labelDelete:S,handelDeleteSelected:O}=p,C=typeof v;return x.jsxDEV(wT,{children:[x.jsxDEV(uu,{style:{fontSize:"0.775rem",maxHeight:"27px"},value:h?h[w.selectColumn]:k||N||"Chưa chọn...",readOnly:!0},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:76,columnNumber:7},globalThis),x.jsxDEV(f_,{className:"bg-info",style:{pointerEvents:w.disableSelect?"none":"auto",opacity:w.disableSelect?.65:1},onClick:l,children:f},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:89,columnNumber:7},globalThis),v&&x.jsxDEV(f_,{className:"bg-danger",style:{pointerEvents:w.disableSelect?"none":"auto",opacity:w.disableSelect?.65:1},onClick:C==="function"?v:O,children:S||"Xóa"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:100,columnNumber:9},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:75,columnNumber:5},globalThis)}),_T=U.memo(p=>{const{dataSelect:f,onClose:l,isOpen:h,setselectedItem:w,ableCRUD:k,maxWidth:v,isModal:N,toggleAdd:S,tableRef:O,toggleImport:C,toggleOnRowSelect:L,setValueRow:j,isImport:F}=p,q=U.useRef([{title:"Id",field:"Id",type:"numeric",hidden:!0},{title:"Tên",field:"Name",type:"string"}]);return x.jsxDEV(x.Fragment,{children:x.jsxDEV(vT,{maxWidth:v,size:"xl",isOpen:h,toggle:l,zIndex:f.zIndex||1301,children:[x.jsxDEV(xl,{children:x.jsxDEV(P0,{title:f.title,tableRef:O,url:f.url,columns:f.columns||q,where:f.where,SearchAdvanced:f.isFormSearch?()=>f.isFormSearch:null,onAdd:N?{onClick:()=>S("add",null)}:k?{disabled:!1,defaultValues:f.defaultValues||[]}:null,onEdit:N?{onClick:(K,te)=>S("edit",te),hidden:!k}:k?{defaultValues:f.defaultValuesEdit||[]}:null,onDelete:k?{}:null,onActions:[{icon:"upload",tooltip:"Import",isFreeAction:!0,hidden:!F,onClick:()=>C()},{icon:"tag",tooltip:"Chọn",onClick:(K,te)=>{w(te),l()}}],onRowClick:(K,te)=>{L(),j(te)}},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:157,columnNumber:11},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:156,columnNumber:9},globalThis)," "]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:149,columnNumber:7},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:148,columnNumber:5},globalThis)});function Sw(p){const{isComponent:f,label:l,dataSelect:h,onCallback:w,ableCRUD:k,valueDisplay:v,onDelete:N,placeholder:S,labelDelete:O,onClickButton:C,maxWidth:L,isModal:j,isImport:F,isCheck:q,isOnRowSelect:K,keyComponent:te}=p,[se,Z]=U.useState(null),[Y,oe]=U.useState(!1),[ie,ge]=U.useState(!1),[de,je]=U.useState({}),[Ie,Pe]=U.useState(null),[ce,ae]=U.useState(!1),[be,ke]=U.useState(!1),[_e,Ee]=U.useState(!1),[Se,Oe]=U.useState(),rt=U.useContext(jx),De=U.useRef(),Fe=U.useCallback(()=>De.current&&De.current.onQueryChange(),[]);U.useEffect(()=>{rt.reloadTablePopup&&Fe(),!rt.reloadTablePopup&&Fe()},[rt.reloadTablePopup,Fe]);const mt=U.useCallback(()=>{C&&C(),oe(!Y)},[C,Y]),Ne=U.useCallback((Re,ct)=>{C&&C(),Re==="add"?(Pe(null),je({})):Re==="edit"?(Pe(ct.Id),je({...ct})):je({}),ge(!ie)},[C,ie]),Le=()=>{rt.setOpenPopupNguoiLaoDong("abc"),oe(!1)},qe=U.useCallback(()=>{C&&C(),ae(!ce)},[ce,C]);U.useEffect(()=>{se&&w(se)},[w,se]);const{handleChange:$e,handleValidate:tt}=qN(de,h.formAddModal,Re=>je(Re)),nt=U.useCallback(async()=>{if(tt()){const Re=q;let ct=!1;const st=Ie?"PATCH":"POST",Bt=Ie?`${h.url}(guid'${Ie}')`:`${h.url}`,xn=Ie?"Cập nhật thành công":"Thêm thành công";delete de.DM_Chuong,delete de.Dieu18_DM_LinhVuc,delete de.Id,delete de.TenChuong,delete de.tableData,delete de.PhuongXa,delete de.QLLD_DM_DanToc,delete de.QLLD_DM_GioiTinh,delete de.QLLD_DM_ThamGiaBHXH,delete de.QLLD_DM_TinhTrangHonNhan,delete de.QLLD_DM_TinhTrangViecLam,delete de.QLLD_DM_TonGiao,delete de.QLLD_DM_TrinhDoCMKT,delete de.QLLD_DM_TrinhDoHocVan,delete de.QLLD_DM_QuanHeVoiChuHo,delete de.ThonXom,q&&!Ie&&(ct=await zt(`${Re}`,"POST",JSON.stringify(de),{odata:!1}));const ln=()=>zt(Bt,st,JSON.stringify(de)).then(jt=>{Ne(),Fe(),Cr(xn)});ct?Np("Bạn có muốn tiếp tục thêm vào dánh sách dự án",`Mã dự án ${de.MaDuAnDauTu} đã tồn tại trong danh sách dự án`).then(jt=>{jt.isConfirmed&&ln()}):ln()}},[tt,q,Ie,h.url,de,Ne,Fe]),Ue=U.useMemo(()=>{if(h.formAddModal){const Re=Object.values(h.formAddModal),ct=st=>{var Bt;return st.type!=="popup-select"?de[st.field_name]:de[(Bt=st.popupSelect)==null?void 0:Bt.selectColumn]};return x.jsxDEV(Sr,{size:"lg",isOpen:ie,zIndex:1301,toggle:Ne,children:[x.jsxDEV(du,{children:[Ie?x.jsxDEV("span",{children:"Cập Nhật"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:356,columnNumber:23},this):x.jsxDEV("span",{children:"Thêm Mới"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:356,columnNumber:47},this),x.jsxDEV("span",{className:"float-right",children:[x.jsxDEV(hn,{className:"me-2",color:"success",onClick:nt,children:[x.jsxDEV(Xt,{fa:"save"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:359,columnNumber:17},this),x.jsxDEV("span",{className:"ms-2",children:"Lưu"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:360,columnNumber:17},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:358,columnNumber:15},this),x.jsxDEV(hn,{color:"danger",onClick:Ne,children:[x.jsxDEV(Xt,{fa:"times"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:363,columnNumber:17},this),x.jsxDEV("span",{className:"ms-2",children:"Trở lại"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:364,columnNumber:17},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:362,columnNumber:15},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:357,columnNumber:13},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:355,columnNumber:11},this),x.jsxDEV(xl,{className:"pt-0",style:{height:"calc(100vh - 130px)",overflow:"auto"},children:Re.map((st,Bt)=>x.jsxDEV(Vx,{className:"mt-4",children:[x.jsxDEV(bT,{title:st.title,children:st.title},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:371,columnNumber:17},this),x.jsxDEV(Lx,{onDragStart:xn=>xn.preventDefault(),className:"pt-3 pb-2",children:[x.jsxDEV(Lt,{data:{...st,hidden_label:!0},value:ct(st),onChange:(xn,ln)=>$e(xn,ln),inline:!1},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:373,columnNumber:19},this),st.required&&x.jsxDEV("p",{className:"mb-0",children:[x.jsxDEV("span",{style:{color:"red"},children:"(*)"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:381,columnNumber:23},this)," Bắt buộc nhập"]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:380,columnNumber:21},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:372,columnNumber:17},this)]},Bt,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:370,columnNumber:15},this))},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:368,columnNumber:11},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:354,columnNumber:9},this)}},[h.formAddModal,ie,Ne,de,nt]),We=U.useCallback(()=>{ke(!be),Ee(!_e)},[be,_e]),et=U.useMemo(()=>{switch(te){case"ModalGD":return x.jsxDEV(GN,{valueRow:Se,isOpen:be,onClose:We},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:402,columnNumber:16},this);case"ModalNLD":return x.jsxDEV(pT,{SDDGD:Se==null?void 0:Se.SoDinhDanhHoGD,ID:Se==null?void 0:Se.Id,isOpen:_e,isClose:We},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:405,columnNumber:11},this);default:return x.jsxDEV("div",{className:""},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:413,columnNumber:16},this)}},[te,be,_e,We,Se]),Ut=U.useMemo(()=>{const{urlImport:Re,urlPreImport:ct,columnsImport:st,theadTableImport:Bt,title:xn,urldownload:ln,isNew:jt}=h;return x.jsxDEV(KN,{zIndex:1301,urldownload:ln,title:"Import "+xn,isOpen:ce,isClose:qe,isNew:jt,urlImport:Re,urlPreImport:ct,columnsImport:st,theadTableImport:Bt,reloadData:Fe},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:420,columnNumber:7},this)},[ce,qe,h,Fe]),en=U.useMemo(()=>Y&&x.jsxDEV(_T,{ableCRUD:k,isOpen:Y,onClose:mt,dataSelect:h,setselectedItem:Z,maxWidth:L,isModal:j,isImport:F,toggleAdd:f?Le:Ne,toggleImport:qe,tableRef:De,isOnRowSelect:K,toggleOnRowSelect:We,setValueRow:Oe,keyComponent:te},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:439,columnNumber:9},this),[k,h,j,L,Y,mt]),we=U.useCallback(()=>{Z(null)},[]);return x.jsxDEV(Ii.Fragment,{children:[x.jsxDEV(kT,{label:l,onClick:mt,onDelete:N,labelDelete:O,selectedItem:se,dataSelect:h,valueDisplay:v,placeholder:S,handelDeleteSelected:we},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:467,columnNumber:7},this),en,f||ie&&Ue,Ut,et]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:466,columnNumber:5},this)}Sw.propTypes={label:G.oneOfType([G.string,G.number,G.element]),dataSelect:G.shape({title:G.string,url:G.string.isRequired,where:G.string,columns:G.array,defaultValues:G.array,selectColumn:G.string.isRequired,disableSelect:G.bool}),onCallback:G.func.isRequired,className:G.shape({button:G.string,popup:G.string}),labelDelete:G.string,ableCRUD:G.bool,valueDisplay:G.string,placeholder:G.string,maxWidth:G.number};Sw.defaultProps={label:"Chọn",className:{},ableCRUD:!0};var _p={exports:{}};/*!
 * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
 * For licensing, see LICENSE.md.
 */_p.exports;(function(p,f){(function(l,h){p.exports=h(U)})(self,l=>(()=>{var h={703:(N,S,O)=>{var C=O(414);function L(){}function j(){}j.resetWarningCache=L,N.exports=function(){function F(te,se,Z,Y,oe,ie){if(ie!==C){var ge=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw ge.name="Invariant Violation",ge}}function q(){return F}F.isRequired=F;var K={array:F,bigint:F,bool:F,func:F,number:F,object:F,string:F,symbol:F,any:F,arrayOf:q,element:F,elementType:F,instanceOf:q,node:F,objectOf:q,oneOf:q,oneOfType:q,shape:q,exact:q,checkPropTypes:j,resetWarningCache:L};return K.PropTypes=K,K}},697:(N,S,O)=>{N.exports=O(703)()},414:N=>{N.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},787:N=>{N.exports=l}},w={};function k(N){var S=w[N];if(S!==void 0)return S.exports;var O=w[N]={exports:{}};return h[N](O,O.exports,k),O.exports}k.n=N=>{var S=N&&N.__esModule?()=>N.default:()=>N;return k.d(S,{a:S}),S},k.d=(N,S)=>{for(var O in S)k.o(S,O)&&!k.o(N,O)&&Object.defineProperty(N,O,{enumerable:!0,get:S[O]})},k.o=(N,S)=>Object.prototype.hasOwnProperty.call(N,S),k.r=N=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(N,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(N,"__esModule",{value:!0})};var v={};return(()=>{k.r(v),k.d(v,{CKEditor:()=>Oo,CKEditorContext:()=>Pa});var N=k(787),S=k.n(N),O=k(697),C=k.n(O);const L=function(D){var I=typeof D;return D!=null&&(I=="object"||I=="function")},j=typeof an=="object"&&an&&an.Object===Object&&an;var F=typeof self=="object"&&self&&self.Object===Object&&self;const q=j||F||Function("return this")(),K=function(){return q.Date.now()};var te=/\s/;const se=function(D){for(var I=D.length;I--&&te.test(D.charAt(I)););return I};var Z=/^\s+/;const Y=function(D){return D&&D.slice(0,se(D)+1).replace(Z,"")},oe=q.Symbol;var ie=Object.prototype,ge=ie.hasOwnProperty,de=ie.toString,je=oe?oe.toStringTag:void 0;const Ie=function(D){var I=ge.call(D,je),B=D[je];try{D[je]=void 0;var ne=!0}catch{}var Me=de.call(D);return ne&&(I?D[je]=B:delete D[je]),Me};var Pe=Object.prototype.toString;const ce=function(D){return Pe.call(D)};var ae=oe?oe.toStringTag:void 0;const be=function(D){return D==null?D===void 0?"[object Undefined]":"[object Null]":ae&&ae in Object(D)?Ie(D):ce(D)},ke=function(D){return D!=null&&typeof D=="object"},_e=function(D){return typeof D=="symbol"||ke(D)&&be(D)=="[object Symbol]"};var Ee=/^[-+]0x[0-9a-f]+$/i,Se=/^0b[01]+$/i,Oe=/^0o[0-7]+$/i,rt=parseInt;const De=function(D){if(typeof D=="number")return D;if(_e(D))return NaN;if(L(D)){var I=typeof D.valueOf=="function"?D.valueOf():D;D=L(I)?I+"":I}if(typeof D!="string")return D===0?D:+D;D=Y(D);var B=Se.test(D);return B||Oe.test(D)?rt(D.slice(2),B?2:8):Ee.test(D)?NaN:+D};var Fe=Math.max,mt=Math.min;const Ne=function(D,I,B){var ne,Me,Te,Ve,Ke,Ct,Zt=0,mr=!1,Ro=!1,Vo=!0;if(typeof D!="function")throw new TypeError("Expected a function");function wo(Je){var Ot=ne,Nt=Me;return ne=Me=void 0,Zt=Je,Ve=D.apply(Nt,Ot)}function Q(Je){return Zt=Je,Ke=setTimeout(ee,I),mr?wo(Je):Ve}function re(Je){var Ot=Je-Ct;return Ct===void 0||Ot>=I||Ot<0||Ro&&Je-Zt>=Te}function ee(){var Je=K();if(re(Je))return Ce(Je);Ke=setTimeout(ee,function(Ot){var Nt=I-(Ot-Ct);return Ro?mt(Nt,Te-(Ot-Zt)):Nt}(Je))}function Ce(Je){return Ke=void 0,Vo&&ne?wo(Je):(ne=Me=void 0,Ve)}function Xe(){var Je=K(),Ot=re(Je);if(ne=arguments,Me=this,Ct=Je,Ot){if(Ke===void 0)return Q(Ct);if(Ro)return clearTimeout(Ke),Ke=setTimeout(ee,I),wo(Ct)}return Ke===void 0&&(Ke=setTimeout(ee,I)),Ve}return I=De(I)||0,L(B)&&(mr=!!B.leading,Te=(Ro="maxWait"in B)?Fe(De(B.maxWait)||0,I):Te,Vo="trailing"in B?!!B.trailing:Vo),Xe.cancel=function(){Ke!==void 0&&clearTimeout(Ke),Zt=0,ne=Ct=Me=Ke=void 0},Xe.flush=function(){return Ke===void 0?Ve:Ce(K())},Xe},Le=function(D,I,B){var ne=!0,Me=!0;if(typeof D!="function")throw new TypeError("Expected a function");return L(B)&&(ne="leading"in B?!!B.leading:ne,Me="trailing"in B?!!B.trailing:Me),Ne(D,I,{leading:ne,maxWait:I,trailing:Me})},qe=function(){this.__data__=[],this.size=0},$e=function(D,I){return D===I||D!=D&&I!=I},tt=function(D,I){for(var B=D.length;B--;)if($e(D[B][0],I))return B;return-1};var nt=Array.prototype.splice;const Ue=function(D){var I=this.__data__,B=tt(I,D);return!(B<0)&&(B==I.length-1?I.pop():nt.call(I,B,1),--this.size,!0)},We=function(D){var I=this.__data__,B=tt(I,D);return B<0?void 0:I[B][1]},et=function(D){return tt(this.__data__,D)>-1},Ut=function(D,I){var B=this.__data__,ne=tt(B,D);return ne<0?(++this.size,B.push([D,I])):B[ne][1]=I,this};function en(D){var I=-1,B=D==null?0:D.length;for(this.clear();++I<B;){var ne=D[I];this.set(ne[0],ne[1])}}en.prototype.clear=qe,en.prototype.delete=Ue,en.prototype.get=We,en.prototype.has=et,en.prototype.set=Ut;const we=en,Re=function(){this.__data__=new we,this.size=0},ct=function(D){var I=this.__data__,B=I.delete(D);return this.size=I.size,B},st=function(D){return this.__data__.get(D)},Bt=function(D){return this.__data__.has(D)},xn=function(D){if(!L(D))return!1;var I=be(D);return I=="[object Function]"||I=="[object GeneratorFunction]"||I=="[object AsyncFunction]"||I=="[object Proxy]"},ln=q["__core-js_shared__"];var jt=function(){var D=/[^.]+$/.exec(ln&&ln.keys&&ln.keys.IE_PROTO||"");return D?"Symbol(src)_1."+D:""}();const Wo=function(D){return!!jt&&jt in D};var or=Function.prototype.toString;const gn=function(D){if(D!=null){try{return or.call(D)}catch{}try{return D+""}catch{}}return""};var ai=/^\[object .+?Constructor\]$/,ea=Function.prototype,li=Object.prototype,go=ea.toString,jr=li.hasOwnProperty,Oi=RegExp("^"+go.call(jr).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const Ir=function(D){return!(!L(D)||Wo(D))&&(xn(D)?Oi:ai).test(gn(D))},Ri=function(D,I){return D==null?void 0:D[I]},bo=function(D,I){var B=Ri(D,I);return Ir(B)?B:void 0},ft=bo(q,"Map"),Jt=bo(Object,"create"),mn=function(){this.__data__=Jt?Jt(null):{},this.size=0},bn=function(D){var I=this.has(D)&&delete this.__data__[D];return this.size-=I?1:0,I};var An=Object.prototype.hasOwnProperty;const jn=function(D){var I=this.__data__;if(Jt){var B=I[D];return B==="__lodash_hash_undefined__"?void 0:B}return An.call(I,D)?I[D]:void 0};var cn=Object.prototype.hasOwnProperty;const Io=function(D){var I=this.__data__;return Jt?I[D]!==void 0:cn.call(I,D)},xt=function(D,I){var B=this.__data__;return this.size+=this.has(D)?0:1,B[D]=Jt&&I===void 0?"__lodash_hash_undefined__":I,this};function ci(D){var I=-1,B=D==null?0:D.length;for(this.clear();++I<B;){var ne=D[I];this.set(ne[0],ne[1])}}ci.prototype.clear=mn,ci.prototype.delete=bn,ci.prototype.get=jn,ci.prototype.has=Io,ci.prototype.set=xt;const ms=ci,ir=function(){this.size=0,this.__data__={hash:new ms,map:new(ft||we),string:new ms}},Sl=function(D){var I=typeof D;return I=="string"||I=="number"||I=="symbol"||I=="boolean"?D!=="__proto__":D===null},Vi=function(D,I){var B=D.__data__;return Sl(I)?B[typeof I=="string"?"string":"hash"]:B.map},yu=function(D){var I=Vi(this,D).delete(D);return this.size-=I?1:0,I},Dl=function(D){return Vi(this,D).get(D)},xu=function(D){return Vi(this,D).has(D)},Pr=function(D,I){var B=Vi(this,D),ne=B.size;return B.set(D,I),this.size+=B.size==ne?0:1,this};function rr(D){var I=-1,B=D==null?0:D.length;for(this.clear();++I<B;){var ne=D[I];this.set(ne[0],ne[1])}}rr.prototype.clear=ir,rr.prototype.delete=yu,rr.prototype.get=Dl,rr.prototype.has=xu,rr.prototype.set=Pr;const ta=rr,Nu=function(D,I){var B=this.__data__;if(B instanceof we){var ne=B.__data__;if(!ft||ne.length<199)return ne.push([D,I]),this.size=++B.size,this;B=this.__data__=new ta(ne)}return B.set(D,I),this.size=B.size,this};function vo(D){var I=this.__data__=new we(D);this.size=I.size}vo.prototype.clear=Re,vo.prototype.delete=ct,vo.prototype.get=st,vo.prototype.has=Bt,vo.prototype.set=Nu;const Mr=vo,fs=function(D,I){for(var B=-1,ne=D==null?0:D.length;++B<ne&&I(D[B],B,D)!==!1;);return D},Or=function(){try{var D=bo(Object,"defineProperty");return D({},"",{}),D}catch{}}(),Rr=function(D,I,B){I=="__proto__"&&Or?Or(D,I,{configurable:!0,enumerable:!0,value:B,writable:!0}):D[I]=B};var sr=Object.prototype.hasOwnProperty;const na=function(D,I,B){var ne=D[I];sr.call(D,I)&&$e(ne,B)&&(B!==void 0||I in D)||Rr(D,I,B)},Li=function(D,I,B,ne){var Me=!B;B||(B={});for(var Te=-1,Ve=I.length;++Te<Ve;){var Ke=I[Te],Ct=ne?ne(B[Ke],D[Ke],Ke,B,D):void 0;Ct===void 0&&(Ct=D[Ke]),Me?Rr(B,Ke,Ct):na(B,Ke,Ct)}return B},Wt=function(D,I){for(var B=-1,ne=Array(D);++B<D;)ne[B]=I(B);return ne},oa=function(D){return ke(D)&&be(D)=="[object Arguments]"};var jl=Object.prototype,Tu=jl.hasOwnProperty,Il=jl.propertyIsEnumerable;const Pl=oa(function(){return arguments}())?oa:function(D){return ke(D)&&Tu.call(D,"callee")&&!Il.call(D,"callee")},Be=Array.isArray,ve=function(){return!1};var ar=f&&!f.nodeType&&f,pt=ar&&!0&&p&&!p.nodeType&&p,ia=pt&&pt.exports===ar?q.Buffer:void 0;const ra=(ia?ia.isBuffer:void 0)||ve;var sa=/^(?:0|[1-9]\d*)$/;const ps=function(D,I){var B=typeof D;return!!(I=I??9007199254740991)&&(B=="number"||B!="symbol"&&sa.test(D))&&D>-1&&D%1==0&&D<I},aa=function(D){return typeof D=="number"&&D>-1&&D%1==0&&D<=9007199254740991};var Kt={};Kt["[object Float32Array]"]=Kt["[object Float64Array]"]=Kt["[object Int8Array]"]=Kt["[object Int16Array]"]=Kt["[object Int32Array]"]=Kt["[object Uint8Array]"]=Kt["[object Uint8ClampedArray]"]=Kt["[object Uint16Array]"]=Kt["[object Uint32Array]"]=!0,Kt["[object Arguments]"]=Kt["[object Array]"]=Kt["[object ArrayBuffer]"]=Kt["[object Boolean]"]=Kt["[object DataView]"]=Kt["[object Date]"]=Kt["[object Error]"]=Kt["[object Function]"]=Kt["[object Map]"]=Kt["[object Number]"]=Kt["[object Object]"]=Kt["[object RegExp]"]=Kt["[object Set]"]=Kt["[object String]"]=Kt["[object WeakMap]"]=!1;const Ml=function(D){return ke(D)&&aa(D.length)&&!!Kt[be(D)]},la=function(D){return function(I){return D(I)}};var Ol=f&&!f.nodeType&&f,Nn=Ol&&!0&&p&&!p.nodeType&&p,gs=Nn&&Nn.exports===Ol&&j.process;const Po=function(){try{var D=Nn&&Nn.require&&Nn.require("util").types;return D||gs&&gs.binding&&gs.binding("util")}catch{}}();var bs=Po&&Po.isTypedArray;const Cu=bs?la(bs):Ml;var Rl=Object.prototype.hasOwnProperty;const Vr=function(D,I){var B=Be(D),ne=!B&&Pl(D),Me=!B&&!ne&&ra(D),Te=!B&&!ne&&!Me&&Cu(D),Ve=B||ne||Me||Te,Ke=Ve?Wt(D.length,String):[],Ct=Ke.length;for(var Zt in D)!I&&!Rl.call(D,Zt)||Ve&&(Zt=="length"||Me&&(Zt=="offset"||Zt=="parent")||Te&&(Zt=="buffer"||Zt=="byteLength"||Zt=="byteOffset")||ps(Zt,Ct))||Ke.push(Zt);return Ke};var Vl=Object.prototype;const ui=function(D){var I=D&&D.constructor;return D===(typeof I=="function"&&I.prototype||Vl)},lr=function(D,I){return function(B){return D(I(B))}},Ll=lr(Object.keys,Object);var ca=Object.prototype.hasOwnProperty;const Eu=function(D){if(!ui(D))return Ll(D);var I=[];for(var B in Object(D))ca.call(D,B)&&B!="constructor"&&I.push(B);return I},ua=function(D){return D!=null&&aa(D.length)&&!xn(D)},Ko=function(D){return ua(D)?Vr(D):Eu(D)},zi=function(D,I){return D&&Li(I,Ko(I),D)},cr=function(D){var I=[];if(D!=null)for(var B in Object(D))I.push(B);return I};var zl=Object.prototype.hasOwnProperty;const Bl=function(D){if(!L(D))return cr(D);var I=ui(D),B=[];for(var ne in D)(ne!="constructor"||!I&&zl.call(D,ne))&&B.push(ne);return B},da=function(D){return ua(D)?Vr(D,!0):Bl(D)},Fl=function(D,I){return D&&Li(I,da(I),D)};var ha=f&&!f.nodeType&&f,ma=ha&&!0&&p&&!p.nodeType&&p,di=ma&&ma.exports===ha?q.Buffer:void 0,fa=di?di.allocUnsafe:void 0;const Au=function(D,I){if(I)return D.slice();var B=D.length,ne=fa?fa(B):new D.constructor(B);return D.copy(ne),ne},Su=function(D,I){var B=-1,ne=D.length;for(I||(I=Array(ne));++B<ne;)I[B]=D[B];return I},Lr=function(D,I){for(var B=-1,ne=D==null?0:D.length,Me=0,Te=[];++B<ne;){var Ve=D[B];I(Ve,B,D)&&(Te[Me++]=Ve)}return Te},ql=function(){return[]};var Du=Object.prototype.propertyIsEnumerable,Hl=Object.getOwnPropertySymbols;const pa=Hl?function(D){return D==null?[]:(D=Object(D),Lr(Hl(D),function(I){return Du.call(D,I)}))}:ql,hi=function(D,I){return Li(D,pa(D),I)},zr=function(D,I){for(var B=-1,ne=I.length,Me=D.length;++B<ne;)D[Me+B]=I[B];return D},ga=lr(Object.getPrototypeOf,Object),Bi=Object.getOwnPropertySymbols?function(D){for(var I=[];D;)zr(I,pa(D)),D=ga(D);return I}:ql,Br=function(D,I){return Li(D,Bi(D),I)},$l=function(D,I,B){var ne=I(D);return Be(D)?ne:zr(ne,B(D))},Gt=function(D){return $l(D,Ko,pa)},Ft=function(D){return $l(D,da,Bi)},ba=bo(q,"DataView"),Fr=bo(q,"Promise"),va=bo(q,"Set"),wa=bo(q,"WeakMap");var ka="[object Map]",_a="[object Promise]",ya="[object Set]",xa="[object WeakMap]",vn="[object DataView]",vs=gn(ba),Go=gn(ft),Ul=gn(Fr),ws=gn(va),Qn=gn(wa),mi=be;(ba&&mi(new ba(new ArrayBuffer(1)))!=vn||ft&&mi(new ft)!=ka||Fr&&mi(Fr.resolve())!=_a||va&&mi(new va)!=ya||wa&&mi(new wa)!=xa)&&(mi=function(D){var I=be(D),B=I=="[object Object]"?D.constructor:void 0,ne=B?gn(B):"";if(ne)switch(ne){case vs:return vn;case Go:return ka;case Ul:return _a;case ws:return ya;case Qn:return xa}return I});const qr=mi;var ks=Object.prototype.hasOwnProperty;const Wl=function(D){var I=D.length,B=new D.constructor(I);return I&&typeof D[0]=="string"&&ks.call(D,"index")&&(B.index=D.index,B.input=D.input),B},Hr=q.Uint8Array,ur=function(D){var I=new D.constructor(D.byteLength);return new Hr(I).set(new Hr(D)),I},In=function(D,I){var B=I?ur(D.buffer):D.buffer;return new D.constructor(B,D.byteOffset,D.byteLength)};var Na=/\w*$/;const oo=function(D){var I=new D.constructor(D.source,Na.exec(D));return I.lastIndex=D.lastIndex,I};var Kl=oe?oe.prototype:void 0,Ta=Kl?Kl.valueOf:void 0;const fi=function(D){return Ta?Object(Ta.call(D)):{}},_s=function(D,I){var B=I?ur(D.buffer):D.buffer;return new D.constructor(B,D.byteOffset,D.length)},Qo=function(D,I,B){var ne=D.constructor;switch(I){case"[object ArrayBuffer]":return ur(D);case"[object Boolean]":case"[object Date]":return new ne(+D);case"[object DataView]":return In(D,B);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return _s(D,B);case"[object Map]":case"[object Set]":return new ne;case"[object Number]":case"[object String]":return new ne(D);case"[object RegExp]":return oo(D);case"[object Symbol]":return fi(D)}};var At=Object.create;const pi=function(){function D(){}return function(I){if(!L(I))return{};if(At)return At(I);D.prototype=I;var B=new D;return D.prototype=void 0,B}}(),Ca=function(D){return typeof D.constructor!="function"||ui(D)?{}:pi(ga(D))},ys=function(D){return ke(D)&&qr(D)=="[object Map]"};var dr=Po&&Po.isMap;const ju=dr?la(dr):ys,Iu=function(D){return ke(D)&&qr(D)=="[object Set]"};var Gl=Po&&Po.isSet;const Ea=Gl?la(Gl):Iu;var hr="[object Arguments]",Fi="[object Function]",Ql="[object Object]",Mt={};Mt[hr]=Mt["[object Array]"]=Mt["[object ArrayBuffer]"]=Mt["[object DataView]"]=Mt["[object Boolean]"]=Mt["[object Date]"]=Mt["[object Float32Array]"]=Mt["[object Float64Array]"]=Mt["[object Int8Array]"]=Mt["[object Int16Array]"]=Mt["[object Int32Array]"]=Mt["[object Map]"]=Mt["[object Number]"]=Mt["[object Object]"]=Mt["[object RegExp]"]=Mt["[object Set]"]=Mt["[object String]"]=Mt["[object Symbol]"]=Mt["[object Uint8Array]"]=Mt["[object Uint8ClampedArray]"]=Mt["[object Uint16Array]"]=Mt["[object Uint32Array]"]=!0,Mt["[object Error]"]=Mt[Fi]=Mt["[object WeakMap]"]=!1;const Aa=function D(I,B,ne,Me,Te,Ve){var Ke,Ct=1&B,Zt=2&B,mr=4&B;if(ne&&(Ke=Te?ne(I,Me,Te,Ve):ne(I)),Ke!==void 0)return Ke;if(!L(I))return I;var Ro=Be(I);if(Ro){if(Ke=Wl(I),!Ct)return Su(I,Ke)}else{var Vo=qr(I),wo=Vo==Fi||Vo=="[object GeneratorFunction]";if(ra(I))return Au(I,Ct);if(Vo==Ql||Vo==hr||wo&&!Te){if(Ke=Zt||wo?{}:Ca(I),!Ct)return Zt?Br(I,Fl(Ke,I)):hi(I,zi(Ke,I))}else{if(!Mt[Vo])return Te?I:{};Ke=Qo(I,Vo,Ct)}}Ve||(Ve=new Mr);var Q=Ve.get(I);if(Q)return Q;Ve.set(I,Ke),Ea(I)?I.forEach(function(ee){Ke.add(D(ee,B,ne,ee,I,Ve))}):ju(I)&&I.forEach(function(ee,Ce){Ke.set(Ce,D(ee,B,ne,Ce,I,Ve))});var re=Ro?void 0:(mr?Zt?Ft:Gt:Zt?da:Ko)(I);return fs(re||I,function(ee,Ce){re&&(ee=I[Ce=ee]),na(Ke,Ce,D(ee,B,ne,Ce,I,Ve))}),Ke},Sa=function(D,I){return Aa(D,5,I=typeof I=="function"?I:void 0)};var xs=Function.prototype,Yl=Object.prototype,Da=xs.toString,ja=Yl.hasOwnProperty,Ia=Da.call(Object);const Xl=function(D){if(!ke(D)||be(D)!="[object Object]")return!1;var I=ga(D);if(I===null)return!0;var B=ja.call(I,"constructor")&&I.constructor;return typeof B=="function"&&B instanceof B&&Da.call(B)==Ia},Jl=function(D){return ke(D)&&D.nodeType===1&&!Xl(D)};function at(D,I=new Set){const B=[D],ne=new Set;let Me=0;for(;B.length>Me;){const Te=B[Me++];if(!(ne.has(Te)||$r(Te)||I.has(Te)))if(ne.add(Te),Te[Symbol.iterator])try{for(const Ve of Te)B.push(Ve)}catch{}else for(const Ve in Te)Ve!=="defaultValue"&&B.push(Te[Ve])}return ne}function $r(D){const I=Object.prototype.toString.call(D),B=typeof D;return B==="number"||B==="boolean"||B==="string"||B==="symbol"||B==="function"||I==="[object Date]"||I==="[object RegExp]"||I==="[object Module]"||D==null||D instanceof EventTarget||D instanceof Event}function qi(D,I,B=new Set){if(D===I&&typeof(ne=D)=="object"&&ne!==null)return!0;var ne;const Me=at(D,B),Te=at(I,B);for(const Ve of Me)if(Te.has(Ve))return!0;return!1}class Mo{constructor(I){if(this.crashes=[],this.state="initializing",this._crashNumberLimit=typeof I.crashNumberLimit=="number"?I.crashNumberLimit:3,this._now=Date.now,this._minimumNonErrorTimePeriod=typeof I.minimumNonErrorTimePeriod=="number"?I.minimumNonErrorTimePeriod:5e3,this._boundErrorHandler=B=>{const ne=B.error||B.reason;ne instanceof Error&&this._handleError(ne,B)},this._listeners={},!this._restart)throw new Error("The Watchdog class was split into the abstract `Watchdog` class and the `EditorWatchdog` class. Please, use `EditorWatchdog` if you have used the `Watchdog` class previously.")}setCreator(I){this._creator=I}setDestructor(I){this._destructor=I}destroy(){this._stopErrorHandling(),this._listeners={}}on(I,B){this._listeners[I]||(this._listeners[I]=[]),this._listeners[I].push(B)}off(I,B){this._listeners[I]=this._listeners[I].filter(ne=>ne!==B)}_fire(I,...B){const ne=this._listeners[I]||[];for(const Me of ne)Me.apply(this,[null,...B])}_startErrorHandling(){window.addEventListener("error",this._boundErrorHandler),window.addEventListener("unhandledrejection",this._boundErrorHandler)}_stopErrorHandling(){window.removeEventListener("error",this._boundErrorHandler),window.removeEventListener("unhandledrejection",this._boundErrorHandler)}_handleError(I,B){if(this._shouldReactToError(I)){this.crashes.push({message:I.message,stack:I.stack,filename:B.filename,lineno:B.lineno,colno:B.colno,date:this._now()});const ne=this._shouldRestart();this.state="crashed",this._fire("stateChange"),this._fire("error",{error:I,causesRestart:ne}),ne?this._restart():(this.state="crashedPermanently",this._fire("stateChange"))}}_shouldReactToError(I){return I.is&&I.is("CKEditorError")&&I.context!==void 0&&I.context!==null&&this.state==="ready"&&this._isErrorComingFromThisItem(I)}_shouldRestart(){return this.crashes.length<=this._crashNumberLimit?!0:(this.crashes[this.crashes.length-1].date-this.crashes[this.crashes.length-1-this._crashNumberLimit].date)/this._crashNumberLimit>this._minimumNonErrorTimePeriod}}class Ns extends Mo{constructor(I,B={}){super(B),this._editor=null,this._throttledSave=Le(this._save.bind(this),typeof B.saveInterval=="number"?B.saveInterval:5e3),this._creator=(ne,Me)=>I.create(ne,Me),this._destructor=ne=>ne.destroy()}get editor(){return this._editor}get _item(){return this._editor}_restart(){return Promise.resolve().then(()=>(this.state="initializing",this._fire("stateChange"),this._destroy())).catch(I=>{console.error("An error happened during the editor destroying.",I)}).then(()=>{if(typeof this._elementOrData=="string")return this.create(this._data,this._config,this._config.context);{const I=Object.assign({},this._config,{initialData:this._data});return this.create(this._elementOrData,I,I.context)}}).then(()=>{this._fire("restart")})}create(I=this._elementOrData,B=this._config,ne){return Promise.resolve().then(()=>(super._startErrorHandling(),this._elementOrData=I,this._config=this._cloneEditorConfiguration(B)||{},this._config.context=ne,this._creator(I,this._config))).then(Me=>{this._editor=Me,Me.model.document.on("change:data",this._throttledSave),this._lastDocumentVersion=Me.model.document.version,this._data=this._getData(),this.state="ready",this._fire("stateChange")})}destroy(){return Promise.resolve().then(()=>(this.state="destroyed",this._fire("stateChange"),super.destroy(),this._destroy()))}_destroy(){return Promise.resolve().then(()=>{this._stopErrorHandling(),this._throttledSave.flush();const I=this._editor;return this._editor=null,I.model.document.off("change:data",this._throttledSave),this._destructor(I)})}_save(){const I=this._editor.model.document.version;try{this._data=this._getData(),this._lastDocumentVersion=I}catch(B){console.error(B,"An error happened during restoring editor data. Editor will be restored from the previously saved data.")}}_setExcludedProperties(I){this._excludedProps=I}_getData(){const I={};for(const B of this._editor.model.document.getRootNames())I[B]=this._editor.data.get({rootName:B});return I}_isErrorComingFromThisItem(I){return qi(this._editor,I.context,this._excludedProps)}_cloneEditorConfiguration(I){return Sa(I,(B,ne)=>Jl(B)||ne==="context"?B:void 0)}}const Tn=new Array(256).fill().map((D,I)=>("0"+I.toString(16)).slice(-2)),Ur=Symbol("MainQueueId");class Yn extends Mo{constructor(I,B={}){super(B),this._watchdogs=new Map,this._watchdogConfig=B,this._context=null,this._contextProps=new Set,this._actionQueues=new io,this._creator=ne=>I.create(ne),this._destructor=ne=>ne.destroy(),this._actionQueues.onEmpty(()=>{this.state==="initializing"&&(this.state="ready",this._fire("stateChange"))})}get context(){return this._context}create(I={}){return this._actionQueues.enqueue(Ur,()=>(this._contextConfig=I,this._create()))}getItem(I){return this._getWatchdog(I)._item}getItemState(I){return this._getWatchdog(I).state}add(I){const B=Ts(I);return Promise.all(B.map(ne=>this._actionQueues.enqueue(ne.id,()=>{if(this.state==="destroyed")throw new Error("Cannot add items to destroyed watchdog.");if(!this._context)throw new Error("Context was not created yet. You should call the `ContextWatchdog#create()` method first.");let Me;if(this._watchdogs.has(ne.id))throw new Error(`Item with the given id is already added: '${ne.id}'.`);if(ne.type==="editor")return Me=new Ns(this._watchdogConfig),Me.setCreator(ne.creator),Me._setExcludedProperties(this._contextProps),ne.destructor&&Me.setDestructor(ne.destructor),this._watchdogs.set(ne.id,Me),Me.on("error",(Te,{error:Ve,causesRestart:Ke})=>{this._fire("itemError",{itemId:ne.id,error:Ve}),Ke&&this._actionQueues.enqueue(ne.id,()=>new Promise(Ct=>{Me.on("restart",(function Zt(){Me.off("restart",Zt),this._fire("itemRestart",{itemId:ne.id}),Ct()}).bind(this))}))}),Me.create(ne.sourceElementOrData,ne.config,this._context);throw new Error(`Not supported item type: '${ne.type}'.`)})))}remove(I){const B=Ts(I);return Promise.all(B.map(ne=>this._actionQueues.enqueue(ne,()=>{const Me=this._getWatchdog(ne);return this._watchdogs.delete(ne),Me.destroy()})))}destroy(){return this._actionQueues.enqueue(Ur,()=>(this.state="destroyed",this._fire("stateChange"),super.destroy(),this._destroy()))}_restart(){return this._actionQueues.enqueue(Ur,()=>(this.state="initializing",this._fire("stateChange"),this._destroy().catch(I=>{console.error("An error happened during destroying the context or items.",I)}).then(()=>this._create()).then(()=>this._fire("restart"))))}_create(){return Promise.resolve().then(()=>(this._startErrorHandling(),this._creator(this._contextConfig))).then(I=>(this._context=I,this._contextProps=at(this._context),Promise.all(Array.from(this._watchdogs.values()).map(B=>(B._setExcludedProperties(this._contextProps),B.create(void 0,void 0,this._context))))))}_destroy(){return Promise.resolve().then(()=>{this._stopErrorHandling();const I=this._context;return this._context=null,this._contextProps=new Set,Promise.all(Array.from(this._watchdogs.values()).map(B=>B.destroy())).then(()=>this._destructor(I))})}_getWatchdog(I){const B=this._watchdogs.get(I);if(!B)throw new Error(`Item with the given id was not registered: ${I}.`);return B}_isErrorComingFromThisItem(I){for(const B of this._watchdogs.values())if(B._isErrorComingFromThisItem(I))return!1;return qi(this._context,I.context)}}class io{constructor(){this._onEmptyCallbacks=[],this._queues=new Map,this._actions=new WeakMap,this._lastActionId=0,this._activeActions=0}onEmpty(I){this._onEmptyCallbacks.push(I)}enqueue(I,B){const ne=I===Ur;this._activeActions++,this._queues.get(I)||this._queues.set(I,Promise.resolve());const Me=(ne?Promise.all(this._queues.values()):Promise.all([this._queues.get(Ur),this._queues.get(I)])).then(B),Te=Me.catch(()=>{});return this._queues.set(I,Te),Me.finally(()=>{this._activeActions--,this._queues.get(I)===Te&&this._activeActions===0&&this._onEmptyCallbacks.forEach(Ve=>Ve())})}}function Ts(D){return Array.isArray(D)?D:[D]}const Tt=S().createContext("contextWatchdog");class Pa extends S().Component{constructor(I,B){super(I,B),this.contextWatchdog=null,this.props.isLayoutReady&&this._initializeContextWatchdog(this.props.config)}async shouldComponentUpdate(I){return I.id!==this.props.id&&(this.contextWatchdog&&await this.contextWatchdog.destroy(),await this._initializeContextWatchdog(I.config)),I.isLayoutReady&&!this.contextWatchdog?(await this._initializeContextWatchdog(I.config),!0):this.props.children!==I.children}render(){return S().createElement(Tt.Provider,{value:this.contextWatchdog},this.props.children)}async componentWillUnmount(){await this._destroyContext()}async _initializeContextWatchdog(I){this.contextWatchdog=new Yn(this.props.context),this.contextWatchdog.on("error",(B,ne)=>{this.props.onError(ne.error,{phase:"runtime",willContextRestart:ne.causesRestart})}),this.contextWatchdog.on("stateChange",()=>{this.contextWatchdog.state==="ready"&&this.props.onReady&&this.props.onReady(this.contextWatchdog.context)}),await this.contextWatchdog.create(I).catch(B=>{this.props.onError(B,{phase:"initialization",willContextRestart:!1})})}async _destroyContext(){this.contextWatchdog&&(await this.contextWatchdog.destroy(),this.contextWatchdog=null)}}Pa.defaultProps={isLayoutReady:!0,onError:(D,I)=>console.error(D,I)},Pa.propTypes={id:C().string,isLayoutReady:C().bool,context:C().func,config:C().object,onReady:C().func,onError:C().func};const Ma="Lock from React integration (@ckeditor/ckeditor5-react)";class Oo extends S().Component{constructor(I){super(I),this.editorDestructionInProgress=null,this.domContainer=S().createRef(),this.watchdog=null;const{CKEDITOR_VERSION:B}=window;if(B){const[ne]=B.split(".").map(Number);ne<34&&console.warn("The <CKEditor> component requires using CKEditor 5 in version 34 or higher.")}else console.warn('Cannot find the "CKEDITOR_VERSION" in the "window" scope.')}get editor(){return this.watchdog?this.watchdog.editor:null}shouldComponentUpdate(I){return!!this.editor&&(I.id!==this.props.id||(this._shouldUpdateEditor(I)&&this.editor.setData(I.data),"disabled"in I&&(I.disabled?this.editor.enableReadOnlyMode(Ma):this.editor.disableReadOnlyMode(Ma)),!1))}async componentDidMount(){await this._initializeEditor()}async componentDidUpdate(){await this._destroyEditor(),await this._initializeEditor()}async componentWillUnmount(){await this._destroyEditor()}render(){return S().createElement("div",{ref:this.domContainer})}async _initializeEditor(){await this.editorDestructionInProgress,this.watchdog||(this.context instanceof Yn?this.watchdog=new Zl(this.context):this.watchdog=new Oo._EditorWatchdog(this.props.editor),this.watchdog.setCreator((I,B)=>this._createEditor(I,B)),this.watchdog.on("error",(I,{error:B,causesRestart:ne})=>{this.props.onError(B,{phase:"runtime",willEditorRestart:ne})}),await this.watchdog.create(this.domContainer.current,this._getConfig()).catch(I=>this.props.onError(I,{phase:"initialization",willEditorRestart:!1})))}_createEditor(I,B){return this.props.editor.create(I,B).then(ne=>{"disabled"in this.props&&this.props.disabled&&ne.enableReadOnlyMode(Ma);const Me=ne.model.document,Te=ne.editing.view.document;return Me.on("change:data",Ve=>{this.props.onChange&&this.props.onChange(Ve,ne)}),Te.on("focus",Ve=>{this.props.onFocus&&this.props.onFocus(Ve,ne)}),Te.on("blur",Ve=>{this.props.onBlur&&this.props.onBlur(Ve,ne)}),setTimeout(()=>{this.props.onReady&&this.props.onReady(ne)}),ne})}async _destroyEditor(){this.editorDestructionInProgress=new Promise(I=>{this.watchdog?this.watchdog.destroy().then(()=>{this.watchdog=null,I()}):I()})}_shouldUpdateEditor(I){return this.props.data!==I.data&&this.editor.getData()!==I.data}_getConfig(){return this.props.data&&this.props.config.initialData&&console.warn("Editor data should be provided either using `config.initialData` or `data` properties. The config property is over the data value and the first one will be used when specified both."),{...this.props.config,initialData:this.props.config.initialData||this.props.data||""}}}class Zl{constructor(I){this._contextWatchdog=I,this._id=function(){const B=4294967296*Math.random()>>>0,ne=4294967296*Math.random()>>>0,Me=4294967296*Math.random()>>>0,Te=4294967296*Math.random()>>>0;return"e"+Tn[B>>0&255]+Tn[B>>8&255]+Tn[B>>16&255]+Tn[B>>24&255]+Tn[ne>>0&255]+Tn[ne>>8&255]+Tn[ne>>16&255]+Tn[ne>>24&255]+Tn[Me>>0&255]+Tn[Me>>8&255]+Tn[Me>>16&255]+Tn[Me>>24&255]+Tn[Te>>0&255]+Tn[Te>>8&255]+Tn[Te>>16&255]+Tn[Te>>24&255]}()}setCreator(I){this._creator=I}create(I,B){return this._contextWatchdog.add({sourceElementOrData:I,config:B,creator:this._creator,id:this._id,type:"editor"})}on(I,B){this._contextWatchdog.on("itemError",(ne,{itemId:Me,causesRestart:Te,error:Ve})=>{Me===this._id&&B(null,{error:Ve,causesRestart:Te})})}destroy(){this._contextWatchdog.remove(this._id)}get editor(){return this._contextWatchdog.getItem(this._id)}}Oo.contextType=Tt,Oo.propTypes={editor:C().func.isRequired,data:C().string,config:C().object,onChange:C().func,onReady:C().func,onFocus:C().func,onBlur:C().func,onError:C().func,disabled:C().bool,onInit:(D,I)=>{if(D[I])return new Error('The "onInit" property is not supported anymore by the CKEditor component. Use the "onReady" property instead.')}},Oo.defaultProps={config:{},onError:(D,I)=>console.error(D,I)},Oo._EditorWatchdog=Ns})(),v})())})(_p,_p.exports);var yT=_p.exports,tw={exports:{}};/*!
 * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
 * For licensing, see LICENSE.md.
 */(function(p,f){(function(l){const h=l.en=l.en||{};h.dictionary=Object.assign(h.dictionary||{},{"%0 of %1":"%0 of %1",Aquamarine:"Aquamarine",Black:"Black","Block quote":"Block quote",Blue:"Blue",Bold:"Bold","Break text":"Break text","Bulleted List":"Bulleted List",Cancel:"Cancel","Cannot upload file:":"Cannot upload file:","Centered image":"Centered image","Change image text alternative":"Change image text alternative","Choose heading":"Choose heading",Column:"Column","Could not insert image at the current position.":"Could not insert image at the current position.","Could not obtain resized image URL.":"Could not obtain resized image URL.","Decrease indent":"Decrease indent","Delete column":"Delete column","Delete row":"Delete row","Dim grey":"Dim grey",Downloadable:"Downloadable","Dropdown toolbar":"Dropdown toolbar","Edit block":"Edit block","Edit link":"Edit link","Editor toolbar":"Editor toolbar","Enter image caption":"Enter image caption","Full size image":"Full size image",Green:"Green",Grey:"Grey","Header column":"Header column","Header row":"Header row",Heading:"Heading","Heading 1":"Heading 1","Heading 2":"Heading 2","Heading 3":"Heading 3","Heading 4":"Heading 4","Heading 5":"Heading 5","Heading 6":"Heading 6","Image toolbar":"Image toolbar","image widget":"image widget","In line":"In line","Increase indent":"Increase indent","Insert column left":"Insert column left","Insert column right":"Insert column right","Insert image":"Insert image","Insert image or file":"Insert image or file","Insert media":"Insert media","Insert paragraph after block":"Insert paragraph after block","Insert paragraph before block":"Insert paragraph before block","Insert row above":"Insert row above","Insert row below":"Insert row below","Insert table":"Insert table","Inserting image failed":"Inserting image failed",Italic:"Italic","Left aligned image":"Left aligned image","Light blue":"Light blue","Light green":"Light green","Light grey":"Light grey",Link:"Link","Link URL":"Link URL","Media URL":"Media URL","media widget":"media widget","Merge cell down":"Merge cell down","Merge cell left":"Merge cell left","Merge cell right":"Merge cell right","Merge cell up":"Merge cell up","Merge cells":"Merge cells",Next:"Next","Numbered List":"Numbered List","Open in a new tab":"Open in a new tab","Open link in new tab":"Open link in new tab",Orange:"Orange",Paragraph:"Paragraph","Paste the media URL in the input.":"Paste the media URL in the input.",Previous:"Previous",Purple:"Purple",Red:"Red",Redo:"Redo","Rich Text Editor":"Rich Text Editor","Rich Text Editor, %0":"Rich Text Editor, %0","Right aligned image":"Right aligned image",Row:"Row",Save:"Save","Select all":"Select all","Select column":"Select column","Select row":"Select row","Selecting resized image failed":"Selecting resized image failed","Show more items":"Show more items","Side image":"Side image","Split cell horizontally":"Split cell horizontally","Split cell vertically":"Split cell vertically","Table toolbar":"Table toolbar","Text alternative":"Text alternative","The URL must not be empty.":"The URL must not be empty.","This link has no URL":"This link has no URL","This media URL is not supported.":"This media URL is not supported.","Tip: Paste the URL into the content to embed faster.":"Tip: Paste the URL into the content to embed faster.","Toggle caption off":"Toggle caption off","Toggle caption on":"Toggle caption on",Turquoise:"Turquoise",Undo:"Undo",Unlink:"Unlink","Upload failed":"Upload failed","Upload in progress":"Upload in progress",White:"White","Widget toolbar":"Widget toolbar","Wrap text":"Wrap text",Yellow:"Yellow"})})(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})),function(l,h){p.exports=h()}(window,function(){return function(l){var h={};function w(k){if(h[k])return h[k].exports;var v=h[k]={i:k,l:!1,exports:{}};return l[k].call(v.exports,v,v.exports,w),v.l=!0,v.exports}return w.m=l,w.c=h,w.d=function(k,v,N){w.o(k,v)||Object.defineProperty(k,v,{enumerable:!0,get:N})},w.r=function(k){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(k,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(k,"__esModule",{value:!0})},w.t=function(k,v){if(1&v&&(k=w(k)),8&v||4&v&&typeof k=="object"&&k&&k.__esModule)return k;var N=Object.create(null);if(w.r(N),Object.defineProperty(N,"default",{enumerable:!0,value:k}),2&v&&typeof k!="string")for(var S in k)w.d(N,S,(function(O){return k[O]}).bind(null,S));return N},w.n=function(k){var v=k&&k.__esModule?function(){return k.default}:function(){return k};return w.d(v,"a",v),v},w.o=function(k,v){return Object.prototype.hasOwnProperty.call(k,v)},w.p="",w(w.s=108)}([function(l,h,w){w.d(h,"a",function(){return k}),w.d(h,"b",function(){return v});class k extends Error{constructor(C,L,j){super(`${C}${j?" "+JSON.stringify(j):""}${N(C)}`),this.name="CKEditorError",this.context=L,this.data=j}is(C){return C==="CKEditorError"}static rethrowUnexpectedError(C,L){if(C.is&&C.is("CKEditorError"))throw C;const j=new k(C.message,L);throw j.stack=C.stack,j}}function v(O,C){console.warn(...S(O,C))}function N(O){return`
Read more: https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html#error-`+O}function S(O,C){const L=N(O);return C?[O,C,L]:[O,L]}},function(l,h,w){var k,v=function(){return k===void 0&&(k=!!(window&&document&&document.all&&!window.atob)),k},N=function(){var Y={};return function(oe){if(Y[oe]===void 0){var ie=document.querySelector(oe);if(window.HTMLIFrameElement&&ie instanceof window.HTMLIFrameElement)try{ie=ie.contentDocument.head}catch{ie=null}Y[oe]=ie}return Y[oe]}}(),S=[];function O(Y){for(var oe=-1,ie=0;ie<S.length;ie++)if(S[ie].identifier===Y){oe=ie;break}return oe}function C(Y,oe){for(var ie={},ge=[],de=0;de<Y.length;de++){var je=Y[de],Ie=oe.base?je[0]+oe.base:je[0],Pe=ie[Ie]||0,ce="".concat(Ie," ").concat(Pe);ie[Ie]=Pe+1;var ae=O(ce),be={css:je[1],media:je[2],sourceMap:je[3]};ae!==-1?(S[ae].references++,S[ae].updater(be)):S.push({identifier:ce,updater:Z(be,oe),references:1}),ge.push(ce)}return ge}function L(Y){var oe=document.createElement("style"),ie=Y.attributes||{};if(ie.nonce===void 0){var ge=w.nc;ge&&(ie.nonce=ge)}if(Object.keys(ie).forEach(function(je){oe.setAttribute(je,ie[je])}),typeof Y.insert=="function")Y.insert(oe);else{var de=N(Y.insert||"head");if(!de)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");de.appendChild(oe)}return oe}var j,F=(j=[],function(Y,oe){return j[Y]=oe,j.filter(Boolean).join(`
`)});function q(Y,oe,ie,ge){var de=ie?"":ge.media?"@media ".concat(ge.media," {").concat(ge.css,"}"):ge.css;if(Y.styleSheet)Y.styleSheet.cssText=F(oe,de);else{var je=document.createTextNode(de),Ie=Y.childNodes;Ie[oe]&&Y.removeChild(Ie[oe]),Ie.length?Y.insertBefore(je,Ie[oe]):Y.appendChild(je)}}function K(Y,oe,ie){var ge=ie.css,de=ie.media,je=ie.sourceMap;if(de?Y.setAttribute("media",de):Y.removeAttribute("media"),je&&typeof btoa<"u"&&(ge+=`
/*# sourceMappingURL=data:application/json;base64,`.concat(btoa(unescape(encodeURIComponent(JSON.stringify(je))))," */")),Y.styleSheet)Y.styleSheet.cssText=ge;else{for(;Y.firstChild;)Y.removeChild(Y.firstChild);Y.appendChild(document.createTextNode(ge))}}var te=null,se=0;function Z(Y,oe){var ie,ge,de;if(oe.singleton){var je=se++;ie=te||(te=L(oe)),ge=q.bind(null,ie,je,!1),de=q.bind(null,ie,je,!0)}else ie=L(oe),ge=K.bind(null,ie,oe),de=function(){(function(Ie){if(Ie.parentNode===null)return!1;Ie.parentNode.removeChild(Ie)})(ie)};return ge(Y),function(Ie){if(Ie){if(Ie.css===Y.css&&Ie.media===Y.media&&Ie.sourceMap===Y.sourceMap)return;ge(Y=Ie)}else de()}}l.exports=function(Y,oe){(oe=oe||{}).singleton||typeof oe.singleton=="boolean"||(oe.singleton=v());var ie=C(Y=Y||[],oe);return function(ge){if(ge=ge||[],Object.prototype.toString.call(ge)==="[object Array]"){for(var de=0;de<ie.length;de++){var je=O(ie[de]);S[je].references--}for(var Ie=C(ge,oe),Pe=0;Pe<ie.length;Pe++){var ce=O(ie[Pe]);S[ce].references===0&&(S[ce].updater(),S.splice(ce,1))}ie=Ie}}}},,function(l,h,w){var k=w(8),v=typeof self=="object"&&self&&self.Object===Object&&self,N=k.a||v||Function("return this")();h.a=N},function(l,h,w){(function(k){var v=w(3),N=w(14),S=f&&!f.nodeType&&f,O=S&&typeof k=="object"&&k&&!k.nodeType&&k,C=O&&O.exports===S?v.a.Buffer:void 0,L=(C?C.isBuffer:void 0)||N.a;h.a=L}).call(this,w(10)(l))},function(l,h,w){(function(k){var v=w(8),N=f&&!f.nodeType&&f,S=N&&typeof k=="object"&&k&&!k.nodeType&&k,O=S&&S.exports===N&&v.a.process,C=function(){try{var L=S&&S.require&&S.require("util").types;return L||O&&O.binding&&O.binding("util")}catch{}}();h.a=C}).call(this,w(10)(l))},function(l,h,w){(function(k){var v=w(0);const N=typeof window=="object"?window:k;if(N.CKEDITOR_VERSION)throw new v.a("ckeditor-duplicated-modules",null);N.CKEDITOR_VERSION="29.2.0"}).call(this,w(12))},function(l,h,w){var k=w(1),v=w(76);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var N={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(v,N),l.exports=v.locals||{}},function(l,h,w){(function(k){var v=typeof k=="object"&&k&&k.Object===Object&&k;h.a=v}).call(this,w(12))},function(l,h,w){(function(k){var v=w(3),N=f&&!f.nodeType&&f,S=N&&typeof k=="object"&&k&&!k.nodeType&&k,O=S&&S.exports===N?v.a.Buffer:void 0,C=O?O.allocUnsafe:void 0;h.a=function(L,j){if(j)return L.slice();var F=L.length,q=C?C(F):new L.constructor(F);return L.copy(q),q}}).call(this,w(10)(l))},function(l,h){l.exports=function(w){if(!w.webpackPolyfill){var k=Object.create(w);k.children||(k.children=[]),Object.defineProperty(k,"loaded",{enumerable:!0,get:function(){return k.l}}),Object.defineProperty(k,"id",{enumerable:!0,get:function(){return k.i}}),Object.defineProperty(k,"exports",{enumerable:!0}),k.webpackPolyfill=1}return k}},function(l,h,w){var k=w(1),v=w(77);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var N={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(v,N),l.exports=v.locals||{}},function(l,h){var w;w=function(){return this}();try{w=w||new Function("return this")()}catch{typeof window=="object"&&(w=window)}l.exports=w},function(l,h,w){var k=w(1),v=w(71);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var N={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(v,N),l.exports=v.locals||{}},function(l,h,w){h.a=function(){return!1}},function(l,h,w){var k=w(1),v=w(16);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var N={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(v,N),l.exports=v.locals||{}},function(l,h){l.exports=".ck-hidden{display:none!important}.ck.ck-reset,.ck.ck-reset_all,.ck.ck-reset_all *{box-sizing:border-box;width:auto;height:auto;position:static}:root{--ck-z-default:1;--ck-z-modal:calc(var(--ck-z-default) + 999)}.ck-transitions-disabled,.ck-transitions-disabled *{transition:none!important}:root{--ck-color-base-foreground:#fafafa;--ck-color-base-background:#fff;--ck-color-base-border:#c4c4c4;--ck-color-base-action:#61b045;--ck-color-base-focus:#6cb5f9;--ck-color-base-text:#333;--ck-color-base-active:#198cf0;--ck-color-base-active-focus:#0e7fe1;--ck-color-base-error:#db3700;--ck-color-focus-border-coordinates:208,79%,51%;--ck-color-focus-border:hsl(var(--ck-color-focus-border-coordinates));--ck-color-focus-outer-shadow:#bcdefb;--ck-color-focus-disabled-shadow:rgba(119,186,248,0.3);--ck-color-focus-error-shadow:rgba(255,64,31,0.3);--ck-color-text:var(--ck-color-base-text);--ck-color-shadow-drop:rgba(0,0,0,0.15);--ck-color-shadow-drop-active:rgba(0,0,0,0.2);--ck-color-shadow-inner:rgba(0,0,0,0.1);--ck-color-button-default-background:transparent;--ck-color-button-default-hover-background:#e6e6e6;--ck-color-button-default-active-background:#d9d9d9;--ck-color-button-default-active-shadow:#bfbfbf;--ck-color-button-default-disabled-background:transparent;--ck-color-button-on-background:#dedede;--ck-color-button-on-hover-background:#c4c4c4;--ck-color-button-on-active-background:#bababa;--ck-color-button-on-active-shadow:#a1a1a1;--ck-color-button-on-disabled-background:#dedede;--ck-color-button-action-background:var(--ck-color-base-action);--ck-color-button-action-hover-background:#579e3d;--ck-color-button-action-active-background:#53973b;--ck-color-button-action-active-shadow:#498433;--ck-color-button-action-disabled-background:#7ec365;--ck-color-button-action-text:var(--ck-color-base-background);--ck-color-button-save:#008a00;--ck-color-button-cancel:#db3700;--ck-color-switch-button-off-background:#b0b0b0;--ck-color-switch-button-off-hover-background:#a3a3a3;--ck-color-switch-button-on-background:var(--ck-color-button-action-background);--ck-color-switch-button-on-hover-background:#579e3d;--ck-color-switch-button-inner-background:var(--ck-color-base-background);--ck-color-switch-button-inner-shadow:rgba(0,0,0,0.1);--ck-color-dropdown-panel-background:var(--ck-color-base-background);--ck-color-dropdown-panel-border:var(--ck-color-base-border);--ck-color-input-background:var(--ck-color-base-background);--ck-color-input-border:#c7c7c7;--ck-color-input-error-border:var(--ck-color-base-error);--ck-color-input-text:var(--ck-color-base-text);--ck-color-input-disabled-background:#f2f2f2;--ck-color-input-disabled-border:#c7c7c7;--ck-color-input-disabled-text:#757575;--ck-color-list-background:var(--ck-color-base-background);--ck-color-list-button-hover-background:var(--ck-color-button-default-hover-background);--ck-color-list-button-on-background:var(--ck-color-base-active);--ck-color-list-button-on-background-focus:var(--ck-color-base-active-focus);--ck-color-list-button-on-text:var(--ck-color-base-background);--ck-color-panel-background:var(--ck-color-base-background);--ck-color-panel-border:var(--ck-color-base-border);--ck-color-toolbar-background:var(--ck-color-base-foreground);--ck-color-toolbar-border:var(--ck-color-base-border);--ck-color-tooltip-background:var(--ck-color-base-text);--ck-color-tooltip-text:var(--ck-color-base-background);--ck-color-engine-placeholder-text:#707070;--ck-color-upload-bar-background:#6cb5f9;--ck-color-link-default:#0000f0;--ck-color-link-selected-background:rgba(31,177,255,0.1);--ck-color-link-fake-selection:rgba(31,177,255,0.3);--ck-disabled-opacity:.5;--ck-focus-outer-shadow-geometry:0 0 0 3px;--ck-focus-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-outer-shadow);--ck-focus-disabled-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-disabled-shadow);--ck-focus-error-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-error-shadow);--ck-focus-ring:1px solid var(--ck-color-focus-border);--ck-font-size-base:13px;--ck-line-height-base:1.84615;--ck-font-face:Helvetica,Arial,Tahoma,Verdana,Sans-Serif;--ck-font-size-tiny:0.7em;--ck-font-size-small:0.75em;--ck-font-size-normal:1em;--ck-font-size-big:1.4em;--ck-font-size-large:1.8em;--ck-ui-component-min-height:2.3em}.ck.ck-reset,.ck.ck-reset_all,.ck.ck-reset_all *{margin:0;padding:0;border:0;background:transparent;text-decoration:none;vertical-align:middle;transition:none;word-wrap:break-word}.ck.ck-reset_all,.ck.ck-reset_all *{border-collapse:collapse;font:normal normal normal var(--ck-font-size-base)/var(--ck-line-height-base) var(--ck-font-face);color:var(--ck-color-text);text-align:left;white-space:nowrap;cursor:auto;float:none}.ck.ck-reset_all .ck-rtl *{text-align:right}.ck.ck-reset_all iframe{vertical-align:inherit}.ck.ck-reset_all textarea{white-space:pre-wrap}.ck.ck-reset_all input[type=password],.ck.ck-reset_all input[type=text],.ck.ck-reset_all textarea{cursor:text}.ck.ck-reset_all input[type=password][disabled],.ck.ck-reset_all input[type=text][disabled],.ck.ck-reset_all textarea[disabled]{cursor:default}.ck.ck-reset_all fieldset{padding:10px;border:2px groove #dfdee3}.ck.ck-reset_all button::-moz-focus-inner{padding:0;border:0}.ck[dir=rtl],.ck[dir=rtl] .ck{text-align:right}:root{--ck-border-radius:2px;--ck-inner-shadow:2px 2px 3px var(--ck-color-shadow-inner) inset;--ck-drop-shadow:0 1px 2px 1px var(--ck-color-shadow-drop);--ck-drop-shadow-active:0 3px 6px 1px var(--ck-color-shadow-drop-active);--ck-spacing-unit:0.6em;--ck-spacing-large:calc(var(--ck-spacing-unit)*1.5);--ck-spacing-standard:var(--ck-spacing-unit);--ck-spacing-medium:calc(var(--ck-spacing-unit)*0.8);--ck-spacing-small:calc(var(--ck-spacing-unit)*0.5);--ck-spacing-tiny:calc(var(--ck-spacing-unit)*0.3);--ck-spacing-extra-tiny:calc(var(--ck-spacing-unit)*0.16)}"},function(l,h,w){var k=w(1),v=w(18);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var N={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(v,N),l.exports=v.locals||{}},function(l,h){l.exports=".ck.ck-icon{vertical-align:middle}:root{--ck-icon-size:calc(var(--ck-line-height-base)*var(--ck-font-size-normal))}.ck.ck-icon{width:var(--ck-icon-size);height:var(--ck-icon-size);font-size:.8333350694em;will-change:transform}.ck.ck-icon,.ck.ck-icon *{color:inherit;cursor:inherit}.ck.ck-icon :not([fill]){fill:currentColor}"},function(l,h,w){var k=w(1),v=w(20);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var N={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(v,N),l.exports=v.locals||{}},function(l,h){l.exports='.ck.ck-tooltip,.ck.ck-tooltip .ck-tooltip__text:after{position:absolute;pointer-events:none;-webkit-backface-visibility:hidden}.ck.ck-tooltip{visibility:hidden;opacity:0;display:none;z-index:var(--ck-z-modal)}.ck.ck-tooltip .ck-tooltip__text{display:inline-block}.ck.ck-tooltip .ck-tooltip__text:after{content:"";width:0;height:0}:root{--ck-tooltip-arrow-size:5px}.ck.ck-tooltip{left:50%;top:0;transition:opacity .2s ease-in-out .2s}.ck.ck-tooltip .ck-tooltip__text{border-radius:0}.ck-rounded-corners .ck.ck-tooltip .ck-tooltip__text,.ck.ck-tooltip .ck-tooltip__text.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-tooltip .ck-tooltip__text{font-size:.9em;line-height:1.5;color:var(--ck-color-tooltip-text);padding:var(--ck-spacing-small) var(--ck-spacing-medium);background:var(--ck-color-tooltip-background);position:relative;left:-50%}.ck.ck-tooltip .ck-tooltip__text:after{transition:opacity .2s ease-in-out .2s;border-style:solid;left:50%}.ck.ck-tooltip.ck-tooltip_s,.ck.ck-tooltip.ck-tooltip_se,.ck.ck-tooltip.ck-tooltip_sw{bottom:calc(var(--ck-tooltip-arrow-size)*-1);transform:translateY(100%)}.ck.ck-tooltip.ck-tooltip_s .ck-tooltip__text:after,.ck.ck-tooltip.ck-tooltip_se .ck-tooltip__text:after,.ck.ck-tooltip.ck-tooltip_sw .ck-tooltip__text:after{top:calc(var(--ck-tooltip-arrow-size)*-1 + 1px);transform:translateX(-50%);border-left-color:transparent;border-bottom-color:var(--ck-color-tooltip-background);border-right-color:transparent;border-top-color:transparent;border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:var(--ck-tooltip-arrow-size);border-right-width:var(--ck-tooltip-arrow-size);border-top-width:0}.ck.ck-tooltip.ck-tooltip_sw{right:50%;left:auto}.ck.ck-tooltip.ck-tooltip_sw .ck-tooltip__text{left:auto;right:calc(var(--ck-tooltip-arrow-size)*-2)}.ck.ck-tooltip.ck-tooltip_sw .ck-tooltip__text:after{left:auto;right:0}.ck.ck-tooltip.ck-tooltip_se{left:50%;right:auto}.ck.ck-tooltip.ck-tooltip_se .ck-tooltip__text{right:auto;left:calc(var(--ck-tooltip-arrow-size)*-2)}.ck.ck-tooltip.ck-tooltip_se .ck-tooltip__text:after{right:auto;left:0;transform:translateX(50%)}.ck.ck-tooltip.ck-tooltip_n{top:calc(var(--ck-tooltip-arrow-size)*-1);transform:translateY(-100%)}.ck.ck-tooltip.ck-tooltip_n .ck-tooltip__text:after{bottom:calc(var(--ck-tooltip-arrow-size)*-1);transform:translateX(-50%);border-left-color:transparent;border-bottom-color:transparent;border-right-color:transparent;border-top-color:var(--ck-color-tooltip-background);border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:0;border-right-width:var(--ck-tooltip-arrow-size);border-top-width:var(--ck-tooltip-arrow-size)}.ck.ck-tooltip.ck-tooltip_e{left:calc(100% + var(--ck-tooltip-arrow-size));top:50%}.ck.ck-tooltip.ck-tooltip_e .ck-tooltip__text{left:0;transform:translateY(-50%)}.ck.ck-tooltip.ck-tooltip_e .ck-tooltip__text:after{left:calc(var(--ck-tooltip-arrow-size)*-1);top:calc(50% - var(--ck-tooltip-arrow-size)*1);border-left-color:transparent;border-bottom-color:transparent;border-right-color:var(--ck-color-tooltip-background);border-top-color:transparent;border-left-width:0;border-bottom-width:var(--ck-tooltip-arrow-size);border-right-width:var(--ck-tooltip-arrow-size);border-top-width:var(--ck-tooltip-arrow-size)}.ck.ck-tooltip.ck-tooltip_w{right:calc(100% + var(--ck-tooltip-arrow-size));left:auto;top:50%}.ck.ck-tooltip.ck-tooltip_w .ck-tooltip__text{left:0;transform:translateY(-50%)}.ck.ck-tooltip.ck-tooltip_w .ck-tooltip__text:after{left:100%;top:calc(50% - var(--ck-tooltip-arrow-size)*1);border-left-color:var(--ck-color-tooltip-background);border-bottom-color:transparent;border-right-color:transparent;border-top-color:transparent;border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:var(--ck-tooltip-arrow-size);border-right-width:0;border-top-width:var(--ck-tooltip-arrow-size)}'},function(l,h,w){var k=w(1),v=w(22);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var N={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(v,N),l.exports=v.locals||{}},function(l,h){l.exports=".ck.ck-button,a.ck.ck-button{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ck.ck-button .ck-tooltip,a.ck.ck-button .ck-tooltip{display:block}@media (hover:none){.ck.ck-button .ck-tooltip,a.ck.ck-button .ck-tooltip{display:none}}.ck.ck-button,a.ck.ck-button{position:relative;display:inline-flex;align-items:center;justify-content:left}.ck.ck-button .ck-button__label,a.ck.ck-button .ck-button__label{display:none}.ck.ck-button.ck-button_with-text .ck-button__label,a.ck.ck-button.ck-button_with-text .ck-button__label{display:inline-block}.ck.ck-button:not(.ck-button_with-text),a.ck.ck-button:not(.ck-button_with-text){justify-content:center}.ck.ck-button:hover .ck-tooltip,a.ck.ck-button:hover .ck-tooltip{visibility:visible;opacity:1}.ck.ck-button:focus:not(:hover) .ck-tooltip,a.ck.ck-button:focus:not(:hover) .ck-tooltip{display:none}.ck.ck-button,a.ck.ck-button{background:var(--ck-color-button-default-background)}.ck.ck-button:not(.ck-disabled):hover,a.ck.ck-button:not(.ck-disabled):hover{background:var(--ck-color-button-default-hover-background)}.ck.ck-button:not(.ck-disabled):active,a.ck.ck-button:not(.ck-disabled):active{background:var(--ck-color-button-default-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-default-active-shadow)}.ck.ck-button.ck-disabled,a.ck.ck-button.ck-disabled{background:var(--ck-color-button-default-disabled-background)}.ck.ck-button,a.ck.ck-button{border-radius:0}.ck-rounded-corners .ck.ck-button,.ck-rounded-corners a.ck.ck-button,.ck.ck-button.ck-rounded-corners,a.ck.ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-button,a.ck.ck-button{white-space:nowrap;cursor:default;vertical-align:middle;padding:var(--ck-spacing-tiny);text-align:center;min-width:var(--ck-ui-component-min-height);min-height:var(--ck-ui-component-min-height);line-height:1;font-size:inherit;border:1px solid transparent;transition:box-shadow .2s ease-in-out,border .2s ease-in-out;-webkit-appearance:none}.ck.ck-button:active,.ck.ck-button:focus,a.ck.ck-button:active,a.ck.ck-button:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0}.ck.ck-button .ck-button__icon use,.ck.ck-button .ck-button__icon use *,a.ck.ck-button .ck-button__icon use,a.ck.ck-button .ck-button__icon use *{color:inherit}.ck.ck-button .ck-button__label,a.ck.ck-button .ck-button__label{font-size:inherit;font-weight:inherit;color:inherit;cursor:inherit;vertical-align:middle}[dir=ltr] .ck.ck-button .ck-button__label,[dir=ltr] a.ck.ck-button .ck-button__label{text-align:left}[dir=rtl] .ck.ck-button .ck-button__label,[dir=rtl] a.ck.ck-button .ck-button__label{text-align:right}.ck.ck-button .ck-button__keystroke,a.ck.ck-button .ck-button__keystroke{color:inherit}[dir=ltr] .ck.ck-button .ck-button__keystroke,[dir=ltr] a.ck.ck-button .ck-button__keystroke{margin-left:var(--ck-spacing-large)}[dir=rtl] .ck.ck-button .ck-button__keystroke,[dir=rtl] a.ck.ck-button .ck-button__keystroke{margin-right:var(--ck-spacing-large)}.ck.ck-button .ck-button__keystroke,a.ck.ck-button .ck-button__keystroke{font-weight:700;opacity:.7}.ck.ck-button.ck-disabled:active,.ck.ck-button.ck-disabled:focus,a.ck.ck-button.ck-disabled:active,a.ck.ck-button.ck-disabled:focus{box-shadow:var(--ck-focus-disabled-outer-shadow),0 0}.ck.ck-button.ck-disabled .ck-button__icon,a.ck.ck-button.ck-disabled .ck-button__icon{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-disabled .ck-button__label,a.ck.ck-button.ck-disabled .ck-button__label{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-disabled .ck-button__keystroke,a.ck.ck-button.ck-disabled .ck-button__keystroke{opacity:.3}.ck.ck-button.ck-button_with-text,a.ck.ck-button.ck-button_with-text{padding:var(--ck-spacing-tiny) var(--ck-spacing-standard)}[dir=ltr] .ck.ck-button.ck-button_with-text .ck-button__icon,[dir=ltr] a.ck.ck-button.ck-button_with-text .ck-button__icon{margin-left:calc(var(--ck-spacing-small)*-1);margin-right:var(--ck-spacing-small)}[dir=rtl] .ck.ck-button.ck-button_with-text .ck-button__icon,[dir=rtl] a.ck.ck-button.ck-button_with-text .ck-button__icon{margin-right:calc(var(--ck-spacing-small)*-1);margin-left:var(--ck-spacing-small)}.ck.ck-button.ck-button_with-keystroke .ck-button__label,a.ck.ck-button.ck-button_with-keystroke .ck-button__label{flex-grow:1}.ck.ck-button.ck-on,a.ck.ck-button.ck-on{background:var(--ck-color-button-on-background)}.ck.ck-button.ck-on:not(.ck-disabled):hover,a.ck.ck-button.ck-on:not(.ck-disabled):hover{background:var(--ck-color-button-on-hover-background)}.ck.ck-button.ck-on:not(.ck-disabled):active,a.ck.ck-button.ck-on:not(.ck-disabled):active{background:var(--ck-color-button-on-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-on-active-shadow)}.ck.ck-button.ck-on.ck-disabled,a.ck.ck-button.ck-on.ck-disabled{background:var(--ck-color-button-on-disabled-background)}.ck.ck-button.ck-button-save,a.ck.ck-button.ck-button-save{color:var(--ck-color-button-save)}.ck.ck-button.ck-button-cancel,a.ck.ck-button.ck-button-cancel{color:var(--ck-color-button-cancel)}.ck.ck-button-action,a.ck.ck-button-action{background:var(--ck-color-button-action-background)}.ck.ck-button-action:not(.ck-disabled):hover,a.ck.ck-button-action:not(.ck-disabled):hover{background:var(--ck-color-button-action-hover-background)}.ck.ck-button-action:not(.ck-disabled):active,a.ck.ck-button-action:not(.ck-disabled):active{background:var(--ck-color-button-action-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-action-active-shadow)}.ck.ck-button-action.ck-disabled,a.ck.ck-button-action.ck-disabled{background:var(--ck-color-button-action-disabled-background)}.ck.ck-button-action,a.ck.ck-button-action{color:var(--ck-color-button-action-text)}.ck.ck-button-bold,a.ck.ck-button-bold{font-weight:700}"},function(l,h,w){var k=w(1),v=w(24);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var N={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(v,N),l.exports=v.locals||{}},function(l,h){l.exports=".ck.ck-button.ck-switchbutton .ck-button__toggle,.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{display:block}:root{--ck-switch-button-toggle-width:2.6153846154em;--ck-switch-button-toggle-inner-size:1.0769230769em;--ck-switch-button-toggle-spacing:1px;--ck-switch-button-translation:calc(var(--ck-switch-button-toggle-width) - var(--ck-switch-button-toggle-inner-size) - var(--ck-switch-button-toggle-spacing)*2)}[dir=ltr] .ck.ck-button.ck-switchbutton .ck-button__label{margin-right:calc(var(--ck-spacing-large)*2)}[dir=rtl] .ck.ck-button.ck-switchbutton .ck-button__label{margin-left:calc(var(--ck-spacing-large)*2)}.ck.ck-button.ck-switchbutton .ck-button__toggle{border-radius:0}.ck-rounded-corners .ck.ck-button.ck-switchbutton .ck-button__toggle,.ck.ck-button.ck-switchbutton .ck-button__toggle.ck-rounded-corners{border-radius:var(--ck-border-radius)}[dir=ltr] .ck.ck-button.ck-switchbutton .ck-button__toggle{margin-left:auto}[dir=rtl] .ck.ck-button.ck-switchbutton .ck-button__toggle{margin-right:auto}.ck.ck-button.ck-switchbutton .ck-button__toggle{transition:background .4s ease;width:var(--ck-switch-button-toggle-width);background:var(--ck-color-switch-button-off-background)}.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{border-radius:0}.ck-rounded-corners .ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner,.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner.ck-rounded-corners{border-radius:var(--ck-border-radius);border-radius:calc(var(--ck-border-radius)*0.5)}.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{margin:var(--ck-switch-button-toggle-spacing);width:var(--ck-switch-button-toggle-inner-size);height:var(--ck-switch-button-toggle-inner-size);background:var(--ck-color-switch-button-inner-background);transition:all .3s ease}.ck.ck-button.ck-switchbutton .ck-button__toggle:hover{background:var(--ck-color-switch-button-off-hover-background)}.ck.ck-button.ck-switchbutton .ck-button__toggle:hover .ck-button__toggle__inner{box-shadow:0 0 0 5px var(--ck-color-switch-button-inner-shadow)}.ck.ck-button.ck-switchbutton.ck-disabled .ck-button__toggle{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle{background:var(--ck-color-switch-button-on-background)}.ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle:hover{background:var(--ck-color-switch-button-on-hover-background)}[dir=ltr] .ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle .ck-button__toggle__inner{transform:translateX(var(--ck-switch-button-translation))}[dir=rtl] .ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle .ck-button__toggle__inner{transform:translateX(calc(var(--ck-switch-button-translation)*-1))}"},function(l,h,w){var k=w(1),v=w(26);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var N={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(v,N),l.exports=v.locals||{}},function(l,h){l.exports=".ck.ck-color-grid{display:grid}:root{--ck-color-grid-tile-size:24px;--ck-color-color-grid-check-icon:#000}.ck.ck-color-grid{grid-gap:5px;padding:8px}.ck.ck-color-grid__tile{width:var(--ck-color-grid-tile-size);height:var(--ck-color-grid-tile-size);min-width:var(--ck-color-grid-tile-size);min-height:var(--ck-color-grid-tile-size);padding:0;transition:box-shadow .2s ease;border:0}.ck.ck-color-grid__tile.ck-disabled{cursor:unset;transition:unset}.ck.ck-color-grid__tile.ck-color-table__color-tile_bordered{box-shadow:0 0 0 1px var(--ck-color-base-border)}.ck.ck-color-grid__tile .ck.ck-icon{display:none;color:var(--ck-color-color-grid-check-icon)}.ck.ck-color-grid__tile.ck-on{box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-base-text)}.ck.ck-color-grid__tile.ck-on .ck.ck-icon{display:block}.ck.ck-color-grid__tile.ck-on,.ck.ck-color-grid__tile:focus:not(.ck-disabled),.ck.ck-color-grid__tile:hover:not(.ck-disabled){border:0}.ck.ck-color-grid__tile:focus:not(.ck-disabled),.ck.ck-color-grid__tile:hover:not(.ck-disabled){box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-focus-border)}.ck.ck-color-grid__label{padding:0 var(--ck-spacing-standard)}"},function(l,h,w){var k=w(1),v=w(28);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var N={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(v,N),l.exports=v.locals||{}},function(l,h){l.exports='.ck.ck-splitbutton{font-size:inherit}.ck.ck-splitbutton .ck-splitbutton__action:focus{z-index:calc(var(--ck-z-default) + 1)}.ck.ck-splitbutton.ck-splitbutton_open>.ck-button .ck-tooltip{display:none}:root{--ck-color-split-button-hover-background:#ebebeb;--ck-color-split-button-hover-border:#b3b3b3}[dir=ltr] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__action,[dir=ltr] .ck.ck-splitbutton:hover>.ck-splitbutton__action{border-top-right-radius:unset;border-bottom-right-radius:unset}[dir=rtl] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__action,[dir=rtl] .ck.ck-splitbutton:hover>.ck-splitbutton__action{border-top-left-radius:unset;border-bottom-left-radius:unset}.ck.ck-splitbutton>.ck-splitbutton__arrow{min-width:unset}[dir=ltr] .ck.ck-splitbutton>.ck-splitbutton__arrow{border-top-left-radius:unset;border-bottom-left-radius:unset}[dir=rtl] .ck.ck-splitbutton>.ck-splitbutton__arrow{border-top-right-radius:unset;border-bottom-right-radius:unset}.ck.ck-splitbutton>.ck-splitbutton__arrow svg{width:var(--ck-dropdown-arrow-size)}.ck.ck-splitbutton.ck-splitbutton_open>.ck-button:not(.ck-on):not(.ck-disabled):not(:hover),.ck.ck-splitbutton:hover>.ck-button:not(.ck-on):not(.ck-disabled):not(:hover){background:var(--ck-color-split-button-hover-background)}.ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,.ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled):after{content:"";position:absolute;width:1px;height:100%;background-color:var(--ck-color-split-button-hover-border)}[dir=ltr] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,[dir=ltr] .ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled):after{left:-1px}[dir=rtl] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,[dir=rtl] .ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled):after{right:-1px}.ck.ck-splitbutton.ck-splitbutton_open{border-radius:0}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__action,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners>.ck-splitbutton__action{border-bottom-left-radius:0}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners>.ck-splitbutton__arrow{border-bottom-right-radius:0}'},function(l,h,w){var k=w(1),v=w(30);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var N={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(v,N),l.exports=v.locals||{}},function(l,h){l.exports=":root{--ck-dropdown-max-width:75vw}.ck.ck-dropdown{display:inline-block;position:relative}.ck.ck-dropdown .ck-dropdown__arrow{pointer-events:none;z-index:var(--ck-z-default)}.ck.ck-dropdown .ck-button.ck-dropdown__button{width:100%}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on .ck-tooltip{display:none}.ck.ck-dropdown .ck-dropdown__panel{-webkit-backface-visibility:hidden;display:none;z-index:var(--ck-z-modal);max-width:var(--ck-dropdown-max-width);position:absolute}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel-visible{display:inline-block}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_n,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_ne,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nmw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw{bottom:100%}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_s,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_se,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_smw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sw{top:100%;bottom:auto}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_ne,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_se{left:0}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sw{right:0}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_n,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_s{left:50%;transform:translateX(-50%)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nmw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_smw{left:75%;transform:translateX(-75%)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sme{left:25%;transform:translateX(-25%)}.ck.ck-toolbar .ck-dropdown__panel{z-index:calc(var(--ck-z-modal) + 1)}:root{--ck-dropdown-arrow-size:calc(var(--ck-icon-size)*0.5)}.ck.ck-dropdown{font-size:inherit}.ck.ck-dropdown .ck-dropdown__arrow{width:var(--ck-dropdown-arrow-size)}[dir=ltr] .ck.ck-dropdown .ck-dropdown__arrow{right:var(--ck-spacing-standard);margin-left:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-dropdown .ck-dropdown__arrow{left:var(--ck-spacing-standard);margin-right:var(--ck-spacing-small)}.ck.ck-dropdown.ck-disabled .ck-dropdown__arrow{opacity:var(--ck-disabled-opacity)}[dir=ltr] .ck.ck-dropdown .ck-button.ck-dropdown__button:not(.ck-button_with-text){padding-left:var(--ck-spacing-small)}[dir=rtl] .ck.ck-dropdown .ck-button.ck-dropdown__button:not(.ck-button_with-text){padding-right:var(--ck-spacing-small)}.ck.ck-dropdown .ck-button.ck-dropdown__button .ck-button__label{width:7em;overflow:hidden;text-overflow:ellipsis}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-disabled .ck-button__label{opacity:var(--ck-disabled-opacity)}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on{border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-dropdown__button_label-width_auto .ck-button__label{width:auto}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-off:active,.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on:active{box-shadow:none}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-off:active:focus,.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on:active:focus{box-shadow:var(--ck-focus-outer-shadow),0 0}.ck.ck-dropdown__panel{border-radius:0}.ck-rounded-corners .ck.ck-dropdown__panel,.ck.ck-dropdown__panel.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-dropdown__panel{box-shadow:var(--ck-drop-shadow),0 0;background:var(--ck-color-dropdown-panel-background);border:1px solid var(--ck-color-dropdown-panel-border);bottom:0;min-width:100%}.ck.ck-dropdown__panel.ck-dropdown__panel_se{border-top-left-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_sw{border-top-right-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_ne{border-bottom-left-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_nw{border-bottom-right-radius:0}"},function(l,h,w){var k=w(1),v=w(32);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var N={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(v,N),l.exports=v.locals||{}},function(l,h){l.exports=".ck.ck-toolbar{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-flow:row nowrap;align-items:center}.ck.ck-toolbar>.ck-toolbar__items{display:flex;flex-flow:row wrap;align-items:center;flex-grow:1}.ck.ck-toolbar .ck.ck-toolbar__separator{display:inline-block}.ck.ck-toolbar .ck.ck-toolbar__separator:first-child,.ck.ck-toolbar .ck.ck-toolbar__separator:last-child{display:none}.ck.ck-toolbar .ck-toolbar__line-break{flex-basis:100%}.ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items{flex-wrap:nowrap}.ck.ck-toolbar.ck-toolbar_vertical>.ck-toolbar__items{flex-direction:column}.ck.ck-toolbar.ck-toolbar_floating>.ck-toolbar__items{flex-wrap:nowrap}.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown>.ck-dropdown__button .ck-dropdown__arrow{display:none}.ck.ck-toolbar{border-radius:0}.ck-rounded-corners .ck.ck-toolbar,.ck.ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-toolbar{background:var(--ck-color-toolbar-background);padding:0 var(--ck-spacing-small);border:1px solid var(--ck-color-toolbar-border)}.ck.ck-toolbar .ck.ck-toolbar__separator{align-self:stretch;width:1px;min-width:1px;background:var(--ck-color-toolbar-border);margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small)}.ck.ck-toolbar .ck-toolbar__line-break{height:0}.ck.ck-toolbar>.ck-toolbar__items>:not(.ck-toolbar__line-break){margin-right:var(--ck-spacing-small)}.ck.ck-toolbar>.ck-toolbar__items:empty+.ck.ck-toolbar__separator{display:none}.ck.ck-toolbar>.ck-toolbar__items>:not(.ck-toolbar__line-break),.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown{margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small)}.ck.ck-toolbar.ck-toolbar_vertical{padding:0}.ck.ck-toolbar.ck-toolbar_vertical>.ck-toolbar__items>.ck{width:100%;margin:0;border-radius:0;border:0}.ck.ck-toolbar.ck-toolbar_compact{padding:0}.ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>*{margin:0}.ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>:not(:first-child):not(:last-child){border-radius:0}.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown>.ck.ck-button.ck-dropdown__button{padding-left:var(--ck-spacing-tiny)}.ck-toolbar-container .ck.ck-toolbar{border:0}.ck.ck-toolbar[dir=rtl]>.ck-toolbar__items>.ck,[dir=rtl] .ck.ck-toolbar>.ck-toolbar__items>.ck{margin-right:0}.ck.ck-toolbar[dir=rtl]:not(.ck-toolbar_compact)>.ck-toolbar__items>.ck,[dir=rtl] .ck.ck-toolbar:not(.ck-toolbar_compact)>.ck-toolbar__items>.ck{margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=rtl]>.ck-toolbar__items>.ck:last-child,[dir=rtl] .ck.ck-toolbar>.ck-toolbar__items>.ck:last-child{margin-left:0}.ck.ck-toolbar[dir=rtl].ck-toolbar_compact>.ck-toolbar__items>.ck:first-child,[dir=rtl] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:first-child{border-top-left-radius:0;border-bottom-left-radius:0}.ck.ck-toolbar[dir=rtl].ck-toolbar_compact>.ck-toolbar__items>.ck:last-child,[dir=rtl] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:last-child{border-top-right-radius:0;border-bottom-right-radius:0}.ck.ck-toolbar[dir=rtl]>.ck.ck-toolbar__separator,[dir=rtl] .ck.ck-toolbar>.ck.ck-toolbar__separator{margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=rtl].ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child),[dir=rtl] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child){margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=ltr]>.ck-toolbar__items>.ck:last-child,[dir=ltr] .ck.ck-toolbar>.ck-toolbar__items>.ck:last-child{margin-right:0}.ck.ck-toolbar[dir=ltr].ck-toolbar_compact>.ck-toolbar__items>.ck:first-child,[dir=ltr] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.ck.ck-toolbar[dir=ltr].ck-toolbar_compact>.ck-toolbar__items>.ck:last-child,[dir=ltr] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:last-child{border-top-left-radius:0;border-bottom-left-radius:0}.ck.ck-toolbar[dir=ltr]>.ck.ck-toolbar__separator,[dir=ltr] .ck.ck-toolbar>.ck.ck-toolbar__separator{margin-right:var(--ck-spacing-small)}.ck.ck-toolbar[dir=ltr].ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child),[dir=ltr] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child){margin-right:var(--ck-spacing-small)}"},function(l,h,w){var k=w(1),v=w(34);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var N={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(v,N),l.exports=v.locals||{}},function(l,h){l.exports=".ck.ck-list{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-direction:column}.ck.ck-list .ck-list__item,.ck.ck-list .ck-list__separator{display:block}.ck.ck-list .ck-list__item>:focus{position:relative;z-index:var(--ck-z-default)}.ck.ck-list{border-radius:0}.ck-rounded-corners .ck.ck-list,.ck.ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-list{list-style-type:none;background:var(--ck-color-list-background)}.ck.ck-list__item{cursor:default;min-width:12em}.ck.ck-list__item .ck-button{min-height:unset;width:100%;text-align:left;border-radius:0;padding:calc(var(--ck-line-height-base)*0.2*var(--ck-font-size-base)) calc(var(--ck-line-height-base)*0.4*var(--ck-font-size-base))}.ck.ck-list__item .ck-button .ck-button__label{line-height:calc(var(--ck-line-height-base)*1.2*var(--ck-font-size-base))}.ck.ck-list__item .ck-button:active{box-shadow:none}.ck.ck-list__item .ck-button.ck-on{background:var(--ck-color-list-button-on-background);color:var(--ck-color-list-button-on-text)}.ck.ck-list__item .ck-button.ck-on:active{box-shadow:none}.ck.ck-list__item .ck-button.ck-on:hover:not(.ck-disabled){background:var(--ck-color-list-button-on-background-focus)}.ck.ck-list__item .ck-button.ck-on:focus:not(.ck-disabled){border-color:var(--ck-color-base-background)}.ck.ck-list__item .ck-button:hover:not(.ck-disabled){background:var(--ck-color-list-button-hover-background)}.ck.ck-list__item .ck-switchbutton.ck-on{background:var(--ck-color-list-background);color:inherit}.ck.ck-list__item .ck-switchbutton.ck-on:hover:not(.ck-disabled){background:var(--ck-color-list-button-hover-background);color:inherit}.ck.ck-list__separator{height:1px;width:100%;background:var(--ck-color-base-border)}"},function(l,h,w){var k=w(1),v=w(36);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var N={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(v,N),l.exports=v.locals||{}},function(l,h){l.exports=":root{--ck-toolbar-dropdown-max-width:60vw}.ck.ck-toolbar-dropdown>.ck-dropdown__panel{width:max-content;max-width:var(--ck-toolbar-dropdown-max-width)}.ck.ck-toolbar-dropdown>.ck-dropdown__panel .ck-button:focus{z-index:calc(var(--ck-z-default) + 1)}.ck.ck-toolbar-dropdown .ck-toolbar{border:0}"},function(l,h,w){var k=w(1),v=w(38);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var N={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(v,N),l.exports=v.locals||{}},function(l,h){l.exports=".ck.ck-dropdown .ck-dropdown__panel .ck-list{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list,.ck.ck-dropdown .ck-dropdown__panel .ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0}.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button,.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button,.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}"},function(l,h,w){var k=w(1),v=w(40);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var N={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(v,N),l.exports=v.locals||{}},function(l,h){l.exports=":root{--ck-color-editable-blur-selection:#d9d9d9}.ck.ck-editor__editable:not(.ck-editor__nested-editable){border-radius:0}.ck-rounded-corners .ck.ck-editor__editable:not(.ck-editor__nested-editable),.ck.ck-editor__editable:not(.ck-editor__nested-editable).ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-editor__editable:not(.ck-editor__nested-editable).ck-focused{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-inner-shadow),0 0}.ck.ck-editor__editable_inline{overflow:auto;padding:0 var(--ck-spacing-standard);border:1px solid transparent}.ck.ck-editor__editable_inline[dir=ltr]{text-align:left}.ck.ck-editor__editable_inline[dir=rtl]{text-align:right}.ck.ck-editor__editable_inline>:first-child{margin-top:var(--ck-spacing-large)}.ck.ck-editor__editable_inline>:last-child{margin-bottom:var(--ck-spacing-large)}.ck.ck-editor__editable_inline.ck-blurred ::selection{background:var(--ck-color-editable-blur-selection)}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_n]:after{border-bottom-color:var(--ck-color-base-foreground)}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_s]:after{border-top-color:var(--ck-color-base-foreground)}"},function(l,h,w){var k=w(1),v=w(42);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var N={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(v,N),l.exports=v.locals||{}},function(l,h){l.exports=".ck.ck-label{display:block}.ck.ck-voice-label{display:none}.ck.ck-label{font-weight:700}"},function(l,h,w){var k=w(1),v=w(44);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var N={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(v,N),l.exports=v.locals||{}},function(l,h){l.exports=".ck.ck-form__header{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:center;justify-content:space-between}:root{--ck-form-header-height:38px}.ck.ck-form__header{padding:var(--ck-spacing-small) var(--ck-spacing-large);height:var(--ck-form-header-height);line-height:var(--ck-form-header-height);border-bottom:1px solid var(--ck-color-base-border)}.ck.ck-form__header .ck-form__header__label{font-weight:700}"},function(l,h,w){var k=w(1),v=w(46);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var N={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(v,N),l.exports=v.locals||{}},function(l,h){l.exports=":root{--ck-input-text-width:18em}.ck.ck-input-text{border-radius:0}.ck-rounded-corners .ck.ck-input-text,.ck.ck-input-text.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-input-text{background:var(--ck-color-input-background);border:1px solid var(--ck-color-input-border);padding:var(--ck-spacing-extra-tiny) var(--ck-spacing-medium);min-width:var(--ck-input-text-width);min-height:var(--ck-ui-component-min-height);transition:box-shadow .1s ease-in-out,border .1s ease-in-out}.ck.ck-input-text:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0}.ck.ck-input-text[readonly]{border:1px solid var(--ck-color-input-disabled-border);background:var(--ck-color-input-disabled-background);color:var(--ck-color-input-disabled-text)}.ck.ck-input-text[readonly]:focus{box-shadow:var(--ck-focus-disabled-outer-shadow),0 0}.ck.ck-input-text.ck-error{border-color:var(--ck-color-input-error-border);animation:ck-text-input-shake .3s ease both}.ck.ck-input-text.ck-error:focus{box-shadow:var(--ck-focus-error-outer-shadow),0 0}@keyframes ck-text-input-shake{20%{transform:translateX(-2px)}40%{transform:translateX(2px)}60%{transform:translateX(-1px)}80%{transform:translateX(1px)}}"},function(l,h,w){var k=w(1),v=w(48);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var N={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(v,N),l.exports=v.locals||{}},function(l,h){l.exports=".ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper{display:flex;position:relative}.ck.ck-labeled-field-view .ck.ck-label{display:block;position:absolute}:root{--ck-labeled-field-view-transition:.1s cubic-bezier(0,0,0.24,0.95);--ck-labeled-field-empty-unfocused-max-width:100% - 2 * var(--ck-spacing-medium);--ck-color-labeled-field-label-background:var(--ck-color-base-background)}.ck.ck-labeled-field-view{border-radius:0}.ck-rounded-corners .ck.ck-labeled-field-view,.ck.ck-labeled-field-view.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper{width:100%}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{top:0}[dir=ltr] .ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{left:0}[dir=rtl] .ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{right:0}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{pointer-events:none;transform-origin:0 0;transform:translate(var(--ck-spacing-medium),-6px) scale(.75);background:var(--ck-color-labeled-field-label-background);padding:0 calc(var(--ck-font-size-tiny)*0.5);line-height:normal;font-weight:400;text-overflow:ellipsis;overflow:hidden;max-width:100%;transition:transform var(--ck-labeled-field-view-transition),padding var(--ck-labeled-field-view-transition),background var(--ck-labeled-field-view-transition)}.ck.ck-labeled-field-view.ck-error .ck-input:not([readonly])+.ck.ck-label,.ck.ck-labeled-field-view.ck-error>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{color:var(--ck-color-base-error)}.ck.ck-labeled-field-view .ck-labeled-field-view__status{font-size:var(--ck-font-size-small);margin-top:var(--ck-spacing-small);white-space:normal}.ck.ck-labeled-field-view .ck-labeled-field-view__status.ck-labeled-field-view__status_error{color:var(--ck-color-base-error)}.ck.ck-labeled-field-view.ck-disabled>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{color:var(--ck-color-input-disabled-text)}[dir=ltr] .ck.ck-labeled-field-view.ck-disabled.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,[dir=ltr] .ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{transform:translate(var(--ck-spacing-medium),calc(var(--ck-font-size-base)*0.6)) scale(1)}[dir=rtl] .ck.ck-labeled-field-view.ck-disabled.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,[dir=rtl] .ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{transform:translate(calc(var(--ck-spacing-medium)*-1),calc(var(--ck-font-size-base)*0.6)) scale(1)}.ck.ck-labeled-field-view.ck-disabled.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{max-width:calc(var(--ck-labeled-field-empty-unfocused-max-width));background:transparent;padding:0}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown>.ck.ck-button{background:transparent}.ck.ck-labeled-field-view.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown>.ck-button>.ck-button__label{opacity:0}.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown+.ck-label{max-width:calc(var(--ck-labeled-field-empty-unfocused-max-width) - var(--ck-dropdown-arrow-size) - var(--ck-spacing-standard))}"},function(l,h,w){var k=w(1),v=w(50);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var N={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(v,N),l.exports=v.locals||{}},function(l,h){l.exports=':root{--ck-balloon-panel-arrow-z-index:calc(var(--ck-z-default) - 3)}.ck.ck-balloon-panel{display:none;position:absolute;z-index:var(--ck-z-modal)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{content:"";position:absolute}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel[class*=arrow_n]:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel[class*=arrow_n]:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel[class*=arrow_s]:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel[class*=arrow_s]:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel.ck-balloon-panel_visible{display:block}:root{--ck-balloon-arrow-offset:2px;--ck-balloon-arrow-height:10px;--ck-balloon-arrow-half-width:8px;--ck-balloon-arrow-drop-shadow:0 2px 2px var(--ck-color-shadow-drop)}.ck.ck-balloon-panel{border-radius:0}.ck-rounded-corners .ck.ck-balloon-panel,.ck.ck-balloon-panel.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-balloon-panel{box-shadow:var(--ck-drop-shadow),0 0;min-height:15px;background:var(--ck-color-panel-background);border:1px solid var(--ck-color-panel-border)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{width:0;height:0;border-style:solid}.ck.ck-balloon-panel[class*=arrow_n]:after,.ck.ck-balloon-panel[class*=arrow_n]:before{border-left-width:var(--ck-balloon-arrow-half-width);border-bottom-width:var(--ck-balloon-arrow-height);border-right-width:var(--ck-balloon-arrow-half-width);border-top-width:0}.ck.ck-balloon-panel[class*=arrow_n]:before{border-bottom-color:var(--ck-color-panel-border)}.ck.ck-balloon-panel[class*=arrow_n]:after,.ck.ck-balloon-panel[class*=arrow_n]:before{border-left-color:transparent;border-right-color:transparent;border-top-color:transparent}.ck.ck-balloon-panel[class*=arrow_n]:after{border-bottom-color:var(--ck-color-panel-background);margin-top:var(--ck-balloon-arrow-offset)}.ck.ck-balloon-panel[class*=arrow_s]:after,.ck.ck-balloon-panel[class*=arrow_s]:before{border-left-width:var(--ck-balloon-arrow-half-width);border-bottom-width:0;border-right-width:var(--ck-balloon-arrow-half-width);border-top-width:var(--ck-balloon-arrow-height)}.ck.ck-balloon-panel[class*=arrow_s]:before{border-top-color:var(--ck-color-panel-border);filter:drop-shadow(var(--ck-balloon-arrow-drop-shadow))}.ck.ck-balloon-panel[class*=arrow_s]:after,.ck.ck-balloon-panel[class*=arrow_s]:before{border-left-color:transparent;border-bottom-color:transparent;border-right-color:transparent}.ck.ck-balloon-panel[class*=arrow_s]:after{border-top-color:var(--ck-color-panel-background);margin-bottom:var(--ck-balloon-arrow-offset)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:before{left:50%;margin-left:calc(var(--ck-balloon-arrow-half-width)*-1);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:before{left:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:before{right:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:before{left:50%;margin-left:calc(var(--ck-balloon-arrow-half-width)*-1);bottom:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:before{left:calc(var(--ck-balloon-arrow-half-width)*2);bottom:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:before{right:calc(var(--ck-balloon-arrow-half-width)*2);bottom:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sme:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sme:before{right:25%;margin-right:calc(var(--ck-balloon-arrow-half-width)*2);bottom:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_smw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_smw:before{left:25%;margin-left:calc(var(--ck-balloon-arrow-half-width)*2);bottom:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nme:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nme:before{right:25%;margin-right:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nmw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nmw:before{left:25%;margin-left:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}'},function(l,h,w){var k=w(1),v=w(52);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var N={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(v,N),l.exports=v.locals||{}},function(l,h){l.exports=".ck .ck-balloon-rotator__navigation{display:flex;align-items:center;justify-content:center}.ck .ck-balloon-rotator__content .ck-toolbar{justify-content:center}.ck .ck-balloon-rotator__navigation{background:var(--ck-color-toolbar-background);border-bottom:1px solid var(--ck-color-toolbar-border);padding:0 var(--ck-spacing-small)}.ck .ck-balloon-rotator__navigation>*{margin-right:var(--ck-spacing-small);margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small)}.ck .ck-balloon-rotator__navigation .ck-balloon-rotator__counter{margin-right:var(--ck-spacing-standard);margin-left:var(--ck-spacing-small)}.ck .ck-balloon-rotator__content .ck.ck-annotation-wrapper{box-shadow:none}"},function(l,h,w){var k=w(1),v=w(54);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var N={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(v,N),l.exports=v.locals||{}},function(l,h){l.exports=".ck .ck-fake-panel{position:absolute;z-index:calc(var(--ck-z-modal) - 1)}.ck .ck-fake-panel div{position:absolute}.ck .ck-fake-panel div:first-child{z-index:2}.ck .ck-fake-panel div:nth-child(2){z-index:1}:root{--ck-balloon-fake-panel-offset-horizontal:6px;--ck-balloon-fake-panel-offset-vertical:6px}.ck .ck-fake-panel div{box-shadow:var(--ck-drop-shadow),0 0;min-height:15px;background:var(--ck-color-panel-background);border:1px solid var(--ck-color-panel-border);border-radius:var(--ck-border-radius);width:100%;height:100%}.ck .ck-fake-panel div:first-child{margin-left:var(--ck-balloon-fake-panel-offset-horizontal);margin-top:var(--ck-balloon-fake-panel-offset-vertical)}.ck .ck-fake-panel div:nth-child(2){margin-left:calc(var(--ck-balloon-fake-panel-offset-horizontal)*2);margin-top:calc(var(--ck-balloon-fake-panel-offset-vertical)*2)}.ck .ck-fake-panel div:nth-child(3){margin-left:calc(var(--ck-balloon-fake-panel-offset-horizontal)*3);margin-top:calc(var(--ck-balloon-fake-panel-offset-vertical)*3)}.ck .ck-balloon-panel_arrow_s+.ck-fake-panel,.ck .ck-balloon-panel_arrow_se+.ck-fake-panel,.ck .ck-balloon-panel_arrow_sw+.ck-fake-panel{--ck-balloon-fake-panel-offset-vertical:-6px}"},function(l,h,w){var k=w(1),v=w(56);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var N={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(v,N),l.exports=v.locals||{}},function(l,h){l.exports=".ck.ck-sticky-panel .ck-sticky-panel__content_sticky{z-index:var(--ck-z-modal);position:fixed;top:0}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky_bottom-limit{top:auto;position:absolute}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky{box-shadow:var(--ck-drop-shadow),0 0;border-width:0 1px 1px;border-top-left-radius:0;border-top-right-radius:0}"},function(l,h,w){var k=w(1),v=w(58);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var N={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(v,N),l.exports=v.locals||{}},function(l,h){l.exports=".ck.ck-block-toolbar-button{position:absolute;z-index:var(--ck-z-default)}:root{--ck-color-block-toolbar-button:var(--ck-color-text);--ck-block-toolbar-button-size:var(--ck-font-size-normal)}.ck.ck-block-toolbar-button{color:var(--ck-color-block-toolbar-button);font-size:var(--ck-block-toolbar-size)}"},function(l,h,w){var k=w(1),v=w(60);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var N={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(v,N),l.exports=v.locals||{}},function(l,h){l.exports=".ck.ck-placeholder,.ck .ck-placeholder{position:relative}.ck.ck-placeholder:before,.ck .ck-placeholder:before{position:absolute;left:0;right:0;content:attr(data-placeholder);pointer-events:none}.ck.ck-read-only .ck-placeholder:before{display:none}.ck.ck-placeholder:before,.ck .ck-placeholder:before{cursor:text;color:var(--ck-color-engine-placeholder-text)}"},function(l,h,w){var k=w(1),v=w(62);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var N={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(v,N),l.exports=v.locals||{}},function(l,h){l.exports=".ck.ck-editor{position:relative}.ck.ck-editor .ck-editor__top .ck-sticky-panel .ck-toolbar{z-index:var(--ck-z-modal)}.ck.ck-editor__top .ck-sticky-panel .ck-toolbar{border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-toolbar,.ck.ck-editor__top .ck-sticky-panel .ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius);border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-editor__top .ck-sticky-panel .ck-toolbar{border-bottom-width:0}.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar{border-bottom-width:1px;border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar,.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius);border-radius:0}.ck.ck-editor__main>.ck-editor__editable{background:var(--ck-color-base-background);border-radius:0}.ck-rounded-corners .ck.ck-editor__main>.ck-editor__editable,.ck.ck-editor__main>.ck-editor__editable.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}.ck.ck-editor__main>.ck-editor__editable:not(.ck-focused){border-color:var(--ck-color-base-border)}"},function(l,h,w){var k=w(1),v=w(64);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var N={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(v,N),l.exports=v.locals||{}},function(l,h){l.exports='.ck .ck-widget .ck-widget__type-around__button{display:block;position:absolute;overflow:hidden;z-index:var(--ck-z-default)}.ck .ck-widget .ck-widget__type-around__button svg{position:absolute;top:50%;left:50%;z-index:calc(var(--ck-z-default) + 2)}.ck .ck-widget .ck-widget__type-around__button.ck-widget__type-around__button_before{top:calc(var(--ck-widget-outline-thickness)*-0.5);left:min(10%,30px);transform:translateY(-50%)}.ck .ck-widget .ck-widget__type-around__button.ck-widget__type-around__button_after{bottom:calc(var(--ck-widget-outline-thickness)*-0.5);right:min(10%,30px);transform:translateY(50%)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:after,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover:after{content:"";display:block;position:absolute;top:1px;left:1px;z-index:calc(var(--ck-z-default) + 1)}.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__fake-caret{display:none;position:absolute;left:0;right:0}.ck .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__fake-caret{left:calc(var(--ck-widget-outline-thickness)*-1);right:calc(var(--ck-widget-outline-thickness)*-1)}.ck .ck-widget.ck-widget_type-around_show-fake-caret_before>.ck-widget__type-around>.ck-widget__type-around__fake-caret{top:calc(var(--ck-widget-outline-thickness)*-1 - 1px);display:block}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after>.ck-widget__type-around>.ck-widget__type-around__fake-caret{bottom:calc(var(--ck-widget-outline-thickness)*-1 - 1px);display:block}.ck.ck-editor__editable.ck-read-only .ck-widget__type-around,.ck.ck-editor__editable.ck-restricted-editing_mode_restricted .ck-widget__type-around,.ck.ck-editor__editable.ck-widget__type-around_disabled .ck-widget__type-around{display:none}:root{--ck-widget-type-around-button-size:20px;--ck-color-widget-type-around-button-active:var(--ck-color-focus-border);--ck-color-widget-type-around-button-hover:var(--ck-color-widget-hover-border);--ck-color-widget-type-around-button-blurred-editable:var(--ck-color-widget-blurred-border);--ck-color-widget-type-around-button-radar-start-alpha:0;--ck-color-widget-type-around-button-radar-end-alpha:.3;--ck-color-widget-type-around-button-icon:var(--ck-color-base-background)}.ck .ck-widget .ck-widget__type-around__button{width:var(--ck-widget-type-around-button-size);height:var(--ck-widget-type-around-button-size);background:var(--ck-color-widget-type-around-button);border-radius:100px;transition:opacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);opacity:0;pointer-events:none}.ck .ck-widget .ck-widget__type-around__button svg{width:10px;height:8px;transform:translate(-50%,-50%);transition:transform .5s ease;margin-top:1px}.ck .ck-widget .ck-widget__type-around__button svg *{stroke-dasharray:10;stroke-dashoffset:0;fill:none;stroke:var(--ck-color-widget-type-around-button-icon);stroke-width:1.5px;stroke-linecap:round;stroke-linejoin:round}.ck .ck-widget .ck-widget__type-around__button svg line{stroke-dasharray:7}.ck .ck-widget .ck-widget__type-around__button:hover{animation:ck-widget-type-around-button-sonar 1s ease infinite}.ck .ck-widget .ck-widget__type-around__button:hover svg polyline{animation:ck-widget-type-around-arrow-dash 2s linear}.ck .ck-widget .ck-widget__type-around__button:hover svg line{animation:ck-widget-type-around-arrow-tip-dash 2s linear}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__button{opacity:1;pointer-events:auto}.ck .ck-widget:not(.ck-widget_selected)>.ck-widget__type-around>.ck-widget__type-around__button{background:var(--ck-color-widget-type-around-button-hover)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover{background:var(--ck-color-widget-type-around-button-active)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:after,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover:after{width:calc(var(--ck-widget-type-around-button-size) - 2px);height:calc(var(--ck-widget-type-around-button-size) - 2px);border-radius:100px;background:linear-gradient(135deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3))}.ck .ck-widget.ck-widget_with-selection-handle>.ck-widget__type-around>.ck-widget__type-around__button_before{margin-left:20px}.ck .ck-widget .ck-widget__type-around__fake-caret{pointer-events:none;height:1px;animation:ck-widget-type-around-fake-caret-pulse 1s linear infinite normal forwards;outline:1px solid hsla(0,0%,100%,.5);background:var(--ck-color-base-text)}.ck .ck-widget.ck-widget_selected.ck-widget_type-around_show-fake-caret_after,.ck .ck-widget.ck-widget_selected.ck-widget_type-around_show-fake-caret_before{outline-color:transparent}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_selected:hover,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_selected:hover{outline-color:var(--ck-color-widget-hover-border)}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before>.ck-widget__type-around>.ck-widget__type-around__button{opacity:0;pointer-events:none}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle{opacity:0}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_selected.ck-widget_with-resizer>.ck-widget__resizer,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_selected.ck-widget_with-resizer>.ck-widget__resizer{opacity:0}.ck[dir=rtl] .ck-widget.ck-widget_with-selection-handle .ck-widget__type-around>.ck-widget__type-around__button_before{margin-left:0;margin-right:20px}.ck-editor__nested-editable.ck-editor__editable_selected .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck-editor__nested-editable.ck-editor__editable_selected .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__button{opacity:0;pointer-events:none}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:not(:hover){background:var(--ck-color-widget-type-around-button-blurred-editable)}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:not(:hover) svg *{stroke:#999}@keyframes ck-widget-type-around-arrow-dash{0%{stroke-dashoffset:10}20%,to{stroke-dashoffset:0}}@keyframes ck-widget-type-around-arrow-tip-dash{0%,20%{stroke-dashoffset:7}40%,to{stroke-dashoffset:0}}@keyframes ck-widget-type-around-button-sonar{0%{box-shadow:0 0 0 0 hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-start-alpha))}50%{box-shadow:0 0 0 5px hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-end-alpha))}to{box-shadow:0 0 0 5px hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-start-alpha))}}@keyframes ck-widget-type-around-fake-caret-pulse{0%{opacity:1}49%{opacity:1}50%{opacity:0}99%{opacity:0}to{opacity:1}}'},function(l,h,w){var k=w(1),v=w(66);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var N={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(v,N),l.exports=v.locals||{}},function(l,h){l.exports=":root{--ck-color-resizer:var(--ck-color-focus-border);--ck-color-resizer-tooltip-background:#262626;--ck-color-resizer-tooltip-text:#f2f2f2;--ck-resizer-border-radius:var(--ck-border-radius);--ck-resizer-tooltip-offset:10px;--ck-resizer-tooltip-height:calc(var(--ck-spacing-small)*2 + 10px)}.ck .ck-widget,.ck .ck-widget.ck-widget_with-selection-handle{position:relative}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{position:absolute}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon{display:block}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_with-selection-handle:hover>.ck-widget__selection-handle{visibility:visible}.ck .ck-size-view{background:var(--ck-color-resizer-tooltip-background);color:var(--ck-color-resizer-tooltip-text);border:1px solid var(--ck-color-resizer-tooltip-text);border-radius:var(--ck-resizer-border-radius);font-size:var(--ck-font-size-tiny);display:block;padding:0 var(--ck-spacing-small);height:var(--ck-resizer-tooltip-height);line-height:var(--ck-resizer-tooltip-height)}.ck .ck-size-view.ck-orientation-above-center,.ck .ck-size-view.ck-orientation-bottom-left,.ck .ck-size-view.ck-orientation-bottom-right,.ck .ck-size-view.ck-orientation-top-left,.ck .ck-size-view.ck-orientation-top-right{position:absolute}.ck .ck-size-view.ck-orientation-top-left{top:var(--ck-resizer-tooltip-offset);left:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-top-right{top:var(--ck-resizer-tooltip-offset);right:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-bottom-right{bottom:var(--ck-resizer-tooltip-offset);right:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-bottom-left{bottom:var(--ck-resizer-tooltip-offset);left:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-above-center{top:calc(var(--ck-resizer-tooltip-height)*-1);left:50%;transform:translate(-50%)}:root{--ck-widget-outline-thickness:3px;--ck-widget-handler-icon-size:16px;--ck-widget-handler-animation-duration:200ms;--ck-widget-handler-animation-curve:ease;--ck-color-widget-blurred-border:#dedede;--ck-color-widget-hover-border:#ffc83d;--ck-color-widget-editable-focus-background:var(--ck-color-base-background);--ck-color-widget-drag-handler-icon-color:var(--ck-color-base-background)}.ck .ck-widget{outline-width:var(--ck-widget-outline-thickness);outline-style:solid;outline-color:transparent;transition:outline-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve)}.ck .ck-widget.ck-widget_selected,.ck .ck-widget.ck-widget_selected:hover{outline:var(--ck-widget-outline-thickness) solid var(--ck-color-focus-border)}.ck .ck-widget:hover{outline-color:var(--ck-color-widget-hover-border)}.ck .ck-editor__nested-editable{border:1px solid transparent}.ck .ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck .ck-editor__nested-editable:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-inner-shadow),0 0;background-color:var(--ck-color-widget-editable-focus-background)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{padding:4px;box-sizing:border-box;background-color:transparent;opacity:0;transition:background-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),visibility var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),opacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);border-radius:var(--ck-border-radius) var(--ck-border-radius) 0 0;transform:translateY(-100%);left:calc(0px - var(--ck-widget-outline-thickness));top:0}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon{width:var(--ck-widget-handler-icon-size);height:var(--ck-widget-handler-icon-size);color:var(--ck-color-widget-drag-handler-icon-color)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator{opacity:0;transition:opacity .3s var(--ck-widget-handler-animation-curve)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle:hover .ck-icon .ck-icon__selected-indicator{opacity:1}.ck .ck-widget.ck-widget_with-selection-handle:hover>.ck-widget__selection-handle{opacity:1;background-color:var(--ck-color-widget-hover-border)}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle{opacity:1;background-color:var(--ck-color-focus-border)}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator{opacity:1}.ck[dir=rtl] .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{left:auto;right:calc(0px - var(--ck-widget-outline-thickness))}.ck.ck-editor__editable.ck-read-only .ck-widget{transition:none}.ck.ck-editor__editable.ck-read-only .ck-widget:not(.ck-widget_selected){--ck-widget-outline-thickness:0px}.ck.ck-editor__editable.ck-read-only .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle,.ck.ck-editor__editable.ck-read-only .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle:hover{background:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover{outline-color:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle>.ck-widget__selection-handle,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle>.ck-widget__selection-handle:hover,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover.ck-widget_with-selection-handle>.ck-widget__selection-handle,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover.ck-widget_with-selection-handle>.ck-widget__selection-handle:hover{background:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable>.ck-widget.ck-widget_with-selection-handle:first-child,.ck.ck-editor__editable blockquote>.ck-widget.ck-widget_with-selection-handle:first-child{margin-top:calc(1em + var(--ck-widget-handler-icon-size))}"},function(l,h,w){var k=w(1),v=w(68);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var N={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(v,N),l.exports=v.locals||{}},function(l,h){l.exports='.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position{display:inline;position:relative;pointer-events:none}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span{position:absolute;width:0}.ck.ck-editor__editable .ck-widget:-webkit-drag>.ck-widget__selection-handle,.ck.ck-editor__editable .ck-widget:-webkit-drag>.ck-widget__type-around{display:none}:root{--ck-clipboard-drop-target-dot-width:12px;--ck-clipboard-drop-target-dot-height:8px;--ck-clipboard-drop-target-color:var(--ck-color-focus-border)}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span{bottom:calc(var(--ck-clipboard-drop-target-dot-height)*-0.5);top:calc(var(--ck-clipboard-drop-target-dot-height)*-0.5);border:1px solid var(--ck-clipboard-drop-target-color);background:var(--ck-clipboard-drop-target-color);margin-left:-1px}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span:after{content:"";width:0;height:0;display:block;position:absolute;left:50%;top:calc(var(--ck-clipboard-drop-target-dot-height)*-0.5);transform:translateX(-50%);border-left:calc(var(--ck-clipboard-drop-target-dot-width)*0.5) solid transparent;border-bottom:0 solid transparent;border-right:calc(var(--ck-clipboard-drop-target-dot-width)*0.5) solid transparent;border-top:calc(var(--ck-clipboard-drop-target-dot-height)) solid var(--ck-clipboard-drop-target-color)}.ck.ck-editor__editable .ck-widget.ck-clipboard-drop-target-range{outline:var(--ck-widget-outline-thickness) solid var(--ck-clipboard-drop-target-color)!important}.ck.ck-editor__editable .ck-widget:-webkit-drag{zoom:.6;outline:none!important}'},function(l,h,w){var k=w(1),v=w(70);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var N={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(v,N),l.exports=v.locals||{}},function(l,h){l.exports=".ck-content blockquote{overflow:hidden;padding-right:1.5em;padding-left:1.5em;margin-left:0;margin-right:0;font-style:italic;border-left:5px solid #ccc}.ck-content[dir=rtl] blockquote{border-left:0;border-right:5px solid #ccc}"},function(l,h){l.exports=".ck.ck-heading_heading1{font-size:20px}.ck.ck-heading_heading2{font-size:17px}.ck.ck-heading_heading3{font-size:14px}.ck[class*=ck-heading_heading]{font-weight:700}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__button .ck-button__label{width:8em}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__panel .ck-list__item{min-width:18em}"},function(l,h,w){var k=w(1),v=w(73);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var N={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(v,N),l.exports=v.locals||{}},function(l,h){l.exports=".ck .ck-widget_with-resizer{position:relative}.ck .ck-widget__resizer{display:none;position:absolute;pointer-events:none;left:0;top:0}.ck-focused .ck-widget_with-resizer.ck-widget_selected>.ck-widget__resizer{display:block}.ck .ck-widget__resizer__handle{position:absolute;pointer-events:all}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-right,.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-left{cursor:nwse-resize}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-left,.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-right{cursor:nesw-resize}:root{--ck-resizer-size:10px;--ck-resizer-offset:calc(var(--ck-resizer-size)/-2 - 2px);--ck-resizer-border-width:1px}.ck .ck-widget__resizer{outline:1px solid var(--ck-color-resizer)}.ck .ck-widget__resizer__handle{width:var(--ck-resizer-size);height:var(--ck-resizer-size);background:var(--ck-color-focus-border);border:var(--ck-resizer-border-width) solid #fff;border-radius:var(--ck-resizer-border-radius)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-left{top:var(--ck-resizer-offset);left:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-right{top:var(--ck-resizer-offset);right:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-right{bottom:var(--ck-resizer-offset);right:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-left{bottom:var(--ck-resizer-offset);left:var(--ck-resizer-offset)}"},function(l,h,w){var k=w(1),v=w(75);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var N={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(v,N),l.exports=v.locals||{}},function(l,h){l.exports=".ck.ck-text-alternative-form{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-text-alternative-form .ck-labeled-field-view{display:inline-block}.ck.ck-text-alternative-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-text-alternative-form{flex-wrap:wrap}.ck.ck-text-alternative-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-text-alternative-form .ck-button{flex-basis:50%}}"},function(l,h){l.exports='.ck-vertical-form .ck-button:after{content:"";width:0;position:absolute;right:-1px;top:var(--ck-spacing-small);bottom:var(--ck-spacing-small);z-index:1}@media screen and (max-width:600px){.ck.ck-responsive-form .ck-button:after{content:"";width:0;position:absolute;right:-1px;top:var(--ck-spacing-small);bottom:var(--ck-spacing-small);z-index:1}}.ck-vertical-form>.ck-button:nth-last-child(2):after{border-right:1px solid var(--ck-color-base-border)}.ck.ck-responsive-form{padding:var(--ck-spacing-large)}.ck.ck-responsive-form:focus{outline:none}[dir=ltr] .ck.ck-responsive-form>:not(:first-child),[dir=rtl] .ck.ck-responsive-form>:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-responsive-form{padding:0;width:calc(var(--ck-input-text-width)*0.8)}.ck.ck-responsive-form .ck-labeled-field-view{margin:var(--ck-spacing-large) var(--ck-spacing-large) 0}.ck.ck-responsive-form .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-responsive-form .ck-labeled-field-view .ck-labeled-field-view__error{white-space:normal}.ck.ck-responsive-form>.ck-button:last-child,.ck.ck-responsive-form>.ck-button:nth-last-child(2){padding:var(--ck-spacing-standard);margin-top:var(--ck-spacing-large);border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-responsive-form>.ck-button:last-child,[dir=ltr] .ck.ck-responsive-form>.ck-button:nth-last-child(2),[dir=rtl] .ck.ck-responsive-form>.ck-button:last-child,[dir=rtl] .ck.ck-responsive-form>.ck-button:nth-last-child(2){margin-left:0}.ck.ck-responsive-form>.ck-button:nth-last-child(2):after,[dir=rtl] .ck.ck-responsive-form>.ck-button:last-child:last-of-type,[dir=rtl] .ck.ck-responsive-form>.ck-button:nth-last-child(2):last-of-type{border-right:1px solid var(--ck-color-base-border)}}'},function(l,h){l.exports=".ck-content .image{display:table;clear:both;text-align:center;margin:.9em auto;min-width:50px}.ck-content .image img{display:block;margin:0 auto;max-width:100%;min-width:100%}.ck-content .image-inline{display:inline-flex;max-width:100%;align-items:flex-start}.ck-content .image-inline picture{display:flex}.ck-content .image-inline img,.ck-content .image-inline picture{flex-grow:1;flex-shrink:1;max-width:100%}.ck.ck-editor__editable .image>figcaption.ck-placeholder:before{padding-left:inherit;padding-right:inherit;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ck.ck-editor__editable .image-inline.ck-widget_selected,.ck.ck-editor__editable .image.ck-widget_selected{z-index:1}.ck.ck-editor__editable .image-inline.ck-widget_selected ::selection{display:none}.ck.ck-editor__editable td .image-inline img,.ck.ck-editor__editable th .image-inline img{max-width:none}"},function(l,h,w){var k=w(1),v=w(79);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var N={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(v,N),l.exports=v.locals||{}},function(l,h){l.exports=":root{--ck-color-image-caption-background:#f7f7f7;--ck-color-image-caption-text:#333;--ck-color-image-caption-highligted-background:#fd0}.ck-content .image>figcaption{display:table-caption;caption-side:bottom;word-break:break-word;color:var(--ck-color-image-caption-text);background-color:var(--ck-color-image-caption-background);padding:.6em;font-size:.75em;outline-offset:-1px}.ck.ck-editor__editable .image>figcaption.image__caption_highlighted{animation:ck-image-caption-highlight .6s ease-out}@keyframes ck-image-caption-highlight{0%{background-color:var(--ck-color-image-caption-highligted-background)}to{background-color:var(--ck-color-image-caption-background)}}"},function(l,h,w){var k=w(1),v=w(81);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var N={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(v,N),l.exports=v.locals||{}},function(l,h){l.exports=":root{--ck-image-style-spacing:1.5em;--ck-inline-image-style-spacing:calc(var(--ck-image-style-spacing)/2)}.ck-content .image-style-block-align-left,.ck-content .image-style-block-align-right{max-width:calc(100% - var(--ck-image-style-spacing))}.ck-content .image-style-align-left,.ck-content .image-style-align-right{clear:none}.ck-content .image-style-side{float:right;margin-left:var(--ck-image-style-spacing);max-width:50%}.ck-content .image-style-align-left{float:left;margin-right:var(--ck-image-style-spacing)}.ck-content .image-style-align-center{margin-left:auto;margin-right:auto}.ck-content .image-style-align-right{float:right;margin-left:var(--ck-image-style-spacing)}.ck-content .image-style-block-align-right{margin-right:0;margin-left:auto}.ck-content .image-style-block-align-left{margin-left:0;margin-right:auto}.ck-content p+.image-style-align-left,.ck-content p+.image-style-align-right,.ck-content p+.image-style-side{margin-top:0}.ck-content .image-inline.image-style-align-left,.ck-content .image-inline.image-style-align-right{margin-top:var(--ck-inline-image-style-spacing);margin-bottom:var(--ck-inline-image-style-spacing)}.ck-content .image-inline.image-style-align-left{margin-right:var(--ck-inline-image-style-spacing)}.ck-content .image-inline.image-style-align-right{margin-left:var(--ck-inline-image-style-spacing)}.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__action:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover),.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__action:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover){background-color:var(--ck-color-button-on-background)}.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__action:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover):after,.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__action:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover):after{display:none}.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open:hover>.ck-splitbutton__action:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open:hover>.ck-splitbutton__arrow:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open:hover>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover){background-color:var(--ck-color-button-on-hover-background)}"},function(l,h,w){var k=w(1),v=w(83);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var N={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(v,N),l.exports=v.locals||{}},function(l,h){l.exports=".ck.ck-editor__editable .image,.ck.ck-editor__editable .image-inline{position:relative}.ck.ck-editor__editable .image-inline .ck-progress-bar,.ck.ck-editor__editable .image .ck-progress-bar{position:absolute;top:0;left:0}.ck.ck-editor__editable .image-inline.ck-appear,.ck.ck-editor__editable .image.ck-appear{animation:fadeIn .7s}.ck.ck-editor__editable .image-inline .ck-progress-bar,.ck.ck-editor__editable .image .ck-progress-bar{height:2px;width:0;background:var(--ck-color-upload-bar-background);transition:width .1s}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}"},function(l,h,w){var k=w(1),v=w(85);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var N={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(v,N),l.exports=v.locals||{}},function(l,h){l.exports='.ck-image-upload-complete-icon{display:block;position:absolute;top:min(var(--ck-spacing-medium),6%);right:min(var(--ck-spacing-medium),6%);border-radius:50%;z-index:1}.ck-image-upload-complete-icon:after{content:"";position:absolute}:root{--ck-color-image-upload-icon:#fff;--ck-color-image-upload-icon-background:#008a00;--ck-image-upload-icon-size:20;--ck-image-upload-icon-width:2px;--ck-image-upload-icon-is-visible:clamp(0px,100% - 50px,1px)}.ck-image-upload-complete-icon{opacity:0;background:var(--ck-color-image-upload-icon-background);animation-name:ck-upload-complete-icon-show,ck-upload-complete-icon-hide;animation-fill-mode:forwards,forwards;animation-duration:.5s,.5s;font-size:calc(1px*var(--ck-image-upload-icon-size));animation-delay:0ms,3s;overflow:hidden;width:calc(var(--ck-image-upload-icon-is-visible)*var(--ck-image-upload-icon-size));height:calc(var(--ck-image-upload-icon-is-visible)*var(--ck-image-upload-icon-size))}.ck-image-upload-complete-icon:after{left:25%;top:50%;opacity:0;height:0;width:0;transform:scaleX(-1) rotate(135deg);transform-origin:left top;border-top:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);border-right:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);animation-name:ck-upload-complete-icon-check;animation-duration:.5s;animation-delay:.5s;animation-fill-mode:forwards;box-sizing:border-box}@keyframes ck-upload-complete-icon-show{0%{opacity:0}to{opacity:1}}@keyframes ck-upload-complete-icon-hide{0%{opacity:1}to{opacity:0}}@keyframes ck-upload-complete-icon-check{0%{opacity:1;width:0;height:0}33%{width:.3em;height:0}to{opacity:1;width:.3em;height:.45em}}'},function(l,h,w){var k=w(1),v=w(87);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var N={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(v,N),l.exports=v.locals||{}},function(l,h){l.exports='.ck .ck-upload-placeholder-loader{position:absolute;display:flex;align-items:center;justify-content:center;top:0;left:0}.ck .ck-upload-placeholder-loader:before{content:"";position:relative}:root{--ck-color-upload-placeholder-loader:#b3b3b3;--ck-upload-placeholder-loader-size:32px}.ck .ck-image-upload-placeholder{width:100%;margin:0}.ck .ck-upload-placeholder-loader{width:100%;height:100%}.ck .ck-upload-placeholder-loader:before{width:var(--ck-upload-placeholder-loader-size);height:var(--ck-upload-placeholder-loader-size);border-radius:50%;border-top:3px solid var(--ck-color-upload-placeholder-loader);border-right:2px solid transparent;animation:ck-upload-placeholder-loader 1s linear infinite}@keyframes ck-upload-placeholder-loader{to{transform:rotate(1turn)}}'},function(l,h,w){var k=w(1),v=w(89);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var N={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(v,N),l.exports=v.locals||{}},function(l,h){l.exports=".ck .ck-link_selected{background:var(--ck-color-link-selected-background)}.ck .ck-link_selected span.image-inline{outline:var(--ck-widget-outline-thickness) solid var(--ck-color-link-selected-background)}.ck .ck-fake-link-selection{background:var(--ck-color-link-fake-selection)}.ck .ck-fake-link-selection_collapsed{height:100%;border-right:1px solid var(--ck-color-base-text);margin-right:-1px;outline:1px solid hsla(0,0%,100%,.5)}"},function(l,h,w){var k=w(1),v=w(91);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var N={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(v,N),l.exports=v.locals||{}},function(l,h){l.exports=".ck.ck-link-form{display:flex}.ck.ck-link-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-link-form{flex-wrap:wrap}.ck.ck-link-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-link-form .ck-button{flex-basis:50%}}.ck.ck-link-form_layout-vertical{display:block}.ck.ck-link-form_layout-vertical .ck-button.ck-button-cancel,.ck.ck-link-form_layout-vertical .ck-button.ck-button-save{margin-top:var(--ck-spacing-medium)}.ck.ck-link-form_layout-vertical{padding:0;min-width:var(--ck-input-text-width)}.ck.ck-link-form_layout-vertical .ck-labeled-field-view{margin:var(--ck-spacing-large) var(--ck-spacing-large) var(--ck-spacing-small)}.ck.ck-link-form_layout-vertical .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-link-form_layout-vertical .ck-button{padding:var(--ck-spacing-standard);margin:0;border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border);width:50%}[dir=ltr] .ck.ck-link-form_layout-vertical .ck-button,[dir=rtl] .ck.ck-link-form_layout-vertical .ck-button{margin-left:0}[dir=rtl] .ck.ck-link-form_layout-vertical .ck-button:last-of-type{border-right:1px solid var(--ck-color-base-border)}.ck.ck-link-form_layout-vertical .ck.ck-list{margin:var(--ck-spacing-standard) var(--ck-spacing-large)}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton{border:0;padding:0;width:100%}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton:hover{background:none}"},function(l,h,w){var k=w(1),v=w(93);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var N={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(v,N),l.exports=v.locals||{}},function(l,h){l.exports=".ck.ck-link-actions{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-link-actions .ck-link-actions__preview{display:inline-block}.ck.ck-link-actions .ck-link-actions__preview .ck-button__label{overflow:hidden}@media screen and (max-width:600px){.ck.ck-link-actions{flex-wrap:wrap}.ck.ck-link-actions .ck-link-actions__preview{flex-basis:100%}.ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){flex-basis:50%}}.ck.ck-link-actions .ck-button.ck-link-actions__preview{padding-left:0;padding-right:0}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{padding:0 var(--ck-spacing-medium);color:var(--ck-color-link-default);text-overflow:ellipsis;cursor:pointer;max-width:var(--ck-input-text-width);min-width:3em;text-align:center}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label:hover{text-decoration:underline}.ck.ck-link-actions .ck-button.ck-link-actions__preview,.ck.ck-link-actions .ck-button.ck-link-actions__preview:active,.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus,.ck.ck-link-actions .ck-button.ck-link-actions__preview:hover{background:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:active{box-shadow:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus .ck-button__label{text-decoration:underline}[dir=ltr] .ck.ck-link-actions .ck-button:not(:first-child),[dir=rtl] .ck.ck-link-actions .ck-button:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-link-actions .ck-button.ck-link-actions__preview{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{min-width:0;max-width:100%}[dir=ltr] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview),[dir=rtl] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){margin-left:0}}"},function(l,h,w){var k=w(1),v=w(95);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var N={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(v,N),l.exports=v.locals||{}},function(l,h){l.exports='.ck-media__wrapper .ck-media__placeholder{display:flex;flex-direction:column;align-items:center}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url .ck-tooltip{display:block}@media (hover:none){.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url .ck-tooltip{display:none}}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url{max-width:100%;position:relative}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url:hover .ck-tooltip{visibility:visible;opacity:1}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url .ck-media__placeholder__url__text{overflow:hidden;display:block}.ck-media__wrapper[data-oembed-url*="facebook.com"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="goo.gl/maps"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="google.com/maps"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="maps.app.goo.gl"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="maps.google.com"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck-media__placeholder__icon *{display:none}.ck-editor__editable:not(.ck-read-only) .ck-media__wrapper>:not(.ck-media__placeholder),.ck-editor__editable:not(.ck-read-only) .ck-widget:not(.ck-widget_selected) .ck-media__placeholder{pointer-events:none}:root{--ck-media-embed-placeholder-icon-size:3em;--ck-color-media-embed-placeholder-url-text:#757575;--ck-color-media-embed-placeholder-url-text-hover:var(--ck-color-base-text)}.ck-media__wrapper{margin:0 auto}.ck-media__wrapper .ck-media__placeholder{padding:calc(var(--ck-spacing-standard)*3);background:var(--ck-color-base-foreground)}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__icon{min-width:var(--ck-media-embed-placeholder-icon-size);height:var(--ck-media-embed-placeholder-icon-size);margin-bottom:var(--ck-spacing-large);background-position:50%;background-size:cover}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__icon .ck-icon{width:100%;height:100%}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url__text{color:var(--ck-color-media-embed-placeholder-url-text);white-space:nowrap;text-align:center;font-style:italic;text-overflow:ellipsis}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url__text:hover{color:var(--ck-color-media-embed-placeholder-url-text-hover);cursor:pointer;text-decoration:underline}.ck-media__wrapper[data-oembed-url*="open.spotify.com"]{max-width:300px;max-height:380px}.ck-media__wrapper[data-oembed-url*="goo.gl/maps"] .ck-media__placeholder__icon,.ck-media__wrapper[data-oembed-url*="google.com/maps"] .ck-media__placeholder__icon,.ck-media__wrapper[data-oembed-url*="maps.app.goo.gl"] .ck-media__placeholder__icon,.ck-media__wrapper[data-oembed-url*="maps.google.com"] .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNTAuMzc4IiBoZWlnaHQ9IjI1NC4xNjciIHZpZXdCb3g9IjAgMCA2Ni4yNDYgNjcuMjQ4Ij48ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTcyLjUzMSAtMjE4LjQ1NSkgc2NhbGUoLjk4MDEyKSI+PHJlY3Qgcnk9IjUuMjM4IiByeD0iNS4yMzgiIHk9IjIzMS4zOTkiIHg9IjE3Ni4wMzEiIGhlaWdodD0iNjAuMDk5IiB3aWR0aD0iNjAuMDk5IiBmaWxsPSIjMzRhNjY4IiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjxwYXRoIGQ9Ik0yMDYuNDc3IDI2MC45bC0yOC45ODcgMjguOTg3YTUuMjE4IDUuMjE4IDAgMDAzLjc4IDEuNjFoNDkuNjIxYzEuNjk0IDAgMy4xOS0uNzk4IDQuMTQ2LTIuMDM3eiIgZmlsbD0iIzVjODhjNSIvPjxwYXRoIGQ9Ik0yMjYuNzQyIDIyMi45ODhjLTkuMjY2IDAtMTYuNzc3IDcuMTctMTYuNzc3IDE2LjAxNC4wMDcgMi43NjIuNjYzIDUuNDc0IDIuMDkzIDcuODc1LjQzLjcwMy44MyAxLjQwOCAxLjE5IDIuMTA3LjMzMy41MDIuNjUgMS4wMDUuOTUgMS41MDguMzQzLjQ3Ny42NzMuOTU3Ljk4OCAxLjQ0IDEuMzEgMS43NjkgMi41IDMuNTAyIDMuNjM3IDUuMTY4Ljc5MyAxLjI3NSAxLjY4MyAyLjY0IDIuNDY2IDMuOTkgMi4zNjMgNC4wOTQgNC4wMDcgOC4wOTIgNC42IDEzLjkxNHYuMDEyYy4xODIuNDEyLjUxNi42NjYuODc5LjY2Ny40MDMtLjAwMS43NjgtLjMxNC45My0uNzk5LjYwMy01Ljc1NiAyLjIzOC05LjcyOSA0LjU4NS0xMy43OTQuNzgyLTEuMzUgMS42NzMtMi43MTUgMi40NjUtMy45OSAxLjEzNy0xLjY2NiAyLjMyOC0zLjQgMy42MzgtNS4xNjkuMzE1LS40ODIuNjQ1LS45NjIuOTg4LTEuNDM5LjMtLjUwMy42MTctMS4wMDYuOTUtMS41MDguMzU5LS43Ljc2LTEuNDA0IDEuMTktMi4xMDcgMS40MjYtMi40MDIgMi01LjExNCAyLjAwNC03Ljg3NSAwLTguODQ0LTcuNTExLTE2LjAxNC0xNi43NzYtMTYuMDE0eiIgZmlsbD0iI2RkNGIzZSIgcGFpbnQtb3JkZXI9Im1hcmtlcnMgc3Ryb2tlIGZpbGwiLz48ZWxsaXBzZSByeT0iNS41NjQiIHJ4PSI1LjgyOCIgY3k9IjIzOS4wMDIiIGN4PSIyMjYuNzQyIiBmaWxsPSIjODAyZDI3IiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjxwYXRoIGQ9Ik0xOTAuMzAxIDIzNy4yODNjLTQuNjcgMC04LjQ1NyAzLjg1My04LjQ1NyA4LjYwNnMzLjc4NiA4LjYwNyA4LjQ1NyA4LjYwN2MzLjA0MyAwIDQuODA2LS45NTggNi4zMzctMi41MTYgMS41My0xLjU1NyAyLjA4Ny0zLjkxMyAyLjA4Ny02LjI5IDAtLjM2Mi0uMDIzLS43MjItLjA2NC0xLjA3OWgtOC4yNTd2My4wNDNoNC44NWMtLjE5Ny43NTktLjUzMSAxLjQ1LTEuMDU4IDEuOTg2LS45NDIuOTU4LTIuMDI4IDEuNTQ4LTMuOTAxIDEuNTQ4LTIuODc2IDAtNS4yMDgtMi4zNzItNS4yMDgtNS4yOTkgMC0yLjkyNiAyLjMzMi01LjI5OSA1LjIwOC01LjI5OSAxLjM5OSAwIDIuNjE4LjQwNyAzLjU4NCAxLjI5M2wyLjM4MS0yLjM4YzAtLjAwMi0uMDAzLS4wMDQtLjAwNC0uMDA1LTEuNTg4LTEuNTI0LTMuNjItMi4yMTUtNS45NTUtMi4yMTV6bTQuNDMgNS42NmwuMDAzLjAwNnYtLjAwM3oiIGZpbGw9IiNmZmYiIHBhaW50LW9yZGVyPSJtYXJrZXJzIHN0cm9rZSBmaWxsIi8+PHBhdGggZD0iTTIxNS4xODQgMjUxLjkyOWwtNy45OCA3Ljk3OSAyOC40NzcgMjguNDc1YTUuMjMzIDUuMjMzIDAgMDAuNDQ5LTIuMTIzdi0zMS4xNjVjLS40NjkuNjc1LS45MzQgMS4zNDktMS4zODIgMi4wMDUtLjc5MiAxLjI3NS0xLjY4MiAyLjY0LTIuNDY1IDMuOTktMi4zNDcgNC4wNjUtMy45ODIgOC4wMzgtNC41ODUgMTMuNzk0LS4xNjIuNDg1LS41MjcuNzk4LS45My43OTktLjM2My0uMDAxLS42OTctLjI1NS0uODc5LS42Njd2LS4wMTJjLS41OTMtNS44MjItMi4yMzctOS44Mi00LjYtMTMuOTE0LS43ODMtMS4zNS0xLjY3My0yLjcxNS0yLjQ2Ni0zLjk5LTEuMTM3LTEuNjY2LTIuMzI3LTMuNC0zLjYzNy01LjE2OWwtLjAwMi0uMDAzeiIgZmlsbD0iI2MzYzNjMyIvPjxwYXRoIGQ9Ik0yMTIuOTgzIDI0OC40OTVsLTM2Ljk1MiAzNi45NTN2LjgxMmE1LjIyNyA1LjIyNyAwIDAwNS4yMzggNS4yMzhoMS4wMTVsMzUuNjY2LTM1LjY2NmExMzYuMjc1IDEzNi4yNzUgMCAwMC0yLjc2NC0zLjkgMzcuNTc1IDM3LjU3NSAwIDAwLS45ODktMS40NCAzNS4xMjcgMzUuMTI3IDAgMDAtLjk1LTEuNTA4Yy0uMDgzLS4xNjItLjE3Ni0uMzI2LS4yNjQtLjQ4OXoiIGZpbGw9IiNmZGRjNGYiIHBhaW50LW9yZGVyPSJtYXJrZXJzIHN0cm9rZSBmaWxsIi8+PHBhdGggZD0iTTIxMS45OTggMjYxLjA4M2wtNi4xNTIgNi4xNTEgMjQuMjY0IDI0LjI2NGguNzgxYTUuMjI3IDUuMjI3IDAgMDA1LjIzOS01LjIzOHYtMS4wNDV6IiBmaWxsPSIjZmZmIiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjwvZz48L3N2Zz4=)}.ck-media__wrapper[data-oembed-url*="facebook.com"] .ck-media__placeholder{background:#4268b3}.ck-media__wrapper[data-oembed-url*="facebook.com"] .ck-media__placeholder .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAyNCIgaGVpZ2h0PSIxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik05NjcuNDg0IDBINTYuNTE3QzI1LjMwNCAwIDAgMjUuMzA0IDAgNTYuNTE3djkxMC45NjZDMCA5OTguNjk0IDI1LjI5NyAxMDI0IDU2LjUyMiAxMDI0SDU0N1Y2MjhINDE0VjQ3M2gxMzNWMzU5LjAyOWMwLTEzMi4yNjIgODAuNzczLTIwNC4yODIgMTk4Ljc1Ni0yMDQuMjgyIDU2LjUxMyAwIDEwNS4wODYgNC4yMDggMTE5LjI0NCA2LjA4OVYyOTlsLTgxLjYxNi4wMzdjLTYzLjk5MyAwLTc2LjM4NCAzMC40OTItNzYuMzg0IDc1LjIzNlY0NzNoMTUzLjQ4N2wtMTkuOTg2IDE1NUg3MDd2Mzk2aDI2MC40ODRjMzEuMjEzIDAgNTYuNTE2LTI1LjMwMyA1Ni41MTYtNTYuNTE2VjU2LjUxNUMxMDI0IDI1LjMwMyA5OTguNjk3IDAgOTY3LjQ4NCAwIiBmaWxsPSIjRkZGRkZFIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ck-media__wrapper[data-oembed-url*="facebook.com"] .ck-media__placeholder .ck-media__placeholder__url__text{color:#cdf}.ck-media__wrapper[data-oembed-url*="facebook.com"] .ck-media__placeholder .ck-media__placeholder__url__text:hover{color:#fff}.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder{background:linear-gradient(-135deg,#1400c7,#b800b1,#f50000)}.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTA0IiBoZWlnaHQ9IjUwNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PGRlZnM+PHBhdGggaWQ9ImEiIGQ9Ik0wIC4xNTloNTAzLjg0MVY1MDMuOTRIMHoiLz48L2RlZnM+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48bWFzayBpZD0iYiIgZmlsbD0iI2ZmZiI+PHVzZSB4bGluazpocmVmPSIjYSIvPjwvbWFzaz48cGF0aCBkPSJNMjUxLjkyMS4xNTljLTY4LjQxOCAwLTc2Ljk5Ny4yOS0xMDMuODY3IDEuNTE2LTI2LjgxNCAxLjIyMy00NS4xMjcgNS40ODItNjEuMTUxIDExLjcxLTE2LjU2NiA2LjQzNy0zMC42MTUgMTUuMDUxLTQ0LjYyMSAyOS4wNTYtMTQuMDA1IDE0LjAwNi0yMi42MTkgMjguMDU1LTI5LjA1NiA0NC42MjEtNi4yMjggMTYuMDI0LTEwLjQ4NyAzNC4zMzctMTEuNzEgNjEuMTUxQy4yOSAxNzUuMDgzIDAgMTgzLjY2MiAwIDI1Mi4wOGMwIDY4LjQxNy4yOSA3Ni45OTYgMS41MTYgMTAzLjg2NiAxLjIyMyAyNi44MTQgNS40ODIgNDUuMTI3IDExLjcxIDYxLjE1MSA2LjQzNyAxNi41NjYgMTUuMDUxIDMwLjYxNSAyOS4wNTYgNDQuNjIxIDE0LjAwNiAxNC4wMDUgMjguMDU1IDIyLjYxOSA0NC42MjEgMjkuMDU3IDE2LjAyNCA2LjIyNyAzNC4zMzcgMTAuNDg2IDYxLjE1MSAxMS43MDkgMjYuODcgMS4yMjYgMzUuNDQ5IDEuNTE2IDEwMy44NjcgMS41MTYgNjguNDE3IDAgNzYuOTk2LS4yOSAxMDMuODY2LTEuNTE2IDI2LjgxNC0xLjIyMyA0NS4xMjctNS40ODIgNjEuMTUxLTExLjcwOSAxNi41NjYtNi40MzggMzAuNjE1LTE1LjA1MiA0NC42MjEtMjkuMDU3IDE0LjAwNS0xNC4wMDYgMjIuNjE5LTI4LjA1NSAyOS4wNTctNDQuNjIxIDYuMjI3LTE2LjAyNCAxMC40ODYtMzQuMzM3IDExLjcwOS02MS4xNTEgMS4yMjYtMjYuODcgMS41MTYtMzUuNDQ5IDEuNTE2LTEwMy44NjYgMC02OC40MTgtLjI5LTc2Ljk5Ny0xLjUxNi0xMDMuODY3LTEuMjIzLTI2LjgxNC01LjQ4Mi00NS4xMjctMTEuNzA5LTYxLjE1MS02LjQzOC0xNi41NjYtMTUuMDUyLTMwLjYxNS0yOS4wNTctNDQuNjIxLTE0LjAwNi0xNC4wMDUtMjguMDU1LTIyLjYxOS00NC42MjEtMjkuMDU2LTE2LjAyNC02LjIyOC0zNC4zMzctMTAuNDg3LTYxLjE1MS0xMS43MUMzMjguOTE3LjQ0OSAzMjAuMzM4LjE1OSAyNTEuOTIxLjE1OXptMCA0NS4zOTFjNjcuMjY1IDAgNzUuMjMzLjI1NyAxMDEuNzk3IDEuNDY5IDI0LjU2MiAxLjEyIDM3LjkwMSA1LjIyNCA0Ni43NzggOC42NzQgMTEuNzU5IDQuNTcgMjAuMTUxIDEwLjAyOSAyOC45NjYgMTguODQ1IDguODE2IDguODE1IDE0LjI3NSAxNy4yMDcgMTguODQ1IDI4Ljk2NiAzLjQ1IDguODc3IDcuNTU0IDIyLjIxNiA4LjY3NCA0Ni43NzggMS4yMTIgMjYuNTY0IDEuNDY5IDM0LjUzMiAxLjQ2OSAxMDEuNzk4IDAgNjcuMjY1LS4yNTcgNzUuMjMzLTEuNDY5IDEwMS43OTctMS4xMiAyNC41NjItNS4yMjQgMzcuOTAxLTguNjc0IDQ2Ljc3OC00LjU3IDExLjc1OS0xMC4wMjkgMjAuMTUxLTE4Ljg0NSAyOC45NjYtOC44MTUgOC44MTYtMTcuMjA3IDE0LjI3NS0yOC45NjYgMTguODQ1LTguODc3IDMuNDUtMjIuMjE2IDcuNTU0LTQ2Ljc3OCA4LjY3NC0yNi41NiAxLjIxMi0zNC41MjcgMS40NjktMTAxLjc5NyAxLjQ2OS02Ny4yNzEgMC03NS4yMzctLjI1Ny0xMDEuNzk4LTEuNDY5LTI0LjU2Mi0xLjEyLTM3LjkwMS01LjIyNC00Ni43NzgtOC42NzQtMTEuNzU5LTQuNTctMjAuMTUxLTEwLjAyOS0yOC45NjYtMTguODQ1LTguODE1LTguODE1LTE0LjI3NS0xNy4yMDctMTguODQ1LTI4Ljk2Ni0zLjQ1LTguODc3LTcuNTU0LTIyLjIxNi04LjY3NC00Ni43NzgtMS4yMTItMjYuNTY0LTEuNDY5LTM0LjUzMi0xLjQ2OS0xMDEuNzk3IDAtNjcuMjY2LjI1Ny03NS4yMzQgMS40NjktMTAxLjc5OCAxLjEyLTI0LjU2MiA1LjIyNC0zNy45MDEgOC42NzQtNDYuNzc4IDQuNTctMTEuNzU5IDEwLjAyOS0yMC4xNTEgMTguODQ1LTI4Ljk2NiA4LjgxNS04LjgxNiAxNy4yMDctMTQuMjc1IDI4Ljk2Ni0xOC44NDUgOC44NzctMy40NSAyMi4yMTYtNy41NTQgNDYuNzc4LTguNjc0IDI2LjU2NC0xLjIxMiAzNC41MzItMS40NjkgMTAxLjc5OC0xLjQ2OXoiIGZpbGw9IiNGRkYiIG1hc2s9InVybCgjYikiLz48cGF0aCBkPSJNMjUxLjkyMSAzMzYuMDUzYy00Ni4zNzggMC04My45NzQtMzcuNTk2LTgzLjk3NC04My45NzMgMC00Ni4zNzggMzcuNTk2LTgzLjk3NCA4My45NzQtODMuOTc0IDQ2LjM3NyAwIDgzLjk3MyAzNy41OTYgODMuOTczIDgzLjk3NCAwIDQ2LjM3Ny0zNy41OTYgODMuOTczLTgzLjk3MyA4My45NzN6bTAtMjEzLjMzOGMtNzEuNDQ3IDAtMTI5LjM2NSA1Ny45MTgtMTI5LjM2NSAxMjkuMzY1IDAgNzEuNDQ2IDU3LjkxOCAxMjkuMzY0IDEyOS4zNjUgMTI5LjM2NCA3MS40NDYgMCAxMjkuMzY0LTU3LjkxOCAxMjkuMzY0LTEyOS4zNjQgMC03MS40NDctNTcuOTE4LTEyOS4zNjUtMTI5LjM2NC0xMjkuMzY1ek00MTYuNjI3IDExNy42MDRjMCAxNi42OTYtMTMuNTM1IDMwLjIzLTMwLjIzMSAzMC4yMy0xNi42OTUgMC0zMC4yMy0xMy41MzQtMzAuMjMtMzAuMjMgMC0xNi42OTYgMTMuNTM1LTMwLjIzMSAzMC4yMy0zMC4yMzEgMTYuNjk2IDAgMzAuMjMxIDEzLjUzNSAzMC4yMzEgMzAuMjMxIiBmaWxsPSIjRkZGIi8+PC9nPjwvc3ZnPg==)}.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder .ck-media__placeholder__url__text{color:#ffe0fe}.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder .ck-media__placeholder__url__text:hover{color:#fff}.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck.ck-media__placeholder{background:linear-gradient(90deg,#71c6f4,#0d70a5)}.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck.ck-media__placeholder .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0MDAgNDAwIj48cGF0aCBkPSJNNDAwIDIwMGMwIDExMC41LTg5LjUgMjAwLTIwMCAyMDBTMCAzMTAuNSAwIDIwMCA4OS41IDAgMjAwIDBzMjAwIDg5LjUgMjAwIDIwMHpNMTYzLjQgMzA1LjVjODguNyAwIDEzNy4yLTczLjUgMTM3LjItMTM3LjIgMC0yLjEgMC00LjItLjEtNi4yIDkuNC02LjggMTcuNi0xNS4zIDI0LjEtMjUtOC42IDMuOC0xNy45IDYuNC0yNy43IDcuNiAxMC02IDE3LjYtMTUuNCAyMS4yLTI2LjctOS4zIDUuNS0xOS42IDkuNS0zMC42IDExLjctOC44LTkuNC0yMS4zLTE1LjItMzUuMi0xNS4yLTI2LjYgMC00OC4yIDIxLjYtNDguMiA0OC4yIDAgMy44LjQgNy41IDEuMyAxMS00MC4xLTItNzUuNi0yMS4yLTk5LjQtNTAuNC00LjEgNy4xLTYuNSAxNS40LTYuNSAyNC4yIDAgMTYuNyA4LjUgMzEuNSAyMS41IDQwLjEtNy45LS4yLTE1LjMtMi40LTIxLjgtNnYuNmMwIDIzLjQgMTYuNiA0Mi44IDM4LjcgNDcuMy00IDEuMS04LjMgMS43LTEyLjcgMS43LTMuMSAwLTYuMS0uMy05LjEtLjkgNi4xIDE5LjIgMjMuOSAzMy4xIDQ1IDMzLjUtMTYuNSAxMi45LTM3LjMgMjAuNi01OS45IDIwLjYtMy45IDAtNy43LS4yLTExLjUtLjcgMjEuMSAxMy44IDQ2LjUgMjEuOCA3My43IDIxLjgiIGZpbGw9IiNmZmYiLz48L3N2Zz4=)}.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck.ck-media__placeholder .ck-media__placeholder__url__text{color:#b8e6ff}.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck.ck-media__placeholder .ck-media__placeholder__url__text:hover{color:#fff}'},function(l,h,w){var k=w(1),v=w(97);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var N={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(v,N),l.exports=v.locals||{}},function(l,h){l.exports=".ck.ck-media-form{display:flex;align-items:flex-start;flex-direction:row;flex-wrap:nowrap}.ck.ck-media-form .ck-labeled-field-view{display:inline-block}.ck.ck-media-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-media-form{flex-wrap:wrap}.ck.ck-media-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-media-form .ck-button{flex-basis:50%}}"},function(l,h,w){var k=w(1),v=w(99);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var N={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(v,N),l.exports=v.locals||{}},function(l,h){l.exports=".ck-content .media{clear:both;margin:.9em 0;display:block;min-width:15em}"},function(l,h,w){var k=w(1),v=w(101);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var N={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(v,N),l.exports=v.locals||{}},function(l,h){l.exports=":root{--ck-color-table-focused-cell-background:rgba(158,207,250,0.3)}.ck-widget.table td.ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck-widget.table td.ck-editor__nested-editable:focus,.ck-widget.table th.ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck-widget.table th.ck-editor__nested-editable:focus{background:var(--ck-color-table-focused-cell-background);border-style:none;outline:1px solid var(--ck-color-focus-border);outline-offset:-1px}"},function(l,h,w){var k=w(1),v=w(103);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var N={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(v,N),l.exports=v.locals||{}},function(l,h){l.exports=".ck .ck-insert-table-dropdown__grid{display:flex;flex-direction:row;flex-wrap:wrap}:root{--ck-insert-table-dropdown-padding:10px;--ck-insert-table-dropdown-box-height:11px;--ck-insert-table-dropdown-box-width:12px;--ck-insert-table-dropdown-box-margin:1px}.ck .ck-insert-table-dropdown__grid{width:calc(var(--ck-insert-table-dropdown-box-width)*10 + var(--ck-insert-table-dropdown-box-margin)*20 + var(--ck-insert-table-dropdown-padding)*2);padding:var(--ck-insert-table-dropdown-padding) var(--ck-insert-table-dropdown-padding) 0}.ck .ck-insert-table-dropdown__label{text-align:center}.ck .ck-insert-table-dropdown-grid-box{width:var(--ck-insert-table-dropdown-box-width);height:var(--ck-insert-table-dropdown-box-height);margin:var(--ck-insert-table-dropdown-box-margin);border:1px solid var(--ck-color-base-border);border-radius:1px}.ck .ck-insert-table-dropdown-grid-box.ck-on{border-color:var(--ck-color-focus-border);background:var(--ck-color-focus-outer-shadow)}"},function(l,h,w){var k=w(1),v=w(105);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var N={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(v,N),l.exports=v.locals||{}},function(l,h){l.exports=':root{--ck-table-selected-cell-background:rgba(158,207,250,0.3)}.ck.ck-editor__editable .table table td.ck-editor__editable_selected,.ck.ck-editor__editable .table table th.ck-editor__editable_selected{position:relative;caret-color:transparent;outline:unset;box-shadow:unset}.ck.ck-editor__editable .table table td.ck-editor__editable_selected:after,.ck.ck-editor__editable .table table th.ck-editor__editable_selected:after{content:"";pointer-events:none;background-color:var(--ck-table-selected-cell-background);position:absolute;top:0;left:0;right:0;bottom:0}.ck.ck-editor__editable .table table td.ck-editor__editable_selected ::selection,.ck.ck-editor__editable .table table td.ck-editor__editable_selected:focus,.ck.ck-editor__editable .table table th.ck-editor__editable_selected ::selection,.ck.ck-editor__editable .table table th.ck-editor__editable_selected:focus{background-color:transparent}.ck.ck-editor__editable .table table td.ck-editor__editable_selected .ck-widget_selected,.ck.ck-editor__editable .table table th.ck-editor__editable_selected .ck-widget_selected{outline:unset}'},function(l,h,w){var k=w(1),v=w(107);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var N={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(v,N),l.exports=v.locals||{}},function(l,h){l.exports=".ck-content .table{margin:.9em auto;display:table}.ck-content .table table{border-collapse:collapse;border-spacing:0;width:100%;height:100%;border:1px double #b3b3b3}.ck-content .table table td,.ck-content .table table th{min-width:2em;padding:.4em;border:1px solid #bfbfbf}.ck-content .table table th{font-weight:700;background:hsla(0,0%,0%,5%)}.ck-content[dir=rtl] .table th{text-align:right}.ck-content[dir=ltr] .table th{text-align:left}.ck-editor__editable .ck-table-bogus-paragraph{display:inline-block;width:100%}"},function(l,h,w){w.r(h),w.d(h,"default",function(){return Cv});var k=function(){return function i(){i.called=!0}};class v{constructor(e,t){this.source=e,this.name=t,this.path=[],this.stop=k(),this.off=k()}}const N=new Array(256).fill().map((i,e)=>("0"+e.toString(16)).slice(-2));function S(){const i=4294967296*Math.random()>>>0,e=4294967296*Math.random()>>>0,t=4294967296*Math.random()>>>0,n=4294967296*Math.random()>>>0;return"e"+N[i>>0&255]+N[i>>8&255]+N[i>>16&255]+N[i>>24&255]+N[e>>0&255]+N[e>>8&255]+N[e>>16&255]+N[e>>24&255]+N[t>>0&255]+N[t>>8&255]+N[t>>16&255]+N[t>>24&255]+N[n>>0&255]+N[n>>8&255]+N[n>>16&255]+N[n>>24&255]}var O={get(i){return typeof i!="number"?this[i]||this.normal:i},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5},C=(w(6),w(0));const L=Symbol("listeningTo"),j=Symbol("emitterId");var F={on(i,e,t={}){this.listenTo(this,i,e,t)},once(i,e,t){let n=!1;this.listenTo(this,i,function(o,...r){n||(n=!0,o.off(),e.call(this,o,...r))},t)},off(i,e){this.stopListening(this,i,e)},listenTo(i,e,t,n={}){let o,r;this[L]||(this[L]={});const a=this[L];K(i)||q(i);const c=K(i);(o=a[c])||(o=a[c]={emitter:i,callbacks:{}}),(r=o.callbacks[e])||(r=o.callbacks[e]=[]),r.push(t),function(d,m,b,_,T){m._addEventListener?m._addEventListener(b,_,T):d._addEventListener.call(m,b,_,T)}(this,i,e,t,n)},stopListening(i,e,t){const n=this[L];let o=i&&K(i);const r=n&&o&&n[o],a=r&&e&&r.callbacks[e];if(!(!n||i&&!r||e&&!a))if(t)Y(this,i,e,t),a.indexOf(t)!==-1&&(a.length===1?delete r.callbacks[e]:Y(this,i,e,t));else if(a){for(;t=a.pop();)Y(this,i,e,t);delete r.callbacks[e]}else if(r){for(e in r.callbacks)this.stopListening(i,e);delete n[o]}else{for(o in n)this.stopListening(n[o].emitter);delete this[L]}},fire(i,...e){try{const t=i instanceof v?i:new v(this,i),n=t.name;let o=function r(a,c){let d;return!a._events||!(d=a._events[c])||!d.callbacks.length?c.indexOf(":")>-1?r(a,c.substr(0,c.lastIndexOf(":"))):null:d.callbacks}(this,n);if(t.path.push(this),o){const r=[t,...e];o=Array.from(o);for(let a=0;a<o.length&&(o[a].callback.apply(this,r),t.off.called&&(delete t.off.called,this._removeEventListener(n,o[a].callback)),!t.stop.called);a++);}if(this._delegations){const r=this._delegations.get(n),a=this._delegations.get("*");r&&Z(r,t,e),a&&Z(a,t,e)}return t.return}catch(t){C.a.rethrowUnexpectedError(t,this)}},delegate(...i){return{to:(e,t)=>{this._delegations||(this._delegations=new Map),i.forEach(n=>{const o=this._delegations.get(n);o?o.set(e,t):this._delegations.set(n,new Map([[e,t]]))})}}},stopDelegating(i,e){if(this._delegations)if(i)if(e){const t=this._delegations.get(i);t&&t.delete(e)}else this._delegations.delete(i);else this._delegations.clear()},_addEventListener(i,e,t){(function(a,c){const d=te(a);if(d[c])return;let m=c,b=null;const _=[];for(;m!==""&&!d[m];)d[m]={callbacks:[],childEvents:[]},_.push(d[m]),b&&d[m].childEvents.push(b),b=m,m=m.substr(0,m.lastIndexOf(":"));if(m!==""){for(const T of _)T.callbacks=d[m].callbacks.slice();d[m].childEvents.push(b)}})(this,i);const n=se(this,i),o=O.get(t.priority),r={callback:e,priority:o};for(const a of n){let c=!1;for(let d=0;d<a.length;d++)if(a[d].priority<o){a.splice(d,0,r),c=!0;break}c||a.push(r)}},_removeEventListener(i,e){const t=se(this,i);for(const n of t)for(let o=0;o<n.length;o++)n[o].callback==e&&(n.splice(o,1),o--)}};function q(i,e){i[j]||(i[j]=e||S())}function K(i){return i[j]}function te(i){return i._events||Object.defineProperty(i,"_events",{value:{}}),i._events}function se(i,e){const t=te(i)[e];if(!t)return[];let n=[t.callbacks];for(let o=0;o<t.childEvents.length;o++){const r=se(i,t.childEvents[o]);n=n.concat(r)}return n}function Z(i,e,t){for(let[n,o]of i){o?typeof o=="function"&&(o=o(e.name)):o=e.name;const r=new v(e.source,o);r.path=[...e.path],n.fire(r,...t)}}function Y(i,e,t,n){e._removeEventListener?e._removeEventListener(t,n):i._removeEventListener.call(e,t,n)}var oe=function(i){var e=typeof i;return i!=null&&(e=="object"||e=="function")},ie=w(3),ge=ie.a.Symbol,de=Object.prototype,je=de.hasOwnProperty,Ie=de.toString,Pe=ge?ge.toStringTag:void 0,ce=function(i){var e=je.call(i,Pe),t=i[Pe];try{i[Pe]=void 0;var n=!0}catch{}var o=Ie.call(i);return n&&(e?i[Pe]=t:delete i[Pe]),o},ae=Object.prototype.toString,be=function(i){return ae.call(i)},ke=ge?ge.toStringTag:void 0,_e=function(i){return i==null?i===void 0?"[object Undefined]":"[object Null]":ke&&ke in Object(i)?ce(i):be(i)},Ee,Se=function(i){if(!oe(i))return!1;var e=_e(i);return e=="[object Function]"||e=="[object GeneratorFunction]"||e=="[object AsyncFunction]"||e=="[object Proxy]"},Oe=ie.a["__core-js_shared__"],rt=(Ee=/[^.]+$/.exec(Oe&&Oe.keys&&Oe.keys.IE_PROTO||""))?"Symbol(src)_1."+Ee:"",De=function(i){return!!rt&&rt in i},Fe=Function.prototype.toString,mt=function(i){if(i!=null){try{return Fe.call(i)}catch{}try{return i+""}catch{}}return""},Ne=/^\[object .+?Constructor\]$/,Le=Function.prototype,qe=Object.prototype,$e=Le.toString,tt=qe.hasOwnProperty,nt=RegExp("^"+$e.call(tt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ue=function(i){return!(!oe(i)||De(i))&&(Se(i)?nt:Ne).test(mt(i))},We=function(i,e){return i==null?void 0:i[e]},et=function(i,e){var t=We(i,e);return Ue(t)?t:void 0},Ut=function(){try{var i=et(Object,"defineProperty");return i({},"",{}),i}catch{}}(),en=function(i,e,t){e=="__proto__"&&Ut?Ut(i,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):i[e]=t},we=function(i,e){return i===e||i!=i&&e!=e},Re=Object.prototype.hasOwnProperty,ct=function(i,e,t){var n=i[e];Re.call(i,e)&&we(n,t)&&(t!==void 0||e in i)||en(i,e,t)},st=function(i,e,t,n){var o=!t;t||(t={});for(var r=-1,a=e.length;++r<a;){var c=e[r],d=n?n(t[c],i[c],c,t,i):void 0;d===void 0&&(d=i[c]),o?en(t,c,d):ct(t,c,d)}return t},Bt=function(i){return i},xn=function(i,e,t){switch(t.length){case 0:return i.call(e);case 1:return i.call(e,t[0]);case 2:return i.call(e,t[0],t[1]);case 3:return i.call(e,t[0],t[1],t[2])}return i.apply(e,t)},ln=Math.max,jt=function(i,e,t){return e=ln(e===void 0?i.length-1:e,0),function(){for(var n=arguments,o=-1,r=ln(n.length-e,0),a=Array(r);++o<r;)a[o]=n[e+o];o=-1;for(var c=Array(e+1);++o<e;)c[o]=n[o];return c[e]=t(a),xn(i,this,c)}},Wo=function(i){return function(){return i}},or=Ut?function(i,e){return Ut(i,"toString",{configurable:!0,enumerable:!1,value:Wo(e),writable:!0})}:Bt,gn=Date.now,ai=function(i){var e=0,t=0;return function(){var n=gn(),o=16-(n-t);if(t=n,o>0){if(++e>=800)return arguments[0]}else e=0;return i.apply(void 0,arguments)}}(or),ea=function(i,e){return ai(jt(i,e,Bt),i+"")},li=function(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=9007199254740991},go=function(i){return i!=null&&li(i.length)&&!Se(i)},jr=/^(?:0|[1-9]\d*)$/,Oi=function(i,e){var t=typeof i;return!!(e=e??9007199254740991)&&(t=="number"||t!="symbol"&&jr.test(i))&&i>-1&&i%1==0&&i<e},Ir=function(i,e,t){if(!oe(t))return!1;var n=typeof e;return!!(n=="number"?go(t)&&Oi(e,t.length):n=="string"&&e in t)&&we(t[e],i)},Ri=function(i){return ea(function(e,t){var n=-1,o=t.length,r=o>1?t[o-1]:void 0,a=o>2?t[2]:void 0;for(r=i.length>3&&typeof r=="function"?(o--,r):void 0,a&&Ir(t[0],t[1],a)&&(r=o<3?void 0:r,o=1),e=Object(e);++n<o;){var c=t[n];c&&i(e,c,n,r)}return e})},bo=function(i,e){for(var t=-1,n=Array(i);++t<i;)n[t]=e(t);return n},ft=function(i){return i!=null&&typeof i=="object"},Jt=function(i){return ft(i)&&_e(i)=="[object Arguments]"},mn=Object.prototype,bn=mn.hasOwnProperty,An=mn.propertyIsEnumerable,jn=Jt(function(){return arguments}())?Jt:function(i){return ft(i)&&bn.call(i,"callee")&&!An.call(i,"callee")},cn=Array.isArray,Io=w(4),xt={};xt["[object Float32Array]"]=xt["[object Float64Array]"]=xt["[object Int8Array]"]=xt["[object Int16Array]"]=xt["[object Int32Array]"]=xt["[object Uint8Array]"]=xt["[object Uint8ClampedArray]"]=xt["[object Uint16Array]"]=xt["[object Uint32Array]"]=!0,xt["[object Arguments]"]=xt["[object Array]"]=xt["[object ArrayBuffer]"]=xt["[object Boolean]"]=xt["[object DataView]"]=xt["[object Date]"]=xt["[object Error]"]=xt["[object Function]"]=xt["[object Map]"]=xt["[object Number]"]=xt["[object Object]"]=xt["[object RegExp]"]=xt["[object Set]"]=xt["[object String]"]=xt["[object WeakMap]"]=!1;var ci=function(i){return ft(i)&&li(i.length)&&!!xt[_e(i)]},ms=function(i){return function(e){return i(e)}},ir=w(5),Sl=ir.a&&ir.a.isTypedArray,Vi=Sl?ms(Sl):ci,yu=Object.prototype.hasOwnProperty,Dl=function(i,e){var t=cn(i),n=!t&&jn(i),o=!t&&!n&&Object(Io.a)(i),r=!t&&!n&&!o&&Vi(i),a=t||n||o||r,c=a?bo(i.length,String):[],d=c.length;for(var m in i)!e&&!yu.call(i,m)||a&&(m=="length"||o&&(m=="offset"||m=="parent")||r&&(m=="buffer"||m=="byteLength"||m=="byteOffset")||Oi(m,d))||c.push(m);return c},xu=Object.prototype,Pr=function(i){var e=i&&i.constructor;return i===(typeof e=="function"&&e.prototype||xu)},rr=function(i){var e=[];if(i!=null)for(var t in Object(i))e.push(t);return e},ta=Object.prototype.hasOwnProperty,Nu=function(i){if(!oe(i))return rr(i);var e=Pr(i),t=[];for(var n in i)(n!="constructor"||!e&&ta.call(i,n))&&t.push(n);return t},vo=function(i){return go(i)?Dl(i,!0):Nu(i)},Mr=Ri(function(i,e){st(e,vo(e),i)});const fs=Symbol("observableProperties"),Or=Symbol("boundObservables"),Rr=Symbol("boundProperties"),sr=Symbol("decoratedMethods"),na=Symbol("decoratedOriginal"),Li={set(i,e){if(oe(i))return void Object.keys(i).forEach(n=>{this.set(n,i[n])},this);oa(this);const t=this[fs];if(i in this&&!t.has(i))throw new C.a("observable-set-cannot-override",this);Object.defineProperty(this,i,{enumerable:!0,configurable:!0,get:()=>t.get(i),set(n){const o=t.get(i);let r=this.fire("set:"+i,i,n,o);r===void 0&&(r=n),o===r&&t.has(i)||(t.set(i,r),this.fire("change:"+i,i,r,o))}}),this[i]=e},bind(...i){if(!i.length||!Il(i))throw new C.a("observable-bind-wrong-properties",this);if(new Set(i).size!==i.length)throw new C.a("observable-bind-duplicate-properties",this);oa(this);const e=this[Rr];i.forEach(n=>{if(e.has(n))throw new C.a("observable-bind-rebind",this)});const t=new Map;return i.forEach(n=>{const o={property:n,to:[]};e.set(n,o),t.set(n,o)}),{to:jl,toMany:Tu,_observable:this,_bindProperties:i,_to:[],_bindings:t}},unbind(...i){if(!this[fs])return;const e=this[Rr],t=this[Or];if(i.length){if(!Il(i))throw new C.a("observable-unbind-wrong-properties",this);i.forEach(n=>{const o=e.get(n);if(!o)return;let r,a,c,d;o.to.forEach(m=>{r=m[0],a=m[1],c=t.get(r),d=c[a],d.delete(o),d.size||delete c[a],Object.keys(c).length||(t.delete(r),this.stopListening(r,"change"))}),e.delete(n)})}else t.forEach((n,o)=>{this.stopListening(o,"change")}),t.clear(),e.clear()},decorate(i){const e=this[i];if(!e)throw new C.a("observablemixin-cannot-decorate-undefined",this,{object:this,methodName:i});this.on(i,(t,n)=>{t.return=e.apply(this,n)}),this[i]=function(...t){return this.fire(i,t)},this[i][na]=e,this[sr]||(this[sr]=[]),this[sr].push(i)}};Mr(Li,F),Li.stopListening=function(i,e,t){if(!i&&this[sr]){for(const n of this[sr])this[n]=this[n][na];delete this[sr]}F.stopListening.call(this,i,e,t)};var Wt=Li;function oa(i){i[fs]||(Object.defineProperty(i,fs,{value:new Map}),Object.defineProperty(i,Or,{value:new Map}),Object.defineProperty(i,Rr,{value:new Map}))}function jl(...i){const e=function(...r){if(!r.length)throw new C.a("observable-bind-to-parse-error",null);const a={to:[]};let c;return typeof r[r.length-1]=="function"&&(a.callback=r.pop()),r.forEach(d=>{if(typeof d=="string")c.properties.push(d);else{if(typeof d!="object")throw new C.a("observable-bind-to-parse-error",null);c={observable:d,properties:[]},a.to.push(c)}}),a}(...i),t=Array.from(this._bindings.keys()),n=t.length;if(!e.callback&&e.to.length>1)throw new C.a("observable-bind-to-no-callback",this);if(n>1&&e.callback)throw new C.a("observable-bind-to-extra-callback",this);var o;e.to.forEach(r=>{if(r.properties.length&&r.properties.length!==n)throw new C.a("observable-bind-to-properties-length",this);r.properties.length||(r.properties=this._bindProperties)}),this._to=e.to,e.callback&&(this._bindings.get(t[0]).callback=e.callback),o=this._observable,this._to.forEach(r=>{const a=o[Or];let c;a.get(r.observable)||o.listenTo(r.observable,"change",(d,m)=>{c=a.get(r.observable)[m],c&&c.forEach(b=>{Pl(o,b.property)})})}),function(r){let a;r._bindings.forEach((c,d)=>{r._to.forEach(m=>{a=m.properties[c.callback?0:r._bindProperties.indexOf(d)],c.to.push([m.observable,a]),function(b,_,T,E){const P=b[Or],R=P.get(T),z=R||{};z[E]||(z[E]=new Set),z[E].add(_),R||P.set(T,z)}(r._observable,c,m.observable,a)})})}(this),this._bindProperties.forEach(r=>{Pl(this._observable,r)})}function Tu(i,e,t){if(this._bindings.size>1)throw new C.a("observable-bind-to-many-not-one-binding",this);this.to(...function(n,o){const r=n.map(a=>[a,o]);return Array.prototype.concat.apply([],r)}(i,e),t)}function Il(i){return i.every(e=>typeof e=="string")}function Pl(i,e){const t=i[Rr].get(e);let n;t.callback?n=t.callback.apply(i,t.to.map(o=>o[0][o[1]])):(n=t.to[0],n=n[0][n[1]]),Object.prototype.hasOwnProperty.call(i,e)?i[e]=n:i.set(e,n)}function Be(i,...e){e.forEach(t=>{Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t)).forEach(n=>{if(n in i.prototype)return;const o=Object.getOwnPropertyDescriptor(t,n);o.enumerable=!1,Object.defineProperty(i.prototype,n,o)})})}class ve{constructor(e){this.editor=e,this.set("isEnabled",!0),this._disableStack=new Set}forceDisabled(e){this._disableStack.add(e),this._disableStack.size==1&&(this.on("set:isEnabled",ar,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),this._disableStack.size==0&&(this.off("set:isEnabled",ar),this.isEnabled=!0)}destroy(){this.stopListening()}static get isContextPlugin(){return!1}}function ar(i){i.return=!1,i.stop()}Be(ve,Wt);class pt{constructor(e){this.editor=e,this.set("value",void 0),this.set("isEnabled",!1),this._disableStack=new Set,this.decorate("execute"),this.listenTo(this.editor.model.document,"change",()=>{this.refresh()}),this.on("execute",t=>{this.isEnabled||t.stop()},{priority:"high"}),this.listenTo(e,"change:isReadOnly",(t,n,o)=>{o?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")})}refresh(){this.isEnabled=!0}forceDisabled(e){this._disableStack.add(e),this._disableStack.size==1&&(this.on("set:isEnabled",ia,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),this._disableStack.size==0&&(this.off("set:isEnabled",ia),this.refresh())}execute(){}destroy(){this.stopListening()}}function ia(i){i.return=!1,i.stop()}Be(pt,Wt);class ra extends pt{constructor(e){super(e),this._childCommands=[]}refresh(){}execute(...e){const t=this._getFirstEnabledCommand();return t!=null&&t.execute(e)}registerChildCommand(e){this._childCommands.push(e),e.on("change:isEnabled",()=>this._checkEnabled()),this._checkEnabled()}_checkEnabled(){this.isEnabled=!!this._getFirstEnabledCommand()}_getFirstEnabledCommand(){return this._childCommands.find(e=>e.isEnabled)}}var sa=function(i,e){return function(t){return i(e(t))}},ps=sa(Object.getPrototypeOf,Object),aa=Function.prototype,Kt=Object.prototype,Ml=aa.toString,la=Kt.hasOwnProperty,Ol=Ml.call(Object),Nn=function(i){if(!ft(i)||_e(i)!="[object Object]")return!1;var e=ps(i);if(e===null)return!0;var t=la.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&Ml.call(t)==Ol},gs=function(){this.__data__=[],this.size=0},Po=function(i,e){for(var t=i.length;t--;)if(we(i[t][0],e))return t;return-1},bs=Array.prototype.splice,Cu=function(i){var e=this.__data__,t=Po(e,i);return!(t<0)&&(t==e.length-1?e.pop():bs.call(e,t,1),--this.size,!0)},Rl=function(i){var e=this.__data__,t=Po(e,i);return t<0?void 0:e[t][1]},Vr=function(i){return Po(this.__data__,i)>-1},Vl=function(i,e){var t=this.__data__,n=Po(t,i);return n<0?(++this.size,t.push([i,e])):t[n][1]=e,this};function ui(i){var e=-1,t=i==null?0:i.length;for(this.clear();++e<t;){var n=i[e];this.set(n[0],n[1])}}ui.prototype.clear=gs,ui.prototype.delete=Cu,ui.prototype.get=Rl,ui.prototype.has=Vr,ui.prototype.set=Vl;var lr=ui,Ll=function(){this.__data__=new lr,this.size=0},ca=function(i){var e=this.__data__,t=e.delete(i);return this.size=e.size,t},Eu=function(i){return this.__data__.get(i)},ua=function(i){return this.__data__.has(i)},Ko=et(ie.a,"Map"),zi=et(Object,"create"),cr=function(){this.__data__=zi?zi(null):{},this.size=0},zl=function(i){var e=this.has(i)&&delete this.__data__[i];return this.size-=e?1:0,e},Bl=Object.prototype.hasOwnProperty,da=function(i){var e=this.__data__;if(zi){var t=e[i];return t==="__lodash_hash_undefined__"?void 0:t}return Bl.call(e,i)?e[i]:void 0},Fl=Object.prototype.hasOwnProperty,ha=function(i){var e=this.__data__;return zi?e[i]!==void 0:Fl.call(e,i)},ma=function(i,e){var t=this.__data__;return this.size+=this.has(i)?0:1,t[i]=zi&&e===void 0?"__lodash_hash_undefined__":e,this};function di(i){var e=-1,t=i==null?0:i.length;for(this.clear();++e<t;){var n=i[e];this.set(n[0],n[1])}}di.prototype.clear=cr,di.prototype.delete=zl,di.prototype.get=da,di.prototype.has=ha,di.prototype.set=ma;var fa=di,Au=function(){this.size=0,this.__data__={hash:new fa,map:new(Ko||lr),string:new fa}},Su=function(i){var e=typeof i;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?i!=="__proto__":i===null},Lr=function(i,e){var t=i.__data__;return Su(e)?t[typeof e=="string"?"string":"hash"]:t.map},ql=function(i){var e=Lr(this,i).delete(i);return this.size-=e?1:0,e},Du=function(i){return Lr(this,i).get(i)},Hl=function(i){return Lr(this,i).has(i)},pa=function(i,e){var t=Lr(this,i),n=t.size;return t.set(i,e),this.size+=t.size==n?0:1,this};function hi(i){var e=-1,t=i==null?0:i.length;for(this.clear();++e<t;){var n=i[e];this.set(n[0],n[1])}}hi.prototype.clear=Au,hi.prototype.delete=ql,hi.prototype.get=Du,hi.prototype.has=Hl,hi.prototype.set=pa;var zr=hi,ga=function(i,e){var t=this.__data__;if(t instanceof lr){var n=t.__data__;if(!Ko||n.length<199)return n.push([i,e]),this.size=++t.size,this;t=this.__data__=new zr(n)}return t.set(i,e),this.size=t.size,this};function Bi(i){var e=this.__data__=new lr(i);this.size=e.size}Bi.prototype.clear=Ll,Bi.prototype.delete=ca,Bi.prototype.get=Eu,Bi.prototype.has=ua,Bi.prototype.set=ga;var Br=Bi,$l=function(i,e){for(var t=-1,n=i==null?0:i.length;++t<n&&e(i[t],t,i)!==!1;);return i},Gt=sa(Object.keys,Object),Ft=Object.prototype.hasOwnProperty,ba=function(i){if(!Pr(i))return Gt(i);var e=[];for(var t in Object(i))Ft.call(i,t)&&t!="constructor"&&e.push(t);return e},Fr=function(i){return go(i)?Dl(i):ba(i)},va=function(i,e){return i&&st(e,Fr(e),i)},wa=function(i,e){return i&&st(e,vo(e),i)},ka=w(9),_a=function(i,e){var t=-1,n=i.length;for(e||(e=Array(n));++t<n;)e[t]=i[t];return e},ya=function(i,e){for(var t=-1,n=i==null?0:i.length,o=0,r=[];++t<n;){var a=i[t];e(a,t,i)&&(r[o++]=a)}return r},xa=function(){return[]},vn=Object.prototype.propertyIsEnumerable,vs=Object.getOwnPropertySymbols,Go=vs?function(i){return i==null?[]:(i=Object(i),ya(vs(i),function(e){return vn.call(i,e)}))}:xa,Ul=function(i,e){return st(i,Go(i),e)},ws=function(i,e){for(var t=-1,n=e.length,o=i.length;++t<n;)i[o+t]=e[t];return i},Qn=Object.getOwnPropertySymbols?function(i){for(var e=[];i;)ws(e,Go(i)),i=ps(i);return e}:xa,mi=function(i,e){return st(i,Qn(i),e)},qr=function(i,e,t){var n=e(i);return cn(i)?n:ws(n,t(i))},ks=function(i){return qr(i,Fr,Go)},Wl=function(i){return qr(i,vo,Qn)},Hr=et(ie.a,"DataView"),ur=et(ie.a,"Promise"),In=et(ie.a,"Set"),Na=et(ie.a,"WeakMap"),oo=mt(Hr),Kl=mt(Ko),Ta=mt(ur),fi=mt(In),_s=mt(Na),Qo=_e;(Hr&&Qo(new Hr(new ArrayBuffer(1)))!="[object DataView]"||Ko&&Qo(new Ko)!="[object Map]"||ur&&Qo(ur.resolve())!="[object Promise]"||In&&Qo(new In)!="[object Set]"||Na&&Qo(new Na)!="[object WeakMap]")&&(Qo=function(i){var e=_e(i),t=e=="[object Object]"?i.constructor:void 0,n=t?mt(t):"";if(n)switch(n){case oo:return"[object DataView]";case Kl:return"[object Map]";case Ta:return"[object Promise]";case fi:return"[object Set]";case _s:return"[object WeakMap]"}return e});var At=Qo,pi=Object.prototype.hasOwnProperty,Ca=function(i){var e=i.length,t=new i.constructor(e);return e&&typeof i[0]=="string"&&pi.call(i,"index")&&(t.index=i.index,t.input=i.input),t},ys=ie.a.Uint8Array,dr=function(i){var e=new i.constructor(i.byteLength);return new ys(e).set(new ys(i)),e},ju=function(i,e){var t=e?dr(i.buffer):i.buffer;return new i.constructor(t,i.byteOffset,i.byteLength)},Iu=/\w*$/,Gl=function(i){var e=new i.constructor(i.source,Iu.exec(i));return e.lastIndex=i.lastIndex,e},Ea=ge?ge.prototype:void 0,hr=Ea?Ea.valueOf:void 0,Fi=function(i){return hr?Object(hr.call(i)):{}},Ql=function(i,e){var t=e?dr(i.buffer):i.buffer;return new i.constructor(t,i.byteOffset,i.length)},Mt=function(i,e,t){var n=i.constructor;switch(e){case"[object ArrayBuffer]":return dr(i);case"[object Boolean]":case"[object Date]":return new n(+i);case"[object DataView]":return ju(i,t);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return Ql(i,t);case"[object Map]":return new n;case"[object Number]":case"[object String]":return new n(i);case"[object RegExp]":return Gl(i);case"[object Set]":return new n;case"[object Symbol]":return Fi(i)}},Aa=Object.create,Sa=function(){function i(){}return function(e){if(!oe(e))return{};if(Aa)return Aa(e);i.prototype=e;var t=new i;return i.prototype=void 0,t}}(),xs=function(i){return typeof i.constructor!="function"||Pr(i)?{}:Sa(ps(i))},Yl=function(i){return ft(i)&&At(i)=="[object Map]"},Da=ir.a&&ir.a.isMap,ja=Da?ms(Da):Yl,Ia=function(i){return ft(i)&&At(i)=="[object Set]"},Xl=ir.a&&ir.a.isSet,Jl=Xl?ms(Xl):Ia,at={};at["[object Arguments]"]=at["[object Array]"]=at["[object ArrayBuffer]"]=at["[object DataView]"]=at["[object Boolean]"]=at["[object Date]"]=at["[object Float32Array]"]=at["[object Float64Array]"]=at["[object Int8Array]"]=at["[object Int16Array]"]=at["[object Int32Array]"]=at["[object Map]"]=at["[object Number]"]=at["[object Object]"]=at["[object RegExp]"]=at["[object Set]"]=at["[object String]"]=at["[object Symbol]"]=at["[object Uint8Array]"]=at["[object Uint8ClampedArray]"]=at["[object Uint16Array]"]=at["[object Uint32Array]"]=!0,at["[object Error]"]=at["[object Function]"]=at["[object WeakMap]"]=!1;var $r=function i(e,t,n,o,r,a){var c,d=1&t,m=2&t,b=4&t;if(n&&(c=r?n(e,o,r,a):n(e)),c!==void 0)return c;if(!oe(e))return e;var _=cn(e);if(_){if(c=Ca(e),!d)return _a(e,c)}else{var T=At(e),E=T=="[object Function]"||T=="[object GeneratorFunction]";if(Object(Io.a)(e))return Object(ka.a)(e,d);if(T=="[object Object]"||T=="[object Arguments]"||E&&!r){if(c=m||E?{}:xs(e),!d)return m?mi(e,wa(c,e)):Ul(e,va(c,e))}else{if(!at[T])return r?e:{};c=Mt(e,T,d)}}a||(a=new Br);var P=a.get(e);if(P)return P;a.set(e,c),Jl(e)?e.forEach(function(z){c.add(i(z,t,n,z,e,a))}):ja(e)&&e.forEach(function(z,$){c.set($,i(z,t,n,$,e,a))});var R=_?void 0:(b?m?Wl:ks:m?vo:Fr)(e);return $l(R||e,function(z,$){R&&(z=e[$=z]),ct(c,$,i(z,t,n,$,e,a))}),c},qi=function(i,e){return $r(i,5,e=typeof e=="function"?e:void 0)},Mo=function(i){return ft(i)&&i.nodeType===1&&!Nn(i)};class Ns{constructor(e,t){this._config={},t&&this.define(Tn(t)),e&&this._setObjectToTarget(this._config,e)}set(e,t){this._setToTarget(this._config,e,t)}define(e,t){this._setToTarget(this._config,e,t,!0)}get(e){return this._getFromSource(this._config,e)}*names(){for(const e of Object.keys(this._config))yield e}_setToTarget(e,t,n,o=!1){if(Nn(t))return void this._setObjectToTarget(e,t,o);const r=t.split(".");t=r.pop();for(const a of r)Nn(e[a])||(e[a]={}),e=e[a];if(Nn(n))return Nn(e[t])||(e[t]={}),e=e[t],void this._setObjectToTarget(e,n,o);o&&e[t]!==void 0||(e[t]=n)}_getFromSource(e,t){const n=t.split(".");t=n.pop();for(const o of n){if(!Nn(e[o])){e=null;break}e=e[o]}return e?Tn(e[t]):void 0}_setObjectToTarget(e,t,n){Object.keys(t).forEach(o=>{this._setToTarget(e,o,t[o],n)})}}function Tn(i){return qi(i,Ur)}function Ur(i){return Mo(i)?i:void 0}function Yn(i){return!(!i||!i[Symbol.iterator])}class io{constructor(e={},t={}){const n=Yn(e);if(n||(t=e),this._items=[],this._itemMap=new Map,this._idProperty=t.idProperty||"id",this._bindToExternalToInternalMap=new WeakMap,this._bindToInternalToExternalMap=new WeakMap,this._skippedIndexesFromExternal=[],n)for(const o of e)this._items.push(o),this._itemMap.set(this._getItemIdBeforeAdding(o),o)}get length(){return this._items.length}get first(){return this._items[0]||null}get last(){return this._items[this.length-1]||null}add(e,t){return this.addMany([e],t)}addMany(e,t){if(t===void 0)t=this._items.length;else if(t>this._items.length||t<0)throw new C.a("collection-add-item-invalid-index",this);for(let n=0;n<e.length;n++){const o=e[n],r=this._getItemIdBeforeAdding(o),a=t+n;this._items.splice(a,0,o),this._itemMap.set(r,o),this.fire("add",o,a)}return this.fire("change",{added:e,removed:[],index:t}),this}get(e){let t;if(typeof e=="string")t=this._itemMap.get(e);else{if(typeof e!="number")throw new C.a("collection-get-invalid-arg",this);t=this._items[e]}return t||null}has(e){if(typeof e=="string")return this._itemMap.has(e);{const t=e[this._idProperty];return this._itemMap.has(t)}}getIndex(e){let t;return t=typeof e=="string"?this._itemMap.get(e):e,this._items.indexOf(t)}remove(e){const[t,n]=this._remove(e);return this.fire("change",{added:[],removed:[t],index:n}),t}map(e,t){return this._items.map(e,t)}find(e,t){return this._items.find(e,t)}filter(e,t){return this._items.filter(e,t)}clear(){this._bindToCollection&&(this.stopListening(this._bindToCollection),this._bindToCollection=null);const e=Array.from(this._items);for(;this.length;)this._remove(0);this.fire("change",{added:[],removed:e,index:0})}bindTo(e){if(this._bindToCollection)throw new C.a("collection-bind-to-rebind",this);return this._bindToCollection=e,{as:t=>{this._setUpBindToBinding(n=>new t(n))},using:t=>{typeof t=="function"?this._setUpBindToBinding(n=>t(n)):this._setUpBindToBinding(n=>n[t])}}}_setUpBindToBinding(e){const t=this._bindToCollection,n=(o,r,a)=>{const c=t._bindToCollection==this,d=t._bindToInternalToExternalMap.get(r);if(c&&d)this._bindToExternalToInternalMap.set(r,d),this._bindToInternalToExternalMap.set(d,r);else{const m=e(r);if(!m)return void this._skippedIndexesFromExternal.push(a);let b=a;for(const _ of this._skippedIndexesFromExternal)a>_&&b--;for(const _ of t._skippedIndexesFromExternal)b>=_&&b++;this._bindToExternalToInternalMap.set(r,m),this._bindToInternalToExternalMap.set(m,r),this.add(m,b);for(let _=0;_<t._skippedIndexesFromExternal.length;_++)b<=t._skippedIndexesFromExternal[_]&&t._skippedIndexesFromExternal[_]++}};for(const o of t)n(0,o,t.getIndex(o));this.listenTo(t,"add",n),this.listenTo(t,"remove",(o,r,a)=>{const c=this._bindToExternalToInternalMap.get(r);c&&this.remove(c),this._skippedIndexesFromExternal=this._skippedIndexesFromExternal.reduce((d,m)=>(a<m&&d.push(m-1),a>m&&d.push(m),d),[])})}_getItemIdBeforeAdding(e){const t=this._idProperty;let n;if(t in e){if(n=e[t],typeof n!="string")throw new C.a("collection-add-invalid-id",this);if(this.get(n))throw new C.a("collection-add-item-already-exists",this)}else e[t]=n=S();return n}_remove(e){let t,n,o,r=!1;const a=this._idProperty;if(typeof e=="string"?(n=e,o=this._itemMap.get(n),r=!o,o&&(t=this._items.indexOf(o))):typeof e=="number"?(t=e,o=this._items[t],r=!o,o&&(n=o[a])):(o=e,n=o[a],t=this._items.indexOf(o),r=t==-1||!this._itemMap.get(n)),r)throw new C.a("collection-remove-404",this);this._items.splice(t,1),this._itemMap.delete(n);const c=this._bindToInternalToExternalMap.get(o);return this._bindToInternalToExternalMap.delete(o),this._bindToExternalToInternalMap.delete(c),this.fire("remove",o,t),[o,t]}[Symbol.iterator](){return this._items[Symbol.iterator]()}}Be(io,F);class Ts{constructor(e,t=[],n=[]){this._context=e,this._plugins=new Map,this._availablePlugins=new Map;for(const o of t)o.pluginName&&this._availablePlugins.set(o.pluginName,o);this._contextPlugins=new Map;for(const[o,r]of n)this._contextPlugins.set(o,r),this._contextPlugins.set(r,o),o.pluginName&&this._availablePlugins.set(o.pluginName,o)}*[Symbol.iterator](){for(const e of this._plugins)typeof e[0]=="function"&&(yield e)}get(e){const t=this._plugins.get(e);if(!t){let n=e;throw typeof e=="function"&&(n=e.pluginName||e.name),new C.a("plugincollection-plugin-not-loaded",this._context,{plugin:n})}return t}has(e){return this._plugins.has(e)}init(e,t=[],n=[]){const o=this,r=this._context;(function P(R,z=new Set){R.forEach($=>{d($)&&(z.has($)||(z.add($),$.pluginName&&!o._availablePlugins.has($.pluginName)&&o._availablePlugins.set($.pluginName,$),$.requires&&P($.requires,z)))})})(e),T(e);const a=[...function P(R,z=new Set){return R.map($=>d($)?$:o._availablePlugins.get($)).reduce(($,J)=>z.has(J)?$:(z.add(J),J.requires&&(T(J.requires,J),P(J.requires,z).forEach(ue=>$.add(ue))),$.add(J)),new Set)}(e.filter(P=>!b(P,t)))];(function(P,R){for(const z of R){if(typeof z!="function")throw new C.a("plugincollection-replace-plugin-invalid-type",null,{pluginItem:z});const $=z.pluginName;if(!$)throw new C.a("plugincollection-replace-plugin-missing-name",null,{pluginItem:z});if(z.requires&&z.requires.length)throw new C.a("plugincollection-plugin-for-replacing-cannot-have-dependencies",null,{pluginName:$});const J=o._availablePlugins.get($);if(!J)throw new C.a("plugincollection-plugin-for-replacing-not-exist",null,{pluginName:$});const ue=P.indexOf(J);if(ue===-1){if(o._contextPlugins.has(J))return;throw new C.a("plugincollection-plugin-for-replacing-not-loaded",null,{pluginName:$})}if(J.requires&&J.requires.length)throw new C.a("plugincollection-replaced-plugin-cannot-have-dependencies",null,{pluginName:$});P.splice(ue,1,z),o._availablePlugins.set($,z)}})(a,n);const c=function(P){return P.map(R=>{const z=o._contextPlugins.get(R)||new R(r);return o._add(R,z),z})}(a);return E(c,"init").then(()=>E(c,"afterInit")).then(()=>c);function d(P){return typeof P=="function"}function m(P){return d(P)&&P.isContextPlugin}function b(P,R){return R.some(z=>z===P||_(P)===z||_(z)===P)}function _(P){return d(P)?P.pluginName||P.name:P}function T(P,R=null){P.map(z=>d(z)?z:o._availablePlugins.get(z)||z).forEach(z=>{(function($,J){if(!d($))throw J?new C.a("plugincollection-soft-required",r,{missingPlugin:$,requiredBy:_(J)}):new C.a("plugincollection-plugin-not-found",r,{plugin:$})})(z,R),function($,J){if(m(J)&&!m($))throw new C.a("plugincollection-context-required",r,{plugin:_($),requiredBy:_(J)})}(z,R),function($,J){if(J&&b($,t))throw new C.a("plugincollection-required",r,{plugin:_($),requiredBy:_(J)})}(z,R)})}function E(P,R){return P.reduce((z,$)=>$[R]?o._contextPlugins.has($)?z:z.then($[R].bind($)):z,Promise.resolve())}}destroy(){const e=[];for(const[,t]of this)typeof t.destroy!="function"||this._contextPlugins.has(t)||e.push(t.destroy());return Promise.all(e)}_add(e,t){this._plugins.set(e,t);const n=e.pluginName;if(n){if(this._plugins.has(n))throw new C.a("plugincollection-plugin-name-conflict",null,{pluginName:n,plugin1:this._plugins.get(n).constructor,plugin2:e});this._plugins.set(n,t)}}}function Tt(i){return Array.isArray(i)?i:[i]}function Pa(i,e,t=1){if(typeof t!="number")throw new C.a("translation-service-quantity-not-a-number",null,{quantity:t});const n=Object.keys(window.CKEDITOR_TRANSLATIONS).length;n===1&&(i=Object.keys(window.CKEDITOR_TRANSLATIONS)[0]);const o=e.id||e.string;if(n===0||!function(d,m){return!!window.CKEDITOR_TRANSLATIONS[d]&&!!window.CKEDITOR_TRANSLATIONS[d].dictionary[m]}(i,o))return t!==1?e.plural:e.string;const r=window.CKEDITOR_TRANSLATIONS[i].dictionary,a=window.CKEDITOR_TRANSLATIONS[i].getPluralForm||(d=>d===1?0:1);if(typeof r[o]=="string")return r[o];const c=Number(a(t));return r[o][c]}Be(Ts,F),window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={});const Ma=["ar","ara","fa","per","fas","he","heb","ku","kur","ug","uig"];function Oo(i){return Ma.includes(i)?"rtl":"ltr"}class Zl{constructor(e={}){this.uiLanguage=e.uiLanguage||"en",this.contentLanguage=e.contentLanguage||this.uiLanguage,this.uiLanguageDirection=Oo(this.uiLanguage),this.contentLanguageDirection=Oo(this.contentLanguage),this.t=(t,n)=>this._t(t,n)}get language(){return console.warn("locale-deprecated-language-property: The Locale#language property has been deprecated and will be removed in the near future. Please use #uiLanguage and #contentLanguage properties instead."),this.uiLanguage}_t(e,t=[]){t=Tt(t),typeof e=="string"&&(e={string:e});const n=e.plural?t[0]:1;return function(o,r){return o.replace(/%(\d+)/g,(a,c)=>c<r.length?r[c]:a)}(Pa(this.uiLanguage,e,n),t)}}class D{constructor(e){this.config=new Ns(e,this.constructor.defaultConfig);const t=this.constructor.builtinPlugins;this.config.define("plugins",t),this.plugins=new Ts(this,t);const n=this.config.get("language")||{};this.locale=new Zl({uiLanguage:typeof n=="string"?n:n.ui,contentLanguage:this.config.get("language.content")}),this.t=this.locale.t,this.editors=new io,this._contextOwner=null}initPlugins(){const e=this.config.get("plugins")||[],t=this.config.get("substitutePlugins")||[];for(const n of e.concat(t)){if(typeof n!="function")throw new C.a("context-initplugins-constructor-only",null,{Plugin:n});if(n.isContextPlugin!==!0)throw new C.a("context-initplugins-invalid-plugin",null,{Plugin:n})}return this.plugins.init(e,[],t)}destroy(){return Promise.all(Array.from(this.editors,e=>e.destroy())).then(()=>this.plugins.destroy())}_addEditor(e,t){if(this._contextOwner)throw new C.a("context-addeditor-private-context");this.editors.add(e),t&&(this._contextOwner=e)}_removeEditor(e){return this.editors.has(e)&&this.editors.remove(e),this._contextOwner===e?this.destroy():Promise.resolve()}_getEditorConfig(){const e={};for(const t of this.config.names())["plugins","removePlugins","extraPlugins"].includes(t)||(e[t]=this.config.get(t));return e}static create(e){return new Promise(t=>{const n=new this(e);t(n.initPlugins().then(()=>n))})}}class I{constructor(e){this.context=e}destroy(){this.stopListening()}static get isContextPlugin(){return!0}}function B(i,e){const t=Math.min(i.length,e.length);for(let n=0;n<t;n++)if(i[n]!=e[n])return n;return i.length==e.length?"same":i.length<e.length?"prefix":"extension"}Be(I,Wt);var ne=function(i){return $r(i,4)};class Me{constructor(e){this.document=e,this.parent=null}get index(){let e;if(!this.parent)return null;if((e=this.parent.getChildIndex(this))==-1)throw new C.a("view-node-not-found-in-parent",this);return e}get nextSibling(){const e=this.index;return e!==null&&this.parent.getChild(e+1)||null}get previousSibling(){const e=this.index;return e!==null&&this.parent.getChild(e-1)||null}get root(){let e=this;for(;e.parent;)e=e.parent;return e}isAttached(){return this.root.is("rootElement")}getPath(){const e=[];let t=this;for(;t.parent;)e.unshift(t.index),t=t.parent;return e}getAncestors(e={includeSelf:!1,parentFirst:!1}){const t=[];let n=e.includeSelf?this:this.parent;for(;n;)t[e.parentFirst?"push":"unshift"](n),n=n.parent;return t}getCommonAncestor(e,t={}){const n=this.getAncestors(t),o=e.getAncestors(t);let r=0;for(;n[r]==o[r]&&n[r];)r++;return r===0?null:n[r-1]}isBefore(e){if(this==e||this.root!==e.root)return!1;const t=this.getPath(),n=e.getPath(),o=B(t,n);switch(o){case"prefix":return!0;case"extension":return!1;default:return t[o]<n[o]}}isAfter(e){return this!=e&&this.root===e.root&&!this.isBefore(e)}_remove(){this.parent._removeChildren(this.index)}_fireChange(e,t){this.fire("change:"+e,t),this.parent&&this.parent._fireChange(e,t)}toJSON(){const e=ne(this);return delete e.parent,e}is(e){return e==="node"||e==="view:node"}}Be(Me,F);class Te extends Me{constructor(e,t){super(e),this._textData=t}is(e){return e==="$text"||e==="view:$text"||e==="text"||e==="view:text"||e==="node"||e==="view:node"}get data(){return this._textData}get _data(){return this.data}set _data(e){this._fireChange("text",this),this._textData=e}isSimilar(e){return e instanceof Te&&(this===e||this.data===e.data)}_clone(){return new Te(this.document,this.data)}}class Ve{constructor(e,t,n){if(this.textNode=e,t<0||t>e.data.length)throw new C.a("view-textproxy-wrong-offsetintext",this);if(n<0||t+n>e.data.length)throw new C.a("view-textproxy-wrong-length",this);this.data=e.data.substring(t,t+n),this.offsetInText=t}get offsetSize(){return this.data.length}get isPartial(){return this.data.length!==this.textNode.data.length}get parent(){return this.textNode.parent}get root(){return this.textNode.root}get document(){return this.textNode.document}is(e){return e==="$textProxy"||e==="view:$textProxy"||e==="textProxy"||e==="view:textProxy"}getAncestors(e={includeSelf:!1,parentFirst:!1}){const t=[];let n=e.includeSelf?this.textNode:this.parent;for(;n!==null;)t[e.parentFirst?"push":"unshift"](n),n=n.parent;return t}}function Ke(i){return Yn(i)?new Map(i):function(e){const t=new Map;for(const n in e)t.set(n,e[n]);return t}(i)}class Ct{constructor(...e){this._patterns=[],this.add(...e)}add(...e){for(let t of e)(typeof t=="string"||t instanceof RegExp)&&(t={name:t}),this._patterns.push(t)}match(...e){for(const t of e)for(const n of this._patterns){const o=Zt(t,n);if(o)return{element:t,pattern:n,match:o}}return null}matchAll(...e){const t=[];for(const n of e)for(const o of this._patterns){const r=Zt(n,o);r&&t.push({element:n,pattern:o,match:r})}return t.length>0?t:null}getElementName(){if(this._patterns.length!==1)return null;const e=this._patterns[0],t=e.name;return typeof e=="function"||!t||t instanceof RegExp?null:t}}function Zt(i,e){if(typeof e=="function")return e(i);const t={};return e.name&&(t.name=function(n,o){return n instanceof RegExp?n.test(o):n===o}(e.name,i.name),!t.name)||e.attributes&&(t.attributes=function(n,o){const r=new Set(o.getAttributeKeys());return Nn(n)?(n.style!==void 0&&Object(C.b)("matcher-pattern-deprecated-attributes-style-key",n),n.class!==void 0&&Object(C.b)("matcher-pattern-deprecated-attributes-class-key",n)):(r.delete("style"),r.delete("class")),mr(n,r,a=>o.getAttribute(a))}(e.attributes,i),!t.attributes)?null:!(e.classes&&(t.classes=function(n,o){return mr(n,o.getClassNames())}(e.classes,i),!t.classes))&&!(e.styles&&(t.styles=function(n,o){return mr(n,o.getStyleNames(!0),r=>o.getStyle(r))}(e.styles,i),!t.styles))&&t}function mr(i,e,t){const n=function(a){return Array.isArray(a)?a.map(c=>Nn(c)?(c.key!==void 0&&c.value!==void 0||Object(C.b)("matcher-pattern-missing-key-or-value",c),[c.key,c.value]):[c,!0]):Nn(a)?Object.entries(a):[[a,!0]]}(i),o=Array.from(e),r=[];return n.forEach(([a,c])=>{o.forEach(d=>{(function(m,b){return m===!0||m===b||m instanceof RegExp&&m.test(b)})(a,d)&&function(m,b,_){if(m===!0)return!0;const T=_(b);return m===T||m instanceof RegExp&&m.test(T)}(c,d,t)&&r.push(d)})}),!n.length||r.length<n.length?null:r}var Ro=function(i){return typeof i=="symbol"||ft(i)&&_e(i)=="[object Symbol]"},Vo=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,wo=/^\w*$/,Q=function(i,e){if(cn(i))return!1;var t=typeof i;return!(t!="number"&&t!="symbol"&&t!="boolean"&&i!=null&&!Ro(i))||wo.test(i)||!Vo.test(i)||e!=null&&i in Object(e)};function re(i,e){if(typeof i!="function"||e!=null&&typeof e!="function")throw new TypeError("Expected a function");var t=function(){var n=arguments,o=e?e.apply(this,n):n[0],r=t.cache;if(r.has(o))return r.get(o);var a=i.apply(this,n);return t.cache=r.set(o,a)||r,a};return t.cache=new(re.Cache||zr),t}re.Cache=zr;var ee=re,Ce=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Xe=/\\(\\)?/g,Je=function(i){var e=ee(i,function(n){return t.size===500&&t.clear(),n}),t=e.cache;return e}(function(i){var e=[];return i.charCodeAt(0)===46&&e.push(""),i.replace(Ce,function(t,n,o,r){e.push(o?r.replace(Xe,"$1"):n||t)}),e}),Ot=function(i,e){for(var t=-1,n=i==null?0:i.length,o=Array(n);++t<n;)o[t]=e(i[t],t,i);return o},Nt=ge?ge.prototype:void 0,ec=Nt?Nt.toString:void 0,qp=function i(e){if(typeof e=="string")return e;if(cn(e))return Ot(e,i)+"";if(Ro(e))return ec?ec.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t},ro=function(i){return i==null?"":qp(i)},Cs=function(i,e){return cn(i)?i:Q(i,e)?[i]:Je(ro(i))},Hp=function(i){var e=i==null?0:i.length;return e?i[e-1]:void 0},fr=function(i){if(typeof i=="string"||Ro(i))return i;var e=i+"";return e=="0"&&1/i==-1/0?"-0":e},Oa=function(i,e){for(var t=0,n=(e=Cs(e,i)).length;i!=null&&t<n;)i=i[fr(e[t++])];return t&&t==n?i:void 0},Ra=function(i,e,t){var n=-1,o=i.length;e<0&&(e=-e>o?0:o+e),(t=t>o?o:t)<0&&(t+=o),o=e>t?0:t-e>>>0,e>>>=0;for(var r=Array(o);++n<o;)r[n]=i[n+e];return r},Rt=function(i,e){return e.length<2?i:Oa(i,Ra(e,0,-1))},$p=function(i,e){return e=Cs(e,i),(i=Rt(i,e))==null||delete i[fr(Hp(e))]},Eh=function(i,e){return i==null||$p(i,e)},Wr=function(i,e,t){var n=i==null?void 0:Oa(i,e);return n===void 0?t:n},Pu=function(i,e,t){(t!==void 0&&!we(i[e],t)||t===void 0&&!(e in i))&&en(i,e,t)},Up=function(i){return function(e,t,n){for(var o=-1,r=Object(e),a=n(e),c=a.length;c--;){var d=a[i?c:++o];if(t(r[d],d,r)===!1)break}return e}}(),Wp=function(i){return ft(i)&&go(i)},Es=function(i,e){if((e!=="constructor"||typeof i[e]!="function")&&e!="__proto__")return i[e]},pr=function(i){return st(i,vo(i))},tc=function(i,e,t,n,o,r,a){var c=Es(i,t),d=Es(e,t),m=a.get(d);if(m)Pu(i,t,m);else{var b=r?r(c,d,t+"",i,e,a):void 0,_=b===void 0;if(_){var T=cn(d),E=!T&&Object(Io.a)(d),P=!T&&!E&&Vi(d);b=d,T||E||P?cn(c)?b=c:Wp(c)?b=_a(c):E?(_=!1,b=Object(ka.a)(d,!0)):P?(_=!1,b=Ql(d,!0)):b=[]:Nn(d)||jn(d)?(b=c,jn(c)?b=pr(c):oe(c)&&!Se(c)||(b=xs(d))):_=!1}_&&(a.set(d,b),o(b,d,n,r,a),a.delete(d)),Pu(i,t,b)}},Ah=function i(e,t,n,o,r){e!==t&&Up(t,function(a,c){if(r||(r=new Br),oe(a))tc(e,t,c,n,i,o,r);else{var d=o?o(Es(e,c),a,c+"",e,t,r):void 0;d===void 0&&(d=a),Pu(e,c,d)}},vo)},Va=Ri(function(i,e,t){Ah(i,e,t)}),Sh=function(i,e,t,n){if(!oe(i))return i;for(var o=-1,r=(e=Cs(e,i)).length,a=r-1,c=i;c!=null&&++o<r;){var d=fr(e[o]),m=t;if(d==="__proto__"||d==="constructor"||d==="prototype")return i;if(o!=a){var b=c[d];(m=n?n(b,d,c):void 0)===void 0&&(m=oe(b)?b:Oi(e[o+1])?[]:{})}ct(c,d,m),c=c[d]}return i},Dh=function(i,e,t){return i==null?i:Sh(i,e,t)};class nc{constructor(e){this._styles={},this._styleProcessor=e}get isEmpty(){const e=Object.entries(this._styles);return!Array.from(e).length}get size(){return this.isEmpty?0:this.getStyleNames().length}setTo(e){this.clear();const t=Array.from(function(n){let o=null,r=0,a=0,c=null;const d=new Map;if(n==="")return d;n.charAt(n.length-1)!=";"&&(n+=";");for(let m=0;m<n.length;m++){const b=n.charAt(m);if(o===null)switch(b){case":":c||(c=n.substr(r,m-r),a=m+1);break;case'"':case"'":o=b;break;case";":{const _=n.substr(a,m-a);c&&d.set(c.trim(),_.trim()),c=null,r=m+1;break}}else b===o&&(o=null)}return d}(e).entries());for(const[n,o]of t)this._styleProcessor.toNormalizedForm(n,o,this._styles)}has(e){if(this.isEmpty)return!1;const t=this._styleProcessor.getReducedForm(e,this._styles).find(([n])=>n===e);return Array.isArray(t)}set(e,t){if(oe(e))for(const[n,o]of Object.entries(e))this._styleProcessor.toNormalizedForm(n,o,this._styles);else this._styleProcessor.toNormalizedForm(e,t,this._styles)}remove(e){const t=Kr(e);Eh(this._styles,t),delete this._styles[e],this._cleanEmptyObjectsOnPath(t)}getNormalized(e){return this._styleProcessor.getNormalized(e,this._styles)}toString(){return this.isEmpty?"":this._getStylesEntries().map(e=>e.join(":")).sort().join(";")+";"}getAsString(e){if(this.isEmpty)return;if(this._styles[e]&&!oe(this._styles[e]))return this._styles[e];const t=this._styleProcessor.getReducedForm(e,this._styles).find(([n])=>n===e);return Array.isArray(t)?t[1]:void 0}getStyleNames(e=!1){return this.isEmpty?[]:e?this._styleProcessor.getStyleNames(this._styles):this._getStylesEntries().map(([t])=>t)}clear(){this._styles={}}_getStylesEntries(){const e=[],t=Object.keys(this._styles);for(const n of t)e.push(...this._styleProcessor.getReducedForm(n,this._styles));return e}_cleanEmptyObjectsOnPath(e){const t=e.split(".");if(!(t.length>1))return;const n=t.splice(0,t.length-1).join("."),o=Wr(this._styles,n);o&&!Array.from(Object.keys(o)).length&&this.remove(n)}}class jh{constructor(){this._normalizers=new Map,this._extractors=new Map,this._reducers=new Map,this._consumables=new Map}toNormalizedForm(e,t,n){if(oe(t))Hi(n,Kr(e),t);else if(this._normalizers.has(e)){const o=this._normalizers.get(e),{path:r,value:a}=o(t);Hi(n,r,a)}else Hi(n,e,t)}getNormalized(e,t){if(!e)return Va({},t);if(t[e]!==void 0)return t[e];if(this._extractors.has(e)){const n=this._extractors.get(e);if(typeof n=="string")return Wr(t,n);const o=n(e,t);if(o)return o}return Wr(t,Kr(e))}getReducedForm(e,t){const n=this.getNormalized(e,t);return n===void 0?[]:this._reducers.has(e)?this._reducers.get(e)(n):[[e,n]]}getStyleNames(e){const t=Array.from(this._consumables.keys()).filter(o=>{const r=this.getNormalized(o,e);return r&&typeof r=="object"?Object.keys(r).length:r}),n=new Set([...t,...Object.keys(e)]);return Array.from(n.values())}getRelatedStyles(e){return this._consumables.get(e)||[]}setNormalizer(e,t){this._normalizers.set(e,t)}setExtractor(e,t){this._extractors.set(e,t)}setReducer(e,t){this._reducers.set(e,t)}setStyleRelation(e,t){this._mapStyleNames(e,t);for(const n of t)this._mapStyleNames(n,[e])}_mapStyleNames(e,t){this._consumables.has(e)||this._consumables.set(e,[]),this._consumables.get(e).push(...t)}}function Kr(i){return i.replace("-",".")}function Hi(i,e,t){let n=t;oe(t)&&(n=Va({},Wr(i,e),t)),Dh(i,e,n)}class Xn extends Me{constructor(e,t,n,o){if(super(e),this.name=t,this._attrs=function(r){r=Ke(r);for(const[a,c]of r)c===null?r.delete(a):typeof c!="string"&&r.set(a,String(c));return r}(n),this._children=[],o&&this._insertChild(0,o),this._classes=new Set,this._attrs.has("class")){const r=this._attrs.get("class");Ih(this._classes,r),this._attrs.delete("class")}this._styles=new nc(this.document.stylesProcessor),this._attrs.has("style")&&(this._styles.setTo(this._attrs.get("style")),this._attrs.delete("style")),this._customProperties=new Map,this._isAllowedInsideAttributeElement=!1}get childCount(){return this._children.length}get isEmpty(){return this._children.length===0}get isAllowedInsideAttributeElement(){return this._isAllowedInsideAttributeElement}is(e,t=null){return t?t===this.name&&(e==="element"||e==="view:element"):e==="element"||e==="view:element"||e==="node"||e==="view:node"}getChild(e){return this._children[e]}getChildIndex(e){return this._children.indexOf(e)}getChildren(){return this._children[Symbol.iterator]()}*getAttributeKeys(){this._classes.size>0&&(yield"class"),this._styles.isEmpty||(yield"style"),yield*this._attrs.keys()}*getAttributes(){yield*this._attrs.entries(),this._classes.size>0&&(yield["class",this.getAttribute("class")]),this._styles.isEmpty||(yield["style",this.getAttribute("style")])}getAttribute(e){if(e=="class")return this._classes.size>0?[...this._classes].join(" "):void 0;if(e=="style"){const t=this._styles.toString();return t==""?void 0:t}return this._attrs.get(e)}hasAttribute(e){return e=="class"?this._classes.size>0:e=="style"?!this._styles.isEmpty:this._attrs.has(e)}isSimilar(e){if(!(e instanceof Xn))return!1;if(this===e)return!0;if(this.name!=e.name||this.isAllowedInsideAttributeElement!=e.isAllowedInsideAttributeElement||this._attrs.size!==e._attrs.size||this._classes.size!==e._classes.size||this._styles.size!==e._styles.size)return!1;for(const[t,n]of this._attrs)if(!e._attrs.has(t)||e._attrs.get(t)!==n)return!1;for(const t of this._classes)if(!e._classes.has(t))return!1;for(const t of this._styles.getStyleNames())if(!e._styles.has(t)||e._styles.getAsString(t)!==this._styles.getAsString(t))return!1;return!0}hasClass(...e){for(const t of e)if(!this._classes.has(t))return!1;return!0}getClassNames(){return this._classes.keys()}getStyle(e){return this._styles.getAsString(e)}getNormalizedStyle(e){return this._styles.getNormalized(e)}getStyleNames(e=!1){return this._styles.getStyleNames(e)}hasStyle(...e){for(const t of e)if(!this._styles.has(t))return!1;return!0}findAncestor(...e){const t=new Ct(...e);let n=this.parent;for(;n;){if(t.match(n))return n;n=n.parent}return null}getCustomProperty(e){return this._customProperties.get(e)}*getCustomProperties(){yield*this._customProperties.entries()}getIdentity(){const e=Array.from(this._classes).sort().join(","),t=this._styles.toString(),n=Array.from(this._attrs).map(o=>`${o[0]}="${o[1]}"`).sort().join(" ");return this.name+(e==""?"":` class="${e}"`)+(t?` style="${t}"`:"")+(n==""?"":" "+n)}_clone(e=!1){const t=[];if(e)for(const o of this.getChildren())t.push(o._clone(e));const n=new this.constructor(this.document,this.name,this._attrs,t);return n._classes=new Set(this._classes),n._styles.set(this._styles.getNormalized()),n._customProperties=new Map(this._customProperties),n.getFillerOffset=this.getFillerOffset,n._isAllowedInsideAttributeElement=this.isAllowedInsideAttributeElement,n}_appendChild(e){return this._insertChild(this.childCount,e)}_insertChild(e,t){this._fireChange("children",this);let n=0;const o=function(r,a){return typeof a=="string"?[new Te(r,a)]:(Yn(a)||(a=[a]),Array.from(a).map(c=>typeof c=="string"?new Te(r,c):c instanceof Ve?new Te(r,c.data):c))}(this.document,t);for(const r of o)r.parent!==null&&r._remove(),r.parent=this,r.document=this.document,this._children.splice(e,0,r),e++,n++;return n}_removeChildren(e,t=1){this._fireChange("children",this);for(let n=e;n<e+t;n++)this._children[n].parent=null;return this._children.splice(e,t)}_setAttribute(e,t){t=String(t),this._fireChange("attributes",this),e=="class"?Ih(this._classes,t):e=="style"?this._styles.setTo(t):this._attrs.set(e,t)}_removeAttribute(e){return this._fireChange("attributes",this),e=="class"?this._classes.size>0&&(this._classes.clear(),!0):e=="style"?!this._styles.isEmpty&&(this._styles.clear(),!0):this._attrs.delete(e)}_addClass(e){this._fireChange("attributes",this);for(const t of Tt(e))this._classes.add(t)}_removeClass(e){this._fireChange("attributes",this);for(const t of Tt(e))this._classes.delete(t)}_setStyle(e,t){this._fireChange("attributes",this),this._styles.set(e,t)}_removeStyle(e){this._fireChange("attributes",this);for(const t of Tt(e))this._styles.remove(t)}_setCustomProperty(e,t){this._customProperties.set(e,t)}_removeCustomProperty(e){return this._customProperties.delete(e)}}function Ih(i,e){const t=e.split(/\s+/);i.clear(),t.forEach(n=>i.add(n))}class oc extends Xn{constructor(e,t,n,o){super(e,t,n,o),this.getFillerOffset=Ph}is(e,t=null){return t?t===this.name&&(e==="containerElement"||e==="view:containerElement"||e==="element"||e==="view:element"):e==="containerElement"||e==="view:containerElement"||e==="element"||e==="view:element"||e==="node"||e==="view:node"}}function Ph(){const i=[...this.getChildren()],e=i[this.childCount-1];if(e&&e.is("element","br"))return this.childCount;for(const t of i)if(!t.is("uiElement"))return null;return this.childCount}class Gr extends oc{constructor(e,t,n,o){super(e,t,n,o),this.set("isReadOnly",!1),this.set("isFocused",!1),this.bind("isReadOnly").to(e),this.bind("isFocused").to(e,"isFocused",r=>r&&e.selection.editableElement==this),this.listenTo(e.selection,"change",()=>{this.isFocused=e.isFocused&&e.selection.editableElement==this})}is(e,t=null){return t?t===this.name&&(e==="editableElement"||e==="view:editableElement"||e==="containerElement"||e==="view:containerElement"||e==="element"||e==="view:element"):e==="editableElement"||e==="view:editableElement"||e==="containerElement"||e==="view:containerElement"||e==="element"||e==="view:element"||e==="node"||e==="view:node"}destroy(){this.stopListening()}}Be(Gr,Wt);const La=Symbol("rootName");class Mu extends Gr{constructor(e,t){super(e,t),this.rootName="main"}is(e,t=null){return t?t===this.name&&(e==="rootElement"||e==="view:rootElement"||e==="editableElement"||e==="view:editableElement"||e==="containerElement"||e==="view:containerElement"||e==="element"||e==="view:element"):e==="rootElement"||e==="view:rootElement"||e==="editableElement"||e==="view:editableElement"||e==="containerElement"||e==="view:containerElement"||e==="element"||e==="view:element"||e==="node"||e==="view:node"}get rootName(){return this.getCustomProperty(La)}set rootName(e){this._setCustomProperty(La,e)}set _name(e){this.name=e}}class Qr{constructor(e={}){if(!e.boundaries&&!e.startPosition)throw new C.a("view-tree-walker-no-start-position",null);if(e.direction&&e.direction!="forward"&&e.direction!="backward")throw new C.a("view-tree-walker-unknown-direction",e.startPosition,{direction:e.direction});this.boundaries=e.boundaries||null,e.startPosition?this.position=ye._createAt(e.startPosition):this.position=ye._createAt(e.boundaries[e.direction=="backward"?"end":"start"]),this.direction=e.direction||"forward",this.singleCharacters=!!e.singleCharacters,this.shallow=!!e.shallow,this.ignoreElementEnd=!!e.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null}[Symbol.iterator](){return this}skip(e){let t,n,o;do o=this.position,{done:t,value:n}=this.next();while(!t&&e(n));t||(this.position=o)}next(){return this.direction=="forward"?this._next():this._previous()}_next(){let e=this.position.clone();const t=this.position,n=e.parent;if(n.parent===null&&e.offset===n.childCount)return{done:!0};if(n===this._boundaryEndParent&&e.offset==this.boundaries.end.offset)return{done:!0};let o;if(n instanceof Te){if(e.isAtEnd)return this.position=ye._createAfter(n),this._next();o=n.data[e.offset]}else o=n.getChild(e.offset);if(o instanceof Xn)return this.shallow?e.offset++:e=new ye(o,0),this.position=e,this._formatReturnValue("elementStart",o,t,e,1);if(o instanceof Te){if(this.singleCharacters)return e=new ye(o,0),this.position=e,this._next();{let r,a=o.data.length;return o==this._boundaryEndParent?(a=this.boundaries.end.offset,r=new Ve(o,0,a),e=ye._createAfter(r)):(r=new Ve(o,0,o.data.length),e.offset++),this.position=e,this._formatReturnValue("text",r,t,e,a)}}if(typeof o=="string"){let r;this.singleCharacters?r=1:r=(n===this._boundaryEndParent?this.boundaries.end.offset:n.data.length)-e.offset;const a=new Ve(n,e.offset,r);return e.offset+=r,this.position=e,this._formatReturnValue("text",a,t,e,r)}return e=ye._createAfter(n),this.position=e,this.ignoreElementEnd?this._next():this._formatReturnValue("elementEnd",n,t,e)}_previous(){let e=this.position.clone();const t=this.position,n=e.parent;if(n.parent===null&&e.offset===0)return{done:!0};if(n==this._boundaryStartParent&&e.offset==this.boundaries.start.offset)return{done:!0};let o;if(n instanceof Te){if(e.isAtStart)return this.position=ye._createBefore(n),this._previous();o=n.data[e.offset-1]}else o=n.getChild(e.offset-1);if(o instanceof Xn)return this.shallow?(e.offset--,this.position=e,this._formatReturnValue("elementStart",o,t,e,1)):(e=new ye(o,o.childCount),this.position=e,this.ignoreElementEnd?this._previous():this._formatReturnValue("elementEnd",o,t,e));if(o instanceof Te){if(this.singleCharacters)return e=new ye(o,o.data.length),this.position=e,this._previous();{let r,a=o.data.length;if(o==this._boundaryStartParent){const c=this.boundaries.start.offset;r=new Ve(o,c,o.data.length-c),a=r.data.length,e=ye._createBefore(r)}else r=new Ve(o,0,o.data.length),e.offset--;return this.position=e,this._formatReturnValue("text",r,t,e,a)}}if(typeof o=="string"){let r;if(this.singleCharacters)r=1;else{const c=n===this._boundaryStartParent?this.boundaries.start.offset:0;r=e.offset-c}e.offset-=r;const a=new Ve(n,e.offset,r);return this.position=e,this._formatReturnValue("text",a,t,e,r)}return e=ye._createBefore(n),this.position=e,this._formatReturnValue("elementStart",n,t,e,1)}_formatReturnValue(e,t,n,o,r){return t instanceof Ve&&(t.offsetInText+t.data.length==t.textNode.data.length&&(this.direction!="forward"||this.boundaries&&this.boundaries.end.isEqual(this.position)?n=ye._createAfter(t.textNode):(o=ye._createAfter(t.textNode),this.position=o)),t.offsetInText===0&&(this.direction!="backward"||this.boundaries&&this.boundaries.start.isEqual(this.position)?n=ye._createBefore(t.textNode):(o=ye._createBefore(t.textNode),this.position=o))),{done:!1,value:{type:e,item:t,previousPosition:n,nextPosition:o,length:r}}}}class ye{constructor(e,t){this.parent=e,this.offset=t}get nodeAfter(){return this.parent.is("$text")?null:this.parent.getChild(this.offset)||null}get nodeBefore(){return this.parent.is("$text")?null:this.parent.getChild(this.offset-1)||null}get isAtStart(){return this.offset===0}get isAtEnd(){const e=this.parent.is("$text")?this.parent.data.length:this.parent.childCount;return this.offset===e}get root(){return this.parent.root}get editableElement(){let e=this.parent;for(;!(e instanceof Gr);){if(!e.parent)return null;e=e.parent}return e}getShiftedBy(e){const t=ye._createAt(this),n=t.offset+e;return t.offset=n<0?0:n,t}getLastMatchingPosition(e,t={}){t.startPosition=this;const n=new Qr(t);return n.skip(e),n.position}getAncestors(){return this.parent.is("documentFragment")?[this.parent]:this.parent.getAncestors({includeSelf:!0})}getCommonAncestor(e){const t=this.getAncestors(),n=e.getAncestors();let o=0;for(;t[o]==n[o]&&t[o];)o++;return o===0?null:t[o-1]}is(e){return e==="position"||e==="view:position"}isEqual(e){return this.parent==e.parent&&this.offset==e.offset}isBefore(e){return this.compareWith(e)=="before"}isAfter(e){return this.compareWith(e)=="after"}compareWith(e){if(this.root!==e.root)return"different";if(this.isEqual(e))return"same";const t=this.parent.is("node")?this.parent.getPath():[],n=e.parent.is("node")?e.parent.getPath():[];t.push(this.offset),n.push(e.offset);const o=B(t,n);switch(o){case"prefix":return"before";case"extension":return"after";default:return t[o]<n[o]?"before":"after"}}getWalker(e={}){return e.startPosition=this,new Qr(e)}clone(){return new ye(this.parent,this.offset)}static _createAt(e,t){if(e instanceof ye)return new this(e.parent,e.offset);{const n=e;if(t=="end")t=n.is("$text")?n.data.length:n.childCount;else{if(t=="before")return this._createBefore(n);if(t=="after")return this._createAfter(n);if(t!==0&&!t)throw new C.a("view-createpositionat-offset-required",n)}return new ye(n,t)}}static _createAfter(e){if(e.is("$textProxy"))return new ye(e.textNode,e.offsetInText+e.data.length);if(!e.parent)throw new C.a("view-position-after-root",e,{root:e});return new ye(e.parent,e.index+1)}static _createBefore(e){if(e.is("$textProxy"))return new ye(e.textNode,e.offsetInText);if(!e.parent)throw new C.a("view-position-before-root",e,{root:e});return new ye(e.parent,e.index)}}class Ze{constructor(e,t=null){this.start=e.clone(),this.end=t?t.clone():e.clone()}*[Symbol.iterator](){yield*new Qr({boundaries:this,ignoreElementEnd:!0})}get isCollapsed(){return this.start.isEqual(this.end)}get isFlat(){return this.start.parent===this.end.parent}get root(){return this.start.root}getEnlarged(){let e=this.start.getLastMatchingPosition(ic,{direction:"backward"}),t=this.end.getLastMatchingPosition(ic);return e.parent.is("$text")&&e.isAtStart&&(e=ye._createBefore(e.parent)),t.parent.is("$text")&&t.isAtEnd&&(t=ye._createAfter(t.parent)),new Ze(e,t)}getTrimmed(){let e=this.start.getLastMatchingPosition(ic);if(e.isAfter(this.end)||e.isEqual(this.end))return new Ze(e,e);let t=this.end.getLastMatchingPosition(ic,{direction:"backward"});const n=e.nodeAfter,o=t.nodeBefore;return n&&n.is("$text")&&(e=new ye(n,0)),o&&o.is("$text")&&(t=new ye(o,o.data.length)),new Ze(e,t)}isEqual(e){return this==e||this.start.isEqual(e.start)&&this.end.isEqual(e.end)}containsPosition(e){return e.isAfter(this.start)&&e.isBefore(this.end)}containsRange(e,t=!1){e.isCollapsed&&(t=!1);const n=this.containsPosition(e.start)||t&&this.start.isEqual(e.start),o=this.containsPosition(e.end)||t&&this.end.isEqual(e.end);return n&&o}getDifference(e){const t=[];return this.isIntersecting(e)?(this.containsPosition(e.start)&&t.push(new Ze(this.start,e.start)),this.containsPosition(e.end)&&t.push(new Ze(e.end,this.end))):t.push(this.clone()),t}getIntersection(e){if(this.isIntersecting(e)){let t=this.start,n=this.end;return this.containsPosition(e.start)&&(t=e.start),this.containsPosition(e.end)&&(n=e.end),new Ze(t,n)}return null}getWalker(e={}){return e.boundaries=this,new Qr(e)}getCommonAncestor(){return this.start.getCommonAncestor(this.end)}getContainedElement(){if(this.isCollapsed)return null;let e=this.start.nodeAfter,t=this.end.nodeBefore;return this.start.parent.is("$text")&&this.start.isAtEnd&&this.start.parent.nextSibling&&(e=this.start.parent.nextSibling),this.end.parent.is("$text")&&this.end.isAtStart&&this.end.parent.previousSibling&&(t=this.end.parent.previousSibling),e&&e.is("element")&&e===t?e:null}clone(){return new Ze(this.start,this.end)}*getItems(e={}){e.boundaries=this,e.ignoreElementEnd=!0;const t=new Qr(e);for(const n of t)yield n.item}*getPositions(e={}){e.boundaries=this;const t=new Qr(e);yield t.position;for(const n of t)yield n.nextPosition}is(e){return e==="range"||e==="view:range"}isIntersecting(e){return this.start.isBefore(e.end)&&this.end.isAfter(e.start)}static _createFromParentsAndOffsets(e,t,n,o){return new this(new ye(e,t),new ye(n,o))}static _createFromPositionAndShift(e,t){const n=e,o=e.getShiftedBy(t);return t>0?new this(n,o):new this(o,n)}static _createIn(e){return this._createFromParentsAndOffsets(e,0,e,e.childCount)}static _createOn(e){const t=e.is("$textProxy")?e.offsetSize:1;return this._createFromPositionAndShift(ye._createBefore(e),t)}}function ic(i){return!(!i.item.is("attributeElement")&&!i.item.is("uiElement"))}function fn(i){let e=0;for(const t of i)e++;return e}class Yt{constructor(e=null,t,n){this._ranges=[],this._lastRangeBackward=!1,this._isFake=!1,this._fakeSelectionLabel="",this.setTo(e,t,n)}get isFake(){return this._isFake}get fakeSelectionLabel(){return this._fakeSelectionLabel}get anchor(){if(!this._ranges.length)return null;const e=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?e.end:e.start).clone()}get focus(){if(!this._ranges.length)return null;const e=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?e.start:e.end).clone()}get isCollapsed(){return this.rangeCount===1&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}get editableElement(){return this.anchor?this.anchor.editableElement:null}*getRanges(){for(const e of this._ranges)yield e.clone()}getFirstRange(){let e=null;for(const t of this._ranges)e&&!t.start.isBefore(e.start)||(e=t);return e?e.clone():null}getLastRange(){let e=null;for(const t of this._ranges)e&&!t.end.isAfter(e.end)||(e=t);return e?e.clone():null}getFirstPosition(){const e=this.getFirstRange();return e?e.start.clone():null}getLastPosition(){const e=this.getLastRange();return e?e.end.clone():null}isEqual(e){if(this.isFake!=e.isFake||this.isFake&&this.fakeSelectionLabel!=e.fakeSelectionLabel||this.rangeCount!=e.rangeCount)return!1;if(this.rangeCount===0)return!0;if(!this.anchor.isEqual(e.anchor)||!this.focus.isEqual(e.focus))return!1;for(const t of this._ranges){let n=!1;for(const o of e._ranges)if(t.isEqual(o)){n=!0;break}if(!n)return!1}return!0}isSimilar(e){if(this.isBackward!=e.isBackward)return!1;const t=fn(this.getRanges());if(t!=fn(e.getRanges()))return!1;if(t==0)return!0;for(let n of this.getRanges()){n=n.getTrimmed();let o=!1;for(let r of e.getRanges())if(r=r.getTrimmed(),n.start.isEqual(r.start)&&n.end.isEqual(r.end)){o=!0;break}if(!o)return!1}return!0}getSelectedElement(){return this.rangeCount!==1?null:this.getFirstRange().getContainedElement()}setTo(e,t,n){if(e===null)this._setRanges([]),this._setFakeOptions(t);else if(e instanceof Yt||e instanceof Ou)this._setRanges(e.getRanges(),e.isBackward),this._setFakeOptions({fake:e.isFake,label:e.fakeSelectionLabel});else if(e instanceof Ze)this._setRanges([e],t&&t.backward),this._setFakeOptions(t);else if(e instanceof ye)this._setRanges([new Ze(e)]),this._setFakeOptions(t);else if(e instanceof Me){const o=!!n&&!!n.backward;let r;if(t===void 0)throw new C.a("view-selection-setto-required-second-parameter",this);r=t=="in"?Ze._createIn(e):t=="on"?Ze._createOn(e):new Ze(ye._createAt(e,t)),this._setRanges([r],o),this._setFakeOptions(n)}else{if(!Yn(e))throw new C.a("view-selection-setto-not-selectable",this);this._setRanges(e,t&&t.backward),this._setFakeOptions(t)}this.fire("change")}setFocus(e,t){if(this.anchor===null)throw new C.a("view-selection-setfocus-no-ranges",this);const n=ye._createAt(e,t);if(n.compareWith(this.focus)=="same")return;const o=this.anchor;this._ranges.pop(),n.compareWith(o)=="before"?this._addRange(new Ze(n,o),!0):this._addRange(new Ze(o,n)),this.fire("change")}is(e){return e==="selection"||e==="view:selection"}_setRanges(e,t=!1){e=Array.from(e),this._ranges=[];for(const n of e)this._addRange(n);this._lastRangeBackward=!!t}_setFakeOptions(e={}){this._isFake=!!e.fake,this._fakeSelectionLabel=e.fake&&e.label||""}_addRange(e,t=!1){if(!(e instanceof Ze))throw new C.a("view-selection-add-range-not-range",this);this._pushRange(e),this._lastRangeBackward=!!t}_pushRange(e){for(const t of this._ranges)if(e.isIntersecting(t))throw new C.a("view-selection-range-intersects",this,{addedRange:e,intersectingRange:t});this._ranges.push(new Ze(e.start,e.end))}}Be(Yt,F);class Ou{constructor(e=null,t,n){this._selection=new Yt,this._selection.delegate("change").to(this),this._selection.setTo(e,t,n)}get isFake(){return this._selection.isFake}get fakeSelectionLabel(){return this._selection.fakeSelectionLabel}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get isCollapsed(){return this._selection.isCollapsed}get rangeCount(){return this._selection.rangeCount}get isBackward(){return this._selection.isBackward}get editableElement(){return this._selection.editableElement}get _ranges(){return this._selection._ranges}*getRanges(){yield*this._selection.getRanges()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getSelectedElement(){return this._selection.getSelectedElement()}isEqual(e){return this._selection.isEqual(e)}isSimilar(e){return this._selection.isSimilar(e)}is(e){return e==="selection"||e=="documentSelection"||e=="view:selection"||e=="view:documentSelection"}_setTo(e,t,n){this._selection.setTo(e,t,n)}_setFocus(e,t){this._selection.setFocus(e,t)}}Be(Ou,F);class rc extends v{constructor(e,t,n){super(e,t),this.startRange=n,this._eventPhase="none",this._currentTarget=null}get eventPhase(){return this._eventPhase}get currentTarget(){return this._currentTarget}}const sc=Symbol("bubbling contexts");var Kp={fire(i,...e){try{const t=i instanceof v?i:new v(this,i),n=gr(this);if(!n.size)return;if(Yr(t,"capturing",this),gi(n,"$capture",t,...e))return t.return;const o=t.startRange||this.selection.getFirstRange(),r=o?o.getContainedElement():null,a=!!r&&!!ac(n,r);let c=r||function(d){if(!d)return null;const m=d.start.parent,b=d.end.parent,_=m.getPath(),T=b.getPath();return _.length>T.length?m:b}(o);if(Yr(t,"atTarget",c),!a){if(gi(n,"$text",t,...e))return t.return;Yr(t,"bubbling",c)}for(;c;){if(c.is("rootElement")){if(gi(n,"$root",t,...e))return t.return}else if(c.is("element")&&gi(n,c.name,t,...e))return t.return;if(gi(n,c,t,...e))return t.return;c=c.parent,Yr(t,"bubbling",c)}return Yr(t,"bubbling",this),gi(n,"$document",t,...e),t.return}catch(t){C.a.rethrowUnexpectedError(t,this)}},_addEventListener(i,e,t){const n=Tt(t.context||"$document"),o=gr(this);for(const r of n){let a=o.get(r);a||(a=Object.create(F),o.set(r,a)),this.listenTo(a,i,e,t)}},_removeEventListener(i,e){const t=gr(this);for(const n of t.values())this.stopListening(n,i,e)}};function Yr(i,e,t){i instanceof rc&&(i._eventPhase=e,i._currentTarget=t)}function gi(i,e,t,...n){const o=typeof e=="string"?i.get(e):ac(i,e);return!!o&&(o.fire(t,...n),t.stop.called)}function ac(i,e){for(const[t,n]of i)if(typeof t=="function"&&t(e))return n;return null}function gr(i){return i[sc]||(i[sc]=new Map),i[sc]}class $i{constructor(e){this.selection=new Ou,this.roots=new io({idProperty:"rootName"}),this.stylesProcessor=e,this.set("isReadOnly",!1),this.set("isFocused",!1),this.set("isComposing",!1),this._postFixers=new Set}getRoot(e="main"){return this.roots.get(e)}registerPostFixer(e){this._postFixers.add(e)}destroy(){this.roots.map(e=>e.destroy()),this.stopListening()}_callPostFixers(e){let t=!1;do for(const n of this._postFixers)if(t=n(e),t)break;while(t)}}Be($i,Kp),Be($i,Wt);class bi extends Xn{constructor(e,t,n,o){super(e,t,n,o),this.getFillerOffset=lc,this._priority=10,this._id=null,this._clonesGroup=null}get priority(){return this._priority}get id(){return this._id}getElementsWithSameId(){if(this.id===null)throw new C.a("attribute-element-get-elements-with-same-id-no-id",this);return new Set(this._clonesGroup)}is(e,t=null){return t?t===this.name&&(e==="attributeElement"||e==="view:attributeElement"||e==="element"||e==="view:element"):e==="attributeElement"||e==="view:attributeElement"||e==="element"||e==="view:element"||e==="node"||e==="view:node"}isSimilar(e){return this.id!==null||e.id!==null?this.id===e.id:super.isSimilar(e)&&this.priority==e.priority}_clone(e){const t=super._clone(e);return t._priority=this._priority,t._id=this._id,t}}function lc(){if(br(this))return null;let i=this.parent;for(;i&&i.is("attributeElement");){if(br(i)>1)return null;i=i.parent}return!i||br(i)>1?null:this.childCount}function br(i){return Array.from(i.getChildren()).filter(e=>!e.is("uiElement")).length}bi.DEFAULT_PRIORITY=10;class Mh extends Xn{constructor(e,t,n,o){super(e,t,n,o),this._isAllowedInsideAttributeElement=!0,this.getFillerOffset=Gp}is(e,t=null){return t?t===this.name&&(e==="emptyElement"||e==="view:emptyElement"||e==="element"||e==="view:element"):e==="emptyElement"||e==="view:emptyElement"||e==="element"||e==="view:element"||e==="node"||e==="view:node"}_insertChild(e,t){if(t&&(t instanceof Me||Array.from(t).length>0))throw new C.a("view-emptyelement-cannot-add",[this,t])}}function Gp(){return null}const za=navigator.userAgent.toLowerCase();var Cn={isMac:function(i){return i.indexOf("macintosh")>-1}(za),isGecko:function(i){return!!i.match(/gecko\/\d+/)}(za),isSafari:function(i){return i.indexOf(" applewebkit/")>-1&&i.indexOf("chrome")===-1}(za),isAndroid:function(i){return i.indexOf("android")>-1}(za),isBlink:function(i){return i.indexOf("chrome/")>-1&&i.indexOf("edge/")<0}(za),features:{isRegExpUnicodePropertySupported:function(){let i=!1;try{i="ć".search(new RegExp("[\\p{L}]","u"))===0}catch{}return i}()}};const Qp={ctrl:"⌃",cmd:"⌘",alt:"⌥",shift:"⇧"},cc={ctrl:"Ctrl+",alt:"Alt+",shift:"Shift+"},ut=function(){const i={arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,backspace:8,delete:46,enter:13,space:32,esc:27,tab:9,ctrl:1114112,shift:2228224,alt:4456448,cmd:8912896};for(let e=65;e<=90;e++){const t=String.fromCharCode(e);i[t.toLowerCase()]=e}for(let e=48;e<=57;e++)i[e-48]=e;for(let e=112;e<=123;e++)i["f"+(e-111)]=e;return i}(),Oh=Object.fromEntries(Object.entries(ut).map(([i,e])=>[e,i.charAt(0).toUpperCase()+i.slice(1)]));function M(i){let e;if(typeof i=="string"){if(e=ut[i.toLowerCase()],!e)throw new C.a("keyboard-unknown-key",null,{key:i})}else e=i.keyCode+(i.altKey?ut.alt:0)+(i.ctrlKey?ut.ctrl:0)+(i.shiftKey?ut.shift:0)+(i.metaKey?ut.cmd:0);return e}function vr(i){return typeof i=="string"&&(i=function(e){return e.split("+").map(t=>t.trim())}(i)),i.map(e=>typeof e=="string"?function(t){if(t.endsWith("!"))return M(t.slice(0,-1));const n=M(t);return Cn.isMac&&n==ut.ctrl?ut.cmd:n}(e):e).reduce((e,t)=>t+e,0)}function Ba(i){let e=vr(i);return Object.entries(Cn.isMac?Qp:cc).reduce((t,[n,o])=>(e&ut[n]&&(e&=~ut[n],t+=o),t),"")+(e?Oh[e]:"")}function ko(i,e){const t=e==="ltr";switch(i){case ut.arrowleft:return t?"left":"right";case ut.arrowright:return t?"right":"left";case ut.arrowup:return"up";case ut.arrowdown:return"down"}}function wt(i,e){const t=ko(i,e);return t==="down"||t==="right"}class Ru extends Xn{constructor(e,t,n,o){super(e,t,n,o),this._isAllowedInsideAttributeElement=!0,this.getFillerOffset=Xp}is(e,t=null){return t?t===this.name&&(e==="uiElement"||e==="view:uiElement"||e==="element"||e==="view:element"):e==="uiElement"||e==="view:uiElement"||e==="element"||e==="view:element"||e==="node"||e==="view:node"}_insertChild(e,t){if(t&&(t instanceof Me||Array.from(t).length>0))throw new C.a("view-uielement-cannot-add",this)}render(e){return this.toDomElement(e)}toDomElement(e){const t=e.createElement(this.name);for(const n of this.getAttributeKeys())t.setAttribute(n,this.getAttribute(n));return t}}function Yp(i){i.document.on("arrowKey",(e,t)=>function(n,o,r){if(o.keyCode==ut.arrowright){const a=o.domTarget.ownerDocument.defaultView.getSelection(),c=a.rangeCount==1&&a.getRangeAt(0).collapsed;if(c||o.shiftKey){const d=a.focusNode,m=a.focusOffset,b=r.domPositionToView(d,m);if(b===null)return;let _=!1;const T=b.getLastMatchingPosition(E=>(E.item.is("uiElement")&&(_=!0),!(!E.item.is("uiElement")&&!E.item.is("attributeElement"))));if(_){const E=r.viewPositionToDom(T);c?a.collapse(E.parent,E.offset):a.extend(E.parent,E.offset)}}}}(0,t,i.domConverter),{priority:"low"})}function Xp(){return null}class wr extends Xn{constructor(e,t,n,o){super(e,t,n,o),this._isAllowedInsideAttributeElement=!0,this.getFillerOffset=Jp}is(e,t=null){return t?t===this.name&&(e==="rawElement"||e==="view:rawElement"||e==="element"||e==="view:element"):e==="rawElement"||e==="view:rawElement"||e===this.name||e==="view:"+this.name||e==="element"||e==="view:element"||e==="node"||e==="view:node"}_insertChild(e,t){if(t&&(t instanceof Me||Array.from(t).length>0))throw new C.a("view-rawelement-cannot-add",[this,t])}}function Jp(){return null}class Xr{constructor(e,t){this.document=e,this._children=[],t&&this._insertChild(0,t)}[Symbol.iterator](){return this._children[Symbol.iterator]()}get childCount(){return this._children.length}get isEmpty(){return this.childCount===0}get root(){return this}get parent(){return null}is(e){return e==="documentFragment"||e==="view:documentFragment"}_appendChild(e){return this._insertChild(this.childCount,e)}getChild(e){return this._children[e]}getChildIndex(e){return this._children.indexOf(e)}getChildren(){return this._children[Symbol.iterator]()}_insertChild(e,t){this._fireChange("children",this);let n=0;const o=function(r,a){return typeof a=="string"?[new Te(r,a)]:(Yn(a)||(a=[a]),Array.from(a).map(c=>typeof c=="string"?new Te(r,c):c instanceof Ve?new Te(r,c.data):c))}(this.document,t);for(const r of o)r.parent!==null&&r._remove(),r.parent=this,this._children.splice(e,0,r),e++,n++;return n}_removeChildren(e,t=1){this._fireChange("children",this);for(let n=e;n<e+t;n++)this._children[n].parent=null;return this._children.splice(e,t)}_fireChange(e,t){this.fire("change:"+e,t)}}Be(Xr,F);class Rh{constructor(e){this.document=e,this._cloneGroups=new Map}setSelection(e,t,n){this.document.selection._setTo(e,t,n)}setSelectionFocus(e,t){this.document.selection._setFocus(e,t)}createDocumentFragment(e){return new Xr(this.document,e)}createText(e){return new Te(this.document,e)}createAttributeElement(e,t,n={}){const o=new bi(this.document,e,t);return typeof n.priority=="number"&&(o._priority=n.priority),n.id&&(o._id=n.id),o}createContainerElement(e,t,n={}){const o=new oc(this.document,e,t);return n.isAllowedInsideAttributeElement!==void 0&&(o._isAllowedInsideAttributeElement=n.isAllowedInsideAttributeElement),o}createEditableElement(e,t){const n=new Gr(this.document,e,t);return n._document=this.document,n}createEmptyElement(e,t,n={}){const o=new Mh(this.document,e,t);return n.isAllowedInsideAttributeElement!==void 0&&(o._isAllowedInsideAttributeElement=n.isAllowedInsideAttributeElement),o}createUIElement(e,t,n,o={}){const r=new Ru(this.document,e,t);return n&&(r.render=n),o.isAllowedInsideAttributeElement!==void 0&&(r._isAllowedInsideAttributeElement=o.isAllowedInsideAttributeElement),r}createRawElement(e,t,n,o={}){const r=new wr(this.document,e,t);return r.render=n||(()=>{}),o.isAllowedInsideAttributeElement!==void 0&&(r._isAllowedInsideAttributeElement=o.isAllowedInsideAttributeElement),r}setAttribute(e,t,n){n._setAttribute(e,t)}removeAttribute(e,t){t._removeAttribute(e)}addClass(e,t){t._addClass(e)}removeClass(e,t){t._removeClass(e)}setStyle(e,t,n){Nn(e)&&n===void 0&&(n=t),n._setStyle(e,t)}removeStyle(e,t){t._removeStyle(e)}setCustomProperty(e,t,n){n._setCustomProperty(e,t)}removeCustomProperty(e,t){return t._removeCustomProperty(e)}breakAttributes(e){return e instanceof ye?this._breakAttributes(e):this._breakAttributesRange(e)}breakContainer(e){const t=e.parent;if(!t.is("containerElement"))throw new C.a("view-writer-break-non-container-element",this.document);if(!t.parent)throw new C.a("view-writer-break-root",this.document);if(e.isAtStart)return ye._createBefore(t);if(!e.isAtEnd){const n=t._clone(!1);this.insert(ye._createAfter(t),n);const o=new Ze(e,ye._createAt(t,"end")),r=new ye(n,0);this.move(o,r)}return ye._createAfter(t)}mergeAttributes(e){const t=e.offset,n=e.parent;if(n.is("$text"))return e;if(n.is("attributeElement")&&n.childCount===0){const a=n.parent,c=n.index;return n._remove(),this._removeFromClonedElementsGroup(n),this.mergeAttributes(new ye(a,c))}const o=n.getChild(t-1),r=n.getChild(t);if(!o||!r)return e;if(o.is("$text")&&r.is("$text"))return Vh(o,r);if(o.is("attributeElement")&&r.is("attributeElement")&&o.isSimilar(r)){const a=o.childCount;return o._appendChild(r.getChildren()),r._remove(),this._removeFromClonedElementsGroup(r),this.mergeAttributes(new ye(o,a))}return e}mergeContainers(e){const t=e.nodeBefore,n=e.nodeAfter;if(!(t&&n&&t.is("containerElement")&&n.is("containerElement")))throw new C.a("view-writer-merge-containers-invalid-position",this.document);const o=t.getChild(t.childCount-1),r=o instanceof Te?ye._createAt(o,"end"):ye._createAt(t,"end");return this.move(Ze._createIn(n),ye._createAt(t,"end")),this.remove(Ze._createOn(n)),r}insert(e,t){(function a(c,d){for(const m of c){if(!eg.some(b=>m instanceof b))throw new C.a("view-writer-insert-invalid-node-type",d);m.is("$text")||a(m.getChildren(),d)}})(t=Yn(t)?[...t]:[t],this.document);const n=t.reduce((a,c)=>{const d=a[a.length-1],m=!(c.is("uiElement")&&c.isAllowedInsideAttributeElement);return d&&d.breakAttributes==m?d.nodes.push(c):a.push({breakAttributes:m,nodes:[c]}),a},[]);let o=null,r=e;for(const{nodes:a,breakAttributes:c}of n){const d=this._insertNodes(r,a,c);o||(o=d.start),r=d.end}return o?new Ze(o,r):new Ze(e)}remove(e){const t=e instanceof Ze?e:Ze._createOn(e);if(Fa(t,this.document),t.isCollapsed)return new Xr(this.document);const{start:n,end:o}=this._breakAttributesRange(t,!0),r=n.parent,a=o.offset-n.offset,c=r._removeChildren(n.offset,a);for(const m of c)this._removeFromClonedElementsGroup(m);const d=this.mergeAttributes(n);return t.start=d,t.end=d.clone(),new Xr(this.document,c)}clear(e,t){Fa(e,this.document);const n=e.getWalker({direction:"backward",ignoreElementEnd:!0});for(const o of n){const r=o.item;let a;if(r.is("element")&&t.isSimilar(r))a=Ze._createOn(r);else if(!o.nextPosition.isAfter(e.start)&&r.is("$textProxy")){const c=r.getAncestors().find(d=>d.is("element")&&t.isSimilar(d));c&&(a=Ze._createIn(c))}a&&(a.end.isAfter(e.end)&&(a.end=e.end),a.start.isBefore(e.start)&&(a.start=e.start),this.remove(a))}}move(e,t){let n;if(t.isAfter(e.end)){const o=(t=this._breakAttributes(t,!0)).parent,r=o.childCount;e=this._breakAttributesRange(e,!0),n=this.remove(e),t.offset+=o.childCount-r}else n=this.remove(e);return this.insert(t,n)}wrap(e,t){if(!(t instanceof bi))throw new C.a("view-writer-wrap-invalid-attribute",this.document);if(Fa(e,this.document),e.isCollapsed){let o=e.start;o.parent.is("element")&&(n=o.parent,!Array.from(n.getChildren()).some(a=>!a.is("uiElement")))&&(o=o.getLastMatchingPosition(a=>a.item.is("uiElement"))),o=this._wrapPosition(o,t);const r=this.document.selection;return r.isCollapsed&&r.getFirstPosition().isEqual(e.start)&&this.setSelection(o),new Ze(o)}return this._wrapRange(e,t);var n}unwrap(e,t){if(!(t instanceof bi))throw new C.a("view-writer-unwrap-invalid-attribute",this.document);if(Fa(e,this.document),e.isCollapsed)return e;const{start:n,end:o}=this._breakAttributesRange(e,!0),r=n.parent,a=this._unwrapChildren(r,n.offset,o.offset,t),c=this.mergeAttributes(a.start);c.isEqual(a.start)||a.end.offset--;const d=this.mergeAttributes(a.end);return new Ze(c,d)}rename(e,t){const n=new oc(this.document,e,t.getAttributes());return this.insert(ye._createAfter(t),n),this.move(Ze._createIn(t),ye._createAt(n,0)),this.remove(Ze._createOn(t)),n}clearClonedElementsGroup(e){this._cloneGroups.delete(e)}createPositionAt(e,t){return ye._createAt(e,t)}createPositionAfter(e){return ye._createAfter(e)}createPositionBefore(e){return ye._createBefore(e)}createRange(e,t){return new Ze(e,t)}createRangeOn(e){return Ze._createOn(e)}createRangeIn(e){return Ze._createIn(e)}createSelection(e,t,n){return new Yt(e,t,n)}_insertNodes(e,t,n){let o,r;if(o=n?Vu(e):e.parent.is("$text")?e.parent.parent:e.parent,!o)throw new C.a("view-writer-invalid-position-container",this.document);r=n?this._breakAttributes(e,!0):e.parent.is("$text")?Lu(e):e;const a=o._insertChild(r.offset,t);for(const b of t)this._addToClonedElementsGroup(b);const c=r.getShiftedBy(a),d=this.mergeAttributes(r);d.isEqual(r)||c.offset--;const m=this.mergeAttributes(c);return new Ze(d,m)}_wrapChildren(e,t,n,o){let r=t;const a=[];for(;r<n;){const d=e.getChild(r),m=d.is("$text"),b=d.is("attributeElement"),_=d.isAllowedInsideAttributeElement;if(b&&this._wrapAttributeElement(o,d))a.push(new ye(e,r));else if(m||_||b&&Zp(o,d)){const T=o._clone();d._remove(),T._appendChild(d),e._insertChild(r,T),this._addToClonedElementsGroup(T),a.push(new ye(e,r))}else b&&this._wrapChildren(d,0,d.childCount,o);r++}let c=0;for(const d of a)d.offset-=c,d.offset!=t&&(this.mergeAttributes(d).isEqual(d)||(c++,n--));return Ze._createFromParentsAndOffsets(e,t,e,n)}_unwrapChildren(e,t,n,o){let r=t;const a=[];for(;r<n;){const d=e.getChild(r);if(d.is("attributeElement"))if(d.isSimilar(o)){const m=d.getChildren(),b=d.childCount;d._remove(),e._insertChild(r,m),this._removeFromClonedElementsGroup(d),a.push(new ye(e,r),new ye(e,r+b)),r+=b,n+=b-1}else this._unwrapAttributeElement(o,d)?(a.push(new ye(e,r),new ye(e,r+1)),r++):(this._unwrapChildren(d,0,d.childCount,o),r++);else r++}let c=0;for(const d of a)d.offset-=c,!(d.offset==t||d.offset==n)&&(this.mergeAttributes(d).isEqual(d)||(c++,n--));return Ze._createFromParentsAndOffsets(e,t,e,n)}_wrapRange(e,t){const{start:n,end:o}=this._breakAttributesRange(e,!0),r=n.parent,a=this._wrapChildren(r,n.offset,o.offset,t),c=this.mergeAttributes(a.start);c.isEqual(a.start)||a.end.offset--;const d=this.mergeAttributes(a.end);return new Ze(c,d)}_wrapPosition(e,t){if(t.isSimilar(e.parent))return vi(e.clone());e.parent.is("$text")&&(e=Lu(e));const n=this.createAttributeElement();n._priority=Number.POSITIVE_INFINITY,n.isSimilar=()=>!1,e.parent._insertChild(e.offset,n);const o=new Ze(e,e.getShiftedBy(1));this.wrap(o,t);const r=new ye(n.parent,n.index);n._remove();const a=r.nodeBefore,c=r.nodeAfter;return a instanceof Te&&c instanceof Te?Vh(a,c):vi(r)}_wrapAttributeElement(e,t){if(!wi(e,t)||e.name!==t.name||e.priority!==t.priority)return!1;for(const n of e.getAttributeKeys())if(n!=="class"&&n!=="style"&&t.hasAttribute(n)&&t.getAttribute(n)!==e.getAttribute(n))return!1;for(const n of e.getStyleNames())if(t.hasStyle(n)&&t.getStyle(n)!==e.getStyle(n))return!1;for(const n of e.getAttributeKeys())n!=="class"&&n!=="style"&&(t.hasAttribute(n)||this.setAttribute(n,e.getAttribute(n),t));for(const n of e.getStyleNames())t.hasStyle(n)||this.setStyle(n,e.getStyle(n),t);for(const n of e.getClassNames())t.hasClass(n)||this.addClass(n,t);return!0}_unwrapAttributeElement(e,t){if(!wi(e,t)||e.name!==t.name||e.priority!==t.priority)return!1;for(const n of e.getAttributeKeys())if(n!=="class"&&n!=="style"&&(!t.hasAttribute(n)||t.getAttribute(n)!==e.getAttribute(n)))return!1;if(!t.hasClass(...e.getClassNames()))return!1;for(const n of e.getStyleNames())if(!t.hasStyle(n)||t.getStyle(n)!==e.getStyle(n))return!1;for(const n of e.getAttributeKeys())n!=="class"&&n!=="style"&&this.removeAttribute(n,t);return this.removeClass(Array.from(e.getClassNames()),t),this.removeStyle(Array.from(e.getStyleNames()),t),!0}_breakAttributesRange(e,t=!1){const n=e.start,o=e.end;if(Fa(e,this.document),e.isCollapsed){const d=this._breakAttributes(e.start,t);return new Ze(d,d)}const r=this._breakAttributes(o,t),a=r.parent.childCount,c=this._breakAttributes(n,t);return r.offset+=r.parent.childCount-a,new Ze(c,r)}_breakAttributes(e,t=!1){const n=e.offset,o=e.parent;if(e.parent.is("emptyElement"))throw new C.a("view-writer-cannot-break-empty-element",this.document);if(e.parent.is("uiElement"))throw new C.a("view-writer-cannot-break-ui-element",this.document);if(e.parent.is("rawElement"))throw new C.a("view-writer-cannot-break-raw-element",this.document);if(!t&&o.is("$text")&&zu(o.parent)||zu(o))return e.clone();if(o.is("$text"))return this._breakAttributes(Lu(e),t);if(n==o.childCount){const r=new ye(o.parent,o.index+1);return this._breakAttributes(r,t)}if(n===0){const r=new ye(o.parent,o.index);return this._breakAttributes(r,t)}{const r=o.index+1,a=o._clone();o.parent._insertChild(r,a),this._addToClonedElementsGroup(a);const c=o.childCount-n,d=o._removeChildren(n,c);a._appendChild(d);const m=new ye(o.parent,r);return this._breakAttributes(m,t)}}_addToClonedElementsGroup(e){if(!e.root.is("rootElement"))return;if(e.is("element"))for(const o of e.getChildren())this._addToClonedElementsGroup(o);const t=e.id;if(!t)return;let n=this._cloneGroups.get(t);n||(n=new Set,this._cloneGroups.set(t,n)),n.add(e),e._clonesGroup=n}_removeFromClonedElementsGroup(e){if(e.is("element"))for(const o of e.getChildren())this._removeFromClonedElementsGroup(o);const t=e.id;if(!t)return;const n=this._cloneGroups.get(t);n&&n.delete(e)}}function Vu(i){let e=i.parent;for(;!zu(e);){if(!e)return;e=e.parent}return e}function Zp(i,e){return i.priority<e.priority||!(i.priority>e.priority)&&i.getIdentity()<e.getIdentity()}function vi(i){const e=i.nodeBefore;if(e&&e.is("$text"))return new ye(e,e.data.length);const t=i.nodeAfter;return t&&t.is("$text")?new ye(t,0):i}function Lu(i){if(i.offset==i.parent.data.length)return new ye(i.parent.parent,i.parent.index+1);if(i.offset===0)return new ye(i.parent.parent,i.parent.index);const e=i.parent.data.slice(i.offset);return i.parent._data=i.parent.data.slice(0,i.offset),i.parent.parent._insertChild(i.parent.index+1,new Te(i.root.document,e)),new ye(i.parent.parent,i.parent.index+1)}function Vh(i,e){const t=i.data.length;return i._data+=e.data,e._remove(),new ye(i,t)}const eg=[Te,bi,oc,Mh,wr,Ru];function zu(i){return i&&(i.is("containerElement")||i.is("documentFragment"))}function Fa(i,e){const t=Vu(i.start),n=Vu(i.end);if(!t||!n||t!==n)throw new C.a("view-writer-invalid-range-container",e)}function wi(i,e){return i.id===null&&e.id===null}function Pn(i){return Object.prototype.toString.call(i)=="[object Text]"}const Lh=i=>i.createTextNode(" "),zh=i=>{const e=i.createElement("span");return e.dataset.ckeFiller=!0,e.innerHTML=" ",e},Bh=i=>{const e=i.createElement("br");return e.dataset.ckeFiller=!0,e},uc="⁠".repeat(7);function En(i){return Pn(i)&&i.data.substr(0,7)===uc}function dc(i){return i.data.length==7&&En(i)}function Bu(i){return En(i)?i.data.slice(7):i.data}function Yo(i,e){if(e.keyCode==ut.arrowleft){const t=e.domTarget.ownerDocument.defaultView.getSelection();if(t.rangeCount==1&&t.getRangeAt(0).collapsed){const n=t.getRangeAt(0).startContainer,o=t.getRangeAt(0).startOffset;En(n)&&o<=7&&t.collapse(n,0)}}}function Fh(i,e,t,n=!1){t=t||function(r,a){return r===a},Array.isArray(i)||(i=Array.prototype.slice.call(i)),Array.isArray(e)||(e=Array.prototype.slice.call(e));const o=function(r,a,c){const d=qh(r,a,c);if(d===-1)return{firstIndex:-1,lastIndexOld:-1,lastIndexNew:-1};const m=Hh(r,d),b=Hh(a,d),_=qh(m,b,c),T=r.length-_,E=a.length-_;return{firstIndex:d,lastIndexOld:T,lastIndexNew:E}}(i,e,t);return n?function(r,a){const{firstIndex:c,lastIndexOld:d,lastIndexNew:m}=r;if(c===-1)return Array(a).fill("equal");let b=[];return c>0&&(b=b.concat(Array(c).fill("equal"))),m-c>0&&(b=b.concat(Array(m-c).fill("insert"))),d-c>0&&(b=b.concat(Array(d-c).fill("delete"))),m<a&&(b=b.concat(Array(a-m).fill("equal"))),b}(o,e.length):function(r,a){const c=[],{firstIndex:d,lastIndexOld:m,lastIndexNew:b}=a;return b-d>0&&c.push({index:d,type:"insert",values:r.slice(d,b)}),m-d>0&&c.push({index:d+(b-d),type:"delete",howMany:m-d}),c}(e,o)}function qh(i,e,t){for(let n=0;n<Math.max(i.length,e.length);n++)if(i[n]===void 0||e[n]===void 0||!t(i[n],e[n]))return n;return-1}function Hh(i,e){return i.slice(e).reverse()}function kr(i,e,t){t=t||function(R,z){return R===z};const n=i.length,o=e.length;if(n>200||o>200||n+o>300)return kr.fastDiff(i,e,t,!0);let r,a;if(o<n){const R=i;i=e,e=R,r="delete",a="insert"}else r="insert",a="delete";const c=i.length,d=e.length,m=d-c,b={},_={};function T(R){const z=(_[R-1]!==void 0?_[R-1]:-1)+1,$=_[R+1]!==void 0?_[R+1]:-1,J=z>$?-1:1;b[R+J]&&(b[R]=b[R+J].slice(0)),b[R]||(b[R]=[]),b[R].push(z>$?r:a);let ue=Math.max(z,$),xe=ue-R;for(;xe<c&&ue<d&&t(i[xe],e[ue]);)xe++,ue++,b[R].push("equal");return ue}let E,P=0;do{for(E=-P;E<m;E++)_[E]=T(E);for(E=m+P;E>m;E--)_[E]=T(E);_[m]=T(m),P++}while(_[m]!==d);return b[m].slice(1)}function $h(i,e,t){i.insertBefore(t,i.childNodes[e]||null)}function Fu(i){const e=i.parentNode;e&&e.removeChild(i)}function Jr(i){if(i){if(i.defaultView)return i instanceof i.defaultView.Document;if(i.ownerDocument&&i.ownerDocument.defaultView)return i instanceof i.ownerDocument.defaultView.Node}return!1}kr.fastDiff=Fh;class Uh{constructor(e,t){this.domDocuments=new Set,this.domConverter=e,this.markedAttributes=new Set,this.markedChildren=new Set,this.markedTexts=new Set,this.selection=t,this.isFocused=!1,this._inlineFiller=null,this._fakeSelectionContainer=null}markToSync(e,t){if(e==="text")this.domConverter.mapViewToDom(t.parent)&&this.markedTexts.add(t);else{if(!this.domConverter.mapViewToDom(t))return;if(e==="attributes")this.markedAttributes.add(t);else{if(e!=="children")throw new C.a("view-renderer-unknown-type",this);this.markedChildren.add(t)}}}render(){let e;for(const t of this.markedChildren)this._updateChildrenMappings(t);this._inlineFiller&&!this._isSelectionInInlineFiller()&&this._removeInlineFiller(),this._inlineFiller?e=this._getInlineFillerPosition():this._needsInlineFillerAtSelection()&&(e=this.selection.getFirstPosition(),this.markedChildren.add(e.parent));for(const t of this.markedAttributes)this._updateAttrs(t);for(const t of this.markedChildren)this._updateChildren(t,{inlineFillerPosition:e});for(const t of this.markedTexts)!this.markedChildren.has(t.parent)&&this.domConverter.mapViewToDom(t.parent)&&this._updateText(t,{inlineFillerPosition:e});if(e){const t=this.domConverter.viewPositionToDom(e),n=t.parent.ownerDocument;En(t.parent)?this._inlineFiller=t.parent:this._inlineFiller=Wh(n,t.parent,t.offset)}else this._inlineFiller=null;this._updateFocus(),this._updateSelection(),this.markedTexts.clear(),this.markedAttributes.clear(),this.markedChildren.clear()}_updateChildrenMappings(e){const t=this.domConverter.mapViewToDom(e);if(!t)return;const n=Array.from(this.domConverter.mapViewToDom(e).childNodes),o=Array.from(this.domConverter.viewChildrenToDom(e,t.ownerDocument,{withChildren:!1})),r=this._diffNodeLists(n,o),a=this._findReplaceActions(r,n,o);if(a.indexOf("replace")!==-1){const c={equal:0,insert:0,delete:0};for(const d of a)if(d==="replace"){const m=c.equal+c.insert,b=c.equal+c.delete,_=e.getChild(m);!_||_.is("uiElement")||_.is("rawElement")||this._updateElementMappings(_,n[b]),Fu(o[m]),c.equal++}else c[d]++}}_updateElementMappings(e,t){this.domConverter.unbindDomElement(t),this.domConverter.bindElements(t,e),this.markedChildren.add(e),this.markedAttributes.add(e)}_getInlineFillerPosition(){const e=this.selection.getFirstPosition();return e.parent.is("$text")?ye._createBefore(this.selection.getFirstPosition().parent):e}_isSelectionInInlineFiller(){if(this.selection.rangeCount!=1||!this.selection.isCollapsed)return!1;const e=this.selection.getFirstPosition(),t=this.domConverter.viewPositionToDom(e);return!!(t&&Pn(t.parent)&&En(t.parent))}_removeInlineFiller(){const e=this._inlineFiller;if(!En(e))throw new C.a("view-renderer-filler-was-lost",this);dc(e)?e.parentNode.removeChild(e):e.data=e.data.substr(7),this._inlineFiller=null}_needsInlineFillerAtSelection(){if(this.selection.rangeCount!=1||!this.selection.isCollapsed)return!1;const e=this.selection.getFirstPosition(),t=e.parent,n=e.offset;if(!this.domConverter.mapViewToDom(t.root)||!t.is("element")||!function(a){if(a.getAttribute("contenteditable")=="false")return!1;const c=a.findAncestor(d=>d.hasAttribute("contenteditable"));return!c||c.getAttribute("contenteditable")=="true"}(t)||n===t.getFillerOffset())return!1;const o=e.nodeBefore,r=e.nodeAfter;return!(o instanceof Te||r instanceof Te)}_updateText(e,t){const n=this.domConverter.findCorrespondingDomText(e),o=this.domConverter.viewToDom(e,n.ownerDocument),r=n.data;let a=o.data;const c=t.inlineFillerPosition;if(c&&c.parent==e.parent&&c.offset==e.index&&(a=uc+a),r!=a){const d=Fh(r,a);for(const m of d)m.type==="insert"?n.insertData(m.index,m.values.join("")):n.deleteData(m.index,m.howMany)}}_updateAttrs(e){const t=this.domConverter.mapViewToDom(e);if(!t)return;const n=Array.from(t.attributes).map(r=>r.name),o=e.getAttributeKeys();for(const r of o)t.setAttribute(r,e.getAttribute(r));for(const r of n)e.hasAttribute(r)||t.removeAttribute(r)}_updateChildren(e,t){const n=this.domConverter.mapViewToDom(e);if(!n)return;const o=t.inlineFillerPosition,r=this.domConverter.mapViewToDom(e).childNodes,a=Array.from(this.domConverter.viewChildrenToDom(e,n.ownerDocument,{bind:!0,inlineFillerPosition:o}));o&&o.parent===e&&Wh(n.ownerDocument,a,o.offset);const c=this._diffNodeLists(r,a);let d=0;const m=new Set;for(const b of c)b==="delete"?(m.add(r[d]),Fu(r[d])):b==="equal"&&d++;d=0;for(const b of c)b==="insert"?($h(n,d,a[d]),d++):b==="equal"&&(this._markDescendantTextToSync(this.domConverter.domToView(a[d])),d++);for(const b of m)b.parentNode||this.domConverter.unbindDomElement(b)}_diffNodeLists(e,t){return kr(e=function(n,o){const r=Array.from(n);return r.length==0||!o||r[r.length-1]==o&&r.pop(),r}(e,this._fakeSelectionContainer),t,qa.bind(null,this.domConverter))}_findReplaceActions(e,t,n){if(e.indexOf("insert")===-1||e.indexOf("delete")===-1)return e;let o=[],r=[],a=[];const c={equal:0,insert:0,delete:0};for(const d of e)d==="insert"?a.push(n[c.equal+c.insert]):d==="delete"?r.push(t[c.equal+c.delete]):(o=o.concat(kr(r,a,hc).map(m=>m==="equal"?"replace":m)),o.push("equal"),r=[],a=[]),c[d]++;return o.concat(kr(r,a,hc).map(d=>d==="equal"?"replace":d))}_markDescendantTextToSync(e){if(e){if(e.is("$text"))this.markedTexts.add(e);else if(e.is("element"))for(const t of e.getChildren())this._markDescendantTextToSync(t)}}_updateSelection(){if(this.selection.rangeCount===0)return this._removeDomSelection(),void this._removeFakeSelection();const e=this.domConverter.mapViewToDom(this.selection.editableElement);this.isFocused&&e&&(this.selection.isFake?this._updateFakeSelection(e):(this._removeFakeSelection(),this._updateDomSelection(e)))}_updateFakeSelection(e){const t=e.ownerDocument;this._fakeSelectionContainer||(this._fakeSelectionContainer=function(a){const c=a.createElement("div");return c.className="ck-fake-selection-container",Object.assign(c.style,{position:"fixed",top:0,left:"-9999px",width:"42px"}),c.textContent=" ",c}(t));const n=this._fakeSelectionContainer;if(this.domConverter.bindFakeSelection(n,this.selection),!this._fakeSelectionNeedsUpdate(e))return;n.parentElement&&n.parentElement==e||e.appendChild(n),n.textContent=this.selection.fakeSelectionLabel||" ";const o=t.getSelection(),r=t.createRange();o.removeAllRanges(),r.selectNodeContents(n),o.addRange(r)}_updateDomSelection(e){const t=e.ownerDocument.defaultView.getSelection();if(!this._domSelectionNeedsUpdate(t))return;const n=this.domConverter.viewPositionToDom(this.selection.anchor),o=this.domConverter.viewPositionToDom(this.selection.focus);t.collapse(n.parent,n.offset),t.extend(o.parent,o.offset),Cn.isGecko&&function(r,a){const c=r.parent;if(c.nodeType!=Node.ELEMENT_NODE||r.offset!=c.childNodes.length-1)return;const d=c.childNodes[r.offset];d&&d.tagName=="BR"&&a.addRange(a.getRangeAt(0))}(o,t)}_domSelectionNeedsUpdate(e){if(!this.domConverter.isDomSelectionCorrect(e))return!0;const t=e&&this.domConverter.domSelectionToView(e);return(!t||!this.selection.isEqual(t))&&!(!this.selection.isCollapsed&&this.selection.isSimilar(t))}_fakeSelectionNeedsUpdate(e){const t=this._fakeSelectionContainer,n=e.ownerDocument.getSelection();return!t||t.parentElement!==e||n.anchorNode!==t&&!t.contains(n.anchorNode)||t.textContent!==this.selection.fakeSelectionLabel}_removeDomSelection(){for(const e of this.domDocuments)if(e.getSelection().rangeCount){const t=e.activeElement,n=this.domConverter.mapDomToView(t);t&&n&&e.getSelection().removeAllRanges()}}_removeFakeSelection(){const e=this._fakeSelectionContainer;e&&e.remove()}_updateFocus(){if(this.isFocused){const e=this.selection.editableElement;e&&this.domConverter.focus(e)}}}function Wh(i,e,t){const n=e instanceof Array?e:e.childNodes,o=n[t];if(Pn(o))return o.data=uc+o.data,o;{const r=i.createTextNode(uc);return Array.isArray(e)?n.splice(t,0,r):$h(e,t,r),r}}function hc(i,e){return Jr(i)&&Jr(e)&&!Pn(i)&&!Pn(e)&&i.nodeType!==Node.COMMENT_NODE&&e.nodeType!==Node.COMMENT_NODE&&i.tagName.toLowerCase()===e.tagName.toLowerCase()}function qa(i,e,t){return e===t||(Pn(e)&&Pn(t)?e.data===t.data:!(!i.isBlockFiller(e)||!i.isBlockFiller(t)))}Be(Uh,Wt);var qt={window,document};function qu(i){let e=0;for(;i.previousSibling;)i=i.previousSibling,e++;return e}function Hu(i){const e=[];for(;i&&i.nodeType!=Node.DOCUMENT_NODE;)e.unshift(i),i=i.parentNode;return e}const tg=Bh(document),Ui=Lh(document),$u=zh(document);class ki{constructor(e,t={}){this.document=e,this.blockFillerMode=t.blockFillerMode||"br",this.preElements=["pre"],this.blockElements=["address","article","aside","blockquote","caption","center","dd","details","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","legend","li","main","menu","nav","ol","p","pre","section","summary","table","tbody","td","tfoot","th","thead","tr","ul"],this.inlineObjectElements=["object","iframe","input","button","textarea","select","option","video","embed","audio","img","canvas"],this._domToViewMapping=new WeakMap,this._viewToDomMapping=new WeakMap,this._fakeSelectionMapping=new WeakMap,this._rawContentElementMatcher=new Ct,this._encounteredRawContentDomNodes=new WeakSet}bindFakeSelection(e,t){this._fakeSelectionMapping.set(e,new Yt(t))}fakeSelectionToView(e){return this._fakeSelectionMapping.get(e)}bindElements(e,t){this._domToViewMapping.set(e,t),this._viewToDomMapping.set(t,e)}unbindDomElement(e){const t=this._domToViewMapping.get(e);if(t){this._domToViewMapping.delete(e),this._viewToDomMapping.delete(t);for(const n of e.childNodes)this.unbindDomElement(n)}}bindDocumentFragments(e,t){this._domToViewMapping.set(e,t),this._viewToDomMapping.set(t,e)}viewToDom(e,t,n={}){if(e.is("$text")){const o=this._processDataFromViewText(e);return t.createTextNode(o)}{if(this.mapViewToDom(e))return this.mapViewToDom(e);let o;if(e.is("documentFragment"))o=t.createDocumentFragment(),n.bind&&this.bindDocumentFragments(o,e);else{if(e.is("uiElement"))return o=e.name==="$comment"?t.createComment(e.getCustomProperty("$rawContent")):e.render(t),n.bind&&this.bindElements(o,e),o;o=e.hasAttribute("xmlns")?t.createElementNS(e.getAttribute("xmlns"),e.name):t.createElement(e.name),e.is("rawElement")&&e.render(o),n.bind&&this.bindElements(o,e);for(const r of e.getAttributeKeys())o.setAttribute(r,e.getAttribute(r))}if(n.withChildren!==!1)for(const r of this.viewChildrenToDom(e,t,n))o.appendChild(r);return o}}*viewChildrenToDom(e,t,n={}){const o=e.getFillerOffset&&e.getFillerOffset();let r=0;for(const a of e.getChildren())o===r&&(yield this._getBlockFiller(t)),yield this.viewToDom(a,t,n),r++;o===r&&(yield this._getBlockFiller(t))}viewRangeToDom(e){const t=this.viewPositionToDom(e.start),n=this.viewPositionToDom(e.end),o=document.createRange();return o.setStart(t.parent,t.offset),o.setEnd(n.parent,n.offset),o}viewPositionToDom(e){const t=e.parent;if(t.is("$text")){const n=this.findCorrespondingDomText(t);if(!n)return null;let o=e.offset;return En(n)&&(o+=7),{parent:n,offset:o}}{let n,o,r;if(e.offset===0){if(n=this.mapViewToDom(t),!n)return null;r=n.childNodes[0]}else{const a=e.nodeBefore;if(o=a.is("$text")?this.findCorrespondingDomText(a):this.mapViewToDom(e.nodeBefore),!o)return null;n=o.parentNode,r=o.nextSibling}return Pn(r)&&En(r)?{parent:r,offset:7}:{parent:n,offset:o?qu(o)+1:0}}}domToView(e,t={}){if(this.isBlockFiller(e))return null;const n=this.getHostViewElement(e);if(n)return n;if(this.isComment(e)&&t.skipComments)return null;if(Pn(e)){if(dc(e))return null;{const o=this._processDataFromDomText(e);return o===""?null:new Te(this.document,o)}}{if(this.mapDomToView(e))return this.mapDomToView(e);let o;if(this.isDocumentFragment(e))o=new Xr(this.document),t.bind&&this.bindDocumentFragments(e,o);else{o=this._createViewElement(e,t),t.bind&&this.bindElements(e,o);const r=e.attributes;if(r)for(let a=r.length-1;a>=0;a--)o._setAttribute(r[a].name,r[a].value);if(this._isViewElementWithRawContent(o,t)||this.isComment(e)){const a=this.isComment(e)?e.data:e.innerHTML;return o._setCustomProperty("$rawContent",a),this._encounteredRawContentDomNodes.add(e),o}}if(t.withChildren!==!1)for(const r of this.domChildrenToView(e,t))o._appendChild(r);return o}}*domChildrenToView(e,t={}){for(let n=0;n<e.childNodes.length;n++){const o=e.childNodes[n],r=this.domToView(o,t);r!==null&&(yield r)}}domSelectionToView(e){if(e.rangeCount===1){let o=e.getRangeAt(0).startContainer;Pn(o)&&(o=o.parentNode);const r=this.fakeSelectionToView(o);if(r)return r}const t=this.isDomSelectionBackward(e),n=[];for(let o=0;o<e.rangeCount;o++){const r=e.getRangeAt(o),a=this.domRangeToView(r);a&&n.push(a)}return new Yt(n,{backward:t})}domRangeToView(e){const t=this.domPositionToView(e.startContainer,e.startOffset),n=this.domPositionToView(e.endContainer,e.endOffset);return t&&n?new Ze(t,n):null}domPositionToView(e,t){if(this.isBlockFiller(e))return this.domPositionToView(e.parentNode,qu(e));const n=this.mapDomToView(e);if(n&&(n.is("uiElement")||n.is("rawElement")))return ye._createBefore(n);if(Pn(e)){if(dc(e))return this.domPositionToView(e.parentNode,qu(e));const o=this.findCorrespondingViewText(e);let r=t;return o?(En(e)&&(r-=7,r=r<0?0:r),new ye(o,r)):null}if(t===0){const o=this.mapDomToView(e);if(o)return new ye(o,0)}else{const o=e.childNodes[t-1],r=Pn(o)?this.findCorrespondingViewText(o):this.mapDomToView(o);if(r&&r.parent)return new ye(r.parent,r.index+1)}return null}mapDomToView(e){return this.getHostViewElement(e)||this._domToViewMapping.get(e)}findCorrespondingViewText(e){if(dc(e))return null;const t=this.getHostViewElement(e);if(t)return t;const n=e.previousSibling;if(n){if(!this.isElement(n))return null;const o=this.mapDomToView(n);if(o)return o.nextSibling instanceof Te?o.nextSibling:null}else{const o=this.mapDomToView(e.parentNode);if(o){const r=o.getChild(0);return r instanceof Te?r:null}}return null}mapViewToDom(e){return this._viewToDomMapping.get(e)}findCorrespondingDomText(e){const t=e.previousSibling;return t&&this.mapViewToDom(t)?this.mapViewToDom(t).nextSibling:!t&&e.parent&&this.mapViewToDom(e.parent)?this.mapViewToDom(e.parent).childNodes[0]:null}focus(e){const t=this.mapViewToDom(e);if(t&&t.ownerDocument.activeElement!==t){const{scrollX:n,scrollY:o}=qt.window,r=[];_o(t,a=>{const{scrollLeft:c,scrollTop:d}=a;r.push([c,d])}),t.focus(),_o(t,a=>{const[c,d]=r.shift();a.scrollLeft=c,a.scrollTop=d}),qt.window.scrollTo(n,o)}}isElement(e){return e&&e.nodeType==Node.ELEMENT_NODE}isDocumentFragment(e){return e&&e.nodeType==Node.DOCUMENT_FRAGMENT_NODE}isComment(e){return e&&e.nodeType==Node.COMMENT_NODE}isBlockFiller(e){return this.blockFillerMode=="br"?e.isEqualNode(tg):!(e.tagName!=="BR"||!Kh(e,this.blockElements)||e.parentNode.childNodes.length!==1)||e.isEqualNode($u)||function(t,n){return t.isEqualNode(Ui)&&Kh(t,n)&&t.parentNode.childNodes.length===1}(e,this.blockElements)}isDomSelectionBackward(e){if(e.isCollapsed)return!1;const t=document.createRange();t.setStart(e.anchorNode,e.anchorOffset),t.setEnd(e.focusNode,e.focusOffset);const n=t.collapsed;return t.detach(),n}getHostViewElement(e){const t=Hu(e);for(t.pop();t.length;){const n=t.pop(),o=this._domToViewMapping.get(n);if(o&&(o.is("uiElement")||o.is("rawElement")))return o}return null}isDomSelectionCorrect(e){return this._isDomSelectionPositionCorrect(e.anchorNode,e.anchorOffset)&&this._isDomSelectionPositionCorrect(e.focusNode,e.focusOffset)}registerRawContentMatcher(e){this._rawContentElementMatcher.add(e)}_getBlockFiller(e){switch(this.blockFillerMode){case"nbsp":return Lh(e);case"markedNbsp":return zh(e);case"br":return Bh(e)}}_isDomSelectionPositionCorrect(e,t){if(Pn(e)&&En(e)&&t<7||this.isElement(e)&&En(e.childNodes[t]))return!1;const n=this.mapDomToView(e);return!n||!n.is("uiElement")&&!n.is("rawElement")}_processDataFromViewText(e){let t=e.data;if(e.getAncestors().some(n=>this.preElements.includes(n.name)))return t;if(t.charAt(0)==" "){const n=this._getTouchingInlineViewNode(e,!1);!(n&&n.is("$textProxy")&&this._nodeEndsWithSpace(n))&&n||(t=" "+t.substr(1))}if(t.charAt(t.length-1)==" "){const n=this._getTouchingInlineViewNode(e,!0),o=n&&n.is("$textProxy")&&n.data.charAt(0)==" ";t.charAt(t.length-2)!=" "&&n&&!o||(t=t.substr(0,t.length-1)+" ")}return t.replace(/ {2}/g,"  ")}_nodeEndsWithSpace(e){if(e.getAncestors().some(n=>this.preElements.includes(n.name)))return!1;const t=this._processDataFromViewText(e);return t.charAt(t.length-1)==" "}_processDataFromDomText(e){let t=e.data;if(function(m,b){return Hu(m).some(_=>_.tagName&&b.includes(_.tagName.toLowerCase()))}(e,this.preElements))return Bu(e);t=t.replace(/[ \n\t\r]{1,}/g," ");const n=this._getTouchingInlineDomNode(e,!1),o=this._getTouchingInlineDomNode(e,!0),r=this._checkShouldLeftTrimDomText(e,n),a=this._checkShouldRightTrimDomText(e,o);r&&(t=t.replace(/^ /,"")),a&&(t=t.replace(/ $/,"")),t=Bu(new Text(t)),t=t.replace(/ \u00A0/g,"  ");const c=o&&this.isElement(o)&&o.tagName!="BR",d=o&&Pn(o)&&o.data.charAt(0)==" ";return(/( |\u00A0)\u00A0$/.test(t)||!o||c||d)&&(t=t.replace(/\u00A0$/," ")),(r||n&&this.isElement(n)&&n.tagName!="BR")&&(t=t.replace(/^\u00A0/," ")),t}_checkShouldLeftTrimDomText(e,t){return!t||(this.isElement(t)?t.tagName==="BR":!this._encounteredRawContentDomNodes.has(e.previousSibling)&&/[^\S\u00A0]/.test(t.data.charAt(t.data.length-1)))}_checkShouldRightTrimDomText(e,t){return!t&&!En(e)}_getTouchingInlineViewNode(e,t){const n=new Qr({startPosition:t?ye._createAfter(e):ye._createBefore(e),direction:t?"forward":"backward"});for(const o of n){if(o.item.is("element")&&this.inlineObjectElements.includes(o.item.name))return o.item;if(o.item.is("containerElement")||o.item.is("element","br"))return null;if(o.item.is("$textProxy"))return o.item}return null}_getTouchingInlineDomNode(e,t){if(!e.parentNode)return null;const n=t?"firstChild":"lastChild",o=t?"nextSibling":"previousSibling";let r=!0;do if(!r&&e[n]?e=e[n]:e[o]?(e=e[o],r=!1):(e=e.parentNode,r=!0),!e||this._isBlockElement(e))return null;while(!Pn(e)&&e.tagName!="BR"&&!this._isInlineObjectElement(e));return e}_isBlockElement(e){return this.isElement(e)&&this.blockElements.includes(e.tagName.toLowerCase())}_isInlineObjectElement(e){return this.isElement(e)&&this.inlineObjectElements.includes(e.tagName.toLowerCase())}_createViewElement(e,t){if(this.isComment(e))return new Ru(this.document,"$comment");const n=t.keepOriginalCase?e.tagName:e.tagName.toLowerCase();return new Xn(this.document,n)}_isViewElementWithRawContent(e,t){return t.withChildren!==!1&&this._rawContentElementMatcher.match(e)}}function _o(i,e){for(;i&&i!=qt.document;)e(i),i=i.parentNode}function Kh(i,e){const t=i.parentNode;return t&&t.tagName&&e.includes(t.tagName.toLowerCase())}function Ha(i){const e=Object.prototype.toString.apply(i);return e=="[object Window]"||e=="[object global]"}var Zr=Mr({},F,{listenTo(i,...e){if(Jr(i)||Ha(i)){const t=this._getProxyEmitter(i)||new es(i);t.attach(...e),i=t}F.listenTo.call(this,i,...e)},stopListening(i,e,t){if(Jr(i)||Ha(i)){const n=this._getProxyEmitter(i);if(!n)return;i=n}F.stopListening.call(this,i,e,t),i instanceof es&&i.detach(e)},_getProxyEmitter(i){return e=this,t=Wi(i),e[L]&&e[L][t]?e[L][t].emitter:null;var e,t}});class es{constructor(e){q(this,Wi(e)),this._domNode=e}}function Wi(i){return i["data-ck-expando"]||(i["data-ck-expando"]=S())}Mr(es.prototype,F,{attach(i,e,t={}){if(this._domListeners&&this._domListeners[i])return;const n={capture:!!t.useCapture,passive:!!t.usePassive},o=this._createDomListener(i,n);this._domNode.addEventListener(i,o,n),this._domListeners||(this._domListeners={}),this._domListeners[i]=o},detach(i){let e;!this._domListeners[i]||(e=this._events[i])&&e.callbacks.length||this._domListeners[i].removeListener()},_createDomListener(i,e){const t=n=>{this.fire(i,n)};return t.removeListener=()=>{this._domNode.removeEventListener(i,t,e),delete this._domListeners[i]},t}});class _i{constructor(e){this.view=e,this.document=e.document,this.isEnabled=!1}enable(){this.isEnabled=!0}disable(){this.isEnabled=!1}destroy(){this.disable(),this.stopListening()}checkShouldIgnoreEventFromTarget(e){return e&&e.nodeType===3&&(e=e.parentNode),!(!e||e.nodeType!==1)&&e.matches("[data-cke-ignore-events], [data-cke-ignore-events] *")}}Be(_i,Zr);var ng=function(i){return this.__data__.set(i,"__lodash_hash_undefined__"),this},mc=function(i){return this.__data__.has(i)};function fc(i){var e=-1,t=i==null?0:i.length;for(this.__data__=new zr;++e<t;)this.add(i[e])}fc.prototype.add=fc.prototype.push=ng,fc.prototype.has=mc;var Gh=fc,Mn=function(i,e){for(var t=-1,n=i==null?0:i.length;++t<n;)if(e(i[t],t,i))return!0;return!1},Uu=function(i,e){return i.has(e)},Wu=function(i,e,t,n,o,r){var a=1&t,c=i.length,d=e.length;if(c!=d&&!(a&&d>c))return!1;var m=r.get(i),b=r.get(e);if(m&&b)return m==e&&b==i;var _=-1,T=!0,E=2&t?new Gh:void 0;for(r.set(i,e),r.set(e,i);++_<c;){var P=i[_],R=e[_];if(n)var z=a?n(R,P,_,e,i,r):n(P,R,_,i,e,r);if(z!==void 0){if(z)continue;T=!1;break}if(E){if(!Mn(e,function($,J){if(!Uu(E,J)&&(P===$||o(P,$,t,n,r)))return E.push(J)})){T=!1;break}}else if(P!==R&&!o(P,R,t,n,r)){T=!1;break}}return r.delete(i),r.delete(e),T},yi=function(i){var e=-1,t=Array(i.size);return i.forEach(function(n,o){t[++e]=[o,n]}),t},Ku=function(i){var e=-1,t=Array(i.size);return i.forEach(function(n){t[++e]=n}),t},$a=ge?ge.prototype:void 0,Ki=$a?$a.valueOf:void 0,Qh=function(i,e,t,n,o,r,a){switch(t){case"[object DataView]":if(i.byteLength!=e.byteLength||i.byteOffset!=e.byteOffset)return!1;i=i.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(i.byteLength!=e.byteLength||!r(new ys(i),new ys(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return we(+i,+e);case"[object Error]":return i.name==e.name&&i.message==e.message;case"[object RegExp]":case"[object String]":return i==e+"";case"[object Map]":var c=yi;case"[object Set]":var d=1&n;if(c||(c=Ku),i.size!=e.size&&!d)return!1;var m=a.get(i);if(m)return m==e;n|=2,a.set(i,e);var b=Wu(c(i),c(e),n,o,r,a);return a.delete(i),b;case"[object Symbol]":if(Ki)return Ki.call(i)==Ki.call(e)}return!1},Jn=Object.prototype.hasOwnProperty,Gu=function(i,e,t,n,o,r){var a=1&t,c=ks(i),d=c.length;if(d!=ks(e).length&&!a)return!1;for(var m=d;m--;){var b=c[m];if(!(a?b in e:Jn.call(e,b)))return!1}var _=r.get(i),T=r.get(e);if(_&&T)return _==e&&T==i;var E=!0;r.set(i,e),r.set(e,i);for(var P=a;++m<d;){var R=i[b=c[m]],z=e[b];if(n)var $=a?n(z,R,b,e,i,r):n(R,z,b,i,e,r);if(!($===void 0?R===z||o(R,z,t,n,r):$)){E=!1;break}P||(P=b=="constructor")}if(E&&!P){var J=i.constructor,ue=e.constructor;J==ue||!("constructor"in i)||!("constructor"in e)||typeof J=="function"&&J instanceof J&&typeof ue=="function"&&ue instanceof ue||(E=!1)}return r.delete(i),r.delete(e),E},Yh=Object.prototype.hasOwnProperty,og=function(i,e,t,n,o,r){var a=cn(i),c=cn(e),d=a?"[object Array]":At(i),m=c?"[object Array]":At(e),b=(d=d=="[object Arguments]"?"[object Object]":d)=="[object Object]",_=(m=m=="[object Arguments]"?"[object Object]":m)=="[object Object]",T=d==m;if(T&&Object(Io.a)(i)){if(!Object(Io.a)(e))return!1;a=!0,b=!1}if(T&&!b)return r||(r=new Br),a||Vi(i)?Wu(i,e,t,n,o,r):Qh(i,e,d,t,n,o,r);if(!(1&t)){var E=b&&Yh.call(i,"__wrapped__"),P=_&&Yh.call(e,"__wrapped__");if(E||P){var R=E?i.value():i,z=P?e.value():e;return r||(r=new Br),o(R,z,t,n,r)}}return!!T&&(r||(r=new Br),Gu(i,e,t,n,o,r))},Xh=function i(e,t,n,o,r){return e===t||(e==null||t==null||!ft(e)&&!ft(t)?e!=e&&t!=t:og(e,t,n,o,i,r))},Qu=function(i,e,t){var n=(t=typeof t=="function"?t:void 0)?t(i,e):void 0;return n===void 0?Xh(i,e,void 0,t):!!n};class Jh extends _i{constructor(e){super(e),this._config={childList:!0,characterData:!0,characterDataOldValue:!0,subtree:!0},this.domConverter=e.domConverter,this.renderer=e._renderer,this._domElements=[],this._mutationObserver=new window.MutationObserver(this._onMutations.bind(this))}flush(){this._onMutations(this._mutationObserver.takeRecords())}observe(e){this._domElements.push(e),this.isEnabled&&this._mutationObserver.observe(e,this._config)}enable(){super.enable();for(const e of this._domElements)this._mutationObserver.observe(e,this._config)}disable(){super.disable(),this._mutationObserver.disconnect()}destroy(){super.destroy(),this._mutationObserver.disconnect()}_onMutations(e){if(e.length===0)return;const t=this.domConverter,n=new Map,o=new Set;for(const m of e)if(m.type==="childList"){const b=t.mapDomToView(m.target);if(b&&(b.is("uiElement")||b.is("rawElement")))continue;b&&!this._isBogusBrMutation(m)&&o.add(b)}for(const m of e){const b=t.mapDomToView(m.target);if((!b||!b.is("uiElement")&&!b.is("rawElement"))&&m.type==="characterData"){const _=t.findCorrespondingViewText(m.target);_&&!o.has(_.parent)?n.set(_,{type:"text",oldText:_.data,newText:Bu(m.target),node:_}):!_&&En(m.target)&&o.add(t.mapDomToView(m.target.parentNode))}}const r=[];for(const m of n.values())this.renderer.markToSync("text",m.node),r.push(m);for(const m of o){const b=t.mapViewToDom(m),_=Array.from(m.getChildren()),T=Array.from(t.domChildrenToView(b,{withChildren:!1}));Qu(_,T,d)||(this.renderer.markToSync("children",m),r.push({type:"children",oldChildren:_,newChildren:T,node:m}))}const a=e[0].target.ownerDocument.getSelection();let c=null;if(a&&a.anchorNode){const m=t.domPositionToView(a.anchorNode,a.anchorOffset),b=t.domPositionToView(a.focusNode,a.focusOffset);m&&b&&(c=new Yt(m),c.setFocus(b))}function d(m,b){if(!Array.isArray(m))return m===b||!(!m.is("$text")||!b.is("$text"))&&m.data===b.data}r.length&&(this.document.fire("mutations",r,c),this.view.forceRender())}_isBogusBrMutation(e){let t=null;return e.nextSibling===null&&e.removedNodes.length===0&&e.addedNodes.length==1&&(t=this.domConverter.domToView(e.addedNodes[0],{withChildren:!1})),t&&t.is("element","br")}}class ts{constructor(e,t,n){this.view=e,this.document=e.document,this.domEvent=t,this.domTarget=t.target,Mr(this,n)}get target(){return this.view.domConverter.mapDomToView(this.domTarget)}preventDefault(){this.domEvent.preventDefault()}stopPropagation(){this.domEvent.stopPropagation()}}class Gi extends _i{constructor(e){super(e),this.useCapture=!1}observe(e){(typeof this.domEventType=="string"?[this.domEventType]:this.domEventType).forEach(t=>{this.listenTo(e,t,(n,o)=>{this.isEnabled&&!this.checkShouldIgnoreEventFromTarget(o.target)&&this.onDomEvent(o)},{useCapture:this.useCapture})})}fire(e,t,n){this.isEnabled&&this.document.fire(e,new ts(this.view,t,n))}}class ig extends Gi{constructor(e){super(e),this.domEventType=["keydown","keyup"]}onDomEvent(e){this.fire(e.type,e,{keyCode:e.keyCode,altKey:e.altKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,metaKey:e.metaKey,get keystroke(){return M(this)}})}}var Yu=function(){return ie.a.Date.now()},Ua=/\s/,rg=function(i){for(var e=i.length;e--&&Ua.test(i.charAt(e)););return e},sg=/^\s+/,Xu=function(i){return i&&i.slice(0,rg(i)+1).replace(sg,"")},Zh=/^[-+]0x[0-9a-f]+$/i,ag=/^0b[01]+$/i,lg=/^0o[0-7]+$/i,cg=parseInt,Ju=function(i){if(typeof i=="number")return i;if(Ro(i))return NaN;if(oe(i)){var e=typeof i.valueOf=="function"?i.valueOf():i;i=oe(e)?e+"":e}if(typeof i!="string")return i===0?i:+i;i=Xu(i);var t=ag.test(i);return t||lg.test(i)?cg(i.slice(2),t?2:8):Zh.test(i)?NaN:+i},Zu=Math.max,ug=Math.min,Wa=function(i,e,t){var n,o,r,a,c,d,m=0,b=!1,_=!1,T=!0;if(typeof i!="function")throw new TypeError("Expected a function");function E(ue){var xe=n,He=o;return n=o=void 0,m=ue,a=i.apply(He,xe)}function P(ue){return m=ue,c=setTimeout(z,e),b?E(ue):a}function R(ue){var xe=ue-d;return d===void 0||xe>=e||xe<0||_&&ue-m>=r}function z(){var ue=Yu();if(R(ue))return $(ue);c=setTimeout(z,function(xe){var He=e-(xe-d);return _?ug(He,r-(xe-m)):He}(ue))}function $(ue){return c=void 0,T&&n?E(ue):(n=o=void 0,a)}function J(){var ue=Yu(),xe=R(ue);if(n=arguments,o=this,d=ue,xe){if(c===void 0)return P(d);if(_)return clearTimeout(c),c=setTimeout(z,e),E(d)}return c===void 0&&(c=setTimeout(z,e)),a}return e=Ju(e)||0,oe(t)&&(b=!!t.leading,r=(_="maxWait"in t)?Zu(Ju(t.maxWait)||0,e):r,T="trailing"in t?!!t.trailing:T),J.cancel=function(){c!==void 0&&clearTimeout(c),m=0,n=d=o=c=void 0},J.flush=function(){return c===void 0?a:$(Yu())},J};class em extends _i{constructor(e){super(e),this._fireSelectionChangeDoneDebounced=Wa(t=>this.document.fire("selectionChangeDone",t),200)}observe(){const e=this.document;e.on("arrowKey",(t,n)=>{e.selection.isFake&&this.isEnabled&&n.preventDefault()},{context:"$capture"}),e.on("arrowKey",(t,n)=>{e.selection.isFake&&this.isEnabled&&this._handleSelectionMove(n.keyCode)},{priority:"lowest"})}destroy(){super.destroy(),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionMove(e){const t=this.document.selection,n=new Yt(t.getRanges(),{backward:t.isBackward,fake:!1});e!=ut.arrowleft&&e!=ut.arrowup||n.setTo(n.getFirstPosition()),e!=ut.arrowright&&e!=ut.arrowdown||n.setTo(n.getLastPosition());const o={oldSelection:t,newSelection:n,domSelection:null};this.document.fire("selectionChange",o),this._fireSelectionChangeDoneDebounced(o)}}class tm extends _i{constructor(e){super(e),this.mutationObserver=e.getObserver(Jh),this.selection=this.document.selection,this.domConverter=e.domConverter,this._documents=new WeakSet,this._fireSelectionChangeDoneDebounced=Wa(t=>this.document.fire("selectionChangeDone",t),200),this._clearInfiniteLoopInterval=setInterval(()=>this._clearInfiniteLoop(),1e3),this._loopbackCounter=0}observe(e){const t=e.ownerDocument;this._documents.has(t)||(this.listenTo(t,"selectionchange",(n,o)=>{this._handleSelectionChange(o,t)}),this._documents.add(t))}destroy(){super.destroy(),clearInterval(this._clearInfiniteLoopInterval),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionChange(e,t){if(!this.isEnabled)return;const n=t.defaultView.getSelection();if(this.checkShouldIgnoreEventFromTarget(n.anchorNode))return;this.mutationObserver.flush();const o=this.domConverter.domSelectionToView(n);if(o.rangeCount!=0){if(this.view.hasDomSelection=!0,!(this.selection.isEqual(o)&&this.domConverter.isDomSelectionCorrect(n)||++this._loopbackCounter>60))if(this.selection.isSimilar(o))this.view.forceRender();else{const r={oldSelection:this.selection,newSelection:o,domSelection:n};this.document.fire("selectionChange",r),this._fireSelectionChangeDoneDebounced(r)}}else this.view.hasDomSelection=!1}_clearInfiniteLoop(){this._loopbackCounter=0}}class nm extends Gi{constructor(e){super(e),this.domEventType=["focus","blur"],this.useCapture=!0;const t=this.document;t.on("focus",()=>{t.isFocused=!0,this._renderTimeoutId=setTimeout(()=>e.change(()=>{}),50)}),t.on("blur",(n,o)=>{const r=t.selection.editableElement;r!==null&&r!==o.target||(t.isFocused=!1,e.change(()=>{}))})}onDomEvent(e){this.fire(e.type,e)}destroy(){this._renderTimeoutId&&clearTimeout(this._renderTimeoutId),super.destroy()}}class pc extends Gi{constructor(e){super(e),this.domEventType=["compositionstart","compositionupdate","compositionend"];const t=this.document;t.on("compositionstart",()=>{t.isComposing=!0}),t.on("compositionend",()=>{t.isComposing=!1})}onDomEvent(e){this.fire(e.type,e)}}class dg extends Gi{constructor(e){super(e),this.domEventType=["beforeinput"]}onDomEvent(e){this.fire(e.type,e)}}class om{constructor(){this._replacedElements=[]}replace(e,t){this._replacedElements.push({element:e,newElement:t}),e.style.display="none",t&&e.parentNode.insertBefore(t,e.nextSibling)}restore(){this._replacedElements.forEach(({element:e,newElement:t})=>{e.style.display="",t&&t.remove()}),this._replacedElements=[]}}var ed=function(i){return typeof i=="string"||!cn(i)&&ft(i)&&_e(i)=="[object String]"};function gc(i){return Object.prototype.toString.apply(i)=="[object Range]"}function td(i){const e=i.ownerDocument.defaultView.getComputedStyle(i);return{top:parseInt(e.borderTopWidth,10),right:parseInt(e.borderRightWidth,10),bottom:parseInt(e.borderBottomWidth,10),left:parseInt(e.borderLeftWidth,10)}}const im=["top","right","bottom","left","width","height"];class Et{constructor(e){const t=gc(e);if(Object.defineProperty(this,"_source",{value:e._source||e,writable:!0,enumerable:!1}),Mo(e)||t)if(t){const n=Et.getDomRangeRects(e);Ka(this,Et.getBoundingRect(n))}else Ka(this,e.getBoundingClientRect());else if(Ha(e)){const{innerWidth:n,innerHeight:o}=e;Ka(this,{top:0,right:n,bottom:o,left:0,width:n,height:o})}else Ka(this,e)}clone(){return new Et(this)}moveTo(e,t){return this.top=t,this.right=e+this.width,this.bottom=t+this.height,this.left=e,this}moveBy(e,t){return this.top+=t,this.right+=e,this.left+=e,this.bottom+=t,this}getIntersection(e){const t={top:Math.max(this.top,e.top),right:Math.min(this.right,e.right),bottom:Math.min(this.bottom,e.bottom),left:Math.max(this.left,e.left)};return t.width=t.right-t.left,t.height=t.bottom-t.top,t.width<0||t.height<0?null:new Et(t)}getIntersectionArea(e){const t=this.getIntersection(e);return t?t.getArea():0}getArea(){return this.width*this.height}getVisible(){const e=this._source;let t=this.clone();if(!bc(e)){let n=e.parentNode||e.commonAncestorContainer;for(;n&&!bc(n);){const o=new Et(n),r=t.getIntersection(o);if(!r)return null;r.getArea()<t.getArea()&&(t=r),n=n.parentNode}}return t}isEqual(e){for(const t of im)if(this[t]!==e[t])return!1;return!0}contains(e){const t=this.getIntersection(e);return!(!t||!t.isEqual(e))}excludeScrollbarsAndBorders(){const e=this._source;let t,n,o;if(Ha(e))t=e.innerWidth-e.document.documentElement.clientWidth,n=e.innerHeight-e.document.documentElement.clientHeight,o=e.getComputedStyle(e.document.documentElement).direction;else{const r=td(this._source);t=e.offsetWidth-e.clientWidth-r.left-r.right,n=e.offsetHeight-e.clientHeight-r.top-r.bottom,o=e.ownerDocument.defaultView.getComputedStyle(e).direction,this.left+=r.left,this.top+=r.top,this.right-=r.right,this.bottom-=r.bottom,this.width=this.right-this.left,this.height=this.bottom-this.top}return this.width-=t,o==="ltr"?this.right-=t:this.left+=t,this.height-=n,this.bottom-=n,this}static getDomRangeRects(e){const t=[],n=Array.from(e.getClientRects());if(n.length)for(const o of n)t.push(new Et(o));else{let o=e.startContainer;Pn(o)&&(o=o.parentNode);const r=new Et(o.getBoundingClientRect());r.right=r.left,r.width=0,t.push(r)}return t}static getBoundingRect(e){const t={left:Number.POSITIVE_INFINITY,top:Number.POSITIVE_INFINITY,right:Number.NEGATIVE_INFINITY,bottom:Number.NEGATIVE_INFINITY};let n=0;for(const o of e)n++,t.left=Math.min(t.left,o.left),t.top=Math.min(t.top,o.top),t.right=Math.max(t.right,o.right),t.bottom=Math.max(t.bottom,o.bottom);return n==0?null:(t.width=t.right-t.left,t.height=t.bottom-t.top,new Et(t))}}function Ka(i,e){for(const t of im)i[t]=e[t]}function bc(i){return!!Mo(i)&&i===i.ownerDocument.body}class tn{constructor(e,t){tn._observerInstance||tn._createObserver(),this._element=e,this._callback=t,tn._addElementCallback(e,t),tn._observerInstance.observe(e)}destroy(){tn._deleteElementCallback(this._element,this._callback)}static _addElementCallback(e,t){tn._elementCallbacks||(tn._elementCallbacks=new Map);let n=tn._elementCallbacks.get(e);n||(n=new Set,tn._elementCallbacks.set(e,n)),n.add(t)}static _deleteElementCallback(e,t){const n=tn._getElementCallbacks(e);n&&(n.delete(t),n.size||(tn._elementCallbacks.delete(e),tn._observerInstance.unobserve(e))),tn._elementCallbacks&&!tn._elementCallbacks.size&&(tn._observerInstance=null,tn._elementCallbacks=null)}static _getElementCallbacks(e){return tn._elementCallbacks?tn._elementCallbacks.get(e):null}static _createObserver(){let e;e=typeof qt.window.ResizeObserver=="function"?qt.window.ResizeObserver:vc,tn._observerInstance=new e(t=>{for(const n of t){const o=tn._getElementCallbacks(n.target);if(o)for(const r of o)r(n)}})}}tn._observerInstance=null,tn._elementCallbacks=null;class vc{constructor(e){this._callback=e,this._elements=new Set,this._previousRects=new Map,this._periodicCheckTimeout=null}observe(e){this._elements.add(e),this._checkElementRectsAndExecuteCallback(),this._elements.size===1&&this._startPeriodicCheck()}unobserve(e){this._elements.delete(e),this._previousRects.delete(e),this._elements.size||this._stopPeriodicCheck()}_startPeriodicCheck(){const e=()=>{this._checkElementRectsAndExecuteCallback(),this._periodicCheckTimeout=setTimeout(e,100)};this.listenTo(qt.window,"resize",()=>{this._checkElementRectsAndExecuteCallback()}),this._periodicCheckTimeout=setTimeout(e,100)}_stopPeriodicCheck(){clearTimeout(this._periodicCheckTimeout),this.stopListening(),this._previousRects.clear()}_checkElementRectsAndExecuteCallback(){const e=[];for(const t of this._elements)this._hasRectChanged(t)&&e.push({target:t,contentRect:this._previousRects.get(t)});e.length&&this._callback(e)}_hasRectChanged(e){if(!e.ownerDocument.body.contains(e))return!1;const t=new Et(e),n=this._previousRects.get(e),o=!n||!n.isEqual(t);return this._previousRects.set(e,t),o}}function dt(i){return e=>e+i}function so(i){const e=i.next();return e.done?null:e.value}Be(vc,Zr);class Lo{constructor(){this.set("isFocused",!1),this.set("focusedElement",null),this._elements=new Set,this._nextEventLoopTimeout=null}add(e){if(this._elements.has(e))throw new C.a("focustracker-add-element-already-exist",this);this.listenTo(e,"focus",()=>this._focus(e),{useCapture:!0}),this.listenTo(e,"blur",()=>this._blur(),{useCapture:!0}),this._elements.add(e)}remove(e){e===this.focusedElement&&this._blur(e),this._elements.has(e)&&(this.stopListening(e),this._elements.delete(e))}destroy(){this.stopListening()}_focus(e){clearTimeout(this._nextEventLoopTimeout),this.focusedElement=e,this.isFocused=!0}_blur(){clearTimeout(this._nextEventLoopTimeout),this._nextEventLoopTimeout=setTimeout(()=>{this.focusedElement=null,this.isFocused=!1},0)}}Be(Lo,Zr),Be(Lo,Wt);class yo{constructor(){this._listener=Object.create(Zr)}listenTo(e){this._listener.listenTo(e,"keydown",(t,n)=>{this._listener.fire("_keydown:"+M(n),n)})}set(e,t,n={}){const o=vr(e),r=n.priority;this._listener.listenTo(this._listener,"_keydown:"+o,(a,c)=>{t(c,()=>{c.preventDefault(),c.stopPropagation(),a.stop()}),a.return=!0},{priority:r})}press(e){return!!this._listener.fire("_keydown:"+M(e),e)}destroy(){this._listener.stopListening()}}class rm extends _i{constructor(e){super(e),this.document.on("keydown",(t,n)=>{if(this.isEnabled&&((o=n.keyCode)==ut.arrowright||o==ut.arrowleft||o==ut.arrowup||o==ut.arrowdown)){const r=new rc(this.document,"arrowKey",this.document.selection.getFirstRange());this.document.fire(r,n),r.stop.called&&t.stop()}var o})}observe(){}}function sm({target:i,viewportOffset:e=0}){const t=kc(i);let n=t,o=null;for(;n;){let r;r=ao(n==t?i:o),xo(r,()=>Qi(i,n));const a=Qi(i,n);if(hg(n,a,e),n.parent!=n){if(o=n.frameElement,n=n.parent,!o)return}else n=null}}function hg(i,e,t){const n=e.clone().moveBy(0,t),o=e.clone().moveBy(0,-t),r=new Et(i).excludeScrollbarsAndBorders();if(![o,n].every(a=>r.contains(a))){let{scrollX:a,scrollY:c}=i;Ga(o,r)?c-=r.top-e.top+t:am(n,r)&&(c+=e.bottom-r.bottom+t),wc(e,r)?a-=r.left-e.left+t:nd(e,r)&&(a+=e.right-r.right+t),i.scrollTo(a,c)}}function xo(i,e){const t=kc(i);let n,o;for(;i!=t.document.body;)o=e(),n=new Et(i).excludeScrollbarsAndBorders(),n.contains(o)||(Ga(o,n)?i.scrollTop-=n.top-o.top:am(o,n)&&(i.scrollTop+=o.bottom-n.bottom),wc(o,n)?i.scrollLeft-=n.left-o.left:nd(o,n)&&(i.scrollLeft+=o.right-n.right)),i=i.parentNode}function am(i,e){return i.bottom>e.bottom}function Ga(i,e){return i.top<e.top}function wc(i,e){return i.left<e.left}function nd(i,e){return i.right>e.right}function kc(i){return gc(i)?i.startContainer.ownerDocument.defaultView:i.ownerDocument.defaultView}function ao(i){if(gc(i)){let e=i.commonAncestorContainer;return Pn(e)&&(e=e.parentNode),e}return i.parentNode}function Qi(i,e){const t=kc(i),n=new Et(i);if(t===e)return n;{let o=t;for(;o!=e;){const r=o.frameElement,a=new Et(r).excludeScrollbarsAndBorders();n.moveBy(a.left,a.top),o=o.parent}}return n}Object.assign({},{scrollViewportToShowTarget:sm,scrollAncestorsToShowTarget:function(i){xo(ao(i),()=>new Et(i))}});class _c{constructor(e){this.document=new $i(e),this.domConverter=new ki(this.document),this.domRoots=new Map,this.set("isRenderingInProgress",!1),this.set("hasDomSelection",!1),this._renderer=new Uh(this.domConverter,this.document.selection),this._renderer.bind("isFocused").to(this.document),this._initialDomRootAttributes=new WeakMap,this._observers=new Map,this._ongoingChange=!1,this._postFixersInProgress=!1,this._renderingDisabled=!1,this._hasChangedSinceTheLastRendering=!1,this._writer=new Rh(this.document),this.addObserver(Jh),this.addObserver(tm),this.addObserver(nm),this.addObserver(ig),this.addObserver(em),this.addObserver(pc),this.addObserver(rm),Cn.isAndroid&&this.addObserver(dg),this.document.on("arrowKey",Yo,{priority:"low"}),Yp(this),this.on("render",()=>{this._render(),this.document.fire("layoutChanged"),this._hasChangedSinceTheLastRendering=!1}),this.listenTo(this.document.selection,"change",()=>{this._hasChangedSinceTheLastRendering=!0}),this.listenTo(this.document,"change:isFocused",()=>{this._hasChangedSinceTheLastRendering=!0})}attachDomRoot(e,t="main"){const n=this.document.getRoot(t);n._name=e.tagName.toLowerCase();const o={};for(const{name:a,value:c}of Array.from(e.attributes))o[a]=c,a==="class"?this._writer.addClass(c.split(" "),n):this._writer.setAttribute(a,c,n);this._initialDomRootAttributes.set(e,o);const r=()=>{this._writer.setAttribute("contenteditable",!n.isReadOnly,n),n.isReadOnly?this._writer.addClass("ck-read-only",n):this._writer.removeClass("ck-read-only",n)};r(),this.domRoots.set(t,e),this.domConverter.bindElements(e,n),this._renderer.markToSync("children",n),this._renderer.markToSync("attributes",n),this._renderer.domDocuments.add(e.ownerDocument),n.on("change:children",(a,c)=>this._renderer.markToSync("children",c)),n.on("change:attributes",(a,c)=>this._renderer.markToSync("attributes",c)),n.on("change:text",(a,c)=>this._renderer.markToSync("text",c)),n.on("change:isReadOnly",()=>this.change(r)),n.on("change",()=>{this._hasChangedSinceTheLastRendering=!0});for(const a of this._observers.values())a.observe(e,t)}detachDomRoot(e){const t=this.domRoots.get(e);Array.from(t.attributes).forEach(({name:o})=>t.removeAttribute(o));const n=this._initialDomRootAttributes.get(t);for(const o in n)t.setAttribute(o,n[o]);this.domRoots.delete(e),this.domConverter.unbindDomElement(t)}getDomRoot(e="main"){return this.domRoots.get(e)}addObserver(e){let t=this._observers.get(e);if(t)return t;t=new e(this),this._observers.set(e,t);for(const[n,o]of this.domRoots)t.observe(o,n);return t.enable(),t}getObserver(e){return this._observers.get(e)}disableObservers(){for(const e of this._observers.values())e.disable()}enableObservers(){for(const e of this._observers.values())e.enable()}scrollToTheSelection(){const e=this.document.selection.getFirstRange();e&&sm({target:this.domConverter.viewRangeToDom(e),viewportOffset:20})}focus(){if(!this.document.isFocused){const e=this.document.selection.editableElement;e&&(this.domConverter.focus(e),this.forceRender())}}change(e){if(this.isRenderingInProgress||this._postFixersInProgress)throw new C.a("cannot-change-view-tree",this);try{if(this._ongoingChange)return e(this._writer);this._ongoingChange=!0;const t=e(this._writer);return this._ongoingChange=!1,!this._renderingDisabled&&this._hasChangedSinceTheLastRendering&&(this._postFixersInProgress=!0,this.document._callPostFixers(this._writer),this._postFixersInProgress=!1,this.fire("render")),t}catch(t){C.a.rethrowUnexpectedError(t,this)}}forceRender(){this._hasChangedSinceTheLastRendering=!0,this.change(()=>{})}destroy(){for(const e of this._observers.values())e.destroy();this.document.destroy(),this.stopListening()}createPositionAt(e,t){return ye._createAt(e,t)}createPositionAfter(e){return ye._createAfter(e)}createPositionBefore(e){return ye._createBefore(e)}createRange(e,t){return new Ze(e,t)}createRangeOn(e){return Ze._createOn(e)}createRangeIn(e){return Ze._createIn(e)}createSelection(e,t,n){return new Yt(e,t,n)}_disableRendering(e){this._renderingDisabled=e,e==0&&this.change(()=>{})}_render(){this.isRenderingInProgress=!0,this.disableObservers(),this._renderer.render(),this.enableObservers(),this.isRenderingInProgress=!1}}Be(_c,Wt);class _r{constructor(e){this.parent=null,this._attrs=Ke(e)}get index(){let e;if(!this.parent)return null;if((e=this.parent.getChildIndex(this))===null)throw new C.a("model-node-not-found-in-parent",this);return e}get startOffset(){let e;if(!this.parent)return null;if((e=this.parent.getChildStartOffset(this))===null)throw new C.a("model-node-not-found-in-parent",this);return e}get offsetSize(){return 1}get endOffset(){return this.parent?this.startOffset+this.offsetSize:null}get nextSibling(){const e=this.index;return e!==null&&this.parent.getChild(e+1)||null}get previousSibling(){const e=this.index;return e!==null&&this.parent.getChild(e-1)||null}get root(){let e=this;for(;e.parent;)e=e.parent;return e}isAttached(){return this.root.is("rootElement")}getPath(){const e=[];let t=this;for(;t.parent;)e.unshift(t.startOffset),t=t.parent;return e}getAncestors(e={includeSelf:!1,parentFirst:!1}){const t=[];let n=e.includeSelf?this:this.parent;for(;n;)t[e.parentFirst?"push":"unshift"](n),n=n.parent;return t}getCommonAncestor(e,t={}){const n=this.getAncestors(t),o=e.getAncestors(t);let r=0;for(;n[r]==o[r]&&n[r];)r++;return r===0?null:n[r-1]}isBefore(e){if(this==e||this.root!==e.root)return!1;const t=this.getPath(),n=e.getPath(),o=B(t,n);switch(o){case"prefix":return!0;case"extension":return!1;default:return t[o]<n[o]}}isAfter(e){return this!=e&&this.root===e.root&&!this.isBefore(e)}hasAttribute(e){return this._attrs.has(e)}getAttribute(e){return this._attrs.get(e)}getAttributes(){return this._attrs.entries()}getAttributeKeys(){return this._attrs.keys()}toJSON(){const e={};return this._attrs.size&&(e.attributes=Array.from(this._attrs).reduce((t,n)=>(t[n[0]]=n[1],t),{})),e}is(e){return e==="node"||e==="model:node"}_clone(){return new _r(this._attrs)}_remove(){this.parent._removeChildren(this.index)}_setAttribute(e,t){this._attrs.set(e,t)}_setAttributesTo(e){this._attrs=Ke(e)}_removeAttribute(e){return this._attrs.delete(e)}_clearAttributes(){this._attrs.clear()}}class It extends _r{constructor(e,t){super(t),this._data=e||""}get offsetSize(){return this.data.length}get data(){return this._data}is(e){return e==="$text"||e==="model:$text"||e==="text"||e==="model:text"||e==="node"||e==="model:node"}toJSON(){const e=super.toJSON();return e.data=this.data,e}_clone(){return new It(this.data,this.getAttributes())}static fromJSON(e){return new It(e.data,e.attributes)}}class Xo{constructor(e,t,n){if(this.textNode=e,t<0||t>e.offsetSize)throw new C.a("model-textproxy-wrong-offsetintext",this);if(n<0||t+n>e.offsetSize)throw new C.a("model-textproxy-wrong-length",this);this.data=e.data.substring(t,t+n),this.offsetInText=t}get startOffset(){return this.textNode.startOffset!==null?this.textNode.startOffset+this.offsetInText:null}get offsetSize(){return this.data.length}get endOffset(){return this.startOffset!==null?this.startOffset+this.offsetSize:null}get isPartial(){return this.offsetSize!==this.textNode.offsetSize}get parent(){return this.textNode.parent}get root(){return this.textNode.root}is(e){return e==="$textProxy"||e==="model:$textProxy"||e==="textProxy"||e==="model:textProxy"}getPath(){const e=this.textNode.getPath();return e.length>0&&(e[e.length-1]+=this.offsetInText),e}getAncestors(e={includeSelf:!1,parentFirst:!1}){const t=[];let n=e.includeSelf?this:this.parent;for(;n;)t[e.parentFirst?"push":"unshift"](n),n=n.parent;return t}hasAttribute(e){return this.textNode.hasAttribute(e)}getAttribute(e){return this.textNode.getAttribute(e)}getAttributes(){return this.textNode.getAttributes()}getAttributeKeys(){return this.textNode.getAttributeKeys()}}class yr{constructor(e){this._nodes=[],e&&this._insertNodes(0,e)}[Symbol.iterator](){return this._nodes[Symbol.iterator]()}get length(){return this._nodes.length}get maxOffset(){return this._nodes.reduce((e,t)=>e+t.offsetSize,0)}getNode(e){return this._nodes[e]||null}getNodeIndex(e){const t=this._nodes.indexOf(e);return t==-1?null:t}getNodeStartOffset(e){const t=this.getNodeIndex(e);return t===null?null:this._nodes.slice(0,t).reduce((n,o)=>n+o.offsetSize,0)}indexToOffset(e){if(e==this._nodes.length)return this.maxOffset;const t=this._nodes[e];if(!t)throw new C.a("model-nodelist-index-out-of-bounds",this);return this.getNodeStartOffset(t)}offsetToIndex(e){let t=0;for(const n of this._nodes){if(e>=t&&e<t+n.offsetSize)return this.getNodeIndex(n);t+=n.offsetSize}if(t!=e)throw new C.a("model-nodelist-offset-out-of-bounds",this,{offset:e,nodeList:this});return this.length}_insertNodes(e,t){for(const n of t)if(!(n instanceof _r))throw new C.a("model-nodelist-insertnodes-not-node",this);this._nodes.splice(e,0,...t)}_removeNodes(e,t=1){return this._nodes.splice(e,t)}toJSON(){return this._nodes.map(e=>e.toJSON())}}class Pt extends _r{constructor(e,t,n){super(t),this.name=e,this._children=new yr,n&&this._insertChild(0,n)}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return this.childCount===0}is(e,t=null){return t?t===this.name&&(e==="element"||e==="model:element"):e==="element"||e==="model:element"||e==="node"||e==="model:node"}getChild(e){return this._children.getNode(e)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(e){return this._children.getNodeIndex(e)}getChildStartOffset(e){return this._children.getNodeStartOffset(e)}offsetToIndex(e){return this._children.offsetToIndex(e)}getNodeByPath(e){let t=this;for(const n of e)t=t.getChild(t.offsetToIndex(n));return t}findAncestor(e,t={includeSelf:!1}){let n=t.includeSelf?this:this.parent;for(;n;){if(n.name===e)return n;n=n.parent}return null}toJSON(){const e=super.toJSON();if(e.name=this.name,this._children.length>0){e.children=[];for(const t of this._children)e.children.push(t.toJSON())}return e}_clone(e=!1){const t=e?Array.from(this._children).map(n=>n._clone(!0)):null;return new Pt(this.name,this.getAttributes(),t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const n=function(o){return typeof o=="string"?[new It(o)]:(Yn(o)||(o=[o]),Array.from(o).map(r=>typeof r=="string"?new It(r):r instanceof Xo?new It(r.data,r.getAttributes()):r))}(t);for(const o of n)o.parent!==null&&o._remove(),o.parent=this;this._children._insertNodes(e,n)}_removeChildren(e,t=1){const n=this._children._removeNodes(e,t);for(const o of n)o.parent=null;return n}static fromJSON(e){let t=null;if(e.children){t=[];for(const n of e.children)n.name?t.push(Pt.fromJSON(n)):t.push(It.fromJSON(n))}return new Pt(e.name,e.attributes,t)}}class Jo{constructor(e={}){if(!e.boundaries&&!e.startPosition)throw new C.a("model-tree-walker-no-start-position",null);const t=e.direction||"forward";if(t!="forward"&&t!="backward")throw new C.a("model-tree-walker-unknown-direction",e,{direction:t});this.direction=t,this.boundaries=e.boundaries||null,e.startPosition?this.position=e.startPosition.clone():this.position=fe._createAt(this.boundaries[this.direction=="backward"?"end":"start"]),this.position.stickiness="toNone",this.singleCharacters=!!e.singleCharacters,this.shallow=!!e.shallow,this.ignoreElementEnd=!!e.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null,this._visitedParent=this.position.parent}[Symbol.iterator](){return this}skip(e){let t,n,o,r;do o=this.position,r=this._visitedParent,{done:t,value:n}=this.next();while(!t&&e(n));t||(this.position=o,this._visitedParent=r)}next(){return this.direction=="forward"?this._next():this._previous()}_next(){const e=this.position,t=this.position.clone(),n=this._visitedParent;if(n.parent===null&&t.offset===n.maxOffset)return{done:!0};if(n===this._boundaryEndParent&&t.offset==this.boundaries.end.offset)return{done:!0};const o=t.parent,r=As(t,o),a=r||xi(t,o,r);if(a instanceof Pt)return this.shallow?t.offset++:(t.path.push(0),this._visitedParent=a),this.position=t,Yi("elementStart",a,e,t,1);if(a instanceof It){let c;if(this.singleCharacters)c=1;else{let b=a.endOffset;this._boundaryEndParent==n&&this.boundaries.end.offset<b&&(b=this.boundaries.end.offset),c=b-t.offset}const d=t.offset-a.startOffset,m=new Xo(a,d,c);return t.offset+=c,this.position=t,Yi("text",m,e,t,c)}return t.path.pop(),t.offset++,this.position=t,this._visitedParent=n.parent,this.ignoreElementEnd?this._next():Yi("elementEnd",n,e,t)}_previous(){const e=this.position,t=this.position.clone(),n=this._visitedParent;if(n.parent===null&&t.offset===0)return{done:!0};if(n==this._boundaryStartParent&&t.offset==this.boundaries.start.offset)return{done:!0};const o=t.parent,r=As(t,o),a=r||od(t,o,r);if(a instanceof Pt)return t.offset--,this.shallow?(this.position=t,Yi("elementStart",a,e,t,1)):(t.path.push(a.maxOffset),this.position=t,this._visitedParent=a,this.ignoreElementEnd?this._previous():Yi("elementEnd",a,e,t));if(a instanceof It){let c;if(this.singleCharacters)c=1;else{let b=a.startOffset;this._boundaryStartParent==n&&this.boundaries.start.offset>b&&(b=this.boundaries.start.offset),c=t.offset-b}const d=t.offset-a.startOffset,m=new Xo(a,d-c,c);return t.offset-=c,this.position=t,Yi("text",m,e,t,c)}return t.path.pop(),this.position=t,this._visitedParent=n.parent,Yi("elementStart",n,e,t,1)}}function Yi(i,e,t,n,o){return{done:!1,value:{type:i,item:e,previousPosition:t,nextPosition:n,length:o}}}class fe{constructor(e,t,n="toNone"){if(!e.is("element")&&!e.is("documentFragment"))throw new C.a("model-position-root-invalid",e);if(!(t instanceof Array)||t.length===0)throw new C.a("model-position-path-incorrect-format",e,{path:t});e.is("rootElement")?t=t.slice():(t=[...e.getPath(),...t],e=e.root),this.root=e,this.path=t,this.stickiness=n}get offset(){return this.path[this.path.length-1]}set offset(e){this.path[this.path.length-1]=e}get parent(){let e=this.root;for(let t=0;t<this.path.length-1;t++)if(e=e.getChild(e.offsetToIndex(this.path[t])),!e)throw new C.a("model-position-path-incorrect",this,{position:this});if(e.is("$text"))throw new C.a("model-position-path-incorrect",this,{position:this});return e}get index(){return this.parent.offsetToIndex(this.offset)}get textNode(){return As(this,this.parent)}get nodeAfter(){const e=this.parent;return xi(this,e,As(this,e))}get nodeBefore(){const e=this.parent;return od(this,e,As(this,e))}get isAtStart(){return this.offset===0}get isAtEnd(){return this.offset==this.parent.maxOffset}compareWith(e){if(this.root!=e.root)return"different";const t=B(this.path,e.path);switch(t){case"same":return"same";case"prefix":return"before";case"extension":return"after";default:return this.path[t]<e.path[t]?"before":"after"}}getLastMatchingPosition(e,t={}){t.startPosition=this;const n=new Jo(t);return n.skip(e),n.position}getParentPath(){return this.path.slice(0,-1)}getAncestors(){const e=this.parent;return e.is("documentFragment")?[e]:e.getAncestors({includeSelf:!0})}findAncestor(e){const t=this.parent;return t.is("element")?t.findAncestor(e,{includeSelf:!0}):null}getCommonPath(e){if(this.root!=e.root)return[];const t=B(this.path,e.path),n=typeof t=="string"?Math.min(this.path.length,e.path.length):t;return this.path.slice(0,n)}getCommonAncestor(e){const t=this.getAncestors(),n=e.getAncestors();let o=0;for(;t[o]==n[o]&&t[o];)o++;return o===0?null:t[o-1]}getShiftedBy(e){const t=this.clone(),n=t.offset+e;return t.offset=n<0?0:n,t}isAfter(e){return this.compareWith(e)=="after"}isBefore(e){return this.compareWith(e)=="before"}isEqual(e){return this.compareWith(e)=="same"}isTouching(e){let t=null,n=null;switch(this.compareWith(e)){case"same":return!0;case"before":t=fe._createAt(this),n=fe._createAt(e);break;case"after":t=fe._createAt(e),n=fe._createAt(this);break;default:return!1}let o=t.parent;for(;t.path.length+n.path.length;){if(t.isEqual(n))return!0;if(t.path.length>n.path.length){if(t.offset!==o.maxOffset)return!1;t.path=t.path.slice(0,-1),o=o.parent,t.offset++}else{if(n.offset!==0)return!1;n.path=n.path.slice(0,-1)}}}is(e){return e==="position"||e==="model:position"}hasSameParentAs(e){return this.root!==e.root?!1:B(this.getParentPath(),e.getParentPath())=="same"}getTransformedByOperation(e){let t;switch(e.type){case"insert":t=this._getTransformedByInsertOperation(e);break;case"move":case"remove":case"reinsert":t=this._getTransformedByMoveOperation(e);break;case"split":t=this._getTransformedBySplitOperation(e);break;case"merge":t=this._getTransformedByMergeOperation(e);break;default:t=fe._createAt(this)}return t}_getTransformedByInsertOperation(e){return this._getTransformedByInsertion(e.position,e.howMany)}_getTransformedByMoveOperation(e){return this._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany)}_getTransformedBySplitOperation(e){const t=e.movedRange;return t.containsPosition(this)||t.start.isEqual(this)&&this.stickiness=="toNext"?this._getCombined(e.splitPosition,e.moveTargetPosition):e.graveyardPosition?this._getTransformedByMove(e.graveyardPosition,e.insertionPosition,1):this._getTransformedByInsertion(e.insertionPosition,1)}_getTransformedByMergeOperation(e){const t=e.movedRange;let n;return t.containsPosition(this)||t.start.isEqual(this)?(n=this._getCombined(e.sourcePosition,e.targetPosition),e.sourcePosition.isBefore(e.targetPosition)&&(n=n._getTransformedByDeletion(e.deletionPosition,1))):n=this.isEqual(e.deletionPosition)?fe._createAt(e.deletionPosition):this._getTransformedByMove(e.deletionPosition,e.graveyardPosition,1),n}_getTransformedByDeletion(e,t){const n=fe._createAt(this);if(this.root!=e.root)return n;if(B(e.getParentPath(),this.getParentPath())=="same"){if(e.offset<this.offset){if(e.offset+t>this.offset)return null;n.offset-=t}}else if(B(e.getParentPath(),this.getParentPath())=="prefix"){const o=e.path.length-1;if(e.offset<=this.path[o]){if(e.offset+t>this.path[o])return null;n.path[o]-=t}}return n}_getTransformedByInsertion(e,t){const n=fe._createAt(this);if(this.root!=e.root)return n;if(B(e.getParentPath(),this.getParentPath())=="same")(e.offset<this.offset||e.offset==this.offset&&this.stickiness!="toPrevious")&&(n.offset+=t);else if(B(e.getParentPath(),this.getParentPath())=="prefix"){const o=e.path.length-1;e.offset<=this.path[o]&&(n.path[o]+=t)}return n}_getTransformedByMove(e,t,n){if(t=t._getTransformedByDeletion(e,n),e.isEqual(t))return fe._createAt(this);const o=this._getTransformedByDeletion(e,n);return o===null||e.isEqual(this)&&this.stickiness=="toNext"||e.getShiftedBy(n).isEqual(this)&&this.stickiness=="toPrevious"?this._getCombined(e,t):o._getTransformedByInsertion(t,n)}_getCombined(e,t){const n=e.path.length-1,o=fe._createAt(t);return o.stickiness=this.stickiness,o.offset=o.offset+this.path[n]-e.offset,o.path=[...o.path,...this.path.slice(n+1)],o}toJSON(){return{root:this.root.toJSON(),path:Array.from(this.path),stickiness:this.stickiness}}clone(){return new this.constructor(this.root,this.path,this.stickiness)}static _createAt(e,t,n="toNone"){if(e instanceof fe)return new fe(e.root,e.path,e.stickiness);{const o=e;if(t=="end")t=o.maxOffset;else{if(t=="before")return this._createBefore(o,n);if(t=="after")return this._createAfter(o,n);if(t!==0&&!t)throw new C.a("model-createpositionat-offset-required",[this,e])}if(!o.is("element")&&!o.is("documentFragment"))throw new C.a("model-position-parent-incorrect",[this,e]);const r=o.getPath();return r.push(t),new this(o.root,r,n)}}static _createAfter(e,t){if(!e.parent)throw new C.a("model-position-after-root",[this,e],{root:e});return this._createAt(e.parent,e.endOffset,t)}static _createBefore(e,t){if(!e.parent)throw new C.a("model-position-before-root",e,{root:e});return this._createAt(e.parent,e.startOffset,t)}static fromJSON(e,t){if(e.root==="$graveyard"){const n=new fe(t.graveyard,e.path);return n.stickiness=e.stickiness,n}if(!t.getRoot(e.root))throw new C.a("model-position-fromjson-no-root",t,{rootName:e.root});return new fe(t.getRoot(e.root),e.path,e.stickiness)}}function As(i,e){const t=e.getChild(e.offsetToIndex(i.offset));return t&&t.is("$text")&&t.startOffset<i.offset?t:null}function xi(i,e,t){return t!==null?null:e.getChild(e.offsetToIndex(i.offset))}function od(i,e,t){return t!==null?null:e.getChild(e.offsetToIndex(i.offset)-1)}class le{constructor(e,t=null){this.start=fe._createAt(e),this.end=t?fe._createAt(t):fe._createAt(e),this.start.stickiness=this.isCollapsed?"toNone":"toNext",this.end.stickiness=this.isCollapsed?"toNone":"toPrevious"}*[Symbol.iterator](){yield*new Jo({boundaries:this,ignoreElementEnd:!0})}get isCollapsed(){return this.start.isEqual(this.end)}get isFlat(){return B(this.start.getParentPath(),this.end.getParentPath())=="same"}get root(){return this.start.root}containsPosition(e){return e.isAfter(this.start)&&e.isBefore(this.end)}containsRange(e,t=!1){e.isCollapsed&&(t=!1);const n=this.containsPosition(e.start)||t&&this.start.isEqual(e.start),o=this.containsPosition(e.end)||t&&this.end.isEqual(e.end);return n&&o}containsItem(e){const t=fe._createBefore(e);return this.containsPosition(t)||this.start.isEqual(t)}is(e){return e==="range"||e==="model:range"}isEqual(e){return this.start.isEqual(e.start)&&this.end.isEqual(e.end)}isIntersecting(e){return this.start.isBefore(e.end)&&this.end.isAfter(e.start)}getDifference(e){const t=[];return this.isIntersecting(e)?(this.containsPosition(e.start)&&t.push(new le(this.start,e.start)),this.containsPosition(e.end)&&t.push(new le(e.end,this.end))):t.push(new le(this.start,this.end)),t}getIntersection(e){if(this.isIntersecting(e)){let t=this.start,n=this.end;return this.containsPosition(e.start)&&(t=e.start),this.containsPosition(e.end)&&(n=e.end),new le(t,n)}return null}getJoined(e,t=!1){let n=this.isIntersecting(e);if(n||(n=this.start.isBefore(e.start)?t?this.end.isTouching(e.start):this.end.isEqual(e.start):t?e.end.isTouching(this.start):e.end.isEqual(this.start)),!n)return null;let o=this.start,r=this.end;return e.start.isBefore(o)&&(o=e.start),e.end.isAfter(r)&&(r=e.end),new le(o,r)}getMinimalFlatRanges(){const e=[],t=this.start.getCommonPath(this.end).length,n=fe._createAt(this.start);let o=n.parent;for(;n.path.length>t+1;){const r=o.maxOffset-n.offset;r!==0&&e.push(new le(n,n.getShiftedBy(r))),n.path=n.path.slice(0,-1),n.offset++,o=o.parent}for(;n.path.length<=this.end.path.length;){const r=this.end.path[n.path.length-1],a=r-n.offset;a!==0&&e.push(new le(n,n.getShiftedBy(a))),n.offset=r,n.path.push(0)}return e}getWalker(e={}){return e.boundaries=this,new Jo(e)}*getItems(e={}){e.boundaries=this,e.ignoreElementEnd=!0;const t=new Jo(e);for(const n of t)yield n.item}*getPositions(e={}){e.boundaries=this;const t=new Jo(e);yield t.position;for(const n of t)yield n.nextPosition}getTransformedByOperation(e){switch(e.type){case"insert":return this._getTransformedByInsertOperation(e);case"move":case"remove":case"reinsert":return this._getTransformedByMoveOperation(e);case"split":return[this._getTransformedBySplitOperation(e)];case"merge":return[this._getTransformedByMergeOperation(e)]}return[new le(this.start,this.end)]}getTransformedByOperations(e){const t=[new le(this.start,this.end)];for(const n of e)for(let o=0;o<t.length;o++){const r=t[o].getTransformedByOperation(n);t.splice(o,1,...r),o+=r.length-1}for(let n=0;n<t.length;n++){const o=t[n];for(let r=n+1;r<t.length;r++){const a=t[r];(o.containsRange(a)||a.containsRange(o)||o.isEqual(a))&&t.splice(r,1)}}return t}getCommonAncestor(){return this.start.getCommonAncestor(this.end)}getContainedElement(){if(this.isCollapsed)return null;const e=this.start.nodeAfter,t=this.end.nodeBefore;return e&&e.is("element")&&e===t?e:null}toJSON(){return{start:this.start.toJSON(),end:this.end.toJSON()}}clone(){return new this.constructor(this.start,this.end)}_getTransformedByInsertOperation(e,t=!1){return this._getTransformedByInsertion(e.position,e.howMany,t)}_getTransformedByMoveOperation(e,t=!1){const n=e.sourcePosition,o=e.howMany,r=e.targetPosition;return this._getTransformedByMove(n,r,o,t)}_getTransformedBySplitOperation(e){const t=this.start._getTransformedBySplitOperation(e);let n=this.end._getTransformedBySplitOperation(e);return this.end.isEqual(e.insertionPosition)&&(n=this.end.getShiftedBy(1)),t.root!=n.root&&(n=this.end.getShiftedBy(-1)),new le(t,n)}_getTransformedByMergeOperation(e){if(this.start.isEqual(e.targetPosition)&&this.end.isEqual(e.deletionPosition))return new le(this.start);let t=this.start._getTransformedByMergeOperation(e),n=this.end._getTransformedByMergeOperation(e);return t.root!=n.root&&(n=this.end.getShiftedBy(-1)),t.isAfter(n)?(e.sourcePosition.isBefore(e.targetPosition)?(t=fe._createAt(n),t.offset=0):(e.deletionPosition.isEqual(t)||(n=e.deletionPosition),t=e.targetPosition),new le(t,n)):new le(t,n)}_getTransformedByInsertion(e,t,n=!1){if(n&&this.containsPosition(e))return[new le(this.start,e),new le(e.getShiftedBy(t),this.end._getTransformedByInsertion(e,t))];{const o=new le(this.start,this.end);return o.start=o.start._getTransformedByInsertion(e,t),o.end=o.end._getTransformedByInsertion(e,t),[o]}}_getTransformedByMove(e,t,n,o=!1){if(this.isCollapsed){const _=this.start._getTransformedByMove(e,t,n);return[new le(_)]}const r=le._createFromPositionAndShift(e,n),a=t._getTransformedByDeletion(e,n);if(this.containsPosition(t)&&!o&&(r.containsPosition(this.start)||r.containsPosition(this.end))){const _=this.start._getTransformedByMove(e,t,n),T=this.end._getTransformedByMove(e,t,n);return[new le(_,T)]}let c;const d=this.getDifference(r);let m=null;const b=this.getIntersection(r);if(d.length==1?m=new le(d[0].start._getTransformedByDeletion(e,n),d[0].end._getTransformedByDeletion(e,n)):d.length==2&&(m=new le(this.start,this.end._getTransformedByDeletion(e,n))),c=m?m._getTransformedByInsertion(a,n,b!==null||o):[],b){const _=new le(b.start._getCombined(r.start,a),b.end._getCombined(r.start,a));c.length==2?c.splice(1,0,_):c.push(_)}return c}_getTransformedByDeletion(e,t){let n=this.start._getTransformedByDeletion(e,t),o=this.end._getTransformedByDeletion(e,t);return n==null&&o==null?null:(n==null&&(n=e),o==null&&(o=e),new le(n,o))}static _createFromPositionAndShift(e,t){const n=e,o=e.getShiftedBy(t);return t>0?new this(n,o):new this(o,n)}static _createIn(e){return new this(fe._createAt(e,0),fe._createAt(e,e.maxOffset))}static _createOn(e){return this._createFromPositionAndShift(fe._createBefore(e),e.offsetSize)}static _createFromRanges(e){if(e.length===0)throw new C.a("range-create-from-ranges-empty-array",null);if(e.length==1)return e[0].clone();const t=e[0];e.sort((r,a)=>r.start.isAfter(a.start)?1:-1);const n=e.indexOf(t),o=new this(t.start,t.end);if(n>0)for(let r=n-1;e[r].end.isEqual(o.start);r++)o.start=fe._createAt(e[r].start);for(let r=n+1;r<e.length&&e[r].start.isEqual(o.end);r++)o.end=fe._createAt(e[r].end);return o}static fromJSON(e,t){return new this(fe.fromJSON(e.start,t),fe.fromJSON(e.end,t))}}class Qa{constructor(){this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap,this._viewToModelLengthCallbacks=new Map,this._markerNameToElements=new Map,this._elementToMarkerNames=new Map,this._unboundMarkerNames=new Set,this.on("modelToViewPosition",(e,t)=>{if(t.viewPosition)return;const n=this._modelToViewMapping.get(t.modelPosition.parent);t.viewPosition=this.findPositionIn(n,t.modelPosition.offset)},{priority:"low"}),this.on("viewToModelPosition",(e,t)=>{if(t.modelPosition)return;const n=this.findMappedViewAncestor(t.viewPosition),o=this._viewToModelMapping.get(n),r=this._toModelOffset(t.viewPosition.parent,t.viewPosition.offset,n);t.modelPosition=fe._createAt(o,r)},{priority:"low"})}bindElements(e,t){this._modelToViewMapping.set(e,t),this._viewToModelMapping.set(t,e)}unbindViewElement(e){const t=this.toModelElement(e);if(this._viewToModelMapping.delete(e),this._elementToMarkerNames.has(e))for(const n of this._elementToMarkerNames.get(e))this._unboundMarkerNames.add(n);this._modelToViewMapping.get(t)==e&&this._modelToViewMapping.delete(t)}unbindModelElement(e){const t=this.toViewElement(e);this._modelToViewMapping.delete(e),this._viewToModelMapping.get(t)==e&&this._viewToModelMapping.delete(t)}bindElementToMarker(e,t){const n=this._markerNameToElements.get(t)||new Set;n.add(e);const o=this._elementToMarkerNames.get(e)||new Set;o.add(t),this._markerNameToElements.set(t,n),this._elementToMarkerNames.set(e,o)}unbindElementFromMarkerName(e,t){const n=this._markerNameToElements.get(t);n&&(n.delete(e),n.size==0&&this._markerNameToElements.delete(t));const o=this._elementToMarkerNames.get(e);o&&(o.delete(t),o.size==0&&this._elementToMarkerNames.delete(e))}flushUnboundMarkerNames(){const e=Array.from(this._unboundMarkerNames);return this._unboundMarkerNames.clear(),e}clearBindings(){this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap,this._markerNameToElements=new Map,this._elementToMarkerNames=new Map,this._unboundMarkerNames=new Set}toModelElement(e){return this._viewToModelMapping.get(e)}toViewElement(e){return this._modelToViewMapping.get(e)}toModelRange(e){return new le(this.toModelPosition(e.start),this.toModelPosition(e.end))}toViewRange(e){return new Ze(this.toViewPosition(e.start),this.toViewPosition(e.end))}toModelPosition(e){const t={viewPosition:e,mapper:this};return this.fire("viewToModelPosition",t),t.modelPosition}toViewPosition(e,t={isPhantom:!1}){const n={modelPosition:e,mapper:this,isPhantom:t.isPhantom};return this.fire("modelToViewPosition",n),n.viewPosition}markerNameToElements(e){const t=this._markerNameToElements.get(e);if(!t)return null;const n=new Set;for(const o of t)if(o.is("attributeElement"))for(const r of o.getElementsWithSameId())n.add(r);else n.add(o);return n}registerViewToModelLength(e,t){this._viewToModelLengthCallbacks.set(e,t)}findMappedViewAncestor(e){let t=e.parent;for(;!this._viewToModelMapping.has(t);)t=t.parent;return t}_toModelOffset(e,t,n){if(n!=e)return this._toModelOffset(e.parent,e.index,n)+this._toModelOffset(e,t,e);if(e.is("$text"))return t;let o=0;for(let r=0;r<t;r++)o+=this.getModelLength(e.getChild(r));return o}getModelLength(e){if(this._viewToModelLengthCallbacks.get(e.name))return this._viewToModelLengthCallbacks.get(e.name)(e);if(this._viewToModelMapping.has(e))return 1;if(e.is("$text"))return e.data.length;if(e.is("uiElement"))return 0;{let t=0;for(const n of e.getChildren())t+=this.getModelLength(n);return t}}findPositionIn(e,t){let n,o=0,r=0,a=0;if(e.is("$text"))return new ye(e,t);for(;r<t;)n=e.getChild(a),o=this.getModelLength(n),r+=o,a++;return r==t?this._moveViewPositionToTextNode(new ye(e,a)):this.findPositionIn(n,t-(r-o))}_moveViewPositionToTextNode(e){const t=e.nodeBefore,n=e.nodeAfter;return t instanceof Te?new ye(t,t.data.length):n instanceof Te?new ye(n,0):e}}Be(Qa,F);class yc{constructor(){this._consumable=new Map,this._textProxyRegistry=new Map}add(e,t){t=xc(t),e instanceof Xo&&(e=this._getSymbolForTextProxy(e)),this._consumable.has(e)||this._consumable.set(e,new Map),this._consumable.get(e).set(t,!0)}consume(e,t){return t=xc(t),e instanceof Xo&&(e=this._getSymbolForTextProxy(e)),!!this.test(e,t)&&(this._consumable.get(e).set(t,!1),!0)}test(e,t){t=xc(t),e instanceof Xo&&(e=this._getSymbolForTextProxy(e));const n=this._consumable.get(e);if(n===void 0)return null;const o=n.get(t);return o===void 0?null:o}revert(e,t){t=xc(t),e instanceof Xo&&(e=this._getSymbolForTextProxy(e));const n=this.test(e,t);return n===!1?(this._consumable.get(e).set(t,!0),!0):n!==!0&&null}_getSymbolForTextProxy(e){let t=null;const n=this._textProxyRegistry.get(e.startOffset);if(n){const o=n.get(e.endOffset);o&&(t=o.get(e.parent))}return t||(t=this._addSymbolForTextProxy(e.startOffset,e.endOffset,e.parent)),t}_addSymbolForTextProxy(e,t,n){const o=Symbol("textProxySymbol");let r,a;return r=this._textProxyRegistry.get(e),r||(r=new Map,this._textProxyRegistry.set(e,r)),a=r.get(t),a||(a=new Map,r.set(t,a)),a.set(n,o),o}}function xc(i){const e=i.split(":");return e[0]=="addMarker"||e[0]=="removeMarker"?i:e.length>1?e[0]+":"+e[1]:e[0]}class id{constructor(e){this.conversionApi=Object.assign({dispatcher:this},e),this._reconversionEventsMapping=new Map}convertChanges(e,t,n){for(const r of e.getMarkersToRemove())this.convertMarkerRemove(r.name,r.range,n);const o=this._mapChangesWithAutomaticReconversion(e);for(const r of o)r.type==="insert"?this.convertInsert(le._createFromPositionAndShift(r.position,r.length),n):r.type==="remove"?this.convertRemove(r.position,r.length,r.name,n):r.type==="reconvert"?this.reconvertElement(r.element,n):this.convertAttribute(r.range,r.attributeKey,r.attributeOldValue,r.attributeNewValue,n);for(const r of this.conversionApi.mapper.flushUnboundMarkerNames()){const a=t.get(r).getRange();this.convertMarkerRemove(r,a,n),this.convertMarkerAdd(r,a,n)}for(const r of e.getMarkersToAdd())this.convertMarkerAdd(r.name,r.range,n)}convertInsert(e,t){this.conversionApi.writer=t,this.conversionApi.consumable=this._createInsertConsumable(e);for(const n of Array.from(e).map(rd))this._convertInsertWithAttributes(n);this._clearConversionApi()}convertRemove(e,t,n,o){this.conversionApi.writer=o,this.fire("remove:"+n,{position:e,length:t},this.conversionApi),this._clearConversionApi()}convertAttribute(e,t,n,o,r){this.conversionApi.writer=r,this.conversionApi.consumable=this._createConsumableForRange(e,"attribute:"+t);for(const a of e){const c={item:a.item,range:le._createFromPositionAndShift(a.previousPosition,a.length),attributeKey:t,attributeOldValue:n,attributeNewValue:o};this._testAndFire("attribute:"+t,c)}this._clearConversionApi()}reconvertElement(e,t){const n=le._createOn(e);this.conversionApi.writer=t,this.conversionApi.consumable=this._createInsertConsumable(n);const o=this.conversionApi.mapper,r=o.toViewElement(e);t.remove(r),this._convertInsertWithAttributes({item:e,range:n});const a=o.toViewElement(e);for(const c of le._createIn(e)){const{item:d}=c,m=mg(d,o);m?m.root!==a.root&&t.move(t.createRangeOn(m),o.toViewPosition(fe._createBefore(d))):this._convertInsertWithAttributes(rd(c))}o.unbindViewElement(r),this._clearConversionApi()}convertSelection(e,t,n){const o=Array.from(t.getMarkersAtPosition(e.getFirstPosition()));if(this.conversionApi.writer=n,this.conversionApi.consumable=this._createSelectionConsumable(e,o),this.fire("selection",{selection:e},this.conversionApi),e.isCollapsed){for(const r of o){const a=r.getRange();if(!lm(e.getFirstPosition(),r,this.conversionApi.mapper))continue;const c={item:e,markerName:r.name,markerRange:a};this.conversionApi.consumable.test(e,"addMarker:"+r.name)&&this.fire("addMarker:"+r.name,c,this.conversionApi)}for(const r of e.getAttributeKeys()){const a={item:e,range:e.getFirstRange(),attributeKey:r,attributeOldValue:null,attributeNewValue:e.getAttribute(r)};this.conversionApi.consumable.test(e,"attribute:"+a.attributeKey)&&this.fire("attribute:"+a.attributeKey+":$text",a,this.conversionApi)}this._clearConversionApi()}else this._clearConversionApi()}convertMarkerAdd(e,t,n){if(t.root.rootName=="$graveyard")return;this.conversionApi.writer=n;const o="addMarker:"+e,r=new yc;if(r.add(t,o),this.conversionApi.consumable=r,this.fire(o,{markerName:e,markerRange:t},this.conversionApi),r.test(t,o)){this.conversionApi.consumable=this._createConsumableForRange(t,o);for(const a of t.getItems()){if(!this.conversionApi.consumable.test(a,o))continue;const c={item:a,range:le._createOn(a),markerName:e,markerRange:t};this.fire(o,c,this.conversionApi)}this._clearConversionApi()}else this._clearConversionApi()}convertMarkerRemove(e,t,n){t.root.rootName!="$graveyard"&&(this.conversionApi.writer=n,this.fire("removeMarker:"+e,{markerName:e,markerRange:t},this.conversionApi),this._clearConversionApi())}_mapReconversionTriggerEvent(e,t){this._reconversionEventsMapping.set(t,e)}_createInsertConsumable(e){const t=new yc;for(const n of e){const o=n.item;t.add(o,"insert");for(const r of o.getAttributeKeys())t.add(o,"attribute:"+r)}return t}_createConsumableForRange(e,t){const n=new yc;for(const o of e.getItems())n.add(o,t);return n}_createSelectionConsumable(e,t){const n=new yc;n.add(e,"selection");for(const o of t)n.add(e,"addMarker:"+o.name);for(const o of e.getAttributeKeys())n.add(e,"attribute:"+o);return n}_testAndFire(e,t){this.conversionApi.consumable.test(t.item,e)&&this.fire(function(n,o){const r=o.item.name||"$text";return`${n}:${r}`}(e,t),t,this.conversionApi)}_clearConversionApi(){delete this.conversionApi.writer,delete this.conversionApi.consumable}_convertInsertWithAttributes(e){this._testAndFire("insert",e);for(const t of e.item.getAttributeKeys())e.attributeKey=t,e.attributeOldValue=null,e.attributeNewValue=e.item.getAttribute(t),this._testAndFire("attribute:"+t,e)}_mapChangesWithAutomaticReconversion(e){const t=new Set,n=[];for(const o of e.getChanges()){const r=o.position||o.range.start,a=r.parent;if(As(r,a)){n.push(o);continue}const c=o.type==="attribute"?xi(r,a,null):a;if(c.is("$text")){n.push(o);continue}let d;if(d=o.type==="attribute"?`attribute:${o.attributeKey}:${c.name}`:`${o.type}:${o.name}`,this._isReconvertTriggerEvent(d,c.name)){if(t.has(c))continue;t.add(c),n.push({type:"reconvert",element:c})}else n.push(o)}return n}_isReconvertTriggerEvent(e,t){return this._reconversionEventsMapping.get(e)===t}}function lm(i,e,t){const n=e.getRange(),o=Array.from(i.getAncestors());return o.shift(),o.reverse(),!o.some(r=>{if(n.containsItem(r))return!!t.toViewElement(r).getCustomProperty("addHighlight")})}function rd(i){return{item:i.item,range:le._createFromPositionAndShift(i.previousPosition,i.length)}}function mg(i,e){if(i.is("textProxy")){const t=e.toViewPosition(fe._createBefore(i)).parent;return t.is("$text")?t:null}return e.toViewElement(i)}Be(id,F);class Ni{constructor(e,t,n){this._lastRangeBackward=!1,this._ranges=[],this._attrs=new Map,e&&this.setTo(e,t,n)}get anchor(){if(this._ranges.length>0){const e=this._ranges[this._ranges.length-1];return this._lastRangeBackward?e.end:e.start}return null}get focus(){if(this._ranges.length>0){const e=this._ranges[this._ranges.length-1];return this._lastRangeBackward?e.start:e.end}return null}get isCollapsed(){return this._ranges.length===1&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}isEqual(e){if(this.rangeCount!=e.rangeCount)return!1;if(this.rangeCount===0)return!0;if(!this.anchor.isEqual(e.anchor)||!this.focus.isEqual(e.focus))return!1;for(const t of this._ranges){let n=!1;for(const o of e._ranges)if(t.isEqual(o)){n=!0;break}if(!n)return!1}return!0}*getRanges(){for(const e of this._ranges)yield new le(e.start,e.end)}getFirstRange(){let e=null;for(const t of this._ranges)e&&!t.start.isBefore(e.start)||(e=t);return e?new le(e.start,e.end):null}getLastRange(){let e=null;for(const t of this._ranges)e&&!t.end.isAfter(e.end)||(e=t);return e?new le(e.start,e.end):null}getFirstPosition(){const e=this.getFirstRange();return e?e.start.clone():null}getLastPosition(){const e=this.getLastRange();return e?e.end.clone():null}setTo(e,t,n){if(e===null)this._setRanges([]);else if(e instanceof Ni)this._setRanges(e.getRanges(),e.isBackward);else if(e&&typeof e.getRanges=="function")this._setRanges(e.getRanges(),e.isBackward);else if(e instanceof le)this._setRanges([e],!!t&&!!t.backward);else if(e instanceof fe)this._setRanges([new le(e)]);else if(e instanceof _r){const o=!!n&&!!n.backward;let r;if(t=="in")r=le._createIn(e);else if(t=="on")r=le._createOn(e);else{if(t===void 0)throw new C.a("model-selection-setto-required-second-parameter",[this,e]);r=new le(fe._createAt(e,t))}this._setRanges([r],o)}else{if(!Yn(e))throw new C.a("model-selection-setto-not-selectable",[this,e]);this._setRanges(e,t&&!!t.backward)}}_setRanges(e,t=!1){const n=(e=Array.from(e)).some(o=>{if(!(o instanceof le))throw new C.a("model-selection-set-ranges-not-range",[this,e]);return this._ranges.every(r=>!r.isEqual(o))});if(e.length!==this._ranges.length||n){this._removeAllRanges();for(const o of e)this._pushRange(o);this._lastRangeBackward=!!t,this.fire("change:range",{directChange:!0})}}setFocus(e,t){if(this.anchor===null)throw new C.a("model-selection-setfocus-no-ranges",[this,e]);const n=fe._createAt(e,t);if(n.compareWith(this.focus)=="same")return;const o=this.anchor;this._ranges.length&&this._popRange(),n.compareWith(o)=="before"?(this._pushRange(new le(n,o)),this._lastRangeBackward=!0):(this._pushRange(new le(o,n)),this._lastRangeBackward=!1),this.fire("change:range",{directChange:!0})}getAttribute(e){return this._attrs.get(e)}getAttributes(){return this._attrs.entries()}getAttributeKeys(){return this._attrs.keys()}hasAttribute(e){return this._attrs.has(e)}removeAttribute(e){this.hasAttribute(e)&&(this._attrs.delete(e),this.fire("change:attribute",{attributeKeys:[e],directChange:!0}))}setAttribute(e,t){this.getAttribute(e)!==t&&(this._attrs.set(e,t),this.fire("change:attribute",{attributeKeys:[e],directChange:!0}))}getSelectedElement(){return this.rangeCount!==1?null:this.getFirstRange().getContainedElement()}is(e){return e==="selection"||e==="model:selection"}*getSelectedBlocks(){const e=new WeakSet;for(const t of this.getRanges()){const n=Zo(t.start,e);n&&ad(n,t)&&(yield n);for(const r of t.getWalker()){const a=r.item;r.type=="elementEnd"&&lo(a,e,t)&&(yield a)}const o=Zo(t.end,e);o&&!t.end.isTouching(fe._createAt(o,0))&&ad(o,t)&&(yield o)}}containsEntireContent(e=this.anchor.root){const t=fe._createAt(e,0),n=fe._createAt(e,"end");return t.isTouching(this.getFirstPosition())&&n.isTouching(this.getLastPosition())}_pushRange(e){this._checkRange(e),this._ranges.push(new le(e.start,e.end))}_checkRange(e){for(let t=0;t<this._ranges.length;t++)if(e.isIntersecting(this._ranges[t]))throw new C.a("model-selection-range-intersects",[this,e],{addedRange:e,intersectingRange:this._ranges[t]})}_removeAllRanges(){for(;this._ranges.length>0;)this._popRange()}_popRange(){this._ranges.pop()}}function sd(i,e){return!e.has(i)&&(e.add(i),i.root.document.model.schema.isBlock(i)&&i.parent)}function lo(i,e,t){return sd(i,e)&&ad(i,t)}function Zo(i,e){const t=i.parent.root.document.model.schema,n=i.parent.getAncestors({parentFirst:!0,includeSelf:!0});let o=!1;const r=n.find(a=>!o&&(o=t.isLimit(a),!o&&sd(a,e)));return n.forEach(a=>e.add(a)),r}function ad(i,e){const t=function(n){const o=n.root.document.model.schema;let r=n.parent;for(;r;){if(o.isBlock(r))return r;r=r.parent}}(i);return t?!e.containsRange(le._createOn(t),!0):!0}Be(Ni,F);class Ti extends le{constructor(e,t){super(e,t),Nc.call(this)}detach(){this.stopListening()}is(e){return e==="liveRange"||e==="model:liveRange"||e=="range"||e==="model:range"}toRange(){return new le(this.start,this.end)}static fromRange(e){return new Ti(e.start,e.end)}}function Nc(){this.listenTo(this.root.document.model,"applyOperation",(i,e)=>{const t=e[0];t.isDocumentOperation&&Ss.call(this,t)},{priority:"low"})}function Ss(i){const e=this.getTransformedByOperation(i),t=le._createFromRanges(e),n=!t.isEqual(this),o=function(a,c){switch(c.type){case"insert":return a.containsPosition(c.position);case"move":case"remove":case"reinsert":case"merge":return a.containsPosition(c.sourcePosition)||a.start.isEqual(c.sourcePosition)||a.containsPosition(c.targetPosition);case"split":return a.containsPosition(c.splitPosition)||a.containsPosition(c.insertionPosition)}return!1}(this,i);let r=null;if(n){t.root.rootName=="$graveyard"&&(r=i.type=="remove"?i.sourcePosition:i.deletionPosition);const a=this.toRange();this.start=t.start,this.end=t.end,this.fire("change:range",a,{deletionPosition:r})}else o&&this.fire("change:content",this.toRange(),{deletionPosition:r})}Be(Ti,F);class zo{constructor(e){this._selection=new cm(e),this._selection.delegate("change:range").to(this),this._selection.delegate("change:attribute").to(this),this._selection.delegate("change:marker").to(this)}get isCollapsed(){return this._selection.isCollapsed}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get rangeCount(){return this._selection.rangeCount}get hasOwnRange(){return this._selection.hasOwnRange}get isBackward(){return this._selection.isBackward}get isGravityOverridden(){return this._selection.isGravityOverridden}get markers(){return this._selection.markers}get _ranges(){return this._selection._ranges}getRanges(){return this._selection.getRanges()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getSelectedBlocks(){return this._selection.getSelectedBlocks()}getSelectedElement(){return this._selection.getSelectedElement()}containsEntireContent(e){return this._selection.containsEntireContent(e)}destroy(){this._selection.destroy()}getAttributeKeys(){return this._selection.getAttributeKeys()}getAttributes(){return this._selection.getAttributes()}getAttribute(e){return this._selection.getAttribute(e)}hasAttribute(e){return this._selection.hasAttribute(e)}refresh(){this._selection._updateMarkers(),this._selection._updateAttributes(!1)}observeMarkers(e){this._selection.observeMarkers(e)}is(e){return e==="selection"||e=="model:selection"||e=="documentSelection"||e=="model:documentSelection"}_setFocus(e,t){this._selection.setFocus(e,t)}_setTo(e,t,n){this._selection.setTo(e,t,n)}_setAttribute(e,t){this._selection.setAttribute(e,t)}_removeAttribute(e){this._selection.removeAttribute(e)}_getStoredAttributes(){return this._selection._getStoredAttributes()}_overrideGravity(){return this._selection.overrideGravity()}_restoreGravity(e){this._selection.restoreGravity(e)}static _getStoreAttributeKey(e){return"selection:"+e}static _isStoreAttributeKey(e){return e.startsWith("selection:")}}Be(zo,F);class cm extends Ni{constructor(e){super(),this.markers=new io({idProperty:"name"}),this._model=e.model,this._document=e,this._attributePriority=new Map,this._selectionRestorePosition=null,this._hasChangedRange=!1,this._overriddenGravityRegister=new Set,this._observedMarkers=new Set,this.listenTo(this._model,"applyOperation",(t,n)=>{const o=n[0];o.isDocumentOperation&&o.type!="marker"&&o.type!="rename"&&o.type!="noop"&&(this._ranges.length==0&&this._selectionRestorePosition&&this._fixGraveyardSelection(this._selectionRestorePosition),this._selectionRestorePosition=null,this._hasChangedRange&&(this._hasChangedRange=!1,this.fire("change:range",{directChange:!1})))},{priority:"lowest"}),this.on("change:range",()=>{for(const t of this.getRanges())if(!this._document._validateSelectionRange(t))throw new C.a("document-selection-wrong-position",this,{range:t})}),this.listenTo(this._model.markers,"update",(t,n,o,r)=>{this._updateMarker(n,r)}),this.listenTo(this._document,"change",(t,n)=>{(function(o,r){const a=o.document.differ;for(const c of a.getChanges()){if(c.type!="insert")continue;const d=c.position.parent;c.length===d.maxOffset&&o.enqueueChange(r,m=>{const b=Array.from(d.getAttributeKeys()).filter(_=>_.startsWith("selection:"));for(const _ of b)m.removeAttribute(_,d)})}})(this._model,n)})}get isCollapsed(){return this._ranges.length===0?this._document._getDefaultRange().isCollapsed:super.isCollapsed}get anchor(){return super.anchor||this._document._getDefaultRange().start}get focus(){return super.focus||this._document._getDefaultRange().end}get rangeCount(){return this._ranges.length?this._ranges.length:1}get hasOwnRange(){return this._ranges.length>0}get isGravityOverridden(){return!!this._overriddenGravityRegister.size}destroy(){for(let e=0;e<this._ranges.length;e++)this._ranges[e].detach();this.stopListening()}*getRanges(){this._ranges.length?yield*super.getRanges():yield this._document._getDefaultRange()}getFirstRange(){return super.getFirstRange()||this._document._getDefaultRange()}getLastRange(){return super.getLastRange()||this._document._getDefaultRange()}setTo(e,t,n){super.setTo(e,t,n),this._updateAttributes(!0),this._updateMarkers()}setFocus(e,t){super.setFocus(e,t),this._updateAttributes(!0),this._updateMarkers()}setAttribute(e,t){if(this._setAttribute(e,t)){const n=[e];this.fire("change:attribute",{attributeKeys:n,directChange:!0})}}removeAttribute(e){if(this._removeAttribute(e)){const t=[e];this.fire("change:attribute",{attributeKeys:t,directChange:!0})}}overrideGravity(){const e=S();return this._overriddenGravityRegister.add(e),this._overriddenGravityRegister.size===1&&this._updateAttributes(!0),e}restoreGravity(e){if(!this._overriddenGravityRegister.has(e))throw new C.a("document-selection-gravity-wrong-restore",this,{uid:e});this._overriddenGravityRegister.delete(e),this.isGravityOverridden||this._updateAttributes(!0)}observeMarkers(e){this._observedMarkers.add(e),this._updateMarkers()}_popRange(){this._ranges.pop().detach()}_pushRange(e){const t=this._prepareRange(e);t&&this._ranges.push(t)}_prepareRange(e){if(this._checkRange(e),e.root==this._document.graveyard)return;const t=Ti.fromRange(e);return t.on("change:range",(n,o,r)=>{if(this._hasChangedRange=!0,t.root==this._document.graveyard){this._selectionRestorePosition=r.deletionPosition;const a=this._ranges.indexOf(t);this._ranges.splice(a,1),t.detach()}}),t}_updateMarkers(){if(!this._observedMarkers.size)return;const e=[];let t=!1;for(const o of this._model.markers){const r=o.name.split(":",1)[0];if(!this._observedMarkers.has(r))continue;const a=o.getRange();for(const c of this.getRanges())a.containsRange(c,!c.isCollapsed)&&e.push(o)}const n=Array.from(this.markers);for(const o of e)this.markers.has(o)||(this.markers.add(o),t=!0);for(const o of Array.from(this.markers))e.includes(o)||(this.markers.remove(o),t=!0);t&&this.fire("change:marker",{oldMarkers:n,directChange:!1})}_updateMarker(e,t){const n=e.name.split(":",1)[0];if(!this._observedMarkers.has(n))return;let o=!1;const r=Array.from(this.markers),a=this.markers.has(e);if(t){let c=!1;for(const d of this.getRanges())if(t.containsRange(d,!d.isCollapsed)){c=!0;break}c&&!a?(this.markers.add(e),o=!0):!c&&a&&(this.markers.remove(e),o=!0)}else a&&(this.markers.remove(e),o=!0);o&&this.fire("change:marker",{oldMarkers:r,directChange:!1})}_updateAttributes(e){const t=Ke(this._getSurroundingAttributes()),n=Ke(this.getAttributes());if(e)this._attributePriority=new Map,this._attrs=new Map;else for(const[r,a]of this._attributePriority)a=="low"&&(this._attrs.delete(r),this._attributePriority.delete(r));this._setAttributesTo(t);const o=[];for(const[r,a]of this.getAttributes())n.has(r)&&n.get(r)===a||o.push(r);for(const[r]of n)this.hasAttribute(r)||o.push(r);o.length>0&&this.fire("change:attribute",{attributeKeys:o,directChange:!1})}_setAttribute(e,t,n=!0){const o=n?"normal":"low";return o=="low"&&this._attributePriority.get(e)=="normal"?!1:super.getAttribute(e)!==t&&(this._attrs.set(e,t),this._attributePriority.set(e,o),!0)}_removeAttribute(e,t=!0){const n=t?"normal":"low";return(n!="low"||this._attributePriority.get(e)!="normal")&&(this._attributePriority.set(e,n),!!super.hasAttribute(e)&&(this._attrs.delete(e),!0))}_setAttributesTo(e){const t=new Set;for(const[n,o]of this.getAttributes())e.get(n)!==o&&this._removeAttribute(n,!1);for(const[n,o]of e)this._setAttribute(n,o,!1)&&t.add(n);return t}*_getStoredAttributes(){const e=this.getFirstPosition().parent;if(this.isCollapsed&&e.isEmpty)for(const t of e.getAttributeKeys())t.startsWith("selection:")&&(yield[t.substr(10),e.getAttribute(t)])}_getSurroundingAttributes(){const e=this.getFirstPosition(),t=this._model.schema;let n=null;if(this.isCollapsed){const o=e.textNode?e.textNode:e.nodeBefore,r=e.textNode?e.textNode:e.nodeAfter;if(this.isGravityOverridden||(n=Tc(o)),n||(n=Tc(r)),!this.isGravityOverridden&&!n){let a=o;for(;a&&!t.isInline(a)&&!n;)a=a.previousSibling,n=Tc(a)}if(!n){let a=r;for(;a&&!t.isInline(a)&&!n;)a=a.nextSibling,n=Tc(a)}n||(n=this._getStoredAttributes())}else{const o=this.getFirstRange();for(const r of o){if(r.item.is("element")&&t.isObject(r.item))break;if(r.type=="text"){n=r.item.getAttributes();break}}}return n}_fixGraveyardSelection(e){const t=this._model.schema.getNearestSelectionRange(e);t&&this._pushRange(t)}}function Tc(i){return i instanceof Xo||i instanceof It?i.getAttributes():null}class ld{constructor(e){this._dispatchers=e}add(e){for(const t of this._dispatchers)e(t);return this}}var Zn=function(i){return $r(i,5)};class Ya extends ld{elementToElement(e){return this.add(function(t){return(t=Zn(t)).view=Xa(t.view,"container"),n=>{var o;if(n.on("insert:"+t.model,(o=t.view,(r,a,c)=>{const d=o(a.item,c);if(!d||!c.consumable.consume(a.item,"insert"))return;const m=c.mapper.toViewPosition(a.range.start);c.mapper.bindElements(a.item,d),c.writer.insert(m,d)}),{priority:t.converterPriority||"normal"}),t.triggerBy){if(t.triggerBy.attributes)for(const r of t.triggerBy.attributes)n._mapReconversionTriggerEvent(t.model,`attribute:${r}:${t.model}`);if(t.triggerBy.children)for(const r of t.triggerBy.children)n._mapReconversionTriggerEvent(t.model,"insert:"+r),n._mapReconversionTriggerEvent(t.model,"remove:"+r)}}}(e))}attributeToElement(e){return this.add(function(t){t=Zn(t);let n="attribute:"+(t.model.key?t.model.key:t.model);if(t.model.name&&(n+=":"+t.model.name),t.model.values)for(const r of t.model.values)t.view[r]=Xa(t.view[r],"attribute");else t.view=Xa(t.view,"attribute");const o=Ja(t);return r=>{r.on(n,function(a){return(c,d,m)=>{const b=a(d.attributeOldValue,m),_=a(d.attributeNewValue,m);if(!b&&!_||!m.consumable.consume(d.item,c.name))return;const T=m.writer,E=T.document.selection;if(d.item instanceof Ni||d.item instanceof zo)T.wrap(E.getFirstRange(),_);else{let P=m.mapper.toViewRange(d.range);d.attributeOldValue!==null&&b&&(P=T.unwrap(P,b)),d.attributeNewValue!==null&&_&&T.wrap(P,_)}}}(o),{priority:t.converterPriority||"normal"})}}(e))}attributeToAttribute(e){return this.add(function(t){t=Zn(t);let n="attribute:"+(t.model.key?t.model.key:t.model);if(t.model.name&&(n+=":"+t.model.name),t.model.values)for(const r of t.model.values)t.view[r]=ud(t.view[r]);else t.view=ud(t.view);const o=Ja(t);return r=>{var a;r.on(n,(a=o,(c,d,m)=>{const b=a(d.attributeOldValue,m),_=a(d.attributeNewValue,m);if(!b&&!_||!m.consumable.consume(d.item,c.name))return;const T=m.mapper.toViewElement(d.item),E=m.writer;if(!T)throw new C.a("conversion-attribute-to-attribute-on-text",[d,m]);if(d.attributeOldValue!==null&&b)if(b.key=="class"){const P=Tt(b.value);for(const R of P)E.removeClass(R,T)}else if(b.key=="style"){const P=Object.keys(b.value);for(const R of P)E.removeStyle(R,T)}else E.removeAttribute(b.key,T);if(d.attributeNewValue!==null&&_)if(_.key=="class"){const P=Tt(_.value);for(const R of P)E.addClass(R,T)}else if(_.key=="style"){const P=Object.keys(_.value);for(const R of P)E.setStyle(R,_.value[R],T)}else E.setAttribute(_.key,_.value,T)}),{priority:t.converterPriority||"normal"})}}(e))}markerToElement(e){return this.add(function(t){return(t=Zn(t)).view=Xa(t.view,"ui"),n=>{var o;n.on("addMarker:"+t.model,(o=t.view,(r,a,c)=>{a.isOpening=!0;const d=o(a,c);a.isOpening=!1;const m=o(a,c);if(!d||!m)return;const b=a.markerRange;if(b.isCollapsed&&!c.consumable.consume(b,r.name))return;for(const E of b)if(!c.consumable.consume(E.item,r.name))return;const _=c.mapper,T=c.writer;T.insert(_.toViewPosition(b.start),d),c.mapper.bindElementToMarker(d,a.markerName),b.isCollapsed||(T.insert(_.toViewPosition(b.end),m),c.mapper.bindElementToMarker(m,a.markerName)),r.stop()}),{priority:t.converterPriority||"normal"}),n.on("removeMarker:"+t.model,(t.view,(r,a,c)=>{const d=c.mapper.markerNameToElements(a.markerName);if(d){for(const m of d)c.mapper.unbindElementFromMarkerName(m,a.markerName),c.writer.clear(c.writer.createRangeOn(m),m);c.writer.clearClonedElementsGroup(a.markerName),r.stop()}}),{priority:t.converterPriority||"normal"})}}(e))}markerToHighlight(e){return this.add(function(t){return n=>{var o;n.on("addMarker:"+t.model,(o=t.view,(r,a,c)=>{if(!a.item||!(a.item instanceof Ni||a.item instanceof zo||a.item.is("$textProxy")))return;const d=Ds(o,a,c);if(!d||!c.consumable.consume(a.item,r.name))return;const m=c.writer,b=um(m,d),_=m.document.selection;if(a.item instanceof Ni||a.item instanceof zo)m.wrap(_.getFirstRange(),b,_);else{const T=c.mapper.toViewRange(a.range),E=m.wrap(T,b);for(const P of E.getItems())if(P.is("attributeElement")&&P.isSimilar(b)){c.mapper.bindElementToMarker(P,a.markerName);break}}}),{priority:t.converterPriority||"normal"}),n.on("addMarker:"+t.model,function(r){return(a,c,d)=>{if(!c.item||!(c.item instanceof Pt))return;const m=Ds(r,c,d);if(!m||!d.consumable.test(c.item,a.name))return;const b=d.mapper.toViewElement(c.item);if(b&&b.getCustomProperty("addHighlight")){d.consumable.consume(c.item,a.name);for(const _ of le._createIn(c.item))d.consumable.consume(_.item,a.name);b.getCustomProperty("addHighlight")(b,m,d.writer),d.mapper.bindElementToMarker(b,c.markerName)}}}(t.view),{priority:t.converterPriority||"normal"}),n.on("removeMarker:"+t.model,function(r){return(a,c,d)=>{if(c.markerRange.isCollapsed)return;const m=Ds(r,c,d);if(!m)return;const b=um(d.writer,m),_=d.mapper.markerNameToElements(c.markerName);if(_){for(const T of _)d.mapper.unbindElementFromMarkerName(T,c.markerName),T.is("attributeElement")?d.writer.unwrap(d.writer.createRangeOn(T),b):T.getCustomProperty("removeHighlight")(T,m.id,d.writer);d.writer.clearClonedElementsGroup(c.markerName),a.stop()}}}(t.view),{priority:t.converterPriority||"normal"})}}(e))}markerToData(e){return this.add(function(t){const n=(t=Zn(t)).model;return t.view||(t.view=o=>({group:n,name:o.substr(t.model.length+1)})),o=>{var r;o.on("addMarker:"+n,(r=t.view,(a,c,d)=>{const m=r(c.markerName,d);if(!m)return;const b=c.markerRange;d.consumable.consume(b,a.name)&&(cd(b,!1,d,c,m),cd(b,!0,d,c,m),a.stop())}),{priority:t.converterPriority||"normal"}),o.on("removeMarker:"+n,function(a){return(c,d,m)=>{const b=a(d.markerName,m);if(!b)return;const _=m.mapper.markerNameToElements(d.markerName);if(_){for(const E of _)m.mapper.unbindElementFromMarkerName(E,d.markerName),E.is("containerElement")?(T(`data-${b.group}-start-before`,E),T(`data-${b.group}-start-after`,E),T(`data-${b.group}-end-before`,E),T(`data-${b.group}-end-after`,E)):m.writer.clear(m.writer.createRangeOn(E),E);m.writer.clearClonedElementsGroup(d.markerName),c.stop()}function T(E,P){if(P.hasAttribute(E)){const R=new Set(P.getAttribute(E).split(","));R.delete(b.name),R.size==0?m.writer.removeAttribute(E,P):m.writer.setAttribute(E,Array.from(R).join(","),P)}}}}(t.view),{priority:t.converterPriority||"normal"})}}(e))}}function um(i,e){const t=i.createAttributeElement("span",e.attributes);return e.classes&&t._addClass(e.classes),typeof e.priority=="number"&&(t._priority=e.priority),t._id=e.id,t}function cd(i,e,t,n,o){const r=e?i.start:i.end,a=r.nodeAfter&&r.nodeAfter.is("element")?r.nodeAfter:null,c=r.nodeBefore&&r.nodeBefore.is("element")?r.nodeBefore:null;if(a||c){let d,m;e&&a||!e&&!c?(d=a,m=!0):(d=c,m=!1);const b=t.mapper.toViewElement(d);if(b)return void function(_,T,E,P,R,z){const $=`data-${z.group}-${T?"start":"end"}-${E?"before":"after"}`,J=_.hasAttribute($)?_.getAttribute($).split(","):[];J.unshift(z.name),P.writer.setAttribute($,J.join(","),_),P.mapper.bindElementToMarker(_,R.markerName)}(b,e,m,t,n,o)}(function(d,m,b,_,T){const E=`${T.group}-${m?"start":"end"}`,P=T.name?{name:T.name}:null,R=b.writer.createUIElement(E,P);b.writer.insert(d,R),b.mapper.bindElementToMarker(R,_.markerName)})(t.mapper.toViewPosition(r),e,t,n,o)}function Xa(i,e){return typeof i=="function"?i:(t,n)=>function(o,r,a){typeof o=="string"&&(o={name:o});let c;const d=r.writer,m=Object.assign({},o.attributes);if(a=="container")c=d.createContainerElement(o.name,m);else if(a=="attribute"){const b={priority:o.priority||bi.DEFAULT_PRIORITY};c=d.createAttributeElement(o.name,m,b)}else c=d.createUIElement(o.name,m);if(o.styles){const b=Object.keys(o.styles);for(const _ of b)d.setStyle(_,o.styles[_],c)}if(o.classes){const b=o.classes;if(typeof b=="string")d.addClass(b,c);else for(const _ of b)d.addClass(_,c)}return c}(i,n,e)}function Ja(i){return i.model.values?(e,t)=>{const n=i.view[e];return n?n(e,t):null}:i.view}function ud(i){return typeof i=="string"?e=>({key:i,value:e}):typeof i=="object"?i.value?()=>i:e=>({key:i.key,value:e}):i}function Ds(i,e,t){const n=typeof i=="function"?i(e,t):i;return n?(n.priority||(n.priority=10),n.id||(n.id=e.markerName),n):null}function Cc(i){const{schema:e,document:t}=i.model;for(const n of t.getRootNames()){const o=t.getRoot(n);if(o.isEmpty&&!e.checkChild(o,"$text")&&e.checkChild(o,"paragraph"))return i.insertElement("paragraph",o),!0}return!1}function Za(i,e,t){const n=t.createContext(i);return!!t.checkChild(n,"paragraph")&&!!t.checkChild(n.push("paragraph"),e)}function dm(i,e){const t=e.createElement("paragraph");return e.insert(t,i),e.createPositionAt(t,0)}class hm extends ld{elementToElement(e){return this.add(el(e))}elementToAttribute(e){return this.add(function(t){mm(t=Zn(t));const n=dd(t,!1),o=Ec(t.view),r=o?"element:"+o:"element";return a=>{a.on(r,n,{priority:t.converterPriority||"low"})}}(e))}attributeToAttribute(e){return this.add(function(t){t=Zn(t);let n=null;(typeof t.view=="string"||t.view.key)&&(n=function(r){typeof r.view=="string"&&(r.view={key:r.view});const a=r.view.key;let c;if(a=="class"||a=="style")c={[a=="class"?"classes":"styles"]:r.view.value};else{const d=r.view.value===void 0?/[\s\S]*/:r.view.value;c={attributes:{[a]:d}}}return r.view.name&&(c.name=r.view.name),r.view=c,a}(t)),mm(t,n);const o=dd(t,!0);return r=>{r.on("element",o,{priority:t.converterPriority||"low"})}}(e))}elementToMarker(e){return this.add(function(t){return function(n){const o=n.model;n.model=(r,a)=>{const c=typeof o=="string"?o:o(r,a);return a.writer.createElement("$marker",{"data-name":c})}}(t=Zn(t)),el(t)}(e))}dataToMarker(e){return this.add(function(t){(t=Zn(t)).model||(t.model=r=>r?t.view+":"+r:t.view);const n=tl(Ci(t,"start")),o=tl(Ci(t,"end"));return r=>{r.on("element:"+t.view+"-start",n,{priority:t.converterPriority||"normal"}),r.on("element:"+t.view+"-end",o,{priority:t.converterPriority||"normal"});const a=O.get("low"),c=O.get("highest"),d=O.get(t.converterPriority)/c;r.on("element",function(m){return(b,_,T)=>{const E="data-"+m.view;function P(R,z){for(const $ of z){const J=m.model($,T),ue=T.writer.createElement("$marker",{"data-name":J});T.writer.insert(ue,R),_.modelCursor.isEqual(R)?_.modelCursor=_.modelCursor.getShiftedBy(1):_.modelCursor=_.modelCursor._getTransformedByInsertion(R,1),_.modelRange=_.modelRange._getTransformedByInsertion(R,1)[0]}}(T.consumable.test(_.viewItem,{attributes:E+"-end-after"})||T.consumable.test(_.viewItem,{attributes:E+"-start-after"})||T.consumable.test(_.viewItem,{attributes:E+"-end-before"})||T.consumable.test(_.viewItem,{attributes:E+"-start-before"}))&&(_.modelRange||Object.assign(_,T.convertChildren(_.viewItem,_.modelCursor)),T.consumable.consume(_.viewItem,{attributes:E+"-end-after"})&&P(_.modelRange.end,_.viewItem.getAttribute(E+"-end-after").split(",")),T.consumable.consume(_.viewItem,{attributes:E+"-start-after"})&&P(_.modelRange.end,_.viewItem.getAttribute(E+"-start-after").split(",")),T.consumable.consume(_.viewItem,{attributes:E+"-end-before"})&&P(_.modelRange.start,_.viewItem.getAttribute(E+"-end-before").split(",")),T.consumable.consume(_.viewItem,{attributes:E+"-start-before"})&&P(_.modelRange.start,_.viewItem.getAttribute(E+"-start-before").split(",")))}}(t),{priority:a+d})}}(e))}}function el(i){const e=tl(i=Zn(i)),t=Ec(i.view),n=t?"element:"+t:"element";return o=>{o.on(n,e,{priority:i.converterPriority||"normal"})}}function Ec(i){return typeof i=="string"?i:typeof i=="object"&&typeof i.name=="string"?i.name:null}function tl(i){const e=new Ct(i.view);return(t,n,o)=>{const r=e.match(n.viewItem);if(!r)return;const a=r.match;if(a.name=!0,!o.consumable.test(n.viewItem,a))return;const c=function(d,m,b){return d instanceof Function?d(m,b):b.writer.createElement(d)}(i.model,n.viewItem,o);c&&o.safeInsert(c,n.modelCursor)&&(o.consumable.consume(n.viewItem,a),o.convertChildren(n.viewItem,c),o.updateConversionResult(c,n))}}function mm(i,e=null){const t=e===null||(r=>r.getAttribute(e)),n=typeof i.model!="object"?i.model:i.model.key,o=typeof i.model!="object"||i.model.value===void 0?t:i.model.value;i.model={key:n,value:o}}function dd(i,e){const t=new Ct(i.view);return(n,o,r)=>{const a=t.match(o.viewItem);if(!a||(function(m,b){const _=typeof m=="function"?m(b):m;return typeof _=="object"&&!Ec(_)?!1:!_.classes&&!_.attributes&&!_.styles}(i.view,o.viewItem)?a.match.name=!0:delete a.match.name,!r.consumable.test(o.viewItem,a.match)))return;const c=i.model.key,d=typeof i.model.value=="function"?i.model.value(o.viewItem,r):i.model.value;d!==null&&(o.modelRange||Object.assign(o,r.convertChildren(o.viewItem,o.modelCursor)),function(m,b,_,T){let E=!1;for(const P of Array.from(m.getItems({shallow:_})))T.schema.checkAttribute(P,b.key)&&(E=!0,P.hasAttribute(b.key)||T.writer.setAttribute(b.key,b.value,P));return E}(o.modelRange,{key:c,value:d},e,r)&&r.consumable.consume(o.viewItem,a.match))}}function Ci(i,e){const t={};return t.view=i.view+"-"+e,t.model=(n,o)=>{const r=n.getAttribute("name"),a=i.model(r,o);return o.writer.createElement("$marker",{"data-name":a})},t}class hd{constructor(e,t){this.model=e,this.view=new _c(t),this.mapper=new Qa,this.downcastDispatcher=new id({mapper:this.mapper,schema:e.schema});const n=this.model.document,o=n.selection,r=this.model.markers;this.listenTo(this.model,"_beforeChanges",()=>{this.view._disableRendering(!0)},{priority:"highest"}),this.listenTo(this.model,"_afterChanges",()=>{this.view._disableRendering(!1)},{priority:"lowest"}),this.listenTo(n,"change",()=>{this.view.change(a=>{this.downcastDispatcher.convertChanges(n.differ,r,a),this.downcastDispatcher.convertSelection(o,r,a)})},{priority:"low"}),this.listenTo(this.view.document,"selectionChange",function(a,c){return(d,m)=>{const b=m.newSelection,_=[];for(const E of b.getRanges())_.push(c.toModelRange(E));const T=a.createSelection(_,{backward:b.isBackward});T.isEqual(a.document.selection)||a.change(E=>{E.setSelection(T)})}}(this.model,this.mapper)),this.downcastDispatcher.on("insert:$text",(a,c,d)=>{if(!d.consumable.consume(c.item,"insert"))return;const m=d.writer,b=d.mapper.toViewPosition(c.range.start),_=m.createText(c.item.data);m.insert(b,_)},{priority:"lowest"}),this.downcastDispatcher.on("remove",(a,c,d)=>{const m=d.mapper.toViewPosition(c.position),b=c.position.getShiftedBy(c.length),_=d.mapper.toViewPosition(b,{isPhantom:!0}),T=d.writer.createRange(m,_),E=d.writer.remove(T.getTrimmed());for(const P of d.writer.createRangeIn(E).getItems())d.mapper.unbindViewElement(P)},{priority:"low"}),this.downcastDispatcher.on("selection",(a,c,d)=>{const m=d.writer,b=m.document.selection;for(const _ of b.getRanges())_.isCollapsed&&_.end.parent.isAttached()&&d.writer.mergeAttributes(_.start);m.setSelection(null)},{priority:"high"}),this.downcastDispatcher.on("selection",(a,c,d)=>{const m=c.selection;if(m.isCollapsed||!d.consumable.consume(m,"selection"))return;const b=[];for(const _ of m.getRanges()){const T=d.mapper.toViewRange(_);b.push(T)}d.writer.setSelection(b,{backward:m.isBackward})},{priority:"low"}),this.downcastDispatcher.on("selection",(a,c,d)=>{const m=c.selection;if(!m.isCollapsed||!d.consumable.consume(m,"selection"))return;const b=d.writer,_=m.getFirstPosition(),T=d.mapper.toViewPosition(_),E=b.breakAttributes(T);b.setSelection(E)},{priority:"low"}),this.view.document.roots.bindTo(this.model.document.roots).using(a=>{if(a.rootName=="$graveyard")return null;const c=new Mu(this.view.document,a.name);return c.rootName=a.rootName,this.mapper.bindElements(a,c),c})}destroy(){this.view.destroy(),this.stopListening()}}Be(hd,Wt);class fm{constructor(){this._commands=new Map}add(e,t){this._commands.set(e,t)}get(e){return this._commands.get(e)}execute(e,...t){const n=this.get(e);if(!n)throw new C.a("commandcollection-command-not-found",this,{commandName:e});return n.execute(...t)}*names(){yield*this._commands.keys()}*commands(){yield*this._commands.values()}[Symbol.iterator](){return this._commands[Symbol.iterator]()}destroy(){for(const e of this.commands())e.destroy()}}class nl{constructor(){this._consumables=new Map}add(e,t){let n;e.is("$text")||e.is("documentFragment")?this._consumables.set(e,!0):(this._consumables.has(e)?n=this._consumables.get(e):(n=new pm(e),this._consumables.set(e,n)),n.add(t))}test(e,t){const n=this._consumables.get(e);return n===void 0?null:e.is("$text")||e.is("documentFragment")?n:n.test(t)}consume(e,t){return!!this.test(e,t)&&(e.is("$text")||e.is("documentFragment")?this._consumables.set(e,!1):this._consumables.get(e).consume(t),!0)}revert(e,t){const n=this._consumables.get(e);n!==void 0&&(e.is("$text")||e.is("documentFragment")?this._consumables.set(e,!0):n.revert(t))}static consumablesFromElement(e){const t={element:e,name:!0,attributes:[],classes:[],styles:[]},n=e.getAttributeKeys();for(const a of n)a!="style"&&a!="class"&&t.attributes.push(a);const o=e.getClassNames();for(const a of o)t.classes.push(a);const r=e.getStyleNames();for(const a of r)t.styles.push(a);return t}static createFrom(e,t){if(t||(t=new nl(e)),e.is("$text"))return t.add(e),t;e.is("element")&&t.add(e,nl.consumablesFromElement(e)),e.is("documentFragment")&&t.add(e);for(const n of e.getChildren())t=nl.createFrom(n,t);return t}}class pm{constructor(e){this.element=e,this._canConsumeName=null,this._consumables={attributes:new Map,styles:new Map,classes:new Map}}add(e){e.name&&(this._canConsumeName=!0);for(const t in this._consumables)t in e&&this._add(t,e[t])}test(e){if(e.name&&!this._canConsumeName)return this._canConsumeName;for(const t in this._consumables)if(t in e){const n=this._test(t,e[t]);if(n!==!0)return n}return!0}consume(e){e.name&&(this._canConsumeName=!1);for(const t in this._consumables)t in e&&this._consume(t,e[t])}revert(e){e.name&&(this._canConsumeName=!0);for(const t in this._consumables)t in e&&this._revert(t,e[t])}_add(e,t){const n=cn(t)?t:[t],o=this._consumables[e];for(const r of n){if(e==="attributes"&&(r==="class"||r==="style"))throw new C.a("viewconsumable-invalid-attribute",this);if(o.set(r,!0),e==="styles")for(const a of this.element.document.stylesProcessor.getRelatedStyles(r))o.set(a,!0)}}_test(e,t){const n=cn(t)?t:[t],o=this._consumables[e];for(const r of n)if(e!=="attributes"||r!=="class"&&r!=="style"){const a=o.get(r);if(a===void 0)return null;if(!a)return!1}else{const a=r=="class"?"classes":"styles",c=this._test(a,[...this._consumables[a].keys()]);if(c!==!0)return c}return!0}_consume(e,t){const n=cn(t)?t:[t],o=this._consumables[e];for(const r of n)if(e!=="attributes"||r!=="class"&&r!=="style"){if(o.set(r,!1),e=="styles")for(const a of this.element.document.stylesProcessor.getRelatedStyles(r))o.set(a,!1)}else{const a=r=="class"?"classes":"styles";this._consume(a,[...this._consumables[a].keys()])}}_revert(e,t){const n=cn(t)?t:[t],o=this._consumables[e];for(const r of n)if(e!=="attributes"||r!=="class"&&r!=="style")o.get(r)===!1&&o.set(r,!0);else{const a=r=="class"?"classes":"styles";this._revert(a,[...this._consumables[a].keys()])}}}class gm{constructor(){this._sourceDefinitions={},this._attributeProperties={},this.decorate("checkChild"),this.decorate("checkAttribute"),this.on("checkAttribute",(e,t)=>{t[0]=new ns(t[0])},{priority:"highest"}),this.on("checkChild",(e,t)=>{t[0]=new ns(t[0]),t[1]=this.getDefinition(t[1])},{priority:"highest"})}register(e,t){if(this._sourceDefinitions[e])throw new C.a("schema-cannot-register-item-twice",this,{itemName:e});this._sourceDefinitions[e]=[Object.assign({},t)],this._clearCache()}extend(e,t){if(!this._sourceDefinitions[e])throw new C.a("schema-cannot-extend-missing-item",this,{itemName:e});this._sourceDefinitions[e].push(Object.assign({},t)),this._clearCache()}getDefinitions(){return this._compiledDefinitions||this._compile(),this._compiledDefinitions}getDefinition(e){let t;return t=typeof e=="string"?e:e.is&&(e.is("$text")||e.is("$textProxy"))?"$text":e.name,this.getDefinitions()[t]}isRegistered(e){return!!this.getDefinition(e)}isBlock(e){const t=this.getDefinition(e);return!(!t||!t.isBlock)}isLimit(e){const t=this.getDefinition(e);return!!t&&!(!t.isLimit&&!t.isObject)}isObject(e){const t=this.getDefinition(e);return!!t&&!!(t.isObject||t.isLimit&&t.isSelectable&&t.isContent)}isInline(e){const t=this.getDefinition(e);return!(!t||!t.isInline)}isSelectable(e){const t=this.getDefinition(e);return!!t&&!(!t.isSelectable&&!t.isObject)}isContent(e){const t=this.getDefinition(e);return!!t&&!(!t.isContent&&!t.isObject)}checkChild(e,t){return!!t&&this._checkContextMatch(t,e)}checkAttribute(e,t){const n=this.getDefinition(e.last);return!!n&&n.allowAttributes.includes(t)}checkMerge(e,t=null){if(e instanceof fe){const n=e.nodeBefore,o=e.nodeAfter;if(!(n instanceof Pt))throw new C.a("schema-check-merge-no-element-before",this);if(!(o instanceof Pt))throw new C.a("schema-check-merge-no-element-after",this);return this.checkMerge(n,o)}for(const n of t.getChildren())if(!this.checkChild(e,n))return!1;return!0}addChildCheck(e){this.on("checkChild",(t,[n,o])=>{if(!o)return;const r=e(n,o);typeof r=="boolean"&&(t.stop(),t.return=r)},{priority:"high"})}addAttributeCheck(e){this.on("checkAttribute",(t,[n,o])=>{const r=e(n,o);typeof r=="boolean"&&(t.stop(),t.return=r)},{priority:"high"})}setAttributeProperties(e,t){this._attributeProperties[e]=Object.assign(this.getAttributeProperties(e),t)}getAttributeProperties(e){return this._attributeProperties[e]||{}}getLimitElement(e){let t;for(e instanceof fe?t=e.parent:t=(e instanceof le?[e]:Array.from(e.getRanges())).reduce((n,o)=>{const r=o.getCommonAncestor();return n?n.getCommonAncestor(r,{includeSelf:!0}):r},null);!this.isLimit(t)&&t.parent;)t=t.parent;return t}checkAttributeInSelection(e,t){if(e.isCollapsed){const n=[...e.getFirstPosition().getAncestors(),new It("",e.getAttributes())];return this.checkAttribute(n,t)}{const n=e.getRanges();for(const o of n)for(const r of o)if(this.checkAttribute(r.item,t))return!0}return!1}*getValidRanges(e,t){e=function*(n){for(const o of n)yield*o.getMinimalFlatRanges()}(e);for(const n of e)yield*this._getValidRangesForRange(n,t)}getNearestSelectionRange(e,t="both"){if(this.checkChild(e,"$text"))return new le(e);let n,o;const r=e.getAncestors().reverse().find(a=>this.isLimit(a))||e.root;t!="both"&&t!="backward"||(n=new Jo({boundaries:le._createIn(r),startPosition:e,direction:"backward"})),t!="both"&&t!="forward"||(o=new Jo({boundaries:le._createIn(r),startPosition:e}));for(const a of function*(c,d){let m=!1;for(;!m;){if(m=!0,c){const b=c.next();b.done||(m=!1,yield{walker:c,value:b.value})}if(d){const b=d.next();b.done||(m=!1,yield{walker:d,value:b.value})}}}(n,o)){const c=a.walker==n?"elementEnd":"elementStart",d=a.value;if(d.type==c&&this.isObject(d.item))return le._createOn(d.item);if(this.checkChild(d.nextPosition,"$text"))return new le(d.nextPosition)}return null}findAllowedParent(e,t){let n=e.parent;for(;n;){if(this.checkChild(n,t))return n;if(this.isLimit(n))return null;n=n.parent}return null}removeDisallowedAttributes(e,t){for(const n of e)if(n.is("$text"))vd(this,n,t);else{const o=le._createIn(n).getPositions();for(const r of o)vd(this,r.nodeBefore||r.parent,t)}}createContext(e){return new ns(e)}_clearCache(){this._compiledDefinitions=null}_compile(){const e={},t=this._sourceDefinitions,n=Object.keys(t);for(const o of n)e[o]=Xi(t[o],o);for(const o of n)md(e,o);for(const o of n)fd(e,o);for(const o of n)pd(e,o);for(const o of n)Ac(e,o),js(e,o);for(const o of n)Ge(e,o),Sc(e,o),gd(e,o);this._compiledDefinitions=e}_checkContextMatch(e,t,n=t.length-1){const o=t.getItem(n);if(e.allowIn.includes(o.name)){if(n==0)return!0;{const r=this.getDefinition(o);return this._checkContextMatch(r,t,n-1)}}return!1}*_getValidRangesForRange(e,t){let n=e.start,o=e.start;for(const r of e.getItems({shallow:!0}))r.is("element")&&(yield*this._getValidRangesForRange(le._createIn(r),t)),this.checkAttribute(r,t)||(n.isEqual(o)||(yield new le(n,o)),n=fe._createAfter(r)),o=fe._createAfter(r);n.isEqual(o)||(yield new le(n,o))}}Be(gm,Wt);class ns{constructor(e){if(e instanceof ns)return e;typeof e=="string"?e=[e]:Array.isArray(e)||(e=e.getAncestors({includeSelf:!0})),this._items=e.map(bd)}get length(){return this._items.length}get last(){return this._items[this._items.length-1]}[Symbol.iterator](){return this._items[Symbol.iterator]()}push(e){const t=new ns([e]);return t._items=[...this._items,...t._items],t}getItem(e){return this._items[e]}*getNames(){yield*this._items.map(e=>e.name)}endsWith(e){return Array.from(this.getNames()).join(" ").endsWith(e)}startsWith(e){return Array.from(this.getNames()).join(" ").startsWith(e)}}function Xi(i,e){const t={name:e,allowIn:[],allowContentOf:[],allowWhere:[],allowAttributes:[],allowAttributesOf:[],allowChildren:[],inheritTypesFrom:[]};return function(n,o){for(const r of n){const a=Object.keys(r).filter(c=>c.startsWith("is"));for(const c of a)o[c]=r[c]}}(i,t),No(i,t,"allowIn"),No(i,t,"allowContentOf"),No(i,t,"allowWhere"),No(i,t,"allowAttributes"),No(i,t,"allowAttributesOf"),No(i,t,"allowChildren"),No(i,t,"inheritTypesFrom"),function(n,o){for(const r of n){const a=r.inheritAllFrom;a&&(o.allowContentOf.push(a),o.allowWhere.push(a),o.allowAttributesOf.push(a),o.inheritTypesFrom.push(a))}}(i,t),t}function md(i,e){const t=i[e];for(const n of t.allowChildren){const o=i[n];o&&o.allowIn.push(e)}t.allowChildren.length=0}function fd(i,e){for(const t of i[e].allowContentOf)i[t]&&fg(i,t).forEach(n=>{n.allowIn.push(e)});delete i[e].allowContentOf}function pd(i,e){for(const t of i[e].allowWhere){const n=i[t];if(n){const o=n.allowIn;i[e].allowIn.push(...o)}}delete i[e].allowWhere}function Ac(i,e){for(const t of i[e].allowAttributesOf){const n=i[t];if(n){const o=n.allowAttributes;i[e].allowAttributes.push(...o)}}delete i[e].allowAttributesOf}function js(i,e){const t=i[e];for(const n of t.inheritTypesFrom){const o=i[n];if(o){const r=Object.keys(o).filter(a=>a.startsWith("is"));for(const a of r)a in t||(t[a]=o[a])}}delete t.inheritTypesFrom}function Ge(i,e){const t=i[e],n=t.allowIn.filter(o=>i[o]);t.allowIn=Array.from(new Set(n))}function Sc(i,e){const t=i[e];for(const n of t.allowIn)i[n].allowChildren.push(e)}function gd(i,e){const t=i[e];t.allowAttributes=Array.from(new Set(t.allowAttributes))}function No(i,e,t){for(const n of i)typeof n[t]=="string"?e[t].push(n[t]):Array.isArray(n[t])&&e[t].push(...n[t])}function fg(i,e){const t=i[e];return(n=i,Object.keys(n).map(o=>n[o])).filter(o=>o.allowIn.includes(t.name));var n}function bd(i){return typeof i=="string"||i.is("documentFragment")?{name:typeof i=="string"?i:"$documentFragment",*getAttributeKeys(){},getAttribute(){}}:{name:i.is("element")?i.name:"$text",*getAttributeKeys(){yield*i.getAttributeKeys()},getAttribute:e=>i.getAttribute(e)}}function vd(i,e,t){for(const n of e.getAttributeKeys())i.checkAttribute(e,n)||t.removeAttribute(n,e)}class On{constructor(e={}){this._splitParts=new Map,this._cursorParents=new Map,this._modelCursor=null,this.conversionApi=Object.assign({},e),this.conversionApi.convertItem=this._convertItem.bind(this),this.conversionApi.convertChildren=this._convertChildren.bind(this),this.conversionApi.safeInsert=this._safeInsert.bind(this),this.conversionApi.updateConversionResult=this._updateConversionResult.bind(this),this.conversionApi.splitToAllowedParent=this._splitToAllowedParent.bind(this),this.conversionApi.getSplitParts=this._getSplitParts.bind(this)}convert(e,t,n=["$root"]){this.fire("viewCleanup",e),this._modelCursor=function(a,c){let d;for(const m of new ns(a)){const b={};for(const T of m.getAttributeKeys())b[T]=m.getAttribute(T);const _=c.createElement(m.name,b);d&&c.append(_,d),d=fe._createAt(_,0)}return d}(n,t),this.conversionApi.writer=t,this.conversionApi.consumable=nl.createFrom(e),this.conversionApi.store={};const{modelRange:o}=this._convertItem(e,this._modelCursor),r=t.createDocumentFragment();if(o){this._removeEmptyElements();for(const a of Array.from(this._modelCursor.parent.getChildren()))t.append(a,r);r.markers=function(a,c){const d=new Set,m=new Map,b=le._createIn(a).getItems();for(const _ of b)_.name=="$marker"&&d.add(_);for(const _ of d){const T=_.getAttribute("data-name"),E=c.createPositionBefore(_);m.has(T)?m.get(T).end=E.clone():m.set(T,new le(E.clone())),c.remove(_)}return m}(r,t)}return this._modelCursor=null,this._splitParts.clear(),this._cursorParents.clear(),this.conversionApi.writer=null,this.conversionApi.store=null,r}_convertItem(e,t){const n=Object.assign({viewItem:e,modelCursor:t,modelRange:null});if(e.is("element")?this.fire("element:"+e.name,n,this.conversionApi):e.is("$text")?this.fire("text",n,this.conversionApi):this.fire("documentFragment",n,this.conversionApi),n.modelRange&&!(n.modelRange instanceof le))throw new C.a("view-conversion-dispatcher-incorrect-result",this);return{modelRange:n.modelRange,modelCursor:n.modelCursor}}_convertChildren(e,t){let n=t.is("position")?t:fe._createAt(t,0);const o=new le(n);for(const r of Array.from(e.getChildren())){const a=this._convertItem(r,n);a.modelRange instanceof le&&(o.end=a.modelRange.end,n=a.modelCursor)}return{modelRange:o,modelCursor:n}}_safeInsert(e,t){const n=this._splitToAllowedParent(e,t);return!!n&&(this.conversionApi.writer.insert(e,n.position),!0)}_updateConversionResult(e,t){const n=this._getSplitParts(e),o=this.conversionApi.writer;t.modelRange||(t.modelRange=o.createRange(o.createPositionBefore(e),o.createPositionAfter(n[n.length-1])));const r=this._cursorParents.get(e);t.modelCursor=r?o.createPositionAt(r,0):t.modelRange.end}_splitToAllowedParent(e,t){const{schema:n,writer:o}=this.conversionApi;let r=n.findAllowedParent(t,e);if(r){if(r===t.parent)return{position:t};this._modelCursor.parent.getAncestors().includes(r)&&(r=null)}if(!r)return Za(t,e,n)?{position:dm(t,o)}:null;const a=this.conversionApi.writer.split(t,r),c=[];for(const m of a.range.getWalker())if(m.type=="elementEnd")c.push(m.item);else{const b=c.pop(),_=m.item;this._registerSplitPair(b,_)}const d=a.range.end.parent;return this._cursorParents.set(e,d),{position:a.position,cursorParent:d}}_registerSplitPair(e,t){this._splitParts.has(e)||this._splitParts.set(e,[e]);const n=this._splitParts.get(e);this._splitParts.set(t,n),n.push(t)}_getSplitParts(e){let t;return t=this._splitParts.has(e)?this._splitParts.get(e):[e],t}_removeEmptyElements(){let e=!1;for(const t of this._splitParts.keys())t.isEmpty&&(this.conversionApi.writer.remove(t),this._splitParts.delete(t),e=!0);e&&this._removeEmptyElements()}}Be(On,F);class pg{getHtml(e){const t=document.implementation.createHTMLDocument("").createElement("div");return t.appendChild(e),t.innerHTML}}class gg{constructor(e){this._domParser=new DOMParser,this._domConverter=new ki(e,{blockFillerMode:"nbsp"}),this._htmlWriter=new pg}toData(e){const t=this._domConverter.viewToDom(e,document);return this._htmlWriter.getHtml(t)}toView(e){const t=this._toDom(e);return this._domConverter.domToView(t)}registerRawContentMatcher(e){this._domConverter.registerRawContentMatcher(e)}useFillerType(e){this._domConverter.blockFillerMode=e=="marked"?"markedNbsp":"nbsp"}_toDom(e){const t=this._domParser.parseFromString(e,"text/html"),n=t.createDocumentFragment();let o=t.firstChild;for(;!o.isSameNode(t.documentElement);){const a=o;o=o.nextSibling,a.nodeType==Node.COMMENT_NODE&&n.appendChild(a)}const r=t.body.childNodes;for(;r.length>0;)n.appendChild(r[0]);return n}}class wd{constructor(e,t){this.model=e,this.mapper=new Qa,this.downcastDispatcher=new id({mapper:this.mapper,schema:e.schema}),this.downcastDispatcher.on("insert:$text",(n,o,r)=>{if(!r.consumable.consume(o.item,"insert"))return;const a=r.writer,c=r.mapper.toViewPosition(o.range.start),d=a.createText(o.item.data);a.insert(c,d)},{priority:"lowest"}),this.upcastDispatcher=new On({schema:e.schema}),this.viewDocument=new $i(t),this.stylesProcessor=t,this.htmlProcessor=new gg(this.viewDocument),this.processor=this.htmlProcessor,this._viewWriter=new Rh(this.viewDocument),this.upcastDispatcher.on("text",(n,o,{schema:r,consumable:a,writer:c})=>{let d=o.modelCursor;if(!a.test(o.viewItem))return;if(!r.checkChild(d,"$text")){if(!Za(d,"$text",r))return;d=dm(d,c)}a.consume(o.viewItem);const m=c.createText(o.viewItem.data);c.insert(m,d),o.modelRange=c.createRange(d,d.getShiftedBy(m.offsetSize)),o.modelCursor=o.modelRange.end},{priority:"lowest"}),this.upcastDispatcher.on("element",(n,o,r)=>{if(!o.modelRange&&r.consumable.consume(o.viewItem,{name:!0})){const{modelRange:a,modelCursor:c}=r.convertChildren(o.viewItem,o.modelCursor);o.modelRange=a,o.modelCursor=c}},{priority:"lowest"}),this.upcastDispatcher.on("documentFragment",(n,o,r)=>{if(!o.modelRange&&r.consumable.consume(o.viewItem,{name:!0})){const{modelRange:a,modelCursor:c}=r.convertChildren(o.viewItem,o.modelCursor);o.modelRange=a,o.modelCursor=c}},{priority:"lowest"}),this.decorate("init"),this.decorate("set"),this.on("init",()=>{this.fire("ready")},{priority:"lowest"}),this.on("ready",()=>{this.model.enqueueChange("transparent",Cc)},{priority:"lowest"})}get(e={}){const{rootName:t="main",trim:n="empty"}=e;if(!this._checkIfRootsExists([t]))throw new C.a("datacontroller-get-non-existent-root",this);const o=this.model.document.getRoot(t);return n!=="empty"||this.model.hasContent(o,{ignoreWhitespaces:!0})?this.stringify(o,e):""}stringify(e,t={}){const n=this.toView(e,t);return this.processor.toData(n)}toView(e,t={}){const n=this.viewDocument,o=this._viewWriter;this.mapper.clearBindings();const r=le._createIn(e),a=new Xr(n);this.mapper.bindElements(e,a),this.downcastDispatcher.conversionApi.options=t,this.downcastDispatcher.convertInsert(r,o);const c=e.is("documentFragment")?Array.from(e.markers):function(d){const m=[],b=d.root.document;if(!b)return[];const _=le._createIn(d);for(const T of b.model.markers){const E=T.getRange(),P=E.isCollapsed,R=E.start.isEqual(_.start)||E.end.isEqual(_.end);if(P&&R)m.push([T.name,E]);else{const z=_.getIntersection(E);z&&m.push([T.name,z])}}return m}(e);for(const[d,m]of c)this.downcastDispatcher.convertMarkerAdd(d,m,o);return delete this.downcastDispatcher.conversionApi.options,a}init(e){if(this.model.document.version)throw new C.a("datacontroller-init-document-not-empty",this);let t={};if(typeof e=="string"?t.main=e:t=e,!this._checkIfRootsExists(Object.keys(t)))throw new C.a("datacontroller-init-non-existent-root",this);return this.model.enqueueChange("transparent",n=>{for(const o of Object.keys(t)){const r=this.model.document.getRoot(o);n.insert(this.parse(t[o],r),r,0)}}),Promise.resolve()}set(e,t={}){let n={};if(typeof e=="string"?n.main=e:n=e,!this._checkIfRootsExists(Object.keys(n)))throw new C.a("datacontroller-set-non-existent-root",this);const o=t.batchType||"default";this.model.enqueueChange(o,r=>{r.setSelection(null),r.removeSelectionAttribute(this.model.document.selection.getAttributeKeys());for(const a of Object.keys(n)){const c=this.model.document.getRoot(a);r.remove(r.createRangeIn(c)),r.insert(this.parse(n[a],c),c,0)}})}parse(e,t="$root"){const n=this.processor.toView(e);return this.toModel(n,t)}toModel(e,t="$root"){return this.model.change(n=>this.upcastDispatcher.convert(e,n,t))}addStyleProcessorRules(e){e(this.stylesProcessor)}registerRawContentMatcher(e){this.processor&&this.processor!==this.htmlProcessor&&this.processor.registerRawContentMatcher(e),this.htmlProcessor.registerRawContentMatcher(e)}destroy(){this.stopListening()}_checkIfRootsExists(e){for(const t of e)if(!this.model.document.getRootNames().includes(t))return!1;return!0}}Be(wd,Wt);class bg{constructor(e,t){this._helpers=new Map,this._downcast=Tt(e),this._createConversionHelpers({name:"downcast",dispatchers:this._downcast,isDowncast:!0}),this._upcast=Tt(t),this._createConversionHelpers({name:"upcast",dispatchers:this._upcast,isDowncast:!1})}addAlias(e,t){const n=this._downcast.includes(t);if(!this._upcast.includes(t)&&!n)throw new C.a("conversion-add-alias-dispatcher-not-registered",this);this._createConversionHelpers({name:e,dispatchers:[t],isDowncast:n})}for(e){if(!this._helpers.has(e))throw new C.a("conversion-for-unknown-group",this);return this._helpers.get(e)}elementToElement(e){this.for("downcast").elementToElement(e);for(const{model:t,view:n}of Dc(e))this.for("upcast").elementToElement({model:t,view:n,converterPriority:e.converterPriority})}attributeToElement(e){this.for("downcast").attributeToElement(e);for(const{model:t,view:n}of Dc(e))this.for("upcast").elementToAttribute({view:n,model:t,converterPriority:e.converterPriority})}attributeToAttribute(e){this.for("downcast").attributeToAttribute(e);for(const{model:t,view:n}of Dc(e))this.for("upcast").attributeToAttribute({view:n,model:t})}_createConversionHelpers({name:e,dispatchers:t,isDowncast:n}){if(this._helpers.has(e))throw new C.a("conversion-group-exists",this);const o=n?new Ya(t):new hm(t);this._helpers.set(e,o)}}function*Dc(i){if(i.model.values)for(const e of i.model.values){const t={key:i.model.key,value:e},n=i.view[e],o=i.upcastAlso?i.upcastAlso[e]:void 0;yield*bm(t,n,o)}else yield*bm(i.model,i.view,i.upcastAlso)}function*bm(i,e,t){if(yield{model:i,view:e},t)for(const n of Tt(t))yield{model:i,view:n}}class jc{constructor(e="default"){this.operations=[],this.type=e}get baseVersion(){for(const e of this.operations)if(e.baseVersion!==null)return e.baseVersion;return null}addOperation(e){return e.batch=this,this.operations.push(e),e}}class Bo{constructor(e){this.baseVersion=e,this.isDocumentOperation=this.baseVersion!==null,this.batch=null}_validate(){}toJSON(){const e=Object.assign({},this);return e.__className=this.constructor.className,delete e.batch,delete e.isDocumentOperation,e}static get className(){return"Operation"}static fromJSON(e){return new this(e.baseVersion)}}class Rn{constructor(e){this.markers=new Map,this._children=new yr,e&&this._insertChild(0,e)}[Symbol.iterator](){return this.getChildren()}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return this.childCount===0}get root(){return this}get parent(){return null}is(e){return e==="documentFragment"||e==="model:documentFragment"}getChild(e){return this._children.getNode(e)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(e){return this._children.getNodeIndex(e)}getChildStartOffset(e){return this._children.getNodeStartOffset(e)}getPath(){return[]}getNodeByPath(e){let t=this;for(const n of e)t=t.getChild(t.offsetToIndex(n));return t}offsetToIndex(e){return this._children.offsetToIndex(e)}toJSON(){const e=[];for(const t of this._children)e.push(t.toJSON());return e}static fromJSON(e){const t=[];for(const n of e)n.name?t.push(Pt.fromJSON(n)):t.push(It.fromJSON(n));return new Rn(t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const n=function(o){return typeof o=="string"?[new It(o)]:(Yn(o)||(o=[o]),Array.from(o).map(r=>typeof r=="string"?new It(r):r instanceof Xo?new It(r.data,r.getAttributes()):r))}(t);for(const o of n)o.parent!==null&&o._remove(),o.parent=this;this._children._insertNodes(e,n)}_removeChildren(e,t=1){const n=this._children._removeNodes(e,t);for(const o of n)o.parent=null;return n}}function Vn(i,e){const t=(e=Pc(e)).reduce((r,a)=>r+a.offsetSize,0),n=i.parent;rl(i);const o=i.index;return n._insertChild(o,e),il(n,o+e.length),il(n,o),new le(i,i.getShiftedBy(t))}function Ic(i){if(!i.isFlat)throw new C.a("operation-utils-remove-range-not-flat",this);const e=i.start.parent;rl(i.start),rl(i.end);const t=e._removeChildren(i.start.index,i.end.index-i.start.index);return il(e,i.start.index),t}function ol(i,e){if(!i.isFlat)throw new C.a("operation-utils-move-range-not-flat",this);const t=Ic(i);return Vn(e=e._getTransformedByDeletion(i.start,i.end.offset-i.start.offset),t)}function Pc(i){const e=[];i instanceof Array||(i=[i]);for(let t=0;t<i.length;t++)if(typeof i[t]=="string")e.push(new It(i[t]));else if(i[t]instanceof Xo)e.push(new It(i[t].data,i[t].getAttributes()));else if(i[t]instanceof Rn||i[t]instanceof yr)for(const n of i[t])e.push(n);else i[t]instanceof _r&&e.push(i[t]);for(let t=1;t<e.length;t++){const n=e[t],o=e[t-1];n instanceof It&&o instanceof It&&Is(n,o)&&(e.splice(t-1,2,new It(o.data+n.data,o.getAttributes())),t--)}return e}function il(i,e){const t=i.getChild(e-1),n=i.getChild(e);if(t&&n&&t.is("$text")&&n.is("$text")&&Is(t,n)){const o=new It(t.data+n.data,t.getAttributes());i._removeChildren(e-1,2),i._insertChild(e-1,o)}}function rl(i){const e=i.textNode,t=i.parent;if(e){const n=i.offset-e.startOffset,o=e.index;t._removeChildren(o,1);const r=new It(e.data.substr(0,n),e.getAttributes()),a=new It(e.data.substr(n),e.getAttributes());t._insertChild(o,[r,a])}}function Is(i,e){const t=i.getAttributes(),n=e.getAttributes();for(const o of t){if(o[1]!==e.getAttribute(o[0]))return!1;n.next()}return n.next().done}var kd=function(i,e){return Xh(i,e)};class un extends Bo{constructor(e,t,n,o,r){super(r),this.range=e.clone(),this.key=t,this.oldValue=n===void 0?null:n,this.newValue=o===void 0?null:o}get type(){return this.oldValue===null?"addAttribute":this.newValue===null?"removeAttribute":"changeAttribute"}clone(){return new un(this.range,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new un(this.range,this.key,this.newValue,this.oldValue,this.baseVersion+1)}toJSON(){const e=super.toJSON();return e.range=this.range.toJSON(),e}_validate(){if(!this.range.isFlat)throw new C.a("attribute-operation-range-not-flat",this);for(const e of this.range.getItems({shallow:!0})){if(this.oldValue!==null&&!kd(e.getAttribute(this.key),this.oldValue))throw new C.a("attribute-operation-wrong-old-value",this,{item:e,key:this.key,value:this.oldValue});if(this.oldValue===null&&this.newValue!==null&&e.hasAttribute(this.key))throw new C.a("attribute-operation-attribute-exists",this,{node:e,key:this.key})}}_execute(){kd(this.oldValue,this.newValue)||function(e,t,n){rl(e.start),rl(e.end);for(const o of e.getItems({shallow:!0})){const r=o.is("$textProxy")?o.textNode:o;n!==null?r._setAttribute(t,n):r._removeAttribute(t),il(r.parent,r.index)}il(e.end.parent,e.end.index)}(this.range,this.key,this.newValue)}static get className(){return"AttributeOperation"}static fromJSON(e,t){return new un(le.fromJSON(e.range,t),e.key,e.oldValue,e.newValue,e.baseVersion)}}class vg extends Bo{constructor(e,t){super(null),this.sourcePosition=e.clone(),this.howMany=t}get type(){return"detach"}toJSON(){const e=super.toJSON();return e.sourcePosition=this.sourcePosition.toJSON(),e}_validate(){if(this.sourcePosition.root.document)throw new C.a("detach-operation-on-document-node",this)}_execute(){Ic(le._createFromPositionAndShift(this.sourcePosition,this.howMany))}static get className(){return"DetachOperation"}}class Vt extends Bo{constructor(e,t,n,o){super(o),this.sourcePosition=e.clone(),this.sourcePosition.stickiness="toNext",this.howMany=t,this.targetPosition=n.clone(),this.targetPosition.stickiness="toNone"}get type(){return this.targetPosition.root.rootName=="$graveyard"?"remove":this.sourcePosition.root.rootName=="$graveyard"?"reinsert":"move"}clone(){return new this.constructor(this.sourcePosition,this.howMany,this.targetPosition,this.baseVersion)}getMovedRangeStart(){return this.targetPosition._getTransformedByDeletion(this.sourcePosition,this.howMany)}getReversed(){const e=this.sourcePosition._getTransformedByInsertion(this.targetPosition,this.howMany);return new this.constructor(this.getMovedRangeStart(),this.howMany,e,this.baseVersion+1)}_validate(){const e=this.sourcePosition.parent,t=this.targetPosition.parent,n=this.sourcePosition.offset,o=this.targetPosition.offset;if(n+this.howMany>e.maxOffset)throw new C.a("move-operation-nodes-do-not-exist",this);if(e===t&&n<o&&o<n+this.howMany)throw new C.a("move-operation-range-into-itself",this);if(this.sourcePosition.root==this.targetPosition.root&&B(this.sourcePosition.getParentPath(),this.targetPosition.getParentPath())=="prefix"){const r=this.sourcePosition.path.length-1;if(this.targetPosition.path[r]>=n&&this.targetPosition.path[r]<n+this.howMany)throw new C.a("move-operation-node-into-itself",this)}}_execute(){ol(le._createFromPositionAndShift(this.sourcePosition,this.howMany),this.targetPosition)}toJSON(){const e=super.toJSON();return e.sourcePosition=this.sourcePosition.toJSON(),e.targetPosition=this.targetPosition.toJSON(),e}static get className(){return"MoveOperation"}static fromJSON(e,t){const n=fe.fromJSON(e.sourcePosition,t),o=fe.fromJSON(e.targetPosition,t);return new this(n,e.howMany,o,e.baseVersion)}}class Sn extends Bo{constructor(e,t,n){super(n),this.position=e.clone(),this.position.stickiness="toNone",this.nodes=new yr(Pc(t)),this.shouldReceiveAttributes=!1}get type(){return"insert"}get howMany(){return this.nodes.maxOffset}clone(){const e=new yr([...this.nodes].map(n=>n._clone(!0))),t=new Sn(this.position,e,this.baseVersion);return t.shouldReceiveAttributes=this.shouldReceiveAttributes,t}getReversed(){const e=this.position.root.document.graveyard,t=new fe(e,[0]);return new Vt(this.position,this.nodes.maxOffset,t,this.baseVersion+1)}_validate(){const e=this.position.parent;if(!e||e.maxOffset<this.position.offset)throw new C.a("insert-operation-position-invalid",this)}_execute(){const e=this.nodes;this.nodes=new yr([...e].map(t=>t._clone(!0))),Vn(this.position,e)}toJSON(){const e=super.toJSON();return e.position=this.position.toJSON(),e.nodes=this.nodes.toJSON(),e}static get className(){return"InsertOperation"}static fromJSON(e,t){const n=[];for(const r of e.nodes)r.name?n.push(Pt.fromJSON(r)):n.push(It.fromJSON(r));const o=new Sn(fe.fromJSON(e.position,t),n,e.baseVersion);return o.shouldReceiveAttributes=e.shouldReceiveAttributes,o}}class co extends Bo{constructor(e,t,n,o,r,a){super(a),this.name=e,this.oldRange=t?t.clone():null,this.newRange=n?n.clone():null,this.affectsData=r,this._markers=o}get type(){return"marker"}clone(){return new co(this.name,this.oldRange,this.newRange,this._markers,this.affectsData,this.baseVersion)}getReversed(){return new co(this.name,this.newRange,this.oldRange,this._markers,this.affectsData,this.baseVersion+1)}_execute(){const e=this.newRange?"_set":"_remove";this._markers[e](this.name,this.newRange,!0,this.affectsData)}toJSON(){const e=super.toJSON();return this.oldRange&&(e.oldRange=this.oldRange.toJSON()),this.newRange&&(e.newRange=this.newRange.toJSON()),delete e._markers,e}static get className(){return"MarkerOperation"}static fromJSON(e,t){return new co(e.name,e.oldRange?le.fromJSON(e.oldRange,t):null,e.newRange?le.fromJSON(e.newRange,t):null,t.model.markers,e.affectsData,e.baseVersion)}}class eo extends Bo{constructor(e,t,n,o){super(o),this.position=e,this.position.stickiness="toNext",this.oldName=t,this.newName=n}get type(){return"rename"}clone(){return new eo(this.position.clone(),this.oldName,this.newName,this.baseVersion)}getReversed(){return new eo(this.position.clone(),this.newName,this.oldName,this.baseVersion+1)}_validate(){const e=this.position.nodeAfter;if(!(e instanceof Pt))throw new C.a("rename-operation-wrong-position",this);if(e.name!==this.oldName)throw new C.a("rename-operation-wrong-name",this)}_execute(){this.position.nodeAfter.name=this.newName}toJSON(){const e=super.toJSON();return e.position=this.position.toJSON(),e}static get className(){return"RenameOperation"}static fromJSON(e,t){return new eo(fe.fromJSON(e.position,t),e.oldName,e.newName,e.baseVersion)}}class Ei extends Bo{constructor(e,t,n,o,r){super(r),this.root=e,this.key=t,this.oldValue=n,this.newValue=o}get type(){return this.oldValue===null?"addRootAttribute":this.newValue===null?"removeRootAttribute":"changeRootAttribute"}clone(){return new Ei(this.root,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new Ei(this.root,this.key,this.newValue,this.oldValue,this.baseVersion+1)}_validate(){if(this.root!=this.root.root||this.root.is("documentFragment"))throw new C.a("rootattribute-operation-not-a-root",this,{root:this.root,key:this.key});if(this.oldValue!==null&&this.root.getAttribute(this.key)!==this.oldValue)throw new C.a("rootattribute-operation-wrong-old-value",this,{root:this.root,key:this.key});if(this.oldValue===null&&this.newValue!==null&&this.root.hasAttribute(this.key))throw new C.a("rootattribute-operation-attribute-exists",this,{root:this.root,key:this.key})}_execute(){this.newValue!==null?this.root._setAttribute(this.key,this.newValue):this.root._removeAttribute(this.key)}toJSON(){const e=super.toJSON();return e.root=this.root.toJSON(),e}static get className(){return"RootAttributeOperation"}static fromJSON(e,t){if(!t.getRoot(e.root))throw new C.a("rootattribute-operation-fromjson-no-root",this,{rootName:e.root});return new Ei(t.getRoot(e.root),e.key,e.oldValue,e.newValue,e.baseVersion)}}class wn extends Bo{constructor(e,t,n,o,r){super(r),this.sourcePosition=e.clone(),this.sourcePosition.stickiness="toPrevious",this.howMany=t,this.targetPosition=n.clone(),this.targetPosition.stickiness="toNext",this.graveyardPosition=o.clone()}get type(){return"merge"}get deletionPosition(){return new fe(this.sourcePosition.root,this.sourcePosition.path.slice(0,-1))}get movedRange(){const e=this.sourcePosition.getShiftedBy(Number.POSITIVE_INFINITY);return new le(this.sourcePosition,e)}clone(){return new this.constructor(this.sourcePosition,this.howMany,this.targetPosition,this.graveyardPosition,this.baseVersion)}getReversed(){const e=this.targetPosition._getTransformedByMergeOperation(this),t=this.sourcePosition.path.slice(0,-1),n=new fe(this.sourcePosition.root,t)._getTransformedByMergeOperation(this);return new Ht(e,this.howMany,n,this.graveyardPosition,this.baseVersion+1)}_validate(){const e=this.sourcePosition.parent,t=this.targetPosition.parent;if(!e.parent)throw new C.a("merge-operation-source-position-invalid",this);if(!t.parent)throw new C.a("merge-operation-target-position-invalid",this);if(this.howMany!=e.maxOffset)throw new C.a("merge-operation-how-many-invalid",this)}_execute(){const e=this.sourcePosition.parent;ol(le._createIn(e),this.targetPosition),ol(le._createOn(e),this.graveyardPosition)}toJSON(){const e=super.toJSON();return e.sourcePosition=e.sourcePosition.toJSON(),e.targetPosition=e.targetPosition.toJSON(),e.graveyardPosition=e.graveyardPosition.toJSON(),e}static get className(){return"MergeOperation"}static fromJSON(e,t){const n=fe.fromJSON(e.sourcePosition,t),o=fe.fromJSON(e.targetPosition,t),r=fe.fromJSON(e.graveyardPosition,t);return new this(n,e.howMany,o,r,e.baseVersion)}}class Ht extends Bo{constructor(e,t,n,o,r){super(r),this.splitPosition=e.clone(),this.splitPosition.stickiness="toNext",this.howMany=t,this.insertionPosition=n,this.graveyardPosition=o?o.clone():null,this.graveyardPosition&&(this.graveyardPosition.stickiness="toNext")}get type(){return"split"}get moveTargetPosition(){const e=this.insertionPosition.path.slice();return e.push(0),new fe(this.insertionPosition.root,e)}get movedRange(){const e=this.splitPosition.getShiftedBy(Number.POSITIVE_INFINITY);return new le(this.splitPosition,e)}clone(){return new this.constructor(this.splitPosition,this.howMany,this.insertionPosition,this.graveyardPosition,this.baseVersion)}getReversed(){const e=this.splitPosition.root.document.graveyard,t=new fe(e,[0]);return new wn(this.moveTargetPosition,this.howMany,this.splitPosition,t,this.baseVersion+1)}_validate(){const e=this.splitPosition.parent,t=this.splitPosition.offset;if(!e||e.maxOffset<t)throw new C.a("split-operation-position-invalid",this);if(!e.parent)throw new C.a("split-operation-split-in-root",this);if(this.howMany!=e.maxOffset-this.splitPosition.offset)throw new C.a("split-operation-how-many-invalid",this);if(this.graveyardPosition&&!this.graveyardPosition.nodeAfter)throw new C.a("split-operation-graveyard-position-invalid",this)}_execute(){const e=this.splitPosition.parent;if(this.graveyardPosition)ol(le._createFromPositionAndShift(this.graveyardPosition,1),this.insertionPosition);else{const t=e._clone();Vn(this.insertionPosition,t)}ol(new le(fe._createAt(e,this.splitPosition.offset),fe._createAt(e,e.maxOffset)),this.moveTargetPosition)}toJSON(){const e=super.toJSON();return e.splitPosition=this.splitPosition.toJSON(),e.insertionPosition=this.insertionPosition.toJSON(),this.graveyardPosition&&(e.graveyardPosition=this.graveyardPosition.toJSON()),e}static get className(){return"SplitOperation"}static getInsertionPosition(e){const t=e.path.slice(0,-1);return t[t.length-1]++,new fe(e.root,t,"toPrevious")}static fromJSON(e,t){const n=fe.fromJSON(e.splitPosition,t),o=fe.fromJSON(e.insertionPosition,t),r=e.graveyardPosition?fe.fromJSON(e.graveyardPosition,t):null;return new this(n,e.howMany,o,r,e.baseVersion)}}class Mc extends Pt{constructor(e,t,n="main"){super(t),this._document=e,this.rootName=n}get document(){return this._document}is(e,t){return t?t===this.name&&(e==="rootElement"||e==="model:rootElement"||e==="element"||e==="model:element"):e==="rootElement"||e==="model:rootElement"||e==="element"||e==="model:element"||e==="node"||e==="model:node"}toJSON(){return this.rootName}}class sl{constructor(e,t){this.model=e,this.batch=t}createText(e,t){return new It(e,t)}createElement(e,t){return new Pt(e,t)}createDocumentFragment(){return new Rn}cloneElement(e,t=!0){return e._clone(t)}insert(e,t,n=0){if(this._assertWriterUsedCorrectly(),e instanceof It&&e.data=="")return;const o=fe._createAt(t,n);if(e.parent){if(yd(e.root,o.root))return void this.move(le._createOn(e),o);if(e.root.document)throw new C.a("model-writer-insert-forbidden-move",this);this.remove(e)}const r=o.root.document?o.root.document.version:null,a=new Sn(o,e,r);if(e instanceof It&&(a.shouldReceiveAttributes=!0),this.batch.addOperation(a),this.model.applyOperation(a),e instanceof Rn)for(const[c,d]of e.markers){const m=fe._createAt(d.root,0),b={range:new le(d.start._getCombined(m,o),d.end._getCombined(m,o)),usingOperation:!0,affectsData:!0};this.model.markers.has(c)?this.updateMarker(c,b):this.addMarker(c,b)}}insertText(e,t,n,o){t instanceof Rn||t instanceof Pt||t instanceof fe?this.insert(this.createText(e),t,n):this.insert(this.createText(e,t),n,o)}insertElement(e,t,n,o){t instanceof Rn||t instanceof Pt||t instanceof fe?this.insert(this.createElement(e),t,n):this.insert(this.createElement(e,t),n,o)}append(e,t){this.insert(e,t,"end")}appendText(e,t,n){t instanceof Rn||t instanceof Pt?this.insert(this.createText(e),t,"end"):this.insert(this.createText(e,t),n,"end")}appendElement(e,t,n){t instanceof Rn||t instanceof Pt?this.insert(this.createElement(e),t,"end"):this.insert(this.createElement(e,t),n,"end")}setAttribute(e,t,n){if(this._assertWriterUsedCorrectly(),n instanceof le){const o=n.getMinimalFlatRanges();for(const r of o)Oc(this,e,t,r)}else _d(this,e,t,n)}setAttributes(e,t){for(const[n,o]of Ke(e))this.setAttribute(n,o,t)}removeAttribute(e,t){if(this._assertWriterUsedCorrectly(),t instanceof le){const n=t.getMinimalFlatRanges();for(const o of n)Oc(this,e,null,o)}else _d(this,e,null,t)}clearAttributes(e){this._assertWriterUsedCorrectly();const t=n=>{for(const o of n.getAttributeKeys())this.removeAttribute(o,n)};if(e instanceof le)for(const n of e.getItems())t(n);else t(e)}move(e,t,n){if(this._assertWriterUsedCorrectly(),!(e instanceof le))throw new C.a("writer-move-invalid-range",this);if(!e.isFlat)throw new C.a("writer-move-range-not-flat",this);const o=fe._createAt(t,n);if(o.isEqual(e.start))return;if(this._addOperationForAffectedMarkers("move",e),!yd(e.root,o.root))throw new C.a("writer-move-different-document",this);const r=e.root.document?e.root.document.version:null,a=new Vt(e.start,e.end.offset-e.start.offset,o,r);this.batch.addOperation(a),this.model.applyOperation(a)}remove(e){this._assertWriterUsedCorrectly();const t=(e instanceof le?e:le._createOn(e)).getMinimalFlatRanges().reverse();for(const n of t)this._addOperationForAffectedMarkers("move",n),Rc(n.start,n.end.offset-n.start.offset,this.batch,this.model)}merge(e){this._assertWriterUsedCorrectly();const t=e.nodeBefore,n=e.nodeAfter;if(this._addOperationForAffectedMarkers("merge",e),!(t instanceof Pt))throw new C.a("writer-merge-no-element-before",this);if(!(n instanceof Pt))throw new C.a("writer-merge-no-element-after",this);e.root.document?this._merge(e):this._mergeDetached(e)}createPositionFromPath(e,t,n){return this.model.createPositionFromPath(e,t,n)}createPositionAt(e,t){return this.model.createPositionAt(e,t)}createPositionAfter(e){return this.model.createPositionAfter(e)}createPositionBefore(e){return this.model.createPositionBefore(e)}createRange(e,t){return this.model.createRange(e,t)}createRangeIn(e){return this.model.createRangeIn(e)}createRangeOn(e){return this.model.createRangeOn(e)}createSelection(e,t,n){return this.model.createSelection(e,t,n)}_mergeDetached(e){const t=e.nodeBefore,n=e.nodeAfter;this.move(le._createIn(n),fe._createAt(t,"end")),this.remove(n)}_merge(e){const t=fe._createAt(e.nodeBefore,"end"),n=fe._createAt(e.nodeAfter,0),o=e.root.document.graveyard,r=new fe(o,[0]),a=e.root.document.version,c=new wn(n,e.nodeAfter.maxOffset,t,r,a);this.batch.addOperation(c),this.model.applyOperation(c)}rename(e,t){if(this._assertWriterUsedCorrectly(),!(e instanceof Pt))throw new C.a("writer-rename-not-element-instance",this);const n=e.root.document?e.root.document.version:null,o=new eo(fe._createBefore(e),e.name,t,n);this.batch.addOperation(o),this.model.applyOperation(o)}split(e,t){this._assertWriterUsedCorrectly();let n,o,r=e.parent;if(!r.parent)throw new C.a("writer-split-element-no-parent",this);if(t||(t=r.parent),!e.parent.getAncestors({includeSelf:!0}).includes(t))throw new C.a("writer-split-invalid-limit-element",this);do{const a=r.root.document?r.root.document.version:null,c=r.maxOffset-e.offset,d=Ht.getInsertionPosition(e),m=new Ht(e,c,d,null,a);this.batch.addOperation(m),this.model.applyOperation(m),n||o||(n=r,o=e.parent.nextSibling),r=(e=this.createPositionAfter(e.parent)).parent}while(r!==t);return{position:e,range:new le(fe._createAt(n,"end"),fe._createAt(o,0))}}wrap(e,t){if(this._assertWriterUsedCorrectly(),!e.isFlat)throw new C.a("writer-wrap-range-not-flat",this);const n=t instanceof Pt?t:new Pt(t);if(n.childCount>0)throw new C.a("writer-wrap-element-not-empty",this);if(n.parent!==null)throw new C.a("writer-wrap-element-attached",this);this.insert(n,e.start);const o=new le(e.start.getShiftedBy(1),e.end.getShiftedBy(1));this.move(o,fe._createAt(n,0))}unwrap(e){if(this._assertWriterUsedCorrectly(),e.parent===null)throw new C.a("writer-unwrap-element-no-parent",this);this.move(le._createIn(e),this.createPositionAfter(e)),this.remove(e)}addMarker(e,t){if(this._assertWriterUsedCorrectly(),!t||typeof t.usingOperation!="boolean")throw new C.a("writer-addmarker-no-usingoperation",this);const n=t.usingOperation,o=t.range,r=t.affectsData!==void 0&&t.affectsData;if(this.model.markers.has(e))throw new C.a("writer-addmarker-marker-exists",this);if(!o)throw new C.a("writer-addmarker-no-range",this);return n?(Ps(this,e,null,o,r),this.model.markers.get(e)):this.model.markers._set(e,o,n,r)}updateMarker(e,t){this._assertWriterUsedCorrectly();const n=typeof e=="string"?e:e.name,o=this.model.markers.get(n);if(!o)throw new C.a("writer-updatemarker-marker-not-exists",this);if(!t)return void this.model.markers._refresh(o);const r=typeof t.usingOperation=="boolean",a=typeof t.affectsData=="boolean",c=a?t.affectsData:o.affectsData;if(!r&&!t.range&&!a)throw new C.a("writer-updatemarker-wrong-options",this);const d=o.getRange(),m=t.range?t.range:d;r&&t.usingOperation!==o.managedUsingOperations?t.usingOperation?Ps(this,n,null,m,c):(Ps(this,n,d,null,c),this.model.markers._set(n,m,void 0,c)):o.managedUsingOperations?Ps(this,n,d,m,c):this.model.markers._set(n,m,void 0,c)}removeMarker(e){this._assertWriterUsedCorrectly();const t=typeof e=="string"?e:e.name;if(!this.model.markers.has(t))throw new C.a("writer-removemarker-no-marker",this);const n=this.model.markers.get(t);if(!n.managedUsingOperations)return void this.model.markers._remove(t);Ps(this,t,n.getRange(),null,n.affectsData)}setSelection(e,t,n){this._assertWriterUsedCorrectly(),this.model.document.selection._setTo(e,t,n)}setSelectionFocus(e,t){this._assertWriterUsedCorrectly(),this.model.document.selection._setFocus(e,t)}setSelectionAttribute(e,t){if(this._assertWriterUsedCorrectly(),typeof e=="string")this._setSelectionAttribute(e,t);else for(const[n,o]of Ke(e))this._setSelectionAttribute(n,o)}removeSelectionAttribute(e){if(this._assertWriterUsedCorrectly(),typeof e=="string")this._removeSelectionAttribute(e);else for(const t of e)this._removeSelectionAttribute(t)}overrideSelectionGravity(){return this.model.document.selection._overrideGravity()}restoreSelectionGravity(e){this.model.document.selection._restoreGravity(e)}_setSelectionAttribute(e,t){const n=this.model.document.selection;if(n.isCollapsed&&n.anchor.parent.isEmpty){const o=zo._getStoreAttributeKey(e);this.setAttribute(o,t,n.anchor.parent)}n._setAttribute(e,t)}_removeSelectionAttribute(e){const t=this.model.document.selection;if(t.isCollapsed&&t.anchor.parent.isEmpty){const n=zo._getStoreAttributeKey(e);this.removeAttribute(n,t.anchor.parent)}t._removeAttribute(e)}_assertWriterUsedCorrectly(){if(this.model._currentWriter!==this)throw new C.a("writer-incorrect-use",this)}_addOperationForAffectedMarkers(e,t){for(const n of this.model.markers){if(!n.managedUsingOperations)continue;const o=n.getRange();let r=!1;if(e==="move")r=t.containsPosition(o.start)||t.start.isEqual(o.start)||t.containsPosition(o.end)||t.end.isEqual(o.end);else{const a=t.nodeBefore,c=t.nodeAfter,d=o.start.parent==a&&o.start.isAtEnd,m=o.end.parent==c&&o.end.offset==0,b=o.end.nodeAfter==c,_=o.start.nodeAfter==c;r=d||m||b||_}r&&this.updateMarker(n.name,{range:o})}}}function Oc(i,e,t,n){const o=i.model,r=o.document;let a,c,d,m=n.start;for(const _ of n.getWalker({shallow:!0}))d=_.item.getAttribute(e),a&&c!=d&&(c!=t&&b(),m=a),a=_.nextPosition,c=d;function b(){const _=new le(m,a),T=_.root.document?r.version:null,E=new un(_,e,c,t,T);i.batch.addOperation(E),o.applyOperation(E)}a instanceof fe&&a!=m&&c!=t&&b()}function _d(i,e,t,n){const o=i.model,r=o.document,a=n.getAttribute(e);let c,d;if(a!=t){if(n.root===n){const m=n.document?r.version:null;d=new Ei(n,e,a,t,m)}else{c=new le(fe._createBefore(n),i.createPositionAfter(n));const m=c.root.document?r.version:null;d=new un(c,e,a,t,m)}i.batch.addOperation(d),o.applyOperation(d)}}function Ps(i,e,t,n,o){const r=i.model,a=r.document,c=new co(e,t,n,r.markers,o,a.version);i.batch.addOperation(c),r.applyOperation(c)}function Rc(i,e,t,n){let o;if(i.root.document){const r=n.document,a=new fe(r.graveyard,[0]);o=new Vt(i,e,a,r.version)}else o=new vg(i,e);t.addOperation(o),n.applyOperation(o)}function yd(i,e){return i===e||i instanceof Mc&&e instanceof Mc}class Ai{constructor(e){this._markerCollection=e,this._changesInElement=new Map,this._elementSnapshots=new Map,this._changedMarkers=new Map,this._changeCount=0,this._cachedChanges=null,this._cachedChangesWithGraveyard=null}get isEmpty(){return this._changesInElement.size==0&&this._changedMarkers.size==0}refreshItem(e){if(this._isInInsertedElement(e.parent))return;this._markRemove(e.parent,e.startOffset,e.offsetSize),this._markInsert(e.parent,e.startOffset,e.offsetSize);const t=le._createOn(e);for(const n of this._markerCollection.getMarkersIntersectingRange(t)){const o=n.getRange();this.bufferMarkerChange(n.name,o,o,n.affectsData)}this._cachedChanges=null}bufferOperation(e){switch(e.type){case"insert":if(this._isInInsertedElement(e.position.parent))return;this._markInsert(e.position.parent,e.position.offset,e.nodes.maxOffset);break;case"addAttribute":case"removeAttribute":case"changeAttribute":for(const t of e.range.getItems({shallow:!0}))this._isInInsertedElement(t.parent)||this._markAttribute(t);break;case"remove":case"move":case"reinsert":{if(e.sourcePosition.isEqual(e.targetPosition)||e.sourcePosition.getShiftedBy(e.howMany).isEqual(e.targetPosition))return;const t=this._isInInsertedElement(e.sourcePosition.parent),n=this._isInInsertedElement(e.targetPosition.parent);t||this._markRemove(e.sourcePosition.parent,e.sourcePosition.offset,e.howMany),n||this._markInsert(e.targetPosition.parent,e.getMovedRangeStart().offset,e.howMany);break}case"rename":{if(this._isInInsertedElement(e.position.parent))return;this._markRemove(e.position.parent,e.position.offset,1),this._markInsert(e.position.parent,e.position.offset,1);const t=le._createFromPositionAndShift(e.position,1);for(const n of this._markerCollection.getMarkersIntersectingRange(t)){const o=n.getRange();this.bufferMarkerChange(n.name,o,o,n.affectsData)}break}case"split":{const t=e.splitPosition.parent;this._isInInsertedElement(t)||this._markRemove(t,e.splitPosition.offset,e.howMany),this._isInInsertedElement(e.insertionPosition.parent)||this._markInsert(e.insertionPosition.parent,e.insertionPosition.offset,1),e.graveyardPosition&&this._markRemove(e.graveyardPosition.parent,e.graveyardPosition.offset,1);break}case"merge":{const t=e.sourcePosition.parent;this._isInInsertedElement(t.parent)||this._markRemove(t.parent,t.startOffset,1);const n=e.graveyardPosition.parent;this._markInsert(n,e.graveyardPosition.offset,1);const o=e.targetPosition.parent;this._isInInsertedElement(o)||this._markInsert(o,e.targetPosition.offset,t.maxOffset);break}}this._cachedChanges=null}bufferMarkerChange(e,t,n,o){const r=this._changedMarkers.get(e);r?(r.newRange=n,r.affectsData=o,r.oldRange==null&&r.newRange==null&&this._changedMarkers.delete(e)):this._changedMarkers.set(e,{oldRange:t,newRange:n,affectsData:o})}getMarkersToRemove(){const e=[];for(const[t,n]of this._changedMarkers)n.oldRange!=null&&e.push({name:t,range:n.oldRange});return e}getMarkersToAdd(){const e=[];for(const[t,n]of this._changedMarkers)n.newRange!=null&&e.push({name:t,range:n.newRange});return e}getChangedMarkers(){return Array.from(this._changedMarkers).map(e=>({name:e[0],data:{oldRange:e[1].oldRange,newRange:e[1].newRange}}))}hasDataChanges(){for(const[,e]of this._changedMarkers)if(e.affectsData)return!0;return this._changesInElement.size>0}getChanges(e={includeChangesInGraveyard:!1}){if(this._cachedChanges)return e.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice();let t=[];for(const n of this._changesInElement.keys()){const o=this._changesInElement.get(n).sort((b,_)=>b.offset===_.offset?b.type!=_.type?b.type=="remove"?-1:1:0:b.offset<_.offset?-1:1),r=this._elementSnapshots.get(n),a=xr(n.getChildren()),c=wg(r.length,o);let d=0,m=0;for(const b of c)if(b==="i")t.push(this._getInsertDiff(n,d,a[d].name)),d++;else if(b==="r")t.push(this._getRemoveDiff(n,d,r[m].name)),m++;else if(b==="a"){const _=a[d].attributes,T=r[m].attributes;let E;if(a[d].name=="$text")E=new le(fe._createAt(n,d),fe._createAt(n,d+1));else{const P=n.offsetToIndex(d);E=new le(fe._createAt(n,d),fe._createAt(n.getChild(P),0))}t.push(...this._getAttributesDiff(E,T,_)),d++,m++}else d++,m++}t.sort((n,o)=>n.position.root!=o.position.root?n.position.root.rootName<o.position.root.rootName?-1:1:n.position.isEqual(o.position)?n.changeCount-o.changeCount:n.position.isBefore(o.position)?-1:1);for(let n=1,o=0;n<t.length;n++){const r=t[o],a=t[n],c=r.type=="remove"&&a.type=="remove"&&r.name=="$text"&&a.name=="$text"&&r.position.isEqual(a.position),d=r.type=="insert"&&a.type=="insert"&&r.name=="$text"&&a.name=="$text"&&r.position.parent==a.position.parent&&r.position.offset+r.length==a.position.offset,m=r.type=="attribute"&&a.type=="attribute"&&r.position.parent==a.position.parent&&r.range.isFlat&&a.range.isFlat&&r.position.offset+r.length==a.position.offset&&r.attributeKey==a.attributeKey&&r.attributeOldValue==a.attributeOldValue&&r.attributeNewValue==a.attributeNewValue;c||d||m?(r.length++,m&&(r.range.end=r.range.end.getShiftedBy(1)),t[n]=null):o=n}t=t.filter(n=>n);for(const n of t)delete n.changeCount,n.type=="attribute"&&(delete n.position,delete n.length);return this._changeCount=0,this._cachedChangesWithGraveyard=t.slice(),this._cachedChanges=t.filter(vm),e.includeChangesInGraveyard?this._cachedChangesWithGraveyard:this._cachedChanges}reset(){this._changesInElement.clear(),this._elementSnapshots.clear(),this._changedMarkers.clear(),this._cachedChanges=null}_markInsert(e,t,n){const o={type:"insert",offset:t,howMany:n,count:this._changeCount++};this._markChange(e,o)}_markRemove(e,t,n){const o={type:"remove",offset:t,howMany:n,count:this._changeCount++};this._markChange(e,o),this._removeAllNestedChanges(e,t,n)}_markAttribute(e){const t={type:"attribute",offset:e.startOffset,howMany:e.offsetSize,count:this._changeCount++};this._markChange(e.parent,t)}_markChange(e,t){this._makeSnapshot(e);const n=this._getChangesForElement(e);this._handleChange(t,n),n.push(t);for(let o=0;o<n.length;o++)n[o].howMany<1&&(n.splice(o,1),o--)}_getChangesForElement(e){let t;return this._changesInElement.has(e)?t=this._changesInElement.get(e):(t=[],this._changesInElement.set(e,t)),t}_makeSnapshot(e){this._elementSnapshots.has(e)||this._elementSnapshots.set(e,xr(e.getChildren()))}_handleChange(e,t){e.nodesToHandle=e.howMany;for(const n of t){const o=e.offset+e.howMany,r=n.offset+n.howMany;if(e.type=="insert"&&(n.type=="insert"&&(e.offset<=n.offset?n.offset+=e.howMany:e.offset<r&&(n.howMany+=e.nodesToHandle,e.nodesToHandle=0)),n.type=="remove"&&e.offset<n.offset&&(n.offset+=e.howMany),n.type=="attribute")){if(e.offset<=n.offset)n.offset+=e.howMany;else if(e.offset<r){const a=n.howMany;n.howMany=e.offset-n.offset,t.unshift({type:"attribute",offset:o,howMany:a-n.howMany,count:this._changeCount++})}}if(e.type=="remove"){if(n.type=="insert"){if(o<=n.offset)n.offset-=e.howMany;else if(o<=r)if(e.offset<n.offset){const a=o-n.offset;n.offset=e.offset,n.howMany-=a,e.nodesToHandle-=a}else n.howMany-=e.nodesToHandle,e.nodesToHandle=0;else if(e.offset<=n.offset)e.nodesToHandle-=n.howMany,n.howMany=0;else if(e.offset<r){const a=r-e.offset;n.howMany-=a,e.nodesToHandle-=a}}if(n.type=="remove"&&(o<=n.offset?n.offset-=e.howMany:e.offset<n.offset&&(e.nodesToHandle+=n.howMany,n.howMany=0)),n.type=="attribute"){if(o<=n.offset)n.offset-=e.howMany;else if(e.offset<n.offset){const a=o-n.offset;n.offset=e.offset,n.howMany-=a}else if(e.offset<r)if(o<=r){const a=n.howMany;n.howMany=e.offset-n.offset;const c=a-n.howMany-e.nodesToHandle;t.unshift({type:"attribute",offset:e.offset,howMany:c,count:this._changeCount++})}else n.howMany-=r-e.offset}}if(e.type=="attribute"){if(n.type=="insert")if(e.offset<n.offset&&o>n.offset){if(o>r){const a={type:"attribute",offset:r,howMany:o-r,count:this._changeCount++};this._handleChange(a,t),t.push(a)}e.nodesToHandle=n.offset-e.offset,e.howMany=e.nodesToHandle}else e.offset>=n.offset&&e.offset<r&&(o>r?(e.nodesToHandle=o-r,e.offset=r):e.nodesToHandle=0);if(n.type=="remove"&&e.offset<n.offset&&o>n.offset){const a={type:"attribute",offset:n.offset,howMany:o-n.offset,count:this._changeCount++};this._handleChange(a,t),t.push(a),e.nodesToHandle=n.offset-e.offset,e.howMany=e.nodesToHandle}n.type=="attribute"&&(e.offset>=n.offset&&o<=r?(e.nodesToHandle=0,e.howMany=0,e.offset=0):e.offset<=n.offset&&o>=r&&(n.howMany=0))}}e.howMany=e.nodesToHandle,delete e.nodesToHandle}_getInsertDiff(e,t,n){return{type:"insert",position:fe._createAt(e,t),name:n,length:1,changeCount:this._changeCount++}}_getRemoveDiff(e,t,n){return{type:"remove",position:fe._createAt(e,t),name:n,length:1,changeCount:this._changeCount++}}_getAttributesDiff(e,t,n){const o=[];n=new Map(n);for(const[r,a]of t){const c=n.has(r)?n.get(r):null;c!==a&&o.push({type:"attribute",position:e.start,range:e.clone(),length:1,attributeKey:r,attributeOldValue:a,attributeNewValue:c,changeCount:this._changeCount++}),n.delete(r)}for(const[r,a]of n)o.push({type:"attribute",position:e.start,range:e.clone(),length:1,attributeKey:r,attributeOldValue:null,attributeNewValue:a,changeCount:this._changeCount++});return o}_isInInsertedElement(e){const t=e.parent;if(!t)return!1;const n=this._changesInElement.get(t),o=e.startOffset;if(n){for(const r of n)if(r.type=="insert"&&o>=r.offset&&o<r.offset+r.howMany)return!0}return this._isInInsertedElement(t)}_removeAllNestedChanges(e,t,n){const o=new le(fe._createAt(e,t),fe._createAt(e,t+n));for(const r of o.getItems({shallow:!0}))r.is("element")&&(this._elementSnapshots.delete(r),this._changesInElement.delete(r),this._removeAllNestedChanges(r,0,r.maxOffset))}}function xr(i){const e=[];for(const t of i)if(t.is("$text"))for(let n=0;n<t.data.length;n++)e.push({name:"$text",attributes:new Map(t.getAttributes())});else e.push({name:t.name,attributes:new Map(t.getAttributes())});return e}function wg(i,e){const t=[];let n=0,o=0;for(const r of e){if(r.offset>n){for(let a=0;a<r.offset-n;a++)t.push("e");o+=r.offset-n}if(r.type=="insert"){for(let a=0;a<r.howMany;a++)t.push("i");n=r.offset+r.howMany}else if(r.type=="remove"){for(let a=0;a<r.howMany;a++)t.push("r");n=r.offset,o+=r.howMany}else t.push(..."a".repeat(r.howMany).split("")),n=r.offset+r.howMany,o+=r.howMany}if(o<i)for(let r=0;r<i-o-n;r++)t.push("e");return t}function vm(i){const e=i.position&&i.position.root.rootName=="$graveyard",t=i.range&&i.range.root.rootName=="$graveyard";return!e&&!t}class kg{constructor(){this._operations=[],this._undoPairs=new Map,this._undoneOperations=new Set}addOperation(e){this._operations.includes(e)||this._operations.push(e)}getOperations(e=Number.NEGATIVE_INFINITY,t=Number.POSITIVE_INFINITY){const n=[];for(const o of this._operations)o.baseVersion>=e&&o.baseVersion<t&&n.push(o);return n}getOperation(e){for(const t of this._operations)if(t.baseVersion==e)return t}setOperationAsUndone(e,t){this._undoPairs.set(t,e),this._undoneOperations.add(e)}isUndoingOperation(e){return this._undoPairs.has(e)}isUndoneOperation(e){return this._undoneOperations.has(e)}getUndoneOperation(e){return this._undoPairs.get(e)}}function wm(i,e){return!!(t=i.charAt(e-1))&&t.length==1&&/[\ud800-\udbff]/.test(t)&&function(n){return!!n&&n.length==1&&/[\udc00-\udfff]/.test(n)}(i.charAt(e));var t}function km(i,e){return!!(t=i.charAt(e))&&t.length==1&&/[\u0300-\u036f\u1ab0-\u1aff\u1dc0-\u1dff\u20d0-\u20ff\ufe20-\ufe2f]/.test(t);var t}class _m{constructor(e){this.model=e,this.version=0,this.history=new kg(this),this.selection=new zo(this),this.roots=new io({idProperty:"rootName"}),this.differ=new Ai(e.markers),this._postFixers=new Set,this._hasSelectionChangedFromTheLastChangeBlock=!1,this.createRoot("$root","$graveyard"),this.listenTo(e,"applyOperation",(t,n)=>{const o=n[0];if(o.isDocumentOperation&&o.baseVersion!==this.version)throw new C.a("model-document-applyoperation-wrong-version",this,{operation:o})},{priority:"highest"}),this.listenTo(e,"applyOperation",(t,n)=>{const o=n[0];o.isDocumentOperation&&this.differ.bufferOperation(o)},{priority:"high"}),this.listenTo(e,"applyOperation",(t,n)=>{const o=n[0];o.isDocumentOperation&&(this.version++,this.history.addOperation(o))},{priority:"low"}),this.listenTo(this.selection,"change",()=>{this._hasSelectionChangedFromTheLastChangeBlock=!0}),this.listenTo(e.markers,"update",(t,n,o,r)=>{this.differ.bufferMarkerChange(n.name,o,r,n.affectsData),o===null&&n.on("change",(a,c)=>{this.differ.bufferMarkerChange(n.name,c,n.getRange(),n.affectsData)})})}get graveyard(){return this.getRoot("$graveyard")}createRoot(e="$root",t="main"){if(this.roots.get(t))throw new C.a("model-document-createroot-name-exists",this,{name:t});const n=new Mc(this,e,t);return this.roots.add(n),n}destroy(){this.selection.destroy(),this.stopListening()}getRoot(e="main"){return this.roots.get(e)}getRootNames(){return Array.from(this.roots,e=>e.rootName).filter(e=>e!="$graveyard")}registerPostFixer(e){this._postFixers.add(e)}toJSON(){const e=ne(this);return e.selection="[engine.model.DocumentSelection]",e.model="[engine.model.Model]",e}_handleChangeBlock(e){this._hasDocumentChangedFromTheLastChangeBlock()&&(this._callPostFixers(e),this.selection.refresh(),this.differ.hasDataChanges()?this.fire("change:data",e.batch):this.fire("change",e.batch),this.selection.refresh(),this.differ.reset()),this._hasSelectionChangedFromTheLastChangeBlock=!1}_hasDocumentChangedFromTheLastChangeBlock(){return!this.differ.isEmpty||this._hasSelectionChangedFromTheLastChangeBlock}_getDefaultRoot(){for(const e of this.roots)if(e!==this.graveyard)return e;return this.graveyard}_getDefaultRange(){const e=this._getDefaultRoot(),t=this.model,n=t.schema,o=t.createPositionFromPath(e,[0]);return n.getNearestSelectionRange(o)||t.createRange(o)}_validateSelectionRange(e){return ym(e.start)&&ym(e.end)}_callPostFixers(e){let t=!1;do for(const n of this._postFixers)if(this.selection.refresh(),t=n(e),t)break;while(t)}}function ym(i){const e=i.textNode;if(e){const t=e.data,n=i.offset-e.startOffset;return!wm(t,n)&&!km(t,n)}return!0}Be(_m,F);class xm{constructor(){this._markers=new Map}[Symbol.iterator](){return this._markers.values()}has(e){return this._markers.has(e)}get(e){return this._markers.get(e)||null}_set(e,t,n=!1,o=!1){const r=e instanceof al?e.name:e;if(r.includes(","))throw new C.a("markercollection-incorrect-marker-name",this);const a=this._markers.get(r);if(a){const m=a.getRange();let b=!1;return m.isEqual(t)||(a._attachLiveRange(Ti.fromRange(t)),b=!0),n!=a.managedUsingOperations&&(a._managedUsingOperations=n,b=!0),typeof o=="boolean"&&o!=a.affectsData&&(a._affectsData=o,b=!0),b&&this.fire("update:"+r,a,m,t),a}const c=Ti.fromRange(t),d=new al(r,c,n,o);return this._markers.set(r,d),this.fire("update:"+r,d,null,t),d}_remove(e){const t=e instanceof al?e.name:e,n=this._markers.get(t);return!!n&&(this._markers.delete(t),this.fire("update:"+t,n,n.getRange(),null),this._destroyMarker(n),!0)}_refresh(e){const t=e instanceof al?e.name:e,n=this._markers.get(t);if(!n)throw new C.a("markercollection-refresh-marker-not-exists",this);const o=n.getRange();this.fire("update:"+t,n,o,o,n.managedUsingOperations,n.affectsData)}*getMarkersAtPosition(e){for(const t of this)t.getRange().containsPosition(e)&&(yield t)}*getMarkersIntersectingRange(e){for(const t of this)t.getRange().getIntersection(e)!==null&&(yield t)}destroy(){for(const e of this._markers.values())this._destroyMarker(e);this._markers=null,this.stopListening()}*getMarkersGroup(e){for(const t of this._markers.values())t.name.startsWith(e+":")&&(yield t)}_destroyMarker(e){e.stopListening(),e._detachLiveRange()}}Be(xm,F);class al{constructor(e,t,n,o){this.name=e,this._liveRange=this._attachLiveRange(t),this._managedUsingOperations=n,this._affectsData=o}get managedUsingOperations(){if(!this._liveRange)throw new C.a("marker-destroyed",this);return this._managedUsingOperations}get affectsData(){if(!this._liveRange)throw new C.a("marker-destroyed",this);return this._affectsData}getStart(){if(!this._liveRange)throw new C.a("marker-destroyed",this);return this._liveRange.start.clone()}getEnd(){if(!this._liveRange)throw new C.a("marker-destroyed",this);return this._liveRange.end.clone()}getRange(){if(!this._liveRange)throw new C.a("marker-destroyed",this);return this._liveRange.toRange()}is(e){return e==="marker"||e==="model:marker"}_attachLiveRange(e){return this._liveRange&&this._detachLiveRange(),e.delegate("change:range").to(this),e.delegate("change:content").to(this),this._liveRange=e,e}_detachLiveRange(){this._liveRange.stopDelegating("change:range",this),this._liveRange.stopDelegating("change:content",this),this._liveRange.detach(),this._liveRange=null}}Be(al,F);class Dn extends Bo{get type(){return"noop"}clone(){return new Dn(this.baseVersion)}getReversed(){return new Dn(this.baseVersion+1)}_execute(){}static get className(){return"NoOperation"}}const ei={};ei[un.className]=un,ei[Sn.className]=Sn,ei[co.className]=co,ei[Vt.className]=Vt,ei[Dn.className]=Dn,ei[Bo.className]=Bo,ei[eo.className]=eo,ei[Ei.className]=Ei,ei[Ht.className]=Ht,ei[wn.className]=wn;class Ln extends fe{constructor(e,t,n="toNone"){if(super(e,t,n),!this.root.is("rootElement"))throw new C.a("model-liveposition-root-not-rootelement",e);_g.call(this)}detach(){this.stopListening()}is(e){return e==="livePosition"||e==="model:livePosition"||e=="position"||e==="model:position"}toPosition(){return new fe(this.root,this.path.slice(),this.stickiness)}static fromPosition(e,t){return new this(e.root,e.path.slice(),t||e.stickiness)}}function _g(){this.listenTo(this.root.document.model,"applyOperation",(i,e)=>{const t=e[0];t.isDocumentOperation&&Nm.call(this,t)},{priority:"low"})}function Nm(i){const e=this.getTransformedByOperation(i);if(!this.isEqual(e)){const t=this.toPosition();this.path=e.path,this.root=e.root,this.fire("change",t)}}Be(Ln,F);class Tm{constructor(e,t,n){this.model=e,this.writer=t,this.position=n,this.canMergeWith=new Set([this.position.parent]),this.schema=e.schema,this._documentFragment=t.createDocumentFragment(),this._documentFragmentPosition=t.createPositionAt(this._documentFragment,0),this._firstNode=null,this._lastNode=null,this._lastAutoParagraph=null,this._filterAttributesOf=[],this._affectedStart=null,this._affectedEnd=null}handleNodes(e){for(const t of Array.from(e))this._handleNode(t);this._insertPartialFragment(),this._lastAutoParagraph&&this._updateLastNodeFromAutoParagraph(this._lastAutoParagraph),this._mergeOnRight(),this.schema.removeDisallowedAttributes(this._filterAttributesOf,this.writer),this._filterAttributesOf=[]}_updateLastNodeFromAutoParagraph(e){const t=this.writer.createPositionAfter(this._lastNode),n=this.writer.createPositionAfter(e);if(n.isAfter(t)){if(this._lastNode=e,this.position.parent!=e||!this.position.isAtEnd)throw new C.a("insertcontent-invalid-insertion-position",this);this.position=n,this._setAffectedBoundaries(this.position)}}getSelectionRange(){return this.nodeToSelect?le._createOn(this.nodeToSelect):this.model.schema.getNearestSelectionRange(this.position)}getAffectedRange(){return this._affectedStart?new le(this._affectedStart,this._affectedEnd):null}destroy(){this._affectedStart&&this._affectedStart.detach(),this._affectedEnd&&this._affectedEnd.detach()}_handleNode(e){if(this.schema.isObject(e))return void this._handleObject(e);let t=this._checkAndAutoParagraphToAllowedPosition(e);t||(t=this._checkAndSplitToAllowedPosition(e),t)?(this._appendToFragment(e),this._firstNode||(this._firstNode=e),this._lastNode=e):this._handleDisallowedNode(e)}_insertPartialFragment(){if(this._documentFragment.isEmpty)return;const e=Ln.fromPosition(this.position,"toNext");this._setAffectedBoundaries(this.position),this._documentFragment.getChild(0)==this._firstNode&&(this.writer.insert(this._firstNode,this.position),this._mergeOnLeft(),this.position=e.toPosition()),this._documentFragment.isEmpty||this.writer.insert(this._documentFragment,this.position),this._documentFragmentPosition=this.writer.createPositionAt(this._documentFragment,0),this.position=e.toPosition(),e.detach()}_handleObject(e){this._checkAndSplitToAllowedPosition(e)?this._appendToFragment(e):this._tryAutoparagraphing(e)}_handleDisallowedNode(e){e.is("element")?this.handleNodes(e.getChildren()):this._tryAutoparagraphing(e)}_appendToFragment(e){if(!this.schema.checkChild(this.position,e))throw new C.a("insertcontent-wrong-position",this,{node:e,position:this.position});this.writer.insert(e,this._documentFragmentPosition),this._documentFragmentPosition=this._documentFragmentPosition.getShiftedBy(e.offsetSize),this.schema.isObject(e)&&!this.schema.checkChild(this.position,"$text")?this.nodeToSelect=e:this.nodeToSelect=null,this._filterAttributesOf.push(e)}_setAffectedBoundaries(e){this._affectedStart||(this._affectedStart=Ln.fromPosition(e,"toPrevious")),this._affectedEnd&&!this._affectedEnd.isBefore(e)||(this._affectedEnd&&this._affectedEnd.detach(),this._affectedEnd=Ln.fromPosition(e,"toNext"))}_mergeOnLeft(){const e=this._firstNode;if(!(e instanceof Pt)||!this._canMergeLeft(e))return;const t=Ln._createBefore(e);t.stickiness="toNext";const n=Ln.fromPosition(this.position,"toNext");this._affectedStart.isEqual(t)&&(this._affectedStart.detach(),this._affectedStart=Ln._createAt(t.nodeBefore,"end","toPrevious")),this._firstNode===this._lastNode&&(this._firstNode=t.nodeBefore,this._lastNode=t.nodeBefore),this.writer.merge(t),t.isEqual(this._affectedEnd)&&this._firstNode===this._lastNode&&(this._affectedEnd.detach(),this._affectedEnd=Ln._createAt(t.nodeBefore,"end","toNext")),this.position=n.toPosition(),n.detach(),this._filterAttributesOf.push(this.position.parent),t.detach()}_mergeOnRight(){const e=this._lastNode;if(!(e instanceof Pt)||!this._canMergeRight(e))return;const t=Ln._createAfter(e);if(t.stickiness="toNext",!this.position.isEqual(t))throw new C.a("insertcontent-invalid-insertion-position",this);this.position=fe._createAt(t.nodeBefore,"end");const n=Ln.fromPosition(this.position,"toPrevious");this._affectedEnd.isEqual(t)&&(this._affectedEnd.detach(),this._affectedEnd=Ln._createAt(t.nodeBefore,"end","toNext")),this._firstNode===this._lastNode&&(this._firstNode=t.nodeBefore,this._lastNode=t.nodeBefore),this.writer.merge(t),t.getShiftedBy(-1).isEqual(this._affectedStart)&&this._firstNode===this._lastNode&&(this._affectedStart.detach(),this._affectedStart=Ln._createAt(t.nodeBefore,0,"toPrevious")),this.position=n.toPosition(),n.detach(),this._filterAttributesOf.push(this.position.parent),t.detach()}_canMergeLeft(e){const t=e.previousSibling;return t instanceof Pt&&this.canMergeWith.has(t)&&this.model.schema.checkMerge(t,e)}_canMergeRight(e){const t=e.nextSibling;return t instanceof Pt&&this.canMergeWith.has(t)&&this.model.schema.checkMerge(e,t)}_tryAutoparagraphing(e){const t=this.writer.createElement("paragraph");this._getAllowedIn(this.position.parent,t)&&this.schema.checkChild(t,e)&&(t._appendChild(e),this._handleNode(t))}_checkAndAutoParagraphToAllowedPosition(e){if(this.schema.checkChild(this.position.parent,e))return!0;if(!this.schema.checkChild(this.position.parent,"paragraph")||!this.schema.checkChild("paragraph",e))return!1;this._insertPartialFragment();const t=this.writer.createElement("paragraph");return this.writer.insert(t,this.position),this._setAffectedBoundaries(this.position),this._lastAutoParagraph=t,this.position=this.writer.createPositionAt(t,0),!0}_checkAndSplitToAllowedPosition(e){const t=this._getAllowedIn(this.position.parent,e);if(!t)return!1;for(t!=this.position.parent&&this._insertPartialFragment();t!=this.position.parent;)if(this.position.isAtStart){const n=this.position.parent;this.position=this.writer.createPositionBefore(n),n.isEmpty&&n.parent===t&&this.writer.remove(n)}else if(this.position.isAtEnd)this.position=this.writer.createPositionAfter(this.position.parent);else{const n=this.writer.createPositionAfter(this.position.parent);this._setAffectedBoundaries(this.position),this.writer.split(this.position),this.position=n,this.canMergeWith.add(this.position.nodeAfter)}return!0}_getAllowedIn(e,t){return this.schema.checkChild(e,t)?e:this.schema.isLimit(e)?null:this._getAllowedIn(e.parent,t)}}function Cm(i,e,t={}){if(e.isCollapsed)return;const n=e.getFirstRange();if(n.root.rootName=="$graveyard")return;const o=i.schema;i.change(r=>{if(!t.doNotResetEntireContent&&function(d,m){const b=d.getLimitElement(m);if(!m.containsEntireContent(b))return!1;const _=m.getFirstRange();return _.start.parent==_.end.parent?!1:d.checkChild(b,"paragraph")}(o,e))return void function(d,m){const b=d.model.schema.getLimitElement(m);d.remove(d.createRangeIn(b)),Em(d,d.createPositionAt(b,0),m)}(r,e);const[a,c]=function(d){const m=d.root.document.model,b=d.start;let _=d.end;if(m.hasContent(d,{ignoreMarkers:!0})){const T=function(E){const P=E.parent,R=P.root.document.model.schema,z=P.getAncestors({parentFirst:!0,includeSelf:!0});for(const $ of z){if(R.isLimit($))return null;if(R.isBlock($))return $}}(_);if(T&&_.isTouching(m.createPositionAt(T,0))){const E=m.createSelection(d);m.modifySelection(E,{direction:"backward"});const P=E.getLastPosition(),R=m.createRange(P,_);m.hasContent(R,{ignoreMarkers:!0})||(_=P)}}return[Ln.fromPosition(b,"toPrevious"),Ln.fromPosition(_,"toNext")]}(n);a.isTouching(c)||r.remove(r.createRange(a,c)),t.leaveUnmerged||(function(d,m,b){const _=d.model;if(!xd(d.model.schema,m,b))return;const[T,E]=function(P,R){const z=P.getAncestors(),$=R.getAncestors();let J=0;for(;z[J]&&z[J]==$[J];)J++;return[z[J],$[J]]}(m,b);!T||!E||(!_.hasContent(T,{ignoreMarkers:!0})&&_.hasContent(E,{ignoreMarkers:!0})?function P(R,z,$,J){const ue=z.parent,xe=$.parent;if(!(ue==J||xe==J)){for(z=R.createPositionAfter(ue),($=R.createPositionBefore(xe)).isEqual(z)||R.insert(ue,$);z.parent.isEmpty;){const He=z.parent;z=R.createPositionBefore(He),R.remove(He)}$=R.createPositionBefore(xe),function(He,Qt){const _t=Qt.nodeBefore,Un=Qt.nodeAfter;_t.name!=Un.name&&He.rename(_t,Un.name),He.clearAttributes(_t),He.setAttributes(Object.fromEntries(Un.getAttributes()),_t),He.merge(Qt)}(R,$),xd(R.model.schema,z,$)&&P(R,z,$,J)}}(d,m,b,T.parent):function P(R,z,$,J){const ue=z.parent,xe=$.parent;if(!(ue==J||xe==J)){for(z=R.createPositionAfter(ue),($=R.createPositionBefore(xe)).isEqual(z)||R.insert(xe,z),R.merge(z);$.parent.isEmpty;){const He=$.parent;$=R.createPositionBefore(He),R.remove(He)}xd(R.model.schema,z,$)&&P(R,z,$,J)}}(d,m,b,T.parent))}(r,a,c),o.removeDisallowedAttributes(a.parent.getChildren(),r)),Am(r,e,a),!t.doNotAutoparagraph&&function(d,m){const b=d.checkChild(m,"$text"),_=d.checkChild(m,"paragraph");return!b&&_}(o,a)&&Em(r,a,e),a.detach(),c.detach()})}function xd(i,e,t){const n=e.parent,o=t.parent;return n!=o&&!i.isLimit(n)&&!i.isLimit(o)&&function(r,a,c){const d=new le(r,a);for(const m of d.getWalker())if(c.isLimit(m.item))return!1;return!0}(e,t,i)}function Em(i,e,t){const n=i.createElement("paragraph");i.insert(n,e),Am(i,t,i.createPositionAt(n,0))}function Am(i,e,t){e instanceof zo?i.setSelection(t):e.setTo(t)}function Sm(i,e){const{isForward:t,walker:n,unit:o,schema:r}=i,{type:a,item:c,nextPosition:d}=e;if(a=="text")return i.unit==="word"?function(m,b){let _=m.position.textNode;if(_){let T=m.position.offset-_.startOffset;for(;!xg(_.data,T,b)&&!Ng(_,T,b);){m.next();const E=b?m.position.nodeAfter:m.position.nodeBefore;if(E&&E.is("$text")){const P=E.data.charAt(b?0:E.data.length-1);' ,.?!:;"-()'.includes(P)||(m.next(),_=m.position.textNode)}T=m.position.offset-_.startOffset}}return m.position}(n,t):function(m,b){const _=m.position.textNode;if(_){const T=_.data;let E=m.position.offset-_.startOffset;for(;wm(T,E)||b=="character"&&km(T,E);)m.next(),E=m.position.offset-_.startOffset}return m.position}(n,o);if(a==(t?"elementStart":"elementEnd")){if(r.isSelectable(c))return fe._createAt(c,t?"after":"before");if(r.checkChild(d,"$text"))return d}else{if(r.isLimit(c))return void n.skip(()=>!0);if(r.checkChild(d,"$text"))return d}}function yg(i,e){const t=i.root,n=fe._createAt(t,e?"end":0);return e?new le(i,n):new le(n,i)}function xg(i,e,t){const n=e+(t?0:-1);return' ,.?!:;"-()'.includes(i.charAt(n))}function Ng(i,e,t){return e===(t?i.endOffset:0)}function Dm(i,e){const t=[];Array.from(i.getItems({direction:"backward"})).map(n=>e.createRangeOn(n)).filter(n=>(n.start.isAfter(i.start)||n.start.isEqual(i.start))&&(n.end.isBefore(i.end)||n.end.isEqual(i.end))).forEach(n=>{t.push(n.start.parent),e.remove(n)}),t.forEach(n=>{let o=n;for(;o.parent&&o.isEmpty;){const r=e.createRangeOn(o);o=o.parent,e.remove(r)}})}function Tg(i){i.document.registerPostFixer(e=>function(t,n){const o=n.document.selection,r=n.schema,a=[];let c=!1;for(const d of o.getRanges()){const m=Cg(d,r);m&&!m.isEqual(d)?(a.push(m),c=!0):a.push(d)}c&&t.setSelection(function(d){const m=[];m.push(d.shift());for(const b of d){const _=m.pop();if(b.isEqual(_))m.push(_);else if(b.isIntersecting(_)){const T=_.start.isAfter(b.start)?b.start:_.start,E=_.end.isAfter(b.end)?_.end:b.end,P=new le(T,E);m.push(P)}else m.push(_),m.push(b)}return m}(a),{backward:o.isBackward})}(e,i))}function Cg(i,e){return i.isCollapsed?function(t,n){const o=t.start,r=n.getNearestSelectionRange(o);if(!r)return null;if(!r.isCollapsed)return r;const a=r.start;return o.isEqual(a)?null:new le(a)}(i,e):function(t,n){const{start:o,end:r}=t,a=n.checkChild(o,"$text"),c=n.checkChild(r,"$text"),d=n.getLimitElement(o),m=n.getLimitElement(r);if(d===m){if(a&&c)return null;if(function(T,E,P){const R=T.nodeAfter&&!P.isLimit(T.nodeAfter)||P.checkChild(T,"$text"),z=E.nodeBefore&&!P.isLimit(E.nodeBefore)||P.checkChild(E,"$text");return R||z}(o,r,n)){const T=o.nodeAfter&&n.isSelectable(o.nodeAfter)?null:n.getNearestSelectionRange(o,"forward"),E=r.nodeBefore&&n.isSelectable(r.nodeBefore)?null:n.getNearestSelectionRange(r,"backward"),P=T?T.start:o,R=E?E.end:r;return new le(P,R)}}const b=d&&!d.is("rootElement"),_=m&&!m.is("rootElement");if(b||_){const T=o.nodeAfter&&r.nodeBefore&&o.nodeAfter.parent===r.nodeBefore.parent,E=b&&(!T||!jm(o.nodeAfter,n)),P=_&&(!T||!jm(r.nodeBefore,n));let R=o,z=r;return E&&(R=fe._createBefore(To(d,n))),P&&(z=fe._createAfter(To(m,n))),new le(R,z)}return null}(i,e)}function To(i,e){let t=i,n=t;for(;e.isLimit(n)&&n.parent;)t=n,n=n.parent;return t}function jm(i,e){return i&&e.isSelectable(i)}class Im{constructor(){this.markers=new xm,this.document=new _m(this),this.schema=new gm,this._pendingChanges=[],this._currentWriter=null,["insertContent","deleteContent","modifySelection","getSelectedContent","applyOperation"].forEach(e=>this.decorate(e)),this.on("applyOperation",(e,t)=>{t[0]._validate()},{priority:"highest"}),this.schema.register("$root",{isLimit:!0}),this.schema.register("$block",{allowIn:"$root",isBlock:!0}),this.schema.register("$text",{allowIn:"$block",isInline:!0,isContent:!0}),this.schema.register("$clipboardHolder",{allowContentOf:"$root",allowChildren:"$text",isLimit:!0}),this.schema.register("$documentFragment",{allowContentOf:"$root",allowChildren:"$text",isLimit:!0}),this.schema.register("$marker"),this.schema.addChildCheck((e,t)=>{if(t.name==="$marker")return!0}),Tg(this),this.document.registerPostFixer(Cc)}change(e){try{return this._pendingChanges.length===0?(this._pendingChanges.push({batch:new jc,callback:e}),this._runPendingChanges()[0]):e(this._currentWriter)}catch(t){C.a.rethrowUnexpectedError(t,this)}}enqueueChange(e,t){try{typeof e=="string"?e=new jc(e):typeof e=="function"&&(t=e,e=new jc),this._pendingChanges.push({batch:e,callback:t}),this._pendingChanges.length==1&&this._runPendingChanges()}catch(n){C.a.rethrowUnexpectedError(n,this)}}applyOperation(e){e._execute()}insertContent(e,t,n){return function(o,r,a,c){return o.change(d=>{let m;m=a?a instanceof Ni||a instanceof zo?a:d.createSelection(a,c):o.document.selection,m.isCollapsed||o.deleteContent(m,{doNotAutoparagraph:!0});const b=new Tm(o,d,m.anchor);let _;_=r.is("documentFragment")?r.getChildren():[r],b.handleNodes(_);const T=b.getSelectionRange();T&&(m instanceof zo?d.setSelection(T):m.setTo(T));const E=b.getAffectedRange()||o.createRange(m.anchor);return b.destroy(),E})}(this,e,t,n)}deleteContent(e,t){Cm(this,e,t)}modifySelection(e,t){(function(n,o,r={}){const a=n.schema,c=r.direction!="backward",d=r.unit?r.unit:"character",m=o.focus,b=new Jo({boundaries:yg(m,c),singleCharacters:!0,direction:c?"forward":"backward"}),_={walker:b,schema:a,isForward:c,unit:d};let T;for(;T=b.next();){if(T.done)return;const E=Sm(_,T.value);if(E)return void(o instanceof zo?n.change(P=>{P.setSelectionFocus(E)}):o.setFocus(E))}})(this,e,t)}getSelectedContent(e){return function(t,n){return t.change(o=>{const r=o.createDocumentFragment(),a=n.getFirstRange();if(!a||a.isCollapsed)return r;const c=a.start.root,d=a.start.getCommonPath(a.end),m=c.getNodeByPath(d);let b;b=a.start.parent==a.end.parent?a:o.createRange(o.createPositionAt(m,a.start.path[d.length]),o.createPositionAt(m,a.end.path[d.length]+1));const _=b.end.offset-b.start.offset;for(const T of b.getItems({shallow:!0}))T.is("$textProxy")?o.appendText(T.data,T.getAttributes(),r):o.append(o.cloneElement(T,!0),r);if(b!=a){const T=a._getTransformedByMove(b.start,o.createPositionAt(r,0),_)[0],E=o.createRange(o.createPositionAt(r,0),T.start);Dm(o.createRange(T.end,o.createPositionAt(r,"end")),o),Dm(E,o)}return r})}(this,e)}hasContent(e,t={}){const n=e instanceof Pt?le._createIn(e):e;if(n.isCollapsed)return!1;const{ignoreWhitespaces:o=!1,ignoreMarkers:r=!1}=t;if(!r){for(const a of this.markers.getMarkersIntersectingRange(n))if(a.affectsData)return!0}for(const a of n.getItems())if(this.schema.isContent(a)&&(!a.is("$textProxy")||!o||a.data.search(/\S/)!==-1))return!0;return!1}createPositionFromPath(e,t,n){return new fe(e,t,n)}createPositionAt(e,t){return fe._createAt(e,t)}createPositionAfter(e){return fe._createAfter(e)}createPositionBefore(e){return fe._createBefore(e)}createRange(e,t){return new le(e,t)}createRangeIn(e){return le._createIn(e)}createRangeOn(e){return le._createOn(e)}createSelection(e,t,n){return new Ni(e,t,n)}createBatch(e){return new jc(e)}createOperationFromJSON(e){return(class{static fromJSON(t,n){return ei[t.__className].fromJSON(t,n)}}).fromJSON(e,this.document)}destroy(){this.document.destroy(),this.stopListening()}_runPendingChanges(){const e=[];for(this.fire("_beforeChanges");this._pendingChanges.length;){const t=this._pendingChanges[0].batch;this._currentWriter=new sl(this,t);const n=this._pendingChanges[0].callback(this._currentWriter);e.push(n),this.document._handleChangeBlock(this._currentWriter),this._pendingChanges.shift(),this._currentWriter=null}return this.fire("_afterChanges"),e}}Be(Im,Wt);class Eg extends yo{constructor(e){super(),this.editor=e}set(e,t,n={}){if(typeof t=="string"){const o=t;t=(r,a)=>{this.editor.execute(o),a()}}super.set(e,t,n)}}class Nd{constructor(e={}){this._context=e.context||new D({language:e.language}),this._context._addEditor(this,!e.context);const t=Array.from(this.constructor.builtinPlugins||[]);this.config=new Ns(e,this.constructor.defaultConfig),this.config.define("plugins",t),this.config.define(this._context._getEditorConfig()),this.plugins=new Ts(this,t,this._context.plugins),this.locale=this._context.locale,this.t=this.locale.t,this.commands=new fm,this.set("state","initializing"),this.once("ready",()=>this.state="ready",{priority:"high"}),this.once("destroy",()=>this.state="destroyed",{priority:"high"}),this.set("isReadOnly",!1),this.model=new Im;const n=new jh;this.data=new wd(this.model,n),this.editing=new hd(this.model,n),this.editing.view.document.bind("isReadOnly").to(this),this.conversion=new bg([this.editing.downcastDispatcher,this.data.downcastDispatcher],this.data.upcastDispatcher),this.conversion.addAlias("dataDowncast",this.data.downcastDispatcher),this.conversion.addAlias("editingDowncast",this.editing.downcastDispatcher),this.keystrokes=new Eg(this),this.keystrokes.listenTo(this.editing.view.document)}initPlugins(){const e=this.config,t=e.get("plugins"),n=e.get("removePlugins")||[],o=e.get("extraPlugins")||[],r=e.get("substitutePlugins")||[];return this.plugins.init(t.concat(o),n,r)}destroy(){let e=Promise.resolve();return this.state=="initializing"&&(e=new Promise(t=>this.once("ready",t))),e.then(()=>{this.fire("destroy"),this.stopListening(),this.commands.destroy()}).then(()=>this.plugins.destroy()).then(()=>{this.model.destroy(),this.data.destroy(),this.editing.destroy(),this.keystrokes.destroy()}).then(()=>this._context._removeEditor(this))}execute(...e){try{return this.commands.execute(...e)}catch(t){C.a.rethrowUnexpectedError(t,this)}}focus(){this.editing.view.focus()}}Be(Nd,Wt);class Ag{constructor(e){this.editor=e,this._components=new Map}*names(){for(const e of this._components.values())yield e.originalName}add(e,t){this._components.set(Td(e),{callback:t,originalName:e})}create(e){if(!this.has(e))throw new C.a("componentfactory-item-missing",this,{name:e});return this._components.get(Td(e)).callback(this.editor.locale)}has(e){return this._components.has(Td(e))}}function Td(i){return String(i).toLowerCase()}class Pm{constructor(e){this.editor=e,this.componentFactory=new Ag(e),this.focusTracker=new Lo,this._editableElementsMap=new Map,this.listenTo(e.editing.view.document,"layoutChanged",()=>this.update())}get element(){return null}update(){this.fire("update")}destroy(){this.stopListening(),this.focusTracker.destroy();for(const e of this._editableElementsMap.values())e.ckeditorInstance=null;this._editableElementsMap=new Map}setEditableElement(e,t){this._editableElementsMap.set(e,t),t.ckeditorInstance||(t.ckeditorInstance=this.editor)}getEditableElement(e="main"){return this._editableElementsMap.get(e)}getEditableElementsNames(){return this._editableElementsMap.keys()}get _editableElements(){return console.warn("editor-ui-deprecated-editable-elements: The EditorUI#_editableElements property has been deprecated and will be removed in the near future.",{editorUI:this}),this._editableElementsMap}}Be(Pm,F);var Sg={setData(i){this.data.set(i)},getData(i){return this.data.get(i)}},Cd={updateSourceElement(){if(!this.sourceElement)throw new C.a("editor-missing-sourceelement",this);var i,e;i=this.sourceElement,e=this.data.get(),i instanceof HTMLTextAreaElement&&(i.value=e),i.innerHTML=e}};class Mm extends I{static get pluginName(){return"PendingActions"}init(){this.set("hasAny",!1),this._actions=new io({idProperty:"_id"}),this._actions.delegate("add","remove").to(this)}add(e){if(typeof e!="string")throw new C.a("pendingactions-add-invalid-message",this);const t=Object.create(Wt);return t.set("message",e),this._actions.add(t),this.hasAny=!0,t}remove(e){this._actions.remove(e),this.hasAny=!!this._actions.length}get first(){return this._actions.get(0)}[Symbol.iterator](){return this._actions[Symbol.iterator]()}}const Co={cancel:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m11.591 10.177 4.243 4.242a1 1 0 0 1-1.415 1.415l-4.242-4.243-4.243 4.243a1 1 0 0 1-1.414-1.415l4.243-4.242L4.52 5.934A1 1 0 0 1 5.934 4.52l4.243 4.243 4.242-4.243a1 1 0 1 1 1.415 1.414l-4.243 4.243z"/></svg>',caption:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 16h9a1 1 0 0 1 0 2H2a1 1 0 0 1 0-2z"/><path d="M17 1a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h14zm0 1.5H3a.5.5 0 0 0-.492.41L2.5 3v9a.5.5 0 0 0 .41.492L3 12.5h14a.5.5 0 0 0 .492-.41L17.5 12V3a.5.5 0 0 0-.41-.492L17 2.5z" fill-opacity=".6"/></svg>',check:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M6.972 16.615a.997.997 0 0 1-.744-.292l-4.596-4.596a1 1 0 1 1 1.414-1.414l3.926 3.926 9.937-9.937a1 1 0 0 1 1.414 1.415L7.717 16.323a.997.997 0 0 1-.745.292z"/></svg>',cog:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m11.333 2 .19 2.263a5.899 5.899 0 0 1 1.458.604L14.714 3.4 16.6 5.286l-1.467 1.733c.263.452.468.942.605 1.46L18 8.666v2.666l-2.263.19a5.899 5.899 0 0 1-.604 1.458l1.467 1.733-1.886 1.886-1.733-1.467a5.899 5.899 0 0 1-1.46.605L11.334 18H8.667l-.19-2.263a5.899 5.899 0 0 1-1.458-.604L5.286 16.6 3.4 14.714l1.467-1.733a5.899 5.899 0 0 1-.604-1.458L2 11.333V8.667l2.262-.189a5.899 5.899 0 0 1 .605-1.459L3.4 5.286 5.286 3.4l1.733 1.467a5.899 5.899 0 0 1 1.46-.605L8.666 2h2.666zM10 6.267a3.733 3.733 0 1 0 0 7.466 3.733 3.733 0 0 0 0-7.466z"/></svg>',eraser:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m8.636 9.531-2.758 3.94a.5.5 0 0 0 .122.696l3.224 2.284h1.314l2.636-3.736L8.636 9.53zm.288 8.451L5.14 15.396a2 2 0 0 1-.491-2.786l6.673-9.53a2 2 0 0 1 2.785-.49l3.742 2.62a2 2 0 0 1 .491 2.785l-7.269 10.053-2.147-.066z"/><path d="M4 18h5.523v-1H4zm-2 0h1v-1H2z"/></svg>',lowVision:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M5.085 6.22 2.943 4.078a.75.75 0 1 1 1.06-1.06l2.592 2.59A11.094 11.094 0 0 1 10 5.068c4.738 0 8.578 3.101 8.578 5.083 0 1.197-1.401 2.803-3.555 3.887l1.714 1.713a.75.75 0 0 1-.09 1.138.488.488 0 0 1-.15.084.75.75 0 0 1-.821-.16L6.17 7.304c-.258.11-.51.233-.757.365l6.239 6.24-.006.005.78.78c-.388.094-.78.166-1.174.215l-1.11-1.11h.011L4.55 8.197a7.2 7.2 0 0 0-.665.514l-.112.098 4.897 4.897-.005.006 1.276 1.276a10.164 10.164 0 0 1-1.477-.117l-.479-.479-.009.009-4.863-4.863-.022.031a2.563 2.563 0 0 0-.124.2c-.043.077-.08.158-.108.241a.534.534 0 0 0-.028.133.29.29 0 0 0 .008.072.927.927 0 0 0 .082.226c.067.133.145.26.234.379l3.242 3.365.025.01.59.623c-3.265-.918-5.59-3.155-5.59-4.668 0-1.194 1.448-2.838 3.663-3.93zm7.07.531a4.632 4.632 0 0 1 1.108 5.992l.345.344.046-.018a9.313 9.313 0 0 0 2-1.112c.256-.187.5-.392.727-.613.137-.134.27-.277.392-.431.072-.091.141-.185.203-.286.057-.093.107-.19.148-.292a.72.72 0 0 0 .036-.12.29.29 0 0 0 .008-.072.492.492 0 0 0-.028-.133.999.999 0 0 0-.036-.096 2.165 2.165 0 0 0-.071-.145 2.917 2.917 0 0 0-.125-.2 3.592 3.592 0 0 0-.263-.335 5.444 5.444 0 0 0-.53-.523 7.955 7.955 0 0 0-1.054-.768 9.766 9.766 0 0 0-1.879-.891c-.337-.118-.68-.219-1.027-.301zm-2.85.21-.069.002a.508.508 0 0 0-.254.097.496.496 0 0 0-.104.679.498.498 0 0 0 .326.199l.045.005c.091.003.181.003.272.012a2.45 2.45 0 0 1 2.017 1.513c.024.061.043.125.069.185a.494.494 0 0 0 .45.287h.008a.496.496 0 0 0 .35-.158.482.482 0 0 0 .13-.335.638.638 0 0 0-.048-.219 3.379 3.379 0 0 0-.36-.723 3.438 3.438 0 0 0-2.791-1.543l-.028-.001h-.013z"/></svg>',image:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M6.91 10.54c.26-.23.64-.21.88.03l3.36 3.14 2.23-2.06a.64.64 0 0 1 .87 0l2.52 2.97V4.5H3.2v10.12l3.71-4.08zm10.27-7.51c.6 0 1.09.47 1.09 1.05v11.84c0 .59-.49 1.06-1.09 1.06H2.79c-.6 0-1.09-.47-1.09-1.06V4.08c0-.58.49-1.05 1.1-1.05h14.38zm-5.22 5.56a1.96 1.96 0 1 1 3.4-1.96 1.96 1.96 0 0 1-3.4 1.96z"/></svg>',alignBottom:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m9.239 13.938-2.88-1.663a.75.75 0 0 1 .75-1.3L9 12.067V4.75a.75.75 0 1 1 1.5 0v7.318l1.89-1.093a.75.75 0 0 1 .75 1.3l-2.879 1.663a.752.752 0 0 1-.511.187.752.752 0 0 1-.511-.187zM4.25 17a.75.75 0 1 1 0-1.5h10.5a.75.75 0 0 1 0 1.5H4.25z"/></svg>',alignMiddle:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M9.75 11.875a.752.752 0 0 1 .508.184l2.883 1.666a.75.75 0 0 1-.659 1.344l-.091-.044-1.892-1.093.001 4.318a.75.75 0 1 1-1.5 0v-4.317l-1.89 1.092a.75.75 0 0 1-.75-1.3l2.879-1.663a.752.752 0 0 1 .51-.187zM15.25 9a.75.75 0 1 1 0 1.5H4.75a.75.75 0 1 1 0-1.5h10.5zM9.75.375a.75.75 0 0 1 .75.75v4.318l1.89-1.093.092-.045a.75.75 0 0 1 .659 1.344l-2.883 1.667a.752.752 0 0 1-.508.184.752.752 0 0 1-.511-.187L6.359 5.65a.75.75 0 0 1 .75-1.299L9 5.442V1.125a.75.75 0 0 1 .75-.75z"/></svg>',alignTop:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m10.261 7.062 2.88 1.663a.75.75 0 0 1-.75 1.3L10.5 8.933v7.317a.75.75 0 1 1-1.5 0V8.932l-1.89 1.093a.75.75 0 0 1-.75-1.3l2.879-1.663a.752.752 0 0 1 .511-.187.752.752 0 0 1 .511.187zM15.25 4a.75.75 0 1 1 0 1.5H4.75a.75.75 0 0 1 0-1.5h10.5z"/></svg>',alignLeft:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 4c0 .414.336.75.75.75h9.929a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0-8c0 .414.336.75.75.75h9.929a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75z"/></svg>',alignCenter:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm2.286 4c0 .414.336.75.75.75h9.928a.75.75 0 1 0 0-1.5H5.036a.75.75 0 0 0-.75.75zm0-8c0 .414.336.75.75.75h9.928a.75.75 0 1 0 0-1.5H5.036a.75.75 0 0 0-.75.75z"/></svg>',alignRight:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M18 3.75a.75.75 0 0 1-.75.75H2.75a.75.75 0 1 1 0-1.5h14.5a.75.75 0 0 1 .75.75zm0 8a.75.75 0 0 1-.75.75H2.75a.75.75 0 1 1 0-1.5h14.5a.75.75 0 0 1 .75.75zm0 4a.75.75 0 0 1-.75.75H7.321a.75.75 0 1 1 0-1.5h9.929a.75.75 0 0 1 .75.75zm0-8a.75.75 0 0 1-.75.75H7.321a.75.75 0 1 1 0-1.5h9.929a.75.75 0 0 1 .75.75z"/></svg>',alignJustify:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 4c0 .414.336.75.75.75h9.929a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0-8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75z"/></svg>',objectLeft:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path opacity=".5" d="M2 3h16v1.5H2zm11.5 9H18v1.5h-4.5zm0-3H18v1.5h-4.5zm0-3H18v1.5h-4.5zM2 15h16v1.5H2z"/><path d="M12.003 7v5.5a1 1 0 0 1-1 1H2.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1zm-1.506.5H3.5V12h6.997V7.5z"/></svg>',objectCenter:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path opacity=".5" d="M2 3h16v1.5H2zm0 12h16v1.5H2z"/><path d="M15.003 7v5.5a1 1 0 0 1-1 1H5.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1zm-1.506.5H6.5V12h6.997V7.5z"/></svg>',objectRight:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path opacity=".5" d="M2 3h16v1.5H2zm0 12h16v1.5H2zm0-9h5v1.5H2zm0 3h5v1.5H2zm0 3h5v1.5H2z"/><path d="M18.003 7v5.5a1 1 0 0 1-1 1H8.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1zm-1.506.5H9.5V12h6.997V7.5z"/></svg>',objectFullWidth:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path opacity=".5" d="M2 3h16v1.5H2zm0 12h16v1.5H2z"/><path d="M18 7v5.5a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1zm-1.505.5H3.504V12h12.991V7.5z"/></svg>',objectInline:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path opacity=".5" d="M2 3h16v1.5H2zm11.5 9H18v1.5h-4.5zM2 15h16v1.5H2z"/><path d="M12.003 7v5.5a1 1 0 0 1-1 1H2.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1zm-1.506.5H3.5V12h6.997V7.5z"/></svg>',objectBlockLeft:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path opacity=".5" d="M2 3h16v1.5H2zm0 12h16v1.5H2z"/><path d="M12.003 7v5.5a1 1 0 0 1-1 1H2.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1zm-1.506.5H3.5V12h6.997V7.5z"/></svg>',objectBlockRight:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path opacity=".5" d="M2 3h16v1.5H2zm0 12h16v1.5H2z"/><path d="M18.003 7v5.5a1 1 0 0 1-1 1H8.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1zm-1.506.5H9.5V12h6.997V7.5z"/></svg>',objectSizeFull:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2.5 17v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zM1 15.5v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm0-2v1h-1v-1h1zm-19 0v1H0v-1h1zM14.5 2v1h-1V2h1zm2 0v1h-1V2h1zm2 0v1h-1V2h1zm-8 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm8 0v1h-1V2h1zm-10 0v1h-1V2h1z"/><path d="M18.095 2H1.905C.853 2 0 2.895 0 4v12c0 1.105.853 2 1.905 2h16.19C19.147 18 20 17.105 20 16V4c0-1.105-.853-2-1.905-2zm0 1.5c.263 0 .476.224.476.5v12c0 .276-.213.5-.476.5H1.905a.489.489 0 0 1-.476-.5V4c0-.276.213-.5.476-.5h16.19z"/></svg>',objectSizeLarge:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2.5 17v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zM1 15.5v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm0-2v1h-1v-1h1zm-19 0v1H0v-1h1zM14.5 2v1h-1V2h1zm2 0v1h-1V2h1zm2 0v1h-1V2h1zm-8 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm8 0v1h-1V2h1zm-10 0v1h-1V2h1z"/><path d="M13 6H2a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2zm0 1.5a.5.5 0 0 1 .5.5v8a.5.5 0 0 1-.5.5H2a.5.5 0 0 1-.5-.5V8a.5.5 0 0 1 .5-.5h11z"/></svg>',objectSizeSmall:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2.5 17v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zM1 15.5v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm0-2v1h-1v-1h1zm-19 0v1H0v-1h1zM14.5 2v1h-1V2h1zm2 0v1h-1V2h1zm2 0v1h-1V2h1zm-8 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm8 0v1h-1V2h1zm-10 0v1h-1V2h1z"/><path d="M7 10H2a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h5a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2zm0 1.5a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5H2a.5.5 0 0 1-.5-.5v-4a.5.5 0 0 1 .5-.5h5z"/></svg>',objectSizeMedium:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2.5 17v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zM1 15.5v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm0-2v1h-1v-1h1zm-19 0v1H0v-1h1zM14.5 2v1h-1V2h1zm2 0v1h-1V2h1zm2 0v1h-1V2h1zm-8 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm8 0v1h-1V2h1zm-10 0v1h-1V2h1z"/><path d="M10 8H2a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2v-6a2 2 0 0 0-2-2zm0 1.5a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-.5.5H2a.5.5 0 0 1-.5-.5v-6a.5.5 0 0 1 .5-.5h8z"/></svg>',pencil:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m7.3 17.37-.061.088a1.518 1.518 0 0 1-.934.535l-4.178.663-.806-4.153a1.495 1.495 0 0 1 .187-1.058l.056-.086L8.77 2.639c.958-1.351 2.803-1.076 4.296-.03 1.497 1.047 2.387 2.693 1.433 4.055L7.3 17.37zM9.14 4.728l-5.545 8.346 3.277 2.294 5.544-8.346L9.14 4.728zM6.07 16.512l-3.276-2.295.53 2.73 2.746-.435zM9.994 3.506 13.271 5.8c.316-.452-.16-1.333-1.065-1.966-.905-.634-1.895-.78-2.212-.328zM8 18.5 9.375 17H19v1.5H8z"/></svg>',pilcrow:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M6.999 2H15a1 1 0 0 1 0 2h-1.004v13a1 1 0 1 1-2 0V4H8.999v13a1 1 0 1 1-2 0v-7A4 4 0 0 1 3 6a4 4 0 0 1 3.999-4z"/></svg>',quote:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M3 10.423a6.5 6.5 0 0 1 6.056-6.408l.038.67C6.448 5.423 5.354 7.663 5.22 10H9c.552 0 .5.432.5.986v4.511c0 .554-.448.503-1 .503h-5c-.552 0-.5-.449-.5-1.003v-4.574zm8 0a6.5 6.5 0 0 1 6.056-6.408l.038.67c-2.646.739-3.74 2.979-3.873 5.315H17c.552 0 .5.432.5.986v4.511c0 .554-.448.503-1 .503h-5c-.552 0-.5-.449-.5-1.003v-4.574z"/></svg>',threeVerticalDots:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle cx="9.5" cy="4.5" r="1.5"/><circle cx="9.5" cy="10.5" r="1.5"/><circle cx="9.5" cy="16.5" r="1.5"/></svg>'};function Ed({emitter:i,activator:e,callback:t,contextElements:n}){i.listenTo(document,"mousedown",(o,r)=>{if(!e())return;const a=typeof r.composedPath=="function"?r.composedPath():[];for(const c of n)if(c.contains(r.target)||a.includes(c))return;t()})}function Ad(i){i.set("_isCssTransitionsDisabled",!1),i.disableCssTransitions=()=>{i._isCssTransitionsDisabled=!0},i.enableCssTransitions=()=>{i._isCssTransitionsDisabled=!1},i.extendTemplate({attributes:{class:[i.bindTemplate.if("_isCssTransitionsDisabled","ck-transitions-disabled")]}})}function Sd({view:i}){i.listenTo(i.element,"submit",(e,t)=>{t.preventDefault(),i.fire("submit")},{useCapture:!0})}class os extends io{constructor(e=[]){super(e,{idProperty:"viewUid"}),this.on("add",(t,n,o)=>{this._renderViewIntoCollectionParent(n,o)}),this.on("remove",(t,n)=>{n.element&&this._parentElement&&n.element.remove()}),this._parentElement=null}destroy(){this.map(e=>e.destroy())}setParent(e){this._parentElement=e;for(const t of this)this._renderViewIntoCollectionParent(t)}delegate(...e){if(!e.length||!e.every(t=>typeof t=="string"))throw new C.a("ui-viewcollection-delegate-wrong-events",this);return{to:t=>{for(const n of this)for(const o of e)n.delegate(o).to(t);this.on("add",(n,o)=>{for(const r of e)o.delegate(r).to(t)}),this.on("remove",(n,o)=>{for(const r of e)o.stopDelegating(r,t)})}}}_renderViewIntoCollectionParent(e,t){e.isRendered||e.render(),e.element&&this._parentElement&&this._parentElement.insertBefore(e.element,this._parentElement.children[t])}}w(15);class gt{constructor(e){this.element=null,this.isRendered=!1,this.locale=e,this.t=e&&e.t,this._viewCollections=new io,this._unboundChildren=this.createCollection(),this._viewCollections.on("add",(t,n)=>{n.locale=e}),this.decorate("render")}get bindTemplate(){return this._bindTemplate?this._bindTemplate:this._bindTemplate=Eo.bind(this,this)}createCollection(e){const t=new os(e);return this._viewCollections.add(t),t}registerChild(e){Yn(e)||(e=[e]);for(const t of e)this._unboundChildren.add(t)}deregisterChild(e){Yn(e)||(e=[e]);for(const t of e)this._unboundChildren.remove(t)}setTemplate(e){this.template=new Eo(e)}extendTemplate(e){Eo.extend(this.template,e)}render(){if(this.isRendered)throw new C.a("ui-view-render-already-rendered",this);this.template&&(this.element=this.template.render(),this.registerChild(this.template.getViews())),this.isRendered=!0}destroy(){this.stopListening(),this._viewCollections.map(e=>e.destroy()),this.template&&this.template._revertData&&this.template.revert(this.element)}}Be(gt,Zr),Be(gt,Wt);class Eo{constructor(e){Object.assign(this,Lm(Vm(e))),this._isRendered=!1,this._revertData=null}render(){const e=this._renderNode({intoFragment:!0});return this._isRendered=!0,e}apply(e){return this._revertData={children:[],bindings:[],attributes:{}},this._renderNode({node:e,isApplying:!0,revertData:this._revertData}),e}revert(e){if(!this._revertData)throw new C.a("ui-template-revert-not-applied",[this,e]);this._revertTemplateFromNode(e,this._revertData)}*getViews(){yield*function*e(t){if(t.children)for(const n of t.children)zc(n)?yield n:Dd(n)&&(yield*e(n))}(this)}static bind(e,t){return{to:(n,o)=>new Dg({eventNameOrFunction:n,attribute:n,observable:e,emitter:t,callback:o}),if:(n,o,r)=>new Om({observable:e,emitter:t,attribute:n,valueIfTrue:o,callback:r})}}static extend(e,t){if(e._isRendered)throw new C.a("template-extend-render",[this,e]);(function n(o,r){if(r.attributes&&(o.attributes||(o.attributes={}),Lc(o.attributes,r.attributes)),r.eventListeners&&(o.eventListeners||(o.eventListeners={}),Lc(o.eventListeners,r.eventListeners)),r.text&&o.text.push(...r.text),r.children&&r.children.length){if(o.children.length!=r.children.length)throw new C.a("ui-template-extend-children-mismatch",o);let a=0;for(const c of r.children)n(o.children[a++],c)}})(e,Lm(Vm(t)))}_renderNode(e){let t;if(t=e.node?this.tag&&this.text:this.tag?this.text:!this.text,t)throw new C.a("ui-template-wrong-syntax",this);return this.text?this._renderText(e):this._renderElement(e)}_renderElement(e){let t=e.node;return t||(t=e.node=document.createElementNS(this.ns||"http://www.w3.org/1999/xhtml",this.tag)),this._renderAttributes(e),this._renderElementChildren(e),this._setUpListeners(e),t}_renderText(e){let t=e.node;return t?e.revertData.text=t.textContent:t=e.node=document.createTextNode(""),Vc(this.text)?this._bindToObservable({schema:this.text,updater:jg(t),data:e}):t.textContent=this.text.join(""),t}_renderAttributes(e){let t,n,o,r;if(!this.attributes)return;const a=e.node,c=e.revertData;for(t in this.attributes)if(o=a.getAttribute(t),n=this.attributes[t],c&&(c.attributes[t]=o),r=oe(n[0])&&n[0].ns?n[0].ns:null,Vc(n)){const d=r?n[0].value:n;c&&Fm(t)&&d.unshift(o),this._bindToObservable({schema:d,updater:Ig(a,t,r),data:e})}else t=="style"&&typeof n[0]!="string"?this._renderStyleAttribute(n[0],e):(c&&o&&Fm(t)&&n.unshift(o),n=n.map(d=>d&&d.value||d).reduce((d,m)=>d.concat(m),[]).reduce(Bm,""),is(n)||a.setAttributeNS(r,t,n))}_renderStyleAttribute(e,t){const n=t.node;for(const o in e){const r=e[o];Vc(r)?this._bindToObservable({schema:[r],updater:Pg(n,o),data:t}):n.style[o]=r}}_renderElementChildren(e){const t=e.node,n=e.intoFragment?document.createDocumentFragment():t,o=e.isApplying;let r=0;for(const a of this.children)if(jd(a)){if(!o){a.setParent(t);for(const c of a)n.appendChild(c.element)}}else if(zc(a))o||(a.isRendered||a.render(),n.appendChild(a.element));else if(Jr(a))n.appendChild(a);else if(o){const c={children:[],bindings:[],attributes:{}};e.revertData.children.push(c),a._renderNode({node:n.childNodes[r++],isApplying:!0,revertData:c})}else n.appendChild(a.render());e.intoFragment&&t.appendChild(n)}_setUpListeners(e){if(this.eventListeners)for(const t in this.eventListeners){const n=this.eventListeners[t].map(o=>{const[r,a]=t.split("@");return o.activateDomEventListener(r,a,e)});e.revertData&&e.revertData.bindings.push(n)}}_bindToObservable({schema:e,updater:t,data:n}){const o=n.revertData;Rm(e,t,n);const r=e.filter(a=>!is(a)).filter(a=>a.observable).map(a=>a.activateAttributeListener(e,t,n));o&&o.bindings.push(r)}_revertTemplateFromNode(e,t){for(const n of t.bindings)for(const o of n)o();if(t.text)e.textContent=t.text;else{for(const n in t.attributes){const o=t.attributes[n];o===null?e.removeAttribute(n):e.setAttribute(n,o)}for(let n=0;n<t.children.length;++n)this._revertTemplateFromNode(e.childNodes[n],t.children[n])}}}Be(Eo,F);class ll{constructor(e){Object.assign(this,e)}getValue(e){const t=this.observable[this.attribute];return this.callback?this.callback(t,e):t}activateAttributeListener(e,t,n){const o=()=>Rm(e,t,n);return this.emitter.listenTo(this.observable,"change:"+this.attribute,o),()=>{this.emitter.stopListening(this.observable,"change:"+this.attribute,o)}}}class Dg extends ll{activateDomEventListener(e,t,n){const o=(r,a)=>{t&&!a.target.matches(t)||(typeof this.eventNameOrFunction=="function"?this.eventNameOrFunction(a):this.observable.fire(this.eventNameOrFunction,a))};return this.emitter.listenTo(n.node,e,o),()=>{this.emitter.stopListening(n.node,e,o)}}}class Om extends ll{getValue(e){return!is(super.getValue(e))&&(this.valueIfTrue||!0)}}function Vc(i){return!!i&&(i.value&&(i=i.value),Array.isArray(i)?i.some(Vc):i instanceof ll)}function Rm(i,e,{node:t}){let n=function(o,r){return o.map(a=>a instanceof ll?a.getValue(r):a)}(i,t);n=i.length==1&&i[0]instanceof Om?n[0]:n.reduce(Bm,""),is(n)?e.remove():e.set(n)}function jg(i){return{set(e){i.textContent=e},remove(){i.textContent=""}}}function Ig(i,e,t){return{set(n){i.setAttributeNS(t,e,n)},remove(){i.removeAttributeNS(t,e)}}}function Pg(i,e){return{set(t){i.style[e]=t},remove(){i.style[e]=null}}}function Vm(i){return qi(i,e=>{if(e&&(e instanceof ll||Dd(e)||zc(e)||jd(e)))return e})}function Lm(i){if(typeof i=="string"?i=function(e){return{text:[e]}}(i):i.text&&function(e){e.text=Tt(e.text)}(i),i.on&&(i.eventListeners=function(e){for(const t in e)zm(e,t);return e}(i.on),delete i.on),!i.text){i.attributes&&function(t){for(const n in t)t[n].value&&(t[n].value=Tt(t[n].value)),zm(t,n)}(i.attributes);const e=[];if(i.children)if(jd(i.children))e.push(i.children);else for(const t of i.children)Dd(t)||zc(t)||Jr(t)?e.push(t):e.push(new Eo(t));i.children=e}return i}function zm(i,e){i[e]=Tt(i[e])}function Bm(i,e){return is(e)?i:is(i)?e:`${i} ${e}`}function Lc(i,e){for(const t in e)i[t]?i[t].push(...e[t]):i[t]=e[t]}function is(i){return!i&&i!==0}function zc(i){return i instanceof gt}function Dd(i){return i instanceof Eo}function jd(i){return i instanceof os}function Fm(i){return i=="class"||i=="style"}class Mg extends os{constructor(e,t=[]){super(t),this.locale=e}attachToDom(){this._bodyCollectionContainer=new Eo({tag:"div",attributes:{class:["ck","ck-reset_all","ck-body","ck-rounded-corners"],dir:this.locale.uiLanguageDirection},children:this}).render();let e=document.querySelector(".ck-body-wrapper");e||(e=function(t,n,o={},r=[]){const a=o&&o.xmlns,c=a?t.createElementNS(a,n):t.createElement(n);for(const d in o)c.setAttribute(d,o[d]);!ed(r)&&Yn(r)||(r=[r]);for(let d of r)ed(d)&&(d=t.createTextNode(d)),c.appendChild(d);return c}(document,"div",{class:"ck-body-wrapper"}),document.body.appendChild(e)),e.appendChild(this._bodyCollectionContainer)}detachFromDom(){super.destroy(),this._bodyCollectionContainer&&this._bodyCollectionContainer.remove();const e=document.querySelector(".ck-body-wrapper");e&&e.childElementCount==0&&e.remove()}}w(17);class Bc extends gt{constructor(){super();const e=this.bindTemplate;this.set("content",""),this.set("viewBox","0 0 20 20"),this.set("fillColor",""),this.setTemplate({tag:"svg",ns:"http://www.w3.org/2000/svg",attributes:{class:["ck","ck-icon"],viewBox:e.to("viewBox")}})}render(){super.render(),this._updateXMLContent(),this._colorFillPaths(),this.on("change:content",()=>{this._updateXMLContent(),this._colorFillPaths()}),this.on("change:fillColor",()=>{this._colorFillPaths()})}_updateXMLContent(){if(this.content){const e=new DOMParser().parseFromString(this.content.trim(),"image/svg+xml").querySelector("svg"),t=e.getAttribute("viewBox");for(t&&(this.viewBox=t),this.element.innerHTML="";e.childNodes.length>0;)this.element.appendChild(e.childNodes[0])}}_colorFillPaths(){this.fillColor&&this.element.querySelectorAll(".ck-icon__fill").forEach(e=>{e.style.fill=this.fillColor})}}w(19);class qm extends gt{constructor(e){super(e),this.set("text",""),this.set("position","s");const t=this.bindTemplate;this.setTemplate({tag:"span",attributes:{class:["ck","ck-tooltip",t.to("position",n=>"ck-tooltip_"+n),t.if("text","ck-hidden",n=>!n.trim())]},children:[{tag:"span",attributes:{class:["ck","ck-tooltip__text"]},children:[{text:t.to("text")}]}]})}}w(21);class nn extends gt{constructor(e){super(e);const t=this.bindTemplate,n=S();this.set("class"),this.set("labelStyle"),this.set("icon"),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isVisible",!0),this.set("isToggleable",!1),this.set("keystroke"),this.set("label"),this.set("tabindex",-1),this.set("tooltip"),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.set("withKeystroke",!1),this.children=this.createCollection(),this.tooltipView=this._createTooltipView(),this.labelView=this._createLabelView(n),this.iconView=new Bc,this.iconView.extendTemplate({attributes:{class:"ck-button__icon"}}),this.keystrokeView=this._createKeystrokeView(),this.bind("_tooltipString").to(this,"tooltip",this,"label",this,"keystroke",this._getTooltipString.bind(this)),this.setTemplate({tag:"button",attributes:{class:["ck","ck-button",t.to("class"),t.if("isEnabled","ck-disabled",o=>!o),t.if("isVisible","ck-hidden",o=>!o),t.to("isOn",o=>o?"ck-on":"ck-off"),t.if("withText","ck-button_with-text"),t.if("withKeystroke","ck-button_with-keystroke")],type:t.to("type",o=>o||"button"),tabindex:t.to("tabindex"),"aria-labelledby":"ck-editor__aria-label_"+n,"aria-disabled":t.if("isEnabled",!0,o=>!o),"aria-pressed":t.to("isOn",o=>!!this.isToggleable&&String(o))},children:this.children,on:{mousedown:t.to(o=>{o.preventDefault()}),click:t.to(o=>{this.isEnabled?this.fire("execute"):o.preventDefault()})}})}render(){super.render(),this.icon&&(this.iconView.bind("content").to(this,"icon"),this.children.add(this.iconView)),this.children.add(this.tooltipView),this.children.add(this.labelView),this.withKeystroke&&this.children.add(this.keystrokeView)}focus(){this.element.focus()}_createTooltipView(){const e=new qm;return e.bind("text").to(this,"_tooltipString"),e.bind("position").to(this,"tooltipPosition"),e}_createLabelView(e){const t=new gt,n=this.bindTemplate;return t.setTemplate({tag:"span",attributes:{class:["ck","ck-button__label"],style:n.to("labelStyle"),id:"ck-editor__aria-label_"+e},children:[{text:this.bindTemplate.to("label")}]}),t}_createKeystrokeView(){const e=new gt;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__keystroke"]},children:[{text:this.bindTemplate.to("keystroke",t=>Ba(t))}]}),e}_getTooltipString(e,t,n){return e?typeof e=="string"?e:(n&&(n=Ba(n)),e instanceof Function?e(t,n):`${t}${n?` (${n})`:""}`):""}}w(23);class Fc extends nn{constructor(e){super(e),this.isToggleable=!0,this.toggleSwitchView=this._createToggleView(),this.extendTemplate({attributes:{class:"ck-switchbutton"}})}render(){super.render(),this.children.add(this.toggleSwitchView)}_createToggleView(){const e=new gt;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__toggle"]},children:[{tag:"span",attributes:{class:["ck","ck-button__toggle__inner"]}}]}),e}}class Ms{constructor(e){if(Object.assign(this,e),e.actions&&e.keystrokeHandler)for(const t in e.actions){let n=e.actions[t];typeof n=="string"&&(n=[n]);for(const o of n)e.keystrokeHandler.set(o,(r,a)=>{this[t](),a()})}}get first(){return this.focusables.find(Os)||null}get last(){return this.focusables.filter(Os).slice(-1)[0]||null}get next(){return this._getFocusableItem(1)}get previous(){return this._getFocusableItem(-1)}get current(){let e=null;return this.focusTracker.focusedElement===null?null:(this.focusables.find((t,n)=>{const o=t.element===this.focusTracker.focusedElement;return o&&(e=n),o}),e)}focusFirst(){this._focus(this.first)}focusLast(){this._focus(this.last)}focusNext(){this._focus(this.next)}focusPrevious(){this._focus(this.previous)}_focus(e){e&&e.focus()}_getFocusableItem(e){const t=this.current,n=this.focusables.length;if(!n)return null;if(t===null)return this[e===1?"first":"last"];let o=(t+n+e)%n;do{const r=this.focusables.get(o);if(Os(r))return r;o=(o+n+e)%n}while(o!==t);return null}}function Os(i){return!(!i.focus||qt.window.getComputedStyle(i.element).display=="none")}w(25);var Hm='<svg viewBox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"><path d="M.941 4.523a.75.75 0 1 1 1.06-1.06l3.006 3.005 3.005-3.005a.75.75 0 1 1 1.06 1.06l-3.549 3.55a.75.75 0 0 1-1.168-.136L.941 4.523z"/></svg>';class $m extends nn{constructor(e){super(e),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{"aria-haspopup":!0}}),this.delegate("execute").to(this,"open")}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){const e=new Bc;return e.content=Hm,e.extendTemplate({attributes:{class:"ck-dropdown__arrow"}}),e}}w(27);class Um extends gt{constructor(e){super(e);const t=this.bindTemplate;this.set("class"),this.set("icon"),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isToggleable",!1),this.set("isVisible",!0),this.set("keystroke"),this.set("label"),this.set("tabindex",-1),this.set("tooltip"),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.children=this.createCollection(),this.actionView=this._createActionView(),this.arrowView=this._createArrowView(),this.keystrokes=new yo,this.focusTracker=new Lo,this.setTemplate({tag:"div",attributes:{class:["ck","ck-splitbutton",t.to("class"),t.if("isVisible","ck-hidden",n=>!n),this.arrowView.bindTemplate.if("isOn","ck-splitbutton_open")]},children:this.children})}render(){super.render(),this.children.add(this.actionView),this.children.add(this.arrowView),this.focusTracker.add(this.actionView.element),this.focusTracker.add(this.arrowView.element),this.keystrokes.listenTo(this.element),this.keystrokes.set("arrowright",(e,t)=>{this.focusTracker.focusedElement===this.actionView.element&&(this.arrowView.focus(),t())}),this.keystrokes.set("arrowleft",(e,t)=>{this.focusTracker.focusedElement===this.arrowView.element&&(this.actionView.focus(),t())})}focus(){this.actionView.focus()}_createActionView(){const e=new nn;return e.bind("icon","isEnabled","isOn","isToggleable","keystroke","label","tabindex","tooltip","tooltipPosition","type","withText").to(this),e.extendTemplate({attributes:{class:"ck-splitbutton__action"}}),e.delegate("execute").to(this),e}_createArrowView(){const e=new nn,t=e.bindTemplate;return e.icon=Hm,e.extendTemplate({attributes:{class:"ck-splitbutton__arrow","aria-haspopup":!0,"aria-expanded":t.to("isOn",n=>String(n))}}),e.bind("isEnabled").to(this),e.delegate("execute").to(this,"open"),e}}class Og extends gt{constructor(e){super(e);const t=this.bindTemplate;this.set("isVisible",!1),this.set("position","se"),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-dropdown__panel",t.to("position",n=>"ck-dropdown__panel_"+n),t.if("isVisible","ck-dropdown__panel-visible")]},children:this.children,on:{selectstart:t.to(n=>n.preventDefault())}})}focus(){this.children.length&&this.children.first.focus()}focusLast(){if(this.children.length){const e=this.children.last;typeof e.focusLast=="function"?e.focusLast():e.focus()}}}w(29);function Wm({element:i,target:e,positions:t,limiter:n,fitInViewport:o}){Se(e)&&(e=e()),Se(n)&&(n=n());const r=function(_){return _&&_.parentNode?_.offsetParent===qt.document.body?null:_.offsetParent:null}(i),a=new Et(i),c=new Et(e);let d,m;n||o?[m,d]=function(T,E){const{elementRect:P,viewportRect:R}=E,z=P.getArea(),$=function(J,{targetRect:ue,elementRect:xe,limiterRect:He,viewportRect:Qt}){const _t=[],Un=xe.getArea();for(const no of J){const Wn=Id(no,ue,xe);if(!Wn)continue;const[Fo,ho]=Wn;let jo=0,us=0;if(He)if(Qt){const ch=He.getIntersection(Qt);ch&&(jo=ch.getIntersectionArea(ho))}else jo=He.getIntersectionArea(ho);Qt&&(us=Qt.getIntersectionArea(ho));const lh={positionName:Fo,positionRect:ho,limiterIntersectArea:jo,viewportIntersectArea:us};if(jo===Un)return[lh];_t.push(lh)}return _t}(T,E);if(R){const J=Km($.filter(({viewportIntersectArea:ue})=>ue===z),z);if(J)return J}return Km($,z)}(t,{targetRect:c,elementRect:a,limiterRect:n&&new Et(n).getVisible(),viewportRect:o&&new Et(qt.window)})||Id(t[0],c,a):[m,d]=Id(t[0],c,a);let b=Gm(d);return r&&(b=function({left:_,top:T},E){const P=Gm(new Et(E)),R=td(E);return _-=P.left,T-=P.top,_+=E.scrollLeft,T+=E.scrollTop,_-=R.left,T-=R.top,{left:_,top:T}}(b,r)),{left:b.left,top:b.top,name:m}}function Id(i,e,t){const n=i(e,t);if(!n)return null;const{left:o,top:r,name:a}=n;return[a,t.clone().moveTo(o,r)]}function Km(i,e){let t,n,o=0;for(const{positionName:r,positionRect:a,limiterIntersectArea:c,viewportIntersectArea:d}of i){if(c===e)return[r,a];const m=d**2+c**2;m>o&&(o=m,t=a,n=r)}return t?[n,t]:null}function Gm({left:i,top:e}){const{scrollX:t,scrollY:n}=qt.window;return{left:i+t,top:e+n}}class Rs extends gt{constructor(e,t,n){super(e);const o=this.bindTemplate;this.buttonView=t,this.panelView=n,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("class"),this.set("id"),this.set("panelPosition","auto"),this.keystrokes=new yo,this.setTemplate({tag:"div",attributes:{class:["ck","ck-dropdown",o.to("class"),o.if("isEnabled","ck-disabled",r=>!r)],id:o.to("id"),"aria-describedby":o.to("ariaDescribedById")},children:[t,n]}),t.extendTemplate({attributes:{class:["ck-dropdown__button"]}})}render(){super.render(),this.listenTo(this.buttonView,"open",()=>{this.isOpen=!this.isOpen}),this.panelView.bind("isVisible").to(this,"isOpen"),this.on("change:isOpen",()=>{this.isOpen&&(this.panelPosition==="auto"?this.panelView.position=Rs._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:this._panelPositions}).name:this.panelView.position=this.panelPosition)}),this.keystrokes.listenTo(this.element);const e=(t,n)=>{this.isOpen&&(this.buttonView.focus(),this.isOpen=!1,n())};this.keystrokes.set("arrowdown",(t,n)=>{this.buttonView.isEnabled&&!this.isOpen&&(this.isOpen=!0,n())}),this.keystrokes.set("arrowright",(t,n)=>{this.isOpen&&n()}),this.keystrokes.set("arrowleft",e),this.keystrokes.set("esc",e)}focus(){this.buttonView.focus()}get _panelPositions(){const{south:e,north:t,southEast:n,southWest:o,northEast:r,northWest:a,southMiddleEast:c,southMiddleWest:d,northMiddleEast:m,northMiddleWest:b}=Rs.defaultPanelPositions;return this.locale.uiLanguageDirection!=="rtl"?[n,o,c,d,e,r,a,m,b,t]:[o,n,d,c,e,a,r,b,m,t]}}Rs.defaultPanelPositions={south:(i,e)=>({top:i.bottom,left:i.left-(e.width-i.width)/2,name:"s"}),southEast:i=>({top:i.bottom,left:i.left,name:"se"}),southWest:(i,e)=>({top:i.bottom,left:i.left-e.width+i.width,name:"sw"}),southMiddleEast:(i,e)=>({top:i.bottom,left:i.left-(e.width-i.width)/4,name:"sme"}),southMiddleWest:(i,e)=>({top:i.bottom,left:i.left-3*(e.width-i.width)/4,name:"smw"}),north:(i,e)=>({top:i.top-e.height,left:i.left-(e.width-i.width)/2,name:"n"}),northEast:(i,e)=>({top:i.top-e.height,left:i.left,name:"ne"}),northWest:(i,e)=>({top:i.top-e.height,left:i.left-e.width+i.width,name:"nw"}),northMiddleEast:(i,e)=>({top:i.top-e.height,left:i.left-(e.width-i.width)/4,name:"nme"}),northMiddleWest:(i,e)=>({top:i.top-e.height,left:i.left-3*(e.width-i.width)/4,name:"nmw"})},Rs._getOptimalPosition=Wm;class Qm extends gt{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__separator"]}})}}class Rg extends gt{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__line-break"]}})}}function Ym(i){return Array.isArray(i)?{items:i,removeItems:[]}:i?Object.assign({items:[],removeItems:[]},i):{items:[],removeItems:[]}}w(31);class Pd extends gt{constructor(e,t){super(e);const n=this.bindTemplate,o=this.t;this.options=t||{},this.set("ariaLabel",o("Editor toolbar")),this.set("maxWidth","auto"),this.items=this.createCollection(),this.focusTracker=new Lo,this.keystrokes=new yo,this.set("class"),this.set("isCompact",!1),this.itemsView=new Vg(e),this.children=this.createCollection(),this.children.add(this.itemsView),this.focusables=this.createCollection();const r=e.uiLanguageDirection==="rtl";this._focusCycler=new Ms({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:[r?"arrowright":"arrowleft","arrowup"],focusNext:[r?"arrowleft":"arrowright","arrowdown"]}});const a=["ck","ck-toolbar",n.to("class"),n.if("isCompact","ck-toolbar_compact")];var c;this.options.shouldGroupWhenFull&&this.options.isFloating&&a.push("ck-toolbar_floating"),this.setTemplate({tag:"div",attributes:{class:a,role:"toolbar","aria-label":n.to("ariaLabel"),style:{maxWidth:n.to("maxWidth")}},children:this.children,on:{mousedown:(c=this,c.bindTemplate.to(d=>{d.target===c.element&&d.preventDefault()}))}}),this._behavior=this.options.shouldGroupWhenFull?new zg(this):new Lg(this)}render(){super.render();for(const e of this.items)this.focusTracker.add(e.element);this.items.on("add",(e,t)=>{this.focusTracker.add(t.element)}),this.items.on("remove",(e,t)=>{this.focusTracker.remove(t.element)}),this.keystrokes.listenTo(this.element),this._behavior.render(this)}destroy(){return this._behavior.destroy(),super.destroy()}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}fillFromConfig(e,t){const n=Ym(e),o=n.items.filter((a,c,d)=>a==="|"||n.removeItems.indexOf(a)===-1&&(a==="-"?!this.options.shouldGroupWhenFull||(Object(C.b)("toolbarview-line-break-ignored-when-grouping-items",d),!1):!!t.has(a)||(Object(C.b)("toolbarview-item-unavailable",{name:a}),!1))),r=this._cleanSeparators(o).map(a=>a==="|"?new Qm:a==="-"?new Rg:t.create(a));this.items.addMany(r)}_cleanSeparators(e){const t=a=>a!=="-"&&a!=="|",n=e.length,o=e.findIndex(t),r=n-e.slice().reverse().findIndex(t);return e.slice(o,r).filter((a,c,d)=>t(a)?!0:!(c>0&&d[c-1]===a))}}class Vg extends gt{constructor(e){super(e),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-toolbar__items"]},children:this.children})}}class Lg{constructor(e){const t=e.bindTemplate;e.set("isVertical",!1),e.itemsView.children.bindTo(e.items).using(n=>n),e.focusables.bindTo(e.items).using(n=>n),e.extendTemplate({attributes:{class:[t.if("isVertical","ck-toolbar_vertical")]}})}render(){}destroy(){}}class zg{constructor(e){this.view=e,this.viewChildren=e.children,this.viewFocusables=e.focusables,this.viewItemsView=e.itemsView,this.viewFocusTracker=e.focusTracker,this.viewLocale=e.locale,this.ungroupedItems=e.createCollection(),this.groupedItems=e.createCollection(),this.groupedItemsDropdown=this._createGroupedItemsDropdown(),this.resizeObserver=null,this.cachedPadding=null,this.shouldUpdateGroupingOnNextResize=!1,e.itemsView.children.bindTo(this.ungroupedItems).using(t=>t),this.ungroupedItems.on("add",this._updateFocusCycleableItems.bind(this)),this.ungroupedItems.on("remove",this._updateFocusCycleableItems.bind(this)),e.children.on("add",this._updateFocusCycleableItems.bind(this)),e.children.on("remove",this._updateFocusCycleableItems.bind(this)),e.items.on("change",(t,n)=>{const o=n.index;for(const r of n.removed)o>=this.ungroupedItems.length?this.groupedItems.remove(r):this.ungroupedItems.remove(r);for(let r=o;r<o+n.added.length;r++){const a=n.added[r-o];r>this.ungroupedItems.length?this.groupedItems.add(a,r-this.ungroupedItems.length):this.ungroupedItems.add(a,r)}this._updateGrouping()}),e.extendTemplate({attributes:{class:["ck-toolbar_grouping"]}})}render(e){this.viewElement=e.element,this._enableGroupingOnResize(),this._enableGroupingOnMaxWidthChange(e)}destroy(){this.groupedItemsDropdown.destroy(),this.resizeObserver.destroy()}_updateGrouping(){if(!this.viewElement.ownerDocument.body.contains(this.viewElement))return;if(!this.viewElement.offsetParent)return void(this.shouldUpdateGroupingOnNextResize=!0);const e=this.groupedItems.length;let t;for(;this._areItemsOverflowing;)this._groupLastItem(),t=!0;if(!t&&this.groupedItems.length){for(;this.groupedItems.length&&!this._areItemsOverflowing;)this._ungroupFirstItem();this._areItemsOverflowing&&this._groupLastItem()}this.groupedItems.length!==e&&this.view.fire("groupedItemsUpdate")}get _areItemsOverflowing(){if(!this.ungroupedItems.length)return!1;const e=this.viewElement,t=this.viewLocale.uiLanguageDirection,n=new Et(e.lastChild),o=new Et(e);if(!this.cachedPadding){const r=qt.window.getComputedStyle(e),a=t==="ltr"?"paddingRight":"paddingLeft";this.cachedPadding=Number.parseInt(r[a])}return t==="ltr"?n.right>o.right-this.cachedPadding:n.left<o.left+this.cachedPadding}_enableGroupingOnResize(){let e;this.resizeObserver=new tn(this.viewElement,t=>{e&&e===t.contentRect.width&&!this.shouldUpdateGroupingOnNextResize||(this.shouldUpdateGroupingOnNextResize=!1,this._updateGrouping(),e=t.contentRect.width)}),this._updateGrouping()}_enableGroupingOnMaxWidthChange(e){e.on("change:maxWidth",()=>{this._updateGrouping()})}_groupLastItem(){this.groupedItems.length||(this.viewChildren.add(new Qm),this.viewChildren.add(this.groupedItemsDropdown),this.viewFocusTracker.add(this.groupedItemsDropdown.element)),this.groupedItems.add(this.ungroupedItems.remove(this.ungroupedItems.last),0)}_ungroupFirstItem(){this.ungroupedItems.add(this.groupedItems.remove(this.groupedItems.first)),this.groupedItems.length||(this.viewChildren.remove(this.groupedItemsDropdown),this.viewChildren.remove(this.viewChildren.last),this.viewFocusTracker.remove(this.groupedItemsDropdown.element))}_createGroupedItemsDropdown(){const e=this.viewLocale,t=e.t,n=rs(e);return n.class="ck-toolbar__grouped-dropdown",n.panelPosition=e.uiLanguageDirection==="ltr"?"sw":"se",Zm(n,[]),n.buttonView.set({label:t("Show more items"),tooltip:!0,tooltipPosition:e.uiLanguageDirection==="rtl"?"se":"sw",icon:Co.threeVerticalDots}),n.toolbarView.items.bindTo(this.groupedItems).using(o=>o),n}_updateFocusCycleableItems(){this.viewFocusables.clear(),this.ungroupedItems.map(e=>{this.viewFocusables.add(e)}),this.groupedItems.length&&this.viewFocusables.add(this.groupedItemsDropdown)}}w(33);class Xm extends gt{constructor(){super(),this.items=this.createCollection(),this.focusTracker=new Lo,this.keystrokes=new yo,this._focusCycler=new Ms({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowup",focusNext:"arrowdown"}}),this.setTemplate({tag:"ul",attributes:{class:["ck","ck-reset","ck-list"]},children:this.items})}render(){super.render();for(const e of this.items)this.focusTracker.add(e.element);this.items.on("add",(e,t)=>{this.focusTracker.add(t.element)}),this.items.on("remove",(e,t)=>{this.focusTracker.remove(t.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}}class Jm extends gt{constructor(e){super(e),this.children=this.createCollection(),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__item"]},children:this.children})}focus(){this.children.first.focus()}}class Bg extends gt{constructor(e){super(e),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__separator"]}})}}w(35),w(37);function rs(i,e=$m){const t=new e(i),n=new Og(i),o=new Rs(i,t,n);return t.bind("isEnabled").to(o),t instanceof $m?t.bind("isOn").to(o,"isOpen"):t.arrowView.bind("isOn").to(o,"isOpen"),function(r){(function(a){a.on("render",()=>{Ed({emitter:a,activator:()=>a.isOpen,callback:()=>{a.isOpen=!1},contextElements:[a.element]})})})(r),function(a){a.on("execute",c=>{c.source instanceof Fc||(a.isOpen=!1)})}(r),function(a){a.keystrokes.set("arrowdown",(c,d)=>{a.isOpen&&(a.panelView.focus(),d())}),a.keystrokes.set("arrowup",(c,d)=>{a.isOpen&&(a.panelView.focusLast(),d())})}(r)}(o),o}function Zm(i,e){const t=i.locale,n=t.t,o=i.toolbarView=new Pd(t);o.set("ariaLabel",n("Dropdown toolbar")),i.extendTemplate({attributes:{class:["ck-toolbar-dropdown"]}}),e.map(r=>o.items.add(r)),i.panelView.children.add(o),o.items.delegate("execute").to(i)}function ef(i,e){const t=i.locale,n=i.listView=new Xm(t);n.items.bindTo(e).using(({type:o,model:r})=>{if(o==="separator")return new Bg(t);if(o==="button"||o==="switchbutton"){const a=new Jm(t);let c;return c=o==="button"?new nn(t):new Fc(t),c.bind(...Object.keys(r)).to(r),c.delegate("execute").to(a),a.children.add(c),a}}),i.panelView.children.add(n),n.items.delegate("execute").to(i)}w(39);class qc extends gt{constructor(e){super(e),this.body=new Mg(e)}render(){super.render(),this.body.attachToDom()}destroy(){return this.body.detachFromDom(),super.destroy()}}w(41);class tf extends gt{constructor(e){super(e),this.set("text"),this.set("for"),this.id="ck-editor__label_"+S();const t=this.bindTemplate;this.setTemplate({tag:"label",attributes:{class:["ck","ck-label"],id:this.id,for:t.to("for")},children:[{text:t.to("text")}]})}}class Fg extends qc{constructor(e){super(e),this.top=this.createCollection(),this.main=this.createCollection(),this._voiceLabelView=this._createVoiceLabel(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-editor","ck-rounded-corners"],role:"application",dir:e.uiLanguageDirection,lang:e.uiLanguage,"aria-labelledby":this._voiceLabelView.id},children:[this._voiceLabelView,{tag:"div",attributes:{class:["ck","ck-editor__top","ck-reset_all"],role:"presentation"},children:this.top},{tag:"div",attributes:{class:["ck","ck-editor__main"],role:"presentation"},children:this.main}]})}_createVoiceLabel(){const e=this.t,t=new tf;return t.text=e("Rich Text Editor"),t.extendTemplate({attributes:{class:"ck-voice-label"}}),t}}class qg extends gt{constructor(e,t,n){super(e),this.setTemplate({tag:"div",attributes:{class:["ck","ck-content","ck-editor__editable","ck-rounded-corners"],lang:e.contentLanguage,dir:e.contentLanguageDirection}}),this.name=null,this.set("isFocused",!1),this._editableElement=n,this._hasExternalElement=!!this._editableElement,this._editingView=t}render(){super.render(),this._hasExternalElement?this.template.apply(this.element=this._editableElement):this._editableElement=this.element,this.on("change:isFocused",()=>this._updateIsFocusedClasses()),this._updateIsFocusedClasses()}destroy(){this._hasExternalElement&&this.template.revert(this._editableElement),super.destroy()}_updateIsFocusedClasses(){const e=this._editingView;function t(n){e.change(o=>{const r=e.document.getRoot(n.name);o.addClass(n.isFocused?"ck-focused":"ck-blurred",r),o.removeClass(n.isFocused?"ck-blurred":"ck-focused",r)})}e.isRenderingInProgress?function n(o){e.once("change:isRenderingInProgress",(r,a,c)=>{c?n(o):t(o)})}(this):t(this)}}class Hg extends qg{constructor(e,t,n){super(e,t,n),this.extendTemplate({attributes:{role:"textbox",class:"ck-editor__editable_inline"}})}render(){super.render();const e=this._editingView,t=this.t;e.change(n=>{const o=e.document.getRoot(this.name);n.setAttribute("aria-label",t("Rich Text Editor, %0",this.name),o)})}}w(43),w(45);class $g extends gt{constructor(e){super(e),this.set("value"),this.set("id"),this.set("placeholder"),this.set("isReadOnly",!1),this.set("hasError",!1),this.set("ariaDescribedById"),this.focusTracker=new Lo,this.bind("isFocused").to(this.focusTracker),this.set("isEmpty",!0);const t=this.bindTemplate;this.setTemplate({tag:"input",attributes:{type:"text",class:["ck","ck-input","ck-input-text",t.if("isFocused","ck-input_focused"),t.if("isEmpty","ck-input-text_empty"),t.if("hasError","ck-error")],id:t.to("id"),placeholder:t.to("placeholder"),readonly:t.to("isReadOnly"),"aria-invalid":t.if("hasError",!0),"aria-describedby":t.to("ariaDescribedById")},on:{input:t.to("input"),change:t.to(this._updateIsEmpty.bind(this))}})}render(){super.render(),this.focusTracker.add(this.element),this._setDomElementValue(this.value),this._updateIsEmpty(),this.on("change:value",(e,t,n)=>{this._setDomElementValue(n),this._updateIsEmpty()})}select(){this.element.select()}focus(){this.element.focus()}_updateIsEmpty(){this.isEmpty=!this.element.value}_setDomElementValue(e){this.element.value=e||e===0?e:""}}w(47);class Md extends gt{constructor(e,t){super(e);const n="ck-labeled-field-view-"+S(),o="ck-labeled-field-view-status-"+S();this.fieldView=t(this,n,o),this.set("label"),this.set("isEnabled",!0),this.set("isEmpty",!0),this.set("isFocused",!1),this.set("errorText",null),this.set("infoText",null),this.set("class"),this.set("placeholder"),this.labelView=this._createLabelView(n),this.statusView=this._createStatusView(o),this.bind("_statusText").to(this,"errorText",this,"infoText",(a,c)=>a||c);const r=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view",r.to("class"),r.if("isEnabled","ck-disabled",a=>!a),r.if("isEmpty","ck-labeled-field-view_empty"),r.if("isFocused","ck-labeled-field-view_focused"),r.if("placeholder","ck-labeled-field-view_placeholder"),r.if("errorText","ck-error")]},children:[{tag:"div",attributes:{class:["ck","ck-labeled-field-view__input-wrapper"]},children:[this.fieldView,this.labelView]},this.statusView]})}_createLabelView(e){const t=new tf(this.locale);return t.for=e,t.bind("text").to(this,"label"),t}_createStatusView(e){const t=new gt(this.locale),n=this.bindTemplate;return t.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view__status",n.if("errorText","ck-labeled-field-view__status_error"),n.if("_statusText","ck-hidden",o=>!o)],id:e,role:n.if("errorText","alert")},children:[{text:n.to("_statusText")}]}),t}focus(){this.fieldView.focus()}}function Od(i,e,t){const n=new $g(i.locale);return n.set({id:e,ariaDescribedById:t}),n.bind("isReadOnly").to(i,"isEnabled",o=>!o),n.bind("hasError").to(i,"errorText",o=>!!o),n.on("input",()=>{i.errorText=null}),i.bind("isEmpty","isFocused","placeholder").to(n),n}class Rd extends I{static get pluginName(){return"Notification"}init(){this.on("show:warning",(e,t)=>{window.alert(t.message)},{priority:"lowest"})}showSuccess(e,t={}){this._showNotification({message:e,type:"success",namespace:t.namespace,title:t.title})}showInfo(e,t={}){this._showNotification({message:e,type:"info",namespace:t.namespace,title:t.title})}showWarning(e,t={}){this._showNotification({message:e,type:"warning",namespace:t.namespace,title:t.title})}_showNotification(e){const t="show:"+e.type+(e.namespace?":"+e.namespace:"");this.fire(t,{message:e.message,type:e.type,title:e.title||""})}}class Vd{constructor(e,t){t&&Mr(this,t),e&&this.set(e)}}Be(Vd,Wt),w(49);const nf=dt("px"),of=qt.document.body;class ht extends gt{constructor(e){super(e);const t=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("position","arrow_nw"),this.set("isVisible",!1),this.set("withArrow",!0),this.set("class"),this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-panel",t.to("position",n=>"ck-balloon-panel_"+n),t.if("isVisible","ck-balloon-panel_visible"),t.if("withArrow","ck-balloon-panel_with-arrow"),t.to("class")],style:{top:t.to("top",nf),left:t.to("left",nf)}},children:this.content})}show(){this.isVisible=!0}hide(){this.isVisible=!1}attachTo(e){this.show();const t=ht.defaultPositions,n=Object.assign({},{element:this.element,positions:[t.southArrowNorth,t.southArrowNorthMiddleWest,t.southArrowNorthMiddleEast,t.southArrowNorthWest,t.southArrowNorthEast,t.northArrowSouth,t.northArrowSouthMiddleWest,t.northArrowSouthMiddleEast,t.northArrowSouthWest,t.northArrowSouthEast],limiter:of,fitInViewport:!0},e),o=ht._getOptimalPosition(n),r=parseInt(o.left),a=parseInt(o.top),c=o.name;Object.assign(this,{top:a,left:r,position:c})}pin(e){this.unpin(),this._pinWhenIsVisibleCallback=()=>{this.isVisible?this._startPinning(e):this._stopPinning()},this._startPinning(e),this.listenTo(this,"change:isVisible",this._pinWhenIsVisibleCallback)}unpin(){this._pinWhenIsVisibleCallback&&(this._stopPinning(),this.stopListening(this,"change:isVisible",this._pinWhenIsVisibleCallback),this._pinWhenIsVisibleCallback=null,this.hide())}_startPinning(e){this.attachTo(e);const t=Ld(e.target),n=e.limiter?Ld(e.limiter):of;this.listenTo(qt.document,"scroll",(o,r)=>{const a=r.target,c=t&&a.contains(t),d=n&&a.contains(n);!c&&!d&&t&&n||this.attachTo(e)},{useCapture:!0}),this.listenTo(qt.window,"resize",()=>{this.attachTo(e)})}_stopPinning(){this.stopListening(qt.document,"scroll"),this.stopListening(qt.window,"resize")}}function Ld(i){return Mo(i)?i:gc(i)?i.commonAncestorContainer:typeof i=="function"?Ld(i()):null}function qn(i,e){return i.top-e.height-ht.arrowVerticalOffset}function Hn(i){return i.bottom+ht.arrowVerticalOffset}ht.arrowHorizontalOffset=25,ht.arrowVerticalOffset=10,ht._getOptimalPosition=Wm,ht.defaultPositions={northWestArrowSouthWest:(i,e)=>({top:qn(i,e),left:i.left-ht.arrowHorizontalOffset,name:"arrow_sw"}),northWestArrowSouthMiddleWest:(i,e)=>({top:qn(i,e),left:i.left-.25*e.width-ht.arrowHorizontalOffset,name:"arrow_smw"}),northWestArrowSouth:(i,e)=>({top:qn(i,e),left:i.left-e.width/2,name:"arrow_s"}),northWestArrowSouthMiddleEast:(i,e)=>({top:qn(i,e),left:i.left-.75*e.width+ht.arrowHorizontalOffset,name:"arrow_sme"}),northWestArrowSouthEast:(i,e)=>({top:qn(i,e),left:i.left-e.width+ht.arrowHorizontalOffset,name:"arrow_se"}),northArrowSouthWest:(i,e)=>({top:qn(i,e),left:i.left+i.width/2-ht.arrowHorizontalOffset,name:"arrow_sw"}),northArrowSouthMiddleWest:(i,e)=>({top:qn(i,e),left:i.left+i.width/2-.25*e.width-ht.arrowHorizontalOffset,name:"arrow_smw"}),northArrowSouth:(i,e)=>({top:qn(i,e),left:i.left+i.width/2-e.width/2,name:"arrow_s"}),northArrowSouthMiddleEast:(i,e)=>({top:qn(i,e),left:i.left+i.width/2-.75*e.width+ht.arrowHorizontalOffset,name:"arrow_sme"}),northArrowSouthEast:(i,e)=>({top:qn(i,e),left:i.left+i.width/2-e.width+ht.arrowHorizontalOffset,name:"arrow_se"}),northEastArrowSouthWest:(i,e)=>({top:qn(i,e),left:i.right-ht.arrowHorizontalOffset,name:"arrow_sw"}),northEastArrowSouthMiddleWest:(i,e)=>({top:qn(i,e),left:i.right-.25*e.width-ht.arrowHorizontalOffset,name:"arrow_smw"}),northEastArrowSouth:(i,e)=>({top:qn(i,e),left:i.right-e.width/2,name:"arrow_s"}),northEastArrowSouthMiddleEast:(i,e)=>({top:qn(i,e),left:i.right-.75*e.width+ht.arrowHorizontalOffset,name:"arrow_sme"}),northEastArrowSouthEast:(i,e)=>({top:qn(i,e),left:i.right-e.width+ht.arrowHorizontalOffset,name:"arrow_se"}),southWestArrowNorthWest:(i,e)=>({top:Hn(i),left:i.left-ht.arrowHorizontalOffset,name:"arrow_nw"}),southWestArrowNorthMiddleWest:(i,e)=>({top:Hn(i),left:i.left-.25*e.width-ht.arrowHorizontalOffset,name:"arrow_nmw"}),southWestArrowNorth:(i,e)=>({top:Hn(i),left:i.left-e.width/2,name:"arrow_n"}),southWestArrowNorthMiddleEast:(i,e)=>({top:Hn(i),left:i.left-.75*e.width+ht.arrowHorizontalOffset,name:"arrow_nme"}),southWestArrowNorthEast:(i,e)=>({top:Hn(i),left:i.left-e.width+ht.arrowHorizontalOffset,name:"arrow_ne"}),southArrowNorthWest:(i,e)=>({top:Hn(i),left:i.left+i.width/2-ht.arrowHorizontalOffset,name:"arrow_nw"}),southArrowNorthMiddleWest:(i,e)=>({top:Hn(i),left:i.left+i.width/2-.25*e.width-ht.arrowHorizontalOffset,name:"arrow_nmw"}),southArrowNorth:(i,e)=>({top:Hn(i),left:i.left+i.width/2-e.width/2,name:"arrow_n"}),southArrowNorthMiddleEast:(i,e)=>({top:Hn(i),left:i.left+i.width/2-.75*e.width+ht.arrowHorizontalOffset,name:"arrow_nme"}),southArrowNorthEast:(i,e)=>({top:Hn(i),left:i.left+i.width/2-e.width+ht.arrowHorizontalOffset,name:"arrow_ne"}),southEastArrowNorthWest:(i,e)=>({top:Hn(i),left:i.right-ht.arrowHorizontalOffset,name:"arrow_nw"}),southEastArrowNorthMiddleWest:(i,e)=>({top:Hn(i),left:i.right-.25*e.width-ht.arrowHorizontalOffset,name:"arrow_nmw"}),southEastArrowNorth:(i,e)=>({top:Hn(i),left:i.right-e.width/2,name:"arrow_n"}),southEastArrowNorthMiddleEast:(i,e)=>({top:Hn(i),left:i.right-.75*e.width+ht.arrowHorizontalOffset,name:"arrow_nme"}),southEastArrowNorthEast:(i,e)=>({top:Hn(i),left:i.right-e.width+ht.arrowHorizontalOffset,name:"arrow_ne"})},w(51),w(53);const Vs=dt("px");class cl extends ve{static get pluginName(){return"ContextualBalloon"}constructor(e){super(e),this.positionLimiter=()=>{const t=this.editor.editing.view,n=t.document.selection.editableElement;return n?t.domConverter.mapViewToDom(n.root):null},this.set("visibleView",null),this.view=new ht(e.locale),e.ui.view.body.add(this.view),e.ui.focusTracker.add(this.view.element),this._viewToStack=new Map,this._idToStack=new Map,this.set("_numberOfStacks",0),this.set("_singleViewMode",!1),this._rotatorView=this._createRotatorView(),this._fakePanelsView=this._createFakePanelsView()}hasView(e){return Array.from(this._viewToStack.keys()).includes(e)}add(e){if(this.hasView(e.view))throw new C.a("contextualballoon-add-view-exist",[this,e]);const t=e.stackId||"main";if(!this._idToStack.has(t))return this._idToStack.set(t,new Map([[e.view,e]])),this._viewToStack.set(e.view,this._idToStack.get(t)),this._numberOfStacks=this._idToStack.size,void(this._visibleStack&&!e.singleViewMode||this.showStack(t));const n=this._idToStack.get(t);e.singleViewMode&&this.showStack(t),n.set(e.view,e),this._viewToStack.set(e.view,n),n===this._visibleStack&&this._showView(e)}remove(e){if(!this.hasView(e))throw new C.a("contextualballoon-remove-view-not-exist",[this,e]);const t=this._viewToStack.get(e);this._singleViewMode&&this.visibleView===e&&(this._singleViewMode=!1),this.visibleView===e&&(t.size===1?this._idToStack.size>1?this._showNextStack():(this.view.hide(),this.visibleView=null,this._rotatorView.hideView()):this._showView(Array.from(t.values())[t.size-2])),t.size===1?(this._idToStack.delete(this._getStackId(t)),this._numberOfStacks=this._idToStack.size):t.delete(e),this._viewToStack.delete(e)}updatePosition(e){e&&(this._visibleStack.get(this.visibleView).position=e),this.view.pin(this._getBalloonPosition()),this._fakePanelsView.updatePosition()}showStack(e){this.visibleStack=e;const t=this._idToStack.get(e);if(!t)throw new C.a("contextualballoon-showstack-stack-not-exist",this);this._visibleStack!==t&&this._showView(Array.from(t.values()).pop())}get _visibleStack(){return this._viewToStack.get(this.visibleView)}_getStackId(e){return Array.from(this._idToStack.entries()).find(t=>t[1]===e)[0]}_showNextStack(){const e=Array.from(this._idToStack.values());let t=e.indexOf(this._visibleStack)+1;e[t]||(t=0),this.showStack(this._getStackId(e[t]))}_showPrevStack(){const e=Array.from(this._idToStack.values());let t=e.indexOf(this._visibleStack)-1;e[t]||(t=e.length-1),this.showStack(this._getStackId(e[t]))}_createRotatorView(){const e=new rf(this.editor.locale),t=this.editor.locale.t;return this.view.content.add(e),e.bind("isNavigationVisible").to(this,"_numberOfStacks",this,"_singleViewMode",(n,o)=>!o&&n>1),e.on("change:isNavigationVisible",()=>this.updatePosition(),{priority:"low"}),e.bind("counter").to(this,"visibleView",this,"_numberOfStacks",(n,o)=>{if(o<2)return"";const r=Array.from(this._idToStack.values()).indexOf(this._visibleStack)+1;return t("%0 of %1",[r,o])}),e.buttonNextView.on("execute",()=>{e.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showNextStack()}),e.buttonPrevView.on("execute",()=>{e.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showPrevStack()}),e}_createFakePanelsView(){const e=new sf(this.editor.locale,this.view);return e.bind("numberOfPanels").to(this,"_numberOfStacks",this,"_singleViewMode",(t,n)=>!n&&t>=2?Math.min(t-1,2):0),e.listenTo(this.view,"change:top",()=>e.updatePosition()),e.listenTo(this.view,"change:left",()=>e.updatePosition()),this.editor.ui.view.body.add(e),e}_showView({view:e,balloonClassName:t="",withArrow:n=!0,singleViewMode:o=!1}){this.view.class=t,this.view.withArrow=n,this._rotatorView.showView(e),this.visibleView=e,this.view.pin(this._getBalloonPosition()),this._fakePanelsView.updatePosition(),o&&(this._singleViewMode=!0)}_getBalloonPosition(){let e=Array.from(this._visibleStack.values()).pop().position;return e&&!e.limiter&&(e=Object.assign({},e,{limiter:this.positionLimiter})),e}}class rf extends gt{constructor(e){super(e);const t=e.t,n=this.bindTemplate;this.set("isNavigationVisible",!0),this.focusTracker=new Lo,this.buttonPrevView=this._createButtonView(t("Previous"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M11.463 5.187a.888.888 0 1 1 1.254 1.255L9.16 10l3.557 3.557a.888.888 0 1 1-1.254 1.255L7.26 10.61a.888.888 0 0 1 .16-1.382l4.043-4.042z"/></svg>'),this.buttonNextView=this._createButtonView(t("Next"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M8.537 14.813a.888.888 0 1 1-1.254-1.255L10.84 10 7.283 6.442a.888.888 0 1 1 1.254-1.255L12.74 9.39a.888.888 0 0 1-.16 1.382l-4.043 4.042z"/></svg>'),this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-rotator"],"z-index":"-1"},children:[{tag:"div",attributes:{class:["ck-balloon-rotator__navigation",n.to("isNavigationVisible",o=>o?"":"ck-hidden")]},children:[this.buttonPrevView,{tag:"span",attributes:{class:["ck-balloon-rotator__counter"]},children:[{text:n.to("counter")}]},this.buttonNextView]},{tag:"div",attributes:{class:"ck-balloon-rotator__content"},children:this.content}]})}render(){super.render(),this.focusTracker.add(this.element)}showView(e){this.hideView(),this.content.add(e)}hideView(){this.content.clear()}_createButtonView(e,t){const n=new nn(this.locale);return n.set({label:e,icon:t,tooltip:!0}),n}}class sf extends gt{constructor(e,t){super(e);const n=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("height",0),this.set("width",0),this.set("numberOfPanels",0),this.content=this.createCollection(),this._balloonPanelView=t,this.setTemplate({tag:"div",attributes:{class:["ck-fake-panel",n.to("numberOfPanels",o=>o?"":"ck-hidden")],style:{top:n.to("top",Vs),left:n.to("left",Vs),width:n.to("width",Vs),height:n.to("height",Vs)}},children:this.content}),this.on("change:numberOfPanels",(o,r,a,c)=>{a>c?this._addPanels(a-c):this._removePanels(c-a),this.updatePosition()})}_addPanels(e){for(;e--;){const t=new gt;t.setTemplate({tag:"div"}),this.content.add(t),this.registerChild(t)}}_removePanels(e){for(;e--;){const t=this.content.last;this.content.remove(t),this.deregisterChild(t),t.destroy()}}updatePosition(){if(this.numberOfPanels){const{top:e,left:t}=this._balloonPanelView,{width:n,height:o}=new Et(this._balloonPanelView.element);Object.assign(this,{top:e,left:t,width:n,height:o})}}}w(55);const Ls=dt("px");class Ug extends gt{constructor(e){super(e);const t=this.bindTemplate;this.set("isActive",!1),this.set("isSticky",!1),this.set("limiterElement",null),this.set("limiterBottomOffset",50),this.set("viewportTopOffset",0),this.set("_marginLeft",null),this.set("_isStickyToTheLimiter",!1),this.set("_hasViewportTopOffset",!1),this.content=this.createCollection(),this._contentPanelPlaceholder=new Eo({tag:"div",attributes:{class:["ck","ck-sticky-panel__placeholder"],style:{display:t.to("isSticky",n=>n?"block":"none"),height:t.to("isSticky",n=>n?Ls(this._panelRect.height):null)}}}).render(),this._contentPanel=new Eo({tag:"div",attributes:{class:["ck","ck-sticky-panel__content",t.if("isSticky","ck-sticky-panel__content_sticky"),t.if("_isStickyToTheLimiter","ck-sticky-panel__content_sticky_bottom-limit")],style:{width:t.to("isSticky",n=>n?Ls(this._contentPanelPlaceholder.getBoundingClientRect().width):null),top:t.to("_hasViewportTopOffset",n=>n?Ls(this.viewportTopOffset):null),bottom:t.to("_isStickyToTheLimiter",n=>n?Ls(this.limiterBottomOffset):null),marginLeft:t.to("_marginLeft")}},children:this.content}).render(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-sticky-panel"]},children:[this._contentPanelPlaceholder,this._contentPanel]})}render(){super.render(),this._checkIfShouldBeSticky(),this.listenTo(qt.window,"scroll",()=>{this._checkIfShouldBeSticky()}),this.listenTo(this,"change:isActive",()=>{this._checkIfShouldBeSticky()})}_checkIfShouldBeSticky(){const e=this._panelRect=this._contentPanel.getBoundingClientRect();let t;this.limiterElement?(t=this._limiterRect=this.limiterElement.getBoundingClientRect(),this.isSticky=this.isActive&&t.top<this.viewportTopOffset&&this._panelRect.height+this.limiterBottomOffset<t.height):this.isSticky=!1,this.isSticky?(this._isStickyToTheLimiter=t.bottom<e.height+this.limiterBottomOffset+this.viewportTopOffset,this._hasViewportTopOffset=!this._isStickyToTheLimiter&&!!this.viewportTopOffset,this._marginLeft=this._isStickyToTheLimiter?null:Ls(-qt.window.scrollX)):(this._isStickyToTheLimiter=!1,this._hasViewportTopOffset=!1,this._marginLeft=null)}}w(57),w(59);const Hc=new WeakMap;function af(i){const{view:e,element:t,text:n,isDirectHost:o=!0,keepOnFocus:r=!1}=i,a=e.document;Hc.has(a)||(Hc.set(a,new Map),a.registerPostFixer(c=>ul(a,c))),Hc.get(a).set(t,{text:n,isDirectHost:o,keepOnFocus:r,hostElement:o?t:null}),e.change(c=>ul(a,c))}function $c(i,e){return!!e.hasClass("ck-placeholder")&&(i.removeClass("ck-placeholder",e),!0)}function ul(i,e){const t=Hc.get(i),n=[];let o=!1;for(const[r,a]of t)a.isDirectHost&&(n.push(r),lf(e,r,a)&&(o=!0));for(const[r,a]of t){if(a.isDirectHost)continue;const c=Wg(r);c&&(n.includes(c)||(a.hostElement=c,lf(e,r,a)&&(o=!0)))}return o}function lf(i,e,t){const{text:n,isDirectHost:o,hostElement:r}=t;let a=!1;return r.getAttribute("data-placeholder")!==n&&(i.setAttribute("data-placeholder",n,r),a=!0),(o||e.childCount==1)&&function(c,d){if(!c.isAttached()||Array.from(c.getChildren()).some(_=>!_.is("uiElement")))return!1;if(d)return!0;const m=c.document;if(!m.isFocused)return!0;const b=m.selection.anchor;return b&&b.parent!==c}(r,t.keepOnFocus)?function(c,d){return!d.hasClass("ck-placeholder")&&(c.addClass("ck-placeholder",d),!0)}(i,r)&&(a=!0):$c(i,r)&&(a=!0),a}function Wg(i){if(i.childCount){const e=i.getChild(0);if(e.is("element")&&!e.is("uiElement"))return e}return null}const dl=new Map;function yt(i,e,t){let n=dl.get(i);n||(n=new Map,dl.set(i,n)),n.set(e,t)}function Kg(i){return[i]}function cf(i,e,t={}){const n=function(o,r){const a=dl.get(o);return a&&a.has(r)?a.get(r):Kg}(i.constructor,e.constructor);try{return n(i=i.clone(),e,t)}catch(o){throw o}}function Gg(i,e,t){i=i.slice(),e=e.slice();const n=new Qg(t.document,t.useRelations,t.forceWeakRemove);n.setOriginalOperations(i),n.setOriginalOperations(e);const o=n.originalOperations;if(i.length==0||e.length==0)return{operationsA:i,operationsB:e,originalOperations:o};const r=new WeakMap;for(const d of i)r.set(d,0);const a={nextBaseVersionA:i[i.length-1].baseVersion+1,nextBaseVersionB:e[e.length-1].baseVersion+1,originalOperationsACount:i.length,originalOperationsBCount:e.length};let c=0;for(;c<i.length;){const d=i[c],m=r.get(d);if(m==e.length){c++;continue}const b=e[m],_=cf(d,b,n.getContext(d,b,!0)),T=cf(b,d,n.getContext(b,d,!1));n.updateRelation(d,b),n.setOriginalOperations(_,d),n.setOriginalOperations(T,b);for(const E of _)r.set(E,m+T.length);i.splice(c,1,..._),e.splice(m,1,...T)}if(t.padWithNoOps){const d=i.length-a.originalOperationsACount,m=e.length-a.originalOperationsBCount;df(i,m-d),df(e,d-m)}return uf(i,a.nextBaseVersionB),uf(e,a.nextBaseVersionA),{operationsA:i,operationsB:e,originalOperations:o}}class Qg{constructor(e,t,n=!1){this.originalOperations=new Map,this._history=e.history,this._useRelations=t,this._forceWeakRemove=!!n,this._relations=new Map}setOriginalOperations(e,t=null){const n=t?this.originalOperations.get(t):null;for(const o of e)this.originalOperations.set(o,n||o)}updateRelation(e,t){switch(e.constructor){case Vt:switch(t.constructor){case wn:e.targetPosition.isEqual(t.sourcePosition)||t.movedRange.containsPosition(e.targetPosition)?this._setRelation(e,t,"insertAtSource"):e.targetPosition.isEqual(t.deletionPosition)?this._setRelation(e,t,"insertBetween"):e.targetPosition.isAfter(t.sourcePosition)&&this._setRelation(e,t,"moveTargetAfter");break;case Vt:e.targetPosition.isEqual(t.sourcePosition)||e.targetPosition.isBefore(t.sourcePosition)?this._setRelation(e,t,"insertBefore"):this._setRelation(e,t,"insertAfter")}break;case Ht:switch(t.constructor){case wn:e.splitPosition.isBefore(t.sourcePosition)&&this._setRelation(e,t,"splitBefore");break;case Vt:if(e.splitPosition.isEqual(t.sourcePosition)||e.splitPosition.isBefore(t.sourcePosition))this._setRelation(e,t,"splitBefore");else{const n=le._createFromPositionAndShift(t.sourcePosition,t.howMany);if(e.splitPosition.hasSameParentAs(t.sourcePosition)&&n.containsPosition(e.splitPosition)){const o=n.end.offset-e.splitPosition.offset,r=e.splitPosition.offset-n.start.offset;this._setRelation(e,t,{howMany:o,offset:r})}}}break;case wn:switch(t.constructor){case wn:e.targetPosition.isEqual(t.sourcePosition)||this._setRelation(e,t,"mergeTargetNotMoved"),e.sourcePosition.isEqual(t.targetPosition)&&this._setRelation(e,t,"mergeSourceNotMoved"),e.sourcePosition.isEqual(t.sourcePosition)&&this._setRelation(e,t,"mergeSameElement");break;case Ht:e.sourcePosition.isEqual(t.splitPosition)&&this._setRelation(e,t,"splitAtSource")}break;case co:{const n=e.newRange;if(!n)return;switch(t.constructor){case Vt:{const o=le._createFromPositionAndShift(t.sourcePosition,t.howMany),r=o.containsPosition(n.start)||o.start.isEqual(n.start),a=o.containsPosition(n.end)||o.end.isEqual(n.end);!r&&!a||o.containsRange(n)||this._setRelation(e,t,{side:r?"left":"right",path:r?n.start.path.slice():n.end.path.slice()});break}case wn:{const o=n.start.isEqual(t.targetPosition),r=n.start.isEqual(t.deletionPosition),a=n.end.isEqual(t.deletionPosition),c=n.end.isEqual(t.sourcePosition);(o||r||a||c)&&this._setRelation(e,t,{wasInLeftElement:o,wasStartBeforeMergedElement:r,wasEndBeforeMergedElement:a,wasInRightElement:c});break}}break}}}getContext(e,t,n){return{aIsStrong:n,aWasUndone:this._wasUndone(e),bWasUndone:this._wasUndone(t),abRelation:this._useRelations?this._getRelation(e,t):null,baRelation:this._useRelations?this._getRelation(t,e):null,forceWeakRemove:this._forceWeakRemove}}_wasUndone(e){const t=this.originalOperations.get(e);return t.wasUndone||this._history.isUndoneOperation(t)}_getRelation(e,t){const n=this.originalOperations.get(t),o=this._history.getUndoneOperation(n);if(!o)return null;const r=this.originalOperations.get(e),a=this._relations.get(r);return a&&a.get(o)||null}_setRelation(e,t,n){const o=this.originalOperations.get(e),r=this.originalOperations.get(t);let a=this._relations.get(o);a||(a=new Map,this._relations.set(o,a)),a.set(r,n)}}function uf(i,e){for(const t of i)t.baseVersion=e++}function df(i,e){for(let t=0;t<e;t++)i.push(new Dn(0))}function hf(i,e,t){const n=i.nodes.getNode(0).getAttribute(e);if(n==t)return null;const o=new le(i.position,i.position.getShiftedBy(i.howMany));return new un(o,e,n,t,0)}function mf(i,e){return i.targetPosition._getTransformedByDeletion(e.sourcePosition,e.howMany)===null}function zs(i,e){const t=[];for(let n=0;n<i.length;n++){const o=i[n],r=new Vt(o.start,o.end.offset-o.start.offset,e,0);t.push(r);for(let a=n+1;a<i.length;a++)i[a]=i[a]._getTransformedByMove(r.sourcePosition,r.targetPosition,r.howMany)[0];e=e._getTransformedByMove(r.sourcePosition,r.targetPosition,r.howMany)}return t}yt(un,un,(i,e,t)=>{if(i.key===e.key&&i.range.start.hasSameParentAs(e.range.start)){const n=i.range.getDifference(e.range).map(r=>new un(r,i.key,i.oldValue,i.newValue,0)),o=i.range.getIntersection(e.range);return o&&t.aIsStrong&&n.push(new un(o,e.key,e.newValue,i.newValue,0)),n.length==0?[new Dn(0)]:n}return[i]}),yt(un,Sn,(i,e)=>{if(i.range.start.hasSameParentAs(e.position)&&i.range.containsPosition(e.position)){const t=i.range._getTransformedByInsertion(e.position,e.howMany,!e.shouldReceiveAttributes).map(n=>new un(n,i.key,i.oldValue,i.newValue,i.baseVersion));if(e.shouldReceiveAttributes){const n=hf(e,i.key,i.oldValue);n&&t.unshift(n)}return t}return i.range=i.range._getTransformedByInsertion(e.position,e.howMany,!1)[0],[i]}),yt(un,wn,(i,e)=>{const t=[];i.range.start.hasSameParentAs(e.deletionPosition)&&(i.range.containsPosition(e.deletionPosition)||i.range.start.isEqual(e.deletionPosition))&&t.push(le._createFromPositionAndShift(e.graveyardPosition,1));const n=i.range._getTransformedByMergeOperation(e);return n.isCollapsed||t.push(n),t.map(o=>new un(o,i.key,i.oldValue,i.newValue,i.baseVersion))}),yt(un,Vt,(i,e)=>function(t,n){const o=le._createFromPositionAndShift(n.sourcePosition,n.howMany);let r=null,a=[];o.containsRange(t,!0)?r=t:t.start.hasSameParentAs(o.start)?(a=t.getDifference(o),r=t.getIntersection(o)):a=[t];const c=[];for(let d of a){d=d._getTransformedByDeletion(n.sourcePosition,n.howMany);const m=n.getMovedRangeStart(),b=d.start.hasSameParentAs(m);d=d._getTransformedByInsertion(m,n.howMany,b),c.push(...d)}return r&&c.push(r._getTransformedByMove(n.sourcePosition,n.targetPosition,n.howMany,!1)[0]),c}(i.range,e).map(t=>new un(t,i.key,i.oldValue,i.newValue,i.baseVersion))),yt(un,Ht,(i,e)=>{if(i.range.end.isEqual(e.insertionPosition))return e.graveyardPosition||i.range.end.offset++,[i];if(i.range.start.hasSameParentAs(e.splitPosition)&&i.range.containsPosition(e.splitPosition)){const t=i.clone();return t.range=new le(e.moveTargetPosition.clone(),i.range.end._getCombined(e.splitPosition,e.moveTargetPosition)),i.range.end=e.splitPosition.clone(),i.range.end.stickiness="toPrevious",[i,t]}return i.range=i.range._getTransformedBySplitOperation(e),[i]}),yt(Sn,un,(i,e)=>{const t=[i];if(i.shouldReceiveAttributes&&i.position.hasSameParentAs(e.range.start)&&e.range.containsPosition(i.position)){const n=hf(i,e.key,e.newValue);n&&t.push(n)}return t}),yt(Sn,Sn,(i,e,t)=>(i.position.isEqual(e.position)&&t.aIsStrong||(i.position=i.position._getTransformedByInsertOperation(e)),[i])),yt(Sn,Vt,(i,e)=>(i.position=i.position._getTransformedByMoveOperation(e),[i])),yt(Sn,Ht,(i,e)=>(i.position=i.position._getTransformedBySplitOperation(e),[i])),yt(Sn,wn,(i,e)=>(i.position=i.position._getTransformedByMergeOperation(e),[i])),yt(co,Sn,(i,e)=>(i.oldRange&&(i.oldRange=i.oldRange._getTransformedByInsertOperation(e)[0]),i.newRange&&(i.newRange=i.newRange._getTransformedByInsertOperation(e)[0]),[i])),yt(co,co,(i,e,t)=>{if(i.name==e.name){if(!t.aIsStrong)return[new Dn(0)];i.oldRange=e.newRange?e.newRange.clone():null}return[i]}),yt(co,wn,(i,e)=>(i.oldRange&&(i.oldRange=i.oldRange._getTransformedByMergeOperation(e)),i.newRange&&(i.newRange=i.newRange._getTransformedByMergeOperation(e)),[i])),yt(co,Vt,(i,e,t)=>{if(i.oldRange&&(i.oldRange=le._createFromRanges(i.oldRange._getTransformedByMoveOperation(e))),i.newRange){if(t.abRelation){const n=le._createFromRanges(i.newRange._getTransformedByMoveOperation(e));if(t.abRelation.side=="left"&&e.targetPosition.isEqual(i.newRange.start))return i.newRange.start.path=t.abRelation.path,i.newRange.end=n.end,[i];if(t.abRelation.side=="right"&&e.targetPosition.isEqual(i.newRange.end))return i.newRange.start=n.start,i.newRange.end.path=t.abRelation.path,[i]}i.newRange=le._createFromRanges(i.newRange._getTransformedByMoveOperation(e))}return[i]}),yt(co,Ht,(i,e,t)=>{if(i.oldRange&&(i.oldRange=i.oldRange._getTransformedBySplitOperation(e)),i.newRange){if(t.abRelation){const n=i.newRange._getTransformedBySplitOperation(e);return i.newRange.start.isEqual(e.splitPosition)&&t.abRelation.wasStartBeforeMergedElement?i.newRange.start=fe._createAt(e.insertionPosition):i.newRange.start.isEqual(e.splitPosition)&&!t.abRelation.wasInLeftElement&&(i.newRange.start=fe._createAt(e.moveTargetPosition)),i.newRange.end.isEqual(e.splitPosition)&&t.abRelation.wasInRightElement?i.newRange.end=fe._createAt(e.moveTargetPosition):i.newRange.end.isEqual(e.splitPosition)&&t.abRelation.wasEndBeforeMergedElement?i.newRange.end=fe._createAt(e.insertionPosition):i.newRange.end=n.end,[i]}i.newRange=i.newRange._getTransformedBySplitOperation(e)}return[i]}),yt(wn,Sn,(i,e)=>(i.sourcePosition.hasSameParentAs(e.position)&&(i.howMany+=e.howMany),i.sourcePosition=i.sourcePosition._getTransformedByInsertOperation(e),i.targetPosition=i.targetPosition._getTransformedByInsertOperation(e),[i])),yt(wn,wn,(i,e,t)=>{if(i.sourcePosition.isEqual(e.sourcePosition)&&i.targetPosition.isEqual(e.targetPosition)){if(t.bWasUndone){const n=e.graveyardPosition.path.slice();return n.push(0),i.sourcePosition=new fe(e.graveyardPosition.root,n),i.howMany=0,[i]}return[new Dn(0)]}if(i.sourcePosition.isEqual(e.sourcePosition)&&!i.targetPosition.isEqual(e.targetPosition)&&!t.bWasUndone&&t.abRelation!="splitAtSource"){const n=i.targetPosition.root.rootName=="$graveyard",o=e.targetPosition.root.rootName=="$graveyard";if(o&&!n||!(n&&!o)&&t.aIsStrong){const a=e.targetPosition._getTransformedByMergeOperation(e),c=i.targetPosition._getTransformedByMergeOperation(e);return[new Vt(a,i.howMany,c,0)]}return[new Dn(0)]}return i.sourcePosition.hasSameParentAs(e.targetPosition)&&(i.howMany+=e.howMany),i.sourcePosition=i.sourcePosition._getTransformedByMergeOperation(e),i.targetPosition=i.targetPosition._getTransformedByMergeOperation(e),i.graveyardPosition.isEqual(e.graveyardPosition)&&t.aIsStrong||(i.graveyardPosition=i.graveyardPosition._getTransformedByMergeOperation(e)),[i]}),yt(wn,Vt,(i,e,t)=>{const n=le._createFromPositionAndShift(e.sourcePosition,e.howMany);return e.type=="remove"&&!t.bWasUndone&&!t.forceWeakRemove&&i.deletionPosition.hasSameParentAs(e.sourcePosition)&&n.containsPosition(i.sourcePosition)?[new Dn(0)]:(i.sourcePosition.hasSameParentAs(e.targetPosition)&&(i.howMany+=e.howMany),i.sourcePosition.hasSameParentAs(e.sourcePosition)&&(i.howMany-=e.howMany),i.sourcePosition=i.sourcePosition._getTransformedByMoveOperation(e),i.targetPosition=i.targetPosition._getTransformedByMoveOperation(e),i.graveyardPosition.isEqual(e.targetPosition)||(i.graveyardPosition=i.graveyardPosition._getTransformedByMoveOperation(e)),[i])}),yt(wn,Ht,(i,e,t)=>{if(e.graveyardPosition&&(i.graveyardPosition=i.graveyardPosition._getTransformedByDeletion(e.graveyardPosition,1),i.deletionPosition.isEqual(e.graveyardPosition)&&(i.howMany=e.howMany)),i.targetPosition.isEqual(e.splitPosition)){const n=e.howMany!=0,o=e.graveyardPosition&&i.deletionPosition.isEqual(e.graveyardPosition);if(n||o||t.abRelation=="mergeTargetNotMoved")return i.sourcePosition=i.sourcePosition._getTransformedBySplitOperation(e),[i]}if(i.sourcePosition.isEqual(e.splitPosition)){if(t.abRelation=="mergeSourceNotMoved")return i.howMany=0,i.targetPosition=i.targetPosition._getTransformedBySplitOperation(e),[i];if(t.abRelation=="mergeSameElement"||i.sourcePosition.offset>0)return i.sourcePosition=e.moveTargetPosition.clone(),i.targetPosition=i.targetPosition._getTransformedBySplitOperation(e),[i]}return i.sourcePosition.hasSameParentAs(e.splitPosition)&&(i.howMany=e.splitPosition.offset),i.sourcePosition=i.sourcePosition._getTransformedBySplitOperation(e),i.targetPosition=i.targetPosition._getTransformedBySplitOperation(e),[i]}),yt(Vt,Sn,(i,e)=>{const t=le._createFromPositionAndShift(i.sourcePosition,i.howMany)._getTransformedByInsertOperation(e,!1)[0];return i.sourcePosition=t.start,i.howMany=t.end.offset-t.start.offset,i.targetPosition.isEqual(e.position)||(i.targetPosition=i.targetPosition._getTransformedByInsertOperation(e)),[i]}),yt(Vt,Vt,(i,e,t)=>{const n=le._createFromPositionAndShift(i.sourcePosition,i.howMany),o=le._createFromPositionAndShift(e.sourcePosition,e.howMany);let r,a=t.aIsStrong,c=!t.aIsStrong;if(t.abRelation=="insertBefore"||t.baRelation=="insertAfter"?c=!0:t.abRelation!="insertAfter"&&t.baRelation!="insertBefore"||(c=!1),r=i.targetPosition.isEqual(e.targetPosition)&&c?i.targetPosition._getTransformedByDeletion(e.sourcePosition,e.howMany):i.targetPosition._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),mf(i,e)&&mf(e,i))return[e.getReversed()];if(n.containsPosition(e.targetPosition)&&n.containsRange(o,!0))return n.start=n.start._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),n.end=n.end._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),zs([n],r);if(o.containsPosition(i.targetPosition)&&o.containsRange(n,!0))return n.start=n.start._getCombined(e.sourcePosition,e.getMovedRangeStart()),n.end=n.end._getCombined(e.sourcePosition,e.getMovedRangeStart()),zs([n],r);const d=B(i.sourcePosition.getParentPath(),e.sourcePosition.getParentPath());if(d=="prefix"||d=="extension")return n.start=n.start._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),n.end=n.end._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),zs([n],r);i.type!="remove"||e.type=="remove"||t.aWasUndone||t.forceWeakRemove?i.type=="remove"||e.type!="remove"||t.bWasUndone||t.forceWeakRemove||(a=!1):a=!0;const m=[],b=n.getDifference(o);for(const T of b){T.start=T.start._getTransformedByDeletion(e.sourcePosition,e.howMany),T.end=T.end._getTransformedByDeletion(e.sourcePosition,e.howMany);const E=B(T.start.getParentPath(),e.getMovedRangeStart().getParentPath())=="same",P=T._getTransformedByInsertion(e.getMovedRangeStart(),e.howMany,E);m.push(...P)}const _=n.getIntersection(o);return _!==null&&a&&(_.start=_.start._getCombined(e.sourcePosition,e.getMovedRangeStart()),_.end=_.end._getCombined(e.sourcePosition,e.getMovedRangeStart()),m.length===0?m.push(_):m.length==1?o.start.isBefore(n.start)||o.start.isEqual(n.start)?m.unshift(_):m.push(_):m.splice(1,0,_)),m.length===0?[new Dn(i.baseVersion)]:zs(m,r)}),yt(Vt,Ht,(i,e,t)=>{let n=i.targetPosition.clone();i.targetPosition.isEqual(e.insertionPosition)&&e.graveyardPosition&&t.abRelation!="moveTargetAfter"||(n=i.targetPosition._getTransformedBySplitOperation(e));const o=le._createFromPositionAndShift(i.sourcePosition,i.howMany);if(o.end.isEqual(e.insertionPosition))return e.graveyardPosition||i.howMany++,i.targetPosition=n,[i];if(o.start.hasSameParentAs(e.splitPosition)&&o.containsPosition(e.splitPosition)){let a=new le(e.splitPosition,o.end);return a=a._getTransformedBySplitOperation(e),zs([new le(o.start,e.splitPosition),a],n)}i.targetPosition.isEqual(e.splitPosition)&&t.abRelation=="insertAtSource"&&(n=e.moveTargetPosition),i.targetPosition.isEqual(e.insertionPosition)&&t.abRelation=="insertBetween"&&(n=i.targetPosition);const r=[o._getTransformedBySplitOperation(e)];if(e.graveyardPosition){const a=o.start.isEqual(e.graveyardPosition)||o.containsPosition(e.graveyardPosition);i.howMany>1&&a&&!t.aWasUndone&&r.push(le._createFromPositionAndShift(e.insertionPosition,1))}return zs(r,n)}),yt(Vt,wn,(i,e,t)=>{const n=le._createFromPositionAndShift(i.sourcePosition,i.howMany);if(e.deletionPosition.hasSameParentAs(i.sourcePosition)&&n.containsPosition(e.sourcePosition)){if(i.type!="remove"||t.forceWeakRemove){if(i.howMany==1)return t.bWasUndone?(i.sourcePosition=e.graveyardPosition.clone(),i.targetPosition=i.targetPosition._getTransformedByMergeOperation(e),[i]):[new Dn(0)]}else if(!t.aWasUndone){const r=[];let a=e.graveyardPosition.clone(),c=e.targetPosition._getTransformedByMergeOperation(e);i.howMany>1&&(r.push(new Vt(i.sourcePosition,i.howMany-1,i.targetPosition,0)),a=a._getTransformedByMove(i.sourcePosition,i.targetPosition,i.howMany-1),c=c._getTransformedByMove(i.sourcePosition,i.targetPosition,i.howMany-1));const d=e.deletionPosition._getCombined(i.sourcePosition,i.targetPosition),m=new Vt(a,1,d,0),b=m.getMovedRangeStart().path.slice();b.push(0);const _=new fe(m.targetPosition.root,b);c=c._getTransformedByMove(a,d,1);const T=new Vt(c,e.howMany,_,0);return r.push(m),r.push(T),r}}const o=le._createFromPositionAndShift(i.sourcePosition,i.howMany)._getTransformedByMergeOperation(e);return i.sourcePosition=o.start,i.howMany=o.end.offset-o.start.offset,i.targetPosition=i.targetPosition._getTransformedByMergeOperation(e),[i]}),yt(eo,Sn,(i,e)=>(i.position=i.position._getTransformedByInsertOperation(e),[i])),yt(eo,wn,(i,e)=>i.position.isEqual(e.deletionPosition)?(i.position=e.graveyardPosition.clone(),i.position.stickiness="toNext",[i]):(i.position=i.position._getTransformedByMergeOperation(e),[i])),yt(eo,Vt,(i,e)=>(i.position=i.position._getTransformedByMoveOperation(e),[i])),yt(eo,eo,(i,e,t)=>{if(i.position.isEqual(e.position)){if(!t.aIsStrong)return[new Dn(0)];i.oldName=e.newName}return[i]}),yt(eo,Ht,(i,e)=>{if(B(i.position.path,e.splitPosition.getParentPath())=="same"&&!e.graveyardPosition){const t=new eo(i.position.getShiftedBy(1),i.oldName,i.newName,0);return[i,t]}return i.position=i.position._getTransformedBySplitOperation(e),[i]}),yt(Ei,Ei,(i,e,t)=>{if(i.root===e.root&&i.key===e.key){if(!t.aIsStrong||i.newValue===e.newValue)return[new Dn(0)];i.oldValue=e.newValue}return[i]}),yt(Ht,Sn,(i,e)=>(i.splitPosition.hasSameParentAs(e.position)&&i.splitPosition.offset<e.position.offset&&(i.howMany+=e.howMany),i.splitPosition=i.splitPosition._getTransformedByInsertOperation(e),i.insertionPosition=i.insertionPosition._getTransformedByInsertOperation(e),[i])),yt(Ht,wn,(i,e,t)=>{if(!i.graveyardPosition&&!t.bWasUndone&&i.splitPosition.hasSameParentAs(e.sourcePosition)){const n=e.graveyardPosition.path.slice();n.push(0);const o=new fe(e.graveyardPosition.root,n),r=Ht.getInsertionPosition(new fe(e.graveyardPosition.root,n)),a=new Ht(o,0,r,null,0);return i.splitPosition=i.splitPosition._getTransformedByMergeOperation(e),i.insertionPosition=Ht.getInsertionPosition(i.splitPosition),i.graveyardPosition=a.insertionPosition.clone(),i.graveyardPosition.stickiness="toNext",[a,i]}return i.splitPosition.hasSameParentAs(e.deletionPosition)&&!i.splitPosition.isAfter(e.deletionPosition)&&i.howMany--,i.splitPosition.hasSameParentAs(e.targetPosition)&&(i.howMany+=e.howMany),i.splitPosition=i.splitPosition._getTransformedByMergeOperation(e),i.insertionPosition=Ht.getInsertionPosition(i.splitPosition),i.graveyardPosition&&(i.graveyardPosition=i.graveyardPosition._getTransformedByMergeOperation(e)),[i]}),yt(Ht,Vt,(i,e,t)=>{const n=le._createFromPositionAndShift(e.sourcePosition,e.howMany);if(i.graveyardPosition){const r=n.start.isEqual(i.graveyardPosition)||n.containsPosition(i.graveyardPosition);if(!t.bWasUndone&&r){const a=i.splitPosition._getTransformedByMoveOperation(e),c=i.graveyardPosition._getTransformedByMoveOperation(e),d=c.path.slice();d.push(0);const m=new fe(c.root,d);return[new Vt(a,i.howMany,m,0)]}i.graveyardPosition=i.graveyardPosition._getTransformedByMoveOperation(e)}const o=i.splitPosition.isEqual(e.targetPosition);if(o&&(t.baRelation=="insertAtSource"||t.abRelation=="splitBefore"))return i.howMany+=e.howMany,i.splitPosition=i.splitPosition._getTransformedByDeletion(e.sourcePosition,e.howMany),i.insertionPosition=Ht.getInsertionPosition(i.splitPosition),[i];if(o&&t.abRelation&&t.abRelation.howMany){const{howMany:r,offset:a}=t.abRelation;return i.howMany+=r,i.splitPosition=i.splitPosition.getShiftedBy(a),[i]}if(i.splitPosition.hasSameParentAs(e.sourcePosition)&&n.containsPosition(i.splitPosition)){const r=e.howMany-(i.splitPosition.offset-e.sourcePosition.offset);return i.howMany-=r,i.splitPosition.hasSameParentAs(e.targetPosition)&&i.splitPosition.offset<e.targetPosition.offset&&(i.howMany+=e.howMany),i.splitPosition=e.sourcePosition.clone(),i.insertionPosition=Ht.getInsertionPosition(i.splitPosition),[i]}return e.sourcePosition.isEqual(e.targetPosition)||(i.splitPosition.hasSameParentAs(e.sourcePosition)&&i.splitPosition.offset<=e.sourcePosition.offset&&(i.howMany-=e.howMany),i.splitPosition.hasSameParentAs(e.targetPosition)&&i.splitPosition.offset<e.targetPosition.offset&&(i.howMany+=e.howMany)),i.splitPosition.stickiness="toNone",i.splitPosition=i.splitPosition._getTransformedByMoveOperation(e),i.splitPosition.stickiness="toNext",i.graveyardPosition?i.insertionPosition=i.insertionPosition._getTransformedByMoveOperation(e):i.insertionPosition=Ht.getInsertionPosition(i.splitPosition),[i]}),yt(Ht,Ht,(i,e,t)=>{if(i.splitPosition.isEqual(e.splitPosition)){if(!i.graveyardPosition&&!e.graveyardPosition)return[new Dn(0)];if(i.graveyardPosition&&e.graveyardPosition&&i.graveyardPosition.isEqual(e.graveyardPosition))return[new Dn(0)];if(t.abRelation=="splitBefore")return i.howMany=0,i.graveyardPosition=i.graveyardPosition._getTransformedBySplitOperation(e),[i]}if(i.graveyardPosition&&e.graveyardPosition&&i.graveyardPosition.isEqual(e.graveyardPosition)){const n=i.splitPosition.root.rootName=="$graveyard",o=e.splitPosition.root.rootName=="$graveyard";if(o&&!n||!(n&&!o)&&t.aIsStrong){const a=[];return e.howMany&&a.push(new Vt(e.moveTargetPosition,e.howMany,e.splitPosition,0)),i.howMany&&a.push(new Vt(i.splitPosition,i.howMany,i.moveTargetPosition,0)),a}return[new Dn(0)]}if(i.graveyardPosition&&(i.graveyardPosition=i.graveyardPosition._getTransformedBySplitOperation(e)),i.splitPosition.isEqual(e.insertionPosition)&&t.abRelation=="splitBefore")return i.howMany++,[i];if(e.splitPosition.isEqual(i.insertionPosition)&&t.baRelation=="splitBefore"){const n=e.insertionPosition.path.slice();n.push(0);const o=new fe(e.insertionPosition.root,n);return[i,new Vt(i.insertionPosition,1,o,0)]}return i.splitPosition.hasSameParentAs(e.splitPosition)&&i.splitPosition.offset<e.splitPosition.offset&&(i.howMany-=e.howMany),i.splitPosition=i.splitPosition._getTransformedBySplitOperation(e),i.insertionPosition=Ht.getInsertionPosition(i.splitPosition),[i]});class Yg extends Gi{constructor(e){super(e),this.domEventType="click"}onDomEvent(e){this.fire(e.type,e)}}class Uc extends Gi{constructor(e){super(e),this.domEventType=["mousedown","mouseup","mouseover","mouseout"]}onDomEvent(e){this.fire(e.type,e)}}class Bs{constructor(e){this.document=e}createDocumentFragment(e){return new Xr(this.document,e)}createElement(e,t,n){return new Xn(this.document,e,t,n)}createText(e){return new Te(this.document,e)}clone(e,t=!1){return e._clone(t)}appendChild(e,t){return t._appendChild(e)}insertChild(e,t,n){return n._insertChild(e,t)}removeChildren(e,t,n){return n._removeChildren(e,t)}remove(e){const t=e.parent;return t?this.removeChildren(t.getChildIndex(e),1,t):[]}replace(e,t){const n=e.parent;if(n){const o=n.getChildIndex(e);return this.removeChildren(o,1,n),this.insertChild(o,t,n),!0}return!1}unwrapElement(e){const t=e.parent;if(t){const n=t.getChildIndex(e);this.remove(e),this.insertChild(n,e.getChildren(),t)}}rename(e,t){const n=new Xn(this.document,e,t.getAttributes(),t.getChildren());return this.replace(t,n)?n:null}setAttribute(e,t,n){n._setAttribute(e,t)}removeAttribute(e,t){t._removeAttribute(e)}addClass(e,t){t._addClass(e)}removeClass(e,t){t._removeClass(e)}setStyle(e,t,n){Nn(e)&&n===void 0&&(n=t),n._setStyle(e,t)}removeStyle(e,t){t._removeStyle(e)}setCustomProperty(e,t,n){n._setCustomProperty(e,t)}removeCustomProperty(e,t){return t._removeCustomProperty(e)}createPositionAt(e,t){return ye._createAt(e,t)}createPositionAfter(e){return ye._createAfter(e)}createPositionBefore(e){return ye._createBefore(e)}createRange(e,t){return new Ze(e,t)}createRangeOn(e){return Ze._createOn(e)}createRangeIn(e){return Ze._createIn(e)}createSelection(e,t,n){return new Yt(e,t,n)}}class ti extends Pm{constructor(e,t){super(e),this.view=t,this._toolbarConfig=Ym(e.config.get("toolbar")),this._elementReplacer=new om}get element(){return this.view.element}init(e){const t=this.editor,n=this.view,o=t.editing.view,r=n.editable,a=o.document.getRoot();r.name=a.rootName,n.render();const c=r.element;this.setEditableElement(r.name,c),this.focusTracker.add(c),n.editable.bind("isFocused").to(this.focusTracker),o.attachDomRoot(c),e&&this._elementReplacer.replace(e,this.element),this._initPlaceholder(),this._initToolbar(),this.fire("ready")}destroy(){const e=this.view,t=this.editor.editing.view;this._elementReplacer.restore(),t.detachDomRoot(e.editable.name),e.destroy(),super.destroy()}_initToolbar(){const e=this.editor,t=this.view,n=e.editing.view;t.stickyPanel.bind("isActive").to(this.focusTracker,"isFocused"),t.stickyPanel.limiterElement=t.element,this._toolbarConfig.viewportTopOffset&&(t.stickyPanel.viewportTopOffset=this._toolbarConfig.viewportTopOffset),t.toolbar.fillFromConfig(this._toolbarConfig,this.componentFactory),function({origin:o,originKeystrokeHandler:r,originFocusTracker:a,toolbar:c,beforeFocus:d,afterBlur:m}){a.add(c.element),r.set("Alt+F10",(b,_)=>{a.isFocused&&!c.focusTracker.isFocused&&(d&&d(),c.focus(),_())}),c.keystrokes.set("Esc",(b,_)=>{c.focusTracker.isFocused&&(o.focus(),m&&m(),_())})}({origin:n,originFocusTracker:this.focusTracker,originKeystrokeHandler:e.keystrokes,toolbar:t.toolbar})}_initPlaceholder(){const e=this.editor,t=e.editing.view,n=t.document.getRoot(),o=e.sourceElement,r=e.config.get("placeholder")||o&&o.tagName.toLowerCase()==="textarea"&&o.getAttribute("placeholder");r&&af({view:t,element:n,text:r,isDirectHost:!1,keepOnFocus:!0})}}w(61);class Xg extends Fg{constructor(e,t,n={}){super(e),this.stickyPanel=new Ug(e),this.toolbar=new Pd(e,{shouldGroupWhenFull:n.shouldToolbarGroupWhenFull}),this.editable=new Hg(e,t)}render(){super.render(),this.stickyPanel.content.add(this.toolbar),this.top.add(this.stickyPanel),this.main.add(this.editable)}}class zd extends Nd{constructor(e,t){super(t),Mo(e)&&(this.sourceElement=e),this.model.document.createRoot();const n=!this.config.get("toolbar.shouldNotGroupWhenFull"),o=new Xg(this.locale,this.editing.view,{shouldToolbarGroupWhenFull:n});this.ui=new ti(this,o),function(r){if(!Se(r.updateSourceElement))throw new C.a("attachtoform-missing-elementapi-interface",r);const a=r.sourceElement;if(a&&a.tagName.toLowerCase()==="textarea"&&a.form){let c;const d=a.form,m=()=>r.updateSourceElement();Se(d.submit)&&(c=d.submit,d.submit=()=>{m(),c.apply(d)}),d.addEventListener("submit",m),r.on("destroy",()=>{d.removeEventListener("submit",m),c&&(d.submit=c)})}}(this)}destroy(){return this.sourceElement&&this.updateSourceElement(),this.ui.destroy(),super.destroy()}static create(e,t={}){return new Promise(n=>{const o=new this(e,t);n(o.initPlugins().then(()=>o.ui.init(Mo(e)?e:null)).then(()=>{if(!Mo(e)&&t.initialData)throw new C.a("editor-create-initial-data",null);const r=t.initialData!==void 0?t.initialData:function(a){return Mo(a)?(c=a,c instanceof HTMLTextAreaElement?c.value:c.innerHTML):a;var c}(e);return o.data.init(r)}).then(()=>o.fire("ready")).then(()=>o))})}}Be(zd,Sg),Be(zd,Cd);class ss{constructor(e){this.files=function(t){const n=Array.from(t.files||[]),o=Array.from(t.items||[]);return n.length?n:o.filter(r=>r.kind==="file").map(r=>r.getAsFile())}(e),this._native=e}get types(){return this._native.types}getData(e){return this._native.getData(e)}setData(e,t){this._native.setData(e,t)}set effectAllowed(e){this._native.effectAllowed=e}get effectAllowed(){return this._native.effectAllowed}set dropEffect(e){this._native.dropEffect=e}get dropEffect(){return this._native.dropEffect}get isCanceled(){return this._native.dropEffect=="none"||!!this._native.mozUserCancelled}}class ot extends Gi{constructor(e){super(e);const t=this.document;function n(o){return(r,a)=>{a.preventDefault();const c=a.dropRange?[a.dropRange]:null,d=new v(t,o);t.fire(d,{dataTransfer:a.dataTransfer,method:r.name,targetRanges:c,target:a.target}),d.stop.called&&a.stopPropagation()}}this.domEventType=["paste","copy","cut","drop","dragover","dragstart","dragend","dragenter","dragleave"],this.listenTo(t,"paste",n("clipboardInput"),{priority:"low"}),this.listenTo(t,"drop",n("clipboardInput"),{priority:"low"}),this.listenTo(t,"dragover",n("dragging"),{priority:"low"})}onDomEvent(e){const t={dataTransfer:new ss(e.clipboardData?e.clipboardData:e.dataTransfer)};e.type!="drop"&&e.type!="dragover"||(t.dropRange=function(n,o){const r=o.target.ownerDocument,a=o.clientX,c=o.clientY;let d;return r.caretRangeFromPoint&&r.caretRangeFromPoint(a,c)?d=r.caretRangeFromPoint(a,c):o.rangeParent&&(d=r.createRange(),d.setStart(o.rangeParent,o.rangeOffset),d.collapse(!0)),d?n.domConverter.domRangeToView(d):null}(this.view,e)),this.fire(e.type,e,t)}}const ff=["figcaption","li"];class sn extends ve{static get pluginName(){return"ClipboardPipeline"}init(){this.editor.editing.view.addObserver(ot),this._setupPasteDrop(),this._setupCopyCut()}_setupPasteDrop(){const e=this.editor,t=e.model,n=e.editing.view,o=n.document;this.listenTo(o,"clipboardInput",r=>{e.isReadOnly&&r.stop()},{priority:"highest"}),this.listenTo(o,"clipboardInput",(r,a)=>{const c=a.dataTransfer;let d=a.content||"";var m;d||(c.getData("text/html")?d=function(_){return _.replace(/<span(?: class="Apple-converted-space"|)>(\s+)<\/span>/g,(T,E)=>E.length==1?" ":E).replace(/<!--[\s\S]*?-->/g,"")}(c.getData("text/html")):c.getData("text/plain")&&(((m=(m=c.getData("text/plain")).replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\r?\n\r?\n/g,"</p><p>").replace(/\r?\n/g,"<br>").replace(/^\s/,"&nbsp;").replace(/\s$/,"&nbsp;").replace(/\s\s/g," &nbsp;")).includes("</p><p>")||m.includes("<br>"))&&(m=`<p>${m}</p>`),d=m),d=this.editor.data.htmlProcessor.toView(d));const b=new v(this,"inputTransformation");this.fire(b,{content:d,dataTransfer:c,targetRanges:a.targetRanges,method:a.method}),b.stop.called&&r.stop(),n.scrollToTheSelection()},{priority:"low"}),this.listenTo(this,"inputTransformation",(r,a)=>{if(a.content.isEmpty)return;const c=this.editor.data.toModel(a.content,"$clipboardHolder");c.childCount!=0&&(r.stop(),t.change(()=>{this.fire("contentInsertion",{content:c,method:a.method,dataTransfer:a.dataTransfer,targetRanges:a.targetRanges})}))},{priority:"low"}),this.listenTo(this,"contentInsertion",(r,a)=>{a.resultRange=t.insertContent(a.content)},{priority:"low"})}_setupCopyCut(){const e=this.editor,t=e.model.document,n=e.editing.view.document;function o(r,a){const c=a.dataTransfer;a.preventDefault();const d=e.data.toView(e.model.getSelectedContent(t.selection));n.fire("clipboardOutput",{dataTransfer:c,content:d,method:r.name})}this.listenTo(n,"copy",o,{priority:"low"}),this.listenTo(n,"cut",(r,a)=>{e.isReadOnly?a.preventDefault():o(r,a)},{priority:"low"}),this.listenTo(n,"clipboardOutput",(r,a)=>{a.content.isEmpty||(a.dataTransfer.setData("text/html",this.editor.data.htmlProcessor.toData(a.content)),a.dataTransfer.setData("text/plain",function c(d){let m="";if(d.is("$text")||d.is("$textProxy"))m=d.data;else if(d.is("element","img")&&d.hasAttribute("alt"))m=d.getAttribute("alt");else if(d.is("element","br"))m=`
`;else{let b=null;for(const _ of d.getChildren()){const T=c(_);b&&(b.is("containerElement")||_.is("containerElement"))&&(ff.includes(b.name)||ff.includes(_.name)?m+=`
`:m+=`

`),m+=T,b=_}}return m}(a.content))),a.method=="cut"&&e.model.deleteContent(t.selection)},{priority:"low"})}}function*dn(i,e){for(const t of e)t&&i.getAttributeProperties(t[0]).copyOnEnter&&(yield t)}class Jg extends pt{execute(){const e=this.editor.model,t=e.document;e.change(n=>{(function(o,r,a,c){const d=a.isCollapsed,m=a.getFirstRange(),b=m.start.parent,_=m.end.parent;if(c.isLimit(b)||c.isLimit(_))return void(d||b!=_||o.deleteContent(a));if(d){const T=dn(r.model.schema,a.getAttributes());Ji(r,m.start),r.setSelectionAttribute(T)}else{const T=!(m.start.isAtStart&&m.end.isAtEnd),E=b==_;o.deleteContent(a,{leaveUnmerged:T}),T&&(E?Ji(r,a.focus):r.setSelection(_,0))}})(this.editor.model,n,t.selection,e.schema),this.fire("afterExecute",{writer:n})})}}function Ji(i,e){i.split(e),i.setSelection(e.parent.nextSibling,0)}class pf extends _i{constructor(e){super(e);const t=this.document;t.on("keydown",(n,o)=>{if(this.isEnabled&&o.keyCode==ut.enter){const r=new rc(t,"enter",t.selection.getFirstRange());t.fire(r,new ts(t,o.domEvent,{isSoft:o.shiftKey})),r.stop.called&&n.stop()}})}observe(){}}class Wc extends ve{static get pluginName(){return"Enter"}init(){const e=this.editor,t=e.editing.view,n=t.document;t.addObserver(pf),e.commands.add("enter",new Jg(e)),this.listenTo(n,"enter",(o,r)=>{r.preventDefault(),r.isSoft||(e.execute("enter"),t.scrollToTheSelection())},{priority:"low"})}}class gf{constructor(e,t=20){this.model=e,this.size=0,this.limit=t,this.isLocked=!1,this._changeCallback=(n,o)=>{o.type!="transparent"&&o!==this._batch&&this._reset(!0)},this._selectionChangeCallback=()=>{this._reset()},this.model.document.on("change",this._changeCallback),this.model.document.selection.on("change:range",this._selectionChangeCallback),this.model.document.selection.on("change:attribute",this._selectionChangeCallback)}get batch(){return this._batch||(this._batch=this.model.createBatch()),this._batch}input(e){this.size+=e,this.size>=this.limit&&this._reset(!0)}lock(){this.isLocked=!0}unlock(){this.isLocked=!1}destroy(){this.model.document.off("change",this._changeCallback),this.model.document.selection.off("change:range",this._selectionChangeCallback),this.model.document.selection.off("change:attribute",this._selectionChangeCallback)}_reset(e){this.isLocked&&!e||(this._batch=null,this.size=0)}}class bf extends pt{constructor(e,t){super(e),this.direction=t,this._buffer=new gf(e.model,e.config.get("typing.undoStep"))}get buffer(){return this._buffer}execute(e={}){const t=this.editor.model,n=t.document;t.enqueueChange(this._buffer.batch,o=>{this._buffer.lock();const r=o.createSelection(e.selection||n.selection),a=e.sequence||1,c=r.isCollapsed;if(r.isCollapsed&&t.modifySelection(r,{direction:this.direction,unit:e.unit}),this._shouldEntireContentBeReplacedWithParagraph(a))return void this._replaceEntireContentWithParagraph(o);if(this._shouldReplaceFirstBlockWithParagraph(r,a))return void this.editor.execute("paragraph",{selection:r});if(r.isCollapsed)return;let d=0;r.getFirstRange().getMinimalFlatRanges().forEach(m=>{d+=fn(m.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))}),t.deleteContent(r,{doNotResetEntireContent:c,direction:this.direction}),this._buffer.input(d),o.setSelection(r),this._buffer.unlock()})}_shouldEntireContentBeReplacedWithParagraph(e){if(e>1)return!1;const t=this.editor.model,n=t.document.selection,o=t.schema.getLimitElement(n);if(!(n.isCollapsed&&n.containsEntireContent(o))||!t.schema.checkChild(o,"paragraph"))return!1;const r=o.getChild(0);return!r||r.name!=="paragraph"}_replaceEntireContentWithParagraph(e){const t=this.editor.model,n=t.document.selection,o=t.schema.getLimitElement(n),r=e.createElement("paragraph");e.remove(e.createRangeIn(o)),e.insert(r,o),e.setSelection(r,0)}_shouldReplaceFirstBlockWithParagraph(e,t){const n=this.editor.model;if(t>1||this.direction!="backward"||!e.isCollapsed)return!1;const o=e.getFirstPosition(),r=n.schema.getLimitElement(o),a=r.getChild(0);return o.parent==a&&!!e.containsEntireContent(a)&&!!n.schema.checkChild(r,"paragraph")&&a.name!="paragraph"}}class Zg extends _i{constructor(e){super(e);const t=e.document;let n=0;function o(r,a,c){const d=new rc(t,"delete",t.selection.getFirstRange());t.fire(d,new ts(t,a,c)),d.stop.called&&r.stop()}t.on("keyup",(r,a)=>{a.keyCode!=ut.delete&&a.keyCode!=ut.backspace||(n=0)}),t.on("keydown",(r,a)=>{const c={};if(a.keyCode==ut.delete)c.direction="forward",c.unit="character";else{if(a.keyCode!=ut.backspace)return;c.direction="backward",c.unit="codePoint"}const d=Cn.isMac?a.altKey:a.ctrlKey;c.unit=d?"word":c.unit,c.sequence=++n,o(r,a.domEvent,c)}),Cn.isAndroid&&t.on("beforeinput",(r,a)=>{if(a.domEvent.inputType!="deleteContentBackward")return;const c={unit:"codepoint",direction:"backward",sequence:1},d=a.domTarget.ownerDocument.defaultView.getSelection();d.anchorNode==d.focusNode&&d.anchorOffset+1!=d.focusOffset&&(c.selectionToRemove=e.domConverter.domSelectionToView(d)),o(r,a.domEvent,c)})}observe(){}}class as extends ve{static get pluginName(){return"Delete"}init(){const e=this.editor,t=e.editing.view,n=t.document;t.addObserver(Zg);const o=new bf(e,"forward");if(e.commands.add("deleteForward",o),e.commands.add("forwardDelete",o),e.commands.add("delete",new bf(e,"backward")),this.listenTo(n,"delete",(r,a)=>{const c={unit:a.unit,sequence:a.sequence};if(a.selectionToRemove){const d=e.model.createSelection(),m=[];for(const b of a.selectionToRemove.getRanges())m.push(e.editing.mapper.toModelRange(b));d.setTo(m),c.selection=d}e.execute(a.direction=="forward"?"deleteForward":"delete",c),a.preventDefault(),t.scrollToTheSelection()},{priority:"low"}),Cn.isAndroid){let r=null;this.listenTo(n,"delete",(a,c)=>{const d=c.domTarget.ownerDocument.defaultView.getSelection();r={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}},{priority:"lowest"}),this.listenTo(n,"keyup",(a,c)=>{if(r){const d=c.domTarget.ownerDocument.defaultView.getSelection();d.collapse(r.anchorNode,r.anchorOffset),d.extend(r.focusNode,r.focusOffset),r=null}})}}}class vf{constructor(){this._stack=[]}add(e,t){const n=this._stack,o=n[0];this._insertDescriptor(e);const r=n[0];o===r||ni(o,r)||this.fire("change:top",{oldDescriptor:o,newDescriptor:r,writer:t})}remove(e,t){const n=this._stack,o=n[0];this._removeDescriptor(e);const r=n[0];o===r||ni(o,r)||this.fire("change:top",{oldDescriptor:o,newDescriptor:r,writer:t})}_insertDescriptor(e){const t=this._stack,n=t.findIndex(r=>r.id===e.id);if(ni(e,t[n]))return;n>-1&&t.splice(n,1);let o=0;for(;t[o]&&wf(t[o],e);)o++;t.splice(o,0,e)}_removeDescriptor(e){const t=this._stack,n=t.findIndex(o=>o.id===e);n>-1&&t.splice(n,1)}}function ni(i,e){return i&&e&&i.priority==e.priority&&ls(i.classes)==ls(e.classes)}function wf(i,e){return i.priority>e.priority||!(i.priority<e.priority)&&ls(i.classes)>ls(e.classes)}function ls(i){return Array.isArray(i)?i.sort().join(","):i}Be(vf,F);function it(i){return!!i.is("element")&&!!i.getCustomProperty("widget")}function on(i,e,t={}){if(!i.is("containerElement"))throw new C.a("widget-to-widget-wrong-element-type",null,{element:i});return e.setAttribute("contenteditable","false",i),e.addClass("ck-widget",i),e.setCustomProperty("widget",!0,i),i.getFillerOffset=_f,t.label&&function(n,o,r){r.setCustomProperty("widgetLabel",o,n)}(i,t.label,e),t.hasSelectionHandle&&function(n,o){const r=o.createUIElement("div",{class:"ck ck-widget__selection-handle"},function(a){const c=this.toDomElement(a),d=new Bc;return d.set("content",'<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M4 0v1H1v3H0V.5A.5.5 0 0 1 .5 0H4zm8 0h3.5a.5.5 0 0 1 .5.5V4h-1V1h-3V0zM4 16H.5a.5.5 0 0 1-.5-.5V12h1v3h3v1zm8 0v-1h3v-3h1v3.5a.5.5 0 0 1-.5.5H12z"/><path fill-opacity=".256" d="M1 1h14v14H1z"/><g class="ck-icon__selected-indicator"><path d="M7 0h2v1H7V0zM0 7h1v2H0V7zm15 0h1v2h-1V7zm-8 8h2v1H7v-1z"/><path fill-opacity=".254" d="M1 1h14v14H1z"/></g></svg>'),d.render(),c.appendChild(d.element),c});o.insert(o.createPositionAt(n,0),r),o.addClass(["ck-widget_with-selection-handle"],n)}(i,e),Kc(i,e,kf,eb),i}function kf(i,e,t){if(e.classes&&t.addClass(Tt(e.classes),i),e.attributes)for(const n in e.attributes)t.setAttribute(n,e.attributes[n],i)}function eb(i,e,t){if(e.classes&&t.removeClass(Tt(e.classes),i),e.attributes)for(const n in e.attributes)t.removeAttribute(n,i)}function Kc(i,e,t,n){const o=new vf;o.on("change:top",(r,a)=>{a.oldDescriptor&&n(i,a.oldDescriptor,a.writer),a.newDescriptor&&t(i,a.newDescriptor,a.writer)}),e.setCustomProperty("addHighlight",(r,a,c)=>o.add(a,c),i),e.setCustomProperty("removeHighlight",(r,a,c)=>o.remove(a,c),i)}function tb(i){const e=i.getCustomProperty("widgetLabel");return e?typeof e=="function"?e():e:""}function Bd(i,e){return e.addClass(["ck-editor__editable","ck-editor__nested-editable"],i),e.setAttribute("contenteditable",i.isReadOnly?"false":"true",i),i.on("change:isReadOnly",(t,n,o)=>{e.setAttribute("contenteditable",o?"false":"true",i)}),i.on("change:isFocused",(t,n,o)=>{o?e.addClass("ck-editor__nested-editable_focused",i):e.removeClass("ck-editor__nested-editable_focused",i)}),i}function hl(i,e){const t=i.getSelectedElement();if(t){const o=Zi(i);if(o)return e.createRange(e.createPositionAt(t,o));if(e.schema.isObject(t)&&!e.schema.isInline(t))return e.createRangeOn(t)}const n=i.getSelectedBlocks().next().value;if(n){if(n.isEmpty)return e.createRange(e.createPositionAt(n,0));const o=e.createPositionAfter(n);return i.focus.isTouching(o)?e.createRange(o):e.createRange(e.createPositionBefore(n))}return e.createRange(i.focus)}function nb(i,e){const t=new Et(qt.window),n=t.getIntersection(i),o=e.height+ht.arrowVerticalOffset;if(i.top-o>t.top||i.bottom+o<t.bottom)return null;const r=n||i,a=r.left+r.width/2-e.width/2;return{top:Math.max(i.top,0)+ht.arrowVerticalOffset,left:a,name:"arrow_n"}}function _f(){return null}function Si(i,e,t){return i&&it(i)&&!t.isInline(e)}function Zi(i){return i.getAttribute("widget-type-around")}const yf=[M("arrowUp"),M("arrowRight"),M("arrowDown"),M("arrowLeft"),9,16,17,18,19,20,27,33,34,35,36,45,91,93,144,145,173,174,175,176,177,178,179,255];for(let i=112;i<=135;i++)yf.push(i);function Fd(i){return!(!i.ctrlKey&&!i.metaKey)||yf.includes(i.keyCode)}w(63);const ml=["before","after"],Ao=new DOMParser().parseFromString('<svg viewBox="0 0 10 8" xmlns="http://www.w3.org/2000/svg"><path d="M9.055.263v3.972h-6.77M1 4.216l2-2.038m-2 2 2 2.038"/></svg>',"image/svg+xml").firstChild;class Fs extends ve{static get pluginName(){return"WidgetTypeAround"}static get requires(){return[Wc,as]}constructor(e){super(e),this._currentFakeCaretModelElement=null}init(){const e=this.editor,t=e.editing.view;this.on("change:isEnabled",(n,o,r)=>{t.change(a=>{for(const c of t.document.roots)r?a.removeClass("ck-widget__type-around_disabled",c):a.addClass("ck-widget__type-around_disabled",c)}),r||e.model.change(a=>{a.removeSelectionAttribute("widget-type-around")})}),this._enableTypeAroundUIInjection(),this._enableInsertingParagraphsOnButtonClick(),this._enableInsertingParagraphsOnEnterKeypress(),this._enableInsertingParagraphsOnTypingKeystroke(),this._enableTypeAroundFakeCaretActivationUsingKeyboardArrows(),this._enableDeleteIntegration(),this._enableInsertContentIntegration(),this._enableDeleteContentIntegration()}destroy(){this._currentFakeCaretModelElement=null}_insertParagraph(e,t){const n=this.editor,o=n.editing.view;n.execute("insertParagraph",{position:n.model.createPositionAt(e,t)}),o.focus(),o.scrollToTheSelection()}_listenToIfEnabled(e,t,n,o){this.listenTo(e,t,(...r)=>{this.isEnabled&&n(...r)},o)}_insertParagraphAccordingToFakeCaretPosition(){const e=this.editor.model.document.selection,t=Zi(e);if(!t)return!1;const n=e.getSelectedElement();return this._insertParagraph(n,t),!0}_enableTypeAroundUIInjection(){const e=this.editor,t=e.model.schema,n=e.locale.t,o={before:n("Insert paragraph before block"),after:n("Insert paragraph after block")};e.editing.downcastDispatcher.on("insert",(r,a,c)=>{const d=c.mapper.toViewElement(a.item);Si(d,a.item,t)&&function(m,b,_){const T=m.createUIElement("div",{class:"ck ck-reset_all ck-widget__type-around"},function(E){const P=this.toDomElement(E);return function(R,z){for(const $ of ml){const J=new Eo({tag:"div",attributes:{class:["ck","ck-widget__type-around__button","ck-widget__type-around__button_"+$],title:z[$]},children:[R.ownerDocument.importNode(Ao,!0)]});R.appendChild(J.render())}}(P,b),function(R){const z=new Eo({tag:"div",attributes:{class:["ck","ck-widget__type-around__fake-caret"]}});R.appendChild(z.render())}(P),P});m.insert(m.createPositionAt(_,"end"),T)}(c.writer,o,d)},{priority:"low"})}_enableTypeAroundFakeCaretActivationUsingKeyboardArrows(){const e=this.editor,t=e.model,n=t.document.selection,o=t.schema,r=e.editing.view;function a(c){return"ck-widget_type-around_show-fake-caret_"+c}this._listenToIfEnabled(r.document,"arrowKey",(c,d)=>{this._handleArrowKeyPress(c,d)},{context:[it,"$text"],priority:"high"}),this._listenToIfEnabled(n,"change:range",(c,d)=>{d.directChange&&e.model.change(m=>{m.removeSelectionAttribute("widget-type-around")})}),this._listenToIfEnabled(t.document,"change:data",()=>{const c=n.getSelectedElement();c&&Si(e.editing.mapper.toViewElement(c),c,o)||e.model.change(d=>{d.removeSelectionAttribute("widget-type-around")})}),this._listenToIfEnabled(e.editing.downcastDispatcher,"selection",(c,d,m)=>{const b=m.writer;if(this._currentFakeCaretModelElement){const P=m.mapper.toViewElement(this._currentFakeCaretModelElement);P&&(b.removeClass(ml.map(a),P),this._currentFakeCaretModelElement=null)}const _=d.selection.getSelectedElement();if(!_)return;const T=m.mapper.toViewElement(_);if(!Si(T,_,o))return;const E=Zi(d.selection);E&&(b.addClass(a(E),T),this._currentFakeCaretModelElement=_)}),this._listenToIfEnabled(e.ui.focusTracker,"change:isFocused",(c,d,m)=>{m||e.model.change(b=>{b.removeSelectionAttribute("widget-type-around")})})}_handleArrowKeyPress(e,t){const n=this.editor,o=n.model,r=o.document.selection,a=o.schema,c=n.editing.view,d=wt(t.keyCode,n.locale.contentLanguageDirection),m=c.document.selection.getSelectedElement();let b;Si(m,n.editing.mapper.toModelElement(m),a)?b=this._handleArrowKeyPressOnSelectedWidget(d):r.isCollapsed&&(b=this._handleArrowKeyPressWhenSelectionNextToAWidget(d)),b&&(t.preventDefault(),e.stop())}_handleArrowKeyPressOnSelectedWidget(e){const t=this.editor.model,n=Zi(t.document.selection);return t.change(o=>n?n!==(e?"after":"before")?(o.removeSelectionAttribute("widget-type-around"),!0):!1:(o.setSelectionAttribute("widget-type-around",e?"after":"before"),!0))}_handleArrowKeyPressWhenSelectionNextToAWidget(e){const t=this.editor,n=t.model,o=n.schema,r=t.plugins.get("Widget"),a=r._getObjectElementNextToSelection(e);return!!Si(t.editing.mapper.toViewElement(a),a,o)&&(n.change(c=>{r._setSelectionOverElement(a),c.setSelectionAttribute("widget-type-around",e?"before":"after")}),!0)}_enableInsertingParagraphsOnButtonClick(){const e=this.editor,t=e.editing.view;this._listenToIfEnabled(t.document,"mousedown",(n,o)=>{const r=o.domTarget.closest(".ck-widget__type-around__button");if(!r)return;const a=function(m){return m.classList.contains("ck-widget__type-around__button_before")?"before":"after"}(r),c=function(m,b){const _=m.closest(".ck-widget");return b.mapDomToView(_)}(r,t.domConverter),d=e.editing.mapper.toModelElement(c);this._insertParagraph(d,a),o.preventDefault(),n.stop()})}_enableInsertingParagraphsOnEnterKeypress(){const e=this.editor,t=e.model.document.selection,n=e.editing.view;this._listenToIfEnabled(n.document,"enter",(o,r)=>{if(o.eventPhase!="atTarget")return;const a=t.getSelectedElement(),c=e.editing.mapper.toViewElement(a),d=e.model.schema;let m;this._insertParagraphAccordingToFakeCaretPosition()?m=!0:Si(c,a,d)&&(this._insertParagraph(a,r.isSoft?"before":"after"),m=!0),m&&(r.preventDefault(),o.stop())},{context:it})}_enableInsertingParagraphsOnTypingKeystroke(){const e=this.editor.editing.view,t=[ut.enter,ut.delete,ut.backspace];this._listenToIfEnabled(e.document,"keydown",(n,o)=>{t.includes(o.keyCode)||Fd(o)||this._insertParagraphAccordingToFakeCaretPosition()},{priority:"high"})}_enableDeleteIntegration(){const e=this.editor,t=e.editing.view,n=e.model,o=n.schema;this._listenToIfEnabled(t.document,"delete",(r,a)=>{if(r.eventPhase!="atTarget")return;const c=Zi(n.document.selection);if(!c)return;const d=a.direction,m=n.document.selection.getSelectedElement(),b=d=="forward";if(c==="before"===b)e.execute("delete",{selection:n.createSelection(m,"on")});else{const _=o.getNearestSelectionRange(n.createPositionAt(m,c),d);if(_)if(_.isCollapsed){const T=n.createSelection(_.start);if(n.modifySelection(T,{direction:d}),T.focus.isEqual(_.start)){const E=function(P,R){let z=R;for(const $ of R.getAncestors({parentFirst:!0})){if($.childCount>1||P.isLimit($))break;z=$}return z}(o,_.start.parent);n.deleteContent(n.createSelection(E,"on"),{doNotAutoparagraph:!0})}else n.change(E=>{E.setSelection(_),e.execute(b?"deleteForward":"delete")})}else n.change(T=>{T.setSelection(_),e.execute(b?"deleteForward":"delete")})}a.preventDefault(),r.stop()},{context:it})}_enableInsertContentIntegration(){const e=this.editor,t=this.editor.model,n=t.document.selection;this._listenToIfEnabled(e.model,"insertContent",(o,[r,a])=>{if(a&&!a.is("documentSelection"))return;const c=Zi(n);return c?(o.stop(),t.change(d=>{const m=n.getSelectedElement(),b=t.createPositionAt(m,c),_=d.createSelection(b),T=t.insertContent(r,_);return d.setSelection(_),T})):void 0},{priority:"high"})}_enableDeleteContentIntegration(){const e=this.editor,t=this.editor.model.document.selection;this._listenToIfEnabled(e.model,"deleteContent",(n,[o])=>{o&&!o.is("documentSelection")||Zi(t)&&n.stop()},{priority:"high"})}}w(65);function ob(i){const e=i.model;return(t,n)=>{const o=n.keyCode==ut.arrowup,r=n.keyCode==ut.arrowdown,a=n.shiftKey,c=e.document.selection;if(!o&&!r)return;const d=r;if(a&&function(b,_){return!b.isCollapsed&&b.isBackward==_}(c,d))return;const m=function(b,_,T){const E=b.model;if(T){const P=_.isCollapsed?_.focus:_.getLastPosition(),R=xf(E,P,"forward");if(!R)return null;const z=E.createRange(P,R),$=Nf(E.schema,z,"backward");return $&&P.isBefore($)?E.createRange(P,$):null}{const P=_.isCollapsed?_.focus:_.getFirstPosition(),R=xf(E,P,"backward");if(!R)return null;const z=E.createRange(R,P),$=Nf(E.schema,z,"forward");return $&&P.isAfter($)?E.createRange($,P):null}}(i,c,d);m&&!m.isCollapsed&&function(b,_,T){const E=b.model,P=b.view.domConverter;if(T){const ue=E.createSelection(_.start);E.modifySelection(ue),ue.focus.isAtEnd||_.start.isEqual(ue.focus)||(_=E.createRange(ue.focus,_.end))}const R=b.mapper.toViewRange(_),z=P.viewRangeToDom(R),$=Et.getDomRangeRects(z);let J;for(const ue of $)if(J!==void 0){if(Math.round(ue.top)>=J)return!1;J=Math.max(J,Math.round(ue.bottom))}else J=Math.round(ue.bottom);return!0}(i,m,d)&&(e.change(b=>{const _=d?m.end:m.start;if(a){const T=e.createSelection(c.anchor);T.setFocus(_),b.setSelection(T)}else b.setSelection(_)}),t.stop(),n.preventDefault(),n.stopPropagation())}}function xf(i,e,t){const n=i.schema,o=i.createRangeIn(e.root),r=t=="forward"?"elementStart":"elementEnd";for(const{previousPosition:a,item:c,type:d}of o.getWalker({startPosition:e,direction:t})){if(n.isLimit(c)&&!n.isInline(c))return a;if(d==r&&n.isBlock(c))return null}return null}function Nf(i,e,t){const n=t=="backward"?e.end:e.start;if(i.checkChild(n,"$text"))return n;for(const{nextPosition:o}of e.getWalker({direction:t}))if(i.checkChild(o,"$text"))return o}class fl extends ve{static get pluginName(){return"Widget"}static get requires(){return[Fs,as]}init(){const e=this.editor,t=e.editing.view,n=t.document;this._previouslySelected=new Set,this.editor.editing.downcastDispatcher.on("selection",(o,r,a)=>{const c=a.writer,d=r.selection;if(d.isCollapsed)return;const m=d.getSelectedElement();if(!m)return;const b=e.editing.mapper.toViewElement(m);it(b)&&a.consumable.consume(d,"selection")&&c.setSelection(c.createRangeOn(b),{fake:!0,label:tb(b)})}),this.editor.editing.downcastDispatcher.on("selection",(o,r,a)=>{this._clearPreviouslySelectedWidgets(a.writer);const c=a.writer,d=c.document.selection;let m=null;for(const b of d.getRanges())for(const _ of b){const T=_.item;it(T)&&!ib(T,m)&&(c.addClass("ck-widget_selected",T),this._previouslySelected.add(T),m=T)}},{priority:"low"}),t.addObserver(Uc),this.listenTo(n,"mousedown",(...o)=>this._onMousedown(...o)),this.listenTo(n,"arrowKey",(...o)=>{this._handleSelectionChangeOnArrowKeyPress(...o)},{context:[it,"$text"]}),this.listenTo(n,"arrowKey",(...o)=>{this._preventDefaultOnArrowKeyPress(...o)},{context:"$root"}),this.listenTo(n,"arrowKey",ob(this.editor.editing),{context:"$text"}),this.listenTo(n,"delete",(o,r)=>{this._handleDelete(r.direction=="forward")&&(r.preventDefault(),o.stop())},{context:"$root"})}_onMousedown(e,t){const n=this.editor,o=n.editing.view,r=o.document;let a=t.target;if(function(d){for(;d;){if(d.is("editableElement")&&!d.is("rootElement"))return!0;if(it(d))return!1;d=d.parent}return!1}(a)){if((Cn.isSafari||Cn.isGecko)&&t.domEvent.detail>=3){const d=n.editing.mapper,m=a.is("attributeElement")?a.findAncestor(_=>!_.is("attributeElement")):a,b=d.toModelElement(m);t.preventDefault(),this.editor.model.change(_=>{_.setSelection(b,"in")})}return}if(!it(a)&&(a=a.findAncestor(it),!a))return;Cn.isAndroid&&t.preventDefault(),r.isFocused||o.focus();const c=n.editing.mapper.toModelElement(a);this._setSelectionOverElement(c)}_handleSelectionChangeOnArrowKeyPress(e,t){const n=t.keyCode,o=this.editor.model,r=o.schema,a=o.document.selection,c=a.getSelectedElement(),d=wt(n,this.editor.locale.contentLanguageDirection);if(c&&r.isObject(c)){const b=d?a.getLastPosition():a.getFirstPosition(),_=r.getNearestSelectionRange(b,d?"forward":"backward");return void(_&&(o.change(T=>{T.setSelection(_)}),t.preventDefault(),e.stop()))}if(!a.isCollapsed)return;const m=this._getObjectElementNextToSelection(d);m&&r.isObject(m)&&(this._setSelectionOverElement(m),t.preventDefault(),e.stop())}_preventDefaultOnArrowKeyPress(e,t){const n=this.editor.model,o=n.schema,r=n.document.selection.getSelectedElement();r&&o.isObject(r)&&(t.preventDefault(),e.stop())}_handleDelete(e){if(this.editor.isReadOnly)return;const t=this.editor.model.document.selection;if(!t.isCollapsed)return;const n=this._getObjectElementNextToSelection(e);return n?(this.editor.model.change(o=>{let r=t.anchor.parent;for(;r.isEmpty;){const a=r;r=a.parent,o.remove(a)}this._setSelectionOverElement(n)}),!0):void 0}_setSelectionOverElement(e){this.editor.model.change(t=>{t.setSelection(t.createRangeOn(e))})}_getObjectElementNextToSelection(e){const t=this.editor.model,n=t.schema,o=t.document.selection,r=t.createSelection(o);t.modifySelection(r,{direction:e?"forward":"backward"});const a=e?r.focus.nodeBefore:r.focus.nodeAfter;return a&&n.isObject(a)?a:null}_clearPreviouslySelectedWidgets(e){for(const t of this._previouslySelected)e.removeClass("ck-widget_selected",t);this._previouslySelected.clear()}}function ib(i,e){return!!e&&Array.from(i.getAncestors()).includes(e)}var qd=function(i,e,t){var n=!0,o=!0;if(typeof i!="function")throw new TypeError("Expected a function");return oe(t)&&(n="leading"in t?!!t.leading:n,o="trailing"in t?!!t.trailing:o),Wa(i,e,{leading:n,maxWait:e,trailing:o})};w(67);class er extends ve{static get pluginName(){return"DragDrop"}static get requires(){return[sn,fl]}init(){const e=this.editor,t=e.editing.view;this._draggedRange=null,this._draggingUid="",this._draggableElement=null,this._updateDropMarkerThrottled=qd(n=>this._updateDropMarker(n),40),this._removeDropMarkerDelayed=So(()=>this._removeDropMarker(),40),this._clearDraggableAttributesDelayed=So(()=>this._clearDraggableAttributes(),40),t.addObserver(ot),t.addObserver(Uc),this._setupDragging(),this._setupContentInsertionIntegration(),this._setupClipboardInputIntegration(),this._setupDropMarker(),this._setupDraggableAttributeHandling(),this.listenTo(e,"change:isReadOnly",(n,o,r)=>{r?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")}),this.on("change:isEnabled",(n,o,r)=>{r||this._finalizeDragging(!1)}),Cn.isAndroid&&this.forceDisabled("noAndroidSupport")}destroy(){return this._draggedRange&&(this._draggedRange.detach(),this._draggedRange=null),this._updateDropMarkerThrottled.cancel(),this._removeDropMarkerDelayed.cancel(),this._clearDraggableAttributesDelayed.cancel(),super.destroy()}_setupDragging(){const e=this.editor,t=e.model,n=t.document,o=e.editing.view,r=o.document;this.listenTo(r,"dragstart",(a,c)=>{const d=n.selection;if(c.target&&c.target.is("editableElement"))return void c.preventDefault();const m=c.target?$d(c.target):null;if(m){const T=e.editing.mapper.toModelElement(m);this._draggedRange=Ti.fromRange(t.createRangeOn(T)),e.plugins.has("WidgetToolbarRepository")&&e.plugins.get("WidgetToolbarRepository").forceDisabled("dragDrop")}else if(!r.selection.isCollapsed){const T=r.selection.getSelectedElement();T&&it(T)||(this._draggedRange=Ti.fromRange(d.getFirstRange()))}if(!this._draggedRange)return void c.preventDefault();this._draggingUid=S(),c.dataTransfer.effectAllowed=this.isEnabled?"copyMove":"copy",c.dataTransfer.setData("application/ckeditor5-dragging-uid",this._draggingUid);const b=t.createSelection(this._draggedRange.toRange()),_=e.data.toView(t.getSelectedContent(b));r.fire("clipboardOutput",{dataTransfer:c.dataTransfer,content:_,method:a.name}),this.isEnabled||(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid="")},{priority:"low"}),this.listenTo(r,"dragend",(a,c)=>{this._finalizeDragging(!c.dataTransfer.isCanceled&&c.dataTransfer.dropEffect=="move")},{priority:"low"}),this.listenTo(r,"dragenter",()=>{this.isEnabled&&o.focus()}),this.listenTo(r,"dragleave",()=>{this._removeDropMarkerDelayed()}),this.listenTo(r,"dragging",(a,c)=>{if(!this.isEnabled)return void(c.dataTransfer.dropEffect="none");this._removeDropMarkerDelayed.cancel();const d=lt(e,c.targetRanges,c.target);this._draggedRange||(c.dataTransfer.dropEffect="copy"),Cn.isGecko||(c.dataTransfer.effectAllowed=="copy"?c.dataTransfer.dropEffect="copy":["all","copyMove"].includes(c.dataTransfer.effectAllowed)&&(c.dataTransfer.dropEffect="move")),d&&this._updateDropMarkerThrottled(d)},{priority:"low"})}_setupClipboardInputIntegration(){const e=this.editor,t=e.editing.view.document;this.listenTo(t,"clipboardInput",(n,o)=>{if(o.method!="drop")return;const r=lt(e,o.targetRanges,o.target);if(this._removeDropMarker(),!r)return this._finalizeDragging(!1),void n.stop();if(this._draggedRange&&this._draggingUid!=o.dataTransfer.getData("application/ckeditor5-dragging-uid")&&(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid=""),Hd(o.dataTransfer)=="move"&&this._draggedRange&&this._draggedRange.containsRange(r,!0))return this._finalizeDragging(!1),void n.stop();o.targetRanges=[e.editing.mapper.toViewRange(r)]},{priority:"high"})}_setupContentInsertionIntegration(){const e=this.editor.plugins.get(sn);e.on("contentInsertion",(t,n)=>{if(!this.isEnabled||n.method!=="drop")return;const o=n.targetRanges.map(r=>this.editor.editing.mapper.toModelRange(r));this.editor.model.change(r=>r.setSelection(o))},{priority:"high"}),e.on("contentInsertion",(t,n)=>{if(!this.isEnabled||n.method!=="drop")return;const o=Hd(n.dataTransfer)=="move",r=!n.resultRange||!n.resultRange.isCollapsed;this._finalizeDragging(r&&o)},{priority:"lowest"})}_setupDraggableAttributeHandling(){const e=this.editor,t=e.editing.view,n=t.document;this.listenTo(n,"mousedown",(o,r)=>{if(Cn.isAndroid||!r)return;this._clearDraggableAttributesDelayed.cancel();let a=$d(r.target);if(Cn.isBlink&&!e.isReadOnly&&!a&&!n.selection.isCollapsed){const c=n.selection.getSelectedElement();c&&it(c)||(a=n.selection.editableElement)}a&&(t.change(c=>{c.setAttribute("draggable","true",a)}),this._draggableElement=e.editing.mapper.toModelElement(a))}),this.listenTo(n,"mouseup",()=>{Cn.isAndroid||this._clearDraggableAttributesDelayed()})}_clearDraggableAttributes(){const e=this.editor.editing;e.view.change(t=>{this._draggableElement&&this._draggableElement.root.rootName!="$graveyard"&&t.removeAttribute("draggable",e.mapper.toViewElement(this._draggableElement)),this._draggableElement=null})}_setupDropMarker(){const e=this.editor;e.conversion.for("editingDowncast").markerToHighlight({model:"drop-target",view:{classes:["ck-clipboard-drop-target-range"]}}),e.conversion.for("editingDowncast").markerToElement({model:"drop-target",view:(t,{writer:n})=>{if(e.model.schema.checkChild(t.markerRange.start,"$text"))return n.createUIElement("span",{class:"ck ck-clipboard-drop-target-position"},function(o){const r=this.toDomElement(o);return r.innerHTML="&NoBreak;<span></span>&NoBreak;",r})}})}_updateDropMarker(e){const t=this.editor,n=t.model.markers;t.model.change(o=>{n.has("drop-target")?n.get("drop-target").getRange().isEqual(e)||o.updateMarker("drop-target",{range:e}):o.addMarker("drop-target",{range:e,usingOperation:!1,affectsData:!1})})}_removeDropMarker(){const e=this.editor.model;this._removeDropMarkerDelayed.cancel(),this._updateDropMarkerThrottled.cancel(),e.markers.has("drop-target")&&e.change(t=>{t.removeMarker("drop-target")})}_finalizeDragging(e){const t=this.editor,n=t.model;this._removeDropMarker(),this._clearDraggableAttributes(),t.plugins.has("WidgetToolbarRepository")&&t.plugins.get("WidgetToolbarRepository").clearForceDisabled("dragDrop"),this._draggingUid="",this._draggedRange&&(e&&this.isEnabled&&n.deleteContent(n.createSelection(this._draggedRange),{doNotAutoparagraph:!0}),this._draggedRange.detach(),this._draggedRange=null)}}function lt(i,e,t){const n=i.model,o=i.editing.mapper;let r=null;const a=e?e[0].start:null;if(t.is("uiElement")&&(t=t.parent),r=function(m,b){const _=m.model,T=m.editing.mapper;if(it(b))return _.createRangeOn(T.toModelElement(b));if(!b.is("editableElement")){const E=b.findAncestor(P=>it(P)||P.is("editableElement"));if(it(E))return _.createRangeOn(T.toModelElement(E))}return null}(i,t),r)return r;const c=function(m,b){const _=m.editing.mapper,T=m.editing.view,E=_.toModelElement(b);if(E)return E;const P=T.createPositionBefore(b),R=_.findMappedViewAncestor(P);return _.toModelElement(R)}(i,t),d=a?o.toModelPosition(a):null;return d?(r=function(m,b,_){const T=m.model;if(!T.schema.checkChild(_,"$block"))return null;const E=T.createPositionAt(_,0),P=b.path.slice(0,E.path.length),R=T.createPositionFromPath(b.root,P).nodeAfter;return R&&T.schema.isObject(R)?T.createRangeOn(R):null}(i,d,c),r||(r=n.schema.getNearestSelectionRange(d,Cn.isGecko?"forward":"backward"),r||function(m,b){const _=m.model;for(;b;){if(_.schema.isObject(b))return _.createRangeOn(b);b=b.parent}}(i,d.parent))):function(m,b){const _=m.model,T=_.schema,E=_.createPositionAt(b,0);return T.getNearestSelectionRange(E,"forward")}(i,c)}function Hd(i){return Cn.isGecko?i.dropEffect:["all","copyMove"].includes(i.effectAllowed)?"move":"copy"}function So(i,e){let t;function n(...o){n.cancel(),t=setTimeout(()=>i(...o),e)}return n.cancel=()=>{clearTimeout(t)},n}function $d(i){if(i.is("editableElement"))return null;if(i.hasClass("ck-widget__selection-handle"))return i.findAncestor(it);if(it(i))return i;const e=i.findAncestor(t=>it(t)||t.is("editableElement"));return it(e)?e:null}class rb extends ve{static get pluginName(){return"PastePlainText"}static get requires(){return[sn]}init(){const e=this.editor,t=e.model,n=e.editing.view,o=n.document,r=t.document.selection;let a=!1;n.addObserver(ot),this.listenTo(o,"keydown",(c,d)=>{a=d.shiftKey}),e.plugins.get(sn).on("contentInsertion",(c,d)=>{(a||function(m,b){if(m.childCount>1)return!1;const _=m.getChild(0);return b.isObject(_)?!1:[..._.getAttributeKeys()].length==0}(d.content,t.schema))&&t.change(m=>{const b=Array.from(r.getAttributes()).filter(([T])=>t.schema.getAttributeProperties(T).isFormatting);r.isCollapsed||t.deleteContent(r,{doNotAutoparagraph:!0}),b.push(...r.getAttributes());const _=m.createRangeIn(d.content);for(const T of _.getItems())T.is("$textProxy")&&m.setAttributes(b,T)})})}}class St extends ve{static get pluginName(){return"Clipboard"}static get requires(){return[sn,er,rb]}}class sb extends pt{execute(){const e=this.editor.model,t=e.document;e.change(n=>{(function(o,r,a){const c=a.isCollapsed,d=a.getFirstRange(),m=d.start.parent,b=d.end.parent,_=m==b;if(c){const T=dn(o.schema,a.getAttributes());Ud(o,r,d.end),r.removeSelectionAttribute(a.getAttributeKeys()),r.setSelectionAttribute(T)}else{const T=!(d.start.isAtStart&&d.end.isAtEnd);o.deleteContent(a,{leaveUnmerged:T}),_?Ud(o,r,a.focus):T&&r.setSelection(b,0)}})(e,n,t.selection),this.fire("afterExecute",{writer:n})})}refresh(){const e=this.editor.model,t=e.document;this.isEnabled=function(n,o){if(o.rangeCount>1)return!1;const r=o.anchor;if(!r||!n.checkChild(r,"softBreak"))return!1;const a=o.getFirstRange(),c=a.start.parent,d=a.end.parent;return!((qs(c,n)||qs(d,n))&&c!==d)}(e.schema,t.selection)}}function Ud(i,e,t){const n=e.createElement("softBreak");i.insertContent(n,t),e.setSelection(n,"after")}function qs(i,e){return!i.is("rootElement")&&(e.isLimit(i)||qs(i.parent,e))}class ab extends ve{static get pluginName(){return"ShiftEnter"}init(){const e=this.editor,t=e.model.schema,n=e.conversion,o=e.editing.view,r=o.document;t.register("softBreak",{allowWhere:"$text",isInline:!0}),n.for("upcast").elementToElement({model:"softBreak",view:"br"}),n.for("downcast").elementToElement({model:"softBreak",view:(a,{writer:c})=>c.createEmptyElement("br")}),o.addObserver(pf),e.commands.add("shiftEnter",new sb(e)),this.listenTo(r,"enter",(a,c)=>{c.preventDefault(),c.isSoft&&(e.execute("shiftEnter"),o.scrollToTheSelection())},{priority:"low"})}}class lb extends pt{execute(){const e=this.editor.model,t=e.document.selection;let n=e.schema.getLimitElement(t);if(t.containsEntireContent(n)||!Tf(e.schema,n))do if(n=n.parent,!n)return;while(!Tf(e.schema,n));e.change(o=>{o.setSelection(n,"in")})}}function Tf(i,e){return i.isLimit(e)&&(i.checkChild(e,"$text")||i.checkChild(e,"paragraph"))}const cb=vr("Ctrl+A");class ub extends ve{static get pluginName(){return"SelectAllEditing"}init(){const e=this.editor,t=e.editing.view.document;e.commands.add("selectAll",new lb(e)),this.listenTo(t,"keydown",(n,o)=>{M(o)===cb&&(e.execute("selectAll"),o.preventDefault())})}}class db extends ve{static get pluginName(){return"SelectAllUI"}init(){const e=this.editor;e.ui.componentFactory.add("selectAll",t=>{const n=e.commands.get("selectAll"),o=new nn(t),r=t.t;return o.set({label:r("Select all"),icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M.75 15.5a.75.75 0 0 1 .75.75V18l.008.09A.5.5 0 0 0 2 18.5h1.75a.75.75 0 1 1 0 1.5H1.5l-.144-.007a1.5 1.5 0 0 1-1.35-1.349L0 18.5v-2.25a.75.75 0 0 1 .75-.75zm18.5 0a.75.75 0 0 1 .75.75v2.25l-.007.144a1.5 1.5 0 0 1-1.349 1.35L18.5 20h-2.25a.75.75 0 1 1 0-1.5H18a.5.5 0 0 0 .492-.41L18.5 18v-1.75a.75.75 0 0 1 .75-.75zm-10.45 3c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2H7.2a.2.2 0 0 1-.2-.2v-1.1c0-.11.09-.2.2-.2h1.6zm4 0c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2h-1.6a.2.2 0 0 1-.2-.2v-1.1c0-.11.09-.2.2-.2h1.6zm.45-5.5a.75.75 0 1 1 0 1.5h-8.5a.75.75 0 1 1 0-1.5h8.5zM1.3 11c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2H.2a.2.2 0 0 1-.2-.2v-1.6c0-.11.09-.2.2-.2h1.1zm18.5 0c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2h-1.1a.2.2 0 0 1-.2-.2v-1.6c0-.11.09-.2.2-.2h1.1zm-4.55-2a.75.75 0 1 1 0 1.5H4.75a.75.75 0 1 1 0-1.5h10.5zM1.3 7c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2H.2a.2.2 0 0 1-.2-.2V7.2c0-.11.09-.2.2-.2h1.1zm18.5 0c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2h-1.1a.2.2 0 0 1-.2-.2V7.2c0-.11.09-.2.2-.2h1.1zm-4.55-2a.75.75 0 1 1 0 1.5h-2.5a.75.75 0 1 1 0-1.5h2.5zm-5 0a.75.75 0 1 1 0 1.5h-5.5a.75.75 0 0 1 0-1.5h5.5zm-6.5-5a.75.75 0 0 1 0 1.5H2a.5.5 0 0 0-.492.41L1.5 2v1.75a.75.75 0 0 1-1.5 0V1.5l.007-.144A1.5 1.5 0 0 1 1.356.006L1.5 0h2.25zM18.5 0l.144.007a1.5 1.5 0 0 1 1.35 1.349L20 1.5v2.25a.75.75 0 1 1-1.5 0V2l-.008-.09A.5.5 0 0 0 18 1.5h-1.75a.75.75 0 1 1 0-1.5h2.25zM8.8 0c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2H7.2a.2.2 0 0 1-.2-.2V.2c0-.11.09-.2.2-.2h1.6zm4 0c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2h-1.6a.2.2 0 0 1-.2-.2V.2c0-.11.09-.2.2-.2h1.6z"/></svg>',keystroke:"Ctrl+A",tooltip:!0}),o.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(o,"execute",()=>{e.execute("selectAll"),e.editing.view.focus()}),o})}}class hb extends ve{static get requires(){return[ub,db]}static get pluginName(){return"SelectAll"}}class mb extends pt{constructor(e,t){super(e),this._buffer=new gf(e.model,t),this._batches=new WeakSet}get buffer(){return this._buffer}destroy(){super.destroy(),this._buffer.destroy()}execute(e={}){const t=this.editor.model,n=t.document,o=e.text||"",r=o.length,a=e.range?t.createSelection(e.range):n.selection,c=e.resultRange;t.enqueueChange(this._buffer.batch,d=>{this._buffer.lock(),this._batches.add(this._buffer.batch),t.deleteContent(a),o&&t.insertContent(d.createText(o,n.selection.getAttributes()),a),c?d.setSelection(c):a.is("documentSelection")||d.setSelection(a),this._buffer.unlock(),this._buffer.input(r)})}}function Cf(i){if(i.newChildren.length-i.oldChildren.length!=1)return;const e=function(n,o){const r=[];let a,c=0;return n.forEach(b=>{b=="equal"?(d(),c++):b=="insert"?(m("insert")?a.values.push(o[c]):(d(),a={type:"insert",index:c,values:[o[c]]}),c++):m("delete")?a.howMany++:(d(),a={type:"delete",index:c,howMany:1})}),d(),r;function d(){a&&(r.push(a),a=null)}function m(b){return a&&a.type==b}}(kr(i.oldChildren,i.newChildren,fb),i.newChildren);if(e.length>1)return;const t=e[0];return t.values[0]&&t.values[0].is("$text")?t:void 0}function fb(i,e){return i&&i.is("$text")&&e&&e.is("$text")?i.data===e.data:i===e}class pb{constructor(e){this.editor=e,this.editing=this.editor.editing}handle(e,t){if(function(n){if(n.length==0)return!1;for(const o of n)if(o.type==="children"&&!Cf(o))return!0;return!1}(e))this._handleContainerChildrenMutations(e,t);else for(const n of e)this._handleTextMutation(n,t),this._handleTextNodeInsertion(n)}_handleContainerChildrenMutations(e,t){const n=function(Un){const no=Un.map(Wn=>Wn.node).reduce((Wn,Fo)=>Wn.getCommonAncestor(Fo,{includeSelf:!0}));if(no)return no.getAncestors({includeSelf:!0,parentFirst:!0}).find(Wn=>Wn.is("containerElement")||Wn.is("rootElement"))}(e);if(!n)return;const o=this.editor.editing.view.domConverter.mapViewToDom(n),r=new ki(this.editor.editing.view.document),a=this.editor.data.toModel(r.domToView(o)).getChild(0),c=this.editor.editing.mapper.toModelElement(n);if(!c)return;const d=Array.from(a.getChildren()),m=Array.from(c.getChildren()),b=d[d.length-1],_=m[m.length-1],T=b&&b.is("element","softBreak"),E=_&&!_.is("element","softBreak");T&&E&&d.pop();const P=this.editor.model.schema;if(!Ef(d,P)||!Ef(m,P))return;const R=d.map(Un=>Un.is("$text")?Un.data:"@").join("").replace(/\u00A0/g," "),z=m.map(Un=>Un.is("$text")?Un.data:"@").join("").replace(/\u00A0/g," ");if(z===R)return;const $=kr(z,R),{firstChangeAt:J,insertions:ue,deletions:xe}=Af($);let He=null;t&&(He=this.editing.mapper.toModelRange(t.getFirstRange()));const Qt=R.substr(J,ue),_t=this.editor.model.createRange(this.editor.model.createPositionAt(c,J),this.editor.model.createPositionAt(c,J+xe));this.editor.execute("input",{text:Qt,range:_t,resultRange:He})}_handleTextMutation(e,t){if(e.type!="text")return;const n=e.newText.replace(/\u00A0/g," "),o=e.oldText.replace(/\u00A0/g," ");if(o===n)return;const r=kr(o,n),{firstChangeAt:a,insertions:c,deletions:d}=Af(r);let m=null;t&&(m=this.editing.mapper.toModelRange(t.getFirstRange()));const b=this.editing.view.createPositionAt(e.node,a),_=this.editing.mapper.toModelPosition(b),T=this.editor.model.createRange(_,_.getShiftedBy(d)),E=n.substr(a,c);this.editor.execute("input",{text:E,range:T,resultRange:m})}_handleTextNodeInsertion(e){if(e.type!="children")return;const t=Cf(e),n=this.editing.view.createPositionAt(e.node,t.index),o=this.editing.mapper.toModelPosition(n),r=t.values[0].data;this.editor.execute("input",{text:r.replace(/\u00A0/g," "),range:this.editor.model.createRange(o)})}}function Ef(i,e){return i.every(t=>e.isInline(t))}function Af(i){let e=null,t=null;for(let r=0;r<i.length;r++)i[r]!="equal"&&(e=e===null?r:e,t=r);let n=0,o=0;for(let r=e;r<=t;r++)i[r]!="insert"&&n++,i[r]!="delete"&&o++;return{insertions:o,deletions:n,firstChangeAt:e}}class Gc extends ve{static get pluginName(){return"Input"}init(){const e=this.editor,t=new mb(e,e.config.get("typing.undoStep")||20);e.commands.add("input",t),function(n){let o=null;const r=n.model,a=n.editing.view,c=n.commands.get("input");function d(b){const _=r.document,T=a.document.isComposing,E=o&&o.isEqual(_.selection);o=null,c.isEnabled&&(Fd(b)||_.selection.isCollapsed||T&&b.keyCode===229||!T&&b.keyCode===229&&E||m())}function m(){const b=c.buffer;b.lock();const _=b.batch;c._batches.add(_),r.enqueueChange(_,()=>{r.deleteContent(r.document.selection)}),b.unlock()}Cn.isAndroid?a.document.on("beforeinput",(b,_)=>d(_),{priority:"lowest"}):a.document.on("keydown",(b,_)=>d(_),{priority:"lowest"}),a.document.on("compositionstart",function(){const b=r.document,_=b.selection.rangeCount!==1||b.selection.getFirstRange().isFlat;b.selection.isCollapsed||_||m()},{priority:"lowest"}),a.document.on("compositionend",()=>{o=r.createSelection(r.document.selection)},{priority:"lowest"})}(e),function(n){n.editing.view.document.on("mutations",(o,r,a)=>{new pb(n).handle(r,a)})}(e)}isInput(e){return this.editor.commands.get("input")._batches.has(e)}}class gb extends ve{static get requires(){return[Gc,as]}static get pluginName(){return"Typing"}}function Qc(i,e){let t=i.start;return{text:Array.from(i.getItems()).reduce((n,o)=>o.is("$text")||o.is("$textProxy")?n+o.data:(t=e.createPositionAfter(o),""),""),range:e.createRange(t,i.end)}}class Wd{constructor(e,t){this.model=e,this.testCallback=t,this.hasMatch=!1,this.set("isEnabled",!0),this.on("change:isEnabled",()=>{this.isEnabled?this._startListening():(this.stopListening(e.document.selection),this.stopListening(e.document))}),this._startListening()}_startListening(){const e=this.model.document;this.listenTo(e.selection,"change:range",(t,{directChange:n})=>{n&&(e.selection.isCollapsed?this._evaluateTextBeforeSelection("selection"):this.hasMatch&&(this.fire("unmatched"),this.hasMatch=!1))}),this.listenTo(e,"change:data",(t,n)=>{n.type!="transparent"&&this._evaluateTextBeforeSelection("data",{batch:n})})}_evaluateTextBeforeSelection(e,t={}){const n=this.model,o=n.document.selection,r=n.createRange(n.createPositionAt(o.focus.parent,0),o.focus),{text:a,range:c}=Qc(r,n),d=this.testCallback(a);if(!d&&this.hasMatch&&this.fire("unmatched"),this.hasMatch=!!d,d){const m=Object.assign(t,{text:a,range:c});typeof d=="object"&&Object.assign(m,d),this.fire("matched:"+e,m)}}}Be(Wd,Wt);class Sf extends ve{static get pluginName(){return"TwoStepCaretMovement"}constructor(e){super(e),this.attributes=new Set,this._overrideUid=null}init(){const e=this.editor,t=e.model,n=e.editing.view,o=e.locale,r=t.document.selection;this.listenTo(n.document,"arrowKey",(a,c)=>{if(!r.isCollapsed||c.shiftKey||c.altKey||c.ctrlKey)return;const d=c.keyCode==ut.arrowright,m=c.keyCode==ut.arrowleft;if(!d&&!m)return;const b=o.contentLanguageDirection;let _=!1;_=b==="ltr"&&d||b==="rtl"&&m?this._handleForwardMovement(c):this._handleBackwardMovement(c),_===!0&&a.stop()},{context:"$text",priority:"highest"}),this._isNextGravityRestorationSkipped=!1,this.listenTo(r,"change:range",(a,c)=>{this._isNextGravityRestorationSkipped?this._isNextGravityRestorationSkipped=!1:this._isGravityOverridden&&(!c.directChange&&Yc(r.getFirstPosition(),this.attributes)||this._restoreGravity())})}registerAttribute(e){this.attributes.add(e)}_handleForwardMovement(e){const t=this.attributes,n=this.editor.model.document.selection,o=n.getFirstPosition();return!this._isGravityOverridden&&(!o.isAtStart||!Kd(n,t))&&(Yc(o,t)?(zn(e),this._overrideGravity(),!0):void 0)}_handleBackwardMovement(e){const t=this.attributes,n=this.editor.model,o=n.document.selection,r=o.getFirstPosition();return this._isGravityOverridden?(zn(e),this._restoreGravity(),kn(n,t,r),!0):r.isAtStart?!!Kd(o,t)&&(zn(e),kn(n,t,r),!0):function(a,c){return Yc(a.getShiftedBy(-1),c)}(r,t)?r.isAtEnd&&!Kd(o,t)&&Yc(r,t)?(zn(e),kn(n,t,r),!0):(this._isNextGravityRestorationSkipped=!0,this._overrideGravity(),!1):void 0}get _isGravityOverridden(){return!!this._overrideUid}_overrideGravity(){this._overrideUid=this.editor.model.change(e=>e.overrideSelectionGravity())}_restoreGravity(){this.editor.model.change(e=>{e.restoreSelectionGravity(this._overrideUid),this._overrideUid=null})}}function Kd(i,e){for(const t of e)if(i.hasAttribute(t))return!0;return!1}function kn(i,e,t){const n=t.nodeBefore;i.change(o=>{n?o.setSelectionAttribute(n.getAttributes()):o.removeSelectionAttribute(e)})}function zn(i){i.preventDefault()}function Yc(i,e){const{nodeBefore:t,nodeAfter:n}=i;for(const o of e){const r=t?t.getAttribute(o):void 0;if((n?n.getAttribute(o):void 0)!==r)return!0}return!1}var Df=/[\\^$.*+?()[\]{}|]/g,bb=RegExp(Df.source),jf=function(i){return(i=ro(i))&&bb.test(i)?i.replace(Df,"\\$&"):i};const vb={copyright:{from:"(c)",to:"©"},registeredTrademark:{from:"(r)",to:"®"},trademark:{from:"(tm)",to:"™"},oneHalf:{from:"1/2",to:"½"},oneThird:{from:"1/3",to:"⅓"},twoThirds:{from:"2/3",to:"⅔"},oneForth:{from:"1/4",to:"¼"},threeQuarters:{from:"3/4",to:"¾"},lessThanOrEqual:{from:"<=",to:"≤"},greaterThanOrEqual:{from:">=",to:"≥"},notEqual:{from:"!=",to:"≠"},arrowLeft:{from:"<-",to:"←"},arrowRight:{from:"->",to:"→"},horizontalEllipsis:{from:"...",to:"…"},enDash:{from:/(^| )(--)( )$/,to:[null,"–",null]},emDash:{from:/(^| )(---)( )$/,to:[null,"—",null]},quotesPrimary:{from:Hs('"'),to:[null,"“",null,"”"]},quotesSecondary:{from:Hs("'"),to:[null,"‘",null,"’"]},quotesPrimaryEnGb:{from:Hs("'"),to:[null,"‘",null,"’"]},quotesSecondaryEnGb:{from:Hs('"'),to:[null,"“",null,"”"]},quotesPrimaryPl:{from:Hs('"'),to:[null,"„",null,"”"]},quotesSecondaryPl:{from:Hs("'"),to:[null,"‚",null,"’"]}},If={symbols:["copyright","registeredTrademark","trademark"],mathematical:["oneHalf","oneThird","twoThirds","oneForth","threeQuarters","lessThanOrEqual","greaterThanOrEqual","notEqual","arrowLeft","arrowRight"],typography:["horizontalEllipsis","enDash","emDash"],quotes:["quotesPrimary","quotesSecondary"]},wb=["symbols","mathematical","typography","quotes"];function Pf(i){return typeof i=="string"?new RegExp(`(${jf(i)})$`):i}function kb(i){return typeof i=="string"?()=>[i]:i instanceof Array?()=>i:i}function _b(i){return(i.textNode?i.textNode:i.nodeAfter).getAttributes()}function Hs(i){return new RegExp(`(^|\\s)(${i})([^${i}]*)(${i})$`)}function cs(i,e,t,n){return n.createRange(Gd(i,e,t,!0,n),Gd(i,e,t,!1,n))}function Gd(i,e,t,n,o){let r=i.textNode||(n?i.nodeBefore:i.nodeAfter),a=null;for(;r&&r.getAttribute(e)==t;)a=r,r=n?r.previousSibling:r.nextSibling;return a?o.createPositionAt(a,n?"before":"after"):i}class Mf extends pt{constructor(e){super(e),this._stack=[],this._createdBatches=new WeakSet,this.refresh(),this.listenTo(e.data,"set",(t,n)=>{n[1]={...n[1]};const o=n[1];o.batchType||(o.batchType="transparent")},{priority:"high"}),this.listenTo(e.data,"set",(t,n)=>{n[1].batchType==="transparent"&&this.clearStack()})}refresh(){this.isEnabled=this._stack.length>0}addBatch(e){const t=this.editor.model.document.selection,n={ranges:t.hasOwnRange?Array.from(t.getRanges()):[],isBackward:t.isBackward};this._stack.push({batch:e,selection:n}),this.refresh()}clearStack(){this._stack=[],this.refresh()}_restoreSelection(e,t,n){const o=this.editor.model,r=o.document,a=[],c=e.map(m=>m.getTransformedByOperations(n)),d=c.flat();for(const m of c){const b=m.filter(_=>_.root!=r.graveyard).filter(_=>!xb(_,d));b.length&&(yb(b),a.push(b[0]))}a.length&&o.change(m=>{m.setSelection(a,{backward:t})})}_undo(e,t){const n=this.editor.model,o=n.document;this._createdBatches.add(t);const r=e.operations.slice().filter(a=>a.isDocumentOperation);r.reverse();for(const a of r){const c=a.baseVersion+1,d=Array.from(o.history.getOperations(c)),m=Gg([a.getReversed()],d,{useRelations:!0,document:this.editor.model.document,padWithNoOps:!1,forceWeakRemove:!0}).operationsA;for(const b of m)t.addOperation(b),n.applyOperation(b),o.history.setOperationAsUndone(a,b)}}}function yb(i){i.sort((e,t)=>e.start.isBefore(t.start)?-1:1);for(let e=1;e<i.length;e++){const t=i[e-1].getJoined(i[e],!0);t&&(e--,i.splice(e,2,t))}}function xb(i,e){return e.some(t=>t!==i&&t.containsRange(i,!0))}class Nb extends Mf{execute(e=null){const t=e?this._stack.findIndex(r=>r.batch==e):this._stack.length-1,n=this._stack.splice(t,1)[0],o=this.editor.model.createBatch("transparent");this.editor.model.enqueueChange(o,()=>{this._undo(n.batch,o);const r=this.editor.model.document.history.getOperations(n.batch.baseVersion);this._restoreSelection(n.selection.ranges,n.selection.isBackward,r),this.fire("revert",n.batch,o)}),this.refresh()}}class $s extends Mf{execute(){const e=this._stack.pop(),t=this.editor.model.createBatch("transparent");this.editor.model.enqueueChange(t,()=>{const n=e.batch.operations[e.batch.operations.length-1].baseVersion+1,o=this.editor.model.document.history.getOperations(n);this._restoreSelection(e.selection.ranges,e.selection.isBackward,o),this._undo(e.batch,t)}),this.refresh()}}class Tb extends ve{static get pluginName(){return"UndoEditing"}constructor(e){super(e),this._batchRegistry=new WeakSet}init(){const e=this.editor;this._undoCommand=new Nb(e),this._redoCommand=new $s(e),e.commands.add("undo",this._undoCommand),e.commands.add("redo",this._redoCommand),this.listenTo(e.model,"applyOperation",(t,n)=>{const o=n[0];if(!o.isDocumentOperation)return;const r=o.batch,a=this._redoCommand._createdBatches.has(r),c=this._undoCommand._createdBatches.has(r);this._batchRegistry.has(r)||r.type=="transparent"&&!a&&!c||(a?this._undoCommand.addBatch(r):c||(this._undoCommand.addBatch(r),this._redoCommand.clearStack()),this._batchRegistry.add(r))},{priority:"highest"}),this.listenTo(this._undoCommand,"revert",(t,n,o)=>{this._redoCommand.addBatch(o)}),e.keystrokes.set("CTRL+Z","undo"),e.keystrokes.set("CTRL+Y","redo"),e.keystrokes.set("CTRL+SHIFT+Z","redo")}}var Of='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m5.042 9.367 2.189 1.837a.75.75 0 0 1-.965 1.149l-3.788-3.18a.747.747 0 0 1-.21-.284.75.75 0 0 1 .17-.945L6.23 4.762a.75.75 0 1 1 .964 1.15L4.863 7.866h8.917A.75.75 0 0 1 14 7.9a4 4 0 1 1-1.477 7.718l.344-1.489a2.5 2.5 0 1 0 1.094-4.73l.008-.032H5.042z"/></svg>',Rf='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m14.958 9.367-2.189 1.837a.75.75 0 0 0 .965 1.149l3.788-3.18a.747.747 0 0 0 .21-.284.75.75 0 0 0-.17-.945L13.77 4.762a.75.75 0 1 0-.964 1.15l2.331 1.955H6.22A.75.75 0 0 0 6 7.9a4 4 0 1 0 1.477 7.718l-.344-1.489A2.5 2.5 0 1 1 6.039 9.4l-.008-.032h8.927z"/></svg>';class Cb extends ve{static get pluginName(){return"UndoUI"}init(){const e=this.editor,t=e.locale,n=e.t,o=t.uiLanguageDirection=="ltr"?Of:Rf,r=t.uiLanguageDirection=="ltr"?Rf:Of;this._addButton("undo",n("Undo"),"CTRL+Z",o),this._addButton("redo",n("Redo"),"CTRL+Y",r)}_addButton(e,t,n,o){const r=this.editor;r.ui.componentFactory.add(e,a=>{const c=r.commands.get(e),d=new nn(a);return d.set({label:t,icon:o,keystroke:n,tooltip:!0}),d.bind("isEnabled").to(c,"isEnabled"),this.listenTo(d,"execute",()=>{r.execute(e),r.editing.view.focus()}),d})}}class Vf extends ve{static get requires(){return[Tb,Cb]}static get pluginName(){return"Undo"}}class Qd{constructor(){const e=new window.FileReader;this._reader=e,this._data=void 0,this.set("loaded",0),e.onprogress=t=>{this.loaded=t.loaded}}get error(){return this._reader.error}get data(){return this._data}read(e){const t=this._reader;return this.total=e.size,new Promise((n,o)=>{t.onload=()=>{const r=t.result;this._data=r,n(r)},t.onerror=()=>{o("error")},t.onabort=()=>{o("aborted")},this._reader.readAsDataURL(e)})}abort(){this._reader.abort()}}Be(Qd,Wt);class oi extends ve{static get pluginName(){return"FileRepository"}static get requires(){return[Mm]}init(){this.loaders=new io,this.loaders.on("add",()=>this._updatePendingAction()),this.loaders.on("remove",()=>this._updatePendingAction()),this._loadersMap=new Map,this._pendingAction=null,this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(e,t)=>t?e/t*100:0)}getLoader(e){return this._loadersMap.get(e)||null}createLoader(e){if(!this.createUploadAdapter)return Object(C.b)("filerepository-no-upload-adapter"),null;const t=new Yd(Promise.resolve(e),this.createUploadAdapter);return this.loaders.add(t),this._loadersMap.set(e,t),e instanceof Promise&&t.file.then(n=>{this._loadersMap.set(n,t)}).catch(()=>{}),t.on("change:uploaded",()=>{let n=0;for(const o of this.loaders)n+=o.uploaded;this.uploaded=n}),t.on("change:uploadTotal",()=>{let n=0;for(const o of this.loaders)o.uploadTotal&&(n+=o.uploadTotal);this.uploadTotal=n}),t}destroyLoader(e){const t=e instanceof Yd?e:this.getLoader(e);t._destroy(),this.loaders.remove(t),this._loadersMap.forEach((n,o)=>{n===t&&this._loadersMap.delete(o)})}_updatePendingAction(){const e=this.editor.plugins.get(Mm);if(this.loaders.length){if(!this._pendingAction){const t=this.editor.t,n=o=>`${t("Upload in progress")} ${parseInt(o)}%.`;this._pendingAction=e.add(n(this.uploadedPercent)),this._pendingAction.bind("message").to(this,"uploadedPercent",n)}}else e.remove(this._pendingAction),this._pendingAction=null}}Be(oi,Wt);class Yd{constructor(e,t){this.id=S(),this._filePromiseWrapper=this._createFilePromiseWrapper(e),this._adapter=t(this),this._reader=new Qd,this.set("status","idle"),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(n,o)=>o?n/o*100:0),this.set("uploadResponse",null)}get file(){return this._filePromiseWrapper?this._filePromiseWrapper.promise.then(e=>this._filePromiseWrapper?e:null):Promise.resolve(null)}get data(){return this._reader.data}read(){if(this.status!="idle")throw new C.a("filerepository-read-wrong-status",this);return this.status="reading",this.file.then(e=>this._reader.read(e)).then(e=>{if(this.status!=="reading")throw this.status;return this.status="idle",e}).catch(e=>{throw e==="aborted"?(this.status="aborted","aborted"):(this.status="error",this._reader.error?this._reader.error:e)})}upload(){if(this.status!="idle")throw new C.a("filerepository-upload-wrong-status",this);return this.status="uploading",this.file.then(()=>this._adapter.upload()).then(e=>(this.uploadResponse=e,this.status="idle",e)).catch(e=>{throw this.status==="aborted"?"aborted":(this.status="error",e)})}abort(){const e=this.status;this.status="aborted",this._filePromiseWrapper.isFulfilled?e=="reading"?this._reader.abort():e=="uploading"&&this._adapter.abort&&this._adapter.abort():(this._filePromiseWrapper.promise.catch(()=>{}),this._filePromiseWrapper.rejecter("aborted")),this._destroy()}_destroy(){this._filePromiseWrapper=void 0,this._reader=void 0,this._adapter=void 0,this.uploadResponse=void 0}_createFilePromiseWrapper(e){const t={};return t.promise=new Promise((n,o)=>{t.rejecter=o,t.isFulfilled=!1,e.then(r=>{t.isFulfilled=!0,n(r)}).catch(r=>{t.isFulfilled=!0,o(r)})}),t}}Be(Yd,Wt);class Eb extends gt{constructor(e){super(e),this.buttonView=new nn(e),this._fileInputView=new Ab(e),this._fileInputView.bind("acceptedType").to(this),this._fileInputView.bind("allowMultipleFiles").to(this),this._fileInputView.delegate("done").to(this),this.setTemplate({tag:"span",attributes:{class:"ck-file-dialog-button"},children:[this.buttonView,this._fileInputView]}),this.buttonView.on("execute",()=>{this._fileInputView.open()})}focus(){this.buttonView.focus()}}class Ab extends gt{constructor(e){super(e),this.set("acceptedType"),this.set("allowMultipleFiles",!1);const t=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck-hidden"],type:"file",tabindex:"-1",accept:t.to("acceptedType"),multiple:t.to("allowMultipleFiles")},on:{change:t.to(()=>{this.element&&this.element.files&&this.element.files.length&&this.fire("done",this.element.files),this.element.value=""})}})}open(){this.element.click()}}function Sb(){let i=function(n){n=n.toLowerCase();const o=document.cookie.split(";");for(const r of o){const a=r.split("=");if(decodeURIComponent(a[0].trim().toLowerCase())===n)return decodeURIComponent(a[1])}return null}("ckCsrfToken");var e,t;return i&&i.length==40||(i=function(n){let o="";const r=new Uint8Array(n);window.crypto.getRandomValues(r);for(let a=0;a<r.length;a++){const c="abcdefghijklmnopqrstuvwxyz0123456789".charAt(r[a]%36);o+=Math.random()>.5?c.toUpperCase():c}return o}(40),e="ckCsrfToken",t=i,document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(t)+";path=/"),i}class Db{constructor(e,t,n){this.loader=e,this.url=t,this.t=n}upload(){return this.loader.file.then(e=>new Promise((t,n)=>{this._initRequest(),this._initListeners(t,n,e),this._sendRequest(e)}))}abort(){this.xhr&&this.xhr.abort()}_initRequest(){const e=this.xhr=new XMLHttpRequest;e.open("POST",this.url,!0),e.responseType="json"}_initListeners(e,t,n){const o=this.xhr,r=this.loader,a=(0,this.t)("Cannot upload file:")+` ${n.name}.`;o.addEventListener("error",()=>t(a)),o.addEventListener("abort",()=>t()),o.addEventListener("load",()=>{const c=o.response;if(!c||!c.uploaded)return t(c&&c.error&&c.error.message?c.error.message:a);e({default:c.url})}),o.upload&&o.upload.addEventListener("progress",c=>{c.lengthComputable&&(r.uploadTotal=c.total,r.uploaded=c.loaded)})}_sendRequest(e){const t=new FormData;t.append("upload",e),t.append("ckCsrfToken",Sb()),this.xhr.send(t)}}function Nr(i,e,t,n){let o,r=null;typeof n=="function"?o=n:(r=i.commands.get(n),o=()=>{i.execute(n)}),i.model.document.on("change:data",(a,c)=>{if(r&&!r.isEnabled||!e.isEnabled)return;const d=so(i.model.document.selection.getRanges());if(!d.isCollapsed||c.type=="transparent")return;const m=Array.from(i.model.document.differ.getChanges()),b=m[0];if(m.length!=1||b.type!=="insert"||b.name!="$text"||b.length!=1)return;const _=b.position.parent;if(_.is("element","codeBlock")||_.is("element","listItem")&&typeof n!="function"&&!["numberedList","bulletedList","todoList"].includes(n)||r&&r.value===!0)return;const T=_.getChild(0),E=i.model.createRangeOn(T);if(!E.containsRange(d)&&!d.end.isEqual(E.end))return;const P=t.exec(T.data.substr(0,d.end.offset));P&&i.model.enqueueChange(R=>{const z=R.createPositionAt(_,0),$=R.createPositionAt(_,P[0].length),J=new Ti(z,$);if(o({match:P})!==!1){R.remove(J);const ue=i.model.document.selection.getFirstRange(),xe=R.createRangeIn(_);!_.isEmpty||xe.isEqual(ue)||xe.containsRange(ue,!0)||R.remove(_)}J.detach()})})}function Us(i,e,t,n){let o,r;t instanceof RegExp?o=t:r=t,r=r||(a=>{let c;const d=[],m=[];for(;(c=o.exec(a))!==null&&!(c&&c.length<4);){let{index:b,1:_,2:T,3:E}=c;const P=_+T+E;b+=c[0].length-P.length;const R=[b,b+_.length],z=[b+_.length+T.length,b+_.length+T.length+E.length];d.push(R),d.push(z),m.push([b+_.length,b+_.length+T.length])}return{remove:d,format:m}}),i.model.document.on("change:data",(a,c)=>{if(c.type=="transparent"||!e.isEnabled)return;const d=i.model,m=d.document.selection;if(!m.isCollapsed)return;const b=Array.from(d.document.differ.getChanges()),_=b[0];if(b.length!=1||_.type!=="insert"||_.name!="$text"||_.length!=1)return;const T=m.focus,E=T.parent,{text:P,range:R}=function(ue,xe){let He=ue.start;return{text:Array.from(ue.getItems()).reduce((Qt,_t)=>!_t.is("$text")&&!_t.is("$textProxy")||_t.getAttribute("code")?(He=xe.createPositionAfter(_t),""):Qt+_t.data,""),range:xe.createRange(He,ue.end)}}(d.createRange(d.createPositionAt(E,0),T),d),z=r(P),$=Lf(R.start,z.format,d),J=Lf(R.start,z.remove,d);$.length&&J.length&&d.enqueueChange(ue=>{if(n(ue,$)!==!1)for(const xe of J.reverse())ue.remove(xe)})})}function Lf(i,e,t){return e.filter(n=>n[0]!==void 0&&n[1]!==void 0).map(n=>t.createRange(i.getShiftedBy(n[0]),i.getShiftedBy(n[1])))}function Xc(i,e){return(t,n)=>{if(!i.commands.get(e).isEnabled)return!1;const o=i.model.schema.getValidRanges(n,e);for(const r of o)t.setAttribute(e,!0,r);t.removeSelectionAttribute(e)}}class zf extends pt{constructor(e,t){super(e),this.attributeKey=t}refresh(){const e=this.editor.model,t=e.document;this.value=this._getValueFromFirstAllowedNode(),this.isEnabled=e.schema.checkAttributeInSelection(t.selection,this.attributeKey)}execute(e={}){const t=this.editor.model,n=t.document.selection,o=e.forceValue===void 0?!this.value:e.forceValue;t.change(r=>{if(n.isCollapsed)o?r.setSelectionAttribute(this.attributeKey,!0):r.removeSelectionAttribute(this.attributeKey);else{const a=t.schema.getValidRanges(n.getRanges(),this.attributeKey);for(const c of a)o?r.setAttribute(this.attributeKey,o,c):r.removeAttribute(this.attributeKey,c)}})}_getValueFromFirstAllowedNode(){const e=this.editor.model,t=e.schema,n=e.document.selection;if(n.isCollapsed)return n.hasAttribute(this.attributeKey);for(const o of n.getRanges())for(const r of o.getItems())if(t.checkAttribute(r,this.attributeKey))return r.hasAttribute(this.attributeKey);return!1}}class jb extends ve{static get pluginName(){return"BoldEditing"}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:"bold"}),e.model.schema.setAttributeProperties("bold",{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:"bold",view:"strong",upcastAlso:["b",t=>{const n=t.getStyle("font-weight");return n?n=="bold"||Number(n)>=600?{name:!0,styles:["font-weight"]}:void 0:null}]}),e.commands.add("bold",new zf(e,"bold")),e.keystrokes.set("CTRL+B","bold")}}class Ib extends ve{static get pluginName(){return"BoldUI"}init(){const e=this.editor,t=e.t;e.ui.componentFactory.add("bold",n=>{const o=e.commands.get("bold"),r=new nn(n);return r.set({label:t("Bold"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M10.187 17H5.773c-.637 0-1.092-.138-1.364-.415-.273-.277-.409-.718-.409-1.323V4.738c0-.617.14-1.062.419-1.332.279-.27.73-.406 1.354-.406h4.68c.69 0 1.288.041 1.793.124.506.083.96.242 1.36.478.341.197.644.447.906.75a3.262 3.262 0 0 1 .808 2.162c0 1.401-.722 2.426-2.167 3.075C15.05 10.175 16 11.315 16 13.01a3.756 3.756 0 0 1-2.296 3.504 6.1 6.1 0 0 1-1.517.377c-.571.073-1.238.11-2 .11zm-.217-6.217H7v4.087h3.069c1.977 0 2.965-.69 2.965-2.072 0-.707-.256-1.22-.768-1.537-.512-.319-1.277-.478-2.296-.478zM7 5.13v3.619h2.606c.729 0 1.292-.067 1.69-.2a1.6 1.6 0 0 0 .91-.765c.165-.267.247-.566.247-.897 0-.707-.26-1.176-.778-1.409-.519-.232-1.31-.348-2.375-.348H7z"/></svg>',keystroke:"CTRL+B",tooltip:!0,isToggleable:!0}),r.bind("isOn","isEnabled").to(o,"value","isEnabled"),this.listenTo(r,"execute",()=>{e.execute("bold"),e.editing.view.focus()}),r})}}class Pb extends ve{static get pluginName(){return"ItalicEditing"}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:"italic"}),e.model.schema.setAttributeProperties("italic",{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:"italic",view:"i",upcastAlso:["em",{styles:{"font-style":"italic"}}]}),e.commands.add("italic",new zf(e,"italic")),e.keystrokes.set("CTRL+I","italic")}}class Mb extends ve{static get pluginName(){return"ItalicUI"}init(){const e=this.editor,t=e.t;e.ui.componentFactory.add("italic",n=>{const o=e.commands.get("italic"),r=new nn(n);return r.set({label:t("Italic"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m9.586 14.633.021.004c-.036.335.095.655.393.962.082.083.173.15.274.201h1.474a.6.6 0 1 1 0 1.2H5.304a.6.6 0 0 1 0-1.2h1.15c.474-.07.809-.182 1.005-.334.157-.122.291-.32.404-.597l2.416-9.55a1.053 1.053 0 0 0-.281-.823 1.12 1.12 0 0 0-.442-.296H8.15a.6.6 0 0 1 0-1.2h6.443a.6.6 0 1 1 0 1.2h-1.195c-.376.056-.65.155-.823.296-.215.175-.423.439-.623.79l-2.366 9.347z"/></svg>',keystroke:"CTRL+I",tooltip:!0,isToggleable:!0}),r.bind("isOn","isEnabled").to(o,"value","isEnabled"),this.listenTo(r,"execute",()=>{e.execute("italic"),e.editing.view.focus()}),r})}}class Ob extends pt{refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){const t=this.editor.model,n=t.schema,o=t.document.selection,r=Array.from(o.getSelectedBlocks()),a=e.forceValue===void 0?!this.value:e.forceValue;t.change(c=>{if(a){const d=r.filter(m=>Jc(m)||Ff(n,m));this._applyQuote(c,d)}else this._removeQuote(c,r.filter(Jc))})}_getValue(){const e=so(this.editor.model.document.selection.getSelectedBlocks());return!(!e||!Jc(e))}_checkEnabled(){if(this.value)return!0;const e=this.editor.model.document.selection,t=this.editor.model.schema,n=so(e.getSelectedBlocks());return!!n&&Ff(t,n)}_removeQuote(e,t){Bf(e,t).reverse().forEach(n=>{if(n.start.isAtStart&&n.end.isAtEnd)return void e.unwrap(n.start.parent);if(n.start.isAtStart){const r=e.createPositionBefore(n.start.parent);return void e.move(n,r)}n.end.isAtEnd||e.split(n.end);const o=e.createPositionAfter(n.end.parent);e.move(n,o)})}_applyQuote(e,t){const n=[];Bf(e,t).reverse().forEach(o=>{let r=Jc(o.start);r||(r=e.createElement("blockQuote"),e.wrap(o,r)),n.push(r)}),n.reverse().reduce((o,r)=>o.nextSibling==r?(e.merge(e.createPositionAfter(o)),o):r)}}function Jc(i){return i.parent.name=="blockQuote"?i.parent:null}function Bf(i,e){let t,n=0;const o=[];for(;n<e.length;){const r=e[n],a=e[n+1];t||(t=i.createPositionBefore(r)),a&&r.nextSibling==a||(o.push(i.createRange(t,i.createPositionAfter(r))),t=null),n++}return o}function Ff(i,e){const t=i.checkChild(e.parent,"blockQuote"),n=i.checkChild(["$root","blockQuote"],e);return t&&n}class Rb extends ve{static get pluginName(){return"BlockQuoteEditing"}static get requires(){return[Wc,as]}init(){const e=this.editor,t=e.model.schema;e.commands.add("blockQuote",new Ob(e)),t.register("blockQuote",{allowWhere:"$block",allowContentOf:"$root"}),e.conversion.elementToElement({model:"blockQuote",view:"blockquote"}),e.model.document.registerPostFixer(a=>{const c=e.model.document.differ.getChanges();for(const d of c)if(d.type=="insert"){const m=d.position.nodeAfter;if(!m)continue;if(m.is("element","blockQuote")&&m.isEmpty)return a.remove(m),!0;if(m.is("element","blockQuote")&&!t.checkChild(d.position,m))return a.unwrap(m),!0;if(m.is("element")){const b=a.createRangeIn(m);for(const _ of b.getItems())if(_.is("element","blockQuote")&&!t.checkChild(a.createPositionBefore(_),_))return a.unwrap(_),!0}}else if(d.type=="remove"){const m=d.position.parent;if(m.is("element","blockQuote")&&m.isEmpty)return a.remove(m),!0}return!1});const n=this.editor.editing.view.document,o=e.model.document.selection,r=e.commands.get("blockQuote");this.listenTo(n,"enter",(a,c)=>{!o.isCollapsed||!r.value||o.getLastPosition().parent.isEmpty&&(e.execute("blockQuote"),e.editing.view.scrollToTheSelection(),c.preventDefault(),a.stop())},{context:"blockquote"}),this.listenTo(n,"delete",(a,c)=>{if(c.direction!="backward"||!o.isCollapsed||!r.value)return;const d=o.getLastPosition().parent;d.isEmpty&&!d.previousSibling&&(e.execute("blockQuote"),e.editing.view.scrollToTheSelection(),c.preventDefault(),a.stop())},{context:"blockquote"})}}w(69);class Vb extends ve{static get pluginName(){return"BlockQuoteUI"}init(){const e=this.editor,t=e.t;e.ui.componentFactory.add("blockQuote",n=>{const o=e.commands.get("blockQuote"),r=new nn(n);return r.set({label:t("Block quote"),icon:Co.quote,tooltip:!0,isToggleable:!0}),r.bind("isOn","isEnabled").to(o,"value","isEnabled"),this.listenTo(r,"execute",()=>{e.execute("blockQuote"),e.editing.view.focus()}),r})}}class Lb extends ve{static get pluginName(){return"CKFinderUI"}init(){const e=this.editor,t=e.ui.componentFactory,n=e.t;t.add("ckfinder",o=>{const r=e.commands.get("ckfinder"),a=new nn(o);return a.set({label:n("Insert image or file"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M11.627 16.5zm5.873-.196zm0-7.001V8h-13v8.5h4.341c.191.54.457 1.044.785 1.5H2a1.5 1.5 0 0 1-1.5-1.5v-13A1.5 1.5 0 0 1 2 2h4.5a1.5 1.5 0 0 1 1.06.44L9.122 4H16a1.5 1.5 0 0 1 1.5 1.5v1A1.5 1.5 0 0 1 19 8v2.531a6.027 6.027 0 0 0-1.5-1.228zM16 6.5v-1H8.5l-2-2H2v13h1V8a1.5 1.5 0 0 1 1.5-1.5H16z"/><path d="M14.5 19.5a5 5 0 1 1 0-10 5 5 0 0 1 0 10zM15 14v-2h-1v2h-2v1h2v2h1v-2h2v-1h-2z"/></svg>',tooltip:!0}),a.bind("isEnabled").to(r),a.on("execute",()=>{e.execute("ckfinder"),e.editing.view.focus()}),a})}}class zb extends pt{constructor(e){super(e),this.stopListening(this.editor.model.document,"change"),this.listenTo(this.editor.model.document,"change",()=>this.refresh(),{priority:"low"})}refresh(){const e=this.editor.commands.get("insertImage"),t=this.editor.commands.get("link");this.isEnabled=e.isEnabled||t.isEnabled}execute(){const e=this.editor,t=this.editor.config.get("ckfinder.openerMethod")||"modal";if(t!="popup"&&t!="modal")throw new C.a("ckfinder-unknown-openermethod",e);const n=this.editor.config.get("ckfinder.options")||{};n.chooseFiles=!0;const o=n.onInit;n.language||(n.language=e.locale.uiLanguage),n.onInit=r=>{o&&o(r),r.on("files:choose",a=>{const c=a.data.files.toArray(),d=c.filter(_=>!_.isImage()),m=c.filter(_=>_.isImage());for(const _ of d)e.execute("link",_.getUrl());const b=[];for(const _ of m){const T=_.getUrl();b.push(T||r.request("file:getProxyUrl",{file:_}))}b.length&&qf(e,b)}),r.on("file:choose:resizedImage",a=>{const c=a.data.resizedUrl;if(c)qf(e,[c]);else{const d=e.plugins.get("Notification"),m=e.locale.t;d.showWarning(m("Could not obtain resized image URL."),{title:m("Selecting resized image failed"),namespace:"ckfinder"})}})},window.CKFinder[t](n)}}function qf(i,e){if(i.commands.get("insertImage").isEnabled)i.execute("insertImage",{source:e});else{const t=i.plugins.get("Notification"),n=i.locale.t;t.showWarning(n("Could not insert image at the current position."),{title:n("Inserting image failed"),namespace:"ckfinder"})}}class Bb extends ve{static get pluginName(){return"CKFinderEditing"}static get requires(){return[Rd,"LinkEditing"]}init(){const e=this.editor;if(!e.plugins.has("ImageBlockEditing")&&!e.plugins.has("ImageInlineEditing"))throw new C.a("ckfinder-missing-image-plugin",e);e.commands.add("ckfinder",new zb(e))}}class Fb extends ve{static get pluginName(){return"CloudServicesUploadAdapter"}static get requires(){return["CloudServices",oi]}init(){const e=this.editor,t=e.plugins.get("CloudServices"),n=t.token,o=t.uploadUrl;n&&(this._uploadGateway=e.plugins.get("CloudServicesCore").createUploadGateway(n,o),e.plugins.get(oi).createUploadAdapter=r=>new Xd(this._uploadGateway,r))}}class Xd{constructor(e,t){this.uploadGateway=e,this.loader=t}upload(){return this.loader.file.then(e=>(this.fileUploader=this.uploadGateway.upload(e),this.fileUploader.on("progress",(t,n)=>{this.loader.uploadTotal=n.total,this.loader.uploaded=n.uploaded}),this.fileUploader.send()))}abort(){this.fileUploader.abort()}}class Hf extends pt{refresh(){const e=this.editor.model,t=so(e.document.selection.getSelectedBlocks());this.value=!!t&&t.is("element","paragraph"),this.isEnabled=!!t&&Jd(t,e.schema)}execute(e={}){const t=this.editor.model,n=t.document;t.change(o=>{const r=(e.selection||n.selection).getSelectedBlocks();for(const a of r)!a.is("element","paragraph")&&Jd(a,t.schema)&&o.rename(a,"paragraph")})}}function Jd(i,e){return e.checkChild(i.parent,"paragraph")&&!e.isObject(i)}class qb extends pt{execute(e){const t=this.editor.model;let n=e.position;t.change(o=>{const r=o.createElement("paragraph");if(!t.schema.checkChild(n.parent,r)){const a=t.schema.findAllowedParent(n,r);if(!a)return;n=o.split(n,a).position}t.insertContent(r,n),o.setSelection(r,"in")})}}class pl extends ve{static get pluginName(){return"Paragraph"}init(){const e=this.editor,t=e.model;e.commands.add("paragraph",new Hf(e)),e.commands.add("insertParagraph",new qb(e)),t.schema.register("paragraph",{inheritAllFrom:"$block"}),e.conversion.elementToElement({model:"paragraph",view:"p"}),e.conversion.for("upcast").elementToElement({model:(n,{writer:o})=>pl.paragraphLikeElements.has(n.name)?n.isEmpty?null:o.createElement("paragraph"):null,view:/.+/,converterPriority:"low"})}}pl.paragraphLikeElements=new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td","th"]);class Hb extends pt{constructor(e,t){super(e),this.modelElements=t}refresh(){const e=so(this.editor.model.document.selection.getSelectedBlocks());this.value=!!e&&this.modelElements.includes(e.name)&&e.name,this.isEnabled=!!e&&this.modelElements.some(t=>Zc(e,t,this.editor.model.schema))}execute(e){const t=this.editor.model,n=t.document,o=e.value;t.change(r=>{const a=Array.from(n.selection.getSelectedBlocks()).filter(c=>Zc(c,o,t.schema));for(const c of a)c.is("element",o)||r.rename(c,o)})}}function Zc(i,e,t){return t.checkChild(i.parent,e)&&!t.isObject(i)}class $b extends ve{static get pluginName(){return"HeadingEditing"}constructor(e){super(e),e.config.define("heading",{options:[{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h2",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h3",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h4",title:"Heading 3",class:"ck-heading_heading3"}]})}static get requires(){return[pl]}init(){const e=this.editor,t=e.config.get("heading.options"),n=[];for(const o of t)o.model!=="paragraph"&&(e.model.schema.register(o.model,{inheritAllFrom:"$block"}),e.conversion.elementToElement(o),n.push(o.model));this._addDefaultH1Conversion(e),e.commands.add("heading",new Hb(e,n))}afterInit(){const e=this.editor,t=e.commands.get("enter"),n=e.config.get("heading.options");t&&this.listenTo(t,"afterExecute",(o,r)=>{const a=e.model.document.selection.getFirstPosition().parent;n.some(c=>a.is("element",c.model))&&!a.is("element","paragraph")&&a.childCount===0&&r.writer.rename(a,"paragraph")})}_addDefaultH1Conversion(e){e.conversion.for("upcast").elementToElement({model:"heading1",view:"h1",converterPriority:O.get("low")+1})}}w(13);class Ub extends ve{static get pluginName(){return"HeadingUI"}init(){const e=this.editor,t=e.t,n=function(a){const c=a.t,d={Paragraph:c("Paragraph"),"Heading 1":c("Heading 1"),"Heading 2":c("Heading 2"),"Heading 3":c("Heading 3"),"Heading 4":c("Heading 4"),"Heading 5":c("Heading 5"),"Heading 6":c("Heading 6")};return a.config.get("heading.options").map(m=>{const b=d[m.title];return b&&b!=m.title&&(m.title=b),m})}(e),o=t("Choose heading"),r=t("Heading");e.ui.componentFactory.add("heading",a=>{const c={},d=new io,m=e.commands.get("heading"),b=e.commands.get("paragraph"),_=[m];for(const E of n){const P={type:"button",model:new Vd({label:E.title,class:E.class,withText:!0})};E.model==="paragraph"?(P.model.bind("isOn").to(b,"value"),P.model.set("commandName","paragraph"),_.push(b)):(P.model.bind("isOn").to(m,"value",R=>R===E.model),P.model.set({commandName:"heading",commandValue:E.model})),d.add(P),c[E.model]=E.title}const T=rs(a);return ef(T,d),T.buttonView.set({isOn:!1,withText:!0,tooltip:r}),T.extendTemplate({attributes:{class:["ck-heading-dropdown"]}}),T.bind("isEnabled").toMany(_,"isEnabled",(...E)=>E.some(P=>P)),T.buttonView.bind("label").to(m,"value",b,"value",(E,P)=>{const R=E||P&&"paragraph";return c[R]?c[R]:o}),this.listenTo(T,"execute",E=>{e.execute(E.source.commandName,E.source.commandValue?{value:E.source.commandValue}:void 0),e.editing.view.focus()}),T})}}class eu extends ve{static get requires(){return[cl]}static get pluginName(){return"WidgetToolbarRepository"}init(){const e=this.editor;if(e.plugins.has("BalloonToolbar")){const t=e.plugins.get("BalloonToolbar");this.listenTo(t,"show",n=>{(function(o){const r=o.getSelectedElement();return!(!r||!it(r))})(e.editing.view.document.selection)&&n.stop()},{priority:"high"})}this._toolbarDefinitions=new Map,this._balloon=this.editor.plugins.get("ContextualBalloon"),this.on("change:isEnabled",()=>{this._updateToolbarsVisibility()}),this.listenTo(e.ui,"update",()=>{this._updateToolbarsVisibility()}),this.listenTo(e.ui.focusTracker,"change:isFocused",()=>{this._updateToolbarsVisibility()},{priority:"low"})}destroy(){super.destroy();for(const e of this._toolbarDefinitions.values())e.view.destroy()}register(e,{ariaLabel:t,items:n,getRelatedElement:o,balloonClassName:r="ck-toolbar-container"}){if(!n.length)return void Object(C.b)("widget-toolbar-no-items",{toolbarId:e});const a=this.editor,c=a.t,d=new Pd(a.locale);if(d.ariaLabel=t||c("Widget toolbar"),this._toolbarDefinitions.has(e))throw new C.a("widget-toolbar-duplicated",this,{toolbarId:e});d.fillFromConfig(n,a.ui.componentFactory),this._toolbarDefinitions.set(e,{view:d,getRelatedElement:o,balloonClassName:r})}_updateToolbarsVisibility(){let e=0,t=null,n=null;for(const o of this._toolbarDefinitions.values()){const r=o.getRelatedElement(this.editor.editing.view.document.selection);if(this.isEnabled&&r)if(this.editor.ui.focusTracker.isFocused){const a=r.getAncestors().length;a>e&&(e=a,t=r,n=o)}else this._isToolbarVisible(o)&&this._hideToolbar(o);else this._isToolbarInBalloon(o)&&this._hideToolbar(o)}n&&this._showToolbar(n,t)}_hideToolbar(e){this._balloon.remove(e.view),this.stopListening(this._balloon,"change:visibleView")}_showToolbar(e,t){this._isToolbarVisible(e)?to(this.editor,t):this._isToolbarInBalloon(e)||(this._balloon.add({view:e.view,position:tu(this.editor,t),balloonClassName:e.balloonClassName}),this.listenTo(this._balloon,"change:visibleView",()=>{for(const n of this._toolbarDefinitions.values())if(this._isToolbarVisible(n)){const o=n.getRelatedElement(this.editor.editing.view.document.selection);to(this.editor,o)}}))}_isToolbarVisible(e){return this._balloon.visibleView===e.view}_isToolbarInBalloon(e){return this._balloon.hasView(e.view)}}function to(i,e){const t=i.plugins.get("ContextualBalloon"),n=tu(i,e);t.updatePosition(n)}function tu(i,e){const t=i.editing.view,n=ht.defaultPositions;return{target:t.domConverter.mapViewToDom(e),positions:[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast,nb]}}class $f{constructor(e){this.set("activeHandlePosition",null),this.set("proposedWidthPercents",null),this.set("proposedWidth",null),this.set("proposedHeight",null),this.set("proposedHandleHostWidth",null),this.set("proposedHandleHostHeight",null),this._options=e,this._referenceCoordinates=null}begin(e,t,n){const o=new Et(t);this.activeHandlePosition=function(a){const c=["top-left","top-right","bottom-right","bottom-left"];for(const d of c)if(a.classList.contains("ck-widget__resizer__handle-"+d))return d}(e),this._referenceCoordinates=function(a,c){const d=new Et(a),m=c.split("-"),b={x:m[1]=="right"?d.right:d.left,y:m[0]=="bottom"?d.bottom:d.top};return b.x+=a.ownerDocument.defaultView.scrollX,b.y+=a.ownerDocument.defaultView.scrollY,b}(t,function(a){const c=a.split("-"),d={top:"bottom",bottom:"top",left:"right",right:"left"};return`${d[c[0]]}-${d[c[1]]}`}(this.activeHandlePosition)),this.originalWidth=o.width,this.originalHeight=o.height,this.aspectRatio=o.width/o.height;const r=n.style.width;r&&r.match(/^\d+(\.\d*)?%$/)?this.originalWidthPercents=parseFloat(r):this.originalWidthPercents=function(a,c){const d=a.parentElement,m=parseFloat(d.ownerDocument.defaultView.getComputedStyle(d).width);return c.width/m*100}(n,o)}update(e){this.proposedWidth=e.width,this.proposedHeight=e.height,this.proposedWidthPercents=e.widthPercents,this.proposedHandleHostWidth=e.handleHostWidth,this.proposedHandleHostHeight=e.handleHostHeight}}Be($f,Wt);class Wb extends gt{constructor(){super();const e=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-size-view",e.to("_viewPosition",t=>t?"ck-orientation-"+t:"")],style:{display:e.if("_isVisible","none",t=>!t)}},children:[{text:e.to("_label")}]})}_bindToState(e,t){this.bind("_isVisible").to(t,"proposedWidth",t,"proposedHeight",(n,o)=>n!==null&&o!==null),this.bind("_label").to(t,"proposedHandleHostWidth",t,"proposedHandleHostHeight",t,"proposedWidthPercents",(n,o,r)=>e.unit==="px"?`${n}×${o}`:r+"%"),this.bind("_viewPosition").to(t,"activeHandlePosition",t,"proposedHandleHostWidth",t,"proposedHandleHostHeight",(n,o,r)=>o<50||r<50?"above-center":n)}_dismiss(){this.unbind(),this._isVisible=!1}}class Zd{constructor(e){this._options=e,this._viewResizerWrapper=null,this.set("isEnabled",!0),this.decorate("begin"),this.decorate("cancel"),this.decorate("commit"),this.decorate("updateSize"),this.on("commit",t=>{this.state.proposedWidth||this.state.proposedWidthPercents||(this._cleanup(),t.stop())},{priority:"high"}),this.on("change:isEnabled",()=>{this.isEnabled&&this.redraw()})}attach(){const e=this,t=this._options.viewElement;this._options.editor.editing.view.change(n=>{const o=n.createUIElement("div",{class:"ck ck-reset_all ck-widget__resizer"},function(r){const a=this.toDomElement(r);return e._appendHandles(a),e._appendSizeUI(a),e.on("change:isEnabled",(c,d,m)=>{a.style.display=m?"":"none"}),a.style.display=e.isEnabled?"":"none",a});n.insert(n.createPositionAt(t,"end"),o),n.addClass("ck-widget_with-resizer",t),this._viewResizerWrapper=o})}begin(e){this.state=new $f(this._options),this._sizeView._bindToState(this._options,this.state),this._initialViewWidth=this._options.viewElement.getStyle("width"),this.state.begin(e,this._getHandleHost(),this._getResizeHost())}updateSize(e){const t=this._proposeNewSize(e);this._options.editor.editing.view.change(a=>{const c=this._options.unit||"%",d=(c==="%"?t.widthPercents:t.width)+c;a.setStyle("width",d,this._options.viewElement)});const n=this._getHandleHost(),o=new Et(n);t.handleHostWidth=Math.round(o.width),t.handleHostHeight=Math.round(o.height);const r=new Et(n);t.width=Math.round(r.width),t.height=Math.round(r.height),this.redraw(o),this.state.update(t)}commit(){const e=this._options.unit||"%",t=(e==="%"?this.state.proposedWidthPercents:this.state.proposedWidth)+e;this._options.editor.editing.view.change(()=>{this._cleanup(),this._options.onCommit(t)})}cancel(){this._cleanup()}destroy(){this.cancel()}redraw(e){const t=this._domResizerWrapper;if(!((n=t)&&n.ownerDocument&&n.ownerDocument.contains(n)))return;var n;const o=t.parentElement,r=this._getHandleHost(),a=this._viewResizerWrapper,c=[a.getStyle("width"),a.getStyle("height"),a.getStyle("left"),a.getStyle("top")];let d;if(o.isSameNode(r)){const m=e||new Et(r);d=[m.width+"px",m.height+"px",void 0,void 0]}else d=[r.offsetWidth+"px",r.offsetHeight+"px",r.offsetLeft+"px",r.offsetTop+"px"];B(c,d)!=="same"&&this._options.editor.editing.view.change(m=>{m.setStyle({width:d[0],height:d[1],left:d[2],top:d[3]},a)})}containsHandle(e){return this._domResizerWrapper.contains(e)}static isResizeHandle(e){return e.classList.contains("ck-widget__resizer__handle")}_cleanup(){this._sizeView._dismiss(),this._options.editor.editing.view.change(e=>{e.setStyle("width",this._initialViewWidth,this._options.viewElement)})}_proposeNewSize(e){const t=this.state,n={x:(o=e).pageX,y:o.pageY};var o;const r=!this._options.isCentered||this._options.isCentered(this),a={x:t._referenceCoordinates.x-(n.x+t.originalWidth),y:n.y-t.originalHeight-t._referenceCoordinates.y};r&&t.activeHandlePosition.endsWith("-right")&&(a.x=n.x-(t._referenceCoordinates.x+t.originalWidth)),r&&(a.x*=2);const c={width:Math.abs(t.originalWidth+a.x),height:Math.abs(t.originalHeight+a.y)};c.dominant=c.width/t.aspectRatio>c.height?"width":"height",c.max=c[c.dominant];const d={width:c.width,height:c.height};return c.dominant=="width"?d.height=d.width/t.aspectRatio:d.width=d.height*t.aspectRatio,{width:Math.round(d.width),height:Math.round(d.height),widthPercents:Math.min(Math.round(t.originalWidthPercents/t.originalWidth*d.width*100)/100,100)}}_getResizeHost(){const e=this._domResizerWrapper.parentElement;return this._options.getResizeHost(e)}_getHandleHost(){const e=this._domResizerWrapper.parentElement;return this._options.getHandleHost(e)}get _domResizerWrapper(){return this._options.editor.editing.view.domConverter.mapViewToDom(this._viewResizerWrapper)}_appendHandles(e){const t=["top-left","top-right","bottom-right","bottom-left"];for(const o of t)e.appendChild(new Eo({tag:"div",attributes:{class:"ck-widget__resizer__handle "+(n=o,"ck-widget__resizer__handle-"+n)}}).render());var n}_appendSizeUI(e){this._sizeView=new Wb,this._sizeView.render(),e.appendChild(this._sizeView.element)}}Be(Zd,Wt),w(72),Be(class extends ve{static get pluginName(){return"WidgetResize"}init(){const i=this.editor.editing,e=qt.window.document;this.set("visibleResizer",null),this.set("_activeResizer",null),this._resizers=new Map,i.view.addObserver(Uc),this._observer=Object.create(Zr),this.listenTo(i.view.document,"mousedown",this._mouseDownListener.bind(this),{priority:"high"}),this._observer.listenTo(e,"mousemove",this._mouseMoveListener.bind(this)),this._observer.listenTo(e,"mouseup",this._mouseUpListener.bind(this));const t=()=>{this.visibleResizer&&this.visibleResizer.redraw()};this._redrawFocusedResizerThrottled=qd(t,200),this.on("change:visibleResizer",t),this.editor.ui.on("update",this._redrawFocusedResizerThrottled),this.editor.model.document.on("change",()=>{for(const[o,r]of this._resizers)o.isAttached()||(this._resizers.delete(o),r.destroy())},{priority:"lowest"}),this._observer.listenTo(qt.window,"resize",this._redrawFocusedResizerThrottled);const n=this.editor.editing.view.document.selection;n.on("change",()=>{const o=n.getSelectedElement();this.visibleResizer=this.getResizerByViewElement(o)||null})}destroy(){this._observer.stopListening();for(const i of this._resizers.values())i.destroy();this._redrawFocusedResizerThrottled.cancel()}attachTo(i){const e=new Zd(i),t=this.editor.plugins;if(e.attach(),t.has("WidgetToolbarRepository")){const o=t.get("WidgetToolbarRepository");e.on("begin",()=>{o.forceDisabled("resize")},{priority:"lowest"}),e.on("cancel",()=>{o.clearForceDisabled("resize")},{priority:"highest"}),e.on("commit",()=>{o.clearForceDisabled("resize")},{priority:"highest"})}this._resizers.set(i.viewElement,e);const n=this.editor.editing.view.document.selection.getSelectedElement();return this.getResizerByViewElement(n)==e&&(this.visibleResizer=e),e}getResizerByViewElement(i){return this._resizers.get(i)}_getResizerByHandle(i){for(const e of this._resizers.values())if(e.containsHandle(i))return e}_mouseDownListener(i,e){const t=e.domTarget;Zd.isResizeHandle(t)&&(this._activeResizer=this._getResizerByHandle(t),this._activeResizer&&(this._activeResizer.begin(t),i.stop(),e.preventDefault()))}_mouseMoveListener(i,e){this._activeResizer&&this._activeResizer.updateSize(e)}_mouseUpListener(){this._activeResizer&&(this._activeResizer.commit(),this._activeResizer=null)}},Wt);class Kb extends pt{refresh(){const e=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!e,this.isEnabled&&e.hasAttribute("alt")?this.value=e.getAttribute("alt"):this.value=!1}execute(e){const t=this.editor,n=t.plugins.get("ImageUtils"),o=t.model,r=n.getClosestSelectedImageElement(o.document.selection);o.change(a=>{a.setAttribute("alt",e.newValue,r)})}}function gl(i,e){const t=i.createEmptyElement("img"),n=e==="imageBlock"?i.createContainerElement("figure",{class:"image"}):i.createContainerElement("span",{class:"image-inline"},{isAllowedInsideAttributeElement:!0});return i.insert(i.createPositionAt(n,0),t),n}function Uf(i,e){if(i.plugins.has("ImageInlineEditing")!==i.plugins.has("ImageBlockEditing"))return{name:"img",attributes:{src:!0}};const t=i.plugins.get("ImageUtils");return n=>!t.isInlineImageView(n)||!n.hasAttribute("src")||(n.findAncestor(t.isBlockImageView)?"imageBlock":"imageInline")!==e?null:{name:!0,attributes:["src"]}}function bl(i,e){const t=so(e.getSelectedBlocks());return!t||i.isObject(t)||t.isEmpty&&t.name!="listItem"?"imageBlock":"imageInline"}class Di extends ve{static get pluginName(){return"ImageUtils"}isImage(e){return this.isInlineImage(e)||this.isBlockImage(e)}isInlineImageView(e){return!!e&&e.is("element","img")}isBlockImageView(e){return!!e&&e.is("element","figure")&&e.hasClass("image")}insertImage(e={},t=null,n=null){const o=this.editor,r=o.model,a=r.document.selection;n=Wf(o,t||a,n),e={...Object.fromEntries(a.getAttributes()),...e};for(const c in e)r.schema.checkAttribute(n,c)||delete e[c];return r.change(c=>{const d=c.createElement(n,e);return t||n=="imageInline"||(t=hl(a,r)),r.insertContent(d,t),d.parent?(c.setSelection(d,"on"),d):null})}getClosestSelectedImageWidget(e){const t=e.getSelectedElement();if(t&&this.isImageWidget(t))return t;let n=e.getFirstPosition().parent;for(;n;){if(n.is("element")&&this.isImageWidget(n))return n;n=n.parent}return null}getClosestSelectedImageElement(e){const t=e.getSelectedElement();return this.isImage(t)?t:e.getFirstPosition().findAncestor("imageBlock")}isImageAllowed(){const e=this.editor.model.document.selection;return function(t,n){if(Wf(t,n)=="imageBlock"){const o=function(r,a){const c=hl(r,a).start.parent;return c.isEmpty&&!c.is("element","$root")?c.parent:c}(n,t.model);if(t.model.schema.checkChild(o,"imageBlock"))return!0}else if(t.model.schema.checkChild(n.focus,"imageInline"))return!0;return!1}(this.editor,e)&&function(t){return[...t.focus.getAncestors()].every(n=>!n.is("element","imageBlock"))}(e)}toImageWidget(e,t,n){return t.setCustomProperty("image",!0,e),on(e,t,{label:()=>{const o=this.findViewImgElement(e).getAttribute("alt");return o?`${o} ${n}`:n}})}isImageWidget(e){return!!e.getCustomProperty("image")&&it(e)}isBlockImage(e){return!!e&&e.is("element","imageBlock")}isInlineImage(e){return!!e&&e.is("element","imageInline")}findViewImgElement(e){if(this.isInlineImageView(e))return e;const t=this.editor.editing.view;for(const{item:n}of t.createRangeIn(e))if(this.isInlineImageView(n))return n}}function Wf(i,e,t){const n=i.model.schema,o=i.config.get("image.insert.type");return i.plugins.has("ImageBlockEditing")?i.plugins.has("ImageInlineEditing")?t||(o==="inline"?"imageInline":o==="block"?"imageBlock":e.is("selection")?bl(n,e):n.checkChild(e,"imageInline")?"imageInline":"imageBlock"):"imageBlock":"imageInline"}class Gb extends ve{static get requires(){return[Di]}static get pluginName(){return"ImageTextAlternativeEditing"}init(){this.editor.commands.add("imageTextAlternative",new Kb(this.editor))}}w(74),w(7);class Qb extends gt{constructor(e){super(e);const t=this.locale.t;this.focusTracker=new Lo,this.keystrokes=new yo,this.labeledInput=this._createLabeledInputView(),this.saveButtonView=this._createButton(t("Save"),Co.check,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(t("Cancel"),Co.cancel,"ck-button-cancel","cancel"),this._focusables=new os,this._focusCycler=new Ms({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-text-alternative-form","ck-responsive-form"],tabindex:"-1"},children:[this.labeledInput,this.saveButtonView,this.cancelButtonView]}),Ad(this)}render(){super.render(),this.keystrokes.listenTo(this.element),Sd({view:this}),[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)})}_createButton(e,t,n,o){const r=new nn(this.locale);return r.set({label:e,icon:t,tooltip:!0}),r.extendTemplate({attributes:{class:n}}),o&&r.delegate("execute").to(this,o),r}_createLabeledInputView(){const e=this.locale.t,t=new Md(this.locale,Od);return t.label=e("Text alternative"),t}}function eh(i){const e=i.editing.view,t=ht.defaultPositions,n=i.plugins.get("ImageUtils");return{target:e.domConverter.viewToDom(n.getClosestSelectedImageWidget(e.document.selection)),positions:[t.northArrowSouth,t.northArrowSouthWest,t.northArrowSouthEast,t.southArrowNorth,t.southArrowNorthWest,t.southArrowNorthEast]}}class Yb extends ve{static get requires(){return[cl]}static get pluginName(){return"ImageTextAlternativeUI"}init(){this._createButton(),this._createForm()}destroy(){super.destroy(),this._form.destroy()}_createButton(){const e=this.editor,t=e.t;e.ui.componentFactory.add("imageTextAlternative",n=>{const o=e.commands.get("imageTextAlternative"),r=new nn(n);return r.set({label:t("Change image text alternative"),icon:Co.lowVision,tooltip:!0}),r.bind("isEnabled").to(o,"isEnabled"),this.listenTo(r,"execute",()=>{this._showForm()}),r})}_createForm(){const e=this.editor,t=e.editing.view.document,n=e.plugins.get("ImageUtils");this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new Qb(e.locale),this._form.render(),this.listenTo(this._form,"submit",()=>{e.execute("imageTextAlternative",{newValue:this._form.labeledInput.fieldView.element.value}),this._hideForm(!0)}),this.listenTo(this._form,"cancel",()=>{this._hideForm(!0)}),this._form.keystrokes.set("Esc",(o,r)=>{this._hideForm(!0),r()}),this.listenTo(e.ui,"update",()=>{n.getClosestSelectedImageWidget(t.selection)?this._isVisible&&function(o){const r=o.plugins.get("ContextualBalloon");if(o.plugins.get("ImageUtils").getClosestSelectedImageWidget(o.editing.view.document.selection)){const a=eh(o);r.updatePosition(a)}}(e):this._hideForm(!0)}),Ed({emitter:this._form,activator:()=>this._isVisible,contextElements:[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(){if(this._isVisible)return;const e=this.editor,t=e.commands.get("imageTextAlternative"),n=this._form.labeledInput;this._form.disableCssTransitions(),this._isInBalloon||this._balloon.add({view:this._form,position:eh(e)}),n.fieldView.value=n.fieldView.element.value=t.value||"",this._form.labeledInput.fieldView.select(),this._form.enableCssTransitions()}_hideForm(e){this._isInBalloon&&(this._form.focusTracker.isFocused&&this._form.saveButtonView.focus(),this._balloon.remove(this._form),e&&this.editor.editing.view.focus())}get _isVisible(){return this._balloon.visibleView===this._form}get _isInBalloon(){return this._balloon.hasView(this._form)}}class Kf extends ve{static get requires(){return[Gb,Yb]}static get pluginName(){return"ImageTextAlternative"}}function Gf(i,e){return n=>{n.on("attribute:srcset:"+e,t)};function t(n,o,r){if(!r.consumable.consume(o.item,n.name))return;const a=r.writer,c=r.mapper.toViewElement(o.item),d=i.findViewImgElement(c);if(o.attributeNewValue===null){const m=o.attributeOldValue;m.data&&(a.removeAttribute("srcset",d),a.removeAttribute("sizes",d),m.width&&a.removeAttribute("width",d))}else{const m=o.attributeNewValue;m.data&&(a.setAttribute("srcset",m.data,d),a.setAttribute("sizes","100vw",d),m.width&&a.setAttribute("width",m.width,d))}}}function Ws(i,e,t){return o=>{o.on(`attribute:${t}:${e}`,n)};function n(o,r,a){if(!a.consumable.consume(r.item,o.name))return;const c=a.writer,d=a.mapper.toViewElement(r.item),m=i.findViewImgElement(d);c.setAttribute(r.attributeKey,r.attributeNewValue||"",m)}}class th extends _i{observe(e){this.listenTo(e,"load",(t,n)=>{const o=n.target;this.checkShouldIgnoreEventFromTarget(o)||o.tagName=="IMG"&&this._fireEvents(n)},{useCapture:!0})}_fireEvents(e){this.isEnabled&&(this.document.fire("layoutChanged"),this.document.fire("imageLoaded",e))}}class Xb extends pt{constructor(e){super(e);const t=e.config.get("image.insert.type");e.plugins.has("ImageBlockEditing")||t==="block"&&Object(C.b)("image-block-plugin-required"),e.plugins.has("ImageInlineEditing")||t==="inline"&&Object(C.b)("image-inline-plugin-required")}refresh(){this.isEnabled=this.editor.plugins.get("ImageUtils").isImageAllowed()}execute(e){const t=Tt(e.source),n=this.editor.model.document.selection,o=this.editor.plugins.get("ImageUtils"),r=Object.fromEntries(n.getAttributes());t.forEach((a,c)=>{const d=n.getSelectedElement();if(typeof a=="string"&&(a={src:a}),c&&d&&o.isImage(d)){const m=this.editor.model.createPositionAfter(d);o.insertImage({...a,...r},m)}else o.insertImage({...a,...r})})}}class Qf extends ve{static get requires(){return[Di]}static get pluginName(){return"ImageEditing"}init(){const e=this.editor,t=e.conversion;e.editing.view.addObserver(th),t.for("upcast").attributeToAttribute({view:{name:"img",key:"alt"},model:"alt"}).attributeToAttribute({view:{name:"img",key:"srcset"},model:{key:"srcset",value:o=>{const r={data:o.getAttribute("srcset")};return o.hasAttribute("width")&&(r.width=o.getAttribute("width")),r}}});const n=new Xb(e);e.commands.add("insertImage",n),e.commands.add("imageInsert",n)}}class Yf extends pt{constructor(e,t){super(e),this._modelElementName=t}refresh(){const e=this.editor.plugins.get("ImageUtils"),t=e.getClosestSelectedImageElement(this.editor.model.document.selection);this._modelElementName==="imageBlock"?this.isEnabled=e.isInlineImage(t):this.isEnabled=e.isBlockImage(t)}execute(){const e=this.editor,t=this.editor.model,n=e.plugins.get("ImageUtils"),o=n.getClosestSelectedImageElement(t.document.selection),r=Object.fromEntries(o.getAttributes());return r.src||r.uploadId?t.change(a=>{const c=Array.from(t.markers).filter(b=>b.getRange().containsItem(o)),d=n.insertImage(r,t.createSelection(o,"on"),this._modelElementName);if(!d)return null;const m=a.createRangeOn(d);for(const b of c){const _=b.getRange(),T=_.root.rootName!="$graveyard"?_.getJoined(m,!0):m;a.updateMarker(b,{range:T})}return{oldElement:o,newElement:d}}):null}}class Xf extends ve{static get requires(){return[Qf,Di,sn]}static get pluginName(){return"ImageBlockEditing"}init(){const e=this.editor;e.model.schema.register("imageBlock",{isObject:!0,isBlock:!0,allowWhere:"$block",allowAttributes:["alt","src","srcset"]}),this._setupConversion(),e.plugins.has("ImageInlineEditing")&&(e.commands.add("imageTypeBlock",new Yf(this.editor,"imageBlock")),this._setupClipboardIntegration())}_setupConversion(){const e=this.editor,t=e.t,n=e.conversion,o=e.plugins.get("ImageUtils");n.for("dataDowncast").elementToElement({model:"imageBlock",view:(r,{writer:a})=>gl(a,"imageBlock")}),n.for("editingDowncast").elementToElement({model:"imageBlock",view:(r,{writer:a})=>o.toImageWidget(gl(a,"imageBlock"),a,t("image widget"))}),n.for("downcast").add(Ws(o,"imageBlock","src")).add(Ws(o,"imageBlock","alt")).add(Gf(o,"imageBlock")),n.for("upcast").elementToElement({view:Uf(e,"imageBlock"),model:(r,{writer:a})=>a.createElement("imageBlock",{src:r.getAttribute("src")})}).add(function(r){return c=>{c.on("element:figure",a)};function a(c,d,m){if(!m.consumable.test(d.viewItem,{name:!0,classes:"image"}))return;const b=r.findViewImgElement(d.viewItem);if(!b||!b.hasAttribute("src")||!m.consumable.test(b,{name:!0}))return;const _=so(m.convertItem(b,d.modelCursor).modelRange.getItems());_&&(m.convertChildren(d.viewItem,_),m.updateConversionResult(_,d))}}(o))}_setupClipboardIntegration(){const e=this.editor,t=e.model,n=e.editing.view,o=e.plugins.get("ImageUtils");this.listenTo(e.plugins.get("ClipboardPipeline"),"inputTransformation",(r,a)=>{const c=Array.from(a.content.getChildren());let d;if(!c.every(o.isInlineImageView))return;d=a.targetRanges?e.editing.mapper.toModelRange(a.targetRanges[0]):t.document.selection.getFirstRange();const m=t.createSelection(d);if(bl(t.schema,m)==="imageBlock"){const b=new Bs(n.document),_=c.map(T=>b.createElement("figure",{class:"image"},T));a.content=b.createDocumentFragment(_)}})}}w(11);class Jb extends ve{static get requires(){return[Xf,fl,Kf]}static get pluginName(){return"ImageBlock"}}class Zb extends ve{static get requires(){return[Qf,Di,sn]}static get pluginName(){return"ImageInlineEditing"}init(){const e=this.editor,t=e.model.schema;t.register("imageInline",{isObject:!0,isInline:!0,allowWhere:"$text",allowAttributes:["alt","src","srcset"]}),t.addChildCheck((n,o)=>{if(n.endsWith("caption")&&o.name==="imageInline")return!1}),this._setupConversion(),e.plugins.has("ImageBlockEditing")&&(e.commands.add("imageTypeInline",new Yf(this.editor,"imageInline")),this._setupClipboardIntegration())}_setupConversion(){const e=this.editor,t=e.t,n=e.conversion,o=e.plugins.get("ImageUtils");n.for("dataDowncast").elementToElement({model:"imageInline",view:(r,{writer:a})=>a.createEmptyElement("img")}),n.for("editingDowncast").elementToElement({model:"imageInline",view:(r,{writer:a})=>o.toImageWidget(gl(a,"imageInline"),a,t("image widget"))}),n.for("downcast").add(Ws(o,"imageInline","src")).add(Ws(o,"imageInline","alt")).add(Gf(o,"imageInline")),n.for("upcast").elementToElement({view:Uf(e,"imageInline"),model:(r,{writer:a})=>a.createElement("imageInline",{src:r.getAttribute("src")})})}_setupClipboardIntegration(){const e=this.editor,t=e.model,n=e.editing.view,o=e.plugins.get("ImageUtils");this.listenTo(e.plugins.get("ClipboardPipeline"),"inputTransformation",(r,a)=>{const c=Array.from(a.content.getChildren());let d;if(!c.every(o.isBlockImageView))return;d=a.targetRanges?e.editing.mapper.toModelRange(a.targetRanges[0]):t.document.selection.getFirstRange();const m=t.createSelection(d);if(bl(t.schema,m)==="imageInline"){const b=new Bs(n.document),_=c.map(T=>T.childCount===1?(Array.from(T.getAttributes()).forEach(E=>b.setAttribute(...E,o.findViewImgElement(T))),T.getChild(0)):T);a.content=b.createDocumentFragment(_)}})}}class ev extends ve{static get requires(){return[Zb,fl,Kf]}static get pluginName(){return"ImageInline"}}function nh(i){for(const e of i.getChildren())if(e&&e.is("element","caption"))return e;return null}function oh(i,e){const t=e.getFirstPosition().findAncestor("caption");return t&&i.isBlockImage(t.parent)?t:null}class tv extends pt{refresh(){const e=this.editor,t=e.plugins.get("ImageUtils");if(!e.plugins.has(Xf))return this.isEnabled=!1,void(this.value=!1);const n=e.model.document.selection,o=n.getSelectedElement();if(!o){const r=oh(t,n);return this.isEnabled=!!r,void(this.value=!!r)}this.isEnabled=this.editor.plugins.get("ImageUtils").isImage(o),this.isEnabled?this.value=!!nh(o):this.value=!1}execute(e={}){const{focusCaptionOnShow:t}=e;this.editor.model.change(n=>{this.value?this._hideImageCaption(n):this._showImageCaption(n,t)})}_showImageCaption(e,t){const n=this.editor.model.document.selection,o=this.editor.plugins.get("ImageCaptionEditing");let r=n.getSelectedElement();const a=o._getSavedCaption(r);this.editor.plugins.get("ImageUtils").isInlineImage(r)&&(this.editor.execute("imageTypeBlock"),r=n.getSelectedElement());const c=a||e.createElement("caption");e.append(c,r),t&&e.setSelection(c,"in")}_hideImageCaption(e){const t=this.editor,n=t.model.document.selection,o=t.plugins.get("ImageCaptionEditing"),r=t.plugins.get("ImageUtils");let a,c=n.getSelectedElement();c?a=nh(c):(a=oh(r,n),c=a.parent),o._saveCaption(c,a),e.setSelection(c,"on"),e.remove(a)}}class nv extends ve{static get requires(){return[Di]}static get pluginName(){return"ImageCaptionEditing"}constructor(e){super(e),this._savedCaptionsMap=new WeakMap}init(){const e=this.editor,t=e.model.schema;t.isRegistered("caption")?t.extend("caption",{allowIn:"imageBlock"}):t.register("caption",{allowIn:"imageBlock",allowContentOf:"$block",isLimit:!0}),e.commands.add("toggleImageCaption",new tv(this.editor)),this._setupConversion(),this._setupImageTypeCommandsIntegration()}_setupConversion(){const e=this.editor,t=e.editing.view,n=e.plugins.get("ImageUtils"),o=e.t;e.conversion.for("upcast").elementToElement({view:r=>function(a,c){return c.name=="figcaption"&&a.isBlockImageView(c.parent)?{name:!0}:null}(n,r),model:"caption"}),e.conversion.for("dataDowncast").elementToElement({model:"caption",view:(r,{writer:a})=>n.isBlockImage(r.parent)?a.createContainerElement("figcaption"):null}),e.conversion.for("editingDowncast").elementToElement({model:"caption",view:(r,{writer:a})=>{if(!n.isBlockImage(r.parent))return null;const c=a.createEditableElement("figcaption");a.setCustomProperty("imageCaption",!0,c),af({view:t,element:c,text:o("Enter image caption"),keepOnFocus:!0});const d=Bd(c,a);return Kc(d,a,(m,b,_)=>_.addClass(Tt(b.classes),m),(m,b,_)=>_.removeClass(Tt(b.classes),m)),d}}),e.editing.mapper.on("modelToViewPosition",Jf(t)),e.data.mapper.on("modelToViewPosition",Jf(t))}_setupImageTypeCommandsIntegration(){const e=this.editor,t=e.plugins.get("ImageUtils"),n=e.commands.get("imageTypeInline"),o=e.commands.get("imageTypeBlock"),r=a=>{if(!a.return)return;const{oldElement:c,newElement:d}=a.return;if(!c)return;if(t.isBlockImage(c)){const b=nh(c);if(b)return void this._saveCaption(d,b)}const m=this._getSavedCaption(c);m&&this._saveCaption(d,m)};n&&this.listenTo(n,"execute",r,{priority:"low"}),o&&this.listenTo(o,"execute",r,{priority:"low"})}_getSavedCaption(e){const t=this._savedCaptionsMap.get(e);return t?Pt.fromJSON(t):null}_saveCaption(e,t){this._savedCaptionsMap.set(e,t.toJSON())}}function Jf(i){return(e,t)=>{const n=t.modelPosition,o=n.parent;if(!o.is("element","imageBlock"))return;const r=t.mapper.toViewElement(o);t.viewPosition=i.createPositionAt(r,n.offset+1)}}class ov extends ve{static get requires(){return[Di]}static get pluginName(){return"ImageCaptionUI"}init(){const e=this.editor,t=e.editing.view,n=e.plugins.get("ImageUtils"),o=e.t;e.ui.componentFactory.add("toggleImageCaption",r=>{const a=e.commands.get("toggleImageCaption"),c=new nn(r);return c.set({icon:Co.caption,tooltip:!0,isToggleable:!0}),c.bind("isOn","isEnabled").to(a,"value","isEnabled"),c.bind("label").to(a,"value",d=>o(d?"Toggle caption off":"Toggle caption on")),this.listenTo(c,"execute",()=>{e.execute("toggleImageCaption",{focusCaptionOnShow:!0});const d=oh(n,e.model.document.selection);if(d){const m=e.editing.mapper.toViewElement(d);t.scrollToTheSelection(),t.change(b=>{b.addClass("image__caption_highlighted",m)})}}),c})}}w(78);class iv extends pt{constructor(e,t){super(e),this._defaultStyles={imageBlock:!1,imageInline:!1},this._styles=new Map(t.map(n=>{if(n.isDefault)for(const o of n.modelElements)this._defaultStyles[o]=n.name;return[n.name,n]}))}refresh(){const e=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!e,this.isEnabled?e.hasAttribute("imageStyle")?this.value=e.getAttribute("imageStyle"):this.value=this._defaultStyles[e.name]:this.value=!1}execute(e={}){const t=this.editor,n=t.model,o=t.plugins.get("ImageUtils");n.change(r=>{const a=e.value;let c=o.getClosestSelectedImageElement(n.document.selection);a&&this.shouldConvertImageType(a,c)&&(this.editor.execute(o.isBlockImage(c)?"imageTypeInline":"imageTypeBlock"),c=o.getClosestSelectedImageElement(n.document.selection)),!a||this._styles.get(a).isDefault?r.removeAttribute("imageStyle",c):r.setAttribute("imageStyle",a,c)})}shouldConvertImageType(e,t){return!this._styles.get(e).modelElements.includes(t.name)}}const{objectFullWidth:rv,objectInline:Zf,objectLeft:ep,objectRight:ih,objectCenter:rh,objectBlockLeft:tp,objectBlockRight:np}=Co,s={inline:{name:"inline",title:"In line",icon:Zf,modelElements:["imageInline"],isDefault:!0},alignLeft:{name:"alignLeft",title:"Left aligned image",icon:ep,modelElements:["imageBlock","imageInline"],className:"image-style-align-left"},alignBlockLeft:{name:"alignBlockLeft",title:"Left aligned image",icon:tp,modelElements:["imageBlock"],className:"image-style-block-align-left"},alignCenter:{name:"alignCenter",title:"Centered image",icon:rh,modelElements:["imageBlock"],className:"image-style-align-center"},alignRight:{name:"alignRight",title:"Right aligned image",icon:ih,modelElements:["imageBlock","imageInline"],className:"image-style-align-right"},alignBlockRight:{name:"alignBlockRight",title:"Right aligned image",icon:np,modelElements:["imageBlock"],className:"image-style-block-align-right"},block:{name:"block",title:"Centered image",icon:rh,modelElements:["imageBlock"],isDefault:!0},side:{name:"side",title:"Side image",icon:ih,modelElements:["imageBlock"],className:"image-style-side"}},u={full:rv,left:tp,right:np,center:rh,inlineLeft:ep,inlineRight:ih,inline:Zf},g=[{name:"imageStyle:wrapText",title:"Wrap text",defaultItem:"imageStyle:alignLeft",items:["imageStyle:alignLeft","imageStyle:alignRight"]},{name:"imageStyle:breakText",title:"Break text",defaultItem:"imageStyle:block",items:["imageStyle:alignBlockLeft","imageStyle:block","imageStyle:alignBlockRight"]}];function y(i){Object(C.b)("image-style-configuration-definition-invalid",i)}var A={normalizeStyles:function(i){return(i.configuredStyles.options||[]).map(e=>function(t){return t=typeof t=="string"?s[t]?{...s[t]}:{name:t}:function(n,o){const r={...o};for(const a in n)Object.prototype.hasOwnProperty.call(o,a)||(r[a]=n[a]);return r}(s[t.name],t),typeof t.icon=="string"&&(t.icon=u[t.icon]||t.icon),t}(e)).filter(e=>function(t,{isBlockPluginLoaded:n,isInlinePluginLoaded:o}){const{modelElements:r,name:a}=t;if(!(r&&r.length&&a))return y({style:t}),!1;{const c=[n?"imageBlock":null,o?"imageInline":null];if(!r.some(d=>c.includes(d)))return Object(C.b)("image-style-missing-dependency",{style:t,missingPlugins:r.map(d=>d==="imageBlock"?"ImageBlockEditing":"ImageInlineEditing")}),!1}return!0}(e,i))},getDefaultStylesConfiguration:function(i,e){return i&&e?{options:["inline","alignLeft","alignRight","alignCenter","alignBlockLeft","alignBlockRight","block","side"]}:i?{options:["block","side"]}:e?{options:["inline","alignLeft","alignRight"]}:{}},getDefaultDropdownDefinitions:function(i){return i.has("ImageBlockEditing")&&i.has("ImageInlineEditing")?[...g]:[]},warnInvalidStyle:y,DEFAULT_OPTIONS:s,DEFAULT_ICONS:u,DEFAULT_DROPDOWN_DEFINITIONS:g};function V(i,e){for(const t of e)if(t.name===i)return t}class H extends ve{static get pluginName(){return"ImageStyleEditing"}static get requires(){return[Di]}init(){const{normalizeStyles:e,getDefaultStylesConfiguration:t}=A,n=this.editor,o=n.plugins.has("ImageBlockEditing"),r=n.plugins.has("ImageInlineEditing");n.config.define("image.styles",t(o,r)),this.normalizedStyles=e({configuredStyles:n.config.get("image.styles"),isBlockPluginLoaded:o,isInlinePluginLoaded:r}),this._setupConversion(o,r),this._setupPostFixer(),n.commands.add("imageStyle",new iv(n,this.normalizedStyles))}_setupConversion(e,t){const n=this.editor,o=n.model.schema,r=(a=this.normalizedStyles,(d,m,b)=>{if(!b.consumable.consume(m.item,d.name))return;const _=V(m.attributeNewValue,a),T=V(m.attributeOldValue,a),E=b.mapper.toViewElement(m.item),P=b.writer;T&&P.removeClass(T.className,E),_&&P.addClass(_.className,E)});var a;const c=function(d){const m={imageInline:d.filter(b=>!b.isDefault&&b.modelElements.includes("imageInline")),imageBlock:d.filter(b=>!b.isDefault&&b.modelElements.includes("imageBlock"))};return(b,_,T)=>{if(!_.modelRange)return;const E=_.viewItem,P=so(_.modelRange.getItems());if(P&&T.schema.checkAttribute(P,"imageStyle"))for(const R of m[P.name])T.consumable.consume(E,{classes:R.className})&&T.writer.setAttribute("imageStyle",R.name,P)}}(this.normalizedStyles);n.editing.downcastDispatcher.on("attribute:imageStyle",r),n.data.downcastDispatcher.on("attribute:imageStyle",r),e&&(o.extend("imageBlock",{allowAttributes:"imageStyle"}),n.data.upcastDispatcher.on("element:figure",c,{priority:"low"})),t&&(o.extend("imageInline",{allowAttributes:"imageStyle"}),n.data.upcastDispatcher.on("element:img",c,{priority:"low"}))}_setupPostFixer(){const e=this.editor,t=e.model.document,n=e.plugins.get(Di),o=new Map(this.normalizedStyles.map(r=>[r.name,r]));t.registerPostFixer(r=>{let a=!1;for(const c of t.differ.getChanges())if(c.type=="insert"||c.type=="attribute"&&c.attributeKey=="imageStyle"){let d=c.type=="insert"?c.position.nodeAfter:c.range.start.nodeAfter;if(d&&d.is("element","paragraph")&&d.childCount>0&&(d=d.getChild(0)),!n.isImage(d))continue;const m=d.getAttribute("imageStyle");if(!m)continue;const b=o.get(m);b&&b.modelElements.includes(d.name)||(r.removeAttribute("imageStyle",d),a=!0)}return a})}}w(80);class W extends ve{static get requires(){return[H]}static get pluginName(){return"ImageStyleUI"}get localizedDefaultStylesTitles(){const e=this.editor.t;return{"Wrap text":e("Wrap text"),"Break text":e("Break text"),"In line":e("In line"),"Full size image":e("Full size image"),"Side image":e("Side image"),"Left aligned image":e("Left aligned image"),"Centered image":e("Centered image"),"Right aligned image":e("Right aligned image")}}init(){const e=this.editor.plugins,t=this.editor.config.get("image.toolbar")||[],n=X(e.get("ImageStyleEditing").normalizedStyles,this.localizedDefaultStylesTitles);for(const r of n)this._createButton(r);const o=X([...t.filter(oe),...A.getDefaultDropdownDefinitions(e)],this.localizedDefaultStylesTitles);for(const r of o)this._createDropdown(r,n)}_createDropdown(e,t){const n=this.editor.ui.componentFactory;n.add(e.name,o=>{let r;const{defaultItem:a,items:c,title:d}=e,m=c.filter(T=>t.find(({name:E})=>he(E)===T)).map(T=>{const E=n.create(T);return T===a&&(r=E),E});c.length!==m.length&&A.warnInvalidStyle({dropdown:e});const b=rs(o,Um),_=b.buttonView;return Zm(b,m),_.set({label:me(d,r.label),class:null,tooltip:!0}),_.bind("icon").toMany(m,"isOn",(...T)=>{const E=T.findIndex(Bt);return E<0?r.icon:m[E].icon}),_.bind("label").toMany(m,"isOn",(...T)=>{const E=T.findIndex(Bt);return me(d,E<0?r.label:m[E].label)}),_.bind("isOn").toMany(m,"isOn",(...T)=>T.some(Bt)),_.bind("class").toMany(m,"isOn",(...T)=>T.some(Bt)?"ck-splitbutton_flatten":null),_.on("execute",()=>{m.some(({isOn:T})=>T)?b.isOpen=!b.isOpen:r.fire("execute")}),b.bind("isEnabled").toMany(m,"isEnabled",(...T)=>T.some(Bt)),b})}_createButton(e){const t=e.name;this.editor.ui.componentFactory.add(he(t),n=>{const o=this.editor.commands.get("imageStyle"),r=new nn(n);return r.set({label:e.title,icon:e.icon,tooltip:!0,isToggleable:!0}),r.bind("isEnabled").to(o,"isEnabled"),r.bind("isOn").to(o,"value",a=>a===t),r.on("execute",this._executeCommand.bind(this,t)),r})}_executeCommand(e){this.editor.execute("imageStyle",{value:e}),this.editor.editing.view.focus()}}function X(i,e){for(const t of i)e[t.title]&&(t.title=e[t.title]);return i}function he(i){return"imageStyle:"+i}function me(i,e){return(i?i+": ":"")+e}function pe(i){const e=i.map(t=>t.replace("+","\\+"));return new RegExp(`^image\\/(${e.join("|")})$`)}function Ae(i){return new Promise((e,t)=>{const n=i.getAttribute("src");fetch(n).then(o=>o.blob()).then(o=>{const r=ze(o,n),a=r.replace("image/",""),c=new File([o],"image."+a,{type:r});e(c)}).catch(o=>o&&o.name==="TypeError"?function(r){return function(a){return new Promise((c,d)=>{const m=qt.document.createElement("img");m.addEventListener("load",()=>{const b=qt.document.createElement("canvas");b.width=m.width,b.height=m.height,b.getContext("2d").drawImage(m,0,0),b.toBlob(_=>_?c(_):d())}),m.addEventListener("error",()=>d()),m.src=a})}(r).then(a=>{const c=ze(a,r),d=c.replace("image/","");return new File([a],"image."+d,{type:c})})}(n).then(e).catch(t):t(o))})}function ze(i,e){return i.type?i.type:e.match(/data:(image\/\w+);base64/)?e.match(/data:(image\/\w+);base64/)[1].toLowerCase():"image/jpeg"}class Ye extends ve{static get pluginName(){return"ImageUploadUI"}init(){const e=this.editor,t=e.t,n=o=>{const r=new Eb(o),a=e.commands.get("uploadImage"),c=e.config.get("image.upload.types"),d=pe(c);return r.set({acceptedType:c.map(m=>"image/"+m).join(","),allowMultipleFiles:!0}),r.buttonView.set({label:t("Insert image"),icon:Co.image,tooltip:!0}),r.buttonView.bind("isEnabled").to(a),r.on("done",(m,b)=>{const _=Array.from(b).filter(T=>d.test(T.type));_.length&&e.execute("uploadImage",{file:_})}),r};e.ui.componentFactory.add("uploadImage",n),e.ui.componentFactory.add("imageUpload",n)}}w(82),w(84),w(86);class bt extends ve{static get pluginName(){return"ImageUploadProgress"}constructor(e){super(e),this.placeholder="data:image/svg+xml;utf8,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 250"><rect rx="4"/></svg>')}init(){const e=this.editor;e.plugins.has("ImageBlockEditing")&&e.editing.downcastDispatcher.on("attribute:uploadStatus:imageBlock",(...t)=>this.uploadStatusChange(...t)),e.plugins.has("ImageInlineEditing")&&e.editing.downcastDispatcher.on("attribute:uploadStatus:imageInline",(...t)=>this.uploadStatusChange(...t))}uploadStatusChange(e,t,n){const o=this.editor,r=t.item,a=r.getAttribute("uploadId");if(!n.consumable.consume(t.item,e.name))return;const c=o.plugins.get("ImageUtils"),d=o.plugins.get(oi),m=a?t.attributeNewValue:null,b=this.placeholder,_=o.editing.mapper.toViewElement(r),T=n.writer;if(m=="reading")return Qe(_,T),void vt(c,b,_,T);if(m=="uploading"){const E=d.loaders.get(a);return Qe(_,T),void(E?(kt(_,T),function(P,R,z,$){const J=function(ue){const xe=ue.createUIElement("div",{class:"ck-progress-bar"});return ue.setCustomProperty("progressBar",!0,xe),xe}(R);R.insert(R.createPositionAt(P,"end"),J),z.on("change:uploadedPercent",(ue,xe,He)=>{$.change(Qt=>{Qt.setStyle("width",He+"%",J)})})}(_,T,E,o.editing.view),function(P,R,z,$){if($.data){const J=P.findViewImgElement(R);z.setAttribute("src",$.data,J)}}(c,_,T,E)):vt(c,b,_,T))}m=="complete"&&d.loaders.get(a)&&function(E,P,R){const z=P.createUIElement("div",{class:"ck-image-upload-complete-icon"});P.insert(P.createPositionAt(E,"end"),z),setTimeout(()=>{R.change($=>$.remove($.createRangeOn(z)))},3e3)}(_,T,o.editing.view),function(E,P){$n(E,P,"progressBar")}(_,T),kt(_,T),function(E,P){P.removeClass("ck-appear",E)}(_,T)}}function Qe(i,e){i.hasClass("ck-appear")||e.addClass("ck-appear",i)}function vt(i,e,t,n){t.hasClass("ck-image-upload-placeholder")||n.addClass("ck-image-upload-placeholder",t);const o=i.findViewImgElement(t);o.getAttribute("src")!==e&&n.setAttribute("src",e,o),uo(t,"placeholder")||n.insert(n.createPositionAfter(o),function(r){const a=r.createUIElement("div",{class:"ck-upload-placeholder-loader"});return r.setCustomProperty("placeholder",!0,a),a}(n))}function kt(i,e){i.hasClass("ck-image-upload-placeholder")&&e.removeClass("ck-image-upload-placeholder",i),$n(i,e,"placeholder")}function uo(i,e){for(const t of i.getChildren())if(t.getCustomProperty(e))return t}function $n(i,e,t){const n=uo(i,t);n&&e.remove(e.createRangeOn(n))}class Do extends pt{refresh(){const e=this.editor,t=e.plugins.get("ImageUtils"),n=e.model.document.selection.getSelectedElement();this.isEnabled=t.isImageAllowed()||t.isImage(n)}execute(e){const t=Tt(e.file),n=this.editor.model.document.selection,o=this.editor.plugins.get("ImageUtils"),r=Object.fromEntries(n.getAttributes());t.forEach((a,c)=>{const d=n.getSelectedElement();if(c&&d&&o.isImage(d)){const m=this.editor.model.createPositionAfter(d);this._uploadImage(a,r,m)}else this._uploadImage(a,r)})}_uploadImage(e,t,n){const o=this.editor,r=o.plugins.get(oi).createLoader(e),a=o.plugins.get("ImageUtils");r&&a.insertImage({...t,uploadId:r.id},n)}}class pn extends ve{static get requires(){return[oi,Rd,sn,Di]}static get pluginName(){return"ImageUploadEditing"}constructor(e){super(e),e.config.define("image",{upload:{types:["jpeg","png","gif","bmp","webp","tiff"]}}),this._uploadImageElements=new Map}init(){const e=this.editor,t=e.model.document,n=e.conversion,o=e.plugins.get(oi),r=e.plugins.get("ImageUtils"),a=pe(e.config.get("image.upload.types")),c=new Do(e);e.commands.add("uploadImage",c),e.commands.add("imageUpload",c),n.for("upcast").attributeToAttribute({view:{name:"img",key:"uploadId"},model:"uploadId"}),this.listenTo(e.editing.view.document,"clipboardInput",(d,m)=>{if(b=m.dataTransfer,Array.from(b.types).includes("text/html")&&b.getData("text/html")!=="")return;var b;const _=Array.from(m.dataTransfer.files).filter(T=>!!T&&a.test(T.type));_.length&&(d.stop(),e.model.change(T=>{m.targetRanges&&T.setSelection(m.targetRanges.map(E=>e.editing.mapper.toModelRange(E))),e.model.enqueueChange("default",()=>{e.execute("uploadImage",{file:_})})}))}),this.listenTo(e.plugins.get("ClipboardPipeline"),"inputTransformation",(d,m)=>{const b=Array.from(e.editing.view.createRangeIn(m.content)).filter(T=>function(E,P){return!(!E.isInlineImageView(P)||!P.getAttribute("src"))&&(P.getAttribute("src").match(/^data:image\/\w+;base64,/g)||P.getAttribute("src").match(/^blob:/g))}(r,T.item)&&!T.item.getAttribute("uploadProcessed")).map(T=>({promise:Ae(T.item),imageElement:T.item}));if(!b.length)return;const _=new Bs(e.editing.view.document);for(const T of b){_.setAttribute("uploadProcessed",!0,T.imageElement);const E=o.createLoader(T.promise);E&&(_.setAttribute("src","",T.imageElement),_.setAttribute("uploadId",E.id,T.imageElement))}}),e.editing.view.document.on("dragover",(d,m)=>{m.preventDefault()}),t.on("change",()=>{const d=t.differ.getChanges({includeChangesInGraveyard:!0}).reverse(),m=new Set;for(const b of d)if(b.type=="insert"&&b.name!="$text"){const _=b.position.nodeAfter,T=b.position.root.rootName=="$graveyard";for(const E of ii(e,_)){const P=E.getAttribute("uploadId");if(!P)continue;const R=o.loaders.get(P);R&&(T?m.has(P)||R.abort():(m.add(P),this._uploadImageElements.set(P,E),R.status=="idle"&&this._readAndUpload(R)))}}}),this.on("uploadComplete",(d,{imageElement:m,data:b})=>{const _=b.urls?b.urls:b;this.editor.model.change(T=>{T.setAttribute("src",_.default,m),this._parseAndSetSrcsetAttributeOnImage(_,m,T)})},{priority:"low"})}afterInit(){const e=this.editor.model.schema;this.editor.plugins.has("ImageBlockEditing")&&e.extend("imageBlock",{allowAttributes:["uploadId","uploadStatus"]}),this.editor.plugins.has("ImageInlineEditing")&&e.extend("imageInline",{allowAttributes:["uploadId","uploadStatus"]})}_readAndUpload(e){const t=this.editor,n=t.model,o=t.locale.t,r=t.plugins.get(oi),a=t.plugins.get(Rd),c=t.plugins.get("ImageUtils"),d=this._uploadImageElements;return n.enqueueChange("transparent",b=>{b.setAttribute("uploadStatus","reading",d.get(e.id))}),e.read().then(()=>{const b=e.upload(),_=d.get(e.id);if(Cn.isSafari){const T=t.editing.mapper.toViewElement(_),E=c.findViewImgElement(T);t.editing.view.once("render",()=>{if(!E.parent)return;const P=t.editing.view.domConverter.mapViewToDom(E.parent);if(!P)return;const R=P.style.display;P.style.display="none",P._ckHack=P.offsetHeight,P.style.display=R})}return n.enqueueChange("transparent",T=>{T.setAttribute("uploadStatus","uploading",_)}),b}).then(b=>{n.enqueueChange("transparent",_=>{const T=d.get(e.id);_.setAttribute("uploadStatus","complete",T),this.fire("uploadComplete",{data:b,imageElement:T})}),m()}).catch(b=>{if(e.status!=="error"&&e.status!=="aborted")throw b;e.status=="error"&&b&&a.showWarning(b,{title:o("Upload failed"),namespace:"upload"}),n.enqueueChange("transparent",_=>{_.remove(d.get(e.id))}),m()});function m(){n.enqueueChange("transparent",b=>{const _=d.get(e.id);b.removeAttribute("uploadId",_),b.removeAttribute("uploadStatus",_),d.delete(e.id)}),r.destroyLoader(e)}}_parseAndSetSrcsetAttributeOnImage(e,t,n){let o=0;const r=Object.keys(e).filter(a=>{const c=parseInt(a,10);if(!isNaN(c))return o=Math.max(o,c),!0}).map(a=>`${e[a]} ${a}w`).join(", ");r!=""&&n.setAttribute("srcset",{data:r,width:o},t)}}function ii(i,e){const t=i.plugins.get("ImageUtils");return Array.from(i.model.createRangeOn(e)).filter(n=>t.isImage(n.item)).map(n=>n.item)}class tr extends ve{static get pluginName(){return"IndentEditing"}init(){const e=this.editor;e.commands.add("indent",new ra(e)),e.commands.add("outdent",new ra(e))}}var sh='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm5 6c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zM2.75 16.5h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 1 0 0 1.5zM1.632 6.95 5.02 9.358a.4.4 0 0 1-.013.661l-3.39 2.207A.4.4 0 0 1 1 11.892V7.275a.4.4 0 0 1 .632-.326z"/></svg>',ok='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm5 6c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zM2.75 16.5h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 1 0 0 1.5zm1.618-9.55L.98 9.358a.4.4 0 0 0 .013.661l3.39 2.207A.4.4 0 0 0 5 11.892V7.275a.4.4 0 0 0-.632-.326z"/></svg>';class qy extends ve{static get pluginName(){return"IndentUI"}init(){const e=this.editor,t=e.locale,n=e.t,o=t.uiLanguageDirection=="ltr"?sh:ok,r=t.uiLanguageDirection=="ltr"?ok:sh;this._defineButton("indent",n("Increase indent"),o),this._defineButton("outdent",n("Decrease indent"),r)}_defineButton(e,t,n){const o=this.editor;o.ui.componentFactory.add(e,r=>{const a=o.commands.get(e),c=new nn(r);return c.set({label:t,icon:n,tooltip:!0}),c.bind("isOn","isEnabled").to(a,"value","isEnabled"),this.listenTo(c,"execute",()=>{o.execute(e),o.editing.view.focus()}),c})}}class Hy{constructor(){this._definitions=new Set}get length(){return this._definitions.size}add(e){Array.isArray(e)?e.forEach(t=>this._definitions.add(t)):this._definitions.add(e)}getDispatcher(){return e=>{e.on("attribute:linkHref",(t,n,o)=>{if(!o.consumable.test(n.item,"attribute:linkHref"))return;const r=o.writer,a=r.document.selection;for(const c of this._definitions){const d=r.createAttributeElement("a",c.attributes,{priority:5});c.classes&&r.addClass(c.classes,d);for(const m in c.styles)r.setStyle(m,c.styles[m],d);r.setCustomProperty("link",!0,d),c.callback(n.attributeNewValue)?n.item.is("selection")?r.wrap(a.getFirstRange(),d):r.wrap(o.mapper.toViewRange(n.range),d):r.unwrap(o.mapper.toViewRange(n.range),d)}},{priority:"high"})}}getDispatcherForLinkedImage(){return e=>{e.on("attribute:linkHref:imageBlock",(t,n,{writer:o,mapper:r})=>{const a=r.toViewElement(n.item),c=Array.from(a.getChildren()).find(d=>d.name==="a");for(const d of this._definitions){const m=Ke(d.attributes);if(d.callback(n.attributeNewValue)){for(const[b,_]of m)b==="class"?o.addClass(_,c):o.setAttribute(b,_,c);d.classes&&o.addClass(d.classes,c);for(const b in d.styles)o.setStyle(b,d.styles[b],c)}else{for(const[b,_]of m)b==="class"?o.removeClass(_,c):o.removeAttribute(b,c);d.classes&&o.removeClass(d.classes,c);for(const b in d.styles)o.removeStyle(b,c)}}})}}}var $y=function(i,e,t){var n=i.length;return t=t===void 0?n:t,!e&&t>=n?i:Ra(i,e,t)},Uy=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]"),ik=function(i){return Uy.test(i)},Wy=function(i){return i.split("")},Ky="[\\ud800-\\udfff]",sv="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",av="\\ud83c[\\udffb-\\udfff]",rk="[^\\ud800-\\udfff]",sk="(?:\\ud83c[\\udde6-\\uddff]){2}",ak="[\\ud800-\\udbff][\\udc00-\\udfff]",lk="(?:"+sv+"|"+av+")?",Gy="[\\ufe0e\\ufe0f]?"+lk+("(?:\\u200d(?:"+[rk,sk,ak].join("|")+")[\\ufe0e\\ufe0f]?"+lk+")*"),Qy="(?:"+[rk+sv+"?",sv,sk,ak,Ky].join("|")+")",Yy=RegExp(av+"(?="+av+")|"+Qy+Gy,"g"),Xy=function(i){return i.match(Yy)||[]},Jy=function(i){return ik(i)?Xy(i):Wy(i)},Zy=function(i){return function(e){e=ro(e);var t=ik(e)?Jy(e):void 0,n=t?t[0]:e.charAt(0),o=t?$y(t,1).join(""):e.slice(1);return n[i]()+o}}("toUpperCase");const e1=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,t1=/^(?:(?:https?|ftps?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i,n1=/^[\S]+@((?![-_])(?:[-\w\u00a1-\uffff]{0,63}[^-_]\.))+(?:[a-z\u00a1-\uffff]{2,})$/i,o1=/^((\w+:(\/{2,})?)|(\W))/i;function ck(i,{writer:e}){const t=e.createAttributeElement("a",{href:i},{priority:5});return e.setCustomProperty("link",!0,t),t}function uk(i){return function(e){return e.replace(e1,"").match(t1)}(i=String(i))?i:"#"}function lv(i,e){return!!i&&e.checkAttribute(i.name,"linkHref")}function dk(i,e){const t=(n=i,n1.test(n)?"mailto:":e);var n;const o=!!t&&!o1.test(i);return i&&o?t+i:i}class i1 extends pt{constructor(e){super(e),this.manualDecorators=new io,this.automaticDecorators=new Hy}restoreManualDecoratorStates(){for(const e of this.manualDecorators)e.value=this._getDecoratorStateFromModel(e.id)}refresh(){const e=this.editor.model,t=e.document.selection,n=t.getSelectedElement()||so(t.getSelectedBlocks());lv(n,e.schema)?(this.value=n.getAttribute("linkHref"),this.isEnabled=e.schema.checkAttribute(n,"linkHref")):(this.value=t.getAttribute("linkHref"),this.isEnabled=e.schema.checkAttributeInSelection(t,"linkHref"));for(const o of this.manualDecorators)o.value=this._getDecoratorStateFromModel(o.id)}execute(e,t={}){const n=this.editor.model,o=n.document.selection,r=[],a=[];for(const c in t)t[c]?r.push(c):a.push(c);n.change(c=>{if(o.isCollapsed){const d=o.getFirstPosition();if(o.hasAttribute("linkHref")){const m=cs(d,"linkHref",o.getAttribute("linkHref"),n);c.setAttribute("linkHref",e,m),r.forEach(b=>{c.setAttribute(b,!0,m)}),a.forEach(b=>{c.removeAttribute(b,m)}),c.setSelection(c.createPositionAfter(m.end.nodeBefore))}else if(e!==""){const m=Ke(o.getAttributes());m.set("linkHref",e),r.forEach(_=>{m.set(_,!0)});const{end:b}=n.insertContent(c.createText(e,m),d);c.setSelection(b)}["linkHref",...r,...a].forEach(m=>{c.removeSelectionAttribute(m)})}else{const d=n.schema.getValidRanges(o.getRanges(),"linkHref"),m=[];for(const _ of o.getSelectedBlocks())n.schema.checkAttribute(_,"linkHref")&&m.push(c.createRangeOn(_));const b=m.slice();for(const _ of d)this._isRangeToUpdate(_,m)&&b.push(_);for(const _ of b)c.setAttribute("linkHref",e,_),r.forEach(T=>{c.setAttribute(T,!0,_)}),a.forEach(T=>{c.removeAttribute(T,_)})}})}_getDecoratorStateFromModel(e){const t=this.editor.model,n=t.document.selection,o=n.getSelectedElement();return lv(o,t.schema)?o.getAttribute(e):n.getAttribute(e)}_isRangeToUpdate(e,t){for(const n of t)if(n.containsRange(e))return!1;return!0}}class r1 extends pt{refresh(){const e=this.editor.model,t=e.document.selection,n=t.getSelectedElement();lv(n,e.schema)?this.isEnabled=e.schema.checkAttribute(n,"linkHref"):this.isEnabled=e.schema.checkAttributeInSelection(t,"linkHref")}execute(){const e=this.editor,t=this.editor.model,n=t.document.selection,o=e.commands.get("link");t.change(r=>{const a=n.isCollapsed?[cs(n.getFirstPosition(),"linkHref",n.getAttribute("linkHref"),t)]:t.schema.getValidRanges(n.getRanges(),"linkHref");for(const c of a)if(r.removeAttribute("linkHref",c),o)for(const d of o.manualDecorators)r.removeAttribute(d.id,c)})}}class hk{constructor({id:e,label:t,attributes:n,classes:o,styles:r,defaultValue:a}){this.id=e,this.set("value"),this.defaultValue=a,this.label=t,this.attributes=n,this.classes=o,this.styles=r}_createPattern(){return{attributes:this.attributes,classes:this.classes,styles:this.styles}}}Be(hk,Wt),w(88);const s1=/^(https?:)?\/\//;class a1 extends ve{static get pluginName(){return"LinkEditing"}static get requires(){return[Sf,Gc,sn]}constructor(e){super(e),e.config.define("link",{addTargetToExternalLinks:!1})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:"linkHref"}),e.conversion.for("dataDowncast").attributeToElement({model:"linkHref",view:ck}),e.conversion.for("editingDowncast").attributeToElement({model:"linkHref",view:(n,o)=>ck(uk(n),o)}),e.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:{href:!0}},model:{key:"linkHref",value:n=>n.getAttribute("href")}}),e.commands.add("link",new i1(e)),e.commands.add("unlink",new r1(e));const t=function(n,o){const r={"Open in a new tab":n("Open in a new tab"),Downloadable:n("Downloadable")};return o.forEach(a=>(a.label&&r[a.label]&&(a.label=r[a.label]),a)),o}(e.t,function(n){const o=[];if(n)for(const[r,a]of Object.entries(n)){const c=Object.assign({},a,{id:"link"+Zy(r)});o.push(c)}return o}(e.config.get("link.decorators")));this._enableAutomaticDecorators(t.filter(n=>n.mode==="automatic")),this._enableManualDecorators(t.filter(n=>n.mode==="manual")),e.plugins.get(Sf).registerAttribute("linkHref"),function(n,o,r,a){const c=n.editing.view,d=new Set;c.document.registerPostFixer(m=>{const b=n.model.document.selection;let _=!1;if(b.hasAttribute(o)){const T=cs(b.getFirstPosition(),o,b.getAttribute(o),n.model),E=n.editing.mapper.toViewRange(T);for(const P of E.getItems())P.is("element",r)&&!P.hasClass(a)&&(m.addClass(a,P),d.add(P),_=!0)}return _}),n.conversion.for("editingDowncast").add(m=>{function b(){c.change(_=>{for(const T of d.values())_.removeClass(a,T),d.delete(T)})}m.on("insert",b,{priority:"highest"}),m.on("remove",b,{priority:"highest"}),m.on("attribute",b,{priority:"highest"}),m.on("selection",b,{priority:"highest"})})}(e,"linkHref","a","ck-link_selected"),this._enableInsertContentSelectionAttributesFixer(),this._enableClickingAfterLink(),this._enableTypingOverLink(),this._handleDeleteContentAfterLink()}_enableAutomaticDecorators(e){const t=this.editor,n=t.commands.get("link").automaticDecorators;t.config.get("link.addTargetToExternalLinks")&&n.add({id:"linkIsExternal",mode:"automatic",callback:o=>s1.test(o),attributes:{target:"_blank",rel:"noopener noreferrer"}}),n.add(e),n.length&&t.conversion.for("downcast").add(n.getDispatcher())}_enableManualDecorators(e){if(!e.length)return;const t=this.editor,n=t.commands.get("link").manualDecorators;e.forEach(o=>{t.model.schema.extend("$text",{allowAttributes:o.id}),o=new hk(o),n.add(o),t.conversion.for("downcast").attributeToElement({model:o.id,view:(r,{writer:a})=>{if(r){const c=a.createAttributeElement("a",o.attributes,{priority:5});o.classes&&a.addClass(o.classes,c);for(const d in o.styles)a.setStyle(d,o.styles[d],c);return a.setCustomProperty("link",!0,c),c}}}),t.conversion.for("upcast").elementToAttribute({view:{name:"a",...o._createPattern()},model:{key:o.id}})})}_enableInsertContentSelectionAttributesFixer(){const e=this.editor.model,t=e.document.selection;this.listenTo(e,"insertContent",()=>{const n=t.anchor.nodeBefore,o=t.anchor.nodeAfter;t.hasAttribute("linkHref")&&n&&n.hasAttribute("linkHref")&&(o&&o.hasAttribute("linkHref")||e.change(r=>{cv(r,uv(e.schema))}))},{priority:"low"})}_enableClickingAfterLink(){const e=this.editor,t=e.model;e.editing.view.addObserver(Uc);let n=!1;this.listenTo(e.editing.view.document,"mousedown",()=>{n=!0}),this.listenTo(e.editing.view.document,"selectionChange",()=>{if(!n)return;n=!1;const o=t.document.selection;if(!o.isCollapsed||!o.hasAttribute("linkHref"))return;const r=o.getFirstPosition(),a=cs(r,"linkHref",o.getAttribute("linkHref"),t);(r.isTouching(a.start)||r.isTouching(a.end))&&t.change(c=>{cv(c,uv(t.schema))})})}_enableTypingOverLink(){const e=this.editor,t=e.editing.view;let n,o;this.listenTo(t.document,"delete",()=>{o=!0},{priority:"high"}),this.listenTo(e.model,"deleteContent",()=>{const r=e.model.document.selection;r.isCollapsed||(o?o=!1:mk(e)&&function(a){const c=a.document.selection,d=c.getFirstPosition(),m=c.getLastPosition(),b=d.nodeAfter;if(!b||!b.is("$text")||!b.hasAttribute("linkHref"))return!1;const _=m.textNode||m.nodeBefore;return b===_?!0:cs(d,"linkHref",b.getAttribute("linkHref"),a).containsRange(a.createRange(d,m),!0)}(e.model)&&(n=r.getAttributes()))},{priority:"high"}),this.listenTo(e.model,"insertContent",(r,[a])=>{o=!1,mk(e)&&n&&(e.model.change(c=>{for(const[d,m]of n)c.setAttribute(d,m,a)}),n=null)},{priority:"high"})}_handleDeleteContentAfterLink(){const e=this.editor,t=e.model,n=t.document.selection,o=e.editing.view;let r=!1,a=!1;this.listenTo(o.document,"delete",(c,d)=>{a=d.domEvent.keyCode===ut.backspace},{priority:"high"}),this.listenTo(t,"deleteContent",()=>{r=!1;const c=n.getFirstPosition(),d=n.getAttribute("linkHref");if(!d)return;const m=cs(c,"linkHref",d,t);r=m.containsPosition(c)||m.end.isEqual(c)},{priority:"high"}),this.listenTo(t,"deleteContent",()=>{a&&(a=!1,r||e.model.enqueueChange(c=>{cv(c,uv(t.schema))}))},{priority:"low"})}}function cv(i,e){i.removeSelectionAttribute("linkHref");for(const t of e)i.removeSelectionAttribute(t)}function mk(i){return i.plugins.get("Input").isInput(i.model.change(e=>e.batch))}function uv(i){return i.getDefinition("$text").allowAttributes.filter(e=>e.startsWith("link"))}w(90);class l1 extends gt{constructor(e,t){super(e);const n=e.t;this.focusTracker=new Lo,this.keystrokes=new yo,this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(n("Save"),Co.check,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(n("Cancel"),Co.cancel,"ck-button-cancel","cancel"),this._manualDecoratorSwitches=this._createManualDecoratorSwitches(t),this.children=this._createFormChildren(t.manualDecorators),this._focusables=new os,this._focusCycler=new Ms({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});const o=["ck","ck-link-form","ck-responsive-form"];t.manualDecorators.length&&o.push("ck-link-form_layout-vertical","ck-vertical-form"),this.setTemplate({tag:"form",attributes:{class:o,tabindex:"-1"},children:this.children}),Ad(this)}getDecoratorSwitchesState(){return Array.from(this._manualDecoratorSwitches).reduce((e,t)=>(e[t.name]=t.isOn,e),{})}render(){super.render(),Sd({view:this}),[this.urlInputView,...this._manualDecoratorSwitches,this.saveButtonView,this.cancelButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}_createUrlInput(){const e=this.locale.t,t=new Md(this.locale,Od);return t.label=e("Link URL"),t}_createButton(e,t,n,o){const r=new nn(this.locale);return r.set({label:e,icon:t,tooltip:!0}),r.extendTemplate({attributes:{class:n}}),o&&r.delegate("execute").to(this,o),r}_createManualDecoratorSwitches(e){const t=this.createCollection();for(const n of e.manualDecorators){const o=new Fc(this.locale);o.set({name:n.id,label:n.label,withText:!0}),o.bind("isOn").toMany([n,e],"value",(r,a)=>a===void 0&&r===void 0?n.defaultValue:r),o.on("execute",()=>{n.set("value",!o.isOn)}),t.add(o)}return t}_createFormChildren(e){const t=this.createCollection();if(t.add(this.urlInputView),e.length){const n=new gt;n.setTemplate({tag:"ul",children:this._manualDecoratorSwitches.map(o=>({tag:"li",children:[o],attributes:{class:["ck","ck-list__item"]}})),attributes:{class:["ck","ck-reset","ck-list"]}}),t.add(n)}return t.add(this.saveButtonView),t.add(this.cancelButtonView),t}}w(92);class c1 extends gt{constructor(e){super(e);const t=e.t;this.focusTracker=new Lo,this.keystrokes=new yo,this.previewButtonView=this._createPreviewButton(),this.unlinkButtonView=this._createButton(t("Unlink"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m11.077 15 .991-1.416a.75.75 0 1 1 1.229.86l-1.148 1.64a.748.748 0 0 1-.217.206 5.251 5.251 0 0 1-8.503-5.955.741.741 0 0 1 .12-.274l1.147-1.639a.75.75 0 1 1 1.228.86L4.933 10.7l.006.003a3.75 3.75 0 0 0 6.132 4.294l.006.004zm5.494-5.335a.748.748 0 0 1-.12.274l-1.147 1.639a.75.75 0 1 1-1.228-.86l.86-1.23a3.75 3.75 0 0 0-6.144-4.301l-.86 1.229a.75.75 0 0 1-1.229-.86l1.148-1.64a.748.748 0 0 1 .217-.206 5.251 5.251 0 0 1 8.503 5.955zm-4.563-2.532a.75.75 0 0 1 .184 1.045l-3.155 4.505a.75.75 0 1 1-1.229-.86l3.155-4.506a.75.75 0 0 1 1.045-.184zm4.919 10.562-1.414 1.414a.75.75 0 1 1-1.06-1.06l1.414-1.415-1.415-1.414a.75.75 0 0 1 1.061-1.06l1.414 1.414 1.414-1.415a.75.75 0 0 1 1.061 1.061l-1.414 1.414 1.414 1.415a.75.75 0 0 1-1.06 1.06l-1.415-1.414z"/></svg>',"unlink"),this.editButtonView=this._createButton(t("Edit link"),Co.pencil,"edit"),this.set("href"),this._focusables=new os,this._focusCycler=new Ms({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-link-actions","ck-responsive-form"],tabindex:"-1"},children:[this.previewButtonView,this.editButtonView,this.unlinkButtonView]})}render(){super.render(),[this.previewButtonView,this.editButtonView,this.unlinkButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}_createButton(e,t,n){const o=new nn(this.locale);return o.set({label:e,icon:t,tooltip:!0}),o.delegate("execute").to(this,n),o}_createPreviewButton(){const e=new nn(this.locale),t=this.bindTemplate,n=this.t;return e.set({withText:!0,tooltip:n("Open link in new tab")}),e.extendTemplate({attributes:{class:["ck","ck-link-actions__preview"],href:t.to("href",o=>o&&uk(o)),target:"_blank",rel:"noopener noreferrer"}}),e.bind("label").to(this,"href",o=>o||n("This link has no URL")),e.bind("isEnabled").to(this,"href",o=>!!o),e.template.tag="a",e.template.eventListeners={},e}}class u1 extends ve{static get requires(){return[cl]}static get pluginName(){return"LinkUI"}init(){const e=this.editor;e.editing.view.addObserver(Yg),this.actionsView=this._createActionsView(),this.formView=this._createFormView(),this._balloon=e.plugins.get(cl),this._createToolbarLinkButton(),this._enableUserBalloonInteractions(),e.conversion.for("editingDowncast").markerToHighlight({model:"link-ui",view:{classes:["ck-fake-link-selection"]}}),e.conversion.for("editingDowncast").markerToElement({model:"link-ui",view:{name:"span",classes:["ck-fake-link-selection","ck-fake-link-selection_collapsed"]}})}destroy(){super.destroy(),this.formView.destroy()}_createActionsView(){const e=this.editor,t=new c1(e.locale),n=e.commands.get("link"),o=e.commands.get("unlink");return t.bind("href").to(n,"value"),t.editButtonView.bind("isEnabled").to(n),t.unlinkButtonView.bind("isEnabled").to(o),this.listenTo(t,"edit",()=>{this._addFormView()}),this.listenTo(t,"unlink",()=>{e.execute("unlink"),this._hideUI()}),t.keystrokes.set("Esc",(r,a)=>{this._hideUI(),a()}),t.keystrokes.set("Ctrl+K",(r,a)=>{this._addFormView(),a()}),t}_createFormView(){const e=this.editor,t=e.commands.get("link"),n=e.config.get("link.defaultProtocol"),o=new l1(e.locale,t);return o.urlInputView.fieldView.bind("value").to(t,"value"),o.urlInputView.bind("isReadOnly").to(t,"isEnabled",r=>!r),o.saveButtonView.bind("isEnabled").to(t),this.listenTo(o,"submit",()=>{const{value:r}=o.urlInputView.fieldView.element,a=dk(r,n);e.execute("link",a,o.getDecoratorSwitchesState()),this._closeFormView()}),this.listenTo(o,"cancel",()=>{this._closeFormView()}),o.keystrokes.set("Esc",(r,a)=>{this._closeFormView(),a()}),o}_createToolbarLinkButton(){const e=this.editor,t=e.commands.get("link"),n=e.t;e.keystrokes.set("Ctrl+K",(o,r)=>{r(),t.isEnabled&&this._showUI(!0)}),e.ui.componentFactory.add("link",o=>{const r=new nn(o);return r.isEnabled=!0,r.label=n("Link"),r.icon='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m11.077 15 .991-1.416a.75.75 0 1 1 1.229.86l-1.148 1.64a.748.748 0 0 1-.217.206 5.251 5.251 0 0 1-8.503-5.955.741.741 0 0 1 .12-.274l1.147-1.639a.75.75 0 1 1 1.228.86L4.933 10.7l.006.003a3.75 3.75 0 0 0 6.132 4.294l.006.004zm5.494-5.335a.748.748 0 0 1-.12.274l-1.147 1.639a.75.75 0 1 1-1.228-.86l.86-1.23a3.75 3.75 0 0 0-6.144-4.301l-.86 1.229a.75.75 0 0 1-1.229-.86l1.148-1.64a.748.748 0 0 1 .217-.206 5.251 5.251 0 0 1 8.503 5.955zm-4.563-2.532a.75.75 0 0 1 .184 1.045l-3.155 4.505a.75.75 0 1 1-1.229-.86l3.155-4.506a.75.75 0 0 1 1.045-.184z"/></svg>',r.keystroke="Ctrl+K",r.tooltip=!0,r.isToggleable=!0,r.bind("isEnabled").to(t,"isEnabled"),r.bind("isOn").to(t,"value",a=>!!a),this.listenTo(r,"execute",()=>this._showUI(!0)),r})}_enableUserBalloonInteractions(){const e=this.editor.editing.view.document;this.listenTo(e,"click",()=>{this._getSelectedLinkElement()&&this._showUI()}),this.editor.keystrokes.set("Tab",(t,n)=>{this._areActionsVisible&&!this.actionsView.focusTracker.isFocused&&(this.actionsView.focus(),n())},{priority:"high"}),this.editor.keystrokes.set("Esc",(t,n)=>{this._isUIVisible&&(this._hideUI(),n())}),Ed({emitter:this.formView,activator:()=>this._isUIInPanel,contextElements:[this._balloon.view.element],callback:()=>this._hideUI()})}_addActionsView(){this._areActionsInPanel||this._balloon.add({view:this.actionsView,position:this._getBalloonPositionData()})}_addFormView(){if(this._isFormInPanel)return;const e=this.editor.commands.get("link");this.formView.disableCssTransitions(),this._balloon.add({view:this.formView,position:this._getBalloonPositionData()}),this._balloon.visibleView===this.formView&&this.formView.urlInputView.fieldView.select(),this.formView.enableCssTransitions(),this.formView.urlInputView.fieldView.element.value=e.value||""}_closeFormView(){const e=this.editor.commands.get("link");e.restoreManualDecoratorStates(),e.value!==void 0?this._removeFormView():this._hideUI()}_removeFormView(){this._isFormInPanel&&(this.formView.saveButtonView.focus(),this._balloon.remove(this.formView),this.editor.editing.view.focus(),this._hideFakeVisualSelection())}_showUI(e=!1){this._getSelectedLinkElement()?(this._areActionsVisible?this._addFormView():this._addActionsView(),e&&this._balloon.showStack("main")):(this._showFakeVisualSelection(),this._addActionsView(),e&&this._balloon.showStack("main"),this._addFormView()),this._startUpdatingUI()}_hideUI(){if(!this._isUIInPanel)return;const e=this.editor;this.stopListening(e.ui,"update"),this.stopListening(this._balloon,"change:visibleView"),e.editing.view.focus(),this._removeFormView(),this._balloon.remove(this.actionsView),this._hideFakeVisualSelection()}_startUpdatingUI(){const e=this.editor,t=e.editing.view.document;let n=this._getSelectedLinkElement(),o=a();const r=()=>{const c=this._getSelectedLinkElement(),d=a();n&&!c||!n&&d!==o?this._hideUI():this._isUIVisible&&this._balloon.updatePosition(this._getBalloonPositionData()),n=c,o=d};function a(){return t.selection.focus.getAncestors().reverse().find(c=>c.is("element"))}this.listenTo(e.ui,"update",r),this.listenTo(this._balloon,"change:visibleView",r)}get _isFormInPanel(){return this._balloon.hasView(this.formView)}get _areActionsInPanel(){return this._balloon.hasView(this.actionsView)}get _areActionsVisible(){return this._balloon.visibleView===this.actionsView}get _isUIInPanel(){return this._isFormInPanel||this._areActionsInPanel}get _isUIVisible(){return this._balloon.visibleView==this.formView||this._areActionsVisible}_getBalloonPositionData(){const e=this.editor.editing.view,t=this.editor.model,n=e.document;let o=null;if(t.markers.has("link-ui")){const r=Array.from(this.editor.editing.mapper.markerNameToElements("link-ui")),a=e.createRange(e.createPositionBefore(r[0]),e.createPositionAfter(r[r.length-1]));o=e.domConverter.viewRangeToDom(a)}else o=()=>{const r=this._getSelectedLinkElement();return r?e.domConverter.mapViewToDom(r):e.domConverter.viewRangeToDom(n.selection.getFirstRange())};return{target:o}}_getSelectedLinkElement(){const e=this.editor.editing.view,t=e.document.selection,n=t.getSelectedElement();if(t.isCollapsed||n&&it(n))return dv(t.getFirstPosition());{const o=t.getFirstRange().getTrimmed(),r=dv(o.start),a=dv(o.end);return r&&r==a&&e.createRangeIn(r).getTrimmed().isEqual(o)?r:null}}_showFakeVisualSelection(){const e=this.editor.model;e.change(t=>{const n=e.document.selection.getFirstRange();if(e.markers.has("link-ui"))t.updateMarker("link-ui",{range:n});else if(n.start.isAtEnd){const o=n.start.getLastMatchingPosition(({item:r})=>!e.schema.isContent(r),{boundaries:n});t.addMarker("link-ui",{usingOperation:!1,affectsData:!1,range:t.createRange(o,n.end)})}else t.addMarker("link-ui",{usingOperation:!1,affectsData:!1,range:n})})}_hideFakeVisualSelection(){const e=this.editor.model;e.markers.has("link-ui")&&e.change(t=>{t.removeMarker("link-ui")})}}function dv(i){return i.getAncestors().find(e=>{return(t=e).is("attributeElement")&&!!t.getCustomProperty("link");var t})}const d1=new RegExp("(^|\\s)(((?:(?:(?:https?|ftp):)?\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(((?!www\\.)|(www\\.))(?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.)+(?:[a-z\\u00a1-\\uffff]{2,63})))(?::\\d{2,5})?(?:[/?#]\\S*)?)|((www.|(\\S+@))((?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.))+(?:[a-z\\u00a1-\\uffff]{2,63})))$","i");class h1 extends ve{static get pluginName(){return"AutoLink"}init(){const e=this.editor.model.document.selection;e.on("change:range",()=>{this.isEnabled=!e.anchor.parent.is("element","codeBlock")}),this._enableTypingHandling()}afterInit(){this._enableEnterHandling(),this._enableShiftEnterHandling()}_enableTypingHandling(){const e=this.editor,t=new Wd(e.model,o=>{if(!function(a){return a.length>4&&a[a.length-1]===" "&&a[a.length-2]!==" "}(o))return;const r=fk(o.substr(0,o.length-1));return r?{url:r}:void 0}),n=e.plugins.get("Input");t.on("matched:data",(o,r)=>{const{batch:a,range:c,url:d}=r;if(!n.isInput(a))return;const m=c.end.getShiftedBy(-1),b=m.getShiftedBy(-d.length),_=e.model.createRange(b,m);this._applyAutoLink(d,_)}),t.bind("isEnabled").to(this)}_enableEnterHandling(){const e=this.editor,t=e.model,n=e.commands.get("enter");n&&n.on("execute",()=>{const o=t.document.selection.getFirstPosition();if(!o.parent.previousSibling)return;const r=t.createRangeIn(o.parent.previousSibling);this._checkAndApplyAutoLinkOnRange(r)})}_enableShiftEnterHandling(){const e=this.editor,t=e.model,n=e.commands.get("shiftEnter");n&&n.on("execute",()=>{const o=t.document.selection.getFirstPosition(),r=t.createRange(t.createPositionAt(o.parent,0),o.getShiftedBy(-1));this._checkAndApplyAutoLinkOnRange(r)})}_checkAndApplyAutoLinkOnRange(e){const t=this.editor.model,{text:n,range:o}=Qc(e,t),r=fk(n);if(r){const a=t.createRange(o.end.getShiftedBy(-r.length),o.end);this._applyAutoLink(r,a)}}_applyAutoLink(e,t){const n=this.editor.model;this.isEnabled&&function(o,r){return r.schema.checkAttributeInSelection(r.createSelection(o),"linkHref")}(t,n)&&n.enqueueChange(o=>{const r=this.editor.config.get("link.defaultProtocol"),a=dk(e,r);o.setAttribute("linkHref",a,t)})}}function fk(i){const e=d1.exec(i);return e?e[2]:null}class pk extends pt{constructor(e,t){super(e),this.type=t}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){const t=this.editor.model,n=t.document,o=Array.from(n.selection.getSelectedBlocks()).filter(a=>bk(a,t.schema)),r=e.forceValue!==void 0?!e.forceValue:this.value;t.change(a=>{if(r){let c=o[o.length-1].nextSibling,d=Number.POSITIVE_INFINITY,m=[];for(;c&&c.name=="listItem"&&c.getAttribute("listIndent")!==0;){const b=c.getAttribute("listIndent");b<d&&(d=b);const _=b-d;m.push({element:c,listIndent:_}),c=c.nextSibling}m=m.reverse();for(const b of m)a.setAttribute("listIndent",b.listIndent,b.element)}if(!r){let c=Number.POSITIVE_INFINITY;for(const d of o)d.is("element","listItem")&&d.getAttribute("listIndent")<c&&(c=d.getAttribute("listIndent"));c=c===0?1:c,gk(o,!0,c),gk(o,!1,c)}for(const c of o.reverse())r&&c.name=="listItem"?a.rename(c,"paragraph"):r||c.name=="listItem"?r||c.name!="listItem"||c.getAttribute("listType")==this.type||a.setAttribute("listType",this.type,c):(a.setAttributes({listType:this.type,listIndent:0},c),a.rename(c,"listItem"));this.fire("_executeCleanup",o)})}_getValue(){const e=so(this.editor.model.document.selection.getSelectedBlocks());return!!e&&e.is("element","listItem")&&e.getAttribute("listType")==this.type}_checkEnabled(){if(this.value)return!0;const e=this.editor.model.document.selection,t=this.editor.model.schema,n=so(e.getSelectedBlocks());return!!n&&bk(n,t)}}function gk(i,e,t){const n=e?i[0]:i[i.length-1];if(n.is("element","listItem")){let o=n[e?"previousSibling":"nextSibling"],r=n.getAttribute("listIndent");for(;o&&o.is("element","listItem")&&o.getAttribute("listIndent")>=t;)r>o.getAttribute("listIndent")&&(r=o.getAttribute("listIndent")),o.getAttribute("listIndent")==r&&i[e?"unshift":"push"](o),o=o[e?"previousSibling":"nextSibling"]}}function bk(i,e){return e.checkChild(i.parent,"listItem")&&!e.isObject(i)}class vk extends pt{constructor(e,t){super(e),this._indentBy=t=="forward"?1:-1}refresh(){this.isEnabled=this._checkEnabled()}execute(){const e=this.editor.model,t=e.document;let n=Array.from(t.selection.getSelectedBlocks());e.change(o=>{const r=n[n.length-1];let a=r.nextSibling;for(;a&&a.name=="listItem"&&a.getAttribute("listIndent")>r.getAttribute("listIndent");)n.push(a),a=a.nextSibling;this._indentBy<0&&(n=n.reverse());for(const c of n){const d=c.getAttribute("listIndent")+this._indentBy;d<0?o.rename(c,"paragraph"):o.setAttribute("listIndent",d,c)}this.fire("_executeCleanup",n)})}_checkEnabled(){const e=so(this.editor.model.document.selection.getSelectedBlocks());if(!e||!e.is("element","listItem"))return!1;if(this._indentBy>0){const t=e.getAttribute("listIndent"),n=e.getAttribute("listType");let o=e.previousSibling;for(;o&&o.is("element","listItem")&&o.getAttribute("listIndent")>=t;){if(o.getAttribute("listIndent")==t)return o.getAttribute("listType")==n;o=o.previousSibling}return!1}return!0}}function m1(i,e){const t=e.mapper,n=e.writer,o=i.getAttribute("listType")=="numbered"?"ol":"ul",r=function(c){const d=c.createContainerElement("li");return d.getFillerOffset=f1,d}(n),a=n.createContainerElement(o,null);return n.insert(n.createPositionAt(a,0),r),t.bindElements(i,r),r}function wk(i,e,t,n){const o=e.parent,r=t.mapper,a=t.writer;let c=r.toViewPosition(n.createPositionBefore(i));const d=_k(i.previousSibling,{sameIndent:!0,smallerIndent:!0,listIndent:i.getAttribute("listIndent")}),m=i.previousSibling;if(d&&d.getAttribute("listIndent")==i.getAttribute("listIndent")){const b=r.toViewElement(d);c=a.breakContainer(a.createPositionAfter(b))}else if(m&&m.name=="listItem"){c=r.toViewPosition(n.createPositionAt(m,"end"));const b=r.findMappedViewAncestor(c),_=function(T){for(const E of T.getChildren())if(E.name=="ul"||E.name=="ol")return E;return null}(b);c=_?a.createPositionBefore(_):a.createPositionAt(b,"end")}else c=r.toViewPosition(n.createPositionBefore(i));if(c=kk(c),a.insert(c,o),m&&m.name=="listItem"){const b=r.toViewElement(m),_=a.createRange(a.createPositionAt(b,0),c).getWalker({ignoreElementEnd:!0});for(const T of _)if(T.item.is("element","li")){const E=a.breakContainer(a.createPositionBefore(T.item)),P=T.item.parent,R=a.createPositionAt(e,"end");ji(a,R.nodeBefore,R.nodeAfter),a.move(a.createRangeOn(P),R),_.position=E}}else{const b=o.nextSibling;if(b&&(b.is("element","ul")||b.is("element","ol"))){let _=null;for(const T of b.getChildren()){const E=r.toModelElement(T);if(!(E&&E.getAttribute("listIndent")>i.getAttribute("listIndent")))break;_=T}_&&(a.breakContainer(a.createPositionAfter(_)),a.move(a.createRangeOn(_.parent),a.createPositionAt(e,"end")))}}ji(a,o,o.nextSibling),ji(a,o.previousSibling,o)}function ji(i,e,t){return!e||!t||e.name!="ul"&&e.name!="ol"||e.name!=t.name||e.getAttribute("class")!==t.getAttribute("class")?null:i.mergeContainers(i.createPositionAfter(e))}function kk(i){return i.getLastMatchingPosition(e=>e.item.is("uiElement"))}function _k(i,e){const t=!!e.sameIndent,n=!!e.smallerIndent,o=e.listIndent;let r=i;for(;r&&r.name=="listItem";){const a=r.getAttribute("listIndent");if(t&&o==a||n&&o>a)return r;r=e.direction==="forward"?r.nextSibling:r.previousSibling}return null}function yk(i,e,t,n){i.ui.componentFactory.add(e,o=>{const r=i.commands.get(e),a=new nn(o);return a.set({label:t,icon:n,tooltip:!0,isToggleable:!0}),a.bind("isOn","isEnabled").to(r,"value","isEnabled"),a.on("execute",()=>{i.execute(e),i.editing.view.focus()}),a})}function f1(){const i=!this.isEmpty&&(this.getChild(0).name=="ul"||this.getChild(0).name=="ol");return this.isEmpty||i?0:Ph.call(this)}function xk(i){return(e,t,n)=>{const o=n.consumable;if(!o.test(t.item,"insert")||!o.test(t.item,"attribute:listType")||!o.test(t.item,"attribute:listIndent"))return;o.consume(t.item,"insert"),o.consume(t.item,"attribute:listType"),o.consume(t.item,"attribute:listIndent");const r=t.item;wk(r,m1(r,n),n,i)}}function p1(i,e,t){if(!t.consumable.consume(e.item,"attribute:listType"))return;const n=t.mapper.toViewElement(e.item),o=t.writer;o.breakContainer(o.createPositionBefore(n)),o.breakContainer(o.createPositionAfter(n));const r=n.parent,a=e.attributeNewValue=="numbered"?"ol":"ul";o.rename(a,r)}function g1(i,e,t){const n=t.mapper.toViewElement(e.item).parent,o=t.writer;ji(o,n,n.nextSibling),ji(o,n.previousSibling,n);for(const r of e.item.getChildren())t.consumable.consume(r,"insert")}function Nk(i,e,t){if(e.item.name!="listItem"){let n=t.mapper.toViewPosition(e.range.start);const o=t.writer,r=[];for(;(n.parent.name=="ul"||n.parent.name=="ol")&&(n=o.breakContainer(n),n.parent.name=="li");){const a=n,c=o.createPositionAt(n.parent,"end");if(!a.isEqual(c)){const d=o.remove(o.createRange(a,c));r.push(d)}n=o.createPositionAfter(n.parent)}if(r.length>0){for(let a=0;a<r.length;a++){const c=n.nodeBefore;if(n=o.insert(n,r[a]).end,a>0){const d=ji(o,c,c.nextSibling);d&&d.parent==c&&n.offset--}}ji(o,n.nodeBefore,n.nodeAfter)}}}function b1(i,e,t){const n=t.mapper.toViewPosition(e.position),o=n.nodeBefore,r=n.nodeAfter;ji(t.writer,o,r)}function v1(i,e,t){if(t.consumable.consume(e.viewItem,{name:!0})){const n=t.writer,o=n.createElement("listItem"),r=function(d){let m=0,b=d.parent;for(;b;){if(b.is("element","li"))m++;else{const _=b.previousSibling;_&&_.is("element","li")&&m++}b=b.parent}return m}(e.viewItem);n.setAttribute("listIndent",r,o);const a=e.viewItem.parent&&e.viewItem.parent.name=="ol"?"numbered":"bulleted";if(n.setAttribute("listType",a,o),!t.safeInsert(o,e.modelCursor))return;const c=function(d,m,b){const{writer:_,schema:T}=b;let E=_.createPositionAfter(d);for(const P of m)if(P.name=="ul"||P.name=="ol")E=b.convertItem(P,E).modelCursor;else{const R=b.convertItem(P,_.createPositionAt(d,"end")),z=R.modelRange.start.nodeAfter;z&&z.is("element")&&!T.checkChild(d,z.name)&&(d=R.modelCursor.parent.is("element","listItem")?R.modelCursor.parent:_1(R.modelCursor),E=_.createPositionAfter(d))}return E}(o,e.viewItem.getChildren(),t);e.modelRange=n.createRange(e.modelCursor,c),t.updateConversionResult(o,e)}}function Tk(i,e,t){if(t.consumable.test(e.viewItem,{name:!0})){const n=Array.from(e.viewItem.getChildren());for(const o of n)!(o.is("element","li")||vl(o))&&o._remove()}}function w1(i,e,t){if(t.consumable.test(e.viewItem,{name:!0})){if(e.viewItem.childCount===0)return;const n=[...e.viewItem.getChildren()];let o=!1,r=!0;for(const a of n)o&&!vl(a)&&a._remove(),a.is("$text")?(r&&(a._data=a.data.trimStart()),a.nextSibling&&!vl(a.nextSibling)||(a._data=a.data.trimEnd())):vl(a)&&(o=!0),r=!1}}function Ck(i){return(e,t)=>{if(t.isPhantom)return;const n=t.modelPosition.nodeBefore;if(n&&n.is("element","listItem")){const o=t.mapper.toViewElement(n),r=o.getAncestors().find(vl),a=i.createPositionAt(o,0).getWalker();for(const c of a){if(c.type=="elementStart"&&c.item.is("element","li")){t.viewPosition=c.previousPosition;break}if(c.type=="elementEnd"&&c.item==r){t.viewPosition=c.nextPosition;break}}}}}function k1(i,[e,t]){let n,o=e.is("documentFragment")?e.getChild(0):e;if(n=t?this.createSelection(t):this.document.selection,o&&o.is("element","listItem")){const r=n.getFirstPosition();let a=null;if(r.parent.is("element","listItem")?a=r.parent:r.nodeBefore&&r.nodeBefore.is("element","listItem")&&(a=r.nodeBefore),a){const c=a.getAttribute("listIndent");if(c>0)for(;o&&o.is("element","listItem");)o._setAttribute("listIndent",o.getAttribute("listIndent")+c),o=o.nextSibling}}}function _1(i){const e=new Jo({startPosition:i});let t;do t=e.next();while(!t.value.item.is("element","listItem"));return t.value.item}function Ek(i,e,t,n,o,r){const a=_k(e.nodeBefore,{sameIndent:!0,smallerIndent:!0,listIndent:i,foo:"b"}),c=o.mapper,d=o.writer,m=a?a.getAttribute("listIndent"):null;let b;if(a)if(m==i){const _=c.toViewElement(a).parent;b=d.createPositionAfter(_)}else{const _=r.createPositionAt(a,"end");b=c.toViewPosition(_)}else b=t;b=kk(b);for(const _ of[...n.getChildren()])vl(_)&&(b=d.move(d.createRangeOn(_),b).end,ji(d,_,_.nextSibling),ji(d,_.previousSibling,_))}function vl(i){return i.is("element","ol")||i.is("element","ul")}class y1 extends ve{static get pluginName(){return"ListEditing"}static get requires(){return[Wc,as]}init(){const e=this.editor;e.model.schema.register("listItem",{inheritAllFrom:"$block",allowAttributes:["listType","listIndent"]});const t=e.data,n=e.editing;var o;e.model.document.registerPostFixer(c=>function(d,m){const b=d.document.differ.getChanges(),_=new Map;let T=!1;for(const z of b)if(z.type=="insert"&&z.name=="listItem")E(z.position);else if(z.type=="insert"&&z.name!="listItem"){if(z.name!="$text"){const $=z.position.nodeAfter;$.hasAttribute("listIndent")&&(m.removeAttribute("listIndent",$),T=!0),$.hasAttribute("listType")&&(m.removeAttribute("listType",$),T=!0),$.hasAttribute("listStyle")&&(m.removeAttribute("listStyle",$),T=!0);for(const J of Array.from(d.createRangeIn($)).filter(ue=>ue.item.is("element","listItem")))E(J.previousPosition)}E(z.position.getShiftedBy(z.length))}else z.type=="remove"&&z.name=="listItem"?E(z.position):(z.type=="attribute"&&z.attributeKey=="listIndent"||z.type=="attribute"&&z.attributeKey=="listType")&&E(z.range.start);for(const z of _.values())P(z),R(z);return T;function E(z){const $=z.nodeBefore;if($&&$.is("element","listItem")){let J=$;if(_.has(J))return;for(let ue=J.previousSibling;ue&&ue.is("element","listItem");ue=J.previousSibling)if(J=ue,_.has(J))return;_.set($,J)}else{const J=z.nodeAfter;J&&J.is("element","listItem")&&_.set(J,J)}}function P(z){let $=0,J=null;for(;z&&z.is("element","listItem");){const ue=z.getAttribute("listIndent");if(ue>$){let xe;J===null?(J=ue-$,xe=$):(J>ue&&(J=ue),xe=ue-J),m.setAttribute("listIndent",xe,z),T=!0}else J=null,$=z.getAttribute("listIndent")+1;z=z.nextSibling}}function R(z){let $=[],J=null;for(;z&&z.is("element","listItem");){const ue=z.getAttribute("listIndent");if(J&&J.getAttribute("listIndent")>ue&&($=$.slice(0,ue+1)),ue!=0)if($[ue]){const xe=$[ue];z.getAttribute("listType")!=xe&&(m.setAttribute("listType",xe,z),T=!0)}else $[ue]=z.getAttribute("listType");J=z,z=z.nextSibling}}}(e.model,c)),n.mapper.registerViewToModelLength("li",hv),t.mapper.registerViewToModelLength("li",hv),n.mapper.on("modelToViewPosition",Ck(n.view)),n.mapper.on("viewToModelPosition",(o=e.model,(c,d)=>{const m=d.viewPosition,b=m.parent,_=d.mapper;if(b.name=="ul"||b.name=="ol"){if(m.isAtEnd){const T=_.toModelElement(m.nodeBefore),E=_.getModelLength(m.nodeBefore);d.modelPosition=o.createPositionBefore(T).getShiftedBy(E)}else{const T=_.toModelElement(m.nodeAfter);d.modelPosition=o.createPositionBefore(T)}c.stop()}else if(b.name=="li"&&m.nodeBefore&&(m.nodeBefore.name=="ul"||m.nodeBefore.name=="ol")){const T=_.toModelElement(b);let E=1,P=m.nodeBefore;for(;P&&vl(P);)E+=_.getModelLength(P),P=P.previousSibling;d.modelPosition=o.createPositionBefore(T).getShiftedBy(E),c.stop()}})),t.mapper.on("modelToViewPosition",Ck(n.view)),e.conversion.for("editingDowncast").add(c=>{c.on("insert",Nk,{priority:"high"}),c.on("insert:listItem",xk(e.model)),c.on("attribute:listType:listItem",p1,{priority:"high"}),c.on("attribute:listType:listItem",g1,{priority:"low"}),c.on("attribute:listIndent:listItem",function(d){return(m,b,_)=>{if(!_.consumable.consume(b.item,"attribute:listIndent"))return;const T=_.mapper.toViewElement(b.item),E=_.writer;E.breakContainer(E.createPositionBefore(T)),E.breakContainer(E.createPositionAfter(T));const P=T.parent,R=P.previousSibling,z=E.createRangeOn(P);E.remove(z),R&&R.nextSibling&&ji(E,R,R.nextSibling),Ek(b.attributeOldValue+1,b.range.start,z.start,T,_,d),wk(b.item,T,_,d);for(const $ of b.item.getChildren())_.consumable.consume($,"insert")}}(e.model)),c.on("remove:listItem",function(d){return(m,b,_)=>{const T=_.mapper.toViewPosition(b.position).getLastMatchingPosition(J=>!J.item.is("element","li")).nodeAfter,E=_.writer;E.breakContainer(E.createPositionBefore(T)),E.breakContainer(E.createPositionAfter(T));const P=T.parent,R=P.previousSibling,z=E.createRangeOn(P),$=E.remove(z);R&&R.nextSibling&&ji(E,R,R.nextSibling),Ek(_.mapper.toModelElement(T).getAttribute("listIndent")+1,b.position,z.start,T,_,d);for(const J of E.createRangeIn($).getItems())_.mapper.unbindViewElement(J);m.stop()}}(e.model)),c.on("remove",b1,{priority:"low"})}),e.conversion.for("dataDowncast").add(c=>{c.on("insert",Nk,{priority:"high"}),c.on("insert:listItem",xk(e.model))}),e.conversion.for("upcast").add(c=>{c.on("element:ul",Tk,{priority:"high"}),c.on("element:ol",Tk,{priority:"high"}),c.on("element:li",w1,{priority:"high"}),c.on("element:li",v1)}),e.model.on("insertContent",k1,{priority:"high"}),e.commands.add("numberedList",new pk(e,"numbered")),e.commands.add("bulletedList",new pk(e,"bulleted")),e.commands.add("indentList",new vk(e,"forward")),e.commands.add("outdentList",new vk(e,"backward"));const r=n.view.document;this.listenTo(r,"enter",(c,d)=>{const m=this.editor.model.document,b=m.selection.getLastPosition().parent;m.selection.isCollapsed&&b.name=="listItem"&&b.isEmpty&&(this.editor.execute("outdentList"),d.preventDefault(),c.stop())},{context:"li"}),this.listenTo(r,"delete",(c,d)=>{if(d.direction!=="backward")return;const m=this.editor.model.document.selection;if(!m.isCollapsed)return;const b=m.getFirstPosition();if(!b.isAtStart)return;const _=b.parent;_.name==="listItem"&&(_.previousSibling&&_.previousSibling.name==="listItem"||(this.editor.execute("outdentList"),d.preventDefault(),c.stop()))},{context:"li"});const a=c=>(d,m)=>{this.editor.commands.get(c).isEnabled&&(this.editor.execute(c),m())};e.keystrokes.set("Tab",a("indentList")),e.keystrokes.set("Shift+Tab",a("outdentList"))}afterInit(){const e=this.editor.commands,t=e.get("indent"),n=e.get("outdent");t&&t.registerChildCommand(e.get("indentList")),n&&n.registerChildCommand(e.get("outdentList"))}}function hv(i){let e=1;for(const t of i.getChildren())if(t.name=="ul"||t.name=="ol")for(const n of t.getChildren())e+=hv(n);return e}class x1 extends ve{static get pluginName(){return"ListUI"}init(){const e=this.editor.t;yk(this.editor,"numberedList",e("Numbered List"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M7 5.75c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zM3.5 3v5H2V3.7H1v-1h2.5V3zM.343 17.857l2.59-3.257H2.92a.6.6 0 1 0-1.04 0H.302a2 2 0 1 1 3.995 0h-.001c-.048.405-.16.734-.333.988-.175.254-.59.692-1.244 1.312H4.3v1h-4l.043-.043zM7 14.75a.75.75 0 0 1 .75-.75h9.5a.75.75 0 1 1 0 1.5h-9.5a.75.75 0 0 1-.75-.75z"/></svg>'),yk(this.editor,"bulletedList",e("Bulleted List"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M7 5.75c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zm-6 0C1 4.784 1.777 4 2.75 4c.966 0 1.75.777 1.75 1.75 0 .966-.777 1.75-1.75 1.75C1.784 7.5 1 6.723 1 5.75zm6 9c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zm-6 0c0-.966.777-1.75 1.75-1.75.966 0 1.75.777 1.75 1.75 0 .966-.777 1.75-1.75 1.75-.966 0-1.75-.777-1.75-1.75z"/></svg>')}}function Ak(i,e){return n=>{n.on("attribute:url:media",t)};function t(n,o,r){if(!r.consumable.consume(o.item,n.name))return;const a=o.attributeNewValue,c=r.writer,d=r.mapper.toViewElement(o.item),m=[...d.getChildren()].find(_=>_.getCustomProperty("media-content"));c.remove(m);const b=i.getMediaViewElement(c,a,e);c.insert(c.createPositionAt(d,0),b)}}function Sk(i,e,t,n){const o=i.createContainerElement("figure",{class:"media"});return i.insert(i.createPositionAt(o,0),e.getMediaViewElement(i,t,n)),o}function Dk(i){const e=i.getSelectedElement();return e&&e.is("element","media")?e:null}function jk(i,e,t){i.change(n=>{const o=n.createElement("media",{url:e});i.insertContent(o,t),n.setSelection(o,"on")})}class N1 extends pt{refresh(){const e=this.editor.model,t=e.document.selection,n=Dk(t);this.value=n?n.getAttribute("url"):null,this.isEnabled=function(o){const r=o.getSelectedElement();return!!r&&r.name==="media"}(t)||function(o,r){let a=hl(o,r).start.parent;return a.isEmpty&&!r.schema.isLimit(a)&&(a=a.parent),r.schema.checkChild(a,"media")}(t,e)}execute(e){const t=this.editor.model,n=t.document.selection,o=Dk(n);o?t.change(r=>{r.setAttribute("url",e,o)}):jk(t,e,hl(n,t))}}class T1{constructor(e,t){const n=t.providers,o=t.extraProviders||[],r=new Set(t.removeProviders),a=n.concat(o).filter(c=>{const d=c.name;return d?!r.has(d):(Object(C.b)("media-embed-no-provider-name",{provider:c}),!1)});this.locale=e,this.providerDefinitions=a}hasMedia(e){return!!this._getMedia(e)}getMediaViewElement(e,t,n){return this._getMedia(t).getViewElement(e,n)}_getMedia(e){if(!e)return new Ik(this.locale);e=e.trim();for(const t of this.providerDefinitions){const n=t.html,o=Tt(t.url);for(const r of o){const a=this._getUrlMatches(e,r);if(a)return new Ik(this.locale,e,a,n)}}return null}_getUrlMatches(e,t){let n=e.match(t);if(n)return n;let o=e.replace(/^https?:\/\//,"");return n=o.match(t),n||(o=o.replace(/^www\./,""),n=o.match(t),n||null)}}class Ik{constructor(e,t,n,o){this.url=this._getValidUrl(t),this._t=e.t,this._match=n,this._previewRenderer=o}getViewElement(e,t){const n={};let o;if(t.renderForEditingView||t.renderMediaPreview&&this.url&&this._previewRenderer){this.url&&(n["data-oembed-url"]=this.url),t.renderForEditingView&&(n.class="ck-media__wrapper");const r=this._getPreviewHtml(t);o=e.createRawElement("div",n,function(a){a.innerHTML=r})}else this.url&&(n.url=this.url),o=e.createEmptyElement(t.elementName,n);return e.setCustomProperty("media-content",!0,o),o}_getPreviewHtml(e){return this._previewRenderer?this._previewRenderer(this._match):this.url&&e.renderForEditingView?this._getPlaceholderHtml():""}_getPlaceholderHtml(){const e=new qm,t=new Bc;return e.text=this._t("Open media in new tab"),t.content='<svg viewBox="0 0 64 42" xmlns="http://www.w3.org/2000/svg"><path d="M47.426 17V3.713L63.102 0v19.389h-.001l.001.272c0 1.595-2.032 3.43-4.538 4.098-2.506.668-4.538-.083-4.538-1.678 0-1.594 2.032-3.43 4.538-4.098.914-.244 2.032-.565 2.888-.603V4.516L49.076 7.447v9.556A1.014 1.014 0 0 0 49 17h-1.574zM29.5 17h-8.343a7.073 7.073 0 1 0-4.657 4.06v3.781H3.3a2.803 2.803 0 0 1-2.8-2.804V8.63a2.803 2.803 0 0 1 2.8-2.805h4.082L8.58 2.768A1.994 1.994 0 0 1 10.435 1.5h8.985c.773 0 1.477.448 1.805 1.149l1.488 3.177H26.7c1.546 0 2.8 1.256 2.8 2.805V17zm-11.637 0H17.5a1 1 0 0 0-1 1v.05A4.244 4.244 0 1 1 17.863 17zm29.684 2c.97 0 .953-.048.953.889v20.743c0 .953.016.905-.953.905H19.453c-.97 0-.953.048-.953-.905V19.89c0-.937-.016-.889.97-.889h28.077zm-4.701 19.338V22.183H24.154v16.155h18.692zM20.6 21.375v1.616h1.616v-1.616H20.6zm0 3.231v1.616h1.616v-1.616H20.6zm0 3.231v1.616h1.616v-1.616H20.6zm0 3.231v1.616h1.616v-1.616H20.6zm0 3.231v1.616h1.616v-1.616H20.6zm0 3.231v1.616h1.616V37.53H20.6zm24.233-16.155v1.616h1.615v-1.616h-1.615zm0 3.231v1.616h1.615v-1.616h-1.615zm0 3.231v1.616h1.615v-1.616h-1.615zm0 3.231v1.616h1.615v-1.616h-1.615zm0 3.231v1.616h1.615v-1.616h-1.615zm0 3.231v1.616h1.615V37.53h-1.615zM29.485 25.283a.4.4 0 0 1 .593-.35l9.05 4.977a.4.4 0 0 1 0 .701l-9.05 4.978a.4.4 0 0 1-.593-.35v-9.956z"/></svg>',t.viewBox="0 0 64 42",new Eo({tag:"div",attributes:{class:"ck ck-reset_all ck-media__placeholder"},children:[{tag:"div",attributes:{class:"ck-media__placeholder__icon"},children:[t]},{tag:"a",attributes:{class:"ck-media__placeholder__url",target:"_blank",rel:"noopener noreferrer",href:this.url},children:[{tag:"span",attributes:{class:"ck-media__placeholder__url__text"},children:[this.url]},e]}]}).render().outerHTML}_getValidUrl(e){return e?e.match(/^https?/)?e:"https://"+e:null}}w(94);class op extends ve{static get pluginName(){return"MediaEmbedEditing"}constructor(e){super(e),e.config.define("mediaEmbed",{elementName:"oembed",providers:[{name:"dailymotion",url:/^dailymotion\.com\/video\/(\w+)/,html:t=>`<div style="position: relative; padding-bottom: 100%; height: 0; "><iframe src="https://www.dailymotion.com/embed/video/${t[1]}" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" frameborder="0" width="480" height="270" allowfullscreen allow="autoplay"></iframe></div>`},{name:"spotify",url:[/^open\.spotify\.com\/(artist\/\w+)/,/^open\.spotify\.com\/(album\/\w+)/,/^open\.spotify\.com\/(track\/\w+)/],html:t=>`<div style="position: relative; padding-bottom: 100%; height: 0; padding-bottom: 126%;"><iframe src="https://open.spotify.com/embed/${t[1]}" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" frameborder="0" allowtransparency="true" allow="encrypted-media"></iframe></div>`},{name:"youtube",url:[/^(?:m\.)?youtube\.com\/watch\?v=([\w-]+)/,/^(?:m\.)?youtube\.com\/v\/([\w-]+)/,/^youtube\.com\/embed\/([\w-]+)/,/^youtu\.be\/([\w-]+)/],html:t=>`<div style="position: relative; padding-bottom: 100%; height: 0; padding-bottom: 56.2493%;"><iframe src="https://www.youtube.com/embed/${t[1]}" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe></div>`},{name:"vimeo",url:[/^vimeo\.com\/(\d+)/,/^vimeo\.com\/[^/]+\/[^/]+\/video\/(\d+)/,/^vimeo\.com\/album\/[^/]+\/video\/(\d+)/,/^vimeo\.com\/channels\/[^/]+\/(\d+)/,/^vimeo\.com\/groups\/[^/]+\/videos\/(\d+)/,/^vimeo\.com\/ondemand\/[^/]+\/(\d+)/,/^player\.vimeo\.com\/video\/(\d+)/],html:t=>`<div style="position: relative; padding-bottom: 100%; height: 0; padding-bottom: 56.2493%;"><iframe src="https://player.vimeo.com/video/${t[1]}" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div>`},{name:"instagram",url:/^instagram\.com\/p\/(\w+)/},{name:"twitter",url:/^twitter\.com/},{name:"googleMaps",url:[/^google\.com\/maps/,/^goo\.gl\/maps/,/^maps\.google\.com/,/^maps\.app\.goo\.gl/]},{name:"flickr",url:/^flickr\.com/},{name:"facebook",url:/^facebook\.com/}]}),this.registry=new T1(e.locale,e.config.get("mediaEmbed"))}init(){const e=this.editor,t=e.model.schema,n=e.t,o=e.conversion,r=e.config.get("mediaEmbed.previewsInData"),a=e.config.get("mediaEmbed.elementName"),c=this.registry;e.commands.add("mediaEmbed",new N1(e)),t.register("media",{isObject:!0,isBlock:!0,allowWhere:"$block",allowAttributes:["url"]}),o.for("dataDowncast").elementToElement({model:"media",view:(d,{writer:m})=>{const b=d.getAttribute("url");return Sk(m,c,b,{elementName:a,renderMediaPreview:b&&r})}}),o.for("dataDowncast").add(Ak(c,{elementName:a,renderMediaPreview:r})),o.for("editingDowncast").elementToElement({model:"media",view:(d,{writer:m})=>{const b=d.getAttribute("url");return function(_,T,E){return T.setCustomProperty("media",!0,_),on(_,T,{label:E})}(Sk(m,c,b,{elementName:a,renderForEditingView:!0}),m,n("media widget"))}}),o.for("editingDowncast").add(Ak(c,{elementName:a,renderForEditingView:!0})),o.for("upcast").elementToElement({view:d=>["oembed",a].includes(d.name)&&d.getAttribute("url")?{name:!0}:null,model:(d,{writer:m})=>{const b=d.getAttribute("url");if(c.hasMedia(b))return m.createElement("media",{url:b})}}).elementToElement({view:{name:"div",attributes:{"data-oembed-url":!0}},model:(d,{writer:m})=>{const b=d.getAttribute("data-oembed-url");if(c.hasMedia(b))return m.createElement("media",{url:b})}})}}const C1=/^(?:http(s)?:\/\/)?[\w-]+\.[\w-.~:/?#[\]@!$&'()*+,;=%]+$/;class E1 extends ve{static get requires(){return[St,Vf]}static get pluginName(){return"AutoMediaEmbed"}constructor(e){super(e),this._timeoutId=null,this._positionToInsert=null}init(){const e=this.editor,t=e.model.document;this.listenTo(e.plugins.get("ClipboardPipeline"),"inputTransformation",()=>{const n=t.selection.getFirstRange(),o=Ln.fromPosition(n.start);o.stickiness="toPrevious";const r=Ln.fromPosition(n.end);r.stickiness="toNext",t.once("change:data",()=>{this._embedMediaBetweenPositions(o,r),o.detach(),r.detach()},{priority:"high"})}),e.commands.get("undo").on("execute",()=>{this._timeoutId&&(qt.window.clearTimeout(this._timeoutId),this._positionToInsert.detach(),this._timeoutId=null,this._positionToInsert=null)},{priority:"high"})}_embedMediaBetweenPositions(e,t){const n=this.editor,o=n.plugins.get(op).registry,r=new Ti(e,t),a=r.getWalker({ignoreElementEnd:!0});let c="";for(const d of a)d.item.is("$textProxy")&&(c+=d.item.data);if(c=c.trim(),!c.match(C1)||!o.hasMedia(c))return void r.detach();n.commands.get("mediaEmbed").isEnabled?(this._positionToInsert=Ln.fromPosition(e),this._timeoutId=qt.window.setTimeout(()=>{n.model.change(d=>{let m;this._timeoutId=null,d.remove(r),r.detach(),this._positionToInsert.root.rootName!=="$graveyard"&&(m=this._positionToInsert),jk(n.model,c,m),this._positionToInsert.detach(),this._positionToInsert=null})},100)):r.detach()}}w(96);class A1 extends gt{constructor(e,t){super(t);const n=t.t;this.focusTracker=new Lo,this.keystrokes=new yo,this.set("mediaURLInputValue",""),this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(n("Save"),Co.check,"ck-button-save"),this.saveButtonView.type="submit",this.saveButtonView.bind("isEnabled").to(this,"mediaURLInputValue",o=>!!o),this.cancelButtonView=this._createButton(n("Cancel"),Co.cancel,"ck-button-cancel","cancel"),this._focusables=new os,this._focusCycler=new Ms({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this._validators=e,this.setTemplate({tag:"form",attributes:{class:["ck","ck-media-form","ck-responsive-form"],tabindex:"-1"},children:[this.urlInputView,this.saveButtonView,this.cancelButtonView]}),Ad(this)}render(){super.render(),Sd({view:this}),[this.urlInputView,this.saveButtonView,this.cancelButtonView].forEach(t=>{this._focusables.add(t),this.focusTracker.add(t.element)}),this.keystrokes.listenTo(this.element);const e=t=>t.stopPropagation();this.keystrokes.set("arrowright",e),this.keystrokes.set("arrowleft",e),this.keystrokes.set("arrowup",e),this.keystrokes.set("arrowdown",e),this.listenTo(this.urlInputView.element,"selectstart",(t,n)=>{n.stopPropagation()},{priority:"high"})}focus(){this._focusCycler.focusFirst()}get url(){return this.urlInputView.fieldView.element.value.trim()}set url(e){this.urlInputView.fieldView.element.value=e.trim()}isValid(){this.resetFormStatus();for(const e of this._validators){const t=e(this);if(t)return this.urlInputView.errorText=t,!1}return!0}resetFormStatus(){this.urlInputView.errorText=null,this.urlInputView.infoText=this._urlInputViewInfoDefault}_createUrlInput(){const e=this.locale.t,t=new Md(this.locale,Od),n=t.fieldView;return this._urlInputViewInfoDefault=e("Paste the media URL in the input."),this._urlInputViewInfoTip=e("Tip: Paste the URL into the content to embed faster."),t.label=e("Media URL"),t.infoText=this._urlInputViewInfoDefault,n.on("input",()=>{t.infoText=n.element.value?this._urlInputViewInfoTip:this._urlInputViewInfoDefault,this.mediaURLInputValue=n.element.value.trim()}),t}_createButton(e,t,n,o){const r=new nn(this.locale);return r.set({label:e,icon:t,tooltip:!0}),r.extendTemplate({attributes:{class:n}}),o&&r.delegate("execute").to(this,o),r}}class S1 extends ve{static get requires(){return[op]}static get pluginName(){return"MediaEmbedUI"}init(){const e=this.editor,t=e.commands.get("mediaEmbed"),n=e.plugins.get(op).registry;e.ui.componentFactory.add("mediaEmbed",o=>{const r=rs(o),a=new A1(function(c,d){return[m=>{if(!m.url.length)return c("The URL must not be empty.")},m=>{if(!d.hasMedia(m.url))return c("This media URL is not supported.")}]}(e.t,n),e.locale);return this._setUpDropdown(r,a,t,e),this._setUpForm(r,a,t),r})}_setUpDropdown(e,t,n){const o=this.editor,r=o.t,a=e.buttonView;function c(){o.editing.view.focus(),e.isOpen=!1}e.bind("isEnabled").to(n),e.panelView.children.add(t),a.set({label:r("Insert media"),icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M18.68 3.03c.6 0 .59-.03.59.55v12.84c0 .59.01.56-.59.56H1.29c-.6 0-.59.03-.59-.56V3.58c0-.58-.01-.55.6-.55h17.38zM15.77 15V5H4.2v10h11.57zM2 4v1h1V4H2zm0 2v1h1V6H2zm0 2v1h1V8H2zm0 2v1h1v-1H2zm0 2v1h1v-1H2zm0 2v1h1v-1H2zM17 4v1h1V4h-1zm0 2v1h1V6h-1zm0 2v1h1V8h-1zm0 2v1h1v-1h-1zm0 2v1h1v-1h-1zm0 2v1h1v-1h-1zM7.5 7.177a.4.4 0 0 1 .593-.351l5.133 2.824a.4.4 0 0 1 0 .7l-5.133 2.824a.4.4 0 0 1-.593-.35V7.176v.001z"/></svg>',tooltip:!0}),a.on("open",()=>{t.disableCssTransitions(),t.url=n.value||"",t.urlInputView.fieldView.select(),t.focus(),t.enableCssTransitions()},{priority:"low"}),e.on("submit",()=>{t.isValid()&&(o.execute("mediaEmbed",t.url),c())}),e.on("change:isOpen",()=>t.resetFormStatus()),e.on("cancel",()=>c())}_setUpForm(e,t,n){t.delegate("submit","cancel").to(e),t.urlInputView.bind("value").to(n,"value"),t.urlInputView.bind("isReadOnly").to(n,"isEnabled",o=>!o)}}w(98);function D1(i,e){if(!i.childCount)return;const t=new Bs(i.document),n=function(a,c){const d=c.createRangeIn(a),m=new Ct({name:/^p|h\d+$/,styles:{"mso-list":/.*/}}),b=[];for(const _ of d)if(_.type==="elementStart"&&m.match(_.item)){const T=I1(_.item);b.push({element:_.item,id:T.id,order:T.order,indent:T.indent})}return b}(i,t);if(!n.length)return;let o=null,r=1;n.forEach((a,c)=>{const d=function(P,R){if(!P)return!0;if(P.id!==R.id)return R.indent-P.indent!=1;const z=R.element.previousSibling;if(!z)return!0;return $=z,!($.is("element","ol")||$.is("element","ul"));var $}(n[c-1],a),m=d?null:n[c-1],b=(T=a,(_=m)?T.indent-_.indent:T.indent-1);var _,T;if(d&&(o=null,r=1),!o||b!==0){const P=function(R,z){const $=new RegExp(`@list l${R.id}:level${R.indent}\\s*({[^}]*)`,"gi"),J=/mso-level-number-format:([^;]{0,100});/gi,ue=$.exec(z);let xe="decimal",He="ol";if(ue&&ue[1]){const Qt=J.exec(ue[1]);if(Qt&&Qt[1]&&(xe=Qt[1].trim(),He=xe!=="bullet"&&xe!=="image"?"ol":"ul"),xe==="bullet"){const _t=function(Un){const no=function(Fo){if(Fo.getChild(0).is("$text"))return null;for(const ho of Fo.getChildren()){if(!ho.is("element","span"))continue;const jo=ho.getChild(0);return jo.is("$text")?jo:jo.getChild(0)}}(Un);if(!no)return null;const Wn=no._data;return Wn==="o"?"circle":Wn==="·"?"disc":Wn==="§"?"square":null}(R.element);_t&&(xe=_t)}}return{type:He,style:j1(xe)}}(a,e);if(o){if(a.indent>r){const R=o.getChild(o.childCount-1),z=R.getChild(R.childCount-1);o=Pk(P,z,t),r+=1}else if(a.indent<r){const R=r-a.indent;o=function(z,$){const J=z.getAncestors({parentFirst:!0});let ue=null,xe=0;for(const He of J)if(He.name!=="ul"&&He.name!=="ol"||xe++,xe===$){ue=He;break}return ue}(o,R),r=parseInt(a.indent)}}else o=Pk(P,a.element,t);a.indent<=r&&(o.is("element",P.type)||(o=t.rename(P.type,o)))}const E=function(P,R){return function(z,$){const J=new Ct({name:"span",styles:{"mso-list":"Ignore"}}),ue=$.createRangeIn(z);for(const xe of ue)xe.type==="elementStart"&&J.match(xe.item)&&$.remove(xe.item)}(P,R),R.rename("li",P)}(a.element,t);t.appendChild(E,o)})}function j1(i){switch(i){case"arabic-leading-zero":return"decimal-leading-zero";case"alpha-upper":return"upper-alpha";case"alpha-lower":return"lower-alpha";case"roman-upper":return"upper-roman";case"roman-lower":return"lower-roman";case"circle":case"disc":case"square":return i;default:return null}}function Pk(i,e,t){const n=e.parent,o=t.createElement(i.type),r=n.getChildIndex(e)+1;return t.insertChild(r,o,n),i.style&&t.setStyle("list-style-type",i.style,o),o}function I1(i){const e={},t=i.getStyle("mso-list");if(t){const n=t.match(/(^|\s{1,100})l(\d+)/i),o=t.match(/\s{0,100}lfo(\d+)/i),r=t.match(/\s{0,100}level(\d+)/i);n&&o&&r&&(e.id=n[2],e.order=o[1],e.indent=r[1])}return e}const P1=/id=("|')docs-internal-guid-[-0-9a-f]+("|')/i;class M1{constructor(e){this.document=e}isActive(e){return P1.test(e)}execute(e){const t=new Bs(this.document),{body:n}=e._parsedData;(function(o,r){for(const a of o.getChildren())if(a.is("element","b")&&a.getStyle("font-weight")==="normal"){const c=o.getChildIndex(a);r.remove(a),r.insertChild(c,a.getChildren(),o)}})(n,t),function(o,r){for(const a of r.createRangeIn(o)){const c=a.item;if(c.is("element","li")){const d=c.getChild(0);d&&d.is("element","p")&&r.unwrapElement(d)}}}(n,t),e.content=n}}function O1(i,e){if(!i.childCount)return;const t=new Bs;(function(o,r,a){const c=a.createRangeIn(r),d=new Ct({name:"img"}),m=[];for(const b of c)if(d.match(b.item)){const _=b.item,T=_.getAttribute("v:shapes")?_.getAttribute("v:shapes").split(" "):[];T.length&&T.every(E=>o.indexOf(E)>-1)?m.push(_):_.getAttribute("src")||m.push(_)}for(const b of m)a.remove(b)})(function(o,r){const a=r.createRangeIn(o),c=new Ct({name:/v:(.+)/}),d=[];for(const m of a){const b=m.item,_=b.previousSibling&&b.previousSibling.name||null;c.match(b)&&b.getAttribute("o:gfxdata")&&_!=="v:shapetype"&&d.push(m.item.getAttribute("id"))}return d}(i,t),i,t),function(o,r){const a=r.createRangeIn(o),c=new Ct({name:/v:(.+)/}),d=[];for(const m of a)c.match(m.item)&&d.push(m.item);for(const m of d)r.remove(m)}(i,t);const n=function(o,r){const a=r.createRangeIn(o),c=new Ct({name:"img"}),d=[];for(const m of a)c.match(m.item)&&m.item.getAttribute("src").startsWith("file://")&&d.push(m.item);return d}(i,t);n.length&&function(o,r,a){if(o.length===r.length)for(let d=0;d<o.length;d++){const m=`data:${r[d].type};base64,${c=r[d].hex,btoa(c.match(/\w{2}/g).map(b=>String.fromCharCode(parseInt(b,16))).join(""))}`;a.setAttribute("src",m,o[d])}var c}(n,function(o){if(!o)return[];const r=/{\\pict[\s\S]+?\\bliptag-?\d+(\\blipupi-?\d+)?({\\\*\\blipuid\s?[\da-fA-F]+)?[\s}]*?/,a=new RegExp("(?:("+r.source+"))([\\da-fA-F\\s]+)\\}","g"),c=o.match(a),d=[];if(c)for(const m of c){let b=!1;m.includes("\\pngblip")?b="image/png":m.includes("\\jpegblip")&&(b="image/jpeg"),b&&d.push({hex:m.replace(r,"").replace(/[^\da-fA-F]/g,""),type:b})}return d}(e),t)}const R1=/<meta\s*name="?generator"?\s*content="?microsoft\s*word\s*\d+"?\/?>/i,V1=/xmlns:o="urn:schemas-microsoft-com/i;class L1{constructor(e){this.document=e}isActive(e){return R1.test(e)||V1.test(e)}execute(e){const{body:t,stylesString:n}=e._parsedData;D1(t,n),O1(t,e.dataTransfer.getData("text/rtf")),e.content=t}}function Mk(i){return i.replace(/<span(?: class="Apple-converted-space"|)>(\s+)<\/span>/g,(e,t)=>t.length===1?" ":Array(t.length+1).join("  ").substr(0,t.length))}function z1(i,e){const t=new DOMParser,n=function(d){return Mk(Mk(d)).replace(/(<span\s+style=['"]mso-spacerun:yes['"]>[^\S\r\n]*?)[\r\n]+([^\S\r\n]*<\/span>)/g,"$1$2").replace(/<span\s+style=['"]mso-spacerun:yes['"]><\/span>/g,"").replace(/ <\//g," </").replace(/ <o:p><\/o:p>/g," <o:p></o:p>").replace(/<o:p>(&nbsp;|\u00A0)<\/o:p>/g,"").replace(/>([^\S\r\n]*[\r\n]\s*)</g,"><")}(function(d){const m=d.indexOf("</body>");if(m<0)return d;const b=d.indexOf("</html>",m+7);return d.substring(0,m+7)+(b>=0?d.substring(b):"")}(i=i.replace(/<!--\[if gte vml 1]>/g,""))),o=t.parseFromString(n,"text/html");(function(d){d.querySelectorAll("span[style*=spacerun]").forEach(m=>{const b=m.innerText.length||0;m.innerHTML=Array(b+1).join("  ").substr(0,b)})})(o);const r=o.body.innerHTML,a=function(d,m){const b=new $i(m),_=new ki(b,{blockFillerMode:"nbsp"}),T=d.createDocumentFragment(),E=d.body.childNodes;for(;E.length>0;)T.appendChild(E[0]);return _.domToView(T,{skipComments:!0})}(o,e),c=function(d){const m=[],b=[],_=Array.from(d.getElementsByTagName("style"));for(const T of _)T.sheet&&T.sheet.cssRules&&T.sheet.cssRules.length&&(m.push(T.sheet),b.push(T.innerHTML));return{styles:m,stylesString:b.join(" ")}}(o);return{body:a,bodyString:r,styles:c.styles,stylesString:c.stylesString}}function _n(i,e,t,n,o=1){e>o?n.setAttribute(i,e,t):n.removeAttribute(i,t)}function wl(i,e,t={}){const n=i.createElement("tableCell",t);return i.insertElement("paragraph",n),i.insert(n,e),n}function mv(i,e){const t=e.parent.parent,n=parseInt(t.getAttribute("headingColumns")||0),{column:o}=i.getCellLocation(e);return!!n&&o<n}function B1(){return i=>{i.on("element:table",(e,t,n)=>{const o=t.viewItem;if(!n.consumable.test(o,{name:!0}))return;const{rows:r,headingRows:a,headingColumns:c}=function(b){const _={headingRows:0,headingColumns:0},T=[],E=[];let P;for(const R of Array.from(b.getChildren()))if(R.name==="tbody"||R.name==="thead"||R.name==="tfoot"){R.name!=="thead"||P||(P=R);const z=Array.from(R.getChildren()).filter($=>$.is("element","tr"));for(const $ of z)if($.parent.name==="thead"&&$.parent===P)_.headingRows++,T.push($);else{E.push($);const J=F1($);J>_.headingColumns&&(_.headingColumns=J)}}return _.rows=[...T,...E],_}(o),d={};c&&(d.headingColumns=c),a&&(d.headingRows=a);const m=n.writer.createElement("table",d);if(n.safeInsert(m,t.modelCursor)){if(n.consumable.consume(o,{name:!0}),r.forEach(b=>n.convertItem(b,n.writer.createPositionAt(m,"end"))),n.convertChildren(o,n.writer.createPositionAt(m,"end")),m.isEmpty){const b=n.writer.createElement("tableRow");n.writer.insert(b,n.writer.createPositionAt(m,"end")),wl(n.writer,n.writer.createPositionAt(b,"end"))}n.updateConversionResult(m,t)}})}}function Ok(i){return e=>{e.on("element:"+i,(t,n,o)=>{if(n.modelRange&&n.viewItem.isEmpty){const r=n.modelRange.start.nodeAfter,a=o.writer.createPositionAt(r,0);o.writer.insertElement("paragraph",a)}},{priority:"low"})}}function F1(i){let e=0,t=0;const n=Array.from(i.getChildren()).filter(o=>o.name==="th"||o.name==="td");for(;t<n.length&&n[t].name==="th";){const o=n[t];e+=parseInt(o.getAttribute("colspan")||1),t++}return e}class $t{constructor(e,t={}){this._table=e,this._startRow=t.row!==void 0?t.row:t.startRow||0,this._endRow=t.row!==void 0?t.row:t.endRow,this._startColumn=t.column!==void 0?t.column:t.startColumn||0,this._endColumn=t.column!==void 0?t.column:t.endColumn,this._includeAllSlots=!!t.includeAllSlots,this._skipRows=new Set,this._row=0,this._rowIndex=0,this._column=0,this._cellIndex=0,this._spannedCells=new Map,this._nextCellAtColumn=-1}[Symbol.iterator](){return this}next(){const e=this._table.getChild(this._rowIndex);if(!e||this._isOverEndRow())return{done:!0};if(!e.is("element","tableRow"))return this._rowIndex++,this.next();if(this._isOverEndColumn())return this._advanceToNextRow();let t=null;const n=this._getSpanned();if(n)this._includeAllSlots&&!this._shouldSkipSlot()&&(t=this._formatOutValue(n.cell,n.row,n.column));else{const o=e.getChild(this._cellIndex);if(!o)return this._advanceToNextRow();const r=parseInt(o.getAttribute("colspan")||1),a=parseInt(o.getAttribute("rowspan")||1);(r>1||a>1)&&this._recordSpans(o,a,r),this._shouldSkipSlot()||(t=this._formatOutValue(o)),this._nextCellAtColumn=this._column+r}return this._column++,this._column==this._nextCellAtColumn&&this._cellIndex++,t||this.next()}skipRow(e){this._skipRows.add(e)}_advanceToNextRow(){return this._row++,this._rowIndex++,this._column=0,this._cellIndex=0,this._nextCellAtColumn=-1,this.next()}_isOverEndRow(){return this._endRow!==void 0&&this._row>this._endRow}_isOverEndColumn(){return this._endColumn!==void 0&&this._column>this._endColumn}_formatOutValue(e,t=this._row,n=this._column){return{done:!1,value:new q1(this,e,t,n)}}_shouldSkipSlot(){const e=this._skipRows.has(this._row),t=this._row<this._startRow,n=this._column<this._startColumn,o=this._endColumn!==void 0&&this._column>this._endColumn;return e||t||n||o}_getSpanned(){const e=this._spannedCells.get(this._row);return e&&e.get(this._column)||null}_recordSpans(e,t,n){const o={cell:e,row:this._row,column:this._column};for(let r=this._row;r<this._row+t;r++)for(let a=this._column;a<this._column+n;a++)r==this._row&&a==this._column||this._markSpannedCell(r,a,o)}_markSpannedCell(e,t,n){this._spannedCells.has(e)||this._spannedCells.set(e,new Map),this._spannedCells.get(e).set(t,n)}}class q1{constructor(e,t,n,o){this.cell=t,this.row=e._row,this.column=e._column,this.cellAnchorRow=n,this.cellAnchorColumn=o,this._cellIndex=e._cellIndex,this._rowIndex=e._rowIndex,this._table=e._table}get isAnchor(){return this.row===this.cellAnchorRow&&this.column===this.cellAnchorColumn}get cellWidth(){return parseInt(this.cell.getAttribute("colspan")||1)}get cellHeight(){return parseInt(this.cell.getAttribute("rowspan")||1)}get rowIndex(){return this._rowIndex}getPositionBefore(){return this._table.root.document.model.createPositionAt(this._table.getChild(this.row),this._cellIndex)}}function Rk(i={}){return e=>e.on("insert:table",(t,n,o)=>{const r=n.item;if(!o.consumable.consume(r,"insert"))return;o.consumable.consume(r,"attribute:headingRows:table"),o.consumable.consume(r,"attribute:headingColumns:table");const a=i&&i.asWidget,c=o.writer.createContainerElement("figure",{class:"table"}),d=o.writer.createContainerElement("table");let m;var b,_;o.writer.insert(o.writer.createPositionAt(c,0),d),a&&(b=c,(_=o.writer).setCustomProperty("table",!0,b),m=on(b,_,{hasSelectionHandle:!0}));const T=new $t(r),E={headingRows:r.getAttribute("headingRows")||0,headingColumns:r.getAttribute("headingColumns")||0},P=new Map;for(const z of T){const{row:$,cell:J}=z,ue=r.getChild($),xe=P.get($)||pv(d,ue,$,E,o);P.set($,xe),o.consumable.consume(J,"insert"),fv(z,E,o.writer.createPositionAt(xe,"end"),o,i)}for(const z of r.getChildren()){const $=z.index;z.is("element","tableRow")&&!P.has($)&&P.set($,pv(d,z,$,E,o))}const R=o.mapper.toViewPosition(n.range.start);o.mapper.bindElements(r,a?m:c),o.writer.insert(R,a?m:c)})}function H1(i,e){const{writer:t}=e;if(i.parent.is("element","tableCell"))return Vk(i)?t.createContainerElement("span",{class:"ck-table-bogus-paragraph"}):t.createContainerElement("p")}function Vk(i){return i.parent.childCount===1&&!Fk(i)}function $1(i,e,t){const{cell:n}=i,o=Lk(i,e),r=t.mapper.toViewElement(n);r&&r.name!==o&&function(a,c,d){const m=d.writer,b=d.mapper.toViewElement(a),_=Bd(m.createEditableElement(c,b.getAttributes()),m);Kc(_,m,(T,E,P)=>P.addClass(Tt(E.classes),T),(T,E,P)=>P.removeClass(Tt(E.classes),T)),m.insert(m.createPositionAfter(b),_),m.move(m.createRangeIn(b),m.createPositionAt(_,0)),m.remove(m.createRangeOn(b)),d.mapper.unbindViewElement(b),d.mapper.bindElements(a,_)}(n,o,t)}function fv(i,e,t,n,o){const r=o&&o.asWidget,a=Lk(i,e),c=r?Bd(n.writer.createEditableElement(a),n.writer):n.writer.createContainerElement(a);r&&Kc(c,n.writer,(_,T,E)=>E.addClass(Tt(T.classes),_),(_,T,E)=>E.removeClass(Tt(T.classes),_));const d=i.cell,m=d.getChild(0),b=d.childCount===1&&m.name==="paragraph";if(n.writer.insert(t,c),n.mapper.bindElements(d,c),!r&&b&&!Fk(m)){const _=d.getChild(0);n.consumable.consume(_,"insert"),n.mapper.bindElements(_,c)}}function pv(i,e,t,n,o){o.consumable.consume(e,"insert");const r=e.isEmpty?o.writer.createEmptyElement("tr"):o.writer.createContainerElement("tr");o.mapper.bindElements(e,r);const a=n.headingRows,c=function(b,_,T){return zk(b,_)||function(P,R,z){const $=z.writer.createContainerElement(P),J=z.writer.createPositionAt(R,P=="tbody"?"end":0);return z.writer.insert(J,$),$}(b,_,T)}(function(b,_){return b<_.headingRows?"thead":"tbody"}(t,n),i,o),d=a>0&&t>=a?t-a:t,m=o.writer.createPositionAt(c,d);return o.writer.insert(m,r),r}function Lk(i,e){const{row:t,column:n}=i,{headingColumns:o,headingRows:r}=e;return r&&r>t||o&&o>n?"th":"td"}function zk(i,e){for(const t of e.getChildren())if(t.name==i)return t}function Bk(i,e,t){const n=zk(i,e);n&&n.childCount===0&&t.writer.remove(t.writer.createRangeOn(n))}function Fk(i){return!![...i.getAttributeKeys()].length}class U1 extends pt{refresh(){const e=this.editor.model,t=e.document.selection,n=e.schema;this.isEnabled=function(o,r){const a=o.getFirstPosition().parent,c=a===a.root?a:a.parent;return r.checkChild(c,"table")}(t,n)}execute(e={}){const t=this.editor.model,n=t.document.selection,o=this.editor.plugins.get("TableUtils"),r=this.editor.config.get("table"),a=hl(n,t),c=r.defaultHeadings.rows,d=r.defaultHeadings.columns;e.headingRows===void 0&&c&&(e.headingRows=c),e.headingColumns===void 0&&d&&(e.headingColumns=d),t.change(m=>{const b=o.createTable(m,e);t.insertContent(b,a),m.setSelection(m.createPositionAt(b.getNodeByPath([0,0,0]),0))})}}function nu(i){const e=[];for(const t of qk(i.getRanges())){const n=t.getContainedElement();n&&n.is("element","tableCell")&&e.push(n)}return e}function ah(i){const e=[];for(const t of i.getRanges()){const n=t.start.findAncestor("tableCell");n&&e.push(n)}return e}function Bn(i){const e=nu(i);return e.length?e:ah(i)}function Ks(i){return Hk(i.map(e=>e.parent.index))}function ou(i){const e=i[0].findAncestor("table");return Hk([...new $t(e)].filter(t=>i.includes(t.cell)).map(t=>t.column))}function gv(i,e){if(i.length<2||!function(r){const a=r[0].findAncestor("table"),c=Ks(r),d=parseInt(a.getAttribute("headingRows")||0);if(!$k(c,d))return!1;const m=parseInt(a.getAttribute("headingColumns")||0);return $k(ou(r),m)}(i))return!1;const t=new Set,n=new Set;let o=0;for(const r of i){const{row:a,column:c}=e.getCellLocation(r),d=parseInt(r.getAttribute("rowspan")||1),m=parseInt(r.getAttribute("colspan")||1);t.add(a),n.add(c),d>1&&t.add(a+d-1),m>1&&n.add(c+m-1),o+=d*m}return function(r,a){const c=Array.from(r.values()),d=Array.from(a.values()),m=Math.max(...c),b=Math.min(...c),_=Math.max(...d),T=Math.min(...d);return(m-b+1)*(_-T+1)}(t,n)==o}function qk(i){return Array.from(i).sort(W1)}function Hk(i){const e=i.sort((t,n)=>t-n);return{first:e[0],last:e[e.length-1]}}function W1(i,e){const t=i.start,n=e.start;return t.isBefore(n)?-1:1}function $k({first:i,last:e},t){return i<t==e<t}class Uk extends pt{constructor(e,t={}){super(e),this.order=t.order||"below"}refresh(){const e=!!Bn(this.editor.model.document.selection).length;this.isEnabled=e}execute(){const e=this.editor,t=e.model.document.selection,n=e.plugins.get("TableUtils"),o=this.order==="above",r=Bn(t),a=Ks(r),c=o?a.first:a.last,d=r[0].findAncestor("table");n.insertRows(d,{at:o?c:c+1,copyStructureFromAbove:!o})}}class Wk extends pt{constructor(e,t={}){super(e),this.order=t.order||"right"}refresh(){const e=!!Bn(this.editor.model.document.selection).length;this.isEnabled=e}execute(){const e=this.editor,t=e.model.document.selection,n=e.plugins.get("TableUtils"),o=this.order==="left",r=Bn(t),a=ou(r),c=o?a.first:a.last,d=r[0].findAncestor("table");n.insertColumns(d,{columns:1,at:o?c:c+1})}}class Kk extends pt{constructor(e,t={}){super(e),this.direction=t.direction||"horizontally"}refresh(){const e=Bn(this.editor.model.document.selection);this.isEnabled=e.length===1}execute(){const e=Bn(this.editor.model.document.selection)[0],t=this.direction==="horizontally",n=this.editor.plugins.get("TableUtils");t?n.splitCellHorizontally(e,2):n.splitCellVertically(e,2)}}function Gk(i,e,t){const{startRow:n,startColumn:o,endRow:r,endColumn:a}=e,c=t.createElement("table"),d=r-n+1;for(let b=0;b<d;b++)t.insertElement("tableRow",c,"end");const m=[...new $t(i,{startRow:n,endRow:r,startColumn:o,endColumn:a,includeAllSlots:!0})];for(const{row:b,column:_,cell:T,isAnchor:E,cellAnchorRow:P,cellAnchorColumn:R}of m){const z=b-n,$=c.getChild(z);if(E){const J=t.cloneElement(T);t.append(J,$),Zk(J,b,_,r,a,t)}else(P<n||R<o)&&wl(t,t.createPositionAt($,"end"))}return function(b,_,T,E,P){const R=parseInt(_.getAttribute("headingRows")||0);R>0&&_n("headingRows",R-T,b,P,0);const z=parseInt(_.getAttribute("headingColumns")||0);z>0&&_n("headingColumns",z-E,b,P,0)}(c,i,n,o,t),c}function Qk(i,e,t=0){const n=[],o=new $t(i,{startRow:t,endRow:e-1});for(const r of o){const{row:a,cellHeight:c}=r,d=a+c-1;a<e&&e<=d&&n.push(r)}return n}function Yk(i,e,t){const n=i.parent,o=n.parent,r=n.index,a=e-r,c={},d=parseInt(i.getAttribute("rowspan"))-a;d>1&&(c.rowspan=d);const m=parseInt(i.getAttribute("colspan")||1);m>1&&(c.colspan=m);const b=r+a,_=[...new $t(o,{startRow:r,endRow:b,includeAllSlots:!0})];let T,E=null;for(const P of _){const{row:R,column:z,cell:$}=P;$===i&&T===void 0&&(T=z),T!==void 0&&T===z&&R===b&&(E=wl(t,P.getPositionBefore(),c))}return _n("rowspan",a,i,t),E}function Xk(i,e){const t=[],n=new $t(i);for(const o of n){const{column:r,cellWidth:a}=o,c=r+a-1;r<e&&e<=c&&t.push(o)}return t}function Jk(i,e,t,n){const o=t-e,r={},a=parseInt(i.getAttribute("colspan"))-o;a>1&&(r.colspan=a);const c=parseInt(i.getAttribute("rowspan")||1);c>1&&(r.rowspan=c);const d=wl(n,n.createPositionAfter(i),r);return _n("colspan",o,i,n),d}function Zk(i,e,t,n,o,r){const a=parseInt(i.getAttribute("colspan")||1),c=parseInt(i.getAttribute("rowspan")||1);t+a-1>o&&_n("colspan",o-t+1,i,r,1),e+c-1>n&&_n("rowspan",n-e+1,i,r,1)}function bv(i,e){const t=e.getColumns(i),n=new Array(t).fill(0);for(const{column:r}of new $t(i))n[r]++;const o=n.reduce((r,a,c)=>a?r:[...r,c],[]);if(o.length>0){const r=o[o.length-1];return e.removeColumns(i,{at:r}),!0}return!1}function vv(i,e){const t=[],n=e.getRows(i);for(let o=0;o<n;o++)i.getChild(o).isEmpty&&t.push(o);if(t.length>0){const o=t[t.length-1];return e.removeRows(i,{at:o}),!0}return!1}function wv(i,e){bv(i,e)||vv(i,e)}function e_(i,e){const t=Array.from(new $t(i,{startColumn:e.firstColumn,endColumn:e.lastColumn,row:e.lastRow}));if(t.every(({cellHeight:o})=>o===1))return e.lastRow;const n=t[0].cellHeight-1;return e.lastRow+n}function t_(i,e){const t=Array.from(new $t(i,{startRow:e.firstRow,endRow:e.lastRow,column:e.lastColumn}));if(t.every(({cellWidth:o})=>o===1))return e.lastColumn;const n=t[0].cellWidth-1;return e.lastColumn+n}class ip extends pt{constructor(e,t){super(e),this.direction=t.direction,this.isHorizontal=this.direction=="right"||this.direction=="left"}refresh(){const e=this._getMergeableCell();this.value=e,this.isEnabled=!!e}execute(){const e=this.editor.model,t=ah(e.document.selection)[0],n=this.value,o=this.direction;e.change(r=>{const a=o=="right"||o=="down",c=a?t:n,d=a?n:t,m=d.parent;(function(P,R,z){n_(P)||(n_(R)&&z.remove(z.createRangeIn(R)),z.move(z.createRangeIn(P),z.createPositionAt(R,"end"))),z.remove(P)})(d,c,r);const b=this.isHorizontal?"colspan":"rowspan",_=parseInt(t.getAttribute(b)||1),T=parseInt(n.getAttribute(b)||1);r.setAttribute(b,_+T,c),r.setSelection(r.createRangeIn(c));const E=this.editor.plugins.get("TableUtils");wv(m.findAncestor("table"),E)})}_getMergeableCell(){const e=ah(this.editor.model.document.selection)[0];if(!e)return;const t=this.editor.plugins.get("TableUtils"),n=this.isHorizontal?function(a,c,d){const m=a.parent.parent,b=c=="right"?a.nextSibling:a.previousSibling,_=(m.getAttribute("headingColumns")||0)>0;if(!b)return;const T=c=="right"?a:b,E=c=="right"?b:a,{column:P}=d.getCellLocation(T),{column:R}=d.getCellLocation(E),z=parseInt(T.getAttribute("colspan")||1),$=mv(d,T),J=mv(d,E);if(!(_&&$!=J))return P+z===R?b:void 0}(e,this.direction,t):function(a,c,d){const m=a.parent,b=m.parent,_=b.getChildIndex(m);if(c=="down"&&_===d.getRows(b)-1||c=="up"&&_===0)return;const T=parseInt(a.getAttribute("rowspan")||1),E=b.getAttribute("headingRows")||0,P=c=="down"&&_+T===E,R=c=="up"&&_===E;if(E&&(P||R))return;const z=parseInt(a.getAttribute("rowspan")||1),$=c=="down"?_+z:_,J=[...new $t(b,{endRow:$})],ue=J.find(He=>He.cell===a).column,xe=J.find(({row:He,cellHeight:Qt,column:_t})=>_t===ue&&(c=="down"?He===$:$===He+Qt));return xe&&xe.cell}(e,this.direction,t);if(!n)return;const o=this.isHorizontal?"rowspan":"colspan",r=parseInt(e.getAttribute(o)||1);return parseInt(n.getAttribute(o)||1)===r?n:void 0}}function n_(i){return i.childCount==1&&i.getChild(0).is("element","paragraph")&&i.getChild(0).isEmpty}class K1 extends pt{refresh(){const e=Bn(this.editor.model.document.selection),t=e[0];if(t){const n=t.findAncestor("table"),o=this.editor.plugins.get("TableUtils").getRows(n)-1,r=Ks(e),a=r.first===0&&r.last===o;this.isEnabled=!a}else this.isEnabled=!1}execute(){const e=this.editor.model,t=this.editor.plugins.get("TableUtils"),n=Bn(e.document.selection),o=Ks(n),r=n[0],a=r.findAncestor("table"),c=t.getCellLocation(r).column;e.change(d=>{const m=o.last-o.first+1;t.removeRows(a,{at:o.first,rows:m});const b=function(_,T,E,P){const R=_.getChild(Math.min(T,P-1));let z=R.getChild(0),$=0;for(const J of R.getChildren()){if($>E)return z;z=J,$+=parseInt(J.getAttribute("colspan")||1)}return z}(a,o.first,c,t.getRows(a));d.setSelection(d.createPositionAt(b,0))})}}class G1 extends pt{refresh(){const e=Bn(this.editor.model.document.selection),t=e[0];if(t){const n=t.findAncestor("table"),o=this.editor.plugins.get("TableUtils").getColumns(n),{first:r,last:a}=ou(e);this.isEnabled=a-r<o-1}else this.isEnabled=!1}execute(){const[e,t]=function(c){const d=Bn(c),m=d[0],b=d.pop(),_=[m,b];return m.isBefore(b)?_:_.reverse()}(this.editor.model.document.selection),n=e.parent.parent,o=[...new $t(n)],r={first:o.find(c=>c.cell===e).column,last:o.find(c=>c.cell===t).column},a=function(c,d,m,b){return parseInt(m.getAttribute("colspan")||1)>1?m:d.previousSibling||m.nextSibling?m.nextSibling||d.previousSibling:b.first?c.reverse().find(({column:_})=>_<b.first).cell:c.reverse().find(({column:_})=>_>b.last).cell}(o,e,t,r);this.editor.model.change(c=>{const d=r.last-r.first+1;this.editor.plugins.get("TableUtils").removeColumns(n,{at:r.first,columns:d}),c.setSelection(c.createPositionAt(a,0))})}}class Q1 extends pt{refresh(){const e=Bn(this.editor.model.document.selection),t=e.length>0;this.isEnabled=t,this.value=t&&e.every(n=>this._isInHeading(n,n.parent.parent))}execute(e={}){if(e.forceValue===this.value)return;const t=this.editor.model,n=Bn(t.document.selection),o=n[0].findAncestor("table"),{first:r,last:a}=Ks(n),c=this.value?r:a+1,d=o.getAttribute("headingRows")||0;t.change(m=>{if(c){const b=Qk(o,c,c>d?d:0);for(const{cell:_}of b)Yk(_,c,m)}_n("headingRows",c,o,m,0)})}_isInHeading(e,t){const n=parseInt(t.getAttribute("headingRows")||0);return!!n&&e.parent.index<n}}class Y1 extends pt{refresh(){const e=Bn(this.editor.model.document.selection),t=this.editor.plugins.get("TableUtils"),n=e.length>0;this.isEnabled=n,this.value=n&&e.every(o=>mv(t,o))}execute(e={}){if(e.forceValue===this.value)return;const t=this.editor.model,n=Bn(t.document.selection),o=n[0].findAncestor("table"),{first:r,last:a}=ou(n),c=this.value?r:a+1;t.change(d=>{if(c){const m=Xk(o,c);for(const{cell:b,column:_}of m)Jk(b,_,c,d)}_n("headingColumns",c,o,d,0)})}}class iu extends ve{static get pluginName(){return"TableUtils"}init(){this.decorate("insertColumns"),this.decorate("insertRows")}getCellLocation(e){const t=e.parent,n=t.parent,o=n.getChildIndex(t),r=new $t(n,{row:o});for(const{cell:a,row:c,column:d}of r)if(a===e)return{row:c,column:d}}createTable(e,t){const n=e.createElement("table"),o=parseInt(t.rows)||2,r=parseInt(t.columns)||2;return kv(e,n,0,o,r),t.headingRows&&_n("headingRows",Math.min(t.headingRows,o),n,e,0),t.headingColumns&&_n("headingColumns",Math.min(t.headingColumns,r),n,e,0),n}insertRows(e,t={}){const n=this.editor.model,o=t.at||0,r=t.rows||1,a=t.copyStructureFromAbove!==void 0,c=t.copyStructureFromAbove?o-1:o,d=this.getRows(e),m=this.getColumns(e);if(o>d)throw new C.a("tableutils-insertrows-insert-out-of-range",this,{options:t});n.change(b=>{const _=e.getAttribute("headingRows")||0;if(_>o&&_n("headingRows",_+r,e,b,0),!a&&(o===0||o===d))return void kv(b,e,o,r,m);const T=a?Math.max(o,c):o,E=new $t(e,{endRow:T}),P=new Array(m).fill(1);for(const{row:R,column:z,cellHeight:$,cellWidth:J,cell:ue}of E){const xe=R+$-1,He=R<=c&&c<=xe;R<o&&o<=xe?(b.setAttribute("rowspan",$+r,ue),P[z]=-J):a&&He&&(P[z]=J)}for(let R=0;R<r;R++){const z=b.createElement("tableRow");b.insert(z,e,o);for(let $=0;$<P.length;$++){const J=P[$],ue=b.createPositionAt(z,"end");J>0&&wl(b,ue,J>1?{colspan:J}:null),$+=Math.abs(J)-1}}})}insertColumns(e,t={}){const n=this.editor.model,o=t.at||0,r=t.columns||1;n.change(a=>{const c=e.getAttribute("headingColumns");o<c&&a.setAttribute("headingColumns",c+r,e);const d=this.getColumns(e);if(o===0||d===o){for(const b of e.getChildren())b.is("element","tableRow")&&ru(r,a,a.createPositionAt(b,o?"end":0));return}const m=new $t(e,{column:o,includeAllSlots:!0});for(const b of m){const{row:_,cell:T,cellAnchorColumn:E,cellAnchorRow:P,cellWidth:R,cellHeight:z}=b;if(E<o){a.setAttribute("colspan",R+r,T);const $=P+z-1;for(let J=_;J<=$;J++)m.skipRow(J)}else ru(r,a,b.getPositionBefore())}})}removeRows(e,t){const n=this.editor.model,o=t.rows||1,r=this.getRows(e),a=t.at,c=a+o-1;if(c>r-1)throw new C.a("tableutils-removerows-row-index-out-of-range",this,{table:e,options:t});n.change(d=>{const{cellsToMove:m,cellsToTrim:b}=function(_,T,E){const P=new Map,R=[];for(const{row:z,column:$,cellHeight:J,cell:ue}of new $t(_,{endRow:E})){const xe=z+J-1;if(z>=T&&z<=E&&xe>E){const He=J-(E-z+1);P.set($,{cell:ue,rowspan:He})}if(z<T&&xe>=T){let He;He=xe>=E?E-T+1:xe-T+1,R.push({cell:ue,rowspan:J-He})}}return{cellsToMove:P,cellsToTrim:R}}(e,a,c);m.size&&function(_,T,E,P){const R=[...new $t(_,{includeAllSlots:!0,row:T})],z=_.getChild(T);let $;for(const{column:J,cell:ue,isAnchor:xe}of R)if(E.has(J)){const{cell:He,rowspan:Qt}=E.get(J),_t=$?P.createPositionAfter($):P.createPositionAt(z,0);P.move(P.createRangeOn(He),_t),_n("rowspan",Qt,He,P),$=He}else xe&&($=ue)}(e,c+1,m,d);for(let _=c;_>=a;_--)d.remove(e.getChild(_));for(const{rowspan:_,cell:T}of b)_n("rowspan",_,T,d);(function(_,T,E,P){const R=_.getAttribute("headingRows")||0;T<R&&_n("headingRows",E<R?R-(E-T+1):T,_,P,0)})(e,a,c,d),bv(e,this)||vv(e,this)})}removeColumns(e,t){const n=this.editor.model,o=t.at,r=t.columns||1,a=t.at+r-1;n.change(c=>{(function(d,m,b){const _=d.getAttribute("headingColumns")||0;if(_&&m.first<_){const T=Math.min(_-1,m.last)-m.first+1;b.setAttribute("headingColumns",_-T,d)}})(e,{first:o,last:a},c);for(let d=a;d>=o;d--)for(const{cell:m,column:b,cellWidth:_}of[...new $t(e)])b<=d&&_>1&&b+_>d?_n("colspan",_-1,m,c):b===d&&c.remove(m);vv(e,this)||bv(e,this)})}splitCellVertically(e,t=2){const n=this.editor.model,o=e.parent.parent,r=parseInt(e.getAttribute("rowspan")||1),a=parseInt(e.getAttribute("colspan")||1);n.change(c=>{if(a>1){const{newCellsSpan:d,updatedSpan:m}=o_(a,t);_n("colspan",m,e,c);const b={};d>1&&(b.colspan=d),r>1&&(b.rowspan=r),ru(a>t?t-1:a-1,c,c.createPositionAfter(e),b)}if(a<t){const d=t-a,m=[...new $t(o)],{column:b}=m.find(({cell:P})=>P===e),_=m.filter(({cell:P,cellWidth:R,column:z})=>P!==e&&z===b||z<b&&z+R>b);for(const{cell:P,cellWidth:R}of _)c.setAttribute("colspan",R+d,P);const T={};r>1&&(T.rowspan=r),ru(d,c,c.createPositionAfter(e),T);const E=o.getAttribute("headingColumns")||0;E>b&&_n("headingColumns",E+d,o,c)}})}splitCellHorizontally(e,t=2){const n=this.editor.model,o=e.parent,r=o.parent,a=r.getChildIndex(o),c=parseInt(e.getAttribute("rowspan")||1),d=parseInt(e.getAttribute("colspan")||1);n.change(m=>{if(c>1){const b=[...new $t(r,{startRow:a,endRow:a+c-1,includeAllSlots:!0})],{newCellsSpan:_,updatedSpan:T}=o_(c,t);_n("rowspan",T,e,m);const{column:E}=b.find(({cell:R})=>R===e),P={};_>1&&(P.rowspan=_),d>1&&(P.colspan=d);for(const R of b){const{column:z,row:$}=R,J=z===E,ue=($+a+T)%_==0;$>=a+T&&J&&ue&&ru(1,m,R.getPositionBefore(),P)}}if(c<t){const b=t-c,_=[...new $t(r,{startRow:0,endRow:a})];for(const{cell:P,cellHeight:R,row:z}of _)if(P!==e&&z+R>a){const $=R+b;m.setAttribute("rowspan",$,P)}const T={};d>1&&(T.colspan=d),kv(m,r,a+1,b,1,T);const E=r.getAttribute("headingRows")||0;E>a&&_n("headingRows",E+b,r,m)}})}getColumns(e){return[...e.getChild(0).getChildren()].reduce((t,n)=>t+parseInt(n.getAttribute("colspan")||1),0)}getRows(e){return Array.from(e.getChildren()).reduce((t,n)=>n.is("element","tableRow")?t+1:t,0)}}function kv(i,e,t,n,o,r={}){for(let a=0;a<n;a++){const c=i.createElement("tableRow");i.insert(c,e,t),ru(o,i,i.createPositionAt(c,"end"),r)}}function ru(i,e,t,n={}){for(let o=0;o<i;o++)wl(e,t,n)}function o_(i,e){if(i<e)return{newCellsSpan:1,updatedSpan:1};const t=Math.floor(i/e);return{newCellsSpan:t,updatedSpan:i-t*e+t}}class X1 extends pt{refresh(){const e=nu(this.editor.model.document.selection);this.isEnabled=gv(e,this.editor.plugins.get(iu))}execute(){const e=this.editor.model,t=this.editor.plugins.get(iu);e.change(n=>{const o=nu(e.document.selection),r=o.shift(),{mergeWidth:a,mergeHeight:c}=function(d,m,b){let _=0,T=0;for(const R of m){const{row:z,column:$}=b.getCellLocation(R);_=r_(R,$,_,"colspan"),T=r_(R,z,T,"rowspan")}const{row:E,column:P}=b.getCellLocation(d);return{mergeWidth:_-P,mergeHeight:T-E}}(r,o,t);_n("colspan",a,r,n),_n("rowspan",c,r,n);for(const d of o)J1(d,r,n);wv(r.findAncestor("table"),t),n.setSelection(r,"in")})}}function J1(i,e,t){i_(i)||(i_(e)&&t.remove(t.createRangeIn(e)),t.move(t.createRangeIn(i),t.createPositionAt(e,"end"))),t.remove(i)}function i_(i){return i.childCount==1&&i.getChild(0).is("element","paragraph")&&i.getChild(0).isEmpty}function r_(i,e,t,n){const o=parseInt(i.getAttribute(n)||1);return Math.max(t,e+o)}class Z1 extends pt{refresh(){const e=Bn(this.editor.model.document.selection);this.isEnabled=e.length>0}execute(){const e=this.editor.model,t=Bn(e.document.selection),n=Ks(t),o=t[0].findAncestor("table"),r=[];for(let a=n.first;a<=n.last;a++)for(const c of o.getChild(a).getChildren())r.push(e.createRangeOn(c));e.change(a=>{a.setSelection(r)})}}class ex extends pt{refresh(){const e=Bn(this.editor.model.document.selection);this.isEnabled=e.length>0}execute(){const e=this.editor.model,t=Bn(e.document.selection),n=t[0],o=t.pop(),r=n.findAncestor("table"),a=this.editor.plugins.get("TableUtils"),c=a.getCellLocation(n),d=a.getCellLocation(o),m=Math.min(c.column,d.column),b=Math.max(c.column,d.column),_=[];for(const T of new $t(r,{startColumn:m,endColumn:b}))_.push(e.createRangeOn(T.cell));e.change(T=>{T.setSelection(_)})}}function tx(i){i.document.registerPostFixer(e=>function(t,n){const o=n.document.differ.getChanges();let r=!1;const a=new Set;for(const c of o){let d;c.name=="table"&&c.type=="insert"&&(d=c.position.nodeAfter),c.name!="tableRow"&&c.name!="tableCell"||(d=c.position.findAncestor("table")),ix(c)&&(d=c.range.start.findAncestor("table")),d&&!a.has(d)&&(r=nx(d,t)||r,r=ox(d,t)||r,a.add(d))}return r}(e,i))}function nx(i,e){let t=!1;const n=function(o){const r=parseInt(o.getAttribute("headingRows")||0),a=Array.from(o.getChildren()).reduce((d,m)=>m.is("element","tableRow")?d+1:d,0),c=[];for(const{row:d,cell:m,cellHeight:b}of new $t(o)){if(b<2)continue;const _=d<r?r:a;if(d+b>_){const T=_-d;c.push({cell:m,rowspan:T})}}return c}(i);if(n.length){t=!0;for(const o of n)_n("rowspan",o.rowspan,o.cell,e,1)}return t}function ox(i,e){let t=!1;const n=function(c){const d=new Array(c.childCount).fill(0);for(const{rowIndex:m}of new $t(c,{includeAllSlots:!0}))d[m]++;return d}(i),o=[];for(const[c,d]of n.entries())!d&&i.getChild(c).is("element","tableRow")&&o.push(c);if(o.length){t=!0;for(const c of o.reverse())e.remove(i.getChild(c)),n.splice(c,1)}const r=n.filter((c,d)=>i.getChild(d).is("element","tableRow")),a=r[0];if(!r.every(c=>c===a)){const c=r.reduce((d,m)=>m>d?m:d,0);for(const[d,m]of r.entries()){const b=c-m;if(b){for(let _=0;_<b;_++)wl(e,e.createPositionAt(i.getChild(d),"end"));t=!0}}}return t}function ix(i){const e=i.type==="attribute",t=i.attributeKey;return e&&(t==="headingRows"||t==="colspan"||t==="rowspan")}function rx(i){i.document.registerPostFixer(e=>function(t,n){const o=n.document.differ.getChanges();let r=!1;for(const a of o)a.type=="insert"&&a.name=="table"&&(r=sx(a.position.nodeAfter,t)||r),a.type=="insert"&&a.name=="tableRow"&&(r=s_(a.position.nodeAfter,t)||r),a.type=="insert"&&a.name=="tableCell"&&(r=_v(a.position.nodeAfter,t)||r),ax(a)&&(r=_v(a.position.parent,t)||r);return r}(e,i))}function sx(i,e){let t=!1;for(const n of i.getChildren())n.is("element","tableRow")&&(t=s_(n,e)||t);return t}function s_(i,e){let t=!1;for(const n of i.getChildren())t=_v(n,e)||t;return t}function _v(i,e){if(i.childCount==0)return e.insertElement("paragraph",i),!0;const t=Array.from(i.getChildren()).filter(n=>n.is("$text"));for(const n of t)e.wrap(e.createRangeOn(n),"paragraph");return!!t.length}function ax(i){return!(!i.position||!i.position.parent.is("element","tableCell"))&&(i.type=="insert"&&i.name=="$text"||i.type=="remove")}function lx(i,e){i.document.registerPostFixer(()=>function(t,n){const o=new Set;for(const r of t.getChanges()){const a=r.type=="attribute"?r.range.start.parent:r.position.parent;a.is("element","tableCell")&&o.add(a)}for(const r of o.values())for(const a of[...r.getChildren()].filter(c=>cx(c,n)))t.refreshItem(a);return!1}(i.document.differ,e))}function cx(i,e){if(!i.is("element","paragraph"))return!1;const t=e.toViewElement(i);return!!t&&Vk(i)!==t.is("element","span")}function ux(i){i.document.registerPostFixer(()=>function(e){const t=e.document.differ,n=new Set;for(const o of t.getChanges()){if(o.type!="attribute")continue;const r=o.range.start.nodeAfter;r&&r.is("element","table")&&o.attributeKey=="headingRows"&&n.add(r)}if(n.size){for(const o of n.values())t.refreshItem(o);return!0}return!1}(i))}w(100);class dx extends ve{static get pluginName(){return"TableEditing"}init(){const e=this.editor,t=e.model,n=t.schema,o=e.conversion;n.register("table",{allowWhere:"$block",allowAttributes:["headingRows","headingColumns"],isObject:!0,isBlock:!0}),n.register("tableRow",{allowIn:"table",isLimit:!0}),n.register("tableCell",{allowIn:"tableRow",allowChildren:"$block",allowAttributes:["colspan","rowspan"],isLimit:!0,isSelectable:!0}),o.for("upcast").add(r=>{r.on("element:figure",(a,c,d)=>{if(!d.consumable.test(c.viewItem,{name:!0,classes:"table"}))return;const m=function(_){for(const T of _.getChildren())if(T.is("element","table"))return T}(c.viewItem);if(!m||!d.consumable.test(m,{name:!0}))return;const b=so(d.convertItem(m,c.modelCursor).modelRange.getItems());b&&(d.convertChildren(c.viewItem,d.writer.createPositionAt(b,"end")),d.updateConversionResult(b,c))})}),o.for("upcast").add(B1()),o.for("editingDowncast").add(Rk({asWidget:!0})),o.for("dataDowncast").add(Rk()),o.for("upcast").elementToElement({model:"tableRow",view:"tr"}),o.for("upcast").add(r=>{r.on("element:tr",(a,c)=>{c.viewItem.isEmpty&&c.modelCursor.index==0&&a.stop()},{priority:"high"})}),o.for("editingDowncast").add(r=>r.on("insert:tableRow",(a,c,d)=>{const m=c.item;if(!d.consumable.consume(m,"insert"))return;const b=m.parent,_=function(z){for(const $ of z.getChildren())if($.name==="table")return $}(d.mapper.toViewElement(b)),T=b.getChildIndex(m),E=new $t(b,{row:T}),P={headingRows:b.getAttribute("headingRows")||0,headingColumns:b.getAttribute("headingColumns")||0},R=new Map;for(const z of E){const $=R.get(T)||pv(_,m,T,P,d);R.set(T,$),d.consumable.consume(z.cell,"insert"),fv(z,P,d.writer.createPositionAt($,"end"),d,{asWidget:!0})}})),o.for("editingDowncast").add(r=>r.on("remove:tableRow",(a,c,d)=>{a.stop();const m=d.writer,b=d.mapper,_=b.toViewPosition(c.position).getLastMatchingPosition(R=>!R.item.is("element","tr")).nodeAfter,T=_.parent.parent,E=m.createRangeOn(_),P=m.remove(E);for(const R of m.createRangeIn(P).getItems())b.unbindViewElement(R);Bk("thead",T,d),Bk("tbody",T,d)},{priority:"higher"})),o.for("upcast").elementToElement({model:"tableCell",view:"td"}),o.for("upcast").elementToElement({model:"tableCell",view:"th"}),o.for("upcast").add(Ok("td")),o.for("upcast").add(Ok("th")),o.for("editingDowncast").add(r=>r.on("insert:tableCell",(a,c,d)=>{const m=c.item;if(!d.consumable.consume(m,"insert"))return;const b=m.parent,_=b.parent,T=_.getChildIndex(b),E=new $t(_,{row:T}),P={headingRows:_.getAttribute("headingRows")||0,headingColumns:_.getAttribute("headingColumns")||0};for(const R of E)if(R.cell===m){const z=d.mapper.toViewElement(b);return void fv(R,P,d.writer.createPositionAt(z,b.getChildIndex(m)),d,{asWidget:!0})}})),o.for("editingDowncast").elementToElement({model:"paragraph",view:H1,converterPriority:"high"}),o.for("downcast").attributeToAttribute({model:"colspan",view:"colspan"}),o.for("upcast").attributeToAttribute({model:{key:"colspan",value:a_("colspan")},view:"colspan"}),o.for("downcast").attributeToAttribute({model:"rowspan",view:"rowspan"}),o.for("upcast").attributeToAttribute({model:{key:"rowspan",value:a_("rowspan")},view:"rowspan"}),o.for("editingDowncast").add(r=>r.on("attribute:headingColumns:table",(a,c,d)=>{const m=c.item;if(!d.consumable.consume(c.item,a.name))return;const b={headingRows:m.getAttribute("headingRows")||0,headingColumns:m.getAttribute("headingColumns")||0},_=c.attributeOldValue,T=c.attributeNewValue,E=(_>T?_:T)-1;for(const P of new $t(m,{endColumn:E}))$1(P,b,d)})),e.data.mapper.on("modelToViewPosition",(r,a)=>{const c=a.modelPosition.parent,d=a.modelPosition.nodeBefore;if(!c.is("element","tableCell")||!d||!d.is("element","paragraph"))return;const m=a.mapper.toViewElement(d),b=a.mapper.toViewElement(c);m===b&&(a.viewPosition=a.mapper.findPositionIn(b,d.maxOffset))}),e.config.define("table.defaultHeadings.rows",0),e.config.define("table.defaultHeadings.columns",0),e.commands.add("insertTable",new U1(e)),e.commands.add("insertTableRowAbove",new Uk(e,{order:"above"})),e.commands.add("insertTableRowBelow",new Uk(e,{order:"below"})),e.commands.add("insertTableColumnLeft",new Wk(e,{order:"left"})),e.commands.add("insertTableColumnRight",new Wk(e,{order:"right"})),e.commands.add("removeTableRow",new K1(e)),e.commands.add("removeTableColumn",new G1(e)),e.commands.add("splitTableCellVertically",new Kk(e,{direction:"vertically"})),e.commands.add("splitTableCellHorizontally",new Kk(e,{direction:"horizontally"})),e.commands.add("mergeTableCells",new X1(e)),e.commands.add("mergeTableCellRight",new ip(e,{direction:"right"})),e.commands.add("mergeTableCellLeft",new ip(e,{direction:"left"})),e.commands.add("mergeTableCellDown",new ip(e,{direction:"down"})),e.commands.add("mergeTableCellUp",new ip(e,{direction:"up"})),e.commands.add("setTableColumnHeader",new Y1(e)),e.commands.add("setTableRowHeader",new Q1(e)),e.commands.add("selectTableRow",new Z1(e)),e.commands.add("selectTableColumn",new ex(e)),ux(t),tx(t),lx(t,e.editing.mapper),rx(t)}static get requires(){return[iu]}}function a_(i){return e=>{const t=parseInt(e.getAttribute(i));return Number.isNaN(t)||t<=0?null:t}}w(102);class hx extends gt{constructor(e){super(e);const t=this.bindTemplate;this.items=this._createGridCollection(),this.set("rows",0),this.set("columns",0),this.bind("label").to(this,"columns",this,"rows",(n,o)=>`${o} × ${n}`),this.setTemplate({tag:"div",attributes:{class:["ck"]},children:[{tag:"div",attributes:{class:["ck-insert-table-dropdown__grid"]},on:{"mouseover@.ck-insert-table-dropdown-grid-box":t.to("boxover")},children:this.items},{tag:"div",attributes:{class:["ck-insert-table-dropdown__label"]},children:[{text:t.to("label")}]}],on:{mousedown:t.to(n=>{n.preventDefault()}),click:t.to(()=>{this.fire("execute")})}}),this.on("boxover",(n,o)=>{const{row:r,column:a}=o.target.dataset;this.set({rows:parseInt(r),columns:parseInt(a)})}),this.on("change:columns",()=>{this._highlightGridBoxes()}),this.on("change:rows",()=>{this._highlightGridBoxes()})}focus(){}focusLast(){}_highlightGridBoxes(){const e=this.rows,t=this.columns;this.items.map((n,o)=>{const r=Math.floor(o/10)<e&&o%10<t;n.set("isOn",r)})}_createGridCollection(){const e=[];for(let t=0;t<100;t++){const n=Math.floor(t/10),o=t%10;e.push(new mx(this.locale,n+1,o+1))}return this.createCollection(e)}}class mx extends gt{constructor(e,t,n){super(e);const o=this.bindTemplate;this.set("isOn",!1),this.setTemplate({tag:"div",attributes:{class:["ck-insert-table-dropdown-grid-box",o.if("isOn","ck-on")],"data-row":t,"data-column":n}})}}class fx extends ve{static get pluginName(){return"TableUI"}init(){const e=this.editor,t=this.editor.t,n=e.locale.contentLanguageDirection==="ltr";e.ui.componentFactory.add("insertTable",o=>{const r=e.commands.get("insertTable"),a=rs(o);let c;return a.bind("isEnabled").to(r),a.buttonView.set({icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M3 6v3h4V6H3zm0 4v3h4v-3H3zm0 4v3h4v-3H3zm5 3h4v-3H8v3zm5 0h4v-3h-4v3zm4-4v-3h-4v3h4zm0-4V6h-4v3h4zm1.5 8a1.5 1.5 0 0 1-1.5 1.5H3A1.5 1.5 0 0 1 1.5 17V4c.222-.863 1.068-1.5 2-1.5h13c.932 0 1.778.637 2 1.5v13zM12 13v-3H8v3h4zm0-4V6H8v3h4z"/></svg>',label:t("Insert table"),tooltip:!0}),a.on("change:isOpen",()=>{c||(c=new hx(o),a.panelView.children.add(c),c.delegate("execute").to(a),a.buttonView.on("open",()=>{c.rows=0,c.columns=0}),a.on("execute",()=>{e.execute("insertTable",{rows:c.rows,columns:c.columns}),e.editing.view.focus()}))}),a}),e.ui.componentFactory.add("tableColumn",o=>{const r=[{type:"switchbutton",model:{commandName:"setTableColumnHeader",label:t("Header column"),bindIsOn:!0}},{type:"separator"},{type:"button",model:{commandName:n?"insertTableColumnLeft":"insertTableColumnRight",label:t("Insert column left")}},{type:"button",model:{commandName:n?"insertTableColumnRight":"insertTableColumnLeft",label:t("Insert column right")}},{type:"button",model:{commandName:"removeTableColumn",label:t("Delete column")}},{type:"button",model:{commandName:"selectTableColumn",label:t("Select column")}}];return this._prepareDropdown(t("Column"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z" opacity=".6"/><path d="M18 7v1H2V7h16zm0 5v1H2v-1h16z" opacity=".6"/><path d="M14 1v18a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V1a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1zm-2 1H8v4h4V2zm0 6H8v4h4V8zm0 6H8v4h4v-4z"/></svg>',r,o)}),e.ui.componentFactory.add("tableRow",o=>{const r=[{type:"switchbutton",model:{commandName:"setTableRowHeader",label:t("Header row"),bindIsOn:!0}},{type:"separator"},{type:"button",model:{commandName:"insertTableRowAbove",label:t("Insert row above")}},{type:"button",model:{commandName:"insertTableRowBelow",label:t("Insert row below")}},{type:"button",model:{commandName:"removeTableRow",label:t("Delete row")}},{type:"button",model:{commandName:"selectTableRow",label:t("Select row")}}];return this._prepareDropdown(t("Row"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z" opacity=".6"/><path d="M7 2h1v16H7V2zm5 0h1v16h-1V2z" opacity=".6"/><path d="M1 6h18a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm1 2v4h4V8H2zm6 0v4h4V8H8zm6 0v4h4V8h-4z"/></svg>',r,o)}),e.ui.componentFactory.add("mergeTableCells",o=>{const r=[{type:"button",model:{commandName:"mergeTableCellUp",label:t("Merge cell up")}},{type:"button",model:{commandName:n?"mergeTableCellRight":"mergeTableCellLeft",label:t("Merge cell right")}},{type:"button",model:{commandName:"mergeTableCellDown",label:t("Merge cell down")}},{type:"button",model:{commandName:n?"mergeTableCellLeft":"mergeTableCellRight",label:t("Merge cell left")}},{type:"separator"},{type:"button",model:{commandName:"splitTableCellVertically",label:t("Split cell vertically")}},{type:"button",model:{commandName:"splitTableCellHorizontally",label:t("Split cell horizontally")}}];return this._prepareMergeSplitButtonDropdown(t("Merge cells"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z" opacity=".6"/><path d="M7 2h1v16H7V2zm5 0h1v7h-1V2zm6 5v1H2V7h16zM8 12v1H2v-1h6z" opacity=".6"/><path d="M7 7h12a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1zm1 2v9h10V9H8z"/></svg>',r,o)})}_prepareDropdown(e,t,n,o){const r=this.editor,a=rs(o),c=this._fillDropdownWithListOptions(a,n);return a.buttonView.set({label:e,icon:t,tooltip:!0}),a.bind("isEnabled").toMany(c,"isEnabled",(...d)=>d.some(m=>m)),this.listenTo(a,"execute",d=>{r.execute(d.source.commandName),r.editing.view.focus()}),a}_prepareMergeSplitButtonDropdown(e,t,n,o){const r=this.editor,a=rs(o,Um),c=r.commands.get("mergeTableCells"),d=this._fillDropdownWithListOptions(a,n);return a.buttonView.set({label:e,icon:t,tooltip:!0,isEnabled:!0}),a.bind("isEnabled").toMany([c,...d],"isEnabled",(...m)=>m.some(b=>b)),this.listenTo(a.buttonView,"execute",()=>{r.execute("mergeTableCells"),r.editing.view.focus()}),this.listenTo(a,"execute",m=>{r.execute(m.source.commandName),r.editing.view.focus()}),a}_fillDropdownWithListOptions(e,t){const n=this.editor,o=[],r=new io;for(const a of t)px(a,n,o,r);return ef(e,r,n.ui.componentFactory),o}}function px(i,e,t,n){const o=i.model=new Vd(i.model),{commandName:r,bindIsOn:a}=i.model;if(i.type==="button"||i.type==="switchbutton"){const c=e.commands.get(r);t.push(c),o.set({commandName:r}),o.bind("isEnabled").to(c),a&&o.bind("isOn").to(c,"value")}o.set({withText:!0}),n.add(i)}w(104);class kl extends ve{static get pluginName(){return"TableSelection"}static get requires(){return[iu]}init(){const e=this.editor.model;this.listenTo(e,"deleteContent",(t,n)=>this._handleDeleteContent(t,n),{priority:"high"}),this._defineSelectionConverter(),this._enablePluginDisabling()}getSelectedTableCells(){const e=nu(this.editor.model.document.selection);return e.length==0?null:e}getSelectionAsFragment(){const e=this.getSelectedTableCells();return e?this.editor.model.change(t=>{const n=t.createDocumentFragment(),o=this.editor.plugins.get("TableUtils"),{first:r,last:a}=ou(e),{first:c,last:d}=Ks(e),m=e[0].findAncestor("table");let b=d,_=a;if(gv(e,o)){const E={firstColumn:r,lastColumn:a,firstRow:c,lastRow:d};b=e_(m,E),_=t_(m,E)}const T=Gk(m,{startRow:c,startColumn:r,endRow:b,endColumn:_},t);return t.insert(T,n,0),n}):null}setCellSelection(e,t){const n=this._getCellsToSelect(e,t);this.editor.model.change(o=>{o.setSelection(n.cells.map(r=>o.createRangeOn(r)),{backward:n.backward})})}getFocusCell(){const e=[...this.editor.model.document.selection.getRanges()].pop().getContainedElement();return e&&e.is("element","tableCell")?e:null}getAnchorCell(){const e=so(this.editor.model.document.selection.getRanges()).getContainedElement();return e&&e.is("element","tableCell")?e:null}_defineSelectionConverter(){const e=this.editor,t=new Set;e.conversion.for("editingDowncast").add(n=>n.on("selection",(o,r,a)=>{const c=a.writer;(function(b){for(const _ of t)b.removeClass("ck-editor__editable_selected",_);t.clear()})(c);const d=this.getSelectedTableCells();if(!d)return;for(const b of d){const _=a.mapper.toViewElement(b);c.addClass("ck-editor__editable_selected",_),t.add(_)}const m=a.mapper.toViewElement(d[d.length-1]);c.setSelection(m,0)},{priority:"lowest"}))}_enablePluginDisabling(){const e=this.editor;this.on("change:isEnabled",()=>{if(!this.isEnabled){const t=this.getSelectedTableCells();if(!t)return;e.model.change(n=>{const o=n.createPositionAt(t[0],0),r=e.model.schema.getNearestSelectionRange(o);n.setSelection(r)})}})}_handleDeleteContent(e,t){const[n,o]=t,r=this.editor.model,a=!o||o.direction=="backward",c=nu(n);c.length&&(e.stop(),r.change(d=>{const m=c[a?c.length-1:0];r.change(_=>{for(const T of c)r.deleteContent(_.createSelection(T,"in"))});const b=r.schema.getNearestSelectionRange(d.createPositionAt(m,0));n.is("documentSelection")?d.setSelection(b):n.setTo(b)}))}_getCellsToSelect(e,t){const n=this.editor.plugins.get("TableUtils"),o=n.getCellLocation(e),r=n.getCellLocation(t),a=Math.min(o.row,r.row),c=Math.max(o.row,r.row),d=Math.min(o.column,r.column),m=Math.max(o.column,r.column),b=new Array(c-a+1).fill(null).map(()=>[]),_={startRow:a,endRow:c,startColumn:d,endColumn:m};for(const{row:P,cell:R}of new $t(e.findAncestor("table"),_))b[P-a].push(R);const T=r.row<o.row,E=r.column<o.column;return T&&b.reverse(),E&&b.forEach(P=>P.reverse()),{cells:b.flat(),backward:T||E}}}class gx extends ve{static get pluginName(){return"TableClipboard"}static get requires(){return[kl,iu]}init(){const e=this.editor,t=e.editing.view.document;this.listenTo(t,"copy",(n,o)=>this._onCopyCut(n,o)),this.listenTo(t,"cut",(n,o)=>this._onCopyCut(n,o)),this.listenTo(e.model,"insertContent",(n,o)=>this._onInsertContent(n,...o),{priority:"high"}),this.decorate("_replaceTableSlotCell")}_onCopyCut(e,t){const n=this.editor.plugins.get(kl);if(!n.getSelectedTableCells()||e.name=="cut"&&this.editor.isReadOnly)return;t.preventDefault(),e.stop();const o=this.editor.data,r=this.editor.editing.view.document,a=o.toView(n.getSelectionAsFragment());r.fire("clipboardOutput",{dataTransfer:t.dataTransfer,content:a,method:e.name})}_onInsertContent(e,t,n){if(n&&!n.is("documentSelection"))return;const o=this.editor.model,r=this.editor.plugins.get(iu);let a=function(d,m){if(!d.is("documentFragment")&&!d.is("element"))return null;if(d.is("element","table"))return d;if(d.childCount==1&&d.getChild(0).is("element","table"))return d.getChild(0);const b=m.createRangeIn(d);for(const _ of b.getItems())if(_.is("element","table")){const T=m.createRange(b.start,m.createPositionBefore(_));if(m.hasContent(T,{ignoreWhitespaces:!0}))return null;const E=m.createRange(m.createPositionAfter(_),b.end);return m.hasContent(E,{ignoreWhitespaces:!0})?null:_}return null}(t,o);if(!a)return;const c=Bn(o.document.selection);c.length?(e.stop(),o.change(d=>{const m={width:r.getColumns(a),height:r.getRows(a)},b=function(z,$,J,ue){const xe=z[0].findAncestor("table"),He=ou(z),Qt=Ks(z),_t={firstColumn:He.first,lastColumn:He.last,firstRow:Qt.first,lastRow:Qt.last},Un=z.length===1;return Un&&(_t.lastRow+=$.height-1,_t.lastColumn+=$.width-1,function(no,Wn,Fo,ho){const jo=ho.getColumns(no),us=ho.getRows(no);Fo>jo&&ho.insertColumns(no,{at:jo,columns:Fo-jo}),Wn>us&&ho.insertRows(no,{at:us,rows:Wn-us})}(xe,_t.lastRow+1,_t.lastColumn+1,ue)),Un||!gv(z,ue)?function(no,Wn,Fo){const{firstRow:ho,lastRow:jo,firstColumn:us,lastColumn:lh}=Wn,ch={first:ho,last:jo},h_={first:us,last:lh};xv(no,us,ch,Fo),xv(no,lh+1,ch,Fo),yv(no,ho,h_,Fo),yv(no,jo+1,h_,Fo,ho)}(xe,_t,J):(_t.lastRow=e_(xe,_t),_t.lastColumn=t_(xe,_t)),_t}(c,m,d,r),_=b.lastRow-b.firstRow+1,T=b.lastColumn-b.firstColumn+1,E={startRow:0,startColumn:0,endRow:Math.min(_,m.height)-1,endColumn:Math.min(T,m.width)-1};a=Gk(a,E,d);const P=c[0].findAncestor("table"),R=this._replaceSelectedCellsWithPasted(a,m,P,b,d);if(this.editor.plugins.get("TableSelection").isEnabled){const z=qk(R.map($=>d.createRangeOn($)));d.setSelection(z)}else d.setSelection(R[0],0)})):wv(a,r)}_replaceSelectedCellsWithPasted(e,t,n,o,r){const{width:a,height:c}=t,d=function(z,$,J){const ue=new Array(J).fill(null).map(()=>new Array($).fill(null));for(const{column:xe,row:He,cell:Qt}of new $t(z))ue[He][xe]=Qt;return ue}(e,a,c),m=[...new $t(n,{startRow:o.firstRow,endRow:o.lastRow,startColumn:o.firstColumn,endColumn:o.lastColumn,includeAllSlots:!0})],b=[];let _;for(const z of m){const{row:$,column:J}=z;J===o.firstColumn&&(_=z.getPositionBefore());const ue=$-o.firstRow,xe=J-o.firstColumn,He=d[ue%c][xe%a],Qt=He?r.cloneElement(He):null,_t=this._replaceTableSlotCell(z,Qt,_,r);_t&&(Zk(_t,$,J,o.lastRow,o.lastColumn,r),b.push(_t),_=r.createPositionAfter(_t))}const T=parseInt(n.getAttribute("headingRows")||0),E=parseInt(n.getAttribute("headingColumns")||0),P=o.firstRow<T&&T<=o.lastRow,R=o.firstColumn<E&&E<=o.lastColumn;if(P){const z=yv(n,T,{first:o.firstColumn,last:o.lastColumn},r,o.firstRow);b.push(...z)}if(R){const z=xv(n,E,{first:o.firstRow,last:o.lastRow},r);b.push(...z)}return b}_replaceTableSlotCell(e,t,n,o){const{cell:r,isAnchor:a}=e;return a&&o.remove(r),t?(o.insert(t,n),t):null}}function yv(i,e,t,n,o=0){if(!(e<1))return Qk(i,e,o).filter(({column:r,cellWidth:a})=>l_(r,a,t)).map(({cell:r})=>Yk(r,e,n))}function xv(i,e,t,n){if(!(e<1))return Xk(i,e).filter(({row:o,cellHeight:r})=>l_(o,r,t)).map(({cell:o,column:r})=>Jk(o,r,e,n))}function l_(i,e,t){const n=i+e-1,{first:o,last:r}=t;return i>=o&&i<=r||i<o&&n>=o}class bx extends ve{static get pluginName(){return"TableKeyboard"}static get requires(){return[kl]}init(){const e=this.editor.editing.view.document;this.editor.keystrokes.set("Tab",(...t)=>this._handleTabOnSelectedTable(...t),{priority:"low"}),this.editor.keystrokes.set("Tab",this._getTabHandler(!0),{priority:"low"}),this.editor.keystrokes.set("Shift+Tab",this._getTabHandler(!1),{priority:"low"}),this.listenTo(e,"arrowKey",(...t)=>this._onArrowKey(...t),{context:"table"})}_handleTabOnSelectedTable(e,t){const n=this.editor,o=n.model.document.selection.getSelectedElement();o&&o.is("element","table")&&(t(),n.model.change(r=>{r.setSelection(r.createRangeIn(o.getChild(0).getChild(0)))}))}_getTabHandler(e){const t=this.editor;return(n,o)=>{let r=ah(t.model.document.selection)[0];if(r||(r=this.editor.plugins.get("TableSelection").getFocusCell()),!r)return;o();const a=r.parent,c=a.parent,d=c.getChildIndex(a),m=a.getChildIndex(r),b=m===0;if(!e&&b&&d===0)return void t.model.change(R=>{R.setSelection(R.createRangeOn(c))});const _=this.editor.plugins.get("TableUtils"),T=m===a.childCount-1,E=d===_.getRows(c)-1;if(e&&E&&T&&(t.execute("insertTableRowBelow"),d===_.getRows(c)-1))return void t.model.change(R=>{R.setSelection(R.createRangeOn(c))});let P;if(e&&T)P=c.getChild(d+1).getChild(0);else if(!e&&b){const R=c.getChild(d-1);P=R.getChild(R.childCount-1)}else P=a.getChild(m+(e?1:-1));t.model.change(R=>{R.setSelection(R.createRangeIn(P))})}}_onArrowKey(e,t){const n=this.editor,o=ko(t.keyCode,n.locale.contentLanguageDirection);this._handleArrowKeys(o,t.shiftKey)&&(t.preventDefault(),t.stopPropagation(),e.stop())}_handleArrowKeys(e,t){const n=this.editor.model.document.selection,o=["right","down"].includes(e),r=nu(n);if(r.length){let c;return c=t?this.editor.plugins.get("TableSelection").getFocusCell():o?r[r.length-1]:r[0],this._navigateFromCellInDirection(c,e,t),!0}const a=n.focus.findAncestor("tableCell");return!!a&&!(t&&!n.isCollapsed&&n.isBackward==o)&&!!this._isSelectionAtCellEdge(n,a,o)&&(this._navigateFromCellInDirection(a,e,t),!0)}_isSelectionAtCellEdge(e,t,n){const o=this.editor.model,r=this.editor.model.schema,a=n?e.getLastPosition():e.getFirstPosition();if(!r.getLimitElement(a).is("element","tableCell"))return o.createPositionAt(t,n?"end":0).isTouching(a);const c=o.createSelection(a);return o.modifySelection(c,{direction:n?"forward":"backward"}),a.isEqual(c.focus)}_navigateFromCellInDirection(e,t,n=!1){const o=this.editor.model,r=e.findAncestor("table"),a=[...new $t(r,{includeAllSlots:!0})],{row:c,column:d}=a[a.length-1],m=a.find(({cell:R})=>R==e);let{row:b,column:_}=m;switch(t){case"left":_--;break;case"up":b--;break;case"right":_+=m.cellWidth;break;case"down":b+=m.cellHeight}if(b<0||b>c||_<0&&b<=0||_>d&&b>=c)return void o.change(R=>{R.setSelection(R.createRangeOn(r))});_<0?(_=n?0:d,b--):_>d&&(_=n?d:0,b++);const T=a.find(R=>R.row==b&&R.column==_).cell,E=["right","down"].includes(t),P=this.editor.plugins.get("TableSelection");if(n&&P.isEnabled){const R=P.getAnchorCell()||e;P.setCellSelection(R,T)}else{const R=o.createPositionAt(T,E?0:"end");o.change(z=>{z.setSelection(R)})}}}class vx extends Gi{constructor(e){super(e),this.domEventType=["mousemove","mouseleave"]}onDomEvent(e){this.fire(e.type,e)}}class wx extends ve{static get pluginName(){return"TableMouse"}static get requires(){return[kl]}init(){this.editor.editing.view.addObserver(vx),this._enableShiftClickSelection(),this._enableMouseDragSelection()}_enableShiftClickSelection(){const e=this.editor;let t=!1;const n=e.plugins.get(kl);this.listenTo(e.editing.view.document,"mousedown",(o,r)=>{if(!this.isEnabled||!n.isEnabled||!r.domEvent.shiftKey)return;const a=n.getAnchorCell()||ah(e.model.document.selection)[0];if(!a)return;const c=this._getModelTableCellFromDomEvent(r);c&&c_(a,c)&&(t=!0,n.setCellSelection(a,c),r.preventDefault())}),this.listenTo(e.editing.view.document,"mouseup",()=>{t=!1}),this.listenTo(e.editing.view.document,"selectionChange",o=>{t&&o.stop()},{priority:"highest"})}_enableMouseDragSelection(){const e=this.editor;let t,n,o=!1,r=!1;const a=e.plugins.get(kl);this.listenTo(e.editing.view.document,"mousedown",(c,d)=>{this.isEnabled&&a.isEnabled&&(d.domEvent.shiftKey||d.domEvent.ctrlKey||d.domEvent.altKey||(t=this._getModelTableCellFromDomEvent(d)))}),this.listenTo(e.editing.view.document,"mousemove",(c,d)=>{if(!d.domEvent.buttons||!t)return;const m=this._getModelTableCellFromDomEvent(d);m&&c_(t,m)&&(n=m,o||n==t||(o=!0)),o&&(r=!0,a.setCellSelection(t,n),d.preventDefault())}),this.listenTo(e.editing.view.document,"mouseup",()=>{o=!1,r=!1,t=null,n=null}),this.listenTo(e.editing.view.document,"selectionChange",c=>{r&&c.stop()},{priority:"highest"})}_getModelTableCellFromDomEvent(e){const t=e.target,n=this.editor.editing.view.createPositionAt(t,0);return this.editor.editing.mapper.toModelPosition(n).parent.findAncestor("tableCell",{includeSelf:!0})}}function c_(i,e){return i.parent.parent==e.parent.parent}w(106);function kx(i){const e=i.getSelectedElement();return e&&u_(e)?e:null}function _x(i){let e=i.getFirstPosition().parent;for(;e;){if(e.is("element")&&u_(e))return e;e=e.parent}return null}function u_(i){return!!i.getCustomProperty("table")&&it(i)}const Nv={autoRefresh:!0};class rp{constructor(e,t=Nv){if(!e)throw new C.a("token-missing-token-url",this);t.initValue&&this._validateTokenValue(t.initValue),this.set("value",t.initValue),this._refresh=typeof e=="function"?e:()=>{return n=e,new Promise((o,r)=>{const a=new XMLHttpRequest;a.open("GET",n),a.addEventListener("load",()=>{const c=a.status,d=a.response;return c<200||c>299?r(new C.a("token-cannot-download-new-token",null)):o(d)}),a.addEventListener("error",()=>r(new Error("Network Error"))),a.addEventListener("abort",()=>r(new Error("Abort"))),a.send()});var n},this._options=Object.assign({},Nv,t)}init(){return new Promise((e,t)=>{this.value?(this._options.autoRefresh&&this._registerRefreshTokenTimeout(),e(this)):this.refreshToken().then(e).catch(t)})}refreshToken(){return this._refresh().then(e=>{this._validateTokenValue(e),this.set("value",e),this._options.autoRefresh&&this._registerRefreshTokenTimeout()}).then(()=>this)}destroy(){clearTimeout(this._tokenRefreshTimeout)}_validateTokenValue(e){const t=typeof e=="string",n=!/^".*"$/.test(e),o=t&&e.split(".").length===3;if(!n||!o)throw new C.a("token-not-in-jwt-format",this)}_registerRefreshTokenTimeout(){const e=this._getTokenRefreshTimeoutTime();clearTimeout(this._tokenRefreshTimeout),this._tokenRefreshTimeout=setTimeout(()=>{this.refreshToken()},e)}_getTokenRefreshTimeoutTime(){try{const[,e]=this.value.split("."),{exp:t}=JSON.parse(atob(e));return t?Math.floor((1e3*t-Date.now())/2):36e5}catch{return 36e5}}static create(e,t=Nv){return new rp(e,t).init()}}Be(rp,Wt);var yx=rp;const Tv=/^data:(\S*?);base64,/;class d_{constructor(e,t,n){if(!e)throw new C.a("fileuploader-missing-file",null);if(!t)throw new C.a("fileuploader-missing-token",null);if(!n)throw new C.a("fileuploader-missing-api-address",null);this.file=function(o){if(typeof o!="string")return!1;const r=o.match(Tv);return!(!r||!r.length)}(e)?function(o,r=512){try{const a=o.match(Tv)[1],c=atob(o.replace(Tv,"")),d=[];for(let m=0;m<c.length;m+=r){const b=c.slice(m,m+r),_=new Array(b.length);for(let T=0;T<b.length;T++)_[T]=b.charCodeAt(T);d.push(new Uint8Array(_))}return new Blob(d,{type:a})}catch{throw new C.a("fileuploader-decoding-image-data-error",null)}}(e):e,this._token=t,this._apiAddress=n}onProgress(e){return this.on("progress",(t,n)=>e(n)),this}onError(e){return this.once("error",(t,n)=>e(n)),this}abort(){this.xhr.abort()}send(){return this._prepareRequest(),this._attachXHRListeners(),this._sendRequest()}_prepareRequest(){const e=new XMLHttpRequest;e.open("POST",this._apiAddress),e.setRequestHeader("Authorization",this._token.value),e.responseType="json",this.xhr=e}_attachXHRListeners(){const e=this,t=this.xhr;function n(o){return()=>e.fire("error",o)}t.addEventListener("error",n("Network Error")),t.addEventListener("abort",n("Abort")),t.upload&&t.upload.addEventListener("progress",o=>{o.lengthComputable&&this.fire("progress",{total:o.total,uploaded:o.loaded})}),t.addEventListener("load",()=>{const o=t.status,r=t.response;if(o<200||o>299)return this.fire("error",r.message||r.error)})}_sendRequest(){const e=new FormData,t=this.xhr;return e.append("file",this.file),new Promise((n,o)=>{t.addEventListener("load",()=>{const r=t.status,a=t.response;return r<200||r>299?a.message?o(new C.a("fileuploader-uploading-data-failed",this,{message:a.message})):o(a.error):n(a)}),t.addEventListener("error",()=>o(new Error("Network Error"))),t.addEventListener("abort",()=>o(new Error("Abort"))),t.send(e)})}}Be(d_,F);class xx{constructor(e,t){if(!e)throw new C.a("uploadgateway-missing-token",null);if(!t)throw new C.a("uploadgateway-missing-api-address",null);this._token=e,this._apiAddress=t}upload(e){return new d_(e,this._token,this._apiAddress)}}class Nx extends I{static get pluginName(){return"CloudServicesCore"}createToken(e,t){return new yx(e,t)}createUploadGateway(e,t){return new xx(e,t)}}class Cv extends zd{}Cv.builtinPlugins=[class extends ve{static get requires(){return[St,Wc,hb,ab,gb,Vf]}static get pluginName(){return"Essentials"}},class extends ve{static get requires(){return[oi]}static get pluginName(){return"CKFinderUploadAdapter"}init(){const i=this.editor.config.get("ckfinder.uploadUrl");i&&(this.editor.plugins.get(oi).createUploadAdapter=e=>new Db(e,i,this.editor.t))}},class extends ve{static get pluginName(){return"Autoformat"}afterInit(){this._addListAutoformats(),this._addBasicStylesAutoformats(),this._addHeadingAutoformats(),this._addBlockQuoteAutoformats(),this._addCodeBlockAutoformats(),this._addHorizontalLineAutoformats()}_addListAutoformats(){const i=this.editor.commands;i.get("bulletedList")&&Nr(this.editor,this,/^[*-]\s$/,"bulletedList"),i.get("numberedList")&&Nr(this.editor,this,/^1[.|)]\s$/,"numberedList"),i.get("todoList")&&Nr(this.editor,this,/^\[\s?\]\s$/,"todoList"),i.get("checkTodoList")&&Nr(this.editor,this,/^\[\s?x\s?\]\s$/,()=>{this.editor.execute("todoList"),this.editor.execute("checkTodoList")})}_addBasicStylesAutoformats(){const i=this.editor.commands;if(i.get("bold")){const e=Xc(this.editor,"bold");Us(this.editor,this,/(?:^|\s)(\*\*)([^*]+)(\*\*)$/g,e),Us(this.editor,this,/(?:^|\s)(__)([^_]+)(__)$/g,e)}if(i.get("italic")){const e=Xc(this.editor,"italic");Us(this.editor,this,/(?:^|\s)(\*)([^*_]+)(\*)$/g,e),Us(this.editor,this,/(?:^|\s)(_)([^_]+)(_)$/g,e)}if(i.get("code")){const e=Xc(this.editor,"code");Us(this.editor,this,/(`)([^`]+)(`)$/g,e)}if(i.get("strikethrough")){const e=Xc(this.editor,"strikethrough");Us(this.editor,this,/(~~)([^~]+)(~~)$/g,e)}}_addHeadingAutoformats(){const i=this.editor.commands.get("heading");i&&i.modelElements.filter(e=>e.match(/^heading[1-6]$/)).forEach(e=>{const t=e[7],n=new RegExp(`^(#{${t}})\\s$`);Nr(this.editor,this,n,()=>{if(!i.isEnabled||i.value===e)return!1;this.editor.execute("heading",{value:e})})})}_addBlockQuoteAutoformats(){this.editor.commands.get("blockQuote")&&Nr(this.editor,this,/^>\s$/,"blockQuote")}_addCodeBlockAutoformats(){const i=this.editor,e=i.model.document.selection;i.commands.get("codeBlock")&&Nr(i,this,/^```$/,()=>{if(e.getFirstPosition().parent.is("element","listItem"))return!1;this.editor.execute("codeBlock",{usePreviousLanguageChoice:!0})})}_addHorizontalLineAutoformats(){this.editor.commands.get("horizontalLine")&&Nr(this.editor,this,/^---$/,"horizontalLine")}},class extends ve{static get requires(){return[jb,Ib]}static get pluginName(){return"Bold"}},class extends ve{static get requires(){return[Pb,Mb]}static get pluginName(){return"Italic"}},class extends ve{static get requires(){return[Rb,Vb]}static get pluginName(){return"BlockQuote"}},class extends ve{static get pluginName(){return"CKFinder"}static get requires(){return["Link","CKFinderUploadAdapter",Bb,Lb]}},class extends I{static get pluginName(){return"CloudServices"}static get requires(){return[Nx]}init(){const i=this.context.config.get("cloudServices")||{};for(const e in i)this[e]=i[e];if(this._tokens=new Map,this.tokenUrl)return this.token=this.context.plugins.get("CloudServicesCore").createToken(this.tokenUrl),this._tokens.set(this.tokenUrl,this.token),this.token.init();this.token=null}registerTokenUrl(i){if(this._tokens.has(i))return Promise.resolve(this.getTokenFor(i));const e=this.context.plugins.get("CloudServicesCore").createToken(i);return this._tokens.set(i,e),e.init()}getTokenFor(i){const e=this._tokens.get(i);if(!e)throw new C.a("cloudservices-token-not-registered",this);return e}destroy(){super.destroy();for(const i of this._tokens.values())i.destroy()}},class extends ve{static get requires(){return[Fb,"ImageUpload"]}init(){const i=this.editor;i.plugins.has("ImageBlockEditing")||i.plugins.has("ImageInlineEditing")||Object(C.b)("easy-image-image-feature-missing",i)}static get pluginName(){return"EasyImage"}},class extends ve{static get requires(){return[$b,Ub]}static get pluginName(){return"Heading"}},class extends ve{static get requires(){return[Jb,ev]}static get pluginName(){return"Image"}},class extends ve{static get requires(){return[nv,ov]}static get pluginName(){return"ImageCaption"}},class extends ve{static get requires(){return[H,W]}static get pluginName(){return"ImageStyle"}},class extends ve{static get requires(){return[eu,Di]}static get pluginName(){return"ImageToolbar"}afterInit(){const i=this.editor,e=i.t,t=i.plugins.get(eu),n=i.plugins.get("ImageUtils");var o;t.register("image",{ariaLabel:e("Image toolbar"),items:(o=i.config.get("image.toolbar")||[],o.map(r=>oe(r)?r.name:r)),getRelatedElement:r=>n.getClosestSelectedImageWidget(r)})}},class extends ve{static get pluginName(){return"ImageUpload"}static get requires(){return[pn,Ye,bt]}},class extends ve{static get pluginName(){return"Indent"}static get requires(){return[tr,qy]}},class extends ve{static get requires(){return[a1,u1,h1]}static get pluginName(){return"Link"}},class extends ve{static get requires(){return[y1,x1]}static get pluginName(){return"List"}},class extends ve{static get requires(){return[op,S1,E1,fl]}static get pluginName(){return"MediaEmbed"}},pl,class extends ve{static get pluginName(){return"PasteFromOffice"}static get requires(){return[sn]}init(){const i=this.editor,e=i.editing.view.document,t=[];t.push(new L1(e)),t.push(new M1(e)),i.plugins.get("ClipboardPipeline").on("inputTransformation",(n,o)=>{if(o._isTransformedWithPasteFromOffice)return;const r=o.dataTransfer.getData("text/html"),a=t.find(c=>c.isActive(r));a&&(o._parsedData=z1(r,e.stylesProcessor),a.execute(o),o._isTransformedWithPasteFromOffice=!0)},{priority:"high"})}},class extends ve{static get requires(){return[dx,fx,kl,wx,bx,gx,fl]}static get pluginName(){return"Table"}},class extends ve{static get requires(){return[eu]}static get pluginName(){return"TableToolbar"}afterInit(){const i=this.editor,e=i.t,t=i.plugins.get(eu),n=i.config.get("table.contentToolbar"),o=i.config.get("table.tableToolbar");n&&t.register("tableContent",{ariaLabel:e("Table toolbar"),items:n,getRelatedElement:_x}),o&&t.register("table",{ariaLabel:e("Table toolbar"),items:o,getRelatedElement:kx})}},class extends ve{static get pluginName(){return"TextTransformation"}constructor(i){super(i),i.config.define("typing",{transformations:{include:wb}})}init(){const i=this.editor.model.document.selection;i.on("change:range",()=>{this.isEnabled=!i.anchor.parent.is("element","codeBlock")}),this._enableTransformationWatchers()}_enableTransformationWatchers(){const i=this.editor,e=i.model,t=i.plugins.get("Input"),n=function(r){const a=r.extra||[],c=r.remove||[],d=m=>!c.includes(m);return function(m){const b=new Set;for(const _ of m)if(If[_])for(const T of If[_])b.add(T);else b.add(_);return Array.from(b)}(r.include.concat(a).filter(d)).filter(d).map(m=>vb[m]||m).map(m=>({from:Pf(m.from),to:kb(m.to)}))}(i.config.get("typing.transformations")),o=new Wd(i.model,r=>{for(const a of n)if(a.from.test(r))return{normalizedTransformation:a}});o.on("matched:data",(r,a)=>{if(!t.isInput(a.batch))return;const{from:c,to:d}=a.normalizedTransformation,m=c.exec(a.text),b=d(m.slice(1)),_=a.range;let T=m.index;e.enqueueChange(E=>{for(let P=1;P<m.length;P++){const R=m[P],z=b[P-1];if(z==null){T+=R.length;continue}const $=_.start.getShiftedBy(T),J=e.createRange($,$.getShiftedBy(R.length)),ue=_b($);e.insertContent(E.createText(z,ue),J),T+=z.length}})}),o.bind("isEnabled").to(this)}}],Cv.defaultConfig={toolbar:{items:["heading","|","bold","italic","link","bulletedList","numberedList","|","outdent","indent","|","uploadImage","blockQuote","insertTable","mediaEmbed","undo","redo"]},image:{toolbar:["imageStyle:inline","imageStyle:block","imageStyle:side","|","toggleImageCaption","imageTextAlternative"]},table:{contentToolbar:["tableColumn","tableRow","mergeTableCells"]},language:"en"}}]).default})})(tw,tw.exports);var xT=tw.exports;const NT=Tp(xT);function hu(p){var f=[];return Ii.Children.forEach(p,function(l){l!=null&&(Array.isArray(l)?f=f.concat(hu(l)):Ix.isFragment(l)&&l.props?f=f.concat(hu(l.props.children)):f.push(l))}),f}function W0(){var p=this.constructor.getDerivedStateFromProps(this.props,this.state);p!=null&&this.setState(p)}function K0(p){function f(l){var h=this.constructor.getDerivedStateFromProps(p,l);return h??null}this.setState(f.bind(this))}function G0(p,f){try{var l=this.props,h=this.state;this.props=p,this.state=f,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(l,h)}finally{this.props=l,this.state=h}}W0.__suppressDeprecationWarning=!0;K0.__suppressDeprecationWarning=!0;G0.__suppressDeprecationWarning=!0;function Dw(p){var f=p.prototype;if(!f||!f.isReactComponent)throw new Error("Can only polyfill class components");if(typeof p.getDerivedStateFromProps!="function"&&typeof f.getSnapshotBeforeUpdate!="function")return p;var l=null,h=null,w=null;if(typeof f.componentWillMount=="function"?l="componentWillMount":typeof f.UNSAFE_componentWillMount=="function"&&(l="UNSAFE_componentWillMount"),typeof f.componentWillReceiveProps=="function"?h="componentWillReceiveProps":typeof f.UNSAFE_componentWillReceiveProps=="function"&&(h="UNSAFE_componentWillReceiveProps"),typeof f.componentWillUpdate=="function"?w="componentWillUpdate":typeof f.UNSAFE_componentWillUpdate=="function"&&(w="UNSAFE_componentWillUpdate"),l!==null||h!==null||w!==null){var k=p.displayName||p.name,v=typeof p.getDerivedStateFromProps=="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error(`Unsafe legacy lifecycles will not be called for components using new component APIs.

`+k+" uses "+v+" but also contains the following legacy lifecycles:"+(l!==null?`
  `+l:"")+(h!==null?`
  `+h:"")+(w!==null?`
  `+w:"")+`

The above lifecycles should be removed. Learn more about this warning here:
https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof p.getDerivedStateFromProps=="function"&&(f.componentWillMount=W0,f.componentWillReceiveProps=K0),typeof f.getSnapshotBeforeUpdate=="function"){if(typeof f.componentDidUpdate!="function")throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");f.componentWillUpdate=G0;var N=f.componentDidUpdate;f.componentDidUpdate=function(O,C,L){var j=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:L;N.call(this,O,C,j)}}return p}var nw={exports:{}},ow={exports:{}};(function(p,f){f.__esModule=!0;var l=U;O(l);var h=Px,w=O(h),k=$x,v=O(k),N=zx,S=O(N);function O(Z){return Z&&Z.__esModule?Z:{default:Z}}function C(Z,Y){if(!(Z instanceof Y))throw new TypeError("Cannot call a class as a function")}function L(Z,Y){if(!Z)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Y&&(typeof Y=="object"||typeof Y=="function")?Y:Z}function j(Z,Y){if(typeof Y!="function"&&Y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof Y);Z.prototype=Object.create(Y&&Y.prototype,{constructor:{value:Z,enumerable:!1,writable:!0,configurable:!0}}),Y&&(Object.setPrototypeOf?Object.setPrototypeOf(Z,Y):Z.__proto__=Y)}var F=1073741823;function q(Z,Y){return Z===Y?Z!==0||1/Z===1/Y:Z!==Z&&Y!==Y}function K(Z){var Y=[];return{on:function(ie){Y.push(ie)},off:function(ie){Y=Y.filter(function(ge){return ge!==ie})},get:function(){return Z},set:function(ie,ge){Z=ie,Y.forEach(function(de){return de(Z,ge)})}}}function te(Z){return Array.isArray(Z)?Z[0]:Z}function se(Z,Y){var oe,ie,ge="__create-react-context-"+(0,v.default)()+"__",de=function(Ie){j(Pe,Ie);function Pe(){var ce,ae,be;C(this,Pe);for(var ke=arguments.length,_e=Array(ke),Ee=0;Ee<ke;Ee++)_e[Ee]=arguments[Ee];return be=(ce=(ae=L(this,Ie.call.apply(Ie,[this].concat(_e))),ae),ae.emitter=K(ae.props.value),ce),L(ae,be)}return Pe.prototype.getChildContext=function(){var ae;return ae={},ae[ge]=this.emitter,ae},Pe.prototype.componentWillReceiveProps=function(ae){if(this.props.value!==ae.value){var be=this.props.value,ke=ae.value,_e=void 0;q(be,ke)?_e=0:(_e=typeof Y=="function"?Y(be,ke):F,(0,S.default)((_e&F)===_e,"calculateChangedBits: Expected the return value to be a 31-bit integer. Instead received: %s",_e),_e|=0,_e!==0&&this.emitter.set(ae.value,_e))}},Pe.prototype.render=function(){return this.props.children},Pe}(l.Component);de.childContextTypes=(oe={},oe[ge]=w.default.object.isRequired,oe);var je=function(Ie){j(Pe,Ie);function Pe(){var ce,ae,be;C(this,Pe);for(var ke=arguments.length,_e=Array(ke),Ee=0;Ee<ke;Ee++)_e[Ee]=arguments[Ee];return be=(ce=(ae=L(this,Ie.call.apply(Ie,[this].concat(_e))),ae),ae.state={value:ae.getValue()},ae.onUpdate=function(Se,Oe){var rt=ae.observedBits|0;rt&Oe&&ae.setState({value:ae.getValue()})},ce),L(ae,be)}return Pe.prototype.componentWillReceiveProps=function(ae){var be=ae.observedBits;this.observedBits=be??F},Pe.prototype.componentDidMount=function(){this.context[ge]&&this.context[ge].on(this.onUpdate);var ae=this.props.observedBits;this.observedBits=ae??F},Pe.prototype.componentWillUnmount=function(){this.context[ge]&&this.context[ge].off(this.onUpdate)},Pe.prototype.getValue=function(){return this.context[ge]?this.context[ge].get():Z},Pe.prototype.render=function(){return te(this.props.children)(this.state.value)},Pe}(l.Component);return je.contextTypes=(ie={},ie[ge]=w.default.object,ie),{Provider:de,Consumer:je}}f.default=se,p.exports=f.default})(ow,ow.exports);var TT=ow.exports;(function(p,f){f.__esModule=!0;var l=U,h=v(l),w=TT,k=v(w);function v(N){return N&&N.__esModule?N:{default:N}}f.default=h.default.createContext||k.default,p.exports=f.default})(nw,nw.exports);var CT=nw.exports;const ET=Tp(CT);var Q0=ET(null),Y0={exports:{}},AT=Y0.exports=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=AT);var El=Y0.exports,X0={exports:{}},ST=X0.exports={version:"2.6.12"};typeof __e=="number"&&(__e=ST);var Xs=X0.exports,DT=function(p){if(typeof p!="function")throw TypeError(p+" is not a function!");return p},jT=DT,J0=function(p,f,l){if(jT(p),f===void 0)return p;switch(l){case 1:return function(h){return p.call(f,h)};case 2:return function(h,w){return p.call(f,h,w)};case 3:return function(h,w,k){return p.call(f,h,w,k)}}return function(){return p.apply(f,arguments)}},Js={},gu=function(p){return typeof p=="object"?p!==null:typeof p=="function"},IT=gu,yh=function(p){if(!IT(p))throw TypeError(p+" is not an object!");return p},xh=function(p){try{return!!p()}catch{return!0}},Zs=!xh(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7}),Dv,y_;function Z0(){if(y_)return Dv;y_=1;var p=gu,f=El.document,l=p(f)&&p(f.createElement);return Dv=function(h){return l?f.createElement(h):{}},Dv}var ey=!Zs&&!xh(function(){return Object.defineProperty(Z0()("div"),"a",{get:function(){return 7}}).a!=7}),sp=gu,jw=function(p,f){if(!sp(p))return p;var l,h;if(f&&typeof(l=p.toString)=="function"&&!sp(h=l.call(p))||typeof(l=p.valueOf)=="function"&&!sp(h=l.call(p))||!f&&typeof(l=p.toString)=="function"&&!sp(h=l.call(p)))return h;throw TypeError("Can't convert object to primitive value")},x_=yh,PT=ey,MT=jw,OT=Object.defineProperty;Js.f=Zs?Object.defineProperty:function(f,l,h){if(x_(f),l=MT(l,!0),x_(h),PT)try{return OT(f,l,h)}catch{}if("get"in h||"set"in h)throw TypeError("Accessors not supported!");return"value"in h&&(f[l]=h.value),f};var Ep=function(p,f){return{enumerable:!(p&1),configurable:!(p&2),writable:!(p&4),value:f}},RT=Js,VT=Ep,bu=Zs?function(p,f,l){return RT.f(p,f,VT(1,l))}:function(p,f,l){return p[f]=l,p},LT={}.hasOwnProperty,Al=function(p,f){return LT.call(p,f)},ap=El,jv=Xs,N_=J0,zT=bu,BT=Al,lp="prototype",fo=function(p,f,l){var h=p&fo.F,w=p&fo.G,k=p&fo.S,v=p&fo.P,N=p&fo.B,S=p&fo.W,O=w?jv:jv[f]||(jv[f]={}),C=O[lp],L=w?ap:k?ap[f]:(ap[f]||{})[lp],j,F,q;w&&(l=f);for(j in l)F=!h&&L&&L[j]!==void 0,!(F&&BT(O,j))&&(q=F?L[j]:l[j],O[j]=w&&typeof L[j]!="function"?l[j]:N&&F?N_(q,ap):S&&L[j]==q?function(K){var te=function(se,Z,Y){if(this instanceof K){switch(arguments.length){case 0:return new K;case 1:return new K(se);case 2:return new K(se,Z)}return new K(se,Z,Y)}return K.apply(this,arguments)};return te[lp]=K[lp],te}(q):v&&typeof q=="function"?N_(Function.call,q):q,v&&((O.virtual||(O.virtual={}))[j]=q,p&fo.R&&C&&!C[j]&&zT(C,j,q)))};fo.F=1;fo.G=2;fo.S=4;fo.P=8;fo.B=16;fo.W=32;fo.U=64;fo.R=128;var vu=fo,Iv=vu;Iv(Iv.S+Iv.F*!Zs,"Object",{defineProperty:Js.f});var FT=Xs.Object,qT=function(f,l,h){return FT.defineProperty(f,l,h)},ty={default:qT,__esModule:!0},HT=ty,$T=UT(HT);function UT(p){return p&&p.__esModule?p:{default:p}}var Pv=function(p,f,l){return f in p?(0,$T.default)(p,f,{value:l,enumerable:!0,configurable:!0,writable:!0}):p[f]=l,p},WT={}.toString,ny=function(p){return WT.call(p).slice(8,-1)},KT=ny,oy=Object("z").propertyIsEnumerable(0)?Object:function(p){return KT(p)=="String"?p.split(""):Object(p)},Iw=function(p){if(p==null)throw TypeError("Can't call method on  "+p);return p},GT=oy,QT=Iw,wu=function(p){return GT(QT(p))},YT=Math.ceil,XT=Math.floor,Pw=function(p){return isNaN(p=+p)?0:(p>0?XT:YT)(p)},JT=Pw,ZT=Math.min,eC=function(p){return p>0?ZT(JT(p),9007199254740991):0},tC=Pw,nC=Math.max,oC=Math.min,iC=function(p,f){return p=tC(p),p<0?nC(p+f,0):oC(p,f)},rC=wu,sC=eC,aC=iC,lC=function(p){return function(f,l,h){var w=rC(f),k=sC(w.length),v=aC(h,k),N;if(p&&l!=l){for(;k>v;)if(N=w[v++],N!=N)return!0}else for(;k>v;v++)if((p||v in w)&&w[v]===l)return p||v||0;return!p&&-1}},iy={exports:{}},cC=!0,uC=Xs,T_=El,C_="__core-js_shared__",E_=T_[C_]||(T_[C_]={});(iy.exports=function(p,f){return E_[p]||(E_[p]=f!==void 0?f:{})})("versions",[]).push({version:uC.version,mode:"pure",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"});var Mw=iy.exports,dC=0,hC=Math.random(),Ap=function(p){return"Symbol(".concat(p===void 0?"":p,")_",(++dC+hC).toString(36))},A_=Mw("keys"),mC=Ap,Ow=function(p){return A_[p]||(A_[p]=mC(p))},S_=Al,fC=wu,pC=lC(!1),gC=Ow("IE_PROTO"),ry=function(p,f){var l=fC(p),h=0,w=[],k;for(k in l)k!=gC&&S_(l,k)&&w.push(k);for(;f.length>h;)S_(l,k=f[h++])&&(~pC(w,k)||w.push(k));return w},Rw="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),bC=ry,vC=Rw,Sp=Object.keys||function(f){return bC(f,vC)},Dp={};Dp.f=Object.getOwnPropertySymbols;var Nh={};Nh.f={}.propertyIsEnumerable;var wC=Iw,Vw=function(p){return Object(wC(p))},Mv,D_;function kC(){if(D_)return Mv;D_=1;var p=Zs,f=Sp,l=Dp,h=Nh,w=Vw,k=oy,v=Object.assign;return Mv=!v||xh(function(){var N={},S={},O=Symbol(),C="abcdefghijklmnopqrst";return N[O]=7,C.split("").forEach(function(L){S[L]=L}),v({},N)[O]!=7||Object.keys(v({},S)).join("")!=C})?function(S,O){for(var C=w(S),L=arguments.length,j=1,F=l.f,q=h.f;L>j;)for(var K=k(arguments[j++]),te=F?f(K).concat(F(K)):f(K),se=te.length,Z=0,Y;se>Z;)Y=te[Z++],(!p||q.call(K,Y))&&(C[Y]=K[Y]);return C}:v,Mv}var Ov=vu;Ov(Ov.S+Ov.F,"Object",{assign:kC()});var _C=Xs.Object.assign,yC={default:_C,__esModule:!0},xC=yC,NC=TC(xC);function TC(p){return p&&p.__esModule?p:{default:p}}var su=NC.default||function(p){for(var f=1;f<arguments.length;f++){var l=arguments[f];for(var h in l)Object.prototype.hasOwnProperty.call(l,h)&&(p[h]=l[h])}return p},CC=function(p,f){if(!(p instanceof f))throw new TypeError("Cannot call a class as a function")},EC=ty,AC=SC(EC);function SC(p){return p&&p.__esModule?p:{default:p}}var DC=function(){function p(f,l){for(var h=0;h<l.length;h++){var w=l[h];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),(0,AC.default)(f,w.key,w)}}return function(f,l,h){return l&&p(f.prototype,l),h&&p(f,h),f}}(),jp={},jC=Pw,IC=Iw,PC=function(p){return function(f,l){var h=String(IC(f)),w=jC(l),k=h.length,v,N;return w<0||w>=k?p?"":void 0:(v=h.charCodeAt(w),v<55296||v>56319||w+1===k||(N=h.charCodeAt(w+1))<56320||N>57343?p?h.charAt(w):v:p?h.slice(w,w+2):(v-55296<<10)+(N-56320)+65536)}},sy=bu,Lw={},MC=Js,OC=yh,RC=Sp,VC=Zs?Object.defineProperties:function(f,l){OC(f);for(var h=RC(l),w=h.length,k=0,v;w>k;)MC.f(f,v=h[k++],l[v]);return f},Rv,j_;function LC(){if(j_)return Rv;j_=1;var p=El.document;return Rv=p&&p.documentElement,Rv}var zC=yh,BC=VC,I_=Rw,FC=Ow("IE_PROTO"),Vv=function(){},iw="prototype",bp=function(){var p=Z0()("iframe"),f=I_.length,l="<",h=">",w;for(p.style.display="none",LC().appendChild(p),p.src="javascript:",w=p.contentWindow.document,w.open(),w.write(l+"script"+h+"document.F=Object"+l+"/script"+h),w.close(),bp=w.F;f--;)delete bp[iw][I_[f]];return bp()},zw=Object.create||function(f,l){var h;return f!==null?(Vv[iw]=zC(f),h=new Vv,Vv[iw]=null,h[FC]=f):h=bp(),l===void 0?h:BC(h,l)},ay={exports:{}},rw=Mw("wks"),qC=Ap,sw=El.Symbol,P_=typeof sw=="function",HC=ay.exports=function(p){return rw[p]||(rw[p]=P_&&sw[p]||(P_?sw:qC)("Symbol."+p))};HC.store=rw;var ku=ay.exports,$C=Js.f,UC=Al,M_=ku("toStringTag"),Bw=function(p,f,l){p&&!UC(p=l?p:p.prototype,M_)&&$C(p,M_,{configurable:!0,value:f})},WC=zw,KC=Ep,GC=Bw,ly={};bu(ly,ku("iterator"),function(){return this});var QC=function(p,f,l){p.prototype=WC(ly,{next:KC(1,l)}),GC(p,f+" Iterator")},YC=Al,XC=Vw,O_=Ow("IE_PROTO"),JC=Object.prototype,ZC=Object.getPrototypeOf||function(p){return p=XC(p),YC(p,O_)?p[O_]:typeof p.constructor=="function"&&p instanceof p.constructor?p.constructor.prototype:p instanceof Object?JC:null},Lv=vu,eE=sy,tE=bu,R_=Lw,nE=QC,oE=Bw,iE=ZC,zv=ku("iterator"),Bv=!([].keys&&"next"in[].keys()),rE="@@iterator",V_="keys",cp="values",sE=function(){return this},cy=function(p,f,l,h,w,k,v){nE(l,f,h);var N=function(Y){if(!Bv&&Y in L)return L[Y];switch(Y){case V_:return function(){return new l(this,Y)};case cp:return function(){return new l(this,Y)}}return function(){return new l(this,Y)}},S=f+" Iterator",O=w==cp,C=!1,L=p.prototype,j=L[zv]||L[rE]||w&&L[w],F=j||N(w),q=w?O?N("entries"):F:void 0,K=f=="Array"&&L.entries||j,te,se,Z;if(K&&(Z=iE(K.call(new p)),Z!==Object.prototype&&Z.next&&oE(Z,S,!0)),O&&j&&j.name!==cp&&(C=!0,F=function(){return j.call(this)}),v&&(Bv||C||!L[zv])&&tE(L,zv,F),R_[f]=F,R_[S]=sE,w)if(te={values:O?F:N(cp),keys:k?F:N(V_),entries:q},v)for(se in te)se in L||eE(L,se,te[se]);else Lv(Lv.P+Lv.F*(Bv||C),f,te);return te},aE=PC(!0);cy(String,"String",function(p){this._t=String(p),this._i=0},function(){var p=this._t,f=this._i,l;return f>=p.length?{value:void 0,done:!0}:(l=aE(p,f),this._i+=l.length,{value:l,done:!1})});var lE=function(p,f){return{value:f,done:!!p}},up=lE,L_=Lw,cE=wu;cy(Array,"Array",function(p,f){this._t=cE(p),this._i=0,this._k=f},function(){var p=this._t,f=this._k,l=this._i++;return!p||l>=p.length?(this._t=void 0,up(1)):f=="keys"?up(0,l):f=="values"?up(0,p[l]):up(0,[l,p[l]])},"values");L_.Arguments=L_.Array;var uE=El,dE=bu,z_=Lw,B_=ku("toStringTag"),F_="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(",");for(var Fv=0;Fv<F_.length;Fv++){var qv=F_[Fv],q_=uE[qv],Hv=q_&&q_.prototype;Hv&&!Hv[B_]&&dE(Hv,B_,qv),z_[qv]=z_.Array}var Ip={};Ip.f=ku;var hE=Ip.f("iterator"),mE={default:hE,__esModule:!0},uy={exports:{}},Nl=Ap("meta"),fE=gu,Fw=Al,pE=Js.f,gE=0,Pp=Object.isExtensible||function(){return!0},bE=!xh(function(){return Pp(Object.preventExtensions({}))}),qw=function(p){pE(p,Nl,{value:{i:"O"+ ++gE,w:{}}})},vE=function(p,f){if(!fE(p))return typeof p=="symbol"?p:(typeof p=="string"?"S":"P")+p;if(!Fw(p,Nl)){if(!Pp(p))return"F";if(!f)return"E";qw(p)}return p[Nl].i},wE=function(p,f){if(!Fw(p,Nl)){if(!Pp(p))return!0;if(!f)return!1;qw(p)}return p[Nl].w},kE=function(p){return bE&&_E.NEED&&Pp(p)&&!Fw(p,Nl)&&qw(p),p},_E=uy.exports={KEY:Nl,NEED:!1,fastKey:vE,getWeak:wE,onFreeze:kE},yE=uy.exports,H_=Xs,xE=Ip,NE=Js.f,Hw=function(p){var f=H_.Symbol||(H_.Symbol={});p.charAt(0)!="_"&&!(p in f)&&NE(f,p,{value:xE.f(p)})},TE=Sp,CE=Dp,EE=Nh,AE=function(p){var f=TE(p),l=CE.f;if(l)for(var h=l(p),w=EE.f,k=0,v;h.length>k;)w.call(p,v=h[k++])&&f.push(v);return f},SE=ny,DE=Array.isArray||function(f){return SE(f)=="Array"},dy={},$w={},jE=ry,IE=Rw.concat("length","prototype");$w.f=Object.getOwnPropertyNames||function(f){return jE(f,IE)};var PE=wu,hy=$w.f,ME={}.toString,my=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],OE=function(p){try{return hy(p)}catch{return my.slice()}};dy.f=function(f){return my&&ME.call(f)=="[object Window]"?OE(f):hy(PE(f))};var Uw={},RE=Nh,VE=Ep,LE=wu,zE=jw,BE=Al,FE=ey,$_=Object.getOwnPropertyDescriptor;Uw.f=Zs?$_:function(f,l){if(f=LE(f),l=zE(l,!0),FE)try{return $_(f,l)}catch{}if(BE(f,l))return VE(!RE.f.call(f,l),f[l])};var Mp=El,Gn=Al,aw=Zs,po=vu,U_=sy,qE=yE.KEY,Ww=xh,Kw=Mw,Gw=Bw,HE=Ap,Th=ku,$E=Ip,UE=Hw,WE=AE,KE=DE,lw=yh,GE=gu,QE=Vw,Op=wu,Qw=jw,cw=Ep,kh=zw,fy=dy,py=Uw,Rp=Dp,gy=Js,YE=Sp,by=py.f,yl=gy.f,vy=fy.f,Uo=Mp.Symbol,yp=Mp.JSON,dp=yp&&yp.stringify,Ys="prototype",Ho=Th("_hidden"),W_=Th("toPrimitive"),XE={}.propertyIsEnumerable,uh=Kw("symbol-registry"),hs=Kw("symbols"),Ch=Kw("op-symbols"),Pi=Object[Ys],_u=typeof Uo=="function"&&!!Rp.f,$v=Mp.QObject,uw=!$v||!$v[Ys]||!$v[Ys].findChild,dw=aw&&Ww(function(){return kh(yl({},"a",{get:function(){return yl(this,"a",{value:7}).a}})).a!=7})?function(p,f,l){var h=by(Pi,f);h&&delete Pi[f],yl(p,f,l),h&&p!==Pi&&yl(Pi,f,h)}:yl,K_=function(p){var f=hs[p]=kh(Uo[Ys]);return f._k=p,f},hw=_u&&typeof Uo.iterator=="symbol"?function(p){return typeof p=="symbol"}:function(p){return p instanceof Uo},Vp=function(f,l,h){return f===Pi&&Vp(Ch,l,h),lw(f),l=Qw(l,!0),lw(h),Gn(hs,l)?(h.enumerable?(Gn(f,Ho)&&f[Ho][l]&&(f[Ho][l]=!1),h=kh(h,{enumerable:cw(0,!1)})):(Gn(f,Ho)||yl(f,Ho,cw(1,{})),f[Ho][l]=!0),dw(f,l,h)):yl(f,l,h)},wy=function(f,l){lw(f);for(var h=WE(l=Op(l)),w=0,k=h.length,v;k>w;)Vp(f,v=h[w++],l[v]);return f},JE=function(f,l){return l===void 0?kh(f):wy(kh(f),l)},G_=function(f){var l=XE.call(this,f=Qw(f,!0));return this===Pi&&Gn(hs,f)&&!Gn(Ch,f)?!1:l||!Gn(this,f)||!Gn(hs,f)||Gn(this,Ho)&&this[Ho][f]?l:!0},ky=function(f,l){if(f=Op(f),l=Qw(l,!0),!(f===Pi&&Gn(hs,l)&&!Gn(Ch,l))){var h=by(f,l);return h&&Gn(hs,l)&&!(Gn(f,Ho)&&f[Ho][l])&&(h.enumerable=!0),h}},_y=function(f){for(var l=vy(Op(f)),h=[],w=0,k;l.length>w;)!Gn(hs,k=l[w++])&&k!=Ho&&k!=qE&&h.push(k);return h},yy=function(f){for(var l=f===Pi,h=vy(l?Ch:Op(f)),w=[],k=0,v;h.length>k;)Gn(hs,v=h[k++])&&(!l||Gn(Pi,v))&&w.push(hs[v]);return w};_u||(Uo=function(){if(this instanceof Uo)throw TypeError("Symbol is not a constructor!");var f=HE(arguments.length>0?arguments[0]:void 0),l=function(h){this===Pi&&l.call(Ch,h),Gn(this,Ho)&&Gn(this[Ho],f)&&(this[Ho][f]=!1),dw(this,f,cw(1,h))};return aw&&uw&&dw(Pi,f,{configurable:!0,set:l}),K_(f)},U_(Uo[Ys],"toString",function(){return this._k}),py.f=ky,gy.f=Vp,$w.f=fy.f=_y,Nh.f=G_,Rp.f=yy,aw&&!cC&&U_(Pi,"propertyIsEnumerable",G_),$E.f=function(p){return K_(Th(p))});po(po.G+po.W+po.F*!_u,{Symbol:Uo});for(var Q_="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),Y_=0;Q_.length>Y_;)Th(Q_[Y_++]);for(var X_=YE(Th.store),J_=0;X_.length>J_;)UE(X_[J_++]);po(po.S+po.F*!_u,"Symbol",{for:function(p){return Gn(uh,p+="")?uh[p]:uh[p]=Uo(p)},keyFor:function(f){if(!hw(f))throw TypeError(f+" is not a symbol!");for(var l in uh)if(uh[l]===f)return l},useSetter:function(){uw=!0},useSimple:function(){uw=!1}});po(po.S+po.F*!_u,"Object",{create:JE,defineProperty:Vp,defineProperties:wy,getOwnPropertyDescriptor:ky,getOwnPropertyNames:_y,getOwnPropertySymbols:yy});var ZE=Ww(function(){Rp.f(1)});po(po.S+po.F*ZE,"Object",{getOwnPropertySymbols:function(f){return Rp.f(QE(f))}});yp&&po(po.S+po.F*(!_u||Ww(function(){var p=Uo();return dp([p])!="[null]"||dp({a:p})!="{}"||dp(Object(p))!="{}"})),"JSON",{stringify:function(f){for(var l=[f],h=1,w,k;arguments.length>h;)l.push(arguments[h++]);if(k=w=l[1],!(!GE(w)&&f===void 0||hw(f)))return KE(w)||(w=function(v,N){if(typeof k=="function"&&(N=k.call(this,v,N)),!hw(N))return N}),l[1]=w,dp.apply(yp,l)}});Uo[Ys][W_]||bu(Uo[Ys],W_,Uo[Ys].valueOf);Gw(Uo,"Symbol");Gw(Math,"Math",!0);Gw(Mp.JSON,"JSON",!0);Hw("asyncIterator");Hw("observable");var eA=Xs.Symbol,tA={default:eA,__esModule:!0};jp.__esModule=!0;var nA=mE,xy=Ny(nA),oA=tA,Qs=Ny(oA),Uv=typeof Qs.default=="function"&&typeof xy.default=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Qs.default=="function"&&p.constructor===Qs.default&&p!==Qs.default.prototype?"symbol":typeof p};function Ny(p){return p&&p.__esModule?p:{default:p}}jp.default=typeof Qs.default=="function"&&Uv(xy.default)==="symbol"?function(p){return typeof p>"u"?"undefined":Uv(p)}:function(p){return p&&typeof Qs.default=="function"&&p.constructor===Qs.default&&p!==Qs.default.prototype?"symbol":typeof p>"u"?"undefined":Uv(p)};var iA=jp,rA=sA(iA);function sA(p){return p&&p.__esModule?p:{default:p}}var aA=function(p,f){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f&&((typeof f>"u"?"undefined":(0,rA.default)(f))==="object"||typeof f=="function")?f:p},Wv,Z_;function lA(){if(Z_)return Wv;Z_=1;var p=gu,f=yh,l=function(h,w){if(f(h),!p(w)&&w!==null)throw TypeError(w+": can't set as prototype!")};return Wv={set:Object.setPrototypeOf||("__proto__"in{}?function(h,w,k){try{k=J0(Function.call,Uw.f(Object.prototype,"__proto__").set,2),k(h,[]),w=!(h instanceof Array)}catch{w=!0}return function(N,S){return l(N,S),w?N.__proto__=S:k(N,S),N}}({},!1):void 0),check:l},Wv}var e0=vu;e0(e0.S,"Object",{setPrototypeOf:lA().set});var cA=Xs.Object.setPrototypeOf,uA={default:cA,__esModule:!0},t0=vu;t0(t0.S,"Object",{create:zw});var dA=Xs.Object,hA=function(f,l){return dA.create(f,l)},mA={default:hA,__esModule:!0},fA=uA,n0=Yw(fA),pA=mA,gA=Yw(pA),bA=jp,vA=Yw(bA);function Yw(p){return p&&p.__esModule?p:{default:p}}var wA=function(p,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+(typeof f>"u"?"undefined":(0,vA.default)(f)));p.prototype=(0,gA.default)(f&&f.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),f&&(n0.default?(0,n0.default)(p,f):p.__proto__=f)};function kA(p){return p instanceof HTMLElement?p:Mx.findDOMNode(p)}var Lp={exports:{}},vh={exports:{}};(function(){var p,f,l,h,w,k;typeof performance<"u"&&performance!==null&&performance.now?vh.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(vh.exports=function(){return(p()-w)/1e6},f=process.hrtime,p=function(){var v;return v=f(),v[0]*1e9+v[1]},h=p(),k=process.uptime()*1e9,w=h-k):Date.now?(vh.exports=function(){return Date.now()-l},l=Date.now()):(vh.exports=function(){return new Date().getTime()-l},l=new Date().getTime())}).call(an);var _A=vh.exports,yA=_A,ds=typeof window>"u"?an:window,hp=["moz","webkit"],cu="AnimationFrame",mu=ds["request"+cu],_h=ds["cancel"+cu]||ds["cancelRequest"+cu];for(var dh=0;!mu&&dh<hp.length;dh++)mu=ds[hp[dh]+"Request"+cu],_h=ds[hp[dh]+"Cancel"+cu]||ds[hp[dh]+"CancelRequest"+cu];if(!mu||!_h){var Kv=0,o0=0,_l=[],xA=1e3/60;mu=function(p){if(_l.length===0){var f=yA(),l=Math.max(0,xA-(f-Kv));Kv=l+f,setTimeout(function(){var h=_l.slice(0);_l.length=0;for(var w=0;w<h.length;w++)if(!h[w].cancelled)try{h[w].callback(Kv)}catch(k){setTimeout(function(){throw k},0)}},Math.round(l))}return _l.push({handle:++o0,callback:p,cancelled:!1}),o0},_h=function(p){for(var f=0;f<_l.length;f++)_l[f].handle===p&&(_l[f].cancelled=!0)}}Lp.exports=function(p){return mu.call(ds,p)};Lp.exports.cancel=function(){_h.apply(ds,arguments)};Lp.exports.polyfill=function(p){p||(p=ds),p.requestAnimationFrame=mu,p.cancelAnimationFrame=_h};var NA=Lp.exports;const i0=Tp(NA);var Ty=!!(typeof window<"u"&&window.document&&window.document.createElement);function r0(p,f){var l={};return l[p.toLowerCase()]=f.toLowerCase(),l["Webkit"+p]="webkit"+f,l["Moz"+p]="moz"+f,l["ms"+p]="MS"+f,l["O"+p]="o"+f.toLowerCase(),l}function TA(p,f){var l={animationend:r0("Animation","AnimationEnd"),transitionend:r0("Transition","TransitionEnd")};return p&&("AnimationEvent"in f||delete l.animationend.animation,"TransitionEvent"in f||delete l.transitionend.transition),l}var CA=TA(Ty,typeof window<"u"?window:{}),Cy={};Ty&&(Cy=document.createElement("div").style);var mp={};function Ey(p){if(mp[p])return mp[p];var f=CA[p];if(f)for(var l=Object.keys(f),h=l.length,w=0;w<h;w+=1){var k=l[w];if(Object.prototype.hasOwnProperty.call(f,k)&&k in Cy)return mp[p]=f[k],mp[p]}return""}var mw=Ey("animationend"),fw=Ey("transitionend"),EA=!!(mw&&fw);function s0(p,f){if(!p)return null;if(typeof p=="object"){var l=f.replace(/-\w/g,function(h){return h[1].toUpperCase()});return p[l]}return p+"-"+f}var Gs="none",hh="appear",mh="enter",fh="leave",AA={eventProps:G.object,visible:G.bool,children:G.func,motionName:G.oneOfType([G.string,G.object]),motionAppear:G.bool,motionEnter:G.bool,motionLeave:G.bool,motionLeaveImmediately:G.bool,motionDeadline:G.number,removeOnLeave:G.bool,leavedClassName:G.string,onAppearStart:G.func,onAppearActive:G.func,onAppearEnd:G.func,onEnterStart:G.func,onEnterActive:G.func,onEnterEnd:G.func,onLeaveStart:G.func,onLeaveActive:G.func,onLeaveEnd:G.func};function SA(p){var f=p,l=!!Ii.forwardRef;typeof p=="object"&&(f=p.transitionSupport,l="forwardRef"in p?p.forwardRef:l);function h(k){return!!(k.motionName&&f)}var w=function(k){wA(v,k);function v(){CC(this,v);var N=aA(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return N.onDomUpdate=function(){var S=N.state,O=S.status,C=S.newStatus,L=N.props,j=L.onAppearStart,F=L.onEnterStart,q=L.onLeaveStart,K=L.onAppearActive,te=L.onEnterActive,se=L.onLeaveActive,Z=L.motionAppear,Y=L.motionEnter,oe=L.motionLeave;if(h(N.props)){var ie=N.getElement();N.$cacheEle!==ie&&(N.removeEventListener(N.$cacheEle),N.addEventListener(ie),N.$cacheEle=ie),C&&O===hh&&Z?N.updateStatus(j,null,null,function(){N.updateActiveStatus(K,hh)}):C&&O===mh&&Y?N.updateStatus(F,null,null,function(){N.updateActiveStatus(te,mh)}):C&&O===fh&&oe&&N.updateStatus(q,null,null,function(){N.updateActiveStatus(se,fh)})}},N.onMotionEnd=function(S){var O=N.state,C=O.status,L=O.statusActive,j=N.props,F=j.onAppearEnd,q=j.onEnterEnd,K=j.onLeaveEnd;C===hh&&L?N.updateStatus(F,{status:Gs},S):C===mh&&L?N.updateStatus(q,{status:Gs},S):C===fh&&L&&N.updateStatus(K,{status:Gs},S)},N.setNodeRef=function(S){var O=N.props.internalRef;N.node=S,typeof O=="function"?O(S):O&&"current"in O&&(O.current=S)},N.getElement=function(){try{return kA(N.node||N)}catch{return N.$cacheEle}},N.addEventListener=function(S){S&&(S.addEventListener(fw,N.onMotionEnd),S.addEventListener(mw,N.onMotionEnd))},N.removeEventListener=function(S){S&&(S.removeEventListener(fw,N.onMotionEnd),S.removeEventListener(mw,N.onMotionEnd))},N.updateStatus=function(S,O,C,L){var j=S?S(N.getElement(),C):null;if(!(j===!1||N._destroyed)){var F=void 0;L&&(F=function(){N.nextFrame(L)}),N.setState(su({statusStyle:typeof j=="object"?j:null,newStatus:!1},O),F)}},N.updateActiveStatus=function(S,O){N.nextFrame(function(){var C=N.state.status;if(C===O){var L=N.props.motionDeadline;N.updateStatus(S,{statusActive:!0}),L>0&&setTimeout(function(){N.onMotionEnd({deadline:!0})},L)}})},N.nextFrame=function(S){N.cancelNextFrame(),N.raf=i0(S)},N.cancelNextFrame=function(){N.raf&&(i0.cancel(N.raf),N.raf=null)},N.state={status:Gs,statusActive:!1,newStatus:!1,statusStyle:null},N.$cacheEle=null,N.node=null,N.raf=null,N}return DC(v,[{key:"componentDidMount",value:function(){this.onDomUpdate()}},{key:"componentDidUpdate",value:function(){this.onDomUpdate()}},{key:"componentWillUnmount",value:function(){this._destroyed=!0,this.removeEventListener(this.$cacheEle),this.cancelNextFrame()}},{key:"render",value:function(){var S,O=this.state,C=O.status,L=O.statusActive,j=O.statusStyle,F=this.props,q=F.children,K=F.motionName,te=F.visible,se=F.removeOnLeave,Z=F.leavedClassName,Y=F.eventProps;return q?C===Gs||!h(this.props)?te?q(su({},Y),this.setNodeRef):se?null:q(su({},Y,{className:Z}),this.setNodeRef):q(su({},Y,{className:Tr((S={},Pv(S,s0(K,C),C!==Gs),Pv(S,s0(K,C+"-active"),C!==Gs&&L),Pv(S,K,typeof K=="string"),S)),style:j}),this.setNodeRef):null}}],[{key:"getDerivedStateFromProps",value:function(S,O){var C=O.prevProps,L=O.status;if(!h(S))return{};var j=S.visible,F=S.motionAppear,q=S.motionEnter,K=S.motionLeave,te=S.motionLeaveImmediately,se={prevProps:S};return(L===hh&&!F||L===mh&&!q||L===fh&&!K)&&(se.status=Gs,se.statusActive=!1,se.newStatus=!1),!C&&j&&F&&(se.status=hh,se.statusActive=!1,se.newStatus=!0),C&&!C.visible&&j&&q&&(se.status=mh,se.statusActive=!1,se.newStatus=!0),(C&&C.visible&&!j&&K||!C&&te&&!j&&K)&&(se.status=fh,se.statusActive=!1,se.newStatus=!0),se}}]),v}(Ii.Component);return w.propTypes=su({},AA,{internalRef:G.oneOfType([G.object,G.func])}),w.defaultProps={visible:!0,motionEnter:!0,motionAppear:!0,motionLeave:!0,removeOnLeave:!0},Dw(w),l?Ii.forwardRef(function(k,v){return Ii.createElement(w,su({internalRef:v},k))}):w}const DA=SA(EA);function vp(p){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?vp=function(l){return typeof l}:vp=function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},vp(p)}function jA(p,f){if(p==null)return{};var l=IA(p,f),h,w;if(Object.getOwnPropertySymbols){var k=Object.getOwnPropertySymbols(p);for(w=0;w<k.length;w++)h=k[w],!(f.indexOf(h)>=0)&&Object.prototype.propertyIsEnumerable.call(p,h)&&(l[h]=p[h])}return l}function IA(p,f){if(p==null)return{};var l={},h=Object.keys(p),w,k;for(k=0;k<h.length;k++)w=h[k],!(f.indexOf(w)>=0)&&(l[w]=p[w]);return l}function a0(p,f){var l=Object.keys(p);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(p);f&&(h=h.filter(function(w){return Object.getOwnPropertyDescriptor(p,w).enumerable})),l.push.apply(l,h)}return l}function l0(p){for(var f=1;f<arguments.length;f++){var l=arguments[f]!=null?arguments[f]:{};f%2?a0(l,!0).forEach(function(h){nr(p,h,l[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(l)):a0(l).forEach(function(h){Object.defineProperty(p,h,Object.getOwnPropertyDescriptor(l,h))})}return p}function nr(p,f,l){return f in p?Object.defineProperty(p,f,{value:l,enumerable:!0,configurable:!0,writable:!0}):p[f]=l,p}function PA(p,f){if(!(p instanceof f))throw new TypeError("Cannot call a class as a function")}function c0(p,f){for(var l=0;l<f.length;l++){var h=f[l];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(p,h.key,h)}}function MA(p,f,l){return f&&c0(p.prototype,f),l&&c0(p,l),p}function OA(p,f){return f&&(vp(f)==="object"||typeof f=="function")?f:mo(p)}function pw(p){return pw=Object.setPrototypeOf?Object.getPrototypeOf:function(l){return l.__proto__||Object.getPrototypeOf(l)},pw(p)}function mo(p){if(p===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p}function RA(p,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function");p.prototype=Object.create(f&&f.prototype,{constructor:{value:p,writable:!0,configurable:!0}}),f&&gw(p,f)}function gw(p,f){return gw=Object.setPrototypeOf||function(h,w){return h.__proto__=w,h},gw(p,f)}var u0="open",d0="close",VA="---",Xw=function(p){RA(f,p);function f(){var l;return PA(this,f),l=OA(this,pw(f).apply(this,arguments)),l.state={dragNodeHighlight:!1},l.onSelectorClick=function(h){var w=l.props.context.onNodeClick;w(h,mo(l)),l.isSelectable()?l.onSelect(h):l.onCheck(h)},l.onSelectorDoubleClick=function(h){var w=l.props.context.onNodeDoubleClick;w(h,mo(l))},l.onSelect=function(h){if(!l.isDisabled()){var w=l.props.context.onNodeSelect;h.preventDefault(),w(h,mo(l))}},l.onCheck=function(h){if(!l.isDisabled()){var w=l.props,k=w.disableCheckbox,v=w.checked,N=l.props.context.onNodeCheck;if(!(!l.isCheckable()||k)){h.preventDefault();var S=!v;N(h,mo(l),S)}}},l.onMouseEnter=function(h){var w=l.props.context.onNodeMouseEnter;w(h,mo(l))},l.onMouseLeave=function(h){var w=l.props.context.onNodeMouseLeave;w(h,mo(l))},l.onContextMenu=function(h){var w=l.props.context.onNodeContextMenu;w(h,mo(l))},l.onDragStart=function(h){var w=l.props.context.onNodeDragStart;h.stopPropagation(),l.setState({dragNodeHighlight:!0}),w(h,mo(l));try{h.dataTransfer.setData("text/plain","")}catch{}},l.onDragEnter=function(h){var w=l.props.context.onNodeDragEnter;h.preventDefault(),h.stopPropagation(),w(h,mo(l))},l.onDragOver=function(h){var w=l.props.context.onNodeDragOver;h.preventDefault(),h.stopPropagation(),w(h,mo(l))},l.onDragLeave=function(h){var w=l.props.context.onNodeDragLeave;h.stopPropagation(),w(h,mo(l))},l.onDragEnd=function(h){var w=l.props.context.onNodeDragEnd;h.stopPropagation(),l.setState({dragNodeHighlight:!1}),w(h,mo(l))},l.onDrop=function(h){var w=l.props.context.onNodeDrop;h.preventDefault(),h.stopPropagation(),l.setState({dragNodeHighlight:!1}),w(h,mo(l))},l.onExpand=function(h){var w=l.props.context.onNodeExpand;w(h,mo(l))},l.setSelectHandle=function(h){l.selectHandle=h},l.getNodeChildren=function(){var h=l.props.children,w=hu(h).filter(function(v){return v}),k=Dy(w);return w.length!==k.length&&Ay(),k},l.getNodeState=function(){var h=l.props.expanded;return l.isLeaf()?null:h?u0:d0},l.isLeaf=function(){var h=l.props,w=h.isLeaf,k=h.loaded,v=l.props.context.loadData,N=l.getNodeChildren().length!==0;return w===!1?!1:w||!v&&!N||v&&k&&!N},l.isDisabled=function(){var h=l.props.disabled,w=l.props.context.disabled;return h===!1?!1:!!(w||h)},l.isCheckable=function(){var h=l.props.checkable,w=l.props.context.checkable;return!w||h===!1?!1:w},l.syncLoadData=function(h){var w=h.expanded,k=h.loading,v=h.loaded,N=l.props.context,S=N.loadData,O=N.onNodeLoad;if(!k&&S&&w&&!l.isLeaf()){var C=l.getNodeChildren().length!==0;!C&&!v&&O(mo(l))}},l.renderSwitcher=function(){var h=l.props,w=h.expanded,k=h.switcherIcon,v=l.props.context,N=v.prefixCls,S=v.switcherIcon,O=k||S;if(l.isLeaf())return U.createElement("span",{className:Tr("".concat(N,"-switcher"),"".concat(N,"-switcher-noop"))},typeof O=="function"?O(l0({},l.props,{isLeaf:!0})):O);var C=Tr("".concat(N,"-switcher"),"".concat(N,"-switcher_").concat(w?u0:d0));return U.createElement("span",{onClick:l.onExpand,className:C},typeof O=="function"?O(l0({},l.props,{isLeaf:!1})):O)},l.renderCheckbox=function(){var h=l.props,w=h.checked,k=h.halfChecked,v=h.disableCheckbox,N=l.props.context.prefixCls,S=l.isDisabled(),O=l.isCheckable();if(!O)return null;var C=typeof O!="boolean"?O:null;return U.createElement("span",{className:Tr("".concat(N,"-checkbox"),w&&"".concat(N,"-checkbox-checked"),!w&&k&&"".concat(N,"-checkbox-indeterminate"),(S||v)&&"".concat(N,"-checkbox-disabled")),onClick:l.onCheck},C)},l.renderIcon=function(){var h=l.props.loading,w=l.props.context.prefixCls;return U.createElement("span",{className:Tr("".concat(w,"-iconEle"),"".concat(w,"-icon__").concat(l.getNodeState()||"docu"),h&&"".concat(w,"-icon_loading"))})},l.renderSelector=function(){var h=l.state.dragNodeHighlight,w=l.props,k=w.title,v=w.selected,N=w.icon,S=w.loading,O=l.props.context,C=O.prefixCls,L=O.showIcon,j=O.icon,F=O.draggable,q=O.loadData,K=l.isDisabled(),te="".concat(C,"-node-content-wrapper"),se;if(L){var Z=N||j;se=Z?U.createElement("span",{className:Tr("".concat(C,"-iconEle"),"".concat(C,"-icon__customize"))},typeof Z=="function"?Z(l.props):Z):l.renderIcon()}else q&&S&&(se=l.renderIcon());var Y=U.createElement("span",{className:"".concat(C,"-title")},k);return U.createElement("span",{ref:l.setSelectHandle,title:typeof k=="string"?k:"",className:Tr("".concat(te),"".concat(te,"-").concat(l.getNodeState()||"normal"),!K&&(v||h)&&"".concat(C,"-node-selected"),!K&&F&&"draggable"),draggable:!K&&F||void 0,"aria-grabbed":!K&&F||void 0,onMouseEnter:l.onMouseEnter,onMouseLeave:l.onMouseLeave,onContextMenu:l.onContextMenu,onClick:l.onSelectorClick,onDoubleClick:l.onSelectorDoubleClick,onDragStart:F?l.onDragStart:void 0},se,Y)},l.renderChildren=function(){var h=l.props,w=h.expanded,k=h.pos,v=l.props.context,N=v.prefixCls,S=v.motion,O=v.renderTreeNode,C=l.getNodeChildren();return C.length===0?null:U.createElement(DA,Object.assign({visible:w},S),function(L){var j=L.style,F=L.className;return U.createElement("ul",{className:Tr(F,"".concat(N,"-child-tree"),w&&"".concat(N,"-child-tree-open")),style:j,"data-expanded":w,role:"group"},Iy(C,function(q,K){return O(q,K,k)}))})},l}return MA(f,[{key:"componentDidMount",value:function(){var h=this.props,w=h.eventKey,k=h.context.registerTreeNode;this.syncLoadData(this.props),k(w,this)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"componentWillUnmount",value:function(){var h=this.props,w=h.eventKey,k=h.context.registerTreeNode;k(w,null)}},{key:"isSelectable",value:function(){var h=this.props.selectable,w=this.props.context.selectable;return typeof h=="boolean"?h:w}},{key:"render",value:function(){var h,w=this.props.loading,k=this.props,v=k.className,N=k.style,S=k.dragOver,O=k.dragOverGapTop,C=k.dragOverGapBottom,L=k.isLeaf,j=k.expanded,F=k.selected,q=k.checked,K=k.halfChecked,te=jA(k,["className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","expanded","selected","checked","halfChecked"]),se=this.props.context,Z=se.prefixCls,Y=se.filterTreeNode,oe=se.draggable,ie=this.isDisabled(),ge=My(te);return U.createElement("li",Object.assign({className:Tr(v,(h={},nr(h,"".concat(Z,"-treenode-disabled"),ie),nr(h,"".concat(Z,"-treenode-switcher-").concat(j?"open":"close"),!L),nr(h,"".concat(Z,"-treenode-checkbox-checked"),q),nr(h,"".concat(Z,"-treenode-checkbox-indeterminate"),K),nr(h,"".concat(Z,"-treenode-selected"),F),nr(h,"".concat(Z,"-treenode-loading"),w),nr(h,"drag-over",!ie&&S),nr(h,"drag-over-gap-top",!ie&&O),nr(h,"drag-over-gap-bottom",!ie&&C),nr(h,"filter-node",Y&&Y(this)),h)),style:N,role:"treeitem",onDragEnter:oe?this.onDragEnter:void 0,onDragOver:oe?this.onDragOver:void 0,onDragLeave:oe?this.onDragLeave:void 0,onDrop:oe?this.onDrop:void 0,onDragEnd:oe?this.onDragEnd:void 0},ge),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector(),this.renderChildren())}}]),f}(U.Component);Xw.propTypes={eventKey:G.string,prefixCls:G.string,className:G.string,style:G.object,onSelect:G.func,expanded:G.bool,selected:G.bool,checked:G.bool,loaded:G.bool,loading:G.bool,halfChecked:G.bool,children:G.node,title:G.node,pos:G.string,dragOver:G.bool,dragOverGapTop:G.bool,dragOverGapBottom:G.bool,isLeaf:G.bool,checkable:G.bool,selectable:G.bool,disabled:G.bool,disableCheckbox:G.bool,icon:G.oneOfType([G.node,G.func]),switcherIcon:G.oneOfType([G.node,G.func])};Dw(Xw);var Jw=function(f){return U.createElement(Q0.Consumer,null,function(l){return U.createElement(Xw,Object.assign({},f,{context:l}))})};Jw.defaultProps={title:VA};Jw.isTreeNode=1;const zp=Jw;function wp(p){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?wp=function(l){return typeof l}:wp=function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},wp(p)}function LA(p,f){if(p==null)return{};var l=zA(p,f),h,w;if(Object.getOwnPropertySymbols){var k=Object.getOwnPropertySymbols(p);for(w=0;w<k.length;w++)h=k[w],!(f.indexOf(h)>=0)&&Object.prototype.propertyIsEnumerable.call(p,h)&&(l[h]=p[h])}return l}function zA(p,f){if(p==null)return{};var l={},h=Object.keys(p),w,k;for(k=0;k<h.length;k++)w=h[k],!(f.indexOf(w)>=0)&&(l[w]=p[w]);return l}var BA=.25,FA=2,h0=!1;function Ay(){h0||(h0=!0,wh(!1,"Tree only accept TreeNode as children."))}function au(p,f){var l=p.slice(),h=l.indexOf(f);return h>=0&&l.splice(h,1),l}function lu(p,f){var l=p.slice();return l.indexOf(f)===-1&&l.push(f),l}function qA(p){return p.split("-")}function Sy(p,f){return"".concat(p,"-").concat(f)}function HA(p){return p&&p.type&&p.type.isTreeNode}function Dy(p){return hu(p).filter(HA)}function ph(p){var f=p.props||{},l=f.disabled,h=f.disableCheckbox,w=f.checkable;return!!(l||h)||w===!1}function jy(p,f){function l(h,w,k){var v=h?h.props.children:p,N=h?Sy(k.pos,w):0,S=Dy(v);if(h){var O={node:h,index:w,pos:N,key:h.key||N,parentPos:k.node?k.pos:null};f(O)}U.Children.forEach(S,function(C,L){l(C,L,{node:h,pos:N})})}l(null)}function Iy(p,f){var l=hu(p).map(f);return l.length===1?l[0]:l}function $A(p,f){var l=f.props,h=l.eventKey,w=l.pos,k=[];return jy(p,function(v){var N=v.key;k.push(N)}),k.push(h||w),k}function m0(p,f){var l=p.clientY,h=f.selectHandle.getBoundingClientRect(),w=h.top,k=h.bottom,v=h.height,N=Math.max(v*BA,FA);return l<=w+N?-1:l>=k-N?1:0}function f0(p,f){if(p){var l=f.multiple;return l?p.slice():p.length?[p[0]]:p}}function p0(p){return p&&p.map(function(f){return String(f)})}var UA=function(f){return f};function Py(p,f){if(!p)return[];var l=f||{},h=l.processProps,w=h===void 0?UA:h,k=Array.isArray(p)?p:[p];return k.map(function(v){var N=v.children,S=LA(v,["children"]),O=Py(N,f);return Ii.createElement(zp,Object.assign({},w(S)),O)})}function WA(p){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=f.initWrapper,h=f.processEntity,w=f.onProcessFinished,k={},v={},N={posEntities:k,keyEntities:v};return l&&(N=l(N)||N),jy(p,function(S){var O=S.node,C=S.index,L=S.pos,j=S.key,F=S.parentPos,q={node:O,index:C,key:j,pos:L};k[L]=q,v[j]=q,q.parent=k[F],q.parent&&(q.parent.children=q.parent.children||[],q.parent.children.push(q)),h&&h(q,N)}),w&&w(N),N}function Gv(p){if(!p)return null;var f;if(Array.isArray(p))f={checkedKeys:p,halfCheckedKeys:void 0};else if(wp(p)==="object")f={checkedKeys:p.checked||void 0,halfCheckedKeys:p.halfChecked||void 0};else return wh(!1,"`checkedKeys` is not an array or an object"),null;return f.checkedKeys=p0(f.checkedKeys),f.halfCheckedKeys=p0(f.halfCheckedKeys),f}function g0(p,f,l){var h=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},w={},k={};(h.checkedKeys||[]).forEach(function(L){w[L]=!0}),(h.halfCheckedKeys||[]).forEach(function(L){k[L]=!0});function v(L){if(w[L]!==f){var j=l[L];if(j){var F=j.children,q=j.parent,K=j.node;if(!ph(K)){var te=!0,se=!1;(F||[]).filter(function(Z){return!ph(Z.node)}).forEach(function(Z){var Y=Z.key,oe=w[Y],ie=k[Y];(oe||ie)&&(se=!0),oe||(te=!1)}),f?w[L]=te:w[L]=!1,k[L]=se,q&&v(q.key)}}}}function N(L){if(w[L]!==f){var j=l[L];if(j){var F=j.children,q=j.node;ph(q)||(w[L]=f,(F||[]).forEach(function(K){N(K.key)}))}}}function S(L){var j=l[L];if(!j){wh(!1,"'".concat(L,"' does not exist in the tree."));return}var F=j.children,q=j.parent,K=j.node;w[L]=f,!ph(K)&&((F||[]).filter(function(te){return!ph(te.node)}).forEach(function(te){N(te.key)}),q&&v(q.key))}(p||[]).forEach(function(L){S(L)});var O=[],C=[];return Object.keys(w).forEach(function(L){w[L]&&O.push(L)}),Object.keys(k).forEach(function(L){!w[L]&&k[L]&&C.push(L)}),{checkedKeys:O,halfCheckedKeys:C}}function b0(p,f){var l={};function h(w){if(!l[w]){var k=f[w];if(k){l[w]=!0;var v=k.parent,N=k.node;N.props&&N.props.disabled||v&&h(v.key)}}}return(p||[]).forEach(function(w){h(w)}),Object.keys(l)}function My(p){return Object.keys(p).reduce(function(f,l){return(l.substr(0,5)==="data-"||l.substr(0,5)==="aria-")&&(f[l]=p[l]),f},{})}function kp(p){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?kp=function(l){return typeof l}:kp=function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},kp(p)}function KA(p,f,l){return f in p?Object.defineProperty(p,f,{value:l,enumerable:!0,configurable:!0,writable:!0}):p[f]=l,p}function GA(p,f){if(!(p instanceof f))throw new TypeError("Cannot call a class as a function")}function v0(p,f){for(var l=0;l<f.length;l++){var h=f[l];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(p,h.key,h)}}function QA(p,f,l){return f&&v0(p.prototype,f),l&&v0(p,l),p}function YA(p,f){return f&&(kp(f)==="object"||typeof f=="function")?f:XA(p)}function XA(p){if(p===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p}function bw(p){return bw=Object.setPrototypeOf?Object.getPrototypeOf:function(l){return l.__proto__||Object.getPrototypeOf(l)},bw(p)}function JA(p,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function");p.prototype=Object.create(f&&f.prototype,{constructor:{value:p,writable:!0,configurable:!0}}),f&&vw(p,f)}function vw(p,f){return vw=Object.setPrototypeOf||function(h,w){return h.__proto__=w,h},vw(p,f)}var Bp=function(p){JA(f,p);function f(){var l;return GA(this,f),l=YA(this,bw(f).apply(this,arguments)),l.domTreeNodes={},l.state={keyEntities:{},selectedKeys:[],checkedKeys:[],halfCheckedKeys:[],loadedKeys:[],loadingKeys:[],expandedKeys:[],dragNodesKeys:[],dragOverNodeKey:null,dropPosition:null,treeNode:[],prevProps:null},l.onNodeDragStart=function(h,w){var k=l.state.expandedKeys,v=l.props.onDragStart,N=w.props,S=N.eventKey,O=N.children;l.dragNode=w,l.setState({dragNodesKeys:$A(O,w),expandedKeys:au(k,S)}),v&&v({event:h,node:w})},l.onNodeDragEnter=function(h,w){var k=l.state.expandedKeys,v=l.props.onDragEnter,N=w.props,S=N.pos,O=N.eventKey;if(l.dragNode){var C=m0(h,w);if(l.dragNode.props.eventKey===O&&C===0){l.setState({dragOverNodeKey:"",dropPosition:null});return}setTimeout(function(){l.setState({dragOverNodeKey:O,dropPosition:C}),l.delayedDragEnterLogic||(l.delayedDragEnterLogic={}),Object.keys(l.delayedDragEnterLogic).forEach(function(L){clearTimeout(l.delayedDragEnterLogic[L])}),l.delayedDragEnterLogic[S]=window.setTimeout(function(){var L=lu(k,O);"expandedKeys"in l.props||l.setState({expandedKeys:L}),v&&v({event:h,node:w,expandedKeys:L})},400)},0)}},l.onNodeDragOver=function(h,w){var k=l.props.onDragOver,v=w.props.eventKey;if(l.dragNode&&v===l.state.dragOverNodeKey){var N=m0(h,w);if(N===l.state.dropPosition)return;l.setState({dropPosition:N})}k&&k({event:h,node:w})},l.onNodeDragLeave=function(h,w){var k=l.props.onDragLeave;l.setState({dragOverNodeKey:""}),k&&k({event:h,node:w})},l.onNodeDragEnd=function(h,w){var k=l.props.onDragEnd;l.setState({dragOverNodeKey:""}),k&&k({event:h,node:w}),l.dragNode=null},l.onNodeDrop=function(h,w){var k=l.state,v=k.dragNodesKeys,N=v===void 0?[]:v,S=k.dropPosition,O=l.props.onDrop,C=w.props,L=C.eventKey,j=C.pos;if(l.setState({dragOverNodeKey:""}),N.indexOf(L)!==-1){wh(!1,"Can not drop to dragNode(include it's children node)");return}var F=qA(j),q={event:h,node:w,dragNode:l.dragNode,dragNodesKeys:N.slice(),dropPosition:S+Number(F[F.length-1]),dropToGap:!1};S!==0&&(q.dropToGap=!0),O&&O(q),l.dragNode=null},l.onNodeClick=function(h,w){var k=l.props.onClick;k&&k(h,w)},l.onNodeDoubleClick=function(h,w){var k=l.props.onDoubleClick;k&&k(h,w)},l.onNodeSelect=function(h,w){var k=l.state.selectedKeys,v=l.state.keyEntities,N=l.props,S=N.onSelect,O=N.multiple,C=w.props,L=C.selected,j=C.eventKey,F=!L;F?O?k=lu(k,j):k=[j]:k=au(k,j);var q=k.map(function(K){var te=v[K];return te?te.node:null}).filter(function(K){return K});l.setUncontrolledState({selectedKeys:k}),S&&S(k,{event:"select",selected:F,node:w,selectedNodes:q,nativeEvent:h.nativeEvent})},l.onNodeCheck=function(h,w,k){var v=l.state,N=v.keyEntities,S=v.checkedKeys,O=v.halfCheckedKeys,C=l.props,L=C.checkStrictly,j=C.onCheck,F=w.props.eventKey,q,K={event:"check",node:w,checked:k,nativeEvent:h.nativeEvent};if(L){var te=k?lu(S,F):au(S,F),se=au(O,F);q={checked:te,halfChecked:se},K.checkedNodes=te.map(function(ie){return N[ie]}).filter(function(ie){return ie}).map(function(ie){return ie.node}),l.setUncontrolledState({checkedKeys:te})}else{var Z=g0([F],k,N,{checkedKeys:S,halfCheckedKeys:O}),Y=Z.checkedKeys,oe=Z.halfCheckedKeys;q=Y,K.checkedNodes=[],K.checkedNodesPositions=[],K.halfCheckedKeys=oe,Y.forEach(function(ie){var ge=N[ie];if(ge){var de=ge.node,je=ge.pos;K.checkedNodes.push(de),K.checkedNodesPositions.push({node:de,pos:je})}}),l.setUncontrolledState({checkedKeys:Y,halfCheckedKeys:oe})}j&&j(q,K)},l.onNodeLoad=function(h){return new Promise(function(w){l.setState(function(k){var v=k.loadedKeys,N=v===void 0?[]:v,S=k.loadingKeys,O=S===void 0?[]:S,C=l.props,L=C.loadData,j=C.onLoad,F=h.props.eventKey;if(!L||N.indexOf(F)!==-1||O.indexOf(F)!==-1)return{};var q=L(h);return q.then(function(){var K=l.state,te=K.loadedKeys,se=K.loadingKeys,Z=lu(te,F),Y=au(se,F);j&&j(Z,{event:"load",node:h}),l.setUncontrolledState({loadedKeys:Z}),l.setState({loadingKeys:Y}),w()}),{loadingKeys:lu(O,F)}})})},l.onNodeExpand=function(h,w){var k=l.state.expandedKeys,v=l.props,N=v.onExpand,S=v.loadData,O=w.props,C=O.eventKey,L=O.expanded,j=k.indexOf(C),F=!L;if(wh(L&&j!==-1||!L&&j===-1,"Expand state not sync with index check"),F?k=lu(k,C):k=au(k,C),l.setUncontrolledState({expandedKeys:k}),N&&N(k,{node:w,expanded:F,nativeEvent:h.nativeEvent}),F&&S){var q=l.onNodeLoad(w);return q?q.then(function(){l.setUncontrolledState({expandedKeys:k})}):null}return null},l.onNodeMouseEnter=function(h,w){var k=l.props.onMouseEnter;k&&k({event:h,node:w})},l.onNodeMouseLeave=function(h,w){var k=l.props.onMouseLeave;k&&k({event:h,node:w})},l.onNodeContextMenu=function(h,w){var k=l.props.onRightClick;k&&(h.preventDefault(),k({event:h,node:w}))},l.setUncontrolledState=function(h){var w=!1,k={};Object.keys(h).forEach(function(v){v in l.props||(w=!0,k[v]=h[v])}),w&&l.setState(k)},l.registerTreeNode=function(h,w){w?l.domTreeNodes[h]=w:delete l.domTreeNodes[h]},l.isKeyChecked=function(h){var w=l.state.checkedKeys,k=w===void 0?[]:w;return k.indexOf(h)!==-1},l.renderTreeNode=function(h,w){var k=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,v=l.state,N=v.keyEntities,S=v.expandedKeys,O=S===void 0?[]:S,C=v.selectedKeys,L=C===void 0?[]:C,j=v.halfCheckedKeys,F=j===void 0?[]:j,q=v.loadedKeys,K=q===void 0?[]:q,te=v.loadingKeys,se=te===void 0?[]:te,Z=v.dragOverNodeKey,Y=v.dropPosition,oe=Sy(k,w),ie=h.key||oe;return N[ie]?U.cloneElement(h,{key:ie,eventKey:ie,expanded:O.indexOf(ie)!==-1,selected:L.indexOf(ie)!==-1,loaded:K.indexOf(ie)!==-1,loading:se.indexOf(ie)!==-1,checked:l.isKeyChecked(ie),halfChecked:F.indexOf(ie)!==-1,pos:oe,dragOver:Z===ie&&Y===0,dragOverGapTop:Z===ie&&Y===-1,dragOverGapBottom:Z===ie&&Y===1}):(Ay(),null)},l}return QA(f,[{key:"render",value:function(){var h=this,w=this.state.treeNode,k=this.props,v=k.prefixCls,N=k.className,S=k.focusable,O=k.style,C=k.showLine,L=k.tabIndex,j=L===void 0?0:L,F=k.selectable,q=k.showIcon,K=k.icon,te=k.switcherIcon,se=k.draggable,Z=k.checkable,Y=k.checkStrictly,oe=k.disabled,ie=k.motion,ge=k.loadData,de=k.filterTreeNode,je=My(this.props);return S&&(je.tabIndex=j),U.createElement(Q0.Provider,{value:{prefixCls:v,selectable:F,showIcon:q,icon:K,switcherIcon:te,draggable:se,checkable:Z,checkStrictly:Y,disabled:oe,motion:ie,loadData:ge,filterTreeNode:de,renderTreeNode:this.renderTreeNode,isKeyChecked:this.isKeyChecked,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop,registerTreeNode:this.registerTreeNode}},U.createElement("ul",Object.assign({},je,{className:Tr(v,N,KA({},"".concat(v,"-show-line"),C)),style:O,role:"tree",unselectable:"on"}),Iy(w,function(Ie,Pe){return h.renderTreeNode(Ie,Pe)})))}}],[{key:"getDerivedStateFromProps",value:function(h,w){var k=w.prevProps,v={prevProps:h};function N(Z){return!k&&Z in h||k&&k[Z]!==h[Z]}var S=null;if(N("treeData")?S=Py(h.treeData):N("children")&&(S=hu(h.children)),S){v.treeNode=S;var O=WA(S);v.keyEntities=O.keyEntities}var C=v.keyEntities||w.keyEntities;if(N("expandedKeys")||k&&N("autoExpandParent")?v.expandedKeys=h.autoExpandParent||!k&&h.defaultExpandParent?b0(h.expandedKeys,C):h.expandedKeys:!k&&h.defaultExpandAll?v.expandedKeys=Object.keys(C):!k&&h.defaultExpandedKeys&&(v.expandedKeys=h.autoExpandParent||h.defaultExpandParent?b0(h.defaultExpandedKeys,C):h.defaultExpandedKeys),h.selectable&&(N("selectedKeys")?v.selectedKeys=f0(h.selectedKeys,h):!k&&h.defaultSelectedKeys&&(v.selectedKeys=f0(h.defaultSelectedKeys,h))),h.checkable){var L;if(N("checkedKeys")?L=Gv(h.checkedKeys)||{}:!k&&h.defaultCheckedKeys?L=Gv(h.defaultCheckedKeys)||{}:S&&(L=Gv(h.checkedKeys)||{checkedKeys:w.checkedKeys,halfCheckedKeys:w.halfCheckedKeys}),L){var j=L,F=j.checkedKeys,q=F===void 0?[]:F,K=j.halfCheckedKeys,te=K===void 0?[]:K;if(!h.checkStrictly){var se=g0(q,!0,C);q=se.checkedKeys,te=se.halfCheckedKeys}v.checkedKeys=q,v.halfCheckedKeys=te}}return N("loadedKeys")&&(v.loadedKeys=h.loadedKeys),v}}]),f}(U.Component);Bp.propTypes={prefixCls:G.string,className:G.string,style:G.object,tabIndex:G.oneOfType([G.string,G.number]),children:G.any,treeData:G.array,showLine:G.bool,showIcon:G.bool,icon:G.oneOfType([G.node,G.func]),focusable:G.bool,selectable:G.bool,disabled:G.bool,multiple:G.bool,checkable:G.oneOfType([G.bool,G.node]),checkStrictly:G.bool,draggable:G.bool,defaultExpandParent:G.bool,autoExpandParent:G.bool,defaultExpandAll:G.bool,defaultExpandedKeys:G.arrayOf(G.string),expandedKeys:G.arrayOf(G.string),defaultCheckedKeys:G.arrayOf(G.string),checkedKeys:G.oneOfType([G.arrayOf(G.oneOfType([G.string,G.number])),G.object]),defaultSelectedKeys:G.arrayOf(G.string),selectedKeys:G.arrayOf(G.string),onClick:G.func,onDoubleClick:G.func,onExpand:G.func,onCheck:G.func,onSelect:G.func,onLoad:G.func,loadData:G.func,loadedKeys:G.arrayOf(G.string),onMouseEnter:G.func,onMouseLeave:G.func,onRightClick:G.func,onDragStart:G.func,onDragEnter:G.func,onDragOver:G.func,onDragLeave:G.func,onDragEnd:G.func,onDrop:G.func,filterTreeNode:G.func,motion:G.object,switcherIcon:G.oneOfType([G.node,G.func])};Bp.defaultProps={prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[]};Dw(Bp);var Oy=Bp;Oy.TreeNode=zp;const ZA=Oy;const _D=yn.MaLoaiDonVi==="SoLaoDong",eS=yn.MaLoaiDonVi==="UBNDHuyen",yD=yn.MaLoaiDonVi==="PLDHuyen",tS=yn.MaLoaiDonVi==="UBNDXa";yn.MaQuanHuyen;yn.MaLoaiDonVi;yn.CoSoGDNN_Id;yn.MaLoaiDonVi;yn.TaiKhoanQuanTri;yn.IDDonVi;const xD=yn.CoSoGDNN_Id,Qv=si.span`
  cursor: pointer;
  &#add {
    color: #28a745;
  }
  &#update {
    color: #20a8d8;
  }
  &#delete {
    color: #dc3545;
  }
  &:hover {
    &#add {
      color: #1d8234;
      text-decoration: underline;
    }
    &#update {
      color: #1a7696;
      text-decoration: underline;
    }
    &#delete {
      color: #a22020;
      text-decoration: underline;
    }
  }
`,w0={Name:{field_name:"Name",title:"Tên",type:"textbox",required:!0},MaKiHieu:{field_name:"MaKiHieu",title:"Mã kí hiệu",type:"textbox"}},nS=si(zp)`
  .rc-tree-node-content-wrapper {
    white-space: nowrap;
    width: 780px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
`;function oS(p){const{dataSelect:f,valueDisplay:l,onClickButton:h,onCallback:w,Id:k,EndPoint_Tree:v,EndPoint_Odata:N,isDieu18:S}=p,{placeholder:O}=f,[C,L]=U.useState(!1),[j,F]=U.useState([]),[q,K]=U.useState({value:null,label:""}),[te,se]=U.useState(!1),[Z,Y]=U.useState(!1),[oe,ie]=U.useState(!0),[ge,de]=U.useState(!0),[je,Ie]=U.useState(!0),[Pe,ce]=U.useState(!0),[ae,be]=U.useState([]),[ke,_e]=U.useState({}),[Ee,Se]=U.useState({valueFake:null,labelFake:"",isFake:!0}),[Oe,rt]=U.useState({});U.useEffect(()=>rt({label:l}),[l]),U.useEffect(()=>{k&&K(we=>({...we,value:[`${k}`]}))},[k]);const De=U.useCallback(()=>{zt(v,"GET",null,{odata:!1}).then(Re=>F(Re)).catch(Re=>$o("Không thể tải dữ liệu danh mục nội dung","Thông báo"))},[v]);U.useEffect(()=>{De()},[De]);const Fe=U.useCallback(we=>{h&&h(),C?!k&&!we.isValue&&(K({}),ie(!0),de(!0),Ie(!0)):(F(j),be([])),L(!C)},[k,j,C,h]),mt=U.useMemo(()=>{const{label:we}=Oe;return x.jsxDEV(ww,{children:[x.jsxDEV(uu,{readOnly:!0,placeholder:O,value:we||""},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:148,columnNumber:9},this),x.jsxDEV(hn,{color:"primary",onClick:Fe,children:"Chọn"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:149,columnNumber:9},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:147,columnNumber:7},this)},[Fe,Oe,O]),Ne=U.useCallback((we,Re)=>{const{node:{props:{title:ct,isChildren:st}}}=Re;we.length!==0&&(Y(Re.selected),ie(!Re.selected),de(!Re.selected),Ie(!Re.selected),K({value:we,label:we.length?ct:""}),Se({isFake:!1}),ce(st))},[]),Le=U.useCallback(()=>{rt({value:q.value[0],label:q.label}),w({value:q.value[0],label:q.label}),Fe({isValue:q.value[0]})},[Fe,w,q]),qe=U.useCallback(we=>{we&&zt(`${N}(${we})`).then(Re=>_e(Re))},[N]),$e=U.useCallback(()=>{se(!1),_e({}),Se({})},[]),tt=U.useCallback(we=>{Np("Bạn có muốn xóa nguồn vốn này không").then(Re=>{Re&&Re.isConfirmed&&zt(`${N}(${we})`,"DELETE",null).then(()=>{De(),Cr("Xóa thành công","Thông báo"),$e(),w({})})})},[N,De,$e,w]);U.useCallback(we=>{const Re=yn.IDDonVi==="bccb8adf-7788-4ddc-9376-640a7f90cd29";return x.jsxDEV(U.Fragment,{children:[x.jsxDEV("span",{children:we.title},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:215,columnNumber:11},this),x.jsxDEV("span",{children:Re&&eS&&x.jsxDEV(x.Fragment,{children:[x.jsxDEV(Qv,{id:"add",onClick:()=>{se("addChildren"),Se(ct=>({...ct,valueFake:we.key,labelFake:we.title,isFake:!0}))},className:"ms-3",children:[x.jsxDEV(Xt,{fa:"plus-circle"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:227,columnNumber:19},this),x.jsxDEV("span",{className:"ms-1",children:"Thêm danh mục con"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:228,columnNumber:19},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:219,columnNumber:17},this),x.jsxDEV(Qv,{id:"update",onClick:()=>{se("update"),Se(ct=>({...ct,valueFake:we.key,labelFake:we.title,isFake:!0})),qe(we.key)},className:"ms-3",children:[x.jsxDEV(Xt,{fa:"pencil-square-o"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:239,columnNumber:19},this),x.jsxDEV("span",{className:"ms-1",children:"Cập nhật"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:240,columnNumber:19},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:230,columnNumber:17},this),we.children.length===0&&x.jsxDEV(Qv,{id:"delete",onClick:()=>{tt(we.key)},className:"ms-2",children:[x.jsxDEV(Xt,{fa:"times"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:250,columnNumber:21},this),x.jsxDEV("span",{className:"ms-1",children:"Xóa"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:251,columnNumber:21},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:243,columnNumber:19},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:218,columnNumber:15},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:216,columnNumber:11},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:214,columnNumber:9},this)},[qe,tt]);const nt=U.useCallback(we=>we.map(Re=>Re.children&&Re.children.length?x.jsxDEV(zp,{className:"parent",isChildren:!0,title:Re.title,children:nt(Re.children)},Re.key,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:268,columnNumber:13},this):x.jsxDEV(nS,{className:"children",isChildren:!1,title:Re.title},Re.key,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:273,columnNumber:16},this)),[]),Ue=U.useCallback(we=>{let Re=document.getElementById("value").value;we.type==="click"&&zt(`Dieu18Ext/GetTree_NguonVon?search=${Re}`,"GET",null,{odata:!1}).then(ct=>{be(ct)}),we.key==="Enter"||we.type==="click"?we.target.value?zt(`Dieu18Ext/GetTree_NguonVon?search=${we.target.value}`,"GET",null,{odata:!1}).then(ct=>{be(ct)}):be(j):we.target.value||be(j)},[j]),We=U.useMemo(()=>{const{value:we}=q;yn.IDDonVi;let Re=ae.length===0?j:ae;return x.jsxDEV(Sr,{size:"xl",isOpen:C,toggle:Fe,zIndex:1301,children:[x.jsxDEV(du,{className:"align-items-center pb-0",style:{borderBottom:"none"},children:x.jsxDEV("span",{children:"Thêm mới"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:313,columnNumber:11},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:312,columnNumber:9},this),x.jsxDEV(xl,{children:x.jsxDEV("div",{className:"module-tree h-100",children:[x.jsxDEV("div",{className:"module-tree-header",style:{border:"1px solid #ccc"},children:x.jsxDEV("div",{className:"d-flex justify-content-between align-items-center",children:[x.jsxDEV(x.Fragment,{children:x.jsxDEV("div",{children:[x.jsxDEV(hn,{disabled:oe,onClick:()=>se("addChildren"),children:"Thêm danh mục con"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:323,columnNumber:23},this),x.jsxDEV(hn,{disabled:ge,onClick:()=>{se("update"),qe(we[0])},children:"Cập nhật"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:326,columnNumber:23},this),x.jsxDEV(hn,{disabled:je,onClick:()=>tt(we[0]),style:{color:"red"},children:"Xóa"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:336,columnNumber:25},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:321,columnNumber:21},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:320,columnNumber:19},this),x.jsxDEV("div",{className:"me-1",children:x.jsxDEV(hn,{onClick:Le,disabled:!we||!we.length||Pe,size:"sm",color:"primary",children:[x.jsxDEV(Xt,{fa:"save"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:360,columnNumber:21},this),x.jsxDEV("span",{className:"ms-1",children:"Chọn"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:361,columnNumber:21},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:354,columnNumber:19},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:353,columnNumber:17},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:318,columnNumber:15},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:317,columnNumber:13},this),x.jsxDEV("div",{className:"module-tree-body pt-2 pb-2",style:{overflow:"auto",border:"1px solid #ccc",borderTop:0,height:"calc(100vh - 170px)"},children:[x.jsxDEV("div",{className:"pl-2 pr-2 d-flex align-items-center",children:[x.jsxDEV(uu,{onKeyPress:Ue,onChange:Ue,placeholder:"Tìm tên nguồn vốn...",id:"value"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:376,columnNumber:17},this),x.jsxDEV(iS,{onClick:ct=>Ue(ct),className:"w-25",children:"Tìm kiếm"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:382,columnNumber:17},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:375,columnNumber:15},this),x.jsxDEV(ZA,{className:"myCls",showLine:!0,selectedKeys:we,onSelect:Ne,defaultExpandAll:!!k,defaultExpandedKeys:S&&["A","B"],children:nt(Re)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:386,columnNumber:15},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:366,columnNumber:13},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:316,columnNumber:11},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:315,columnNumber:9},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:311,columnNumber:7},this)},[q,ae,j,C,Fe,oe,ge,je,Le,Pe,Ue,Ne,k,S,nt,qe,tt]),et=U.useCallback((we,Re)=>{_e(ct=>({...ct,[we]:Re}))},[]),Ut=U.useCallback((we,Re)=>{const{Name:ct,MaKiHieu:st}=ke;if(ct&&st){let Bt=Re&&we==="update"?`${N}(${Re})`:N,xn=Re&&we==="update"?"PATCH":"POST",ln=Re&&we==="update"?"Cập nhật":"Thêm mới",jt={...ke,IsDM:!0};Re&&we==="addChildren"&&(jt={...jt,Parent_Id:Re,Created_By:yn.MaTaiKhoan}),!Re&&we==="add"&&(jt={...jt,IsFixed:!0}),Re&&we==="update"&&(jt={Name:ke.Name,MaKiHieu:ke.MaKiHieu}),zt(Bt,xn,JSON.stringify(jt),!0).then(Wo=>{De(),Cr(`${ln} thành công`,"Thông báo"),$e()}).catch(Wo=>$o(`${ln} không thành công`,"Thông báo"))}else Er("Vui lòng nhập đầy đủ vào thông tin có dấu sao đỏ")},[N,ke,De,$e]),en=U.useMemo(()=>{const{valueFake:we,labelFake:Re,isFake:ct}=Ee,st=te,Bt=ct?we:q&&q.value&&q.value.length?q.value[0]:null,xn=ct?Re:q?q.label:"";return x.jsxDEV(Sr,{isOpen:!!te,toggle:()=>$e(),size:"lg",zIndex:"1302",children:[x.jsxDEV(du,{children:x.jsxDEV("b",{children:Bt?"Cập nhật danh mục":"Thêm mới danh mục"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:475,columnNumber:11},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:474,columnNumber:9},this),x.jsxDEV(xl,{children:[Bt&&st==="addChildren"&&x.jsxDEV("h5",{children:['Thuộc danh mục "',xn,'"']},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:478,columnNumber:44},this),x.jsxDEV(Lt,{data:w0.Name,value:ke.Name,onChange:et},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:479,columnNumber:11},this),x.jsxDEV(Lt,{data:w0.MaKiHieu,value:ke.MaKiHieu,onChange:et},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:484,columnNumber:11},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:477,columnNumber:9},this),x.jsxDEV(_w,{children:[x.jsxDEV(I0,{onClick:()=>Ut(st,Bt),children:"Lưu"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:491,columnNumber:11},this)," ",x.jsxDEV(hn,{onClick:$e,children:"Hủy"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:492,columnNumber:11},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:490,columnNumber:9},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:473,columnNumber:7},this)},[te,q,ke,et,$e,Ut,Ee]);return x.jsxDEV(U.Fragment,{children:[mt,We,en]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:507,columnNumber:5},this)}const iS=si.span`
  text-align: center;
  border: 1px solid #ccc;
  height: 35px;
  line-height: 32px;
  background: #ccc;
  border-radius: 3px;
  margin-left: 10px;
  font-weight: bold;
  cursor: pointer;
`;/*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var rn=function(){return rn=Object.assign||function(f){for(var l,h=1,w=arguments.length;h<w;h++){l=arguments[h];for(var k in l)Object.prototype.hasOwnProperty.call(l,k)&&(f[k]=l[k])}return f},rn.apply(this,arguments)};function rS(p,f){var l={};for(var h in p)Object.prototype.hasOwnProperty.call(p,h)&&f.indexOf(h)<0&&(l[h]=p[h]);if(p!=null&&typeof Object.getOwnPropertySymbols=="function")for(var w=0,h=Object.getOwnPropertySymbols(p);w<h.length;w++)f.indexOf(h[w])<0&&Object.prototype.propertyIsEnumerable.call(p,h[w])&&(l[h[w]]=p[h[w]]);return l}function ri(p,f,l){if(l||arguments.length===2)for(var h=0,w=f.length,k;h<w;h++)(k||!(h in f))&&(k||(k=Array.prototype.slice.call(f,0,h)),k[h]=f[h]);return p.concat(k||f)}var Dr=function(p){return p.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")},sS={k:1e3,m:1e6,b:1e9},aS=function(p,f){f===void 0&&(f=".");var l=new RegExp("(\\d+("+Dr(f)+"\\d*)?)([kmb])$","i"),h=p.match(l);if(h){var w=h[1],k=h[3],v=sS[k.toLowerCase()];return Number(w.replace(f,"."))*v}},lS=function(p,f){f===void 0&&(f=",");var l=new RegExp(Dr(f),"g");return p.replace(l,"")},cS=function(p,f){var l=Dr(f.join("")),h=new RegExp("[^\\d"+l+"]","gi");return p.replace(h,"")},Yv=function(p){var f=p.value,l=p.groupSeparator,h=l===void 0?",":l,w=p.decimalSeparator,k=w===void 0?".":w,v=p.allowDecimals,N=v===void 0?!0:v,S=p.decimalsLimit,O=S===void 0?2:S,C=p.allowNegativeValue,L=C===void 0?!0:C,j=p.disableAbbreviations,F=j===void 0?!1:j,q=p.prefix,K=q===void 0?"":q,te=p.transformRawValue,se=te===void 0?function(De){return De}:te,Z=se(f);if(Z==="-")return Z;var Y=F?[]:["k","m","b"],oe=new RegExp("((^|\\D)-\\d)|(-"+Dr(K)+")"),ie=oe.test(Z),ge=RegExp("(\\d+)-?"+Dr(K)).exec(f)||[],de=ge[0],je=ge[1],Ie=K?de?Z.replace(de,"").concat(je):Z.replace(K,""):Z,Pe=lS(Ie,h),ce=cS(Pe,ri([h,k],Y)),ae=ce;if(!F){if(Y.some(function(De){return De===ce.toLowerCase()}))return"";var be=aS(ce,k);be&&(ae=String(be))}var ke=ie&&L?"-":"";if(k&&ae.includes(k)){var _e=ce.split(k),Ee=_e[0],Se=_e[1],Oe=O&&Se?Se.slice(0,O):Se,rt=N?""+k+Oe:"";return""+ke+Ee+rt}return""+ke+ae},uS=function(p,f,l){if(l&&p.length>1){if(p.includes(f)){var h=p.split(f),w=h[0],k=h[1];if(k.length>l)return""+w+f+k.slice(0,l)}var v=p.length>l?new RegExp("(\\d+)(\\d{"+l+"})"):new RegExp("(\\d)(\\d+)"),N=p.match(v);if(N){var w=N[1],k=N[2];return""+w+f+k}}return p},Ry=function(p,f){var l=f.groupSeparator,h=l===void 0?",":l,w=f.decimalSeparator,k=w===void 0?".":w,v=new RegExp("\\d([^"+Dr(h)+Dr(k)+"0-9]+)"),N=p.match(v);return N?N[1]:void 0},gh=function(p){var f=p.value,l=p.decimalSeparator,h=p.intlConfig,w=p.decimalScale,k=p.prefix,v=k===void 0?"":k,N=p.suffix,S=N===void 0?"":N;if(f===""||f===void 0)return"";if(f==="-")return"-";var O=new RegExp("^\\d?-"+(v?Dr(v)+"?":"")+"\\d").test(f),C=l!=="."?dS(f,l,O):f,L=h?new Intl.NumberFormat(h.locale,h.currency?{style:"currency",currency:h.currency,minimumFractionDigits:w||0,maximumFractionDigits:20}:void 0):new Intl.NumberFormat(void 0,{minimumFractionDigits:w||0,maximumFractionDigits:20}),j=L.formatToParts(Number(C)),F=hS(j,p),q=Ry(F,rn({},p)),K=f.slice(-1)===l?l:"",te=C.match(RegExp("\\d+\\.(\\d+)"))||[],se=te[1];return w===void 0&&se&&l&&(F.includes(l)?F=F.replace(RegExp("(\\d+)("+Dr(l)+")(\\d+)","g"),"$1$2"+se):q&&!S?F=F.replace(q,""+l+se+q):F=""+F+l+se),S&&K?""+F+K+S:q&&K?F.replace(q,""+K+q):q&&S?F.replace(q,""+K+S):[F,K,S].join("")},dS=function(p,f,l){var h=p;return f&&f!=="."&&(h=h.replace(RegExp(Dr(f),"g"),"."),l&&f==="-"&&(h="-"+h.slice(1))),h},hS=function(p,f){var l=f.prefix,h=f.groupSeparator,w=f.decimalSeparator,k=f.decimalScale,v=f.disableGroupSeparators,N=v===void 0?!1:v;return p.reduce(function(S,O,C){var L=O.type,j=O.value;return C===0&&l?L==="minusSign"?[j,l]:L==="currency"?ri(ri([],S),[l]):[l,j]:L==="currency"?l?S:ri(ri([],S),[j]):L==="group"?N?S:ri(ri([],S),[h!==void 0?h:j]):L==="decimal"?k!==void 0&&k===0?S:ri(ri([],S),[w!==void 0?w:j]):L==="fraction"?ri(ri([],S),[k!==void 0?j.slice(0,k):j]):ri(ri([],S),[j])},[""]).join("")},mS={currencySymbol:"",groupSeparator:"",decimalSeparator:"",prefix:"",suffix:""},fS=function(p){var f=p||{},l=f.locale,h=f.currency,w=l?new Intl.NumberFormat(l,h?{currency:h,style:"currency"}:void 0):new Intl.NumberFormat;return w.formatToParts(1000.1).reduce(function(k,v,N){return v.type==="currency"?N===0?rn(rn({},k),{currencySymbol:v.value,prefix:v.value}):rn(rn({},k),{currencySymbol:v.value,suffix:v.value}):v.type==="group"?rn(rn({},k),{groupSeparator:v.value}):v.type==="decimal"?rn(rn({},k),{decimalSeparator:v.value}):k},mS)},k0=function(p){return RegExp(/\d/,"gi").test(p)},pS=function(p,f,l){if(f===void 0&&(f="."),l===void 0||p===""||p===void 0)return p;if(!p.match(/\d/g))return"";var h=p.split(f),w=h[0],k=h[1];if(l===0)return w;var v=k||"";if(v.length<l)for(;v.length<l;)v+="0";else v=v.slice(0,l);return""+w+f+v},gS=function(p){var f=p.selectionStart,l=p.value,h=p.lastKeyStroke,w=p.stateValue,k=p.groupSeparator,v=f,N=l;if(w&&v){var S=l.split("");return h==="Backspace"&&w[v]===k&&(S.splice(v-1,1),v-=1),h==="Delete"&&w[v]===k&&(S.splice(v,1),v+=1),N=S.join(""),{modifiedValue:N,cursorPosition:v}}return{modifiedValue:N,cursorPosition:f}},Vy=U.forwardRef(function(p,f){var l=p.allowDecimals,h=l===void 0?!0:l,w=p.allowNegativeValue,k=w===void 0?!0:w,v=p.id,N=p.name,S=p.className,O=p.customInput,C=p.decimalsLimit,L=p.defaultValue,j=p.disabled,F=j===void 0?!1:j,q=p.maxLength,K=p.value,te=p.onValueChange,se=p.fixedDecimalLength,Z=p.placeholder,Y=p.decimalScale,oe=p.prefix,ie=p.suffix,ge=p.intlConfig,de=p.step,je=p.min,Ie=p.max,Pe=p.disableGroupSeparators,ce=Pe===void 0?!1:Pe,ae=p.disableAbbreviations,be=ae===void 0?!1:ae,ke=p.decimalSeparator,_e=p.groupSeparator,Ee=p.onChange,Se=p.onFocus,Oe=p.onBlur,rt=p.onKeyDown,De=p.onKeyUp,Fe=p.transformRawValue,mt=rS(p,["allowDecimals","allowNegativeValue","id","name","className","customInput","decimalsLimit","defaultValue","disabled","maxLength","value","onValueChange","fixedDecimalLength","placeholder","decimalScale","prefix","suffix","intlConfig","step","min","max","disableGroupSeparators","disableAbbreviations","decimalSeparator","groupSeparator","onChange","onFocus","onBlur","onKeyDown","onKeyUp","transformRawValue"]);if(ke&&k0(ke))throw new Error("decimalSeparator cannot be a number");if(_e&&k0(_e))throw new Error("groupSeparator cannot be a number");var Ne=U.useMemo(function(){return fS(ge)},[ge]),Le=ke||Ne.decimalSeparator||"",qe=_e||Ne.groupSeparator||"";if(Le&&qe&&Le===qe&&ce===!1)throw new Error("decimalSeparator cannot be the same as groupSeparator");var $e={decimalSeparator:Le,groupSeparator:qe,disableGroupSeparators:ce,intlConfig:ge,prefix:oe||Ne.prefix,suffix:ie},tt={decimalSeparator:Le,groupSeparator:qe,allowDecimals:h,decimalsLimit:C||se||2,allowNegativeValue:k,disableAbbreviations:be,prefix:oe||Ne.prefix,transformRawValue:Fe},nt=L!=null?gh(rn(rn({},$e),{decimalScale:Y,value:String(L)})):K!=null?gh(rn(rn({},$e),{decimalScale:Y,value:String(K)})):"",Ue=U.useState(nt),We=Ue[0],et=Ue[1],Ut=U.useState(!1),en=Ut[0],we=Ut[1],Re=U.useState(0),ct=Re[0],st=Re[1],Bt=U.useState(0),xn=Bt[0],ln=Bt[1],jt=U.useState(null),Wo=jt[0],or=jt[1],gn=f||U.useRef(null),ai=function(ft,Jt){we(!0);var mn=gS({selectionStart:Jt,value:ft,lastKeyStroke:Wo,stateValue:We,groupSeparator:qe}),bn=mn.modifiedValue,An=mn.cursorPosition,jn=Yv(rn({value:bn},tt));if(!(q&&jn.replace(/-/g,"").length>q)){if(jn===""||jn==="-"||jn===Le){te&&te(void 0,N,{float:null,formatted:"",value:""}),et(jn);return}var cn=parseFloat(jn.replace(Le,".")),Io=gh(rn({value:jn},$e));if(An!=null){var xt=An+(Io.length-ft.length);xt=xt<=0?oe?oe.length:0:xt,st(xt),ln(xn+1)}if(et(Io),te){var ci={float:cn,formatted:Io,value:jn};te(jn,N,ci)}}},ea=function(ft){var Jt=ft.target,mn=Jt.value,bn=Jt.selectionStart;ai(mn,bn),Ee&&Ee(ft)},li=function(ft){return Se&&Se(ft),We?We.length:0},go=function(ft){var Jt=ft.target.value,mn=Yv(rn({value:Jt},tt));if(mn==="-"||!mn){et(""),Oe&&Oe(ft);return}var bn=uS(mn,Le,se),An=pS(bn,Le,Y!==void 0?Y:se),jn=parseFloat(An.replace(Le,".")),cn=gh(rn(rn({},$e),{value:An}));te&&te(An,N,{float:jn,formatted:cn,value:An}),et(cn),Oe&&Oe(ft)},jr=function(ft){var Jt=ft.key;if(or(Jt),de&&(Jt==="ArrowUp"||Jt==="ArrowDown")){ft.preventDefault(),st(We.length);var mn=parseFloat(K!=null?String(K).replace(Le,"."):Yv(rn({value:We},tt)))||0,bn=Jt==="ArrowUp"?mn+de:mn-de;if(je!==void 0&&bn<je||Ie!==void 0&&bn>Ie)return;var An=String(de).includes(".")?Number(String(de).split(".")[1].length):void 0;ai(String(An?bn.toFixed(An):bn).replace(".",Le))}rt&&rt(ft)},Oi=function(ft){var Jt=ft.key,mn=ft.currentTarget.selectionStart;if(Jt!=="ArrowUp"&&Jt!=="ArrowDown"&&We!=="-"){var bn=Ry(We,{groupSeparator:qe,decimalSeparator:Le});if(bn&&mn&&mn>We.length-bn.length&&gn&&typeof gn=="object"&&gn.current){var An=We.length-bn.length;gn.current.setSelectionRange(An,An)}}De&&De(ft)};U.useEffect(function(){en&&We!=="-"&&gn&&typeof gn=="object"&&gn.current&&gn.current.setSelectionRange(ct,ct)},[We,ct,gn,en,xn]);var Ir=function(){return K!=null&&We!=="-"&&(!Le||We!==Le)?gh(rn(rn({},$e),{decimalScale:en?void 0:Y,value:String(K)})):We},Ri=rn({type:"text",inputMode:"decimal",id:v,name:N,className:S,onChange:ea,onBlur:go,onFocus:li,onKeyDown:jr,onKeyUp:Oi,placeholder:Z,disabled:F,value:Ir(),ref:gn},mt);if(O){var bo=O;return Ii.createElement(bo,rn({},Ri))}return Ii.createElement("input",rn({},Ri))});Vy.displayName="CurrencyInput";var Ly={},Zw={},ek={},Fp={};(function(p){Object.defineProperty(p,"__esModule",{value:!0}),p.Direction=void 0,function(f){f.Right="to right",f.Left="to left",f.Down="to bottom",f.Up="to top"}(p.Direction||(p.Direction={}))})(Fp);(function(p){var f=an&&an.__spreadArray||function(ce,ae,be){if(be||arguments.length===2)for(var ke=0,_e=ae.length,Ee;ke<_e;ke++)(Ee||!(ke in ae))&&(Ee||(Ee=Array.prototype.slice.call(ae,0,ke)),Ee[ke]=ae[ke]);return ce.concat(Ee||Array.prototype.slice.call(ae))};Object.defineProperty(p,"__esModule",{value:!0}),p.useThumbOverlap=p.assertUnreachable=p.voidFn=p.getTrackBackground=p.replaceAt=p.schd=p.translate=p.getClosestThumbIndex=p.translateThumbs=p.getPaddingAndBorder=p.getMargin=p.checkInitialOverlap=p.checkValuesAgainstBoundaries=p.checkBoundaries=p.isVertical=p.relativeValue=p.normalizeValue=p.isStepDivisible=p.isTouchEvent=p.getStepDecimals=void 0;var l=U,h=Fp,w=function(ce){var ae=ce.toString().split(".")[1];return ae?ae.length:0};p.getStepDecimals=w;function k(ce){return ce.touches&&ce.touches.length||ce.changedTouches&&ce.changedTouches.length}p.isTouchEvent=k;function v(ce,ae,be){var ke=(ae-ce)/be,_e=8,Ee=Number(ke.toFixed(_e));return parseInt(Ee.toString(),10)===Ee}p.isStepDivisible=v;function N(ce,ae,be,ke,_e,Ee,Se){var Oe=1e11;if(ce=Math.round(ce*Oe)/Oe,!Ee){var rt=Se[ae-1],De=Se[ae+1];if(rt&&rt>ce)return rt;if(De&&De<ce)return De}if(ce>ke)return ke;if(ce<be)return be;var Fe=Math.floor(ce*Oe-be*Oe)%Math.floor(_e*Oe),mt=Math.floor(ce*Oe-Math.abs(Fe)),Ne=Fe===0?ce:mt/Oe,Le=Math.abs(Fe/Oe)<_e/2?Ne:Ne+_e,qe=(0,p.getStepDecimals)(_e);return parseFloat(Le.toFixed(qe))}p.normalizeValue=N;function S(ce,ae,be){return(ce-ae)/(be-ae)}p.relativeValue=S;function O(ce){return ce===h.Direction.Up||ce===h.Direction.Down}p.isVertical=O;function C(ce,ae,be){if(ae>=be)throw new RangeError("min (".concat(ae,") is equal/bigger than max (").concat(be,")"));if(ce<ae)throw new RangeError("value (".concat(ce,") is smaller than min (").concat(ae,")"));if(ce>be)throw new RangeError("value (".concat(ce,") is bigger than max (").concat(be,")"))}p.checkBoundaries=C;function L(ce,ae,be){return ce<ae?ae:ce>be?be:ce}p.checkValuesAgainstBoundaries=L;function j(ce){if(!(ce.length<2)&&!ce.slice(1).every(function(ae,be){return ce[be]<=ae}))throw new RangeError("values={[".concat(ce,"]} needs to be sorted when allowOverlap={false}"))}p.checkInitialOverlap=j;function F(ce){var ae=window.getComputedStyle(ce);return{top:parseInt(ae["margin-top"],10),bottom:parseInt(ae["margin-bottom"],10),left:parseInt(ae["margin-left"],10),right:parseInt(ae["margin-right"],10)}}p.getMargin=F;function q(ce){var ae=window.getComputedStyle(ce);return{top:parseInt(ae["padding-top"],10)+parseInt(ae["border-top-width"],10),bottom:parseInt(ae["padding-bottom"],10)+parseInt(ae["border-bottom-width"],10),left:parseInt(ae["padding-left"],10)+parseInt(ae["border-left-width"],10),right:parseInt(ae["padding-right"],10)+parseInt(ae["border-right-width"],10)}}p.getPaddingAndBorder=q;function K(ce,ae,be){var ke=be?-1:1;ce.forEach(function(_e,Ee){return se(_e,ke*ae[Ee].x,ae[Ee].y)})}p.translateThumbs=K;function te(ce,ae,be,ke){for(var _e=0,Ee=Pe(ce[0],ae,be,ke),Se=1;Se<ce.length;Se++){var Oe=Pe(ce[Se],ae,be,ke);Oe<Ee&&(Ee=Oe,_e=Se)}return _e}p.getClosestThumbIndex=te;function se(ce,ae,be){ce.style.transform="translate(".concat(ae,"px, ").concat(be,"px)")}p.translate=se;var Z=function(ce){var ae=[],be=null,ke=function(){for(var _e=[],Ee=0;Ee<arguments.length;Ee++)_e[Ee]=arguments[Ee];ae=_e,!be&&(be=requestAnimationFrame(function(){be=null,ce.apply(void 0,ae)}))};return ke};p.schd=Z;function Y(ce,ae,be){var ke=ce.slice(0);return ke[ae]=be,ke}p.replaceAt=Y;function oe(ce){var ae=ce.values,be=ce.colors,ke=ce.min,_e=ce.max,Ee=ce.direction,Se=Ee===void 0?h.Direction.Right:Ee,Oe=ce.rtl,rt=Oe===void 0?!1:Oe;rt&&Se===h.Direction.Right?Se=h.Direction.Left:rt&&h.Direction.Left&&(Se=h.Direction.Right);var De=ae.slice(0).sort(function(mt,Ne){return mt-Ne}).map(function(mt){return(mt-ke)/(_e-ke)*100}),Fe=De.reduce(function(mt,Ne,Le){return"".concat(mt,", ").concat(be[Le]," ").concat(Ne,"%, ").concat(be[Le+1]," ").concat(Ne,"%")},"");return"linear-gradient(".concat(Se,", ").concat(be[0]," 0%").concat(Fe,", ").concat(be[be.length-1]," 100%)")}p.getTrackBackground=oe;function ie(){}p.voidFn=ie;function ge(ce){throw new Error("Didn't expect to get here")}p.assertUnreachable=ge;var de=function(ce,ae,be,ke,_e){_e===void 0&&(_e=function(Se){return Se});var Ee=Math.ceil(f([ce],Array.from(ce.children),!0).reduce(function(Se,Oe){var rt=Math.ceil(Oe.getBoundingClientRect().width);if(Oe.innerText&&Oe.innerText.includes(be)&&Oe.childElementCount===0){var De=Oe.cloneNode(!0);De.innerHTML=_e(ae.toFixed(ke)),De.style.visibility="hidden",document.body.appendChild(De),rt=Math.ceil(De.getBoundingClientRect().width),document.body.removeChild(De)}return rt>Se?rt:Se},ce.getBoundingClientRect().width));return Ee},je=function(ce,ae,be,ke,_e,Ee,Se){Se===void 0&&(Se=function(De){return De});var Oe=[],rt=function(De){var Fe=de(be[De],ke[De],_e,Ee,Se),mt=ae[De].x;ae.forEach(function(Ne,Le){var qe=Ne.x,$e=de(be[Le],ke[Le],_e,Ee,Se);De!==Le&&(mt>=qe&&mt<=qe+$e||mt+Fe>=qe&&mt+Fe<=qe+$e)&&(Oe.includes(Le)||(Oe.push(De),Oe.push(Le),Oe=f(f([],Oe,!0),[De,Le],!1),rt(Le)))})};return rt(ce),Array.from(new Set(Oe.sort()))},Ie=function(ce,ae,be,ke,_e,Ee){ke===void 0&&(ke=.1),_e===void 0&&(_e=" - "),Ee===void 0&&(Ee=function(Le){return Le});var Se=(0,p.getStepDecimals)(ke),Oe=(0,l.useState)({}),rt=Oe[0],De=Oe[1],Fe=(0,l.useState)(Ee(ae[be].toFixed(Se))),mt=Fe[0],Ne=Fe[1];return(0,l.useEffect)(function(){if(ce){var Le=ce.getThumbs();if(Le.length<1)return;var qe={},$e=ce.getOffsets(),tt=je(be,$e,Le,ae,_e,Se,Ee),nt=Ee(ae[be].toFixed(Se));if(tt.length){var Ue=tt.reduce(function(we,Re,ct,st){return we.length?f(f([],we,!0),[$e[st[ct]].x],!1):[$e[st[ct]].x]},[]);if(Math.min.apply(Math,Ue)===$e[be].x){var We=[];tt.forEach(function(we){We.push(ae[we].toFixed(Se))}),nt=Array.from(new Set(We.sort(function(we,Re){return parseFloat(we)-parseFloat(Re)}))).map(Ee).join(_e);var et=Math.min.apply(Math,Ue),Ut=Math.max.apply(Math,Ue),en=Le[tt[Ue.indexOf(Ut)]].getBoundingClientRect().width;qe.left="".concat(Math.abs(et-(Ut+en))/2,"px"),qe.transform="translate(-50%, 0)"}else qe.visibility="hidden"}Ne(nt),De(qe)}},[ce,ae]),[mt,rt]};p.useThumbOverlap=Ie;function Pe(ce,ae,be,ke){var _e=ce.getBoundingClientRect(),Ee=_e.left,Se=_e.top,Oe=_e.width,rt=_e.height;return O(ke)?Math.abs(be-(Se+rt/2)):Math.abs(ae-(Ee+Oe/2))}})(ek);var bS=an&&an.__extends||function(){var p=function(f,l){return p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,w){h.__proto__=w}||function(h,w){for(var k in w)Object.prototype.hasOwnProperty.call(w,k)&&(h[k]=w[k])},p(f,l)};return function(f,l){if(typeof l!="function"&&l!==null)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");p(f,l);function h(){this.constructor=f}f.prototype=l===null?Object.create(l):(h.prototype=l.prototype,new h)}}(),vS=an&&an.__createBinding||(Object.create?function(p,f,l,h){h===void 0&&(h=l);var w=Object.getOwnPropertyDescriptor(f,l);(!w||("get"in w?!f.__esModule:w.writable||w.configurable))&&(w={enumerable:!0,get:function(){return f[l]}}),Object.defineProperty(p,h,w)}:function(p,f,l,h){h===void 0&&(h=l),p[h]=f[l]}),wS=an&&an.__setModuleDefault||(Object.create?function(p,f){Object.defineProperty(p,"default",{enumerable:!0,value:f})}:function(p,f){p.default=f}),kS=an&&an.__importStar||function(p){if(p&&p.__esModule)return p;var f={};if(p!=null)for(var l in p)l!=="default"&&Object.prototype.hasOwnProperty.call(p,l)&&vS(f,p,l);return wS(f,p),f},_0=an&&an.__spreadArray||function(p,f,l){if(l||arguments.length===2)for(var h=0,w=f.length,k;h<w;h++)(k||!(h in f))&&(k||(k=Array.prototype.slice.call(f,0,h)),k[h]=f[h]);return p.concat(k||Array.prototype.slice.call(f))};Object.defineProperty(Zw,"__esModule",{value:!0});var fp=kS(U),Dt=ek,Fn=Fp,_S=["ArrowRight","ArrowUp","k","PageUp"],yS=["ArrowLeft","ArrowDown","j","PageDown"],xS=function(p){bS(f,p);function f(l){var h=p.call(this,l)||this;if(h.trackRef=fp.createRef(),h.thumbRefs=[],h.state={draggedTrackPos:[-1,-1],draggedThumbIndex:-1,thumbZIndexes:new Array(h.props.values.length).fill(0).map(function(w,k){return k}),isChanged:!1,markOffsets:[]},h.getOffsets=function(){var w=h.props,k=w.direction,v=w.values,N=w.min,S=w.max,O=h.trackRef.current,C=O.getBoundingClientRect(),L=(0,Dt.getPaddingAndBorder)(O);return h.getThumbs().map(function(j,F){var q={x:0,y:0},K=j.getBoundingClientRect(),te=(0,Dt.getMargin)(j);switch(k){case Fn.Direction.Right:return q.x=(te.left+L.left)*-1,q.y=((K.height-C.height)/2+L.top)*-1,q.x+=C.width*(0,Dt.relativeValue)(v[F],N,S)-K.width/2,q;case Fn.Direction.Left:return q.x=(te.right+L.right)*-1,q.y=((K.height-C.height)/2+L.top)*-1,q.x+=C.width-C.width*(0,Dt.relativeValue)(v[F],N,S)-K.width/2,q;case Fn.Direction.Up:return q.x=((K.width-C.width)/2+te.left+L.left)*-1,q.y=-L.left,q.y+=C.height-C.height*(0,Dt.relativeValue)(v[F],N,S)-K.height/2,q;case Fn.Direction.Down:return q.x=((K.width-C.width)/2+te.left+L.left)*-1,q.y=-L.left,q.y+=C.height*(0,Dt.relativeValue)(v[F],N,S)-K.height/2,q;default:return(0,Dt.assertUnreachable)(k)}})},h.getThumbs=function(){return h.trackRef&&h.trackRef.current?Array.from(h.trackRef.current.children).filter(function(w){return w.hasAttribute("aria-valuenow")}):(console.warn("No thumbs found in the track container. Did you forget to pass & spread the `props` param in renderTrack?"),[])},h.getTargetIndex=function(w){return h.getThumbs().findIndex(function(k){return k===w.target||k.contains(w.target)})},h.addTouchEvents=function(w){document.addEventListener("touchmove",h.schdOnTouchMove,{passive:!1}),document.addEventListener("touchend",h.schdOnEnd,{passive:!1}),document.addEventListener("touchcancel",h.schdOnEnd,{passive:!1})},h.addMouseEvents=function(w){document.addEventListener("mousemove",h.schdOnMouseMove),document.addEventListener("mouseup",h.schdOnEnd)},h.onMouseDownTrack=function(w){var k;if(w.button===0)if(w.persist(),w.preventDefault(),h.addMouseEvents(w.nativeEvent),h.props.values.length>1&&h.props.draggableTrack){if(h.thumbRefs.some(function(N){var S;return(S=N.current)===null||S===void 0?void 0:S.contains(w.target)}))return;h.setState({draggedTrackPos:[w.clientX,w.clientY]},function(){return h.onMove(w.clientX,w.clientY)})}else{var v=(0,Dt.getClosestThumbIndex)(h.thumbRefs.map(function(N){return N.current}),w.clientX,w.clientY,h.props.direction);(k=h.thumbRefs[v].current)===null||k===void 0||k.focus(),h.setState({draggedThumbIndex:v},function(){return h.onMove(w.clientX,w.clientY)})}},h.onResize=function(){(0,Dt.translateThumbs)(h.getThumbs(),h.getOffsets(),h.props.rtl),h.calculateMarkOffsets()},h.onTouchStartTrack=function(w){var k;if(w.persist(),h.addTouchEvents(w.nativeEvent),h.props.values.length>1&&h.props.draggableTrack){if(h.thumbRefs.some(function(N){var S;return(S=N.current)===null||S===void 0?void 0:S.contains(w.target)}))return;h.setState({draggedTrackPos:[w.touches[0].clientX,w.touches[0].clientY]},function(){return h.onMove(w.touches[0].clientX,w.touches[0].clientY)})}else{var v=(0,Dt.getClosestThumbIndex)(h.thumbRefs.map(function(N){return N.current}),w.touches[0].clientX,w.touches[0].clientY,h.props.direction);(k=h.thumbRefs[v].current)===null||k===void 0||k.focus(),h.setState({draggedThumbIndex:v},function(){return h.onMove(w.touches[0].clientX,w.touches[0].clientY)})}},h.onMouseOrTouchStart=function(w){if(!h.props.disabled){var k=(0,Dt.isTouchEvent)(w);if(!(!k&&w.button!==0)){var v=h.getTargetIndex(w);v!==-1&&(k?h.addTouchEvents(w):h.addMouseEvents(w),h.setState({draggedThumbIndex:v,thumbZIndexes:h.state.thumbZIndexes.map(function(N,S){return S===v?Math.max.apply(Math,h.state.thumbZIndexes):N<=h.state.thumbZIndexes[v]?N:N-1})}))}}},h.onMouseMove=function(w){w.preventDefault(),h.onMove(w.clientX,w.clientY)},h.onTouchMove=function(w){w.preventDefault(),h.onMove(w.touches[0].clientX,w.touches[0].clientY)},h.onKeyDown=function(w){var k=h.props,v=k.values,N=k.onChange,S=k.step,O=k.rtl,C=k.direction,L=h.state.isChanged,j=h.getTargetIndex(w.nativeEvent),F=O||C===Fn.Direction.Left||C===Fn.Direction.Down?-1:1;j!==-1&&(_S.includes(w.key)?(w.preventDefault(),h.setState({draggedThumbIndex:j,isChanged:!0}),N((0,Dt.replaceAt)(v,j,h.normalizeValue(v[j]+F*(w.key==="PageUp"?S*10:S),j)))):yS.includes(w.key)?(w.preventDefault(),h.setState({draggedThumbIndex:j,isChanged:!0}),N((0,Dt.replaceAt)(v,j,h.normalizeValue(v[j]-F*(w.key==="PageDown"?S*10:S),j)))):w.key==="Tab"?h.setState({draggedThumbIndex:-1},function(){L&&h.fireOnFinalChange()}):L&&h.fireOnFinalChange())},h.onKeyUp=function(w){var k=h.state.isChanged;h.setState({draggedThumbIndex:-1},function(){k&&h.fireOnFinalChange()})},h.onMove=function(w,k){var v=h.state,N=v.draggedThumbIndex,S=v.draggedTrackPos,O=h.props,C=O.direction,L=O.min,j=O.max,F=O.onChange,q=O.values,K=O.step,te=O.rtl;if(N===-1&&S[0]===-1&&S[1]===-1)return null;var se=h.trackRef.current;if(!se)return null;var Z=se.getBoundingClientRect(),Y=(0,Dt.isVertical)(C)?Z.height:Z.width;if(S[0]!==-1&&S[1]!==-1){var oe=w-S[0],ie=k-S[1],ge=0;switch(C){case Fn.Direction.Right:case Fn.Direction.Left:ge=oe/Y*(j-L);break;case Fn.Direction.Down:case Fn.Direction.Up:ge=ie/Y*(j-L);break;default:(0,Dt.assertUnreachable)(C)}if(te&&(ge*=-1),Math.abs(ge)>=K/2){for(var de=0;de<h.thumbRefs.length;de++){if(q[de]===j&&Math.sign(ge)===1||q[de]===L&&Math.sign(ge)===-1)return;var je=q[de]+ge;je>j?ge=j-q[de]:je<L&&(ge=L-q[de])}for(var Ie=q.slice(0),de=0;de<h.thumbRefs.length;de++)Ie=(0,Dt.replaceAt)(Ie,de,h.normalizeValue(q[de]+ge,de));h.setState({draggedTrackPos:[w,k]}),F(Ie)}}else{var Pe=0;switch(C){case Fn.Direction.Right:Pe=(w-Z.left)/Y*(j-L)+L;break;case Fn.Direction.Left:Pe=(Y-(w-Z.left))/Y*(j-L)+L;break;case Fn.Direction.Down:Pe=(k-Z.top)/Y*(j-L)+L;break;case Fn.Direction.Up:Pe=(Y-(k-Z.top))/Y*(j-L)+L;break;default:(0,Dt.assertUnreachable)(C)}te&&(Pe=j+L-Pe),Math.abs(q[N]-Pe)>=K/2&&F((0,Dt.replaceAt)(q,N,h.normalizeValue(Pe,N)))}},h.normalizeValue=function(w,k){var v=h.props,N=v.min,S=v.max,O=v.step,C=v.allowOverlap,L=v.values;return(0,Dt.normalizeValue)(w,k,N,S,O,C,L)},h.onEnd=function(w){if(w.preventDefault(),document.removeEventListener("mousemove",h.schdOnMouseMove),document.removeEventListener("touchmove",h.schdOnTouchMove),document.removeEventListener("mouseup",h.schdOnEnd),document.removeEventListener("touchend",h.schdOnEnd),document.removeEventListener("touchcancel",h.schdOnEnd),h.state.draggedThumbIndex===-1&&h.state.draggedTrackPos[0]===-1&&h.state.draggedTrackPos[1]===-1)return null;h.setState({draggedThumbIndex:-1,draggedTrackPos:[-1,-1]},function(){h.fireOnFinalChange()})},h.fireOnFinalChange=function(){h.setState({isChanged:!1});var w=h.props,k=w.onFinalChange,v=w.values;k&&k(v)},h.updateMarkRefs=function(w){if(!w.renderMark){h.numOfMarks=void 0,h.markRefs=void 0;return}h.numOfMarks=(w.max-w.min)/h.props.step,h.markRefs=[];for(var k=0;k<h.numOfMarks+1;k++)h.markRefs[k]=fp.createRef()},h.calculateMarkOffsets=function(){if(!(!h.props.renderMark||!h.trackRef||!h.numOfMarks||!h.markRefs||h.trackRef.current===null)){for(var w=window.getComputedStyle(h.trackRef.current),k=parseInt(w.width,10),v=parseInt(w.height,10),N=parseInt(w.paddingLeft,10),S=parseInt(w.paddingTop,10),O=[],C=0;C<h.numOfMarks+1;C++){var L=9999,j=9999;if(h.markRefs[C].current){var F=h.markRefs[C].current.getBoundingClientRect();L=F.height,j=F.width}h.props.direction===Fn.Direction.Left||h.props.direction===Fn.Direction.Right?O.push([Math.round(k/h.numOfMarks*C+N-j/2),-Math.round((L-v)/2)]):O.push([Math.round(v/h.numOfMarks*C+S-L/2),-Math.round((j-k)/2)])}h.setState({markOffsets:O})}},l.step===0)throw new Error('"step" property should be a positive number');return h.schdOnMouseMove=(0,Dt.schd)(h.onMouseMove),h.schdOnTouchMove=(0,Dt.schd)(h.onTouchMove),h.schdOnEnd=(0,Dt.schd)(h.onEnd),h.thumbRefs=l.values.map(function(){return fp.createRef()}),h.updateMarkRefs(l),h}return f.prototype.componentDidMount=function(){var l=this,h=this.props,w=h.values,k=h.min,v=h.step;this.resizeObserver=window.ResizeObserver?new window.ResizeObserver(this.onResize):{observe:function(){return window.addEventListener("resize",l.onResize)},unobserve:function(){return window.removeEventListener("resize",l.onResize)}},document.addEventListener("touchstart",this.onMouseOrTouchStart,{passive:!1}),document.addEventListener("mousedown",this.onMouseOrTouchStart,{passive:!1}),!this.props.allowOverlap&&(0,Dt.checkInitialOverlap)(this.props.values),this.props.values.forEach(function(N){return(0,Dt.checkBoundaries)(N,l.props.min,l.props.max)}),this.resizeObserver.observe(this.trackRef.current),(0,Dt.translateThumbs)(this.getThumbs(),this.getOffsets(),this.props.rtl),this.calculateMarkOffsets(),w.forEach(function(N){(0,Dt.isStepDivisible)(k,N,v)||console.warn("The `values` property is in conflict with the current `step`, `min`, and `max` properties. Please provide values that are accessible using the min, max, and step values.")})},f.prototype.componentDidUpdate=function(l,h){var w=this.props,k=w.max,v=w.min,N=w.step,S=w.values,O=w.rtl;(l.max!==k||l.min!==v||l.step!==N)&&this.updateMarkRefs(this.props),(0,Dt.translateThumbs)(this.getThumbs(),this.getOffsets(),O),(l.max!==k||l.min!==v||l.step!==N||h.markOffsets.length!==this.state.markOffsets.length)&&(this.calculateMarkOffsets(),S.forEach(function(C){(0,Dt.isStepDivisible)(v,C,N)||console.warn("The `values` property is in conflict with the current `step`, `min`, and `max` properties. Please provide values that are accessible using the min, max, and step values.")}))},f.prototype.componentWillUnmount=function(){var l={passive:!1};document.removeEventListener("mousedown",this.onMouseOrTouchStart,l),document.removeEventListener("mousemove",this.schdOnMouseMove),document.removeEventListener("touchmove",this.schdOnTouchMove),document.removeEventListener("touchstart",this.onMouseOrTouchStart),document.removeEventListener("mouseup",this.schdOnEnd),document.removeEventListener("touchend",this.schdOnEnd),this.resizeObserver.unobserve(this.trackRef.current)},f.prototype.render=function(){var l=this,h=this.props,w=h.renderTrack,k=h.renderThumb,v=h.renderMark,N=v===void 0?function(){return null}:v,S=h.values,O=h.min,C=h.max,L=h.allowOverlap,j=h.disabled,F=this.state,q=F.draggedThumbIndex,K=F.thumbZIndexes,te=F.markOffsets;return w({props:{style:{transform:"scale(1)",cursor:q>-1?"grabbing":this.props.draggableTrack?(0,Dt.isVertical)(this.props.direction)?"ns-resize":"ew-resize":S.length===1&&!j?"pointer":"inherit"},onMouseDown:j?Dt.voidFn:this.onMouseDownTrack,onTouchStart:j?Dt.voidFn:this.onTouchStartTrack,ref:this.trackRef},isDragged:this.state.draggedThumbIndex>-1,disabled:j,children:_0(_0([],te.map(function(se,Z,Y){return N({props:{style:l.props.direction===Fn.Direction.Left||l.props.direction===Fn.Direction.Right?{position:"absolute",left:"".concat(se[0],"px"),marginTop:"".concat(se[1],"px")}:{position:"absolute",top:"".concat(se[0],"px"),marginLeft:"".concat(se[1],"px")},key:"mark".concat(Z),ref:l.markRefs[Z]},index:Z})}),!0),S.map(function(se,Z){var Y=l.state.draggedThumbIndex===Z;return k({index:Z,value:se,isDragged:Y,props:{style:{position:"absolute",zIndex:K[Z],cursor:j?"inherit":Y?"grabbing":"grab",userSelect:"none",touchAction:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none"},key:Z,tabIndex:j?void 0:0,"aria-valuemax":L?C:S[Z+1]||C,"aria-valuemin":L?O:S[Z-1]||O,"aria-valuenow":se,draggable:!1,ref:l.thumbRefs[Z],role:"slider",onKeyDown:j?Dt.voidFn:l.onKeyDown,onKeyUp:j?Dt.voidFn:l.onKeyUp}})}),!0)})},f.defaultProps={step:1,direction:Fn.Direction.Right,rtl:!1,disabled:!1,allowOverlap:!1,draggableTrack:!1,min:0,max:100},f}(fp.Component);Zw.default=xS;(function(p){var f=an&&an.__importDefault||function(k){return k&&k.__esModule?k:{default:k}};Object.defineProperty(p,"__esModule",{value:!0}),p.checkValuesAgainstBoundaries=p.relativeValue=p.useThumbOverlap=p.Direction=p.getTrackBackground=p.Range=void 0;var l=f(Zw);p.Range=l.default;var h=ek;Object.defineProperty(p,"getTrackBackground",{enumerable:!0,get:function(){return h.getTrackBackground}}),Object.defineProperty(p,"useThumbOverlap",{enumerable:!0,get:function(){return h.useThumbOverlap}}),Object.defineProperty(p,"relativeValue",{enumerable:!0,get:function(){return h.relativeValue}}),Object.defineProperty(p,"checkValuesAgainstBoundaries",{enumerable:!0,get:function(){return h.checkValuesAgainstBoundaries}});var w=Fp;Object.defineProperty(p,"Direction",{enumerable:!0,get:function(){return w.Direction}})})(Ly);const NS=1,y0=15,x0=100;function TS({values:p,colors:f,min:l,max:h,direction:w="to right",rtl:k=!1}){k&&w==="to right"?w="to left":k&&(w="to right");const N=p.slice(0).sort((S,O)=>S-O).map(S=>(S-l)/(h-l)*100).reduce((S,O,C)=>`${S}, ${f[C]} ${O}%, ${f[C+1]} ${O}%`,"");return`linear-gradient(${w}, ${f[0]} 0%${N}, ${f[f.length-1]} 100%)`}const CS=({rtl:p,value:f,onChange:l})=>{const[h,w]=U.useState([15,15]);return U.useEffect(()=>{f&&w(f)},[f]),x.jsxDEV("div",{style:{display:"flex",justifyContent:"center",flexWrap:"wrap"},children:x.jsxDEV(Ly.Range,{values:h,step:NS,min:y0,max:x0,rtl:p,onChange:k=>l(k),renderTrack:({props:k,children:v})=>x.jsxDEV("div",{onMouseDown:k.onMouseDown,onTouchStart:k.onTouchStart,style:{...k.style,height:"36px",display:"flex",width:"100%"},children:x.jsxDEV("div",{ref:k.ref,style:{height:"5px",width:"100%",borderRadius:"4px",background:TS({values:h,colors:["#ccc","#548BF4","#ccc"],min:y0,max:x0,rtl:p}),alignSelf:"center"},children:v},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Ranger/index.jsx",lineNumber:57,columnNumber:13},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Ranger/index.jsx",lineNumber:47,columnNumber:11},globalThis),renderThumb:({index:k,props:v,isDragged:N})=>x.jsxDEV("div",{...v,style:{...v.style,height:"1.5rem",width:"1.5rem",borderRadius:"4px",backgroundColor:"#FFF",display:"flex",justifyContent:"center",alignItems:"center",boxShadow:"0px 2px 6px #AAA"},children:[x.jsxDEV("div",{style:{position:"absolute",top:"-20px",color:"#fff",fontWeight:"bold",fontSize:"12px",fontFamily:"Arial,Helvetica Neue,Helvetica,sans-serif",padding:"2px",borderRadius:"4px",backgroundColor:"#548BF4"},children:h[k]},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Ranger/index.jsx",lineNumber:92,columnNumber:13},globalThis),x.jsxDEV("div",{style:{height:"16px",width:"5px",backgroundColor:N?"#548BF4":"#CCC"}},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Ranger/index.jsx",lineNumber:108,columnNumber:13},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Ranger/index.jsx",lineNumber:78,columnNumber:11},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Ranger/index.jsx",lineNumber:39,columnNumber:7},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Ranger/index.jsx",lineNumber:32,columnNumber:5},globalThis)};var xp={exports:{}};/**
 * @license
 * Lodash <https://lodash.com/>
 * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
 * Released under MIT license <https://lodash.com/license>
 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
 */xp.exports;(function(p,f){(function(){var l,h="4.17.21",w=200,k="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",v="Expected a function",N="Invalid `variable` option passed into `_.template`",S="__lodash_hash_undefined__",O=500,C="__lodash_placeholder__",L=1,j=2,F=4,q=1,K=2,te=1,se=2,Z=4,Y=8,oe=16,ie=32,ge=64,de=128,je=256,Ie=512,Pe=30,ce="...",ae=800,be=16,ke=1,_e=2,Ee=3,Se=1/0,Oe=9007199254740991,rt=17976931348623157e292,De=0/0,Fe=4294967295,mt=Fe-1,Ne=Fe>>>1,Le=[["ary",de],["bind",te],["bindKey",se],["curry",Y],["curryRight",oe],["flip",Ie],["partial",ie],["partialRight",ge],["rearg",je]],qe="[object Arguments]",$e="[object Array]",tt="[object AsyncFunction]",nt="[object Boolean]",Ue="[object Date]",We="[object DOMException]",et="[object Error]",Ut="[object Function]",en="[object GeneratorFunction]",we="[object Map]",Re="[object Number]",ct="[object Null]",st="[object Object]",Bt="[object Promise]",xn="[object Proxy]",ln="[object RegExp]",jt="[object Set]",Wo="[object String]",or="[object Symbol]",gn="[object Undefined]",ai="[object WeakMap]",ea="[object WeakSet]",li="[object ArrayBuffer]",go="[object DataView]",jr="[object Float32Array]",Oi="[object Float64Array]",Ir="[object Int8Array]",Ri="[object Int16Array]",bo="[object Int32Array]",ft="[object Uint8Array]",Jt="[object Uint8ClampedArray]",mn="[object Uint16Array]",bn="[object Uint32Array]",An=/\b__p \+= '';/g,jn=/\b(__p \+=) '' \+/g,cn=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Io=/&(?:amp|lt|gt|quot|#39);/g,xt=/[&<>"']/g,ci=RegExp(Io.source),ms=RegExp(xt.source),ir=/<%-([\s\S]+?)%>/g,Sl=/<%([\s\S]+?)%>/g,Vi=/<%=([\s\S]+?)%>/g,yu=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Dl=/^\w*$/,xu=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Pr=/[\\^$.*+?()[\]{}|]/g,rr=RegExp(Pr.source),ta=/^\s+/,Nu=/\s/,vo=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Mr=/\{\n\/\* \[wrapped with (.+)\] \*/,fs=/,? & /,Or=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Rr=/[()=,{}\[\]\/\s]/,sr=/\\(\\)?/g,na=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Li=/\w*$/,Wt=/^[-+]0x[0-9a-f]+$/i,oa=/^0b[01]+$/i,jl=/^\[object .+?Constructor\]$/,Tu=/^0o[0-7]+$/i,Il=/^(?:0|[1-9]\d*)$/,Pl=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Be=/($^)/,ve=/['\n\r\u2028\u2029\\]/g,ar="\\ud800-\\udfff",pt="\\u0300-\\u036f",ia="\\ufe20-\\ufe2f",ra="\\u20d0-\\u20ff",sa=pt+ia+ra,ps="\\u2700-\\u27bf",aa="a-z\\xdf-\\xf6\\xf8-\\xff",Kt="\\xac\\xb1\\xd7\\xf7",Ml="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",la="\\u2000-\\u206f",Ol=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Nn="A-Z\\xc0-\\xd6\\xd8-\\xde",gs="\\ufe0e\\ufe0f",Po=Kt+Ml+la+Ol,bs="['’]",Cu="["+ar+"]",Rl="["+Po+"]",Vr="["+sa+"]",Vl="\\d+",ui="["+ps+"]",lr="["+aa+"]",Ll="[^"+ar+Po+Vl+ps+aa+Nn+"]",ca="\\ud83c[\\udffb-\\udfff]",Eu="(?:"+Vr+"|"+ca+")",ua="[^"+ar+"]",Ko="(?:\\ud83c[\\udde6-\\uddff]){2}",zi="[\\ud800-\\udbff][\\udc00-\\udfff]",cr="["+Nn+"]",zl="\\u200d",Bl="(?:"+lr+"|"+Ll+")",da="(?:"+cr+"|"+Ll+")",Fl="(?:"+bs+"(?:d|ll|m|re|s|t|ve))?",ha="(?:"+bs+"(?:D|LL|M|RE|S|T|VE))?",ma=Eu+"?",di="["+gs+"]?",fa="(?:"+zl+"(?:"+[ua,Ko,zi].join("|")+")"+di+ma+")*",Au="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Su="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Lr=di+ma+fa,ql="(?:"+[ui,Ko,zi].join("|")+")"+Lr,Du="(?:"+[ua+Vr+"?",Vr,Ko,zi,Cu].join("|")+")",Hl=RegExp(bs,"g"),pa=RegExp(Vr,"g"),hi=RegExp(ca+"(?="+ca+")|"+Du+Lr,"g"),zr=RegExp([cr+"?"+lr+"+"+Fl+"(?="+[Rl,cr,"$"].join("|")+")",da+"+"+ha+"(?="+[Rl,cr+Bl,"$"].join("|")+")",cr+"?"+Bl+"+"+Fl,cr+"+"+ha,Su,Au,Vl,ql].join("|"),"g"),ga=RegExp("["+zl+ar+sa+gs+"]"),Bi=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Br=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],$l=-1,Gt={};Gt[jr]=Gt[Oi]=Gt[Ir]=Gt[Ri]=Gt[bo]=Gt[ft]=Gt[Jt]=Gt[mn]=Gt[bn]=!0,Gt[qe]=Gt[$e]=Gt[li]=Gt[nt]=Gt[go]=Gt[Ue]=Gt[et]=Gt[Ut]=Gt[we]=Gt[Re]=Gt[st]=Gt[ln]=Gt[jt]=Gt[Wo]=Gt[ai]=!1;var Ft={};Ft[qe]=Ft[$e]=Ft[li]=Ft[go]=Ft[nt]=Ft[Ue]=Ft[jr]=Ft[Oi]=Ft[Ir]=Ft[Ri]=Ft[bo]=Ft[we]=Ft[Re]=Ft[st]=Ft[ln]=Ft[jt]=Ft[Wo]=Ft[or]=Ft[ft]=Ft[Jt]=Ft[mn]=Ft[bn]=!0,Ft[et]=Ft[Ut]=Ft[ai]=!1;var ba={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Fr={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},va={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},wa={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ka=parseFloat,_a=parseInt,ya=typeof an=="object"&&an&&an.Object===Object&&an,xa=typeof self=="object"&&self&&self.Object===Object&&self,vn=ya||xa||Function("return this")(),vs=f&&!f.nodeType&&f,Go=vs&&!0&&p&&!p.nodeType&&p,Ul=Go&&Go.exports===vs,ws=Ul&&ya.process,Qn=function(){try{var Q=Go&&Go.require&&Go.require("util").types;return Q||ws&&ws.binding&&ws.binding("util")}catch{}}(),mi=Qn&&Qn.isArrayBuffer,qr=Qn&&Qn.isDate,ks=Qn&&Qn.isMap,Wl=Qn&&Qn.isRegExp,Hr=Qn&&Qn.isSet,ur=Qn&&Qn.isTypedArray;function In(Q,re,ee){switch(ee.length){case 0:return Q.call(re);case 1:return Q.call(re,ee[0]);case 2:return Q.call(re,ee[0],ee[1]);case 3:return Q.call(re,ee[0],ee[1],ee[2])}return Q.apply(re,ee)}function Na(Q,re,ee,Ce){for(var Xe=-1,Je=Q==null?0:Q.length;++Xe<Je;){var Ot=Q[Xe];re(Ce,Ot,ee(Ot),Q)}return Ce}function oo(Q,re){for(var ee=-1,Ce=Q==null?0:Q.length;++ee<Ce&&re(Q[ee],ee,Q)!==!1;);return Q}function Kl(Q,re){for(var ee=Q==null?0:Q.length;ee--&&re(Q[ee],ee,Q)!==!1;);return Q}function Ta(Q,re){for(var ee=-1,Ce=Q==null?0:Q.length;++ee<Ce;)if(!re(Q[ee],ee,Q))return!1;return!0}function fi(Q,re){for(var ee=-1,Ce=Q==null?0:Q.length,Xe=0,Je=[];++ee<Ce;){var Ot=Q[ee];re(Ot,ee,Q)&&(Je[Xe++]=Ot)}return Je}function _s(Q,re){var ee=Q==null?0:Q.length;return!!ee&&Fi(Q,re,0)>-1}function Qo(Q,re,ee){for(var Ce=-1,Xe=Q==null?0:Q.length;++Ce<Xe;)if(ee(re,Q[Ce]))return!0;return!1}function At(Q,re){for(var ee=-1,Ce=Q==null?0:Q.length,Xe=Array(Ce);++ee<Ce;)Xe[ee]=re(Q[ee],ee,Q);return Xe}function pi(Q,re){for(var ee=-1,Ce=re.length,Xe=Q.length;++ee<Ce;)Q[Xe+ee]=re[ee];return Q}function Ca(Q,re,ee,Ce){var Xe=-1,Je=Q==null?0:Q.length;for(Ce&&Je&&(ee=Q[++Xe]);++Xe<Je;)ee=re(ee,Q[Xe],Xe,Q);return ee}function ys(Q,re,ee,Ce){var Xe=Q==null?0:Q.length;for(Ce&&Xe&&(ee=Q[--Xe]);Xe--;)ee=re(ee,Q[Xe],Xe,Q);return ee}function dr(Q,re){for(var ee=-1,Ce=Q==null?0:Q.length;++ee<Ce;)if(re(Q[ee],ee,Q))return!0;return!1}var ju=Sa("length");function Iu(Q){return Q.split("")}function Gl(Q){return Q.match(Or)||[]}function Ea(Q,re,ee){var Ce;return ee(Q,function(Xe,Je,Ot){if(re(Xe,Je,Ot))return Ce=Je,!1}),Ce}function hr(Q,re,ee,Ce){for(var Xe=Q.length,Je=ee+(Ce?1:-1);Ce?Je--:++Je<Xe;)if(re(Q[Je],Je,Q))return Je;return-1}function Fi(Q,re,ee){return re===re?ne(Q,re,ee):hr(Q,Mt,ee)}function Ql(Q,re,ee,Ce){for(var Xe=ee-1,Je=Q.length;++Xe<Je;)if(Ce(Q[Xe],re))return Xe;return-1}function Mt(Q){return Q!==Q}function Aa(Q,re){var ee=Q==null?0:Q.length;return ee?ja(Q,re)/ee:De}function Sa(Q){return function(re){return re==null?l:re[Q]}}function xs(Q){return function(re){return Q==null?l:Q[re]}}function Yl(Q,re,ee,Ce,Xe){return Xe(Q,function(Je,Ot,Nt){ee=Ce?(Ce=!1,Je):re(ee,Je,Ot,Nt)}),ee}function Da(Q,re){var ee=Q.length;for(Q.sort(re);ee--;)Q[ee]=Q[ee].value;return Q}function ja(Q,re){for(var ee,Ce=-1,Xe=Q.length;++Ce<Xe;){var Je=re(Q[Ce]);Je!==l&&(ee=ee===l?Je:ee+Je)}return ee}function Ia(Q,re){for(var ee=-1,Ce=Array(Q);++ee<Q;)Ce[ee]=re(ee);return Ce}function Xl(Q,re){return At(re,function(ee){return[ee,Q[ee]]})}function Jl(Q){return Q&&Q.slice(0,Ke(Q)+1).replace(ta,"")}function at(Q){return function(re){return Q(re)}}function $r(Q,re){return At(re,function(ee){return Q[ee]})}function qi(Q,re){return Q.has(re)}function Mo(Q,re){for(var ee=-1,Ce=Q.length;++ee<Ce&&Fi(re,Q[ee],0)>-1;);return ee}function Ns(Q,re){for(var ee=Q.length;ee--&&Fi(re,Q[ee],0)>-1;);return ee}function Tn(Q,re){for(var ee=Q.length,Ce=0;ee--;)Q[ee]===re&&++Ce;return Ce}var Ur=xs(ba),Yn=xs(Fr);function io(Q){return"\\"+wa[Q]}function Ts(Q,re){return Q==null?l:Q[re]}function Tt(Q){return ga.test(Q)}function Pa(Q){return Bi.test(Q)}function Ma(Q){for(var re,ee=[];!(re=Q.next()).done;)ee.push(re.value);return ee}function Oo(Q){var re=-1,ee=Array(Q.size);return Q.forEach(function(Ce,Xe){ee[++re]=[Xe,Ce]}),ee}function Zl(Q,re){return function(ee){return Q(re(ee))}}function D(Q,re){for(var ee=-1,Ce=Q.length,Xe=0,Je=[];++ee<Ce;){var Ot=Q[ee];(Ot===re||Ot===C)&&(Q[ee]=C,Je[Xe++]=ee)}return Je}function I(Q){var re=-1,ee=Array(Q.size);return Q.forEach(function(Ce){ee[++re]=Ce}),ee}function B(Q){var re=-1,ee=Array(Q.size);return Q.forEach(function(Ce){ee[++re]=[Ce,Ce]}),ee}function ne(Q,re,ee){for(var Ce=ee-1,Xe=Q.length;++Ce<Xe;)if(Q[Ce]===re)return Ce;return-1}function Me(Q,re,ee){for(var Ce=ee+1;Ce--;)if(Q[Ce]===re)return Ce;return Ce}function Te(Q){return Tt(Q)?Zt(Q):ju(Q)}function Ve(Q){return Tt(Q)?mr(Q):Iu(Q)}function Ke(Q){for(var re=Q.length;re--&&Nu.test(Q.charAt(re)););return re}var Ct=xs(va);function Zt(Q){for(var re=hi.lastIndex=0;hi.test(Q);)++re;return re}function mr(Q){return Q.match(hi)||[]}function Ro(Q){return Q.match(zr)||[]}var Vo=function Q(re){re=re==null?vn:wo.defaults(vn.Object(),re,wo.pick(vn,Br));var ee=re.Array,Ce=re.Date,Xe=re.Error,Je=re.Function,Ot=re.Math,Nt=re.Object,ec=re.RegExp,qp=re.String,ro=re.TypeError,Cs=ee.prototype,Hp=Je.prototype,fr=Nt.prototype,Oa=re["__core-js_shared__"],Ra=Hp.toString,Rt=fr.hasOwnProperty,$p=0,Eh=function(){var s=/[^.]+$/.exec(Oa&&Oa.keys&&Oa.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}(),Wr=fr.toString,Pu=Ra.call(Nt),Up=vn._,Wp=ec("^"+Ra.call(Rt).replace(Pr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Es=Ul?re.Buffer:l,pr=re.Symbol,tc=re.Uint8Array,Ah=Es?Es.allocUnsafe:l,Va=Zl(Nt.getPrototypeOf,Nt),Sh=Nt.create,Dh=fr.propertyIsEnumerable,nc=Cs.splice,jh=pr?pr.isConcatSpreadable:l,Kr=pr?pr.iterator:l,Hi=pr?pr.toStringTag:l,Xn=function(){try{var s=No(Nt,"defineProperty");return s({},"",{}),s}catch{}}(),Ih=re.clearTimeout!==vn.clearTimeout&&re.clearTimeout,oc=Ce&&Ce.now!==vn.Date.now&&Ce.now,Ph=re.setTimeout!==vn.setTimeout&&re.setTimeout,Gr=Ot.ceil,La=Ot.floor,Mu=Nt.getOwnPropertySymbols,Qr=Es?Es.isBuffer:l,ye=re.isFinite,Ze=Cs.join,ic=Zl(Nt.keys,Nt),fn=Ot.max,Yt=Ot.min,Ou=Ce.now,rc=re.parseInt,sc=Ot.random,Kp=Cs.reverse,Yr=No(re,"DataView"),gi=No(re,"Map"),ac=No(re,"Promise"),gr=No(re,"Set"),$i=No(re,"WeakMap"),bi=No(Nt,"create"),lc=$i&&new $i,br={},Mh=xr(Yr),Gp=xr(gi),za=xr(ac),Cn=xr(gr),Qp=xr($i),cc=pr?pr.prototype:l,ut=cc?cc.valueOf:l,Oh=cc?cc.toString:l;function M(s){if(on(s)&&!ot(s)&&!(s instanceof wt)){if(s instanceof ko)return s;if(Rt.call(s,"__wrapped__"))return vm(s)}return new ko(s)}var vr=function(){function s(){}return function(u){if(!it(u))return{};if(Sh)return Sh(u);s.prototype=u;var g=new s;return s.prototype=l,g}}();function Ba(){}function ko(s,u){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!u,this.__index__=0,this.__values__=l}M.templateSettings={escape:ir,evaluate:Sl,interpolate:Vi,variable:"",imports:{_:M}},M.prototype=Ba.prototype,M.prototype.constructor=M,ko.prototype=vr(Ba.prototype),ko.prototype.constructor=ko;function wt(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Fe,this.__views__=[]}function Ru(){var s=new wt(this.__wrapped__);return s.__actions__=lo(this.__actions__),s.__dir__=this.__dir__,s.__filtered__=this.__filtered__,s.__iteratees__=lo(this.__iteratees__),s.__takeCount__=this.__takeCount__,s.__views__=lo(this.__views__),s}function Yp(){if(this.__filtered__){var s=new wt(this);s.__dir__=-1,s.__filtered__=!0}else s=this.clone(),s.__dir__*=-1;return s}function Xp(){var s=this.__wrapped__.value(),u=this.__dir__,g=ot(s),y=u<0,A=g?s.length:0,V=pg(0,A,this.__views__),H=V.start,W=V.end,X=W-H,he=y?W:H-1,me=this.__iteratees__,pe=me.length,Ae=0,ze=Yt(X,this.__takeCount__);if(!g||!y&&A==X&&ze==X)return Xo(s,this.__actions__);var Ye=[];e:for(;X--&&Ae<ze;){he+=u;for(var bt=-1,Qe=s[he];++bt<pe;){var vt=me[bt],kt=vt.iteratee,uo=vt.type,$n=kt(Qe);if(uo==_e)Qe=$n;else if(!$n){if(uo==ke)continue e;break e}}Ye[Ae++]=Qe}return Ye}wt.prototype=vr(Ba.prototype),wt.prototype.constructor=wt;function wr(s){var u=-1,g=s==null?0:s.length;for(this.clear();++u<g;){var y=s[u];this.set(y[0],y[1])}}function Jp(){this.__data__=bi?bi(null):{},this.size=0}function Xr(s){var u=this.has(s)&&delete this.__data__[s];return this.size-=u?1:0,u}function Rh(s){var u=this.__data__;if(bi){var g=u[s];return g===S?l:g}return Rt.call(u,s)?u[s]:l}function Vu(s){var u=this.__data__;return bi?u[s]!==l:Rt.call(u,s)}function Zp(s,u){var g=this.__data__;return this.size+=this.has(s)?0:1,g[s]=bi&&u===l?S:u,this}wr.prototype.clear=Jp,wr.prototype.delete=Xr,wr.prototype.get=Rh,wr.prototype.has=Vu,wr.prototype.set=Zp;function vi(s){var u=-1,g=s==null?0:s.length;for(this.clear();++u<g;){var y=s[u];this.set(y[0],y[1])}}function Lu(){this.__data__=[],this.size=0}function Vh(s){var u=this.__data__,g=qt(u,s);if(g<0)return!1;var y=u.length-1;return g==y?u.pop():nc.call(u,g,1),--this.size,!0}function eg(s){var u=this.__data__,g=qt(u,s);return g<0?l:u[g][1]}function zu(s){return qt(this.__data__,s)>-1}function Fa(s,u){var g=this.__data__,y=qt(g,s);return y<0?(++this.size,g.push([s,u])):g[y][1]=u,this}vi.prototype.clear=Lu,vi.prototype.delete=Vh,vi.prototype.get=eg,vi.prototype.has=zu,vi.prototype.set=Fa;function wi(s){var u=-1,g=s==null?0:s.length;for(this.clear();++u<g;){var y=s[u];this.set(y[0],y[1])}}function Pn(){this.size=0,this.__data__={hash:new wr,map:new(gi||vi),string:new wr}}function Lh(s){var u=Sc(this,s).delete(s);return this.size-=u?1:0,u}function zh(s){return Sc(this,s).get(s)}function Bh(s){return Sc(this,s).has(s)}function uc(s,u){var g=Sc(this,s),y=g.size;return g.set(s,u),this.size+=g.size==y?0:1,this}wi.prototype.clear=Pn,wi.prototype.delete=Lh,wi.prototype.get=zh,wi.prototype.has=Bh,wi.prototype.set=uc;function En(s){var u=-1,g=s==null?0:s.length;for(this.__data__=new wi;++u<g;)this.add(s[u])}function dc(s){return this.__data__.set(s,S),this}function Bu(s){return this.__data__.has(s)}En.prototype.add=En.prototype.push=dc,En.prototype.has=Bu;function Yo(s){var u=this.__data__=new vi(s);this.size=u.size}function Fh(){this.__data__=new vi,this.size=0}function qh(s){var u=this.__data__,g=u.delete(s);return this.size=u.size,g}function Hh(s){return this.__data__.get(s)}function kr(s){return this.__data__.has(s)}function $h(s,u){var g=this.__data__;if(g instanceof vi){var y=g.__data__;if(!gi||y.length<w-1)return y.push([s,u]),this.size=++g.size,this;g=this.__data__=new wi(y)}return g.set(s,u),this.size=g.size,this}Yo.prototype.clear=Fh,Yo.prototype.delete=qh,Yo.prototype.get=Hh,Yo.prototype.has=kr,Yo.prototype.set=$h;function Fu(s,u){var g=ot(s),y=!g&&ss(s),A=!g&&!y&&Ji(s),V=!g&&!y&&!A&&Fs(s),H=g||y||A||V,W=H?Ia(s.length,qp):[],X=W.length;for(var he in s)(u||Rt.call(s,he))&&!(H&&(he=="length"||A&&(he=="offset"||he=="parent")||V&&(he=="buffer"||he=="byteLength"||he=="byteOffset")||Rn(he,X)))&&W.push(he);return W}function Jr(s){var u=s.length;return u?s[bc(0,u-1)]:l}function Uh(s,u){return Rc(lo(s),ki(u,0,s.length))}function Wh(s){return Rc(lo(s))}function hc(s,u,g){(g!==l&&!ti(s[u],g)||g===l&&!(u in s))&&Ui(s,u,g)}function qa(s,u,g){var y=s[u];(!(Rt.call(s,u)&&ti(y,g))||g===l&&!(u in s))&&Ui(s,u,g)}function qt(s,u){for(var g=s.length;g--;)if(ti(s[g][0],u))return g;return-1}function qu(s,u,g,y){return Wi(s,function(A,V,H){u(y,A,g(A),H)}),y}function Hu(s,u){return s&&Zo(u,kn(u),s)}function tg(s,u){return s&&Zo(u,zn(u),s)}function Ui(s,u,g){u=="__proto__"&&Xn?Xn(s,u,{configurable:!0,enumerable:!0,value:g,writable:!0}):s[u]=g}function $u(s,u){for(var g=-1,y=u.length,A=ee(y),V=s==null;++g<y;)A[g]=V?l:Gc(s,u[g]);return A}function ki(s,u,g){return s===s&&(g!==l&&(s=s<=g?s:g),u!==l&&(s=s>=u?s:u)),s}function _o(s,u,g,y,A,V){var H,W=u&L,X=u&j,he=u&F;if(g&&(H=A?g(s,y,A,V):g(s)),H!==l)return H;if(!it(s))return s;var me=ot(s);if(me){if(H=bg(s),!W)return lo(s,H)}else{var pe=On(s),Ae=pe==Ut||pe==en;if(Ji(s))return le(s,W);if(pe==st||pe==qe||Ae&&!A){if(H=X||Ae?{}:Dc(s),!W)return X?Ti(s,tg(H,s)):ad(s,Hu(H,s))}else{if(!Ft[pe])return A?s:{};H=bm(s,pe,W)}}V||(V=new Yo);var ze=V.get(s);if(ze)return ze;V.set(s,H),Fd(s)?s.forEach(function(Qe){H.add(_o(Qe,u,g,Qe,s,V))}):kf(s)&&s.forEach(function(Qe,vt){H.set(vt,_o(Qe,u,g,vt,s,V))});var Ye=he?X?fd:md:X?zn:kn,bt=me?l:Ye(s);return oo(bt||s,function(Qe,vt){bt&&(vt=Qe,Qe=s[vt]),qa(H,vt,_o(Qe,u,g,vt,s,V))}),H}function Kh(s){var u=kn(s);return function(g){return Ha(g,s,u)}}function Ha(s,u,g){var y=g.length;if(s==null)return!y;for(s=Nt(s);y--;){var A=g[y],V=u[A],H=s[A];if(H===l&&!(A in s)||!V(H))return!1}return!0}function Zr(s,u,g){if(typeof s!="function")throw new ro(v);return sl(function(){s.apply(l,g)},u)}function es(s,u,g,y){var A=-1,V=_s,H=!0,W=s.length,X=[],he=u.length;if(!W)return X;g&&(u=At(u,at(g))),y?(V=Qo,H=!1):u.length>=w&&(V=qi,H=!1,u=new En(u));e:for(;++A<W;){var me=s[A],pe=g==null?me:g(me);if(me=y||me!==0?me:0,H&&pe===pe){for(var Ae=he;Ae--;)if(u[Ae]===pe)continue e;X.push(me)}else V(u,pe,y)||X.push(me)}return X}var Wi=zo(yi),_i=zo(Ku,!0);function ng(s,u){var g=!0;return Wi(s,function(y,A,V){return g=!!u(y,A,V),g}),g}function mc(s,u,g){for(var y=-1,A=s.length;++y<A;){var V=s[y],H=u(V);if(H!=null&&(W===l?H===H&&!Ao(H):g(H,W)))var W=H,X=V}return X}function fc(s,u,g,y){var A=s.length;for(g=lt(g),g<0&&(g=-g>A?0:A+g),y=y===l||y>A?A:lt(y),y<0&&(y+=A),y=g>y?0:Hd(y);g<y;)s[g++]=u;return s}function Gh(s,u){var g=[];return Wi(s,function(y,A,V){u(y,A,V)&&g.push(y)}),g}function Mn(s,u,g,y,A){var V=-1,H=s.length;for(g||(g=Bo),A||(A=[]);++V<H;){var W=s[V];u>0&&g(W)?u>1?Mn(W,u-1,g,y,A):pi(A,W):y||(A[A.length]=W)}return A}var Uu=cm(),Wu=cm(!0);function yi(s,u){return s&&Uu(s,u,kn)}function Ku(s,u){return s&&Wu(s,u,kn)}function $a(s,u){return fi(u,function(g){return ni(s[g])})}function Ki(s,u){u=fe(u,s);for(var g=0,y=u.length;s!=null&&g<y;)s=s[Ai(u[g++])];return g&&g==y?s:l}function Qh(s,u,g){var y=u(s);return ot(s)?y:pi(y,g(s))}function Jn(s){return s==null?s===l?gn:ct:Hi&&Hi in Nt(s)?fg(s):co(s)}function Gu(s,u){return s>u}function Yh(s,u){return s!=null&&Rt.call(s,u)}function og(s,u){return s!=null&&u in Nt(s)}function Xh(s,u,g){return s>=Yt(u,g)&&s<fn(u,g)}function Qu(s,u,g){for(var y=g?Qo:_s,A=s[0].length,V=s.length,H=V,W=ee(V),X=1/0,he=[];H--;){var me=s[H];H&&u&&(me=At(me,at(u))),X=Yt(me.length,X),W[H]=!g&&(u||A>=120&&me.length>=120)?new En(H&&me):l}me=s[0];var pe=-1,Ae=W[0];e:for(;++pe<A&&he.length<X;){var ze=me[pe],Ye=u?u(ze):ze;if(ze=g||ze!==0?ze:0,!(Ae?qi(Ae,Ye):y(he,Ye,g))){for(H=V;--H;){var bt=W[H];if(!(bt?qi(bt,Ye):y(s[H],Ye,g)))continue e}Ae&&Ae.push(Ye),he.push(ze)}}return he}function Jh(s,u,g,y){return yi(s,function(A,V,H){u(y,g(A),V,H)}),y}function ts(s,u,g){u=fe(u,s),s=Ei(s,u);var y=s==null?s:s[Ai(To(u))];return y==null?l:In(y,s,g)}function Gi(s){return on(s)&&Jn(s)==qe}function ig(s){return on(s)&&Jn(s)==li}function Yu(s){return on(s)&&Jn(s)==Ue}function Ua(s,u,g,y,A){return s===u?!0:s==null||u==null||!on(s)&&!on(u)?s!==s&&u!==u:rg(s,u,g,y,Ua,A)}function rg(s,u,g,y,A,V){var H=ot(s),W=ot(u),X=H?$e:On(s),he=W?$e:On(u);X=X==qe?st:X,he=he==qe?st:he;var me=X==st,pe=he==st,Ae=X==he;if(Ae&&Ji(s)){if(!Ji(u))return!1;H=!0,me=!1}if(Ae&&!me)return V||(V=new Yo),H||Fs(s)?pm(s,u,g,y,A,V):gm(s,u,X,g,y,A,V);if(!(g&q)){var ze=me&&Rt.call(s,"__wrapped__"),Ye=pe&&Rt.call(u,"__wrapped__");if(ze||Ye){var bt=ze?s.value():s,Qe=Ye?u.value():u;return V||(V=new Yo),A(bt,Qe,g,y,V)}}return Ae?(V||(V=new Yo),ns(s,u,g,y,A,V)):!1}function sg(s){return on(s)&&On(s)==we}function Xu(s,u,g,y){var A=g.length,V=A,H=!y;if(s==null)return!V;for(s=Nt(s);A--;){var W=g[A];if(H&&W[2]?W[1]!==s[W[0]]:!(W[0]in s))return!1}for(;++A<V;){W=g[A];var X=W[0],he=s[X],me=W[1];if(H&&W[2]){if(he===l&&!(X in s))return!1}else{var pe=new Yo;if(y)var Ae=y(he,me,X,s,u,pe);if(!(Ae===l?Ua(me,he,q|K,y,pe):Ae))return!1}}return!0}function Zh(s){if(!it(s)||il(s))return!1;var u=ni(s)?Wp:jl;return u.test(xr(s))}function ag(s){return on(s)&&Jn(s)==ln}function lg(s){return on(s)&&On(s)==jt}function cg(s){return on(s)&&ls(s.length)&&!!Gt[Jn(s)]}function Ju(s){return typeof s=="function"?s:s==null?to:typeof s=="object"?ot(s)?nm(s[0],s[1]):tm(s):eh(s)}function Zu(s){if(!Is(s))return ic(s);var u=[];for(var g in Nt(s))Rt.call(s,g)&&g!="constructor"&&u.push(g);return u}function ug(s){if(!it(s))return Sn(s);var u=Is(s),g=[];for(var y in s)y=="constructor"&&(u||!Rt.call(s,y))||g.push(y);return g}function Wa(s,u){return s<u}function em(s,u){var g=-1,y=sn(s)?ee(s.length):[];return Wi(s,function(A,V,H){y[++g]=u(A,V,H)}),y}function tm(s){var u=gd(s);return u.length==1&&u[0][2]?un(u[0][0],u[0][1]):function(g){return g===s||Xu(g,s,u)}}function nm(s,u){return Ic(s)&&kd(u)?un(Ai(s),u):function(g){var y=Gc(g,s);return y===l&&y===u?Qc(g,s):Ua(u,y,q|K)}}function pc(s,u,g,y,A){s!==u&&Uu(u,function(V,H){if(A||(A=new Yo),it(V))dg(s,u,H,g,pc,y,A);else{var W=y?y(Ht(s,H),V,H+"",s,u,A):l;W===l&&(W=V),hc(s,H,W)}},zn)}function dg(s,u,g,y,A,V,H){var W=Ht(s,g),X=Ht(u,g),he=H.get(X);if(he){hc(s,g,he);return}var me=V?V(W,X,g+"",s,u,H):l,pe=me===l;if(pe){var Ae=ot(X),ze=!Ae&&Ji(X),Ye=!Ae&&!ze&&Fs(X);me=X,Ae||ze||Ye?ot(W)?me=W:dn(W)?me=lo(W):ze?(pe=!1,me=le(X,!0)):Ye?(pe=!1,me=lm(X,!0)):me=[]:Si(X)||ss(X)?(me=W,ss(W)?me=$d(W):(!it(W)||ni(W))&&(me=Dc(X))):pe=!1}pe&&(H.set(X,me),A(me,X,y,V,H),H.delete(X)),hc(s,g,me)}function om(s,u){var g=s.length;if(g)return u+=u<0?g:0,Rn(u,g)?s[u]:l}function ed(s,u,g){u.length?u=At(u,function(V){return ot(V)?function(H){return Ki(H,V.length===1?V[0]:V)}:V}):u=[to];var y=-1;u=At(u,at(Ge()));var A=em(s,function(V,H,W){var X=At(u,function(he){return he(V)});return{criteria:X,index:++y,value:V}});return Da(A,function(V,H){return mg(V,H,g)})}function gc(s,u){return td(s,u,function(g,y){return Qc(s,y)})}function td(s,u,g){for(var y=-1,A=u.length,V={};++y<A;){var H=u[y],W=Ki(s,H);g(W,H)&&yo(V,fe(H,s),W)}return V}function im(s){return function(u){return Ki(u,s)}}function Et(s,u,g,y){var A=y?Ql:Fi,V=-1,H=u.length,W=s;for(s===u&&(u=lo(u)),g&&(W=At(s,at(g)));++V<H;)for(var X=0,he=u[V],me=g?g(he):he;(X=A(W,me,X,y))>-1;)W!==s&&nc.call(W,X,1),nc.call(s,X,1);return s}function Ka(s,u){for(var g=s?u.length:0,y=g-1;g--;){var A=u[g];if(g==y||A!==V){var V=A;Rn(A)?nc.call(s,A,1):_c(s,A)}}return s}function bc(s,u){return s+La(sc()*(u-s+1))}function tn(s,u,g,y){for(var A=-1,V=fn(Gr((u-s)/(g||1)),0),H=ee(V);V--;)H[y?V:++A]=s,s+=g;return H}function vc(s,u){var g="";if(!s||u<1||u>Oe)return g;do u%2&&(g+=s),u=La(u/2),u&&(s+=s);while(u);return g}function dt(s,u){return Oc(eo(s,u,to),s+"")}function so(s){return Jr($s(s))}function Lo(s,u){var g=$s(s);return Rc(g,ki(u,0,g.length))}function yo(s,u,g,y){if(!it(s))return s;u=fe(u,s);for(var A=-1,V=u.length,H=V-1,W=s;W!=null&&++A<V;){var X=Ai(u[A]),he=g;if(X==="__proto__"||X==="constructor"||X==="prototype")return s;if(A!=H){var me=W[X];he=y?y(me,X,W):l,he===l&&(he=it(me)?me:Rn(u[A+1])?[]:{})}qa(W,X,he),W=W[X]}return s}var rm=lc?function(s,u){return lc.set(s,u),s}:to,sm=Xn?function(s,u){return Xn(s,"toString",{configurable:!0,enumerable:!1,value:Zc(u),writable:!0})}:to;function hg(s){return Rc($s(s))}function xo(s,u,g){var y=-1,A=s.length;u<0&&(u=-u>A?0:A+u),g=g>A?A:g,g<0&&(g+=A),A=u>g?0:g-u>>>0,u>>>=0;for(var V=ee(A);++y<A;)V[y]=s[y+u];return V}function am(s,u){var g;return Wi(s,function(y,A,V){return g=u(y,A,V),!g}),!!g}function Ga(s,u,g){var y=0,A=s==null?y:s.length;if(typeof u=="number"&&u===u&&A<=Ne){for(;y<A;){var V=y+A>>>1,H=s[V];H!==null&&!Ao(H)&&(g?H<=u:H<u)?y=V+1:A=V}return A}return wc(s,u,to,g)}function wc(s,u,g,y){var A=0,V=s==null?0:s.length;if(V===0)return 0;u=g(u);for(var H=u!==u,W=u===null,X=Ao(u),he=u===l;A<V;){var me=La((A+V)/2),pe=g(s[me]),Ae=pe!==l,ze=pe===null,Ye=pe===pe,bt=Ao(pe);if(H)var Qe=y||Ye;else he?Qe=Ye&&(y||Ae):W?Qe=Ye&&Ae&&(y||!ze):X?Qe=Ye&&Ae&&!ze&&(y||!bt):ze||bt?Qe=!1:Qe=y?pe<=u:pe<u;Qe?A=me+1:V=me}return Yt(V,mt)}function nd(s,u){for(var g=-1,y=s.length,A=0,V=[];++g<y;){var H=s[g],W=u?u(H):H;if(!g||!ti(W,X)){var X=W;V[A++]=H===0?0:H}}return V}function kc(s){return typeof s=="number"?s:Ao(s)?De:+s}function ao(s){if(typeof s=="string")return s;if(ot(s))return At(s,ao)+"";if(Ao(s))return Oh?Oh.call(s):"";var u=s+"";return u=="0"&&1/s==-Se?"-0":u}function Qi(s,u,g){var y=-1,A=_s,V=s.length,H=!0,W=[],X=W;if(g)H=!1,A=Qo;else if(V>=w){var he=u?null:mm(s);if(he)return I(he);H=!1,A=qi,X=new En}else X=u?[]:W;e:for(;++y<V;){var me=s[y],pe=u?u(me):me;if(me=g||me!==0?me:0,H&&pe===pe){for(var Ae=X.length;Ae--;)if(X[Ae]===pe)continue e;u&&X.push(pe),W.push(me)}else A(X,pe,g)||(X!==W&&X.push(pe),W.push(me))}return W}function _c(s,u){return u=fe(u,s),s=Ei(s,u),s==null||delete s[Ai(To(u))]}function _r(s,u,g,y){return yo(s,u,g(Ki(s,u)),y)}function It(s,u,g,y){for(var A=s.length,V=y?A:-1;(y?V--:++V<A)&&u(s[V],V,s););return g?xo(s,y?0:V,y?V+1:A):xo(s,y?V+1:0,y?A:V)}function Xo(s,u){var g=s;return g instanceof wt&&(g=g.value()),Ca(u,function(y,A){return A.func.apply(A.thisArg,pi([y],A.args))},g)}function yr(s,u,g){var y=s.length;if(y<2)return y?Qi(s[0]):[];for(var A=-1,V=ee(y);++A<y;)for(var H=s[A],W=-1;++W<y;)W!=A&&(V[A]=es(V[A]||H,s[W],u,g));return Qi(Mn(V,1),u,g)}function Pt(s,u,g){for(var y=-1,A=s.length,V=u.length,H={};++y<A;){var W=y<V?u[y]:l;g(H,s[y],W)}return H}function Jo(s){return dn(s)?s:[]}function Yi(s){return typeof s=="function"?s:to}function fe(s,u){return ot(s)?s:Ic(s,u)?[s]:yd(St(s))}var As=dt;function xi(s,u,g){var y=s.length;return g=g===l?y:g,!u&&g>=y?s:xo(s,u,g)}var od=Ih||function(s){return vn.clearTimeout(s)};function le(s,u){if(u)return s.slice();var g=s.length,y=Ah?Ah(g):new s.constructor(g);return s.copy(y),y}function Qa(s){var u=new s.constructor(s.byteLength);return new tc(u).set(new tc(s)),u}function yc(s,u){var g=u?Qa(s.buffer):s.buffer;return new s.constructor(g,s.byteOffset,s.byteLength)}function xc(s){var u=new s.constructor(s.source,Li.exec(s));return u.lastIndex=s.lastIndex,u}function id(s){return ut?Nt(ut.call(s)):{}}function lm(s,u){var g=u?Qa(s.buffer):s.buffer;return new s.constructor(g,s.byteOffset,s.length)}function rd(s,u){if(s!==u){var g=s!==l,y=s===null,A=s===s,V=Ao(s),H=u!==l,W=u===null,X=u===u,he=Ao(u);if(!W&&!he&&!V&&s>u||V&&H&&X&&!W&&!he||y&&H&&X||!g&&X||!A)return 1;if(!y&&!V&&!he&&s<u||he&&g&&A&&!y&&!V||W&&g&&A||!H&&A||!X)return-1}return 0}function mg(s,u,g){for(var y=-1,A=s.criteria,V=u.criteria,H=A.length,W=g.length;++y<H;){var X=rd(A[y],V[y]);if(X){if(y>=W)return X;var he=g[y];return X*(he=="desc"?-1:1)}}return s.index-u.index}function Ni(s,u,g,y){for(var A=-1,V=s.length,H=g.length,W=-1,X=u.length,he=fn(V-H,0),me=ee(X+he),pe=!y;++W<X;)me[W]=u[W];for(;++A<H;)(pe||A<V)&&(me[g[A]]=s[A]);for(;he--;)me[W++]=s[A++];return me}function sd(s,u,g,y){for(var A=-1,V=s.length,H=-1,W=g.length,X=-1,he=u.length,me=fn(V-W,0),pe=ee(me+he),Ae=!y;++A<me;)pe[A]=s[A];for(var ze=A;++X<he;)pe[ze+X]=u[X];for(;++H<W;)(Ae||A<V)&&(pe[ze+g[H]]=s[A++]);return pe}function lo(s,u){var g=-1,y=s.length;for(u||(u=ee(y));++g<y;)u[g]=s[g];return u}function Zo(s,u,g,y){var A=!g;g||(g={});for(var V=-1,H=u.length;++V<H;){var W=u[V],X=y?y(g[W],s[W],W,g,s):l;X===l&&(X=s[W]),A?Ui(g,W,X):qa(g,W,X)}return g}function ad(s,u){return Zo(s,bd(s),u)}function Ti(s,u){return Zo(s,vd(s),u)}function Nc(s,u){return function(g,y){var A=ot(g)?Na:qu,V=u?u():{};return A(g,s,Ge(y,2),V)}}function Ss(s){return dt(function(u,g){var y=-1,A=g.length,V=A>1?g[A-1]:l,H=A>2?g[2]:l;for(V=s.length>3&&typeof V=="function"?(A--,V):l,H&&Vn(g[0],g[1],H)&&(V=A<3?l:V,A=1),u=Nt(u);++y<A;){var W=g[y];W&&s(u,W,y,V)}return u})}function zo(s,u){return function(g,y){if(g==null)return g;if(!sn(g))return s(g,y);for(var A=g.length,V=u?A:-1,H=Nt(g);(u?V--:++V<A)&&y(H[V],V,H)!==!1;);return g}}function cm(s){return function(u,g,y){for(var A=-1,V=Nt(u),H=y(u),W=H.length;W--;){var X=H[s?W:++A];if(g(V[X],X,V)===!1)break}return u}}function Tc(s,u,g){var y=u&te,A=Ya(s);function V(){var H=this&&this!==vn&&this instanceof V?A:s;return H.apply(y?g:this,arguments)}return V}function ld(s){return function(u){u=St(u);var g=Tt(u)?Ve(u):l,y=g?g[0]:u.charAt(0),A=g?xi(g,1).join(""):u.slice(1);return y[s]()+A}}function Zn(s){return function(u){return Ca(Hf(oi(u).replace(Hl,"")),s,"")}}function Ya(s){return function(){var u=arguments;switch(u.length){case 0:return new s;case 1:return new s(u[0]);case 2:return new s(u[0],u[1]);case 3:return new s(u[0],u[1],u[2]);case 4:return new s(u[0],u[1],u[2],u[3]);case 5:return new s(u[0],u[1],u[2],u[3],u[4]);case 6:return new s(u[0],u[1],u[2],u[3],u[4],u[5]);case 7:return new s(u[0],u[1],u[2],u[3],u[4],u[5],u[6])}var g=vr(s.prototype),y=s.apply(g,u);return it(y)?y:g}}function um(s,u,g){var y=Ya(s);function A(){for(var V=arguments.length,H=ee(V),W=V,X=js(A);W--;)H[W]=arguments[W];var he=V<3&&H[0]!==X&&H[V-1]!==X?[]:D(H,X);if(V-=he.length,V<g)return Ec(s,u,Ja,A.placeholder,l,H,he,l,l,g-V);var me=this&&this!==vn&&this instanceof A?y:s;return In(me,this,H)}return A}function cd(s){return function(u,g,y){var A=Nt(u);if(!sn(u)){var V=Ge(g,3);u=kn(u),g=function(W){return V(A[W],W,A)}}var H=s(u,g,y);return H>-1?A[V?u[H]:H]:l}}function Xa(s){return Xi(function(u){var g=u.length,y=g,A=ko.prototype.thru;for(s&&u.reverse();y--;){var V=u[y];if(typeof V!="function")throw new ro(v);if(A&&!H&&Ac(V)=="wrapper")var H=new ko([],!0)}for(y=H?y:g;++y<g;){V=u[y];var W=Ac(V),X=W=="wrapper"?pd(V):l;X&&Pc(X[0])&&X[1]==(de|Y|ie|je)&&!X[4].length&&X[9]==1?H=H[Ac(X[0])].apply(H,X[3]):H=V.length==1&&Pc(V)?H[W]():H.thru(V)}return function(){var he=arguments,me=he[0];if(H&&he.length==1&&ot(me))return H.plant(me).value();for(var pe=0,Ae=g?u[pe].apply(this,he):me;++pe<g;)Ae=u[pe].call(this,Ae);return Ae}})}function Ja(s,u,g,y,A,V,H,W,X,he){var me=u&de,pe=u&te,Ae=u&se,ze=u&(Y|oe),Ye=u&Ie,bt=Ae?l:Ya(s);function Qe(){for(var vt=arguments.length,kt=ee(vt),uo=vt;uo--;)kt[uo]=arguments[uo];if(ze)var $n=js(Qe),Do=Tn(kt,$n);if(y&&(kt=Ni(kt,y,A,ze)),V&&(kt=sd(kt,V,H,ze)),vt-=Do,ze&&vt<he){var pn=D(kt,$n);return Ec(s,u,Ja,Qe.placeholder,g,kt,pn,W,X,he-vt)}var ii=pe?g:this,tr=Ae?ii[s]:s;return vt=kt.length,W?kt=wn(kt,W):Ye&&vt>1&&kt.reverse(),me&&X<vt&&(kt.length=X),this&&this!==vn&&this instanceof Qe&&(tr=bt||Ya(tr)),tr.apply(ii,kt)}return Qe}function ud(s,u){return function(g,y){return Jh(g,s,u(y),{})}}function Ds(s,u){return function(g,y){var A;if(g===l&&y===l)return u;if(g!==l&&(A=g),y!==l){if(A===l)return y;typeof g=="string"||typeof y=="string"?(g=ao(g),y=ao(y)):(g=kc(g),y=kc(y)),A=s(g,y)}return A}}function Cc(s){return Xi(function(u){return u=At(u,at(Ge())),dt(function(g){var y=this;return s(u,function(A){return In(A,y,g)})})})}function Za(s,u){u=u===l?" ":ao(u);var g=u.length;if(g<2)return g?vc(u,s):u;var y=vc(u,Gr(s/Te(u)));return Tt(u)?xi(Ve(y),0,s).join(""):y.slice(0,s)}function dm(s,u,g,y){var A=u&te,V=Ya(s);function H(){for(var W=-1,X=arguments.length,he=-1,me=y.length,pe=ee(me+X),Ae=this&&this!==vn&&this instanceof H?V:s;++he<me;)pe[he]=y[he];for(;X--;)pe[he++]=arguments[++W];return In(Ae,A?g:this,pe)}return H}function hm(s){return function(u,g,y){return y&&typeof y!="number"&&Vn(u,g,y)&&(g=y=l),u=er(u),g===l?(g=u,u=0):g=er(g),y=y===l?u<g?1:-1:er(y),tn(u,g,y,s)}}function el(s){return function(u,g){return typeof u=="string"&&typeof g=="string"||(u=So(u),g=So(g)),s(u,g)}}function Ec(s,u,g,y,A,V,H,W,X,he){var me=u&Y,pe=me?H:l,Ae=me?l:H,ze=me?V:l,Ye=me?l:V;u|=me?ie:ge,u&=~(me?ge:ie),u&Z||(u&=~(te|se));var bt=[s,u,A,ze,pe,Ye,Ae,W,X,he],Qe=g.apply(l,bt);return Pc(s)&&Mc(Qe,bt),Qe.placeholder=y,_d(Qe,s,u)}function tl(s){var u=Ot[s];return function(g,y){if(g=So(g),y=y==null?0:Yt(lt(y),292),y&&ye(g)){var A=(St(g)+"e").split("e"),V=u(A[0]+"e"+(+A[1]+y));return A=(St(V)+"e").split("e"),+(A[0]+"e"+(+A[1]-y))}return u(g)}}var mm=gr&&1/I(new gr([,-0]))[1]==Se?function(s){return new gr(s)}:bl;function dd(s){return function(u){var g=On(u);return g==we?Oo(u):g==jt?B(u):Xl(u,s(u))}}function Ci(s,u,g,y,A,V,H,W){var X=u&se;if(!X&&typeof s!="function")throw new ro(v);var he=y?y.length:0;if(he||(u&=~(ie|ge),y=A=l),H=H===l?H:fn(lt(H),0),W=W===l?W:lt(W),he-=A?A.length:0,u&ge){var me=y,pe=A;y=A=l}var Ae=X?l:pd(s),ze=[s,u,g,y,A,me,pe,V,H,W];if(Ae&&Vt(ze,Ae),s=ze[0],u=ze[1],g=ze[2],y=ze[3],A=ze[4],W=ze[9]=ze[9]===l?X?0:s.length:fn(ze[9]-he,0),!W&&u&(Y|oe)&&(u&=~(Y|oe)),!u||u==te)var Ye=Tc(s,u,g);else u==Y||u==oe?Ye=um(s,u,W):(u==ie||u==(te|ie))&&!A.length?Ye=dm(s,u,g,y):Ye=Ja.apply(l,ze);var bt=Ae?rm:Mc;return _d(bt(Ye,ze),s,u)}function hd(s,u,g,y){return s===l||ti(s,fr[g])&&!Rt.call(y,g)?u:s}function fm(s,u,g,y,A,V){return it(s)&&it(u)&&(V.set(u,s),pc(s,u,l,fm,V),V.delete(u)),s}function nl(s){return Si(s)?l:s}function pm(s,u,g,y,A,V){var H=g&q,W=s.length,X=u.length;if(W!=X&&!(H&&X>W))return!1;var he=V.get(s),me=V.get(u);if(he&&me)return he==u&&me==s;var pe=-1,Ae=!0,ze=g&K?new En:l;for(V.set(s,u),V.set(u,s);++pe<W;){var Ye=s[pe],bt=u[pe];if(y)var Qe=H?y(bt,Ye,pe,u,s,V):y(Ye,bt,pe,s,u,V);if(Qe!==l){if(Qe)continue;Ae=!1;break}if(ze){if(!dr(u,function(vt,kt){if(!qi(ze,kt)&&(Ye===vt||A(Ye,vt,g,y,V)))return ze.push(kt)})){Ae=!1;break}}else if(!(Ye===bt||A(Ye,bt,g,y,V))){Ae=!1;break}}return V.delete(s),V.delete(u),Ae}function gm(s,u,g,y,A,V,H){switch(g){case go:if(s.byteLength!=u.byteLength||s.byteOffset!=u.byteOffset)return!1;s=s.buffer,u=u.buffer;case li:return!(s.byteLength!=u.byteLength||!V(new tc(s),new tc(u)));case nt:case Ue:case Re:return ti(+s,+u);case et:return s.name==u.name&&s.message==u.message;case ln:case Wo:return s==u+"";case we:var W=Oo;case jt:var X=y&q;if(W||(W=I),s.size!=u.size&&!X)return!1;var he=H.get(s);if(he)return he==u;y|=K,H.set(s,u);var me=pm(W(s),W(u),y,A,V,H);return H.delete(s),me;case or:if(ut)return ut.call(s)==ut.call(u)}return!1}function ns(s,u,g,y,A,V){var H=g&q,W=md(s),X=W.length,he=md(u),me=he.length;if(X!=me&&!H)return!1;for(var pe=X;pe--;){var Ae=W[pe];if(!(H?Ae in u:Rt.call(u,Ae)))return!1}var ze=V.get(s),Ye=V.get(u);if(ze&&Ye)return ze==u&&Ye==s;var bt=!0;V.set(s,u),V.set(u,s);for(var Qe=H;++pe<X;){Ae=W[pe];var vt=s[Ae],kt=u[Ae];if(y)var uo=H?y(kt,vt,Ae,u,s,V):y(vt,kt,Ae,s,u,V);if(!(uo===l?vt===kt||A(vt,kt,g,y,V):uo)){bt=!1;break}Qe||(Qe=Ae=="constructor")}if(bt&&!Qe){var $n=s.constructor,Do=u.constructor;$n!=Do&&"constructor"in s&&"constructor"in u&&!(typeof $n=="function"&&$n instanceof $n&&typeof Do=="function"&&Do instanceof Do)&&(bt=!1)}return V.delete(s),V.delete(u),bt}function Xi(s){return Oc(eo(s,l,Cm),s+"")}function md(s){return Qh(s,kn,bd)}function fd(s){return Qh(s,zn,vd)}var pd=lc?function(s){return lc.get(s)}:bl;function Ac(s){for(var u=s.name+"",g=br[u],y=Rt.call(br,u)?g.length:0;y--;){var A=g[y],V=A.func;if(V==null||V==s)return A.name}return u}function js(s){var u=Rt.call(M,"placeholder")?M:s;return u.placeholder}function Ge(){var s=M.iteratee||tu;return s=s===tu?Ju:s,arguments.length?s(arguments[0],arguments[1]):s}function Sc(s,u){var g=s.__data__;return ol(u)?g[typeof u=="string"?"string":"hash"]:g.map}function gd(s){for(var u=kn(s),g=u.length;g--;){var y=u[g],A=s[y];u[g]=[y,A,kd(A)]}return u}function No(s,u){var g=Ts(s,u);return Zh(g)?g:l}function fg(s){var u=Rt.call(s,Hi),g=s[Hi];try{s[Hi]=l;var y=!0}catch{}var A=Wr.call(s);return y&&(u?s[Hi]=g:delete s[Hi]),A}var bd=Mu?function(s){return s==null?[]:(s=Nt(s),fi(Mu(s),function(u){return Dh.call(s,u)}))}:Ws,vd=Mu?function(s){for(var u=[];s;)pi(u,bd(s)),s=Va(s);return u}:Ws,On=Jn;(Yr&&On(new Yr(new ArrayBuffer(1)))!=go||gi&&On(new gi)!=we||ac&&On(ac.resolve())!=Bt||gr&&On(new gr)!=jt||$i&&On(new $i)!=ai)&&(On=function(s){var u=Jn(s),g=u==st?s.constructor:l,y=g?xr(g):"";if(y)switch(y){case Mh:return go;case Gp:return we;case za:return Bt;case Cn:return jt;case Qp:return ai}return u});function pg(s,u,g){for(var y=-1,A=g.length;++y<A;){var V=g[y],H=V.size;switch(V.type){case"drop":s+=H;break;case"dropRight":u-=H;break;case"take":u=Yt(u,s+H);break;case"takeRight":s=fn(s,u-H);break}}return{start:s,end:u}}function gg(s){var u=s.match(Mr);return u?u[1].split(fs):[]}function wd(s,u,g){u=fe(u,s);for(var y=-1,A=u.length,V=!1;++y<A;){var H=Ai(u[y]);if(!(V=s!=null&&g(s,H)))break;s=s[H]}return V||++y!=A?V:(A=s==null?0:s.length,!!A&&ls(A)&&Rn(H,A)&&(ot(s)||ss(s)))}function bg(s){var u=s.length,g=new s.constructor(u);return u&&typeof s[0]=="string"&&Rt.call(s,"index")&&(g.index=s.index,g.input=s.input),g}function Dc(s){return typeof s.constructor=="function"&&!Is(s)?vr(Va(s)):{}}function bm(s,u,g){var y=s.constructor;switch(u){case li:return Qa(s);case nt:case Ue:return new y(+s);case go:return yc(s,g);case jr:case Oi:case Ir:case Ri:case bo:case ft:case Jt:case mn:case bn:return lm(s,g);case we:return new y;case Re:case Wo:return new y(s);case ln:return xc(s);case jt:return new y;case or:return id(s)}}function jc(s,u){var g=u.length;if(!g)return s;var y=g-1;return u[y]=(g>1?"& ":"")+u[y],u=u.join(g>2?", ":" "),s.replace(vo,`{
/* [wrapped with `+u+`] */
`)}function Bo(s){return ot(s)||ss(s)||!!(jh&&s&&s[jh])}function Rn(s,u){var g=typeof s;return u=u??Oe,!!u&&(g=="number"||g!="symbol"&&Il.test(s))&&s>-1&&s%1==0&&s<u}function Vn(s,u,g){if(!it(g))return!1;var y=typeof u;return(y=="number"?sn(g)&&Rn(u,g.length):y=="string"&&u in g)?ti(g[u],s):!1}function Ic(s,u){if(ot(s))return!1;var g=typeof s;return g=="number"||g=="symbol"||g=="boolean"||s==null||Ao(s)?!0:Dl.test(s)||!yu.test(s)||u!=null&&s in Nt(u)}function ol(s){var u=typeof s;return u=="string"||u=="number"||u=="symbol"||u=="boolean"?s!=="__proto__":s===null}function Pc(s){var u=Ac(s),g=M[u];if(typeof g!="function"||!(u in wt.prototype))return!1;if(s===g)return!0;var y=pd(g);return!!y&&s===y[0]}function il(s){return!!Eh&&Eh in s}var rl=Oa?ni:th;function Is(s){var u=s&&s.constructor,g=typeof u=="function"&&u.prototype||fr;return s===g}function kd(s){return s===s&&!it(s)}function un(s,u){return function(g){return g==null?!1:g[s]===u&&(u!==l||s in Nt(g))}}function vg(s){var u=$c(s,function(y){return g.size===O&&g.clear(),y}),g=u.cache;return u}function Vt(s,u){var g=s[1],y=u[1],A=g|y,V=A<(te|se|de),H=y==de&&g==Y||y==de&&g==je&&s[7].length<=u[8]||y==(de|je)&&u[7].length<=u[8]&&g==Y;if(!(V||H))return s;y&te&&(s[2]=u[2],A|=g&te?0:Z);var W=u[3];if(W){var X=s[3];s[3]=X?Ni(X,W,u[4]):W,s[4]=X?D(s[3],C):u[4]}return W=u[5],W&&(X=s[5],s[5]=X?sd(X,W,u[6]):W,s[6]=X?D(s[5],C):u[6]),W=u[7],W&&(s[7]=W),y&de&&(s[8]=s[8]==null?u[8]:Yt(s[8],u[8])),s[9]==null&&(s[9]=u[9]),s[0]=u[0],s[1]=A,s}function Sn(s){var u=[];if(s!=null)for(var g in Nt(s))u.push(g);return u}function co(s){return Wr.call(s)}function eo(s,u,g){return u=fn(u===l?s.length-1:u,0),function(){for(var y=arguments,A=-1,V=fn(y.length-u,0),H=ee(V);++A<V;)H[A]=y[u+A];A=-1;for(var W=ee(u+1);++A<u;)W[A]=y[A];return W[u]=g(H),In(s,this,W)}}function Ei(s,u){return u.length<2?s:Ki(s,xo(u,0,-1))}function wn(s,u){for(var g=s.length,y=Yt(u.length,g),A=lo(s);y--;){var V=u[y];s[y]=Rn(V,g)?A[V]:l}return s}function Ht(s,u){if(!(u==="constructor"&&typeof s[u]=="function")&&u!="__proto__")return s[u]}var Mc=Ps(rm),sl=Ph||function(s,u){return vn.setTimeout(s,u)},Oc=Ps(sm);function _d(s,u,g){var y=u+"";return Oc(s,jc(y,wg(gg(y),g)))}function Ps(s){var u=0,g=0;return function(){var y=Ou(),A=be-(y-g);if(g=y,A>0){if(++u>=ae)return arguments[0]}else u=0;return s.apply(l,arguments)}}function Rc(s,u){var g=-1,y=s.length,A=y-1;for(u=u===l?y:u;++g<u;){var V=bc(g,A),H=s[V];s[V]=s[g],s[g]=H}return s.length=u,s}var yd=vg(function(s){var u=[];return s.charCodeAt(0)===46&&u.push(""),s.replace(xu,function(g,y,A,V){u.push(A?V.replace(sr,"$1"):y||g)}),u});function Ai(s){if(typeof s=="string"||Ao(s))return s;var u=s+"";return u=="0"&&1/s==-Se?"-0":u}function xr(s){if(s!=null){try{return Ra.call(s)}catch{}try{return s+""}catch{}}return""}function wg(s,u){return oo(Le,function(g){var y="_."+g[0];u&g[1]&&!_s(s,y)&&s.push(y)}),s.sort()}function vm(s){if(s instanceof wt)return s.clone();var u=new ko(s.__wrapped__,s.__chain__);return u.__actions__=lo(s.__actions__),u.__index__=s.__index__,u.__values__=s.__values__,u}function kg(s,u,g){(g?Vn(s,u,g):u===l)?u=1:u=fn(lt(u),0);var y=s==null?0:s.length;if(!y||u<1)return[];for(var A=0,V=0,H=ee(Gr(y/u));A<y;)H[V++]=xo(s,A,A+=u);return H}function wm(s){for(var u=-1,g=s==null?0:s.length,y=0,A=[];++u<g;){var V=s[u];V&&(A[y++]=V)}return A}function km(){var s=arguments.length;if(!s)return[];for(var u=ee(s-1),g=arguments[0],y=s;y--;)u[y-1]=arguments[y];return pi(ot(g)?lo(g):[g],Mn(u,1))}var _m=dt(function(s,u){return dn(s)?es(s,Mn(u,1,dn,!0)):[]}),ym=dt(function(s,u){var g=To(u);return dn(g)&&(g=l),dn(s)?es(s,Mn(u,1,dn,!0),Ge(g,2)):[]}),xm=dt(function(s,u){var g=To(u);return dn(g)&&(g=l),dn(s)?es(s,Mn(u,1,dn,!0),l,g):[]});function al(s,u,g){var y=s==null?0:s.length;return y?(u=g||u===l?1:lt(u),xo(s,u<0?0:u,y)):[]}function Dn(s,u,g){var y=s==null?0:s.length;return y?(u=g||u===l?1:lt(u),u=y-u,xo(s,0,u<0?0:u)):[]}function ei(s,u){return s&&s.length?It(s,Ge(u,3),!0,!0):[]}function Ln(s,u){return s&&s.length?It(s,Ge(u,3),!0):[]}function _g(s,u,g,y){var A=s==null?0:s.length;return A?(g&&typeof g!="number"&&Vn(s,u,g)&&(g=0,y=A),fc(s,u,g,y)):[]}function Nm(s,u,g){var y=s==null?0:s.length;if(!y)return-1;var A=g==null?0:lt(g);return A<0&&(A=fn(y+A,0)),hr(s,Ge(u,3),A)}function Tm(s,u,g){var y=s==null?0:s.length;if(!y)return-1;var A=y-1;return g!==l&&(A=lt(g),A=g<0?fn(y+A,0):Yt(A,y-1)),hr(s,Ge(u,3),A,!0)}function Cm(s){var u=s==null?0:s.length;return u?Mn(s,1):[]}function xd(s){var u=s==null?0:s.length;return u?Mn(s,Se):[]}function Em(s,u){var g=s==null?0:s.length;return g?(u=u===l?1:lt(u),Mn(s,u)):[]}function Am(s){for(var u=-1,g=s==null?0:s.length,y={};++u<g;){var A=s[u];y[A[0]]=A[1]}return y}function Sm(s){return s&&s.length?s[0]:l}function yg(s,u,g){var y=s==null?0:s.length;if(!y)return-1;var A=g==null?0:lt(g);return A<0&&(A=fn(y+A,0)),Fi(s,u,A)}function xg(s){var u=s==null?0:s.length;return u?xo(s,0,-1):[]}var Ng=dt(function(s){var u=At(s,Jo);return u.length&&u[0]===s[0]?Qu(u):[]}),Dm=dt(function(s){var u=To(s),g=At(s,Jo);return u===To(g)?u=l:g.pop(),g.length&&g[0]===s[0]?Qu(g,Ge(u,2)):[]}),Tg=dt(function(s){var u=To(s),g=At(s,Jo);return u=typeof u=="function"?u:l,u&&g.pop(),g.length&&g[0]===s[0]?Qu(g,l,u):[]});function Cg(s,u){return s==null?"":Ze.call(s,u)}function To(s){var u=s==null?0:s.length;return u?s[u-1]:l}function jm(s,u,g){var y=s==null?0:s.length;if(!y)return-1;var A=y;return g!==l&&(A=lt(g),A=A<0?fn(y+A,0):Yt(A,y-1)),u===u?Me(s,u,A):hr(s,Mt,A,!0)}function Im(s,u){return s&&s.length?om(s,lt(u)):l}var Eg=dt(Nd);function Nd(s,u){return s&&s.length&&u&&u.length?Et(s,u):s}function Ag(s,u,g){return s&&s.length&&u&&u.length?Et(s,u,Ge(g,2)):s}function Td(s,u,g){return s&&s.length&&u&&u.length?Et(s,u,l,g):s}var Pm=Xi(function(s,u){var g=s==null?0:s.length,y=$u(s,u);return Ka(s,At(u,function(A){return Rn(A,g)?+A:A}).sort(rd)),y});function Sg(s,u){var g=[];if(!(s&&s.length))return g;var y=-1,A=[],V=s.length;for(u=Ge(u,3);++y<V;){var H=s[y];u(H,y,s)&&(g.push(H),A.push(y))}return Ka(s,A),g}function Cd(s){return s==null?s:Kp.call(s)}function Mm(s,u,g){var y=s==null?0:s.length;return y?(g&&typeof g!="number"&&Vn(s,u,g)?(u=0,g=y):(u=u==null?0:lt(u),g=g===l?y:lt(g)),xo(s,u,g)):[]}function Co(s,u){return Ga(s,u)}function Ed(s,u,g){return wc(s,u,Ge(g,2))}function Ad(s,u){var g=s==null?0:s.length;if(g){var y=Ga(s,u);if(y<g&&ti(s[y],u))return y}return-1}function Sd(s,u){return Ga(s,u,!0)}function os(s,u,g){return wc(s,u,Ge(g,2),!0)}function gt(s,u){var g=s==null?0:s.length;if(g){var y=Ga(s,u,!0)-1;if(ti(s[y],u))return y}return-1}function Eo(s){return s&&s.length?nd(s):[]}function ll(s,u){return s&&s.length?nd(s,Ge(u,2)):[]}function Dg(s){var u=s==null?0:s.length;return u?xo(s,1,u):[]}function Om(s,u,g){return s&&s.length?(u=g||u===l?1:lt(u),xo(s,0,u<0?0:u)):[]}function Vc(s,u,g){var y=s==null?0:s.length;return y?(u=g||u===l?1:lt(u),u=y-u,xo(s,u<0?0:u,y)):[]}function Rm(s,u){return s&&s.length?It(s,Ge(u,3),!1,!0):[]}function jg(s,u){return s&&s.length?It(s,Ge(u,3)):[]}var Ig=dt(function(s){return Qi(Mn(s,1,dn,!0))}),Pg=dt(function(s){var u=To(s);return dn(u)&&(u=l),Qi(Mn(s,1,dn,!0),Ge(u,2))}),Vm=dt(function(s){var u=To(s);return u=typeof u=="function"?u:l,Qi(Mn(s,1,dn,!0),l,u)});function Lm(s){return s&&s.length?Qi(s):[]}function zm(s,u){return s&&s.length?Qi(s,Ge(u,2)):[]}function Bm(s,u){return u=typeof u=="function"?u:l,s&&s.length?Qi(s,l,u):[]}function Lc(s){if(!(s&&s.length))return[];var u=0;return s=fi(s,function(g){if(dn(g))return u=fn(g.length,u),!0}),Ia(u,function(g){return At(s,Sa(g))})}function is(s,u){if(!(s&&s.length))return[];var g=Lc(s);return u==null?g:At(g,function(y){return In(u,l,y)})}var zc=dt(function(s,u){return dn(s)?es(s,u):[]}),Dd=dt(function(s){return yr(fi(s,dn))}),jd=dt(function(s){var u=To(s);return dn(u)&&(u=l),yr(fi(s,dn),Ge(u,2))}),Fm=dt(function(s){var u=To(s);return u=typeof u=="function"?u:l,yr(fi(s,dn),l,u)}),Mg=dt(Lc);function Bc(s,u){return Pt(s||[],u||[],qa)}function qm(s,u){return Pt(s||[],u||[],yo)}var nn=dt(function(s){var u=s.length,g=u>1?s[u-1]:l;return g=typeof g=="function"?(s.pop(),g):l,is(s,g)});function Fc(s){var u=M(s);return u.__chain__=!0,u}function Ms(s,u){return u(s),s}function Os(s,u){return u(s)}var Hm=Xi(function(s){var u=s.length,g=u?s[0]:0,y=this.__wrapped__,A=function(V){return $u(V,s)};return u>1||this.__actions__.length||!(y instanceof wt)||!Rn(g)?this.thru(A):(y=y.slice(g,+g+(u?1:0)),y.__actions__.push({func:Os,args:[A],thisArg:l}),new ko(y,this.__chain__).thru(function(V){return u&&!V.length&&V.push(l),V}))});function $m(){return Fc(this)}function Um(){return new ko(this.value(),this.__chain__)}function Og(){this.__values__===l&&(this.__values__=qd(this.value()));var s=this.__index__>=this.__values__.length,u=s?l:this.__values__[this.__index__++];return{done:s,value:u}}function Wm(){return this}function Id(s){for(var u,g=this;g instanceof Ba;){var y=vm(g);y.__index__=0,y.__values__=l,u?A.__wrapped__=y:u=y;var A=y;g=g.__wrapped__}return A.__wrapped__=s,u}function Km(){var s=this.__wrapped__;if(s instanceof wt){var u=s;return this.__actions__.length&&(u=new wt(this)),u=u.reverse(),u.__actions__.push({func:Os,args:[Cd],thisArg:l}),new ko(u,this.__chain__)}return this.thru(Cd)}function Gm(){return Xo(this.__wrapped__,this.__actions__)}var Rs=Nc(function(s,u,g){Rt.call(s,g)?++s[g]:Ui(s,g,1)});function Qm(s,u,g){var y=ot(s)?Ta:ng;return g&&Vn(s,u,g)&&(u=l),y(s,Ge(u,3))}function Rg(s,u){var g=ot(s)?fi:Gh;return g(s,Ge(u,3))}var Ym=cd(Nm),Pd=cd(Tm);function Vg(s,u){return Mn(qc(s,u),1)}function Lg(s,u){return Mn(qc(s,u),Se)}function zg(s,u,g){return g=g===l?1:lt(g),Mn(qc(s,u),g)}function Xm(s,u){var g=ot(s)?oo:Wi;return g(s,Ge(u,3))}function Jm(s,u){var g=ot(s)?Kl:_i;return g(s,Ge(u,3))}var Bg=Nc(function(s,u,g){Rt.call(s,g)?s[g].push(u):Ui(s,g,[u])});function rs(s,u,g,y){s=sn(s)?s:$s(s),g=g&&!y?lt(g):0;var A=s.length;return g<0&&(g=fn(A+g,0)),ml(s)?g<=A&&s.indexOf(u,g)>-1:!!A&&Fi(s,u,g)>-1}var Zm=dt(function(s,u,g){var y=-1,A=typeof u=="function",V=sn(s)?ee(s.length):[];return Wi(s,function(H){V[++y]=A?In(u,H,g):ts(H,u,g)}),V}),ef=Nc(function(s,u,g){Ui(s,g,u)});function qc(s,u){var g=ot(s)?At:em;return g(s,Ge(u,3))}function tf(s,u,g,y){return s==null?[]:(ot(u)||(u=u==null?[]:[u]),g=y?l:g,ot(g)||(g=g==null?[]:[g]),ed(s,u,g))}var Fg=Nc(function(s,u,g){s[g?0:1].push(u)},function(){return[[],[]]});function qg(s,u,g){var y=ot(s)?Ca:Yl,A=arguments.length<3;return y(s,Ge(u,4),g,A,Wi)}function Hg(s,u,g){var y=ot(s)?ys:Yl,A=arguments.length<3;return y(s,Ge(u,4),g,A,_i)}function $g(s,u){var g=ot(s)?fi:Gh;return g(s,ul(Ge(u,3)))}function Md(s){var u=ot(s)?Jr:so;return u(s)}function Od(s,u,g){(g?Vn(s,u,g):u===l)?u=1:u=lt(u);var y=ot(s)?Uh:Lo;return y(s,u)}function Rd(s){var u=ot(s)?Wh:hg;return u(s)}function Vd(s){if(s==null)return 0;if(sn(s))return ml(s)?Te(s):s.length;var u=On(s);return u==we||u==jt?s.size:Zu(s).length}function nf(s,u,g){var y=ot(s)?dr:am;return g&&Vn(s,u,g)&&(u=l),y(s,Ge(u,3))}var of=dt(function(s,u){if(s==null)return[];var g=u.length;return g>1&&Vn(s,u[0],u[1])?u=[]:g>2&&Vn(u[0],u[1],u[2])&&(u=[u[0]]),ed(s,Mn(u,1),[])}),ht=oc||function(){return vn.Date.now()};function Ld(s,u){if(typeof u!="function")throw new ro(v);return s=lt(s),function(){if(--s<1)return u.apply(this,arguments)}}function qn(s,u,g){return u=g?l:u,u=s&&u==null?s.length:u,Ci(s,de,l,l,l,l,u)}function Hn(s,u){var g;if(typeof u!="function")throw new ro(v);return s=lt(s),function(){return--s>0&&(g=u.apply(this,arguments)),s<=1&&(u=l),g}}var Vs=dt(function(s,u,g){var y=te;if(g.length){var A=D(g,js(Vs));y|=ie}return Ci(s,y,u,g,A)}),cl=dt(function(s,u,g){var y=te|se;if(g.length){var A=D(g,js(cl));y|=ie}return Ci(u,y,s,g,A)});function rf(s,u,g){u=g?l:u;var y=Ci(s,Y,l,l,l,l,l,u);return y.placeholder=rf.placeholder,y}function sf(s,u,g){u=g?l:u;var y=Ci(s,oe,l,l,l,l,l,u);return y.placeholder=sf.placeholder,y}function Ls(s,u,g){var y,A,V,H,W,X,he=0,me=!1,pe=!1,Ae=!0;if(typeof s!="function")throw new ro(v);u=So(u)||0,it(g)&&(me=!!g.leading,pe="maxWait"in g,V=pe?fn(So(g.maxWait)||0,u):V,Ae="trailing"in g?!!g.trailing:Ae);function ze(pn){var ii=y,tr=A;return y=A=l,he=pn,H=s.apply(tr,ii),H}function Ye(pn){return he=pn,W=sl(vt,u),me?ze(pn):H}function bt(pn){var ii=pn-X,tr=pn-he,sh=u-ii;return pe?Yt(sh,V-tr):sh}function Qe(pn){var ii=pn-X,tr=pn-he;return X===l||ii>=u||ii<0||pe&&tr>=V}function vt(){var pn=ht();if(Qe(pn))return kt(pn);W=sl(vt,bt(pn))}function kt(pn){return W=l,Ae&&y?ze(pn):(y=A=l,H)}function uo(){W!==l&&od(W),he=0,y=X=A=W=l}function $n(){return W===l?H:kt(ht())}function Do(){var pn=ht(),ii=Qe(pn);if(y=arguments,A=this,X=pn,ii){if(W===l)return Ye(X);if(pe)return od(W),W=sl(vt,u),ze(X)}return W===l&&(W=sl(vt,u)),H}return Do.cancel=uo,Do.flush=$n,Do}var Ug=dt(function(s,u){return Zr(s,1,u)}),Hc=dt(function(s,u,g){return Zr(s,So(u)||0,g)});function af(s){return Ci(s,Ie)}function $c(s,u){if(typeof s!="function"||u!=null&&typeof u!="function")throw new ro(v);var g=function(){var y=arguments,A=u?u.apply(this,y):y[0],V=g.cache;if(V.has(A))return V.get(A);var H=s.apply(this,y);return g.cache=V.set(A,H)||V,H};return g.cache=new($c.Cache||wi),g}$c.Cache=wi;function ul(s){if(typeof s!="function")throw new ro(v);return function(){var u=arguments;switch(u.length){case 0:return!s.call(this);case 1:return!s.call(this,u[0]);case 2:return!s.call(this,u[0],u[1]);case 3:return!s.call(this,u[0],u[1],u[2])}return!s.apply(this,u)}}function lf(s){return Hn(2,s)}var Wg=As(function(s,u){u=u.length==1&&ot(u[0])?At(u[0],at(Ge())):At(Mn(u,1),at(Ge()));var g=u.length;return dt(function(y){for(var A=-1,V=Yt(y.length,g);++A<V;)y[A]=u[A].call(this,y[A]);return In(s,this,y)})}),dl=dt(function(s,u){var g=D(u,js(dl));return Ci(s,ie,l,u,g)}),yt=dt(function(s,u){var g=D(u,js(yt));return Ci(s,ge,l,u,g)}),Kg=Xi(function(s,u){return Ci(s,je,l,l,l,u)});function cf(s,u){if(typeof s!="function")throw new ro(v);return u=u===l?u:lt(u),dt(s,u)}function Gg(s,u){if(typeof s!="function")throw new ro(v);return u=u==null?0:fn(lt(u),0),dt(function(g){var y=g[u],A=xi(g,0,u);return y&&pi(A,y),In(s,this,A)})}function Qg(s,u,g){var y=!0,A=!0;if(typeof s!="function")throw new ro(v);return it(g)&&(y="leading"in g?!!g.leading:y,A="trailing"in g?!!g.trailing:A),Ls(s,u,{leading:y,maxWait:u,trailing:A})}function uf(s){return qn(s,1)}function df(s,u){return dl(Yi(u),s)}function hf(){if(!arguments.length)return[];var s=arguments[0];return ot(s)?s:[s]}function mf(s){return _o(s,F)}function zs(s,u){return u=typeof u=="function"?u:l,_o(s,F,u)}function Yg(s){return _o(s,L|F)}function Uc(s,u){return u=typeof u=="function"?u:l,_o(s,L|F,u)}function Bs(s,u){return u==null||Ha(s,u,kn(u))}function ti(s,u){return s===u||s!==s&&u!==u}var Xg=el(Gu),zd=el(function(s,u){return s>=u}),ss=Gi(function(){return arguments}())?Gi:function(s){return on(s)&&Rt.call(s,"callee")&&!Dh.call(s,"callee")},ot=ee.isArray,ff=mi?at(mi):ig;function sn(s){return s!=null&&ls(s.length)&&!ni(s)}function dn(s){return on(s)&&sn(s)}function Jg(s){return s===!0||s===!1||on(s)&&Jn(s)==nt}var Ji=Qr||th,pf=qr?at(qr):Yu;function Wc(s){return on(s)&&s.nodeType===1&&!Si(s)}function gf(s){if(s==null)return!0;if(sn(s)&&(ot(s)||typeof s=="string"||typeof s.splice=="function"||Ji(s)||Fs(s)||ss(s)))return!s.length;var u=On(s);if(u==we||u==jt)return!s.size;if(Is(s))return!Zu(s).length;for(var g in s)if(Rt.call(s,g))return!1;return!0}function bf(s,u){return Ua(s,u)}function Zg(s,u,g){g=typeof g=="function"?g:l;var y=g?g(s,u):l;return y===l?Ua(s,u,l,g):!!y}function as(s){if(!on(s))return!1;var u=Jn(s);return u==et||u==We||typeof s.message=="string"&&typeof s.name=="string"&&!Si(s)}function vf(s){return typeof s=="number"&&ye(s)}function ni(s){if(!it(s))return!1;var u=Jn(s);return u==Ut||u==en||u==tt||u==xn}function wf(s){return typeof s=="number"&&s==lt(s)}function ls(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=Oe}function it(s){var u=typeof s;return s!=null&&(u=="object"||u=="function")}function on(s){return s!=null&&typeof s=="object"}var kf=ks?at(ks):sg;function eb(s,u){return s===u||Xu(s,u,gd(u))}function Kc(s,u,g){return g=typeof g=="function"?g:l,Xu(s,u,gd(u),g)}function tb(s){return _f(s)&&s!=+s}function Bd(s){if(rl(s))throw new Xe(k);return Zh(s)}function hl(s){return s===null}function nb(s){return s==null}function _f(s){return typeof s=="number"||on(s)&&Jn(s)==Re}function Si(s){if(!on(s)||Jn(s)!=st)return!1;var u=Va(s);if(u===null)return!0;var g=Rt.call(u,"constructor")&&u.constructor;return typeof g=="function"&&g instanceof g&&Ra.call(g)==Pu}var Zi=Wl?at(Wl):ag;function yf(s){return wf(s)&&s>=-Oe&&s<=Oe}var Fd=Hr?at(Hr):lg;function ml(s){return typeof s=="string"||!ot(s)&&on(s)&&Jn(s)==Wo}function Ao(s){return typeof s=="symbol"||on(s)&&Jn(s)==or}var Fs=ur?at(ur):cg;function ob(s){return s===l}function xf(s){return on(s)&&On(s)==ai}function Nf(s){return on(s)&&Jn(s)==ea}var fl=el(Wa),ib=el(function(s,u){return s<=u});function qd(s){if(!s)return[];if(sn(s))return ml(s)?Ve(s):lo(s);if(Kr&&s[Kr])return Ma(s[Kr]());var u=On(s),g=u==we?Oo:u==jt?I:$s;return g(s)}function er(s){if(!s)return s===0?s:0;if(s=So(s),s===Se||s===-Se){var u=s<0?-1:1;return u*rt}return s===s?s:0}function lt(s){var u=er(s),g=u%1;return u===u?g?u-g:u:0}function Hd(s){return s?ki(lt(s),0,Fe):0}function So(s){if(typeof s=="number")return s;if(Ao(s))return De;if(it(s)){var u=typeof s.valueOf=="function"?s.valueOf():s;s=it(u)?u+"":u}if(typeof s!="string")return s===0?s:+s;s=Jl(s);var g=oa.test(s);return g||Tu.test(s)?_a(s.slice(2),g?2:8):Wt.test(s)?De:+s}function $d(s){return Zo(s,zn(s))}function rb(s){return s?ki(lt(s),-Oe,Oe):s===0?s:0}function St(s){return s==null?"":ao(s)}var sb=Ss(function(s,u){if(Is(u)||sn(u)){Zo(u,kn(u),s);return}for(var g in u)Rt.call(u,g)&&qa(s,g,u[g])}),Ud=Ss(function(s,u){Zo(u,zn(u),s)}),qs=Ss(function(s,u,g,y){Zo(u,zn(u),s,y)}),ab=Ss(function(s,u,g,y){Zo(u,kn(u),s,y)}),lb=Xi($u);function Tf(s,u){var g=vr(s);return u==null?g:Hu(g,u)}var cb=dt(function(s,u){s=Nt(s);var g=-1,y=u.length,A=y>2?u[2]:l;for(A&&Vn(u[0],u[1],A)&&(y=1);++g<y;)for(var V=u[g],H=zn(V),W=-1,X=H.length;++W<X;){var he=H[W],me=s[he];(me===l||ti(me,fr[he])&&!Rt.call(s,he))&&(s[he]=V[he])}return s}),ub=dt(function(s){return s.push(l,fm),In(jf,l,s)});function db(s,u){return Ea(s,Ge(u,3),yi)}function hb(s,u){return Ea(s,Ge(u,3),Ku)}function mb(s,u){return s==null?s:Uu(s,Ge(u,3),zn)}function Cf(s,u){return s==null?s:Wu(s,Ge(u,3),zn)}function fb(s,u){return s&&yi(s,Ge(u,3))}function pb(s,u){return s&&Ku(s,Ge(u,3))}function Ef(s){return s==null?[]:$a(s,kn(s))}function Af(s){return s==null?[]:$a(s,zn(s))}function Gc(s,u,g){var y=s==null?l:Ki(s,u);return y===l?g:y}function gb(s,u){return s!=null&&wd(s,u,Yh)}function Qc(s,u){return s!=null&&wd(s,u,og)}var Wd=ud(function(s,u,g){u!=null&&typeof u.toString!="function"&&(u=Wr.call(u)),s[u]=g},Zc(to)),Sf=ud(function(s,u,g){u!=null&&typeof u.toString!="function"&&(u=Wr.call(u)),Rt.call(s,u)?s[u].push(g):s[u]=[g]},Ge),Kd=dt(ts);function kn(s){return sn(s)?Fu(s):Zu(s)}function zn(s){return sn(s)?Fu(s,!0):ug(s)}function Yc(s,u){var g={};return u=Ge(u,3),yi(s,function(y,A,V){Ui(g,u(y,A,V),y)}),g}function Df(s,u){var g={};return u=Ge(u,3),yi(s,function(y,A,V){Ui(g,A,u(y,A,V))}),g}var bb=Ss(function(s,u,g){pc(s,u,g)}),jf=Ss(function(s,u,g,y){pc(s,u,g,y)}),vb=Xi(function(s,u){var g={};if(s==null)return g;var y=!1;u=At(u,function(V){return V=fe(V,s),y||(y=V.length>1),V}),Zo(s,fd(s),g),y&&(g=_o(g,L|j|F,nl));for(var A=u.length;A--;)_c(g,u[A]);return g});function If(s,u){return Pf(s,ul(Ge(u)))}var wb=Xi(function(s,u){return s==null?{}:gc(s,u)});function Pf(s,u){if(s==null)return{};var g=At(fd(s),function(y){return[y]});return u=Ge(u),td(s,g,function(y,A){return u(y,A[0])})}function kb(s,u,g){u=fe(u,s);var y=-1,A=u.length;for(A||(A=1,s=l);++y<A;){var V=s==null?l:s[Ai(u[y])];V===l&&(y=A,V=g),s=ni(V)?V.call(s):V}return s}function _b(s,u,g){return s==null?s:yo(s,u,g)}function Hs(s,u,g,y){return y=typeof y=="function"?y:l,s==null?s:yo(s,u,g,y)}var cs=dd(kn),Gd=dd(zn);function Mf(s,u,g){var y=ot(s),A=y||Ji(s)||Fs(s);if(u=Ge(u,4),g==null){var V=s&&s.constructor;A?g=y?new V:[]:it(s)?g=ni(V)?vr(Va(s)):{}:g={}}return(A?oo:yi)(s,function(H,W,X){return u(g,H,W,X)}),g}function yb(s,u){return s==null?!0:_c(s,u)}function xb(s,u,g){return s==null?s:_r(s,u,Yi(g))}function Nb(s,u,g,y){return y=typeof y=="function"?y:l,s==null?s:_r(s,u,Yi(g),y)}function $s(s){return s==null?[]:$r(s,kn(s))}function Tb(s){return s==null?[]:$r(s,zn(s))}function Of(s,u,g){return g===l&&(g=u,u=l),g!==l&&(g=So(g),g=g===g?g:0),u!==l&&(u=So(u),u=u===u?u:0),ki(So(s),u,g)}function Rf(s,u,g){return u=er(u),g===l?(g=u,u=0):g=er(g),s=So(s),Xh(s,u,g)}function Cb(s,u,g){if(g&&typeof g!="boolean"&&Vn(s,u,g)&&(u=g=l),g===l&&(typeof u=="boolean"?(g=u,u=l):typeof s=="boolean"&&(g=s,s=l)),s===l&&u===l?(s=0,u=1):(s=er(s),u===l?(u=s,s=0):u=er(u)),s>u){var y=s;s=u,u=y}if(g||s%1||u%1){var A=sc();return Yt(s+A*(u-s+ka("1e-"+((A+"").length-1))),u)}return bc(s,u)}var Vf=Zn(function(s,u,g){return u=u.toLowerCase(),s+(g?Qd(u):u)});function Qd(s){return Xd(St(s).toLowerCase())}function oi(s){return s=St(s),s&&s.replace(Pl,Ur).replace(pa,"")}function Yd(s,u,g){s=St(s),u=ao(u);var y=s.length;g=g===l?y:ki(lt(g),0,y);var A=g;return g-=u.length,g>=0&&s.slice(g,A)==u}function Eb(s){return s=St(s),s&&ms.test(s)?s.replace(xt,Yn):s}function Ab(s){return s=St(s),s&&rr.test(s)?s.replace(Pr,"\\$&"):s}var Sb=Zn(function(s,u,g){return s+(g?"-":"")+u.toLowerCase()}),Db=Zn(function(s,u,g){return s+(g?" ":"")+u.toLowerCase()}),Nr=ld("toLowerCase");function Us(s,u,g){s=St(s),u=lt(u);var y=u?Te(s):0;if(!u||y>=u)return s;var A=(u-y)/2;return Za(La(A),g)+s+Za(Gr(A),g)}function Lf(s,u,g){s=St(s),u=lt(u);var y=u?Te(s):0;return u&&y<u?s+Za(u-y,g):s}function Xc(s,u,g){s=St(s),u=lt(u);var y=u?Te(s):0;return u&&y<u?Za(u-y,g)+s:s}function zf(s,u,g){return g||u==null?u=0:u&&(u=+u),rc(St(s).replace(ta,""),u||0)}function jb(s,u,g){return(g?Vn(s,u,g):u===l)?u=1:u=lt(u),vc(St(s),u)}function Ib(){var s=arguments,u=St(s[0]);return s.length<3?u:u.replace(s[1],s[2])}var Pb=Zn(function(s,u,g){return s+(g?"_":"")+u.toLowerCase()});function Mb(s,u,g){return g&&typeof g!="number"&&Vn(s,u,g)&&(u=g=l),g=g===l?Fe:g>>>0,g?(s=St(s),s&&(typeof u=="string"||u!=null&&!Zi(u))&&(u=ao(u),!u&&Tt(s))?xi(Ve(s),0,g):s.split(u,g)):[]}var Ob=Zn(function(s,u,g){return s+(g?" ":"")+Xd(u)});function Jc(s,u,g){return s=St(s),g=g==null?0:ki(lt(g),0,s.length),u=ao(u),s.slice(g,g+u.length)==u}function Bf(s,u,g){var y=M.templateSettings;g&&Vn(s,u,g)&&(u=l),s=St(s),u=qs({},u,y,hd);var A=qs({},u.imports,y.imports,hd),V=kn(A),H=$r(A,V),W,X,he=0,me=u.interpolate||Be,pe="__p += '",Ae=ec((u.escape||Be).source+"|"+me.source+"|"+(me===Vi?na:Be).source+"|"+(u.evaluate||Be).source+"|$","g"),ze="//# sourceURL="+(Rt.call(u,"sourceURL")?(u.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++$l+"]")+`
`;s.replace(Ae,function(Qe,vt,kt,uo,$n,Do){return kt||(kt=uo),pe+=s.slice(he,Do).replace(ve,io),vt&&(W=!0,pe+=`' +
__e(`+vt+`) +
'`),$n&&(X=!0,pe+=`';
`+$n+`;
__p += '`),kt&&(pe+=`' +
((__t = (`+kt+`)) == null ? '' : __t) +
'`),he=Do+Qe.length,Qe}),pe+=`';
`;var Ye=Rt.call(u,"variable")&&u.variable;if(!Ye)pe=`with (obj) {
`+pe+`
}
`;else if(Rr.test(Ye))throw new Xe(N);pe=(X?pe.replace(An,""):pe).replace(jn,"$1").replace(cn,"$1;"),pe="function("+(Ye||"obj")+`) {
`+(Ye?"":`obj || (obj = {});
`)+"var __t, __p = ''"+(W?", __e = _.escape":"")+(X?`, __j = Array.prototype.join;
function print() { __p += __j.call(arguments, '') }
`:`;
`)+pe+`return __p
}`;var bt=Jd(function(){return Je(V,ze+"return "+pe).apply(l,H)});if(bt.source=pe,as(bt))throw bt;return bt}function Ff(s){return St(s).toLowerCase()}function Rb(s){return St(s).toUpperCase()}function Vb(s,u,g){if(s=St(s),s&&(g||u===l))return Jl(s);if(!s||!(u=ao(u)))return s;var y=Ve(s),A=Ve(u),V=Mo(y,A),H=Ns(y,A)+1;return xi(y,V,H).join("")}function Lb(s,u,g){if(s=St(s),s&&(g||u===l))return s.slice(0,Ke(s)+1);if(!s||!(u=ao(u)))return s;var y=Ve(s),A=Ns(y,Ve(u))+1;return xi(y,0,A).join("")}function zb(s,u,g){if(s=St(s),s&&(g||u===l))return s.replace(ta,"");if(!s||!(u=ao(u)))return s;var y=Ve(s),A=Mo(y,Ve(u));return xi(y,A).join("")}function qf(s,u){var g=Pe,y=ce;if(it(u)){var A="separator"in u?u.separator:A;g="length"in u?lt(u.length):g,y="omission"in u?ao(u.omission):y}s=St(s);var V=s.length;if(Tt(s)){var H=Ve(s);V=H.length}if(g>=V)return s;var W=g-Te(y);if(W<1)return y;var X=H?xi(H,0,W).join(""):s.slice(0,W);if(A===l)return X+y;if(H&&(W+=X.length-W),Zi(A)){if(s.slice(W).search(A)){var he,me=X;for(A.global||(A=ec(A.source,St(Li.exec(A))+"g")),A.lastIndex=0;he=A.exec(me);)var pe=he.index;X=X.slice(0,pe===l?W:pe)}}else if(s.indexOf(ao(A),W)!=W){var Ae=X.lastIndexOf(A);Ae>-1&&(X=X.slice(0,Ae))}return X+y}function Bb(s){return s=St(s),s&&ci.test(s)?s.replace(Io,Ct):s}var Fb=Zn(function(s,u,g){return s+(g?" ":"")+u.toUpperCase()}),Xd=ld("toUpperCase");function Hf(s,u,g){return s=St(s),u=g?l:u,u===l?Pa(s)?Ro(s):Gl(s):s.match(u)||[]}var Jd=dt(function(s,u){try{return In(s,l,u)}catch(g){return as(g)?g:new Xe(g)}}),qb=Xi(function(s,u){return oo(u,function(g){g=Ai(g),Ui(s,g,Vs(s[g],s))}),s});function pl(s){var u=s==null?0:s.length,g=Ge();return s=u?At(s,function(y){if(typeof y[1]!="function")throw new ro(v);return[g(y[0]),y[1]]}):[],dt(function(y){for(var A=-1;++A<u;){var V=s[A];if(In(V[0],this,y))return In(V[1],this,y)}})}function Hb(s){return Kh(_o(s,L))}function Zc(s){return function(){return s}}function $b(s,u){return s==null||s!==s?u:s}var Ub=Xa(),eu=Xa(!0);function to(s){return s}function tu(s){return Ju(typeof s=="function"?s:_o(s,L))}function $f(s){return tm(_o(s,L))}function Wb(s,u){return nm(s,_o(u,L))}var Zd=dt(function(s,u){return function(g){return ts(g,s,u)}}),Kb=dt(function(s,u){return function(g){return ts(s,g,u)}});function gl(s,u,g){var y=kn(u),A=$a(u,y);g==null&&!(it(u)&&(A.length||!y.length))&&(g=u,u=s,s=this,A=$a(u,kn(u)));var V=!(it(g)&&"chain"in g)||!!g.chain,H=ni(s);return oo(A,function(W){var X=u[W];s[W]=X,H&&(s.prototype[W]=function(){var he=this.__chain__;if(V||he){var me=s(this.__wrapped__),pe=me.__actions__=lo(this.__actions__);return pe.push({func:X,args:arguments,thisArg:s}),me.__chain__=he,me}return X.apply(s,pi([this.value()],arguments))})}),s}function Uf(){return vn._===this&&(vn._=Up),this}function bl(){}function Di(s){return s=lt(s),dt(function(u){return om(u,s)})}var Wf=Cc(At),Gb=Cc(Ta),Qb=Cc(dr);function eh(s){return Ic(s)?Sa(Ai(s)):im(s)}function Yb(s){return function(u){return s==null?l:Ki(s,u)}}var Kf=hm(),Gf=hm(!0);function Ws(){return[]}function th(){return!1}function Xb(){return{}}function Qf(){return""}function Yf(){return!0}function Xf(s,u){if(s=lt(s),s<1||s>Oe)return[];var g=Fe,y=Yt(s,Fe);u=Ge(u),s-=Fe;for(var A=Ia(y,u);++g<s;)u(g);return A}function Jb(s){return ot(s)?At(s,Ai):Ao(s)?[s]:lo(yd(St(s)))}function Zb(s){var u=++$p;return St(s)+u}var ev=Ds(function(s,u){return s+u},0),nh=tl("ceil"),oh=Ds(function(s,u){return s/u},1),tv=tl("floor");function nv(s){return s&&s.length?mc(s,to,Gu):l}function Jf(s,u){return s&&s.length?mc(s,Ge(u,2),Gu):l}function ov(s){return Aa(s,to)}function iv(s,u){return Aa(s,Ge(u,2))}function rv(s){return s&&s.length?mc(s,to,Wa):l}function Zf(s,u){return s&&s.length?mc(s,Ge(u,2),Wa):l}var ep=Ds(function(s,u){return s*u},1),ih=tl("round"),rh=Ds(function(s,u){return s-u},0);function tp(s){return s&&s.length?ja(s,to):0}function np(s,u){return s&&s.length?ja(s,Ge(u,2)):0}return M.after=Ld,M.ary=qn,M.assign=sb,M.assignIn=Ud,M.assignInWith=qs,M.assignWith=ab,M.at=lb,M.before=Hn,M.bind=Vs,M.bindAll=qb,M.bindKey=cl,M.castArray=hf,M.chain=Fc,M.chunk=kg,M.compact=wm,M.concat=km,M.cond=pl,M.conforms=Hb,M.constant=Zc,M.countBy=Rs,M.create=Tf,M.curry=rf,M.curryRight=sf,M.debounce=Ls,M.defaults=cb,M.defaultsDeep=ub,M.defer=Ug,M.delay=Hc,M.difference=_m,M.differenceBy=ym,M.differenceWith=xm,M.drop=al,M.dropRight=Dn,M.dropRightWhile=ei,M.dropWhile=Ln,M.fill=_g,M.filter=Rg,M.flatMap=Vg,M.flatMapDeep=Lg,M.flatMapDepth=zg,M.flatten=Cm,M.flattenDeep=xd,M.flattenDepth=Em,M.flip=af,M.flow=Ub,M.flowRight=eu,M.fromPairs=Am,M.functions=Ef,M.functionsIn=Af,M.groupBy=Bg,M.initial=xg,M.intersection=Ng,M.intersectionBy=Dm,M.intersectionWith=Tg,M.invert=Wd,M.invertBy=Sf,M.invokeMap=Zm,M.iteratee=tu,M.keyBy=ef,M.keys=kn,M.keysIn=zn,M.map=qc,M.mapKeys=Yc,M.mapValues=Df,M.matches=$f,M.matchesProperty=Wb,M.memoize=$c,M.merge=bb,M.mergeWith=jf,M.method=Zd,M.methodOf=Kb,M.mixin=gl,M.negate=ul,M.nthArg=Di,M.omit=vb,M.omitBy=If,M.once=lf,M.orderBy=tf,M.over=Wf,M.overArgs=Wg,M.overEvery=Gb,M.overSome=Qb,M.partial=dl,M.partialRight=yt,M.partition=Fg,M.pick=wb,M.pickBy=Pf,M.property=eh,M.propertyOf=Yb,M.pull=Eg,M.pullAll=Nd,M.pullAllBy=Ag,M.pullAllWith=Td,M.pullAt=Pm,M.range=Kf,M.rangeRight=Gf,M.rearg=Kg,M.reject=$g,M.remove=Sg,M.rest=cf,M.reverse=Cd,M.sampleSize=Od,M.set=_b,M.setWith=Hs,M.shuffle=Rd,M.slice=Mm,M.sortBy=of,M.sortedUniq=Eo,M.sortedUniqBy=ll,M.split=Mb,M.spread=Gg,M.tail=Dg,M.take=Om,M.takeRight=Vc,M.takeRightWhile=Rm,M.takeWhile=jg,M.tap=Ms,M.throttle=Qg,M.thru=Os,M.toArray=qd,M.toPairs=cs,M.toPairsIn=Gd,M.toPath=Jb,M.toPlainObject=$d,M.transform=Mf,M.unary=uf,M.union=Ig,M.unionBy=Pg,M.unionWith=Vm,M.uniq=Lm,M.uniqBy=zm,M.uniqWith=Bm,M.unset=yb,M.unzip=Lc,M.unzipWith=is,M.update=xb,M.updateWith=Nb,M.values=$s,M.valuesIn=Tb,M.without=zc,M.words=Hf,M.wrap=df,M.xor=Dd,M.xorBy=jd,M.xorWith=Fm,M.zip=Mg,M.zipObject=Bc,M.zipObjectDeep=qm,M.zipWith=nn,M.entries=cs,M.entriesIn=Gd,M.extend=Ud,M.extendWith=qs,gl(M,M),M.add=ev,M.attempt=Jd,M.camelCase=Vf,M.capitalize=Qd,M.ceil=nh,M.clamp=Of,M.clone=mf,M.cloneDeep=Yg,M.cloneDeepWith=Uc,M.cloneWith=zs,M.conformsTo=Bs,M.deburr=oi,M.defaultTo=$b,M.divide=oh,M.endsWith=Yd,M.eq=ti,M.escape=Eb,M.escapeRegExp=Ab,M.every=Qm,M.find=Ym,M.findIndex=Nm,M.findKey=db,M.findLast=Pd,M.findLastIndex=Tm,M.findLastKey=hb,M.floor=tv,M.forEach=Xm,M.forEachRight=Jm,M.forIn=mb,M.forInRight=Cf,M.forOwn=fb,M.forOwnRight=pb,M.get=Gc,M.gt=Xg,M.gte=zd,M.has=gb,M.hasIn=Qc,M.head=Sm,M.identity=to,M.includes=rs,M.indexOf=yg,M.inRange=Rf,M.invoke=Kd,M.isArguments=ss,M.isArray=ot,M.isArrayBuffer=ff,M.isArrayLike=sn,M.isArrayLikeObject=dn,M.isBoolean=Jg,M.isBuffer=Ji,M.isDate=pf,M.isElement=Wc,M.isEmpty=gf,M.isEqual=bf,M.isEqualWith=Zg,M.isError=as,M.isFinite=vf,M.isFunction=ni,M.isInteger=wf,M.isLength=ls,M.isMap=kf,M.isMatch=eb,M.isMatchWith=Kc,M.isNaN=tb,M.isNative=Bd,M.isNil=nb,M.isNull=hl,M.isNumber=_f,M.isObject=it,M.isObjectLike=on,M.isPlainObject=Si,M.isRegExp=Zi,M.isSafeInteger=yf,M.isSet=Fd,M.isString=ml,M.isSymbol=Ao,M.isTypedArray=Fs,M.isUndefined=ob,M.isWeakMap=xf,M.isWeakSet=Nf,M.join=Cg,M.kebabCase=Sb,M.last=To,M.lastIndexOf=jm,M.lowerCase=Db,M.lowerFirst=Nr,M.lt=fl,M.lte=ib,M.max=nv,M.maxBy=Jf,M.mean=ov,M.meanBy=iv,M.min=rv,M.minBy=Zf,M.stubArray=Ws,M.stubFalse=th,M.stubObject=Xb,M.stubString=Qf,M.stubTrue=Yf,M.multiply=ep,M.nth=Im,M.noConflict=Uf,M.noop=bl,M.now=ht,M.pad=Us,M.padEnd=Lf,M.padStart=Xc,M.parseInt=zf,M.random=Cb,M.reduce=qg,M.reduceRight=Hg,M.repeat=jb,M.replace=Ib,M.result=kb,M.round=ih,M.runInContext=Q,M.sample=Md,M.size=Vd,M.snakeCase=Pb,M.some=nf,M.sortedIndex=Co,M.sortedIndexBy=Ed,M.sortedIndexOf=Ad,M.sortedLastIndex=Sd,M.sortedLastIndexBy=os,M.sortedLastIndexOf=gt,M.startCase=Ob,M.startsWith=Jc,M.subtract=rh,M.sum=tp,M.sumBy=np,M.template=Bf,M.times=Xf,M.toFinite=er,M.toInteger=lt,M.toLength=Hd,M.toLower=Ff,M.toNumber=So,M.toSafeInteger=rb,M.toString=St,M.toUpper=Rb,M.trim=Vb,M.trimEnd=Lb,M.trimStart=zb,M.truncate=qf,M.unescape=Bb,M.uniqueId=Zb,M.upperCase=Fb,M.upperFirst=Xd,M.each=Xm,M.eachRight=Jm,M.first=Sm,gl(M,function(){var s={};return yi(M,function(u,g){Rt.call(M.prototype,g)||(s[g]=u)}),s}(),{chain:!1}),M.VERSION=h,oo(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){M[s].placeholder=M}),oo(["drop","take"],function(s,u){wt.prototype[s]=function(g){g=g===l?1:fn(lt(g),0);var y=this.__filtered__&&!u?new wt(this):this.clone();return y.__filtered__?y.__takeCount__=Yt(g,y.__takeCount__):y.__views__.push({size:Yt(g,Fe),type:s+(y.__dir__<0?"Right":"")}),y},wt.prototype[s+"Right"]=function(g){return this.reverse()[s](g).reverse()}}),oo(["filter","map","takeWhile"],function(s,u){var g=u+1,y=g==ke||g==Ee;wt.prototype[s]=function(A){var V=this.clone();return V.__iteratees__.push({iteratee:Ge(A,3),type:g}),V.__filtered__=V.__filtered__||y,V}}),oo(["head","last"],function(s,u){var g="take"+(u?"Right":"");wt.prototype[s]=function(){return this[g](1).value()[0]}}),oo(["initial","tail"],function(s,u){var g="drop"+(u?"":"Right");wt.prototype[s]=function(){return this.__filtered__?new wt(this):this[g](1)}}),wt.prototype.compact=function(){return this.filter(to)},wt.prototype.find=function(s){return this.filter(s).head()},wt.prototype.findLast=function(s){return this.reverse().find(s)},wt.prototype.invokeMap=dt(function(s,u){return typeof s=="function"?new wt(this):this.map(function(g){return ts(g,s,u)})}),wt.prototype.reject=function(s){return this.filter(ul(Ge(s)))},wt.prototype.slice=function(s,u){s=lt(s);var g=this;return g.__filtered__&&(s>0||u<0)?new wt(g):(s<0?g=g.takeRight(-s):s&&(g=g.drop(s)),u!==l&&(u=lt(u),g=u<0?g.dropRight(-u):g.take(u-s)),g)},wt.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},wt.prototype.toArray=function(){return this.take(Fe)},yi(wt.prototype,function(s,u){var g=/^(?:filter|find|map|reject)|While$/.test(u),y=/^(?:head|last)$/.test(u),A=M[y?"take"+(u=="last"?"Right":""):u],V=y||/^find/.test(u);A&&(M.prototype[u]=function(){var H=this.__wrapped__,W=y?[1]:arguments,X=H instanceof wt,he=W[0],me=X||ot(H),pe=function(vt){var kt=A.apply(M,pi([vt],W));return y&&Ae?kt[0]:kt};me&&g&&typeof he=="function"&&he.length!=1&&(X=me=!1);var Ae=this.__chain__,ze=!!this.__actions__.length,Ye=V&&!Ae,bt=X&&!ze;if(!V&&me){H=bt?H:new wt(this);var Qe=s.apply(H,W);return Qe.__actions__.push({func:Os,args:[pe],thisArg:l}),new ko(Qe,Ae)}return Ye&&bt?s.apply(this,W):(Qe=this.thru(pe),Ye?y?Qe.value()[0]:Qe.value():Qe)})}),oo(["pop","push","shift","sort","splice","unshift"],function(s){var u=Cs[s],g=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",y=/^(?:pop|shift)$/.test(s);M.prototype[s]=function(){var A=arguments;if(y&&!this.__chain__){var V=this.value();return u.apply(ot(V)?V:[],A)}return this[g](function(H){return u.apply(ot(H)?H:[],A)})}}),yi(wt.prototype,function(s,u){var g=M[u];if(g){var y=g.name+"";Rt.call(br,y)||(br[y]=[]),br[y].push({name:u,func:g})}}),br[Ja(l,se).name]=[{name:"wrapper",func:l}],wt.prototype.clone=Ru,wt.prototype.reverse=Yp,wt.prototype.value=Xp,M.prototype.at=Hm,M.prototype.chain=$m,M.prototype.commit=Um,M.prototype.next=Og,M.prototype.plant=Id,M.prototype.reverse=Km,M.prototype.toJSON=M.prototype.valueOf=M.prototype.value=Gm,M.prototype.first=M.prototype.head,Kr&&(M.prototype[Kr]=Wm),M},wo=Vo();Go?((Go.exports=wo)._=wo,vs._=wo):vn._=wo}).call(an)})(xp,xp.exports);var ES=xp.exports;const AS=Tp(ES),SS=(p,f=!0)=>{const[l,h]=U.useState("idle"),[w,k]=U.useState(void 0),[v,N]=U.useState(void 0),S=U.useRef(!1),O=U.useCallback(C=>(h("pending"),N(null),p(C).then(L=>{S.current&&(k(L),h("success"))}).catch(L=>{S.current&&(N(L),h("error"))})),[p]);return U.useEffect(()=>{f&&O()},[O,f]),U.useEffect(()=>(S.current=!0,()=>{S.current=!1}),[]),{execute:O,status:l,value:w,error:v,setValue:k,setStatus:h}},N0={noOptionsMessage:()=>"Không có lựa chọn",placeholder:"Nhấp để chọn",loadingMessage:()=>"Đang tìm kiếm",menuPosition:"fixed"},pp=10,DS={display:"flex",alignItems:"center",justifyContent:"space-between"},jS={backgroundColor:"#EBECF0",borderRadius:"2em",color:"#172B4D",display:"inline-block",fontSize:12,fontWeight:"normal",lineHeight:"1",minWidth:1,padding:"0.16em 0.5em",textAlign:"center"},IS=U.forwardRef(({onChange:p,id:f,name:l,placeholder:h,getOptionLabel:w,getOptionValue:k,onAdd:v,value:N,disabled:S,endPoint:O,fieldLabel:C,fieldValue:L,isClearable:j,isGroup:F,conditions:q,keySearch:K,...te},se)=>{const[Z,Y]=U.useState(null),[oe,ie]=U.useState([]),[ge,de]=U.useState([]),[je,Ie]=U.useState(null),Pe=U.useRef(),ce=U.useRef(),ae=U.useRef(null);h&&(N0.placeholder=h),U.useEffect(()=>{q&&(ie([]),de([]),Pe.current={top:pp,skip:0},ce.current={top:pp,skip:0},ae.current=q)},[q]),U.useEffect(()=>(Pe.current={top:pp,skip:0},ce.current={top:pp,skip:0},()=>{ae.current=null}),[]);const be=(Ne,Le,qe)=>{let $e="";if(Le){const{top:tt,skip:nt}=ce.current;qe?$e+=`&$top=${tt}&$skip=${nt}&$inlinecount=allpages`:(ce.current.skip=0,$e+=`&$top=${tt}&$skip=0&$inlinecount=allpages`)}else{const{top:tt,skip:nt}=Pe.current;$e+=`&$top=${tt}&$skip=${nt}&$inlinecount=allpages`}return Ne.length>0&&($e+=Ne.reduce((tt,nt,Ue)=>{const We=Ue===Ne.length-1?"":",";return tt+=`${nt}${We}`,tt},"&$select=")),$e},ke=U.useCallback(async(Ne,Le)=>{if(O){let qe=be([C,L],Ne,Le),$e=[];(q&&q.length>0||ae.current&&ae.current.length>0)&&((q.length>0?q:ae.current).map((et,Ut)=>et.expression==="in"?$e.push(`${et.field} ${et.expression} (${et.value})`):$e.push(`${et.field} ${et.expression} ${et.value}`)),$e=$e.join(" or "),qe=`${qe}&$filter=${$e}`),Ne&&(qe.indexOf("$filter")>-1?qe+=` and substringof('${Ne}',${C})`:qe+=`&$filter=substringof('${Ne}',${C})`);const{value:tt,...nt}=await O(`${qe}`),Ue=We=>{let et=[...We];return Le?et=[...et,...tt]:et=tt,et};return Ne?(ce.current.count=parseInt(nt["odata.count"]),de(Ue)):(Pe.current.count=parseInt(nt["odata.count"]),ie(Ue)),tt}return[]},[q,O,C,L]),_e=U.useCallback(({curSearch:Ne,preSearch:Le,isScroll:qe}={})=>{if(Ne){if(Ne!=="")return Ie(Ne),new Promise($e=>{setTimeout(()=>$e(ke(Ne,qe)),1e3)})}else return Ne!==""?(Ie(null),de([]),ce.current.count=0,new Promise($e=>{setTimeout(()=>$e(ke(null,qe)),1e3)})):(ce.current.count=0,Promise.resolve([]))},[ke]),{execute:Ee,status:Se}=SS(_e,!1);U.useEffect(()=>{N&&Y(N)},[N]),U.useCallback(async Ne=>{const Le=await _e(),[qe]=Le.filter($e=>$e[k||"value"]===Ne);return qe||null},[k,_e]);const Oe=U.useCallback((Ne,Le)=>{const{count:qe}=Pe.current;Pe.current.skip+=Le,Pe.current.skip<=qe&&Ee({curSearch:Ne,preSearch:Ne,isScroll:!0})},[Ee]),rt=U.useCallback(Ne=>{p(Ne||[])},[p]),De=U.useCallback(AS.debounce(Ee,1e3),[]),Fe=U.useCallback((Ne,Le)=>{De({curSearch:Ne,preSearch:Le})},[De]),mt=Ne=>x.jsxDEV("div",{style:DS,children:[x.jsxDEV("span",{children:Ne.label},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/select/SelectAsyncMulti.jsx",lineNumber:230,columnNumber:9},globalThis),x.jsxDEV("span",{style:jS,children:Ne.options.length},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/select/SelectAsyncMulti.jsx",lineNumber:231,columnNumber:9},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/select/SelectAsyncMulti.jsx",lineNumber:229,columnNumber:7},globalThis);return x.jsxDEV(oT,{children:x.jsxDEV(Zv,{className:v&&"d-flex justify-content-between basic-single",children:[x.jsxDEV(Ar,{className:"pr-0",children:x.jsxDEV(cN,{...te,style:{control:Ne=>({...Ne,lineHeight:"1.5",cursor:"pointer",borderRadius:"0.2rem"}),option:Ne=>({...Ne,fontSize:"0.76563rem",cursor:"pointer"}),input:Ne=>({...Ne,position:"unset"})},isMulti:!0,onMenuScrollToBottom:()=>Oe(je,10),options:je?ge:oe,isLoading:Se==="pending",isDisabled:S,defaultOptions:!0,value:Z,name:l,onChange:rt,onInputChange:Ne=>Fe(Ne,je),getOptionValue:k,getOptionLabel:w,inputId:l,id:f,instanceId:l,onMenuClose:()=>{Ie(null),de([])},onMenuOpen:()=>oe.length===0&&Ee({curSearch:null,preSearch:null,isScroll:!1}),...N0,isClearable:j,formatGroupLabel:F?mt:{}},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/select/SelectAsyncMulti.jsx",lineNumber:238,columnNumber:13},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/select/SelectAsyncMulti.jsx",lineNumber:237,columnNumber:11},globalThis),v&&x.jsxDEV(Ar,{md:"1",className:"pl-0",children:x.jsxDEV(xw,{className:"h-100",onClick:v},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/select/SelectAsyncMulti.jsx",lineNumber:277,columnNumber:15},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/select/SelectAsyncMulti.jsx",lineNumber:276,columnNumber:13},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/select/SelectAsyncMulti.jsx",lineNumber:236,columnNumber:9},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/select/SelectAsyncMulti.jsx",lineNumber:235,columnNumber:7},globalThis)}),PS=U.memo(IS);class zy extends Ii.Component{constructor(l){super(l);Kn(this,"componentDidMount",()=>{const{data:l,url:h,columns:w,where:k,initRowData:v}=this.props;l?this.setState({data:l}):zt(`${h}?${fN(w,k,!0,this.props.selectType)}`,"GET",null).then(N=>{N.value&&(v&&N.value.forEach(S=>v.forEach(O=>S[O.name]=O.value)),this.setState({data:N.value}))}).catch(N=>console.log(N))});Kn(this,"addRowToTable",l=>{this.setState({data:[l,...this.state.data]})});Kn(this,"handleAddRowTable",l=>new Promise((h,w)=>{if(!w_(this.props.columns,l))w();else try{this.setState({data:[l,...this.state.data]},h(l))}catch{w()}}));Kn(this,"handleUpdateRowTable",(l,h)=>new Promise((w,k)=>{if(!w_(this.props.columns,l))k();else try{let v=[...this.state.data];v[v.indexOf(h)]=l,this.setState({data:v},w(l))}catch{k()}}));Kn(this,"handleDeleteRowTable",l=>new Promise((h,w)=>{try{let k=[...this.state.data];k.splice(k.indexOf(l),1),this.setState({data:k},h())}catch{w()}}));Kn(this,"getRowData",()=>{const{initRowData:l}=this.props;if(l){let h=[...this.state.data];return h.forEach(w=>l.forEach(k=>w[k.name]=k.value)),h}return this.state.data&&[...this.state.data]});Kn(this,"getData",()=>this.state.data);this.state={data:[]}}render(){const{addMoreRows:l,title:h,columns:w,pageSize:k,tableRef:v}=this.props;return x.jsxDEV(uN,{addMoreRows:l,pageSize:k,title:h,columns:w,tableRef:v,data:this.state.data,editable:{onRowAdd:N=>this.handleAddRowTable(N),onRowUpdate:(N,S)=>this.handleUpdateRowTable(N,S),onRowDelete:N=>this.handleDeleteRowTable(N)}},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/table/ActionsTable.jsx",lineNumber:98,columnNumber:7},this)}}zy.propTypes={url:G.string.isRequired,title:G.string.isRequired,columns:G.array.isRequired,pageSize:G.number.isRequired};zy.defaultProps={addMoreRows:!1,title:"",columns:[],pageSize:10,searchLength:1};si.div`
  position: absolute;
  top: -12px;
  left: 12px;
  background-color: #fff;
  color: #374dc5;
  font-weight: bold;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1; /* number of lines to show */
  -webkit-box-orient: vertical;
`;function MS(p,f){U.useEffect(()=>{const l=h=>{!p.current||p.current.contains(h.target)||f(h)};return document.addEventListener("mousedown",l),document.addEventListener("touchstart",l),()=>{document.removeEventListener("mousedown",l),document.removeEventListener("touchstart",l)}},[p,f])}const By=(p,f,l)=>{p(h=>({...h,[f]:l}))};const OS=({value:p,thonXom:f,title:l,onChange:h,placeholder:w})=>{const[k,v]=U.useState(""),[N,S]=U.useState(!1),[O,C]=U.useState({IdTinh:"52",IdQuan:null,IdPhuong:p,IdThon:null});U.useEffect(()=>{p&&zt(`PhuongXas(${p})?$expand=QuanHuyen/TinhThanh`).then(j=>{v(`${j.TenPhuongXa}, ${j.QuanHuyen.TenQuanHuyen}, ${j.QuanHuyen.TinhThanh.TenTinhThanh}`),L("IdTinh",j.QuanHuyen.MaTinhThanh),L("IdQuan",j.QuanHuyen.MaQuanHuyen),L("IdPhuong",j.MaPhuongXa),f&&zt(`ThonXoms(${f})`).then(F=>{L("IdThon",F.Id),v(q=>`Thôn ${F.Ten}, ${q}`)})})},[f,p]);const L=(j,F)=>{By(C,j,F)};return x.jsxDEV(x.Fragment,{children:[x.jsxDEV(fu,{style:{cursor:"pointer"},onClick:()=>S(!0),value:k,placeholder:w||"Chọn vị trí"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/custome/InputHuyenPhuongXa.jsx",lineNumber:37,columnNumber:7},globalThis),x.jsxDEV(Sr,{zIndex:3900,isOpen:N,toggle:()=>S(j=>!j),children:[x.jsxDEV("div",{className:"p-4 d-block",children:[x.jsxDEV("div",{className:"d-flex w-100 mb-3",children:[x.jsxDEV("strong",{className:"text-red me-2",children:"*"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/custome/InputHuyenPhuongXa.jsx",lineNumber:46,columnNumber:13},globalThis),x.jsxDEV("h6",{children:[l||"Địa chỉ"," :"]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/custome/InputHuyenPhuongXa.jsx",lineNumber:47,columnNumber:13},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/custome/InputHuyenPhuongXa.jsx",lineNumber:45,columnNumber:11},globalThis),x.jsxDEV("div",{className:"d-block w-100",children:[x.jsxDEV(Lt,{data:{title:"Tỉnh thành",required:!0,type:"data-select",dataSelect:{url:"TinhThanhs",value_field:"MaTinhThanh",text_field:"TenTinhThanh",placeholder:"Chọn tỉnh thành"}},value:O==null?void 0:O.IdTinh,inline:!1,onChange:(j,F)=>{L(["IdTinh"],F),L(["IdQuan"],null),L(["IdPhuong"],null),L(["IdThon"],null)}},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/custome/InputHuyenPhuongXa.jsx",lineNumber:50,columnNumber:13},globalThis),x.jsxDEV(Lt,{data:{title:"Quận/Huyện",required:!0,type:"data-select",dataSelect:{url:"QuanHuyens",value_field:"MaQuanHuyen",text_field:"TenQuanHuyen",placeholder:"Chọn Quận/Huyện",where:`MaTinhThanh eq '${O.IdTinh}'`}},value:O==null?void 0:O.IdQuan,inline:!1,onChange:(j,F)=>{L(["IdQuan"],F),L(["IdPhuong"],null),L(["IdThon"],null)}},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/custome/InputHuyenPhuongXa.jsx",lineNumber:71,columnNumber:13},globalThis),x.jsxDEV(Lt,{data:{title:"Phường/Xã",required:!0,type:"data-select",dataSelect:{url:"PhuongXas",value_field:"MaPhuongXa",text_field:"TenPhuongXa",placeholder:"Chọn Phường/Xã",where:`MaQuanHuyen eq '${O.IdQuan}'`}},value:O==null?void 0:O.IdPhuong,inline:!1,onChange:(j,F)=>{L(["IdPhuong"],F),L(["IdThon"],null)}},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/custome/InputHuyenPhuongXa.jsx",lineNumber:92,columnNumber:13},globalThis),f!==void 0&&x.jsxDEV(Lt,{data:{title:"Thôn/Xóm",type:"data-select",dataSelect:{url:"ThonXoms",value_field:"Id",text_field:"Ten",placeholder:"Chọn Thôn/Xóm",where:`MaPhuongXa eq '${O.IdPhuong}'`}},value:O==null?void 0:O.IdThon,inline:!1,onChange:(j,F)=>{L(["IdThon"],F)}},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/custome/InputHuyenPhuongXa.jsx",lineNumber:113,columnNumber:15},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/custome/InputHuyenPhuongXa.jsx",lineNumber:49,columnNumber:11},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/custome/InputHuyenPhuongXa.jsx",lineNumber:44,columnNumber:9},globalThis),x.jsxDEV(_w,{children:x.jsxDEV(xw,{onClick:()=>{h&&h(O.IdPhuong,O.IdThon),S(!1)},disabled:!O.IdPhuong,children:"Lưu"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/custome/InputHuyenPhuongXa.jsx",lineNumber:136,columnNumber:11},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/custome/InputHuyenPhuongXa.jsx",lineNumber:135,columnNumber:9},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/custome/InputHuyenPhuongXa.jsx",lineNumber:43,columnNumber:7},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/custome/InputHuyenPhuongXa.jsx",lineNumber:36,columnNumber:5},globalThis)},RS=({value:p,onChange:f})=>{const[l,h]=U.useState({status:null,text:null}),w=U.useRef();MS(w,()=>{l.status==="error"&&f(null)});const k=U.useCallback(v=>{if(f(v),v&&v.length!==9&&v.length!==12){h({status:"error",text:"Nhập đủ 9 hoặc 12 số"});return}if(!v){h({status:null,text:null});return}(v.length===9||v.length===12)&&zt(`QLLD_NguoiLaoDong?$filter=SoCCCD eq '${v}'`,"GET",null).then(N=>{h({status:N.value.length?"error":"success",text:N.value.length?"Số CMND/CCCD đã tồn tại":v.length!==9&&v.length!==12?"Nhập đủ 9 hoặc 12 số":"Số CMND/CCCD hợp lệ"})})},[f]);return x.jsxDEV(x.Fragment,{children:x.jsxDEV("div",{ref:w,className:"position-relative",children:[x.jsxDEV(fu,{className:` ${l.status==="error"?"error-input":l.status==="success"&&"success-input"}`,type:"number",onChange:v=>{k(v.target.value)},value:p,placeholder:"Nhập số CMND/CCCD"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/custome/InputCheckCMND.jsx",lineNumber:45,columnNumber:9},globalThis),x.jsxDEV("p",{className:`text-conform-input-check-cmnd ${l.status==="error"?"error-text-confim":l.status==="success"&&"success-text-confim"}`,children:l.text},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/custome/InputCheckCMND.jsx",lineNumber:54,columnNumber:9},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/custome/InputCheckCMND.jsx",lineNumber:44,columnNumber:7},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/custome/InputCheckCMND.jsx",lineNumber:43,columnNumber:5},globalThis)},Xv=[{title:"Id",field:"Id",hidden:"true",dataID:!0,table:!0,notEdit:!0},{tabName:"Thông tin công dân",hidden:!0},{title:"Số CCCD",field:"SoCCCD",type:"textbox",searchable:!0,table:!0,required:!0,btnClose:!0},{title:"Họ và tên",field:"HoVaTen",type:"textbox",searchable:!0,table:!0,required:!0},{title:"Dân tộc",field:"DanToc_Id",type:"data-select",table:!0,required:!0,valueDefault:1,dataSelect:{url:"DM_DanToc",value_field:"Id",text_field:"Name",placeholder:"Chọn Dân tộc"}},{title:"tháng",field:"ThangSinh",table:!0,hidden:!0},{title:"nam",field:"NamSinh",table:!0,hidden:!0},{title:"Ngày/Tháng/Năm Sinh",field:"NgaySinh",render:p=>`${(p==null?void 0:p.NgaySinh)||"??"}/${(p==null?void 0:p.ThangSinh)||"??"}/${(p==null?void 0:p.NamSinh)||"????"}`,table:!0},{title:"Giới tính",field:"GioiTinh_Id",type:"data-select",table:!0,required:!0,dataSelect:{url:"DM_GioiTinh",value_field:"Id",text_field:"Name",placeholder:"Chọn Giới tính"}},{title:"Thôn xóm",field:"Thon_Id",type:"input-thon-xom",required:!0},{tabName:"Ngày tháng ngăm sinh",ratio:[2,2,2,5],hidden:!0},{title:"Ngày/Tháng/Năm sinh",field:"NgaySinh",type:"select-date"},{title:"Tháng sinh",hiddenLabel:!0,field:"ThangSinh",type:"select-month"},{title:"Năm sinh",field:"NamSinh",type:"input-year",hiddenLabel:!0}];const VS=({value:p})=>{const[f,l]=U.useState(void 0);return U.useEffect(()=>{p&&zt(`ThonXoms(${p})?$expand=PhuongXa/QuanHuyen`).then(h=>{l(`Thôn ${h.Ten}, ${h.PhuongXa.TenPhuongXa}, ${h.PhuongXa.QuanHuyen.TenQuanHuyen}, Tỉnh Bình Định`)})},[p]),f===void 0?x.jsxDEV("div",{children:x.jsxDEV(ew,{width:100},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/custome/TextThonXom.jsx",lineNumber:18,columnNumber:7},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/custome/TextThonXom.jsx",lineNumber:17,columnNumber:5},globalThis):f},LS=({item:p,data:f,fullScreen:l,close:h})=>{var k,v,N,S,O;let w=f[p==null?void 0:p.field]?p!=null&&p.dataSelect?(k=p==null?void 0:p.dataSelect)!=null&&k.urlExpand?f[(v=p==null?void 0:p.dataSelect)==null?void 0:v.urlExpand][(N=p==null?void 0:p.dataSelect)==null?void 0:N.text_field]:f[(S=p==null?void 0:p.dataSelect)==null?void 0:S.url][(O=p==null?void 0:p.dataSelect)==null?void 0:O.text_field]:f[p==null?void 0:p.field]:null;return x.jsxDEV(x.Fragment,{children:x.jsxDEV("div",{className:"form-item-detail",children:[x.jsxDEV("div",{className:"mb-2 ms-2",children:[!(p!=null&&p.hiddenLabel)&&p.title,x.jsxDEV("span",{style:p!=null&&p.hiddenLabel?{color:"transparent"}:{},children:":"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Detail/ItemDetail.jsx",lineNumber:21,columnNumber:11},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Detail/ItemDetail.jsx",lineNumber:19,columnNumber:9},globalThis),x.jsxDEV("div",{style:l?{background:"white",padding:"0"}:{},className:"value-detail-custom",children:[f[p==null?void 0:p.field]!==void 0?zS(p.type,w):x.jsxDEV(x.Fragment,{children:x.jsxDEV("i",{className:"text-muted",children:"Chưa có thông tin"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Detail/ItemDetail.jsx",lineNumber:28,columnNumber:15},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Detail/ItemDetail.jsx",lineNumber:27,columnNumber:13},globalThis),(p==null?void 0:p.btnClose)&&h&&x.jsxDEV(x.Fragment,{children:x.jsxDEV(hn,{onClick:h,className:"btn-close-in-item",children:[x.jsxDEV(Xt,{style:{marginTop:"0.1rem"},fa:"gg"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Detail/ItemDetail.jsx",lineNumber:34,columnNumber:17},globalThis),"Thay đổi"]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Detail/ItemDetail.jsx",lineNumber:33,columnNumber:15},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Detail/ItemDetail.jsx",lineNumber:32,columnNumber:13},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Detail/ItemDetail.jsx",lineNumber:23,columnNumber:9},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Detail/ItemDetail.jsx",lineNumber:18,columnNumber:7},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Detail/ItemDetail.jsx",lineNumber:17,columnNumber:5},globalThis)},zS=(p,f)=>{switch(p){case"date":return D0(f);case"datetime":return S0(f);case"input-hpx":return x.jsxDEV(gp,{maPhuongXa:f},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Detail/ItemDetail.jsx",lineNumber:52,columnNumber:14},globalThis);case"input-thon-xom":return x.jsxDEV(VS,{value:f},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Detail/ItemDetail.jsx",lineNumber:54,columnNumber:14},globalThis);case"danh-sach-cong-dan":return x.jsxDEV(Fy,{value:f,isDetail:!0},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Detail/ItemDetail.jsx",lineNumber:56,columnNumber:14},globalThis);case"checkbox":return f?"Có":"Không";default:return f}},BS=({listFormControl:p,data:f,children:l,isFormControl:h,close:w})=>x.jsxDEV(x.Fragment,{children:[l&&l.filter(k=>(k==null?void 0:k.position)==="top"&&(k==null?void 0:k.component)&&!(k!=null&&k.hidden)).map(k=>x.jsxDEV(x.Fragment,{children:x.jsxDEV(T0,{item:k},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Detail/BodyDetailCustom.jsx",lineNumber:13,columnNumber:17},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Detail/BodyDetailCustom.jsx",lineNumber:12,columnNumber:15},globalThis)),p.map(k=>{var v,N;return x.jsxDEV(x.Fragment,{children:x.jsxDEV("div",{children:[(k==null?void 0:k.tabName)&&(k==null?void 0:k.hidden)!==!0&&x.jsxDEV("h6",{className:"title-tab-name",children:k==null?void 0:k.tabName},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Detail/BodyDetailCustom.jsx",lineNumber:21,columnNumber:58},globalThis),!!((v=k==null?void 0:k.children)!=null&&v.length)&&f&&x.jsxDEV("div",{style:h?{marginTop:"1rem",boxShadow:"none",marginBottom:0,padding:0}:!(k!=null&&k.tabName)||(k==null?void 0:k.hidden)===!0?{borderRadius:"10px"}:{},className:"form-group",children:x.jsxDEV(x.Fragment,{children:x.jsxDEV("div",{style:{gridTemplateColumns:O0(k==null?void 0:k.ratio)},className:"form-body-group",children:(N=k==null?void 0:k.children)==null?void 0:N.map(S=>x.jsxDEV(x.Fragment,{children:x.jsxDEV(LS,{close:w,fullScreen:(k==null?void 0:k.ratio)===1,item:S,data:f},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Detail/BodyDetailCustom.jsx",lineNumber:43,columnNumber:29},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Detail/BodyDetailCustom.jsx",lineNumber:42,columnNumber:27},globalThis))},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Detail/BodyDetailCustom.jsx",lineNumber:39,columnNumber:21},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Detail/BodyDetailCustom.jsx",lineNumber:38,columnNumber:19},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Detail/BodyDetailCustom.jsx",lineNumber:23,columnNumber:17},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Detail/BodyDetailCustom.jsx",lineNumber:20,columnNumber:13},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Detail/BodyDetailCustom.jsx",lineNumber:19,columnNumber:11},globalThis)}),l&&l.filter(k=>(k==null?void 0:k.position)!=="top"&&(k==null?void 0:k.component)&&!(k!=null&&k.hidden)).map(k=>x.jsxDEV(x.Fragment,{children:x.jsxDEV(T0,{item:k},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Detail/BodyDetailCustom.jsx",lineNumber:61,columnNumber:17},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Detail/BodyDetailCustom.jsx",lineNumber:60,columnNumber:15},globalThis))]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Detail/BodyDetailCustom.jsx",lineNumber:6,columnNumber:5},globalThis),T0=({item:p})=>x.jsxDEV(x.Fragment,{children:x.jsxDEV("div",{children:[(p==null?void 0:p.title)&&x.jsxDEV("h6",{className:"title-tab-name",children:p==null?void 0:p.title},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Detail/BodyDetailCustom.jsx",lineNumber:75,columnNumber:25},globalThis),x.jsxDEV("div",{style:p!=null&&p.title?{}:{borderRadius:"10px"},className:"form-group",children:p==null?void 0:p.component},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Detail/BodyDetailCustom.jsx",lineNumber:76,columnNumber:9},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Detail/BodyDetailCustom.jsx",lineNumber:74,columnNumber:7},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Detail/BodyDetailCustom.jsx",lineNumber:73,columnNumber:5},globalThis),FS=U.forwardRef(({Id:p,columns:f,children:l,close:h,title:w,url:k,isDetail:v,disabled:N,isFormControl:S,titleSecond:O,getData:C,apiGetData:L},j)=>{let F=f.filter(Z=>Z.type||Z.tabName),q=R0(F)||[];const[K,te]=U.useState();U.useEffect(()=>{C&&C(K)},[K]),U.useImperativeHandle(j,()=>({loadData(){se()}}));const se=U.useCallback(()=>{let Z=L||`${k}(${p})${k_(f)?`?$expand=${k_(f)}`:""}`;zt(Z,"GET",null,{odata:!L}).then(Y=>{te(Y)})},[p,L,f,k]);return U.useEffect(()=>{se()},[se]),U.useEffect(()=>{const Z=Y=>{Y.key==="Escape"&&h()};return document.addEventListener("keydown",Z),()=>{document.removeEventListener("keydown",Z)}},[h]),x.jsxDEV(x.Fragment,{children:x.jsxDEV("div",{onClick:()=>!S&&h(),className:S?"":"outline-form-detail-custom",children:x.jsxDEV("div",{onClick:Z=>Z.stopPropagation(),style:S?{padding:0}:{},className:`form-detail-custom ${S?"bg-white":(F.length>10,"form-modal-min")}`,children:[!S&&x.jsxDEV("div",{style:{borderBottom:"solid 1px #f1f1f1"},className:"d-flex mb-4 align-items-start justify-content-between hidden-by-formcontrol",children:[w!==!1&&x.jsxDEV("div",{children:[x.jsxDEV("div",{className:"d-flex align-items-center gap-4",children:x.jsxDEV("h3",{className:"fw-bold mb-0",children:["Thông tin chi tiết ",O||""]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Detail/DetailCustom.jsx",lineNumber:71,columnNumber:23},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Detail/DetailCustom.jsx",lineNumber:70,columnNumber:21},globalThis),x.jsxDEV("p",{className:"mb-4"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Detail/DetailCustom.jsx",lineNumber:73,columnNumber:21},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Detail/DetailCustom.jsx",lineNumber:69,columnNumber:19},globalThis),x.jsxDEV("div",{className:"d-flex align-items-center gap-4",children:[x.jsxDEV("div",{className:"id-data",children:[x.jsxDEV(Xt,{fa:"500px"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Detail/DetailCustom.jsx",lineNumber:78,columnNumber:21},globalThis),"ID Dữ liêu: ",p]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Detail/DetailCustom.jsx",lineNumber:77,columnNumber:19},globalThis),!v&&x.jsxDEV(x.Fragment,{children:[x.jsxDEV("p",{style:{fontSize:"20px"},className:"mb-1 text-muted",children:"|"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Detail/DetailCustom.jsx",lineNumber:83,columnNumber:23},globalThis),x.jsxDEV(hn,{onClick:h,style:{boxShadow:"none",fontSize:"20px"},className:"btn-close"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Detail/DetailCustom.jsx",lineNumber:86,columnNumber:23},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Detail/DetailCustom.jsx",lineNumber:82,columnNumber:21},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Detail/DetailCustom.jsx",lineNumber:76,columnNumber:17},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Detail/DetailCustom.jsx",lineNumber:64,columnNumber:15},globalThis),K&&x.jsxDEV(BS,{listFormControl:q,isFormControl:S,title:w,data:K,children:l,close:S&&!v&&!N?h:!1},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Detail/DetailCustom.jsx",lineNumber:97,columnNumber:15},globalThis),!(f!=null&&f.find(Z=>Z.btnClose===!0))&&S&&!v&&K&&!N&&x.jsxDEV(x.Fragment,{children:x.jsxDEV("div",{style:{padding:S?"2rem":"0.7rem"},children:x.jsxDEV("div",{className:"form-btn-change-select",children:x.jsxDEV(hn,{onClick:h,children:"Thay đổi lựa chọn"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Detail/DetailCustom.jsx",lineNumber:110,columnNumber:21},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Detail/DetailCustom.jsx",lineNumber:109,columnNumber:19},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Detail/DetailCustom.jsx",lineNumber:108,columnNumber:17},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Detail/DetailCustom.jsx",lineNumber:107,columnNumber:15},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Detail/DetailCustom.jsx",lineNumber:56,columnNumber:11},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Detail/DetailCustom.jsx",lineNumber:55,columnNumber:9},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Detail/DetailCustom.jsx",lineNumber:54,columnNumber:7},globalThis)});const qS=({data:p,item:f,setData:l,isErr:h,columns:w,fullScreen:k,isEdit:v})=>{var N,S,O;return x.jsxDEV(x.Fragment,{children:pN((N=f==null?void 0:f.dependent)==null?void 0:N.name,p[(S=f==null?void 0:f.dependent)==null?void 0:S.name],(O=f==null?void 0:f.dependent)==null?void 0:O.comparison)&&x.jsxDEV("div",{style:k?{background:"none",padding:"0"}:{},className:`item-form-control ${p[f==null?void 0:f.field]||p[f==null?void 0:f.field]===0?"form-custom-formcontrol":""} ${h?"form-custom-formcontrol-err":""}`,children:[x.jsxDEV("p",{className:"title-item-form",children:!(f!=null&&f.hiddenLabel)&&x.jsxDEV(x.Fragment,{children:[f==null?void 0:f.title," ",(f==null?void 0:f.required)&&x.jsxDEV("strong",{style:{color:"red"},children:"*"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/ItemFormControl.jsx",lineNumber:18,columnNumber:50},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/ItemFormControl.jsx",lineNumber:17,columnNumber:15},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/ItemFormControl.jsx",lineNumber:15,columnNumber:11},globalThis),x.jsxDEV("div",{children:x.jsxDEV(Lt,{data:{hidden_label:!0,disabled:f!=null&&f.disabledWhenEdit?!!v:!!(f!=null&&f.disabled),...gN(f,p)},value:p?p[f==null?void 0:f.field]:null,onChange:(C,L)=>l(j=>({...bN(w,j,f==null?void 0:f.field,L),[f==null?void 0:f.field]:L}))},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/ItemFormControl.jsx",lineNumber:23,columnNumber:13},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/ItemFormControl.jsx",lineNumber:22,columnNumber:11},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/ItemFormControl.jsx",lineNumber:9,columnNumber:9},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/ItemFormControl.jsx",lineNumber:7,columnNumber:5},globalThis)},HS=({children:p,listFormControl:f,listErr:l,data:h,listData:w,setData:k,isEdit:v,search:N,hidden:S})=>x.jsxDEV(x.Fragment,{children:[p&&p.filter(O=>(O==null?void 0:O.position)==="top"&&(O==null?void 0:O.component)&&!(O!=null&&O.hidden)).map(O=>x.jsxDEV(x.Fragment,{children:x.jsxDEV(C0,{item:O},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/BodyModalCustom.jsx",lineNumber:13,columnNumber:17},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/BodyModalCustom.jsx",lineNumber:12,columnNumber:15},globalThis)),!S&&f.map(O=>{var C,L;return x.jsxDEV(x.Fragment,{children:x.jsxDEV("div",{children:[(O==null?void 0:O.tabName)&&(O==null?void 0:O.hidden)!==!0&&x.jsxDEV("h4",{className:"title-item-name-group",children:O==null?void 0:O.tabName},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/BodyModalCustom.jsx",lineNumber:22,columnNumber:60},globalThis),!!((C=O==null?void 0:O.children)!=null&&C.length)&&x.jsxDEV("div",{className:"form-group",children:x.jsxDEV(x.Fragment,{children:x.jsxDEV("div",{style:{gridTemplateColumns:O0(O==null?void 0:O.ratio)},className:"form-body-group",children:(L=O==null?void 0:O.children)==null?void 0:L.filter(j=>{var F,q;return N&&(N!=null&&N.text)?(q=j==null?void 0:j.title)==null?void 0:q.toUpperCase().includes((F=N==null?void 0:N.text)==null?void 0:F.toUpperCase()):!0}).map(j=>x.jsxDEV(x.Fragment,{children:x.jsxDEV(qS,{isErr:l.includes(j.field)&&(h[j==null?void 0:j.field]===null||h[j==null?void 0:j.field]===""),fullScreen:(O==null?void 0:O.ratio)===1,columns:w,item:j,data:h,setData:k,isEdit:v},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/BodyModalCustom.jsx",lineNumber:36,columnNumber:33},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/BodyModalCustom.jsx",lineNumber:35,columnNumber:31},globalThis))},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/BodyModalCustom.jsx",lineNumber:26,columnNumber:23},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/BodyModalCustom.jsx",lineNumber:25,columnNumber:21},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/BodyModalCustom.jsx",lineNumber:24,columnNumber:19},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/BodyModalCustom.jsx",lineNumber:21,columnNumber:15},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/BodyModalCustom.jsx",lineNumber:20,columnNumber:13},globalThis)}),p&&p.filter(O=>(O==null?void 0:O.position)!=="top"&&(O==null?void 0:O.component)&&!(O!=null&&O.hidden)).map(O=>x.jsxDEV(x.Fragment,{children:x.jsxDEV(C0,{item:O},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/BodyModalCustom.jsx",lineNumber:65,columnNumber:17},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/BodyModalCustom.jsx",lineNumber:64,columnNumber:15},globalThis))]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/BodyModalCustom.jsx",lineNumber:6,columnNumber:5},globalThis),C0=({item:p})=>x.jsxDEV(x.Fragment,{children:x.jsxDEV("div",{children:[(p==null?void 0:p.title)&&x.jsxDEV("h4",{className:"title-item-name-group",children:p==null?void 0:p.title},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/BodyModalCustom.jsx",lineNumber:79,columnNumber:25},globalThis),x.jsxDEV("div",{className:"form-group",children:p==null?void 0:p.component},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/BodyModalCustom.jsx",lineNumber:80,columnNumber:9},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/BodyModalCustom.jsx",lineNumber:78,columnNumber:7},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/BodyModalCustom.jsx",lineNumber:77,columnNumber:5},globalThis),$S=({data:p,setData:f,Id:l,url:h,onChange:w,value:k})=>{let v=localStorage.getItem(h);const[N,S]=U.useState(!!v||!1);return x.jsxDEV(x.Fragment,{children:x.jsxDEV("div",{className:"toolbar-form",children:[x.jsxDEV(fu,{onChange:O=>w(O.target.value),value:k,className:"input-search",placeholder:"Tìm kiếm"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/ToolbarModalCustom.jsx",lineNumber:15,columnNumber:9},globalThis),h&&!l&&x.jsxDEV("div",{className:"form-btn-toolbar",children:[x.jsxDEV(hn,{onClick:()=>{localStorage.removeItem(h),S(!1),Cr("Bản lưu tạm đã được xóa!")},disabled:!N||l,className:"delete",children:[x.jsxDEV(Xt,{fa:"trash-o"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/ToolbarModalCustom.jsx",lineNumber:32,columnNumber:15},globalThis)," ",x.jsxDEV("div",{className:"text-name-toolbar",children:"Xóa bản lưu tạm"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/ToolbarModalCustom.jsx",lineNumber:32,columnNumber:45},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/ToolbarModalCustom.jsx",lineNumber:23,columnNumber:13},globalThis),x.jsxDEV(hn,{onClick:()=>{f(O=>({...JSON.parse(v),...vN(O)}))},disabled:!N||l,className:"paste",children:[x.jsxDEV(Xt,{fa:"file-text"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/ToolbarModalCustom.jsx",lineNumber:41,columnNumber:15},globalThis)," ",x.jsxDEV("div",{className:"text-name-toolbar",children:"Dùng bản lưu tạm"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/ToolbarModalCustom.jsx",lineNumber:41,columnNumber:47},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/ToolbarModalCustom.jsx",lineNumber:34,columnNumber:13},globalThis),x.jsxDEV(hn,{onClick:()=>{localStorage.setItem(h,JSON.stringify(p)),S(!0),Cr("Bản copy này đã được lưu lại. Bạn có thể sử dụng dữ liệu này cho các lần nhập liệu kế tiếp.","Lưu thành công")},disabled:N||l,className:"copy",children:[x.jsxDEV(Xt,{fa:"clone"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/ToolbarModalCustom.jsx",lineNumber:55,columnNumber:15},globalThis)," ",x.jsxDEV("div",{className:"text-name-toolbar",children:"Copy bản lưu tạm"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/ToolbarModalCustom.jsx",lineNumber:55,columnNumber:43},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/ToolbarModalCustom.jsx",lineNumber:43,columnNumber:13},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/ToolbarModalCustom.jsx",lineNumber:22,columnNumber:11},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/ToolbarModalCustom.jsx",lineNumber:14,columnNumber:7},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/ToolbarModalCustom.jsx",lineNumber:13,columnNumber:5},globalThis)},E0=U.forwardRef(({open:p,close:f,Id:l,columns:h,title:w,titleSecond:k,url:v,children:N,afterSaving:S,getId:O,defaultValue:C,addValue:L,getData:j,getFullData:F,hidden:q,apiUrl:K,apiGetData:te,method:se},Z)=>{let Y=`${l||l===0?"Cập nhật":"Thêm mới"}`;const oe=h.filter(De=>De.type),ie=oe!=null&&oe.length?oe.filter(De=>De.required):[],ge=C?{...Ev(oe),...C}:Ev(oe),[de,je]=U.useState(ge),[Ie,Pe]=U.useState([]);let ce=h.filter(De=>De.type||De.tabName);const ae=R0(ce),be=h.filter(De=>De.dataID)[0].field,[ke,_e]=U.useState({text:"",required:!1}),[Ee,Se]=U.useState(null);U.useEffect(()=>{je(De=>({...De,...ge}))},[C]),U.useEffect(()=>{j&&j(de)},[de]),U.useImperativeHandle(Z,()=>({loadData(){Oe()}}));const Oe=U.useCallback(()=>{let De=h.filter(Ne=>Ne.type),Fe=Ev(De),mt=te||`${v}(${l})`;l!==!0&&(l||l===0)&&Fe&&zt(mt,"GET",null,{odata:!te}).then(Ne=>{je(__(Fe,Ne)),Se(__(Fe,Ne)),F&&F(Ne)})},[l,te,h,F,v]);U.useEffect(()=>{Oe()},[Oe]);const rt=()=>{let De=wN(ie,de);if(Av(De,de)){console.log(Av(De,de)),Er("Bạn nhập thiếu trường dữ liệu!"),Pe(Av(De,de));return}let Fe=K||(l||l===0?`${v}(${l})`:`${v}`),mt=se||(K?"POST":l||l===0?"PATCH":"POST"),Ne=K?Ee?{...Ee,...de}:de:Ee?kN(Ee,de):de,Le=L?{...Ne,...L}:Ne,qe=Object.keys(Le).length,$e=!K;if(!qe&&l){Er("Bạn chưa thay đổi bất cứ trường nào");return}zt(Fe,mt,JSON.stringify(Le),{odata:$e}).then(tt=>{if(S&&S(),Cr("Thành công!"),f(),K){O&&O(tt);return}O&&O(tt[be]||l)}).catch(tt=>{var nt,Ue;if(K){$o(tt||"Không thành công!");return}$o(tt["odata.error"]?(Ue=(nt=tt["odata.error"])==null?void 0:nt.message)==null?void 0:Ue.value:"Không thành công!")})};return x.jsxDEV(x.Fragment,{children:x.jsxDEV(Sr,{size:"xl",zIndex:1500,className:"form-modal-auto-custom",isOpen:p,toggle:f,children:x.jsxDEV("div",{className:"inline-form-modal-auto-custom",children:[x.jsxDEV("div",{className:"form-list-btn-action",children:[x.jsxDEV("div",{className:"list-btn-action",children:[x.jsxDEV("div",{className:"form-info",children:l||l===0?x.jsxDEV(x.Fragment,{children:[x.jsxDEV("div",{className:"d-flex align-items-center gap-2",children:[x.jsxDEV(Xt,{fa:"500px"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/ModalCustom.jsx",lineNumber:140,columnNumber:25},globalThis)," ID Dữ Liệu: ",l]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/ModalCustom.jsx",lineNumber:139,columnNumber:23},globalThis)," "]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/ModalCustom.jsx",lineNumber:138,columnNumber:21},globalThis):x.jsxDEV(x.Fragment,{children:[x.jsxDEV("div",{className:"d-flex align-items-center gap-2",children:[x.jsxDEV(Xt,{fa:"dashcube"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/ModalCustom.jsx",lineNumber:146,columnNumber:25},globalThis)," Thêm mới"]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/ModalCustom.jsx",lineNumber:145,columnNumber:23},globalThis)," "]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/ModalCustom.jsx",lineNumber:144,columnNumber:21},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/ModalCustom.jsx",lineNumber:136,columnNumber:17},globalThis),x.jsxDEV(hn,{onClick:rt,className:"btn-action",children:"Lưu thông tin"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/ModalCustom.jsx",lineNumber:152,columnNumber:17},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/ModalCustom.jsx",lineNumber:134,columnNumber:15},globalThis),x.jsxDEV(hn,{style:{boxShadow:"none"},onClick:f,className:"btn-close btn-close-custom"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/ModalCustom.jsx",lineNumber:156,columnNumber:15},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/ModalCustom.jsx",lineNumber:133,columnNumber:13},globalThis),x.jsxDEV("div",{className:"header-modal-custom",children:[x.jsxDEV("div",{style:{width:"max-content"},className:"d-flex justify-content-bettween position-relative",children:x.jsxDEV("div",{children:[x.jsxDEV("h4",{className:"fw-bold",children:[Y," ",k||""]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/ModalCustom.jsx",lineNumber:161,columnNumber:19},globalThis),x.jsxDEV("p",{className:"mb-3 fw-bold text-muted"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/ModalCustom.jsx",lineNumber:164,columnNumber:19},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/ModalCustom.jsx",lineNumber:160,columnNumber:17},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/ModalCustom.jsx",lineNumber:159,columnNumber:15},globalThis),x.jsxDEV($S,{onChange:De=>_e(Fe=>({...Fe,text:De})),value:ke.text,Id:l,data:de,setData:je,url:v},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/ModalCustom.jsx",lineNumber:167,columnNumber:15},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/ModalCustom.jsx",lineNumber:158,columnNumber:13},globalThis),x.jsxDEV("div",{className:"outline-form",children:x.jsxDEV(HS,{search:ke,children:N,listFormControl:ae,listErr:Ie,data:de,listData:oe,hidden:q,setData:je,isEdit:l},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/ModalCustom.jsx",lineNumber:177,columnNumber:15},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/ModalCustom.jsx",lineNumber:176,columnNumber:13},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/ModalCustom.jsx",lineNumber:132,columnNumber:11},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/ModalCustom.jsx",lineNumber:131,columnNumber:9},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/components/TableAutoCustom/Modal/ModalCustom.jsx",lineNumber:130,columnNumber:7},globalThis)}),Fy=({value:p,onChange:f,isDetail:l,disabled:h})=>{const[w,k]=U.useState(!1),[v,N]=U.useState(null),[S,O]=U.useState(""),[C,L]=U.useState(!1),j=U.useRef(),F=U.useCallback((q,K)=>{var te;if(q&&K){f(q);return}q?zt(`HNCN_CongDan?$filter=(substringof('${q}', SoCCCD)) and ThonXom/MaPhuongXa eq '${(te=yn)==null?void 0:te.MaPhuongXa}'&$top=1`).then(se=>{se.value.length?(N(se.value[0].Id),f(se.value[0].Id)):(k(!0),f(null))}):N(null)},[f]);return x.jsxDEV(x.Fragment,{children:x.jsxDEV("div",{style:l?{}:{borderRadius:"10px",boxShadow:"rgba(0, 0, 0, 0.06) 0px 2px 4px 0px inset",border:"solid 1px lightgray"},className:l?"":"p-2",children:[!l&&x.jsxDEV(x.Fragment,{children:!p&&x.jsxDEV(x.Fragment,{children:!w&&x.jsxDEV(x.Fragment,{children:x.jsxDEV("div",{className:"d-flex",children:[x.jsxDEV("div",{className:"d-block w-25",children:x.jsxDEV(fu,{value:S,onChange:q=>{O(q.target.value)},onKeyPress:q=>{q.charCode===13&&F(q.target.value)},placeholder:"Tìm kiếm theo CMND/CCCD"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/DuLieuRaSot/CongDan/index.jsx",lineNumber:67,columnNumber:25},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/DuLieuRaSot/CongDan/index.jsx",lineNumber:66,columnNumber:23},globalThis),x.jsxDEV("div",{className:"d-flex gap-3 ms-3",children:x.jsxDEV(hn,{style:{background:"#004cb3",padding:"0.5rem 2rem",display:"flex",alignItems:"center",gap:"0.5rem"},onClick:()=>{F(S)},children:[x.jsxDEV(Xt,{fa:"500px"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/DuLieuRaSot/CongDan/index.jsx",lineNumber:93,columnNumber:27},globalThis),"Kiểm tra"]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/DuLieuRaSot/CongDan/index.jsx",lineNumber:81,columnNumber:25},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/DuLieuRaSot/CongDan/index.jsx",lineNumber:80,columnNumber:23},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/DuLieuRaSot/CongDan/index.jsx",lineNumber:65,columnNumber:21},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/DuLieuRaSot/CongDan/index.jsx",lineNumber:64,columnNumber:19},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/DuLieuRaSot/CongDan/index.jsx",lineNumber:62,columnNumber:15},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/DuLieuRaSot/CongDan/index.jsx",lineNumber:60,columnNumber:11},globalThis),w&&S&&!v&&x.jsxDEV("span",{style:{fontWeight:"500"},className:"ms-2",children:["Không có kết quả phù hợp với ",x.jsxDEV("strong",{children:S},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/DuLieuRaSot/CongDan/index.jsx",lineNumber:106,columnNumber:42},globalThis),", Hãy tiến hành Thêm mới!"]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/DuLieuRaSot/CongDan/index.jsx",lineNumber:105,columnNumber:11},globalThis),p&&x.jsxDEV(x.Fragment,{children:x.jsxDEV("div",{className:l?"":"mt-3",children:[tS&&x.jsxDEV("div",{style:{fontWeight:"500",borderRadius:"10px",padding:"1rem",background:"#f2f5f6"},className:" d-flex justify-content-between gap-3 align-items-center mb-4",children:["Cập nhật nhanh thông tin Công Dân",x.jsxDEV(hn,{style:{background:l?"linear-gradient(90deg, rgba(38,206,255,1) 0%, rgba(0,154,170,1) 100%)":"#0049a3"},className:"fw-bold d-flex align-items-center gap-2",onClick:()=>L(!0),children:[x.jsxDEV(Xt,{style:{marginTop:"0.2rem"},fa:"pencil-square-o"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/DuLieuRaSot/CongDan/index.jsx",lineNumber:132,columnNumber:21},globalThis),"Cập nhật"]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/DuLieuRaSot/CongDan/index.jsx",lineNumber:123,columnNumber:19},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/DuLieuRaSot/CongDan/index.jsx",lineNumber:113,columnNumber:17},globalThis),x.jsxDEV(FS,{title:"Công dân",ref:j,url:"HNCN_CongDan",isDetail:l,disabled:h,Id:p||v,isFormControl:!0,close:()=>{f(null),N(null)},columns:Xv},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/DuLieuRaSot/CongDan/index.jsx",lineNumber:137,columnNumber:15},globalThis),C&&x.jsxDEV(E0,{columns:Xv,open:C,close:()=>L(!1),Id:p||v,url:"HNCN_CongDan",afterSaving:()=>{var q,K;(q=j==null?void 0:j.current)!=null&&q.loadData&&((K=j==null?void 0:j.current)==null||K.loadData())}},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/DuLieuRaSot/CongDan/index.jsx",lineNumber:152,columnNumber:17},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/DuLieuRaSot/CongDan/index.jsx",lineNumber:111,columnNumber:13},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/DuLieuRaSot/CongDan/index.jsx",lineNumber:110,columnNumber:11},globalThis),w&&x.jsxDEV(x.Fragment,{children:x.jsxDEV("div",{className:"p-2",children:x.jsxDEV(E0,{columns:Xv,open:w,close:()=>k(!1),title:"Công dân",url:"HNCN_CongDan",defaultValue:{SoCCCD:S},getId:q=>{F(q,!0)},children:[{position:"top",component:x.jsxDEV(x.Fragment,{children:x.jsxDEV("div",{style:{background:"linear-gradient(90deg, rgba(235,235,235,1) 0%, rgba(219,230,235,1) 100%)",padding:"1rem",borderRadius:"10px",marginBottom:"1rem"},children:x.jsxDEV("span",{style:{fontWeight:"500"},className:"ms-2",children:["Không có kết quả phù hợp với ",x.jsxDEV("strong",{children:S},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/DuLieuRaSot/CongDan/index.jsx",lineNumber:193,columnNumber:58},globalThis),", Hãy tiến hành Thêm mới!"]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/DuLieuRaSot/CongDan/index.jsx",lineNumber:192,columnNumber:27},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/DuLieuRaSot/CongDan/index.jsx",lineNumber:184,columnNumber:25},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/DuLieuRaSot/CongDan/index.jsx",lineNumber:183,columnNumber:23},globalThis)}],afterSaving:()=>k(!1)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/DuLieuRaSot/CongDan/index.jsx",lineNumber:169,columnNumber:15},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/DuLieuRaSot/CongDan/index.jsx",lineNumber:168,columnNumber:13},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/DuLieuRaSot/CongDan/index.jsx",lineNumber:167,columnNumber:11},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/DuLieuRaSot/CongDan/index.jsx",lineNumber:47,columnNumber:7},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/views/DuLieuRaSot/CongDan/index.jsx",lineNumber:46,columnNumber:5},globalThis)},US=({value:p,title:f,onChange:l,placeholder:h})=>{var L,j,F,q;const[w,k]=U.useState(""),[v,N]=U.useState(!1),[S,O]=U.useState({IdTinh:"52",IdQuan:((L=yn)==null?void 0:L.MaQuanHuyen)||null,IdPhuong:(j=yn)==null?void 0:j.MaPhuongXa,IdThon:p});U.useEffect(()=>{p&&zt(`ThonXoms(${p})?$expand=PhuongXa/QuanHuyen`).then(K=>{k(`Thôn ${K.Ten}, ${K.PhuongXa.TenPhuongXa}, ${K.PhuongXa.QuanHuyen.TenQuanHuyen}, Tỉnh Bình Định`),O(te=>({...te,IdQuan:K.PhuongXa.QuanHuyen.MaQuanHuyen,IdPhuong:K.PhuongXa.MaPhuongXa,IdThon:K.Id}))})},[p]);const C=(K,te)=>{By(O,K,te)};return x.jsxDEV(x.Fragment,{children:[x.jsxDEV(fu,{style:{cursor:"pointer"},onClick:()=>N(!0),value:w,placeholder:h||"Chọn vị trí"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/custome/InputThonXom.jsx",lineNumber:38,columnNumber:7},globalThis),x.jsxDEV(Sr,{zIndex:3900,isOpen:v,toggle:()=>N(K=>!K),children:[x.jsxDEV("div",{className:"p-4 d-block",children:[x.jsxDEV("div",{className:"d-flex w-100 mb-3",children:[x.jsxDEV("strong",{className:"text-red me-2",children:"*"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/custome/InputThonXom.jsx",lineNumber:47,columnNumber:13},globalThis),x.jsxDEV("h6",{children:[f||"Thôn xóm"," :"]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/custome/InputThonXom.jsx",lineNumber:48,columnNumber:13},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/custome/InputThonXom.jsx",lineNumber:46,columnNumber:11},globalThis),x.jsxDEV("div",{style:{display:"grid",gap:"1rem"},className:"w-100",children:[x.jsxDEV(Lt,{data:{title:"Tỉnh thành",required:!0,type:"data-select",disabled:!0,dataSelect:{url:"TinhThanhs",value_field:"MaTinhThanh",text_field:"TenTinhThanh",placeholder:"Chọn tỉnh thành"}},value:S==null?void 0:S.IdTinh,inline:!1,onChange:(K,te)=>{C(["IdTinh"],te),C(["IdQuan"],null),C(["IdPhuong"],null),C(["IdThon"],null)}},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/custome/InputThonXom.jsx",lineNumber:51,columnNumber:13},globalThis),x.jsxDEV(Lt,{data:{title:"Quận/Huyện",required:!0,type:"data-select",disabled:(F=yn)==null?void 0:F.MaQuanHuyen,dataSelect:{url:"QuanHuyens",value_field:"MaQuanHuyen",text_field:"TenQuanHuyen",placeholder:"Chọn Quận/Huyện",where:`MaTinhThanh eq '${S.IdTinh}'`}},value:S==null?void 0:S.IdQuan,inline:!1,onChange:(K,te)=>{C(["IdQuan"],te),C(["IdPhuong"],null),C(["IdThon"],null)}},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/custome/InputThonXom.jsx",lineNumber:73,columnNumber:13},globalThis),x.jsxDEV(Lt,{data:{title:"Phường/Xã",required:!0,type:"data-select",disabled:(q=yn)==null?void 0:q.MaPhuongXa,dataSelect:{url:"PhuongXas",value_field:"MaPhuongXa",text_field:"TenPhuongXa",placeholder:"Chọn Quận/Huyện",where:`MaQuanHuyen eq '${S.IdQuan}'`}},value:S==null?void 0:S.IdPhuong,inline:!1,onChange:(K,te)=>{C(["IdPhuong"],te),C(["IdThon"],null)}},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/custome/InputThonXom.jsx",lineNumber:95,columnNumber:13},globalThis),x.jsxDEV(Lt,{data:{title:"Thôn/Xóm",type:"data-select",required:!0,dataSelect:{url:"ThonXoms",value_field:"Id",text_field:"Ten",placeholder:"Chọn Thôn/Xóm",where:`MaPhuongXa eq '${S.IdPhuong}'`}},value:S==null?void 0:S.IdThon,inline:!1,onChange:(K,te)=>{C(["IdThon"],te)}},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/custome/InputThonXom.jsx",lineNumber:116,columnNumber:13},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/custome/InputThonXom.jsx",lineNumber:50,columnNumber:11},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/custome/InputThonXom.jsx",lineNumber:45,columnNumber:9},globalThis),x.jsxDEV(_w,{children:x.jsxDEV(xw,{onClick:()=>{l&&l(S.IdThon),N(!1)},disabled:!S.IdThon,children:"Lưu"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/custome/InputThonXom.jsx",lineNumber:138,columnNumber:11},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/custome/InputThonXom.jsx",lineNumber:137,columnNumber:9},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/custome/InputThonXom.jsx",lineNumber:44,columnNumber:7},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/custome/InputThonXom.jsx",lineNumber:37,columnNumber:5},globalThis)},WS=({value:p,onChange:f,placeholder:l})=>{const[h,w]=U.useState();let k=new Date().getFullYear();return x.jsxDEV(x.Fragment,{children:x.jsxDEV(qx,{value:h||p,onBlur:()=>{h!==0&&(+h<1e3||+h>k)&&Er("Bạn chưa nhập đúng định dạng năm!")},onChange:v=>{w(+v.target.value),+v.target.value>=1e3&&+v.target.value<=k&&f(+v.target.value)},placeholder:l||"Nhập năm"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Input/InputYear.jsx",lineNumber:10,columnNumber:7},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Input/InputYear.jsx",lineNumber:9,columnNumber:5},globalThis)};class tk extends U.Component{render(){const{value:f,onChange:l,disabled:h}=this.props,w=()=>{let k=[];for(var v=1;v<=31;v++)k.push({value:v,label:`Ngày ${v}`});return k};return x.jsxDEV(yw,{disabled:h,value:f||"",onChange:l,options:w(),valueRef:"value",labelRef:"label",placeholder:"Chọn ngày"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/select/SelectDate.jsx",lineNumber:15,columnNumber:7},this)}}tk.propTypes={};tk.defaultProps={placeholder:"Chọn..."};const KS=(p,f)=>{let{data:l,onChange:h,onKeyDown:w,value:k,isDetail:v,onBlur:N,donVi:S,valueId:O}=p;const C=j=>`Nhập ${j==null?void 0:j.toLowerCase()}`;switch(v&&l.type!=="data-select"?"label":l.type){case"number_current":return x.jsxDEV(Vy,{disabled:l.disabled,id:l.field_name,name:l.field_name,placeholder:"0",defaultValue:k,decimalsLimit:0,decimalScale:0,value:k,onValueChange:(j,F)=>{h&&h(l.field_name,parseFloat(j))},className:"number-format form-control-sm form-control text-right"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:51,columnNumber:9},globalThis);case"label":return x.jsxDEV("span",{style:l.style,children:l.type==="datetime"?S0(k):l.type==="date"?D0(k):l.type==="radio-list"?k===2?k="Thông báo giá":k="Kê khai giá":l.type==="numeric"?Jv(k):k},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:68,columnNumber:9},globalThis);case"textbox":return x.jsxDEV(fu,{style:{background:l.disabled?"#dedede":"inherit",textAlign:l.textAlign?l.textAlign:"left"},autoFocus:l.autoFocus,disabled:f||(l.disabled?l.disabled:!1),plaintext:l.plaintext||!1,name:l.field_name,value:k??"",onChange:j=>h&&h(j.target.name,j.target.value),onBlur:j=>N&&N(j.target.name,j.target.value),placeholder:l.placeholder?l.placeholder:C(l.title)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:84,columnNumber:9},globalThis);case"password":return x.jsxDEV(Kx,{style:{background:l.disabled?"#dedede":"inherit"},autoFocus:l.autoFocus,name:l.field_name,value:k??"",onChange:j=>h&&h(j.target.name,j.target.value),onBlur:j=>N&&N(j.target.name,j.target.value),placeholder:C(l.title),validation:{regex:/^(?=.*[A-Z])(?=.*[!@#$&*]).{6,}$/,text:"Mật khẩu không được nhỏ hơn 6 ký tự, có chữ hoa và ký tự đặc biệt"}},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:103,columnNumber:9},globalThis);case"textarea":return x.jsxDEV(Gx,{style:{background:l.disabled?"#dedede":"inherit"},autoFocus:l.autoFocus,rows:l.rows,disabled:l.disabled?l.disabled:!1,name:l.field_name,value:k??"",onChange:j=>h&&h(j.target.name,j.target.value),onBlur:j=>N&&N(j.target.name,j.target.value),onKeyDown:w,placeholder:C(l.title)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:120,columnNumber:9},globalThis);case"checkbox":return x.jsxDEV(V0,{autoFocus:l.autoFocus,disabled:l.disabled?l.disabled:!1,name:l.field_name,checked:k||!1,onChange:j=>h&&h(l.field_name,j),placeholder:C(l.title)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:136,columnNumber:9},globalThis);case"datetime":return x.jsxDEV(Wx,{style:{background:l.disabled?"#dedede":"inherit"},autoFocus:l.autoFocus,disabled:l.disabled?l.disabled:!1,name:l.field_name,value:k,onChange:j=>h&&h(l.field_name,j),placeholderText:C(l.title)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:147,columnNumber:9},globalThis);case"date":return x.jsxDEV(Ux,{style:{background:l.disabled?"#dedede":"inherit"},autoFocus:l.autoFocus,disabled:l.disabled?l.disabled:!1,name:l.field_name,value:k,onChange:j=>h&&h(l.field_name,j),placeholderText:C(l.title),notFormat:l.notFormat},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:159,columnNumber:9},globalThis);case"data-select":return l.dataSelect&&x.jsxDEV(j0,{menuPosition:l.menuPosition,autoFocus:l.dataSelect.autoFocus,isDetail:v,isMulti:l.dataSelect.isMulti?l.dataSelect.isMulti:!1,isClearable:l.dataSelect.isClearable,disabled:l.disabled?l.disabled:!1,url:l.dataSelect.url,odata:l.dataSelect.odata,where:l.dataSelect.where,group_by:l.dataSelect.group_by,columns:l.dataSelect.columns,valueField:l.dataSelect.value_field,textField:l.dataSelect.text_field,textFieldSub:l.dataSelect.text_field_sub,options:l.dataSelect.options,value:k,placeholder:l.dataSelect.placeholder,onChange:(j,F)=>{h&&h(l.field_name,j,F)}},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:173,columnNumber:11},globalThis);case"data-select-async":return l.dataSelect&&x.jsxDEV(eN,{disabled:f,value:k||"",url:l.dataSelect.url,column:l.dataSelect.column,options:l.dataSelect.options,whereOne:l.dataSelect.whereOne,where:l.dataSelect.where,onChange:j=>{j?h(l.field_name,j.value):h(null)}},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:200,columnNumber:11},globalThis);case"numeric":case"currency":return x.jsxDEV(p_,{style:{background:l.disabled||f?"#dedede":"inherit"},autoFocus:l.autoFocus,isDetail:v,decimalScale:l.decimalScale,className:"number-format",disabled:f||(l.disabled?l.disabled:!1),value:Jv(k),placeholder:l.placeholder||l.placeholder===null?l.placeholder:"0",onValueChange:j=>{h&&h(l.field_name,parseFloat(j.value))},onBlur:j=>N&&N(l.field_name,j),onKeyDown:w,onFocus:j=>l.onFocus&&j.target.select()},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:230,columnNumber:9},globalThis);case"number":return x.jsxDEV("div",{className:"row m-0 justify-content-center align-items-baseline",children:[x.jsxDEV(p_,{style:{background:l.disabled?"#dedede":"inherit"},autoFocus:l.autoFocus,isDetail:v,className:"number-format ms-3 me-3",disabled:l.disabled?l.disabled:!1,value:k,placeholder:"0",onValueChange:j=>{h&&(j.value||j.value===0)?h(l.field_name,j.value):h(l.field_name,null)},onBlur:j=>N&&N(l.field_name,j),onFocus:j=>l.onFocus&&j.target.select()},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:251,columnNumber:11},globalThis)," ",x.jsxDEV("p",{className:"col-2 mb-0 justify-content-center",children:S},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:267,columnNumber:11},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:250,columnNumber:9},globalThis);case"number-not-seperator":return x.jsxDEV("div",{style:{padding:"0 13px"},className:"row justify-content-center align-items-baseline",children:x.jsxDEV(Tw,{style:{background:l.disabled?"#dedede":"inherit"},autoFocus:l.autoFocus,isDetail:v,className:"number-format ms-3 me-3",disabled:l.disabled?l.disabled:!1,value:k,placeholder:"0",onValueChange:j=>{h&&h(l.field_name,j.value)},onBlur:j=>N&&N(l.field_name,j)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:273,columnNumber:11},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:272,columnNumber:9},globalThis);case"radio-list":return x.jsxDEV(jN,{name:l.field_name,disabled:l.disabled?l.disabled:!1,data:l.data,value:k,onChange:j=>h&&p.onChange(l.field_name,j)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:290,columnNumber:9},globalThis);case"radio":return x.jsxDEV(Cp,{name:l.field_name,disabled:l.disabled,value:k,label:l.title,hidden_label:l.hidden_label,checked:k===l.valueCompare&&!l.disabled,onChange:j=>{l.valueCompare!==k&&p.onChange(j.target.value)}},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:300,columnNumber:9},globalThis);case"checkbox-list":return x.jsxDEV(IN,{name:l.field_name,disabled:l.disabled?l.disabled:!1,data:l.data,value:k,onChange:j=>h&&p.onChange(l.field_name,j)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:328,columnNumber:9},globalThis);case"select-year":return x.jsxDEV(Cw,{disabled:l.disabled?l.disabled:!1,value:k,onChange:j=>{h&&p.onChange(l.field_name,j&&j.value)},placeholder:C(l.title)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:340,columnNumber:9},globalThis);case"input-year":return x.jsxDEV(x.Fragment,{children:x.jsxDEV(WS,{value:k,onChange:j=>{h&&p.onChange(l.field_name,j)},placeholder:C(l.title)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:352,columnNumber:11},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:351,columnNumber:9},globalThis);case"select-date":return x.jsxDEV(tk,{disabled:l.disabled?l.disabled:!1,value:k,onChange:j=>{h&&p.onChange(l.field_name,j&&j.value)},placeholder:C(l.title)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:365,columnNumber:9},globalThis);case"select-month":return x.jsxDEV(Ew,{disabled:l.disabled?l.disabled:!1,value:k,onChange:j=>{h&&p.onChange(l.field_name,j&&j.value)},placeholder:C(l.title)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:378,columnNumber:9},globalThis);case"select-custom":return x.jsxDEV(Jx,{value:k,onChange:j=>{h&&p.onChange(l.field_name,j&&j.value)},options:p.data.options},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:389,columnNumber:9},globalThis);case"select-multi":return x.jsxDEV(FN,{isSearchable:!1,cacheOptions:!0,isDisabled:l.isDisabled,className:"flex-grow-1",isMulti:!0,noOptionsMessage:()=>"Không có",loadingMessage:()=>"Đang tải các lựa chọn",placeholder:"Chọn...",onChange:j=>p.onChange&&p.onChange(l.field_name,j),value:k,getOptionValue:j=>j.Id,getOptionLabel:j=>j.Name,defaultOptions:!0,loadOptions:l.loadOptions},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:399,columnNumber:9},globalThis);case"popup-select":return x.jsxDEV(Sw,{ableCRUD:l.popupSelect.ableCRUD,isModal:l.popupSelect.isModal,isComponent:l.popupSelect.isComponent,isCheck:l.popupSelect.isCheck,isImport:l.popupSelect.isImport,label:l.popupSelect.label,dataSelect:{url:l.popupSelect.url,isFormSearch:l.popupSelect.isFormSearch,selectColumn:l.popupSelect.selectColumn,columns:l.popupSelect.columns,formAddModal:l.popupSelect.formAddModal,where:l.popupSelect.where,title:l.popupSelect.title,disableSelect:l.disabled,defaultValues:l.popupSelect.defaultValues,defaultValuesEdit:l.popupSelect.defaultValuesEdit,zIndex:l.popupSelect.zIndex,theadTableImport:l.popupSelect.theadTableImport,urlImport:l.popupSelect.urlImport,urlPreImport:l.popupSelect.urlPreImport,urldownload:l.popupSelect.urldownload,columnsImport:l.popupSelect.columnsImport,isNew:l.popupSelect.isNew,keyComponent:l.popupSelect.keyComponent},keyComponent:l.popupSelect.keyComponent,componentOnRowSelect:l.popupSelect.componentOnRowSelect,isOnRowSelect:l.popupSelect.isOnRowSelect,maxWidth:l.popupSelect.maxWidth,valueDisplay:k,onDelete:l.popupSelect.onDelete,onClickButton:l.popupSelect.onClickButton,onCallback:j=>h&&p.onChange(l.field_name,j&&(l.popupSelect.isGetItem?j:j.Id||j.MaChuong))},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:440,columnNumber:9},globalThis);case"popup-select-tree":return x.jsxDEV(oS,{isDieu18:l.isDieu18,dataSelect:{disableSelect:l.disabled,endPoint:l.popupSelect.endPoint,template:l.popupSelect.template,label:l.popupSelect.label,placeholder:l.popupSelect.placeholder},EndPoint_Tree:l.popupSelect.EndPoint_Tree,EndPoint_Odata:l.popupSelect.EndPoint_Odata,valueDisplay:k,Id:O,onClickButton:l.popupSelect.onClickButton,onCallback:j=>h&&p.onChange(l.field_name,j&&j.value)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:487,columnNumber:9},globalThis);case"chkeditor":return x.jsxDEV(yT.CKEditor,{editor:NT,data:k||"",disabled:l.disabled,config:{toolbar:["heading","|","bold","italic","bulletedList","numberedList","|","outdent","indent","|","undo","redo"]},onReady:j=>{},onChange:(j,F)=>{},onBlur:(j,F)=>{let q=F.getData();h&&p.onChange(l.field_name,q)},onFocus:(j,F)=>{}},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:506,columnNumber:9},globalThis);case"ranger":return x.jsxDEV(CS,{value:k,rtl:!1,onChange:j=>p.onChange(l.field_name,j)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:539,columnNumber:14},globalThis);case"select-async-multi":return x.jsxDEV(PS,{name:l.field_name,onChange:j=>p.onChange(l.field_name,j),placeholder:l.dataSelect.placeholder||"Chọn",endPoint:l.dataSelect.endpoint,fieldValue:l.dataSelect.value_field,fieldLabel:l.dataSelect.text_field,getOptionValue:j=>j[l.dataSelect.value_field],getOptionLabel:j=>j[l.dataSelect.text_field],value:k,disabled:!1,conditions:l.dataSelect.conditions},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:542,columnNumber:9},globalThis);case"input-check-cmnd":return x.jsxDEV(RS,{style:{background:l.disabled?"#dedede":"inherit",textAlign:l.textAlign?l.textAlign:"left"},autoFocus:l.autoFocus,disabled:f||(l.disabled?l.disabled:!1),plaintext:l.plaintext||!1,name:l.field_name,value:k??"",onChange:j=>h&&h(null,j),onBlur:j=>N&&N(j.target.name,j.target.value),placeholder:l.placeholder?l.placeholder:C(l.title)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:558,columnNumber:9},globalThis);case"input-hpx":return x.jsxDEV(OS,{style:{background:l.disabled?"#dedede":"inherit",textAlign:l.textAlign?l.textAlign:"left"},autoFocus:l.autoFocus,disabled:f||(l.disabled?l.disabled:!1),plaintext:l.plaintext||!1,name:l.field_name,value:k??"",onChange:j=>h&&h(null,j),onBlur:j=>N&&N(j.target.name,j.target.value),placeholder:l.placeholder?l.placeholder:C(l.title)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:577,columnNumber:9},globalThis);case"input-thon-xom":return x.jsxDEV(x.Fragment,{children:x.jsxDEV(US,{value:k??"",onChange:j=>h&&h(null,j)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:597,columnNumber:11},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:596,columnNumber:9},globalThis);case"danh-sach-cong-dan":return x.jsxDEV(x.Fragment,{children:x.jsxDEV(Fy,{disabled:f||(l.disabled?l.disabled:!1),value:k,onChange:j=>h&&h(null,j)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:604,columnNumber:11},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:603,columnNumber:9},globalThis)}},nk=p=>{const{data:f,value:l,colLabel:h,colValue:w,onChange:k,onBlur:v,onKeyDown:N,onChangeRender:S,inline_equal:O,inline:C,className:L,style:j,styleRow:F,disabled:q,error:K,invalid:te}=p,se=Z=>`Nhập ${Z==null?void 0:Z.toLowerCase()}`;return f&&f.type!=="hidden"&&x.jsxDEV("div",{row:!0,className:`form-control-${f.field_name}`,style:F,children:[!(f!=null&&f.hidden_label)&&x.jsxDEV(Ar,{md:h||(C===!1?"12":"6"),children:f.required?x.jsxDEV(Fx,{children:f.title},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:645,columnNumber:15},globalThis):x.jsxDEV("strong",{style:{fontSize:"12px"},children:f.title},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:647,columnNumber:15},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:643,columnNumber:11},globalThis),x.jsxDEV(Ar,{md:w||(C===!1||f.hidden_label===!0?"12":"6"),style:j,children:[x.jsxDEV("div",{className:`form-control-value ${te?"is-invalid":""}`,style:f.width&&{maxWidth:f.width},children:f.render?f.render(l,S):f.lookup?x.jsxDEV(Hx,{style:{background:f.disabled?"#dedede":"inherit"},name:f.field_name,value:l,onChange:Z=>k&&k(Z.target.name,Z.target.value),onBlur:Z=>v&&v(Z.target.name,Z.target.value),onKeyDown:N,placeholder:se(f.title),children:Object.keys(f.lookup).map((Z,Y)=>x.jsxDEV("option",{value:Z,children:f.lookup[Z]},Y,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:672,columnNumber:19},globalThis))},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:662,columnNumber:15},globalThis):KS(p,q)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:655,columnNumber:11},globalThis),x.jsxDEV(Bx,{children:K==null?void 0:K.message},void 0,!1,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:681,columnNumber:11},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:651,columnNumber:9},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/qlhncn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:641,columnNumber:7},globalThis)};nk.propTypes={data:G.object.isRequired};nk.defaultProps={};const Lt=nk;export{$0 as A,BS as B,V0 as C,FS as D,Lt as F,uT as I,E0 as M,Sw as P,ew as S,ZA as T,zp as a,eS as b,MS as c,tS as d,QN as e,Cw as f,yD as g,Xv as h,_D as i,PS as j,xD as k,gp as l,By as s,qN as u};