1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9364],{6656:function(e,t,r){"use strict";var n=r(90116),l=r(86010),s=r(67294),a=r(86501),i=r(2777),c=r(37797),o=r(85893),u=(0,s.forwardRef)((function(e,t){var r=e.multiple,c=void 0!==r&&r,u=e.label,f=e.placeholder,x=e.accept,m=e.id,p=e.containerClassName,h=e.maxFiles,v=void 0===h?3:h,w=(0,s.useState)([]),j=w[0],b=w[1],N=function(){b([])};return(0,s.useImperativeHandle)(t,(function(){return{files:j,reset:N}}),[j]),(0,o.jsxs)(d,{className:(0,l.Z)(p),children:[(0,o.jsx)("label",{htmlFor:m,className:"text-sm font-semibold mb-2 block",children:u}),(0,o.jsxs)("label",{htmlFor:m,className:"flex justify-between items-center outline-none border border-slate-300 p-2 rounded-md w-full gap-4",children:[(0,o.jsx)("span",{className:"whitespace-nowrap w-full overflow-hidden text-ellipsis",children:f}),(0,o.jsx)(i.Yjd,{})]}),(0,o.jsx)("input",{onClick:function(e){e.target.value=null},onChange:function(e){var t,r=null!==(t=e.target.files)&&void 0!==t?t:[],l=[].concat((0,n.Z)(j),(0,n.Z)(r));l.length>v?(0,a.Am)("Unable to attach more than ".concat(v," files.")):b(l)},multiple:c,className:"absolute left-[-1000vw]",type:"file",name:m,id:m,accept:x}),(0,o.jsx)("ul",{className:"flex flex-col gap-3 mt-4",children:j.map((function(e,t){var r;return(0,o.jsxs)("li",{onClick:function(){b((function(e){for(var r=[],n=0;n<e.length;n++)t!==n&&r.push(e[n]);return r}))},className:"bg-slate-50 border border-slate-300 p-2 rounded-md text-sm text-slate-600 flex items-center justify-between gap-4",children:[(0,o.jsx)("div",{className:"flex-1 whitespace-nowrap overflow-hidden text-ellipsis",children:null!==(r=null===e||void 0===e?void 0:e.name)&&void 0!==r?r:"File"}),(0,o.jsx)(i.Ybf,{className:"text-red-500"})]},t)}))})]})}));u.displayName="FileSelect",t.Z=u;var d=c.ZP.div.withConfig({displayName:"FileSelect__Container",componentId:"sc-1tqvvkf-0"})([""])},53119:function(e,t,r){"use strict";r(67294);var n=r(85893);t.Z=function(e){var t=e.children,r=e.className,l=void 0===r?"":r,s=e.style;return(0,n.jsx)("div",{style:s,className:"flex flex-col min-h-screen ".concat(l),children:t})}},65098:function(e,t,r){"use strict";r.d(t,{_:function(){return n.Z},J:function(){return a}});var n=r(53119),l=r(86010),s=(r(67294),r(85893)),a=function(e){var t=e.children,r=e.className,n=e.wrapperClassName;return(0,s.jsx)("div",{className:(0,l.Z)("flex-1 flex flex-col items-center",r),children:(0,s.jsx)("div",{className:(0,l.Z)("w-full max-w-5xl",n),children:t})})}},66689:function(e,t,r){"use strict";r.r(t),r.d(t,{__N_SSP:function(){return h}});var n=r(50029),l=r(87794),s=r.n(l),a=r(67294),i=r(47497),c=r(65098),o=r(6656),u=r(86501),d=r(11047),f=r(91575),x=r(9008),m=r(85893),p=(0,a.forwardRef)((function(e,t){var r,n=e.result,l=n.model,s=n.status,a=n.url;return(0,m.jsxs)("div",{className:"bg-slate-50 border border-slate-300 p-2 rounded-md text-sm text-slate-600 flex items-center justify-between gap-4",children:[(0,m.jsx)("div",{className:"flex-1 whitespace-nowrap overflow-hidden text-ellipsis",children:null!==(r=l.file.name)&&void 0!==r?r:"File"}),function(){switch(s){case"added":return(0,m.jsx)("div",{children:"Added"});case"error":return(0,m.jsx)("div",{children:"Error"});case"uploading":return(0,m.jsx)("div",{children:"Uploading"});case"success":return(0,m.jsx)("button",{className:"bg-sky-500 text-white rounded-md p-1.5 text-xs font-bold",onClick:function(){(0,f.vQ)(a),u.Am.success("Url Copied: ".concat(a))},children:"Copy Link"})}}()]})}));p.displayName="FileStatusItem";var h=!0;t.default=function(){var e=(0,a.useRef)(null),t=(0,a.useState)(),r=(t[0],t[1]),l=(0,a.useRef)([]),u=(0,a.useState)([]),f=u[0],h=u[1],v=function(){var e=(0,n.Z)(s().mark((function e(t){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",d.C.uploadFile(t.file).then((function(e){var r={model:t,error:"",url:"",status:"added"};return e?(r.error="",r.status="success",r.url=e,r):(r.error="Error",r.url="",r.status="error",r)})).catch((function(e){return console.error(e),{model:t,error:"Error",url:"",status:"error"}})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),w=function(){var t=(0,n.Z)(s().mark((function t(){var r,n,l,a,i,c,o;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:l=null!==(r=null===(n=e.current)||void 0===n?void 0:n.files.map((function(e){return{file:e}})))&&void 0!==r?r:[],a=[],i=0;case 3:if(!(i<l.length)){t.next=13;break}return c=l[i],t.next=7,v(c);case 7:o=t.sent,a.push(o),h([].concat(a));case 10:i++,t.next=3;break;case 13:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return(0,m.jsxs)(c._,{children:[(0,m.jsx)(x.default,{children:(0,m.jsx)("title",{children:"File Uploader - Shuru"})}),(0,m.jsx)(i.h4,{}),(0,m.jsx)(c.J,{children:(0,m.jsxs)("div",{className:"p-4",children:[(0,m.jsx)("h1",{className:"text-xl font-bold",children:"File Uploader"}),(0,m.jsx)("p",{className:"mt-2 text-sm mb-8",children:"Select files below and press upload. After upload copy url by pressing copy button."}),(0,m.jsx)(o.Z,{placeholder:"Add files",ref:e,id:"file_select",multiple:!0,maxFiles:32}),(0,m.jsxs)("div",{className:"flex gap-4 mt-8",children:[(0,m.jsx)("button",{onClick:function(){var t;null===(t=e.current)||void 0===t||t.reset(),r([]),l.current=[]},className:"bg-red-400 text-white w-full max-w-[120px] rounded-md p-3",children:"Reset"}),(0,m.jsx)("button",{onClick:function(){return w()},className:"bg-green-500 text-white w-full max-w-[120px] rounded-md p-3",children:"Upload"})]}),(0,m.jsx)("div",{className:"flex flex-col gap-3 mt-8",children:null===f||void 0===f?void 0:f.map((function(e,t){return(0,m.jsx)(p,{result:e},t)}))})]})}),(0,m.jsx)(i.$_,{})]})}},61728:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/internal/upload-slow",function(){return r(66689)}])}},function(e){e.O(0,[9774,2888,179],(function(){return t=61728,e(e.s=t);var t}));var t=e.O();_N_E=t}]);
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.