1/* @license See /assets/vendor.LICENSE.txt */ 2import{_ as ee,a as te}from"./who-BecomeStreamerCloseButton.vue_vue_type_script_setup_true_lang.CHu92_f8.js";import{i as ae,U as oe,f$ as se,V as re,a0 as ne,u as le,r as I,j as ie,f as M,w as ce,J as de,m as h,F as C,v as R,t as f,q as P,P as g,x as e,S as m,z as A,L as c,G as K,aj as fe,s as ue,y as pe,bw as L,g0 as z,g1 as W,g2 as me,b0 as $,g3 as be,_ as ve,B as _e,fk as ge,g4 as he}from"./who-modals.COweCHuk.js";import"./who-vendor-firebase.Cl-uKClc.js";import"./who-vendor-date-fns.CVLJUTOg.js";import"./who-vendor-sentry.D6QQgNDm.js";import"./who-vendor-lottie-web.CrC-EasW.js";import"./who-vendor-swiper.B3M301Wf.js";(function(){try{var d=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},b=new d.Error().stack;b&&(d._sentryDebugIds=d._sentryDebugIds||{},d._sentryDebugIds[b]="019dc32b-7d63-4fa9-956d-54e2e659fca3",d._sentryDebugIdIdentifier="sentry-dbid-019dc32b-7d63-4fa9-956d-54e2e659fca3")}catch{}})();const r=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];function xe(){const d=Math.random()*4294967295|0,b=Math.random()*4294967295|0,n=Math.random()*4294967295|0,u=Math.random()*4294967295|0;return(r[d&255]+r[d>>8&255]+r[d>>16&255]+r[d>>24&255]+"-"+r[b&255]+r[b>>8&255]+"-"+r[b>>16&15|64]+r[b>>24&255]+"-"+r[n&63|128]+r[n>>8&255]+"-"+r[n>>16&255]+r[n>>24&255]+r[u&255]+r[u>>8&255]+r[u>>16&255]+r[u>>24&255]).toLowerCase()}const ye={class:"relative size-full"},ke={class:"flex h-full w-full max-w-md flex-col items-center justify-center text-center"},Ie=["src"],Ae={key:1,class:"absolute inset-0 flex items-center justify-center text-sm text-gray-400"},Ue={class:"mx-auto mt-2 flex w-fit items-center gap-2 text-xs text-richTeal"},Ce=["disabled"],Re={class:"text-base"}
2,we={class:"flex w-full max-w-md shrink-0 flex-col items-center pt-3 text-center"},Le=["capture"],Se=["disabled"],Be={class:"text-base"},Ee=100,Ne=ae({__name:"BecomeStreamerSelfiePreview",props:{uploadedPhoto:{},supportConversationId:{},unseenCount:{},conversationData:{},isIdBackImgUpload:{type:Boolean}},emits:["next","updateImage","updateConversationId","imageUploaded"],setup(d,{emit:b}){const n=d,u=b,T=oe(),w=se(),j=re(),{isDesktop:S}=ne(),i=le(),D=I(null),s=I(null),v=I(null),_=I(!1),x=I([]),B=I(null),y=I(null),p=ie.WHO_BRAND_NAME,H=()=>{var t;return(t=D.value)==null?void 0:t.click()},q=M(()=>{var t,a;return(a=(t=j.setting)==null?void 0:t.self_become_popular_settings)==null?void 0:a.requires_id_back_photo}),F=M(()=>!n.isIdBackImgUpload&&!q.value),G=M(()=>{if(x.value.length===0)return 0;const t=x.value.reduce((a,l)=>a+l,0);return Math.round(t/x.value.length)}),J=async(t,a)=>{var N,V,O;const l=xe();B.value=null,x.value[a]=0;const o=l||crypto.randomUUID(),U=((V=(N=j.setting)==null?void 0:N.self_become_popular_settings)==null?void 0:V.photo_path)+o;y.value=new AbortController;const Z=y.value.signal;try{await ge(t,U,t.type||"image/jpeg",Z,E=>x.value[a]=E??0),he(o),await z({receiver_id:"support",conversation_id:n.supportConversationId,photo:U,dev_payload:o,photo_mode:W.CAMERA}),u("imageUploaded",{storagePath:U})}catch{if((O=y.value)!=null&&O.signal.aborted)return;L.error(i(c.error_occurred))}finally{x.value.every(E=>E>=Ee)&&(y.value=null)}};async function Q(){if(v.value&&v.value.size>=5*1024*1024){L.error(i(c.image_size_error));return}if(!(n.isIdBackImgUpload||F.value)){u("next");return}if(_.value)return;const a=[];if(v.value&&a.push(v.value),n.isIdBackImgUpload&&w.idVerificationPhoto instanceof File&&a.push(w.idVerificationPhoto),a.length===0){B.value="No file selected";return}if(a.some(o=>o.type.startsWith("image/")&&o.size>=5*1024*1024)){L.error(i(c.image_size_error));return}if(n.conversationData||await X(),!n.supportConversationId){B.value="Missing conversation id";return}_.value=!0,x.value=a.map(()=>0),await Promise.all(a.map((o,k)=>
2J(o,k))),typeof w.idVerificationPhoto=="string"&&await z({receiver_id:"support",conversation_id:n.supportConversationId,photo:w.idVerificationPhoto,dev_payload:crypto.randomUUID(),photo_mode:W.CAMERA}),_.value=!1,u("next")}async function X(){const t=await me({receiver_id:"support"});if(t.type===$.API_ERROR&&L.error(i(c.error_occurred)),t.type===$.API_RESULT){const a=t.data.conversation_id;return u("updateConversationId",a),await be({receiver_id:T.uid,update:null,next:null}),a}}const Y=t=>{var o,k;const l=(o=t.target.files)==null?void 0:o[0];l&&((k=s.value)!=null&&k.startsWith("blob:")&&URL.revokeObjectURL(s.value),v.value=l,s.value=URL.createObjectURL(l),u("updateImage",l))};return ce(()=>n.uploadedPhoto,t=>{var a,l,o;if(!t){(a=s.value)!=null&&a.startsWith("blob:")&&URL.revokeObjectURL(s.value),s.value=null,v.value=null;return}typeof t=="string"?((l=s.value)!=null&&l.startsWith("blob:")&&URL.revokeObjectURL(s.value),s.value=t,v.value=null):((o=s.value)!=null&&o.startsWith("blob:")&&URL.revokeObjectURL(s.value),s.value=URL.createObjectURL(t),v.value=t)},{immediate:!0}),de(async()=>{var t;(t=s.value)!=null&&t.startsWith("blob:")&&URL.revokeObjectURL(s.value),y.value&&(y.value.abort(),y.value=null)}),(t,a)=>{const l=ee,o=ve,k=_e,U=te;return h(),C("div",ye,[R(l,{class:"md:absolute",disabled:_.value},null,8,["disabled"]),f("div",{class:g(["flex h-full flex-col items-center justify-between overflow-y-auto overscroll-contain px-12 py-8",e(p)===e(m).KARAMELCHAT?"text-black":"text-white"])},[f("div",ke,[t.isIdBackImgUpload?(h(),P(o,{key:0,name:"id-card-icon",class:g([{"**:fill-becomeStreamerKaramel":e(p)===e(m).KARAMELCHAT},"min-h-fit shrink-0"])},null,8,["class"])):(h(),P(o,{key:1,name:"verification-info-icon",class:g([{"**:fill-becomeStreamerKaramel":e(p)===e(m).KARAMELCHAT},"min-h-fit shrink-0"])},null,8,["class"])),f("span",{class:g(["mt-2 text-2xl font-bold",e(p)===e(m).KARAMELCHAT?"text-black":"text-white"])},A(t.isIdBackImgUpload?e(i)(e(c).id_back_title):e(i)(e(c).verify_id_and_photo)),3),f("span",{class:g(["mt-1 text-sm",e(p)===e(m).KARAMELCHAT?"text-black":"text-white"])},A(t.isIdBackImgUpload?e(i)(e(c).id_back_instruction):e(i)(e(c).ensure_id_face_visible)),3),f("div",{class:g(["relative mt-8 max-h-[40vh] overflow-hidden rounded-2xl bg-gray-800/90",[t.isIdBackImgUpload?"aspect-video":"aspect-9/16",e(p)===e(m).KARAMELCHAT?"bg-lightgray":"bg-gray-800"]])},[s.value?(h(),C("img",{key:0,src:s.value,alt:"Preview",class:"h-full w-full object-contain"},null,8,Ie)):(h(),C("span",Ae," No image selected "))],2),f("div",Ue,[R(o,{name:"clip"}),f("span",null,A(e(i)(e(c).uploaded_photo)),1)]),e(S)?K("",!0):(h(),C("button",{key:2,class:g(["mt-3 inline-flex w-fit items-center gap-2 rounded-full border px-6 py-2 disabled:opacity-60",e(p)===e(m).KARAMELCHAT?"border-becomeStreamerKaramel text-becomeStreamerKaramel":"border-primary text-primary"]),disabled:_.value,onClick:H},[R(o,{name:"mode-portrait"}),f("span",Re,A(e(i)(e(c).retake)),1)],10,Ce))]),f("div",we,[f("input",{ref_key:"inputEl",ref:D,type:"file",accept:"image/*",capture:e(fe)?void 0:"user",class:"hidden",onChange:Y},null,40,Le),e(S)?(h(),C("button",{key:0,class:g(["mb-4 inline-flex w-full items-center justify-center gap-2 rounded-full border px-6 py-3 disabled:opacity-60",e(p)===e(m).KARAMELCHAT?"border-becomeStreamerKaramel":"border-primary"]),disabled:_.value,onClick:H},[R(o,{name:"icons-add",class:g(["fill-black",{"**:fill-becomeStreamerKaramel **:stroke-becomeStreamerKaramel":e(p)===e(m).KARAMELCHAT}])},null,8,["class"]),f("span",Be,A(e(i)(e(c).streamer_replace_photo)),1)],10,Se)):K("",!0),R(k,{type:e(p)===e(m).KARAMELCHAT?"karamelStreamer":"primary",class:"font-bold",size:"xl",disabled:_.value||!v.value,onClick:Q},{default:ue(()=>[pe(A(_.value?`${e(i)(e(c).uploading_info_text)} ${G.value}%`:e(i)(e(c).continue)),1)]),_:1},8,["type","disabled"]),e(S)?(h(),P(U,{key:1,"support-conversation-id":t.supportConversationId,disabled:_.value},null,8,["support-conversation-id","disabled"])):K("",!0)])],2)])}}});export{Ne as default};
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.