1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/GiftOwners-DT4zRq4R.js","assets/index-DcSVvNrM.js","assets/index-BDc4Q_5u.css","assets/GiftOwners-CS-j0_O_.css"])))=>i.map(i=>d[i]); 2import{d as K,j as Y,eA as Z,X as ee,R as ae,aj as te,ak as oe,y as ie,z as n,a as r,b as y,c as m,f as t,ce as se,S as ne,s as u,cG as re,e as I,w as p,b9 as le,G as de,aS as ce,p as k,t as f,ac as ue,dE as me,aQ as fe,m as h,au as pe,l as C,b4 as ve,r as he,v as c,eG as we,b2 as ge,aw as O,cJ as De,T as ye,eH as ke,eC as Ce,U as Pe}from"./index-DcSVvNrM.js";import{_ as be}from"./Scene.vue_vue_type_style_index_0_lang-Bp082L0t.js";import{u as Se}from"./useDebouncedUiToggle-2KTYyWEn.js";import{u as _e}from"./useGiftPurchase-lnrsge68.js";const Ae={class:"gift"},Te={class:"gift__description"},ze={key:0,class:"gift__code"},Ue=["innerHTML"],$e={class:"gift__actions"},Ie=K({__name:"Gift",props:{data:{},ownershipData:{},isAllowShare:{type:Boolean},isAllowCollectionNavigation:{type:Boolean},caption:{}},emits:["close","pin"],setup(i,{emit:G}){var U,$;const e=i,w=G,P=Y(),{t:s,p:g}=Z(),{open:M,close:N,modalHeaderRef:b}=ee(),{formatTime:x}=ae(),{user:l}=te(),{setPinnedCollectible:B}=oe(),{alert:F,AlertType:L}=ie(),{purchase:S,isLoadingPaymentOptions:_}=n((U=l.value)==null?void 0:U.id)?_e({giftCode:e.data.code,userId:l.value.id,context:{userId:l.value.id}}):{isLoadingPaymentOptions:he(!1)},{stateModel:V,toggleState:H}=Se(async a=>{var o,d;n((o=e.ownershipData)==null?void 0:o.id)&&(await B({type:"gift",id:(d=e.ownershipData)==null?void 0:d.id},a),w("pin",a),F({type:L.Success,text:s(a?"gifts.pinned":"gifts.unpinned")}))},{initialValue:(($=e.ownershipData)==null?void 0:$.isPinned)??!1,delay:300}),A=c(()=>e.data.counters.total-e.data.counters.current),D=c(()=>e.data.counters.current===0),R=c(()=>{var a;return e.ownershipData!==void 0&&"isPinned"in e.ownershipData&&e.ownershipData.userId===((a=l.value)==null?void 0:a.id)&&e.ownershipData.isPinned!==void 0}),E=c(()=>{var a,o,d;return!D.value&&n(e.ownershipData)&&n((a=l.value)==null?void 0:a.id)&&((o=e.ownershipData)==null?void 0:o.userId)!==((d=l.value)==null?void 0:d.id)}),T=c(()=>{var a;return n((a=e.ownershipData)==null?void 0:a.fromUser.id)?O({id:e.ownershipData.fromUser.id,nickname:e.ownershipData.fromUser.nickname}):void 0}),W=c(()=>n(e.data.description)?e.data.description:e.ownershipData?s("common.receivedFromOnDate",{from:T.value?`@${T.value}`:s("common.fromAnon"),date:x(e.ownershipData.dateGifted*1e3,ye.FullMonthWithTime)}):D.value?s("common.soldOut"):`${ke(g("common.leftPluralized",e.data.counters.current,{excludeNumber:!0}))} ${s("common.countOfTotal",{count:g("common.items",e.data.counters.current),total:Ce(e.data.counters.total)})}`),z=c(()=>De(W.value)),j=c(()=>{if(!n(e.ownershipData))return D.value?"var(--theme-color-signal-negative-default)":void 0});async function J(){const{default:a}=await we(async()=>{const{default:o}=await import("./GiftOwners-DT4zRq4R.js");return{default:o}},__vite__mapDeps([0,1,2,3]));M(a,{giftCode:e.data.code,onItemSelect:()=>{N()}},{title:s("gifts.owners"),height:o=>o})}function Q(){var a;!n(e.ownershipData)||!n((a=e.ownershipData)==null?void 0:a.shareImage)||ge(e.ownershipData.shareImage,"_blank")}function X(){P.push({name:"Collectibles",params:{nickname:O(l.value)}}),w("close")}function q(){var a;!n((a=l.value)==null?void 0:a.id)||typeof S!="function"||S()}return(a,o)=>{var d;return r(),y("div",Ae,[(r(),m(re,{to:t(b),disabled:!t(b)},[R.value?(r(),m(t(se),{key:0,class:ne(["gift__pin",t(V)&&"gift__pin--active"]),icon:"pin",onClick:o[0]||(o[0]=v=>t(H)())},null,8,["class"])):u("",!0)],8,["to","disabled"])),I(t(be),{"model-url":i.data.formats.glb,"model-size":256,"model-view-data":i.data.viewData,"model-caption":i.caption,"canvas-size":300},{default:p(()=>[I(t(le),de(t(ce)({uuid:i.data.previewUuid,color:"transparent",size:256}),{size:256}),null,16)]),_:1},8,["model-url","model-view-data","model-caption"]),k("div",Te,[k("h2",null,f(i.data.title),1),(d=i.ownershipData)!=null&&d.id?(r(),y("div",ze," #"+f(i.ownershipData.id),1)):u("",!0),z.value?ue((r(),y("div",{key:1,innerHTML:z.value,style:fe({color:j.value})},null,12,Ue)),[[t(me),[t(P),()=>{w("close")}]]]):u("",!0),!i.isAllowShare&&A.value>0?(r(),m(t(pe),{key:2,icon:"chevron_right",type:"minimal",onClick:o[1]||(o[1]=v=>J())},{default:p(()=>[h(f(t(g)("gifts.ownersPlural",A.value)),1)]),_:1})):u("",!0)]),k("div",$e,[i.ownershipData&&i.isAllowShare?(r(),m(t(C),{key:0,size:"l",onClick:o[2]||(o[2]=v=>Q())},{default:p(()=>[h(f(t(s)("common.share")),1)]),_:1})):u("",!0),i.isAllowCollectionNavigation?(r(),m(t(C),{key:1,size:"l",type:"minimal",onClick:o[3]||(o[3]=v=>X())},{default:p(()=>[h(f(t(s)("gifts.toMyCollection")),1)]),_:1})):u("",!0),!i.isAllowShare&&E.value?(r(),m(t(C),{key:2,size:"l",loading:t(_),disabled:t(_),onClick:o[4]||(o[4]=v=>q())},{default:p(()=>[h(f(t(s)("common.purchaseForSelf",{price:t(ve)(i.data.price)})),1)]),_:1},8,["loading","disabled"])):u("",!0)])])}}}),xe=Pe(Ie,[["__scopeId","data-v-587a1fa6"]]);export{xe 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.