1import{a as x,w as _,B as P,x as b}from"./chunk-UIGDSWPH-Cvdthj3w.js";import{j as t}from"./jsx-runtime-DI7wNVj9.js";import{A as j,a as y}from"./app-details-tabs-pTc2xHiV.js";import{A as I}from"./app-status-wzcvpAU9.js";import{A as v}from"./app-logo-B_ChtZUk.js";import{A as h,M as S,a2 as D}from"./clsx-DSpH6-Ct.js";import{z as d,u as E}from"./useMutation-Cfe0QBRa.js";import{u as A}from"./useTranslation-0IrcU9Ce.js";import{c as N}from"./createReactComponent-ClF_ax1B.js";import{u as C}from"./useSuspenseQuery-e5Wc0O7a.js";import{u as w}from"./DropdownMenu-ZzypLQhl.js";import"./Button-C52GdXfD.js";import"./index-BmS60WiQ.js";import"./Dialog-BXhNaeYd.js";import"./index-HYDYcs2H.js";import"./index-CHC7d3nN.js";import"./floating-ui.dom-DhEb_iXA.js";import"./Combination-BIxPe9yq.js";import"./Switch-Bl5fxM_1.js";import"./Alert-DaQFrtBZ.js";import"./index-CIfJB_2Z.js";import"./useBaseQuery-BXWEg2QX.js";import"./i18next-B0ZP0dUq.js";import"./context-CgECK52e.js";import"./index-DsUpwLPW.js";import"./index-DfVXOBe9.js";import"./Input-B7CnZl0y.js";import"./app-helpers-CB5QwD37.js";import"./keywords-Ch8Z-og-.js";import"./react-tooltip.min-CldjOdIz.js";import"./index-D9A85Gtn.js";import"./Select-BkrNPmYF.js";import"./sse-vZQnl_Fi.js";import"./IconTrash-C5vS94oo.js";import"./IconSettings-DoOFMUTy.js";import"./IconExternalLink-CCCEi89o.js";import"./IconLock-DbHYb5G4.js";import"./preload-helper-dJ61LZNH.js";import"./tabs-DF3Hq_kB.js";import"./index-DhAMLqx8.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="cb4ac20b-468d-4816-8765-72142b018975",e._sentryDebugIdIdentifier="sentry-dbid-cb4ac20b-468d-4816-8765-72142b018975")}catch{}})();const L=[["path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2",key:"svg-0"}],["path",{d:"M7 9l5 -5l5 5",key:"svg-1"}],["path",{d:"M12 4l0 12",key:"svg-2"}]],M=N("outline","upload","Upload",L),O=({urn:e,url:o,size:i=80,className:u="",alt:f="",onImageUpload:p,isUploading:n=!1})=>{const{t:s}=A(),m=x.useRef(null),g=()=>{p&&!n&&m.current?.click()},c=r=>{const a=r.target.files?.[0];if(!a)return;const l=5*1024*1024;if(a.size>l){d.error(s("FILE_TOO_LARGE")),r.target.value="";return}if(!a.type.startsWith("image/")){d.error(s("INVALID_FILE_TYPE")),r.target.value="";return}if(a.type!=="image/jpeg"&&a.type!=="image/jpg"){d.error(s("INVALID_FILE_TYPE")),r.target.value="";return}a&&p&&(p(a),r.target.value="")};return t.jsxs("div",{className:h("custom-app-logo-container",u),style:{width:i,height:i},children:[t.jsx(v,{urn:e,url:o,size:i,alt:f}),p&&t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:g,className:h("custom-app-logo-overlay",{"is-uploading":n}),"aria-label":s("CUSTOM_APP_UPLOAD_IMAGE"),disabled:n,children:t.jsxs("div",{className:"custom-app-logo-overlay-content",children:[t.jsx(M,{size:i/3,className:"custom-app-logo-icon"}),t.jsx("span",{className:"custom-app-logo-text",children:s(n?"CUSTOM_APP_UPLOADING":"CUSTOM_APP_UPLOAD_IMAGE")})]})}),t.jsx("input",{ref:m,type:"file",accept:".jpg,.jpeg,image/jpeg",onChange:c,style:{display:"none"},"aria-label":s("CUSTOM_APP_UPLOAD_IMAGE")})]})]})},T=()=>{const e=P(),{t:o}=A(),i=C({...S({path:{urn:`${e.appId}:_user`}})}),{userSettings:u}=w(),[f]=b(),[p,n]=x.useState(f.get("bust")),{info:s,app:m,metadata:g}=i.data,c=new URL(`/api/marketplace/apps/${e.appId}:_user/image`,window.location.origin),r=E({...D(),onSuccess:()=>{n(Date.now().toString()),fetch(c.toString(),{method:"HEAD"}),d.success(o("CUSTOM_APP_UPLOAD_SUCCESS"))},onError:l=>{d.error(o(l.message,l.intlParams))}}),a=l=>{r.mutate({path:{urn:`${e.appId}:_user`},body:{image:l}})};
1return p&&c.searchParams.set("t",p),t.jsxs("div",{className:"card","data-testid":"app-details",children:[t.jsxs("div",{className:"card-header d-flex flex-column flex-md-row border-0",children:[t.jsx(O,{url:c.toString(),size:130,alt:s?.name,onImageUpload:a,isUploading:r.isPending}),t.jsxs("div",{className:"w-100 d-flex flex-column ms-md-3 align-items-center align-items-md-start",children:[t.jsxs("div",{children:[t.jsxs("span",{className:"mt-1 me-1",children:[o("APP_DETAILS_VERSION"),": "]}),t.jsx("span",{className:"badge bg-muted mt-2 text-white",children:s?.version})]}),t.jsx("span",{className:"mt-1 text-muted text-center text-md-start mb-2",children:s?.short_desc}),t.jsx("div",{className:"mb-1",children:t.jsx(I,{status:m?.status??"missing"})}),t.jsx(j,{app:m,metadata:g,info:s,localDomain:u.localDomain,sslPort:u.sslPort})]})]}),t.jsx(y,{info:s,app:m,metadata:g})]})},jt=_(T);export{jt as default}; 2//# sourceMappingURL=custom-app-details-page-O4JFarCN.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.