(()=>{function e(e){if(e.target.src)throw new URIError("The script "+e.target.src+" didn't load correctly.");if(e.target.href)throw new URIError("The style "+e.target.href+" didn't load correctly.")}function t(e){e.target.src&&console.info("The script "+e.target.src+" loaded."),e.target.href&&console.info("The style "+e.target.href+" loaded.")}function r(r){let o=document.createElement("script");o.onerror=e,o.onload=t,r.differ&&(o.defer=!0),r.async&&(o.async=!0),o.type="text/javascript",o.src=r.dir+r.js,document.body.appendChild(o)}function o(r){let o=document.createElement("link");o.onerror=e,o.onload=t,o.rel="stylesheet",document.head.appendChild(o),o.href=r.dir+r.css}void 0===window.wpcm&&(window.wpcm={}),void 0===window.wpcm.codeEditor&&(window.wpcm.codeEditor={}),assets=wpcm.assets,document.addEventListener("DOMContentLoaded",(function(e){console.log("doc ready"),(document.querySelectorAll(".code-block > pre.CodeMirror").length>0||"admin"==wpcm.view)&&function(e){for(let t=0;t pre.CodeMirror");e.addNotice();for(let o=0;o{s.setOption("styleActiveLine",!1)})),s.on("focus",(e=>{s.setOption("styleActiveLine",i.styleActiveLine)}))),t.autoLoadMode(s,i.mode),!0===i.showPanel&&e.panelOptions.showPanel&&(s.getWrapperElement().querySelector(".CodeMirror-simplescroll-vertical"),e.addPanel(s,i)),e.editors.push(s);let r=new CustomEvent("wpcm_editor_loaded",{detail:s});document.dispatchEvent(r)},e.addNotice=function(){const e=document.createElement("div");e.className="CodeMirror-notice",document.body.appendChild(e)},e.showNotice=function(e,t){const o=document.querySelector(".CodeMirror-notice");o.innerHTML=e,o.setAttribute("style","bottom: 15px"),setTimeout((()=>{o.removeAttribute("style")}),3e3)},e.addPanel=function(t,o){const n=document.createElement("div"),i=document.createElement("div"),d=document.createElement("div"),s=document.createElement("span"),r=t.getWrapperElement();if(n.className="CodeMirror-panel",i.className="info-panel",e.editorOptions.maxHeight&&i.classList.add("max-height"),d.className="control-panel","no"!==o.languageLabel&&(s.textContent=o?.fileName?o.fileName:o.language,s.className="language "+o.modeName.toLowerCase()),i.appendChild(s),window.wpcm.panelOptions.runButton&&e.executableModes.includes(o.mode)){let t=document.createElement("span"),o=document.createElement("b");t.classList="tool",t.setAttribute("data-tip","Execute Code"),o.className="run-code execute-code",t.onclick=e.executeCode,t.appendChild(o),d.appendChild(t)}if(window.wpcm.panelOptions.fullScreenButton){const t=document.createElement("span"),o=document.createElement("b");t.classList="tool",t.setAttribute("data-tip","Full Screen"),o.className="fullscreen maximize",o.onclick=e.setFullScreen,t.appendChild(o),d.appendChild(t)}if(window.wpcm.panelOptions.copyButton&&!o.disableCopy){const t=document.createElement("span"),o=document.createElement("b");t.classList="tool",t.setAttribute("data-tip","Copy Code"),o.className="copy",o.onclick=e.copyToClipboard,t.appendChild(o),d.appendChild(t)}i.appendChild(d),n.appendChild(i),r.insertBefore(n,r.firstChild)},e.setFullScreen=function(){const t=this,o=t.closest(".code-block").id,n=e.editors[o],i=document.getElementById("wpadminbar"),d=t.closest(".CodeMirror");t.classList.contains("maximize")?(t.classList.remove("maximize"),t.classList.add("restore"),d.classList.add("CodeMirror-fullscreen"),void 0!==i&&null!=i&&t.closest(".CodeMirror").style.setProperty("top",`${i.clientHeight}px`),e.editorOptions.maxHeight&&(d.style.removeProperty("height"),d.style.setProperty("padding-bottom","2rem")),document.documentElement.style.setProperty("overflow","hidden")):(t.classList.remove("restore"),t.classList.add("maximize"),d.classList.remove("CodeMirror-fullscreen"),d.style.removeProperty("top"),document.documentElement.style.removeProperty("overflow"),e.editorOptions.maxHeight?d.style.setProperty("height",e.editorOptions.maxHeight):d.style.removeProperty("padding-bottom")),n.refresh()},e.copyToClipboard=function(){const t=this.closest(".code-block").id,o=e.editors[t].getValue();let n;if(window.clipboardData)window.clipboardData.setData("Text",o);else{const e=document.createElement("textarea");e.className="CodeMirror-ClipBoard",document.body.appendChild(e),e.appendChild(document.createTextNode(o)),e.select();try{n=document.execCommand("copy")?"Copied to clipboard":"Can not copied"}catch(e){n="Oops, unable to copy"}e.remove()}e.showNotice(n,"")}}(window.wpcm,window.CodeMirror),!1===window.wpcm.executed&&(window.wpcm.executed=!0,wpcm.frontEndInitialization()),window.addEventListener("load",(function(){console.log("window ready"),setTimeout((()=>{for(let e=0;e768){$('header nav .menu-item-has-children').hover(function(){$(this).find('ul').fadeIn('fast');},function(){$(this).find('ul').fadeOut('fast');});}} $('.search-field').attr('placeholder','');});}(jQuery));