PageSourceSearch

https://app.przetargi.io/assets/index-BF-0rXTO.js

js przetargi.io collected 2026-10-09 01:27:45 UTC 7,969 bytes, 1 lines download raw bytes

1import{r as y,O as Z,b0 as ee,a9 as se,j as e,ak as ae,ar as a,aN as P,aE as C,aF as E,bN as ne,ac as ie,bR as L,aw as te,a8 as le}from"./index-Ozl4GyvN.js";import{P as oe}from"./pageHeadline.component-CUy7vhIi.js";import{b as re,c as ce,d as de,u as O,C as z,e as _,f as R,g as W,h as Y,T as me,D as ue,i as ge,j as he,k as xe,l as pe,m as fe,S as o,n as je,o as Pe,P as Ce}from"./app.component-CSz9esQu.js";import{C as be,u as Ne}from"./confirmPurchaseDialog-Td1TmRwo.js";import{P as De}from"./personalTenantWarningDialog-BcWh2-A9.js";const b=ne({confirmPlanChangeTitle:{id:"PlanChangeWarningDialog / Title",defaultMessage:"Confirmation of the new plan"},confirmPlanChangeDescription:{id:"PlanChangeWarningDialog / Description",defaultMessage:"If you confirm, your current subscription will end immediately, and any unused reports will be lost. You will be charged right away for the new plan if it is a paid plan. A new billing cycle for the next month will start now. Are you sure you want to proceed?"},confirmPlanChangeCancel:{id:"PlanChangeWarningDialog / Cancel",defaultMessage:"Cancel"},confirmPlanChangeConfirm:{id:"PlanChangeWarningDialog / Confirm",defaultMessage:"Confirm"}}),Se=({plan:r,onSelect:t,className:h,activeSubscription:i,loading:c})=>{var T;const n=ie(we,r),{name:j,price:l,discountedPrice:N,finalPrice:s,hasDiscount:d,isFree:m,description:B,features:D,discountEndDate:w}=re(n),{isTrialEligible:H,activeSubscriptionIsCancelled:U,activeSubscriptionPlan:u,nextSubscriptionPlanDetails:q,defaultPaymentMethod:M}=ce(i),Q=u.name===j&&!U,G=q.name===j,F=((T=n==null?void 0:n.product)==null?void 0:T.name)==="przetargi.io - Platinum Plan",[$,x]=y.useState(!1),[J,S]=y.useState(!1),[K,I]=y.useState(!1),p=Z(),k=ee(),A=de();se();const{data:v}=O(),g=()=>{var f;return t((f=n==null?void 0:n.pk)!=null?f:null)},V=()=>{g(),x(!1)};return e.jsxs(e.Fragment,{children:[e.jsxs(z,{className:ae(h,{"border-primary border-2":Q}),children:[e.jsxs(_,{children:[e.jsx(R,{children:j}),e.jsx(W,{children:B})]}),e.jsxs(Y,{className:"space-y-3",children:[e.jsx("div",{children:!F&&e.jsxs(e.Fragment,{children:[d?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col items-start space-y-1",children:[e.jsxs("div",{className:"flex flex-row items-baseline space-x-2",children:[e.jsxs("span",{className:"text-sm line-through text-muted-foreground",children:[l.toFixed(2)," PLN"]}),e.jsxs("span",{className:"text-3xl font-bold text-green-600",children:[N.toFixed(2)," PLN"]}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:["/ ",e.jsx(a,{defaultMessage:"month",id:"Change plan item / month"})]})]}),e.jsx("div",{className:"text-xs font-medium text-green-800 bg-green-100 px-2 py-1 rounded-md",children:e.jsx(a,{defaultMessage:"You save {saving} PLN",id:"Change plan item / discount saving info",values:{saving:(l-N).toFixed(2)}})})]}),w&&e.jsx("div",{className:"text-xs text-muted-foreground",children:e.jsx(a,{defaultMessage:"Discount valid until {date}, then {price} PLN/month",id:"Plan item discount end date",values:{date:new Date(w).toLocaleDateString("pl-PL"),price:l.toFixed(2)}})})]}):e.jsxs("div",{className:"flex flex-row items-baseline space-x-1",children:[e.jsxs("span",{className:"text-3xl",children:[s.toFixed(2)," PLN"]}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:["/"," ",e.jsx(a,{defaultMessage:"month",id:"Change plan item / month",values:{price:s.toFixed(2)}})]})]}),e.jsx("div",{className:"text-sm text-muted-foreground",children:e.jsx(a,{defaultMessage:"Net price",id:"Change plan item / net price notice"})})]})}),F?e.jsx(P,{variant:"default",disabled:!0,icon:e.jsx(C,{icon:"heroicons:lock-closed",size:18,className:"mr-2"}),children:e.jsx(a,{defaultMessage:"Unavailable",id:"Change plan item / Unavailable"})}):e.jsx(P,{onClick:()=>{if((v==null?void 0:v.type)===me.PERSONAL){I(!0);return}m&&!u.isFree?k(A(E.subscription.cancel)):u.isFree?!m&&s===0?g():M!=null?S(!0):g():x(!0)},disabled:G||m&&u.isFree||c,icon:e.jsx(C,{icon:"heroicons:shopping-cart",size:18,className:"mr-2"}),children:e.jsx(a,{defaultMessage:"Select plan",id:"Change plan item / Select plan"})}),e.jsxs("ul",{className:"space-y-2",children:[D==null?void 0:D.map((f,X)=>e.jsx("li",{className:"leading-3",children:e.jsx("span",{className:"text-muted-foreground text-sm",children:f})},[f,X].join())),H&&!m&&e.jsx("li",{className:"leading-3",children:e.jsx("span",{className:"text-muted-foreground text-sm",children:e.jsx(a,{defaultMessage:"Your subscription will start with a trial",id:"Change plan item / Trial eligible info"})})})]})]})]}),e.jsx(ue,{open:$,onOpenChange:x,children:e.jsxs(ge,{children:[e.jsxs(he,{children:[e.jsx(xe,{children:p.formatMessage(b.confirmPlanChangeTitle)}),e.jsx(pe,{children:p.formatMessage(b.confirmPlanChangeDescription)})]}),e.jsxs(fe,{children:[e.jsx(P,{variant:"outline",onClick:()=>x(!1),icon:e.jsx(C,{icon:"heroicons:x-mark",size:18,className:"mr-2"}),children:p.formatMessage(b.confirmPlanChangeCancel)}),e.jsx(P,{onClick:V,icon:e.jsx(C,{icon:"heroicons:check",size:18,className:"mr-2"}),children:p.formatMessage(b.confirmPlanChangeConfirm)})]})]})}),e.jsx(De,{isOpen:K,onOpenChange:I,onContinue:()=>{m&&!u.isFree?k(A(E.subscription.cancel)):u.isFree?!m&&s===0?g():M!=null?S(!0):g():x(!0)}}),e.jsx(be,{isOpen:J,description:p.formatMessage({defaultMessage:"You will receive an invoice with today's payment due date. You can cancel your subscription at any time in the Subscription tab. Do you want to continue?",id:"ConfirmPurchaseDialog / Subscription description"}),onOpenChange:S,onConfirm:g})]})},ve=()=>e.jsxs(z,{children:[e.jsxs(_,{children:[e.jsx(R,{children:e.jsx(o,{className:"h-6 w-[120px]"})}),e.jsx(W,{children:e.jsx(o,{className:"h-4 w-[180px]"})})]}),e.jsxs(Y,{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx(o,{className:"h-8 w-[140px]"}),e.jsx(o,{className:"mt-1 h-4 w-[100px]"}),e.jsx("div",{className:"text-sm text-muted-foreground mt-1",children:e.jsx(o,{className:"h-3 w-[60px]"})})]}),e.jsx(o,{className:"h-10 w-[120px]"}),e.jsx("ul",{className:"space-y-2",children:Array.from({length:3}).map((r,t)=>e.jsx("li",{className:"leading-3",children:e.jsx(o,{className:"h-4 w-full max-w-[200px]"})},t))})]})]}),ye=L("\nquery subscriptionPlansAllQuery($tenantId: ID) {\n    allSubscriptionPlans(first: 100, tenantId: $tenantId) {\n        edges {\n            node {\n                ...subscriptionPriceItemFragment\n                id\n                pk\n                product {\n                    id\n                    name\n                }
1\n                unitAmount\n            }\n        }\n    }\n}\n"),we=L("\n  fragment subscriptionPriceItemFragment on StripePriceType {\n    id\n    pk\n    product {\n      id\n      name\n    }\n    unitAmount\n    discountedUnitAmount\n    discountEndDate\n  }\n"),Me=({onPlanSelection:r,loading:t})=>{const{activeSubscription:h}=je(),{data:i}=O(),{data:c,loading:n}=te(ye,{variables:{tenantId:i==null?void 0:i.id},skip:!(i!=null&&i.id),fetchPolicy:"cache-and-network"});if(n||!c)return e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:Array.from({length:5}).map((s,d)=>e.jsx(ve,{},d))});const l=Pe(s=>s,c==null?void 0:c.allSubscriptionPlans);return l.some(s=>{var d;return((d=s==null?void 0:s.product)==null?void 0:d.name)==="przetargi.io - Platinum Plan"})||l.push({id:"platinum_plan",pk:"price_platinum",product:{id:"platinum_plan",name:"przetargi.io - Platinum Plan"},unitAmount:0}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:l.map(s=>e.jsx(Se,{plan:s,onSelect:r,activeSubscription:h,loading:t},s==null?void 0:s.id))})},Ee=()=>{const{selectPlan:r,loading:t}=Ne();return e.jsxs(Ce,{children:[e.jsx(oe,{hasBackButton:!0,header:e.jsx(a,{defaultMessage:"Plans",id:"Change plan / Heading"}),subheader:e.jsx(a,{defaultMessage:"Choose a plan",id:"Change plan / Subheading"})}),e.jsx(Me,{onPlanSelection:h=>{r(h).catch(le)},loading:t})]})};export{Ee 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.