PageSourceSearch

https://freedommunitions.com/cdn/shop/t/7/assets/form-dealers.js?v=105450629215820311211790866428

js freedommunitions.com collected 2026-10-03 23:37:38 UTC 19,468 bytes, 394 lines download raw bytes

1let headings={business:{text:"Business Contact Information",added:!1},principals:{text:"Principals (Owners and Decision Makers)",added:!1},shipping:{text:"Shipping Instructions",added:!1}};const createStyledHeading=text=>{const heading=document.createElement("h1");return heading.textContent=text,heading.className="register-form-heading",heading.style.cssText=`
2        color: var(--1-Deep-Green, #2B3729);
3        text-align: center;
4        font-family: var(--font-heading-family);
5        font-size: 38px;
6        font-style: normal;
7        font-weight: 700;
8        line-height: 48px;
9        letter-spacing: -0.76px;
10        margin: 42px 0 32px 0;
11    `,heading},FILE_UPLOAD_MESSAGE_TAX="If you have a tax exemption certificate please upload it here",FILE_UPLOAD_MESSAGE_FFL="Please upload FFL and Business License",isFflPickupPage=()=>window.location.pathname.replace(/\/+$/,"")==="/pages/ffl-pickup-location",getFileUploadMessage=()=>isFflPickupPage()?FILE_UPLOAD_MESSAGE_FFL:FILE_UPLOAD_MESSAGE_TAX,applyFileUploadMessages=shadowRoot=>{const message=getFileUploadMessage();shadowRoot.querySelectorAll('[class^="_formFileInputField_"]').forEach(field=>{field.setAttribute("data-upload-message",message)})},FULL_WIDTH_FIELD_IDS=new Set(["company_name","custom#mailing_address_1"]),isFullWidthFieldContainer=container=>{if(container.querySelector("textarea, select"))return!0;const input=container.querySelector("input");if(!input)return!0;const fieldId=input.id||"";return FULL_WIDTH_FIELD_IDS.has(fieldId)?!0:fieldId.includes("company_name")},applyDealerFormLayout=shadowRoot=>{const form=shadowRoot.querySelector('form[class^="_formFieldset_"]'),containers=shadowRoot.querySelectorAll('div[class^="_formFieldContainer_"]');
11if(!form||!containers.length)return;shadowRoot.querySelectorAll(".dealer-form-grid-host").forEach(el=>{el.classList.remove("dealer-form-grid-host")});const gridHost=containers[0].parentElement===form?form:containers[0].parentElement,isStackedLayout=window.matchMedia("(max-width: 990px)").matches;gridHost&&(gridHost.classList.add("dealer-form-grid-host"),gridHost.classList.toggle("dealer-form-layout--stacked",isStackedLayout)),shadowRoot.querySelectorAll(".register-form-heading").forEach(heading=>{heading.classList.add("dealer-form-field--full")}),shadowRoot.querySelectorAll('fieldset[class^="_checkboxFieldSet_"], [class^="_formFileInput_"], [class^="_formFileInputLabel_"], [class^="_formFileInputField_"]').forEach(el=>{el.classList.add("dealer-form-field--full")}),containers.forEach(container=>{container.classList.remove("dealer-form-field--full","dealer-form-field--half"),isStackedLayout||isFullWidthFieldContainer(container)?container.classList.add("dealer-form-field--full"):container.classList.add("dealer-form-field--half")}),shadowRoot.querySelectorAll('[class^="_formFileInput_"], [class^="_formFileInputLabel_"], [class^="_formFileInputField_"]').forEach(el=>{el.style.setProperty("width","100%","important"),el.style.setProperty("max-width","100%","important"),el.style.setProperty("min-width","0","important"),el.style.setProperty("box-sizing","border-box","important")}),applyFileUploadMessages(shadowRoot)},applyFormStyles=shadowRoot=>{if(shadowRoot.querySelector("#dealer-form-custom-styles-v4"))return;shadowRoot.querySelector("#dealer-form-custom-styles")?.remove(),shadowRoot.querySelector("#dealer-form-custom-styles-v2")?.remove(),shadowRoot.querySelector("#dealer-form-custom-styles-v3")?.remove();const style=document.createElement("style");style.id="dealer-form-custom-styles-v4",style.textContent=`
12        #form-container-ref section[data-sizing="form-wrapper"] {
13            max-width: 986px;
14            margin: 0 auto;
15            width: 100%;
16            box-sizing: border-box !important;
17        }
18
19        #form-container-ref section[data-sizing="form-wrapper"] form {
20          max-width: 800px;
21          padding: 0 50px;
22            margin: 0 auto;
23            width: 100%;
24            gap: 32px !important;
25            box-sizing: border-box !important;
26        }
27
28        ._formFieldContainer_1ydxd_5:nth-child(3) {
29       display: none !important;
30       }
31            
32        ._formFieldContainer_1ydxd_5 {
33            margin-bottom: 20px;
34        }
35
36        [class^="_textBody_"] p,
37         [class^="_textBody_"] p a{
38      color:  #212121 !important;
39text-align: center;
40        font-family: var(--font-body-family) !important;
41font-size: 18px !important;
42font-style: normal;
43font-weight: 400;
44line-height: 28px; 
45letter-spacing: 0.1px !important;
46        }
47
48        section[class^="_formHeader_"] {
49           margin: 0px auto 40px auto !important;
50        }
51
52        div[class^="_formFieldContainer_"] input,
53        div[class^="_formFieldContainer_"] select,
54        div[class^="_formFieldContainer_"] textarea {
55            padding: 25px 12px 8px 12px !important;
56            border: 0.5px solid #484848 !important;
57            border-radius: 8px !important;
58            background: transparent !important;
59            font-family: var(--font-body-family) !important;
60            font-size: 16px !important;
61            box-shadow: 0px 1px 2px 0px rgba(10, 13, 18, 0.05) !important;
62        }
63
64        form[class^="_formFieldset_"],
65        .dealer-form-grid-host {
66            display: grid !important;
67            grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
68            column-gap: 40px !important;
69            row-gap: 24px !important;
70            align-items: start !important;
71        }
72
73        @media (max-width: 990px) {
74            form[class^="_formFieldset_"],
75            .dealer-form-grid-host,
76            .dealer-form-layout--stacked {
77                grid-template-columns: minmax(0, 1fr) !important;
78                column-gap: 0 !important;
79            }
80
81            #form-container-ref section[data-sizing="form-wrapper"],
82            #form-container-ref section[data-sizing="form-wrapper"] form,
83            form[class^="_formFieldset_"],
84            .dealer-form-grid-host {
85                width: 100% !important;
86                max-width: 100% !important;
87                min-width: 0 !important;
88            }
89
90            div[class^="_formFieldContainer_"],
91            div[class^="_formFieldContainer_"].dealer-form-field--half,
92            div[class^="_formFieldContainer_"].dealer-form-field--full {
93                grid-column: 1 / -1 !important;
94                width: 100% !important;
95                max-width: 100% !important;
96                min-width: 0 !important;
97            }
98
99            div[class^="_formFieldContainer_"] > *,
100            div[class^="_formFieldContainer_"] [class^="_formInputField_"],
101            div[class^="_formFieldContainer_"] [class^="_inputWrapper_"],
102            [class^="_formFileInput_"],
103            [class^="_formFileInputLabel_"],
104            [class^="_formFileInputField_"] {
105                width: 100% !important;
106                max-width: 100% !important;
107                min-width: 0 !important;
108                box-sizing: border-box !important;
109            }
110
111            [class^="_formFileInputLabel_"] {
112                padding: 24px 16px !important;
113            }
114
115            [class^="_formFileInputField_"]::before {
116                left: 16px !important;
117                right: 16px !important;
118            }
119        }
120
121        .dealer-form-field--full {
122            grid-column: 1 / -1 !important;
123            width: 100% !important;
124            max-width: 100% !important;
125        }
126
127        div[class^="_formFieldContainer_"].dealer-form-field--half {
128            grid-column: auto !important;
129            width: 100% !important;
130            max-width: 100% !important;
131            min-width: 0 !important;
132        }
133
134        div[class^="_formFieldContainer_"] {
135            width: 100% !important;
136            max-width: 100% !important;
137            margin-bottom: 0 !important;
138            margin-right: 0 !important;
139            height: auto !important;
140            min-height: 0 !important;
141            position: relative !important;
142            padding-bottom: 10px !important;
143            box-sizing: border-box !important;
144        }
145
146       div[class^="_formFieldContainer_"]:nth-child(3) {
147            display: none !important;
148        }
149
150
151
152      label[class^="_formInputFieldLabel_"] {
153      color:  #212124 !important;
154        font-family: var(--font-body-family) !important;
155font-size: 16px !important;
156font-style: normal;
157font-weight: 400 !important;
158line-height: 24px; 
159letter-spacing: 0.1px !important;
160      }
161
162      fieldset[class^="_checkboxFieldSet_"] legend {
163      display: none !important;
164      }
165
166      fieldset[class^="_checkboxFieldSet_"] {
167      margin-bottom: 32px !important;
168      }
169
170        button[type="submit"] {
171            border-radius: 2px !important;
172            border: 1px solid  #8A0016 !important;
173            background: #8A0016 !important;
174            box-shadow: 0px 1px 2px 0px rgba(10, 13, 18, 0.05);
175            color: #FFFFFF !important;
176            font-family: var(--font-body-family) !important;
177            font-size: 18px !important;
178            font-style: normal;
179            font-weight: 500;
180            line-height: 28px; 
181            padding: 16px 28px !important;
182            width: 164px !important;
183            margin: 50px auto 0 auto !important;
184        }
185
186
187        [class^="_formFileInput_"],
188        [class^="_formFileInputLabel_"],
189        [class^="_formFileInputField_"] {
190            width: 100% !important;
191            max-width: 100% !important;
192            min-width: 0 !important;
193            box-sizing: border-box !important;
194        }
195
196        [class^="_formFileInputLabel_"] {
197            display: flex !important;
198            flex-direction: column !important;
199            align-items: center !important;
200            justify-content: center !important;
201            padding: 24px 16px !important;
202            margin: 0 !important;
203            border-radius: 8px !important;
204        }
205
206        [class^="_formFileInputField_"] {
207        background: transparent !important;
208                    border: 0.5px solid #484848 !important;
209            box-shadow: 0px 1px 2px 0px rgba(10, 13, 18, 0.05) !important;
210
211        }
212
213        [class^="_textBody_"] {
214        color: var(--almost-black) !important;
215                font-family: var(--font-body-family) !important;
216font-size: 18px !important;
217font-style: normal;
218font-weight: 400;
219line-height: 28px;
220letter-spacing: 0.1px !important;
221}
222
223[class^="_textBody_"] {
224color:  #212124 !important;
225 font-family: var(--font-body-family) !important;
226font-size: 16px !important;
227font-style: normal;
228font-weight: 400;
229line-height: 24px;
230letter-spacing: 0.1px !important;
231}
232
233[class^="_textBody_"] p:last-child {
234    color: var(--freedom-red) !important;
235    font-size: 16px !important;
236    margin-top: 4px !important;
237}
238
239.store-lax [class^="_textBody_"] p:last-child {
240    color: var(--lax-deep-crimson) !important;
241}
242
243.store-xtreme [class^="_textBody_"] p:last-child {
244    color: var(--xtreme-deep-red) !important;
245}
246
247[class^="_formFileInputButton_"] {
248 background: rgba(140, 144, 128, 0.05) !important;
249  font-size: 0px !important;
250  border-radius: 50% !important;
251  width: 39px !important;
252    height: 39px !important;
253    position: relative !important;
254}
255
256    [class^="_formFileInputButton_"]::before {
257        content: " ";
258        background-image: url('https://cdn.shopify.com/s/files/1/0887/1061/1314/files/upload.svg?v=1749072325');
259        background-size: cover;
260        background-repeat: no-repeat;
261        background-position: center;
262        position: absolute;
263        top: 50%;
264        left: 50%;
265        transform: translate(-50%, -50%);
266        width: 24px;
267        height: 24px;
268    }
269
270    [class^="_formFileInputField_"]  {
271       position: relative !important;
272       min-height: 166px !important;
273       align-items: center !important;
274       justify-content: center !important;
275       flex-wrap: wrap !important;
276       padding: 56px 16px 16px 16px !important;
277       text-align: center !important;
278    }
279
280    [class^="_formFileInputField_"]::before {
281        content: attr(data-upload-message);
282        position: absolute;
283        top: 24px;
284        left: 16px;
285        right: 16px;
286        transform: none;
287        width: auto;
288        max-width: none;
289        padding: 0 !important;
290        text-align: center !important;
291        box-sizing: border-box !important;
292        color: var(--almost-black) !important;
293        font-family: var(--font-body-family) !important;
294        font-size: 16px !important;
295        line-height: 24px !important;
296        margin-bottom: 0 !important;
297        pointer-events: none;
298        white-space: normal !important;
299    }
300
301[class^="_formFileInputButton_"] {
302   margin-top: 24px !important;
303}
304
305[class^="_formFileInput_"] {
306   margin-top: 40px !important;
307   margin-bottom: 24px !important;
308   grid-column: 1 / -1 !important;
309   width: 100% !important;
310   max-width: 100% !important;
311}
312
313[class^="_formFileInput_"] [class^="_textBody_"] {
314display: none !important;
315}
316
317div[class^="_formError_"],
318div[class^="_error_"] {
319    margin-top: 10px !important;
320    color: var(--freedom-red) !important;
321}
322
323.store-lax div[class^="_formError_"] ,
324.store-lax div[class^="_error_"] {
325    color: var(--lax-deep-crimson) !important;
326    }
327
328.store-xtreme div[class^="_formError_"],
329.store-xtreme div[class^="_error_"] {
330    color: var(--xtreme-deep-red) !important;
331    }
332
333
334
335        div[class^="_formFieldContainer_"] input,
336        div[class^="_formFieldContainer_"] select,
337        div[class^="_formFieldContainer_"] textarea {
338            max-width: 100% !important;
339            width: 100% !important;
340            box-sizing: border-box !important;
341            display: block !important;
342        }
343
344            @media (max-width: 1200px) {
345            #form-container-ref section[data-sizing="form-wrapper"] form {
346            padding: 0 24px !important;
347            }
348            }
349
350            @media (max-width: 990px) {
351            .register-form-heading {
352                font-size: 24px !important;
353                line-height: 32px !important;
354                margin-top: 20px !important;
355                margin-bottom: 20px !important;
356            }
357
358            #form-container-ref section[data-sizing="form-wrapper"] form {
359                padding: 0 16px !important;
360            }
361
362            button[class^="_formSubmitButton_"] {
363                font-size: 16px !important;
364                padding: 12px 20px !important;
365                width: 140px !important;
366            }
367
368            div[class^="_formFieldContainer_"][class*="_withError_"] {
369                padding-bottom: 18px !important;
370            }
371            }
372
373
374    //  Style guide
375    .store-lax [class^="_textBody_"] p, 
376    .store-lax [class^="_textBody_"] p a,
377     .store-lax label[class^="_formInputFieldLabel_"],
378     .store-lax [class^="_textBody_"],
379      .store-lax [class^="_textBody_"] p{
380         color: var(--lax-rich-black) !important;
381    }
382
383    .store-xtreme [class^="_textBody_"] p, 
384    .store-xtreme [class^="_textBody_"] p a,
385     .store-xtreme label[class^="_formInputFieldLabel_"],
386     .store-xtreme [class^="_textBody_"],
387      .store-xtreme [class^="_textBody_"] p{
388         color: var(--xtreme-jet-black) !important;
389    }
390
391
392    
393    `,shadowRoot.appendChild(style)},moveErrorMessages=shadowRoot=>{const moveErrors=()=>{shadowRoot.querySelectorAll('div[class^="_formFieldContainer_"][class*="_withError_"]').forEach(field=>{const errorMsg=field.nextElementSibling;errorMsg&&Array.from(errorMsg.classList).some(c=>c.startsWith("_formError_"))&&!field.querySelector('div[class^="_formError_"]')&&field.appendChild(errorMsg)})};moveErrors();const form=shadowRoot.querySelector("form");form&&new MutationObserver(()=>moveErrors()).observe(form,{childList:!0,subtree:!0})},moveFieldContainer=shadowRoot=>{const moveFields=()=>{const emailDiv=shadowRoot.querySelector('div[class^="_formFieldContainer_"]:has(input[id="email"])'),purchasingContactDiv=shadowRoot.querySelector('div[class^="_formFieldContainer_"]:has(input[id="custom#city"])');if(emailDiv&&purchasingContactDiv&&emailDiv!==purchasingContactDiv){const emailIndex=Array.from(emailDiv.parentNode.children).indexOf(emailDiv),purchasingIndex=Array.from(purchasingContactDiv.parentNode.children).indexOf(purchasingContactDiv);emailIndex>purchasingIndex&&purchasingContactDiv.parentNode.insertBefore(emailDiv,purchasingContactDiv)}const mailingAddressDiv=shadowRoot.querySelector('div[class^="_formFieldContainer_"]:has(input[id="custom#mailing_address_1"])'),oemManufacturerFieldset=shadowRoot.querySelector('fieldset[name="custom#are_you_an_oem_manufacturer"]');if(mailingAddressDiv&&oemManufacturerFieldset&&mailingAddressDiv!==oemManufacturerFieldset){const mailingIndex=Array.from(mailingAddressDiv.parentNode.children).indexOf(mailingAddressDiv),oemIndex=Array.from(oemManufacturerFieldset.parentNode.children).indexOf(oemManufacturerFieldset);mailingIndex>oemIndex&&oemManufacturerFieldset.parentNode.insertBefore(mailingAddressDiv,oemManufacturerFieldset)}};moveFields(),applyDealerFormLayout(shadowRoot);const form=shadowRoot.querySelector("form");form&&new MutationObserver(()=>{moveFields(),applyDealerFormLayout(shadowRoot)}).observe(form,{childList:!0,subtree:!0})},addTermsAndConditionsLink=shadowRoot=>{const addLink=()=>{const termsFieldset=shadowRoot.querySelector('fieldset[name="custom#terms_and_condition"]');if(termsFieldset){const textSpan=termsFieldset.querySelector('span[class^="_textBody_"]');if(textSpan&&textSpan.textContent&&!textSpan.querySelector("a")){const text=textSpan.textContent,linkText="Freedom Munitions FFL Pickup Location Terms & Conditions",linkUrl="https://freedommunitions.com/pages/ffl-pickup-location-terms-conditions";if(text.includes(linkText)){const link=document.createElement("a");link.href=linkUrl,link.textContent=linkText,link.target="_blank",link.rel="noopener noreferrer",link.style.color="inherit",link.style.textDecoration="underline";const newText=text.replace(linkText,link.outerHTML);textSpan.innerHTML=newText}}}};addLink();const form=shadowRoot.querySelector("form");form&&new MutationObserver(()=>addLink()).observe(form,{childList:!0,subtree:!0})};
393let layoutResizeBound=!1;const bindLayoutResize=shadowRoot=>{layoutResizeBound||(layoutResizeBound=!0,window.addEventListener("resize",()=>applyDealerFormLayout(shadowRoot)))},observer=new MutationObserver((mutations,obs)=>{const formEmbed=document.querySelector("#app-embed");if(formEmbed&&formEmbed.shadowRoot){if(applyFormStyles(formEmbed.shadowRoot),moveFieldContainer(formEmbed.shadowRoot),applyFileUploadMessages(formEmbed.shadowRoot),applyDealerFormLayout(formEmbed.shadowRoot),bindLayoutResize(formEmbed.shadowRoot),moveErrorMessages(formEmbed.shadowRoot),addTermsAndConditionsLink(formEmbed.shadowRoot),!headings.business.added){const businessContainer=formEmbed.shadowRoot.querySelector('div[class^="_formFieldContainer_"]');if(businessContainer&&businessContainer.querySelector('input[id*="company_name"]')){const heading=createStyledHeading(headings.business.text);businessContainer.parentNode.insertBefore(heading,businessContainer),headings.business.added=!0,applyDealerFormLayout(formEmbed.shadowRoot)}}Object.values(headings).every(heading=>heading.added)&&obs.disconnect()}});observer.observe(document,{childList:!0,subtree:!0});
394//# sourceMappingURL=/cdn/shop/t/7/assets/form-dealers.js.map?v=105450629215820311211790866428

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.