1(globalThis.webpackChunklacartedescolocs||=[]).push([[8880],{57200(){angular.module("apoena").component("formPictureUpload",{bindings:{type:"@",pictures:"<",uploadErrorUniqueId:"<",onAdd:"&",onComplete:"&",onCancel:"&",onDelete:"&",onSort:"&",onError:"&"},controller:["$scope","$timeout","$element","I18nHelper","StringHelper",function(e,t,r,o,a){const i=this;i.thumbnails=[];let n=null;const s=r[0].querySelector('input[type="file"]'),l=r[0].querySelector(".photo_preview_container"),u=e=>{let t=0,r=null;angular.forEach(i.thumbnails,(o,a)=>{if(o.unique_id==e)return t=a,r=o,!1}),r&&r.config.uppyId&&n.removeFile(r.config.uppyId),i.thumbnails.splice(t,1),d()},d=()=>{angular.forEach(i.thumbnails,(e,t)=>{e.index=t})};let p=!1,c={};i.deletePicture=e=>{e.config.isDeleting=!0,i.onDelete({uniqueId:e.unique_id})},i.cancelPicture=e=>{i.onCancel({uniqueId:e}),u(e)};const m=()=>{n||(n=new Uppy({id:i.type+"_pictures",autoProceed:!0,debug:!1,allowMultipleUploadBatches:!0,locale:window.uppyTranslations[o.locale],restrictions:{allowedFileTypes:[".jpg",".jpeg",".png",".gif",".webp",".heif",".heic",".avif","bmp"],maxNumberOfFiles:"pro_pictures"===i.type?30:100,maxFileSize:52428800},onBeforeFileAdded:(e,r)=>{i.showUppyCompressorNotice||t(()=>{i.showUppyCompressorNotice=!0})}}),n.use(AwsS3,{limit:5,shouldUseMultipart:e=>e.size>5242880,companionEndpoint:"/ovh-photo"}),n.use(Compressor,{limit:10,quality:.6,maxWidth:1200,maxHeight:900,mimeType:"image/jpeg"}),n.on("file-added",e=>{const r=(o=e.id,n=e.name,{unique_id:a.randomToken(20),index:i.thumbnails.length,config:Object.assign({},{uploadComplete:!1,showPreview:!1,uppyId:null,uppyFilename:null,isCreating:!1,isDeleting:!1,showDeleteTooltip:!1,showUploadError:!1,showPreviewError:!1},{uppyId:o,uppyFilename:a.truncateFilename(n,160)})});var o,n;t(()=>{i.thumbnails.push(r),d(),i.onAdd({uniqueId:r.unique_id,index:r.index})})}),n.on("compressor:complete",e=>{t(()=>{i.showUppyCompressorNotice=!1})}),n.on("upload-success",(e,r)=>{t(()=>{let o=i.thumbnails.find(t=>t.config.uppyId===e.id);if(!r?.uploadURL)return console.error("[uppy] upload-success without uploadURL",{file_id:e?.id,response:r}),i.showUppyCompressorNotice=!1,void i.onError({error:new Error("uppy_missing_upload_url")});o.config.uploadComplete=!0,o.config.previewTimer=t(()=>{o.config.showPreviewError=!0},17e3),i.onComplete({uniqueId:o.unique_id,uploadUrl:r.uploadURL})})}),n.on("upload-progress",(e,t)=>{if(!e)return;const o=Math.floor(t?.percentage??(t?.bytesTotal?100*t.bytesUploaded/t.bytesTotal:0)),a=i.thumbnails.find(t=>t.config.uppyId===e.id);a&&(r[0].querySelector("#progress_"+a.unique_id).style.width=o+"%")}),n.on("file-removed",(e,t)=>{s.value="",0==n.getFiles().length&&n.cancelAll()}),n.on("error",e=>{i.showUppyCompressorNotice=!1,t(()=>{i.onError({error:e})})}),s.addEventListener("change",e=>{Array.from(e.target.files).forEach(e=>{try{n.addFile({source:"file input",name:e.name,type:e.type,data:e})}catch(r){t(()=>{if(i.showUppyCompressorNotice=!1,!r.isRestriction||!r.message)throw alert(r),new Error(r);var e;e=r.message,p&&c[e]||(p=!0,c[e]=!0,setTimeout(()=>{p=!1,c={}},3e3),alert(e))})}})}))};document.addEventListener("PICTURE_UPLOADED",e=>{const r=e.detail;r?.unique_id&&r?.image_medium&&t(()=>{let e=i.thumbnails.find(e=>e.unique_id===r.unique_id);e&&(e.image_medium=r.image_medium,t(()=>{t.cancel(e.config.previewTimer),e.config.showPreview=!0},77))})}),document.addEventListener("PICTURE_TO_POLL",e=>{const t=e.detail;t?.unique_id&&t?.image_medium&&h(t.image_medium,t.unique_id)});const h=(e,r,o=10,a=1e3)=>{let n=0;const s=setInterval(()=>{n++;const a=new Image;a.src=e+`?t=${(new Date).getTime()}`,a.onload=()=>{t(()=>{let o=i.thumbnails.find(e=>e.unique_id===r);o&&(o.image_medium=e,t(()=>{t.cancel(o.config.previewTimer),o.config.showPreview=!0},77))}),clearInterval(s)},a.onerror=()=>{n>=o&&(console.warn(`Polling stopped after ${o} attempts for ${r}`),clearInterval(s))}},a)};e.$on("pictureDeleted",(e,t)=>{u(t)}),i.$onChanges=e=>{if(i.type&&!n&&(m(),window.Sortable.create(l,{draggable:".thumbnail_preview",onSort:e=>{let r=e.oldIndex,o=e.newIndex,a=e.item.id.replace("pic_","");t(()=>{i.thumbnails.splice(o,0,i.thumbnails.splice(r,1)[0]),d(),i.onSort({uniqueId:a,oldIndex:r,newIndex:o})})}})),e.pictures?.currentValue){let t=[];const r=e.pictures.currentValue;angular.forEach(r,e=>{t.push({id:e.id,unique_id:e.unique_id,index:e.index,image_medium:e.image_medium,config:Object.assign({},{uploadComplete:!1,showPreview:!1,uppyId:null,uppyFilename:null,isCreating:!1,isDeleting:!1,showDeleteTooltip:!1,showUploadError:!1,showPreviewError:!1},{uploadComplete:!0,showPreview:!0})})}),i.thumbnails=t}if(e.uploadErrorUniqueId?.currentValue){let e=i.thumbnails.find(e=>e.unique_id===i.uploadErrorUniqueId);e&&(e.config.showUploadError=!0)}}}],templateUrl:"formPictureUpload.html"})},81601(){angular.module("apoena").factory("ListingPicture",["$http",function(e){return{config:{preloader:new Image,uploadsInProgress:0},preload(e,t=null,r=null){let o=null;t||r?t&&r&&(o=e.replace(t,r)):o=e,this.config.preloader.src=o},create:t=>e({method:"POST",url:"/listing_pictures",data:{listing_picture:t}}).then(e=>e.data),destroy:(t,r)=>e({method:"DELETE",url:"/listing_pictures/"+t,params:{listing_token:r}}).then(e=>e.data)}}])},74368(){angular.module("apoena").factory("ProfilePicture",["$http",function(e){return{config:{preloader:new Image,uploadsInProgress:0},preload(e,t=null,r=null){let o=null;return t||r?t&&r&&(o=e.replace(t,r)):o=e,this.config.preloader.src=o,o},create:t=>e({method:"POST",url:"/profile_pictures",data:{profile_picture:t}}).then(e=>e.data),destroy:(t,r)=>e({method:"DELETE",url:"/profile_pictures/"+t,params:{apoena_token:r}}).then(e=>e.data)}}])},12961(){angular.module("apoena").factory("User",["$http",function(e){return{data:{},config:{},create:t=>e({method:"POST",url:"/users",data:{user:t}}).then(e=>e.data),login:t=>e({method:"POST",url:"/users/sign_in",data:{user:t}}).then(e=>e.data),edit:()=>e({method:"GET",url:"/users/edit_account"}).then(e=>e.data),update:t=>e({method:"PUT",url:"/users/update_account",data:{user:t}}).then(e=>e.data),updateEmailAlert:t=>e({method:"PATCH",url:"/users/update_email_alert",data:{user:t}}).then(e=>e.data),updateSearchParams:t=>e({method:"PATCH",url:"/users/update_search_params",data:{user:t}}).then(e=>e.data),updateEmailModel:t=>e({method:"PATCH",url:"/users/update_email_model",data:{user:t}}).then(e=>e.data),destroy:()=>e({method:"DELETE",url:"/users"}).then(e=>e.data),recoverPassword:t=>e({method:"POST",url:"/users/password",data:{user:{email:t,form_origin:"password_recovery"}}}).then(e=>e.data),setNewPassword:t=>e({method:"PUT",url:"/users/password",data:{user:t}}).then(e=>e.data),sendEmailConfirmationLink:()=>e({method:"POST",url:"/users/send_email_confirmation_link"}).then(e=>e.data),checkEmailDomain:t=>e({method:"POST",url:"/users/email_domain_check",data:{email:t}}).then(e=>e.data),sendPhoneVerificationCode:()=>e({method:"POST",url:"/users/send_phone_verification_code"}).then(e=>e.data),validatePhoneVerificationCode:t=>e({method:"POST",url:"/users/validate_phone_verification_code",params:{verification_code:t}}).then(e=>e.data),createDeviseCredentials:t=>e({method:"PATCH",url:"/users/create_devise_credentials",data:{user:t}}).then(e=>e.data),updateDeviseCredentials:t=>e({method:"PATCH",url:"/users/update_devise_credentials",data:{user:t}}).then(e=>e.data),updateInvoiceCredentials:t=>e({method:"PATCH",url:"/users/update_invoice_credentials",data:{user:t}}).then(e=>e.data),convertAccountType:()=>e({method:"PATCH",url:"/users/convert_account_type"}).then(e=>e.data),toggleChatNotification:t=>e({method:"PATCH",url:"/users/update_notification_status",data:{chat_notification_on:t}}).then(e=>e.data),updateScamWarningStatus:()=>e({method:"PATCH",url:"/users/update_scam_warning_status"}).then(e=>e.data),pingCommercialTeam:()=>e({method:"PUT",url:"/users/ping_commercial_team"}).then(e=>e.data),getLoginActivity(t=10,r=0){const o={batch_size:t};return"string"===typeof r?o.cursor=r:o.offset=r,e({method:"GET",url:"/users/login_activity",params:o}).then(e=>e.data)}}}])},47048(){angular.module("apoena").factory("Viewport",["$http","$q","I18nHelper","RailsData",function(e,t,r,o){return{current:{},parse(e){let t=JSON.parse(e);if("fr"==t.country_code&&t.area_name.indexOf("rrondissement")>-1){let e=`${t.city} ${t.district}, ${t.administrative}, ${t.country}`;t.formatted_string=e}return this.current=t,r.init(t),this.current},fetchFromLocation(r){return r?.canonical_path?t.resolve(this.parse(JSON.stringify(r))):e({method:"GET",url:"/viewports/fetch_from_location",params:r}).then(e=>{const t=e.data;return this.parse(JSON.stringify(t)),t})}}}])},18919(e,t,r){"use strict";var o=r(44914),a=r(95856),i=r(98187),n=r(87445),s=r(6284);var l=r(56568);!async function(){try{const o=await l.Ay.load(),a=await o.get();e="browser_fp",t=a.visitorId,r=2592e3,document.cookie=`${e}=${t};path=/;max-age=${r};SameSite=Lax`}catch(o){console.debug("FingerprintJS init error:",o)}var e,t,r}();var u=r(68331);r(71521);window.Uppy=o.A,window.AwsS3=a.A,window.attachUppyProgressBar=function(e,t){const r="string"===typeof t?document.querySelector(t):t;if(!e||!r)return console.warn("[uppy] progress bar target not found:",t),()=>{};let o=r.querySelector(".uppy-simple-progress");o||(o=document.createElement("div"),o.className="uppy-simple-progress",o.innerHTML='<div class="uppy-simple-progress-inner"></div>',r.appendChild(o));const a=o.querySelector(".uppy-simple-progress-inner");o.style.display="none";const i=e=>{const t=Math.max(0,Math.min(100,Number(e)||0));o.style.display="block",a.style.width=t+"%"},n=()=>{o.style.display="none",a.style.width="0%"};return e.on("progress",i),e.on("complete",n),e.on("error",n),e.on("cancel-all",n),()=>{e.off("progress",i),e.off("complete",n),e.off("error",n),e.off("cancel-all",n),o.remove()}},window.Compressor=i.A,window.uppyTranslations={fr:n.A,en:s.A},window.Sortable=u.A,r(64167)}}]);
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.