mooHP Framework PHP Que Utiliza La Sintaxis de MooTools

mooHP Framework PHP Que Utiliza La Sintaxis de MooTools

Suena un poco extraña la combinación pero supongo a los que utilizan mootools les agradará y les parecerá algo familiar. mooHP es un framework en PHP que utiliza la sintaxis del framework javascript mooTools. Funciona en PHP 5.2.1 y superiores.

Ejemplo de mooHP:



loadFile(“base.html”);

//Gets element by css selector and sets it’s HTML content.
$t->SE(“body”)->setHTML(“”);

//Selected ellement: body adopts new element
$t->SE(“body”)->adopt( $t->element(“div”, array(“id”=>”header”) ,”Hello world!”) );

//Body adopts
$t->SE(“body”)->newLine();

$picked = “”;
if (isset( $_GET[“cd”] )) {
$picked = ” you have selected #”.$_GET[“cd”];
}

//Body adopts new element div: with assigned properties as second argument and text as content;
$t->SE(“body”)->adopt( $t->element(“div”, array(“style”=>”margin:10px; padding:10px; border:1px solid #444;”), “Counting down:”.$picked) );

// $select = new Element()
$select = $t->element(“select”, array(“name”=>”cd”), “”);

//Body adopts new element of type form
$t->SE(“body”)->adopt( $t->element(“form”, array(“id”=>”newForm”,”method”=>”get”) ) );
//Selects new element by ID and adopts previously defined element $select
$t->S(“newForm”)->adopt( $select );
// #newForm adopts new Element input
$t->S(“newForm”)->adopt( $t->element(“input”, array(“type”=>”submit”, “value”=>”CLICK!”) ) );

for ($i=1; $i<=20; $i++) { //$newOption is new option element $newOption = $t->element(“option”, array(“value”=>$i), “Count down: ” . $i );
//$select adopt as it’s first child the $newOption element
$select->adoptTop( $newOption );
if ( isset($_GET[“cd”]) && $_GET[“cd”] == $i ) {
//Setting an attribute to an element
$newOption->setProperty(“selected”,”selected”);
}
}

//Body accepts new style rules
$t->SE(“body”)->setStyle(“margin”,”10px”);

//Body adopts
$t->SE(“body”)->newLine();

//Appending text to the body
$t->SE(“body”)->appendText(“and here comes the appended text”);

//Body is adopting the inc.html contents
$t->SE(“body”)->adopt( $t->includeFile(“inc.html”) );

if (!isset( $_GET[“cd”] )) {
//Make simple alert with javascript
$t->alert(“Hello and welcome to mooHP”);
}

//Setting the tah innerHTML<br /> $t->setPageTitle(“..:: Hello and welcome to mooHP ::..”);</p><p>//Creating new instance of the css class<br /> $newCss = new css();<br /> //Setting rule in css<br /> $newCss->setStyle(“color”,”#ff9900″);<br /> //Setting rules in css<br /> $newCss->setStyles(array(“font-weight”=>”bold”,”font-size”=>”24px” ));<br /> //Writing the defined css to element<br /> $newCss->writeToElement( $t->S(“header”) );</p><p>//Creating new instance of the css class<br /> $newCss2 = new css();<br /> //Setting rule in css<br /> $newCss2->setStyle(“border”,”10px solid #DDD”);<br /> //Setting rule in css<br /> $newCss2->setStyle(“padding”,”10px”);<br /> //Writing the defined css as #newForm selector in $t dom instance<br /> $newCss2->writeToDom(“#newForm”, $t);</p><p>//Writing the page if true is passed as argument the page will be compresed<br /> $t->writePage(true);</p><p>?><br /> [/code]</p><p>– <span class="removed_link" title="http://www.devpartment.com/testdrive/mooHP/">Demo mooHP</span></p><p>– <span class="removed_link" title="http://www.devpartment.com/testdrive/mooHP/mooHP.zip">Descargar mooHP</span></p><p>– <span class="removed_link" title="http://www.devpartment.com/posts/mootools-php-moohp/">Mas información</span></p><p>Vía: <a href="http://www.dzone.com/links/rss/mootools_php_moohp.html" target="_blank" rel="nofollow">Dzone</a></p></div><aside class="entry-grid__sidebar d-none d-lg-block"><div id="sidebar" class="sticky-top sticky-header sticky-ad"><div id="Brid_70374669" class="brid" ></div> <script type="pmdelayedscript" data-perfmatters-type="text/javascript" data-cfasync="false" data-no-optimize="1" data-no-defer="1" data-no-minify="1">var _bos = _bos||[]; _bos.push({ "div": "Brid_70374669", "obj": {"id":"27194","width":"300","height":"250"} });</script> <script type="pmdelayedscript" async src="https://services.brid.tv/player/build/brid.outstream.min.js" data-perfmatters-type="text/javascript" data-cfasync="false" data-no-optimize="1" data-no-defer="1" data-no-minify="1"></script> <div class="ad-container dfp-ad-unit ad-custom ad-boxbanner" id="ros-box-a-6574842e10f5d" data-ad-type="custom" data-slot="ros-box-a" data-ad-setup='{"postID":1601,"css":"ad-boxbanner","canRefresh":true,"mappings":{"sizes":[[300,250],[300,600]],"desktop":[[300,250],[300,600]],"mobile":[],"all":[]},"infinitescroll":false}' data-ad-loaded="0"></div></div></aside></div><footer class="my-5"><div class="ad-container dfp-ad-unit ad-billboardboxmobile ad-superbanner" id="ros-top-b-6574842e10f6e" data-ad-type="billboardboxmobile" data-slot="ros-top-b" data-ad-setup='{"postID":1601,"css":"ad-superbanner","canRefresh":true,"mappings":[],"infinitescroll":false}' data-ad-loaded="0"></div></footer></article></section></main><footer id="footer" class="footer py-4"><div class="container-fluid"><div class="footer__wrapper"><div class="footer__logo"> <a href="/"><img class="img-footer perfmatters-lazy" src="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='127'%20height='75'%20viewBox='0%200%20127%2075'%3E%3C/svg%3E" alt="WebAdictos" width="127" height="75" data-src="https://webadictos.com/wp-content/themes/webadictos-theme/assets/images/webadictos-logo-2021-white.svg" /><noscript><img class="img-footer" src="https://webadictos.com/wp-content/themes/webadictos-theme/assets/images/webadictos-logo-2021-white.svg" alt="WebAdictos" loading="lazy" width="127" height="75"></noscript></a></div><div class="footer__social-icons"><ul class='social-media-icons'><li> <a class="social-icon-facebook" target="_blank" href="https://www.facebook.com/WebAdictos" rel="noopener noreferrer"> <span class="fa-stack fa-2x"> <i class="fas fa-circle fa-stack-2x"></i> <i class="fab fa-facebook-f fa-social-icon fa-inverse fa-stack-1x" title="facebook icon"></i> </span> </a></li><li> <a class="social-icon-instagram" target="_blank" href="https://www.instagram.com/webadictos/" rel="noopener noreferrer"> <span class="fa-stack fa-2x"> <i class="fas fa-circle fa-stack-2x"></i> <i class="fab fa-instagram fa-social-icon fa-inverse fa-stack-1x" title="instagram icon"></i> </span> </a></li><li> <a class="social-icon-twitter" target="_blank" href="https://twitter.com/WebAdictos" rel="noopener noreferrer"> <span class="fa-stack fa-2x"> <i class="fas fa-circle fa-stack-2x"></i> <i class="fab fa-twitter fa-social-icon fa-inverse fa-stack-1x" title="twitter icon"></i> </span> </a></li><li> <a class="social-icon-pinterest" target="_blank" href="https://www.pinterest.com/webadictosmx/" rel="noopener noreferrer"> <span class="fa-stack fa-2x"> <i class="fas fa-circle fa-stack-2x"></i> <i class="fab fa-pinterest fa-social-icon fa-inverse fa-stack-1x" title="pinterest icon"></i> </span> </a></li><li> <a class="social-icon-youtube" target="_blank" href="https://www.youtube.com/user/WebAdictosTV" rel="noopener noreferrer"> <span class="fa-stack fa-2x"> <i class="fas fa-circle fa-stack-2x"></i> <i class="fab fa-youtube fa-social-icon fa-inverse fa-stack-1x" title="youtube icon"></i> </span> </a></li><li> <a class="social-icon-linkedin" target="_blank" href="https://www.linkedin.com/company/webadictos" rel="noopener noreferrer"> <span class="fa-stack fa-2x"> <i class="fas fa-circle fa-stack-2x"></i> <i class="fab fa-linkedin fa-social-icon fa-inverse fa-stack-1x" title="linkedin icon"></i> </span> </a></li></ul></div><nav id="footer-nav" class="footer__nav"><ul id="menu-footer" class="menu"><li class="menu-item menu-item-type-post_type menu-item-object-page nav-item"><a href="https://webadictos.com/acerca-de/" class="nav-link">Acerca de WebAdictos</a></li><li class="menu-item menu-item-type-post_type menu-item-object-page nav-item"><a href="https://webadictos.com/contacto/" class="nav-link">Contacto</a></li><li class="menu-item menu-item-type-post_type menu-item-object-page nav-item"><a href="https://webadictos.com/publicidad/" class="nav-link">Publicidad</a></li><li class="menu-item menu-item-type-post_type menu-item-object-page nav-item"><a href="https://webadictos.com/politica-de-privacidad/" class="nav-link">Política de Privacidad</a></li></ul></nav><div class="footer__logos"><ul><li> <a href="https://pinit.media"><img src="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='100'%20height='24'%20viewBox='0%200%20100%2024'%3E%3C/svg%3E" alt="Pinit Media" width="100" height="24" class="perfmatters-lazy" data-src="https://webadictos.com/wp-content/themes/webadictos-theme/assets/images/pinit-logo.png" /><noscript><img src="https://webadictos.com/wp-content/themes/webadictos-theme/assets/images/pinit-logo.png" alt="Pinit Media" width="100" height="24" loading="lazy"></noscript></a></li></ul></div><div class="footer__privacy"><p>© WEBADICTOS S.A DE C.V</p></div></div></div></footer></div><div class="ad-footer-container"> <button class="ad-footer-close" onclick="document.querySelector('.ad-footer-container').remove();">Cerrar</button><div class="ad-container dfp-ad-unit ad-custom ad-footer" id="ros-footer-6574842e118c0" data-ad-type="custom" data-slot="ros-footer" data-ad-setup='{"postID":1601,"css":"ad-footer","canRefresh":"true","mappings":{"sizes":[[970,90],[728,90],[320,50],[320,100]],"desktop":[[728,90],[970,90]],"mobile":[[320,50],[320,100]],"all":[]},"infinitescroll":false}' data-ad-loaded="0"></div></div><div id="search" class="hotbook-overlay"> <button type="button" class="close">×</button><div class="container h-100"><div class="d-flex flex-column justify-content-center align-items-center h-100"><form role="search" method="get" class="search-form w-100" action="https://webadictos.com/"><div class="search-wrapper position-relative"> <input type="search" id="searchoverlay" name="s" value="" placeholder="Escribe lo que deseas buscar y presiona enter..." autocomplete="off" /></div></form></div></div></div><div class="modal left fade modal-menu" id="menu-left" tabindex="-1" role="dialog" aria-labelledby="menu-left"><div class="modal-dialog" role="document"><div class="modal-content"><div class="modal-header justify-content-end"> <button type="button" class="close m-0 p-0" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button></div><div class="modal-body p-0"><nav class="navbar h-100 p-0"><div id="main-left-nav" class="collapse show navbar-collapse justify-content-end mb-auto"><ul id="menu-mobile" class="navbar-nav"><li itemscope="itemscope" itemtype="https://www.schema.org/SiteNavigationElement" id="menu-item-164539" class="menu-item menu-item-type-taxonomy menu-item-object-category current-post-ancestor current-menu-parent current-post-parent nav-item menu-item-164539 category-tecnologia active"><a data-category-id="487" aria-current="page" title="Tecnología" href="https://webadictos.com/tecnologia/" class="nav-link">Tecnología</a></li><li itemscope="itemscope" itemtype="https://www.schema.org/SiteNavigationElement" id="menu-item-164536" class="menu-item menu-item-type-taxonomy menu-item-object-category nav-item menu-item-164536 category-entretenimiento"><a data-category-id="30444" title="Entretenimiento" href="https://webadictos.com/entretenimiento/" class="nav-link">Entretenimiento</a></li><li itemscope="itemscope" itemtype="https://www.schema.org/SiteNavigationElement" id="menu-item-164535" class="menu-item menu-item-type-taxonomy menu-item-object-category nav-item menu-item-164535 category-deportes"><a data-category-id="3926" title="Deportes" href="https://webadictos.com/deportes/" class="nav-link">Deportes</a></li><li itemscope="itemscope" itemtype="https://www.schema.org/SiteNavigationElement" id="menu-item-164538" class="menu-item menu-item-type-taxonomy menu-item-object-category nav-item menu-item-164538 category-sobre-ruedas"><a data-category-id="76578" title="Sobre Ruedas" href="https://webadictos.com/sobre-ruedas/" class="nav-link">Sobre Ruedas</a></li><li itemscope="itemscope" itemtype="https://www.schema.org/SiteNavigationElement" id="menu-item-164537" class="menu-item menu-item-type-taxonomy menu-item-object-category nav-item menu-item-164537 category-juegos"><a data-category-id="31" title="Gaming" href="https://webadictos.com/juegos/" class="nav-link">Gaming</a></li></ul></div><div class="navbar-text w-100 py-5 mt-auto menu-left-social"><h3>Síguenos</h3><ul class='social-media-icons'><li> <a class="social-icon-facebook" target="_blank" href="https://www.facebook.com/WebAdictos" rel="noopener noreferrer"> <span class="fa-stack fa-2x"> <i class="fas fa-circle fa-stack-2x"></i> <i class="fab fa-facebook-f fa-social-icon fa-stack-1x" title="facebook icon"></i> </span> </a></li><li> <a class="social-icon-instagram" target="_blank" href="https://www.instagram.com/webadictos/" rel="noopener noreferrer"> <span class="fa-stack fa-2x"> <i class="fas fa-circle fa-stack-2x"></i> <i class="fab fa-instagram fa-social-icon fa-stack-1x" title="instagram icon"></i> </span> </a></li><li> <a class="social-icon-twitter" target="_blank" href="https://twitter.com/WebAdictos" rel="noopener noreferrer"> <span class="fa-stack fa-2x"> <i class="fas fa-circle fa-stack-2x"></i> <i class="fab fa-twitter fa-social-icon fa-stack-1x" title="twitter icon"></i> </span> </a></li><li> <a class="social-icon-pinterest" target="_blank" href="https://www.pinterest.com/webadictosmx/" rel="noopener noreferrer"> <span class="fa-stack fa-2x"> <i class="fas fa-circle fa-stack-2x"></i> <i class="fab fa-pinterest fa-social-icon fa-stack-1x" title="pinterest icon"></i> </span> </a></li><li> <a class="social-icon-youtube" target="_blank" href="https://www.youtube.com/user/WebAdictosTV" rel="noopener noreferrer"> <span class="fa-stack fa-2x"> <i class="fas fa-circle fa-stack-2x"></i> <i class="fab fa-youtube fa-social-icon fa-stack-1x" title="youtube icon"></i> </span> </a></li><li> <a class="social-icon-linkedin" target="_blank" href="https://www.linkedin.com/company/webadictos" rel="noopener noreferrer"> <span class="fa-stack fa-2x"> <i class="fas fa-circle fa-stack-2x"></i> <i class="fab fa-linkedin fa-social-icon fa-stack-1x" title="linkedin icon"></i> </span> </a></li></ul></div></nav></div></div></div></div> <script type="module">import { Workbox } from "https:\/\/webadictos.com\/wp-content\/plugins\/pwa\/wp-includes\/js\/workbox-v6.5.3\/workbox-window.prod.js"; if ( 'serviceWorker' in navigator ) { window.wp = window.wp || {}; window.wp.serviceWorkerWindow = new Workbox( "https:\/\/webadictos.com\/wp.serviceworker", {"scope":"\/"} ); window.wp.serviceWorkerWindow.register(); }</script> <script src="https://webadictos.com/wp-content/cache/autoptimize/js/autoptimize_single_328b8123661abdd5f4a0c695e7aa9dcc.js?minify=false&ver=132249e245926ae3e188" id="jetpack-photon-js" type="pmdelayedscript" data-cfasync="false" data-no-optimize="1" data-no-defer="1" data-no-minify="1"></script> <script id="swcfpc_auto_prefetch_url-js-before" type="pmdelayedscript" data-cfasync="false" data-no-optimize="1" data-no-defer="1" data-no-minify="1">function swcfpc_wildcard_check(str, rule) { let escapeRegex = (str) => str.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1"); return new RegExp("^" + rule.split("*").map(escapeRegex).join(".*") + "$").test(str); } function swcfpc_can_url_be_prefetched(href) { if( href.length == 0 ) return false; if( href.startsWith("mailto:") ) return false; if( href.startsWith("https://") ) href = href.split("https://"+location.host)[1]; else if( href.startsWith("http://") ) href = href.split("http://"+location.host)[1]; for( let i=0; i < swcfpc_prefetch_urls_to_exclude.length; i++) { if( swcfpc_wildcard_check(href, swcfpc_prefetch_urls_to_exclude[i]) ) return false; } return true; } let swcfpc_prefetch_urls_to_exclude = '["\/*ao_noptirocket*","\/*jetpack=comms*","\/*kinsta-monitor*","*ao_speedup_cachebuster*","\/*removed_item*","\/my-account*","\/wc-api\/*","\/edd-api\/*","\/wp-json*"]'; swcfpc_prefetch_urls_to_exclude = (swcfpc_prefetch_urls_to_exclude) ? JSON.parse(swcfpc_prefetch_urls_to_exclude) : [];</script> <script src="https://webadictos.com/wp-content/cache/autoptimize/js/autoptimize_single_a97e104b61c420c73cd80fed9e573e8b.js?ver=0.81627900%201702134829" id="mainjs-js" type="pmdelayedscript" data-cfasync="false" data-no-optimize="1" data-no-defer="1" data-no-minify="1"></script> <script id="perfmatters-lazy-load-js-before">window.lazyLoadOptions={elements_selector:"img[data-src],.perfmatters-lazy,.perfmatters-lazy-css-bg",thresholds:"0px 0px",class_loading:"pmloading",class_loaded:"pmloaded",callback_loaded:function(element){if(element.tagName==="IFRAME"){if(element.classList.contains("pmloaded")){if(typeof window.jQuery!="undefined"){if(jQuery.fn.fitVids){jQuery(element).parent().fitVids()}}}}}};window.addEventListener("LazyLoad::Initialized",function(e){var lazyLoadInstance=e.detail.instance;var target=document.querySelector("body");var observer=new MutationObserver(function(mutations){lazyLoadInstance.update()});var config={childList:!0,subtree:!0};observer.observe(target,config);});</script> <script async src="https://webadictos.com/wp-content/plugins/perfmatters/js/lazyload.min.js?ver=2.2.0" id="perfmatters-lazy-load-js"></script> <script defer src="https://stats.wp.com/e-202349.js" id="jetpack-stats-js" type="pmdelayedscript" data-cfasync="false" data-no-optimize="1" data-no-defer="1" data-no-minify="1"></script> <script id="jetpack-stats-js-after" type="pmdelayedscript" data-cfasync="false" data-no-optimize="1" data-no-defer="1" data-no-minify="1">_stq = window._stq || []; _stq.push([ "view", {v:'ext',blog:'80645858',post:'1601',tz:'-6',srv:'webadictos.com',j:'1:12.9'} ]); _stq.push([ "clickTrackerInit", "80645858", "1601" ]);</script> <script async data-no-optimize="1" src="https://webadictos.com/wp-content/plugins/perfmatters/vendor/instant-page/pminstantpage.min.js?ver=2.2.0" id="perfmatters-instant-page-js" type="pmdelayedscript" data-cfasync="false" data-no-defer="1" data-no-minify="1"></script> <script id="swcfpc" type="pmdelayedscript" data-cfasync="false" data-no-optimize="1" data-no-defer="1" data-no-minify="1">const swcfpc_prefetch_urls_timestamp_server = '1702134903'; let swcfpc_prefetched_urls = localStorage.getItem("swcfpc_prefetched_urls"); swcfpc_prefetched_urls = (swcfpc_prefetched_urls) ? JSON.parse(swcfpc_prefetched_urls) : []; let swcfpc_prefetch_urls_timestamp_client = localStorage.getItem("swcfpc_prefetch_urls_timestamp_client"); if( swcfpc_prefetch_urls_timestamp_client == undefined || swcfpc_prefetch_urls_timestamp_client != swcfpc_prefetch_urls_timestamp_server ) { swcfpc_prefetch_urls_timestamp_client = swcfpc_prefetch_urls_timestamp_server; swcfpc_prefetched_urls = new Array(); localStorage.setItem("swcfpc_prefetched_urls", JSON.stringify(swcfpc_prefetched_urls)); localStorage.setItem("swcfpc_prefetch_urls_timestamp_client", swcfpc_prefetch_urls_timestamp_client); } function swcfpc_element_is_in_viewport( element ) { let bounding = element.getBoundingClientRect(); if ( bounding.top >= 0 && bounding.left >= 0 && bounding.right <= (window.innerWidth || document.documentElement.clientWidth) && bounding.bottom <= (window.innerHeight || document.documentElement.clientHeight) ) return true; return false; } function swcfpc_prefetch_urls() { let comp = new RegExp(location.host); document.querySelectorAll("a").forEach( (item) => { if( item.href ) { let href = item.href.split("#")[0]; if( swcfpc_can_url_be_prefetched(href) && swcfpc_prefetched_urls.includes(href) == false && comp.test( item.href ) && swcfpc_element_is_in_viewport(item) ) { swcfpc_prefetched_urls.push( href ); //console.log( href ); let prefetch_element = document.createElement('link'); prefetch_element.rel = "prefetch"; prefetch_element.href = href; document.getElementsByTagName('body')[0].appendChild( prefetch_element ); } } } ) localStorage.setItem("swcfpc_prefetched_urls", JSON.stringify(swcfpc_prefetched_urls)); } window.addEventListener("load", function(event) { swcfpc_prefetch_urls(); }); window.addEventListener("scroll", function(event) { swcfpc_prefetch_urls(); });</script> <div id="scrollIndicator" class="indicator"></div><script type="text/javascript" id="perfmatters-delayed-scripts-js">const pmDelayClick=true;const pmDelayTimer=setTimeout(pmTriggerDOMListener,10*1000);const pmUserInteractions=["keydown","mousedown","mousemove","wheel","touchmove","touchstart","touchend"],pmDelayedScripts={normal:[],defer:[],async:[]},jQueriesArray=[],pmInterceptedClicks=[];var pmDOMLoaded=!1,pmClickTarget="";function pmTriggerDOMListener(){"undefined"!=typeof pmDelayTimer&&clearTimeout(pmDelayTimer),pmUserInteractions.forEach(function(e){window.removeEventListener(e,pmTriggerDOMListener,{passive:!0})}),document.removeEventListener("visibilitychange",pmTriggerDOMListener),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",pmTriggerDelayedScripts):pmTriggerDelayedScripts()}async function pmTriggerDelayedScripts(){pmDelayEventListeners(),pmDelayJQueryReady(),pmProcessDocumentWrite(),pmSortDelayedScripts(),pmPreloadDelayedScripts(),await pmLoadDelayedScripts(pmDelayedScripts.normal),await pmLoadDelayedScripts(pmDelayedScripts.defer),await pmLoadDelayedScripts(pmDelayedScripts.async),await pmTriggerEventListeners(),document.querySelectorAll("link[data-pmdelayedstyle]").forEach(function(e){e.setAttribute("href",e.getAttribute("data-pmdelayedstyle"))}),window.dispatchEvent(new Event("perfmatters-allScriptsLoaded")),pmReplayClicks()}function pmDelayEventListeners(){let e={};function t(t,r){function n(r){return e[t].delayedEvents.indexOf(r)>=0?"perfmatters-"+r:r}e[t]||(e[t]={originalFunctions:{add:t.addEventListener,remove:t.removeEventListener},delayedEvents:[]},t.addEventListener=function(){arguments[0]=n(arguments[0]),e[t].originalFunctions.add.apply(t,arguments)},t.removeEventListener=function(){arguments[0]=n(arguments[0]),e[t].originalFunctions.remove.apply(t,arguments)}),e[t].delayedEvents.push(r)}function r(e,t){let r=e[t];Object.defineProperty(e,t,{get:r||function(){},set:function(r){e["perfmatters"+t]=r}})}t(document,"DOMContentLoaded"),t(window,"DOMContentLoaded"),t(window,"load"),t(window,"pageshow"),t(document,"readystatechange"),r(document,"onreadystatechange"),r(window,"onload"),r(window,"onpageshow")}function pmDelayJQueryReady(){let e=window.jQuery;Object.defineProperty(window,"jQuery",{get:()=>e,set(t){if(t&&t.fn&&!jQueriesArray.includes(t)){t.fn.ready=t.fn.init.prototype.ready=function(e){pmDOMLoaded?e.bind(document)(t):document.addEventListener("perfmatters-DOMContentLoaded",function(){e.bind(document)(t)})};let r=t.fn.on;t.fn.on=t.fn.init.prototype.on=function(){if(this[0]===window){function e(e){return e=(e=(e=e.split(" ")).map(function(e){return"load"===e||0===e.indexOf("load.")?"perfmatters-jquery-load":e})).join(" ")}"string"==typeof arguments[0]||arguments[0]instanceof String?arguments[0]=e(arguments[0]):"object"==typeof arguments[0]&&Object.keys(arguments[0]).forEach(function(t){delete Object.assign(arguments[0],{[e(t)]:arguments[0][t]})[t]})}return r.apply(this,arguments),this},jQueriesArray.push(t)}e=t}})}function pmProcessDocumentWrite(){let e=new Map;document.write=document.writeln=function(t){var r=document.currentScript,n=document.createRange();let a=e.get(r);void 0===a&&(a=r.nextSibling,e.set(r,a));var i=document.createDocumentFragment();n.setStart(i,0),i.appendChild(n.createContextualFragment(t)),r.parentElement.insertBefore(i,a)}}function pmSortDelayedScripts(){document.querySelectorAll("script[type=pmdelayedscript]").forEach(function(e){e.hasAttribute("src")?e.hasAttribute("defer")&&!1!==e.defer?pmDelayedScripts.defer.push(e):e.hasAttribute("async")&&!1!==e.async?pmDelayedScripts.async.push(e):pmDelayedScripts.normal.push(e):pmDelayedScripts.normal.push(e)})}function pmPreloadDelayedScripts(){var e=document.createDocumentFragment();[...pmDelayedScripts.normal,...pmDelayedScripts.defer,...pmDelayedScripts.async].forEach(function(t){var r=t.getAttribute("src");if(r){var n=document.createElement("link");n.href=r,n.rel="preload",n.as="script",e.appendChild(n)}}),document.head.appendChild(e)}async function pmLoadDelayedScripts(e){var t=e.shift();return t?(await pmReplaceScript(t),pmLoadDelayedScripts(e)):Promise.resolve()}async function pmReplaceScript(e){return await pmNextFrame(),new Promise(function(t){let r=document.createElement("script");[...e.attributes].forEach(function(e){let t=e.nodeName;"type"!==t&&("data-type"===t&&(t="type"),r.setAttribute(t,e.nodeValue))}),e.hasAttribute("src")?(r.addEventListener("load",t),r.addEventListener("error",t)):(r.text=e.text,t()),e.parentNode.replaceChild(r,e)})}async function pmTriggerEventListeners(){pmDOMLoaded=!0,await pmNextFrame(),document.dispatchEvent(new Event("perfmatters-DOMContentLoaded")),await pmNextFrame(),window.dispatchEvent(new Event("perfmatters-DOMContentLoaded")),await pmNextFrame(),document.dispatchEvent(new Event("perfmatters-readystatechange")),await pmNextFrame(),document.perfmattersonreadystatechange&&document.perfmattersonreadystatechange(),await pmNextFrame(),window.dispatchEvent(new Event("perfmatters-load")),await pmNextFrame(),window.perfmattersonload&&window.perfmattersonload(),await pmNextFrame(),jQueriesArray.forEach(function(e){e(window).trigger("perfmatters-jquery-load")});let e=new Event("perfmatters-pageshow");e.persisted=window.pmPersisted,window.dispatchEvent(e),await pmNextFrame(),window.perfmattersonpageshow&&window.perfmattersonpageshow({persisted:window.pmPersisted})}async function pmNextFrame(){return new Promise(function(e){requestAnimationFrame(e)})}function pmClickHandler(e){e.target.removeEventListener("click",pmClickHandler),pmRenameDOMAttribute(e.target,"pm-onclick","onclick"),pmInterceptedClicks.push(e),e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation()}function pmReplayClicks(){window.removeEventListener("touchstart",pmTouchStartHandler,{passive:!0}),window.removeEventListener("mousedown",pmTouchStartHandler),pmInterceptedClicks.forEach(e=>{e.target.outerHTML===pmClickTarget&&e.target.dispatchEvent(new MouseEvent("click",{view:e.view,bubbles:!0,cancelable:!0}))})}function pmTouchStartHandler(e){"HTML"!==e.target.tagName&&(pmClickTarget||(pmClickTarget=e.target.outerHTML),window.addEventListener("touchend",pmTouchEndHandler),window.addEventListener("mouseup",pmTouchEndHandler),window.addEventListener("touchmove",pmTouchMoveHandler,{passive:!0}),window.addEventListener("mousemove",pmTouchMoveHandler),e.target.addEventListener("click",pmClickHandler),pmRenameDOMAttribute(e.target,"onclick","pm-onclick"))}function pmTouchMoveHandler(e){window.removeEventListener("touchend",pmTouchEndHandler),window.removeEventListener("mouseup",pmTouchEndHandler),window.removeEventListener("touchmove",pmTouchMoveHandler,{passive:!0}),window.removeEventListener("mousemove",pmTouchMoveHandler),e.target.removeEventListener("click",pmClickHandler),pmRenameDOMAttribute(e.target,"pm-onclick","onclick")}function pmTouchEndHandler(e){window.removeEventListener("touchend",pmTouchEndHandler),window.removeEventListener("mouseup",pmTouchEndHandler),window.removeEventListener("touchmove",pmTouchMoveHandler,{passive:!0}),window.removeEventListener("mousemove",pmTouchMoveHandler)}function pmRenameDOMAttribute(e,t,r){e.hasAttribute&&e.hasAttribute(t)&&(event.target.setAttribute(r,event.target.getAttribute(t)),event.target.removeAttribute(t))}window.addEventListener("pageshow",e=>{window.pmPersisted=e.persisted}),pmUserInteractions.forEach(function(e){window.addEventListener(e,pmTriggerDOMListener,{passive:!0})}),pmDelayClick&&(window.addEventListener("touchstart",pmTouchStartHandler,{passive:!0}),window.addEventListener("mousedown",pmTouchStartHandler)),document.addEventListener("visibilitychange",pmTriggerDOMListener);</script></body></html>