1import{u as Ae,h as k,b as Ce,q as De,ai as Te,r as m,o as we,aw as H,a9 as Pe,cQ as V,s as Ie,d as R,R as e,E as j,g as Se,N as O,y as K,B as M,H as Le,cd as ke,j as N,l as Re,aF as Oe,ar as Y,a8 as Ne,v as Q,w as h,aD as te,L as y,c as Me,i as d,c4 as Qe,c5 as Ue,b$ as qe,D as $e,e as E,cn as Ge,A as J,aE as We,aO as ze,P as U,av as Be}from"./index-9Wgw656h.js";import{u as Fe,a as He,U as Ve,Q as je,D as Ke}from"./useProductAccessUsage-CW_AnTSN.js";import{D as Ye}from"./DeleteOutline-D-Gn1LkS.js";import{E as Je}from"./EmptyState-Gpsuoo2Y.js";import{F as Xe}from"./FeaturesManagerButton-CbAuSqt5.js";import{M as Ze}from"./MoreVert-C-O-FSXR.js";import{G as i,Q as X}from"./QuotaRow-B1_Ycwme.js";import{R as et}from"./RecallWorkspacesModal-D_kfN7KQ.js";import"./ReportBar-DNF3-QjC.js";import{S as Z}from"./StatusCell-7UIvvZ00.js";import{T as tt}from"./TravelExplore-CAPR-Qrt.js";import{a as at}from"./lineitems-BlpXSr_F.js";import{p as u,g as rt,T as ot}from"./dates-B1eCd1nJ.js";import{s as st,g as nt,b as lt}from"./styles-Dow19S5m.js";import{n as ct,c as it,r as ut}from"./quota-Dn7m8qmn.js";import{i as dt}from"./tasking--IMN7EHe.js";import"./ErrorOutline-Cii8Z8Lc.js";import"./formik.esm-Ckg8DODl.js";import"./Button-Bb9qX28R.js";import"./ErrorMessage-DLzVPxFn.js";import"./OverlineLabel-Z_A9sK4Z.js";import"./tasking-zYAkjAHz.js";import"./QuotaValue-Y-KydChm.js";import"./useInfiniteQuery-Bnm3XCDO.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new r.Error().stack;o&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[o]="12d22b2b-b0ed-4b75-9cfd-1c73133554aa",r._sentryDebugIdIdentifier="sentry-dbid-12d22b2b-b0ed-4b75-9cfd-1c73133554aa")}catch{}})();const x=({children:r,tooltipText:o})=>e.createElement(Q,{sx:{display:"flex",gap:.5}},r,e.createElement(te,{title:o,placement:"top"},e.createElement(We,{color:"disabled",fontSize:"small"})));x.propTypes={children:U.node,tooltipText:U.string};const mt=2,ae=({description:r})=>{const[o,_]=m.useState(!1),[p,g]=m.useState(!1),f=e.useRef(null);return e.useEffect(()=>{const s=f.current;s&&g(s.scrollHeight>s.clientHeight)},[r]),e.createElement(M,{sx:{mb:3}},e.createElement(d,{ref:f,variant:"body2",color:"text.secondary",sx:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:o?"unset":mt,overflow:"hidden"}},r),(p||o)&&e.createElement(y,{component:"button",variant:"body2",onClick:()=>_(s=>!s),sx:{mt:.5}},o?"Show less":"Show more"))};ae.propTypes={description:U.string.isRequired};const ee=()=>e.createElement(Je,{icon:tt,text:"No line items",textSx:{maxWidth:"300px"}}),Qt=()=>{const r=Ae(),o=k(r,[E.planet_admin]),_=k(r,[E.planet_user,E.planet_admin]),{showCustomerAccounts:p,showAllAccounts:g,sqkmUsedConversionWorkaround:f}=Ce(),{productAccessId:s}=De(),A=Te(),[re,q]=m.useState(!1),[C,$]=m.useState(!1),[G,b]=m.useState(null),{data:oe,isLoading:W,error:z}=Fe(s,{enabled:!!s&&p}),a=oe??{},{organization_id:v,customer_account_id:l}=a,{isLoading:se,error:ne,data:D}=He(s,{enabled:!!s&&p}),{data:B,isLoading:le}=we(["workspacePas",l,a.edp_id],()=>Be({customerAccountId:l,search:a.edp_id,limit:H}),{enabled:o&&!!l&&C}),ce=(B?.results??[]).filter(t=>!!t.workspace_id),ie=(B?.meta?.count??0)>H,T=()=>{q(!1)},{mutate:ue,isLoading:F,isError:de,error:me}=Pe(ze,{onSuccess:async()=>{T(),await A.invalidateQueries(["productAccess"])}}),pe=()=>{ue(Number(s)),T()},c=a?.title,ge=m.useMemo(()=>v?[{label:"All Organizations",url:V},{label:a?.organization_name??"...",url:R(Ge,{orgId:v})},{label:c}]:l?[...g?[{label:"All Accounts",url:Ie},{label:a?.customer_account_name??"...",url:R(J,{accountId:l})}]:[],{label:c}]:[{label:"All Organizations",url:V},{label:c}],[l,v,a?.customer_account_name,a?.organization_name,c,g]),Ee=t=>{const n=rt(t).startOf("day").diff(ot).as("days");return`Customer access starts in ${n} ${n===1?"day":"days"}`},_e=[{field:"created_at",headerName:"Transaction Date",valueGetter:t=>u(t.value),flex:.2},{field:"quota_limit",headerName:"Quota Limit",valueGetter:t=>t.row.has_unlimited_quota?"Unlimited":ut(t.row.quota_limit,t.row.quota_units),renderCell:t=>t.value==="Error"?e.createElement(d,{color:"error",variant:"body2"},"Error"):t.value,flex:.2}
1,{field:"start_date",headerName:"Access Dates",valueGetter:t=>{const n=t.row.sfdc_year_label?` (${t.row.sfdc_year_label})`:"";return`${u(t.row.start_date)} to ${u(t.row.end_date)}${n}`},flex:.4},{field:"state",headerName:"Status",valueGetter:t=>t.row.activation_state,renderCell:t=>e.createElement(Z,{status:t.value,sx:n=>({color:lt(n,t.value),fontWeight:"inherit"}),tooltipText:t.value===at.PENDING?Ee(t.row.start_date):null}),flex:.2}];if(!p||!_)return e.createElement(j,{statusCode:404});if(z)return e.createElement(j,{...Se(z)});if(W)return e.createElement(O,{progress:!0,open:!0,message:"Loading product..."});if(!a)return null;const w=a.state===K.ACTIVE,P=o&&w,fe=a.quota_units==="tile",I=o&&!!l&&!fe,S=dt(a),be=(a.quota_style??"").startsWith("billableaoi"),ve=w&&!S&&be,he=w&&!ne&&!se&&!S,ye=!1,xe=!!a.toa_start_date||!!a.toa_end_date;return e.createElement(M,{sx:{paddingBottom:8}},e.createElement(Le,{name:e.createElement(e.Fragment,null,e.createElement("span",null,c)," ",a.state===K.DEACTIVATED&&e.createElement(ke,{label:"Deactivated",statusColor:st.deactivated,style:{marginLeft:6}})),breadcrumbs:ge,helmetTitle:c},e.createElement(N,{gap:1,alignItems:"center",flexDirection:"row"},ve&&e.createElement(Xe,{orgId:v,showReserveQuotaCopy:k(r,[E.planet_user,E.planet_admin])}),(P||I)&&e.createElement(e.Fragment,null,e.createElement(Re,{"aria-label":"More options",size:"small",onClick:t=>b(t.currentTarget)},e.createElement(Ze,null)),e.createElement(Oe,{anchorEl:G,open:!!G,onClose:()=>b(null)},I&&e.createElement(Y,{onClick:()=>{b(null),$(!0)}},e.createElement(Ve,{sx:{mr:1,fontSize:"1.1rem"}}),"Recall quota from workspaces"),I&&P&&e.createElement(Ne,null),P&&e.createElement(Y,{sx:t=>({color:t.palette.error.main}),onClick:()=>{b(null),q(!0)}},e.createElement(Ye,{sx:{mr:1}}),"Deactivate product"))))),a.description&&e.createElement(ae,{description:a.description}),e.createElement(i,{container:!0,spacing:3},e.createElement(i,{xs:12,md:6},e.createElement(x,{tooltipText:"Defined by provisioning completeness and access dates. Pending status has future access dates."},"Status"),e.createElement(Z,{status:a.state,variant:"body1",sx:t=>({color:nt(t,a.state),fontWeight:"inherit"})})),a.pl_numbers&&a.pl_numbers.length>0&&e.createElement(i,{xs:12,md:6},e.createElement(Q,null,"PL ",a.pl_numbers.length===1?"Number":"Numbers"),e.createElement(h,null,(()=>{const t=a.pl_numbers;if(t.length<=3)return t.join(", ");const n=`${t.slice(0,3).join(", ")}, ...`,L=t.join(", ");return e.createElement(te,{title:L,placement:"top"},e.createElement("span",null,n))})())),e.createElement(i,{xs:12,md:6},e.createElement(x,{tooltipText:"Time period in which user can access data."},"Access Dates"),e.createElement(h,null,u(a.term_start_date)," to"," ",u(a.term_end_date))),xe&&e.createElement(i,{xs:12,md:6},e.createElement(x,{tooltipText:"Time extent for all available data"},"Data Availability"),e.createElement(h,null,a.toa_start_date?u(a.toa_start_date):"Start of term"," ","to"," ",a.toa_end_date?u(a.toa_end_date):"end of term")),o&&l&&e.createElement(i,{xs:12,md:6},e.createElement(Q,{sx:{margin:0}},"Customer Account"),e.createElement(h,null,g?e.createElement(y,{color:"primary.dark",component:Me,to:R(J,{accountId:l}),underline:"hover"},a.customer_account_name??"..."):a.customer_account_name??"..."))),he&&e.createElement(N,{sx:{gap:1,marginTop:3}},e.createElement(d,{variant:"subtitle1",sx:{fontWeight:700}},"Current Term Usage"),e.createElement(d,{variant:"body2",color:"text.secondary",component:"div"},"Quota unit:"," ",e.createElement(je,{unit:D?.non_recurring?.[0]?.quota_unit??a.quota_units,variant:"body2"})),D?.non_recurring?.map(t=>{const{used:n,limit:L}=ct({current:t.used,limit:t.quota_limit,units:t.quota_unit},f);return e.createElement(X,{key:`${t.quota_unit}-${t.quota_limit}-${t.start_date}`,quota:{limit:L,current:n,enabled:!0},quotaUnits:t.quota_unit,subscriptionEnd:t.end_date})}),!D?.non_recurring?.length&&e.createElement(X,{quota:{...it(a),enabled:!0},quotaUnits:a.quota_units,subscriptionEnd:a.term_end_date})),S&&e.createElement(i,{sm:12,xl:12,sx:{marginTop:3}},e.createElement(Qe,{variant:"outlined",sx:{backgroundColor:"grey.100",borderColor:"grey.300"}},e.createElement(Ue,null,e.createElement(d,{variant:"subtitle1"},"This product consumes"," ",e.createElement(y,{color:"primary",href:"https://docs.planet.com/platform/processing-units",target:"_blank",rel:"noreferer noopener"},"processing units")," ","when you view basemap tiles. Please refer to your Processing Units"," ",e.createElement(y,{color:"primary",href:`${qe}#/usage`,target:"_blank",rel:"noreferer noopener"},"usage")," ","to track consumption and understand how much has been used.")))
1),ye,e.createElement(N,{"data-testid":"product-history-section",sx:{gap:1,marginTop:5}},e.createElement(d,{variant:"subtitle1",fontWeight:700},"Product History"),e.createElement(M,{sx:{display:"flex",flexDirection:"column",minHeight:120}},e.createElement($e,{autoHeight:!0,columns:_e,disableColumnFilter:!0,disableColumnSorting:!0,disableRowSelectionOnClick:!0,initialState:{sorting:{sortModel:[{field:"created_at",sort:"asc"}]}},loading:W,rowCount:(a.line_items??[]).length,rows:a.line_items??[],slots:{noRowsOverlay:ee,noResultsOverlay:ee}}))),C&&e.createElement(et,{open:C,onClose:()=>$(!1),onSuccess:()=>{A.invalidateQueries(["productAccess",s]),A.invalidateQueries(["productAccessTerms",s])},workspacePas:ce,workspacePasLoading:le,workspacePasTruncated:ie}),re&&e.createElement(Ke,{handleModalClose:T,handleDeactivate:pe,isLoading:F,productTitle:c}),e.createElement(O,{open:F,message:"Deactivating product...",progress:!0}),e.createElement(O,{open:de,message:me?.message,severity:"error",autoHideDuration:5e3}))};export{Qt as default}; 2//# sourceMappingURL=ProductDetailPage-CwRGYxHM.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.