1function i(){new c}class c{constructor(){this.init()}init(){this.loadColors(),this.generateColorPalettes(),this.eventListeners()}get createColorPalette(){let e=this.BgColorsFromStylesheet,o=document.createElement("div");return e.forEach(t=>{let l=document.createElement("li");l.classList.add("palette-item"),l.classList.add("palette-color"),l.classList.add(t);let s=t.replace("bg-","");l.setAttribute("data-color",s),o.appendChild(l)}),o}get ColorPaletteView(){let e=document.createElement("div");e.classList.add("woody-dev-tools"),e.classList.add("woody-palette");let o=document.createElement("ul");o.classList.add("palette-list"),o.innerHTML=this.createColorPalette.innerHTML;let t=document.createElement("div");return t.classList.add("palette-item"),t.classList.add("palette-button"),t.innerHTML="<svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 384 384' style='enable-background:new 0 0 384 384;'><linearGradient id='gradient'><stop offset='0%' stop-color='#C084FB' /><stop offset='100%' stop-color='#FABE26' /></linearGradient><path d='M192,0C85.973,0,0,85.973,0,192s85.973,192,192,192c17.707,0,32-14.293,32-32c0-8.32-3.093-15.787-8.32-21.44c-5.013-5.653-8-13.013-8-21.227c0-17.707,14.293-32,32-32h37.653c58.88,0,106.667-47.787,106.667-106.667C384,76.373,298.027,0,192,0z M74.667,192c-17.707,0-32-14.293-32-32s14.293-32,32-32s32,14.293,32,32S92.373,192,74.667,192zM138.667,106.667c-17.707,0-32-14.293-32-32s14.293-32,32-32s32,14.293,32,32S156.373,106.667,138.667,106.667z M245.333,106.667c-17.707,0-32-14.293-32-32s14.293-32,32-32s32,14.293,32,32S263.04,106.667,245.333,106.667z M309.333,192c-17.707,0-32-14.293-32-32s14.293-32,32-32s32,14.293,32,32S327.04,192,309.333,192z' /></svg>",e.appendChild(o),e.appendChild(t),e}loadColors(){this.COLORS={"--primary-color":"bg-primary","--secondary-color":"bg-secondary","--tertiary-color":"bg-tertiary","--quaternary-color":"bg-quaternary","--light-gray":"bg-lightgray","--medium-gray":"bg-mediumgray","--dark-gray":"bg-darkgray","--black":"bg-black","--white":"bg-white"}}generateColorPalettes(){let e=this;document.querySelectorAll(".section, .woody-component-teaser, .woody-component-custom-text, .woody-component-feature, .woody-component-cta, .woody-component-tabs, .woody-component-quote").forEach(o=>{o.appendChild(e.ColorPaletteView),o.classList.add("has-woody-palette")})}eventListeners(){this.onClick(".palette-button",this.openColorPalette),this.onClick(".palette-color",this.changeBackgroundColor)}onClick(e,o){document.querySelectorAll(e).forEach(t=>{t.addEventListener("click",o)})}openColorPalette(e){let o=this,t=e.target,l=t.closest(".has-woody-palette");t.closest(".woody-dev-tools.woody-palette").classList.toggle("open"),l.classList.forEach(a=>{a.startsWith("bg-")&&l.classList.remove(a)})}changeBackgroundColor(e){let o=this,t=e.target,l=t.closest(".has-woody-palette");t.closest(".has-woody-palette").classList.forEach(r=>{r.startsWith("bg-")&&l.classList.remove(r)});let s=t.classList,a=s[s.length-1];l.classList.add(a)}get BgColorsFromStylesheet(){let e=this,o=[];return Object.keys(this.COLORS).forEach(t=>{let l=getComputedStyle(document.documentElement).getPropertyValue(t),s=e.COLORS[t];l&&o.push(s)}),o}}export{i as init};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.