@strapi/admin 4.13.6 → 4.14.0-beta.0
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/admin/src/content-manager/components/Wysiwyg/EditorLayout.js +1 -1
- package/admin/src/content-manager/pages/ListView/components/BulkActionButtons/ConfirmBulkActionDialog/index.js +3 -0
- package/admin/src/content-manager/pages/ListView/components/BulkActionButtons/SelectedEntriesModal/index.js +2 -1
- package/admin/src/hooks/useAdminRoles/index.js +17 -7
- package/admin/src/hooks/useAdminUsers/useAdminUsers.js +16 -7
- package/admin/src/hooks/useContentTypes/useContentTypes.js +18 -7
- package/admin/src/index.js +1 -7
- package/build/1227.4f48119b.chunk.js +1 -0
- package/build/{3483.19381b40.chunk.js → 3483.f6b2439f.chunk.js} +1 -1
- package/build/4174.924ebd4c.chunk.js +1 -0
- package/build/6266.c652bdb1.chunk.js +146 -0
- package/build/7897.cf22d5fe.chunk.js +6 -0
- package/build/{Admin-authenticatedApp.69c7ea72.chunk.js → Admin-authenticatedApp.a687d9c6.chunk.js} +1 -1
- package/build/{admin-app.1fde8f7a.chunk.js → admin-app.4654dc77.chunk.js} +11 -11
- package/build/admin-edit-roles-page.6597d934.chunk.js +267 -0
- package/build/admin-edit-users.3014605e.chunk.js +10 -0
- package/build/admin-roles-list.ab6fcfb7.chunk.js +22 -0
- package/build/admin-users.81bf5f4d.chunk.js +11 -0
- package/build/audit-logs-settings-page.4eb6cdf8.chunk.js +1 -0
- package/build/{content-manager.f9abb63f.chunk.js → content-manager.9187db78.chunk.js} +37 -37
- package/build/index.html +1 -1
- package/build/{main.9ed36326.js → main.da000219.js} +17 -17
- package/build/review-workflows-settings-create-view.5d8806b2.chunk.js +1 -0
- package/build/review-workflows-settings-edit-view.634903ed.chunk.js +1 -0
- package/build/review-workflows-settings-list-view.d138c3b5.chunk.js +56 -0
- package/build/{runtime~main.562cc892.js → runtime~main.9589b498.js} +2 -2
- package/build/sso-settings-page.caa35f7b.chunk.js +1 -0
- package/ee/admin/content-manager/pages/EditView/InformationBox/components/StageSelect/StageSelect.js +65 -53
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/actions/index.js +50 -5
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/components/Stages/Stage/Stage.js +257 -21
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/components/WorkflowAttributes/WorkflowAttributes.js +8 -23
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/constants.js +6 -0
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/hooks/useReviewWorkflows.js +17 -7
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/hooks/useReviewWorkflowsStages.js +36 -0
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/pages/CreateView/CreateView.js +68 -19
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/pages/EditView/EditView.js +105 -35
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/reducer/index.js +68 -27
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/selectors.js +45 -0
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/utils/validateWorkflow.js +20 -0
- package/ee/server/config/admin-actions.js +6 -0
- package/ee/server/constants/workflows.js +13 -0
- package/ee/server/content-types/workflow-stage/index.js +6 -0
- package/ee/server/controllers/workflows/index.js +41 -16
- package/ee/server/controllers/workflows/stages/index.js +93 -6
- package/ee/server/migrations/review-workflows-stages-roles.js +68 -0
- package/ee/server/migrations/review-workflows-workflow-name.js +7 -0
- package/ee/server/register.js +2 -0
- package/ee/server/routes/review-workflows.js +10 -9
- package/ee/server/services/index.js +1 -0
- package/ee/server/services/review-workflows/stage-permissions.js +60 -0
- package/ee/server/services/review-workflows/stages.js +91 -12
- package/ee/server/services/review-workflows/workflows/index.js +20 -7
- package/ee/server/validation/review-workflows.js +11 -0
- package/package.json +8 -8
- package/server/content-types/Permission.js +6 -0
- package/server/domain/permission/index.js +11 -2
- package/server/services/role.js +12 -4
- package/server/validation/action-provider.js +1 -1
- package/server/validation/common-validators.js +92 -100
- package/server/validation/permission.js +0 -3
- package/build/1227.c72e74e9.chunk.js +0 -1
- package/build/2237.a7992513.chunk.js +0 -114
- package/build/4174.6efb0dc6.chunk.js +0 -1
- package/build/4724.a0ce68f3.chunk.js +0 -6
- package/build/admin-edit-roles-page.f76cb0aa.chunk.js +0 -267
- package/build/admin-edit-users.186c9d90.chunk.js +0 -10
- package/build/admin-roles-list.3a4edfa2.chunk.js +0 -22
- package/build/admin-users.e276bd9a.chunk.js +0 -11
- package/build/audit-logs-settings-page.0d9bc0f6.chunk.js +0 -1
- package/build/review-workflows-settings-create-view.b96b7be1.chunk.js +0 -1
- package/build/review-workflows-settings-edit-view.21a682a0.chunk.js +0 -1
- package/build/review-workflows-settings-list-view.14212324.chunk.js +0 -56
- package/build/sso-settings-page.d93bd81f.chunk.js +0 -1
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
(self.webpackChunk_strapi_admin=self.webpackChunk_strapi_admin||[]).push([[5538],{58917:function(
|
|
1
|
+
(self.webpackChunk_strapi_admin=self.webpackChunk_strapi_admin||[]).push([[5538],{58917:function(j,p,t){"use strict";t.r(p),t.d(p,{default:function(){return bs}});var e=t(32735),g=t(41865),E=t(88492),v=t(56784),u=t.n(v),f=t(93839),W=t.n(f),H=t(86349),C=t.n(H),b=t(88423),U=t.n(b),q=t(74758),D=t(14911),T=t(47750),Pe="strapi-admin-language",i=t(30126),be=t(60216),a=t.n(be),Se=t(20108),Te=t(15062),Ne=t(76402),De=t(97889);const Je={menuLogo:null,authLogo:null};var Qe=(o=Je,s)=>(0,De.ZP)(o,n=>{switch(s.type){case"UPDATE_PROJECT_SETTINGS":{Object.assign(n,s.values);break}default:return n}});const oe=({children:o,authLogo:s,menuLogo:n,showReleaseNotification:r,showTutorials:l})=>{const[{menuLogo:d,authLogo:c},m]=(0,e.useReducer)(Qe,Je),R=(0,e.useCallback)(({menuLogo:w,authLogo:S})=>m({type:"UPDATE_PROJECT_SETTINGS",values:{menuLogo:w||n,authLogo:S||s}}),[s,n]),A=(0,e.useMemo)(()=>({logos:{menu:{custom:d,default:n},auth:{custom:c,default:s}},updateProjectSettings:R,showReleaseNotification:r,showTutorials:l}),[d,n,c,s,R,r,l]);return e.createElement(Ne._5.Provider,{value:A},o)};oe.propTypes={authLogo:a().string.isRequired,children:a().element.isRequired,menuLogo:a().string.isRequired,showReleaseNotification:a().bool.isRequired,showTutorials:a().bool.isRequired};var He=oe,Ce=t(33795),Me=t.n(Ce),Ie=t(3040),Oe=t.n(Ie);const Xe="GUIDED_TOUR_CURRENT_STEP",Ke="GUIDED_TOUR_COMPLETED_STEPS",et="GUIDED_TOUR_SKIPPED",ke=JSON.parse,qe=JSON.stringify;var ye={clear(){localStorage.removeItem(Xe),localStorage.removeItem(Ke)},addCompletedStep(o){const s=ke(localStorage.getItem(Ke))?.slice()||[];s.includes(o)||(s.push(o),localStorage.setItem(Ke,qe(s)))},addCurrentStep(o){localStorage.setItem(Xe,qe(o))},setSkipped(o){localStorage.setItem(et,qe(o))},get(o){return ke(localStorage.getItem(o))}},tt=o=>{const s={...o},n=ye.get(Ke),r=ye.get(Xe),l=ye.get(et);if(n&&n.forEach(d=>{const[c,m]=d.split(".");Oe()(s,["guidedTourState",c,m],!0)}),r){const[d,c]=r.split(".");Oe()(s,["guidedTourState",d,c],!0),ye.addCompletedStep(r),ye.addCurrentStep(null)}return l!==null&&Oe()(s,"isSkipped",l),s};const st={currentStep:null,guidedTourState:{contentTypeBuilder:{create:!1,success:!1},contentManager:{create:!1,success:!1},apiTokens:{create:!1,success:!1}},isGuidedTourVisible:!1,isSkipped:!0};var gt=(o=st,s)=>(0,De.ZP)(o,n=>{switch(s.type){case"SET_CURRENT_STEP":{n.currentStep=s.step;break}case"SET_STEP_STATE":{const[r,l]=s.currentStep.split(".");n.guidedTourState[r][l]=s.value;break}case"SET_SKIPPED":{n.isSkipped=s.value;break}case"SET_GUIDED_TOUR_VISIBILITY":{n.isGuidedTourVisible=s.value;break}default:return n}}),pt=(o,s)=>{const n=Object.entries(s),r=n.findIndex(([d])=>d===o);return n.slice(0,r).every(([,d])=>Object.values(d).every(Boolean))},ft=(o,s)=>{const n=o.split("."),r=n[1],l=Object.entries(s[n[0]]),d=l.findIndex(([m])=>m===r);return l.slice(0,d).every(([,m])=>m)};const nt=({children:o})=>{const[{currentStep:s,guidedTourState:n,isGuidedTourVisible:r,isSkipped:l},d]=(0,e.useReducer)(gt,st,tt),c=S=>{if(S!==null){const Q=Me()(n,S),X=ft(S,n);if(Q||l||!X)return null}return ye.addCurrentStep(S),d({type:"SET_CURRENT_STEP",step:S})},m=S=>{d({type:"SET_GUIDED_TOUR_VISIBILITY",value:S})},R=(S,Q)=>{ye.addCompletedStep(S),d({type:"SET_STEP_STATE",currentStep:S,value:Q})},A=S=>{const Q=n[S];if(Q){const X=pt(S,n),N=Object.keys(Q)[0],ie=Q[N];if(X&&!s&&!ie)return c(`${S}.${N}`)}return null},w=S=>{ye.setSkipped(S),d({type:"SET_SKIPPED",value:S})};return e.createElement(i.Zc,{guidedTourState:n,currentStep:s,setCurrentStep:c,setGuidedTourVisibility:m,setSkipped:w,setStepState:R,startSection:A,isGuidedTourVisible:r,isSkipped:l},o)};nt.propTypes={children:a().element.isRequired};var ht=nt,bt=t(58732),Et=t.n(bt),Dt=t(78023),vt=t(33229);const yt=({changeLocale:o,children:s,localeNames:n})=>e.createElement(vt.Z.Provider,{value:{changeLocale:o,localeNames:n}},s);yt.propTypes={changeLocale:a().func.isRequired,children:a().element.isRequired,localeNames:a().object.isRequired};var Pt=yt,h=o=>{const s=window.localStorage.getItem(Pe);return{locale:o[s]?s:"en",localeNames:o}};const y={localeNames:{en:"English"},locale:"en"};var le=(o=y,s)=>{switch(s.type){case"CHANGE_LOCALE":{const{locale:n}=s;return o.localeNames[n]?{...o,locale:n}:o}default:return o}};const z=({children:o,localeNames:s,messages:n})=>{const[{locale:r},l]=(0,e.useReducer)(le,y,()=>h(s));(0,e.useEffect)(()=>{window.localStorage.setItem(Pe,r),document.documentElement.setAttribute("lang",r)},[r]);const d=m=>{l({type:"CHANGE_LOCALE",locale:m})},c=Et()(n[r],n.en);return e.createElement(Dt.Z,{locale:r,defaultLocale:"en",messages:c,textComponent:"span"},e.createElement(Pt,{changeLocale:d,localeNames:s},o))};z.propTypes={children:a().element.isRequired,localeNames:a().objectOf(a().string).isRequired,messages:a().object.isRequired};var se=z,re=t(44662),K=t(67879),ue=t(79652),O=t(8471),Ae=(0,O.vJ)`
|
|
2
2
|
body {
|
|
3
3
|
background: ${({theme:o})=>o.colors.neutral100};
|
|
4
4
|
}
|
|
5
|
-
`;const Fe=({children:o})=>{const{currentTheme:s,themes:n}=(0,ue.M1)(),{locale:r}=(0,H.Z)();return e.createElement(re.h,{locale:r,theme:n[s]||n.light},o,e.createElement(Ae,null))};Fe.propTypes={children:a().element.isRequired};var ze=Fe;const Le="STRAPI_THEME",at=()=>{const o=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",s=localStorage.getItem(Le);return s||localStorage.setItem(Le,o),s||o},we=({children:o,themes:s})=>{const[n,r]=(0,e.useState)(at()),l=(0,e.useCallback)(c=>{r(c),localStorage.setItem(Le,c)},[r]),d=(0,e.useMemo)(()=>({currentTheme:n,onChangeTheme:l,themes:s}),[n,l,s]);return e.createElement(Ne.Rj.Provider,{value:d},o)};we.propTypes={children:a().node.isRequired,themes:a().shape({light:a().shape({colors:a().object.isRequired,shadows:a().object.isRequired,sizes:a().object.isRequired,zIndices:a().array.isRequired,spaces:a().array.isRequired,borderRadius:a().string.isRequired,mediaQueries:a().object.isRequired,fontSizes:a().array.isRequired,lineHeights:a().array.isRequired,fontWeights:a().object.isRequired}).isRequired,dark:a().shape({colors:a().object.isRequired,shadows:a().object.isRequired,sizes:a().object.isRequired,zIndices:a().array.isRequired,spaces:a().array.isRequired,borderRadius:a().string.isRequired,mediaQueries:a().object.isRequired,fontSizes:a().array.isRequired,lineHeights:a().array.isRequired,fontWeights:a().object.isRequired}).isRequired,custom:a().object}).isRequired};var je=we;const Ge=new Se.QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:!1}}}),ce=({authLogo:o,children:s,components:n,customFields:r,fields:l,getAdminInjectedComponents:d,getPlugin:c,localeNames:m,menu:A,menuLogo:L,messages:k,plugins:S,runHookParallel:J,runHookSeries:Q,runHookWaterfall:B,settings:ie,showReleaseNotification:R,showTutorials:Ze,store:Be,themes:z})=>e.createElement(se,{messages:k,localeNames:m},e.createElement(je,{themes:z},e.createElement(ze,null,e.createElement(Se.QueryClientProvider,{client:Ge},e.createElement(Te.zt,{store:Be},e.createElement(Ne.ux.Provider,{value:{getAdminInjectedComponents:d}},e.createElement(He,{authLogo:o,menuLogo:L,showReleaseNotification:R,showTutorials:Ze},e.createElement(i._Y,{getPlugin:c,menu:A,plugins:S,runHookParallel:J,runHookWaterfall:B,runHookSeries:Q,settings:ie},e.createElement(i.rt,{components:n,fields:l},e.createElement(i.MG,{customFields:r},e.createElement(i.m$,null,e.createElement(i.w7,null,e.createElement(ht,null,e.createElement(i.N$,null,s))))))))))))));ce.propTypes={authLogo:a().oneOfType([a().string,a().any]).isRequired,children:a().element.isRequired,components:a().object.isRequired,customFields:a().object.isRequired,fields:a().object.isRequired,getAdminInjectedComponents:a().func.isRequired,getPlugin:a().func.isRequired,localeNames:a().objectOf(a().string).isRequired,menu:a().arrayOf(a().shape({to:a().string.isRequired,icon:a().func.isRequired,intlLabel:a().shape({id:a().string.isRequired,defaultMessage:a().string.isRequired}).isRequired,permissions:a().array,Component:a().func})).isRequired,menuLogo:a().oneOfType([a().string,a().any]).isRequired,messages:a().object.isRequired,plugins:a().object.isRequired,runHookParallel:a().func.isRequired,runHookWaterfall:a().func.isRequired,runHookSeries:a().func.isRequired,settings:a().object.isRequired,showReleaseNotification:a().bool.isRequired,showTutorials:a().bool.isRequired,store:a().object.isRequired,themes:a().shape({light:a().shape({colors:a().object.isRequired,shadows:a().object.isRequired,sizes:a().object.isRequired,zIndices:a().array.isRequired,spaces:a().array.isRequired,borderRadius:a().string.isRequired,mediaQueries:a().object.isRequired,fontSizes:a().array.isRequired,lineHeights:a().array.isRequired,fontWeights:a().object.isRequired}).isRequired,dark:a().shape({colors:a().object.isRequired,shadows:a().object.isRequired,sizes:a().object.isRequired,zIndices:a().array.isRequired,spaces:a().array.isRequired,borderRadius:a().string.isRequired,mediaQueries:a().object.isRequired,fontSizes:a().array.isRequired,lineHeights:a().array.isRequired,fontWeights:a().object.isRequired}).isRequired,custom:a().object}).isRequired};var ne=ce,$=t(59883),Y=t(6680);const Ue=(o,s)=>{let n=Y.compose;const r=[];o.forEach(d=>{r.push(d())});const l=(0,Y.createStore)(Ot(s,{}),{},n((0,Y.applyMiddleware)(...r)));return l.asyncReducers={},l.injectReducer=(d,c)=>{l.asyncReducers[d]=c,l.replaceReducer(Ot(s,l.asyncReducers))},l},Ot=(o,s)=>(0,Y.combineReducers)({...o,...s});var $t=Ue,Yt=t(35231),Jt=()=>{const o=[];return{register(s){o.push(s)},delete(s){o.splice(o.indexOf(s),1)},runWaterfall(s,n){return o.reduce((r,l)=>l(r,n),s)},async runWaterfallAsync(s,n){let r=s;for(const l of o)r=await l(r,n);return r},runSeries(...s){return o.map(n=>n(...s))},async runSeriesAsync(...s){const n=[];for(const r of o)n.push(await r(...s));return n},runParallel(...s){return Promise.all(o.map(n=>n(...s)))}}},ot=t(66941),Qt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAXVBMVEUAAABIRP9IRP9IRP9IRP9IRP9IRP9IRP9IRP9IRP9IRP9IRP9IRP9IRP9IRP9JRf9IRf9IRP5IRP5JRP9JRf////+Vk/+zsv++vf9mY/9taf9/fP+Jh//c3P9RTf/Ibar2AAAAFHRSTlMA/MJX+fPt48cahaff1dMaGqcahSpTPmAAAAEvSURBVFjD7dfNTsMwEATgXcf5cdKEtixtcYH3f0xEibIguba1g8Slc+58iqUedmhNaMbJzX3Xema5G2bfdv3iprE50s80g7Yqw0Oz1Z+cmOL2a38nxuy+BSfmuNv7BUhDRAMCDESBEYCDvsD6hmcMGGnCgIkcBjhaMGCmHgN66jCgoxYDWvIY4IkxgHFAkrmeU7kmfpkG4uUllXMtEE82QPs2QPs2QPs2QPs2QPsAoH0DoH0LoH0QeN3ydtnyXg38ok76MQ/gAfwf8JH8V18LQOljomBAFAyIkga4CGT7XAtEuQf4IpDri6e2BoiZA6OrAGLuxOnLQMweWXMRyPVlwQ/NAwZMNGLACJ/76ODYo5MHHl3o7EOHZ6BbjtbpG/5kfOv8P7ilbv7PX/M/rMVPqrI3XI3nd3sAAAAASUVORK5CYII=",Xt={admin:{tutorials:{links:[]}},contentManager:{editView:{informations:[],"right-links":[]},listView:{actions:[],deleteModalAdditionalInfos:[],publishModalAdditionalInfos:[],unpublishModalAdditionalInfos:[]}}},qt=t(34197),fe=t(53038);const kt=({component:o,path:s,...n})=>{const{pathname:r,search:l}=(0,fe.TH)();return e.createElement(fe.AW,{path:s,render:d=>i.I8.getToken()!==null?e.createElement(o,{...n,...d}):e.createElement(fe.l_,{to:{pathname:"/auth/login",search:r!=="/"&&`?redirectTo=${encodeURIComponent(`${r}${l}`)}`}})})};kt.propTypes={component:a().any.isRequired,path:a().string.isRequired};var wt=(0,e.memo)(kt);const jt={contentManager:{main:[],collectionTypesConfigurations:[{action:"plugin::content-manager.collection-types.configure-view",subject:null}],componentsConfigurations:[{action:"plugin::content-manager.components.configure-layout",subject:null}],singleTypesConfigurations:[{action:"plugin::content-manager.single-types.configure-view",subject:null}]},marketplace:{main:[{action:"admin::marketplace.read",subject:null}],read:[{action:"admin::marketplace.read",subject:null}]},settings:{roles:{main:[{action:"admin::roles.create",subject:null},{action:"admin::roles.update",subject:null},{action:"admin::roles.read",subject:null},{action:"admin::roles.delete",subject:null}],create:[{action:"admin::roles.create",subject:null}],delete:[{action:"admin::roles.delete",subject:null}],read:[{action:"admin::roles.read",subject:null}],update:[{action:"admin::roles.update",subject:null}]},users:{main:[{action:"admin::users.create",subject:null},{action:"admin::users.read",subject:null},{action:"admin::users.update",subject:null},{action:"admin::users.delete",subject:null}],create:[{action:"admin::users.create",subject:null}],delete:[{action:"admin::users.delete",subject:null}],read:[{action:"admin::users.read",subject:null}],update:[{action:"admin::users.update",subject:null}]},webhooks:{main:[{action:"admin::webhooks.create",subject:null},{action:"admin::webhooks.read",subject:null},{action:"admin::webhooks.update",subject:null},{action:"admin::webhooks.delete",subject:null}],create:[{action:"admin::webhooks.create",subject:null}],delete:[{action:"admin::webhooks.delete",subject:null}],read:[{action:"admin::webhooks.read",subject:null},{action:"admin::webhooks.update",subject:null},{action:"admin::webhooks.delete",subject:null}],update:[{action:"admin::webhooks.update",subject:null}]},"api-tokens":{main:[{action:"admin::api-tokens.access",subject:null}],create:[{action:"admin::api-tokens.create",subject:null}],delete:[{action:"admin::api-tokens.delete",subject:null}],read:[{action:"admin::api-tokens.read",subject:null}],update:[{action:"admin::api-tokens.update",subject:null}],regenerate:[{action:"admin::api-tokens.regenerate",subject:null}]},"transfer-tokens":{main:[{action:"admin::transfer.tokens.access",subject:null}],create:[{action:"admin::transfer.tokens.create",subject:null}],delete:[{action:"admin::transfer.tokens.delete",subject:null}],read:[{action:"admin::transfer.tokens.read",subject:null}],update:[{action:"admin::transfer.tokens.update",subject:null}],regenerate:[{action:"admin::transfer.tokens.regenerate",subject:null}]},"project-settings":{read:[{action:"admin::project-settings.read",subject:null}],update:[{action:"admin::project-settings.update",subject:null}]}}};var rt=t(9592),Ut=t(90869),_t=t(84306),es=t(39935),ts=t.n(es),ss=t(9086),it=t.n(ss),ns=t(51399),as=t(5074),ee=t(11060),os=t(24436);const St=o=>e.createElement(ee.ZP,null,e.createElement(os.Z,{...o}));St.defaultProps={onSubmit:o=>o.preventDefault()},St.propTypes={onSubmit:a().func};var O=t(24346),Ve=t(95162),de=t(77981),me=t(8365),he=t(84642),xe=t(2846),lt=t(91779),Tt=t(92802),$e=t(73678);const Ct=({onSubmit:o,schema:s})=>{const{formatMessage:n}=(0,H.Z)();return e.createElement(ee.ZP,null,e.createElement(Ve.o,null,e.createElement(ee.bU,null,e.createElement(Tt.J9,{enableReinitialize:!0,initialValues:{email:""},onSubmit:o,validationSchema:s,validateOnChange:!1},({values:r,errors:l,handleChange:d})=>e.createElement(i.l0,{noValidate:!0},e.createElement(ee.sg,null,e.createElement($e.Z,null),e.createElement(de.x,{paddingTop:6,paddingBottom:7},e.createElement(me.Z,{as:"h1",variant:"alpha"},n({id:"Auth.form.button.password-recovery",defaultMessage:"Password Recovery"}))),l.errorMessage&&e.createElement(me.Z,{id:"global-form-error",role:"alert",tabIndex:-1,textColor:"danger600"},n({id:l.errorMessage,defaultMessage:"An error occurred"}))),e.createElement(he.k,{direction:"column",alignItems:"stretch",gap:6},e.createElement(xe.o,{error:l.email?n({id:l.email,defaultMessage:"This email is invalid."}):"",value:r.email,onChange:d,label:n({id:"Auth.form.email.label",defaultMessage:"Email"}),placeholder:n({id:"Auth.form.email.placeholder",defaultMessage:"kai@doe.com"}),name:"email",required:!0}),e.createElement(lt.z,{type:"submit",fullWidth:!0},n({id:"Auth.form.button.forgot-password",defaultMessage:"Send Email"})))))),e.createElement(he.k,{justifyContent:"center"},e.createElement(de.x,{paddingTop:4},e.createElement(i.rU,{to:"/auth/login"},n({id:"Auth.link.ready",defaultMessage:"Ready to sign in?"}))))))};Ct.defaultProps={onSubmit:o=>o.preventDefault()},Ct.propTypes={onSubmit:a().func,schema:a().shape({type:a().string.isRequired}).isRequired};var rs=Ct,is=()=>{const{formatMessage:o}=(0,H.Z)();return e.createElement(ee.ZP,null,e.createElement(Ve.o,null,e.createElement(ee.bU,null,e.createElement(ee.sg,null,e.createElement($e.Z,null),e.createElement(de.x,{paddingTop:6,paddingBottom:7},e.createElement(me.Z,{as:"h1",variant:"alpha"},o({id:"app.containers.AuthPage.ForgotPasswordSuccess.title",defaultMessage:"Email sent"}))),e.createElement(me.Z,null,o({id:"app.containers.AuthPage.ForgotPasswordSuccess.text.email",defaultMessage:"It can take a few minutes to receive your password recovery link."})),e.createElement(de.x,{paddingTop:4},e.createElement(me.Z,null,o({id:"app.containers.AuthPage.ForgotPasswordSuccess.text.contact-admin",defaultMessage:"If you do not receive this link, please contact your administrator."}))))),e.createElement(he.k,{justifyContent:"center"},e.createElement(de.x,{paddingTop:4},e.createElement(i.rU,{to:"/auth/login"},o({id:"Auth.link.signin",defaultMessage:"Sign in"}))))))},ls=()=>{const{formatMessage:o}=(0,H.Z)(),n=(0,i.aM)().get("info")||o({id:"Auth.components.Oops.text",defaultMessage:"Your account has been suspended."});return e.createElement(ee.ZP,null,e.createElement(Ve.o,null,e.createElement(ee.bU,null,e.createElement(ee.sg,null,e.createElement($e.Z,null),e.createElement(de.x,{paddingTop:6,paddingBottom:7},e.createElement(me.Z,{as:"h1",variant:"alpha"},o({id:"Auth.components.Oops.title",defaultMessage:"Oops..."}))),e.createElement(me.Z,null,n),e.createElement(de.x,{paddingTop:4},e.createElement(me.Z,null,o({id:"Auth.components.Oops.text.admin",defaultMessage:"If this is a mistake, please contact your administrator."}))))),e.createElement(he.k,{justifyContent:"center"},e.createElement(de.x,{paddingTop:4},e.createElement(i.rU,{to:"/auth/login"},o({id:"Auth.link.signin",defaultMessage:"Sign in"}))))))},us=t(10710),xt=t(97037),cs=t(31014),ut=t(10364),ct=t(62161),ds=t(22773),dt=t(24018);const Zt=D.ZP.a`
|
|
5
|
+
`;const Fe=({children:o})=>{const{currentTheme:s,themes:n}=(0,ue.M1)(),{locale:r}=(0,K.Z)();return e.createElement(re.h,{locale:r,theme:n[s]||n.light},o,e.createElement(Ae,null))};Fe.propTypes={children:a().element.isRequired};var ze=Fe;const Le="STRAPI_THEME",at=()=>{const o=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",s=localStorage.getItem(Le);return s||localStorage.setItem(Le,o),s||o},we=({children:o,themes:s})=>{const[n,r]=(0,e.useState)(at()),l=(0,e.useCallback)(c=>{r(c),localStorage.setItem(Le,c)},[r]),d=(0,e.useMemo)(()=>({currentTheme:n,onChangeTheme:l,themes:s}),[n,l,s]);return e.createElement(Ne.Rj.Provider,{value:d},o)};we.propTypes={children:a().node.isRequired,themes:a().shape({light:a().shape({colors:a().object.isRequired,shadows:a().object.isRequired,sizes:a().object.isRequired,zIndices:a().array.isRequired,spaces:a().array.isRequired,borderRadius:a().string.isRequired,mediaQueries:a().object.isRequired,fontSizes:a().array.isRequired,lineHeights:a().array.isRequired,fontWeights:a().object.isRequired}).isRequired,dark:a().shape({colors:a().object.isRequired,shadows:a().object.isRequired,sizes:a().object.isRequired,zIndices:a().array.isRequired,spaces:a().array.isRequired,borderRadius:a().string.isRequired,mediaQueries:a().object.isRequired,fontSizes:a().array.isRequired,lineHeights:a().array.isRequired,fontWeights:a().object.isRequired}).isRequired,custom:a().object}).isRequired};var je=we;const Ge=new Se.QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:!1}}}),ce=({authLogo:o,children:s,components:n,customFields:r,fields:l,getAdminInjectedComponents:d,getPlugin:c,localeNames:m,menu:R,menuLogo:A,messages:w,plugins:S,runHookParallel:Q,runHookSeries:X,runHookWaterfall:N,settings:ie,showReleaseNotification:M,showTutorials:Ze,store:Be,themes:G})=>e.createElement(se,{messages:w,localeNames:m},e.createElement(je,{themes:G},e.createElement(ze,null,e.createElement(Se.QueryClientProvider,{client:Ge},e.createElement(Te.zt,{store:Be},e.createElement(Ne.ux.Provider,{value:{getAdminInjectedComponents:d}},e.createElement(He,{authLogo:o,menuLogo:A,showReleaseNotification:M,showTutorials:Ze},e.createElement(i._Y,{getPlugin:c,menu:R,plugins:S,runHookParallel:Q,runHookWaterfall:N,runHookSeries:X,settings:ie},e.createElement(i.rt,{components:n,fields:l},e.createElement(i.MG,{customFields:r},e.createElement(i.m$,null,e.createElement(i.w7,null,e.createElement(ht,null,e.createElement(i.N$,null,s))))))))))))));ce.propTypes={authLogo:a().oneOfType([a().string,a().any]).isRequired,children:a().element.isRequired,components:a().object.isRequired,customFields:a().object.isRequired,fields:a().object.isRequired,getAdminInjectedComponents:a().func.isRequired,getPlugin:a().func.isRequired,localeNames:a().objectOf(a().string).isRequired,menu:a().arrayOf(a().shape({to:a().string.isRequired,icon:a().func.isRequired,intlLabel:a().shape({id:a().string.isRequired,defaultMessage:a().string.isRequired}).isRequired,permissions:a().array,Component:a().func})).isRequired,menuLogo:a().oneOfType([a().string,a().any]).isRequired,messages:a().object.isRequired,plugins:a().object.isRequired,runHookParallel:a().func.isRequired,runHookWaterfall:a().func.isRequired,runHookSeries:a().func.isRequired,settings:a().object.isRequired,showReleaseNotification:a().bool.isRequired,showTutorials:a().bool.isRequired,store:a().object.isRequired,themes:a().shape({light:a().shape({colors:a().object.isRequired,shadows:a().object.isRequired,sizes:a().object.isRequired,zIndices:a().array.isRequired,spaces:a().array.isRequired,borderRadius:a().string.isRequired,mediaQueries:a().object.isRequired,fontSizes:a().array.isRequired,lineHeights:a().array.isRequired,fontWeights:a().object.isRequired}).isRequired,dark:a().shape({colors:a().object.isRequired,shadows:a().object.isRequired,sizes:a().object.isRequired,zIndices:a().array.isRequired,spaces:a().array.isRequired,borderRadius:a().string.isRequired,mediaQueries:a().object.isRequired,fontSizes:a().array.isRequired,lineHeights:a().array.isRequired,fontWeights:a().object.isRequired}).isRequired,custom:a().object}).isRequired};var ne=ce,Y=t(59883),J=t(6680);const Ue=(o,s)=>{let n=J.compose;const r=[];o.forEach(d=>{r.push(d())});const l=(0,J.createStore)(Ot(s,{}),{},n((0,J.applyMiddleware)(...r)));return l.asyncReducers={},l.injectReducer=(d,c)=>{l.asyncReducers[d]=c,l.replaceReducer(Ot(s,l.asyncReducers))},l},Ot=(o,s)=>(0,J.combineReducers)({...o,...s});var $t=Ue,Yt=t(35231),Jt=()=>{const o=[];return{register(s){o.push(s)},delete(s){o.splice(o.indexOf(s),1)},runWaterfall(s,n){return o.reduce((r,l)=>l(r,n),s)},async runWaterfallAsync(s,n){let r=s;for(const l of o)r=await l(r,n);return r},runSeries(...s){return o.map(n=>n(...s))},async runSeriesAsync(...s){const n=[];for(const r of o)n.push(await r(...s));return n},runParallel(...s){return Promise.all(o.map(n=>n(...s)))}}},ot=t(66941),Qt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAXVBMVEUAAABIRP9IRP9IRP9IRP9IRP9IRP9IRP9IRP9IRP9IRP9IRP9IRP9IRP9IRP9JRf9IRf9IRP5IRP5JRP9JRf////+Vk/+zsv++vf9mY/9taf9/fP+Jh//c3P9RTf/Ibar2AAAAFHRSTlMA/MJX+fPt48cahaff1dMaGqcahSpTPmAAAAEvSURBVFjD7dfNTsMwEATgXcf5cdKEtixtcYH3f0xEibIguba1g8Slc+58iqUedmhNaMbJzX3Xema5G2bfdv3iprE50s80g7Yqw0Oz1Z+cmOL2a38nxuy+BSfmuNv7BUhDRAMCDESBEYCDvsD6hmcMGGnCgIkcBjhaMGCmHgN66jCgoxYDWvIY4IkxgHFAkrmeU7kmfpkG4uUllXMtEE82QPs2QPs2QPs2QPs2QPsAoH0DoH0LoH0QeN3ydtnyXg38ok76MQ/gAfwf8JH8V18LQOljomBAFAyIkga4CGT7XAtEuQf4IpDri6e2BoiZA6OrAGLuxOnLQMweWXMRyPVlwQ/NAwZMNGLACJ/76ODYo5MHHl3o7EOHZ6BbjtbpG/5kfOv8P7ilbv7PX/M/rMVPqrI3XI3nd3sAAAAASUVORK5CYII=",Xt={admin:{tutorials:{links:[]}},contentManager:{editView:{informations:[],"right-links":[]},listView:{actions:[],deleteModalAdditionalInfos:[],publishModalAdditionalInfos:[],unpublishModalAdditionalInfos:[]}}},qt=t(34197),fe=t(53038);const kt=({component:o,path:s,...n})=>{const{pathname:r,search:l}=(0,fe.TH)();return e.createElement(fe.AW,{path:s,render:d=>i.I8.getToken()!==null?e.createElement(o,{...n,...d}):e.createElement(fe.l_,{to:{pathname:"/auth/login",search:r!=="/"&&`?redirectTo=${encodeURIComponent(`${r}${l}`)}`}})})};kt.propTypes={component:a().any.isRequired,path:a().string.isRequired};var wt=(0,e.memo)(kt);const jt={contentManager:{main:[],collectionTypesConfigurations:[{action:"plugin::content-manager.collection-types.configure-view",subject:null}],componentsConfigurations:[{action:"plugin::content-manager.components.configure-layout",subject:null}],singleTypesConfigurations:[{action:"plugin::content-manager.single-types.configure-view",subject:null}]},marketplace:{main:[{action:"admin::marketplace.read",subject:null}],read:[{action:"admin::marketplace.read",subject:null}]},settings:{roles:{main:[{action:"admin::roles.create",subject:null},{action:"admin::roles.update",subject:null},{action:"admin::roles.read",subject:null},{action:"admin::roles.delete",subject:null}],create:[{action:"admin::roles.create",subject:null}],delete:[{action:"admin::roles.delete",subject:null}],read:[{action:"admin::roles.read",subject:null}],update:[{action:"admin::roles.update",subject:null}]},users:{main:[{action:"admin::users.create",subject:null},{action:"admin::users.read",subject:null},{action:"admin::users.update",subject:null},{action:"admin::users.delete",subject:null}],create:[{action:"admin::users.create",subject:null}],delete:[{action:"admin::users.delete",subject:null}],read:[{action:"admin::users.read",subject:null}],update:[{action:"admin::users.update",subject:null}]},webhooks:{main:[{action:"admin::webhooks.create",subject:null},{action:"admin::webhooks.read",subject:null},{action:"admin::webhooks.update",subject:null},{action:"admin::webhooks.delete",subject:null}],create:[{action:"admin::webhooks.create",subject:null}],delete:[{action:"admin::webhooks.delete",subject:null}],read:[{action:"admin::webhooks.read",subject:null},{action:"admin::webhooks.update",subject:null},{action:"admin::webhooks.delete",subject:null}],update:[{action:"admin::webhooks.update",subject:null}]},"api-tokens":{main:[{action:"admin::api-tokens.access",subject:null}],create:[{action:"admin::api-tokens.create",subject:null}],delete:[{action:"admin::api-tokens.delete",subject:null}],read:[{action:"admin::api-tokens.read",subject:null}],update:[{action:"admin::api-tokens.update",subject:null}],regenerate:[{action:"admin::api-tokens.regenerate",subject:null}]},"transfer-tokens":{main:[{action:"admin::transfer.tokens.access",subject:null}],create:[{action:"admin::transfer.tokens.create",subject:null}],delete:[{action:"admin::transfer.tokens.delete",subject:null}],read:[{action:"admin::transfer.tokens.read",subject:null}],update:[{action:"admin::transfer.tokens.update",subject:null}],regenerate:[{action:"admin::transfer.tokens.regenerate",subject:null}]},"project-settings":{read:[{action:"admin::project-settings.read",subject:null}],update:[{action:"admin::project-settings.update",subject:null}]}}};var rt=t(9592),Ut=t(90869),_t=t(84306),es=t(39935),ts=t.n(es),ss=t(9086),it=t.n(ss),ns=t(51399),as=t(5074),ee=t(11060),os=t(24436);const St=o=>e.createElement(ee.ZP,null,e.createElement(os.Z,{...o}));St.defaultProps={onSubmit:o=>o.preventDefault()},St.propTypes={onSubmit:a().func};var k=t(24346),Ve=t(95162),de=t(77981),me=t(8365),he=t(84642),xe=t(2846),lt=t(91779),Tt=t(92802),$e=t(73678);const Ct=({onSubmit:o,schema:s})=>{const{formatMessage:n}=(0,K.Z)();return e.createElement(ee.ZP,null,e.createElement(Ve.o,null,e.createElement(ee.bU,null,e.createElement(Tt.J9,{enableReinitialize:!0,initialValues:{email:""},onSubmit:o,validationSchema:s,validateOnChange:!1},({values:r,errors:l,handleChange:d})=>e.createElement(i.l0,{noValidate:!0},e.createElement(ee.sg,null,e.createElement($e.Z,null),e.createElement(de.x,{paddingTop:6,paddingBottom:7},e.createElement(me.Z,{as:"h1",variant:"alpha"},n({id:"Auth.form.button.password-recovery",defaultMessage:"Password Recovery"}))),l.errorMessage&&e.createElement(me.Z,{id:"global-form-error",role:"alert",tabIndex:-1,textColor:"danger600"},n({id:l.errorMessage,defaultMessage:"An error occurred"}))),e.createElement(he.k,{direction:"column",alignItems:"stretch",gap:6},e.createElement(xe.o,{error:l.email?n({id:l.email,defaultMessage:"This email is invalid."}):"",value:r.email,onChange:d,label:n({id:"Auth.form.email.label",defaultMessage:"Email"}),placeholder:n({id:"Auth.form.email.placeholder",defaultMessage:"kai@doe.com"}),name:"email",required:!0}),e.createElement(lt.z,{type:"submit",fullWidth:!0},n({id:"Auth.form.button.forgot-password",defaultMessage:"Send Email"})))))),e.createElement(he.k,{justifyContent:"center"},e.createElement(de.x,{paddingTop:4},e.createElement(i.rU,{to:"/auth/login"},n({id:"Auth.link.ready",defaultMessage:"Ready to sign in?"}))))))};Ct.defaultProps={onSubmit:o=>o.preventDefault()},Ct.propTypes={onSubmit:a().func,schema:a().shape({type:a().string.isRequired}).isRequired};var rs=Ct,is=()=>{const{formatMessage:o}=(0,K.Z)();return e.createElement(ee.ZP,null,e.createElement(Ve.o,null,e.createElement(ee.bU,null,e.createElement(ee.sg,null,e.createElement($e.Z,null),e.createElement(de.x,{paddingTop:6,paddingBottom:7},e.createElement(me.Z,{as:"h1",variant:"alpha"},o({id:"app.containers.AuthPage.ForgotPasswordSuccess.title",defaultMessage:"Email sent"}))),e.createElement(me.Z,null,o({id:"app.containers.AuthPage.ForgotPasswordSuccess.text.email",defaultMessage:"It can take a few minutes to receive your password recovery link."})),e.createElement(de.x,{paddingTop:4},e.createElement(me.Z,null,o({id:"app.containers.AuthPage.ForgotPasswordSuccess.text.contact-admin",defaultMessage:"If you do not receive this link, please contact your administrator."}))))),e.createElement(he.k,{justifyContent:"center"},e.createElement(de.x,{paddingTop:4},e.createElement(i.rU,{to:"/auth/login"},o({id:"Auth.link.signin",defaultMessage:"Sign in"}))))))},ls=()=>{const{formatMessage:o}=(0,K.Z)(),n=(0,i.aM)().get("info")||o({id:"Auth.components.Oops.text",defaultMessage:"Your account has been suspended."});return e.createElement(ee.ZP,null,e.createElement(Ve.o,null,e.createElement(ee.bU,null,e.createElement(ee.sg,null,e.createElement($e.Z,null),e.createElement(de.x,{paddingTop:6,paddingBottom:7},e.createElement(me.Z,{as:"h1",variant:"alpha"},o({id:"Auth.components.Oops.title",defaultMessage:"Oops..."}))),e.createElement(me.Z,null,n),e.createElement(de.x,{paddingTop:4},e.createElement(me.Z,null,o({id:"Auth.components.Oops.text.admin",defaultMessage:"If this is a mistake, please contact your administrator."}))))),e.createElement(he.k,{justifyContent:"center"},e.createElement(de.x,{paddingTop:4},e.createElement(i.rU,{to:"/auth/login"},o({id:"Auth.link.signin",defaultMessage:"Sign in"}))))))},us=t(10710),xt=t(97037),cs=t(31014),ut=t(10364),ct=t(62161),ds=t(22773),dt=t(24018);const Zt=O.ZP.a`
|
|
6
6
|
color: ${({theme:o})=>o.colors.primary600};
|
|
7
|
-
`,Bt=(0,
|
|
7
|
+
`,Bt=(0,O.ZP)(xe.o)`
|
|
8
8
|
::-ms-reveal {
|
|
9
9
|
display: none;
|
|
10
10
|
}
|
|
11
|
-
`,
|
|
11
|
+
`,Mt=({authType:o,fieldsToDisable:s,noSignin:n,onSubmit:r,schema:l})=>{const d=(0,i.lm)(),{push:c}=(0,fe.k6)(),[m,R]=(0,e.useState)(!1),[A,w]=(0,e.useState)(!1),[S,Q]=(0,e.useState)(0),[X,N]=(0,e.useState)({}),{trackUsage:ie}=(0,i.rS)(),{formatMessage:M}=(0,K.Z)(),Ze=(0,i.aM)(),{formatAPIError:Be}=(0,i.So)(),{get:G}=(0,i.kY)(),{setNpsSurveySettings:ge}=(0,ds.$)(),te=Ze.get("registrationToken");(0,e.useEffect)(()=>{te&&(async()=>{try{const{data:{data:L}}=await G("/admin/registration-info",{params:{registrationToken:te}});L&&N(L)}catch(L){const I=Be(L);d({type:"warning",message:I}),c(`/auth/oops?info=${encodeURIComponent(I)}`)}})()},[te]);function _e(V){return Object.entries(V).reduce((L,[I,Ee])=>{let pe=Ee;return!["password","confirmPassword"].includes(I)&&typeof Ee=="string"&&(pe=pe.trim(),I==="lastname"&&(pe=pe||null)),L[I]=pe,L},{})}return e.createElement(ee.ZP,null,e.createElement(ee.bU,null,e.createElement(Tt.J9,{enableReinitialize:!0,initialValues:{firstname:X.firstname||"",lastname:X.lastname||"",email:X.email||"",password:"",confirmPassword:"",registrationToken:te||void 0,news:!1},onSubmit:async(V,L)=>{const I=_e(V);try{await l.validate(I,{abortEarly:!1}),S>0&&o==="register-admin"&&ie("didSubmitWithErrorsFirstAdmin",{count:S.toString()}),r(te?{userInfo:it()(I,["registrationToken"]),registrationToken:te}:I,L),ge({enabled:V.news})}catch(Ee){const pe=(0,i.CJ)(Ee);Q(S+1),L.setErrors(pe)}},validateOnChange:!1},({values:V,errors:L,handleChange:I})=>e.createElement(i.l0,{noValidate:!0},e.createElement(Ve.o,null,e.createElement(he.k,{direction:"column",alignItems:"center",gap:3},e.createElement($e.Z,null),e.createElement(me.Z,{as:"h1",variant:"alpha",textAlign:"center"},M({id:"Auth.form.welcome.title",defaultMessage:"Welcome to Strapi!"})),e.createElement(me.Z,{variant:"epsilon",textColor:"neutral600",textAlign:"center"},M({id:"Auth.form.register.subtitle",defaultMessage:"Credentials are only used to authenticate in Strapi. All saved data will be stored in your database."}))),e.createElement(he.k,{direction:"column",alignItems:"stretch",gap:6,marginTop:7},e.createElement(us.r,{gap:4},e.createElement(xt.P,{col:6},e.createElement(xe.o,{name:"firstname",required:!0,value:V.firstname,error:L.firstname?M(L.firstname):void 0,onChange:I,label:M({id:"Auth.form.firstname.label",defaultMessage:"Firstname"})})),e.createElement(xt.P,{col:6},e.createElement(xe.o,{name:"lastname",value:V.lastname,onChange:I,label:M({id:"Auth.form.lastname.label",defaultMessage:"Lastname"})}))),e.createElement(xe.o,{name:"email",disabled:s.includes("email"),value:V.email,onChange:I,error:L.email?M(L.email):void 0,required:!0,label:M({id:"Auth.form.email.label",defaultMessage:"Email"}),type:"email"}),e.createElement(Bt,{name:"password",onChange:I,value:V.password,error:L.password?M(L.password):void 0,endAction:e.createElement(dt.Z,{onClick:Ee=>{Ee.preventDefault(),R(pe=>!pe)},label:M(m?{id:"Auth.form.password.show-password",defaultMessage:"Show password"}:{id:"Auth.form.password.hide-password",defaultMessage:"Hide password"})},m?e.createElement(ut.Z,null):e.createElement(ct.Z,null)),hint:M({id:"Auth.form.password.hint",defaultMessage:"Must be at least 8 characters, 1 uppercase, 1 lowercase & 1 number"}),required:!0,label:M({id:"global.password",defaultMessage:"Password"}),type:m?"text":"password"}),e.createElement(Bt,{name:"confirmPassword",onChange:I,value:V.confirmPassword,error:L.confirmPassword?M(L.confirmPassword):void 0,endAction:e.createElement(dt.Z,{onClick:Ee=>{Ee.preventDefault(),w(pe=>!pe)},label:M(A?{id:"Auth.form.password.show-password",defaultMessage:"Show password"}:{id:"Auth.form.password.hide-password",defaultMessage:"Hide password"})},A?e.createElement(ut.Z,null):e.createElement(ct.Z,null)),required:!0,label:M({id:"Auth.form.confirmPassword.label",defaultMessage:"Confirm Password"}),type:A?"text":"password"}),e.createElement(cs.X,{onValueChange:Ee=>{I({target:{value:Ee,name:"news"}})},value:V.news,name:"news","aria-label":"news"},M({id:"Auth.form.register.news.label",defaultMessage:"Keep me updated about new features & upcoming improvements (by doing this you accept the {terms} and the {policy})."},{terms:e.createElement(Zt,{target:"_blank",href:"https://strapi.io/terms",rel:"noreferrer"},M({id:"Auth.privacy-policy-agreement.terms",defaultMessage:"terms"})),policy:e.createElement(Zt,{target:"_blank",href:"https://strapi.io/privacy",rel:"noreferrer"},M({id:"Auth.privacy-policy-agreement.policy",defaultMessage:"policy"}))})),e.createElement(lt.z,{fullWidth:!0,size:"L",type:"submit"},M({id:"Auth.form.button.register",defaultMessage:"Let's start"})))))),!n&&e.createElement(de.x,{paddingTop:4},e.createElement(he.k,{justifyContent:"center"},e.createElement(i.rU,{label:"Auth.link.signin",to:"/auth/login"},M({id:"Auth.link.signin.account",defaultMessage:"Already have an account?"}))))))};Mt.defaultProps={fieldsToDisable:[],noSignin:!1,onSubmit:o=>o.preventDefault()},Mt.propTypes={authType:a().string.isRequired,fieldsToDisable:a().array,noSignin:a().bool,onSubmit:a().func,schema:a().shape({validate:a().func.isRequired,type:a().string.isRequired}).isRequired};var Nt=Mt;const Wt=(0,O.ZP)(xe.o)`
|
|
12
12
|
::-ms-reveal {
|
|
13
13
|
display: none;
|
|
14
14
|
}
|
|
15
|
-
`,
|
|
15
|
+
`,Rt=({onSubmit:o,schema:s})=>{const[n,r]=(0,e.useState)(!1),[l,d]=(0,e.useState)(!1),{formatMessage:c}=(0,K.Z)();return e.createElement(ee.ZP,null,e.createElement(Ve.o,null,e.createElement(ee.bU,null,e.createElement(Tt.J9,{enableReinitialize:!0,initialValues:{password:"",confirmPassword:""},onSubmit:o,validationSchema:s,validateOnChange:!1},({values:m,errors:R,handleChange:A})=>e.createElement(i.l0,{noValidate:!0},e.createElement(ee.sg,null,e.createElement($e.Z,null),e.createElement(de.x,{paddingTop:6,paddingBottom:7},e.createElement(me.Z,{as:"h1",variant:"alpha"},c({id:"global.reset-password",defaultMessage:"Reset password"}))),R.errorMessage&&e.createElement(me.Z,{id:"global-form-error",role:"alert",tabIndex:-1,textColor:"danger600"},c({id:R.errorMessage,defaultMessage:"An error occurred"}))),e.createElement(he.k,{direction:"column",alignItems:"stretch",gap:6},e.createElement(Wt,{name:"password",onChange:A,value:m.password,error:R.password?c({id:R.password,defaultMessage:"This field is required."}):void 0,endAction:e.createElement(dt.Z,{onClick:w=>{w.preventDefault(),r(S=>!S)},label:c(n?{id:"Auth.form.password.show-password",defaultMessage:"Show password"}:{id:"Auth.form.password.hide-password",defaultMessage:"Hide password"})},n?e.createElement(ut.Z,null):e.createElement(ct.Z,null)),hint:c({id:"Auth.form.password.hint",defaultMessage:"Password must contain at least 8 characters, 1 uppercase, 1 lowercase and 1 number"}),required:!0,label:c({id:"global.password",defaultMessage:"Password"}),type:n?"text":"password"}),e.createElement(Wt,{name:"confirmPassword",onChange:A,value:m.confirmPassword,error:R.confirmPassword?c({id:R.confirmPassword,defaultMessage:"This value is required."}):void 0,endAction:e.createElement(dt.Z,{onClick:w=>{w.preventDefault(),d(S=>!S)},label:c(n?{id:"Auth.form.password.show-password",defaultMessage:"Show password"}:{id:"Auth.form.password.hide-password",defaultMessage:"Hide password"})},l?e.createElement(ut.Z,null):e.createElement(ct.Z,null)),required:!0,label:c({id:"Auth.form.confirmPassword.label",defaultMessage:"Confirm Password"}),type:l?"text":"password"}),e.createElement(lt.z,{fullwidth:!0,type:"submit"},c({id:"global.change-password",defaultMessage:"Change password"})))))),e.createElement(he.k,{justifyContent:"center"},e.createElement(de.x,{paddingTop:4},e.createElement(i.rU,{to:"/auth/login"},c({id:"Auth.link.ready",defaultMessage:"Ready to sign in?"}))))))};Rt.defaultProps={onSubmit:o=>o.preventDefault()},Rt.propTypes={onSubmit:a().func,schema:a().shape({type:a().string.isRequired}).isRequired};var ms=Rt;const Ht={"forgot-password":{Component:rs,endPoint:"forgot-password",fieldsToDisable:[],fieldsToOmit:[],schema:k.Ry().shape({email:k.Z_().email(i.I0.email).required(i.I0.required)}),inputsPrefix:""},"forgot-password-success":{Component:is,endPoint:"",fieldsToDisable:[],fieldsToOmit:[],schema:null,inputsPrefix:""},login:{endPoint:"login",fieldsToDisable:[],fieldsToOmit:["rememberMe"],schema:k.Ry().shape({email:k.Z_().email(i.I0.email).required(i.I0.required),password:k.Z_().required(i.I0.required),rememberMe:k.Xg().nullable()}),inputsPrefix:""},oops:{Component:ls,endPoint:null,fieldsToDisable:[],fieldsToOmit:[],schema:null,inputsPrefix:""},register:{Component:Nt,endPoint:"register",fieldsToDisable:["email"],fieldsToOmit:["userInfo.confirmPassword","userInfo.news","userInfo.email"],schema:k.Ry().shape({firstname:k.Z_().trim().required(i.I0.required),lastname:k.Z_().nullable(),password:k.Z_().min(8,i.I0.minLength).matches(/[a-z]/,"components.Input.error.contain.lowercase").matches(/[A-Z]/,"components.Input.error.contain.uppercase").matches(/\d/,"components.Input.error.contain.number").required(i.I0.required),confirmPassword:k.Z_().oneOf([k.iH("password"),null],"components.Input.error.password.noMatch").required(i.I0.required),registrationToken:k.Z_().required(i.I0.required)}),inputsPrefix:"userInfo."},"register-admin":{Component:Nt,endPoint:"register-admin",noSignin:!0,fieldsToDisable:[],fieldsToOmit:["confirmPassword","news"],schema:k.Ry().shape({firstname:k.Z_().trim().required(i.I0.required),lastname:k.Z_().nullable(),password:k.Z_().min(8,i.I0.minLength).matches(/[a-z]/,"components.Input.error.contain.lowercase").matches(/[A-Z]/,"components.Input.error.contain.uppercase").matches(/\d/,"components.Input.error.contain.number").required(i.I0.required),email:k.Z_().email(i.I0.email).strict().lowercase(i.I0.lowercase).required(i.I0.required),confirmPassword:k.Z_().oneOf([k.iH("password"),null],"components.Input.error.password.noMatch").required(i.I0.required)}),inputsPrefix:""},"reset-password":{Component:ms,endPoint:"reset-password",fieldsToDisable:[],fieldsToOmit:["confirmPassword"],schema:k.Ry().shape({password:k.Z_().min(8,i.I0.minLength).matches(/[a-z]/,"components.Input.error.contain.lowercase").matches(/[A-Z]/,"components.Input.error.contain.uppercase").matches(/\d/,"components.Input.error.contain.number").required(i.I0.required),confirmPassword:k.Z_().oneOf([k.iH("password"),null],"components.Input.error.password.noMatch").required(i.I0.required)})}};var gs=o=>o;const Kt={formErrors:{},modifiedData:{},requestError:null},ps=(o,s)=>(0,De.ZP)(o,n=>{switch(s.type){case"ON_CHANGE":{Oe()(n.modifiedData,s.keys.split("."),s.value);break}case"RESET_PROPS":return Kt;case"SET_DATA":{n.modifiedData=s.data;break}case"SET_ERRORS":{n.formErrors=s.errors;break}case"SET_REQUEST_ERROR":{n.requestError={errorMessage:s.errorMessage,errorStatus:s.errorStatus};break}default:return n}}),At=({hasAdmin:o,setHasAdmin:s})=>{const{push:n,location:{search:r}}=(0,fe.k6)(),{changeLocale:l}=(0,ns.Z)(),{setSkipped:d}=(0,i.c1)(),{trackUsage:c}=(0,i.rS)(),{params:{authType:m}}=(0,fe.$B)("/auth/:authType"),R=(0,i.aM)(),A=(0,rt.c)(St,async()=>(await t.e(2395).then(t.bind(t,82395))).LoginEE),w=(0,rt.c)(Ht,async()=>(await t.e(8276).then(t.bind(t,18276))).FORMS,{combine(x,$){return{...x,...$}},defaultValue:Ht}),[{formErrors:S,modifiedData:Q,requestError:X},N]=(0,e.useReducer)(ps,Kt,gs),M=_t.default.CancelToken.source(),{endPoint:Ze,fieldsToDisable:Be,fieldsToOmit:G,inputsPrefix:ge,schema:te,..._e}=w?.[m]??{};(0,e.useEffect)(()=>()=>{M.cancel("Component unmounted")},[]);const{post:V}=(0,i.kY)();(0,e.useEffect)(()=>{N({type:"RESET_PROPS"})},[m]);const L=({target:{name:x,value:$}})=>{N({type:"ON_CHANGE",keys:x,value:$})},I=async(x,{setSubmitting:$,setErrors:ve})=>{$(!0);const Re=it()(x,G),Z=`/admin/${Ze}`;m==="login"&&await pe(x,Z,{setSubmitting:$,setErrors:ve}),(m==="register"||m==="register-admin")&&await Ds(x,Z,{setSubmitting:$,setErrors:ve}),m==="forgot-password"&&await Ee(Re,Z,{setSubmitting:$,setErrors:ve}),m==="reset-password"&&await Os(Re,Z,{setSubmitting:$,setErrors:ve})},Ee=async(x,$,{setSubmitting:ve,setErrors:Re})=>{try{await V($,x,{cancelToken:M.token}),n("/auth/forgot-password-success")}catch(Z){console.error(Z),Re({errorMessage:"notification.error"})}finally{ve(!1)}},pe=async(x,$,{setSubmitting:ve,setErrors:Re})=>{try{const{data:{data:{token:Z,user:ae}}}=await V($,it()(x,G),{cancelToken:M.token});ae.preferedLanguage&&l(ae.preferedLanguage),i.I8.setToken(Z,x.rememberMe),i.I8.setUserInfo(ae,x.rememberMe),zt()}catch(Z){if(Z.response){const ae=Me()(Z,["response","data","error","message"],"Something went wrong");if(ts()(ae).toLowerCase()==="usernotactive"){n("/auth/oops"),N({type:"RESET_PROPS"});return}Re({errorMessage:ae})}}finally{ve(!1)}},Ds=async(x,$,{setSubmitting:ve,setErrors:Re})=>{try{c("willCreateFirstAdmin");const{data:{data:{token:Z,user:ae}}}=await V($,it()(x,G),{cancelToken:M.token});i.I8.setToken(Z,!1),i.I8.setUserInfo(ae,!1),ve(!1),s(!0);const{roles:Ye}=ae;if(Ye&&Ye.find(({code:ws})=>ws==="strapi-super-admin")&&(ye.setSkipped(!1),d(!1),c("didLaunchGuidedtour")),m==="register"&&x.userInfo.news===!0||m==="register-admin"&&x.news===!0){n({pathname:"/usecase",search:`?hasAdmin=${o}`});return}zt()}catch(Z){if(c("didNotCreateFirstAdmin"),Z.response){const{data:ae}=Z.response,Ye=(0,as.Z)(ae);Re({apiErrors:Ye})}}},Os=async(x,$,{setErrors:ve,setSubmitting:Re})=>{try{const{data:{data:{token:Z,user:ae}}}=await V($,{...x,resetPasswordToken:R.get("code")},{cancelToken:M.token});i.I8.setToken(Z,!1),i.I8.setUserInfo(ae,!1),n("/")}catch(Z){if(Z.response){const ae=Me()(Z,["response","data","message"],"Something went wrong"),Ye=Me()(Z,["response","data","statusCode"],400);N({type:"SET_REQUEST_ERROR",errorMessage:ae,errorStatus:Ye}),ve({errorMessage:ae})}}finally{Re(!1)}},zt=()=>{if(m==="login"){const x=R.get("redirectTo"),$=x?decodeURIComponent(x):"/";n($)}else n("/")};if(!w[m]||o&&m==="register-admin"||i.I8.getToken())return e.createElement(fe.l_,{to:"/"});if(!o&&m!=="register-admin")return e.createElement(fe.l_,{to:{pathname:"/auth/register-admin",search:r}});if(A&&(w.login.Component=A),!A)return null;const{Component:ks}=w?.[m]??{};return e.createElement(ks,{..._e,authType:m,fieldsToDisable:Be,formErrors:S,inputsPrefix:ge,modifiedData:Q,onChange:L,onSubmit:I,requestError:X,schema:te})};At.defaultProps={hasAdmin:!1},At.propTypes={hasAdmin:a().bool,setHasAdmin:a().func.isRequired};var fs=At,hs=t(33248),Es=t(16773),vs=t(40260),ys=t(43743),Ps=t(33348);const Ss=[{intlLabel:{id:"Usecase.front-end",defaultMessage:"Front-end developer"},value:"front_end_developer"},{intlLabel:{id:"Usecase.back-end",defaultMessage:"Back-end developer"},value:"back_end_developer"},{intlLabel:{id:"Usecase.full-stack",defaultMessage:"Full-stack developer"},value:"full_stack_developer"},{intlLabel:{id:"global.content-manager",defaultMessage:"Content Manager"},value:"content_manager"},{intlLabel:{id:"Usecase.content-creator",defaultMessage:"Content Creator"},value:"content_creator"},{intlLabel:{id:"Usecase.other",defaultMessage:"Other"},value:"other"}],Ts=(0,O.ZP)(me.Z)`
|
|
16
16
|
text-align: center;
|
|
17
|
-
`;var Cs=()=>{const o=(0,i.lm)(),{push:s,location:n}=(0,fe.k6)(),{formatMessage:r}=(0,H.Z)(),[l,d]=(0,e.useState)(),[c,m]=(0,e.useState)(""),{post:A}=(0,i.kY)(),{firstname:L,email:k}=i.I8.getUserInfo(),{hasAdmin:S}=(0,Ps.parse)(n?.search,{ignoreQueryPrefix:!0}),J=l==="other",Q=async(B,ie)=>{B.preventDefault();try{await A("https://analytics.strapi.io/register",{email:k,username:L,firstAdmin:Boolean(!S),persona:{role:ie?void 0:l,otherRole:ie?void 0:c}}),o({type:"success",message:{id:"Usecase.notification.success.project-created",defaultMessage:"Project has been successfully created"}}),s("/")}catch{}};return e.createElement(ee.ZP,null,e.createElement(Ve.o,{labelledBy:"usecase-title"},e.createElement(ee.bU,null,e.createElement("form",{onSubmit:B=>Q(B,!1)},e.createElement(he.k,{direction:"column",paddingBottom:7},e.createElement($e.Z,null),e.createElement(de.x,{paddingTop:6,paddingBottom:1,width:(0,i.Q1)(250)},e.createElement(Ts,{variant:"alpha",as:"h1",id:"usecase-title"},r({id:"Usecase.title",defaultMessage:"Tell us a bit more about yourself"})))),e.createElement(he.k,{direction:"column",alignItems:"stretch",gap:6},e.createElement(Es.P,{id:"usecase","data-testid":"usecase",label:r({id:"Usecase.input.work-type",defaultMessage:"What type of work do you do?"}),onChange:d,value:l},Ss.map(({intlLabel:B,value:ie})=>e.createElement(vs.W,{key:ie,value:ie},r(B)))),J&&e.createElement(xe.o,{name:"other",label:r({id:"Usecase.other",defaultMessage:"Other"}),value:c,onChange:B=>m(B.target.value),"data-testid":"other"}),e.createElement(lt.z,{type:"submit",size:"L",fullWidth:!0,disabled:!l},r({id:"global.finish",defaultMessage:"Finish"}))))),e.createElement(he.k,{justifyContent:"center"},e.createElement(de.x,{paddingTop:4},e.createElement(ys.A,{onClick:()=>Q(!0)},r({id:"Usecase.button.skip",defaultMessage:"Skip this question"}))))))},Ft=t(4556);const Rs=(0,e.lazy)(()=>Promise.all([t.e(2659),t.e(801)]).then(t.bind(t,7805)));function Ms(){const o=(0,rt.c)(jt,async()=>(await t.e(3100).then(t.bind(t,73100))).ADMIN_PERMISSIONS_EE,{combine(z,ge){return C()({},z,ge)},defaultValue:jt}),s=(0,rt.c)(Ft.y3,async()=>(await t.e(1386).then(t.bind(t,31386))).ROUTES_EE,{defaultValue:[]}),n=(0,i.lm)(),{updateProjectSettings:r}=(0,ue.um)(),{formatMessage:l}=(0,H.Z)(),[{isLoading:d,hasAdmin:c,uuid:m,deviceId:A},L]=(0,e.useState)({isLoading:!0,hasAdmin:!1}),k=(0,Te.I0)(),S=(0,i.L7)(),{get:J,post:Q}=(0,i.kY)(),B=(0,e.useMemo)(()=>(0,Ut.WW)(s.map(({to:z,Component:ge,exact:te})=>(0,Ut.ot)(ge,z,te))),[s]),[ie,R]=(0,e.useState)(null);(0,e.useEffect)(()=>{k({type:Ft.XS,payload:o})},[o,k]),(0,e.useEffect)(()=>{const z=i.I8.getToken();z&&(async()=>{try{const{data:{data:{token:te}}}=await Q("/admin/renew-token",{token:z});i.I8.updateToken(te)}catch{i.I8.clearAppStorage(),window.location.reload()}})()},[Q]),(0,e.useEffect)(()=>{(async()=>{try{const{data:{data:{hasAdmin:ge,uuid:te,menuLogo:_e,authLogo:G}}}=await J("/admin/init");if(r({menuLogo:(0,i.CR)(_e),authLogo:(0,i.CR)(G)}),te){const{data:{data:I}}=await J("/admin/telemetry-properties",{validateStatus:b=>b<500});R(I);try{const b="didInitializeAdministration";await Q("https://analytics.strapi.io/api/v2/track",{event:b,userId:"",deviceId:A,eventPropeties:{},userProperties:{environment:S.currentEnvironment},groupProperties:{...I,projectId:te}},{headers:{"X-Strapi-Event":b}})}catch{}}L({isLoading:!1,hasAdmin:ge,uuid:te,deviceId:A})}catch{n({type:"warning",message:{id:"app.containers.App.notification.error.init"}})}})()},[n,r]);const Ze=z=>L(ge=>({...ge,hasAdmin:z})),Be=(0,e.useMemo)(()=>({uuid:m,telemetryProperties:ie,deviceId:A}),[m,ie,A]);return d?e.createElement(i.dO,null):e.createElement(e.Suspense,{fallback:e.createElement(i.dO,null)},e.createElement(qt.z,null,l({id:"skipToContent"})),e.createElement(i.L8,{value:Be},e.createElement(fe.rs,null,B,e.createElement(fe.AW,{path:"/auth/:authType",render:z=>e.createElement(fs,{...z,setHasAdmin:Ze,hasAdmin:c}),exact:!0}),e.createElement(wt,{path:"/usecase",component:Cs}),e.createElement(wt,{path:"/",component:Rs}),e.createElement(fe.AW,{path:"",component:hs.default}))))}var As=Ms,Ls={ar:"\u0627\u0644\u0639\u0631\u0628\u064A\u0629",ca:"Catal\xE0",cs:"\u010Ce\u0161tina",de:"Deutsch",dk:"Dansk",en:"English",es:"Espa\xF1ol",eu:"Euskara",fr:"Fran\xE7ais",gu:"Gujarati",he:"\u05E2\u05D1\u05E8\u05D9\u05EA",hu:"Magyar",id:"Indonesian",it:"Italiano",ja:"\u65E5\u672C\u8A9E",ko:"\uD55C\uAD6D\uC5B4",ml:"Malayalam",ms:"Melayu",nl:"Nederlands",no:"Norwegian",pl:"Polski","pt-BR":"Portugu\xEAs (Brasil)",pt:"Portugu\xEAs (Portugal)",ru:"\u0420\u0443\u0441\u0441\u043A\u0438\u0439",sk:"Sloven\u010Dina",sv:"Swedish",th:"\u0E44\u0E17\u0E22",tr:"T\xFCrk\xE7e",uk:"\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430",vi:"Ti\u1EBFng Vi\u1EC7t","zh-Hans":"\u4E2D\u6587 (\u7B80\u4F53)",zh:"\u4E2D\u6587 (\u7E41\u9AD4)",sa:"\u0938\u0902\u0938\u094D\u0915\u0943\u0924",hi:"\u0939\u093F\u0928\u094D\u0926\u0940"};class Is{constructor({adminConfig:s,appPlugins:n,library:r,middlewares:l,reducers:d}){this.customConfigurations=s.config,this.customBootstrapConfiguration=s.bootstrap,this.configurations={authLogo:M,head:{favicon:Qt},locales:["en"],menuLogo:M,notifications:{releases:!0},themes:{light:g.W,dark:E.$},translations:{},tutorials:!0},this.appPlugins=n||{},this.library=r,this.middlewares=l,this.plugins={},this.reducers=d,this.translations={},this.hooksDict={},this.admin={injectionZones:Xt},this.customFields=$.rh,this.menu=[],this.settings={global:{id:"global",intlLabel:{id:"Settings.global",defaultMessage:"Global Settings"},links:[]}}}addComponents=s=>{Array.isArray(s)?s.map(n=>this.library.components.add(n)):this.library.components.add(s)};addCorePluginMenuLink=s=>{const n=JSON.stringify(s);u()(s.to,`link.to should be defined for ${n}`),u()(typeof s.to=="string",`Expected link.to to be a string instead received ${typeof s.to}`),u()(["/plugins/content-type-builder","/plugins/upload"].includes(s.to),"This method is not available for your plugin"),u()(s.intlLabel?.id&&s.intlLabel?.defaultMessage,`link.intlLabel.id & link.intlLabel.defaultMessage for ${n}`),this.menu.push(s)};addFields=s=>{Array.isArray(s)?s.map(n=>this.library.fields.add(n)):this.library.fields.add(s)};addMenuLink=s=>{const n=JSON.stringify(s);u()(s.to,`link.to should be defined for ${n}`),u()(typeof s.to=="string",`Expected link.to to be a string instead received ${typeof s.to}`),u()(s.intlLabel?.id&&s.intlLabel?.defaultMessage,`link.intlLabel.id & link.intlLabel.defaultMessage for ${n}`),u()(s.Component&&typeof s.Component=="function","link.Component should be a valid React Component"),u()(s.icon&&typeof s.icon=="function","link.Icon should be a valid React Component"),this.menu.push(s)};addMiddlewares=s=>{s.forEach(n=>{this.middlewares.add(n)})};addReducers=s=>{Object.keys(s).forEach(n=>{this.reducers.add(n,s[n])})};addSettingsLink=(s,n)=>{u()(this.settings[s],"The section does not exist");const r=JSON.stringify(n);u()(n.id,`link.id should be defined for ${r}`),u()(n.intlLabel?.id&&n.intlLabel?.defaultMessage,`link.intlLabel.id & link.intlLabel.defaultMessage for ${r}`),u()(n.to,`link.to should be defined for ${r}`),u()(n.Component&&typeof n.Component=="function","link.Component should be a valid React Component"),this.settings[s].links.push(n)};addSettingsLinks=(s,n)=>{u()(this.settings[s],"The section does not exist"),u()(Array.isArray(n),"TypeError expected links to be an array"),n.forEach(r=>{this.addSettingsLink(s,r)})};async bootstrap(){Object.keys(this.appPlugins).forEach(s=>{const n=this.appPlugins[s].bootstrap;n&&n({addSettingsLink:this.addSettingsLink,addSettingsLinks:this.addSettingsLinks,getPlugin:this.getPlugin,injectContentManagerComponent:this.injectContentManagerComponent,injectAdminComponent:this.injectAdminComponent,registerHook:this.registerHook})}),N()(this.customBootstrapConfiguration)&&this.customBootstrapConfiguration({addComponents:this.addComponents,addFields:this.addFields,addMenuLink:this.addMenuLink,addReducers:this.addReducers,addSettingsLink:this.addSettingsLink,addSettingsLinks:this.addSettingsLinks,getPlugin:this.getPlugin,injectContentManagerComponent:this.injectContentManagerComponent,injectAdminComponent:this.injectAdminComponent,registerHook:this.registerHook})}bootstrapAdmin=async()=>(await this.createCustomConfigurations(),this.createHook(ot.No),this.createHook(ot.LK),this.createHook(ot.dV),this.createHook(ot.Eo),Promise.resolve());createCustomConfigurations=async()=>{if(this.customConfigurations?.locales&&(this.configurations.locales=["en",...this.customConfigurations.locales?.filter(s=>s!=="en")||[]]),this.customConfigurations?.auth?.logo&&(this.configurations.authLogo=this.customConfigurations.auth.logo),this.customConfigurations?.menu?.logo&&(this.configurations.menuLogo=this.customConfigurations.menu.logo),this.customConfigurations?.head?.favicon&&(this.configurations.head.favicon=this.customConfigurations.head.favicon),this.customConfigurations?.theme){const s=this.customConfigurations.theme.dark,n=this.customConfigurations.theme.light;!s&&!n&&(console.warn("[deprecated] In future versions, Strapi will stop supporting this theme customization syntax. The theme configuration accepts a light and a dark key to customize each theme separately. See https://docs.strapi.io/developer-docs/latest/development/admin-customization.html#theme-extension."),C()(this.configurations.themes.light,this.customConfigurations.theme)),n&&C()(this.configurations.themes.light,n),s&&C()(this.configurations.themes.dark,s)}this.customConfigurations?.notifications?.releases!==void 0&&(this.configurations.notifications.releases=this.customConfigurations.notifications.releases),this.customConfigurations?.tutorials!==void 0&&(this.configurations.tutorials=this.customConfigurations.tutorials)};createHook=s=>{this.hooksDict[s]=Jt()};createSettingSection=(s,n)=>{u()(s.id,"section.id should be defined"),u()(s.intlLabel?.id&&s.intlLabel?.defaultMessage,"section.intlLabel should be defined"),u()(Array.isArray(n),"TypeError expected links to be an array"),u()(this.settings[s.id]===void 0,"A similar section already exists"),this.settings[s.id]={...s,links:[]},n.forEach(r=>{this.addSettingsLink(s.id,r)})};createStore=()=>$t(this.middlewares.middlewares,this.reducers.reducers);getAdminInjectedComponents=(s,n,r)=>{try{return this.admin.injectionZones[s][n][r]||[]}catch(l){return console.error("Cannot get injected component",l),l}};getPlugin=s=>this.plugins[s];async initialize(){Object.keys(this.appPlugins).forEach(s=>{this.appPlugins[s].register(this)})}injectContentManagerComponent=(s,n,r)=>{u()(this.admin.injectionZones.contentManager[s]?.[n],`The ${s} ${n} zone is not defined in the content manager`),u()(r,"A Component must be provided"),this.admin.injectionZones.contentManager[s][n].push(r)};injectAdminComponent=(s,n,r)=>{u()(this.admin.injectionZones.admin[s]?.[n],`The ${s} ${n} zone is not defined in the admin`),u()(r,"A Component must be provided"),this.admin.injectionZones.admin[s][n].push(r)};async loadAdminTrads(){const s=this.configurations.locales.map(l=>t(48224)(`./${l}.json`).then(({default:d})=>({data:d,locale:l})).catch(()=>({data:null,locale:l})));return(await Promise.all(s)).reduce((l,d)=>(d.data&&(l[d.locale]=d.data),l),{})}async loadTrads(){const s=await this.loadAdminTrads(),n=Object.keys(this.appPlugins).map(c=>{const m=this.appPlugins[c].registerTrads;return m?m({locales:this.configurations.locales}):null}).filter(c=>c),l=(await Promise.all(n)).reduce((c,m)=>{const A=m.reduce((L,k)=>(L[k.locale]=k.data,L),{});return Object.keys(A).forEach(L=>{c[L]={...c[L],...A[L]}}),c},{}),d=this.configurations.locales.reduce((c,m)=>(c[m]={...s[m],...l[m]||{},...this.customConfigurations?.translations?.[m]},c),{});return this.configurations.translations=d,Promise.resolve()}registerHook=(s,n)=>{u()(this.hooksDict[s],`The hook ${s} is not defined. You are trying to register a hook that does not exist in the application.`),this.hooksDict[s].register(n)};registerPlugin=s=>{const n=(0,$.Sy)(s);this.plugins[n.pluginId]=n};runHookSeries=(s,n=!1)=>n?this.hooksDict[s].runSeriesAsync():this.hooksDict[s].runSeries();runHookWaterfall=(s,n,r=!1,l)=>r?this.hooksDict[s].runWaterfallAsync(n,l):this.hooksDict[s].runWaterfall(n,l);runHookParallel=s=>this.hooksDict[s].runParallel();render(){const s=this.createStore(),n=j()(Ls,this.configurations.locales||[]),{components:{components:r},fields:{fields:l}}=this.library;return e.createElement(ne,{authLogo:this.configurations.authLogo,components:r,fields:l,customFields:this.customFields,localeNames:n,getAdminInjectedComponents:this.getAdminInjectedComponents,getPlugin:this.getPlugin,messages:this.configurations.translations,menu:this.menu,menuLogo:this.configurations.menuLogo,plugins:this.plugins,runHookParallel:this.runHookParallel,runHookWaterfall:(d,c,m=!1)=>this.runHookWaterfall(d,c,m,s),runHookSeries:this.runHookSeries,themes:this.configurations.themes,settings:this.settings,showTutorials:this.configurations.tutorials,showReleaseNotification:this.configurations.notifications.releases,store:s},e.createElement(e.Fragment,null,e.createElement(X.q,{link:[{rel:"icon",type:"image/png",href:this.configurations.head.favicon}],htmlAttributes:{lang:localStorage.getItem(Pe)||"en"}}),e.createElement(T.VK,{basename:Yt.Z},e.createElement(As,{store:s}))))}}var bs=({adminConfig:o={},appPlugins:s,library:n,middlewares:r,reducers:l})=>new Is({adminConfig:o,appPlugins:s,library:n,middlewares:r,reducers:l})},33229:function(w,p,t){"use strict";var e=t(32735);const g=(0,e.createContext)();p.Z=g},51399:function(w,p,t){"use strict";var e=t(32735),g=t(33229);const E=()=>{const{changeLocale:v,localeNames:u,messages:f}=(0,e.useContext)(g.Z);return{changeLocale:v,localeNames:u,messages:f}};p.Z=E},22773:function(w,p,t){"use strict";t.d(p,{$:function(){return g}});var e=t(30126);function g(){const[E,v]=(0,e.Yw)("STRAPI_NPS_SURVEY_SETTINGS",{enabled:!0,lastResponseDate:null,firstDismissalDate:null,lastDismissalDate:null});return{npsSurveySettings:E,setNpsSurveySettings:v}}},73678:function(w,p,t){"use strict";var e=t(32735),g=t(8471),E=t(79652);const v=g.ZP.img`
|
|
17
|
+
`;var Cs=()=>{const o=(0,i.lm)(),{push:s,location:n}=(0,fe.k6)(),{formatMessage:r}=(0,K.Z)(),[l,d]=(0,e.useState)(),[c,m]=(0,e.useState)(""),{post:R}=(0,i.kY)(),{firstname:A,email:w}=i.I8.getUserInfo(),{hasAdmin:S}=(0,Ps.parse)(n?.search,{ignoreQueryPrefix:!0}),Q=l==="other",X=async(N,ie)=>{N.preventDefault();try{await R("https://analytics.strapi.io/register",{email:w,username:A,firstAdmin:Boolean(!S),persona:{role:ie?void 0:l,otherRole:ie?void 0:c}}),o({type:"success",message:{id:"Usecase.notification.success.project-created",defaultMessage:"Project has been successfully created"}}),s("/")}catch{}};return e.createElement(ee.ZP,null,e.createElement(Ve.o,{labelledBy:"usecase-title"},e.createElement(ee.bU,null,e.createElement("form",{onSubmit:N=>X(N,!1)},e.createElement(he.k,{direction:"column",paddingBottom:7},e.createElement($e.Z,null),e.createElement(de.x,{paddingTop:6,paddingBottom:1,width:(0,i.Q1)(250)},e.createElement(Ts,{variant:"alpha",as:"h1",id:"usecase-title"},r({id:"Usecase.title",defaultMessage:"Tell us a bit more about yourself"})))),e.createElement(he.k,{direction:"column",alignItems:"stretch",gap:6},e.createElement(Es.P,{id:"usecase","data-testid":"usecase",label:r({id:"Usecase.input.work-type",defaultMessage:"What type of work do you do?"}),onChange:d,value:l},Ss.map(({intlLabel:N,value:ie})=>e.createElement(vs.W,{key:ie,value:ie},r(N)))),Q&&e.createElement(xe.o,{name:"other",label:r({id:"Usecase.other",defaultMessage:"Other"}),value:c,onChange:N=>m(N.target.value),"data-testid":"other"}),e.createElement(lt.z,{type:"submit",size:"L",fullWidth:!0,disabled:!l},r({id:"global.finish",defaultMessage:"Finish"}))))),e.createElement(he.k,{justifyContent:"center"},e.createElement(de.x,{paddingTop:4},e.createElement(ys.A,{onClick:()=>X(!0)},r({id:"Usecase.button.skip",defaultMessage:"Skip this question"}))))))},Ft=t(4556);const Ms=(0,e.lazy)(()=>Promise.all([t.e(2659),t.e(801)]).then(t.bind(t,7805)));function Rs(){const o=(0,rt.c)(jt,async()=>(await t.e(3100).then(t.bind(t,73100))).ADMIN_PERMISSIONS_EE,{combine(G,ge){return C()({},G,ge)},defaultValue:jt}),s=(0,rt.c)(Ft.y3,async()=>(await t.e(1386).then(t.bind(t,31386))).ROUTES_EE,{defaultValue:[]}),n=(0,i.lm)(),{updateProjectSettings:r}=(0,ue.um)(),{formatMessage:l}=(0,K.Z)(),[{isLoading:d,hasAdmin:c,uuid:m,deviceId:R},A]=(0,e.useState)({isLoading:!0,hasAdmin:!1}),w=(0,Te.I0)(),S=(0,i.L7)(),{get:Q,post:X}=(0,i.kY)(),N=(0,e.useMemo)(()=>(0,Ut.WW)(s.map(({to:G,Component:ge,exact:te})=>(0,Ut.ot)(ge,G,te))),[s]),[ie,M]=(0,e.useState)(null);(0,e.useEffect)(()=>{w({type:Ft.XS,payload:o})},[o,w]),(0,e.useEffect)(()=>{const G=i.I8.getToken();G&&(async()=>{try{const{data:{data:{token:te}}}=await X("/admin/renew-token",{token:G});i.I8.updateToken(te)}catch{i.I8.clearAppStorage(),window.location.reload()}})()},[X]),(0,e.useEffect)(()=>{(async()=>{try{const{data:{data:{hasAdmin:ge,uuid:te,menuLogo:_e,authLogo:V}}}=await Q("/admin/init");if(r({menuLogo:(0,i.CR)(_e),authLogo:(0,i.CR)(V)}),te){const{data:{data:L}}=await Q("/admin/telemetry-properties",{validateStatus:I=>I<500});M(L);try{const I="didInitializeAdministration";await X("https://analytics.strapi.io/api/v2/track",{event:I,userId:"",deviceId:R,eventPropeties:{},userProperties:{environment:S.currentEnvironment},groupProperties:{...L,projectId:te}},{headers:{"X-Strapi-Event":I}})}catch{}}A({isLoading:!1,hasAdmin:ge,uuid:te,deviceId:R})}catch{n({type:"warning",message:{id:"app.containers.App.notification.error.init"}})}})()},[n,r]);const Ze=G=>A(ge=>({...ge,hasAdmin:G})),Be=(0,e.useMemo)(()=>({uuid:m,telemetryProperties:ie,deviceId:R}),[m,ie,R]);return d?e.createElement(i.dO,null):e.createElement(e.Suspense,{fallback:e.createElement(i.dO,null)},e.createElement(qt.z,null,l({id:"skipToContent"})),e.createElement(i.L8,{value:Be},e.createElement(fe.rs,null,N,e.createElement(fe.AW,{path:"/auth/:authType",render:G=>e.createElement(fs,{...G,setHasAdmin:Ze,hasAdmin:c}),exact:!0}),e.createElement(wt,{path:"/usecase",component:Cs}),e.createElement(wt,{path:"/",component:Ms}),e.createElement(fe.AW,{path:"",component:hs.default}))))}var As=Rs,Ls={ar:"\u0627\u0644\u0639\u0631\u0628\u064A\u0629",ca:"Catal\xE0",cs:"\u010Ce\u0161tina",de:"Deutsch",dk:"Dansk",en:"English",es:"Espa\xF1ol",eu:"Euskara",fr:"Fran\xE7ais",gu:"Gujarati",he:"\u05E2\u05D1\u05E8\u05D9\u05EA",hu:"Magyar",id:"Indonesian",it:"Italiano",ja:"\u65E5\u672C\u8A9E",ko:"\uD55C\uAD6D\uC5B4",ml:"Malayalam",ms:"Melayu",nl:"Nederlands",no:"Norwegian",pl:"Polski","pt-BR":"Portugu\xEAs (Brasil)",pt:"Portugu\xEAs (Portugal)",ru:"\u0420\u0443\u0441\u0441\u043A\u0438\u0439",sk:"Sloven\u010Dina",sv:"Swedish",th:"\u0E44\u0E17\u0E22",tr:"T\xFCrk\xE7e",uk:"\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430",vi:"Ti\u1EBFng Vi\u1EC7t","zh-Hans":"\u4E2D\u6587 (\u7B80\u4F53)",zh:"\u4E2D\u6587 (\u7E41\u9AD4)",sa:"\u0938\u0902\u0938\u094D\u0915\u0943\u0924",hi:"\u0939\u093F\u0928\u094D\u0926\u0940"};class Is{constructor({adminConfig:s,appPlugins:n,library:r,middlewares:l,reducers:d}){this.customConfigurations=s.config,this.customBootstrapConfiguration=s.bootstrap,this.configurations={authLogo:T,head:{favicon:Qt},locales:["en"],menuLogo:T,notifications:{releases:!0},themes:{light:g.W,dark:E.$},translations:{},tutorials:!0},this.appPlugins=n||{},this.library=r,this.middlewares=l,this.plugins={},this.reducers=d,this.translations={},this.hooksDict={},this.admin={injectionZones:Xt},this.customFields=Y.rh,this.menu=[],this.settings={global:{id:"global",intlLabel:{id:"Settings.global",defaultMessage:"Global Settings"},links:[]}}}addComponents=s=>{Array.isArray(s)?s.map(n=>this.library.components.add(n)):this.library.components.add(s)};addCorePluginMenuLink=s=>{const n=JSON.stringify(s);u()(s.to,`link.to should be defined for ${n}`),u()(typeof s.to=="string",`Expected link.to to be a string instead received ${typeof s.to}`),u()(["/plugins/content-type-builder","/plugins/upload"].includes(s.to),"This method is not available for your plugin"),u()(s.intlLabel?.id&&s.intlLabel?.defaultMessage,`link.intlLabel.id & link.intlLabel.defaultMessage for ${n}`),this.menu.push(s)};addFields=s=>{Array.isArray(s)?s.map(n=>this.library.fields.add(n)):this.library.fields.add(s)};addMenuLink=s=>{const n=JSON.stringify(s);u()(s.to,`link.to should be defined for ${n}`),u()(typeof s.to=="string",`Expected link.to to be a string instead received ${typeof s.to}`),u()(s.intlLabel?.id&&s.intlLabel?.defaultMessage,`link.intlLabel.id & link.intlLabel.defaultMessage for ${n}`),u()(s.Component&&typeof s.Component=="function","link.Component should be a valid React Component"),u()(s.icon&&typeof s.icon=="function","link.Icon should be a valid React Component"),this.menu.push(s)};addMiddlewares=s=>{s.forEach(n=>{this.middlewares.add(n)})};addReducers=s=>{Object.keys(s).forEach(n=>{this.reducers.add(n,s[n])})};addSettingsLink=(s,n)=>{u()(this.settings[s],"The section does not exist");const r=JSON.stringify(n);u()(n.id,`link.id should be defined for ${r}`),u()(n.intlLabel?.id&&n.intlLabel?.defaultMessage,`link.intlLabel.id & link.intlLabel.defaultMessage for ${r}`),u()(n.to,`link.to should be defined for ${r}`),u()(n.Component&&typeof n.Component=="function","link.Component should be a valid React Component"),this.settings[s].links.push(n)};addSettingsLinks=(s,n)=>{u()(this.settings[s],"The section does not exist"),u()(Array.isArray(n),"TypeError expected links to be an array"),n.forEach(r=>{this.addSettingsLink(s,r)})};async bootstrap(){Object.keys(this.appPlugins).forEach(s=>{const n=this.appPlugins[s].bootstrap;n&&n({addSettingsLink:this.addSettingsLink,addSettingsLinks:this.addSettingsLinks,getPlugin:this.getPlugin,injectContentManagerComponent:this.injectContentManagerComponent,injectAdminComponent:this.injectAdminComponent,registerHook:this.registerHook})}),W()(this.customBootstrapConfiguration)&&this.customBootstrapConfiguration({addComponents:this.addComponents,addFields:this.addFields,addMenuLink:this.addMenuLink,addReducers:this.addReducers,addSettingsLink:this.addSettingsLink,addSettingsLinks:this.addSettingsLinks,getPlugin:this.getPlugin,injectContentManagerComponent:this.injectContentManagerComponent,injectAdminComponent:this.injectAdminComponent,registerHook:this.registerHook})}bootstrapAdmin=async()=>(await this.createCustomConfigurations(),this.createHook(ot.No),this.createHook(ot.LK),this.createHook(ot.dV),this.createHook(ot.Eo),Promise.resolve());createCustomConfigurations=async()=>{if(this.customConfigurations?.locales&&(this.configurations.locales=["en",...this.customConfigurations.locales?.filter(s=>s!=="en")||[]]),this.customConfigurations?.auth?.logo&&(this.configurations.authLogo=this.customConfigurations.auth.logo),this.customConfigurations?.menu?.logo&&(this.configurations.menuLogo=this.customConfigurations.menu.logo),this.customConfigurations?.head?.favicon&&(this.configurations.head.favicon=this.customConfigurations.head.favicon),this.customConfigurations?.theme){const s=this.customConfigurations.theme.dark,n=this.customConfigurations.theme.light;!s&&!n&&(console.warn("[deprecated] In future versions, Strapi will stop supporting this theme customization syntax. The theme configuration accepts a light and a dark key to customize each theme separately. See https://docs.strapi.io/developer-docs/latest/development/admin-customization.html#theme-extension."),C()(this.configurations.themes.light,this.customConfigurations.theme)),n&&C()(this.configurations.themes.light,n),s&&C()(this.configurations.themes.dark,s)}this.customConfigurations?.notifications?.releases!==void 0&&(this.configurations.notifications.releases=this.customConfigurations.notifications.releases),this.customConfigurations?.tutorials!==void 0&&(this.configurations.tutorials=this.customConfigurations.tutorials)};createHook=s=>{this.hooksDict[s]=Jt()};createSettingSection=(s,n)=>{u()(s.id,"section.id should be defined"),u()(s.intlLabel?.id&&s.intlLabel?.defaultMessage,"section.intlLabel should be defined"),u()(Array.isArray(n),"TypeError expected links to be an array"),u()(this.settings[s.id]===void 0,"A similar section already exists"),this.settings[s.id]={...s,links:[]},n.forEach(r=>{this.addSettingsLink(s.id,r)})};createStore=()=>$t(this.middlewares.middlewares,this.reducers.reducers);getAdminInjectedComponents=(s,n,r)=>{try{return this.admin.injectionZones[s][n][r]||[]}catch(l){return console.error("Cannot get injected component",l),l}};getPlugin=s=>this.plugins[s];async initialize(){Object.keys(this.appPlugins).forEach(s=>{this.appPlugins[s].register(this)})}injectContentManagerComponent=(s,n,r)=>{u()(this.admin.injectionZones.contentManager[s]?.[n],`The ${s} ${n} zone is not defined in the content manager`),u()(r,"A Component must be provided"),this.admin.injectionZones.contentManager[s][n].push(r)};injectAdminComponent=(s,n,r)=>{u()(this.admin.injectionZones.admin[s]?.[n],`The ${s} ${n} zone is not defined in the admin`),u()(r,"A Component must be provided"),this.admin.injectionZones.admin[s][n].push(r)};async loadAdminTrads(){const s=this.configurations.locales.map(l=>t(48224)(`./${l}.json`).then(({default:d})=>({data:d,locale:l})).catch(()=>({data:null,locale:l})));return(await Promise.all(s)).reduce((l,d)=>(d.data&&(l[d.locale]=d.data),l),{})}async loadTrads(){const s=await this.loadAdminTrads(),n=Object.keys(this.appPlugins).map(c=>{const m=this.appPlugins[c].registerTrads;return m?m({locales:this.configurations.locales}):null}).filter(c=>c),l=(await Promise.all(n)).reduce((c,m)=>{const R=m.reduce((A,w)=>(A[w.locale]=w.data,A),{});return Object.keys(R).forEach(A=>{c[A]={...c[A],...R[A]}}),c},{}),d=this.configurations.locales.reduce((c,m)=>(c[m]={...s[m],...l[m]||{},...this.customConfigurations?.translations?.[m]},c),{});return this.configurations.translations=d,Promise.resolve()}registerHook=(s,n)=>{u()(this.hooksDict[s],`The hook ${s} is not defined. You are trying to register a hook that does not exist in the application.`),this.hooksDict[s].register(n)};registerPlugin=s=>{const n=(0,Y.Sy)(s);this.plugins[n.pluginId]=n};runHookSeries=(s,n=!1)=>n?this.hooksDict[s].runSeriesAsync():this.hooksDict[s].runSeries();runHookWaterfall=(s,n,r=!1,l)=>r?this.hooksDict[s].runWaterfallAsync(n,l):this.hooksDict[s].runWaterfall(n,l);runHookParallel=s=>this.hooksDict[s].runParallel();render(){const s=this.createStore(),n=U()(Ls,this.configurations.locales||[]),{components:{components:r},fields:{fields:l}}=this.library;return e.createElement(ne,{authLogo:this.configurations.authLogo,components:r,fields:l,customFields:this.customFields,localeNames:n,getAdminInjectedComponents:this.getAdminInjectedComponents,getPlugin:this.getPlugin,messages:this.configurations.translations,menu:this.menu,menuLogo:this.configurations.menuLogo,plugins:this.plugins,runHookParallel:this.runHookParallel,runHookWaterfall:(d,c,m=!1)=>this.runHookWaterfall(d,c,m,s),runHookSeries:this.runHookSeries,themes:this.configurations.themes,settings:this.settings,showTutorials:this.configurations.tutorials,showReleaseNotification:this.configurations.notifications.releases,store:s},e.createElement(e.Fragment,null,e.createElement(q.q,{link:[{rel:"icon",type:"image/png",href:this.configurations.head.favicon}],htmlAttributes:{lang:localStorage.getItem(Pe)||"en"}}),e.createElement(D.VK,{basename:Yt.Z},e.createElement(As,{store:s}))))}}var bs=({adminConfig:o={},appPlugins:s,library:n,middlewares:r,reducers:l})=>new Is({adminConfig:o,appPlugins:s,library:n,middlewares:r,reducers:l})},33229:function(j,p,t){"use strict";var e=t(32735);const g=(0,e.createContext)();p.Z=g},51399:function(j,p,t){"use strict";var e=t(32735),g=t(33229);const E=()=>{const{changeLocale:v,localeNames:u,messages:f}=(0,e.useContext)(g.Z);return{changeLocale:v,localeNames:u,messages:f}};p.Z=E},22773:function(j,p,t){"use strict";t.d(p,{$:function(){return g}});var e=t(30126);function g(){const[E,v]=(0,e.Yw)("STRAPI_NPS_SURVEY_SETTINGS",{enabled:!0,lastResponseDate:null,firstDismissalDate:null,lastDismissalDate:null});return{npsSurveySettings:E,setNpsSurveySettings:v}}},73678:function(j,p,t){"use strict";var e=t(32735),g=t(8471),E=t(79652);const v=g.ZP.img`
|
|
18
18
|
height: ${72/16}rem;
|
|
19
|
-
`,u=()=>{const{logos:{auth:f}}=(0,E.um)();return e.createElement(v,{src:f?.custom??f.default,"aria-hidden":!0,alt:""})};p.Z=u},76402:function(
|
|
19
|
+
`,u=()=>{const{logos:{auth:f}}=(0,E.um)();return e.createElement(v,{src:f?.custom??f.default,"aria-hidden":!0,alt:""})};p.Z=u},76402:function(j,p,t){"use strict";t.d(p,{ux:function(){return E},_5:function(){return u},$l:function(){return W},Rj:function(){return C}});var e=t(32735),E=(0,e.createContext)({}),u=(0,e.createContext)({}),W=(0,e.createContext)({}),C=(0,e.createContext)({})},35231:function(j,p){"use strict";const t="/admin/".replace(window.location.origin,"");p.Z=t},66941:function(j,p,t){"use strict";t.d(p,{Eo:function(){return E},LK:function(){return g},No:function(){return e},dV:function(){return v}});const e="Admin/CM/pages/ListView/inject-column-in-table",g="Admin/CM/pages/App/mutate-collection-types-links",E="Admin/CM/pages/EditView/mutate-edit-view-layout",v="Admin/CM/pages/App/mutate-single-types-links"},79652:function(j,p,t){"use strict";t.d(p,{um:function(){return v},H9:function(){return Te},$_:function(){return De},rW:function(){return We},G4:function(){return gt},Te:function(){return vt},M1:function(){return Pt}});var e=t(32735),g=t(76402),v=()=>(0,e.useContext)(g._5),u=t(90769),f=t(30126),W=t(601),H=t(90230),C=t(19594),b=t(15062),U=t(30305),q=t(99381),D=t.n(q),B=(P,h)=>h.map(({permissions:y})=>(0,f.qX)(P,y)),i=async(P,h,y)=>{const F=B(P,h),le=await Promise.all(F),z=h.filter((K,ue)=>le[ue]),se=z.findIndex(K=>K.to==="/settings");if(se===-1)return[];const re=D()(z);return re[se].notificationsCount=y?1:0,re},a=async(P,h)=>{const y=B(P,h),F=await Promise.all(y);return h.filter((z,se)=>F[se])},Te=()=>{const{allPermissions:P}=(0,f.vn)(),{shouldUpdateStrapi:h}=(0,f.L7)(),{menu:y}=(0,f.j1)(),F=(0,b.v9)(U._),[le,z]=e.useState({generalSectionLinks:[{icon:W.Z,intlLabel:{id:"global.plugins",defaultMessage:"Plugins"},to:"/list-plugins",permissions:F.marketplace.main},{icon:H.Z,intlLabel:{id:"global.marketplace",defaultMessage:"Marketplace"},to:"/marketplace",permissions:F.marketplace.main},{icon:C.Z,intlLabel:{id:"global.settings",defaultMessage:"Settings"},to:"/settings",permissions:[],notificationsCount:0}],pluginsSectionLinks:[],isLoading:!0}),se=e.useRef(le.generalSectionLinks);return e.useEffect(()=>{async function re(){const K=await a(P,y),ue=await i(P,se.current,h);z(O=>({...O,generalSectionLinks:ue,pluginsSectionLinks:K,isLoading:!1}))}re()},[z,se,P,y,F,h]),le},De=()=>(0,e.useContext)(g.$l),We=(P,h,y,F)=>{const[le,z]=(0,e.useState)(!1),se=(0,f.lm)(),{post:re}=(0,f.kY)(),{formatAPIError:K}=(0,f.So)();return{regenerateData:async()=>{try{const{data:{data:{accessKey:O}}}=await re(`${P}${h}/regenerate`);z(!1),y(O)}catch(O){z(!1),F?F(O):se({type:"warning",message:K(O)})}},isLoadingConfirmation:le}};const Qe=!JSON.parse(localStorage.getItem("STRAPI_UPDATE_NOTIF")),oe=()=>{const{latestStrapiReleaseTag:P,shouldUpdateStrapi:h}=useAppInfo(),y=useNotification();return useEffect(()=>{h&&Qe&&y({type:"info",message:{id:"notification.version.update.message"},link:{url:`https://github.com/strapi/strapi/releases/tag/${P}`,label:{id:"global.see-more"}},blockTransition:!0,onClose:()=>localStorage.setItem("STRAPI_UPDATE_NOTIF",!0)})},[P,h,y]),null};var He=null,Ce=t(9086),Me=t.n(Ce),Ie=t(90869),Xe=(P,h)=>({...P,fieldsToPick:h}),Ke=t(97889),et=t(88423),ke=t.n(et),qe=t(3040),mt=t.n(qe),ye=t(56236),Lt=t.n(ye);const tt={fieldsToPick:[],formErrors:{},initialData:{},isLoading:!0,modifiedData:{},showHeaderButtonLoader:!1,showHeaderLoader:!0},st=(P,h)=>(0,Ke.ZP)(P,y=>{switch(h.type){case"GET_DATA_SUCCEEDED":{y.isLoading=!1,y.showHeaderLoader=!1,y.initialData=ke()(h.data,P.fieldsToPick),y.modifiedData=ke()(h.data,P.fieldsToPick);break}case"ON_CANCEL":{y.modifiedData=P.initialData,y.formErrors={};break}case"ON_CHANGE":{h.inputType==="password"&&!h.value?Lt()(y.modifiedData,h.keys.split(".")):h.keys.includes("username")&&!h.value?mt()(y.modifiedData,h.keys.split("."),null):mt()(y.modifiedData,h.keys.split("."),h.value);break}case"ON_SUBMIT":{y.showHeaderButtonLoader=!0;break}case"ON_SUBMIT_SUCCEEDED":{y.initialData=ke()(h.data,P.fieldsToPick),y.modifiedData=ke()(h.data,P.fieldsToPick),y.showHeaderButtonLoader=!1;break}case"SET_ERRORS":{y.formErrors=h.errors,y.showHeaderButtonLoader=!1;break}default:return y}});var gt=(P,h,y,F)=>{const[{formErrors:le,initialData:z,isLoading:se,modifiedData:re,showHeaderButtonLoader:K,showHeaderLoader:ue},O]=(0,e.useReducer)(st,tt,()=>Xe(tt,F)),_=(0,f.lm)(),{lockApp:Ae,unlockApp:Fe}=(0,f.o1)(),{get:ze,put:Le}=(0,f.kY)();return(0,e.useEffect)(()=>{P&&(async()=>{try{const{data:{data:ne}}=await ze(P);O({type:"GET_DATA_SUCCEEDED",data:ne,fieldsToPick:F})}catch(ne){console.error(ne.response),_({type:"warning",message:{id:"notification.error"}})}})()},[P]),[{formErrors:le,initialData:z,isLoading:se,modifiedData:re,showHeaderButtonLoader:K,showHeaderLoader:ue},O,{handleCancel:()=>{O({type:"ON_CANCEL"})},handleChange:({target:{name:ce,value:ne,type:Y}})=>{O({type:"ON_CHANGE",inputType:Y,keys:ce,value:ne})},handleSubmit:async ce=>{ce.preventDefault();const ne=await(0,Ie.R6)(re,h);if(O({type:"SET_ERRORS",errors:ne||{}}),!ne)try{Ae(),O({type:"ON_SUBMIT"});const Y=Me()(re,["confirmPassword","registrationToken"]);Y.roles&&(Y.roles=Y.roles.map(Ue=>Ue.id)),Y.ssoLockedRoles&&(Y.ssoLockedRoles=[...new Set(Y.ssoLockedRoles)]);const{data:{data:J}}=await Le(P,Y);y(J),O({type:"ON_SUBMIT_SUCCEEDED",data:J}),_({type:"success",message:{id:"notification.success.saved"}})}catch(Y){const J=Y?.response?.payload??{data:{}};J?.data&&typeof J.data=="string"?_({type:"warning",message:J.data}):_({type:"warning",message:J.message});const Ue=(0,Ie.Iz)(J);O({type:"SET_ERRORS",errors:Ue})}finally{Fe()}},setField:(ce,ne)=>{O({type:"ON_CHANGE",keys:ce,value:ne})}}]},It=t(9592);const pt={global:[{intlLabel:{id:"Settings.application.title",defaultMessage:"Overview"},to:"/settings/application-infos",id:"000-application-infos",permissions:[]},{intlLabel:{id:"Settings.webhooks.title",defaultMessage:"Webhooks"},to:"/settings/webhooks",id:"webhooks"},{intlLabel:{id:"Settings.apiTokens.title",defaultMessage:"API Tokens"},to:"/settings/api-tokens?sort=name:ASC",id:"api-tokens"},{intlLabel:{id:"Settings.transferTokens.title",defaultMessage:"Transfer Tokens"},to:"/settings/transfer-tokens?sort=name:ASC",id:"transfer-tokens"}],admin:[{intlLabel:{id:"global.roles",defaultMessage:"Roles"},to:"/settings/roles",id:"roles"},{intlLabel:{id:"global.users"},to:"/settings/users?pageSize=10&page=1&sort=firstname",id:"users"}]};var ft=P=>P.map(h=>{const y=h.links.map(F=>({...F,isDisplayed:!1}));return{...h,links:y}}),nt=t(98978),ht=t.n(nt),Et=P=>ht()(P,h=>h.id),vt=()=>{const[{isLoading:P,menu:h},y]=(0,e.useState)({isLoading:!0,menu:[]}),{allPermissions:F}=(0,f.vn)(),{shouldUpdateStrapi:le}=(0,f.L7)(),{settings:z}=(0,f.j1)(),se=(0,b.v9)(U._),{global:re,admin:K}=(0,It.c)(pt,async()=>(await t.e(918).then(t.bind(t,50918))).LINKS_EE,{combine(_,Ae){return{admin:[...Ae.admin,..._.admin],global:[..._.global,...Ae.global]}},defaultValue:{admin:[],global:[]}}),ue=(0,e.useCallback)(_=>{if(!_.id)throw new Error("The settings menu item must have an id attribute.");return{..._,permissions:se.settings?.[_.id]?.main}},[se.settings]);(0,e.useEffect)(()=>{const _=async()=>{const at=await(we=>Promise.all(we.reduce((je,Ge,ce)=>{const ne=Y=>Y.map(async(J,Ue)=>({hasPermission:await(0,f.qX)(F,J.permissions),sectionIndex:ce,linkIndex:Ue}));return[...je,...ne(Ge.links)]},[])))(ze);y(we=>({...we,isLoading:!1,menu:ze.map((je,Ge)=>({...je,links:je.links.map((ce,ne)=>{const Y=at.find(J=>J.sectionIndex===Ge&&J.linkIndex===ne);return{...ce,isDisplayed:Boolean(Y.hasPermission)}})}))}))},{global:Ae,...Fe}=z,ze=ft([{...z.global,links:Et([...z.global.links,...re.map(ue)]).map(Le=>({...Le,hasNotification:Le.id==="000-application-infos"&&le}))},{id:"permissions",intlLabel:{id:"Settings.permissions",defaultMessage:"Administration Panel"},links:K.map(ue)},...Object.values(Fe)]);_()},[K,re,F,z,le,ue]);const O=_=>({..._,links:_.links.filter(Ae=>Ae.isDisplayed)});return{isLoading:P,menu:h.map(O)}},Pt=()=>(0,e.useContext)(g.Rj)},90769:function(j,p,t){"use strict";t.d(p,{G:function(){return v}});var e=t(32735),g=t(30126),E=t(20108);function v(){const{get:u}=(0,g.kY)(),{formatAPIError:f}=(0,g.So)(),W=(0,g.lm)(),H=(0,E.useQueries)(["components","content-types"].map(T=>({queryKey:["content-manager",T],async queryFn(){const{data:{data:B}}=await u(`/content-manager/${T}`);return B},onError(B){W({type:"warning",message:f(B)})}}))),[C,b]=H,U=C.isLoading||b.isLoading,q=e.useMemo(()=>(b?.data??[]).filter(T=>T.kind==="collectionType"&&T.isDisplayed),[b?.data]),D=e.useMemo(()=>(b?.data??[]).filter(T=>T.kind!=="collectionType"&&T.isDisplayed),[b?.data]);return{isLoading:U,components:e.useMemo(()=>C?.data??[],[C?.data]),collectionTypes:q,singleTypes:D}}},9592:function(j,p,t){"use strict";t.d(p,{c:function(){return v}});var e=t(32735),g=t(30126);function E(){return window.strapi.isEE}function v(u,f,{defaultValue:W=null,combine:H=(b,U)=>U,enabled:C=!0}={}){const b=(0,g.W6)(f),U=(0,g.W6)(H),[{data:q},D]=e.useState({data:E()&&C?W:u});return e.useEffect(()=>{async function T(){const B=await b();D({data:U(u,B)})}E()&&C&&T()},[u,b,U,C]),q}},11060:function(j,p,t){"use strict";t.d(p,{sg:function(){return D},bU:function(){return T},ZP:function(){return Pe}});var e=t(32735),g=t(77981),E=t(84642),v=t(60216),u=t.n(v),f=t(8471),W=t(4987),H=t(67879),C=t(51399),U=()=>{const{changeLocale:i,localeNames:be}=(0,C.Z)(),{locale:a}=(0,H.Z)();return e.createElement(W.q4,{value:a,onChange:Se=>i(Se)},Object.entries(be).map(([Se,Te])=>e.createElement(W.ag,{key:Se,value:Se},Te)))};const q=(0,f.ZP)(g.x)`
|
|
20
20
|
margin: 0 auto;
|
|
21
21
|
width: 552px;
|
|
22
|
-
`,
|
|
22
|
+
`,D=(0,f.ZP)(E.k)`
|
|
23
23
|
flex-direction: column;
|
|
24
|
-
`,
|
|
24
|
+
`,T=({children:i})=>e.createElement(q,{shadow:"tableShadow",hasRadius:!0,paddingTop:9,paddingBottom:9,paddingLeft:10,paddingRight:10,background:"neutral0",justifyContent:"center"},i);T.propTypes={children:u().node.isRequired};const B=({children:i})=>e.createElement("div",null,e.createElement(E.k,{as:"header",justifyContent:"flex-end"},e.createElement(g.x,{paddingTop:6,paddingRight:8},e.createElement(U,null))),e.createElement(g.x,{paddingTop:2,paddingBottom:11},i));B.propTypes={children:u().node.isRequired};var Pe=B},30305:function(j,p,t){"use strict";t.d(p,{_:function(){return v}});var e=t(98178),g=t(69891);const E=()=>u=>u.admin_app||g.E,v=(0,e.P1)(E(),u=>u.permissions)},24018:function(j,p,t){"use strict";var e=t(78495),g=t(8471);const E=(0,g.ZP)(e.E)`
|
|
25
25
|
svg {
|
|
26
26
|
height: 1rem;
|
|
27
27
|
width: 1rem;
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
fill: ${({theme:v})=>v.colors.neutral600};
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
`;p.Z=E},24436:function(
|
|
32
|
+
`;p.Z=E},24436:function(j,p,t){"use strict";var e=t(32735),g=t(2846),E=t(95162),v=t(77981),u=t(8365),f=t(84642),W=t(31014),H=t(91779),C=t(30126),b=t(10364),U=t(62161),q=t(92802),D=t(60216),T=t.n(D),B=t(67879),Pe=t(8471),i=t(73678),be=t(11060),a=t(24018);const Se=(0,Pe.ZP)(g.o)`
|
|
33
33
|
::-ms-reveal {
|
|
34
34
|
display: none;
|
|
35
35
|
}
|
|
36
|
-
`,Te=({onSubmit:Ne,schema:De,children:Je})=>{const[We,Qe]=(0,e.useState)(!1),{formatMessage:oe}=(0,
|
|
36
|
+
`,Te=({onSubmit:Ne,schema:De,children:Je})=>{const[We,Qe]=(0,e.useState)(!1),{formatMessage:oe}=(0,B.Z)();return e.createElement(E.o,null,e.createElement(be.bU,null,e.createElement(q.J9,{enableReinitialize:!0,initialValues:{email:"",password:"",rememberMe:!1},onSubmit:Ne,validationSchema:De,validateOnChange:!1},({values:He,errors:Ce,handleChange:Me})=>e.createElement(C.l0,{noValidate:!0},e.createElement(be.sg,null,e.createElement(i.Z,null),e.createElement(v.x,{paddingTop:6,paddingBottom:1},e.createElement(u.Z,{variant:"alpha",as:"h1"},oe({id:"Auth.form.welcome.title",defaultMessage:"Welcome!"}))),e.createElement(v.x,{paddingBottom:7},e.createElement(u.Z,{variant:"epsilon",textColor:"neutral600"},oe({id:"Auth.form.welcome.subtitle",defaultMessage:"Log in to your Strapi account"}))),Ce.errorMessage&&e.createElement(u.Z,{id:"global-form-error",role:"alert",tabIndex:-1,textColor:"danger600"},Ce.errorMessage)),e.createElement(f.k,{direction:"column",alignItems:"stretch",gap:6},e.createElement(g.o,{error:Ce.email?oe({id:Ce.email,defaultMessage:"This value is required."}):"",value:He.email,onChange:Me,label:oe({id:"Auth.form.email.label",defaultMessage:"Email"}),placeholder:oe({id:"Auth.form.email.placeholder",defaultMessage:"kai@doe.com"}),name:"email",required:!0}),e.createElement(Se,{error:Ce.password?oe({id:Ce.password,defaultMessage:"This value is required."}):"",onChange:Me,value:He.password,label:oe({id:"global.password",defaultMessage:"Password"}),name:"password",type:We?"text":"password",endAction:e.createElement(a.Z,{onClick:Ie=>{Ie.stopPropagation(),Qe(Oe=>!Oe)},label:oe(We?{id:"Auth.form.password.show-password",defaultMessage:"Show password"}:{id:"Auth.form.password.hide-password",defaultMessage:"Hide password"})},We?e.createElement(b.Z,null):e.createElement(U.Z,null)),required:!0}),e.createElement(W.X,{onValueChange:Ie=>{Me({target:{value:Ie,name:"rememberMe"}})},value:He.rememberMe,"aria-label":"rememberMe",name:"rememberMe"},oe({id:"Auth.form.rememberMe.label",defaultMessage:"Remember me"})),e.createElement(H.z,{fullWidth:!0,type:"submit"},oe({id:"Auth.form.button.login",defaultMessage:"Login"}))))),Je),e.createElement(f.k,{justifyContent:"center"},e.createElement(v.x,{paddingTop:4},e.createElement(C.rU,{to:"/auth/forgot-password"},oe({id:"Auth.link.forgot-password",defaultMessage:"Forgot your password?"})))))};Te.defaultProps={children:null,onSubmit(){}},Te.propTypes={children:T().node,onSubmit:T().func,schema:T().shape({type:T().string.isRequired}).isRequired},p.Z=Te},33248:function(j,p,t){"use strict";t.r(p);var e=t(32735),g=t(95162),E=t(64092),v=t(56932),u=t(80564),f=t(30126),W=t(25919),H=t(29213),C=t(67879);const b=()=>{const{formatMessage:U}=(0,C.Z)();return(0,f.go)(),e.createElement(g.o,{labelledBy:"title"},e.createElement(E.T,{id:"title",title:U({id:"content-manager.pageNotFound",defaultMessage:"Page not found"})}),e.createElement(v.D,null,e.createElement(u.x,{action:e.createElement(f.Qj,{variant:"secondary",endIcon:e.createElement(W.Z,null),to:"/"},U({id:"app.components.NotFoundPage.back",defaultMessage:"Back to homepage"})),content:U({id:"app.page.not.found",defaultMessage:"Oops! We can't seem to find the page you're looging for..."}),hasRadius:!0,icon:e.createElement(H.Z,{width:"10rem"}),shadow:"tableShadow"})))};p.default=b},63602:function(j,p,t){"use strict";var e=t(32735),g=t(30126),E=t(60216),v=t.n(E),u=t(53038);const f=({loadComponent:H})=>{const[C,b]=(0,e.useState)(null);return(0,e.useEffect)(()=>{(async()=>{try{const q=await H();b(()=>q.default)}catch(q){console.log(q)}})()},[H]),C?e.createElement(C,null):e.createElement(g.dO,null)},W=(H,C,b)=>e.createElement(u.AW,{render:()=>e.createElement(f,{loadComponent:H}),key:C,path:C,exact:b||!1});f.propTypes={loadComponent:v().func.isRequired},p.Z=W},5074:function(j,p){"use strict";const t=({data:e})=>{try{return Object.keys(e).reduce((g,E)=>{const v=e[E][0];return g[E]={id:v,defaultMessage:v},g},{})}catch{return{}}};p.Z=t},90869:function(j,p,t){"use strict";t.d(p,{R6:function(){return E},ot:function(){return v.Z},Iz:function(){return u.Z},Pp:function(){return f},Qy:function(){return q},WW:function(){return W.Z}});var e=t(30126),E=async(D,T)=>{let B=null;try{await T.validate(D,{abortEarly:!1})}catch(Pe){B=(0,e.CJ)(Pe)}return B},v=t(63602),u=t(5074),f=(D,T="")=>[D,T].filter(B=>B).join(" "),W=t(18805),H=t(98978);const C=D=>sortBy(D,T=>T.name);var b=null;const U={bufferToHex(D){return[...new Uint8Array(D)].map(T=>T.toString(16).padStart(2,"0")).join("")},async digestMessage(D){const T=new TextEncoder().encode(D),B=await crypto.subtle.digest("SHA-256",T);return this.bufferToHex(B)}};async function q(D){if(!D)return null;try{return await U.digestMessage(D.email)}catch{return null}}},18805:function(j,p){"use strict";const t=e=>e.filter((g,E,v)=>v.findIndex(u=>u.key===g.key)===E);p.Z=t},48224:function(j,p,t){var e={"./ar.json":[38677,7958],"./ca.json":[90169,3516],"./cs.json":[43186,7519],"./de.json":[8343,6901],"./dk.json":[65668,7898],"./en.json":[10329,320],"./es.json":[45445,8367],"./eu.json":[69511,8360],"./fr.json":[8399,8006],"./gu.json":[10182,2248],"./he.json":[21757,830],"./hi.json":[43206,6332],"./hu.json":[72320,5894],"./id.json":[74221,8897],"./it.json":[90685,6817],"./ja.json":[21727,1312],"./ko.json":[30986,1377],"./ml.json":[11309,9903],"./ms.json":[75973,3025],"./nl.json":[80381,2671],"./no.json":[82446,562],"./pl.json":[84008,7846],"./pt-BR.json":[91417,9647],"./pt.json":[41830,3340],"./ru.json":[57098,123],"./sa.json":[92900,9726],"./sk.json":[52204,606],"./sv.json":[43211,9303],"./th.json":[49582,749],"./tr.json":[99154,395],"./uk.json":[2987,7403],"./vi.json":[50576,3278],"./zh-Hans.json":[35964,2553],"./zh.json":[91999,1011]};function g(E){if(!t.o(e,E))return Promise.resolve().then(function(){var f=new Error("Cannot find module '"+E+"'");throw f.code="MODULE_NOT_FOUND",f});var v=e[E],u=v[0];return t.e(v[1]).then(function(){return t.t(u,19)})}g.keys=function(){return Object.keys(e)},g.id=48224,j.exports=g},47750:function(j,p,t){"use strict";j.exports=t.p+"70674f63fc3904c20de0.svg"}}]);
|