import{s as l}from"./ycaG4YXp.min.js";import{e as f}from"./0XPwTFcg.min.js";function h(n){let e=window.location.search.split(n+"=")[1];return e=e&&e.split("&")[0],e||null}function d(n){const e=n.substr(1),r={};return e.split("&").forEach(a=>{const t=a.split("=");t[0]!==""&&(r[t[0]]=decodeURIComponent(t[1]))}),r}function u(n,e){Object.entries(n).forEach(([r,a])=>{e(r,a)})}var m=Object.defineProperty,w=Object.getOwnPropertyDescriptor,b=(n,e,r,a)=>{for(var t=a>1?void 0:a?w(e,r):e,o=n.length-1,s;o>=0;o--)(s=n[o])&&(t=(a?s(e,r,t):s(t))||t);return a&&t&&m(e,r,t),t};let p=class extends l{connectedCallback(){super.connectedCallback();const e=h("version")==="2"?"approach-feature-cards":"approach-5050",r=document.getElementById(e);r&&(r.style.display="none")}async firstUpdated(){await this.updateComplete,this.preserveParams()}preserveParams(){const n=Array.from(document.querySelectorAll("a[href],hsw-button[href]")).filter(e=>e.getAttribute("href").startsWith("/"));this.appendUrlParamsToLinks(n,[],["debug","grid","preview"])}appendUrlParamsToLinks(n,e=[],r=[]){if("URLSearchParams"in window){const a=d(window.location.search);n.forEach(t=>{if(!t.getAttribute("href"))return;let o=t.getAttribute("href");o.startsWith("/")&&(o=window.location.origin+o);const s=new URL(o);u(a,(i,c)=>{s.searchParams.has(i)||(r&&r.length>=1?~r.indexOf(i)&&s.searchParams.append(i,c):e&&e.length>=1&&~e.indexOf(i)||s.searchParams.append(i,c))}),t.setAttribute("href",s.toString())})}}disconnectedCallback(){super.disconnectedCallback()}createRenderRoot(){return this}};p=b([f("hsw-app")],p);