1(globalThis.TURBOPACK=globalThis.TURBOPACK||[]).push(["object"==typeof document?document.currentScript:void 0,{166809:e=>{"use strict";e.s({DocumentIcon:()=>n},166809);var t=e.i(759171);let n=t.forwardRef(function(e,n){let{title:l,titleId:a,...i}=e;return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":a},i),l?t.createElement("title",{id:a},l):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"}))})},179942:e=>{"use strict";e.s({revalidateTagsHelper:()=>n});var t=e.i(722258),n=(0,t.createServerReference)("401c0132cc2b3046b1003870e53171c43100be222b",t.callServer,void 0,t.findSourceMapURL,"revalidateTagsHelper")},399905:e=>{"use strict";e.s({InformationCircleIcon:()=>n},399905);var t=e.i(759171);let n=t.forwardRef(function(e,n){let{title:l,titleId:a,...i}=e;return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":a},i),l?t.createElement("title",{id:a},l):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"}))})},218733:[e=>{"use strict";e.s({FilterItem:()=>a},218733);var t=e.i(187207);e.i(635118);var n=e.i(49429);e.i(8744);var l=e.i(179755);let a=e=>{let{name:a,selected:i,onClick:o,count:r}=e;return(0,t.jsxs)("div",{className:"flex w-full cursor-pointer items-center rounded-md p-2 hover:bg-bg-2",onClick:o,children:[(0,t.jsx)(l.Checkbox,{checked:i,onChange:e=>null}),(0,t.jsx)(n.Text,{className:"ml-2",maxLines:1,children:a}),void 0!==r?(0,t.jsx)(n.Text,{className:"ml-2",children:r}):(0,t.jsx)("div",{})]})};e.s({FilterWrapper:()=>g},363642);var i=e.i(685932),o=e.i(266797),r=e.i(563348),s=e.i(942751),s=s,c=e.i(111616),d=e.i(271340),u=e.i(566123),p=e.i(324976),m=e.i(484609),v=e.i(207796),x=e.i(759171),h=e.i(745305);let g=e=>{let{id:n,buttonText:l,onChangeSearch:a,onClickOverride:g,onRemoveAll:f,search:j,hasSearch:y=!0,children:b,filterActive:w,menuPosition:C="left",footerText:N="Done",withHeaderSpaceOnMobile:P=!0}=e,{currentOpenMenu:k,onToggleMenu:T,onCloseMenu:I}=(0,h.useFilters)(),A=(0,x.useRef)(null);(0,d.default)(n,()=>{k===n&&I()});let F=k===n;return(0,x.useEffect)(()=>{if(F){var e;null==(e=A.current)||e.focus()}},[F]),(0,t.jsxs)("div",{className:"relative flex-shrink-0",id:n,children:[(0,t.jsx)(o.FilterButton,{label:l,onClick:()=>{if(g){let{hasSubscription:e}=g();e&&T(n)}else T(n)},active:w,onRemoveAll:f,open:F}),(0,t.jsx)("div",{className:(0,v.default)("duration-250 fixed bottom-auto top-[72px] z-50 h-[calc(100dvh-72px)] w-full transition-opacity ease-out sm:absolute sm:top-auto sm:z-30 sm:h-fit sm:w-[320px]",F?"opacity-1 pointer-events-auto":"pointer-events-none opacity-0","right"===C?"left-auto right-0":"left-0 right-auto",P?"top-[72px] h-[calc(100dvh-72px)]":"top-[0px] h-[calc(100dvh)]"),children:(0,t.jsxs)("div",{className:"shadow-filter-button mt-0 h-full overflow-y-auto overscroll-contain border-none bg-bg-1 px-5 py-4 sm:mx-auto sm:mt-2 sm:h-auto sm:overflow-hidden sm:rounded-xl sm:border sm:border-solid sm:border-bg-3 sm:p-0",children:[y?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"hidden sm:block",children:[(0,t.jsxs)("div",{className:"flex flex-row items-center px-3 py-3",children:[(0,t.jsx)("div",{className:"pr-2",children:(0,t.jsx)(p.MagnifyingGlassIcon,{height:18})}),(0,t.jsx)("input",{ref:A,placeholder:"Search",className:"w-full appearance-none border-none border-transparent p-0 outline-none focus:border-transparent focus:outline-none focus:ring-0",onChange:a,value:j}),j&&(0,t.jsx)("div",{className:"my-auto cursor-pointer pl-2",onClick:()=>{null==a||a({target:{value:""}})},children:(0,t.jsx)(m.XMarkIcon,{height:18})})]}),(0,t.jsx)(c.Separator,{className:"bg-bg-3"})]}),(0,t.jsx)("div",{className:"block sm:hidden",children:(0,t.jsxs)("div",{className:"flex flex-row gap-x-2 pb-1",children:[(0,t.jsx)(r.IconButton,{Icon:u.ChevronLeftIcon,onClick:I}),(0,t.jsx)(s.default,{id:"findme",type:"search",placeholder:"Search",onChange:a,wrapperClassName:"w-full",className:"w-full",value:j})]})})]}):(0,t.jsx)("div",{className:"block sm:hidden",children:(0,t.jsx)("div",{className:"flex flex-row justify-end pb-1",children:(0,t.jsx)(r.IconButton,{Icon:m.XMarkIcon,onClick:I,variant:"white"})})}),(0,t.jsx)("div",{className:"flex flex-col gap-1 overflow-scroll px-2 py-2 sm:max-h-[380px]",children:b}),(0,t.jsxs)("div",{className:"absolute bottom-0 left-0 flex h-16 w-full flex-row items-center justify-between border-t border-bg-2 bg-bg-1 px-5 sm:hidden",children:[(0,t.jsx)("div",{onClick:f,children:(0,t.jsx)(i.Button,{variant:"white",children:"Clear"})}),(0,t.jsx)(i.Button,{onClick:I,children:N})]})]})})]})}},[363642]],573095:[e=>{"use strict";e.s({ApplyToJobContent:()=>A},573095);var t=e.i(187207);e.i(255692);var n=e.i(649168),l=e.i(660818),a=e.i(432658);e.i(533364);var i=e.i(548158),o=e.i(837403);e.i(635118);var r=e.i(799359),s=e.i(505026),c=e.i(685932),d=e.i(111616),u=e.i(49429),p=e.i(807086);e.i(118691);var m=e.i(906861),v=e.i(412624);e.i(501251);var x=e.i(96806),h=e.i(433872);e.i(490868);var g=e.i(199698),f=e.i(886779),j=e.i(815058),y=e.i(759171),b=e.i(879641),w=e.i(500853),C=e.i(399905);let N=e=>(0,t.jsx)(w.Tooltip,{contentProps:{align:"end",side:"bottom"},trigger:(0,t.jsxs)("div",{className:"flex cursor-default flex-row items-center gap-1 rounded-sm bg-bg-2 px-2 py-1",children:[(0,t.jsx)(C.InformationCircleIcon,{className:"size-[18px] stroke-fg-1"}),(0,t.jsx)(u.Text,{className:"",variant:"caption",children:"How do credits work?"})]}),text:"Credits show the number of past projects you've completed in this role. Each completed project on your portfolio tagged in this role counts as one credit.",textClassName:"text-left",width:270});var P=e.i(297954);let k=(0,m.graphql)("\n fragment ApplyToJobContentJobPosting on JobPosting {\n __typename\n id\n ...MiniJobCard\n position {\n name\n id\n }\n\n payType\n payRate\n payString\n\n owner {\n id\n name\n avatarInitials\n ... on HasAvatarUrl {\n avatarUrl(width: 48)\n }\n }\n }\n"),T=(0,m.graphql)('\n fragment ApplyToJobContentCreative on Indiv
1idualCreative {\n id\n __typename\n name\n avatarInitials\n avatarUrl(width: 80)\n creditsCount: creativeWorkPortfolioProjects(\n creatorRoles: [$positionId]\n status: PUBLISHED\n first: 1\n ) @connection(key: "creditsCount") {\n totalCount\n }\n emptyStateCheck: creativeWorkPortfolioProjects(\n status: PUBLISHED\n first: 0\n ) {\n totalCount\n }\n ...AdditionalProjectsForApplication\n }\n'),I=function(e,t,n){let{titleCase:l=!1}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=e=>l?e:e.toLowerCase();if(e===h.JobPostingPayType.RateBased&&t&&"$TBD"!==n){let e=t.replaceAll("_"," ");return a("".concat(e[0].toUpperCase()).concat(e.toLowerCase().slice(1)," rate"))}return a("Proposed rate")},A=e=>{var m;let{creativeWorkAttachments:w,coverLetter:C,proposedRate:A,loading:F,serverSession:S,onSelectWork:D,hasViewedSelectionScreen:J,...R}=e,B=(0,v.useFragment)(k,R.jobPosting),_=(0,v.useFragment)(T,R.creative),[W,E]=(0,y.useState)("");(0,y.useEffect)(()=>{E("Add rate")},[null==B?void 0:B.payType,null==B?void 0:B.payRate,null==B?void 0:B.payString]);let M=(0,y.useMemo)(()=>w.map(e=>(0,x.getFragmentData)(h.JobApplicationProjectPreviewFragmentDoc,e).id),[w]);return F?(0,t.jsx)(b.ApplyToJobContentSkeleton,{}):(0,t.jsxs)("div",{className:"mt-6 flex flex-col",children:[(0,t.jsx)("div",{className:"px-5 md:px-0",children:(0,t.jsx)(l.MiniJobCard,{size:"large",jobPosting:B})}),(0,t.jsx)("div",{className:"py-6",children:(0,t.jsx)(d.Separator,{})}),(0,t.jsxs)("div",{className:"flex flex-row items-center gap-x-2 px-5 md:px-0",children:[(0,t.jsx)(u.Text,{className:"text-fg-3",children:"This is what"}),(0,t.jsx)(r.Avatar,{size:"xs",src:null==B?void 0:B.owner.avatarUrl,initials:null==B?void 0:B.owner.avatarInitials}),(0,t.jsxs)(u.Text,{className:"text-fg-3",children:[(0,t.jsx)(u.Text,{element:"span",className:"text-fg-1",children:null==B?void 0:B.owner.name})," ","will see."]})]}),(0,t.jsxs)("div",{className:"my-6 flex w-full items-end justify-between px-5 md:px-0",children:[(0,t.jsxs)("div",{className:"flex flex-row items-center gap-x-3",children:[(0,t.jsx)(r.Avatar,{size:"lg",src:null==_?void 0:_.avatarUrl,initials:null==_?void 0:_.avatarInitials}),(0,t.jsxs)("div",{className:"flex w-full flex-col gap-y-0",children:[(0,t.jsx)(u.Text,{children:null==_?void 0:_.name}),(0,t.jsx)(n.CreditsTag,{creditsCount:null==_?void 0:_.creditsCount.totalCount,positionName:null==B||null==(m=B.position)?void 0:m.name,textVariant:"body3"})]})]}),J||0!==w.length?(0,t.jsx)(c.Button,{variant:"secondary",onClick:()=>{null==D||D()},children:"Edit"}):(0,t.jsx)("div",{className:"hidden flex-shrink-0 md:flex",children:(0,t.jsx)(N,{})})]}),(null==_?void 0:_.emptyStateCheck.totalCount)===0?(0,t.jsx)("div",{className:"px-5 md:px-0",children:(0,t.jsx)(a.EmptyState,{Icon:g.ImageX,title:"No projects",description:"You don't have any projects in your profile"})}):0!==w.length||J?(0,t.jsxs)("div",{className:"flex flex-row gap-x-2 overflow-x-auto px-5 md:w-[calc(100%+40px)] md:px-0 md:pr-10",children:[w.map((e,n)=>{var l;return(0,t.jsx)(o.ProjectPreviewCard,{projectData:e,positionId:null==B||null==(l=B.position)?void 0:l.id,imageWidth:"200px"},n)}),(0,t.jsx)(i.AdditionalProjectsCard,{creative:_,selectedProjectsIds:M})]}):(0,t.jsx)("div",{className:"px-5 md:px-0",children:(0,t.jsxs)("div",{onClick:()=>{null==D||D()},className:"flex h-[180px] w-full cursor-pointer flex-col items-center justify-center rounded-md border border-bg-3 bg-bg-2",children:[(0,t.jsx)(j.PlusIcon,{className:"size-6 stroke-fg-4"}),(0,t.jsx)(u.Text,{className:"text-fg-4",children:"Select work"})]})}),(0,t.jsxs)("div",{className:"mt-6 flex w-full flex-col px-5 md:px-0",children:[(0,t.jsxs)("div",{className:"flex flex-row items-center gap-x-2",children:[(0,t.jsxs)("div",{className:"flex flex-1 flex-col",children:[(0,t.jsx)(u.Text,{variant:"label",children:I(null==B?void 0:B.payType,null==B?void 0:B.payRate,null==B?void 0:B.payString,{titleCase:!0})}),(0,t.jsxs)("div",{className:"relative mt-2 flex flex-col",children:[(0,t.jsx)(s.BorderedInput,{value:(0,f.formatCurrencyLocale)(A.value,{decimals:0}),placeholder:W,onChange:e=>{let t=parseFloat(e.target.value.replace(/,/g,""))||null;if(null!==t&&t>999999)return void A.setError("Rate cannot be greater than 999,999");t?A.onChange(t.toString()):A.onChange("0")},onFocus:()=>{E("1200")},onBlur:()=>{E("Add rate")},className:"w-full bg-bg-1 pl-[32px]"}),(0,t.jsx)(u.Text,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-fg-4",children:"$"}),(null==B?void 0:B.payType)===h.JobPostingPayType.RateBased&&(null==B?void 0:B.payString)!=="$TBD"?(0,t.jsxs)(u.Text,{className:"absolute right-4 top-1/2 -translate-y-1/2 text-fg-4",children:["/",B.payRate.replaceAll("_"," ").toLowerCase()]}):null]})]}),(null==B?void 0:B.payString)==="$TBD"?(0,t.jsxs)("div",{className:"flex h-auto flex-1 flex-col",children:[(0,t.jsx)(u.Text,{variant:"label",children:"Pay Frequency"}),(0,t.jsx)(P.PayFrequencyDropdown,{...A})]}):null]}),A.error&&(0,t.jsx)(u.Text,{variant:"body3",className:"mt-1 text-red-default",children:A.error}),(0,t.jsx)(u.Text,{variant:"label",className:"mt-8",id:"add-note-section",children:"Add a note*"}),(0,t.jsx)(p.TextArea,{value:C.value,onChange:e=>{C.onChange(e.target.value)},className:"mt-3 w-full rounded-lg bg-bg-1",placeholder:"Attach any information that will help you stand out",rows:4}),C.error?(0,t.jsx)(u.Text,{variant:"body3",className:"text-red-default",children:C.error}):null]})]})};e.s({ApplyToJobFooter:()=>M},168997);var F=e.i(920386),S=e.i(29154);e.i(354666);var D=e.i(348366);e.i(382285);var J=e.i(164348),R=e.i(179942),B=e.i(330074),_=e.i(307266),W=e.i(494307);let E=(0,m.graphql)("\n fragment ApplyToJobFooter on JobPosting {\n __typename\n id\n payString\n payType\n payRate\n employmentTypeDisplay\n activeInteractionForCreative(creativeId: $creativeId) {\n __typename\n ... on N
1ode {\n id\n }\n }\n }\n");(0,m.graphql)("\n mutation ApplyToJob($input: ApplyToJobInput!, $creativeId: ID!) {\n applyToJob(input: $input) {\n errors {\n field\n messages\n }\n jobApplication {\n id\n status\n createdAt\n jobPosting {\n id\n status\n applicationCount\n activeInteractionForCreative(creativeId: $creativeId) {\n ... on JobApplication {\n id\n __typename\n applicationStatus: status\n invitation {\n id\n status\n acceptedAt\n }\n chat {\n id\n }\n }\n ... on JobInvitation {\n id\n __typename\n invitationStatus: status\n createdAt\n message\n acceptedAt\n }\n }\n }\n }\n }\n }\n");let M=e=>{var n,l,a;let{onClose:i,onSubmit:o,submitApplicationRefetchQueries:r,serverSession:s,coverLetter:d,proposedRate:p,loading:m,entryPoint:g,creativeWorkAttachments:f,goToSelectWork:j,onApplySuccess:b,...w}=e,C=(0,v.useFragment)(E,w.jobPosting),[N,{loading:P}]=(0,B.useMutation)(h.ApplyToJobDocument),[k,T]=(0,y.useState)(!1),I=null==s||null==(l=s.user)||null==(n=l.creative)?void 0:n.id,A=null==C?void 0:C.id,M=(0,y.useCallback)(async function(){var e,t,n,l,a,o;let s=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!A||!I)return void D.toast.error("Error submitting application");if(d.value)d.setError(void 0);else{d.setError("Please include a note"),null==(e=window.document.getElementById("add-note-section"))||e.scrollIntoView({behavior:"smooth"});return}if(!s&&0===f.length)return void T(!0);try{let e=p.payType?p.payType:(null==C?void 0:C.payType)?C.payType:h.JobPostingPayType.FixedFee,s=await N({variables:{input:{jobPosting:A,creative:I,invitation:(null==C||null==(t=C.activeInteractionForCreative)?void 0:t.id)||void 0,coverLetter:d.value||void 0,creativeWorkAttachments:f.map(e=>({portfolioProject:(0,x.getFragmentData)(h.JobApplicationProjectPreviewFragmentDoc,e).id})),...p.value&&{proposedPay:{currency:"USD",amount:p.value},proposedPayType:e,proposedPayRateFrequency:e===h.JobPostingPayType.FixedFee?void 0:p.payRateFrequency?p.payRateFrequency:(null==C?void 0:C.payRate)?C.payRate:h.JobPostingPayRate.Hour}},creativeId:I},awaitRefetchQueries:!0,refetchQueries:r});if((null==(l=s.data)||null==(n=l.applyToJob)?void 0:n.errors)&&(null==(o=s.data)||null==(a=o.applyToJob)?void 0:a.errors.length)>0)throw Error("Error submitting application");F.ampli.applyToJobComplete({job_id:(0,J.decodeGraphqlNodeId)(A).numericalId||"",job_type:(null==C?void 0:C.__typename)==="ClientJobPosting"?"client":"creative"}),D.toast.success("Application submitted"),(0,R.revalidateTagsHelper)(["jobs-id-server-authenticated-query"]),null==b||b(),null==i||i()}catch(e){(0,_.captureException)(e),console.error(e)}},[A,I,d,f,N,null==C||null==(a=C.activeInteractionForCreative)?void 0:a.id,null==C?void 0:C.__typename,r,b,i]);return m?(0,t.jsx)(W.JobsDrawerFooterSkeleton,{}):(0,t.jsxs)("div",{className:"flex h-full w-full flex-row items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,t.jsx)(u.Text,{variant:"h5",children:null==C?void 0:C.payString}),(0,t.jsx)(u.Text,{variant:"label",className:"text-fg-3",maxLines:1,children:null==C?void 0:C.employmentTypeDisplay})]}),(0,t.jsxs)("div",{className:"flex flex-row items-center gap-2",children:[(0,t.jsx)(c.Button,{size:"large",className:"hidden md:block",onClick:i,variant:"transparent",disabled:P,children:"Cancel"}),(0,t.jsx)(c.Button,{className:"md:hidden",onClick:i,variant:"transparent",disabled:P,children:"Cancel"}),(0,t.jsx)(c.Button,{size:"large",className:"hidden md:block",onClick:()=>M(!1),loading:P,children:"Submit application"}),(0,t.jsx)(c.Button,{className:"md:hidden",onClick:()=>M(!1),loading:P,children:"Submit"})]}),(0,t.jsx)(S.ControlledModal,{zIndex:102,fullScreenOnMobile:!1,header:{fixed:!0,variant:"warning",title:"Are you sure?",subt
1itle:"You havenât chosen any of your projects to be included in your application. Including projects increases your chances of getting contacted and hired."},open:k,onOpenChange:e=>{e||F.ampli.noAttachedWorkWarning({action:"cancel"}),T(e)},onClose:()=>{F.ampli.noAttachedWorkWarning({action:"cancel"}),T(!1)},footer:{fixed:!0,primaryButton:{children:"Select projects",onClick:()=>{F.ampli.noAttachedWorkWarning({action:"select-projects"}),j()}},secondaryButton:{children:"Apply anyway",onClick:()=>{M(!0),F.ampli.noAttachedWorkWarning({action:"apply-anyway"})}},tertiaryButton:{children:"Cancel",onClick:()=>{T(!1),F.ampli.noAttachedWorkWarning({action:"cancel"})},className:"hidden md:block"}}})]})};e.s({ApplyToJobSelectWork:()=>K},441201);var $=e.i(218733),L=e.i(363642),q=e.i(535758),H=e.i(673466),U=e.i(478571),z=e.i(807356),O=e.i(166809),G=e.i(493405),Q=e.i(318282),V=e.i(29360);e.i(222859);var X=e.i(665584),Y=e.i(207796);let Z=e=>{var n,l,a;let{creativeWorkAttachments:i,toggleProject:o,positionId:r,...s}=e,c=(0,v.useFragment)(h.JobApplicationProjectPreviewFragmentDoc,s.projectData),d=(0,y.useMemo)(()=>(0,x.getFragmentData)(h.JobApplicationProjectPreviewFragmentDoc,i).map(e=>e.id).indexOf((null==c?void 0:c.id)||""),[i,null==c?void 0:c.id]),p=d>=0;if(!c||!s.projectData)return null;let m=null!=(l=null==c?void 0:c.thumbnailFocalPointX)?l:.5,g=null!=(a=null==c?void 0:c.thumbnailFocalPointY)?a:.5;return(0,t.jsxs)("div",{className:"relative h-fit cursor-default",children:[(0,t.jsx)(V.Image,{srcSetUrls:{sm:c.thumbnail645w||""},alt:c.title||"",className:"aspect-square w-full cursor-pointer select-none rounded-md object-cover",onClick:()=>{s.projectData&&o(s.projectData)},style:{objectPosition:"".concat(100*m,"% ").concat(100*g,"%")}}),(0,t.jsx)("div",{className:(0,Y.default)("absolute right-4 top-4 flex size-7 cursor-pointer select-none items-center justify-center rounded-full text-fg-1",p?"bg-bg-1":"border border-bg-1 border-opacity-70 bg-bg-1 bg-opacity-10 shadow-[0_4px_24px_0_rgba(0,0,0,0.10)] backdrop-blur-[10px]"),onClick:()=>{s.projectData&&o(s.projectData)},children:p?(0,t.jsx)(u.Text,{variant:"CTASmall",children:d+1}):null}),(0,t.jsxs)("div",{className:"flex flex-col pb-3 pt-2",children:[(0,t.jsx)(u.Text,{className:"pb-1",maxLines:1,variant:"body2",children:c.title}),(0,t.jsx)(Q.RolePreview,{creativeWork:c,positionId:r}),c.category?(0,t.jsxs)("div",{className:"flex flex-row items-center gap-x-[6px]",children:[(0,t.jsx)(X.BriefcaseIcon,{width:12,height:12,className:"shrink-0 fill-fg-3 stroke-fg-3"}),(0,t.jsx)(u.Text,{variant:"caption",className:"text-fg-3",children:null==(n=c.category)?void 0:n.name})]}):null]})]})};(0,m.graphql)("\n query FetchMoreApplicationSelectProjects(\n $id: ID!\n $first: Int!\n $after: String\n $category: [ID!]\n $creatorRoles: [ID!]\n ) {\n individualCreative(id: $id) {\n id\n ...MyApplicationSelectProjects\n }\n }\n"),(0,m.graphql)("\n query GetFiltersForProfile($id: ID!) {\n node(id: $id) {\n ... on IndividualCreative {\n creativeWorkPortfolioProjects {\n roleCounts {\n category {\n id\n name\n }\n count\n }\n typeCounts {\n category {\n id\n name\n }\n count\n }\n }\n }\n }\n }\n"),(0,m.graphql)("\n fragment MyApplicationSelectProjects on IndividualCreative {\n id\n projects: creativeWorkPortfolioProjects(\n first: $first\n after: $after\n filters: {\n status: { exact: PUBLISHED }\n category: { inList: $category }\n creatorRoles: { inList: $creatorRoles }\n }\n order: { profileOrder: ASC }\n ) {\n totalCount\n edges {\n node {\n id\n __typename\n ...JobApplicationProjectPreview\n }\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n }\n");let K=e=>{var n,i,o,r,s;let{loading:p,creativeWorkAttachments:m,setCreativeWorkAttachments:g,creativeId:f,...j}=e,[w,C]=(0,y.useState)([]),[N,P]=(0,y.useState)([]),{data:k}=(0,U.useSession)(),T=(0,v.useFragment)(h.ApplyToJobContentJobPostingFragmentDoc,j.jobPosting),{data:I,fetchMore:A,networkStatus:F,loading:S}=(0,z.useQuery)(h.FetchMoreApplicationSelectProjectsDocument,{variables:{id:"".concat(f),first:8,after:null,category:N.map(e=>e.id).length>0?N.map(e=>e.id):null,creatorRoles:w.map(e=>e.id).length>0?w.map(e=>e.id):null}
1,skip:!f,context:{version:2},fetchPolicy:"network-only"}),{data:J}=(0,z.useQuery)(h.GetFiltersForProfileDocument,{variables:{id:"".concat(f)},skip:!f}),R=null==(n=(0,x.getFragmentData)(h.MyApplicationSelectProjectsFragmentDoc,null==I?void 0:I.individualCreative))?void 0:n.projects,B=(0,y.useRef)(null);(0,H.useHandleListEndReached)({fetchMore:A,pageInfo:null==(i=(0,x.getFragmentData)(h.MyApplicationSelectProjectsFragmentDoc,null==I?void 0:I.individualCreative))?void 0:i.projects.pageInfo,first:8,observerRef:B,networkStatus:F});let _=e=>{m.some(t=>{var n,l;return(null==(n=(0,x.getFragmentData)(h.JobApplicationProjectPreviewFragmentDoc,t))?void 0:n.id)===(null==(l=(0,x.getFragmentData)(h.JobApplicationProjectPreviewFragmentDoc,e))?void 0:l.id)})?g(t=>t.filter(t=>{var n,l;return(null==(n=(0,x.getFragmentData)(h.JobApplicationProjectPreviewFragmentDoc,t))?void 0:n.id)!==(null==(l=(0,x.getFragmentData)(h.JobApplicationProjectPreviewFragmentDoc,e))?void 0:l.id)})):m.length<6?g(t=>[...t,e]):D.toast.error("You can only select up to 6 projects")},W=(null==J||null==(o=J.node)?void 0:o.__typename)==="IndividualCreative"?null==J?void 0:J.node:void 0;return p?(0,t.jsx)(b.ApplyToJobContentSkeleton,{}):(0,t.jsxs)("div",{className:"mt-6 flex flex-col px-5 md:px-0",children:[(0,t.jsx)(l.MiniJobCard,{jobPosting:T}),(0,t.jsx)("div",{className:"py-6",children:(0,t.jsx)(d.Separator,{})}),(0,t.jsx)(u.Text,{variant:"body2",className:"text-fg-3",children:"Choose up to 6 relevant projects for this job."}),(0,t.jsxs)("div",{className:"mb-5 mt-6 flex flex-row gap-x-2",children:[(0,t.jsx)(L.FilterWrapper,{withHeaderSpaceOnMobile:!1,hasSearch:!1,onRemoveAll:()=>C([]),id:"filter-roles",buttonText:"Roles ".concat(w.length>0?"(".concat(w.length,")"):""),filterActive:w.length>0,menuPosition:"left",footerText:"".concat(w.length," roles selected"),children:(0,t.jsx)("div",{className:"mt-3 flex w-full",children:(0,t.jsx)("div",{className:"flex w-full flex-col gap-1",children:null==W?void 0:W.creativeWorkPortfolioProjects.roleCounts.map(e=>{var n,l;return(0,t.jsx)($.FilterItem,{name:"".concat(null==e||null==(n=e.category)?void 0:n.name," ").concat(null==e?void 0:e.count)||"",selected:w.some(t=>{var n;return t.id===(null==e||null==(n=e.category)?void 0:n.id)||""}),onClick:()=>{var t;(null==e||null==(t=e.category)?void 0:t.id)&&(e=>{w.some(t=>t.id===e.id)?C(t=>t.filter(t=>t.id!==e.id)):C(t=>[...t,e])})(e.category)}},null==e||null==(l=e.category)?void 0:l.id)})})})}),(0,t.jsx)(L.FilterWrapper,{withHeaderSpaceOnMobile:!1,hasSearch:!1,onRemoveAll:()=>P([]),id:"filter-project-types",buttonText:"Project Types ".concat(N.length>0?"(".concat(N.length,")"):""),filterActive:N.length>0,menuPosition:"left",footerText:"".concat(N.length," project types selected"),children:(0,t.jsx)("div",{className:"mt-3 flex w-full",children:(0,t.jsx)("div",{className:"flex w-full flex-col gap-1",children:null==W?void 0:W.creativeWorkPortfolioProjects.typeCounts.map(e=>{var n,l,a;return(null==e||null==(n=e.category)?void 0:n.id)?(0,t.jsx)($.FilterItem,{name:"".concat(null==e||null==(l=e.category)?void 0:l.name," ").concat(null==e?void 0:e.count)||"",selected:N.some(t=>{var n;return t.id===(null==e||null==(n=e.category)?void 0:n.id)||""}),onClick:()=>{var t;(null==e||null==(t=e.category)?void 0:t.id)&&(e=>{N.some(t=>t.id===e.id)?P(t=>t.filter(t=>t.id!==e.id)):P(t=>[...t,e])})(e.category)}},null==e||null==(a=e.category)?void 0:a.id):null})})})})]}),(null==R||null==(r=R.edges)?void 0:r.length)&&(null==R||null==(s=R.edges)?void 0:s.length)>0?(0,t.jsx)("div",{className:"grid grid-cols-2 gap-3",children:null==R?void 0:R.edges.map((e,n)=>{var l;return(0,t.jsx)(Z,{projectData:null==e?void 0:e.node,creativeWorkAttachments:m,toggleProject:_,positionId:null==T||null==(l=T.position)?void 0:l.id},n)})}):!S&&(0,t.jsx)(a.EmptyState,{title:"No projects found",Icon:O.DocumentIcon,description:"".concat(w.length>0||N.length>0?"No projects found":""," ").concat(w.length>0?"where the role was ".concat(w.map(e=>e.name).join("/")):""," ").concat(N.length>0?"on a project type of ".concat(N.map(e=>e.name).join("/")):""),children:(0,t.jsx)(G.default,{className:"mt-4",href:"/".concat(null==k?void 0:k.user.creative.handle,"/projects/form"),children:(0,t.jsx)(c.Button,{children:"Upload project"})})}),(null==R?void 0:R.pageInfo.hasNextPage)?(0,t.jsx)("div",{className:"relative mb-1 mt-2 flex h-[20px] w-full flex-row items-center justify-center sm:col-span-2",ref:B,children:(0,t.jsx)(q.Spinner,{className:"bg-fg-1"})}):null]})};e.s({ApplyToJobSelectWorkFooter:()=>ee},216110);let ee=e=>{let{returnToApply:n,attachmentLength:l}=e;return(0,t.jsxs)("div",{className:"flex h-full w-full flex-row items-center justify-end",children:[(0,t.jsxs)(c.Button,{size:"large",variant:"primary",className:"hidden md:block",onClick:n,children:["Next ",l>0?"(".concat(l,")"):""]}),(0,t.jsxs)(c.Button,{variant:"primary",className:"w-full md:hidden",onClick:n,children:["Next ",l>0?"(".concat(l,")"):""]})]})}},[168997,441201,216110]]}]); 2
3//# sourceMappingURL=cc23c92bc442bd7c.js.map
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.