/*! * JavaScript Cookie v2.2.0 * https://github.com/js-cookie/js-cookie * * Copyright 2006, 2015 Klaus Hartl & Fagner Brack * Released under the MIT license */ !function(e){var r;if("function"==typeof define&&define.amd&&(define(e),r=!0),"object"==typeof exports&&(module.exports=e(),r=!0),!r){var t=window.Cookies,n=window.Cookies=e();n.noConflict=function(){return window.Cookies=t,n}}}(function(){function e(){for(var e=0,r={};e span { display: none !important; } html body button.p-subsidy-ai__launcher > svg { width: 24px; height: 24px; flex: 0 0 24px; } }`; document.head.appendChild(style); function setup() { var queued = false, video = null, copyrightVisibleInitially = null; var videoResize = new ResizeObserver(schedule); var videoState = new MutationObserver(schedule); function schedule() { if (queued) return; queued = true; requestAnimationFrame(update); } function update() { queued = false; var button = document.querySelector('.p-subsidy-ai__launcher'); if (!button) return; button.setAttribute('aria-label', '補助金AIに質問する'); var inMenu = !!button.closest('.sv-menu-panel__ai'); var copyright = document.querySelector('.p-footer-b__bottom > p'); var copyrightVisible = false; if (copyright) { var copyrightRect = copyright.getBoundingClientRect(); copyrightVisible = copyrightRect.height > 0 && copyrightRect.top < window.innerHeight && copyrightRect.bottom > 0; if (copyrightVisibleInitially === null && copyrightRect.height > 0) copyrightVisibleInitially = copyrightVisible; } button.classList.toggle('is-at-copyright', !inMenu && copyrightVisibleInitially === false && copyrightVisible); var nextVideo = document.querySelector('.sv-video-float'); if (nextVideo !== video) { videoResize.disconnect(); videoState.disconnect(); video = nextVideo; if (video) { videoResize.observe(video); videoState.observe(video, { attributes: true, attributeFilter: ['class', 'style', 'hidden'] }); } } var bottom = window.innerWidth <= 767 ? 16 : 24; var right = bottom; if (video && !inMenu) { var rect = video.getBoundingClientRect(), css = getComputedStyle(video); if (rect.height && rect.width && css.position === 'fixed' && css.display !== 'none' && css.visibility !== 'hidden' && Number(css.opacity) > 0 && rect.top < window.innerHeight && rect.bottom > 0) { bottom = Math.max(bottom, window.innerHeight - rect.top + 12); right = Math.max(right, window.innerWidth - rect.right); } } button.style.setProperty('--sv-ai-bottom', bottom + 'px'); button.style.setProperty('--sv-ai-right', right + 'px'); } window.addEventListener('scroll', schedule, { passive: true }); window.addEventListener('resize', schedule, { passive: true }); window.addEventListener('load', schedule, { once: true }); new MutationObserver(schedule).observe(document.body, { childList: true, subtree: true }); schedule(); } if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', setup, { once: true }); else setup(); })();