PageSourceSearch

https://www.wholesalesuppliesplus.com/cdn/shop/t/202/assets/-bis-form.js?v=1700536426816938741789737139

js wholesalesuppliesplus.com collected 2026-09-24 19:50:42 UTC 2,989 bytes, 1 lines download raw bytes

1import{a as u}from"./chunk-BaseElement-COVKFV2h.js";import{t as p}from"./chunk-custom-element-BhZVzxrc.js";import{n as c}from"./chunk-property-BXqvfTtY.js";import"./chunk-lit-element-CULRVKo8.js";var h=Object.defineProperty,m=Object.getOwnPropertyDescriptor,l=(a,e,o,s)=>{for(var t=s>1?void 0:s?m(e,o):e,n=a.length-1,i;n>=0;n--)(i=a[n])&&(t=(s?i(e,o,t):i(t))||t);return s&&t&&h(e,o,t),t};let r=class extends u{constructor(){super(),this.publicKlaviyoId="",this.sectionId="",this.variantId="",this.errorMessage="",this.submissionStatus="",this.form=null,this.handleSubmit=async a=>{var o;if(a.preventDefault(),!this.form){this.errorMessage="Form not found";return}if(!this.publicKlaviyoId){this.errorMessage="Configuration error: Missing Klaviyo ID";return}this.submissionStatus="loading",this.errorMessage="";const e=this.querySelector("[data-bis-submit]");e==null||e.setAttribute("disabled","");try{const t=new FormData(this.form).get("bis[email]");if(!t||typeof t!="string"||!this.isValidEmail(t))throw new Error("Please enter a valid email address.");if(!this.variantId)throw new Error("Product variant not found.");const n=await fetch(`https://a.klaviyo.com/client/back-in-stock-subscriptions/?company_id=${this.publicKlaviyoId}`,{method:"POST",headers:{Accept:"application/json",Revision:"2024-07-15","Content-Type":"application/json"},body:JSON.stringify({data:{type:"back-in-stock-subscription",attributes:{profile:{data:{type:"profile",attributes:{email:t}}},channels:["EMAIL"]},relationships:{variant:{data:{type:"catalog-variant",id:`$shopify:::$default:::${this.variantId}`}}}}})});if(!n.ok){const i=await n.json().catch(()=>null),d=this.querySelector("[data-bis-error]");throw d&&(d.textContent=(i==null?void 0:i.message)||"Subscription failed. Please try again later."),new Error((i==null?void 0:i.message)||"Subscription failed. Please try again later.")}this.submissionStatus="success",this.form.classList.add("hidden"),(o=this.querySelector("[data-bis-success]"))==null||o.classList.remove("hidden")}catch(s){this.submissionStatus="error",this.errorMessage=s instanceof Error?s.message:"An unexpected error occurred."}},this.boundHandleSubmit=this.handleSubmit.bind(this)}connectedCallback(){if(super.connectedCallback(),this.form=this.querySelector("[data-bis-form]"),!this.publicKlaviyoId){console.error("Missing required Klaviyo ID");return}this.form&&this.form.addEventListener("submit",this.boundHandleSubmit)}disconnectedCallback(){this.form&&this.form.removeEventListener("submit",this.boundHandleSubmit),super.disconnectedCallback()}isValidEmail(a){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(a)}};l([c({type:String,attribute:"data-public-klaviyo-id"})],r.prototype,"publicKlaviyoId",2);l([c({type:String,attribute:"data-section-id"})],r.prototype,"sectionId",2);l([c({type:String,attribute:"data-variant-id"})],r.prototype,"variantId",2);l([c({type:String})],r.prototype,"errorMessage",2);l([c({type:String})],r.prototype,"submissionStatus",2);r=l([p("bis-form")],r);

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.