@wellesley/settings 1.0.660 → 1.0.661
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.
- package/index.mjs +2 -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 Wy,{useState as Ny,useEffect as Ty,forwardRef as Bs,createElement as No}from"https://cdn.jsdelivr.net/npm/react@18.2.0/+esm";import{Checkbox as Dy,RadioGroup as Fy,RadioGroupItem as By,TooltipProvider as zy,Tooltip as Uy,TooltipTrigger as Vy,Label as qy,TooltipContent as $y,Select as Ky,SelectTrigger as Qy,SelectValue as Gy,SelectContent as Jy,SelectGroup as Yy,SelectItem as Zy,Switch as Hy,Input as Xy,cn as e_}from"https://cdn.jsdelivr.net/npm/@wellesley/ui@1.0.665";import{useForm as t_,FormProvider as r_}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.47";import{api as Ze,QueryTags as _s}from"https://cdn.jsdelivr.net/npm/@wellesley/openapi@1.0.703";import{getErrorMsg as Xn}from"https://cdn.jsdelivr.net/npm/@wellesley/error-kit@1.0.554";import{authSlice as Gr,useHasUserPermissions as n_}from"https://cdn.jsdelivr.net/npm/@wellesley/auth@1.0.759";import{userSlice as vs}from"https://cdn.jsdelivr.net/npm/@wellesley/user@1.0.718";import{AppsLink as i_}from"https://cdn.jsdelivr.net/npm/@wellesley/router@1.0.631";import{useMatch as ms}from"https://cdn.jsdelivr.net/npm/react-router-dom@6.22.2/+esm";const o_=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)},a_=t=>o_(t)&&"type"in t&&"string"==typeof t.type,J=t=>{const e=e=>({type:t,payload:e});return e.toString=()=>`${t}`,e.type=t,e.match=e=>a_(e)&&e.type===t,e};J("remoteReady"),J("askLogin"),J("reselectUser"),J("requestLogout"),J("setConfirmLeavePage"),J("requestChangePath"),J("wsSubscribe"),J("wsUnSubscribe"),J("hostStoreConnect"),J("remoteLogin"),J("remoteLogout"),J("wsOnMessage"),J("setRouterPath"),J("setDeviceType"),J("setDeviceWidth"),J("setUserError"),J("setUserIsError"),J("setUserPending"),J("setUserSuccess"),J("setUserData"),J("updateAccountData"),J("updateUser"),J("addNotification"),J("markNotification"),J("setNotificationsError"),J("setNotificationsList"),J("setNotificationsPending"),J("setNotificationsTotalCount"),J("setNotificationsUnreadCount"),J("resetNotificationsState"),J("undoNotification"),J("setInstanceInfo"),J("setInstanceInfoPending"),J("setInstanceInfoError");const To=J("setPlatformSettings"),Do=J("setProfileSettings");J("setGroupData"),J("setGroupLoading"),Ds("requestMicroFrontendFetch"),Ds("sendMicroFrontendFetchResponse");const u_={data:null,isPending:!1,isSuccess:!1},s_=Fs({name:"profileSettings",initialState:u_,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}}),M={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"},Zv=[M.uploadsPolicyImageExtensions,M.uploadsPolicyImageKeepOriginal,M.uploadsPolicyImageResolutions,M.uploadsPolicyImageMaxResolution,M.uploadsPolicyImageMaxMatrix,M.uploadsPolicyImageMaxSize,M.uploadsPolicyVideoExtensions,M.uploadsPolicyVideoResolutions,M.uploadsPolicyVideoKeepOriginal,M.uploadsPolicyVideoMaxResolution,M.uploadsPolicyVideoMaxMatrix,M.uploadsPolicyVideoMaxSize,M.uploadsPolicyVideoMaxDuration,M.uploadsPolicyVideoStreamingThreshold,M.uploadsPolicyAudioExtensions,M.uploadsPolicyAudioKeepOriginal,M.uploadsPolicyAudioMaxSize,M.uploadsPolicyDocExtensions,M.uploadsPolicyDocMaxSize,M.mediacacheEnabled,M.mediacacheMaxTotalSize,M.mediacacheMaxFileSize,M.mediacacheLimitPerRun,M.mediacacheSingleRun,M.mediacacheCheckInterval,M.postsMaxMediaAttachments,M.postsMaxCharacters,M.postsMaxPins,M.registrationMode,M.registrationInvitesEnabled,M.registrationReasonToJoin,M.registrationShowCaptcha,M.registrationNotAvailableMessage],Hv="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"},Xv="user",c_=["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"],l_=["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"],f_={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)))||[],p_={data:null,isPending:!1},{posts:Ro,uploadsPolicyDoc:ws,uploadsPolicyAudio:ko,uploadsPolicyImage:ei,uploadsPolicyVideo:Vr,registration:h_,captcha:d_,instanceAdmin:g_,branding:y_,translation:__,access:v_}=ni,{captcha:m_,language:w_,translation:x_,openai:S_,link_service:b_}=f_,hr=t=>t.data,A_=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}})),I_=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)}))),R_=Ct(qs,(t=>Object.keys(t).reduce(((e,n)=>[...e,...t[n]||[]]),[]))),Po=Fs({name:"platformSettings",initialState:p_,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:A_,selectDocPolicy:Vs,selectImagePolicy:Bo,selectVideoPolicy:zs,selectAudioPolicy:Us,selectImageExtensions:I_,selectSupportedExtensions:qs,selectFullExtensionsList:R_,selectRegistration:t=>{var e;return null==(e=t.data)?void 0:e[h_]},selectLanguageDetection:t=>{var e;return null==(e=t.data)?void 0:e[w_]},selectLanguageTranslation:t=>{var e;return null==(e=t.data)?void 0:e[x_]},selectOpenai:t=>{var e;return null==(e=t.data)?void 0:e[S_]},selectCaptcha:t=>{var e;return null==(e=t.data)?void 0:e[d_]},selectAdminCaptcha:t=>{var e;return null==(e=t.data)?void 0:e[m_]},selectPlatformTranslation:t=>{var e;return null==(e=t.data)?void 0:e[__]},selectAccess:t=>{var e;return null==(e=t.data)?void 0:e[v_]},selectBranding:t=>{var e;return null==(e=t.data)?void 0:e[y_]},selectLinkService:t=>{var e;return null==(e=t.data)?void 0:e[b_]},selectInstanceAdmin:t=>{var e;return null==(e=t.data)?void 0:e[g_]},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 Wy,{useState as Ny,useEffect as Ty,forwardRef as Bs,createElement as No}from"https://cdn.jsdelivr.net/npm/react@18.2.0/+esm";import{Checkbox as Dy,RadioGroup as Fy,RadioGroupItem as By,TooltipProvider as zy,Tooltip as Uy,TooltipTrigger as Vy,Label as qy,TooltipContent as $y,Select as Ky,SelectTrigger as Qy,SelectValue as Gy,SelectContent as Jy,SelectGroup as Yy,SelectItem as Zy,Switch as Hy,Input as Xy,cn as e_}from"https://cdn.jsdelivr.net/npm/@wellesley/ui@1.0.666";import{useForm as t_,FormProvider as r_}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.48";import{api as Ze,QueryTags as _s}from"https://cdn.jsdelivr.net/npm/@wellesley/openapi@1.0.704";import{getErrorMsg as Xn}from"https://cdn.jsdelivr.net/npm/@wellesley/error-kit@1.0.555";import{authSlice as Gr,useHasUserPermissions as n_}from"https://cdn.jsdelivr.net/npm/@wellesley/auth@1.0.760";import{userSlice as vs}from"https://cdn.jsdelivr.net/npm/@wellesley/user@1.0.719";import{AppsLink as i_}from"https://cdn.jsdelivr.net/npm/@wellesley/router@1.0.632";import{useMatch as ms}from"https://cdn.jsdelivr.net/npm/react-router-dom@6.22.2/+esm";const o_=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)},a_=t=>o_(t)&&"type"in t&&"string"==typeof t.type,J=t=>{const e=e=>({type:t,payload:e});return e.toString=()=>`${t}`,e.type=t,e.match=e=>a_(e)&&e.type===t,e};J("remoteReady"),J("askLogin"),J("reselectUser"),J("requestLogout"),J("setConfirmLeavePage"),J("requestChangePath"),J("wsSubscribe"),J("wsUnSubscribe"),J("hostStoreConnect"),J("remoteLogin"),J("remoteLogout"),J("wsOnMessage"),J("setRouterPath"),J("setDeviceType"),J("setDeviceWidth"),J("setUserError"),J("setUserIsError"),J("setUserPending"),J("setUserSuccess"),J("setUserData"),J("updateAccountData"),J("updateUser"),J("addNotification"),J("markNotification"),J("setNotificationsError"),J("setNotificationsList"),J("setNotificationsPending"),J("setNotificationsTotalCount"),J("setNotificationsUnreadCount"),J("resetNotificationsState"),J("undoNotification"),J("setInstanceInfo"),J("setInstanceInfoPending"),J("setInstanceInfoError");const To=J("setPlatformSettings"),Do=J("setProfileSettings");J("setGroupData"),J("setGroupLoading"),Ds("requestMicroFrontendFetch"),Ds("sendMicroFrontendFetchResponse");const u_={data:null,isPending:!1,isSuccess:!1},s_=Fs({name:"profileSettings",initialState:u_,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}}),M={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"},Zv=[M.uploadsPolicyImageExtensions,M.uploadsPolicyImageKeepOriginal,M.uploadsPolicyImageResolutions,M.uploadsPolicyImageMaxResolution,M.uploadsPolicyImageMaxMatrix,M.uploadsPolicyImageMaxSize,M.uploadsPolicyVideoExtensions,M.uploadsPolicyVideoResolutions,M.uploadsPolicyVideoKeepOriginal,M.uploadsPolicyVideoMaxResolution,M.uploadsPolicyVideoMaxMatrix,M.uploadsPolicyVideoMaxSize,M.uploadsPolicyVideoMaxDuration,M.uploadsPolicyVideoStreamingThreshold,M.uploadsPolicyAudioExtensions,M.uploadsPolicyAudioKeepOriginal,M.uploadsPolicyAudioMaxSize,M.uploadsPolicyDocExtensions,M.uploadsPolicyDocMaxSize,M.mediacacheEnabled,M.mediacacheMaxTotalSize,M.mediacacheMaxFileSize,M.mediacacheLimitPerRun,M.mediacacheSingleRun,M.mediacacheCheckInterval,M.postsMaxMediaAttachments,M.postsMaxCharacters,M.postsMaxPins,M.registrationMode,M.registrationInvitesEnabled,M.registrationReasonToJoin,M.registrationShowCaptcha,M.registrationNotAvailableMessage],Hv="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"},Xv="user",c_=["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"],l_=["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"],f_={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)))||[],p_={data:null,isPending:!1},{posts:Ro,uploadsPolicyDoc:ws,uploadsPolicyAudio:ko,uploadsPolicyImage:ei,uploadsPolicyVideo:Vr,registration:h_,captcha:d_,instanceAdmin:g_,branding:y_,translation:__,access:v_}=ni,{captcha:m_,language:w_,translation:x_,openai:S_,link_service:b_}=f_,hr=t=>t.data,A_=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}})),I_=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)}))),R_=Ct(qs,(t=>Object.keys(t).reduce(((e,n)=>[...e,...t[n]||[]]),[]))),Po=Fs({name:"platformSettings",initialState:p_,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:A_,selectDocPolicy:Vs,selectImagePolicy:Bo,selectVideoPolicy:zs,selectAudioPolicy:Us,selectImageExtensions:I_,selectSupportedExtensions:qs,selectFullExtensionsList:R_,selectRegistration:t=>{var e;return null==(e=t.data)?void 0:e[h_]},selectLanguageDetection:t=>{var e;return null==(e=t.data)?void 0:e[w_]},selectLanguageTranslation:t=>{var e;return null==(e=t.data)?void 0:e[x_]},selectOpenai:t=>{var e;return null==(e=t.data)?void 0:e[S_]},selectCaptcha:t=>{var e;return null==(e=t.data)?void 0:e[d_]},selectAdminCaptcha:t=>{var e;return null==(e=t.data)?void 0:e[m_]},selectPlatformTranslation:t=>{var e;return null==(e=t.data)?void 0:e[__]},selectAccess:t=>{var e;return null==(e=t.data)?void 0:e[v_]},selectBranding:t=>{var e;return null==(e=t.data)?void 0:e[y_]},selectLinkService:t=>{var e;return null==(e=t.data)?void 0:e[b_]},selectInstanceAdmin:t=>{var e;return null==(e=t.data)?void 0:e[g_]},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,7 +33,7 @@ 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 xv=Bs((({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:a,...s},u)=>No("svg",{ref:u,...wv,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]]))),Sv=(t,e)=>{const n=Bs((({className:n,...r},i)=>No(xv,{ref:i,iconNode:e,className:Hs(`lucide-${mv(t)}`,n),...r})));return n.displayName=`${t}`,n},bv=[["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"}]],Av=Sv("Rss",bv),Iv={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(Av,{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"}}},Rv=404,Mo=(t=Rv,e=!0)=>{const n=Iv[t],r=null==n?void 0:n.user;return e?r:n.guest||r},kv=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(`${kv(t)}`)}},Pv=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:Ev,usePutApiV1SettingsMutation:nm,usePutApiV1SettingsUserMutation:Cv,useLazyGetApiV1SettingsUserQuery:im,useGetApiV1InstanceSupportedLanguagesQuery:om,useGetApiV1RulesQuery:am,usePostApiV1RulesMutation:um,usePutApiV1RulesMutation:sm,usePostApiV1RulesReorderMutation:cm,useDeleteApiV1RulesByIdMutation:lm}=Pv,Ov=()=>{const t=Et(Gr.selectors.selectIsAuthenticated);return $o({keys:[]},{skip:!t})},jv=t=>dt.capitalize(t.replace(/[A-Z]/g,(t=>` ${t}`)).replace("_"," ")),Lv=(t,e)=>({readonly:!0,title:jv(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}:Lv(i,a),r}),{}):null,fm=()=>{const{data:t,isSuccess:e,isLoading:n}=Ov();return Xs({data:t,isSuccess:e,isLoading:n,metaData:U_,settingsKeys:M})},Mv={[Ae.followAutoAccept]:{title:"Follow auto accept",type:"text",value:""}},Wv=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})},pm=()=>{const{data:t,isSuccess:e,isLoading:n}=Wv();return Xs({data:t,isSuccess:e,isLoading:n,metaData:Mv,settingsKeys:Ae})},ec=["user.follow","user.privacy","user.translation","user.notifications.prefs","user.notifications.policy"],Nv={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}}}}},Tv=t=>!(null==t||!t.type),tc=({defaultSettings:t,incomingSettings:e})=>{const n={...t};for(const r in n)if(Tv(t[r])){const t=e[r];t&&(n[r]={...n[r],value:t})}else n[r]=tc({defaultSettings:t[r],incomingSettings:e});return n},rc=(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,rc(i,o)):"boolean"==typeof i&&(n[o]=i?"true":"false")}return n},hm=()=>{const t=Et(Gr.selectors.selectIsAuthenticated),e=Et(s_.selectors.selectProfileSettings),n=rc(e||{}),r=tc({defaultSettings:Nv,incomingSettings:n}),{isLoading:i}=Ev({keys:ec},{skip:!t});return{settings:e,mergedSettings:r,isLoading:i}},dm=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,nc=(t,e)=>{if(1===t.length)return{[t[0]]:e};const[n,...r]=t;return{[n]:nc(r,e)}},ic=(t,e)=>{const n={...t};for(const t in e)"object"!=typeof e[t]||null===e[t]||Array.isArray(e[t])?n[t]=e[t]:n[t]=ic(n[t]||{},e[t]);return n},gm=t=>{const[e]=Cv();return({id:n,value:r})=>{const i="true"===r||"false"===r?"true"===r:r,o=ec.find((t=>n.startsWith(t+".")));if(!o)return void console.error("Unknown setting key for ID:",n);const a=n.substring(o.length+1).split("."),s=t[o]||{},u=nc(a,i),l=ic(s,u),c={...t,[o]:l};e({userSettings:c})}},ym=(t,e=!1)=>{const n=Et(Gr.selectors.selectIsAuthenticated),r=n_([{resource:"AdminSettings",actions:["Read"]}]),i=[...c_,...n&&r?l_:[]];$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:e_("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]})},Dv=({children:t})=>T.jsx("h3",{className:"mb-xxxs mt-s px-xxs text-sm font-semibold text-slate-500",children:t}),_m=({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(Dv,{children:t.label}),T.jsx("div",{className:"gap-xxs flex flex-col",children:t.items.map((t=>t.href?T.jsx(i_,{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)))}),vm=({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 xv=Bs((({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:a,...s},u)=>No("svg",{ref:u,...wv,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]]))),Sv=(t,e)=>{const n=Bs((({className:n,...r},i)=>No(xv,{ref:i,iconNode:e,className:Hs(`lucide-${mv(t)}`,n),...r})));return n.displayName=`${t}`,n},bv=[["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"}]],Av=Sv("Rss",bv),Iv={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(Av,{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"}}},Rv=404,Mo=(t=Rv,e=!0)=>{const n=Iv[t],r=null==n?void 0:n.user;return e?r:n.guest||r},kv=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(`${kv(t)}`)}},Pv=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:Ev,usePutApiV1SettingsMutation:nm,usePutApiV1SettingsUserMutation:Cv,useLazyGetApiV1SettingsUserQuery:im,useGetApiV1InstanceSupportedLanguagesQuery:om,useGetApiV1RulesQuery:am,usePostApiV1RulesMutation:um,usePutApiV1RulesMutation:sm,usePostApiV1RulesReorderMutation:cm,useDeleteApiV1RulesByIdMutation:lm}=Pv,Ov=()=>{const t=Et(Gr.selectors.selectIsAuthenticated);return $o({keys:[]},{skip:!t})},jv=t=>dt.capitalize(t.replace(/[A-Z]/g,(t=>` ${t}`)).replace("_"," ")),Lv=(t,e)=>({readonly:!0,title:jv(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}:Lv(i,a),r}),{}):null,fm=()=>{const{data:t,isSuccess:e,isLoading:n}=Ov();return Xs({data:t,isSuccess:e,isLoading:n,metaData:U_,settingsKeys:M})},Mv={[Ae.followAutoAccept]:{title:"Follow auto accept",type:"text",value:""}},Wv=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})},pm=()=>{const{data:t,isSuccess:e,isLoading:n}=Wv();return Xs({data:t,isSuccess:e,isLoading:n,metaData:Mv,settingsKeys:Ae})},ec=["user.follow","user.privacy","user.translation","user.notifications.prefs","user.notifications.policy"],Nv={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}}}}},Tv=t=>!(null==t||!t.type),tc=({defaultSettings:t,incomingSettings:e})=>{const n={...t};for(const r in n)if(Tv(t[r])){const t=e[r];t&&(n[r]={...n[r],value:t})}else n[r]=tc({defaultSettings:t[r],incomingSettings:e});return n},rc=(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,rc(i,o)):"boolean"==typeof i&&(n[o]=i?"true":"false")}return n},hm=()=>{const t=Et(Gr.selectors.selectIsAuthenticated),e=Et(s_.selectors.selectProfileSettings),n=rc(e||{}),r=tc({defaultSettings:Nv,incomingSettings:n}),{isLoading:i}=Ev({keys:ec},{skip:!t});return{settings:e,mergedSettings:r,isLoading:i}},dm=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,nc=(t,e)=>{if(1===t.length)return{[t[0]]:e};const[n,...r]=t;return{[n]:nc(r,e)}},ic=(t,e)=>{const n={...t};for(const t in e)"object"!=typeof e[t]||null===e[t]||Array.isArray(e[t])?n[t]=e[t]:n[t]=ic(n[t]||{},e[t]);return n},gm=t=>{const[e]=Cv();return({id:n,value:r})=>{const i="true"===r||"false"===r?"true"===r:r,o=ec.find((t=>n.startsWith(t+".")));if(!o)return void console.error("Unknown setting key for ID:",n);const a=n.substring(o.length+1).split("."),s=t[o]||{},u=nc(a,i),l=ic(s,u),c={...t,[o]:l};e({userSettings:c})}},ym=(t,e=!1)=>{const n=Et(Gr.selectors.selectIsAuthenticated),r=n_([{resource:"AdminSettings",actions:["Read"]}]),i=[...c_,...n&&r?l_:[]];$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:e_("gap-xxs rounded-m px-xxs flex min-h-10 items-center py-1 text-base font-medium text-gray-800 hover:bg-gray-100",s&&"bg-gray-100 text-gray-900"),children:[t,e]})},Dv=({children:t})=>T.jsx("h3",{className:"mb-xxxs mt-s px-xxs text-sm font-semibold text-gray-500",children:t}),_m=({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(Dv,{children:t.label}),T.jsx("div",{className:"gap-xxs flex flex-col",children:t.items.map((t=>t.href?T.jsx(i_,{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)))}),vm=({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
|
*
|
package/package.json
CHANGED