PageSourceSearch

https://www.recustom.com/_next/static/chunks/7453-fde369ea9b698e69.js

js recustom.com collected 2026-10-09 04:57:42 UTC 42,977 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7453],{67337:(e,i,n)=>{n.d(i,{A:()=>t,g:()=>l});var a=n(95155);n(12115);let l=e=>(0,a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",...e,children:(0,a.jsx)("path",{d:"M15 18L9 12L15 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),t=l},77453:(e,i,n)=>{let a,l;n.r(i),n.d(i,{AddToBook:()=>eh,default:()=>eg});var t=n(95155),d=n(12115),o=n(98967),r=n.n(o),k=n(70361),m=n.n(k),s=n(38032),u=n(78556),c=n(2778),v=n(65036),p=n(25635),b=n(81318),N=n(73450),f=n(2188),h=n(17791),g=n(2416);let x={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ClipByID"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"skipCollaborationProfile"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}}},defaultValue:{kind:"BooleanValue",value:!1}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clip"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"id"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"_eq"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}]}}]}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"IntValue",value:"1"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ClipMetaFields"}},{kind:"FragmentSpread",name:{kind:"Name",value:"ClipTopicTagsForClipFields"}},{kind:"FragmentSpread",name:{kind:"Name",value:"ClipContributorFields"}},{kind:"FragmentSpread",name:{kind:"Name",value:"ClipCollaborationContributorFields"},directives:[{kind:"Directive",name:{kind:"Name",value:"skip"},arguments:[{kind:"Argument",name:{kind:"Name",value:"if"},value:{kind:"Variable",name:{kind:"Name",value:"skipCollaborationProfile"}}}]}]},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"type"}},{kind:"Field",name:{kind:"Name",value:"content"}},{kind:"Field",name:{kind:"Name",value:"contributor"}},{kind:"Field",name:{kind:"Name",value:"source"}},{kind:"Field",name:{kind:"Name",value:"clip_media"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"height"}},{kind:"Field",name:{kind:"Name",value:"source"}},{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"type"}}]}},{kind:"Field",name:{kind:"Name",value:"bookmark_clips"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"DefaultTopicTagFields"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"topic_tag"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"label"}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ContributorUserFields"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"contributor_profile"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"profile_photo"}},{kind:"Field",name:{kind:"Name",value:"profile_name"}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ClipMetaFields"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"clip"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"slug"}},{kind:"Field",name:{kind:"Name",value:"legacyId"}},{kind:"Field",name:{kind:"Name",value:"createdAt"}},{kind:"Field",name:{kind:"Name",value:"updatedAt"}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ClipTopicTagsForClipFields"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"clip"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clip_topic_tag_proxies"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"topicTagId"}},{kind:"Field",name:{kind:"Name",value:"topic_tag"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"DefaultTopicTagFields"}}]}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ClipContributorFields"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"clip"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"contributor_profile"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ContributorUserFields"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ClipCollaborationContributorFields"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"clip"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"collaboration_contributor_profile"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"profile_name"}},{kind:"Field",name:{kind:"Name",value:"profile_photo"}}]}}]}}]},F={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"AddToBookUserBooks"}
1,variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"userId"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"uuid"}}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"publishStatus"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"publish_status_enum"}}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"search"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"skipCollaborationProfile"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}}},defaultValue:{kind:"BooleanValue",value:!1}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"book"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"publishStatus"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"_in"},value:{kind:"Variable",name:{kind:"Name",value:"publishStatus"}}}]}},{kind:"ObjectField",name:{kind:"Name",value:"is_pdf"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"_eq"},value:{kind:"BooleanValue",value:!1}}]}},{kind:"ObjectField",name:{kind:"Name",value:"_or"},value:{kind:"ListValue",values:[{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"contributor"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"_in"},value:{kind:"Variable",name:{kind:"Name",value:"userId"}}}]}}]},{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"book_collaborators"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"collaborator_id"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"_in"},value:{kind:"Variable",name:{kind:"Name",value:"userId"}}}]}}]}}]}]}},{kind:"ObjectField",name:{kind:"Name",value:"title"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"_ilike"},value:{kind:"Variable",name:{kind:"Name",value:"search"}}}]}}]}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"updatedAt"},value:{kind:"EnumValue",value:"desc"}}]}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}},{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"BookMetaFields"}},{kind:"FragmentSpread",name:{kind:"Name",value:"BookContributorFields"}},{kind:"FragmentSpread",name:{kind:"Name",value:"BookCollaborationContributorFields"},directives:[{kind:"Directive",name:{kind:"Name",value:"skip"},arguments:[{kind:"Argument",name:{kind:"Name",value:"if"},value:{kind:"Variable",name:{kind:"Name",value:"skipCollaborationProfile"}}}]}]},{kind:"FragmentSpread",name:{kind:"Name",value:"BookTopicTagsForBookFields"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"coverImageUrl"}},{kind:"Field",name:{kind:"Name",value:"book_sections"},arguments:[{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"order"},value:{kind:"EnumValue",value:"asc"}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"title"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"book_aggregate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"publishStatus"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"_in"},value:{kind:"Variable",name:{kind:"Name",value:"publishStatus"}}}]}},{kind:"ObjectField",name:{kind:"Name",value:"is_pdf"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"_eq"},value:{kind:"BooleanValue",value:!1}}]}},{kind:"ObjectField",name:{kind:"Name",value:"_or"}
1,value:{kind:"ListValue",values:[{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"contributor"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"_in"},value:{kind:"Variable",name:{kind:"Name",value:"userId"}}}]}}]},{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"book_collaborators"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"collaborator_id"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"_in"},value:{kind:"Variable",name:{kind:"Name",value:"userId"}}}]}}]}}]}]}},{kind:"ObjectField",name:{kind:"Name",value:"title"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"_ilike"},value:{kind:"Variable",name:{kind:"Name",value:"search"}}}]}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"aggregate"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"count"}}]}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ContributorUserFields"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"contributor_profile"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"profile_photo"}},{kind:"Field",name:{kind:"Name",value:"profile_name"}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"DefaultTopicTagFields"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"topic_tag"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"label"}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"BookMetaFields"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"book"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"slug"}},{kind:"Field",name:{kind:"Name",value:"is_pdf"}},{kind:"Field",name:{kind:"Name",value:"legacyId"}},{kind:"Field",name:{kind:"Name",value:"createdAt"}},{kind:"Field",name:{kind:"Name",value:"updatedAt"}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"BookContributorFields"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"book"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"contributor_profile"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ContributorUserFields"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"BookCollaborationContributorFields"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"book"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"collaboration_contributor_profile"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"profile_name"}},{kind:"Field",name:{kind:"Name",value:"profile_photo"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"BookTopicTagsForBookFields"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"book"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"book_topic_tag_proxies"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"topicTagId"}},{kind:"Field",name:{kind:"Name",value:"topic_tag"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"DefaultTopicTagFields"}}]}}]}}]}}]},S={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"AddToBookCollaboratorBooks"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"userId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"uuid"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}}
1,{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"publishStatus"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"publish_status_enum"}}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"search"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"skipCollaborationProfile"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}}},defaultValue:{kind:"BooleanValue",value:!1}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"book"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"book_collaborators"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"collaborator_id"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"_eq"},value:{kind:"Variable",name:{kind:"Name",value:"userId"}}}]}}]}},{kind:"ObjectField",name:{kind:"Name",value:"publishStatus"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"_in"},value:{kind:"Variable",name:{kind:"Name",value:"publishStatus"}}}]}},{kind:"ObjectField",name:{kind:"Name",value:"is_pdf"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"_eq"},value:{kind:"BooleanValue",value:!1}}]}},{kind:"ObjectField",name:{kind:"Name",value:"title"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"_ilike"},value:{kind:"Variable",name:{kind:"Name",value:"search"}}}]}}]}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"updatedAt"},value:{kind:"EnumValue",value:"desc"}}]}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}},{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"BookMetaFields"}},{kind:"FragmentSpread",name:{kind:"Name",value:"BookContributorFields"}},{kind:"FragmentSpread",name:{kind:"Name",value:"BookCollaborationContributorFields"},directives:[{kind:"Directive",name:{kind:"Name",value:"skip"},arguments:[{kind:"Argument",name:{kind:"Name",value:"if"},value:{kind:"Variable",name:{kind:"Name",value:"skipCollaborationProfile"}}}]}]},{kind:"FragmentSpread",name:{kind:"Name",value:"BookTopicTagsForBookFields"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"coverImageUrl"}},{kind:"Field",name:{kind:"Name",value:"book_sections"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"title"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"book_aggregate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"book_collaborators"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"collaborator_id"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"_eq"},value:{kind:"Variable",name:{kind:"Name",value:"userId"}}}]}}]}},{kind:"ObjectField",name:{kind:"Name",value:"publishStatus"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"_in"},value:{kind:"Variable",name:{kind:"Name",value:"publishStatus"}}}]}},{kind:"ObjectField",name:{kind:"Name",value:"is_pdf"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"_eq"},value:{kind:"BooleanValue",value:!1}}]}},{kind:"ObjectField",name:{kind:"Name",value:"title"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"_ilike"},value:{kind:"Variable",name:{kind:"Name",value:"search"}}}]}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"aggregate"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"count"}}]}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ContributorUserFields"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"contributor_profile"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"profile_photo"}},{kind:"Field",name:{kind:"Name",value:"profile_name"}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"DefaultTopicTagFields"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"topic_tag"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"label"}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"BookMetaFields"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"book"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"slug"}},{kind:"Field",name:{kind:"Name",value:"is_pdf"}},{kind:"Field",name:{kind:"Name",value:"legacyId"}},{kind:"Field",name:{kind:"Name",value:"createdAt"}},{kind:"Field",name:{kind:"Name",value:"updatedAt"}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"BookContributorFields"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"book"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"contributor_profile"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ContributorUserFields"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"BookCollaborationContributorFields"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"book"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"collaboration_contributor_profile"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"profile_name"}},{kind:"Field",name:{kind:"Name",value:"profile_photo"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"BookTopicTagsForBookFields"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"book"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"book_topic_tag_proxies"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"topicTagId"}},{kind:"Field",name:{kind:"Name",value:"topic_tag"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"DefaultTopicTagFields"}}]}}]}}]}}]},y={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"InsertBookSectionClipProxy"}
1,variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"bookSectionId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"order"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"clip"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"clip_insert_input"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"insert_book_section_clip_proxy_one"},arguments:[{kind:"Argument",name:{kind:"Name",value:"object"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"bookSectionId"},value:{kind:"Variable",name:{kind:"Name",value:"bookSectionId"}}},{kind:"ObjectField",name:{kind:"Name",value:"order"},value:{kind:"Variable",name:{kind:"Name",value:"order"}}},{kind:"ObjectField",name:{kind:"Name",value:"clip"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"clip"}}}]}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"order"}},{kind:"Field",name:{kind:"Name",value:"clipId"}},{kind:"Field",name:{kind:"Name",value:"bookSectionId"}}]}}]}}]},j={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"InsertBookSectionWithClip"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"section"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"book_section_insert_input"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"insert_book_section_one"},arguments:[{kind:"Argument",name:{kind:"Name",value:"object"},value:{kind:"Variable",name:{kind:"Name",value:"section"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"book"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"slug"}}]}},{kind:"Field",name:{kind:"Name",value:"book_section_clip_proxies"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"clipId"}}]}}]}}]}}]},_={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"InsertBookWithSection"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"book"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"book_insert_input"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"insert_book_one"},arguments:[{kind:"Argument",name:{kind:"Name",value:"object"},value:{kind:"Variable",name:{kind:"Name",value:"book"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"slug"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"book_sections"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"book_section_clip_proxies"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"clipId"}}]}}]}}]}}]}}]};var C=n(12945),V=n(53743),w=n(28304),A=n(64413),T=n(93411),O=n(77043),D=n(54224),I=n(42209),B=n(51505),P=n(15239),W=n(74551),E=n(65380),z=n(42640),M=n(67337),U=n(42248),q=n(2821);n(74062),n(1878);let H=(0,d.memo)(e=>{let{tags:i,className:n}=e,[a,l]=(0,d.useState)(!1),[o,r]=(0,d.useState)(!1),k=(0,d.useRef)(null),m=(0,d.useRef)(null),s=(0,d.useRef)(null),u=(0,z.A)(),c=(0,d.useCallback)(()=>{k.current&&(l(!k.current.isBeginning),r(!k.current.isEnd))},[]),v=(0,d.useCallback)(e=>{k.current=e,c()},[c]),p=(0,d.useCallback)(()=>{c()},[c]),b=(0,d.useCallback)(e=>{e.stopPropagation()},[]),N=(0,d.useCallback)(e=>i=>{i.stopPropagation(),u({id:e.id,label:e.label,href:"/tag/".concat(encodeURIComponent(e.label))})()},[u]);return 0===i.length?null:(0,t.jsx)("div",{onClick:b,onTouchStart:b,className:(0,q.A)(n),children:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("div",{className:"overflow-hidden",children:(0,t.jsx)(W.RC,{modules:[E.Vx],slidesPerView:"auto",spaceBetween:6,navigation:{prevEl:m.current,nextEl:s.current},style:{height:"32px",lineHeight:"32px"},observer:!0,watchOverflow:!0,onSwiper:v,onSlideChange:p,children:i.map(e=>(0,t.jsx)(W.qr,{style:{width:"fit-content"},children:(0,t.jsx)("span",{className:"px-2.5 py-1 rounded-full bg-white border border-gray-500 text-[16px] font-medium text-gray-700 truncate cursor-pointer",onClick:N(e),children:e.label})},e.id))})}),(0,t.jsx)("button",{ref:m,className:(0,q.A)({"absolute left-0 top-1/2 -translate-y-1/2 z-1 py-1 bg-white rounded-r-full":!0,"opacity-100 shadow-sm":a,"opacity-0 pointer-events-none":!a}),children:(0,t.jsx)(M.g,{className:"w-6 h-6 text-gray-500 cursor-pointer"})}),(0,t.jsx)("button",{ref:s,className:(0,q.A)({"absolute right-0 top-1/2 -translate-y-1/2 z-1 py-1 bg-white rounded-l-full hover:shadow-sm":!0,"opacity-100":o,"opacity-0 pointer-events-none":!o,"shadow-sm":a}),children:(0,t.jsx)(U.V,{className:"w-6 h-6 text-gray-500 cursor-pointer"})})]})})});H.displayName="TagCarousel";let R=[g.FKE.Draft,g.FKE.Private,g.FKE.Public],L="clip_add_to_book";var Q=n(81778);let K=e=>{let{book:i,onClick:n}=e,a=i.coverImageUrl||"/book_empty_cover.png",l=(0,Q.F)(i),o=null==l?void 0:l.profile_name,r=(0,d.useMemo)(()=>{var e;return(null!=(e=i.book_topic_tag_proxies)?e:[]).map(e=>e.topic_tag)},[i.book_topic_tag_proxies]);return(0,t.jsxs)("div",{className:"relative flex flex-col rounded-md overflow-hidden bg-white cursor-pointer transition-border",style:{width:290,height:460,flexShrink:0},onClick:n,role:"button",tabIndex:0,children:[(0,t.jsx)("div",{className:"aspect-square w-full overflow-hidden",children:(0,t.jsx)(P.default,{src:a,alt:i.title,width:300,height:300,draggable:!1,
1className:"w-full h-full object-cover rounded-md"})}),(0,t.jsxs)("div",{className:"flex pt-4 flex-col justify-between",style:{height:170},children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-[1.5rem] leading-8 font-semibold text-gray-900 line-clamp-2",children:i.title}),o&&(0,t.jsxs)("p",{className:"mt-2 text-base leading-6 font-medium text-gray-700",children:["by ",o]})]}),(0,t.jsx)(H,{tags:r})]})]})};var X=n(35025),Y=n(35086),G=n(91871),J=n(35217),Z=n(43750);let $=e=>{let{onAddClipToNewBook:i,isSaving:n}=e,a=(0,Z.M)();return(0,t.jsxs)(I.A,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:432,width:"100%"},children:[(0,t.jsx)(p.A,{variant:"h4",fontWeight:600,fontSize:"1.125rem",lineHeight:"1.75rem",color:"#101828",textAlign:"center",sx:{mb:2},children:"You don't have any ".concat(a("books")," yet.")}),(0,t.jsx)(p.A,{variant:"body2",fontSize:"0.875rem",lineHeight:"1.25rem",color:"#475467",textAlign:"center",sx:{mb:4},children:"We'll create a new ".concat(a("book")," for you and add the clip to it.")}),(0,t.jsxs)(G.A,{variant:"contained",color:"secondary",disabled:n,onClick:i,children:["Add clip to a new ".concat(a("book")),n&&(0,t.jsx)(J.A,{size:24,color:"inherit",sx:{ml:2}})]})]})};var ee=n(31729);let ei=()=>{let e=(0,ee.T)(3);return(0,t.jsxs)("div",{className:"relative flex flex-col rounded-md overflow-hidden bg-white",style:{width:290,height:460,flexShrink:0},children:[(0,t.jsx)("div",{className:"aspect-square w-full overflow-hidden",children:(0,t.jsx)("div",{className:"w-full h-full bg-gray-200 animate-pulse"})}),(0,t.jsxs)("div",{className:"flex pt-4 flex-col justify-between",style:{height:170},children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"text-[1.5rem] leading-8 font-semibold line-clamp-2",children:[(0,t.jsx)("div",{className:"h-8 bg-gray-200 animate-pulse rounded"}),(0,t.jsx)("div",{className:"h-8 bg-gray-200 animate-pulse rounded"})]}),(0,t.jsx)("div",{className:"mt-2 text-base leading-6 font-medium w-24",children:(0,t.jsx)("div",{className:"h-6 bg-gray-200 animate-pulse rounded"})})]}),(0,t.jsxs)("div",{className:"flex justify-between items-center w-full",children:[(0,t.jsx)("div",{className:"inline-flex gap-1.5 text-nowrap overflow-hidden",children:e.map(e=>(0,t.jsx)("span",{className:"w-22 h-8.5 rounded-full bg-gray-200 animate-pulse"},e))}),(0,t.jsx)(U.V,{className:"w-6 h-6 text-gray-500"})]})]})]})},en=()=>{let e=(0,ee.T)(12);return(0,t.jsx)(I.A,{sx:{display:"grid",gridTemplateColumns:{xs:"repeat(1, 290px)",sm:"repeat(2, 290px)",md:"repeat(3, 290px)",lg:"repeat(4, 290px)"},justifyContent:"start",gap:"24px",width:"fit-content",mx:"auto"},children:e.map(e=>(0,t.jsx)(ei,{},e))})},ea=e=>{let{searchQuery:i,onSearch:n,slots:a}=e,[l,o]=(0,d.useState)("");(0,d.useEffect)(()=>{o(i||"")},[i]);let r=(0,d.useCallback)(e=>{let i=e.target.value;(0,d.startTransition)(()=>{o(i)})},[]),k=(0,d.useCallback)(()=>{n(l||"")},[n,l]);return(0,t.jsxs)(I.A,{display:"flex",flexDirection:"column",position:"relative",children:[(0,t.jsxs)(B.A,{spacing:2,pb:4,sx:e=>({position:"sticky",top:0,left:0,right:0,zIndex:10,mb:"3px",mx:"-20px",px:"20px",bgcolor:e.palette.common.white}),children:[(0,t.jsx)(p.A,{variant:"body1",fontSize:"1.25rem",lineHeight:"1.875rem",fontWeight:500,color:"text.secondary",children:"Please select the book you want to add this clip to."}),(0,t.jsxs)(I.A,{display:"flex",alignItems:"center",justifyContent:"space-between",flexDirection:{xs:"column",sm:"row",md:"row"},gap:{xs:"20px",md:0},children:[(0,t.jsx)(X.v,{fullWidth:!1,placeholder:"Search by title, keyword, or tag",value:l,onChange:r,onSearch:k,formControlProps:{sx:{width:"100%",maxWidth:400}},InputProps:{autoFocus:!1,autoComplete:"off","aria-label":"Search by title, keyword, or tag"}}),a.Button]})]}),(0,t.jsx)(en,{})]})},el=e=>{let{books:i,onSelect:n,totalCount:a,searchQuery:l,onSearch:o,slots:r}=e,[k,m]=(0,d.useState)("");(0,d.useEffect)(()=>{m(l||"")},[l]);let{itemsInView:s}=(0,h.H)(L,4,L),u=(0,d.useMemo)(()=>{if(!l||!l.trim())return i;let e=l.trim().toLowerCase();return i.filter(i=>i.title.toLowerCase().includes(e))},[i,l]),c=(0,d.useCallback)(e=>{let i=e.target.value;(0,d.startTransition)(()=>{m(i)})},[]),v=(0,d.useCallback)(()=>{o&&o(k)},[o,k]);return(0,t.jsxs)(I.A,{display:"flex",flexDirection:"column",position:"relative",children:[(0,t.jsxs)(B.A,{spacing:2,pb:4,sx:e=>({position:"sticky",top:0,left:0,right:0,zIndex:10,mb:"3px",mx:"-20px",px:"20px",bgcolor:e.palette.common.white}),children:[(0,t.jsx)(p.A,{variant:"body1",fontSize:"1.25rem",lineHeight:"1.875rem",fontWeight:500,color:"text.secondary",children:"Please select the book you want to add this clip to."}),(0,t.jsxs)(I.A,{display:"flex",alignItems:"center",justifyContent:"space-between",flexDirection:{xs:"column",sm:"row",md:"row"},gap:{xs:"20px",md:0},children:[(0,t.jsx)(X.v,{fullWidth:!1,placeholder:"Search by title, keyword, or tag",value:k,onChange:c,onSearch:v,formControlProps:{sx:{width:"100%",maxWidth:400}},InputProps:{autoFocus:!1,autoComplete:"off","aria-label":"Search by title, keyword, or tag",sx:{height:"50px !important",borderRadius:"9999px !important","&.MuiInputBase-root":{padding:"16px 12px"}}}}),r.Button]})]}),(0,t.jsx)(I.A,{sx:{display:"grid",gridTemplateColumns:{xs:"repeat(1, 290px)",sm:"repeat(2, 290px)",md:"repeat(3, 290px)",lg:"repeat(4, 290px)"}
1,justifyContent:"start",gap:"24px",width:"fit-content",mx:"auto"},children:u.map(e=>(0,t.jsx)(K,{book:e,onClick:n(e)},e.id))}),(0,t.jsx)(Y.d,{totalCount:a,prefix:L,rowsPerPageRef:L,itemsPerRow:4,hide:a<=s})]})};var et=n(45932),ed=n(52641),eo=n(55606),er=n(86973),ek=n(78102),em=n(65879),es=n(34071);let eu=[],ec=e=>{let{open:i,book:n,onClose:a,onAddClip:l,isSaving:o}=e,r=(null==n?void 0:n.book_sections)||eu,k=r.length>0,m=1===r.length,[s,u]=(0,d.useState)(null);(0,d.useEffect)(()=>{i&&(k?u(r[0].id):u(-1))},[i,k]);let b=(0,d.useCallback)(e=>{u(e.target.value)},[]),N=(0,d.useCallback)(()=>{null!=s&&l(s)},[s,l]),f=(0,d.useMemo)(()=>{var e;return -1===s?"Untitled Section":(null==(e=r.find(e=>e.id===s))?void 0:e.title)||""},[s,r]),h=(0,d.useCallback)(e=>e.stopPropagation(),[]);return(0,t.jsxs)(c.A,{open:i,onClose:a,onClick:h,maxWidth:!1,sx:{".MuiPaper-root":{maxWidth:400}},children:[(0,t.jsx)(I.A,{sx:{pt:3,pb:1,px:3},children:(0,t.jsxs)(I.A,{sx:{display:"flex",justifyContent:"space-between",alignItems:"flex-start"},children:[(0,t.jsxs)(I.A,{children:[(0,t.jsx)(p.A,{variant:"body2",fontSize:"1rem",lineHeight:"1.5rem",color:"text.secondary",fontWeight:400,children:"Book selected:"}),(0,t.jsx)(et.A,{href:{route:"/books/[slug]",routeParams:{slug:(null==n?void 0:n.slug)||""}},target:"_blank",rel:"noopener noreferrer",children:(0,t.jsx)(p.A,{variant:"body1",fontSize:"1.25rem",lineHeight:"1.875rem",fontWeight:600,color:"primary.main",sx:{textDecoration:"none",mt:.5,display:"block"},children:null==n?void 0:n.title})})]}),(0,t.jsx)(es.K,{variant:"outlined",onClick:a,children:(0,t.jsx)(em.g,{width:24,height:24})})]})}),(0,t.jsxs)(v.A,{sx:{px:3,pt:3},children:[(0,t.jsxs)(I.A,{children:[(0,t.jsx)(p.A,{variant:"body2",fontWeight:500,fontSize:"1rem",lineHeight:"1.5rem",color:"text.secondary",sx:{mb:.75},children:"Select a section"}),(0,t.jsx)(ed.A,{fullWidth:!0,sx:{".MuiOutlinedInput-root":{py:"6px"}},children:(0,t.jsxs)(eo.A,{fullWidth:!0,disabled:m||!k,value:null!=s?s:-1,onChange:b,renderValue:()=>f,IconComponent:ek.A,children:[!k&&(0,t.jsx)(er.A,{value:-1,children:"Untitled Section"}),r.map(e=>(0,t.jsx)(er.A,{value:Number(e.id),children:e.title},e.id))]})}),(0,t.jsx)(p.A,{variant:"body2",fontSize:"1rem",lineHeight:"1.5rem",color:"text.paragraph",fontWeight:400,sx:{mt:1},children:"The clip will be added at the end of this section. You can move or edit the clip in the book editor."})]}),(0,t.jsxs)(I.A,{sx:{pt:4,pb:1.5,display:"flex",flexDirection:"column",gap:1.5},children:[(0,t.jsx)(G.A,{variant:"contained",color:"secondary",disabled:o,fullWidth:!0,onClick:N,children:"Add clip"}),(0,t.jsx)(G.A,{variant:"outlined",onClick:a,fullWidth:!0,sx:{borderColor:"var(--color-gray-modern-500)!important",color:"var(--color-gray-modern-500)!important",background:"var(--color-white)!important"},children:"Cancel"})]})]})]})};var ev=n(51198);let ep=e=>{let{book:i,open:n,onClose:a}=e;return(0,t.jsxs)(c.A,{open:n,onClose:a,maxWidth:!1,sx:{".MuiPaper-root":{maxWidth:400,width:"100%",borderRadius:"12px",boxShadow:"0 8px 8px -4px rgba(16,24,40,0.05), 0 20px 24px -4px rgba(16,24,40,0.03)"}},children:[(0,t.jsx)(es.K,{variant:"outlined",onClick:a,sx:{position:"absolute",top:16,right:16,zIndex:1},children:(0,t.jsx)(em.g,{width:24,height:24})}),(0,t.jsxs)(v.A,{sx:{p:0,display:"flex",flexDirection:"column"},children:[(0,t.jsxs)(I.A,{sx:{pt:3,px:3,display:"flex",flexDirection:"column"},children:[(0,t.jsx)(I.A,{sx:{width:48,height:48,borderRadius:"9999px",backgroundColor:"#d3f8df",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,t.jsx)(ev.A,{sx:{color:"#099250",fontSize:24}})}),(0,t.jsx)(p.A,{variant:"inherit",fontWeight:600,fontSize:"24px",lineHeight:"32px",color:"text.primary",sx:{mt:2,mb:.5},children:"Success!"}),(0,t.jsxs)(p.A,{variant:"inherit",fontSize:"18px",lineHeight:"28px",color:"text.paragraph",fontWeight:400,children:["This clip has been added to"," ",i?(0,t.jsx)(et.A,{isolated:!0,href:{route:"/books/[slug]",routeParams:{slug:i.slug}},target:"_blank",rel:"noopener noreferrer",style:{textDecoration:"none",color:"#005161"},children:(0,t.jsxs)(p.A,{component:"span",variant:"inherit",fontSize:"18px",lineHeight:"28px",fontWeight:600,sx:{color:"primary.main"},children:[i.title,"."]})}):(0,t.jsx)(p.A,{component:"span",variant:"inherit",fontSize:"18px",lineHeight:"28px",fontWeight:600,sx:{color:"primary.main"},children:"the book."})]})]}),i&&(0,t.jsxs)(I.A,{sx:{pt:4,pb:3,px:3,display:"flex",flexDirection:"column",gap:1.5},children:[(0,t.jsx)(et.A,{href:{route:"/account/my-books/[bookId]",routeParam
1s:{bookId:i.id}},target:"_blank",rel:"noopener noreferrer",isolated:!0,children:(0,t.jsx)(G.A,{fullWidth:!0,variant:"contained",color:"secondary",children:"Edit book"})}),(0,t.jsx)(et.A,{href:{route:"/books/[slug]",routeParams:{slug:i.slug}},target:"_blank",rel:"noopener noreferrer",isolated:!0,children:(0,t.jsx)(G.A,{variant:"outlined",fullWidth:!0,sx:{borderColor:"var(--color-gray-modern-500)!important",color:"var(--color-gray-modern-500)!important",background:"var(--color-white)!important"},children:"Preview book"})})]})]})]})};var eb=n(86144),eN=n.n(eb);let ef=[],eh=(a=(0,d.memo)(e=>{var i,n,a,l,o,k,I,B,P;let{clipId:W,open:E,setOpen:z,onClose:M}=e,U=(0,N.m)(),[q,H]=(0,d.useState)(null),[Q,K]=(0,d.useState)(!1),[X,Y]=(0,d.useState)(!1),[G,{setTrue:J,setFalse:ee}]=(0,b.C)(),[ei,en]=(0,d.useState)(""),{limit:et,offset:ed}=(0,h.H)(L,4),{pushParam:eo,removeParams:er}=(0,f.q)(),ek=(0,Z.M)(),[em]=(0,s.n)(y),[es]=(0,s.n)(_),[eu]=(0,s.n)(j),ev=ei.trim()?"%".concat(ei.trim(),"%"):"%",eb=(0,d.useMemo)(()=>[{query:C.S,variables:{userId:[U],publishStatus:R}},{query:V.NG,variables:{id:null==q?void 0:q.id}}],[U,q]),eh=(0,u.I)(x,{variables:{id:W},fetchPolicy:"network-only",nextFetchPolicy:"cache-first"}),{data:eg,loading:ex}=(0,u.I)(S,{variables:{userId:U,publishStatus:R,limit:et,offset:ed,search:ev},skip:!U}),eF=(0,u.I)(F,{variables:{userId:U?[U]:[],publishStatus:R,limit:et,offset:ed,search:ev},fetchPolicy:"network-only",nextFetchPolicy:"cache-first"}),eS=null==(i=eh.data)?void 0:i.clip[0],ey=(null==(n=eF.data)?void 0:n.book)||ef,ej=(null==eg?void 0:eg.book)||ef,e_=(null!=(B=null==(o=eF.data)||null==(l=o.book_aggregate)||null==(a=l.aggregate)?void 0:a.count)?B:0)+(null!=(P=null==eg||null==(I=eg.book_aggregate)||null==(k=I.aggregate)?void 0:k.count)?P:0),eC=(0,d.useMemo)(()=>{let e=new Set;return[ej,ey].flat().filter(i=>!e.has(i.id)&&(e.add(i.id),!0))},[ej,ey]),eV=(0,d.useCallback)(()=>z(!1),[z]),ew=(0,d.useCallback)(e=>()=>{(0,d.startTransition)(()=>{H(m()(e)),J()})},[H,J]),eA=(0,d.useCallback)(e=>{(0,d.startTransition)(()=>{en(e)}),eo((0,T.U)(L)+A.Q.Pagination.Page,"1")},[en,eo]),eT=(0,d.useMemo)(()=>eS?O.t.cloneAsNewClip({clip:eS,cloned:!0}):null,[eS]),eO=(0,d.useCallback)(async e=>{try{Y(!0),await e(),K(!0)}catch(e){D.v.error("Failed to add clip to book:",e)}finally{Y(!1)}},[]),eD=(0,d.useCallback)(async()=>{eT&&q&&await eO(async()=>{var e,i;let n=null==(i=(await eu({variables:{section:{bookId:q.id,title:"Untitled Section",type:g.RXm.Clips,order:((null==(e=q.book_sections)?void 0:e.length)||0)+1,book_section_clip_proxies:{data:[{order:1,clip:{data:eT}}]}}},refetchQueries:eb})).data)?void 0:i.insert_book_section_one;if(!n)throw Error("Failed to create Untitled Section with clip");H(n.book)})},[q,eT,eu,eb,eO]),eI=(0,d.useCallback)(async e=>{eT&&q&&await eO(async()=>{var i,n,a;let l=null==(i=q.book_sections)?void 0:i.find(i=>i.id===e);if(!l)throw Error("Section not found");let t=(l.book_section_clip_proxies||[]).length+1;if(!(null==(a=(await em({variables:{bookSectionId:e,order:t,clip:eT},refetchQueries:eb})).data)||null==(n=a.insert_book_section_clip_proxy_one)?void 0:n.id))throw Error("Failed to add clip proxy")})},[eT,em,eb,q,eO]),eB=(0,d.useCallback)(async e=>{q&&(ee(),-1===e?await eD():await eI(e))},[q,ee,eD,eI]),eP=(0,d.useCallback)(async()=>{eT&&U&&await eO(async()=>{var e;let i=null==(e=(await es({variables:{book:{title:"Untitled ".concat(eN()(ek("book"))),book_sections:{data:[{title:"Untitled Section",type:g.RXm.Clips,order:1,book_section_clip_proxies:{data:[{clip:{data:eT}}]}}]}}},refetchQueries:eb})).data)?void 0:e.insert_book_one;if(!i)throw Error("Failed to create new book with clip");H(i)})},[U,eT,es,eb,eO]),eW=(0,d.useCallback)(()=>{(0,d.startTransition)(()=>{H(null),K(!1),Y(!1),ee()})},[H,K,Y,ee]);(0,d.useEffect)(()=>{if(E)eo((0,T.U)(L)+A.Q.Pagination.Page,"1");else{Q||eW();let e=(0,T.U)(L);er([e+A.Q.Pagination.Page,e+A.Q.Pagination.RowsPerPage],{strategy:"replace"})}},[E,eo,eW,er,Q]);let eE=(0,d.useCallback)(e=>e.stopPropagation(),[]),ez=(0,d.useCallback)(()=>{K(!1),eV()},[K,eV]);(0,d.useEffect)(()=>{Q&&z(!1)},[Q,z]);let eM=ex||eh.loading||eF.loading,eU=r()(eC)&&!eM,eq=!r()(eC)&&!eM;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(c.A,{fullWidth:!0,open:E,onClose:M,onClick:eE,maxWidth:!1,sx:{".MuiPaper-root":{maxWidth:1280}},children:[(0,t.jsx)(w.A,{onClose:eV,sx:e=>({backgroundColor:e.palette.common.white}),children:(0,t.jsxs)(p.A,{component:"div",fontWeight:600,fontSize:"1.5rem",lineHeight:"2rem",children:["Add"," ",(0,t.jsx)(p.A,{component:"span",fontSize:"1.5rem",fontWeight:500,fontStyle:"italic",children:(null==eS?void 0:eS.title)||"clip"})," ","to a ".concat(ek("book"))]})}),(0,t.jsxs)(v.A,{sx:e=>({backgroundColor:e.palette.common.white}),children:[eM&&(0,t.jsx)(ea,{searchQuery:ei,onSearch:eA,slots:{Button:null}}),!eM&&eU&&(0,t.jsx)($,{onAddClipToNewBook:eP,isSaving:X}),!eM&&eq&&(0,t.jsx)(el,{books:eC,onSelect:ew,totalCount:e_,searchQuery:ei,onSearch:eA,slots:{Button:null,CardAddonEnd:null}})]}),(0,t.jsx)(ec,{open:G,book:q,onClose:ee,onAddClip:eB,isSaving:X})]}),(0,t.jsx)(ep,{book:q,open:Q,onClose:ez})]})}),l=e=>e.open,function(e){return(e=>{let[i,n]=(0,d.useState)(!1);return(0,d.useEffect)(()=>{e&&!i&&n(!0)},[e]),i})((0,d.useMemo)(()=>l(e),[e]))?(0,t.jsx)(a,{...e}):null}),eg=eh}}]);

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.