1import{m as p,aW as Q,df as X,dg as B,dh as W,di as $,dj as Y,dk as j,dl as H,dm as J,dn as Z,bX as N,dp as ee}from"./CelG4gE-.js";const F=()=>{const s=new Date;return s.setMilliseconds(0),s.setSeconds(0),s.toISOString()};var T={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetProductListsOverview"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"query"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ProductListsQueryInput"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"pagination"}},type:{kind:"NamedType",name:{kind:"Name",value:"PaginationInput"}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"productLists"},arguments:[{kind:"Argument",name:{kind:"Name",value:"query"},value:{kind:"Variable",name:{kind:"Name",value:"query"}}},{kind:"Argument",name:{kind:"Name",value:"pagination"},value:{kind:"Variable",name:{kind:"Name",value:"pagination"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"items"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thumbnail"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"image"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"title"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"type"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"webUrl"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"productsCount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"description"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"followersCount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"author"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"image"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]}]}}]}}]}}]}}],loc:{start:0,end:370}};T.loc.source={body:`query GetProductListsOverview($query: ProductListsQueryInput!, $pagination: PaginationInput) { 2 productLists(query: $query, pagination: $pagination) { 3 items { 4 thumbnail { 5 image 6 } 7 id 8 title 9 type 10 webUrl 11 productsCount 12 description 13 followersCount 14 author { 15 image 16 name 17 } 18 } 19 } 20} 21`,name:"GraphQL request",locationOffset:{line:1,column:1}};function I(s,u){if(s.kind==="FragmentSpread")u.add(s.name.value);else if(s.kind==="VariableDefinition"){var d=s.type;d.kind==="NamedType"&&u.add(d.name.value)}s.selectionSet&&s.selectionSet.selections.forEach(function(l){I(l,u)}),s.variableDefinitions&&s.variableDefinitions.forEach(function(l){I(l,u)}),s.definitions&&s.definitions.forEach(function(l){I(l,u)})}var A={};(function(){T.definitions.forEach(function(u){if(u.name){var d=new Set;I(u,d),A[u.name.value]=d}})})();function _(s,u){for(var d=0;d<s.definitions.length;d++){var l=s.definitions[d];if(l.name&&l.name.value==u)return l}}function te(s,u){var d={kind:s.kind,definitions:[_(s,u)]};s.hasOwnProperty("loc")&&(d.loc=s.loc);var l=A[u]||new Set,g=new Set,L=new Set;for(l.forEach(function(v){L.add(v)});L.size>0;){var w=L;L=new Set,w.forEach(function(v){if(!g.has(v)){g.add(v);var k=A[v]||new Set;k.forEach(function(M){L.add(M)})}})}return g.forEach(function(v){var k=_(s,v);k&&d.definitions.push(k)}),d}te(T,"GetProductListsOverview");const P=25;function ne(){const d={offset:0,limit:P},l=(e,t)=>{const i=t.fetchMoreResult;if(!i)return e;const o=i.customerLists.items.filter(a=>!e.customerLists.items.some(n=>n.id===a.id));return{customerLists:{...e.customerLists,items:[...e.customerLists.items,...o]},favouriteLists:e.favouriteLists,followingLists:e.followingLists}},g=(e,t)=>{const i=t.fetchMoreResult?.followingLists?.items??[];return i.length?{followingLists:{...e.followingLists,items:[...e.followingLists.items,...i]}}:e},L=e=>async t=>await e({query:ee,variables:{listPagination:{offset:t,limit:P},listItemsPagination:{offset:0,limit:4},referenceDate:F()},updateQuery:g}),w=e=>async t=>await e({query:$,variables:{listPagination:{offset:t,limit:P}},updateQuery:l}),v=(e=d)=>{const{error:t,load:i,loading:r,result:o,refetch:m,onError:a,fetchMore:n}=Z(),c=()=>i(void 0,{listItemPagination:{offset:0,limit:4},listPagination:e},{fetchPolicy:"network-only"});return{result:o,error:t,loading:r,fetchMore:w(n),load:c,refetch:m}},k=()=>{const{error:e,load:t,loading:i,result:r,fetchMore:o,onError:m}=J(),a=p(!1),n=c=>(a.value=!0,t(void 0,{listPagination:c,listItemsPagination:{limit:4,offset:0},referenceDate:F()},{fetchPolicy:"network-only"}));return{error:e,result:r,loading:i,fetchMore:L(o),load:n,called:a}},M=()=>{const{error:e,load:t,result:i,loading:r,fetchMore:o}=W();return{error:e,result:i,loading:r,fetchMore:o,load:({ids:a,type:n,listPagination:c,listItemsPagination:h,listContainsSKU:y})=>t(void 0,{query:{listIds:a,type:n,containingSKU:y},listPagination:c,listItemsPagination:h,referenceDate:F()},{fetchPolicy:"network-only"})}},b=()=>{const{error:e,load:t,refetch:i,loading:r,result:o,fetchMore:m,onResult:a,onError:n}=Y();return{error:e,result:o,loading:r,load:(f,S)=>t(void 0,{input:{searchType:N.KEYWORD,searchTerms:f,skuFilter:S,offSet:0,limit:P}},{fetchPolicy:"network-only"}),refetch:(f,S)=>i({input:{searchType:N.KEYWORD,searchTerms:f,skuFilter:S,offSet:0,limit:P}}),fetchMore:async(f,S,x)=>await m({variables:{input:{searchType:N.KEYWORD,searchTerms:S,skuFilter:x,offSet:f,limit:P}},updateQuery(V,z){const K=z.fetchMoreResult;return C(V,K)}}),onResult:a,onError:n}},G=()=>{const{error:e,load:t,loading:i,onResult:r,onError:o,refetch:m}=j(),a=p(null),n=c=>t(void 0,{productListV2Id:c},{fetchPolicy:"network-only"});return r(c=>{a.value=c.data?.productListV2?.skus??null}),{error:e,result:a,loading:i,load:n,refetch:m,onResult:r,onError:o}}
21,O=()=>{const{error:e,load:t,result:i,loading:r,fetchMore:o,refetch:m,onResult:a,onError:n}=H();return{error:e,result:i,loading:r,load:(h,y,f)=>t(void 0,{listId:h,sort:y,listItemsPagination:f,referenceDate:F(),includeAuthor:!0},{fetchPolicy:"network-only"}),fetchMore:o,refetch:m,onResult:a,onError:n}},D=p(!0),E=p({favouriteLists:{items:[]},customerLists:{items:[],total:0}}),q=()=>{const{error:e,load:t,loading:i,onResult:r,fetchMore:o}=B(),m=(n,c)=>o({variables:{containingSKU:c,listPagination:n,fetchFavoriteLists:!1}}),a=(n,c)=>t(void 0,{containingSKU:c,listPagination:n,fetchFavoriteLists:!0},{fetchPolicy:"network-only"});return r(n=>{if(!n.data?.customerLists?.items){D.value=!1;return}E.value={favouriteLists:n.data?.favouriteLists,customerLists:{...n.data?.customerLists,items:[...E.value.customerLists.items,...n.data.customerLists.items].filter((c,h,y)=>y.findIndex(f=>f.id===c.id)===h)}},D.value=E.value.customerLists.items.length<(n.data?.customerLists?.total??0)}),{error:e,result:E,loading:i,fetchMore:m,hasMore:D,load:a}},R=async(e,t,i=d,r=Q.CUSTOMER)=>{const o=p(null);try{const{data:m,error:a}=await X(T,{key:e,variables:{query:{listIds:t,type:r},pagination:i}});if(a?.value)throw a.value;const n=m.value?.productLists;n&&(o.value=n.items)}catch{o.value=null}return{result:o}},U=(e,t)=>{const i="productListV2";return t?{[i]:{...e[i],items:[...e[i].items,...t[i].items]}}:e},C=(e,t)=>t?{searchProducts:{...e.searchProducts,products:[...e.searchProducts.products,...t.searchProducts.products]}}:e;return{getCustomerProductLists:v,getFollowingProductLists:k,getProductList:O,getProductListSkus:G,getSearchedProductList:b,fetchMoreCustomerProductLists:w,getProductLists:M,getProductListsAddSkuToList:q,getProductListsOverviewAsync:R,updateQueryCustomerProductLists:l,mergeFetchMoreProductLists:U,mergePaginatedFollowingLists:g}}export{P as D,F as g,ne as u};
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.