lakelib 0.1.18 → 0.1.19

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/lake.min.js CHANGED
@@ -1,4 +1,4 @@
1
- var Lake=function(t){"use strict";class e extends HTMLElement{}void 0!==customElements.get("lake-box")&&customElements.define("lake-box",e);class i extends HTMLElement{}void 0!==customElements.get("lake-bookmark")&&customElements.define("lake-bookmark",i);const n=new Map([["plus",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm48-88a8,8,0,0,1-8,8H136v32a8,8,0,0,1-16,0V136H88a8,8,0,0,1,0-16h32V88a8,8,0,0,1,16,0v32h32A8,8,0,0,1,176,128Z"></path></svg>'],["more",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M112,60a16,16,0,1,1,16,16A16,16,0,0,1,112,60Zm16,52a16,16,0,1,0,16,16A16,16,0,0,0,128,112Zm0,68a16,16,0,1,0,16,16A16,16,0,0,0,128,180Z"></path></svg>'],["left",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M165.66,202.34a8,8,0,0,1-11.32,11.32l-80-80a8,8,0,0,1,0-11.32l80-80a8,8,0,0,1,11.32,11.32L91.31,128Z"></path></svg>'],["right",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z"></path></svg>'],["down",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M216.49,104.49l-80,80a12,12,0,0,1-17,0l-80-80a12,12,0,0,1,17-17L128,159l71.51-71.52a12,12,0,0,1,17,17Z"></path></svg>'],["check",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"></path></svg>'],["checkCircle",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"></path></svg>'],["warningCircle",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm-8-80V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,172Z"></path></svg>'],["file",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Z"></path></svg>'],["open",'<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6.25 4.5A1.75 1.75 0 0 0 4.5 6.25v11.5c0 .966.783 1.75 1.75 1.75h11.5a1.75 1.75 0 0 0 1.75-1.75v-4a.75.75 0 0 1 1.5 0v4A3.25 3.25 0 0 1 17.75 21H6.25A3.25 3.25 0 0 1 3 17.75V6.25A3.25 3.25 0 0 1 6.25 3h4a.75.75 0 0 1 0 1.5h-4ZM13 3.75a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 .75.75v6.5a.75.75 0 0 1-1.5 0V5.56l-5.22 5.22a.75.75 0 0 1-1.06-1.06l5.22-5.22h-4.69a.75.75 0 0 1-.75-.75Z" fill="#000000"/></svg>'],["download",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z"></path></svg>'],["copy",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"></path></svg>'],["remove",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"></path></svg>'],["maximize",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M200,80v32a8,8,0,0,1-16,0V88H160a8,8,0,0,1,0-16h32A8,8,0,0,1,200,80ZM96,168H72V144a8,8,0,0,0-16,0v32a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16ZM232,56V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56ZM216,200V56H40V200H216Z"></path></svg>'],["close",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"></path></svg>'],["zoomIn",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M152,112a8,8,0,0,1-8,8H120v24a8,8,0,0,1-16,0V120H80a8,8,0,0,1,0-16h24V80a8,8,0,0,1,16,0v24h24A8,8,0,0,1,152,112Zm77.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88.11,88.11,0,1,1,11.31-11.31l50.07,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z"></path></svg>'],["zoomOut",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M152,112a8,8,0,0,1-8,8H80a8,8,0,0,1,0-16h64A8,8,0,0,1,152,112Zm77.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88.11,88.11,0,1,1,11.31-11.31l50.07,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z"></path></svg>'],["circleNotch",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60.15,61.59,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20.15-66.41-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z"></path></svg>'],["selectAll",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M104,40a8,8,0,0,1,8-8h32a8,8,0,0,1,0,16H112A8,8,0,0,1,104,40Zm40,168H112a8,8,0,0,0,0,16h32a8,8,0,0,0,0-16ZM208,32H184a8,8,0,0,0,0,16h24V72a8,8,0,0,0,16,0V48A16,16,0,0,0,208,32Zm8,72a8,8,0,0,0-8,8v32a8,8,0,0,0,16,0V112A8,8,0,0,0,216,104Zm0,72a8,8,0,0,0-8,8v24H184a8,8,0,0,0,0,16h24a16,16,0,0,0,16-16V184A8,8,0,0,0,216,176ZM40,152a8,8,0,0,0,8-8V112a8,8,0,0,0-16,0v32A8,8,0,0,0,40,152Zm32,56H48V184a8,8,0,0,0-16,0v24a16,16,0,0,0,16,16H72a8,8,0,0,0,0-16ZM40,80a8,8,0,0,0,8-8V48H72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,48V72A8,8,0,0,0,40,80ZM176,184H80a8,8,0,0,1-8-8V80a8,8,0,0,1,8-8h96a8,8,0,0,1,8,8v96A8,8,0,0,1,176,184Zm-8-96H88v80h80Z"></path></svg>'],["undo",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M232,144a64.07,64.07,0,0,1-64,64H80a8,8,0,0,1,0-16h88a48,48,0,0,0,0-96H51.31l34.35,34.34a8,8,0,0,1-11.32,11.32l-48-48a8,8,0,0,1,0-11.32l48-48A8,8,0,0,1,85.66,45.66L51.31,80H168A64.07,64.07,0,0,1,232,144Z"></path></svg>'],["redo",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M170.34,130.34,204.69,96H88a48,48,0,0,0,0,96h88a8,8,0,0,1,0,16H88A64,64,0,0,1,88,80H204.69L170.34,45.66a8,8,0,0,1,11.32-11.32l48,48a8,8,0,0,1,0,11.32l-48,48a8,8,0,0,1-11.32-11.32Z"></path></svg>'],["heading",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M208,56V200a8,8,0,0,1-16,0V136H64v64a8,8,0,0,1-16,0V56a8,8,0,0,1,16,0v64H192V56a8,8,0,0,1,16,0Z"></path></svg>'],["heading1",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M152,56V176a8,8,0,0,1-16,0V124H48v52a8,8,0,0,1-16,0V56a8,8,0,0,1,16,0v52h88V56a8,8,0,0,1,16,0Zm75.77,49a8,8,0,0,0-8.21.39l-24,16a8,8,0,1,0,8.88,13.32L216,127V208a8,8,0,0,0,16,0V112A8,8,0,0,0,227.77,105Z"></path></svg>'],["heading2",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M152,56V176a8,8,0,0,1-16,0V124H48v52a8,8,0,0,1-16,0V56a8,8,0,0,1,16,0v52h88V56a8,8,0,0,1,16,0Zm88,144H208l33.55-44.74a32,32,0,1,0-55.73-29.93,8,8,0,1,0,15.08,5.34,16.28,16.28,0,0,1,2.32-4.3,16,16,0,1,1,25.54,19.27L185.6,203.2A8,8,0,0,0,192,216h48a8,8,0,0,0,0-16Z"></path></svg>'],["heading3",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M152,56V176a8,8,0,0,1-16,0V124H48v52a8,8,0,0,1-16,0V56a8,8,0,0,1,16,0v52h88V56a8,8,0,0,1,16,0Zm73.52,90.63,21-30A8,8,0,0,0,240,104H192a8,8,0,0,0,0,16h32.63l-19.18,27.41A8,8,0,0,0,212,160a20,20,0,1,1-14.29,34,8,8,0,1,0-11.42,11.19A36,36,0,0,0,248,180,36.07,36.07,0,0,0,225.52,146.63Z"></path></svg>'],["heading4",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M152,56V176a8,8,0,0,1-16,0V124H48v52a8,8,0,0,1-16,0V56a8,8,0,0,1,16,0v52h88V56a8,8,0,0,1,16,0Zm96,112h-8V144a8,8,0,0,0-16,0v24H195.1l20.49-61.47a8,8,0,0,0-15.18-5.06l-24,72A8,8,0,0,0,184,184h40v24a8,8,0,0,0,16,0V184h8a8,8,0,0,0,0-16Z"></path></svg>'],["heading5",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M152,56V176a8,8,0,0,1-16,0V124H48v52a8,8,0,0,1-16,0V56a8,8,0,0,1,16,0v52h88V56a8,8,0,0,1,16,0Zm60,88a38.8,38.8,0,0,0-9.41,1.14L206.78,120H240a8,8,0,0,0,0-16H200a8,8,0,0,0-7.89,6.68l-8,48a8,8,0,0,0,13.6,6.92A19.73,19.73,0,0,1,212,160a20,20,0,0,1,0,40,19.73,19.73,0,0,1-14.29-5.6,8,8,0,1,0-11.42,11.2A35.54,35.54,0,0,0,212,216a36,36,0,0,0,0-72Z"></path></svg>'],["heading6",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M152,56V176a8,8,0,0,1-16,0V124H48v52a8,8,0,0,1-16,0V56a8,8,0,0,1,16,0v52h88V56a8,8,0,0,1,16,0Zm96,124a36,36,0,1,1-67.34-17.68c.07-.14.14-.28.22-.42l32.25-54a8,8,0,0,1,13.74,8.2l-16.69,28c.6,0,1.21-.05,1.82-.05A36,36,0,0,1,248,180Zm-16,0a20,20,0,1,0-20,20A20,20,0,0,0,232,180Z"></path></svg>'],["paragraph",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M208,40H96a64,64,0,0,0,0,128h40v40a8,8,0,0,0,16,0V56h24V208a8,8,0,0,0,16,0V56h16a8,8,0,0,0,0-16ZM136,152H96a48,48,0,0,1,0-96h40Z"></path></svg>'],["blockQuote",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M100,56H40A16,16,0,0,0,24,72v64a16,16,0,0,0,16,16h60v8a32,32,0,0,1-32,32,8,8,0,0,0,0,16,48.05,48.05,0,0,0,48-48V72A16,16,0,0,0,100,56Zm0,80H40V72h60ZM216,56H156a16,16,0,0,0-16,16v64a16,16,0,0,0,16,16h60v8a32,32,0,0,1-32,32,8,8,0,0,0,0,16,48.05,48.05,0,0,0,48-48V72A16,16,0,0,0,216,56Zm0,80H156V72h60Z"></path></svg>'],["list",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M88,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H96A8,8,0,0,1,88,64Zm128,56H96a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Zm0,64H96a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16ZM56,56H40a8,8,0,0,0,0,16H56a8,8,0,0,0,0-16Zm0,64H40a8,8,0,0,0,0,16H56a8,8,0,0,0,0-16Zm0,64H40a8,8,0,0,0,0,16H56a8,8,0,0,0,0-16Z"></path></svg>'],["numberedList",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M224,128a8,8,0,0,1-8,8H104a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128ZM104,72H216a8,8,0,0,0,0-16H104a8,8,0,0,0,0,16ZM216,184H104a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16ZM43.58,55.16,48,52.94V104a8,8,0,0,0,16,0V40a8,8,0,0,0-11.58-7.16l-16,8a8,8,0,0,0,7.16,14.32ZM79.77,156.72a23.73,23.73,0,0,0-9.6-15.95,24.86,24.86,0,0,0-34.11,4.7,23.63,23.63,0,0,0-3.57,6.46,8,8,0,1,0,15,5.47,7.84,7.84,0,0,1,1.18-2.13,8.76,8.76,0,0,1,12-1.59A7.91,7.91,0,0,1,63.93,159a7.64,7.64,0,0,1-1.57,5.78,1,1,0,0,0-.08.11L33.59,203.21A8,8,0,0,0,40,216H72a8,8,0,0,0,0-16H56l19.08-25.53A23.47,23.47,0,0,0,79.77,156.72Z"></path></svg>'],["bulletedList",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M80,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H88A8,8,0,0,1,80,64Zm136,56H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Zm0,64H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16ZM44,52A12,12,0,1,0,56,64,12,12,0,0,0,44,52Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,116Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,180Z"></path></svg>'],["checklist",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M224,128a8,8,0,0,1-8,8H128a8,8,0,0,1,0-16h88A8,8,0,0,1,224,128ZM128,72h88a8,8,0,0,0,0-16H128a8,8,0,0,0,0,16Zm88,112H128a8,8,0,0,0,0,16h88a8,8,0,0,0,0-16ZM82.34,42.34,56,68.69,45.66,58.34A8,8,0,0,0,34.34,69.66l16,16a8,8,0,0,0,11.32,0l32-32A8,8,0,0,0,82.34,42.34Zm0,64L56,132.69,45.66,122.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32,0l32-32a8,8,0,0,0-11.32-11.32Zm0,64L56,196.69,45.66,186.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32,0l32-32a8,8,0,0,0-11.32-11.32Z"></path></svg>'],["alignLeft",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64Zm8,48H168a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Zm176,24H40a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Zm-48,40H40a8,8,0,0,0,0,16H168a8,8,0,0,0,0-16Z"></path></svg>'],["alignCenter",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64ZM64,96a8,8,0,0,0,0,16H192a8,8,0,0,0,0-16Zm152,40H40a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Zm-24,40H64a8,8,0,0,0,0,16H192a8,8,0,0,0,0-16Z"></path></svg>'],["alignRight",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64ZM216,96H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Zm0,40H40a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Zm0,40H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Z"></path></svg>'],["alignJustify",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64ZM216,96H40a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Zm0,40H40a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Zm0,40H40a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Z"></path></svg>'],["increaseIndent",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M224,128a8,8,0,0,1-8,8H112a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128ZM112,72H216a8,8,0,0,0,0-16H112a8,8,0,0,0,0,16ZM216,184H40a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16ZM34.34,141.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0,0-11.32l-40-40A8,8,0,0,0,34.34,61.66L68.69,96,34.34,130.34A8,8,0,0,0,34.34,141.66Z"></path></svg>'],["decreaseIndent",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M224,128a8,8,0,0,1-8,8H112a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128ZM112,72H216a8,8,0,0,0,0-16H112a8,8,0,0,0,0,16ZM216,184H40a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16ZM72,144a8,8,0,0,0,5.66-13.66L43.31,96,77.66,61.66A8,8,0,0,0,66.34,50.34l-40,40a8,8,0,0,0,0,11.32l40,40A8,8,0,0,0,72,144Z"></path></svg>'],["formatPainter",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M232,88H216V64a16,16,0,0,0-16-16H48A16,16,0,0,0,32,64V88H16a8,8,0,0,0,0,16H32v24a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V104h16v50L131.6,182.65A16.07,16.07,0,0,0,120,198v34a8,8,0,0,0,16,0V198l100.4-28.68A16.07,16.07,0,0,0,248,154V104A16,16,0,0,0,232,88Zm-32,40H48V64H200v64Z"></path></svg>'],["bold",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M170.48,115.7A44,44,0,0,0,140,40H72a8,8,0,0,0-8,8V200a8,8,0,0,0,8,8h80a48,48,0,0,0,18.48-92.3ZM80,56h60a28,28,0,0,1,0,56H80Zm72,136H80V128h72a32,32,0,0,1,0,64Z"></path></svg>'],["italic",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M200,56a8,8,0,0,1-8,8H157.77L115.1,192H144a8,8,0,0,1,0,16H64a8,8,0,0,1,0-16H98.23L140.9,64H112a8,8,0,0,1,0-16h80A8,8,0,0,1,200,56Z"></path></svg>'],["underline",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M200,224a8,8,0,0,1-8,8H64a8,8,0,0,1,0-16H192A8,8,0,0,1,200,224Zm-72-24a64.07,64.07,0,0,0,64-64V56a8,8,0,0,0-16,0v80a48,48,0,0,1-96,0V56a8,8,0,0,0-16,0v80A64.07,64.07,0,0,0,128,200Z"></path></svg>'],["strikethrough",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M224,128a8,8,0,0,1-8,8H175.93c9.19,7.11,16.07,17.2,16.07,32,0,13.34-7,25.7-19.75,34.79C160.33,211.31,144.61,216,128,216s-32.33-4.69-44.25-13.21C71,193.7,64,181.34,64,168a8,8,0,0,1,16,0c0,17.35,22,32,48,32s48-14.65,48-32c0-14.85-10.54-23.58-38.77-32H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128ZM76.33,104a8,8,0,0,0,7.61-10.49A17.3,17.3,0,0,1,83.11,88c0-18.24,19.3-32,44.89-32,18.84,0,34.16,7.42,41,19.85a8,8,0,0,0,14-7.7C173.33,50.52,152.77,40,128,40,93.29,40,67.11,60.63,67.11,88a33.73,33.73,0,0,0,1.62,10.49A8,8,0,0,0,76.33,104Z"></path></svg>'],["superscript",'<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M18.736 3.5c-.543 0-.986.495-.986 1.023a.75.75 0 0 1-1.5 0C16.25 3.278 17.258 2 18.736 2c.855 0 1.684.4 2.15 1.117.49.751.5 1.724-.057 2.672-.285.484-.673.847-1.045 1.141-.187.148-.379.284-.557.41l-.078.056a17.45 17.45 0 0 0-.432.311c-.356.268-.619.511-.78.793h2.514a.75.75 0 0 1 0 1.5H17a.75.75 0 0 1-.75-.75c0-1.396.821-2.182 1.565-2.741.157-.119.32-.234.472-.341l.074-.052c.177-.126.34-.243.493-.363.306-.242.532-.47.682-.724.31-.53.229-.886.093-1.094-.158-.244-.486-.435-.893-.435Z" fill="#000000"/><path d="M15.26 4.71c.06.562.385 1.043.847 1.318L10.987 12l5.583 6.512a.75.75 0 1 1-1.14.976L10 13.152l-5.43 6.336a.75.75 0 0 1-1.14-.976L9.013 12 3.431 5.488a.75.75 0 1 1 1.139-.976L10 10.848l5.26-6.137Z" fill="#000000"/></svg>'],["subscript",'<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M16.488 4.43a.75.75 0 0 1 .082 1.058L10.988 12l5.032 5.871c-.302.41-.555.906-.682 1.51L10 13.151l-5.43 6.336a.75.75 0 0 1-1.14-.976L9.013 12 3.431 5.488a.75.75 0 0 1 1.139-.976L10 10.848l5.43-6.336a.75.75 0 0 1 1.058-.081ZM17.75 15.523c0-.528.444-1.023.986-1.023.407 0 .735.19.893.434.136.21.218.566-.093 1.095-.15.255-.376.482-.682.724-.152.12-.316.237-.493.363l-.074.052c-.152.107-.315.222-.472.34-.744.56-1.565 1.346-1.565 2.742 0 .414.336.75.75.75h3.451a.75.75 0 0 0 0-1.5h-2.513c.16-.282.423-.525.779-.793.137-.103.279-.203.432-.312l.078-.054c.178-.127.37-.264.557-.41.372-.295.76-.658 1.045-1.142.557-.948.546-1.921.058-2.672C20.42 13.4 19.59 13 18.736 13c-1.478 0-2.486 1.278-2.486 2.523a.75.75 0 0 0 1.5 0Z" fill="#000000"/></svg>'],["code",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M93.31,70,28,128l65.27,58a8,8,0,1,1-10.62,12l-72-64a8,8,0,0,1,0-12l72-64A8,8,0,1,1,93.31,70Zm152,52-72-64a8,8,0,0,0-10.62,12L228,128l-65.27,58a8,8,0,1,0,10.62,12l72-64a8,8,0,0,0,0-12Z"></path></svg>'],["removeFormat",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M225,80.4,183.6,39a24,24,0,0,0-33.94,0L31,157.66a24,24,0,0,0,0,33.94l30.06,30.06A8,8,0,0,0,66.74,224H216a8,8,0,0,0,0-16h-84.7L225,114.34A24,24,0,0,0,225,80.4ZM108.68,208H70.05L42.33,180.28a8,8,0,0,1,0-11.31L96,115.31,148.69,168Zm105-105L160,156.69,107.31,104,161,50.34a8,8,0,0,1,11.32,0l41.38,41.38a8,8,0,0,1,0,11.31Z"></path></svg>'],["moreStyle",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M112,60a16,16,0,1,1,16,16A16,16,0,0,1,112,60Zm16,52a16,16,0,1,0,16,16A16,16,0,0,0,128,112Zm0,68a16,16,0,1,0,16,16A16,16,0,0,0,128,180Z"></path></svg>'],["fontColor",'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><rect width="256" height="256" fill="none"/><polyline points="192 168 128 32 64 168" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="173.18" y1="128" x2="82.82" y2="128" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></svg>'],["fontColorAccent",'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><rect width="256" height="256" fill="none"/><line x1="40" y1="216" x2="216" y2="216" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></svg>'],["highlight",'<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4.38 14.003A2.5 2.5 0 0 0 2 16.5v3A2.5 2.5 0 0 0 4.5 22h15a2.5 2.5 0 0 0 2.5-2.5v-3a2.5 2.5 0 0 0-2.5-2.5h-5.954l-1.316 1.314a3.237 3.237 0 0 1-.203.186H19.5a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1h-15a1 1 0 0 1-1-1v-3a1 1 0 0 1 .504-.869 2 2 0 0 1 .092-.744l.285-.884Z" fill="#000000"/><path d="M18.648 2.944a3.218 3.218 0 0 1-.002 4.551l-7.123 7.111a2.25 2.25 0 0 1-.942.563l-4.294 1.289a1 1 0 0 1-1.239-1.265l1.362-4.228c.11-.34.298-.65.552-.902l7.132-7.122a3.22 3.22 0 0 1 4.554.003Zm-3.494 1.059-7.133 7.121a.75.75 0 0 0-.184.301l-1.07 3.322 3.382-1.015a.75.75 0 0 0 .315-.187l7.121-7.11a1.718 1.718 0 1 0-2.43-2.432Z" fill="#000000"/></svg>'],["highlightAccent",'<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4.004 15.631a2 2 0 0 0 2.571 1.784l4.293-1.288a3.25 3.25 0 0 0 1.159-.627H19.5a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1h-15a1 1 0 0 1-1-1v-3a1 1 0 0 1 .504-.869Z" fill="#000000"/></svg>'],["link",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M165.66,90.34a8,8,0,0,1,0,11.32l-64,64a8,8,0,0,1-11.32-11.32l64-64A8,8,0,0,1,165.66,90.34ZM215.6,40.4a56,56,0,0,0-79.2,0L106.34,70.45a8,8,0,0,0,11.32,11.32l30.06-30a40,40,0,0,1,56.57,56.56l-30.07,30.06a8,8,0,0,0,11.31,11.32L215.6,119.6a56,56,0,0,0,0-79.2ZM138.34,174.22l-30.06,30.06a40,40,0,1,1-56.56-56.57l30.05-30.05a8,8,0,0,0-11.32-11.32L40.4,136.4a56,56,0,0,0,79.2,79.2l30.06-30.07a8,8,0,0,0-11.32-11.31Z"></path></svg>'],["unlink",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M190.63,65.37a32,32,0,0,0-45.19-.06L133.79,77.52a8,8,0,0,1-11.58-11l11.72-12.29a1.59,1.59,0,0,1,.13-.13,48,48,0,0,1,67.88,67.88,1.59,1.59,0,0,1-.13.13l-12.29,11.72a8,8,0,0,1-11-11.58l12.21-11.65A32,32,0,0,0,190.63,65.37ZM122.21,178.48l-11.65,12.21a32,32,0,0,1-45.25-45.25l12.21-11.65a8,8,0,0,0-11-11.58L54.19,133.93a1.59,1.59,0,0,0-.13.13,48,48,0,0,0,67.88,67.88,1.59,1.59,0,0,0,.13-.13l11.72-12.29a8,8,0,1,0-11.58-11ZM208,152H184a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16ZM48,104H72a8,8,0,0,0,0-16H48a8,8,0,0,0,0,16Zm112,72a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V184A8,8,0,0,0,160,176ZM96,80a8,8,0,0,0,8-8V48a8,8,0,0,0-16,0V72A8,8,0,0,0,96,80Z"></path></svg>'],["hr",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M224,128a8,8,0,0,1-8,8H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128Z"></path></svg>'],["codeBlock",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M58.34,101.66l-32-32a8,8,0,0,1,0-11.32l32-32A8,8,0,0,1,69.66,37.66L43.31,64,69.66,90.34a8,8,0,0,1-11.32,11.32Zm40,0a8,8,0,0,0,11.32,0l32-32a8,8,0,0,0,0-11.32l-32-32A8,8,0,0,0,98.34,37.66L124.69,64,98.34,90.34A8,8,0,0,0,98.34,101.66ZM200,40H176a8,8,0,0,0,0,16h24V200H56V136a8,8,0,0,0-16,0v64a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Z"></path></svg>'],["image",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,16V158.75l-26.07-26.06a16,16,0,0,0-22.63,0l-20,20-44-44a16,16,0,0,0-22.62,0L40,149.37V56ZM40,172l52-52,80,80H40Zm176,28H194.63l-36-36,20-20L216,181.38V200ZM144,100a12,12,0,1,1,12,12A12,12,0,0,1,144,100Z"></path></svg>'],["video",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M164.44,121.34l-48-32A8,8,0,0,0,104,96v64a8,8,0,0,0,12.44,6.66l48-32a8,8,0,0,0,0-13.32ZM120,145.05V111l25.58,17ZM234.33,69.52a24,24,0,0,0-14.49-16.4C185.56,39.88,131,40,128,40s-57.56-.12-91.84,13.12a24,24,0,0,0-14.49,16.4C19.08,79.5,16,97.74,16,128s3.08,48.5,5.67,58.48a24,24,0,0,0,14.49,16.41C69,215.56,120.4,216,127.34,216h1.32c6.94,0,58.37-.44,91.18-13.11a24,24,0,0,0,14.49-16.41c2.59-10,5.67-28.22,5.67-58.48S236.92,79.5,234.33,69.52Zm-15.49,113a8,8,0,0,1-4.77,5.49c-31.65,12.22-85.48,12-86,12H128c-.54,0-54.33.2-86-12a8,8,0,0,1-4.77-5.49C34.8,173.39,32,156.57,32,128s2.8-45.39,5.16-54.47A8,8,0,0,1,41.93,68c30.52-11.79,81.66-12,85.85-12h.27c.54,0,54.38-.18,86,12a8,8,0,0,1,4.77,5.49C221.2,82.61,224,99.43,224,128S221.2,173.39,218.84,182.47Z"></path></svg>'],["attachment",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M209.66,122.34a8,8,0,0,1,0,11.32l-82.05,82a56,56,0,0,1-79.2-79.21L147.67,35.73a40,40,0,1,1,56.61,56.55L105,193A24,24,0,1,1,71,159L154.3,74.38A8,8,0,1,1,165.7,85.6L82.39,170.31a8,8,0,1,0,11.27,11.36L192.93,81A24,24,0,1,0,159,47L59.76,147.68a40,40,0,1,0,56.53,56.62l82.06-82A8,8,0,0,1,209.66,122.34Z"></path></svg>'],["emoji",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216ZM80,108a12,12,0,1,1,12,12A12,12,0,0,1,80,108Zm96,0a12,12,0,1,1-12-12A12,12,0,0,1,176,108Zm-1.07,48c-10.29,17.79-27.4,28-46.93,28s-36.63-10.2-46.92-28a8,8,0,1,1,13.84-8c7.47,12.91,19.21,20,33.08,20s25.61-7.1,33.07-20a8,8,0,0,1,13.86,8Z"></path></svg>'],["specialCharacter",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 32 32"><path d="M22.7373,25A14.3093,14.3093,0,0,0,27,15C27,8.42,22.58,4,16,4S5,8.42,5,15A14.3093,14.3093,0,0,0,9.2627,25H4v2h8V24.7617A12.5683,12.5683,0,0,1,7,15c0-5.4673,3.5327-9,9-9s9,3.5327,9,9a12.5683,12.5683,0,0,1-5,9.7617V27h8V25Z"/></svg>'],["equation",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M184,72V56H80.65l53.6,67a8,8,0,0,1,0,10l-53.6,67H184V184a8,8,0,0,1,16,0v24a8,8,0,0,1-8,8H64a8,8,0,0,1-6.25-13l60-75-60-75A8,8,0,0,1,64,40H192a8,8,0,0,1,8,8V72a8,8,0,0,1-16,0Z"></path></svg>'],["table",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M224,48H32a8,8,0,0,0-8,8V192a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A8,8,0,0,0,224,48ZM40,112H80v32H40Zm56,0H216v32H96ZM216,64V96H40V64ZM40,160H80v32H40Zm176,32H96V160H216v32Z"></path></svg>']]);function s(t,...e){let i=t[0];for(let n=0;n<e.length;n++){i+=String(e[n]),i+=t[n+1]}return i=i.replace(/^\s+/gm,"").replace(/\s+$/gm,"").replace(/[\r\n]/g,""),i}const o=new Map([["&","&amp;"],["<","&lt;"],[">","&gt;"],['"',"&quot;"],[" ","&nbsp;"]]);function r(t){return t.replace(/[&<>"\xA0]/g,(t=>{var e;return null!==(e=o.get(t))&&void 0!==e?e:""}))}function a(t,...e){let i=t[0];for(let n=0;n<e.length;n++){i+=r(String(e[n])),i+=t[n+1]}return i=i.replace(/^\s+/gm,"").replace(/\s+$/gm,"").replace(/[\r\n]/g,""),i}function l(t){const e=t.split("-");let i="";for(let t=0;t<e.length;t++){const n=e[t];i+=t>0?n.charAt(0).toUpperCase()+n.substring(1):n}return i}function d(t,e,i){return void 0===i&&(i=","),(i+t+i).indexOf(i+e+i)>=0}function c(t){const e=(new TextEncoder).encode(t);let i="";return e.forEach((t=>{i+=String.fromCharCode(t)})),window.btoa(i)}function h(t){const e=window.atob(t),i=new Uint8Array(e.length);for(let t=0;t<e.length;t++)i[t]=e.charCodeAt(t);return(new TextDecoder).decode(i)}function p(t){const e=Number.parseInt(t,10).toString(16).toLowerCase();return e.length>1?e:`0${e}`}function u(t){return t.replace(/rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+)\s*)?\)/gi,((t,e,i,n,s)=>void 0===s?`#${p(e)}${p(i)}${p(n)}`:`#${p(e)}${p(i)}${p(n)}${function(t){const e=Math.round(255*Number.parseFloat(t)).toString(16);return e.length>1?e:`0${e}`}(s)}`))}function m(t){t=t.replace(/&quot;/gi,'"');const e={},i=/\s*([\w-]+)\s*:([^;]*)(;|$)/g;let n;for(;null!==(n=i.exec(t));){const t=n[1].toLowerCase().trim(),i=u(n[2]).trim();e[t]=i}return e}function f(t){return t.replace(/(<lake-box[^>]+>)[\s\S]*?(<\/lake-box>|$)/gi,"$1</lake-box>").replace(/<anchor\s*\/>/gi,'<lake-bookmark type="anchor"></lake-bookmark>').replace(/<focus\s*\/>/gi,'<lake-bookmark type="focus"></lake-bookmark>')}function g(t){return t.replace(/(<lake-box[^>]+>)[\s\S]*?(<\/lake-box>)/gi,"$1$2").replace(/<lake-bookmark\s+type="anchor">\s*<\/lake-bookmark>/gi,"<anchor />").replace(/<lake-bookmark\s+type="focus">\s*<\/lake-bookmark>/gi,"<focus />")}function v(t,e){if("undefined"==typeof window)return t;const i=(e=null!=e?e:navigator.userAgent).indexOf("Mac OS X")>=0?"⌘":"Ctrl";return t.replace(/(^|\+|\s)mod(\+|\s|$)/g,`$1${i}$2`)}function w(t){let e=0;for(t/=1024;t>1024&&e<2;)t/=1024,e++;return`${t>0?Math.max(t,.1).toFixed(1):0} ${["KB","MB","GB"][e]}`}function y(t,e){const i=l(e),n=window.getComputedStyle(t,null);return u(t.style[i]||n.getPropertyValue(e)||"")}function x(t,e){const i=[];if("string"!=typeof t)return i.push(t),i;if(""===t)return i;if("text"===e){const e=document.createTextNode(t);return i.push(e),i}if("html"===e||/<.+>/.test(t)){const e=document.createElement("div");e.innerHTML=t;for(const t of e.childNodes)i.push(t);return i}const n=document.querySelectorAll(t);for(const t of n)i.push(t);return i}const b=new Set(["h1","h2","h3","h4","h5","h6","div","p","blockquote","ul","ol","li","table","tr","th","td"]),k=new Set(["span","strong","em","i","u","s","sup","sub","code"]),S=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),C=new Set(["h1","h2","h3","h4","h5","h6"]),_=new Set(["ol","ul","li"]),B=new Set(["table","tr","td"]);function A(...t){window.LAKE_DEBUG&&console.log.apply(console.log,t)}const T={};let E=0;class L{constructor(t){t=null!=t?t:[],this.nodeList=Array.isArray(t)?t:[t];for(let t=0;t<this.nodeList.length;t++)this.nodeList[t].lakeId||(this.nodeList[t].lakeId=++E);this.length=this.nodeList.length}get id(){return this.get(0).lakeId}get name(){if(0===this.length)return"";return this.get(0).nodeName.toLowerCase()}get isElement(){if(0===this.length)return!1;return this.get(0).nodeType===Node.ELEMENT_NODE}get isText(){if(0===this.length)return!1;return this.get(0).nodeType===Node.TEXT_NODE}get isBlock(){return 0!==this.length&&b.has(this.name)}get isMark(){return 0!==this.length&&k.has(this.name)}get isVoid(){return 0!==this.length&&S.has(this.name)}get isHeading(){return 0!==this.length&&C.has(this.name)}get isList(){return 0!==this.length&&_.has(this.name)}get isTable(){return 0!==this.length&&B.has(this.name)}get isBookmark(){return"lake-bookmark"===this.name}get isBox(){return"lake-box"===this.name}get isInlineBox(){return this.isBox&&"inline"===this.attr("type")}get isBlockBox(){return this.isBox&&"block"===this.attr("type")}get isContainer(){if(0===this.length)return!1;const t=this.get(0);return this.isElement&&"true"===t.getAttribute("contenteditable")}get isOutside(){return 0===this.closest('[contenteditable="true"]').length}get isInside(){return!this.isOutside&&!this.isContainer}get isTopInside(){if(0===this.length)return!1;const t=this.parent();return 0!==t.length&&(this.isInside&&t.isContainer)}get isContentEditable(){if(0===this.length)return!1;if(this.isText){const t=this.get(0).parentNode;return!!t&&t.isContentEditable}if(!this.isElement)return!1;return this.get(0).isContentEditable}get isIndivisible(){return this.isContainer||this.isTable}get isEmpty(){if(this.isBox)return!1;const t=this.text();if(!(""===t||/^[\r\n\u200B\u2060]+$/.test(t)))return!1;if(this.isElement){if(this.find("lake-box").length>0)return!1;if(this.find("br").length>1)return!1}return!0}isSibling(t){if(0===this.length)return!1;const e=this.get(0).parentNode;return e&&e===t.parent().get(0)}get(t){return this.nodeList[t]}getAll(){return this.nodeList}eq(t){const e=this.get(t);return new L(e)}each(t){const e=this.getAll();for(let i=0;i<e.length;i++)if(!1===t(e[i],i))return this;return this}eachElement(t){const e=this.getAll();for(let i=0;i<e.length;i++)if(e[i].nodeType===Node.ELEMENT_NODE&&!1===t(e[i],i))return this;return this}reverse(){const t=this.getAll().reverse();return new L(t)}matches(t){if(!this.isElement)return!1;return this.get(0).matches(t)}find(t){if("string"==typeof t){const e=this.get(0).querySelectorAll(t);return new L(Array.from(e))}let e=this.eq(0);for(const i of t)if(e=e.children()[i],!e)return new L;return e}closest(t){if(this.isText){const e=this.get(0).parentNode;return e?new L(e.closest(t)):new L}if(!this.isElement)return new L;const e=this.get(0);return new L(e.closest(t))}closestBlock(){let t=this.eq(0);for(;t.length>0&&!t.isTopInside&&!t.isBlock;)t=t.parent();return t.isBlock?t:new L}closestOperableBlock(){const t=this.closest("lake-box"),e=t.length>0?t.closestBlock():this.closestBlock();if(0===e.length)return e;if(e.isTable)return new L;const i=e.parent();return"li"===e.name&&i.isList?i:e}closestContainer(){return this.closest('div[contenteditable="true"]')}closestScroller(){let t=this.eq(0);for(;t.length>0&&t.isElement;){if(["scroll","auto"].indexOf(t.computedCSS("overflow-y"))>=0)return t;t=t.parent()}return new L}parent(){const t=this.get(0);return new L(t.parentNode)}prev(){const t=this.get(0);return new L(t.previousSibling)}next(){const t=this.get(0);return new L(t.nextSibling)}first(){const t=this.get(0);return new L(t.firstChild)}last(){const t=this.get(0);return new L(t.lastChild)}index(){let t=-1,e=this.get(0);for(;e;)t++,e=e.previousSibling;return t}path(){const t=[];let e=this.eq(0);if(e.isContainer)return t;for(;e.length>0;){const i=e.parent();if(0===i.length)break;if(t.push(e.index()),i.isContainer)break;e=i}return t.reverse()}children(){const t=[];let e=this.first();for(;e.length>0;)t.push(e),e=e.next();return t}*getWalker(){for(const t of function*t(e){if(e.isBox)return;let i=e.first();for(;i.length>0;){const e=i.next();yield i,yield*t(i),i=e}}(this.eq(0)))yield t}on(t,e){return this.eachElement((i=>{i.addEventListener(t,e,!1);const n=i.lakeId;T[n]||(T[n]=[]),T[n].push({type:t,listener:e})}))}off(t,e){return this.eachElement((i=>{var n;const s=i.lakeId,o=null!==(n=T[s])&&void 0!==n?n:[];for(let n=0;n<o.length;n++){const s=o[n];t&&(t!==s.type||e&&e!==s.listener)||(i.removeEventListener(s.type,s.listener,!1),o[n]={type:"",listener:()=>{}})}T[s]=o.filter((t=>""!==t.type))}))}emit(t,e){return this.eachElement((i=>{const n=i.lakeId,s=T[n];for(const i of s)i.type===t&&i.listener(null!=e?e:new Event(t))}))}getEventListeners(t){const e=this.get(t).lakeId;return T[e]}focus(){return this.get(0).focus(),this}blur(){return this.get(0).blur(),this}clone(t=!1){const e=this.get(0);return new L(e.cloneNode(t))}hasAttr(t){return this.get(0).hasAttribute(t)}attr(t,e){var i;if("object"==typeof t){for(const e of Object.keys(t))this.attr(e,t[e]);return this}if(void 0===e){return null!==(i=this.get(0).getAttribute(t))&&void 0!==i?i:""}return this.eachElement((i=>{i.setAttribute(t,e)}))}removeAttr(t){return this.eachElement((e=>{e.removeAttribute(t)}))}hasClass(t){return d(this.get(0).className,t," ")}addClass(t){if(Array.isArray(t)){for(const e of t)this.addClass(e);return this}return this.eachElement((e=>{d(e.className,t," ")||e.classList.add(t)}))}removeClass(t){if(Array.isArray(t)){for(const e of t)this.removeClass(e);return this}return this.eachElement((e=>{d(e.className,t," ")&&(e.classList.remove(t),""===e.className&&e.removeAttribute("class"))}))}computedCSS(t){return y(this.get(0),t)}css(t,e){if("object"==typeof t){for(const e of Object.keys(t))this.css(e,t[e]);return this}if(void 0===e){return u(this.get(0).style[l(t)])}return this.eachElement((i=>{i.style[l(t)]=e,""===i.getAttribute("style")&&i.removeAttribute("style")}))}width(){return this.get(0).offsetWidth}innerWidth(){const t=Number.parseInt(this.computedCSS("padding-left"),10)||0,e=Number.parseInt(this.computedCSS("padding-right"),10)||0;return this.width()-t-e}height(){return this.get(0).offsetHeight}show(t="block"){return this.css("display",t),this}hide(){return this.css("display","none"),this}html(t){if(void 0===t){return this.get(0).innerHTML}return this.eachElement((e=>{e.innerHTML=t}))}text(t){var e;if(void 0===t){const t=this.get(0);if(this.isText)return null!==(e=t.nodeValue)&&void 0!==e?e:"";return t.innerText.replace(/^\n+|\n+$/,"")}return this.eachElement((e=>{e.innerText=t}))}outerHTML(){return this.get(0).outerHTML}empty(){return this.html(""),this}prepend(t){const e=this.get(0);if("string"==typeof t){const i=x(t).reverse();for(const t of i)e.firstChild?e.insertBefore(t,e.firstChild):e.appendChild(t);return this}return t instanceof L&&(t=t.get(0)),e.firstChild?e.insertBefore(t,e.firstChild):e.appendChild(t),this}append(t){const e=this.get(0);if("string"==typeof t){const i=x(t);for(const t of i)e.appendChild(t);return this}return t instanceof L&&(t=t.get(0)),e.appendChild(t),this}before(t){const e=this.get(0);if(!e.parentNode)return this;if("string"==typeof t){const i=x(t);for(const t of i)e.parentNode.insertBefore(t,e);return this}return t instanceof L&&(t=t.get(0)),e.parentNode.insertBefore(t,e),this}after(t){const e=this.get(0);if(!e.parentNode)return this;if("string"==typeof t){const i=x(t).reverse();for(const t of i)e.nextSibling?e.parentNode.insertBefore(t,e.nextSibling):e.parentNode.appendChild(t);return this}return t instanceof L&&(t=t.get(0)),e.nextSibling?e.parentNode.insertBefore(t,e.nextSibling):e.parentNode.appendChild(t),this}replaceWith(t){const e=this.get(0);if(!e.parentNode)return this;let i;return i=t instanceof L?t.get(0):x(t)[0],e.parentNode.replaceChild(i,e),this}remove(t=!1){return this.each((e=>{if(e.parentNode){if(t){let t=e.firstChild;for(;t;){const i=t.nextSibling;e.parentNode.insertBefore(t,e),t=i}}e.parentNode.removeChild(e)}})),this}splitText(t){if(!this.isText)return new L;const e=this.get(0).splitText(t);return new L(e)}toString(){if(0===this.length)return"";const t=this.get(0);let e=this.isText?t.nodeValue:this.outerHTML();return e&&e.length>50&&(e=`${e.substring(0,50)} ...`),`node (${t.lakeId}): ${e}`}info(){A(this.toString())}}function I(t){if(t instanceof L)return t;const e=x(t);return new L(e)}class M{constructor(t){this.range=null!=t?t:document.createRange()}get startNode(){return new L(this.range.startContainer)}get startOffset(){return this.range.startOffset}get endNode(){return new L(this.range.endContainer)}get endOffset(){return this.range.endOffset}get commonAncestor(){return new L(this.range.commonAncestorContainer)}get isCollapsed(){return this.range.collapsed}get isBox(){return this.commonAncestor.closest("lake-box").length>0}get isBoxStart(){const t=this.commonAncestor.closest("lake-box");if(0===t.length)return!1;const e=t.find(".lake-box-container");return this.compareBeforeNode(e)>=0}get isBoxCenter(){const t=this.commonAncestor.closest("lake-box");if(0===t.length)return!1;const e=t.find(".lake-box-container");return this.isCollapsed&&this.startNode.get(0)===e.get(0)&&0===this.startOffset}get isBoxEnd(){const t=this.commonAncestor.closest("lake-box");if(0===t.length)return!1;const e=t.find(".lake-box-container");return this.compareAfterNode(e)<=0}get isInsideBox(){const t=this.commonAncestor.closest("lake-box");if(0===t.length)return!1;const e=t.find(".lake-box-container");return(!this.isCollapsed||this.startNode.get(0)!==e.get(0)||0!==this.startOffset)&&(this.compareBeforeNode(e)<0&&this.compareAfterNode(e)>0)}get isInoperative(){if(this.commonAncestor.isOutside)return!0;const t=this.startNode.closest("td"),e=this.endNode.closest("td");return t.length>0&&e.length>0&&t.get(0)!==e.get(0)}get(){return this.range}getRect(){const t=this.clone();let e,i,n;if(t.isCollapsed){let s="left";if(t.startNode.isElement){const e=t.startNode.children();0===e.length?t.selectNode(t.startNode):t.startOffset<e.length?t.setEnd(t.startNode,t.startOffset+1):(t.setStart(t.startNode,t.startOffset-1),s="right")}else if(t.startNode.isText){const e=t.startNode.text();t.startOffset<e.length?t.setEnd(t.startNode,t.startOffset+1):t.startOffset>0&&(t.setStart(t.startNode,t.startOffset-1),s="right")}e=t.get().getBoundingClientRect(),i="left"===s?e.x:e.right,n=1}else e=t.get().getBoundingClientRect(),i=e.x,n=e.width;const s=e.height;return DOMRect.fromRect({x:i,y:e.y,width:n>0?n:1,height:s>0?s:1})}comparePoint(t,e){return this.range.comparePoint(t.get(0),e)}compareBeforeNode(t){const e=new M;return t.isText?e.setStart(t,0):e.setStartBefore(t),e.collapseToStart(),this.comparePoint(e.startNode,e.startOffset)}compareAfterNode(t){var e;const i=new M;if(t.isText){const n=null!==(e=t.get(0).nodeValue)&&void 0!==e?e:"";i.setStart(t,n.length)}else i.setStartAfter(t);return i.collapseToStart(),this.comparePoint(i.startNode,i.startOffset)}intersectsNode(t){return this.range.intersectsNode(t.get(0))}setStart(t,e){this.range.setStart(t.get(0),e)}setStartBefore(t){this.range.setStartBefore(t.get(0))}setStartAfter(t){this.range.setStartAfter(t.get(0))}setEnd(t,e){this.range.setEnd(t.get(0),e)}setEndBefore(t){this.range.setEndBefore(t.get(0))}setEndAfter(t){this.range.setEndAfter(t.get(0))}collapseToStart(){this.range.collapse(!0)}collapseToEnd(){this.range.collapse(!1)}selectNode(t){this.range.selectNode(t.get(0))}selectNodeContents(t){this.range.selectNodeContents(t.get(0))}selectBox(t){const e=t.find(".lake-box-container");if(0===e.length)throw new Error(`The box cannot be selected because the box "${t.attr("name")}" (id=${t.id}) has not been rendered yet.`);this.setStart(e,0),this.collapseToStart()}selectBoxStart(t){const e=t.find(".lake-box-strip");if(0===e.length)throw new Error(`The box cannot be selected because the box "${t.attr("name")}" (id=${t.id}) has not been rendered yet.`);this.selectNodeContents(e.eq(0)),this.collapseToStart()}selectBoxEnd(t){const e=t.find(".lake-box-strip");if(0===e.length)throw new Error(`The box cannot be selected because the box "${t.attr("name")}" (id=${t.id}) has not been rendered yet.`);this.selectNodeContents(e.eq(1)),this.collapseToStart()}shrinkBefore(t){if(t.isBox)return void this.selectBoxStart(t);if(t.isText)return this.setStartBefore(t),void this.collapseToStart();let e;for(this.setStart(t,0);this.startNode.isElement&&(e=this.startNode.children()[0])&&e.isElement&&!e.isVoid;){if(e.isBox)return void this.selectBoxStart(e);this.setStart(e,0)}this.collapseToStart()}shrinkAfter(t){if(t.isBox)return void this.selectBoxEnd(t);if(t.isText)return this.setEndAfter(t),void this.collapseToEnd();let e;for(this.setEnd(t,t.children().length);this.endNode.isElement&&this.endOffset>0&&(e=this.endNode.children()[this.endOffset-1])&&e.isElement&&!e.isVoid;){if(e.isBox)return void this.selectBoxEnd(e);this.setEnd(e,e.children().length)}this.collapseToEnd()}shrink(){const t=this.isCollapsed;let e;for(;this.startNode.isElement&&(e=this.startNode.children()[this.startOffset])&&e.isElement&&!e.isVoid&&!e.isBox;)this.setStart(e,0);if(t)this.collapseToStart();else for(;this.endNode.isElement&&this.endOffset>0&&(e=this.endNode.children()[this.endOffset-1])&&e.isElement&&!e.isVoid&&!e.isBox;)this.setEnd(e,e.children().length)}adjustBox(){const t=this.startNode.closest("lake-box");if(t.length>0){const e=this.clone();e.collapseToStart(),e.isBoxEnd?this.setStartAfter(t):this.setStartBefore(t)}const e=this.endNode.closest("lake-box");if(e.length>0){const t=this.clone();t.collapseToEnd(),t.isBoxStart?this.setEndBefore(e):this.setEndAfter(e)}}adjustTable(){const t=this.startNode.closest("table"),e=this.endNode.closest("table");if(0===t.length&&e.length>0&&e.isInside)return this.setEndBefore(e),void this.shrink();0===e.length&&t.length>0&&t.isInside&&(this.setStartAfter(t),this.shrink())}adjustBlock(){if(!this.isCollapsed){if(this.endNode.isElement&&0===this.endOffset){let t=this.endNode;for(;0===t.prev().length;)t=t.parent();this.setEndBefore(t)}return void this.shrink()}if(this.startNode.isText)return;const t=this.startNode.children()[this.startOffset];t&&(t.isBlockBox||t.isBlock)&&this.shrinkBefore(t)}adjust(){this.adjustBox(),this.adjustTable(),this.adjustBlock()}getPrevNode(){let t;return t=this.startNode.isText?0===this.startOffset?this.startNode.prev():this.startNode:this.startNode.children()[this.startOffset-1],null!=t?t:new L}getNextNode(){let t;return t=this.endNode.isText?this.endOffset===this.endNode.text().length?this.endNode.next():this.endNode:this.endNode.children()[this.endOffset],null!=t?t:new L}getBoxes(){if(this.isCollapsed){const t=this.startNode.closest("lake-box");return t.length>0?[t]:[]}const t=[],e=this.clone();e.adjustBox();for(const i of e.commonAncestor.getWalker())i.isBox&&e.intersectsNode(i)&&t.push(i);return t}getBlocks(){if(this.isCollapsed){const t=this.startNode.closestOperableBlock();return t.isTable?[]:t.isInside?[t]:[]}const t=this.startNode.closestOperableBlock(),e=this.endNode.closestOperableBlock();if(t.isInside&&t.get(0)&&t.get(0)===e.get(0))return t.isTable?[]:[t];const i=[],n=this.clone();n.collapseToEnd();for(const t of this.commonAncestor.getWalker())t.isBlock&&!t.isTable&&t.isTopInside&&0!==n.comparePoint(t,0)&&this.intersectsNode(t)&&i.push(t);if(i.length>0)return i;for(const n of this.commonAncestor.getWalker())n.isBlock&&!n.isTable&&(t.isSibling(n)||e.isSibling(n))&&this.intersectsNode(n)&&i.push(n);return i}getMarks(t=!1){const e=[];if(this.commonAncestor.isText&&t&&0===this.startOffset&&this.endOffset===this.commonAncestor.text().length)return e.push(this.commonAncestor),e;const i=this.clone();i.collapseToStart();const n=this.clone();n.collapseToEnd();for(const s of this.commonAncestor.getWalker()){const o=document.createRange();if(o.setStartAfter(s.get(0)),o.collapse(!0),n.compareBeforeNode(s)>=0)break;i.compareAfterNode(s)>0&&(s.isMark||s.isText&&t)&&e.push(s)}return e}getStartText(){const t=this.startNode,e=this.startOffset;let i=t.closestBlock();if(i.isOutside&&(i=t.closestContainer()),0===i.length)return"";const n=new M;n.setStartBefore(i),n.setEnd(t,e);const s=I("<div />");s.append(n.cloneContents());const o=s.text();return""===o&&s.find("lake-box").length>0?"​":o}getEndText(){const t=this.endNode,e=this.endOffset;let i=t.closestBlock();if(i.isOutside&&(i=t.closestContainer()),0===i.length)return"";const n=new M;n.setStart(t,e),n.setEndAfter(i);const s=I("<div />");s.append(n.cloneContents());const o=s.text();return""===o&&s.find("lake-box").length>0?"​":o}clone(){return new M(this.range.cloneRange())}cloneContents(){return this.range.cloneContents()}info(){A("--- range information ---"),A("start node:",this.startNode.toString(),", offset:",this.startOffset),A("end node:",this.endNode.toString(),", offset:",this.endOffset)}}function P(t,e,i){const n=new M;let s;if(t.isText){s=t.parent();const i=t.splitText(e);n.setStartAfter(t),""===t.text()&&t.remove(),""===i.text()&&i.remove()}else n.setStart(t,e),s=t;if("body"===s.name||"html"===s.name)return null;if(s.get(0)===i.get(0))return null;n.collapseToStart();const o=s.clone();let r=s.first();for(;r.length>0&&!(n.compareBeforeNode(r)>=0);){const t=r.next();o.append(r),r=t}return s.before(o),s.parent().length>0&&s.parent().get(0)!==i.get(0)?P(s.parent(),s.index(),i):{start:o,end:s}}function Z(t,e){let i=t;for(;i.length>0;){let t=i.first();for(;t.isText&&t.isEmpty;)t=t.next();if(i.isText||i.isBox)break;if(i.isElement&&1===i.children().length&&t.isBookmark){i.prepend(e);break}if(i.isElement&&!i.isVoid&&0===t.length){i.append(e);break}i=t}}function N(t){if(0===t.length)return;const e=[];let i=t.first();for(;i.length>0;){const t=i.next();i.isText&&""===i.text()||e.push(i),i=t}(1===e.length&&"br"===e[0].name||2===e.length&&"br"===e[0].name&&e[1].isBookmark)&&e[0].remove(),2===e.length&&e[0].isBookmark&&"br"===e[1].name&&e[1].remove()}function O(t){if(t.isText)return{node:t,offset:t.text().length};const e=new M;return e.setEndAfter(t),{node:e.endNode,offset:e.endOffset}}function z(t,e){const i=e;if(["ul","ol"].indexOf(t.name)>=0){const e=t.find("li");t=e.eq(e.length-1)}if(["ul","ol"].indexOf(e.name)>=0){const t=e.find("li");e=t.eq(0)}if(t.isText||e.isText||t.isVoid||e.isVoid)return O(t);N(t),N(e),t.isBlock&&t.isEmpty&&e.isEmpty&&Z(t,I("<br />"));const n=t.last(),s=e.first();let o=s;for(;o.length>0;){const e=o.next();t.append(o),o=e}return i.remove(),n.length>0&&s.length>0&&n.isElement&&!n.isBox&&n.clone(!1).get(0).isEqualNode(s.clone(!1).get(0))?z(n,s):0===n.length?{node:t,offset:0}:O(n)}function H(t){let e=t;for(;e.length>0;){let t=e.first();if(t.isText&&t.isEmpty&&(t=t.next()),e.isElement&&!e.isVoid&&0===t.length)break;e=t}return e}function $(t,e){if(e=null!=e?e:I("<p />"),0===t.length)return e;const i=H(e=e.clone(!0));t[0].before(e);for(const e of t)i.append(e);return e}function D(t){for(const e of t.getWalker())if(e.isText){const t=e.text();""===t?e.remove():t.length>1&&/\u200B/.test(t)&&(e.get(0).nodeValue=t.replace(/\u200B/g,""))}}function V(t,e){const i=t.get(0),n=I(a`<${e} />`);for(const t of i.attributes)n.attr(t.name,t.value);let s=t.first();for(;s.length>0;){const t=s.next();n.append(s),s=t}return t.replaceWith(n),n}function F(t){if(0===t.length)return;const e=t[0],i=t[t.length-1],n=[];let s=e.prev();for(;s.length>0&&"ol"===s.name;)n.push(s),s=s.prev();n.reverse(),n.push(...t);let o=i.next();for(;o.length>0&&"ol"===o.name;)n.push(o),o=o.next();let r=1;for(const t of n){const e=t.prev();if(0!==e.length&&"ol"===e.name||(r=1),"ol"===t.name){"ol"===e.name&&e.attr("indent")!==t.attr("indent")&&(r=1);const i=t.attr("start"),n=r.toString(10);i!==n&&t.attr("start",n),r++}}}function R(t,e){if(t.isList){let i=Number.parseInt(t.attr("indent"),10)||0;if("increase"===e?i++:i--,i<=0)i=0;else if(i>10)return;return 0===i?t.removeAttr("indent"):t.attr("indent",i.toString(10)),void F([t])}let i=Number.parseInt(t.css("margin-left"),10)||0;"decrease"!==e||0!==i||""===t.css("text-indent")?("increase"===e?i+=40:i-=40,i<=0&&(i=0),0===i?t.css("margin-left",""):t.css("margin-left",`${i}px`)):t.css("text-indent","")}const j=new Set;function W(){}const q={morphStyle:"outerHTML",callbacks:{beforeNodeAdded:W,afterNodeAdded:W,beforeNodeMorphed:W,afterNodeMorphed:W,beforeNodeRemoved:W,afterNodeRemoved:W,beforeAttributeUpdated:W,afterAttributeUpdated:W,beforeChildrenUpdated:W},head:{style:"merge",shouldPreserve:t=>"true"===t.getAttribute("im-preserve"),shouldReAppend:t=>"true"===t.getAttribute("im-re-append"),shouldRemove:W,afterHeadMorphed:W}};function U(t,e){return!t.deadIds.has(e)}function K(t,e,i){return(t.idMap.get(i)||j).has(e)}function G(t,e){const i=t.idMap.get(e)||j;for(const e of i)t.deadIds.add(e)}function X(t,e,i){const n=t.idMap.get(e)||j;let s=0;for(const e of n)U(t,e)&&K(t,e,i)&&++s;return s}function Y(t,e){const i=t.parentElement,n=t.querySelectorAll("[id]");for(const t of n){let n=t;for(;n!==i&&null!=n;){let i=e.get(n);null==i&&(i=new Set,e.set(n,i)),i.add(t.id),n=n.parentElement}}}function J(t,e){const i=new Map;return Y(t,i),Y(e,i),i}function Q(t,e,i){return{target:t,newContent:e,config:i=function(t){const e={};return Object.assign(e,q),Object.assign(e,t),e.callbacks={},Object.assign(e.callbacks,q.callbacks),Object.assign(e.callbacks,t.callbacks),e.head={},Object.assign(e.head,q.head),Object.assign(e.head,t.head),e}(i),morphStyle:i.morphStyle,ignoreActive:i.ignoreActive,ignoreActiveValue:i.ignoreActiveValue,idMap:J(t,e),deadIds:new Set,callbacks:i.callbacks,head:i.head}}function tt(t,e,i){return null!=t&&null!=e&&(t.nodeType===e.nodeType&&t.tagName===e.tagName&&(""!==t.id&&t.id===e.id||X(i,t,e)>0))}function et(t,e){return null!=t&&null!=e&&(t.nodeType===e.nodeType&&t.tagName===e.tagName)}function it(t,e){G(e,t),!1!==e.callbacks.beforeNodeRemoved(t)&&(t.remove(),e.callbacks.afterNodeRemoved(t))}function nt(t,e,i){let n=t;for(;n&&n!==e;){const t=n;n=n.nextSibling,it(t,i)}return G(i,e),e.nextSibling}function st(t,e,i,n,s){const o=X(s,i,e);let r=null;if(o>0){r=n;let e=0;for(;null!=r;){if(tt(i,r,s))return r;if(e+=X(s,r,t),e>o)return null;r=r.nextSibling}}return r}function ot(t,e,i,n,s){let o=n,r=i.nextSibling,a=0;for(;null!=o;){if(X(s,o,t)>0)return null;if(et(i,o))return o;if(et(r,o)&&(a++,r=r?r.nextSibling:null,a>=2))return null;o=o?o.nextSibling:null}return o}function rt(t,e,i){return et(t,e)?.5+X(i,t,e):0}function at(t,e,i,n){return!("value"!==t||!n.ignoreActiveValue||e!==document.activeElement)||!1===n.callbacks.beforeAttributeUpdated(t,e,i)}function lt(t,e,i){var n;if(!i.ignoreActive||t!==document.activeElement)return null==e?!1===i.callbacks.beforeNodeRemoved(t)?t:(t.remove(),i.callbacks.afterNodeRemoved(t),null):et(t,e)?(!1===i.callbacks.beforeNodeMorphed(t,e)||(function(t,e,i){const n=t.nodeType;if(1===n){const n=t.attributes,s=e.attributes;for(const t of n)at(t.name,e,"update",i)||e.getAttribute(t.name)!==t.value&&(e.setAttribute(t.name,t.value),i.callbacks.afterAttributeUpdated(t.name,e,"update"));for(let n=s.length-1;n>=0;n--){const o=s[n];at(o.name,e,"remove",i)||t.hasAttribute(o.name)||(e.removeAttribute(o.name),i.callbacks.afterAttributeUpdated(o.name,e,"remove"))}}8!==n&&3!==n||e.nodeValue!==t.nodeValue&&(e.nodeValue=t.nodeValue)}(e,t,i),!1===i.callbacks.beforeChildrenUpdated(t,e)||function(t,e){return e.ignoreActiveValue&&t===document.activeElement}(t,i)||dt(e,t,i),i.callbacks.afterNodeMorphed(t,e)),t):!1===i.callbacks.beforeNodeRemoved(t)||!1===i.callbacks.beforeNodeAdded(e)?t:(null===(n=t.parentElement)||void 0===n||n.replaceChild(e,t),i.callbacks.afterNodeAdded(e),i.callbacks.afterNodeRemoved(t),e)}function dt(t,e,i){let n,s=t.firstChild,o=e.firstChild;for(;s;){if(n=s,s=n.nextSibling,null==o){if(!1===i.callbacks.beforeNodeAdded(n))return;e.appendChild(n),i.callbacks.afterNodeAdded(n),G(i,n);continue}if(tt(n,o,i)){lt(o,n,i),o=o.nextSibling,G(i,n);continue}const r=st(t,e,n,o,i);if(r){o=nt(o,r,i),lt(r,n,i),G(i,n);continue}const a=ot(t,0,n,o,i);if(a)o=nt(o,a,i),lt(a,n,i),G(i,n);else{if(!1===i.callbacks.beforeNodeAdded(n))return;e.insertBefore(n,o),i.callbacks.afterNodeAdded(n),G(i,n)}}for(;null!==o;){const t=o;o=o.nextSibling,it(t,i)}}function ct(t,e,i){if("innerHTML"===i.morphStyle)return dt(e,t,i),t.children;if("outerHTML"===i.morphStyle||null==i.morphStyle){const n=function(t,e,i){let n;n=t.firstChild;let s=n,o=0;for(;n;){const t=rt(n,e,i);t>o&&(s=n,o=t),n=n.nextSibling}return s}(e,t,i),s=null==n?void 0:n.previousSibling,o=null==n?void 0:n.nextSibling,r=lt(t,n,i);return n?function(t,e,i){var n,s;const o=[],r=[];let a=t;for(;null!=a;)o.push(a),a=a.previousSibling;for(;o.length>0;){const t=o.pop();r.push(t),t&&(null===(n=e.parentElement)||void 0===n||n.insertBefore(t,e))}r.push(e);let l=i;for(;null!=l;)o.push(l),r.push(l),l=l.nextSibling;for(;o.length>0;){const t=o.pop();t&&(null===(s=e.parentElement)||void 0===s||s.insertBefore(t,e.nextSibling))}return r}(s,r,o):[]}throw`Do not understand how to morph style ${i.morphStyle}`}function ht(t,e,i={}){const n=function(t){if(null==t)return document.createElement("div");if(t instanceof Node){if(t.generatedByIdiomorph)return t;const e=document.createElement("div");return e.append(t),e}const e=document.createElement("div");for(const i of[...t])e.append(i);return e}(e.get(0)),s=Q(t.get(0),n,i);ct(t.get(0),n,s)}function pt(t){const e=t.get(0).getBoundingClientRect();let i=e.left,n=e.right,s=e.top,o=e.bottom,r=window.innerWidth,a=window.innerHeight;const l=t.closestScroller();if(l.length>0){const t=l.get(0).getBoundingClientRect(),e=t.x,d=t.y;i-=e,n-=e,s-=d,o-=d,r=t.width,a=t.height}return{left:i,right:r-n,top:s,bottom:a-o}}const ut=new Map;function mt(t){let e=ut.get(t);return e||(e=new Map,ut.set(t,e),e)}function ft(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var gt={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,i="~";function n(){}function s(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function o(t,e,n,o,r){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new s(n,o||t,r),l=i?i+e:e;return t._events[l]?t._events[l].fn?t._events[l]=[t._events[l],a]:t._events[l].push(a):(t._events[l]=a,t._eventsCount++),t}function r(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),a.prototype.eventNames=function(){var t,n,s=[];if(0===this._eventsCount)return s;for(n in t=this._events)e.call(t,n)&&s.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(t)):s},a.prototype.listeners=function(t){var e=i?i+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var s=0,o=n.length,r=new Array(o);s<o;s++)r[s]=n[s].fn;return r},a.prototype.listenerCount=function(t){var e=i?i+t:t,n=this._events[e];return n?n.fn?1:n.length:0},a.prototype.emit=function(t,e,n,s,o,r){var a=i?i+t:t;if(!this._events[a])return!1;var l,d,c=this._events[a],h=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),h){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,n),!0;case 4:return c.fn.call(c.context,e,n,s),!0;case 5:return c.fn.call(c.context,e,n,s,o),!0;case 6:return c.fn.call(c.context,e,n,s,o,r),!0}for(d=1,l=new Array(h-1);d<h;d++)l[d-1]=arguments[d];c.fn.apply(c.context,l)}else{var p,u=c.length;for(d=0;d<u;d++)switch(c[d].once&&this.removeListener(t,c[d].fn,void 0,!0),h){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,e);break;case 3:c[d].fn.call(c[d].context,e,n);break;case 4:c[d].fn.call(c[d].context,e,n,s);break;default:if(!l)for(p=1,l=new Array(h-1);p<h;p++)l[p-1]=arguments[p];c[d].fn.apply(c[d].context,l)}}return!0},a.prototype.on=function(t,e,i){return o(this,t,e,i,!1)},a.prototype.once=function(t,e,i){return o(this,t,e,i,!0)},a.prototype.removeListener=function(t,e,n,s){var o=i?i+t:t;if(!this._events[o])return this;if(!e)return r(this,o),this;var a=this._events[o];if(a.fn)a.fn!==e||s&&!a.once||n&&a.context!==n||r(this,o);else{for(var l=0,d=[],c=a.length;l<c;l++)(a[l].fn!==e||s&&!a[l].once||n&&a[l].context!==n)&&d.push(a[l]);d.length?this._events[o]=1===d.length?d[0]:d:r(this,o)}return this},a.prototype.removeAllListeners=function(t){var e;return t?(e=i?i+t:t,this._events[e]&&r(this,e)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=i,a.EventEmitter=a,t.exports=a}(gt);var vt=ft(gt.exports);const wt=new Map,yt=new Map;class xt{constructor(t){this.config=t,this.root=t.root,this.node=I(a`
1
+ var Lake=function(t){"use strict";class e extends HTMLElement{}void 0!==customElements.get("lake-box")&&customElements.define("lake-box",e);class i extends HTMLElement{}void 0!==customElements.get("lake-bookmark")&&customElements.define("lake-bookmark",i);const n=new Map([["plus",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm48-88a8,8,0,0,1-8,8H136v32a8,8,0,0,1-16,0V136H88a8,8,0,0,1,0-16h32V88a8,8,0,0,1,16,0v32h32A8,8,0,0,1,176,128Z"></path></svg>'],["more",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M112,60a16,16,0,1,1,16,16A16,16,0,0,1,112,60Zm16,52a16,16,0,1,0,16,16A16,16,0,0,0,128,112Zm0,68a16,16,0,1,0,16,16A16,16,0,0,0,128,180Z"></path></svg>'],["left",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M165.66,202.34a8,8,0,0,1-11.32,11.32l-80-80a8,8,0,0,1,0-11.32l80-80a8,8,0,0,1,11.32,11.32L91.31,128Z"></path></svg>'],["right",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z"></path></svg>'],["down",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M216.49,104.49l-80,80a12,12,0,0,1-17,0l-80-80a12,12,0,0,1,17-17L128,159l71.51-71.52a12,12,0,0,1,17,17Z"></path></svg>'],["check",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"></path></svg>'],["checkCircle",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"></path></svg>'],["warningCircle",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm-8-80V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,172Z"></path></svg>'],["file",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Z"></path></svg>'],["open",'<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6.25 4.5A1.75 1.75 0 0 0 4.5 6.25v11.5c0 .966.783 1.75 1.75 1.75h11.5a1.75 1.75 0 0 0 1.75-1.75v-4a.75.75 0 0 1 1.5 0v4A3.25 3.25 0 0 1 17.75 21H6.25A3.25 3.25 0 0 1 3 17.75V6.25A3.25 3.25 0 0 1 6.25 3h4a.75.75 0 0 1 0 1.5h-4ZM13 3.75a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 .75.75v6.5a.75.75 0 0 1-1.5 0V5.56l-5.22 5.22a.75.75 0 0 1-1.06-1.06l5.22-5.22h-4.69a.75.75 0 0 1-.75-.75Z" fill="#000000"/></svg>'],["download",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z"></path></svg>'],["copy",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"></path></svg>'],["remove",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"></path></svg>'],["maximize",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M200,80v32a8,8,0,0,1-16,0V88H160a8,8,0,0,1,0-16h32A8,8,0,0,1,200,80ZM96,168H72V144a8,8,0,0,0-16,0v32a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16ZM232,56V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56ZM216,200V56H40V200H216Z"></path></svg>'],["close",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"></path></svg>'],["zoomIn",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M152,112a8,8,0,0,1-8,8H120v24a8,8,0,0,1-16,0V120H80a8,8,0,0,1,0-16h24V80a8,8,0,0,1,16,0v24h24A8,8,0,0,1,152,112Zm77.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88.11,88.11,0,1,1,11.31-11.31l50.07,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z"></path></svg>'],["zoomOut",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M152,112a8,8,0,0,1-8,8H80a8,8,0,0,1,0-16h64A8,8,0,0,1,152,112Zm77.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88.11,88.11,0,1,1,11.31-11.31l50.07,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z"></path></svg>'],["circleNotch",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60.15,61.59,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20.15-66.41-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z"></path></svg>'],["selectAll",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M104,40a8,8,0,0,1,8-8h32a8,8,0,0,1,0,16H112A8,8,0,0,1,104,40Zm40,168H112a8,8,0,0,0,0,16h32a8,8,0,0,0,0-16ZM208,32H184a8,8,0,0,0,0,16h24V72a8,8,0,0,0,16,0V48A16,16,0,0,0,208,32Zm8,72a8,8,0,0,0-8,8v32a8,8,0,0,0,16,0V112A8,8,0,0,0,216,104Zm0,72a8,8,0,0,0-8,8v24H184a8,8,0,0,0,0,16h24a16,16,0,0,0,16-16V184A8,8,0,0,0,216,176ZM40,152a8,8,0,0,0,8-8V112a8,8,0,0,0-16,0v32A8,8,0,0,0,40,152Zm32,56H48V184a8,8,0,0,0-16,0v24a16,16,0,0,0,16,16H72a8,8,0,0,0,0-16ZM40,80a8,8,0,0,0,8-8V48H72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,48V72A8,8,0,0,0,40,80ZM176,184H80a8,8,0,0,1-8-8V80a8,8,0,0,1,8-8h96a8,8,0,0,1,8,8v96A8,8,0,0,1,176,184Zm-8-96H88v80h80Z"></path></svg>'],["undo",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M232,144a64.07,64.07,0,0,1-64,64H80a8,8,0,0,1,0-16h88a48,48,0,0,0,0-96H51.31l34.35,34.34a8,8,0,0,1-11.32,11.32l-48-48a8,8,0,0,1,0-11.32l48-48A8,8,0,0,1,85.66,45.66L51.31,80H168A64.07,64.07,0,0,1,232,144Z"></path></svg>'],["redo",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M170.34,130.34,204.69,96H88a48,48,0,0,0,0,96h88a8,8,0,0,1,0,16H88A64,64,0,0,1,88,80H204.69L170.34,45.66a8,8,0,0,1,11.32-11.32l48,48a8,8,0,0,1,0,11.32l-48,48a8,8,0,0,1-11.32-11.32Z"></path></svg>'],["heading",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M208,56V200a8,8,0,0,1-16,0V136H64v64a8,8,0,0,1-16,0V56a8,8,0,0,1,16,0v64H192V56a8,8,0,0,1,16,0Z"></path></svg>'],["heading1",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M152,56V176a8,8,0,0,1-16,0V124H48v52a8,8,0,0,1-16,0V56a8,8,0,0,1,16,0v52h88V56a8,8,0,0,1,16,0Zm75.77,49a8,8,0,0,0-8.21.39l-24,16a8,8,0,1,0,8.88,13.32L216,127V208a8,8,0,0,0,16,0V112A8,8,0,0,0,227.77,105Z"></path></svg>'],["heading2",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M152,56V176a8,8,0,0,1-16,0V124H48v52a8,8,0,0,1-16,0V56a8,8,0,0,1,16,0v52h88V56a8,8,0,0,1,16,0Zm88,144H208l33.55-44.74a32,32,0,1,0-55.73-29.93,8,8,0,1,0,15.08,5.34,16.28,16.28,0,0,1,2.32-4.3,16,16,0,1,1,25.54,19.27L185.6,203.2A8,8,0,0,0,192,216h48a8,8,0,0,0,0-16Z"></path></svg>'],["heading3",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M152,56V176a8,8,0,0,1-16,0V124H48v52a8,8,0,0,1-16,0V56a8,8,0,0,1,16,0v52h88V56a8,8,0,0,1,16,0Zm73.52,90.63,21-30A8,8,0,0,0,240,104H192a8,8,0,0,0,0,16h32.63l-19.18,27.41A8,8,0,0,0,212,160a20,20,0,1,1-14.29,34,8,8,0,1,0-11.42,11.19A36,36,0,0,0,248,180,36.07,36.07,0,0,0,225.52,146.63Z"></path></svg>'],["heading4",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M152,56V176a8,8,0,0,1-16,0V124H48v52a8,8,0,0,1-16,0V56a8,8,0,0,1,16,0v52h88V56a8,8,0,0,1,16,0Zm96,112h-8V144a8,8,0,0,0-16,0v24H195.1l20.49-61.47a8,8,0,0,0-15.18-5.06l-24,72A8,8,0,0,0,184,184h40v24a8,8,0,0,0,16,0V184h8a8,8,0,0,0,0-16Z"></path></svg>'],["heading5",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M152,56V176a8,8,0,0,1-16,0V124H48v52a8,8,0,0,1-16,0V56a8,8,0,0,1,16,0v52h88V56a8,8,0,0,1,16,0Zm60,88a38.8,38.8,0,0,0-9.41,1.14L206.78,120H240a8,8,0,0,0,0-16H200a8,8,0,0,0-7.89,6.68l-8,48a8,8,0,0,0,13.6,6.92A19.73,19.73,0,0,1,212,160a20,20,0,0,1,0,40,19.73,19.73,0,0,1-14.29-5.6,8,8,0,1,0-11.42,11.2A35.54,35.54,0,0,0,212,216a36,36,0,0,0,0-72Z"></path></svg>'],["heading6",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M152,56V176a8,8,0,0,1-16,0V124H48v52a8,8,0,0,1-16,0V56a8,8,0,0,1,16,0v52h88V56a8,8,0,0,1,16,0Zm96,124a36,36,0,1,1-67.34-17.68c.07-.14.14-.28.22-.42l32.25-54a8,8,0,0,1,13.74,8.2l-16.69,28c.6,0,1.21-.05,1.82-.05A36,36,0,0,1,248,180Zm-16,0a20,20,0,1,0-20,20A20,20,0,0,0,232,180Z"></path></svg>'],["paragraph",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M208,40H96a64,64,0,0,0,0,128h40v40a8,8,0,0,0,16,0V56h24V208a8,8,0,0,0,16,0V56h16a8,8,0,0,0,0-16ZM136,152H96a48,48,0,0,1,0-96h40Z"></path></svg>'],["blockQuote",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M100,56H40A16,16,0,0,0,24,72v64a16,16,0,0,0,16,16h60v8a32,32,0,0,1-32,32,8,8,0,0,0,0,16,48.05,48.05,0,0,0,48-48V72A16,16,0,0,0,100,56Zm0,80H40V72h60ZM216,56H156a16,16,0,0,0-16,16v64a16,16,0,0,0,16,16h60v8a32,32,0,0,1-32,32,8,8,0,0,0,0,16,48.05,48.05,0,0,0,48-48V72A16,16,0,0,0,216,56Zm0,80H156V72h60Z"></path></svg>'],["list",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M88,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H96A8,8,0,0,1,88,64Zm128,56H96a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Zm0,64H96a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16ZM56,56H40a8,8,0,0,0,0,16H56a8,8,0,0,0,0-16Zm0,64H40a8,8,0,0,0,0,16H56a8,8,0,0,0,0-16Zm0,64H40a8,8,0,0,0,0,16H56a8,8,0,0,0,0-16Z"></path></svg>'],["numberedList",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M224,128a8,8,0,0,1-8,8H104a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128ZM104,72H216a8,8,0,0,0,0-16H104a8,8,0,0,0,0,16ZM216,184H104a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16ZM43.58,55.16,48,52.94V104a8,8,0,0,0,16,0V40a8,8,0,0,0-11.58-7.16l-16,8a8,8,0,0,0,7.16,14.32ZM79.77,156.72a23.73,23.73,0,0,0-9.6-15.95,24.86,24.86,0,0,0-34.11,4.7,23.63,23.63,0,0,0-3.57,6.46,8,8,0,1,0,15,5.47,7.84,7.84,0,0,1,1.18-2.13,8.76,8.76,0,0,1,12-1.59A7.91,7.91,0,0,1,63.93,159a7.64,7.64,0,0,1-1.57,5.78,1,1,0,0,0-.08.11L33.59,203.21A8,8,0,0,0,40,216H72a8,8,0,0,0,0-16H56l19.08-25.53A23.47,23.47,0,0,0,79.77,156.72Z"></path></svg>'],["bulletedList",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M80,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H88A8,8,0,0,1,80,64Zm136,56H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Zm0,64H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16ZM44,52A12,12,0,1,0,56,64,12,12,0,0,0,44,52Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,116Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,180Z"></path></svg>'],["checklist",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M224,128a8,8,0,0,1-8,8H128a8,8,0,0,1,0-16h88A8,8,0,0,1,224,128ZM128,72h88a8,8,0,0,0,0-16H128a8,8,0,0,0,0,16Zm88,112H128a8,8,0,0,0,0,16h88a8,8,0,0,0,0-16ZM82.34,42.34,56,68.69,45.66,58.34A8,8,0,0,0,34.34,69.66l16,16a8,8,0,0,0,11.32,0l32-32A8,8,0,0,0,82.34,42.34Zm0,64L56,132.69,45.66,122.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32,0l32-32a8,8,0,0,0-11.32-11.32Zm0,64L56,196.69,45.66,186.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32,0l32-32a8,8,0,0,0-11.32-11.32Z"></path></svg>'],["alignLeft",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64Zm8,48H168a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Zm176,24H40a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Zm-48,40H40a8,8,0,0,0,0,16H168a8,8,0,0,0,0-16Z"></path></svg>'],["alignCenter",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64ZM64,96a8,8,0,0,0,0,16H192a8,8,0,0,0,0-16Zm152,40H40a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Zm-24,40H64a8,8,0,0,0,0,16H192a8,8,0,0,0,0-16Z"></path></svg>'],["alignRight",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64ZM216,96H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Zm0,40H40a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Zm0,40H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Z"></path></svg>'],["alignJustify",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64ZM216,96H40a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Zm0,40H40a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Zm0,40H40a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Z"></path></svg>'],["increaseIndent",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M224,128a8,8,0,0,1-8,8H112a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128ZM112,72H216a8,8,0,0,0,0-16H112a8,8,0,0,0,0,16ZM216,184H40a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16ZM34.34,141.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0,0-11.32l-40-40A8,8,0,0,0,34.34,61.66L68.69,96,34.34,130.34A8,8,0,0,0,34.34,141.66Z"></path></svg>'],["decreaseIndent",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M224,128a8,8,0,0,1-8,8H112a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128ZM112,72H216a8,8,0,0,0,0-16H112a8,8,0,0,0,0,16ZM216,184H40a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16ZM72,144a8,8,0,0,0,5.66-13.66L43.31,96,77.66,61.66A8,8,0,0,0,66.34,50.34l-40,40a8,8,0,0,0,0,11.32l40,40A8,8,0,0,0,72,144Z"></path></svg>'],["formatPainter",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M232,88H216V64a16,16,0,0,0-16-16H48A16,16,0,0,0,32,64V88H16a8,8,0,0,0,0,16H32v24a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V104h16v50L131.6,182.65A16.07,16.07,0,0,0,120,198v34a8,8,0,0,0,16,0V198l100.4-28.68A16.07,16.07,0,0,0,248,154V104A16,16,0,0,0,232,88Zm-32,40H48V64H200v64Z"></path></svg>'],["bold",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M170.48,115.7A44,44,0,0,0,140,40H72a8,8,0,0,0-8,8V200a8,8,0,0,0,8,8h80a48,48,0,0,0,18.48-92.3ZM80,56h60a28,28,0,0,1,0,56H80Zm72,136H80V128h72a32,32,0,0,1,0,64Z"></path></svg>'],["italic",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M200,56a8,8,0,0,1-8,8H157.77L115.1,192H144a8,8,0,0,1,0,16H64a8,8,0,0,1,0-16H98.23L140.9,64H112a8,8,0,0,1,0-16h80A8,8,0,0,1,200,56Z"></path></svg>'],["underline",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M200,224a8,8,0,0,1-8,8H64a8,8,0,0,1,0-16H192A8,8,0,0,1,200,224Zm-72-24a64.07,64.07,0,0,0,64-64V56a8,8,0,0,0-16,0v80a48,48,0,0,1-96,0V56a8,8,0,0,0-16,0v80A64.07,64.07,0,0,0,128,200Z"></path></svg>'],["strikethrough",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M224,128a8,8,0,0,1-8,8H175.93c9.19,7.11,16.07,17.2,16.07,32,0,13.34-7,25.7-19.75,34.79C160.33,211.31,144.61,216,128,216s-32.33-4.69-44.25-13.21C71,193.7,64,181.34,64,168a8,8,0,0,1,16,0c0,17.35,22,32,48,32s48-14.65,48-32c0-14.85-10.54-23.58-38.77-32H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128ZM76.33,104a8,8,0,0,0,7.61-10.49A17.3,17.3,0,0,1,83.11,88c0-18.24,19.3-32,44.89-32,18.84,0,34.16,7.42,41,19.85a8,8,0,0,0,14-7.7C173.33,50.52,152.77,40,128,40,93.29,40,67.11,60.63,67.11,88a33.73,33.73,0,0,0,1.62,10.49A8,8,0,0,0,76.33,104Z"></path></svg>'],["superscript",'<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M18.736 3.5c-.543 0-.986.495-.986 1.023a.75.75 0 0 1-1.5 0C16.25 3.278 17.258 2 18.736 2c.855 0 1.684.4 2.15 1.117.49.751.5 1.724-.057 2.672-.285.484-.673.847-1.045 1.141-.187.148-.379.284-.557.41l-.078.056a17.45 17.45 0 0 0-.432.311c-.356.268-.619.511-.78.793h2.514a.75.75 0 0 1 0 1.5H17a.75.75 0 0 1-.75-.75c0-1.396.821-2.182 1.565-2.741.157-.119.32-.234.472-.341l.074-.052c.177-.126.34-.243.493-.363.306-.242.532-.47.682-.724.31-.53.229-.886.093-1.094-.158-.244-.486-.435-.893-.435Z" fill="#000000"/><path d="M15.26 4.71c.06.562.385 1.043.847 1.318L10.987 12l5.583 6.512a.75.75 0 1 1-1.14.976L10 13.152l-5.43 6.336a.75.75 0 0 1-1.14-.976L9.013 12 3.431 5.488a.75.75 0 1 1 1.139-.976L10 10.848l5.26-6.137Z" fill="#000000"/></svg>'],["subscript",'<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M16.488 4.43a.75.75 0 0 1 .082 1.058L10.988 12l5.032 5.871c-.302.41-.555.906-.682 1.51L10 13.151l-5.43 6.336a.75.75 0 0 1-1.14-.976L9.013 12 3.431 5.488a.75.75 0 0 1 1.139-.976L10 10.848l5.43-6.336a.75.75 0 0 1 1.058-.081ZM17.75 15.523c0-.528.444-1.023.986-1.023.407 0 .735.19.893.434.136.21.218.566-.093 1.095-.15.255-.376.482-.682.724-.152.12-.316.237-.493.363l-.074.052c-.152.107-.315.222-.472.34-.744.56-1.565 1.346-1.565 2.742 0 .414.336.75.75.75h3.451a.75.75 0 0 0 0-1.5h-2.513c.16-.282.423-.525.779-.793.137-.103.279-.203.432-.312l.078-.054c.178-.127.37-.264.557-.41.372-.295.76-.658 1.045-1.142.557-.948.546-1.921.058-2.672C20.42 13.4 19.59 13 18.736 13c-1.478 0-2.486 1.278-2.486 2.523a.75.75 0 0 0 1.5 0Z" fill="#000000"/></svg>'],["code",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M93.31,70,28,128l65.27,58a8,8,0,1,1-10.62,12l-72-64a8,8,0,0,1,0-12l72-64A8,8,0,1,1,93.31,70Zm152,52-72-64a8,8,0,0,0-10.62,12L228,128l-65.27,58a8,8,0,1,0,10.62,12l72-64a8,8,0,0,0,0-12Z"></path></svg>'],["removeFormat",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M225,80.4,183.6,39a24,24,0,0,0-33.94,0L31,157.66a24,24,0,0,0,0,33.94l30.06,30.06A8,8,0,0,0,66.74,224H216a8,8,0,0,0,0-16h-84.7L225,114.34A24,24,0,0,0,225,80.4ZM108.68,208H70.05L42.33,180.28a8,8,0,0,1,0-11.31L96,115.31,148.69,168Zm105-105L160,156.69,107.31,104,161,50.34a8,8,0,0,1,11.32,0l41.38,41.38a8,8,0,0,1,0,11.31Z"></path></svg>'],["moreStyle",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M112,60a16,16,0,1,1,16,16A16,16,0,0,1,112,60Zm16,52a16,16,0,1,0,16,16A16,16,0,0,0,128,112Zm0,68a16,16,0,1,0,16,16A16,16,0,0,0,128,180Z"></path></svg>'],["fontColor",'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><rect width="256" height="256" fill="none"/><polyline points="192 168 128 32 64 168" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="173.18" y1="128" x2="82.82" y2="128" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></svg>'],["fontColorAccent",'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><rect width="256" height="256" fill="none"/><line x1="40" y1="216" x2="216" y2="216" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></svg>'],["highlight",'<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4.38 14.003A2.5 2.5 0 0 0 2 16.5v3A2.5 2.5 0 0 0 4.5 22h15a2.5 2.5 0 0 0 2.5-2.5v-3a2.5 2.5 0 0 0-2.5-2.5h-5.954l-1.316 1.314a3.237 3.237 0 0 1-.203.186H19.5a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1h-15a1 1 0 0 1-1-1v-3a1 1 0 0 1 .504-.869 2 2 0 0 1 .092-.744l.285-.884Z" fill="#000000"/><path d="M18.648 2.944a3.218 3.218 0 0 1-.002 4.551l-7.123 7.111a2.25 2.25 0 0 1-.942.563l-4.294 1.289a1 1 0 0 1-1.239-1.265l1.362-4.228c.11-.34.298-.65.552-.902l7.132-7.122a3.22 3.22 0 0 1 4.554.003Zm-3.494 1.059-7.133 7.121a.75.75 0 0 0-.184.301l-1.07 3.322 3.382-1.015a.75.75 0 0 0 .315-.187l7.121-7.11a1.718 1.718 0 1 0-2.43-2.432Z" fill="#000000"/></svg>'],["highlightAccent",'<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4.004 15.631a2 2 0 0 0 2.571 1.784l4.293-1.288a3.25 3.25 0 0 0 1.159-.627H19.5a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1h-15a1 1 0 0 1-1-1v-3a1 1 0 0 1 .504-.869Z" fill="#000000"/></svg>'],["link",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M165.66,90.34a8,8,0,0,1,0,11.32l-64,64a8,8,0,0,1-11.32-11.32l64-64A8,8,0,0,1,165.66,90.34ZM215.6,40.4a56,56,0,0,0-79.2,0L106.34,70.45a8,8,0,0,0,11.32,11.32l30.06-30a40,40,0,0,1,56.57,56.56l-30.07,30.06a8,8,0,0,0,11.31,11.32L215.6,119.6a56,56,0,0,0,0-79.2ZM138.34,174.22l-30.06,30.06a40,40,0,1,1-56.56-56.57l30.05-30.05a8,8,0,0,0-11.32-11.32L40.4,136.4a56,56,0,0,0,79.2,79.2l30.06-30.07a8,8,0,0,0-11.32-11.31Z"></path></svg>'],["unlink",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M190.63,65.37a32,32,0,0,0-45.19-.06L133.79,77.52a8,8,0,0,1-11.58-11l11.72-12.29a1.59,1.59,0,0,1,.13-.13,48,48,0,0,1,67.88,67.88,1.59,1.59,0,0,1-.13.13l-12.29,11.72a8,8,0,0,1-11-11.58l12.21-11.65A32,32,0,0,0,190.63,65.37ZM122.21,178.48l-11.65,12.21a32,32,0,0,1-45.25-45.25l12.21-11.65a8,8,0,0,0-11-11.58L54.19,133.93a1.59,1.59,0,0,0-.13.13,48,48,0,0,0,67.88,67.88,1.59,1.59,0,0,0,.13-.13l11.72-12.29a8,8,0,1,0-11.58-11ZM208,152H184a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16ZM48,104H72a8,8,0,0,0,0-16H48a8,8,0,0,0,0,16Zm112,72a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V184A8,8,0,0,0,160,176ZM96,80a8,8,0,0,0,8-8V48a8,8,0,0,0-16,0V72A8,8,0,0,0,96,80Z"></path></svg>'],["hr",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M224,128a8,8,0,0,1-8,8H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128Z"></path></svg>'],["codeBlock",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M58.34,101.66l-32-32a8,8,0,0,1,0-11.32l32-32A8,8,0,0,1,69.66,37.66L43.31,64,69.66,90.34a8,8,0,0,1-11.32,11.32Zm40,0a8,8,0,0,0,11.32,0l32-32a8,8,0,0,0,0-11.32l-32-32A8,8,0,0,0,98.34,37.66L124.69,64,98.34,90.34A8,8,0,0,0,98.34,101.66ZM200,40H176a8,8,0,0,0,0,16h24V200H56V136a8,8,0,0,0-16,0v64a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Z"></path></svg>'],["image",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,16V158.75l-26.07-26.06a16,16,0,0,0-22.63,0l-20,20-44-44a16,16,0,0,0-22.62,0L40,149.37V56ZM40,172l52-52,80,80H40Zm176,28H194.63l-36-36,20-20L216,181.38V200ZM144,100a12,12,0,1,1,12,12A12,12,0,0,1,144,100Z"></path></svg>'],["video",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M164.44,121.34l-48-32A8,8,0,0,0,104,96v64a8,8,0,0,0,12.44,6.66l48-32a8,8,0,0,0,0-13.32ZM120,145.05V111l25.58,17ZM234.33,69.52a24,24,0,0,0-14.49-16.4C185.56,39.88,131,40,128,40s-57.56-.12-91.84,13.12a24,24,0,0,0-14.49,16.4C19.08,79.5,16,97.74,16,128s3.08,48.5,5.67,58.48a24,24,0,0,0,14.49,16.41C69,215.56,120.4,216,127.34,216h1.32c6.94,0,58.37-.44,91.18-13.11a24,24,0,0,0,14.49-16.41c2.59-10,5.67-28.22,5.67-58.48S236.92,79.5,234.33,69.52Zm-15.49,113a8,8,0,0,1-4.77,5.49c-31.65,12.22-85.48,12-86,12H128c-.54,0-54.33.2-86-12a8,8,0,0,1-4.77-5.49C34.8,173.39,32,156.57,32,128s2.8-45.39,5.16-54.47A8,8,0,0,1,41.93,68c30.52-11.79,81.66-12,85.85-12h.27c.54,0,54.38-.18,86,12a8,8,0,0,1,4.77,5.49C221.2,82.61,224,99.43,224,128S221.2,173.39,218.84,182.47Z"></path></svg>'],["attachment",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M209.66,122.34a8,8,0,0,1,0,11.32l-82.05,82a56,56,0,0,1-79.2-79.21L147.67,35.73a40,40,0,1,1,56.61,56.55L105,193A24,24,0,1,1,71,159L154.3,74.38A8,8,0,1,1,165.7,85.6L82.39,170.31a8,8,0,1,0,11.27,11.36L192.93,81A24,24,0,1,0,159,47L59.76,147.68a40,40,0,1,0,56.53,56.62l82.06-82A8,8,0,0,1,209.66,122.34Z"></path></svg>'],["emoji",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216ZM80,108a12,12,0,1,1,12,12A12,12,0,0,1,80,108Zm96,0a12,12,0,1,1-12-12A12,12,0,0,1,176,108Zm-1.07,48c-10.29,17.79-27.4,28-46.93,28s-36.63-10.2-46.92-28a8,8,0,1,1,13.84-8c7.47,12.91,19.21,20,33.08,20s25.61-7.1,33.07-20a8,8,0,0,1,13.86,8Z"></path></svg>'],["specialCharacter",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 32 32"><path d="M22.7373,25A14.3093,14.3093,0,0,0,27,15C27,8.42,22.58,4,16,4S5,8.42,5,15A14.3093,14.3093,0,0,0,9.2627,25H4v2h8V24.7617A12.5683,12.5683,0,0,1,7,15c0-5.4673,3.5327-9,9-9s9,3.5327,9,9a12.5683,12.5683,0,0,1-5,9.7617V27h8V25Z"/></svg>'],["equation",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M184,72V56H80.65l53.6,67a8,8,0,0,1,0,10l-53.6,67H184V184a8,8,0,0,1,16,0v24a8,8,0,0,1-8,8H64a8,8,0,0,1-6.25-13l60-75-60-75A8,8,0,0,1,64,40H192a8,8,0,0,1,8,8V72a8,8,0,0,1-16,0Z"></path></svg>'],["table",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M224,48H32a8,8,0,0,0-8,8V192a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A8,8,0,0,0,224,48ZM40,112H80v32H40Zm56,0H216v32H96ZM216,64V96H40V64ZM40,160H80v32H40Zm176,32H96V160H216v32Z"></path></svg>']]);function s(t,...e){let i=t[0];for(let n=0;n<e.length;n++){i+=String(e[n]),i+=t[n+1]}return i=i.replace(/^\s+/gm,"").replace(/\s+$/gm,"").replace(/[\r\n]/g,""),i}const o=new Map([["&","&amp;"],["<","&lt;"],[">","&gt;"],['"',"&quot;"],[" ","&nbsp;"]]);function r(t){return t.replace(/[&<>"\xA0]/g,(t=>{var e;return null!==(e=o.get(t))&&void 0!==e?e:""}))}function a(t,...e){let i=t[0];for(let n=0;n<e.length;n++){i+=r(String(e[n])),i+=t[n+1]}return i=i.replace(/^\s+/gm,"").replace(/\s+$/gm,"").replace(/[\r\n]/g,""),i}function l(t){const e=t.split("-");let i="";for(let t=0;t<e.length;t++){const n=e[t];i+=t>0?n.charAt(0).toUpperCase()+n.substring(1):n}return i}function d(t,e,i){return void 0===i&&(i=","),(i+t+i).indexOf(i+e+i)>=0}function c(t){const e=(new TextEncoder).encode(t);let i="";return e.forEach((t=>{i+=String.fromCharCode(t)})),window.btoa(i)}function h(t){const e=window.atob(t),i=new Uint8Array(e.length);for(let t=0;t<e.length;t++)i[t]=e.charCodeAt(t);return(new TextDecoder).decode(i)}function p(t){const e=Number.parseInt(t,10).toString(16).toLowerCase();return e.length>1?e:`0${e}`}function u(t){return t.replace(/rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+)\s*)?\)/gi,((t,e,i,n,s)=>void 0===s?`#${p(e)}${p(i)}${p(n)}`:`#${p(e)}${p(i)}${p(n)}${function(t){const e=Math.round(255*Number.parseFloat(t)).toString(16);return e.length>1?e:`0${e}`}(s)}`))}function m(t){t=t.replace(/&quot;/gi,'"');const e={},i=/\s*([\w-]+)\s*:([^;]*)(;|$)/g;let n;for(;null!==(n=i.exec(t));){const t=n[1].toLowerCase().trim(),i=u(n[2]).trim();e[t]=i}return e}function f(t){return t.replace(/(<lake-box[^>]+>)[\s\S]*?(<\/lake-box>|$)/gi,"$1</lake-box>").replace(/<anchor\s*\/>/gi,'<lake-bookmark type="anchor"></lake-bookmark>').replace(/<focus\s*\/>/gi,'<lake-bookmark type="focus"></lake-bookmark>')}function g(t){return t.replace(/(<lake-box[^>]+>)[\s\S]*?(<\/lake-box>)/gi,"$1$2").replace(/<lake-bookmark\s+type="anchor">\s*<\/lake-bookmark>/gi,"<anchor />").replace(/<lake-bookmark\s+type="focus">\s*<\/lake-bookmark>/gi,"<focus />")}function v(t,e){if("undefined"==typeof window)return t;const i=(e=null!=e?e:navigator.userAgent).indexOf("Mac OS X")>=0?"⌘":"Ctrl";return t.replace(/(^|\+|\s)mod(\+|\s|$)/g,`$1${i}$2`)}function w(t){let e=0;for(t/=1024;t>1024&&e<2;)t/=1024,e++;return`${t>0?Math.max(t,.1).toFixed(1):0} ${["KB","MB","GB"][e]}`}function y(t,e){const i=l(e),n=window.getComputedStyle(t,null);return u(t.style[i]||n.getPropertyValue(e)||"")}function x(t,e){const i=[];if("string"!=typeof t)return i.push(t),i;if(""===t)return i;if("text"===e){const e=document.createTextNode(t);return i.push(e),i}if("html"===e||/<.+>/.test(t)){const e=document.createElement("div");e.innerHTML=t;for(const t of e.childNodes)i.push(t);return i}const n=document.querySelectorAll(t);for(const t of n)i.push(t);return i}const b=new Set(["h1","h2","h3","h4","h5","h6","div","p","blockquote","ul","ol","li","table","tr","th","td"]),k=new Set(["span","strong","em","i","u","s","sup","sub","code"]),S=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),C=new Set(["h1","h2","h3","h4","h5","h6"]),_=new Set(["ol","ul","li"]),B=new Set(["table","tr","td"]);function A(...t){window.LAKE_DEBUG&&console.log.apply(console.log,t)}const T={};let E=0;class L{constructor(t){t=null!=t?t:[],this.nodeList=Array.isArray(t)?t:[t];for(let t=0;t<this.nodeList.length;t++)this.nodeList[t].lakeId||(this.nodeList[t].lakeId=++E);this.length=this.nodeList.length}get id(){return this.get(0).lakeId}get name(){if(0===this.length)return"";return this.get(0).nodeName.toLowerCase()}get isElement(){if(0===this.length)return!1;return this.get(0).nodeType===Node.ELEMENT_NODE}get isText(){if(0===this.length)return!1;return this.get(0).nodeType===Node.TEXT_NODE}get isBlock(){return 0!==this.length&&b.has(this.name)}get isMark(){return 0!==this.length&&k.has(this.name)}get isVoid(){return 0!==this.length&&S.has(this.name)}get isHeading(){return 0!==this.length&&C.has(this.name)}get isList(){return 0!==this.length&&_.has(this.name)}get isTable(){return 0!==this.length&&B.has(this.name)}get isBookmark(){return"lake-bookmark"===this.name}get isBox(){return"lake-box"===this.name}get isInlineBox(){return this.isBox&&"inline"===this.attr("type")}get isBlockBox(){return this.isBox&&"block"===this.attr("type")}get isContainer(){if(0===this.length)return!1;const t=this.get(0);return this.isElement&&"true"===t.getAttribute("contenteditable")}get isOutside(){return 0===this.closest('[contenteditable="true"]').length}get isInside(){return!this.isOutside&&!this.isContainer}get isTopInside(){if(0===this.length)return!1;const t=this.parent();return 0!==t.length&&(this.isInside&&t.isContainer)}get isContentEditable(){if(0===this.length)return!1;if(this.isText){const t=this.get(0).parentNode;return!!t&&t.isContentEditable}if(!this.isElement)return!1;return this.get(0).isContentEditable}get isIndivisible(){return this.isContainer||this.isTable}get isEmpty(){if(this.isBox)return!1;const t=this.text();if(!(""===t||/^[\r\n\u200B\u2060]+$/.test(t)))return!1;if(this.isElement){if(this.find("lake-box").length>0)return!1;if(this.find("br").length>1)return!1}return!0}isSibling(t){if(0===this.length)return!1;const e=this.get(0).parentNode;return e&&e===t.parent().get(0)}get(t){return this.nodeList[t]}getAll(){return this.nodeList}eq(t){const e=this.get(t);return new L(e)}each(t){const e=this.getAll();for(let i=0;i<e.length;i++)if(!1===t(e[i],i))return this;return this}eachElement(t){const e=this.getAll();for(let i=0;i<e.length;i++)if(e[i].nodeType===Node.ELEMENT_NODE&&!1===t(e[i],i))return this;return this}reverse(){const t=this.getAll().reverse();return new L(t)}matches(t){if(!this.isElement)return!1;return this.get(0).matches(t)}find(t){if("string"==typeof t){const e=this.get(0).querySelectorAll(t);return new L(Array.from(e))}let e=this.eq(0);for(const i of t)if(e=e.children()[i],!e)return new L;return e}closest(t){if(this.isText){const e=this.get(0).parentNode;return e?new L(e.closest(t)):new L}if(!this.isElement)return new L;const e=this.get(0);return new L(e.closest(t))}closestBlock(){let t=this.eq(0);for(;t.length>0&&!t.isTopInside&&!t.isBlock;)t=t.parent();return t.isBlock?t:new L}closestOperableBlock(){const t=this.closest("lake-box"),e=t.length>0?t.closestBlock():this.closestBlock();if(0===e.length)return e;if(e.isTable)return new L;const i=e.parent();return"li"===e.name&&i.isList?i:e}closestContainer(){return this.closest('div[contenteditable="true"]')}closestScroller(){let t=this.eq(0);for(;t.length>0&&t.isElement;){if(["scroll","auto"].indexOf(t.computedCSS("overflow-y"))>=0)return t;t=t.parent()}return new L}parent(){const t=this.get(0);return new L(t.parentNode)}prev(){const t=this.get(0);return new L(t.previousSibling)}next(){const t=this.get(0);return new L(t.nextSibling)}first(){const t=this.get(0);return new L(t.firstChild)}last(){const t=this.get(0);return new L(t.lastChild)}index(){let t=-1,e=this.get(0);for(;e;)t++,e=e.previousSibling;return t}path(){const t=[];let e=this.eq(0);if(e.isContainer)return t;for(;e.length>0;){const i=e.parent();if(0===i.length)break;if(t.push(e.index()),i.isContainer)break;e=i}return t.reverse()}children(){const t=[];let e=this.first();for(;e.length>0;)t.push(e),e=e.next();return t}*getWalker(){for(const t of function*t(e){if(e.isBox)return;let i=e.first();for(;i.length>0;){const e=i.next();yield i,yield*t(i),i=e}}(this.eq(0)))yield t}on(t,e){return this.eachElement((i=>{i.addEventListener(t,e,!1);const n=i.lakeId;T[n]||(T[n]=[]),T[n].push({type:t,listener:e})}))}off(t,e){return this.eachElement((i=>{var n;const s=i.lakeId,o=null!==(n=T[s])&&void 0!==n?n:[];for(let n=0;n<o.length;n++){const s=o[n];t&&(t!==s.type||e&&e!==s.listener)||(i.removeEventListener(s.type,s.listener,!1),o[n]={type:"",listener:()=>{}})}T[s]=o.filter((t=>""!==t.type))}))}emit(t,e){return this.eachElement((i=>{const n=i.lakeId,s=T[n];for(const i of s)i.type===t&&i.listener(null!=e?e:new Event(t))}))}getEventListeners(t){const e=this.get(t).lakeId;return T[e]}focus(){return this.get(0).focus(),this}blur(){return this.get(0).blur(),this}clone(t=!1){const e=this.get(0);return new L(e.cloneNode(t))}hasAttr(t){return this.get(0).hasAttribute(t)}attr(t,e){var i;if("object"==typeof t){for(const e of Object.keys(t))this.attr(e,t[e]);return this}if(void 0===e){return null!==(i=this.get(0).getAttribute(t))&&void 0!==i?i:""}return this.eachElement((i=>{i.setAttribute(t,e)}))}removeAttr(t){return this.eachElement((e=>{e.removeAttribute(t)}))}hasClass(t){return d(this.get(0).className,t," ")}addClass(t){if(Array.isArray(t)){for(const e of t)this.addClass(e);return this}return this.eachElement((e=>{d(e.className,t," ")||e.classList.add(t)}))}removeClass(t){if(Array.isArray(t)){for(const e of t)this.removeClass(e);return this}return this.eachElement((e=>{d(e.className,t," ")&&(e.classList.remove(t),""===e.className&&e.removeAttribute("class"))}))}computedCSS(t){return y(this.get(0),t)}css(t,e){if("object"==typeof t){for(const e of Object.keys(t))this.css(e,t[e]);return this}if(void 0===e){return u(this.get(0).style[l(t)])}return this.eachElement((i=>{i.style[l(t)]=e,""===i.getAttribute("style")&&i.removeAttribute("style")}))}width(){return this.get(0).offsetWidth}innerWidth(){const t=Number.parseInt(this.computedCSS("padding-left"),10)||0,e=Number.parseInt(this.computedCSS("padding-right"),10)||0;return this.width()-t-e}height(){return this.get(0).offsetHeight}show(t="block"){return this.css("display",t),this}hide(){return this.css("display","none"),this}html(t){if(void 0===t){return this.get(0).innerHTML}return this.eachElement((e=>{e.innerHTML=t}))}text(t){var e;if(void 0===t){const t=this.get(0);if(this.isText)return null!==(e=t.nodeValue)&&void 0!==e?e:"";return t.innerText.replace(/^\n+|\n+$/,"")}return this.eachElement((e=>{e.innerText=t}))}outerHTML(){return this.get(0).outerHTML}empty(){return this.html(""),this}prepend(t){const e=this.get(0);if("string"==typeof t){const i=x(t).reverse();for(const t of i)e.firstChild?e.insertBefore(t,e.firstChild):e.appendChild(t);return this}return t instanceof L&&(t=t.get(0)),e.firstChild?e.insertBefore(t,e.firstChild):e.appendChild(t),this}append(t){const e=this.get(0);if("string"==typeof t){const i=x(t);for(const t of i)e.appendChild(t);return this}return t instanceof L&&(t=t.get(0)),e.appendChild(t),this}before(t){const e=this.get(0);if(!e.parentNode)return this;if("string"==typeof t){const i=x(t);for(const t of i)e.parentNode.insertBefore(t,e);return this}return t instanceof L&&(t=t.get(0)),e.parentNode.insertBefore(t,e),this}after(t){const e=this.get(0);if(!e.parentNode)return this;if("string"==typeof t){const i=x(t).reverse();for(const t of i)e.nextSibling?e.parentNode.insertBefore(t,e.nextSibling):e.parentNode.appendChild(t);return this}return t instanceof L&&(t=t.get(0)),e.nextSibling?e.parentNode.insertBefore(t,e.nextSibling):e.parentNode.appendChild(t),this}replaceWith(t){const e=this.get(0);if(!e.parentNode)return this;let i;return i=t instanceof L?t.get(0):x(t)[0],e.parentNode.replaceChild(i,e),this}remove(t=!1){return this.each((e=>{if(e.parentNode){if(t){let t=e.firstChild;for(;t;){const i=t.nextSibling;e.parentNode.insertBefore(t,e),t=i}}e.parentNode.removeChild(e)}})),this}splitText(t){if(!this.isText)return new L;const e=this.get(0).splitText(t);return new L(e)}toString(){if(0===this.length)return"";const t=this.get(0);let e=this.isText?t.nodeValue:this.outerHTML();return e&&e.length>50&&(e=`${e.substring(0,50)} ...`),`node (${t.lakeId}): ${e}`}info(){A(this.toString())}}function I(t){if(t instanceof L)return t;const e=x(t);return new L(e)}class M{constructor(t){this.range=null!=t?t:document.createRange()}get startNode(){return new L(this.range.startContainer)}get startOffset(){return this.range.startOffset}get endNode(){return new L(this.range.endContainer)}get endOffset(){return this.range.endOffset}get commonAncestor(){return new L(this.range.commonAncestorContainer)}get isCollapsed(){return this.range.collapsed}get isBox(){return this.commonAncestor.closest("lake-box").length>0}get isBoxStart(){const t=this.commonAncestor.closest("lake-box");if(0===t.length)return!1;const e=t.find(".lake-box-container");return this.compareBeforeNode(e)>=0}get isBoxCenter(){const t=this.commonAncestor.closest("lake-box");if(0===t.length)return!1;const e=t.find(".lake-box-container");return this.isCollapsed&&this.startNode.get(0)===e.get(0)&&0===this.startOffset}get isBoxEnd(){const t=this.commonAncestor.closest("lake-box");if(0===t.length)return!1;const e=t.find(".lake-box-container");return this.compareAfterNode(e)<=0}get isInsideBox(){const t=this.commonAncestor.closest("lake-box");if(0===t.length)return!1;const e=t.find(".lake-box-container");return(!this.isCollapsed||this.startNode.get(0)!==e.get(0)||0!==this.startOffset)&&(this.compareBeforeNode(e)<0&&this.compareAfterNode(e)>0)}get isInoperative(){if(this.commonAncestor.isOutside)return!0;const t=this.startNode.closest("td"),e=this.endNode.closest("td");return t.length>0&&e.length>0&&t.get(0)!==e.get(0)}get(){return this.range}getRect(){const t=this.clone();let e,i,n;if(t.isCollapsed){let s="left";if(t.startNode.isElement){const e=t.startNode.children();0===e.length?t.selectNode(t.startNode):t.startOffset<e.length?t.setEnd(t.startNode,t.startOffset+1):(t.setStart(t.startNode,t.startOffset-1),s="right")}else if(t.startNode.isText){const e=t.startNode.text();t.startOffset<e.length?t.setEnd(t.startNode,t.startOffset+1):t.startOffset>0&&(t.setStart(t.startNode,t.startOffset-1),s="right")}e=t.get().getBoundingClientRect(),i="left"===s?e.x:e.right,n=1}else e=t.get().getBoundingClientRect(),i=e.x,n=e.width;const s=e.height;return DOMRect.fromRect({x:i,y:s>0?e.y:0,width:n>0?n:1,height:s>0?s:1})}comparePoint(t,e){return this.range.comparePoint(t.get(0),e)}compareBeforeNode(t){const e=new M;return t.isText?e.setStart(t,0):e.setStartBefore(t),e.collapseToStart(),this.comparePoint(e.startNode,e.startOffset)}compareAfterNode(t){var e;const i=new M;if(t.isText){const n=null!==(e=t.get(0).nodeValue)&&void 0!==e?e:"";i.setStart(t,n.length)}else i.setStartAfter(t);return i.collapseToStart(),this.comparePoint(i.startNode,i.startOffset)}intersectsNode(t){return this.range.intersectsNode(t.get(0))}setStart(t,e){this.range.setStart(t.get(0),e)}setStartBefore(t){this.range.setStartBefore(t.get(0))}setStartAfter(t){this.range.setStartAfter(t.get(0))}setEnd(t,e){this.range.setEnd(t.get(0),e)}setEndBefore(t){this.range.setEndBefore(t.get(0))}setEndAfter(t){this.range.setEndAfter(t.get(0))}collapseToStart(){this.range.collapse(!0)}collapseToEnd(){this.range.collapse(!1)}selectNode(t){this.range.selectNode(t.get(0))}selectNodeContents(t){this.range.selectNodeContents(t.get(0))}selectBox(t){const e=t.find(".lake-box-container");if(0===e.length)throw new Error(`The box cannot be selected because the box "${t.attr("name")}" (id=${t.id}) has not been rendered yet.`);this.setStart(e,0),this.collapseToStart()}selectBoxStart(t){const e=t.find(".lake-box-strip");if(0===e.length)throw new Error(`The box cannot be selected because the box "${t.attr("name")}" (id=${t.id}) has not been rendered yet.`);this.selectNodeContents(e.eq(0)),this.collapseToStart()}selectBoxEnd(t){const e=t.find(".lake-box-strip");if(0===e.length)throw new Error(`The box cannot be selected because the box "${t.attr("name")}" (id=${t.id}) has not been rendered yet.`);this.selectNodeContents(e.eq(1)),this.collapseToStart()}shrinkBefore(t){if(t.isBox)return void this.selectBoxStart(t);if(t.isText)return this.setStartBefore(t),void this.collapseToStart();let e;for(this.setStart(t,0);this.startNode.isElement&&(e=this.startNode.children()[0])&&e.isElement&&!e.isVoid;){if(e.isBox)return void this.selectBoxStart(e);this.setStart(e,0)}this.collapseToStart()}shrinkAfter(t){if(t.isBox)return void this.selectBoxEnd(t);if(t.isText)return this.setEndAfter(t),void this.collapseToEnd();let e;for(this.setEnd(t,t.children().length);this.endNode.isElement&&this.endOffset>0&&(e=this.endNode.children()[this.endOffset-1])&&e.isElement&&!e.isVoid;){if(e.isBox)return void this.selectBoxEnd(e);this.setEnd(e,e.children().length)}this.collapseToEnd(),this.adjustBr()}shrink(){const t=this.isCollapsed;let e;for(;this.startNode.isElement&&(e=this.startNode.children()[this.startOffset])&&e.isElement&&!e.isVoid&&!e.isBox;)this.setStart(e,0);if(t)this.collapseToStart();else for(;this.endNode.isElement&&this.endOffset>0&&(e=this.endNode.children()[this.endOffset-1])&&e.isElement&&!e.isVoid&&!e.isBox;)this.setEnd(e,e.children().length)}adjustBox(){const t=this.startNode.closest("lake-box");if(t.length>0){const e=this.clone();e.collapseToStart(),e.isBoxEnd?this.setStartAfter(t):this.setStartBefore(t)}const e=this.endNode.closest("lake-box");if(e.length>0){const t=this.clone();t.collapseToEnd(),t.isBoxStart?this.setEndBefore(e):this.setEndAfter(e)}}adjustTable(){const t=this.startNode.closest("table"),e=this.endNode.closest("table");if(0===t.length&&e.length>0&&e.isInside)return this.setEndBefore(e),void this.shrink();0===e.length&&t.length>0&&t.isInside&&(this.setStartAfter(t),this.shrink())}adjustBlock(){if(!this.isCollapsed){if(this.endNode.isElement&&0===this.endOffset){let t=this.endNode;for(;0===t.prev().length;)t=t.parent();this.setEndBefore(t)}return void this.shrink()}if(this.startNode.isText)return;const t=this.startNode.children()[this.startOffset];t&&(t.isBlockBox||t.isBlock)&&this.shrinkBefore(t)}adjust(){this.adjustBox(),this.adjustTable(),this.adjustBlock()}adjustBr(){if(!this.isCollapsed)return;const t=this.getPrevNode(),e=this.getNextNode();"br"===t.name&&0===e.length&&(this.setStartBefore(t),this.collapseToStart())}getPrevNode(){let t;return t=this.startNode.isText?0===this.startOffset?this.startNode.prev():this.startNode:this.startNode.children()[this.startOffset-1],null!=t?t:new L}getNextNode(){let t;return t=this.endNode.isText?this.endOffset===this.endNode.text().length?this.endNode.next():this.endNode:this.endNode.children()[this.endOffset],null!=t?t:new L}getBoxes(){if(this.isCollapsed){const t=this.startNode.closest("lake-box");return t.length>0?[t]:[]}const t=[],e=this.clone();e.adjustBox();for(const i of e.commonAncestor.getWalker())i.isBox&&e.intersectsNode(i)&&t.push(i);return t}getBlocks(){if(this.isCollapsed){const t=this.startNode.closestOperableBlock();return t.isTable?[]:t.isInside?[t]:[]}const t=this.startNode.closestOperableBlock(),e=this.endNode.closestOperableBlock();if(t.isInside&&t.get(0)&&t.get(0)===e.get(0))return t.isTable?[]:[t];const i=[],n=this.clone();n.collapseToEnd();for(const t of this.commonAncestor.getWalker())t.isBlock&&!t.isTable&&t.isTopInside&&0!==n.comparePoint(t,0)&&this.intersectsNode(t)&&i.push(t);if(i.length>0)return i;for(const n of this.commonAncestor.getWalker())n.isBlock&&!n.isTable&&(t.isSibling(n)||e.isSibling(n))&&this.intersectsNode(n)&&i.push(n);return i}getMarks(t=!1){const e=[];if(this.commonAncestor.isText&&t&&0===this.startOffset&&this.endOffset===this.commonAncestor.text().length)return e.push(this.commonAncestor),e;const i=this.clone();i.collapseToStart();const n=this.clone();n.collapseToEnd();for(const s of this.commonAncestor.getWalker()){const o=document.createRange();if(o.setStartAfter(s.get(0)),o.collapse(!0),n.compareBeforeNode(s)>=0)break;i.compareAfterNode(s)>0&&(s.isMark||s.isText&&t)&&e.push(s)}return e}getStartText(){const t=this.startNode,e=this.startOffset;let i=t.closestBlock();if(i.isOutside&&(i=t.closestContainer()),0===i.length)return"";const n=new M;n.setStartBefore(i),n.setEnd(t,e);const s=I("<div />");s.append(n.cloneContents());const o=s.text();return""===o&&s.find("lake-box").length>0?"​":o}getEndText(){const t=this.endNode,e=this.endOffset;let i=t.closestBlock();if(i.isOutside&&(i=t.closestContainer()),0===i.length)return"";const n=new M;n.setStart(t,e),n.setEndAfter(i);const s=I("<div />");s.append(n.cloneContents());const o=s.text();return""===o&&s.find("lake-box").length>0?"​":o}clone(){return new M(this.range.cloneRange())}cloneContents(){return this.range.cloneContents()}info(){A("--- range information ---"),A("start node:",this.startNode.toString(),", offset:",this.startOffset),A("end node:",this.endNode.toString(),", offset:",this.endOffset)}}function P(t,e,i){const n=new M;let s;if(t.isText){s=t.parent();const i=t.splitText(e);n.setStartAfter(t),""===t.text()&&t.remove(),""===i.text()&&i.remove()}else n.setStart(t,e),s=t;if("body"===s.name||"html"===s.name)return null;if(s.get(0)===i.get(0))return null;n.collapseToStart();const o=s.clone();let r=s.first();for(;r.length>0&&!(n.compareBeforeNode(r)>=0);){const t=r.next();o.append(r),r=t}return s.before(o),s.parent().length>0&&s.parent().get(0)!==i.get(0)?P(s.parent(),s.index(),i):{start:o,end:s}}function Z(t){const e=I("<br />");let i=t;for(;i.isBlock;){let t=i.last();for(;t.isText&&t.isEmpty;)t=t.prev();if(!t.isBlock&&"br"!==t.name){i.append(e);break}i=t}return e}function N(t){if(0===t.length)return;const e=[];let i=t.first();for(;i.length>0;){const t=i.next();i.isText&&""===i.text()||e.push(i),i=t}(1===e.length&&"br"===e[0].name||2===e.length&&"br"===e[0].name&&e[1].isBookmark)&&e[0].remove(),2===e.length&&e[0].isBookmark&&"br"===e[1].name&&e[1].remove()}function O(t){if(t.isText)return{node:t,offset:t.text().length};const e=new M;return e.setEndAfter(t),{node:e.endNode,offset:e.endOffset}}function z(t,e){const i=e;if(["ul","ol"].indexOf(t.name)>=0){const e=t.find("li");t=e.eq(e.length-1)}if(["ul","ol"].indexOf(e.name)>=0){const t=e.find("li");e=t.eq(0)}if(t.isText||e.isText||t.isVoid||e.isVoid)return O(t);N(t),N(e),t.isBlock&&t.isEmpty&&e.isEmpty&&Z(t);const n=t.last(),s=e.first();let o=s;for(;o.length>0;){const e=o.next();t.append(o),o=e}return i.remove(),n.length>0&&s.length>0&&n.isElement&&!n.isBox&&n.clone(!1).get(0).isEqualNode(s.clone(!1).get(0))?z(n,s):0===n.length?{node:t,offset:0}:O(n)}function H(t){let e=t;for(;e.length>0;){let t=e.first();if(t.isText&&t.isEmpty&&(t=t.next()),e.isElement&&!e.isVoid&&0===t.length)break;e=t}return e}function $(t,e){if(e=null!=e?e:I("<p />"),0===t.length)return e;const i=H(e=e.clone(!0));t[0].before(e);for(const e of t)i.append(e);return e}function D(t){for(const e of t.getWalker())if(e.isText){const t=e.text();""===t?e.remove():t.length>1&&/\u200B/.test(t)&&(e.get(0).nodeValue=t.replace(/\u200B/g,""))}}function V(t,e){const i=t.get(0),n=I(a`<${e} />`);for(const t of i.attributes)n.attr(t.name,t.value);let s=t.first();for(;s.length>0;){const t=s.next();n.append(s),s=t}return t.replaceWith(n),n}function F(t){if(0===t.length)return;const e=t[0],i=t[t.length-1],n=[];let s=e.prev();for(;s.length>0&&"ol"===s.name;)n.push(s),s=s.prev();n.reverse(),n.push(...t);let o=i.next();for(;o.length>0&&"ol"===o.name;)n.push(o),o=o.next();let r=1;for(const t of n){const e=t.prev();if(0!==e.length&&"ol"===e.name||(r=1),"ol"===t.name){"ol"===e.name&&e.attr("indent")!==t.attr("indent")&&(r=1);const i=t.attr("start"),n=r.toString(10);i!==n&&t.attr("start",n),r++}}}function R(t,e){if(t.isList){let i=Number.parseInt(t.attr("indent"),10)||0;if("increase"===e?i++:i--,i<=0)i=0;else if(i>10)return;return 0===i?t.removeAttr("indent"):t.attr("indent",i.toString(10)),void F([t])}let i=Number.parseInt(t.css("margin-left"),10)||0;"decrease"!==e||0!==i||""===t.css("text-indent")?("increase"===e?i+=40:i-=40,i<=0&&(i=0),0===i?t.css("margin-left",""):t.css("margin-left",`${i}px`)):t.css("text-indent","")}const j=new Set;function W(){}const q={morphStyle:"outerHTML",callbacks:{beforeNodeAdded:W,afterNodeAdded:W,beforeNodeMorphed:W,afterNodeMorphed:W,beforeNodeRemoved:W,afterNodeRemoved:W,beforeAttributeUpdated:W,afterAttributeUpdated:W,beforeChildrenUpdated:W},head:{style:"merge",shouldPreserve:t=>"true"===t.getAttribute("im-preserve"),shouldReAppend:t=>"true"===t.getAttribute("im-re-append"),shouldRemove:W,afterHeadMorphed:W}};function U(t,e){return!t.deadIds.has(e)}function K(t,e,i){return(t.idMap.get(i)||j).has(e)}function G(t,e){const i=t.idMap.get(e)||j;for(const e of i)t.deadIds.add(e)}function X(t,e,i){const n=t.idMap.get(e)||j;let s=0;for(const e of n)U(t,e)&&K(t,e,i)&&++s;return s}function Y(t,e){const i=t.parentElement,n=t.querySelectorAll("[id]");for(const t of n){let n=t;for(;n!==i&&null!=n;){let i=e.get(n);null==i&&(i=new Set,e.set(n,i)),i.add(t.id),n=n.parentElement}}}function J(t,e){const i=new Map;return Y(t,i),Y(e,i),i}function Q(t,e,i){return{target:t,newContent:e,config:i=function(t){const e={};return Object.assign(e,q),Object.assign(e,t),e.callbacks={},Object.assign(e.callbacks,q.callbacks),Object.assign(e.callbacks,t.callbacks),e.head={},Object.assign(e.head,q.head),Object.assign(e.head,t.head),e}(i),morphStyle:i.morphStyle,ignoreActive:i.ignoreActive,ignoreActiveValue:i.ignoreActiveValue,idMap:J(t,e),deadIds:new Set,callbacks:i.callbacks,head:i.head}}function tt(t,e,i){return null!=t&&null!=e&&(t.nodeType===e.nodeType&&t.tagName===e.tagName&&(""!==t.id&&t.id===e.id||X(i,t,e)>0))}function et(t,e){return null!=t&&null!=e&&(t.nodeType===e.nodeType&&t.tagName===e.tagName)}function it(t,e){G(e,t),!1!==e.callbacks.beforeNodeRemoved(t)&&(t.remove(),e.callbacks.afterNodeRemoved(t))}function nt(t,e,i){let n=t;for(;n&&n!==e;){const t=n;n=n.nextSibling,it(t,i)}return G(i,e),e.nextSibling}function st(t,e,i,n,s){const o=X(s,i,e);let r=null;if(o>0){r=n;let e=0;for(;null!=r;){if(tt(i,r,s))return r;if(e+=X(s,r,t),e>o)return null;r=r.nextSibling}}return r}function ot(t,e,i,n,s){let o=n,r=i.nextSibling,a=0;for(;null!=o;){if(X(s,o,t)>0)return null;if(et(i,o))return o;if(et(r,o)&&(a++,r=r?r.nextSibling:null,a>=2))return null;o=o?o.nextSibling:null}return o}function rt(t,e,i){return et(t,e)?.5+X(i,t,e):0}function at(t,e,i,n){return!("value"!==t||!n.ignoreActiveValue||e!==document.activeElement)||!1===n.callbacks.beforeAttributeUpdated(t,e,i)}function lt(t,e,i){var n;if(!i.ignoreActive||t!==document.activeElement)return null==e?!1===i.callbacks.beforeNodeRemoved(t)?t:(t.remove(),i.callbacks.afterNodeRemoved(t),null):et(t,e)?(!1===i.callbacks.beforeNodeMorphed(t,e)||(function(t,e,i){const n=t.nodeType;if(1===n){const n=t.attributes,s=e.attributes;for(const t of n)at(t.name,e,"update",i)||e.getAttribute(t.name)!==t.value&&(e.setAttribute(t.name,t.value),i.callbacks.afterAttributeUpdated(t.name,e,"update"));for(let n=s.length-1;n>=0;n--){const o=s[n];at(o.name,e,"remove",i)||t.hasAttribute(o.name)||(e.removeAttribute(o.name),i.callbacks.afterAttributeUpdated(o.name,e,"remove"))}}8!==n&&3!==n||e.nodeValue!==t.nodeValue&&(e.nodeValue=t.nodeValue)}(e,t,i),!1===i.callbacks.beforeChildrenUpdated(t,e)||function(t,e){return e.ignoreActiveValue&&t===document.activeElement}(t,i)||dt(e,t,i),i.callbacks.afterNodeMorphed(t,e)),t):!1===i.callbacks.beforeNodeRemoved(t)||!1===i.callbacks.beforeNodeAdded(e)?t:(null===(n=t.parentElement)||void 0===n||n.replaceChild(e,t),i.callbacks.afterNodeAdded(e),i.callbacks.afterNodeRemoved(t),e)}function dt(t,e,i){let n,s=t.firstChild,o=e.firstChild;for(;s;){if(n=s,s=n.nextSibling,null==o){if(!1===i.callbacks.beforeNodeAdded(n))return;e.appendChild(n),i.callbacks.afterNodeAdded(n),G(i,n);continue}if(tt(n,o,i)){lt(o,n,i),o=o.nextSibling,G(i,n);continue}const r=st(t,e,n,o,i);if(r){o=nt(o,r,i),lt(r,n,i),G(i,n);continue}const a=ot(t,0,n,o,i);if(a)o=nt(o,a,i),lt(a,n,i),G(i,n);else{if(!1===i.callbacks.beforeNodeAdded(n))return;e.insertBefore(n,o),i.callbacks.afterNodeAdded(n),G(i,n)}}for(;null!==o;){const t=o;o=o.nextSibling,it(t,i)}}function ct(t,e,i){if("innerHTML"===i.morphStyle)return dt(e,t,i),t.children;if("outerHTML"===i.morphStyle||null==i.morphStyle){const n=function(t,e,i){let n;n=t.firstChild;let s=n,o=0;for(;n;){const t=rt(n,e,i);t>o&&(s=n,o=t),n=n.nextSibling}return s}(e,t,i),s=null==n?void 0:n.previousSibling,o=null==n?void 0:n.nextSibling,r=lt(t,n,i);return n?function(t,e,i){var n,s;const o=[],r=[];let a=t;for(;null!=a;)o.push(a),a=a.previousSibling;for(;o.length>0;){const t=o.pop();r.push(t),t&&(null===(n=e.parentElement)||void 0===n||n.insertBefore(t,e))}r.push(e);let l=i;for(;null!=l;)o.push(l),r.push(l),l=l.nextSibling;for(;o.length>0;){const t=o.pop();t&&(null===(s=e.parentElement)||void 0===s||s.insertBefore(t,e.nextSibling))}return r}(s,r,o):[]}throw`Do not understand how to morph style ${i.morphStyle}`}function ht(t,e,i={}){const n=function(t){if(null==t)return document.createElement("div");if(t instanceof Node){if(t.generatedByIdiomorph)return t;const e=document.createElement("div");return e.append(t),e}const e=document.createElement("div");for(const i of[...t])e.append(i);return e}(e.get(0)),s=Q(t.get(0),n,i);ct(t.get(0),n,s)}function pt(t){const e=t.get(0).getBoundingClientRect();let i=e.left,n=e.right,s=e.top,o=e.bottom,r=window.innerWidth,a=window.innerHeight;const l=t.closestScroller();if(l.length>0){const t=l.get(0).getBoundingClientRect(),e=t.x,d=t.y;i-=e,n-=e,s-=d,o-=d,r=t.width,a=t.height}return{left:i,right:r-n,top:s,bottom:a-o}}const ut=new Map;function mt(t){let e=ut.get(t);return e||(e=new Map,ut.set(t,e),e)}function ft(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var gt={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,i="~";function n(){}function s(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function o(t,e,n,o,r){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new s(n,o||t,r),l=i?i+e:e;return t._events[l]?t._events[l].fn?t._events[l]=[t._events[l],a]:t._events[l].push(a):(t._events[l]=a,t._eventsCount++),t}function r(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),a.prototype.eventNames=function(){var t,n,s=[];if(0===this._eventsCount)return s;for(n in t=this._events)e.call(t,n)&&s.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(t)):s},a.prototype.listeners=function(t){var e=i?i+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var s=0,o=n.length,r=new Array(o);s<o;s++)r[s]=n[s].fn;return r},a.prototype.listenerCount=function(t){var e=i?i+t:t,n=this._events[e];return n?n.fn?1:n.length:0},a.prototype.emit=function(t,e,n,s,o,r){var a=i?i+t:t;if(!this._events[a])return!1;var l,d,c=this._events[a],h=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),h){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,n),!0;case 4:return c.fn.call(c.context,e,n,s),!0;case 5:return c.fn.call(c.context,e,n,s,o),!0;case 6:return c.fn.call(c.context,e,n,s,o,r),!0}for(d=1,l=new Array(h-1);d<h;d++)l[d-1]=arguments[d];c.fn.apply(c.context,l)}else{var p,u=c.length;for(d=0;d<u;d++)switch(c[d].once&&this.removeListener(t,c[d].fn,void 0,!0),h){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,e);break;case 3:c[d].fn.call(c[d].context,e,n);break;case 4:c[d].fn.call(c[d].context,e,n,s);break;default:if(!l)for(p=1,l=new Array(h-1);p<h;p++)l[p-1]=arguments[p];c[d].fn.apply(c[d].context,l)}}return!0},a.prototype.on=function(t,e,i){return o(this,t,e,i,!1)},a.prototype.once=function(t,e,i){return o(this,t,e,i,!0)},a.prototype.removeListener=function(t,e,n,s){var o=i?i+t:t;if(!this._events[o])return this;if(!e)return r(this,o),this;var a=this._events[o];if(a.fn)a.fn!==e||s&&!a.once||n&&a.context!==n||r(this,o);else{for(var l=0,d=[],c=a.length;l<c;l++)(a[l].fn!==e||s&&!a[l].once||n&&a[l].context!==n)&&d.push(a[l]);d.length?this._events[o]=1===d.length?d[0]:d:r(this,o)}return this},a.prototype.removeAllListeners=function(t){var e;return t?(e=i?i+t:t,this._events[e]&&r(this,e)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=i,a.EventEmitter=a,t.exports=a}(gt);var vt=ft(gt.exports);const wt=new Map,yt=new Map;class xt{constructor(t){this.config=t,this.root=t.root,this.node=I(a`
2
2
  <button type="button" name="${t.name}" class="lake-button" />
3
3
  `),t.type&&this.node.addClass(`lake-${t.type}-button`),void 0!==t.tabIndex&&this.node.attr("tabindex",t.tabIndex.toString())}render(){const t=this.config,e=this.node;e.addClass(`lake-${t.text?"text":"icon"}-button`),t.tooltip&&e.attr("title",t.tooltip),t.icon&&e.append(t.icon),t.text&&e.append(`<span>${t.text}</span>`),this.root.append(e),e.on("mouseenter",(()=>{e.attr("disabled")||e.hasClass("lake-button-selected")||e.addClass("lake-button-hovered")})),e.on("mouseleave",(()=>{e.attr("disabled")||e.removeClass("lake-button-hovered")})),e.on("click",(e=>{e.preventDefault(),t.onClick()}))}}const bt=/^\{.*\}$/,kt=/(\{(?:[^{}]+|\{(?:[^{}]+)*\})*\})/g,St=t=>t.substring(1,t.length-1),Ct=(t,e=!0,i="",n="")=>t.split(kt).map((t=>{if(!t.match(kt))return t;const e=St(t);if(e.startsWith("{"))return((t,e)=>{let[i,n]=t.split(":");n||(n=i,i=e);const s=n.split("|"),[o,r,a,l,d,c]=s,h=s.filter((t=>void 0!==t)).length;return 1===h?{k:i,r:o}:2===h?{k:i,o:o,r:r}:3===h?{k:i,z:o,o:r,r:a}:{k:i,z:o,o:r,t:a,f:l,m:d,r:c}})(St(e),n);const s=(t=>{const[e="",...i]=t.split("|"),[n="",s]=e.split(":"),[o,r]=n.split("?");return{k:o,i:s,n:""===r,f:i}})(e);return n=s.k||n,!i&&(i=n),s})).map((t=>{if("string"==typeof t)return t;t.k||(t.k=i||"0");const n=(t=>Object.fromEntries(Object.keys(t).map((e=>{const i=t[e];return[e,Array.isArray(i)?i.map((t=>null==t?void 0:t.trim())):i===!!i?i:null==i?void 0:i.trim()]}))))(t);return e?(s=n,Object.fromEntries(Object.entries(s).map((([t,e])=>"i"!==t&&e&&"0"!=e&&[t,e])).filter(Boolean))):n;var s})),_t=(t,e,i)=>e.reduce(((e,i)=>{var n,s,o;return null!==(s=i.match(bt)?(t=>{var i;return null!==(i=t[e])&&void 0!==i?i:t["*"]})((o=i,Object.fromEntries(St(o).split(",").map((t=>t.split(":"))).reduce(((t,e)=>2===e.length?[...t,e.map((t=>t.trim()))]:(t[t.length-1][1]+=","+e[0],t)),[])))):null===(n=t[i])||void 0===n?void 0:n.call(t,e))&&void 0!==s?s:e}),i),Bt=/\?\?/g,At=(t,e,i,n)=>{const s=n[0],o=s&&"object"==typeof s&&s.constructor===Object;return((t,e,i,n)=>t.map((t=>{if("string"==typeof t)return t;const{k:s="0",f:o=[]}=t,r=n[s];if((t=>!(!t.o&&!t.r))(t))return(("boolean"==typeof r?r?t.o:t.r:((t,{z:e,o:i,t:n,f:s,m:o,r:r},a)=>{switch(e&&0==a?"zero":t.select(a)){case"zero":return e;case"one":return i;case"two":return n;case"few":return null!=s?s:r;case"many":return null!=o?o:r;default:return r}})(e,t,r))||"").replace(Bt,r);const a=o.length?_t(i,o,r):r;return(""+(null!=a?a:"")).trim()})).join(""))(t,e,i,1===n.length&&o?s:n)},Tt=(t,e)=>{const i={},n=new Intl.PluralRules(t);return(t,...s)=>At(((t,e)=>t[e]||(t[e]=Ct(e)))(i,t),n,e,s)};const Et=(t={},e)=>"string"==typeof t?e.bind(null,t):Object.assign(Object.defineProperty((()=>""),"name",{writable:!0}),t),Lt=(t,e)=>new Proxy(Et(t,e),{get:(t,i)=>i===Symbol.iterator?[][Symbol.iterator].bind(Object.values(t).map((t=>Et(t,e)))):Lt(t[i],e)});const It={"en-US":{toolbar:{undo:`Undo (${v("mod+Z")})`,redo:`Redo (${v("mod+Y")})`,selectAll:`Select all (${v("mod+A")})`,paragraph:"Paragraph",blockQuote:"Block quotation",numberedList:"Numbered list",bulletedList:"Bulleted list",checklist:"Checklist",alignLeft:"Align left",alignCenter:"Align center",alignRight:"Align right",alignJustify:"Align justify",increaseIndent:"Increase indent",decreaseIndent:"Decrease indent",bold:`Bold (${v("mod+B")})`,italic:`Italic (${v("mod+I")})`,underline:`Underline (${v("mod+U")})`,strikethrough:"Strikethrough",superscript:"Superscript",subscript:"Subscript",code:"Inline code",removeFormat:"Remove format",formatPainter:"Format painter",link:"Link",hr:"Horizontal line",video:"Video",codeBlock:"Code block",heading:"Heading",heading1:"Heading 1",heading2:"Heading 2",heading3:"Heading 3",heading4:"Heading 4",heading5:"Heading 5",heading6:"Heading 6",list:"List",align:"Alignment",indent:"Indent",fontFamily:"Font family",fontSize:"Font size",moreStyle:"More style",fontColor:"Font color",highlight:"Highlight",image:"Image",file:"File",emoji:"Emoji",equation:"Equation",removeColor:"Remove color"},link:{newLink:"New link",url:"Link URL",title:"Link title",copy:"Copy link to clipboard",open:"Open link in new tab",save:"Save",unlink:"Remove link"},image:{view:"Full screen",remove:"Delete",previous:"Previous",next:"Next",close:"Close (Esc)",loadingError:"The image cannot be loaded",zoomOut:"Zoom out",zoomIn:"Zoom in"},file:{download:"Download",remove:"Delete"},video:{embed:"Embed video",remove:"Delete",description:"Paste a link to embed a video from YouTube.",url:"Link",urlError:"Please enter a valid link."},codeBlock:{langType:"Select language"},equation:{save:"Done",placeholder:"Type a TeX expression"}},"zh-CN":{toolbar:{undo:`撤消 (${v("mod+Z")})`,redo:`重做 (${v("mod+Y")})`,selectAll:`全选 (${v("mod+A")})`,paragraph:"正文",blockQuote:"引用",numberedList:"编号",bulletedList:"项目符号",checklist:"任务列表",alignLeft:"左对齐",alignCenter:"居中",alignRight:"右对齐",alignJustify:"两端对齐",increaseIndent:"增加缩进",decreaseIndent:"减少缩进",bold:`粗体 (${v("mod+B")})`,italic:`斜体 (${v("mod+I")})`,underline:`下划线 (${v("mod+U")})`,strikethrough:"删除线",superscript:"上标",subscript:"下标",code:"行内代码",removeFormat:"清除格式",formatPainter:"格式刷",link:"链接",hr:"分割线",video:"视频",codeBlock:"代码块",heading:"标题",heading1:"标题 1",heading2:"标题 2",heading3:"标题 3",heading4:"标题 4",heading5:"标题 5",heading6:"标题 6",list:"列表",align:"对齐方式",indent:"缩进",fontFamily:"字体",fontSize:"文字大小",moreStyle:"更多样式",fontColor:"文字颜色",highlight:"文字背景",image:"图片",file:"文件",emoji:"表情",equation:"公式",removeColor:"默认"},link:{newLink:"新链接",url:"链接 URL",title:"链接文本",copy:"复制到剪贴板",open:"打开链接",save:"确定",unlink:"取消链接"},image:{view:"查看大图",remove:"删除",previous:"上一张",next:"下一张",close:"关闭 (Esc)",loadingError:"图片加载失败",zoomOut:"缩小",zoomIn:"放大"},file:{download:"下载",remove:"删除"},video:{embed:"嵌入视频",remove:"删除",description:"在下面的输入框里,粘贴 YouTube 链接。",url:"链接",urlError:"请输入有效的链接。"},codeBlock:{langType:"选择代码语言"},equation:{save:"确定",placeholder:"请输入 TeX 公式"}},ja:{toolbar:{undo:`元に戻す (${v("mod+Z")})`,redo:`やり直し (${v("mod+Y")})`,selectAll:`すべて選択 (${v("mod+A")})`,paragraph:"テキスト",blockQuote:"ブロック引用",numberedList:"番号付きリスト",bulletedList:"箇条書きリスト",checklist:"タスクリスト",alignLeft:"左揃え",alignCenter:"中心揃え",alignRight:"右揃え",alignJustify:"左右に並べ替え",increaseIndent:"インデントを増やす",decreaseIndent:"インデントを減らす",bold:`太字 (${v("mod+B")})`,italic:`斜体 (${v("mod+I")})`,underline:`下線 (${v("mod+U")})`,strikethrough:"取り消し線",superscript:"上付き文字",subscript:"下付き文字",code:"インラインコード",removeFormat:"形式を削除",formatPainter:"形式ペインタ",link:"リンク",hr:"区切り線",video:"動画",codeBlock:"コードブロック",heading:"タイトル",heading1:"タイトル 1",heading2:"タイトル 2",heading3:"タイトル 3",heading4:"タイトル 4",heading5:"タイトル 5",heading6:"タイトル 6",list:"リスト",align:"文字揃え",indent:"インデント",fontFamily:"フォント",fontSize:"文字サイズ",moreStyle:"その他のスタイル",fontColor:"文字色",highlight:"文字の背景",image:"画像",file:"ファイル",emoji:"絵文字",equation:"公式",removeColor:"デフォルト"},link:{newLink:"新しいリンク",url:"リンク URL",title:"リンク文字",copy:"クリップボードにコピー",open:"リンクを開く",save:"確認",unlink:"リンクを削除"},image:{view:"大きな画像を見る",remove:"削除",previous:"前の画像",next:"次の画像",close:"閉じる (Esc)",loadingError:"画像を読み込めません",zoomOut:"縮小",zoomIn:"拡大"},file:{download:"ダウンロード",remove:"削除"},video:{embed:"動画を埋め込む",remove:"削除",description:"下の入力欄に YouTube リンクを貼り付けてください。",url:"リンク",urlError:"有効なリンクを入力してください。"},codeBlock:{langType:"コード言語を選択"},equation:{save:"確認",placeholder:"TeX 公式を入力してください。"}},ko:{toolbar:{undo:`작업취소 (${v("mod+Z")})`,redo:`작업재개 (${v("mod+Y")})`,selectAll:`전체 선택 (${v("mod+A")})`,paragraph:"텍스트",blockQuote:"인용문",numberedList:"순서 목록",bulletedList:"비순서 목록",checklist:"체크리스트",alignLeft:"왼쪽 정렬",alignCenter:"가운데 정렬",alignRight:"오른쪽 정렬",alignJustify:"좌우로 정렬",increaseIndent:"들여쓰기 증가",decreaseIndent:"들여쓰기 줄이기",bold:`굵게 (${v("mod+B")})`,italic:`기울임꼴 (${v("mod+I")})`,underline:`밑줄 (${v("mod+U")})`,strikethrough:"취소선",superscript:"위첨자",subscript:"아래 첨자",code:"인라인 코드",removeFormat:"형식 지우기",formatPainter:"형식 페인터",link:"링크",hr:"구분선",video:"동영상",codeBlock:"코드 블록",heading:"제목",heading1:"제목 1",heading2:"제목 2",heading3:"제목 3",heading4:"제목 4",heading5:"제목 5",heading6:"제목 6",list:"목록",align:"정렬",indent:"들여쓰기",fontFamily:"글꼴",fontSize:"글자 크기",moreStyle:"더 많은 스타일",fontColor:"글자 색상",highlight:"글자 배경",image:"이미지",file:"파일",emoji:"이모지",equation:"수식",removeColor:"기본색"},link:{newLink:"새 링크",url:"링크 URL",title:"링크 텍스트",copy:"클립보드에 복사",open:"링크 열기",save:"확인",unlink:"링크 제거"},image:{view:"큰 이미지 보기",remove:"삭제",previous:"이전 이미지",next:"다음 이미지",close:"닫기 (Esc)",loadingError:"이미지를 로드할 수 없습니다",zoomOut:"축소",zoomIn:"확대"},file:{download:"다운로드",remove:"삭제"},video:{embed:"동영상 삽입",remove:"삭제",description:"아래 입력란에 YouTube 링크를 붙여넣으세요.",url:"링크",urlError:"유효한 링크를 입력하세요."},codeBlock:{langType:"코드언어 선택"},equation:{save:"확인",placeholder:"TeX 수식을 입력하세요"}}},Mt=Object.keys(It),Pt={},Zt={},Nt=t=>{Pt[t]||(Pt[t]=It[t],(t=>{Zt[t]={}})(t))},Ot=t=>function(t,e,i={}){return Lt(e,Tt(t,i))}(t,Pt[t],Zt[t]);Mt.forEach(Nt);class zt{constructor(t){this.documentClickListener=t=>{const e=new L(t.target),i=this.node.find(".lake-dropdown-title"),n=this.node.find(".lake-dropdown-menu");e.closest(".lake-dropdown-title").get(0)!==i.get(0)&&(n.hide(),document.removeEventListener("click",this.documentClickListener))},this.config=t,this.root=t.root,this.locale=t.locale||Ot("en-US");const e=t.placement||"bottom";if(this.node=I(a`
4
4
  <div class="lake-dropdown lake-${t.menuType}-dropdown" name="${t.name}" placement="${e}">
@@ -15,7 +15,7 @@ var Lake=function(t){"use strict";class e extends HTMLElement{}void 0!==customEl
15
15
  <span class="lake-box-strip"><br /></span>
16
16
  <div class="lake-box-container" contenteditable="false"></div>
17
17
  <span class="lake-box-strip"><br /></span>
18
- `;class Dt{constructor(t){if(this.event=new vt,"string"==typeof t){const e=wt.get(t);if(void 0===e)throw new Error(`The box "${t}" has not been defined yet.`);const i=r(e.type),n=r(e.name);this.node=I(a`<lake-box type="${i}" name="${n}"></lake-box>`),e.value&&(this.value=e.value)}else{this.node=I(t);const e=wt.get(this.name);if(void 0===e)throw new Error(`The box "${this.name}" has not been defined yet.`);e.value&&!this.node.hasAttr("value")&&(this.value=e.value)}}addFramework(){let t=this.getContainer();0===t.length?(this.node.html($t),t=this.getContainer()):(t.off("mouseenter"),t.off("mouseleave"),t.off("click")),t.on("mouseenter",(()=>{t.hasClass("lake-box-selected")||t.hasClass("lake-box-focused")||t.hasClass("lake-box-activated")||t.addClass("lake-box-hovered")})),t.on("mouseleave",(()=>{t.removeClass("lake-box-hovered")})),t.on("click",(()=>{A(`The box "${this.name}" (id = ${this.node.id}) value:`),A(this.value)})),"block"===this.type&&this.node.isContentEditable&&t.attr("draggable","true")}get type(){return this.node.attr("type")}get name(){return this.node.attr("name")}get value(){const t=this.node.attr("value");return""===t?{}:JSON.parse(h(t))}set value(t){this.node.attr("value",c(JSON.stringify(t)))}updateValue(t,e){const i=this.value;if("string"==typeof t)i[t]=e;else for(const e of Object.keys(t))i[e]=t[e];this.value=i}getEditor(){const t=this.node.closest("div[contenteditable]");return t.length>0?yt.get(t.id):void 0}getContainer(){return this.node.find(".lake-box-container")}setToolbar(t){const e=this.getEditor();let i=null;const n=()=>{i&&i.updatePosition()};this.event.on("focus",(()=>{i=new Ht({root:e?e.popupContainer:I(document.body),box:this,items:t,locale:e?e.locale:void 0}),i.render(),e&&e.root.on("scroll",n)})),this.event.on("blur",(()=>{i&&(i.unmount(),i=null),e&&e.root.off("scroll",n)}))}render(){const t=wt.get(this.name);if(void 0===t)return;this.event.emit("beforeunmount"),this.event.removeAllListeners(),this.addFramework();const e=t.render(this);if(void 0!==e){const t=this.getContainer();t.empty(),t.append(e)}A(`The box "${this.name}" (id: ${this.node.id}) rendered`)}unmount(){this.event.emit("blur"),this.event.emit("beforeunmount"),this.event.removeAllListeners(),this.node.empty(),A(`The box "${this.name}" (id: ${this.node.id}) unmounted`)}getHTML(){const t=wt.get(this.name);return void 0===t?"":void 0===t.html?this.node.outerHTML():t.html(this)}}function Vt(t){const e=mt(0);if("string"==typeof t){const i=new Dt(t);return e.set(i.node.id,i),i}const i=(t=I(t)).closestContainer();if(0===i.length){let i=e.get(t.id);return i||(i=new Dt(t),e.set(t.id,i),i)}const n=mt(i.id);let s=e.get(t.id);return s?(n.set(t.id,s),e.delete(t.id),s):(s=n.get(t.id),s||(s=new Dt(t),n.set(t.id,s),s))}function Ft(t){const e=t.responseText||t.response;if(!e)return e;try{return JSON.parse(e)}catch(t){return e}}function Rt(t){const e=new XMLHttpRequest;t.onProgress&&e.upload&&(e.upload.onprogress=e=>{e.total>0&&(e.percent=e.loaded/e.total*100),t.onProgress&&t.onProgress(e)});const i=new FormData,n=t.data||{};Object.keys(n).forEach((t=>{const e=n[t];Array.isArray(e)?e.forEach((e=>{i.append(`${t}[]`,e)})):i.append(t,e)}));const s=t.filename||"file";t.file instanceof Blob?i.append(s,t.file,t.file.name):i.append(s,t.file),e.onerror=e=>{t.onError&&t.onError(e)},e.onload=()=>{if(e.status<200||e.status>=300){if(!t.onError)return;return t.onError(function(t,e){const i=`Cannot ${t.method} ${t.action} ${e.status}'`,n=new Error(i);return n.status=e.status,n.method=t.method,n.url=t.action,n}(t,e),Ft(e))}if(t.onSuccess)return t.onSuccess(Ft(e),e)},e.open(t.method,t.action,!0),t.withCredentials&&"withCredentials"in e&&(e.withCredentials=!0);const o=t.headers||{};return null!==o["X-Requested-With"]&&e.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(o).forEach((t=>{null!==o[t]&&e.setRequestHeader(t,o[t])})),e.send(i),e}function jt(t){const{editor:e,name:i,file:n,onError:s,onSuccess:o}=t,{requestMethod:r,requestAction:a,requestTypes:l}=e.config[i];if(l.indexOf(n.type)<0)throw s&&s(`File "${n.name}" is not allowed for uploading.`),new Error(`Cannot upload file "${n.name}" because its type "${n.type}" is not found in ['${l.join("', '")}'].`);const d=e.selection.insertBox(i,{url:URL.createObjectURL(n),status:"uploading",name:n.name,size:n.size,type:n.type,lastModified:n.lastModified});let c=Rt({onProgress:t=>{const e=d.node.find(".lake-percent"),i=Math.round(t.percent);e.text(`${i<100?i:99} %`)},onError:(t,e)=>{c=null,A(t.toString(),e),d.updateValue("status","error"),d.render(),s&&s(t.toString())},onSuccess:t=>{if(c=null,!t.url)return d.updateValue("status","error"),d.render(),void(s&&s("Cannot find the url field."));d.updateValue({status:"done",url:t.url}),d.render(),e.history.save(),o&&o()},file:n,action:a,method:r});return d.event.on("beforeunmount",(()=>{c&&(c.abort(),A("Upload canceled"))})),d}var Wt=Object.freeze({__proto__:null,appendDeepest:Z,camelCase:l,changeTagName:V,debug:A,denormalizeValue:g,encode:r,fileSize:w,fixNumberedList:F,fromBase64:h,getBox:Vt,getCSS:y,getDeepest:H,inString:d,mergeNodes:z,modifierText:v,morph:ht,nodeAndView:pt,normalizeValue:f,parseStyle:m,query:I,removeBr:N,removeZWS:D,request:Rt,safeTemplate:a,setBlockIndent:R,splitNodes:P,template:s,toBase64:c,toHex:u,toNodeList:x,uploadFile:jt,wrapNodeList:$});class qt{constructor(t){this.fragment=null!=t?t:document.createDocumentFragment()}get(){return this.fragment}find(t){const e=[];let i=new L(this.fragment.firstChild);for(;i.length>0;)i.matches(t)?e.push(i.get(0)):i.isElement&&i.find(t).each((t=>{e.push(t)})),i=i.next();return new L(e)}append(t){I(t).each((t=>{this.fragment.appendChild(t)}))}}const Ut={id:/^[\w-]+$/,class:/^[\w-]+$/,style:{"text-align":["left","center","right","justify","start","end"],"margin-left":/^-?\d+px$/i,"text-indent":/^-?\d+em$/i}};function Kt(){return{h1:Object.assign({},Ut),h2:Object.assign({},Ut),h3:Object.assign({},Ut),h4:Object.assign({},Ut),h5:Object.assign({},Ut),h6:Object.assign({},Ut),p:Object.assign({},Ut),blockquote:Object.assign(Object.assign({},Ut),{type:["info","tip","success","warning","error","danger"]}),ul:Object.assign(Object.assign({},Ut),{type:"checklist",indent:/^\d+$/}),ol:Object.assign(Object.assign({},Ut),{start:/^\d+$/,indent:/^\d+$/}),li:{value:["true","false"]},table:{style:{width:/^-?\d+(px|%)$/i,height:/^-?\d+(px|%)$/i,border:/^[^"]+$/,"border-width":/^-?\d+px$/i,"border-style":/^[\w-]+$/,"border-color":/^[^"]+$/,"background-color":/^[^"]+$/}},tr:{style:{height:/^-?\d+(px|%)$/i}},th:"td",td:{colspan:/^\d+$/,rowspan:/^\d+$/,style:{width:/^-?\d+(px|%)$/i,height:/^-?\d+(px|%)$/i,border:/^[^"]+$/,"border-width":/^-?\d+px$/i,"border-style":/^[\w-]+$/,"border-color":/^[^"]+$/,"background-color":/^[^"]+$/,"text-align":["left","center","right","justify"]}},"lake-box":{type:["inline","block"],name:/^[\w-]+$/,value:/^[^"]+$/,focus:["start","center","end"]},br:{},hr:{},img:{src:/^[^"]+$/,width:/^-?\d+px$/i,height:/^-?\d+px$/i,"data-lake-value":/^[^"]+$/,alt:/^[^"]+$/,style:{width:/^-?\d+px$/i,height:/^-?\d+px$/i}},span:{class:/^[\w-]+$/,style:{color:/^[^"]+$/,"background-color":/^[^"]+$/,"font-family":/^[^;]+$/,"font-size":/^[^"]+$/}},b:"strong",strong:{},em:"i",i:{},u:{},s:{},sub:{},sup:{},code:{},a:{class:/^[\w-]+$/,name:/^[\w-]+$/,href:/^[^"]+$/,target:/^[\w-]+$/,rel:/^[^"]+$/,download:/^[^"]+$/},"lake-bookmark":{type:["anchor","focus"]}}}class Gt{constructor(t,e=Kt()){this.rules=e,this.source="string"==typeof t?this.parseHTML(t):t}parseHTML(t){const e=(new DOMParser).parseFromString(t,"text/html");return new L(e.querySelector("body"))}static matchRule(t,e){return"string"==typeof t?t===e:Array.isArray(t)?t.indexOf(e)>=0:t instanceof RegExp&&t.test(e)}static getOpenTagString(t,e){let i=t.name,n=e[i];if(!n)return"";"string"==typeof n&&(i=n,n=e[i]);const s=t.get(0);if(!s.hasAttributes())return i;const o=new Map;for(const t of s.attributes)if(n[t.name]&&("style"!==t.name&&Gt.matchRule(n[t.name],t.value)&&o.set(t.name,t.value),"style"===t.name)){const e=n.style,i=new Map,s=m(t.value);for(const t of Object.keys(s)){const n=s[t];e[t]&&Gt.matchRule(e[t],n)&&i.set(t,n)}o.set("style",i)}let r=i;for(const[t,e]of o)if("style"===t){let t="";for(const[i,n]of e)t+=`${i}: ${n.replace(/"/g,"&quot;")}; `;""!==t&&(r+=` style="${t.trim()}"`)}else r+=` ${t}="${e}"`;return r}static getClosedTagString(t,e){let i=t.name;const n=e[i];return n?("string"==typeof n&&(i=n),i):""}static getTrimmedText(t){const e=t.parent(),i=t.prev(),n=t.next();let s=t.text();return(i.isBlock||i.isBlockBox)&&(n.isBlock||n.isBlockBox)||0===i.length&&0===n.length&&e.isBlock?s=s.replace(/^[\u0020\t\r\n]+|[\u0020\t\r\n]+$/g,""):i.isBlock||i.isBlockBox||0===i.length&&e.isBlock?s=s.replace(/^[\u0020\t\r\n]+/,""):(n.isBlock||n.isBlockBox||0===n.length&&e.isBlock)&&(s=s.replace(/[\u0020\t\r\n]+$/,"")),s}getHTML(){const t=this.rules;let e="";for(const i of function*e(i){let n=i.first();for(;n.length>0;){const i=n.next();if(n.isText)yield r(Gt.getTrimmedText(n));else if(n.isVoid){const e=Gt.getOpenTagString(n,t);""!==e&&(yield`<${e} />`)}else if(n.isElement){const i=Gt.getOpenTagString(n,t),s=Gt.getClosedTagString(n,t);""!==i&&(yield`<${i}>`),n.isBox||(yield*e(n)),""!==s&&(yield`</${s}>`)}n=i}}(this.source))e+=i;return e.trim()}getFragment(){const t=this.getHTML(),e=this.parseHTML(t),i=document.createDocumentFragment();let n=e.first();for(;n.length>0;){const t=n.next();i.appendChild(n.get(0)),n=t}return i}}class Xt{constructor(t){this.content=t}getHTML(){let t=this.content;return t=t.replace(/ {2}/g,"  "),t=r(t.trim()),t=`<p>${t}</p>`,t=t.replace(/(\r\n){2,}/g,"</p><p><br /></p><p>"),t=t.replace(/\r\n/g,"</p><p>"),t=t.replace(/[\r\n]{2,}/g,"</p><p><br /></p><p>"),t=t.replace(/[\r\n]/g,"</p><p>"),t}getFragment(){return new Gt(this.getHTML()).getFragment()}}function Yt(t,e){if(t.commonAncestor.isOutside)return;const i=(e=I(e)).get(0),n=t.get();n.insertNode(i),n.setEndAfter(i),n.collapse(!1)}function Jt(t){if(t.commonAncestor.isOutside)return{anchor:new L,focus:new L};const e=t.startNode.closest("lake-box");if(e.length>0)return t.isBoxStart?e.attr("focus","start"):t.isBoxEnd?e.attr("focus","end"):e.attr("focus","center"),{anchor:new L,focus:e};if(t.isCollapsed){const e=t.clone();e.collapseToEnd();const i=I('<lake-bookmark type="focus" />');return Yt(e,i),{anchor:new L,focus:i}}const i=t.clone();i.collapseToStart();const n=I('<lake-bookmark type="anchor" />');Yt(i,n);const s=t.clone();s.collapseToEnd();const o=I('<lake-bookmark type="focus" />');return Yt(s,o),{anchor:n,focus:o}}function Qt(t,e){const i=t.prev(),n=t.next();if(i.isText||n.isText){const e=t.parent();t.remove(),e.get(0).normalize()}else if(0===i.length&&0===n.length){if(t.parent().isMark&&e){const i=new L(document.createTextNode("​"));t.before(i),e.setStartAfter(i),e.collapseToStart()}t.remove()}else t.remove()}function te(t,e){const i=e.anchor,n=e.focus;if(i.length>0&&0===n.length)Qt(i);else{if(n.length>0&&0===i.length){if(n.isBox){const e=Vt(n);0===e.getContainer().length&&e.render();const i=n.attr("focus");return"start"===i?t.selectBoxStart(n):"center"===i?t.selectBox(n):t.selectBoxEnd(n),void n.removeAttr("focus")}return t.setStartBefore(n),t.collapseToStart(),void Qt(n,t)}if(i.length>0&&n.length>0){const e=new M;e.selectNode(i),e.collapseToEnd(),-1===e.compareAfterNode(n)?(t.setStartBefore(n),Qt(n),t.setEndBefore(i),Qt(i)):(t.setStartBefore(i),Qt(i),t.setEndBefore(n),Qt(n))}}}function ee(t){if(t.commonAncestor.isOutside)return;F(t.getBlocks())}function ie(t){if(t.isCollapsed)return;if(t.adjustBox(),t.adjustTable(),t.isInoperative)return;const e=t.startNode.closestBlock(),i=t.endNode.closestBlock(),n=e.get(0)===i.get(0);if(t.get().deleteContents(),t.adjustBlock(),n){const e=t.getBlocks()[0];return void(e&&e.isEmpty&&(Z(e,I("<br />")),t.shrinkAfter(e)))}const s=t.getBlocks()[0];if(!s)return;const o=s.prev();if(0===o.length)return;const r=Jt(t);z(o,s),te(t,r),ee(t)}function ne(t,e){if(e instanceof qt&&(e=e.get()),t.commonAncestor.isOutside)return;t.isCollapsed?t.adjustBox():ie(t);N(t.startNode.closestBlock());const i=Jt(t);i.focus.before(e),te(t,i),t.adjustBlock()}function se(t,e){if(t.commonAncestor.isOutside)return;if(t.isCollapsed){if(t.commonAncestor.closest("lake-box").isBlockBox)return}if("string"!=typeof e){const i=t.getBlocks();for(const t of i)t.css(e);return}const i=I(e),n=i.name,s=i.get(0).attributes,o=t.getBlocks();if(o.length>0){const e=Jt(t);for(const t of o)if(t.name===n&&0===i.first().length)for(const e of s)t.attr(e.name,e.value);else{const e=i.clone(!0);e.isList&&t.isList&&""!==t.attr("indent")&&e.attr("indent",t.attr("indent"));const n=H(e);let s=t.first();for(;s.length>0;){const t=s.next();n.append(s),n.name!==s.name&&"li"!==s.name||s.remove(!0),s=t}t.replaceWith(e)}return te(t,e),void ee(t)}const r=Jt(t),a=function(t){const e=t.commonAncestor.closest('div[contenteditable="true"],td');let i=[];if(0===e.length)return i;let n=e.first(),s=!0;for(;n.length>0;){if(n.isMark||n.isText||n.isBookmark||n.isInlineBox)i.push(n);else{if(!s)break;i=[]}t.intersectsNode(n)&&(s=!1),n=n.next()}return i}(t),l=$(a,i);te(t,r),ee(t),l.isEmpty&&(Z(l,I("<br />")),t.shrinkAfter(l))}function oe(t){if(t.commonAncestor.isOutside)return{start:null,end:null};t.isCollapsed?t.adjustBox():ie(t);const e=t.startNode,i=e.closestOperableBlock();if(0===i.length)return{start:null,end:null};let n=i.parent();n.isOutside&&(n=e.closestContainer());const s=P(e,t.startOffset,n);let o=null,r=null;return s&&(o=s.start,r=s.end),!s&&e.isBlock&&(t.startOffset>0&&(o=e.children()[t.startOffset-1]),r=e.children()[t.startOffset],r&&!r.isBlock&&(r=null)),o&&o.isEmpty&&Z(o,I("<br />")),r&&(r.isEmpty?(Z(r,I("<br />")),t.shrinkAfter(r)):t.shrinkBefore(r)),ee(t),{start:o,end:r}}function re(t){if(t.isMark&&t.isEmpty)t.remove();else for(const e of t.getWalker())e.isMark&&e.isEmpty&&e.remove()}function ae(t,e,i){let n=null,s=null,o=t.closestBlock();0===o.length&&(o=t.closestContainer());const r=P(t,e,o);return r&&(i?(re(r.start),re(r.end),r.start.isEmpty||(n=r.start),r.end.isEmpty||(s=r.end)):(n=r.start,s=r.end)),{start:n,end:s}}function le(t,e=!0){if(t.commonAncestor.isOutside)return{start:null,center:null,end:null};if(t.adjustBox(),t.isCollapsed){const i=ae(t.startNode,t.startOffset,e);return i.start?(t.setStartAfter(i.start),t.collapseToStart()):i.end&&(t.setStartBefore(i.end),t.collapseToStart()),{start:i.start,center:null,end:i.end}}const i=ae(t.startNode,t.startOffset,e);i.start?t.setStartAfter(i.start):i.end&&t.setStartBefore(i.end);const n=ae(t.endNode,t.endOffset,e);return n.start?t.setEndAfter(n.start):n.end&&t.setEndBefore(n.end),{start:i.start,center:n.start,end:n.end}}function de(t,e){const i=t.text();let n=t;for(;n.length>0;){const t=n.parent();if(!t.isMark||i!==t.text()||!n.isText&&n.name===e&&""!==n.attr("style"))break;n=t}return n}function ce(t,e){if(t.commonAncestor.isOutside)return;let i=I(e);const n=i.name,s=m(i.attr("style"));if(t.isCollapsed){if(t.isBox){const e=t.startNode.closest("lake-box");if("block"===Vt(e).type){const i=I("<p><br /></p>");t.isBoxStart?e.before(i):e.after(i),t.shrinkAfter(i)}else t.adjustBox()}N(t.startNode.closestBlock());const e=new L(document.createTextNode("​")),o=le(t);if(o.start){const t=function(t){if(!t.isMark)return null;let e=t.clone(),i=t.last();for(;i.length>0;){if(i.isMark){const t=i.clone();e.append(t),e=t}i=i.last()}return e}(o.start);t&&(t.name===n?(t.css(s),i=t):(Z(t,e),i.append(t)))}return""===i.text()&&i.append(e),Yt(t,i),function(t){const e=t.prev();e.length>0&&e.isText&&e.isEmpty&&e.remove();const i=t.next();i.length>0&&i.isText&&i.isEmpty&&i.remove()}(i),void t.shrinkAfter(i)}le(t);const o=t.getMarks(!0),r=Jt(t);for(const t of o)if(!t.isEmpty&&t.isText){const e=de(t,n);if(e.isMark&&e.name===n)e.css(s);else{const t=i.clone();e.before(t),t.append(e)}}te(t,r)}function he(t){if(t.isMark&&t.isEmpty)t.remove();else for(const e of t.getWalker())e.isMark&&e.isEmpty&&e.remove()}function pe(t,e){if(t.commonAncestor.isOutside)return;let i;if(e){i=I(e).name}if(t.isCollapsed){if(t.isBox)return;if(i&&0===t.commonAncestor.closest(i).length)return;const e=le(t,!1);if(!e.start)return;e.end&&he(e.end);const n=new L(document.createTextNode("​")),s=function(t,e){if(!t.isMark||!e)return null;let i=t.clone(),n=t.last();for(;n.length>0;){if(n.isMark&&n.name!==e){const t=n.clone();i.append(t),i=t}n=n.last()}if(i.name===e){if(!(i.first().length>0))return null;i=i.first()}return i}(e.start,i);return s?(Z(s,n),e.start.after(s),he(e.start),void t.shrinkAfter(s)):(e.start.after(n),he(e.start),n.prev().isText?(t.setStartAfter(n.prev()),t.collapseToStart(),void n.remove()):(t.setStartAfter(n),void t.collapseToStart()))}le(t);const n=t.getMarks(),s=Jt(t);for(const t of n)if(!i||t.name===i){const e=t.parent();t.remove(!t.isEmpty),e.length>0&&e.get(0).normalize()}D(t.commonAncestor),te(t,s)}function ue(t,e){if(t.commonAncestor.isOutside)return null;const i=I(e);if(t.isCollapsed){let e=t.commonAncestor.closest("a");if(0===e.length){e=i.clone(!0);return N(t.startNode.closestBlock()),Yt(t,e),e}return""!==i.attr("href")&&e.attr({href:i.attr("href")}),e}le(t);const n=Jt(t);for(const e of t.commonAncestor.getWalker())"a"===e.name&&t.intersectsNode(e)&&e.remove(!0);const s=i.clone(!1);n.anchor.after(s);let o=s.next();for(;o.length>0;){const t=o.next();if(!o.isMark&&!o.isText)break;s.append(o),o=t}return 0===s.first().length&&s.remove(),te(t,n),s}function me(t,e,i){if(t.commonAncestor.isOutside)return null;const n=Vt(e);i&&(n.value=i);const s=document.createDocumentFragment();if(s.appendChild(n.node.get(0)),"inline"===n.type)return ne(t,s),n.render(),t.selectBoxEnd(n.node),Vt(n.node);const o=oe(t);return o.start&&(t.setEndAfter(o.start),t.collapseToEnd()),o.end&&o.end.isEmpty&&o.end.remove(),ne(t,s),n.render(),t.selectBoxEnd(n.node),o.start&&o.start.isEmpty&&o.start.remove(),Vt(n.node)}function fe(t){const e=t.node.closestContainer();if(t.unmount(),t.node.remove(),e.length>0){mt(e.id).delete(t.node.id);mt(0).set(t.node.id,t)}return t}function ge(t){if(t.commonAncestor.isOutside)return null;const e=t.commonAncestor.closest("lake-box");if(0===e.length)return null;const i=Vt(e);if("block"===i.type){const n=I("<p><br /></p>");return e.before(n),t.shrinkAfter(n),fe(i)}t.setStartBefore(e),t.collapseToStart();const n=e.parent();return fe(i),n.isEmpty&&(Z(n,I("<br />")),t.shrinkAfter(n)),i}var ve={exports:{}};function we(t,e=100,i={}){if("function"!=typeof t)throw new TypeError(`Expected the first parameter to be a function, got \`${typeof t}\`.`);if(e<0)throw new RangeError("`wait` must not be negative.");const{immediate:n}="boolean"==typeof i?{immediate:i}:i;let s,o,r,a,l;function d(){const e=s,i=o;return s=void 0,o=void 0,l=t.apply(e,i),l}function c(){const t=Date.now()-a;t<e&&t>=0?r=setTimeout(c,e-t):(r=void 0,n||(l=d()))}const h=function(...t){if(s&&this!==s)throw new Error("Debounced method called with different contexts.");s=this,o=t,a=Date.now();const i=n&&!r;return r||(r=setTimeout(c,e)),i&&(l=d()),l};return h.clear=()=>{r&&(clearTimeout(r),r=void 0)},h.flush=()=>{r&&h.trigger()},h.trigger=()=>{l=d(),h.clear()},h}ve.exports.debounce=we,ve.exports=we;var ye=ft(ve.exports),xe=ft((function t(e,i){if(e===i)return!0;if(e&&i&&"object"==typeof e&&"object"==typeof i){if(e.constructor!==i.constructor)return!1;var n,s,o;if(Array.isArray(e)){if((n=e.length)!=i.length)return!1;for(s=n;0!=s--;)if(!t(e[s],i[s]))return!1;return!0}if(e instanceof Map&&i instanceof Map){if(e.size!==i.size)return!1;for(s of e.entries())if(!i.has(s[0]))return!1;for(s of e.entries())if(!t(s[1],i.get(s[0])))return!1;return!0}if(e instanceof Set&&i instanceof Set){if(e.size!==i.size)return!1;for(s of e.entries())if(!i.has(s[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(i)){if((n=e.length)!=i.length)return!1;for(s=n;0!=s--;)if(e[s]!==i[s])return!1;return!0}if(e.constructor===RegExp)return e.source===i.source&&e.flags===i.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===i.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===i.toString();if((n=(o=Object.keys(e)).length)!==Object.keys(i).length)return!1;for(s=n;0!=s--;)if(!Object.prototype.hasOwnProperty.call(i,o[s]))return!1;for(s=n;0!=s--;){var r=o[s];if(!t(e[r],i[r]))return!1}return!0}return e!=e&&i!=i}));function be(t){const e=t.get(0),i={};if(e.hasAttributes())for(const t of e.attributes)i[t.name]=t.value;return i}class ke{constructor(t){const e=window.getSelection();if(!e)throw new Error("Selection object is null.");this.selection=e,this.container=t,this.range=this.getRangeFromNativeSelection()}getRangeFromNativeSelection(){if(this.selection.rangeCount>0){const t=this.selection.getRangeAt(0);return new M(t)}return new M}sync(){this.selection.removeAllRanges(),this.selection.addRange(this.range.get())}updateByRange(){const t=this.getRangeFromNativeSelection();this.range.startNode.get(0)===t.startNode.get(0)&&this.range.startOffset===t.startOffset&&this.range.endNode.get(0)===t.endNode.get(0)&&this.range.endOffset===t.endOffset||(this.range=t)}updateByBookmark(){const t=this.range,e=this.container,i=e.find("lake-box[focus]");if(i.length>0)return te(t,{anchor:new L,focus:i}),void this.sync();te(t,{anchor:e.find('lake-bookmark[type="anchor"]'),focus:e.find('lake-bookmark[type="focus"]')}),this.sync()}getAppliedItems(){const t=[];return function(t,e){let i=e.startNode;for(i.isText&&(i=i.parent());i.length>0&&i.isInside;)t.push({node:i,name:i.name,attributes:be(i),styles:m(i.attr("style"))}),i=i.parent()}(t,this.range),function(t,e){const i=e.startNode;let n;if(i.isText&&i.text().length===e.startOffset){const t=i.next();t.length>0&&t.isElement&&(n=t)}if(i.isElement){const t=i.children();if(t.length>0){const i=t[e.startOffset];i&&i.isElement&&(n=i)}}if(n){let e=n;for(;e.length>0;)e.isElement&&t.push({node:e,name:e.name,attributes:be(e),styles:m(e.attr("style"))}),e=e.first()}}(t,this.range),t}insertBookmark(){return Jt(this.range)}toBookmark(t){return te(this.range,t)}insertNode(t){return Yt(this.range,t)}insertFragment(t){return ne(this.range,t)}deleteContents(){return ie(this.range)}setBlocks(t){return se(this.range,t)}splitBlock(){return oe(this.range)}splitMarks(t){return le(this.range,t)}addMark(t){return ce(this.range,t)}removeMark(t){return pe(this.range,t)}fixList(){return ee(this.range)}insertLink(t){return ue(this.range,t)}selectBox(t){let e=t;e=t instanceof Dt?t.node:t,this.range.selectBox(e)}insertBox(t,e){const i=me(this.range,t,e);if(!i)throw new Error(`The box "${t}" cannot be inserted outside the editor.`);return i}removeBox(t=null){return t&&this.selectBox(t),ge(this.range)}}class Se{constructor(t){this.commandMap=new Map,this.selection=t}add(t,e){this.commandMap.set(t,e)}delete(t){this.commandMap.delete(t)}getNames(){return Array.from(this.commandMap.keys())}has(t){return void 0!==this.commandMap.get(t)}getItem(t){const e=this.commandMap.get(t);if(void 0===e)throw new Error(`Command "${t}" has not been defined yet.`);return e}isDisabled(t){const e=this.getItem(t);if(!e.isDisabled)return!1;const i=this.selection.getAppliedItems();return e.isDisabled(i)}isSelected(t){const e=this.getItem(t);if(!e.isSelected)return!1;const i=this.selection.getAppliedItems();return e.isSelected(i)}selectedValues(t){const e=this.getItem(t);if(!e.selectedValues)return[];const i=this.selection.getAppliedItems();return e.selectedValues(i)}execute(t,...e){this.getItem(t).execute.apply(this,e),A(`Command "${t}" executed`)}}class Ce{constructor(t){this.canSave=!0,this.list=[],this.index=0,this.limit=100,this.event=new vt,this.selection=t,this.container=t.container}removeBookmark(t){return t.replace(/(<lake-box[^>]+)\s+focus="\w+"([^>]*>)/gi,"$1$2").replace(/<lake-bookmark\s+type="anchor">\s*<\/lake-bookmark>/gi,"").replace(/<lake-bookmark\s+type="focus">\s*<\/lake-bookmark>/gi,"")}getValue(t){return new Gt(t).getHTML()}addIdToBoxes(t){t.find("lake-box").each((t=>{const e=new L(t),i=`${e.attr("name")}-${e.attr("value")}`;e.attr("id",i)}))}removeIdfromBoxes(t){t.find("lake-box").each((t=>{new L(t).removeAttr("id")}))}morphContainer(t){const e=this.container,i={beforeChildrenUpdated:t=>{if("lake-box"===new L(t).name)return!1},afterAttributeUpdated:(t,i)=>{const n=new L(i);if(["name","value"].indexOf(t)>=0&&"lake-box"===n.name){Vt(n).unmount();mt(e.id).delete(n.id)}}},n=t.clone(!0);this.addIdToBoxes(e),this.addIdToBoxes(n),ht(e,n,{callbacks:i}),this.removeIdfromBoxes(e),this.removeIdfromBoxes(n)}get canUndo(){return this.index>1&&!!this.list[this.index-2]}get canRedo(){return!!this.list[this.index]}cloneContainer(){const t=this.selection.range,e=this.container.clone(!0);if(e.find("lake-box").each((t=>{Vt(t).getContainer().empty()})),t.commonAncestor.isOutside)return e;if(t.isInsideBox){const i=t.commonAncestor.closest("lake-box").path(),n=e.find(i),s=t.clone();return s.selectBox(n),Jt(s),e}const i=t.startNode.path(),n=t.endNode.path(),s=e.find(i),o=e.find(n),r=t.clone();return r.setStart(s,t.startOffset),r.setEnd(o,t.endOffset),Jt(r),e}undo(){if(!this.list[this.index-2])return;this.selection.insertBookmark();const t=this.getValue(this.container);for(;this.index>1;){const e=this.list[this.index-2];if(!e)break;this.index--;const i=this.getValue(e);if(this.removeBookmark(i)!==this.removeBookmark(t)){this.morphContainer(e),this.event.emit("undo",i);break}}this.selection.updateByBookmark(),A(`History undone (index: ${this.index})`)}redo(){if(!this.list[this.index])return;this.selection.insertBookmark();const t=this.getValue(this.container);for(;this.index<this.list.length;){const e=this.list[this.index];if(!e)break;this.index++;const i=this.getValue(e);if(this.removeBookmark(i)!==this.removeBookmark(t)){this.morphContainer(e),this.event.emit("redo",i);break}}this.selection.updateByBookmark(),A(`History redone (index: ${this.index})`)}continue(){this.canSave=!0}pause(){this.canSave=!1}save(t={}){var e,i,n;const s=null!==(e=t.inputType)&&void 0!==e?e:"",o=null!==(i=t.update)&&void 0!==i&&i,r=null===(n=t.emitEvent)||void 0===n||n;if(!this.canSave)return;const a=this.cloneContainer(),l=this.getValue(a);this.list[this.index-1]&&this.removeBookmark(this.getValue(this.list[this.index-1]))===this.removeBookmark(l)||(o?this.list.splice(this.index-1,1/0,a):(this.list.splice(this.index,1/0,a),this.index++),this.list.length>this.limit&&(this.list.shift(),this.index=this.list.length),A(`History saved (index: ${this.index}, inputType: "${s}", update: ${o}, emitEvent: ${r})`),r&&this.event.emit("save",g(l),{inputType:s,update:o,emitEvent:r}))}}var _e={};Object.defineProperty(_e,"__esModule",{value:!0});for(var Be="undefined"!=typeof window&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),Ae={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},Te={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:Be?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},Ee={backspace:8,tab:9,enter:13,shift:16,control:17,alt:18,pause:19,capslock:20,escape:27," ":32,pageup:33,pagedown:34,end:35,home:36,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,insert:45,delete:46,meta:91,numlock:144,scrolllock:145,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},Le=1;Le<20;Le++)Ee["f"+Le]=111+Le;function Ie(t,e,i){e&&!("byKey"in e)&&(i=e,e=null),Array.isArray(t)||(t=[t]);var n=t.map((function(t){return Me(t,e)})),s=function(t){return n.some((function(e){return Pe(e,t)}))};return null==i?s:s(i)}function Me(t,e){var i=e&&e.byKey,n={},s=(t=t.replace("++","+add")).split("+"),o=s.length;for(var r in Ae)n[Ae[r]]=!1;var a=!0,l=!1,d=void 0;try{for(var c,h=s[Symbol.iterator]();!(a=(c=h.next()).done);a=!0){var p=c.value,u=p.endsWith("?")&&p.length>1;u&&(p=p.slice(0,-1));var m=Ne(p),f=Ae[m];if(p.length>1&&!f&&!Te[p]&&!Ee[m])throw new TypeError('Unknown modifier: "'+p+'"');1!==o&&f||(i?n.key=m:n.which=Ze(p)),f&&(n[f]=!u||null)}}catch(t){l=!0,d=t}finally{try{!a&&h.return&&h.return()}finally{if(l)throw d}}return n}function Pe(t,e){for(var i in t){var n=t[i],s=void 0;if(null!=n&&((null!=(s="key"===i&&null!=e.key?e.key.toLowerCase():"which"===i?91===n&&93===e.which?91:e.which:e[i])||!1!==n)&&s!==n))return!1}return!0}function Ze(t){return t=Ne(t),Ee[t]||t.toUpperCase().charCodeAt(0)}function Ne(t){return t=t.toLowerCase(),t=Te[t]||t}_e.default=Ie,_e.isHotkey=Ie,_e.isCodeHotkey=function(t,e){return Ie(t,e)};var Oe=_e.isKeyHotkey=function(t,e){return Ie(t,{byKey:!0},e)};_e.parseHotkey=Me,_e.compareHotkey=Pe,_e.toKeyCode=Ze,_e.toKeyName=Ne;const ze=new Map([["arrow-left","left"],["arrow-right","right"],["arrow-up","up"],["arrow-down","down"]]);class He{constructor(t){this.keydownEventList=[],this.keyupEventList=[],this.container=t,this.container.on("keydown",(t=>{const e=t;if(!e.isComposing)for(const t of this.keydownEventList)if(Oe(t.type,e)&&!1===t.listener(e))break})),this.container.on("keyup",(t=>{const e=t;if(!e.isComposing)for(const t of this.keyupEventList)if(Oe(t.type,e)&&!1===t.listener(e))break}))}normalizeType(t){var e;return t=null!==(e=ze.get(t))&&void 0!==e?e:t}setKeydown(t,e){t=this.normalizeType(t),this.keydownEventList.push({type:t,listener:e})}setKeyup(t,e){t=this.normalizeType(t),this.keyupEventList.push({type:t,listener:e})}keydown(t){t=this.normalizeType(t);for(const e of this.keydownEventList)if(e.type===t&&!1===e.listener(new KeyboardEvent(t)))break}keyup(t){t=this.normalizeType(t);for(const e of this.keyupEventList)if(e.type===t&&!1===e.listener(new KeyboardEvent(t)))break}}const $e={value:"<p><br /></p>",readonly:!1,spellcheck:!1,tabIndex:0,placeholder:"",indentWithTab:!0,lang:"en-US",minChangeSize:5,historySize:100,onMessage:(t,e)=>{"success"!==t?"warning"!==t?"error"===t&&console.error(e):console.warn(e):console.log(e)}};class De{constructor(t){if(this.unsavedInputData="",this.unsavedInputCount=0,this.state={appliedItems:[],disabledNameMap:new Map,selectedNameMap:new Map,selectedValuesMap:new Map},this.isComposing=!1,this.event=new vt,this.box=De.box,this.copyListener=t=>{this.selection.range.commonAncestor.closestContainer().get(0)===this.container.get(0)&&this.event.emit("copy",t)},this.cutListener=t=>{this.selection.range.commonAncestor.closestContainer().get(0)===this.container.get(0)&&this.event.emit("cut",t)},this.pasteListener=t=>{this.selection.range.commonAncestor.closestContainer().get(0)===this.container.get(0)&&this.event.emit("paste",t)},this.selectionchangeListener=()=>{this.selection.updateByRange(),this.updateBoxSelectionStyle(),this.emitStateChangeEvent()},this.clickListener=t=>{const e=new L(t.target);!e.get(0).isConnected||e.closest(".lake-popup").length>0||this.event.emit("click",e)},this.resizeListener=()=>{this.event.emit("resize")},this.updateBoxSelectionStyle=ye((()=>{if(0===this.root.first().length)return;const t=this.selection.range,e=t.clone();e.adjustBox(),this.container.find("lake-box").each((i=>{const n=Vt(i),s=n.getContainer();if(0!==s.length){if(t.compareBeforeNode(s)<0&&t.compareAfterNode(s)>0&&(!t.isCollapsed||t.startNode.get(0)!==s.get(0)||0!==t.startOffset))return s.removeClass("lake-box-hovered"),s.removeClass("lake-box-selected"),s.removeClass("lake-box-focused"),s.addClass("lake-box-activated"),void n.event.emit("focus");if(e.intersectsNode(n.node))return s.removeClass("lake-box-activated"),void(t.isCollapsed?(s.removeClass("lake-box-hovered"),s.removeClass("lake-box-selected"),s.addClass("lake-box-focused"),n.event.emit("focus")):(s.removeClass("lake-box-focused"),s.addClass("lake-box-selected"),n.event.emit("blur")));s.removeClass("lake-box-activated"),s.removeClass("lake-box-focused"),s.removeClass("lake-box-selected"),n.event.emit("blur")}}))}),50,{immediate:!0}),this.emitStateChangeEvent=ye((()=>{const t=this.command.getNames();let e=this.selection.getAppliedItems();e.length>0&&e[0].node.closestContainer().get(0)!==this.container.get(0)&&(e=[]);const i=new Map,n=new Map,s=new Map;if(e.length>0)for(const o of t){const t=this.command.getItem(o);if(t.isDisabled&&t.isDisabled(e)&&i.set(o,!0),t.isSelected&&t.isSelected(e)&&n.set(o,!0),t.selectedValues){const i=t.selectedValues(e);i.length>0&&s.set(o,i)}}const o={appliedItems:e,disabledNameMap:i,selectedNameMap:n,selectedValuesMap:s};xe(o,this.state)||(this.toolbar&&this.toolbar.updateState(o),this.event.emit("statechange",o),this.state=o)}),50,{immediate:!1}),!t.root)throw new Error("The root of the config must be specified.");this.root=I(t.root),this.toolbar=t.toolbar,this.config=Object.assign({},$e);for(const e of Object.keys(t))this.config[e]=t[e];this.containerWrapper=I('<div class="lake-container-wrapper" />'),this.container=I('<div class="lake-container" />'),this.overlayContainer=I('<div class="lake-overlay" />'),this.popupContainer=I('<div class="lake-popup lake-custom-properties" />'),this.readonly=this.config.readonly,this.root.addClass("lake-custom-properties"),this.container.attr({contenteditable:this.readonly?"false":"true",spellcheck:this.config.spellcheck?"true":"false",tabindex:this.config.tabIndex.toString()}),""!==this.config.placeholder&&this.container.attr("placeholder",this.config.placeholder),this.selection=new ke(this.container),this.command=new Se(this.selection),this.history=new Ce(this.selection),this.history.limit=this.config.historySize,this.keystroke=new He(this.container),yt.set(this.container.id,this)}togglePlaceholderClass(t){const e="lake-placeholder";"<p><br /></p>"===(t=g(t)).replace("<focus />","")?this.container.addClass(e):this.container.removeClass(e)}moveBoxStripText(){const t=this.selection,e=t.range,i=e.startNode.closest(".lake-box-strip"),n=i.closest("lake-box");if("inline"===Vt(n).type)e.isBoxStart?(e.setStartBefore(n),e.collapseToStart()):(e.setStartAfter(n),e.collapseToStart());else{const t=I("<p />");e.isBoxStart?n.before(t):n.after(t),e.shrinkAfter(t)}const s=i.text();i.html("<br />"),t.insertNode(document.createTextNode(s))}resetUnsavedInputData(){this.unsavedInputData="",this.unsavedInputCount=0}bindInputEvents(){this.container.on("compositionstart",(()=>{this.isComposing=!0})),this.container.on("compositionend",(()=>{this.isComposing=!1})),this.container.on("beforeinput",(t=>{const e=t;this.isComposing&&"insertText"===e.inputType&&(e.preventDefault(),this.isComposing=!1,this.history.save({inputType:"insertText"}))})),this.container.on("input",(t=>{const e=t;window.setTimeout((()=>{var t;const i=this.selection.range;if(!i.isInsideBox){if(this.isComposing)return"insertCompositionText"===e.inputType&&this.container.removeClass("lake-placeholder"),void this.event.emit("input",e);if(i.isBoxStart||i.isBoxEnd)return this.moveBoxStripText(),this.history.save(),void this.event.emit("input",e);if("insertText"===e.inputType||"insertCompositionText"===e.inputType)return this.unsavedInputData+=null!==(t=e.data)&&void 0!==t?t:"",this.unsavedInputCount++,this.unsavedInputData.length<this.config.minChangeSize?this.history.save({inputType:"insertText",update:this.unsavedInputCount>1}):(this.history.save({inputType:"insertText",update:!0}),this.resetUnsavedInputData()),void this.event.emit("input",e);this.history.save(),this.event.emit("input",e)}}),0)}))}bindHistoryEvents(){const t=t=>{this.fixContent()&&(this.history.save({update:!0,emitEvent:!1}),t=this.getValue()),this.emitStateChangeEvent(),this.togglePlaceholderClass(t),this.scrollToCaret(),this.event.emit("change",t)};this.history.event.on("undo",(e=>{this.renderBoxes(),t(e),this.resetUnsavedInputData()})),this.history.event.on("redo",(e=>{this.renderBoxes(),t(e),this.resetUnsavedInputData()})),this.history.event.on("save",((e,i)=>{this.removeBoxGarbage(),t(e),this.selection.sync(),"insertText"!==i.inputType&&this.resetUnsavedInputData()}))}get hasFocus(){const t=document.activeElement;return!!t&&I(t).closest(".lake-container").get(0)===this.container.get(0)}get locale(){return Ot(this.config.lang)}fixContent(){const t=this.selection.range;let e=!1,i=this.container.children();for(const t of i)(t.isBlock||t.isMark)&&""===t.html()&&(t.remove(),e=!0,A(`Content fixed: empty tag "${t.name}" was removed`));if(i=this.container.children(),0===i.length)this.container.html("<p><br /></p>"),t.shrinkAfter(this.container),e=!0,A("Content fixed: default paragraph was added");else if(1===i.length){const n=i[0];if(n.isVoid){const i=I("<p />");n.before(i),i.append(n),t.shrinkAfter(i),e=!0,A(`Content fixed: void element "${n.name}" was wrapped in paragraph`)}}if(t.isCollapsed){const e=t.getPrevNode(),i=t.getNextNode();"br"===e.name&&0===i.length&&(t.setStartBefore(e),t.collapseToStart(),A("Range fixed: the caret has been moved to the front of the <br> tag"))}return e}setPluginConfig(t,e){this.config[t]||(this.config[t]={});for(const i of Object.keys(e))void 0===this.config[t][i]&&(this.config[t][i]=e[i])}removeBoxGarbage(){const t=mt(this.container.id);for(const e of t.values())e.node.get(0).isConnected||(e.unmount(),t.delete(e.node.id))}renderBoxes(){this.removeBoxGarbage();const t=this.container,e=mt(t.id);t.find("lake-box").each((t=>{const i=I(t);if(e.get(i.id))return;Vt(i).render()}))}focus(){this.container.focus()}blur(){this.container.blur()}scrollToCaret(){const t=this.selection.range;if(t.isBox)return;const e=t.getRect();if(0===e.x||0===e.y)return;const i=this.container.get(0).getBoundingClientRect(),n=I('<div class="lake-artificial-caret" />'),s=e.x-i.x,o=e.y-i.y;n.css({position:"absolute",top:`${o}px`,left:`${s}px`,width:`${e.width}px`,height:`${e.height}px`,"z-index":"-1"}),this.overlayContainer.find(".lake-artificial-caret").remove(),this.overlayContainer.append(n);const r=pt(n);(r.left<0||r.right<0||r.top<0||r.bottom<0)&&n.get(0).scrollIntoView({behavior:"instant",block:"center",inline:"nearest"}),n.remove()}setValue(t){t=f(t);const e=new Gt(t),i=e.getFragment();this.container.empty(),this.togglePlaceholderClass(e.getHTML()),this.container.append(i),this.renderBoxes(),this.selection.updateByBookmark()}getValue(){const t=this.history.cloneContainer();let e=new Gt(t).getHTML();return e=g(e),e}render(){const t=f(this.config.value),e=new Gt(t),i=e.getFragment();this.root.empty(),this.root.append(this.containerWrapper),this.containerWrapper.append(this.container),this.containerWrapper.append(this.overlayContainer),I(document.body).append(this.popupContainer),this.togglePlaceholderClass(e.getHTML()),this.container.append(i),De.plugin.loadAll(this),this.readonly||(this.selection.updateByBookmark(),this.history.save({emitEvent:!1})),this.renderBoxes(),this.toolbar&&this.toolbar.render(this),document.addEventListener("copy",this.copyListener),this.readonly||(document.addEventListener("cut",this.cutListener),document.addEventListener("paste",this.pasteListener),document.addEventListener("selectionchange",this.selectionchangeListener),document.addEventListener("click",this.clickListener),window.addEventListener("resize",this.resizeListener),this.bindInputEvents(),this.bindHistoryEvents())}unmount(){this.event.removeAllListeners(),this.history.event.removeAllListeners(),this.root.empty(),this.popupContainer.remove(),document.removeEventListener("copy",this.copyListener),this.readonly||(document.removeEventListener("cut",this.cutListener),document.removeEventListener("paste",this.pasteListener),document.removeEventListener("selectionchange",this.selectionchangeListener),document.removeEventListener("click",this.clickListener),window.removeEventListener("resize",this.resizeListener))}}De.version="0.1.18",De.box=new class{add(t){wt.set(t.name,t)}remove(t){wt.delete(t)}getNames(){return Array.from(wt.keys())}},De.plugin=new class{constructor(){this.pluginList=[]}add(t){this.pluginList.push(t)}loadAll(t){for(const e of this.pluginList)e(t)}};const Ve=[{icon:n.get("numberedList"),value:"numbered",text:t=>t.toolbar.numberedList()},{icon:n.get("bulletedList"),value:"bulleted",text:t=>t.toolbar.bulletedList()},{icon:n.get("checklist"),value:"checklist",text:t=>t.toolbar.checklist()}],Fe=[{icon:n.get("alignLeft"),value:"left",text:t=>t.toolbar.alignLeft()},{icon:n.get("alignCenter"),value:"center",text:t=>t.toolbar.alignCenter()},{icon:n.get("alignRight"),value:"right",text:t=>t.toolbar.alignRight()},{icon:n.get("alignJustify"),value:"justify",text:t=>t.toolbar.alignJustify()}],Re=[{icon:n.get("increaseIndent"),value:"increase",text:t=>t.toolbar.increaseIndent()},{icon:n.get("decreaseIndent"),value:"decrease",text:t=>t.toolbar.decreaseIndent()}],je=[{icon:n.get("italic"),value:"italic",text:t=>t.toolbar.italic()},{icon:n.get("underline"),value:"underline",text:t=>t.toolbar.underline()},{icon:n.get("strikethrough"),value:"strikethrough",text:t=>t.toolbar.strikethrough()},{icon:n.get("superscript"),value:"superscript",text:t=>t.toolbar.superscript()},{icon:n.get("subscript"),value:"subscript",text:t=>t.toolbar.subscript()},{icon:n.get("code"),value:"code",text:t=>t.toolbar.code()}],We=["#f5222d","#fa541c","#fa8c16","#faad14","#fadb14","#a0d911","#52c41a","#13c2c2","#1677ff","#2f54eb","#722ed1","#eb2f96","#fff1f0","#fff2e8","#fff7e6","#fffbe6","#feffe6","#fcffe6","#f6ffed","#e6fffb","#e6f4ff","#f0f5ff","#f9f0ff","#fff0f6","#ffccc7","#ffd8bf","#ffe7ba","#fff1b8","#ffffb8","#f4ffb8","#d9f7be","#b5f5ec","#bae0ff","#d6e4ff","#efdbff","#ffd6e7","#ffa39e","#ffbb96","#ffd591","#ffe58f","#fffb8f","#eaff8f","#b7eb8f","#87e8de","#91caff","#adc6ff","#d3adf7","#ffadd2","#ff7875","#ff9c6e","#ffc069","#ffd666","#fff566","#d3f261","#95de64","#5cdbd3","#69b1ff","#85a5ff","#b37feb","#ff85c0","#ff4d4f","#ff7a45","#ffa940","#ffc53d","#ffec3d","#bae637","#73d13d","#36cfc9","#4096ff","#597ef7","#9254de","#f759ab","#cf1322","#d4380d","#d46b08","#d48806","#d4b106","#7cb305","#389e0d","#08979c","#0958d9","#1d39c4","#531dab","#c41d7f","#a8071a","#ad2102","#ad4e00","#ad6800","#ad8b00","#5b8c00","#237804","#006d75","#003eb3","#10239e","#391085","#9e1068","#820014","#871400","#873800","#874d00","#876800","#3f6600","#135200","#00474f","#002c8c","#061178","#22075e","#780650","#5c0011","#610b00","#612500","#613400","#614700","#254000","#092b00","#002329","#001d66","#030852","#120338","#520339","#000000","#1f1f1f","#262626","#434343","#595959","#8c8c8c","#bfbfbf","#d9d9d9","#f0f0f0","#f5f5f5","#fafafa","#ffffff"],qe=[{icon:n.get("removeFormat"),value:"",text:t=>t.toolbar.removeColor()}];for(const t of We)qe.push({value:t.toLowerCase(),text:t.toUpperCase()});const Ue=new Map([["strong","bold"],["em","italic"],["i","italic"],["u","underline"],["s","strikethrough"],["sup","superscript"],["sub","subscript"],["code","code"]]),Ke=[{name:"undo",type:"button",icon:n.get("undo"),tooltip:t=>t.toolbar.undo(),onClick:(t,e)=>{t.command.execute(e)}},{name:"redo",type:"button",icon:n.get("redo"),tooltip:t=>t.toolbar.redo(),onClick:(t,e)=>{t.command.execute(e)}},{name:"selectAll",type:"button",icon:n.get("selectAll"),tooltip:t=>t.toolbar.selectAll(),onClick:(t,e)=>{t.command.execute(e)}},{name:"paragraph",type:"button",icon:n.get("paragraph"),tooltip:t=>t.toolbar.paragraph(),isSelected:t=>!!t.find((t=>"p"===t.name)),onClick:t=>{t.command.execute("heading","p")}},{name:"blockQuote",type:"button",icon:n.get("blockQuote"),tooltip:t=>t.toolbar.blockQuote(),onClick:(t,e)=>{t.command.execute(e)}},{name:"numberedList",type:"button",icon:n.get("numberedList"),tooltip:t=>t.toolbar.numberedList(),isSelected:t=>!!t.find((t=>"ol"===t.name)),onClick:t=>{t.command.execute("list","numbered")}},{name:"bulletedList",type:"button",icon:n.get("bulletedList"),tooltip:t=>t.toolbar.bulletedList(),isSelected:t=>!!t.find((t=>"ul"===t.name&&!t.node.hasAttr("type"))),onClick:t=>{t.command.execute("list","bulleted")}},{name:"checklist",type:"button",icon:n.get("checklist"),tooltip:t=>t.toolbar.checklist(),isSelected:t=>!!t.find((t=>"ul"===t.name&&"checklist"===t.node.attr("type"))),onClick:t=>{t.command.execute("list","checklist")}},{name:"alignLeft",type:"button",icon:n.get("alignLeft"),tooltip:t=>t.toolbar.alignLeft(),isSelected:t=>!!t.find((t=>t.node.isBlock&&"left"===t.node.css("text-align"))),onClick:t=>{t.command.execute("align","left")}},{name:"alignCenter",type:"button",icon:n.get("alignCenter"),tooltip:t=>t.toolbar.alignCenter(),isSelected:t=>!!t.find((t=>t.node.isBlock&&"center"===t.node.css("text-align"))),onClick:t=>{t.command.execute("align","center")}},{name:"alignRight",type:"button",icon:n.get("alignRight"),tooltip:t=>t.toolbar.alignRight(),isSelected:t=>!!t.find((t=>t.node.isBlock&&"right"===t.node.css("text-align"))),onClick:t=>{t.command.execute("align","right")}},{name:"alignJustify",type:"button",icon:n.get("alignJustify"),tooltip:t=>t.toolbar.alignJustify(),isSelected:t=>!!t.find((t=>t.node.isBlock&&"justify"===t.node.css("text-align"))),onClick:t=>{t.command.execute("align","justify")}},{name:"increaseIndent",type:"button",icon:n.get("increaseIndent"),tooltip:t=>t.toolbar.increaseIndent(),onClick:t=>{t.command.execute("indent","increase")}},{name:"decreaseIndent",type:"button",icon:n.get("decreaseIndent"),tooltip:t=>t.toolbar.decreaseIndent(),onClick:t=>{t.command.execute("indent","decrease")}},{name:"bold",type:"button",icon:n.get("bold"),tooltip:t=>t.toolbar.bold(),onClick:(t,e)=>{t.command.execute(e)}},{name:"italic",type:"button",icon:n.get("italic"),tooltip:t=>t.toolbar.italic(),onClick:(t,e)=>{t.command.execute(e)}},{name:"underline",type:"button",icon:n.get("underline"),tooltip:t=>t.toolbar.underline(),onClick:(t,e)=>{t.command.execute(e)}},{name:"strikethrough",type:"button",icon:n.get("strikethrough"),tooltip:t=>t.toolbar.strikethrough(),onClick:(t,e)=>{t.command.execute(e)}},{name:"superscript",type:"button",icon:n.get("superscript"),tooltip:t=>t.toolbar.superscript(),onClick:(t,e)=>{t.command.execute(e)}},{name:"subscript",type:"button",icon:n.get("subscript"),tooltip:t=>t.toolbar.subscript(),onClick:(t,e)=>{t.command.execute(e)}},{name:"code",type:"button",icon:n.get("code"),tooltip:t=>t.toolbar.code(),onClick:(t,e)=>{t.command.execute(e)}},{name:"removeFormat",type:"button",icon:n.get("removeFormat"),tooltip:t=>t.toolbar.removeFormat(),onClick:(t,e)=>{t.command.execute(e)}},{name:"formatPainter",type:"button",icon:n.get("formatPainter"),tooltip:t=>t.toolbar.formatPainter(),onClick:(t,e)=>{t.command.execute(e)}},{name:"link",type:"button",icon:n.get("link"),tooltip:t=>t.toolbar.link(),onClick:(t,e)=>{t.command.execute(e)}},{name:"hr",type:"button",icon:n.get("hr"),tooltip:t=>t.toolbar.hr(),onClick:(t,e)=>{t.command.execute(e)}},{name:"codeBlock",type:"button",icon:n.get("codeBlock"),tooltip:t=>t.toolbar.codeBlock(),onClick:(t,e)=>{t.command.execute(e)}},{name:"video",type:"button",icon:n.get("video"),tooltip:t=>t.toolbar.video(),onClick:(t,e)=>{t.command.execute(e)}},{name:"equation",type:"button",icon:n.get("equation"),tooltip:t=>t.toolbar.equation(),onClick:(t,e)=>{t.command.execute(e)}},{name:"heading",type:"dropdown",downIcon:n.get("down"),defaultValue:"p",tooltip:t=>t.toolbar.heading(),width:"100px",menuType:"list",menuItems:[{value:"h1",text:t=>`<span style="font-weight: bold; font-size: 26px;">${t.toolbar.heading1()}</span>`},{value:"h2",text:t=>`<span style="font-weight: bold; font-size: 24px;">${t.toolbar.heading2()}</span>`},{value:"h3",text:t=>`<span style="font-weight: bold; font-size: 22px;">${t.toolbar.heading3()}</span>`},{value:"h4",text:t=>`<span style="font-weight: bold; font-size: 20px;">${t.toolbar.heading4()}</span>`},{value:"h5",text:t=>`<span style="font-weight: bold; font-size: 18px;">${t.toolbar.heading5()}</span>`},{value:"h6",text:t=>`<span style="font-weight: bold; font-size: 16px;">${t.toolbar.heading6()}</span>`},{value:"p",text:t=>t.toolbar.paragraph()}],onSelect:(t,e)=>{t.command.execute("heading",e)}},{name:"list",type:"dropdown",downIcon:n.get("down"),icon:n.get("list"),tooltip:t=>t.toolbar.list(),menuType:"list",menuItems:Ve,onSelect:(t,e)=>{t.command.execute("list",e)}},{name:"align",type:"dropdown",downIcon:n.get("down"),icon:n.get("alignLeft"),tooltip:t=>t.toolbar.align(),menuType:"list",menuItems:Fe,onSelect:(t,e)=>{t.command.execute("align",e)}},{name:"indent",type:"dropdown",downIcon:n.get("down"),icon:n.get("increaseIndent"),tooltip:t=>t.toolbar.indent(),menuType:"list",menuItems:Re,onSelect:(t,e)=>{t.command.execute("indent",e)}},{name:"fontFamily",type:"dropdown",downIcon:n.get("down"),defaultValue:"Segoe UI",tooltip:t=>t.toolbar.fontFamily(),width:"100px",menuType:"list",menuItems:[{value:"Arial",text:'<span style="font-family: Arial;">Arial</span>'},{value:"Arial Black",text:"<span style=\"font-family: 'Arial Black';\">Arial Black</span>"},{value:"Comic Sans MS",text:"<span style=\"font-family: 'Comic Sans MS';\">Comic Sans MS</span>"},{value:"Courier New",text:"<span style=\"font-family: 'Courier New';\">Courier New</span>"},{value:"Georgia",text:'<span style="font-family: Georgia;">Georgia</span>'},{value:"Helvetica",text:'<span style="font-family: Helvetica;">Helvetica</span>'},{value:"Impact",text:'<span style="font-family: Impact;">Impact</span>'},{value:"Segoe UI",text:"<span style=\"font-family: 'Segoe UI';\">Segoe UI</span>"},{value:"Tahoma",text:'<span style="font-family: Tahoma;">Tahoma</span>'},{value:"Times New Roman",text:"<span style=\"font-family: 'Times New Roman';\">Times New Roman</span>"},{value:"Trebuchet MS",text:"<span style=\"font-family: 'Trebuchet MS';\">Trebuchet MS</span>"},{value:"Verdana",text:'<span style="font-family: Verdana;">Verdana</span>'}],onSelect:(t,e)=>{t.command.execute("fontFamily",e)}},{name:"fontSize",type:"dropdown",downIcon:n.get("down"),defaultValue:"16px",tooltip:t=>t.toolbar.fontSize(),width:"65px",menuType:"list",menuItems:[{value:"12px",text:"12px"},{value:"14px",text:"14px"},{value:"16px",text:"16px"},{value:"18px",text:"18px"},{value:"22px",text:"22px"},{value:"24px",text:"24px"},{value:"32px",text:"32px"}],onSelect:(t,e)=>{t.command.execute("fontSize",e)}},{name:"moreStyle",type:"dropdown",icon:n.get("more"),tooltip:t=>t.toolbar.moreStyle(),menuType:"list",menuItems:je,selectedValues:t=>{var e;const i=[];for(const n of t)if(n.node.isMark){const t=null!==(e=Ue.get(n.name))&&void 0!==e?e:n.name;i.push(t)}return i},onSelect:(t,e)=>{t.command.execute(e)}},{name:"fontColor",type:"dropdown",downIcon:n.get("down"),icon:n.get("fontColor"),accentIcon:n.get("fontColorAccent"),defaultValue:"#f5222d",tooltip:t=>t.toolbar.fontColor(),menuType:"color",menuItems:qe,menuWidth:"296px",onSelect:(t,e)=>{t.command.execute("fontColor",e)}},{name:"highlight",type:"dropdown",downIcon:n.get("down"),icon:n.get("highlight"),accentIcon:n.get("highlightAccent"),defaultValue:"#fadb14",tooltip:t=>t.toolbar.highlight(),menuType:"color",menuItems:qe,menuWidth:"296px",onSelect:(t,e)=>{t.command.execute("highlight",e)}},{name:"image",type:"upload",icon:n.get("image"),tooltip:t=>t.toolbar.image(),accept:"image/*",multiple:!0},{name:"file",type:"upload",icon:n.get("attachment"),tooltip:t=>t.toolbar.file(),accept:"*",multiple:!0}],Ge=["undo","redo","|","heading","|","formatPainter","removeFormat","bold","moreStyle","|","fontColor","highlight","|","align","list","indent","link","blockQuote","hr"],Xe=new Map;for(const t of Ke)Xe.set(t.name,t);const Ye={type:"block",name:"hr",render:t=>{const e=t.getEditor();if(!e)return;const i=t.getContainer(),n=I('<div class="lake-hr"><hr /></div>');i.empty(),i.append(n),n.on("click",(()=>{e.selection.selectBox(t)}))},html:()=>"<hr />"},Je="#57606a",Qe="#444d56",ti="#953800",ei="#0550ae",ii="#444d56",ni="#24292e",si="#005cc5",oi="#0550ae",ri="#444d56",ai="#444d56",li="#0a3069",di="#0550ae",ci="#0550ae",hi="#116329",pi="#0550ae",ui="#cf222e",mi="#24292f",fi="#cf222e",gi="#57606a",vi="#57606a",wi="#8250df",yi="#0550ae",xi="#f6f8fa",bi="#cf222e",ki="#0550ae",Si="#005cc5",Ci="#444d56",_i="#444d56";function Bi(t){const{HighlightStyle:e,tags:i}=t;return e.define([{tag:[i.comment,i.lineComment,i.blockComment,i.docComment],color:Je},{tag:[i.name],color:Qe},{tag:[i.variableName,i.self],color:ti},{tag:[i.typeName,i.tagName],color:ei},{tag:[i.propertyName,i.attributeName],color:ii},{tag:[i.className],color:ni},{tag:[i.labelName],color:si},{tag:[i.namespace],color:oi},{tag:[i.macroName],color:ri},{tag:[i.literal],color:ai},{tag:[i.string,i.docString,i.character,i.attributeValue,i.unit],color:li},{tag:[i.number,i.integer,i.float],color:di},{tag:[i.bool,i.null,i.atom],color:ci},{tag:[i.regexp,i.escape,i.url],color:hi},{tag:[i.color],color:pi},{tag:[i.keyword,i.operatorKeyword,i.controlKeyword,i.definitionKeyword,i.moduleKeyword],color:ui},{tag:[i.modifier],color:mi},{tag:[i.operator,i.derefOperator,i.arithmeticOperator,i.logicOperator,i.bitwiseOperator,i.compareOperator,i.updateOperator,i.definitionOperator,i.typeOperator,i.controlOperator],color:fi},{tag:[i.punctuation,i.separator,i.bracket,i.angleBracket,i.squareBracket,i.paren,i.brace,i.contentSeparator],color:gi},{tag:[i.content],color:vi},{tag:[i.meta,i.documentMeta,i.annotation,i.processingInstruction],color:wi},{tag:i.heading,fontWeight:"bold",color:yi},{tag:i.strong,fontWeight:"bold"},{tag:i.emphasis,fontStyle:"italic"},{tag:i.link,textDecoration:"underline"},{tag:i.strikethrough,textDecoration:"line-through"},{tag:[i.invalid,i.inserted,i.deleted,i.changed],color:xi},{tag:[i.definition(i.name)],color:bi},{tag:[i.constant(i.name)],color:ki},{tag:[i.function(i.variableName)],color:Si},{tag:[i.standard(i.name)],color:Ci},{tag:[i.special(i.variableName)],color:_i}])}const Ai={type:"block",name:"codeBlock",render:t=>{var e;const i=t.getEditor();if(!i)return;const s=I('<div class="lake-code-block" />'),o=t.getContainer();o.css("width",i.container.innerWidth()-2+"px"),o.empty(),o.append(s);const r=s.get(0);if(!r)return;const a=window.LakeCodeMirror;if(!a)return i.readonly?void t.node.hide():(s.addClass("lake-code-block-error"),s.text('\n The code cannot be displayed because window.LakeCodeMirror is not found.\n Please check if the "lake-codemirror" library is added to this page.\n '.trim()),void s.on("click",(()=>{i.selection.selectBox(t)})));const{EditorState:l,Compartment:d,EditorView:c,keymap:h,history:p,defaultKeymap:u,historyKeymap:m,indentWithTab:f,syntaxHighlighting:g}=a,v=a.langItems,w=i.config.codeBlock,y=v.filter((t=>w.langList.indexOf(t.value)>=0)),x=new Map;for(const t of y)x.set(t.value,t);const b=t.value,k=x.get(b.lang),S=new d,C=c.updateListener.of((e=>{var n;e.docChanged&&(n=e.state.doc.toString(),window.setTimeout((()=>{i.isComposing||(t.updateValue("code",n),i.history.save())}),0))})),_=new c({parent:r,doc:null!==(e=b.code)&&void 0!==e?e:"",extensions:[l.readOnly.of(i.readonly),c.editable.of(!i.readonly),p(),h.of([...u,...m,f]),g(Bi(a)),S.of(k&&k.component?k.component():[]),C]});s.find('[contenteditable="true"]').attr("tabindex","-1");new zt({root:s,name:"langType",downIcon:n.get("down"),defaultValue:k?b.lang:w.defaultLang,tooltip:i.locale.codeBlock.langType(),menuType:"list",menuHeight:"200px",menuItems:y.map((t=>({value:t.value,text:t.text}))),onSelect:e=>{t.updateValue({lang:e}),t.unmount(),t.render(),i.selection.selectBox(t),i.history.save()}}).render();const B=()=>{o.css("width",i.container.innerWidth()-2+"px")};i.event.on("resize",B),s.on("click",(()=>{_.hasFocus||_.focus()})),t.event.on("beforeunmount",(()=>{_.destroy(),i.event.off("resize",B),A("CodeMirror destroyed")}))}};function Ti(t,e,i,n){return new(i||(i=Promise))((function(s,o){function r(t){try{l(n.next(t))}catch(t){o(t)}}function a(t){try{l(n.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(r,a)}l((n=n.apply(t,e||[])).next())}))}
18
+ `;class Dt{constructor(t){if(this.event=new vt,"string"==typeof t){const e=wt.get(t);if(void 0===e)throw new Error(`The box "${t}" has not been defined yet.`);const i=r(e.type),n=r(e.name);this.node=I(a`<lake-box type="${i}" name="${n}"></lake-box>`),e.value&&(this.value=e.value)}else{this.node=I(t);const e=wt.get(this.name);if(void 0===e)throw new Error(`The box "${this.name}" has not been defined yet.`);e.value&&!this.node.hasAttr("value")&&(this.value=e.value)}}addFramework(){let t=this.getContainer();0===t.length?(this.node.html($t),t=this.getContainer()):(t.off("mouseenter"),t.off("mouseleave"),t.off("click")),t.on("mouseenter",(()=>{t.hasClass("lake-box-selected")||t.hasClass("lake-box-focused")||t.hasClass("lake-box-activated")||t.addClass("lake-box-hovered")})),t.on("mouseleave",(()=>{t.removeClass("lake-box-hovered")})),t.on("click",(()=>{A(`The box "${this.name}" (id = ${this.node.id}) value:`),A(this.value)})),"block"===this.type&&this.node.isContentEditable&&t.attr("draggable","true")}get type(){return this.node.attr("type")}get name(){return this.node.attr("name")}get value(){const t=this.node.attr("value");return""===t?{}:JSON.parse(h(t))}set value(t){this.node.attr("value",c(JSON.stringify(t)))}updateValue(t,e){const i=this.value;if("string"==typeof t)i[t]=e;else for(const e of Object.keys(t))i[e]=t[e];this.value=i}getEditor(){const t=this.node.closest("div[contenteditable]");return t.length>0?yt.get(t.id):void 0}getContainer(){return this.node.find(".lake-box-container")}setToolbar(t){const e=this.getEditor();let i=null;const n=()=>{i&&i.updatePosition()};this.event.on("focus",(()=>{i=new Ht({root:e?e.popupContainer:I(document.body),box:this,items:t,locale:e?e.locale:void 0}),i.render(),e&&e.root.on("scroll",n)})),this.event.on("blur",(()=>{i&&(i.unmount(),i=null),e&&e.root.off("scroll",n)}))}render(){const t=wt.get(this.name);if(void 0===t)return;this.event.emit("beforeunmount"),this.event.removeAllListeners(),this.addFramework();const e=t.render(this);if(void 0!==e){const t=this.getContainer();t.empty(),t.append(e)}A(`The box "${this.name}" (id: ${this.node.id}) rendered`)}unmount(){this.event.emit("blur"),this.event.emit("beforeunmount"),this.event.removeAllListeners(),this.node.empty(),A(`The box "${this.name}" (id: ${this.node.id}) unmounted`)}getHTML(){const t=wt.get(this.name);return void 0===t?"":void 0===t.html?this.node.outerHTML():t.html(this)}}function Vt(t){const e=mt(0);if("string"==typeof t){const i=new Dt(t);return e.set(i.node.id,i),i}const i=(t=I(t)).closestContainer();if(0===i.length){let i=e.get(t.id);return i||(i=new Dt(t),e.set(t.id,i),i)}const n=mt(i.id);let s=e.get(t.id);return s?(n.set(t.id,s),e.delete(t.id),s):(s=n.get(t.id),s||(s=new Dt(t),n.set(t.id,s),s))}function Ft(t){const e=t.responseText||t.response;if(!e)return e;try{return JSON.parse(e)}catch(t){return e}}function Rt(t){const e=new XMLHttpRequest;t.onProgress&&e.upload&&(e.upload.onprogress=e=>{e.total>0&&(e.percent=e.loaded/e.total*100),t.onProgress&&t.onProgress(e)});const i=new FormData,n=t.data||{};Object.keys(n).forEach((t=>{const e=n[t];Array.isArray(e)?e.forEach((e=>{i.append(`${t}[]`,e)})):i.append(t,e)}));const s=t.filename||"file";t.file instanceof Blob?i.append(s,t.file,t.file.name):i.append(s,t.file),e.onerror=e=>{t.onError&&t.onError(e)},e.onload=()=>{if(e.status<200||e.status>=300){if(!t.onError)return;return t.onError(function(t,e){const i=`Cannot ${t.method} ${t.action} ${e.status}'`,n=new Error(i);return n.status=e.status,n.method=t.method,n.url=t.action,n}(t,e),Ft(e))}if(t.onSuccess)return t.onSuccess(Ft(e),e)},e.open(t.method,t.action,!0),t.withCredentials&&"withCredentials"in e&&(e.withCredentials=!0);const o=t.headers||{};return null!==o["X-Requested-With"]&&e.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(o).forEach((t=>{null!==o[t]&&e.setRequestHeader(t,o[t])})),e.send(i),e}function jt(t){const{editor:e,name:i,file:n,onError:s,onSuccess:o}=t,{requestMethod:r,requestAction:a,requestTypes:l}=e.config[i];if(l.indexOf(n.type)<0)throw s&&s(`File "${n.name}" is not allowed for uploading.`),new Error(`Cannot upload file "${n.name}" because its type "${n.type}" is not found in ['${l.join("', '")}'].`);const d=e.selection.insertBox(i,{url:URL.createObjectURL(n),status:"uploading",name:n.name,size:n.size,type:n.type,lastModified:n.lastModified});let c=Rt({onProgress:t=>{const e=d.node.find(".lake-percent"),i=Math.round(t.percent);e.text(`${i<100?i:99} %`)},onError:(t,e)=>{c=null,A(t.toString(),e),d.updateValue("status","error"),d.render(),s&&s(t.toString())},onSuccess:t=>{if(c=null,!t.url)return d.updateValue("status","error"),d.render(),void(s&&s("Cannot find the url field."));d.updateValue({status:"done",url:t.url}),d.render(),e.history.save(),o&&o()},file:n,action:a,method:r});return d.event.on("beforeunmount",(()=>{c&&(c.abort(),A("Upload canceled"))})),d}var Wt=Object.freeze({__proto__:null,appendBreak:Z,camelCase:l,changeTagName:V,debug:A,denormalizeValue:g,encode:r,fileSize:w,fixNumberedList:F,fromBase64:h,getBox:Vt,getCSS:y,getDeepElement:H,inString:d,mergeNodes:z,modifierText:v,morph:ht,nodeAndView:pt,normalizeValue:f,parseStyle:m,query:I,removeBreak:N,removeZWS:D,request:Rt,safeTemplate:a,setBlockIndent:R,splitNodes:P,template:s,toBase64:c,toHex:u,toNodeList:x,uploadFile:jt,wrapNodeList:$});class qt{constructor(t){this.fragment=null!=t?t:document.createDocumentFragment()}get(){return this.fragment}find(t){const e=[];let i=new L(this.fragment.firstChild);for(;i.length>0;)i.matches(t)?e.push(i.get(0)):i.isElement&&i.find(t).each((t=>{e.push(t)})),i=i.next();return new L(e)}append(t){I(t).each((t=>{this.fragment.appendChild(t)}))}}const Ut={id:/^[\w-]+$/,class:/^[\w- ]+$/,style:{"text-align":["left","center","right","justify","start","end"],"margin-left":/^-?\d+px$/i,"text-indent":/^-?\d+em$/i}};function Kt(){return{h1:Object.assign({},Ut),h2:Object.assign({},Ut),h3:Object.assign({},Ut),h4:Object.assign({},Ut),h5:Object.assign({},Ut),h6:Object.assign({},Ut),p:Object.assign({},Ut),blockquote:Object.assign(Object.assign({},Ut),{type:["info","tip","success","warning","error","danger"]}),ul:Object.assign(Object.assign({},Ut),{type:"checklist",indent:/^\d+$/}),ol:Object.assign(Object.assign({},Ut),{start:/^\d+$/,indent:/^\d+$/}),li:{value:["true","false"]},table:{style:{width:/^-?\d+(px|%)$/i,height:/^-?\d+(px|%)$/i,border:/^[^"]+$/,"border-width":/^-?\d+px$/i,"border-style":/^[\w-]+$/,"border-color":/^[^"]+$/,"background-color":/^[^"]+$/}},tr:{style:{height:/^-?\d+(px|%)$/i}},th:"td",td:{colspan:/^\d+$/,rowspan:/^\d+$/,style:{width:/^-?\d+(px|%)$/i,height:/^-?\d+(px|%)$/i,border:/^[^"]+$/,"border-width":/^-?\d+px$/i,"border-style":/^[\w-]+$/,"border-color":/^[^"]+$/,"background-color":/^[^"]+$/,"text-align":["left","center","right","justify"]}},"lake-box":{type:["inline","block"],name:/^[\w-]+$/,value:/^[^"]+$/,focus:["start","center","end"]},br:{},hr:{},img:{src:/^[^"]+$/,width:/^-?\d+px$/i,height:/^-?\d+px$/i,"data-lake-value":/^[^"]+$/,alt:/^[^"]+$/,style:{width:/^-?\d+px$/i,height:/^-?\d+px$/i}},span:{class:/^[\w- ]+$/,style:{color:/^[^"]+$/,"background-color":/^[^"]+$/,"font-family":/^[^;]+$/,"font-size":/^[^"]+$/}},b:"strong",strong:{},em:"i",i:{},u:{},s:{},sub:{},sup:{},code:{},a:{class:/^[\w- ]+$/,name:/^[\w-]+$/,href:/^[^"]+$/,target:/^[\w-]+$/,rel:/^[^"]+$/,download:/^[^"]+$/},"lake-bookmark":{type:["anchor","focus"]}}}class Gt{constructor(t,e=Kt()){this.rules=e,this.source="string"==typeof t?this.parseHTML(t):t}parseHTML(t){const e=(new DOMParser).parseFromString(t,"text/html");return new L(e.querySelector("body"))}static matchRule(t,e){return"string"==typeof t?t===e:Array.isArray(t)?t.indexOf(e)>=0:t instanceof RegExp&&t.test(e)}static getOpenTagString(t,e){let i=t.name,n=e[i];if(!n)return"";"string"==typeof n&&(i=n,n=e[i]);const s=t.get(0);if(!s.hasAttributes())return i;const o=new Map;for(const t of s.attributes)if(n[t.name]&&("style"!==t.name&&Gt.matchRule(n[t.name],t.value)&&o.set(t.name,t.value),"style"===t.name)){const e=n.style,i=new Map,s=m(t.value);for(const t of Object.keys(s)){const n=s[t];e[t]&&Gt.matchRule(e[t],n)&&i.set(t,n)}o.set("style",i)}let r=i;for(const[t,e]of o)if("style"===t){let t="";for(const[i,n]of e)t+=`${i}: ${n.replace(/"/g,"&quot;")}; `;""!==t&&(r+=` style="${t.trim()}"`)}else r+=` ${t}="${e}"`;return r}static getClosedTagString(t,e){let i=t.name;const n=e[i];return n?("string"==typeof n&&(i=n),i):""}static getTrimmedText(t){const e=t.parent(),i=t.prev(),n=t.next();let s=t.text();return(i.isBlock||i.isBlockBox)&&(n.isBlock||n.isBlockBox)||0===i.length&&0===n.length&&e.isBlock?s=s.replace(/^[\u0020\t\r\n]+|[\u0020\t\r\n]+$/g,""):i.isBlock||i.isBlockBox||0===i.length&&e.isBlock?s=s.replace(/^[\u0020\t\r\n]+/,""):(n.isBlock||n.isBlockBox||0===n.length&&e.isBlock)&&(s=s.replace(/[\u0020\t\r\n]+$/,"")),s}getHTML(){const t=this.rules;let e="";for(const i of function*e(i){let n=i.first();for(;n.length>0;){const i=n.next();if(n.isText)yield r(Gt.getTrimmedText(n));else if(n.isVoid){const e=Gt.getOpenTagString(n,t);""!==e&&(yield`<${e} />`)}else if(n.isElement){const i=Gt.getOpenTagString(n,t),s=Gt.getClosedTagString(n,t);""!==i&&(yield`<${i}>`),n.isBox||(yield*e(n)),""!==s&&(yield`</${s}>`)}n=i}}(this.source))e+=i;return e.trim()}getFragment(){const t=this.getHTML(),e=this.parseHTML(t),i=document.createDocumentFragment();let n=e.first();for(;n.length>0;){const t=n.next();i.appendChild(n.get(0)),n=t}return i}}class Xt{constructor(t){this.content=t}getHTML(){let t=this.content;return t=t.replace(/ {2}/g,"  "),t=r(t.trim()),t=`<p>${t}</p>`,t=t.replace(/(\r\n){2,}/g,"</p><p><br /></p><p>"),t=t.replace(/\r\n/g,"</p><p>"),t=t.replace(/[\r\n]{2,}/g,"</p><p><br /></p><p>"),t=t.replace(/[\r\n]/g,"</p><p>"),t}getFragment(){return new Gt(this.getHTML()).getFragment()}}function Yt(t,e){if(t.commonAncestor.isOutside)return;const i=(e=I(e)).get(0),n=t.get();n.insertNode(i),n.setEndAfter(i),n.collapse(!1)}function Jt(t){if(t.commonAncestor.isOutside)return{anchor:new L,focus:new L};const e=t.startNode.closest("lake-box");if(e.length>0)return t.isBoxStart?e.attr("focus","start"):t.isBoxEnd?e.attr("focus","end"):e.attr("focus","center"),{anchor:new L,focus:e};if(t.isCollapsed){const e=t.clone();e.collapseToEnd();const i=I('<lake-bookmark type="focus" />');return Yt(e,i),{anchor:new L,focus:i}}const i=t.clone();i.collapseToStart();const n=I('<lake-bookmark type="anchor" />');Yt(i,n);const s=t.clone();s.collapseToEnd();const o=I('<lake-bookmark type="focus" />');return Yt(s,o),{anchor:n,focus:o}}function Qt(t,e){const i=t.prev(),n=t.next();if(i.isText||n.isText){const e=t.parent();t.remove(),e.get(0).normalize()}else if(0===i.length&&0===n.length){if(t.parent().isMark&&e){const i=new L(document.createTextNode("​"));t.before(i),e.setStartAfter(i),e.collapseToStart()}t.remove()}else t.remove()}function te(t,e){const i=e.anchor,n=e.focus;if(i.length>0&&0===n.length)Qt(i);else{if(n.length>0&&0===i.length){if(n.isBox){const e=Vt(n);0===e.getContainer().length&&e.render();const i=n.attr("focus");return"start"===i?t.selectBoxStart(n):"center"===i?t.selectBox(n):t.selectBoxEnd(n),void n.removeAttr("focus")}return t.setStartBefore(n),t.collapseToStart(),void Qt(n,t)}if(i.length>0&&n.length>0){const e=new M;e.selectNode(i),e.collapseToEnd(),-1===e.compareAfterNode(n)?(t.setStartBefore(n),Qt(n),t.setEndBefore(i),Qt(i)):(t.setStartBefore(i),Qt(i),t.setEndBefore(n),Qt(n))}}}function ee(t){if(t.commonAncestor.isOutside)return;F(t.getBlocks())}function ie(t){if(t.isCollapsed)return;if(t.adjustBox(),t.adjustTable(),t.isInoperative)return;const e=t.startNode.closestBlock(),i=t.endNode.closestBlock(),n=e.get(0)===i.get(0);if(t.get().deleteContents(),t.adjustBlock(),n){const e=t.getBlocks()[0];if(e&&e.isEmpty){const i=Z(e);t.setStartBefore(i),t.collapseToStart()}return}const s=t.getBlocks()[0];if(!s)return;const o=s.prev();if(0===o.length)return;const r=Jt(t);z(o,s),te(t,r),ee(t)}function ne(t,e){if(e instanceof qt&&(e=e.get()),t.commonAncestor.isOutside)return;t.isCollapsed?t.adjustBox():ie(t);N(t.startNode.closestBlock());const i=Jt(t);i.focus.before(e),te(t,i),t.adjustBlock()}function se(t,e){if(t.commonAncestor.isOutside)return;if(t.isCollapsed){if(t.commonAncestor.closest("lake-box").isBlockBox)return}if("string"!=typeof e){const i=t.getBlocks();for(const t of i)t.css(e);return}const i=I(e),n=i.name,s=i.get(0).attributes,o=t.getBlocks();if(o.length>0){const e=Jt(t);for(const t of o)if(t.name===n&&0===i.first().length)for(const e of s)t.attr(e.name,e.value);else{const e=i.clone(!0);e.isList&&t.isList&&""!==t.attr("indent")&&e.attr("indent",t.attr("indent"));const n=H(e);let s=t.first();for(;s.length>0;){const t=s.next();n.append(s),n.name!==s.name&&"li"!==s.name||s.remove(!0),s=t}t.replaceWith(e)}return te(t,e),void ee(t)}const r=Jt(t),a=function(t){const e=t.commonAncestor.closest('div[contenteditable="true"],td');let i=[];if(0===e.length)return i;let n=e.first(),s=!0;for(;n.length>0;){if(n.isMark||n.isText||n.isBookmark||n.isInlineBox)i.push(n);else{if(!s)break;i=[]}t.intersectsNode(n)&&(s=!1),n=n.next()}return i}(t),l=$(a,i);if(te(t,r),ee(t),l.isEmpty){const e=Z(l);t.setStartBefore(e),t.collapseToStart()}}function oe(t){if(t.commonAncestor.isOutside)return{start:null,end:null};t.isCollapsed?t.adjustBox():ie(t);const e=t.startNode,i=e.closestOperableBlock();if(0===i.length)return{start:null,end:null};let n=i.parent();n.isOutside&&(n=e.closestContainer());const s=P(e,t.startOffset,n);let o=null,r=null;return s&&(o=s.start,r=s.end),!s&&e.isBlock&&(t.startOffset>0&&(o=e.children()[t.startOffset-1]),r=e.children()[t.startOffset],r&&!r.isBlock&&(r=null)),o&&o.isEmpty&&Z(o),r&&(r.isEmpty&&Z(r),t.shrinkBefore(r)),ee(t),{start:o,end:r}}function re(t){if(t.isMark&&t.isEmpty)t.remove();else for(const e of t.getWalker())e.isMark&&e.isEmpty&&e.remove()}function ae(t,e,i){let n=null,s=null,o=t.closestBlock();0===o.length&&(o=t.closestContainer());const r=P(t,e,o);return r&&(i?(re(r.start),re(r.end),r.start.isEmpty||(n=r.start),r.end.isEmpty||(s=r.end)):(n=r.start,s=r.end)),{start:n,end:s}}function le(t,e=!0){if(t.commonAncestor.isOutside)return{start:null,center:null,end:null};if(t.adjustBox(),t.isCollapsed){const i=ae(t.startNode,t.startOffset,e);return i.start?(t.setStartAfter(i.start),t.collapseToStart()):i.end&&(t.setStartBefore(i.end),t.collapseToStart()),{start:i.start,center:null,end:i.end}}const i=ae(t.startNode,t.startOffset,e);i.start?t.setStartAfter(i.start):i.end&&t.setStartBefore(i.end);const n=ae(t.endNode,t.endOffset,e);return n.start?t.setEndAfter(n.start):n.end&&t.setEndBefore(n.end),{start:i.start,center:n.start,end:n.end}}function de(t,e){const i=t.text();let n=t;for(;n.length>0;){const t=n.parent();if(!t.isMark||i!==t.text()||!n.isText&&n.name===e&&""!==n.attr("style"))break;n=t}return n}function ce(t,e){if(t.commonAncestor.isOutside)return;let i=I(e);const n=i.name,s=m(i.attr("style"));if(t.isCollapsed){if(t.isBox){const e=t.startNode.closest("lake-box");if("block"===Vt(e).type){const i=I("<p><br /></p>");t.isBoxStart?e.before(i):e.after(i),t.shrinkAfter(i)}else t.adjustBox()}N(t.startNode.closestBlock());const e=new L(document.createTextNode("​")),o=le(t);if(o.start){const t=function(t){if(!t.isMark)return null;let e=t.clone(),i=t.last();for(;i.length>0;){if(i.isMark){const t=i.clone();e.append(t),e=t}i=i.last()}return e}(o.start);if(t)if(t.name===n)t.css(s),i=t;else{H(t).append(e),i.append(t)}}return""===i.text()&&i.append(e),Yt(t,i),function(t){const e=t.prev();e.length>0&&e.isText&&e.isEmpty&&e.remove();const i=t.next();i.length>0&&i.isText&&i.isEmpty&&i.remove()}(i),void t.shrinkAfter(i)}le(t);const o=t.getMarks(!0),r=Jt(t);for(const t of o)if(!t.isEmpty&&t.isText){const e=de(t,n);if(e.isMark&&e.name===n)e.css(s);else{const t=i.clone();e.before(t),t.append(e)}}te(t,r)}function he(t){if(t.isMark&&t.isEmpty)t.remove();else for(const e of t.getWalker())e.isMark&&e.isEmpty&&e.remove()}function pe(t,e){if(t.commonAncestor.isOutside)return;let i;if(e){i=I(e).name}if(t.isCollapsed){if(t.isBox)return;if(i&&0===t.commonAncestor.closest(i).length)return;const e=le(t,!1);if(!e.start)return;e.end&&he(e.end);const n=new L(document.createTextNode("​")),s=function(t,e){if(!t.isMark||!e)return null;let i=t.clone(),n=t.last();for(;n.length>0;){if(n.isMark&&n.name!==e){const t=n.clone();i.append(t),i=t}n=n.last()}if(i.name===e){if(!(i.first().length>0))return null;i=i.first()}return i}(e.start,i);if(!s)return e.start.after(n),he(e.start),n.prev().isText?(t.setStartAfter(n.prev()),t.collapseToStart(),void n.remove()):(t.setStartAfter(n),void t.collapseToStart());return H(s).append(n),e.start.after(s),he(e.start),void t.shrinkAfter(s)}le(t);const n=t.getMarks(),s=Jt(t);for(const t of n)if(!i||t.name===i){const e=t.parent();t.remove(!t.isEmpty),e.length>0&&e.get(0).normalize()}D(t.commonAncestor),te(t,s)}function ue(t,e){if(t.commonAncestor.isOutside)return null;const i=I(e);if(t.isCollapsed){let e=t.commonAncestor.closest("a");if(0===e.length){e=i.clone(!0);return N(t.startNode.closestBlock()),Yt(t,e),e}return""!==i.attr("href")&&e.attr({href:i.attr("href")}),e}le(t);const n=Jt(t);for(const e of t.commonAncestor.getWalker())"a"===e.name&&t.intersectsNode(e)&&e.remove(!0);const s=i.clone(!1);n.anchor.after(s);let o=s.next();for(;o.length>0;){const t=o.next();if(!o.isMark&&!o.isText)break;s.append(o),o=t}return 0===s.first().length&&s.remove(),te(t,n),s}function me(t,e,i){if(t.commonAncestor.isOutside)return null;const n=Vt(e);i&&(n.value=i);const s=document.createDocumentFragment();if(s.appendChild(n.node.get(0)),"inline"===n.type)return ne(t,s),n.render(),t.selectBoxEnd(n.node),Vt(n.node);const o=oe(t);return o.start&&(t.setEndAfter(o.start),t.collapseToEnd()),o.end&&o.end.isEmpty&&o.end.remove(),ne(t,s),n.render(),t.selectBoxEnd(n.node),o.start&&o.start.isEmpty&&o.start.remove(),Vt(n.node)}function fe(t){const e=t.node.closestContainer();if(t.unmount(),t.node.remove(),e.length>0){mt(e.id).delete(t.node.id);mt(0).set(t.node.id,t)}return t}function ge(t){if(t.commonAncestor.isOutside)return null;const e=t.commonAncestor.closest("lake-box");if(0===e.length)return null;const i=Vt(e);if("block"===i.type){const n=I("<p><br /></p>");return e.before(n),t.shrinkAfter(n),fe(i)}t.setStartBefore(e),t.collapseToStart();const n=e.parent();if(fe(i),n.isEmpty){const e=Z(n);t.setStartBefore(e),t.collapseToStart()}return i}var ve={exports:{}};function we(t,e=100,i={}){if("function"!=typeof t)throw new TypeError(`Expected the first parameter to be a function, got \`${typeof t}\`.`);if(e<0)throw new RangeError("`wait` must not be negative.");const{immediate:n}="boolean"==typeof i?{immediate:i}:i;let s,o,r,a,l;function d(){const e=s,i=o;return s=void 0,o=void 0,l=t.apply(e,i),l}function c(){const t=Date.now()-a;t<e&&t>=0?r=setTimeout(c,e-t):(r=void 0,n||(l=d()))}const h=function(...t){if(s&&this!==s)throw new Error("Debounced method called with different contexts.");s=this,o=t,a=Date.now();const i=n&&!r;return r||(r=setTimeout(c,e)),i&&(l=d()),l};return h.clear=()=>{r&&(clearTimeout(r),r=void 0)},h.flush=()=>{r&&h.trigger()},h.trigger=()=>{l=d(),h.clear()},h}ve.exports.debounce=we,ve.exports=we;var ye=ft(ve.exports),xe=ft((function t(e,i){if(e===i)return!0;if(e&&i&&"object"==typeof e&&"object"==typeof i){if(e.constructor!==i.constructor)return!1;var n,s,o;if(Array.isArray(e)){if((n=e.length)!=i.length)return!1;for(s=n;0!=s--;)if(!t(e[s],i[s]))return!1;return!0}if(e instanceof Map&&i instanceof Map){if(e.size!==i.size)return!1;for(s of e.entries())if(!i.has(s[0]))return!1;for(s of e.entries())if(!t(s[1],i.get(s[0])))return!1;return!0}if(e instanceof Set&&i instanceof Set){if(e.size!==i.size)return!1;for(s of e.entries())if(!i.has(s[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(i)){if((n=e.length)!=i.length)return!1;for(s=n;0!=s--;)if(e[s]!==i[s])return!1;return!0}if(e.constructor===RegExp)return e.source===i.source&&e.flags===i.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===i.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===i.toString();if((n=(o=Object.keys(e)).length)!==Object.keys(i).length)return!1;for(s=n;0!=s--;)if(!Object.prototype.hasOwnProperty.call(i,o[s]))return!1;for(s=n;0!=s--;){var r=o[s];if(!t(e[r],i[r]))return!1}return!0}return e!=e&&i!=i}));function be(t){const e=t.get(0),i={};if(e.hasAttributes())for(const t of e.attributes)i[t.name]=t.value;return i}class ke{constructor(t){const e=window.getSelection();if(!e)throw new Error("Selection object is null.");this.selection=e,this.container=t,this.range=this.getRangeFromNativeSelection()}getRangeFromNativeSelection(){if(this.selection.rangeCount>0){const t=this.selection.getRangeAt(0);return new M(t)}return new M}sync(){this.selection.removeAllRanges(),this.selection.addRange(this.range.get())}updateByRange(){const t=this.getRangeFromNativeSelection();this.range.startNode.get(0)===t.startNode.get(0)&&this.range.startOffset===t.startOffset&&this.range.endNode.get(0)===t.endNode.get(0)&&this.range.endOffset===t.endOffset||(this.range=t)}updateByBookmark(){const t=this.range,e=this.container,i=e.find("lake-box[focus]");if(i.length>0)return te(t,{anchor:new L,focus:i}),void this.sync();te(t,{anchor:e.find('lake-bookmark[type="anchor"]'),focus:e.find('lake-bookmark[type="focus"]')}),this.sync()}getAppliedItems(){const t=[];return function(t,e){let i=e.startNode;for(i.isText&&(i=i.parent());i.length>0&&i.isInside;)t.push({node:i,name:i.name,attributes:be(i),styles:m(i.attr("style"))}),i=i.parent()}(t,this.range),function(t,e){const i=e.startNode;let n;if(i.isText&&i.text().length===e.startOffset){const t=i.next();t.length>0&&t.isElement&&(n=t)}if(i.isElement){const t=i.children();if(t.length>0){const i=t[e.startOffset];i&&i.isElement&&(n=i)}}if(n){let e=n;for(;e.length>0;)e.isElement&&t.push({node:e,name:e.name,attributes:be(e),styles:m(e.attr("style"))}),e=e.first()}}(t,this.range),t}insertBookmark(){return Jt(this.range)}toBookmark(t){return te(this.range,t)}insertNode(t){return Yt(this.range,t)}insertFragment(t){return ne(this.range,t)}deleteContents(){return ie(this.range)}setBlocks(t){return se(this.range,t)}splitBlock(){return oe(this.range)}splitMarks(t){return le(this.range,t)}addMark(t){return ce(this.range,t)}removeMark(t){return pe(this.range,t)}fixList(){return ee(this.range)}insertLink(t){return ue(this.range,t)}selectBox(t){let e=t;e=t instanceof Dt?t.node:t,this.range.selectBox(e)}insertBox(t,e){const i=me(this.range,t,e);if(!i)throw new Error(`The box "${t}" cannot be inserted outside the editor.`);return i}removeBox(t=null){return t&&this.selectBox(t),ge(this.range)}}class Se{constructor(t){this.commandMap=new Map,this.selection=t}add(t,e){this.commandMap.set(t,e)}delete(t){this.commandMap.delete(t)}getNames(){return Array.from(this.commandMap.keys())}has(t){return void 0!==this.commandMap.get(t)}getItem(t){const e=this.commandMap.get(t);if(void 0===e)throw new Error(`Command "${t}" has not been defined yet.`);return e}isDisabled(t){const e=this.getItem(t);if(!e.isDisabled)return!1;const i=this.selection.getAppliedItems();return e.isDisabled(i)}isSelected(t){const e=this.getItem(t);if(!e.isSelected)return!1;const i=this.selection.getAppliedItems();return e.isSelected(i)}selectedValues(t){const e=this.getItem(t);if(!e.selectedValues)return[];const i=this.selection.getAppliedItems();return e.selectedValues(i)}execute(t,...e){this.getItem(t).execute.apply(this,e),A(`Command "${t}" executed`)}}class Ce{constructor(t){this.canSave=!0,this.list=[],this.index=0,this.limit=100,this.event=new vt,this.selection=t,this.container=t.container}removeBookmark(t){return t.replace(/(<lake-box[^>]+)\s+focus="\w+"([^>]*>)/gi,"$1$2").replace(/<lake-bookmark\s+type="anchor">\s*<\/lake-bookmark>/gi,"").replace(/<lake-bookmark\s+type="focus">\s*<\/lake-bookmark>/gi,"")}getValue(t){return new Gt(t).getHTML()}addIdToBoxes(t){t.find("lake-box").each((t=>{const e=new L(t),i=`${e.attr("name")}-${e.attr("value")}`;e.attr("id",i)}))}removeIdfromBoxes(t){t.find("lake-box").each((t=>{new L(t).removeAttr("id")}))}morphContainer(t){const e=this.container,i={beforeChildrenUpdated:t=>{if("lake-box"===new L(t).name)return!1},afterAttributeUpdated:(t,i)=>{const n=new L(i);if(["name","value"].indexOf(t)>=0&&"lake-box"===n.name){Vt(n).unmount();mt(e.id).delete(n.id)}}},n=t.clone(!0);this.addIdToBoxes(e),this.addIdToBoxes(n),ht(e,n,{callbacks:i}),this.removeIdfromBoxes(e),this.removeIdfromBoxes(n)}get canUndo(){return this.index>1&&!!this.list[this.index-2]}get canRedo(){return!!this.list[this.index]}cloneContainer(){const t=this.selection.range,e=this.container.clone(!0);if(e.find("lake-box").each((t=>{Vt(t).getContainer().empty()})),t.commonAncestor.isOutside)return e;if(t.isInsideBox){const i=t.commonAncestor.closest("lake-box").path(),n=e.find(i),s=t.clone();return s.selectBox(n),Jt(s),e}const i=t.startNode.path(),n=t.endNode.path(),s=e.find(i),o=e.find(n),r=t.clone();return r.setStart(s,t.startOffset),r.setEnd(o,t.endOffset),Jt(r),e}undo(){if(!this.list[this.index-2])return;this.selection.insertBookmark();const t=this.getValue(this.container);for(;this.index>1;){const e=this.list[this.index-2];if(!e)break;this.index--;const i=this.getValue(e);if(this.removeBookmark(i)!==this.removeBookmark(t)){this.morphContainer(e),this.event.emit("undo",i);break}}this.selection.updateByBookmark(),A(`History undone (index: ${this.index})`)}redo(){if(!this.list[this.index])return;this.selection.insertBookmark();const t=this.getValue(this.container);for(;this.index<this.list.length;){const e=this.list[this.index];if(!e)break;this.index++;const i=this.getValue(e);if(this.removeBookmark(i)!==this.removeBookmark(t)){this.morphContainer(e),this.event.emit("redo",i);break}}this.selection.updateByBookmark(),A(`History redone (index: ${this.index})`)}continue(){this.canSave=!0}pause(){this.canSave=!1}save(t={}){var e,i,n;const s=null!==(e=t.inputType)&&void 0!==e?e:"",o=null!==(i=t.update)&&void 0!==i&&i,r=null===(n=t.emitEvent)||void 0===n||n;if(!this.canSave)return;const a=this.cloneContainer(),l=this.getValue(a);this.list[this.index-1]&&this.removeBookmark(this.getValue(this.list[this.index-1]))===this.removeBookmark(l)||(o?this.list.splice(this.index-1,1/0,a):(this.list.splice(this.index,1/0,a),this.index++),this.list.length>this.limit&&(this.list.shift(),this.index=this.list.length),A(`History saved (index: ${this.index}, inputType: "${s}", update: ${o}, emitEvent: ${r})`),r&&this.event.emit("save",g(l),{inputType:s,update:o,emitEvent:r}))}}var _e={};Object.defineProperty(_e,"__esModule",{value:!0});for(var Be="undefined"!=typeof window&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),Ae={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},Te={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:Be?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},Ee={backspace:8,tab:9,enter:13,shift:16,control:17,alt:18,pause:19,capslock:20,escape:27," ":32,pageup:33,pagedown:34,end:35,home:36,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,insert:45,delete:46,meta:91,numlock:144,scrolllock:145,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},Le=1;Le<20;Le++)Ee["f"+Le]=111+Le;function Ie(t,e,i){e&&!("byKey"in e)&&(i=e,e=null),Array.isArray(t)||(t=[t]);var n=t.map((function(t){return Me(t,e)})),s=function(t){return n.some((function(e){return Pe(e,t)}))};return null==i?s:s(i)}function Me(t,e){var i=e&&e.byKey,n={},s=(t=t.replace("++","+add")).split("+"),o=s.length;for(var r in Ae)n[Ae[r]]=!1;var a=!0,l=!1,d=void 0;try{for(var c,h=s[Symbol.iterator]();!(a=(c=h.next()).done);a=!0){var p=c.value,u=p.endsWith("?")&&p.length>1;u&&(p=p.slice(0,-1));var m=Ne(p),f=Ae[m];if(p.length>1&&!f&&!Te[p]&&!Ee[m])throw new TypeError('Unknown modifier: "'+p+'"');1!==o&&f||(i?n.key=m:n.which=Ze(p)),f&&(n[f]=!u||null)}}catch(t){l=!0,d=t}finally{try{!a&&h.return&&h.return()}finally{if(l)throw d}}return n}function Pe(t,e){for(var i in t){var n=t[i],s=void 0;if(null!=n&&((null!=(s="key"===i&&null!=e.key?e.key.toLowerCase():"which"===i?91===n&&93===e.which?91:e.which:e[i])||!1!==n)&&s!==n))return!1}return!0}function Ze(t){return t=Ne(t),Ee[t]||t.toUpperCase().charCodeAt(0)}function Ne(t){return t=t.toLowerCase(),t=Te[t]||t}_e.default=Ie,_e.isHotkey=Ie,_e.isCodeHotkey=function(t,e){return Ie(t,e)};var Oe=_e.isKeyHotkey=function(t,e){return Ie(t,{byKey:!0},e)};_e.parseHotkey=Me,_e.compareHotkey=Pe,_e.toKeyCode=Ze,_e.toKeyName=Ne;const ze=new Map([["arrow-left","left"],["arrow-right","right"],["arrow-up","up"],["arrow-down","down"]]);class He{constructor(t){this.keydownEventList=[],this.keyupEventList=[],this.container=t,this.container.on("keydown",(t=>{const e=t;if(!e.isComposing)for(const t of this.keydownEventList)if(Oe(t.type,e)&&!1===t.listener(e))break})),this.container.on("keyup",(t=>{const e=t;if(!e.isComposing)for(const t of this.keyupEventList)if(Oe(t.type,e)&&!1===t.listener(e))break}))}normalizeType(t){var e;return t=null!==(e=ze.get(t))&&void 0!==e?e:t}setKeydown(t,e){t=this.normalizeType(t),this.keydownEventList.push({type:t,listener:e})}setKeyup(t,e){t=this.normalizeType(t),this.keyupEventList.push({type:t,listener:e})}keydown(t){t=this.normalizeType(t);for(const e of this.keydownEventList)if(e.type===t&&!1===e.listener(new KeyboardEvent(t)))break}keyup(t){t=this.normalizeType(t);for(const e of this.keyupEventList)if(e.type===t&&!1===e.listener(new KeyboardEvent(t)))break}}const $e={value:"<p><br /></p>",readonly:!1,spellcheck:!1,tabIndex:0,placeholder:"",indentWithTab:!0,lang:"en-US",minChangeSize:5,historySize:100,onMessage:(t,e)=>{"success"!==t?"warning"!==t?"error"===t&&console.error(e):console.warn(e):console.log(e)}};class De{constructor(t){if(this.unsavedInputData="",this.unsavedInputCount=0,this.state={appliedItems:[],disabledNameMap:new Map,selectedNameMap:new Map,selectedValuesMap:new Map},this.isComposing=!1,this.event=new vt,this.box=De.box,this.copyListener=t=>{this.selection.range.commonAncestor.closestContainer().get(0)===this.container.get(0)&&this.event.emit("copy",t)},this.cutListener=t=>{this.selection.range.commonAncestor.closestContainer().get(0)===this.container.get(0)&&this.event.emit("cut",t)},this.pasteListener=t=>{this.selection.range.commonAncestor.closestContainer().get(0)===this.container.get(0)&&this.event.emit("paste",t)},this.selectionchangeListener=()=>{this.selection.updateByRange(),this.updateBoxSelectionStyle(),this.emitStateChangeEvent()},this.clickListener=t=>{const e=new L(t.target);!e.get(0).isConnected||e.closest(".lake-popup").length>0||this.event.emit("click",e)},this.resizeListener=()=>{this.event.emit("resize")},this.updateBoxSelectionStyle=ye((()=>{if(0===this.root.first().length)return;const t=this.selection.range,e=t.clone();e.adjustBox(),this.container.find("lake-box").each((i=>{const n=Vt(i),s=n.getContainer();if(0!==s.length){if(t.compareBeforeNode(s)<0&&t.compareAfterNode(s)>0&&(!t.isCollapsed||t.startNode.get(0)!==s.get(0)||0!==t.startOffset))return s.removeClass("lake-box-hovered"),s.removeClass("lake-box-selected"),s.removeClass("lake-box-focused"),s.addClass("lake-box-activated"),void n.event.emit("focus");if(e.intersectsNode(n.node))return s.removeClass("lake-box-activated"),void(t.isCollapsed?(s.removeClass("lake-box-hovered"),s.removeClass("lake-box-selected"),s.addClass("lake-box-focused"),n.event.emit("focus")):(s.removeClass("lake-box-focused"),s.addClass("lake-box-selected"),n.event.emit("blur")));s.removeClass("lake-box-activated"),s.removeClass("lake-box-focused"),s.removeClass("lake-box-selected"),n.event.emit("blur")}}))}),50,{immediate:!0}),this.emitStateChangeEvent=ye((()=>{const t=this.command.getNames();let e=this.selection.getAppliedItems();e.length>0&&e[0].node.closestContainer().get(0)!==this.container.get(0)&&(e=[]);const i=new Map,n=new Map,s=new Map;if(e.length>0)for(const o of t){const t=this.command.getItem(o);if(t.isDisabled&&t.isDisabled(e)&&i.set(o,!0),t.isSelected&&t.isSelected(e)&&n.set(o,!0),t.selectedValues){const i=t.selectedValues(e);i.length>0&&s.set(o,i)}}const o={appliedItems:e,disabledNameMap:i,selectedNameMap:n,selectedValuesMap:s};xe(o,this.state)||(this.toolbar&&this.toolbar.updateState(o),this.event.emit("statechange",o),this.state=o)}),50,{immediate:!1}),!t.root)throw new Error("The root of the config must be specified.");this.root=I(t.root),this.toolbar=t.toolbar,this.config=Object.assign({},$e);for(const e of Object.keys(t))this.config[e]=t[e];this.containerWrapper=I('<div class="lake-container-wrapper" />'),this.container=I('<div class="lake-container" />'),this.overlayContainer=I('<div class="lake-overlay" />'),this.popupContainer=I('<div class="lake-popup lake-custom-properties" />'),this.readonly=this.config.readonly,this.root.addClass("lake-custom-properties"),this.container.attr({contenteditable:this.readonly?"false":"true",spellcheck:this.config.spellcheck?"true":"false",tabindex:this.config.tabIndex.toString()}),""!==this.config.placeholder&&this.container.attr("placeholder",this.config.placeholder),this.selection=new ke(this.container),this.command=new Se(this.selection),this.history=new Ce(this.selection),this.history.limit=this.config.historySize,this.keystroke=new He(this.container),yt.set(this.container.id,this)}togglePlaceholderClass(t){const e="lake-placeholder";"<p><br /></p>"===(t=g(t)).replace("<focus />","")?this.container.addClass(e):this.container.removeClass(e)}moveBoxStripText(){const t=this.selection,e=t.range,i=e.startNode.closest(".lake-box-strip"),n=i.closest("lake-box");if("inline"===Vt(n).type)e.isBoxStart?(e.setStartBefore(n),e.collapseToStart()):(e.setStartAfter(n),e.collapseToStart());else{const t=I("<p />");e.isBoxStart?n.before(t):n.after(t),e.setStart(t,0),e.collapseToStart()}const s=i.text();i.html("<br />"),t.insertNode(document.createTextNode(s))}resetUnsavedInputData(){this.unsavedInputData="",this.unsavedInputCount=0}bindInputEvents(){this.container.on("compositionstart",(()=>{this.isComposing=!0})),this.container.on("compositionend",(()=>{this.isComposing=!1})),this.container.on("input",(t=>{const e=t;window.setTimeout((()=>{var t;const i=this.selection.range;if(!i.isInsideBox){if(this.isComposing)return"insertCompositionText"===e.inputType&&this.container.removeClass("lake-placeholder"),void this.event.emit("input",e);if(i.isBoxStart||i.isBoxEnd)return this.moveBoxStripText(),this.history.save(),void this.event.emit("input",e);if("insertText"===e.inputType||"insertCompositionText"===e.inputType)return this.unsavedInputData+=null!==(t=e.data)&&void 0!==t?t:"",this.unsavedInputCount++,this.unsavedInputData.length<this.config.minChangeSize?this.history.save({inputType:"insertText",update:this.unsavedInputCount>1}):(this.history.save({inputType:"insertText",update:!0}),this.resetUnsavedInputData()),void this.event.emit("input",e);this.history.save(),this.event.emit("input",e)}}),0)}))}bindHistoryEvents(){const t=t=>{this.fixContent()&&(this.history.save({update:!0,emitEvent:!1}),t=this.getValue()),this.emitStateChangeEvent(),this.togglePlaceholderClass(t),this.scrollToCaret(),this.event.emit("change",t)};this.history.event.on("undo",(e=>{this.renderBoxes(),t(e),this.resetUnsavedInputData()})),this.history.event.on("redo",(e=>{this.renderBoxes(),t(e),this.resetUnsavedInputData()})),this.history.event.on("save",((e,i)=>{this.removeBoxGarbage(),t(e),this.selection.sync(),"insertText"!==i.inputType&&this.resetUnsavedInputData()}))}get hasFocus(){const t=document.activeElement;return!!t&&I(t).closest(".lake-container").get(0)===this.container.get(0)}get locale(){return Ot(this.config.lang)}fixContent(){const t=this.selection.range;let e=!1,i=this.container.children();for(const t of i)(t.isBlock||t.isMark)&&""===t.html()&&(t.remove(),e=!0,A(`Content fixed: empty tag "${t.name}" was removed`));if(i=this.container.children(),0===i.length)this.container.html("<p><br /></p>"),t.shrinkBefore(this.container),e=!0,A("Content fixed: default paragraph was added");else if(1===i.length){const n=i[0];if(n.isVoid){const i=I("<p />");n.before(i),i.append(n),t.shrinkAfter(i),e=!0,A(`Content fixed: void element "${n.name}" was wrapped in paragraph`)}}return t.adjustBr(),e}setPluginConfig(t,e){this.config[t]||(this.config[t]={});for(const i of Object.keys(e))void 0===this.config[t][i]&&(this.config[t][i]=e[i])}removeBoxGarbage(){const t=mt(this.container.id);for(const e of t.values())e.node.get(0).isConnected||(e.unmount(),t.delete(e.node.id))}renderBoxes(){this.removeBoxGarbage();const t=this.container,e=mt(t.id);t.find("lake-box").each((t=>{const i=I(t);if(e.get(i.id))return;Vt(i).render()}))}focus(){this.container.focus()}blur(){this.container.blur()}scrollToCaret(){const t=this.selection.range;if(t.isBox)return;const e=t.getRect();if(0===e.x||0===e.y)return;const i=this.container.get(0).getBoundingClientRect(),n=I('<div class="lake-artificial-caret" />'),s=e.x-i.x,o=e.y-i.y;n.css({position:"absolute",top:`${o}px`,left:`${s}px`,width:`${e.width}px`,height:`${e.height}px`,"z-index":"-1"}),this.overlayContainer.find(".lake-artificial-caret").remove(),this.overlayContainer.append(n);const r=pt(n);(r.left<0||r.right<0||r.top<0||r.bottom<0)&&n.get(0).scrollIntoView({behavior:"instant",block:"center",inline:"nearest"}),n.remove()}setValue(t){t=f(t);const e=new Gt(t),i=e.getFragment();this.container.empty(),this.togglePlaceholderClass(e.getHTML()),this.container.append(i),this.renderBoxes(),this.selection.updateByBookmark()}getValue(){const t=this.history.cloneContainer();let e=new Gt(t).getHTML();return e=g(e),e}render(){const t=f(this.config.value),e=new Gt(t),i=e.getFragment();this.root.empty(),this.root.append(this.containerWrapper),this.containerWrapper.append(this.container),this.containerWrapper.append(this.overlayContainer),I(document.body).append(this.popupContainer),this.togglePlaceholderClass(e.getHTML()),this.container.append(i),De.plugin.loadAll(this),this.readonly||(this.selection.updateByBookmark(),this.history.save({emitEvent:!1})),this.renderBoxes(),this.toolbar&&this.toolbar.render(this),document.addEventListener("copy",this.copyListener),this.readonly||(document.addEventListener("cut",this.cutListener),document.addEventListener("paste",this.pasteListener),document.addEventListener("selectionchange",this.selectionchangeListener),document.addEventListener("click",this.clickListener),window.addEventListener("resize",this.resizeListener),this.bindInputEvents(),this.bindHistoryEvents())}unmount(){this.event.removeAllListeners(),this.history.event.removeAllListeners(),this.root.empty(),this.popupContainer.remove(),document.removeEventListener("copy",this.copyListener),this.readonly||(document.removeEventListener("cut",this.cutListener),document.removeEventListener("paste",this.pasteListener),document.removeEventListener("selectionchange",this.selectionchangeListener),document.removeEventListener("click",this.clickListener),window.removeEventListener("resize",this.resizeListener))}}De.version="0.1.19",De.box=new class{add(t){wt.set(t.name,t)}remove(t){wt.delete(t)}getNames(){return Array.from(wt.keys())}},De.plugin=new class{constructor(){this.pluginList=[]}add(t){this.pluginList.push(t)}loadAll(t){for(const e of this.pluginList)e(t)}};const Ve=[{icon:n.get("numberedList"),value:"numbered",text:t=>t.toolbar.numberedList()},{icon:n.get("bulletedList"),value:"bulleted",text:t=>t.toolbar.bulletedList()},{icon:n.get("checklist"),value:"checklist",text:t=>t.toolbar.checklist()}],Fe=[{icon:n.get("alignLeft"),value:"left",text:t=>t.toolbar.alignLeft()},{icon:n.get("alignCenter"),value:"center",text:t=>t.toolbar.alignCenter()},{icon:n.get("alignRight"),value:"right",text:t=>t.toolbar.alignRight()},{icon:n.get("alignJustify"),value:"justify",text:t=>t.toolbar.alignJustify()}],Re=[{icon:n.get("increaseIndent"),value:"increase",text:t=>t.toolbar.increaseIndent()},{icon:n.get("decreaseIndent"),value:"decrease",text:t=>t.toolbar.decreaseIndent()}],je=[{icon:n.get("italic"),value:"italic",text:t=>t.toolbar.italic()},{icon:n.get("underline"),value:"underline",text:t=>t.toolbar.underline()},{icon:n.get("strikethrough"),value:"strikethrough",text:t=>t.toolbar.strikethrough()},{icon:n.get("superscript"),value:"superscript",text:t=>t.toolbar.superscript()},{icon:n.get("subscript"),value:"subscript",text:t=>t.toolbar.subscript()},{icon:n.get("code"),value:"code",text:t=>t.toolbar.code()}],We=["#f5222d","#fa541c","#fa8c16","#faad14","#fadb14","#a0d911","#52c41a","#13c2c2","#1677ff","#2f54eb","#722ed1","#eb2f96","#fff1f0","#fff2e8","#fff7e6","#fffbe6","#feffe6","#fcffe6","#f6ffed","#e6fffb","#e6f4ff","#f0f5ff","#f9f0ff","#fff0f6","#ffccc7","#ffd8bf","#ffe7ba","#fff1b8","#ffffb8","#f4ffb8","#d9f7be","#b5f5ec","#bae0ff","#d6e4ff","#efdbff","#ffd6e7","#ffa39e","#ffbb96","#ffd591","#ffe58f","#fffb8f","#eaff8f","#b7eb8f","#87e8de","#91caff","#adc6ff","#d3adf7","#ffadd2","#ff7875","#ff9c6e","#ffc069","#ffd666","#fff566","#d3f261","#95de64","#5cdbd3","#69b1ff","#85a5ff","#b37feb","#ff85c0","#ff4d4f","#ff7a45","#ffa940","#ffc53d","#ffec3d","#bae637","#73d13d","#36cfc9","#4096ff","#597ef7","#9254de","#f759ab","#cf1322","#d4380d","#d46b08","#d48806","#d4b106","#7cb305","#389e0d","#08979c","#0958d9","#1d39c4","#531dab","#c41d7f","#a8071a","#ad2102","#ad4e00","#ad6800","#ad8b00","#5b8c00","#237804","#006d75","#003eb3","#10239e","#391085","#9e1068","#820014","#871400","#873800","#874d00","#876800","#3f6600","#135200","#00474f","#002c8c","#061178","#22075e","#780650","#5c0011","#610b00","#612500","#613400","#614700","#254000","#092b00","#002329","#001d66","#030852","#120338","#520339","#000000","#1f1f1f","#262626","#434343","#595959","#8c8c8c","#bfbfbf","#d9d9d9","#f0f0f0","#f5f5f5","#fafafa","#ffffff"],qe=[{icon:n.get("removeFormat"),value:"",text:t=>t.toolbar.removeColor()}];for(const t of We)qe.push({value:t.toLowerCase(),text:t.toUpperCase()});const Ue=new Map([["strong","bold"],["em","italic"],["i","italic"],["u","underline"],["s","strikethrough"],["sup","superscript"],["sub","subscript"],["code","code"]]),Ke=[{name:"undo",type:"button",icon:n.get("undo"),tooltip:t=>t.toolbar.undo(),onClick:(t,e)=>{t.command.execute(e)}},{name:"redo",type:"button",icon:n.get("redo"),tooltip:t=>t.toolbar.redo(),onClick:(t,e)=>{t.command.execute(e)}},{name:"selectAll",type:"button",icon:n.get("selectAll"),tooltip:t=>t.toolbar.selectAll(),onClick:(t,e)=>{t.command.execute(e)}},{name:"paragraph",type:"button",icon:n.get("paragraph"),tooltip:t=>t.toolbar.paragraph(),isSelected:t=>!!t.find((t=>"p"===t.name)),onClick:t=>{t.command.execute("heading","p")}},{name:"blockQuote",type:"button",icon:n.get("blockQuote"),tooltip:t=>t.toolbar.blockQuote(),onClick:(t,e)=>{t.command.execute(e)}},{name:"numberedList",type:"button",icon:n.get("numberedList"),tooltip:t=>t.toolbar.numberedList(),isSelected:t=>!!t.find((t=>"ol"===t.name)),onClick:t=>{t.command.execute("list","numbered")}},{name:"bulletedList",type:"button",icon:n.get("bulletedList"),tooltip:t=>t.toolbar.bulletedList(),isSelected:t=>!!t.find((t=>"ul"===t.name&&!t.node.hasAttr("type"))),onClick:t=>{t.command.execute("list","bulleted")}},{name:"checklist",type:"button",icon:n.get("checklist"),tooltip:t=>t.toolbar.checklist(),isSelected:t=>!!t.find((t=>"ul"===t.name&&"checklist"===t.node.attr("type"))),onClick:t=>{t.command.execute("list","checklist")}},{name:"alignLeft",type:"button",icon:n.get("alignLeft"),tooltip:t=>t.toolbar.alignLeft(),isSelected:t=>!!t.find((t=>t.node.isBlock&&"left"===t.node.css("text-align"))),onClick:t=>{t.command.execute("align","left")}},{name:"alignCenter",type:"button",icon:n.get("alignCenter"),tooltip:t=>t.toolbar.alignCenter(),isSelected:t=>!!t.find((t=>t.node.isBlock&&"center"===t.node.css("text-align"))),onClick:t=>{t.command.execute("align","center")}},{name:"alignRight",type:"button",icon:n.get("alignRight"),tooltip:t=>t.toolbar.alignRight(),isSelected:t=>!!t.find((t=>t.node.isBlock&&"right"===t.node.css("text-align"))),onClick:t=>{t.command.execute("align","right")}},{name:"alignJustify",type:"button",icon:n.get("alignJustify"),tooltip:t=>t.toolbar.alignJustify(),isSelected:t=>!!t.find((t=>t.node.isBlock&&"justify"===t.node.css("text-align"))),onClick:t=>{t.command.execute("align","justify")}},{name:"increaseIndent",type:"button",icon:n.get("increaseIndent"),tooltip:t=>t.toolbar.increaseIndent(),onClick:t=>{t.command.execute("indent","increase")}},{name:"decreaseIndent",type:"button",icon:n.get("decreaseIndent"),tooltip:t=>t.toolbar.decreaseIndent(),onClick:t=>{t.command.execute("indent","decrease")}},{name:"bold",type:"button",icon:n.get("bold"),tooltip:t=>t.toolbar.bold(),onClick:(t,e)=>{t.command.execute(e)}},{name:"italic",type:"button",icon:n.get("italic"),tooltip:t=>t.toolbar.italic(),onClick:(t,e)=>{t.command.execute(e)}},{name:"underline",type:"button",icon:n.get("underline"),tooltip:t=>t.toolbar.underline(),onClick:(t,e)=>{t.command.execute(e)}},{name:"strikethrough",type:"button",icon:n.get("strikethrough"),tooltip:t=>t.toolbar.strikethrough(),onClick:(t,e)=>{t.command.execute(e)}},{name:"superscript",type:"button",icon:n.get("superscript"),tooltip:t=>t.toolbar.superscript(),onClick:(t,e)=>{t.command.execute(e)}},{name:"subscript",type:"button",icon:n.get("subscript"),tooltip:t=>t.toolbar.subscript(),onClick:(t,e)=>{t.command.execute(e)}},{name:"code",type:"button",icon:n.get("code"),tooltip:t=>t.toolbar.code(),onClick:(t,e)=>{t.command.execute(e)}},{name:"removeFormat",type:"button",icon:n.get("removeFormat"),tooltip:t=>t.toolbar.removeFormat(),onClick:(t,e)=>{t.command.execute(e)}},{name:"formatPainter",type:"button",icon:n.get("formatPainter"),tooltip:t=>t.toolbar.formatPainter(),onClick:(t,e)=>{t.command.execute(e)}},{name:"link",type:"button",icon:n.get("link"),tooltip:t=>t.toolbar.link(),onClick:(t,e)=>{t.command.execute(e)}},{name:"hr",type:"button",icon:n.get("hr"),tooltip:t=>t.toolbar.hr(),onClick:(t,e)=>{t.command.execute(e)}},{name:"codeBlock",type:"button",icon:n.get("codeBlock"),tooltip:t=>t.toolbar.codeBlock(),onClick:(t,e)=>{t.command.execute(e)}},{name:"video",type:"button",icon:n.get("video"),tooltip:t=>t.toolbar.video(),onClick:(t,e)=>{t.command.execute(e)}},{name:"equation",type:"button",icon:n.get("equation"),tooltip:t=>t.toolbar.equation(),onClick:(t,e)=>{t.command.execute(e)}},{name:"heading",type:"dropdown",downIcon:n.get("down"),defaultValue:"p",tooltip:t=>t.toolbar.heading(),width:"100px",menuType:"list",menuItems:[{value:"h1",text:t=>`<span style="font-weight: bold; font-size: 26px;">${t.toolbar.heading1()}</span>`},{value:"h2",text:t=>`<span style="font-weight: bold; font-size: 24px;">${t.toolbar.heading2()}</span>`},{value:"h3",text:t=>`<span style="font-weight: bold; font-size: 22px;">${t.toolbar.heading3()}</span>`},{value:"h4",text:t=>`<span style="font-weight: bold; font-size: 20px;">${t.toolbar.heading4()}</span>`},{value:"h5",text:t=>`<span style="font-weight: bold; font-size: 18px;">${t.toolbar.heading5()}</span>`},{value:"h6",text:t=>`<span style="font-weight: bold; font-size: 16px;">${t.toolbar.heading6()}</span>`},{value:"p",text:t=>t.toolbar.paragraph()}],onSelect:(t,e)=>{t.command.execute("heading",e)}},{name:"list",type:"dropdown",downIcon:n.get("down"),icon:n.get("list"),tooltip:t=>t.toolbar.list(),menuType:"list",menuItems:Ve,onSelect:(t,e)=>{t.command.execute("list",e)}},{name:"align",type:"dropdown",downIcon:n.get("down"),icon:n.get("alignLeft"),tooltip:t=>t.toolbar.align(),menuType:"list",menuItems:Fe,onSelect:(t,e)=>{t.command.execute("align",e)}},{name:"indent",type:"dropdown",downIcon:n.get("down"),icon:n.get("increaseIndent"),tooltip:t=>t.toolbar.indent(),menuType:"list",menuItems:Re,onSelect:(t,e)=>{t.command.execute("indent",e)}},{name:"fontFamily",type:"dropdown",downIcon:n.get("down"),defaultValue:"Segoe UI",tooltip:t=>t.toolbar.fontFamily(),width:"100px",menuType:"list",menuItems:[{value:"Arial",text:'<span style="font-family: Arial;">Arial</span>'},{value:"Arial Black",text:"<span style=\"font-family: 'Arial Black';\">Arial Black</span>"},{value:"Comic Sans MS",text:"<span style=\"font-family: 'Comic Sans MS';\">Comic Sans MS</span>"},{value:"Courier New",text:"<span style=\"font-family: 'Courier New';\">Courier New</span>"},{value:"Georgia",text:'<span style="font-family: Georgia;">Georgia</span>'},{value:"Helvetica",text:'<span style="font-family: Helvetica;">Helvetica</span>'},{value:"Impact",text:'<span style="font-family: Impact;">Impact</span>'},{value:"Segoe UI",text:"<span style=\"font-family: 'Segoe UI';\">Segoe UI</span>"},{value:"Tahoma",text:'<span style="font-family: Tahoma;">Tahoma</span>'},{value:"Times New Roman",text:"<span style=\"font-family: 'Times New Roman';\">Times New Roman</span>"},{value:"Trebuchet MS",text:"<span style=\"font-family: 'Trebuchet MS';\">Trebuchet MS</span>"},{value:"Verdana",text:'<span style="font-family: Verdana;">Verdana</span>'}],onSelect:(t,e)=>{t.command.execute("fontFamily",e)}},{name:"fontSize",type:"dropdown",downIcon:n.get("down"),defaultValue:"16px",tooltip:t=>t.toolbar.fontSize(),width:"65px",menuType:"list",menuItems:[{value:"12px",text:"12px"},{value:"14px",text:"14px"},{value:"16px",text:"16px"},{value:"18px",text:"18px"},{value:"22px",text:"22px"},{value:"24px",text:"24px"},{value:"32px",text:"32px"}],onSelect:(t,e)=>{t.command.execute("fontSize",e)}},{name:"moreStyle",type:"dropdown",icon:n.get("more"),tooltip:t=>t.toolbar.moreStyle(),menuType:"list",menuItems:je,selectedValues:t=>{var e;const i=[];for(const n of t)if(n.node.isMark){const t=null!==(e=Ue.get(n.name))&&void 0!==e?e:n.name;i.push(t)}return i},onSelect:(t,e)=>{t.command.execute(e)}},{name:"fontColor",type:"dropdown",downIcon:n.get("down"),icon:n.get("fontColor"),accentIcon:n.get("fontColorAccent"),defaultValue:"#f5222d",tooltip:t=>t.toolbar.fontColor(),menuType:"color",menuItems:qe,menuWidth:"296px",onSelect:(t,e)=>{t.command.execute("fontColor",e)}},{name:"highlight",type:"dropdown",downIcon:n.get("down"),icon:n.get("highlight"),accentIcon:n.get("highlightAccent"),defaultValue:"#fadb14",tooltip:t=>t.toolbar.highlight(),menuType:"color",menuItems:qe,menuWidth:"296px",onSelect:(t,e)=>{t.command.execute("highlight",e)}},{name:"image",type:"upload",icon:n.get("image"),tooltip:t=>t.toolbar.image(),accept:"image/*",multiple:!0},{name:"file",type:"upload",icon:n.get("attachment"),tooltip:t=>t.toolbar.file(),accept:"*",multiple:!0}],Ge=["undo","redo","|","heading","|","formatPainter","removeFormat","bold","moreStyle","|","fontColor","highlight","|","align","list","indent","link","blockQuote","hr"],Xe=new Map;for(const t of Ke)Xe.set(t.name,t);const Ye={type:"block",name:"hr",render:t=>{const e=t.getEditor();if(!e)return;const i=t.getContainer(),n=I('<div class="lake-hr"><hr /></div>');i.empty(),i.append(n),n.on("click",(()=>{e.selection.selectBox(t)}))},html:()=>"<hr />"},Je="#57606a",Qe="#444d56",ti="#953800",ei="#0550ae",ii="#444d56",ni="#24292e",si="#005cc5",oi="#0550ae",ri="#444d56",ai="#444d56",li="#0a3069",di="#0550ae",ci="#0550ae",hi="#116329",pi="#0550ae",ui="#cf222e",mi="#24292f",fi="#cf222e",gi="#57606a",vi="#57606a",wi="#8250df",yi="#0550ae",xi="#f6f8fa",bi="#cf222e",ki="#0550ae",Si="#005cc5",Ci="#444d56",_i="#444d56";function Bi(t){const{HighlightStyle:e,tags:i}=t;return e.define([{tag:[i.comment,i.lineComment,i.blockComment,i.docComment],color:Je},{tag:[i.name],color:Qe},{tag:[i.variableName,i.self],color:ti},{tag:[i.typeName,i.tagName],color:ei},{tag:[i.propertyName,i.attributeName],color:ii},{tag:[i.className],color:ni},{tag:[i.labelName],color:si},{tag:[i.namespace],color:oi},{tag:[i.macroName],color:ri},{tag:[i.literal],color:ai},{tag:[i.string,i.docString,i.character,i.attributeValue,i.unit],color:li},{tag:[i.number,i.integer,i.float],color:di},{tag:[i.bool,i.null,i.atom],color:ci},{tag:[i.regexp,i.escape,i.url],color:hi},{tag:[i.color],color:pi},{tag:[i.keyword,i.operatorKeyword,i.controlKeyword,i.definitionKeyword,i.moduleKeyword],color:ui},{tag:[i.modifier],color:mi},{tag:[i.operator,i.derefOperator,i.arithmeticOperator,i.logicOperator,i.bitwiseOperator,i.compareOperator,i.updateOperator,i.definitionOperator,i.typeOperator,i.controlOperator],color:fi},{tag:[i.punctuation,i.separator,i.bracket,i.angleBracket,i.squareBracket,i.paren,i.brace,i.contentSeparator],color:gi},{tag:[i.content],color:vi},{tag:[i.meta,i.documentMeta,i.annotation,i.processingInstruction],color:wi},{tag:i.heading,fontWeight:"bold",color:yi},{tag:i.strong,fontWeight:"bold"},{tag:i.emphasis,fontStyle:"italic"},{tag:i.link,textDecoration:"underline"},{tag:i.strikethrough,textDecoration:"line-through"},{tag:[i.invalid,i.inserted,i.deleted,i.changed],color:xi},{tag:[i.definition(i.name)],color:bi},{tag:[i.constant(i.name)],color:ki},{tag:[i.function(i.variableName)],color:Si},{tag:[i.standard(i.name)],color:Ci},{tag:[i.special(i.variableName)],color:_i}])}const Ai={type:"block",name:"codeBlock",render:t=>{var e;const i=t.getEditor();if(!i)return;const s=I('<div class="lake-code-block" />'),o=t.getContainer();o.css("width",i.container.innerWidth()-2+"px"),o.empty(),o.append(s);const r=s.get(0);if(!r)return;const a=window.LakeCodeMirror;if(!a)return i.readonly?void t.node.hide():(s.addClass("lake-code-block-error"),s.text('\n The code cannot be displayed because window.LakeCodeMirror is not found.\n Please check if the "lake-codemirror" library is added to this page.\n '.trim()),void s.on("click",(()=>{i.selection.selectBox(t)})));const{EditorState:l,Compartment:d,EditorView:c,keymap:h,history:p,defaultKeymap:u,historyKeymap:m,indentWithTab:f,syntaxHighlighting:g}=a,v=a.langItems,w=i.config.codeBlock,y=v.filter((t=>w.langList.indexOf(t.value)>=0)),x=new Map;for(const t of y)x.set(t.value,t);const b=t.value,k=x.get(b.lang),S=new d,C=c.updateListener.of((e=>{var n;e.docChanged&&(n=e.state.doc.toString(),window.setTimeout((()=>{i.isComposing||(t.updateValue("code",n),i.history.save())}),0))})),_=new c({parent:r,doc:null!==(e=b.code)&&void 0!==e?e:"",extensions:[l.readOnly.of(i.readonly),c.editable.of(!i.readonly),p(),h.of([...u,...m,f]),g(Bi(a)),S.of(k&&k.component?k.component():[]),C]});s.find('[contenteditable="true"]').attr("tabindex","-1");new zt({root:s,name:"langType",downIcon:n.get("down"),defaultValue:k?b.lang:w.defaultLang,tooltip:i.locale.codeBlock.langType(),menuType:"list",menuHeight:"200px",menuItems:y.map((t=>({value:t.value,text:t.text}))),onSelect:e=>{t.updateValue({lang:e}),t.unmount(),t.render(),i.selection.selectBox(t),i.history.save()}}).render();const B=()=>{o.css("width",i.container.innerWidth()-2+"px")};i.event.on("resize",B),s.on("click",(()=>{_.hasFocus||_.focus()})),t.event.on("beforeunmount",(()=>{_.destroy(),i.event.off("resize",B),A("CodeMirror destroyed")}))}};function Ti(t,e,i,n){return new(i||(i=Promise))((function(s,o){function r(t){try{l(n.next(t))}catch(t){o(t)}}function a(t){try{l(n.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(r,a)}l((n=n.apply(t,e||[])).next())}))}
19
19
  /*!
20
20
  * PhotoSwipe Lightbox 5.4.4 - https://photoswipe.com
21
21
  * (c) 2024 Dmytro Semenov
@@ -101,13 +101,13 @@ function Ei(t,e,i){const n=document.createElement(e);return t&&(n.className=t),i
101
101
  </div>
102
102
  <div class="lake-row lake-button-row"></div>
103
103
  </div>
104
- `)}writeClipboardText(t){return Ti(this,void 0,void 0,(function*(){let e=!1;try{window.LAKE_TEST?e=window.LAKE_ERROR:yield navigator.clipboard.writeText(t)}catch(t){e=!0}return new Promise((t=>{t(e)}))}))}appendCopyButton(){const t=this.config;let e=null;const i=new xt({root:this.container.find(".lake-url-row"),name:"copy",icon:n.get("copy"),tooltip:this.locale.link.copy(),onClick:()=>{if(!this.linkNode)return;const i=this.getInputValue("url");this.writeClipboardText(i).then((i=>{const n=this.container.find('button[name="copy"] svg');if(n.hide(),i)return n.eq(2).show("inline"),void(t.onCopy&&t.onCopy(i));n.eq(1).show("inline"),t.onCopy&&t.onCopy(i),e&&window.clearTimeout(e),e=window.setTimeout((()=>{n.hide(),n.eq(0).show("inline")}),2e3)}))}});i.render();const s=n.get("checkCircle");s&&i.node.append(s);const o=n.get("warningCircle");o&&i.node.append(o)}appendOpenButton(){new xt({root:this.container.find(".lake-url-row"),name:"open",icon:n.get("open"),tooltip:this.locale.link.open(),onClick:()=>{if(!this.linkNode)return;const t=this.getInputValue("url");window.open(t)}}).render()}appendSaveButton(){const t=new xt({root:this.container.find(".lake-button-row"),name:"save",icon:n.get("check"),text:this.locale.link.save(),onClick:()=>{if(!this.linkNode)return;const t=this.linkNode;this.save(),this.hide(),this.config.onSave&&this.config.onSave(t)}});t.render(),this.container.find('input[name="url"]').on("keydown",(e=>{Oe("enter",e)&&(e.preventDefault(),t.node.emit("click"))})),this.container.find('input[name="title"]').on("keydown",(e=>{Oe("enter",e)&&(e.preventDefault(),t.node.emit("click"))}))}appendUnlinkButton(){new xt({root:this.container.find(".lake-button-row"),name:"unlink",icon:n.get("unlink"),text:this.locale.link.unlink(),onClick:()=>{if(!this.linkNode)return;const t=this.linkNode.last();this.linkNode.remove(!0),this.hide(),this.config.onRemove&&this.config.onRemove(t)}}).render()}getInputValue(t){return this.container.find(`input[name="${t}"]`).get(0).value}setInputValue(t,e){this.container.find(`input[name="${t}"]`).get(0).value=e}save(){if(!this.linkNode)return;const t=this.getInputValue("url");let e=this.getInputValue("title");""!==t||""!==e?(""===e&&(e=t),this.linkNode.attr("href",t),this.linkNode.text(e)):this.linkNode.remove()}updatePosition(){if(!this.linkNode)return;const t=pt(this.linkNode);if(t.left<0||t.right<0||t.top<0||t.bottom<0)return void this.container.css("visibility","hidden");this.container.css("visibility","");const e=this.linkNode.get(0).getBoundingClientRect(),i=e.x+window.scrollX,n=e.y+window.scrollY;e.x+this.container.width()>window.innerWidth?this.container.css("left",`${i-this.container.width()+e.width}px`):this.container.css("left",`${i}px`),e.y+e.height+this.container.height()>window.innerHeight?this.container.css("top",n-this.container.height()+"px"):this.container.css("top",`${n+e.height}px`)}render(){this.appendCopyButton(),this.appendOpenButton(),this.appendSaveButton(),this.appendUnlinkButton(),this.root.append(this.container)}show(t){if(0===this.root.find(".lake-link-popup").length&&this.render(),this.linkNode&&this.linkNode.get(0)===t.get(0))return;this.linkNode=t;const e=t.attr("href"),i=t.text();this.setInputValue("url",e),i!==e&&this.setInputValue("title",i),this.container.css("visibility","hidden"),this.container.show(),this.updatePosition(),this.container.css("visibility",""),this.container.find('input[name="url"]').focus()}hide(){this.linkNode=null,this.container.hide()}}const Ts=["text","c","csharp","cpp","css","go","html","java","javascript","json","markdown","php","python","rust","sql","typescript","xml","yaml"];const Es=new Map([["#","h1"],["##","h2"],["###","h3"],["####","h4"],["#####","h5"],["######","h6"]]),Ls=new Map([["js","javascript"],["ts","typescript"],["md","markdown"],["htm","html"]]),Is=[{re:/\*\*(.+?)\*\*$/,getParameters:()=>["bold"]},{re:/__(.+?)__$/,getParameters:()=>["bold"]},{re:/_(.+?)_$/,getParameters:()=>["italic"]},{re:/\*(.+?)\*$/,getParameters:()=>["italic"]},{re:/==(.+?)==$/,getParameters:()=>["highlight","#fff566"]},{re:/~~(.+?)~~$/,getParameters:()=>["strikethrough"]},{re:/`(.+?)`$/,getParameters:()=>["code"]}],Ms=[{re:/^#+$/,getParameters:t=>{var e;return["heading",null!==(e=Es.get(t[0]))&&void 0!==e?e:"h6"]}},{re:/^\d+\.$/,getParameters:()=>["list","numbered"]},{re:/^[*\-+]$/,getParameters:()=>["list","bulleted"]},{re:/^\[\s?\]$/,getParameters:()=>["list","checklist",!1]},{re:/^\[x\]$/i,getParameters:()=>["list","checklist",!0]},{re:/^>$/,getParameters:()=>["blockQuote"]}],Ps=[{re:/^:{3,}([a-z]*)$/i,getParameters:t=>t[1]?["blockQuote",t[1]]:["blockQuote","info"]},{re:/^-{3,}$/,getParameters:()=>["hr"]},{re:/^`{3,}([a-z]*)$/i,getParameters:t=>{var e;return t[1]?["codeBlock",{lang:null!==(e=Ls.get(t[1]))&&void 0!==e?e:t[1]}]:["codeBlock"]}}];function Zs(t){const e=t.clone(!0);e.find("lake-bookmark").remove(),""===e.html()&&t.prepend("<br />")}function Ns(t,e){const i=t.selection.range,n=i.getEndText();t.selection.splitBlock(),(e=i.getBlocks()[0])&&(""!==n||!e.isHeading&&"blockquote"!==e.name?e.isList&&"checklist"===e.attr("type")&&e.find("li").attr("value","false"):t.selection.setBlocks("<p />"))}function Os(t){const e=t.selection.range,i=e.startNode.closest("lake-box"),n=i.closestBlock();if(n.length>0&&!n.isContainer)return void(e.isBoxStart?(e.setStartBefore(i),e.collapseToStart(),Ns(t,n)):e.isBoxEnd?(e.setStartAfter(i),e.collapseToStart(),Ns(t,n)):t.selection.removeBox());const s=I("<p><br /></p>");e.isBoxStart?i.before(s):e.isBoxEnd?(i.after(s),e.shrinkAfter(s)):t.selection.removeBox()}function zs(t){const e=t.selection.range,i=e.startNode.closestBlock();if(i.length>0&&!i.isContainer){const i=e.getPrevNode(),n=e.getEndText();if("br"!==i.name&&""===n){const e=new qt;return e.append("<br /><br />"),t.selection.insertFragment(e),void t.history.save()}}t.selection.insertNode(I("<br />"))}function Hs(t){const e=t.selection.range,i=e.startNode.closest("lake-box"),n=i.closestBlock();if(n.length>0&&!n.isContainer)return void(e.isBoxStart?(e.setStartBefore(i),e.collapseToStart(),zs(t)):e.isBoxEnd?(e.setStartAfter(i),e.collapseToStart(),zs(t)):t.selection.removeBox());const s=I("<p><br /></p>");e.isBoxStart?i.before(s):e.isBoxEnd?(i.after(s),e.shrinkAfter(s)):t.selection.removeBox()}function $s(t,e){const i=t.selection.range;let n=e.prev();if(0===n.length)return void("p"!==e.name&&t.selection.setBlocks("<p />"));if(n.isBox)return e.isEmpty&&e.remove(),void i.selectBoxEnd(n);if("br"===n.name)return void n.remove();if(!n.isBlock){const t=new M;t.selectNodeContents(n),se(t,"<p />"),n=t.startNode.closestBlock()}if(n.isEmpty)return void n.remove();!function(t){const e=t.getBlocks()[0];e&&e.isEmpty&&"br"!==e.first().name&&(e.empty(),Z(e,I("<br />")),t.shrinkAfter(e))}(i);const s=i.getNextNode();if("br"===s.name&&"p"!==n.name)return s.remove(),void i.shrinkAfter(n);const o=t.selection.insertBookmark();z(n,e),t.selection.toBookmark(o),t.selection.fixList()}function Ds(t,e){const i=t.selection.range;let n=e.next();if(0===n.length)return void t.history.save();if(n.isBox)return e.isEmpty&&e.remove(),i.selectBoxStart(n),void t.history.save();if(!n.isBlock){const t=new M;t.selectNodeContents(n),se(t,"<p />"),n=n.closestBlock()}const s=t.selection.insertBookmark();z(e,n),t.selection.toBookmark(s),t.selection.fixList()}return De.box.add(Ye),De.box.add(Ai),De.box.add(ns),De.box.add(as),De.box.add(ds),De.box.add(cs),De.box.add(ps),De.plugin.add((t=>{t.event.on("copy",(e=>{const i=t.selection.range;if(i.isInsideBox)return;if(!i.isCollapsed)return void i.adjust();const n=i.commonAncestor.closest("lake-box");if(0===n.length)return;if(i.isBoxStart||i.isBoxEnd)return;e.preventDefault();const s=e.clipboardData;if(!s)return;const o=Vt(n).getHTML();s.setData("text/html",o)}))})),De.plugin.add((t=>{t.readonly||t.event.on("cut",(e=>{const i=e.clipboardData;if(!i)return;const n=t.selection.range;if(n.isInsideBox)return;if(!n.isCollapsed){e.preventDefault();const n=t.selection.range.cloneContents(),s=I("<div />");return s.append(n),i.setData("text/html",s.html()),t.selection.deleteContents(),void t.history.save()}const s=n.commonAncestor.closest("lake-box");if(0===s.length)return;if(n.isBoxStart||n.isBoxEnd)return;e.preventDefault();const o=Vt(s).getHTML();i.setData("text/html",o),t.selection.removeBox(),t.history.save()}))})),De.plugin.add((t=>{t.readonly||t.event.on("paste",(e=>{const{requestTypes:i}=t.config.image;if(t.selection.range.isInsideBox)return;e.preventDefault();const n=e.clipboardData;if(!n)return;if(t.selection.deleteContents(),n.files.length>0){for(const e of n.files)i.indexOf(e.type)>=0&&jt({editor:t,name:0===e.type.indexOf("image/")?"image":"file",file:e,onError:e=>t.config.onMessage("error",e)});return}const s=n.types;if(1===s.length&&"text/plain"===s[0]){const e=n.getData("text/plain"),i=new Xt(e).getFragment();return t.event.emit("beforepaste",i),void fs(t,i)}const o=f(n.getData("text/html")),r=function(){const t=Kt();t.div=t.p;for(const e of Object.keys(t)){const i=t[e];delete i.id,delete i.class}return t}(),a=new Gt(o,r).getFragment();t.event.emit("beforepaste",a),function(t){let e=new L(t.firstChild);for(;e.length>0;){const t=e.next();e.isBlock&&ms(e),e=t}let i=[];for(e=new L(t.firstChild);e.length>0;){const t=e.next();e.isMark||e.isText||e.isBookmark||e.isInlineBox?i.push(e):($(i),i=[]),e=t}$(i)}(a),fs(t,a)}))})),De.plugin.add((t=>{if(t.readonly)return;let e=null,i=null,n=null,s="bottom";t.container.on("dragstart",(n=>{e=null;const s=n,o=s.dataTransfer;if(!o)return;o.effectAllowed="move";const r=I(s.target).closest("lake-box");if(0===r.length)return void s.preventDefault();"inline"!==Vt(r).type?(e=r,i=I(a`
104
+ `)}writeClipboardText(t){return Ti(this,void 0,void 0,(function*(){let e=!1;try{window.LAKE_TEST?e=window.LAKE_ERROR:yield navigator.clipboard.writeText(t)}catch(t){e=!0}return new Promise((t=>{t(e)}))}))}appendCopyButton(){const t=this.config;let e=null;const i=new xt({root:this.container.find(".lake-url-row"),name:"copy",icon:n.get("copy"),tooltip:this.locale.link.copy(),onClick:()=>{if(!this.linkNode)return;const i=this.getInputValue("url");this.writeClipboardText(i).then((i=>{const n=this.container.find('button[name="copy"] svg');if(n.hide(),i)return n.eq(2).show("inline"),void(t.onCopy&&t.onCopy(i));n.eq(1).show("inline"),t.onCopy&&t.onCopy(i),e&&window.clearTimeout(e),e=window.setTimeout((()=>{n.hide(),n.eq(0).show("inline")}),2e3)}))}});i.render();const s=n.get("checkCircle");s&&i.node.append(s);const o=n.get("warningCircle");o&&i.node.append(o)}appendOpenButton(){new xt({root:this.container.find(".lake-url-row"),name:"open",icon:n.get("open"),tooltip:this.locale.link.open(),onClick:()=>{if(!this.linkNode)return;const t=this.getInputValue("url");window.open(t)}}).render()}appendSaveButton(){const t=new xt({root:this.container.find(".lake-button-row"),name:"save",icon:n.get("check"),text:this.locale.link.save(),onClick:()=>{if(!this.linkNode)return;const t=this.linkNode;this.save(),this.hide(),this.config.onSave&&this.config.onSave(t)}});t.render(),this.container.find('input[name="url"]').on("keydown",(e=>{Oe("enter",e)&&(e.preventDefault(),t.node.emit("click"))})),this.container.find('input[name="title"]').on("keydown",(e=>{Oe("enter",e)&&(e.preventDefault(),t.node.emit("click"))}))}appendUnlinkButton(){new xt({root:this.container.find(".lake-button-row"),name:"unlink",icon:n.get("unlink"),text:this.locale.link.unlink(),onClick:()=>{if(!this.linkNode)return;const t=this.linkNode.last();this.linkNode.remove(!0),this.hide(),this.config.onRemove&&this.config.onRemove(t)}}).render()}getInputValue(t){return this.container.find(`input[name="${t}"]`).get(0).value}setInputValue(t,e){this.container.find(`input[name="${t}"]`).get(0).value=e}save(){if(!this.linkNode)return;const t=this.getInputValue("url");let e=this.getInputValue("title");""!==t||""!==e?(""===e&&(e=t),this.linkNode.attr("href",t),this.linkNode.text(e)):this.linkNode.remove()}updatePosition(){if(!this.linkNode)return;const t=pt(this.linkNode);if(t.left<0||t.right<0||t.top<0||t.bottom<0)return void this.container.css("visibility","hidden");this.container.css("visibility","");const e=this.linkNode.get(0).getBoundingClientRect(),i=e.x+window.scrollX,n=e.y+window.scrollY;e.x+this.container.width()>window.innerWidth?this.container.css("left",`${i-this.container.width()+e.width}px`):this.container.css("left",`${i}px`),e.y+e.height+this.container.height()>window.innerHeight?this.container.css("top",n-this.container.height()+"px"):this.container.css("top",`${n+e.height}px`)}render(){this.appendCopyButton(),this.appendOpenButton(),this.appendSaveButton(),this.appendUnlinkButton(),this.root.append(this.container)}show(t){if(0===this.root.find(".lake-link-popup").length&&this.render(),this.linkNode&&this.linkNode.get(0)===t.get(0))return;this.linkNode=t;const e=t.attr("href"),i=t.text();this.setInputValue("url",e),i!==e&&this.setInputValue("title",i),this.container.css("visibility","hidden"),this.container.show(),this.updatePosition(),this.container.css("visibility",""),this.container.find('input[name="url"]').focus()}hide(){this.linkNode=null,this.container.hide()}}const Ts=["text","c","csharp","cpp","css","go","html","java","javascript","json","markdown","php","python","rust","sql","typescript","xml","yaml"];const Es=new Map([["#","h1"],["##","h2"],["###","h3"],["####","h4"],["#####","h5"],["######","h6"]]),Ls=new Map([["js","javascript"],["ts","typescript"],["md","markdown"],["htm","html"]]),Is=[{re:/\*\*(.+?)\*\*$/,getParameters:()=>["bold"]},{re:/__(.+?)__$/,getParameters:()=>["bold"]},{re:/_(.+?)_$/,getParameters:()=>["italic"]},{re:/\*(.+?)\*$/,getParameters:()=>["italic"]},{re:/==(.+?)==$/,getParameters:()=>["highlight","#fff566"]},{re:/~~(.+?)~~$/,getParameters:()=>["strikethrough"]},{re:/`(.+?)`$/,getParameters:()=>["code"]}],Ms=[{re:/^#+$/,getParameters:t=>{var e;return["heading",null!==(e=Es.get(t[0]))&&void 0!==e?e:"h6"]}},{re:/^\d+\.$/,getParameters:()=>["list","numbered"]},{re:/^[*\-+]$/,getParameters:()=>["list","bulleted"]},{re:/^\[\s?\]$/,getParameters:()=>["list","checklist",!1]},{re:/^\[x\]$/i,getParameters:()=>["list","checklist",!0]},{re:/^>$/,getParameters:()=>["blockQuote"]}],Ps=[{re:/^:{3,}([a-z]*)$/i,getParameters:t=>t[1]?["blockQuote",t[1]]:["blockQuote","info"]},{re:/^-{3,}$/,getParameters:()=>["hr"]},{re:/^`{3,}([a-z]*)$/i,getParameters:t=>{var e;return t[1]?["codeBlock",{lang:null!==(e=Ls.get(t[1]))&&void 0!==e?e:t[1]}]:["codeBlock"]}}];function Zs(t){const e=t.clone(!0);e.find("lake-bookmark").remove(),""===e.html()&&t.prepend("<br />")}function Ns(t,e){const i=t.selection.range,n=i.getEndText();t.selection.splitBlock(),(e=i.getBlocks()[0])&&(""!==n||!e.isHeading&&"blockquote"!==e.name?e.isList&&"checklist"===e.attr("type")&&e.find("li").attr("value","false"):t.selection.setBlocks("<p />"))}function Os(t){const e=t.selection.range,i=e.startNode.closest("lake-box"),n=i.closestBlock();if(n.length>0&&!n.isContainer)return void(e.isBoxStart?(e.setStartBefore(i),e.collapseToStart(),Ns(t,n)):e.isBoxEnd?(e.setStartAfter(i),e.collapseToStart(),Ns(t,n)):t.selection.removeBox());const s=I("<p><br /></p>");e.isBoxStart?i.before(s):e.isBoxEnd?(i.after(s),e.shrinkAfter(s)):t.selection.removeBox()}function zs(t){const e=t.selection.range,i=e.startNode.closestBlock();if(i.length>0&&!i.isContainer){const i=e.getPrevNode(),n=e.getEndText();if("br"!==i.name&&""===n){const e=new qt;return e.append("<br /><br />"),t.selection.insertFragment(e),void t.history.save()}}t.selection.insertNode(I("<br />"))}function Hs(t){const e=t.selection.range,i=e.startNode.closest("lake-box"),n=i.closestBlock();if(n.length>0&&!n.isContainer)return void(e.isBoxStart?(e.setStartBefore(i),e.collapseToStart(),zs(t)):e.isBoxEnd?(e.setStartAfter(i),e.collapseToStart(),zs(t)):t.selection.removeBox());const s=I("<p><br /></p>");e.isBoxStart?i.before(s):e.isBoxEnd?(i.after(s),e.shrinkAfter(s)):t.selection.removeBox()}function $s(t,e){const i=t.selection.range;let n=e.prev();if(0===n.length)return void("p"!==e.name&&t.selection.setBlocks("<p />"));if(n.isBox)return e.isEmpty&&e.remove(),void i.selectBoxEnd(n);if("br"===n.name)return void n.remove();if(!n.isBlock){const t=new M;t.selectNodeContents(n),se(t,"<p />"),n=t.startNode.closestBlock()}if(n.isEmpty)return void n.remove();!function(t){const e=t.getBlocks()[0];if(e&&e.isEmpty&&"br"!==e.first().name){e.empty();const i=Z(e);t.setStartBefore(i),t.collapseToStart()}}(i);const s=i.getNextNode();if("br"===s.name&&"p"!==n.name)return s.remove(),void i.shrinkAfter(n);const o=t.selection.insertBookmark();z(n,e),t.selection.toBookmark(o),t.selection.fixList()}function Ds(t,e){const i=t.selection.range;let n=e.next();if(0===n.length)return void t.history.save();if(n.isBox)return e.isEmpty&&e.remove(),i.selectBoxStart(n),void t.history.save();if(!n.isBlock){const t=new M;t.selectNodeContents(n),se(t,"<p />"),n=n.closestBlock()}const s=t.selection.insertBookmark();z(e,n),t.selection.toBookmark(s),t.selection.fixList()}return De.box.add(Ye),De.box.add(Ai),De.box.add(ns),De.box.add(as),De.box.add(ds),De.box.add(cs),De.box.add(ps),De.plugin.add((t=>{t.event.on("copy",(e=>{const i=t.selection.range;if(i.isInsideBox)return;if(!i.isCollapsed)return void i.adjust();const n=i.commonAncestor.closest("lake-box");if(0===n.length)return;if(i.isBoxStart||i.isBoxEnd)return;e.preventDefault();const s=e.clipboardData;if(!s)return;const o=Vt(n).getHTML();s.setData("text/html",o)}))})),De.plugin.add((t=>{t.readonly||t.event.on("cut",(e=>{const i=e.clipboardData;if(!i)return;const n=t.selection.range;if(n.isInsideBox)return;if(!n.isCollapsed){e.preventDefault();const n=t.selection.range.cloneContents(),s=I("<div />");return s.append(n),i.setData("text/html",s.html()),t.selection.deleteContents(),void t.history.save()}const s=n.commonAncestor.closest("lake-box");if(0===s.length)return;if(n.isBoxStart||n.isBoxEnd)return;e.preventDefault();const o=Vt(s).getHTML();i.setData("text/html",o),t.selection.removeBox(),t.history.save()}))})),De.plugin.add((t=>{t.readonly||t.event.on("paste",(e=>{const{requestTypes:i}=t.config.image;if(t.selection.range.isInsideBox)return;e.preventDefault();const n=e.clipboardData;if(!n)return;if(t.selection.deleteContents(),n.files.length>0){for(const e of n.files)i.indexOf(e.type)>=0&&jt({editor:t,name:0===e.type.indexOf("image/")?"image":"file",file:e,onError:e=>t.config.onMessage("error",e)});return}const s=n.types;if(1===s.length&&"text/plain"===s[0]){const e=n.getData("text/plain"),i=new Xt(e).getFragment();return t.event.emit("beforepaste",i),void fs(t,i)}const o=f(n.getData("text/html")),r=function(){const t=Kt();t.div=t.p;for(const e of Object.keys(t)){const i=t[e];delete i.id,delete i.class}return t}(),a=new Gt(o,r).getFragment();t.event.emit("beforepaste",a),function(t){let e=new L(t.firstChild);for(;e.length>0;){const t=e.next();e.isBlock&&ms(e),e=t}let i=[];for(e=new L(t.firstChild);e.length>0;){const t=e.next();e.isMark||e.isText||e.isBookmark||e.isInlineBox?i.push(e):($(i),i=[]),e=t}$(i)}(a),fs(t,a)}))})),De.plugin.add((t=>{if(t.readonly)return;let e=null,i=null,n=null,s="bottom";t.container.on("dragstart",(n=>{e=null;const s=n,o=s.dataTransfer;if(!o)return;o.effectAllowed="move";const r=I(s.target).closest("lake-box");if(0===r.length)return void s.preventDefault();"inline"!==Vt(r).type?(e=r,i=I(a`
105
105
  <div class="lake-drop-indication">
106
106
  <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="#000000" viewBox="0 0 256 256">
107
107
  <path d="M181.66,133.66l-80,80A8,8,0,0,1,88,208V48a8,8,0,0,1,13.66-5.66l80,80A8,8,0,0,1,181.66,133.66Z"></path>
108
108
  </svg>
109
109
  </div>
110
- `),t.overlayContainer.append(i)):s.preventDefault()})),t.container.on("dragover",(e=>{const o=e;o.preventDefault();const r=o.dataTransfer;if(!r)return;if(r.dropEffect="move",!i)return;const a=I(o.target);if(a.isContainer)return;const l=a.closest("lake-box");n=l.length>0?l.isBlockBox?l:l.closestBlock():a.closestBlock();const d=t.container.get(0).getBoundingClientRect();let c=n.get(0).getBoundingClientRect();s="bottom";let h=c.x-d.x,p=c.y+c.height-d.y+parseInt(n.computedCSS("margin-bottom"),10)/2;if(o.clientY<c.y+c.height/2){const e=n.prev();e.length>0&&e.isBlock||e.isBlockBox?(n=e,c=n.get(0).getBoundingClientRect(),h=c.x-d.x,p=c.y+c.height-d.y+parseInt(n.computedCSS("margin-bottom"),10)/2):(s="top",p=c.y-d.y-parseInt(t.container.computedCSS("padding-top"),10)/2)}i.css({top:`${p}px`,left:`${h}px`,width:`${c.width}px`,display:"block"})})),t.container.on("dragend",(()=>{i&&(i.remove(),i=null)})),t.container.on("drop",(o=>{const r=o;if(r.dataTransfer&&i&&(i.remove(),i=null,e&&n&&e.isBox)){if(e.get(0)===n.get(0))return;if("bottom"===s&&e.get(0)===n.next().get(0))return;r.preventDefault();const i=Vt(e),o=t.selection.range;n.isBox?"top"===s?o.selectBoxStart(n):o.selectBoxEnd(n):(o.selectNodeContents(n),"top"===s?o.collapseToStart():o.collapseToEnd()),t.selection.insertBox(i.name,i.value),e.remove(),t.history.save()}}))})),De.plugin.add((t=>{t.readonly||(t.command.add("undo",{isDisabled:()=>!t.history.canUndo,execute:()=>{t.history.undo()}}),t.keystroke.setKeydown("mod+z",(e=>{t.selection.range.isInsideBox||(e.preventDefault(),t.command.execute("undo"))})))})),De.plugin.add((t=>{if(t.readonly)return;t.command.add("redo",{isDisabled:()=>!t.history.canRedo,execute:()=>{t.history.redo()}});const e=e=>{t.selection.range.isInsideBox||(e.preventDefault(),t.command.execute("redo"))};t.keystroke.setKeydown("mod+y",e),t.keystroke.setKeydown("mod+shift+z",e)})),De.plugin.add((t=>{t.readonly||t.command.add("selectAll",{execute:()=>{const e=t.selection.range;e.selectNodeContents(t.container),e.shrink()}})})),De.plugin.add((t=>{t.readonly||t.command.add("heading",{selectedValues:t=>{const e=t.find((t=>t.node.isHeading||"p"===t.name));return e?[e.name]:[]},execute:e=>{t.selection.setBlocks(`<${e} />`),t.history.save()}})})),De.plugin.add((t=>{t.readonly||t.command.add("blockQuote",{isSelected:t=>!!t.find((t=>"blockquote"===t.name)),execute:e=>{e&&gs.indexOf(e)>=0?t.selection.setBlocks(a`<blockquote type="${e}" />`):t.selection.setBlocks("<blockquote />"),t.history.save()}})})),De.plugin.add((t=>{t.readonly||(t.command.add("list",{selectedValues:t=>{let e;for(const i of t){if("ol"===i.name){e="numbered";break}if("ul"===i.name&&!i.node.hasAttr("type")){e="bulleted";break}if("ul"===i.name&&"checklist"===i.node.attr("type")){e="checklist";break}}return e?[e]:[]},execute:(e,i=!1)=>{const n=t.selection.range.getBlocks();let s=!1,o=!1,r=!1;for(const t of n)s||"ol"!==t.name||(s=!0),o||"ul"!==t.name||t.hasAttr("type")||(o=!0),r||"ul"!==t.name||"checklist"!==t.attr("type")||(r=!0);s?("numbered"===e&&vs(t),"bulleted"===e&&ys(t),"checklist"===e&&xs(t,i)):o?("numbered"===e&&ws(t),"bulleted"===e&&vs(t),"checklist"===e&&xs(t,i)):r?("numbered"===e&&ws(t),"bulleted"===e&&ys(t),"checklist"===e&&vs(t)):("numbered"===e&&ws(t),"bulleted"===e&&ys(t),"checklist"===e&&xs(t,i)),t.history.save()}}),t.container.on("click",(e=>{const i=e;if(!i.target)return;const n=I(i.target);"li"===n.name&&""!==n.attr("value")&&i.offsetX<=18&&(n.attr("value",("true"!==n.attr("value")).toString()),t.history.save())})))})),De.plugin.add((t=>{t.readonly||t.command.add("align",{selectedValues:t=>{let e;for(const i of t)if(i.node.isBlock){e=i.node.computedCSS("text-align");break}return e?[bs[e]||e]:[]},execute:e=>{t.selection.setBlocks({"text-align":e}),t.history.save()}})})),De.plugin.add((t=>{t.readonly||t.command.add("indent",{execute:e=>{const i=t.selection.range.getBlocks();for(const t of i)R(t,e);t.history.save()}})})),De.plugin.add((t=>{t.readonly||(t.command.add("bold",{isDisabled:t=>!!t.find((t=>t.node.isHeading)),isSelected:t=>!!t.find((t=>t.name===ks)),execute:()=>{t.command.isSelected("bold")?t.selection.removeMark(`<${ks} />`):t.selection.addMark(`<${ks} />`),t.history.save()}}),t.keystroke.setKeydown("mod+b",(e=>{e.preventDefault(),t.command.execute("bold")})))})),De.plugin.add((t=>{t.readonly||(t.command.add("italic",{isSelected:t=>!!t.find((t=>"i"===t.name)),execute:()=>{t.command.isSelected("italic")?t.selection.removeMark("<i />"):t.selection.addMark("<i />"),t.history.save()}}),t.keystroke.setKeydown("mod+i",(e=>{e.preventDefault(),t.command.execute("italic")})))})),De.plugin.add((t=>{t.readonly||(t.command.add("underline",{isSelected:t=>!!t.find((t=>"u"===t.name)),execute:()=>{t.command.isSelected("underline")?t.selection.removeMark("<u />"):t.selection.addMark("<u />"),t.history.save()}}),t.keystroke.setKeydown("mod+u",(e=>{e.preventDefault(),t.command.execute("underline")})))})),De.plugin.add((t=>{t.readonly||(t.command.add("strikethrough",{isSelected:t=>!!t.find((t=>"s"===t.name)),execute:()=>{t.command.isSelected("strikethrough")?t.selection.removeMark("<s />"):t.selection.addMark("<s />"),t.history.save()}}),t.keystroke.setKeydown("mod+shift+x",(e=>{e.preventDefault(),t.command.execute("strikethrough")})))})),De.plugin.add((t=>{t.readonly||t.command.add("subscript",{isSelected:t=>!!t.find((t=>t.name===Ss)),execute:()=>{t.command.isSelected("subscript")?t.selection.removeMark(`<${Ss} />`):t.selection.addMark(`<${Ss} />`),t.history.save()}})})),De.plugin.add((t=>{t.readonly||t.command.add("superscript",{isSelected:t=>!!t.find((t=>t.name===Cs)),execute:()=>{t.command.isSelected("superscript")?t.selection.removeMark(`<${Cs} />`):t.selection.addMark(`<${Cs} />`),t.history.save()}})})),De.plugin.add((t=>{t.readonly||t.command.add("code",{isSelected:t=>!!t.find((t=>t.name===_s)),execute:()=>{t.command.isSelected("code")?t.selection.removeMark(`<${_s} />`):t.selection.addMark(`<${_s} />`),t.history.save()}})})),De.plugin.add((t=>{t.readonly||t.command.add("fontFamily",{selectedValues:t=>{for(const e of t)if("span"===e.name){return[e.node.css("font-family").replace(/['"]/g,"")]}return[]},execute:e=>{t.selection.addMark(`<span style="font-family: ${e};" />`),t.history.save()}})})),De.plugin.add((t=>{t.readonly||t.command.add("fontSize",{isDisabled:t=>!!t.find((t=>t.node.isHeading)),selectedValues:t=>{for(const e of t)if("span"===e.name){return[e.node.css("font-size").replace(/\.\d+/,"")]}return[]},execute:e=>{t.selection.addMark(`<span style="font-size: ${e};" />`),t.history.save()}})})),De.plugin.add((t=>{t.readonly||t.command.add("fontColor",{selectedValues:t=>{for(const e of t)if("span"===e.name){return[u(e.node.computedCSS("color"))]}return[]},execute:e=>{t.selection.addMark(`<span style="color: ${e};" />`),t.history.save()}})})),De.plugin.add((t=>{t.readonly||t.command.add("highlight",{selectedValues:t=>{for(const e of t)if("span"===e.name){return[u(e.node.computedCSS("background-color"))]}return[]},execute:e=>{t.selection.addMark(`<span style="background-color: ${e};" />`),t.history.save()}})})),De.plugin.add((t=>{t.readonly||t.command.add("removeFormat",{execute:()=>{t.selection.removeMark(),t.history.save()}})})),De.plugin.add((t=>{if(t.readonly)return;let e=[];t.command.add("formatPainter",{execute:()=>{t.container.addClass(Bs);const i=t.selection.getAppliedItems();for(const t of i){const i=t.node.clone();i.isMark&&"a"!==i.name&&e.push(i)}}}),t.container.on("click",(()=>{if(t.container.removeClass(Bs),0!==e.length){for(const i of e)t.selection.addMark(i);e=[],t.history.save()}})),t.event.on("click",(i=>{if(i.isInside&&i.closestContainer().get(0)===t.container.get(0))return;i.closest('button[name="formatPainter"]').length>0||(t.container.removeClass(Bs),e=[])}))})),De.plugin.add((t=>{if(t.readonly)return;const e=new As({root:t.popupContainer,locale:t.locale,onSave:e=>{const i=t.selection.range;i.setStartAfter(e),i.collapseToStart(),t.history.save()},onRemove:e=>{const i=t.selection.range;i.setStartAfter(e),i.collapseToStart(),t.history.save()}});t.root.on("scroll",(()=>{e.updatePosition()})),t.event.on("resize",(()=>{e.updatePosition()})),t.event.on("click",(i=>{if(i.closest('button[name="link"]').length>0)return;const n=i.closest("a");0!==n.length?n.isOutside||n.closestContainer().get(0)!==t.container.get(0)||n.closest("lake-box").length>0?e.hide():e.show(n):e.hide()})),t.command.add("link",{execute:()=>{const i=t.selection.insertLink(`<a href="">${t.locale.link.newLink()}</a>`);i&&(t.history.save(),e.show(i))}})})),De.plugin.add((t=>{t.readonly||(t.event.on("beforepaste",(t=>{new qt(t).find("hr").each((t=>{const e=I(t),i=Vt("hr");e.replaceWith(i.node)}))})),t.command.add("hr",{execute:()=>{t.selection.insertBox("hr"),t.history.save()}}))})),De.plugin.add((t=>{window.LakeCodeMirror&&(t.setPluginConfig("codeBlock",{langList:Ts,defaultLang:"text"}),t.readonly||t.command.add("codeBlock",{execute:e=>{const i=t.selection.insertBox("codeBlock",e);t.history.save(),i.getContainer().find(".lake-code-block").emit("click")}}))})),De.plugin.add((t=>{t.setPluginConfig("image",{requestMethod:"POST",requestTypes:["image/gif","image/jpeg","image/png","image/svg+xml"]}),t.readonly||(t.event.on("beforepaste",(t=>{new qt(t).find("img").each((t=>{const e=I(t),i=Vt("image"),n=e.attr("data-lake-value");""===n?i.value={url:e.attr("src"),status:"done"}:i.node.attr("value",n),e.replaceWith(i.node)}))})),t.command.add("image",{execute:e=>{t.selection.insertBox("image",e),t.history.save()}}))})),De.plugin.add((t=>{t.readonly||t.command.add("video",{execute:e=>{const i=t.selection.insertBox("video",e);t.history.save(),i&&i.getContainer().find('input[name="url"]').focus()}})})),De.plugin.add((t=>{t.setPluginConfig("file",{requestMethod:"POST",requestTypes:["application/zip","application/x-zip-compressed","application/vnd.rar","image/gif","image/jpeg","image/png","image/svg+xml","text/plain","text/html","application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.presentationml.presentation"]}),t.readonly||t.command.add("file",{execute:e=>{t.selection.insertBox("file",e),t.history.save()}})})),De.plugin.add((t=>{t.readonly||t.command.add("emoji",{execute:e=>{t.selection.insertBox("emoji",e),t.history.save()}})})),De.plugin.add((t=>{window.katex&&(t.readonly||t.command.add("equation",{execute:e=>{const i=t.selection.insertBox("equation",e);t.selection.selectBox(i),t.history.save()}}))})),De.plugin.add((t=>{t.readonly||t.command.add("specialCharacter",{execute:e=>{const i=new qt;i.append(document.createTextNode(e)),t.selection.insertFragment(i),t.history.save()}})})),De.plugin.add((t=>{t.readonly||(t.keystroke.setKeydown("space",(e=>{const i=t.selection.range;if(i.isBox)return;const n=function(t){const e=t.selection.range;let i=e.startNode,n=e.startOffset;if(0!==n){if(i.isElement){const t=i.children()[n-1];if(!t||!t.isText)return;i=t,n=i.text().length}if(!(n<1))return{node:i,offset:n}}}(t);if(!n)return;if(function(t,e){const i=t.selection,n=i.range,s=e.offset,o=e.node.text().slice(0,s);for(const e of Is){const r=e.re.exec(o);if(null!==r){const o=e.getParameters(),a=o.shift();if(!t.command.has(a))return!1;t.history.pause();const l=i.insertBookmark(),d=l.focus.prev(),c=d.text(),h=`${c.replace(e.re,"$1")}​`;return d.get(0).nodeValue=h,n.setStart(d,s-r[0].length),n.setEnd(d,s-(c.length-h.length)-1),t.command.execute(a,...o),i.toBookmark(l),t.history.continue(),t.history.save(),!0}}return!1}(t,n))return void e.preventDefault();const s=i.getBlocks()[0];s&&(s.isHeading||"p"===s.name)&&function(t,e){const i=t.selection,n=e.offset;let s=e.node.text().slice(0,n);s=s.replace(/[\u200B\u2060]/g,"");for(const e of Ms){const n=e.re.exec(s);if(null!==n){const s=e.getParameters(n),o=s.shift();if(!t.command.has(o))return!1;const r=i.insertBookmark();r.focus.prev().remove();const a=r.focus.closestBlock();return Zs(a),i.range.shrinkAfter(a),i.toBookmark(r),t.command.execute(o,...s),!0}}return!1}(t,n)&&e.preventDefault()})),t.keystroke.setKeydown("enter",(e=>{const i=t.selection.range;if(i.isBox)return;const n=i.getBlocks()[0];return!n||!n.isHeading&&"p"!==n.name||n.find("lake-box").length>0||""!==i.getEndText()?void 0:function(t,e){const i=t.selection;let n=e.text();n=n.replace(/[\u200B\u2060]/g,"");for(const s of Ps){const o=s.re.exec(n);if(null!==o){const n=s.getParameters(o),r=n.shift();return!!t.command.has(r)&&(e.empty(),Zs(e),i.range.shrinkAfter(e),t.command.execute(r,...n),!0)}}return!1}(t,n)?(e.preventDefault(),e.stopImmediatePropagation(),!1):void 0})))})),De.plugin.add((t=>{t.readonly||t.keystroke.setKeydown("enter",(e=>{const i=t.selection.range;if(i.isInsideBox)return;if(e.preventDefault(),t.fixContent(),i.isBox)return Os(t),void t.history.save();if(i.adjust(),i.isInoperative)return;if(i.isBox)return Os(t),void t.history.save();let n=i.getBlocks()[0];if(n||(t.selection.setBlocks("<p />"),n=i.getBlocks()[0]),n.isEmpty&&"p"!==n.name)return t.selection.setBlocks("<p />"),void t.history.save();Ns(t,n),t.history.save()}))})),De.plugin.add((t=>{t.readonly||t.keystroke.setKeydown("shift+enter",(e=>{const i=t.selection.range;if(!i.isInsideBox){if(t.fixContent(),e.preventDefault(),i.isBox)return Hs(t),void t.history.save();if(i.adjust(),!i.isInoperative){if(i.isBox)return Hs(t),void t.history.save();zs(t),t.history.save()}}}))})),De.plugin.add((t=>{t.readonly||t.keystroke.setKeydown("backspace",(e=>{const i=t.selection.range;if(i.isInsideBox){const n=Vt(i.commonAncestor.closest("lake-box")),s=n.value;return void("codeBlock"!==n.name||void 0!==s.code&&""!==s.code||(e.preventDefault(),t.selection.removeBox(n),t.history.save()))}if(t.fixContent(),i.isBoxStart){const n=i.startNode.closest("lake-box"),s=n.prev();if(0===s.length){const i=n.closestBlock();return void(i.length>0&&!i.isContainer&&(e.preventDefault(),$s(t,i),t.history.save()))}if(s.isBlock)return s.isEmpty?(e.preventDefault(),s.remove(),t.selection.fixList(),void t.history.save()):(e.preventDefault(),void i.shrinkAfter(s));if(s.isText&&1===s.text().length)return e.preventDefault(),s.remove(),void t.history.save();i.adjustBox()}if(i.isBox)return e.preventDefault(),t.selection.removeBox(),void t.history.save();if(!i.isCollapsed)return e.preventDefault(),t.selection.deleteContents(),""===t.container.html().trim()&&t.setValue("<p><br /><focus /></p>"),void t.history.save();i.adjust();const n=i.getPrevNode();if(n.isBox)return e.preventDefault(),t.selection.removeBox(n),void t.history.save();if(n.isText&&1===n.text().length&&n.parent().isBlock){e.preventDefault();const s=n.closestBlock();return i.setStartBefore(n),i.collapseToStart(),n.remove(),s.isEmpty&&(Z(s,I("<br />")),i.shrinkAfter(s)),void t.history.save()}const s=i.getNextNode();if("br"===n.name&&s.length>0)return e.preventDefault(),i.setStartBefore(n),i.collapseToStart(),n.remove(),void t.history.save();if(""===i.getStartText()){e.preventDefault();let n=i.getBlocks()[0];if(n||(t.selection.setBlocks("<p />"),n=i.getBlocks()[0]),""!==n.css("margin-left")||""!==n.css("text-indent")||""!==n.attr("indent"))return R(n,"decrease"),void t.history.save();if(n.isList||"blockquote"===n.name)return t.selection.setBlocks("<p />"),void t.history.save();$s(t,n),t.history.save()}}))})),De.plugin.add((t=>{t.readonly||t.keystroke.setKeydown("delete",(e=>{const i=t.selection.range;if(i.isInsideBox)return;if(t.fixContent(),i.isBoxEnd){const n=i.startNode.closest("lake-box"),s=n.next();if(0===s.length){const i=n.closestBlock();return void(i.length>0&&!i.isContainer&&(e.preventDefault(),Ds(t,i),t.history.save()))}if(s.isBlock)return s.isEmpty?(e.preventDefault(),s.remove(),t.selection.fixList(),void t.history.save()):(e.preventDefault(),void i.shrinkBefore(s));i.adjustBox()}if(i.isBox)return e.preventDefault(),t.selection.removeBox(),void t.history.save();if(!i.isCollapsed)return e.preventDefault(),t.selection.deleteContents(),""===t.container.html().trim()&&t.setValue("<p><br /><focus /></p>"),void t.history.save();i.adjust();const n=i.getNextNode();if(n.isBox)return e.preventDefault(),t.selection.removeBox(n),void t.history.save();"br"===n.name&&n.next().length>0&&(e.preventDefault(),i.setStartBefore(n),i.collapseToStart(),n.remove(),t.history.save());if(""===i.getEndText()){e.preventDefault();let n=i.getBlocks()[0];n||(t.selection.setBlocks("<p />"),n=i.getBlocks()[0]),Ds(t,n),t.history.save()}}))})),De.plugin.add((t=>{t.readonly||t.keystroke.setKeydown("tab",(e=>{if(!1===t.config.indentWithTab)return;const i=t.selection.range;if(i.isInsideBox)return;e.preventDefault();const n=i.getBlocks();for(const t of n)"p"!==t.name||"2em"===t.css("text-indent")?R(t,"increase"):t.css("text-indent","2em");t.history.save()}))})),De.plugin.add((t=>{t.readonly||(t.keystroke.setKeydown("arrow-left",(e=>{const i=t.selection.range;if(i.isInsideBox)return;const n=i.commonAncestor.closest("lake-box");if(n.length>0){if(i.isBoxStart){const t=n.prev();return t.isBlock||t.isBox?(e.preventDefault(),t.isInlineBox?void i.selectBox(t):void i.shrinkAfter(t)):(i.setStartBefore(n),void i.collapseToStart())}return i.isBoxEnd?(e.preventDefault(),void i.selectBox(n)):(e.preventDefault(),void i.selectBoxStart(n))}if(!i.isCollapsed)return;const s=i.getPrevNode();s.isBox&&(e.preventDefault(),i.selectBox(s))})),t.keystroke.setKeydown("arrow-right",(e=>{const i=t.selection.range;if(i.isInsideBox)return;const n=i.commonAncestor.closest("lake-box");if(n.length>0){if(i.isBoxStart)return e.preventDefault(),void i.selectBox(n);if(i.isBoxEnd){const t=n.next();return t.isBlock||t.isBox?(e.preventDefault(),t.isInlineBox?void i.selectBox(t):void i.shrinkBefore(t)):(i.setStartAfter(n),void i.collapseToStart())}return e.preventDefault(),void i.selectBoxEnd(n)}if(!i.isCollapsed)return;const s=i.getNextNode();s.isBox&&(e.preventDefault(),i.selectBox(s))})),t.keystroke.setKeydown("arrow-up",(e=>{const i=t.selection.range;if(i.isInsideBox)return;const n=i.commonAncestor.closest("lake-box");if(n.length>0){if(n.isBlockBox){const t=n.prev();if(t.isBlock||t.isBox)return e.preventDefault(),void i.shrinkAfter(t)}i.setStartBefore(n),i.collapseToStart()}})),t.keystroke.setKeydown("arrow-down",(e=>{const i=t.selection.range;if(i.isInsideBox)return;const n=i.commonAncestor.closest("lake-box");if(n.length>0){if(n.isBlockBox){const t=n.next();if(t.isBlock||t.isBox)return e.preventDefault(),void i.shrinkBefore(t)}i.setStartAfter(n),i.collapseToStart()}})))})),De.plugin.add((t=>{t.readonly||t.keystroke.setKeydown("escape",(e=>{const i=t.selection,n=i.range;if(n.isBoxCenter||n.isInsideBox){e.preventDefault();const t=n.commonAncestor.closest("lake-box");return n.selectBoxEnd(t),void i.sync()}t.hasFocus&&(e.preventDefault(),t.blur())}))})),t.Box=Dt,t.Button=xt,t.Dropdown=zt,t.Editor=De,t.Fragment=qt,t.HTMLParser=Gt,t.Nodes=L,t.Range=M,t.TextParser=Xt,t.Toolbar=class{constructor(t){this.placement="top",this.allMenuMap=new Map,this.buttonItemList=[],this.dropdownItemList=[],this.root=I(t.root),this.items=t.items||Ge,t.placement&&(this.placement=t.placement),this.container=I('<div class="lake-toolbar" />'),this.root.addClass("lake-custom-properties")}appendDivider(){this.container.append('<div class="lake-toolbar-divider" />')}appendButton(t,e){new xt({root:this.container,name:e.name,icon:e.icon,tooltip:"string"==typeof e.tooltip?e.tooltip:e.tooltip(t.locale),tabIndex:-1,onClick:()=>{t.focus(),e.onClick(t,e.name)}}).render()}appendDropdown(t,e){new zt({root:this.container,locale:t.locale,name:e.name,icon:e.icon,accentIcon:e.accentIcon,downIcon:e.downIcon,defaultValue:e.defaultValue,tooltip:e.tooltip,width:e.width,menuType:e.menuType,menuItems:e.menuItems,menuWidth:e.menuWidth,menuHeight:e.menuHeight,tabIndex:-1,placement:"top"===this.placement?"bottom":"top",onSelect:i=>{t.focus(),e.onSelect(t,i)}}).render()}appendUpload(t,e){const i=I(a`
110
+ `),t.overlayContainer.append(i)):s.preventDefault()})),t.container.on("dragover",(e=>{const o=e;o.preventDefault();const r=o.dataTransfer;if(!r)return;if(r.dropEffect="move",!i)return;const a=I(o.target);if(a.isContainer)return;const l=a.closest("lake-box");n=l.length>0?l.isBlockBox?l:l.closestBlock():a.closestBlock();const d=t.container.get(0).getBoundingClientRect();let c=n.get(0).getBoundingClientRect();s="bottom";let h=c.x-d.x,p=c.y+c.height-d.y+parseInt(n.computedCSS("margin-bottom"),10)/2;if(o.clientY<c.y+c.height/2){const e=n.prev();e.length>0&&e.isBlock||e.isBlockBox?(n=e,c=n.get(0).getBoundingClientRect(),h=c.x-d.x,p=c.y+c.height-d.y+parseInt(n.computedCSS("margin-bottom"),10)/2):(s="top",p=c.y-d.y-parseInt(t.container.computedCSS("padding-top"),10)/2)}i.css({top:`${p}px`,left:`${h}px`,width:`${c.width}px`,display:"block"})})),t.container.on("dragend",(()=>{i&&(i.remove(),i=null)})),t.container.on("drop",(o=>{const r=o;if(r.dataTransfer&&i&&(i.remove(),i=null,e&&n&&e.isBox)){if(e.get(0)===n.get(0))return;if("bottom"===s&&e.get(0)===n.next().get(0))return;r.preventDefault();const i=Vt(e),o=t.selection.range;n.isBox?"top"===s?o.selectBoxStart(n):o.selectBoxEnd(n):(o.selectNodeContents(n),"top"===s?o.collapseToStart():o.collapseToEnd()),t.selection.insertBox(i.name,i.value),e.remove(),t.history.save()}}))})),De.plugin.add((t=>{t.readonly||(t.command.add("undo",{isDisabled:()=>!t.history.canUndo,execute:()=>{t.history.undo()}}),t.keystroke.setKeydown("mod+z",(e=>{t.selection.range.isInsideBox||(e.preventDefault(),t.command.execute("undo"))})))})),De.plugin.add((t=>{if(t.readonly)return;t.command.add("redo",{isDisabled:()=>!t.history.canRedo,execute:()=>{t.history.redo()}});const e=e=>{t.selection.range.isInsideBox||(e.preventDefault(),t.command.execute("redo"))};t.keystroke.setKeydown("mod+y",e),t.keystroke.setKeydown("mod+shift+z",e)})),De.plugin.add((t=>{t.readonly||t.command.add("selectAll",{execute:()=>{const e=t.selection.range;e.selectNodeContents(t.container),e.shrink()}})})),De.plugin.add((t=>{t.readonly||t.command.add("heading",{selectedValues:t=>{const e=t.find((t=>t.node.isHeading||"p"===t.name));return e?[e.name]:[]},execute:e=>{t.selection.setBlocks(`<${e} />`),t.history.save()}})})),De.plugin.add((t=>{t.readonly||t.command.add("blockQuote",{isSelected:t=>!!t.find((t=>"blockquote"===t.name)),execute:e=>{e&&gs.indexOf(e)>=0?t.selection.setBlocks(a`<blockquote type="${e}" />`):t.selection.setBlocks("<blockquote />"),t.history.save()}})})),De.plugin.add((t=>{t.readonly||(t.command.add("list",{selectedValues:t=>{let e;for(const i of t){if("ol"===i.name){e="numbered";break}if("ul"===i.name&&!i.node.hasAttr("type")){e="bulleted";break}if("ul"===i.name&&"checklist"===i.node.attr("type")){e="checklist";break}}return e?[e]:[]},execute:(e,i=!1)=>{const n=t.selection.range.getBlocks();let s=!1,o=!1,r=!1;for(const t of n)s||"ol"!==t.name||(s=!0),o||"ul"!==t.name||t.hasAttr("type")||(o=!0),r||"ul"!==t.name||"checklist"!==t.attr("type")||(r=!0);s?("numbered"===e&&vs(t),"bulleted"===e&&ys(t),"checklist"===e&&xs(t,i)):o?("numbered"===e&&ws(t),"bulleted"===e&&vs(t),"checklist"===e&&xs(t,i)):r?("numbered"===e&&ws(t),"bulleted"===e&&ys(t),"checklist"===e&&vs(t)):("numbered"===e&&ws(t),"bulleted"===e&&ys(t),"checklist"===e&&xs(t,i)),t.history.save()}}),t.container.on("click",(e=>{const i=e;if(!i.target)return;const n=I(i.target);"li"===n.name&&""!==n.attr("value")&&i.offsetX<=18&&(n.attr("value",("true"!==n.attr("value")).toString()),t.history.save())})))})),De.plugin.add((t=>{t.readonly||t.command.add("align",{selectedValues:t=>{let e;for(const i of t)if(i.node.isBlock){e=i.node.computedCSS("text-align");break}return e?[bs[e]||e]:[]},execute:e=>{t.selection.setBlocks({"text-align":e}),t.history.save()}})})),De.plugin.add((t=>{t.readonly||t.command.add("indent",{execute:e=>{const i=t.selection.range.getBlocks();for(const t of i)R(t,e);t.history.save()}})})),De.plugin.add((t=>{t.readonly||(t.command.add("bold",{isDisabled:t=>!!t.find((t=>t.node.isHeading)),isSelected:t=>!!t.find((t=>t.name===ks)),execute:()=>{t.command.isSelected("bold")?t.selection.removeMark(`<${ks} />`):t.selection.addMark(`<${ks} />`),t.history.save()}}),t.keystroke.setKeydown("mod+b",(e=>{e.preventDefault(),t.command.execute("bold")})))})),De.plugin.add((t=>{t.readonly||(t.command.add("italic",{isSelected:t=>!!t.find((t=>"i"===t.name)),execute:()=>{t.command.isSelected("italic")?t.selection.removeMark("<i />"):t.selection.addMark("<i />"),t.history.save()}}),t.keystroke.setKeydown("mod+i",(e=>{e.preventDefault(),t.command.execute("italic")})))})),De.plugin.add((t=>{t.readonly||(t.command.add("underline",{isSelected:t=>!!t.find((t=>"u"===t.name)),execute:()=>{t.command.isSelected("underline")?t.selection.removeMark("<u />"):t.selection.addMark("<u />"),t.history.save()}}),t.keystroke.setKeydown("mod+u",(e=>{e.preventDefault(),t.command.execute("underline")})))})),De.plugin.add((t=>{t.readonly||(t.command.add("strikethrough",{isSelected:t=>!!t.find((t=>"s"===t.name)),execute:()=>{t.command.isSelected("strikethrough")?t.selection.removeMark("<s />"):t.selection.addMark("<s />"),t.history.save()}}),t.keystroke.setKeydown("mod+shift+x",(e=>{e.preventDefault(),t.command.execute("strikethrough")})))})),De.plugin.add((t=>{t.readonly||t.command.add("subscript",{isSelected:t=>!!t.find((t=>t.name===Ss)),execute:()=>{t.command.isSelected("subscript")?t.selection.removeMark(`<${Ss} />`):t.selection.addMark(`<${Ss} />`),t.history.save()}})})),De.plugin.add((t=>{t.readonly||t.command.add("superscript",{isSelected:t=>!!t.find((t=>t.name===Cs)),execute:()=>{t.command.isSelected("superscript")?t.selection.removeMark(`<${Cs} />`):t.selection.addMark(`<${Cs} />`),t.history.save()}})})),De.plugin.add((t=>{t.readonly||t.command.add("code",{isSelected:t=>!!t.find((t=>t.name===_s)),execute:()=>{t.command.isSelected("code")?t.selection.removeMark(`<${_s} />`):t.selection.addMark(`<${_s} />`),t.history.save()}})})),De.plugin.add((t=>{t.readonly||t.command.add("fontFamily",{selectedValues:t=>{for(const e of t)if("span"===e.name){return[e.node.css("font-family").replace(/['"]/g,"")]}return[]},execute:e=>{t.selection.addMark(`<span style="font-family: ${e};" />`),t.history.save()}})})),De.plugin.add((t=>{t.readonly||t.command.add("fontSize",{isDisabled:t=>!!t.find((t=>t.node.isHeading)),selectedValues:t=>{for(const e of t)if("span"===e.name){return[e.node.css("font-size").replace(/\.\d+/,"")]}return[]},execute:e=>{t.selection.addMark(`<span style="font-size: ${e};" />`),t.history.save()}})})),De.plugin.add((t=>{t.readonly||t.command.add("fontColor",{selectedValues:t=>{for(const e of t)if("span"===e.name){return[u(e.node.computedCSS("color"))]}return[]},execute:e=>{t.selection.addMark(`<span style="color: ${e};" />`),t.history.save()}})})),De.plugin.add((t=>{t.readonly||t.command.add("highlight",{selectedValues:t=>{for(const e of t)if("span"===e.name){return[u(e.node.computedCSS("background-color"))]}return[]},execute:e=>{t.selection.addMark(`<span style="background-color: ${e};" />`),t.history.save()}})})),De.plugin.add((t=>{t.readonly||t.command.add("removeFormat",{execute:()=>{t.selection.removeMark(),t.history.save()}})})),De.plugin.add((t=>{if(t.readonly)return;let e=[];t.command.add("formatPainter",{execute:()=>{t.container.addClass(Bs);const i=t.selection.getAppliedItems();for(const t of i){const i=t.node.clone();i.isMark&&"a"!==i.name&&e.push(i)}}}),t.container.on("click",(()=>{if(t.container.removeClass(Bs),0!==e.length){for(const i of e)t.selection.addMark(i);e=[],t.history.save()}})),t.event.on("click",(i=>{if(i.isInside&&i.closestContainer().get(0)===t.container.get(0))return;i.closest('button[name="formatPainter"]').length>0||(t.container.removeClass(Bs),e=[])}))})),De.plugin.add((t=>{if(t.readonly)return;const e=new As({root:t.popupContainer,locale:t.locale,onSave:e=>{const i=t.selection.range;i.setStartAfter(e),i.collapseToStart(),t.history.save()},onRemove:e=>{const i=t.selection.range;i.setStartAfter(e),i.collapseToStart(),t.history.save()}});t.root.on("scroll",(()=>{e.updatePosition()})),t.event.on("resize",(()=>{e.updatePosition()})),t.event.on("click",(i=>{if(i.closest('button[name="link"]').length>0)return;const n=i.closest("a");0!==n.length?n.isOutside||n.closestContainer().get(0)!==t.container.get(0)||n.closest("lake-box").length>0?e.hide():e.show(n):e.hide()})),t.command.add("link",{execute:()=>{const i=t.selection.insertLink(`<a href="">${t.locale.link.newLink()}</a>`);i&&(t.history.save(),e.show(i))}})})),De.plugin.add((t=>{t.readonly||(t.event.on("beforepaste",(t=>{new qt(t).find("hr").each((t=>{const e=I(t),i=Vt("hr");e.replaceWith(i.node)}))})),t.command.add("hr",{execute:()=>{t.selection.insertBox("hr"),t.history.save()}}))})),De.plugin.add((t=>{window.LakeCodeMirror&&(t.setPluginConfig("codeBlock",{langList:Ts,defaultLang:"text"}),t.readonly||t.command.add("codeBlock",{execute:e=>{const i=t.selection.insertBox("codeBlock",e);t.history.save(),i.getContainer().find(".lake-code-block").emit("click")}}))})),De.plugin.add((t=>{t.setPluginConfig("image",{requestMethod:"POST",requestTypes:["image/gif","image/jpeg","image/png","image/svg+xml"]}),t.readonly||(t.event.on("beforepaste",(t=>{new qt(t).find("img").each((t=>{const e=I(t),i=Vt("image"),n=e.attr("data-lake-value");""===n?i.value={url:e.attr("src"),status:"done"}:i.node.attr("value",n),e.replaceWith(i.node)}))})),t.command.add("image",{execute:e=>{t.selection.insertBox("image",e),t.history.save()}}))})),De.plugin.add((t=>{t.readonly||t.command.add("video",{execute:e=>{const i=t.selection.insertBox("video",e);t.history.save(),i&&i.getContainer().find('input[name="url"]').focus()}})})),De.plugin.add((t=>{t.setPluginConfig("file",{requestMethod:"POST",requestTypes:["application/zip","application/x-zip-compressed","application/vnd.rar","image/gif","image/jpeg","image/png","image/svg+xml","text/plain","text/html","application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.presentationml.presentation"]}),t.readonly||t.command.add("file",{execute:e=>{t.selection.insertBox("file",e),t.history.save()}})})),De.plugin.add((t=>{t.readonly||t.command.add("emoji",{execute:e=>{t.selection.insertBox("emoji",e),t.history.save()}})})),De.plugin.add((t=>{window.katex&&(t.readonly||t.command.add("equation",{execute:e=>{const i=t.selection.insertBox("equation",e);t.selection.selectBox(i),t.history.save()}}))})),De.plugin.add((t=>{t.readonly||t.command.add("specialCharacter",{execute:e=>{const i=new qt;i.append(document.createTextNode(e)),t.selection.insertFragment(i),t.history.save()}})})),De.plugin.add((t=>{t.readonly||(t.keystroke.setKeydown("space",(e=>{const i=t.selection.range;if(i.isBox)return;const n=function(t){const e=t.selection.range;let i=e.startNode,n=e.startOffset;if(0!==n){if(i.isElement){const t=i.children()[n-1];if(!t||!t.isText)return;i=t,n=i.text().length}if(!(n<1))return{node:i,offset:n}}}(t);if(!n)return;if(function(t,e){const i=t.selection,n=i.range,s=e.offset,o=e.node.text().slice(0,s);for(const e of Is){const r=e.re.exec(o);if(null!==r){const o=e.getParameters(),a=o.shift();if(!t.command.has(a))return!1;t.history.pause();const l=i.insertBookmark(),d=l.focus.prev(),c=d.text(),h=`${c.replace(e.re,"$1")}​`;return d.get(0).nodeValue=h,n.setStart(d,s-r[0].length),n.setEnd(d,s-(c.length-h.length)-1),t.command.execute(a,...o),i.toBookmark(l),t.history.continue(),t.history.save(),!0}}return!1}(t,n))return void e.preventDefault();const s=i.getBlocks()[0];s&&(s.isHeading||"p"===s.name)&&function(t,e){const i=t.selection,n=e.offset;let s=e.node.text().slice(0,n);s=s.replace(/[\u200B\u2060]/g,"");for(const e of Ms){const n=e.re.exec(s);if(null!==n){const s=e.getParameters(n),o=s.shift();if(!t.command.has(o))return!1;const r=i.insertBookmark();r.focus.prev().remove();const a=r.focus.closestBlock();return Zs(a),i.range.shrinkAfter(a),i.toBookmark(r),t.command.execute(o,...s),!0}}return!1}(t,n)&&e.preventDefault()})),t.keystroke.setKeydown("enter",(e=>{const i=t.selection.range;if(i.isBox)return;const n=i.getBlocks()[0];return!n||!n.isHeading&&"p"!==n.name||n.find("lake-box").length>0||""!==i.getEndText()?void 0:function(t,e){const i=t.selection;let n=e.text();n=n.replace(/[\u200B\u2060]/g,"");for(const s of Ps){const o=s.re.exec(n);if(null!==o){const n=s.getParameters(o),r=n.shift();return!!t.command.has(r)&&(e.empty(),Zs(e),i.range.shrinkAfter(e),t.command.execute(r,...n),!0)}}return!1}(t,n)?(e.preventDefault(),e.stopImmediatePropagation(),!1):void 0})))})),De.plugin.add((t=>{t.readonly||t.keystroke.setKeydown("enter",(e=>{const i=t.selection.range;if(i.isInsideBox)return;if(e.preventDefault(),t.fixContent(),i.isBox)return Os(t),void t.history.save();if(i.adjust(),i.isInoperative)return;if(i.isBox)return Os(t),void t.history.save();let n=i.getBlocks()[0];if(n||(t.selection.setBlocks("<p />"),n=i.getBlocks()[0]),n.isEmpty&&"p"!==n.name)return t.selection.setBlocks("<p />"),void t.history.save();Ns(t,n),t.history.save()}))})),De.plugin.add((t=>{t.readonly||t.keystroke.setKeydown("shift+enter",(e=>{const i=t.selection.range;if(!i.isInsideBox){if(t.fixContent(),e.preventDefault(),i.isBox)return Hs(t),void t.history.save();if(i.adjust(),!i.isInoperative){if(i.isBox)return Hs(t),void t.history.save();zs(t),t.history.save()}}}))})),De.plugin.add((t=>{t.readonly||t.keystroke.setKeydown("backspace",(e=>{const i=t.selection.range;if(i.isInsideBox){const n=Vt(i.commonAncestor.closest("lake-box")),s=n.value;return void("codeBlock"!==n.name||void 0!==s.code&&""!==s.code||(e.preventDefault(),t.selection.removeBox(n),t.history.save()))}if(t.fixContent(),i.isBoxStart){const n=i.startNode.closest("lake-box"),s=n.prev();if(0===s.length){const i=n.closestBlock();return void(i.length>0&&!i.isContainer&&(e.preventDefault(),$s(t,i),t.history.save()))}if(s.isBlock)return s.isEmpty?(e.preventDefault(),s.remove(),t.selection.fixList(),void t.history.save()):(e.preventDefault(),void i.shrinkAfter(s));if(s.isText&&1===s.text().length)return e.preventDefault(),s.remove(),void t.history.save();i.adjustBox()}if(i.isBox)return e.preventDefault(),t.selection.removeBox(),void t.history.save();if(!i.isCollapsed)return e.preventDefault(),t.selection.deleteContents(),""===t.container.html().trim()&&t.setValue("<p><br /><focus /></p>"),void t.history.save();i.adjust();const n=i.getPrevNode();if(n.isBox)return e.preventDefault(),t.selection.removeBox(n),void t.history.save();if(n.isText&&1===n.text().length&&n.parent().isBlock){e.preventDefault();const s=n.closestBlock();if(i.setStartBefore(n),i.collapseToStart(),n.remove(),s.isEmpty){const t=Z(s);i.setStartBefore(t),i.collapseToStart()}return void t.history.save()}const s=i.getNextNode();if("br"===n.name&&s.length>0)return e.preventDefault(),i.setStartBefore(n),i.collapseToStart(),n.remove(),void t.history.save();if(""===i.getStartText()){e.preventDefault();let n=i.getBlocks()[0];if(n||(t.selection.setBlocks("<p />"),n=i.getBlocks()[0]),""!==n.css("margin-left")||""!==n.css("text-indent")||""!==n.attr("indent"))return R(n,"decrease"),void t.history.save();if(n.isList||"blockquote"===n.name)return t.selection.setBlocks("<p />"),void t.history.save();$s(t,n),t.history.save()}}))})),De.plugin.add((t=>{t.readonly||t.keystroke.setKeydown("delete",(e=>{const i=t.selection.range;if(i.isInsideBox)return;if(t.fixContent(),i.isBoxEnd){const n=i.startNode.closest("lake-box"),s=n.next();if(0===s.length){const i=n.closestBlock();return void(i.length>0&&!i.isContainer&&(e.preventDefault(),Ds(t,i),t.history.save()))}if(s.isBlock)return s.isEmpty?(e.preventDefault(),s.remove(),t.selection.fixList(),void t.history.save()):(e.preventDefault(),void i.shrinkBefore(s));i.adjustBox()}if(i.isBox)return e.preventDefault(),t.selection.removeBox(),void t.history.save();if(!i.isCollapsed)return e.preventDefault(),t.selection.deleteContents(),""===t.container.html().trim()&&t.setValue("<p><br /><focus /></p>"),void t.history.save();i.adjust();const n=i.getNextNode();if(n.isBox)return e.preventDefault(),t.selection.removeBox(n),void t.history.save();"br"===n.name&&n.next().length>0&&(e.preventDefault(),i.setStartBefore(n),i.collapseToStart(),n.remove(),t.history.save());if(""===i.getEndText()){e.preventDefault();let n=i.getBlocks()[0];n||(t.selection.setBlocks("<p />"),n=i.getBlocks()[0]),Ds(t,n),t.history.save()}}))})),De.plugin.add((t=>{t.readonly||t.keystroke.setKeydown("tab",(e=>{if(!1===t.config.indentWithTab)return;const i=t.selection.range;if(i.isInsideBox)return;e.preventDefault();const n=i.getBlocks();for(const t of n)"p"!==t.name||"2em"===t.css("text-indent")?R(t,"increase"):t.css("text-indent","2em");t.history.save()}))})),De.plugin.add((t=>{t.readonly||(t.keystroke.setKeydown("arrow-left",(e=>{const i=t.selection.range;if(i.isInsideBox)return;const n=i.commonAncestor.closest("lake-box");if(n.length>0){if(i.isBoxStart){const t=n.prev();return t.isBlock||t.isBox?(e.preventDefault(),t.isInlineBox?void i.selectBox(t):void i.shrinkAfter(t)):(i.setStartBefore(n),void i.collapseToStart())}return i.isBoxEnd?(e.preventDefault(),void i.selectBox(n)):(e.preventDefault(),void i.selectBoxStart(n))}if(!i.isCollapsed)return;const s=i.getPrevNode();s.isBox&&(e.preventDefault(),i.selectBox(s))})),t.keystroke.setKeydown("arrow-right",(e=>{const i=t.selection.range;if(i.isInsideBox)return;const n=i.commonAncestor.closest("lake-box");if(n.length>0){if(i.isBoxStart)return e.preventDefault(),void i.selectBox(n);if(i.isBoxEnd){const t=n.next();return t.isBlock||t.isBox?(e.preventDefault(),t.isInlineBox?void i.selectBox(t):void i.shrinkBefore(t)):(i.setStartAfter(n),void i.collapseToStart())}return e.preventDefault(),void i.selectBoxEnd(n)}if(!i.isCollapsed)return;const s=i.getNextNode();s.isBox&&(e.preventDefault(),i.selectBox(s))})),t.keystroke.setKeydown("arrow-up",(e=>{const i=t.selection.range;if(i.isInsideBox)return;const n=i.commonAncestor.closest("lake-box");if(n.length>0){if(n.isBlockBox){const t=n.prev();if(t.isBlock||t.isBox)return e.preventDefault(),void i.shrinkAfter(t)}i.setStartBefore(n),i.collapseToStart()}})),t.keystroke.setKeydown("arrow-down",(e=>{const i=t.selection.range;if(i.isInsideBox)return;const n=i.commonAncestor.closest("lake-box");if(n.length>0){if(n.isBlockBox){const t=n.next();if(t.isBlock||t.isBox)return e.preventDefault(),void i.shrinkBefore(t)}i.setStartAfter(n),i.collapseToStart()}})))})),De.plugin.add((t=>{t.readonly||t.keystroke.setKeydown("escape",(e=>{const i=t.selection,n=i.range;if(n.isBoxCenter||n.isInsideBox){e.preventDefault();const t=n.commonAncestor.closest("lake-box");return n.selectBoxEnd(t),void i.sync()}t.hasFocus&&(e.preventDefault(),t.blur())}))})),t.Box=Dt,t.Button=xt,t.Dropdown=zt,t.Editor=De,t.Fragment=qt,t.HTMLParser=Gt,t.Nodes=L,t.Range=M,t.TextParser=Xt,t.Toolbar=class{constructor(t){this.placement="top",this.allMenuMap=new Map,this.buttonItemList=[],this.dropdownItemList=[],this.root=I(t.root),this.items=t.items||Ge,t.placement&&(this.placement=t.placement),this.container=I('<div class="lake-toolbar" />'),this.root.addClass("lake-custom-properties")}appendDivider(){this.container.append('<div class="lake-toolbar-divider" />')}appendButton(t,e){new xt({root:this.container,name:e.name,icon:e.icon,tooltip:"string"==typeof e.tooltip?e.tooltip:e.tooltip(t.locale),tabIndex:-1,onClick:()=>{t.focus(),e.onClick(t,e.name)}}).render()}appendDropdown(t,e){new zt({root:this.container,locale:t.locale,name:e.name,icon:e.icon,accentIcon:e.accentIcon,downIcon:e.downIcon,defaultValue:e.defaultValue,tooltip:e.tooltip,width:e.width,menuType:e.menuType,menuItems:e.menuItems,menuWidth:e.menuWidth,menuHeight:e.menuHeight,tabIndex:-1,placement:"top"===this.placement?"bottom":"top",onSelect:i=>{t.focus(),e.onSelect(t,i)}}).render()}appendUpload(t,e){const i=I(a`
111
111
  <div class="lake-upload" name="${e.name}">
112
112
  <input type="file" />
113
113
  </div>