smart-webcomponents-react
Version:
[](https://jqwidgets.com/license/)
6 lines (4 loc) โข 315 kB
JavaScript
/* 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=" ";else{const e=e=>{let t=e.replace(/\\"/g,'"');return t=t.replace(/\\+/g,""),t=t.replace(/ /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," ")}))}_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