PageSourceSearch

https://de.serlo.org/_next/static/chunks/pages/page/create-315f8aaaa6b62900.js

js serlo.org collected 2026-09-24 17:43:40 UTC 9,391 bytes, 2 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[180],{1480:function(t,e,n){"use strict";var r=n(32408);e.DF={prefix:r.prefix,iconName:r.iconName,icon:[r.width,r.height,r.aliases,r.unicode,r.svgPathData]},e.e7=e.DF,r.prefix,r.iconName,r.width,r.height,r.aliases,r.unicode,r.svgPathData,r.aliases},65983:function(t,e,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/page/create",function(){return n(2098)}])},55436:function(t,e,n){"use strict";n.r(e),n.d(e,{fetchAndPersistAuthSession:function(){return o}});var r=n(88507),i=n(99674);async function o(t,e){try{let n=void 0===e?(await i.A.toSession()).data:e;return r.D.set(n),t&&t(n),n}catch(e){return r.D.remove(),t&&t(null),null}}},99674:function(t,e,n){"use strict";n.d(e,{A:function(){return s}});var r=n(68962),i=n(35474);let o=new r.V({basePath:"/api/.ory"}),s=new i.eR(o)},50448:function(t,e,n){"use strict";n.d(e,{x:function(){return f}});var r=n(52322),i=n(2784),o=n(67063),s=n(22435),a=n(50079),u=n(31668);function c(t){let{error:e}=t,{strings:n}=(0,u.xN)();return console.error(e),(0,r.jsxs)("p",{className:"serlo-p mt-12 text-brand",children:[(0,r.jsx)(a.J,{icon:s.RL})," ",n.loading.unknownProblem]})}var l=n(51515),d=n(72329);function f(t){let{children:e,data:n,error:s,needsAuth:a}=t,u=(0,o.J)(),[f,m]=(0,i.useState)(!1);return((0,i.useEffect)(()=>{a&&m(!0)},[a]),a&&!f)?null:a&&null===u?(0,r.jsx)(d.I,{}):n||s?s?(0,r.jsx)(c,{error:JSON.stringify(s)}):n&&e?(0,r.jsx)(r.Fragment,{children:e}):null:(0,r.jsx)(l.T,{noText:!0})}},19812:function(t,e,n){"use strict";n.d(e,{c:function(){return l}});var r=n(52322),i=n(97729),o=n.n(i),s=n(5632),a=n(31668),u=n(59540),c=n(88520);function l(t){let{data:e,breadcrumbsData:n,noIndex:i}=t,{title:l,contentType:d,metaDescription:f,metaImage:m,canonicalUrl:p}=e,{strings:x,lang:g}=(0,a.xN)(),h=(0,s.useRouter)(),y=null!=p?p:"https://".concat(g,".serlo.org")+h.asPath.split("?")[0];return(0,r.jsxs)(o(),{children:[(0,r.jsx)("title",{children:l}),(0,r.jsx)("link",{rel:"canonical",href:y}),d&&(0,r.jsx)("meta",{name:"content_type",content:d}),f&&(0,r.jsx)("meta",{name:"description",content:f}),(0,r.jsx)("meta",{property:"og:site_name",content:"serlo.org"}),(0,r.jsx)("meta",{property:"og:type",content:"website"}),(0,r.jsx)("meta",{property:"og:title",content:l}),(0,r.jsx)("meta",{property:"og:url",content:y}),(0,r.jsx)("meta",{property:"og:description",content:null!=f?f:x.header.slogan}),function(){let t=null==n?void 0:n.filter(t=>t.id===u.Z);return i||t&&t.length>0||e.title.startsWith("Testbereich")?(0,r.jsx)("meta",{name:"robots",content:"noindex"}):null}(),(0,r.jsx)("meta",{property:"og:image",name:"image",content:m||"https://".concat(g,".").concat(c.b,"/_assets/img/meta/serlo.png")}),(0,r.jsx)("meta",{property:"og:image:width",content:"1200"}),(0,r.jsx)("meta",{property:"og:image:height",content:"630"})]})}},71828:function(t,e,n){"use strict";n.d(e,{W:function(){return J}});var r=n(52322),i=n(1480),o=n(2784),s=n(58885),a=n(30675),u=n(19812),c=n(65183),l=n(51515),d=n(38719),f=n(55436),m=n(67063),p=n(31668),x=n(9063),g=n(59540),h=n(38231),y=n(94671),v=n(63830),j=n(5632),w=n(73235),b=n(2409);function P(){let t=(0,w._)(["\n  mutation setAbstractEntity($input: SetAbstractEntityInput!) {\n    entity {\n      setAbstractEntity(input: $input) {\n        __typename\n        success\n        record {\n          id\n        }\n      }\n    }\n  }\n"]);return P=function(){return t},t}let T=(0,b.Ps)(P());var _=n(62378),I=n(22428),N=n(6117),A=n(95529),E=n(85566),O=n(63092);function k(t,e,n){if(!n||!n.trim()){let n="".concat(t.errors.valueMissing,' ("').concat(e,'")');throw(0,v.U)(n,"warning"),Error(n)}return n}var S=n(84185),D=n(98041);function C(){let t=(0,w._)(["\n  mutation taxonomyTermSetNameAndDescription(\n    $input: TaxonomyTermSetNameAndDescriptionInput!\n  ) {\n    taxonomyTerm {\n      setNameAndDescription(input: $input) {\n        success\n      }\n    }\n  }\n"]);return C=function(){return t},t}function L(){let t=(0,w._)(["\n  mutation taxonomyCreate($input: TaxonomyTermCreateInput!) {\n    taxonomyTerm {\n      create(input: $input) {\n        success\n      }\n    }\n  }\n"]);return L=function(){return t},t}let R=(0,b.Ps)(C()),F=(0,b.Ps)(L());var $=n(85941);function J(t){let{initialState:e,type:n,id:w,taxonomyParentId:b,breadcrumbsData:P}
1=t,{strings:C}=(0,p.xN)(),L=(0,m.J)(),J=!!(P&&P.some(t=>t.id===g.Z)),U=function(){let t=(0,A.t)(),e=(0,I.K)(),n=(0,j.useRouter)(),r=(0,o.useContext)(N.Dz),i=null==r?void 0:r.entityId,s=null==r?void 0:r.metaTitle,a=null==r?void 0:r.metaDescription;if(!t)return!1;let u=t.strings.mutations;return async(t,r)=>{return await o({data:t,taxonomyParentId:r});async function o(t){let r,{data:o,taxonomyParentId:c}=t;if(!o.__typename)return console.error("no typename"),!1;if(!i)return console.error("no entityId"),!1;let l=await (0,_.A)(i),d={};try{let t=function(t,e){let{__typename:n,changes:r,content:i}=e;if(!n)return;let o=n===x.fO.Page?"Page":k(t,"changes",r);return{entityType:n,changes:o,content:k(t,"content",i),needsReview:!0,subscribeThis:!0,subscribeThisByEmail:!1}}(u,o);if(!t)return console.error("no generic input data"),!1;let e=function(t,e){let{title:n,url:r,content:i,description:o}=e;switch(e.__typename){case x.fO.Course:case x.fO.Article:case x.fO.Event:case x.fO.Page:return{title:k(t,"title",n)};case x.fO.Exercise:case x.fO.ExerciseGroup:break;case x.fO.Video:return{title:k(t,"title",n),url:k(t,"url",i),content:k(t,"content",o)};case x.fO.Applet:return{title:k(t,"title",n),url:k(t,"url",r)}}return{}}(u,o);d={entityId:c?null:i,...t,...e,metaTitle:s,metaDescription:a,parentId:t.entityId?void 0:c}}catch(t){return console.error("error collecting data, probably missing value?",t),!1}try{if(r=await e(T,d),!Number.isInteger(r))return console.error("no valid savedId returned"),!1}catch(t){return console.error("error saving main uuid",t),!1}(0,v.U)(u.success.saveNeedsReview,"success",7e3);let f=0===r?void 0:r,m=c?f:i||f,p=m?(0,E.e)(m):"/".concat(c);return l&&await (0,_.t)(l),setTimeout(()=>n.push(p+O.z),200),!0}}}(),V=function(){let t=(0,A.t)(),e=(0,I.K)(),n=(0,S.X)(),r=(0,j.useRouter)(),i=(0,o.useContext)(N.Dz),s=null==i?void 0:i.entityId;return async i=>{if(!t)return(0,v.U)("Please make sure you are logged in!","warning"),!1;let o=t.strings.mutations;try{let t={id:s,name:k(o,"name",i.term.name),description:k(o,"description",i.description)},[,,,,a,u]=r.asPath.split("/"),c=s?await e(R,t):await e(F,{...t,parentId:parseInt(u),taxonomyType:function(t){if(!t||!parseInt(t))throw Error("invalid url -> unknown taxonomy type");let e=parseInt(t);if([4,16,33,42,48,53].includes(e))return D.Q2.Topic;if([9,19,36,45,51,56].includes(e))return D.Q2.ExerciseFolder;throw Error("unknown taxonomy type")}(a)});return n({success:c,toastKey:"save",redirectUrl:"/".concat(null!=s?s:u)})}catch(t){return console.error(t,"probably missing value?"),!1}}}(),[z,K]=(0,o.useState)(void 0),Q=n===x.fO.Page;if((0,o.useEffect)(()=>{(async function(){await (0,f.fetchAndPersistAuthSession)(),K(!y.y||null!==L)})(),void 0===z||L||(0,v.U)(C.notices.warningLoggedOut,"warning",18e3)},[L,C]),!U||!w&&!Q&&!b)return null;if(void 0===z)return(0,r.jsx)(l.T,{noText:!0});if(!1===z)return(0,r.jsxs)(c.V,{icon:i.e7,type:"failure",children:["Sorry, Something is wrong!",(0,r.jsx)("br",{}),"Please: Logout and Login again and try to edit again.",(0,r.jsx)("br",{}),(0,r.jsx)("br",{})," If that does not work head to"," ",(0,r.jsx)(a.r,{href:s.x4,children:s.x4})," and make sure you are logged in there."]});let W=async t=>{if(n===x.fO.TaxonomyTerm)return await V(t)?Promise.resolve():Promise.reject();let e={__typename:n,...t};return await U(e,b)?Promise.resolve():Promise.reject()},X=(0,h.g)(C,n),Z="".concat(C.editOrAdd.button," | ").concat(X).concat(w?" (".concat(w,")"):"");return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(u.c,{data:{title:Z}}),function(){if(!P)return null;let t={label:C.revisions.toContent,url:"/".concat(null!=w?w:b)};return(0,r.jsx)(d.O,{data:[...P,t]})}(),(0,r.jsx)($.R,{onSave:W,isInTestArea:J,initialState:e})]})}},72329:function(t,e,n){"use strict";n.d(e,{I:function(){return s}});var r=n(52322),i=n(30675),o=n(31668);function s(t){let{noWrapper:e}=t,{strings:n}=(0,o.xN)();if(e)return s();return(0,r.jsx)("p",{className:"serlo-p",children:s()});function s(){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.r,{href:"/auth/login",children:n.auth.pleaseLogInLink})," ",n.auth.pleaseLogInText]})}}},59540:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=106082},85566:function(t,e,n){"use strict";function r(t){return"/entity/repository/history/".concat(t)}n.d(e,{e:function(){return r}})},2098:function(t,e,n){"use strict";n.r(e);var r=n(52322),i=n(8767),o=n(88255),s=n(23306),a=n(50448),u=n(94626),c=n(71828),l=n(9063),d=n(94671),f=n(53972);e.default=(0,f.Q)(()=>{let t={initialState:{...(0,i.J)("serlo-org"),document:{plugin:o.k.Page}},type:l.fO.Page,errorType:"none"};return(0,r.jsx)(s.V,{noContainers:!0,noIndex:!0,loadLoggedInData:!d.y,children:(0,r.jsx)("div",{className:"relative",children:(0,r.jsx)(u.P,{children:(0,r.jsx)("main",{children:(0,r.jsx)(a.x,{needsAuth:!!d.y||void 0,data:!0,children:(0,r.jsx)(c.W,{...t})})})})})})})}},function(t){t.O(0,[4786,5089,1364,2941,2409,8870,4233,965,7899,5257,8834,9989,8384,3306,9692,440,2944,6179,2888,9774,179],function(){return t(t.s=65983)}),_N_E=t.O()}]);
2//# sourceMappingURL=create-315f8aaaa6b62900.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.