1import{H as D}from"./XzcKr1g2.js";import{a2 as G,r as y,X as j,j as h,h as g,m as o,v as P,G as B,f as a,n as K,e as _,p as R,ai as A,K as E,L as I,t as O,a as U,a8 as J,V as Q,q as Y}from"./JTGkqvXa.js";import"./Q27x1Ny1.js";const Z={class:"flex flex-col"},ee=["max","readonly","value"],te={__name:"index",props:{label:{type:String,required:!0},maxLimit:{type:Number,default:100},value:{type:Number,default:0},defaultValue:{type:Number,required:!1},readonly:{type:Boolean,default:!1}},emits:["input"],setup(i,{emit:r}){const s=i,v=r,m=y(!1);j(()=>s.value,()=>{m.value=!0});const u=c=>{c.isTrusted&&v("input",parseFloat(c.target.value))};return(c,f)=>(h(),g("div",Z,[o("div",{class:B([{"text-ternary/60":!a(m).value,"text-ternary":a(m).value},"u-text-regular-3 mb-1"])},P(i.label),3),o("div",{class:B([{"border-ternary/60 text-ternary/60":!a(m).value,"border-ternary text-ternary":a(m).value},"rounded-2xl border text-center flex justify-center max-w-[14rem] py-4 transition-colors duration-200 ease-in sm:px-16 px-8"])},[o("input",{type:"number",min:"0",step:".01",max:i.maxLimit,class:"u-text-regular-1 bg-transparent max-w-[4.5rem] text-center focus:outline-none",onInput:u,readonly:i.readonly,value:i.value},null,40,ee)],2)]))}},se=G(te,[["__scopeId","data-v-e394b6fd"]]),ae={class:"absolute left-1/2 bottom-0 flex w-24 justify-center -translate-x-1/2 translate-y-full u-text-regular-2"},M="var(--color-secondary)",oe={__name:"index",props:{currentValue:{type:Number,default:0},maxValue:{type:Number,default:100},yValue:{type:Number,default:0},yValues:{type:Array,default:()=>[]},maxYValue:{type:Number,default:100},isComparativeActive:{type:Boolean,default:!1}},emits:["input"],setup(i,{emit:r}){const s=i,v=r,{$gsap:m,$Draggable:u}=K(),c=y(null),f=y(null),d=y(0),b=y(0),C=y(231),W=_(()=>s.isComparativeActive?(F.value/s.maxYValue*C.value).toFixed(3):b.value),V=_(()=>s.isComparativeActive?s.yValues:s.yValues.filter(n=>n.default===!0)),F=_(()=>Math.max(...s.yValues.map(n=>n.value)));function k(n){const x=c.value.parentElement.parentElement,p=x?x.getBoundingClientRect():{},e=n.touches&&n.touches.length>0?n.touches[0].pageX:n.pageX,l=p.x?e-p.x:e,t=p.x?l/c.value.offsetWidth:0;l<c.value.offsetWidth&&x&&t>=0&&t<=1?(v("input",t),d.value=l):t>=1?(d.value=c.value.offsetWidth,v("input",1)):t<=0&&(d.value=0,v("input",0))}function N(n){return(n.value/s.maxYValue*C.value).toFixed(3)}function w(){b.value=(s.yValue/s.maxYValue*C.value).toFixed(3)}return R(()=>{d.value=s.currentValue/s.maxValue*c.value.offsetWidth;const n=document.body.querySelector("#y-axis");n&&(C.value=n.offsetHeight),w(),u.create(f.value,{type:"x",bounds:{minX:0,maxX:c.value.offsetWidth},onDrag:x=>{k(x),w()}}),d.value>0&&m.set(f.value,{x:d.value})}),j(()=>s.currentValue,n=>{n<s.maxValue&&(d.value=n/s.maxValue*c.value.offsetWidth,m.set(f.value,{x:d.value}),w())}),j(()=>s.maxYValue,()=>{w()}),(n,x)=>(h(),g("div",{ref_key:"el",ref:c,class:"relative h-[0.2em] flex w-full"},[o("div",{class:"bg-ternary",style:A({width:`${a(d)}px`})},null,4),(h(!0),g(E,null,I(a(V),(p,e)=>(h(),g("div",{key:e,class:"absolute border-b border-dashed border-gray-200 left-0 bottom-0 pointer-events-none translate-y-0",style:A({width:`${a(d)}px`,"--tw-translate-y":`${-N(p)}px`})},null,4))),128)),o("div",{ref_key:"cursor",ref:f,class:"w-[1.6em] h-[1.6em] bg-ternary/30 rounded-full -translate-x-1/2 flex justify-center items-center absolute left-0 top-1/2 -translate-y-1/2"},[x[1]||(x[1]=o("div",{class:"bg-ternary rounded-full w-[1em] h-[1em]"},null,-1)),(h(!0),g(E,null,I(a(V),(p,e)=>(h(),g("div",{key:e,class:"absolute xs:top-[0.2rem] sm:top-[0.3rem] group hover:z-10 focus:z-10 top-px rounded-full w-4 h-4 translate-y-0",style:A({"--tw-translate-y":`${-N(p)}px`,backgroundColor:p.default?M:p.color})},[o("div",{class:B([{"opacity-0 pointer-events-none":i.isComparativeActive},"absolute -top-12 left-1/2 -translate-x-1/2 px-3 py-2 -translate-y-1/2 shadow-box z-50 h-12 w-32 text-center bg-white rounded-xl font-semibold text-xs transition-opacity duration-300 ease-out group-hover:opacity-100 group-focus:opacity-100"]),style:A({color:p.default?M:p.color})},[O(P(i.currentValue>0?p.value:0)+" ⬠",1),x[0]||(x[0]=o("div",{class:"absolute bottom-[0.6rem] translate-y-full left-1/2 -translate-x-1/2 roun
1ded-tr-[30%] inline-block h-0 w-0 z-30 border-t-[1.6rem] border-t-white border-r-[1.1rem] border-r-transparent border-l-[1.1rem] border-l-transparent"},null,-1))],6)],4))),128)),o("div",{class:"absolute border-r border-dashed border-gray-200 left-1/2 bottom-0 -z-10 pointer-events-none",style:A(`height: ${a(W)}px`)},null,4),o("div",ae,P(i.currentValue)+" ⬠",1)],512)],512))}};class X{constructor({x1:r=0,y1:s=0,x2:v=0,y2:m=0,color:u="black"}){this.x1=r,this.y1=s,this.x2=v,this.y2=m,this.color=u}draw(r){r.strokeStyle=this.color,r.lineCap="round",r.lineWidth=3,r.beginPath(),r.moveTo(this.x1,this.y1),r.lineTo(this.x2,this.y2),r.stroke()}getLineEndCoords(){return{x:this.x2,y:this.y2}}}const le={class:"bg-gray-50 z-30 relative PriceComparator",id:"price-comparator"},ne={class:"container flex lg:flex-row flex-col justify-center items-center gap-x-48 gap-y-24"},re={class:"flex flex-col lg:items-end items-center justify-end relative flex-grow translate-y-8 pt-10 lg:pt-0"},ie={class:"rounded-2xl bg-white shadow-box pl-12 pr-12 pb-12 pt-[3.7rem] lg:pt-[4.6rem] flex flex-col sm:h-[33.1em] sm:w-[47.1em] h-[33.6em] w-[48.6em] relative sm:text-[1rem] xs:text-[0.8rem] text-[0.65rem]"},ue={class:"rounded-2xl bg-white shadow-box xs:p-8 p-6 flex flex-col absolute -translate-y-full sm:top-12 top-8 sm:-left-12 mid-xs:-left-8 left-4 z-10"},ce={class:"font-barlow text-secondary tracking-barlow font-medium xs:text-base text-xs mb-6 uppercase"},de={class:"flex gap-12"},me={class:"flex items-end relative"},fe=["src","alt"],pe=["width","height"],xe={id:"js-curve-parent",class:"flex items-center relative"},ve={class:"h-[0.2em] bg-gray-150 rounded-2xl w-[34em] relative"},ye={class:"text-5xs text-ternary pl-4 absolute top-1/2 right-0 -translate-y-1/2 translate-x-full flex xs:flex-row flex-col"},he={class:"mr-[0.2rem]"},ge={class:"xs:block hidden mr-[0.2rem]"},L=200,ke={__name:"index",props:{slice:{type:Object,required:!0,default:()=>({})}},setup(i){const r=i,{t:s}=U(),v=y(!1),m=_(()=>r.slice.items.find(e=>e.default)),u=y({width:0,height:0}),c=y([]),f=y(20),d=y(null),b=_(()=>v.value?r.slice.items.reduce((e,l)=>{const t=k(l);return t>e?t:e},0):k(m.value)),C=_(()=>V(m.value,f.value));_(()=>k(m.value));const W=_(()=>r.slice.items.map(e=>({default:e.default,value:V(e,f.value),color:e.color})));function V(e,l){if(e){const t=e.commissionTypeSwitchAmount??null;if(e.commissionPercentage&&e.commission&&t===null)return parseFloat((e.commissionPercentage/100*l+e.commission).toFixed(2));if(e.commissionPercentage&&!e.commission||e.commission&&t>0&&l>t)return parseFloat((e.commissionPercentage/100*l).toFixed(2));if(e.commission&&!e.commissionPercentage||e.commission&&t>0&&l<t)return parseFloat(e.commission.toFixed(2))}}function F(e){return V(e,0)}function k(e){return V(e,L)}function N(e){return(1-k(e)/b.value)*u.value.height/2}function w(){const e=d.value.getContext("2d");r.slice.items.map(t=>({...t,commissionTypeSwitchAmount:t.commissionTypeSwitchAmount??null})).forEach((t,z)=>{if(!v.value&&!t.default)return;const $=(1-k(t)/b.value)*u.value.height,S=t.default?getComputedStyle(document.documentElement).getPropertyValue("--color-secondary"):t.color;if(t.commissionTypeSwitchAmount===null)new X({x1:0,x2:u.value.width,y1:(1-F(t)/b.value)*u.value.height,y2:$,color:S}).draw(e);else if(t.commissionTypeSwitchAmount>0){const T=(1-F(t)/b.value)*u.value.height,q=t.commissionTypeSwitchAmount/L*u.value.width;new X({x1:0,x2:q,y1:T,y2:T,color:S}).draw(e),new X({x1:q,x2:u.value.width,y1:T,y2:$,color:S}).draw(e)}c.value[z]={top:`${$/2}px`}})}function n(){w()}function x(e){parseInt(e,10)>0&&(f.value=e)}function p(e){const l=e*L;f.value=l>L-1?Math.round(l):parseFloat(l.toFixed(2))}return R(()=>{u.value.width=d.value.clientWidth*2,u.value.height=d.value.clientHeight*2,c.value=r.slice.items.map(l=>({top:`${N(l)}px`})),J(()=>{w()}),window.addEventListener("resize",n)}),Q(()=>{window.removeEventListener("resize",n)}),j(f,()=>{w()}),(e,l)=>{const t=D,z=se,H=oe;return h(),g("section",le,[o("div",ne,[Y(t,{title:i.slice.primary.title,description:i.slice.primary.description,"sub-title":i.slice.primary.label,"has-entry-animation":"","container-classes":{"lg:w-1/2 xs:w-3/4 sm:pt-40 sm:pb-40 pb-18 pt-18 flex flex-col justify-center":!0}},null,8,["title","description","sub-title"]),o("div",re,[o("div",ie,[o("div",ue,[o("div",ce,P(a(s)("prices.priceCalculation")),1),o("div",de,[Y(z,{label:`${a(s)("prices.ticketPrice.price")} ${a(s)("prices.ticketPrice.of")} ${a(s)("prices.ticketPrice.ticket")}`,value:Number(a(f)),onInput:x},null,8,["label","value"]),Y(z,{label:a(s)("prices.commission"),value:a(f)>0?a(C):0,readonly:""},null,8,["label","value"])])]),o("div",me,[l[0]||(l[0]=o("div",{id:"y-axis",class:"h-[23.1em] w-[0.2em] flex-shrink-0 rounded-2xl bg-gray-150"},null,-1)),(h(!0),g(E,null,I(i.slice.items,($,S)=>(h(),g("div",{key:S,class:"absolute sm:right-24 xs:right-16 right-8 translate-x-full w-1/4 sm:max-w-[7rem] xs:max-w-[5.5rem] max-w-[4rem]",style:A(a(c)[S])},[o("img",{class:"w-full -translate-y-1/2",src:$.logo.url,alt:$.logo.alt},null,8,fe)],4))),128)),o("canvas",{width:a(u).width,height:a(u).height,class:"h-full w-[34.2em]",ref_key:"canvasRef",ref:d},null,8,pe)]),o("div",xe,[o("div",ve,[Y(H,{"current-value":Number(a(f)),"max-value":L,"y-value":a(C),"y-values":a(W),"max-y-value":a(b),"is-comparative-active":a(v),onInput:p},null,8,["current-value","y-value","y-values","max-y-value","is-comparative-active"]),o("div",ye,[o("span",he,P(a(s)("prices.ticketPrice.price")),1),o("span",ge,P(a(s)("prices.ticketPrice.of")),1),o("span",null,P(a(s)("prices.ticketPrice.ticket")),1)])])])])])])])}}};export{ke as default};
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.