iBet uBet web content aggregator. Adding the entire web to your favor.
iBet uBet web content aggregator. Adding the entire web to your favor.



Link to original content: http://retty.me/_nuxt/IndexPage-BQ63B9jc.js
import{V as h,J as M,n as _,E as I}from"./client-BmVmnFEC.js";import{P as B}from"./PvLogger-Bfc8O67g.js";import{u as C}from"./graphqlErrorHandling-BE1XWHfd.js";import{m as R}from"./makeMyBestHead-DbSQjwBn.js";import{t as w}from"./type-util-BsvaEqwl.js";import{V as L,g as x}from"./makeGtmScript-B8HLg2s0.js";import"./constants-2oqeuneD.js";const $=h.extend({props:{pageEntity:{type:Object,required:!0}},computed:{user(){var n;return w((n=this.pageEntity.entity)==null?void 0:n.user)},userId(){return this.user.id.toString()},myBestLinkList(){var n,e;return((e=(n=this.user)==null?void 0:n.myBestReports)==null?void 0:e.map(i=>{var t,l,s;return{year:i.year,reportImage:((s=(l=(t=i.reports)==null?void 0:t[0])==null?void 0:l.images[0])==null?void 0:s.image.url)||"",linkUrl:`${M()}/${this.userId}/mybest/${i.year}/`}}))||[]},userName(){return this.user.name||"No Name"}}});var P=function(){var e=this,i=e._self._c;return e._self._setupProxy,i("div",{staticClass:"my-best-link-list"},[i("header",{staticClass:"page-title"},[i("h1",{staticClass:"page-title__text"},[e._v(e._s(e.userName)+"さんのMY BEST")])]),i("div",{staticClass:"my-best-link-list__content"},[e.myBestLinkList.length>0?i("ul",{staticClass:"my-best-list"},e._l(e.myBestLinkList,function(t){return i("li",{key:`my-best-link-${t.year}`,staticClass:"my-best-list__item"},[i("anchor-link",{staticClass:"my-best-link",attrs:{to:t.linkUrl}},[i("div",{staticClass:"my-best-link__item",style:`background-image: url('${t.reportImage}')`},[i("div",{staticClass:"my-best-link__text"},[e._v("MY BEST"),i("br"),e._v(e._s(t.year))])])])],1)}),0):i("p",{staticClass:"my-best-list-error"},[e._v("MY BEST投稿がありません")])])])},D=[],U=_($,P,D,!1,null,"4f60ca15");const V=U.exports;var v={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"MobileMyBestLinkList"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Query"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"entity"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"user"},arguments:[{kind:"Argument",name:{kind:"Name",value:"userId"},value:{kind:"Variable",name:{kind:"Name",value:"userId"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"myBestReports"},arguments:[{kind:"Argument",name:{kind:"Name",value:"filterByYear"},value:{kind:"Variable",name:{kind:"Name",value:"year"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"year"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"reports"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"images"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"image"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"},arguments:[],directives:[]}]}}]}}]}}]}}]}}]}}]}}],loc:{start:0,end:287}};v.loc.source={body:`fragment MobileMyBestLinkList on Query { entity { user(userId: $userId) { id name myBestReports(filterByYear: $year) { year reports { images { image { url } } } } } } } `,name:"GraphQL request",locationOffset:{line:1,column:1}};function m(n,e){if(n.kind==="FragmentSpread")e.add(n.name.value);else if(n.kind==="VariableDefinition"){var i=n.type;i.kind==="NamedType"&&e.add(i.name.value)}n.selectionSet&&n.selectionSet.selections.forEach(function(t){m(t,e)}),n.variableDefinitions&&n.variableDefinitions.forEach(function(t){m(t,e)}),n.definitions&&n.definitions.forEach(function(t){m(t,e)})}var k={};(function(){v.definitions.forEach(function(e){if(e.name){var i=new Set;m(e,i),k[e.name.value]=i}})})();function p(n,e){for(var i=0;i0;){var u=s;s=new Set,u.forEach(function(r){if(!l.has(r)){l.add(r);var a=k[r]||new Set;a.forEach(function(o){s.add(o)})}})}return l.forEach(function(r){var a=p(n,r);a&&i.definitions.push(a)}),i}Q(v,"MobileMyBestLinkList");var d={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"MobileMyBestIndexPageFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Query"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"entity"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"user"},arguments:[{kind:"Argument",name:{kind:"Name",value:"userId"},value:{kind:"Variable",name:{kind:"Name",value:"userId"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"url"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"currentUser"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"url"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"isRealName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"followingCount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"followerCount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"reportCount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"goneCount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"wannagoCount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"currentReservationCount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"topUserProfile"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"isPro"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"notifications"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"html"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"link"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"iconUrl"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]}]}}]}},{kind:"Field",name:{kind:"Name",value:"loginSession"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"session"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"userId"},arguments:[],directives:[]}]}}]}}]}}]}},{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"MobileMyBestIndexPage"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"userId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"UserId"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"year"}},type:{kind:"NamedType",name:{kind:"Name",value:"Uint32"}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"MobileMyBestIndexPageFragment"},directives:[]},{kind:"FragmentSpread",name:{kind:"Name",value:"MobileMyBestLinkList"},directives:[]}]}}],loc:{start:0,end:732}};d.loc.source={body:`#import "@/components/core/mobile/organisms/UserMyBest/MyBestLinkList.graphql" fragment MobileMyBestIndexPageFragment on Query { entity { user(userId: $userId) { id name url } currentUser { id url name isRealName followingCount followerCount reportCount goneCount wannagoCount currentReservationCount topUserProfile { isPro } notifications { html link iconUrl createdAt } } loginSession { session { userId } } } } query MobileMyBestIndexPage($userId: UserId!, $year: Uint32) { ...MobileMyBestIndexPageFragment ...MobileMyBestLinkList } `,name:"GraphQL request",locationOffset:{line:1,column:1}};var S={};function O(n){return n.filter(function(e){if(e.kind!=="FragmentDefinition")return!0;var i=e.name.value;return S[i]?!1:(S[i]=!0,!0)})}d.definitions=d.definitions.concat(O(v.definitions));function c(n,e){if(n.kind==="FragmentSpread")e.add(n.name.value);else if(n.kind==="VariableDefinition"){var i=n.type;i.kind==="NamedType"&&e.add(i.name.value)}n.selectionSet&&n.selectionSet.selections.forEach(function(t){c(t,e)}),n.variableDefinitions&&n.variableDefinitions.forEach(function(t){c(t,e)}),n.definitions&&n.definitions.forEach(function(t){c(t,e)})}var f={};(function(){d.definitions.forEach(function(e){if(e.name){var i=new Set;c(e,i),f[e.name.value]=i}})})();function N(n,e){for(var i=0;i0;){var u=s;s=new Set,u.forEach(function(r){if(!l.has(r)){l.add(r);var a=f[r]||new Set;a.forEach(function(o){s.add(o)})}})}return l.forEach(function(r){var a=N(n,r);a&&i.definitions.push(a)}),i}b(d,"MobileMyBestIndexPageFragment");b(d,"MobileMyBestIndexPage");const T=h.extend({components:{MyBestLinkList:V},mixins:[B,L],layout:"mobile/default",async asyncData({app:n,store:e,route:i,error:t,req:l,params:s}){var y;const u=await n.$urql.value.query(d,{userId:Number(s.userId),year:Number(s.year)}).toPromise(),{data:r,error:a}=u;if(a&&console.error(a),!r||a!=null&&a.networkError)return t({statusCode:500,message:I.ON_FAILED_CONNECT_API_SERVER}),null;const o=e.state.errors.errors;if(a!=null&&a.graphQLErrors||o.length>0){e.dispatch("errors/setGraphQLError",a==null?void 0:a.graphQLErrors);const E=C((a==null?void 0:a.graphQLErrors)||o);return t(E),null}if(!r.entity||!r.entity.user)return t({statusCode:404,message:"User not found"}),null;e.dispatch("session/setSessionUserWithReservation",r.entity.currentUser);const{userId:g}=i.params,F=((y=r.entity.user)==null?void 0:y.name)||"No Name";return e.dispatch("breadcrumbs/setBreadcrumbs",[{url:"https://retty.me/",text:"Rettyグルメ"},{url:"https://user.retty.me/",text:"ユーザーから探す"},{url:`https://user.retty.me/${g}/`,text:`${F}`},{url:`https://user.retty.me/${g}/mybest/`,text:"MY BEST"}]),{pageEntity:r}},data(){return{pageEntity:{}}},head(){var i,t,l,s;const{user:n}=((i=this.pageEntity)==null?void 0:i.entity)||{user:void 0};if(!n)return{};const e={userId:((s=(l=(t=this.pageEntity.entity)==null?void 0:t.loginSession)==null?void 0:l.session)==null?void 0:s.userId)||null,ruid:x(document.cookie,"_ruid")||null};return R({id:n.id,name:n.name,url:n.url},e)}});var q=function(){var e=this,i=e._self._c;return e._self._setupProxy,i("my-best-link-list",{attrs:{"page-entity":e.pageEntity}})},A=[],Y=_(T,q,A,!1,null,null);const X=Y.exports;export{X as default};