/**
  * @copyright  (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
  * @license    GNU General Public License version 2 or later; see LICENSE.txt
  */window.parent.JoomlaExpectingPostMessage||(document.querySelectorAll(".js-module-insert").forEach(e=>{e.addEventListener("click",o=>{o.preventDefault();const a=o.target.getAttribute("data-module"),t=o.target.getAttribute("data-editor");window.parent.Joomla&&window.parent.Joomla.editors&&window.parent.Joomla.editors.instances&&Object.prototype.hasOwnProperty.call(window.parent.Joomla.editors.instances,t)&&window.parent.Joomla.editors.instances[t].replaceSelection(`{loadmoduleid ${a}}`),window.parent.Joomla.Modal&&window.parent.Joomla.Modal.getCurrent().close()})}),document.querySelectorAll(".js-position-insert").forEach(e=>{e.addEventListener("click",o=>{o.preventDefault();const a=o.target.getAttribute("data-position"),t=o.target.getAttribute("data-editor");window.Joomla&&window.Joomla.editors&&Joomla.editors.instances&&Object.prototype.hasOwnProperty.call(window.parent.Joomla.editors.instances,t)&&window.parent.Joomla.editors.instances[t].replaceSelection(`{loadposition ${a}}`),window.parent.Joomla.Modal&&window.parent.Joomla.Modal.getCurrent().close()})}));
