function reportLcpBackground(){var t=$('.section[style*="background-image"]');let r=null;t.each(function(){var t=$(this),e=t.attr("style").match(/url\((['"]?)(.*?)\1\)/);if(e&&e[2]){e=e[2].replace(/"/g,"");if(!e.includes("null.png")&&!e.includes("50x0"))return!(r={$el:t,imageUrl:e})}}),r&&(t=r.imageUrl.replace("/img/1920x0/",""),window.tobiz.rep_large_image!==t)&&$.ajax({url:"/registerLCPImage.php",method:"POST",data:{action:"register_lcp",page_id:window.tobiz.rep_id,image_url:t}})}function getUniqueLoadedFonts(){return new Promise(t=>{const o=new Set,a=[];document.querySelectorAll(".section, .section *").forEach(t=>{var e,t=getComputedStyle(t),r=t.fontFamily.split(",")[0]?.replace(/['"]/g,"").trim();r&&(e=(`${r}-${t.fontWeight}-`+t.fontStyle).toLowerCase(),o.has(e)||(o.add(e),a.push({family:r,weight:t.fontWeight,style:t.fontStyle})))});var e=JSON.stringify(a);window.tobiz?.rep_used_font_and_weights!==e&&0",{id:"dynamic-google-fonts",rel:"stylesheet",href:t.url,media:"all"}).appendTo("head"))},error:function(t){}})}window.ASTC=function(){const e=t=>Math.max(0,Math.min(255,Math.round(t)));return{isTransparent:function(t){return!t||"transparent"===t||!!(t=t.match(/rgba\(\s*\d+,\s*\d+,\s*\d+,\s*([0-9.]+)\s*\)/i))&&0===parseFloat(t[1])},RGBToHex:function(t){return(t=t&&String(t).match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/i))?"#"+e(+t[1]).toString(16).padStart(2,"0")+e(+t[2]).toString(16).padStart(2,"0")+e(+t[3]).toString(16).padStart(2,"0"):"#ffffff"},getContrast:function(t){let e=String(t).replace("#","").trim();3===e.length&&(e=e.split("").map(t=>t+t).join(""));var t=parseInt(e,16),r=t>>8&255,o=255&t;return(Math.round(299*(t>>16&255))+Math.round(587*r)+Math.round(114*o))/1e3},checkColor:function(t){return ASTC.getContrast(t)<125},checkColorBtn:function(t){return ASTC.getContrast(t)<180},getContrastColor:function(t){return ASTC.checkColor(t)?"#000000":"#ffffff"},getEffectiveBackgroundColor:function(t){var e,r=t.css("background-color");return ASTC.isTransparent(r)?(e=t.closest(".text_block")).length&&!ASTC.isTransparent(e.css("background-color"))?e.css("background-color"):(e=t.closest(".section")).length&&!ASTC.isTransparent(e.css("background-color"))?e.css("background-color"):"rgba(0, 0, 0, 0)":r},makeDarkOrLight:function(t){var e,t=$("#b_"+t);t.length&&(e=t.css("background-color"),ASTC.isTransparent(e)||(e=ASTC.RGBToHex(e))&&ASTC.checkColor(e)&&t.addClass("dark"),t.find(".bg_color").each(function(){var t=$(this),e=t.css("background-color");ASTC.isTransparent(e)||(e=(e=ASTC.RGBToHex(e))&&ASTC.checkColor(e),t.parent().removeClass("dark light").addClass(e?"dark":"light"))}),t.find([".menu1",".extra_info_block",".text_block",".col_3",".col_4",".txt_and_btn",".table .line",".icon_layer",".tile",".content-tile",".content-text",".spoiler"].join(", ")).each(function(){var t=$(this),e=ASTC.getEffectiveBackgroundColor(t);ASTC.isTransparent(e)||(e=ASTC.RGBToHex(e),t.toggleClass("dark",!(!e||!ASTC.checkColor(e))))}),t.find(".bg_right, .form_bg_color, .col_bg, .menu1 ul").each(function(){var t=$(this),e=ASTC.getEffectiveBackgroundColor(t);ASTC.isTransparent(e)||(e=ASTC.RGBToHex(e),t.parent().toggleClass("dark",!(!e||!ASTC.checkColor(e))))}))},makeDarkOrLightBTNs:function(t){$("#b_"+t).length&&$(`#b_${t} .surround, #b_${t} .cookie_btn, #b_${t} .section1011 .next`).each(function(){var t=$(this),e=t.css("background-color");ASTC.isTransparent(e)||(e=ASTC.RGBToHex(e),e=ASTC.checkColorBtn(e),t.toggleClass("dark",!!e))})},checkBackgroundImageInUse:function(t){t=$("#b_"+t);if(!t.length)return!1;var e=t.css("background-image"),t=t.attr("data-bg");if("null.png"===t||"null.png.webp"===t)return!1;if(!(e&&"none"!==e||t))return!1;if(e&&"none"!==e&&[...e.matchAll(/url\((['"]?)(.*?)\1\)/gi)].map(t=>t[2]).some(t=>!/null\.png/i.test(t)))return!0;return!!t},getImageAverageColor:async function(t,e="default"){const r=[...(t.css("background-image")||"").matchAll(/url\(["']?([^"')]+)["']?\)/g)].map(t=>t[1]);if(!r.length)return{r:255,g:255,b:255,a:1};const o=new Image;o.crossOrigin="Anonymous",await new Promise((t,e)=>{o.onload=()=>t(),o.onerror=()=>t(),o.src=r[r.length-1]});var t=document.createElement("canvas"),a=t.getContext("2d"),n=(t.width=Math.max(1,Math.floor(o.width/4)),t.height=Math.max(1,Math.floor(o.height/4)),a.drawImage(o,0,0,t.width,t.height),t.width),t=t.height;let i,s;s="header"===e?(i=Math.max(0,Math.floor(n/2-50)),Math.max(0,Math.floor(.1*t))):(i=Math.max(0,Math.floor(n/2-50)),Math.max(0,Math.floor(t/2-50)));var e=Math.min(100,n-i),n=Math.min(100,t-s),c=a.getImageData(i,s,e,n).data;let l=0,g=0,d=0;for(let t=0;t