@strapi/admin 4.4.2 → 4.4.4
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/StrapiApp.js +14 -2
- package/admin/src/content-manager/components/DynamicTable/CellContent/index.js +10 -0
- package/admin/src/content-manager/components/PreviewWysiwyg/index.js +1 -1
- package/admin/src/content-manager/components/SelectOne/SingleValue.js +4 -1
- package/admin/src/content-manager/pages/ListSettingsView/components/DraggableCard.js +3 -3
- package/admin/src/content-manager/pages/ListSettingsView/components/Settings.js +2 -2
- package/admin/src/content-manager/pages/ListSettingsView/components/SortDisplayedFields.js +1 -1
- package/admin/src/core/apis/CustomFields.js +0 -1
- package/admin/src/core/store/configureStore.js +17 -2
- package/admin/src/favicon.png +0 -0
- package/admin/src/pages/App/index.js +1 -1
- package/admin/src/pages/HomePage/SocialLinks.js +1 -1
- package/admin/src/pages/MarketplacePage/components/NpmPackageCard/CardButton.js +110 -0
- package/admin/src/pages/MarketplacePage/components/NpmPackageCard/InstallPluginButton.js +32 -21
- package/admin/src/pages/MarketplacePage/components/NpmPackageCard/index.js +7 -0
- package/admin/src/pages/MarketplacePage/components/NpmPackagesGrid/index.js +4 -0
- package/admin/src/pages/MarketplacePage/index.js +2 -1
- package/admin/src/translations/en.json +7 -5
- package/build/{Admin-authenticatedApp.45cb8bc8.chunk.js → Admin-authenticatedApp.48c67745.chunk.js} +2 -2
- package/build/{Admin_homePage.6d5e3236.chunk.js → Admin_homePage.4b2be829.chunk.js} +1 -1
- package/build/Admin_marketplace.3b5a5b5d.chunk.js +11 -0
- package/build/admin-app.9b3b21e5.chunk.js +112 -0
- package/build/{content-manager.8bddf2e6.chunk.js → content-manager.78fe09e2.chunk.js} +93 -92
- package/build/{content-type-builder.a6e29716.chunk.js → content-type-builder.adbfd710.chunk.js} +13 -13
- package/build/en-json.922ce2db.chunk.js +1 -0
- package/build/index.html +1 -1
- package/build/{main.6650d2e7.js → main.b0b16454.js} +371 -371
- package/build/{runtime~main.0338967e.js → runtime~main.4b562cd4.js} +1 -1
- package/build/{upload-translation-en-json.004a86c1.chunk.js → upload-translation-en-json.86da7b0a.chunk.js} +1 -1
- package/package.json +9 -8
- package/admin/src/favicon.ico +0 -0
- package/build/Admin_marketplace.82c0570b.chunk.js +0 -11
- package/build/admin-app.a61d5c2e.chunk.js +0 -112
- package/build/b997a22a2e0b87ef1fa2.ico +0 -0
- package/build/en-json.e936d40e.chunk.js +0 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
(self.webpackChunk_strapi_admin=self.webpackChunk_strapi_admin||[]).push([[5516],{28992:function(T,R,r){(function(e,m){T.exports=m(r(32735))})(this,function(e){return function(m){var P={};function l(t){if(P[t])return P[t].exports;var n=P[t]={i:t,l:!1,exports:{}};return m[t].call(n.exports,n,n.exports,l),n.l=!0,n.exports}return l.m=m,l.c=P,l.d=function(t,n,u){l.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:u})},l.r=function(t){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},l.t=function(t,n){if(1&n&&(t=l(t)),8&n||4&n&&typeof t=="object"&&t&&t.__esModule)return t;var u=Object.create(null);if(l.r(u),Object.defineProperty(u,"default",{enumerable:!0,value:t}),2&n&&typeof t!="string")for(var E in t)l.d(u,E,function(c){return t[c]}.bind(null,E));return u},l.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return l.d(n,"a",n),n},l.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},l.p="",l(l.s=87)}({0:function(m,P){m.exports=e},87:function(m,P,l){"use strict";l.r(P);var t=l(0);function n(){return(n=Object.assign||function(u){for(var E=1;E<arguments.length;E++){var c=arguments[E];for(var M in c)Object.prototype.hasOwnProperty.call(c,M)&&(u[M]=c[M])}return u}).apply(this,arguments)}P.default=function(u){return t.createElement("svg",n({width:"1em",height:"1em",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},u),t.createElement("path",{d:"M0 4a4 4 0 014-4h24a4 4 0 014 4v24a4 4 0 01-4 4H4a4 4 0 01-4-4V4z",fill:"#AC73E6"}),t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.027 13.839c-3.19-.836-6.305-1.064-10.18-.608-1.215.152-1.063 1.975.076 2.203.304.836.456 2.355.912 3.267.987 2.279 5.622 1.975 7.369.835 1.14-.683 1.443-2.279 1.9-3.494.227-.684 1.595-.684 1.822 0 .38 1.215.76 2.81 1.9 3.494 1.747 1.14 6.381 1.444 7.369-.835.456-.912.607-2.431.911-3.267 1.14-.228 1.216-2.051.076-2.203-3.874-.456-6.989-.228-10.18.608-.455.075-1.519.075-1.975 0z",fill:"#fff"}))}}})})},75152:function(T,R,r){(function(e,m){T.exports=m(r(32735))})(this,function(e){return function(m){var P={};function l(t){if(P[t])return P[t].exports;var n=P[t]={i:t,l:!1,exports:{}};return m[t].call(n.exports,n,n.exports,l),n.l=!0,n.exports}return l.m=m,l.c=P,l.d=function(t,n,u){l.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:u})},l.r=function(t){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},l.t=function(t,n){if(1&n&&(t=l(t)),8&n||4&n&&typeof t=="object"&&t&&t.__esModule)return t;var u=Object.create(null);if(l.r(u),Object.defineProperty(u,"default",{enumerable:!0,value:t}),2&n&&typeof t!="string")for(var E in t)l.d(u,E,function(c){return t[c]}.bind(null,E));return u},l.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return l.d(n,"a",n),n},l.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},l.p="",l(l.s=188)}({0:function(m,P){m.exports=e},188:function(m,P,l){"use strict";l.r(P);var t=l(0);function n(){return(n=Object.assign||function(u){for(var E=1;E<arguments.length;E++){var c=arguments[E];for(var M in c)Object.prototype.hasOwnProperty.call(c,M)&&(u[M]=c[M])}return u}).apply(this,arguments)}P.default=function(u){return t.createElement("svg",n({width:"1em",height:"1em",viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},u),t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.571 18.272H10.43v-8.47H2.487a.2.2 0 01-.14-.343L11.858.058a.2.2 0 01.282 0l9.513 9.4a.2.2 0 01-.14.343H13.57v8.47zM2.2 21.095a.2.2 0 00-.2.2v2.424c0 .11.09.2.2.2h19.6a.2.2 0 00.2-.2v-2.424a.2.2 0 00-.2-.2H2.2z",fill:"#212134"}))}}})})},4407:(T,R,r)=>{"use strict";r.r(R),r.d(R,{MarketPlacePage:()=>ne,default:()=>_e});var e=r(32735),m=r(5636),P=r(99357),l=r(58469),t=r(88425),n=r(11856),u=r(16540),E=r(89978),c=r(9808),M=r(29270),b=r(95602),x=r(19192),k=r(81700),ce=r(60216),i=r.n(ce),S=r(78752),ue=r(97042),de=r.n(ue),$=r(19615);const pe=(0,$.default)(c.Box)`
|
|
2
|
+
background: ${({theme:a})=>`linear-gradient(180deg, rgba(234, 234, 239, 0) 0%, ${a.colors.neutral150} 100%)`};
|
|
3
|
+
opacity: 0.33;
|
|
4
|
+
`,ge=()=>e.createElement(n.GridLayout,null,Array(12).fill(null).map((a,s)=>e.createElement(pe,{key:`empty-plugin-card-${s}`,height:"234px",hasRadius:!0}))),H=({content:a})=>e.createElement(c.Box,{position:"relative"},e.createElement(ge,null),e.createElement(c.Box,{position:"absolute",top:11,width:"100%"},e.createElement(x.Flex,{alignItems:"center",justifyContent:"center",direction:"column"},e.createElement(S.Icon,{as:de(),color:"",width:"160px",height:"88px"}),e.createElement(c.Box,{paddingTop:6},e.createElement(b.Typography,{variant:"delta",as:"p",textColor:"neutral600"},a)))));H.propTypes={content:i().string.isRequired};const G=H;var z=r(61541),me=r(75152),fe=r.n(me);const I=({isOnline:a,npmPackageType:s})=>{const{formatMessage:o}=(0,m.useIntl)(),{trackUsage:f}=(0,t.useTracking)(),g=s==="provider"?"didSubmitProvider":"didSubmitPlugin";return e.createElement(n.HeaderLayout,{title:o({id:"global.marketplace",defaultMessage:"Marketplace"}),subtitle:o({id:"admin.pages.MarketPlacePage.subtitle",defaultMessage:"Get more out of Strapi"}),primaryAction:a&&e.createElement(z.LinkButton,{startIcon:e.createElement(fe(),null),variant:"tertiary",href:`https://market.strapi.io/submit-${s}`,onClick:()=>f(g),isExternal:!0},o({id:`admin.pages.MarketPlacePage.submit.${s}.link`,defaultMessage:`Submit ${s}`}))})},W=I;I.defaultProps={npmPackageType:"plugin"},I.propTypes={isOnline:i().bool.isRequired,npmPackageType:i().string};var Y=r(84968),ve=r(43653),Q=r.n(ve),ye=(a,s,o)=>new Promise((f,g)=>{var y=v=>{try{p(o.next(v))}catch(h){g(h)}},d=v=>{try{p(o.throw(v))}catch(h){g(h)}},p=v=>v.done?f(v.value):Promise.resolve(v.value).then(y,d);p((o=o.apply(a,s)).next())});const Pe="https://market-api.strapi.io",he=()=>ye(void 0,null,function*(){const{data:a}=yield Q().get(`${Pe}/providers`);return a}),Ee=a=>{const s=(0,t.useNotification)();return(0,Y.useQuery)("list-marketplace-providers",()=>he(),{onSuccess(){a&&a()},onError(){s({type:"warning",message:{id:"notification.error",defaultMessage:"An error occured"}})}})};var Me=Object.defineProperty,ke=Object.defineProperties,be=Object.getOwnPropertyDescriptors,Z=Object.getOwnPropertySymbols,xe=Object.prototype.hasOwnProperty,Te=Object.prototype.propertyIsEnumerable,K=(a,s,o)=>s in a?Me(a,s,{enumerable:!0,configurable:!0,writable:!0,value:o}):a[s]=o,Re=(a,s)=>{for(var o in s||(s={}))xe.call(s,o)&&K(a,o,s[o]);if(Z)for(var o of Z(s))Te.call(s,o)&&K(a,o,s[o]);return a},Se=(a,s)=>ke(a,be(s)),Ce=(a,s,o)=>new Promise((f,g)=>{var y=v=>{try{p(o.next(v))}catch(h){g(h)}},d=v=>{try{p(o.throw(v))}catch(h){g(h)}},p=v=>v.done?f(v.value):Promise.resolve(v.value).then(y,d);p((o=o.apply(a,s)).next())});const Oe="https://market-api.strapi.io",Be=()=>Ce(void 0,null,function*(){const{data:a}=yield Q().get(`${Oe}/plugins`);return Se(Re({},a),{data:a.data.filter(o=>o.attributes.strapiCompatibility==="v4")})}),Ie=a=>{const s=(0,t.useNotification)();return(0,Y.useQuery)("list-marketplace-plugins",()=>Be(),{onSuccess(){a&&a()},onError(){s({type:"warning",message:{id:"notification.error",defaultMessage:"An error occured"}})}})};var Le=r(83983);const Ne=r.p+"a6b842e0b6d2b61135d1.svg",je=()=>{const a=typeof navigator!="undefined"&&typeof navigator.onLine=="boolean"?navigator.onLine:!0,[s,o]=(0,e.useState)(a),f=()=>o(!0),g=()=>o(!1);return(0,e.useEffect)(()=>(window.addEventListener("online",f),window.addEventListener("offline",g),()=>{window.removeEventListener("online",f),window.removeEventListener("offline",g)}),[]),s};var Ae=r(28992),De=r.n(Ae),we=r(82372),J=r.n(we);const Ve=()=>{const{formatMessage:a}=(0,m.useIntl)(),{trackUsage:s}=(0,t.useTracking)();return e.createElement("a",{href:"https://strapi.canny.io/plugin-requests",target:"_blank",rel:"noopener noreferrer nofollow",style:{textDecoration:"none"},onClick:()=>s("didMissMarketplacePlugin")},e.createElement(t.ContentBox,{title:a({id:"admin.pages.MarketPlacePage.missingPlugin.title",defaultMessage:"Documentation"}),subtitle:a({id:"admin.pages.MarketPlacePage.missingPlugin.description",defaultMessage:"Tell us what plugin you are looking for and we'll let our community plugin developers know in case they are in search for inspiration!"}),icon:e.createElement(De(),null),iconBackground:"alternative100",endAction:e.createElement(S.Icon,{as:J(),color:"neutral600",width:3,height:3,marginLeft:2})}))};var X=r(78330),Fe=r(24443),Ue=r.n(Fe),$e=r(90662),L=r(44826),He=r(14356),Ge=r.n(He);const ze=r.p+"90f49a385afb000fb1d4.svg";var We=r(88677),Ye=r.n(We),Qe=r(54770),q=r.n(Qe),_=r(44526),Ze=r(68192),ee=r.n(Ze);const C=({description:a,installMessage:s,disabled:o,handleCopy:f,pluginName:g})=>e.createElement(L.Tooltip,{"data-testid":`tooltip-${g}`,description:a},e.createElement(c.Box,null,e.createElement(_.Button,{size:"S",startIcon:e.createElement(ee(),null),variant:"secondary",disabled:o,onClick:f},s))),N=({strapiPeerDepVersion:a,strapiAppVersion:s,handleCopy:o,pluginName:f})=>{const{formatMessage:g}=(0,m.useIntl)(),y=q().validRange(a),d=q().satisfies(s,y),p=g({id:"admin.pages.MarketPlacePage.plugin.copy",defaultMessage:"Copy install command"});if(s){if(!y)return e.createElement(C,{installMessage:p,pluginName:f,description:g({id:"admin.pages.MarketPlacePage.plugin.version.null",defaultMessage:'Unable to verify compatibility with your Strapi version: "{strapiAppVersion}"'},{strapiAppVersion:s}),handleCopy:o});if(!d)return e.createElement(C,{installMessage:p,pluginName:f,description:g({id:"admin.pages.MarketPlacePage.plugin.version",defaultMessage:'Update your Strapi version: "{strapiAppVersion}" to: "{versionRange}"'},{strapiAppVersion:s,versionRange:y}),disabled:!0})}return e.createElement(_.Button,{size:"S",startIcon:e.createElement(ee(),null),variant:"secondary",onClick:o},p)};C.defaultProps={disabled:!1,handleCopy:null},C.propTypes={description:i().string.isRequired,installMessage:i().string.isRequired,disabled:i().bool,handleCopy:i().func,pluginName:i().string.isRequired},N.defaultProps={strapiAppVersion:null,strapiPeerDepVersion:null},N.propTypes={strapiAppVersion:i().string,strapiPeerDepVersion:i().string,handleCopy:i().func.isRequired,pluginName:i().string.isRequired};const Ke=N,j=({isInstalled:a,isInDevelopmentMode:s,commandToCopy:o,strapiAppVersion:f,strapiPeerDepVersion:g,pluginName:y})=>{const d=(0,t.useNotification)(),{formatMessage:p}=(0,m.useIntl)(),{trackUsage:v}=(0,t.useTracking)(),h=()=>{navigator.clipboard.writeText(o),v("willInstallPlugin"),d({type:"success",message:{id:"admin.pages.MarketPlacePage.plugin.copy.success"}})};return a?e.createElement(c.Box,{paddingLeft:4},e.createElement(S.Icon,{as:Ye(),marginRight:2,width:12,height:12,color:"success600"}),e.createElement(b.Typography,{variant:"omega",textColor:"success600",fontWeight:"bold"},p({id:"admin.pages.MarketPlacePage.plugin.installed",defaultMessage:"Installed"}))):s?e.createElement(Ke,{strapiAppVersion:f,strapiPeerDepVersion:g,handleCopy:h,pluginName:y}):null};j.defaultProps={strapiAppVersion:null,strapiPeerDepVersion:null},j.propTypes={isInstalled:i().bool.isRequired,isInDevelopmentMode:i().bool.isRequired,commandToCopy:i().string.isRequired,strapiAppVersion:i().string,strapiPeerDepVersion:i().string,pluginName:i().string.isRequired};const Je=j,Xe=(0,$.default)(b.Typography)`
|
|
5
|
+
/* stylelint-disable value-no-vendor-prefix, property-no-vendor-prefix */
|
|
6
|
+
display: -webkit-box;
|
|
7
|
+
-webkit-box-orient: vertical;
|
|
8
|
+
-webkit-line-clamp: 2;
|
|
9
|
+
/* stylelint-enable value-no-vendor-prefix, property-no-vendor-prefix */
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
`,A=({npmPackage:a,isInstalled:s,useYarn:o,isInDevelopmentMode:f,npmPackageType:g,strapiAppVersion:y})=>{const{attributes:d}=a,{formatMessage:p}=(0,m.useIntl)(),{trackUsage:v}=(0,t.useTracking)(),h=o?`yarn add ${d.npmPackageName}`:`npm install ${d.npmPackageName}`,O=p({id:"admin.pages.MarketPlacePage.plugin.tooltip.madeByStrapi",defaultMessage:"Made by Strapi"}),B=`https://market.strapi.io/${Ue().plural(g)}/${d.slug}`;return e.createElement(x.Flex,{direction:"column",justifyContent:"space-between",paddingTop:4,paddingRight:4,paddingBottom:4,paddingLeft:4,hasRadius:!0,background:"neutral0",shadow:"tableShadow",height:"100%",alignItems:"normal","data-testid":"npm-package-card"},e.createElement(c.Box,null,e.createElement(c.Box,{as:"img",src:d.logo.url,alt:`${d.name} logo`,hasRadius:!0,width:11,height:11}),e.createElement(c.Box,{paddingTop:4},e.createElement(b.Typography,{as:"h3",variant:"delta"},e.createElement(x.Flex,{alignItems:"center"},d.name,d.validated&&!d.madeByStrapi&&e.createElement(L.Tooltip,{description:p({id:"admin.pages.MarketPlacePage.plugin.tooltip.verified",defaultMessage:"Plugin verified by Strapi"})},e.createElement(x.Flex,null,e.createElement(S.Icon,{as:Ge(),marginLeft:2,color:"success600"}))),d.madeByStrapi&&e.createElement(L.Tooltip,{description:O},e.createElement(x.Flex,null,e.createElement(c.Box,{as:"img",src:ze,alt:O,marginLeft:1,width:6,height:"auto"})))))),e.createElement(c.Box,{paddingTop:2},e.createElement(Xe,{as:"p",variant:"omega",textColor:"neutral600"},d.description))),e.createElement($e.Stack,{horizontal:!0,spacing:2,style:{alignSelf:"flex-end"},paddingTop:6},e.createElement(z.LinkButton,{size:"S",href:B,isExternal:!0,endIcon:e.createElement(J(),null),"aria-label":p({id:"admin.pages.MarketPlacePage.plugin.info.label",defaultMessage:"Learn more about {pluginName}"},{pluginName:d.name}),variant:"tertiary",onClick:()=>v("didPluginLearnMore")},p({id:"admin.pages.MarketPlacePage.plugin.info.text",defaultMessage:"Learn more"})),e.createElement(Je,{isInstalled:s,isInDevelopmentMode:f,commandToCopy:h,strapiAppVersion:y,strapiPeerDepVersion:d.strapiVersion,pluginName:d.name})))};A.defaultProps={isInDevelopmentMode:!1,strapiAppVersion:null},A.propTypes={npmPackage:i().shape({id:i().string.isRequired,attributes:i().shape({name:i().string.isRequired,description:i().string.isRequired,slug:i().string.isRequired,npmPackageName:i().string.isRequired,npmPackageUrl:i().string.isRequired,repositoryUrl:i().string.isRequired,logo:i().object.isRequired,developerName:i().string.isRequired,validated:i().bool.isRequired,madeByStrapi:i().bool.isRequired,strapiCompatibility:i().oneOf(["v3","v4"]),strapiVersion:i().string}).isRequired}).isRequired,isInstalled:i().bool.isRequired,useYarn:i().bool.isRequired,isInDevelopmentMode:i().bool,npmPackageType:i().string.isRequired,strapiAppVersion:i().string};const qe=A,D=({npmPackages:a,installedPackageNames:s,useYarn:o,isInDevelopmentMode:f,npmPackageType:g,strapiAppVersion:y})=>{const d=(0,e.useCallback)(p=>s.includes(p),[s]);return e.createElement(X.Grid,{gap:4},a.map(p=>e.createElement(X.GridItem,{col:4,s:6,xs:12,style:{height:"100%"},key:p.id},e.createElement(qe,{npmPackage:p,isInstalled:d(p.attributes.npmPackageName),useYarn:o,isInDevelopmentMode:f,npmPackageType:g,strapiAppVersion:y}))))};D.defaultProps={installedPackageNames:[],strapiAppVersion:null},D.propTypes={npmPackages:i().array.isRequired,installedPackageNames:i().arrayOf(i().string),useYarn:i().bool.isRequired,isInDevelopmentMode:i().bool.isRequired,npmPackageType:i().string.isRequired,strapiAppVersion:i().string};const te=D,ae=(a,s)=>(0,l.ZP)(a,s,{keys:[{threshold:l.ZP.rankings.WORD_STARTS_WITH,key:"attributes.name"},{threshold:l.ZP.rankings.WORD_STARTS_WITH,key:"attributes.description"}]}),ne=()=>{const{formatMessage:a}=(0,m.useIntl)(),{trackUsage:s}=(0,t.useTracking)(),{notifyStatus:o}=(0,M.useNotifyAT)(),f=(0,e.useRef)(s),g=(0,t.useNotification)(),[y,d]=(0,e.useState)(""),[p,v]=(0,e.useState)("plugin"),{autoReload:h,dependencies:O,useYarn:B,strapiVersion:et}=(0,t.useAppInfos)(),w=je();(0,t.useFocusWhenNavigate)();const tt=a({id:"global.marketplace",defaultMessage:"Marketplace"}),re=()=>{o(a({id:"app.utils.notify.data-loaded",defaultMessage:"The {target} has loaded"},{target:tt}))},{status:se,data:at}=Ie(re),{status:ie,data:nt}=Ee(re),rt=[se,ie].includes("loading"),st=[se,ie].includes("error");if((0,e.useEffect)(()=>{f.current("didGoToMarketplace")},[]),(0,e.useEffect)(()=>{h||g({type:"info",message:{id:"admin.pages.MarketPlacePage.production",defaultMessage:"Manage plugins from the development environment"},blockTransition:!0})},[g,h]),!w)return e.createElement(n.Layout,null,e.createElement(u.Main,null,e.createElement(W,{isOnline:w}),e.createElement(x.Flex,{width:"100%",direction:"column",alignItems:"center",justifyContent:"center",style:{paddingTop:"120px"}},e.createElement(c.Box,{paddingBottom:2},e.createElement(b.Typography,{textColor:"neutral700",variant:"alpha"},a({id:"admin.pages.MarketPlacePage.offline.title",defaultMessage:"You are offline"}))),e.createElement(c.Box,{paddingBottom:6},e.createElement(b.Typography,{textColor:"neutral700",variant:"epsilon"},a({id:"admin.pages.MarketPlacePage.offline.subtitle",defaultMessage:"You need to be connected to the Internet to access Strapi Market."}))),e.createElement("img",{src:Ne,alt:"offline",style:{width:"88px",height:"88px"}}))));if(st)return e.createElement(n.Layout,null,e.createElement(n.ContentLayout,null,e.createElement(c.Box,{paddingTop:8},e.createElement(t.AnErrorOccurred,null))));if(rt)return e.createElement(n.Layout,null,e.createElement(u.Main,{"aria-busy":!0},e.createElement(t.LoadingIndicatorPage,null)));const V=ae(at.data,y),F=ae(nt.data,y),le=a({id:"admin.pages.MarketPlacePage.search.empty",defaultMessage:'No result for "{target}"'},{target:y}),it=U=>{v(U===0?"plugin":"provider")},oe=Object.keys(O);return e.createElement(n.Layout,null,e.createElement(u.Main,null,e.createElement(P.Helmet,{title:a({id:"admin.pages.MarketPlacePage.helmet",defaultMessage:"Marketplace - Plugins"})}),e.createElement(W,{isOnline:w,npmPackageType:p}),e.createElement(n.ContentLayout,null,e.createElement(c.Box,{width:"25%",paddingBottom:4},e.createElement(E.Searchbar,{name:"searchbar",onClear:()=>d(""),value:y,onChange:U=>d(U.target.value),clearLabel:a({id:"admin.pages.MarketPlacePage.search.clear",defaultMessage:"Clear the search"}),placeholder:a({id:"admin.pages.MarketPlacePage.search.placeholder",defaultMessage:"Search"})},a({id:"admin.pages.MarketPlacePage.search.placeholder",defaultMessage:"Search"}))),e.createElement(k.TabGroup,{label:a({id:"admin.pages.MarketPlacePage.tab-group.label",defaultMessage:"Plugins and Providers for Strapi"}),id:"tabs",variant:"simple",onTabChange:it},e.createElement(c.Box,{paddingBottom:4},e.createElement(k.Tabs,null,e.createElement(k.Tab,null,a({id:"admin.pages.MarketPlacePage.plugins",defaultMessage:"Plugins"})," ","(",V.length,")"),e.createElement(k.Tab,null,a({id:"admin.pages.MarketPlacePage.providers",defaultMessage:"Providers"})," ","(",F.length,")"))),e.createElement(k.TabPanels,null,e.createElement(k.TabPanel,null,y.length>0&&!V.length?e.createElement(G,{content:le}):e.createElement(te,{npmPackages:V,installedPackageNames:oe,useYarn:B,isInDevelopmentMode:h,npmPackageType:"plugin",strapiAppVersion:et})),e.createElement(k.TabPanel,null,y.length>0&&!F.length?e.createElement(G,{content:le}):e.createElement(te,{npmPackages:F,installedPackageNames:oe,useYarn:B,isInDevelopmentMode:h,npmPackageType:"provider"})))),e.createElement(c.Box,{paddingTop:7},e.createElement(Ve,null)))))},_e=()=>e.createElement(t.CheckPagePermissions,{permissions:Le.Z.marketplace.main},e.createElement(ne,null))}}]);
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
(self.webpackChunk_strapi_admin=self.webpackChunk_strapi_admin||[]).push([[5538],{78834:(ee,C,e)=>{"use strict";e.d(C,{Z:()=>gt});var t=e(5173),c=e(88425),a=e(32735),P=e(5636),M=e(60216),S=e.n(M),x=e(9808),Z=e(90662),te=e(16540),V=e(19192),L=e(44526),K=e(37178),w=e(95602),D=e(83281),A=e(954),k=e(10190);const F=({onSubmit:Q,schema:Ze})=>{const{formatMessage:ce}=(0,P.useIntl)();return a.createElement(A.ZP,null,a.createElement(te.Main,null,a.createElement(A.bU,null,a.createElement(D.Formik,{enableReinitialize:!0,initialValues:{email:""},onSubmit:Q,validationSchema:Ze,validateOnChange:!1},({values:qe,errors:De,handleChange:at})=>a.createElement(c.Form,{noValidate:!0},a.createElement(A.sg,null,a.createElement(k.Z,null),a.createElement(x.Box,{paddingTop:6,paddingBottom:7},a.createElement(w.Typography,{as:"h1",variant:"alpha"},ce({id:"Auth.form.button.password-recovery",defaultMessage:"Password Recovery"}))),De.errorMessage&&a.createElement(w.Typography,{id:"global-form-error",role:"alert",tabIndex:-1,textColor:"danger600"},ce({id:De.errorMessage,defaultMessage:"An error occurred"}))),a.createElement(Z.Stack,{spacing:6},a.createElement(K.TextInput,{error:De.email?ce({id:De.email,defaultMessage:"This email is invalid."}):"",value:qe.email,onChange:at,label:ce({id:"Auth.form.email.label",defaultMessage:"Email"}),placeholder:ce({id:"Auth.form.email.placeholder",defaultMessage:"kai@doe.com"}),name:"email",required:!0}),a.createElement(L.Button,{type:"submit",fullWidth:!0},ce({id:"Auth.form.button.forgot-password",defaultMessage:"Send Email"})))))),a.createElement(V.Flex,{justifyContent:"center"},a.createElement(x.Box,{paddingTop:4},a.createElement(c.Link,{to:"/auth/login"},ce({id:"Auth.link.ready",defaultMessage:"Ready to sign in?"}))))))};F.defaultProps={onSubmit:Q=>Q.preventDefault()},F.propTypes={onSubmit:S().func,schema:S().shape({type:S().string.isRequired}).isRequired};const H=F,g=()=>{const{formatMessage:Q}=(0,P.useIntl)();return a.createElement(A.ZP,null,a.createElement(te.Main,null,a.createElement(A.bU,null,a.createElement(A.sg,null,a.createElement(k.Z,null),a.createElement(x.Box,{paddingTop:6,paddingBottom:7},a.createElement(w.Typography,{as:"h1",variant:"alpha"},Q({id:"app.containers.AuthPage.ForgotPasswordSuccess.title",defaultMessage:"Email sent"}))),a.createElement(w.Typography,null,Q({id:"app.containers.AuthPage.ForgotPasswordSuccess.text.email",defaultMessage:"It can take a few minutes to receive your password recovery link."})),a.createElement(x.Box,{paddingTop:4},a.createElement(w.Typography,null,Q({id:"app.containers.AuthPage.ForgotPasswordSuccess.text.contact-admin",defaultMessage:"If you do not receive this link, please contact your administrator."}))))),a.createElement(V.Flex,{justifyContent:"center"},a.createElement(x.Box,{paddingTop:4},a.createElement(c.Link,{to:"/auth/login"},Q({id:"Auth.link.signin",defaultMessage:"Sign in"}))))))},X=()=>{const{formatMessage:Q}=(0,P.useIntl)(),ce=(0,c.useQuery)().get("info")||Q({id:"Auth.components.Oops.text",defaultMessage:"Your account has been suspended."});return a.createElement(A.ZP,null,a.createElement(te.Main,null,a.createElement(A.bU,null,a.createElement(A.sg,null,a.createElement(k.Z,null),a.createElement(x.Box,{paddingTop:6,paddingBottom:7},a.createElement(w.Typography,{as:"h1",variant:"alpha"},Q({id:"Auth.components.Oops.title",defaultMessage:"Oops..."}))),a.createElement(w.Typography,null,ce),a.createElement(x.Box,{paddingTop:4},a.createElement(w.Typography,null,Q({id:"Auth.components.Oops.text.admin",defaultMessage:"If this is a mistake, please contact your administrator."}))))),a.createElement(V.Flex,{justifyContent:"center"},a.createElement(x.Box,{paddingTop:4},a.createElement(c.Link,{to:"/auth/login"},Q({id:"Auth.link.signin",defaultMessage:"Sign in"}))))))};var me=e(19615),be=e(33795),je=e.n(be),u=e(9086),Je=e.n(u),_e=e(5141),pe=e(43653),ie=e.n(pe),ye=e(52111),ke=e(78330),le=e(37341),J=e.n(le),ne=e(33912),_=e.n(ne),I=e(72218),B=(Q,Ze,ce)=>new Promise((qe,De)=>{var at=fe=>{try{$e(ce.next(fe))}catch(ze){De(ze)}},re=fe=>{try{$e(ce.throw(fe))}catch(ze){De(ze)}},$e=fe=>fe.done?qe(fe.value):Promise.resolve(fe.value).then(at,re);$e((ce=ce.apply(Q,Ze)).next())});const Pe=(0,me.default)(x.Box)`
|
|
2
|
+
text-align: center;
|
|
3
|
+
`,$=me.default.a`
|
|
4
|
+
color: ${({theme:Q})=>Q.colors.primary600};
|
|
5
|
+
`,Ce=(0,me.default)(K.TextInput)`
|
|
6
|
+
::-ms-reveal {
|
|
7
|
+
display: none;
|
|
8
|
+
}
|
|
9
|
+
`,ue=({authType:Q,fieldsToDisable:Ze,noSignin:ce,onSubmit:qe,schema:De})=>{const at=(0,c.useNotification)(),{push:re}=(0,_e.useHistory)(),[$e,fe]=(0,a.useState)(!1),[ze,pt]=(0,a.useState)(!1),[Ve,Ct]=(0,a.useState)(0),[ht,Mt]=(0,a.useState)({}),{trackUsage:Dt}=(0,c.useTracking)(),{formatMessage:Te}=(0,P.useIntl)(),tt=(0,c.useQuery)().get("registrationToken");return(0,a.useEffect)(()=>{tt&&B(void 0,null,function*(){try{const{data:{data:Oe}}=yield ie().get(`${strapi.backendURL}/admin/registration-info?registrationToken=${tt}`);Oe&&Mt(Oe)}catch(Oe){const Ne=je()(Oe,["response","data","message"],"An error occurred");at({type:"warning",message:Ne}),re(`/auth/oops?info=${encodeURIComponent(Ne)}`)}})},[tt]),a.createElement(A.ZP,null,a.createElement(A.bU,null,a.createElement(D.Formik,{enableReinitialize:!0,initialValues:{firstname:ht.firstname||"",lastname:ht.lastname||"",email:ht.email||"",password:"",confirmPassword:"",registrationToken:tt||void 0,news:!1},onSubmit:(We,Oe)=>B(void 0,null,function*(){try{yield De.validate(We,{abortEarly:!1}),Ve>0&&Q==="register-admin"&&Dt("didSubmitWithErrorsFirstAdmin",{count:Ve.toString()}),qe(tt?{userInfo:Je()(We,["registrationToken"]),registrationToken:tt}:We,Oe)}catch(Ne){const st=(0,c.getYupInnerErrors)(Ne);Ct(Ve+1),Oe.setErrors(st)}}),validateOnChange:!1},({values:We,errors:Oe,handleChange:Ne})=>a.createElement(c.Form,{noValidate:!0},a.createElement(te.Main,null,a.createElement(A.sg,null,a.createElement(k.Z,null),a.createElement(x.Box,{paddingTop:6,paddingBottom:1},a.createElement(w.Typography,{as:"h1",variant:"alpha"},Te({id:"Auth.form.welcome.title",defaultMessage:"Welcome to Strapi!"}))),a.createElement(Pe,{paddingBottom:7},a.createElement(w.Typography,{variant:"epsilon",textColor:"neutral600"},Te({id:"Auth.form.register.subtitle",defaultMessage:"Credentials are only used to authenticate in Strapi. All saved data will be stored in your database."})))),a.createElement(Z.Stack,{spacing:6},a.createElement(ke.Grid,{gap:4},a.createElement(ke.GridItem,{col:6},a.createElement(K.TextInput,{name:"firstname",required:!0,value:We.firstname,error:Oe.firstname?Te(Oe.firstname):void 0,onChange:Ne,label:Te({id:"Auth.form.firstname.label",defaultMessage:"Firstname"})})),a.createElement(ke.GridItem,{col:6},a.createElement(K.TextInput,{name:"lastname",value:We.lastname,onChange:Ne,label:Te({id:"Auth.form.lastname.label",defaultMessage:"Lastname"})}))),a.createElement(K.TextInput,{name:"email",disabled:Ze.includes("email"),value:We.email,onChange:Ne,error:Oe.email?Te(Oe.email):void 0,required:!0,label:Te({id:"Auth.form.email.label",defaultMessage:"Email"}),type:"email"}),a.createElement(Ce,{name:"password",onChange:Ne,value:We.password,error:Oe.password?Te(Oe.password):void 0,endAction:a.createElement(I.Z,{onClick:st=>{st.preventDefault(),fe(Xe=>!Xe)},label:Te($e?{id:"Auth.form.password.show-password",defaultMessage:"Show password"}:{id:"Auth.form.password.hide-password",defaultMessage:"Hide password"})},$e?a.createElement(_(),null):a.createElement(J(),null)),hint:Te({id:"Auth.form.password.hint",defaultMessage:"Must be at least 8 characters, 1 uppercase, 1 lowercase & 1 number"}),required:!0,label:Te({id:"global.password",defaultMessage:"Password"}),type:$e?"text":"password"}),a.createElement(Ce,{name:"confirmPassword",onChange:Ne,value:We.confirmPassword,error:Oe.confirmPassword?Te(Oe.confirmPassword):void 0,endAction:a.createElement(I.Z,{onClick:st=>{st.preventDefault(),pt(Xe=>!Xe)},label:Te(ze?{id:"Auth.form.password.show-password",defaultMessage:"Show password"}:{id:"Auth.form.password.hide-password",defaultMessage:"Hide password"})},ze?a.createElement(_(),null):a.createElement(J(),null)),required:!0,label:Te({id:"Auth.form.confirmPassword.label",defaultMessage:"Confirmation Password"}),type:ze?"text":"password"}),a.createElement(ye.Checkbox,{onValueChange:st=>{Ne({target:{value:st,name:"news"}})},value:We.news,name:"news","aria-label":"news"},Te({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:a.createElement($,{target:"_blank",href:"https://strapi.io/terms",rel:"noreferrer"},Te({id:"Auth.privacy-policy-agreement.terms",defaultMessage:"terms"})),policy:a.createElement($,{target:"_blank",href:"https://strapi.io/privacy",rel:"noreferrer"},Te({id:"Auth.privacy-policy-agreement.policy",defaultMessage:"policy"}))})),a.createElement(L.Button,{fullWidth:!0,size:"L",type:"submit"},Te({id:"Auth.form.button.register",defaultMessage:"Let's start"})))))),!ce&&a.createElement(x.Box,{paddingTop:4},a.createElement(V.Flex,{justifyContent:"center"},a.createElement(c.Link,{label:"Auth.link.signin",to:"/auth/login"},Te({id:"Auth.link.signin.account",defaultMessage:"Already have an account?"}))))))};ue.defaultProps={fieldsToDisable:[],noSignin:!1,onSubmit:Q=>Q.preventDefault()},ue.propTypes={authType:S().string.isRequired,fieldsToDisable:S().array,noSignin:S().bool,onSubmit:S().func,schema:S().shape({validate:S().func.isRequired,type:S().string.isRequired}).isRequired};const N=ue,de=(0,me.default)(K.TextInput)`
|
|
10
|
+
::-ms-reveal {
|
|
11
|
+
display: none;
|
|
12
|
+
}
|
|
13
|
+
`,Fe=({onSubmit:Q,schema:Ze})=>{const[ce,qe]=(0,a.useState)(!1),[De,at]=(0,a.useState)(!1),{formatMessage:re}=(0,P.useIntl)();return a.createElement(A.ZP,null,a.createElement(te.Main,null,a.createElement(A.bU,null,a.createElement(D.Formik,{enableReinitialize:!0,initialValues:{password:"",confirmPassword:""},onSubmit:Q,validationSchema:Ze,validateOnChange:!1},({values:$e,errors:fe,handleChange:ze})=>a.createElement(c.Form,{noValidate:!0},a.createElement(A.sg,null,a.createElement(k.Z,null),a.createElement(x.Box,{paddingTop:6,paddingBottom:7},a.createElement(w.Typography,{as:"h1",variant:"alpha"},re({id:"global.reset-password",defaultMessage:"Reset password"}))),fe.errorMessage&&a.createElement(w.Typography,{id:"global-form-error",role:"alert",tabIndex:-1,textColor:"danger600"},re({id:fe.errorMessage,defaultMessage:"An error occurred"}))),a.createElement(Z.Stack,{spacing:6},a.createElement(de,{name:"password",onChange:ze,value:$e.password,error:fe.password?re({id:fe.password,defaultMessage:"This field is required."}):void 0,endAction:a.createElement(I.Z,{onClick:pt=>{pt.preventDefault(),qe(Ve=>!Ve)},label:re(ce?{id:"Auth.form.password.show-password",defaultMessage:"Show password"}:{id:"Auth.form.password.hide-password",defaultMessage:"Hide password"})},ce?a.createElement(_(),null):a.createElement(J(),null)),hint:re({id:"Auth.form.password.hint",defaultMessage:"Password must contain at least 8 characters, 1 uppercase, 1 lowercase and 1 number"}),required:!0,label:re({id:"global.password",defaultMessage:"Password"}),type:ce?"text":"password"}),a.createElement(de,{name:"confirmPassword",onChange:ze,value:$e.confirmPassword,error:fe.confirmPassword?re({id:fe.confirmPassword,defaultMessage:"This value is required."}):void 0,endAction:a.createElement(I.Z,{onClick:pt=>{pt.preventDefault(),at(Ve=>!Ve)},label:re(ce?{id:"Auth.form.password.show-password",defaultMessage:"Show password"}:{id:"Auth.form.password.hide-password",defaultMessage:"Hide password"})},De?a.createElement(_(),null):a.createElement(J(),null)),required:!0,label:re({id:"Auth.form.confirmPassword.label",defaultMessage:"Confirmation Password"}),type:De?"text":"password"}),a.createElement(L.Button,{fullwidth:!0,type:"submit"},re({id:"global.change-password",defaultMessage:"Change password"})))))),a.createElement(V.Flex,{justifyContent:"center"},a.createElement(x.Box,{paddingTop:4},a.createElement(c.Link,{to:"/auth/login"},re({id:"Auth.link.ready",defaultMessage:"Ready to sign in?"}))))))};Fe.defaultProps={onSubmit:Q=>Q.preventDefault()},Fe.propTypes={onSubmit:S().func,schema:S().shape({type:S().string.isRequired}).isRequired};const At=Fe;var Ke=function(){return window&&window.strapi&&window.strapi.isEE?e(98768).Z:e(5365).Z}(),St={"forgot-password":{Component:H,endPoint:"forgot-password",fieldsToDisable:[],fieldsToOmit:[],schema:t.Ry().shape({email:t.Z_().email(c.translatedErrors.email).required(c.translatedErrors.required)}),inputsPrefix:""},"forgot-password-success":{Component:g,endPoint:"",fieldsToDisable:[],fieldsToOmit:[],schema:null,inputsPrefix:""},login:{Component:Ke,endPoint:"login",fieldsToDisable:[],fieldsToOmit:["rememberMe"],schema:t.Ry().shape({email:t.Z_().email(c.translatedErrors.email).required(c.translatedErrors.required),password:t.Z_().required(c.translatedErrors.required),rememberMe:t.Xg().nullable()}),inputsPrefix:""},oops:{Component:X,endPoint:null,fieldsToDisable:[],fieldsToOmit:[],schema:null,inputsPrefix:""},register:{Component:N,endPoint:"register",fieldsToDisable:["email"],fieldsToOmit:["userInfo.confirmPassword","userInfo.news","userInfo.email"],schema:t.Ry().shape({firstname:t.Z_().trim().required(c.translatedErrors.required),lastname:t.Z_(),password:t.Z_().min(8,c.translatedErrors.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(c.translatedErrors.required),confirmPassword:t.Z_().oneOf([t.iH("password"),null],"components.Input.error.password.noMatch").required(c.translatedErrors.required),registrationToken:t.Z_().required(c.translatedErrors.required)}),inputsPrefix:"userInfo."},"register-admin":{Component:N,endPoint:"register-admin",noSignin:!0,fieldsToDisable:[],fieldsToOmit:["confirmPassword","news"],schema:t.Ry().shape({firstname:t.Z_().trim().required(c.translatedErrors.required),lastname:t.Z_(),password:t.Z_().min(8,c.translatedErrors.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(c.translatedErrors.required),email:t.Z_().email(c.translatedErrors.email).strict().lowercase(c.translatedErrors.lowercase).required(c.translatedErrors.required),confirmPassword:t.Z_().oneOf([t.iH("password"),null],"components.Input.error.password.noMatch").required(c.translatedErrors.required)}),inputsPrefix:""},"reset-password":{Component:At,endPoint:"reset-password",fieldsToDisable:[],fieldsToOmit:["confirmPassword"],schema:t.Ry().shape({password:t.Z_().min(8,c.translatedErrors.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(c.translatedErrors.required),confirmPassword:t.Z_().oneOf([t.iH("password"),null],"components.Input.error.password.noMatch").required(c.translatedErrors.required)})}};const gt=St},83983:(ee,C,e)=>{"use strict";e.d(C,{Z:()=>S});var t=e(92891);const a={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},{action:"admin::marketplace.plugins.install",subject:null},{action:"admin::marketplace.plugins.uninstall",subject:null}],install:[{action:"admin::marketplace.plugins.install",subject:null}],read:[{action:"admin::marketplace.read",subject:null},{action:"admin::marketplace.plugins.uninstall",subject:null}],uninstall:[{action:"admin::marketplace.plugins.uninstall",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}]}}};var P=function(){return window&&window.strapi&&window.strapi.isEE?e(99568).Z:e(26123).Z}(),M=(0,t.merge)(a,P);const S=M},33320:(ee,C,e)=>{"use strict";e.r(C),e.d(C,{default:()=>ir});var t=e(32735),c=e(5141),a=e(10345),P=e(86349),M=e.n(P),S=e(88423),x=e.n(S),Z=e(93839),te=e.n(Z),V=e(56784),L=e.n(V),K=e(99357),w=e(17247),D=e(13055);const k=i=>(0,D.combineReducers)(i),H=(i,n)=>{let r=D.compose;const p=[];return i.forEach(h=>{p.push(h())}),(0,D.createStore)(k(n),{},r((0,D.applyMiddleware)(...p)))};var ae=e(20284),g=e(88425),se=e(43653),X=e.n(se),me=e(16540),be=e(5636),je=e(60216),u=e.n(je),Je=Object.defineProperty,_e=Object.getOwnPropertySymbols,pe=Object.prototype.hasOwnProperty,ie=Object.prototype.propertyIsEnumerable,ye=(i,n,r)=>n in i?Je(i,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):i[n]=r,ke=(i,n)=>{for(var r in n||(n={}))pe.call(n,r)&&ye(i,r,n[r]);if(_e)for(var r of _e(n))ie.call(n,r)&&ye(i,r,n[r]);return i},le=(i,n)=>{var r={};for(var p in i)pe.call(i,p)&&n.indexOf(p)<0&&(r[p]=i[p]);if(i!=null&&_e)for(var p of _e(i))n.indexOf(p)<0&&ie.call(i,p)&&(r[p]=i[p]);return r};const J=i=>{var n=i,{component:r,path:p}=n,h=le(n,["component","path"]);const{pathname:v,search:d}=(0,c.useLocation)();return t.createElement(c.Route,{path:p,render:m=>g.auth.getToken()!==null?t.createElement(r,ke(ke({},h),m)):t.createElement(c.Redirect,{to:{pathname:"/auth/login",search:v!=="/"&&`?redirectTo=${encodeURIComponent(`${v}${d}`)}`}})})};J.propTypes={component:u().any.isRequired,path:u().string.isRequired};const ne=(0,t.memo)(J);var _=e(7602),I=e(20011),B=e(47169),Pe=e(18950),$=e(92577),Ce=e(82726),ue=e(72975),N=e.n(ue),de=e(39935),Fe=e.n(de),At=e(33795),Ke=e.n(At),St=e(9086),gt=e.n(St);const Q="GUIDED_TOUR_CURRENT_STEP",Ze="GUIDED_TOUR_COMPLETED_STEPS",ce="GUIDED_TOUR_SKIPPED",qe=JSON.parse,De=JSON.stringify,re={clear(){localStorage.removeItem(Q),localStorage.removeItem(Ze)},addCompletedStep(i){var n;const r=((n=qe(localStorage.getItem(Ze)))==null?void 0:n.slice())||[];r.includes(i)||(r.push(i),localStorage.setItem(Ze,De(r)))},addCurrentStep(i){localStorage.setItem(Q,De(i))},setSkipped(i){localStorage.setItem(ce,De(i))},get(i){return qe(localStorage.getItem(i))}};var $e=e(20139),fe=e(41832);const pt=i=>i;var Ve=e(49415),Ct=e(92891);const ht={formErrors:{},modifiedData:{},requestError:null},Mt=(i,n)=>(0,Ve.default)(i,r=>{switch(n.type){case"ON_CHANGE":{(0,Ct.set)(r.modifiedData,n.keys.split("."),n.value);break}case"RESET_PROPS":return ht;case"SET_DATA":{r.modifiedData=n.data;break}case"SET_ERRORS":{r.formErrors=n.errors;break}case"SET_REQUEST_ERROR":{r.requestError={errorMessage:n.errorMessage,errorStatus:n.errorStatus};break}default:return r}});var Dt=e(98399),Te=["Component","endPoint","fieldsToDisable","fieldsToOmit","inputsPrefix","schema"];function yt(i,n){var r=Object.keys(i);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(i);n&&(p=p.filter(function(h){return Object.getOwnPropertyDescriptor(i,h).enumerable})),r.push.apply(r,p)}return r}function tt(i){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?yt(Object(r),!0).forEach(function(p){(0,B.Z)(i,p,r[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(r)):yt(Object(r)).forEach(function(p){Object.defineProperty(i,p,Object.getOwnPropertyDescriptor(r,p))})}return i}var We=function(){return window&&window.strapi&&window.strapi.isEE?e(7277).Z:e(78834).Z}(),Oe=function(n){var r=n.hasAdmin,p=n.setHasAdmin,h=(0,c.useHistory)(),v=h.push,d=h.location.search,m=(0,$e.Z)(),E=m.changeLocale,y=(0,g.useGuidedTour)(),q=y.setSkipped,G=(0,g.useTracking)(),oe=G.trackUsage,z=(0,c.useRouteMatch)("/auth/:authType"),W=z.params.authType,Y=(0,g.useQuery)(),Ee=Ke()(We,W,{}),Ue=Ee.Component,et=Ee.endPoint,vt=Ee.fieldsToDisable,zs=Ee.fieldsToOmit,lr=Ee.inputsPrefix,ur=Ee.schema,dr=(0,Ce.Z)(Ee,Te),cr=(0,t.useReducer)(Mt,ht,pt),Sn=(0,$.Z)(cr,2),Vs=Sn[0],mr=Vs.formErrors,pr=Vs.modifiedData,fr=Vs.requestError,ds=Sn[1],gr=X().CancelToken,Vt=gr.source();(0,t.useEffect)(function(){return function(){Vt.cancel("Component unmounted")}},[]),(0,t.useEffect)(function(){ds({type:"RESET_PROPS"})},[W]);var hr=function(Me){var ge=Me.target,we=ge.name,ve=ge.value;ds({type:"ON_CHANGE",keys:we,value:ve})},Er=function(){var nt=(0,Pe.Z)(N().mark(function Me(ge,we){var ve,xe,Ge,He;return N().wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:if(ve=we.setSubmitting,xe=we.setErrors,ve(!0),Ge=gt()(ge,zs),He="/admin/".concat(et),W!=="login"){Se.next=7;break}return Se.next=7,yr(ge,He,{setSubmitting:ve,setErrors:xe});case 7:if(!(W==="register"||W==="register-admin")){Se.next=10;break}return Se.next=10,Pr(ge,He,{setSubmitting:ve,setErrors:xe});case 10:if(W!=="forgot-password"){Se.next=13;break}return Se.next=13,vr(Ge,He,{setSubmitting:ve,setErrors:xe});case 13:if(W!=="reset-password"){Se.next=16;break}return Se.next=16,Tr(Ge,He,{setSubmitting:ve,setErrors:xe});case 16:case"end":return Se.stop()}},Me)}));return function(ge,we){return nt.apply(this,arguments)}}(),vr=function(){var nt=(0,Pe.Z)(N().mark(function Me(ge,we,ve){var xe,Ge;return N().wrap(function(he){for(;;)switch(he.prev=he.next){case 0:return xe=ve.setSubmitting,Ge=ve.setErrors,he.prev=1,he.next=4,X()({method:"POST",url:"".concat(strapi.backendURL).concat(we),data:ge,cancelToken:Vt.token});case 4:v("/auth/forgot-password-success"),he.next=11;break;case 7:he.prev=7,he.t0=he.catch(1),Dt.error(he.t0),Ge({errorMessage:"notification.error"});case 11:return he.prev=11,xe(!1),he.finish(11);case 14:case"end":return he.stop()}},Me,null,[[1,7,11,14]])}));return function(ge,we,ve){return nt.apply(this,arguments)}}(),yr=function(){var nt=(0,Pe.Z)(N().mark(function Me(ge,we,ve){var xe,Ge,He,he,Se,rt,ot;return N().wrap(function(Ae){for(;;)switch(Ae.prev=Ae.next){case 0:return xe=ve.setSubmitting,Ge=ve.setErrors,Ae.prev=1,Ae.next=4,X()({method:"POST",url:"".concat(strapi.backendURL).concat(we),data:gt()(ge,zs),cancelToken:Vt.token});case 4:He=Ae.sent,he=He.data.data,Se=he.token,rt=he.user,rt.preferedLanguage&&E(rt.preferedLanguage),g.auth.setToken(Se,ge.rememberMe),g.auth.setUserInfo(rt,ge.rememberMe),Cn(),Ae.next=23;break;case 14:if(Ae.prev=14,Ae.t0=Ae.catch(1),!Ae.t0.response){Ae.next=23;break}if(ot=Ke()(Ae.t0,["response","data","error","message"],"Something went wrong"),Fe()(ot).toLowerCase()!=="usernotactive"){Ae.next=22;break}return v("/auth/oops"),ds({type:"RESET_PROPS"}),Ae.abrupt("return");case 22:Ge({errorMessage:ot});case 23:return Ae.prev=23,xe(!1),Ae.finish(23);case 26:case"end":return Ae.stop()}},Me,null,[[1,14,23,26]])}));return function(ge,we,ve){return nt.apply(this,arguments)}}(),Pr=function(){var nt=(0,Pe.Z)(N().mark(function Me(ge,we,ve){var xe,Ge,He,he,Se,rt,ot,Rt,Ae,Ie;return N().wrap(function(Ye){for(;;)switch(Ye.prev=Ye.next){case 0:return xe=ve.setSubmitting,Ge=ve.setErrors,Ye.prev=1,oe("willCreateFirstAdmin"),Ye.next=5,X()({method:"POST",url:"".concat(strapi.backendURL).concat(we),data:gt()(ge,zs),cancelToken:Vt.token});case 5:if(He=Ye.sent,he=He.data.data,Se=he.token,rt=he.user,g.auth.setToken(Se,!1),g.auth.setUserInfo(rt,!1),xe(!1),p(!0),ot=rt.roles,ot&&(Rt=ot.find(function(Or){var Rr=Or.code;return Rr==="strapi-super-admin"}),Rt&&(re.setSkipped(!1),q(!1),oe("didLaunchGuidedtour"))),!(W==="register"&&ge.userInfo.news===!0||W==="register-admin"&&ge.news===!0)){Ye.next=18;break}return v({pathname:"/usecase",search:"?hasAdmin=".concat(r)}),Ye.abrupt("return");case 18:Cn(),Ye.next=25;break;case 21:Ye.prev=21,Ye.t0=Ye.catch(1),oe("didNotCreateFirstAdmin"),Ye.t0.response&&(Ae=Ye.t0.response.data,Ie=(0,fe.Z)(Ae),Ge({apiErrors:Ie}));case 25:case"end":return Ye.stop()}},Me,null,[[1,21]])}));return function(ge,we,ve){return nt.apply(this,arguments)}}(),Tr=function(){var nt=(0,Pe.Z)(N().mark(function Me(ge,we,ve){var xe,Ge,He,he,Se,rt,ot,Rt;return N().wrap(function(Ie){for(;;)switch(Ie.prev=Ie.next){case 0:return xe=ve.setErrors,Ge=ve.setSubmitting,Ie.prev=1,Ie.next=4,X()({method:"POST",url:"".concat(strapi.backendURL).concat(we),data:tt(tt({},ge),{},{resetPasswordToken:Y.get("code")}),cancelToken:Vt.token});case 4:He=Ie.sent,he=He.data.data,Se=he.token,rt=he.user,g.auth.setToken(Se,!1),g.auth.setUserInfo(rt,!1),v("/"),Ie.next=16;break;case 13:Ie.prev=13,Ie.t0=Ie.catch(1),Ie.t0.response&&(ot=Ke()(Ie.t0,["response","data","message"],"Something went wrong"),Rt=Ke()(Ie.t0,["response","data","statusCode"],400),ds({type:"SET_REQUEST_ERROR",errorMessage:ot,errorStatus:Rt}),xe({errorMessage:ot}));case 16:return Ie.prev=16,Ge(!1),Ie.finish(16);case 19:case"end":return Ie.stop()}},Me,null,[[1,13,16,19]])}));return function(ge,we,ve){return nt.apply(this,arguments)}}(),Cn=function(){if(W==="login"){var Me=Y.get("redirectTo"),ge=Me?decodeURIComponent(Me):"/";v(ge)}else v("/")};return!We[W]||r&&W==="register-admin"||g.auth.getToken()?t.createElement(c.Redirect,{to:"/"}):!r&&W!=="register-admin"?t.createElement(c.Redirect,{to:{pathname:"/auth/register-admin",search:d}}):t.createElement(Ue,(0,I.Z)({},dr,{authType:W,fieldsToDisable:vt,formErrors:mr,inputsPrefix:lr,modifiedData:pr,onChange:hr,onSubmit:Er,requestError:fr,schema:ur}))};Oe.defaultProps={hasAdmin:!1},Oe.propTypes={hasAdmin:u().bool,setHasAdmin:u().func.isRequired};const Ne=Oe;var st=e(53951),Xe=e(19615),Xt=e(77997),ft=e(19192),Et=e(9808),Lt=e(90662),It=e(95602),bt=e(25716),Xs=e(37178),cs=e(74201),ms=e(44526),Qs=e(10190),Qt=e(954);const Qe=[{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"}],Yt=(0,Xe.default)(It.Typography)`
|
|
14
|
+
text-align: center;
|
|
15
|
+
`,ps=()=>{const i=(0,g.useNotification)(),{push:n,location:r}=(0,c.useHistory)(),{formatMessage:p}=(0,be.useIntl)(),[h,v]=(0,t.useState)(),[d,m]=(0,t.useState)(""),{firstname:E,email:y}=g.auth.getUserInfo(),{hasAdmin:q}=(0,Xt.parse)(r==null?void 0:r.search,{ignoreQueryPrefix:!0}),G=h==="other",oe=z=>{try{X()({method:"POST",url:"https://analytics.strapi.io/register",data:{email:y,username:E,firstAdmin:Boolean(!q),persona:{role:z?void 0:h,otherRole:z?void 0:d}}}),i({type:"success",message:{id:"Usecase.notification.success.project-created",defaultMessage:"Project has been successfully created"}}),n("/")}catch(W){}};return t.createElement(Qt.ZP,null,t.createElement(me.Main,{labelledBy:"usecase-title"},t.createElement(Qt.bU,null,t.createElement("form",{onSubmit:()=>oe(!1)},t.createElement(ft.Flex,{direction:"column",paddingBottom:7},t.createElement(Qs.Z,null),t.createElement(Et.Box,{paddingTop:6,paddingBottom:1,width:(0,g.pxToRem)(250)},t.createElement(Yt,{variant:"alpha",as:"h1",id:"usecase-title"},p({id:"Usecase.title",defaultMessage:"Tell us a bit more about yourself"})))),t.createElement(Lt.Stack,{spacing:6},t.createElement(bt.Select,{id:"usecase","data-testid":"usecase",label:p({id:"Usecase.input.work-type",defaultMessage:"What type of work do you do?"}),onChange:v,value:h},Qe.map(({intlLabel:z,value:W})=>t.createElement(bt.Option,{key:W,value:W},p(z)))),G&&t.createElement(Xs.TextInput,{name:"other",label:p({id:"Usecase.other",defaultMessage:"Other"}),value:d,onChange:z=>m(z.target.value),"data-testid":"other"}),t.createElement(ms.Button,{type:"submit",size:"L",fullWidth:!0,disabled:!h},p({id:"global.finish",defaultMessage:"Finish"}))))),t.createElement(ft.Flex,{justifyContent:"center"},t.createElement(Et.Box,{paddingTop:4},t.createElement(cs.TextButton,{onClick:()=>oe(!0)},p({id:"Usecase.button.skip",defaultMessage:"Skip this question"}))))))};var fs=e(61605),gs=(i,n,r)=>new Promise((p,h)=>{var v=E=>{try{m(r.next(E))}catch(y){h(y)}},d=E=>{try{m(r.throw(E))}catch(y){h(y)}},m=E=>E.done?p(E.value):Promise.resolve(E.value).then(v,d);m((r=r.apply(i,n)).next())});const hs=()=>gs(void 0,null,function*(){return`web-fingerprint-${(yield(yield fs.ZP.load()).get()).visitorId}`});var Es=e(21930);const vs=[];var ys=function(){return window&&window.strapi&&window.strapi.isEE?e(68944).Z:e(56761).Z}();const Ps=[].concat((0,Es.Z)(ys),(0,Es.Z)(vs));var jt=e(775),Ts=Object.defineProperty,Os=Object.defineProperties,Jt=Object.getOwnPropertyDescriptors,_t=Object.getOwnPropertySymbols,qt=Object.prototype.hasOwnProperty,qs=Object.prototype.propertyIsEnumerable,es=(i,n,r)=>n in i?Ts(i,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):i[n]=r,Pt=(i,n)=>{for(var r in n||(n={}))qt.call(n,r)&&es(i,r,n[r]);if(_t)for(var r of _t(n))qs.call(n,r)&&es(i,r,n[r]);return i},ts=(i,n)=>Os(i,Jt(n)),ss=(i,n,r)=>new Promise((p,h)=>{var v=E=>{try{m(r.next(E))}catch(y){h(y)}},d=E=>{try{m(r.throw(E))}catch(y){h(y)}},m=E=>E.done?p(E.value):Promise.resolve(E.value).then(v,d);m((r=r.apply(i,n)).next())});const Rs=(0,t.lazy)(()=>Promise.all([e.e(6925),e.e(9166),e.e(801)]).then(e.bind(e,19782)));function As(){const i=(0,g.useNotification)(),{updateProjectSettings:n}=(0,jt.um)(),{formatMessage:r}=(0,be.useIntl)(),[{isLoading:p,hasAdmin:h,uuid:v},d]=(0,t.useState)({isLoading:!0,hasAdmin:!1}),m=(0,g.useAppInfos)(),E=(0,t.useMemo)(()=>(0,_.WW)(Ps.map(({to:z,Component:W,exact:Y})=>(0,_.ot)(W,z,Y))),[]),[y,q]=(0,t.useState)(null);(0,t.useEffect)(()=>{const z=g.auth.getToken();z&&(()=>ss(this,null,function*(){try{const{data:{token:Y}}=yield(0,g.request)("/admin/renew-token",{method:"POST",body:{token:z}});g.auth.updateToken(Y)}catch(Y){g.auth.clearAppStorage(),window.location.reload()}}))()},[]),(0,t.useEffect)(()=>{(()=>ss(this,null,function*(){try{const{data:{data:{hasAdmin:W,uuid:Y,menuLogo:Ee}}}=yield X().get(`${strapi.backendURL}/admin/init`);if(n({menuLogo:(0,g.prefixFileUrlWithBackendUrl)(Ee)}),Y){const{data:{data:Ue}}=yield X().get(`${strapi.backendURL}/admin/telemetry-properties`);q(Ue);try{const et=yield hs();yield fetch("https://analytics.strapi.io/track",{method:"POST",body:JSON.stringify({event:"didInitializeAdministration",uuid:Y,deviceId:et,properties:ts(Pt({},Ue),{environment:m.currentEnvironment})}),headers:{"Content-Type":"application/json"}})}catch(et){}}d({isLoading:!1,hasAdmin:W,uuid:Y})}catch(W){i({type:"warning",message:{id:"app.containers.App.notification.error.init"}})}}))()},[i,n]);const G=z=>d(W=>ts(Pt({},W),{hasAdmin:z})),oe=(0,t.useMemo)(()=>({uuid:v,telemetryProperties:y}),[v,y]);return p?t.createElement(g.LoadingIndicatorPage,null):t.createElement(t.Suspense,{fallback:t.createElement(g.LoadingIndicatorPage,null)},t.createElement(me.SkipToContent,null,r({id:"skipToContent"})),t.createElement(g.TrackingProvider,{value:oe},t.createElement(c.Switch,null,E,t.createElement(c.Route,{path:"/auth/:authType",render:z=>t.createElement(Ne,ts(Pt({},z),{setHasAdmin:G,hasAdmin:h})),exact:!0}),t.createElement(ne,{path:"/usecase",component:ps}),t.createElement(ne,{path:"/",component:Rs}),t.createElement(c.Route,{path:"",component:st.default}))))}const Ss=As,Cs=e.p+"fde9b1ad0670d29a2516.png",Ms=e.p+"15026a3d58aeb2828134.png";var Bt=e(84968),Ds=e(4409),Ut=e(66694);const wt={menuLogo:null},xt=(i=wt,n)=>(0,Ve.default)(i,r=>{switch(n.type){case"UPDATE_PROJECT_SETTINGS":{Object.assign(r,n.values);break}default:return r}}),Ls=({children:i,authLogo:n,menuLogo:r,showReleaseNotification:p,showTutorials:h})=>{const[{menuLogo:v},d]=(0,t.useReducer)(xt,wt),m=({menuLogo:q})=>d({type:"UPDATE_PROJECT_SETTINGS",values:{menuLogo:q||r}}),E=(0,t.useRef)(m),y=(0,t.useMemo)(()=>({logos:{menu:{custom:v,default:r},auth:{custom:null,default:n}},updateProjectSettings:E.current,showReleaseNotification:p,showTutorials:h}),[n,v,p,h,E,r]);return t.createElement(Ut._5.Provider,{value:y},i)};Ls.propTypes={authLogo:u().string.isRequired,children:u().element.isRequired,menuLogo:u().string.isRequired,showReleaseNotification:u().bool.isRequired,showTutorials:u().bool.isRequired};const Is=Ls;var rs=e(58732),en=e.n(rs),bs=e(5985);const kt=({changeLocale:i,children:n,localeNames:r,messages:p})=>t.createElement(bs.Z.Provider,{value:{changeLocale:i,localeNames:r,messages:p}},n);kt.propTypes={changeLocale:u().func.isRequired,children:u().element.isRequired,localeNames:u().object.isRequired,messages:u().object.isRequired};const os=kt,Ft="strapi-admin-language",js=i=>{const n=window.localStorage.getItem(Ft);return{locale:i[n]?n:"en",localeNames:i}};var as=Object.defineProperty,_s=Object.defineProperties,Bs=Object.getOwnPropertyDescriptors,Wt=Object.getOwnPropertySymbols,Us=Object.prototype.hasOwnProperty,ws=Object.prototype.propertyIsEnumerable,xs=(i,n,r)=>n in i?as(i,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):i[n]=r,ks=(i,n)=>{for(var r in n||(n={}))Us.call(n,r)&&xs(i,r,n[r]);if(Wt)for(var r of Wt(n))ws.call(n,r)&&xs(i,r,n[r]);return i},Fs=(i,n)=>_s(i,Bs(n));const Nt={localeNames:{en:"English"},locale:"en"},Ws=(i=Nt,n)=>{switch(n.type){case"CHANGE_LOCALE":{const{locale:r}=n;return i.localeNames[r]?Fs(ks({},i),{locale:r}):i}default:return i}},Kt=({children:i,localeNames:n,messages:r})=>{const[{locale:p},h]=(0,t.useReducer)(Ws,Nt,()=>js(n));(0,t.useEffect)(()=>{window.localStorage.setItem(Ft,p),document.documentElement.setAttribute("lang",p)},[p]);const v=m=>{h({type:"CHANGE_LOCALE",locale:m})},d=en()(r[p],r.en);return t.createElement(be.IntlProvider,{locale:p,defaultLocale:"en",messages:d,textComponent:"span"},t.createElement(os,{changeLocale:v,localeNames:n,messages:d},i))};Kt.propTypes={children:u().element.isRequired,localeNames:u().objectOf(u().string).isRequired,messages:u().object.isRequired};const nn=Kt,Ns=(i,n)=>{const r=Object.entries(n),p=r.findIndex(([v])=>v===i);return r.slice(0,p).every(([,v])=>Object.values(v).every(Boolean))},on=(i,n)=>{const r=i.split("."),p=r[1],h=Object.entries(n[r[0]]),v=h.findIndex(([m])=>m===p);return h.slice(0,v).every(([,m])=>m)},Ks={currentStep:null,guidedTourState:{contentTypeBuilder:{create:!1,success:!1},contentManager:{create:!1,success:!1},apiTokens:{create:!1,success:!1}},isGuidedTourVisible:!1,isSkipped:!0},Zs=(i=Ks,n)=>(0,Ve.default)(i,r=>{switch(n.type){case"SET_CURRENT_STEP":{r.currentStep=n.step;break}case"SET_STEP_STATE":{const[p,h]=n.currentStep.split(".");r.guidedTourState[p][h]=n.value;break}case"SET_SKIPPED":{r.isSkipped=n.value;break}case"SET_GUIDED_TOUR_VISIBILITY":{r.isGuidedTourVisible=n.value;break}default:return r}});var ln=e(3040),Zt=e.n(ln),l=Object.defineProperty,o=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,O=Object.prototype.propertyIsEnumerable,T=(i,n,r)=>n in i?l(i,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):i[n]=r,U=(i,n)=>{for(var r in n||(n={}))s.call(n,r)&&T(i,r,n[r]);if(o)for(var r of o(n))O.call(n,r)&&T(i,r,n[r]);return i};const R=i=>{const n=U({},i),r=re.get(Ze),p=re.get(Q),h=re.get(ce);if(r&&r.forEach(v=>{const[d,m]=v.split(".");Zt()(n,["guidedTourState",d,m],!0)}),p){const[v,d]=p.split(".");Zt()(n,["guidedTourState",v,d],!0),re.addCompletedStep(p),re.addCurrentStep(null)}return h!==null&&Zt()(n,"isSkipped",h),n},f=({children:i})=>{const[{currentStep:n,guidedTourState:r,isGuidedTourVisible:p,isSkipped:h},v]=(0,t.useReducer)(Zs,Ks,R),d=G=>{if(G!==null){const oe=Ke()(r,G),z=on(G,r);if(oe||h||!z)return null}return re.addCurrentStep(G),v({type:"SET_CURRENT_STEP",step:G})},m=G=>{v({type:"SET_GUIDED_TOUR_VISIBILITY",value:G})},E=(G,oe)=>{re.addCompletedStep(G),v({type:"SET_STEP_STATE",currentStep:G,value:oe})},y=G=>{const oe=r[G];if(oe){const z=Ns(G,r),W=Object.keys(oe)[0],Y=oe[W];if(z&&!n&&!Y)return d(`${G}.${W}`)}return null},q=G=>{re.setSkipped(G),v({type:"SET_SKIPPED",value:G})};return t.createElement(g.GuidedTourProvider,{guidedTourState:r,currentStep:n,setCurrentStep:d,setGuidedTourVisibility:m,setSkipped:q,setStepState:E,startSection:y,isGuidedTourVisible:p,isSkipped:h},i)};f.propTypes={children:u().element.isRequired};const j=f;var Be=e(12788),dt=e(70324),ct=e.n(dt),mt=e(23101),Gt=e.n(mt),Ht=e(14983);const is=(0,Xe.default)(Et.Box)`
|
|
16
|
+
position: fixed;
|
|
17
|
+
top: 0;
|
|
18
|
+
right: 0;
|
|
19
|
+
bottom: 0;
|
|
20
|
+
left: 0;
|
|
21
|
+
z-index: 1140;
|
|
22
|
+
&:before {
|
|
23
|
+
content: '';
|
|
24
|
+
position: fixed;
|
|
25
|
+
top: 0;
|
|
26
|
+
right: 0;
|
|
27
|
+
bottom: 0;
|
|
28
|
+
left: 0;
|
|
29
|
+
background: ${({theme:i})=>i.colors.neutral0};
|
|
30
|
+
opacity: 0.9;
|
|
31
|
+
}
|
|
32
|
+
`,$t=(0,Xe.default)(Lt.Stack)`
|
|
33
|
+
position: fixed;
|
|
34
|
+
top: 0;
|
|
35
|
+
right: 0;
|
|
36
|
+
bottom: 0;
|
|
37
|
+
left: 0;
|
|
38
|
+
padding-top: ${(0,g.pxToRem)(160)};
|
|
39
|
+
`,it=(0,Xe.default)(Et.Box)`
|
|
40
|
+
border-radius: 50%;
|
|
41
|
+
svg {
|
|
42
|
+
> path {
|
|
43
|
+
fill: ${({theme:i})=>i.colors.primary600} !important;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
`,Le=document.createElement("div"),lt="autoReloadOverlayBlocker";Le.setAttribute("id",lt);const ut=Xe.keyframes`
|
|
47
|
+
from {
|
|
48
|
+
transform: rotate(0deg);
|
|
49
|
+
}
|
|
50
|
+
to {
|
|
51
|
+
transform: rotate(359deg);
|
|
52
|
+
}
|
|
53
|
+
`,zt=(0,Xe.default)(Gt())`
|
|
54
|
+
animation: ${ut} 1s infinite linear;
|
|
55
|
+
`,un=({displayedIcon:i,description:n,title:r,isOpen:p})=>{const{formatMessage:h}=(0,be.useIntl)();return(0,t.useEffect)(()=>(document.body.appendChild(Le),()=>{document.body.removeChild(Le)}),[]),p?Be.createPortal(t.createElement(is,null,t.createElement($t,{spacing:6},t.createElement(Lt.Stack,{spacing:2},t.createElement(ft.Flex,{justifyContent:"center"},t.createElement(It.Typography,{as:"h1",variant:"alpha"},h(r))),t.createElement(ft.Flex,{justifyContent:"center"},t.createElement(It.Typography,{as:"h2",textColor:"neutral600",fontSize:4,fontWeight:"regular"},h(n)))),t.createElement(ft.Flex,{justifyContent:"center"},i==="reload"&&t.createElement(it,{padding:6,background:"primary100",borderColor:"primary200"},t.createElement(zt,{width:(0,g.pxToRem)(36),height:(0,g.pxToRem)(36)})),i==="time"&&t.createElement(it,{padding:6,background:"primary100",borderColor:"primary200"},t.createElement(ct(),{width:(0,g.pxToRem)(40),height:(0,g.pxToRem)(40)}))),t.createElement(ft.Flex,{justifyContent:"center"},t.createElement(Et.Box,{paddingTop:2},t.createElement(Ht.Link,{href:"https://docs.strapi.io",isExternal:!0},h({id:"global.documentation",defaultMessage:"Read the documentation"})))))),Le):null};un.propTypes={displayedIcon:u().oneOfType([u().string,u().array]).isRequired,description:u().object.isRequired,isOpen:u().bool.isRequired,title:u().object.isRequired};const In=un;var bn=Object.defineProperty,jn=Object.defineProperties,_n=Object.getOwnPropertyDescriptors,dn=Object.getOwnPropertySymbols,Bn=Object.prototype.hasOwnProperty,Un=Object.prototype.propertyIsEnumerable,cn=(i,n,r)=>n in i?bn(i,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):i[n]=r,mn=(i,n)=>{for(var r in n||(n={}))Bn.call(n,r)&&cn(i,r,n[r]);if(dn)for(var r of dn(n))Un.call(n,r)&&cn(i,r,n[r]);return i},pn=(i,n)=>jn(i,_n(n));const fn=30,gn=({children:i})=>{const[n,r]=(0,t.useState)(!1),[{elapsed:p},h]=(0,t.useState)({elapsed:0,start:0}),[v,d]=(0,t.useState)(void 0),m=(Y=void 0)=>{r(!0),d(Y),h(Ee=>pn(mn({},Ee),{start:Date.now()}))},E=()=>{r(!1),h({start:0,elapsed:0}),d(void 0)},y=(0,t.useRef)(m),q=(0,t.useRef)(E);(0,t.useEffect)(()=>{let Y=null;return n?Y=setInterval(()=>p>fn?(clearInterval(Y),null):(h(Ee=>pn(mn({},Ee),{elapsed:Math.round(Date.now()-Ee.start)/1e3})),null),1e3):clearInterval(Y),()=>{clearInterval(Y)}},[n,p]);let G=(v==null?void 0:v.icon)||"reload",oe={id:(v==null?void 0:v.description)||"components.OverlayBlocker.description",defaultMessage:"You're using a feature that needs the server to restart. Please wait until the server is up."},z={id:(v==null?void 0:v.title)||"components.OverlayBlocker.title",defaultMessage:"Waiting for restart"};p>fn&&(G="time",oe={id:"components.OverlayBlocker.description.serverError",defaultMessage:"The server should have restarted, please check your logs in the terminal."},z={id:"components.OverlayBlocker.title.serverError",defaultMessage:"The restart is taking longer than expected"});const W=(0,t.useMemo)(()=>({lockApp:y.current,unlockApp:q.current}),[y,q]);return t.createElement(g.AutoReloadOverlayBockerContext.Provider,{value:W},t.createElement(In,{displayedIcon:G,isOpen:n,description:oe,title:z}),i)};gn.propTypes={children:u().element.isRequired};const wn=gn;var xn=e(63568);const Gs=({dispatch:i,notification:n})=>{var r,p,h;const{formatMessage:v}=(0,be.useIntl)(),{message:d,link:m,type:E,id:y,onClose:q,timeout:G,blockTransition:oe}=n,z=Ue=>typeof Ue=="string"?Ue:v(Ue,Ue.values),W=(0,t.useCallback)(()=>{q&&q(),i({type:"HIDE_NOTIFICATION",id:y})},[y]);(0,t.useEffect)(()=>{let Ue;return oe||(Ue=setTimeout(()=>{W()},G||2500)),()=>clearTimeout(Ue)},[oe,W,G]);let Y,Ee;return E==="info"?(Y="default",Ee=v({id:"notification.default.title",defaultMessage:"Information:"})):E==="warning"?(Ee=v({id:"notification.warning.title",defaultMessage:"Warning:"}),Y="danger"):(Ee=v({id:"notification.success.title",defaultMessage:"Success:"}),Y="success"),t.createElement(xn.Alert,{action:m?t.createElement(Ht.Link,{href:m.url,isExternal:!0},v({id:((r=m.label)==null?void 0:r.id)||m.label,defaultMessage:((p=m.label)==null?void 0:p.defaultMessage)||((h=m.label)==null?void 0:h.id)||m.label})):void 0,onClose:W,closeLabel:"Close",title:Ee,variant:Y},z({id:(d==null?void 0:d.id)||d,defaultMessage:(d==null?void 0:d.defaultMessage)||(d==null?void 0:d.id)||d}))};Gs.defaultProps={notification:{id:1,type:"success",message:{id:"notification.success.saved",defaultMessage:"Saved"},onClose:()=>null,timeout:2500,blockTransition:!1}},Gs.propTypes={dispatch:u().func.isRequired,notification:u().shape({id:u().number,message:u().oneOfType([u().string,u().shape({id:u().string.isRequired,defaultMessage:u().string,values:u().object})]),link:u().shape({target:u().string,url:u().string.isRequired,label:u().oneOfType([u().string,u().shape({id:u().string.isRequired,defaultMessage:u().string,values:u().object})]).isRequired}),type:u().string,onClose:u().func,timeout:u().number,blockTransition:u().bool})};const kn=Gs,hn={notifId:0,notifications:[]},Fn=(i=hn,n)=>(0,Ve.default)(i,r=>{switch(n.type){case"SHOW_NOTIFICATION":{r.notifications.push({id:i.notifId,type:Ke()(n,["config","type"],"success"),message:Ke()(n,["config","message"],{id:"notification.success.saved",defaultMessage:"Saved"}),link:Ke()(n,["config","link"],null),timeout:Ke()(n,["config","timeout"],2500),blockTransition:Ke()(n,["config","blockTransition"],!1),onClose:Ke()(n,["config","onClose"],null)}),r.notifId=i.notifId+1;break}case"HIDE_NOTIFICATION":{const p=i.notifications.findIndex(h=>h.id===n.id);p!==-1&&r.notifications.splice(p,1);break}default:return r}}),En=({children:i})=>{const[{notifications:n},r]=(0,t.useReducer)(Fn,hn),p=h=>{r({type:"SHOW_NOTIFICATION",config:h})};return t.createElement(g.NotificationsProvider,{toggleNotification:p},t.createElement(Lt.Stack,{left:"50%",marginLeft:"-250px",position:"fixed",spacing:2,top:`${46/16}rem`,width:`${500/16}rem`,zIndex:10},n.map(h=>t.createElement(kn,{key:h.id,dispatch:r,notification:h}))),i)};En.propTypes={children:u().element.isRequired};const Wn=En,ls=document.createElement("div");ls.setAttribute("id","overlayBlocker");const Nn=Xe.default.div`
|
|
56
|
+
position: fixed;
|
|
57
|
+
top: 0;
|
|
58
|
+
right: 0;
|
|
59
|
+
bottom: 0;
|
|
60
|
+
left: 0;
|
|
61
|
+
z-index: 1140;
|
|
62
|
+
`,vn=({isOpen:i})=>((0,t.useEffect)(()=>(document.body.appendChild(ls),()=>{document.body.removeChild(ls)}),[]),i?Be.createPortal(t.createElement(Nn,null),ls):null);vn.propTypes={isOpen:u().bool.isRequired};const yn=({children:i})=>{const[n,r]=(0,t.useState)(!1),p=()=>{r(!0)},h=()=>{r(!1)};return t.createElement(g.OverlayBlockerContext.Provider,{value:{lockApp:p,unlockApp:h}},i,t.createElement(vn,{isOpen:n}))};yn.propTypes={children:u().node.isRequired};const Kn=yn,Hs="STRAPI_THEME",Zn=()=>{const i=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",n=localStorage.getItem(Hs);return n||localStorage.setItem(Hs,i),n||i},Pn=({children:i,themes:n})=>{const[r,p]=(0,t.useState)(Zn()),h=(0,t.useCallback)(d=>{p(d),localStorage.setItem(Hs,d)},[p]),v=(0,t.useMemo)(()=>({currentTheme:r,onChangeTheme:h,themes:n}),[r,h,n]);return t.createElement(Ut.Rj.Provider,{value:v},i)};Pn.propTypes={children:u().node.isRequired,themes:u().shape({light:u().shape({colors:u().object.isRequired,shadows:u().object.isRequired,sizes:u().object.isRequired,zIndices:u().array.isRequired,spaces:u().array.isRequired,borderRadius:u().string.isRequired,mediaQueries:u().object.isRequired,fontSizes:u().array.isRequired,lineHeights:u().array.isRequired,fontWeights:u().object.isRequired}).isRequired,dark:u().shape({colors:u().object.isRequired,shadows:u().object.isRequired,sizes:u().object.isRequired,zIndices:u().array.isRequired,spaces:u().array.isRequired,borderRadius:u().string.isRequired,mediaQueries:u().object.isRequired,fontSizes:u().array.isRequired,lineHeights:u().array.isRequired,fontWeights:u().object.isRequired}).isRequired,custom:u().object}).isRequired};const Gn=Pn;var Hn=e(45230),$n=(i,n,r)=>new Promise((p,h)=>{var v=E=>{try{m(r.next(E))}catch(y){h(y)}},d=E=>{try{m(r.throw(E))}catch(y){h(y)}},m=E=>E.done?p(E.value):Promise.resolve(E.value).then(v,d);m((r=r.apply(i,n)).next())});(()=>$n(void 0,null,function*(){yield e.e(7723).then(e.bind(e,69820)),yield e.e(7566).then(e.bind(e,53688)),yield e.e(8e3).then(e.t.bind(e,37433,23)),yield e.e(7784).then(e.bind(e,94300))}))();const zn=Xe.createGlobalStyle`
|
|
63
|
+
body {
|
|
64
|
+
background: ${({theme:i})=>i.colors.neutral100};
|
|
65
|
+
}
|
|
66
|
+
`,Tn=({children:i})=>{const{currentTheme:n,themes:r}=(0,jt.M1)();return t.createElement(Hn.ThemeProvider,{theme:r[n]||r.light},i,t.createElement(zn,null))};Tn.propTypes={children:u().element.isRequired};const Vn=Tn,Xn=new Bt.QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:!1}}}),On=({authLogo:i,children:n,components:r,customFields:p,fields:h,getAdminInjectedComponents:v,getPlugin:d,localeNames:m,menu:E,menuLogo:y,messages:q,plugins:G,runHookParallel:oe,runHookSeries:z,runHookWaterfall:W,settings:Y,showReleaseNotification:Ee,showTutorials:Ue,store:et,themes:vt})=>t.createElement(Gn,{themes:vt},t.createElement(Vn,null,t.createElement(Bt.QueryClientProvider,{client:Xn},t.createElement(Ds.Provider,{store:et},t.createElement(Ut.ux.Provider,{value:{getAdminInjectedComponents:v}},t.createElement(Is,{authLogo:i,menuLogo:y,showReleaseNotification:Ee,showTutorials:Ue},t.createElement(g.StrapiAppProvider,{getPlugin:d,menu:E,plugins:G,runHookParallel:oe,runHookWaterfall:W,runHookSeries:z,settings:Y},t.createElement(g.LibraryProvider,{components:r,fields:h},t.createElement(g.CustomFieldsProvider,{customFields:p},t.createElement(nn,{messages:q,localeNames:m},t.createElement(wn,null,t.createElement(Kn,null,t.createElement(j,null,t.createElement(Wn,null,n))))))))))))));On.propTypes={authLogo:u().oneOfType([u().string,u().any]).isRequired,children:u().element.isRequired,components:u().object.isRequired,customFields:u().object.isRequired,fields:u().object.isRequired,getAdminInjectedComponents:u().func.isRequired,getPlugin:u().func.isRequired,localeNames:u().objectOf(u().string).isRequired,menu:u().arrayOf(u().shape({to:u().string.isRequired,icon:u().func.isRequired,intlLabel:u().shape({id:u().string.isRequired,defaultMessage:u().string.isRequired}).isRequired,permissions:u().array,Component:u().func})).isRequired,menuLogo:u().oneOfType([u().string,u().any]).isRequired,messages:u().object.isRequired,plugins:u().object.isRequired,runHookParallel:u().func.isRequired,runHookWaterfall:u().func.isRequired,runHookSeries:u().func.isRequired,settings:u().object.isRequired,showReleaseNotification:u().bool.isRequired,showTutorials:u().bool.isRequired,store:u().object.isRequired,themes:u().shape({light:u().shape({colors:u().object.isRequired,shadows:u().object.isRequired,sizes:u().object.isRequired,zIndices:u().array.isRequired,spaces:u().array.isRequired,borderRadius:u().string.isRequired,mediaQueries:u().object.isRequired,fontSizes:u().array.isRequired,lineHeights:u().array.isRequired,fontWeights:u().object.isRequired}).isRequired,dark:u().shape({colors:u().object.isRequired,shadows:u().object.isRequired,sizes:u().object.isRequired,zIndices:u().array.isRequired,spaces:u().array.isRequired,borderRadius:u().string.isRequired,mediaQueries:u().object.isRequired,fontSizes:u().array.isRequired,lineHeights:u().array.isRequired,fontWeights:u().object.isRequired}).isRequired,custom:u().object}).isRequired};const Qn=On,Yn={ar:"\u0627\u0644\u0639\u0631\u0628\u064A\u0629",ca:"Catal\xE0",cs:"\u010Ce\u0161tina",de:"Deutsch",dk:"Dansk",en:"English",es:"Espa\xF1ol",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"};var us=e(70836);const Jn={admin:{tutorials:{links:[]}},contentManager:{editView:{informations:[],"right-links":[]},listView:{actions:[],deleteModalAdditionalInfos:[]}}},qn="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAXVBMVEUAAABIRP9IRP9IRP9IRP9IRP9IRP9IRP9IRP9IRP9IRP9IRP9IRP9IRP9IRP9JRf9IRf9IRP5IRP5JRP9JRf////+Vk/+zsv++vf9mY/9taf9/fP+Jh//c3P9RTf/Ibar2AAAAFHRSTlMA/MJX+fPt48cahaff1dMaGqcahSpTPmAAAAEvSURBVFjD7dfNTsMwEATgXcf5cdKEtixtcYH3f0xEibIguba1g8Slc+58iqUedmhNaMbJzX3Xema5G2bfdv3iprE50s80g7Yqw0Oz1Z+cmOL2a38nxuy+BSfmuNv7BUhDRAMCDESBEYCDvsD6hmcMGGnCgIkcBjhaMGCmHgN66jCgoxYDWvIY4IkxgHFAkrmeU7kmfpkG4uUllXMtEE82QPs2QPs2QPs2QPs2QPsAoH0DoH0LoH0QeN3ydtnyXg38ok76MQ/gAfwf8JH8V18LQOljomBAFAyIkga4CGT7XAtEuQf4IpDri6e2BoiZA6OrAGLuxOnLQMweWXMRyPVlwQ/NAwZMNGLACJ/76ODYo5MHHl3o7EOHZ6BbjtbpG/5kfOv8P7ilbv7PX/M/rMVPqrI3XI3nd3sAAAAASUVORK5CYII=";var Rn=e(98399),er=Object.defineProperty,tr=Object.defineProperties,sr=Object.getOwnPropertyDescriptors,An=Object.getOwnPropertySymbols,nr=Object.prototype.hasOwnProperty,rr=Object.prototype.propertyIsEnumerable,$s=(i,n,r)=>n in i?er(i,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):i[n]=r,Tt=(i,n)=>{for(var r in n||(n={}))nr.call(n,r)&&$s(i,r,n[r]);if(An)for(var r of An(n))rr.call(n,r)&&$s(i,r,n[r]);return i},or=(i,n)=>tr(i,sr(n)),Re=(i,n,r)=>($s(i,typeof n!="symbol"?n+"":n,r),r),Ot=(i,n,r)=>new Promise((p,h)=>{var v=E=>{try{m(r.next(E))}catch(y){h(y)}},d=E=>{try{m(r.throw(E))}catch(y){h(y)}},m=E=>E.done?p(E.value):Promise.resolve(E.value).then(v,d);m((r=r.apply(i,n)).next())});class ar{constructor({adminConfig:n,appPlugins:r,library:p,middlewares:h,reducers:v}){Re(this,"addComponents",d=>{Array.isArray(d)?d.map(m=>this.library.components.add(m)):this.library.components.add(d)}),Re(this,"addCorePluginMenuLink",d=>{var m,E;const y=JSON.stringify(d);L()(d.to,`link.to should be defined for ${y}`),L()(typeof d.to=="string",`Expected link.to to be a string instead received ${typeof d.to}`),L()(["/plugins/content-type-builder","/plugins/upload"].includes(d.to),"This method is not available for your plugin"),L()(((m=d.intlLabel)==null?void 0:m.id)&&((E=d.intlLabel)==null?void 0:E.defaultMessage),`link.intlLabel.id & link.intlLabel.defaultMessage for ${y}`),this.menu.push(d)}),Re(this,"addFields",d=>{Array.isArray(d)?d.map(m=>this.library.fields.add(m)):this.library.fields.add(d)}),Re(this,"addMenuLink",d=>{var m,E;const y=JSON.stringify(d);L()(d.to,`link.to should be defined for ${y}`),L()(typeof d.to=="string",`Expected link.to to be a string instead received ${typeof d.to}`),L()(((m=d.intlLabel)==null?void 0:m.id)&&((E=d.intlLabel)==null?void 0:E.defaultMessage),`link.intlLabel.id & link.intlLabel.defaultMessage for ${y}`),L()(d.Component&&typeof d.Component=="function","link.Component should be a valid React Component"),L()(d.icon&&typeof d.icon=="function","link.Icon should be a valid React Component"),this.menu.push(d)}),Re(this,"addMiddlewares",d=>{d.forEach(m=>{this.middlewares.add(m)})}),Re(this,"addReducers",d=>{Object.keys(d).forEach(m=>{this.reducers.add(m,d[m])})}),Re(this,"addSettingsLink",(d,m)=>{var E,y;L()(this.settings[d],"The section does not exist");const q=JSON.stringify(m);L()(m.id,`link.id should be defined for ${q}`),L()(((E=m.intlLabel)==null?void 0:E.id)&&((y=m.intlLabel)==null?void 0:y.defaultMessage),`link.intlLabel.id & link.intlLabel.defaultMessage for ${q}`),L()(m.to,`link.to should be defined for ${q}`),L()(m.Component&&typeof m.Component=="function","link.Component should be a valid React Component"),this.settings[d].links.push(m)}),Re(this,"addSettingsLinks",(d,m)=>{L()(this.settings[d],"The section does not exist"),L()(Array.isArray(m),"TypeError expected links to be an array"),m.forEach(E=>{this.addSettingsLink(d,E)})}),Re(this,"bootstrapAdmin",()=>Ot(this,null,function*(){return yield this.createCustomConfigurations(),this.createHook(us.No),this.createHook(us.LK),this.createHook(us.dV),this.createHook(us.Eo),Promise.resolve()})),Re(this,"createCustomConfigurations",()=>Ot(this,null,function*(){var d,m,E,y,q,G,oe,z,W,Y,Ee,Ue;if((d=this.customConfigurations)!=null&&d.locales&&(this.configurations.locales=["en",...((m=this.customConfigurations.locales)==null?void 0:m.filter(et=>et!=="en"))||[]]),(y=(E=this.customConfigurations)==null?void 0:E.auth)!=null&&y.logo&&(this.configurations.authLogo=this.customConfigurations.auth.logo),(G=(q=this.customConfigurations)==null?void 0:q.menu)!=null&&G.logo&&(this.configurations.menuLogo=this.customConfigurations.menu.logo),(z=(oe=this.customConfigurations)==null?void 0:oe.head)!=null&&z.favicon&&(this.configurations.head.favicon=this.customConfigurations.head.favicon),(W=this.customConfigurations)!=null&&W.theme){const et=this.customConfigurations.theme.dark,vt=this.customConfigurations.theme.light;!et&&!vt&&(Rn.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."),M()(this.configurations.themes.light,this.customConfigurations.theme)),vt&&M()(this.configurations.themes.light,vt),et&&M()(this.configurations.themes.dark,et)}((Ee=(Y=this.customConfigurations)==null?void 0:Y.notifications)==null?void 0:Ee.releases)!==void 0&&(this.configurations.notifications.releases=this.customConfigurations.notifications.releases),((Ue=this.customConfigurations)==null?void 0:Ue.tutorials)!==void 0&&(this.configurations.tutorials=this.customConfigurations.tutorials)})),Re(this,"createHook",d=>{this.hooksDict[d]=(0,w.Bi)()}),Re(this,"createSettingSection",(d,m)=>{var E,y;L()(d.id,"section.id should be defined"),L()(((E=d.intlLabel)==null?void 0:E.id)&&((y=d.intlLabel)==null?void 0:y.defaultMessage),"section.intlLabel should be defined"),L()(Array.isArray(m),"TypeError expected links to be an array"),L()(this.settings[d.id]===void 0,"A similar section already exists"),this.settings[d.id]=or(Tt({},d),{links:[]}),m.forEach(q=>{this.addSettingsLink(d.id,q)})}),Re(this,"createStore",()=>H(this.middlewares.middlewares,this.reducers.reducers)),Re(this,"getAdminInjectedComponents",(d,m,E)=>{try{return this.admin.injectionZones[d][m][E]||[]}catch(y){return Rn.error("Cannot get injected component",y),y}}),Re(this,"getPlugin",d=>this.plugins[d]),Re(this,"injectContentManagerComponent",(d,m,E)=>{var y;L()((y=this.admin.injectionZones.contentManager[d])==null?void 0:y[m],`The ${d} ${m} zone is not defined in the content manager`),L()(E,"A Component must be provided"),this.admin.injectionZones.contentManager[d][m].push(E)}),Re(this,"injectAdminComponent",(d,m,E)=>{var y;L()((y=this.admin.injectionZones.admin[d])==null?void 0:y[m],`The ${d} ${m} zone is not defined in the admin`),L()(E,"A Component must be provided"),this.admin.injectionZones.admin[d][m].push(E)}),Re(this,"registerHook",(d,m)=>{L()(this.hooksDict[d],`The hook ${d} is not defined. You are trying to register a hook that does not exist in the application.`),this.hooksDict[d].register(m)}),Re(this,"registerPlugin",d=>{const m=(0,ae.Sy)(d);this.plugins[m.pluginId]=m}),Re(this,"runHookSeries",(d,m=!1)=>m?this.hooksDict[d].runSeriesAsync():this.hooksDict[d].runSeries()),Re(this,"runHookWaterfall",(d,m,E=!1,y)=>E?this.hooksDict[d].runWaterfallAsync(m,y):this.hooksDict[d].runWaterfall(m,y)),Re(this,"runHookParallel",d=>this.hooksDict[d].runParallel()),this.customConfigurations=n.config,this.customBootstrapConfiguration=n.bootstrap,this.configurations={authLogo:Cs,head:{favicon:qn},locales:["en"],menuLogo:Ms,notifications:{releases:!0},themes:{light:a.lightTheme,dark:a.darkTheme},translations:{},tutorials:!0},this.appPlugins=r||{},this.library=p,this.middlewares=h,this.plugins={},this.reducers=v,this.translations={},this.hooksDict={},this.admin={injectionZones:Jn},this.customFields=ae.rh,this.menu=[],this.settings={global:{id:"global",intlLabel:{id:"Settings.global",defaultMessage:"Global Settings"},links:[]}}}bootstrap(){return Ot(this,null,function*(){Object.keys(this.appPlugins).forEach(n=>{const r=this.appPlugins[n].bootstrap;r&&r({addSettingsLink:this.addSettingsLink,addSettingsLinks:this.addSettingsLinks,getPlugin:this.getPlugin,injectContentManagerComponent:this.injectContentManagerComponent,injectAdminComponent:this.injectAdminComponent,registerHook:this.registerHook})}),te()(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})})}initialize(){return Ot(this,null,function*(){Object.keys(this.appPlugins).forEach(n=>{this.appPlugins[n].register(this)})})}loadAdminTrads(){return Ot(this,null,function*(){const n=this.configurations.locales.map(h=>e(48224)(`./${h}.json`).then(({default:v})=>({data:v,locale:h})).catch(()=>({data:null,locale:h})));return(yield Promise.all(n)).reduce((h,v)=>(v.data&&(h[v.locale]=v.data),h),{})})}loadTrads(){return Ot(this,null,function*(){const n=yield this.loadAdminTrads(),r=Object.keys(this.appPlugins).map(d=>{const m=this.appPlugins[d].registerTrads;return m?m({locales:this.configurations.locales}):null}).filter(d=>d),h=(yield Promise.all(r)).reduce((d,m)=>{const E=m.reduce((y,q)=>(y[q.locale]=q.data,y),{});return Object.keys(E).forEach(y=>{d[y]=Tt(Tt({},d[y]),E[y])}),d},{}),v=this.configurations.locales.reduce((d,m)=>{var E,y;return d[m]=Tt(Tt(Tt({},n[m]),h[m]||{}),(y=(E=this.customConfigurations)==null?void 0:E.translations)==null?void 0:y[m]),d},{});return this.configurations.translations=v,Promise.resolve()})}render(){const n=this.createStore(),r=x()(Yn,this.configurations.locales||[]),{components:{components:p},fields:{fields:h}}=this.library;return t.createElement(Qn,{authLogo:this.configurations.authLogo,components:p,fields:h,customFields:this.customFields,localeNames:r,getAdminInjectedComponents:this.getAdminInjectedComponents,getPlugin:this.getPlugin,messages:this.configurations.translations,menu:this.menu,menuLogo:this.configurations.menuLogo,plugins:this.plugins,runHookParallel:this.runHookParallel,runHookWaterfall:(v,d,m=!1)=>this.runHookWaterfall(v,d,m,n),runHookSeries:this.runHookSeries,themes:this.configurations.themes,settings:this.settings,showTutorials:this.configurations.tutorials,showReleaseNotification:this.configurations.notifications.releases,store:n},t.createElement(t.Fragment,null,t.createElement(K.Helmet,{link:[{rel:"icon",type:"image/png",href:this.configurations.head.favicon}],htmlAttributes:{lang:localStorage.getItem(Ft)||"en"}}),t.createElement(c.BrowserRouter,{basename:w.EZ},t.createElement(Ss,{store:n}))))}}const ir=({adminConfig:i={},appPlugins:n,library:r,middlewares:p,reducers:h})=>new ar({adminConfig:i,appPlugins:n,library:r,middlewares:p,reducers:h})},5985:(ee,C,e)=>{"use strict";e.d(C,{Z:()=>a});var t=e(32735);const a=(0,t.createContext)()},20139:(ee,C,e)=>{"use strict";e.d(C,{Z:()=>P});var t=e(32735),c=e(5985);const P=()=>{const{changeLocale:M,localeNames:S,messages:x}=(0,t.useContext)(c.Z);return{changeLocale:M,localeNames:S,messages:x}}},10190:(ee,C,e)=>{"use strict";e.d(C,{Z:()=>S});var t=e(32735),c=e(19615),a=e(775);const P=c.default.img`
|
|
67
|
+
height: ${72/16}rem;
|
|
68
|
+
`,S=()=>{const{logos:{auth:x}}=(0,a.um)();return t.createElement(P,{src:x.default,"aria-hidden":!0,alt:""})}},66694:(ee,C,e)=>{"use strict";e.d(C,{ux:()=>a,_5:()=>M,$l:()=>x,Rj:()=>te});var t=e(32735);const a=(0,t.createContext)({}),M=(0,t.createContext)({}),x=(0,t.createContext)({}),te=(0,t.createContext)({})},70836:(ee,C,e)=>{"use strict";e.d(C,{Eo:()=>a,LK:()=>c,No:()=>t,dV:()=>P});const t="Admin/CM/pages/ListView/inject-column-in-table",c="Admin/CM/pages/App/mutate-collection-types-links",a="Admin/CM/pages/EditView/mutate-edit-view-layout",P="Admin/CM/pages/App/mutate-single-types-links"},775:(ee,C,e)=>{"use strict";e.d(C,{um:()=>t.Z,U_:()=>je,Dq:()=>Ce,H9:()=>Mt,bP:()=>ae,$_:()=>rn,rW:()=>Zt,bF:()=>Qt,G4:()=>Ws,Te:()=>bs,M1:()=>an});var t=e(19799),c=e(32735),a=e(88425),P=e(49415);const M={collectionTypes:[],components:[],isLoading:!0,singleTypes:[]},x=(l,o)=>(0,P.default)(l,s=>{switch(o.type){case"GET_MODELS":{s.collectionTypes=M.collectionTypes,s.singleTypes=M.singleTypes,s.components=M.components,s.isLoading=!0;break}case"GET_MODELS_ERROR":{s.collectionTypes=M.collectionTypes,s.singleTypes=M.singleTypes,s.components=M.components,s.isLoading=!1;break}case"GET_MODELS_SUCCEDED":{const O=T=>o.contentTypes.filter(U=>U.isDisplayed&&U.kind===T);s.isLoading=!1,s.collectionTypes=O("collectionType"),s.singleTypes=O("singleType"),s.components=o.components;break}default:return s}});var Z=Object.defineProperty,te=Object.defineProperties,V=Object.getOwnPropertyDescriptors,L=Object.getOwnPropertySymbols,K=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable,D=(l,o,s)=>o in l?Z(l,o,{enumerable:!0,configurable:!0,writable:!0,value:s}):l[o]=s,A=(l,o)=>{for(var s in o||(o={}))K.call(o,s)&&D(l,s,o[s]);if(L)for(var s of L(o))w.call(o,s)&&D(l,s,o[s]);return l},k=(l,o)=>te(l,V(o)),F=(l,o,s)=>new Promise((O,T)=>{var U=f=>{try{R(s.next(f))}catch(j){T(j)}},b=f=>{try{R(s.throw(f))}catch(j){T(j)}},R=f=>f.done?O(f.value):Promise.resolve(f.value).then(U,b);R((s=s.apply(l,o)).next())});const ae=()=>{const l=(0,a.useNotification)(),[o,s]=(0,c.useReducer)(x,M);(0,c.useEffect)(()=>{O()},[]);const O=()=>F(void 0,null,function*(){s({type:"GET_MODELS"});try{const[{data:T},{data:U}]=yield Promise.all(["components","content-types"].map(b=>(0,a.request)(`/content-manager/${b}`,{method:"GET"})));s({type:"GET_MODELS_SUCCEDED",contentTypes:U,components:T})}catch(T){s({type:"GET_MODELS_ERROR"}),l({type:"warning",message:{id:"notification.error"}})}});return k(A({},o),{getData:O})},g={data:{},error:null,isLoading:!0},X=(l,o)=>(0,P.default)(l,s=>{switch(o.type){case"GET_DATA":{s.isLoading=!0,s.data={},s.error=null;break}case"GET_DATA_SUCCEEDED":{s.data=o.data,s.isLoading=!1,s.error=null;break}case"GET_DATA_ERROR":{s.isLoading=!1,s.error=o.error;break}default:return s}});var me=(l,o,s)=>new Promise((O,T)=>{var U=f=>{try{R(s.next(f))}catch(j){T(j)}},b=f=>{try{R(s.throw(f))}catch(j){T(j)}},R=f=>f.done?O(f.value):Promise.resolve(f.value).then(U,b);R((s=s.apply(l,o)).next())});const je=l=>{const[{data:o,error:s,isLoading:O},T]=(0,c.useReducer)(X,g);return(0,c.useEffect)(()=>{(()=>me(void 0,null,function*(){T({type:"GET_DATA"});const{data:b}=yield(0,a.request)("/admin/permissions",{method:"GET",params:{role:l}});T({type:"GET_DATA_SUCCEEDED",data:b})}))()},[l]),{data:o,error:s,isLoading:O}},u={role:{},permissions:{},isLoading:!0},_e=(l,o)=>(0,P.default)(l,s=>{switch(o.type){case"GET_DATA_SUCCEEDED":{s.role=o.role,s.permissions=o.permissions,s.isLoading=!1;break}case"GET_DATA_ERROR":{s.isLoading=!1;break}case"ON_SUBMIT_SUCCEEDED":{s.role.name=o.name,s.role.description=o.description;break}default:return s}});var pe=e(98399),ie=Object.defineProperty,ye=Object.defineProperties,ke=Object.getOwnPropertyDescriptors,le=Object.getOwnPropertySymbols,J=Object.prototype.hasOwnProperty,ne=Object.prototype.propertyIsEnumerable,_=(l,o,s)=>o in l?ie(l,o,{enumerable:!0,configurable:!0,writable:!0,value:s}):l[o]=s,I=(l,o)=>{for(var s in o||(o={}))J.call(o,s)&&_(l,s,o[s]);if(le)for(var s of le(o))ne.call(o,s)&&_(l,s,o[s]);return l},B=(l,o)=>ye(l,ke(o)),Pe=(l,o,s)=>new Promise((O,T)=>{var U=f=>{try{R(s.next(f))}catch(j){T(j)}},b=f=>{try{R(s.throw(f))}catch(j){T(j)}},R=f=>f.done?O(f.value):Promise.resolve(f.value).then(U,b);R((s=s.apply(l,o)).next())});const Ce=l=>{const o=(0,a.useNotification)(),[s,O]=(0,c.useReducer)(_e,u);(0,c.useEffect)(()=>{l?T(l):O({type:"GET_DATA_SUCCEEDED",role:{},permissions:[]})},[l]);const T=b=>Pe(void 0,null,function*(){try{const[{data:R},{data:f}]=yield Promise.all([`roles/${b}`,`roles/${b}/permissions`].map(j=>(0,a.request)(`/admin/${j}`,{method:"GET"})));O({type:"GET_DATA_SUCCEEDED",role:R,permissions:f})}catch(R){pe.error(R),O({type:"GET_DATA_ERROR"}),o({type:"warning",message:{id:"notification.error"}})}}),U=(0,c.useCallback)(b=>{O(I({type:"ON_SUBMIT_SUCCEEDED"},b))},[]);return B(I({},s),{onSubmitSucceeded:U})},N=(l,o)=>o.map(({permissions:s})=>(0,a.hasPermissions)(l,s));var de=(l,o,s)=>new Promise((O,T)=>{var U=f=>{try{R(s.next(f))}catch(j){T(j)}},b=f=>{try{R(s.throw(f))}catch(j){T(j)}},R=f=>f.done?O(f.value):Promise.resolve(f.value).then(U,b);R((s=s.apply(l,o)).next())});const At=(l,o)=>de(void 0,null,function*(){const s=N(l,o),O=yield Promise.all(s);return o.filter((U,b)=>O[b])});var Ke=e(99381),St=e.n(Ke),gt=(l,o,s)=>new Promise((O,T)=>{var U=f=>{try{R(s.next(f))}catch(j){T(j)}},b=f=>{try{R(s.throw(f))}catch(j){T(j)}},R=f=>f.done?O(f.value):Promise.resolve(f.value).then(U,b);R((s=s.apply(l,o)).next())});const Ze=(l,o,s)=>gt(void 0,null,function*(){const O=N(l,o),T=yield Promise.all(O),U=o.filter((f,j)=>T[j]),b=U.findIndex(f=>f.to==="/settings");if(b===-1)return[];const R=St()(U);return R[b].notificationsCount=s?1:0,R});var ce=e(42258),qe=e.n(ce),De=e(45619),at=e.n(De),re=e(20223),$e=e.n(re),fe=e(83983);const ze={generalSectionLinks:[{icon:at(),intlLabel:{id:"global.plugins",defaultMessage:"Plugins"},to:"/list-plugins",permissions:fe.Z.marketplace.main},{icon:$e(),intlLabel:{id:"global.marketplace",defaultMessage:"Marketplace"},to:"/marketplace",permissions:fe.Z.marketplace.main},{icon:qe(),intlLabel:{id:"global.settings",defaultMessage:"Settings"},to:"/settings",permissions:[],notificationsCount:0}],pluginsSectionLinks:[],isLoading:!0},Ve=(l=ze,o)=>(0,P.default)(l,s=>{switch(o.type){case"SET_SECTION_LINKS":{const{authorizedGeneralSectionLinks:O,authorizedPluginSectionLinks:T}=o.data;s.generalSectionLinks=O,s.pluginsSectionLinks=T;break}case"UNSET_IS_LOADING":{s.isLoading=!1;break}default:return s}});var Ct=(l,o,s)=>new Promise((O,T)=>{var U=f=>{try{R(s.next(f))}catch(j){T(j)}},b=f=>{try{R(s.throw(f))}catch(j){T(j)}},R=f=>f.done?O(f.value):Promise.resolve(f.value).then(U,b);R((s=s.apply(l,o)).next())});const Mt=()=>{const[l,o]=(0,c.useReducer)(Ve,ze),{allPermissions:s}=(0,a.useRBACProvider)(),{shouldUpdateStrapi:O}=(0,a.useAppInfos)(),{menu:T}=(0,a.useStrapiApp)(),U=(0,c.useRef)(l.generalSectionLinks),b=(0,c.useRef)(O),R=(...j)=>Ct(void 0,[...j],function*(Be=s){const ct=yield At(Be,T),mt=yield Ze(Be,U.current,b.current);o({type:"SET_SECTION_LINKS",data:{authorizedGeneralSectionLinks:mt,authorizedPluginSectionLinks:ct}}),o({type:"UNSET_IS_LOADING"})}),f=(0,c.useRef)(R);return(0,c.useEffect)(()=>{f.current(s)},[s,o]),l};var Dt=e(33795),Te=e.n(Dt),yt=e(17247),tt=Object.defineProperty,We=Object.defineProperties,Oe=Object.getOwnPropertyDescriptors,Ne=Object.getOwnPropertySymbols,st=Object.prototype.hasOwnProperty,Xe=Object.prototype.propertyIsEnumerable,Xt=(l,o,s)=>o in l?tt(l,o,{enumerable:!0,configurable:!0,writable:!0,value:s}):l[o]=s,ft=(l,o)=>{for(var s in o||(o={}))st.call(o,s)&&Xt(l,s,o[s]);if(Ne)for(var s of Ne(o))Xe.call(o,s)&&Xt(l,s,o[s]);return l},Et=(l,o)=>We(l,Oe(o));const It=(l,o)=>Et(ft({},l),{isLoading:o}),bt={roles:[],isLoading:!0},cs=(l,o)=>(0,P.default)(l,s=>{switch(o.type){case"GET_DATA":{s.isLoading=!0,s.roles=[];break}case"GET_DATA_SUCCEEDED":{s.roles=o.data,s.isLoading=!1;break}case"GET_DATA_ERROR":{s.isLoading=!1;break}default:return s}});var ms=(l,o,s)=>new Promise((O,T)=>{var U=f=>{try{R(s.next(f))}catch(j){T(j)}},b=f=>{try{R(s.throw(f))}catch(j){T(j)}},R=f=>f.done?O(f.value):Promise.resolve(f.value).then(U,b);R((s=s.apply(l,o)).next())});const Qt=(l=!0)=>{const o=(0,a.useNotification)(),[{roles:s,isLoading:O},T]=(0,c.useReducer)(cs,bt,()=>It(bt,l));(0,c.useEffect)(()=>{l&&U()},[l]);const U=(0,c.useCallback)(()=>ms(void 0,null,function*(){try{T({type:"GET_DATA"});const{data:{data:b}}=yield yt.be.get("/admin/roles");T({type:"GET_DATA_SUCCEEDED",data:b})}catch(b){const R=Te()(b,["response","payload","message"],"An error occured");T({type:"GET_DATA_ERROR"}),R!=="Forbidden"&&o({type:"warning",message:R})}}),[o]);return{roles:s,isLoading:O,getData:U}};var Qe=e(92891);const Yt={menu:[],isLoading:!0},ps=(l,o)=>(0,P.default)(l,s=>{switch(o.type){case"CHECK_PERMISSIONS_SUCCEEDED":{o.data.forEach(O=>{O.hasPermission&&(0,Qe.set)(s,["menu",...O.path.split("."),"isDisplayed"],O.hasPermission)}),s.menu.forEach((O,T)=>{s.menu[T].links=O.links.filter(U=>U.isDisplayed===!0)}),s.isLoading=!1;break}default:return s}});var fs=e(9086),gs=e.n(fs),Ys=e(98978),hs=e.n(Ys);const Js=l=>hs()(l,o=>o.id);var vs=Object.defineProperty,ys=Object.defineProperties,Ps=Object.getOwnPropertyDescriptors,jt=Object.getOwnPropertySymbols,Ts=Object.prototype.hasOwnProperty,Os=Object.prototype.propertyIsEnumerable,Jt=(l,o,s)=>o in l?vs(l,o,{enumerable:!0,configurable:!0,writable:!0,value:s}):l[o]=s,_t=(l,o)=>{for(var s in o||(o={}))Ts.call(o,s)&&Jt(l,s,o[s]);if(jt)for(var s of jt(o))Os.call(o,s)&&Jt(l,s,o[s]);return l},qt=(l,o)=>ys(l,Ps(o));const es=l=>l.map(o=>{const s=o.links.map(O=>qt(_t({},O),{isDisplayed:!1}));return qt(_t({},o),{links:s})});var Pt=e(21930);const ss=[{intlLabel:{id:"Settings.application.title",defaultMessage:"Overview"},to:"/settings/application-infos",id:"000-application-infos",isDisplayed:!1,permissions:[]},{intlLabel:{id:"Settings.webhooks.title",defaultMessage:"Webhooks"},to:"/settings/webhooks",id:"webhooks",isDisplayed:!1,permissions:fe.Z.settings.webhooks.main},{intlLabel:{id:"Settings.apiTokens.title",defaultMessage:"API Tokens"},to:"/settings/api-tokens?sort=name:ASC",id:"api-tokens",isDisplayed:!1,permissions:fe.Z.settings["api-tokens"].main}];var Rs=function(){return window&&window.strapi&&window.strapi.isEE?e(11545).Z:e(73086).Z}();const As=[].concat((0,Pt.Z)(ss),(0,Pt.Z)(Rs));var Ss=Object.defineProperty,Cs=Object.defineProperties,Ms=Object.getOwnPropertyDescriptors,Bt=Object.getOwnPropertySymbols,Ds=Object.prototype.hasOwnProperty,Ut=Object.prototype.propertyIsEnumerable,wt=(l,o,s)=>o in l?Ss(l,o,{enumerable:!0,configurable:!0,writable:!0,value:s}):l[o]=s,ns=(l,o)=>{for(var s in o||(o={}))Ds.call(o,s)&&wt(l,s,o[s]);if(Bt)for(var s of Bt(o))Ut.call(o,s)&&wt(l,s,o[s]);return l},xt=(l,o)=>Cs(l,Ms(o));const Is=(l,{settings:o,shouldUpdateStrapi:s})=>{const O=o.global.links,T=Js([...O,...As]).map(R=>xt(ns({},R),{hasNotification:R.id==="000-application-infos"&&s})),U=Object.values(gs()(o,"global")),b=[xt(ns({},o.global),{links:T}),{id:"permissions",intlLabel:{id:"Settings.permissions",defaultMessage:"Administration Panel"},links:[{intlLabel:{id:"global.roles",defaultMessage:"Roles"},to:"/settings/roles",id:"roles",isDisplayed:!1,permissions:fe.Z.settings.roles.main},{intlLabel:{id:"global.users"},to:"/settings/users?pageSize=10&page=1&sort=firstname",id:"users",isDisplayed:!1,permissions:fe.Z.settings.users.main}]},...U];return xt(ns({},l),{menu:es(b)})};var rs=(l,o,s)=>new Promise((O,T)=>{var U=f=>{try{R(s.next(f))}catch(j){T(j)}},b=f=>{try{R(s.throw(f))}catch(j){T(j)}},R=f=>f.done?O(f.value):Promise.resolve(f.value).then(U,b);R((s=s.apply(l,o)).next())});const bs=(l=!1)=>{const{allPermissions:o}=(0,a.useRBACProvider)(),{shouldUpdateStrapi:s}=(0,a.useAppInfos)(),{settings:O}=(0,a.useStrapiApp)(),[{isLoading:T,menu:U},b]=(0,c.useReducer)(ps,Yt,()=>Is(Yt,{settings:O,shouldUpdateStrapi:s}));return(0,c.useEffect)(()=>{l||(()=>rs(void 0,null,function*(){const f=(ct,mt)=>rs(void 0,null,function*(){return{hasPermission:yield(0,a.hasPermissions)(o,ct),path:mt}}),Be=(ct=>ct.reduce((mt,Gt,Ht)=>{const is=$t=>$t.map((it,Le)=>f($t[Le].permissions,`${Ht}.links.${Le}`));return[...mt,...is(Gt.links)]},[]))(U),dt=yield Promise.all(Be);b({type:"CHECK_PERMISSIONS_SUCCEEDED",data:dt})}))()},[o,l]),{isLoading:T,menu:U}};var kt=e(7602);const os={fieldsToPick:[],formErrors:{},initialData:{},isLoading:!0,modifiedData:{},showHeaderButtonLoader:!1,showHeaderLoader:!0},tn=(l,o)=>(0,P.default)(l,s=>{switch(o.type){case"GET_DATA_SUCCEEDED":{s.isLoading=!1,s.showHeaderLoader=!1,s.initialData=(0,Qe.pick)(o.data,l.fieldsToPick),s.modifiedData=(0,Qe.pick)(o.data,l.fieldsToPick);break}case"ON_CANCEL":{s.modifiedData=l.initialData,s.formErrors={};break}case"ON_CHANGE":{o.inputType==="password"&&!o.value?(0,Qe.unset)(s.modifiedData,o.keys.split(".")):o.keys.includes("username")&&!o.value?(0,Qe.set)(s.modifiedData,o.keys.split("."),null):(0,Qe.set)(s.modifiedData,o.keys.split("."),o.value);break}case"ON_SUBMIT":{s.showHeaderButtonLoader=!0;break}case"ON_SUBMIT_SUCCEEDED":{s.initialData=(0,Qe.pick)(o.data,l.fieldsToPick),s.modifiedData=(0,Qe.pick)(o.data,l.fieldsToPick),s.showHeaderButtonLoader=!1;break}case"SET_ERRORS":{s.formErrors=o.errors,s.showHeaderButtonLoader=!1;break}default:return s}});var Ft=Object.defineProperty,sn=Object.defineProperties,js=Object.getOwnPropertyDescriptors,as=Object.getOwnPropertySymbols,_s=Object.prototype.hasOwnProperty,Bs=Object.prototype.propertyIsEnumerable,Wt=(l,o,s)=>o in l?Ft(l,o,{enumerable:!0,configurable:!0,writable:!0,value:s}):l[o]=s,Us=(l,o)=>{for(var s in o||(o={}))_s.call(o,s)&&Wt(l,s,o[s]);if(as)for(var s of as(o))Bs.call(o,s)&&Wt(l,s,o[s]);return l},ws=(l,o)=>sn(l,js(o));const ks=(l,o)=>ws(Us({},l),{fieldsToPick:o});var Fs=e(98399),Nt=(l,o,s)=>new Promise((O,T)=>{var U=f=>{try{R(s.next(f))}catch(j){T(j)}},b=f=>{try{R(s.throw(f))}catch(j){T(j)}},R=f=>f.done?O(f.value):Promise.resolve(f.value).then(U,b);R((s=s.apply(l,o)).next())});const Ws=(l,o,s,O)=>{const[{formErrors:T,initialData:U,isLoading:b,modifiedData:R,showHeaderButtonLoader:f,showHeaderLoader:j},Be]=(0,c.useReducer)(tn,os,()=>ks(os,O)),dt=(0,a.useNotification)(),{lockApp:ct,unlockApp:mt}=(0,a.useOverlayBlocker)();return(0,c.useEffect)(()=>{l&&(()=>Nt(void 0,null,function*(){try{const{data:Le}=yield(0,a.request)(l,{method:"GET"});Be({type:"GET_DATA_SUCCEEDED",data:Le,fieldsToPick:O})}catch(Le){Fs.error(Le.response),dt({type:"warning",message:{id:"notification.error"}})}}))()},[l]),[{formErrors:T,initialData:U,isLoading:b,modifiedData:R,showHeaderButtonLoader:f,showHeaderLoader:j},Be,{handleCancel:()=>{Be({type:"ON_CANCEL"})},handleChange:({target:{name:it,value:Le,type:lt}})=>{Be({type:"ON_CHANGE",inputType:lt,keys:it,value:Le})},handleSubmit:it=>Nt(void 0,null,function*(){it.preventDefault();const Le=yield(0,kt.R6)(R,o);if(Be({type:"SET_ERRORS",errors:Le||{}}),!Le)try{ct(),Be({type:"ON_SUBMIT"});const lt=(0,Qe.omit)(R,["confirmPassword","registrationToken"]);lt.roles&&(lt.roles=lt.roles.map(zt=>zt.id));const{data:ut}=yield(0,a.request)(l,{method:"PUT",body:lt});s(ut),Be({type:"ON_SUBMIT_SUCCEEDED",data:ut}),dt({type:"success",message:{id:"notification.success.saved"}})}catch(lt){const ut=(0,Qe.get)(lt,"response.payload",{data:{}});(0,Qe.has)(ut,"data")&&typeof ut.data=="string"?dt({type:"warning",message:ut.data}):dt({type:"warning",message:ut.message});const zt=(0,kt.Iz)(ut);Be({type:"SET_ERRORS",errors:zt})}finally{mt()}}),setField:(it,Le)=>{Be({type:"ON_CHANGE",keys:it,value:Le})}}]};var Kt=e(66694);const rn=()=>(0,c.useContext)(Kt.$l),Ns=!JSON.parse(localStorage.getItem("STRAPI_UPDATE_NOTIF")),Ln=()=>{const{latestStrapiReleaseTag:l,shouldUpdateStrapi:o}=useAppInfos(),s=useNotification();return useEffect(()=>{o&&Ns&&s({type:"info",message:{id:"notification.version.update.message"},link:{url:`https://github.com/strapi/strapi/releases/tag/${l}`,label:{id:"global.see-more"}},blockTransition:!0,onClose:()=>localStorage.setItem("STRAPI_UPDATE_NOTIF",!0)})},[l,o,s]),null},on=null,an=()=>(0,c.useContext)(Kt.Rj);var Zs=(l,o,s)=>new Promise((O,T)=>{var U=f=>{try{R(s.next(f))}catch(j){T(j)}},b=f=>{try{R(s.throw(f))}catch(j){T(j)}},R=f=>f.done?O(f.value):Promise.resolve(f.value).then(U,b);R((s=s.apply(l,o)).next())});const Zt=(l,o)=>{const[s,O]=(0,c.useState)(!1),T=(0,a.useNotification)();return{regenerateData:()=>Zs(void 0,null,function*(){try{const{data:{data:{accessKey:b}}}=yield yt.be.post(`/admin/api-tokens/${l}/regenerate`);O(!1),o(b)}catch(b){O(!1),T({type:"warning",message:(0,Qe.get)(b,"response.data.message","notification.error")})}}),isLoadingConfirmation:s}}},19799:(ee,C,e)=>{"use strict";e.d(C,{Z:()=>P});var t=e(32735),c=e(66694);const P=()=>(0,t.useContext)(c._5)},73086:(ee,C,e)=>{"use strict";e.d(C,{Z:()=>t});const t=[]},954:(ee,C,e)=>{"use strict";e.d(C,{sg:()=>w,bU:()=>D,ZP:()=>k});var t=e(32735),c=e(19615),a=e(60216),P=e.n(a),M=e(9808),S=e(19192),x=e(5636),Z=e(12611),te=e(20139);const L=()=>{const{changeLocale:F,localeNames:H}=(0,te.Z)(),{locale:ae}=(0,x.useIntl)();return t.createElement(Z.SimpleMenu,{label:H[ae]},Object.keys(H).map(g=>t.createElement(Z.MenuItem,{onClick:()=>F(g),key:g},H[g])))},K=(0,c.default)(M.Box)`
|
|
69
|
+
margin: 0 auto;
|
|
70
|
+
width: 552px;
|
|
71
|
+
`,w=(0,c.default)(S.Flex)`
|
|
72
|
+
flex-direction: column;
|
|
73
|
+
`,D=({children:F})=>t.createElement(K,{shadow:"tableShadow",hasRadius:!0,paddingTop:9,paddingBottom:9,paddingLeft:10,paddingRight:10,background:"neutral0",justifyContent:"center"},F);D.propTypes={children:P().node.isRequired};const A=({children:F})=>t.createElement("div",null,t.createElement(S.Flex,{as:"header",justifyContent:"flex-end"},t.createElement(M.Box,{paddingTop:6,paddingRight:8},t.createElement(L,null))),t.createElement(M.Box,{paddingTop:2,paddingBottom:11},F));A.propTypes={children:P().node.isRequired};const k=A},56761:(ee,C,e)=>{"use strict";e.d(C,{Z:()=>c});const c=[]},72218:(ee,C,e)=>{"use strict";e.d(C,{Z:()=>M});var t=e(19615),c=e(20001),a=e.n(c);const M=(0,t.default)(c.FieldAction)`
|
|
74
|
+
svg {
|
|
75
|
+
height: 1rem;
|
|
76
|
+
width: 1rem;
|
|
77
|
+
path {
|
|
78
|
+
fill: ${({theme:S})=>S.colors.neutral600};
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
`},1115:(ee,C,e)=>{"use strict";e.d(C,{Z:()=>J});var t=e(32735),c=e(88425),a=e.n(c),P=e(37341),M=e.n(P),S=e(33912),x=e.n(S),Z=e(9808),te=e.n(Z),V=e(90662),L=e.n(V),K=e(16540),w=e.n(K),D=e(19192),A=e.n(D),k=e(44526),F=e.n(k),H=e(37178),ae=e.n(H),g=e(52111),se=e.n(g),X=e(95602),me=e.n(X),be=e(60216),je=e.n(be),u=e(5636),Je=e(19615),_e=e(83281),pe=e(954),ie=e(10190),ye=e(72218);const ke=(0,Je.default)(H.TextInput)`
|
|
82
|
+
::-ms-reveal {
|
|
83
|
+
display: none;
|
|
84
|
+
}
|
|
85
|
+
`,le=({onSubmit:ne,schema:_,children:I})=>{const[B,Pe]=(0,t.useState)(!1),{formatMessage:$}=(0,u.useIntl)();return t.createElement(K.Main,null,t.createElement(pe.bU,null,t.createElement(_e.Formik,{enableReinitialize:!0,initialValues:{email:"",password:"",rememberMe:!1},onSubmit:ne,validationSchema:_,validateOnChange:!1},({values:Ce,errors:ue,handleChange:N})=>t.createElement(c.Form,{noValidate:!0},t.createElement(pe.sg,null,t.createElement(ie.Z,null),t.createElement(Z.Box,{paddingTop:6,paddingBottom:1},t.createElement(X.Typography,{variant:"alpha",as:"h1"},$({id:"Auth.form.welcome.title",defaultMessage:"Welcome!"}))),t.createElement(Z.Box,{paddingBottom:7},t.createElement(X.Typography,{variant:"epsilon",textColor:"neutral600"},$({id:"Auth.form.welcome.subtitle",defaultMessage:"Log in to your Strapi account"}))),ue.errorMessage&&t.createElement(X.Typography,{id:"global-form-error",role:"alert",tabIndex:-1,textColor:"danger600"},ue.errorMessage)),t.createElement(V.Stack,{spacing:6},t.createElement(H.TextInput,{error:ue.email?$({id:ue.email,defaultMessage:"This value is required."}):"",value:Ce.email,onChange:N,label:$({id:"Auth.form.email.label",defaultMessage:"Email"}),placeholder:$({id:"Auth.form.email.placeholder",defaultMessage:"kai@doe.com"}),name:"email",required:!0}),t.createElement(ke,{error:ue.password?$({id:ue.password,defaultMessage:"This value is required."}):"",onChange:N,value:Ce.password,label:$({id:"global.password",defaultMessage:"Password"}),name:"password",type:B?"text":"password",endAction:t.createElement(ye.Z,{onClick:de=>{de.stopPropagation(),Pe(Fe=>!Fe)},label:$(B?{id:"Auth.form.password.show-password",defaultMessage:"Show password"}:{id:"Auth.form.password.hide-password",defaultMessage:"Hide password"})},B?t.createElement(x(),null):t.createElement(M(),null)),required:!0}),t.createElement(g.Checkbox,{onValueChange:de=>{N({target:{value:de,name:"rememberMe"}})},value:Ce.rememberMe,"aria-label":"rememberMe",name:"rememberMe"},$({id:"Auth.form.rememberMe.label",defaultMessage:"Remember me"})),t.createElement(k.Button,{fullWidth:!0,type:"submit"},$({id:"Auth.form.button.login",defaultMessage:"Login"}))))),I),t.createElement(D.Flex,{justifyContent:"center"},t.createElement(Z.Box,{paddingTop:4},t.createElement(c.Link,{to:"/auth/forgot-password"},$({id:"Auth.link.forgot-password",defaultMessage:"Forgot your password?"})))))};le.defaultProps={children:null,onSubmit(){}},le.propTypes={children:je().node,onSubmit:je().func,schema:je().shape({type:je().string.isRequired}).isRequired};const J=le},5365:(ee,C,e)=>{"use strict";e.d(C,{Z:()=>w});var t=e(32735),c=e(60216),a=e.n(c),P=e(1115),M=e(954),S=Object.defineProperty,x=Object.getOwnPropertySymbols,Z=Object.prototype.hasOwnProperty,te=Object.prototype.propertyIsEnumerable,V=(D,A,k)=>A in D?S(D,A,{enumerable:!0,configurable:!0,writable:!0,value:k}):D[A]=k,L=(D,A)=>{for(var k in A||(A={}))Z.call(A,k)&&V(D,k,A[k]);if(x)for(var k of x(A))te.call(A,k)&&V(D,k,A[k]);return D};const K=D=>t.createElement(M.ZP,null,t.createElement(P.Z,L({},D)));K.defaultProps={onSubmit:D=>D.preventDefault()},K.propTypes={onSubmit:a().func};const w=K},53951:(ee,C,e)=>{"use strict";e.r(C),e.d(C,{default:()=>k});var t=e(32735),c=e(88425),a=e.n(c),P=e(16540),M=e.n(P),S=e(11856),x=e.n(S),Z=e(64354),te=e.n(Z),V=e(70733),L=e.n(V),K=e(30345),w=e.n(K),D=e(5636);const k=()=>{const{formatMessage:F}=(0,D.useIntl)();return(0,c.useFocusWhenNavigate)(),t.createElement(P.Main,{labelledBy:"title"},t.createElement(S.HeaderLayout,{id:"title",title:F({id:"content-manager.pageNotFound",defaultMessage:"Page not found"})}),t.createElement(S.ContentLayout,null,t.createElement(Z.EmptyStateLayout,{action:t.createElement(c.LinkButton,{variant:"secondary",endIcon:t.createElement(w(),null),to:"/"},F({id:"app.components.NotFoundPage.back",defaultMessage:"Back to homepage"})),content:F({id:"app.page.not.found",defaultMessage:"Oops! We can't seem to find the page you're looging for..."}),hasRadius:!0,icon:t.createElement(L(),{width:"10rem"}),shadow:"tableShadow"})))}},26123:(ee,C,e)=>{"use strict";e.d(C,{Z:()=>t});const t={}},41832:(ee,C,e)=>{"use strict";e.d(C,{Z:()=>c});const c=({data:a})=>{try{return Object.keys(a).reduce((P,M)=>{const S=a[M][0];return P[M]={id:S,defaultMessage:S},P},{})}catch(P){return{}}}},7602:(ee,C,e)=>{"use strict";e.d(C,{R6:()=>P,ot:()=>w,Iz:()=>D.Z,Pp:()=>ne,IF:()=>J,WW:()=>_e});var t=e(88425),c=(_,I,B)=>new Promise((Pe,$)=>{var Ce=de=>{try{N(B.next(de))}catch(Fe){$(Fe)}},ue=de=>{try{N(B.throw(de))}catch(Fe){$(Fe)}},N=de=>de.done?Pe(de.value):Promise.resolve(de.value).then(Ce,ue);N((B=B.apply(_,I)).next())});const P=(_,I)=>c(void 0,null,function*(){let B=null;try{yield I.validate(_,{abortEarly:!1})}catch(Pe){B=(0,t.getYupInnerErrors)(Pe)}return B});var M=e(32735),S=e(60216),x=e.n(S),Z=e(5141),te=e(98399),V=(_,I,B)=>new Promise((Pe,$)=>{var Ce=de=>{try{N(B.next(de))}catch(Fe){$(Fe)}},ue=de=>{try{N(B.throw(de))}catch(Fe){$(Fe)}},N=de=>de.done?Pe(de.value):Promise.resolve(de.value).then(Ce,ue);N((B=B.apply(_,I)).next())});const L=({loadComponent:_})=>{const[I,B]=(0,M.useState)(null);return(0,M.useEffect)(()=>{(()=>V(void 0,null,function*(){try{const $=yield _();B(()=>$.default)}catch($){te.log($)}}))()},[_]),I?M.createElement(I,null):M.createElement(t.LoadingIndicatorPage,null)},K=(_,I,B)=>M.createElement(Z.Route,{render:()=>M.createElement(L,{loadComponent:_}),key:I,path:I,exact:B||!1});L.propTypes={loadComponent:x().func.isRequired};const w=K;var D=e(41832),A=e(92891),k=Object.defineProperty,F=Object.defineProperties,H=Object.getOwnPropertyDescriptors,ae=Object.getOwnPropertySymbols,g=Object.prototype.hasOwnProperty,se=Object.prototype.propertyIsEnumerable,X=(_,I,B)=>I in _?k(_,I,{enumerable:!0,configurable:!0,writable:!0,value:B}):_[I]=B,me=(_,I)=>{for(var B in I||(I={}))g.call(I,B)&&X(_,B,I[B]);if(ae)for(var B of ae(I))se.call(I,B)&&X(_,B,I[B]);return _},be=(_,I)=>F(_,H(I));const je=_=>{const I=get(_,["options","timestamps"]);let B=Array.isArray(I)?I:[];const $=[...["id","_id"],...B,"publishedAt"],Ce=get(_,["attributes"],{});return Object.keys(Ce).reduce((ue,N)=>($.includes(N)||ue.push(be(me({},Ce[N]),{attributeName:N})),ue),[])},u=null,_e=_=>_.filter((I,B,Pe)=>Pe.findIndex($=>$.key===I.key)===B),pe=_=>sortBy(_,I=>I.name),ie=null,ye=_=>Array.from(new Set(Object.entries(_).reduce((I,B)=>{const Pe=$=>$.reduce((Ce,ue)=>{let N=Ce;return ue.actions&&(N=[...N,...ue.actions]),typeof ue=="object"&&!ue.actions&&(N=[...N,...Object.keys(ue)]),N},[]);return[...I,...Pe([...Object.values(B[1].attributes||{}),get(B[1],"contentTypeActions",{})])]},[]))),ke=null,J=_=>`/admin/${_}`,ne=(_,I="")=>[_,I].filter(B=>B).join(" ")},58414:(ee,C,e)=>{"use strict";e.d(C,{p:()=>L});var t=e(32735),c=e(88425),a=e(7602),P=e(49415);const M={data:[],isLoading:!0},x=(K,w)=>(0,P.default)(K,D=>{switch(w.type){case"GET_DATA_SUCCEEDED":{D.data=w.data,D.isLoading=!1;break}case"GET_DATA_ERROR":{D.isLoading=!1;break}default:return D}});var Z=e(98399),te=(K,w,D)=>new Promise((A,k)=>{var F=g=>{try{ae(D.next(g))}catch(se){k(se)}},H=g=>{try{ae(D.throw(g))}catch(se){k(se)}},ae=g=>g.done?A(g.value):Promise.resolve(g.value).then(F,H);ae((D=D.apply(K,w)).next())});const L=({ssoEnabled:K})=>{const[w,D]=(0,t.useReducer)(x,M),A=(0,c.useNotification)();(0,t.useEffect)(()=>{k()},[]);const k=()=>te(void 0,null,function*(){try{if(!K){D({type:"GET_DATA_SUCCEEDED",data:[]});return}const F=(0,a.IF)("providers"),H=yield(0,c.request)(F,{method:"GET"});D({type:"GET_DATA_SUCCEEDED",data:H})}catch(F){Z.error(F),D({type:"GET_DATA_ERROR"}),A({type:"warning",message:{id:"notification.error"}})}});return w}},11545:(ee,C,e)=>{"use strict";e.d(C,{Z:()=>P});var t=e(83983);const P=[...strapi.features.isEnabled(strapi.features.SSO)?[{intlLabel:{id:"Settings.sso.title",defaultMessage:"Single Sign-On"},to:"/settings/single-sign-on",id:"sso",isDisplayed:!1,permissions:t.Z.settings.sso.main}]:[]]},68944:(ee,C,e)=>{"use strict";e.d(C,{Z:()=>K});var t=e(32735),c=e(5141),a=e(5636),P=e(49189),M=e.n(P),S=e(88425),x=e(7602),Z=(w,D,A)=>new Promise((k,F)=>{var H=se=>{try{g(A.next(se))}catch(X){F(X)}},ae=se=>{try{g(A.throw(se))}catch(X){F(X)}},g=se=>se.done?k(se.value):Promise.resolve(se.value).then(H,ae);g((A=A.apply(w,D)).next())});const V=()=>{const{params:{authResponse:w}}=(0,c.useRouteMatch)("/auth/login/:authResponse"),{formatMessage:D}=(0,a.useIntl)(),{push:A}=(0,c.useHistory)(),k=(0,t.useRef)(D);let F=(0,t.useCallback)(()=>{A(`/auth/oops?info=${encodeURIComponent(k.current({id:"Auth.form.button.login.providers.error",defaultMessage:"We cannot connect you through the selected provider."}))}`)},[A]);const H=(0,t.useCallback)(()=>Z(void 0,null,function*(){try{const ae=M().get("jwtToken");if(S.auth.clearAppStorage(),ae){S.auth.setToken(ae,!0);const g=(0,x.IF)("users/me"),{data:se}=yield(0,S.request)(g,{method:"GET"});S.auth.setUserInfo(se,!0),M().remove("jwtToken"),A("/auth/login")}}catch(ae){F()}}),[A,F]);return(0,t.useEffect)(()=>{w==="error"&&F(),w==="success"&&H()},[w,H,F]),t.createElement(S.LoadingIndicatorPage,null)},K=[{Component:()=>({default:V}),to:"/auth/login/:authResponse",exact:!0}]},98768:(ee,C,e)=>{"use strict";e.d(C,{Z:()=>_e});var t=e(32735),c=e(60216),a=e.n(c),P=e(19615),M=e(9808),S=e.n(M),x=e(19192),Z=e.n(x),te=e(27635),V=e.n(te),L=e(90662),K=e.n(L),w=e(95602),D=e.n(w),A=e(5636),k=e(1115),F=e(58414),H=e(954),ae=e(33205),g=Object.defineProperty,se=Object.getOwnPropertySymbols,X=Object.prototype.hasOwnProperty,me=Object.prototype.propertyIsEnumerable,be=(pe,ie,ye)=>ie in pe?g(pe,ie,{enumerable:!0,configurable:!0,writable:!0,value:ye}):pe[ie]=ye,je=(pe,ie)=>{for(var ye in ie||(ie={}))X.call(ie,ye)&&be(pe,ye,ie[ye]);if(se)for(var ye of se(ie))me.call(ie,ye)&&be(pe,ye,ie[ye]);return pe};const u=(0,P.default)(te.Divider)`
|
|
86
|
+
flex: 1;
|
|
87
|
+
`,Je=pe=>{const ie=strapi.features.isEnabled(strapi.features.SSO),{isLoading:ye,data:ke}=(0,F.p)({ssoEnabled:ie}),{formatMessage:le}=(0,A.useIntl)();return!ie||!ye&&ke.length===0?t.createElement(H.ZP,null,t.createElement(k.Z,je({},pe))):t.createElement(H.ZP,null,t.createElement(k.Z,je({},pe),t.createElement(M.Box,{paddingTop:7},t.createElement(L.Stack,{spacing:7},t.createElement(x.Flex,null,t.createElement(u,null),t.createElement(M.Box,{paddingLeft:3,paddingRight:3},t.createElement(w.Typography,{variant:"sigma",textColor:"neutral600"},le({id:"Auth.login.sso.divider"}))),t.createElement(u,null)),t.createElement(ae.Z,{providers:ke,displayAllProviders:!1})))))};Je.defaultProps={onSubmit:pe=>pe.preventDefault(),requestError:null},Je.propTypes={formErrors:a().object.isRequired,modifiedData:a().object.isRequired,onChange:a().func.isRequired,onSubmit:a().func,requestError:a().object};const _e=Je},33205:(ee,C,e)=>{"use strict";e.d(C,{Z:()=>ae});var t=e(32735),c=e(60216),a=e.n(c),P=e(78330),M=e.n(P),S=e(19192),x=e.n(S),Z=e(95602),te=e.n(Z),V=e(44826),L=e.n(V),K=e(19615),w=e(5636),D=e(5141);const A=K.default.a`
|
|
88
|
+
width: ${136/16}rem;
|
|
89
|
+
display: flex;
|
|
90
|
+
justify-content: center;
|
|
91
|
+
align-items: center;
|
|
92
|
+
height: ${48/16}rem;
|
|
93
|
+
border: 1px solid ${({theme:g})=>g.colors.neutral150};
|
|
94
|
+
border-radius: ${({theme:g})=>g.borderRadius};
|
|
95
|
+
text-decoration: inherit;
|
|
96
|
+
&:link {
|
|
97
|
+
text-decoration: none;
|
|
98
|
+
}
|
|
99
|
+
color: ${({theme:g})=>g.colors.neutral600};
|
|
100
|
+
`,k=(0,K.default)(S.Flex)`
|
|
101
|
+
& a:not(:first-child):not(:last-child) {
|
|
102
|
+
margin: 0 ${({theme:g})=>g.spaces[2]};
|
|
103
|
+
}
|
|
104
|
+
& a:first-child {
|
|
105
|
+
margin-right: ${({theme:g})=>g.spaces[2]};
|
|
106
|
+
}
|
|
107
|
+
& a:last-child {
|
|
108
|
+
margin-left: ${({theme:g})=>g.spaces[2]};
|
|
109
|
+
}
|
|
110
|
+
`,F=({provider:g})=>t.createElement(V.Tooltip,{label:g.displayName},t.createElement(A,{href:`${strapi.backendURL}/admin/connect/${g.uid}`},g.icon?t.createElement("img",{src:g.icon,"aria-hidden":!0,alt:"",height:"32px"}):t.createElement(Z.Typography,null,g.displayName)));F.propTypes={provider:a().shape({icon:a().string,displayName:a().string.isRequired,uid:a().string.isRequired}).isRequired};const H=({providers:g,displayAllProviders:se})=>{const{formatMessage:X}=(0,w.useIntl)();return se?t.createElement(P.Grid,{gap:4},g.map(me=>t.createElement(P.GridItem,{key:me.uid,col:4},t.createElement(F,{provider:me})))):g.length>2&&!se?t.createElement(P.Grid,{gap:4},g.slice(0,2).map(me=>t.createElement(P.GridItem,{key:me.uid,col:4},t.createElement(F,{provider:me}))),t.createElement(P.GridItem,{col:4},t.createElement(V.Tooltip,{label:X({id:"global.see-more"})},t.createElement(A,{as:D.Link,to:"/auth/providers"},t.createElement("span",{"aria-hidden":!0},"\u2022\u2022\u2022"))))):t.createElement(k,{justifyContent:"center"},g.map(me=>t.createElement(F,{key:me.uid,provider:me})))};H.defaultProps={displayAllProviders:!0},H.propTypes={providers:a().arrayOf(a().object).isRequired,displayAllProviders:a().bool};const ae=H},7277:(ee,C,e)=>{"use strict";e.d(C,{Z:()=>ke});var t=e(32735),c=e(5141),a=e(19615),P=e(88425),M=e(27635),S=e(90662),x=e(19192),Z=e(9808),te=e(44526),V=e(82910),L=e(95602),K=e(16540),w=e(5636),D=e(58414),A=e(954),k=e(33205),F=e(10190);const H=(0,a.default)(M.Divider)`
|
|
111
|
+
flex: 1;
|
|
112
|
+
`,g=()=>{const le=strapi.features.isEnabled(strapi.features.SSO),{push:J}=(0,c.useHistory)(),{formatMessage:ne}=(0,w.useIntl)(),{isLoading:_,data:I}=(0,D.p)({ssoEnabled:le}),B=()=>{J("/auth/login")};return!le||!_&&I.length===0?t.createElement(c.Redirect,{to:"/auth/login"}):t.createElement(A.ZP,null,t.createElement(K.Main,null,t.createElement(A.bU,null,t.createElement(A.sg,null,t.createElement(F.Z,null),t.createElement(Z.Box,{paddingTop:6,paddingBottom:1},t.createElement(L.Typography,{as:"h1",variant:"alpha"},ne({id:"Auth.form.welcome.title"}))),t.createElement(Z.Box,{paddingBottom:7},t.createElement(L.Typography,{variant:"epsilon",textColor:"neutral600"},ne({id:"Auth.login.sso.subtitle"})))),t.createElement(S.Stack,{spacing:7},_?t.createElement(x.Flex,{justifyContent:"center"},t.createElement(V.Loader,null,ne({id:"Auth.login.sso.loading"}))):t.createElement(k.Z,{providers:I}),t.createElement(x.Flex,null,t.createElement(H,null),t.createElement(Z.Box,{paddingLeft:3,paddingRight:3},t.createElement(L.Typography,{variant:"sigma",textColor:"neutral600"},ne({id:"or"}))),t.createElement(H,null)),t.createElement(te.Button,{fullWidth:!0,size:"L",onClick:B},ne({id:"Auth.form.button.login.strapi"})))),t.createElement(x.Flex,{justifyContent:"center"},t.createElement(Z.Box,{paddingTop:4},t.createElement(P.Link,{to:"/auth/forgot-password"},t.createElement(L.Typography,{variant:"pi"},ne({id:"Auth.link.forgot-password"})))))))};var se=e(78834),X=Object.defineProperty,me=Object.defineProperties,be=Object.getOwnPropertyDescriptors,je=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,Je=Object.prototype.propertyIsEnumerable,_e=(le,J,ne)=>J in le?X(le,J,{enumerable:!0,configurable:!0,writable:!0,value:ne}):le[J]=ne,pe=(le,J)=>{for(var ne in J||(J={}))u.call(J,ne)&&_e(le,ne,J[ne]);if(je)for(var ne of je(J))Je.call(J,ne)&&_e(le,ne,J[ne]);return le},ie=(le,J)=>me(le,be(J));const ke=ie(pe({},se.Z),{providers:{Component:g,endPoint:null,fieldsToDisable:[],fieldsToOmit:[],schema:null,inputsPrefix:""}})},99568:(ee,C,e)=>{"use strict";e.d(C,{Z:()=>c});const c={settings:{sso:{main:[{action:"admin::provider-login.read",subject:null}],read:[{action:"admin::provider-login.read",subject:null}],update:[{action:"admin::provider-login.update",subject:null}]}}}},48224:(ee,C,e)=>{var t={"./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],"./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 c(a){if(!e.o(t,a))return Promise.resolve().then(()=>{var S=new Error("Cannot find module '"+a+"'");throw S.code="MODULE_NOT_FOUND",S});var P=t[a],M=P[0];return e.e(P[1]).then(()=>e.t(M,19))}c.keys=()=>Object.keys(t),c.id=48224,ee.exports=c}}]);
|