(()=>{"use strict";function e(e){return e.form?`siwg-comment-text-${new FormData(e.form).get("comment_post_ID")}`:"siwg-comment-text-0"}try{const t=document.currentScript?.dataset.siwgConfig;if(!t)throw new Error("Configuration data not found.");const o=globalThis.google?.accounts?.id;if(!o)throw new Error("Google identity services not found.");!function(t,o){const{initialize:n,prompt:i,renderButton:s}=t,{clientID:r,defaultButtonOptions:c,isExistingUserFlow:a,isPreview:g,isUserLoggedIn:l,isWPLogin:d,redirectTo:m,redirectCookieTTL:u,redirectCookieName:p,redirectCookiePath:w,shouldShowOneTapPrompt:h}=o;n({client_id:r,callback:t=>async function(t,o){const{connectNonce:n,followsPostRedirect:i,isExistingUserFlow:s,isPreview:r,isWooCommerce:c,isWPLogin:a,loginURI:g,redirectTo:l}=o;if(r)return;const d=new URLSearchParams;d.append("credential",t.credential),d.append("select_by",t.select_by),s?(d.append("integration","existing_user"),d.append("connect_nonce",n)):c&&!a&&d.append("integration","woocommerce");const m=document.getElementById("comment");m&&function(t){const o=e(t);t.value&&sessionStorage.setItem(o,t.value)}(m);try{const e=await fetch(g,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:d});l||i?e.ok&&e.redirected&&location.assign(e.url):location.reload()}catch(e){globalThis.console.error(e)}}(t,o),library_name:"Site-Kit"});const f=document.getElementById("login");if(d&&f){const e=document.createElement("div"),t=document.getElementById("loginform");e.classList.add("googlesitekit-sign-in-with-google__frontend-output-button"),e.dataset.googlesitekitSiwgWidth="320",f.insertBefore(e,t)}(!l||d||g||a)&&document.querySelectorAll(".googlesitekit-sign-in-with-google__frontend-output-button").forEach(e=>{const{googlesitekitSiwgShape:t=c.shape,googlesitekitSiwgText:o=c.text,googlesitekitSiwgTheme:n=c.theme,googlesitekitSiwgWidth:i}=e.dataset,r={shape:t,text:o,theme:n},a=Number(i);!isNaN(a)&&a>0&&(r.width=a,e.style.maxInlineSize=`${a}px`),s(e,r)}),h&&i(),m&&(document.cookie=`${p}=${m};max-age=${u};path=${w}`);const S=document.getElementById("comment");S&&function(t){const o=e(t),n=sessionStorage.getItem(o);n&&(t.value=n,sessionStorage.removeItem(o))}(S)}(o,JSON.parse(t))}catch(e){globalThis.console.error(e)}})();