(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".ce-popover--inline .ce-popover--nested .ce-popover__container{width:min-content!important;min-width:unset!important}.ce-popover--inline .ce-popover--nested .ce-popover__items{width:max-content}.editorjs__color-selector-container{display:grid;gap:10px;padding:4px}.editorjs__color-selector__container-item{width:30px;height:30px;display:block;cursor:pointer;border-radius:100%;transition:transform .2s ease}.editorjs__color-selector__container-item:hover{transform:scale(1.1)}")),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
(function(e,o){typeof exports=="object"&&typeof module<"u"?o(exports):typeof define=="function"&&define.amd?define(["exports"],o):(e=typeof globalThis<"u"?globalThis:e||self,o(e.ColorPicker={}))})(this,function(e){"use strict";var d=Object.defineProperty;var u=(e,o,r)=>o in e?d(e,o,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[o]=r;var i=(e,o,r)=>u(e,typeof o!="symbol"?o+"":o,r);const o='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-width="2" d="M5.24296 11.4075C5.23167 10.6253 5.52446 9.8395 6.12132 9.24264L9.65686 5.70711C10.0474 5.31658 10.6809 5.31693 11.0714 5.70745L16.0205 10.6565C16.2268 10.8629 16.3243 11.1371 16.3126 11.4075M5.24296 11.4075C5.25382 12.1607 5.54661 12.9106 6.12132 13.4853L8 15.364M5.24296 11.4075H11.9565M16.3126 11.4075C16.3022 11.6487 16.205 11.8869 16.0208 12.0711L12.4853 15.6066C11.3137 16.7782 9.41421 16.7782 8.24264 15.6066L8 15.364M16.3126 11.4075H11.9565M8 15.364L11.9565 11.4075"/><path stroke="currentColor" stroke-width="2" d="M20 17.4615C20 18.3112 19.3284 19 18.5 19C17.6716 19 17 18.3112 17 17.4615C17 16.6119 17.9 15.6154 18.5 15C19.1 15.6154 20 16.6119 20 17.4615Z"/></svg>';class r{constructor(t){i(this,"api");i(this,"tag","SPAN");i(this,"class","cdx-text-color");i(this,"defaultColor","#2644FF");i(this,"lastRange",null);i(this,"colors",["#182a4e","#0055cc","#1f6a83","#206e4e","#e56910","#ae2e24","#5e4db2","#758195","#1e7afd","#2998bd","#23a06b","#fea363","#c9372c","#8270db"]);i(this,"columns",7);const{api:n,config:s}=t;this.api=n,s.colors&&(this.colors=s.colors),s.columns&&(this.columns=s.columns)}static get title(){return"Color"}static get isInline(){return!0}render(){const t=document.createElement("button");return t.type="button",t.innerHTML=o,t.classList.add(this.api.styles.inlineToolButton),t.addEventListener("mousedown",n=>{n.preventDefault()}),t}surround(t){this.lastRange=t}wrapAndColor(t,n){if(!t)return;const s=t.extractContents(),c=document.createElement(this.tag);c.classList.add(this.class),c.appendChild(s),c.style.color=n,c.innerHTML=c.textContent||"",t.insertNode(c),this.api.selection.expandToTag(c)}renderActions(){const t=document.createElement("div");return t.classList.add("editorjs__color-selector-container"),t.style.gridTemplateColumns=`repeat(${this.columns}, 1fr)`,this.colors.forEach(n=>{const s=document.createElement("div");s.classList.add("editorjs__color-selector__container-item"),s.style.backgroundColor=n,s.onclick=()=>{this.wrapAndColor(this.lastRange,n)},t.append(s)}),t}static get sanitize(){return{span:{style:{color:!0}}}}}class l extends r{static get sanitize(){}}e.ColorPickerWithoutSanitize=l,e.default=r,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
