(()=>{"use strict";var t={};function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,M=Array(e);n<e;n++)M[n]=t[n];return M}t.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},t.d=(e,n)=>{for(var M in n)t.o(n,M)&&!t.o(e,M)&&Object.defineProperty(e,M,{enumerable:!0,get:n[M]})},t.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);const n=window.tinymce;var M=t.n(n),u=function(t){return Object.keys(t).map((function(e){return{text:t[Number(e)],value:e}}))},i=function(t,e){return{text:e.getLang("code_snippets.insert_source_menu"),onclick:function(){t.windowManager.open({title:e.getLang("code_snippets.insert_source_title"),body:[{type:"listbox",name:"id",label:e.getLang("code_snippets.snippet_label"),values:u(e.getLang("code_snippets.all_snippets"))},{type:"checkbox",name:"line_numbers",label:e.getLang("code_snippets.show_line_numbers_label")}],onsubmit:function(e){var n=parseInt(e.data.id,10);if(n){var M="";e.data.line_numbers&&(M+=" line_numbers=true"),t.insertContent("[code_snippet_source id=".concat(n).concat(M,"]"))}}},{})}}},r=function(t,n){return{text:n.getLang("code_snippets.insert_content_menu"),onclick:function(){t.windowManager.open({title:n.getLang("code_snippets.insert_content_title"),body:[{type:"listbox",name:"id",label:n.getLang("code_snippets.snippet_label"),values:u(n.getLang("code_snippets.content_snippets"))},{type:"checkbox",name:"php",label:n.getLang("code_snippets.php_att_label")},{type:"checkbox",name:"format",label:n.getLang("code_snippets.format_att_label")},{type:"checkbox",name:"shortcodes",label:n.getLang("code_snippets.shortcodes_att_label")}],onsubmit:function(n){var M,u,i=parseInt(n.data.id,10);if(i){for(var r="",a=0,o=Object.entries(n.data);a<o.length;a++){var g=(M=o[a],u=2,function(t){if(Array.isArray(t))return t}(M)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var M,u,i,r,a=[],o=!0,g=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;o=!1}else for(;!(o=(M=i.call(n)).done)&&(a.push(M.value),a.length!==e);o=!0);}catch(t){g=!0,u=t}finally{try{if(!o&&null!=n.return&&(r=n.return(),Object(r)!==r))return}finally{if(g)throw u}}return a}}(M,u)||function(t,n){if(t){if("string"==typeof t)return e(t,n);var M={}.toString.call(t).slice(8,-1);return"Object"===M&&t.constructor&&(M=t.constructor.name),"Map"===M||"Set"===M?Array.from(t):"Arguments"===M||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(M)?e(t,n):void 0}}(M,u)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),c=g[0],A=g[1];"id"!==c&&A&&(r+=" ".concat(c,"=").concat(A))}t.insertContent("[code_snippet id=".concat(i).concat(r,"]"))}}},{})}}};M().PluginManager.add("code_snippets",(function(t){var e=M().activeEditor;t.addButton("code_snippets",{type:"menubutton",title:"Code Snippets",image:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCAyNiAyNSI+PHBhdGggZmlsbD0iIzUxNTc1ZiIgZD0iTTYuMTI3IDExLjk2NmgzLjQxNGEuOTEuOTEgMCAwIDEgLjg0NC41NjMuOTMuOTMgMCAwIDEtLjE4NSAxLjAwNGwuMDA1LjAxLTIuMzM4IDIuMzU1YTQuMTkgNC4xOSAwIDAgMCAwIDUuODg1QTQuMTEgNC4xMSAwIDAgMCAxMC43ODQgMjNhNC4xMSA0LjExIDAgMCAwIDIuOTE3LTEuMjE3IDQuMiA0LjIgMCAwIDAgMS4wNDgtMS44MDIgNC4yIDQuMiAwIDAgMC0uOTE1LTMuOTQgNC4xIDQuMSAwIDAgMC0xLjczMi0xLjE0NWwuNjE0LS42MTloNy44NDZjMS44NyAwIDMuMzkxLTEuNjA0IDMuNDM2LTMuNjA2IDAtLjAzMy4wMDQtLjA2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