"use strict";(self.webpackChunkfl_assistant=self.webpackChunkfl_assistant||[]).push([[751],{5970:(e,t,l)=>{l.r(t),l.d(t,{default:()=>g});var a=l(8168),n=l(1594),r=l.n(n),i=l(2470),s=l(1112),o=l(2405),c=l(6075),m=l(2117);const u=({onInput:e=(()=>{}),onDismiss:t=(()=>{}),...l})=>r().createElement("div",{className:"fl-asst-upload-card-wrapper"},r().createElement("div",(0,a.A)({className:"fl-asst-upload-card"},l),r().createElement("span",{className:"close-action"},r().createElement(o.Button,{icon:r().createElement(o.Icon.CloseCompact,null),appearance:"transparent",shape:"round",onClick:t})),r().createElement("p",{style:{textAlign:"center"}},(0,i.__)("Drop or Select files to upload to the media library.")),r().createElement("label",{htmlFor:"media-upload"},r().createElement("input",{type:"file",name:"media-upload",id:"media-upload",multiple:!0,accept:"image/jpg,image/gif,image/png,image/svg+xml",onInput:t=>e(t.target.files)}),r().createElement(o.Icon.PlusSmall,{style:{marginLeft:10}}),(0,i.__)("Choose Files")))),d=({files:e=[],current:t})=>t>e.length?null:r().createElement(r().Fragment,null,r().createElement("ul",{className:"fl-asst-file-list"},e.map(((e,l)=>l+1<t?null:r().createElement("li",{key:e.name},r().createElement("img",{style:{width:36,height:36,marginRight:10},src:URL.createObjectURL(e)}),e.name,r().createElement(o.Icon.Loading,{style:{marginLeft:"auto"}}))))));var p=l(2191);const g=e=>r().createElement(o.App.Config,(0,a.A)({pages:{default:f,"attachment/:id":()=>r().createElement(o.Page.Attachment,{CloudUI:s})}},e)),f=({baseURL:e})=>{const{listStyle:t,query:l,showUploader:a}=(0,c.useAppState)("fl-media"),{setListStyle:n,setQuery:s,setShowUploader:g}=(0,c.getAppActions)("fl-media"),{attachmentTypes:f}=(0,c.getSystemConfig)(),{files:_,uploadFiles:E,current:y}=o.Media.useMediaUploads(),h=()=>{const e={ID:(0,i.__)("ID"),date:(0,i.__)("Date Uploaded"),modified:(0,i.__)("Last Modified")},a={"":(0,i.__)("List"),grid:(0,i.__)("Grid")},c={ASC:(0,i.__)("Ascending"),DESC:(0,i.__)("Descending")};return r().createElement(o.Filter,null,r().createElement(o.Filter.RadioGroupItem,{title:(0,i.__)("Type"),items:f,value:l.post_mime_type,defaultValue:"",onChange:e=>s({...l,post_mime_type:e})}),r().createElement(o.Filter.RadioGroupItem,{title:(0,i.__)("Display As"),items:a,value:t,defaultValue:m.n.listStyle,onChange:e=>n(e)}),r().createElement(o.Filter.LabelsItem,{value:l.label,defaultValue:m.n.query.label,onChange:e=>s({...l,label:e})}),r().createElement(o.Filter.RadioGroupItem,{title:(0,i.__)("Sort By"),items:e,value:l.orderby,defaultValue:m.n.query.orderby,onChange:e=>s({...l,orderby:e})}),r().createElement(o.Filter.RadioGroupItem,{title:(0,i.__)("Order"),items:c,value:l.order,defaultValue:m.n.query.order,onChange:e=>s({...l,order:e})}),r().createElement(o.Filter.Button,{onClick:()=>{s(m.n.query),n(m.n.listStyle)}},(0,i.__)("Reset Filter")))},b=()=>r().createElement(o.Button,{isSelected:a,shape:"round",icon:r().createElement(o.Icon.Plus,null),onClick:()=>g(!a)}),C=()=>r().createElement(r().Fragment,null,a&&r().createElement(u,{onInput:E,onDismiss:()=>g(!1)}),0<_.length&&r().createElement(d,{files:_,current:y})),S=()=>r().createElement(h,null);return r().createElement(o.Page,{id:"fl-asst-media-list-page",title:(0,i.__)("Media"),icon:r().createElement(p.A,null),shouldShowBackButton:!1,padX:!1,padY:!1,shouldScroll:!1,onLoad:()=>{const e=document.querySelector(".fluid-page-content .fluid-button");e&&e.focus()},actions:r().createElement(b,null),header:r().createElement(S,null)},r().createElement(o.List.Attachments,{before:r().createElement(C,null),key:t+y,baseURL:e,query:{...l,posts_per_page:36},listStyle:t}))}},8168:(e,t,l)=>{function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e},a.apply(null,arguments)}l.d(t,{A:()=>a})}}]);