1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[129],{6053:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/auth/connect-store",function(){return r(3773)}])},3773:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return b}});var s=r(5893),o=r(7294),l=r(5675),n=r.n(l),c=r(4761),i=r(9630),a=r(4871),u=r(9669),d=r.n(u),p=r(9580),m=r(9008),g=r.n(m),h=r(1664),f=r.n(h),y=r(5811),x=r(1163),v=()=>{let[e,t]=(0,o.useState)({price:p.zX,isPriceDiscounted:!1,discountCode:""}),[r,s]=(0,o.useState)(!1),l=(0,x.useRouter)();return(0,o.useEffect)(()=>{e();async function e(){let{discount_code:e}=l.query;if("string"==typeof e&&""!==e){s(!0);try{let{data:r}=await d().get(p.z0+"/api/app-subscription-price?discount_code="+e);t(r)}catch(e){console.log(e)}s(!1)}}},[l.query]),{appSubscriptionPrice:e,isAppSubscriptionPriceLoading:r}},b=()=>{let[e,t]=(0,o.useState)(""),[r,l]=(0,o.useState)(!1),u=(0,x.useRouter)(),{appSubscriptionPrice:m,isAppSubscriptionPriceLoading:h}=v(),b=async e=>{e.preventDefault(),l(!0),t(""),console.log(e.currentTarget["store-url"].value);let r=e.currentTarget["store-url"].value,s=e.currentTarget["privacy-policy-agree"].checked,{discount_code:o}=u.query;if(!r){t("Please enter your store url."),l(!1);return}if(!s){t("You must agree to our Privacy Policy to connect your store."),l(!1);return}try{let e=await d().get("".concat(p.z0,"/api/auth/offline-token?shop=").concat(r,"&privacy_policy_agreed=").concat(s,"&from_frontend=true").concat(o?"&discount_code=".concat(o):""),{withCredentials:!0});window.location.assign(e.data.redirect),l(!1)}catch(e){w(e),l(!1)}},w=e=>{var r,s,o;(0,y.I)(e)&&(null==e?void 0:null===(s=e.response)||void 0===s?void 0:null===(r=s.data)||void 0===r?void 0:r.message)?t(e.response.data.message):t(null!==(o=e.message)&&void 0!==o?o:"Whoops, something went wrong")};return(0,s.jsxs)("div",{className:"container flex flex-col lg:flex-row justify-center lg:justify-around grow items-center",children:[(0,s.jsx)(g(),{children:(0,s.jsx)("title",{children:"Connect Store | CustomerLift"})}),(0,s.jsxs)("div",{className:"mb-14 mt-10 lg:mt-0 lg:mb-40 flex flex-col items-center lg:block",style:{maxWidth:510},children:[(0,s.jsx)("div",{style:{background:"#FEB094"},className:"rounded-full inline-block text-xl py-3 px-4 border border-black mb-5",children:"Step 1"}),(0,s.jsx)("h1",{className:"text-[32px] text-center lg:text-start lg:leading-[110%] lg:text-[88px] font-bold",children:"Link Your Shopify Account"}),(0,s.jsxs)("p",{className:"mt-8",children:["$",m.price," / month per store"]})]}),(0,s.jsxs)("div",{className:"lg:pt-12 flex flex-col items-center lg:block w-full max-w-sm lg:w-80 lg:mb-40",children:[(0,s.jsx)(n(),{src:"/shopify_with_text.svg",width:168,height:49,alt:"Shopify logo"}),(0,s.jsx)("p",{className:"p-large text-center lg:text-start mt-5 lg:mt-8 mb-5 lg:mb-6",children:"Log in to Shopify securely."}),(0,s.jsxs)("form",{className:"w-full",onSubmit:b,children:[(0,s.jsx)(c.Z,{extraClasses:"mb-8 lg:w-96 lg:mb-10",Svg:i.Z,inputType:"text",label:"STORE URL",placeholder:"your-store-name.myshopify.com",inputName:"store-url",errorMsg:e,description:'Please use this Shopify URL structure: "storename.myshopify.com". No need to include "https://" and make sure to remove any "/" at the end of the URL.'}),(0,s.jsx)("input",{type:"checkbox",id:"privacy-policy-agree",name:"privacy-policy-agree"}),(0,s.jsxs)("label",{htmlFor:"privacy-policy-agree",className:"ml-2 text-sm",children:["I have read & agree to CustomerLift's"," ",(0,s.jsx)(f(),{href:"/privacy-policy",className:"underline",target:"_blank",children:"Privacy Policy"})]}),(0,s.jsx)("div",{className:"text-center lg:text-start mt-8 lg:mt-10",children:(0,s.jsx)(a.Z,{type:"submit",size:"sm",isLoading:r,children:"Connect Store"})})]})]})]})}}},function(e){e.O(0,[959,888,774,179],function(){return e(e.s=6053)}),_N_E=e.O()}]);
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.