1/*! For license information please see 9240.54a4b33f9a60ab7d1d17.bundle.js.LICENSE.txt */ 2"use strict";(self.webpackChunkStackby_webapp=self.webpackChunkStackby_webapp||[]).push([[9240],{39240:(e,t,n)=>{n.r(t),n.d(t,{default:()=>J});var r=n(71083),o=n(86663),a=n(379),i=n.n(a),c=n(92257),u=n(56429),s=n(49607),l=n(36713),p=n(9872),d=n(92672),f=n(49973),y=n(33365),h=n(75766),v=n(70510);function m(e){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},m(e)}function b(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,g(r.key),r)}}function g(e){var t=function(e,t){if("object"!=m(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=m(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==m(t)?t:t+""}function j(e,t,n){return t=k(t),function(e,t){if(t&&("object"==m(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,w()?Reflect.construct(t,n||[],k(e).constructor):t.apply(e,n))}function w(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(w=function(){return!!e})()}function k(e){return k=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},k(e)}function S(e,t){return S=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},S(e,t)}var x=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=j(this,t,[e])).state={payment:void 0,addCard:e.addCard,cardAdded:e.cardAdded,useDefaultCard:!1,error:"",workspaceId:e.workspaceId},n.handleCheckout=n.handleCheckout.bind(n),n.handleDone=n.handleDone.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&S(e,t)}(t,e),n=t,o=[{key:"UNSAFE_componentWillReceiveProps",value:function(e){}},{key:"handleCheckout",value:function(e){var t=this,n=this.state;n.useDefaultCard,n.workspaceId,e.preventDefault(),this.setState({payment:"pending"}),this.props.stripe.createToken({}).then(function(e){var n=e.token;t.setState({payment:"pending"},function(){var e={stripeToken:n?n.id:null,planId:t.props.checkoutProps.planId,workspaceId:t.props.checkoutProps.workspaceId,couponId:t.props.checkoutProps.couponCode,address:t.props.checkoutProps.address,isPaymentOptional:n?0:1};t.props.stripe.elements("card"),r.A.post("/api/v1/paymentactions/paystartup",e).then(function(e){t.handleDone(),t.setState({payment:void 0})}).catch(function(n){(0,h.g)({message:n.message,stack_trace:n.stack,type:"frontend",user_id:null,workspace_id:e.workspaceId}),t.setState({payment:"error",error:n.response.data.error}),y.oR.error("Error Payment",{position:"bottom-left",autoClose:!0,closeButton:!1})})})})}},{key:"handleDone",value:function(){this.setState({payment:"done"}),this.props.checkoutProps.handleDone()}},{key:"render",value:function(){var e=this.state,t=e.payment,n=e.addCard,r=(e.useDefaultCard,e.cardAdded,e.error);return(0,v.jsx)("div",{className:"checkout-form",children:(0,v.jsxs)("form",{onSubmit:this.handleCheckout,children:[(0,v.jsx)("div",{className:"payment-details",children:(0,v.jsx)(f.hA,{className:"card-element",style:{base:{fontSize:"18px"}}})}),t&&"error"==t&&(0,v.jsx)("div",{className:"downgrade-warning",style:{color:"red"},children:r&&(0,v.jsx)("p",{children:r})}),(0,v.jsx)("div",{className:"pay-button",style:{display:"flex",flexDirection:n?"row-reverse":"row"},children:(0,v.jsx)(u.A,{primary:!0,loading:"pending"==t,children:"Launch your Workspace"})})]})})}}],o&&b(n.prototype,o),a&&b(n,a),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,o,a}(i().Component);const C=(0,f.lc)(x);function P(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function a(n,r,o,a){var u=r&&r.prototype instanceof c?r:c,s=Object.create(u.prototype);return O(s,"_invoke",function(n,r,o){var a,c,u,s=0,l=o||[],p=!1,d={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return a=t,c=0,u=e,d.n=n,i}};function f(n,r){for(c=n,u=r,t=0;!p&&s&&!o&&t<l.length;t++){var o,a=l[t],f=d.p,y=a[2];n>3?(o=y===r)&&(u=a[(c=a[4])?5:(c=3,3)],a[4]=a[5]=e):a[0]<=f&&((o=n<2&&f<a[1])?(c=0,d.v=r,d.n=a[1]):f<y&&(o=n<3||a[0]>r||r>y)&&(a[4]=n,a[5]=r,d.n=y,c=0))}if(o||n>1)return i;throw p=!0,r}
2return function(o,l,y){if(s>1)throw TypeError("Generator is already running");for(p&&1===l&&f(l,y),c=l,u=y;(t=c<2?e:u)||!p;){a||(c?c<3?(c>1&&(d.n=-1),f(c,u)):d.n=u:d.v=u);try{if(s=2,a){if(c||(o="next"),t=a[o]){if(!(t=t.call(a,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,c<2&&(c=0)}else 1===c&&(t=a.return)&&t.call(a),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);a=e}else if((t=(p=d.n<0)?u:n.call(r,d))!==i)break}catch(t){a=e,c=1,u=t}finally{s=1}}return{value:t,done:p}}}(n,o,a),!0),s}var i={};function c(){}function u(){}function s(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(O(t={},r,function(){return this}),t),p=s.prototype=c.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,O(e,o,"GeneratorFunction")),e.prototype=Object.create(p),e}return u.prototype=s,O(p,"constructor",s),O(s,"constructor",u),u.displayName="GeneratorFunction",O(s,o,"GeneratorFunction"),O(p),O(p,o,"Generator"),O(p,r,function(){return this}),O(p,"toString",function(){return"[object Generator]"}),(P=function(){return{w:a,m:d}})()}function O(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}O=function(e,t,n,r){function a(t,n){O(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(a("next",0),a("throw",1),a("return",2))},O(e,t,n,r)}function _(e,t,n,r,o,a,i){try{var c=e[a](i),u=c.value}catch(e){return void n(e)}c.done?t(u):Promise.resolve(u).then(r,o)}function A(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,c=[],u=!0,s=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(c.push(r.value),c.length!==t);u=!0);}catch(e){s=!0,o=e}finally{try{if(!u&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(s)throw o}}return c}}(e,t)||function(e,t){if(e){if("string"==typeof e)return D(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?D(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function D(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var N=function(e){return new Promise(function(t,n){var r=document.createElement("script");r.src=e,r.addEventListener("load",function(){t({successful:!0})}),r.addEventListener("error",function(e){n({error:e})}),document.head.appendChild(r)})};const E=function(e){var t=A((0,a.useState)({}),2),n=t[0],r=t[1];(0,a.useEffect)(function(){var e=function(){var e,t=(e=P().m(function e(){var t;return P().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,N("https://js.stripe.com/v3/");case 1:t=e.v,r(t);case 2:return e.a(2)}},e)}),function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){_(a,r,o,i,c,"next",e)}function c(e){_(a,r,o,i,c,"throw",e)}i(void 0)})});return function(){return t.apply(this,arguments)}}();e()},[]);return n.successful?(0,v.jsx)(f.li,{apiKey:"pk_live_jkeUzf2DlrId8hxHypunCSLo00aUbMUqZJ",children:(0,v.jsx)(f.S8,{children:(0,v.jsx)(C,{checkoutProps:e})})}):null};var I=n(74046),T=n.n(I),L=n(91003),M=n.n(L),R=n(96763);function G(e){return G="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},G(e)}function U(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,W(r.key),r)}}function W(e){var t=function(e,t){if("object"!=G(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=G(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==G(t)?t:t+""}function B(e,t,n){return t=V(t),function(e,t){if(t&&("object"==G(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,F()?Reflect.construct(t,n||[],V(e).constructor):t.apply(e,n))}function F(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(F=function(){return!!e})()}
2function V(e){return V=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},V(e)}function Y(e,t){return Y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Y(e,t)}var z=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=B(this,t,[e])).state={planDropDown:[{key:"1",value:"Economy Annual Special",text:"Economy Annual Special"},{key:"2",value:"Max Stack Yearly",text:"Max Stack Yearly"}],currentPlan:"",amount:"",plandetails:[],currentPlanId:"",paymentDone:!1,workspaceId:null,couponCode:null,percent_off:0,countryList:[]},n.getPlanDetails=n.getPlanDetails.bind(n),n.handleChange=n.handleChange.bind(n),n.handleDone=n.handleDone.bind(n),n.applyCouponCode=n.applyCouponCode.bind(n),n.getCounty=n.getCounty.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Y(e,t)}(t,e),n=t,a=[{key:"UNSAFE_componentWillReceiveProps",value:function(e){}},{key:"componentDidMount",value:function(){this.props.location.pathname.split("-").pop(),T().pageView("/startup-program"),M().dataLayer({dataLayer:{page:"/startup-program"}}),this.getPlanDetails();var e=o.parse(this.props.location.search),t=e.workspaceId,n=void 0===t?null:t;e.planName,this.setState({workspaceId:n}),this.getCounty()}},{key:"getCounty",value:function(){var e=this;r.A.get("/api/v1/fetchcountries").then(function(t){var n=t.data.data.map(function(e){return{key:e.name,text:e.name,value:e.name}});e.setState({countryList:n})}).catch(function(e){R.log("eror",e)})}},{key:"getPlanDetails",value:function(){var e=this;this.props.location.pathname.split("-").pop(),r.A.get("/api/v1/plandetails?category=personal-campaign&slug=startup").then(function(t){var n=JSON.parse((0,p.Y)(t.data.data));e.setState({plandetails:n,currentPlan:n[0].name,amount:n[0].amount,currentPlanId:n[0].id})}).catch(function(e){R.log("error",e)})}},{key:"handleChange",value:function(e,t){var n=this.state.plandetails.find(function(e){return e.name==t.value});this.setState({currentPlan:n.name,amount:n.amount,currentPlanId:n.id})}},{key:"handleDone",value:function(){this.state.currentPlan.startsWith("Economy"),this.setState({paymentDone:!0}),this.props.history.push("/dashboard")}},{key:"applyCouponCode",value:function(){var e=this,t=this.state.couponCode,n=void 0===t?"":t;this.setState({couponMsg:!1}),r.A.get("/api/v1/coupon/".concat(n,"/check")).then(function(t){e.setState({isCouponValid:t.data.data.isValid,couponMsg:t.data.data.msg,percent_off:t.data.data.percent_off})}).catch(function(t){e.setState({isCouponValid:!1,percent_off:0,couponMsg:"Something wrong."})})}},{key:"render",value:function(){var e=this,t=this.state,n=(t.plandetails,t.currentPlan),r=(t.planDropDown,t.currentPlanId),o=(t.paymentDone,t.workspaceId),a=t.isCouponValid,i=void 0!==a&&a,p=t.couponCode,d=t.couponMsg,f=void 0!==d&&d,y=t.percent_off,h=t.line1,m=t.state,b=t.city,g=t.postal_code,j=t.country,w=t.countryList,k=this.state.amount;return k-=k*y/100,(0,v.jsx)("div",{id:"startupProgram",className:"startupProgram",children:(0,v.jsxs)("div",{className:"checkout-page",children:[(0,v.jsx)("div",{className:"checkout-header",children:"Awesome! Letâs get you setup on Stackbyâs Startup Program ð"}),(0,v.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:["Choose plan - ",(0,v.jsxs)("p",{style:{fontWeight:"bold"},children:[" ",n," "]})]}),(0,v.jsxs)("div",{className:"discount-div",style:{marginTop:15},children:["Add your Coupon Code -"," ",(0,v.jsx)(c.A,{value:p,onChange:function(t,n){var r=n.value;return e.setState({couponCode:r})},placeholder:"Enter Coupon code here"}),(0,v.jsx)(u.A,{style:{marginLeft:5},onClick:this.applyCouponCode,children:"Apply"}),f&&(0,v.jsx)("p",{className:"coupon-code-text",style:{color:0==i?"red":""},children:f})]}),(0,v.jsxs)("div",{style:{marginTop:"18px"},className:"choose-billing-cycle",onClick:this.handleCheckout,children:["Total Amount due - ",(0,v.jsxs)("b",{children:["$",k]})]}),(0,v.jsxs)("div",{className:"address-form",children:[(0,v.jsx)("h3",{style:{marginTop:15,fontWeight:"bold"},children:"Please add your Address"}),(0,v.jsx)("div",{className:"a-item",children:(0,v.jsx)(c.A,{value:h,onChange:function(t,n){var r=n.value;return e.setState({line1:r})},placeholder:"Street"})}),(0,v.jsx)("div",{className:"a-item",children:(0,v.jsx)(c.A,{value:g,onChange:function(t,n){var r=n.value;return e.setState({postal_code:r})},placeholder:"Postal code"})}),(0,v.jsx)("div",{className:"a-item",children:(0,v.jsx)(c.A,{value:b,onChange:function(t,n){var r=n.value;return e.setState({city:r})},placeholder:"City"})}),(0,v.jsx)("div",{className:"a-item",children:(0,v.jsx)(c.A,{value:m,onChange:function(t,n){var r=n.value;return e.setState({state:r})},placeholder:"State"})}),(0,v.jsx)("div",{className:"a-item",style:{width:"68%"},children:(0,v.jsx)(s.A,{options:w,search:!0,selection:!0,placeholder:"Select country",onChange:function(t,n){var r=n.value;return e.setState({country:r})},style:{width:"100%"}})})]}),(0,v.jsx)(l.A,{style:{width:"500px"}}),(0,v.jsxs)("div",{className:"payment-checkout-div",children:[(0,v.jsx)("div",{className:"checkout-heading",children:(0,v.jsx)("b",{children:"Please add your Payment Details (Optional) "})}),(0,v.jsx)(E,{workspaceId:o,planId:r,address:{line1:h,state:m,city:b,postal_code:g,country:j},couponCode:p,handleDone:this.handleDone})]})]})})}}],a&&U(n.prototype,a),i&&U(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,a,i}(i().Component);const J=(0,d.A)(z)}}]);
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.