@deskhero/dh_ui 2.0.3 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dh_ui.es.js +1 -1
- package/dist/dh_ui.umd.js +1 -1
- package/package.json +1 -1
package/dist/dh_ui.es.js
CHANGED
|
@@ -43756,7 +43756,7 @@ class FileTool {
|
|
|
43756
43756
|
for (const file of files) {
|
|
43757
43757
|
const url = URL.createObjectURL(file);
|
|
43758
43758
|
const fileId = this.generateFileId();
|
|
43759
|
-
const result = this.createResultElement(url, fileId);
|
|
43759
|
+
const result = this.createResultElement(url, fileId, file.name);
|
|
43760
43760
|
this.resultContainer.appendChild(result);
|
|
43761
43761
|
this.uploadFile(file, fileId);
|
|
43762
43762
|
}
|
package/dist/dh_ui.umd.js
CHANGED
|
@@ -374,7 +374,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
374
374
|
`);var z=d(b.insertInto+" "+b.insertAt.before);x.insertBefore(h,z)}}function N(b){if(b.parentNode===null)return!1;b.parentNode.removeChild(b);var h=g.indexOf(b);h>=0&&g.splice(h,1)}function v(b){var h=document.createElement("style");return b.attrs.type===void 0&&(b.attrs.type="text/css"),m(h,b.attrs),p(b,h),h}function m(b,h){Object.keys(h).forEach(function(x){b.setAttribute(x,h[x])})}function j(b,h){var x,k,z,S;if(h.transform&&b.css){if(!(S=h.transform(b.css)))return function(){};b.css=S}if(h.singleton){var E=f++;x=M||(M=v(h)),k=A.bind(null,x,E,!1),z=A.bind(null,x,E,!0)}else b.sourceMap&&typeof URL=="function"&&typeof URL.createObjectURL=="function"&&typeof URL.revokeObjectURL=="function"&&typeof Blob=="function"&&typeof btoa=="function"?(x=function(O){var _=document.createElement("link");return O.attrs.type===void 0&&(O.attrs.type="text/css"),O.attrs.rel="stylesheet",m(_,O.attrs),p(O,_),_}(h),k=C.bind(null,x,h),z=function(){N(x),x.href&&URL.revokeObjectURL(x.href)}):(x=v(h),k=L.bind(null,x),z=function(){N(x)});return k(b),function(O){if(O){if(O.css===b.css&&O.media===b.media&&O.sourceMap===b.sourceMap)return;k(b=O)}else z()}}e.exports=function(b,h){if(typeof DEBUG!="undefined"&&DEBUG&&typeof document!="object")throw new Error("The style-loader cannot be used in a non-browser environment");(h=h||{}).attrs=typeof h.attrs=="object"?h.attrs:{},h.singleton||typeof h.singleton=="boolean"||(h.singleton=l()),h.insertInto||(h.insertInto="head"),h.insertAt||(h.insertAt="bottom");var x=D(b,h);return I(x,h),function(k){for(var z=[],S=0;S<x.length;S++){var E=x[S];(O=s[E.id]).refs--,z.push(O)}for(k&&I(D(k,h),h),S=0;S<z.length;S++){var O;if((O=z[S]).refs===0){for(var _=0;_<O.parts.length;_++)O.parts[_]();delete s[O.id]}}}};var T,w=(T=[],function(b,h){return T[b]=h,T.filter(Boolean).join(`
|
|
375
375
|
`)});function A(b,h,x,k){var z=x?"":k.css;if(b.styleSheet)b.styleSheet.cssText=w(h,z);else{var S=document.createTextNode(z),E=b.childNodes;E[h]&&b.removeChild(E[h]),E.length?b.insertBefore(S,E[h]):b.appendChild(S)}}function L(b,h){var x=h.css,k=h.media;if(k&&b.setAttribute("media",k),b.styleSheet)b.styleSheet.cssText=x;else{for(;b.firstChild;)b.removeChild(b.firstChild);b.appendChild(document.createTextNode(x))}}function C(b,h,x){var k=x.css,z=x.sourceMap,S=h.convertToAbsoluteUrls===void 0&&z;(h.convertToAbsoluteUrls||S)&&(k=y(k)),z&&(k+=`
|
|
376
376
|
/*# sourceMappingURL=data:application/json;base64,`+btoa(unescape(encodeURIComponent(JSON.stringify(z))))+" */");var E=new Blob([k],{type:"text/css"}),O=b.href;b.href=URL.createObjectURL(E),O&&URL.revokeObjectURL(O)}},function(e,i){e.exports=function(t){var o=typeof window!="undefined"&&window.location;if(!o)throw new Error("fixUrls requires window.location");if(!t||typeof t!="string")return t;var a=o.protocol+"//"+o.host,s=a+o.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(l,u){var d,M=u.trim().replace(/^"(.*)"$/,function(f,g){return g}).replace(/^'(.*)'$/,function(f,g){return g});return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(M)?l:(d=M.indexOf("//")===0?M:M.indexOf("/")===0?a+M:s+M.replace(/^\.\//,""),"url("+JSON.stringify(d)+")")})}},function(e,i,t){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(o){var a=this;if(!document.documentElement.contains(a))return null;do{if(a.matches(o))return a;a=a.parentElement||a.parentNode}while(a!==null&&a.nodeType===1);return null})},function(e,i,t){t.r(i),t.d(i,"default",function(){return g}),t(0);function o(y){return function(I){if(Array.isArray(I))return a(I)}(y)||function(I){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(I))return Array.from(I)}(y)||function(I,D){if(!!I){if(typeof I=="string")return a(I,D);var p=Object.prototype.toString.call(I).slice(8,-1);if(p==="Object"&&I.constructor&&(p=I.constructor.name),p==="Map"||p==="Set")return Array.from(I);if(p==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(p))return a(I,D)}}(y)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
377
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function a(y,I){(I==null||I>y.length)&&(I=y.length);for(var D=0,p=new Array(I);D<I;D++)p[D]=y[D];return p}function s(){var y=document.activeElement,I=window.getSelection().getRangeAt(0),D=I.cloneRange();return D.selectNodeContents(y),D.setStart(I.endContainer,I.endOffset),D.extractContents()}function l(y){var I,D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},N=document.createElement(y);Array.isArray(D)?(I=N.classList).add.apply(I,o(D)):D&&N.classList.add(D);for(var v in p)N[v]=p[v];return N}function u(y){return y.innerHTML.replace("<br>"," ").trim()}function d(y){var I=arguments.length>1&&arguments[1]!==void 0&&arguments[1],D=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,p=document.createRange(),N=window.getSelection();p.selectNodeContents(y),D!==void 0&&(p.setStart(y,D),p.setEnd(y,D)),p.collapse(I),N.removeAllRanges(),N.addRange(p)}t(5);function M(y,I){for(var D=0;D<I.length;D++){var p=I[D];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(y,p.key,p)}}function f(y,I,D){return I&&M(y.prototype,I),D&&M(y,D),y}var g=function(){function y(I){var D=I.data,p=(I.config,I.api),N=I.readOnly;(function(v,m){if(!(v instanceof m))throw new TypeError("Cannot call a class as a function")})(this,y),this._elements={wrapper:null,items:[]},this.readOnly=N,this.api=p,this.data=D||{}}return f(y,null,[{key:"isReadOnlySupported",get:function(){return!0}},{key:"enableLineBreaks",get:function(){return!0}},{key:"toolbox",get:function(){return{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M9.2 12L11.0586 13.8586C11.1367 13.9367 11.2633 13.9367 11.3414 13.8586L14.7 10.5"/><rect width="14" height="14" x="5" y="5" stroke="currentColor" stroke-width="2" rx="4"/></svg>',title:"Checklist"}}},{key:"conversionConfig",get:function(){return{export:function(I){return I.items.map(function(D){return D.text}).join(". ")},import:function(I){return{items:[{text:I,checked:!1}]}}}}}]),f(y,[{key:"render",value:function(){var I=this;return this._elements.wrapper=l("div",[this.CSS.baseBlock,this.CSS.wrapper]),this.data.items||(this.data.items=[{text:"",checked:!1}]),this.data.items.forEach(function(D){var p=I.createChecklistItem(D);I._elements.wrapper.appendChild(p)}),this.readOnly||(this._elements.wrapper.addEventListener("keydown",function(D){switch(D.keyCode){case 13:I.enterPressed(D);break;case 8:I.backspace(D)}},!1),this._elements.wrapper.addEventListener("click",function(D){I.toggleCheckbox(D)})),this._elements.wrapper}},{key:"save",value:function(){var I=this,D=this.items.map(function(p){return{text:u(I.getItemInput(p)),checked:p.classList.contains(I.CSS.itemChecked)}});return{items:D=D.filter(function(p){return p.text.trim().length!==0})}}},{key:"validate",value:function(I){return!!I.items.length}},{key:"toggleCheckbox",value:function(I){var D=I.target.closest(".".concat(this.CSS.item));D.querySelector(".".concat(this.CSS.checkbox)).contains(I.target)&&D.classList.toggle(this.CSS.itemChecked)}},{key:"createChecklistItem",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},D=l("div",this.CSS.item),p=l("span",this.CSS.checkbox),N=l("div",this.CSS.textField,{innerHTML:I.text?I.text:"",contentEditable:!this.readOnly});return I.checked&&D.classList.add(this.CSS.itemChecked),D.appendChild(p),D.appendChild(N),D}},{key:"enterPressed",value:function(I){I.preventDefault();var D=this.items,p=document.activeElement.closest(".".concat(this.CSS.item));if(D.indexOf(p)===D.length-1&&u(this.getItemInput(p)).length===0){var N=this.api.blocks.getCurrentBlockIndex();return p.remove(),this.api.blocks.insert(),void this.api.caret.setToBlock(N+1)}var v,m,j=s(),T=(v=j,(m=document.createElement("div")).appendChild(v),m.innerHTML),w=this.createChecklistItem({text:T,checked:!1});this._elements.wrapper.insertBefore(w,p.nextSibling),d(this.getItemInput(w),!0)}},{key:"backspace",value:function(I){var D=I.target.closest(".".concat(this.CSS.item)),p=this.items.indexOf(D),N=this.items[p-1];if(N&&window.getSelection().focusOffset===0){I.preventDefault();var v=s(),m=this.getItemInput(N),j=m.childNodes.length;m.appendChild(v),d(m,void 0,j),D.remove()}}},{key:"getItemInput",value:function(I){return I.querySelector(".".concat(this.CSS.textField))}},{key:"CSS",get:function(){return{baseBlock:this.api.styles.block,wrapper:"cdx-checklist",item:"cdx-checklist__item",itemChecked:"cdx-checklist__item--checked",checkbox:"cdx-checklist__item-checkbox",textField:"cdx-checklist__item-text"}}},{key:"items",get:function(){return Array.from(this._elements.wrapper.querySelectorAll(".".concat(this.CSS.item)))}}]),y}()}]).default})})(Gg);var V2=Wt(Gg.exports);class Fg{static get isReadOnlySupported(){return!0}static get toolbox(){return{title:"Image",icon:'<svg width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.34 3H2.66C2.48496 3 2.31708 3.06954 2.19331 3.19331C2.06954 3.31708 2 3.48496 2 3.66V11.58C2 11.755 2.06954 11.9229 2.19331 12.0467C2.31708 12.1705 2.48496 12.24 2.66 12.24H12.34C12.515 12.24 12.6829 12.1705 12.8067 12.0467C12.9305 11.9229 13 11.755 13 11.58V3.66C13 3.48496 12.9305 3.31708 12.8067 3.19331C12.6829 3.06954 12.515 3 12.34 3ZM2.66 3.44H12.34C12.3983 3.44 12.4543 3.46318 12.4956 3.50444C12.5368 3.54569 12.56 3.60165 12.56 3.66V9.842L10.751 8.03305C10.6897 7.97152 10.6169 7.9227 10.5367 7.88939C10.4564 7.85608 10.3704 7.83893 10.2836 7.83893C10.1967 7.83893 10.1107 7.85608 10.0304 7.88939C9.95023 7.9227 9.87737 7.97152 9.81605 8.03305L8.5604 9.2887L5.9853 6.71305C5.92398 6.65152 5.85112 6.6027 5.7709 6.56939C5.69068 6.53608 5.60467 6.51893 5.5178 6.51893C5.43093 6.51893 5.34492 6.53608 5.2647 6.56939C5.18448 6.6027 5.11162 6.65152 5.0503 6.71305L2.44 9.325V3.66C2.44 3.60165 2.46318 3.54569 2.50444 3.50444C2.54569 3.46318 2.60165 3.44 2.66 3.44ZM2.44 11.58V9.9487L5.36435 7.02435C5.38478 7.00389 5.40905 6.98767 5.43575 6.9766C5.46246 6.96553 5.49109 6.95983 5.52 6.95983C5.54891 6.95983 5.57754 6.96553 5.60425 6.9766C5.63095 6.98767 5.65522 7.00389 5.67565 7.02435L10.4513 11.8H2.66C2.60165 11.8 2.54569 11.7768 2.50444 11.7356C2.46318 11.6943 2.44 11.6383 2.44 11.58ZM12.34 11.8H11.075L8.875 9.6L10.1307 8.34435C10.1511 8.3239 10.1753 8.30767 10.2021 8.2966C10.2288 8.28553 10.2574 8.27983 10.2863 8.27983C10.3152 8.27983 10.3438 8.28553 10.3705 8.2966C10.3973 8.30767 10.4215 8.3239 10.4419 8.34435L12.56 10.4641V11.58C12.56 11.6383 12.5368 11.6943 12.4956 11.7356C12.4543 11.7768 12.3983 11.8 12.34 11.8Z" fill="black"/></svg>'}}constructor({data:n,config:e,api:i}){this.data={imageLink:n.imageLink||"",fileId:n.fileId!==void 0?n.fileId:0,width:n.width!==void 0?n.width:"WidthFull",position:n.position!==void 0?n.position:"AlignCenter"},this.api=i,this.config=e||{},this.container=null,this.fileInput=null,this.img=null,this.label=null,this.icon=null,this.browse=null,this.uploading=!1,this.settings=[{name:"WidthSmall",icon:'<svg id="WidthSmall" width="11" height="11" viewBox="0 0 11 11" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M7.19786 7.66578C7.19786 7.46123 7.16578 7.28075 7.1016 7.12433C7.04144 6.9639 6.93316 6.81952 6.77674 6.69118C6.62433 6.56283 6.41176 6.44051 6.13904 6.3242C5.87032 6.20789 5.52941 6.08957 5.11631 5.96925C4.68315 5.84091 4.29211 5.69853 3.94318 5.54211C3.59425 5.38168 3.29545 5.1992 3.04679 4.99465C2.79813 4.79011 2.60762 4.55548 2.47527 4.29078C2.34291 4.02607 2.27674 3.72326 2.27674 3.38235C2.27674 3.04144 2.34693 2.7266 2.4873 2.43783C2.62767 2.14906 2.82821 1.8984 3.0889 1.68583C3.35361 1.46925 3.66845 1.3008 4.03342 1.18048C4.3984 1.06016 4.80548 1 5.25468 1C5.91243 1 6.46992 1.12634 6.92714 1.37901C7.38837 1.62767 7.73931 1.95455 7.97995 2.35963C8.22059 2.7607 8.34091 3.18984 8.34091 3.64706H7.18583C7.18583 3.31818 7.11564 3.02741 6.97527 2.77473C6.83489 2.51805 6.62233 2.31751 6.33757 2.17313C6.05281 2.02473 5.69185 1.95053 5.25468 1.95053C4.84158 1.95053 4.50067 2.0127 4.23195 2.13703C3.96324 2.26136 3.7627 2.42981 3.63035 2.64238C3.50201 2.85495 3.43783 3.09759 3.43783 3.37032C3.43783 3.55481 3.47594 3.72326 3.55214 3.87567C3.63235 4.02406 3.75468 4.16243 3.91912 4.29078C4.08757 4.41912 4.30013 4.53743 4.55682 4.64572C4.81751 4.75401 5.12834 4.85829 5.4893 4.95856C5.98663 5.09893 6.41578 5.25535 6.77674 5.42781C7.1377 5.60027 7.43449 5.79479 7.66711 6.01136C7.90374 6.22393 8.07821 6.46658 8.19051 6.73931C8.30682 7.00802 8.36497 7.31283 8.36497 7.65374C8.36497 8.0107 8.29278 8.33356 8.1484 8.62233C8.00401 8.9111 7.79746 9.15775 7.52874 9.3623C7.26003 9.56685 6.93717 9.72527 6.56016 9.83757C6.18717 9.94586 5.77005 10 5.30882 10C4.90374 10 4.50468 9.94385 4.11163 9.83155C3.72259 9.71925 3.36765 9.5508 3.04679 9.3262C2.72995 9.1016 2.47527 8.82487 2.28275 8.49599C2.09425 8.1631 2 7.77808 2 7.34091H3.15508C3.15508 7.64171 3.21324 7.9004 3.32955 8.11698C3.44586 8.32955 3.60428 8.50602 3.80481 8.64639C4.00936 8.78677 4.23997 8.89104 4.49666 8.95922C4.75735 9.0234 5.02807 9.05548 5.30882 9.05548C5.7139 9.05548 6.05682 8.99933 6.33757 8.88703C6.61832 8.77473 6.83088 8.61431 6.97527 8.40575C7.12366 8.19719 7.19786 7.95053 7.19786 7.66578Z" fill="currentColor"/></svg>'},{name:"WidthMedium",icon:'<svg id="WidthMedium" width="11" height="11" viewBox="0 0 11 11" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1.37888 1H2.54037L5.50311 8.37267L8.45963 1H9.62733L5.95031 10.0435H5.04348L1.37888 1ZM1 1H2.02484L2.19255 6.51553V10.0435H1V1ZM8.97515 1H10V10.0435H8.80745V6.51553L8.97515 1Z" fill="currentColor"/></svg>'},{name:"WidthFull",icon:'<svg id="WidthFull" width="17" height="7" viewBox="0 0 17 7" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M13.375 1L16 3.625L13.375 6.25M15.5212 3.6243L1.74906 3.625M3.625 6.25L1 3.625L3.625 1" stroke="currentColor" stroke-width="1.19727" stroke-linecap="round" stroke-linejoin="round"/></svg>'},{name:"AlignStart",icon:'<svg id="AlignStart" width="15" height="12" viewBox="0 0 15 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M0.5 1C0.5 0.723858 0.723858 0.5 1 0.5H13.8C14.0761 0.5 14.3 0.723858 14.3 1C14.3 1.27614 14.0761 1.5 13.8 1.5H1C0.723858 1.5 0.5 1.27614 0.5 1Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M0.5 11C0.5 10.7239 0.723858 10.5 1 10.5H13.8C14.0761 10.5 14.3 10.7239 14.3 11C14.3 11.2761 14.0761 11.5 13.8 11.5H1C0.723858 11.5 0.5 11.2761 0.5 11Z" fill="currentColor"/><path d="M6.6 3.59998H1.8C1.35817 3.59998 1 3.95815 1 4.39998V7.59998C1 8.0418 1.35817 8.39998 1.8 8.39998H6.6C7.04183 8.39998 7.4 8.0418 7.4 7.59998V4.39998C7.4 3.95815 7.04183 3.59998 6.6 3.59998Z" fill="currentColor"/></svg>'},{name:"AlignCenter",icon:'<svg id="AlignCenter" width="15" height="11" viewBox="0 0 15 11" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M0.800049 0.5C0.800049 0.223858 1.02391 0 1.30005 0H14.1C14.3762 0 14.6 0.223858 14.6 0.5C14.6 0.776142 14.3762 1 14.1 1H1.30005C1.02391 1 0.800049 0.776142 0.800049 0.5Z" fill="black"/><path fill-rule="evenodd" clip-rule="evenodd" d="M0.800049 10.5C0.800049 10.2239 1.02391 10 1.30005 10H14.1C14.3762 10 14.6 10.2239 14.6 10.5C14.6 10.7761 14.3762 11 14.1 11H1.30005C1.02391 11 0.800049 10.7761 0.800049 10.5Z" fill="currentColor"/><path d="M10.1 3.09998H5.3C4.85817 3.09998 4.5 3.45815 4.5 3.89998V7.09998C4.5 7.5418 4.85817 7.89998 5.3 7.89998H10.1C10.5418 7.89998 10.9 7.5418 10.9 7.09998V3.89998C10.9 3.45815 10.5418 3.09998 10.1 3.09998Z" fill="currentColor"/></svg>'},{name:"AlignEnd",icon:'<svg id="AlignEnd" width="15" height="12" viewBox="0 0 15 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M0.5 1C0.5 0.723858 0.723858 0.5 1 0.5H13.8C14.0761 0.5 14.3 0.723858 14.3 1C14.3 1.27614 14.0761 1.5 13.8 1.5H1C0.723858 1.5 0.5 1.27614 0.5 1Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M0.5 11C0.5 10.7239 0.723858 10.5 1 10.5H13.8C14.0761 10.5 14.3 10.7239 14.3 11C14.3 11.2761 14.0761 11.5 13.8 11.5H1C0.723858 11.5 0.5 11.2761 0.5 11Z" fill="currentColor"/><path d="M13 3.59998H8.20002C7.7582 3.59998 7.40002 3.95815 7.40002 4.39998V7.59998C7.40002 8.0418 7.7582 8.39998 8.20002 8.39998H13C13.4419 8.39998 13.8 8.0418 13.8 7.59998V4.39998C13.8 3.95815 13.4419 3.59998 13 3.59998Z" fill="currentColor"/></svg>'}]}render(){this.container=document.createElement("div"),this.container.classList.add("picture__upload"),this.wrapper=document.createElement("div"),this.wrapper.classList.add("picture__upload_btn"),this.fileInput=document.createElement("input");const n=`upload_image_${Date.now()}`;return this.fileInput.id=n,this.fileInput.type="file",this.fileInput.name="image",this.fileInput.accept="image/*",this.icon=document.createElement("IMG"),this.icon.classList.add("picture__upload_btn_icon"),this.icon.src=Ol,this.icon.onerror=function(){throw new Error("Error loading image")},this.icon.height="24",this.label=document.createElement("label"),this.label.setAttribute("for",n),this.label.textContent="Drag & drop image file or ",this.browse=document.createElement("span"),this.browse.textContent="browse",this.browse.id="upload",this.label.appendChild(this.browse),this.wrapper.prepend(this.icon),this.wrapper.appendChild(this.label),this.wrapper.appendChild(this.fileInput),this.img=document.createElement("IMG"),this.img.classList.add("picture__upload_img"),this.container.appendChild(this.wrapper),this.container.appendChild(this.img),this.data&&this.data.imageLink&&(this.img.src=this.data.imageLink,this.img.style.display="block",this.wrapper.style.display="none"),this.data&&this.data.width&&this.data.position&&this.data.imageLink&&this._acceptTuneView(),this.api.readOnly.isEnabled&&this._acceptTuneView(),this.wrapper.addEventListener("dragover",e=>{e.preventDefault(),e.dataTransfer.dropEffect="copy"}),this.wrapper.addEventListener("drop",e=>{e.preventDefault();const i=e.dataTransfer.files[0];this.handleFile(i)}),this.fileInput.addEventListener("input",e=>{e.preventDefault();const i=e.target.files[0];this.handleFile(i)}),this.container}handleFile(n){if(n.type.match("image.*")){this.wrapper.style.display="none";const e=URL.createObjectURL(n);this.img.src=e,this.img.style.display="block",this.uploading=!0,this.uploadFile(n)}else alert("Invalid file type. Please select an image file.")}save(n){return n.querySelector("img.picture__upload_img")?Object.assign(this.data,{imageLink:this.data.imageLink,fileId:this.data.fileId,width:this.data.width||"Full",position:this.data.position||"AlignStart"}):this.data}uploadFile(n){const e=new CustomEvent("uploadImage",{detail:{image:n}});document.dispatchEvent(e)}renderSettings(){const n=document.createElement("div");return this.settings.forEach(e=>{let i=document.createElement("div");i.classList.add("cdx-settings-button"),i.classList.toggle("cdx-settings-button--active",this.data.position==e.name||this.data.width==e.name),i.innerHTML=e.icon,n.appendChild(i),i.addEventListener("click",()=>{this._toggleTune(e.name),document.querySelectorAll(".cdx-settings-button--active").forEach(o=>{o.firstChild.id!==this.data.width&&o.firstChild.id!==this.data.position&&o.classList.remove("cdx-settings-button--active")}),i.classList.toggle("cdx-settings-button--active")})}),n}_toggleTune(n){(n=="WidthSmall"||n=="WidthMedium"||n=="WidthFull")&&(this.data.width=n),(n=="AlignStart"||n=="AlignCenter"||n=="AlignEnd")&&(this.data.position=n),this._acceptTuneView()}_acceptTuneView(){this.settings.forEach(n=>{this.container.classList.toggle(n.name,this.data.width==n.name||this.data.position==n.name)})}}class W2{static get isReadOnlySupported(){return!0}static get toolbox(){return{title:"Attachment",icon:'<svg width="15" height="16" viewBox="0 0 15 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M9.34181 3.175C8.86733 3.175 8.41228 3.36348 8.07677 3.69899L3.96053 7.81523C3.45247 8.33711 3.17027 9.03805 3.17501 9.76641C3.17975 10.4951 3.47134 11.1927 3.98665 11.708C4.50195 12.2233 5.19949 12.5149 5.92823 12.5196C6.6566 12.5244 7.35753 12.2422 7.87942 11.7341C7.87968 11.7338 7.87994 11.7336 7.88021 11.7333L11.8762 7.7373L12.1237 7.98479L8.12446 11.984C7.53657 12.5568 6.74672 12.875 5.92595 12.8696C5.10518 12.8643 4.31955 12.5359 3.73916 11.9555C3.15878 11.3751 2.83036 10.5895 2.82502 9.76869C2.81968 8.94792 3.13784 8.15807 3.71063 7.57019L3.71222 7.56855L7.82928 3.45151C8.23043 3.05036 8.77451 2.825 9.34181 2.825C9.90912 2.825 10.4532 3.05036 10.8543 3.45151C11.2555 3.85266 11.4809 4.39673 11.4809 4.96404C11.4809 5.53135 11.2555 6.07542 10.8543 6.47657L6.85603 10.4749C6.63904 10.6919 6.34475 10.8138 6.03789 10.8138C5.73103 10.8138 5.43674 10.6919 5.21975 10.4749C5.00277 10.2579 4.88087 9.96361 4.88087 9.65675C4.88087 9.34989 5.00277 9.05559 5.21975 8.83861L9.09863 4.95973L9.34612 5.20722L5.46724 9.0861C5.3159 9.23744 5.23087 9.44271 5.23087 9.65675C5.23087 9.87078 5.3159 10.0761 5.46724 10.2274C5.61859 10.3787 5.82386 10.4638 6.03789 10.4638C6.25193 10.4638 6.45719 10.3787 6.60854 10.2274L10.6069 6.22908C10.9424 5.89357 11.1309 5.43852 11.1309 4.96404C11.1309 4.48955 10.9424 4.03451 10.6069 3.69899C10.2713 3.36348 9.8163 3.175 9.34181 3.175Z" fill="black"/></svg>'}}constructor({data:n,config:e,api:i}){this.data={fileLinks:n.fileLinks||[],fileIds:n.fileIds||[],fileNames:n.fileNames||[]},this.api=i,this.config=e||{},this.wrapper=null,this.fileInput=null,this.resultContainer=null,this.uploading=!1,this.config.standardFormats=[".pdf",".csv",".doc",".jpeg",".jpg",".mp4",".png",".txt",".xls"]}render(){this.container=document.createElement("div"),this.container.classList.add("picture__upload"),this.wrapper=document.createElement("div"),this.wrapper.classList.add("picture__upload_btn"),this.fileInput=document.createElement("input");const n=`upload_file_${Date.now()}`;return this.fileInput.id=n,this.fileInput.type="file",this.fileInput.name="file",this.fileInput.multiple=!0,this.icon=document.createElement("IMG"),this.icon.classList.add("picture__upload_btn_icon"),this.icon.src=Ol,this.icon.onerror=function(){throw new Error("Error loading image")},this.icon.height="24",this.label=document.createElement("label"),this.label.setAttribute("for",n),this.label.textContent="Drag & drop file(s) or ",this.browse=document.createElement("span"),this.browse.textContent="browse",this.browse.id="upload",this.label.appendChild(this.browse),this.wrapper.prepend(this.icon),this.wrapper.appendChild(this.label),this.wrapper.appendChild(this.fileInput),this.resultContainer=document.createElement("div"),this.resultContainer.classList.add("file__results"),this.resultContainer.style.gap="7px",this.data.fileIds.length||(this.resultContainer.style.display="none"),this.container.appendChild(this.wrapper),this.container.appendChild(this.resultContainer),this.populateExistingFiles(),this.data&&this.data.fileIds.length&&(this.wrapper.style.display="none",this.resultContainer.style.display="flex"),this.wrapper.addEventListener("dragover",e=>{e.preventDefault(),e.dataTransfer.dropEffect="copy"}),this.wrapper.addEventListener("drop",e=>{e.preventDefault();const i=Array.from(e.dataTransfer.files);this.handleFiles(i)}),this.fileInput.addEventListener("input",e=>{e.stopPropagation();const i=Array.from(this.fileInput.files);this.handleFiles(i)}),this.container}populateExistingFiles(){for(let n=0;n<this.data.fileLinks.length;n++){const e=this.data.fileLinks[n],i=this.data.fileIds[n],t=this.data.fileNames[n],o=this.createResultElement(e,i,t);this.resultContainer.appendChild(o)}}createResultElement(n,e,i){const t=document.createElement("div");t.classList.add("file__result");const o=document.createElement("IMG");o.classList.add("file__result_icon"),this.iconName(i)=="pdf"?o.src=jM:this.iconName(i)=="jpg"?o.src=yM:this.iconName(i)=="jpeg"?o.src=pM:this.iconName(i)=="png"?o.src=IM:this.iconName(i)=="doc"?o.src=hM:this.iconName(i)=="csv"?o.src=gM:this.iconName(i)=="xls"?o.src=xM:this.iconName(i)=="txt"?o.src=mM:this.iconName(i)=="mp4"?o.src=NM:o.src=DM;const a=document.createElement("a");return a.classList.add("file__result_name"),a.href=n,a.innerHTML=i,a.target="_blank",console.log(e),t.appendChild(o),t.appendChild(a),t}handleFiles(n){if(n.length>0){this.wrapper.style.display="none",this.resultContainer.style.display="flex";for(const e of n){const i=URL.createObjectURL(e),t=this.generateFileId(),o=this.createResultElement(i,t);this.resultContainer.appendChild(o),this.uploadFile(e,t)}this.uploading=!0}else alert("Invalid file type. Please select a valid file.")}generateFileId(){return Math.floor(Math.random()*1e6)}save(n){const e=n.querySelectorAll(".file__result");if(e.length===0)return this.data;const i=[],t=[],o=[];for(const a of e){const s=a.querySelector(".file__result_name");i.push(s.href),t.push(s.innerHTML),o.push(s.innerHTML)}return Object.assign(this.data,{fileLinks:i,fileIds:t,fileNames:o})}uploadFile(n,e){const i=new CustomEvent("uploadFile",{detail:{file:n,fileId:e}});document.dispatchEvent(i)}iconName(n){const e=this.getExtension(n).toLowerCase();return this.config.standardFormats.includes(`.${e}`)?e:"unknown"}getExtension(n){return n.slice((n.lastIndexOf(".")-1>>>0)+2)}}var EL="";const H2={key:0,class:"editor__count"},G2=c.createTextVNode(" /300 "),F2={class:"editor__body"},$2={key:0,class:"editor__first"},J2={class:"editor__first_text"},X2={class:"editor__first_link",href:"https://deskhero.com",target:"_blank"},K2=["id"],q2={__name:"TextEditor",props:{data:{type:Object,default:()=>({blocks:[]}),required:!1},readOnly:{type:Boolean,default:!0,required:!1},featureSet:{type:String,default:"Default",required:!1},firstBlock:{type:Boolean,default:!0,required:!1},firstBlockText:{type:String,default:"add your first block",required:!1},learnMoreText:{type:String,default:"Learn more about the text editor",required:!1},placeholder:{type:String,default:"Start typing...",required:!1},holder:{type:String,required:!0},wordCount:{type:Boolean,default:!1,required:!1},minHeight:{type:Number,default:50,required:!1},toolbarPosition:{type:String,default:"left",required:!1}},emits:["change"],setup(r,{expose:n,emit:e}){const i=r,t=c.ref(!1),o=c.ref(0),a=c.ref(!1),s=c.ref({}),l=c.ref({holder:i.holder,autofocus:!0,minHeight:0,defaultBlock:"paragraph",readOnly:i.readOnly,logLevel:"ERROR",onReady:()=>{t.value=!0},onChange:async(D,p)=>{if(p.type!=="block-changed"||!i.wordCount){const x=await D.saver.save();e("change",x.blocks);return}function N(x){return"text"in x.data}function v(x){return x.filter(N).reduce((k,z)=>(k+=z.data.text.length,k),0)}const m=300,j=await D.saver.save(),T=v(j.blocks);if(o.value=T,T<=m)return;const w=p.detail.target,A=p.detail.index,L=j.blocks.filter(x=>x.id===w.id).pop(),C=j.blocks.filter(x=>x.id!==w.id),b=v(C),h=m-b;D.blocks.update(w.id,{text:L.data.text.substr(0,h)}),D.caret.setToBlock(A,"end")}}),u=c.computed(()=>o.value>300);n({toggleReadOnly:d,save:M,reset:f,editBlock:g});function d(){s.value.configuration.data.blocks.length?(console.log(s.value.configuration.data.blocks),s.value.readOnly.toggle()):alert("You must at least have one block to toggle preview")}function M(){return s.value.save()}function f(){s.value.destroy()}function g(D){console.log(D),console.log(s.value)}function y(){i.featureSet=="Full"?s.value=new Tu({...l.value,data:i.data,minHeight:i.minHeight,tools:{paragraph:{class:Au,config:{placeholder:i.placeholder}},header:{class:bu},list:{class:Zg},underline:{class:Yg,shortcut:"CMD+SHIFT+U"},marker:{class:_g,shortcut:"CMD+SHIFT+H"},image:{class:Fg},file:{class:W2},inlineCode:{class:B2},checklist:{class:V2},table:{class:P2},delimiter:{class:Z2},code:{class:R2}}}):i.featureSet=="Default"?s.value=new Tu({...l.value,data:i.data,minHeight:i.minHeight,tools:{paragraph:{class:Au,config:{placeholder:i.placeholder}},header:{class:bu},list:{class:Zg},underline:{class:Yg,shortcut:"CMD+SHIFT+U"},marker:{class:_g,shortcut:"CMD+SHIFT+H"},image:{class:Fg,config:{uploadEndpoint:i.uploadEndPoint}}}}):s.value=new Tu({...l.value,data:i.data,minHeight:i.minHeight,tools:{paragraph:{class:Au,config:{placeholder:i.placeholder}},header:{class:bu}}})}function I(){y(),a.value=!1}return c.onMounted(()=>{i.firstBlock?y():a.value=!0}),(D,p)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["editor__wrapper",!r.readOnly&&r.toolbarPosition=="right"?"editor__wrapper--right":r.readOnly?"":"editor__wrapper--left"])},[r.wordCount?(c.openBlock(),c.createElementBlock("div",H2,[c.createElementVNode("span",{class:c.normalizeClass(c.unref(u)?"editor__count--danger":"")},c.toDisplayString(o.value),3),G2])):c.createCommentVNode("",!0),c.createElementVNode("div",F2,[a.value?(c.openBlock(),c.createElementBlock("div",$2,[c.createElementVNode("button",{class:"editor__first_btn",onClick:I},"+"),c.createElementVNode("p",J2,c.toDisplayString(r.firstBlockText),1),c.createElementVNode("a",X2,c.toDisplayString(r.learnMoreText),1)])):c.createCommentVNode("",!0),c.createElementVNode("div",{id:r.holder},null,8,K2)])],2))}};var _L="";const ez={class:"code"},tz=["autocomplete"],nz=["autocomplete"],rz=["autocomplete"],iz=["autocomplete"],oz=["autocomplete"],az=["autocomplete"];var sz=at(c.defineComponent({__name:"VerificationCode",props:{code:{type:String,required:!1,default:""},focusOnFirstInput:{type:Boolean,default:!0},focusOnFirstInputDelay:{type:Number,default:100},autoComplete:{type:String,default:"off"}},emits:["submit"],setup(r,{emit:n}){const e=r,i=c.ref(null),t=c.ref(null),o=c.ref(null),a=c.ref(null),s=c.ref(null),l=c.ref(null);async function u(D){var p,N,v,m,j;switch(D){case 1:break;case 2:(p=i.value)==null||p.focus();break;case 3:(N=t.value)==null||N.focus();break;case 4:(v=o.value)==null||v.focus();break;case 5:(m=a.value)==null||m.focus();break;case 6:(j=s.value)==null||j.focus();break}}async function d(D){var p,N,v,m,j;switch(D){case 1:(p=t.value)==null||p.focus();break;case 2:(N=o.value)==null||N.focus();break;case 3:(v=a.value)==null||v.focus();break;case 4:(m=s.value)==null||m.focus();break;case 5:(j=l.value)==null||j.focus();break}}async function M(D,p){const N=D.key;let v=!0;[{_index:1,nextInput:t},{_index:2,nextInput:o},{_index:3,nextInput:a},{_index:4,nextInput:s},{_index:5,nextInput:l}].forEach(({_index:m,nextInput:j})=>{p===m&&(j.value&&N.match(/^[0-9]+$/)&&j.value.focus({}),v=!1),D.preventDefault()}),N.match(/^[0-9]+$/)&&(D.target.value=N),v&&y()}async function f(D){var N;const p=((N=D.clipboardData)==null?void 0:N.getData("text/plain"))||"";g(p),y()}function g(D){const p=D.replace(/\D/g,"");if(p.length!==6)return;const[N,v,m,j,T,w]=p.split("");i.value&&(i.value.value=N),t.value&&(t.value.value=v),o.value&&(o.value.value=m),a.value&&(a.value.value=j),s.value&&(s.value.value=T),l.value&&(l.value.value=w)}async function y(){var p,N,v,m,j,T;const D=`${(p=i.value)==null?void 0:p.value}${(N=t.value)==null?void 0:N.value}${(v=o.value)==null?void 0:v.value}${(m=a.value)==null?void 0:m.value}${(j=s.value)==null?void 0:j.value}${(T=l.value)==null?void 0:T.value}`;n("submit",D)}function I(){setTimeout(()=>{var D;e.focusOnFirstInput&&((D=i.value)==null||D.focus())},e.focusOnFirstInputDelay)}return c.onMounted(()=>{e.code&&(g(e.code),y()),I()}),(D,p)=>(c.openBlock(),c.createElementBlock("div",ez,[c.createElementVNode("input",{ref_key:"txtInput1",ref:i,autocomplete:r.autoComplete,autofocus:"",class:"form-input input-1","data-e2e":"input-1",inputmode:"numeric",maxlength:"1",placeholder:"_",type:"text",onKeypress:p[0]||(p[0]=N=>M(N,1)),onKeyup:[p[1]||(p[1]=c.withKeys(N=>u(1),["delete"])),p[2]||(p[2]=c.withKeys(N=>u(1),["left"])),p[3]||(p[3]=c.withKeys(N=>d(1),["right"]))],onPaste:f},null,40,tz),c.createElementVNode("input",{ref_key:"txtInput2",ref:t,autocomplete:r.autoComplete,class:"form-input","data-e2e":"input-2",inputmode:"numeric",maxlength:"1",placeholder:"_",type:"text",onKeypress:p[4]||(p[4]=N=>M(N,2)),onKeyup:[p[5]||(p[5]=c.withKeys(N=>u(2),["delete"])),p[6]||(p[6]=c.withKeys(N=>u(2),["left"])),p[7]||(p[7]=c.withKeys(N=>d(2),["right"]))],onPaste:f},null,40,nz),c.createElementVNode("input",{ref_key:"txtInput3",ref:o,autocomplete:r.autoComplete,class:"form-input","data-e2e":"input-3",inputmode:"numeric",maxlength:"1",placeholder:"_",type:"text",onKeypress:p[8]||(p[8]=N=>M(N,3)),onKeyup:[p[9]||(p[9]=c.withKeys(N=>u(3),["delete"])),p[10]||(p[10]=c.withKeys(N=>u(3),["left"])),p[11]||(p[11]=c.withKeys(N=>d(3),["right"]))],onPaste:f},null,40,rz),c.createElementVNode("input",{ref_key:"txtInput4",ref:a,autocomplete:r.autoComplete,class:"form-input","data-e2e":"input-4",inputmode:"numeric",maxlength:"1",placeholder:"_",type:"text",onKeypress:p[12]||(p[12]=N=>M(N,4)),onKeyup:[p[13]||(p[13]=c.withKeys(N=>u(4),["delete"])),p[14]||(p[14]=c.withKeys(N=>u(4),["left"])),p[15]||(p[15]=c.withKeys(N=>d(4),["right"]))],onPaste:f},null,40,iz),c.createElementVNode("input",{ref_key:"txtInput5",ref:s,autocomplete:r.autoComplete,class:"form-input","data-e2e":"input-5",inputmode:"numeric",maxlength:"1",placeholder:"_",type:"text",onKeypress:p[16]||(p[16]=N=>M(N,5)),onKeyup:[p[17]||(p[17]=c.withKeys(N=>u(5),["delete"])),p[18]||(p[18]=c.withKeys(N=>u(5),["left"])),p[19]||(p[19]=c.withKeys(N=>d(5),["right"]))],onPaste:f},null,40,oz),c.createElementVNode("input",{ref_key:"txtInput6",ref:l,autocomplete:r.autoComplete,class:"form-input","data-e2e":"input-6",inputmode:"numeric",maxlength:"1",placeholder:"_",type:"text",onKeypress:p[20]||(p[20]=N=>M(N,6)),onKeyup:[p[21]||(p[21]=c.withKeys(N=>u(6),["delete"])),p[22]||(p[22]=c.withKeys(N=>u(6),["left"])),p[23]||(p[23]=c.withKeys(N=>d(6),["right"]))],onPaste:f},null,40,az)]))}}),[["__scopeId","data-v-2ace876a"]]),YL="";/*!
|
|
377
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function a(y,I){(I==null||I>y.length)&&(I=y.length);for(var D=0,p=new Array(I);D<I;D++)p[D]=y[D];return p}function s(){var y=document.activeElement,I=window.getSelection().getRangeAt(0),D=I.cloneRange();return D.selectNodeContents(y),D.setStart(I.endContainer,I.endOffset),D.extractContents()}function l(y){var I,D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},N=document.createElement(y);Array.isArray(D)?(I=N.classList).add.apply(I,o(D)):D&&N.classList.add(D);for(var v in p)N[v]=p[v];return N}function u(y){return y.innerHTML.replace("<br>"," ").trim()}function d(y){var I=arguments.length>1&&arguments[1]!==void 0&&arguments[1],D=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,p=document.createRange(),N=window.getSelection();p.selectNodeContents(y),D!==void 0&&(p.setStart(y,D),p.setEnd(y,D)),p.collapse(I),N.removeAllRanges(),N.addRange(p)}t(5);function M(y,I){for(var D=0;D<I.length;D++){var p=I[D];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(y,p.key,p)}}function f(y,I,D){return I&&M(y.prototype,I),D&&M(y,D),y}var g=function(){function y(I){var D=I.data,p=(I.config,I.api),N=I.readOnly;(function(v,m){if(!(v instanceof m))throw new TypeError("Cannot call a class as a function")})(this,y),this._elements={wrapper:null,items:[]},this.readOnly=N,this.api=p,this.data=D||{}}return f(y,null,[{key:"isReadOnlySupported",get:function(){return!0}},{key:"enableLineBreaks",get:function(){return!0}},{key:"toolbox",get:function(){return{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M9.2 12L11.0586 13.8586C11.1367 13.9367 11.2633 13.9367 11.3414 13.8586L14.7 10.5"/><rect width="14" height="14" x="5" y="5" stroke="currentColor" stroke-width="2" rx="4"/></svg>',title:"Checklist"}}},{key:"conversionConfig",get:function(){return{export:function(I){return I.items.map(function(D){return D.text}).join(". ")},import:function(I){return{items:[{text:I,checked:!1}]}}}}}]),f(y,[{key:"render",value:function(){var I=this;return this._elements.wrapper=l("div",[this.CSS.baseBlock,this.CSS.wrapper]),this.data.items||(this.data.items=[{text:"",checked:!1}]),this.data.items.forEach(function(D){var p=I.createChecklistItem(D);I._elements.wrapper.appendChild(p)}),this.readOnly||(this._elements.wrapper.addEventListener("keydown",function(D){switch(D.keyCode){case 13:I.enterPressed(D);break;case 8:I.backspace(D)}},!1),this._elements.wrapper.addEventListener("click",function(D){I.toggleCheckbox(D)})),this._elements.wrapper}},{key:"save",value:function(){var I=this,D=this.items.map(function(p){return{text:u(I.getItemInput(p)),checked:p.classList.contains(I.CSS.itemChecked)}});return{items:D=D.filter(function(p){return p.text.trim().length!==0})}}},{key:"validate",value:function(I){return!!I.items.length}},{key:"toggleCheckbox",value:function(I){var D=I.target.closest(".".concat(this.CSS.item));D.querySelector(".".concat(this.CSS.checkbox)).contains(I.target)&&D.classList.toggle(this.CSS.itemChecked)}},{key:"createChecklistItem",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},D=l("div",this.CSS.item),p=l("span",this.CSS.checkbox),N=l("div",this.CSS.textField,{innerHTML:I.text?I.text:"",contentEditable:!this.readOnly});return I.checked&&D.classList.add(this.CSS.itemChecked),D.appendChild(p),D.appendChild(N),D}},{key:"enterPressed",value:function(I){I.preventDefault();var D=this.items,p=document.activeElement.closest(".".concat(this.CSS.item));if(D.indexOf(p)===D.length-1&&u(this.getItemInput(p)).length===0){var N=this.api.blocks.getCurrentBlockIndex();return p.remove(),this.api.blocks.insert(),void this.api.caret.setToBlock(N+1)}var v,m,j=s(),T=(v=j,(m=document.createElement("div")).appendChild(v),m.innerHTML),w=this.createChecklistItem({text:T,checked:!1});this._elements.wrapper.insertBefore(w,p.nextSibling),d(this.getItemInput(w),!0)}},{key:"backspace",value:function(I){var D=I.target.closest(".".concat(this.CSS.item)),p=this.items.indexOf(D),N=this.items[p-1];if(N&&window.getSelection().focusOffset===0){I.preventDefault();var v=s(),m=this.getItemInput(N),j=m.childNodes.length;m.appendChild(v),d(m,void 0,j),D.remove()}}},{key:"getItemInput",value:function(I){return I.querySelector(".".concat(this.CSS.textField))}},{key:"CSS",get:function(){return{baseBlock:this.api.styles.block,wrapper:"cdx-checklist",item:"cdx-checklist__item",itemChecked:"cdx-checklist__item--checked",checkbox:"cdx-checklist__item-checkbox",textField:"cdx-checklist__item-text"}}},{key:"items",get:function(){return Array.from(this._elements.wrapper.querySelectorAll(".".concat(this.CSS.item)))}}]),y}()}]).default})})(Gg);var V2=Wt(Gg.exports);class Fg{static get isReadOnlySupported(){return!0}static get toolbox(){return{title:"Image",icon:'<svg width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.34 3H2.66C2.48496 3 2.31708 3.06954 2.19331 3.19331C2.06954 3.31708 2 3.48496 2 3.66V11.58C2 11.755 2.06954 11.9229 2.19331 12.0467C2.31708 12.1705 2.48496 12.24 2.66 12.24H12.34C12.515 12.24 12.6829 12.1705 12.8067 12.0467C12.9305 11.9229 13 11.755 13 11.58V3.66C13 3.48496 12.9305 3.31708 12.8067 3.19331C12.6829 3.06954 12.515 3 12.34 3ZM2.66 3.44H12.34C12.3983 3.44 12.4543 3.46318 12.4956 3.50444C12.5368 3.54569 12.56 3.60165 12.56 3.66V9.842L10.751 8.03305C10.6897 7.97152 10.6169 7.9227 10.5367 7.88939C10.4564 7.85608 10.3704 7.83893 10.2836 7.83893C10.1967 7.83893 10.1107 7.85608 10.0304 7.88939C9.95023 7.9227 9.87737 7.97152 9.81605 8.03305L8.5604 9.2887L5.9853 6.71305C5.92398 6.65152 5.85112 6.6027 5.7709 6.56939C5.69068 6.53608 5.60467 6.51893 5.5178 6.51893C5.43093 6.51893 5.34492 6.53608 5.2647 6.56939C5.18448 6.6027 5.11162 6.65152 5.0503 6.71305L2.44 9.325V3.66C2.44 3.60165 2.46318 3.54569 2.50444 3.50444C2.54569 3.46318 2.60165 3.44 2.66 3.44ZM2.44 11.58V9.9487L5.36435 7.02435C5.38478 7.00389 5.40905 6.98767 5.43575 6.9766C5.46246 6.96553 5.49109 6.95983 5.52 6.95983C5.54891 6.95983 5.57754 6.96553 5.60425 6.9766C5.63095 6.98767 5.65522 7.00389 5.67565 7.02435L10.4513 11.8H2.66C2.60165 11.8 2.54569 11.7768 2.50444 11.7356C2.46318 11.6943 2.44 11.6383 2.44 11.58ZM12.34 11.8H11.075L8.875 9.6L10.1307 8.34435C10.1511 8.3239 10.1753 8.30767 10.2021 8.2966C10.2288 8.28553 10.2574 8.27983 10.2863 8.27983C10.3152 8.27983 10.3438 8.28553 10.3705 8.2966C10.3973 8.30767 10.4215 8.3239 10.4419 8.34435L12.56 10.4641V11.58C12.56 11.6383 12.5368 11.6943 12.4956 11.7356C12.4543 11.7768 12.3983 11.8 12.34 11.8Z" fill="black"/></svg>'}}constructor({data:n,config:e,api:i}){this.data={imageLink:n.imageLink||"",fileId:n.fileId!==void 0?n.fileId:0,width:n.width!==void 0?n.width:"WidthFull",position:n.position!==void 0?n.position:"AlignCenter"},this.api=i,this.config=e||{},this.container=null,this.fileInput=null,this.img=null,this.label=null,this.icon=null,this.browse=null,this.uploading=!1,this.settings=[{name:"WidthSmall",icon:'<svg id="WidthSmall" width="11" height="11" viewBox="0 0 11 11" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M7.19786 7.66578C7.19786 7.46123 7.16578 7.28075 7.1016 7.12433C7.04144 6.9639 6.93316 6.81952 6.77674 6.69118C6.62433 6.56283 6.41176 6.44051 6.13904 6.3242C5.87032 6.20789 5.52941 6.08957 5.11631 5.96925C4.68315 5.84091 4.29211 5.69853 3.94318 5.54211C3.59425 5.38168 3.29545 5.1992 3.04679 4.99465C2.79813 4.79011 2.60762 4.55548 2.47527 4.29078C2.34291 4.02607 2.27674 3.72326 2.27674 3.38235C2.27674 3.04144 2.34693 2.7266 2.4873 2.43783C2.62767 2.14906 2.82821 1.8984 3.0889 1.68583C3.35361 1.46925 3.66845 1.3008 4.03342 1.18048C4.3984 1.06016 4.80548 1 5.25468 1C5.91243 1 6.46992 1.12634 6.92714 1.37901C7.38837 1.62767 7.73931 1.95455 7.97995 2.35963C8.22059 2.7607 8.34091 3.18984 8.34091 3.64706H7.18583C7.18583 3.31818 7.11564 3.02741 6.97527 2.77473C6.83489 2.51805 6.62233 2.31751 6.33757 2.17313C6.05281 2.02473 5.69185 1.95053 5.25468 1.95053C4.84158 1.95053 4.50067 2.0127 4.23195 2.13703C3.96324 2.26136 3.7627 2.42981 3.63035 2.64238C3.50201 2.85495 3.43783 3.09759 3.43783 3.37032C3.43783 3.55481 3.47594 3.72326 3.55214 3.87567C3.63235 4.02406 3.75468 4.16243 3.91912 4.29078C4.08757 4.41912 4.30013 4.53743 4.55682 4.64572C4.81751 4.75401 5.12834 4.85829 5.4893 4.95856C5.98663 5.09893 6.41578 5.25535 6.77674 5.42781C7.1377 5.60027 7.43449 5.79479 7.66711 6.01136C7.90374 6.22393 8.07821 6.46658 8.19051 6.73931C8.30682 7.00802 8.36497 7.31283 8.36497 7.65374C8.36497 8.0107 8.29278 8.33356 8.1484 8.62233C8.00401 8.9111 7.79746 9.15775 7.52874 9.3623C7.26003 9.56685 6.93717 9.72527 6.56016 9.83757C6.18717 9.94586 5.77005 10 5.30882 10C4.90374 10 4.50468 9.94385 4.11163 9.83155C3.72259 9.71925 3.36765 9.5508 3.04679 9.3262C2.72995 9.1016 2.47527 8.82487 2.28275 8.49599C2.09425 8.1631 2 7.77808 2 7.34091H3.15508C3.15508 7.64171 3.21324 7.9004 3.32955 8.11698C3.44586 8.32955 3.60428 8.50602 3.80481 8.64639C4.00936 8.78677 4.23997 8.89104 4.49666 8.95922C4.75735 9.0234 5.02807 9.05548 5.30882 9.05548C5.7139 9.05548 6.05682 8.99933 6.33757 8.88703C6.61832 8.77473 6.83088 8.61431 6.97527 8.40575C7.12366 8.19719 7.19786 7.95053 7.19786 7.66578Z" fill="currentColor"/></svg>'},{name:"WidthMedium",icon:'<svg id="WidthMedium" width="11" height="11" viewBox="0 0 11 11" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1.37888 1H2.54037L5.50311 8.37267L8.45963 1H9.62733L5.95031 10.0435H5.04348L1.37888 1ZM1 1H2.02484L2.19255 6.51553V10.0435H1V1ZM8.97515 1H10V10.0435H8.80745V6.51553L8.97515 1Z" fill="currentColor"/></svg>'},{name:"WidthFull",icon:'<svg id="WidthFull" width="17" height="7" viewBox="0 0 17 7" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M13.375 1L16 3.625L13.375 6.25M15.5212 3.6243L1.74906 3.625M3.625 6.25L1 3.625L3.625 1" stroke="currentColor" stroke-width="1.19727" stroke-linecap="round" stroke-linejoin="round"/></svg>'},{name:"AlignStart",icon:'<svg id="AlignStart" width="15" height="12" viewBox="0 0 15 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M0.5 1C0.5 0.723858 0.723858 0.5 1 0.5H13.8C14.0761 0.5 14.3 0.723858 14.3 1C14.3 1.27614 14.0761 1.5 13.8 1.5H1C0.723858 1.5 0.5 1.27614 0.5 1Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M0.5 11C0.5 10.7239 0.723858 10.5 1 10.5H13.8C14.0761 10.5 14.3 10.7239 14.3 11C14.3 11.2761 14.0761 11.5 13.8 11.5H1C0.723858 11.5 0.5 11.2761 0.5 11Z" fill="currentColor"/><path d="M6.6 3.59998H1.8C1.35817 3.59998 1 3.95815 1 4.39998V7.59998C1 8.0418 1.35817 8.39998 1.8 8.39998H6.6C7.04183 8.39998 7.4 8.0418 7.4 7.59998V4.39998C7.4 3.95815 7.04183 3.59998 6.6 3.59998Z" fill="currentColor"/></svg>'},{name:"AlignCenter",icon:'<svg id="AlignCenter" width="15" height="11" viewBox="0 0 15 11" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M0.800049 0.5C0.800049 0.223858 1.02391 0 1.30005 0H14.1C14.3762 0 14.6 0.223858 14.6 0.5C14.6 0.776142 14.3762 1 14.1 1H1.30005C1.02391 1 0.800049 0.776142 0.800049 0.5Z" fill="black"/><path fill-rule="evenodd" clip-rule="evenodd" d="M0.800049 10.5C0.800049 10.2239 1.02391 10 1.30005 10H14.1C14.3762 10 14.6 10.2239 14.6 10.5C14.6 10.7761 14.3762 11 14.1 11H1.30005C1.02391 11 0.800049 10.7761 0.800049 10.5Z" fill="currentColor"/><path d="M10.1 3.09998H5.3C4.85817 3.09998 4.5 3.45815 4.5 3.89998V7.09998C4.5 7.5418 4.85817 7.89998 5.3 7.89998H10.1C10.5418 7.89998 10.9 7.5418 10.9 7.09998V3.89998C10.9 3.45815 10.5418 3.09998 10.1 3.09998Z" fill="currentColor"/></svg>'},{name:"AlignEnd",icon:'<svg id="AlignEnd" width="15" height="12" viewBox="0 0 15 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M0.5 1C0.5 0.723858 0.723858 0.5 1 0.5H13.8C14.0761 0.5 14.3 0.723858 14.3 1C14.3 1.27614 14.0761 1.5 13.8 1.5H1C0.723858 1.5 0.5 1.27614 0.5 1Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M0.5 11C0.5 10.7239 0.723858 10.5 1 10.5H13.8C14.0761 10.5 14.3 10.7239 14.3 11C14.3 11.2761 14.0761 11.5 13.8 11.5H1C0.723858 11.5 0.5 11.2761 0.5 11Z" fill="currentColor"/><path d="M13 3.59998H8.20002C7.7582 3.59998 7.40002 3.95815 7.40002 4.39998V7.59998C7.40002 8.0418 7.7582 8.39998 8.20002 8.39998H13C13.4419 8.39998 13.8 8.0418 13.8 7.59998V4.39998C13.8 3.95815 13.4419 3.59998 13 3.59998Z" fill="currentColor"/></svg>'}]}render(){this.container=document.createElement("div"),this.container.classList.add("picture__upload"),this.wrapper=document.createElement("div"),this.wrapper.classList.add("picture__upload_btn"),this.fileInput=document.createElement("input");const n=`upload_image_${Date.now()}`;return this.fileInput.id=n,this.fileInput.type="file",this.fileInput.name="image",this.fileInput.accept="image/*",this.icon=document.createElement("IMG"),this.icon.classList.add("picture__upload_btn_icon"),this.icon.src=Ol,this.icon.onerror=function(){throw new Error("Error loading image")},this.icon.height="24",this.label=document.createElement("label"),this.label.setAttribute("for",n),this.label.textContent="Drag & drop image file or ",this.browse=document.createElement("span"),this.browse.textContent="browse",this.browse.id="upload",this.label.appendChild(this.browse),this.wrapper.prepend(this.icon),this.wrapper.appendChild(this.label),this.wrapper.appendChild(this.fileInput),this.img=document.createElement("IMG"),this.img.classList.add("picture__upload_img"),this.container.appendChild(this.wrapper),this.container.appendChild(this.img),this.data&&this.data.imageLink&&(this.img.src=this.data.imageLink,this.img.style.display="block",this.wrapper.style.display="none"),this.data&&this.data.width&&this.data.position&&this.data.imageLink&&this._acceptTuneView(),this.api.readOnly.isEnabled&&this._acceptTuneView(),this.wrapper.addEventListener("dragover",e=>{e.preventDefault(),e.dataTransfer.dropEffect="copy"}),this.wrapper.addEventListener("drop",e=>{e.preventDefault();const i=e.dataTransfer.files[0];this.handleFile(i)}),this.fileInput.addEventListener("input",e=>{e.preventDefault();const i=e.target.files[0];this.handleFile(i)}),this.container}handleFile(n){if(n.type.match("image.*")){this.wrapper.style.display="none";const e=URL.createObjectURL(n);this.img.src=e,this.img.style.display="block",this.uploading=!0,this.uploadFile(n)}else alert("Invalid file type. Please select an image file.")}save(n){return n.querySelector("img.picture__upload_img")?Object.assign(this.data,{imageLink:this.data.imageLink,fileId:this.data.fileId,width:this.data.width||"Full",position:this.data.position||"AlignStart"}):this.data}uploadFile(n){const e=new CustomEvent("uploadImage",{detail:{image:n}});document.dispatchEvent(e)}renderSettings(){const n=document.createElement("div");return this.settings.forEach(e=>{let i=document.createElement("div");i.classList.add("cdx-settings-button"),i.classList.toggle("cdx-settings-button--active",this.data.position==e.name||this.data.width==e.name),i.innerHTML=e.icon,n.appendChild(i),i.addEventListener("click",()=>{this._toggleTune(e.name),document.querySelectorAll(".cdx-settings-button--active").forEach(o=>{o.firstChild.id!==this.data.width&&o.firstChild.id!==this.data.position&&o.classList.remove("cdx-settings-button--active")}),i.classList.toggle("cdx-settings-button--active")})}),n}_toggleTune(n){(n=="WidthSmall"||n=="WidthMedium"||n=="WidthFull")&&(this.data.width=n),(n=="AlignStart"||n=="AlignCenter"||n=="AlignEnd")&&(this.data.position=n),this._acceptTuneView()}_acceptTuneView(){this.settings.forEach(n=>{this.container.classList.toggle(n.name,this.data.width==n.name||this.data.position==n.name)})}}class W2{static get isReadOnlySupported(){return!0}static get toolbox(){return{title:"Attachment",icon:'<svg width="15" height="16" viewBox="0 0 15 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M9.34181 3.175C8.86733 3.175 8.41228 3.36348 8.07677 3.69899L3.96053 7.81523C3.45247 8.33711 3.17027 9.03805 3.17501 9.76641C3.17975 10.4951 3.47134 11.1927 3.98665 11.708C4.50195 12.2233 5.19949 12.5149 5.92823 12.5196C6.6566 12.5244 7.35753 12.2422 7.87942 11.7341C7.87968 11.7338 7.87994 11.7336 7.88021 11.7333L11.8762 7.7373L12.1237 7.98479L8.12446 11.984C7.53657 12.5568 6.74672 12.875 5.92595 12.8696C5.10518 12.8643 4.31955 12.5359 3.73916 11.9555C3.15878 11.3751 2.83036 10.5895 2.82502 9.76869C2.81968 8.94792 3.13784 8.15807 3.71063 7.57019L3.71222 7.56855L7.82928 3.45151C8.23043 3.05036 8.77451 2.825 9.34181 2.825C9.90912 2.825 10.4532 3.05036 10.8543 3.45151C11.2555 3.85266 11.4809 4.39673 11.4809 4.96404C11.4809 5.53135 11.2555 6.07542 10.8543 6.47657L6.85603 10.4749C6.63904 10.6919 6.34475 10.8138 6.03789 10.8138C5.73103 10.8138 5.43674 10.6919 5.21975 10.4749C5.00277 10.2579 4.88087 9.96361 4.88087 9.65675C4.88087 9.34989 5.00277 9.05559 5.21975 8.83861L9.09863 4.95973L9.34612 5.20722L5.46724 9.0861C5.3159 9.23744 5.23087 9.44271 5.23087 9.65675C5.23087 9.87078 5.3159 10.0761 5.46724 10.2274C5.61859 10.3787 5.82386 10.4638 6.03789 10.4638C6.25193 10.4638 6.45719 10.3787 6.60854 10.2274L10.6069 6.22908C10.9424 5.89357 11.1309 5.43852 11.1309 4.96404C11.1309 4.48955 10.9424 4.03451 10.6069 3.69899C10.2713 3.36348 9.8163 3.175 9.34181 3.175Z" fill="black"/></svg>'}}constructor({data:n,config:e,api:i}){this.data={fileLinks:n.fileLinks||[],fileIds:n.fileIds||[],fileNames:n.fileNames||[]},this.api=i,this.config=e||{},this.wrapper=null,this.fileInput=null,this.resultContainer=null,this.uploading=!1,this.config.standardFormats=[".pdf",".csv",".doc",".jpeg",".jpg",".mp4",".png",".txt",".xls"]}render(){this.container=document.createElement("div"),this.container.classList.add("picture__upload"),this.wrapper=document.createElement("div"),this.wrapper.classList.add("picture__upload_btn"),this.fileInput=document.createElement("input");const n=`upload_file_${Date.now()}`;return this.fileInput.id=n,this.fileInput.type="file",this.fileInput.name="file",this.fileInput.multiple=!0,this.icon=document.createElement("IMG"),this.icon.classList.add("picture__upload_btn_icon"),this.icon.src=Ol,this.icon.onerror=function(){throw new Error("Error loading image")},this.icon.height="24",this.label=document.createElement("label"),this.label.setAttribute("for",n),this.label.textContent="Drag & drop file(s) or ",this.browse=document.createElement("span"),this.browse.textContent="browse",this.browse.id="upload",this.label.appendChild(this.browse),this.wrapper.prepend(this.icon),this.wrapper.appendChild(this.label),this.wrapper.appendChild(this.fileInput),this.resultContainer=document.createElement("div"),this.resultContainer.classList.add("file__results"),this.resultContainer.style.gap="7px",this.data.fileIds.length||(this.resultContainer.style.display="none"),this.container.appendChild(this.wrapper),this.container.appendChild(this.resultContainer),this.populateExistingFiles(),this.data&&this.data.fileIds.length&&(this.wrapper.style.display="none",this.resultContainer.style.display="flex"),this.wrapper.addEventListener("dragover",e=>{e.preventDefault(),e.dataTransfer.dropEffect="copy"}),this.wrapper.addEventListener("drop",e=>{e.preventDefault();const i=Array.from(e.dataTransfer.files);this.handleFiles(i)}),this.fileInput.addEventListener("input",e=>{e.stopPropagation();const i=Array.from(this.fileInput.files);this.handleFiles(i)}),this.container}populateExistingFiles(){for(let n=0;n<this.data.fileLinks.length;n++){const e=this.data.fileLinks[n],i=this.data.fileIds[n],t=this.data.fileNames[n],o=this.createResultElement(e,i,t);this.resultContainer.appendChild(o)}}createResultElement(n,e,i){const t=document.createElement("div");t.classList.add("file__result");const o=document.createElement("IMG");o.classList.add("file__result_icon"),this.iconName(i)=="pdf"?o.src=jM:this.iconName(i)=="jpg"?o.src=yM:this.iconName(i)=="jpeg"?o.src=pM:this.iconName(i)=="png"?o.src=IM:this.iconName(i)=="doc"?o.src=hM:this.iconName(i)=="csv"?o.src=gM:this.iconName(i)=="xls"?o.src=xM:this.iconName(i)=="txt"?o.src=mM:this.iconName(i)=="mp4"?o.src=NM:o.src=DM;const a=document.createElement("a");return a.classList.add("file__result_name"),a.href=n,a.innerHTML=i,a.target="_blank",console.log(e),t.appendChild(o),t.appendChild(a),t}handleFiles(n){if(n.length>0){this.wrapper.style.display="none",this.resultContainer.style.display="flex";for(const e of n){const i=URL.createObjectURL(e),t=this.generateFileId(),o=this.createResultElement(i,t,e.name);this.resultContainer.appendChild(o),this.uploadFile(e,t)}this.uploading=!0}else alert("Invalid file type. Please select a valid file.")}generateFileId(){return Math.floor(Math.random()*1e6)}save(n){const e=n.querySelectorAll(".file__result");if(e.length===0)return this.data;const i=[],t=[],o=[];for(const a of e){const s=a.querySelector(".file__result_name");i.push(s.href),t.push(s.innerHTML),o.push(s.innerHTML)}return Object.assign(this.data,{fileLinks:i,fileIds:t,fileNames:o})}uploadFile(n,e){const i=new CustomEvent("uploadFile",{detail:{file:n,fileId:e}});document.dispatchEvent(i)}iconName(n){const e=this.getExtension(n).toLowerCase();return this.config.standardFormats.includes(`.${e}`)?e:"unknown"}getExtension(n){return n.slice((n.lastIndexOf(".")-1>>>0)+2)}}var EL="";const H2={key:0,class:"editor__count"},G2=c.createTextVNode(" /300 "),F2={class:"editor__body"},$2={key:0,class:"editor__first"},J2={class:"editor__first_text"},X2={class:"editor__first_link",href:"https://deskhero.com",target:"_blank"},K2=["id"],q2={__name:"TextEditor",props:{data:{type:Object,default:()=>({blocks:[]}),required:!1},readOnly:{type:Boolean,default:!0,required:!1},featureSet:{type:String,default:"Default",required:!1},firstBlock:{type:Boolean,default:!0,required:!1},firstBlockText:{type:String,default:"add your first block",required:!1},learnMoreText:{type:String,default:"Learn more about the text editor",required:!1},placeholder:{type:String,default:"Start typing...",required:!1},holder:{type:String,required:!0},wordCount:{type:Boolean,default:!1,required:!1},minHeight:{type:Number,default:50,required:!1},toolbarPosition:{type:String,default:"left",required:!1}},emits:["change"],setup(r,{expose:n,emit:e}){const i=r,t=c.ref(!1),o=c.ref(0),a=c.ref(!1),s=c.ref({}),l=c.ref({holder:i.holder,autofocus:!0,minHeight:0,defaultBlock:"paragraph",readOnly:i.readOnly,logLevel:"ERROR",onReady:()=>{t.value=!0},onChange:async(D,p)=>{if(p.type!=="block-changed"||!i.wordCount){const x=await D.saver.save();e("change",x.blocks);return}function N(x){return"text"in x.data}function v(x){return x.filter(N).reduce((k,z)=>(k+=z.data.text.length,k),0)}const m=300,j=await D.saver.save(),T=v(j.blocks);if(o.value=T,T<=m)return;const w=p.detail.target,A=p.detail.index,L=j.blocks.filter(x=>x.id===w.id).pop(),C=j.blocks.filter(x=>x.id!==w.id),b=v(C),h=m-b;D.blocks.update(w.id,{text:L.data.text.substr(0,h)}),D.caret.setToBlock(A,"end")}}),u=c.computed(()=>o.value>300);n({toggleReadOnly:d,save:M,reset:f,editBlock:g});function d(){s.value.configuration.data.blocks.length?(console.log(s.value.configuration.data.blocks),s.value.readOnly.toggle()):alert("You must at least have one block to toggle preview")}function M(){return s.value.save()}function f(){s.value.destroy()}function g(D){console.log(D),console.log(s.value)}function y(){i.featureSet=="Full"?s.value=new Tu({...l.value,data:i.data,minHeight:i.minHeight,tools:{paragraph:{class:Au,config:{placeholder:i.placeholder}},header:{class:bu},list:{class:Zg},underline:{class:Yg,shortcut:"CMD+SHIFT+U"},marker:{class:_g,shortcut:"CMD+SHIFT+H"},image:{class:Fg},file:{class:W2},inlineCode:{class:B2},checklist:{class:V2},table:{class:P2},delimiter:{class:Z2},code:{class:R2}}}):i.featureSet=="Default"?s.value=new Tu({...l.value,data:i.data,minHeight:i.minHeight,tools:{paragraph:{class:Au,config:{placeholder:i.placeholder}},header:{class:bu},list:{class:Zg},underline:{class:Yg,shortcut:"CMD+SHIFT+U"},marker:{class:_g,shortcut:"CMD+SHIFT+H"},image:{class:Fg,config:{uploadEndpoint:i.uploadEndPoint}}}}):s.value=new Tu({...l.value,data:i.data,minHeight:i.minHeight,tools:{paragraph:{class:Au,config:{placeholder:i.placeholder}},header:{class:bu}}})}function I(){y(),a.value=!1}return c.onMounted(()=>{i.firstBlock?y():a.value=!0}),(D,p)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["editor__wrapper",!r.readOnly&&r.toolbarPosition=="right"?"editor__wrapper--right":r.readOnly?"":"editor__wrapper--left"])},[r.wordCount?(c.openBlock(),c.createElementBlock("div",H2,[c.createElementVNode("span",{class:c.normalizeClass(c.unref(u)?"editor__count--danger":"")},c.toDisplayString(o.value),3),G2])):c.createCommentVNode("",!0),c.createElementVNode("div",F2,[a.value?(c.openBlock(),c.createElementBlock("div",$2,[c.createElementVNode("button",{class:"editor__first_btn",onClick:I},"+"),c.createElementVNode("p",J2,c.toDisplayString(r.firstBlockText),1),c.createElementVNode("a",X2,c.toDisplayString(r.learnMoreText),1)])):c.createCommentVNode("",!0),c.createElementVNode("div",{id:r.holder},null,8,K2)])],2))}};var _L="";const ez={class:"code"},tz=["autocomplete"],nz=["autocomplete"],rz=["autocomplete"],iz=["autocomplete"],oz=["autocomplete"],az=["autocomplete"];var sz=at(c.defineComponent({__name:"VerificationCode",props:{code:{type:String,required:!1,default:""},focusOnFirstInput:{type:Boolean,default:!0},focusOnFirstInputDelay:{type:Number,default:100},autoComplete:{type:String,default:"off"}},emits:["submit"],setup(r,{emit:n}){const e=r,i=c.ref(null),t=c.ref(null),o=c.ref(null),a=c.ref(null),s=c.ref(null),l=c.ref(null);async function u(D){var p,N,v,m,j;switch(D){case 1:break;case 2:(p=i.value)==null||p.focus();break;case 3:(N=t.value)==null||N.focus();break;case 4:(v=o.value)==null||v.focus();break;case 5:(m=a.value)==null||m.focus();break;case 6:(j=s.value)==null||j.focus();break}}async function d(D){var p,N,v,m,j;switch(D){case 1:(p=t.value)==null||p.focus();break;case 2:(N=o.value)==null||N.focus();break;case 3:(v=a.value)==null||v.focus();break;case 4:(m=s.value)==null||m.focus();break;case 5:(j=l.value)==null||j.focus();break}}async function M(D,p){const N=D.key;let v=!0;[{_index:1,nextInput:t},{_index:2,nextInput:o},{_index:3,nextInput:a},{_index:4,nextInput:s},{_index:5,nextInput:l}].forEach(({_index:m,nextInput:j})=>{p===m&&(j.value&&N.match(/^[0-9]+$/)&&j.value.focus({}),v=!1),D.preventDefault()}),N.match(/^[0-9]+$/)&&(D.target.value=N),v&&y()}async function f(D){var N;const p=((N=D.clipboardData)==null?void 0:N.getData("text/plain"))||"";g(p),y()}function g(D){const p=D.replace(/\D/g,"");if(p.length!==6)return;const[N,v,m,j,T,w]=p.split("");i.value&&(i.value.value=N),t.value&&(t.value.value=v),o.value&&(o.value.value=m),a.value&&(a.value.value=j),s.value&&(s.value.value=T),l.value&&(l.value.value=w)}async function y(){var p,N,v,m,j,T;const D=`${(p=i.value)==null?void 0:p.value}${(N=t.value)==null?void 0:N.value}${(v=o.value)==null?void 0:v.value}${(m=a.value)==null?void 0:m.value}${(j=s.value)==null?void 0:j.value}${(T=l.value)==null?void 0:T.value}`;n("submit",D)}function I(){setTimeout(()=>{var D;e.focusOnFirstInput&&((D=i.value)==null||D.focus())},e.focusOnFirstInputDelay)}return c.onMounted(()=>{e.code&&(g(e.code),y()),I()}),(D,p)=>(c.openBlock(),c.createElementBlock("div",ez,[c.createElementVNode("input",{ref_key:"txtInput1",ref:i,autocomplete:r.autoComplete,autofocus:"",class:"form-input input-1","data-e2e":"input-1",inputmode:"numeric",maxlength:"1",placeholder:"_",type:"text",onKeypress:p[0]||(p[0]=N=>M(N,1)),onKeyup:[p[1]||(p[1]=c.withKeys(N=>u(1),["delete"])),p[2]||(p[2]=c.withKeys(N=>u(1),["left"])),p[3]||(p[3]=c.withKeys(N=>d(1),["right"]))],onPaste:f},null,40,tz),c.createElementVNode("input",{ref_key:"txtInput2",ref:t,autocomplete:r.autoComplete,class:"form-input","data-e2e":"input-2",inputmode:"numeric",maxlength:"1",placeholder:"_",type:"text",onKeypress:p[4]||(p[4]=N=>M(N,2)),onKeyup:[p[5]||(p[5]=c.withKeys(N=>u(2),["delete"])),p[6]||(p[6]=c.withKeys(N=>u(2),["left"])),p[7]||(p[7]=c.withKeys(N=>d(2),["right"]))],onPaste:f},null,40,nz),c.createElementVNode("input",{ref_key:"txtInput3",ref:o,autocomplete:r.autoComplete,class:"form-input","data-e2e":"input-3",inputmode:"numeric",maxlength:"1",placeholder:"_",type:"text",onKeypress:p[8]||(p[8]=N=>M(N,3)),onKeyup:[p[9]||(p[9]=c.withKeys(N=>u(3),["delete"])),p[10]||(p[10]=c.withKeys(N=>u(3),["left"])),p[11]||(p[11]=c.withKeys(N=>d(3),["right"]))],onPaste:f},null,40,rz),c.createElementVNode("input",{ref_key:"txtInput4",ref:a,autocomplete:r.autoComplete,class:"form-input","data-e2e":"input-4",inputmode:"numeric",maxlength:"1",placeholder:"_",type:"text",onKeypress:p[12]||(p[12]=N=>M(N,4)),onKeyup:[p[13]||(p[13]=c.withKeys(N=>u(4),["delete"])),p[14]||(p[14]=c.withKeys(N=>u(4),["left"])),p[15]||(p[15]=c.withKeys(N=>d(4),["right"]))],onPaste:f},null,40,iz),c.createElementVNode("input",{ref_key:"txtInput5",ref:s,autocomplete:r.autoComplete,class:"form-input","data-e2e":"input-5",inputmode:"numeric",maxlength:"1",placeholder:"_",type:"text",onKeypress:p[16]||(p[16]=N=>M(N,5)),onKeyup:[p[17]||(p[17]=c.withKeys(N=>u(5),["delete"])),p[18]||(p[18]=c.withKeys(N=>u(5),["left"])),p[19]||(p[19]=c.withKeys(N=>d(5),["right"]))],onPaste:f},null,40,oz),c.createElementVNode("input",{ref_key:"txtInput6",ref:l,autocomplete:r.autoComplete,class:"form-input","data-e2e":"input-6",inputmode:"numeric",maxlength:"1",placeholder:"_",type:"text",onKeypress:p[20]||(p[20]=N=>M(N,6)),onKeyup:[p[21]||(p[21]=c.withKeys(N=>u(6),["delete"])),p[22]||(p[22]=c.withKeys(N=>u(6),["left"])),p[23]||(p[23]=c.withKeys(N=>d(6),["right"]))],onPaste:f},null,40,az)]))}}),[["__scopeId","data-v-2ace876a"]]),YL="";/*!
|
|
378
378
|
* Cropper.js v1.5.13
|
|
379
379
|
* https://fengyuanchen.github.io/cropperjs
|
|
380
380
|
*
|