MWSDevicesAppSettingsPageUpdateSettings.react",["fbt","CometRelayErrorHandling","GeoButton.react","GeoCancelButton.react","GeoFlexbox.react","GeoHStack.react","GeoNotice.react","GeoSwitch.react","GeoText.react","GeoVStack.react","MMAQPLUserFlow","MWSDevicesAppDetailsTabsMutation.graphql","MWSDevicesAppDetailsTabsMutationManagedPrivateAppMutation.graphql","MWSDevicesAppFormContext","MWSDevicesAppFormHelper","MWSDevicesAppFormReducer","MWSDevicesAppSelfHostedUpdatePriorityForm.react","MWSDevicesAppUpdateTypeForm.react","MWSDevicesAppsGKs","MWSDevicesStringUtils","RelayHooks","geoMargin","isMWSDevicesAppFormValid","qpl","react","useGeoSelection"],(function(a,b,c,d,e,f,g,h){"use strict";var i,j=i||(i=d("react"));b=i;var k=b.useCallback,l=b.useMemo,m=b.useReducer,n=b.useState;function a(a){var b=a.canManageApps,e=a.eventOrigin,f=a.isSelfHostedApp,g=a.itapCompanyID;a=a.itemID;var i=d("MWSDevicesAppFormContext").useMWSDevicesAppFormContext(),q=i.appData,r=i.dispatch;i=m(d("MWSDevicesAppFormReducer").reducer,babelHelpers["extends"]({},q));var s=i[0],t=i[1],u=c("qpl")._(440735277,"762"),v=k(function(a){r(a),t(a)},[r,t]);i=n(null);var w=i[0],x=i[1];i=d("RelayHooks").useMutation(c("MWSDevicesAppDetailsTabsMutation.graphql"));var y=i[0],z=i[1];i=d("RelayHooks").useMutation(c("MWSDevicesAppDetailsTabsMutationManagedPrivateAppMutation.graphql"));var A=i[0],B=i[1];i=c("useGeoSelection")(a);a=i.toggleSelection;var C=l(function(){return B||z},[B,z]);i=l(function(){return C||!d("isMWSDevicesAppFormValid").isMWSDevicesAppUpdateSettingUpdatedWithUserData(s,q,!0)},[q,s,C]);var D=k(function(a,b){var c;d("MWSDevicesAppFormHelper").logAppUpdateSuccessOrFailure(g,e,(c=q.appID)!=null?c:"",a);d("MWSDevicesAppFormHelper").logChangesInAppUpdateSettings(g,e,s,q,a);a&&d("MMAQPLUserFlow").start(u);if(b){d("CometRelayErrorHandling").markErrorAsHandled(b);d("MMAQPLUserFlow").endCancelOrFailure(u,b,{annotations:{string:{cancelReason:b.toString(),www_request_id:(c=b.source)==null?void 0:c.www_request_id}}})}},[q,s,e,g,u]),E=k(function(){v({type:"UPDATE_DEVICE_UPDATE_PRIORITY",value:s.deviceUpdatePriority}),v({type:"UPDATE_IS_AUTOMATIC_UPDATE_ENABLED",value:s.isAutoUpdateEnabled}),v({type:"UPDATE_DEVICE_UPDATE_TYPE",value:s.deviceUpdateType})},[s,v]),F=k(function(){x(null);d("MMAQPLUserFlow").start(u);if(f)y({onCompleted:function(){E(),D(!0)},onError:function(a){D(!1,a),x(p)},variables:{input:{device_update_priority:s.deviceUpdatePriority,remote_app_id:q.appID},refetch_app_details:!1}});else{var a;A({onCompleted:function(){E(),D(!0)},onError:function(a){D(!1,a),x(p)},variables:{input:{managed_app_id:(a=q.appID)!=null?a:"",update_settings:{device_update_type:s.deviceUpdateType,is_autoupdate_enabled:s.isAutoUpdateEnabled}}}})}},[q.appID,s.deviceUpdatePriority,s.deviceUpdateType,s.isAutoUpdateEnabled,f,D,A,u,y,E]);return j.jsxs(c("GeoVStack.react"),{children:[j.jsx(c("GeoFlexbox.react"),{xstyle:c("geoMargin").vert8,children:j.jsxs(c("GeoVStack.react"),{children:[j.jsx(o,{appDataWithChanges:s,editStateDispatch:t,isDisabled:!b,isLoading:C,isSelfHostedApp:f}),w!=null&&j.jsx(c("GeoNotice.react"),{status:"error",children:w})]})}),j.jsxs(c("GeoHStack.react"),{alignItems:"end",grow:1,justifyContent:"end",children:[j.jsx(c("GeoCancelButton.react"),{isDisabled:C,onClick:a}),j.jsx(c("GeoButton.react"),{disabledMessage:b?null:d("MWSDevicesStringUtils").Q4B_MISSING_PERMISSION_MSG,isDisabled:i||!b,isLoading:C,label:h._(/*BTDS*/"Save"),onClick:F,variant:"primary"})]})]})}a.displayName=a.name+" [from "+f.id+"]";function o(a){var b=a.appDataWithChanges,e=a.editStateDispatch,f=a.isDisabled,g=a.isLoading;a=a.isSelfHostedApp;var h=function(a){e({type:"UPDATE_IS_AUTOMATIC_UPDATE_ENABLED",value:a})};if(a)return j.jsx(c("MWSDevicesAppSelfHostedUpdatePriorityForm.react"),{isDisabled:f,isLoading:g,propAppData:b,propDispatch:e});if(d("MWSDevicesAppsGKs").GK_Q4B_ADMIN_CENTER_APP_UPDATE_CONTROL)return j.jsx(c("MWSDevicesAppUpdateTypeForm.react"),{isDisabled:f,isLabelHidden:!0,propAppData:b,propDispatch:e});else return j.jsxs(c("GeoHStack.react"),{children:[j.jsx(c("GeoSwitch.react"),{disabledMessage:d("MWSDevicesStringUtils").Q4B_MISSING_PERMISSION_MSG,isDisabled:f,isLabelHidden:!0,label:"App updates",onChange:h,value:b.isAutoUpdateEnabled}),j.jsx(c("GeoText.react"),{children:q})]})}o.displayName=o.name+" [from "+f.id+"]";var p=h._(/*BTDS*/"Failed to update app update control settings. Please try again."),q=h._(/*BTDS*/"Turn on automatic updates for all devices");g["default"]=a}),226);
-----
MWSDevicesAppVisualsPageTabAppImageEdit.react",["fbt","CometRelayErrorHandling","GeoBaseText.react","GeoButton.react","GeoCancelButton.react","GeoHStack.react","GeoHeading.react","GeoNotice.react","GeoVStack.react","MMAQPLUserFlow","MWSDevicesAppDetailsConstants","MWSDevicesAppDetailsTabsMutation.graphql","MWSDevicesAppDetailsTabsMutationManagedPrivateAppMutation.graphql","MWSDevicesAppFormContext","MWSDevicesAppFormHelper","MWSDevicesAppFormReducer","MWSDevicesAppImageDragDropUploadForm.react","MWSDevicesStringUtils","MWSDeviesAppAddModalHelper","RelayHooks","geoMargin","qpl","react","useGeoSelection"],(function(a,b,c,d,e,f,g,h){"use strict";var i,j=i||(i=d("react"));b=i;var k=b.useCallback,l=b.useMemo,m=b.useReducer,n=b.useState;function a(a){var b=a.canManageApps,e=a.eventOrigin,f=a.imageType,g=a.isSelfHostedApp,i=a.itapCompanyID;a=a.itemID;var t=d("MWSDevicesAppFormContext").useMWSDevicesAppFormContext(),u=t.appData,v=t.dispatch;t=m(d("MWSDevicesAppFormReducer").reducer,babelHelpers["extends"]({},u));var w=t[0],x=t[1];t=n(null);var y=t[0],z=t[1],A=c("qpl")._(440735277,"762");t=d("RelayHooks").useMutation(c("MWSDevicesAppDetailsTabsMutation.graphql"));var B=t[0],C=t[1];t=d("RelayHooks").useMutation(c("MWSDevicesAppDetailsTabsMutationManagedPrivateAppMutation.graphql"));var D=t[0],E=t[1];t=c("useGeoSelection")(a);a=t.toggleSelection;var F=l(function(){return E||C},[E,C]);t=l(function(){var a;return F||f==="icon"&&((a=u.icon)==null?void 0:a.id)===((a=w.icon)==null?void 0:a.id)||f==="logo"&&((a=u.logo)==null?void 0:a.id)===((a=w.logo)==null?void 0:a.id)},[(t=u.icon)==null?void 0:t.id,(t=u.logo)==null?void 0:t.id,(t=w.icon)==null?void 0:t.id,(t=w.logo)==null?void 0:t.id,f,F]);var G=k(function(a){var b;switch(f){case"icon":return g?(b=(b=a.update_library_app)==null||(b=b.remote_app)==null?void 0:b.images_icon)!=null?b:{}:(b=(b=a.xhw_q4b_update_managed_app_settings)==null||(b=b.private_app)==null?void 0:b.images_icon)!=null?b:{};case"logo":return g?(b=(b=a.update_library_app)==null||(b=b.remote_app)==null?void 0:b.images_logo)!=null?b:{}:(a=(b=a.xhw_q4b_update_managed_app_settings)==null||(b=b.private_app)==null?void 0:b.images_logo)!=null?a:{}}},[f,g]),H=k(function(a){a=G(a);var b=a.filename,c=a.id;a=a.image_uri;var d=f==="icon"?"UPDATE_APP_ICON":"UPDATE_APP_LOGO";v({type:d,value:{file:null,filename:b!=null?b:"",id:c,uri:a}});x({type:d,value:{file:null,filename:b!=null?b:"",id:c,uri:a}});x({type:"SET_APP_IMAGE_IDS_TO_DELETE",value:[]})},[v,G,f]),I=k(function(a,b){var c;d("MWSDevicesAppFormHelper").logAppUpdateSuccessOrFailure(i,e,(c=u.appID)!=null?c:"",a);a&&d("MMAQPLUserFlow").endSuccess(A);if(b){d("CometRelayErrorHandling").markErrorAsHandled(b);d("MMAQPLUserFlow").endCancelOrFailure(A,b,{annotations:{string:{cancelReason:b.toString(),www_request_id:(c=b.source)==null?void 0:c.www_request_id}}})}},[u.appID,e,i,A]),J=k(function(a,b,c){d("MWSDeviesAppAddModalHelper").handleImageLogging(b,c,e,i),H(a)},[e,i,H]),K=k(function(){z(null);var a=d("MWSDeviesAppAddModalHelper").getUploadablesData(w),b=a.iconUploaded,c=a.logoUploaded;a=a.uploadables;d("MMAQPLUserFlow").start(A);if(g){var e;B({onCompleted:function(a){J(a,c,b),I(!0)},onError:function(a){I(!1,a),z(f==="icon"?q:r)},uploadables:a,variables:{input:{app_icon:f==="icon"&&((e=w.icon)==null?void 0:e.file)!=null?"app_icon":null,app_logo:f==="logo"&&((e=w.logo)==null?void 0:e.file)!=null?"app_logo":null,images_to_delete:w.imageIDsToDelete,remote_app_id:u.appID},refetch_app_details:!1}})}else{D({onCompleted:function(a){J(a,c,b),I(!0)},onError:function(a){I(!1,a),z(f==="icon"?q:r)},uploadables:a,variables:{input:{image_settings:{app_icon:f==="icon"&&((e=w.icon)==null?void 0:e.file)!=null?"app_icon":null,app_logo:f==="logo"&&((a=w.logo)==null?void 0:a.file)!=null?"app_logo":null,images_to_delete:w.imageIDsToDelete},managed_app_id:(e=u.appID)!=null?e:""}}})}},[u.appID,w,f,g,I,D,A,B,J]);return j.jsxs(c("GeoVStack.react"),{children:[j.jsxs(c("GeoVStack.react"),{xstyle:s.uploadSection,children:[f==="icon"&&j.jsx(o,{}),f==="logo"&&j.jsx(p,{}),j.jsx(c("MWSDevicesAppImageDragDropUploadForm.react"),{appData:w,dispatch:x,imageType:f,isDisabled:!b,isLoading:F,itapCompanyID:i,loggerEventOrigin:e,showHeading:!1,testid:void 0})]}),y!=null&&j.jsx(c("GeoNotice.react"),{status:"error",children:y}),j.jsxs(c("GeoHStack.react"),{alignItems:"end",grow:1,justifyContent:"end",children:[j.jsx(c("GeoCancelButton.react"),{isDisabled:F,onClick:a}),j.jsx(c("GeoButton.react"),{disabledMessage:b?null:d("MWSDevicesStringUtils").Q4B_MISSING_PERMISSION_MSG,isDisabled:t||!b,isLoading:F,label:h._(/*BTDS*/"Save"),onClick:K,variant:"primary"})]})]})}a.displayName=a.name+" [from "+f.id+"]";function o(){return j.jsxs(j.Fragment,{children:[j.jsx(c("GeoHeading.react"),{level:3,children:d("MWSDevicesAppDetailsConstants").APP_VISUALS_APP_ICON_GUIDELINES_LABEL}),j.jsx(c("GeoBaseText.react"),{color:"placeholder",size:"value",xstyle:c("geoMargin").start24,children:j.jsxs("ul",{style:{listStyleType:"disc"},children:[j.jsx("li",{children:d("MWSDevicesAppDetailsConstants").APP_VISUALS_APP_ICON_GUIDELINES_DESCRIPTION}),j.jsx("li",{children:d("MWSDevicesAppDetailsConstants").APP_VISUALS_APP_ICON_DIMENSION_DESCRIPTION})]})})]})}o.displayName=o.name+" [from "+f.id+"]";function p(){return j.jsxs(j.Fragment,{children:[j.jsx(c("GeoHeading.react"),{level:3,children:d("MWSDevicesAppDetailsConstants").APP_VISUALS_APP_LOGO_GUIDELINES_LABEL}),j.jsx(c("GeoBaseText.react"),{color:"placeholder",size:"value",xstyle:c("geoMargin").start24,children:j.jsxs("ul",{style:{listStyleType:"disc"},children:[j.jsx("li",{children:d("MWSDevicesAppDetailsConstants").APP_VISUALS_APP_LOGO_GUIDELINES_DESCRIPTION}),j.jsx("li",{children:d("MWSDevicesAppDetailsConstants").APP_VISUALS_APP_LOGO_DIMENSION_DESCRIPTION})]})})]})}p.displayName=p.name+" [from "+f.id+"]";var q=h._(/*BTDS*/"Failed to update app icon. Please try again."),r=h._(/*BTDS*/"Failed to update app logo. Please try again."),s={uploadSection:{width:"x3hqpx7",$$css:!0}};g["default"]=a}),226);
-----
MWSDevicesAppSettingsPagePermissionSettings.react",["fbt","CometRelay","CometRelayErrorHandling","GeoButton.react","GeoCancelButton.react","GeoFlexbox.react","GeoHStack.react","GeoNotice.react","GeoVStack.react","MMAQPLUserFlow","MWSDevicesAppDetailsTabsMutation.graphql","MWSDevicesAppDetailsTabsMutationManagedPrivateAppMutation.graphql","MWSDevicesAppFormContext","MWSDevicesAppFormHelper","MWSDevicesAppFormReducer","MWSDevicesAppPermissionsForm.react","MWSDevicesAppPermissionsHelper","MWSDevicesStringUtils","RelayHooks","emptyFunction","geoMargin","isMWSDevicesAppFormValid","nullthrows","qpl","react","useGeoSelection"],(function(a,b,c,d,e,f,g,h){"use strict";var i,j=i||(i=d("react"));b=i;var k=b.useCallback,l=b.useEffect,m=b.useMemo,n=b.useReducer,o=b.useState;function a(a){var b=a.canManageApps,e=a.eventOrigin,f=a.isSelfHostedApp,g=a.itapCompanyID;a=a.itemID;var i=d("MWSDevicesAppFormContext").useMWSDevicesAppFormContext(),q=i.apkScanNotificationDict,r=d("CometRelay").useRelayEnvironment();i=d("MWSDevicesAppFormContext").useMWSDevicesAppFormContext();var s=i.appData,t=i.dispatch;i=n(d("MWSDevicesAppFormReducer").reducer,babelHelpers["extends"]({},s));var u=i[0],v=i[1],w=c("qpl")._(440735277,"762"),x=k(function(a){t(a),v(a)},[t,v]);i=o(null);var y=i[0],z=i[1];i=d("RelayHooks").useMutation(c("MWSDevicesAppDetailsTabsMutation.graphql"));var A=i[0],B=i[1];i=d("RelayHooks").useMutation(c("MWSDevicesAppDetailsTabsMutationManagedPrivateAppMutation.graphql"));var C=i[0],D=i[1];i=c("useGeoSelection")(a);a=i.toggleSelection;var E=m(function(){return D||B},[D,B]);i=m(function(){return E||!d("isMWSDevicesAppFormValid").isMWSDevicesAppPermissionSettingUpdatedWithUserData(u,s)},[s,u,E]);var F=k(function(){x({type:"SET_APP_PERMISSION_POLICIES",value:u.permissionPolicies})},[u.permissionPolicies,x]),G=k(function(a,b){var c;d("MWSDevicesAppFormHelper").logAppUpdateSuccessOrFailure(g,e,(c=s.appID)!=null?c:"",a);a&&(d("MMAQPLUserFlow").endSuccess(w),d("MWSDevicesAppFormHelper").logAppPermissionsUpdateSuccess(g,e,u,s));if(b){d("CometRelayErrorHandling").markErrorAsHandled(b);d("MMAQPLUserFlow").endCancelOrFailure(w,b,{annotations:{string:{cancelReason:b.toString(),www_request_id:(c=b.source)==null?void 0:c.www_request_id}}});d("MWSDevicesAppFormHelper").logAppPermissionsUpdateFailure(g,e,u,s)}},[s,u,e,g,w]),H=k(function(){d("MMAQPLUserFlow").start(w);if(f)A({onCompleted:function(){F(),G(!0)},onError:function(a){G(!1,a),z(p)},variables:{input:{permission_policies:d("MWSDevicesAppPermissionsHelper").getPermissionPoliciesForUpdate(u),remote_app_id:s.appID},refetch_app_details:!1}});else{var a;C({onCompleted:function(){F(),G(!0)},onError:function(a){G(!1,a),z(p)},variables:{input:{managed_app_id:(a=s.appID)!=null?a:"",permission_policies:d("MWSDevicesAppPermissionsHelper").getPermissionPoliciesForUpdate(u)}}})}},[s.appID,u,f,G,C,w,A,F]);l(function(){if(q[c("nullthrows")(s.appID)]!=null){var a=q[c("nullthrows")(s.appID)].apkParserStatus;s.apkParserStatus!==a&&(x({type:"UPDATE_APK_SCAN_RESULT",value:a}),a==="FINISHED"&&d("MWSDevicesAppPermissionsHelper").fetchPermissionsData(s.appID,c("emptyFunction"),r,x))}},[s,s.apkParserStatus,s.appID,q,r,x]);return j.jsxs(c("GeoVStack.react"),{children:[j.jsx(c("GeoFlexbox.react"),{xstyle:[c("geoMargin").top8,c("geoMargin").bottom24],children:j.jsxs(c("GeoVStack.react"),{children:[j.jsx(c("MWSDevicesAppPermissionsForm.react"),{eventOrigin:e,isDisabled:!b,itapCompanyID:g,propAppData:u,propDispatch:v}),y!=null&&j.jsx(c("GeoNotice.react"),{status:"error",children:y})]})}),j.jsxs(c("GeoHStack.react"),{alignItems:"end",grow:1,justifyContent:"end",children:[j.jsx(c("GeoCancelButton.react"),{isDisabled:E,onClick:a}),j.jsx(c("GeoButton.react"),{disabledMessage:b?null:d("MWSDevicesStringUtils").Q4B_MISSING_PERMISSION_MSG,isDisabled:i||!b,isLoading:E,label:h._(/*BTDS*/"Save"),onClick:H,variant:"primary"})]})]})}a.displayName=a.name+" [from "+f.id+"]";var p=h._(/*BTDS*/"Failed to update app permissions. Please try again.");g["default"]=a}),226);
-----
MWSDevicesAppDetailsTabsMutationManagedPrivateAppMutation_facebookRelayOperation",[],(function(a,b,c,d,e,f){e.exports="23922748687353196"}),null);
-----
-----
MWSDevicesAppVisualsPageTabAppImageEdit.react",["fbt","CometRelayErrorHandling","GeoBaseText.react","GeoButton.react","GeoCancelButton.react","GeoHStack.react","GeoHeading.react","GeoNotice.react","GeoVStack.react","MMAQPLUserFlow","MWSDevicesAppDetailsConstants","MWSDevicesAppDetailsTabsMutation.graphql","MWSDevicesAppDetailsTabsMutationManagedPrivateAppMutation.graphql","MWSDevicesAppFormContext","MWSDevicesAppFormHelper","MWSDevicesAppFormReducer","MWSDevicesAppImageDragDropUploadForm.react","MWSDevicesStringUtils","MWSDeviesAppAddModalHelper","RelayHooks","geoMargin","qpl","react","useGeoSelection"],(function(a,b,c,d,e,f,g,h){"use strict";var i,j=i||(i=d("react"));b=i;var k=b.useCallback,l=b.useMemo,m=b.useReducer,n=b.useState;function a(a){var b=a.canManageApps,e=a.eventOrigin,f=a.imageType,g=a.isSelfHostedApp,i=a.itapCompanyID;a=a.itemID;var t=d("MWSDevicesAppFormContext").useMWSDevicesAppFormContext(),u=t.appData,v=t.dispatch;t=m(d("MWSDevicesAppFormReducer").reducer,babelHelpers["extends"]({},u));var w=t[0],x=t[1];t=n(null);var y=t[0],z=t[1],A=c("qpl")._(440735277,"762");t=d("RelayHooks").useMutation(c("MWSDevicesAppDetailsTabsMutation.graphql"));var B=t[0],C=t[1];t=d("RelayHooks").useMutation(c("MWSDevicesAppDetailsTabsMutationManagedPrivateAppMutation.graphql"));var D=t[0],E=t[1];t=c("useGeoSelection")(a);a=t.toggleSelection;var F=l(function(){return E||C},[E,C]);t=l(function(){var a;return F||f==="icon"&&((a=u.icon)==null?void 0:a.id)===((a=w.icon)==null?void 0:a.id)||f==="logo"&&((a=u.logo)==null?void 0:a.id)===((a=w.logo)==null?void 0:a.id)},[(t=u.icon)==null?void 0:t.id,(t=u.logo)==null?void 0:t.id,(t=w.icon)==null?void 0:t.id,(t=w.logo)==null?void 0:t.id,f,F]);var G=k(function(a){var b;switch(f){case"icon":return g?(b=(b=a.update_library_app)==null||(b=b.remote_app)==null?void 0:b.images_icon)!=null?b:{}:(b=(b=a.xhw_q4b_update_managed_app_settings)==null||(b=b.private_app)==null?void 0:b.images_icon)!=null?b:{};case"logo":return g?(b=(b=a.update_library_app)==null||(b=b.remote_app)==null?void 0:b.images_logo)!=null?b:{}:(a=(b=a.xhw_q4b_update_managed_app_settings)==null||(b=b.private_app)==null?void 0:b.images_logo)!=null?a:{}}},[f,g]),H=k(function(a){a=G(a);var b=a.filename,c=a.id;a=a.image_uri;var d=f==="icon"?"UPDATE_APP_ICON":"UPDATE_APP_LOGO";v({type:d,value:{file:null,filename:b!=null?b:"",id:c,uri:a}});x({type:d,value:{file:null,filename:b!=null?b:"",id:c,uri:a}});x({type:"SET_APP_IMAGE_IDS_TO_DELETE",value:[]})},[v,G,f]),I=k(function(a,b){var c;d("MWSDevicesAppFormHelper").logAppUpdateSuccessOrFailure(i,e,(c=u.appID)!=null?c:"",a);a&&d("MMAQPLUserFlow").endSuccess(A);if(b){d("CometRelayErrorHandling").markErrorAsHandled(b);d("MMAQPLUserFlow").endCancelOrFailure(A,b,{annotations:{string:{cancelReason:b.toString(),www_request_id:(c=b.source)==null?void 0:c.www_request_id}}})}},[u.appID,e,i,A]),J=k(function(a,b,c){d("MWSDeviesAppAddModalHelper").handleImageLogging(b,c,e,i),H(a)},[e,i,H]),K=k(function(){z(null);var a=d("MWSDeviesAppAddModalHelper").getUploadablesData(w),b=a.iconUploaded,c=a.logoUploaded;a=a.uploadables;d("MMAQPLUserFlow").start(A);if(g){var e;B({onCompleted:function(a){J(a,c,b),I(!0)},onError:function(a){I(!1,a),z(f==="icon"?q:r)},uploadables:a,variables:{input:{app_icon:f==="icon"&&((e=w.icon)==null?void 0:e.file)!=null?"app_icon":null,app_logo:f==="logo"&&((e=w.logo)==null?void 0:e.file)!=null?"app_logo":null,images_to_delete:w.imageIDsToDelete,remote_app_id:u.appID},refetch_app_details:!1}})}else{D({onCompleted:function(a){J(a,c,b),I(!0)},onError:function(a){I(!1,a),z(f==="icon"?q:r)},uploadables:a,variables:{input:{image_settings:{app_icon:f==="icon"&&((e=w.icon)==null?void 0:e.file)!=null?"app_icon":null,app_logo:f==="logo"&&((a=w.logo)==null?void 0:a.file)!=null?"app_logo":null,images_to_delete:w.imageIDsToDelete},managed_app_id:(e=u.appID)!=null?e:""}}})}},[u.appID,w,f,g,I,D,A,B,J]);return j.jsxs(c("GeoVStack.react"),{children:[j.jsxs(c("GeoVStack.react"),{xstyle:s.uploadSection,children:[f==="icon"&&j.jsx(o,{}),f==="logo"&&j.jsx(p,{}),j.jsx(c("MWSDevicesAppImageDragDropUploadForm.react"),{appData:w,dispatch:x,imageType:f,isDisabled:!b,isLoading:F,itapCompanyID:i,loggerEventOrigin:e,showHeading:!1,testid:void 0})]}),y!=null&&j.jsx(c("GeoNotice.react"),{status:"error",children:y}),j.jsxs(c("GeoHStack.react"),{alignItems:"end",grow:1,justifyContent:"end",children:[j.jsx(c("GeoCancelButton.react"),{isDisabled:F,onClick:a}),j.jsx(c("GeoButton.react"),{disabledMessage:b?null:d("MWSDevicesStringUtils").Q4B_MISSING_PERMISSION_MSG,isDisabled:t||!b,isLoading:F,label:h._(/*BTDS*/"Save"),onClick:K,variant:"primary"})]})]})}a.displayName=a.name+" [from "+f.id+"]";function o(){return j.jsxs(j.Fragment,{children:[j.jsx(c("GeoHeading.react"),{level:3,children:d("MWSDevicesAppDetailsConstants").APP_VISUALS_APP_ICON_GUIDELINES_LABEL}),j.jsx(c("GeoBaseText.react"),{color:"placeholder",size:"value",xstyle:c("geoMargin").start24,children:j.jsxs("ul",{style:{listStyleType:"disc"},children:[j.jsx("li",{children:d("MWSDevicesAppDetailsConstants").APP_VISUALS_APP_ICON_GUIDELINES_DESCRIPTION}),j.jsx("li",{children:d("MWSDevicesAppDetailsConstants").APP_VISUALS_APP_ICON_DIMENSION_DESCRIPTION})]})})]})}o.displayName=o.name+" [from "+f.id+"]";function p(){return j.jsxs(j.Fragment,{children:[j.jsx(c("GeoHeading.react"),{level:3,children:d("MWSDevicesAppDetailsConstants").APP_VISUALS_APP_LOGO_GUIDELINES_LABEL}),j.jsx(c("GeoBaseText.react"),{color:"placeholder",size:"value",xstyle:c("geoMargin").start24,children:j.jsxs("ul",{style:{listStyleType:"disc"},children:[j.jsx("li",{children:d("MWSDevicesAppDetailsConstants").APP_VISUALS_APP_LOGO_GUIDELINES_DESCRIPTION}),j.jsx("li",{children:d("MWSDevicesAppDetailsConstants").APP_VISUALS_APP_LOGO_DIMENSION_DESCRIPTION})]})})]})}p.displayName=p.name+" [from "+f.id+"]";var q=h._(/*BTDS*/"Failed to update app icon. Please try again."),r=h._(/*BTDS*/"Failed to update app logo. Please try again."),s={uploadSection:{width:"x3hqpx7",$$css:!0}};g["default"]=a}),226);
-----
MWSDevicesAppSettingsPagePermissionSettings.react",["fbt","CometRelay","CometRelayErrorHandling","GeoButton.react","GeoCancelButton.react","GeoFlexbox.react","GeoHStack.react","GeoNotice.react","GeoVStack.react","MMAQPLUserFlow","MWSDevicesAppDetailsTabsMutation.graphql","MWSDevicesAppDetailsTabsMutationManagedPrivateAppMutation.graphql","MWSDevicesAppFormContext","MWSDevicesAppFormHelper","MWSDevicesAppFormReducer","MWSDevicesAppPermissionsForm.react","MWSDevicesAppPermissionsHelper","MWSDevicesStringUtils","RelayHooks","emptyFunction","geoMargin","isMWSDevicesAppFormValid","nullthrows","qpl","react","useGeoSelection"],(function(a,b,c,d,e,f,g,h){"use strict";var i,j=i||(i=d("react"));b=i;var k=b.useCallback,l=b.useEffect,m=b.useMemo,n=b.useReducer,o=b.useState;function a(a){var b=a.canManageApps,e=a.eventOrigin,f=a.isSelfHostedApp,g=a.itapCompanyID;a=a.itemID;var i=d("MWSDevicesAppFormContext").useMWSDevicesAppFormContext(),q=i.apkScanNotificationDict,r=d("CometRelay").useRelayEnvironment();i=d("MWSDevicesAppFormContext").useMWSDevicesAppFormContext();var s=i.appData,t=i.dispatch;i=n(d("MWSDevicesAppFormReducer").reducer,babelHelpers["extends"]({},s));var u=i[0],v=i[1],w=c("qpl")._(440735277,"762"),x=k(function(a){t(a),v(a)},[t,v]);i=o(null);var y=i[0],z=i[1];i=d("RelayHooks").useMutation(c("MWSDevicesAppDetailsTabsMutation.graphql"));var A=i[0],B=i[1];i=d("RelayHooks").useMutation(c("MWSDevicesAppDetailsTabsMutationManagedPrivateAppMutation.graphql"));var C=i[0],D=i[1];i=c("useGeoSelection")(a);a=i.toggleSelection;var E=m(function(){return D||B},[D,B]);i=m(function(){return E||!d("isMWSDevicesAppFormValid").isMWSDevicesAppPermissionSettingUpdatedWithUserData(u,s)},[s,u,E]);var F=k(function(){x({type:"SET_APP_PERMISSION_POLICIES",value:u.permissionPolicies})},[u.permissionPolicies,x]),G=k(function(a,b){var c;d("MWSDevicesAppFormHelper").logAppUpdateSuccessOrFailure(g,e,(c=s.appID)!=null?c:"",a);a&&(d("MMAQPLUserFlow").endSuccess(w),d("MWSDevicesAppFormHelper").logAppPermissionsUpdateSuccess(g,e,u,s));if(b){d("CometRelayErrorHandling").markErrorAsHandled(b);d("MMAQPLUserFlow").endCancelOrFailure(w,b,{annotations:{string:{cancelReason:b.toString(),www_request_id:(c=b.source)==null?void 0:c.www_request_id}}});d("MWSDevicesAppFormHelper").logAppPermissionsUpdateFailure(g,e,u,s)}},[s,u,e,g,w]),H=k(function(){d("MMAQPLUserFlow").start(w);if(f)A({onCompleted:function(){F(),G(!0)},onError:function(a){G(!1,a),z(p)},variables:{input:{permission_policies:d("MWSDevicesAppPermissionsHelper").getPermissionPoliciesForUpdate(u),remote_app_id:s.appID},refetch_app_details:!1}});else{var a;C({onCompleted:function(){F(),G(!0)},onError:function(a){G(!1,a),z(p)},variables:{input:{managed_app_id:(a=s.appID)!=null?a:"",permission_policies:d("MWSDevicesAppPermissionsHelper").getPermissionPoliciesForUpdate(u)}}})}},[s.appID,u,f,G,C,w,A,F]);l(function(){if(q[c("nullthrows")(s.appID)]!=null){var a=q[c("nullthrows")(s.appID)].apkParserStatus;s.apkParserStatus!==a&&(x({type:"UPDATE_APK_SCAN_RESULT",value:a}),a==="FINISHED"&&d("MWSDevicesAppPermissionsHelper").fetchPermissionsData(s.appID,c("emptyFunction"),r,x))}},[s,s.apkParserStatus,s.appID,q,r,x]);return j.jsxs(c("GeoVStack.react"),{children:[j.jsx(c("GeoFlexbox.react"),{xstyle:[c("geoMargin").top8,c("geoMargin").bottom24],children:j.jsxs(c("GeoVStack.react"),{children:[j.jsx(c("MWSDevicesAppPermissionsForm.react"),{eventOrigin:e,isDisabled:!b,itapCompanyID:g,propAppData:u,propDispatch:v}),y!=null&&j.jsx(c("GeoNotice.react"),{status:"error",children:y})]})}),j.jsxs(c("GeoHStack.react"),{alignItems:"end",grow:1,justifyContent:"end",children:[j.jsx(c("GeoCancelButton.react"),{isDisabled:E,onClick:a}),j.jsx(c("GeoButton.react"),{disabledMessage:b?null:d("MWSDevicesStringUtils").Q4B_MISSING_PERMISSION_MSG,isDisabled:i||!b,isLoading:E,label:h._(/*BTDS*/"Save"),onClick:H,variant:"primary"})]})]})}a.displayName=a.name+" [from "+f.id+"]";var p=h._(/*BTDS*/"Failed to update app permissions. Please try again.");g["default"]=a}),226);
-----
MWSDevicesAppDetailsTabsMutationManagedPrivateAppMutation_facebookRelayOperation",[],(function(a,b,c,d,e,f){e.exports="23922748687353196"}),null);
-----