@wellesley/settings 1.0.639 → 1.0.641

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.mjs +3 -3
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import{createAction as Ds,createSlice as Fs,createSelector as Ct}from"https://cdn.jsdelivr.net/npm/@reduxjs/toolkit@2.2.1/+esm";import jy,{useState as Ly,useEffect as My,forwardRef as Bs,createElement as No}from"https://cdn.jsdelivr.net/npm/react@18.2.0/+esm";import{Checkbox as Wy,RadioGroup as Ny,RadioGroupItem as Ty,TooltipProvider as Dy,Tooltip as Fy,TooltipTrigger as By,Label as zy,TooltipContent as Uy,Select as Vy,SelectTrigger as qy,SelectValue as $y,SelectContent as Ky,SelectGroup as Qy,SelectItem as Gy,Switch as Jy,Input as Yy,cn as Zy}from"https://cdn.jsdelivr.net/npm/@wellesley/ui@1.0.644";import{useForm as Hy,FormProvider as Xy}from"https://cdn.jsdelivr.net/npm/react-hook-form@7.51.0/+esm";import{useSelector as Et}from"https://cdn.jsdelivr.net/npm/react-redux@9.1.0/+esm";import{toast as $e}from"https://cdn.jsdelivr.net/npm/@wellesley/system-toast@1.0.26";import{api as Ze,QueryTags as _s}from"https://cdn.jsdelivr.net/npm/@wellesley/openapi@1.0.682";import{getErrorMsg as Xn}from"https://cdn.jsdelivr.net/npm/@wellesley/error-kit@1.0.533";import{authSlice as Gr,useHasUserPermissions as e_}from"https://cdn.jsdelivr.net/npm/@wellesley/auth@1.0.738";import{userSlice as vs}from"https://cdn.jsdelivr.net/npm/@wellesley/user@1.0.697";import{AppsLink as t_}from"https://cdn.jsdelivr.net/npm/@wellesley/router@1.0.610";import{useMatch as ms}from"https://cdn.jsdelivr.net/npm/react-router-dom@6.22.2/+esm";const r_=t=>{if("object"!=typeof t||null===t)return!1;let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e||null===Object.getPrototypeOf(t)},n_=t=>r_(t)&&"type"in t&&"string"==typeof t.type,Y=t=>{const e=e=>({type:t,payload:e});return e.toString=()=>`${t}`,e.type=t,e.match=e=>n_(e)&&e.type===t,e};Y("remoteReady"),Y("askLogin"),Y("reselectUser"),Y("requestLogout"),Y("setConfirmLeavePage"),Y("requestChangePath"),Y("wsSubscribe"),Y("wsUnSubscribe"),Y("hostStoreConnect"),Y("remoteLogin"),Y("remoteLogout"),Y("wsOnMessage"),Y("setRouterPath"),Y("setDeviceType"),Y("setUserError"),Y("setUserIsError"),Y("setUserPending"),Y("setUserSuccess"),Y("setUserData"),Y("updateAccountData"),Y("updateUser"),Y("addNotification"),Y("markNotification"),Y("setNotificationsError"),Y("setNotificationsList"),Y("setNotificationsPending"),Y("setNotificationsTotalCount"),Y("setNotificationsUnreadCount"),Y("resetNotificationsState"),Y("undoNotification"),Y("setInstanceInfo"),Y("setInstanceInfoPending"),Y("setInstanceInfoError");const To=Y("setPlatformSettings"),Do=Y("setProfileSettings");Y("setGroupData"),Y("setGroupLoading"),Ds("requestMicroFrontendFetch"),Ds("sendMicroFrontendFetchResponse");const i_={data:null,isPending:!1,isSuccess:!1},o_=Fs({name:"profileSettings",initialState:i_,reducers:{setPending:(t,e)=>{t.isPending=e.payload},setSuccess:(t,{payload:e})=>{t.isSuccess=e},setError:(t,{payload:e})=>{t.error=e}},extraReducers:t=>{t.addCase(Do,((t,{payload:e})=>{t.data=e}))},selectors:{selectProfileSettings:t=>t.data,selectPending:t=>t.isPending,selectError:t=>t.error,selectSuccess:t=>t.isSuccess}}),L={openaiConfigModel:"wellesley.openai.config.model",openaiConfigApiKey:"wellesley.openai.config.apiKey",uploadsProvider:"wellesley.uploads.provider",uploadsS3:"wellesley.uploads.s3",uploadsPolicyImageExtensions:"wellesley.uploads.policy.image.extensions",uploadsPolicyImageKeepOriginal:"wellesley.uploads.policy.image.keepOriginal",uploadsPolicyImageResolutions:"wellesley.uploads.policy.image.resolutions",uploadsPolicyImageMaxResolution:"wellesley.uploads.policy.image.maxResolution",uploadsPolicyImageMaxMatrix:"wellesley.uploads.policy.image.maxMatrix",uploadsPolicyImageMaxSize:"wellesley.uploads.policy.image.maxSize",uploadsPolicyVideoExtensions:"wellesley.uploads.policy.video.extensions",uploadsPolicyVideoResolutions:"wellesley.uploads.policy.video.resolutions",uploadsPolicyVideoKeepOriginal:"wellesley.uploads.policy.video.keepOriginal",uploadsPolicyVideoMaxResolution:"wellesley.uploads.policy.video.maxResolution",uploadsPolicyVideoMaxMatrix:"wellesley.uploads.policy.video.maxMatrix",uploadsPolicyVideoMaxSize:"wellesley.uploads.policy.video.maxSize",uploadsPolicyVideoMaxDuration:"wellesley.uploads.policy.video.maxDuration",uploadsPolicyVideoStreamingThreshold:"wellesley.uploads.policy.video.streamingThreshold",uploadsPolicyAudioExtensions:"wellesley.uploads.policy.audio.extensions",uploadsPolicyAudioKeepOriginal:"wellesley.uploads.policy.audio.keepOriginal",uploadsPolicyAudioMaxSize:"wellesley.uploads.policy.audio.maxSize",uploadsPolicyDocExtensions:"wellesley.uploads.policy.doc.extensions",uploadsPolicyDocMaxSize:"wellesley.uploads.policy.doc.maxSize",mediacacheEnabled:"wellesley.mediacache.enabled",mediacacheMaxTotalSize:"wellesley.mediacache.maxTotalSize",mediacacheMaxFileSize:"wellesley.mediacache.maxFileSize",mediacacheLimitPerRun:"wellesley.mediacache.limitPerRun",mediacacheSingleRun:"wellesley.mediacache.singleRun",mediacacheCheckInterval:"wellesley.mediacache.checkInterval",postsMaxMediaAttachments:"wellesley.posts.max_media_attachments",postsMaxCharacters:"wellesley.posts.max_characters",postsMaxPins:"wellesley.posts.max_pins",registrationMode:"wellesley.registration.mode",registrationInvitesEnabled:"wellesley.registration.invitesEnabled",registrationReasonToJoin:"wellesley.registration.reasonToJoin",registrationShowCaptcha:"wellesley.registration.showCaptcha",registrationNotAvailableMessage:"wellesley.registration.notAvailableMessage",captchaVerifyUrl:"wellesley.captcha.verifyUrl",captchaSecretKey:"wellesley.captcha.secretKey",captchaSiteKey:"wellesley.captcha.siteKey",confirmationCodeCodeExpirationMinutes:"wellesley.confirmationCode.codeExpirationMinutes",confirmationCodeCounterExpirationMinutes:"wellesley.confirmationCode.counterExpirationMinutes",confirmationCodeLimitStoreAttempts:"wellesley.confirmationCode.limitStoreAttempts",confirmationCodeLimitCheckAttempts:"wellesley.confirmationCode.limitCheckAttempts",translation:"wellesley.translation"},Jv=[L.uploadsPolicyImageExtensions,L.uploadsPolicyImageKeepOriginal,L.uploadsPolicyImageResolutions,L.uploadsPolicyImageMaxResolution,L.uploadsPolicyImageMaxMatrix,L.uploadsPolicyImageMaxSize,L.uploadsPolicyVideoExtensions,L.uploadsPolicyVideoResolutions,L.uploadsPolicyVideoKeepOriginal,L.uploadsPolicyVideoMaxResolution,L.uploadsPolicyVideoMaxMatrix,L.uploadsPolicyVideoMaxSize,L.uploadsPolicyVideoMaxDuration,L.uploadsPolicyVideoStreamingThreshold,L.uploadsPolicyAudioExtensions,L.uploadsPolicyAudioKeepOriginal,L.uploadsPolicyAudioMaxSize,L.uploadsPolicyDocExtensions,L.uploadsPolicyDocMaxSize,L.mediacacheEnabled,L.mediacacheMaxTotalSize,L.mediacacheMaxFileSize,L.mediacacheLimitPerRun,L.mediacacheSingleRun,L.mediacacheCheckInterval,L.postsMaxMediaAttachments,L.postsMaxCharacters,L.postsMaxPins,L.registrationMode,L.registrationInvitesEnabled,L.registrationReasonToJoin,L.registrationShowCaptcha,L.registrationNotAvailableMessage],Yv="wellesley",_e={followAutoAccept:"user.follow.autoAccept",notificationsPrefsFollow:"user.notifications.prefs.follow",notificationsPrefsFollow_request:"user.notifications.prefs.followRequest",notificationsPrefsLike:"user.notifications.prefs.like",notificationsPrefsComment:"user.notifications.prefs.comment",notificationsPrefsMention:"user.notifications.prefs.mention",notificationsPrefsRepost:"user.notifications.prefs.repost",notificationsPrefsList_post_create:"user.notifications.prefs.list_post_create",notificationsPrefsPost_update:"user.notifications.prefs.post_update",notificationsPrefsSubscribeOnComment:"user.notifications.prefs.subscribeOnComment",notificationsPrefsAlwaysSendEmail:"user.notifications.prefs.alwaysSendEmail",notificationsShowPopup:"user.notifications.prefs.showPopup",notificationsPolicyBlockNonFollowers:"user.notifications.policy.blockNonFollowers",notificationsPolicyBlockNonFollowing:"user.notifications.policy.blockNonFollowing",notificationsPolicyBlockNonFollowingMessages:"user.notifications.policy.blockNonFollowingMessages",notificationsPolicyBlockNewAccounts:"user.notifications.policy.blockNewAccounts",privacyShowPublicPosts:"user.privacy.showPublicPosts",privacyShowProfilePage:"user.privacy.showProfilePage",privacyShowFollowers:"user.privacy.showFollowers",translation:"user.translation"},Zv="user",a_=["wellesley.posts","wellesley.captcha","wellesley.registration","wellesley.access","wellesley.branding","wellesley.confirmationCode","wellesley.uploads.policy.doc","wellesley.uploads.policy.audio","wellesley.uploads.policy.image","wellesley.uploads.policy.video","wellesley.translation","wellesley.instance.admin","wellesley.instance.legal","wellesley.instance.domainBlocks","wellesley.instance.contacts"],u_=["wellesley.admin.sms","wellesley.admin.auth","wellesley.admin.openai","wellesley.admin.uploads","wellesley.admin.captcha","wellesley.admin.language","wellesley.admin.mediacache","wellesley.admin.translation","wellesley.admin.link_service"],s_={sms:"wellesley.admin.sms",auth:"wellesley.admin.auth",openai:"wellesley.admin.openai",uploads:"wellesley.admin.uploads",captcha:"wellesley.admin.captcha",language:"wellesley.admin.language",mediacache:"wellesley.admin.mediacache",translation:"wellesley.admin.translation",link_service:"wellesley.admin.link_service"},ni={posts:"wellesley.posts",translation:"wellesley.translation",registration:"wellesley.registration",confirmationCode:"wellesley.confirmationCode",uploadsPolicyDoc:"wellesley.uploads.policy.doc",uploadsPolicyAudio:"wellesley.uploads.policy.audio",uploadsPolicyImage:"wellesley.uploads.policy.image",uploadsPolicyVideo:"wellesley.uploads.policy.video",captcha:"wellesley.captcha",access:"wellesley.access",branding:"wellesley.branding",instanceAdmin:"wellesley.instance.admin",legal:"wellesley.instance.legal",domainBlocks:"wellesley.instance.domainBlocks",contacts:"wellesley.instance.contacts"},$r=t=>(null==t?void 0:t.map((t=>t.value||t)))||[],c_={data:null,isPending:!1},{posts:Ro,uploadsPolicyDoc:ws,uploadsPolicyAudio:ko,uploadsPolicyImage:ei,uploadsPolicyVideo:Vr,registration:l_,captcha:f_,instanceAdmin:p_,branding:h_,translation:d_,access:g_}=ni,{captcha:y_,language:__,translation:v_,openai:m_,link_service:w_}=s_,hr=t=>t.data,x_=Ct(hr,(t=>{var e,n,r;return{max_characters:(null==(e=null==t?void 0:t[Ro])?void 0:e.max_characters)||0,max_media_attachments:(null==(n=null==t?void 0:t[Ro])?void 0:n.max_media_attachments)||0,max_pins:(null==(r=null==t?void 0:t[Ro])?void 0:r.max_pins)||0}})),Bo=Ct(hr,(t=>{var e,n,r;return{...null==t?void 0:t[ei],maxSize:(null==(e=null==t?void 0:t[ei])?void 0:e.maxSize)||0,maxMatrix:(null==(n=null==t?void 0:t[ei])?void 0:n.maxMatrix)||0,maxResolution:(null==(r=null==t?void 0:t[ei])?void 0:r.maxResolution)||0}})),S_=Ct(Bo,(t=>$r(t.extensions))),zs=Ct(hr,(t=>{var e,n,r,i;return{...null==t?void 0:t[Vr],maxSize:(null==(e=null==t?void 0:t[Vr])?void 0:e.maxSize)||0,maxMatrix:(null==(n=null==t?void 0:t[Vr])?void 0:n.maxMatrix)||0,maxDuration:(null==(r=null==t?void 0:t[Vr])?void 0:r.maxDuration)||0,maxResolution:(null==(i=null==t?void 0:t[Vr])?void 0:i.maxResolution)||0}})),Us=Ct(hr,(t=>{var e,n;return{...null==t?void 0:t[ko],maxSize:null==(e=null==t?void 0:t[ko])?void 0:e.maxSize,keepOriginal:(null==(n=null==t?void 0:t[ko])?void 0:n.keepOriginal)||0}})),Vs=Ct(hr,(t=>{var e;return{...null==t?void 0:t[ws],maxSize:(null==(e=null==t?void 0:t[ws])?void 0:e.maxSize)||0}})),qs=Ct([Bo,zs,Us,Vs],((t,e,n,r)=>({IMAGE:$r(null==t?void 0:t.extensions),VIDEO:$r(null==e?void 0:e.extensions),AUDIO:$r(null==n?void 0:n.extensions),DOCUMENT:$r(null==r?void 0:r.extensions)}))),b_=Ct(qs,(t=>Object.keys(t).reduce(((e,n)=>[...e,...t[n]||[]]),[]))),Po=Fs({name:"platformSettings",initialState:c_,reducers:{setError:(t,e)=>{t.error=e.payload},setPending:(t,e)=>{t.isPending=e.payload}},extraReducers:t=>{t.addCase(To,((t,{payload:e})=>{t.data={...t.data,...e}}))},selectors:{selectSettings:hr,selectPostConfig:x_,selectDocPolicy:Vs,selectImagePolicy:Bo,selectVideoPolicy:zs,selectAudioPolicy:Us,selectImageExtensions:S_,selectSupportedExtensions:qs,selectFullExtensionsList:b_,selectRegistration:t=>{var e;return null==(e=t.data)?void 0:e[l_]},selectLanguageDetection:t=>{var e;return null==(e=t.data)?void 0:e[__]},selectLanguageTranslation:t=>{var e;return null==(e=t.data)?void 0:e[v_]},selectOpenai:t=>{var e;return null==(e=t.data)?void 0:e[m_]},selectCaptcha:t=>{var e;return null==(e=t.data)?void 0:e[f_]},selectAdminCaptcha:t=>{var e;return null==(e=t.data)?void 0:e[y_]},selectPlatformTranslation:t=>{var e;return null==(e=t.data)?void 0:e[d_]},selectAccess:t=>{var e;return null==(e=t.data)?void 0:e[g_]},selectBranding:t=>{var e;return null==(e=t.data)?void 0:e[h_]},selectLinkService:t=>{var e;return null==(e=t.data)?void 0:e[w_]},selectInstanceAdmin:t=>{var e;return null==(e=t.data)?void 0:e[p_]},selectLegal:t=>{var e;return null==(e=t.data)?void 0:e[ni.legal]},selectDomainBlocks:t=>{var e;return null==(e=t.data)?void 0:e[ni.domainBlocks]},selectContacts:t=>{var e;return null==(e=t.data)?void 0:e[ni.contacts]}}});var xs,Ss,ti=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Eo={exports:{}},qr={};
1
+ import{createAction as Ds,createSlice as Fs,createSelector as Ct}from"https://cdn.jsdelivr.net/npm/@reduxjs/toolkit@2.2.1/+esm";import jy,{useState as Ly,useEffect as My,forwardRef as Bs,createElement as No}from"https://cdn.jsdelivr.net/npm/react@18.2.0/+esm";import{Checkbox as Wy,RadioGroup as Ny,RadioGroupItem as Ty,TooltipProvider as Dy,Tooltip as Fy,TooltipTrigger as By,Label as zy,TooltipContent as Uy,Select as Vy,SelectTrigger as qy,SelectValue as $y,SelectContent as Ky,SelectGroup as Qy,SelectItem as Gy,Switch as Jy,Input as Yy,cn as Zy}from"https://cdn.jsdelivr.net/npm/@wellesley/ui@1.0.646";import{useForm as Hy,FormProvider as Xy}from"https://cdn.jsdelivr.net/npm/react-hook-form@7.51.0/+esm";import{useSelector as Et}from"https://cdn.jsdelivr.net/npm/react-redux@9.1.0/+esm";import{toast as $e}from"https://cdn.jsdelivr.net/npm/@wellesley/system-toast@1.0.28";import{api as Ze,QueryTags as _s}from"https://cdn.jsdelivr.net/npm/@wellesley/openapi@1.0.684";import{getErrorMsg as Xn}from"https://cdn.jsdelivr.net/npm/@wellesley/error-kit@1.0.535";import{authSlice as Gr,useHasUserPermissions as e_}from"https://cdn.jsdelivr.net/npm/@wellesley/auth@1.0.740";import{userSlice as vs}from"https://cdn.jsdelivr.net/npm/@wellesley/user@1.0.699";import{AppsLink as t_}from"https://cdn.jsdelivr.net/npm/@wellesley/router@1.0.612";import{useMatch as ms}from"https://cdn.jsdelivr.net/npm/react-router-dom@6.22.2/+esm";const r_=t=>{if("object"!=typeof t||null===t)return!1;let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e||null===Object.getPrototypeOf(t)},n_=t=>r_(t)&&"type"in t&&"string"==typeof t.type,Y=t=>{const e=e=>({type:t,payload:e});return e.toString=()=>`${t}`,e.type=t,e.match=e=>n_(e)&&e.type===t,e};Y("remoteReady"),Y("askLogin"),Y("reselectUser"),Y("requestLogout"),Y("setConfirmLeavePage"),Y("requestChangePath"),Y("wsSubscribe"),Y("wsUnSubscribe"),Y("hostStoreConnect"),Y("remoteLogin"),Y("remoteLogout"),Y("wsOnMessage"),Y("setRouterPath"),Y("setDeviceType"),Y("setUserError"),Y("setUserIsError"),Y("setUserPending"),Y("setUserSuccess"),Y("setUserData"),Y("updateAccountData"),Y("updateUser"),Y("addNotification"),Y("markNotification"),Y("setNotificationsError"),Y("setNotificationsList"),Y("setNotificationsPending"),Y("setNotificationsTotalCount"),Y("setNotificationsUnreadCount"),Y("resetNotificationsState"),Y("undoNotification"),Y("setInstanceInfo"),Y("setInstanceInfoPending"),Y("setInstanceInfoError");const To=Y("setPlatformSettings"),Do=Y("setProfileSettings");Y("setGroupData"),Y("setGroupLoading"),Ds("requestMicroFrontendFetch"),Ds("sendMicroFrontendFetchResponse");const i_={data:null,isPending:!1,isSuccess:!1},o_=Fs({name:"profileSettings",initialState:i_,reducers:{setPending:(t,e)=>{t.isPending=e.payload},setSuccess:(t,{payload:e})=>{t.isSuccess=e},setError:(t,{payload:e})=>{t.error=e}},extraReducers:t=>{t.addCase(Do,((t,{payload:e})=>{t.data=e}))},selectors:{selectProfileSettings:t=>t.data,selectPending:t=>t.isPending,selectError:t=>t.error,selectSuccess:t=>t.isSuccess}}),L={openaiConfigModel:"wellesley.openai.config.model",openaiConfigApiKey:"wellesley.openai.config.apiKey",uploadsProvider:"wellesley.uploads.provider",uploadsS3:"wellesley.uploads.s3",uploadsPolicyImageExtensions:"wellesley.uploads.policy.image.extensions",uploadsPolicyImageKeepOriginal:"wellesley.uploads.policy.image.keepOriginal",uploadsPolicyImageResolutions:"wellesley.uploads.policy.image.resolutions",uploadsPolicyImageMaxResolution:"wellesley.uploads.policy.image.maxResolution",uploadsPolicyImageMaxMatrix:"wellesley.uploads.policy.image.maxMatrix",uploadsPolicyImageMaxSize:"wellesley.uploads.policy.image.maxSize",uploadsPolicyVideoExtensions:"wellesley.uploads.policy.video.extensions",uploadsPolicyVideoResolutions:"wellesley.uploads.policy.video.resolutions",uploadsPolicyVideoKeepOriginal:"wellesley.uploads.policy.video.keepOriginal",uploadsPolicyVideoMaxResolution:"wellesley.uploads.policy.video.maxResolution",uploadsPolicyVideoMaxMatrix:"wellesley.uploads.policy.video.maxMatrix",uploadsPolicyVideoMaxSize:"wellesley.uploads.policy.video.maxSize",uploadsPolicyVideoMaxDuration:"wellesley.uploads.policy.video.maxDuration",uploadsPolicyVideoStreamingThreshold:"wellesley.uploads.policy.video.streamingThreshold",uploadsPolicyAudioExtensions:"wellesley.uploads.policy.audio.extensions",uploadsPolicyAudioKeepOriginal:"wellesley.uploads.policy.audio.keepOriginal",uploadsPolicyAudioMaxSize:"wellesley.uploads.policy.audio.maxSize",uploadsPolicyDocExtensions:"wellesley.uploads.policy.doc.extensions",uploadsPolicyDocMaxSize:"wellesley.uploads.policy.doc.maxSize",mediacacheEnabled:"wellesley.mediacache.enabled",mediacacheMaxTotalSize:"wellesley.mediacache.maxTotalSize",mediacacheMaxFileSize:"wellesley.mediacache.maxFileSize",mediacacheLimitPerRun:"wellesley.mediacache.limitPerRun",mediacacheSingleRun:"wellesley.mediacache.singleRun",mediacacheCheckInterval:"wellesley.mediacache.checkInterval",postsMaxMediaAttachments:"wellesley.posts.max_media_attachments",postsMaxCharacters:"wellesley.posts.max_characters",postsMaxPins:"wellesley.posts.max_pins",registrationMode:"wellesley.registration.mode",registrationInvitesEnabled:"wellesley.registration.invitesEnabled",registrationReasonToJoin:"wellesley.registration.reasonToJoin",registrationShowCaptcha:"wellesley.registration.showCaptcha",registrationNotAvailableMessage:"wellesley.registration.notAvailableMessage",captchaVerifyUrl:"wellesley.captcha.verifyUrl",captchaSecretKey:"wellesley.captcha.secretKey",captchaSiteKey:"wellesley.captcha.siteKey",confirmationCodeCodeExpirationMinutes:"wellesley.confirmationCode.codeExpirationMinutes",confirmationCodeCounterExpirationMinutes:"wellesley.confirmationCode.counterExpirationMinutes",confirmationCodeLimitStoreAttempts:"wellesley.confirmationCode.limitStoreAttempts",confirmationCodeLimitCheckAttempts:"wellesley.confirmationCode.limitCheckAttempts",translation:"wellesley.translation"},Jv=[L.uploadsPolicyImageExtensions,L.uploadsPolicyImageKeepOriginal,L.uploadsPolicyImageResolutions,L.uploadsPolicyImageMaxResolution,L.uploadsPolicyImageMaxMatrix,L.uploadsPolicyImageMaxSize,L.uploadsPolicyVideoExtensions,L.uploadsPolicyVideoResolutions,L.uploadsPolicyVideoKeepOriginal,L.uploadsPolicyVideoMaxResolution,L.uploadsPolicyVideoMaxMatrix,L.uploadsPolicyVideoMaxSize,L.uploadsPolicyVideoMaxDuration,L.uploadsPolicyVideoStreamingThreshold,L.uploadsPolicyAudioExtensions,L.uploadsPolicyAudioKeepOriginal,L.uploadsPolicyAudioMaxSize,L.uploadsPolicyDocExtensions,L.uploadsPolicyDocMaxSize,L.mediacacheEnabled,L.mediacacheMaxTotalSize,L.mediacacheMaxFileSize,L.mediacacheLimitPerRun,L.mediacacheSingleRun,L.mediacacheCheckInterval,L.postsMaxMediaAttachments,L.postsMaxCharacters,L.postsMaxPins,L.registrationMode,L.registrationInvitesEnabled,L.registrationReasonToJoin,L.registrationShowCaptcha,L.registrationNotAvailableMessage],Yv="wellesley",Ae={followAutoAccept:"user.follow.autoAccept",notificationsPrefsFollow:"user.notifications.prefs.email.follow",notificationsPrefsFollow_request:"user.notifications.prefs.email.followRequest",notificationsPrefsLike:"user.notifications.prefs.email.like",notificationsPrefsComment:"user.notifications.prefs.email.comment",notificationsPrefsMention:"user.notifications.prefs.email.mention",notificationsPrefsRepost:"user.notifications.prefs.email.repost",notificationsPrefsList_post_create:"user.notifications.prefs.email.list_post_create",notificationsPrefsPost_update:"user.notifications.prefs.email.post_update",notificationsPrefsSubscribeOnComment:"user.notifications.prefs.subscribeOnComment",notificationsShowPopup:"user.notifications.prefs.showPopup",notificationsPolicyBlockNonFollowers:"user.notifications.policy.blockNonFollowers",notificationsPolicyBlockNonFollowing:"user.notifications.policy.blockNonFollowing",notificationsPolicyBlockNonFollowingMessages:"user.notifications.policy.blockNonFollowingMessages",notificationsPolicyBlockNewAccounts:"user.notifications.policy.blockNewAccounts",privacyShowPublicPosts:"user.privacy.showPublicPosts",privacyShowProfilePage:"user.privacy.showProfilePage",privacyShowFollowers:"user.privacy.showFollowers",translation:"user.translation"},Zv="user",a_=["wellesley.posts","wellesley.captcha","wellesley.registration","wellesley.access","wellesley.branding","wellesley.confirmationCode","wellesley.uploads.policy.doc","wellesley.uploads.policy.audio","wellesley.uploads.policy.image","wellesley.uploads.policy.video","wellesley.translation","wellesley.instance.admin","wellesley.instance.legal","wellesley.instance.domainBlocks","wellesley.instance.contacts"],u_=["wellesley.admin.sms","wellesley.admin.auth","wellesley.admin.openai","wellesley.admin.uploads","wellesley.admin.captcha","wellesley.admin.language","wellesley.admin.mediacache","wellesley.admin.translation","wellesley.admin.link_service"],s_={sms:"wellesley.admin.sms",auth:"wellesley.admin.auth",openai:"wellesley.admin.openai",uploads:"wellesley.admin.uploads",captcha:"wellesley.admin.captcha",language:"wellesley.admin.language",mediacache:"wellesley.admin.mediacache",translation:"wellesley.admin.translation",link_service:"wellesley.admin.link_service"},ni={posts:"wellesley.posts",translation:"wellesley.translation",registration:"wellesley.registration",confirmationCode:"wellesley.confirmationCode",uploadsPolicyDoc:"wellesley.uploads.policy.doc",uploadsPolicyAudio:"wellesley.uploads.policy.audio",uploadsPolicyImage:"wellesley.uploads.policy.image",uploadsPolicyVideo:"wellesley.uploads.policy.video",captcha:"wellesley.captcha",access:"wellesley.access",branding:"wellesley.branding",instanceAdmin:"wellesley.instance.admin",legal:"wellesley.instance.legal",domainBlocks:"wellesley.instance.domainBlocks",contacts:"wellesley.instance.contacts"},$r=t=>(null==t?void 0:t.map((t=>t.value||t)))||[],c_={data:null,isPending:!1},{posts:Ro,uploadsPolicyDoc:ws,uploadsPolicyAudio:ko,uploadsPolicyImage:ei,uploadsPolicyVideo:Vr,registration:l_,captcha:f_,instanceAdmin:p_,branding:h_,translation:d_,access:g_}=ni,{captcha:y_,language:__,translation:v_,openai:m_,link_service:w_}=s_,hr=t=>t.data,x_=Ct(hr,(t=>{var e,n,r;return{max_characters:(null==(e=null==t?void 0:t[Ro])?void 0:e.max_characters)||0,max_media_attachments:(null==(n=null==t?void 0:t[Ro])?void 0:n.max_media_attachments)||0,max_pins:(null==(r=null==t?void 0:t[Ro])?void 0:r.max_pins)||0}})),Bo=Ct(hr,(t=>{var e,n,r;return{...null==t?void 0:t[ei],maxSize:(null==(e=null==t?void 0:t[ei])?void 0:e.maxSize)||0,maxMatrix:(null==(n=null==t?void 0:t[ei])?void 0:n.maxMatrix)||0,maxResolution:(null==(r=null==t?void 0:t[ei])?void 0:r.maxResolution)||0}})),S_=Ct(Bo,(t=>$r(t.extensions))),zs=Ct(hr,(t=>{var e,n,r,i;return{...null==t?void 0:t[Vr],maxSize:(null==(e=null==t?void 0:t[Vr])?void 0:e.maxSize)||0,maxMatrix:(null==(n=null==t?void 0:t[Vr])?void 0:n.maxMatrix)||0,maxDuration:(null==(r=null==t?void 0:t[Vr])?void 0:r.maxDuration)||0,maxResolution:(null==(i=null==t?void 0:t[Vr])?void 0:i.maxResolution)||0}})),Us=Ct(hr,(t=>{var e,n;return{...null==t?void 0:t[ko],maxSize:null==(e=null==t?void 0:t[ko])?void 0:e.maxSize,keepOriginal:(null==(n=null==t?void 0:t[ko])?void 0:n.keepOriginal)||0}})),Vs=Ct(hr,(t=>{var e;return{...null==t?void 0:t[ws],maxSize:(null==(e=null==t?void 0:t[ws])?void 0:e.maxSize)||0}})),qs=Ct([Bo,zs,Us,Vs],((t,e,n,r)=>({IMAGE:$r(null==t?void 0:t.extensions),VIDEO:$r(null==e?void 0:e.extensions),AUDIO:$r(null==n?void 0:n.extensions),DOCUMENT:$r(null==r?void 0:r.extensions)}))),b_=Ct(qs,(t=>Object.keys(t).reduce(((e,n)=>[...e,...t[n]||[]]),[]))),Po=Fs({name:"platformSettings",initialState:c_,reducers:{setError:(t,e)=>{t.error=e.payload},setPending:(t,e)=>{t.isPending=e.payload}},extraReducers:t=>{t.addCase(To,((t,{payload:e})=>{t.data={...t.data,...e}}))},selectors:{selectSettings:hr,selectPostConfig:x_,selectDocPolicy:Vs,selectImagePolicy:Bo,selectVideoPolicy:zs,selectAudioPolicy:Us,selectImageExtensions:S_,selectSupportedExtensions:qs,selectFullExtensionsList:b_,selectRegistration:t=>{var e;return null==(e=t.data)?void 0:e[l_]},selectLanguageDetection:t=>{var e;return null==(e=t.data)?void 0:e[__]},selectLanguageTranslation:t=>{var e;return null==(e=t.data)?void 0:e[v_]},selectOpenai:t=>{var e;return null==(e=t.data)?void 0:e[m_]},selectCaptcha:t=>{var e;return null==(e=t.data)?void 0:e[f_]},selectAdminCaptcha:t=>{var e;return null==(e=t.data)?void 0:e[y_]},selectPlatformTranslation:t=>{var e;return null==(e=t.data)?void 0:e[d_]},selectAccess:t=>{var e;return null==(e=t.data)?void 0:e[g_]},selectBranding:t=>{var e;return null==(e=t.data)?void 0:e[h_]},selectLinkService:t=>{var e;return null==(e=t.data)?void 0:e[w_]},selectInstanceAdmin:t=>{var e;return null==(e=t.data)?void 0:e[p_]},selectLegal:t=>{var e;return null==(e=t.data)?void 0:e[ni.legal]},selectDomainBlocks:t=>{var e;return null==(e=t.data)?void 0:e[ni.domainBlocks]},selectContacts:t=>{var e;return null==(e=t.data)?void 0:e[ni.contacts]}}});var xs,Ss,ti=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Eo={exports:{}},qr={};
2
2
  /**
3
3
  * @license React
4
4
  * react-jsx-runtime.production.min.js
@@ -33,10 +33,10 @@ import{createAction as Ds,createSlice as Fs,createSelector as Ct}from"https://cd
33
33
  *
34
34
  * This source code is licensed under the ISC license.
35
35
  * See the LICENSE file in the root directory of this source tree.
36
- */const vv=Bs((({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:a,...s},u)=>No("svg",{ref:u,..._v,width:e,height:e,stroke:t,strokeWidth:r?24*Number(n)/Number(e):n,className:Hs("lucide",i),...s},[...a.map((([t,e])=>No(t,e))),...Array.isArray(o)?o:[o]]))),mv=(t,e)=>{const n=Bs((({className:n,...r},i)=>No(vv,{ref:i,iconNode:e,className:Hs(`lucide-${yv(t)}`,n),...r})));return n.displayName=`${t}`,n},wv=[["path",{d:"M4 11a9 9 0 0 1 9 9",key:"pv89mb"}],["path",{d:"M4 4a16 16 0 0 1 16 16",key:"k0647b"}],["circle",{cx:"5",cy:"19",r:"1",key:"bfqh0e"}]],xv=mv("Rss",wv),Sv={404:{user:{title:"Oops! We can’t find that page",description:"This page isn’t available. It may have been removed or you don’t have permission to view it",links:[{text:"Go to feed",link:"/feed",icon:T.jsx(xv,{size:20,color:"white"})},{text:"Discover groups",link:"/discover"}]}},500:{user:{title:"Oops, something went wrong!",description:'We are already on it. Please try again later or contact us at <a href="mailto:support@wave.video">support@wave.video</a>'}},user404:{user:{title:"We could not find the user you were looking for",description:"Check the username and try one more time",links:[{text:"Wellsley account",link:"/account"},{text:"account settings",link:"/account/settings"}]}},group404:{user:{title:"Oops! We can't find that page",description:"This page isn’t available. It may have been removed or you don’t have permission to view it",links:[{text:"Go to group",link:"/discover"}]}},groupHidden:{user:{title:"This is a hidden private group",description:"Access is restricted — you can join only via a direct invitation link from the owner"}},page404:{user:{title:"We could not find the page you were looking for",description:"Check the address and try one more time"}},post404:{user:{title:"We could not find the post you were looking for",description:"Check the address and try one more time"}},RBACInsufficientPermissions:{user:{title:"You don't have permission to perform this action",description:"Please contact the administrator to get access"}}},bv=404,Mo=(t=bv,e=!0)=>{const n=Sv[t],r=null==n?void 0:n.user;return e?r:n.guest||r},Av=t=>{var e,n,r,i;if(!t)return Mo(500).description;if(dt.isString(t))return t;if("data"in t&&dt.isString(t.data))return t.data;if("data"in t&&null!=(e=t.data)&&e.errorCode)return null==(n=t.data)?void 0:n.message;if("isUnhandledError"in t&&!t.isUnhandledError){const{status:e,data:n}=null==t?void 0:t.error;return(dt.isString(n)?n:null==n?void 0:n.message)||(null==(r=Mo(e||500))?void 0:r.description)}return"message"in t&&t.message?t.message:"error"in t?t.error:"status"in t?null==(i=Mo(t.status))?void 0:i.description:void 0},Wo=async(t,e,n)=>{try{return await t,e&&$e.success(e),t}catch(t){$e.error(`${Av(t)}`)}},Iv=Ze.enhanceEndpoints({endpoints:{getApiV1Settings:{providesTags:["Settings"],async onQueryStarted(t,{dispatch:e,queryFulfilled:n}){e(Po.actions.setPending(!0));try{const t=await Wo(n);t&&e(To(t.data))}catch(t){Ns.error("Platform settings error:",t)}finally{e(Po.actions.setPending(!1))}}},getApiV1SettingsUser:{providesTags:["UserSettings"],async onQueryStarted(t,{dispatch:e,queryFulfilled:n}){try{const t=await Wo(n);null!=t&&t.data&&e(Do(t.data))}catch(t){Ns.error("Get profile settings error:",t)}}},putApiV1Settings:{async onQueryStarted(t,{dispatch:e,queryFulfilled:n,getState:r}){const i=Ze.util.selectCachedArgsForQuery(r(),"getApiV1Settings")[0],o=e(Ze.util.updateQueryData("getApiV1Settings",i||{keys:[]},(e=>{Object.assign(e,dt.merge(e,t.platformSettings))})));try{await n;const i=r(),o=Po.selectors.selectSettings({platformSettings:i.platformSettings});e(To(dt.merge(o||{},t.platformSettings))),$e.success("Updated")}catch{o.undo(),$e.error("Failed to update settings")}}},putApiV1SettingsUser:{async onQueryStarted(t,{dispatch:e,queryFulfilled:n,getState:r}){const i=Ze.util.selectCachedArgsForQuery(r(),"getApiV1SettingsUser")[0],o=e(Ze.util.updateQueryData("getApiV1SettingsUser",i||{keys:[]},(e=>{Object.assign(e,dt.merge(e,t.userSettings))})));e(Do(t.userSettings));try{await n,$e.success("Updated")}catch{o.undo()}}},getApiV1Rules:{providesTags:[_s.SERVER_RULES],async onQueryStarted(t,{queryFulfilled:e}){await Wo(e)}},postApiV1Rules:{invalidatesTags:[_s.SERVER_RULES],async onQueryStarted(t,{queryFulfilled:e}){try{await e,$e.success("Rule created")}catch(t){$e.error(`Failed to create rule ${Xn(t)}`)}}},putApiV1Rules:{async onQueryStarted({rule:t},{dispatch:e,queryFulfilled:n,getState:r}){const i=Ze.util.selectCachedArgsForQuery(r(),"getApiV1Rules")[0],o=e(Ze.util.updateQueryData("getApiV1Rules",i,(e=>{const n=e.findIndex((e=>e.id===t.id));-1!==n&&(e[n]={...e[n],...t})})));try{await n,$e.success("Rule updated")}catch(t){o.undo(),$e.error(`Failed to update rule ${Xn(t)}`)}}},postApiV1RulesReorder:{async onQueryStarted({orderedRules:t},{dispatch:e,queryFulfilled:n,getState:r}){const i=Ze.util.selectCachedArgsForQuery(r(),"getApiV1Rules")[0],o=e(Ze.util.updateQueryData("getApiV1Rules",i,(()=>t)));try{await n}catch(t){o.undo(),$e.error(`Failed to reorder rules ${Xn(t)}`)}}},deleteApiV1RulesById:{async onQueryStarted({id:t},{dispatch:e,queryFulfilled:n,getState:r}){const i=Ze.util.selectCachedArgsForQuery(r(),"getApiV1Rules")[0],o=e(Ze.util.updateQueryData("getApiV1Rules",i,(e=>{const n=e.findIndex((e=>e.id===t));-1!==n&&e.splice(n,1)})));try{await n,$e.success("Rule deleted")}catch(t){o.undo(),$e.error(`Failed to delete rule ${Xn(t)}`)}}}}}),{useGetApiV1SettingsQuery:$o,useGetApiV1SettingsUserQuery:Rv,usePutApiV1SettingsMutation:tm,usePutApiV1SettingsUserMutation:kv,useLazyGetApiV1SettingsUserQuery:rm,useGetApiV1InstanceSupportedLanguagesQuery:nm,useGetApiV1RulesQuery:im,usePostApiV1RulesMutation:om,usePutApiV1RulesMutation:am,usePostApiV1RulesReorderMutation:um,useDeleteApiV1RulesByIdMutation:sm}=Iv,Pv=()=>{const t=Et(Gr.selectors.selectIsAuthenticated);return $o({keys:[]},{skip:!t})},Ev=t=>dt.capitalize(t.replace(/[A-Z]/g,(t=>` ${t}`)).replace("_"," ")),Cv=(t,e)=>({readonly:!0,title:Ev(t),type:"text",value:e}),Xs=({data:t,metaData:e,settingsKeys:n,isLoading:r,isSuccess:i})=>t&&i&&!r?Object.keys(n).reduce(((r,i)=>{const o=n[i],a=t[o],s=e[o];return r[o]=s?{...s,value:a}:Cv(i,a),r}),{}):null,cm=()=>{const{data:t,isSuccess:e,isLoading:n}=Pv();return Xs({data:t,isSuccess:e,isLoading:n,metaData:F_,settingsKeys:L})},Ov={[_e.followAutoAccept]:{title:"Follow auto accept",type:"text",value:""}},jv=t=>{const e=Et(vs.selectors.selectPending),n=Et(Gr.selectors.selectPending),r=Et(Gr.selectors.selectIsAuthenticated),i=Et(vs.selectors.selectSelectedUserId);return $o({keys:t||[]},{skip:!r||!i||n||e})},lm=()=>{const{data:t,isSuccess:e,isLoading:n}=jv();return Xs({data:t,isSuccess:e,isLoading:n,metaData:Ov,settingsKeys:_e})},Lv=["user.follow","user.privacy","user.translation","user.notifications.prefs","user.notifications.policy"],Mv={privacy:{[_e.privacyShowPublicPosts]:{title:"Include public posts in search results",type:"switch",readonly:!1},[_e.privacyShowProfilePage]:{title:"Include profile page in search results",type:"switch",readonly:!1},[_e.followAutoAccept]:{title:"Automatically accept new followers",type:"switch",readonly:!1},[_e.privacyShowFollowers]:{title:"Show follows and followers on profile",type:"switch",readonly:!1}},notifications:{regular:{[_e.notificationsPrefsFollow]:{title:"Someone followed you",type:"check",readonly:!1},[_e.notificationsPrefsFollow_request]:{title:"Someone requested to follow you",type:"check",readonly:!1},[_e.notificationsPrefsRepost]:{title:"Someone boosted your post",type:"check",readonly:!1},[_e.notificationsPrefsLike]:{title:"Someone liked your post",type:"check",readonly:!1},[_e.notificationsPrefsMention]:{title:"Someone mentioned you",type:"check",readonly:!1},[_e.notificationsPrefsComment]:{title:"Someone commented your post",type:"check",readonly:!1},[_e.notificationsPrefsAlwaysSendEmail]:{title:"Send email notifications even if you are using the app",type:"check",readonly:!1}},stranger:{[_e.notificationsPolicyBlockNonFollowers]:{title:"Block notifications from non-followers",type:"check",readonly:!1},[_e.notificationsPolicyBlockNonFollowing]:{title:"Block notifications from people you don’t follow",type:"check",readonly:!1},[_e.notificationsPolicyBlockNonFollowingMessages]:{title:"Block direct messages from people you don’t follow",type:"check",readonly:!1},[_e.notificationsShowPopup]:{title:"Show notifications in popup",type:"check",readonly:!1}}}},Wv=t=>!(null==t||!t.type),ec=({defaultSettings:t,incomingSettings:e})=>{const n={...t};for(const r in n)if(Wv(t[r])){const t=e[r];t&&(n[r]={...n[r],value:t})}else n[r]=ec({defaultSettings:t[r],incomingSettings:e});return n},tc=(t,e="")=>{const n={};for(const r in t){const i=t[r],o=e?`${e}.${r}`:r;"object"==typeof i&&null!==i?Object.assign(n,tc(i,o)):"boolean"==typeof i&&(n[o]=i?"true":"false")}return n},fm=()=>{const t=Et(Gr.selectors.selectIsAuthenticated),e=Et(o_.selectors.selectProfileSettings),n=tc(e||{}),r=ec({defaultSettings:Mv,incomingSettings:n}),{isLoading:i}=Rv({keys:Lv},{skip:!t});return{settings:e,mergedSettings:r,isLoading:i}},pm=t=>t?Object.keys(t).map((e=>({id:e,...t[e]}))).sort(((t,e)=>{const n=e.readonly?0:1,r=t.readonly?0:1;return n!==r?n-r:0})):null,hm=t=>{const[e]=kv();return({id:n,value:r})=>{const i=n.split("."),o=i.pop(),a=i.join("."),s="true"===r||"false"===r,u={[a]:{...t[a],[o]:s?"true"===r:r}},l={...t,...u};e({userSettings:l})}},dm=(t,e=!1)=>{const n=Et(Gr.selectors.selectIsAuthenticated),r=e_([{resource:"AdminSettings",actions:["Read"]}]),i=[...a_,...n&&r?u_:[]];$o({keys:t||i},{skip:e})},Ts=({icon:t,label:e,href:n,isDefaultRoute:r,defaultRoutePattern:i})=>{const o=ms(n||""),a=ms(i||""),s=o||a&&r;return T.jsxs("div",{className:Zy("gap-xxs rounded-m px-xxs flex min-h-10 items-center py-1 text-base font-medium text-slate-800 hover:bg-slate-100",s&&"bg-slate-100 text-slate-900"),children:[t,e]})},Nv=({children:t})=>T.jsx("h3",{className:"mb-xxxs mt-s px-xxs text-sm font-semibold text-slate-500",children:t}),gm=({sections:t,defaultRoutePattern:e})=>T.jsx(T.Fragment,{children:t.map((t=>T.jsxs("div",{className:"gap-xxs px-xs flex flex-col",children:[T.jsx(Nv,{children:t.label}),T.jsx("div",{className:"gap-xxs flex flex-col",children:t.items.map((t=>t.href?T.jsx(t_,{to:t.href,children:T.jsx(Ts,{...t,defaultRoutePattern:e})},t.label):T.jsx("button",{onClick:t.handler,children:T.jsx(Ts,{...t,defaultRoutePattern:e})},t.label)))})]},t.label)))}),ym=({children:t,renderSidebar:e})=>T.jsx("div",{className:"py-m h-screen max-h-screen w-full overflow-hidden",children:T.jsxs("div",{className:"gap-xs flex h-full w-full justify-center",children:[T.jsx("aside",{className:"sticky top-0 w-[320px] rounded-lg bg-white",children:e()}),T.jsx("main",{className:"relative h-full w-full max-w-[600px] rounded-lg bg-white",children:t})]})});
36
+ */const vv=Bs((({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:a,...s},u)=>No("svg",{ref:u,..._v,width:e,height:e,stroke:t,strokeWidth:r?24*Number(n)/Number(e):n,className:Hs("lucide",i),...s},[...a.map((([t,e])=>No(t,e))),...Array.isArray(o)?o:[o]]))),mv=(t,e)=>{const n=Bs((({className:n,...r},i)=>No(vv,{ref:i,iconNode:e,className:Hs(`lucide-${yv(t)}`,n),...r})));return n.displayName=`${t}`,n},wv=[["path",{d:"M4 11a9 9 0 0 1 9 9",key:"pv89mb"}],["path",{d:"M4 4a16 16 0 0 1 16 16",key:"k0647b"}],["circle",{cx:"5",cy:"19",r:"1",key:"bfqh0e"}]],xv=mv("Rss",wv),Sv={404:{user:{title:"Oops! We can’t find that page",description:"This page isn’t available. It may have been removed or you don’t have permission to view it",links:[{text:"Go to feed",link:"/feed",icon:T.jsx(xv,{size:20,color:"white"})},{text:"Discover groups",link:"/discover"}]}},500:{user:{title:"Oops, something went wrong!",description:'We are already on it. Please try again later or contact us at <a href="mailto:support@wave.video">support@wave.video</a>'}},user404:{user:{title:"We could not find the user you were looking for",description:"Check the username and try one more time",links:[{text:"Wellsley account",link:"/account"},{text:"account settings",link:"/account/settings"}]}},group404:{user:{title:"Oops! We can't find that page",description:"This page isn’t available. It may have been removed or you don’t have permission to view it",links:[{text:"Go to group",link:"/discover"}]}},groupHidden:{user:{title:"This is a hidden private group",description:"Access is restricted — you can join only via a direct invitation link from the owner"}},page404:{user:{title:"We could not find the page you were looking for",description:"Check the address and try one more time"}},post404:{user:{title:"We could not find the post you were looking for",description:"Check the address and try one more time"}},RBACInsufficientPermissions:{user:{title:"You don't have permission to perform this action",description:"Please contact the administrator to get access"}}},bv=404,Mo=(t=bv,e=!0)=>{const n=Sv[t],r=null==n?void 0:n.user;return e?r:n.guest||r},Av=t=>{var e,n,r,i;if(!t)return Mo(500).description;if(dt.isString(t))return t;if("data"in t&&dt.isString(t.data))return t.data;if("data"in t&&null!=(e=t.data)&&e.errorCode)return null==(n=t.data)?void 0:n.message;if("isUnhandledError"in t&&!t.isUnhandledError){const{status:e,data:n}=null==t?void 0:t.error;return(dt.isString(n)?n:null==n?void 0:n.message)||(null==(r=Mo(e||500))?void 0:r.description)}return"message"in t&&t.message?t.message:"error"in t?t.error:"status"in t?null==(i=Mo(t.status))?void 0:i.description:void 0},Wo=async(t,e,n)=>{try{return await t,e&&$e.success(e),t}catch(t){$e.error(`${Av(t)}`)}},Iv=Ze.enhanceEndpoints({endpoints:{getApiV1Settings:{providesTags:["Settings"],async onQueryStarted(t,{dispatch:e,queryFulfilled:n}){e(Po.actions.setPending(!0));try{const t=await Wo(n);t&&e(To(t.data))}catch(t){Ns.error("Platform settings error:",t)}finally{e(Po.actions.setPending(!1))}}},getApiV1SettingsUser:{providesTags:["UserSettings"],async onQueryStarted(t,{dispatch:e,queryFulfilled:n}){try{const t=await Wo(n);null!=t&&t.data&&e(Do(t.data))}catch(t){Ns.error("Get profile settings error:",t)}}},putApiV1Settings:{async onQueryStarted(t,{dispatch:e,queryFulfilled:n,getState:r}){const i=Ze.util.selectCachedArgsForQuery(r(),"getApiV1Settings")[0],o=e(Ze.util.updateQueryData("getApiV1Settings",i||{keys:[]},(e=>{Object.assign(e,dt.merge(e,t.platformSettings))})));try{await n;const i=r(),o=Po.selectors.selectSettings({platformSettings:i.platformSettings});e(To(dt.merge(o||{},t.platformSettings))),$e.success("Updated")}catch{o.undo(),$e.error("Failed to update settings")}}},putApiV1SettingsUser:{async onQueryStarted(t,{dispatch:e,queryFulfilled:n,getState:r}){const i=Ze.util.selectCachedArgsForQuery(r(),"getApiV1SettingsUser")[0],o=e(Ze.util.updateQueryData("getApiV1SettingsUser",i||{keys:[]},(e=>{Object.assign(e,dt.merge(e,t.userSettings))})));e(Do(t.userSettings));try{await n,$e.success("Updated")}catch{o.undo()}}},getApiV1Rules:{providesTags:[_s.SERVER_RULES],async onQueryStarted(t,{queryFulfilled:e}){await Wo(e)}},postApiV1Rules:{invalidatesTags:[_s.SERVER_RULES],async onQueryStarted(t,{queryFulfilled:e}){try{await e,$e.success("Rule created")}catch(t){$e.error(`Failed to create rule ${Xn(t)}`)}}},putApiV1Rules:{async onQueryStarted({rule:t},{dispatch:e,queryFulfilled:n,getState:r}){const i=Ze.util.selectCachedArgsForQuery(r(),"getApiV1Rules")[0],o=e(Ze.util.updateQueryData("getApiV1Rules",i,(e=>{const n=e.findIndex((e=>e.id===t.id));-1!==n&&(e[n]={...e[n],...t})})));try{await n,$e.success("Rule updated")}catch(t){o.undo(),$e.error(`Failed to update rule ${Xn(t)}`)}}},postApiV1RulesReorder:{async onQueryStarted({orderedRules:t},{dispatch:e,queryFulfilled:n,getState:r}){const i=Ze.util.selectCachedArgsForQuery(r(),"getApiV1Rules")[0],o=e(Ze.util.updateQueryData("getApiV1Rules",i,(()=>t)));try{await n}catch(t){o.undo(),$e.error(`Failed to reorder rules ${Xn(t)}`)}}},deleteApiV1RulesById:{async onQueryStarted({id:t},{dispatch:e,queryFulfilled:n,getState:r}){const i=Ze.util.selectCachedArgsForQuery(r(),"getApiV1Rules")[0],o=e(Ze.util.updateQueryData("getApiV1Rules",i,(e=>{const n=e.findIndex((e=>e.id===t));-1!==n&&e.splice(n,1)})));try{await n,$e.success("Rule deleted")}catch(t){o.undo(),$e.error(`Failed to delete rule ${Xn(t)}`)}}}}}),{useGetApiV1SettingsQuery:$o,useGetApiV1SettingsUserQuery:Rv,usePutApiV1SettingsMutation:tm,usePutApiV1SettingsUserMutation:kv,useLazyGetApiV1SettingsUserQuery:rm,useGetApiV1InstanceSupportedLanguagesQuery:nm,useGetApiV1RulesQuery:im,usePostApiV1RulesMutation:om,usePutApiV1RulesMutation:am,usePostApiV1RulesReorderMutation:um,useDeleteApiV1RulesByIdMutation:sm}=Iv,Pv=()=>{const t=Et(Gr.selectors.selectIsAuthenticated);return $o({keys:[]},{skip:!t})},Ev=t=>dt.capitalize(t.replace(/[A-Z]/g,(t=>` ${t}`)).replace("_"," ")),Cv=(t,e)=>({readonly:!0,title:Ev(t),type:"text",value:e}),Xs=({data:t,metaData:e,settingsKeys:n,isLoading:r,isSuccess:i})=>t&&i&&!r?Object.keys(n).reduce(((r,i)=>{const o=n[i],a=t[o],s=e[o];return r[o]=s?{...s,value:a}:Cv(i,a),r}),{}):null,cm=()=>{const{data:t,isSuccess:e,isLoading:n}=Pv();return Xs({data:t,isSuccess:e,isLoading:n,metaData:F_,settingsKeys:L})},Ov={[Ae.followAutoAccept]:{title:"Follow auto accept",type:"text",value:""}},jv=t=>{const e=Et(vs.selectors.selectPending),n=Et(Gr.selectors.selectPending),r=Et(Gr.selectors.selectIsAuthenticated),i=Et(vs.selectors.selectSelectedUserId);return $o({keys:t||[]},{skip:!r||!i||n||e})},lm=()=>{const{data:t,isSuccess:e,isLoading:n}=jv();return Xs({data:t,isSuccess:e,isLoading:n,metaData:Ov,settingsKeys:Ae})},Lv=["user.follow","user.privacy","user.translation","user.notifications.prefs","user.notifications.policy"],Mv={privacy:{[Ae.privacyShowPublicPosts]:{title:"Include public posts in search results",type:"switch",readonly:!1},[Ae.privacyShowProfilePage]:{title:"Include profile page in search results",type:"switch",readonly:!1},[Ae.followAutoAccept]:{title:"Automatically accept new followers",type:"switch",readonly:!1},[Ae.privacyShowFollowers]:{title:"Show follows and followers on profile",type:"switch",readonly:!1}},notifications:{email:{regular:{[Ae.notificationsPrefsFollow]:{title:"Someone followed you",type:"check",readonly:!1},[Ae.notificationsPrefsFollow_request]:{title:"Someone requested to follow you",type:"check",readonly:!1},[Ae.notificationsPrefsRepost]:{title:"Someone boosted your post",type:"check",readonly:!1},[Ae.notificationsPrefsLike]:{title:"Someone liked your post",type:"check",readonly:!1},[Ae.notificationsPrefsMention]:{title:"Someone mentioned you",type:"check",readonly:!1},[Ae.notificationsPrefsComment]:{title:"Someone commented your post",type:"check",readonly:!1}},stranger:{[Ae.notificationsPolicyBlockNonFollowers]:{title:"Block notifications from non-followers",type:"check",readonly:!1},[Ae.notificationsPolicyBlockNonFollowing]:{title:"Block notifications from people you don't follow",type:"check",readonly:!1},[Ae.notificationsPolicyBlockNonFollowingMessages]:{title:"Block direct messages from people you don't follow",type:"check",readonly:!1}}}}},Wv=t=>!(null==t||!t.type),ec=({defaultSettings:t,incomingSettings:e})=>{const n={...t};for(const r in n)if(Wv(t[r])){const t=e[r];t&&(n[r]={...n[r],value:t})}else n[r]=ec({defaultSettings:t[r],incomingSettings:e});return n},tc=(t,e="")=>{const n={};for(const r in t){const i=t[r],o=e?`${e}.${r}`:r;"object"==typeof i&&null!==i?Object.assign(n,tc(i,o)):"boolean"==typeof i&&(n[o]=i?"true":"false")}return n},fm=()=>{const t=Et(Gr.selectors.selectIsAuthenticated),e=Et(o_.selectors.selectProfileSettings),n=tc(e||{}),r=ec({defaultSettings:Mv,incomingSettings:n}),{isLoading:i}=Rv({keys:Lv},{skip:!t});return{settings:e,mergedSettings:r,isLoading:i}},pm=t=>t?Object.keys(t).map((e=>({id:e,...t[e]}))).sort(((t,e)=>{const n=e.readonly?0:1,r=t.readonly?0:1;return n!==r?n-r:0})):null,hm=t=>{const[e]=kv();return({id:n,value:r})=>{const i=n.split("."),o=i.pop(),a=i.join("."),s="true"===r||"false"===r,u={[a]:{...t[a],[o]:s?"true"===r:r}},l={...t,...u};e({userSettings:l})}},dm=(t,e=!1)=>{const n=Et(Gr.selectors.selectIsAuthenticated),r=e_([{resource:"AdminSettings",actions:["Read"]}]),i=[...a_,...n&&r?u_:[]];$o({keys:t||i},{skip:e})},Ts=({icon:t,label:e,href:n,isDefaultRoute:r,defaultRoutePattern:i})=>{const o=ms(n||""),a=ms(i||""),s=o||a&&r;return T.jsxs("div",{className:Zy("gap-xxs rounded-m px-xxs flex min-h-10 items-center py-1 text-base font-medium text-slate-800 hover:bg-slate-100",s&&"bg-slate-100 text-slate-900"),children:[t,e]})},Nv=({children:t})=>T.jsx("h3",{className:"mb-xxxs mt-s px-xxs text-sm font-semibold text-slate-500",children:t}),gm=({sections:t,defaultRoutePattern:e})=>T.jsx(T.Fragment,{children:t.map((t=>T.jsxs("div",{className:"gap-xxs px-xs flex flex-col",children:[T.jsx(Nv,{children:t.label}),T.jsx("div",{className:"gap-xxs flex flex-col",children:t.items.map((t=>t.href?T.jsx(t_,{to:t.href,children:T.jsx(Ts,{...t,defaultRoutePattern:e})},t.label):T.jsx("button",{onClick:t.handler,children:T.jsx(Ts,{...t,defaultRoutePattern:e})},t.label)))})]},t.label)))}),ym=({children:t,renderSidebar:e})=>T.jsx("div",{className:"py-m h-screen max-h-screen w-full overflow-hidden",children:T.jsxs("div",{className:"gap-xs flex h-full w-full justify-center",children:[T.jsx("aside",{className:"sticky top-0 w-[320px] rounded-lg bg-white",children:e()}),T.jsx("main",{className:"relative h-full w-full max-w-[600px] rounded-lg bg-white",children:t})]})});
37
37
  /**
38
38
  * @license lucide-react v0.471.2 - ISC
39
39
  *
40
40
  * This source code is licensed under the ISC license.
41
41
  * See the LICENSE file in the root directory of this source tree.
42
- */export{O_ as InputSwitcher,gm as NavigationPanel,Jv as PlatformKeysReadOnlyList,Yv as PlatformKeysReadOnlyPrerfix,L as PlatformKeysSettings,Hv as Settings,ym as SettingsSidebarLayout,Zv as UserKeysPrerfix,_e as UserKeysSettings,Ov as accountSettingsInfoData,u_ as adminOnlyPlatformSettingsKeys,s_ as adminOnlyUserSettingsKeysMap,F_ as adminSettingsInfoData,Xv as createSettingsList,pm as createSortedSettingsList,em as extractSettingsArray,$r as mapExtensions,a_ as platformSettingsKeys,ni as platformSettingsKeysMap,Po as platformSettingsSlice,Mv as profileSettings,o_ as profileSettingsSlice,lm as useAccountSettings,jv as useAccountSettingsQuery,cm as useAdminSettings,Pv as useAdminSettingsQuery,sm as useDeleteApiV1RulesByIdMutation,dm as useFetchPlatformSettings,nm as useGetApiV1InstanceSupportedLanguagesQuery,im as useGetApiV1RulesQuery,$o as useGetApiV1SettingsQuery,Rv as useGetApiV1SettingsUserQuery,rm as useLazyGetApiV1SettingsUserQuery,om as usePostApiV1RulesMutation,um as usePostApiV1RulesReorderMutation,fm as useProfileSettings,am as usePutApiV1RulesMutation,tm as usePutApiV1SettingsMutation,kv as usePutApiV1SettingsUserMutation,hm as useUpdateProfileSettings};
42
+ */export{O_ as InputSwitcher,gm as NavigationPanel,Jv as PlatformKeysReadOnlyList,Yv as PlatformKeysReadOnlyPrerfix,L as PlatformKeysSettings,Hv as Settings,ym as SettingsSidebarLayout,Zv as UserKeysPrerfix,Ae as UserKeysSettings,Ov as accountSettingsInfoData,u_ as adminOnlyPlatformSettingsKeys,s_ as adminOnlyUserSettingsKeysMap,F_ as adminSettingsInfoData,Xv as createSettingsList,pm as createSortedSettingsList,em as extractSettingsArray,$r as mapExtensions,a_ as platformSettingsKeys,ni as platformSettingsKeysMap,Po as platformSettingsSlice,Mv as profileSettings,o_ as profileSettingsSlice,lm as useAccountSettings,jv as useAccountSettingsQuery,cm as useAdminSettings,Pv as useAdminSettingsQuery,sm as useDeleteApiV1RulesByIdMutation,dm as useFetchPlatformSettings,nm as useGetApiV1InstanceSupportedLanguagesQuery,im as useGetApiV1RulesQuery,$o as useGetApiV1SettingsQuery,Rv as useGetApiV1SettingsUserQuery,rm as useLazyGetApiV1SettingsUserQuery,om as usePostApiV1RulesMutation,um as usePostApiV1RulesReorderMutation,fm as useProfileSettings,am as usePutApiV1RulesMutation,tm as usePutApiV1SettingsMutation,kv as usePutApiV1SettingsUserMutation,hm as useUpdateProfileSettings};
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.0.639",
2
+ "version": "1.0.641",
3
3
  "name": "@wellesley/settings",
4
4
  "license": "UNLICENSED",
5
5
  "main": "index.mjs",