diff --git a/CTFd/api/v1/scoreboard.py b/CTFd/api/v1/scoreboard.py index 94efdd7b13e31645383ebec738e01822a0087d09..18537e90b4ba248949a23f0d918c86c340de8166 100644 --- a/CTFd/api/v1/scoreboard.py +++ b/CTFd/api/v1/scoreboard.py @@ -78,7 +78,7 @@ class ScoreboardList(Resource): fails = Fails.query.filter(Fails.account_id.in_(team_ids)) for fail in fails: challenge = Challenges.query.filter_by(id=fail.challenge_id).first_or_404() - if challenge.type == "manual" or challenge.type == "manualRecursive": + if challenge.type == "manual" or challenge.type == "manualRecursive" or challenge.type == "flash": potentialScore += challenge.value entry = { diff --git a/CTFd/api/v1/submissions.py b/CTFd/api/v1/submissions.py index 41879b7f51df87f9dfc54999328a3941398f4564..25d8f0f9290bca2f0d34c8555a6cf1ed2c64a8c2 100644 --- a/CTFd/api/v1/submissions.py +++ b/CTFd/api/v1/submissions.py @@ -196,8 +196,9 @@ class Submission(Resource): req = request.get_json() submission_type = req.get("type") - - + + print("\n\nsubmissions/patch...") + print(submission) if submission_type == "correct": solve = Solves( user_id=submission.user_id, diff --git a/CTFd/models/__init__.py b/CTFd/models/__init__.py index 50278bc4fcc93e772cd83fd83db537204ae3f479..c9dd1c4aa228dd3356e5a6c9a70283fbcde33eee 100644 --- a/CTFd/models/__init__.py +++ b/CTFd/models/__init__.py @@ -929,6 +929,7 @@ class Solves(Submissions): Submissions.team_id, ) + user = db.relationship("Users", foreign_keys="Solves.user_id", lazy="select") team = db.relationship("Teams", foreign_keys="Solves.team_id", lazy="select") challenge = db.relationship( diff --git a/CTFd/themes/admin/package-lock.json b/CTFd/themes/admin/package-lock.json index 3eb51e3399e702a3f28185c87770edab62d2c544..cdcf36d27a340a1ca3355e9002c3a54dee9856a3 100644 --- a/CTFd/themes/admin/package-lock.json +++ b/CTFd/themes/admin/package-lock.json @@ -2606,6 +2606,7 @@ "resolved": "https://registry.npmjs.org/vite/-/vite-3.2.11.tgz", "integrity": "sha512-K/jGKL/PgbIgKCiJo5QbASQhFiV02X9Jh+Qq0AKCRCRKZtOTVi4t6wh75FDpGf2N9rYOnzH87OEFQNaFy6pdxQ==", "dev": true, + "license": "MIT", "dependencies": { "esbuild": "^0.15.9", "postcss": "^8.4.18", diff --git a/CTFd/themes/admin/static/assets/CommentBox.a3989c28.js b/CTFd/themes/admin/static/assets/CommentBox.d3cef9cd.js similarity index 98% rename from CTFd/themes/admin/static/assets/CommentBox.a3989c28.js rename to CTFd/themes/admin/static/assets/CommentBox.d3cef9cd.js index 28d46112c8cbfbb26097142079c0d54f08c65f67..a005fb590657089294537bff2c1a5c02ac827634 100644 --- a/CTFd/themes/admin/static/assets/CommentBox.a3989c28.js +++ b/CTFd/themes/admin/static/assets/CommentBox.d3cef9cd.js @@ -1 +1 @@ -import{_ as r,C as u,J as h,u as m,K as p,c as l,a as e,h as _,m as g,t as a,b as c,f as b,g as v,T as f,o as d,F as C,r as y,p as k,l as x}from"./pages/main.9f35ed12.js";const $={props:{type:String,id:Number},data:function(){return{page:1,pages:null,next:null,prev:null,total:null,comment:"",comments:[],urlRoot:u.config.urlRoot}},methods:{toLocalTime(t){return h(t).format("MMMM Do, h:mm:ss A")},nextPage:function(){this.page++,this.loadComments()},prevPage:function(){this.page--,this.loadComments()},getArgs:function(){let t={};return t[`${this.$props.type}_id`]=this.$props.id,t},loadComments:function(){let t=this.getArgs();t.page=this.page,t.per_page=10,m.comments.get_comments(t).then(s=>(this.page=s.meta.pagination.page,this.pages=s.meta.pagination.pages,this.next=s.meta.pagination.next,this.prev=s.meta.pagination.prev,this.total=s.meta.pagination.total,this.comments=s.data,this.comments))},submitComment:function(){let t=this.comment.trim();t.length>0&&m.comments.add_comment(t,this.$props.type,this.getArgs(),()=>{this.loadComments()}),this.comment=""},deleteComment:function(t){confirm("Are you sure you'd like to delete this comment?")&&m.comments.delete_comment(t).then(s=>{if(s.success===!0)for(let i=this.comments.length-1;i>=0;--i)this.comments[i].id==t&&this.comments.splice(i,1)})}},created(){this.loadComments()},updated(){this.$el.querySelectorAll("pre code").forEach(t=>{p.highlightBlock(t)})}},A=t=>(k("data-v-53a121d7"),t=t(),x(),t),P={class:"row mb-3"},T={class:"col-md-12"},w={class:"comment"},M={key:0,class:"row"},S={class:"col-md-12"},B={class:"text-center"},L=["disabled"],N=["disabled"],V={class:"col-md-12"},D={class:"text-center"},F={class:"text-muted"},H={class:"comments"},I={class:"card-body pl-0 pb-0 pt-2 pr-2"},R=["onClick"],j=A(()=>e("span",{"aria-hidden":"true"},"\xD7",-1)),E=[j],J={class:"card-body"},q=["innerHTML"],z={class:"text-muted float-left"},G=["href"],K={class:"text-muted float-right"},U={class:"float-right"},O={key:1,class:"row"},Q={class:"col-md-12"},W={class:"text-center"},X=["disabled"],Y=["disabled"],Z={class:"col-md-12"},tt={class:"text-center"},et={class:"text-muted"};function st(t,s,i,ot,nt,n){return d(),l("div",null,[e("div",P,[e("div",T,[e("div",w,[_(e("textarea",{class:"form-control mb-2",rows:"2",id:"comment-input",placeholder:"Ajouter un commentaire","onUpdate:modelValue":s[0]||(s[0]=o=>t.comment=o)},null,512),[[g,t.comment,void 0,{lazy:!0}]]),e("button",{class:"btn btn-sm btn-primary btn-outlined float-right",type:"submit",onClick:s[1]||(s[1]=o=>n.submitComment())}," Comment ")])])]),t.pages>1?(d(),l("div",M,[e("div",S,[e("div",B,[e("button",{type:"button",class:"btn btn-link p-0",onClick:s[2]||(s[2]=o=>n.prevPage()),disabled:!t.prev}," <<< ",8,L),e("button",{type:"button",class:"btn btn-link p-0",onClick:s[3]||(s[3]=o=>n.nextPage()),disabled:!t.next}," >>> ",8,N)])]),e("div",V,[e("div",D,[e("small",F,"Page "+a(t.page)+" de "+a(t.total)+" comments",1)])])])):c("",!0),e("div",H,[b(f,{name:"comment-card"},{default:v(()=>[(d(!0),l(C,null,y(t.comments,o=>(d(),l("div",{class:"comment-card card mb-2",key:o.id},[e("div",I,[e("button",{type:"button",class:"close float-right","aria-label":"Close",onClick:at=>n.deleteComment(o.id)},E,8,R)]),e("div",J,[e("div",{class:"card-text",innerHTML:o.html},null,8,q),e("small",z,[e("span",null,[e("a",{href:`${t.urlRoot}/admin/users/${o.author_id}`},a(o.author.name),9,G)])]),e("small",K,[e("span",U,a(n.toLocalTime(o.date)),1)])])]))),128))]),_:1})]),t.pages>1?(d(),l("div",O,[e("div",Q,[e("div",W,[e("button",{type:"button",class:"btn btn-link p-0",onClick:s[4]||(s[4]=o=>n.prevPage()),disabled:!t.prev}," <<< ",8,X),e("button",{type:"button",class:"btn btn-link p-0",onClick:s[5]||(s[5]=o=>n.nextPage()),disabled:!t.next}," >>> ",8,Y)])]),e("div",Z,[e("div",tt,[e("small",et,"Page "+a(t.page)+" de "+a(t.total)+" comments",1)])])])):c("",!0)])}const lt=r($,[["render",st],["__scopeId","data-v-53a121d7"]]);export{lt as C}; +import{_ as r,C as u,J as h,u as m,K as p,c as l,a as e,h as _,m as g,t as a,b as c,f as b,g as v,T as f,o as d,F as C,r as y,p as k,l as x}from"./pages/main.b0151f5b.js";const $={props:{type:String,id:Number},data:function(){return{page:1,pages:null,next:null,prev:null,total:null,comment:"",comments:[],urlRoot:u.config.urlRoot}},methods:{toLocalTime(t){return h(t).format("MMMM Do, h:mm:ss A")},nextPage:function(){this.page++,this.loadComments()},prevPage:function(){this.page--,this.loadComments()},getArgs:function(){let t={};return t[`${this.$props.type}_id`]=this.$props.id,t},loadComments:function(){let t=this.getArgs();t.page=this.page,t.per_page=10,m.comments.get_comments(t).then(s=>(this.page=s.meta.pagination.page,this.pages=s.meta.pagination.pages,this.next=s.meta.pagination.next,this.prev=s.meta.pagination.prev,this.total=s.meta.pagination.total,this.comments=s.data,this.comments))},submitComment:function(){let t=this.comment.trim();t.length>0&&m.comments.add_comment(t,this.$props.type,this.getArgs(),()=>{this.loadComments()}),this.comment=""},deleteComment:function(t){confirm("Are you sure you'd like to delete this comment?")&&m.comments.delete_comment(t).then(s=>{if(s.success===!0)for(let i=this.comments.length-1;i>=0;--i)this.comments[i].id==t&&this.comments.splice(i,1)})}},created(){this.loadComments()},updated(){this.$el.querySelectorAll("pre code").forEach(t=>{p.highlightBlock(t)})}},A=t=>(k("data-v-53a121d7"),t=t(),x(),t),P={class:"row mb-3"},T={class:"col-md-12"},w={class:"comment"},M={key:0,class:"row"},S={class:"col-md-12"},B={class:"text-center"},L=["disabled"],N=["disabled"],V={class:"col-md-12"},D={class:"text-center"},F={class:"text-muted"},H={class:"comments"},I={class:"card-body pl-0 pb-0 pt-2 pr-2"},R=["onClick"],j=A(()=>e("span",{"aria-hidden":"true"},"\xD7",-1)),E=[j],J={class:"card-body"},q=["innerHTML"],z={class:"text-muted float-left"},G=["href"],K={class:"text-muted float-right"},U={class:"float-right"},O={key:1,class:"row"},Q={class:"col-md-12"},W={class:"text-center"},X=["disabled"],Y=["disabled"],Z={class:"col-md-12"},tt={class:"text-center"},et={class:"text-muted"};function st(t,s,i,ot,nt,n){return d(),l("div",null,[e("div",P,[e("div",T,[e("div",w,[_(e("textarea",{class:"form-control mb-2",rows:"2",id:"comment-input",placeholder:"Ajouter un commentaire","onUpdate:modelValue":s[0]||(s[0]=o=>t.comment=o)},null,512),[[g,t.comment,void 0,{lazy:!0}]]),e("button",{class:"btn btn-sm btn-primary btn-outlined float-right",type:"submit",onClick:s[1]||(s[1]=o=>n.submitComment())}," Comment ")])])]),t.pages>1?(d(),l("div",M,[e("div",S,[e("div",B,[e("button",{type:"button",class:"btn btn-link p-0",onClick:s[2]||(s[2]=o=>n.prevPage()),disabled:!t.prev}," <<< ",8,L),e("button",{type:"button",class:"btn btn-link p-0",onClick:s[3]||(s[3]=o=>n.nextPage()),disabled:!t.next}," >>> ",8,N)])]),e("div",V,[e("div",D,[e("small",F,"Page "+a(t.page)+" de "+a(t.total)+" comments",1)])])])):c("",!0),e("div",H,[b(f,{name:"comment-card"},{default:v(()=>[(d(!0),l(C,null,y(t.comments,o=>(d(),l("div",{class:"comment-card card mb-2",key:o.id},[e("div",I,[e("button",{type:"button",class:"close float-right","aria-label":"Close",onClick:at=>n.deleteComment(o.id)},E,8,R)]),e("div",J,[e("div",{class:"card-text",innerHTML:o.html},null,8,q),e("small",z,[e("span",null,[e("a",{href:`${t.urlRoot}/admin/users/${o.author_id}`},a(o.author.name),9,G)])]),e("small",K,[e("span",U,a(n.toLocalTime(o.date)),1)])])]))),128))]),_:1})]),t.pages>1?(d(),l("div",O,[e("div",Q,[e("div",W,[e("button",{type:"button",class:"btn btn-link p-0",onClick:s[4]||(s[4]=o=>n.prevPage()),disabled:!t.prev}," <<< ",8,X),e("button",{type:"button",class:"btn btn-link p-0",onClick:s[5]||(s[5]=o=>n.nextPage()),disabled:!t.next}," >>> ",8,Y)])]),e("div",Z,[e("div",tt,[e("small",et,"Page "+a(t.page)+" de "+a(t.total)+" comments",1)])])])):c("",!0)])}const lt=r($,[["render",st],["__scopeId","data-v-53a121d7"]]);export{lt as C}; diff --git a/CTFd/themes/admin/static/assets/echarts.common.3389571d.js b/CTFd/themes/admin/static/assets/echarts.common.75806e9f.js similarity index 99% rename from CTFd/themes/admin/static/assets/echarts.common.3389571d.js rename to CTFd/themes/admin/static/assets/echarts.common.75806e9f.js index bb91494b721b4090ff231c025373f428a1776f95..7227872ab347376f2d0eeec8a5b6268fb50466ae 100644 --- a/CTFd/themes/admin/static/assets/echarts.common.3389571d.js +++ b/CTFd/themes/admin/static/assets/echarts.common.75806e9f.js @@ -1,4 +1,4 @@ -import{P as DB,I as dw}from"./pages/main.9f35ed12.js";var Dd={exports:{}};(function(IB,pw){(function(U,Ji){Ji(pw)})(dw,function(U){/*! ***************************************************************************** +import{P as DB,I as dw}from"./pages/main.b0151f5b.js";var Dd={exports:{}};(function(IB,pw){(function(U,Ji){Ji(pw)})(dw,function(U){/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any diff --git a/CTFd/themes/admin/static/assets/graphs.05e1bce6.js b/CTFd/themes/admin/static/assets/graphs.f4a6130f.js similarity index 96% rename from CTFd/themes/admin/static/assets/graphs.05e1bce6.js rename to CTFd/themes/admin/static/assets/graphs.f4a6130f.js index 68a09e7d1abed5d1fc598259931a226a911385d4..2424a5834cc07ec88a7a5b1a5f28fa89128753ef 100644 --- a/CTFd/themes/admin/static/assets/graphs.05e1bce6.js +++ b/CTFd/themes/admin/static/assets/graphs.f4a6130f.js @@ -1 +1 @@ -import{j as g,J as y,O as f}from"./pages/main.9f35ed12.js";import{e as h}from"./echarts.common.3389571d.js";function b(c){let i=c.concat();for(let a=0;a<c.length;a++)i[a]=c.slice(0,a+1).reduce(function(u,r){return u+r});return i}const m={score_graph:{format:(c,i,a,u,r)=>{let n={title:{left:"center",text:"Score dans le temps"},tooltip:{trigger:"axis",axisPointer:{type:"cross"}},legend:{type:"scroll",orient:"horizontal",align:"left",bottom:0,data:[a]},toolbox:{feature:{saveAsImage:{}}},grid:{containLabel:!0},xAxis:[{type:"category",boundaryGap:!1,data:[]}],yAxis:[{type:"value"}],dataZoom:[{id:"dataZoomX",type:"slider",xAxisIndex:[0],filterMode:"filter",height:20,top:35,fillerColor:"rgba(233, 236, 241, 0.4)"}],series:[]};const s=[],l=[],o=r[0].data,d=r[2].data,e=o.concat(d);e.sort((t,p)=>new Date(t.date)-new Date(p.date));for(let t=0;t<e.length;t++){const p=y(e[t].date);s.push(p.toDate());try{l.push(e[t].challenge.value)}catch{l.push(e[t].value)}}return s.forEach(t=>{n.xAxis[0].data.push(t)}),n.series.push({name:window.stats_data.name,type:"line",label:{normal:{show:!0,position:"top"}},areaStyle:{normal:{color:f(a+i)}},itemStyle:{normal:{color:f(a+i)}},data:b(l)}),n}},category_breakdown:{format:(c,i,a,u,r)=>{let n={title:{left:"center",text:"R\xE9partition des cat\xE9gories"},tooltip:{trigger:"item"},toolbox:{show:!0,feature:{saveAsImage:{}}},legend:{type:"scroll",orient:"vertical",top:"middle",right:0,data:[]},series:[{name:"R\xE9partition des cat\xE9gories",type:"pie",radius:["30%","50%"],avoidLabelOverlap:!1,label:{show:!1,position:"center"},itemStyle:{normal:{label:{show:!0,formatter:function(e){return`${e.percent}% (${e.value})`}},labelLine:{show:!0}},emphasis:{label:{show:!0,position:"center",textStyle:{fontSize:"14",fontWeight:"normal"}}}},emphasis:{label:{show:!0,fontSize:"30",fontWeight:"bold"}},labelLine:{show:!1},data:[]}]};const s=r[0].data,l=[];for(let e=0;e<s.length;e++)l.push(s[e].challenge.category);const o=l.filter((e,t)=>l.indexOf(e)==t),d=[];for(let e=0;e<o.length;e++){let t=0;for(let p=0;p<l.length;p++)l[p]==o[e]&&t++;d.push(t)}return o.forEach((e,t)=>{n.legend.data.push(e),n.series[0].data.push({value:d[t],name:e,itemStyle:{color:f(e)}})}),n}},solve_percentages:{format:(c,i,a,u,r)=>{const n=r[0].data.length,s=r[1].meta.count;return{title:{left:"center",text:"Pourcentage de r\xE9solution"},tooltip:{trigger:"item"},toolbox:{show:!0,feature:{saveAsImage:{}}},legend:{orient:"vertical",top:"middle",right:0,data:["Fails","Solves"]},series:[{name:"Pourcentage de r\xE9solution",type:"pie",radius:["30%","50%"],avoidLabelOverlap:!1,label:{show:!1,position:"center"},itemStyle:{normal:{label:{show:!0,formatter:function(o){return`${o.name} - ${o.value} (${o.percent}%)`}},labelLine:{show:!0}},emphasis:{label:{show:!0,position:"center",textStyle:{fontSize:"14",fontWeight:"normal"}}}},emphasis:{label:{show:!0,fontSize:"30",fontWeight:"bold"}},labelLine:{show:!1},data:[{value:s,name:"Fails",itemStyle:{color:"rgb(207, 38, 0)"}},{value:n,name:"Solves",itemStyle:{color:"rgb(0, 209, 64)"}}]}]}}}};function S(c,i,a,u,r,n,s){const l=m[c];let o=h.init(document.querySelector(i));o.setOption(l.format(u,r,n,s,a)),g(window).on("resize",function(){o!=null&&o!=null&&o.resize()})}function _(c,i,a,u,r,n,s){const l=m[c];h.init(document.querySelector(i)).setOption(l.format(u,r,n,s,a))}export{S as c,_ as u}; +import{j as g,J as y,O as f}from"./pages/main.b0151f5b.js";import{e as h}from"./echarts.common.75806e9f.js";function b(c){let i=c.concat();for(let a=0;a<c.length;a++)i[a]=c.slice(0,a+1).reduce(function(u,r){return u+r});return i}const m={score_graph:{format:(c,i,a,u,r)=>{let n={title:{left:"center",text:"Score dans le temps"},tooltip:{trigger:"axis",axisPointer:{type:"cross"}},legend:{type:"scroll",orient:"horizontal",align:"left",bottom:0,data:[a]},toolbox:{feature:{saveAsImage:{}}},grid:{containLabel:!0},xAxis:[{type:"category",boundaryGap:!1,data:[]}],yAxis:[{type:"value"}],dataZoom:[{id:"dataZoomX",type:"slider",xAxisIndex:[0],filterMode:"filter",height:20,top:35,fillerColor:"rgba(233, 236, 241, 0.4)"}],series:[]};const s=[],l=[],o=r[0].data,d=r[2].data,e=o.concat(d);e.sort((t,p)=>new Date(t.date)-new Date(p.date));for(let t=0;t<e.length;t++){const p=y(e[t].date);s.push(p.toDate());try{l.push(e[t].challenge.value)}catch{l.push(e[t].value)}}return s.forEach(t=>{n.xAxis[0].data.push(t)}),n.series.push({name:window.stats_data.name,type:"line",label:{normal:{show:!0,position:"top"}},areaStyle:{normal:{color:f(a+i)}},itemStyle:{normal:{color:f(a+i)}},data:b(l)}),n}},category_breakdown:{format:(c,i,a,u,r)=>{let n={title:{left:"center",text:"R\xE9partition des cat\xE9gories"},tooltip:{trigger:"item"},toolbox:{show:!0,feature:{saveAsImage:{}}},legend:{type:"scroll",orient:"vertical",top:"middle",right:0,data:[]},series:[{name:"R\xE9partition des cat\xE9gories",type:"pie",radius:["30%","50%"],avoidLabelOverlap:!1,label:{show:!1,position:"center"},itemStyle:{normal:{label:{show:!0,formatter:function(e){return`${e.percent}% (${e.value})`}},labelLine:{show:!0}},emphasis:{label:{show:!0,position:"center",textStyle:{fontSize:"14",fontWeight:"normal"}}}},emphasis:{label:{show:!0,fontSize:"30",fontWeight:"bold"}},labelLine:{show:!1},data:[]}]};const s=r[0].data,l=[];for(let e=0;e<s.length;e++)l.push(s[e].challenge.category);const o=l.filter((e,t)=>l.indexOf(e)==t),d=[];for(let e=0;e<o.length;e++){let t=0;for(let p=0;p<l.length;p++)l[p]==o[e]&&t++;d.push(t)}return o.forEach((e,t)=>{n.legend.data.push(e),n.series[0].data.push({value:d[t],name:e,itemStyle:{color:f(e)}})}),n}},solve_percentages:{format:(c,i,a,u,r)=>{const n=r[0].data.length,s=r[1].meta.count;return{title:{left:"center",text:"Pourcentage de r\xE9solution"},tooltip:{trigger:"item"},toolbox:{show:!0,feature:{saveAsImage:{}}},legend:{orient:"vertical",top:"middle",right:0,data:["Fails","Solves"]},series:[{name:"Pourcentage de r\xE9solution",type:"pie",radius:["30%","50%"],avoidLabelOverlap:!1,label:{show:!1,position:"center"},itemStyle:{normal:{label:{show:!0,formatter:function(o){return`${o.name} - ${o.value} (${o.percent}%)`}},labelLine:{show:!0}},emphasis:{label:{show:!0,position:"center",textStyle:{fontSize:"14",fontWeight:"normal"}}}},emphasis:{label:{show:!0,fontSize:"30",fontWeight:"bold"}},labelLine:{show:!1},data:[{value:s,name:"Fails",itemStyle:{color:"rgb(207, 38, 0)"}},{value:n,name:"Solves",itemStyle:{color:"rgb(0, 209, 64)"}}]}]}}}};function S(c,i,a,u,r,n,s){const l=m[c];let o=h.init(document.querySelector(i));o.setOption(l.format(u,r,n,s,a)),g(window).on("resize",function(){o!=null&&o!=null&&o.resize()})}function _(c,i,a,u,r,n,s){const l=m[c];h.init(document.querySelector(i)).setOption(l.format(u,r,n,s,a))}export{S as c,_ as u}; diff --git a/CTFd/themes/admin/static/assets/htmlmixed.60cb33cf.js b/CTFd/themes/admin/static/assets/htmlmixed.245897c1.js similarity index 99% rename from CTFd/themes/admin/static/assets/htmlmixed.60cb33cf.js rename to CTFd/themes/admin/static/assets/htmlmixed.245897c1.js index e73adf1eb1867b6f303419daed56c2bc4820f59d..28bb139fa7f126dffbb5d40ee8acc957ada602c2 100644 --- a/CTFd/themes/admin/static/assets/htmlmixed.60cb33cf.js +++ b/CTFd/themes/admin/static/assets/htmlmixed.245897c1.js @@ -1,4 +1,4 @@ -import{I as pu}from"./pages/main.9f35ed12.js";var lo={exports:{}},sa;function An(){return sa||(sa=1,function(Zr,Dn){(function(F,We){Zr.exports=We()})(pu,function(){var F=navigator.userAgent,We=navigator.platform,pe=/gecko\/\d/i.test(F),Je=/MSIE \d/.test(F),dt=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(F),Pe=/Edge\/(\d+)/.exec(F),P=Je||dt||Pe,I=P&&(Je?document.documentMode||6:+(Pe||dt)[1]),se=!Pe&&/WebKit\//.test(F),re=se&&/Qt\/\d+\.\d+/.test(F),X=!Pe&&/Chrome\//.test(F),J=/Opera\//.test(F),fe=/Apple Computer/.test(navigator.vendor),Le=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(F),ze=/PhantomJS/.test(F),$=!Pe&&/AppleWebKit/.test(F)&&/Mobile\/\w+/.test(F),_e=/Android/.test(F),Q=$||_e||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(F),Y=$||/Mac/.test(We),Te=/\bCrOS\b/.test(F),bt=/win/i.test(We),Ae=J&&F.match(/Version\/(\d*\.\d*)/);Ae&&(Ae=Number(Ae[1])),Ae&&Ae>=15&&(J=!1,se=!0);var rt=Y&&(re||J&&(Ae==null||Ae<12.11)),Ie=pe||P&&I>=9;function _(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var j=function(e,t){var n=e.className,r=_(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function k(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function z(e,t){return k(e).appendChild(t)}function c(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),typeof t=="string")i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function D(e,t,n,r){var i=c(e,t,n,r);return i.setAttribute("role","presentation"),i}var L;document.createRange?L=function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:L=function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch{return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};function U(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function ve(){var e;try{e=document.activeElement}catch{e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function De(e,t){var n=e.className;_(t).test(n)||(e.className+=(n?" ":"")+t)}function xt(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!_(n[r]).test(t)&&(t+=" "+n[r]);return t}var Kt=function(e){e.select()};$?Kt=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:P&&(Kt=function(e){try{e.select()}catch{}});function wt(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function vt(e,t,n){t||(t={});for(var r in e)e.hasOwnProperty(r)&&(n!==!1||!t.hasOwnProperty(r))&&(t[r]=e[r]);return t}function be(e,t,n,r,i){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var o=r||0,l=i||0;;){var a=e.indexOf(" ",o);if(a<0||a>=t)return l+(t-o);l+=a-o,l+=n-l%n,o=a+1}}var K=function(){this.id=null,this.f=null,this.time=0,this.handler=wt(this.onTimeout,this)};K.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},K.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};function E(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}var ne=50,ye={toString:function(){return"CodeMirror.Pass"}},Qe={scroll:!1},H={origin:"*mouse"},ie={origin:"+move"};function _t(e,t,n){for(var r=0,i=0;;){var o=e.indexOf(" ",r);o==-1&&(o=e.length);var l=o-r;if(o==e.length||i+l>=t)return r+Math.min(l,t-i);if(i+=o-r,i+=n-i%n,r=o+1,i>=t)return r}}var Dt=[""];function Ct(e){for(;Dt.length<=e;)Dt.push(ee(Dt)+" ");return Dt[e]}function ee(e){return e[e.length-1]}function ce(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function Ve(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}function Ot(){}function gt(e,t){var n;return Object.create?n=Object.create(e):(Ot.prototype=e,n=new Ot),t&&vt(t,n),n}var fr=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function me(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||fr.test(e))}function y(e,t){return t?t.source.indexOf("\\w")>-1&&me(e)?!0:t.test(e):me(e)}function T(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var x=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function oe(e){return e.charCodeAt(0)>=768&&x.test(e)}function Ue(e,t,n){for(;(n<0?t>0:t<e.length)&&oe(e.charAt(t));)t+=n;return t}function cr(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}function Ut(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var l=e[o];(l.from<n&&l.to>t||t==n&&l.to==t)&&(r(Math.max(l.from,t),Math.min(l.to,n),l.level==1?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}var Se=null;function Lt(e,t,n){var r;Se=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&n=="before"?r=i:Se=i),o.from==t&&(o.from!=o.to&&n!="before"?r=i:Se=i)}return r!=null?r:Se}var Sr=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(u){return u<=247?e.charAt(u):1424<=u&&u<=1524?"R":1536<=u&&u<=1785?t.charAt(u-1536):1774<=u&&u<=2220?"r":8192<=u&&u<=8203?"w":u==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,l=/[Lb1n]/,a=/[1n]/;function s(u,d,h){this.level=u,this.from=d,this.to=h}return function(u,d){var h=d=="ltr"?"L":"R";if(u.length==0||d=="ltr"&&!r.test(u))return!1;for(var m=u.length,g=[],b=0;b<m;++b)g.push(n(u.charCodeAt(b)));for(var S=0,C=h;S<m;++S){var N=g[S];N=="m"?g[S]=C:C=N}for(var O=0,A=h;O<m;++O){var W=g[O];W=="1"&&A=="r"?g[O]="n":o.test(W)&&(A=W,W=="r"&&(g[O]="R"))}for(var q=1,R=g[0];q<m-1;++q){var V=g[q];V=="+"&&R=="1"&&g[q+1]=="1"?g[q]="1":V==","&&R==g[q+1]&&(R=="1"||R=="n")&&(g[q]=R),R=V}for(var ge=0;ge<m;++ge){var Xe=g[ge];if(Xe==",")g[ge]="N";else if(Xe=="%"){var Ce=void 0;for(Ce=ge+1;Ce<m&&g[Ce]=="%";++Ce);for(var pt=ge&&g[ge-1]=="!"||Ce<m&&g[Ce]=="1"?"1":"N",ut=ge;ut<Ce;++ut)g[ut]=pt;ge=Ce-1}}for(var Ee=0,ft=h;Ee<m;++Ee){var Ze=g[Ee];ft=="L"&&Ze=="1"?g[Ee]="L":o.test(Ze)&&(ft=Ze)}for(var Ke=0;Ke<m;++Ke)if(i.test(g[Ke])){var Fe=void 0;for(Fe=Ke+1;Fe<m&&i.test(g[Fe]);++Fe);for(var Ne=(Ke?g[Ke-1]:h)=="L",ct=(Fe<m?g[Fe]:h)=="L",Yr=Ne==ct?Ne?"L":"R":h,ur=Ke;ur<Fe;++ur)g[ur]=Yr;Ke=Fe-1}for(var tt=[],Rt,Ye=0;Ye<m;)if(l.test(g[Ye])){var io=Ye;for(++Ye;Ye<m&&l.test(g[Ye]);++Ye);tt.push(new s(0,io,Ye))}else{var Vt=Ye,wr=tt.length,kr=d=="rtl"?1:0;for(++Ye;Ye<m&&g[Ye]!="L";++Ye);for(var ot=Vt;ot<Ye;)if(a.test(g[ot])){Vt<ot&&(tt.splice(wr,0,new s(1,Vt,ot)),wr+=kr);var jr=ot;for(++ot;ot<Ye&&a.test(g[ot]);++ot);tt.splice(wr,0,new s(2,jr,ot)),wr+=kr,Vt=ot}else++ot;Vt<Ye&&tt.splice(wr,0,new s(1,Vt,Ye))}return d=="ltr"&&(tt[0].level==1&&(Rt=u.match(/^\s+/))&&(tt[0].from=Rt[0].length,tt.unshift(new s(0,0,Rt[0].length))),ee(tt).level==1&&(Rt=u.match(/\s+$/))&&(ee(tt).to-=Rt[0].length,tt.push(new s(0,m-Rt[0].length,m)))),d=="rtl"?tt.reverse():tt}}();function nt(e,t){var n=e.order;return n==null&&(n=e.order=Sr(e.text,t)),n}var On=[],G=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||On).concat(n)}};function Jr(e,t){return e._handlers&&e._handlers[t]||On}function te(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var o=E(i,n);o>-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function Me(e,t){var n=Jr(e,t);if(!!n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function xe(e,t,n){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Me(e,n||t.type,e,t),dr(t)||t.codemirrorIgnore}function Cr(e){var t=e._handlers&&e._handlers.cursorActivity;if(!!t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)E(n,t[r])==-1&&n.push(t[r])}function He(e,t){return Jr(e,t).length>0}function $t(e){e.prototype.on=function(t,n){G(this,t,n)},e.prototype.off=function(t,n){te(this,t,n)}}function Be(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Wn(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function dr(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function $e(e){Be(e),Wn(e)}function Lr(e){return e.target||e.srcElement}function Pn(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),Y&&e.ctrlKey&&t==1&&(t=3),t}var Wt=function(){if(P&&I<9)return!1;var e=c("div");return"draggable"in e||"dragDrop"in e}(),Qr;function zn(e){if(Qr==null){var t=c("span","\u200B");z(e,c("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Qr=t.offsetWidth<=1&&t.offsetHeight>2&&!(P&&I<8))}var n=Qr?c("span","\u200B"):c("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var Tr;function di(e){if(Tr!=null)return Tr;var t=z(e,document.createTextNode("A\u062EA")),n=L(t,0,1).getBoundingClientRect(),r=L(t,1,2).getBoundingClientRect();return k(e),!n||n.left==n.right?!1:Tr=r.right-n.right<3}var Pt=` +import{I as pu}from"./pages/main.b0151f5b.js";var lo={exports:{}},sa;function An(){return sa||(sa=1,function(Zr,Dn){(function(F,We){Zr.exports=We()})(pu,function(){var F=navigator.userAgent,We=navigator.platform,pe=/gecko\/\d/i.test(F),Je=/MSIE \d/.test(F),dt=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(F),Pe=/Edge\/(\d+)/.exec(F),P=Je||dt||Pe,I=P&&(Je?document.documentMode||6:+(Pe||dt)[1]),se=!Pe&&/WebKit\//.test(F),re=se&&/Qt\/\d+\.\d+/.test(F),X=!Pe&&/Chrome\//.test(F),J=/Opera\//.test(F),fe=/Apple Computer/.test(navigator.vendor),Le=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(F),ze=/PhantomJS/.test(F),$=!Pe&&/AppleWebKit/.test(F)&&/Mobile\/\w+/.test(F),_e=/Android/.test(F),Q=$||_e||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(F),Y=$||/Mac/.test(We),Te=/\bCrOS\b/.test(F),bt=/win/i.test(We),Ae=J&&F.match(/Version\/(\d*\.\d*)/);Ae&&(Ae=Number(Ae[1])),Ae&&Ae>=15&&(J=!1,se=!0);var rt=Y&&(re||J&&(Ae==null||Ae<12.11)),Ie=pe||P&&I>=9;function _(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var j=function(e,t){var n=e.className,r=_(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function k(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function z(e,t){return k(e).appendChild(t)}function c(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),typeof t=="string")i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function D(e,t,n,r){var i=c(e,t,n,r);return i.setAttribute("role","presentation"),i}var L;document.createRange?L=function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:L=function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch{return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};function U(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function ve(){var e;try{e=document.activeElement}catch{e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function De(e,t){var n=e.className;_(t).test(n)||(e.className+=(n?" ":"")+t)}function xt(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!_(n[r]).test(t)&&(t+=" "+n[r]);return t}var Kt=function(e){e.select()};$?Kt=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:P&&(Kt=function(e){try{e.select()}catch{}});function wt(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function vt(e,t,n){t||(t={});for(var r in e)e.hasOwnProperty(r)&&(n!==!1||!t.hasOwnProperty(r))&&(t[r]=e[r]);return t}function be(e,t,n,r,i){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var o=r||0,l=i||0;;){var a=e.indexOf(" ",o);if(a<0||a>=t)return l+(t-o);l+=a-o,l+=n-l%n,o=a+1}}var K=function(){this.id=null,this.f=null,this.time=0,this.handler=wt(this.onTimeout,this)};K.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},K.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};function E(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}var ne=50,ye={toString:function(){return"CodeMirror.Pass"}},Qe={scroll:!1},H={origin:"*mouse"},ie={origin:"+move"};function _t(e,t,n){for(var r=0,i=0;;){var o=e.indexOf(" ",r);o==-1&&(o=e.length);var l=o-r;if(o==e.length||i+l>=t)return r+Math.min(l,t-i);if(i+=o-r,i+=n-i%n,r=o+1,i>=t)return r}}var Dt=[""];function Ct(e){for(;Dt.length<=e;)Dt.push(ee(Dt)+" ");return Dt[e]}function ee(e){return e[e.length-1]}function ce(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function Ve(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}function Ot(){}function gt(e,t){var n;return Object.create?n=Object.create(e):(Ot.prototype=e,n=new Ot),t&&vt(t,n),n}var fr=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function me(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||fr.test(e))}function y(e,t){return t?t.source.indexOf("\\w")>-1&&me(e)?!0:t.test(e):me(e)}function T(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var x=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function oe(e){return e.charCodeAt(0)>=768&&x.test(e)}function Ue(e,t,n){for(;(n<0?t>0:t<e.length)&&oe(e.charAt(t));)t+=n;return t}function cr(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}function Ut(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var l=e[o];(l.from<n&&l.to>t||t==n&&l.to==t)&&(r(Math.max(l.from,t),Math.min(l.to,n),l.level==1?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}var Se=null;function Lt(e,t,n){var r;Se=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&n=="before"?r=i:Se=i),o.from==t&&(o.from!=o.to&&n!="before"?r=i:Se=i)}return r!=null?r:Se}var Sr=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(u){return u<=247?e.charAt(u):1424<=u&&u<=1524?"R":1536<=u&&u<=1785?t.charAt(u-1536):1774<=u&&u<=2220?"r":8192<=u&&u<=8203?"w":u==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,l=/[Lb1n]/,a=/[1n]/;function s(u,d,h){this.level=u,this.from=d,this.to=h}return function(u,d){var h=d=="ltr"?"L":"R";if(u.length==0||d=="ltr"&&!r.test(u))return!1;for(var m=u.length,g=[],b=0;b<m;++b)g.push(n(u.charCodeAt(b)));for(var S=0,C=h;S<m;++S){var N=g[S];N=="m"?g[S]=C:C=N}for(var O=0,A=h;O<m;++O){var W=g[O];W=="1"&&A=="r"?g[O]="n":o.test(W)&&(A=W,W=="r"&&(g[O]="R"))}for(var q=1,R=g[0];q<m-1;++q){var V=g[q];V=="+"&&R=="1"&&g[q+1]=="1"?g[q]="1":V==","&&R==g[q+1]&&(R=="1"||R=="n")&&(g[q]=R),R=V}for(var ge=0;ge<m;++ge){var Xe=g[ge];if(Xe==",")g[ge]="N";else if(Xe=="%"){var Ce=void 0;for(Ce=ge+1;Ce<m&&g[Ce]=="%";++Ce);for(var pt=ge&&g[ge-1]=="!"||Ce<m&&g[Ce]=="1"?"1":"N",ut=ge;ut<Ce;++ut)g[ut]=pt;ge=Ce-1}}for(var Ee=0,ft=h;Ee<m;++Ee){var Ze=g[Ee];ft=="L"&&Ze=="1"?g[Ee]="L":o.test(Ze)&&(ft=Ze)}for(var Ke=0;Ke<m;++Ke)if(i.test(g[Ke])){var Fe=void 0;for(Fe=Ke+1;Fe<m&&i.test(g[Fe]);++Fe);for(var Ne=(Ke?g[Ke-1]:h)=="L",ct=(Fe<m?g[Fe]:h)=="L",Yr=Ne==ct?Ne?"L":"R":h,ur=Ke;ur<Fe;++ur)g[ur]=Yr;Ke=Fe-1}for(var tt=[],Rt,Ye=0;Ye<m;)if(l.test(g[Ye])){var io=Ye;for(++Ye;Ye<m&&l.test(g[Ye]);++Ye);tt.push(new s(0,io,Ye))}else{var Vt=Ye,wr=tt.length,kr=d=="rtl"?1:0;for(++Ye;Ye<m&&g[Ye]!="L";++Ye);for(var ot=Vt;ot<Ye;)if(a.test(g[ot])){Vt<ot&&(tt.splice(wr,0,new s(1,Vt,ot)),wr+=kr);var jr=ot;for(++ot;ot<Ye&&a.test(g[ot]);++ot);tt.splice(wr,0,new s(2,jr,ot)),wr+=kr,Vt=ot}else++ot;Vt<Ye&&tt.splice(wr,0,new s(1,Vt,Ye))}return d=="ltr"&&(tt[0].level==1&&(Rt=u.match(/^\s+/))&&(tt[0].from=Rt[0].length,tt.unshift(new s(0,0,Rt[0].length))),ee(tt).level==1&&(Rt=u.match(/\s+$/))&&(ee(tt).to-=Rt[0].length,tt.push(new s(0,m-Rt[0].length,m)))),d=="rtl"?tt.reverse():tt}}();function nt(e,t){var n=e.order;return n==null&&(n=e.order=Sr(e.text,t)),n}var On=[],G=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||On).concat(n)}};function Jr(e,t){return e._handlers&&e._handlers[t]||On}function te(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var o=E(i,n);o>-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function Me(e,t){var n=Jr(e,t);if(!!n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function xe(e,t,n){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Me(e,n||t.type,e,t),dr(t)||t.codemirrorIgnore}function Cr(e){var t=e._handlers&&e._handlers.cursorActivity;if(!!t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)E(n,t[r])==-1&&n.push(t[r])}function He(e,t){return Jr(e,t).length>0}function $t(e){e.prototype.on=function(t,n){G(this,t,n)},e.prototype.off=function(t,n){te(this,t,n)}}function Be(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Wn(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function dr(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function $e(e){Be(e),Wn(e)}function Lr(e){return e.target||e.srcElement}function Pn(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),Y&&e.ctrlKey&&t==1&&(t=3),t}var Wt=function(){if(P&&I<9)return!1;var e=c("div");return"draggable"in e||"dragDrop"in e}(),Qr;function zn(e){if(Qr==null){var t=c("span","\u200B");z(e,c("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Qr=t.offsetWidth<=1&&t.offsetHeight>2&&!(P&&I<8))}var n=Qr?c("span","\u200B"):c("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var Tr;function di(e){if(Tr!=null)return Tr;var t=z(e,document.createTextNode("A\u062EA")),n=L(t,0,1).getBoundingClientRect(),r=L(t,1,2).getBoundingClientRect();return k(e),!n||n.left==n.right?!1:Tr=r.right-n.right<3}var Pt=` b`.split(/\n/).length!=3?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf(` `,t);i==-1&&(i=e.length);var o=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),l=o.indexOf("\r");l!=-1?(n.push(o.slice(0,l)),t+=l+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},zt=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch{return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch{}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},er=function(){var e=c("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Mr=null;function Gt(e){if(Mr!=null)return Mr;var t=z(e,c("span","x")),n=t.getBoundingClientRect(),r=L(t,0,1).getBoundingClientRect();return Mr=Math.abs(n.left-r.left)>1}var Vr={},qt={};function Nr(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Vr[e]=t}function Tt(e,t){qt[e]=t}function Xt(e){if(typeof e=="string"&&qt.hasOwnProperty(e))e=qt[e];else if(e&&typeof e.name=="string"&&qt.hasOwnProperty(e.name)){var t=qt[e.name];typeof t=="string"&&(t={name:t}),e=gt(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Xt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Xt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function $r(e,t){t=Xt(t);var n=Vr[t.name];if(!n)return $r(e,"text/plain");var r=n(e,t);if(Yt.hasOwnProperty(t.name)){var i=Yt[t.name];for(var o in i)!i.hasOwnProperty(o)||(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)r[l]=t.modeProps[l];return r}var Yt={};function hi(e,t){var n=Yt.hasOwnProperty(e)?Yt[e]:Yt[e]={};vt(t,n)}function kt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function Ar(e,t){for(var n;e.innerMode&&(n=e.innerMode(t),!(!n||n.mode==e));)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Hn(e,t,n){return e.startState?e.startState(t,n):!0}var we=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};we.prototype.eol=function(){return this.pos>=this.string.length},we.prototype.sol=function(){return this.pos==this.lineStart},we.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},we.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},we.prototype.eat=function(e){var t=this.string.charAt(this.pos),n;if(typeof e=="string"?n=t==e:n=t&&(e.test?e.test(t):e(t)),n)return++this.pos,t},we.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},we.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},we.prototype.skipToEnd=function(){this.pos=this.string.length},we.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},we.prototype.backUp=function(e){this.pos-=e},we.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=be(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?be(this.string,this.lineStart,this.tabSize):0)},we.prototype.indentation=function(){return be(this.string,null,this.tabSize)-(this.lineStart?be(this.string,this.lineStart,this.tabSize):0)},we.prototype.match=function(e,t,n){if(typeof e=="string"){var r=function(l){return n?l.toLowerCase():l},i=this.string.substr(this.pos,e.length);if(r(i)==r(e))return t!==!1&&(this.pos+=e.length),!0}else{var o=this.string.slice(this.pos).match(e);return o&&o.index>0?null:(o&&t!==!1&&(this.pos+=o[0].length),o)}},we.prototype.current=function(){return this.string.slice(this.start,this.pos)},we.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},we.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},we.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function B(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t<o){n=i;break}t-=o}return n.lines[t]}function Ht(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(o){var l=o.text;i==n.line&&(l=l.slice(0,n.ch)),i==t.line&&(l=l.slice(t.ch)),r.push(l),++i}),r}function en(e,t,n){var r=[];return e.iter(t,n,function(i){r.push(i.text)}),r}function St(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function ae(e){if(e.parent==null)return null;for(var t=e.parent,n=E(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function f(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],o=i.height;if(t<o){e=i;continue e}t-=o,n+=i.chunkSize()}return n}while(!e.lines);for(var l=0;l<e.lines.length;++l){var a=e.lines[l],s=a.height;if(t<s)break;t-=s}return n+l}function p(e,t){return t>=e.first&&t<e.first+e.size}function w(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function v(e,t,n){if(n===void 0&&(n=null),!(this instanceof v))return new v(e,t,n);this.line=e,this.ch=t,this.sticky=n}function M(e,t){return e.line-t.line||e.ch-t.ch}function le(e,t){return e.sticky==t.sticky&&M(e,t)==0}function de(e){return v(e.line,e.ch)}function Re(e,t){return M(e,t)<0?t:e}function lt(e,t){return M(e,t)<0?e:t}function En(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function Z(e,t){if(t.line<e.first)return v(e.first,0);var n=e.first+e.size-1;return t.line>n?v(n,B(e,n).text.length):va(t,B(e,t.line).text.length)}function va(e,t){var n=e.ch;return n==null||n>t?v(e.line,t):n<0?v(e.line,0):e}function ao(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=Z(e,t[r]);return n}var Fn=function(e,t){this.state=e,this.lookAhead=t},Et=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};Et.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Et.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},Et.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Et.fromSaved=function(e,t,n){return t instanceof Fn?new Et(e,kt(e.mode,t.state),n,t.lookAhead):new Et(e,kt(e.mode,t),n)},Et.prototype.save=function(e){var t=e!==!1?kt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Fn(t,this.maxLookAhead):t};function so(e,t,n,r){var i=[e.state.modeGen],o={};vo(e,t.text,e.doc.mode,n,function(u,d){return i.push(u,d)},o,r);for(var l=n.state,a=function(u){n.baseTokens=i;var d=e.state.overlays[u],h=1,m=0;n.state=!0,vo(e,t.text,d.mode,n,function(g,b){for(var S=h;m<g;){var C=i[h];C>g&&i.splice(h,1,g,i[h+1],C),h+=2,m=Math.min(g,C)}if(!!b)if(d.opaque)i.splice(S,h-S,g,"overlay "+b),h=S+2;else for(;S<h;S+=2){var N=i[S+1];i[S+1]=(N?N+" ":"")+"overlay "+b}},o),n.state=l,n.baseTokens=null,n.baseTokenPos=1},s=0;s<e.state.overlays.length;++s)a(s);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function uo(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=tn(e,ae(t)),i=t.text.length>e.options.maxHighlightLength&&kt(e.doc.mode,r.state),o=so(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function tn(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new Et(r,!0,t);var o=ga(e,t,n),l=o>r.first&&B(r,o-1).stateAfter,a=l?Et.fromSaved(r,l,o):new Et(r,Hn(r.mode),o);return r.iter(o,t,function(s){pi(e,s.text,a);var u=a.line;s.stateAfter=u==t-1||u%5==0||u>=i.viewFrom&&u<i.viewTo?a.save():null,a.nextLine()}),n&&(r.modeFrontier=a.line),a}function pi(e,t,n,r){var i=e.doc.mode,o=new we(t,e.options.tabSize,n);for(o.start=o.pos=r||0,t==""&&fo(i,n.state);!o.eol();)vi(i,o,n.state),o.start=o.pos}function fo(e,t){if(e.blankLine)return e.blankLine(t);if(!!e.innerMode){var n=Ar(e,t);if(n.mode.blankLine)return n.mode.blankLine(n.state)}}function vi(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=Ar(e,n).mode);var o=e.token(t,n);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}var co=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function ho(e,t,n,r){var i=e.doc,o=i.mode,l;t=Z(i,t);var a=B(i,t.line),s=tn(e,t.line,n),u=new we(a.text,e.options.tabSize,s),d;for(r&&(d=[]);(r||u.pos<t.ch)&&!u.eol();)u.start=u.pos,l=vi(o,u,s.state),r&&d.push(new co(u,l,kt(i.mode,s.state)));return r?d:new co(u,l,s.state)}function po(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";t[r]==null?t[r]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+n[2])}return e}function vo(e,t,n,r,i,o,l){var a=n.flattenSpans;a==null&&(a=e.options.flattenSpans);var s=0,u=null,d=new we(t,e.options.tabSize,r),h,m=e.options.addModeClass&&[null];for(t==""&&po(fo(n,r.state),o);!d.eol();){if(d.pos>e.options.maxHighlightLength?(a=!1,l&&pi(e,t,r,d.pos),d.pos=t.length,h=null):h=po(vi(n,d,r.state,m),o),m){var g=m[0].name;g&&(h="m-"+(h?g+" "+h:g))}if(!a||u!=h){for(;s<d.start;)s=Math.min(d.start,s+5e3),i(s,u);u=h}d.start=d.pos}for(;s<d.pos;){var b=Math.min(d.pos,s+5e3);i(b,u),s=b}}function ga(e,t,n){for(var r,i,o=e.doc,l=n?-1:t-(e.doc.mode.innerMode?1e3:100),a=t;a>l;--a){if(a<=o.first)return o.first;var s=B(o,a-1),u=s.stateAfter;if(u&&(!n||a+(u instanceof Fn?u.lookAhead:0)<=o.modeFrontier))return a;var d=be(s.text,null,e.options.tabSize);(i==null||r>d)&&(i=a-1,r=d)}return i}function ma(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,r=t-1;r>n;r--){var i=B(e,r).stateAfter;if(i&&(!(i instanceof Fn)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}var go=!1,jt=!1;function ya(){go=!0}function ba(){jt=!0}function In(e,t,n){this.marker=e,this.from=t,this.to=n}function rn(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function xa(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function wa(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function ka(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],l=o.marker,a=o.from==null||(l.inclusiveLeft?o.from<=t:o.from<t);if(a||o.from==t&&l.type=="bookmark"&&(!n||!o.marker.insertLeft)){var s=o.to==null||(l.inclusiveRight?o.to>=t:o.to>t);(r||(r=[])).push(new In(l,o.from,s?null:o.to))}}return r}function Sa(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],l=o.marker,a=o.to==null||(l.inclusiveRight?o.to>=t:o.to>t);if(a||o.from==t&&l.type=="bookmark"&&(!n||o.marker.insertLeft)){var s=o.from==null||(l.inclusiveLeft?o.from<=t:o.from<t);(r||(r=[])).push(new In(l,s?null:o.from-t,o.to==null?null:o.to-t))}}return r}function gi(e,t){if(t.full)return null;var n=p(e,t.from.line)&&B(e,t.from.line).markedSpans,r=p(e,t.to.line)&&B(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,o=t.to.ch,l=M(t.from,t.to)==0,a=ka(n,i,l),s=Sa(r,o,l),u=t.text.length==1,d=ee(t.text).length+(u?i:0);if(a)for(var h=0;h<a.length;++h){var m=a[h];if(m.to==null){var g=rn(s,m.marker);g?u&&(m.to=g.to==null?null:g.to+d):m.to=i}}if(s)for(var b=0;b<s.length;++b){var S=s[b];if(S.to!=null&&(S.to+=d),S.from==null){var C=rn(a,S.marker);C||(S.from=d,u&&(a||(a=[])).push(S))}else S.from+=d,u&&(a||(a=[])).push(S)}a&&(a=mo(a)),s&&s!=a&&(s=mo(s));var N=[a];if(!u){var O=t.text.length-2,A;if(O>0&&a)for(var W=0;W<a.length;++W)a[W].to==null&&(A||(A=[])).push(new In(a[W].marker,null,null));for(var q=0;q<O;++q)N.push(A);N.push(s)}return N}function mo(e){for(var t=0;t<e.length;++t){var n=e[t];n.from!=null&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function Ca(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(g){if(g.markedSpans)for(var b=0;b<g.markedSpans.length;++b){var S=g.markedSpans[b].marker;S.readOnly&&(!r||E(r,S)==-1)&&(r||(r=[])).push(S)}}),!r)return null;for(var i=[{from:t,to:n}],o=0;o<r.length;++o)for(var l=r[o],a=l.find(0),s=0;s<i.length;++s){var u=i[s];if(!(M(u.to,a.from)<0||M(u.from,a.to)>0)){var d=[s,1],h=M(u.from,a.from),m=M(u.to,a.to);(h<0||!l.inclusiveLeft&&!h)&&d.push({from:u.from,to:a.from}),(m>0||!l.inclusiveRight&&!m)&&d.push({from:a.to,to:u.to}),i.splice.apply(i,d),s+=d.length-3}}return i}function yo(e){var t=e.markedSpans;if(!!t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function bo(e,t){if(!!t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function Bn(e){return e.inclusiveLeft?-1:0}function Rn(e){return e.inclusiveRight?1:0}function mi(e,t){var n=e.lines.length-t.lines.length;if(n!=0)return n;var r=e.find(),i=t.find(),o=M(r.from,i.from)||Bn(e)-Bn(t);if(o)return-o;var l=M(r.to,i.to)||Rn(e)-Rn(t);return l||t.id-e.id}function xo(e,t){var n=jt&&e.markedSpans,r;if(n)for(var i=void 0,o=0;o<n.length;++o)i=n[o],i.marker.collapsed&&(t?i.from:i.to)==null&&(!r||mi(r,i.marker)<0)&&(r=i.marker);return r}function wo(e){return xo(e,!0)}function Kn(e){return xo(e,!1)}function La(e,t){var n=jt&&e.markedSpans,r;if(n)for(var i=0;i<n.length;++i){var o=n[i];o.marker.collapsed&&(o.from==null||o.from<t)&&(o.to==null||o.to>t)&&(!r||mi(r,o.marker)<0)&&(r=o.marker)}return r}function ko(e,t,n,r,i){var o=B(e,t),l=jt&&o.markedSpans;if(l)for(var a=0;a<l.length;++a){var s=l[a];if(!!s.marker.collapsed){var u=s.marker.find(0),d=M(u.from,n)||Bn(s.marker)-Bn(i),h=M(u.to,r)||Rn(s.marker)-Rn(i);if(!(d>=0&&h<=0||d<=0&&h>=0)&&(d<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?M(u.to,n)>=0:M(u.to,n)>0)||d>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?M(u.from,r)<=0:M(u.from,r)<0)))return!0}}}function Ft(e){for(var t;t=wo(e);)e=t.find(-1,!0).line;return e}function Ta(e){for(var t;t=Kn(e);)e=t.find(1,!0).line;return e}function Ma(e){for(var t,n;t=Kn(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function yi(e,t){var n=B(e,t),r=Ft(n);return n==r?t:ae(r)}function So(e,t){if(t>e.lastLine())return t;var n=B(e,t),r;if(!tr(e,n))return t;for(;r=Kn(n);)n=r.find(1,!0).line;return ae(n)+1}function tr(e,t){var n=jt&&t.markedSpans;if(n){for(var r=void 0,i=0;i<n.length;++i)if(r=n[i],!!r.marker.collapsed){if(r.from==null)return!0;if(!r.marker.widgetNode&&r.from==0&&r.marker.inclusiveLeft&&bi(e,t,r))return!0}}}function bi(e,t,n){if(n.to==null){var r=n.marker.find(1,!0);return bi(e,r.line,rn(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if(i=t.markedSpans[o],i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(i.to==null||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&bi(e,t,i))return!0}function Zt(e){e=Ft(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var o=n.parent;o;n=o,o=n.parent)for(var l=0;l<o.children.length;++l){var a=o.children[l];if(a==n)break;t+=a.height}return t}function _n(e){if(e.height==0)return 0;for(var t=e.text.length,n,r=e;n=wo(r);){var i=n.find(0,!0);r=i.from.line,t+=i.from.ch-i.to.ch}for(r=e;n=Kn(r);){var o=n.find(0,!0);t-=r.text.length-o.from.ch,r=o.to.line,t+=r.text.length-o.to.ch}return t}function xi(e){var t=e.display,n=e.doc;t.maxLine=B(n,n.first),t.maxLineLength=_n(t.maxLine),t.maxLineChanged=!0,n.iter(function(r){var i=_n(r);i>t.maxLineLength&&(t.maxLineLength=i,t.maxLine=r)})}var Dr=function(e,t,n){this.text=e,bo(this,t),this.height=n?n(this):1};Dr.prototype.lineNo=function(){return ae(this)},$t(Dr);function Na(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),yo(e),bo(e,n);var i=r?r(e):1;i!=e.height&&St(e,i)}function Aa(e){e.parent=null,yo(e)}var Da={},Oa={};function Co(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Oa:Da;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Lo(e,t){var n=D("span",null,null,se?"padding-right: .1px":null),r={pre:D("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,l=void 0;r.pos=0,r.addToken=Pa,di(e.display.measure)&&(l=nt(o,e.doc.direction))&&(r.addToken=Ha(r.addToken,l)),r.map=[];var a=t!=e.display.externalMeasured&&ae(o);Ea(o,r,uo(e,o,a)),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=xt(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=xt(o.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(zn(e.display.measure))),i==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(se){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return Me(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=xt(r.pre.className,r.textClass||"")),r}function Wa(e){var t=c("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Pa(e,t,n,r,i,o,l){if(!!t){var a=e.splitSpaces?za(t,e.trailingSpace):t,s=e.cm.state.specialChars,u=!1,d;if(!s.test(t))e.col+=t.length,d=document.createTextNode(a),e.map.push(e.pos,e.pos+t.length,d),P&&I<9&&(u=!0),e.pos+=t.length;else{d=document.createDocumentFragment();for(var h=0;;){s.lastIndex=h;var m=s.exec(t),g=m?m.index-h:t.length-h;if(g){var b=document.createTextNode(a.slice(h,h+g));P&&I<9?d.appendChild(c("span",[b])):d.appendChild(b),e.map.push(e.pos,e.pos+g,b),e.col+=g,e.pos+=g}if(!m)break;h+=g+1;var S=void 0;if(m[0]==" "){var C=e.cm.options.tabSize,N=C-e.col%C;S=d.appendChild(c("span",Ct(N),"cm-tab")),S.setAttribute("role","presentation"),S.setAttribute("cm-text"," "),e.col+=N}else m[0]=="\r"||m[0]==` diff --git a/CTFd/themes/admin/static/assets/pages/challenge.34c205c6.js b/CTFd/themes/admin/static/assets/pages/challenge.23743f93.js similarity index 99% rename from CTFd/themes/admin/static/assets/pages/challenge.34c205c6.js rename to CTFd/themes/admin/static/assets/pages/challenge.23743f93.js index 860f05b10de5a6c247255b0c524a0efc965a3518..d0ac7258d0ad51cc9e645f0b147715175c193d47 100644 --- a/CTFd/themes/admin/static/assets/pages/challenge.34c205c6.js +++ b/CTFd/themes/admin/static/assets/pages/challenge.23743f93.js @@ -1,4 +1,4 @@ -import{_ as _export_sfc,j as jqueryExports,C as CTFd$1,n as nunjucks,o as openBlock,c as createElementBlock,a as createBaseVNode,F as Fragment,r as renderList,t as toDisplayString,w as withModifiers,b as createCommentVNode,d as createStaticVNode,e as resolveComponent,f as createVNode,g as withCtx,T as TransitionGroup,h as withDirectives,v as vModelSelect,i as vModelCheckbox,k as createTextVNode,p as pushScopeId,l as popScopeId,m as vModelText,q as withKeys,s as normalizeClass,u as helpers,x as ezQuery,y as vShow,z as bindMarkdownEditor,A as htmlEntities,V as Vue$1,B as bindMarkdownEditors,D as ezAlert,E as ezToast}from"./main.9f35ed12.js";import"../tab.c508b42d.js";import{C as CommentBox}from"../CommentBox.a3989c28.js";const _sfc_main$b={name:"FlagCreationForm",props:{challenge_id:Number},data:function(){return{types:{},selectedType:null,createForm:""}},methods:{selectType:function(event){let flagType=event.target.value;if(this.types[flagType]===void 0){this.selectedType=null,this.createForm="";return}let createFormURL=this.types[flagType].templates.create;jqueryExports.get(CTFd$1.config.urlRoot+createFormURL,template_data=>{const template=nunjucks.compile(template_data);this.selectedType=flagType,this.createForm=template.render(),this.createForm.includes("<script")&&setTimeout(()=>{jqueryExports("<div>"+this.createForm+"</div>").find("script").each(function(){eval(jqueryExports(this).html())})},100)})},loadTypes:function(){CTFd$1.fetch("/api/v1/flags/types",{method:"GET"}).then(e=>e.json()).then(e=>{this.types=e.data})},submitFlag:function(e){let n=jqueryExports(e.target).serializeJSON(!0);n.challenge=this.$props.challenge_id,CTFd$1.fetch("/api/v1/flags",{method:"POST",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(n)}).then(i=>i.json()).then(i=>{this.$emit("refreshFlags",this.$options.name)})}},created(){this.loadTypes()}},_hoisted_1$b={id:"flag-create-modal",class:"modal fade",tabindex:"-1"},_hoisted_2$b={class:"modal-dialog modal-lg"},_hoisted_3$b={class:"modal-content"},_hoisted_4$b=createStaticVNode('<div class="modal-header text-center"><div class="container"><div class="row"><div class="col-md-12"><h3>Create Answer</h3></div></div></div><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">\xD7</span></button></div>',1),_hoisted_5$b={class:"modal-body"},_hoisted_6$a={class:"create-keys-select-div"},_hoisted_7$8=createBaseVNode("label",{for:"create-keys-select",class:"control-label"}," Choose Answer Type ",-1),_hoisted_8$8=createBaseVNode("option",null,"--",-1),_hoisted_9$7=["value"],_hoisted_10$6=createBaseVNode("br",null,null,-1),_hoisted_11$5=["innerHTML"],_hoisted_12$5={key:0,class:"btn btn-secondary float-right",type:"submit"};function _sfc_render$b(e,t,n,i,a,o){return openBlock(),createElementBlock("div",_hoisted_1$b,[createBaseVNode("div",_hoisted_2$b,[createBaseVNode("div",_hoisted_3$b,[_hoisted_4$b,createBaseVNode("div",_hoisted_5$b,[createBaseVNode("div",_hoisted_6$a,[_hoisted_7$8,createBaseVNode("select",{class:"form-control custom-select",onChange:t[0]||(t[0]=s=>o.selectType(s))},[_hoisted_8$8,(openBlock(!0),createElementBlock(Fragment,null,renderList(Object.keys(e.types),s=>(openBlock(),createElementBlock("option",{value:s,key:s},toDisplayString(s),9,_hoisted_9$7))),128))],32)]),_hoisted_10$6,createBaseVNode("form",{onSubmit:t[1]||(t[1]=withModifiers((...s)=>o.submitFlag&&o.submitFlag(...s),["prevent"]))},[createBaseVNode("div",{id:"create-flag-form",innerHTML:e.createForm},null,8,_hoisted_11$5),e.createForm?(openBlock(),createElementBlock("button",_hoisted_12$5," Create Answer ")):createCommentVNode("",!0)],32)])])])])}const FlagCreationForm=_export_sfc(_sfc_main$b,[["render",_sfc_render$b]]),_sfc_main$a={name:"FlagEditForm",props:{flag_id:Number},data:function(){return{flag:{},editForm:""}},watch:{flag_id:{immediate:!0,handler(e,t){e!==null&&this.loadFlag()}}},methods:{loadFlag:function(){CTFd$1.fetch(`/api/v1/flags/${this.$props.flag_id}`,{method:"GET"}).then(e=>e.json()).then(response=>{this.flag=response.data;let editFormURL=this.flag.templates.update;jqueryExports.get(CTFd$1.config.urlRoot+editFormURL,template_data=>{const template=nunjucks.compile(template_data);this.editForm=template.render(this.flag),this.editForm.includes("<script")&&setTimeout(()=>{jqueryExports("<div>"+this.editForm+"</div>").find("script").each(function(){eval(jqueryExports(this).html())})},100)})})},updateFlag:function(e){let n=jqueryExports(e.target).serializeJSON(!0);CTFd$1.fetch(`/api/v1/flags/${this.$props.flag_id}`,{method:"PATCH",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(n)}).then(i=>i.json()).then(i=>{this.$emit("refreshFlags",this.$options.name)})}},mounted(){this.flag_id&&this.loadFlag()},created(){this.flag_id&&this.loadFlag()}},_hoisted_1$a={id:"flag-edit-modal",class:"modal fade",tabindex:"-1"},_hoisted_2$a={class:"modal-dialog modal-lg"},_hoisted_3$a={class:"modal-content"},_hoisted_4$a=createStaticVNode('<div class="modal-header text-center"><div class="container"><div class="row"><div class="col-md-12"><h3 class="text-center">Edit Flag</h3></div></div></div><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">\xD7</span></button></div>',1),_hoisted_5$a={class:"modal-body"},_hoisted_6$9=["innerHTML"];function _sfc_render$a(e,t,n,i,a,o){return openBlock(),createElementBlock("div",_hoisted_1$a,[createBaseVNode("div",_hoisted_2$a,[createBaseVNode("div",_hoisted_3$a,[_hoisted_4$a,createBaseVNode("div",_hoisted_5$a,[createBaseVNode("form",{method:"POST",innerHTML:e.editForm,onSubmit:t[0]||(t[0]=withModifiers((...s)=>o.updateFlag&&o.updateFlag(...s),["prevent"]))},null,40,_hoisted_6$9)])])])])}const FlagEditForm=_export_sfc(_sfc_main$a,[["render",_sfc_render$a]]),_sfc_main$9={components:{FlagCreationForm,FlagEditForm},props:{challenge_id:Number},data:function(){return{flags:[],editing_flag_id:null}},methods:{loadFlags:function(){CTFd$1.fetch(`/api/v1/challenges/${this.$props.challenge_id}/flags`,{method:"GET",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}}).then(e=>e.json()).then(e=>{e.success&&(this.flags=e.data)})},refreshFlags(e){this.loadFlags();let t;switch(e){case"FlagEditForm":t=this.$refs.FlagEditForm.$el,jqueryExports(t).modal("hide");break;case"FlagCreationForm":t=this.$refs.FlagCreationForm.$el,jqueryExports(t).modal("hide");break}},addFlag:function(){let e=this.$refs.FlagCreationForm.$el;jqueryExports(e).modal()},editFlag:function(e){this.editing_flag_id=e;let t=this.$refs.FlagEditForm.$el;jqueryExports(t).modal()},deleteFlag:function(e){confirm("Are you sure you'd like to delete this flag?")&&CTFd$1.fetch(`/api/v1/flags/${e}`,{method:"DELETE"}).then(t=>t.json()).then(t=>{t.success&&this.loadFlags()})}},created(){this.loadFlags()}},_hoisted_1$9={id:"flagsboard",class:"table table-striped"},_hoisted_2$9=createBaseVNode("thead",null,[createBaseVNode("tr",null,[createBaseVNode("td",{class:"text-center"},[createBaseVNode("b",null,"Type")]),createBaseVNode("td",{class:"text-center"},[createBaseVNode("b",null,"Answer")]),createBaseVNode("td",{class:"text-center"},[createBaseVNode("b",null,"Settings")])])],-1),_hoisted_3$9=["name"],_hoisted_4$9={class:"text-center"},_hoisted_5$9={class:"text-break"},_hoisted_6$8={class:"flag-content"},_hoisted_7$7={class:"text-center"},_hoisted_8$7=["flag-id","flag-type","onClick"],_hoisted_9$6=["flag-id","onClick"],_hoisted_10$5=createBaseVNode("td",{class:"text-center"},null,-1),_hoisted_11$4=createBaseVNode("td",{class:"text-break"},null,-1),_hoisted_12$4={class:"text-center"};function _sfc_render$9(e,t,n,i,a,o){const s=resolveComponent("FlagCreationForm"),l=resolveComponent("FlagEditForm");return openBlock(),createElementBlock("div",null,[createBaseVNode("div",null,[createVNode(s,{ref:"FlagCreationForm",challenge_id:n.challenge_id,onRefreshFlags:o.refreshFlags},null,8,["challenge_id","onRefreshFlags"])]),createBaseVNode("div",null,[createVNode(l,{ref:"FlagEditForm",flag_id:e.editing_flag_id,onRefreshFlags:o.refreshFlags},null,8,["flag_id","onRefreshFlags"])]),createBaseVNode("table",_hoisted_1$9,[_hoisted_2$9,createBaseVNode("tbody",null,[(openBlock(!0),createElementBlock(Fragment,null,renderList(e.flags,d=>(openBlock(),createElementBlock("tr",{name:d.id,key:d.id},[createBaseVNode("td",_hoisted_4$9,toDisplayString(d.type),1),createBaseVNode("td",_hoisted_5$9,[createBaseVNode("pre",_hoisted_6$8,toDisplayString(d.content),1)]),createBaseVNode("td",_hoisted_7$7,[createBaseVNode("i",{role:"button",class:"btn-fa fas fa-edit edit-flag","flag-id":d.id,"flag-type":d.type,onClick:r=>o.editFlag(d.id)},null,8,_hoisted_8$7),createBaseVNode("i",{role:"button",class:"btn-fa fas fa-times delete-flag","flag-id":d.id,onClick:r=>o.deleteFlag(d.id)},null,8,_hoisted_9$6)])],8,_hoisted_3$9))),128)),createBaseVNode("tr",null,[_hoisted_10$5,_hoisted_11$4,createBaseVNode("td",_hoisted_12$4,[createBaseVNode("i",{id:"flag-add-button",class:"btn-fa fas fa-plus add-flag",onClick:t[0]||(t[0]=d=>o.addFlag())})])])])])])}const FlagList=_export_sfc(_sfc_main$9,[["render",_sfc_render$9]]),Requirements_vue_vue_type_style_index_0_scoped_3c612631_lang="",_sfc_main$8={props:{challenge_id:Number},data:function(){return{challenges:[],requirements:{},selectedRequirements:[],selectedAnonymize:!1}},computed:{newRequirements:function(){let e=this.requirements.prerequisites||[],t=this.requirements.anonymize||!1,n=JSON.stringify(e.sort())!==JSON.stringify(this.selectedRequirements.sort()),i=t!==this.selectedAnonymize;return n||i},requiredChallenges:function(){const e=this.requirements.prerequisites||[];return this.challenges.filter(t=>t.id!==this.$props.challenge_id&&e.includes(t.id))},otherChallenges:function(){const e=this.requirements.prerequisites||[];return this.challenges.filter(t=>t.id!==this.$props.challenge_id&&!e.includes(t.id))}},methods:{loadChallenges:function(){CTFd$1.fetch("/api/v1/challenges?view=admin",{method:"GET",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}}).then(e=>e.json()).then(e=>{e.success&&(this.challenges=e.data)})},getChallengeNameById:function(e){let t=this.challenges.find(n=>n.id===e);return t?t.name:""},loadRequirements:function(){CTFd$1.fetch(`/api/v1/challenges/${this.$props.challenge_id}/requirements`,{method:"GET",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}}).then(e=>e.json()).then(e=>{e.success&&(this.requirements=e.data||{},this.selectedRequirements=this.requirements.prerequisites||[],this.selectedAnonymize=this.requirements.anonymize||!1)})},updateRequirements:function(){const t={requirements:{prerequisites:this.selectedRequirements}};this.selectedAnonymize&&(t.requirements.anonymize=!0),CTFd$1.fetch(`/api/v1/challenges/${this.$props.challenge_id}`,{method:"PATCH",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t)}).then(n=>n.json()).then(n=>{n.success&&this.loadRequirements()})}},created(){this.loadChallenges(),this.loadRequirements()}},_withScopeId=e=>(pushScopeId("data-v-3c612631"),e=e(),popScopeId(),e),_hoisted_1$8={class:"form-group scrollbox"},_hoisted_2$8={class:"form-check-label cursor-pointer"},_hoisted_3$8=["value"],_hoisted_4$8={class:"form-check-label cursor-pointer"},_hoisted_5$8=["value"],_hoisted_6$7={class:"form-group"},_hoisted_7$6=_withScopeId(()=>createBaseVNode("label",null,[createBaseVNode("b",null,"Behavior if not unlocked")],-1)),_hoisted_8$6=_withScopeId(()=>createBaseVNode("option",{value:!1},"Cach\xE9",-1)),_hoisted_9$5=_withScopeId(()=>createBaseVNode("option",{value:!0},"Anonymized",-1)),_hoisted_10$4=[_hoisted_8$6,_hoisted_9$5],_hoisted_11$3={class:"form-group"},_hoisted_12$3=["disabled"];function _sfc_render$8(e,t,n,i,a,o){return openBlock(),createElementBlock("div",null,[createBaseVNode("form",{onSubmit:t[3]||(t[3]=withModifiers((...s)=>o.updateRequirements&&o.updateRequirements(...s),["prevent"]))},[createBaseVNode("div",_hoisted_1$8,[createVNode(TransitionGroup,{name:"flip-list"},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(o.requiredChallenges,s=>(openBlock(),createElementBlock("div",{class:"form-check",key:s.id},[createBaseVNode("label",_hoisted_2$8,[withDirectives(createBaseVNode("input",{class:"form-check-input",type:"checkbox",value:s.id,"onUpdate:modelValue":t[0]||(t[0]=l=>e.selectedRequirements=l)},null,8,_hoisted_3$8),[[vModelCheckbox,e.selectedRequirements]]),createTextVNode(" "+toDisplayString(s.name),1)])]))),128)),(openBlock(!0),createElementBlock(Fragment,null,renderList(o.otherChallenges,s=>(openBlock(),createElementBlock("div",{class:"form-check",key:s.id},[createBaseVNode("label",_hoisted_4$8,[withDirectives(createBaseVNode("input",{class:"form-check-input",type:"checkbox",value:s.id,"onUpdate:modelValue":t[1]||(t[1]=l=>e.selectedRequirements=l)},null,8,_hoisted_5$8),[[vModelCheckbox,e.selectedRequirements]]),createTextVNode(" "+toDisplayString(s.name),1)])]))),128))]),_:1})]),createBaseVNode("div",_hoisted_6$7,[_hoisted_7$6,withDirectives(createBaseVNode("select",{class:"form-control custom-select",name:"anonymize","onUpdate:modelValue":t[2]||(t[2]=s=>e.selectedAnonymize=s)},_hoisted_10$4,512),[[vModelSelect,e.selectedAnonymize]])]),createBaseVNode("div",_hoisted_11$3,[createBaseVNode("button",{class:"btn btn-success float-right",disabled:!o.newRequirements}," Save ",8,_hoisted_12$3)])],32)])}const Requirements=_export_sfc(_sfc_main$8,[["render",_sfc_render$8],["__scopeId","data-v-3c612631"]]),_sfc_main$7={props:{challenge_id:Number},data:function(){return{topics:[],topicValue:"",searchedTopic:"",topicResults:[],selectedResultIdx:0,awaitingSearch:!1}},methods:{loadTopics:function(){CTFd$1.fetch(`/api/v1/challenges/${this.$props.challenge_id}/topics`,{method:"GET",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}}).then(e=>e.json()).then(e=>{e.success&&(this.topics=e.data)})},searchTopics:function(){if(this.selectedResultIdx=0,this.topicValue==""){this.topicResults=[];return}CTFd$1.fetch(`/api/v1/topics?field=value&q=${this.topicValue}`,{method:"GET",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}}).then(e=>e.json()).then(e=>{e.success&&(this.topicResults=e.data.slice(0,10))})},addTopic:function(){let e;if(this.selectedResultIdx===0)e=this.topicValue;else{let n=this.selectedResultIdx-1;e=this.topicResults[n].value}const t={value:e,challenge:this.$props.challenge_id,type:"challenge"};CTFd$1.fetch("/api/v1/topics",{method:"POST",body:JSON.stringify(t)}).then(n=>n.json()).then(n=>{n.success&&(this.topicValue="",this.loadTopics())})},deleteTopic:function(e){CTFd$1.fetch(`/api/v1/topics?type=challenge&target_id=${e}`,{method:"DELETE"}).then(t=>t.json()).then(t=>{t.success&&this.loadTopics()})},moveCursor:function(e){switch(e){case"up":this.selectedResultIdx&&(this.selectedResultIdx-=1);break;case"down":this.selectedResultIdx<this.topicResults.length&&(this.selectedResultIdx+=1);break}},selectTopic:function(e){e===void 0&&(e=this.selectedResultIdx);let t=this.topicResults[e];this.topicValue=t.value}},watch:{topicValue:function(e){this.awaitingSearch===!1&&setTimeout(()=>{this.searchTopics(),this.awaitingSearch=!1},500),this.awaitingSearch=!0}},created(){this.loadTopics()}},_hoisted_1$7={class:"col-md-12"},_hoisted_2$7={id:"challenge-topics",class:"my-3"},_hoisted_3$7={class:"mr-1"},_hoisted_4$7=["onClick"],_hoisted_5$7={class:"form-group"},_hoisted_6$6=createBaseVNode("label",null,[createTextVNode(" Topic "),createBaseVNode("br"),createBaseVNode("small",{class:"text-muted"},"Type topic and press Enter")],-1),_hoisted_7$5={class:"form-group"},_hoisted_8$5={class:"list-group"},_hoisted_9$4=["onClick"];function _sfc_render$7(e,t,n,i,a,o){return openBlock(),createElementBlock("div",_hoisted_1$7,[createBaseVNode("div",_hoisted_2$7,[(openBlock(!0),createElementBlock(Fragment,null,renderList(e.topics,s=>(openBlock(),createElementBlock("h5",{class:"challenge-tag",key:s.id},[createBaseVNode("span",_hoisted_3$7,toDisplayString(s.value),1),createBaseVNode("a",{class:"btn-fa delete-tag",onClick:l=>o.deleteTopic(s.id)}," \xD7",8,_hoisted_4$7)]))),128))]),createBaseVNode("div",_hoisted_5$7,[_hoisted_6$6,withDirectives(createBaseVNode("input",{id:"tags-add-input",maxlength:"255",type:"text",class:"form-control","onUpdate:modelValue":t[0]||(t[0]=s=>e.topicValue=s),onKeyup:[t[1]||(t[1]=withKeys(s=>o.moveCursor("down"),["down"])),t[2]||(t[2]=withKeys(s=>o.moveCursor("up"),["up"])),t[3]||(t[3]=withKeys(s=>o.addTopic(),["enter"]))]},null,544),[[vModelText,e.topicValue]])]),createBaseVNode("div",_hoisted_7$5,[createBaseVNode("ul",_hoisted_8$5,[(openBlock(!0),createElementBlock(Fragment,null,renderList(e.topicResults,(s,l)=>(openBlock(),createElementBlock("li",{class:normalizeClass({"list-group-item":!0,active:l+1===e.selectedResultIdx}),key:s.id,onClick:d=>o.selectTopic(l)},toDisplayString(s.value),11,_hoisted_9$4))),128))])])])}const TopicsList=_export_sfc(_sfc_main$7,[["render",_sfc_render$7]]),_sfc_main$6={props:{challenge_id:Number},data:function(){return{tags:[],tagValue:""}},methods:{loadTags:function(){CTFd$1.fetch(`/api/v1/challenges/${this.$props.challenge_id}/tags`,{method:"GET",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}}).then(e=>e.json()).then(e=>{e.success&&(this.tags=e.data)})},addTag:function(){if(this.tagValue){const e={value:this.tagValue,challenge:this.$props.challenge_id};CTFd$1.api.post_tag_list({},e).then(t=>{t.success&&(this.tagValue="",this.loadTags())})}},deleteTag:function(e){CTFd$1.api.delete_tag({tagId:e}).then(t=>{t.success&&this.loadTags()})}},created(){this.loadTags()}},_hoisted_1$6={class:"col-md-12"},_hoisted_2$6={id:"challenge-tags",class:"my-3"},_hoisted_3$6=["onClick"],_hoisted_4$6={class:"form-group"},_hoisted_5$6=createBaseVNode("label",null,[createTextVNode("Tag "),createBaseVNode("br"),createBaseVNode("small",{class:"text-muted"},"Type tag and press Enter")],-1);function _sfc_render$6(e,t,n,i,a,o){return openBlock(),createElementBlock("div",_hoisted_1$6,[createBaseVNode("div",_hoisted_2$6,[(openBlock(!0),createElementBlock(Fragment,null,renderList(e.tags,s=>(openBlock(),createElementBlock("span",{class:"badge badge-primary mx-1 challenge-tag",key:s.id},[createBaseVNode("span",null,toDisplayString(s.value),1),createBaseVNode("a",{class:"btn-fa delete-tag",onClick:l=>o.deleteTag(s.id)}," \xD7",8,_hoisted_3$6)]))),128))]),createBaseVNode("div",_hoisted_4$6,[_hoisted_5$6,withDirectives(createBaseVNode("input",{id:"tags-add-input",maxlength:"80",type:"text",class:"form-control","onUpdate:modelValue":t[0]||(t[0]=s=>e.tagValue=s),onKeyup:t[1]||(t[1]=withKeys(s=>o.addTag(),["enter"]))},null,544),[[vModelText,e.tagValue]])])])}const TagsList=_export_sfc(_sfc_main$6,[["render",_sfc_render$6]]),_sfc_main$5={props:{challenge_id:Number},data:function(){return{files:[],urlRoot:CTFd$1.config.urlRoot}},methods:{loadFiles:function(){CTFd$1.fetch(`/api/v1/challenges/${this.$props.challenge_id}/files`,{method:"GET"}).then(e=>e.json()).then(e=>{e.success&&(this.files=e.data)})},addFiles:function(){let e={challenge:this.$props.challenge_id,type:"challenge"},t=this.$refs.FileUploadForm;helpers.files.upload(t,e,n=>{setTimeout(()=>{this.loadFiles()},700)})},deleteFile:function(e){ezQuery({title:"Delete Files",body:"\xCAtes-vous certain de vouloir supprimer this file?",success:()=>{CTFd$1.fetch(`/api/v1/files/${e}`,{method:"DELETE"}).then(t=>t.json()).then(t=>{t.success&&this.loadFiles()})}})}},created(){this.loadFiles()}},_hoisted_1$5={id:"filesboard",class:"table table-striped"},_hoisted_2$5=createBaseVNode("thead",null,[createBaseVNode("tr",null,[createBaseVNode("td",{class:"text-center"},[createBaseVNode("b",null,"File")]),createBaseVNode("td",{class:"text-center"},[createBaseVNode("b",null,"Settings")])])],-1),_hoisted_3$5={class:"text-center"},_hoisted_4$5=["href"],_hoisted_5$5={class:"text-center"},_hoisted_6$5=["onClick"],_hoisted_7$4={class:"col-md-12 mt-3"},_hoisted_8$4=createStaticVNode('<div class="form-group"><input class="form-control-file" id="file" multiple="" name="file" required="" type="file"><sub class="text-muted"> Attach multiple files using CTRL+Click or Cmd+Click. </sub></div><div class="form-group"><input class="btn btn-success float-right" id="_submit" name="_submit" type="submit" value="Upload"></div>',2),_hoisted_10$3=[_hoisted_8$4];function _sfc_render$5(e,t,n,i,a,o){return openBlock(),createElementBlock("div",null,[createBaseVNode("table",_hoisted_1$5,[_hoisted_2$5,createBaseVNode("tbody",null,[(openBlock(!0),createElementBlock(Fragment,null,renderList(e.files,s=>(openBlock(),createElementBlock("tr",{key:s.id},[createBaseVNode("td",_hoisted_3$5,[createBaseVNode("a",{href:`${e.urlRoot}/files/${s.location}`},toDisplayString(s.location.split("/").pop()),9,_hoisted_4$5)]),createBaseVNode("td",_hoisted_5$5,[createBaseVNode("i",{role:"button",class:"btn-fa fas fa-times delete-file",onClick:l=>o.deleteFile(s.id)},null,8,_hoisted_6$5)])]))),128))])]),createBaseVNode("div",_hoisted_7$4,[createBaseVNode("form",{method:"POST",ref:"FileUploadForm",onSubmit:t[0]||(t[0]=withModifiers((...s)=>o.addFiles&&o.addFiles(...s),["prevent"]))},_hoisted_10$3,544)])])}const ChallengeFilesList=_export_sfc(_sfc_main$5,[["render",_sfc_render$5]]),_sfc_main$4={props:{challengeId:Number,challengeName:String,CHALLENGE_THUMBSNAIL:String},data:function(){return{files:[],urlRoot:CTFd$1.config.urlRoot}},methods:{updateThumbsnailPath(e){CTFd$1.fetch(`/api/v1/challenges/${CHALLENGE_ID}/thumbsnail`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({thumbsnail:e})}).then(t=>t.json()).then(t=>{t.success?console.log("Thumbsnail path updated successfully."):console.error("Failed to update thumbsnail path:",t.message)})}},mounted(){document.getElementById("btn-file-input").style.display="block",document.getElementById("btn-file-input").addEventListener("click",()=>{document.getElementById("thumbsnail-get-path").click()}),document.getElementById("thumbsnail-get-path").addEventListener("change",e=>{const t=e.target.files[0];let n=document.getElementById("thumbsnail-upload-form");const i=new FormData(n);if(i.append("file",t),helpers.files.upload(i,n,a=>{const o=a.data[0],s=CTFd$1.config.urlRoot+"/files/"+o.location;document.getElementById("thumbsnail-path").value=s,console.log("Thumbnail uploaded successfully:",s);const l=document.getElementById("image-preview");l.src=s,l.style.display="block",this.updateThumbsnailPath(s)}),t){const a=new FileReader;a.onload=function(o){const s=document.getElementById("image-preview");s.src=o.target.result,s.style.display="block"},a.readAsDataURL(t)}})}},_hoisted_1$4={id:"Thumbsnailboard",class:"table table-striped"},_hoisted_2$4=createBaseVNode("thead",null,[createBaseVNode("tr",null,[createBaseVNode("td",{class:"text-center"},[createBaseVNode("b",null,"Miniature")]),createBaseVNode("td",{class:"text-center"},[createBaseVNode("b",null,"Settings")])])],-1),_hoisted_3$4={class:"text-center"},_hoisted_4$4=["href"],_hoisted_5$4={class:"text-center"},_hoisted_6$4=["onClick"],_hoisted_7$3={class:"col-md-12 mt-3"},_hoisted_8$3={id:"thumbsnail-upload-form",class:"form-upload",method:"POST",enctype:"multipart/form-data"},_hoisted_9$3=createBaseVNode("button",{id:"btn-file-input",class:"btn btn-secondary",type:"button"},"Select File",-1),_hoisted_10$2=["src"],_hoisted_11$2=createBaseVNode("input",{class:"form-control-file",id:"thumbsnail-get-path",name:"file",type:"file",accept:".png",style:{display:"none"}},null,-1),_hoisted_12$2=createBaseVNode("input",{type:"hidden",id:"thumbsnail-path",name:"thumbsnail"},null,-1);function _sfc_render$4(e,t,n,i,a,o){return openBlock(),createElementBlock("div",null,[createBaseVNode("table",_hoisted_1$4,[_hoisted_2$4,createBaseVNode("tbody",null,[(openBlock(!0),createElementBlock(Fragment,null,renderList(e.files,s=>(openBlock(),createElementBlock("tr",{key:s.id},[createBaseVNode("td",_hoisted_3$4,[createBaseVNode("a",{href:`${e.urlRoot}/files/${s.location}`},toDisplayString(s.location.split("/").pop()),9,_hoisted_4$4)]),createBaseVNode("td",_hoisted_5$4,[createBaseVNode("i",{role:"button",class:"btn-fa fas fa-times delete-file",onClick:l=>e.deleteFile(s.id)},null,8,_hoisted_6$4)])]))),128))])]),createBaseVNode("div",_hoisted_7$3,[createBaseVNode("form",_hoisted_8$3,[_hoisted_9$3,withDirectives(createBaseVNode("img",{id:"image-preview",src:n.CHALLENGE_THUMBSNAIL,style:{width:"100px",height:"100px","margin-top":"10px"}},null,8,_hoisted_10$2),[[vShow,n.CHALLENGE_THUMBSNAIL]]),_hoisted_11$2,_hoisted_12$2])])])}const ChallengeThumbsnail=_export_sfc(_sfc_main$4,[["render",_sfc_render$4]]),_sfc_main$3={name:"HintCreationForm",props:{challenge_id:Number,hints:Array},data:function(){return{cost:0,selectedHints:[]}},methods:{getCost:function(){return this.cost||0},getContent:function(){return this.$refs.content.value},submitHint:function(){let e={challenge_id:this.$props.challenge_id,content:this.getContent(),cost:this.getCost(),requirements:{prerequisites:this.selectedHints}};CTFd.fetch("/api/v1/hints",{method:"POST",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e)}).then(t=>t.json()).then(t=>{t.success&&this.$emit("refreshHints",this.$options.name)})}}},_hoisted_1$3={class:"modal fade",tabindex:"-1"},_hoisted_2$3={class:"modal-dialog"},_hoisted_3$3={class:"modal-content"},_hoisted_4$3=createStaticVNode('<div class="modal-header text-center"><div class="container"><div class="row"><div class="col-md-12"><h3>Hint</h3></div></div></div><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">\xD7</span></button></div>',1),_hoisted_5$3={class:"modal-body"},_hoisted_6$3={class:"container"},_hoisted_7$2={class:"row"},_hoisted_8$2={class:"col-md-12"},_hoisted_9$2={class:"form-group"},_hoisted_10$1=createBaseVNode("label",null,[createTextVNode(" Hint"),createBaseVNode("br"),createBaseVNode("small",null,"Markdown & HTML are supported")],-1),_hoisted_11$1={type:"text",class:"form-control markdown",name:"content",rows:"7",ref:"content"},_hoisted_12$1={class:"form-group"},_hoisted_13$1=createBaseVNode("label",null,[createTextVNode(" Cost"),createBaseVNode("br"),createBaseVNode("small",null,"How many points it costs to see your hint.")],-1),_hoisted_14$1={class:"form-group"},_hoisted_15$1=createBaseVNode("label",null,[createTextVNode(" Requirements"),createBaseVNode("br"),createBaseVNode("small",null,"Hints that must be unlocked before unlocking this hint")],-1),_hoisted_16$1={class:"form-check-label cursor-pointer"},_hoisted_17$1=["value"],_hoisted_18$1=createBaseVNode("input",{type:"hidden",id:"hint-id-for-hint",name:"id"},null,-1),_hoisted_19=createStaticVNode('<div class="modal-footer"><div class="container"><div class="row"><div class="col-md-12"><button class="btn btn-primary float-right">Submit</button></div></div></div></div>',1);function _sfc_render$3(e,t,n,i,a,o){return openBlock(),createElementBlock("div",_hoisted_1$3,[createBaseVNode("div",_hoisted_2$3,[createBaseVNode("div",_hoisted_3$3,[_hoisted_4$3,createBaseVNode("form",{method:"POST",onSubmit:t[2]||(t[2]=withModifiers((...s)=>o.submitHint&&o.submitHint(...s),["prevent"]))},[createBaseVNode("div",_hoisted_5$3,[createBaseVNode("div",_hoisted_6$3,[createBaseVNode("div",_hoisted_7$2,[createBaseVNode("div",_hoisted_8$2,[createBaseVNode("div",_hoisted_9$2,[_hoisted_10$1,createBaseVNode("textarea",_hoisted_11$1,null,512)]),createBaseVNode("div",_hoisted_12$1,[_hoisted_13$1,withDirectives(createBaseVNode("input",{type:"number",class:"form-control",name:"cost","onUpdate:modelValue":t[0]||(t[0]=s=>e.cost=s)},null,512),[[vModelText,e.cost,void 0,{lazy:!0}]])]),createBaseVNode("div",_hoisted_14$1,[_hoisted_15$1,(openBlock(!0),createElementBlock(Fragment,null,renderList(n.hints,s=>(openBlock(),createElementBlock("div",{class:"form-check",key:s.id},[createBaseVNode("label",_hoisted_16$1,[withDirectives(createBaseVNode("input",{class:"form-check-input",type:"checkbox",value:s.id,"onUpdate:modelValue":t[1]||(t[1]=l=>e.selectedHints=l)},null,8,_hoisted_17$1),[[vModelCheckbox,e.selectedHints]]),createTextVNode(" "+toDisplayString(s.cost)+" - "+toDisplayString(s.id),1)])]))),128))]),_hoisted_18$1])])])]),_hoisted_19],32)])])])}const HintCreationForm=_export_sfc(_sfc_main$3,[["render",_sfc_render$3]]),_sfc_main$2={name:"HintEditForm",props:{challenge_id:Number,hint_id:Number,hints:Array},data:function(){return{cost:0,content:null,selectedHints:[]}},computed:{otherHints:function(){return this.hints.filter(e=>e.id!==this.$props.hint_id)}},watch:{hint_id:{immediate:!0,handler(e,t){e!==null&&this.loadHint()}}},methods:{loadHint:function(){CTFd$1.fetch(`/api/v1/hints/${this.$props.hint_id}?preview=true`,{method:"GET",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}}).then(e=>e.json()).then(e=>{var t;if(e.success){let n=e.data;this.cost=n.cost,this.content=n.content,this.selectedHints=((t=n.requirements)==null?void 0:t.prerequisites)||[];let i=this.$refs.content;bindMarkdownEditor(i),setTimeout(()=>{i.mde.codemirror.getDoc().setValue(i.value),this._forceRefresh()},200)}})},_forceRefresh:function(){this.$refs.content.mde.codemirror.refresh()},getCost:function(){return this.cost||0},getContent:function(){return this._forceRefresh(),this.$refs.content.mde.codemirror.getDoc().getValue()},updateHint:function(){let e={challenge_id:this.$props.challenge_id,content:this.getContent(),cost:this.getCost(),requirements:{prerequisites:this.selectedHints}};CTFd$1.fetch(`/api/v1/hints/${this.$props.hint_id}`,{method:"PATCH",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e)}).then(t=>t.json()).then(t=>{t.success&&this.$emit("refreshHints",this.$options.name)})}},mounted(){this.hint_id&&this.loadHint()},created(){this.hint_id&&this.loadHint()}},_hoisted_1$2={class:"modal fade",tabindex:"-1"},_hoisted_2$2={class:"modal-dialog"},_hoisted_3$2={class:"modal-content"},_hoisted_4$2=createStaticVNode('<div class="modal-header text-center"><div class="container"><div class="row"><div class="col-md-12"><h3>Hint</h3></div></div></div><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">\xD7</span></button></div>',1),_hoisted_5$2={class:"modal-body"},_hoisted_6$2={class:"container"},_hoisted_7$1={class:"row"},_hoisted_8$1={class:"col-md-12"},_hoisted_9$1={class:"form-group"},_hoisted_10=createBaseVNode("label",null,[createTextVNode(" Hint"),createBaseVNode("br"),createBaseVNode("small",null,"Markdown & HTML are supported")],-1),_hoisted_11=["value"],_hoisted_12={class:"form-group"},_hoisted_13=createBaseVNode("label",null,[createTextVNode(" Cost"),createBaseVNode("br"),createBaseVNode("small",null,"How many points it costs to see your hint.")],-1),_hoisted_14={class:"form-group"},_hoisted_15=createBaseVNode("label",null,[createTextVNode(" Requirements"),createBaseVNode("br"),createBaseVNode("small",null,"Hints that must be unlocked before unlocking this hint")],-1),_hoisted_16={class:"form-check-label cursor-pointer"},_hoisted_17=["value"],_hoisted_18=createStaticVNode('<div class="modal-footer"><div class="container"><div class="row"><div class="col-md-12"><button class="btn btn-primary float-right">Submit</button></div></div></div></div>',1);function _sfc_render$2(e,t,n,i,a,o){return openBlock(),createElementBlock("div",_hoisted_1$2,[createBaseVNode("div",_hoisted_2$2,[createBaseVNode("div",_hoisted_3$2,[_hoisted_4$2,createBaseVNode("form",{method:"POST",onSubmit:t[2]||(t[2]=withModifiers((...s)=>o.updateHint&&o.updateHint(...s),["prevent"]))},[createBaseVNode("div",_hoisted_5$2,[createBaseVNode("div",_hoisted_6$2,[createBaseVNode("div",_hoisted_7$1,[createBaseVNode("div",_hoisted_8$1,[createBaseVNode("div",_hoisted_9$1,[_hoisted_10,createBaseVNode("textarea",{type:"text",class:"form-control",name:"content",rows:"7",value:this.content,ref:"content"},null,8,_hoisted_11)]),createBaseVNode("div",_hoisted_12,[_hoisted_13,withDirectives(createBaseVNode("input",{type:"number",class:"form-control",name:"cost","onUpdate:modelValue":t[0]||(t[0]=s=>e.cost=s)},null,512),[[vModelText,e.cost,void 0,{lazy:!0}]])]),createBaseVNode("div",_hoisted_14,[_hoisted_15,(openBlock(!0),createElementBlock(Fragment,null,renderList(o.otherHints,s=>(openBlock(),createElementBlock("div",{class:"form-check",key:s.id},[createBaseVNode("label",_hoisted_16,[withDirectives(createBaseVNode("input",{class:"form-check-input",type:"checkbox",value:s.id,"onUpdate:modelValue":t[1]||(t[1]=l=>e.selectedHints=l)},null,8,_hoisted_17),[[vModelCheckbox,e.selectedHints]]),createTextVNode(" "+toDisplayString(s.content)+" - "+toDisplayString(s.cost),1)])]))),128))])])])])]),_hoisted_18],32)])])])}const HintEditForm=_export_sfc(_sfc_main$2,[["render",_sfc_render$2]]),_sfc_main$1={components:{HintCreationForm,HintEditForm},props:{challenge_id:Number},data:function(){return{hints:[],editing_hint_id:null}},methods:{loadHints:async function(){let t=await(await CTFd$1.fetch(`/api/v1/challenges/${this.$props.challenge_id}/hints`,{method:"GET",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}})).json();return this.hints=t.data,t.success},addHint:function(){let e=this.$refs.HintCreationForm.$el;$(e).modal()},editHint:function(e){this.editing_hint_id=e;let t=this.$refs.HintEditForm.$el;$(t).modal()},refreshHints:function(e){this.loadHints().then(t=>{if(t){let n;switch(e){case"HintCreationForm":n=this.$refs.HintCreationForm.$el,console.log(n),$(n).modal("hide");break;case"HintEditForm":n=this.$refs.HintEditForm.$el,$(n).modal("hide");break}}else alert("An error occurred while updating this hint. Please try again.")})},deleteHint:function(e){ezQuery({title:"Delete Hint",body:"\xCAtes-vous certain de vouloir supprimer this hint?",success:()=>{CTFd$1.fetch(`/api/v1/hints/${e}`,{method:"DELETE"}).then(t=>t.json()).then(t=>{t.success&&this.loadHints()})}})}},created(){this.loadHints()}},_hoisted_1$1={class:"table table-striped"},_hoisted_2$1=createBaseVNode("thead",null,[createBaseVNode("tr",null,[createBaseVNode("td",{class:"text-center"},[createBaseVNode("b",null,"ID")]),createBaseVNode("td",{class:"text-center"},[createBaseVNode("b",null,"Hint")]),createBaseVNode("td",{class:"text-center"},[createBaseVNode("b",null,"Cost")]),createBaseVNode("td",{class:"text-center"},[createBaseVNode("b",null,"Settings")])])],-1),_hoisted_3$1={class:"text-center"},_hoisted_4$1={class:"text-break"},_hoisted_5$1={class:"text-center"},_hoisted_6$1={class:"text-center"},_hoisted_7=["onClick"],_hoisted_8=["onClick"],_hoisted_9={class:"col-md-12"};function _sfc_render$1(e,t,n,i,a,o){const s=resolveComponent("HintCreationForm"),l=resolveComponent("HintEditForm");return openBlock(),createElementBlock("div",null,[createBaseVNode("div",null,[createVNode(s,{ref:"HintCreationForm",challenge_id:n.challenge_id,hints:e.hints,onRefreshHints:o.refreshHints},null,8,["challenge_id","hints","onRefreshHints"])]),createBaseVNode("div",null,[createVNode(l,{ref:"HintEditForm",challenge_id:n.challenge_id,hint_id:e.editing_hint_id,hints:e.hints,onRefreshHints:o.refreshHints},null,8,["challenge_id","hint_id","hints","onRefreshHints"])]),createBaseVNode("table",_hoisted_1$1,[_hoisted_2$1,createBaseVNode("tbody",null,[(openBlock(!0),createElementBlock(Fragment,null,renderList(e.hints,d=>(openBlock(),createElementBlock("tr",{key:d.id},[createBaseVNode("td",_hoisted_3$1,toDisplayString(d.type),1),createBaseVNode("td",_hoisted_4$1,[createBaseVNode("pre",null,toDisplayString(d.content),1)]),createBaseVNode("td",_hoisted_5$1,toDisplayString(d.cost),1),createBaseVNode("td",_hoisted_6$1,[createBaseVNode("i",{role:"button",class:"btn-fa fas fa-edit",onClick:r=>o.editHint(d.id)},null,8,_hoisted_7),createBaseVNode("i",{role:"button",class:"btn-fa fas fa-times",onClick:r=>o.deleteHint(d.id)},null,8,_hoisted_8)])]))),128))])]),createBaseVNode("div",_hoisted_9,[createBaseVNode("button",{class:"btn btn-success float-right",onClick:t[0]||(t[0]=(...d)=>o.addHint&&o.addHint(...d))}," Create Hint ")])])}const HintsList=_export_sfc(_sfc_main$1,[["render",_sfc_render$1]]),_sfc_main={props:{challenge_id:Number},data:function(){return{challenge:null,challenges:[],selected_id:null}},computed:{updateAvailable:function(){return this.challenge?this.selected_id!=this.challenge.next_id:!1},otherChallenges:function(){return this.challenges.filter(e=>e.id!==this.$props.challenge_id)}},methods:{loadData:function(){CTFd$1.fetch(`/api/v1/challenges/${this.$props.challenge_id}`,{method:"GET",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}}).then(e=>e.json()).then(e=>{e.success&&(this.challenge=e.data,this.selected_id=e.data.next_id)})},loadChallenges:function(){CTFd$1.fetch("/api/v1/challenges?view=admin",{method:"GET",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}}).then(e=>e.json()).then(e=>{e.success&&(this.challenges=e.data)})},updateNext:function(){CTFd$1.fetch(`/api/v1/challenges/${this.$props.challenge_id}`,{method:"PATCH",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({next_id:this.selected_id!="null"?this.selected_id:null})}).then(e=>e.json()).then(e=>{e.success&&(this.loadData(),this.loadChallenges())})}},created(){this.loadData(),this.loadChallenges()}},_hoisted_1={class:"form-group"},_hoisted_2=createBaseVNode("label",null,[createTextVNode(" Next Challenge "),createBaseVNode("br"),createBaseVNode("small",{class:"text-muted"},"Challenge to recommend after solving this challenge")],-1),_hoisted_3=createBaseVNode("option",{value:"null"},"--",-1),_hoisted_4=["value"],_hoisted_5={class:"form-group"},_hoisted_6=["disabled"];function _sfc_render(e,t,n,i,a,o){return openBlock(),createElementBlock("div",null,[createBaseVNode("form",{onSubmit:t[1]||(t[1]=withModifiers((...s)=>o.updateNext&&o.updateNext(...s),["prevent"]))},[createBaseVNode("div",_hoisted_1,[_hoisted_2,withDirectives(createBaseVNode("select",{class:"form-control custom-select","onUpdate:modelValue":t[0]||(t[0]=s=>e.selected_id=s)},[_hoisted_3,(openBlock(!0),createElementBlock(Fragment,null,renderList(o.otherChallenges,s=>(openBlock(),createElementBlock("option",{value:s.id,key:s.id},toDisplayString(s.name),9,_hoisted_4))),128))],512),[[vModelSelect,e.selected_id]])]),createBaseVNode("div",_hoisted_5,[createBaseVNode("button",{class:"btn btn-success float-right",disabled:!o.updateAvailable}," Save ",8,_hoisted_6)])],32)])}const NextChallenge=_export_sfc(_sfc_main,[["render",_sfc_render]]);function loadChalTemplate(e){CTFd$1._internal.challenge={},jqueryExports.getScript(CTFd$1.config.urlRoot+e.scripts.view,function(){let t=e.create;jqueryExports("#create-chal-entry-div").html(t),bindMarkdownEditors(),jqueryExports.getScript(CTFd$1.config.urlRoot+e.scripts.create,function(){jqueryExports("#create-chal-entry-div form").submit(function(n){n.preventDefault();const i=jqueryExports("#create-chal-entry-div form").serializeJSON();CTFd$1.fetch("/api/v1/challenges",{method:"POST",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(i)}).then(function(a){return a.json()}).then(function(a){if(a.success)jqueryExports("#challenge-create-options #challenge_id").val(a.data.id),jqueryExports("#challenge-create-options").modal();else{let o="";for(const s in a.errors)o+=a.errors[s].join(` +import{_ as _export_sfc,j as jqueryExports,C as CTFd$1,n as nunjucks,o as openBlock,c as createElementBlock,a as createBaseVNode,F as Fragment,r as renderList,t as toDisplayString,w as withModifiers,b as createCommentVNode,d as createStaticVNode,e as resolveComponent,f as createVNode,g as withCtx,T as TransitionGroup,h as withDirectives,v as vModelSelect,i as vModelCheckbox,k as createTextVNode,p as pushScopeId,l as popScopeId,m as vModelText,q as withKeys,s as normalizeClass,u as helpers,x as ezQuery,y as vShow,z as bindMarkdownEditor,A as htmlEntities,V as Vue$1,B as bindMarkdownEditors,D as ezAlert,E as ezToast}from"./main.b0151f5b.js";import"../tab.12dd2b64.js";import{C as CommentBox}from"../CommentBox.d3cef9cd.js";const _sfc_main$b={name:"FlagCreationForm",props:{challenge_id:Number},data:function(){return{types:{},selectedType:null,createForm:""}},methods:{selectType:function(event){let flagType=event.target.value;if(this.types[flagType]===void 0){this.selectedType=null,this.createForm="";return}let createFormURL=this.types[flagType].templates.create;jqueryExports.get(CTFd$1.config.urlRoot+createFormURL,template_data=>{const template=nunjucks.compile(template_data);this.selectedType=flagType,this.createForm=template.render(),this.createForm.includes("<script")&&setTimeout(()=>{jqueryExports("<div>"+this.createForm+"</div>").find("script").each(function(){eval(jqueryExports(this).html())})},100)})},loadTypes:function(){CTFd$1.fetch("/api/v1/flags/types",{method:"GET"}).then(e=>e.json()).then(e=>{this.types=e.data})},submitFlag:function(e){let n=jqueryExports(e.target).serializeJSON(!0);n.challenge=this.$props.challenge_id,CTFd$1.fetch("/api/v1/flags",{method:"POST",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(n)}).then(i=>i.json()).then(i=>{this.$emit("refreshFlags",this.$options.name)})}},created(){this.loadTypes()}},_hoisted_1$b={id:"flag-create-modal",class:"modal fade",tabindex:"-1"},_hoisted_2$b={class:"modal-dialog modal-lg"},_hoisted_3$b={class:"modal-content"},_hoisted_4$b=createStaticVNode('<div class="modal-header text-center"><div class="container"><div class="row"><div class="col-md-12"><h3>Create Answer</h3></div></div></div><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">\xD7</span></button></div>',1),_hoisted_5$b={class:"modal-body"},_hoisted_6$a={class:"create-keys-select-div"},_hoisted_7$8=createBaseVNode("label",{for:"create-keys-select",class:"control-label"}," Choose Answer Type ",-1),_hoisted_8$8=createBaseVNode("option",null,"--",-1),_hoisted_9$7=["value"],_hoisted_10$6=createBaseVNode("br",null,null,-1),_hoisted_11$5=["innerHTML"],_hoisted_12$5={key:0,class:"btn btn-secondary float-right",type:"submit"};function _sfc_render$b(e,t,n,i,a,o){return openBlock(),createElementBlock("div",_hoisted_1$b,[createBaseVNode("div",_hoisted_2$b,[createBaseVNode("div",_hoisted_3$b,[_hoisted_4$b,createBaseVNode("div",_hoisted_5$b,[createBaseVNode("div",_hoisted_6$a,[_hoisted_7$8,createBaseVNode("select",{class:"form-control custom-select",onChange:t[0]||(t[0]=s=>o.selectType(s))},[_hoisted_8$8,(openBlock(!0),createElementBlock(Fragment,null,renderList(Object.keys(e.types),s=>(openBlock(),createElementBlock("option",{value:s,key:s},toDisplayString(s),9,_hoisted_9$7))),128))],32)]),_hoisted_10$6,createBaseVNode("form",{onSubmit:t[1]||(t[1]=withModifiers((...s)=>o.submitFlag&&o.submitFlag(...s),["prevent"]))},[createBaseVNode("div",{id:"create-flag-form",innerHTML:e.createForm},null,8,_hoisted_11$5),e.createForm?(openBlock(),createElementBlock("button",_hoisted_12$5," Create Answer ")):createCommentVNode("",!0)],32)])])])])}const FlagCreationForm=_export_sfc(_sfc_main$b,[["render",_sfc_render$b]]),_sfc_main$a={name:"FlagEditForm",props:{flag_id:Number},data:function(){return{flag:{},editForm:""}},watch:{flag_id:{immediate:!0,handler(e,t){e!==null&&this.loadFlag()}}},methods:{loadFlag:function(){CTFd$1.fetch(`/api/v1/flags/${this.$props.flag_id}`,{method:"GET"}).then(e=>e.json()).then(response=>{this.flag=response.data;let editFormURL=this.flag.templates.update;jqueryExports.get(CTFd$1.config.urlRoot+editFormURL,template_data=>{const template=nunjucks.compile(template_data);this.editForm=template.render(this.flag),this.editForm.includes("<script")&&setTimeout(()=>{jqueryExports("<div>"+this.editForm+"</div>").find("script").each(function(){eval(jqueryExports(this).html())})},100)})})},updateFlag:function(e){let n=jqueryExports(e.target).serializeJSON(!0);CTFd$1.fetch(`/api/v1/flags/${this.$props.flag_id}`,{method:"PATCH",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(n)}).then(i=>i.json()).then(i=>{this.$emit("refreshFlags",this.$options.name)})}},mounted(){this.flag_id&&this.loadFlag()},created(){this.flag_id&&this.loadFlag()}},_hoisted_1$a={id:"flag-edit-modal",class:"modal fade",tabindex:"-1"},_hoisted_2$a={class:"modal-dialog modal-lg"},_hoisted_3$a={class:"modal-content"},_hoisted_4$a=createStaticVNode('<div class="modal-header text-center"><div class="container"><div class="row"><div class="col-md-12"><h3 class="text-center">Edit Flag</h3></div></div></div><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">\xD7</span></button></div>',1),_hoisted_5$a={class:"modal-body"},_hoisted_6$9=["innerHTML"];function _sfc_render$a(e,t,n,i,a,o){return openBlock(),createElementBlock("div",_hoisted_1$a,[createBaseVNode("div",_hoisted_2$a,[createBaseVNode("div",_hoisted_3$a,[_hoisted_4$a,createBaseVNode("div",_hoisted_5$a,[createBaseVNode("form",{method:"POST",innerHTML:e.editForm,onSubmit:t[0]||(t[0]=withModifiers((...s)=>o.updateFlag&&o.updateFlag(...s),["prevent"]))},null,40,_hoisted_6$9)])])])])}const FlagEditForm=_export_sfc(_sfc_main$a,[["render",_sfc_render$a]]),_sfc_main$9={components:{FlagCreationForm,FlagEditForm},props:{challenge_id:Number},data:function(){return{flags:[],editing_flag_id:null}},methods:{loadFlags:function(){CTFd$1.fetch(`/api/v1/challenges/${this.$props.challenge_id}/flags`,{method:"GET",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}}).then(e=>e.json()).then(e=>{e.success&&(this.flags=e.data)})},refreshFlags(e){this.loadFlags();let t;switch(e){case"FlagEditForm":t=this.$refs.FlagEditForm.$el,jqueryExports(t).modal("hide");break;case"FlagCreationForm":t=this.$refs.FlagCreationForm.$el,jqueryExports(t).modal("hide");break}},addFlag:function(){let e=this.$refs.FlagCreationForm.$el;jqueryExports(e).modal()},editFlag:function(e){this.editing_flag_id=e;let t=this.$refs.FlagEditForm.$el;jqueryExports(t).modal()},deleteFlag:function(e){confirm("Are you sure you'd like to delete this flag?")&&CTFd$1.fetch(`/api/v1/flags/${e}`,{method:"DELETE"}).then(t=>t.json()).then(t=>{t.success&&this.loadFlags()})}},created(){this.loadFlags()}},_hoisted_1$9={id:"flagsboard",class:"table table-striped"},_hoisted_2$9=createBaseVNode("thead",null,[createBaseVNode("tr",null,[createBaseVNode("td",{class:"text-center"},[createBaseVNode("b",null,"Type")]),createBaseVNode("td",{class:"text-center"},[createBaseVNode("b",null,"Answer")]),createBaseVNode("td",{class:"text-center"},[createBaseVNode("b",null,"Settings")])])],-1),_hoisted_3$9=["name"],_hoisted_4$9={class:"text-center"},_hoisted_5$9={class:"text-break"},_hoisted_6$8={class:"flag-content"},_hoisted_7$7={class:"text-center"},_hoisted_8$7=["flag-id","flag-type","onClick"],_hoisted_9$6=["flag-id","onClick"],_hoisted_10$5=createBaseVNode("td",{class:"text-center"},null,-1),_hoisted_11$4=createBaseVNode("td",{class:"text-break"},null,-1),_hoisted_12$4={class:"text-center"};function _sfc_render$9(e,t,n,i,a,o){const s=resolveComponent("FlagCreationForm"),l=resolveComponent("FlagEditForm");return openBlock(),createElementBlock("div",null,[createBaseVNode("div",null,[createVNode(s,{ref:"FlagCreationForm",challenge_id:n.challenge_id,onRefreshFlags:o.refreshFlags},null,8,["challenge_id","onRefreshFlags"])]),createBaseVNode("div",null,[createVNode(l,{ref:"FlagEditForm",flag_id:e.editing_flag_id,onRefreshFlags:o.refreshFlags},null,8,["flag_id","onRefreshFlags"])]),createBaseVNode("table",_hoisted_1$9,[_hoisted_2$9,createBaseVNode("tbody",null,[(openBlock(!0),createElementBlock(Fragment,null,renderList(e.flags,d=>(openBlock(),createElementBlock("tr",{name:d.id,key:d.id},[createBaseVNode("td",_hoisted_4$9,toDisplayString(d.type),1),createBaseVNode("td",_hoisted_5$9,[createBaseVNode("pre",_hoisted_6$8,toDisplayString(d.content),1)]),createBaseVNode("td",_hoisted_7$7,[createBaseVNode("i",{role:"button",class:"btn-fa fas fa-edit edit-flag","flag-id":d.id,"flag-type":d.type,onClick:r=>o.editFlag(d.id)},null,8,_hoisted_8$7),createBaseVNode("i",{role:"button",class:"btn-fa fas fa-times delete-flag","flag-id":d.id,onClick:r=>o.deleteFlag(d.id)},null,8,_hoisted_9$6)])],8,_hoisted_3$9))),128)),createBaseVNode("tr",null,[_hoisted_10$5,_hoisted_11$4,createBaseVNode("td",_hoisted_12$4,[createBaseVNode("i",{id:"flag-add-button",class:"btn-fa fas fa-plus add-flag",onClick:t[0]||(t[0]=d=>o.addFlag())})])])])])])}const FlagList=_export_sfc(_sfc_main$9,[["render",_sfc_render$9]]),Requirements_vue_vue_type_style_index_0_scoped_3c612631_lang="",_sfc_main$8={props:{challenge_id:Number},data:function(){return{challenges:[],requirements:{},selectedRequirements:[],selectedAnonymize:!1}},computed:{newRequirements:function(){let e=this.requirements.prerequisites||[],t=this.requirements.anonymize||!1,n=JSON.stringify(e.sort())!==JSON.stringify(this.selectedRequirements.sort()),i=t!==this.selectedAnonymize;return n||i},requiredChallenges:function(){const e=this.requirements.prerequisites||[];return this.challenges.filter(t=>t.id!==this.$props.challenge_id&&e.includes(t.id))},otherChallenges:function(){const e=this.requirements.prerequisites||[];return this.challenges.filter(t=>t.id!==this.$props.challenge_id&&!e.includes(t.id))}},methods:{loadChallenges:function(){CTFd$1.fetch("/api/v1/challenges?view=admin",{method:"GET",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}}).then(e=>e.json()).then(e=>{e.success&&(this.challenges=e.data)})},getChallengeNameById:function(e){let t=this.challenges.find(n=>n.id===e);return t?t.name:""},loadRequirements:function(){CTFd$1.fetch(`/api/v1/challenges/${this.$props.challenge_id}/requirements`,{method:"GET",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}}).then(e=>e.json()).then(e=>{e.success&&(this.requirements=e.data||{},this.selectedRequirements=this.requirements.prerequisites||[],this.selectedAnonymize=this.requirements.anonymize||!1)})},updateRequirements:function(){const t={requirements:{prerequisites:this.selectedRequirements}};this.selectedAnonymize&&(t.requirements.anonymize=!0),CTFd$1.fetch(`/api/v1/challenges/${this.$props.challenge_id}`,{method:"PATCH",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t)}).then(n=>n.json()).then(n=>{n.success&&this.loadRequirements()})}},created(){this.loadChallenges(),this.loadRequirements()}},_withScopeId=e=>(pushScopeId("data-v-3c612631"),e=e(),popScopeId(),e),_hoisted_1$8={class:"form-group scrollbox"},_hoisted_2$8={class:"form-check-label cursor-pointer"},_hoisted_3$8=["value"],_hoisted_4$8={class:"form-check-label cursor-pointer"},_hoisted_5$8=["value"],_hoisted_6$7={class:"form-group"},_hoisted_7$6=_withScopeId(()=>createBaseVNode("label",null,[createBaseVNode("b",null,"Behavior if not unlocked")],-1)),_hoisted_8$6=_withScopeId(()=>createBaseVNode("option",{value:!1},"Cach\xE9",-1)),_hoisted_9$5=_withScopeId(()=>createBaseVNode("option",{value:!0},"Anonymized",-1)),_hoisted_10$4=[_hoisted_8$6,_hoisted_9$5],_hoisted_11$3={class:"form-group"},_hoisted_12$3=["disabled"];function _sfc_render$8(e,t,n,i,a,o){return openBlock(),createElementBlock("div",null,[createBaseVNode("form",{onSubmit:t[3]||(t[3]=withModifiers((...s)=>o.updateRequirements&&o.updateRequirements(...s),["prevent"]))},[createBaseVNode("div",_hoisted_1$8,[createVNode(TransitionGroup,{name:"flip-list"},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(o.requiredChallenges,s=>(openBlock(),createElementBlock("div",{class:"form-check",key:s.id},[createBaseVNode("label",_hoisted_2$8,[withDirectives(createBaseVNode("input",{class:"form-check-input",type:"checkbox",value:s.id,"onUpdate:modelValue":t[0]||(t[0]=l=>e.selectedRequirements=l)},null,8,_hoisted_3$8),[[vModelCheckbox,e.selectedRequirements]]),createTextVNode(" "+toDisplayString(s.name),1)])]))),128)),(openBlock(!0),createElementBlock(Fragment,null,renderList(o.otherChallenges,s=>(openBlock(),createElementBlock("div",{class:"form-check",key:s.id},[createBaseVNode("label",_hoisted_4$8,[withDirectives(createBaseVNode("input",{class:"form-check-input",type:"checkbox",value:s.id,"onUpdate:modelValue":t[1]||(t[1]=l=>e.selectedRequirements=l)},null,8,_hoisted_5$8),[[vModelCheckbox,e.selectedRequirements]]),createTextVNode(" "+toDisplayString(s.name),1)])]))),128))]),_:1})]),createBaseVNode("div",_hoisted_6$7,[_hoisted_7$6,withDirectives(createBaseVNode("select",{class:"form-control custom-select",name:"anonymize","onUpdate:modelValue":t[2]||(t[2]=s=>e.selectedAnonymize=s)},_hoisted_10$4,512),[[vModelSelect,e.selectedAnonymize]])]),createBaseVNode("div",_hoisted_11$3,[createBaseVNode("button",{class:"btn btn-success float-right",disabled:!o.newRequirements}," Save ",8,_hoisted_12$3)])],32)])}const Requirements=_export_sfc(_sfc_main$8,[["render",_sfc_render$8],["__scopeId","data-v-3c612631"]]),_sfc_main$7={props:{challenge_id:Number},data:function(){return{topics:[],topicValue:"",searchedTopic:"",topicResults:[],selectedResultIdx:0,awaitingSearch:!1}},methods:{loadTopics:function(){CTFd$1.fetch(`/api/v1/challenges/${this.$props.challenge_id}/topics`,{method:"GET",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}}).then(e=>e.json()).then(e=>{e.success&&(this.topics=e.data)})},searchTopics:function(){if(this.selectedResultIdx=0,this.topicValue==""){this.topicResults=[];return}CTFd$1.fetch(`/api/v1/topics?field=value&q=${this.topicValue}`,{method:"GET",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}}).then(e=>e.json()).then(e=>{e.success&&(this.topicResults=e.data.slice(0,10))})},addTopic:function(){let e;if(this.selectedResultIdx===0)e=this.topicValue;else{let n=this.selectedResultIdx-1;e=this.topicResults[n].value}const t={value:e,challenge:this.$props.challenge_id,type:"challenge"};CTFd$1.fetch("/api/v1/topics",{method:"POST",body:JSON.stringify(t)}).then(n=>n.json()).then(n=>{n.success&&(this.topicValue="",this.loadTopics())})},deleteTopic:function(e){CTFd$1.fetch(`/api/v1/topics?type=challenge&target_id=${e}`,{method:"DELETE"}).then(t=>t.json()).then(t=>{t.success&&this.loadTopics()})},moveCursor:function(e){switch(e){case"up":this.selectedResultIdx&&(this.selectedResultIdx-=1);break;case"down":this.selectedResultIdx<this.topicResults.length&&(this.selectedResultIdx+=1);break}},selectTopic:function(e){e===void 0&&(e=this.selectedResultIdx);let t=this.topicResults[e];this.topicValue=t.value}},watch:{topicValue:function(e){this.awaitingSearch===!1&&setTimeout(()=>{this.searchTopics(),this.awaitingSearch=!1},500),this.awaitingSearch=!0}},created(){this.loadTopics()}},_hoisted_1$7={class:"col-md-12"},_hoisted_2$7={id:"challenge-topics",class:"my-3"},_hoisted_3$7={class:"mr-1"},_hoisted_4$7=["onClick"],_hoisted_5$7={class:"form-group"},_hoisted_6$6=createBaseVNode("label",null,[createTextVNode(" Topic "),createBaseVNode("br"),createBaseVNode("small",{class:"text-muted"},"Type topic and press Enter")],-1),_hoisted_7$5={class:"form-group"},_hoisted_8$5={class:"list-group"},_hoisted_9$4=["onClick"];function _sfc_render$7(e,t,n,i,a,o){return openBlock(),createElementBlock("div",_hoisted_1$7,[createBaseVNode("div",_hoisted_2$7,[(openBlock(!0),createElementBlock(Fragment,null,renderList(e.topics,s=>(openBlock(),createElementBlock("h5",{class:"challenge-tag",key:s.id},[createBaseVNode("span",_hoisted_3$7,toDisplayString(s.value),1),createBaseVNode("a",{class:"btn-fa delete-tag",onClick:l=>o.deleteTopic(s.id)}," \xD7",8,_hoisted_4$7)]))),128))]),createBaseVNode("div",_hoisted_5$7,[_hoisted_6$6,withDirectives(createBaseVNode("input",{id:"tags-add-input",maxlength:"255",type:"text",class:"form-control","onUpdate:modelValue":t[0]||(t[0]=s=>e.topicValue=s),onKeyup:[t[1]||(t[1]=withKeys(s=>o.moveCursor("down"),["down"])),t[2]||(t[2]=withKeys(s=>o.moveCursor("up"),["up"])),t[3]||(t[3]=withKeys(s=>o.addTopic(),["enter"]))]},null,544),[[vModelText,e.topicValue]])]),createBaseVNode("div",_hoisted_7$5,[createBaseVNode("ul",_hoisted_8$5,[(openBlock(!0),createElementBlock(Fragment,null,renderList(e.topicResults,(s,l)=>(openBlock(),createElementBlock("li",{class:normalizeClass({"list-group-item":!0,active:l+1===e.selectedResultIdx}),key:s.id,onClick:d=>o.selectTopic(l)},toDisplayString(s.value),11,_hoisted_9$4))),128))])])])}const TopicsList=_export_sfc(_sfc_main$7,[["render",_sfc_render$7]]),_sfc_main$6={props:{challenge_id:Number},data:function(){return{tags:[],tagValue:""}},methods:{loadTags:function(){CTFd$1.fetch(`/api/v1/challenges/${this.$props.challenge_id}/tags`,{method:"GET",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}}).then(e=>e.json()).then(e=>{e.success&&(this.tags=e.data)})},addTag:function(){if(this.tagValue){const e={value:this.tagValue,challenge:this.$props.challenge_id};CTFd$1.api.post_tag_list({},e).then(t=>{t.success&&(this.tagValue="",this.loadTags())})}},deleteTag:function(e){CTFd$1.api.delete_tag({tagId:e}).then(t=>{t.success&&this.loadTags()})}},created(){this.loadTags()}},_hoisted_1$6={class:"col-md-12"},_hoisted_2$6={id:"challenge-tags",class:"my-3"},_hoisted_3$6=["onClick"],_hoisted_4$6={class:"form-group"},_hoisted_5$6=createBaseVNode("label",null,[createTextVNode("Tag "),createBaseVNode("br"),createBaseVNode("small",{class:"text-muted"},"Type tag and press Enter")],-1);function _sfc_render$6(e,t,n,i,a,o){return openBlock(),createElementBlock("div",_hoisted_1$6,[createBaseVNode("div",_hoisted_2$6,[(openBlock(!0),createElementBlock(Fragment,null,renderList(e.tags,s=>(openBlock(),createElementBlock("span",{class:"badge badge-primary mx-1 challenge-tag",key:s.id},[createBaseVNode("span",null,toDisplayString(s.value),1),createBaseVNode("a",{class:"btn-fa delete-tag",onClick:l=>o.deleteTag(s.id)}," \xD7",8,_hoisted_3$6)]))),128))]),createBaseVNode("div",_hoisted_4$6,[_hoisted_5$6,withDirectives(createBaseVNode("input",{id:"tags-add-input",maxlength:"80",type:"text",class:"form-control","onUpdate:modelValue":t[0]||(t[0]=s=>e.tagValue=s),onKeyup:t[1]||(t[1]=withKeys(s=>o.addTag(),["enter"]))},null,544),[[vModelText,e.tagValue]])])])}const TagsList=_export_sfc(_sfc_main$6,[["render",_sfc_render$6]]),_sfc_main$5={props:{challenge_id:Number},data:function(){return{files:[],urlRoot:CTFd$1.config.urlRoot}},methods:{loadFiles:function(){CTFd$1.fetch(`/api/v1/challenges/${this.$props.challenge_id}/files`,{method:"GET"}).then(e=>e.json()).then(e=>{e.success&&(this.files=e.data)})},addFiles:function(){let e={challenge:this.$props.challenge_id,type:"challenge"},t=this.$refs.FileUploadForm;helpers.files.upload(t,e,n=>{setTimeout(()=>{this.loadFiles()},700)})},deleteFile:function(e){ezQuery({title:"Delete Files",body:"\xCAtes-vous certain de vouloir supprimer this file?",success:()=>{CTFd$1.fetch(`/api/v1/files/${e}`,{method:"DELETE"}).then(t=>t.json()).then(t=>{t.success&&this.loadFiles()})}})}},created(){this.loadFiles()}},_hoisted_1$5={id:"filesboard",class:"table table-striped"},_hoisted_2$5=createBaseVNode("thead",null,[createBaseVNode("tr",null,[createBaseVNode("td",{class:"text-center"},[createBaseVNode("b",null,"File")]),createBaseVNode("td",{class:"text-center"},[createBaseVNode("b",null,"Settings")])])],-1),_hoisted_3$5={class:"text-center"},_hoisted_4$5=["href"],_hoisted_5$5={class:"text-center"},_hoisted_6$5=["onClick"],_hoisted_7$4={class:"col-md-12 mt-3"},_hoisted_8$4=createStaticVNode('<div class="form-group"><input class="form-control-file" id="file" multiple="" name="file" required="" type="file"><sub class="text-muted"> Attach multiple files using CTRL+Click or Cmd+Click. </sub></div><div class="form-group"><input class="btn btn-success float-right" id="_submit" name="_submit" type="submit" value="Upload"></div>',2),_hoisted_10$3=[_hoisted_8$4];function _sfc_render$5(e,t,n,i,a,o){return openBlock(),createElementBlock("div",null,[createBaseVNode("table",_hoisted_1$5,[_hoisted_2$5,createBaseVNode("tbody",null,[(openBlock(!0),createElementBlock(Fragment,null,renderList(e.files,s=>(openBlock(),createElementBlock("tr",{key:s.id},[createBaseVNode("td",_hoisted_3$5,[createBaseVNode("a",{href:`${e.urlRoot}/files/${s.location}`},toDisplayString(s.location.split("/").pop()),9,_hoisted_4$5)]),createBaseVNode("td",_hoisted_5$5,[createBaseVNode("i",{role:"button",class:"btn-fa fas fa-times delete-file",onClick:l=>o.deleteFile(s.id)},null,8,_hoisted_6$5)])]))),128))])]),createBaseVNode("div",_hoisted_7$4,[createBaseVNode("form",{method:"POST",ref:"FileUploadForm",onSubmit:t[0]||(t[0]=withModifiers((...s)=>o.addFiles&&o.addFiles(...s),["prevent"]))},_hoisted_10$3,544)])])}const ChallengeFilesList=_export_sfc(_sfc_main$5,[["render",_sfc_render$5]]),_sfc_main$4={props:{challengeId:Number,challengeName:String,CHALLENGE_THUMBSNAIL:String},data:function(){return{files:[],urlRoot:CTFd$1.config.urlRoot}},methods:{updateThumbsnailPath(e){CTFd$1.fetch(`/api/v1/challenges/${CHALLENGE_ID}/thumbsnail`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({thumbsnail:e})}).then(t=>t.json()).then(t=>{t.success?console.log("Thumbsnail path updated successfully."):console.error("Failed to update thumbsnail path:",t.message)})}},mounted(){document.getElementById("btn-file-input").style.display="block",document.getElementById("btn-file-input").addEventListener("click",()=>{document.getElementById("thumbsnail-get-path").click()}),document.getElementById("thumbsnail-get-path").addEventListener("change",e=>{const t=e.target.files[0];let n=document.getElementById("thumbsnail-upload-form");const i=new FormData(n);if(i.append("file",t),helpers.files.upload(i,n,a=>{const o=a.data[0],s=CTFd$1.config.urlRoot+"/files/"+o.location;document.getElementById("thumbsnail-path").value=s,console.log("Thumbnail uploaded successfully:",s);const l=document.getElementById("image-preview");l.src=s,l.style.display="block",this.updateThumbsnailPath(s)}),t){const a=new FileReader;a.onload=function(o){const s=document.getElementById("image-preview");s.src=o.target.result,s.style.display="block"},a.readAsDataURL(t)}})}},_hoisted_1$4={id:"Thumbsnailboard",class:"table table-striped"},_hoisted_2$4=createBaseVNode("thead",null,[createBaseVNode("tr",null,[createBaseVNode("td",{class:"text-center"},[createBaseVNode("b",null,"Miniature")]),createBaseVNode("td",{class:"text-center"},[createBaseVNode("b",null,"Settings")])])],-1),_hoisted_3$4={class:"text-center"},_hoisted_4$4=["href"],_hoisted_5$4={class:"text-center"},_hoisted_6$4=["onClick"],_hoisted_7$3={class:"col-md-12 mt-3"},_hoisted_8$3={id:"thumbsnail-upload-form",class:"form-upload",method:"POST",enctype:"multipart/form-data"},_hoisted_9$3=createBaseVNode("button",{id:"btn-file-input",class:"btn btn-secondary",type:"button"},"Select File",-1),_hoisted_10$2=["src"],_hoisted_11$2=createBaseVNode("input",{class:"form-control-file",id:"thumbsnail-get-path",name:"file",type:"file",accept:".png",style:{display:"none"}},null,-1),_hoisted_12$2=createBaseVNode("input",{type:"hidden",id:"thumbsnail-path",name:"thumbsnail"},null,-1);function _sfc_render$4(e,t,n,i,a,o){return openBlock(),createElementBlock("div",null,[createBaseVNode("table",_hoisted_1$4,[_hoisted_2$4,createBaseVNode("tbody",null,[(openBlock(!0),createElementBlock(Fragment,null,renderList(e.files,s=>(openBlock(),createElementBlock("tr",{key:s.id},[createBaseVNode("td",_hoisted_3$4,[createBaseVNode("a",{href:`${e.urlRoot}/files/${s.location}`},toDisplayString(s.location.split("/").pop()),9,_hoisted_4$4)]),createBaseVNode("td",_hoisted_5$4,[createBaseVNode("i",{role:"button",class:"btn-fa fas fa-times delete-file",onClick:l=>e.deleteFile(s.id)},null,8,_hoisted_6$4)])]))),128))])]),createBaseVNode("div",_hoisted_7$3,[createBaseVNode("form",_hoisted_8$3,[_hoisted_9$3,withDirectives(createBaseVNode("img",{id:"image-preview",src:n.CHALLENGE_THUMBSNAIL,style:{width:"100px",height:"100px","margin-top":"10px"}},null,8,_hoisted_10$2),[[vShow,n.CHALLENGE_THUMBSNAIL]]),_hoisted_11$2,_hoisted_12$2])])])}const ChallengeThumbsnail=_export_sfc(_sfc_main$4,[["render",_sfc_render$4]]),_sfc_main$3={name:"HintCreationForm",props:{challenge_id:Number,hints:Array},data:function(){return{cost:0,selectedHints:[]}},methods:{getCost:function(){return this.cost||0},getContent:function(){return this.$refs.content.value},submitHint:function(){let e={challenge_id:this.$props.challenge_id,content:this.getContent(),cost:this.getCost(),requirements:{prerequisites:this.selectedHints}};CTFd.fetch("/api/v1/hints",{method:"POST",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e)}).then(t=>t.json()).then(t=>{t.success&&this.$emit("refreshHints",this.$options.name)})}}},_hoisted_1$3={class:"modal fade",tabindex:"-1"},_hoisted_2$3={class:"modal-dialog"},_hoisted_3$3={class:"modal-content"},_hoisted_4$3=createStaticVNode('<div class="modal-header text-center"><div class="container"><div class="row"><div class="col-md-12"><h3>Hint</h3></div></div></div><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">\xD7</span></button></div>',1),_hoisted_5$3={class:"modal-body"},_hoisted_6$3={class:"container"},_hoisted_7$2={class:"row"},_hoisted_8$2={class:"col-md-12"},_hoisted_9$2={class:"form-group"},_hoisted_10$1=createBaseVNode("label",null,[createTextVNode(" Hint"),createBaseVNode("br"),createBaseVNode("small",null,"Markdown & HTML are supported")],-1),_hoisted_11$1={type:"text",class:"form-control markdown",name:"content",rows:"7",ref:"content"},_hoisted_12$1={class:"form-group"},_hoisted_13$1=createBaseVNode("label",null,[createTextVNode(" Cost"),createBaseVNode("br"),createBaseVNode("small",null,"How many points it costs to see your hint.")],-1),_hoisted_14$1={class:"form-group"},_hoisted_15$1=createBaseVNode("label",null,[createTextVNode(" Requirements"),createBaseVNode("br"),createBaseVNode("small",null,"Hints that must be unlocked before unlocking this hint")],-1),_hoisted_16$1={class:"form-check-label cursor-pointer"},_hoisted_17$1=["value"],_hoisted_18$1=createBaseVNode("input",{type:"hidden",id:"hint-id-for-hint",name:"id"},null,-1),_hoisted_19=createStaticVNode('<div class="modal-footer"><div class="container"><div class="row"><div class="col-md-12"><button class="btn btn-primary float-right">Submit</button></div></div></div></div>',1);function _sfc_render$3(e,t,n,i,a,o){return openBlock(),createElementBlock("div",_hoisted_1$3,[createBaseVNode("div",_hoisted_2$3,[createBaseVNode("div",_hoisted_3$3,[_hoisted_4$3,createBaseVNode("form",{method:"POST",onSubmit:t[2]||(t[2]=withModifiers((...s)=>o.submitHint&&o.submitHint(...s),["prevent"]))},[createBaseVNode("div",_hoisted_5$3,[createBaseVNode("div",_hoisted_6$3,[createBaseVNode("div",_hoisted_7$2,[createBaseVNode("div",_hoisted_8$2,[createBaseVNode("div",_hoisted_9$2,[_hoisted_10$1,createBaseVNode("textarea",_hoisted_11$1,null,512)]),createBaseVNode("div",_hoisted_12$1,[_hoisted_13$1,withDirectives(createBaseVNode("input",{type:"number",class:"form-control",name:"cost","onUpdate:modelValue":t[0]||(t[0]=s=>e.cost=s)},null,512),[[vModelText,e.cost,void 0,{lazy:!0}]])]),createBaseVNode("div",_hoisted_14$1,[_hoisted_15$1,(openBlock(!0),createElementBlock(Fragment,null,renderList(n.hints,s=>(openBlock(),createElementBlock("div",{class:"form-check",key:s.id},[createBaseVNode("label",_hoisted_16$1,[withDirectives(createBaseVNode("input",{class:"form-check-input",type:"checkbox",value:s.id,"onUpdate:modelValue":t[1]||(t[1]=l=>e.selectedHints=l)},null,8,_hoisted_17$1),[[vModelCheckbox,e.selectedHints]]),createTextVNode(" "+toDisplayString(s.cost)+" - "+toDisplayString(s.id),1)])]))),128))]),_hoisted_18$1])])])]),_hoisted_19],32)])])])}const HintCreationForm=_export_sfc(_sfc_main$3,[["render",_sfc_render$3]]),_sfc_main$2={name:"HintEditForm",props:{challenge_id:Number,hint_id:Number,hints:Array},data:function(){return{cost:0,content:null,selectedHints:[]}},computed:{otherHints:function(){return this.hints.filter(e=>e.id!==this.$props.hint_id)}},watch:{hint_id:{immediate:!0,handler(e,t){e!==null&&this.loadHint()}}},methods:{loadHint:function(){CTFd$1.fetch(`/api/v1/hints/${this.$props.hint_id}?preview=true`,{method:"GET",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}}).then(e=>e.json()).then(e=>{var t;if(e.success){let n=e.data;this.cost=n.cost,this.content=n.content,this.selectedHints=((t=n.requirements)==null?void 0:t.prerequisites)||[];let i=this.$refs.content;bindMarkdownEditor(i),setTimeout(()=>{i.mde.codemirror.getDoc().setValue(i.value),this._forceRefresh()},200)}})},_forceRefresh:function(){this.$refs.content.mde.codemirror.refresh()},getCost:function(){return this.cost||0},getContent:function(){return this._forceRefresh(),this.$refs.content.mde.codemirror.getDoc().getValue()},updateHint:function(){let e={challenge_id:this.$props.challenge_id,content:this.getContent(),cost:this.getCost(),requirements:{prerequisites:this.selectedHints}};CTFd$1.fetch(`/api/v1/hints/${this.$props.hint_id}`,{method:"PATCH",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e)}).then(t=>t.json()).then(t=>{t.success&&this.$emit("refreshHints",this.$options.name)})}},mounted(){this.hint_id&&this.loadHint()},created(){this.hint_id&&this.loadHint()}},_hoisted_1$2={class:"modal fade",tabindex:"-1"},_hoisted_2$2={class:"modal-dialog"},_hoisted_3$2={class:"modal-content"},_hoisted_4$2=createStaticVNode('<div class="modal-header text-center"><div class="container"><div class="row"><div class="col-md-12"><h3>Hint</h3></div></div></div><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">\xD7</span></button></div>',1),_hoisted_5$2={class:"modal-body"},_hoisted_6$2={class:"container"},_hoisted_7$1={class:"row"},_hoisted_8$1={class:"col-md-12"},_hoisted_9$1={class:"form-group"},_hoisted_10=createBaseVNode("label",null,[createTextVNode(" Hint"),createBaseVNode("br"),createBaseVNode("small",null,"Markdown & HTML are supported")],-1),_hoisted_11=["value"],_hoisted_12={class:"form-group"},_hoisted_13=createBaseVNode("label",null,[createTextVNode(" Cost"),createBaseVNode("br"),createBaseVNode("small",null,"How many points it costs to see your hint.")],-1),_hoisted_14={class:"form-group"},_hoisted_15=createBaseVNode("label",null,[createTextVNode(" Requirements"),createBaseVNode("br"),createBaseVNode("small",null,"Hints that must be unlocked before unlocking this hint")],-1),_hoisted_16={class:"form-check-label cursor-pointer"},_hoisted_17=["value"],_hoisted_18=createStaticVNode('<div class="modal-footer"><div class="container"><div class="row"><div class="col-md-12"><button class="btn btn-primary float-right">Submit</button></div></div></div></div>',1);function _sfc_render$2(e,t,n,i,a,o){return openBlock(),createElementBlock("div",_hoisted_1$2,[createBaseVNode("div",_hoisted_2$2,[createBaseVNode("div",_hoisted_3$2,[_hoisted_4$2,createBaseVNode("form",{method:"POST",onSubmit:t[2]||(t[2]=withModifiers((...s)=>o.updateHint&&o.updateHint(...s),["prevent"]))},[createBaseVNode("div",_hoisted_5$2,[createBaseVNode("div",_hoisted_6$2,[createBaseVNode("div",_hoisted_7$1,[createBaseVNode("div",_hoisted_8$1,[createBaseVNode("div",_hoisted_9$1,[_hoisted_10,createBaseVNode("textarea",{type:"text",class:"form-control",name:"content",rows:"7",value:this.content,ref:"content"},null,8,_hoisted_11)]),createBaseVNode("div",_hoisted_12,[_hoisted_13,withDirectives(createBaseVNode("input",{type:"number",class:"form-control",name:"cost","onUpdate:modelValue":t[0]||(t[0]=s=>e.cost=s)},null,512),[[vModelText,e.cost,void 0,{lazy:!0}]])]),createBaseVNode("div",_hoisted_14,[_hoisted_15,(openBlock(!0),createElementBlock(Fragment,null,renderList(o.otherHints,s=>(openBlock(),createElementBlock("div",{class:"form-check",key:s.id},[createBaseVNode("label",_hoisted_16,[withDirectives(createBaseVNode("input",{class:"form-check-input",type:"checkbox",value:s.id,"onUpdate:modelValue":t[1]||(t[1]=l=>e.selectedHints=l)},null,8,_hoisted_17),[[vModelCheckbox,e.selectedHints]]),createTextVNode(" "+toDisplayString(s.content)+" - "+toDisplayString(s.cost),1)])]))),128))])])])])]),_hoisted_18],32)])])])}const HintEditForm=_export_sfc(_sfc_main$2,[["render",_sfc_render$2]]),_sfc_main$1={components:{HintCreationForm,HintEditForm},props:{challenge_id:Number},data:function(){return{hints:[],editing_hint_id:null}},methods:{loadHints:async function(){let t=await(await CTFd$1.fetch(`/api/v1/challenges/${this.$props.challenge_id}/hints`,{method:"GET",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}})).json();return this.hints=t.data,t.success},addHint:function(){let e=this.$refs.HintCreationForm.$el;$(e).modal()},editHint:function(e){this.editing_hint_id=e;let t=this.$refs.HintEditForm.$el;$(t).modal()},refreshHints:function(e){this.loadHints().then(t=>{if(t){let n;switch(e){case"HintCreationForm":n=this.$refs.HintCreationForm.$el,console.log(n),$(n).modal("hide");break;case"HintEditForm":n=this.$refs.HintEditForm.$el,$(n).modal("hide");break}}else alert("An error occurred while updating this hint. Please try again.")})},deleteHint:function(e){ezQuery({title:"Delete Hint",body:"\xCAtes-vous certain de vouloir supprimer this hint?",success:()=>{CTFd$1.fetch(`/api/v1/hints/${e}`,{method:"DELETE"}).then(t=>t.json()).then(t=>{t.success&&this.loadHints()})}})}},created(){this.loadHints()}},_hoisted_1$1={class:"table table-striped"},_hoisted_2$1=createBaseVNode("thead",null,[createBaseVNode("tr",null,[createBaseVNode("td",{class:"text-center"},[createBaseVNode("b",null,"ID")]),createBaseVNode("td",{class:"text-center"},[createBaseVNode("b",null,"Hint")]),createBaseVNode("td",{class:"text-center"},[createBaseVNode("b",null,"Cost")]),createBaseVNode("td",{class:"text-center"},[createBaseVNode("b",null,"Settings")])])],-1),_hoisted_3$1={class:"text-center"},_hoisted_4$1={class:"text-break"},_hoisted_5$1={class:"text-center"},_hoisted_6$1={class:"text-center"},_hoisted_7=["onClick"],_hoisted_8=["onClick"],_hoisted_9={class:"col-md-12"};function _sfc_render$1(e,t,n,i,a,o){const s=resolveComponent("HintCreationForm"),l=resolveComponent("HintEditForm");return openBlock(),createElementBlock("div",null,[createBaseVNode("div",null,[createVNode(s,{ref:"HintCreationForm",challenge_id:n.challenge_id,hints:e.hints,onRefreshHints:o.refreshHints},null,8,["challenge_id","hints","onRefreshHints"])]),createBaseVNode("div",null,[createVNode(l,{ref:"HintEditForm",challenge_id:n.challenge_id,hint_id:e.editing_hint_id,hints:e.hints,onRefreshHints:o.refreshHints},null,8,["challenge_id","hint_id","hints","onRefreshHints"])]),createBaseVNode("table",_hoisted_1$1,[_hoisted_2$1,createBaseVNode("tbody",null,[(openBlock(!0),createElementBlock(Fragment,null,renderList(e.hints,d=>(openBlock(),createElementBlock("tr",{key:d.id},[createBaseVNode("td",_hoisted_3$1,toDisplayString(d.type),1),createBaseVNode("td",_hoisted_4$1,[createBaseVNode("pre",null,toDisplayString(d.content),1)]),createBaseVNode("td",_hoisted_5$1,toDisplayString(d.cost),1),createBaseVNode("td",_hoisted_6$1,[createBaseVNode("i",{role:"button",class:"btn-fa fas fa-edit",onClick:r=>o.editHint(d.id)},null,8,_hoisted_7),createBaseVNode("i",{role:"button",class:"btn-fa fas fa-times",onClick:r=>o.deleteHint(d.id)},null,8,_hoisted_8)])]))),128))])]),createBaseVNode("div",_hoisted_9,[createBaseVNode("button",{class:"btn btn-success float-right",onClick:t[0]||(t[0]=(...d)=>o.addHint&&o.addHint(...d))}," Create Hint ")])])}const HintsList=_export_sfc(_sfc_main$1,[["render",_sfc_render$1]]),_sfc_main={props:{challenge_id:Number},data:function(){return{challenge:null,challenges:[],selected_id:null}},computed:{updateAvailable:function(){return this.challenge?this.selected_id!=this.challenge.next_id:!1},otherChallenges:function(){return this.challenges.filter(e=>e.id!==this.$props.challenge_id)}},methods:{loadData:function(){CTFd$1.fetch(`/api/v1/challenges/${this.$props.challenge_id}`,{method:"GET",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}}).then(e=>e.json()).then(e=>{e.success&&(this.challenge=e.data,this.selected_id=e.data.next_id)})},loadChallenges:function(){CTFd$1.fetch("/api/v1/challenges?view=admin",{method:"GET",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}}).then(e=>e.json()).then(e=>{e.success&&(this.challenges=e.data)})},updateNext:function(){CTFd$1.fetch(`/api/v1/challenges/${this.$props.challenge_id}`,{method:"PATCH",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({next_id:this.selected_id!="null"?this.selected_id:null})}).then(e=>e.json()).then(e=>{e.success&&(this.loadData(),this.loadChallenges())})}},created(){this.loadData(),this.loadChallenges()}},_hoisted_1={class:"form-group"},_hoisted_2=createBaseVNode("label",null,[createTextVNode(" Next Challenge "),createBaseVNode("br"),createBaseVNode("small",{class:"text-muted"},"Challenge to recommend after solving this challenge")],-1),_hoisted_3=createBaseVNode("option",{value:"null"},"--",-1),_hoisted_4=["value"],_hoisted_5={class:"form-group"},_hoisted_6=["disabled"];function _sfc_render(e,t,n,i,a,o){return openBlock(),createElementBlock("div",null,[createBaseVNode("form",{onSubmit:t[1]||(t[1]=withModifiers((...s)=>o.updateNext&&o.updateNext(...s),["prevent"]))},[createBaseVNode("div",_hoisted_1,[_hoisted_2,withDirectives(createBaseVNode("select",{class:"form-control custom-select","onUpdate:modelValue":t[0]||(t[0]=s=>e.selected_id=s)},[_hoisted_3,(openBlock(!0),createElementBlock(Fragment,null,renderList(o.otherChallenges,s=>(openBlock(),createElementBlock("option",{value:s.id,key:s.id},toDisplayString(s.name),9,_hoisted_4))),128))],512),[[vModelSelect,e.selected_id]])]),createBaseVNode("div",_hoisted_5,[createBaseVNode("button",{class:"btn btn-success float-right",disabled:!o.updateAvailable}," Save ",8,_hoisted_6)])],32)])}const NextChallenge=_export_sfc(_sfc_main,[["render",_sfc_render]]);function loadChalTemplate(e){CTFd$1._internal.challenge={},jqueryExports.getScript(CTFd$1.config.urlRoot+e.scripts.view,function(){let t=e.create;jqueryExports("#create-chal-entry-div").html(t),bindMarkdownEditors(),jqueryExports.getScript(CTFd$1.config.urlRoot+e.scripts.create,function(){jqueryExports("#create-chal-entry-div form").submit(function(n){n.preventDefault();const i=jqueryExports("#create-chal-entry-div form").serializeJSON();CTFd$1.fetch("/api/v1/challenges",{method:"POST",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(i)}).then(function(a){return a.json()}).then(function(a){if(a.success)jqueryExports("#challenge-create-options #challenge_id").val(a.data.id),jqueryExports("#challenge-create-options").modal();else{let o="";for(const s in a.errors)o+=a.errors[s].join(` `),o+=` `;ezAlert({title:"Erreur",body:o,button:"Ok"})}})})})})}function handleChallengeOptions(e){print("hit"),e.preventDefault();var t=jqueryExports(e.target).serializeJSON(!0);let n={challenge_id:t.challenge_id,content:t.flag||"",type:t.flag_type,data:t.flag_data?t.flag_data:""},i=function(){setTimeout(function(){window.location=CTFd$1.config.urlRoot+"/admin/challenges#challenge-create-options-quick"},700)};Promise.all([new Promise(function(a,o){if(n.content.length==0){a();return}CTFd$1.fetch("/api/v1/flags",{method:"POST",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(n)}).then(function(s){a(s.json())})}),new Promise(function(a,o){let s=e.target,l={challenge:t.challenge_id,type:"challenge"};jqueryExports(s.elements.file).val()&&helpers.files.upload(s,l),a()})]).then(a=>{i()})}jqueryExports(()=>{if(jqueryExports(".preview-challenge").click(function(e){let t=`${CTFd$1.config.urlRoot}/admin/challenges/preview/${window.CHALLENGE_ID}`;jqueryExports("#challenge-window").html(`<iframe src="${t}" height="100%" width="100%" frameBorder=0></iframe>`),jqueryExports("#challenge-modal").modal()}),jqueryExports(".comments-challenge").click(function(e){jqueryExports("#challenge-comments-window").modal()}),jqueryExports(".delete-challenge").click(function(e){ezQuery({title:"Delete Challenge",body:`\xCAtes-vous certain de vouloir supprimer <strong>${htmlEntities(window.CHALLENGE_NAME)}</strong>`,success:function(){CTFd$1.fetch("/api/v1/challenges/"+window.CHALLENGE_ID,{method:"DELETE"}).then(function(t){return t.json()}).then(function(t){t.success&&(window.location=CTFd$1.config.urlRoot+"/admin/challenges")})}})}),jqueryExports("#challenge-update-container > form").submit(function(e){e.preventDefault();var t=jqueryExports(e.target).serializeJSON(!0);console.log(t),CTFd$1.fetch("/api/v1/challenges/"+window.CHALLENGE_ID+"/flags",{method:"GET",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}}).then(function(n){return n.json()}).then(function(n){(function(){CTFd$1.fetch("/api/v1/challenges/"+window.CHALLENGE_ID,{method:"PATCH",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t)}).then(function(a){return a.json()}).then(function(a){if(a.success){switch(jqueryExports(".challenge-state").text(a.data.state),a.data.state){case"visible":jqueryExports(".challenge-state").removeClass("badge-danger").addClass("badge-success");break;case"hidden":jqueryExports(".challenge-state").removeClass("badge-success").addClass("badge-danger");break}ezToast({title:"Succ\xE8s",body:"Votre d\xE9fi a \xE9t\xE9 mis \xE0 jour!"})}else{let o="";for(const s in a.errors)o+=a.errors[s].join(` `),o+=` diff --git a/CTFd/themes/admin/static/assets/pages/challenges.31db042e.js b/CTFd/themes/admin/static/assets/pages/challenges.d31a596d.js similarity index 99% rename from CTFd/themes/admin/static/assets/pages/challenges.31db042e.js rename to CTFd/themes/admin/static/assets/pages/challenges.d31a596d.js index a53b65040d4a5c6c979691804467e63ebe36a147..4d873ee1044d4e5a38fe3d22c067c1ff34d3af51 100644 --- a/CTFd/themes/admin/static/assets/pages/challenges.31db042e.js +++ b/CTFd/themes/admin/static/assets/pages/challenges.d31a596d.js @@ -1,4 +1,4 @@ -import{u as E,C as m,j as i,D as p,x as S}from"./main.9f35ed12.js";document.addEventListener("DOMContentLoaded",function(h){document.getElementById("btn-file-input").addEventListener("click",function(t){document.getElementById("thumbsnail-get-path").click()}),document.getElementById("thumbsnail-get-path").addEventListener("change",function(t){const e=t.target.files[0];let a=document.getElementById("thumbsnail-upload-form");const l=new FormData(a);if(l.append("file",e),E.files.upload(l,a,function(r){const f=r.data[0],c=m.config.urlRoot+"/files/"+f.location;document.getElementById("thumbsnail-path").value=c,console.log("Miniature t\xE9l\xE9charg\xE9e avec succ\xE8s:",c);const D=document.getElementById("image-preview");D.src=c,D.style.display="block"}),e){const r=new FileReader;r.onload=function(f){const c=document.getElementById("image-preview");c.src=f.target.result,c.style.display="block"},r.readAsDataURL(e)}});const o=Object.keys(document.categories),d=document.getElementById("categories-selector");o.forEach(t=>{const e=document.createElement("option");e.value=t,e.textContent=t,e.textContent!="D\xE9fi Flash"&&d.appendChild(e)});const s=document.createElement("option");s.value="other",s.textContent="Other (type below)",d.appendChild(s);const n=document.getElementById("categories-selector-input");d.value=="other"||o.length==0?(n.style.display="block",n.name="category"):(n.style.display="none",n.value="",n.name=""),d.addEventListener("change",function(){d.value=="other"||o.length==0?(n.style.display="block",n.name="category"):(n.style.display="none",n.value="",n.name="")});let u=0;document.querySelectorAll("td.id").forEach(function(t){const e=parseInt(t.textContent);!isNaN(e)&&e>u&&(u=e)});const g=u+1;document.getElementById("challenge_id_texte").textContent=g,document.getElementById("challenge_id").value=g;function v(){const t=i("#challenge-create-options-quick").serializeJSON();let e=document.getElementById("categories-selector"),a=document.getElementById("categories-selector-input"),l=document.getElementById("time-selector-input");e.hidden&&t.type!="flash"?(l.hidden=!0,a.hidden=!1,e.hidden=!1):!e.hidden&&t.type=="flash"&&(l.hidden=!1,a.hidden=!0,e.hidden=!0)}function b(t){p({title:"Choisir P\xE9riode",body:`<div class="mb-3" style="text-align: center;"> +import{u as E,C as m,j as i,D as p,x as S}from"./main.b0151f5b.js";document.addEventListener("DOMContentLoaded",function(h){document.getElementById("btn-file-input").addEventListener("click",function(t){document.getElementById("thumbsnail-get-path").click()}),document.getElementById("thumbsnail-get-path").addEventListener("change",function(t){const e=t.target.files[0];let a=document.getElementById("thumbsnail-upload-form");const l=new FormData(a);if(l.append("file",e),E.files.upload(l,a,function(r){const f=r.data[0],c=m.config.urlRoot+"/files/"+f.location;document.getElementById("thumbsnail-path").value=c,console.log("Miniature t\xE9l\xE9charg\xE9e avec succ\xE8s:",c);const D=document.getElementById("image-preview");D.src=c,D.style.display="block"}),e){const r=new FileReader;r.onload=function(f){const c=document.getElementById("image-preview");c.src=f.target.result,c.style.display="block"},r.readAsDataURL(e)}});const o=Object.keys(document.categories),d=document.getElementById("categories-selector");o.forEach(t=>{const e=document.createElement("option");e.value=t,e.textContent=t,e.textContent!="D\xE9fi Flash"&&d.appendChild(e)});const s=document.createElement("option");s.value="other",s.textContent="Other (type below)",d.appendChild(s);const n=document.getElementById("categories-selector-input");d.value=="other"||o.length==0?(n.style.display="block",n.name="category"):(n.style.display="none",n.value="",n.name=""),d.addEventListener("change",function(){d.value=="other"||o.length==0?(n.style.display="block",n.name="category"):(n.style.display="none",n.value="",n.name="")});let u=0;document.querySelectorAll("td.id").forEach(function(t){const e=parseInt(t.textContent);!isNaN(e)&&e>u&&(u=e)});const g=u+1;document.getElementById("challenge_id_texte").textContent=g,document.getElementById("challenge_id").value=g;function v(){const t=i("#challenge-create-options-quick").serializeJSON();let e=document.getElementById("categories-selector"),a=document.getElementById("categories-selector-input"),l=document.getElementById("time-selector-input");e.hidden&&t.type!="flash"?(l.hidden=!0,a.hidden=!1,e.hidden=!1):!e.hidden&&t.type=="flash"&&(l.hidden=!1,a.hidden=!0,e.hidden=!0)}function b(t){p({title:"Choisir P\xE9riode",body:`<div class="mb-3" style="text-align: center;"> <label>D\xE9but</label> <div class="row" style="justify-content: space-around;"> diff --git a/CTFd/themes/admin/static/assets/pages/configs.2c7edd70.js b/CTFd/themes/admin/static/assets/pages/configs.fe262128.js similarity index 99% rename from CTFd/themes/admin/static/assets/pages/configs.2c7edd70.js rename to CTFd/themes/admin/static/assets/pages/configs.fe262128.js index 67b7ec30d4e69c0e069d05c6ecbf982a717f5445..23f8c996e5e4a07fa4a23730a58116942a5441ed 100644 --- a/CTFd/themes/admin/static/assets/pages/configs.2c7edd70.js +++ b/CTFd/themes/admin/static/assets/pages/configs.fe262128.js @@ -1,4 +1,4 @@ -import{I as q,_ as G,C as p,E as K,o as $,c as P,a as i,h as M,v as W,m as j,i as F,k as U,e as Z,F as Q,r as X,f as ee,J as x,L as re,j as t,V as J,D as O,u as R,x as Y,M as z}from"./main.9f35ed12.js";import"../tab.c508b42d.js";import{c as L}from"../htmlmixed.60cb33cf.js";var ae={exports:{}};(function(e,a){(function(r,s){e.exports=s()})(q,function(){var r="minute",s=/[+-]\d\d(?::?\d\d)?/g,l=/([+-]|\d\d)/g;return function(c,o,d){var u=o.prototype;d.utc=function(n){var A={date:n,utc:!0,args:arguments};return new o(A)},u.utc=function(n){var A=d(this.toDate(),{locale:this.$L,utc:!0});return n?A.add(this.utcOffset(),r):A},u.local=function(){return d(this.toDate(),{locale:this.$L,utc:!1})};var T=u.parse;u.parse=function(n){n.utc&&(this.$u=!0),this.$utils().u(n.$offset)||(this.$offset=n.$offset),T.call(this,n)};var S=u.init;u.init=function(){if(this.$u){var n=this.$d;this.$y=n.getUTCFullYear(),this.$M=n.getUTCMonth(),this.$D=n.getUTCDate(),this.$W=n.getUTCDay(),this.$H=n.getUTCHours(),this.$m=n.getUTCMinutes(),this.$s=n.getUTCSeconds(),this.$ms=n.getUTCMilliseconds()}else S.call(this)};var y=u.utcOffset;u.utcOffset=function(n,A){var b=this.$utils().u;if(b(n))return this.$u?0:b(this.$offset)?y.call(this):this.$offset;if(typeof n=="string"&&(n=function(_){_===void 0&&(_="");var B=_.match(s);if(!B)return null;var E=(""+B[0]).match(l)||["-",0,0],w=E[0],C=60*+E[1]+ +E[2];return C===0?0:w==="+"?C:-C}(n),n===null))return this;var g=Math.abs(n)<=16?60*n:n,v=this;if(A)return v.$offset=g,v.$u=n===0,v;if(n!==0){var k=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(v=this.local().add(g+k,r)).$offset=g,v.$x.$localOffset=k}else v=this.utc();return v};var m=u.format;u.format=function(n){var A=n||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return m.call(this,A)},u.valueOf=function(){var n=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*n},u.isUTC=function(){return!!this.$u},u.toISOString=function(){return this.toDate().toISOString()},u.toString=function(){return this.toDate().toUTCString()};var f=u.toDate;u.toDate=function(n){return n==="s"&&this.$offset?d(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():f.call(this)};var h=u.diff;u.diff=function(n,A,b){if(n&&this.$u===n.$u)return h.call(this,n,A,b);var g=this.local(),v=d(n).local();return h.call(g,v,A,b)}}})})(ae);const se=ae.exports;var te={exports:{}};(function(e,a){(function(r,s){e.exports=s()})(q,function(){var r={year:0,month:1,day:2,hour:3,minute:4,second:5},s={};return function(l,c,o){var d,u=function(m,f,h){h===void 0&&(h={});var n=new Date(m),A=function(b,g){g===void 0&&(g={});var v=g.timeZoneName||"short",k=b+"|"+v,_=s[k];return _||(_=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:b,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:v}),s[k]=_),_}(f,h);return A.formatToParts(n)},T=function(m,f){for(var h=u(m,f),n=[],A=0;A<h.length;A+=1){var b=h[A],g=b.type,v=b.value,k=r[g];k>=0&&(n[k]=parseInt(v,10))}var _=n[3],B=_===24?0:_,E=n[0]+"-"+n[1]+"-"+n[2]+" "+B+":"+n[4]+":"+n[5]+":000",w=+m;return(o.utc(E).valueOf()-(w-=w%1e3))/6e4},S=c.prototype;S.tz=function(m,f){m===void 0&&(m=d);var h=this.utcOffset(),n=this.toDate(),A=n.toLocaleString("en-US",{timeZone:m}),b=Math.round((n-new Date(A))/1e3/60),g=o(A,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(15*-Math.round(n.getTimezoneOffset()/15)-b,!0);if(f){var v=g.utcOffset();g=g.add(h-v,"minute")}return g.$x.$timezone=m,g},S.offsetName=function(m){var f=this.$x.$timezone||o.tz.guess(),h=u(this.valueOf(),f,{timeZoneName:m}).find(function(n){return n.type.toLowerCase()==="timezonename"});return h&&h.value};var y=S.startOf;S.startOf=function(m,f){if(!this.$x||!this.$x.$timezone)return y.call(this,m,f);var h=o(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return y.call(h,m,f).tz(this.$x.$timezone,!0)},o.tz=function(m,f,h){var n=h&&f,A=h||f||d,b=T(+o(),A);if(typeof m!="string")return o(m).tz(A);var g=function(B,E,w){var C=B-60*E*1e3,D=T(C,w);if(E===D)return[C,E];var I=T(C-=60*(D-E)*1e3,w);return D===I?[C,D]:[B-60*Math.min(D,I)*1e3,Math.max(D,I)]}(o.utc(m,n).valueOf(),b,A),v=g[0],k=g[1],_=o(v).utcOffset(k);return _.$x.$timezone=A,_},o.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},o.tz.setDefault=function(m){d=m}}})})(te);const ce=te.exports,le=["Africa/Abidjan","Africa/Accra","Africa/Addis_Ababa","Africa/Algiers","Africa/Asmara","Africa/Asmera","Africa/Bamako","Africa/Bangui","Africa/Banjul","Africa/Bissau","Africa/Blantyre","Africa/Brazzaville","Africa/Bujumbura","Africa/Cairo","Africa/Casablanca","Africa/Ceuta","Africa/Conakry","Africa/Dakar","Africa/Dar_es_Salaam","Africa/Djibouti","Africa/Douala","Africa/El_Aaiun","Africa/Freetown","Africa/Gaborone","Africa/Harare","Africa/Johannesburg","Africa/Juba","Africa/Kampala","Africa/Khartoum","Africa/Kigali","Africa/Kinshasa","Africa/Lagos","Africa/Libreville","Africa/Lome","Africa/Luanda","Africa/Lubumbashi","Africa/Lusaka","Africa/Malabo","Africa/Maputo","Africa/Maseru","Africa/Mbabane","Africa/Mogadishu","Africa/Monrovia","Africa/Nairobi","Africa/Ndjamena","Africa/Niamey","Africa/Nouakchott","Africa/Ouagadougou","Africa/Porto-Novo","Africa/Sao_Tome","Africa/Timbuktu","Africa/Tripoli","Africa/Tunis","Africa/Windhoek","America/Adak","America/Anchorage","America/Anguilla","America/Antigua","America/Araguaina","America/Argentina/Buenos_Aires","America/Argentina/Catamarca","America/Argentina/ComodRivadavia","America/Argentina/Cordoba","America/Argentina/Jujuy","America/Argentina/La_Rioja","America/Argentina/Mendoza","America/Argentina/Rio_Gallegos","America/Argentina/Salta","America/Argentina/San_Juan","America/Argentina/San_Luis","America/Argentina/Tucuman","America/Argentina/Ushuaia","America/Aruba","America/Asuncion","America/Atikokan","America/Atka","America/Bahia","America/Bahia_Banderas","America/Barbados","America/Belem","America/Belize","America/Blanc-Sablon","America/Boa_Vista","America/Bogota","America/Boise","America/Buenos_Aires","America/Cambridge_Bay","America/Campo_Grande","America/Cancun","America/Caracas","America/Catamarca","America/Cayenne","America/Cayman","America/Chicago","America/Chihuahua","America/Coral_Harbour","America/Cordoba","America/Costa_Rica","America/Creston","America/Cuiaba","America/Curacao","America/Danmarkshavn","America/Dawson","America/Dawson_Creek","America/Denver","America/Detroit","America/Dominica","America/Edmonton","America/Eirunepe","America/El_Salvador","America/Ensenada","America/Fort_Nelson","America/Fort_Wayne","America/Fortaleza","America/Glace_Bay","America/Godthab","America/Goose_Bay","America/Grand_Turk","America/Grenada","America/Guadeloupe","America/Guatemala","America/Guayaquil","America/Guyana","America/Halifax","America/Havana","America/Hermosillo","America/Indiana/Indianapolis","America/Indiana/Knox","America/Indiana/Marengo","America/Indiana/Petersburg","America/Indiana/Tell_City","America/Indiana/Vevay","America/Indiana/Vincennes","America/Indiana/Winamac","America/Indianapolis","America/Inuvik","America/Iqaluit","America/Jamaica","America/Jujuy","America/Juneau","America/Kentucky/Louisville","America/Kentucky/Monticello","America/Knox_IN","America/Kralendijk","America/La_Paz","America/Lima","America/Los_Angeles","America/Louisville","America/Lower_Princes","America/Maceio","America/Managua","America/Manaus","America/Marigot","America/Martinique","America/Matamoros","America/Mazatlan","America/Mendoza","America/Menominee","America/Merida","America/Metlakatla","America/Mexico_City","America/Miquelon","America/Moncton","America/Monterrey","America/Montevideo","America/Montreal","America/Montserrat","America/Nassau","America/New_York","America/Nipigon","America/Nome","America/Noronha","America/North_Dakota/Beulah","America/North_Dakota/Center","America/North_Dakota/New_Salem","America/Nuuk","America/Ojinaga","America/Panama","America/Pangnirtung","America/Paramaribo","America/Phoenix","America/Port-au-Prince","America/Port_of_Spain","America/Porto_Acre","America/Porto_Velho","America/Puerto_Rico","America/Punta_Arenas","America/Rainy_River","America/Rankin_Inlet","America/Recife","America/Regina","America/Resolute","America/Rio_Branco","America/Rosario","America/Santa_Isabel","America/Santarem","America/Santiago","America/Santo_Domingo","America/Sao_Paulo","America/Scoresbysund","America/Shiprock","America/Sitka","America/St_Barthelemy","America/St_Johns","America/St_Kitts","America/St_Lucia","America/St_Thomas","America/St_Vincent","America/Swift_Current","America/Tegucigalpa","America/Thule","America/Thunder_Bay","America/Tijuana","America/Toronto","America/Tortola","America/Vancouver","America/Virgin","America/Whitehorse","America/Winnipeg","America/Yakutat","America/Yellowknife","Antarctica/Casey","Antarctica/Davis","Antarctica/DumontDUrville","Antarctica/Macquarie","Antarctica/Mawson","Antarctica/McMurdo","Antarctica/Palmer","Antarctica/Rothera","Antarctica/South_Pole","Antarctica/Syowa","Antarctica/Troll","Antarctica/Vostok","Arctic/Longyearbyen","Asia/Aden","Asia/Almaty","Asia/Amman","Asia/Anadyr","Asia/Aqtau","Asia/Aqtobe","Asia/Ashgabat","Asia/Ashkhabad","Asia/Atyrau","Asia/Baghdad","Asia/Bahrain","Asia/Baku","Asia/Bangkok","Asia/Barnaul","Asia/Beirut","Asia/Bishkek","Asia/Brunei","Asia/Calcutta","Asia/Chita","Asia/Choibalsan","Asia/Chongqing","Asia/Chungking","Asia/Colombo","Asia/Dacca","Asia/Damascus","Asia/Dhaka","Asia/Dili","Asia/Dubai","Asia/Dushanbe","Asia/Famagusta","Asia/Gaza","Asia/Harbin","Asia/Hebron","Asia/Ho_Chi_Minh","Asia/Hong_Kong","Asia/Hovd","Asia/Irkutsk","Asia/Istanbul","Asia/Jakarta","Asia/Jayapura","Asia/Jerusalem","Asia/Kabul","Asia/Kamchatka","Asia/Karachi","Asia/Kashgar","Asia/Kathmandu","Asia/Katmandu","Asia/Khandyga","Asia/Kolkata","Asia/Krasnoyarsk","Asia/Kuala_Lumpur","Asia/Kuching","Asia/Kuwait","Asia/Macao","Asia/Macau","Asia/Magadan","Asia/Makassar","Asia/Manila","Asia/Muscat","Asia/Nicosia","Asia/Novokuznetsk","Asia/Novosibirsk","Asia/Omsk","Asia/Oral","Asia/Phnom_Penh","Asia/Pontianak","Asia/Pyongyang","Asia/Qatar","Asia/Qostanay","Asia/Qyzylorda","Asia/Rangoon","Asia/Riyadh","Asia/Saigon","Asia/Sakhalin","Asia/Samarkand","Asia/Seoul","Asia/Shanghai","Asia/Singapore","Asia/Srednekolymsk","Asia/Taipei","Asia/Tashkent","Asia/Tbilisi","Asia/Tehran","Asia/Tel_Aviv","Asia/Thimbu","Asia/Thimphu","Asia/Tokyo","Asia/Tomsk","Asia/Ujung_Pandang","Asia/Ulaanbaatar","Asia/Ulan_Bator","Asia/Urumqi","Asia/Ust-Nera","Asia/Vientiane","Asia/Vladivostok","Asia/Yakutsk","Asia/Yangon","Asia/Yekaterinburg","Asia/Yerevan","Atlantic/Azores","Atlantic/Bermuda","Atlantic/Canary","Atlantic/Cape_Verde","Atlantic/Faeroe","Atlantic/Faroe","Atlantic/Jan_Mayen","Atlantic/Madeira","Atlantic/Reykjavik","Atlantic/South_Georgia","Atlantic/St_Helena","Atlantic/Stanley","Australia/ACT","Australia/Adelaide","Australia/Brisbane","Australia/Broken_Hill","Australia/Canberra","Australia/Currie","Australia/Darwin","Australia/Eucla","Australia/Hobart","Australia/LHI","Australia/Lindeman","Australia/Lord_Howe","Australia/Melbourne","Australia/NSW","Australia/North","Australia/Perth","Australia/Queensland","Australia/South","Australia/Sydney","Australia/Tasmania","Australia/Victoria","Australia/West","Australia/Yancowinna","Brazil/Acre","Brazil/DeNoronha","Brazil/East","Brazil/West","CET","CST6CDT","Canada/Atlantic","Canada/Central","Canada/Eastern","Canada/Mountain","Canada/Newfoundland","Canada/Pacific","Canada/Saskatchewan","Canada/Yukon","Chile/Continental","Chile/EasterIsland","Cuba","EET","EST","EST5EDT","Egypt","Eire","Etc/GMT","Etc/GMT+0","Etc/GMT+1","Etc/GMT+10","Etc/GMT+11","Etc/GMT+12","Etc/GMT+2","Etc/GMT+3","Etc/GMT+4","Etc/GMT+5","Etc/GMT+6","Etc/GMT+7","Etc/GMT+8","Etc/GMT+9","Etc/GMT-0","Etc/GMT-1","Etc/GMT-10","Etc/GMT-11","Etc/GMT-12","Etc/GMT-13","Etc/GMT-14","Etc/GMT-2","Etc/GMT-3","Etc/GMT-4","Etc/GMT-5","Etc/GMT-6","Etc/GMT-7","Etc/GMT-8","Etc/GMT-9","Etc/GMT0","Etc/Greenwich","Etc/UCT","Etc/UTC","Etc/Universal","Etc/Zulu","Europe/Amsterdam","Europe/Andorra","Europe/Astrakhan","Europe/Athens","Europe/Belfast","Europe/Belgrade","Europe/Berlin","Europe/Bratislava","Europe/Brussels","Europe/Bucharest","Europe/Budapest","Europe/Busingen","Europe/Chisinau","Europe/Copenhagen","Europe/Dublin","Europe/Gibraltar","Europe/Guernsey","Europe/Helsinki","Europe/Isle_of_Man","Europe/Istanbul","Europe/Jersey","Europe/Kaliningrad","Europe/Kiev","Europe/Kirov","Europe/Lisbon","Europe/Ljubljana","Europe/London","Europe/Luxembourg","Europe/Madrid","Europe/Malta","Europe/Mariehamn","Europe/Minsk","Europe/Monaco","Europe/Moscow","Europe/Nicosia","Europe/Oslo","Europe/Paris","Europe/Podgorica","Europe/Prague","Europe/Riga","Europe/Rome","Europe/Samara","Europe/San_Marino","Europe/Sarajevo","Europe/Saratov","Europe/Simferopol","Europe/Skopje","Europe/Sofia","Europe/Stockholm","Europe/Tallinn","Europe/Tirane","Europe/Tiraspol","Europe/Ulyanovsk","Europe/Uzhgorod","Europe/Vaduz","Europe/Vatican","Europe/Vienna","Europe/Vilnius","Europe/Volgograd","Europe/Warsaw","Europe/Zagreb","Europe/Zaporozhye","Europe/Zurich","GB","GB-Eire","GMT","GMT+0","GMT-0","GMT0","Greenwich","HST","Hongkong","Iceland","Indian/Antananarivo","Indian/Chagos","Indian/Christmas","Indian/Cocos","Indian/Comoro","Indian/Kerguelen","Indian/Mahe","Indian/Maldives","Indian/Mauritius","Indian/Mayotte","Indian/Reunion","Iran","Israel","Jamaica","Japan","Kwajalein","Libya","MET","MST","MST7MDT","Mexico/BajaNorte","Mexico/BajaSur","Mexico/General","NZ","NZ-CHAT","Navajo","PRC","PST8PDT","Pacific/Apia","Pacific/Auckland","Pacific/Bougainville","Pacific/Chatham","Pacific/Chuuk","Pacific/Easter","Pacific/Efate","Pacific/Enderbury","Pacific/Fakaofo","Pacific/Fiji","Pacific/Funafuti","Pacific/Galapagos","Pacific/Gambier","Pacific/Guadalcanal","Pacific/Guam","Pacific/Honolulu","Pacific/Johnston","Pacific/Kiritimati","Pacific/Kosrae","Pacific/Kwajalein","Pacific/Majuro","Pacific/Marquesas","Pacific/Midway","Pacific/Nauru","Pacific/Niue","Pacific/Norfolk","Pacific/Noumea","Pacific/Pago_Pago","Pacific/Palau","Pacific/Pitcairn","Pacific/Pohnpei","Pacific/Ponape","Pacific/Port_Moresby","Pacific/Rarotonga","Pacific/Saipan","Pacific/Samoa","Pacific/Tahiti","Pacific/Tarawa","Pacific/Tongatapu","Pacific/Truk","Pacific/Wake","Pacific/Wallis","Pacific/Yap","Poland","Portugal","ROC","ROK","Singapore","Turkey","UCT","US/Alaska","US/Aleutian","US/Arizona","US/Central","US/East-Indiana","US/Eastern","US/Hawaii","US/Indiana-Starke","US/Michigan","US/Mountain","US/Pacific","US/Pacific-New","US/Samoa","UTC","Universal","W-SU","WET","Zulu"],ue={props:{index:Number,initialField:Object},data:function(){return{field:this.initialField}},methods:{persistedField:function(){return this.field.id>=1},saveField:function(){let e=this.field;this.persistedField()?p.fetch(`/api/v1/configs/fields/${this.field.id}`,{method:"PATCH",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e)}).then(a=>a.json()).then(a=>{a.success===!0&&(this.field=a.data,K({title:"Succ\xE8s",body:"Field has been updated!",delay:1e3}))}):p.fetch("/api/v1/configs/fields",{method:"POST",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e)}).then(a=>a.json()).then(a=>{a.success===!0&&(this.field=a.data,K({title:"Succ\xE8s",body:"Field has been created!",delay:1e3}))})},deleteField:function(){confirm("Are you sure you'd like to delete this field?")&&(this.persistedField()?p.fetch(`/api/v1/configs/fields/${this.field.id}`,{method:"DELETE",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}}).then(e=>e.json()).then(e=>{e.success===!0&&this.$emit("remove-field",this.index)}):this.$emit("remove-field",this.index))}}},de={class:"border-bottom"},me=i("span",{"aria-hidden":"true"},"\xD7",-1),fe=[me],he={class:"row"},Ae={class:"col-md-3"},pe={class:"form-group"},ge=i("label",null,"Field Type",-1),ve=i("option",{value:"text"},"Text Field",-1),be=i("option",{value:"boolean"},"Checkbox",-1),_e=[ve,be],ye=i("small",{class:"form-text text-muted"},"Type of field shown to the user",-1),ke={class:"col-md-9"},Ee={class:"form-group"},Te=i("label",null,"Field Name",-1),Se=i("small",{class:"form-text text-muted"},"Field name",-1),Me={class:"col-md-12"},Ce={class:"form-group"},$e=i("label",null,"Field Description",-1),Pe=i("small",{id:"emailHelp",class:"form-text text-muted"},"Field Description",-1),Be={class:"col-md-12"},we={class:"form-check"},ze={class:"form-check-label"},De={class:"form-check"},xe={class:"form-check-label"},Ne={class:"form-check"},je={class:"form-check-label"},Ge={class:"row pb-3"},Oe={class:"col-md-12"},Ie={class:"d-block"};function Fe(e,a,r,s,l,c){return $(),P("div",de,[i("div",null,[i("button",{type:"button",class:"close float-right","aria-label":"Close",onClick:a[0]||(a[0]=o=>c.deleteField())},fe)]),i("div",he,[i("div",Ae,[i("div",pe,[ge,M(i("select",{class:"form-control custom-select","onUpdate:modelValue":a[1]||(a[1]=o=>e.field.field_type=o)},_e,512),[[W,e.field.field_type,void 0,{lazy:!0}]]),ye])]),i("div",ke,[i("div",Ee,[Te,M(i("input",{type:"text",class:"form-control","onUpdate:modelValue":a[2]||(a[2]=o=>e.field.name=o)},null,512),[[j,e.field.name,void 0,{lazy:!0}]]),Se])]),i("div",Me,[i("div",Ce,[$e,M(i("input",{type:"text",class:"form-control","onUpdate:modelValue":a[3]||(a[3]=o=>e.field.description=o)},null,512),[[j,e.field.description,void 0,{lazy:!0}]]),Pe])]),i("div",Be,[i("div",we,[i("label",ze,[M(i("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":a[4]||(a[4]=o=>e.field.editable=o)},null,512),[[F,e.field.editable,void 0,{lazy:!0}]]),U(" Editable by user in profile ")])]),i("div",De,[i("label",xe,[M(i("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":a[5]||(a[5]=o=>e.field.required=o)},null,512),[[F,e.field.required,void 0,{lazy:!0}]]),U(" Required on registration ")])]),i("div",Ne,[i("label",je,[M(i("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":a[6]||(a[6]=o=>e.field.public=o)},null,512),[[F,e.field.public,void 0,{lazy:!0}]]),U(" Shown on public profile ")])])])]),i("div",Ge,[i("div",Oe,[i("div",Ie,[i("button",{class:"btn btn-sm btn-success btn-outlined float-right",type:"button",onClick:a[7]||(a[7]=o=>c.saveField())}," Save ")])])])])}const Ue=G(ue,[["render",Fe]]),Le={name:"FieldList",components:{Field:Ue},props:{type:String},data:function(){return{fields:[]}},methods:{loadFields:function(){p.fetch(`/api/v1/configs/fields?type=${this.type}`,{method:"GET",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}}).then(e=>e.json()).then(e=>{this.fields=e.data})},addField:function(){this.fields.push({id:Math.random(),type:this.type,field_type:"text",name:"",description:"",editable:!1,required:!1,public:!1})},removeField:function(e){this.fields.splice(e,1),console.log(this.fields)}},created(){this.loadFields()}},Ve={class:"row"},He={class:"col text-center"};function Ke(e,a,r,s,l,c){const o=Z("Field");return $(),P("div",null,[($(!0),P(Q,null,X(e.fields,(d,u)=>($(),P("div",{class:"mb-5",key:d.id},[ee(o,{index:u,initialField:e.fields[u],onRemoveField:c.removeField},null,8,["index","initialField","onRemoveField"])]))),128)),i("div",Ve,[i("div",He,[i("button",{class:"btn btn-sm btn-success btn-outlined m-auto",type:"button",onClick:a[0]||(a[0]=d=>c.addField())}," Add New Field ")])])])}const Re=G(Le,[["render",Ke]]),Ye={props:{index:Number,initialBracket:Object},data:function(){return{bracket:this.initialBracket}},methods:{persisted:function(){return this.bracket.id>=1},saveBracket:function(){let e=this.bracket,a="",r="",s="";this.persisted()?(a=`/api/v1/brackets/${this.bracket.id}`,r="PATCH",s="Bracket has been updated!"):(a="/api/v1/brackets",r="POST",s="Bracket has been created!"),p.fetch(a,{method:r,credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e)}).then(l=>l.json()).then(l=>{l.success===!0&&(this.field=l.data,K({title:"Succ\xE8s",body:s,delay:1e3}))})},deleteBracket:function(){confirm("Are you sure you'd like to delete this bracket?")&&(this.persisted()?p.fetch(`/api/v1/brackets/${this.bracket.id}`,{method:"DELETE",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}}).then(e=>e.json()).then(e=>{e.success===!0&&this.$emit("remove-bracket",this.index)}):this.$emit("remove-bracket",this.index))}}},Je={class:"border-bottom"},qe=i("span",{"aria-hidden":"true"},"\xD7",-1),We=[qe],Ze={class:"row"},Qe={class:"col-md-9"},Xe={class:"form-group"},ea=i("label",null,"Bracket Name",-1),aa=i("small",{class:"form-text text-muted"},' Bracket name (e.g. "Students", "Interns", "Engineers") ',-1),ta={class:"col-md-12"},ia={class:"form-group"},oa=i("label",null,"Bracket Description",-1),na=i("small",{class:"form-text text-muted"},"Bracket Description",-1),ra={class:"col-md-12"},sa=i("label",null,"Bracket Type",-1),ca=i("option",null,null,-1),la=i("option",{value:"users"},"Users",-1),ua=i("option",{value:"teams"},"Teams",-1),da=[ca,la,ua],ma=i("small",{class:"form-text text-muted"}," If you are using Team Mode and would like the bracket to apply to entire teams instead of individuals, select Teams. ",-1),fa={class:"row pb-3"},ha={class:"col-md-12"},Aa={class:"d-block"};function pa(e,a,r,s,l,c){return $(),P("div",Je,[i("div",null,[i("button",{type:"button",class:"close float-right","aria-label":"Close",onClick:a[0]||(a[0]=o=>c.deleteBracket())},We)]),i("div",Ze,[i("div",Qe,[i("div",Xe,[ea,M(i("input",{type:"text",class:"form-control","onUpdate:modelValue":a[1]||(a[1]=o=>e.bracket.name=o)},null,512),[[j,e.bracket.name,void 0,{lazy:!0}]]),aa])]),i("div",ta,[i("div",ia,[oa,M(i("input",{type:"text",class:"form-control","onUpdate:modelValue":a[2]||(a[2]=o=>e.bracket.description=o)},null,512),[[j,e.bracket.description,void 0,{lazy:!0}]]),na])]),i("div",ra,[sa,M(i("select",{class:"custom-select","onUpdate:modelValue":a[3]||(a[3]=o=>e.bracket.type=o)},da,512),[[W,e.bracket.type,void 0,{lazy:!0}]]),ma])]),i("div",fa,[i("div",ha,[i("div",Aa,[i("button",{class:"btn btn-sm btn-success btn-outlined float-right",type:"button",onClick:a[4]||(a[4]=o=>c.saveBracket())}," Save ")])])])])}const ga=G(Ye,[["render",pa]]),va={name:"BracketList",components:{Bracket:ga},data:function(){return{brackets:[]}},methods:{loadBrackets:function(){p.fetch("/api/v1/brackets",{method:"GET",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}}).then(e=>e.json()).then(e=>{this.brackets=e.data})},addBracket:function(){this.brackets.push({id:Math.random(),name:"",description:"",type:null})},removeBracket:function(e){this.brackets.splice(e,1)}},created(){this.loadBrackets()}},ba={class:"row"},_a={class:"col text-center"};function ya(e,a,r,s,l,c){const o=Z("Bracket");return $(),P("div",null,[($(!0),P(Q,null,X(e.brackets,(d,u)=>($(),P("div",{class:"mb-5",key:d.id},[ee(o,{index:u,initialBracket:e.brackets[u],onRemoveBracket:c.removeBracket},null,8,["index","initialBracket","onRemoveBracket"])]))),128)),i("div",ba,[i("div",_a,[i("button",{class:"btn btn-sm btn-success btn-outlined m-auto",type:"button",onClick:a[0]||(a[0]=d=>c.addBracket())}," Add New Bracket ")])])])}const ka=G(va,[["render",ya]]);x.extend(re);x.extend(se);x.extend(ce);function V(e,a){typeof a=="string"&&(a=parseInt(a,10)*1e3);const r=x(a);t("#"+e+"-month").val(r.month()+1),t("#"+e+"-day").val(r.date()),t("#"+e+"-year").val(r.year()),t("#"+e+"-hour").val(r.hour()),t("#"+e+"-minute").val(r.minute()),N(e)}function N(e){const a=t("#"+e+"-month").val(),r=t("#"+e+"-day").val(),s=t("#"+e+"-year").val(),l=t("#"+e+"-hour").val(),c=t("#"+e+"-minute").val(),o=t("#"+e+"-timezone").val(),d=Ea(a,r,s,l,c);d.unix()&&a&&r&&s&&l&&c?(t("#"+e).val(d.unix()),t("#"+e+"-local").val(d.format("dddd, MMMM Do YYYY, h:mm:ss a z (zzz)")),t("#"+e+"-zonetime").val(d.tz(o).format("dddd, MMMM Do YYYY, h:mm:ss a z (zzz)"))):(t("#"+e).val(""),t("#"+e+"-local").val(""),t("#"+e+"-zonetime").val(""))}function Ea(e,a,r,s,l){let c=e.toString();c.length==1&&(c="0"+c);let o=a.toString();o.length==1&&(o="0"+o);let d=s.toString();d.length==1&&(d="0"+d);let u=l.toString();u.length==1&&(u="0"+u);const T=r.toString()+"-"+c+"-"+o+" "+d+":"+u+":00";return x(T)}function ie(e){e.preventDefault();const a=t(this).serializeJSON(),r={};a.mail_useauth===!1?(a.mail_username=null,a.mail_password=null):(a.mail_username===""&&delete a.mail_username,a.mail_password===""&&delete a.mail_password),Object.keys(a).forEach(function(s){a[s]==="true"?r[s]=!0:a[s]==="false"?r[s]=!1:r[s]=a[s]}),p.api.patch_config_list({},r).then(function(s){if(s.success)window.location.reload();else{let l=s.errors.value.join(` +import{I as q,_ as G,C as p,E as K,o as $,c as P,a as i,h as M,v as W,m as j,i as F,k as U,e as Z,F as Q,r as X,f as ee,J as x,L as re,j as t,V as J,D as O,u as R,x as Y,M as z}from"./main.b0151f5b.js";import"../tab.12dd2b64.js";import{c as L}from"../htmlmixed.245897c1.js";var ae={exports:{}};(function(e,a){(function(r,s){e.exports=s()})(q,function(){var r="minute",s=/[+-]\d\d(?::?\d\d)?/g,l=/([+-]|\d\d)/g;return function(c,o,d){var u=o.prototype;d.utc=function(n){var A={date:n,utc:!0,args:arguments};return new o(A)},u.utc=function(n){var A=d(this.toDate(),{locale:this.$L,utc:!0});return n?A.add(this.utcOffset(),r):A},u.local=function(){return d(this.toDate(),{locale:this.$L,utc:!1})};var T=u.parse;u.parse=function(n){n.utc&&(this.$u=!0),this.$utils().u(n.$offset)||(this.$offset=n.$offset),T.call(this,n)};var S=u.init;u.init=function(){if(this.$u){var n=this.$d;this.$y=n.getUTCFullYear(),this.$M=n.getUTCMonth(),this.$D=n.getUTCDate(),this.$W=n.getUTCDay(),this.$H=n.getUTCHours(),this.$m=n.getUTCMinutes(),this.$s=n.getUTCSeconds(),this.$ms=n.getUTCMilliseconds()}else S.call(this)};var y=u.utcOffset;u.utcOffset=function(n,A){var b=this.$utils().u;if(b(n))return this.$u?0:b(this.$offset)?y.call(this):this.$offset;if(typeof n=="string"&&(n=function(_){_===void 0&&(_="");var B=_.match(s);if(!B)return null;var E=(""+B[0]).match(l)||["-",0,0],w=E[0],C=60*+E[1]+ +E[2];return C===0?0:w==="+"?C:-C}(n),n===null))return this;var g=Math.abs(n)<=16?60*n:n,v=this;if(A)return v.$offset=g,v.$u=n===0,v;if(n!==0){var k=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(v=this.local().add(g+k,r)).$offset=g,v.$x.$localOffset=k}else v=this.utc();return v};var m=u.format;u.format=function(n){var A=n||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return m.call(this,A)},u.valueOf=function(){var n=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*n},u.isUTC=function(){return!!this.$u},u.toISOString=function(){return this.toDate().toISOString()},u.toString=function(){return this.toDate().toUTCString()};var f=u.toDate;u.toDate=function(n){return n==="s"&&this.$offset?d(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():f.call(this)};var h=u.diff;u.diff=function(n,A,b){if(n&&this.$u===n.$u)return h.call(this,n,A,b);var g=this.local(),v=d(n).local();return h.call(g,v,A,b)}}})})(ae);const se=ae.exports;var te={exports:{}};(function(e,a){(function(r,s){e.exports=s()})(q,function(){var r={year:0,month:1,day:2,hour:3,minute:4,second:5},s={};return function(l,c,o){var d,u=function(m,f,h){h===void 0&&(h={});var n=new Date(m),A=function(b,g){g===void 0&&(g={});var v=g.timeZoneName||"short",k=b+"|"+v,_=s[k];return _||(_=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:b,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:v}),s[k]=_),_}(f,h);return A.formatToParts(n)},T=function(m,f){for(var h=u(m,f),n=[],A=0;A<h.length;A+=1){var b=h[A],g=b.type,v=b.value,k=r[g];k>=0&&(n[k]=parseInt(v,10))}var _=n[3],B=_===24?0:_,E=n[0]+"-"+n[1]+"-"+n[2]+" "+B+":"+n[4]+":"+n[5]+":000",w=+m;return(o.utc(E).valueOf()-(w-=w%1e3))/6e4},S=c.prototype;S.tz=function(m,f){m===void 0&&(m=d);var h=this.utcOffset(),n=this.toDate(),A=n.toLocaleString("en-US",{timeZone:m}),b=Math.round((n-new Date(A))/1e3/60),g=o(A,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(15*-Math.round(n.getTimezoneOffset()/15)-b,!0);if(f){var v=g.utcOffset();g=g.add(h-v,"minute")}return g.$x.$timezone=m,g},S.offsetName=function(m){var f=this.$x.$timezone||o.tz.guess(),h=u(this.valueOf(),f,{timeZoneName:m}).find(function(n){return n.type.toLowerCase()==="timezonename"});return h&&h.value};var y=S.startOf;S.startOf=function(m,f){if(!this.$x||!this.$x.$timezone)return y.call(this,m,f);var h=o(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return y.call(h,m,f).tz(this.$x.$timezone,!0)},o.tz=function(m,f,h){var n=h&&f,A=h||f||d,b=T(+o(),A);if(typeof m!="string")return o(m).tz(A);var g=function(B,E,w){var C=B-60*E*1e3,D=T(C,w);if(E===D)return[C,E];var I=T(C-=60*(D-E)*1e3,w);return D===I?[C,D]:[B-60*Math.min(D,I)*1e3,Math.max(D,I)]}(o.utc(m,n).valueOf(),b,A),v=g[0],k=g[1],_=o(v).utcOffset(k);return _.$x.$timezone=A,_},o.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},o.tz.setDefault=function(m){d=m}}})})(te);const ce=te.exports,le=["Africa/Abidjan","Africa/Accra","Africa/Addis_Ababa","Africa/Algiers","Africa/Asmara","Africa/Asmera","Africa/Bamako","Africa/Bangui","Africa/Banjul","Africa/Bissau","Africa/Blantyre","Africa/Brazzaville","Africa/Bujumbura","Africa/Cairo","Africa/Casablanca","Africa/Ceuta","Africa/Conakry","Africa/Dakar","Africa/Dar_es_Salaam","Africa/Djibouti","Africa/Douala","Africa/El_Aaiun","Africa/Freetown","Africa/Gaborone","Africa/Harare","Africa/Johannesburg","Africa/Juba","Africa/Kampala","Africa/Khartoum","Africa/Kigali","Africa/Kinshasa","Africa/Lagos","Africa/Libreville","Africa/Lome","Africa/Luanda","Africa/Lubumbashi","Africa/Lusaka","Africa/Malabo","Africa/Maputo","Africa/Maseru","Africa/Mbabane","Africa/Mogadishu","Africa/Monrovia","Africa/Nairobi","Africa/Ndjamena","Africa/Niamey","Africa/Nouakchott","Africa/Ouagadougou","Africa/Porto-Novo","Africa/Sao_Tome","Africa/Timbuktu","Africa/Tripoli","Africa/Tunis","Africa/Windhoek","America/Adak","America/Anchorage","America/Anguilla","America/Antigua","America/Araguaina","America/Argentina/Buenos_Aires","America/Argentina/Catamarca","America/Argentina/ComodRivadavia","America/Argentina/Cordoba","America/Argentina/Jujuy","America/Argentina/La_Rioja","America/Argentina/Mendoza","America/Argentina/Rio_Gallegos","America/Argentina/Salta","America/Argentina/San_Juan","America/Argentina/San_Luis","America/Argentina/Tucuman","America/Argentina/Ushuaia","America/Aruba","America/Asuncion","America/Atikokan","America/Atka","America/Bahia","America/Bahia_Banderas","America/Barbados","America/Belem","America/Belize","America/Blanc-Sablon","America/Boa_Vista","America/Bogota","America/Boise","America/Buenos_Aires","America/Cambridge_Bay","America/Campo_Grande","America/Cancun","America/Caracas","America/Catamarca","America/Cayenne","America/Cayman","America/Chicago","America/Chihuahua","America/Coral_Harbour","America/Cordoba","America/Costa_Rica","America/Creston","America/Cuiaba","America/Curacao","America/Danmarkshavn","America/Dawson","America/Dawson_Creek","America/Denver","America/Detroit","America/Dominica","America/Edmonton","America/Eirunepe","America/El_Salvador","America/Ensenada","America/Fort_Nelson","America/Fort_Wayne","America/Fortaleza","America/Glace_Bay","America/Godthab","America/Goose_Bay","America/Grand_Turk","America/Grenada","America/Guadeloupe","America/Guatemala","America/Guayaquil","America/Guyana","America/Halifax","America/Havana","America/Hermosillo","America/Indiana/Indianapolis","America/Indiana/Knox","America/Indiana/Marengo","America/Indiana/Petersburg","America/Indiana/Tell_City","America/Indiana/Vevay","America/Indiana/Vincennes","America/Indiana/Winamac","America/Indianapolis","America/Inuvik","America/Iqaluit","America/Jamaica","America/Jujuy","America/Juneau","America/Kentucky/Louisville","America/Kentucky/Monticello","America/Knox_IN","America/Kralendijk","America/La_Paz","America/Lima","America/Los_Angeles","America/Louisville","America/Lower_Princes","America/Maceio","America/Managua","America/Manaus","America/Marigot","America/Martinique","America/Matamoros","America/Mazatlan","America/Mendoza","America/Menominee","America/Merida","America/Metlakatla","America/Mexico_City","America/Miquelon","America/Moncton","America/Monterrey","America/Montevideo","America/Montreal","America/Montserrat","America/Nassau","America/New_York","America/Nipigon","America/Nome","America/Noronha","America/North_Dakota/Beulah","America/North_Dakota/Center","America/North_Dakota/New_Salem","America/Nuuk","America/Ojinaga","America/Panama","America/Pangnirtung","America/Paramaribo","America/Phoenix","America/Port-au-Prince","America/Port_of_Spain","America/Porto_Acre","America/Porto_Velho","America/Puerto_Rico","America/Punta_Arenas","America/Rainy_River","America/Rankin_Inlet","America/Recife","America/Regina","America/Resolute","America/Rio_Branco","America/Rosario","America/Santa_Isabel","America/Santarem","America/Santiago","America/Santo_Domingo","America/Sao_Paulo","America/Scoresbysund","America/Shiprock","America/Sitka","America/St_Barthelemy","America/St_Johns","America/St_Kitts","America/St_Lucia","America/St_Thomas","America/St_Vincent","America/Swift_Current","America/Tegucigalpa","America/Thule","America/Thunder_Bay","America/Tijuana","America/Toronto","America/Tortola","America/Vancouver","America/Virgin","America/Whitehorse","America/Winnipeg","America/Yakutat","America/Yellowknife","Antarctica/Casey","Antarctica/Davis","Antarctica/DumontDUrville","Antarctica/Macquarie","Antarctica/Mawson","Antarctica/McMurdo","Antarctica/Palmer","Antarctica/Rothera","Antarctica/South_Pole","Antarctica/Syowa","Antarctica/Troll","Antarctica/Vostok","Arctic/Longyearbyen","Asia/Aden","Asia/Almaty","Asia/Amman","Asia/Anadyr","Asia/Aqtau","Asia/Aqtobe","Asia/Ashgabat","Asia/Ashkhabad","Asia/Atyrau","Asia/Baghdad","Asia/Bahrain","Asia/Baku","Asia/Bangkok","Asia/Barnaul","Asia/Beirut","Asia/Bishkek","Asia/Brunei","Asia/Calcutta","Asia/Chita","Asia/Choibalsan","Asia/Chongqing","Asia/Chungking","Asia/Colombo","Asia/Dacca","Asia/Damascus","Asia/Dhaka","Asia/Dili","Asia/Dubai","Asia/Dushanbe","Asia/Famagusta","Asia/Gaza","Asia/Harbin","Asia/Hebron","Asia/Ho_Chi_Minh","Asia/Hong_Kong","Asia/Hovd","Asia/Irkutsk","Asia/Istanbul","Asia/Jakarta","Asia/Jayapura","Asia/Jerusalem","Asia/Kabul","Asia/Kamchatka","Asia/Karachi","Asia/Kashgar","Asia/Kathmandu","Asia/Katmandu","Asia/Khandyga","Asia/Kolkata","Asia/Krasnoyarsk","Asia/Kuala_Lumpur","Asia/Kuching","Asia/Kuwait","Asia/Macao","Asia/Macau","Asia/Magadan","Asia/Makassar","Asia/Manila","Asia/Muscat","Asia/Nicosia","Asia/Novokuznetsk","Asia/Novosibirsk","Asia/Omsk","Asia/Oral","Asia/Phnom_Penh","Asia/Pontianak","Asia/Pyongyang","Asia/Qatar","Asia/Qostanay","Asia/Qyzylorda","Asia/Rangoon","Asia/Riyadh","Asia/Saigon","Asia/Sakhalin","Asia/Samarkand","Asia/Seoul","Asia/Shanghai","Asia/Singapore","Asia/Srednekolymsk","Asia/Taipei","Asia/Tashkent","Asia/Tbilisi","Asia/Tehran","Asia/Tel_Aviv","Asia/Thimbu","Asia/Thimphu","Asia/Tokyo","Asia/Tomsk","Asia/Ujung_Pandang","Asia/Ulaanbaatar","Asia/Ulan_Bator","Asia/Urumqi","Asia/Ust-Nera","Asia/Vientiane","Asia/Vladivostok","Asia/Yakutsk","Asia/Yangon","Asia/Yekaterinburg","Asia/Yerevan","Atlantic/Azores","Atlantic/Bermuda","Atlantic/Canary","Atlantic/Cape_Verde","Atlantic/Faeroe","Atlantic/Faroe","Atlantic/Jan_Mayen","Atlantic/Madeira","Atlantic/Reykjavik","Atlantic/South_Georgia","Atlantic/St_Helena","Atlantic/Stanley","Australia/ACT","Australia/Adelaide","Australia/Brisbane","Australia/Broken_Hill","Australia/Canberra","Australia/Currie","Australia/Darwin","Australia/Eucla","Australia/Hobart","Australia/LHI","Australia/Lindeman","Australia/Lord_Howe","Australia/Melbourne","Australia/NSW","Australia/North","Australia/Perth","Australia/Queensland","Australia/South","Australia/Sydney","Australia/Tasmania","Australia/Victoria","Australia/West","Australia/Yancowinna","Brazil/Acre","Brazil/DeNoronha","Brazil/East","Brazil/West","CET","CST6CDT","Canada/Atlantic","Canada/Central","Canada/Eastern","Canada/Mountain","Canada/Newfoundland","Canada/Pacific","Canada/Saskatchewan","Canada/Yukon","Chile/Continental","Chile/EasterIsland","Cuba","EET","EST","EST5EDT","Egypt","Eire","Etc/GMT","Etc/GMT+0","Etc/GMT+1","Etc/GMT+10","Etc/GMT+11","Etc/GMT+12","Etc/GMT+2","Etc/GMT+3","Etc/GMT+4","Etc/GMT+5","Etc/GMT+6","Etc/GMT+7","Etc/GMT+8","Etc/GMT+9","Etc/GMT-0","Etc/GMT-1","Etc/GMT-10","Etc/GMT-11","Etc/GMT-12","Etc/GMT-13","Etc/GMT-14","Etc/GMT-2","Etc/GMT-3","Etc/GMT-4","Etc/GMT-5","Etc/GMT-6","Etc/GMT-7","Etc/GMT-8","Etc/GMT-9","Etc/GMT0","Etc/Greenwich","Etc/UCT","Etc/UTC","Etc/Universal","Etc/Zulu","Europe/Amsterdam","Europe/Andorra","Europe/Astrakhan","Europe/Athens","Europe/Belfast","Europe/Belgrade","Europe/Berlin","Europe/Bratislava","Europe/Brussels","Europe/Bucharest","Europe/Budapest","Europe/Busingen","Europe/Chisinau","Europe/Copenhagen","Europe/Dublin","Europe/Gibraltar","Europe/Guernsey","Europe/Helsinki","Europe/Isle_of_Man","Europe/Istanbul","Europe/Jersey","Europe/Kaliningrad","Europe/Kiev","Europe/Kirov","Europe/Lisbon","Europe/Ljubljana","Europe/London","Europe/Luxembourg","Europe/Madrid","Europe/Malta","Europe/Mariehamn","Europe/Minsk","Europe/Monaco","Europe/Moscow","Europe/Nicosia","Europe/Oslo","Europe/Paris","Europe/Podgorica","Europe/Prague","Europe/Riga","Europe/Rome","Europe/Samara","Europe/San_Marino","Europe/Sarajevo","Europe/Saratov","Europe/Simferopol","Europe/Skopje","Europe/Sofia","Europe/Stockholm","Europe/Tallinn","Europe/Tirane","Europe/Tiraspol","Europe/Ulyanovsk","Europe/Uzhgorod","Europe/Vaduz","Europe/Vatican","Europe/Vienna","Europe/Vilnius","Europe/Volgograd","Europe/Warsaw","Europe/Zagreb","Europe/Zaporozhye","Europe/Zurich","GB","GB-Eire","GMT","GMT+0","GMT-0","GMT0","Greenwich","HST","Hongkong","Iceland","Indian/Antananarivo","Indian/Chagos","Indian/Christmas","Indian/Cocos","Indian/Comoro","Indian/Kerguelen","Indian/Mahe","Indian/Maldives","Indian/Mauritius","Indian/Mayotte","Indian/Reunion","Iran","Israel","Jamaica","Japan","Kwajalein","Libya","MET","MST","MST7MDT","Mexico/BajaNorte","Mexico/BajaSur","Mexico/General","NZ","NZ-CHAT","Navajo","PRC","PST8PDT","Pacific/Apia","Pacific/Auckland","Pacific/Bougainville","Pacific/Chatham","Pacific/Chuuk","Pacific/Easter","Pacific/Efate","Pacific/Enderbury","Pacific/Fakaofo","Pacific/Fiji","Pacific/Funafuti","Pacific/Galapagos","Pacific/Gambier","Pacific/Guadalcanal","Pacific/Guam","Pacific/Honolulu","Pacific/Johnston","Pacific/Kiritimati","Pacific/Kosrae","Pacific/Kwajalein","Pacific/Majuro","Pacific/Marquesas","Pacific/Midway","Pacific/Nauru","Pacific/Niue","Pacific/Norfolk","Pacific/Noumea","Pacific/Pago_Pago","Pacific/Palau","Pacific/Pitcairn","Pacific/Pohnpei","Pacific/Ponape","Pacific/Port_Moresby","Pacific/Rarotonga","Pacific/Saipan","Pacific/Samoa","Pacific/Tahiti","Pacific/Tarawa","Pacific/Tongatapu","Pacific/Truk","Pacific/Wake","Pacific/Wallis","Pacific/Yap","Poland","Portugal","ROC","ROK","Singapore","Turkey","UCT","US/Alaska","US/Aleutian","US/Arizona","US/Central","US/East-Indiana","US/Eastern","US/Hawaii","US/Indiana-Starke","US/Michigan","US/Mountain","US/Pacific","US/Pacific-New","US/Samoa","UTC","Universal","W-SU","WET","Zulu"],ue={props:{index:Number,initialField:Object},data:function(){return{field:this.initialField}},methods:{persistedField:function(){return this.field.id>=1},saveField:function(){let e=this.field;this.persistedField()?p.fetch(`/api/v1/configs/fields/${this.field.id}`,{method:"PATCH",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e)}).then(a=>a.json()).then(a=>{a.success===!0&&(this.field=a.data,K({title:"Succ\xE8s",body:"Field has been updated!",delay:1e3}))}):p.fetch("/api/v1/configs/fields",{method:"POST",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e)}).then(a=>a.json()).then(a=>{a.success===!0&&(this.field=a.data,K({title:"Succ\xE8s",body:"Field has been created!",delay:1e3}))})},deleteField:function(){confirm("Are you sure you'd like to delete this field?")&&(this.persistedField()?p.fetch(`/api/v1/configs/fields/${this.field.id}`,{method:"DELETE",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}}).then(e=>e.json()).then(e=>{e.success===!0&&this.$emit("remove-field",this.index)}):this.$emit("remove-field",this.index))}}},de={class:"border-bottom"},me=i("span",{"aria-hidden":"true"},"\xD7",-1),fe=[me],he={class:"row"},Ae={class:"col-md-3"},pe={class:"form-group"},ge=i("label",null,"Field Type",-1),ve=i("option",{value:"text"},"Text Field",-1),be=i("option",{value:"boolean"},"Checkbox",-1),_e=[ve,be],ye=i("small",{class:"form-text text-muted"},"Type of field shown to the user",-1),ke={class:"col-md-9"},Ee={class:"form-group"},Te=i("label",null,"Field Name",-1),Se=i("small",{class:"form-text text-muted"},"Field name",-1),Me={class:"col-md-12"},Ce={class:"form-group"},$e=i("label",null,"Field Description",-1),Pe=i("small",{id:"emailHelp",class:"form-text text-muted"},"Field Description",-1),Be={class:"col-md-12"},we={class:"form-check"},ze={class:"form-check-label"},De={class:"form-check"},xe={class:"form-check-label"},Ne={class:"form-check"},je={class:"form-check-label"},Ge={class:"row pb-3"},Oe={class:"col-md-12"},Ie={class:"d-block"};function Fe(e,a,r,s,l,c){return $(),P("div",de,[i("div",null,[i("button",{type:"button",class:"close float-right","aria-label":"Close",onClick:a[0]||(a[0]=o=>c.deleteField())},fe)]),i("div",he,[i("div",Ae,[i("div",pe,[ge,M(i("select",{class:"form-control custom-select","onUpdate:modelValue":a[1]||(a[1]=o=>e.field.field_type=o)},_e,512),[[W,e.field.field_type,void 0,{lazy:!0}]]),ye])]),i("div",ke,[i("div",Ee,[Te,M(i("input",{type:"text",class:"form-control","onUpdate:modelValue":a[2]||(a[2]=o=>e.field.name=o)},null,512),[[j,e.field.name,void 0,{lazy:!0}]]),Se])]),i("div",Me,[i("div",Ce,[$e,M(i("input",{type:"text",class:"form-control","onUpdate:modelValue":a[3]||(a[3]=o=>e.field.description=o)},null,512),[[j,e.field.description,void 0,{lazy:!0}]]),Pe])]),i("div",Be,[i("div",we,[i("label",ze,[M(i("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":a[4]||(a[4]=o=>e.field.editable=o)},null,512),[[F,e.field.editable,void 0,{lazy:!0}]]),U(" Editable by user in profile ")])]),i("div",De,[i("label",xe,[M(i("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":a[5]||(a[5]=o=>e.field.required=o)},null,512),[[F,e.field.required,void 0,{lazy:!0}]]),U(" Required on registration ")])]),i("div",Ne,[i("label",je,[M(i("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":a[6]||(a[6]=o=>e.field.public=o)},null,512),[[F,e.field.public,void 0,{lazy:!0}]]),U(" Shown on public profile ")])])])]),i("div",Ge,[i("div",Oe,[i("div",Ie,[i("button",{class:"btn btn-sm btn-success btn-outlined float-right",type:"button",onClick:a[7]||(a[7]=o=>c.saveField())}," Save ")])])])])}const Ue=G(ue,[["render",Fe]]),Le={name:"FieldList",components:{Field:Ue},props:{type:String},data:function(){return{fields:[]}},methods:{loadFields:function(){p.fetch(`/api/v1/configs/fields?type=${this.type}`,{method:"GET",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}}).then(e=>e.json()).then(e=>{this.fields=e.data})},addField:function(){this.fields.push({id:Math.random(),type:this.type,field_type:"text",name:"",description:"",editable:!1,required:!1,public:!1})},removeField:function(e){this.fields.splice(e,1),console.log(this.fields)}},created(){this.loadFields()}},Ve={class:"row"},He={class:"col text-center"};function Ke(e,a,r,s,l,c){const o=Z("Field");return $(),P("div",null,[($(!0),P(Q,null,X(e.fields,(d,u)=>($(),P("div",{class:"mb-5",key:d.id},[ee(o,{index:u,initialField:e.fields[u],onRemoveField:c.removeField},null,8,["index","initialField","onRemoveField"])]))),128)),i("div",Ve,[i("div",He,[i("button",{class:"btn btn-sm btn-success btn-outlined m-auto",type:"button",onClick:a[0]||(a[0]=d=>c.addField())}," Add New Field ")])])])}const Re=G(Le,[["render",Ke]]),Ye={props:{index:Number,initialBracket:Object},data:function(){return{bracket:this.initialBracket}},methods:{persisted:function(){return this.bracket.id>=1},saveBracket:function(){let e=this.bracket,a="",r="",s="";this.persisted()?(a=`/api/v1/brackets/${this.bracket.id}`,r="PATCH",s="Bracket has been updated!"):(a="/api/v1/brackets",r="POST",s="Bracket has been created!"),p.fetch(a,{method:r,credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e)}).then(l=>l.json()).then(l=>{l.success===!0&&(this.field=l.data,K({title:"Succ\xE8s",body:s,delay:1e3}))})},deleteBracket:function(){confirm("Are you sure you'd like to delete this bracket?")&&(this.persisted()?p.fetch(`/api/v1/brackets/${this.bracket.id}`,{method:"DELETE",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}}).then(e=>e.json()).then(e=>{e.success===!0&&this.$emit("remove-bracket",this.index)}):this.$emit("remove-bracket",this.index))}}},Je={class:"border-bottom"},qe=i("span",{"aria-hidden":"true"},"\xD7",-1),We=[qe],Ze={class:"row"},Qe={class:"col-md-9"},Xe={class:"form-group"},ea=i("label",null,"Bracket Name",-1),aa=i("small",{class:"form-text text-muted"},' Bracket name (e.g. "Students", "Interns", "Engineers") ',-1),ta={class:"col-md-12"},ia={class:"form-group"},oa=i("label",null,"Bracket Description",-1),na=i("small",{class:"form-text text-muted"},"Bracket Description",-1),ra={class:"col-md-12"},sa=i("label",null,"Bracket Type",-1),ca=i("option",null,null,-1),la=i("option",{value:"users"},"Users",-1),ua=i("option",{value:"teams"},"Teams",-1),da=[ca,la,ua],ma=i("small",{class:"form-text text-muted"}," If you are using Team Mode and would like the bracket to apply to entire teams instead of individuals, select Teams. ",-1),fa={class:"row pb-3"},ha={class:"col-md-12"},Aa={class:"d-block"};function pa(e,a,r,s,l,c){return $(),P("div",Je,[i("div",null,[i("button",{type:"button",class:"close float-right","aria-label":"Close",onClick:a[0]||(a[0]=o=>c.deleteBracket())},We)]),i("div",Ze,[i("div",Qe,[i("div",Xe,[ea,M(i("input",{type:"text",class:"form-control","onUpdate:modelValue":a[1]||(a[1]=o=>e.bracket.name=o)},null,512),[[j,e.bracket.name,void 0,{lazy:!0}]]),aa])]),i("div",ta,[i("div",ia,[oa,M(i("input",{type:"text",class:"form-control","onUpdate:modelValue":a[2]||(a[2]=o=>e.bracket.description=o)},null,512),[[j,e.bracket.description,void 0,{lazy:!0}]]),na])]),i("div",ra,[sa,M(i("select",{class:"custom-select","onUpdate:modelValue":a[3]||(a[3]=o=>e.bracket.type=o)},da,512),[[W,e.bracket.type,void 0,{lazy:!0}]]),ma])]),i("div",fa,[i("div",ha,[i("div",Aa,[i("button",{class:"btn btn-sm btn-success btn-outlined float-right",type:"button",onClick:a[4]||(a[4]=o=>c.saveBracket())}," Save ")])])])])}const ga=G(Ye,[["render",pa]]),va={name:"BracketList",components:{Bracket:ga},data:function(){return{brackets:[]}},methods:{loadBrackets:function(){p.fetch("/api/v1/brackets",{method:"GET",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}}).then(e=>e.json()).then(e=>{this.brackets=e.data})},addBracket:function(){this.brackets.push({id:Math.random(),name:"",description:"",type:null})},removeBracket:function(e){this.brackets.splice(e,1)}},created(){this.loadBrackets()}},ba={class:"row"},_a={class:"col text-center"};function ya(e,a,r,s,l,c){const o=Z("Bracket");return $(),P("div",null,[($(!0),P(Q,null,X(e.brackets,(d,u)=>($(),P("div",{class:"mb-5",key:d.id},[ee(o,{index:u,initialBracket:e.brackets[u],onRemoveBracket:c.removeBracket},null,8,["index","initialBracket","onRemoveBracket"])]))),128)),i("div",ba,[i("div",_a,[i("button",{class:"btn btn-sm btn-success btn-outlined m-auto",type:"button",onClick:a[0]||(a[0]=d=>c.addBracket())}," Add New Bracket ")])])])}const ka=G(va,[["render",ya]]);x.extend(re);x.extend(se);x.extend(ce);function V(e,a){typeof a=="string"&&(a=parseInt(a,10)*1e3);const r=x(a);t("#"+e+"-month").val(r.month()+1),t("#"+e+"-day").val(r.date()),t("#"+e+"-year").val(r.year()),t("#"+e+"-hour").val(r.hour()),t("#"+e+"-minute").val(r.minute()),N(e)}function N(e){const a=t("#"+e+"-month").val(),r=t("#"+e+"-day").val(),s=t("#"+e+"-year").val(),l=t("#"+e+"-hour").val(),c=t("#"+e+"-minute").val(),o=t("#"+e+"-timezone").val(),d=Ea(a,r,s,l,c);d.unix()&&a&&r&&s&&l&&c?(t("#"+e).val(d.unix()),t("#"+e+"-local").val(d.format("dddd, MMMM Do YYYY, h:mm:ss a z (zzz)")),t("#"+e+"-zonetime").val(d.tz(o).format("dddd, MMMM Do YYYY, h:mm:ss a z (zzz)"))):(t("#"+e).val(""),t("#"+e+"-local").val(""),t("#"+e+"-zonetime").val(""))}function Ea(e,a,r,s,l){let c=e.toString();c.length==1&&(c="0"+c);let o=a.toString();o.length==1&&(o="0"+o);let d=s.toString();d.length==1&&(d="0"+d);let u=l.toString();u.length==1&&(u="0"+u);const T=r.toString()+"-"+c+"-"+o+" "+d+":"+u+":00";return x(T)}function ie(e){e.preventDefault();const a=t(this).serializeJSON(),r={};a.mail_useauth===!1?(a.mail_username=null,a.mail_password=null):(a.mail_username===""&&delete a.mail_username,a.mail_password===""&&delete a.mail_password),Object.keys(a).forEach(function(s){a[s]==="true"?r[s]=!0:a[s]==="false"?r[s]=!1:r[s]=a[s]}),p.api.patch_config_list({},r).then(function(s){if(s.success)window.location.reload();else{let l=s.errors.value.join(` `);O({title:"Erreur!",body:l,button:"Ok"})}})}function Ta(e){oe(e,1)}function Sa(e){oe(e,2)}function oe(e,a){e.preventDefault();let r=e.target;R.files.upload(r,{},function(s){const c={value:s.data[0].location};p.fetch("/api/v1/configs/ctf_sponsord"+a,{method:"PATCH",body:JSON.stringify(c)}).then(function(o){return o.json()}).then(function(o){o.success?window.location.reload():O({title:"Erreur!",body:"L'envoi du logo a \xE9chou\xE9!",button:"Ok"})})})}function Ma(e){e.preventDefault();let a=new FormData(e.target),r=`\xCAtes-vous s\xFBr que vous souhaitez changer de modes utilisateur? Les soumissions, les r\xE9compenses, les d\xE9verrouilles et le suivi seront supprim\xE9s!`;a.get("user_mode")=="users"&&(r=`\xCAtes-vous s\xFBr que vous souhaitez changer de modes utilisateur? Les \xE9quipes Nall, les soumissions, les r\xE9compenses, les d\xE9verrouilles et le suivi seront supprim\xE9s!`),confirm(r)&&(a.append("submissions",!0),a.append("nonce",p.config.csrfNonce),fetch(p.config.urlRoot+"/admin/reset",{method:"POST",credentials:"same-origin",body:a}),ie.bind(this)(e))}function Ca(){ne(1)}function $a(){ne(2)}function ne(e){Y({title:"Retirer Sponsor"+e,body:"\xCAtes-vous s\xFBr que vous souhaitez supprimer le sponsor?",success:function(){const a={value:null};p.api.patch_config({configKey:"ctf_sponsord"+e},a).then(r=>{window.location.reload()})}})}function Pa(e){e.preventDefault();let a=e.target;R.files.upload(a,{},function(r){const l={value:r.data[0].location};p.fetch("/api/v1/configs/ctf_banner",{method:"PATCH",body:JSON.stringify(l)}).then(function(c){return c.json()}).then(function(c){c.success?window.location.reload():O({title:"Erreur!",body:"L'envoi de banni\xE8re a \xE9chou\xE9!",button:"Ok"})})})}function Ba(){Y({title:"Supprimer la banni\xE8re",body:"\xCAtes-vous s\xFBr que vous souhaitez retirer la banni\xE8re?",success:function(){const e={value:null};p.api.patch_config({configKey:"ctf_banner"},e).then(a=>{window.location.reload()})}})}function wa(e){e.preventDefault();let a=e.target;R.files.upload(a,{},function(r){const l={value:r.data[0].location};p.fetch("/api/v1/configs/ctf_small_icon",{method:"PATCH",body:JSON.stringify(l)}).then(function(c){return c.json()}).then(function(c){c.success?window.location.reload():O({title:"Erreur!",body:"L'envoi d'ic\xF4nes a \xE9chou\xE9!",button:"Ok"})})})}function za(){Y({title:"Supprimer le logo",body:"\xCAtes-vous s\xFBr que vous souhaitez supprimer le petit ic\xF4ne du site?",success:function(){const e={value:null};p.api.patch_config({configKey:"ctf_small_icon"},e).then(a=>{window.location.reload()})}})}function Da(e){e.preventDefault();let a=document.getElementById("import-csv-file").files[0],r=document.getElementById("import-csv-type").value,s=new FormData;s.append("csv_file",a),s.append("csv_type",r),s.append("nonce",p.config.csrfNonce);let l=z({width:0,title:"Progr\xE8s de l'envoi"});t.ajax({url:p.config.urlRoot+"/admin/import/csv",type:"POST",data:s,processData:!1,contentType:!1,statusCode:{500:function(c){let o=JSON.parse(c.responseText),d="";o.forEach(u=>{d+=`Ligne ${u[0]}: ${JSON.stringify(u[1])} diff --git a/CTFd/themes/admin/static/assets/pages/editor.6362b1bf.js b/CTFd/themes/admin/static/assets/pages/editor.a9e33c66.js similarity index 87% rename from CTFd/themes/admin/static/assets/pages/editor.6362b1bf.js rename to CTFd/themes/admin/static/assets/pages/editor.a9e33c66.js index 640cd759f4c2d9917c9e7d9b6904cefd4c623f20..ffbed7ff82a91e1592ae66ec0b6b9ed46363940d 100644 --- a/CTFd/themes/admin/static/assets/pages/editor.6362b1bf.js +++ b/CTFd/themes/admin/static/assets/pages/editor.a9e33c66.js @@ -1,3 +1,3 @@ -import{j as t,N as c,V as m,C as r,D as p,E as l}from"./main.9f35ed12.js";import{c as u}from"../htmlmixed.60cb33cf.js";import{C as f}from"../CommentBox.a3989c28.js";function g(){window.editor.save();var e=t("#page-edit").serializeJSON(),o="/api/v1/pages",n="POST";let d=window.location.pathname.split("/").pop();d!=="new"&&(o+="/"+d,n="PATCH"),e.link_target===""&&(e.link_target=null),r.fetch(o,{method:n,credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e)}).then(function(i){return i.json()}).then(function(i){if(i.success===!1){let a="";for(const s in i.errors)a+=i.errors[s].join(` +import{j as t,N as c,V as m,C as r,D as p,E as l}from"./main.b0151f5b.js";import{c as u}from"../htmlmixed.245897c1.js";import{C as f}from"../CommentBox.d3cef9cd.js";function g(){window.editor.save();var e=t("#page-edit").serializeJSON(),o="/api/v1/pages",n="POST";let d=window.location.pathname.split("/").pop();d!=="new"&&(o+="/"+d,n="PATCH"),e.link_target===""&&(e.link_target=null),r.fetch(o,{method:n,credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e)}).then(function(i){return i.json()}).then(function(i){if(i.success===!1){let a="";for(const s in i.errors)a+=i.errors[s].join(` `),a+=` `;p({title:"Erreur",body:a,button:"Ok"});return}n==="PATCH"&&i.success?l({title:"Enregistr\xE9",body:"Vos modifications ont \xE9t\xE9 enregistr\xE9es"}):window.location=r.config.urlRoot+"/admin/pages/"+i.data.id})}function w(){window.editor.save(),t("#page-edit").attr("action",r.config.urlRoot+"/admin/pages/preview"),t("#page-edit").attr("target","_blank"),t("#page-edit").submit()}t(()=>{if(window.editor=u.fromTextArea(document.getElementById("admin-pages-editor"),{lineNumbers:!0,lineWrapping:!0,mode:"htmlmixed",htmlMode:!0}),t("#media-button").click(function(e){c(window.editor)}),t("#save-page").click(function(e){e.preventDefault(),g()}),t(".preview-page").click(function(){w()}),window.PAGE_ID){const e=m.extend(f);let o=document.createElement("div");document.querySelector("#comment-box").appendChild(o),new e({propsData:{type:"page",id:window.PAGE_ID}}).$mount(o)}}); diff --git a/CTFd/themes/admin/static/assets/pages/main.9f35ed12.js b/CTFd/themes/admin/static/assets/pages/main.b0151f5b.js similarity index 100% rename from CTFd/themes/admin/static/assets/pages/main.9f35ed12.js rename to CTFd/themes/admin/static/assets/pages/main.b0151f5b.js diff --git a/CTFd/themes/admin/static/assets/pages/notifications.ba00413d.js b/CTFd/themes/admin/static/assets/pages/notifications.6d8d6cb6.js similarity index 97% rename from CTFd/themes/admin/static/assets/pages/notifications.ba00413d.js rename to CTFd/themes/admin/static/assets/pages/notifications.6d8d6cb6.js index 6eb21a6957ebb8f44bc69863b476d505ed6e94e1..7ff85dfb7d55d6ad366a28741fd29cf15eec545b 100644 --- a/CTFd/themes/admin/static/assets/pages/notifications.ba00413d.js +++ b/CTFd/themes/admin/static/assets/pages/notifications.6d8d6cb6.js @@ -1 +1 @@ -import{_ as r,J as u,C as c,K as f,c as h,a as o,t as d,o as m,V as p,j as n,D as _}from"./main.9f35ed12.js";const b={props:{id:Number,title:String,content:String,html:String,date:String},methods:{localDate:function(){return u(this.date).format("MMMM Do, h:mm:ss A")},deleteNotification:function(){confirm("\xCAtes-vous certain de vouloir supprimer this notification?")&&c.api.delete_notification({notificationId:this.id}).then(e=>{e.success&&(this.$destroy(),this.$el.parentNode.removeChild(this.$el))})}},mounted(){this.$el.querySelectorAll("pre code").forEach(e=>{f.highlightBlock(e)})}},v={class:"card bg-light mb-4"},y=["data-notif-id"],g=o("span",{"aria-hidden":"true"},"\xD7",-1),$=[g],k={class:"card-body"},D={class:"card-title"},N={class:"blockquote mb-0"},S=["innerHTML"],C={class:"text-muted"},M=["data-time"];function x(e,t,a,i,s,l){return m(),h("div",v,[o("button",{type:"button","data-notif-id":this.id,class:"delete-notification close position-absolute p-3",style:{right:"0"},"data-dismiss":"alert","aria-label":"Close",onClick:t[0]||(t[0]=V=>l.deleteNotification())},$,8,y),o("div",k,[o("h3",D,d(a.title),1),o("blockquote",N,[o("p",{innerHTML:this.html},null,8,S),o("small",C,[o("span",{"data-time":this.date},d(this.localDate()),9,M)])])])])}const E=r(b,[["render",x]]),q=p.extend(E);function B(e){e.preventDefault();const t=n(this),a=t.serializeJSON();t.find("button[type=submit]").attr("disabled",!0),c.api.post_notification_list({},a).then(i=>{t.find(":input[name=title]").val(""),t.find(":input[name=content]").val(""),setTimeout(function(){t.find("button[type=submit]").attr("disabled",!1)},1e3),i.success||_({title:"Erreur",body:"Impossible d'envoyer une notification. Veuillez r\xE9essayer.",button:"Ok"});let s=document.createElement("div");n("#notifications-list").prepend(s),new q({propsData:{id:i.data.id,title:i.data.title,content:i.data.content,html:i.data.html,date:i.data.date}}).$mount(s)})}function T(e){e.preventDefault();const t=n(this),a=t.data("notif-id");confirm("\xCAtes-vous certain de vouloir supprimer cette notification?")&&c.api.delete_notification({notificationId:a}).then(i=>{i.success&&t.parent().remove()})}n(()=>{n("#notifications_form").submit(B),n(".delete-notification").click(T)}); +import{_ as r,J as u,C as c,K as f,c as h,a as o,t as d,o as m,V as p,j as n,D as _}from"./main.b0151f5b.js";const b={props:{id:Number,title:String,content:String,html:String,date:String},methods:{localDate:function(){return u(this.date).format("MMMM Do, h:mm:ss A")},deleteNotification:function(){confirm("\xCAtes-vous certain de vouloir supprimer this notification?")&&c.api.delete_notification({notificationId:this.id}).then(e=>{e.success&&(this.$destroy(),this.$el.parentNode.removeChild(this.$el))})}},mounted(){this.$el.querySelectorAll("pre code").forEach(e=>{f.highlightBlock(e)})}},v={class:"card bg-light mb-4"},y=["data-notif-id"],g=o("span",{"aria-hidden":"true"},"\xD7",-1),$=[g],k={class:"card-body"},D={class:"card-title"},N={class:"blockquote mb-0"},S=["innerHTML"],C={class:"text-muted"},M=["data-time"];function x(e,t,a,i,s,l){return m(),h("div",v,[o("button",{type:"button","data-notif-id":this.id,class:"delete-notification close position-absolute p-3",style:{right:"0"},"data-dismiss":"alert","aria-label":"Close",onClick:t[0]||(t[0]=V=>l.deleteNotification())},$,8,y),o("div",k,[o("h3",D,d(a.title),1),o("blockquote",N,[o("p",{innerHTML:this.html},null,8,S),o("small",C,[o("span",{"data-time":this.date},d(this.localDate()),9,M)])])])])}const E=r(b,[["render",x]]),q=p.extend(E);function B(e){e.preventDefault();const t=n(this),a=t.serializeJSON();t.find("button[type=submit]").attr("disabled",!0),c.api.post_notification_list({},a).then(i=>{t.find(":input[name=title]").val(""),t.find(":input[name=content]").val(""),setTimeout(function(){t.find("button[type=submit]").attr("disabled",!1)},1e3),i.success||_({title:"Erreur",body:"Impossible d'envoyer une notification. Veuillez r\xE9essayer.",button:"Ok"});let s=document.createElement("div");n("#notifications-list").prepend(s),new q({propsData:{id:i.data.id,title:i.data.title,content:i.data.content,html:i.data.html,date:i.data.date}}).$mount(s)})}function T(e){e.preventDefault();const t=n(this),a=t.data("notif-id");confirm("\xCAtes-vous certain de vouloir supprimer cette notification?")&&c.api.delete_notification({notificationId:a}).then(i=>{i.success&&t.parent().remove()})}n(()=>{n("#notifications_form").submit(B),n(".delete-notification").click(T)}); diff --git a/CTFd/themes/admin/static/assets/pages/pages.dc323f6c.js b/CTFd/themes/admin/static/assets/pages/pages.005098aa.js similarity index 86% rename from CTFd/themes/admin/static/assets/pages/pages.dc323f6c.js rename to CTFd/themes/admin/static/assets/pages/pages.005098aa.js index cbb07a2b6028f5be9da0f7f26676e882e7f7fd73..b228a9b95620abb6b2c02ede498e4186564b36e8 100644 --- a/CTFd/themes/admin/static/assets/pages/pages.dc323f6c.js +++ b/CTFd/themes/admin/static/assets/pages/pages.005098aa.js @@ -1 +1 @@ -import{j as e,x as r,C as i}from"./main.9f35ed12.js";function n(p){let t=e("input[data-page-id]:checked").map(function(){return e(this).data("page-id")}),a=t.length===1?"page":"pages";r({title:"Supprimer Pages",body:`\xCAtes-vous certain de vouloir supprimer ${t.length} ${a}?`,success:function(){const s=[];for(var o of t)s.push(i.fetch(`/api/v1/pages/${o}`,{method:"DELETE"}));Promise.all(s).then(c=>{window.location.reload()})}})}e(()=>{e("#pages-delete-button").click(n)}); +import{j as e,x as r,C as i}from"./main.b0151f5b.js";function n(p){let t=e("input[data-page-id]:checked").map(function(){return e(this).data("page-id")}),a=t.length===1?"page":"pages";r({title:"Supprimer Pages",body:`\xCAtes-vous certain de vouloir supprimer ${t.length} ${a}?`,success:function(){const s=[];for(var o of t)s.push(i.fetch(`/api/v1/pages/${o}`,{method:"DELETE"}));Promise.all(s).then(c=>{window.location.reload()})}})}e(()=>{e("#pages-delete-button").click(n)}); diff --git a/CTFd/themes/admin/static/assets/pages/reset.765caf6c.js b/CTFd/themes/admin/static/assets/pages/reset.22a4fe7a.js similarity index 84% rename from CTFd/themes/admin/static/assets/pages/reset.765caf6c.js rename to CTFd/themes/admin/static/assets/pages/reset.22a4fe7a.js index 0d64a5e99caad19b3577e317ef3ed063fc56310b..eaf7afc6d3a7daecf9a7ebb0d76e6c1c0c9bd5e6 100644 --- a/CTFd/themes/admin/static/assets/pages/reset.765caf6c.js +++ b/CTFd/themes/admin/static/assets/pages/reset.22a4fe7a.js @@ -1 +1 @@ -import{j as e,x as s}from"./main.9f35ed12.js";function i(t){t.preventDefault(),s({title:"R\xE9initialiser PolyScav?",body:"\xCAtes-vous s\xFBr de vouloir r\xE9initialiser votre \xE9v\xE8nement?",success:function(){e("#reset-ctf-form").off("submit").submit()}})}e(()=>{e("#reset-ctf-form").submit(i),e("#select-all").change(function(){const t=e(this).is(":checked");e("input[type='checkbox']").prop("checked",t)})}); +import{j as e,x as s}from"./main.b0151f5b.js";function i(t){t.preventDefault(),s({title:"R\xE9initialiser PolyScav?",body:"\xCAtes-vous s\xFBr de vouloir r\xE9initialiser votre \xE9v\xE8nement?",success:function(){e("#reset-ctf-form").off("submit").submit()}})}e(()=>{e("#reset-ctf-form").submit(i),e("#select-all").change(function(){const t=e(this).is(":checked");e("input[type='checkbox']").prop("checked",t)})}); diff --git a/CTFd/themes/admin/static/assets/pages/scoreboard.4eacd5c7.js b/CTFd/themes/admin/static/assets/pages/scoreboard.277a9045.js similarity index 95% rename from CTFd/themes/admin/static/assets/pages/scoreboard.4eacd5c7.js rename to CTFd/themes/admin/static/assets/pages/scoreboard.277a9045.js index f64336e8e05a660199916dad3d5215d31cded944..aa841fadeac9f59f5b0b960360801ae317998b78 100644 --- a/CTFd/themes/admin/static/assets/pages/scoreboard.4eacd5c7.js +++ b/CTFd/themes/admin/static/assets/pages/scoreboard.277a9045.js @@ -1,4 +1,4 @@ -import{j as s,C as n,D as l}from"./main.9f35ed12.js";const d={users:(e,i)=>n.api.patch_user_public({userId:e},i),teams:(e,i)=>n.api.patch_team_public({teamId:e},i)};function u(){const e=s(this),i=e.data("account-id"),a=e.data("state");let t;a==="visible"?t=!0:a==="hidden"&&(t=!1);const o={hidden:t};d[n.config.userMode](i,o).then(c=>{c.success&&(t?(e.data("state","hidden"),e.addClass("btn-danger").removeClass("btn-success"),e.text("Hidden")):(e.data("state","visible"),e.addClass("btn-success").removeClass("btn-danger"),e.text("Visible")))})}function r(e,i){const a={hidden:i==="hidden"},t=[];for(let o of e.accounts)t.push(d[n.config.userMode](o,a));for(let o of e.users)t.push(d.users(o,a));Promise.all(t).then(o=>{window.location.reload()})}function b(e){let i=s(".tab-pane.active input[data-account-id]:checked").map(function(){return s(this).data("account-id")}),a=s(".tab-pane.active input[data-user-id]:checked").map(function(){return s(this).data("user-id")}),t={accounts:i,users:a};l({title:"Toggle Visibility",body:s(` +import{j as s,C as n,D as l}from"./main.b0151f5b.js";const d={users:(e,i)=>n.api.patch_user_public({userId:e},i),teams:(e,i)=>n.api.patch_team_public({teamId:e},i)};function u(){const e=s(this),i=e.data("account-id"),a=e.data("state");let t;a==="visible"?t=!0:a==="hidden"&&(t=!1);const o={hidden:t};d[n.config.userMode](i,o).then(c=>{c.success&&(t?(e.data("state","hidden"),e.addClass("btn-danger").removeClass("btn-success"),e.text("Hidden")):(e.data("state","visible"),e.addClass("btn-success").removeClass("btn-danger"),e.text("Visible")))})}function r(e,i){const a={hidden:i==="hidden"},t=[];for(let o of e.accounts)t.push(d[n.config.userMode](o,a));for(let o of e.users)t.push(d.users(o,a));Promise.all(t).then(o=>{window.location.reload()})}function b(e){let i=s(".tab-pane.active input[data-account-id]:checked").map(function(){return s(this).data("account-id")}),a=s(".tab-pane.active input[data-user-id]:checked").map(function(){return s(this).data("user-id")}),t={accounts:i,users:a};l({title:"Toggle Visibility",body:s(` <form id="scoreboard-bulk-edit"> <div class="form-group"> <label>Visibility</label> diff --git a/CTFd/themes/admin/static/assets/pages/statistics.a646c07a.js b/CTFd/themes/admin/static/assets/pages/statistics.9cb123a3.js similarity index 97% rename from CTFd/themes/admin/static/assets/pages/statistics.a646c07a.js rename to CTFd/themes/admin/static/assets/pages/statistics.9cb123a3.js index fc9741a91316fb9e14bab79f2c10304c719f6e3b..fe19dadd389725d4f1bc49044a571316335592bd 100644 --- a/CTFd/themes/admin/static/assets/pages/statistics.a646c07a.js +++ b/CTFd/themes/admin/static/assets/pages/statistics.9cb123a3.js @@ -1 +1 @@ -import{j as c,C as i,O as h}from"./main.9f35ed12.js";import{e as p}from"../echarts.common.3389571d.js";const u={"#solves-graph":{data:()=>i.api.get_challenge_solve_statistics(),format:o=>{const t=o.data,r=[],a=[],s={};for(let n=0;n<t.length;n++)s[t[n].id]={name:t[n].name,solves:t[n].solves};const e=Object.keys(s).sort(function(n,l){return s[l].solves-s[n].solves});return c.each(e,function(n,l){r.push(s[l].name),a.push(s[l].solves)}),{title:{left:"center",text:"Solve Counts"},tooltip:{trigger:"item"},toolbox:{show:!0,feature:{mark:{show:!0},dataView:{show:!0,readOnly:!1},magicType:{show:!0,type:["line","bar"]},restore:{show:!0},saveAsImage:{show:!0}}},xAxis:{name:"Solve Count",nameLocation:"middle",type:"value"},yAxis:{name:"Challenge Name",nameLocation:"middle",nameGap:60,type:"category",data:r,axisLabel:{interval:0,rotate:0}},dataZoom:[{show:!1,start:0,end:100},{type:"inside",yAxisIndex:0,show:!0,width:20},{fillerColor:"rgba(233, 236, 241, 0.4)",show:!0,yAxisIndex:0,width:20}],series:[{itemStyle:{normal:{color:"#1f76b4"}},data:a,type:"bar"}]}}},"#keys-pie-graph":{data:()=>i.api.get_submission_property_counts({column:"type"}),format:o=>{const t=o.data,r=t.correct,a=t.incorrect;return{title:{left:"center",text:"Pourcentage de soumission"},tooltip:{trigger:"item"},toolbox:{show:!0,feature:{dataView:{show:!0,readOnly:!1},saveAsImage:{}}},legend:{orient:"vertical",top:"middle",right:0,data:["Fails","Solves"]},series:[{name:"Pourcentage de soumission",type:"pie",radius:["30%","50%"],avoidLabelOverlap:!1,label:{show:!1,position:"center"},itemStyle:{normal:{label:{show:!0,formatter:function(e){return`${e.name} - ${e.value} (${e.percent}%)`}},labelLine:{show:!0}},emphasis:{label:{show:!0,position:"center",textStyle:{fontSize:"14",fontWeight:"normal"}}}},emphasis:{label:{show:!0,fontSize:"30",fontWeight:"bold"}},labelLine:{show:!1},data:[{value:a,name:"Fails",itemStyle:{color:"rgb(207, 38, 0)"}},{value:r,name:"Solves",itemStyle:{color:"rgb(0, 209, 64)"}}]}]}}},"#categories-pie-graph":{data:()=>i.api.get_challenge_property_counts({column:"category"}),format:o=>{const t=o.data,r=[],a=[];for(let e in t)Object.hasOwn(t,e)&&(r.push(e),a.push(t[e]));for(let e=0;e<t.length;e++)r.push(t[e].category),a.push(t[e].count);let s={title:{left:"center",text:"R\xE9partition des cat\xE9gories"},tooltip:{trigger:"item"},toolbox:{show:!0,feature:{dataView:{show:!0,readOnly:!1},saveAsImage:{}}},legend:{type:"scroll",orient:"vertical",top:"middle",right:10,data:[]},series:[{name:"R\xE9partition des cat\xE9gories",type:"pie",radius:["30%","50%"],label:{show:!1,position:"center"},itemStyle:{normal:{label:{show:!0,formatter:function(e){return`${e.percent}% (${e.value})`}},labelLine:{show:!0}},emphasis:{label:{show:!0,position:"center",textStyle:{fontSize:"14",fontWeight:"normal"}}}},emphasis:{label:{show:!0,fontSize:"30",fontWeight:"bold"}},data:[]}]};return r.forEach((e,d)=>{s.legend.data.push(e),s.series[0].data.push({value:a[d],name:e,itemStyle:{color:h(e)}})}),s}},"#solve-percentages-graph":{layout:o=>({title:"Pourcentage de r\xE9solution par d\xE9fi",xaxis:{title:"Nom du d\xE9fi"},yaxis:{title:`Pourcentage de ${i.config.userMode.charAt(0).toUpperCase()+i.config.userMode.slice(1)} (%)`,range:[0,100]},annotations:o}),data:()=>i.api.get_challenge_solve_percentages(),format:o=>{const t=o.data,r=[],a=[];for(let e in t)r.push(t[e].name),a.push(t[e].percentage*100),t[e].name,t[e].percentage*100,Math.round(t[e].percentage*100)+"";return{title:{left:"center",text:"Pourcentage de r\xE9solution par d\xE9fi"},tooltip:{trigger:"item",formatter:function(e){return`${e.name} - ${(Math.round(e.value*10)/10).toFixed(1)}%`}},toolbox:{show:!0,feature:{mark:{show:!0},dataView:{show:!0,readOnly:!1},magicType:{show:!0,type:["line","bar"]},restore:{show:!0},saveAsImage:{show:!0}}},xAxis:{name:"Nom du d\xE9fi",nameGap:40,nameLocation:"middle",type:"category",data:r,axisLabel:{interval:0,rotate:50}},yAxis:{name:`"Pourcentage de ${i.config.userMode.charAt(0).toUpperCase()+i.config.userMode.slice(1)} (%)`,nameGap:50,nameLocation:"middle",type:"value",min:0,max:100},dataZoom:[{show:!1,start:0,end:100},{type:"inside",show:!0,start:0,end:100},{fillerColor:"rgba(233, 236, 241, 0.4)",show:!0,right:60,yAxisIndex:0,width:20},{type:"slider",fillerColor:"rgba(233, 236, 241, 0.4)",top:35,height:20,show:!0,start:0,end:100}],series:[{itemStyle:{normal:{color:"#1f76b4"}},data:a,type:"bar"}]}}},"#score-distribution-graph":{layout:o=>({title:"Distribution de score",xaxis:{title:"Cat\xE9gorie de score",showticklabels:!0,type:"category"},yaxis:{title:`Number of ${i.config.userMode.charAt(0).toUpperCase()+i.config.userMode.slice(1)}`},annotations:o}),data:()=>i.fetch("/api/v1/statistics/scores/distribution").then(function(o){return o.json()}),format:o=>{const t=o.data.brackets,r=[],a=[],s=[];for(let n in t)r.push(parseInt(n));r.sort((n,l)=>n-l);let e="<0";return r.map(n=>{a.push(`${e} - ${n}`),s.push(t[n]),e=n}),{title:{left:"center",text:"Distribution de score"},tooltip:{trigger:"item"},toolbox:{show:!0,feature:{mark:{show:!0},dataView:{show:!0,readOnly:!1},magicType:{show:!0,type:["line","bar"]},restore:{show:!0},saveAsImage:{show:!0}}},xAxis:{name:"Cat\xE9gorie de score",nameGap:40,nameLocation:"middle",type:"category",data:a},yAxis:{name:`Nombre de ${i.config.userMode.charAt(0).toUpperCase()+i.config.userMode.slice(1)}`,nameGap:50,nameLocation:"middle",type:"value"},dataZoom:[{show:!1,start:0,end:100},{type:"inside",show:!0,start:0,end:100},{fillerColor:"rgba(233, 236, 241, 0.4)",show:!0,right:60,yAxisIndex:0,width:20},{type:"slider",fillerColor:"rgba(233, 236, 241, 0.4)",top:35,height:20,show:!0,start:0,end:100}],series:[{itemStyle:{normal:{color:"#1f76b4"}},data:s,type:"bar"}]}}}},m=()=>{for(let o in u){const t=u[o];c(o).empty();let a=p.init(document.querySelector(o));t.data().then(t.format).then(s=>{a.setOption(s),c(window).on("resize",function(){a!=null&&a!=null&&a.resize()})})}};function f(){for(let o in u){const t=u[o];let r=p.init(document.querySelector(o));t.data().then(t.format).then(a=>{r.setOption(a)})}}c(()=>{m(),setInterval(f,3e5)}); +import{j as c,C as i,O as h}from"./main.b0151f5b.js";import{e as p}from"../echarts.common.75806e9f.js";const u={"#solves-graph":{data:()=>i.api.get_challenge_solve_statistics(),format:o=>{const t=o.data,r=[],a=[],s={};for(let n=0;n<t.length;n++)s[t[n].id]={name:t[n].name,solves:t[n].solves};const e=Object.keys(s).sort(function(n,l){return s[l].solves-s[n].solves});return c.each(e,function(n,l){r.push(s[l].name),a.push(s[l].solves)}),{title:{left:"center",text:"Solve Counts"},tooltip:{trigger:"item"},toolbox:{show:!0,feature:{mark:{show:!0},dataView:{show:!0,readOnly:!1},magicType:{show:!0,type:["line","bar"]},restore:{show:!0},saveAsImage:{show:!0}}},xAxis:{name:"Solve Count",nameLocation:"middle",type:"value"},yAxis:{name:"Challenge Name",nameLocation:"middle",nameGap:60,type:"category",data:r,axisLabel:{interval:0,rotate:0}},dataZoom:[{show:!1,start:0,end:100},{type:"inside",yAxisIndex:0,show:!0,width:20},{fillerColor:"rgba(233, 236, 241, 0.4)",show:!0,yAxisIndex:0,width:20}],series:[{itemStyle:{normal:{color:"#1f76b4"}},data:a,type:"bar"}]}}},"#keys-pie-graph":{data:()=>i.api.get_submission_property_counts({column:"type"}),format:o=>{const t=o.data,r=t.correct,a=t.incorrect;return{title:{left:"center",text:"Pourcentage de soumission"},tooltip:{trigger:"item"},toolbox:{show:!0,feature:{dataView:{show:!0,readOnly:!1},saveAsImage:{}}},legend:{orient:"vertical",top:"middle",right:0,data:["Fails","Solves"]},series:[{name:"Pourcentage de soumission",type:"pie",radius:["30%","50%"],avoidLabelOverlap:!1,label:{show:!1,position:"center"},itemStyle:{normal:{label:{show:!0,formatter:function(e){return`${e.name} - ${e.value} (${e.percent}%)`}},labelLine:{show:!0}},emphasis:{label:{show:!0,position:"center",textStyle:{fontSize:"14",fontWeight:"normal"}}}},emphasis:{label:{show:!0,fontSize:"30",fontWeight:"bold"}},labelLine:{show:!1},data:[{value:a,name:"Fails",itemStyle:{color:"rgb(207, 38, 0)"}},{value:r,name:"Solves",itemStyle:{color:"rgb(0, 209, 64)"}}]}]}}},"#categories-pie-graph":{data:()=>i.api.get_challenge_property_counts({column:"category"}),format:o=>{const t=o.data,r=[],a=[];for(let e in t)Object.hasOwn(t,e)&&(r.push(e),a.push(t[e]));for(let e=0;e<t.length;e++)r.push(t[e].category),a.push(t[e].count);let s={title:{left:"center",text:"R\xE9partition des cat\xE9gories"},tooltip:{trigger:"item"},toolbox:{show:!0,feature:{dataView:{show:!0,readOnly:!1},saveAsImage:{}}},legend:{type:"scroll",orient:"vertical",top:"middle",right:10,data:[]},series:[{name:"R\xE9partition des cat\xE9gories",type:"pie",radius:["30%","50%"],label:{show:!1,position:"center"},itemStyle:{normal:{label:{show:!0,formatter:function(e){return`${e.percent}% (${e.value})`}},labelLine:{show:!0}},emphasis:{label:{show:!0,position:"center",textStyle:{fontSize:"14",fontWeight:"normal"}}}},emphasis:{label:{show:!0,fontSize:"30",fontWeight:"bold"}},data:[]}]};return r.forEach((e,d)=>{s.legend.data.push(e),s.series[0].data.push({value:a[d],name:e,itemStyle:{color:h(e)}})}),s}},"#solve-percentages-graph":{layout:o=>({title:"Pourcentage de r\xE9solution par d\xE9fi",xaxis:{title:"Nom du d\xE9fi"},yaxis:{title:`Pourcentage de ${i.config.userMode.charAt(0).toUpperCase()+i.config.userMode.slice(1)} (%)`,range:[0,100]},annotations:o}),data:()=>i.api.get_challenge_solve_percentages(),format:o=>{const t=o.data,r=[],a=[];for(let e in t)r.push(t[e].name),a.push(t[e].percentage*100),t[e].name,t[e].percentage*100,Math.round(t[e].percentage*100)+"";return{title:{left:"center",text:"Pourcentage de r\xE9solution par d\xE9fi"},tooltip:{trigger:"item",formatter:function(e){return`${e.name} - ${(Math.round(e.value*10)/10).toFixed(1)}%`}},toolbox:{show:!0,feature:{mark:{show:!0},dataView:{show:!0,readOnly:!1},magicType:{show:!0,type:["line","bar"]},restore:{show:!0},saveAsImage:{show:!0}}},xAxis:{name:"Nom du d\xE9fi",nameGap:40,nameLocation:"middle",type:"category",data:r,axisLabel:{interval:0,rotate:50}},yAxis:{name:`"Pourcentage de ${i.config.userMode.charAt(0).toUpperCase()+i.config.userMode.slice(1)} (%)`,nameGap:50,nameLocation:"middle",type:"value",min:0,max:100},dataZoom:[{show:!1,start:0,end:100},{type:"inside",show:!0,start:0,end:100},{fillerColor:"rgba(233, 236, 241, 0.4)",show:!0,right:60,yAxisIndex:0,width:20},{type:"slider",fillerColor:"rgba(233, 236, 241, 0.4)",top:35,height:20,show:!0,start:0,end:100}],series:[{itemStyle:{normal:{color:"#1f76b4"}},data:a,type:"bar"}]}}},"#score-distribution-graph":{layout:o=>({title:"Distribution de score",xaxis:{title:"Cat\xE9gorie de score",showticklabels:!0,type:"category"},yaxis:{title:`Number of ${i.config.userMode.charAt(0).toUpperCase()+i.config.userMode.slice(1)}`},annotations:o}),data:()=>i.fetch("/api/v1/statistics/scores/distribution").then(function(o){return o.json()}),format:o=>{const t=o.data.brackets,r=[],a=[],s=[];for(let n in t)r.push(parseInt(n));r.sort((n,l)=>n-l);let e="<0";return r.map(n=>{a.push(`${e} - ${n}`),s.push(t[n]),e=n}),{title:{left:"center",text:"Distribution de score"},tooltip:{trigger:"item"},toolbox:{show:!0,feature:{mark:{show:!0},dataView:{show:!0,readOnly:!1},magicType:{show:!0,type:["line","bar"]},restore:{show:!0},saveAsImage:{show:!0}}},xAxis:{name:"Cat\xE9gorie de score",nameGap:40,nameLocation:"middle",type:"category",data:a},yAxis:{name:`Nombre de ${i.config.userMode.charAt(0).toUpperCase()+i.config.userMode.slice(1)}`,nameGap:50,nameLocation:"middle",type:"value"},dataZoom:[{show:!1,start:0,end:100},{type:"inside",show:!0,start:0,end:100},{fillerColor:"rgba(233, 236, 241, 0.4)",show:!0,right:60,yAxisIndex:0,width:20},{type:"slider",fillerColor:"rgba(233, 236, 241, 0.4)",top:35,height:20,show:!0,start:0,end:100}],series:[{itemStyle:{normal:{color:"#1f76b4"}},data:s,type:"bar"}]}}}},m=()=>{for(let o in u){const t=u[o];c(o).empty();let a=p.init(document.querySelector(o));t.data().then(t.format).then(s=>{a.setOption(s),c(window).on("resize",function(){a!=null&&a!=null&&a.resize()})})}};function f(){for(let o in u){const t=u[o];let r=p.init(document.querySelector(o));t.data().then(t.format).then(a=>{r.setOption(a)})}}c(()=>{m(),setInterval(f,3e5)}); diff --git a/CTFd/themes/admin/static/assets/pages/submissions.265b22dc.js b/CTFd/themes/admin/static/assets/pages/submissions.388ef183.js similarity index 95% rename from CTFd/themes/admin/static/assets/pages/submissions.265b22dc.js rename to CTFd/themes/admin/static/assets/pages/submissions.388ef183.js index 173d1c361df5cccc3852ca84d4e5d83bfdaaa086..92bb69498c05a7af83cba2a251bf9a81a3325799 100644 --- a/CTFd/themes/admin/static/assets/pages/submissions.265b22dc.js +++ b/CTFd/themes/admin/static/assets/pages/submissions.388ef183.js @@ -1 +1 @@ -import{j as e,x as c,A as u,C as l,D as f}from"./main.9f35ed12.js";import{s as p}from"../visual.9577c47c.js";window.carouselPosition=0;window.carouselMax=0;function h(i){const t=e(this).data("submission-id"),o=e(this).parent().parent(),s=o.find(".chal").text().trim(),r=o.find(".team").text().trim(),n=e(this).parent().parent();c({title:"Supprimer soumission",body:"\xCAtes-vous certain de vouloir supprimer la soumission de l'\xE9quipe {0} pour le d\xE9fi {1}".format("<strong>"+u(r)+"</strong>","<strong>"+u(s)+"</strong>"),success:function(){alert({submissionId:t}),l.api.delete_submission({submissionId:t}).then(function(a){a.success&&n.remove()})}})}function g(i){let t=e("input[data-submission-id]:checked").map(function(){return e(this).data("submission-id")}),o=t.length===1?"submission":"submissions";c({title:"Supprimer une soumission",body:`\xCAtes-vous certain de vouloir supprimer ${t.length} ${o}?`,success:function(){const s=[];for(var r of t)s.push(l.api.delete_submission({submissionId:r}));Promise.all(s).then(n=>{window.location.reload()})}})}function b(i){let t=e("input[data-submission-id]:checked").map(function(){return e(this).data("submission-id")}).get(),o=t.length===1?"submission":"submissions",s=[];c({title:"Valider une soumission",body:`\xCAtes-vous s\xFBr de vouloir marquer ${t.length} ${o} correct?`,success:function(){const r=t.map(n=>l.fetch(`/api/v1/submissions/${n}`,{method:"GET",credentials:"same-origin",headers:{Accept:"application/json"}}).then(a=>a.json()).then(a=>{a.data.provided!=="M\xE9dia en traitement"?s.push(n):f({title:"Erreur",body:`Soumission ID ${n} ne peut \xEAtre marqu\xE9e comme correcte car le media est encore en traitement.`,button:"OK"})}));Promise.all(r).then(()=>{if(s.length>0){const n=s.map(a=>l.fetch(`/api/v1/submissions/${a}`,{method:"PATCH",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({type:"correct"})}));Promise.all(n).then(()=>{window.location.reload()})}})}})}function m(i){const t=new URLSearchParams(window.location.search);t.has("full")?t.delete("full"):t.set("full","true"),window.location.href=`${window.location.pathname}?${t.toString()}`}function w(i){let t=e(i.currentTarget),o=t.find("i"),s=t.parent().find("pre");s.hasClass("full-flag")?(s.text(s.attr("title").substring(0,42)+"..."),s.removeClass("full-flag"),o.addClass("fa-eye"),o.removeClass("fa-eye-slash")):(s.text(s.attr("title")),s.addClass("full-flag"),o.addClass("fa-eye-slash"),o.removeClass("fa-eye"))}function y(i){let s=e(i.currentTarget).parent().find("pre").attr("title");navigator.clipboard.writeText(s),e(i.currentTarget).tooltip({title:"Copi\xE9!",trigger:"manual"}),e(i.currentTarget).tooltip("show"),setTimeout(function(){e(i.currentTarget).tooltip("hide")},1500)}e(()=>{e("#show-full-flags-button").click(m),e("#show-short-flags-button").click(m),e(".show-flag").click(w),e(".copy-flag").click(y),e("#correct-flags-button").click(b),e(".delete-correct-submission").click(h),e("#submission-delete-button").click(g)});let d=document.getElementsByClassName("imageContainer");for(let i=0;i<d.length;i++)p(d[i]); +import{j as e,x as c,A as u,C as l,D as f}from"./main.b0151f5b.js";import{s as p}from"../visual.cf071827.js";window.carouselPosition=0;window.carouselMax=0;function h(i){const t=e(this).data("submission-id"),o=e(this).parent().parent(),s=o.find(".chal").text().trim(),r=o.find(".team").text().trim(),n=e(this).parent().parent();c({title:"Supprimer soumission",body:"\xCAtes-vous certain de vouloir supprimer la soumission de l'\xE9quipe {0} pour le d\xE9fi {1}".format("<strong>"+u(r)+"</strong>","<strong>"+u(s)+"</strong>"),success:function(){alert({submissionId:t}),l.api.delete_submission({submissionId:t}).then(function(a){a.success&&n.remove()})}})}function g(i){let t=e("input[data-submission-id]:checked").map(function(){return e(this).data("submission-id")}),o=t.length===1?"submission":"submissions";c({title:"Supprimer une soumission",body:`\xCAtes-vous certain de vouloir supprimer ${t.length} ${o}?`,success:function(){const s=[];for(var r of t)s.push(l.api.delete_submission({submissionId:r}));Promise.all(s).then(n=>{window.location.reload()})}})}function b(i){let t=e("input[data-submission-id]:checked").map(function(){return e(this).data("submission-id")}).get(),o=t.length===1?"submission":"submissions",s=[];c({title:"Valider une soumission",body:`\xCAtes-vous s\xFBr de vouloir marquer ${t.length} ${o} correct?`,success:function(){const r=t.map(n=>l.fetch(`/api/v1/submissions/${n}`,{method:"GET",credentials:"same-origin",headers:{Accept:"application/json"}}).then(a=>a.json()).then(a=>{a.data.provided!=="M\xE9dia en traitement"?s.push(n):f({title:"Erreur",body:`Soumission ID ${n} ne peut \xEAtre marqu\xE9e comme correcte car le media est encore en traitement.`,button:"OK"})}));Promise.all(r).then(()=>{if(s.length>0){const n=s.map(a=>l.fetch(`/api/v1/submissions/${a}`,{method:"PATCH",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({type:"correct"})}));Promise.all(n).then(()=>{window.location.reload()})}})}})}function m(i){const t=new URLSearchParams(window.location.search);t.has("full")?t.delete("full"):t.set("full","true"),window.location.href=`${window.location.pathname}?${t.toString()}`}function w(i){let t=e(i.currentTarget),o=t.find("i"),s=t.parent().find("pre");s.hasClass("full-flag")?(s.text(s.attr("title").substring(0,42)+"..."),s.removeClass("full-flag"),o.addClass("fa-eye"),o.removeClass("fa-eye-slash")):(s.text(s.attr("title")),s.addClass("full-flag"),o.addClass("fa-eye-slash"),o.removeClass("fa-eye"))}function y(i){let s=e(i.currentTarget).parent().find("pre").attr("title");navigator.clipboard.writeText(s),e(i.currentTarget).tooltip({title:"Copi\xE9!",trigger:"manual"}),e(i.currentTarget).tooltip("show"),setTimeout(function(){e(i.currentTarget).tooltip("hide")},1500)}e(()=>{e("#show-full-flags-button").click(m),e("#show-short-flags-button").click(m),e(".show-flag").click(w),e(".copy-flag").click(y),e("#correct-flags-button").click(b),e(".delete-correct-submission").click(h),e("#submission-delete-button").click(g)});let d=document.getElementsByClassName("imageContainer");for(let i=0;i<d.length;i++)p(d[i]); diff --git a/CTFd/themes/admin/static/assets/pages/team.4a8539df.js b/CTFd/themes/admin/static/assets/pages/team.c844301c.js similarity index 98% rename from CTFd/themes/admin/static/assets/pages/team.4a8539df.js rename to CTFd/themes/admin/static/assets/pages/team.c844301c.js index fedf72ccad7d8c316af65143d712825bb99c3de1..530341f074455f9321da04a73a20758c873fc298 100644 --- a/CTFd/themes/admin/static/assets/pages/team.4a8539df.js +++ b/CTFd/themes/admin/static/assets/pages/team.c844301c.js @@ -1,4 +1,4 @@ -import{_ as P,C as d,A as _,x as b,c as v,a as p,h as x,m as J,q as E,F as j,r as D,b as N,o as g,k as R,t as U,s as $,j as e,Q as T,R as F,V as q,D as z}from"./main.9f35ed12.js";import{c as A,u as S}from"../graphs.05e1bce6.js";import{C as V}from"../CommentBox.a3989c28.js";import{s as B}from"../visual.9577c47c.js";import"../echarts.common.3389571d.js";const L={name:"UserAddForm",props:{team_id:Number},data:function(){return{searchedName:"",awaitingSearch:!1,emptyResults:!1,userResults:[],selectedResultIdx:0,selectedUsers:[]}},methods:{searchUsers:function(){if(this.selectedResultIdx=0,this.searchedName==""){this.userResults=[];return}d.fetch(`/api/v1/users?view=admin&field=name&q=${this.searchedName}`,{method:"GET",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}}).then(t=>t.json()).then(t=>{t.success&&(this.userResults=t.data.slice(0,10))})},moveCursor:function(t){switch(t){case"up":this.selectedResultIdx&&(this.selectedResultIdx-=1);break;case"down":this.selectedResultIdx<this.userResults.length-1&&(this.selectedResultIdx+=1);break}},selectUser:function(t){t===void 0&&(t=this.selectedResultIdx);let s=this.userResults[t];this.selectedUsers.some(n=>n.id===s.id)===!1&&this.selectedUsers.push(s),this.userResults=[],this.searchedName=""},removeSelectedUser:function(t){this.selectedUsers=this.selectedUsers.filter(s=>s.id!==t)},handleAddUsersRequest:function(){let t=[];return this.selectedUsers.forEach(s=>{let i={user_id:s.id};t.push(d.fetch(`/api/v1/teams/${this.$props.team_id}/members`,{method:"POST",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(i)}))}),Promise.all(t)},handleRemoveUsersFromTeams:function(){let t=[];return this.selectedUsers.forEach(s=>{let i={user_id:s.id};t.push(d.fetch(`/api/v1/teams/${s.team_id}/members`,{method:"DELETE",body:JSON.stringify(i)}))}),Promise.all(t)},addUsers:function(){let t=[];if(this.selectedUsers.forEach(s=>{s.team_id&&t.push(s.name)}),t.length){let s=_(t.join(", "));b({title:"Confirm Team Removal",body:`Les utilisateurs suivants sont actuellement dans une \xE9quipe:<br><br> ${s} <br><br>\xCAtes vous sur de vouloir les retirer de leur \xE9quipe et de les ajouter \xE0 celle-ci? <br><br>Tous leurs d\xE9fis r\xE9solus, tentatives, r\xE9compenses et indices vont \xEAtre supprim\xE9s!`,success:()=>{this.handleRemoveUsersFromTeams().then(i=>{this.handleAddUsersRequest().then(n=>{window.location.reload()})})}})}else this.handleAddUsersRequest().then(s=>{window.location.reload()})}},watch:{searchedName:function(t){this.awaitingSearch===!1&&setTimeout(()=>{this.searchUsers(),this.awaitingSearch=!1},1e3),this.awaitingSearch=!0}}},G={class:"form-group"},H=p("label",null,"Search Users",-1),K={class:"form-group"},Q=["onClick"],Y={class:"form-group"},W={key:0,class:"text-center"},X=p("span",{class:"text-muted"}," No users found ",-1),Z=[X],ee={class:"list-group"},te=["onClick"],se={class:"form-group"};function ie(t,s,i,n,l,r){return g(),v("div",null,[p("div",G,[H,x(p("input",{type:"text",class:"form-control",placeholder:"Search for users","onUpdate:modelValue":s[0]||(s[0]=a=>t.searchedName=a),onKeyup:[s[1]||(s[1]=E(a=>r.moveCursor("down"),["down"])),s[2]||(s[2]=E(a=>r.moveCursor("up"),["up"])),s[3]||(s[3]=E(a=>r.selectUser(),["enter"]))]},null,544),[[J,t.searchedName]])]),p("div",K,[(g(!0),v(j,null,D(t.selectedUsers,a=>(g(),v("span",{class:"badge badge-primary mr-1",key:a.id},[R(U(a.name)+" ",1),p("a",{class:"btn-fa",onClick:c=>r.removeSelectedUser(a.id)}," \xD7",8,Q)]))),128))]),p("div",Y,[t.userResults.length==0&&this.searchedName!=""&&t.awaitingSearch==!1?(g(),v("div",W,Z)):N("",!0),p("ul",ee,[(g(!0),v(j,null,D(t.userResults,(a,c)=>(g(),v("li",{class:$({"list-group-item":!0,active:c===t.selectedResultIdx}),key:a.id,onClick:w=>r.selectUser(c)},[R(U(a.name)+" ",1),a.team_id?(g(),v("small",{key:0,class:$({"float-right":!0,"text-white":c===t.selectedResultIdx,"text-muted":c!==t.selectedResultIdx})}," already in a team ",2)):N("",!0)],10,te))),128))])]),p("div",se,[p("button",{class:"btn btn-success d-inline-block float-right",onClick:s[4]||(s[4]=a=>r.addUsers())}," Add Users ")])])}const ne=P(L,[["render",ie]]);window.CTFd=d;function ae(t){t.preventDefault();const s=e("#team-info-create-form").serializeJSON(!0);s.fields=[];for(const i in s)if(i.match(/fields\[\d+\]/)){let n={},l=parseInt(i.slice(7,-1));n.field_id=l,n.value=s[i],s.fields.push(n),delete s[i]}d.fetch("/api/v1/teams",{method:"POST",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(s)}).then(function(i){return i.json()}).then(function(i){if(i.success){const n=i.data.id;window.location=d.config.urlRoot+"/admin/teams/"+n}else e("#team-info-create-form > #results").empty(),Object.keys(i.errors).forEach(function(n,l){e("#team-info-create-form > #results").append(T({type:"error",body:i.errors[n]}));const r=e("#team-info-create-form").find("input[name={0}]".format(n)),a=e(r);a.addClass("input-filled-invalid"),a.removeClass("input-filled-valid")})})}function oe(t){t.preventDefault();let s=e("#team-info-edit-form").serializeJSON(!0);s.fields=[];for(const i in s)if(i.match(/fields\[\d+\]/)){let n={},l=parseInt(i.slice(7,-1));n.field_id=l,n.value=s[i],s.fields.push(n),delete s[i]}d.fetch("/api/v1/teams/"+window.TEAM_ID,{method:"PATCH",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(s)}).then(function(i){return i.json()}).then(function(i){i.success?window.location.reload():(e("#team-info-form > #results").empty(),Object.keys(i.errors).forEach(function(n,l){e("#team-info-form > #results").append(T({type:"error",body:i.errors[n]}));const r=e("#team-info-form").find("input[name={0}]".format(n)),a=e(r);a.addClass("input-filled-invalid"),a.removeClass("input-filled-valid")}))})}function M(t){let i=e("input[data-submission-type=incorrect]:checked").map(function(){return e(this).data("submission-id")}),n=i.length===1?"submission":"submissions";b({title:"Valider une soumission",body:`\xCAtes vous sur de vouloir marquer ${i.length} ${n} correct?`,success:function(){const l=[];for(var r of i){let a=d.fetch(`/api/v1/submissions/${r}`,{method:"PATCH",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({type:"correct"})});l.push(a)}Promise.all(l).then(a=>{window.location.reload()})}})}function I(t,s){let i,n,l;switch(s){case"solves":i=e("input[data-submission-type=correct]:checked"),n="solve",l="Solves";break;case"fails":i=e("input[data-submission-type=incorrect]:checked"),n="fail",l="Fails";break}let r=i.map(function(){return e(this).data("submission-id")}),a=r.length===1?n:n+"s";b({title:`Supprimer ${l}`,body:`\xCAtes-vous certain de vouloir supprimer ${r.length} ${a}? (Si le d\xE9fi a d\xE9j\xE0 \xE9t\xE9 approuv\xE9, veuillez \xE9galement le supprimer dans les onglets de soumissions.)`,success:function(){const c=[];for(var w of r)c.push(d.api.delete_submission({submissionId:w}));Promise.all(c).then(C=>{window.location.reload()})}})}function re(t){let s=e("input[data-award-id]:checked").map(function(){return e(this).data("award-id")}),i=s.length===1?"award":"awards";b({title:"Supprimer Awards",body:`\xCAtes-vous certain de vouloir supprimer ${s.length} ${i}?`,success:function(){const n=[];for(var l of s){let r=d.fetch("/api/v1/awards/"+l,{method:"DELETE",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}});n.push(r)}Promise.all(n).then(r=>{window.location.reload()})}})}function le(t){t.preventDefault();let s=e("input[data-missing-challenge-id]:checked").map(function(){return e(this).data("missing-challenge-id")}),i=s.length===1?"challenge":"challenges";b({title:"Marquer Correct",body:`\xCAtes-vous s\xFBr de vouloir marquer ${s.length} ${i} correct pour ${_(window.TEAM_NAME)}?`,success:function(){z({title:"Attribution de l'utilisateur",body:` +import{_ as P,C as d,A as _,x as b,c as v,a as p,h as x,m as J,q as E,F as j,r as D,b as N,o as g,k as R,t as U,s as $,j as e,Q as T,R as F,V as q,D as z}from"./main.b0151f5b.js";import{c as A,u as S}from"../graphs.f4a6130f.js";import{C as V}from"../CommentBox.d3cef9cd.js";import{s as B}from"../visual.cf071827.js";import"../echarts.common.75806e9f.js";const L={name:"UserAddForm",props:{team_id:Number},data:function(){return{searchedName:"",awaitingSearch:!1,emptyResults:!1,userResults:[],selectedResultIdx:0,selectedUsers:[]}},methods:{searchUsers:function(){if(this.selectedResultIdx=0,this.searchedName==""){this.userResults=[];return}d.fetch(`/api/v1/users?view=admin&field=name&q=${this.searchedName}`,{method:"GET",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}}).then(t=>t.json()).then(t=>{t.success&&(this.userResults=t.data.slice(0,10))})},moveCursor:function(t){switch(t){case"up":this.selectedResultIdx&&(this.selectedResultIdx-=1);break;case"down":this.selectedResultIdx<this.userResults.length-1&&(this.selectedResultIdx+=1);break}},selectUser:function(t){t===void 0&&(t=this.selectedResultIdx);let s=this.userResults[t];this.selectedUsers.some(n=>n.id===s.id)===!1&&this.selectedUsers.push(s),this.userResults=[],this.searchedName=""},removeSelectedUser:function(t){this.selectedUsers=this.selectedUsers.filter(s=>s.id!==t)},handleAddUsersRequest:function(){let t=[];return this.selectedUsers.forEach(s=>{let i={user_id:s.id};t.push(d.fetch(`/api/v1/teams/${this.$props.team_id}/members`,{method:"POST",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(i)}))}),Promise.all(t)},handleRemoveUsersFromTeams:function(){let t=[];return this.selectedUsers.forEach(s=>{let i={user_id:s.id};t.push(d.fetch(`/api/v1/teams/${s.team_id}/members`,{method:"DELETE",body:JSON.stringify(i)}))}),Promise.all(t)},addUsers:function(){let t=[];if(this.selectedUsers.forEach(s=>{s.team_id&&t.push(s.name)}),t.length){let s=_(t.join(", "));b({title:"Confirm Team Removal",body:`Les utilisateurs suivants sont actuellement dans une \xE9quipe:<br><br> ${s} <br><br>\xCAtes vous sur de vouloir les retirer de leur \xE9quipe et de les ajouter \xE0 celle-ci? <br><br>Tous leurs d\xE9fis r\xE9solus, tentatives, r\xE9compenses et indices vont \xEAtre supprim\xE9s!`,success:()=>{this.handleRemoveUsersFromTeams().then(i=>{this.handleAddUsersRequest().then(n=>{window.location.reload()})})}})}else this.handleAddUsersRequest().then(s=>{window.location.reload()})}},watch:{searchedName:function(t){this.awaitingSearch===!1&&setTimeout(()=>{this.searchUsers(),this.awaitingSearch=!1},1e3),this.awaitingSearch=!0}}},G={class:"form-group"},H=p("label",null,"Search Users",-1),K={class:"form-group"},Q=["onClick"],Y={class:"form-group"},W={key:0,class:"text-center"},X=p("span",{class:"text-muted"}," No users found ",-1),Z=[X],ee={class:"list-group"},te=["onClick"],se={class:"form-group"};function ie(t,s,i,n,l,r){return g(),v("div",null,[p("div",G,[H,x(p("input",{type:"text",class:"form-control",placeholder:"Search for users","onUpdate:modelValue":s[0]||(s[0]=a=>t.searchedName=a),onKeyup:[s[1]||(s[1]=E(a=>r.moveCursor("down"),["down"])),s[2]||(s[2]=E(a=>r.moveCursor("up"),["up"])),s[3]||(s[3]=E(a=>r.selectUser(),["enter"]))]},null,544),[[J,t.searchedName]])]),p("div",K,[(g(!0),v(j,null,D(t.selectedUsers,a=>(g(),v("span",{class:"badge badge-primary mr-1",key:a.id},[R(U(a.name)+" ",1),p("a",{class:"btn-fa",onClick:c=>r.removeSelectedUser(a.id)}," \xD7",8,Q)]))),128))]),p("div",Y,[t.userResults.length==0&&this.searchedName!=""&&t.awaitingSearch==!1?(g(),v("div",W,Z)):N("",!0),p("ul",ee,[(g(!0),v(j,null,D(t.userResults,(a,c)=>(g(),v("li",{class:$({"list-group-item":!0,active:c===t.selectedResultIdx}),key:a.id,onClick:w=>r.selectUser(c)},[R(U(a.name)+" ",1),a.team_id?(g(),v("small",{key:0,class:$({"float-right":!0,"text-white":c===t.selectedResultIdx,"text-muted":c!==t.selectedResultIdx})}," already in a team ",2)):N("",!0)],10,te))),128))])]),p("div",se,[p("button",{class:"btn btn-success d-inline-block float-right",onClick:s[4]||(s[4]=a=>r.addUsers())}," Add Users ")])])}const ne=P(L,[["render",ie]]);window.CTFd=d;function ae(t){t.preventDefault();const s=e("#team-info-create-form").serializeJSON(!0);s.fields=[];for(const i in s)if(i.match(/fields\[\d+\]/)){let n={},l=parseInt(i.slice(7,-1));n.field_id=l,n.value=s[i],s.fields.push(n),delete s[i]}d.fetch("/api/v1/teams",{method:"POST",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(s)}).then(function(i){return i.json()}).then(function(i){if(i.success){const n=i.data.id;window.location=d.config.urlRoot+"/admin/teams/"+n}else e("#team-info-create-form > #results").empty(),Object.keys(i.errors).forEach(function(n,l){e("#team-info-create-form > #results").append(T({type:"error",body:i.errors[n]}));const r=e("#team-info-create-form").find("input[name={0}]".format(n)),a=e(r);a.addClass("input-filled-invalid"),a.removeClass("input-filled-valid")})})}function oe(t){t.preventDefault();let s=e("#team-info-edit-form").serializeJSON(!0);s.fields=[];for(const i in s)if(i.match(/fields\[\d+\]/)){let n={},l=parseInt(i.slice(7,-1));n.field_id=l,n.value=s[i],s.fields.push(n),delete s[i]}d.fetch("/api/v1/teams/"+window.TEAM_ID,{method:"PATCH",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(s)}).then(function(i){return i.json()}).then(function(i){i.success?window.location.reload():(e("#team-info-form > #results").empty(),Object.keys(i.errors).forEach(function(n,l){e("#team-info-form > #results").append(T({type:"error",body:i.errors[n]}));const r=e("#team-info-form").find("input[name={0}]".format(n)),a=e(r);a.addClass("input-filled-invalid"),a.removeClass("input-filled-valid")}))})}function M(t){let i=e("input[data-submission-type=incorrect]:checked").map(function(){return e(this).data("submission-id")}),n=i.length===1?"submission":"submissions";b({title:"Valider une soumission",body:`\xCAtes vous sur de vouloir marquer ${i.length} ${n} correct?`,success:function(){const l=[];for(var r of i){let a=d.fetch(`/api/v1/submissions/${r}`,{method:"PATCH",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({type:"correct"})});l.push(a)}Promise.all(l).then(a=>{window.location.reload()})}})}function I(t,s){let i,n,l;switch(s){case"solves":i=e("input[data-submission-type=correct]:checked"),n="solve",l="Solves";break;case"fails":i=e("input[data-submission-type=incorrect]:checked"),n="fail",l="Fails";break}let r=i.map(function(){return e(this).data("submission-id")}),a=r.length===1?n:n+"s";b({title:`Supprimer ${l}`,body:`\xCAtes-vous certain de vouloir supprimer ${r.length} ${a}? (Si le d\xE9fi a d\xE9j\xE0 \xE9t\xE9 approuv\xE9, veuillez \xE9galement le supprimer dans les onglets de soumissions.)`,success:function(){const c=[];for(var w of r)c.push(d.api.delete_submission({submissionId:w}));Promise.all(c).then(C=>{window.location.reload()})}})}function re(t){let s=e("input[data-award-id]:checked").map(function(){return e(this).data("award-id")}),i=s.length===1?"award":"awards";b({title:"Supprimer Awards",body:`\xCAtes-vous certain de vouloir supprimer ${s.length} ${i}?`,success:function(){const n=[];for(var l of s){let r=d.fetch("/api/v1/awards/"+l,{method:"DELETE",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}});n.push(r)}Promise.all(n).then(r=>{window.location.reload()})}})}function le(t){t.preventDefault();let s=e("input[data-missing-challenge-id]:checked").map(function(){return e(this).data("missing-challenge-id")}),i=s.length===1?"challenge":"challenges";b({title:"Marquer Correct",body:`\xCAtes-vous s\xFBr de vouloir marquer ${s.length} ${i} correct pour ${_(window.TEAM_NAME)}?`,success:function(){z({title:"Attribution de l'utilisateur",body:` Quel utilisateur dans l'\xE9quipe ${_(window.TEAM_NAME)} a r\xE9solu ces d\xE9fis? <div class="pb-3" id="query-team-member-solve"> ${e("#team-member-select").html()} diff --git a/CTFd/themes/admin/static/assets/pages/teams.c7ab65c7.js b/CTFd/themes/admin/static/assets/pages/teams.21a6b3f4.js similarity index 95% rename from CTFd/themes/admin/static/assets/pages/teams.c7ab65c7.js rename to CTFd/themes/admin/static/assets/pages/teams.21a6b3f4.js index 1a9dbea3085723a005d38112dd73e1109a67d9a9..4e37925856d1b3bf4c7d4e149ce71a41479263de 100644 --- a/CTFd/themes/admin/static/assets/pages/teams.c7ab65c7.js +++ b/CTFd/themes/admin/static/assets/pages/teams.21a6b3f4.js @@ -1,4 +1,4 @@ -import{j as e,x as r,C as s,D as u}from"./main.9f35ed12.js";function d(n){let t=e("input[data-team-id]:checked").map(function(){return e(this).data("team-id")}),i=t.length===1?"team":"teams";r({title:"Supprimer les \xE9quipes",body:`\xCAtes-vous certain de vouloir supprimer ${t.length} ${i}?`,success:function(){const a=[];for(var o of t)a.push(s.fetch(`/api/v1/teams/${o}`,{method:"DELETE"}));Promise.all(a).then(l=>{window.location.reload()})}})}function c(n){let t=e("input[data-team-id]:checked").map(function(){return e(this).data("team-id")});u({title:"Modifier les \xE9quipes",body:e(` +import{j as e,x as r,C as s,D as u}from"./main.b0151f5b.js";function d(n){let t=e("input[data-team-id]:checked").map(function(){return e(this).data("team-id")}),i=t.length===1?"team":"teams";r({title:"Supprimer les \xE9quipes",body:`\xCAtes-vous certain de vouloir supprimer ${t.length} ${i}?`,success:function(){const a=[];for(var o of t)a.push(s.fetch(`/api/v1/teams/${o}`,{method:"DELETE"}));Promise.all(a).then(l=>{window.location.reload()})}})}function c(n){let t=e("input[data-team-id]:checked").map(function(){return e(this).data("team-id")});u({title:"Modifier les \xE9quipes",body:e(` <form id="teams-bulk-edit"> <div class="form-group"> <label>Banni</label> diff --git a/CTFd/themes/admin/static/assets/pages/user.5945b8de.js b/CTFd/themes/admin/static/assets/pages/user.977486ab.js similarity index 96% rename from CTFd/themes/admin/static/assets/pages/user.5945b8de.js rename to CTFd/themes/admin/static/assets/pages/user.977486ab.js index cdca3a1d88f52abf9e04fc5fcbfd82f0825446c2..7b2db2033cd07e4a97c224c20b87cf7e85a39665 100644 --- a/CTFd/themes/admin/static/assets/pages/user.5945b8de.js +++ b/CTFd/themes/admin/static/assets/pages/user.977486ab.js @@ -1 +1 @@ -import{j as e,V as y,C as c,Q as u,x as d,A as w}from"./main.9f35ed12.js";import{c as m,u as p}from"../graphs.05e1bce6.js";import{C as _}from"../CommentBox.a3989c28.js";import{s as S}from"../visual.9577c47c.js";import"../echarts.common.3389571d.js";function C(n){n.preventDefault();const s=e("#user-info-create-form").serializeJSON(!0);s.fields=[];for(const r in s)if(r.match(/fields\[\d+\]/)){let o={},l=parseInt(r.slice(7,-1));o.field_id=l,o.value=s[r],s.fields.push(o),delete s[r]}let t="/api/v1/users";s.notify===!0&&(t=`${t}?notify=true`),delete s.notify,c.fetch(t,{method:"POST",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(s)}).then(function(r){return r.json()}).then(function(r){if(r.success){const o=r.data.id;window.location=c.config.urlRoot+"/admin/users/"+o}else e("#user-info-create-form > #results").empty(),Object.keys(r.errors).forEach(function(o,l){e("#user-info-create-form > #results").append(u({type:"error",body:r.errors[o]}));const a=e("#user-info-form").find("input[name={0}]".format(o)),f=e(a);f.addClass("input-filled-invalid"),f.removeClass("input-filled-valid")})})}function E(n){n.preventDefault();const s=e("#user-info-edit-form").serializeJSON(!0);s.fields=[];for(const t in s)if(t.match(/fields\[\d+\]/)){let i={},r=parseInt(t.slice(7,-1));i.field_id=r,i.value=s[t],s.fields.push(i),delete s[t]}c.fetch("/api/v1/users/"+window.USER_ID,{method:"PATCH",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(s)}).then(function(t){return t.json()}).then(function(t){t.success?window.location.reload():(e("#user-info-edit-form > #results").empty(),Object.keys(t.errors).forEach(function(i,r){e("#user-info-edit-form > #results").append(u({type:"error",body:t.errors[i]}));const o=e("#user-info-edit-form").find("input[name={0}]".format(i)),l=e(o);l.addClass("input-filled-invalid"),l.removeClass("input-filled-valid")}))})}function j(n){n.preventDefault(),d({title:"Supprimer l'utilisateur",body:"\xCAtes-vous certain de vouloir supprimer {0}".format("<strong>"+w(window.USER_NAME)+"</strong>"),success:function(){c.fetch("/api/v1/users/"+window.USER_ID,{method:"DELETE"}).then(function(s){return s.json()}).then(function(s){s.success&&(window.location=c.config.urlRoot+"/admin/users")})}})}function k(n){n.preventDefault();const s=e("#user-award-form").serializeJSON(!0);s.user_id=window.USER_ID,c.fetch("/api/v1/awards",{method:"POST",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(s)}).then(function(t){return t.json()}).then(function(t){t.success?window.location.reload():(e("#user-award-form > #results").empty(),Object.keys(t.errors).forEach(function(i,r){e("#user-award-form > #results").append(u({type:"error",body:t.errors[i]}));const o=e("#user-award-form").find("input[name={0}]".format(i)),l=e(o);l.addClass("input-filled-invalid"),l.removeClass("input-filled-valid")}))})}function I(n){n.preventDefault();var s=e("#user-mail-form").serializeJSON(!0);c.fetch("/api/v1/users/"+window.USER_ID+"/email",{method:"POST",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(s)}).then(function(t){return t.json()}).then(function(t){t.success?(e("#user-mail-form > #results").append(u({type:"success",body:"Courriel envoy\xE9 avec succ\xE8s!"})),e("#user-mail-form").find("input[type=text], textarea").val("")):(e("#user-mail-form > #results").empty(),Object.keys(t.errors).forEach(function(i,r){e("#user-mail-form > #results").append(u({type:"error",body:t.errors[i]}));var o=e("#user-mail-form").find("input[name={0}], textarea[name={0}]".format(i)),l=e(o);l.addClass("input-filled-invalid"),l.removeClass("input-filled-valid")}))})}function v(n){let t=e("input[data-submission-type=incorrect]:checked").map(function(){return e(this).data("submission-id")}),i=t.length===1?"submission":"submissions";d({title:"Valider une soumission",body:`\xCAtes vous sur de vouloir marquer ${t.length} ${i} correct?`,success:function(){const r=[];for(var o of t){let l=c.fetch(`/api/v1/submissions/${o}`,{method:"PATCH",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({type:"correct"})});r.push(l)}Promise.all(r).then(l=>{window.location.reload()})}})}function h(n,s){let t,i,r;switch(s){case"solves":t=e("input[data-submission-type=correct]:checked"),i="solve",r="Solves";break;case"fails":t=e("input[data-submission-type=incorrect]:checked"),i="fail",r="Fails";break}let o=t.map(function(){return e(this).data("submission-id")}),l=o.length===1?i:i+"s";d({title:`Supprimer ${r}`,body:`\xCAtes-vous certain de vouloir supprimer ${o.length} ${l}?`,success:function(){const a=[];for(var f of o)a.push(c.api.delete_submission({submissionId:f}));Promise.all(a).then(N=>{window.location.reload()})}})}function D(n){let s=e("input[data-award-id]:checked").map(function(){return e(this).data("award-id")}),t=s.length===1?"award":"awards";d({title:"Supprimer Awards",body:`\xCAtes-vous certain de vouloir supprimer ${s.length} ${t}?`,success:function(){const i=[];for(var r of s){let o=c.fetch("/api/v1/awards/"+r,{method:"DELETE",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}});i.push(o)}Promise.all(i).then(o=>{window.location.reload()})}})}function O(n){n.preventDefault();let s=e("input[data-missing-challenge-id]:checked").map(function(){return e(this).data("missing-challenge-id")}),t=s.length===1?"challenge":"challenges";d({title:"Marquer Correct",body:`\xCAtes-vous s\xFBr de vouloir marquer ${s.length} ${t} correct pour ${w(window.USER_NAME)}?`,success:function(){const i=[];for(var r of s){let o={provided:"MARKED AS SOLVED BY ADMIN",user_id:window.USER_ID,team_id:window.TEAM_ID,challenge_id:r,type:"correct"},l=c.fetch("/api/v1/submissions",{method:"POST",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(o)});i.push(l)}Promise.all(i).then(o=>{window.location.reload()})}})}const b={team:[n=>c.api.get_team_solves({teamId:n}),n=>c.api.get_team_fails({teamId:n}),n=>c.api.get_team_awards({teamId:n})],user:[n=>c.api.get_user_solves({userId:n}),n=>c.api.get_user_fails({userId:n}),n=>c.api.get_user_awards({userId:n})]},A=(n,s,t,i)=>{let[r,o,l]=b[n];Promise.all([r(i),o(i),l(i)]).then(a=>{m("score_graph","#score-graph",a,n,s,t,i),m("category_breakdown","#categories-pie-graph",a,n,s,t,i),m("solve_percentages","#keys-pie-graph",a,n,s,t,i)})},T=(n,s,t,i)=>{let[r,o,l]=b[n];Promise.all([r(i),o(i),l(i)]).then(a=>{p("score_graph","#score-graph",a,n,s,t,i),p("category_breakdown","#categories-pie-graph",a,n,s,t,i),p("solve_percentages","#keys-pie-graph",a,n,s,t,i)})};e(()=>{e(".delete-user").click(j),e(".edit-user").click(function(a){e("#user-info-modal").modal("toggle")}),e(".award-user").click(function(a){e("#user-award-modal").modal("toggle")}),e(".email-user").click(function(a){e("#user-email-modal").modal("toggle")}),e(".addresses-user").click(function(a){e("#user-addresses-modal").modal("toggle")}),e("#user-mail-form").submit(I),e("#solves-delete-button").click(function(a){h(a,"solves")}),e("#correct-fail-button").click(v),e("#correct-submissions-button").click(v),e("#fails-delete-button").click(function(a){h(a,"fails")}),e("#submissions-delete-button").click(function(a){h(a,"fails")}),e("#awards-delete-button").click(function(a){D()}),e("#missing-solve-button").click(function(a){O(a)}),e("#user-info-create-form").submit(C),e("#user-info-edit-form").submit(E),e("#user-award-form").submit(k);const n=y.extend(_);let s=document.createElement("div");document.querySelector("#comment-box").appendChild(s),new n({propsData:{type:"user",id:window.USER_ID}}).$mount(s);let t,i,r,o;({type:t,id:i,name:r,account_id:o}=window.stats_data);let l;e("#user-statistics-modal").on("shown.bs.modal",function(a){A(t,i,r,o),l=setInterval(()=>{T(t,i,r,o)},3e5)}),e("#user-statistics-modal").on("hidden.bs.modal",function(a){clearInterval(l)}),e(".statistics-user").click(function(a){e("#user-statistics-modal").modal("toggle")})});let g=document.getElementsByClassName("imageContainer");for(let n=0;n<g.length;n++)S(g[n]); +import{j as e,V as y,C as c,Q as u,x as d,A as w}from"./main.b0151f5b.js";import{c as m,u as p}from"../graphs.f4a6130f.js";import{C as _}from"../CommentBox.d3cef9cd.js";import{s as S}from"../visual.cf071827.js";import"../echarts.common.75806e9f.js";function C(n){n.preventDefault();const s=e("#user-info-create-form").serializeJSON(!0);s.fields=[];for(const r in s)if(r.match(/fields\[\d+\]/)){let o={},l=parseInt(r.slice(7,-1));o.field_id=l,o.value=s[r],s.fields.push(o),delete s[r]}let t="/api/v1/users";s.notify===!0&&(t=`${t}?notify=true`),delete s.notify,c.fetch(t,{method:"POST",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(s)}).then(function(r){return r.json()}).then(function(r){if(r.success){const o=r.data.id;window.location=c.config.urlRoot+"/admin/users/"+o}else e("#user-info-create-form > #results").empty(),Object.keys(r.errors).forEach(function(o,l){e("#user-info-create-form > #results").append(u({type:"error",body:r.errors[o]}));const a=e("#user-info-form").find("input[name={0}]".format(o)),f=e(a);f.addClass("input-filled-invalid"),f.removeClass("input-filled-valid")})})}function E(n){n.preventDefault();const s=e("#user-info-edit-form").serializeJSON(!0);s.fields=[];for(const t in s)if(t.match(/fields\[\d+\]/)){let i={},r=parseInt(t.slice(7,-1));i.field_id=r,i.value=s[t],s.fields.push(i),delete s[t]}c.fetch("/api/v1/users/"+window.USER_ID,{method:"PATCH",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(s)}).then(function(t){return t.json()}).then(function(t){t.success?window.location.reload():(e("#user-info-edit-form > #results").empty(),Object.keys(t.errors).forEach(function(i,r){e("#user-info-edit-form > #results").append(u({type:"error",body:t.errors[i]}));const o=e("#user-info-edit-form").find("input[name={0}]".format(i)),l=e(o);l.addClass("input-filled-invalid"),l.removeClass("input-filled-valid")}))})}function j(n){n.preventDefault(),d({title:"Supprimer l'utilisateur",body:"\xCAtes-vous certain de vouloir supprimer {0}".format("<strong>"+w(window.USER_NAME)+"</strong>"),success:function(){c.fetch("/api/v1/users/"+window.USER_ID,{method:"DELETE"}).then(function(s){return s.json()}).then(function(s){s.success&&(window.location=c.config.urlRoot+"/admin/users")})}})}function k(n){n.preventDefault();const s=e("#user-award-form").serializeJSON(!0);s.user_id=window.USER_ID,c.fetch("/api/v1/awards",{method:"POST",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(s)}).then(function(t){return t.json()}).then(function(t){t.success?window.location.reload():(e("#user-award-form > #results").empty(),Object.keys(t.errors).forEach(function(i,r){e("#user-award-form > #results").append(u({type:"error",body:t.errors[i]}));const o=e("#user-award-form").find("input[name={0}]".format(i)),l=e(o);l.addClass("input-filled-invalid"),l.removeClass("input-filled-valid")}))})}function I(n){n.preventDefault();var s=e("#user-mail-form").serializeJSON(!0);c.fetch("/api/v1/users/"+window.USER_ID+"/email",{method:"POST",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(s)}).then(function(t){return t.json()}).then(function(t){t.success?(e("#user-mail-form > #results").append(u({type:"success",body:"Courriel envoy\xE9 avec succ\xE8s!"})),e("#user-mail-form").find("input[type=text], textarea").val("")):(e("#user-mail-form > #results").empty(),Object.keys(t.errors).forEach(function(i,r){e("#user-mail-form > #results").append(u({type:"error",body:t.errors[i]}));var o=e("#user-mail-form").find("input[name={0}], textarea[name={0}]".format(i)),l=e(o);l.addClass("input-filled-invalid"),l.removeClass("input-filled-valid")}))})}function v(n){let t=e("input[data-submission-type=incorrect]:checked").map(function(){return e(this).data("submission-id")}),i=t.length===1?"submission":"submissions";d({title:"Valider une soumission",body:`\xCAtes vous sur de vouloir marquer ${t.length} ${i} correct?`,success:function(){const r=[];for(var o of t){let l=c.fetch(`/api/v1/submissions/${o}`,{method:"PATCH",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({type:"correct"})});r.push(l)}Promise.all(r).then(l=>{window.location.reload()})}})}function h(n,s){let t,i,r;switch(s){case"solves":t=e("input[data-submission-type=correct]:checked"),i="solve",r="Solves";break;case"fails":t=e("input[data-submission-type=incorrect]:checked"),i="fail",r="Fails";break}let o=t.map(function(){return e(this).data("submission-id")}),l=o.length===1?i:i+"s";d({title:`Supprimer ${r}`,body:`\xCAtes-vous certain de vouloir supprimer ${o.length} ${l}?`,success:function(){const a=[];for(var f of o)a.push(c.api.delete_submission({submissionId:f}));Promise.all(a).then(N=>{window.location.reload()})}})}function D(n){let s=e("input[data-award-id]:checked").map(function(){return e(this).data("award-id")}),t=s.length===1?"award":"awards";d({title:"Supprimer Awards",body:`\xCAtes-vous certain de vouloir supprimer ${s.length} ${t}?`,success:function(){const i=[];for(var r of s){let o=c.fetch("/api/v1/awards/"+r,{method:"DELETE",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}});i.push(o)}Promise.all(i).then(o=>{window.location.reload()})}})}function O(n){n.preventDefault();let s=e("input[data-missing-challenge-id]:checked").map(function(){return e(this).data("missing-challenge-id")}),t=s.length===1?"challenge":"challenges";d({title:"Marquer Correct",body:`\xCAtes-vous s\xFBr de vouloir marquer ${s.length} ${t} correct pour ${w(window.USER_NAME)}?`,success:function(){const i=[];for(var r of s){let o={provided:"MARKED AS SOLVED BY ADMIN",user_id:window.USER_ID,team_id:window.TEAM_ID,challenge_id:r,type:"correct"},l=c.fetch("/api/v1/submissions",{method:"POST",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(o)});i.push(l)}Promise.all(i).then(o=>{window.location.reload()})}})}const b={team:[n=>c.api.get_team_solves({teamId:n}),n=>c.api.get_team_fails({teamId:n}),n=>c.api.get_team_awards({teamId:n})],user:[n=>c.api.get_user_solves({userId:n}),n=>c.api.get_user_fails({userId:n}),n=>c.api.get_user_awards({userId:n})]},A=(n,s,t,i)=>{let[r,o,l]=b[n];Promise.all([r(i),o(i),l(i)]).then(a=>{m("score_graph","#score-graph",a,n,s,t,i),m("category_breakdown","#categories-pie-graph",a,n,s,t,i),m("solve_percentages","#keys-pie-graph",a,n,s,t,i)})},T=(n,s,t,i)=>{let[r,o,l]=b[n];Promise.all([r(i),o(i),l(i)]).then(a=>{p("score_graph","#score-graph",a,n,s,t,i),p("category_breakdown","#categories-pie-graph",a,n,s,t,i),p("solve_percentages","#keys-pie-graph",a,n,s,t,i)})};e(()=>{e(".delete-user").click(j),e(".edit-user").click(function(a){e("#user-info-modal").modal("toggle")}),e(".award-user").click(function(a){e("#user-award-modal").modal("toggle")}),e(".email-user").click(function(a){e("#user-email-modal").modal("toggle")}),e(".addresses-user").click(function(a){e("#user-addresses-modal").modal("toggle")}),e("#user-mail-form").submit(I),e("#solves-delete-button").click(function(a){h(a,"solves")}),e("#correct-fail-button").click(v),e("#correct-submissions-button").click(v),e("#fails-delete-button").click(function(a){h(a,"fails")}),e("#submissions-delete-button").click(function(a){h(a,"fails")}),e("#awards-delete-button").click(function(a){D()}),e("#missing-solve-button").click(function(a){O(a)}),e("#user-info-create-form").submit(C),e("#user-info-edit-form").submit(E),e("#user-award-form").submit(k);const n=y.extend(_);let s=document.createElement("div");document.querySelector("#comment-box").appendChild(s),new n({propsData:{type:"user",id:window.USER_ID}}).$mount(s);let t,i,r,o;({type:t,id:i,name:r,account_id:o}=window.stats_data);let l;e("#user-statistics-modal").on("shown.bs.modal",function(a){A(t,i,r,o),l=setInterval(()=>{T(t,i,r,o)},3e5)}),e("#user-statistics-modal").on("hidden.bs.modal",function(a){clearInterval(l)}),e(".statistics-user").click(function(a){e("#user-statistics-modal").modal("toggle")})});let g=document.getElementsByClassName("imageContainer");for(let n=0;n<g.length;n++)S(g[n]); diff --git a/CTFd/themes/admin/static/assets/pages/users.7b041154.js b/CTFd/themes/admin/static/assets/pages/users.457072e5.js similarity index 96% rename from CTFd/themes/admin/static/assets/pages/users.7b041154.js rename to CTFd/themes/admin/static/assets/pages/users.457072e5.js index 717fc5f2dcfd30427e8f7308c1da8565166eb8d0..fb7e1a908db88aa8eca3db80bcc90364bc332b82 100644 --- a/CTFd/themes/admin/static/assets/pages/users.7b041154.js +++ b/CTFd/themes/admin/static/assets/pages/users.457072e5.js @@ -1,4 +1,4 @@ -import{j as e,x as n,C as a,D as u}from"./main.9f35ed12.js";function d(r){let t=e("input[data-user-id]:checked").map(function(){return e(this).data("user-id")}),o=t.length===1?"user":"users";n({title:"Supprimer les utilisateurs",body:`\xCAtes-vous certain de vouloir supprimer ${t.length} ${o}?`,success:function(){const i=[];for(var s of t)i.push(a.fetch(`/api/v1/users/${s}`,{method:"DELETE"}));Promise.all(i).then(l=>{window.location.reload()})}})}function p(r){let t=e("input[data-user-id]:checked").map(function(){return e(this).data("user-id")});u({title:"Edit Users",body:e(` +import{j as e,x as n,C as a,D as u}from"./main.b0151f5b.js";function d(r){let t=e("input[data-user-id]:checked").map(function(){return e(this).data("user-id")}),o=t.length===1?"user":"users";n({title:"Supprimer les utilisateurs",body:`\xCAtes-vous certain de vouloir supprimer ${t.length} ${o}?`,success:function(){const i=[];for(var s of t)i.push(a.fetch(`/api/v1/users/${s}`,{method:"DELETE"}));Promise.all(i).then(l=>{window.location.reload()})}})}function p(r){let t=e("input[data-user-id]:checked").map(function(){return e(this).data("user-id")});u({title:"Edit Users",body:e(` <form id="users-bulk-edit"> <div class="form-group"> <label>V\xE9rifi\xE9</label> diff --git a/CTFd/themes/admin/static/assets/tab.c508b42d.js b/CTFd/themes/admin/static/assets/tab.12dd2b64.js similarity index 98% rename from CTFd/themes/admin/static/assets/tab.c508b42d.js rename to CTFd/themes/admin/static/assets/tab.12dd2b64.js index b012e461b41e7fda875ace7786bb87fd4705c81f..04210bd88ca6b38d5b552fb5ecd6387cbe46ce34 100644 --- a/CTFd/themes/admin/static/assets/tab.c508b42d.js +++ b/CTFd/themes/admin/static/assets/tab.12dd2b64.js @@ -1,4 +1,4 @@ -import{G as V,H as S,I as w}from"./pages/main.9f35ed12.js";var P={exports:{}};/*! +import{G as V,H as S,I as w}from"./pages/main.b0151f5b.js";var P={exports:{}};/*! * Bootstrap tab.js v4.3.1 (https://getbootstrap.com/) * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) diff --git a/CTFd/themes/admin/static/assets/visual.9577c47c.js b/CTFd/themes/admin/static/assets/visual.cf071827.js similarity index 98% rename from CTFd/themes/admin/static/assets/visual.9577c47c.js rename to CTFd/themes/admin/static/assets/visual.cf071827.js index 2be7559c9c584a378b37d801da94071ebae6db45..ad2c5eb16eb621d8b8e819797ea9b1fa1a1d625c 100644 --- a/CTFd/themes/admin/static/assets/visual.9577c47c.js +++ b/CTFd/themes/admin/static/assets/visual.cf071827.js @@ -1 +1 @@ -import{D as r}from"./pages/main.9f35ed12.js";window.carouselPosition=0;window.carouselMax=0;async function u(t){let e=t.id,l;try{l=JSON.parse(e),l%10==l%10&&(l=!1)}catch{}if(console.log(e),l){let s=!1;for(let o=0;o<l.length;o++)if(l[o].type=="thumbsnail"){s=!0;let i=a(l[o]);i.style.width="50px",i.style.height="auto",t.appendChild(i),t.onclick=c}if(!s){let o=document.createElement("p");o.textContent="Pas de miniature disponible pour les m\xE9dias actuels",t.appendChild(o)}}else if(e.length>66){let s=document.createElement("i");s.className="fas fa-file-alt",s.style.cursor="pointer",s.style.fontSize="24px",s.onclick=function(){d(e)},t.appendChild(s)}else{let s=document.createElement("p");s.textContent=e,s.style.wordWrap="break-word",t.appendChild(s)}}function d(t){let e=document.createElement("div");e.style.position="fixed",e.style.left="0",e.style.top="0",e.style.width="100%",e.style.height="100%",e.style.backgroundColor="rgba(0, 0, 0, 0.5)",e.style.zIndex="999",e.onclick=function(i){i.target===e&&document.body.removeChild(e)};let l=document.createElement("div");l.style.position="fixed",l.style.left="50%",l.style.top="50%",l.style.transform="translate(-50%, -50%)",l.style.backgroundColor="#f9f9f9",l.style.border="1px solid #ccc",l.style.borderRadius="8px",l.style.padding="20px",l.style.zIndex="1000",l.style.width="80%",l.style.maxWidth="600px",l.style.height="auto",l.style.maxHeight="40%",l.style.overflowY="auto",l.style.boxShadow="0 4px 8px rgba(0, 0, 0, 0.1)";let s=document.createElement("p");s.textContent=t,s.style.wordWrap="break-word",s.style.margin="0",s.style.color="#333",s.style.fontFamily="Arial, sans-serif",l.appendChild(s);let o=document.createElement("button");o.textContent="x",o.className="close",o.ariaLabel="Close",o.style.position="absolute",o.style.top="0px",o.style.right="5px",o.style.cursor="pointer",o.onclick=function(){document.body.removeChild(e)},l.appendChild(o),e.appendChild(l),document.body.appendChild(e)}function a(t){let e;return t.type=="video/webm"?(e=document.createElement("video"),e.controls=!0,e.type="video/webm"):(t.type=="image/png"||t.type=="thumbsnail")&&(e=document.createElement("img"),e.type="image/png"),e.src="/files/"+t.location,e}function c(t){window.carouselPosition=0;let e;try{e=JSON.parse(t.srcElement.id)}catch{e=JSON.parse(t.srcElement.parentElement.id)}let l=!1;window.carouselMax=e.length-1;let s="<section class='slider-wrapper'><ul class='slides-container list-unstyled' style:'list-style: none !important;' id='slides-container'>";for(let o=0;o<e.length;o++)if(e[o].type!="thumbsnail"){let i=a(e[o]);i.style.width="100%",i.style.objectFit="contain",i.style.height="500px";let n=document.createElement("div");n.append(i),s+='<li class="slide '+(l?o-1:o)+'slide" style="min-height:50%">',s+=n.innerHTML,s+="</li>"}else l=!0;s+="</ul></section>",s+=`<img src onerror='reloadCarousel(this.parentElement);'><button class='btn btn-primary carousel__navigation-button slide-arrow-prev' id='slide-arrow-prev' onclick='downCarousel(this)' style='display:block;position:absolute;top:40%;left:1rem;'><svg viewBox="0 0 100 100"><path d="M 50,0 L 60,10 L 20,50 L 60,90 L 50,100 L 0,50 Z" class="arrow" fill="white" transform="translate(15,0) rotate(0)"></path></svg></button><button style='position:absolute;top:40%;right:1rem;' class='btn btn-primary carousel__navigation-button slide-arrow-next' id='slide-arrow-next' onclick='upCarousel(this)'><svg viewBox="0 0 100 100"><path d="M 50,0 L 60,10 L 20,50 L 60,90 L 50,100 L 0,50 Z" class="arrow" fill="white" transform="translate(85,100) rotate(180)"></path></svg></button>`,r({title:"Visioneurs",body:s,button:"retour",additionalClassMain:"FullSizeCarousel"}),document.getElementsByClassName("modal-dialog")[0].style.listStyle="none"}window.upCarousel=function(t){window.carouselPosition+=1,window.carouselPosition!=window.carouselMax-1?(window.reloadCarousel(t.parentElement),t.parentElement.getElementsByClassName("slide-arrow-prev")[0].hidden=!1):(window.reloadCarousel(t.parentElement),t.parentElement.getElementsByClassName("slide-arrow-next")[0].hidden=!0,t.parentElement.getElementsByClassName("slide-arrow-prev")[0].hidden=!1)};window.downCarousel=function(t){window.carouselPosition-=1,window.carouselPosition!=0?(window.reloadCarousel(t.parentElement),t.parentElement.getElementsByClassName("slide-arrow-next")[0].hidden=!1):(window.reloadCarousel(t.parentElement),t.parentElement.getElementsByClassName("slide-arrow-prev")[0].hiddend=!0,t.parentElement.getElementsByClassName("slide-arrow-next")[0].hidden=!1)};window.reloadCarousel=function(t){window.carouselPosition==0&&(t.getElementsByClassName("slide-arrow-prev")[0].hidden=!0),window.carouselMax==1&&(t.getElementsByClassName("slide-arrow-next")[0].hidden=!0);for(let e=0;e<window.carouselMax;e++)if(e==window.carouselPosition)t.getElementsByClassName(e+"slide")[0].hidden=!1;else{t.getElementsByClassName(e+"slide")[0].hidden=!0;let l=t.getElementsByClassName(e+"slide")[0].firstChild;l.nodeName=="VIDEO"&&l.pause()}};export{u as s}; +import{D as r}from"./pages/main.b0151f5b.js";window.carouselPosition=0;window.carouselMax=0;async function u(t){let e=t.id,l;try{l=JSON.parse(e),l%10==l%10&&(l=!1)}catch{}if(console.log(e),l){let s=!1;for(let o=0;o<l.length;o++)if(l[o].type=="thumbsnail"){s=!0;let i=a(l[o]);i.style.width="50px",i.style.height="auto",t.appendChild(i),t.onclick=c}if(!s){let o=document.createElement("p");o.textContent="Pas de miniature disponible pour les m\xE9dias actuels",t.appendChild(o)}}else if(e.length>66){let s=document.createElement("i");s.className="fas fa-file-alt",s.style.cursor="pointer",s.style.fontSize="24px",s.onclick=function(){d(e)},t.appendChild(s)}else{let s=document.createElement("p");s.textContent=e,s.style.wordWrap="break-word",t.appendChild(s)}}function d(t){let e=document.createElement("div");e.style.position="fixed",e.style.left="0",e.style.top="0",e.style.width="100%",e.style.height="100%",e.style.backgroundColor="rgba(0, 0, 0, 0.5)",e.style.zIndex="999",e.onclick=function(i){i.target===e&&document.body.removeChild(e)};let l=document.createElement("div");l.style.position="fixed",l.style.left="50%",l.style.top="50%",l.style.transform="translate(-50%, -50%)",l.style.backgroundColor="#f9f9f9",l.style.border="1px solid #ccc",l.style.borderRadius="8px",l.style.padding="20px",l.style.zIndex="1000",l.style.width="80%",l.style.maxWidth="600px",l.style.height="auto",l.style.maxHeight="40%",l.style.overflowY="auto",l.style.boxShadow="0 4px 8px rgba(0, 0, 0, 0.1)";let s=document.createElement("p");s.textContent=t,s.style.wordWrap="break-word",s.style.margin="0",s.style.color="#333",s.style.fontFamily="Arial, sans-serif",l.appendChild(s);let o=document.createElement("button");o.textContent="x",o.className="close",o.ariaLabel="Close",o.style.position="absolute",o.style.top="0px",o.style.right="5px",o.style.cursor="pointer",o.onclick=function(){document.body.removeChild(e)},l.appendChild(o),e.appendChild(l),document.body.appendChild(e)}function a(t){let e;return t.type=="video/webm"?(e=document.createElement("video"),e.controls=!0,e.type="video/webm"):(t.type=="image/png"||t.type=="thumbsnail")&&(e=document.createElement("img"),e.type="image/png"),e.src="/files/"+t.location,e}function c(t){window.carouselPosition=0;let e;try{e=JSON.parse(t.srcElement.id)}catch{e=JSON.parse(t.srcElement.parentElement.id)}let l=!1;window.carouselMax=e.length-1;let s="<section class='slider-wrapper'><ul class='slides-container list-unstyled' style:'list-style: none !important;' id='slides-container'>";for(let o=0;o<e.length;o++)if(e[o].type!="thumbsnail"){let i=a(e[o]);i.style.width="100%",i.style.objectFit="contain",i.style.height="500px";let n=document.createElement("div");n.append(i),s+='<li class="slide '+(l?o-1:o)+'slide" style="min-height:50%">',s+=n.innerHTML,s+="</li>"}else l=!0;s+="</ul></section>",s+=`<img src onerror='reloadCarousel(this.parentElement);'><button class='btn btn-primary carousel__navigation-button slide-arrow-prev' id='slide-arrow-prev' onclick='downCarousel(this)' style='display:block;position:absolute;top:40%;left:1rem;'><svg viewBox="0 0 100 100"><path d="M 50,0 L 60,10 L 20,50 L 60,90 L 50,100 L 0,50 Z" class="arrow" fill="white" transform="translate(15,0) rotate(0)"></path></svg></button><button style='position:absolute;top:40%;right:1rem;' class='btn btn-primary carousel__navigation-button slide-arrow-next' id='slide-arrow-next' onclick='upCarousel(this)'><svg viewBox="0 0 100 100"><path d="M 50,0 L 60,10 L 20,50 L 60,90 L 50,100 L 0,50 Z" class="arrow" fill="white" transform="translate(85,100) rotate(180)"></path></svg></button>`,r({title:"Visioneurs",body:s,button:"retour",additionalClassMain:"FullSizeCarousel"}),document.getElementsByClassName("modal-dialog")[0].style.listStyle="none"}window.upCarousel=function(t){window.carouselPosition+=1,window.carouselPosition!=window.carouselMax-1?(window.reloadCarousel(t.parentElement),t.parentElement.getElementsByClassName("slide-arrow-prev")[0].hidden=!1):(window.reloadCarousel(t.parentElement),t.parentElement.getElementsByClassName("slide-arrow-next")[0].hidden=!0,t.parentElement.getElementsByClassName("slide-arrow-prev")[0].hidden=!1)};window.downCarousel=function(t){window.carouselPosition-=1,window.carouselPosition!=0?(window.reloadCarousel(t.parentElement),t.parentElement.getElementsByClassName("slide-arrow-next")[0].hidden=!1):(window.reloadCarousel(t.parentElement),t.parentElement.getElementsByClassName("slide-arrow-prev")[0].hiddend=!0,t.parentElement.getElementsByClassName("slide-arrow-next")[0].hidden=!1)};window.reloadCarousel=function(t){window.carouselPosition==0&&(t.getElementsByClassName("slide-arrow-prev")[0].hidden=!0),window.carouselMax==1&&(t.getElementsByClassName("slide-arrow-next")[0].hidden=!0);for(let e=0;e<window.carouselMax;e++)if(e==window.carouselPosition)t.getElementsByClassName(e+"slide")[0].hidden=!1;else{t.getElementsByClassName(e+"slide")[0].hidden=!0;let l=t.getElementsByClassName(e+"slide")[0].firstChild;l.nodeName=="VIDEO"&&l.pause()}};export{u as s}; diff --git a/CTFd/themes/admin/static/manifest.json b/CTFd/themes/admin/static/manifest.json index 5facae3e90c6a86afea7977d35553f8e19313d45..62f9ca78ebf70bbe70760adef279464f7d606ab4 100644 --- a/CTFd/themes/admin/static/manifest.json +++ b/CTFd/themes/admin/static/manifest.json @@ -1,24 +1,24 @@ { "assets/js/pages/main.js": { - "file": "assets/pages/main.9f35ed12.js", + "file": "assets/pages/main.b0151f5b.js", "src": "assets/js/pages/main.js", "isEntry": true }, "assets/js/pages/challenge.js": { - "file": "assets/pages/challenge.34c205c6.js", + "file": "assets/pages/challenge.23743f93.js", "src": "assets/js/pages/challenge.js", "isEntry": true, "imports": [ "assets/js/pages/main.js", - "_tab.c508b42d.js", - "_CommentBox.a3989c28.js" + "_tab.12dd2b64.js", + "_CommentBox.d3cef9cd.js" ], "css": [ "assets/challenge.66ec3ebe.css" ] }, "assets/js/pages/challenges.js": { - "file": "assets/pages/challenges.31db042e.js", + "file": "assets/pages/challenges.d31a596d.js", "src": "assets/js/pages/challenges.js", "isEntry": true, "imports": [ @@ -26,17 +26,17 @@ ] }, "assets/js/pages/configs.js": { - "file": "assets/pages/configs.2c7edd70.js", + "file": "assets/pages/configs.fe262128.js", "src": "assets/js/pages/configs.js", "isEntry": true, "imports": [ "assets/js/pages/main.js", - "_tab.c508b42d.js", - "_htmlmixed.60cb33cf.js" + "_tab.12dd2b64.js", + "_htmlmixed.245897c1.js" ] }, "assets/js/pages/notifications.js": { - "file": "assets/pages/notifications.ba00413d.js", + "file": "assets/pages/notifications.6d8d6cb6.js", "src": "assets/js/pages/notifications.js", "isEntry": true, "imports": [ @@ -44,17 +44,17 @@ ] }, "assets/js/pages/editor.js": { - "file": "assets/pages/editor.6362b1bf.js", + "file": "assets/pages/editor.a9e33c66.js", "src": "assets/js/pages/editor.js", "isEntry": true, "imports": [ "assets/js/pages/main.js", - "_htmlmixed.60cb33cf.js", - "_CommentBox.a3989c28.js" + "_htmlmixed.245897c1.js", + "_CommentBox.d3cef9cd.js" ] }, "assets/js/pages/pages.js": { - "file": "assets/pages/pages.dc323f6c.js", + "file": "assets/pages/pages.005098aa.js", "src": "assets/js/pages/pages.js", "isEntry": true, "imports": [ @@ -62,7 +62,7 @@ ] }, "assets/js/pages/reset.js": { - "file": "assets/pages/reset.765caf6c.js", + "file": "assets/pages/reset.22a4fe7a.js", "src": "assets/js/pages/reset.js", "isEntry": true, "imports": [ @@ -70,7 +70,7 @@ ] }, "assets/js/pages/scoreboard.js": { - "file": "assets/pages/scoreboard.4eacd5c7.js", + "file": "assets/pages/scoreboard.277a9045.js", "src": "assets/js/pages/scoreboard.js", "isEntry": true, "imports": [ @@ -78,37 +78,37 @@ ] }, "assets/js/pages/statistics.js": { - "file": "assets/pages/statistics.a646c07a.js", + "file": "assets/pages/statistics.9cb123a3.js", "src": "assets/js/pages/statistics.js", "isEntry": true, "imports": [ "assets/js/pages/main.js", - "_echarts.common.3389571d.js" + "_echarts.common.75806e9f.js" ] }, "assets/js/pages/submissions.js": { - "file": "assets/pages/submissions.265b22dc.js", + "file": "assets/pages/submissions.388ef183.js", "src": "assets/js/pages/submissions.js", "isEntry": true, "imports": [ "assets/js/pages/main.js", - "_visual.9577c47c.js" + "_visual.cf071827.js" ] }, "assets/js/pages/team.js": { - "file": "assets/pages/team.4a8539df.js", + "file": "assets/pages/team.c844301c.js", "src": "assets/js/pages/team.js", "isEntry": true, "imports": [ "assets/js/pages/main.js", - "_graphs.05e1bce6.js", - "_CommentBox.a3989c28.js", - "_visual.9577c47c.js", - "_echarts.common.3389571d.js" + "_graphs.f4a6130f.js", + "_CommentBox.d3cef9cd.js", + "_visual.cf071827.js", + "_echarts.common.75806e9f.js" ] }, "assets/js/pages/teams.js": { - "file": "assets/pages/teams.c7ab65c7.js", + "file": "assets/pages/teams.21a6b3f4.js", "src": "assets/js/pages/teams.js", "isEntry": true, "imports": [ @@ -116,19 +116,19 @@ ] }, "assets/js/pages/user.js": { - "file": "assets/pages/user.5945b8de.js", + "file": "assets/pages/user.977486ab.js", "src": "assets/js/pages/user.js", "isEntry": true, "imports": [ "assets/js/pages/main.js", - "_graphs.05e1bce6.js", - "_CommentBox.a3989c28.js", - "_visual.9577c47c.js", - "_echarts.common.3389571d.js" + "_graphs.f4a6130f.js", + "_CommentBox.d3cef9cd.js", + "_visual.cf071827.js", + "_echarts.common.75806e9f.js" ] }, "assets/js/pages/users.js": { - "file": "assets/pages/users.7b041154.js", + "file": "assets/pages/users.457072e5.js", "src": "assets/js/pages/users.js", "isEntry": true, "imports": [ @@ -138,14 +138,14 @@ "_echarts.7b83cee2.js": { "file": "assets/echarts.7b83cee2.js" }, - "_tab.75df1c33.js": { - "file": "assets/tab.75df1c33.js", + "_tab.12dd2b64.js": { + "file": "assets/tab.12dd2b64.js", "imports": [ "assets/js/pages/main.js" ] }, - "_CommentBox.59404a7b.js": { - "file": "assets/CommentBox.59404a7b.js", + "_CommentBox.d3cef9cd.js": { + "file": "assets/CommentBox.d3cef9cd.js", "imports": [ "assets/js/pages/main.js" ], @@ -153,39 +153,39 @@ "assets/CommentBox.23213b39.css" ] }, - "_htmlmixed.74384b30.js": { - "file": "assets/htmlmixed.74384b30.js", + "_htmlmixed.245897c1.js": { + "file": "assets/htmlmixed.245897c1.js", "imports": [ "assets/js/pages/main.js" ] }, - "_echarts.common.3f693a3c.js": { - "file": "assets/echarts.common.3f693a3c.js", + "_echarts.common.75806e9f.js": { + "file": "assets/echarts.common.75806e9f.js", "imports": [ "assets/js/pages/main.js" ] }, - "_visual.86b1c6a9.js": { - "file": "assets/visual.86b1c6a9.js", + "_visual.cf071827.js": { + "file": "assets/visual.cf071827.js", "imports": [ "assets/js/pages/main.js" ] }, - "_graphs.b7702e9a.js": { - "file": "assets/graphs.b7702e9a.js", + "_graphs.f4a6130f.js": { + "file": "assets/graphs.f4a6130f.js", "imports": [ "assets/js/pages/main.js", - "_echarts.common.3f693a3c.js" + "_echarts.common.75806e9f.js" ] }, - "assets/js/pages/challenge.css": { - "file": "assets/challenge.66ec3ebe.css", - "src": "assets/js/pages/challenge.css" - }, "CommentBox.css": { "file": "assets/CommentBox.23213b39.css", "src": "CommentBox.css" }, + "assets/js/pages/challenge.css": { + "file": "assets/challenge.66ec3ebe.css", + "src": "assets/js/pages/challenge.css" + }, "assets/css/challenge-board.scss": { "file": "assets/challenge-board.44e07e05.css", "src": "assets/css/challenge-board.scss", @@ -196,59 +196,19 @@ "src": "assets/css/admin.scss", "isEntry": true }, - "assets/css/codemirror.scss": { - "file": "assets/codemirror.d74a88bc.css", - "src": "assets/css/codemirror.scss", - "isEntry": true - }, "assets/css/fonts.scss": { "file": "assets/fonts.ffb05726.css", "src": "assets/css/fonts.scss", "isEntry": true }, + "assets/css/codemirror.scss": { + "file": "assets/codemirror.d74a88bc.css", + "src": "assets/css/codemirror.scss", + "isEntry": true + }, "assets/css/main.scss": { "file": "assets/main.088f55c6.css", "src": "assets/css/main.scss", "isEntry": true - }, - "_tab.c508b42d.js": { - "file": "assets/tab.c508b42d.js", - "imports": [ - "assets/js/pages/main.js" - ] - }, - "_CommentBox.a3989c28.js": { - "file": "assets/CommentBox.a3989c28.js", - "imports": [ - "assets/js/pages/main.js" - ], - "css": [ - "assets/CommentBox.23213b39.css" - ] - }, - "_htmlmixed.60cb33cf.js": { - "file": "assets/htmlmixed.60cb33cf.js", - "imports": [ - "assets/js/pages/main.js" - ] - }, - "_echarts.common.3389571d.js": { - "file": "assets/echarts.common.3389571d.js", - "imports": [ - "assets/js/pages/main.js" - ] - }, - "_visual.9577c47c.js": { - "file": "assets/visual.9577c47c.js", - "imports": [ - "assets/js/pages/main.js" - ] - }, - "_graphs.05e1bce6.js": { - "file": "assets/graphs.05e1bce6.js", - "imports": [ - "assets/js/pages/main.js", - "_echarts.common.3389571d.js" - ] } } \ No newline at end of file diff --git a/CTFd/themes/admin/templates/challenges/challenges.html b/CTFd/themes/admin/templates/challenges/challenges.html index 20b4f6cfb52567deb4cf3d1889ac9265f7c949e8..d13013674513bcd0df3b64035811ccd6384e1be5 100644 --- a/CTFd/themes/admin/templates/challenges/challenges.html +++ b/CTFd/themes/admin/templates/challenges/challenges.html @@ -73,9 +73,9 @@ </td> <th class="sort-col text-center"><b>ID</b></th> <th class="sort-col"><b>Nom</b></th> - <th class="sort-col"><b>Catégorie</b></th> + <th class="sort-col"><b>Type</b></th> <th class="sort-col"><b>Valeur</b></th> - <th class="sort-col text-center"><b>Type</b></th> + <th class="sort-col"><b>Catégorie</b></th> <th class="sort-col text-center"><b>État</b></th> <th class="sort-col text-center"><b>Miniature</b></th> </tr> @@ -99,9 +99,9 @@ </td> <td class="text-center id">{{ challenge.id }}</td> <td><a href="{{ url_for('admin.challenges_detail', challenge_id=challenge.id) }}">{{ challenge.name }}</a></td> + <td class="">{{ challenge.type }}</td> + <td class="">{{ challenge.value }}</td> <td>{{ challenge.category }}</td> - <td class="text-center">{{ challenge.value }}</td> - <td class="text-center">{{ challenge.type }}</td> <td class="text-center"> {% set badge_state = 'badge-danger' if challenge.state == 'hidden' else 'badge-success' %} <span class="badge {{ badge_state }}">{{ challenge.state }}</span> @@ -148,16 +148,6 @@ <td class="editable" data-editable="name"> <input class="form-text-input" name="name" required></input> </td> - <td class="d-block editable text-center" data-checkbox> - <select class="form-control custom-select" id="categories-selector" name="category"> - <!-- Existing categories will be dynamically added here by JavaScript --> - </select> - <input type="text" class="form-control mt-2" id="categories-selector-input" placeholder="Type new category" ></input> - <button class="btn btn-secondary" id="time-selector-input" hidden>Configurer une période</button> - </td> - <td class="editable text-center" data-editable="value"> - <input class="form-text-input" name="value" required></input> - </td> <td class="editable text-center" data-editable="type"> <select class="form-control custom-select" name="type" id="challenge-type"> <option value="manual" selected="">Manuel</option> @@ -167,6 +157,16 @@ </select> </td> + <td class="editable text-center" data-editable="value"> + <input class="form-text-input" name="value" required></input> + </td> + <td class="d-block editable" data-checkbox> + <select class="form-control custom-select" id="categories-selector" name="category"> + <!-- Existing categories will be dynamically added here by JavaScript --> + </select> + <input type="text" class="form-control mt-2" id="categories-selector-input" placeholder="Type new category" ></input> + <button class="btn btn-secondary" id="time-selector-input" hidden>Configurer une période</button> + </td> <td class="text-center" data-editable="visibility"> <select class="form-control custom-select" name="state"> <option value="visible" selected>Visible</option> diff --git a/CTFd/themes/admin/yarn.lock b/CTFd/themes/admin/yarn.lock index 45f37ae9d77180a095c10248de34e03f0f56e7ed..499eb78da36de8762d40275d56cdba302e4fa378 100644 --- a/CTFd/themes/admin/yarn.lock +++ b/CTFd/themes/admin/yarn.lock @@ -587,10 +587,10 @@ entities@^4.4.0: resolved "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz" integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw== -esbuild-windows-64@0.15.18: +esbuild-linux-64@0.15.18: version "0.15.18" - resolved "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.15.18.tgz" - integrity sha512-qinug1iTTaIIrCorAUjR0fcBk24fjzEedFYhhispP8Oc7SFvs+XeW3YpAKiKp8dRpizl4YYAhxMjlftAMJiaUw== + resolved "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.15.18.tgz" + integrity sha512-hNSeP97IviD7oxLKFuii5sDPJ+QHeiFTFLoLm7NZQligur8poNOWGIgpQ7Qf8Balb69hptMZzyOBIPtY09GZYw== esbuild@^0.15.9: version "0.15.18" diff --git a/CTFd/themes/core-beta/assets/js/utils/graphs/echarts/scoreboard.js b/CTFd/themes/core-beta/assets/js/utils/graphs/echarts/scoreboard.js index 398439d6b4638c32f7f98406814b26dec98563f7..ca8623cf180fc10cc30562c8c66e4ca2dc8d766a 100644 --- a/CTFd/themes/core-beta/assets/js/utils/graphs/echarts/scoreboard.js +++ b/CTFd/themes/core-beta/assets/js/utils/graphs/echarts/scoreboard.js @@ -112,8 +112,11 @@ export function getTenLast(places, standings, dictIdChallenge){ last10.push(solves[solved]); } } + for (let solved = 0; solved < fails.length; solved++) { + if (fails[solved]["type"] == "manual" || fails[solved]["type"] == "manualRecursive" || fails[solved]["type"] == "flash"){ + let challengeDate = fails[solved].date; fails[solved]["team_name"] = places[teams[i]].name; fails[solved]["user_name"] = dictIdNom[fails[solved]["user_id"]]; diff --git a/CTFd/themes/core-beta/package-lock.json b/CTFd/themes/core-beta/package-lock.json index 0459471b7dd45369c9bbae07efe7f2b15bf3860f..9b4709be62a8849e17697a994560fb8a54dff7f3 100644 --- a/CTFd/themes/core-beta/package-lock.json +++ b/CTFd/themes/core-beta/package-lock.json @@ -1604,6 +1604,7 @@ "resolved": "https://registry.npmjs.org/vite/-/vite-3.2.11.tgz", "integrity": "sha512-K/jGKL/PgbIgKCiJo5QbASQhFiV02X9Jh+Qq0AKCRCRKZtOTVi4t6wh75FDpGf2N9rYOnzH87OEFQNaFy6pdxQ==", "dev": true, + "license": "MIT", "dependencies": { "esbuild": "^0.15.9", "postcss": "^8.4.18", diff --git a/CTFd/themes/core-beta/static/assets/index.4d4ec5e6.js b/CTFd/themes/core-beta/static/assets/index.efd99572.js similarity index 100% rename from CTFd/themes/core-beta/static/assets/index.4d4ec5e6.js rename to CTFd/themes/core-beta/static/assets/index.efd99572.js diff --git a/CTFd/themes/core-beta/static/assets/scoreboard.197b27af.js b/CTFd/themes/core-beta/static/assets/scoreboard.fba51b64.js similarity index 99% rename from CTFd/themes/core-beta/static/assets/scoreboard.197b27af.js rename to CTFd/themes/core-beta/static/assets/scoreboard.fba51b64.js index 60a1f83d819754093a8ed81f08550f29408f6bca..6bfd18758124f51f3adbc2107399897212f20243 100644 --- a/CTFd/themes/core-beta/static/assets/scoreboard.197b27af.js +++ b/CTFd/themes/core-beta/static/assets/scoreboard.fba51b64.js @@ -1 +1 @@ -import{m as c,C as h}from"./index.5095421b.js";import{t as y,g as E}from"./index.4d4ec5e6.js";import"./echarts.54e741c1.js";import{e as C,h as x}from"./CommentBox.149dab43.js";window.Alpine=c;window.CTFd=h;window.ScoreboardDetail=0;window.standings=0;window.nbStandings=0;window.scoreboardListLoaded=!1;window.allImages=[];window.allSubmited=[];window.maxCount=0;window.maxCountIncrease=5;window.imageInit=!1;window.theninit=0;window.decalage=0;window.laoded=0;window.canShowMore=!0;window.splashPosition={1:[["-55px","0","-30px","0px"],["0px","-50px","50%","0px"],["","-50px","0px","0px"]],2:[["-50px","0px","35%","0"],["","-10px","60%","0px"],["-40px","","-35px","0px"]],3:[["-45px","0px","65%","0"],["","-30px","60%","0px"],["15%","","-35px","0px"]],4:[["-40px","0px","-10%","0"],["","-40px","60%","0"],["-40px","","-35px","0px"]],5:[["-40px","0px","-10%","0"],["","-30px","60%","0"],["","-30px","-25px","0px"]],6:[["-0px","0px","-30%","0"],["","40px","60%","0"],["","-30px","-30px","0px"]]};window.scoreboardSplashPosition={1:["95px","","","105px"],2:["110px","","","50px"],3:["85px","","-195px",""],4:["130px","","","190px"],5:["90px","","","290px"]};c.data("ScoreboardDetail",()=>({data:{},rankings:[],top:{},show:!0,async init(){window.standings=await h.pages.scoreboard.getScoreboard(),window.ScoreboardDetail=await h.pages.scoreboard.getScoreboardDetail(window.standings.length),document.getElementById("score-graph"),this.rankings=y(window.standings),this.top=this.rankings[0],this.show=window.standings.length>0}}));globalThis.loserSplash=function(t,e){if(t.value!="laoded"){if(t.parentElement.style.position="abosolute",window.standings.length-1==e)t.src="/themes/core/static/img/splash"+1+".png",t.parentElement.style.top="125px",t.parentElement.style.right="75%";else{t.src="/themes/core/static/img/splash"+(e%5+1)+".png";let a=window.scoreboardSplashPosition[e%5+1];t.parentElement.style.top=a[0],t.parentElement.style.left=a[2],t.parentElement.style.right=a[3]}t.value="laoded"}};c.data("ScoreboardList",()=>({standings:[],brackets:[],activeBracket:null,async init(){if(window.standings.length!=0){const e=await(await h.fetch(`/api/v1/brackets?type=${h.config.userMode}`,{method:"GET"})).json();this.brackets=e.data;const i=await(await h.fetch("/api/v1/challenges",{method:"GET"})).json();let s={};for(let n=0;n<i.data.length;n++)s[i.data[n].id]=i.data[n].name;if(window.ScoreboardDetail==0||window.standings==0)this.init();else{let n=E(window.ScoreboardDetail,window.standings,s);for(let l=0;l<n.length;l++)n[l].provided||(n[l].provided=n[l].date),this.standings[l]=n[l]}window.nbStandings=this.standings.length}}}));c.data("LogImage",()=>({async init(){let t=!1,e=0;try{e=JSON.parse(this.id)[0].id,window.allImages.push(e),window.allSubmited.push(e)}catch{t=!0;let i="";this.id=="M\xE9dia en traitement"&&(i="M\xE9dia en traitement"),e=i+"%"+String(Math.random()*1e17),window.allSubmited.push(e)}if(window.allSubmited.length>window.maxCount){let a=document.getElementById(this.id);(this.type=="manual"||this.type=="manualRecursive"||this.type=="flash")&&(a.className+=" inSubmission"),t||(a.text=this.challenge_id);try{a.id=e,a.hidden=!0}catch{this.id=e}}(window.allSubmited.length==window.maxCountIncrease||window.allSubmited.length==window.nbStandings)&&(window.imageInit||window.allSubmited.length!=0&&(window.imageInit=!0,self.showXMore()))}}));globalThis.showXMore=async function(t){let e=[];for(let n=window.maxCount;n<window.maxCount+window.maxCountIncrease;n++)try{if(n<window.allSubmited.length){if(!window.allSubmited[n].toString().includes("%"))e.push(window.allImages[n-window.decalage]);else{document.getElementById(window.allSubmited[n]).getElementsByClassName("header")[1].style.height="100px",document.getElementById(window.allSubmited[n]).getElementsByClassName("header")[1].style.width="186px";let l=(Math.random()>.5?-1:1)*(Math.random()*6);document.getElementById(window.allSubmited[n]).style.transform+="rotate("+l+"deg)";let d=document.getElementById(window.allSubmited[n]).getElementsByClassName("splash"),o=window.splashPosition[Math.floor(Math.random()*6)+1];for(let m=0;m<d.length;m++){let g=o[m],r=d[m];r.firstChild.style.top=g[0],r.firstChild.style.bottom=g[1],r.firstChild.style.left=g[2],r.firstChild.style.right=g[3],r.firstChild.src="/themes/core/static/img/splash"+(Math.floor(Math.random()*5)+1)+".png"}window.laoded+=1,window.decalage++}document.getElementById(window.allSubmited[n]).hidden=!1}}catch{}const i=await(await h.fetch("/api/v1/teams?ids="+JSON.stringify(e),{method:"GET"})).json();for(let n=0;n<window.maxCountIncrease;n++)try{if(n<e.length){let l=i.data[n].provided,d=document.getElementById(e[n]),o=!1;try{o=JSON.parse(l)}catch{}if(o){let m=!1,g=!1;for(let r=0;r<o.length;r++)o[r].type=="video/webm"&&(g=!0);for(let r=0;r<o.length;r++)if(o[r].type=="thumbsnail"){m=!0;let p=createMediaElement(o[r]);p.style["max-width"]="100%",p.style.display="block",p.style.height="auto",p.onload=function(w){stylingImage(w,o.length)},d.getElementsByClassName("imageContainer")[0].value!=!0&&(d.getElementsByClassName("imageContainer")[0].appendChild(p),console.log(p.className),d.getElementsByClassName("imageContainer")[0].value=!0),d.getElementsByClassName("imageContainer")[0].onclick=showLargeSubmissions,d.value=l}if(!m){let r=document.createElement("p");r.textContent="Aucune miniature trouv\xE9e pour ce m\xE9dia",d.getElementsByClassName("imageContainer")[0].appendChild(r)}}}}catch{}window.maxCount+=window.maxCountIncrease,(window.laoded==window.allSubmited.length||window.laoded==window.maxCount)&&drawLines(),window.allSubmited.length<=window.maxCount&&(document.getElementById("plus-btn").hidden=!0);let s=document.getElementsByClassName("award-icon");for(let n=0;n<s.length;n++)s[n].parentElement.getElementsByClassName("challenge_name")[0].textContent||(s[n].hidden=!1,s[n].parentElement.getElementsByClassName("challenge_name")[0].hidden=!0)};globalThis.stylingImage=function(t,e){const a=t.target;a.naturalWidth>a.naturalHeight?(a.classList.add("landscape"),a.parentElement.classList.add("landscape-td"),a.parentElement.parentElement.parentElement.classList.add("landscape-td")):(a.classList.add("portrait"),a.parentElement.classList.add("portrait-td"),a.parentElement.parentElement.parentElement.classList.add("portrait-td"));let i=(Math.random()>.5?-1:1)*(Math.random()*6);a.parentElement.parentElement.parentElement.style.transform+="rotate("+i+"deg)";let s=a.parentElement.parentElement.parentElement.getElementsByClassName("splash"),n=window.splashPosition[Math.floor(Math.random()*6)+1];for(let l=0;l<s.length;l++){let d=n[l],o=s[l];o.firstChild.style.top=d[0],o.firstChild.style.bottom=d[1],o.firstChild.style.left=d[2],o.firstChild.style.right=d[3],o.firstChild.src="/themes/core/static/img/splash"+(Math.floor(Math.random()*5)+1)+".png"}window.laoded+=1,(window.laoded==window.allSubmited.length||window.laoded==window.maxCount)&&drawLines(),a.className=="portrait",console.log()};globalThis.drawLines=function(){document.body.getBoundingClientRect();let t=window.maxCount-window.maxCountIncrease;for(let s=t==0?t:t-2;s<window.laoded-1;s++){var i=document.getElementsByClassName("lineCanvas")[s];i.hidden=!1;try{let l=document.getElementsByClassName("lineStart")[s],d=document.getElementsByClassName("lineStart")[s+1],o=l.getBoundingClientRect(),m=d.getBoundingClientRect();var i=document.getElementsByClassName("lineCanvas")[s];let r=i.parentElement.parentElement.parentElement.style.transform,p=parseFloat(r.split("rotate(")[1].split("deg")[0]);i.style.transform="rotate("+-p+"deg)",i.style.left=(m.left<o.left?m.left-o.left:0)+"px",console.log(d);let w=i.getBoundingClientRect();console.log(m.left),i.width=m.left-w.left+Math.abs(o.left-w.left)+l.offsetHeight/2,i.height=m.top-w.top+Math.abs(o.top-w.top)+l.offsetWidth/2;let u={x:o.left-w.left+l.offsetWidth/2,y:o.top-w.top+l.offsetHeight/2},f={x:m.left-w.left+(m.left<o.left?l.offsetWidth:0),y:m.top-w.top+d.offsetHeight/4};var e=i.getContext("2d"),a=e.createLinearGradient(u.x,u.y,f.x,i.height);a.addColorStop(0,l.value),a.addColorStop(1,d.value),e.setLineDash([40,20]),e.strokeStyle=a,e.beginPath(),e.lineWidth="7",e.moveTo(u.x,u.y),e.lineTo(f.x,f.y),e.stroke()}catch(l){i.style.width="0px",console.log(l)}}var i=document.getElementsByClassName("lineCanvas")[window.laoded-1];i.hidden=!0};globalThis.createMediaElement=function(t){let e;return t.type=="video/webm"?(e=document.createElement("video"),e.controls=!0,e.type="video/webm",e.poster=""):(t.type=="image/png"||t.type=="thumbsnail")&&(e=document.createElement("img"),e.type="image/png"),e.src="/files/"+t.location,e};globalThis.showLargeSubmissions=function(t){window.carouselPosition=0;let e,a;try{e=JSON.parse(t.srcElement.parentElement.parentElement.value),a=t.srcElement.parentElement.parentElement}catch{e=JSON.parse(t.srcElement.parentElement.parentElement.parentElement.value),a=t.srcElement.parentElement.parentElement.parentElement}console.log(e);let i=!1;window.carouselMax=e.length-1;let s="<section class='slider-wrapper'><ul class='slides-container list-unstyled' style:'list-style: none !important;' id='slides-container'>";for(let n=0;n<e.length;n++)if(e[n].type!="thumbsnail"){let l=createMediaElement(e[n]);l.style.width="100%",l.style.objectFit="contain",l.style.height="500px";let d=document.createElement("div");d.append(l),s+='<li class="slide '+(i?n-1:n)+'slide" style="min-height:50%">',s+=d.innerHTML,s+="</li>"}else i=!0;s+="</ul></section>",s+="<img src onerror='reloadCarousel(this.parentElement);'></img>",s+=`<button class='btn btn-primary carousel__navigation-button slide-arrow-prev' id='slide-arrow-prev' onclick='downCarousel(this)' style='display:block;position:absolute;top:40%;left:1rem;'><svg viewBox="0 0 100 100"><path d="M 50,0 L 60,10 L 20,50 L 60,90 L 50,100 L 0,50 Z" class="arrow" fill="white" transform="translate(15,0) rotate(0)"></path></svg></button>`,s+=`<button style='position:absolute;top:40%;right:1rem;' class='btn btn-primary carousel__navigation-button slide-arrow-next' id='slide-arrow-next' onclick='upCarousel(this)'><svg viewBox="0 0 100 100"><path d="M 50,0 L 60,10 L 20,50 L 60,90 L 50,100 L 0,50 Z" class="arrow" fill="white" transform="translate(85,100) rotate(180)"></path></svg></button>`,C({title:"Visioneurs",body:s,button:"retour",challenge_id:a.text,ids:a.id,additionalClassMain:"FullSizeCarousel"},x,h.user),document.getElementsByClassName("modal-dialog")[0].style.listStyle="none"};window.upCarousel=function(t){window.carouselPosition+=1,window.carouselPosition!=window.carouselMax-1?(window.reloadCarousel(t.parentElement),t.parentElement.getElementsByClassName("slide-arrow-prev")[0].hidden=!1):(window.reloadCarousel(t.parentElement),t.parentElement.getElementsByClassName("slide-arrow-next")[0].hidden=!0,t.parentElement.getElementsByClassName("slide-arrow-prev")[0].hidden=!1)};window.downCarousel=function(t){window.carouselPosition-=1,window.carouselPosition!=0?(window.reloadCarousel(t.parentElement),t.parentElement.getElementsByClassName("slide-arrow-next")[0].hidden=!1):(window.reloadCarousel(t.parentElement),t.parentElement.getElementsByClassName("slide-arrow-prev")[0].hiddend=!0,t.parentElement.getElementsByClassName("slide-arrow-next")[0].hidden=!1)};window.reloadCarousel=function(t){window.carouselPosition==0&&(t.getElementsByClassName("slide-arrow-prev")[0].hidden=!0),window.carouselMax==1&&(t.getElementsByClassName("slide-arrow-next")[0].hidden=!0);for(let e=0;e<window.carouselMax;e++)if(e==window.carouselPosition)t.getElementsByClassName(e+"slide")[0].hidden=!1;else{t.getElementsByClassName(e+"slide")[0].hidden=!0;let a=t.getElementsByClassName(e+"slide")[0].firstChild;a.nodeName=="VIDEO"&&a.pause()}};c.start(); +import{m as c,C as h}from"./index.5095421b.js";import{t as y,g as E}from"./index.efd99572.js";import"./echarts.54e741c1.js";import{e as C,h as x}from"./CommentBox.149dab43.js";window.Alpine=c;window.CTFd=h;window.ScoreboardDetail=0;window.standings=0;window.nbStandings=0;window.scoreboardListLoaded=!1;window.allImages=[];window.allSubmited=[];window.maxCount=0;window.maxCountIncrease=5;window.imageInit=!1;window.theninit=0;window.decalage=0;window.laoded=0;window.canShowMore=!0;window.splashPosition={1:[["-55px","0","-30px","0px"],["0px","-50px","50%","0px"],["","-50px","0px","0px"]],2:[["-50px","0px","35%","0"],["","-10px","60%","0px"],["-40px","","-35px","0px"]],3:[["-45px","0px","65%","0"],["","-30px","60%","0px"],["15%","","-35px","0px"]],4:[["-40px","0px","-10%","0"],["","-40px","60%","0"],["-40px","","-35px","0px"]],5:[["-40px","0px","-10%","0"],["","-30px","60%","0"],["","-30px","-25px","0px"]],6:[["-0px","0px","-30%","0"],["","40px","60%","0"],["","-30px","-30px","0px"]]};window.scoreboardSplashPosition={1:["95px","","","105px"],2:["110px","","","50px"],3:["85px","","-195px",""],4:["130px","","","190px"],5:["90px","","","290px"]};c.data("ScoreboardDetail",()=>({data:{},rankings:[],top:{},show:!0,async init(){window.standings=await h.pages.scoreboard.getScoreboard(),window.ScoreboardDetail=await h.pages.scoreboard.getScoreboardDetail(window.standings.length),document.getElementById("score-graph"),this.rankings=y(window.standings),this.top=this.rankings[0],this.show=window.standings.length>0}}));globalThis.loserSplash=function(t,e){if(t.value!="laoded"){if(t.parentElement.style.position="abosolute",window.standings.length-1==e)t.src="/themes/core/static/img/splash"+1+".png",t.parentElement.style.top="125px",t.parentElement.style.right="75%";else{t.src="/themes/core/static/img/splash"+(e%5+1)+".png";let a=window.scoreboardSplashPosition[e%5+1];t.parentElement.style.top=a[0],t.parentElement.style.left=a[2],t.parentElement.style.right=a[3]}t.value="laoded"}};c.data("ScoreboardList",()=>({standings:[],brackets:[],activeBracket:null,async init(){if(window.standings.length!=0){const e=await(await h.fetch(`/api/v1/brackets?type=${h.config.userMode}`,{method:"GET"})).json();this.brackets=e.data;const i=await(await h.fetch("/api/v1/challenges",{method:"GET"})).json();let s={};for(let n=0;n<i.data.length;n++)s[i.data[n].id]=i.data[n].name;if(window.ScoreboardDetail==0||window.standings==0)this.init();else{let n=E(window.ScoreboardDetail,window.standings,s);for(let l=0;l<n.length;l++)n[l].provided||(n[l].provided=n[l].date),this.standings[l]=n[l]}window.nbStandings=this.standings.length}}}));c.data("LogImage",()=>({async init(){let t=!1,e=0;try{e=JSON.parse(this.id)[0].id,window.allImages.push(e),window.allSubmited.push(e)}catch{t=!0;let i="";this.id=="M\xE9dia en traitement"&&(i="M\xE9dia en traitement"),e=i+"%"+String(Math.random()*1e17),window.allSubmited.push(e)}if(window.allSubmited.length>window.maxCount){let a=document.getElementById(this.id);(this.type=="manual"||this.type=="manualRecursive"||this.type=="flash")&&(a.className+=" inSubmission"),t||(a.text=this.challenge_id);try{a.id=e,a.hidden=!0}catch{this.id=e}}(window.allSubmited.length==window.maxCountIncrease||window.allSubmited.length==window.nbStandings)&&(window.imageInit||window.allSubmited.length!=0&&(window.imageInit=!0,self.showXMore()))}}));globalThis.showXMore=async function(t){let e=[];for(let n=window.maxCount;n<window.maxCount+window.maxCountIncrease;n++)try{if(n<window.allSubmited.length){if(!window.allSubmited[n].toString().includes("%"))e.push(window.allImages[n-window.decalage]);else{document.getElementById(window.allSubmited[n]).getElementsByClassName("header")[1].style.height="100px",document.getElementById(window.allSubmited[n]).getElementsByClassName("header")[1].style.width="186px";let l=(Math.random()>.5?-1:1)*(Math.random()*6);document.getElementById(window.allSubmited[n]).style.transform+="rotate("+l+"deg)";let d=document.getElementById(window.allSubmited[n]).getElementsByClassName("splash"),o=window.splashPosition[Math.floor(Math.random()*6)+1];for(let m=0;m<d.length;m++){let g=o[m],r=d[m];r.firstChild.style.top=g[0],r.firstChild.style.bottom=g[1],r.firstChild.style.left=g[2],r.firstChild.style.right=g[3],r.firstChild.src="/themes/core/static/img/splash"+(Math.floor(Math.random()*5)+1)+".png"}window.laoded+=1,window.decalage++}document.getElementById(window.allSubmited[n]).hidden=!1}}catch{}const i=await(await h.fetch("/api/v1/teams?ids="+JSON.stringify(e),{method:"GET"})).json();for(let n=0;n<window.maxCountIncrease;n++)try{if(n<e.length){let l=i.data[n].provided,d=document.getElementById(e[n]),o=!1;try{o=JSON.parse(l)}catch{}if(o){let m=!1,g=!1;for(let r=0;r<o.length;r++)o[r].type=="video/webm"&&(g=!0);for(let r=0;r<o.length;r++)if(o[r].type=="thumbsnail"){m=!0;let p=createMediaElement(o[r]);p.style["max-width"]="100%",p.style.display="block",p.style.height="auto",p.onload=function(w){stylingImage(w,o.length)},d.getElementsByClassName("imageContainer")[0].value!=!0&&(d.getElementsByClassName("imageContainer")[0].appendChild(p),console.log(p.className),d.getElementsByClassName("imageContainer")[0].value=!0),d.getElementsByClassName("imageContainer")[0].onclick=showLargeSubmissions,d.value=l}if(!m){let r=document.createElement("p");r.textContent="Aucune miniature trouv\xE9e pour ce m\xE9dia",d.getElementsByClassName("imageContainer")[0].appendChild(r)}}}}catch{}window.maxCount+=window.maxCountIncrease,(window.laoded==window.allSubmited.length||window.laoded==window.maxCount)&&drawLines(),window.allSubmited.length<=window.maxCount&&(document.getElementById("plus-btn").hidden=!0);let s=document.getElementsByClassName("award-icon");for(let n=0;n<s.length;n++)s[n].parentElement.getElementsByClassName("challenge_name")[0].textContent||(s[n].hidden=!1,s[n].parentElement.getElementsByClassName("challenge_name")[0].hidden=!0)};globalThis.stylingImage=function(t,e){const a=t.target;a.naturalWidth>a.naturalHeight?(a.classList.add("landscape"),a.parentElement.classList.add("landscape-td"),a.parentElement.parentElement.parentElement.classList.add("landscape-td")):(a.classList.add("portrait"),a.parentElement.classList.add("portrait-td"),a.parentElement.parentElement.parentElement.classList.add("portrait-td"));let i=(Math.random()>.5?-1:1)*(Math.random()*6);a.parentElement.parentElement.parentElement.style.transform+="rotate("+i+"deg)";let s=a.parentElement.parentElement.parentElement.getElementsByClassName("splash"),n=window.splashPosition[Math.floor(Math.random()*6)+1];for(let l=0;l<s.length;l++){let d=n[l],o=s[l];o.firstChild.style.top=d[0],o.firstChild.style.bottom=d[1],o.firstChild.style.left=d[2],o.firstChild.style.right=d[3],o.firstChild.src="/themes/core/static/img/splash"+(Math.floor(Math.random()*5)+1)+".png"}window.laoded+=1,(window.laoded==window.allSubmited.length||window.laoded==window.maxCount)&&drawLines(),a.className=="portrait",console.log()};globalThis.drawLines=function(){document.body.getBoundingClientRect();let t=window.maxCount-window.maxCountIncrease;for(let s=t==0?t:t-2;s<window.laoded-1;s++){var i=document.getElementsByClassName("lineCanvas")[s];i.hidden=!1;try{let l=document.getElementsByClassName("lineStart")[s],d=document.getElementsByClassName("lineStart")[s+1],o=l.getBoundingClientRect(),m=d.getBoundingClientRect();var i=document.getElementsByClassName("lineCanvas")[s];let r=i.parentElement.parentElement.parentElement.style.transform,p=parseFloat(r.split("rotate(")[1].split("deg")[0]);i.style.transform="rotate("+-p+"deg)",i.style.left=(m.left<o.left?m.left-o.left:0)+"px",console.log(d);let w=i.getBoundingClientRect();console.log(m.left),i.width=m.left-w.left+Math.abs(o.left-w.left)+l.offsetHeight/2,i.height=m.top-w.top+Math.abs(o.top-w.top)+l.offsetWidth/2;let u={x:o.left-w.left+l.offsetWidth/2,y:o.top-w.top+l.offsetHeight/2},f={x:m.left-w.left+(m.left<o.left?l.offsetWidth:0),y:m.top-w.top+d.offsetHeight/4};var e=i.getContext("2d"),a=e.createLinearGradient(u.x,u.y,f.x,i.height);a.addColorStop(0,l.value),a.addColorStop(1,d.value),e.setLineDash([40,20]),e.strokeStyle=a,e.beginPath(),e.lineWidth="7",e.moveTo(u.x,u.y),e.lineTo(f.x,f.y),e.stroke()}catch(l){i.style.width="0px",console.log(l)}}var i=document.getElementsByClassName("lineCanvas")[window.laoded-1];i.hidden=!0};globalThis.createMediaElement=function(t){let e;return t.type=="video/webm"?(e=document.createElement("video"),e.controls=!0,e.type="video/webm",e.poster=""):(t.type=="image/png"||t.type=="thumbsnail")&&(e=document.createElement("img"),e.type="image/png"),e.src="/files/"+t.location,e};globalThis.showLargeSubmissions=function(t){window.carouselPosition=0;let e,a;try{e=JSON.parse(t.srcElement.parentElement.parentElement.value),a=t.srcElement.parentElement.parentElement}catch{e=JSON.parse(t.srcElement.parentElement.parentElement.parentElement.value),a=t.srcElement.parentElement.parentElement.parentElement}console.log(e);let i=!1;window.carouselMax=e.length-1;let s="<section class='slider-wrapper'><ul class='slides-container list-unstyled' style:'list-style: none !important;' id='slides-container'>";for(let n=0;n<e.length;n++)if(e[n].type!="thumbsnail"){let l=createMediaElement(e[n]);l.style.width="100%",l.style.objectFit="contain",l.style.height="500px";let d=document.createElement("div");d.append(l),s+='<li class="slide '+(i?n-1:n)+'slide" style="min-height:50%">',s+=d.innerHTML,s+="</li>"}else i=!0;s+="</ul></section>",s+="<img src onerror='reloadCarousel(this.parentElement);'></img>",s+=`<button class='btn btn-primary carousel__navigation-button slide-arrow-prev' id='slide-arrow-prev' onclick='downCarousel(this)' style='display:block;position:absolute;top:40%;left:1rem;'><svg viewBox="0 0 100 100"><path d="M 50,0 L 60,10 L 20,50 L 60,90 L 50,100 L 0,50 Z" class="arrow" fill="white" transform="translate(15,0) rotate(0)"></path></svg></button>`,s+=`<button style='position:absolute;top:40%;right:1rem;' class='btn btn-primary carousel__navigation-button slide-arrow-next' id='slide-arrow-next' onclick='upCarousel(this)'><svg viewBox="0 0 100 100"><path d="M 50,0 L 60,10 L 20,50 L 60,90 L 50,100 L 0,50 Z" class="arrow" fill="white" transform="translate(85,100) rotate(180)"></path></svg></button>`,C({title:"Visioneurs",body:s,button:"retour",challenge_id:a.text,ids:a.id,additionalClassMain:"FullSizeCarousel"},x,h.user),document.getElementsByClassName("modal-dialog")[0].style.listStyle="none"};window.upCarousel=function(t){window.carouselPosition+=1,window.carouselPosition!=window.carouselMax-1?(window.reloadCarousel(t.parentElement),t.parentElement.getElementsByClassName("slide-arrow-prev")[0].hidden=!1):(window.reloadCarousel(t.parentElement),t.parentElement.getElementsByClassName("slide-arrow-next")[0].hidden=!0,t.parentElement.getElementsByClassName("slide-arrow-prev")[0].hidden=!1)};window.downCarousel=function(t){window.carouselPosition-=1,window.carouselPosition!=0?(window.reloadCarousel(t.parentElement),t.parentElement.getElementsByClassName("slide-arrow-next")[0].hidden=!1):(window.reloadCarousel(t.parentElement),t.parentElement.getElementsByClassName("slide-arrow-prev")[0].hiddend=!0,t.parentElement.getElementsByClassName("slide-arrow-next")[0].hidden=!1)};window.reloadCarousel=function(t){window.carouselPosition==0&&(t.getElementsByClassName("slide-arrow-prev")[0].hidden=!0),window.carouselMax==1&&(t.getElementsByClassName("slide-arrow-next")[0].hidden=!0);for(let e=0;e<window.carouselMax;e++)if(e==window.carouselPosition)t.getElementsByClassName(e+"slide")[0].hidden=!1;else{t.getElementsByClassName(e+"slide")[0].hidden=!0;let a=t.getElementsByClassName(e+"slide")[0].firstChild;a.nodeName=="VIDEO"&&a.pause()}};c.start(); diff --git a/CTFd/themes/core-beta/static/assets/teams_private.68ef4f19.js b/CTFd/themes/core-beta/static/assets/teams_private.ffadd374.js similarity index 98% rename from CTFd/themes/core-beta/static/assets/teams_private.68ef4f19.js rename to CTFd/themes/core-beta/static/assets/teams_private.ffadd374.js index 71dff9ef7104a28e1cf75cc0d4bec9151d17c6bc..bd876dbc6abc2e3ded31ac2c0c42f11dee64b938 100644 --- a/CTFd/themes/core-beta/static/assets/teams_private.68ef4f19.js +++ b/CTFd/themes/core-beta/static/assets/teams_private.ffadd374.js @@ -1 +1 @@ -import{m as i,C as o,M as m,f as h}from"./index.5095421b.js";import{s as c,c as p}from"./clipboard.cfb302a4.js";import{g as f}from"./userscore.a6ac6874.js";import{e as g}from"./index.4d4ec5e6.js";import{$ as n,a as u}from"./CommentBox.149dab43.js";import"./echarts.54e741c1.js";window.Alpine=i;window.CTFd=o;i.store("inviteToken","");i.data("TeamEditModal",()=>({success:null,error:null,initial:null,errors:[],init(){this.initial=c(this.$el.querySelector("form"))},async updateProfile(){let t=c(this.$el,this.initial,!0);t.fields=[];for(const a in t)if(a.match(/fields\[\d+\]/)){let s={},r=parseInt(a.slice(7,-1));s.field_id=r,s.value=t[a],t.fields.push(s),delete t[a]}let e=await o.pages.teams.updateTeamSettings(t);e.success?(this.success=!0,this.error=!1,setTimeout(()=>{this.success=null,this.error=null},3e3)):(this.success=!1,this.error=!0,Object.keys(e.errors).map(a=>{const s=e.errors[a];this.errors.push(s)}))}}));i.data("TeamCaptainModal",()=>({success:null,error:null,errors:[],async updateCaptain(){let t=c(this.$el,null,!0),e=await o.pages.teams.updateTeamSettings(t);e.success?window.location.reload():(this.success=!1,this.error=!0,Object.keys(e.errors).map(a=>{const s=e.errors[a];this.errors.push(s)}))}}));i.data("TeamInviteModal",()=>({copy(){p(this.$refs.link)}}));i.data("TeamDisbandModal",()=>({errors:[],async disbandTeam(){let t=await o.pages.teams.disbandTeam();t.success?window.location.reload():this.errors=t.errors[""]}}));i.data("CaptainMenu",()=>({captain:!1,editTeam(){this.teamEditModal=new m(document.getElementById("team-edit-modal")),this.teamEditModal.show()},chooseCaptain(){this.teamCaptainModal=new m(document.getElementById("team-captain-modal")),this.teamCaptainModal.show()},async inviteMembers(){const t=await o.pages.teams.getInviteToken();if(t.success){const e=t.data.code,a=`${window.location.origin}${o.config.urlRoot}/teams/invite?code=${e}`;document.querySelector("#team-invite-modal input[name=link]").value=a,this.$store.inviteToken=a,this.teamInviteModal=new m(document.getElementById("team-invite-modal")),this.teamInviteModal.show()}else Object.keys(t.errors).map(e=>{const a=t.errors[e];alert(a)})},disbandTeam(){this.teamDisbandModal=new m(document.getElementById("team-disband-modal")),this.teamDisbandModal.show()}}));i.data("TeamGraphs",()=>({solves:null,fails:null,awards:null,solveCount:0,failCount:0,awardCount:0,getSolvePercentage(){return(this.solveCount/(this.solveCount+this.failCount)*100).toFixed(2)},getFailPercentage(){return(this.failCount/(this.solveCount+this.failCount)*100).toFixed(2)},getCategoryBreakdown(){const t=[],e={};this.solves.data.map(s=>{t.push(s.challenge.category)}),t.forEach(s=>{s in e?e[s]+=1:e[s]=1});const a=[];for(const s in e)a.push({name:s,count:e[s],percent:e[s]/t.length*100,color:h(s)});return a},async init(){this.solves=await o.pages.teams.teamSolves("me"),this.solves.data[0].challenge.name="caca",console.log(this.solves),this.fails=await o.pages.teams.teamFails("me"),console.log(this.fails),this.awards=await o.pages.teams.teamAwards("me"),this.solveCount=this.solves.meta.count,this.failCount=this.fails.meta.count,this.awardCount=this.awards.meta.count,console.log(),g(this.$refs.scoregraph,f(o.team.id,o.team.name,this.solves.data,this.awards.data))}}));i.data("UserScore",()=>({members:[],async init(){const e=await(await o.fetch(`/api/v1/teams/${o.team.id}/members`,{method:"GET"})).json();console.log(e)}}));i.start();n(".delete-member").click(function(t){t.preventDefault();const e=n(this).attr("member-id"),a=n(this).attr("member-name"),s=n(this).attr("team-name"),r={user_id:e},l=n(this).parent().parent();u({title:"Retirer un membre",body:"<p> Es-tu s\xFBr de vouloir supprimer <strong>"+a+"</strong> de <strong>"+s+"</strong>? <p><br><br><strong> Tous leurs d\xE9fis r\xE9solus, tentatives, r\xE9compenses et indices d\xE9bloqu\xE9s seront \xE9galement supprim\xE9s !</strong>",success:function(){o.fetch("/api/v1/teams/"+o.team.id+"/members",{method:"DELETE",body:JSON.stringify(r)}).then(function(d){return d.json()}).then(function(d){d.success&&(l.remove(),window.location.reload())})}})});n(".delete-submission").click(function(t){t.preventDefault();const e=n(this).attr("submission-id"),a=n(this).attr("submission-name"),s={submission_id:e},r=n(this).parent().parent();u({title:"Retirer un membre",body:"<p> Es-tu s\xFBr de vouloir canceler <strong>"+a+"</strong>, id : <strong>"+e+"</strong>?",success:function(){o.fetch("/api/v1/submissions/"+e,{method:"DELETE",body:JSON.stringify(s)}).then(function(l){return l.json()}).then(function(l){l.success&&(r.remove(),window.location.reload())})}})}); +import{m as i,C as o,M as m,f as h}from"./index.5095421b.js";import{s as c,c as p}from"./clipboard.cfb302a4.js";import{g as f}from"./userscore.3592dc31.js";import{e as g}from"./index.efd99572.js";import{$ as n,a as u}from"./CommentBox.149dab43.js";import"./echarts.54e741c1.js";window.Alpine=i;window.CTFd=o;i.store("inviteToken","");i.data("TeamEditModal",()=>({success:null,error:null,initial:null,errors:[],init(){this.initial=c(this.$el.querySelector("form"))},async updateProfile(){let t=c(this.$el,this.initial,!0);t.fields=[];for(const a in t)if(a.match(/fields\[\d+\]/)){let s={},r=parseInt(a.slice(7,-1));s.field_id=r,s.value=t[a],t.fields.push(s),delete t[a]}let e=await o.pages.teams.updateTeamSettings(t);e.success?(this.success=!0,this.error=!1,setTimeout(()=>{this.success=null,this.error=null},3e3)):(this.success=!1,this.error=!0,Object.keys(e.errors).map(a=>{const s=e.errors[a];this.errors.push(s)}))}}));i.data("TeamCaptainModal",()=>({success:null,error:null,errors:[],async updateCaptain(){let t=c(this.$el,null,!0),e=await o.pages.teams.updateTeamSettings(t);e.success?window.location.reload():(this.success=!1,this.error=!0,Object.keys(e.errors).map(a=>{const s=e.errors[a];this.errors.push(s)}))}}));i.data("TeamInviteModal",()=>({copy(){p(this.$refs.link)}}));i.data("TeamDisbandModal",()=>({errors:[],async disbandTeam(){let t=await o.pages.teams.disbandTeam();t.success?window.location.reload():this.errors=t.errors[""]}}));i.data("CaptainMenu",()=>({captain:!1,editTeam(){this.teamEditModal=new m(document.getElementById("team-edit-modal")),this.teamEditModal.show()},chooseCaptain(){this.teamCaptainModal=new m(document.getElementById("team-captain-modal")),this.teamCaptainModal.show()},async inviteMembers(){const t=await o.pages.teams.getInviteToken();if(t.success){const e=t.data.code,a=`${window.location.origin}${o.config.urlRoot}/teams/invite?code=${e}`;document.querySelector("#team-invite-modal input[name=link]").value=a,this.$store.inviteToken=a,this.teamInviteModal=new m(document.getElementById("team-invite-modal")),this.teamInviteModal.show()}else Object.keys(t.errors).map(e=>{const a=t.errors[e];alert(a)})},disbandTeam(){this.teamDisbandModal=new m(document.getElementById("team-disband-modal")),this.teamDisbandModal.show()}}));i.data("TeamGraphs",()=>({solves:null,fails:null,awards:null,solveCount:0,failCount:0,awardCount:0,getSolvePercentage(){return(this.solveCount/(this.solveCount+this.failCount)*100).toFixed(2)},getFailPercentage(){return(this.failCount/(this.solveCount+this.failCount)*100).toFixed(2)},getCategoryBreakdown(){const t=[],e={};this.solves.data.map(s=>{t.push(s.challenge.category)}),t.forEach(s=>{s in e?e[s]+=1:e[s]=1});const a=[];for(const s in e)a.push({name:s,count:e[s],percent:e[s]/t.length*100,color:h(s)});return a},async init(){this.solves=await o.pages.teams.teamSolves("me"),this.solves.data[0].challenge.name="caca",console.log(this.solves),this.fails=await o.pages.teams.teamFails("me"),console.log(this.fails),this.awards=await o.pages.teams.teamAwards("me"),this.solveCount=this.solves.meta.count,this.failCount=this.fails.meta.count,this.awardCount=this.awards.meta.count,console.log(),g(this.$refs.scoregraph,f(o.team.id,o.team.name,this.solves.data,this.awards.data))}}));i.data("UserScore",()=>({members:[],async init(){const e=await(await o.fetch(`/api/v1/teams/${o.team.id}/members`,{method:"GET"})).json();console.log(e)}}));i.start();n(".delete-member").click(function(t){t.preventDefault();const e=n(this).attr("member-id"),a=n(this).attr("member-name"),s=n(this).attr("team-name"),r={user_id:e},l=n(this).parent().parent();u({title:"Retirer un membre",body:"<p> Es-tu s\xFBr de vouloir supprimer <strong>"+a+"</strong> de <strong>"+s+"</strong>? <p><br><br><strong> Tous leurs d\xE9fis r\xE9solus, tentatives, r\xE9compenses et indices d\xE9bloqu\xE9s seront \xE9galement supprim\xE9s !</strong>",success:function(){o.fetch("/api/v1/teams/"+o.team.id+"/members",{method:"DELETE",body:JSON.stringify(r)}).then(function(d){return d.json()}).then(function(d){d.success&&(l.remove(),window.location.reload())})}})});n(".delete-submission").click(function(t){t.preventDefault();const e=n(this).attr("submission-id"),a=n(this).attr("submission-name"),s={submission_id:e},r=n(this).parent().parent();u({title:"Retirer un membre",body:"<p> Es-tu s\xFBr de vouloir canceler <strong>"+a+"</strong>, id : <strong>"+e+"</strong>?",success:function(){o.fetch("/api/v1/submissions/"+e,{method:"DELETE",body:JSON.stringify(s)}).then(function(l){return l.json()}).then(function(l){l.success&&(r.remove(),window.location.reload())})}})}); diff --git a/CTFd/themes/core-beta/static/assets/teams_public.1168ca40.js b/CTFd/themes/core-beta/static/assets/teams_public.5d6aa845.js similarity index 88% rename from CTFd/themes/core-beta/static/assets/teams_public.1168ca40.js rename to CTFd/themes/core-beta/static/assets/teams_public.5d6aa845.js index a19e7404b685fc33567076eff2b994e93c720acf..2ec76a2e25d59dab88d09b412d2950b70ef8616d 100644 --- a/CTFd/themes/core-beta/static/assets/teams_public.1168ca40.js +++ b/CTFd/themes/core-beta/static/assets/teams_public.5d6aa845.js @@ -1 +1 @@ -import{m as o,f as n,C as e}from"./index.5095421b.js";import{g as l}from"./userscore.a6ac6874.js";import{e as r}from"./index.4d4ec5e6.js";import"./echarts.54e741c1.js";window.Alpine=o;o.data("TeamGraphs",()=>({solves:null,fails:null,awards:null,solveCount:0,failCount:0,awardCount:0,getSolvePercentage(){return(this.solveCount/(this.solveCount+this.failCount)*100).toFixed(2)},getFailPercentage(){return(this.failCount/(this.solveCount+this.failCount)*100).toFixed(2)},getCategoryBreakdown(){const s=[],a={};this.solves.data.map(t=>{s.push(t.challenge.category)}),s.forEach(t=>{t in a?a[t]+=1:a[t]=1});const i=[];for(const t in a)i.push({name:t,count:a[t],percent:(a[t]/s.length*100).toFixed(2),color:n(t)});return i},async init(){this.solves=await e.pages.teams.teamSolves(window.TEAM.id),this.fails=await e.pages.teams.teamFails(window.TEAM.id),this.awards=await e.pages.teams.teamAwards(window.TEAM.id),this.solveCount=this.solves.meta.count,this.failCount=this.fails.meta.count,this.awardCount=this.awards.meta.count,r(this.$refs.scoregraph,l(window.TEAM.id,window.TEAM.name,this.solves.data,this.awards.data))}}));o.start(); +import{m as o,f as n,C as e}from"./index.5095421b.js";import{g as l}from"./userscore.3592dc31.js";import{e as r}from"./index.efd99572.js";import"./echarts.54e741c1.js";window.Alpine=o;o.data("TeamGraphs",()=>({solves:null,fails:null,awards:null,solveCount:0,failCount:0,awardCount:0,getSolvePercentage(){return(this.solveCount/(this.solveCount+this.failCount)*100).toFixed(2)},getFailPercentage(){return(this.failCount/(this.solveCount+this.failCount)*100).toFixed(2)},getCategoryBreakdown(){const s=[],a={};this.solves.data.map(t=>{s.push(t.challenge.category)}),s.forEach(t=>{t in a?a[t]+=1:a[t]=1});const i=[];for(const t in a)i.push({name:t,count:a[t],percent:(a[t]/s.length*100).toFixed(2),color:n(t)});return i},async init(){this.solves=await e.pages.teams.teamSolves(window.TEAM.id),this.fails=await e.pages.teams.teamFails(window.TEAM.id),this.awards=await e.pages.teams.teamAwards(window.TEAM.id),this.solveCount=this.solves.meta.count,this.failCount=this.fails.meta.count,this.awardCount=this.awards.meta.count,r(this.$refs.scoregraph,l(window.TEAM.id,window.TEAM.name,this.solves.data,this.awards.data))}}));o.start(); diff --git a/CTFd/themes/core-beta/static/assets/users_private.edb4017d.js b/CTFd/themes/core-beta/static/assets/users_private.cb675ea1.js similarity index 88% rename from CTFd/themes/core-beta/static/assets/users_private.edb4017d.js rename to CTFd/themes/core-beta/static/assets/users_private.cb675ea1.js index 2512b1ed3df89aceff46a5a64831faefc49e9a14..b9b4174f0ffb7d5446492475a6d0ebddc62eef28 100644 --- a/CTFd/themes/core-beta/static/assets/users_private.edb4017d.js +++ b/CTFd/themes/core-beta/static/assets/users_private.cb675ea1.js @@ -1 +1 @@ -import{m as o,f as n,C as e}from"./index.5095421b.js";import{g as l}from"./userscore.a6ac6874.js";import{e as u}from"./index.4d4ec5e6.js";import"./echarts.54e741c1.js";window.Alpine=o;o.data("UserGraphs",()=>({solves:null,fails:null,awards:null,solveCount:0,failCount:0,awardCount:0,getSolvePercentage(){return(this.solveCount/(this.solveCount+this.failCount)*100).toFixed(2)},getFailPercentage(){return(this.failCount/(this.solveCount+this.failCount)*100).toFixed(2)},getCategoryBreakdown(){const a=[],t={};this.solves.data.map(s=>{a.push(s.challenge.category)}),a.forEach(s=>{s in t?t[s]+=1:t[s]=1});const i=[];for(const s in t){const r=Number(t[s]/a.length*100).toFixed(2);i.push({name:s,count:t[s],color:n(s),percent:r})}return i},async init(){this.solves=await e.pages.users.userSolves("me"),this.fails=await e.pages.users.userFails("me"),this.awards=await e.pages.users.userAwards("me"),this.solveCount=this.solves.meta.count,this.failCount=this.fails.meta.count,this.awardCount=this.awards.meta.count,u(this.$refs.scoregraph,l(e.user.id,e.user.name,this.solves.data,this.awards.data))}}));o.start(); +import{m as o,f as n,C as e}from"./index.5095421b.js";import{g as l}from"./userscore.3592dc31.js";import{e as u}from"./index.efd99572.js";import"./echarts.54e741c1.js";window.Alpine=o;o.data("UserGraphs",()=>({solves:null,fails:null,awards:null,solveCount:0,failCount:0,awardCount:0,getSolvePercentage(){return(this.solveCount/(this.solveCount+this.failCount)*100).toFixed(2)},getFailPercentage(){return(this.failCount/(this.solveCount+this.failCount)*100).toFixed(2)},getCategoryBreakdown(){const a=[],t={};this.solves.data.map(s=>{a.push(s.challenge.category)}),a.forEach(s=>{s in t?t[s]+=1:t[s]=1});const i=[];for(const s in t){const r=Number(t[s]/a.length*100).toFixed(2);i.push({name:s,count:t[s],color:n(s),percent:r})}return i},async init(){this.solves=await e.pages.users.userSolves("me"),this.fails=await e.pages.users.userFails("me"),this.awards=await e.pages.users.userAwards("me"),this.solveCount=this.solves.meta.count,this.failCount=this.fails.meta.count,this.awardCount=this.awards.meta.count,u(this.$refs.scoregraph,l(e.user.id,e.user.name,this.solves.data,this.awards.data))}}));o.start(); diff --git a/CTFd/themes/core-beta/static/assets/users_public.5fad4e55.js b/CTFd/themes/core-beta/static/assets/users_public.266a1b1d.js similarity index 88% rename from CTFd/themes/core-beta/static/assets/users_public.5fad4e55.js rename to CTFd/themes/core-beta/static/assets/users_public.266a1b1d.js index cf3b43a1dca87dd7425ac2ad2ebd33a6702f5144..dbf2dcbf5c2d26002c18d460636078d3e0dd8f91 100644 --- a/CTFd/themes/core-beta/static/assets/users_public.5fad4e55.js +++ b/CTFd/themes/core-beta/static/assets/users_public.266a1b1d.js @@ -1 +1 @@ -import{m as o,f as r,C as e}from"./index.5095421b.js";import{g as l}from"./userscore.a6ac6874.js";import{e as u}from"./index.4d4ec5e6.js";import"./echarts.54e741c1.js";window.Alpine=o;o.data("UserGraphs",()=>({solves:null,fails:null,awards:null,solveCount:0,failCount:0,awardCount:0,getSolvePercentage(){return(this.solveCount/(this.solveCount+this.failCount)*100).toFixed(2)},getFailPercentage(){return(this.failCount/(this.solveCount+this.failCount)*100).toFixed(2)},getCategoryBreakdown(){const a=[],t={};this.solves.data.map(s=>{a.push(s.challenge.category)}),a.forEach(s=>{s in t?t[s]+=1:t[s]=1});const i=[];for(const s in t){const n=Number(t[s]/a.length*100).toFixed(2);i.push({name:s,count:t[s],color:r(s),percent:n})}return i},async init(){this.solves=await e.pages.users.userSolves(window.USER.id),this.fails=await e.pages.users.userFails(window.USER.id),this.awards=await e.pages.users.userAwards(window.USER.id),this.solveCount=this.solves.meta.count,this.failCount=this.fails.meta.count,this.awardCount=this.awards.meta.count,u(this.$refs.scoregraph,l(window.USER.id,window.USER.name,this.solves.data,this.awards.data))}}));o.start(); +import{m as o,f as r,C as e}from"./index.5095421b.js";import{g as l}from"./userscore.3592dc31.js";import{e as u}from"./index.efd99572.js";import"./echarts.54e741c1.js";window.Alpine=o;o.data("UserGraphs",()=>({solves:null,fails:null,awards:null,solveCount:0,failCount:0,awardCount:0,getSolvePercentage(){return(this.solveCount/(this.solveCount+this.failCount)*100).toFixed(2)},getFailPercentage(){return(this.failCount/(this.solveCount+this.failCount)*100).toFixed(2)},getCategoryBreakdown(){const a=[],t={};this.solves.data.map(s=>{a.push(s.challenge.category)}),a.forEach(s=>{s in t?t[s]+=1:t[s]=1});const i=[];for(const s in t){const n=Number(t[s]/a.length*100).toFixed(2);i.push({name:s,count:t[s],color:r(s),percent:n})}return i},async init(){this.solves=await e.pages.users.userSolves(window.USER.id),this.fails=await e.pages.users.userFails(window.USER.id),this.awards=await e.pages.users.userAwards(window.USER.id),this.solveCount=this.solves.meta.count,this.failCount=this.fails.meta.count,this.awardCount=this.awards.meta.count,u(this.$refs.scoregraph,l(window.USER.id,window.USER.name,this.solves.data,this.awards.data))}}));o.start(); diff --git a/CTFd/themes/core-beta/static/assets/userscore.a6ac6874.js b/CTFd/themes/core-beta/static/assets/userscore.3592dc31.js similarity index 93% rename from CTFd/themes/core-beta/static/assets/userscore.a6ac6874.js rename to CTFd/themes/core-beta/static/assets/userscore.3592dc31.js index adb290cf9908b8a8b98611f027ca509f84f3c742..caf44da0b9d2ba954074ba2d177fa5415bd03f11 100644 --- a/CTFd/themes/core-beta/static/assets/userscore.a6ac6874.js +++ b/CTFd/themes/core-beta/static/assets/userscore.3592dc31.js @@ -1 +1 @@ -import{d as u,f as n}from"./index.5095421b.js";import{c as d}from"./index.4d4ec5e6.js";function m(s,o,c,p){let a={title:{left:"center",text:"Score au fil du temps"},tooltip:{trigger:"axis",axisPointer:{type:"cross"}},legend:{type:"scroll",orient:"horizontal",align:"left",bottom:0,data:[o]},toolbox:{feature:{saveAsImage:{}}},grid:{containLabel:!0},xAxis:[{type:"category",boundaryGap:!1,data:[],axisLabel:""}],yAxis:[{type:"value",axisLabel:""}],dataZoom:[{id:"dataZoomX",type:"slider",xAxisIndex:[0],filterMode:"filter",height:20,top:35,fillerColor:"rgba(233, 236, 241, 0.4)"}],series:[]};const i=[],r=[],e=c.concat(p);e.sort((t,l)=>new Date(t.date)-new Date(l.date));for(let t=0;t<e.length;t++){const l=u(e[t].date);i.push(l.toDate());try{r.push(e[t].challenge.value)}catch{r.push(e[t].value)}}return i.forEach(t=>{a.xAxis[0].data.push(t)}),a.series.push({name:o,type:"line",label:{normal:{show:!0,position:"top"}},areaStyle:{normal:{color:n(o+s)}},itemStyle:{normal:{color:n(o+s)}},data:d(r)}),a}export{m as g}; +import{d as u,f as n}from"./index.5095421b.js";import{c as d}from"./index.efd99572.js";function m(s,o,c,p){let a={title:{left:"center",text:"Score au fil du temps"},tooltip:{trigger:"axis",axisPointer:{type:"cross"}},legend:{type:"scroll",orient:"horizontal",align:"left",bottom:0,data:[o]},toolbox:{feature:{saveAsImage:{}}},grid:{containLabel:!0},xAxis:[{type:"category",boundaryGap:!1,data:[],axisLabel:""}],yAxis:[{type:"value",axisLabel:""}],dataZoom:[{id:"dataZoomX",type:"slider",xAxisIndex:[0],filterMode:"filter",height:20,top:35,fillerColor:"rgba(233, 236, 241, 0.4)"}],series:[]};const i=[],r=[],e=c.concat(p);e.sort((t,l)=>new Date(t.date)-new Date(l.date));for(let t=0;t<e.length;t++){const l=u(e[t].date);i.push(l.toDate());try{r.push(e[t].challenge.value)}catch{r.push(e[t].value)}}return i.forEach(t=>{a.xAxis[0].data.push(t)}),a.series.push({name:o,type:"line",label:{normal:{show:!0,position:"top"}},areaStyle:{normal:{color:n(o+s)}},itemStyle:{normal:{color:n(o+s)}},data:d(r)}),a}export{m as g}; diff --git a/CTFd/themes/core-beta/static/manifest.json b/CTFd/themes/core-beta/static/manifest.json index 414ef64e254b80923dfe5634d9a07926a384104b..65bedd71cf9e204528baab57dc2b00c577f1c6bd 100644 --- a/CTFd/themes/core-beta/static/manifest.json +++ b/CTFd/themes/core-beta/static/manifest.json @@ -39,12 +39,12 @@ ] }, "assets/js/scoreboard.js": { - "file": "assets/scoreboard.197b27af.js", + "file": "assets/scoreboard.fba51b64.js", "src": "assets/js/scoreboard.js", "isEntry": true, "imports": [ "assets/js/index.js", - "_index.4d4ec5e6.js", + "_index.efd99572.js", "_echarts.54e741c1.js", "_CommentBox.149dab43.js" ] @@ -58,25 +58,25 @@ ] }, "assets/js/teams/public.js": { - "file": "assets/teams_public.1168ca40.js", + "file": "assets/teams_public.5d6aa845.js", "src": "assets/js/teams/public.js", "isEntry": true, "imports": [ "assets/js/index.js", - "_userscore.a6ac6874.js", - "_index.4d4ec5e6.js", + "_userscore.3592dc31.js", + "_index.efd99572.js", "_echarts.54e741c1.js" ] }, "assets/js/teams/private.js": { - "file": "assets/teams_private.68ef4f19.js", + "file": "assets/teams_private.ffadd374.js", "src": "assets/js/teams/private.js", "isEntry": true, "imports": [ "assets/js/index.js", "_clipboard.cfb302a4.js", - "_userscore.a6ac6874.js", - "_index.4d4ec5e6.js", + "_userscore.3592dc31.js", + "_index.efd99572.js", "_CommentBox.149dab43.js", "_echarts.54e741c1.js" ] @@ -90,24 +90,24 @@ ] }, "assets/js/users/public.js": { - "file": "assets/users_public.5fad4e55.js", + "file": "assets/users_public.266a1b1d.js", "src": "assets/js/users/public.js", "isEntry": true, "imports": [ "assets/js/index.js", - "_userscore.a6ac6874.js", - "_index.4d4ec5e6.js", + "_userscore.3592dc31.js", + "_index.efd99572.js", "_echarts.54e741c1.js" ] }, "assets/js/users/private.js": { - "file": "assets/users_private.edb4017d.js", + "file": "assets/users_private.cb675ea1.js", "src": "assets/js/users/private.js", "isEntry": true, "imports": [ "assets/js/index.js", - "_userscore.a6ac6874.js", - "_index.4d4ec5e6.js", + "_userscore.3592dc31.js", + "_index.efd99572.js", "_echarts.54e741c1.js" ] }, @@ -137,18 +137,18 @@ "assets/CommentBox.533f8693.css" ] }, - "_index.4d4ec5e6.js": { - "file": "assets/index.4d4ec5e6.js", + "_index.efd549f2.js": { + "file": "assets/index.efd549f2.js", "imports": [ "assets/js/index.js", "_echarts.54e741c1.js" ] }, - "_userscore.a6ac6874.js": { - "file": "assets/userscore.a6ac6874.js", + "_userscore.b45ecd56.js": { + "file": "assets/userscore.b45ecd56.js", "imports": [ "assets/js/index.js", - "_index.4d4ec5e6.js" + "_index.efd549f2.js" ] }, "CommentBox.css": { @@ -159,5 +159,61 @@ "file": "assets/main.0920ac4d.css", "src": "assets/scss/main.scss", "isEntry": true + }, + "_index.d9fc81aa.js": { + "file": "assets/index.d9fc81aa.js", + "imports": [ + "assets/js/index.js", + "_echarts.54e741c1.js" + ] + }, + "_userscore.503e8201.js": { + "file": "assets/userscore.503e8201.js", + "imports": [ + "assets/js/index.js", + "_index.d9fc81aa.js" + ] + }, + "_index.148cec96.js": { + "file": "assets/index.148cec96.js", + "imports": [ + "assets/js/index.js", + "_echarts.54e741c1.js" + ] + }, + "_userscore.b6499138.js": { + "file": "assets/userscore.b6499138.js", + "imports": [ + "assets/js/index.js", + "_index.148cec96.js" + ] + }, + "_index.b5422178.js": { + "file": "assets/index.b5422178.js", + "imports": [ + "assets/js/index.js", + "_echarts.54e741c1.js" + ] + }, + "_userscore.64d976b0.js": { + "file": "assets/userscore.64d976b0.js", + "imports": [ + "assets/js/index.js", + "_index.b5422178.js" + ] + }, + "_index.efd99572.js": { + "file": "assets/index.efd99572.js", + "imports": [ + "assets/js/index.js", + "_echarts.54e741c1.js" + ] + }, + "_userscore.3592dc31.js": { + "file": "assets/userscore.3592dc31.js", + "imports": [ + "assets/js/index.js", + "_index.efd99572.js" + ] } } \ No newline at end of file diff --git a/CTFd/themes/core-beta/templates/challenges.html b/CTFd/themes/core-beta/templates/challenges.html index def06f23149f0e3269ad6cf54691b95871d6361d..ca423d25343b777c09f5c53c6891255854791276 100644 --- a/CTFd/themes/core-beta/templates/challenges.html +++ b/CTFd/themes/core-beta/templates/challenges.html @@ -182,7 +182,13 @@ <template x-if="c.tags.length"> <template x-for="(tag,i) in c.tags"> - <div class="challenge-tag time" :class="{'recursive-tag': tag.value == 'Récursif', 'flash-tag': tag.value == 'Flash time'}" x-text="`${tag.value}`" :id="c.endTime"></div> + <template x-if="tag.value == 'Flash'"> + <div class="challenge-tag time" x-text="`${tag.value}`" :id="c.endTime"></div> + </template> + <template x-if="tag.value != 'Flash'"> + <div class="challenge-tag" x-text="`${tag.value}`"></div> + </template> + </template> </template> </div> diff --git a/CTFd/themes/core-beta/yarn.lock b/CTFd/themes/core-beta/yarn.lock index c513b94104c5e80b29c980a57e66b5c0f53336ba..ace3a17fc6ca99ec7e2a736775ec881b72c21ba9 100644 --- a/CTFd/themes/core-beta/yarn.lock +++ b/CTFd/themes/core-beta/yarn.lock @@ -304,10 +304,10 @@ entities@^4.4.0, entities@^4.5.0: resolved "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz" integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw== -esbuild-windows-64@0.15.18: +esbuild-linux-64@0.15.18: version "0.15.18" - resolved "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.15.18.tgz" - integrity sha512-qinug1iTTaIIrCorAUjR0fcBk24fjzEedFYhhispP8Oc7SFvs+XeW3YpAKiKp8dRpizl4YYAhxMjlftAMJiaUw== + resolved "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.15.18.tgz" + integrity sha512-hNSeP97IviD7oxLKFuii5sDPJ+QHeiFTFLoLm7NZQligur8poNOWGIgpQ7Qf8Balb69hptMZzyOBIPtY09GZYw== esbuild@^0.15.9: version "0.15.18" diff --git a/CTFd/utils/config/__init__.py b/CTFd/utils/config/__init__.py index 12ab134fe6d85f90ceb430b62fd4de8f8f27ef00..3f0fb65894cc1e8d7d55dbe7b858b6d4d017b88f 100644 --- a/CTFd/utils/config/__init__.py +++ b/CTFd/utils/config/__init__.py @@ -34,7 +34,7 @@ def ctf_banner(): def ctf_theme(): theme = get_config("ctf_theme") - return theme if theme else "" + return theme if theme else "core-beta" def ctf_theme_candidates():