(()=>{"use strict";var t,e,n={},r={};function a(t){var e=r[t];if(void 0!==e)return e.exports;var o=r[t]={exports:{}};return n[t](o,o.exports,a),o.exports}a.m=n,a.d=(t,e)=>{for(var n in e)a.o(e,n)&&!a.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},a.f={},a.e=t=>Promise.all(Object.keys(a.f).reduce((e,n)=>(a.f[n](t,e),e),[])),a.u=t=>t+"-"+{603:"a88335f8",605:"0ffb1f77"}[t]+".js",a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t={},e="wl-cloud-bootstrap:",a.l=(n,r,o,i)=>{if(t[n])t[n].push(r);else{var s,l;if(void 0!==o)for(var c=document.getElementsByTagName("script"),d=0;d{s.onerror=s.onload=null,clearTimeout(h);var a=t[n];if(delete t[n],s.parentNode&&s.parentNode.removeChild(s),a&&a.forEach(t=>t(r)),e)return e(r)},h=setTimeout(g.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=g.bind(null,s.onerror),s.onload=g.bind(null,s.onload),l&&document.head.appendChild(s)}},a.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t;a.g.importScripts&&(t=a.g.location+"");var e=a.g.document;if(!t&&e&&(e.currentScript&&"SCRIPT"===e.currentScript.tagName.toUpperCase()&&(t=e.currentScript.src),!t)){var n=e.getElementsByTagName("script");if(n.length)for(var r=n.length-1;r>-1&&(!t||!/^http(s?):/.test(t));)t=n[r--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=t})(),(()=>{var t={792:0};a.f.j=(e,n)=>{var r=a.o(t,e)?t[e]:void 0;if(0!==r)if(r)n.push(r[2]);else{var o=new Promise((n,a)=>r=t[e]=[n,a]);n.push(r[2]=o);var i=a.p+a.u(e),s=new Error;a.l(i,n=>{if(a.o(t,e)&&(0!==(r=t[e])&&(t[e]=void 0),r)){var o=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;s.message="Loading chunk "+e+" failed.\n("+o+": "+i+")",s.name="ChunkLoadError",s.type=o,s.request=i,r[1](s)}},"chunk-"+e,e)}};var e=(e,n)=>{var r,o,[i,s,l]=n,c=0;if(i.some(e=>0!==t[e])){for(r in s)a.o(s,r)&&(a.m[r]=s[r]);l&&l(a)}for(e&&e(n);cs(t,e)):s(n,e))}function c(t){if(null==t)return[];if("object"==typeof t&&null!==t&&"@list"in t){const e=t["@list"];return Array.isArray(e)?e:[]}return Array.isArray(t)?t:[t]}function d(t,e){var n,r;if(!t)return null;if("string"==typeof t&&e.has(t))return null!==(n=e.get(t))&&void 0!==n?n:null;const a=t["@id"];return"string"==typeof a&&e.has(a)?null!==(r=e.get(a))&&void 0!==r?r:null:t}function u(...t){for(const e of t)if("string"==typeof e&&e.trim().length>0)return e;return""}function g(t,e){if(t)for(const n of e)if(n in t)return t[n]}function h(t){const e=[],n=t=>{if(t)if(Array.isArray(t))t.forEach(t=>n(t));else if("object"==typeof t){if(Array.isArray(t["@graph"]))return void t["@graph"].forEach(t=>n(t));e.push(t)}};return n(t),e}async function p(t,e){const{renderFaq:n,faqTargetId:r,faqTemplateId:s}=e;if(!n||!r)return;let p;try{p=JSON.parse(t)}catch(t){return}const m=function(t){try{const e=function(t){const e=Array.isArray(null==t?void 0:t["@graph"])?t["@graph"]:Array.isArray(t)?t:[];if(!e.length)return[];const n=new Map;for(const t of e){const e=null==t?void 0:t["@id"];"string"==typeof e&&n.set(e,t)}const r=e.find(t=>l(t,"FAQPage"));if(!r)return[];const a=[],o=c(g(r,["mainEntity","https://schema.org/mainEntity","http://schema.org/mainEntity"])).map(t=>d(t,n));for(const t of o){if(!t)continue;const e=d(g(t,["acceptedAnswer","https://schema.org/acceptedAnswer","http://schema.org/acceptedAnswer"]),n),r=u(g(t,["name","https://schema.org/name","http://schema.org/name","schema:name"])),o=u(g(null!=e?e:{},["text","https://schema.org/text","http://schema.org/text","schema:text"]));r&&o&&a.push({question:r,answerHtml:o})}return a}({"@graph":h(t)});return e.length?e:function(t){const e=h(t).find(t=>l(t,"FAQPage"));return e?c(g(e,["mainEntity","https://schema.org/mainEntity","http://schema.org/mainEntity"])).map(t=>{const e=g(t,["acceptedAnswer","https://schema.org/acceptedAnswer","http://schema.org/acceptedAnswer"]),n=u(g(t,["name","https://schema.org/name","http://schema.org/name","schema:name"])),r=u(g(e,["text","https://schema.org/text","http://schema.org/text","schema:text"]));return n&&r?{question:n,answerHtml:r}:null}).filter(t=>null!==t):[]}(t)}catch(t){return console.warn("Failed to parse FAQ items",t),[]}}(p);if(!m.length)return;const f=function(t){var e;const n=document.getElementById(t),r=null===(e=null==n?void 0:n.textContent)||void 0===e?void 0:e.trim();return r&&r.length>0?r:i}(s);f&&async function(t,e,n){const r=document.getElementById(e);if(!r)return;const[i,s]=await async function(){return o||(o=Promise.all([a.e(605).then(a.bind(a,605)),a.e(603).then(a.bind(a,603))])),o}(),l=i.default,c=s.default,d=t.map(t=>{var e,n;return{question:null!==(e=t.question)&&void 0!==e?e:"",answer:c.sanitize(null!==(n=t.answerHtml)&&void 0!==n?n:"",{ALLOWED_TAGS:["h1","h2","h3","h4","h5","h6","br","ol","ul","li","a","p","div","b","strong","i","em"],ALLOWED_ATTR:["href"]})}}),u=l.render(n,{faqs:d});r.innerHTML=u}(m,r,f).catch(t=>{console.error("FAQ rendering failed",t)})}function m(t,e){e.source&&e.source.postMessage({type:"html-response",content:document.body.outerHTML},t)}function f(){const t=document.getElementById("wl-frame-sidebar");t&&document.body.removeChild(t);const e=document.body,n=sessionStorage.getItem("wlOriginalWidth");n&&(e.style.width=n),setTimeout(()=>{e.style.transition=""},300),sessionStorage.removeItem("wlIsSidebarOpen"),sessionStorage.removeItem("wlOriginalWidth")}function b(t,e,n){!function(){const t=document.createElement("style");t.innerText="\n #wl-frame-sidebar {\n position: fixed;\n padding: 0;\n margin: 0;\n right: 0;\n z-index: 999999;\n top: 0;\n bottom: 0;\n width: 300px;\n height: 100%;\n border: 0;\n background: #fff;\n box-shadow: -1px 1px 5px rgba(0,0,0,0.15);\n }\n .wl-element-mouse-over:hover {\n background: rgba(46,146,255,0.2);\n outline: 1px solid rgba(46,146,255,0.8);\n }\n body.wl-selecting-element {\n cursor: pointer !important;\n }\n mark[data-markjs='true'] {\n background: initial;\n }\n ",document.head.appendChild(t)}();const r=document.body,a=getComputedStyle(r).width;sessionStorage.setItem("wlOriginalWidth",a),r.style.transition="width 0.3s ease",r.style.width=`calc(${a} - 300px)`;const o=document.createElement("iframe");o.id="wl-frame-sidebar",o.src=`${t}?u=${encodeURIComponent(e)}&t=${encodeURIComponent(n)}`,document.body.appendChild(o),sessionStorage.setItem("wlIsSidebarOpen","true")}class w{constructor(){this.jsonLdDisabled="true"===this.getSetting("data-disable-jsonld","disableJsonLd","false"),this.sidebarUrl=this.getSetting("data-sidebar-url","sidebarUrl","https://cloud-sidebar.wordlift.io"),this.webPageUrl=this.getSetting("data-web-page-url","webPageUrl",window.location.href),this.targetOrigin=this.getSetting("data-target-origin","targetOrigin",this.webPageUrl),this.dataFormatter=this.getSetting("data-data-formatter","dataFormatter"),this.renderFaq="true"===this.getSetting("data-faq","renderFaq","false"),this.faqTargetId=this.getSetting("data-faq-target-id","faqTargetId"),this.faqTemplateId=this.getSetting("data-faq-template-id","faqTemplateId","wl-faq-template"),this.apiUrl=this.getSetting("data-api-url","apiUrl","https://api.wordlift.io/data/__PROTOCOL__/__HOST_AND_PATH__?__QUERY_STRING__")}getSetting(t,e,n){var r,a;if(null===(r=document.currentScript)||void 0===r?void 0:r.hasAttribute(t)){const e=document.currentScript.getAttribute(t);if(null!==e)return e}return(null===(a=window._wlCloudSettings)||void 0===a?void 0:a[e])?window._wlCloudSettings[e]:n}static getInstance(){return w.instance||(w.instance=new w),w.instance}}!function(){const t=w.getInstance();var e,n,r,a;t.jsonLdDisabled||function(t){const e=w.getInstance(),n=function(t,e,n){const r=e.match("^(https?):\\/\\/(.*?)(\\?.*)?$");if(!r)return t;const a=r[1],o=r[2],i=new URLSearchParams(r[3]||""),s=(null===(d=document.documentElement.lang||(null===(l=document.querySelector("meta[http-equiv='Content-Language']"))||void 0===l?void 0:l.getAttribute("content"))||(null===(c=document.querySelector("meta[name='language']"))||void 0===c?void 0:c.getAttribute("content")))||void 0===d?void 0:d.trim())||void 0;var l,c,d;s&&i.set("__wl_lang",s),n&&i.set("__wl_data_formatter",n);const u=i.toString();let g=t.replace("__PROTOCOL__",a).replace("__HOST_AND_PATH__",o).replace("__QUERY_STRING__",u);return u||(g=g.replace(/\?$/,"")),g}(e.apiUrl,t,e.dataFormatter);(async()=>{for(let t=1;t<=3;t++)try{const t=await fetch(n,{headers:{Accept:"application/ld+json"}});if(!t.ok)throw new Error("Network response not ok");const r=await t.text(),a=document.createElement("script");a.id="wl-json-ld",a.type="application/ld+json",a.textContent=r,document.head.appendChild(a),p(r,{renderFaq:e.renderFaq,faqTargetId:e.faqTargetId,faqTemplateId:e.faqTemplateId});break}catch(e){3===t?console.error("Fetch failed after max retries:",{error:e,dataUrl:n}):console.warn(`Attempt ${t} failed, retrying...`)}})()}(t.webPageUrl),e=t.sidebarUrl,n=t.webPageUrl,r=t.targetOrigin,window.addEventListener("keyup",t=>{t.ctrlKey&&t.altKey&&"KeyW"===t.code&&(document.getElementById("wl-frame-sidebar")?f():b(e,n,r))}),a={"close-sidebar-request":{callback:f},"html-request":{callback:m,sourceOrigin:t.sidebarUrl}},window.addEventListener("message",t=>{const e=a[t.data.type];e&&(!e.sourceOrigin||e.sourceOrigin.startsWith(t.origin))&&e.callback(t.origin,t)}),function(t,e,n){"true"===sessionStorage.getItem("wlIsSidebarOpen")&&b(t,e,n)}(t.sidebarUrl,t.webPageUrl,t.targetOrigin)}()})();