UNPKG

smart-webcomponents-react

Version:

[![Price](https://img.shields.io/badge/price-COMMERCIAL-00JS8f7.svg)](https://jqwidgets.com/license/)

6 lines (4 loc) โ€ข 315 kB
/* Smart UI v23.0.8 (2025-05-13) Copyright (c) 2011-2024 jQWidgets. License: https://htmlelements.com/license/ */ // Smart("smart-editor",class extends Smart.ContentElement{static get properties(){return{ai:{type:"any",reflectToAttribute:!1,value:{model:{value:"gpt-3.5-turbo",type:"string"},limit:{value:10,type:"number"},maxTokens:{value:250,type:"number"},temperature:{value:.7,type:"number"},url:{value:"",type:"string"},key:{value:"",type:"string"}}},autoLoad:{value:!1,type:"boolean"},autoSave:{value:!1,type:"boolean"},enablePages:{value:!1,type:"boolean"},pageIndex:{value:0,type:"number"},pages:{value:[],type:"array"},autoSaveInterval:{value:1e3,type:"number"},autoExpand:{value:!1,type:"boolean"},charCountFormatFunction:{value:null,type:"function?"},contentFiltering:{value:{attributes:{value:[],type:"array"},attributeFilterMode:{allowedValues:["blackList","whiteList"],value:"blackList",type:"string"},tags:{value:[],type:"array"},tagFilterMode:{allowedValues:["blackList","whiteList"],value:"blackList",type:"string"},styleAttributes:{value:[],type:"array"},styleAttributeFilterMode:{allowedValues:["blackList","whiteList"],value:"blackList",type:"string"}},type:"object"},contextMenu:{allowedValues:["default","browser","none"],value:"default",type:"string"},contextMenuDataSource:{value:null,type:"any",reflectToAttribute:!1},dataExport:{value:{style:{value:null,type:"object"},fileName:{value:"smartEditor",type:"string?"},pageOrientation:{value:"portrait",type:"string"}},type:"object"},disableEditing:{value:!1,type:"boolean"},disableSearchBar:{value:!1,type:"boolean"},editMode:{allowedValues:["html","blockHtml","markdown"],value:"html",defaultReflectToAttribute:!0,type:"string"},sortable:{value:!1,type:"boolean"},addBlock:{defaultReflectToAttribute:!0,value:!1,type:"boolean"},enableHtmlEncode:{value:!1,type:"boolean"},enableTabKey:{value:!1,type:"boolean"},findAndReplaceTimeout:{value:50,type:"number"},hideToolbar:{value:!1,type:"boolean"},hideInlineToolbar:{value:!1,type:"boolean"},imageFormat:{allowedValues:["blob","base64"],value:"base64",type:"string"},imageName:{value:"userfile[]",type:"string"},innerHTML:{type:"string",validator:"_sanitize",reflectToAttribute:!1},inlineToolbarOffset:{value:[0,-5],type:"array"},iframeSettings:{value:{attributes:{value:null,type:"object?"},enabled:{value:!1,type:"boolean"},copyStyles:{value:!0,type:"boolean"},resources:{value:null,type:"object?"}},type:"object"},maxCharCount:{value:null,type:"number?"},messages:{extend:!0,value:{en:{invalidValue:"{{elementType}}: Invalid {{property}} value. {{property}} should be of type {{typeOne}} or {{typeTwo}}.",incorrectArgument:"{{elementType}}: Incorrect argument {{argumentName}} in method {{methodName}}.",permissionsRequired:"{{elementType}}: Permissions are required for the following action {{actionName}}.",timeout:"{{elementType}}: The import request has timed out.",importError:"{{elementType}}: The import request errored with the following status: {{status}}.",exportError:"{{elementType}}: The Export request errored with the following status: {{status}}.",ok:"Ok",cancel:"Cancel",alignLeft:"Align Left",alignCenter:"Align Center",alignRight:"Align Right",alignJustify:"Align Justify",segoeUi:"Segoe UI",arial:"Arial",georgia:"Georgia",impact:"Impact",tahoma:"Tahoma",timesNewRoman:"Times New Roman",verdana:"Verdana",p:"Paragraph",pre:"Code",code:"Code",blockquote:"Quotation",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",h5:"Heading 5",h6:"Heading 6",bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",orderedlist:"Ordered List",unorderedlist:"Unordered List",checklist:"Check List",subscript:"Subscript",superscript:"Superscript",alignment:"Alignments",fontname:"Font Name",fontsize:"Font Size",formats:"Formats",backgroundcolor:"Background Color",fontcolor:"Font Color",redo:"Redo",undo:"Undo",indent:"Indent",outdent:"Outdent",createlink:"Hyperlink",insertlink:"Insert a hyperlink",hyperlink:"Hyperlink",editlink:"Hyperlink",removelink:"Remove link",openlink:"Open link",image:"Image",video:"Video",table:"Table",lowercase:"Lower Case",uppercase:"Upper Case",print:" Print",cut:" Cut",copy:" Copy",paste:" Paste",clearformat:"Clear Format",fullscreen:"Full Screen",restore:"Restore Screen",sourcecode:"Source Code",preview:"Preview",splitmode:"Split Editor",address:"Web Address",text:"Display Text",addressPlaceholder:"https://example.com",textPlaceholder:"Enter Text",targetPlaceholder:"Select Target",titlePlaceholder:"Enter a Title",urlPlaceholder:"http://example.com/image.png",fileUrlPlaceholder:"http://example.com/file.pdf",srcPlaceholder:"https://www.youtube.com/embed/video_link",thumbnail:"Or provide a URL as a video thumbnail",thumbnailPlaceholder:"https://www.link-to-thumbnail.jpg",videoUrl:"Video URL",videoUrlPlaceholder:"https://www.youtube.com/video_link",captionPlaceholder:"Caption",altPlaceholder:"Alternative Text",widthPlaceholder:"auto",heightPlaceholder:"auto",target:"Open Link in",linkBlankDescr:"New Window",linkSelfDescr:"Same Window",linkParentDescr:"Parent Frame",linkTopDescr:"Full Body of the Window",linkCustomDescr:"Custom Frame Name",title:"Title",fileUrl:"Or provide the URL to a file",url:"Or provide the URL to an image",src:"Or provide the URL to an embed video",width:"Width",height:"Height",alt:"Alternative Text",caption:"Caption",display:"Display",displayPlaceholder:"Display",displayBlock:"Block",displayInline:"Inline",draggable:"Enable Dragging",resizable:"Enable Resizing",browse:"Browse",connectionError:"{{elementType}}: File Upload requires connection to the server.",wrongItemIndex:"{{elementType}}: There is no file with such an index in the list of uploaded files.",tooLongFileName:"{{elementType}}: File name is too long.",totalFiles:"Total files: ",cancelFile:"Cancel File",dashedborders:"Dashed Borders",altrows:"Alternate Rows",insertRowBefore:"Insert Row Before",insertRowAfter:"Insert Row After",deleteRow:"Delete Row",insertColumnLeft:"Insert Column Left",insertColumnRight:"Insert Column Right",deleteColumn:"Delete Column",alignTop:"Align Top",alignMiddle:"Align Middle",alignBottom:"Align Bottom",delete:"Delete",tablerows:"Table Rows",tablecolumns:"Table Columns",tablevalign:"Table Cell Vertical Align",tablestyle:"Table Style",tableheader:"Table Header",buttonLabel:"Custom Table",pasteLabel:"Choose the paste format action:",cols:"Columns",rows:"Rows",alphabet:"abcdefghijklmnopqrstuvwxyz",header:"Header",column:"Column",plainText:"Plain Text",keepFormat:"Keep Format",cleanFormat:"Clean Format",roleDescription:"Text Editor",iframeTitle:"Editor Content is Encloused in it's own DOM inside an iFrame",toolbarButtonAriaLabel:"Toolbar Toggle Button",primaryToolbarAriaLabel:"Primary Toolbar",secondaryToolbarAriaLabel:"Secondary Toolbar",inputAriaLabel:"Enter Text",homeTab:"Home",viewTab:"View",insertTab:"Insert",layoutTab:"Layout",undoGroup:"Undo",clipboardGroup:"Clipboard",fontGroup:"Font",paragraphGroup:"Paragraph",editingGroup:"Editing",tableGroup:"Tables",imageGroup:"Images",videoGroup:"Videos",linkGroup:"Links",viewsGroup:"Views",deleteGroup:"Delete",findandreplace:"Find and Replace",requiredMessage:"The content of the Editor cannot be empty",tableProperties:"Table Properties",imageProperties:"Image Properties",videoProperties:"Video Properties",linkProperties:"Link Properties",selectAll:"Select All",deleteTable:"Delete Table",deleteImage:"Delete Image",deleteVideo:"Delete Video",createLink:"Create Link",deleteLink:"Delete Link",copyImage:"Copy",cutImage:"Cut",copyVideo:"Copy",cutVideo:"Cut",find:"Find",findPlaceholder:"",replace:"Replace",replaceWith:"Replace With",replaceAll:"Replace All",replacePlaceholder:"",results:"Results",resultsPlaceholder:"No match",matchCase:"Match Case",searchPlaceholder:"Search...",newLinePlaceholder:"Write, press 'โ€‰/โ€‰' for commandsโ€ฆ",addButton:"Click to add below \nAlt+Click to add above",askQuestion:"Ask AI",file:"File",date:"Date",emoji:"Emoji",user:"User",bulletedList:"Bulleted list",numberedList:"Numbered list",toDoList:"To-do list",toggleList:"Toggle list",callout:"Callout",quote:"Quote",divider:"Divider",askQuestionToAI:"Ask a question to AI",insertAnImage:"Insert an image",insertAVideo:"Insert a video",insertAFile:"Insert a file",insertADate:"Insert a date",insertAnEmoji:"Insert an emoji",insertAUser:"Insert a user",justStartWritingWithPlainText:"Just start writing with plain text",bigSectionHeading:"Main Title",mediumSectionHeading:"Section Heading",smallSectionHeading:"Subsection Heading",verySmallSectionHeading:"Smaller Subsection",extraSmallSectionHeading:"Minor Heading",leastImportantHeading:"Least Important Heading",startABulletedList:"Start a bulleted list",startANumberedList:"Start a numbered list",startAToDoList:"Start a to-do list",togglesCanHideShowContent:"Toggles can hide/show content",makeWritingStandOut:"Make writing stand out",captureAQuote:"Capture a quote",insertATable:"Insert a table",breakUpYourWriting:"Break up your writing",noResults:"No Results",typeToFilter:"Type to filter...",editSelection:"Edit Selection",rewrite:"Rewrite",rewriteDescription:"Rewrite the selected text",continueWriting:"Continue writing",continueWritingDescription:"Extend the content further",fixSpellingGrammar:"Fix spelling & grammar",fixSpellingGrammarDescription:"Correct spelling and grammatical errors",summarize:"Summarize",summarizeDescription:"Generate a concise summary of the text",makeShorter:"Make shorter",makeShorterDescription:"Reduce the length of the text while maintaining meaning",makeLonger:"Make longer",makeLongerDescription:"Expand the text with more details",explain:"Explain",explainDescription:"Provide a clearer or more detailed explanation",changeTone:"Change Tone",concise:"Concise",conciseDescription:"Make the text more brief and to the point",professional:"Professional",professionalDescription:"Adjust the text to sound more formal and business-like",casual:"Casual",casualDescription:"Make the text sound more relaxed and friendly",funny:"Funny",funnyDescription:"Add humor or a lighthearted tone to the text",translate:"Translate",translateEnglish:"Translate to English",translateEnglishDescription:"Translate the text into English",translateSpanish:"Translate to Spanish",translateSpanishDescription:"Translate the text into Spanish",translatePortuguese:"Translate to Portuguese",translatePortugueseDescription:"Translate the text into Portuguese",translateItalian:"Translate to Italian",translateItalianDescription:"Translate the text into Italian",translateDutch:"Translate to Dutch",translateDutchDescription:"Translate the text into Dutch",translateChinese:"Translate to Chinese",translateChineseDescription:"Translate the text into Chinese",translateKorean:"Translate to Korean",translateKoreanDescription:"Translate the text into Korean",translateJapanese:"Translate to Japanese",translateJapaneseDescription:"Translate the text into Japanese",translateRussian:"Translate to Russian",translateRussianDescription:"Translate the text into Russian",processing:"Processing...",typePrompt:"Type your prompt here",keep:"Keep",insertBelow:"Insert below",page:"Link to a page",insertPage:"Organize ideas, tasks, and notes",task:"Task",insertTask:"Insert a task",twoColumns:"2 columns",threeColumns:"3 columns",fourColumns:"4 columns",twoColumnsDescription:"Create 2 of blocks",threeColumnsDescription:"Create 3 of blocks",fourColumnsDescription:"Create 4 of blocks",taskPlaceholder:"Enter Task Name"}}},name:{value:null,type:"string?"},pasteFormat:{allowedValues:["prompt","plainText","keepFormat","cleanFormat"],value:"keepFormat",type:"string"},postData:{value:null,type:"object"},placeholder:{value:"",type:"string"},removeStylesOnClearFormat:{value:!1,type:"boolean"},required:{value:!1,type:"boolean"},sanitized:{value:!1,type:"boolean"},showCharCount:{value:!1,type:"boolean"},compactImageDialog:{value:!1,type:"boolean"},splitModeRefreshTimeout:{value:100,type:"number"},toolbarItems:{value:["bold","italic","underline","|","formats","alignment","orderedList","unorderedList","|","hyperlink","image","video","|","sourceCode","undo","redo"],reflectToAttribute:!1,type:"array"},toolbarMode:{allowedValues:["menu","singleLineRibbon"],value:"menu",type:"string"},toolbarOnFocus:{value:!1,type:"boolean"},toolbarRibbonConfig:{value:[{name:"homeTab",groups:[{name:"undoGroup",items:["undo","redo"]},{name:"clipboardGroup",items:["cut","copy","paste"]},{name:"fontGroup",items:["fontName","fontSize","backgroundColor","fontColor","clearFormat","formats","bold","italic","underline","strikethrough","superscript","subscript"]},{name:"paragraphGroup",items:["orderedList","unorderedList","indent","outdent","alignment"]},{name:"editingGroup",items:["findAndReplace"]}]},{name:"insertTab",groups:[{name:"tableGroup",items:["table"]},{name:"imageGroup",items:["image"]},{name:"videoGroup",items:["video"]},{name:"linkGroup",items:["createLink","removeLink"]}]},{name:"viewTab",groups:[{name:"viewsGroup",items:["fullScreen","sourceCode","splitMode"]}]},{name:"layoutTab",hidden:!0,groups:[{name:"deleteGroup",items:["delete"]},{name:"tableGroup",items:["table","tableHeader","tableRows","tableColumns","tableVAlign","tableStyle",""]},{name:"imageGroup",items:["image","caption"]},{name:"videoGroup",items:["video","caption"]}]}],type:"array"},toolbarViewMode:{allowedValues:["toggle","multiRow","scroll"],value:"toggle",type:"string"},toolbarSticky:{value:!1,type:"boolean"},spellCheck:{value:!0,type:"boolean"},value:{value:"",type:"string",validator:"_sanitize",reflectToAttribute:!1},validateFile:{value:null,type:"function?",reflectToAttribute:!1},uploadUrl:{value:"",type:"string",reflectToAttribute:!1},removeUrl:{value:"",type:"string",reflectToAttribute:!1},onImageRemove:{value:null,type:"function?"},autoUpload:{value:!0,type:"boolean"},users:{value:[],type:"array",reflectToAttribute:!1},windowCustomizationFunction:{value:null,reflectToAttribute:!1,type:"function?"}}}static get listeners(){return{"document.down":"_documentDownHandler","document.move":"_documentMoveHandler","document.up":"_documentUpHandler","document.dragstart":"_dragStartHandler","document.selectstart":"_selectStartHandler","document.selectionchange":"_selectionChangeHandler","container.dragend":"_dragEndHandler","container.drop":"_dropHandler","container.change":"_changeHandler","container.beforeinput":"_beforeInputHandler","container.input":"_afterInputHandler","contentContainer.contextmenu":"_contextMenuHandler","contentContainer.keydown":"_editableElementKeyDownHandler","contentContainer.keyup":"_updateOnInputChange","contentContainer.paste":"_updateOnInputChange","input.focus":"_editableElementFocusHandler","input.blur":"_editableElementBlurHandler","input.change":"_inputChangeEvent","editableElement.focus":"_editableElementFocusHandler","editableElement.blur":"_editableElementBlurHandler","editableElement.wheel":"_editableElementWheelHandler","editableElement.move":"_editableElementMoveHandler","editableElement.mouseEnter":"_editableElementMouseEnterHandler",touchmove:"_touchmoveHandler",resize:"_resizeHandler",mouseleave:"_mouseLeaveHandler"}}static get requires(){return{"Smart.Button":"smart.button.js","Smart.Window":"smart.window.js","Smart.Tooltip":"smart.tooltip.js"}}static get styleUrls(){return["smart.editor.css"]}template(){return'<div id="container" role="presentation">\n <div id="toolbar" class="smart-editor-toolbar" role="presentation">\n <div id="toolbarItemsPrimary" class="smart-editor-toolbar-items-primary" role="toolbar"></div>\n <div id="toolbarToggleButton" class="smart-editor-toolbar-toggle-button" role="button"></div>\n <div id="toolbarItemsSecondary" class="smart-editor-toolbar-items-secondary" role="toolbar"></div>\n </div>\n <div id="contentContainer" class="smart-editor-content-container" role="presentation">\n <div class="smart-editor-editable" contenteditable="true" id="editableElement" aria-placeholder="[[placeholder]]"\n inner-h-t-m-l="[[innerHTML]]" role="textbox" aria-multiline="true"><content></content></div>\n <textarea name="[[name]]" id="input" class="smart-hidden" placeholder="[[placeholder]]" aria-placeholder="[[placeholder]]"\n spellcheck="[[spellCheck]]" autocapitalize="none" autocomplete="off"></textarea>\n <div class="smart-hidden smart-editor-tabs" id="tabs">\n </div>\n </div>\n </div>'}_editableElementMouseEnterHandler(){this._setSortable()}propertyChangedHandler(e,t,a){const o=this;switch(e){case"contentFiltering":case"contentFiltering_attributes":case"contentFiltering_attributeFilterMode":case"contentFiltering_tags":case"contentFiltering_tagFilterMode":case"contentFiltering_styleAttributes":case"contentFiltering_styleAttributeFilterMode":o._handleContentFiltering();break;case"disabled":case"disableEditing":o.$.input.readonly=a,o.$.editableElement.setAttribute("contenteditable",!a),"disabled"===e&&o._setFocusable();break;case"disableSearchBar":o._closeSearchToolbar();break;case"enableHtmlEncode":{const e=o.$.input;e.classList.contains("smart-hidden")||(e.value=o._getInputValue());break}case"hideToolbar":a&&o._updateToolbarItems(void 0,o.$.toolbar);break;case"sortable":o._setSortable();break;case"users":o._refreshTasks();break;case"innerHTML":case"value":if(""===a)a="&nbsp;";else{const e=e=>{let t=e.replace(/\\"/g,'"');return t=t.replace(/\\+/g,""),t=t.replace(/&nbsp;/g," "),t=t.replace(/"\s*=/g,'="'),t};let t=(e=>{const t=document.createElement("textarea");return t.innerHTML=e,t.value})(a);t=e(t),a=t}if("blockHtml"===o.editMode){const e=o._createEditorBlock(!1,!1,a);o.innerHTML=o.value=a=e.outerHTML}o._handleInputContent(e,a),"blockHtml"===o.editMode?setTimeout((()=>{o._initEditorBlocks(),o._refreshEditorBlockPlaceholder(),o._editorBlocks=o.$.editableElement.querySelectorAll(".smart-editor-block"),o._setSortable(),o._renderPages(),o._refreshTasks()}),100):o._renderPages(),o.$.fireEvent("change",{oldValue:o._value||t,value:o._value=o._getCurrentValue()});break;case"editMode":o._handleEditMode(a);break;case"hideInlineToolbar":{const e=o.$.inlineToolbar;e&&e.visible&&e.classList.contains("smart-editor-inline-toolbar")&&e.close();break}case"toolbarViewMode":o._toggleToolbar("toggle"===a);break;case"pages":case"enablePages":o._renderPages();break;case"toolbarOnFocus":case"toolbarMode":case"toolbarRibbonConfig":o._handleToolbarMode();break;case"locale":delete o._toolbarItemsObj,delete o._inlineToolbarItemsObj,o._refreshToolbarItems(o._getToolbarItems()),o._closeToolbar(),o._closeWindow();break;case"iframeSettings":o._handleInputElement();break;case"maxCharCount":o._handleMaxCharCount(),o._setCharCount();break;case"name":a&&"markdown"!==o.editMode&&(o.$.input.value=o._getInputValue(o.$.editableElement.innerHTML.trim()));break;case"placeholder":o._handlePlaceholder();break;case"pasteFormat":o._closeWindow();break;case"readonly":o.$.input.readonly=a,o.$.editableElement.setAttribute("contenteditable","markdown"!==o.editMode&&!a),o._closePopups(),o._setResizeFrame(),o._closeWindow();break;case"showCharCount":o._setCharCount();break;case"rightToLeft":case"animation":case"theme":o._updateIframeBody();break;case"toolbarItems":o._handleToolbarItems();break;default:super.propertyChangedHandler(e,t,a)}}_mouseLeaveHandler(){const e=this;e.$.headerInsertLine&&(e.$.headerInsertLine.classList.remove("show"),e.$.headerSortable.classList.remove("show"))}addToolbarItem(e){const t=this;t.toolbarItems||(t.toolbarItems=[]),t.toolbarItems.push(e),t._handleToolbarItems()}insertToolbarItem(e,t){const a=this;a.toolbarItems||(a.toolbarItems=[]),a.toolbarItems.splice(t,0,e),a._handleToolbarItems()}removeToolbarItem(e){const t=this;t.toolbarItems||(t.toolbarItems=[]),t.toolbarItems.splice(e,1),t._handleToolbarItems()}_handleToolbarItems(){const e=this,t=e.$.toolbarItemsPrimary,a=e.$.toolbarItemsSecondary;if(t&&a&&(t.innerHTML=a.innerHTML="",delete e._toolbarItemsObj,delete e._inlineToolbarItemsObj,e._refreshToolbarItems(e._getToolbarItems()),"toggle"===e.toolbarViewMode)){const o=e.$.toolbarToggleButton;t.scrollHeight!==t.offsetHeight||a.children.length?o.classList.remove("smart-visibility-hidden"):o.classList.add("smart-visibility-hidden")}}_refreshSortableMenuItems(e){const t=e.querySelectorAll(".smart-editor-context-menu-item");t.forEach((e=>e.classList.remove("smart-hidden")));const a=document.createElement("div");a.classList.add("smart-editor-context-menu-item"),a.setAttribute("role","option"),a.innerHTML=this.localize("noResults"),a.classList.add("smart-hidden"),a.style.whiteSpace="nowrap",a.style.paddingLeft=a.style.paddingBottom=a.style.paddingTop="5px",a.style.paddingRight="7px",a.classList.add("empty-item");let o=!1;return t.forEach((e=>{e.classList.contains("empty-item")&&(o=!0)})),o||e.appendChild(a),[t,a]}_getSortableMenuItems(){const e=this,t=[{label:e.localize("askQuestion"),value:"ai",description:e.localize("askQuestionToAI")}],a=[{label:e.localize("image"),value:"image",description:e.localize("insertAnImage")},{label:e.localize("video"),value:"video",description:e.localize("insertAVideo")},{label:e.localize("file"),value:"file",description:e.localize("insertAFile")},{label:e.localize("date"),value:"date",description:e.localize("insertADate")},{label:e.localize("emoji"),value:"emoji",description:e.localize("insertAnEmoji")}];e.users&&e.users.length>0&&a.push({label:e.localize("user"),value:"user",description:e.localize("insertAUser")});const o=[{label:e.localize("text"),name:"text",value:"text",description:e.localize("justStartWritingWithPlainText")},{label:e.localize("h1"),name:"formats",value:"h1",description:e.localize("bigSectionHeading")},{label:e.localize("h2"),name:"formats",value:"h2",description:e.localize("mediumSectionHeading")},{label:e.localize("h3"),name:"formats",value:"h3",description:e.localize("smallSectionHeading")},{label:e.localize("h4"),name:"formats",value:"h4",description:e.localize("verySmallSectionHeading")},{label:e.localize("h5"),name:"formats",value:"h5",description:e.localize("extraSmallSectionHeading")},{label:e.localize("h6"),name:"formats",value:"h6",description:e.localize("leastImportantHeading")},{label:e.localize("bulletedList"),value:"unorderedlist",description:e.localize("startABulletedList")},{label:e.localize("numberedList"),value:"orderedlist",description:e.localize("startANumberedList")},{label:e.localize("toDoList"),value:"checklist",description:e.localize("startAToDoList")},{label:e.localize("toggleList"),value:"togglelist",description:e.localize("togglesCanHideShowContent")},{label:e.localize("callout"),value:"callout",description:e.localize("makeWritingStandOut")},{label:e.localize("quote"),name:"formats",value:"blockquote",description:e.localize("captureAQuote")},{label:e.localize("createLink"),name:"hyperlink",value:"hyperlink",description:e.localize("insertlink")},{label:e.localize("table"),value:"table",description:e.localize("insertATable")},{label:e.localize("divider"),value:"divider",description:e.localize("breakUpYourWriting")},{label:e.localize("task"),value:"task",description:e.localize("insertTask")}];if(e.enablePages){const t=[{label:e.localize("page"),value:"page",description:e.localize("insertPage")}];o.push(...t)}const i=[{label:e.localize("twoColumns"),value:"twoColumns",description:e.localize("twoColumnsDescription")}];return o.push(...i),e.ai.key&&o.push(...t),o.push(...a),o}_getAIMenuItems(){const e=this;return[{label:e.localize("editSelection","Edit Selection"),value:"category"},{label:e.localize("rewrite","Rewrite"),value:"rewrite",description:e.localize("rewriteDescription","Rewrite the selected text")},{label:e.localize("continueWriting","Continue writing"),value:"continue_writing",description:e.localize("continueWritingDescription","Extend the content further")},{label:e.localize("fixSpellingGrammar","Fix spelling & grammar"),value:"fix_spelling_grammar",description:e.localize("fixSpellingGrammarDescription","Correct spelling and grammatical errors")},{label:e.localize("summarize","Summarize"),value:"summarize",description:e.localize("summarizeDescription","Generate a concise summary of the text")},{label:e.localize("makeShorter","Make shorter"),value:"make_shorter",description:e.localize("makeShorterDescription","Reduce the length of the text while maintaining meaning")},{label:e.localize("makeLonger","Make longer"),value:"make_longer",description:e.localize("makeLongerDescription","Expand the text with more details")},{label:e.localize("explain","Explain"),value:"explain",description:e.localize("explainDescription","Provide a clearer or more detailed explanation")},{label:e.localize("changeTone","Change Tone"),value:"category"},{label:e.localize("concise","Concise"),value:"concise",description:e.localize("conciseDescription","Make the text more brief and to the point")},{label:e.localize("professional","Professional"),value:"professional",description:e.localize("professionalDescription","Adjust the text to sound more formal and business-like")},{label:e.localize("casual","Casual"),value:"casual",description:e.localize("casualDescription","Make the text sound more relaxed and friendly")},{label:e.localize("funny","Funny"),value:"funny",description:e.localize("funnyDescription","Add humor or a lighthearted tone to the text")},{label:e.localize("translate","Translate"),value:"category"},{label:e.localize("translateEnglish","Translate to English"),value:"translate_english",description:e.localize("translateEnglishDescription","Translate the text into English")},{label:e.localize("translateSpanish","Translate to Spanish"),value:"translate_spanish",description:e.localize("translateSpanishDescription","Translate the text into Spanish")},{label:e.localize("translatePortuguese","Translate to Portuguese"),value:"translate_portuguese",description:e.localize("translatePortugueseDescription","Translate the text into Portuguese")},{label:e.localize("translateItalian","Translate to Italian"),value:"translate_italian",description:e.localize("translateItalianDescription","Translate the text into Italian")},{label:e.localize("translateDutch","Translate to Dutch"),value:"translate_dutch",description:e.localize("translateDutchDescription","Translate the text into Dutch")},{label:e.localize("translateChinese","Translate to Chinese"),value:"translate_chinese",description:e.localize("translateChineseDescription","Translate the text into Chinese")},{label:e.localize("translateKorean","Translate to Korean"),value:"translate_korean",description:e.localize("translateKoreanDescription","Translate the text into Korean")},{label:e.localize("translateJapanese","Translate to Japanese"),value:"translate_japanese",description:e.localize("translateJapaneseDescription","Translate the text into Japanese")},{label:e.localize("translateRussian","Translate to Russian"),value:"translate_russian",description:e.localize("translateRussianDescription","Translate the text into Russian")}]}_createCallout(e,t){const a=this;a._callout&&a._callout.remove();const o=document.createElement("div");a._callout=o,o.classList.add("dropdown","smart-editor-callout"),o.innerHTML="\n <div class='categories' id='categories'></div>\n <div class='tabs' id='tabs'></div>\n ";const i=o,n=i.firstElementChild,r=i.lastElementChild;document.body.appendChild(o);const l={General:[{emoji:"๐Ÿ’ก",title:"Idea"},{emoji:"๐Ÿ“Œ",title:"Pinned Note"},{emoji:"๐Ÿ”ฅ",title:"On Fire"},{emoji:"โšก",title:"Lightning Fast"},{emoji:"๐Ÿ’ฌ",title:"Chat"},{emoji:"๐Ÿ“…",title:"Calendar"},{emoji:"๐Ÿ”’",title:"Locked & Secure"},{emoji:"โญ",title:"Starred"},{emoji:"๐ŸŽ‰",title:"Celebration"},{emoji:"๐Ÿ“",title:"Notes"},{emoji:"๐Ÿ“‚",title:"Folder"},{emoji:"๐Ÿ””",title:"Notification"},{emoji:"๐ŸŒŸ",title:"Shining Star"},{emoji:"๐Ÿš€",title:"Rocket Boost"},{emoji:"๐Ÿ“ˆ",title:"Growth"},{emoji:"๐ŸŽฏ",title:"Target Achieved"},{emoji:"๐Ÿ’ช",title:"Strength"},{emoji:"โณ",title:"Time Running"},{emoji:"๐Ÿง ",title:"Brainstorm"},{emoji:"๐Ÿ“š",title:"Learning"},{emoji:"๐Ÿ–‹๏ธ",title:"Writing"},{emoji:"๐Ÿ“‹",title:"Clipboard"},{emoji:"๐Ÿ—“๏ธ",title:"Schedule"},{emoji:"๐Ÿ†",title:"Trophy"},{emoji:"๐ŸŽ",title:"Gift"},{emoji:"๐ŸŽจ",title:"Creativity"},{emoji:"โš–๏ธ",title:"Balance"},{emoji:"โฒ๏ธ",title:"Timer"},{emoji:"๐ŸŒ",title:"Global"},{emoji:"๐Ÿ”",title:"Search"},{emoji:"๐Ÿ› ๏ธ",title:"Tools & Fixes"},{emoji:"๐Ÿ“œ",title:"Document"},{emoji:"๐ŸŽต",title:"Music"},{emoji:"๐Ÿ“Ž",title:"Attachment"},{emoji:"๐Ÿ–ฅ๏ธ",title:"Computer Work"},{emoji:"๐Ÿ“ฑ",title:"Mobile"},{emoji:"๐Ÿ’ญ",title:"Thinking"},{emoji:"โœ‰๏ธ",title:"Email"},{emoji:"๐Ÿ”„",title:"Sync & Refresh"},{emoji:"๐Ÿ•’",title:"Time Management"},{emoji:"๐Ÿ’ฐ",title:"Finance"},{emoji:"๐Ÿ“Š",title:"Analytics"},{emoji:"๐Ÿ›’",title:"Shopping"},{emoji:"๐Ÿ”‘",title:"Key Info"},{emoji:"โš™๏ธ",title:"Settings"},{emoji:"๐ŸŽฌ",title:"Video Content"},{emoji:"๐Ÿ—ƒ๏ธ",title:"Storage"},{emoji:"๐Ÿ…",title:"Achievement"},{emoji:"๐Ÿ“˜",title:"Book"},{emoji:"๐Ÿ“ค",title:"Sent"},{emoji:"๐Ÿ“ฅ",title:"Received"},{emoji:"๐Ÿ“",title:"Location"},{emoji:"โœ๏ธ",title:"Edit"},{emoji:"๐Ÿ–ผ๏ธ",title:"Image"},{emoji:"๐Ÿ“ป",title:"Podcast & Radio"},{emoji:"๐Ÿ›Ž๏ธ",title:"Reminder"},{emoji:"๐Ÿ”ฆ",title:"Highlight"},{emoji:"๐ŸŒˆ",title:"Inspiration"},{emoji:"๐ŸŽ™๏ธ",title:"Recording"},{emoji:"๐Ÿ–Œ๏ธ",title:"Design"}],Productivity:[{emoji:"๐Ÿง ",title:"Brainstorming"},{emoji:"โณ",title:"Time Management"},{emoji:"๐Ÿ”‘",title:"Key"},{emoji:"๐Ÿ—‚๏ธ",title:"Organizer"},{emoji:"๐Ÿ“ˆ",title:"Analytics"},{emoji:"๐Ÿ’ผ",title:"Business"},{emoji:"๐Ÿ“‹",title:"Checklist"},{emoji:"๐Ÿ–ฅ๏ธ",title:"Computer"},{emoji:"๐Ÿ“…",title:"Schedule"},{emoji:"๐Ÿ“š",title:"Learning"},{emoji:"๐Ÿš€",title:"Success"},{emoji:"๐Ÿ’ป",title:"Laptop"},{emoji:"๐Ÿ“ฑ",title:"Mobile"},{emoji:"โฐ",title:"Alarm Clock"},{emoji:"๐Ÿ“‚",title:"Documents"},{emoji:"๐Ÿ“",title:"Writing"},{emoji:"โœ๏ธ",title:"Edit"},{emoji:"๐Ÿ””",title:"Reminder"},{emoji:"โšก",title:"Quick Action"},{emoji:"๐Ÿ’ช",title:"Effort"},{emoji:"๐Ÿ› ๏ธ",title:"Tools"},{emoji:"๐Ÿ“Š",title:"Statistics"},{emoji:"๐Ÿ’ก",title:"Creativity"},{emoji:"๐ŸŽฏ",title:"Focus"},{emoji:"๐Ÿ“Ž",title:"Attachment"},{emoji:"๐Ÿ“ค",title:"Outbox"},{emoji:"๐Ÿ“ฅ",title:"Inbox"},{emoji:"๐Ÿ”",title:"Search"},{emoji:"๐Ÿ—๏ธ",title:"Solution"},{emoji:"๐Ÿ—๏ธ",title:"Building"},{emoji:"๐Ÿƒโ€โ™‚๏ธ",title:"Hustle"},{emoji:"๐Ÿ…",title:"Achievement"},{emoji:"๐ŸŒ",title:"Global Work"},{emoji:"๐Ÿ’ฐ",title:"Finance"},{emoji:"๐Ÿ“ข",title:"Announcement"},{emoji:"๐Ÿ”„",title:"Refresh"},{emoji:"โœ…",title:"Completed Task"},{emoji:"๐Ÿ“ถ",title:"Progress"},{emoji:"๐Ÿ–‡๏ธ",title:"Connection"},{emoji:"๐Ÿ“œ",title:"Documentation"},{emoji:"๐Ÿ†",title:"Success"},{emoji:"๐Ÿšฆ",title:"Prioritization"},{emoji:"๐ŸŽ›๏ธ",title:"Control Panel"},{emoji:"๐Ÿ’ณ",title:"Payment"},{emoji:"๐Ÿ›Ž๏ธ",title:"Service"},{emoji:"๐ŸŒ",title:"Online Work"},{emoji:"๐Ÿ“",title:"Location"},{emoji:"๐Ÿ›’",title:"Shopping List"},{emoji:"๐Ÿ“œ",title:"Agreement"},{emoji:"โš™๏ธ",title:"Settings"},{emoji:"๐Ÿ“‘",title:"Bookmarks"},{emoji:"๐Ÿ›ค๏ธ",title:"Roadmap"}],Motivation:[{emoji:"๐ŸŽฏ",title:"Goal Setting"},{emoji:"๐Ÿ’ช",title:"Strength"},{emoji:"๐Ÿš€",title:"Ambition"},{emoji:"๐ŸŒŸ",title:"Shining Bright"},{emoji:"๐Ÿ†",title:"Victory"},{emoji:"๐Ÿ”ฅ",title:"Passion"},{emoji:"โšก",title:"Energy"},{emoji:"๐Ÿ…",title:"Achievement"},{emoji:"๐ŸŒฑ",title:"Growth"},{emoji:"๐Ÿ’ฏ",title:"Excellence"},{emoji:"๐ŸŽ‰",title:"Celebration"},{emoji:"๐ŸŽ",title:"Reward"},{emoji:"โœจ",title:"Inspiration"},{emoji:"๐Ÿ’ฅ",title:"Breakthrough"},{emoji:"๐Ÿ’ซ",title:"Momentum"},{emoji:"๐ŸŒ ",title:"Dream Big"},{emoji:"๐Ÿฅ‡",title:"First Place"},{emoji:"๐Ÿš€",title:"Sky's the Limit"},{emoji:"๐Ÿ’จ",title:"Speed"},{emoji:"๐Ÿ’ก",title:"Bright Ideas"},{emoji:"๐Ÿ‹๏ธโ€โ™‚๏ธ",title:"Hard Work"},{emoji:"๐Ÿ“ˆ",title:"Progress"},{emoji:"๐Ÿ”",title:"Top Performance"},{emoji:"๐Ÿ‘Š",title:"Determination"},{emoji:"๐Ÿ•ถ๏ธ",title:"Confidence"},{emoji:"๐Ÿคฉ",title:"Excitement"},{emoji:"๐Ÿšง",title:"Overcoming Challenges"},{emoji:"๐Ÿ’Ž",title:"Value"},{emoji:"๐Ÿ",title:"Finish Line"},{emoji:"๐ŸŒž",title:"Positivity"},{emoji:"๐Ÿ”ฅ",title:"Stay Motivated"},{emoji:"๐ŸŽต",title:"Power Playlist"},{emoji:"๐Ÿ›ค๏ธ",title:"Journey to Success"},{emoji:"๐Ÿค",title:"Support System"},{emoji:"๐Ÿ“…",title:"Daily Wins"},{emoji:"๐ŸŽ™๏ธ",title:"Speak Up"},{emoji:"๐Ÿง—โ€โ™‚๏ธ",title:"Keep Climbing"},{emoji:"๐Ÿƒโ€โ™‚๏ธ",title:"Keep Moving"},{emoji:"๐Ÿ“ข",title:"Encouragement"},{emoji:"๐Ÿ’ฐ",title:"Financial Goals"},{emoji:"๐ŸŽ“",title:"Learning & Growth"},{emoji:"๐Ÿ› ๏ธ",title:"Building Success"},{emoji:"โš–๏ธ",title:"Balance & Focus"},{emoji:"๐Ÿฅ‚",title:"Milestone Celebration"},{emoji:"๐Ÿ—บ๏ธ",title:"Vision & Strategy"},{emoji:"๐Ÿ›‘",title:"No Excuses"},{emoji:"๐Ÿšฆ",title:"Go Mode"},{emoji:"๐Ÿš€",title:"Unstoppable"}],"Smile Faces":[{emoji:"๐Ÿ˜€",title:"Big Smile"},{emoji:"๐Ÿ˜ƒ",title:"Happy Face"},{emoji:"๐Ÿ˜„",title:"Grinning"},{emoji:"๐Ÿ˜",title:"Cheerful"},{emoji:"๐Ÿ˜†",title:"Laughing Hard"},{emoji:"๐Ÿ˜…",title:"Relieved Laugh"},{emoji:"๐Ÿ˜‚",title:"Tears of Joy"},{emoji:"๐Ÿคฃ",title:"ROFL"},{emoji:"๐Ÿ˜œ",title:"Playful Wink"},{emoji:"๐Ÿ˜Ž",title:"Cool & Confident"},{emoji:"๐Ÿ˜",title:"Heart Eyes"},{emoji:"๐Ÿ˜Š",title:"Warm Smile"},{emoji:"๐Ÿ˜‰",title:"Wink"},{emoji:"๐Ÿฅฐ",title:"Feeling Loved"},{emoji:"๐Ÿ˜š",title:"Kissy Face"},{emoji:"๐Ÿ˜™",title:"Smooch"},{emoji:"๐Ÿ˜‹",title:"Yummy!"},{emoji:"๐Ÿ˜›",title:"Tongue Out"},{emoji:"๐Ÿ˜",title:"Smirking"},{emoji:"๐Ÿ˜Œ",title:"Content & Relaxed"},{emoji:"๐Ÿ˜—",title:"Kissing Face"},{emoji:"๐Ÿฅณ",title:"Party Mode"},{emoji:"๐Ÿคฉ",title:"Star-Struck"},{emoji:"๐Ÿค—",title:"Hugging You"},{emoji:"๐Ÿ˜‡",title:"Angel Mode"},{emoji:"๐Ÿ˜ป",title:"Loving Cat"},{emoji:"๐Ÿ˜บ",title:"Happy Cat"},{emoji:"๐Ÿ˜ฝ",title:"Cat Kiss"},{emoji:"๐Ÿคญ",title:"Oops, My Bad"},{emoji:"๐Ÿซ ",title:"Melting with Happiness"},{emoji:"๐Ÿฅน",title:"Touched & Emotional"},{emoji:"๐Ÿซก",title:"Respect"},{emoji:"๐Ÿคค",title:"Drooling"},{emoji:"๐Ÿ˜ฌ",title:"Awkward Smile"},{emoji:"๐Ÿคช",title:"Crazy Fun"},{emoji:"๐Ÿ˜ตโ€๐Ÿ’ซ",title:"Dizzy & Confused"},{emoji:"๐Ÿ˜ฏ",title:"Surprised & Speechless"},{emoji:"๐Ÿค ",title:"Yeehaw Mood"},{emoji:"๐Ÿ˜†",title:"Giggle"},{emoji:"๐Ÿซข",title:"Oops!"},{emoji:"๐Ÿ™ƒ",title:"Upside Down Fun"},{emoji:"๐Ÿ˜œ",title:"Goofy"},{emoji:"๐Ÿ˜น",title:"Cat LOL"},{emoji:"๐Ÿ˜ˆ",title:"Mischievous Grin"},{emoji:"๐Ÿ‘ป",title:"Silly Ghost"},{emoji:"๐Ÿฅด",title:"Woozy"},{emoji:"๐Ÿซจ",title:"Shaking with Excitement"},{emoji:"๐Ÿ’ƒ",title:"Dancing Queen"}],People:[{emoji:"๐Ÿ‘จโ€๐Ÿ’ป",title:"Man Technologist"},{emoji:"๐Ÿ‘ฉโ€๐Ÿ’ป",title:"Woman Technologist"},{emoji:"๐Ÿ‘จโ€๐ŸŽ“",title:"Man Student"},{emoji:"๐Ÿ‘ฉโ€๐ŸŽ“",title:"Woman Student"},{emoji:"๐Ÿ‘จโ€๐Ÿซ",title:"Man Teacher"},{emoji:"๐Ÿ‘ฉโ€๐Ÿซ",title:"Woman Teacher"},{emoji:"๐Ÿ‘จโ€โš–๏ธ",title:"Man Judge"},{emoji:"๐Ÿ‘ฉโ€โš–๏ธ",title:"Woman Judge"},{emoji:"๐Ÿ‘จโ€๐Ÿ”ฌ",title:"Man Scientist"},{emoji:"๐Ÿ‘ฉโ€๐Ÿ”ฌ",title:"Woman Scientist"},{emoji:"๐Ÿ‘จโ€๐ŸŽจ",title:"Man Artist"},{emoji:"๐Ÿ‘ฉโ€๐ŸŽจ",title:"Woman Artist"},{emoji:"๐Ÿ‘จโ€๐Ÿณ",title:"Man Chef"},{emoji:"๐Ÿ‘ฉโ€๐Ÿณ",title:"Woman Chef"},{emoji:"๐Ÿ‘จโ€๐Ÿš€",title:"Man Astronaut"},{emoji:"๐Ÿ‘ฉโ€๐Ÿš€",title:"Woman Astronaut"},{emoji:"๐Ÿง‘โ€โš–๏ธ",title:"Person Judge"},{emoji:"๐Ÿง‘โ€๐Ÿ”ฌ",title:"Person Scientist"},{emoji:"๐Ÿง‘โ€๐ŸŽจ",title:"Person Artist"},{emoji:"๐Ÿง‘โ€๐Ÿณ",title:"Person Chef"},{emoji:"๐Ÿง‘โ€๐Ÿš€",title:"Person Astronaut"},{emoji:"๐Ÿง‘โ€โš–๏ธ",title:"Person Lawyer"},{emoji:"๐Ÿ‘ถ",title:"Baby"},{emoji:"๐Ÿ‘ง",title:"Girl"},{emoji:"๐Ÿ‘ฆ",title:"Boy"},{emoji:"๐Ÿ‘จ",title:"Man"},{emoji:"๐Ÿ‘ฉ",title:"Woman"},{emoji:"๐Ÿง‘",title:"Person"},{emoji:"๐Ÿง“",title:"Older Person"},{emoji:"๐Ÿ‘ต",title:"Grandmother"},{emoji:"๐Ÿ‘ด",title:"Grandfather"},{emoji:"๐Ÿ‘ฎ",title:"Police Officer"},{emoji:"๐Ÿ‘ท",title:"Construction Worker"},{emoji:"๐Ÿ’‚",title:"Guard"},{emoji:"๐Ÿ‘ฉโ€โš–๏ธ",title:"Female Judge"},{emoji:"๐Ÿ‘ฉโ€๐Ÿณ",title:"Female Chef"},{emoji:"๐Ÿ‘จโ€โš–๏ธ",title:"Male Judge"},{emoji:"๐Ÿ‘จโ€๐Ÿณ",title:"Male Chef"},{emoji:"๐Ÿ’ƒ",title:"Dancer"},{emoji:"๐Ÿ•บ",title:"Man Dancing"},{emoji:"๐Ÿคฆ",title:"Facepalm"},{emoji:"๐Ÿคท",title:"Shrug"},{emoji:"๐Ÿ™‹",title:"Person Raising Hand"},{emoji:"๐Ÿ™‹โ€โ™‚๏ธ",title:"Man Raising Hand"},{emoji:"๐Ÿ™‹โ€โ™€๏ธ",title:"Woman Raising Hand"},{emoji:"๐Ÿ™†",title:"Person Gesturing OK"},{emoji:"๐Ÿ™†โ€โ™‚๏ธ",title:"Man Gesturing OK"},{emoji:"๐Ÿ™†โ€โ™€๏ธ",title:"Woman Gesturing OK"},{emoji:"๐Ÿ’…",title:"Nail Polish"},{emoji:"๐Ÿง‘โ€๐Ÿฆฑ",title:"Person with Curly Hair"},{emoji:"๐Ÿง‘โ€๐Ÿฆณ",title:"Person with White Hair"},{emoji:"๐Ÿง‘โ€๐Ÿฆฒ",title:"Bald Person"}],"Food & Drink":[{emoji:"๐ŸŽ",title:"Red Apple"},{emoji:"๐Ÿ",title:"Green Apple"},{emoji:"๐Ÿ",title:"Pear"},{emoji:"๐ŸŠ",title:"Orange"},{emoji:"๐Ÿ‹",title:"Lemon"},{emoji:"๐ŸŒ",title:"Banana"},{emoji:"๐Ÿ‰",title:"Watermelon"},{emoji:"๐Ÿ‡",title:"Grapes"},{emoji:"๐Ÿ“",title:"Strawberry"},{emoji:"๐Ÿซ",title:"Blueberry"},{emoji:"๐Ÿ’",title:"Cherries"},{emoji:"๐Ÿ‘",title:"Peach"},{emoji:"๐Ÿฅญ",title:"Mango"},{emoji:"๐Ÿ",title:"Pineapple"},{emoji:"๐Ÿฅฅ",title:"Coconut"},{emoji:"๐Ÿฅ",title:"Kiwi"},{emoji:"๐Ÿ…",title:"Tomato"},{emoji:"๐ŸŒถ๏ธ",title:"Hot Pepper"},{emoji:"๐Ÿฅ’",title:"Cucumber"},{emoji:"๐Ÿฅ•",title:"Carrot"},{emoji:"๐ŸŒฝ",title:"Corn"},{emoji:"๐Ÿฅ”",title:"Potato"},{emoji:"๐Ÿง…",title:"Onion"},{emoji:"๐Ÿง„",title:"Garlic"},{emoji:"๐Ÿฅ‘",title:"Avocado"},{emoji:"๐Ÿฅฆ",title:"Broccoli"},{emoji:"๐Ÿฅฌ",title:"Lettuce"},{emoji:"๐Ÿซ›",title:"Peas"},{emoji:"๐Ÿฅœ",title:"Peanuts"},{emoji:"๐ŸŒฐ",title:"Chestnut"},{emoji:"๐Ÿž",title:"Bread"},{emoji:"๐Ÿฅ–",title:"Baguette"},{emoji:"๐Ÿฅ",title:"Croissant"},{emoji:"๐Ÿฅฏ",title:"Bagel"},{emoji:"๐Ÿง‡",title:"Waffle"},{emoji:"๐Ÿฅž",title:"Pancakes"},{emoji:"๐Ÿง€",title:"Cheese"},{emoji:"๐Ÿ—",title:"Chicken Leg"},{emoji:"๐Ÿฅฉ",title:"Steak"},{emoji:"๐Ÿ–",title:"Meat on Bone"},{emoji:"๐ŸŒญ",title:"Hot Dog"},{emoji:"๐Ÿ”",title:"Burger"},{emoji:"๐Ÿ•",title:"Pizza"},{emoji:"๐Ÿฅช",title:"Sandwich"},{emoji:"๐ŸŒฎ",title:"Taco"},{emoji:"๐ŸŒฏ",title:"Burrito"},{emoji:"๐Ÿฅ—",title:"Salad"},{emoji:"๐Ÿฃ",title:"Sushi"},{emoji:"๐Ÿ›",title:"Curry"},{emoji:"๐Ÿœ",title:"Noodles"},{emoji:"๐Ÿฒ",title:"Soup"},{emoji:"๐Ÿฅ˜",title:"Paella"},{emoji:"๐Ÿซ•",title:"Fondue"},{emoji:"๐Ÿš",title:"Cooked Rice"},{emoji:"๐Ÿค",title:"Fried Shrimp"},{emoji:"๐Ÿฅฎ",title:"Moon Cake"},{emoji:"๐Ÿฉ",title:"Doughnut"},{emoji:"๐Ÿช",title:"Cookie"},{emoji:"๐Ÿฐ",title:"Cake"},{emoji:"๐ŸŽ‚",title:"Birthday Cake"},{emoji:"๐Ÿง",title:"Cupcake"},{emoji:"๐Ÿซ",title:"Chocolate"},{emoji:"๐Ÿฌ",title:"Candy"},{emoji:"๐Ÿญ",title:"Lollipop"},{emoji:"๐Ÿฎ",title:"Custard"},{emoji:"๐Ÿฏ",title:"Honey"},{emoji:"๐Ÿฅ›",title:"Milk"},{emoji:"๐Ÿผ",title:"Baby Bottle"},{emoji:"โ˜•",title:"Coffee"},{emoji:"๐Ÿต",title:"Tea"},{emoji:"๐Ÿงƒ",title:"Juice"},{emoji:"๐Ÿฅค",title:"Soft Drink"},{emoji:"๐Ÿน",title:"Cocktail"},{emoji:"๐Ÿท",title:"Wine"},{emoji:"๐Ÿบ",title:"Beer"},{emoji:"๐Ÿป",title:"Cheers"},{emoji:"๐Ÿฅ‚",title:"Champagne"},{emoji:"๐Ÿฅƒ",title:"Whiskey"}],Symbols:[{emoji:"โœ…",title:"Check Mark"},{emoji:"โŒ",title:"Cross Mark"},{emoji:"โš ๏ธ",title:"Warning"},{emoji:"โ„น๏ธ",title:"Information"},{emoji:"โ“",title:"Question"},{emoji:"โ—",title:"Exclamation"},{emoji:"๐Ÿ”„",title:"Refresh"},{emoji:"๐Ÿ”ƒ",title:"Reload"},{emoji:"โž•",title:"Plus"},{emoji:"โž–",title:"Minus"},{emoji:"โž—",title:"Division"},{emoji:"โœ–๏ธ",title:"Multiplication"},{emoji:"๐Ÿ’ฒ",title:"Dollar Sign"},{emoji:"๐Ÿ’ฑ",title:"Currency Exchange"},{emoji:"โšก",title:"Lightning"},{emoji:"๐Ÿ”’",title:"Lock"},{emoji:"๐Ÿ”“",title:"Unlock"},{emoji:"๐Ÿ”‘",title:"Key"},{emoji:"๐Ÿ†•",title:"New"},{emoji:"๐Ÿ†™",title:"Up"},{emoji:"๐Ÿ†’",title:"Cool"},{emoji:"๐Ÿ†“",title:"Free"},{emoji:"๐Ÿ†–",title:"No Good"},{emoji:"๐Ÿˆบ",title:"Open Business"},{emoji:"๐Ÿˆš",title:"Not Available"},{emoji:"โญ•",title:"Circle"},{emoji:"๐Ÿ’ ",title:"Diamond"},{emoji:"๐Ÿ”ท",title:"Blue Diamond"},{emoji:"๐Ÿ”ถ",title:"Orange Diamond"},{emoji:"๐Ÿ”ด",title:"Red Circle"},{emoji:"๐ŸŸข",title:"Green Circle"},{emoji:"๐Ÿ”ต",title:"Blue Circle"},{emoji:"๐ŸŸก",title:"Yellow Circle"},{emoji:"โšช",title:"White Circle"},{emoji:"โšซ",title:"Black Circle"},{emoji:"โฌ†๏ธ",title:"Up Arrow"},{emoji:"โฌ‡๏ธ",title:"Down Arrow"},{emoji:"โฌ…๏ธ",title:"Left Arrow"},{emoji:"โžก๏ธ",title:"Right Arrow"},{emoji:"โ†”๏ธ",title:"Left-Right Arrow"},{emoji:"โ†•๏ธ",title:"Up-Down Arrow"},{emoji:"๐Ÿ”„",title:"Rotate"},{emoji:"โ™ป๏ธ",title:"Recycle"},{emoji:"๐Ÿณ๏ธ",title:"White Flag"},{emoji:"๐Ÿด",title:"Black Flag"},{emoji:"๐Ÿ",title:"Finish Line"},{emoji:"โšœ๏ธ",title:"Fleur-de-lis"},{emoji:"โ™พ๏ธ",title:"Infinity"}],Flags:[{emoji:"๐Ÿ‡บ๐Ÿ‡ธ",title:"United States"},{emoji:"๐Ÿ‡จ๐Ÿ‡ฆ",title:"Canada"},{emoji:"๐Ÿ‡ฌ๐Ÿ‡ง",title:"United Kingdom"},{emoji:"๐Ÿ‡ฆ๐Ÿ‡บ",title:"Australia"},{emoji:"๐Ÿ‡ฉ๐Ÿ‡ช",title:"Germany"},{emoji:"๐Ÿ‡ซ๐Ÿ‡ท",title:"France"},{emoji:"๐Ÿ‡ฎ๐Ÿ‡น",title:"Italy"},{emoji:"๐Ÿ‡ช๐Ÿ‡ธ",title:"Spain"},{emoji:"๐Ÿ‡ณ๐Ÿ‡ฑ",title:"Netherlands"},{emoji:"๐Ÿ‡ง๐Ÿ‡ช",title:"Belgium"},{emoji:"๐Ÿ‡จ๐Ÿ‡ญ",title:"Switzerland"},{emoji:"๐Ÿ‡ฆ๐Ÿ‡น",title:"Austria"},{emoji:"๐Ÿ‡ธ๐Ÿ‡ช",title:"Sweden"},{emoji:"๐Ÿ‡ณ๐Ÿ‡ด",title:"Norway"},{emoji:"๐Ÿ‡ฉ๐Ÿ‡ฐ",title:"Denmark"},{emoji:"๐Ÿ‡ซ๐Ÿ‡ฎ",title:"Finland"},{emoji:"๐Ÿ‡ฎ๐Ÿ‡ช",title:"Ireland"},{emoji:"๐Ÿ‡ต๐Ÿ‡ฑ",title:"Poland"},{emoji:"๐Ÿ‡จ๐Ÿ‡ฟ",title:"Czech Republic"},{emoji:"๐Ÿ‡ธ๐Ÿ‡ฐ",title:"Slovakia"},{emoji:"๐Ÿ‡ญ๐Ÿ‡บ",title:"Hungary"},{emoji:"๐Ÿ‡ท๐Ÿ‡ด",title:"Romania"},{emoji:"๐Ÿ‡ง๐Ÿ‡ฌ",title:"Bulgaria"},{emoji:"๐Ÿ‡ฌ๐Ÿ‡ท",title:"Greece"},{emoji:"๐Ÿ‡ต๐Ÿ‡น",title:"Portugal"},{emoji:"๐Ÿ‡ท๐Ÿ‡บ",title:"Russia"},{emoji:"๐Ÿ‡น๐Ÿ‡ท",title:"Turkey"},{emoji:"๐Ÿ‡จ๐Ÿ‡ณ",title:"China"},{emoji:"๐Ÿ‡ฏ๐Ÿ‡ต",title:"Japan"},{emoji:"๐Ÿ‡ฐ๐Ÿ‡ท",title:"South Korea"},{emoji:"๐Ÿ‡ฎ๐Ÿ‡ณ",title:"India"},{emoji:"๐Ÿ‡ง๐Ÿ‡ท",title:"Brazil"},{emoji:"๐Ÿ‡ฒ๐Ÿ‡ฝ",title:"Mexico"},{emoji:"๐Ÿ‡ฆ๐Ÿ‡ท",title:"Argentina"},{emoji:"๐Ÿ‡จ๐Ÿ‡ด",title:"Colombia"},{emoji:"๐Ÿ‡จ๐Ÿ‡ฑ",title:"Chile"},{emoji:"๐Ÿ‡ฟ๐Ÿ‡ฆ",title:"South Africa"},{emoji:"๐Ÿ‡ช๐Ÿ‡ฌ",title:"Egypt"},{emoji:"๐Ÿ‡ฆ๐Ÿ‡ช",title:"United Arab Emirates"},{emoji:"๐Ÿ‡ฎ๐Ÿ‡ฑ",title:"Israel"},{emoji:"๐Ÿ‡ธ๐Ÿ‡ฆ",title:"Saudi Arabia"},{emoji:"๐Ÿ‡ฎ๐Ÿ‡ฉ",title:"Indonesia"},{emoji:"๐Ÿ‡ฒ๐Ÿ‡พ",title:"Malaysia"},{emoji:"๐Ÿ‡ต๐Ÿ‡ญ",title:"Philippines"},{emoji:"๐Ÿ‡น๐Ÿ‡ญ",title:"Thailand"},{emoji:"๐Ÿ‡ป๐Ÿ‡ณ",title:"Vietnam"},{emoji:"๐Ÿ‡ธ๐Ÿ‡ฌ",title:"Singapore"},{emoji:"๐Ÿ‡ฐ๐Ÿ‡ช",title:"Kenya"},{emoji:"๐Ÿ‡ณ๐Ÿ‡ฌ",title:"Nigeria"},{emoji:"๐Ÿ‡ต๐Ÿ‡ฐ",title:"Pakistan"},{emoji:"๐Ÿ‡ณ๐Ÿ‡ฟ",title:"New Zealand"},{emoji:"๐Ÿ‡บ๐Ÿ‡ฆ",title:"Ukraine"}],Gestures:[{emoji:"๐Ÿ‘",title:"Thumbs Up"},{emoji:"๐Ÿ‘Ž",title:"Thumbs Down"},{emoji:"๐Ÿ‘Œ",title:"OK Hand"},{emoji:"๐Ÿคž",title:"Fingers Crossed"},{emoji:"โœŒ๏ธ",title:"Victory Hand"},{emoji:"๐ŸคŸ",title:"Love-You Gesture"},{emoji:"๐Ÿค™",title:"Call Me Hand"},{emoji:"๐Ÿ‘‹",title:"Waving Hand"},{emoji:"๐Ÿ–",title:"Raised Hand"},{emoji:"โœ‹",title:"Stop Hand"},{emoji:"๐Ÿคš",title:"Raised Backhand"},{emoji:"๐Ÿคฒ",title:"Palms Up Together"},{emoji:"๐Ÿ‘",title:"Open Hands"},{emoji:"๐Ÿ™Œ",title:"Raising Hands"},{emoji:"๐Ÿ™‹",title:"Person Raising Hand"},{emoji:"๐Ÿ™‹โ€โ™‚๏ธ",title:"Man Raising Hand"},{emoji:"๐Ÿ™‹โ€โ™€๏ธ",title:"Woman Raising Hand"},{emoji:"๐Ÿ‘ˆ",title:"Backhand Index Pointing Left"},{emoji:"๐Ÿ‘‰",title:"Backhand Index Pointing Right"},{emoji:"๐Ÿ‘†",title:"Backhand Index Pointing Up"},{emoji:"๐Ÿ‘‡",title:"Backhand Index Pointing Down"},{emoji:"๐Ÿคš",title:"Raised Backhand"},{emoji:"๐Ÿ––",title:"Vulcan Salute"},{emoji:"๐Ÿคœ",title:"Right-Facing Fist"},{emoji:"๐Ÿค›",title:"Left-Facing Fist"},{emoji:"๐Ÿ–",title:"Five Fingers Raised"},{emoji:"๐Ÿ––",title:"Vulcan Salute"},{emoji:"โœ‹๐Ÿผ",title:"Stop Hand Light Skin Tone"},{emoji:"โœ‹๐Ÿฝ",title:"Stop Hand Medium Skin Tone"},{emoji:"โœ‹๐Ÿพ",title:"Stop Hand Medium-Dark Skin Tone"},{emoji:"โœ‹๐Ÿฟ",title:"Stop Hand Dark Skin Tone"},{emoji:"๐Ÿ‘Œ๐Ÿผ",title:"OK Hand Light Skin Tone"},{emoji:"๐Ÿ‘Œ๐Ÿฝ",title:"OK Hand Medium Skin Tone"},{emoji:"๐Ÿ‘Œ๐Ÿพ",title:"OK Hand Medium-Dark Skin Tone"},{emoji:"๐Ÿ‘Œ๐Ÿฟ",title:"OK Hand Dark Skin Tone"},{emoji:"๐ŸคŸ๐Ÿผ",title:"Love-You Gesture Light Skin Tone"},{emoji:"๐ŸคŸ๐Ÿฝ",title:"Love-You Gesture Medium Skin Tone"},{emoji:"๐ŸคŸ๐Ÿพ",title:"Love-You Gesture Medium-Dark Skin Tone"},{emoji:"๐ŸคŸ๐Ÿฟ",title:"Love-You Gesture Dark Skin Tone"},{emoji:"โœ‹๐Ÿป",title:"Stop Hand Light Skin Tone"},{emoji:"๐Ÿ‘‹๐Ÿป",title:"Waving Hand Light Skin Tone"},{emoji:"๐Ÿ‘‹๐Ÿผ",title:"Waving Hand Medium-Light Skin Tone"},{emoji:"๐Ÿ‘‹๐Ÿฝ",title:"Waving Hand Medium Skin Tone"},{emoji:"๐Ÿ‘‹๐Ÿพ",title:"Waving Hand Medium-Dark Skin Tone"},{emoji:"๐Ÿ‘‹๐Ÿฟ",title:"Waving Hand Dark Skin Tone"},{emoji:"๐Ÿ–๐Ÿป",title:"Raised Hand Light Skin Tone"},{emoji:"๐Ÿ–๐Ÿผ",title:"Raised Hand Medium-Light Skin Tone"},{emoji:"๐Ÿ–๐Ÿฝ",title:"Raised Hand Medium Skin Tone"},{emoji:"๐Ÿคฒ๐Ÿพ",title:"Palms Up Together Medium-Dark Skin Tone"},{emoji:"๐Ÿคฒ๐Ÿฟ",title:"Palms Up Together Dark Skin Tone"}]};let s="General";const d={General:"๐Ÿ’ก",Productivity:"โœ…",Motivation:"๐ŸŽฏ","Smile Faces":"๐Ÿ˜€",People:"๐Ÿ‘จโ€๐Ÿ’ป","Food & Drink":"๐ŸŽ",Symbols:"โœจ",Flags:"๐Ÿณ๏ธ",Gestures:"๐Ÿ‘"};function c(e){s=e;const a=r.querySelector(".active");a&&a.classList.remove("active"),r.querySelector(`[title='${e}']`).classList.add("active"),function(e){n.innerHTML="",l[e].forEach((e=>{const a=document.createElement("div");a.classList.add("option"),a.innerHTML=`<span title="${e.title}" class='emoji'>${e.emoji}</span>`,a.addEventListener("click",(function(){o.setAttribute("value",e.emoji),i.style.display="none",t(e.emoji,e.title)})),n.appendChild(a)}))}(e)}const m=a.offset(e);i.style.left=m.left+"px",i.style.top=m.top-a.$.editableElement.scrollTop+e.offsetHeight+5+"px",i.style.display="block",setTimeout((()=>{a._adjustPopupBounds(i)}),100),r.innerHTML="",Object.keys(l).forEach((e=>{const t=document.createElement("div");t.classList.add("tab"),t.innerHTML=`${d[e]}`,t.setAttribute("title",e),t.addEventListener("click",(()=>c(e))),r.appendChild(t)})),c(s)}_createDatePopup(e,t){const a=this;a._datePopup&&a._datePopup.remove();const o=document.createElement("div");a._datePopup=o,o.classList.add("dropdown","smart-editor-date-popup"),o.innerHTML="\n ";const i=o;document.body.appendChild(o);const n=a.offset(e);i.style.left=n.left+"px",i.style.top=n.top-a.$.editableElement.scrollTop+e.offsetHeight+5+"px",i.style.display="block",setTimeout((()=>{a._adjustPopupBounds(i)}),100);const r=document.createElement("smart-calendar");r.onchange=e=>{t(e.detail.value)},i.appendChild(r)}_refreshPageLabels(){let e=[...this.querySelectorAll(".smart-editor-tab")];[...this.querySelectorAll(".smart-editor-page-label")].forEach((t=>{const a=t.getAttribute("data-id");if(a){const o=parseInt(a);e[o]&&(t.textContent=e[o].textContent.trim())}}))}_setEditorValue(e,t){const a=this;if(e){if(t.innerHTML=e,a.enablePages){const t=a.pages[a.pageIndex];t&&(t.innerHTML=e)}t.whenRendered((()=>{t._initEditorBlocks(),t._refreshEditorBlockPlaceholder(),t._editorBlocks=t.$.editableElement.querySelectorAll(".smart-editor-block"),t._setSortable(),t._currentBlock=t.querySelector(".smart-editor-block"),a._refreshTasks();const e=document.createRange(),o=window.getSelection();t.$.editableElement.lastChild&&(e.setStartAfter(t.$.editableElement.lastChild),e.collapse(!0),o.removeAllRanges(),o.addRange(e)),a._refreshPageLabels()}))}else t.whenRendered((()=>{t.value||t._createEditorBlock(!1,!1,"&nbsp;")}))}_createAIPopup(e,t,a){const o=this;o._aiPopup&&o._aiPopup.remove();const i=document.createElement("div");o._aiPopup=i,i.classList.add("dropdown","smart-editor-ai-popup"),i.innerHTML="\n ";const n=i;document.body.appendChild(i);const r=o.offset(e);n.style.left=r.left+"px",n.style.top=r.top-o.$.editableElement.scrollTop+e.offsetHeight+5+"px",n.style.display="block";let l=[{label:"Outline",value:"Generate an outline about"},{label:"Email",value:"Write an email about"},{label:"Meeting Agenda",value:"Create a meeting agenda for"},{label:"Blog Post",value:"Write a blog post about"},{label:"Social Media Post",value:"Write a social media post about"},{label:"Press Release",value:"Write a press release about"},{label:"Job Description",value:"Write a job description for"},{label:"Website Copy",value:"Write website copy for"}];t&&(l=[]);let s="";for(let e=0;e<l.length;e++)s+=`<button class="smart-editor-predefined-btn" data-click="${l[e].value}">${l[e].label}</button>`;n.innerHTML=` <div class="smart-editor-container">\n <span class="button-close"></span>\n <div class="smart-editor-input-container">\n <input type="text" id="userPrompt" class="smart-editor-input" placeholder="${o.localize("typePrompt")}" />\n <button class="smart-editor-submit-btn" onclick="getAIResponse()">Ask AI <span class="smart-editor-icon-arrow-up">โ†‘</span></button>\n </div>\n\n <div id="aiResult" class="smart-editor-result-box">\n \x3c!-- AI response will appear here --\x3e\n </div>\n <div id="timeoutMessage" class="smart-editor-timeout-message"></div>\n\n <div class="smart-editor-header"><span class="smart-editor-ai-icon"></span>Draft</div>\n\n \x3c!-- Predefined list buttons --\x3e\n <div class="smart-editor-predefined-container">\n ${s}\n </div>\n\n \x3c!-- Modal Popup for AI response --\x3e\n <button id="keepButton" class="smart-editor-keep-btn" onclick="keepResponse()">${o.localize("keep")}</button>\n <button id="replaceButton" class="smart-editor-replace-btn secondary" onclick="keepResponse()">${o.localize("replace")}</button>\n </div>`;const d=n.querySelector("#userPrompt"),c=n.querySelector("#aiResult"),m=n.querySelector("#timeoutMessage"),u=n.querySelector(".smart-editor-submit-btn"),p=document.querySelector("#keepButton"),b=document.querySelector("#replaceButton"),h=n.querySelector(".smart-editor-header"),g=n.querySelector(".button-close"),f=(()=>{let e=window.getSelection();return e.rangeCount?e.getRangeAt(0).toString():""})();if(t){h.classList.add("smart-hidden"),d.parentElement.classList.add("smart-hidden"),d.value='"'+f+'"',p.textContent=o.localize("insertBelow");const e=[{label:o.localize("editSelection","Edit Selection"),value:"category"},{label:o.localize("rewrite","Rewrite"),value:"rewrite",description:o.localize("rewriteDescription","Rewrite the selected text")},{label:o.localize("continueWriting","Continue writing"),value:"continue_writing",description:o.localize("continueWritingDescription","Extend the content further")},{label:o.localize("fixSpellingGrammar","Fix spelling & grammar"),value:"fix_spelling_grammar",description:o.localize("fixSpellingGrammarDescription","Correct spelling and grammatical errors")},{label:o.localize("summarize","Summarize"),value:"summarize",description:o.localize("summarizeDescription","Generate a concise summary of the text")},{label:o.localize("makeShorter","Make shorter"),value:"make_shorter",description:o.localize("makeShorterDescription","Reduce the length of the text while maintaining meaning")},{label:o.localize("makeLonger","Make longer"),value:"make_longer",description:o.localize("makeLongerDescription","Expand the text with more details")},{label:o.localize("explain","Explain"),value:"explain",d