/*! 
*  @plugin @tinymce-plugin/tp-indent2em
*  @version 0.0.1 (2022-4-21)
*  @description 首行缩进
*  @copyright (2022) Five(Li Hailong) . All rights reserved. https://github.com/tinymce-plugin/tp-indent2em
*/(function(){var r=function(e,n){return function(t){return e.selection.selectorChangedWithUnbind(n.join(","),function(g,o){t.setActive(parseInt(e.dom.getStyle(e.dom.getParent(o.node,"li,p,div"),"text-indent"))>0&&g)}).unbind}},i=function(e,n){e.undoManager.transact(function(){e.focus();for(var t=e.selection.getStart();t.nodeName!=="LI"&&t.nodeName!=="P"&&t.nodeName!=="DIV"&&t.nodeName!=="BODY";)t=t.parentNode;e.dom.getStyle(t,"text-indent")?e.execCommand("tpIndent",!1,"remove"):e.execCommand("tpIndent")})},c=function(e,n){e.ui.registry.getAll().icons[n.registryName]||e.ui.registry.addIcon(n.registryName,n.icon),e.ui.registry.addToggleButton(n.registryName,{icon:n.registryName,tooltip:n.title,onAction:function(){return i(e)},onSetup:r(e,['*[style*="text-indent"]','*[data-mce-style*="text-indent"]'])}),e.ui.registry.addMenuItem(n.registryName,{icon:n.registryName,text:n.title,onAction:function(){return i(e)}})},u=function(e,n){e.addCommand("mce".concat(n.registryName.substring(0,1).toUpperCase()+n.registryName.substring(1)),function(){i(e)})},s=function(e){tinymce.PluginManager.add(e.registryName,function(n,t){return c(n,e),u(n,e),{getMetadata:function(){return{name:e.name,url:e.repo}}}})},a={name:"Indent2em",registryName:"tpIndent2em",title:"First line indent",repo:"https://github.com/tinymce-plugin/tp-indent2em",icon:'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="24" height="24"><path d="M170.666667 563.2v-102.4H887.466667v102.4zM170.666667 836.266667v-102.4H887.466667v102.4zM512 290.133333v-102.4H887.466667v102.4zM238.933333 341.333333V136.533333l204.8 102.4z"  p-id="5210"></path></svg>'};s(a);var m={opt:a};return m})();
