1import{_ as B,a as I,o as b,b as m,d as U,s as z,f as V,c as w,u as q,v as W,a8 as X,bS as A,ax as $,l as p,j as g,e as N,i as Y,w as y,Y as H,aU as T,m as P,aV as G,aa as J}from"./index-B73K4ptn.js";import{u as Z}from"./branding-DVlxEELb.js";import{E as K}from"./index-B8Hx5fdR.js";import{E as Q}from"./index-CyIyvjcg.js";import{E as ee}from"./index-CWRKf-Fg.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"[email protected]"}}catch{}})();try{(function(){var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new e.Error().stack;i&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[i]="d12198be-bdf5-4206-b898-b48594ed8391",e._sentryDebugIdIdentifier="sentry-dbid-d12198be-bdf5-4206-b898-b48594ed8391")})()}catch{}function _(e,i){if(!(e instanceof i))throw new TypeError("Cannot call a class as a function")}function te(e,i){for(var t=0;t<i.length;t++){var n=i[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function S(e,i,t){return i&&te(e.prototype,i),e}function R(e){return+e.replace(/px/,"")}function ie(e){var i=window.devicePixelRatio,t=getComputedStyle(e),n=R(t.getPropertyValue("width")),s=R(t.getPropertyValue("height"));e.setAttribute("width",(n*i).toString()),e.setAttribute("height",(s*i).toString())}function v(e,i){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=Math.random()*(i-e)+e;return Math.floor(n*Math.pow(10,t))/Math.pow(10,t)}function x(e){return e[v(0,e.length)]}var ne=.00125,oe=5e-4,ae=9e-4,se=1e-5,re=6,le=80,de=.9,ue=1.7,fe=.2,ce=.6,me=.03,he=.07,j=15,D=82,ve=100,pe=250,ge=40,be=["#fcf403","#62fc03","#f4fc03","#03e7fc","#03fca5","#a503fc","#fc03ad","#fc03c2"];function O(e){var i=1920;return Math.log(e)/Math.log(i)}var F=(function(){function e(i){_(this,e);var t=i.initialPosition,n=i.direction,s=i.confettiRadius,a=i.confettiColors,r=i.emojis,f=i.emojiSize,l=i.canvasWidth,c=v(de,ue,3),d=c*O(l);this.confettiSpeed={x:d,y:d},this.finalConfettiSpeedX=v(fe,ce,3),this.rotationSpeed=r.length?.01:v(me,he,3)*O(l),this.dragForceCoefficient=v(oe,ae,6),this.radius={x:s,y:s},this.initialRadius=s,this.rotationAngle=n==="left"?v(0,.2,3):v(-.2,0,3),this.emojiSize=f,this.emojiRotationAngle=v(0,2*Math.PI),this.radiusYUpdateDirection="down";var u=n==="left"?v(D,j)*Math.PI/180:v(-j,-D)*Math.PI/180;this.absCos=Math.abs(Math.cos(u)),this.absSin=Math.abs(Math.sin(u));var o=v(-150,0),h={x:t.x+(n==="left"?-o:o)*this.absCos,y:t.y-o*this.absSin};this.currentPosition=Object.assign({},h),this.initialPosition=Object.assign({},h),this.color=r.length?null:x(a),this.emoji=r.length?x(r):null,this.createdAt=new Date().getTime(),this.direction=n}return S(e,[{key:"draw",value:function(t){var n=this.currentPosition,s=this.radius,a=this.color,r=this.emoji,f=this.rotationAngle,l=this.emojiRotationAngle,c=this.emojiSize,d=window.devicePixelRatio;a?(t.fillStyle=a,t.beginPath(),t.ellipse(n.x*d,n.y*d,s.x*d,s.y*d,f,0,2*Math.PI),t.fill()):r&&(t.font="".concat(c,"px serif"),t.save(),t.translate(d*n.x,d*n.y),t.rotate(l),t.textAlign="center",t.fillText(r,0,0),t.restore())}},{key:"updatePosition",value:function(t,n){var s=this.confettiSpeed,a=this.dragForceCoefficient,r=this.finalConfettiSpeedX,f=this.radiusYUpdateDirection,l=this.rotationSpeed,c=this.createdAt,d=this.direction,u=n-c;if(s.x>r&&(this.confettiSpeed.x-=a*t),this.currentPosition.x+=s.x*(d==="left"?-this.absCos:this.absCos)*t,this.currentPosition.y=this.initialPosition.y-s.y*this.absSin*u+ne*Math.pow(u,2)/2,this.rotationSpeed-=this.emoji?1e-4:se*t,this.rotationSpeed<0&&(this.rotationSpeed=0),this.emoji){this.emojiRotationAngle+=this.rotationSpeed*t%(2*Math.PI);return}f==="down"?(this.radius.y-=t*l,this.radius.y<=0&&(this.radius.y=0,this.radiusYUpdateDirection="up")):(this.radius.y+=t*l,this.radius.y>=this.initialRadius&&(this.radius.y=this.initialRadius,this.radiusYUpdateDirection="down"))}},{key:"getIsVisibleOnCanvas",value:function(t){return this.currentPosition.y<t+ve}}]),e})();function Ce(){var e=document.createElement("canvas");return e.style.position="fixed",e.style.width="100%",e.style.height="100%",e.style.top="0",e.
1style.left="0",e.style.zIndex="1000",e.style.pointerEvents="none",document.body.appendChild(e),e}function ye(e){var i=e.confettiRadius,t=i===void 0?re:i,n=e.confettiNumber,s=n===void 0?e.confettiesNumber||(e.emojis?ge:pe):n,a=e.confettiColors,r=a===void 0?be:a,f=e.emojis,l=f===void 0?e.emojies||[]:f,c=e.emojiSize,d=c===void 0?le:c;return e.emojies&&console.error("emojies argument is deprecated, please use emojis instead"),e.confettiesNumber&&console.error("confettiesNumber argument is deprecated, please use confettiNumber instead"),{confettiRadius:t,confettiNumber:s,confettiColors:r,emojis:l,emojiSize:d}}var Ie=(function(){function e(i){var t=this;_(this,e),this.canvasContext=i,this.shapes=[],this.promise=new Promise(function(n){return t.resolvePromise=n})}return S(e,[{key:"getBatchCompletePromise",value:function(){return this.promise}},{key:"addShapes",value:function(){var t;(t=this.shapes).push.apply(t,arguments)}},{key:"complete",value:function(){var t;return this.shapes.length?!1:((t=this.resolvePromise)===null||t===void 0||t.call(this),!0)}},{key:"processShapes",value:function(t,n,s){var a=this,r=t.timeDelta,f=t.currentTime;this.shapes=this.shapes.filter(function(l){return l.updatePosition(r,f),l.draw(a.canvasContext),s?l.getIsVisibleOnCanvas(n):!0})}}]),e})(),_e=(function(){function e(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_(this,e),this.activeConfettiBatches=[],this.canvas=i.canvas||Ce(),this.canvasContext=this.canvas.getContext("2d"),this.requestAnimationFrameRequested=!1,this.lastUpdated=new Date().getTime(),this.iterationIndex=0,this.loop=this.loop.bind(this),requestAnimationFrame(this.loop)}return S(e,[{key:"loop",value:function(){this.requestAnimationFrameRequested=!1,ie(this.canvas);var t=new Date().getTime(),n=t-this.lastUpdated,s=this.canvas.offsetHeight,a=this.iterationIndex%10===0;this.activeConfettiBatches=this.activeConfettiBatches.filter(function(r){return r.processShapes({timeDelta:n,currentTime:t},s,a),a?!r.complete():!0}),this.iterationIndex++,this.queueAnimationFrameIfNeeded(t)}},{key:"queueAnimationFrameIfNeeded",value:function(t){this.requestAnimationFrameRequested||this.activeConfettiBatches.length<1||(this.requestAnimationFrameRequested=!0,this.lastUpdated=t||new Date().getTime(),requestAnimationFrame(this.loop))}},{key:"addConfetti",value:function(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=ye(t),s=n.confettiRadius,a=n.confettiNumber,r=n.confettiColors,f=n.emojis,l=n.emojiSize,c=this.canvas.getBoundingClientRect(),d=c.width,u=c.height,o=u*5/7,h={x:0,y:o},M={x:d,y:o},C=new Ie(this.canvasContext),E=0;E<a/2;E++){var L=new F({initialPosition:h,direction:"right",confettiRadius:s,confettiColors:r,confettiNumber:a,emojis:f,emojiSize:l,canvasWidth:d}),k=new F({initialPosition:M,direction:"left",confettiRadius:s,confettiColors:r,confettiNumber:a,emojis:f,emojiSize:l,canvasWidth:d});C.addShapes(L,k)}return this.activeConfettiBatches.push(C),this.queueAnimationFrameIfNeeded(),C.getBatchCompletePromise()}},{key:"clearCanvas",value:function(){this.activeConfettiBatches=[]}},{key:"destroyCanvas",value:function(){this.canvas.remove()}}]),e})();const Se={},Ee={class:"flex flex-col text-center rounded-lg px-4 bg-brand-light-sand max-w-lg mx-auto"};function we(e,i){return b(),I("div",Ee,[...i[0]||(i[0]=[m("div",{id:"inline-preview"},null,-1)])])}const Ae=B(Se,[["render",we]]),Ne={class:"md:grid md:grid-cols-5 md:gap-4 md:items-start"},Te={class:"md:col-span-2"},Pe={class:"border-brand-sand border-2 p-8 rounded-md bg-white"},Re={class:"mt-6"},xe={key:0,class:"mt-3 mb-2 font-semibold text-sm font-gray-700"},je={class:"mt-4"},De={class:"md:mt-0 md:col-span-3"},Oe=U({__name:"design",setup(e){const i=z(null),t=V(),n=w(()=>t.org?.branding??{primaryColor:"#4a4a4f"}),s=q(),a=w(()=>({...s.currentBlueprint,...n.value}));W(()=>c(!0));const r=Z(),f=X();function l(u){t.setOrgDetails({branding:{...n.value,...u}}),u.primaryColor&&A.updateBranding(u.primaryColor),(u.brandImage||u.brandTheme||u.confetti!==void 0)&&s.primaryBlueprint&&c(!0),u.confetti&&d(),r.update()}function c(u=!1){s.primaryBlueprint&&t.org&&A.previewCancelFlow({org:t.org,blueprint:s.primaryBlueprint,provider:t.providerWithVersion??"stripe",coupons:f.$coupons,prices:f.prices,inline:u})}function d(){i.value??=new _e,i.value.addConfetti({confettiNumber:1500})}return $(()=>{i.value?.destroyCanvas()}),(u,o)=>(b(),I("div",Ne,[m("div",Te,[m("div",Pe,[o[10]||(o[10]=m("p",{class:"title"},"Customize Your Design",-1)),p(g(K),{class:"bg-brand-sand"}),m("div",Re,[o[7]||(o[7]=m("p",{class:"mt-3 mb-2 font-semibold text-sm font-gray-700"},"Select Theme",-1)),p(g(G),{"model-value":a.value.brandTheme,"onUpdate:modelValue":o[0]||(o[0]=h=>l({brandTheme:h}))},{default:y(()=>[p(g(T),{label:"Basic",value:"default",class:"capitalize"},{default:y(()=>[...o[5]||(o[5]=[P("Basic",-1)])]),_:1}),p(g(T),{label:"Dynamic",value:"theme-v2",class:"capitalize"},{default:y(()=>[...o[6]||(o[6]=[P("Dynamic",-1)])]),_:1})]),_:1},8,["model-value"]),o[8]||(o[8]=m("p",{class:"mt-4 mb-2 font-semibold text-sm font-gray-700"},"Primary Color",-1)),p(g(Q),{"model-value":a.value.primaryColor||"#4a4a4f","onUpdate:modelValue":o[1]||(o[1]=h=>l({primaryColor:h??void 0}))},null,8,["model-value"]),a.value.brandTheme==="default"?(b(),I("p",xe," Logo URL ")):N("",!0),a.value.brandTheme==="default"?(b(),Y(g
1(J),{key:1,"model-value":a.value.brandImage,"onUpdate:modelValue":o[2]||(o[2]=h=>l({brandImage:h}))},null,8,["model-value"])):N("",!0),o[9]||(o[9]=m("p",{class:"mt-4 mb-2 font-semibold text-sm font-gray-700"}," Confetti When Customer Accepts Offer ",-1)),p(g(ee),{"model-value":a.value.confetti,"active-color":a.value.primaryColor||"#4a4a4f","inactive-color":"#D0C8C0","onUpdate:modelValue":o[3]||(o[3]=h=>l({confetti:h}))},null,8,["model-value","active-color"])])]),m("div",je,[m("button",{style:H({background:a.value.primaryColor||"#4a4a4f"}),type:"button",class:"w-full grow px-6 py-3 text-base leading-6 font-medium rounded-md shadow-md text-white hover:opacity-75 transition ease-in-out duration-150",onClick:o[4]||(o[4]=h=>c())},[...o[11]||(o[11]=[m("div",{class:"flex justify-center space-x-2 cursor-pointer items-center transition-all"},[m("span",{class:"pulse mx-2"}),m("span",{class:"text-white text-sm font-bold"},"Launch Live Preview")],-1)])],4)])]),m("div",De,[p(Ae,{branding:{primaryColor:a.value.primaryColor,brandImage:a.value.brandImage}},null,8,["branding"])])]))}}),Ue=B(Oe,[["__scopeId","data-v-18224296"]]);export{Ue as default}; 2//# sourceMappingURL=design-CbhYAJB7.js.map
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.