OCDevManageWorldsAssetsCollaboratorsTabView.react",["fbt","ix","CometRelay","GeoBaseTableCell.react","GeoButton.react","GeoFlexbox.react","GeoMediaItem.react","GeoTable.react","GeoTableColumnAlignments","GeoTableWidth","GeoText.react","GeoToast.react","Image.react","JSResourceForInteraction","OCDevManageWorldsAssetsCollaboratorsTabViewSelfMutation.graphql","OCDevManageWorldsAssetsUtils","Promise","RelayHooks","SocialVrUserActionWebEventLogger","createGeoTableDataSource","fbicon","isStringNullOrEmpty","promiseDone","react","useCometLazyDialog","useGeoTableRowSelection","useGeoTableRowSelectionState","useGeoTableVirtualization","useGeoToaster"],(function(a,b,c,d,e,f,g,h,i){"use strict";var j,k,l,m=l||(l=d("react"));e=l;var n=e.useCallback,o=e.useEffect,p=e.useMemo,q=e.useRef,r=e.useState,s=c("JSResourceForInteraction")("OCDevManageWorldsAssetsCollaboratorsRemoveModal.react").__setRef("OCDevManageWorldsAssetsCollaboratorsTabView.react"),t=30;function a(a){var e=a.canShare,f=a.collectionId,g=a.collectionName,l=a.hasNext,v=a.isLoading,w=a.loadNext,x=a.owner,y=a.participants,z=a.removeCollaborators,A=a.setIsMultiRemoveShown,B=a.setMultiRemoveIds,C=a.viewerId;a=r(new Set());var D=a[0];a=a[1];var E=c("useCometLazyDialog")(s),F=E[0],G=q(!1);o(function(){I([x].concat(y))},[x,y]);E=r([]);var H=E[0],I=E[1];o(function(){if(!G.current){G.current=!0;return}B(D);D.size>0?A(!0):A(!1)},[D,A,B]);E=c("useGeoToaster")();var J=E.add;E=d("RelayHooks").useMutation(j!==void 0?j:j=b("OCDevManageWorldsAssetsCollaboratorsTabViewSelfMutation.graphql"));var K=E[0],L=n(function(){c("isStringNullOrEmpty")(f)||c("promiseDone")(new(k||(k=b("Promise")))(function(a,b){var e={userCount:1};K({onCompleted:function(){d("SocialVrUserActionWebEventLogger").logCompleted({action:d("SocialVrUserActionWebEventLogger").SocialVrUserActionWebEvent.ASSET_LIBRARY_SHARED_FOLDERS_REMOVE_SUCCESS,extra:e}),a(),J(m.jsx(c("GeoToast.react"),{heading:h._(/*BTDS*/"You are removed from {collection name}",[h._param("collection name",g)])}))},onError:function(a){d("SocialVrUserActionWebEventLogger").logCompleted({action:d("SocialVrUserActionWebEventLogger").SocialVrUserActionWebEvent.ASSET_LIBRARY_SHARED_FOLDERS_REMOVE_FAIL,extra:e}),b(a),J(m.jsx(c("GeoToast.react"),{heading:h._(/*BTDS*/"Something went wrong. Please try again."),status:"error"}))},updater:function(a){var b=d("CometRelay").ConnectionHandler.getConnectionID(C,"HorizonAssetLibraryLeftRail__asset_library_owned_or_shared_with_collections");a=a.get(b);b=a==null?void 0:a.getLinkedRecords("edges");b=(b==null?void 0:b.filter(function(a){var b;return(a==null||(b=a.getLinkedRecord("node"))==null?void 0:b.getValue("id"))!==f}))||[];a==null||a.setLinkedRecords(b,"edges")},variables:{input:{client_mutation_id:d("OCDevManageWorldsAssetsUtils").createUUID(),collection_id:f}}})}))},[J,f,g,K]),M=n(function(a){if(!c("isStringNullOrEmpty")(f)&&a&&z){var b=C===a.id;b?L():z(new Set([a.id]))}},[z,f,L,C]);E=p(function(){return[{cell:function(a){a=a.item;var b=x.id===a.id?h._(/*BTDS*/"{userName} (Owner)",[h._param("userName",a.alias)]):a.alias;return m.jsxs(c("GeoFlexbox.react"),{xstyle:u.participantRow,children:[m.jsx(c("GeoMediaItem.react"),{fit:"contain",media:m.jsx(c("Image.react"),{src:a.photoUri}),ratio:"circle",size:32,xstyle:u.profile}),m.jsx("div",babelHelpers["extends"]({className:"xamitd3"},{children:m.jsx(c("GeoText.react"),{children:b},a.id)}))]},a.id)},header:h._(/*BTDS*/"Name"),key:"Name",width:d("GeoTableWidth").proportional(2)},{cell:function(a){a=a.item;return a.isOwner?h._(/*BTDS*/"Can manage the entire folder and its collaborators"):h._(/*BTDS*/"Can edit and delete assets, and manage collaborators")},header:{label:h._(/*BTDS*/"Permission")},key:"Permission",width:d("GeoTableWidth").proportional(3)},{alignHorizontal:d("GeoTableColumnAlignments").HorizontalAlignment.End,cell:function(a){var b=a.item;if(b.isOwner||!e&&C!==b.id)return m.jsx(c("GeoBaseTableCell.react"),{children:m.jsx("div",babelHelpers["extends"]({className:"x1njhlm6 xlshs6z"},{children:"."}))});else return m.jsx(c("GeoBaseTableCell.react"),{children:m.jsx(c("GeoButton.react"),{icon:d("fbicon")._(i("483825"),16),isLabelHidden:!0,label:h._(/*BTDS*/"Remove collaborator"),onClick:function(){F({collectionName:g,onSingleRemove:M,singleRemoval:b,viewerId:C})}})})},header:h._(/*BTDS*/"Actions"),key:"Actions",width:d("GeoTableWidth").proportional(1)}]},[e,g,x.id,M,F,C]);var N=p(function(){return c("createGeoTableDataSource")(H,{getStableUniqueID:function(a){return a.id}})},[H]),O=n(function(a){return a.id},[]),P=n(function(a){return!a.isOwner},[]);P=c("useGeoTableRowSelectionState")({dataSource:N,getIDForItem:O,getIsItemSelectable:P,selectedItemIDs:D,setSelectedItemIDs:a});a=P.getAllSelected;var Q=P.onSelectAll;P=P.onSelectItem;var R=n(function(a){return!a.isOwner},[]),S=n(function(a){a.isAllSelected;return h._(/*BTDS*/"Select all")},[]),T=n(function(){return h._(/*BTDS*/"Owner cannot be removed.")},[]),U=n(function(a){a.isSelected;a=a.item;return h._(/*BTDS*/"Select {name}",[h._param("name",a.alias)])},[]);a=c("useGeoTableRowSelection")({getAllSelected:a,getIDForItem:O,getIsItemEnabled:R,getSelectAllLabel:S,getSelectDisabledMessage:T,getSelectLabel:U,onSelectAll:Q,onSelectItem:P,selectedItemIDs:D});O=c("useGeoTableVirtualization")({estimatedRowHeight:70});return m.jsx(c("GeoFlexbox.react"),{direction:"column",grow:1,children:m.jsx(c("GeoTable.react"),{columns:E,dataSource:N,label:h._(/*BTDS*/"Folder collaborators table"),pagination:{hasNext:l,isLoadingNext:v,loadNext:w,pageSize:t},plugins:e?{selection:a,virtualization:O}:{virtualization:O},xstyle:u.scrollable})})}a.displayName=a.name+" [from "+f.id+"]";var u={participantRow:{alignItems:"x6s0dn4",$$css:!0},profile:{marginInlineEnd:"x2fvf9",$$css:!0},scrollable:{maxHeight:"x1bwycvy",overflowX:"xw2csxc",overflowY:"x1odjw0f",$$css:!0}};g["default"]=a}),226);
-----
OCDevManageWorldsAssetsCollaboratorsTabViewSelfMutation.graphql",[],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"input"}],b=[{alias:null,args:[{kind:"Variable",name:"input",variableName:"input"}],concreteType:"XFBHorizonAssetLibraryCollectionRemoveSelfResponsePayload",kind:"LinkedField",name:"xfb_horizon_asset_library_collection_remove_self",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"client_mutation_id",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"OCDevManageWorldsAssetsCollaboratorsTabViewSelfMutation",selections:b,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"OCDevManageWorldsAssetsCollaboratorsTabViewSelfMutation",selections:b},params:{id:"24134932519493479",metadata:{},name:"OCDevManageWorldsAssetsCollaboratorsTabViewSelfMutation",operationKind:"mutation",text:null}}}();e.exports=a}),null);
-----
-----
OCDevManageWorldsAssetsCollaboratorsTabViewSelfMutation.graphql",[],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"input"}],b=[{alias:null,args:[{kind:"Variable",name:"input",variableName:"input"}],concreteType:"XFBHorizonAssetLibraryCollectionRemoveSelfResponsePayload",kind:"LinkedField",name:"xfb_horizon_asset_library_collection_remove_self",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"client_mutation_id",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"OCDevManageWorldsAssetsCollaboratorsTabViewSelfMutation",selections:b,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"OCDevManageWorldsAssetsCollaboratorsTabViewSelfMutation",selections:b},params:{id:"24134932519493479",metadata:{},name:"OCDevManageWorldsAssetsCollaboratorsTabViewSelfMutation",operationKind:"mutation",text:null}}}();e.exports=a}),null);
-----