PageSourceSearch

https://meetborderless.com/build/assets/service-tier-pricing-Bbne6f67.js

js meetborderless.com collected 2026-10-09 22:42:20 UTC 6,530 bytes, 1 lines download raw bytes

1import{j as e}from"./app-C1iegf7Q.js";import{h as y,b as x,H as S,f as w}from"./inertia-BpyZy4w-.js";import{B as p}from"./button-BE4q1_FS.js";import{C as f}from"./checkbox-Bj_6CKpj.js";import{I as b}from"./input-DJt0nBB3.js";import{L as N}from"./label-Czc25Mye.js";import{a as C}from"./admin-layout-BhXWbUlP.js";import{S as $}from"./sparkles-C0aC1RHI.js";import{C as A}from"./check-0O-UND6N.js";import{X as E}from"./x-DQSeRCcH.js";import{D as T}from"./dollar-sign-Ck66Jney.js";/* empty css            */import"./index-CGXdj8xB.js";import"./utils-BiuKVCuu.js";import"./index-Dc_FVRD7.js";import"./index-XydtsrKA.js";import"./index-CL12STDK.js";import"./index-Cs5D2gCo.js";import"./index-BRU_LjHB.js";import"./index-B1PKR-s8.js";import"./index-DdRFMukF.js";import"./app-logo-Dz0wogSq.js";import"./logo-light-DU4bWymm.js";import"./flash-toast-C6O0iVL1.js";import"./createLucideIcon-wqc1LSWg.js";import"./info-D2ZN_yLm.js";import"./triangle-alert-C7AVwNi-.js";import"./circle-x-Bp6Mbpgt.js";import"./circle-check-BMWvzPMx.js";import"./arrow-left-DCX0fhKH.js";import"./menu-BR3Nc3Gr.js";import"./users-BCcupCXV.js";import"./folder-open-I72SPUVk.js";import"./pound-sterling-D16GLaAZ.js";import"./book-open-DVFlG_9t.js";function pe(){const{props:g}=y(),{services:h,tiers:l}=g,[u,o]=x.useState(null),[a,n]=x.useState({}),[j,m]=x.useState(!1),v=s=>{o(s.id);const i={};l.forEach(r=>{const t=s.tier_access[r.id];i[r.id]=t?{...t}:{is_included:!1,is_restricted:!1,override_price:null}}),n(i)},_=()=>{o(null),n({})},d=(s,i,r)=>{n(t=>({...t,[s]:{...t[s],[i]:r,...i==="is_included"&&r?{override_price:null}:{}}}))},k=s=>{m(!0);const i=Object.entries(a).map(([r,t])=>({subscription_tier_id:parseInt(r),is_included:t.is_included,is_restricted:t.is_restricted,override_price:t.override_price}));w.patch(`/admin/providers/services/${s}/tier-access`,{tier_access:i},{preserveScroll:!0,onSuccess:()=>{o(null),n({}),m(!1)},onError:()=>{m(!1)}})};return e.jsxs(C,{children:[e.jsx(S,{title:"Service Tier Pricing · Admin"}),e.jsxs("div",{className:"px-4 py-5 sm:px-6 sm:py-7",children:[e.jsxs("div",{className:"mb-5",children:[e.jsx("h1",{className:"text-xl font-semibold text-ink",children:"Service Tier Pricing"}),e.jsx("p",{className:"mt-0.5 text-sm text-ink-3",children:"Configure pricing for services based on subscription tiers"})]}),e.jsxs("div",{className:"rounded-card border border-line bg-white",children:[e.jsxs("div",{className:"border-b border-line-2 px-5 py-4",children:[e.jsx("h2",{className:"text-sm font-semibold text-ink",children:"Borderless Services"}),e.jsx("p",{className:"mt-0.5 text-sm text-ink-3",children:"Set discounts or include services for different subscription tiers"})]}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-line-2 bg-bg-2",children:[e.jsx("th",{className:"w-[250px] px-4 py-2.5 text-left text-2xs font-bold uppercase tracking-eyebrow text-ink-3",children:"Service"}),e.jsx("th",{className:"px-4 py-2.5 text-left text-2xs font-bold uppercase tracking-eyebrow text-ink-3",children:"Base Price"}),l.map(s=>e.jsx("th",{className:"px-4 py-2.5 text-center text-2xs font-bold uppercase tracking-eyebrow text-ink-3",children:s.name},s.id)),e.jsx("th",{className:"w-[100px] px-4 py-2.5 text-left text-2xs font-bold uppercase tracking-eyebrow text-ink-3",children:"Actions"})]})}),e.jsxs("tbody",{children:[h.map(s=>e.jsxs("tr",{className:"border-b border-line-2 last:border-0",children:[e.jsx("td",{className:"px-4 py-3",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-semibold text-ink",children:s.title}),e.jsx("p",{className:"mt-0.5 text-xs text-ink-3",children:s.provider_name})]})}),e.jsx("td",{className:"px-4 py-3",children:e.jsxs("span",{className:"text-sm font-semibold text-ink",children:["£",s.price_gbp]})}),l.map(i=>{const r=u===s.id,t=r?a[i.id]:s.tier_access[i.id];return t?e.jsx("td",{className:"px-4 py-3 text-center",children:r?e.jsxs("div",{className:"flex flex-col items-center gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(f,{id:`included-${s.id}-${i.id}`,checked:t.is_included,onCheckedChange:c=>d(i.id,"is_included",!!c)}),e.jsx(N,{htmlFor:`included-${s.id}-${i.id}`,className:"text-xs",children:"Included"})]}),!t.is_included&&e.jsx(b,{type:"number",step:"0.01",placeholder:`£${s.price_gbp}`,className:"h-8 w-20 text-sm",value:t.override_price??"",onChange:c=>d(i.id,"override_price",c.target.value?parseFloat(c.target.value):null)})]}):t.is_included?e.jsxs("div",{className:"flex items-center justify-center gap-1 text-green-ink",children:[e.jsx($,{className:"h-4 w-4"}),e.jsx("span",{className:"text-sm font-medium",children:"Free"})]}):t.override_price!==null?e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsxs("span",{className:"text-sm font-medium text-amber-ink",children:["£",t.override_price]}),e.jsxs("span",{className:"text-xs text-ink-3 line-through",children:["£",s.price_gbp]})]}):e.jsx("span",{className:"text-sm text-ink-3",children:"-"})},i.id):e.jsx("td",{className:"px-4 py-3 text-center",children:r?e.jsxs("div",{className:"flex flex-col items-center gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(f,{id:`included-${s.id}-${i.id}`,checked:a[i.id]?.is_included??!1,onCheckedChange:c=>d(i.id,"is_included",!!c)}),e.jsx(N,{htmlFor:`included-${s.id}-${i.id}`,className:"text-xs",children:"Included"})]}),!a[i.id]?.is_included&&e.jsx(b,{type:"number",step:"0.01",placeholder:`£${s.price_gbp}`,className:"h-8 w-20 text-sm",value:a[i.id]?.override_price??"",onChange:c=>d(i.id,"override_price",c.target.value?parseFloat(c.target.value):null)})]}):e.jsx("span",{className:"text-sm text-ink-3",children:"-"})},i.id)}),e.jsx("td",{className:"px-4 py-3",children:u===s.id?e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(p,{size:"sm",variant:"ghost",onClick:()=>k(s.id),disabled:j,children:e.jsx(A,{className:"h-4 w-4"})}),e.jsx(p,{size:"sm",variant:"ghost",onClick:_,disabled:j,children:e.jsx(E,{className:"h-4 w-4"})})]}):e.jsxs(p,{size:"sm",variant:"outline",onClick:()=>v(s),children:[e.jsx(T,{className:"mr-1 h-4 w-4"}),"Edit"]})})]},s.id)),h.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:l.length+3,className:"py-8 text-center",children:e.jsx("p",{className:"text-sm text-ink-3",children:"No Borderless services found. Create partner providers with services first."})})})]})]})})]})]})]})}export{pe 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.