diff --git a/accounting/urls.py b/accounting/urls.py index 70eeb158..4ae59a1e 100644 --- a/accounting/urls.py +++ b/accounting/urls.py @@ -22,133 +22,127 @@ # # -from django.urls import re_path +from django.urls import path from accounting.views import * urlpatterns = [ # Accounting types - re_path( - r"^simple_type$", + path( + "simple_type/", SimplifiedAccountingTypeListView.as_view(), name="simple_type_list", ), - re_path( - r"^simple_type/create$", + path( + "simple_type/create/", SimplifiedAccountingTypeCreateView.as_view(), name="simple_type_new", ), - re_path( - r"^simple_type/(?P[0-9]+)/edit$", + path( + "simple_type//edit/", SimplifiedAccountingTypeEditView.as_view(), name="simple_type_edit", ), # Accounting types - re_path(r"^type$", AccountingTypeListView.as_view(), name="type_list"), - re_path(r"^type/create$", AccountingTypeCreateView.as_view(), name="type_new"), - re_path( - r"^type/(?P[0-9]+)/edit$", + path("type/", AccountingTypeListView.as_view(), name="type_list"), + path("type/create/", AccountingTypeCreateView.as_view(), name="type_new"), + path( + "type//edit/", AccountingTypeEditView.as_view(), name="type_edit", ), # Bank accounts - re_path(r"^$", BankAccountListView.as_view(), name="bank_list"), - re_path(r"^bank/create$", BankAccountCreateView.as_view(), name="bank_new"), - re_path( - r"^bank/(?P[0-9]+)$", + path("", BankAccountListView.as_view(), name="bank_list"), + path("bank/create", BankAccountCreateView.as_view(), name="bank_new"), + path( + "bank//", BankAccountDetailView.as_view(), name="bank_details", ), - re_path( - r"^bank/(?P[0-9]+)/edit$", + path( + "bank//edit/", BankAccountEditView.as_view(), name="bank_edit", ), - re_path( - r"^bank/(?P[0-9]+)/delete$", + path( + "bank//delete/", BankAccountDeleteView.as_view(), name="bank_delete", ), # Club accounts - re_path(r"^club/create$", ClubAccountCreateView.as_view(), name="club_new"), - re_path( - r"^club/(?P[0-9]+)$", + path("club/create/", ClubAccountCreateView.as_view(), name="club_new"), + path( + "club//", ClubAccountDetailView.as_view(), name="club_details", ), - re_path( - r"^club/(?P[0-9]+)/edit$", + path( + "club//edit/", ClubAccountEditView.as_view(), name="club_edit", ), - re_path( - r"^club/(?P[0-9]+)/delete$", + path( + "club//delete/", ClubAccountDeleteView.as_view(), name="club_delete", ), # Journals - re_path(r"^journal/create$", JournalCreateView.as_view(), name="journal_new"), - re_path( - r"^journal/(?P[0-9]+)$", + path("journal/create/", JournalCreateView.as_view(), name="journal_new"), + path( + "journal//", JournalDetailView.as_view(), name="journal_details", ), - re_path( - r"^journal/(?P[0-9]+)/edit$", + path( + "journal//edit/", JournalEditView.as_view(), name="journal_edit", ), - re_path( - r"^journal/(?P[0-9]+)/delete$", + path( + "journal//delete/", JournalDeleteView.as_view(), name="journal_delete", ), - re_path( - r"^journal/(?P[0-9]+)/statement/nature$", + path( + "journal//statement/nature/", JournalNatureStatementView.as_view(), name="journal_nature_statement", ), - re_path( - r"^journal/(?P[0-9]+)/statement/person$", + path( + "journal//statement/person/", JournalPersonStatementView.as_view(), name="journal_person_statement", ), - re_path( - r"^journal/(?P[0-9]+)/statement/accounting$", + path( + "journal//statement/accounting/", JournalAccountingStatementView.as_view(), name="journal_accounting_statement", ), # Operations - re_path( - r"^operation/create/(?P[0-9]+)$", + path( + "operation/create//", OperationCreateView.as_view(), name="op_new", ), - re_path( - r"^operation/(?P[0-9]+)$", OperationEditView.as_view(), name="op_edit" - ), - re_path( - r"^operation/(?P[0-9]+)/pdf$", OperationPDFView.as_view(), name="op_pdf" - ), + path("operation//", OperationEditView.as_view(), name="op_edit"), + path("operation//pdf/", OperationPDFView.as_view(), name="op_pdf"), # Companies - re_path(r"^company/list$", CompanyListView.as_view(), name="co_list"), - re_path(r"^company/create$", CompanyCreateView.as_view(), name="co_new"), - re_path(r"^company/(?P[0-9]+)$", CompanyEditView.as_view(), name="co_edit"), + path("company/list/", CompanyListView.as_view(), name="co_list"), + path("company/create/", CompanyCreateView.as_view(), name="co_new"), + path("company//", CompanyEditView.as_view(), name="co_edit"), # Labels - re_path(r"^label/new$", LabelCreateView.as_view(), name="label_new"), - re_path( - r"^label/(?P[0-9]+)$", + path("label/new/", LabelCreateView.as_view(), name="label_new"), + path( + "label//", LabelListView.as_view(), name="label_list", ), - re_path( - r"^label/(?P[0-9]+)/edit$", LabelEditView.as_view(), name="label_edit" - ), - re_path( - r"^label/(?P[0-9]+)/delete$", + path("label//edit/", LabelEditView.as_view(), name="label_edit"), + path( + "label//delete/", LabelDeleteView.as_view(), name="label_delete", ), # User account - re_path(r"^refound/account$", RefoundAccountView.as_view(), name="refound_account"), + path("refound/account/", RefoundAccountView.as_view(), name="refound_account"), ] diff --git a/club/urls.py b/club/urls.py index ed08472f..d33a5167 100644 --- a/club/urls.py +++ b/club/urls.py @@ -23,94 +23,84 @@ # # -from django.urls import re_path +from django.urls import path from club.views import * urlpatterns = [ - re_path(r"^$", ClubListView.as_view(), name="club_list"), - re_path(r"^new$", ClubCreateView.as_view(), name="club_new"), - re_path(r"^stats$", ClubStatView.as_view(), name="club_stats"), - re_path(r"^(?P[0-9]+)/$", ClubView.as_view(), name="club_view"), - re_path( - r"^(?P[0-9]+)/rev/(?P[0-9]+)/$", + path("", ClubListView.as_view(), name="club_list"), + path("new/", ClubCreateView.as_view(), name="club_new"), + path("stats/", ClubStatView.as_view(), name="club_stats"), + path("/", ClubView.as_view(), name="club_view"), + path( + "/rev//", ClubRevView.as_view(), name="club_view_rev", ), - re_path( - r"^(?P[0-9]+)/hist$", ClubPageHistView.as_view(), name="club_hist" - ), - re_path(r"^(?P[0-9]+)/edit$", ClubEditView.as_view(), name="club_edit"), - re_path( - r"^(?P[0-9]+)/edit/page$", + path("/hist/", ClubPageHistView.as_view(), name="club_hist"), + path("/edit/", ClubEditView.as_view(), name="club_edit"), + path( + "/edit/page/", ClubPageEditView.as_view(), name="club_edit_page", ), - re_path( - r"^(?P[0-9]+)/members$", ClubMembersView.as_view(), name="club_members" - ), - re_path( - r"^(?P[0-9]+)/elderlies$", + path("/members/", ClubMembersView.as_view(), name="club_members"), + path( + "/elderlies/", ClubOldMembersView.as_view(), name="club_old_members", ), - re_path( - r"^(?P[0-9]+)/sellings$", + path( + "/sellings/", ClubSellingView.as_view(), name="club_sellings", ), - re_path( - r"^(?P[0-9]+)/sellings/csv$", + path( + "/sellings/csv/", ClubSellingCSVView.as_view(), name="sellings_csv", ), - re_path( - r"^(?P[0-9]+)/prop$", ClubEditPropView.as_view(), name="club_prop" - ), - re_path(r"^(?P[0-9]+)/tools$", ClubToolsView.as_view(), name="tools"), - re_path( - r"^(?P[0-9]+)/mailing$", ClubMailingView.as_view(), name="mailing" - ), - re_path( - r"^(?P[0-9]+)/mailing/generate$", + path("/prop/", ClubEditPropView.as_view(), name="club_prop"), + path("/tools/", ClubToolsView.as_view(), name="tools"), + path("/mailing/", ClubMailingView.as_view(), name="mailing"), + path( + "/mailing/generate/", MailingAutoGenerationView.as_view(), name="mailing_generate", ), - re_path( - r"^(?P[0-9]+)/mailing/delete$", + path( + "/mailing/delete/", MailingDeleteView.as_view(), name="mailing_delete", ), - re_path( - r"^(?P[0-9]+)/mailing/delete/subscription$", + path( + "/mailing/delete/subscription/", MailingSubscriptionDeleteView.as_view(), name="mailing_subscription_delete", ), - re_path( - r"^membership/(?P[0-9]+)/set_old$", + path( + "membership//set_old/", MembershipSetOldView.as_view(), name="membership_set_old", ), - re_path( - r"^membership/(?P[0-9]+)/delete$", + path( + "membership//delete/", MembershipDeleteView.as_view(), name="membership_delete", ), - re_path( - r"^(?P[0-9]+)/poster$", PosterListView.as_view(), name="poster_list" - ), - re_path( - r"^(?P[0-9]+)/poster/create$", + path("/poster/", PosterListView.as_view(), name="poster_list"), + path( + "/poster/create/", PosterCreateView.as_view(), name="poster_create", ), - re_path( - r"^(?P[0-9]+)/poster/(?P[0-9]+)/edit$", + path( + "/poster//edit/", PosterEditView.as_view(), name="poster_edit", ), - re_path( - r"^(?P[0-9]+)/poster/(?P[0-9]+)/delete$", + path( + "/poster//delete/", PosterDeleteView.as_view(), name="poster_delete", ), diff --git a/com/urls.py b/com/urls.py index 6128d1d4..433ec3b3 100644 --- a/com/urls.py +++ b/com/urls.py @@ -22,104 +22,98 @@ # # -from django.urls import re_path +from django.urls import path -from com.views import * from club.views import MailingDeleteView +from com.views import * urlpatterns = [ - re_path(r"^sith/edit/alert$", AlertMsgEditView.as_view(), name="alert_edit"), - re_path(r"^sith/edit/info$", InfoMsgEditView.as_view(), name="info_edit"), - re_path( - r"^sith/edit/weekmail_destinations$", + path("sith/edit/alert/", AlertMsgEditView.as_view(), name="alert_edit"), + path("sith/edit/info/", InfoMsgEditView.as_view(), name="info_edit"), + path( + "sith/edit/weekmail_destinations/", WeekmailDestinationEditView.as_view(), name="weekmail_destinations", ), - re_path(r"^weekmail$", WeekmailEditView.as_view(), name="weekmail"), - re_path( - r"^weekmail/preview$", WeekmailPreviewView.as_view(), name="weekmail_preview" - ), - re_path( - r"^weekmail/new_article$", + path("weekmail/", WeekmailEditView.as_view(), name="weekmail"), + path("weekmail/preview/", WeekmailPreviewView.as_view(), name="weekmail_preview"), + path( + "weekmail/new_article/", WeekmailArticleCreateView.as_view(), name="weekmail_article", ), - re_path( - r"^weekmail/article/(?P[0-9]+)/delete$", + path( + "weekmail/article//delete/", WeekmailArticleDeleteView.as_view(), name="weekmail_article_delete", ), - re_path( - r"^weekmail/article/(?P[0-9]+)/edit$", + path( + "weekmail/article//edit/", WeekmailArticleEditView.as_view(), name="weekmail_article_edit", ), - re_path(r"^news$", NewsListView.as_view(), name="news_list"), - re_path(r"^news/admin$", NewsAdminListView.as_view(), name="news_admin_list"), - re_path(r"^news/create$", NewsCreateView.as_view(), name="news_new"), - re_path( - r"^news/(?P[0-9]+)/delete$", + path("news/", NewsListView.as_view(), name="news_list"), + path("news/admin/", NewsAdminListView.as_view(), name="news_admin_list"), + path("news/create/", NewsCreateView.as_view(), name="news_new"), + path( + "news//delete/", NewsDeleteView.as_view(), name="news_delete", ), - re_path( - r"^news/(?P[0-9]+)/moderate$", + path( + "news//moderate/", NewsModerateView.as_view(), name="news_moderate", ), - re_path( - r"^news/(?P[0-9]+)/edit$", NewsEditView.as_view(), name="news_edit" - ), - re_path( - r"^news/(?P[0-9]+)$", NewsDetailView.as_view(), name="news_detail" - ), - re_path(r"^mailings$", MailingListAdminView.as_view(), name="mailing_admin"), - re_path( - r"^mailings/(?P[0-9]+)/moderate$", + path("news//edit/", NewsEditView.as_view(), name="news_edit"), + path("news//", NewsDetailView.as_view(), name="news_detail"), + path("mailings/", MailingListAdminView.as_view(), name="mailing_admin"), + path( + "mailings//moderate/", MailingModerateView.as_view(), name="mailing_moderate", ), - re_path( - r"^mailings/(?P[0-9]+)/delete$", + path( + "mailings//delete/", MailingDeleteView.as_view(redirect_page="com:mailing_admin"), name="mailing_delete", ), - re_path(r"^poster$", PosterListView.as_view(), name="poster_list"), - re_path(r"^poster/create$", PosterCreateView.as_view(), name="poster_create"), - re_path( - r"^poster/(?P[0-9]+)/edit$", + path("poster/", PosterListView.as_view(), name="poster_list"), + path("poster/create/", PosterCreateView.as_view(), name="poster_create"), + path( + "poster//edit/", PosterEditView.as_view(), name="poster_edit", ), - re_path( - r"^poster/(?P[0-9]+)/delete$", + path( + "poster//delete/", PosterDeleteView.as_view(), name="poster_delete", ), - re_path( - r"^poster/moderate$", + path( + "poster/moderate/", PosterModerateListView.as_view(), name="poster_moderate_list", ), - re_path( - r"^poster/(?P[0-9]+)/moderate$", + path( + "poster//moderate/", PosterModerateView.as_view(), name="poster_moderate", ), - re_path(r"^screen$", ScreenListView.as_view(), name="screen_list"), - re_path(r"^screen/create$", ScreenCreateView.as_view(), name="screen_create"), - re_path( - r"^screen/(?P[0-9]+)/slideshow$", + path("screen/", ScreenListView.as_view(), name="screen_list"), + path("screen/create/", ScreenCreateView.as_view(), name="screen_create"), + path( + "screen//slideshow/", ScreenSlideshowView.as_view(), name="screen_slideshow", ), - re_path( - r"^screen/(?P[0-9]+)/edit$", + path( + "screen//edit/", ScreenEditView.as_view(), name="screen_edit", ), - re_path( - r"^screen/(?P[0-9]+)/delete$", + path( + "screen//delete/", ScreenDeleteView.as_view(), name="screen_delete", ), diff --git a/core/converters.py b/core/converters.py new file mode 100644 index 00000000..cb7bc95b --- /dev/null +++ b/core/converters.py @@ -0,0 +1,35 @@ +from core.models import Page + + +class FourDigitYearConverter: + regex = "[0-9]{4}" + + def to_python(self, value): + return int(value) + + def to_url(self, value): + return str(value).zfill(4) + + +class TwoDigitMonthConverter: + regex = "[0-9]{2}" + + def to_python(self, value): + return int(value) + + def to_url(self, value): + return str(value).zfill(2) + + +class BooleanStringConverter: + """ + Converter whose regex match either True or False + """ + + regex = r"(True)|(False)" + + def to_python(self, value): + return str(value) == "True" + + def to_url(self, value): + return str(value) diff --git a/core/static/core/js/vue.global.prod.js b/core/static/core/js/vue.global.prod.js deleted file mode 100644 index cc65afcd..00000000 --- a/core/static/core/js/vue.global.prod.js +++ /dev/null @@ -1 +0,0 @@ -var Vue=function(e){"use strict";function t(e,t){const n=Object.create(null),o=e.split(",");for(let r=0;r!!n[e.toLowerCase()]:e=>!!n[e]}const n=t("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt"),o=t("itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly");function r(e){return!!e||""===e}function s(e){if(N(e)){const t={};for(let n=0;n{if(e){const n=e.split(l);n.length>1&&(t[n[0].trim()]=n[1].trim())}})),t}function a(e){let t="";if(A(e))t=e;else if(N(e))for(let n=0;nd(e,t)))}const m=(e,t)=>t&&t.__v_isRef?m(e,t.value):E(t)?{[`Map(${t.size})`]:[...t.entries()].reduce(((e,[t,n])=>(e[`${t} =>`]=n,e)),{})}:$(t)?{[`Set(${t.size})`]:[...t.values()]}:!M(t)||N(t)||B(t)?t:String(t),g={},v=[],y=()=>{},b=()=>!1,_=/^on[^a-z]/,S=e=>_.test(e),x=e=>e.startsWith("onUpdate:"),C=Object.assign,w=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},k=Object.prototype.hasOwnProperty,T=(e,t)=>k.call(e,t),N=Array.isArray,E=e=>"[object Map]"===I(e),$=e=>"[object Set]"===I(e),R=e=>e instanceof Date,O=e=>"function"==typeof e,A=e=>"string"==typeof e,F=e=>"symbol"==typeof e,M=e=>null!==e&&"object"==typeof e,P=e=>M(e)&&O(e.then)&&O(e.catch),V=Object.prototype.toString,I=e=>V.call(e),B=e=>"[object Object]"===I(e),L=e=>A(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,j=t(",key,ref,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),U=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},H=/-(\w)/g,D=U((e=>e.replace(H,((e,t)=>t?t.toUpperCase():"")))),W=/\B([A-Z])/g,z=U((e=>e.replace(W,"-$1").toLowerCase())),K=U((e=>e.charAt(0).toUpperCase()+e.slice(1))),G=U((e=>e?`on${K(e)}`:"")),q=(e,t)=>!Object.is(e,t),J=(e,t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})},Y=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let Q;let X;const ee=[];class te{constructor(e=!1){this.active=!0,this.effects=[],this.cleanups=[],!e&&X&&(this.parent=X,this.index=(X.scopes||(X.scopes=[])).push(this)-1)}run(e){if(this.active)try{return this.on(),e()}finally{this.off()}}on(){this.active&&(ee.push(this),X=this)}off(){this.active&&(ee.pop(),X=ee[ee.length-1])}stop(e){if(this.active){if(this.effects.forEach((e=>e.stop())),this.cleanups.forEach((e=>e())),this.scopes&&this.scopes.forEach((e=>e.stop(!0))),this.parent&&!e){const e=this.parent.scopes.pop();e&&e!==this&&(this.parent.scopes[this.index]=e,e.index=this.index)}this.active=!1}}}function ne(e,t){(t=t||X)&&t.active&&t.effects.push(e)}const oe=e=>{const t=new Set(e);return t.w=0,t.n=0,t},re=e=>(e.w&ce)>0,se=e=>(e.n&ce)>0,ie=new WeakMap;let le=0,ce=1;const ae=[];let ue;const pe=Symbol(""),fe=Symbol("");class de{constructor(e,t=null,n){this.fn=e,this.scheduler=t,this.active=!0,this.deps=[],ne(this,n)}run(){if(!this.active)return this.fn();if(!ae.includes(this))try{return ae.push(ue=this),ge.push(me),me=!0,ce=1<<++le,le<=30?(({deps:e})=>{if(e.length)for(let t=0;t{const{deps:t}=e;if(t.length){let n=0;for(let o=0;o0?ae[e-1]:void 0}}stop(){this.active&&(he(this),this.onStop&&this.onStop(),this.active=!1)}}function he(e){const{deps:t}=e;if(t.length){for(let n=0;n{("length"===t||t>=o)&&l.push(e)}));else switch(void 0!==n&&l.push(i.get(n)),t){case"add":N(e)?L(n)&&l.push(i.get("length")):(l.push(i.get(pe)),E(e)&&l.push(i.get(fe)));break;case"delete":N(e)||(l.push(i.get(pe)),E(e)&&l.push(i.get(fe)));break;case"set":E(e)&&l.push(i.get(pe))}if(1===l.length)l[0]&&Ce(l[0]);else{const e=[];for(const t of l)t&&e.push(...t);Ce(oe(e))}}function Ce(e,t){for(const n of N(e)?e:[...e])(n!==ue||n.allowRecurse)&&(n.scheduler?n.scheduler():n.run())}const we=t("__proto__,__v_isRef,__isVue"),ke=new Set(Object.getOwnPropertyNames(Symbol).map((e=>Symbol[e])).filter(F)),Te=Ae(),Ne=Ae(!1,!0),Ee=Ae(!0),$e=Ae(!0,!0),Re=Oe();function Oe(){const e={};return["includes","indexOf","lastIndexOf"].forEach((t=>{e[t]=function(...e){const n=yt(this);for(let t=0,r=this.length;t{e[t]=function(...e){ve();const n=yt(this)[t].apply(this,e);return ye(),n}})),e}function Ae(e=!1,t=!1){return function(n,o,r){if("__v_isReactive"===o)return!e;if("__v_isReadonly"===o)return e;if("__v_raw"===o&&r===(e?t?at:ct:t?lt:it).get(n))return n;const s=N(n);if(!e&&s&&T(Re,o))return Reflect.get(Re,o,r);const i=Reflect.get(n,o,r);if(F(o)?ke.has(o):we(o))return i;if(e||be(n,0,o),t)return i;if(wt(i)){return!s||!L(o)?i.value:i}return M(i)?e?dt(i):pt(i):i}}function Fe(e=!1){return function(t,n,o,r){let s=t[n];if(!e&&(o=yt(o),s=yt(s),!N(t)&&wt(s)&&!wt(o)))return s.value=o,!0;const i=N(t)&&L(n)?Number(n)!0,deleteProperty:(e,t)=>!0},Ve=C({},Me,{get:Ne,set:Fe(!0)}),Ie=C({},Pe,{get:$e}),Be=e=>e,Le=e=>Reflect.getPrototypeOf(e);function je(e,t,n=!1,o=!1){const r=yt(e=e.__v_raw),s=yt(t);t!==s&&!n&&be(r,0,t),!n&&be(r,0,s);const{has:i}=Le(r),l=o?Be:n?St:_t;return i.call(r,t)?l(e.get(t)):i.call(r,s)?l(e.get(s)):void(e!==r&&e.get(t))}function Ue(e,t=!1){const n=this.__v_raw,o=yt(n),r=yt(e);return e!==r&&!t&&be(o,0,e),!t&&be(o,0,r),e===r?n.has(e):n.has(e)||n.has(r)}function He(e,t=!1){return e=e.__v_raw,!t&&be(yt(e),0,pe),Reflect.get(e,"size",e)}function De(e){e=yt(e);const t=yt(this);return Le(t).has.call(t,e)||(t.add(e),xe(t,"add",e,e)),this}function We(e,t){t=yt(t);const n=yt(this),{has:o,get:r}=Le(n);let s=o.call(n,e);s||(e=yt(e),s=o.call(n,e));const i=r.call(n,e);return n.set(e,t),s?q(t,i)&&xe(n,"set",e,t):xe(n,"add",e,t),this}function ze(e){const t=yt(this),{has:n,get:o}=Le(t);let r=n.call(t,e);r||(e=yt(e),r=n.call(t,e)),o&&o.call(t,e);const s=t.delete(e);return r&&xe(t,"delete",e,void 0),s}function Ke(){const e=yt(this),t=0!==e.size,n=e.clear();return t&&xe(e,"clear",void 0,void 0),n}function Ge(e,t){return function(n,o){const r=this,s=r.__v_raw,i=yt(s),l=t?Be:e?St:_t;return!e&&be(i,0,pe),s.forEach(((e,t)=>n.call(o,l(e),l(t),r)))}}function qe(e,t,n){return function(...o){const r=this.__v_raw,s=yt(r),i=E(s),l="entries"===e||e===Symbol.iterator&&i,c="keys"===e&&i,a=r[e](...o),u=n?Be:t?St:_t;return!t&&be(s,0,c?fe:pe),{next(){const{value:e,done:t}=a.next();return t?{value:e,done:t}:{value:l?[u(e[0]),u(e[1])]:u(e),done:t}},[Symbol.iterator](){return this}}}}function Je(e){return function(...t){return"delete"!==e&&this}}function Ze(){const e={get(e){return je(this,e)},get size(){return He(this)},has:Ue,add:De,set:We,delete:ze,clear:Ke,forEach:Ge(!1,!1)},t={get(e){return je(this,e,!1,!0)},get size(){return He(this)},has:Ue,add:De,set:We,delete:ze,clear:Ke,forEach:Ge(!1,!0)},n={get(e){return je(this,e,!0)},get size(){return He(this,!0)},has(e){return Ue.call(this,e,!0)},add:Je("add"),set:Je("set"),delete:Je("delete"),clear:Je("clear"),forEach:Ge(!0,!1)},o={get(e){return je(this,e,!0,!0)},get size(){return He(this,!0)},has(e){return Ue.call(this,e,!0)},add:Je("add"),set:Je("set"),delete:Je("delete"),clear:Je("clear"),forEach:Ge(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach((r=>{e[r]=qe(r,!1,!1),n[r]=qe(r,!0,!1),t[r]=qe(r,!1,!0),o[r]=qe(r,!0,!0)})),[e,n,t,o]}const[Ye,Qe,Xe,et]=Ze();function tt(e,t){const n=t?e?et:Xe:e?Qe:Ye;return(t,o,r)=>"__v_isReactive"===o?!e:"__v_isReadonly"===o?e:"__v_raw"===o?t:Reflect.get(T(n,o)&&o in t?n:t,o,r)}const nt={get:tt(!1,!1)},ot={get:tt(!1,!0)},rt={get:tt(!0,!1)},st={get:tt(!0,!0)},it=new WeakMap,lt=new WeakMap,ct=new WeakMap,at=new WeakMap;function ut(e){return e.__v_skip||!Object.isExtensible(e)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((e=>I(e).slice(8,-1))(e))}function pt(e){return e&&e.__v_isReadonly?e:ht(e,!1,Me,nt,it)}function ft(e){return ht(e,!1,Ve,ot,lt)}function dt(e){return ht(e,!0,Pe,rt,ct)}function ht(e,t,n,o,r){if(!M(e))return e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;const s=r.get(e);if(s)return s;const i=ut(e);if(0===i)return e;const l=new Proxy(e,2===i?o:n);return r.set(e,l),l}function mt(e){return gt(e)?mt(e.__v_raw):!(!e||!e.__v_isReactive)}function gt(e){return!(!e||!e.__v_isReadonly)}function vt(e){return mt(e)||gt(e)}function yt(e){const t=e&&e.__v_raw;return t?yt(t):e}function bt(e){return Z(e,"__v_skip",!0),e}const _t=e=>M(e)?pt(e):e,St=e=>M(e)?dt(e):e;function xt(e){_e()&&((e=yt(e)).dep||(e.dep=oe()),Se(e.dep))}function Ct(e,t){(e=yt(e)).dep&&Ce(e.dep)}function wt(e){return Boolean(e&&!0===e.__v_isRef)}function kt(e){return Tt(e,!1)}function Tt(e,t){return wt(e)?e:new Nt(e,t)}class Nt{constructor(e,t){this._shallow=t,this.dep=void 0,this.__v_isRef=!0,this._rawValue=t?e:yt(e),this._value=t?e:_t(e)}get value(){return xt(this),this._value}set value(e){e=this._shallow?e:yt(e),q(e,this._rawValue)&&(this._rawValue=e,this._value=this._shallow?e:_t(e),Ct(this))}}function Et(e){return wt(e)?e.value:e}const $t={get:(e,t,n)=>Et(Reflect.get(e,t,n)),set:(e,t,n,o)=>{const r=e[t];return wt(r)&&!wt(n)?(r.value=n,!0):Reflect.set(e,t,n,o)}};function Rt(e){return mt(e)?e:new Proxy(e,$t)}class Ot{constructor(e){this.dep=void 0,this.__v_isRef=!0;const{get:t,set:n}=e((()=>xt(this)),(()=>Ct(this)));this._get=t,this._set=n}get value(){return this._get()}set value(e){this._set(e)}}class At{constructor(e,t){this._object=e,this._key=t,this.__v_isRef=!0}get value(){return this._object[this._key]}set value(e){this._object[this._key]=e}}function Ft(e,t){const n=e[t];return wt(n)?n:new At(e,t)}class Mt{constructor(e,t,n){this._setter=t,this.dep=void 0,this._dirty=!0,this.__v_isRef=!0,this.effect=new de(e,(()=>{this._dirty||(this._dirty=!0,Ct(this))})),this.__v_isReadonly=n}get value(){const e=yt(this);return xt(e),e._dirty&&(e._dirty=!1,e._value=e.effect.run()),e._value}set value(e){this._setter(e)}}function Pt(e,t){let n,o;const r=O(e);r?(n=e,o=y):(n=e.get,o=e.set);return new Mt(n,o,r||!o)}let Vt=[];function It(e,t,...n){const o=e.vnode.props||g;let r=n;const s=t.startsWith("update:"),i=s&&t.slice(7);if(i&&i in o){const e=`${"modelValue"===i?"model":i}Modifiers`,{number:t,trim:s}=o[e]||g;s?r=n.map((e=>e.trim())):t&&(r=n.map(Y))}let l,c=o[l=G(t)]||o[l=G(D(t))];!c&&s&&(c=o[l=G(z(t))]),c&&Rr(c,e,6,r);const a=o[l+"Once"];if(a){if(e.emitted){if(e.emitted[l])return}else e.emitted={};e.emitted[l]=!0,Rr(a,e,6,r)}}function Bt(e,t,n=!1){const o=t.emitsCache,r=o.get(e);if(void 0!==r)return r;const s=e.emits;let i={},l=!1;if(!O(e)){const o=e=>{const n=Bt(e,t,!0);n&&(l=!0,C(i,n))};!n&&t.mixins.length&&t.mixins.forEach(o),e.extends&&o(e.extends),e.mixins&&e.mixins.forEach(o)}return s||l?(N(s)?s.forEach((e=>i[e]=null)):C(i,s),o.set(e,i),i):(o.set(e,null),null)}function Lt(e,t){return!(!e||!S(t))&&(t=t.slice(2).replace(/Once$/,""),T(e,t[0].toLowerCase()+t.slice(1))||T(e,z(t))||T(e,t))}let jt=null,Ut=null;function Ht(e){const t=jt;return jt=e,Ut=e&&e.type.__scopeId||null,t}function Dt(e,t=jt,n){if(!t)return e;if(e._n)return e;const o=(...n)=>{o._d&&jo(-1);const r=Ht(t),s=e(...n);return Ht(r),o._d&&jo(1),s};return o._n=!0,o._c=!0,o._d=!0,o}function Wt(e){const{type:t,vnode:n,proxy:o,withProxy:r,props:s,propsOptions:[i],slots:l,attrs:c,emit:a,render:u,renderCache:p,data:f,setupState:d,ctx:h,inheritAttrs:m}=e;let g,v;const y=Ht(e);try{if(4&n.shapeFlag){const e=r||o;g=Xo(u.call(e,e,p,s,d,f,h)),v=c}else{const e=t;0,g=Xo(e(s,e.length>1?{attrs:c,slots:l,emit:a}:null)),v=t.props?c:zt(c)}}catch(_){Po.length=0,Or(_,e,1),g=Jo(Fo)}let b=g;if(v&&!1!==m){const e=Object.keys(v),{shapeFlag:t}=b;e.length&&7&t&&(i&&e.some(x)&&(v=Kt(v,i)),b=Yo(b,v))}return n.dirs&&(b.dirs=b.dirs?b.dirs.concat(n.dirs):n.dirs),n.transition&&(b.transition=n.transition),g=b,Ht(y),g}const zt=e=>{let t;for(const n in e)("class"===n||"style"===n||S(n))&&((t||(t={}))[n]=e[n]);return t},Kt=(e,t)=>{const n={};for(const o in e)x(o)&&o.slice(9)in t||(n[o]=e[o]);return n};function Gt(e,t,n){const o=Object.keys(t);if(o.length!==Object.keys(e).length)return!0;for(let r=0;r0?(Zt(e,"onPending"),Zt(e,"onFallback"),a(null,e.ssFallback,t,n,o,null,s,i),en(f,e.ssFallback)):f.resolve()}(t,n,o,r,s,i,l,c,a):function(e,t,n,o,r,s,i,l,{p:c,um:a,o:{createElement:u}}){const p=t.suspense=e.suspense;p.vnode=t,t.el=e.el;const f=t.ssContent,d=t.ssFallback,{activeBranch:h,pendingBranch:m,isInFallback:g,isHydrating:v}=p;if(m)p.pendingBranch=f,Wo(f,m)?(c(m,f,p.hiddenContainer,null,r,p,s,i,l),p.deps<=0?p.resolve():g&&(c(h,d,n,o,r,null,s,i,l),en(p,d))):(p.pendingId++,v?(p.isHydrating=!1,p.activeBranch=m):a(m,r,p),p.deps=0,p.effects.length=0,p.hiddenContainer=u("div"),g?(c(null,f,p.hiddenContainer,null,r,p,s,i,l),p.deps<=0?p.resolve():(c(h,d,n,o,r,null,s,i,l),en(p,d))):h&&Wo(f,h)?(c(h,f,n,o,r,p,s,i,l),p.resolve(!0)):(c(null,f,p.hiddenContainer,null,r,p,s,i,l),p.deps<=0&&p.resolve()));else if(h&&Wo(f,h))c(h,f,n,o,r,p,s,i,l),en(p,f);else if(Zt(t,"onPending"),p.pendingBranch=f,p.pendingId++,c(null,f,p.hiddenContainer,null,r,p,s,i,l),p.deps<=0)p.resolve();else{const{timeout:e,pendingId:t}=p;e>0?setTimeout((()=>{p.pendingId===t&&p.fallback(d)}),e):0===e&&p.fallback(d)}}(e,t,n,o,r,i,l,c,a)},hydrate:function(e,t,n,o,r,s,i,l,c){const a=t.suspense=Yt(t,o,n,e.parentNode,document.createElement("div"),null,r,s,i,l,!0),u=c(e,a.pendingBranch=t.ssContent,n,a,s,i);0===a.deps&&a.resolve();return u},create:Yt,normalize:function(e){const{shapeFlag:t,children:n}=e,o=32&t;e.ssContent=Qt(o?n.default:n),e.ssFallback=o?Qt(n.fallback):Jo(Fo)}};function Zt(e,t){const n=e.props&&e.props[t];O(n)&&n()}function Yt(e,t,n,o,r,s,i,l,c,a,u=!1){const{p:p,m:f,um:d,n:h,o:{parentNode:m,remove:g}}=a,v=Y(e.props&&e.props.timeout),y={vnode:e,parent:t,parentComponent:n,isSVG:i,container:o,hiddenContainer:r,anchor:s,deps:0,pendingId:0,timeout:"number"==typeof v?v:-1,activeBranch:null,pendingBranch:null,isInFallback:!0,isHydrating:u,isUnmounted:!1,effects:[],resolve(e=!1){const{vnode:t,activeBranch:n,pendingBranch:o,pendingId:r,effects:s,parentComponent:i,container:l}=y;if(y.isHydrating)y.isHydrating=!1;else if(!e){const e=n&&o.transition&&"out-in"===o.transition.mode;e&&(n.transition.afterLeave=()=>{r===y.pendingId&&f(o,l,t,0)});let{anchor:t}=y;n&&(t=h(n),d(n,i,y,!0)),e||f(o,l,t,0)}en(y,o),y.pendingBranch=null,y.isInFallback=!1;let c=y.parent,a=!1;for(;c;){if(c.pendingBranch){c.effects.push(...s),a=!0;break}c=c.parent}a||Jr(s),y.effects=[],Zt(t,"onResolve")},fallback(e){if(!y.pendingBranch)return;const{vnode:t,activeBranch:n,parentComponent:o,container:r,isSVG:s}=y;Zt(t,"onFallback");const i=h(n),a=()=>{y.isInFallback&&(p(null,e,r,i,o,null,s,l,c),en(y,e))},u=e.transition&&"out-in"===e.transition.mode;u&&(n.transition.afterLeave=a),y.isInFallback=!0,d(n,o,null,!0),u||a()},move(e,t,n){y.activeBranch&&f(y.activeBranch,e,t,n),y.container=e},next:()=>y.activeBranch&&h(y.activeBranch),registerDep(e,t){const n=!!y.pendingBranch;n&&y.deps++;const o=e.vnode.el;e.asyncDep.catch((t=>{Or(t,e,0)})).then((r=>{if(e.isUnmounted||y.isUnmounted||y.pendingId!==e.suspenseId)return;e.asyncResolved=!0;const{vnode:s}=e;yr(e,r,!1),o&&(s.el=o);const l=!o&&e.subTree.el;t(e,s,m(o||e.subTree.el),o?null:h(e.subTree),y,i,c),l&&g(l),qt(e,s.el),n&&0==--y.deps&&y.resolve()}))},unmount(e,t){y.isUnmounted=!0,y.activeBranch&&d(y.activeBranch,n,e,t),y.pendingBranch&&d(y.pendingBranch,n,e,t)}};return y}function Qt(e){let t;if(O(e)){const n=Lo&&e._c;n&&(e._d=!1,Io()),e=e(),n&&(e._d=!0,t=Vo,Bo())}if(N(e)){const t=function(e){let t;for(let n=0;nt!==e))),e}function Xt(e,t){t&&t.pendingBranch?N(e)?t.effects.push(...e):t.effects.push(e):Jr(e)}function en(e,t){e.activeBranch=t;const{vnode:n,parentComponent:o}=e,r=n.el=t.el;o&&o.subTree===n&&(o.vnode.el=r,qt(o,r))}function tn(e,t){if(ur){let n=ur.provides;const o=ur.parent&&ur.parent.provides;o===n&&(n=ur.provides=Object.create(o)),n[e]=t}else;}function nn(e,t,n=!1){const o=ur||jt;if(o){const r=null==o.parent?o.vnode.appContext&&o.vnode.appContext.provides:o.parent.provides;if(r&&e in r)return r[e];if(arguments.length>1)return n&&O(t)?t.call(o.proxy):t}}function on(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return En((()=>{e.isMounted=!0})),On((()=>{e.isUnmounting=!0})),e}const rn=[Function,Array],sn={name:"BaseTransition",props:{mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:rn,onEnter:rn,onAfterEnter:rn,onEnterCancelled:rn,onBeforeLeave:rn,onLeave:rn,onAfterLeave:rn,onLeaveCancelled:rn,onBeforeAppear:rn,onAppear:rn,onAfterAppear:rn,onAppearCancelled:rn},setup(e,{slots:t}){const n=pr(),o=on();let r;return()=>{const s=t.default&&fn(t.default(),!0);if(!s||!s.length)return;const i=yt(e),{mode:l}=i,c=s[0];if(o.isLeaving)return an(c);const a=un(c);if(!a)return an(c);const u=cn(a,i,o,n);pn(a,u);const p=n.subTree,f=p&&un(p);let d=!1;const{getTransitionKey:h}=a.type;if(h){const e=h();void 0===r?r=e:e!==r&&(r=e,d=!0)}if(f&&f.type!==Fo&&(!Wo(a,f)||d)){const e=cn(f,i,o,n);if(pn(f,e),"out-in"===l)return o.isLeaving=!0,e.afterLeave=()=>{o.isLeaving=!1,n.update()},an(c);"in-out"===l&&a.type!==Fo&&(e.delayLeave=(e,t,n)=>{ln(o,f)[String(f.key)]=f,e._leaveCb=()=>{t(),e._leaveCb=void 0,delete u.delayedLeave},u.delayedLeave=n})}return c}}};function ln(e,t){const{leavingVNodes:n}=e;let o=n.get(t.type);return o||(o=Object.create(null),n.set(t.type,o)),o}function cn(e,t,n,o){const{appear:r,mode:s,persisted:i=!1,onBeforeEnter:l,onEnter:c,onAfterEnter:a,onEnterCancelled:u,onBeforeLeave:p,onLeave:f,onAfterLeave:d,onLeaveCancelled:h,onBeforeAppear:m,onAppear:g,onAfterAppear:v,onAppearCancelled:y}=t,b=String(e.key),_=ln(n,e),S=(e,t)=>{e&&Rr(e,o,9,t)},x={mode:s,persisted:i,beforeEnter(t){let o=l;if(!n.isMounted){if(!r)return;o=m||l}t._leaveCb&&t._leaveCb(!0);const s=_[b];s&&Wo(e,s)&&s.el._leaveCb&&s.el._leaveCb(),S(o,[t])},enter(e){let t=c,o=a,s=u;if(!n.isMounted){if(!r)return;t=g||c,o=v||a,s=y||u}let i=!1;const l=e._enterCb=t=>{i||(i=!0,S(t?s:o,[e]),x.delayedLeave&&x.delayedLeave(),e._enterCb=void 0)};t?(t(e,l),t.length<=1&&l()):l()},leave(t,o){const r=String(e.key);if(t._enterCb&&t._enterCb(!0),n.isUnmounting)return o();S(p,[t]);let s=!1;const i=t._leaveCb=n=>{s||(s=!0,o(),S(n?h:d,[t]),t._leaveCb=void 0,_[r]===e&&delete _[r])};_[r]=e,f?(f(t,i),f.length<=1&&i()):i()},clone:e=>cn(e,t,n,o)};return x}function an(e){if(gn(e))return(e=Yo(e)).children=null,e}function un(e){return gn(e)?e.children?e.children[0]:void 0:e}function pn(e,t){6&e.shapeFlag&&e.component?pn(e.component.subTree,t):128&e.shapeFlag?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function fn(e,t=!1){let n=[],o=0;for(let r=0;r1)for(let r=0;r!!e.type.__asyncLoader;function mn(e,{vnode:{ref:t,props:n,children:o}}){const r=Jo(e,n,o);return r.ref=t,r}const gn=e=>e.type.__isKeepAlive,vn={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=pr(),o=n.ctx;if(!o.renderer)return t.default;const r=new Map,s=new Set;let i=null;const l=n.suspense,{renderer:{p:c,m:a,um:u,o:{createElement:p}}}=o,f=p("div");function d(e){Cn(e),u(e,n,l)}function h(e){r.forEach(((t,n)=>{const o=wr(t.type);!o||e&&e(o)||m(n)}))}function m(e){const t=r.get(e);i&&t.type===i.type?i&&Cn(i):d(t),r.delete(e),s.delete(e)}o.activate=(e,t,n,o,r)=>{const s=e.component;a(e,t,n,0,l),c(s.vnode,e,t,n,s,l,o,e.slotScopeIds,r),mo((()=>{s.isDeactivated=!1,s.a&&J(s.a);const t=e.props&&e.props.onVnodeMounted;t&&_o(t,s.parent,e)}),l)},o.deactivate=e=>{const t=e.component;a(e,f,null,1,l),mo((()=>{t.da&&J(t.da);const n=e.props&&e.props.onVnodeUnmounted;n&&_o(n,t.parent,e),t.isDeactivated=!0}),l)},ns((()=>[e.include,e.exclude]),(([e,t])=>{e&&h((t=>yn(e,t))),t&&h((e=>!yn(t,e)))}),{flush:"post",deep:!0});let g=null;const v=()=>{null!=g&&r.set(g,wn(n.subTree))};return En(v),Rn(v),On((()=>{r.forEach((e=>{const{subTree:t,suspense:o}=n,r=wn(t);if(e.type!==r.type)d(e);else{Cn(r);const e=r.component.da;e&&mo(e,o)}}))})),()=>{if(g=null,!t.default)return null;const n=t.default(),o=n[0];if(n.length>1)return i=null,n;if(!(Do(o)&&(4&o.shapeFlag||128&o.shapeFlag)))return i=null,o;let l=wn(o);const c=l.type,a=wr(hn(l)?l.type.__asyncResolved||{}:c),{include:u,exclude:p,max:f}=e;if(u&&(!a||!yn(u,a))||p&&a&&yn(p,a))return i=l,o;const d=null==l.key?c:l.key,h=r.get(d);return l.el&&(l=Yo(l),128&o.shapeFlag&&(o.ssContent=l)),g=d,h?(l.el=h.el,l.component=h.component,l.transition&&pn(l,l.transition),l.shapeFlag|=512,s.delete(d),s.add(d)):(s.add(d),f&&s.size>parseInt(f,10)&&m(s.values().next().value)),l.shapeFlag|=256,i=l,o}}};function yn(e,t){return N(e)?e.some((e=>yn(e,t))):A(e)?e.split(",").indexOf(t)>-1:!!e.test&&e.test(t)}function bn(e,t){Sn(e,"a",t)}function _n(e,t){Sn(e,"da",t)}function Sn(e,t,n=ur){const o=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}e()});if(kn(t,o,n),n){let e=n.parent;for(;e&&e.parent;)gn(e.parent.vnode)&&xn(o,t,n,e),e=e.parent}}function xn(e,t,n,o){const r=kn(t,e,o,!0);An((()=>{w(o[t],r)}),n)}function Cn(e){let t=e.shapeFlag;256&t&&(t-=256),512&t&&(t-=512),e.shapeFlag=t}function wn(e){return 128&e.shapeFlag?e.ssContent:e}function kn(e,t,n=ur,o=!1){if(n){const r=n[e]||(n[e]=[]),s=t.__weh||(t.__weh=(...o)=>{if(n.isUnmounted)return;ve(),fr(n);const r=Rr(t,n,e,o);return dr(),ye(),r});return o?r.unshift(s):r.push(s),s}}const Tn=e=>(t,n=ur)=>(!vr||"sp"===e)&&kn(e,t,n),Nn=Tn("bm"),En=Tn("m"),$n=Tn("bu"),Rn=Tn("u"),On=Tn("bum"),An=Tn("um"),Fn=Tn("sp"),Mn=Tn("rtg"),Pn=Tn("rtc");function Vn(e,t=ur){kn("ec",e,t)}let In=!0;function Bn(e){const t=Un(e),n=e.proxy,o=e.ctx;In=!1,t.beforeCreate&&Ln(t.beforeCreate,e,"bc");const{data:r,computed:s,methods:i,watch:l,provide:c,inject:a,created:u,beforeMount:p,mounted:f,beforeUpdate:d,updated:h,activated:m,deactivated:g,beforeUnmount:v,unmounted:b,render:_,renderTracked:S,renderTriggered:x,errorCaptured:C,serverPrefetch:w,expose:k,inheritAttrs:T,components:E,directives:$}=t;if(a&&function(e,t,n=y,o=!1){N(e)&&(e=zn(e));for(const r in e){const n=e[r];let s;s=M(n)?"default"in n?nn(n.from||r,n.default,!0):nn(n.from||r):nn(n),wt(s)&&o?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>s.value,set:e=>s.value=e}):t[r]=s}}(a,o,null,e.appContext.config.unwrapInjectedRef),i)for(const y in i){const e=i[y];O(e)&&(o[y]=e.bind(n))}if(r){const t=r.call(n,n);M(t)&&(e.data=pt(t))}if(In=!0,s)for(const N in s){const e=s[N],t=Pt({get:O(e)?e.bind(n,n):O(e.get)?e.get.bind(n,n):y,set:!O(e)&&O(e.set)?e.set.bind(n):y});Object.defineProperty(o,N,{enumerable:!0,configurable:!0,get:()=>t.value,set:e=>t.value=e})}if(l)for(const y in l)jn(l[y],o,n,y);if(c){const e=O(c)?c.call(n):c;Reflect.ownKeys(e).forEach((t=>{tn(t,e[t])}))}function R(e,t){N(t)?t.forEach((t=>e(t.bind(n)))):t&&e(t.bind(n))}if(u&&Ln(u,e,"c"),R(Nn,p),R(En,f),R($n,d),R(Rn,h),R(bn,m),R(_n,g),R(Vn,C),R(Pn,S),R(Mn,x),R(On,v),R(An,b),R(Fn,w),N(k))if(k.length){const t=e.exposed||(e.exposed={});k.forEach((e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t})}))}else e.exposed||(e.exposed={});_&&e.render===y&&(e.render=_),null!=T&&(e.inheritAttrs=T),E&&(e.components=E),$&&(e.directives=$)}function Ln(e,t,n){Rr(N(e)?e.map((e=>e.bind(t.proxy))):e.bind(t.proxy),t,n)}function jn(e,t,n,o){const r=o.includes(".")?ss(n,o):()=>n[o];if(A(e)){const n=t[e];O(n)&&ns(r,n)}else if(O(e))ns(r,e.bind(n));else if(M(e))if(N(e))e.forEach((e=>jn(e,t,n,o)));else{const o=O(e.handler)?e.handler.bind(n):t[e.handler];O(o)&&ns(r,o,e)}}function Un(e){const t=e.type,{mixins:n,extends:o}=t,{mixins:r,optionsCache:s,config:{optionMergeStrategies:i}}=e.appContext,l=s.get(t);let c;return l?c=l:r.length||n||o?(c={},r.length&&r.forEach((e=>Hn(c,e,i,!0))),Hn(c,t,i)):c=t,s.set(t,c),c}function Hn(e,t,n,o=!1){const{mixins:r,extends:s}=t;s&&Hn(e,s,n,!0),r&&r.forEach((t=>Hn(e,t,n,!0)));for(const i in t)if(o&&"expose"===i);else{const o=Dn[i]||n&&n[i];e[i]=o?o(e[i],t[i]):t[i]}return e}const Dn={data:Wn,props:Gn,emits:Gn,methods:Gn,computed:Gn,beforeCreate:Kn,created:Kn,beforeMount:Kn,mounted:Kn,beforeUpdate:Kn,updated:Kn,beforeDestroy:Kn,beforeUnmount:Kn,destroyed:Kn,unmounted:Kn,activated:Kn,deactivated:Kn,errorCaptured:Kn,serverPrefetch:Kn,components:Gn,directives:Gn,watch:function(e,t){if(!e)return t;if(!t)return e;const n=C(Object.create(null),e);for(const o in t)n[o]=Kn(e[o],t[o]);return n},provide:Wn,inject:function(e,t){return Gn(zn(e),zn(t))}};function Wn(e,t){return t?e?function(){return C(O(e)?e.call(this,this):e,O(t)?t.call(this,this):t)}:t:e}function zn(e){if(N(e)){const t={};for(let n=0;n{c=!0;const[n,o]=Zn(e,t,!0);C(i,n),o&&l.push(...o)};!n&&t.mixins.length&&t.mixins.forEach(o),e.extends&&o(e.extends),e.mixins&&e.mixins.forEach(o)}if(!s&&!c)return o.set(e,v),v;if(N(s))for(let u=0;u-1,n[1]=o<0||t-1||T(n,"default"))&&l.push(e)}}}const a=[i,l];return o.set(e,a),a}function Yn(e){return"$"!==e[0]}function Qn(e){const t=e&&e.toString().match(/^\s*function (\w+)/);return t?t[1]:null===e?"null":""}function Xn(e,t){return Qn(e)===Qn(t)}function eo(e,t){return N(t)?t.findIndex((t=>Xn(t,e))):O(t)&&Xn(t,e)?0:-1}const to=e=>"_"===e[0]||"$stable"===e,no=e=>N(e)?e.map(Xo):[Xo(e)],oo=(e,t,n)=>{const o=Dt(((...e)=>no(t(...e))),n);return o._c=!1,o},ro=(e,t,n)=>{const o=e._ctx;for(const r in e){if(to(r))continue;const n=e[r];if(O(n))t[r]=oo(0,n,o);else if(null!=n){const e=no(n);t[r]=()=>e}}},so=(e,t)=>{const n=no(t);e.slots.default=()=>n};function io(e,t,n,o){const r=e.dirs,s=t&&t.dirs;for(let i=0;i(s.has(e)||(e&&O(e.install)?(s.add(e),e.install(l,...t)):O(e)&&(s.add(e),e(l,...t))),l),mixin:e=>(r.mixins.includes(e)||r.mixins.push(e),l),component:(e,t)=>t?(r.components[e]=t,l):r.components[e],directive:(e,t)=>t?(r.directives[e]=t,l):r.directives[e],mount(s,c,a){if(!i){const u=Jo(n,o);return u.appContext=r,c&&t?t(u,s):e(u,s,a),i=!0,l._container=s,s.__vue_app__=l,xr(u.component)||u.component.proxy}},unmount(){i&&(e(null,l._container),delete l._container.__vue_app__)},provide:(e,t)=>(r.provides[e]=t,l)};return l}}let uo=!1;const po=e=>/svg/.test(e.namespaceURI)&&"foreignObject"!==e.tagName,fo=e=>8===e.nodeType;function ho(e){const{mt:t,p:n,o:{patchProp:o,nextSibling:r,parentNode:s,remove:i,insert:l,createComment:c}}=e,a=(n,o,i,l,c,m=!1)=>{const g=fo(n)&&"["===n.data,v=()=>d(n,o,i,l,c,g),{type:y,ref:b,shapeFlag:_}=o,S=n.nodeType;o.el=n;let x=null;switch(y){case Ao:3!==S?x=v():(n.data!==o.children&&(uo=!0,n.data=o.children),x=r(n));break;case Fo:x=8!==S||g?v():r(n);break;case Mo:if(1===S){x=n;const e=!o.children.length;for(let t=0;t{l=l||!!t.dynamicChildren;const{type:c,props:a,patchFlag:u,shapeFlag:f,dirs:d}=t,h="input"===c&&d||"option"===c;if(h||-1!==u){if(d&&io(t,null,n,"created"),a)if(h||!l||48&u)for(const t in a)(h&&t.endsWith("value")||S(t)&&!j(t))&&o(e,t,null,a[t],!1,void 0,n);else a.onClick&&o(e,"onClick",null,a.onClick,!1,void 0,n);let c;if((c=a&&a.onVnodeBeforeMount)&&_o(c,n,t),d&&io(t,null,n,"beforeMount"),((c=a&&a.onVnodeMounted)||d)&&Xt((()=>{c&&_o(c,n,t),d&&io(t,null,n,"mounted")}),r),16&f&&(!a||!a.innerHTML&&!a.textContent)){let o=p(e.firstChild,t,e,n,r,s,l);for(;o;){uo=!0;const e=o;o=o.nextSibling,i(e)}}else 8&f&&e.textContent!==t.children&&(uo=!0,e.textContent=t.children)}return e.nextSibling},p=(e,t,o,r,s,i,l)=>{l=l||!!t.dynamicChildren;const c=t.children,u=c.length;for(let p=0;p{const{slotScopeIds:u}=t;u&&(i=i?i.concat(u):u);const f=s(e),d=p(r(e),t,f,n,o,i,a);return d&&fo(d)&&"]"===d.data?r(t.anchor=d):(uo=!0,l(t.anchor=c("]"),f,d),d)},d=(e,t,o,l,c,a)=>{if(uo=!0,t.el=null,a){const t=h(e);for(;;){const n=r(e);if(!n||n===t)break;i(n)}}const u=r(e),p=s(e);return i(e),n(null,t,p,u,o,l,po(p),c),u},h=e=>{let t=0;for(;e;)if((e=r(e))&&fo(e)&&("["===e.data&&t++,"]"===e.data)){if(0===t)return r(e);t--}return e};return[(e,t)=>{if(!t.hasChildNodes())return n(null,e,t),void Yr();uo=!1,a(t.firstChild,e,null,null,null),Yr(),uo&&console.error("Hydration completed but contains mismatches.")},a]}const mo=Xt;function go(e){return yo(e)}function vo(e){return yo(e,ho)}function yo(e,t){(Q||(Q="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{})).__VUE__=!0;const{insert:n,remove:o,patchProp:r,createElement:s,createText:i,createComment:l,setText:c,setElementText:a,parentNode:u,nextSibling:p,setScopeId:f=y,cloneNode:d,insertStaticContent:h}=e,m=(e,t,n,o=null,r=null,s=null,i=!1,l=null,c=!!t.dynamicChildren)=>{if(e===t)return;e&&!Wo(e,t)&&(o=X(e),W(e,r,s,!0),e=null),-2===t.patchFlag&&(c=!1,t.dynamicChildren=null);const{type:a,ref:u,shapeFlag:p}=t;switch(a){case Ao:b(e,t,n,o);break;case Fo:_(e,t,n,o);break;case Mo:null==e&&S(t,n,o,i);break;case Oo:O(e,t,n,o,r,s,i,l,c);break;default:1&p?x(e,t,n,o,r,s,i,l,c):6&p?A(e,t,n,o,r,s,i,l,c):(64&p||128&p)&&a.process(e,t,n,o,r,s,i,l,c,ne)}null!=u&&r&&bo(u,e&&e.ref,s,t||e,!t)},b=(e,t,o,r)=>{if(null==e)n(t.el=i(t.children),o,r);else{const n=t.el=e.el;t.children!==e.children&&c(n,t.children)}},_=(e,t,o,r)=>{null==e?n(t.el=l(t.children||""),o,r):t.el=e.el},S=(e,t,n,o)=>{[e.el,e.anchor]=h(e.children,t,n,o)},x=(e,t,n,o,r,s,i,l,c)=>{i=i||"svg"===t.type,null==e?w(t,n,o,r,s,i,l,c):E(e,t,r,s,i,l,c)},w=(e,t,o,i,l,c,u,p)=>{let f,h;const{type:m,props:g,shapeFlag:v,transition:y,patchFlag:b,dirs:_}=e;if(e.el&&void 0!==d&&-1===b)f=e.el=d(e.el);else{if(f=e.el=s(e.type,c,g&&g.is,g),8&v?a(f,e.children):16&v&&N(e.children,f,null,i,l,c&&"foreignObject"!==m,u,p),_&&io(e,null,i,"created"),g){for(const t in g)"value"===t||j(t)||r(f,t,null,g[t],c,e.children,i,l,Y);"value"in g&&r(f,"value",null,g.value),(h=g.onVnodeBeforeMount)&&_o(h,i,e)}k(f,e,e.scopeId,u,i)}_&&io(e,null,i,"beforeMount");const S=(!l||l&&!l.pendingBranch)&&y&&!y.persisted;S&&y.beforeEnter(f),n(f,t,o),((h=g&&g.onVnodeMounted)||S||_)&&mo((()=>{h&&_o(h,i,e),S&&y.enter(f),_&&io(e,null,i,"mounted")}),l)},k=(e,t,n,o,r)=>{if(n&&f(e,n),o)for(let s=0;s{for(let a=c;a{const c=t.el=e.el;let{patchFlag:u,dynamicChildren:p,dirs:f}=t;u|=16&e.patchFlag;const d=e.props||g,h=t.props||g;let m;(m=h.onVnodeBeforeUpdate)&&_o(m,n,t,e),f&&io(t,e,n,"beforeUpdate");const v=s&&"foreignObject"!==t.type;if(p?$(e.dynamicChildren,p,c,n,o,v,i):l||B(e,t,c,null,n,o,v,i,!1),u>0){if(16&u)R(c,t,d,h,n,o,s);else if(2&u&&d.class!==h.class&&r(c,"class",null,h.class,s),4&u&&r(c,"style",d.style,h.style,s),8&u){const i=t.dynamicProps;for(let t=0;t{m&&_o(m,n,t,e),f&&io(t,e,n,"updated")}),o)},$=(e,t,n,o,r,s,i)=>{for(let l=0;l{if(n!==o){for(const c in o){if(j(c))continue;const a=o[c],u=n[c];a!==u&&"value"!==c&&r(e,c,u,a,l,t.children,s,i,Y)}if(n!==g)for(const c in n)j(c)||c in o||r(e,c,n[c],null,l,t.children,s,i,Y);"value"in o&&r(e,"value",n.value,o.value)}},O=(e,t,o,r,s,l,c,a,u)=>{const p=t.el=e?e.el:i(""),f=t.anchor=e?e.anchor:i("");let{patchFlag:d,dynamicChildren:h,slotScopeIds:m}=t;m&&(a=a?a.concat(m):m),null==e?(n(p,o,r),n(f,o,r),N(t.children,o,f,s,l,c,a,u)):d>0&&64&d&&h&&e.dynamicChildren?($(e.dynamicChildren,h,o,s,l,c,a),(null!=t.key||s&&t===s.subTree)&&So(e,t,!0)):B(e,t,o,f,s,l,c,a,u)},A=(e,t,n,o,r,s,i,l,c)=>{t.slotScopeIds=l,null==e?512&t.shapeFlag?r.ctx.activate(t,n,o,i,c):F(t,n,o,r,s,i,c):M(e,t,c)},F=(e,t,n,o,r,s,i)=>{const l=e.component=function(e,t,n){const o=e.type,r=(t?t.appContext:e.appContext)||cr,s={uid:ar++,vnode:e,type:o,parent:t,appContext:r,root:null,next:null,subTree:null,update:null,scope:new te(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(r.provides),accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Zn(o,r),emitsOptions:Bt(o,r),emit:null,emitted:null,propsDefaults:g,inheritAttrs:o.inheritAttrs,ctx:g,data:g,props:g,attrs:g,slots:g,refs:g,setupState:g,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};s.ctx={_:s},s.root=t?t.root:s,s.emit=It.bind(null,s),e.ce&&e.ce(s);return s}(e,o,r);if(gn(e)&&(l.ctx.renderer=ne),function(e,t=!1){vr=t;const{props:n,children:o}=e.vnode,r=hr(e);(function(e,t,n,o=!1){const r={},s={};Z(s,zo,1),e.propsDefaults=Object.create(null),qn(e,t,r,s);for(const i in e.propsOptions[0])i in r||(r[i]=void 0);e.props=n?o?r:ft(r):e.type.props?r:s,e.attrs=s})(e,n,r,t),((e,t)=>{if(32&e.vnode.shapeFlag){const n=t._;n?(e.slots=yt(t),Z(t,"_",n)):ro(t,e.slots={})}else e.slots={},t&&so(e,t);Z(e.slots,zo,1)})(e,o);const s=r?function(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=bt(new Proxy(e.ctx,ir));const{setup:o}=n;if(o){const n=e.setupContext=o.length>1?Sr(e):null;fr(e),ve();const r=$r(o,e,0,[e.props,n]);if(ye(),dr(),P(r)){if(r.then(dr,dr),t)return r.then((n=>{yr(e,n,t)})).catch((t=>{Or(t,e,0)}));e.asyncDep=r}else yr(e,r,t)}else _r(e,t)}(e,t):void 0;vr=!1}(l),l.asyncDep){if(r&&r.registerDep(l,V),!e.el){const e=l.subTree=Jo(Fo);_(null,e,t,n)}}else V(l,e,t,n,r,s,i)},M=(e,t,n)=>{const o=t.component=e.component;if(function(e,t,n){const{props:o,children:r,component:s}=e,{props:i,children:l,patchFlag:c}=t,a=s.emitsOptions;if(t.dirs||t.transition)return!0;if(!(n&&c>=0))return!(!r&&!l||l&&l.$stable)||o!==i&&(o?!i||Gt(o,i,a):!!i);if(1024&c)return!0;if(16&c)return o?Gt(o,i,a):!!i;if(8&c){const e=t.dynamicProps;for(let t=0;tPr&&Mr.splice(t,1)}(o.update),o.update()}else t.component=e.component,t.el=e.el,o.vnode=t},V=(e,t,n,o,r,s,i)=>{const l=new de((()=>{if(e.isMounted){let t,{next:n,bu:o,u:c,parent:a,vnode:p}=e,f=n;l.allowRecurse=!1,n?(n.el=p.el,I(e,n,i)):n=p,o&&J(o),(t=n.props&&n.props.onVnodeBeforeUpdate)&&_o(t,a,n,p),l.allowRecurse=!0;const d=Wt(e),h=e.subTree;e.subTree=d,m(h,d,u(h.el),X(h),e,r,s),n.el=d.el,null===f&&qt(e,d.el),c&&mo(c,r),(t=n.props&&n.props.onVnodeUpdated)&&mo((()=>_o(t,a,n,p)),r)}else{let i;const{el:c,props:a}=t,{bm:u,m:p,parent:f}=e,d=hn(t);if(l.allowRecurse=!1,u&&J(u),!d&&(i=a&&a.onVnodeBeforeMount)&&_o(i,f,t),l.allowRecurse=!0,c&&re){const n=()=>{e.subTree=Wt(e),re(c,e.subTree,e,r,null)};d?t.type.__asyncLoader().then((()=>!e.isUnmounted&&n())):n()}else{const i=e.subTree=Wt(e);m(null,i,n,o,e,r,s),t.el=i.el}if(p&&mo(p,r),!d&&(i=a&&a.onVnodeMounted)){const e=t;mo((()=>_o(i,f,e)),r)}256&t.shapeFlag&&e.a&&mo(e.a,r),e.isMounted=!0,t=n=o=null}}),(()=>Kr(e.update)),e.scope),c=e.update=l.run.bind(l);c.id=e.uid,l.allowRecurse=c.allowRecurse=!0,c()},I=(e,t,n)=>{t.component=e;const o=e.vnode.props;e.vnode=t,e.next=null,function(e,t,n,o){const{props:r,attrs:s,vnode:{patchFlag:i}}=e,l=yt(r),[c]=e.propsOptions;let a=!1;if(!(o||i>0)||16&i){let o;qn(e,t,r,s)&&(a=!0);for(const s in l)t&&(T(t,s)||(o=z(s))!==s&&T(t,o))||(c?!n||void 0===n[s]&&void 0===n[o]||(r[s]=Jn(c,l,s,void 0,e,!0)):delete r[s]);if(s!==l)for(const e in s)t&&T(t,e)||(delete s[e],a=!0)}else if(8&i){const n=e.vnode.dynamicProps;for(let o=0;o{const{vnode:o,slots:r}=e;let s=!0,i=g;if(32&o.shapeFlag){const e=t._;e?n&&1===e?s=!1:(C(r,t),n||1!==e||delete r._):(s=!t.$stable,ro(t,r)),i=t}else t&&(so(e,t),i={default:1});if(s)for(const l in r)to(l)||l in i||delete r[l]})(e,t.children,n),ve(),Zr(void 0,e.update),ye()},B=(e,t,n,o,r,s,i,l,c=!1)=>{const u=e&&e.children,p=e?e.shapeFlag:0,f=t.children,{patchFlag:d,shapeFlag:h}=t;if(d>0){if(128&d)return void U(u,f,n,o,r,s,i,l,c);if(256&d)return void L(u,f,n,o,r,s,i,l,c)}8&h?(16&p&&Y(u,r,s),f!==u&&a(n,f)):16&p?16&h?U(u,f,n,o,r,s,i,l,c):Y(u,r,s,!0):(8&p&&a(n,""),16&h&&N(f,n,o,r,s,i,l,c))},L=(e,t,n,o,r,s,i,l,c)=>{const a=(e=e||v).length,u=(t=t||v).length,p=Math.min(a,u);let f;for(f=0;fu?Y(e,r,s,!0,!1,p):N(t,n,o,r,s,i,l,c,p)},U=(e,t,n,o,r,s,i,l,c)=>{let a=0;const u=t.length;let p=e.length-1,f=u-1;for(;a<=p&&a<=f;){const o=e[a],u=t[a]=c?er(t[a]):Xo(t[a]);if(!Wo(o,u))break;m(o,u,n,null,r,s,i,l,c),a++}for(;a<=p&&a<=f;){const o=e[p],a=t[f]=c?er(t[f]):Xo(t[f]);if(!Wo(o,a))break;m(o,a,n,null,r,s,i,l,c),p--,f--}if(a>p){if(a<=f){const e=f+1,p=ef)for(;a<=p;)W(e[a],r,s,!0),a++;else{const d=a,h=a,g=new Map;for(a=h;a<=f;a++){const e=t[a]=c?er(t[a]):Xo(t[a]);null!=e.key&&g.set(e.key,a)}let y,b=0;const _=f-h+1;let S=!1,x=0;const C=new Array(_);for(a=0;a<_;a++)C[a]=0;for(a=d;a<=p;a++){const o=e[a];if(b>=_){W(o,r,s,!0);continue}let u;if(null!=o.key)u=g.get(o.key);else for(y=h;y<=f;y++)if(0===C[y-h]&&Wo(o,t[y])){u=y;break}void 0===u?W(o,r,s,!0):(C[u-h]=a+1,u>=x?x=u:S=!0,m(o,t[u],n,null,r,s,i,l,c),b++)}const w=S?function(e){const t=e.slice(),n=[0];let o,r,s,i,l;const c=e.length;for(o=0;o>1,e[n[l]]0&&(t[o]=n[s-1]),n[s]=o)}}s=n.length,i=n[s-1];for(;s-- >0;)n[s]=i,i=t[i];return n}(C):v;for(y=w.length-1,a=_-1;a>=0;a--){const e=h+a,p=t[e],f=e+1{const{el:i,type:l,transition:c,children:a,shapeFlag:u}=e;if(6&u)return void H(e.component.subTree,t,o,r);if(128&u)return void e.suspense.move(t,o,r);if(64&u)return void l.move(e,t,o,ne);if(l===Oo){n(i,t,o);for(let e=0;e{let s;for(;e&&e!==t;)s=p(e),n(e,o,r),e=s;n(t,o,r)})(e,t,o);if(2!==r&&1&u&&c)if(0===r)c.beforeEnter(i),n(i,t,o),mo((()=>c.enter(i)),s);else{const{leave:e,delayLeave:r,afterLeave:s}=c,l=()=>n(i,t,o),a=()=>{e(i,(()=>{l(),s&&s()}))};r?r(i,l,a):a()}else n(i,t,o)},W=(e,t,n,o=!1,r=!1)=>{const{type:s,props:i,ref:l,children:c,dynamicChildren:a,shapeFlag:u,patchFlag:p,dirs:f}=e;if(null!=l&&bo(l,null,n,e,!0),256&u)return void t.ctx.deactivate(e);const d=1&u&&f,h=!hn(e);let m;if(h&&(m=i&&i.onVnodeBeforeUnmount)&&_o(m,t,e),6&u)q(e.component,n,o);else{if(128&u)return void e.suspense.unmount(n,o);d&&io(e,null,t,"beforeUnmount"),64&u?e.type.remove(e,t,n,r,ne,o):a&&(s!==Oo||p>0&&64&p)?Y(a,t,n,!1,!0):(s===Oo&&384&p||!r&&16&u)&&Y(c,t,n),o&&K(e)}(h&&(m=i&&i.onVnodeUnmounted)||d)&&mo((()=>{m&&_o(m,t,e),d&&io(e,null,t,"unmounted")}),n)},K=e=>{const{type:t,el:n,anchor:r,transition:s}=e;if(t===Oo)return void G(n,r);if(t===Mo)return void(({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=p(e),o(e),e=n;o(t)})(e);const i=()=>{o(n),s&&!s.persisted&&s.afterLeave&&s.afterLeave()};if(1&e.shapeFlag&&s&&!s.persisted){const{leave:t,delayLeave:o}=s,r=()=>t(n,i);o?o(e.el,i,r):r()}else i()},G=(e,t)=>{let n;for(;e!==t;)n=p(e),o(e),e=n;o(t)},q=(e,t,n)=>{const{bum:o,scope:r,update:s,subTree:i,um:l}=e;o&&J(o),r.stop(),s&&(s.active=!1,W(i,e,t,n)),l&&mo(l,t),mo((()=>{e.isUnmounted=!0}),t),t&&t.pendingBranch&&!t.isUnmounted&&e.asyncDep&&!e.asyncResolved&&e.suspenseId===t.pendingId&&(t.deps--,0===t.deps&&t.resolve())},Y=(e,t,n,o=!1,r=!1,s=0)=>{for(let i=s;i6&e.shapeFlag?X(e.component.subTree):128&e.shapeFlag?e.suspense.next():p(e.anchor||e.el),ee=(e,t,n)=>{null==e?t._vnode&&W(t._vnode,null,null,!0):m(t._vnode||null,e,t,null,null,null,n),Yr(),t._vnode=e},ne={p:m,um:W,m:H,r:K,mt:F,mc:N,pc:B,pbc:$,n:X,o:e};let oe,re;return t&&([oe,re]=t(ne)),{render:ee,hydrate:oe,createApp:ao(ee,oe)}}function bo(e,t,n,o,r=!1){if(N(e))return void e.forEach(((e,s)=>bo(e,t&&(N(t)?t[s]:t),n,o,r)));if(hn(o)&&!r)return;const s=4&o.shapeFlag?xr(o.component)||o.component.proxy:o.el,i=r?null:s,{i:l,r:c}=e,a=t&&t.r,u=l.refs===g?l.refs={}:l.refs,p=l.setupState;if(null!=a&&a!==c&&(A(a)?(u[a]=null,T(p,a)&&(p[a]=null)):wt(a)&&(a.value=null)),A(c)){const e=()=>{u[c]=i,T(p,c)&&(p[c]=i)};i?(e.id=-1,mo(e,n)):e()}else if(wt(c)){const e=()=>{c.value=i};i?(e.id=-1,mo(e,n)):e()}else O(c)&&$r(c,l,12,[i,u])}function _o(e,t,n,o=null){Rr(e,t,7,[n,o])}function So(e,t,n=!1){const o=e.children,r=t.children;if(N(o)&&N(r))for(let s=0;se&&(e.disabled||""===e.disabled),Co=e=>"undefined"!=typeof SVGElement&&e instanceof SVGElement,wo=(e,t)=>{const n=e&&e.to;if(A(n)){if(t){return t(n)}return null}return n};function ko(e,t,n,{o:{insert:o},m:r},s=2){0===s&&o(e.targetAnchor,t,n);const{el:i,anchor:l,shapeFlag:c,children:a,props:u}=e,p=2===s;if(p&&o(i,t,n),(!p||xo(u))&&16&c)for(let f=0;f{16&v&&u(y,e,t,r,s,i,l,c)};g?b(n,a):p&&b(p,f)}else{t.el=e.el;const o=t.anchor=e.anchor,u=t.target=e.target,d=t.targetAnchor=e.targetAnchor,m=xo(e.props),v=m?n:u,y=m?o:d;if(i=i||Co(u),b?(f(e.dynamicChildren,b,v,r,s,i,l),So(e,t,!0)):c||p(e,t,v,y,r,s,i,l,!1),g)m||ko(t,n,o,a,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const e=t.target=wo(t.props,h);e&&ko(t,e,null,a,0)}else m&&ko(t,u,d,a,1)}},remove(e,t,n,o,{um:r,o:{remove:s}},i){const{shapeFlag:l,children:c,anchor:a,targetAnchor:u,target:p,props:f}=e;if(p&&s(u),(i||!xo(f))&&(s(a),16&l))for(let d=0;d0?Vo||v:null,Bo(),Lo>0&&Vo&&Vo.push(e),e}function Ho(e,t,n,o,r){return Uo(Jo(e,t,n,o,r,!0))}function Do(e){return!!e&&!0===e.__v_isVNode}function Wo(e,t){return e.type===t.type&&e.key===t.key}const zo="__vInternal",Ko=({key:e})=>null!=e?e:null,Go=({ref:e})=>null!=e?A(e)||wt(e)||O(e)?{i:jt,r:e}:e:null;function qo(e,t=null,n=null,o=0,r=null,s=(e===Oo?0:1),i=!1,l=!1){const c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Ko(t),ref:t&&Go(t),scopeId:Ut,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:s,patchFlag:o,dynamicProps:r,dynamicChildren:null,appContext:null};return l?(tr(c,n),128&s&&e.normalize(c)):n&&(c.shapeFlag|=A(n)?8:16),Lo>0&&!i&&Vo&&(c.patchFlag>0||6&s)&&32!==c.patchFlag&&Vo.push(c),c}const Jo=function(e,t=null,n=null,o=0,r=null,i=!1){e&&e!==Eo||(e=Fo);if(Do(e)){const o=Yo(e,t,!0);return n&&tr(o,n),o}l=e,O(l)&&"__vccOpts"in l&&(e=e.__vccOpts);var l;if(t){t=Zo(t);let{class:e,style:n}=t;e&&!A(e)&&(t.class=a(e)),M(n)&&(vt(n)&&!N(n)&&(n=C({},n)),t.style=s(n))}const c=A(e)?1:(e=>e.__isSuspense)(e)?128:(e=>e.__isTeleport)(e)?64:M(e)?4:O(e)?2:0;return qo(e,t,n,o,r,c,i,!0)};function Zo(e){return e?vt(e)||zo in e?C({},e):e:null}function Yo(e,t,n=!1){const{props:o,ref:r,patchFlag:s,children:i}=e,l=t?nr(o||{},t):o;return{__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&Ko(l),ref:t&&t.ref?n&&r?N(r)?r.concat(Go(t)):[r,Go(t)]:Go(t):r,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:i,target:e.target,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Oo?-1===s?16:16|s:s,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:e.transition,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Yo(e.ssContent),ssFallback:e.ssFallback&&Yo(e.ssFallback),el:e.el,anchor:e.anchor}}function Qo(e=" ",t=0){return Jo(Ao,null,e,t)}function Xo(e){return null==e||"boolean"==typeof e?Jo(Fo):N(e)?Jo(Oo,null,e.slice()):"object"==typeof e?er(e):Jo(Ao,null,String(e))}function er(e){return null===e.el||e.memo?e:Yo(e)}function tr(e,t){let n=0;const{shapeFlag:o}=e;if(null==t)t=null;else if(N(t))n=16;else if("object"==typeof t){if(65&o){const n=t.default;return void(n&&(n._c&&(n._d=!1),tr(e,n()),n._c&&(n._d=!0)))}{n=32;const o=t._;o||zo in t?3===o&&jt&&(1===jt.slots._?t._=1:(t._=2,e.patchFlag|=1024)):t._ctx=jt}}else O(t)?(t={default:t,_ctx:jt},n=32):(t=String(t),64&o?(n=16,t=[Qo(t)]):n=8);e.children=t,e.shapeFlag|=n}function nr(...e){const t={};for(let n=0;n!Do(e)||e.type!==Fo&&!(e.type===Oo&&!or(e.children))))?e:null}const rr=e=>e?hr(e)?xr(e)||e.proxy:rr(e.parent):null,sr=C(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>rr(e.parent),$root:e=>rr(e.root),$emit:e=>e.emit,$options:e=>Un(e),$forceUpdate:e=>()=>Kr(e.update),$nextTick:e=>zr.bind(e.proxy),$watch:e=>rs.bind(e)}),ir={get({_:e},t){const{ctx:n,setupState:o,data:r,props:s,accessCache:i,type:l,appContext:c}=e;let a;if("$"!==t[0]){const l=i[t];if(void 0!==l)switch(l){case 0:return o[t];case 1:return r[t];case 3:return n[t];case 2:return s[t]}else{if(o!==g&&T(o,t))return i[t]=0,o[t];if(r!==g&&T(r,t))return i[t]=1,r[t];if((a=e.propsOptions[0])&&T(a,t))return i[t]=2,s[t];if(n!==g&&T(n,t))return i[t]=3,n[t];In&&(i[t]=4)}}const u=sr[t];let p,f;return u?("$attrs"===t&&be(e,0,t),u(e)):(p=l.__cssModules)&&(p=p[t])?p:n!==g&&T(n,t)?(i[t]=3,n[t]):(f=c.config.globalProperties,T(f,t)?f[t]:void 0)},set({_:e},t,n){const{data:o,setupState:r,ctx:s}=e;if(r!==g&&T(r,t))r[t]=n;else if(o!==g&&T(o,t))o[t]=n;else if(T(e.props,t))return!1;return("$"!==t[0]||!(t.slice(1)in e))&&(s[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:o,appContext:r,propsOptions:s}},i){let l;return void 0!==n[i]||e!==g&&T(e,i)||t!==g&&T(t,i)||(l=s[0])&&T(l,i)||T(o,i)||T(sr,i)||T(r.config.globalProperties,i)}},lr=C({},ir,{get(e,t){if(t!==Symbol.unscopables)return ir.get(e,t,e)},has:(e,t)=>"_"!==t[0]&&!n(t)}),cr=lo();let ar=0;let ur=null;const pr=()=>ur||jt,fr=e=>{ur=e,e.scope.on()},dr=()=>{ur&&ur.scope.off(),ur=null};function hr(e){return 4&e.vnode.shapeFlag}let mr,gr,vr=!1;function yr(e,t,n){O(t)?e.render=t:M(t)&&(e.setupState=Rt(t)),_r(e,n)}function br(e){mr=e,gr=e=>{e.render._rc&&(e.withProxy=new Proxy(e.ctx,lr))}}function _r(e,t,n){const o=e.type;if(!e.render){if(!t&&mr&&!o.render){const t=o.template;if(t){const{isCustomElement:n,compilerOptions:r}=e.appContext.config,{delimiters:s,compilerOptions:i}=o,l=C(C({isCustomElement:n,delimiters:s},r),i);o.render=mr(t,l)}}e.render=o.render||y,gr&&gr(e)}fr(e),ve(),Bn(e),ye(),dr()}function Sr(e){const t=t=>{e.exposed=t||{}};let n;return{get attrs(){return n||(n=function(e){return new Proxy(e.attrs,{get:(t,n)=>(be(e,0,"$attrs"),t[n])})}(e))},slots:e.slots,emit:e.emit,expose:t}}function xr(e){if(e.exposed)return e.exposeProxy||(e.exposeProxy=new Proxy(Rt(bt(e.exposed)),{get:(t,n)=>n in t?t[n]:n in sr?sr[n](e):void 0}))}const Cr=/(?:^|[-_])(\w)/g;function wr(e){return O(e)&&e.displayName||e.name}function kr(e,t,n=!1){let o=wr(t);if(!o&&t.__file){const e=t.__file.match(/([^/\\]+)\.\w+$/);e&&(o=e[1])}if(!o&&e&&e.parent){const n=e=>{for(const n in e)if(e[n]===t)return n};o=n(e.components||e.parent.type.components)||n(e.appContext.components)}return o?o.replace(Cr,(e=>e.toUpperCase())).replace(/[-_]/g,""):n?"App":"Anonymous"}const Tr=[];function Nr(e){const t=[],n=Object.keys(e);return n.slice(0,3).forEach((n=>{t.push(...Er(n,e[n]))})),n.length>3&&t.push(" ..."),t}function Er(e,t,n){return A(t)?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):"number"==typeof t||"boolean"==typeof t||null==t?n?t:[`${e}=${t}`]:wt(t)?(t=Er(e,yt(t.value),!0),n?t:[`${e}=Ref<`,t,">"]):O(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=yt(t),n?t:[`${e}=`,t])}function $r(e,t,n,o){let r;try{r=o?e(...o):e()}catch(s){Or(s,t,n)}return r}function Rr(e,t,n,o){if(O(e)){const r=$r(e,t,n,o);return r&&P(r)&&r.catch((e=>{Or(e,t,n)})),r}const r=[];for(let s=0;s>>1;Qr(Mr[o])Qr(e)-Qr(t))),Ur=0;Urnull==e.id?1/0:e.id;function Xr(e){Fr=!1,Ar=!0,Zr(e),Mr.sort(((e,t)=>Qr(e)-Qr(t)));try{for(Pr=0;Pre.value,c=!!e._shallow):mt(e)?(i=()=>e,o=!0):N(e)?(a=!0,c=e.some(mt),i=()=>e.map((e=>wt(e)?e.value:mt(e)?is(e):O(e)?$r(e,s,2):void 0))):i=O(e)?t?()=>$r(e,s,2):()=>{if(!s||!s.isUnmounted)return l&&l(),Rr(e,s,3,[u])}:y,t&&o){const e=i;i=()=>is(e())}let u=e=>{l=h.onStop=()=>{$r(e,s,4)}},p=a?[]:ts;const f=()=>{if(h.active)if(t){const e=h.run();(o||c||(a?e.some(((e,t)=>q(e,p[t]))):q(e,p)))&&(l&&l(),Rr(t,s,3,[e,p===ts?void 0:p,u]),p=e)}else h.run()};let d;f.allowRecurse=!!t,d="sync"===r?f:"post"===r?()=>mo(f,s&&s.suspense):()=>{!s||s.isMounted?function(e){qr(e,Ir,Vr,Br)}(f):f()};const h=new de(i,d);return t?n?f():p=h.run():"post"===r?mo(h.run.bind(h),s&&s.suspense):h.run(),()=>{h.stop(),s&&s.scope&&w(s.scope.effects,h)}}function rs(e,t,n){const o=this.proxy,r=A(e)?e.includes(".")?ss(o,e):()=>o[e]:e.bind(o,o);let s;O(t)?s=t:(s=t.handler,n=t);const i=ur;fr(this);const l=os(r,s.bind(o),n);return i?fr(i):dr(),l}function ss(e,t){const n=t.split(".");return()=>{let t=e;for(let e=0;e{is(e,t)}));else if(B(e))for(const n in e)is(e[n],t);return e}function ls(){const e=pr();return e.setupContext||(e.setupContext=Sr(e))}function cs(e,t,n){const o=arguments.length;return 2===o?M(t)&&!N(t)?Do(t)?Jo(e,null,[t]):Jo(e,t):Jo(e,null,t):(o>3?n=Array.prototype.slice.call(arguments,2):3===o&&Do(n)&&(n=[n]),Jo(e,t,n))}const as=Symbol("");function us(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let o=0;o0&&Vo&&Vo.push(e),!0}const ps="3.2.18",fs="undefined"!=typeof document?document:null,ds=new Map,hs={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,o)=>{const r=t?fs.createElementNS("http://www.w3.org/2000/svg",e):fs.createElement(e,n?{is:n}:void 0);return"select"===e&&o&&null!=o.multiple&&r.setAttribute("multiple",o.multiple),r},createText:e=>fs.createTextNode(e),createComment:e=>fs.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>fs.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},cloneNode(e){const t=e.cloneNode(!0);return"_value"in e&&(t._value=e._value),t},insertStaticContent(e,t,n,o){const r=n?n.previousSibling:t.lastChild;let s=ds.get(e);if(!s){const t=fs.createElement("template");if(t.innerHTML=o?`${e}`:e,s=t.content,o){const e=s.firstChild;for(;e.firstChild;)s.appendChild(e.firstChild);s.removeChild(e)}ds.set(e,s)}return t.insertBefore(s.cloneNode(!0),n),[r?r.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}};const ms=/\s*!important$/;function gs(e,t,n){if(N(n))n.forEach((n=>gs(e,t,n)));else if(t.startsWith("--"))e.setProperty(t,n);else{const o=function(e,t){const n=ys[t];if(n)return n;let o=D(t);if("filter"!==o&&o in e)return ys[t]=o;o=K(o);for(let r=0;rdocument.createEvent("Event").timeStamp&&(_s=()=>performance.now());const e=navigator.userAgent.match(/firefox\/(\d+)/i);Ss=!!(e&&Number(e[1])<=53)}let xs=0;const Cs=Promise.resolve(),ws=()=>{xs=0};function ks(e,t,n,o){e.addEventListener(t,n,o)}function Ts(e,t,n,o,r=null){const s=e._vei||(e._vei={}),i=s[t];if(o&&i)i.value=o;else{const[n,l]=function(e){let t;if(Ns.test(e)){let n;for(t={};n=e.match(Ns);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[z(e.slice(2)),t]}(t);if(o){ks(e,n,s[t]=function(e,t){const n=e=>{const o=e.timeStamp||_s();(Ss||o>=n.attached-1)&&Rr(function(e,t){if(N(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map((e=>t=>!t._stopped&&e(t)))}return t}(e,n.value),t,5,[e])};return n.value=e,n.attached=(()=>xs||(Cs.then(ws),xs=_s()))(),n}(o,r),l)}else i&&(!function(e,t,n,o){e.removeEventListener(t,n,o)}(e,n,i,l),s[t]=void 0)}}const Ns=/(?:Once|Passive|Capture)$/;const Es=/^on[a-z]/;function $s(e,t){const n=dn(e);class o extends Os{constructor(e){super(n,e,t)}}return o.def=n,o}const Rs="undefined"!=typeof HTMLElement?HTMLElement:class{};class Os extends Rs{constructor(e,t={},n){super(),this._def=e,this._props=t,this._instance=null,this._connected=!1,this._resolved=!1,this._numberProps=null,this.shadowRoot&&n?n(this._createVNode(),this.shadowRoot):this.attachShadow({mode:"open"});for(let o=0;o{for(const t of e)this._setAttr(t.attributeName)})).observe(this,{attributes:!0})}connectedCallback(){this._connected=!0,this._instance||(this._resolveDef(),this._update())}disconnectedCallback(){this._connected=!1,zr((()=>{this._connected||(Ni(null,this.shadowRoot),this._instance=null)}))}_resolveDef(){if(this._resolved)return;const e=e=>{this._resolved=!0;const{props:t,styles:n}=e,o=!N(t),r=t?o?Object.keys(t):t:[];let s;if(o)for(const i in this._props){const e=t[i];(e===Number||e&&e.type===Number)&&(this._props[i]=Y(this._props[i]),(s||(s=Object.create(null)))[i]=!0)}s&&(this._numberProps=s,this._update());for(const i of Object.keys(this))"_"!==i[0]&&this._setProp(i,this[i]);for(const i of r.map(D))Object.defineProperty(this,i,{get(){return this._getProp(i)},set(e){this._setProp(i,e)}});this._applyStyles(n)},t=this._def.__asyncLoader;t?t().then(e):e(this._def)}_setAttr(e){let t=this.getAttribute(e);this._numberProps&&this._numberProps[e]&&(t=Y(t)),this._setProp(D(e),t,!1)}_getProp(e){return this._props[e]}_setProp(e,t,n=!0){t!==this._props[e]&&(this._props[e]=t,this._instance&&this._update(),n&&(!0===t?this.setAttribute(z(e),""):"string"==typeof t||"number"==typeof t?this.setAttribute(z(e),t+""):t||this.removeAttribute(z(e))))}_update(){Ni(this._createVNode(),this.shadowRoot)}_createVNode(){const e=Jo(this._def,C({},this._props));return this._instance||(e.ce=e=>{this._instance=e,e.isCE=!0,e.emit=(e,...t)=>{this.dispatchEvent(new CustomEvent(e,{detail:t}))};let t=this;for(;t=t&&(t.parentNode||t.host);)if(t instanceof Os){e.parent=t._instance;break}}),e}_applyStyles(e){e&&e.forEach((e=>{const t=document.createElement("style");t.textContent=e,this.shadowRoot.appendChild(t)}))}}function As(e,t){if(128&e.shapeFlag){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push((()=>{As(n.activeBranch,t)}))}for(;e.component;)e=e.component.subTree;if(1&e.shapeFlag&&e.el)Fs(e.el,t);else if(e.type===Oo)e.children.forEach((e=>As(e,t)));else if(e.type===Mo){let{el:n,anchor:o}=e;for(;n&&(Fs(n,t),n!==o);)n=n.nextSibling}}function Fs(e,t){if(1===e.nodeType){const n=e.style;for(const e in t)n.setProperty(`--${e}`,t[e])}}const Ms="transition",Ps="animation",Vs=(e,{slots:t})=>cs(sn,Us(e),t);Vs.displayName="Transition";const Is={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},Bs=Vs.props=C({},sn.props,Is),Ls=(e,t=[])=>{N(e)?e.forEach((e=>e(...t))):e&&e(...t)},js=e=>!!e&&(N(e)?e.some((e=>e.length>1)):e.length>1);function Us(e){const t={};for(const C in e)C in Is||(t[C]=e[C]);if(!1===e.css)return t;const{name:n="v",type:o,duration:r,enterFromClass:s=`${n}-enter-from`,enterActiveClass:i=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:c=s,appearActiveClass:a=i,appearToClass:u=l,leaveFromClass:p=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:d=`${n}-leave-to`}=e,h=function(e){if(null==e)return null;if(M(e))return[Hs(e.enter),Hs(e.leave)];{const t=Hs(e);return[t,t]}}(r),m=h&&h[0],g=h&&h[1],{onBeforeEnter:v,onEnter:y,onEnterCancelled:b,onLeave:_,onLeaveCancelled:S,onBeforeAppear:x=v,onAppear:w=y,onAppearCancelled:k=b}=t,T=(e,t,n)=>{Ws(e,t?u:l),Ws(e,t?a:i),n&&n()},N=(e,t)=>{Ws(e,d),Ws(e,f),t&&t()},E=e=>(t,n)=>{const r=e?w:y,i=()=>T(t,e,n);Ls(r,[t,i]),zs((()=>{Ws(t,e?c:s),Ds(t,e?u:l),js(r)||Gs(t,o,m,i)}))};return C(t,{onBeforeEnter(e){Ls(v,[e]),Ds(e,s),Ds(e,i)},onBeforeAppear(e){Ls(x,[e]),Ds(e,c),Ds(e,a)},onEnter:E(!1),onAppear:E(!0),onLeave(e,t){const n=()=>N(e,t);Ds(e,p),Ys(),Ds(e,f),zs((()=>{Ws(e,p),Ds(e,d),js(_)||Gs(e,o,g,n)})),Ls(_,[e,n])},onEnterCancelled(e){T(e,!1),Ls(b,[e])},onAppearCancelled(e){T(e,!0),Ls(k,[e])},onLeaveCancelled(e){N(e),Ls(S,[e])}})}function Hs(e){return Y(e)}function Ds(e,t){t.split(/\s+/).forEach((t=>t&&e.classList.add(t))),(e._vtc||(e._vtc=new Set)).add(t)}function Ws(e,t){t.split(/\s+/).forEach((t=>t&&e.classList.remove(t)));const{_vtc:n}=e;n&&(n.delete(t),n.size||(e._vtc=void 0))}function zs(e){requestAnimationFrame((()=>{requestAnimationFrame(e)}))}let Ks=0;function Gs(e,t,n,o){const r=e._endId=++Ks,s=()=>{r===e._endId&&o()};if(n)return setTimeout(s,n);const{type:i,timeout:l,propCount:c}=qs(e,t);if(!i)return o();const a=i+"end";let u=0;const p=()=>{e.removeEventListener(a,f),s()},f=t=>{t.target===e&&++u>=c&&p()};setTimeout((()=>{u(n[e]||"").split(", "),r=o("transitionDelay"),s=o("transitionDuration"),i=Js(r,s),l=o("animationDelay"),c=o("animationDuration"),a=Js(l,c);let u=null,p=0,f=0;t===Ms?i>0&&(u=Ms,p=i,f=s.length):t===Ps?a>0&&(u=Ps,p=a,f=c.length):(p=Math.max(i,a),u=p>0?i>a?Ms:Ps:null,f=u?u===Ms?s.length:c.length:0);return{type:u,timeout:p,propCount:f,hasTransform:u===Ms&&/\b(transform|all)(,|$)/.test(n.transitionProperty)}}function Js(e,t){for(;e.lengthZs(t)+Zs(e[n]))))}function Zs(e){return 1e3*Number(e.slice(0,-1).replace(",","."))}function Ys(){return document.body.offsetHeight}const Qs=new WeakMap,Xs=new WeakMap,ei={name:"TransitionGroup",props:C({},Bs,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=pr(),o=on();let r,s;return Rn((()=>{if(!r.length)return;const t=e.moveClass||`${e.name||"v"}-move`;if(!function(e,t,n){const o=e.cloneNode();e._vtc&&e._vtc.forEach((e=>{e.split(/\s+/).forEach((e=>e&&o.classList.remove(e)))}));n.split(/\s+/).forEach((e=>e&&o.classList.add(e))),o.style.display="none";const r=1===t.nodeType?t:t.parentNode;r.appendChild(o);const{hasTransform:s}=qs(o);return r.removeChild(o),s}(r[0].el,n.vnode.el,t))return;r.forEach(ti),r.forEach(ni);const o=r.filter(oi);Ys(),o.forEach((e=>{const n=e.el,o=n.style;Ds(n,t),o.transform=o.webkitTransform=o.transitionDuration="";const r=n._moveCb=e=>{e&&e.target!==n||e&&!/transform$/.test(e.propertyName)||(n.removeEventListener("transitionend",r),n._moveCb=null,Ws(n,t))};n.addEventListener("transitionend",r)}))})),()=>{const i=yt(e),l=Us(i);let c=i.tag||Oo;r=s,s=t.default?fn(t.default()):[];for(let e=0;e{const t=e.props["onUpdate:modelValue"];return N(t)?e=>J(t,e):t};function si(e){e.target.composing=!0}function ii(e){const t=e.target;t.composing&&(t.composing=!1,function(e,t){const n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}(t,"input"))}const li={created(e,{modifiers:{lazy:t,trim:n,number:o}},r){e._assign=ri(r);const s=o||r.props&&"number"===r.props.type;ks(e,t?"change":"input",(t=>{if(t.target.composing)return;let o=e.value;n?o=o.trim():s&&(o=Y(o)),e._assign(o)})),n&&ks(e,"change",(()=>{e.value=e.value.trim()})),t||(ks(e,"compositionstart",si),ks(e,"compositionend",ii),ks(e,"change",ii))},mounted(e,{value:t}){e.value=null==t?"":t},beforeUpdate(e,{value:t,modifiers:{lazy:n,trim:o,number:r}},s){if(e._assign=ri(s),e.composing)return;if(document.activeElement===e){if(n)return;if(o&&e.value.trim()===t)return;if((r||"number"===e.type)&&Y(e.value)===t)return}const i=null==t?"":t;e.value!==i&&(e.value=i)}},ci={deep:!0,created(e,t,n){e._assign=ri(n),ks(e,"change",(()=>{const t=e._modelValue,n=di(e),o=e.checked,r=e._assign;if(N(t)){const e=h(t,n),s=-1!==e;if(o&&!s)r(t.concat(n));else if(!o&&s){const n=[...t];n.splice(e,1),r(n)}}else if($(t)){const e=new Set(t);o?e.add(n):e.delete(n),r(e)}else r(hi(e,o))}))},mounted:ai,beforeUpdate(e,t,n){e._assign=ri(n),ai(e,t,n)}};function ai(e,{value:t,oldValue:n},o){e._modelValue=t,N(t)?e.checked=h(t,o.props.value)>-1:$(t)?e.checked=t.has(o.props.value):t!==n&&(e.checked=d(t,hi(e,!0)))}const ui={created(e,{value:t},n){e.checked=d(t,n.props.value),e._assign=ri(n),ks(e,"change",(()=>{e._assign(di(e))}))},beforeUpdate(e,{value:t,oldValue:n},o){e._assign=ri(o),t!==n&&(e.checked=d(t,o.props.value))}},pi={deep:!0,created(e,{value:t,modifiers:{number:n}},o){const r=$(t);ks(e,"change",(()=>{const t=Array.prototype.filter.call(e.options,(e=>e.selected)).map((e=>n?Y(di(e)):di(e)));e._assign(e.multiple?r?new Set(t):t:t[0])})),e._assign=ri(o)},mounted(e,{value:t}){fi(e,t)},beforeUpdate(e,t,n){e._assign=ri(n)},updated(e,{value:t}){fi(e,t)}};function fi(e,t){const n=e.multiple;if(!n||N(t)||$(t)){for(let o=0,r=e.options.length;o-1:t.has(s);else if(d(di(r),t))return void(e.selectedIndex!==o&&(e.selectedIndex=o))}n||-1===e.selectedIndex||(e.selectedIndex=-1)}}function di(e){return"_value"in e?e._value:e.value}function hi(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const mi={created(e,t,n){gi(e,t,n,null,"created")},mounted(e,t,n){gi(e,t,n,null,"mounted")},beforeUpdate(e,t,n,o){gi(e,t,n,o,"beforeUpdate")},updated(e,t,n,o){gi(e,t,n,o,"updated")}};function gi(e,t,n,o,r){let s;switch(e.tagName){case"SELECT":s=pi;break;case"TEXTAREA":s=li;break;default:switch(n.props&&n.props.type){case"checkbox":s=ci;break;case"radio":s=ui;break;default:s=li}}const i=s[r];i&&i(e,t,n,o)}const vi=["ctrl","shift","alt","meta"],yi={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&0!==e.button,middle:e=>"button"in e&&1!==e.button,right:e=>"button"in e&&2!==e.button,exact:(e,t)=>vi.some((n=>e[`${n}Key`]&&!t.includes(n)))},bi={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},_i={beforeMount(e,{value:t},{transition:n}){e._vod="none"===e.style.display?"":e.style.display,n&&t?n.beforeEnter(e):Si(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:o}){!t!=!n&&(o?t?(o.beforeEnter(e),Si(e,!0),o.enter(e)):o.leave(e,(()=>{Si(e,!1)})):Si(e,t))},beforeUnmount(e,{value:t}){Si(e,t)}};function Si(e,t){e.style.display=t?e._vod:"none"}const xi=C({patchProp:(e,t,n,s,i=!1,l,c,a,u)=>{"class"===t?function(e,t,n){const o=e._vtc;o&&(t=(t?[t,...o]:[...o]).join(" ")),null==t?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}(e,s,i):"style"===t?function(e,t,n){const o=e.style,r=o.display;if(n)if(A(n))t!==n&&(o.cssText=n);else{for(const e in n)gs(o,e,n[e]);if(t&&!A(t))for(const e in t)null==n[e]&&gs(o,e,"")}else e.removeAttribute("style");"_vod"in e&&(o.display=r)}(e,n,s):S(t)?x(t)||Ts(e,t,0,s,c):("."===t[0]?(t=t.slice(1),1):"^"===t[0]?(t=t.slice(1),0):function(e,t,n,o){if(o)return"innerHTML"===t||"textContent"===t||!!(t in e&&Es.test(t)&&O(n));if("spellcheck"===t||"draggable"===t)return!1;if("form"===t)return!1;if("list"===t&&"INPUT"===e.tagName)return!1;if("type"===t&&"TEXTAREA"===e.tagName)return!1;if(Es.test(t)&&A(n))return!1;return t in e}(e,t,s,i))?function(e,t,n,o,s,i,l){if("innerHTML"===t||"textContent"===t)return o&&l(o,s,i),void(e[t]=null==n?"":n);if("value"===t&&"PROGRESS"!==e.tagName){e._value=n;const o=null==n?"":n;return e.value!==o&&(e.value=o),void(null==n&&e.removeAttribute(t))}if(""===n||null==n){const o=typeof e[t];if("boolean"===o)return void(e[t]=r(n));if(null==n&&"string"===o)return e[t]="",void e.removeAttribute(t);if("number"===o){try{e[t]=0}catch(c){}return void e.removeAttribute(t)}}try{e[t]=n}catch(a){}}(e,t,s,l,c,a,u):("true-value"===t?e._trueValue=s:"false-value"===t&&(e._falseValue=s),function(e,t,n,s,i){if(s&&t.startsWith("xlink:"))null==n?e.removeAttributeNS(bs,t.slice(6,t.length)):e.setAttributeNS(bs,t,n);else{const s=o(t);null==n||s&&!r(n)?e.removeAttribute(t):e.setAttribute(t,s?"":n)}}(e,t,s,i))}},hs);let Ci,wi=!1;function ki(){return Ci||(Ci=go(xi))}function Ti(){return Ci=wi?Ci:vo(xi),wi=!0,Ci}const Ni=(...e)=>{ki().render(...e)},Ei=(...e)=>{Ti().hydrate(...e)};function $i(e){if(A(e)){return document.querySelector(e)}return e}const Ri=y;function Oi(e){throw e}function Ai(e){}function Fi(e,t,n,o){const r=new SyntaxError(String(e));return r.code=e,r.loc=t,r}const Mi=Symbol(""),Pi=Symbol(""),Vi=Symbol(""),Ii=Symbol(""),Bi=Symbol(""),Li=Symbol(""),ji=Symbol(""),Ui=Symbol(""),Hi=Symbol(""),Di=Symbol(""),Wi=Symbol(""),zi=Symbol(""),Ki=Symbol(""),Gi=Symbol(""),qi=Symbol(""),Ji=Symbol(""),Zi=Symbol(""),Yi=Symbol(""),Qi=Symbol(""),Xi=Symbol(""),el=Symbol(""),tl=Symbol(""),nl=Symbol(""),ol=Symbol(""),rl=Symbol(""),sl=Symbol(""),il=Symbol(""),ll=Symbol(""),cl=Symbol(""),al=Symbol(""),ul=Symbol(""),pl=Symbol(""),fl=Symbol(""),dl=Symbol(""),hl=Symbol(""),ml=Symbol(""),gl=Symbol(""),vl=Symbol(""),yl=Symbol(""),bl={[Mi]:"Fragment",[Pi]:"Teleport",[Vi]:"Suspense",[Ii]:"KeepAlive",[Bi]:"BaseTransition",[Li]:"openBlock",[ji]:"createBlock",[Ui]:"createElementBlock",[Hi]:"createVNode",[Di]:"createElementVNode",[Wi]:"createCommentVNode",[zi]:"createTextVNode",[Ki]:"createStaticVNode",[Gi]:"resolveComponent",[qi]:"resolveDynamicComponent",[Ji]:"resolveDirective",[Zi]:"resolveFilter",[Yi]:"withDirectives",[Qi]:"renderList",[Xi]:"renderSlot",[el]:"createSlots",[tl]:"toDisplayString",[nl]:"mergeProps",[ol]:"normalizeClass",[rl]:"normalizeStyle",[sl]:"normalizeProps",[il]:"guardReactiveProps",[ll]:"toHandlers",[cl]:"camelize",[al]:"capitalize",[ul]:"toHandlerKey",[pl]:"setBlockTracking",[fl]:"pushScopeId",[dl]:"popScopeId",[hl]:"withCtx",[ml]:"unref",[gl]:"isRef",[vl]:"withMemo",[yl]:"isMemoSame"};const _l={source:"",start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0}};function Sl(e,t,n,o,r,s,i,l=!1,c=!1,a=!1,u=_l){return e&&(l?(e.helper(Li),e.helper(Zl(e.inSSR,a))):e.helper(Jl(e.inSSR,a)),i&&e.helper(Yi)),{type:13,tag:t,props:n,children:o,patchFlag:r,dynamicProps:s,directives:i,isBlock:l,disableTracking:c,isComponent:a,loc:u}}function xl(e,t=_l){return{type:17,loc:t,elements:e}}function Cl(e,t=_l){return{type:15,loc:t,properties:e}}function wl(e,t){return{type:16,loc:_l,key:A(e)?kl(e,!0):e,value:t}}function kl(e,t=!1,n=_l,o=0){return{type:4,loc:n,content:e,isStatic:t,constType:t?3:o}}function Tl(e,t=_l){return{type:8,loc:t,children:e}}function Nl(e,t=[],n=_l){return{type:14,loc:n,callee:e,arguments:t}}function El(e,t,n=!1,o=!1,r=_l){return{type:18,params:e,returns:t,newline:n,isSlot:o,loc:r}}function $l(e,t,n,o=!0){return{type:19,test:e,consequent:t,alternate:n,newline:o,loc:_l}}const Rl=e=>4===e.type&&e.isStatic,Ol=(e,t)=>e===t||e===z(t);function Al(e){return Ol(e,"Teleport")?Pi:Ol(e,"Suspense")?Vi:Ol(e,"KeepAlive")?Ii:Ol(e,"BaseTransition")?Bi:void 0}const Fl=/^\d|[^\$\w]/,Ml=e=>!Fl.test(e),Pl=/[A-Za-z_$\xA0-\uFFFF]/,Vl=/[\.\?\w$\xA0-\uFFFF]/,Il=/\s+[.[]\s*|\s*[.[]\s+/g,Bl=e=>{e=e.trim().replace(Il,(e=>e.trim()));let t=0,n=[],o=0,r=0,s=null;for(let i=0;i4===e.key.type&&e.key.content===n))}e||s.properties.unshift(t),o=s}else o=Nl(n.helper(nl),[Cl([t]),s]),r&&r.callee===il&&(r=i[i.length-2]);13===e.type?r?r.arguments[0]=o:e.props=o:r?r.arguments[0]=o:e.arguments[2]=o}function ec(e,t){return`_${t}_${e.replace(/[^\w]/g,((t,n)=>"-"===t?"_":e.charCodeAt(n).toString()))}`}function tc(e,{helper:t,removeHelper:n,inSSR:o}){e.isBlock||(e.isBlock=!0,n(Jl(o,e.isComponent)),t(Li),t(Zl(o,e.isComponent)))}const nc=/&(gt|lt|amp|apos|quot);/g,oc={gt:">",lt:"<",amp:"&",apos:"'",quot:'"'},rc={delimiters:["{{","}}"],getNamespace:()=>0,getTextMode:()=>0,isVoidTag:b,isPreTag:b,isCustomElement:b,decodeEntities:e=>e.replace(nc,((e,t)=>oc[t])),onError:Oi,onWarn:Ai,comments:!1};function sc(e,t={}){const n=function(e,t){const n=C({},rc);let o;for(o in t)n[o]=void 0===t[o]?rc[o]:t[o];return{options:n,column:1,line:1,offset:0,originalSource:e,source:e,inPre:!1,inVPre:!1,onWarn:n.onWarn}}(e,t),o=bc(n);return function(e,t=_l){return{type:0,children:e,helpers:[],components:[],directives:[],hoists:[],imports:[],cached:0,temps:0,codegenNode:void 0,loc:t}}(ic(n,0,[]),_c(n,o))}function ic(e,t,n){const o=Sc(n),r=o?o.ns:0,s=[];for(;!Tc(e,t,n);){const i=e.source;let l;if(0===t||1===t)if(!e.inVPre&&xc(i,e.options.delimiters[0]))l=gc(e,t);else if(0===t&&"<"===i[0])if(1===i.length);else if("!"===i[1])l=xc(i,"\x3c!--")?ac(e):xc(i,""===i[2]){Cc(e,3);continue}if(/[a-z]/i.test(i[2])){dc(e,1,o);continue}l=uc(e)}else/[a-z]/i.test(i[1])?l=pc(e,n):"?"===i[1]&&(l=uc(e));if(l||(l=vc(e,t)),N(l))for(let e=0;e/.exec(e.source);if(o){n=e.source.slice(4,o.index);const t=e.source.slice(0,o.index);let r=1,s=0;for(;-1!==(s=t.indexOf("\x3c!--",r));)Cc(e,s-r+1),r=s+1;Cc(e,o.index+o[0].length-r+1)}else n=e.source.slice(4),Cc(e,e.source.length);return{type:3,content:n,loc:_c(e,t)}}function uc(e){const t=bc(e),n="?"===e.source[1]?1:2;let o;const r=e.source.indexOf(">");return-1===r?(o=e.source.slice(n),Cc(e,e.source.length)):(o=e.source.slice(n,r),Cc(e,r+1)),{type:3,content:o,loc:_c(e,t)}}function pc(e,t){const n=e.inPre,o=e.inVPre,r=Sc(t),s=dc(e,0,r),i=e.inPre&&!n,l=e.inVPre&&!o;if(s.isSelfClosing||e.options.isVoidTag(s.tag))return i&&(e.inPre=!1),l&&(e.inVPre=!1),s;t.push(s);const c=e.options.getTextMode(s,r),a=ic(e,c,t);if(t.pop(),s.children=a,Nc(e.source,s.tag))dc(e,1,r);else if(0===e.source.length&&"script"===s.tag.toLowerCase()){const e=a[0];e&&xc(e.loc.source,"\x3c!--")}return s.loc=_c(e,s.loc.start),i&&(e.inPre=!1),l&&(e.inVPre=!1),s}const fc=t("if,else,else-if,for,slot");function dc(e,t,n){const o=bc(e),r=/^<\/?([a-z][^\t\r\n\f />]*)/i.exec(e.source),s=r[1],i=e.options.getNamespace(s,n);Cc(e,r[0].length),wc(e);const l=bc(e),c=e.source;e.options.isPreTag(s)&&(e.inPre=!0);let a=hc(e,t);0===t&&!e.inVPre&&a.some((e=>7===e.type&&"pre"===e.name))&&(e.inVPre=!0,C(e,l),e.source=c,a=hc(e,t).filter((e=>"v-pre"!==e.name)));let u=!1;if(0===e.source.length||(u=xc(e.source,"/>"),Cc(e,u?2:1)),1===t)return;let p=0;return e.inVPre||("slot"===s?p=2:"template"===s?a.some((e=>7===e.type&&fc(e.name)))&&(p=3):function(e,t,n){const o=n.options;if(o.isCustomElement(e))return!1;if("component"===e||/^[A-Z]/.test(e)||Al(e)||o.isBuiltInComponent&&o.isBuiltInComponent(e)||o.isNativeTag&&!o.isNativeTag(e))return!0;for(let r=0;r0&&!xc(e.source,">")&&!xc(e.source,"/>");){if(xc(e.source,"/")){Cc(e,1),wc(e);continue}const r=mc(e,o);6===r.type&&r.value&&"class"===r.name&&(r.value.content=r.value.content.replace(/\s+/g," ").trim()),0===t&&n.push(r),/^[^\t\r\n\f />]/.test(e.source),wc(e)}return n}function mc(e,t){const n=bc(e),o=/^[^\t\r\n\f />][^\t\r\n\f />=]*/.exec(e.source)[0];t.has(o),t.add(o);{const e=/["'<]/g;let t;for(;t=e.exec(o););}let r;Cc(e,o.length),/^[\t\r\n\f ]*=/.test(e.source)&&(wc(e),Cc(e,1),wc(e),r=function(e){const t=bc(e);let n;const o=e.source[0],r='"'===o||"'"===o;if(r){Cc(e,1);const t=e.source.indexOf(o);-1===t?n=yc(e,e.source.length,4):(n=yc(e,t,4),Cc(e,1))}else{const t=/^[^\t\r\n\f >]+/.exec(e.source);if(!t)return;const o=/["'<=`]/g;let r;for(;r=o.exec(t[0]););n=yc(e,t[0].length,4)}return{content:n,isQuoted:r,loc:_c(e,t)}}(e));const s=_c(e,n);if(!e.inVPre&&/^(v-[A-Za-z0-9-]|:|\.|@|#)/.test(o)){const t=/(?:^v-([a-z0-9-]+))?(?:(?::|^\.|^@|^#)(\[[^\]]+\]|[^\.]+))?(.+)?$/i.exec(o);let i,l=xc(o,"."),c=t[1]||(l||xc(o,":")?"bind":xc(o,"@")?"on":"slot");if(t[2]){const r="slot"===c,s=o.lastIndexOf(t[2]),l=_c(e,kc(e,n,s),kc(e,n,s+t[2].length+(r&&t[3]||"").length));let a=t[2],u=!0;a.startsWith("[")?(u=!1,a=a.endsWith("]")?a.substr(1,a.length-2):a.substr(1)):r&&(a+=t[3]||""),i={type:4,content:a,isStatic:u,constType:u?3:0,loc:l}}if(r&&r.isQuoted){const e=r.loc;e.start.offset++,e.start.column++,e.end=jl(e.start,r.content),e.source=e.source.slice(1,-1)}const a=t[3]?t[3].substr(1).split("."):[];return l&&a.push("prop"),{type:7,name:c,exp:r&&{type:4,content:r.content,isStatic:!1,constType:0,loc:r.loc},arg:i,modifiers:a,loc:s}}return!e.inVPre&&xc(o,"v-"),{type:6,name:o,value:r&&{type:2,content:r.content,loc:r.loc},loc:s}}function gc(e,t){const[n,o]=e.options.delimiters,r=e.source.indexOf(o,n.length);if(-1===r)return;const s=bc(e);Cc(e,n.length);const i=bc(e),l=bc(e),c=r-n.length,a=e.source.slice(0,c),u=yc(e,c,t),p=u.trim(),f=u.indexOf(p);f>0&&Ul(i,a,f);return Ul(l,a,c-(u.length-p.length-f)),Cc(e,o.length),{type:5,content:{type:4,isStatic:!1,constType:0,content:p,loc:_c(e,i,l)},loc:_c(e,s)}}function vc(e,t){const n=3===t?["]]>"]:["<",e.options.delimiters[0]];let o=e.source.length;for(let s=0;st&&(o=t)}const r=bc(e);return{type:2,content:yc(e,o,t),loc:_c(e,r)}}function yc(e,t,n){const o=e.source.slice(0,t);return Cc(e,t),2===n||3===n||-1===o.indexOf("&")?o:e.options.decodeEntities(o,4===n)}function bc(e){const{column:t,line:n,offset:o}=e;return{column:t,line:n,offset:o}}function _c(e,t,n){return{start:t,end:n=n||bc(e),source:e.originalSource.slice(t.offset,n.offset)}}function Sc(e){return e[e.length-1]}function xc(e,t){return e.startsWith(t)}function Cc(e,t){const{source:n}=e;Ul(e,n,t),e.source=n.slice(t)}function wc(e){const t=/^[\t\r\n\f ]+/.exec(e.source);t&&Cc(e,t[0].length)}function kc(e,t,n){return jl(t,e.originalSource.slice(t.offset,n),n)}function Tc(e,t,n){const o=e.source;switch(t){case 0:if(xc(o,"=0;--e)if(Nc(o,n[e].tag))return!0;break;case 1:case 2:{const e=Sc(n);if(e&&Nc(o,e.tag))return!0;break}case 3:if(xc(o,"]]>"))return!0}return!o}function Nc(e,t){return xc(e,"]/.test(e[2+t.length]||">")}function Ec(e,t){Rc(e,t,$c(e,e.children[0]))}function $c(e,t){const{children:n}=e;return 1===n.length&&1===t.type&&!ql(t)}function Rc(e,t,n=!1){let o=!0;const{children:r}=e,s=r.length;let i=0;for(let l=0;l0){if(r<3&&(o=!1),r>=2){e.codegenNode.patchFlag="-1",e.codegenNode=t.hoist(e.codegenNode),i++;continue}}else{const n=e.codegenNode;if(13===n.type){const o=Vc(n);if((!o||512===o||1===o)&&Mc(e,t)>=2){const o=Pc(e);o&&(n.props=t.hoist(o))}n.dynamicProps&&(n.dynamicProps=t.hoist(n.dynamicProps))}}}else if(12===e.type){const n=Oc(e.content,t);n>0&&(n<3&&(o=!1),n>=2&&(e.codegenNode=t.hoist(e.codegenNode),i++))}if(1===e.type){const n=1===e.tagType;n&&t.scopes.vSlot++,Rc(e,t),n&&t.scopes.vSlot--}else if(11===e.type)Rc(e,t,1===e.children.length);else if(9===e.type)for(let n=0;n1)for(let r=0;r`_${bl[k.helper(e)]}`,replaceNode(e){k.parent.children[k.childIndex]=k.currentNode=e},removeNode(e){const t=e?k.parent.children.indexOf(e):k.currentNode?k.childIndex:-1;e&&e!==k.currentNode?k.childIndex>t&&(k.childIndex--,k.onNodeRemoved()):(k.currentNode=null,k.onNodeRemoved()),k.parent.children.splice(t,1)},onNodeRemoved:()=>{},addIdentifiers(e){},removeIdentifiers(e){},hoist(e){A(e)&&(e=kl(e)),k.hoists.push(e);const t=kl(`_hoisted_${k.hoists.length}`,!1,e.loc,2);return t.hoisted=e,t},cache:(e,t=!1)=>function(e,t,n=!1){return{type:20,index:e,value:t,isVNode:n,loc:_l}}(k.cached++,e,t)};return k}function Bc(e,t){const n=Ic(e,t);Lc(e,n),t.hoistStatic&&Ec(e,n),t.ssr||function(e,t){const{helper:n}=t,{children:o}=e;if(1===o.length){const n=o[0];if($c(e,n)&&n.codegenNode){const o=n.codegenNode;13===o.type&&tc(o,t),e.codegenNode=o}else e.codegenNode=n}else if(o.length>1){let o=64;e.codegenNode=Sl(t,n(Mi),void 0,e.children,o+"",void 0,void 0,!0,void 0,!1)}}(e,n),e.helpers=[...n.helpers.keys()],e.components=[...n.components],e.directives=[...n.directives],e.imports=n.imports,e.hoists=n.hoists,e.temps=n.temps,e.cached=n.cached}function Lc(e,t){t.currentNode=e;const{nodeTransforms:n}=t,o=[];for(let s=0;s{n--};for(;nt===e:t=>e.test(t);return(e,o)=>{if(1===e.type){const{props:r}=e;if(3===e.tagType&&r.some(Kl))return;const s=[];for(let i=0;i`_${bl[e]}`,push(e,t){d.code+=e},indent(){h(++d.indentLevel)},deindent(e=!1){e?--d.indentLevel:h(--d.indentLevel)},newline(){h(d.indentLevel)}};function h(e){d.push("\n"+" ".repeat(e))}return d}(e,t);t.onContextCreated&&t.onContextCreated(n);const{mode:o,push:r,prefixIdentifiers:s,indent:i,deindent:l,newline:c,ssr:a}=n,u=e.helpers.length>0,p=!s&&"module"!==o;!function(e,t){const{push:n,newline:o,runtimeGlobalName:r}=t,s=r,i=e=>`${bl[e]}: _${bl[e]}`;if(e.helpers.length>0&&(n(`const _Vue = ${s}\n`),e.hoists.length)){n(`const { ${[Hi,Di,Wi,zi,Ki].filter((t=>e.helpers.includes(t))).map(i).join(", ")} } = _Vue\n`)}(function(e,t){if(!e.length)return;t.pure=!0;const{push:n,newline:o}=t;o();for(let r=0;r`${bl[e]}: _${bl[e]}`)).join(", ")} } = _Vue`),r("\n"),c())),e.components.length&&(Dc(e.components,"component",n),(e.directives.length||e.temps>0)&&c()),e.directives.length&&(Dc(e.directives,"directive",n),e.temps>0&&c()),e.temps>0){r("let ");for(let t=0;t0?", ":""}_temp${t}`)}return(e.components.length||e.directives.length||e.temps)&&(r("\n"),c()),a||r("return "),e.codegenNode?Kc(e.codegenNode,n):r("null"),p&&(l(),r("}")),l(),r("}"),{ast:e,code:n.code,preamble:"",map:n.map?n.map.toJSON():void 0}}function Dc(e,t,{helper:n,push:o,newline:r,isTS:s}){const i=n("component"===t?Gi:Ji);for(let l=0;l3||!1;t.push("["),n&&t.indent(),zc(e,t,n),n&&t.deindent(),t.push("]")}function zc(e,t,n=!1,o=!0){const{push:r,newline:s}=t;for(let i=0;ie||"null"))}([s,i,l,c,a]),t),n(")"),p&&n(")");u&&(n(", "),Kc(u,t),n(")"))}(e,t);break;case 14:!function(e,t){const{push:n,helper:o,pure:r}=t,s=A(e.callee)?e.callee:o(e.callee);r&&n(Uc);n(s+"(",e),zc(e.arguments,t),n(")")}(e,t);break;case 15:!function(e,t){const{push:n,indent:o,deindent:r,newline:s}=t,{properties:i}=e;if(!i.length)return void n("{}",e);const l=i.length>1||!1;n(l?"{":"{ "),l&&o();for(let c=0;c "),(c||l)&&(n("{"),o());i?(c&&n("return "),N(i)?Wc(i,t):Kc(i,t)):l&&Kc(l,t);(c||l)&&(r(),n("}"));a&&n(")")}(e,t);break;case 19:!function(e,t){const{test:n,consequent:o,alternate:r,newline:s}=e,{push:i,indent:l,deindent:c,newline:a}=t;if(4===n.type){const e=!Ml(n.content);e&&i("("),Gc(n,t),e&&i(")")}else i("("),Kc(n,t),i(")");s&&l(),t.indentLevel++,s||i(" "),i("? "),Kc(o,t),t.indentLevel--,s&&a(),s||i(" "),i(": ");const u=19===r.type;u||t.indentLevel++;Kc(r,t),u||t.indentLevel--;s&&c(!0)}(e,t);break;case 20:!function(e,t){const{push:n,helper:o,indent:r,deindent:s,newline:i}=t;n(`_cache[${e.index}] || (`),e.isVNode&&(r(),n(`${o(pl)}(-1),`),i());n(`_cache[${e.index}] = `),Kc(e.value,t),e.isVNode&&(n(","),i(),n(`${o(pl)}(1),`),i(),n(`_cache[${e.index}]`),s());n(")")}(e,t);break;case 21:zc(e.body,t,!0,!1)}}function Gc(e,t){const{content:n,isStatic:o}=e;t.push(o?JSON.stringify(n):n,e)}function qc(e,t){for(let n=0;nfunction(e,t,n,o){if(!("else"===t.name||t.exp&&t.exp.content.trim())){t.exp=kl("true",!1,t.exp?t.exp.loc:e.loc)}if("if"===t.name){const r=Yc(e,t),s={type:9,loc:e.loc,branches:[r]};if(n.replaceNode(s),o)return o(s,r,!0)}else{const r=n.parent.children;let s=r.indexOf(e);for(;s-- >=-1;){const i=r[s];if(!i||2!==i.type||i.content.trim().length){if(i&&9===i.type){n.removeNode();const r=Yc(e,t);i.branches.push(r);const s=o&&o(i,r,!1);Lc(r,n),s&&s(),n.currentNode=null}break}n.removeNode(i)}}}(e,t,n,((e,t,o)=>{const r=n.parent.children;let s=r.indexOf(e),i=0;for(;s-- >=0;){const e=r[s];e&&9===e.type&&(i+=e.branches.length)}return()=>{if(o)e.codegenNode=Qc(t,i,n);else{(function(e){for(;;)if(19===e.type){if(19!==e.alternate.type)return e;e=e.alternate}else 20===e.type&&(e=e.value)}(e.codegenNode)).alternate=Qc(t,i+e.branches.length-1,n)}}}))));function Yc(e,t){return{type:10,loc:e.loc,condition:"else"===t.name?void 0:t.exp,children:3!==e.tagType||Hl(e,"for")?[e]:e.children,userKey:Dl(e,"key")}}function Qc(e,t,n){return e.condition?$l(e.condition,Xc(e,t,n),Nl(n.helper(Wi),['""',"true"])):Xc(e,t,n)}function Xc(e,t,n){const{helper:o}=n,r=wl("key",kl(`${t}`,!1,_l,2)),{children:s}=e,i=s[0];if(1!==s.length||1!==i.type){if(1===s.length&&11===i.type){const e=i.codegenNode;return Xl(e,r,n),e}{let t=64;return Sl(n,o(Mi),Cl([r]),s,t+"",void 0,void 0,!0,!1,!1,e.loc)}}{const e=i.codegenNode,t=14===(l=e).type&&l.callee===vl?l.arguments[1].returns:l;return 13===t.type&&tc(t,n),Xl(t,r,n),e}var l}const ea=jc("for",((e,t,n)=>{const{helper:o,removeHelper:r}=n;return function(e,t,n,o){if(!t.exp)return;const r=ra(t.exp);if(!r)return;const{scopes:s}=n,{source:i,value:l,key:c,index:a}=r,u={type:11,loc:t.loc,source:i,valueAlias:l,keyAlias:c,objectIndexAlias:a,parseResult:r,children:Gl(e)?e.children:[e]};n.replaceNode(u),s.vFor++;const p=o&&o(u);return()=>{s.vFor--,p&&p()}}(e,t,n,(t=>{const s=Nl(o(Qi),[t.source]),i=Hl(e,"memo"),l=Dl(e,"key"),c=l&&(6===l.type?kl(l.value.content,!0):l.exp),a=l?wl("key",c):null,u=4===t.source.type&&t.source.constType>0,p=u?64:l?128:256;return t.codegenNode=Sl(n,o(Mi),void 0,s,p+"",void 0,void 0,!0,!u,!1,e.loc),()=>{let l;const p=Gl(e),{children:f}=t,d=1!==f.length||1!==f[0].type,h=ql(e)?e:p&&1===e.children.length&&ql(e.children[0])?e.children[0]:null;if(h?(l=h.codegenNode,p&&a&&Xl(l,a,n)):d?l=Sl(n,o(Mi),a?Cl([a]):void 0,e.children,"64",void 0,void 0,!0,void 0,!1):(l=f[0].codegenNode,p&&a&&Xl(l,a,n),l.isBlock!==!u&&(l.isBlock?(r(Li),r(Zl(n.inSSR,l.isComponent))):r(Jl(n.inSSR,l.isComponent))),l.isBlock=!u,l.isBlock?(o(Li),o(Zl(n.inSSR,l.isComponent))):o(Jl(n.inSSR,l.isComponent))),i){const e=El(ia(t.parseResult,[kl("_cached")]));e.body={type:21,body:[Tl(["const _memo = (",i.exp,")"]),Tl(["if (_cached",...c?[" && _cached.key === ",c]:[],` && ${n.helperString(yl)}(_cached, _memo)) return _cached`]),Tl(["const _item = ",l]),kl("_item.memo = _memo"),kl("return _item")],loc:_l},s.arguments.push(e,kl("_cache"),kl(String(n.cached++)))}else s.arguments.push(El(ia(t.parseResult),l,!0))}}))}));const ta=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,na=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,oa=/^\(|\)$/g;function ra(e,t){const n=e.loc,o=e.content,r=o.match(ta);if(!r)return;const[,s,i]=r,l={source:sa(n,i.trim(),o.indexOf(i,s.length)),value:void 0,key:void 0,index:void 0};let c=s.trim().replace(oa,"").trim();const a=s.indexOf(c),u=c.match(na);if(u){c=c.replace(na,"").trim();const e=u[1].trim();let t;if(e&&(t=o.indexOf(e,a+c.length),l.key=sa(n,e,t)),u[2]){const r=u[2].trim();r&&(l.index=sa(n,r,o.indexOf(r,l.key?t+e.length:a+c.length)))}}return c&&(l.value=sa(n,c,a)),l}function sa(e,t,n){return kl(t,!1,Ll(e,n,t.length))}function ia({value:e,key:t,index:n},o=[]){return function(e){let t=e.length;for(;t--&&!e[t];);return e.slice(0,t+1).map(((e,t)=>e||kl("_".repeat(t+1),!1)))}([e,t,n,...o])}const la=kl("undefined",!1),ca=(e,t)=>{if(1===e.type&&(1===e.tagType||3===e.tagType)){const n=Hl(e,"slot");if(n)return t.scopes.vSlot++,()=>{t.scopes.vSlot--}}},aa=(e,t,n)=>El(e,t,!1,!0,t.length?t[0].loc:n);function ua(e,t,n=aa){t.helper(hl);const{children:o,loc:r}=e,s=[],i=[];let l=t.scopes.vSlot>0||t.scopes.vFor>0;const c=Hl(e,"slot",!0);if(c){const{arg:e,exp:t}=c;e&&!Rl(e)&&(l=!0),s.push(wl(e||kl("default",!0),n(t,o,r)))}let a=!1,u=!1;const p=[],f=new Set;for(let m=0;mwl("default",n(e,t,r));a?p.length&&p.some((e=>da(e)))&&(u||s.push(e(void 0,p))):s.push(e(void 0,o))}const d=l?2:fa(e.children)?3:1;let h=Cl(s.concat(wl("_",kl(d+"",!1))),r);return i.length&&(h=Nl(t.helper(el),[h,xl(i)])),{slots:h,hasDynamicSlots:l}}function pa(e,t){return Cl([wl("name",e),wl("fn",t)])}function fa(e){for(let t=0;tfunction(){if(1!==(e=t.currentNode).type||0!==e.tagType&&1!==e.tagType)return;const{tag:n,props:o}=e,r=1===e.tagType;let s=r?function(e,t,n=!1){let{tag:o}=e;const r=ba(o),s=Dl(e,"is");if(s)if(r){const e=6===s.type?s.value&&kl(s.value.content,!0):s.exp;if(e)return Nl(t.helper(qi),[e])}else 6===s.type&&s.value.content.startsWith("vue:")&&(o=s.value.content.slice(4));const i=!r&&Hl(e,"is");if(i&&i.exp)return Nl(t.helper(qi),[i.exp]);const l=Al(o)||t.isBuiltInComponent(o);if(l)return n||t.helper(l),l;return t.helper(Gi),t.components.add(o),ec(o,"component")}(e,t):`"${n}"`;let i,l,c,a,u,p,f=0,d=M(s)&&s.callee===qi||s===Pi||s===Vi||!r&&("svg"===n||"foreignObject"===n||Dl(e,"key",!0));if(o.length>0){const n=ga(e,t);i=n.props,f=n.patchFlag,u=n.dynamicPropNames;const o=n.directives;p=o&&o.length?xl(o.map((e=>function(e,t){const n=[],o=ha.get(e);o?n.push(t.helperString(o)):(t.helper(Ji),t.directives.add(e.name),n.push(ec(e.name,"directive")));const{loc:r}=e;e.exp&&n.push(e.exp);e.arg&&(e.exp||n.push("void 0"),n.push(e.arg));if(Object.keys(e.modifiers).length){e.arg||(e.exp||n.push("void 0"),n.push("void 0"));const t=kl("true",!1,r);n.push(Cl(e.modifiers.map((e=>wl(e,t))),r))}return xl(n,e.loc)}(e,t)))):void 0}if(e.children.length>0){s===Ii&&(d=!0,f|=1024);if(r&&s!==Pi&&s!==Ii){const{slots:n,hasDynamicSlots:o}=ua(e,t);l=n,o&&(f|=1024)}else if(1===e.children.length&&s!==Pi){const n=e.children[0],o=n.type,r=5===o||8===o;r&&0===Oc(n,t)&&(f|=1),l=r||2===o?n:e.children}else l=e.children}0!==f&&(c=String(f),u&&u.length&&(a=function(e){let t="[";for(let n=0,o=e.length;n{if(Rl(e)){const o=e.content,r=S(o);if(i||!r||"onclick"===o.toLowerCase()||"onUpdate:modelValue"===o||j(o)||(h=!0),r&&j(o)&&(g=!0),20===n.type||(4===n.type||8===n.type)&&Oc(n,t)>0)return;"ref"===o?p=!0:"class"===o?f=!0:"style"===o?d=!0:"key"===o||v.includes(o)||v.push(o),!i||"class"!==o&&"style"!==o||v.includes(o)||v.push(o)}else m=!0};for(let _=0;_1?Nl(t.helper(nl),c,s):c[0]):l.length&&(b=Cl(va(l),s)),m?u|=16:(f&&!i&&(u|=2),d&&!i&&(u|=4),v.length&&(u|=8),h&&(u|=32)),0!==u&&32!==u||!(p||g||a.length>0)||(u|=512),!t.inSSR&&b)switch(b.type){case 15:let e=-1,n=-1,o=!1;for(let t=0;t{if(ql(e)){const{children:n,loc:o}=e,{slotName:r,slotProps:s}=function(e,t){let n,o='"default"';const r=[];for(let s=0;s0){const{props:o,directives:s}=ga(e,t,r);n=o}return{slotName:o,slotProps:n}}(e,t),i=[t.prefixIdentifiers?"_ctx.$slots":"$slots",r,"{}","undefined","true"];let l=2;s&&(i[2]=s,l=3),n.length&&(i[3]=El([],n,!1,!1,o),l=4),t.scopeId&&!t.slotted&&(l=5),i.splice(l),e.codegenNode=Nl(t.helper(Xi),i,o)}};const Sa=/^\s*([\w$_]+|(async\s*)?\([^)]*?\))\s*=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/,xa=(e,t,n,o)=>{const{loc:r,modifiers:s,arg:i}=e;let l;if(4===i.type)if(i.isStatic){l=kl(G(D(i.content)),!0,i.loc)}else l=Tl([`${n.helperString(ul)}(`,i,")"]);else l=i,l.children.unshift(`${n.helperString(ul)}(`),l.children.push(")");let c=e.exp;c&&!c.content.trim()&&(c=void 0);let a=n.cacheHandlers&&!c&&!n.inVOnce;if(c){const e=Bl(c.content),t=!(e||Sa.test(c.content)),n=c.content.includes(";");(t||a&&e)&&(c=Tl([`${t?"$event":"(...args)"} => ${n?"{":"("}`,c,n?"}":")"]))}let u={props:[wl(l,c||kl("() => {}",!1,r))]};return o&&(u=o(u)),a&&(u.props[0].value=n.cache(u.props[0].value)),u.props.forEach((e=>e.key.isHandlerKey=!0)),u},Ca=(e,t,n)=>{const{exp:o,modifiers:r,loc:s}=e,i=e.arg;return 4!==i.type?(i.children.unshift("("),i.children.push(') || ""')):i.isStatic||(i.content=`${i.content} || ""`),r.includes("camel")&&(4===i.type?i.content=i.isStatic?D(i.content):`${n.helperString(cl)}(${i.content})`:(i.children.unshift(`${n.helperString(cl)}(`),i.children.push(")"))),n.inSSR||(r.includes("prop")&&wa(i,"."),r.includes("attr")&&wa(i,"^")),!o||4===o.type&&!o.content.trim()?{props:[wl(i,kl("",!0,s))]}:{props:[wl(i,o)]}},wa=(e,t)=>{4===e.type?e.content=e.isStatic?t+e.content:`\`${t}\${${e.content}}\``:(e.children.unshift(`'${t}' + (`),e.children.push(")"))},ka=(e,t)=>{if(0===e.type||1===e.type||11===e.type||10===e.type)return()=>{const n=e.children;let o,r=!1;for(let e=0;e7===e.type&&!t.directiveTransforms[e.name])))))for(let e=0;e{if(1===e.type&&Hl(e,"once",!0)){if(Ta.has(e)||t.inVOnce)return;return Ta.add(e),t.inVOnce=!0,t.helper(pl),()=>{t.inVOnce=!1;const e=t.currentNode;e.codegenNode&&(e.codegenNode=t.cache(e.codegenNode,!0))}}},Ea=(e,t,n)=>{const{exp:o,arg:r}=e;if(!o)return $a();const s=o.loc.source,i=4===o.type?o.content:s;if(!i.trim()||!Bl(i))return $a();const l=r||kl("modelValue",!0),c=r?Rl(r)?`onUpdate:${r.content}`:Tl(['"onUpdate:" + ',r]):"onUpdate:modelValue";let a;a=Tl([`${n.isTS?"($event: any)":"$event"} => ((`,o,") = $event)"]);const u=[wl(l,e.exp),wl(c,a)];if(e.modifiers.length&&1===t.tagType){const t=e.modifiers.map((e=>(Ml(e)?e:JSON.stringify(e))+": true")).join(", "),n=r?Rl(r)?`${r.content}Modifiers`:Tl([r,' + "Modifiers"']):"modelModifiers";u.push(wl(n,kl(`{ ${t} }`,!1,e.loc,2)))}return $a(u)};function $a(e=[]){return{props:e}}const Ra=new WeakSet,Oa=(e,t)=>{if(1===e.type){const n=Hl(e,"memo");if(!n||Ra.has(e))return;return Ra.add(e),()=>{const o=e.codegenNode||t.currentNode.codegenNode;o&&13===o.type&&(1!==e.tagType&&tc(o,t),e.codegenNode=Nl(t.helper(vl),[n.exp,El(void 0,o),"_cache",String(t.cached++)]))}}};function Aa(e,t={}){const n=t.onError||Oi,o="module"===t.mode;!0===t.prefixIdentifiers?n(Fi(46)):o&&n(Fi(47));t.cacheHandlers&&n(Fi(48)),t.scopeId&&!o&&n(Fi(49));const r=A(e)?sc(e,t):e,[s,i]=[[Na,Zc,Oa,ea,_a,ma,ca,ka],{on:xa,bind:Ca,model:Ea}];return Bc(r,C({},t,{prefixIdentifiers:false,nodeTransforms:[...s,...t.nodeTransforms||[]],directiveTransforms:C({},i,t.directiveTransforms||{})})),Hc(r,C({},t,{prefixIdentifiers:false}))}const Fa=Symbol(""),Ma=Symbol(""),Pa=Symbol(""),Va=Symbol(""),Ia=Symbol(""),Ba=Symbol(""),La=Symbol(""),ja=Symbol(""),Ua=Symbol(""),Ha=Symbol("");var Da;let Wa;Da={[Fa]:"vModelRadio",[Ma]:"vModelCheckbox",[Pa]:"vModelText",[Va]:"vModelSelect",[Ia]:"vModelDynamic",[Ba]:"withModifiers",[La]:"withKeys",[ja]:"vShow",[Ua]:"Transition",[Ha]:"TransitionGroup"},Object.getOwnPropertySymbols(Da).forEach((e=>{bl[e]=Da[e]}));const za=t("style,iframe,script,noscript",!0),Ka={isVoidTag:f,isNativeTag:e=>u(e)||p(e),isPreTag:e=>"pre"===e,decodeEntities:function(e,t=!1){return Wa||(Wa=document.createElement("div")),t?(Wa.innerHTML=`
`,Wa.children[0].getAttribute("foo")):(Wa.innerHTML=e,Wa.textContent)},isBuiltInComponent:e=>Ol(e,"Transition")?Ua:Ol(e,"TransitionGroup")?Ha:void 0,getNamespace(e,t){let n=t?t.ns:0;if(t&&2===n)if("annotation-xml"===t.tag){if("svg"===e)return 1;t.props.some((e=>6===e.type&&"encoding"===e.name&&null!=e.value&&("text/html"===e.value.content||"application/xhtml+xml"===e.value.content)))&&(n=0)}else/^m(?:[ions]|text)$/.test(t.tag)&&"mglyph"!==e&&"malignmark"!==e&&(n=0);else t&&1===n&&("foreignObject"!==t.tag&&"desc"!==t.tag&&"title"!==t.tag||(n=0));if(0===n){if("svg"===e)return 1;if("math"===e)return 2}return n},getTextMode({tag:e,ns:t}){if(0===t){if("textarea"===e||"title"===e)return 1;if(za(e))return 2}return 0}},Ga=(e,t)=>{const n=c(e);return kl(JSON.stringify(n),!1,t,3)};const qa=t("passive,once,capture"),Ja=t("stop,prevent,self,ctrl,shift,alt,meta,exact,middle"),Za=t("left,right"),Ya=t("onkeyup,onkeydown,onkeypress",!0),Qa=(e,t)=>Rl(e)&&"onclick"===e.content.toLowerCase()?kl(t,!0):4!==e.type?Tl(["(",e,`) === "onClick" ? "${t}" : (`,e,")"]):e,Xa=(e,t)=>{1!==e.type||0!==e.tagType||"script"!==e.tag&&"style"!==e.tag||t.removeNode()},eu=[e=>{1===e.type&&e.props.forEach(((t,n)=>{6===t.type&&"style"===t.name&&t.value&&(e.props[n]={type:7,name:"bind",arg:kl("style",!0,t.loc),exp:Ga(t.value.content,t.loc),modifiers:[],loc:t.loc})}))}],tu={cloak:()=>({props:[]}),html:(e,t,n)=>{const{exp:o,loc:r}=e;return t.children.length&&(t.children.length=0),{props:[wl(kl("innerHTML",!0,r),o||kl("",!0))]}},text:(e,t,n)=>{const{exp:o,loc:r}=e;return t.children.length&&(t.children.length=0),{props:[wl(kl("textContent",!0),o?Nl(n.helperString(tl),[o],r):kl("",!0))]}},model:(e,t,n)=>{const o=Ea(e,t,n);if(!o.props.length||1===t.tagType)return o;const{tag:r}=t,s=n.isCustomElement(r);if("input"===r||"textarea"===r||"select"===r||s){let e=Pa,i=!1;if("input"===r||s){const n=Dl(t,"type");if(n){if(7===n.type)e=Ia;else if(n.value)switch(n.value.content){case"radio":e=Fa;break;case"checkbox":e=Ma;break;case"file":i=!0}}else(function(e){return e.props.some((e=>!(7!==e.type||"bind"!==e.name||e.arg&&4===e.arg.type&&e.arg.isStatic)))})(t)&&(e=Ia)}else"select"===r&&(e=Va);i||(o.needRuntime=n.helper(e))}return o.props=o.props.filter((e=>!(4===e.key.type&&"modelValue"===e.key.content))),o},on:(e,t,n)=>xa(e,0,n,(t=>{const{modifiers:o}=e;if(!o.length)return t;let{key:r,value:s}=t.props[0];const{keyModifiers:i,nonKeyModifiers:l,eventOptionModifiers:c}=((e,t,n,o)=>{const r=[],s=[],i=[];for(let l=0;l({props:[],needRuntime:n.helper(ja)})};const nu=Object.create(null);function ou(e,t){if(!A(e)){if(!e.nodeType)return y;e=e.innerHTML}const n=e,o=nu[n];if(o)return o;if("#"===e[0]){const t=document.querySelector(e);e=t?t.innerHTML:""}const{code:r}=function(e,t={}){return Aa(e,C({},Ka,t,{nodeTransforms:[Xa,...eu,...t.nodeTransforms||[]],directiveTransforms:C({},tu,t.directiveTransforms||{}),transformHoist:null}))}(e,C({hoistStatic:!0,onError:void 0,onWarn:y},t)),s=new Function(r)();return s._rc=!0,nu[n]=s}return br(ou),e.BaseTransition=sn,e.Comment=Fo,e.EffectScope=te,e.Fragment=Oo,e.KeepAlive=vn,e.ReactiveEffect=de,e.Static=Mo,e.Suspense=Jt,e.Teleport=To,e.Text=Ao,e.Transition=Vs,e.TransitionGroup=ei,e.VueElement=Os,e.callWithAsyncErrorHandling=Rr,e.callWithErrorHandling=$r,e.camelize=D,e.capitalize=K,e.cloneVNode=Yo,e.compatUtils=null,e.compile=ou,e.computed=Pt,e.createApp=(...e)=>{const t=ki().createApp(...e),{mount:n}=t;return t.mount=e=>{const o=$i(e);if(!o)return;const r=t._component;O(r)||r.render||r.template||(r.template=o.innerHTML),o.innerHTML="";const s=n(o,!1,o instanceof SVGElement);return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),s},t},e.createBlock=Ho,e.createCommentVNode=function(e="",t=!1){return t?(Io(),Ho(Fo,null,e)):Jo(Fo,null,e)},e.createElementBlock=function(e,t,n,o,r,s){return Uo(qo(e,t,n,o,r,s,!0))},e.createElementVNode=qo,e.createHydrationRenderer=vo,e.createRenderer=go,e.createSSRApp=(...e)=>{const t=Ti().createApp(...e),{mount:n}=t;return t.mount=e=>{const t=$i(e);if(t)return n(t,!0,t instanceof SVGElement)},t},e.createSlots=function(e,t){for(let n=0;n{let e;return a||(e=a=t().catch((e=>{if(e=e instanceof Error?e:new Error(String(e)),l)return new Promise(((t,n)=>{l(e,(()=>t((u++,a=null,p()))),(()=>n(e)),u+1)}));throw e})).then((t=>e!==a&&a?a:(t&&(t.__esModule||"Module"===t[Symbol.toStringTag])&&(t=t.default),c=t,t))))};return dn({name:"AsyncComponentWrapper",__asyncLoader:p,get __asyncResolved(){return c},setup(){const e=ur;if(c)return()=>mn(c,e);const t=t=>{a=null,Or(t,e,13,!o)};if(i&&e.suspense)return p().then((t=>()=>mn(t,e))).catch((e=>(t(e),()=>o?Jo(o,{error:e}):null)));const l=kt(!1),u=kt(),f=kt(!!r);return r&&setTimeout((()=>{f.value=!1}),r),null!=s&&setTimeout((()=>{if(!l.value&&!u.value){const e=new Error(`Async component timed out after ${s}ms.`);t(e),u.value=e}}),s),p().then((()=>{l.value=!0,e.parent&&gn(e.parent.vnode)&&Kr(e.parent.update)})).catch((e=>{t(e),u.value=e})),()=>l.value&&c?mn(c,e):u.value&&o?Jo(o,{error:u.value}):n&&!f.value?Jo(n):void 0}})},e.defineComponent=dn,e.defineCustomElement=$s,e.defineEmits=function(){return null},e.defineExpose=function(e){},e.defineProps=function(){return null},e.defineSSRCustomElement=e=>$s(e,Ei),e.effect=function(e,t){e.effect&&(e=e.effect.fn);const n=new de(e);t&&(C(n,t),t.scope&&ne(n,t.scope)),t&&t.lazy||n.run();const o=n.run.bind(n);return o.effect=n,o},e.effectScope=function(e){return new te(e)},e.getCurrentInstance=pr,e.getCurrentScope=function(){return X},e.getTransitionRawChildren=fn,e.guardReactiveProps=Zo,e.h=cs,e.handleError=Or,e.hydrate=Ei,e.initCustomFormatter=function(){},e.initDirectivesForSSR=Ri,e.inject=nn,e.isMemoSame=us,e.isProxy=vt,e.isReactive=mt,e.isReadonly=gt,e.isRef=wt,e.isRuntimeOnly=()=>!mr,e.isVNode=Do,e.markRaw=bt,e.mergeDefaults=function(e,t){for(const n in t){const o=e[n];o?o.default=t[n]:null===o&&(e[n]={default:t[n]})}return e},e.mergeProps=nr,e.nextTick=zr,e.normalizeClass=a,e.normalizeProps=function(e){if(!e)return null;let{class:t,style:n}=e;return t&&!A(t)&&(e.class=a(t)),n&&(e.style=s(n)),e},e.normalizeStyle=s,e.onActivated=bn,e.onBeforeMount=Nn,e.onBeforeUnmount=On,e.onBeforeUpdate=$n,e.onDeactivated=_n,e.onErrorCaptured=Vn,e.onMounted=En,e.onRenderTracked=Pn,e.onRenderTriggered=Mn,e.onScopeDispose=function(e){X&&X.cleanups.push(e)},e.onServerPrefetch=Fn,e.onUnmounted=An,e.onUpdated=Rn,e.openBlock=Io,e.popScopeId=function(){Ut=null},e.provide=tn,e.proxyRefs=Rt,e.pushScopeId=function(e){Ut=e},e.queuePostFlushCb=Jr,e.reactive=pt,e.readonly=dt,e.ref=kt,e.registerRuntimeCompiler=br,e.render=Ni,e.renderList=function(e,t,n,o){let r;const s=n&&n[o];if(N(e)||A(e)){r=new Array(e.length);for(let n=0,o=e.length;nt(e,n,void 0,s&&s[n])));else{const n=Object.keys(e);r=new Array(n.length);for(let o=0,i=n.length;oe.devtools.emit(t,...n))),Vt=[];else{(o.__VUE_DEVTOOLS_HOOK_REPLAY__=o.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push((e=>{t(e,o)}))}},e.setTransitionHooks=pn,e.shallowReactive=ft,e.shallowReadonly=function(e){return ht(e,!0,Ie,st,at)},e.shallowRef=function(e){return Tt(e,!0)},e.ssrContextKey=as,e.ssrUtils=null,e.stop=function(e){e.effect.stop()},e.toDisplayString=e=>null==e?"":N(e)||M(e)&&(e.toString===V||!O(e.toString))?JSON.stringify(e,m,2):String(e),e.toHandlerKey=G,e.toHandlers=function(e){const t={};for(const n in e)t[G(n)]=e[n];return t},e.toRaw=yt,e.toRef=Ft,e.toRefs=function(e){const t=N(e)?new Array(e.length):{};for(const n in e)t[n]=Ft(e,n);return t},e.transformVNodeArgs=function(e){},e.triggerRef=function(e){Ct(e)},e.unref=Et,e.useAttrs=function(){return ls().attrs},e.useCssModule=function(e="$style"){return g},e.useCssVars=function(e){const t=pr();if(!t)return;const n=()=>As(t.subTree,e(t.proxy));es(n),En((()=>{const e=new MutationObserver(n);e.observe(t.subTree.el.parentNode,{childList:!0}),An((()=>e.disconnect()))}))},e.useSSRContext=()=>{},e.useSlots=function(){return ls().slots},e.useTransitionState=on,e.vModelCheckbox=ci,e.vModelDynamic=mi,e.vModelRadio=ui,e.vModelSelect=pi,e.vModelText=li,e.vShow=_i,e.version=ps,e.warn=function(e,...t){ve();const n=Tr.length?Tr[Tr.length-1].component:null,o=n&&n.appContext.config.warnHandler,r=function(){let e=Tr[Tr.length-1];if(!e)return[];const t=[];for(;e;){const n=t[0];n&&n.vnode===e?n.recurseCount++:t.push({vnode:e,recurseCount:0});const o=e.component&&e.component.parent;e=o&&o.vnode}return t}();if(o)$r(o,n,11,[e+t.join(""),n&&n.proxy,r.map((({vnode:e})=>`at <${kr(n,e.type)}>`)).join("\n"),r]);else{const n=[`[Vue warn]: ${e}`,...t];r.length&&n.push("\n",...function(e){const t=[];return e.forEach(((e,n)=>{t.push(...0===n?[]:["\n"],...function({vnode:e,recurseCount:t}){const n=t>0?`... (${t} recursive calls)`:"",o=` at <${kr(e.component,e.type,!!e.component&&null==e.component.parent)}`,r=">"+n;return e.props?[o,...Nr(e.props),r]:[o+r]}(e))})),t}(r)),console.warn(...n)}ye()},e.watch=ns,e.watchEffect=function(e,t){return os(e,null,t)},e.watchPostEffect=es,e.watchSyncEffect=function(e,t){return os(e,null,{flush:"sync"})},e.withAsyncContext=function(e){const t=pr();let n=e();return dr(),P(n)&&(n=n.catch((e=>{throw fr(t),e}))),[n,()=>fr(t)]},e.withCtx=Dt,e.withDefaults=function(e,t){return null},e.withDirectives=function(e,t){if(null===jt)return e;const n=jt.proxy,o=e.dirs||(e.dirs=[]);for(let r=0;rn=>{if(!("key"in n))return;const o=z(n.key);return t.some((e=>e===o||bi[e]===o))?e(n):void 0},e.withMemo=function(e,t,n,o){const r=n[o];if(r&&us(r,e))return r;const s=t();return s.memo=e.slice(),n[o]=s},e.withModifiers=(e,t)=>(n,...o)=>{for(let e=0;eDt,Object.defineProperty(e,"__esModule",{value:!0}),e}({}); diff --git a/core/static/core/style.scss b/core/static/core/style.scss index 3424dcee..3279d0d7 100644 --- a/core/static/core/style.scss +++ b/core/static/core/style.scss @@ -1263,7 +1263,7 @@ u, text-decoration: underline; } -#bar_ui { +#bar-ui { padding: 0.4em; display: flex; flex-wrap: wrap; diff --git a/core/templates/core/404.jinja b/core/templates/core/404.jinja index 3846ed70..a777cea6 100644 --- a/core/templates/core/404.jinja +++ b/core/templates/core/404.jinja @@ -4,9 +4,6 @@

{% trans %}404, Not Found{% endtrans %}

-

- {{ exception }} -

{% endblock %} diff --git a/core/templates/core/base.jinja b/core/templates/core/base.jinja index 4ef8d911..e343f2a1 100644 --- a/core/templates/core/base.jinja +++ b/core/templates/core/base.jinja @@ -65,20 +65,26 @@
{% endcache %}
- - -
-
{% trans %}Customer{% endtrans %}
- {{ user_mini_profile(customer.user) }} - {{ user_subscription(customer.user) }} -

{% trans %}Amount: {% endtrans %}{{ customer.amount }} €

- - {% csrf_token %} - - {% trans %}Add a student card{% endtrans %} - - {% if request.session['not_valid_student_card_uid'] %} -

{% trans %}This is not a valid student card UID{% endtrans %}

- {% endif %} - - -
{% trans %}Registered cards{% endtrans %}
- {% if customer.student_cards.exists() %} -
    - {% for card in customer.student_cards.all() %} -
  • {{ card.uid }}
  • - {% endfor %} -
- {% else %} - {% trans %}No card registered{% endtrans %} - {% endif %} -
- -
-
{% trans %}Selling{% endtrans %}
-
- - {% raw %} -
-

{{ error }}

-
- {% endraw %} - -
- {% csrf_token %} - - - -
-

{% trans %}Basket: {% endtrans %}

- - {% raw %} -
    -
  • - -
    - - - - -
    - - {{ p_info["qty"] + p_info["bonus_qty"] }} - -
    - - - - -
    - - {{ products[p_id].name }}: {{ (p_info["qty"]*p_info["price"]/100).toLocaleString(undefined, { minimumFractionDigits: 2 }) }} € P -
  • -
-

- Total: {{ sum_basket().toLocaleString(undefined, { minimumFractionDigits: 2 }) }} € -

- -
-

{{ error }}

-
- {% endraw %} +
+ +
+
{% trans %}Customer{% endtrans %}
+ {{ user_mini_profile(customer.user) }} + {{ user_subscription(customer.user) }} +

{% trans %}Amount: {% endtrans %}{{ customer.amount }} €

{% csrf_token %} - - -
-
- {% csrf_token %} - - -
-
- {% if (counter.type == 'BAR' and barmens_can_refill) %} -
{% trans %}Refilling{% endtrans %}
-
-
- {% csrf_token %} - {{ refill_form.as_p() }} - - -
-
- {% endif %} -
- -
- - {% for category in categories.keys() -%} -
-
{{ category }}
- {% for p in categories[category] -%} - {% set file = None %} - {% if p.icon %} - {% set file = p.icon.url %} - {% else %} - {% set file = static('core/img/na.gif') %} + + {% trans %}Add a student card{% endtrans %} + + {% if request.session['not_valid_student_card_uid'] %} +

{% trans %}This is not a valid student card UID{% endtrans %}

{% endif %} -
+ +
+
{% trans %}Registered cards{% endtrans %}
+ {% if customer.student_cards.exists() %} +
    + {% for card in customer.student_cards.all() %} +
  • {{ card.uid }}
  • + {% endfor %} +
+ {% else %} + {% trans %}No card registered{% endtrans %} + {% endif %} +
+ +
+
{% trans %}Selling{% endtrans %}
+
+ {% set counter_click_url = url('counter:click', counter_id=counter.id, user_id=customer.user.id) %} + + {# Formulaire pour rechercher un produit en tapant son code dans une barre de recherche #} +
{% csrf_token %} - - - + + + +
+ + +

{% trans %}Basket: {% endtrans %}

+ +
    + +
+

+ Total: + + +

+ +
+ {% csrf_token %} + + +
+
+ {% csrf_token %} + + +
+
+ {% if (counter.type == 'BAR' and barmens_can_refill) %} +
{% trans %}Refilling{% endtrans %}
+
+
+ {% csrf_token %} + {{ refill_form.as_p() }} + + +
+
+ {% endif %} +
+ +
+
    + {% for category in categories.keys() -%} +
  • {{ category }}
  • + {%- endfor %} +
+ {% for category in categories.keys() -%} +
+
{{ category }}
+ {% for p in categories[category] -%} +
+ {% csrf_token %} + + + +
+ {%- endfor %} +
{%- endfor %}
- {%- endfor %}
-
- {% endblock %} {% block script %} -{{ super() }} - - + {{ super() }} + {% endblock %} diff --git a/counter/tests.py b/counter/tests.py index 0a25a9ff..d8772d9e 100644 --- a/counter/tests.py +++ b/counter/tests.py @@ -23,6 +23,7 @@ # import json import re +import string from django.test import TestCase from django.urls import reverse @@ -42,7 +43,7 @@ class CounterTest(TestCase): self.foyer = Counter.objects.get(id=2) def test_full_click(self): - response = self.client.post( + self.client.post( reverse("counter:login", kwargs={"counter_id": self.mde.id}), {"username": self.skia.username, "password": "plop"}, ) @@ -62,13 +63,12 @@ class CounterTest(TestCase): reverse("counter:details", kwargs={"counter_id": self.mde.id}), {"code": "4000k", "counter_token": counter_token}, ) - location = response.get("location") - + counter_url = response.get("location") response = self.client.get(response.get("location")) self.assertTrue(">Richard Batsbak2 x Barbar" in str(response_content)) - self.assertTrue("
  • 2 x Déconsigne Eco-cup" in str(response_content)) + self.assertTrue("2 x Barbar" in str(response_content)) + self.assertTrue("2 x Déconsigne Eco-cup" in str(response_content)) self.assertTrue( "

    Client : Richard Batsbak - Nouveau montant : 3.60" in str(response_content) @@ -98,7 +108,7 @@ class CounterTest(TestCase): ) response = self.client.post( - location, + counter_url, { "action": "refill", "amount": "5", @@ -108,7 +118,7 @@ class CounterTest(TestCase): ) self.assertTrue(response.status_code == 200) - response = self.client.post( + self.client.post( reverse("counter:login", kwargs={"counter_id": self.foyer.id}), {"username": self.krophil.username, "password": "plop"}, ) @@ -125,10 +135,10 @@ class CounterTest(TestCase): reverse("counter:details", kwargs={"counter_id": self.foyer.id}), {"code": "4000k", "counter_token": counter_token}, ) - location = response.get("location") + counter_url = response.get("location") response = self.client.post( - location, + counter_url, { "action": "refill", "amount": "5", @@ -138,13 +148,27 @@ class CounterTest(TestCase): ) self.assertTrue(response.status_code == 200) + def test_annotate_has_barman_queryset(self): + """ + Test if the custom queryset method ``annotate_has_barman`` + works as intended + """ + self.sli.counters.clear() + self.sli.counters.add(self.foyer, self.mde) + counters = Counter.objects.annotate_has_barman(self.sli) + for counter in counters: + if counter.name in ("Foyer", "MDE"): + self.assertTrue(counter.has_annotated_barman) + else: + self.assertFalse(counter.has_annotated_barman) + class CounterStatsTest(TestCase): def setUp(self): call_command("populate") self.counter = Counter.objects.filter(id=2).first() - def test_unothorized_user_fail(self): + def test_unauthorised_user_fail(self): # Test with not login user response = self.client.get(reverse("counter:stats", args=[self.counter.id])) self.assertTrue(response.status_code == 403) @@ -745,18 +769,30 @@ class StudentCardTest(TestCase): self.assertEqual(response.status_code, 403) -class AccountIdTest(TestCase): +class CustomerAccountIdTest(TestCase): def setUp(self): - user_a = User.objects.create(username="a", password="plop", email="a.a@a.fr") + self.user_a = User.objects.create( + username="a", password="plop", email="a.a@a.fr" + ) user_b = User.objects.create(username="b", password="plop", email="b.b@b.fr") user_c = User.objects.create(username="c", password="plop", email="c.c@c.fr") - Customer.objects.create(user=user_a, amount=0, account_id="1111a") + Customer.objects.create(user=self.user_a, amount=10, account_id="1111a") Customer.objects.create(user=user_b, amount=0, account_id="9999z") Customer.objects.create(user=user_c, amount=0, account_id="12345f") def test_create_customer(self): user_d = User.objects.create(username="d", password="plop") - customer_d = Customer.new_for_user(user_d) - customer_d.save() - number = customer_d.account_id[:-1] + customer, created = Customer.get_or_create(user_d) + account_id = customer.account_id + number = account_id[:-1] + self.assertTrue(created) self.assertEqual(number, "12346") + self.assertEqual(6, len(account_id)) + self.assertIn(account_id[-1], string.ascii_lowercase) + self.assertEqual(0, customer.amount) + + def test_get_existing_account(self): + account, created = Customer.get_or_create(self.user_a) + self.assertFalse(created) + self.assertEqual(account.account_id, "1111a") + self.assertEqual(10, account.amount) diff --git a/counter/urls.py b/counter/urls.py index 7195ddc6..449c0fe0 100644 --- a/counter/urls.py +++ b/counter/urls.py @@ -22,47 +22,47 @@ # # -from django.urls import re_path, path +from django.urls import path from counter.views import * urlpatterns = [ - re_path(r"^(?P[0-9]+)$", CounterMain.as_view(), name="details"), - re_path( - r"^(?P[0-9]+)/click/(?P[0-9]+)$", + path("/", CounterMain.as_view(), name="details"), + path( + "/click//", CounterClick.as_view(), name="click", ), - re_path( - r"^(?P[0-9]+)/last_ops$", + path( + "/last_ops/", CounterLastOperationsView.as_view(), name="last_ops", ), - re_path( - r"^(?P[0-9]+)/cash_summary$", + path( + "/cash_summary/", CounterCashSummaryView.as_view(), name="cash_summary", ), - re_path( - r"^(?P[0-9]+)/activity$", + path( + "/activity/", CounterActivityView.as_view(), name="activity", ), - re_path(r"^(?P[0-9]+)/stats$", CounterStatView.as_view(), name="stats"), - re_path(r"^(?P[0-9]+)/login$", CounterLogin.as_view(), name="login"), - re_path(r"^(?P[0-9]+)/logout$", CounterLogout.as_view(), name="logout"), - re_path( - r"^eticket/(?P[0-9]+)/pdf$", + path("/stats/", CounterStatView.as_view(), name="stats"), + path("/login/", CounterLogin.as_view(), name="login"), + path("/logout/", CounterLogout.as_view(), name="logout"), + path( + "eticket//pdf/", EticketPDFView.as_view(), name="eticket_pdf", ), - re_path( - r"^customer/(?P[0-9]+)/card/add$", + path( + "customer//card/add/", StudentCardFormView.as_view(), name="add_student_card", ), - re_path( - r"^customer/(?P[0-9]+)/card/delete/(?P[0-9]+)/$", + path( + "customer//card/delete//", StudentCardDeleteView.as_view(), name="delete_student_card", ), @@ -76,76 +76,76 @@ urlpatterns = [ edit_billing_info, name="edit_billing_info", ), - re_path(r"^admin/(?P[0-9]+)$", CounterEditView.as_view(), name="admin"), - re_path( - r"^admin/(?P[0-9]+)/prop$", + path("admin//", CounterEditView.as_view(), name="admin"), + path( + "admin//prop/", CounterEditPropView.as_view(), name="prop_admin", ), - re_path(r"^admin$", CounterListView.as_view(), name="admin_list"), - re_path(r"^admin/new$", CounterCreateView.as_view(), name="new"), - re_path( - r"^admin/delete/(?P[0-9]+)$", + path("admin/", CounterListView.as_view(), name="admin_list"), + path("admin/new/", CounterCreateView.as_view(), name="new"), + path( + "admin/delete//", CounterDeleteView.as_view(), name="delete", ), - re_path(r"^admin/invoices_call$", InvoiceCallView.as_view(), name="invoices_call"), - re_path( - r"^admin/cash_summary/list$", + path("admin/invoices_call/", InvoiceCallView.as_view(), name="invoices_call"), + path( + "admin/cash_summary/list/", CashSummaryListView.as_view(), name="cash_summary_list", ), - re_path( - r"^admin/cash_summary/(?P[0-9]+)$", + path( + "admin/cash_summary//", CashSummaryEditView.as_view(), name="cash_summary_edit", ), - re_path(r"^admin/product/list$", ProductListView.as_view(), name="product_list"), - re_path( - r"^admin/product/list_archived$", + path("admin/product/list/", ProductListView.as_view(), name="product_list"), + path( + "admin/product/list_archived/", ProductArchivedListView.as_view(), name="product_list_archived", ), - re_path(r"^admin/product/create$", ProductCreateView.as_view(), name="new_product"), - re_path( - r"^admin/product/(?P[0-9]+)$", + path("admin/product/create/", ProductCreateView.as_view(), name="new_product"), + path( + "admin/product//", ProductEditView.as_view(), name="product_edit", ), - re_path( - r"^admin/producttype/list$", + path( + "admin/producttype/list/", ProductTypeListView.as_view(), name="producttype_list", ), - re_path( - r"^admin/producttype/create$", + path( + "admin/producttype/create/", ProductTypeCreateView.as_view(), name="new_producttype", ), - re_path( - r"^admin/producttype/(?P[0-9]+)$", + path( + "admin/producttype//", ProductTypeEditView.as_view(), name="producttype_edit", ), - re_path(r"^admin/eticket/list$", EticketListView.as_view(), name="eticket_list"), - re_path(r"^admin/eticket/new$", EticketCreateView.as_view(), name="new_eticket"), - re_path( - r"^admin/eticket/(?P[0-9]+)$", + path("admin/eticket/list/", EticketListView.as_view(), name="eticket_list"), + path("admin/eticket/new/", EticketCreateView.as_view(), name="new_eticket"), + path( + "admin/eticket//", EticketEditView.as_view(), name="edit_eticket", ), - re_path( - r"^admin/selling/(?P[0-9]+)/delete$", + path( + "admin/selling//delete/", SellingDeleteView.as_view(), name="selling_delete", ), - re_path( - r"^admin/refilling/(?P[0-9]+)/delete$", + path( + "admin/refilling//delete/", RefillingDeleteView.as_view(), name="refilling_delete", ), - re_path( - r"^admin/(?P[0-9]+)/refillings$", + path( + "admin//refillings/", CounterRefillingListView.as_view(), name="refilling_list", ), diff --git a/counter/views.py b/counter/views.py index ca012688..2b9bf392 100644 --- a/counter/views.py +++ b/counter/views.py @@ -22,8 +22,10 @@ # # import json +from urllib.parse import parse_qs from django.contrib.auth.decorators import login_required +from django.db.models import F from django.shortcuts import get_object_or_404 from django.http import Http404 from django.core.exceptions import PermissionDenied @@ -300,7 +302,7 @@ class CounterClick(CounterTabsMixin, CanViewMixin, DetailView): current_tab = "counter" def render_to_response(self, *args, **kwargs): - if self.request.is_ajax(): # JSON response for AJAX requests + if self.is_ajax(self.request): response = {"errors": []} status = HTTPStatus.OK @@ -395,42 +397,40 @@ class CounterClick(CounterTabsMixin, CanViewMixin, DetailView): request.session["not_valid_student_card_uid"] = False if self.object.type != "BAR": self.operator = request.user - elif self.is_barman_price(): + elif self.customer_is_barman(): self.operator = self.customer.user else: self.operator = self.object.get_random_barman() - - if "add_product" in request.POST["action"]: + action = self.request.POST.get("action", None) + if action is None: + action = parse_qs(request.body.decode()).get("action", [""])[0] + if action == "add_product": self.add_product(request) - elif "add_student_card" in request.POST["action"]: + elif action == "add_student_card": self.add_student_card(request) - elif "del_product" in request.POST["action"]: + elif action == "del_product": self.del_product(request) - elif "refill" in request.POST["action"]: + elif action == "refill": self.refill(request) - elif "code" in request.POST["action"]: + elif action == "code": return self.parse_code(request) - elif "cancel" in request.POST["action"]: + elif action == "cancel": return self.cancel(request) - elif "finish" in request.POST["action"]: + elif action == "finish": return self.finish(request) context = self.get_context_data(object=self.object) return self.render_to_response(context) - def is_barman_price(self): - if self.object.type == "BAR" and self.customer.user.id in [ - s.id for s in self.object.get_barmen_list() - ]: - return True - else: - return False + def customer_is_barman(self) -> bool: + barmen = self.object.barmen_list + return self.object.type == "BAR" and self.customer.user in barmen def get_product(self, pid): return Product.objects.filter(pk=int(pid)).first() def get_price(self, pid): p = self.get_product(pid) - if self.is_barman_price(): + if self.customer_is_barman(): price = p.special_selling_price else: price = p.selling_price @@ -475,13 +475,22 @@ class CounterClick(CounterTabsMixin, CanViewMixin, DetailView): self.compute_record_product(request, product) ) + @staticmethod + def is_ajax(request): + # when using the fetch API, the django request.POST dict is empty + # this is but a wretched contrivance which strive to replace + # the deprecated django is_ajax() method + # and which must be replaced as soon as possible + # by a proper separation between the api endpoints of the counter + return len(request.POST) == 0 and len(request.body) != 0 + def add_product(self, request, q=1, p=None): """ Add a product to the basket q is the quantity passed as integer p is the product id, passed as an integer """ - pid = p or request.POST["product_id"] + pid = p or parse_qs(request.body.decode())["product_id"][0] pid = str(pid) price = self.get_price(pid) total = self.sum_basket(request) @@ -563,7 +572,7 @@ class CounterClick(CounterTabsMixin, CanViewMixin, DetailView): def del_product(self, request): """Delete a product from the basket""" - pid = str(request.POST["product_id"]) + pid = parse_qs(request.body.decode())["product_id"][0] product = self.get_product(pid) if pid in request.session["basket"]: if ( @@ -576,30 +585,29 @@ class CounterClick(CounterTabsMixin, CanViewMixin, DetailView): request.session["basket"][pid]["qty"] -= 1 if request.session["basket"][pid]["qty"] <= 0: del request.session["basket"][pid] - else: - request.session["basket"][pid] = None request.session.modified = True def parse_code(self, request): - """Parse the string entered by the barman""" - string = str(request.POST["code"]).upper() - if string == _("END"): + """ + Parse the string entered by the barman + This can be of two forms : + - , where the string is the code of the product + - X, where the integer is the quantity and str the code + """ + string = parse_qs(request.body.decode())["code"][0].upper() + if string == "FIN": return self.finish(request) - elif string == _("CAN"): + elif string == "ANN": return self.cancel(request) regex = re.compile(r"^((?P[0-9]+)X)?(?P[A-Z0-9]+)$") m = regex.match(string) if m is not None: nb = m.group("nb") code = m.group("code") - if nb is None: - nb = 1 - else: - nb = int(nb) + nb = int(nb) if nb is not None else 1 p = self.object.products.filter(code=code).first() if p is not None: - while nb > 0 and not self.add_product(request, nb, p.id): - nb -= 1 + self.add_product(request, nb, p.id) context = self.get_context_data(object=self.object) return self.render_to_response(context) @@ -613,7 +621,7 @@ class CounterClick(CounterTabsMixin, CanViewMixin, DetailView): for pid, infos in request.session["basket"].items(): # This duplicates code for DB optimization (prevent to load many times the same object) p = Product.objects.filter(pk=pid).first() - if self.is_barman_price(): + if self.customer_is_barman(): uprice = p.special_selling_price else: uprice = p.selling_price @@ -665,22 +673,26 @@ class CounterClick(CounterTabsMixin, CanViewMixin, DetailView): def refill(self, request): """Refill the customer's account""" - if self.get_object().type == "BAR" and self.object.can_refill(): - form = RefillForm(request.POST) - if form.is_valid(): - form.instance.counter = self.object - form.instance.operator = self.operator - form.instance.customer = self.customer - form.instance.save() - else: - self.refill_form = form - else: + if not self.object.can_refill(): raise PermissionDenied + form = RefillForm(request.POST) + if form.is_valid(): + form.instance.counter = self.object + form.instance.operator = self.operator + form.instance.customer = self.customer + form.instance.save() + else: + self.refill_form = form def get_context_data(self, **kwargs): """Add customer to the context""" kwargs = super(CounterClick, self).get_context_data(**kwargs) - kwargs["products"] = self.object.products.select_related("product_type") + products = self.object.products.select_related("product_type") + if self.customer_is_barman(): + products = products.annotate(price=F("special_selling_price")) + else: + products = products.annotate(price=F("selling_price")) + kwargs["products"] = products kwargs["categories"] = {} for product in kwargs["products"]: if product.product_type: @@ -1780,11 +1792,7 @@ def create_billing_info(request, user_id): if user.id != user_id and not user.has_perm("counter:add_billinginfo"): raise PermissionDenied() user = get_object_or_404(User, pk=user_id) - if not hasattr(user, "customer"): - customer = Customer.new_for_user(user) - customer.save() - else: - customer = get_object_or_404(Customer, user_id=user_id) + customer, _ = Customer.get_or_create(user) BillingInfo.objects.create(customer=customer) return __manage_billing_info_req(request, user_id, True) diff --git a/eboutic/models.py b/eboutic/models.py index 99fe6410..ebfb878b 100644 --- a/eboutic/models.py +++ b/eboutic/models.py @@ -245,12 +245,13 @@ class Invoice(models.Model): def validate(self): if self.validated: raise DataError(_("Invoice already validated")) + customer, created = Customer.get_or_create(user=self.user) eboutic = Counter.objects.filter(type="EBOUTIC").first() for i in self.items.all(): if i.type_id == settings.SITH_COUNTER_PRODUCTTYPE_REFILLING: new = Refilling( counter=eboutic, - customer=self.user.customer, + customer=customer, operator=self.user, amount=i.product_unit_price * i.quantity, payment_method="CARD", @@ -266,7 +267,7 @@ class Invoice(models.Model): club=product.club, product=product, seller=self.user, - customer=self.user.customer, + customer=customer, unit_price=i.product_unit_price, quantity=i.quantity, payment_method="CARD", diff --git a/eboutic/templates/eboutic/eboutic_main.jinja b/eboutic/templates/eboutic/eboutic_main.jinja index b2ff6681..529fd067 100644 --- a/eboutic/templates/eboutic/eboutic_main.jinja +++ b/eboutic/templates/eboutic/eboutic_main.jinja @@ -111,7 +111,7 @@ {% endif %}

    -

    {{ p.name }}

    +

    {{ p.name }}

    {{ p.selling_price }} €

    diff --git a/election/urls.py b/election/urls.py index 4d6b4e1e..697b2464 100644 --- a/election/urls.py +++ b/election/urls.py @@ -1,57 +1,49 @@ -from django.urls import re_path +from django.urls import path from election.views import * urlpatterns = [ - re_path(r"^$", ElectionsListView.as_view(), name="list"), - re_path(r"^archived$", ElectionListArchivedView.as_view(), name="list_archived"), - re_path(r"^add$", ElectionCreateView.as_view(), name="create"), - re_path( - r"^(?P[0-9]+)/edit$", ElectionUpdateView.as_view(), name="update" - ), - re_path( - r"^(?P[0-9]+)/delete$", ElectionDeleteView.as_view(), name="delete" - ), - re_path( - r"^(?P[0-9]+)/list/add$", + path("", ElectionsListView.as_view(), name="list"), + path("archived/", ElectionListArchivedView.as_view(), name="list_archived"), + path("add/", ElectionCreateView.as_view(), name="create"), + path("/edit/", ElectionUpdateView.as_view(), name="update"), + path("/delete/", ElectionDeleteView.as_view(), name="delete"), + path( + "/list/add/", ElectionListCreateView.as_view(), name="create_list", ), - re_path( - r"^(?P[0-9]+)/list/delete$", + path( + "/list/delete/", ElectionListDeleteView.as_view(), name="delete_list", ), - re_path( - r"^(?P[0-9]+)/role/create$", + path( + "/role/create/", RoleCreateView.as_view(), name="create_role", ), - re_path( - r"^(?P[0-9]+)/role/edit$", RoleUpdateView.as_view(), name="update_role" - ), - re_path( - r"^(?P[0-9]+)/role/delete$", + path("/role/edit/", RoleUpdateView.as_view(), name="update_role"), + path( + "/role/delete/", RoleDeleteView.as_view(), name="delete_role", ), - re_path( - r"^(?P[0-9]+)/candidate/add$", + path( + "/candidate/add/", CandidatureCreateView.as_view(), name="candidate", ), - re_path( - r"^(?P[0-9]+)/candidate/edit$", + path( + "/candidate/edit/", CandidatureUpdateView.as_view(), name="update_candidate", ), - re_path( - r"^(?P[0-9]+)/candidate/delete$", + path( + "/candidate/delete/", CandidatureDeleteView.as_view(), name="delete_candidate", ), - re_path(r"^(?P[0-9]+)/vote$", VoteFormView.as_view(), name="vote"), - re_path( - r"^(?P[0-9]+)/detail$", ElectionDetailView.as_view(), name="detail" - ), + path("/vote/", VoteFormView.as_view(), name="vote"), + path("/detail/", ElectionDetailView.as_view(), name="detail"), ] diff --git a/forum/urls.py b/forum/urls.py index de19d7cc..8926ea01 100644 --- a/forum/urls.py +++ b/forum/urls.py @@ -22,69 +22,62 @@ # # -from django.urls import re_path +from django.urls import path from forum.views import * - urlpatterns = [ - re_path(r"^$", ForumMainView.as_view(), name="main"), - re_path(r"^search/$", ForumSearchView.as_view(), name="search"), - re_path(r"^new_forum$", ForumCreateView.as_view(), name="new_forum"), - re_path( - r"^mark_all_as_read$", ForumMarkAllAsRead.as_view(), name="mark_all_as_read" - ), - re_path(r"^last_unread$", ForumLastUnread.as_view(), name="last_unread"), - re_path( - r"^favorite_topics$", ForumFavoriteTopics.as_view(), name="favorite_topics" - ), - re_path(r"^(?P[0-9]+)$", ForumDetailView.as_view(), name="view_forum"), - re_path(r"^(?P[0-9]+)/edit$", ForumEditView.as_view(), name="edit_forum"), - re_path( - r"^(?P[0-9]+)/delete$", ForumDeleteView.as_view(), name="delete_forum" - ), - re_path( - r"^(?P[0-9]+)/new_topic$", + path("", ForumMainView.as_view(), name="main"), + path("search/", ForumSearchView.as_view(), name="search"), + path("new_forum/", ForumCreateView.as_view(), name="new_forum"), + path("mark_all_as_read/", ForumMarkAllAsRead.as_view(), name="mark_all_as_read"), + path("last_unread/", ForumLastUnread.as_view(), name="last_unread"), + path("favorite_topics/", ForumFavoriteTopics.as_view(), name="favorite_topics"), + path("/", ForumDetailView.as_view(), name="view_forum"), + path("/edit/", ForumEditView.as_view(), name="edit_forum"), + path("/delete/", ForumDeleteView.as_view(), name="delete_forum"), + path( + "/new_topic/", ForumTopicCreateView.as_view(), name="new_topic", ), - re_path( - r"^topic/(?P[0-9]+)$", + path( + "topic//", ForumTopicDetailView.as_view(), name="view_topic", ), - re_path( - r"^topic/(?P[0-9]+)/edit$", + path( + "topic//edit/", ForumTopicEditView.as_view(), name="edit_topic", ), - re_path( - r"^topic/(?P[0-9]+)/new_message$", + path( + "topic//new_message/", ForumMessageCreateView.as_view(), name="new_message", ), - re_path( - r"^topic/(?P[0-9]+)/toggle_subscribe$", + path( + "topic//toggle_subscribe/", ForumTopicSubscribeView.as_view(), name="toggle_subscribe_topic", ), - re_path( - r"^message/(?P[0-9]+)$", + path( + "message//", ForumMessageView.as_view(), name="view_message", ), - re_path( - r"^message/(?P[0-9]+)/edit$", + path( + "message//edit/", ForumMessageEditView.as_view(), name="edit_message", ), - re_path( - r"^message/(?P[0-9]+)/delete$", + path( + "message//delete/", ForumMessageDeleteView.as_view(), name="delete_message", ), - re_path( - r"^message/(?P[0-9]+)/undelete$", + path( + "message//undelete/", ForumMessageUndeleteView.as_view(), name="undelete_message", ), diff --git a/galaxy/models.py b/galaxy/models.py index a6f9c907..cc4a3e72 100644 --- a/galaxy/models.py +++ b/galaxy/models.py @@ -26,7 +26,6 @@ import math import logging from typing import Tuple - from django.db import models from django.db.models import Q, Case, F, Value, When, Count from django.db.models.functions import Concat diff --git a/galaxy/tests.py b/galaxy/tests.py index 595844b2..d5957a16 100644 --- a/galaxy/tests.py +++ b/galaxy/tests.py @@ -142,8 +142,4 @@ class GalaxyTest(TestCase): Galaxy.rule() self.client.login(username="root", password="plop") response = self.client.get("/galaxy/2/") - self.assertContains( - response, - "Ce citoyen n'a pas encore rejoint la galaxie", - status_code=404, - ) + self.assertEquals(response.status_code, 404) diff --git a/launderette/urls.py b/launderette/urls.py index b259c2d9..7bc214c0 100644 --- a/launderette/urls.py +++ b/launderette/urls.py @@ -22,54 +22,54 @@ # # -from django.urls import re_path +from django.urls import path from launderette.views import * urlpatterns = [ # views - re_path(r"^$", LaunderetteMainView.as_view(), name="launderette_main"), - re_path( - r"^slot/(?P[0-9]+)/delete$", + path("", LaunderetteMainView.as_view(), name="launderette_main"), + path( + "slot//delete/", SlotDeleteView.as_view(), name="delete_slot", ), - re_path(r"^book$", LaunderetteBookMainView.as_view(), name="book_main"), - re_path( - r"^book/(?P[0-9]+)$", + path("book/", LaunderetteBookMainView.as_view(), name="book_main"), + path( + "book//", LaunderetteBookView.as_view(), name="book_slot", ), - re_path( - r"^(?P[0-9]+)/click$", + path( + "/click/", LaunderetteMainClickView.as_view(), name="main_click", ), - re_path( - r"^(?P[0-9]+)/click/(?P[0-9]+)$", + path( + "/click//", LaunderetteClickView.as_view(), name="click", ), - re_path(r"^admin$", LaunderetteListView.as_view(), name="launderette_list"), - re_path( - r"^admin/(?P[0-9]+)$", + path("admin/", LaunderetteListView.as_view(), name="launderette_list"), + path( + "admin//", LaunderetteAdminView.as_view(), name="launderette_admin", ), - re_path( - r"^admin/(?P[0-9]+)/edit$", + path( + "admin//edit/", LaunderetteEditView.as_view(), name="launderette_edit", ), - re_path(r"^admin/new$", LaunderetteCreateView.as_view(), name="launderette_new"), - re_path(r"^admin/machine/new$", MachineCreateView.as_view(), name="machine_new"), - re_path( - r"^admin/machine/(?P[0-9]+)/edit$", + path("admin/new/", LaunderetteCreateView.as_view(), name="launderette_new"), + path("admin/machine/new/", MachineCreateView.as_view(), name="machine_new"), + path( + "admin/machine//edit/", MachineEditView.as_view(), name="machine_edit", ), - re_path( - r"^admin/machine/(?P[0-9]+)/delete$", + path( + "admin/machine//delete/", MachineDeleteView.as_view(), name="machine_delete", ), diff --git a/locale/fr/LC_MESSAGES/django.po b/locale/fr/LC_MESSAGES/django.po index 2ae9a68b..6cbc0b3a 100644 --- a/locale/fr/LC_MESSAGES/django.po +++ b/locale/fr/LC_MESSAGES/django.po @@ -3070,7 +3070,7 @@ msgid "Eboutic invoices" msgstr "Facture eboutic" #: core/templates/core/user_account.jinja:57 -#: core/templates/core/user_tools.jinja:37 counter/views.py:795 +#: core/templates/core/user_tools.jinja:37 counter/views.py:787 msgid "Etickets" msgstr "Etickets" @@ -3381,7 +3381,7 @@ msgstr "Achats" msgid "Product top 10" msgstr "Top 10 produits" -#: core/templates/core/user_stats.jinja:27 counter/forms.py:176 +#: core/templates/core/user_stats.jinja:27 counter/forms.py:168 msgid "Product" msgstr "Produit" @@ -3717,24 +3717,24 @@ msgstr "Galaxie" msgid "User already has a profile picture" msgstr "L'utilisateur a déjà une photo de profil" -#: counter/app.py:31 counter/models.py:341 counter/models.py:750 -#: counter/models.py:786 launderette/models.py:41 stock/models.py:43 +#: counter/app.py:31 counter/models.py:340 counter/models.py:749 +#: counter/models.py:779 launderette/models.py:41 stock/models.py:43 msgid "counter" msgstr "comptoir" -#: counter/forms.py:38 +#: counter/forms.py:30 msgid "This UID is invalid" msgstr "Cet UID est invalide" -#: counter/forms.py:77 +#: counter/forms.py:69 msgid "User not found" msgstr "Utilisateur non trouvé" -#: counter/forms.py:125 +#: counter/forms.py:117 msgid "Parent product" msgstr "Produit parent" -#: counter/forms.py:131 +#: counter/forms.py:123 msgid "Buying groups" msgstr "Groupes d'achat" @@ -3758,7 +3758,7 @@ msgstr "client" msgid "customers" msgstr "clients" -#: counter/models.py:126 counter/views.py:317 +#: counter/models.py:126 counter/views.py:309 msgid "Not enough money" msgstr "Solde insuffisant" @@ -3774,133 +3774,133 @@ msgstr "Nom de famille" msgid "Address 1" msgstr "Adresse 1" -#: counter/models.py:160 +#: counter/models.py:161 msgid "Address 2" msgstr "Adresse 2" -#: counter/models.py:161 +#: counter/models.py:163 msgid "Zip code" msgstr "Code postal" -#: counter/models.py:162 +#: counter/models.py:164 msgid "City" msgstr "Ville" -#: counter/models.py:163 +#: counter/models.py:165 msgid "Country" msgstr "Pays" -#: counter/models.py:206 counter/models.py:234 +#: counter/models.py:209 counter/models.py:237 msgid "product type" msgstr "type du produit" -#: counter/models.py:240 +#: counter/models.py:243 msgid "purchase price" msgstr "prix d'achat" -#: counter/models.py:241 +#: counter/models.py:244 msgid "selling price" msgstr "prix de vente" -#: counter/models.py:242 +#: counter/models.py:245 msgid "special selling price" msgstr "prix de vente spécial" -#: counter/models.py:244 +#: counter/models.py:247 msgid "icon" msgstr "icône" -#: counter/models.py:249 +#: counter/models.py:252 msgid "limit age" msgstr "âge limite" -#: counter/models.py:250 +#: counter/models.py:253 msgid "tray price" msgstr "prix plateau" -#: counter/models.py:254 +#: counter/models.py:257 msgid "parent product" msgstr "produit parent" -#: counter/models.py:260 +#: counter/models.py:263 msgid "buying groups" msgstr "groupe d'achat" -#: counter/models.py:262 election/models.py:52 +#: counter/models.py:265 election/models.py:52 msgid "archived" msgstr "archivé" -#: counter/models.py:265 counter/models.py:881 +#: counter/models.py:268 counter/models.py:874 msgid "product" msgstr "produit" -#: counter/models.py:322 +#: counter/models.py:321 msgid "products" msgstr "produits" -#: counter/models.py:325 +#: counter/models.py:324 msgid "counter type" msgstr "type de comptoir" -#: counter/models.py:327 +#: counter/models.py:326 msgid "Bar" msgstr "Bar" -#: counter/models.py:327 +#: counter/models.py:326 msgid "Office" msgstr "Bureau" -#: counter/models.py:330 +#: counter/models.py:329 msgid "sellers" msgstr "vendeurs" -#: counter/models.py:338 launderette/models.py:207 +#: counter/models.py:337 launderette/models.py:207 msgid "token" msgstr "jeton" -#: counter/models.py:493 +#: counter/models.py:492 msgid "bank" msgstr "banque" -#: counter/models.py:495 counter/models.py:585 +#: counter/models.py:494 counter/models.py:584 msgid "is validated" msgstr "est validé" -#: counter/models.py:498 +#: counter/models.py:497 msgid "refilling" msgstr "rechargement" -#: counter/models.py:562 eboutic/models.py:288 +#: counter/models.py:561 eboutic/models.py:292 msgid "unit price" msgstr "prix unitaire" -#: counter/models.py:563 counter/models.py:866 eboutic/models.py:289 +#: counter/models.py:562 counter/models.py:859 eboutic/models.py:293 msgid "quantity" msgstr "quantité" -#: counter/models.py:582 +#: counter/models.py:581 msgid "Sith account" msgstr "Compte utilisateur" -#: counter/models.py:582 sith/settings.py:383 sith/settings.py:388 -#: sith/settings.py:408 +#: counter/models.py:581 sith/settings.py:359 sith/settings.py:364 +#: sith/settings.py:384 msgid "Credit card" msgstr "Carte bancaire" -#: counter/models.py:588 +#: counter/models.py:587 msgid "selling" msgstr "vente" -#: counter/models.py:615 +#: counter/models.py:614 msgid "Unknown event" msgstr "Événement inconnu" -#: counter/models.py:616 +#: counter/models.py:615 #, python-format msgid "Eticket bought for the event %(event)s" msgstr "Eticket acheté pour l'événement %(event)s" -#: counter/models.py:618 counter/models.py:641 +#: counter/models.py:617 counter/models.py:640 #, python-format msgid "" "You bought an eticket for the event %(event)s.\n" @@ -3912,59 +3912,59 @@ msgstr "" "Vous pouvez également retrouver tous vos e-tickets sur votre page de compte " "%(url)s." -#: counter/models.py:755 +#: counter/models.py:754 msgid "last activity date" msgstr "dernière activité" -#: counter/models.py:758 +#: counter/models.py:757 msgid "permanency" msgstr "permanence" -#: counter/models.py:791 +#: counter/models.py:784 msgid "emptied" msgstr "coffre vidée" -#: counter/models.py:794 +#: counter/models.py:787 msgid "cash register summary" msgstr "relevé de caisse" -#: counter/models.py:862 +#: counter/models.py:855 msgid "cash summary" msgstr "relevé" -#: counter/models.py:865 +#: counter/models.py:858 msgid "value" msgstr "valeur" -#: counter/models.py:867 +#: counter/models.py:860 msgid "check" msgstr "chèque" -#: counter/models.py:870 +#: counter/models.py:863 msgid "cash register summary item" msgstr "élément de relevé de caisse" -#: counter/models.py:885 +#: counter/models.py:878 msgid "banner" msgstr "bannière" -#: counter/models.py:887 +#: counter/models.py:880 msgid "event date" msgstr "date de l'événement" -#: counter/models.py:889 +#: counter/models.py:882 msgid "event title" msgstr "titre de l'événement" -#: counter/models.py:891 +#: counter/models.py:884 msgid "secret" msgstr "secret" -#: counter/models.py:947 +#: counter/models.py:940 msgid "uid" msgstr "uid" -#: counter/models.py:952 +#: counter/models.py:945 msgid "student cards" msgstr "cartes étudiante" @@ -4016,7 +4016,7 @@ msgstr "Liste des relevés de caisse" msgid "Theoric sums" msgstr "Sommes théoriques" -#: counter/templates/counter/cash_summary_list.jinja:36 counter/views.py:1073 +#: counter/templates/counter/cash_summary_list.jinja:36 counter/views.py:1065 msgid "Emptied" msgstr "Coffre vidé" @@ -4074,11 +4074,11 @@ msgstr "Terminer" msgid "Refilling" msgstr "Rechargement" -#: counter/templates/counter/counter_click.jinja:193 counter/views.py:586 +#: counter/templates/counter/counter_click.jinja:193 counter/views.py:578 msgid "END" msgstr "FIN" -#: counter/templates/counter/counter_click.jinja:193 counter/views.py:588 +#: counter/templates/counter/counter_click.jinja:193 counter/views.py:580 msgid "CAN" msgstr "ANN" @@ -4244,109 +4244,109 @@ msgstr "Temps" msgid "Top 100 barman %(counter_name)s (all semesters)" msgstr "Top 100 barman %(counter_name)s (tous les semestres)" -#: counter/views.py:175 +#: counter/views.py:167 msgid "Cash summary" msgstr "Relevé de caisse" -#: counter/views.py:189 +#: counter/views.py:181 msgid "Last operations" msgstr "Dernières opérations" -#: counter/views.py:204 +#: counter/views.py:196 msgid "Take items from stock" msgstr "Prendre des éléments du stock" -#: counter/views.py:257 +#: counter/views.py:249 msgid "Bad credentials" msgstr "Mauvais identifiants" -#: counter/views.py:259 +#: counter/views.py:251 msgid "User is not barman" msgstr "L'utilisateur n'est pas barman." -#: counter/views.py:264 +#: counter/views.py:256 msgid "Bad location, someone is already logged in somewhere else" msgstr "Mauvais comptoir, quelqu'un est déjà connecté ailleurs" -#: counter/views.py:308 +#: counter/views.py:300 msgid "Too young for that product" msgstr "Trop jeune pour ce produit" -#: counter/views.py:311 +#: counter/views.py:303 msgid "Not allowed for that product" msgstr "Non autorisé pour ce produit" -#: counter/views.py:314 +#: counter/views.py:306 msgid "No date of birth provided" msgstr "Pas de date de naissance renseignée" -#: counter/views.py:611 +#: counter/views.py:603 msgid "You have not enough money to buy all the basket" msgstr "Vous n'avez pas assez d'argent pour acheter le panier" -#: counter/views.py:759 +#: counter/views.py:751 msgid "Counter administration" msgstr "Administration des comptoirs" -#: counter/views.py:761 +#: counter/views.py:753 msgid "Stocks" msgstr "Stocks" -#: counter/views.py:780 +#: counter/views.py:772 msgid "Product types" msgstr "Types de produit" -#: counter/views.py:1030 +#: counter/views.py:1022 msgid "10 cents" msgstr "10 centimes" -#: counter/views.py:1031 +#: counter/views.py:1023 msgid "20 cents" msgstr "20 centimes" -#: counter/views.py:1032 +#: counter/views.py:1024 msgid "50 cents" msgstr "50 centimes" -#: counter/views.py:1033 +#: counter/views.py:1025 msgid "1 euro" msgstr "1 €" -#: counter/views.py:1034 +#: counter/views.py:1026 msgid "2 euros" msgstr "2 €" -#: counter/views.py:1035 +#: counter/views.py:1027 msgid "5 euros" msgstr "5 €" -#: counter/views.py:1036 +#: counter/views.py:1028 msgid "10 euros" msgstr "10 €" -#: counter/views.py:1037 +#: counter/views.py:1029 msgid "20 euros" msgstr "20 €" -#: counter/views.py:1038 +#: counter/views.py:1030 msgid "50 euros" msgstr "50 €" -#: counter/views.py:1040 +#: counter/views.py:1032 msgid "100 euros" msgstr "100 €" -#: counter/views.py:1043 counter/views.py:1049 counter/views.py:1055 -#: counter/views.py:1061 counter/views.py:1067 +#: counter/views.py:1035 counter/views.py:1041 counter/views.py:1047 +#: counter/views.py:1053 counter/views.py:1059 msgid "Check amount" msgstr "Montant du chèque" -#: counter/views.py:1046 counter/views.py:1052 counter/views.py:1058 -#: counter/views.py:1064 counter/views.py:1070 +#: counter/views.py:1038 counter/views.py:1044 counter/views.py:1050 +#: counter/views.py:1056 counter/views.py:1062 msgid "Check quantity" msgstr "Nombre de chèque" -#: counter/views.py:1684 +#: counter/views.py:1676 msgid "people(s)" msgstr "personne(s)" @@ -4371,37 +4371,37 @@ msgstr "Votre panier est vide" msgid "%(name)s : this product does not exist." msgstr "%(name)s : ce produit n'existe pas." -#: eboutic/forms.py:150 +#: eboutic/forms.py:134 #, python-format msgid "%(name)s : this product does not exist or may no longer be available." msgstr "%(name)s : ce produit n'existe pas ou n'est peut-être plus disponible." -#: eboutic/forms.py:157 +#: eboutic/forms.py:141 #, python-format msgid "You cannot buy %(nbr)d %(name)s." msgstr "Vous ne pouvez pas acheter %(nbr)d %(name)s." -#: eboutic/models.py:237 +#: eboutic/models.py:241 msgid "validated" msgstr "validé" -#: eboutic/models.py:247 +#: eboutic/models.py:251 msgid "Invoice already validated" msgstr "Facture déjà validée" -#: eboutic/models.py:285 +#: eboutic/models.py:289 msgid "product id" msgstr "ID du produit" -#: eboutic/models.py:286 +#: eboutic/models.py:290 msgid "product name" msgstr "nom du produit" -#: eboutic/models.py:287 +#: eboutic/models.py:291 msgid "product type id" msgstr "id du type du produit" -#: eboutic/models.py:304 +#: eboutic/models.py:308 msgid "basket" msgstr "panier" @@ -4467,18 +4467,18 @@ msgstr "" "Vous devez renseigner vos coordonnées de facturation si vous voulez payer " "par carte bancaire" -#: eboutic/templates/eboutic/eboutic_makecommand.jinja:111 +#: eboutic/templates/eboutic/eboutic_makecommand.jinja:112 msgid "Pay with credit card" msgstr "Payer avec une carte bancaire" -#: eboutic/templates/eboutic/eboutic_makecommand.jinja:115 +#: eboutic/templates/eboutic/eboutic_makecommand.jinja:116 msgid "" "AE account payment disabled because your basket contains refilling items." msgstr "" "Paiement par compte AE désactivé parce que votre panier contient des bons de " "rechargement." -#: eboutic/templates/eboutic/eboutic_makecommand.jinja:120 +#: eboutic/templates/eboutic/eboutic_makecommand.jinja:121 msgid "Pay with Sith account" msgstr "Payer avec un compte AE" diff --git a/matmat/urls.py b/matmat/urls.py index 80960c59..6e657262 100644 --- a/matmat/urls.py +++ b/matmat/urls.py @@ -22,13 +22,13 @@ # # -from django.urls import re_path +from django.urls import path from matmat.views import * urlpatterns = [ - re_path(r"^$", SearchNormalFormView.as_view(), name="search"), - re_path(r"^reverse$", SearchReverseFormView.as_view(), name="search_reverse"), - re_path(r"^quick$", SearchQuickFormView.as_view(), name="search_quick"), - re_path(r"^clear$", SearchClearFormView.as_view(), name="search_clear"), + path("", SearchNormalFormView.as_view(), name="search"), + path("reverse/", SearchReverseFormView.as_view(), name="search_reverse"), + path("quick/", SearchQuickFormView.as_view(), name="search_quick"), + path("clear/", SearchClearFormView.as_view(), name="search_clear"), ] diff --git a/pedagogy/tests.py b/pedagogy/tests.py index a429bf02..d889f881 100644 --- a/pedagogy/tests.py +++ b/pedagogy/tests.py @@ -732,9 +732,9 @@ class UVSearchTest(TestCase): [ { "id": 1, - "absolute_url": "/pedagogy/uv/1", - "update_url": "/pedagogy/uv/1/edit", - "delete_url": "/pedagogy/uv/1/delete", + "absolute_url": "/pedagogy/uv/1/", + "update_url": "/pedagogy/uv/1/edit/", + "delete_url": "/pedagogy/uv/1/delete/", "code": "PA00", "author": 0, "credit_type": "OM", diff --git a/pedagogy/urls.py b/pedagogy/urls.py index 478d7ad1..8cfca8d2 100644 --- a/pedagogy/urls.py +++ b/pedagogy/urls.py @@ -22,33 +22,33 @@ # # -from django.urls import re_path +from django.urls import path from pedagogy.views import * urlpatterns = [ # Urls displaying the actual application for visitors - re_path(r"^$", UVListView.as_view(), name="guide"), - re_path(r"^uv/(?P[0-9]+)$", UVDetailFormView.as_view(), name="uv_detail"), - re_path( - r"^comment/(?P[0-9]+)/edit$", + path("", UVListView.as_view(), name="guide"), + path("uv//", UVDetailFormView.as_view(), name="uv_detail"), + path( + "comment//edit/", UVCommentUpdateView.as_view(), name="comment_update", ), - re_path( - r"^comment/(?P[0-9]+)/delete$", + path( + "comment//delete/", UVCommentDeleteView.as_view(), name="comment_delete", ), - re_path( - r"^comment/(?P[0-9]+)/report$", + path( + "comment//report/", UVCommentReportCreateView.as_view(), name="comment_report", ), # Moderation - re_path(r"^moderation$", UVModerationFormView.as_view(), name="moderation"), + path("moderation/", UVModerationFormView.as_view(), name="moderation"), # Administration : Create Update Delete Edit - re_path(r"^uv/create$", UVCreateView.as_view(), name="uv_create"), - re_path(r"^uv/(?P[0-9]+)/delete$", UVDeleteView.as_view(), name="uv_delete"), - re_path(r"^uv/(?P[0-9]+)/edit$", UVUpdateView.as_view(), name="uv_update"), + path("uv/create/", UVCreateView.as_view(), name="uv_create"), + path("uv//delete/", UVDeleteView.as_view(), name="uv_delete"), + path("uv//edit/", UVUpdateView.as_view(), name="uv_update"), ] diff --git a/rootplace/tests.py b/rootplace/tests.py index b8fbbe1e..19ee86e4 100644 --- a/rootplace/tests.py +++ b/rootplace/tests.py @@ -21,7 +21,212 @@ # Place - Suite 330, Boston, MA 02111-1307, USA. # # +from datetime import date, timedelta +from django.core.management import call_command from django.test import TestCase +from django.urls import reverse -# Create your tests here. +from club.models import Club +from core.models import User, RealGroup +from counter.models import Customer, Product, Selling, Counter, Refilling +from subscription.models import Subscription + + +class MergeUserTest(TestCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + call_command("populate") + cls.ae = Club.objects.get(unix_name="ae") + cls.eboutic = Counter.objects.get(name="Eboutic") + cls.barbar = Product.objects.get(code="BARB") + cls.barbar.selling_price = 2 + cls.barbar.save() + cls.root = User.objects.get(username="root") + + def setUp(self) -> None: + super().setUp() + self.to_keep = User(username="to_keep", password="plop", email="u.1@utbm.fr") + self.to_delete = User(username="to_del", password="plop", email="u.2@utbm.fr") + self.to_keep.save() + self.to_delete.save() + self.client.login(username="root", password="plop") + + def test_simple(self): + self.to_delete.first_name = "Biggus" + self.to_keep.last_name = "Dickus" + self.to_keep.nick_name = "B'ian" + self.to_keep.address = "Jerusalem" + self.to_delete.parent_address = "Rome" + self.to_delete.address = "Rome" + subscribers = RealGroup.objects.get(name="Subscribers") + mde_admin = RealGroup.objects.get(name="MDE admin") + sas_admin = RealGroup.objects.get(name="SAS admin") + self.to_keep.groups.add(subscribers.id) + self.to_delete.groups.add(mde_admin.id) + self.to_keep.groups.add(sas_admin.id) + self.to_delete.groups.add(sas_admin.id) + self.to_delete.save() + self.to_keep.save() + data = {"user1": self.to_keep.id, "user2": self.to_delete.id} + res = self.client.post(reverse("rootplace:merge"), data) + self.assertRedirects(res, self.to_keep.get_absolute_url()) + self.assertFalse(User.objects.filter(pk=self.to_delete.pk).exists()) + self.to_keep = User.objects.get(pk=self.to_keep.pk) + # fields of to_delete should be assigned to to_keep + # if they were not set beforehand + self.assertEqual("Biggus", self.to_keep.first_name) + self.assertEqual("Dickus", self.to_keep.last_name) + self.assertEqual("B'ian", self.to_keep.nick_name) + self.assertEqual("Jerusalem", self.to_keep.address) + self.assertEqual("Rome", self.to_keep.parent_address) + self.assertEqual(3, self.to_keep.groups.count()) + groups = list(self.to_keep.groups.all()) + expected = [subscribers, mde_admin, sas_admin] + self.assertCountEqual(groups, expected) + + def test_both_subscribers_and_with_account(self): + Customer(user=self.to_keep, account_id="11000l", amount=0).save() + Customer(user=self.to_delete, account_id="12000m", amount=0).save() + Refilling( + amount=10, + operator=self.root, + customer=self.to_keep.customer, + counter=self.eboutic, + ).save() + Refilling( + amount=20, + operator=self.root, + customer=self.to_delete.customer, + counter=self.eboutic, + ).save() + Selling( + label="barbar", + counter=self.eboutic, + club=self.ae, + product=self.barbar, + customer=self.to_keep.customer, + seller=self.root, + unit_price=2, + quantity=2, + payment_method="SITH_ACCOUNT", + ).save() + Selling( + label="barbar", + counter=self.eboutic, + club=self.ae, + product=self.barbar, + customer=self.to_delete.customer, + seller=self.root, + unit_price=2, + quantity=4, + payment_method="SITH_ACCOUNT", + ).save() + today = date.today() + # both subscriptions began last month and shall end in 5 months + Subscription( + member=self.to_keep, + subscription_type="un-semestre", + payment_method="EBOUTIC", + subscription_start=today - timedelta(30), + subscription_end=today + timedelta(5 * 30), + ).save() + Subscription( + member=self.to_delete, + subscription_type="un-semestre", + payment_method="EBOUTIC", + subscription_start=today - timedelta(30), + subscription_end=today + timedelta(5 * 30), + ).save() + data = {"user1": self.to_keep.id, "user2": self.to_delete.id} + res = self.client.post(reverse("rootplace:merge"), data) + self.to_keep = User.objects.get(pk=self.to_keep.id) + self.assertRedirects(res, self.to_keep.get_absolute_url()) + # to_keep had 10€ at first and bought 2 barbar worth 2€ each + # to_delete had 20€ and bought 4 barbar + # total should be 10 - 4 + 20 - 8 = 18 + self.assertAlmostEqual(18, self.to_keep.customer.amount, delta=0.0001) + self.assertEqual(2, self.to_keep.customer.buyings.count()) + self.assertEqual(2, self.to_keep.customer.refillings.count()) + self.assertTrue(self.to_keep.is_subscribed) + # to_keep had 5 months of subscription remaining and received + # 5 more months from to_delete, so he should be subscribed for 10 months + self.assertEqual( + today + timedelta(10 * 30), + self.to_keep.subscriptions.order_by("subscription_end") + .last() + .subscription_end, + ) + + def test_godfathers(self): + users = list(User.objects.all()[:4]) + self.to_keep.godfathers.add(users[0]) + self.to_keep.godchildren.add(users[1]) + self.to_delete.godfathers.add(users[2]) + self.to_delete.godfathers.add(self.to_keep) + self.to_delete.godchildren.add(users[3]) + data = {"user1": self.to_keep.id, "user2": self.to_delete.id} + res = self.client.post(reverse("rootplace:merge"), data) + self.assertRedirects(res, self.to_keep.get_absolute_url()) + self.to_keep = User.objects.get(pk=self.to_keep.id) + self.assertCountEqual(list(self.to_keep.godfathers.all()), [users[0], users[2]]) + self.assertCountEqual( + list(self.to_keep.godchildren.all()), [users[1], users[3]] + ) + + def test_keep_has_no_account(self): + Customer(user=self.to_delete, account_id="12000m", amount=0).save() + Refilling( + amount=20, + operator=self.root, + customer=self.to_delete.customer, + counter=self.eboutic, + ).save() + Selling( + label="barbar", + counter=self.eboutic, + club=self.ae, + product=self.barbar, + customer=self.to_delete.customer, + seller=self.root, + unit_price=2, + quantity=4, + payment_method="SITH_ACCOUNT", + ).save() + data = {"user1": self.to_keep.id, "user2": self.to_delete.id} + res = self.client.post(reverse("rootplace:merge"), data) + self.to_keep = User.objects.get(pk=self.to_keep.id) + self.assertRedirects(res, self.to_keep.get_absolute_url()) + # to_delete had 20€ and bought 4 barbar worth 2€ each + # total should be 20 - 8 = 12 + self.assertTrue(hasattr(self.to_keep, "customer")) + self.assertAlmostEqual(12, self.to_keep.customer.amount, delta=0.0001) + + def test_delete_has_no_account(self): + Customer(user=self.to_keep, account_id="12000m", amount=0).save() + Refilling( + amount=20, + operator=self.root, + customer=self.to_keep.customer, + counter=self.eboutic, + ).save() + Selling( + label="barbar", + counter=self.eboutic, + club=self.ae, + product=self.barbar, + customer=self.to_keep.customer, + seller=self.root, + unit_price=2, + quantity=4, + payment_method="SITH_ACCOUNT", + ).save() + data = {"user1": self.to_keep.id, "user2": self.to_delete.id} + res = self.client.post(reverse("rootplace:merge"), data) + self.to_keep = User.objects.get(pk=self.to_keep.id) + self.assertRedirects(res, self.to_keep.get_absolute_url()) + # to_keep had 20€ and bought 4 barbar worth 2€ each + # total should be 20 - 8 = 12 + self.assertTrue(hasattr(self.to_keep, "customer")) + self.assertAlmostEqual(12, self.to_keep.customer.amount, delta=0.0001) diff --git a/rootplace/urls.py b/rootplace/urls.py index 33b3bd6d..696fb81e 100644 --- a/rootplace/urls.py +++ b/rootplace/urls.py @@ -23,16 +23,16 @@ # # -from django.urls import re_path +from django.urls import path from rootplace.views import * urlpatterns = [ - re_path(r"^merge$", MergeUsersView.as_view(), name="merge"), - re_path( - r"^forum/messages/delete$", + path("merge/", MergeUsersView.as_view(), name="merge"), + path( + "forum/messages/delete/", DeleteAllForumUserMessagesView.as_view(), name="delete_forum_messages", ), - re_path(r"^logs$", OperationLogListView.as_view(), name="operation_logs"), + path("logs/", OperationLogListView.as_view(), name="operation_logs"), ] diff --git a/rootplace/views.py b/rootplace/views.py index 802262fc..fbb04e79 100644 --- a/rootplace/views.py +++ b/rootplace/views.py @@ -23,72 +23,114 @@ # # -from django.utils.translation import gettext as _ -from django.views.generic.edit import FormView -from django.views.generic import ListView -from django.urls import reverse +from ajax_select.fields import AutoCompleteSelectField from django import forms from django.core.exceptions import PermissionDenied +from django.urls import reverse +from django.utils import timezone +from django.utils.translation import gettext as _ +from django.views.generic import ListView +from django.views.generic.edit import FormView -from ajax_select.fields import AutoCompleteSelectField - +from core.models import User, OperationLog, SithFile from core.views import CanEditPropMixin -from core.models import User, OperationLog from counter.models import Customer - from forum.models import ForumMessageMeta -def merge_users(u1, u2): - u1.nick_name = u1.nick_name or u2.nick_name - u1.date_of_birth = u1.date_of_birth or u2.date_of_birth - u1.home = u1.home or u2.home - u1.sex = u1.sex or u2.sex - u1.pronouns = u1.pronouns or u2.pronouns - u1.tshirt_size = u1.tshirt_size or u2.tshirt_size - u1.role = u1.role or u2.role - u1.department = u1.department or u2.department - u1.dpt_option = u1.dpt_option or u2.dpt_option - u1.semester = u1.semester or u2.semester - u1.quote = u1.quote or u2.quote - u1.school = u1.school or u2.school - u1.promo = u1.promo or u2.promo - u1.forum_signature = u1.forum_signature or u2.forum_signature - u1.second_email = u1.second_email or u2.second_email - u1.phone = u1.phone or u2.phone - u1.parent_phone = u1.parent_phone or u2.parent_phone - u1.address = u1.address or u2.address - u1.parent_address = u1.parent_address or u2.parent_address +def __merge_subscriptions(u1: User, u2: User): + """ + Give all the subscriptions of the second user to first one + If some subscriptions are still active, update their end date + to increase the overall subscription time of the first user. + + Some examples : + - if u1 is not subscribed, his subscription end date become the one of u2 + - if u1 is subscribed but not u2, nothing happen + - if u1 is subscribed for, let's say, 2 remaining months and u2 is subscribed for 3 remaining months, + he shall then be subscribed for 5 months + """ + last_subscription = ( + u1.subscriptions.filter( + subscription_start__lte=timezone.now(), subscription_end__gte=timezone.now() + ) + .order_by("subscription_end") + .last() + ) + if last_subscription is not None: + subscription_end = last_subscription.subscription_end + for subscription in u2.subscriptions.filter( + subscription_end__gte=timezone.now() + ): + subscription.subscription_start = subscription_end + if subscription.subscription_start > timezone.now().date(): + remaining = subscription.subscription_end - timezone.now().date() + else: + remaining = ( + subscription.subscription_end - subscription.subscription_start + ) + subscription_end += remaining + subscription.subscription_end = subscription_end + subscription.save() + u2.subscriptions.all().update(member=u1) + + +def __merge_pictures(u1: User, u2: User) -> None: + SithFile.objects.filter(owner=u2).update(owner=u1) + if u1.profile_pict is None and u2.profile_pict is not None: + u1.profile_pict, u2.profile_pict = u2.profile_pict, None + if u1.scrub_pict is None and u2.scrub_pict is not None: + u1.scrub_pict, u2.scrub_pict = u2.scrub_pict, None + if u1.avatar_pict is None and u2.avatar_pict is not None: + u1.avatar_pict, u2.avatar_pict = u2.avatar_pict, None + u2.save() u1.save() - for u in u2.godfathers.all(): - u1.godfathers.add(u) + + +def merge_users(u1: User, u2: User) -> User: + """ + Merge u2 into u1 + This means that u1 shall receive everything that belonged to u2 : + + - pictures + - refills of the sith account + - purchases of any item bought on the eboutic or the counters + - subscriptions + - godfathers + - godchildren + + If u1 had no account id, he shall receive the one of u2. + If u1 and u2 were both in the middle of a subscription, the remaining + durations stack + If u1 had no profile picture, he shall receive the one of u2 + """ + for field in u1._meta.fields: + if not field.is_relation and not u1.__dict__[field.name]: + u1.__dict__[field.name] = u2.__dict__[field.name] + for group in u2.groups.all(): + u1.groups.add(group.id) + for godfather in u2.godfathers.exclude(id=u1.id): + u1.godfathers.add(godfather) + for godchild in u2.godchildren.exclude(id=u1.id): + u1.godchildren.add(godchild) + __merge_subscriptions(u1, u2) + __merge_pictures(u1, u2) + u2.invoices.all().update(user=u1) + c_src = Customer.objects.filter(user=u2).first() + if c_src is not None: + c_dest, created = Customer.get_or_create(u1) + c_src.refillings.update(customer=c_dest) + c_src.buyings.update(customer=c_dest) + c_dest.recompute_amount() + if created: + # swap the account numbers, so that the user keep + # the id he is accustomed to + tmp_id = c_src.account_id + # delete beforehand in order not to have a unique constraint violation + c_src.delete() + c_dest.account_id = tmp_id u1.save() - for i in u2.invoices.all(): - for f in i._meta.local_fields: # I have sadly not found anything better :/ - if f.name == "date": - f.auto_now = False - u1.invoices.add(i) - u1.save() - s1 = User.objects.filter(id=u1.id).first() - s2 = User.objects.filter(id=u2.id).first() - for s in s2.subscriptions.all(): - s1.subscriptions.add(s) - s1.save() - c1 = Customer.objects.filter(user__id=u1.id).first() - c2 = Customer.objects.filter(user__id=u2.id).first() - if c1 and c2: - for r in c2.refillings.all(): - c1.refillings.add(r) - c1.save() - for s in c2.buyings.all(): - c1.buyings.add(s) - c1.save() - elif c2 and not c1: - c2.user = u1 - c1 = c2 - c1.save() - c1.recompute_amount() - u2.delete() + u2.delete() # everything remaining in u2 gets deleted thanks to on_delete=CASCADE return u1 @@ -128,9 +170,8 @@ class MergeUsersView(FormView): form_class = MergeForm def dispatch(self, request, *arg, **kwargs): - res = super(MergeUsersView, self).dispatch(request, *arg, **kwargs) if request.user.is_root: - return res + return super().dispatch(request, *arg, **kwargs) raise PermissionDenied def form_valid(self, form): @@ -140,7 +181,7 @@ class MergeUsersView(FormView): return super(MergeUsersView, self).form_valid(form) def get_success_url(self): - return reverse("core:user_profile", kwargs={"user_id": self.final_user.id}) + return self.final_user.get_absolute_url() class DeleteAllForumUserMessagesView(FormView): diff --git a/sas/urls.py b/sas/urls.py index fada615f..28a2a152 100644 --- a/sas/urls.py +++ b/sas/urls.py @@ -22,40 +22,36 @@ # # -from django.urls import re_path +from django.urls import path from sas.views import * urlpatterns = [ - re_path(r"^$", SASMainView.as_view(), name="main"), - re_path(r"^moderation$", ModerationView.as_view(), name="moderation"), - re_path(r"^album/(?P[0-9]+)$", AlbumView.as_view(), name="album"), - re_path( - r"^album/(?P[0-9]+)/upload$", + path("", SASMainView.as_view(), name="main"), + path("moderation/", ModerationView.as_view(), name="moderation"), + path("album//", AlbumView.as_view(), name="album"), + path( + "album//upload/", AlbumUploadView.as_view(), name="album_upload", ), - re_path( - r"^album/(?P[0-9]+)/edit$", AlbumEditView.as_view(), name="album_edit" - ), - re_path(r"^album/(?P[0-9]+)/preview$", send_album, name="album_preview"), - re_path(r"^picture/(?P[0-9]+)$", PictureView.as_view(), name="picture"), - re_path( - r"^picture/(?P[0-9]+)/edit$", + path("album//edit/", AlbumEditView.as_view(), name="album_edit"), + path("album//preview/", send_album, name="album_preview"), + path("picture//", PictureView.as_view(), name="picture"), + path( + "picture//edit/", PictureEditView.as_view(), name="picture_edit", ), - re_path(r"^picture/(?P[0-9]+)/download$", send_pict, name="download"), - re_path( - r"^picture/(?P[0-9]+)/download/compressed$", + path("picture//download/", send_pict, name="download"), + path( + "picture//download/compressed/", send_compressed, name="download_compressed", ), - re_path( - r"^picture/(?P[0-9]+)/download/thumb$", + path( + "picture//download/thumb/", send_thumb, name="download_thumb", ), - # re_path(r'^album/new$', AlbumCreateView.as_view(), name='album_new'), - # re_path(r'^(?P[0-9]+)/$', ClubView.as_view(), name='club_view'), ] diff --git a/sith/settings.py b/sith/settings.py index 8cce1144..69ecddc4 100644 --- a/sith/settings.py +++ b/sith/settings.py @@ -291,6 +291,10 @@ SITH_URL = "my.url.git.an" SITH_NAME = "Sith website" SITH_TWITTER = "@ae_utbm" +# Enable experimental features +# Enable/Disable the galaxy button on user profile (urls stay activated) +SITH_ENABLE_GALAXY = False + # AE configuration # TODO: keep only that first setting, with the ID, and do the same for the other clubs SITH_MAIN_CLUB_ID = 1 diff --git a/stock/urls.py b/stock/urls.py index 59bc466b..cf7ff13f 100644 --- a/stock/urls.py +++ b/stock/urls.py @@ -23,67 +23,65 @@ # # -from django.urls import include, re_path +from django.urls import path from stock.views import * urlpatterns = [ # Stock re_paths - re_path( - r"^new/counter/(?P[0-9]+)$", StockCreateView.as_view(), name="new" - ), - re_path(r"^edit/(?P[0-9]+)$", StockEditView.as_view(), name="edit"), - re_path(r"^list$", StockListView.as_view(), name="list"), + path("new/counter//", StockCreateView.as_view(), name="new"), + path("edit//", StockEditView.as_view(), name="edit"), + path("list/", StockListView.as_view(), name="list"), # StockItem re_paths - re_path(r"^(?P[0-9]+)$", StockItemList.as_view(), name="items_list"), - re_path( - r"^(?P[0-9]+)/stock_item/new_item$", + path("/", StockItemList.as_view(), name="items_list"), + path( + "/stock_item/new_item/", StockItemCreateView.as_view(), name="new_item", ), - re_path( - r"^stock_item/(?P[0-9]+)/edit$", + path( + "stock_item//edit/", StockItemEditView.as_view(), name="edit_item", ), - re_path( - r"^(?P[0-9]+)/stock_item/take_items$", + path( + "/stock_item/take_items/", StockTakeItemsBaseFormView.as_view(), name="take_items", ), # ShoppingList re_paths - re_path( - r"^(?P[0-9]+)/shopping_list/list$", + path( + "/shopping_list/list/", StockShoppingListView.as_view(), name="shoppinglist_list", ), - re_path( - r"^(?P[0-9]+)/shopping_list/create$", + path( + "/shopping_list/create/", StockItemQuantityBaseFormView.as_view(), name="shoppinglist_create", ), - re_path( - r"^(?P[0-9]+)/shopping_list/(?P[0-9]+)/items$", + path( + "/shopping_list//items/", StockShoppingListItemListView.as_view(), name="shoppinglist_items", ), - re_path( - r"^(?P[0-9]+)/shopping_list/(?P[0-9]+)/delete$", + path( + "/shopping_list//delete/", StockShoppingListDeleteView.as_view(), name="shoppinglist_delete", ), - re_path( - r"^(?P[0-9]+)/shopping_list/(?P[0-9]+)/set_done$", + path( + "/shopping_list//set_done/", StockShopppingListSetDone.as_view(), name="shoppinglist_set_done", ), - re_path( - r"^(?P[0-9]+)/shopping_list/(?P[0-9]+)/set_todo$", + path( + "/shopping_list//set_todo/", StockShopppingListSetTodo.as_view(), name="shoppinglist_set_todo", ), - re_path( - r"^(?P[0-9]+)/shopping_list/(?P[0-9]+)/update_stock$", + path( + "/shopping_list//update_stock/", StockUpdateAfterShopppingBaseFormView.as_view(), name="update_after_shopping", ), diff --git a/subscription/models.py b/subscription/models.py index b724b734..8461ac6e 100644 --- a/subscription/models.py +++ b/subscription/models.py @@ -24,7 +24,6 @@ from datetime import date, timedelta from django.db import models -from django.utils import timezone from django.utils.translation import gettext_lazy as _ from django.conf import settings from django.core.exceptions import ValidationError @@ -101,8 +100,8 @@ class Subscription(models.Model): super(Subscription, self).save() from counter.models import Customer - if not Customer.objects.filter(user=self.member).exists(): - Customer.new_for_user(self.member).save() + _, created = Customer.get_or_create(self.member) + if created: form = PasswordResetForm({"email": self.member.email}) if form.is_valid(): form.save( @@ -166,7 +165,4 @@ class Subscription(models.Model): return user.is_in_group(settings.SITH_MAIN_BOARD_GROUP) or user.is_root def is_valid_now(self): - return ( - self.subscription_start <= date.today() - and date.today() <= self.subscription_end - ) + return self.subscription_start <= date.today() <= self.subscription_end diff --git a/subscription/urls.py b/subscription/urls.py index d398197a..daf1c7d1 100644 --- a/subscription/urls.py +++ b/subscription/urls.py @@ -22,12 +22,12 @@ # # -from django.urls import re_path +from django.urls import path from subscription.views import * urlpatterns = [ # Subscription views - re_path(r"^$", NewSubscription.as_view(), name="subscription"), - re_path(r"stats", SubscriptionsStatsView.as_view(), name="stats"), + path("", NewSubscription.as_view(), name="subscription"), + path("stats/", SubscriptionsStatsView.as_view(), name="stats"), ] diff --git a/trombi/urls.py b/trombi/urls.py index 9858ea65..49ac42db 100644 --- a/trombi/urls.py +++ b/trombi/urls.py @@ -23,67 +23,65 @@ # # -from django.urls import re_path +from django.urls import path from trombi.views import * urlpatterns = [ - re_path(r"^(?P[0-9]+)/new$", TrombiCreateView.as_view(), name="create"), - re_path( - r"^(?P[0-9]+)/export$", TrombiExportView.as_view(), name="export" - ), - re_path(r"^(?P[0-9]+)/edit$", TrombiEditView.as_view(), name="edit"), - re_path( - r"^(?P[0-9]+)/moderate_comments$", + path("/new/", TrombiCreateView.as_view(), name="create"), + path("/export/", TrombiExportView.as_view(), name="export"), + path("/edit/", TrombiEditView.as_view(), name="edit"), + path( + "/moderate_comments/", TrombiModerateCommentsView.as_view(), name="moderate_comments", ), - re_path( - r"^(?P[0-9]+)/moderate$", + path( + "/moderate/", TrombiModerateCommentView.as_view(), name="moderate_comment", ), - re_path( - r"^user/(?P[0-9]+)/delete$", + path( + "user//delete/", TrombiDeleteUserView.as_view(), name="delete_user", ), - re_path(r"^(?P[0-9]+)$", TrombiDetailView.as_view(), name="detail"), - re_path( - r"^(?P[0-9]+)/new_comment$", + path("/", TrombiDetailView.as_view(), name="detail"), + path( + "/new_comment/", TrombiCommentCreateView.as_view(), name="new_comment", ), - re_path( - r"^(?P[0-9]+)/profile$", + path( + "/profile/", UserTrombiProfileView.as_view(), name="user_profile", ), - re_path( - r"^comment/(?P[0-9]+)/edit$", + path( + "comment//edit/", TrombiCommentEditView.as_view(), name="edit_comment", ), - re_path(r"^tools$", UserTrombiToolsView.as_view(), name="user_tools"), - re_path(r"^profile$", UserTrombiEditProfileView.as_view(), name="profile"), - re_path(r"^pictures$", UserTrombiEditPicturesView.as_view(), name="pictures"), - re_path( - r"^reset_memberships$", + path("tools/", UserTrombiToolsView.as_view(), name="user_tools"), + path("profile/", UserTrombiEditProfileView.as_view(), name="profile"), + path("pictures/", UserTrombiEditPicturesView.as_view(), name="pictures"), + path( + "reset_memberships/", UserTrombiResetClubMembershipsView.as_view(), name="reset_memberships", ), - re_path( - r"^membership/(?P[0-9]+)/edit$", + path( + "membership//edit/", UserTrombiEditMembershipView.as_view(), name="edit_membership", ), - re_path( - r"^membership/(?P[0-9]+)/delete$", + path( + "membership//delete/", UserTrombiDeleteMembershipView.as_view(), name="delete_membership", ), - re_path( - r"^membership/(?P[0-9]+)/create$", + path( + "membership//create/", UserTrombiAddMembershipView.as_view(), name="create_membership", ),