1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1594],{61594:function(e,t,l){l.r(t),l.d(t,{GenericConfigurator:function(){return B}});var n=l(57437),i=l(2265),o=l(41750),a=l(59010),r=l(15689),s=l(40823),c=l(16822),d=l(94079),u=l(66273),p=l(38168),h=l(68646),g=l(74988),m=l(47944),f=l(64854),v=l(57590),x=l(26721),y=l(59210),j=l(91953);let w=y.cV,b=new Map;function k(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:900;return(0,j.qv)(e,t)}function _(e){let t=b.get(e);if(t)return t;let l=fetch("/api/sanity/images-by-tag?tag=".concat(encodeURIComponent(e))).then(e=>e.json()).then(e=>Array.isArray(e)?e:[]).catch(t=>(console.error("[GC/Cache] fetch error for tag:",e,t),b.delete(e),[]));return b.set(e,l),l}function C(e){var t,l,n,i,o,a,r;let s=e.attributeValue,c=e.associatedProduct,d=null==c?void 0:c.firstVariant,u=(null==s?void 0:s.title)||(null==s?void 0:s.displayName)||(null==s?void 0:s.value)||(null==c?void 0:c.title)||"";return{label:u,sku:null!==(n=null!==(l=null==d?void 0:d.sku)&&void 0!==l?l:null==s?void 0:s.sku)&&void 0!==n?n:null,price:null!==(o=null!==(i=null==d?void 0:d.price)&&void 0!==i?i:null==s?void 0:s.price)&&void 0!==o?o:null,imageUrl:null!==(r=null!==(a=null==s?void 0:null===(t=s.swatchImage)||void 0===t?void 0:t.url)&&void 0!==a?a:null==c?void 0:c.featuredImageUrl)&&void 0!==r?r:null}}function N(e){return e.title||e.displayName||e.value||""}function L(e){return e.replace(/"/g,"").replace(/'/g,"").replace(/[()]/g,"").replace(/\//g,"").replace(/ - /g," ").replace(/\s+/g," ").trim().toLowerCase()}function S(e,t){if(!t)return!1;if(e===t||e.replace(/\s/g,"")===t.replace(/\s/g,""))return!0;if(!t.includes(" "))return!1;if(e.endsWith(" "+t))return!0;let l=e.length<=t.length?e:t,n=e.length<=t.length?t:e;return!!(n.length-l.length<=2&&n.startsWith(l))}function T(e){return e.replace(/[°()'"]/g,"").replace(/ - /g," ").replace(RegExp("(?<=\\s)-(?=\\s)","g"),"").trim().split(/\s+/).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join("")}function I(e){return e.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"")}function P(e){return e<26?String.fromCharCode(97+e):String.fromCharCode(97+(Math.floor(e/26)-1))+String.fromCharCode(97+e%26)}function M(e,t){var l;if(!e||0===t.length)return null;let n=e.toLowerCase(),i=t.find(e=>e.originalFilename.replace(/\.[^/.]+$/,"").toLowerCase()===n);return null!==(l=null==i?void 0:i.url)&&void 0!==l?l:null}function E(e){if(!e)return{};let t={};for(let l of e.split(/,\s*(?=[A-Za-z][A-Za-z0-9 ]*:)/)){let e=l.indexOf(":");if(-1===e)continue;let n=l.slice(0,e).trim(),i=l.slice(e+1).trim();n&&i&&(t[n]=i)}return t}function A(e,t,l){let n={};for(let i of t){let t;let o=e[i.handle];if(o&&(t=i.optionsList.find(e=>e.handle===o)),!t){let e=null==l?void 0:l.get(i.handle);e&&e.size>0&&(t=i.optionsList.find(t=>t.handle&&e.has(t.handle))),t||(t=i.optionsList[0])}t&&(n[i.optionTitle]=t.title||t.displayName||t.value)}return n}function F(e,t,l,n){if(!n)return!0;if(!e||0===e.length)return!1;let i=e.some(e=>!!e&&""!==e.trim()&&e.split(";").map(e=>e.trim()).filter(Boolean).every(e=>{let t=e.indexOf("=");if(-1===t)return!1;let n=e.slice(0,t).trim(),i=e.slice(t+1).trim(),o=l[n];return!!o&&i.split("&").map(e=>e.trim().toLowerCase()).includes(o.toLowerCase())}));return t?i:!i}function z(e){let t=e.split(/,\s*(?=[A-Za-z][A-Za-z0-9 ]*:)/).map(e=>e.trim()).filter(Boolean);if(t.length<1)return null;let l=t.map(e=>{let t=e.indexOf(":");return -1===t?null:{attrTitle:e.slice(0,t).trim(),value:e.slice(t+1).trim()}});return l.some(e=>null===e)?null:{conditions:l.slice(0,-1),target:l[l.length-1]}}function O(e){let t;let l=e.replace(/</gi,"<").replace(/>/gi,">").replace(/&/gi,"&").replace(/'/gi,"'").replace(/"/gi,'"'),i=/<a\s+href\s*=\s*(["'])([^"']+)\1[^>]*>([\s\S]*?)<\/a>|\[([^\]]+)\]\((https?:\/\/[^)]+)\)/gi,o=[],a=0,r=0,s=e=>{e.split("\n").forEach((e,t,l)=>{o.push(e),t<l.length-1&&o.push((0,n.jsx)("br",{},"br-".concat(r++)))})};for(;null!==(t=i.exec(l));){var c,d;t.index>a&&s(l.slice(a,t.index));let e=null!==(c=t[2])&&void 0!==c?c:t[5],i=null!==(d=t[3])&&void 0!==d?d:t[4];o.push((0,n.jsx)("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"gc-accessory-comment-link",children:i},"link-".concat(r++))),a=t.index+t[0].length}return a<l.length&&s(l.slice(a)),o}function B(e){var t,l;let{section:y,initialProduct:j,initialVariants:b,initialSwatchImages:B,initialGridImages:R}=e,{section_id:V,heading:U,description:W,productRef:Z,variantProductType:q,rowCountTag:H,configuratorLabel:$,useCustomSkuLabel:G=!1,skuLabel:D,contact_button_text:K="Contact us",contact_button_url:X="/pages/contact",footer_note:J,downloads_anchor:Y,background_color:Q,container_width:ee="contained",imageTagDepth:et="1",firstLevelImageMatch:el=!1,singleImageMode:en=!1,useGreedyImageMatch:ei=!1,selectedAttributeValues:eo,icExclusionRules:ea,exp
1andAccessoriesAccordionWhenAccessoriesAvailable:er=!1}=y,es=null!=j,ec=(0,v.Sv)(),ed=Y||null,eu=window.location.pathname.toLowerCase().includes("h-series-housing"),ep=/\/4-retrofit-trims(\/|$)/.test(window.location.pathname.toLowerCase()),eh=window.location.pathname.toLowerCase().includes("/2-modules"),eg=$||(eu?"Housings":"Configure Variants"),em=G&&D?D:eg,[ef,ev]=(0,i.useState)(null!=j?j:null),[ex,ey]=(0,i.useState)(!es),[ej,ew]=(0,i.useState)(null),[eb,ek]=(0,i.useState)({}),[e_,eC]=(0,i.useState)(!1),eN=(0,i.useRef)(null),[eL,eS]=(0,i.useState)(null!=b?b:[]),[eT,eI]=(0,i.useState)(!1),[eP,eM]=(0,i.useState)(es),[eE,eA]=(0,i.useState)(null!=R?R:[]),[eF,ez]=(0,i.useState)(!1),[eO,eB]=(0,i.useState)(new Set),[eR,eV]=(0,i.useState)(null),[eU,eW]=(0,i.useState)(new Set),[eZ,eq]=(0,i.useState)(!0),{user:eH}=(0,a.a)(),{currentLocation:e$}=(0,s.T)(),[eG,eD]=(0,i.useState)(!1),[eK,eX]=(0,i.useState)(null),[eJ,eY]=(0,i.useState)(!1),[eQ,e0]=(0,i.useState)(1),[e1,e9]=(0,i.useState)("idle"),[e5,e2]=(0,i.useState)(null),[e4,e3]=(0,i.useState)(null),[e6,e8]=(0,i.useState)(!1),[e7,te]=(0,i.useState)(""),[tt,tl]=(0,i.useState)(""),[tn,ti]=(0,i.useState)(null),[to,ta]=(0,i.useState)([]),[tr,ts]=(0,i.useState)(!1),[tc,td]=(0,i.useState)(!1),[tu,tp]=(0,i.useState)(null),th=(0,i.useRef)(null),[tg,tm]=(0,i.useState)(null!=B?B:[]),[tf,tv]=(0,i.useState)(!1),tx=(0,i.useRef)([]),[ty,tj]=(0,i.useState)(!1),[tw,tb]=(0,i.useState)(0),tk=(0,i.useRef)(0),t_=(0,i.useRef)(0),tC=(0,i.useRef)(!1),tN=(0,i.useRef)(null),tL=null!==(l=null==Z?void 0:Z._ref)&&void 0!==l?l:null;(0,i.useEffect)(()=>{if(!tL){ey(!1);let e=ec("components.cms.sections.error.no_product_configured_for_this_section","No product configured for this section.");ew(e),(0,r.trackError)("product_load_error",{source:"inline",component:"GenericConfigurator",context:"product_load",message:e,page:window.location.pathname});return}if(es)return;let e=!1;ey(!0),eI(!0),tv(!0),ew(null);let t=new URL("/api/sanity/configurator-bundle",window.location.origin);return t.searchParams.set("productRef",tL),(null==q?void 0:q.trim())&&t.searchParams.set("variantProductType",q.trim()),fetch(t.toString()).then(e=>e.json()).then(t=>{if(!e){if(!t||t.error){var l;let e=null!==(l=null==t?void 0:t.error)&&void 0!==l?l:"Product not found in Sanity.";ew(e),(0,r.trackError)("product_load_error",{source:"inline",component:"GenericConfigurator",context:"product_load",message:e,page:window.location.pathname});return}ev(t.product),eS(Array.isArray(t.variants)?t.variants:[]),eM(!0),tm(Array.isArray(t.swatchImages)?t.swatchImages:[])}}).catch(t=>{e||(console.error("[GenericConfigurator] bundle fetch error:",t),ew("Failed to load product data."),(0,r.trackError)("product_load_error",{source:"inline",component:"GenericConfigurator",context:"product_load",message:"Failed to load product data.",page:window.location.pathname}))}).finally(()=>{e||(ey(!1),eI(!1),tv(!1))}),()=>{e=!0}},[tL,q,es]),(0,i.useEffect)(()=>{if(!(null==ef?void 0:ef.title)||eP)return;let e=!1;eI(!0);let t=[...new Set(((null==q?void 0:q.trim())||(ef.title.includes("Trims")?ef.title:"".concat(ef.title," Trims"))).split(",").map(e=>e.trim()).filter(Boolean))];return fetch("/api/sanity/configurator-variants?productType=".concat(encodeURIComponent(t.join(",")))).then(e=>e.json()).then(t=>{e||(eS(Array.isArray(t)?t:[]),eM(!0))}).catch(t=>{e||console.error("[GenericConfigurator] variant fetch error:",t)}).finally(()=>{e||eI(!1)}),()=>{e=!0}},[null==ef?void 0:ef.title,q]);let tS=(0,i.useMemo)(()=>{var e,t,l;if(!ef)return[];let n=null!==(e=ef.itemClasses)&&void 0!==e?e:[],i=n.some(e=>"Accessories"!==e.classType),o=[];for(let e of n)if(!i||"Accessories"!==e.classType)for(let n of null!==(t=e.optionLists)&&void 0!==t?t:[])(null===(l=n.optionsList)||void 0===l?void 0:l.length)&&o.push(n);return o},[ef]);(0,i.useMemo)(()=>tS.length>0&&tS.every(e=>!!eb[e.handle]),[tS,eb]);let tT=(0,i.useMemo)(()=>{let e=new Map,t=new Map,l=new Map,n=new Map;return tS.forEach((i,o)=>{let a=P(o);e.set(i.handle,a),t.set(a,i.handle);let r=new Map,s=new Map;i.optionsList.forEach((e,t)=>{if(e.handle){let l=P(t);r.set(e.handle,l),s.set(l,e.handle)}}),l.set(i.handle,r),n.set(i.handle,s)}),{attrToKey:e,keyToAttr:t,avToShort:l,shortToAv:n}},[tS]),tI=(0,i.useMemo)(()=>{let e=new Map;if(0===tS.length||0===eL.length)return e;let t=eL.map(e=>({variant:e,meta:E(e.metadataoptions)})),l=new Set;for(let{meta:e}of t)for(let t of Object.keys(e))l.add(t);let n=new Map;for(let[e,t]of Object.entries(eb)){let l=tS.findIndex(t=>t.handle===e),i=l>=0?tS[l]:void 0,o=null==i?void 0:i.optionsList.find(e=>e.handle===t);i&&o&&n.set(e,{index:l,optionTitle:i.optionTitle,displayValue:L(o.title||o.displayName||o.value),avValueNorm:o.value?L(o.value):""})}for(let i=0;i<tS.length;i++){let o=tS[i],a=t.filter(e=>{let{meta:t}=e;return[...n.entries()].every(e=>{let[n,{index:a,optionTitle:r,displayValue:s,avValueNorm:c}]=e;if(n===o.handle||a>=i)return!0;let d=t[r];if(void 0===d)return!l.has(r);let u=L(d);return S(u,s)||""!==c&&u===c})}),r=new Set;for(let{meta:e}of a){let t=e[o.optionTitle];if(t){let e=L(t),l=o.optionsList.find(t=>
1L(t.title||t.displayName||t.value)===e||!!t.value&&L(t.value)===e);l||(l=o.optionsList.find(t=>S(e,L(t.title||t.displayName||t.value)))),(null==l?void 0:l.handle)&&r.add(l.handle)}}e.set(o.handle,r)}if(ea&&ea.length>0&&ef){var i;let t=(null!==(i=ef.itemClasses)&&void 0!==i?i:[]).filter(e=>"Accessories"!==e.classType),l=new Map;for(let e of tS){let t=eb[e.handle];if(!t)continue;let n=e.optionsList.find(e=>e.handle===t);if(!n)continue;let i=(n.title||n.displayName||n.value||"").trim().toLowerCase();l.set(e.optionTitle.trim().toLowerCase(),{attr:e,displayValue:i})}let n=new Map;for(let e of tS)n.set(e.optionTitle.trim().toLowerCase(),e);for(let i=0;i<t.length;i++)for(let t of function(e,t){var l;return e&&e[t]?(null!==(l=e[t].rules)&&void 0!==l?l:"").split("\n").map(e=>e.trim()).filter(Boolean).map(z).filter(e=>null!==e):[]}(ea,i)){if(!t.conditions.every(e=>{let t=l.get(e.attrTitle.trim().toLowerCase());return!!t&&t.displayValue===e.value.trim().toLowerCase()}))continue;let i=n.get(t.target.attrTitle.trim().toLowerCase());if(!i)continue;let o=e.get(i.handle);if(!o)continue;let a=t.target.value.trim().toLowerCase(),r=i.optionsList.find(e=>(e.title||e.displayName||e.value||"").trim().toLowerCase()===a);(null==r?void 0:r.handle)&&o.delete(r.handle)}}return e},[tS,eL,eb,ea,ef]),tP=(0,i.useMemo)(()=>{let e=new Set;for(let t of eL)for(let l of Object.keys(E(t.metadataoptions)))e.add(l);return e},[eL]);(0,i.useEffect)(()=>{if(!eo||0===eo.length){eX(null);return}let e=Object.keys(eb).length>0,t=A(eb,tS,tI);if(eN.current&&e){let e=eN.current,l=eo.find(t=>t._key===e);if(l&&F(l.conditions,!1!==l.showWhenMatched,t,!0)){tI.size>0&&(eN.current=null),eX(e),eY(!0);return}eN.current=null}let l=eo.find(e=>"none"===C(e).label.trim().toLowerCase()),n=eo.some(n=>n!==l&&(n.attributeValue||n.associatedProduct)&&F(n.conditions,!1!==n.showWhenMatched,t,e));l?(eX(l._key),eY(!1)):n||(eX(null),eY(!1))},[eb,eo,tS,tI]),(0,i.useEffect)(()=>{if(!er||!eo||0===eo.length)return;let e=Object.keys(eb).length>0;if(!e){eD(!1);return}let t=A(eb,tS,tI);eD(eo.some(l=>(l.attributeValue||l.associatedProduct)&&F(l.conditions,!1!==l.showWhenMatched,t,e)))},[er,eo,eb,tS,tI]),(0,i.useEffect)(()=>{if(0===tI.size)return;let e=ln.current,t=e?tS.findIndex(t=>t.handle===e):-1;ek(l=>{let n={...l},i=!1;for(let[l,r]of Object.entries(n)){var o,a;if(l===e)continue;let s=tS.findIndex(e=>e.handle===l);if(t>=0&&s<=t)continue;let c=tI.get(l);if(c){if(c.size>0&&!c.has(r)){delete n[l],i=!0;continue}0===c.size&&tP.has(null!==(a=null===(o=tS[s])||void 0===o?void 0:o.optionTitle)&&void 0!==a?a:"")&&(delete n[l],i=!0)}}return i||(ln.current=null),i?n:l})},[tI,tS,tP]),(0,i.useEffect)(()=>{0!==tI.size&&ek(e=>{let t={...e},l=!1;for(let e of tS){let n=tI.get(e.handle);if(!(n&&0===n.size&&tP.has(e.optionTitle))&&!t[e.handle]){if(n&&1===n.size){let[i]=n;t[e.handle]=i,l=!0}else break}}return l?t:e})},[tI,tS,tP]),(0,i.useEffect)(()=>{if(e_||0===tS.length)return;let e=new URLSearchParams(window.location.search),t={};for(let o of tS){var l,n,i;let a=tT.attrToKey.get(o.handle),r=null!==(l=a?e.get(a):null)&&void 0!==l?l:e.get(o.handle);if(r){let e=tT.shortToAv.get(o.handle),l=null!==(i=null==e?void 0:e.get(r))&&void 0!==i?i:null===(n=o.optionsList.find(e=>e.handle===r))||void 0===n?void 0:n.handle;l&&(t[o.handle]=l)}}Object.keys(t).length>0&&ek(t);let o=e.get("acc");o&&(eN.current=o),eC(!0)},[tS,e_,tT]),(0,i.useEffect)(()=>{if(!e_||0===tS.length)return;let e=new URL(window.location.href);for(let t of tS){e.searchParams.delete(t.handle);let l=tT.attrToKey.get(t.handle);l&&e.searchParams.delete(l)}for(let[l,n]of Object.entries(eb)){var t;let i=tT.attrToKey.get(l),o=null===(t=tT.avToShort.get(l))||void 0===t?void 0:t.get(n);i&&o&&e.searchParams.set(i,o)}e.searchParams.delete("acc"),eK&&eJ&&e.searchParams.set("acc",eK),window.history.replaceState(null,"",e.pathname+e.search)},[eb,e_,tS,tT,eK,eJ]);let tM=(0,i.useMemo)(()=>(null==ef?void 0:ef.title)?"".concat(ef.title.replace(/\s+/g,"").toLowerCase(),"/swatches"):null,[null==ef?void 0:ef.title]);(0,i.useEffect)(()=>{if(!tM||tg.length>0)return;let e=!1;return tv(!0),fetch("/api/sanity/images-by-tag?tag=".concat(encodeURIComponent(tM))).then(e=>e.json()).then(t=>
1{e||tm(Array.isArray(t)?t:[])}).catch(t=>{e||(console.error("[GenericConfigurator/Swatches] fetch error:",t),tm([]))}).finally(()=>{e||tv(!1)}),()=>{e=!0}},[tM]);let tE=(0,i.useMemo)(()=>{var e,t;if(!(null==ef?void 0:ef.title)||tS.length<1)return null;let l=ef.title.replace(/\s+/g,"").toLowerCase(),n=A(eb,tS,tI),i=I(null!==(e=n[tS[0].optionTitle])&&void 0!==e?e:"");if(!i)return null;if("2"===et){if(tS.length<2)return"".concat(l,"/").concat(i);let e=I(null!==(t=n[tS[1].optionTitle])&&void 0!==t?t:"");return e?"".concat(l,"/").concat(i,"/").concat(e):"".concat(l,"/").concat(i)}return"".concat(l,"/").concat(i)},[null==ef?void 0:ef.title,eb,tS,tI,et]);(0,i.useEffect)(()=>{if(!(null==ef?void 0:ef.title)||0===tS.length)return;let e=ef.title.replace(/\s+/g,"").toLowerCase();for(let t of tS[0].optionsList){let l=I(t.title||t.displayName||t.value||"");l&&_("".concat(e,"/").concat(l))}},[null==ef?void 0:ef.title,tS]),(0,i.useEffect)(()=>{if(!tE)return;let e=!1;return ez(!0),eB(new Set),_(tE).then(t=>{e||eA(t)}).finally(()=>{e||ez(!1)}),()=>{e=!0}},[tE]);let tA=(0,i.useMemo)(()=>{var e,t,l;if(0===tS.length)return"";let n=A(eb,tS,tI);if(eh){let l=e=>e.toLowerCase().replace(/[^a-z0-9]/g,""),i=tS.find(e=>"moduletype"===l(e.optionTitle));if(i){let o=l(null!==(e=n[i.optionTitle])&&void 0!==e?e:"");if("downlight"===o||"adjustable"===o){let e=tS.find(e=>"beamspread"===l(e.optionTitle)),i=e?l(null!==(t=n[e.optionTitle])&&void 0!==t?t:""):"",a=new Set(["spothexlouver","spotwhexlouver","floodhexlouver","floodwhexlouver","widefloodhexlouver","narrowspothexlouver","narrowspotwhexlouver"]),r=new Set(["spot30","flood40","wideflood50","linearspread60x20","linearspread50x30"]),s=i;if(a.has(i)?s="spothexlouver":r.has(i)&&(s="narrowspot20"),s)return"".concat(o,"_triacelv_750lm_2700k_").concat(s)}}}if(ei&&eE.length>0){let e=e=>e.replace(/(\.\.[^/.]+)+$|\.[^/.]+$/,"").replace(/-/g,"").toLowerCase(),t=eE.map(t=>e(t.originalFilename)),l=e=>t.some(t=>t.startsWith(e+"_")),i=tS.map(e=>{var t;return T(null!==(t=n[e.optionTitle])&&void 0!==t?t:"")}).filter(Boolean),o=[];for(let t of i)l(e([...o,t].join("_")))&&o.push(t);return o.join("_")}return el?T(null!==(l=n[tS[0].optionTitle])&&void 0!==l?l:"")||"":tS.map(e=>{var t;return T(null!==(t=n[e.optionTitle])&&void 0!==t?t:"")}).filter(Boolean).join("_")},[eb,tS,tI,el,ei,eE,eh]),tF=(0,i.useMemo)(()=>{if(0===eE.length||!tA)return[];let e=tA.toLowerCase(),t=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),l=eE.filter(l=>{let n=l.originalFilename.toLowerCase();return!!(n.startsWith(e+"__")||new RegExp("^".concat(t,"_\\d")).test(n))});if(0===l.length){let n=RegExp("^".concat(t,"(_[a-z0-9,]+)*_+[0-9]+"),"i");if((l=eE.filter(e=>n.test(e.originalFilename.toLowerCase()))).length>4){l.sort((e,t)=>e.originalFilename.localeCompare(t.originalFilename));let t=l[0].originalFilename.toLowerCase().replace(e,"").replace(/_+[0-9]+.*$/,"");l=l.filter(l=>l.originalFilename.toLowerCase().replace(e,"").replace(/_+[0-9]+.*$/,"")===t)}}return l.sort((e,t)=>{var l,n,i,o;let a=/_+([0-9]+)(?:\.[^.]+)?$/;return parseInt(null!==(i=null===(l=e.originalFilename.match(a))||void 0===l?void 0:l[1])&&void 0!==i?i:"0",10)-parseInt(null!==(o=null===(n=t.originalFilename.match(a))||void 0===n?void 0:n[1])&&void 0!==o?o:"0",10)||e.originalFilename.localeCompare(t.originalFilename)}).slice(0,4).map(e=>e.url)},[eE,tA]);(0,i.useEffect)(()=>{tF.length>0&&(tx.current=tF)},[tF]);let tz=tF.length>0?tF:tx.current;(0,i.useEffect)(()=>{let e=()=>tj(window.innerWidth<=991);return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);let tO=en?1:Math.min(tz.length,4);(0,i.useEffect)(()=>{tb(0)},[tz]);let tB=(0,i.useCallback)(()=>{var e;if(!ty)return"none";let t=null===(e=tN.current)||void 0===e?void 0:e.children[0],l=t?t.getBoundingClientRect().width:.75*window.innerWidth;return"translate3d(-".concat(tw*(l+17),"px, 0, 0)")},[tw,ty]),tR=(0,i.useCallback)(e=>{tk.current=e.touches[0].clientX,t_.current=e.touches[0].clientX,tC.current=!0},[]),tV=(0,i.useCallback)(e=>{tC.current&&(t_.current=e.touches[0].clientX)},[]),tU=(0,i.useCallback)(()=>
1{if(!tC.current)return;tC.current=!1;let e=tk.current-t_.current;e>30&&tw<tO-1?tb(e=>e+1):e<-30&&tw>0&&tb(e=>e-1)},[tw,tO]);(0,i.useEffect)(()=>{if(!tt.trim()){ta([]);return}let e=setTimeout(async()=>{try{let e=(null==e$?void 0:e$.shopifyCompanyLocationId)?"&shopify_location_id=".concat(encodeURIComponent(e$.shopifyCompanyLocationId)):"",t="?search=".concat(encodeURIComponent(tt.trim()),"&limit=20").concat(e),l=await fetch("/api/projects".concat(t),{credentials:"include"});if(l.ok){let e=await l.json();ta(e.projects||[])}}catch(e){}},300);return()=>clearTimeout(e)},[tt,null==e$?void 0:e$.shopifyCompanyLocationId]),(0,i.useEffect)(()=>{function e(e){th.current&&!th.current.contains(e.target)&&ts(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let tW=(0,i.useMemo)(()=>{if(0===eL.length)return[];if(0===Object.keys(eb).length)return eL;let e={},t={};for(let[l,n]of Object.entries(eb)){let i=tS.find(e=>e.handle===l),o=null==i?void 0:i.optionsList.find(e=>e.handle===n);i&&o&&(e[i.optionTitle]=N(o),o.value&&(t[i.optionTitle]=o.value))}let l=Object.keys(e);if(0===l.length)return eL;let n=new Set;for(let e of eL)for(let t of Object.keys(E(e.metadataoptions)))n.add(t);return eL.filter(i=>{let o=E(i.metadataoptions);return l.every(l=>{let i=o[l];if(void 0===i)return!n.has(l);let a=L(i);if(S(a,L(e[l])))return!0;let r=t[l];return!!r&&a===L(r)})})},[eL,eb,tS]);async function tZ(){if(!tt.trim()){let e=ec("components.cms.sections.info.please_enter_a_project_name","Please enter a project name.");tp({type:"error",message:e}),(0,r.trackError)("add_to_project_error",{source:"inline",component:"GenericConfigurator",context:"add_to_project",message:e,page:window.location.pathname});return}if(!tn){let e=ec("components.cms.sections.info.please_select_a_project_from_the_suggestions","Please select a project from the suggestions.");tp({type:"error",message:e}),(0,r.trackError)("add_to_project_error",{source:"inline",component:"GenericConfigurator",context:"add_to_project",message:e,page:window.location.pathname});return}td(!0),tp(null);try{var e,t,l,n,i,o,a,s,c,d;let u=null!==(t=null!=tH?tH:tW[0])&&void 0!==t?t:null,p=null!==(n=null!==(l=tz[0])&&void 0!==l?l:null==ef?void 0:null===(e=ef.featuredImage)||void 0===e?void 0:e.url)&&void 0!==n?n:null,h=[];for(let e of tS){let t=eb[e.handle];if(!t)continue;let l=e.optionsList.find(e=>e.handle===t),n=l?N(l):t;h.push({key:e.optionTitle,value:n})}let g=null!=t4&&"none"===C(t4).label.trim().toLowerCase(),m=null!=tK?tK:(null==u?void 0:u.price)!=null?parseFloat(String(u.price)):0,f=t4&&!g?null!=tQ?tQ:parseFloat(String(null!==(i=C(t4).price)&&void 0!==i?i:0)):0,v=m+f,x=e=>{if(!e)return"";let t=e.match(/(\d+)$/);return t?t[1]:e},y=()=>Date.now().toString(16)+Math.random().toString(16).slice(2,14),j=[];if(u&&j.push({shopifyProductId:x((null==ef?void 0:ef.shopifyId)||(null==ef?void 0:ef._id)),shopifyVariantId:x(u.shopifyId||u._id),quantity:eQ||1,productHandle:(null==ef?void 0:ef.handle)||(null==ef?void 0:null===(o=ef.slug)||void 0===o?void 0:o.current)||"",productTitle:u.title||(null==ef?void 0:ef.title)||"Configured",variantTitle:u.title||"Default Title",originalPrice:m,sku:u.sku||"",order_quantity:0,property:JSON.stringify(h),image:{url:p||"",alt:u.title||(null==ef?void 0:ef.title)||""},_id:u._id||y()}),t4&&!g){let e=C(t4),t=null!=tQ?tQ:null!=e.price?parseFloat(String(e.price)):0;j.push({shopifyProductId:x(null===(a=t4.associatedProduct)||void 0===a?void 0:a.shopifyId),shopifyVariantId:x(null===(c=t4.associatedProduct)||void 0===c?void 0:null===(s=c.firstVariant)||void 0===s?void 0:s.shopifyVariantId),quantity:eQ||1,productHandle:"",productTitle:(null===(d=t4.associatedProduct)||void 0===d?void 0:d.title)||e.label||"Accessory",variantTitle:"Default Title",originalPrice:t,sku:e.sku||"",order_quantity:0,property:"[]",image:{url:e.imageUrl||"",alt:e.label||""},_id:y()})}let w=j.length>0?{bundleComponents:j}:null,b=window.location.pathname+window.location.search,k=await fetch("/api/projects/".concat(tn.id,"/items"),{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({product_title:(null==ef?void 0:ef.title)||"Untitled Product",product_id:(null==ef?void 0:ef.shopifyId)||(null==ef?void 0:ef._id)||null,variant_id:(null==u?void 0:u.shopifyId)||(null==u?void 0:u._id)||null,sku:(null==u?void 0:u.sku)||null,handle:b||null,product_image:p,fixture_type:e7||null,price:v,quantity:eQ||1,original_quantity:eQ||1,order_quantity:0,shopify_location_id:(null==e$?void 0:e$.shopifyCompanyLocationId)||void 0,properties:w,is_bundle:j.length>0})});if(!k.ok){let e=(await k.json().catch(()=>({}))).error||"Failed to add to project";tp({type:"error",message:e}),(0,r.trackError)("add_to_project_error",{source:"inline",component:"GenericConfigurator",context:"add_to_project",message:e,page:window.location.pathname});return}tp({type:"success",message:'Added to "'.concat(tn.project_name,'"')}),setTimeout(()=>tp(null),3e3)}catch(e){tp({type:"error",message:"Failed to add to project"}),(0,r.trackError)("add_to_project_error",{source:"inline",component:"GenericConfigurator",context:"add_to_project",message:"Failed to add to project",page:window.location.pathname})}finally{td(!1)}}let tq=(0,i.useMemo)(()=>{var e,t;if(0===tS.length||0===eL.length||!tS.every(e=>{let t=tI.get(e.handle);return!!(t&&0===t.size&&tP.has(e.optionTitle))||!!eb[e.handle]}))return!1;let l=null!==(t=null!==(e=tW[0])&&void 0!==e?e:eL[0])&&void 0!==t?t:null;return!!(null==l?void 0:l.sku)},[tS,eL,tI,tP,eb,tW]),tH=(0,i.useMemo)(()=>{var e,t,l;if(!(tS.length>0&&tS.every(e=>{let t=tI.get(e.handle);return!!(t&&0===t.size&&tP.has(e.optionTitle))||!!eb[e.handle]})))return null;let n=null!==(e=tW[0])&&void 0!==e?e:null;if(!n&&eL.length>0){let e=Object.values(A(eb,tS,tI)).map(e=>L(e));if((n=null!==(t=eL.find(t=>e.every(e=>{var l;return L(null!==(l=t.title)&&void 0!==l?l:"").includes(e)})))&&void 0!==t?t:null)||1!==eL.length||(n=eL[0]),!n){let e=[...Object.keys(eb)].reverse().find(e=>tS.some(t=>
1t.handle===e)),t=e?tS.find(t=>t.handle===e):null,i=t&&e?t.optionsList.find(t=>t.handle===eb[e]):null,o=i?L(i.value||i.title||i.displayName||""):null;o&&(n=null!==(l=eL.find(e=>{var t;return L(null!==(t=e.title)&&void 0!==t?t:"").includes(o)}))&&void 0!==l?l:null)}n||(n=eL[0])}return n},[tS,eL,tI,tP,eb,tW]),{disableAddToCart:t$,ctaLabelText:tG,loading:tD}=(0,x.UX)(null==tH?void 0:tH.handle,null==tH?void 0:tH.sku),[tK,tX]=(0,i.useState)(null),[tJ,tY]=(0,i.useState)(!1),[tQ,t0]=(0,i.useState)(null),[t1,t9]=(0,i.useState)(!1),t5=(0,i.useRef)(!1);!t5.current&&eP&&tI.size>0&&tS.some(e=>{var t;let l=tI.get(e.handle);return!(l&&0===l.size&&tP.has(e.optionTitle))&&(null!==(t=null==l?void 0:l.size)&&void 0!==t?t:0)>1})&&(t5.current=!0);let t2=t5.current;(0,i.useEffect)(()=>{tX(null),(null==tH?void 0:tH.shopifyId)?tY(!0):tY(!1)},[null==tH?void 0:tH.shopifyId,null==tH?void 0:tH.sku]),(0,i.useEffect)(()=>{var e,t,l,n,i,o,a,r,s,c;t0(null);let d=eK&&eo?eo.find(e=>e._key===eK):null,u=null!==(r=null!==(a=null==d?void 0:null===(e=d.associatedProduct)||void 0===e?void 0:e.shopifyId)&&void 0!==a?a:null==d?void 0:null===(l=d.associatedProduct)||void 0===l?void 0:null===(t=l.firstVariant)||void 0===t?void 0:t.shopifyVariantId)&&void 0!==r?r:null,p=null!==(c=null!==(s=null==d?void 0:null===(i=d.associatedProduct)||void 0===i?void 0:null===(n=i.firstVariant)||void 0===n?void 0:n.sku)&&void 0!==s?s:null==d?void 0:null===(o=d.attributeValue)||void 0===o?void 0:o.sku)&&void 0!==c?c:null;u||p?t9(!0):t9(!1)},[eK,eo]);let t4=(0,i.useMemo)(()=>{var e;return eK&&eo&&null!==(e=eo.find(e=>e._key===eK))&&void 0!==e?e:null},[eK,eo]);(0,i.useEffect)(()=>{t0(null),t9(!1)},[null==t4?void 0:t4._key]);let t3=(0,i.useCallback)(async()=>{var e,t,l,n,i,o,a,r;if(!tH||"adding"===e1||t$||tD)return;let s=[];for(let e of tS){let t=eb[e.handle];if(!t)continue;let l=e.optionsList.find(e=>e.handle===t),n=l?N(l):t;s.push({key:e.optionTitle,value:n})}let d=null!=t4&&"none"===C(t4).label.trim().toLowerCase();if(t4&&!d){let i=C(t4),o=null!=tQ?tQ:null!=i.price?parseFloat(String(i.price)):null,a=null!=o?" â $".concat(o.toFixed(2)):"";s.push({key:"Accessory",value:"".concat(i.label).concat(i.sku?" (".concat(i.sku,")"):"").concat(a)});let r=s.find(e=>"Accessory"!==e.key&&e.value===i.label);s.push({key:"_acc_sku",value:i.sku||i.label}),null!=o&&s.push({key:"_acc_price",value:o.toFixed(2)}),s.push({key:"_acc_label",value:i.label}),r&&s.push({key:"_acc_attr_title",value:r.key}),(null===(e=t4.associatedProduct)||void 0===e?void 0:e.shopifyId)&&s.push({key:"_acc_product_id",value:t4.associatedProduct.shopifyId}),(null===(l=t4.associatedProduct)||void 0===l?void 0:null===(t=l.firstVariant)||void 0===t?void 0:t.shopifyVariantId)&&s.push({key:"_acc_variant_id",value:t4.associatedProduct.firstVariant.shopifyVariantId}),i.imageUrl&&s.push({key:"_acc_image",value:i.imageUrl});let c=(null===(n=t4.associatedProduct)||void 0===n?void 0:n.title)||i.label;c&&s.push({key:"_acc_product_title",value:c})}let u=null!=tK?tK:null!=tH.price?parseFloat(String(tH.price)):0,p=t4&&!d?null!=tQ?tQ:parseFloat(String(null!==(i=C(t4).price)&&void 0!==i?i:0)):0;p>0&&s.push({key:"_product_price",value:u.toFixed(2)});let h=window.location.pathname+window.location.search;e2(null),e9("adding");try{await (0,c.Xq)({productId:(null==ef?void 0:ef.shopifyId)||(null==ef?void 0:ef._id)||"",variantId:tH.shopifyId||tH._id||"",title:(null==ef?void 0:ef.title)||"",imageUrl:null!==(r=null!==(a=tz[0])&&void 0!==a?a:null==ef?void 0:null===(o=ef.featuredImage)||void 0===o?void 0:o.url)&&void 0!==r?r:"",quantity:eQ||1,price:u+p,fixtureType:e7||void 0,sku:tH.sku||void 0,requiresShipping:tH.requiresShipping,handle:h||void 0,properties:s}),e9("added"),setTimeout(()=>e9("idle"),2500)}catch(e){e9("error"),setTimeout(()=>e9("idle"),2500)}},[tH,t4,tS,eb,eQ,ef,e1,tK,tQ,e7,t$,tD]);(0,i.useEffect)(()=>{let e=null==tH?void 0:tH.sku;if(!e){e3(null);return}let t=!1;return e3(null),fetch("/api/presale/status-by-sku/".concat(encodeURIComponent(e)),{cache:"no-store"}).then(e=>e.ok?e.json():null).then(e=>{t||e3((null==e?void 0:e.isPresale)===!0)}).catch(()=>{t||e3(!1)}),()=>{t=!0}},[null==tH?void 0:tH.sku]);let[t6,t8]=(0,i.useState)(null);(0,i.useEffect)(()=>{let e=null==tH?void 0:tH.sku;if(!e){t8(null);return}let t=!1;return(0,d.dH)(e).then(e=>{t||t8(e)}),()=>{t=!0}},[null==tH?void 0:tH.sku]);let[t7,le]=(0,i.useState)(null),lt=(0,i.useMemo)(()=>
1{if(!t4)return null;let e=C(t4);return"none"===e.label.trim().toLowerCase()?null:e.sku},[t4]);(0,i.useEffect)(()=>{if(!lt){le(null);return}let e=!1;return(0,d.dH)(lt).then(t=>{e||le(t)}),()=>{e=!0}},[lt]);let ll=(null==t6?void 0:t6.purchasable)===!1||(null==t7?void 0:t7.purchasable)===!1,ln=(0,i.useRef)(null),li=(e,t)=>{ln.current=e,eW(new Set),ek(l=>{let n={...l};return n[e]===t?delete n[e]:n[e]=t,n})},lo=(0,i.useMemo)(()=>{let e=(null==H?void 0:H.trim())||(null==ef?void 0:ef.rowCountTag);return e?e.split(",").map(e=>parseInt(e.trim(),10)||0):[]},[H,null==ef?void 0:ef.rowCountTag]),la=(e,t)=>{let l=e.optionTitle.toLowerCase().includes("temperature");return(0,n.jsx)("div",{className:1===t?"gc-options-row-nowrap":t>1?"gc-options-grid ATbtnSec":"gc-options-row",style:t>1?{gridTemplateColumns:"repeat(".concat(t,", minmax(0, 1fr))")}:void 0,children:e.optionsList.map(t=>{let i=eb[e.handle]===t.handle,o=l&&t.swatchImage&&27===t.swatchImage.width&&27===t.swatchImage.height;return(0,n.jsxs)("button",{type:"button",onClick:()=>t.handle&&li(e.handle,t.handle),className:i?"gc-btn-selected":"gc-btn",children:[N(t),o&&(0,n.jsx)("img",{src:t.swatchImage.url,alt:t.swatchImage.alt||N(t),width:27,height:27,className:"gc-temp-swatch-img"})]},t._id)})})},lr=(e,t,l)=>{let i="trimfinish"===e.optionTitle.replace(/\s+/g,"").toLowerCase();return(0,n.jsx)("div",{className:1===t?"gc-swatch-row-nowrap":"gc-swatch-row",style:t>1?{display:"grid",gridTemplateColumns:"repeat(".concat(t,", minmax(0, 1fr))"),gap:"24px"}:void 0,children:e.optionsList.map(t=>{var o,a,r;let s=eb[e.handle]===t.handle,c=function(e,t,l,n,i,o){let a=l.slice(0,4),r={};for(let l=0;l<=e&&l<a.length;l++){let o=a[l];if(l===e)r[o.optionTitle]=t;else{let e;let t=n[o.handle];if(t&&(e=o.optionsList.find(e=>e.handle===t)),!e){let t=i.get(o.handle);t&&t.size>0&&(e=o.optionsList.find(e=>e.handle&&t.has(e.handle)))}e||(e=o.optionsList[0]),e&&(r[o.optionTitle]=N(e))}}o.map(e=>({variant:e,meta:E(e.metadataoptions)})).filter(e=>{let{meta:t}=e;return Object.entries(r).every(e=>{var l;let[n,i]=e;return(null===(l=t[n])||void 0===l?void 0:l.toLowerCase())===i.toLowerCase()})});let s=[];for(let t=0;t<=e&&t<a.length;t++){var c;let e=null!==(c=r[a[t].optionTitle])&&void 0!==c?c:"";e&&s.push(T(e))}return s.join("_")}(l,N(t),tS,eb,tI,eL),d=M(c,tg),u=null!==(r=null!==(a=Object.keys(eb).length>0?d:null)&&void 0!==a?a:null===(o=t.swatchImage)||void 0===o?void 0:o.url)&&void 0!==r?r:null,p=!!c&&eU.has(c);return(0,n.jsxs)("button",{type:"button",title:N(t),onClick:()=>t.handle&&li(e.handle,t.handle),className:"gc-swatch-item",children:[(0,n.jsx)("div",{className:"gc-swatch-circle ".concat(s?"gc-swatch-circle--selected":"gc-swatch-circle--unselected"),children:u&&!p?(0,n.jsx)("img",{src:u,alt:N(t),onError:()=>c&&eW(e=>new Set([...e,c]))}):(0,n.jsx)("div",{className:"gc-swatch-circle-placeholder",children:(0,n.jsx)("span",{children:N(t).charAt(0)})})}),(0,n.jsx)("span",{className:"gc-swatch-label ".concat(s?"gc-swatch-label--selected":""),children:i?null:N(t)})]},t._id)})})},ls=(e,t)=>(e.optionTitle.replace(/\s+/g,"").toLowerCase(),(0,n.jsx)("div",{className:1===t?"gc-color-row-nowrap":"gc-color-row",style:t>1?{display:"grid",gridTemplateColumns:"repeat(".concat(t,", minmax(0, 1fr))"),gap:"16px 20px"}:void 0,children:e.optionsList.map(t=>{var l;let i=eb[e.handle]===t.handle;return(0,n.jsxs)("button",{type:"button",title:N(t),onClick:()=>t.handle&&li(e.handle,t.handle),className:"gc-color-item",children:[(0,n.jsx)("div",{className:"gc-color-circle ".concat(i?"gc-color-circle--selected":"gc-color-circle--unselected"),children:(null===(l=t.swatchImage)||void 0===l?void 0:l.url)?(0,n.jsx)("img",{src:t.swatchImage.url,alt:N(t)}):(0,n.jsx)("div",{className:"gc-color-circle-empty"})}),(0,n.jsx)("span",{className:"gc-color-label"})]},t._id)})})),lc=(e,t)=>{var l,i;let o=(i=e.swatchStyle)?i.includes("Size 2")?"image":i.includes("Size 1")?"color":"button":"button",a=tI.get(e.handle);if(void 0!==a&&0===a.size&&tP.has(e.optionTitle))return null;let r=a&&a.size>0?{...e,optionsList:e.optionsList.filter(e=>e.handle&&a.has(e.handle))}:e;if(0===r.optionsList.length)return null;let s=e.optionTitle.toLowerCase().includes("temperature"),c=e.optionTitle.toLowerCase().includes("kit"),d="button"===o&&!s&&!c&&r.optionsList.some(e=>{var t;return(null===(t=e.swatchImage)||void 0===t?void 0:t.url)&&!(27===e.swatchImage.width&&27===e.swatchImage.height)})?"image":o,u=null!==(l=lo[t])&&void 0!==l?l:0,p=eb[e.handle],h=p?e.optionsList.find(e=>
1e.handle===p):void 0,g=h?N(h):void 0;return(0,n.jsxs)("div",{className:"gc-option-group",children:[(0,n.jsxs)("p",{className:"gc-option-label",children:[(0,n.jsx)("span",{children:e.optionTitle}),g&&(0,n.jsx)("span",{className:"gc-option-selected-value",children:g})]}),"button"===d&&la(r,u),"image"===d&&lr(r,u,t),"color"===d&&ls(r,u)]},e._id)},ld=(0,i.useCallback)(()=>{let e={};for(let t of tS){let l=eb[t.handle];if(!l)continue;let n=t.optionsList.find(e=>e.handle===l);e[t.optionTitle]=n&&(n.value||n.title||n.displayName)||l}let t={configuration:e};return(null==tH?void 0:tH.title)&&(t.variantTitle=tH.title),(null==ef?void 0:ef.title)&&(t.productTitle=ef.title),Object.keys(t).length>0?t:null},[tS,eb,tH,ef]),lu=(null==ef?void 0:null===(t=ef.title)||void 0===t?void 0:t.toLowerCase().replace(/\s+/g,"-"))||(null==tH?void 0:tH.sku)||"",lp=Q?{backgroundColor:Q}:void 0,lh="full"===ee?"w-full px-4 md:px-16":"max-w-[1400px] mx-auto px-4 md:px-16";if(ex)return(0,n.jsx)("section",{id:V,className:"gc-section gc-section--loading",style:{minHeight:"2920px",...lp},children:(0,n.jsx)("div",{className:lh,children:(0,n.jsx)("div",{className:"gc-status-center",children:(0,n.jsx)("span",{className:"gc-status-loading",children:"Loadingâ¦"})})})});if(ej||!ef)return(0,n.jsx)("section",{id:V,className:"gc-section gc-section--error",style:lp,children:(0,n.jsx)("div",{className:lh,children:(0,n.jsx)("div",{className:"gc-status-center",children:(0,n.jsx)("span",{className:"gc-status-error",children:null!=ej?ej:"Product not found."})})})});let lg=W&&Array.isArray(W)&&W.length>0?(0,o.dC)(W):null;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("link",{rel:"stylesheet",href:"/styles-min/cms/theme/configurator-bundle.css?v=".concat(w),precedence:"default"}),(0,n.jsxs)("section",{id:V,className:"gc-section",style:lp,children:[(0,n.jsxs)("div",{className:"page-width",children:[(null==ef?void 0:ef.title)&&(0,n.jsxs)("nav",{className:"product-breadcrumbs",role:"navigation","aria-label":"breadcrumbs",children:[(0,n.jsx)("a",{href:"/",children:"Home"}),"\xa0\xa0/\xa0\xa0",(0,n.jsx)("span",{children:ef.title})]}),(0,n.jsxs)("div",{className:"gc-layout-grid",children:[(0,n.jsxs)("div",{className:"gc-left-col",children:[en?(0,n.jsx)("div",{className:"gc-image-grid gc-image-grid--single cardWidthSize",children:(0,n.jsx)("div",{className:"gc-image-cell gc-image-cell--single",children:eF&&0===tz.length?(0,n.jsx)("div",{className:"gc-image-pulse"}):tz[0]&&!eO.has(0)?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("img",{src:k(tz[0]),alt:"Product view",fetchPriority:"high",onError:()=>eB(e=>new Set([...e,0]))}),(0,n.jsx)("button",{type:"button",className:"gc-zoom-btn gc-zoom-btn--stylized","aria-label":"Zoom image",onClick:()=>eV(tz[0]),children:"+"})]}):(0,n.jsx)("div",{className:"gc-image-placeholder"})})}):(0,n.jsx)("div",{className:"gc-img-carousel-wrap",onTouchStart:tR,onTouchMove:tV,onTouchEnd:tU,children:(0,n.jsx)("div",{ref:tN,className:"gc-image-grid cardWidthSize",style:ty?{transform:tB()}:void 0,children:Array.from({length:4}).map((e,t)=>{var l;let i=null!==(l=tz[t])&&void 0!==l?l:null,o=eO.has(t);return(0,n.jsx)("div",{className:"gc-image-cell",children:eF&&!i?(0,n.jsx)("div",{className:"gc-image-pulse"}):i&&!o?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("img",{src:k(i,0===t?900:600),alt:"Product view ".concat(t+1),fetchPriority:0===t?"high":"auto",onError:()=>eB(e=>new Set([...e,t]))}),(0,n.jsx)("button",{type:"button",className:"gc-zoom-btn gc-zoom-btn--stylized","aria-label":"Zoom image ".concat(t+1),onClick:()=>eV(i),children:"+"})]}):(0,n.jsx)("div",{className:"gc-image-placeholder"})},t)})})}),!en&&tO>1&&(0,n.jsxs)("div",{className:"gc-img-pagination",children:[(0,n.jsxs)("span",{className:"gc-img-counter",children:[tw+1,"/",tO]}),(0,n.jsx)("span",{className:"gc-img-dots",children:Array.from({length:tO}).map((e,t)=>(0,n.jsx)("button",{className:tw===t?"active":"",onClick:()=>tb(t)},t))})]})]}),(0,n.jsxs)("div",{className:"gc-right-col",children:[ed&&!ep?(U||ed)&&(0,n.jsxs)("div",{className:"gc-heading-row",children:[U&&(0,n.jsx)("h2",{className:"gc-heading gc-heading--inline",children:U}),eH&&(0,n.jsxs)("a",{href:"#".concat(ed),className:"font-neue-roman title-downloads_btn",onClick:e=>{e.preventDefault();let t=document.getElementById(ed);t&&t.scrollIntoView({behavior:"smooth",block:"start"})},children:["Downloads",(0,n.jsxs)("svg",{width:"14.8",height:"11.99",viewBox:"0 0 14 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[(0,n.jsx)("path",{d:"M12.99 8.53753L6.99499 14.8996L12.99 8.53753Z",fill:"#5A5857"}),(0,n.jsx)("path",{d:"M0.99999 8.53753L6.99499 14.8996L0.99999 8.53753Z",fill:"#5A5857"}),(0,n.jsx)("path",{d:"M6.99499 0.100586L6.99499 14.8996M6.99499 14.8996L12.99 8.53753M6.99499 14.8996L0.99999 8.53753",stroke:"#5A5857",strokeWidth:"1.5",strokeMiterlimit:"10"})]})]})]}):U&&(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)("div",{className:"gc-heading-wrapper",children:[(0,n.jsx)("h2",{className:"gc-heading gc-heading--no-mb",children:U}),eH&&!ep&&(0,n.jsxs)("a",{href:"#downloads",className:"title-downloads",onClick:e=>{e.preventDefault();let t=document.getElementById("downloads")||document.getElementById("Downloads");t&&t.scrollIntoView({behavior:"smooth",block:"start"})},children:["Downloads",(0,n.jsxs)("svg",{style:{marginLeft:"6px"},width:"14.8",height:"11.99",viewBox:"0 0 14 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,n.jsx)("path",{d:"M12.99 8.53753L6.99499 14.8996L12.99 8.53753Z",fill:"#5A5857"}),(0,n.jsx)("path",{d:"M0.99999 8.53753L6.99499 14.8996L0.99999 8.53753Z",fill:"#5A5857"}),(0,n.jsx)("path",{d:"M6.99499 0.100586L6.99499 14.8996M6.99499 14.8996L12.99 8.53753M6.99499 14.8996L0.99999 8.53753",stroke:"#5A5857",strokeWidth:"1.5",strokeMiterlimit:"10"})]})]})]})}),lg&&(0,n.jsx)("p",{className:"gc-description",children:lg}),(0,n.jsxs)("div",{className:"cardBorderSec",children:[(0,n.jsxs)("button",{type:"button",onClick:()=>{let e=!eZ;eq(e),e&&"Installation Options"===y.accessories_label&&eD(!1)},className:"AccBtnSec gc-accordion-btn ".concat(eZ?"gc-accordion-btn--open":"gc-accordion-btn--collapsed"),children:[(0,n.jsxs)("span",{className:"gc-accordion-label-row",children:[(0,n.jsx)("span",{className:"gc-status-dot ".concat(tq?"gc-status-dot--active":"gc-status-dot--inactive"),style:tq&&!t2?{backgroundColor:"#6B9B87"}:void 0}),(0,n.jsx)("span",{className:"fontTextColor",children:eg})]}),(0,n.jsx)("span",{className:"gc-accordion-icon",children:eZ?"â":"+"})]}),eZ&&(tS.length>0?(0,n.jsx)("div",{className:"gc-accordion-body",children:tS.map((e,t)=>lc(e,t))}):(0,n.jsx)("p",{className:"gc-no-options",children:"No configuration options available for this product."}))]}),eH&&eo&&eo.length>0&&(()=>{let e=Object.keys(eb).length>0,t={};for(let e of tS){let l=eb[e.handle];if(!l)continue;let n=e.optionsList.find(e=>e.handle===l);n&&(t[e.optionTitle]=n.title||n.displayName||n.value)}let l=eo.filter(l=>(!!l.attributeValue||!!l.associatedProduct)&&("none"===C(l).label.trim().toLowerCase()||F(l.conditions,!1!==l.showWhenMatched,t,e))),i=l.filter(e=>eK===e._key).map(e=>C(e).label);return(0,n.jsxs)("div",{className:"cardBorderSec",children:[(0,n.jsxs)("button",{type:"button",onClick:()=>{let e=!eG;eD(e),e&&"Installation Options"===y.accessories_label&&eq(!1)},className:"AccBtnSec gc-accordion-btn ".concat(eG?"gc-accordion-btn--open":"gc-accordion-btn--collapsed"),children:[(0,n.jsxs)("span",{className:"gc-accordion-label-row gc-accordion-label-row--overflow",children:["Installation Options"===y.accessories_label&&eK&&(0,n.jsx)("span",{className:"gc-status-dot gc-status-dot--active"}),(0,n.jsx)("span",{className:"fontTextColor",children:y.accessories_label||"Accessories"})]}),(0,n.jsx)("span",{className:"gc-accordion-icon",children:eG?"â":"+"})]}),eG&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("p",{className:"gc-option-label",children:[(0,n.jsx)("span",{children:"Accessories"}),i.length>0&&(0,n.jsx)("span",{className:"gc-option-selected-value",style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:i.join(", ")})]}),(0,n.jsx)("div",{className:"gc-accessories-grid",children:l.map(e=>{let l=C(e),i=l.label,o=eK===e._key,a=tS.map(e=>{var l;return T(null!==(l=t[e.optionTitle])&&void 0!==l?l:"")}
1).filter(Boolean),r=T(i),s=null;for(let e=a.length;e>=0&&!(s=M([...a.slice(0,e),r].filter(Boolean).join("_"),tg));e--);let c=null!=s?s:l.imageUrl;return(0,n.jsxs)("button",{type:"button",className:"gc-swatch-item gc-accessory-btn",title:i,onClick:()=>{eY(!0),eX(t=>t===e._key?null:e._key)},children:[(0,n.jsx)("div",{className:"gc-swatch-circle ".concat(o?"gc-swatch-circle--selected":"gc-swatch-circle--unselected"),children:c?(0,n.jsx)("img",{src:c,alt:i}):(0,n.jsx)("div",{className:"gc-swatch-circle-placeholder",children:(0,n.jsx)("span",{children:i.charAt(0)})})}),(0,n.jsx)("span",{className:"gc-swatch-label ".concat(o?"gc-swatch-label--selected":""),children:i})]},e._key)})})]})]})})(),eH&&!ep&&!e4&&(0,n.jsxs)("div",{className:"cardBorderSec",children:[(0,n.jsxs)("button",{className:"AccBtnSec gc-accordion-btn ".concat(e6?"gc-accordion-btn--open":"gc-accordion-btn--collapsed"),type:"button",onClick:()=>e8(e=>!e),children:[(0,n.jsxs)("span",{className:"gc-accordion-label-row",children:[(0,n.jsx)("span",{className:"fontTextColor",children:"Fixture Type / Project"}),(0,n.jsx)("span",{className:"gc-tooltip-container",onClick:e=>e.stopPropagation(),children:(0,n.jsxs)("span",{className:"gc-tooltip-trigger cfg-fixture-tooltip-trigger",children:["?",(0,n.jsx)("span",{className:"cfg-fixture-tooltip",children:"Enter a label or description for this fixture to identify its type or placement on the jobsite."})]})})]}),(0,n.jsx)("span",{className:"gc-accordion-icon",children:e6?"â":"+"})]}),e6&&(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"gc-option-group",style:{borderBottom:"none"},children:[(0,n.jsxs)("p",{className:"cfg-option-label",children:[(0,n.jsx)("span",{children:"Fixture Type"}),(0,n.jsx)("span",{className:"cfg-option-selected-value",children:"(optional)"})]}),(0,n.jsx)("input",{type:"text",value:e7,onChange:e=>te(e.target.value),placeholder:"Enter Fixture Type",maxLength:25,className:"boxstyleSec"})]}),(0,n.jsxs)("div",{className:"gc-option-group gc-fixture-inline-block",children:[(0,n.jsxs)("div",{style:{position:"relative",flex:1},ref:th,children:[(0,n.jsx)("input",{type:"text",value:tn?tn.project_name:tt,onCh
1ange:e=>{tl(e.target.value),ti(null),ts(!0)},onFocus:()=>ts(!0),placeholder:"Search and select a project",className:"boxstyleSec boxWidSec"}),tr&&to.length>0&&(0,n.jsx)("div",{className:"project-search-dropdown",style:{position:"absolute",top:"100%",left:0,zIndex:50,background:"rgb(245, 240, 235)",border:"1.25px solid #c2bfba",borderTop:"none",borderRadius:"0 0 8px 8px",maxHeight:"200px",overflowY:"auto",boxShadow:"0 4px 12px rgba(0,0,0,0.08)"},children:to.map(e=>(0,n.jsx)("button",{type:"button",style:{display:"block",width:"100%",textAlign:"left",padding:"10px 21px",border:"none",background:(null==tn?void 0:tn.id)===e.id?"#ebe4db":"transparent",cursor:"pointer",fontSize:"14px",lineHeight:"20px",color:"#292521",fontFamily:"Neue Haas Grotesk Display Pro, sans-serif"},onClick:()=>{ti(e),tl(e.project_name),ts(!1)},children:e.project_name},e.id))})]}),tH?(0,n.jsx)("button",{type:"button",className:"cfg-contact-btn",onClick:tZ,disabled:tc,children:tc?"Addingâ¦":"Add to Project"}):(0,n.jsx)("button",{type:"button",className:"cfg-contact-btn",disabled:!0,children:"Make Selections"}),tu&&(0,n.jsx)("p",{style:{margin:"4px 0 0",fontSize:"13px",color:"success"===tu.type?"#16a34a":"#dc2626"},children:tu.message})]})]})]}),eH&&!ep&&(()=>{var e,t,l,i,o,a,r,s,c,d,h,g,m,v,x,y,j;let w=!1,b=null;if((w=tS.length>0&&tS.every(e=>{let t=tI.get(e.handle);return!!(t&&0===t.size&&tP.has(e.optionTitle))||!!eb[e.handle]}))&&!(b=null!==(s=tW[0])&&void 0!==s?s:null)&&eL.length>0){let e=Object.values(A(eb,tS,tI)).map(e=>L(e));if((b=null!==(c=eL.find(t=>e.every(e=>{var l;return L(null!==(l=t.title)&&void 0!==l?l:"").includes(e)})))&&void 0!==c?c:null)||1!==eL.length||(b=eL[0]),!b){let e=[...Object.keys(eb)].reverse().find(e=>tS.some(t=>t.handle===e)),t=e?tS.find(t=>t.handle===e):null,l=t&&e?t.optionsList.find(t=>t.handle===eb[e]):null,n=l?L(l.value||l.title||l.displayName||""):null;n&&(b=null!==(d=eL.find(e=>{var t;return L(null!==(t=e.title)&&void 0!==t?t:"").includes(n)}))&&void 0!==d?d:null)}b||(b=eL[0])}let k=null!==(h=null==b?void 0:b.sku)&&void 0!==h?h:null,_=(null==b?void 0:b.price)!=null?parseFloat(String(b.price)):null,N=eK&&eo?eo.find(e=>e._key===eK):null,S=N?C(N):null,T=(null==S?void 0:S.sku)||null,I=null!=S&&"none"===S.label.trim().toLowerCase(),P=(null==S?void 0:S.price)!=null?parseFloat(String(S.price)):null,M=I?0:null===N?0:t1?null:tQ,E=I||null==M?null:"$".concat((0,p.T)(M)),F=null!==(g=null==N?void 0:null===(e=N.associatedProduct)||void 0===e?void 0:e.shopifyId)&&void 0!==g?g:null,z=null!==(v=null!==(m=null==N?void 0:null===(l=N.associatedProduct)||void 0===l?void 0:null===(t=l.firstVariant)||void 0===t?void 0:t.sku)&&void 0!==m?m:null==N?void 0:null===(i=N.attributeValue)||void 0===i?void 0:i.sku)&&void 0!==v?v:null,B=w?tK:null,R=null!=B&&null!=M?B+M:null,V=F&&N?(0,n.jsx)("span",{style:{display:"none"},children:(0,n.jsx)(u.Z,{shopifyProductId:F,variantId:null,sku:z,onPriceResolved:e=>t0(e),onLoadingChange:e=>t9(e)})}):null,U="number"==typeof eQ&&eQ>0?eQ:1;return(0,n.jsxs)("div",{className:"gc-sku-price-block",children:[V,(0,n.jsxs)("p",{className:"gc-sku-line",style:{display:"inline-flex",alignItems:"center",gap:"6px",flexWrap:"wrap"},children:[(0,n.jsxs)("span",{className:"gc-sku-line-bold",children:[em,":"]})," ",null!=k?k:"âââ",k&&null!=B?" - $".concat((0,p.T)(B)," USD"):"",eH&&k&&(0,n.jsx)(f.Z,{sku:k,quantity:"number"==typeof eQ?eQ:1,plain:!0})]}),S&&(T||E)&&(0,n.jsxs)("p",{className:"gc-sku-line",style:{marginTop:"2px",display:"inline-flex",alignItems:"center",gap:"6px",flexWrap:"wrap"},children:[(0,n.jsx)("span",{className:"gc-sku-line-bold",children:"Accessories:"})," ",(0,n.jsx)("span",{children:T?"".concat(T).concat(eH&&E?" - ".concat(E," USD"):""):eH&&E?"".concat(E," USD"):null}),eH&&T&&(0,n.jsx)(f.Z,{sku:T,quantity:"number"==typeof eQ?eQ:1,plain:!0})]}),(null==N?void 0:null===(o=N.associatedProduct)||void 0===o?void 0:o.shopifyId)&&(0,n.jsx)("span",{style:{display:"none"},"aria-hidden":"true",children:(0,n.jsx)(u.Z,{shopifyProductId:N.associatedProduct.shopifyId,variantId:null!==(x=null===(a=N.associatedProduct.firstVariant)||void 0===a?void 0:a.shopifyVariantId)&&void 0!==x?x:null,sku:null!==(y=null==S?void 0:S.sku)&&void 0!==y?y:null,msrpFallback:null!=P?P:void 0,onPriceResolved:e=>t0(e),onLoadingChange:e=>t9(e)})}),(0,n.jsx)("p",{className:"gc-total-price",children:t2?null!==tH?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{style:null!=R?{display:"none"}:void 0,children:(0,n.jsx)(u.Z,{shopifyProductId:tH.shopifyId||(null==b?void 0:b.shopifyId)||(null==ef?void 0:ef.shopifyId),variantId:null,sku:tH.sku,msrpFallback:_,showCompareAt:!0,size:"lg",onPriceResolved:e=>tX(e),onLoadingChange:e=>tY(e)})}),null!=R&&(0,n.jsx)("span",{className:"product-price product-price--lg",children:(0,n.jsxs)("span",{className:"product-price__amount",children:["$",(0,p.T)(R*U)]})})]}):null:(0,n.jsxs)(n.Fragment,{children:[null!==tH&&(0,n.jsx)("span",{style:{display:"none"},children:(0,n.jsx)(u.Z,{shopifyProductId:tH.shopifyId||(null==b?void 0:b.shopifyId)||(null==ef?void 0:ef.shopifyId),variantId:null,sku:tH.sku,msrpFallback:_,showCompareAt:!0,size:"lg",onPriceResolved:e=>tX(e),onLoadingChange:e=>tY(e)})}),null!=R?(0,n.jsx)("span",{className:"product-price product-price--lg",children:(0,n.jsxs)("span",{className:"product-price__amount",children:["$",(0,p.T)(R*U)]})}):tJ?(0,n.jsxs)("span",{className:"price-ellipsis","aria-label":"Loading price",children:[(0,n.jsx)("span",{}),(0,n.jsx)("span",{}),(0,n.jsx)("span",{})]}):null!=tK?(0,n.jsx)("span",{className:"product-price product-price--lg",children:(0,n.jsxs)("span",{className:"product-price__amount",children:["$",(0,p.T)(tK*U)]})}):null]})}),(()=>{let e=tS.find(e=>"trimfinish"===e.optionTitle.replace(/\s+/g,"").toLowerCase()),t=e?eb[e.handle]:null,l=t?null==e?void 0:e.optionsList.find(e=>e.handle===t):null,i=l?(l.title||l.displayName||l.value||"").toLowerCase():"";return"brass"===i||"graphite"===i||"copper"===i?(0,n.jsxs)("p",{style:{margin:"8px 0 4px",fontSize:"13px",color:"#fd0101",display:"flex",alignItems:"flex-start",ga
1p:"6px"},children:[(0,n.jsx)("span",{style:{flexShrink:0},children:"â ï¸"}),(0,n.jsx)("span",{children:"Premium trims are manufactured to order and have a 12-week lead time before they can be shipped."})]}):null})(),(null==N?void 0:N.comment)&&eJ&&(0,n.jsxs)("div",{className:"gc-accessory-comment",children:[(null===(r=N.commentImage)||void 0===r?void 0:r.url)&&(0,n.jsx)("img",{src:N.commentImage.url,alt:null!==(j=N.commentImage.alt)&&void 0!==j?j:"",className:"gc-accessory-comment-icon"}),(0,n.jsx)("span",{className:"gc-accessory-comment-text",children:O(N.comment)})]})]})})(),eH&&(0,n.jsxs)("div",{className:"gc-qty-row",children:[!e4&&(0,n.jsx)(h.B,{value:eQ,onChange:e0}),tH&&""!==eQ?null===e4?(0,n.jsx)("button",{type:"button",className:"gc-add-to-cart-btn gc-addCart-btn",disabled:!0,children:(0,n.jsx)("span",{children:"Loadingâ¦"})}):e4?(0,n.jsx)(g.Z,{productHandle:lu,productTitle:null==ef?void 0:ef.title,skuId:(null==tH?void 0:tH.sku)||null,getExtrasJson:ld},null==tH?void 0:tH.sku):t$?(0,n.jsx)("button",{type:"button",className:"gc-add-to-cart-btn gc-addCart-btn",disabled:!0,children:(0,n.jsx)("span",{children:tG||"Contact Us to Order"})}):ll?(0,n.jsx)("button",{type:"button",className:"gc-add-to-cart-btn gc-addCart-btn",disabled:!0,children:(0,n.jsx)("span",{children:"Out of Stock"})}):(0,n.jsxs)("button",{type:"button",className:"gc-add-to-cart-btn gc-addCart-btn",disabled:"adding"===e1||tD,onClick:t3,"data-ph-capture-attribute-product-name":(null==ef?void 0:ef.title)||"","data-ph-capture-attribute-product-price":null!=tK?String(tK):"",children:[(0,n.jsx)("span",{children:"adding"===e1?"Addingâ¦":"added"===e1?"â Added":"error"===e1?"Failed":"Add to Cart"}),(0,n.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none","aria-hidden":"true",children:(0,n.jsx)("path",{d:"M3.75 9H14.25M14.25 9L9.75 4.5M14.25 9L9.75 13.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]}):(0,n.jsxs)("button",{type:"button",className:"gc-add-to-cart-btn gc-addCart-btn",disabled:!0,children:[(0,n.jsx)("span",{children:t2?"Make Selections":"Add to Cart"}),(0,n.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none","aria-hidden":"true",children:(0,n.jsx)("path",{d:"M3.75 9H14.25M14.25 9L9.75 4.5M14.25 9L9.75 13.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]})]}),!eH&&(0,n.jsxs)("a",{href:X,className:"gc-contact-btn",children:[(0,n.jsx)("span",{children:K}),(0,n.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none","aria-hidden":"true",children:(0,n.jsx)("path",{d:"M3.75 9H14.25M14.25 9L9.75 4.5M14.25 9L9.75 13.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]}),ll?(0,n.jsxs)("p",{style:{marginTop:"10px",color:"red"},children:[(0,n.jsx)("span",{style:{fontWeight:"bold"},children:ec("kit.oos.title","This combination is currently unavailable for Kit Options, Housings & Conversion Kits, Modules.")}),(0,n.jsx)("br",{}),ec("kit.oos.subtitle","Please review and adjust your selections.")]}):(0,n.jsx)(m.ZP,{handle:(null==tH?void 0:tH.sku)||void 0,sku:null==tH?void 0:tH.sku,quantity:"number"==typeof eQ?eQ:1,context:"pdp"}),e5&&(0,n.jsx)("p",{style:{margin:"8px 0 0",fontSize:"13px",color:"#c0392b",fontWeight:500,lineHeight:"1.5"},children:e5}),J&&(0,n.jsx)("p",{className:"gc-footer-note",children:O(J)})]})]})]}),eR&&(0,n.jsx)("div",{className:"gc-lightbox-overlay",role:"dialog","aria-modal":"true",onClick:()=>eV(null),children:(0,n.jsxs)("div",{className:"gc-lightbox-inner",onClick:e=>e.stopPropagation(),children:[(0,n.jsx)("img",{src:eR,alt:"Product zoomed view",className:"gc-lightbox-image"}),(0,n.jsxs)("button",{type:"button",className:"gc-lightbox-close",title:"",onClick:()=>eV(null),children:[(0,n.jsx)("span",{className:"sr-only",children:"Close image"}),(0,n.jsxs)("svg",{width:"36",height:"36",viewBox:"0 0 36 36",fill:"none","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",children:[(0,n.jsx)("rect",{width:"36",height:"36",rx:"18",fill:"#EFEBE6"}),(0,n.jsx)("path",{d:"M13.057 13.7506L22.2494 22.943M12.9038 23.0962L17.6532 18.3468L22.0962 13.9038",stroke:"#292521",strokeWidth:"1.5"})]})]})]})})]})]})}}}]);
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.