PageSourceSearch

https://de.serlo-staging.dev/_next/static/chunks/pages/entity/create/[type]/[taxonomyId]-b0666057b6ac6ad7.js

js serlo-staging.dev collected 2026-09-25 22:45:58 UTC 10,290 bytes, 2 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6757],{1480:function(e,t,n){"use strict";var r=n(32408);t.DF={prefix:r.prefix,iconName:r.iconName,icon:[r.width,r.height,r.aliases,r.unicode,r.svgPathData]},t.e7=t.DF,r.prefix,r.iconName,r.width,r.height,r.aliases,r.unicode,r.svgPathData,r.aliases},9918:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/entity/create/[type]/[taxonomyId]",function(){return n(63689)}])},55436:function(e,t,n){"use strict";n.r(t),n.d(t,{fetchAndPersistAuthSession:function(){return o}});var r=n(88507),i=n(99674);async function o(e,t){try{let n=void 0===t?(await i.A.toSession()).data:t;return r.D.set(n),e&&e(n),n}catch(t){return r.D.remove(),e&&e(null),null}}},99674:function(e,t,n){"use strict";n.d(t,{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(e,t,n){"use strict";n.d(t,{x:function(){return p}});var r=n(52322),i=n(2784),o=n(67063),s=n(22435),a=n(50079),u=n(31668);function c(e){let{error:t}=e,{strings:n}=(0,u.xN)();return console.error(t),(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 p(e){let{children:t,data:n,error:s,needsAuth:a}=e,u=(0,o.J)(),[p,f]=(0,i.useState)(!1);return((0,i.useEffect)(()=>{a&&f(!0)},[a]),a&&!p)?null:a&&null===u?(0,r.jsx)(d.I,{}):n||s?s?(0,r.jsx)(c,{error:JSON.stringify(s)}):n&&t?(0,r.jsx)(r.Fragment,{children:t}):null:(0,r.jsx)(l.T,{noText:!0})}},19812:function(e,t,n){"use strict";n.d(t,{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(e){let{data:t,breadcrumbsData:n,noIndex:i}=e,{title:l,contentType:d,metaDescription:p,metaImage:f,canonicalUrl:m}=t,{strings:x,lang:y}=(0,a.xN)(),g=(0,s.useRouter)(),h=null!=m?m:"https://".concat(y,".serlo.org")+g.asPath.split("?")[0];return(0,r.jsxs)(o(),{children:[(0,r.jsx)("title",{children:l}),(0,r.jsx)("link",{rel:"canonical",href:h}),d&&(0,r.jsx)("meta",{name:"content_type",content:d}),p&&(0,r.jsx)("meta",{name:"description",content:p}),(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:h}),(0,r.jsx)("meta",{property:"og:description",content:null!=p?p:x.header.slogan}),function(){let e=null==n?void 0:n.filter(e=>e.id===u.Z);return i||e&&e.length>0||t.title.startsWith("Testbereich")?(0,r.jsx)("meta",{name:"robots",content:"noindex"}):null}(),(0,r.jsx)("meta",{property:"og:image",name:"image",content:f||"https://".concat(y,".").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(e,t,n){"use strict";n.d(t,{W:function(){return F}});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),p=n(55436),f=n(67063),m=n(31668),x=n(9063),y=n(59540),g=n(38231),h=n(94671),v=n(63830),j=n(5632),w=n(73235),T=n(2409);function _(){let e=(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 _=function(){return e},e}let E=(0,T.Ps)(_());var b=n(62378),I=n(22428),P=n(6117),A=n(95529),N=n(85566),k=n(63092);function O(e,t,n){if(!n||!n.trim()){let n="".concat(e.errors.valueMissing,' ("').concat(t,'")');throw(0,v.U)(n,"warning"),Error(n)}return n}var S=n(84185),D=n(98041);function C(){let e=(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 e},e}function R(){let e=(0,w._)(["\n  mutation taxonomyCreate($input: TaxonomyTermCreateInput!) {\n    taxonomyTerm {\n      create(input: $input) {\n        success\n      }\n    }\n  }\n"]);return R=function(){return e},e}let L=(0,T.Ps)(C()),$=(0,T.Ps)(R());var V=n(85941);function F(e){let{initialState:t,type:n,id:w,taxonomyParentId:T,breadcrumbsData:_}=e,{strings:C}=(0,m.xN)(),R=(0,f.J)(),F=!!(_&&_.some(e=>e.id===y.Z)),U=function(){let e=(0,A.t)(),t=(0,I.K)(),n=(0,j.useRouter)(),r=(0,o.useContext)(P.Dz),i=null==r?void 0:r.entityId,s=null==r?void 0:r.metaTitle,a=null==r?void 0:r.metaDescription;if(!e)return!1;let u=e.strings.mutations;return async(e,r)=>{return await o({data:e,taxonomyParentId:r});async function o(e){let r,{data:o,taxonomyParentId:c}=e;if(!o.__typename)return console.error("no typename"),!1;if(!i)return console.error("no entityId"),!1;let l=await (0,b.A)(i),d={};try{let e=function(e,t){let{__typename:n,changes:r,content:i}=t;if(!n)return;let o=n===x.fO.Page?"Page":O(e,"changes",r);return{entityType:n,changes:o,content:O(e,"content",i),needsReview:!0,subscribeThis:!0,subscribeThisByEmail
1:!1}}(u,o);if(!e)return console.error("no generic input data"),!1;let t=function(e,t){let{title:n,url:r,content:i,description:o}=t;switch(t.__typename){case x.fO.Course:case x.fO.Article:case x.fO.Event:case x.fO.Page:return{title:O(e,"title",n)};case x.fO.Exercise:case x.fO.ExerciseGroup:break;case x.fO.Video:return{title:O(e,"title",n),url:O(e,"url",i),content:O(e,"content",o)};case x.fO.Applet:return{title:O(e,"title",n),url:O(e,"url",r)}}return{}}(u,o);d={entityId:c?null:i,...e,...t,metaTitle:s,metaDescription:a,parentId:e.entityId?void 0:c}}catch(e){return console.error("error collecting data, probably missing value?",e),!1}try{if(r=await t(E,d),!Number.isInteger(r))return console.error("no valid savedId returned"),!1}catch(e){return console.error("error saving main uuid",e),!1}(0,v.U)(u.success.saveNeedsReview,"success",7e3);let p=0===r?void 0:r,f=c?p:i||p,m=f?(0,N.e)(f):"/".concat(c);return l&&await (0,b.t)(l),setTimeout(()=>n.push(m+k.z),200),!0}}}(),G=function(){let e=(0,A.t)(),t=(0,I.K)(),n=(0,S.X)(),r=(0,j.useRouter)(),i=(0,o.useContext)(P.Dz),s=null==i?void 0:i.entityId;return async i=>{if(!e)return(0,v.U)("Please make sure you are logged in!","warning"),!1;let o=e.strings.mutations;try{let e={id:s,name:O(o,"name",i.term.name),description:O(o,"description",i.description)},[,,,,a,u]=r.asPath.split("/"),c=s?await t(L,e):await t($,{...e,parentId:parseInt(u),taxonomyType:function(e){if(!e||!parseInt(e))throw Error("invalid url -> unknown taxonomy type");let t=parseInt(e);if([4,16,33,42,48,53].includes(t))return D.Q2.Topic;if([9,19,36,45,51,56].includes(t))return D.Q2.ExerciseFolder;throw Error("unknown taxonomy type")}(a)});return n({success:c,toastKey:"save",redirectUrl:"/".concat(null!=s?s:u)})}catch(e){return console.error(e,"probably missing value?"),!1}}}(),[J,Q]=(0,o.useState)(void 0),z=n===x.fO.Page;if((0,o.useEffect)(()=>{(async function(){await (0,p.fetchAndPersistAuthSession)(),Q(!h.y||null!==R)})(),void 0===J||R||(0,v.U)(C.notices.warningLoggedOut,"warning",18e3)},[R,C]),!U||!w&&!z&&!T)return null;if(void 0===J)return(0,r.jsx)(l.T,{noText:!0});if(!1===J)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 K=async e=>{if(n===x.fO.TaxonomyTerm)return await G(e)?Promise.resolve():Promise.reject();let t={__typename:n,...e};return await U(t,T)?Promise.resolve():Promise.reject()},W=(0,g.g)(C,n),X="".concat(C.editOrAdd.button," | ").concat(W).concat(w?" (".concat(w,")"):"");return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(u.c,{data:{title:X}}),function(){if(!_)return null;let e={label:C.revisions.toContent,url:"/".concat(null!=w?w:T)};return(0,r.jsx)(d.O,{data:[..._,e]})}(),(0,r.jsx)(V.R,{onSave:K,isInTestArea:F,initialState:t})]})}},72329:function(e,t,n){"use strict";n.d(t,{I:function(){return s}});var r=n(52322),i=n(30675),o=n(31668);function s(e){let{noWrapper:t}=e,{strings:n}=(0,o.xN)();if(t)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(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=106082},85566:function(e,t,n){"use strict";function r(e){return"/entity/repository/history/".concat(e)}n.d(t,{e:function(){return r}})},63689:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSG:function(){return v},getTaxonomyTypeQuery:function(){return w}});var r,i,o=n(73235),s=n(52322),a=n(88255),u=n(8767),c=n(2409),l=n(23306),d=n(50448),p=n(94626),f=n(71828),m=n(9063),x=n(96198),y=n(94671),g=n(53972);function h(){let e=(0,o._)(["\n  query getTaxonomyType($id: Int!) {\n    uuid(id: $id) {\n      ... on TaxonomyTerm {\n        id\n        alias\n        title\n        instance\n        type\n        ...pathToRoot\n      }\n    }\n  }\n  ","\n"]);return h=function(){return e},e}(r=i||(i={}))[r.Article=a.k.Article]="Article",r[r.Course=a.k.Course]="Course",r[r.Video=a.k.Video]="Video",r[r.Applet=a.k.Applet]="Applet",r[r.Event=a.k.Event]="Event",r[r.Exercise=a.k.TextExercise]="Exercise",r[r.ExerciseGroup=a.k.TextExerciseGroup]="ExerciseGroup";var v=!0;function j(e){let{props:{taxonomyTerm:t,entityType:n,breadcrumbsData:r}}=e,o={...(0,u.J)("serlo-org"),document:{plugin:i[n]}},{id:a}=t,c={initialState:o,type:m.fO[n],breadcrumbsData:r,taxonomyParentId:a,errorType:"none"};return(0,s.jsx)(l.V,{noContainers:!0,noIndex:!0,loadLoggedInData:!y.y,serloEntityData:{entityId:a},children:(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(p.P,{children:(0,s.jsx)("main",{children:(0,s.jsx)(d.x,{needsAuth:!!y.y||void 0,data:!0,children:(0,s.jsx)(f.W,{...c})})})})," "]})})}t.default=(0,g.Q)(e=>(0,s.jsx)(j,{props:e}));let w=(0,c.Ps)(h(),x.YU)}},function(e){e.O(0,[4786,5089,4856,6760,2941,2409,8870,4233,2627,3998,8834,9989,8384,3306,9692,440,2944,6179,2888,9774,179],function(){return e(e.s=9918)}),_N_E=e.O()}]);
2//# sourceMappingURL=[taxonomyId]-b0666057b6ac6ad7.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.