1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},l=(new e.Error).stack;l&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[l]="1617b3c0-2ece-4053-8f94-b272ad276717",e._sentryDebugIdIdentifier="sentry-dbid-1617b3c0-2ece-4053-8f94-b272ad276717")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7237],{17237:(e,l,a)=>{a.r(l),a.d(l,{UploadComponent:()=>v});var t=a(14739),n=a(58405),o=a(16846),s=a(87758),i=a(95155),c=a(66934),d=a(40426),r=a(82274),u=a(1301),m=a(30746),h=a(33113),p=a(98801),b=a(1300),f=a(96118),g=a(12115),_={depth:0},v=e=>{var l,a,v,w;let{className:y,data:{fields:x,relationTo:D,value:j},format:N,nodeKey:C}=e;if("object"==typeof j)throw Error("Upload value should be a string or number. The Lexical Upload component should not receive the populated value object.");let{config:{routes:{api:S},serverURL:k},getEntityConfig:P}=(0,u.c)(),U=(0,g.useRef)(null),{uuid:E}=(0,s.b)(),I=(0,m.useEditDepth)(),[R]=(0,c.DF)(),{editorConfig:L,fieldProps:{schemaPath:T}}=(0,s.b)(),z=(0,d.a)(),{i18n:B,t:F}=(0,h.d)(),[K,A]=(0,g.useReducer)(e=>e+1,0),[M]=(0,g.useState)(()=>P({collectionSlug:D})),O=(0,g.useId)(),Q=(0,m.formatDrawerSlug)({slug:"lexical-upload-drawer-"+E+O,depth:I}),{toggleDrawer:q}=(0,n.a)(Q,!0),{closeDocumentDrawer:G,DocumentDrawer:H,DocumentDrawerToggler:J}=(0,o.a)({id:j,collectionSlug:M.slug}),[{data:V},{setParams:W}]=(0,m.usePayloadAPI)((0,b.Q)({apiRoute:S,path:"/".concat(M.slug,"/").concat(j),serverURL:k}),{initialParams:_}),X=(null==V?void 0:V.thumbnailURL)||(null==V?void 0:V.url),Y=(0,g.useCallback)(()=>{R.update(()=>{var e;null==(e=(0,p.nsf)(C))||e.remove()})},[R,C]),Z=(0,g.useCallback)(e=>{W({..._,cacheBust:K}),A(),G()},[W,K,G]),$=null==L||null==(w=L.resolvedFeatureMap)||null==(v=w.get("upload"))||null==(a=v.sanitizedClientFeatureProps.collections)||null==(l=a[M.slug])?void 0:l.hasExtraFields,ee=(0,g.useCallback)((e,l)=>{R.update(()=>{let e=(0,p.nsf)(C);if(e){let a={...e.getData(),fields:l};e.setData(a)}})},[R,C]),el=X&&(null==V?void 0:V.width)&&(null==V?void 0:V.height)?V.width>V.height?"landscape":"portrait":"landscape";return(0,i.jsxs)("div",{className:"".concat(y,"__contents ").concat(y,"__contents--").concat(el),"data-align":N||void 0,"data-filename":null==V?void 0:V.filename,ref:U,children:[(0,i.jsxs)("div",{className:"".concat(y,"__card"),children:[(0,i.jsxs)("div",{className:"".concat(y,"__media"),children:[(0,i.jsx)(m.Thumbnail,{collectionSlug:D,fileSrc:(0,f.w)(null==V?void 0:V.mimeType)?X:null,height:null==V?void 0:V.height,size:"none",width:null==V?void 0:V.width}),z&&(0,i.jsx)("div",{className:"".concat(y,"__overlay ").concat(y,"__floater"),children:(0,i.jsxs)("div",{className:"".concat(y,"__actions"),role:"toolbar",children:[$?(0,i.jsx)(m.Button,{buttonStyle:"icon-label",className:"".concat(y,"__upload-drawer-toggler"),disabled:!z,el:"button",icon:"edit",onClick:q,round:!0,size:"medium",tooltip:F("fields:editRelationship")}):null,(0,i.jsx)(m.Button,{buttonStyle:"icon-label",className:"".concat(y,"__swap-drawer-toggler"),disabled:!z,el:"button",icon:"swap",onClick:()=>{R.dispatchCommand(t.b,{replace:{nodeKey:C}})},round:!0,size:"medium",tooltip:F("fields:swapUpload")}),(0,i.jsx)(m.Button,{buttonStyle:"icon-label",className:"".concat(y,"__removeButton"),disabled:!z,icon:"x",onClick:e=>{e.preventDefault(),Y()},round:!0,size:"medium",tooltip:F("fields:removeUpload")})]})})]}),(0,i.jsxs)("div",{className:"".concat(y,"__metaOverlay ").concat(y,"__floater"),children:[(0,i.jsx)(J,{className:"".concat(y,"__doc-drawer-toggler"),children:(0,i.jsx)("strong",{className:"".concat(y,"__filename"),children:(null==V?void 0:V.filename)||F("general:untitled")})}),(0,i.jsx)("div",{className:"".concat(y,"__collectionLabel"),children:(0,r.s)(M.labels.singular,B)})]})]}),j?(0,i.jsx)(H,{onSave:Z}):null,$?(0,i.jsx)(t.a,{data:x,drawerSlug:Q,drawerTitle:F("general:editLabel",{label:(0,r.s)(M.labels.singular,B)}),featureKey:"upload",handleDrawerSubmit:ee,schemaPath:T,schemaPathSuffix:M.slug}):null]})}}}]);
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.