1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3687],{15297:function(e,t,n){n.d(t,{I:function(){return u}}),n(56168);var r=n(10810),i=n(35478),a=n(16051),o=n(59966),c=n(45601),s=n(77),l=n(8014),u=function(e){var t=e.text_confirm||"Confirmar ?",n=e.text_confirm_title||"Confirma\xe7\xe3o",u=e.full_text_confirm;return(0,l.jsx)("div",{children:(0,l.jsxs)(i.Z,{open:e.open,onClose:e.handleClose,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[(0,l.jsx)(s.Z,{id:"alert-dialog-title",children:n}),(0,l.jsxs)(o.Z,{children:[(0,l.jsx)(c.Z,{id:"alert-dialog-description",children:t}),(0,l.jsx)(c.Z,{id:"alert-dialog-description",children:u&&u})]}),(0,l.jsxs)(a.Z,{children:[(0,l.jsx)(r.Z,{onClick:function(){return e.handleClose(!1)},color:"primary",children:"Cancelar"}),(0,l.jsx)(r.Z,{onClick:function(){return e.confirm()},color:"primary",autoFocus:!0,children:"Sim"})]})]})})}},73687:function(e,t,n){n.d(t,{Z:function(){return V}});var r=n(75234),i=n(25883),a=n(14219),o=n.n(a),c=n(56168),s=n(80241),l=n.n(s),u=n(14138),d=n(18003),f=n(80841),p=n(12517),m=n(99042),g=n(58725),h=n(49084),v=n(21260),b=n(31074),x=n(34911),y=n(8014),j=(0,f.Z)()(function(e){return{modal:{display:"flex",alignItems:"center",justifyContent:"center"},container:(0,d.Z)({position:"absolute",backgroundColor:e.palette.background.paper,boxShadow:e.shadows[5],padding:"".concat(e.spacing(2)," 0 "),top:"5%",bottom:"5%",left:"5%",right:"5%",width:"auto"},e.breakpoints.down("sm"),{left:0,right:0}),close:{position:"absolute",top:e.spacing(.5)},closeRight:{right:e.spacing(.5)},closeLeft:{left:e.spacing(.5)}}});function _(e){var t,n=e.open,r=e.handleCloseModal,i=e.children,a=e.maxWidth,o=e.minHeight,c=e.loading,s=e.closeButtonSide,l=void 0===s?"right":s,u=j(),f=u.classes,_=u.cx;return(0,y.jsx)(p.Z,{className:f.modal,open:n,onClose:r,closeAfterTransition:!0,BackdropComponent:m.Z,BackdropProps:{timeout:500},children:(0,y.jsx)(g.Z,{in:n,children:(0,y.jsxs)(h.Z,{maxWidth:void 0===a?"sm":a,className:f.container,style:{minHeight:void 0===o?"50vh":o},children:[(0,y.jsx)(x.Z,{loading:c}),(0,y.jsx)(v.Z,{"aria-label":"close",onClick:r,className:_(f.close,(t={},(0,d.Z)(t,f.closeRight,"right"===l),(0,d.Z)(t,f.closeLeft,"left"===l),t)),children:(0,y.jsx)(b.Z,{})}),i]})})})}var Z=n(89914),w=n.n(Z),C=n(54743),k=n.n(C),S=(0,f.Z)()(function(e){return{fileInput:{color:"transparent",display:"none"},muiButton:{padding:0},buttons:(0,d.Z)({},e.breakpoints.down("sm"),{fontSize:10}),buttonsContainer:(0,d.Z)({display:"flex",marginLeft:"auto",gap:8},e.breakpoints.down("sm"),{marginRight:"auto"}),uploadButton:{height:"100%",width:"100%",cursor:"pointer",padding:"".concat(e.spacing(.5)," ").concat(e.spacing(1))},allImagesContainer:{overflowY:"scroll",overflowX:"hidden",flex:1,"&::-webkit-scrollbar":{backgroundColor:"#eee",width:8},"&::-webkit-scrollbar-track":{backgroundColor:"#d9d9d9",borderRadius:10},"&::-webkit-scrollbar-thumb":{backgroundColor:"#222",borderRadius:10},"&::-webkit-scrollbar-thumb:hover":{background:"#333"}},item:{alignItems:"center",borderBottom:"1px solid #33333330",padding:e.spacing(1),minHeight:50,"&:hover":{background:"#22222220",cursor:"pointer"}},itemLabel:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},itemContentContainer:{paddingLeft:e.spacing(1)},iconButton:{width:40,height:40,padding:4,transition:"300ms","&:hover":{backgroundColor:"#33333360"}},itemDetail:{alignItems:"center"},paginationContainer:{marginTop:"auto",marginBottom:6,paddingTop:6},bottomContainer:{maxHeight:50,display:"flex",alignItems:"center",padding:"".concat(e.spacing(2)," ").concat(e.spacing(2)," 0")}}}),O=n(35907),I=n(10810),D=n(2612),N=n.n(D),L=n(46513),A=n(8744);function P(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return R(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return R(e,t)}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}
1}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){c=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(c)throw a}}}}function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var E,B,U,T,z=(E=(0,i.Z)(o().mark(function e(t){var n,r,i,a,c,s,l;return o().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=(0,D.get)(t,"name",""),r=(0,L.v4)(),i="images/".concat(r,"-").concat(n),a=(0,D.get)(t,"type",""),c=(0,D.get)(t,"size",0),e.prev=5,e.next=8,F(t,i);case 8:return l={name:n,id:r,url:e.sent,ref:i,type:a,size:c},e.abrupt("return",l);case 13:e.prev=13,e.t0=e.catch(5),console.log("error uploading image",e.t0);case 16:case"end":return e.stop()}},e,null,[[5,13]])})),function(e){return E.apply(this,arguments)}),M=(B=(0,i.Z)(o().mark(function e(t){var n,r,i,a,c;return o().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:n=[],r=P(t),e.prev=2,r.s();case 4:if((i=r.n()).done){e.next=12;break}return a=i.value,e.next=8,z(a);case 8:c=e.sent,n.push(c);case 10:e.next=4;break;case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(2),r.e(e.t0);case 17:return e.prev=17,r.f(),e.finish(17);case 20:return e.abrupt("return",n);case 21:case"end":return e.stop()}},e,null,[[2,14,17,20]])})),function(e){return B.apply(this,arguments)}),F=(U=(0,i.Z)(o().mark(function e(t,n){var r,i,a;return o().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=A.tO.ref(),e.next=3,r.child(n).put(t);case 3:return i=e.sent,e.next=6,i.ref.getDownloadURL();case 6:return a=e.sent,e.abrupt("return",a);case 8:case"end":return e.stop()}},e)})),function(e,t){return U.apply(this,arguments)}),G=(T=(0,i.Z)(o().mark(function e(t){var n;return o().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=A.tO.ref(t),e.next=3,n.delete().then(function(){}).catch(function(e){console.log("error deleting image",e)});case 3:case"end":return e.stop()}},e)})),function(e){return T.apply(this,arguments)}),H=n(15297),Y=n(93583),W=n(6804),$=n(22354),X=n(54425),q=n.n(X),J=n(89739);function K(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Q(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Q(e,t)}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){c=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(c)throw a}}}}function Q(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var V=function(e){var t,n,a,s=e.isInForm,d=void 0!==s&&s,f=e.setFormSelectedImages,p=e.singleImage,m=void 0!==p&&p,g=e.open,h=e.handleCloseModal,b=e.loading,x=e.crud_generic_get_action,j=e.done_crud_2,Z=e.currentUser,C=e.set_generic_action,D=(0,c.useState)([]),L=D[0],A=D[1],P=(0,c.useState)({open:!1,images:[]}),R=P[0],E=P[1],B=w()(Z,"uid",!1),U=S().classes,T=(0,J.O)("list_backend","imagesListData","getImagesList","loadingList","errorList","doneList"),z=T.imagesListData,F=T.getImagesList,X=T.loadingList,Q=b||X,V=w()(z,"posts",[]),ee=w()(z,"page",1),et=w()(z,"pageCount",1),en=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;F({model:"images",by_user_uid:B,page:e,per_page:20,list_filters:[],limit:1e4})},er=function(e){var t=N().cloneDeep(e);t.function_name="create",t.mode="post",t.by_user_uid=B,x(t,"images","GET_CRUD_2","DONE_CRUD_2")},ei=function(e){var t={};t.function_name="delete",t.mode="delete",t.by_user_uid=B,t.id=e,x(t,"images","GET_CRUD_2","DONE_CRUD_2")},ea=(t=(0,i.Z)(o().mark(function e(t){var n,r;return o().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.target.files,C(!0,"IS_LOADING"),e.next=4,M(n);case 4:er({images:e.sent});case 6:case"end":return e.stop()}},e)})),function(e){return t.apply(this,arguments)}),eo=function(e){var t=w()(e,"id","");L.some(function(e){return w()(e,"id",!1)===t})?A(L.filter(function(e){return e.id!==t})):A(function(t){return[].concat((0,r.Z)(t),[e])})},ec=function(e){m?f(e[0]):f(function(t){return[].concat((0,r.Z)(t),(0,r.Z)(e))}),h(),A([])},es=(n=(0,i.Z)(o().mark(function e(t){var n,r;return o().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=w()(t,"ref",!1),r=w()(t,"id",""),ei(r),!n){e.next=6;break}return e.next=6,G(n);case 6:case"end":return e.stop()}},e)})),function(e){return n.apply(this,arguments)}),el=(a=(0,i.Z)(o().mark(function e(t){var n,r,i;return o().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:C(!0,"IS_LOADING"),n=K(t),e.prev=2,n.s();case 4:if((r=n.n()).done){e.next=10;break}return i=r.value,e.next=8,es(i);case 8:e.next=4;break;case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(2),n.e(e.t0);case 15:return e.prev=15,n.f(),e.finish(15);case 18:A([]),E({open:!1,images:[],text:""}),C(!1,"IS_LOADING");case 21:case"end":return e.stop()}},e,null,[[2,12,15,18]])})),function(e){return a.apply(this,arguments)});(0,c.useEffect)(function(){en(1)},[]),(0,c.useEffect)(function(){j&&en(1)},[j]);var eu=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=w()(k()(e),"name","");E({open:!0,title:"Deletar imagem?",text:t?"Deseja deletar ".concat(L.length," imagens?"):"Deseja deletar ".concat(n,"?"),images:e})},ed=function(){E({open:!1,images:[],text:""})},ef=function(e,t){en(t)};return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(H.I,{text_confirm_title:R.title||"Deletar imagem?",text_confirm:R.text||"",open:R.open,handleClose:function(){ed()},confirm:function(){ed(),el(R.images)}}),(0,y.jsx)(_,{open:g,handleCloseModal:function(){Q||(A([]),h())},maxWidth:"lg",loading:Q,closeButtonSide:"right",children:(0,y.jsxs)(u.ZP,{container:!0,direction:"column",style:{padding:8,height:"100%",paddingTop:32},children:[(0,y.jsx)(u.ZP,{item:!0,container:!0,spacing:0,className:U.allImagesContainer,children:V.length>0&&V.map(function(e,t){var n=w()(e,"id",""),r=w()(e,"name",""),i=w()(e,"createdAt._seconds",""),a=q().unix(i).format("DD/MM/YYYY"),o=L.some(function(e){return w()(e,"id",!1)===n});return(0,y.jsxs)(u.ZP,{item:!0,container:!0,xs:12,onClick:function(){eo(e)},style:{backgroundColor:o?"#22222220":null,maxHeight:"15%"},className:U.item,children:[(0,y.jsxs)(u.ZP,{item:!0,container:!0,xs:1,alignItems:"center",justifyContent:"center",children:[" ",(0,y.jsx)(l(),{height:40,width:40,src:e.url,srcSet:e.url,alt:e.name,objectFit:"contain",loading:"lazy"})]}),(0,y.jsxs)(u.ZP,{item:!0,container:!0,xs:10,className:U.itemContentContainer,children:[(0,y.jsx)(u.ZP,{item:!0,container:!0,xs:12,children:(0,y.jsx)(Y.Z,{className:U.itemLabel,children:r})}),(0,y.jsx)(u.ZP,{item:!0,container:!0,xs:12,className:U.itemDetail,children:(0,y.jsx)(Y.Z,{variant:"caption",children:a})})]}),(0,y.jsx)(u.ZP,{item:!0,container:!0,xs:1,style:{paddingRight:8},children:(0,y.jsx)(v.Z,{onClick:function(){eu([e])},className:U.iconButton,disabled:Q,children:(0,y.jsx)(O.Z,{})})})]},t)})}),(0,y.jsx)(u.ZP,{container:!0,item:!0,alignItems:"center",justifyContent:"center",className:U.paginationContainer,children:(0,y.jsx)($.Z,{spacing:2,children:(0,y.jsx)(W.Z,{count:et,page:ee,onChange:ef})})}),(0,y.jsxs)(u.ZP,{item:!0,className:U.bottomContainer,children:[(0,y.jsxs)("div",{className:U.buttonsContainer,children:[d&&(0,y.jsx)(I.Z,{variant:"text",size:"small",color:"primary",disabled:0===L.length||Q,onClick:function(){eu(L,!0)},className:U.buttons,children:"Deletar Selecionadas"}),d&&(0,y.jsx)(I.Z,{variant:"contained",size:"small",color:"primary",disabled:0===L.length||Q,onClick:function(){ec(L)},className:U.buttons,children:"Adicionar Imagens"}),(0,y.jsx)(I.Z,{variant:"outlined",size:"small",color:"primary",className:"".concat(U.muiButton," ").concat(U.buttons),disabled:Q,children:(0,y.jsx)("label",{htmlFor:"galleryUploader",className:U.uploadButton,children:"Enviar para galer
1ia"})})]}),(0,y.jsx)("input",{type:"file",className:U.fileInput,name:"galleryUploader",id:"galleryUploader",onChange:ea,multiple:!0})]})]})})]})}},89739:function(e,t,n){n.d(t,{O:function(){return p},j:function(){return m}});var r=n(18003),i=n(25883),a=n(14219),o=n.n(a),c=n(56168),s=n(8744),l=n(89914),u=n.n(l);function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach(function(t){(0,r.Z)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function p(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"posts",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"result",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"get_list",a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"loading",l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"error",d=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"done",p=!(arguments.length>6)||void 0===arguments[6]||arguments[6],m=arguments.length>7&&void 0!==arguments[7]?arguments[7]:{},g=(0,c.useState)([]),h=g[0],v=g[1],b=(0,c.useState)(null),x=b[0],y=b[1],j=(0,c.useState)(!1),_=j[0],Z=j[1],w=(0,c.useState)(!1),C=w[0],k=w[1],S=(e=(0,i.Z)(o().mark(function e(n){var r,i,a,c,l,d,g,h,b,x,j,_,w,C;return o().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=u()(n,"model","profiles"),i=u()(n,"by_user_uid",""),a=u()(n,"list_filters",[]),c=u()(n,"page",0),l=u()(n,"per_page",5),d=u()(n,"limit",100),g=u()(n,"order_by","createdAt._seconds"),h=u()(n,"order_direction","desc"),b=t,x=u()(n,"function_select_name","list"),v(m),e.prev=11,Z(!0),j=(0,s.Lz)(b),_=f(f({},n),{},{model:r,list_filters:a,per_page:l,by_user_uid:i,page:c,limit:d,function_name:x,order_by:g,order_direction:h}),e.next=17,j(_);case 17:w=e.sent,C=u()(w,"data",{}),v(C),setTimeout(function(){p&&(y({}),Z(!1),k(!1))},1e4),e.next=27;break;case 23:e.prev=23,e.t0=e.catch(11),k(!1),y(e.t0);case 27:return e.prev=27,Z(!1),e.finish(27);case 30:case"end":return e.stop()}},e,null,[[11,23,27,30]])})),function(t){return e.apply(this,arguments)}),O={};return O[n]=h,O[a]=_,O[d]=C,O[l]=x,O[r]=S,O}function m(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"list_backend",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"update_user",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"result",a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],l=(0,c.useState)({}),d=l[0],f=l[1],p=(0,c.useState)(null),m=p[0],g=p[1],h=(0,c.useState)(!1),v=h[0],b=h[1],x=(0,c.useState)(!1),y=x[0],j=x[1],_="error_"+n,Z="done_"+n,w="loading_"+n,C=(e=(0,i.Z)(o().mark(function e(n){var r,i,c,l,d,p;return o().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,b(!0),r=(0,s.Lz)(t),e.next=5,r(n);case 5:i=e.sent,c=u()(i,"data",{}),l=u()(c,"done",!1),d=u()(c,"out",{}),p=u()(c,"error",{code:500,message:"useRemoteCrud ERROR"}),f(d),j(l),l||g(p),setTimeout(function(){a&&(g({}),j(!1),b(!1))},1e4),e.next=21;break;case 16:e.prev=16,e.t0=e.catch(0),g(e.t0),f({}),j(!1);case 21:return e.prev=21,b(!1),e.finish(21);case 24:case"end":return e.stop()}},e,null,[[0,16,21,24]])})),function(t){return e.apply(this,arguments)}),k={};return k[r]=d,k[w]=v,k[Z]=y,k[_]=m,k[n]=C,k}}}]);
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.