@farris/ui-vue
Version:
Farris Vue, a Farris Design based Vue3 component library.
2 lines • 77.3 kB
JavaScript
(function(E,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue"),require("lodash-es"),require("bignumber.js"),require("../common/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","bignumber.js","../common/index.umd.js"],r):(E=typeof globalThis<"u"?globalThis:E||self,r(E.uploader={},E.Vue,E.LodashES,E.BigNumber,E.common))})(this,function(E,r,X,ma,lt){"use strict";var fa=Object.defineProperty;var pa=(E,r,X)=>r in E?fa(E,r,{enumerable:!0,configurable:!0,writable:!0,value:X}):E[r]=X;var L=(E,r,X)=>pa(E,typeof r!="symbol"?r+"":r,X);const ct={checked:{type:Boolean,default:!1},id:{type:String,default:""},disabled:{type:Boolean,default:!1}},ut={showInfo:{type:Boolean,default:!0},status:{type:String,default:"normal"},percent:{type:Number,default:0},maxWidth:{type:Number,default:0}},dt={selectText:{type:String,default:"选择文件"},disabled:{type:Boolean,default:!1},enableMulti:{type:Boolean,default:!0},accept:{type:String,default:"*"},options:{type:Object,default:{}},uploadedCount:{type:Number,default:0},extendConfig:{type:Object,default:{}},uploadServerToken:{type:String,default:""}},ft=r.defineComponent({name:"FUploadProgress",props:ut,setup(t,e){const{showInfo:n,status:a,maxWidth:o,percent:i}=r.toRefs(t);return()=>r.createVNode("div",{class:["f-progress upload-progress","upload-progress-status-"+a.value,"f-progress-status-"+a.value,"upload-progress-line",n.value?"upload-progress-show-info":""]},[r.createVNode("div",{class:"upload-progress-outer",style:{"max-width":o.value>0?o.value+"px":"auto"}},[r.createVNode("div",{class:"upload-progress-inner"},[r.createVNode("div",{class:"upload-progress-bg f-progress-bg",style:{width:i.value+"%"}},null)])]),n.value?r.createVNode("span",{class:"upload-progress-text"},[a.value==="error"||a.value==="success"?r.createVNode("span",{class:["upload-progress-text-icon f-icon","f-icon-"+a.value]},null):r.createVNode(r.Fragment,null,[i.value,r.createTextVNode("%")])]):""])}}),Ve=r.defineComponent({name:"FPreviewCheckbox",props:ct,emits:["checkedChange"],setup(t,e){const{disabled:n}=r.toRefs(t),a=r.ref(t.checked),o=i=>{i.stopPropagation(),n.value||(a.value=!a.value,e.emit("checkedChange",{checked:a.value,id:t.id}))};return r.watch(()=>t.checked,i=>{a.value=i}),()=>r.createVNode("div",{class:"preview-checkbox d-inline-flex align-middle"},[r.createVNode("div",{class:"custom-control custom-checkbox f-checkradio-single m-0"},[r.createVNode("input",{title:"custom-control-input",class:"custom-control-input",type:"checkbox",disabled:n.value,checked:a.value},null),r.createVNode("label",{class:"custom-control-label",onClick:i=>o(i),onMousedown:i=>i.stopPropagation()},null)])])}}),ke=r.defineComponent({name:"FFileSelect",props:dt,emits:["change","stateChange"],setup(t,e){const n=r.inject("uploaderService");n.setUploadContext(e);const a=r.getCurrentInstance(),o=r.ref("*");let i;const l=()=>{i.files&&(e.emit("change",i.files),n.handleFiles(i.files),i.value=null)};function s(){i.value=null,n.reset()}r.watch(()=>t.disabled,()=>{s()}),r.watch(()=>t.uploadedCount,d=>{n.setOptions({uploadedCount:d})}),r.watch(()=>t.extendConfig,d=>{n.setExtendServerConfig(d)});function f(d){d&&d.stopPropagation(),i.click()}function c(d){n.handleUploadEvent(d)}return r.onMounted(()=>{var d,m;i=(d=a==null?void 0:a.proxy)==null?void 0:d.$refs.uploadInput,s(),n.setOptions(t.options),n.setExtendServerConfig(t.extendConfig),o.value=(((m=t.options)==null?void 0:m.allowedContentTypes)||["*"]).join(",")}),r.onUnmounted(()=>{}),e.expose({handleUploadEvent:c}),()=>r.createVNode(r.Fragment,null,[r.createVNode("input",{ref:"uploadInput",type:"file",class:"ffileupload--browser",disabled:t.disabled,multiple:t.enableMulti,accept:o.value,onChange:()=>l(),style:"width: 10px",title:"uploadInput"},null),r.createVNode("div",{class:["upload-container",t.disabled?"f-state-disabled":""],onClick:d=>f(d),title:t.selectText},[r.createVNode("i",{class:"f-icon f-icon-upload upload-icon",style:"top: 2px;position: relative;"},null),t.selectText])])}}),Ce={},Pe={};function be(t){const{properties:e,title:n,ignore:a}=t,o=a&&Array.isArray(a),i=Object.keys(e).reduce((l,s)=>((!o||!a.find(f=>f===s))&&(l[s]=e[s].type==="object"&&e[s].properties?be(e[s]):X.cloneDeep(e[s].default)),l),{});if(n&&(!o||!a.find(l=>l==="id"))){const l=n.toLowerCase().replace(/-/g,"_");i.id=`${l}_${Math.random().toString().slice(2,6)}`}return i}function pt(t){const{properties:e,title:n,required:a}=t;if(a&&Array.isArray(a)){const o=a.reduce((i,l)=>(i[l]=e[l].type==="object"&&e[l].properties?be(e[l]):X.cloneDeep(e[l].default),i),{});if(n&&a.find(i=>i==="id")){const i=n.toLowerCase().replace(/-/g,"_");o.id=`${i}_${Math.random().toString().slice(2,6)}`}return o}return{type:n}}function Fe(t,e={},n){const a=Ce[t];if(a){let o=pt(a);const i=Pe[t];return o=i?i({getSchemaByType:Fe},o,e,n):o,o}return null}function mt(t,e){const n=be(e);return Object.keys(n).reduce((a,o)=>(Object.prototype.hasOwnProperty.call(t,o)&&(a[o]&&X.isPlainObject(a[o])&&X.isPlainObject(t[o]||!t[o])?Object.assign(a[o],t[o]||{}):a[o]=t[o]),a),n),n}function Oe(t,e){return Object.keys(t).filter(a=>t[a]!=null).reduce((a,o)=>{if(e.has(o)){const i=e.get(o);if(typeof i=="string")a[i]=t[o];else{const l=i(o,t[o],t);Object.assign(a,l)}}else a[o]=t[o];return a},{})}function ht(t,e,n=new Map){const a=mt(t,e);return Oe(a,n)}function gt(t={}){function e(c,d,m,h){if(typeof m=="number")return h[c].length===m;if(typeof m=="object"){const v=Object.keys(m)[0],g=m[v];if(v==="not")return Number(h[c].length)!==Number(g);if(v==="moreThan")return Number(h[c].length)>=Number(g);if(v==="lessThan")return Number(h[c].length)<=Number(g)}return!1}function n(c,d,m,h){return h[c]&&h[c].propertyValue&&String(h[c].propertyValue.value)===String(m)}const a=new Map([["length",e],["getProperty",n]]);Object.keys(t).reduce((c,d)=>(c.set(d,t[d]),c),a);function o(c,d){const m=c;return typeof d=="number"?[{target:m,operator:"length",param:null,value:Number(d)}]:typeof d=="boolean"?[{target:m,operator:"getProperty",param:c,value:!!d}]:typeof d=="object"?Object.keys(d).map(h=>{if(h==="length")return{target:m,operator:"length",param:null,value:d[h]};const v=h,g=d[h];return{target:m,operator:"getProperty",param:v,value:g}}):[]}function i(c){return Object.keys(c).reduce((m,h)=>{const v=o(h,c[h]);return m.push(...v),m},[])}function l(c,d){if(a.has(c.operator)){const m=a.get(c.operator);return m&&m(c.target,c.param,c.value,d)||!1}return!1}function s(c,d){return i(c).reduce((v,g)=>v&&l(g,d),!0)}function f(c,d){const m=Object.keys(c),h=m.includes("allOf"),v=m.includes("anyOf"),g=h||v,M=(g?c[g?h?"allOf":"anyOf":"allOf"]:[c]).map(T=>s(T,d));return h?!M.includes(!1):M.includes(!0)}return{parseValueSchema:f}}const wt={},yt={};gt();function bt(t,e,n=new Map,a=(l,s,f,c)=>s,o={},i=l=>l){return Ce[e.title]=e,Pe[e.title]=a,wt[e.title]=o,yt[e.title]=i,(l={},s=!0)=>{if(!s)return Oe(l,n);const f=ht(l,e,n),c=Object.keys(t).reduce((d,m)=>(d[m]=t[m].default,d),{});return Object.assign(c,f)}}const Nt={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/uploader.schema.json",title:"uploader",description:"A Farris Component",type:"object",properties:{id:{description:"The unique identifier for uploader",type:"string"},type:{description:"The type string of uploader",type:"string",default:"uploader"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},disable:{type:"boolean",default:!1},placeholder:{description:"",type:"string",default:""},readonly:{description:"",type:"boolean",default:!1},tabindex:{description:"",type:"number",default:-1},visible:{description:"",type:"boolean",default:!0}},required:["id","type"]};function vt(t,e){return{customClass:e.class,customStyle:e.style}}const xt=new Map([["appearance",vt]]);function Tt(t,e,n){return e}const Dt={title:"uploader",description:"A Farris Component",type:"object",categories:{basic:{description:"Basic Infomation",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"waiting for modification",enum:[]}}}},appearance:{description:"外观",title:"外观",properties:{contentFill:{description:"内容填充",title:"内容填充",type:"boolean"}}},server:{description:"服务器配置",title:"服务器配置",properties:{rootId:{description:"附件服务器根目录",title:"附件服务器根目录",type:"string"},formId:{description:"必填,根据【附件信息】业务字段所在位置区分:1、在子表,二级目录建议绑定主表ID。2:在主表:二级目录建议填写当前表数据ID",title:"二级目录",type:"string"}}},upload:{description:"上传配置",title:"上传配置",properties:{uploadVisible:{description:"上传按钮是否可见",title:"上传是否可见",type:"boolean"},uploadDisabled:{description:"禁用时,上传按钮可见,但不可用",title:"上传是否禁用",type:"boolean"},allowEmpty:{description:"运行时是否允许不上传附件",title:"是否允许为空",type:"boolean"},uploadSelectText:{description:"选择文件按钮文本",title:"选择文件按钮文本",type:"string"},uploadOptions:{description:"附件上传配置",title:"附件上传配置",type:"cascade",isExpand:!0,properties:{maxUploads:{description:"值为0时表示不限制上传个数",title:"最大上传个数",type:"number"},maxFileSize:{description:"单个附件最大值(MB)",title:"单个附件最大值(MB)",type:"number"},allowedContentTypes:{description:"允许上传附件类型",title:"允许上传附件类型",type:"string"},notAllowedCharsInFileName:{description:"文件名禁用字符",title:"文件名禁用字符",type:"string"}}},enableUploadedCount:{description:"是否启用已上传个数限制",title:"是否启用已上传个数限制",type:"select",editor:{type:"waiting for modification",enum:[]}},uploadEnableMulti:{description:"是否启用多选附件上传",title:"是否启用多选附件上传",type:"select",editor:{type:"waiting for modification",enum:[]}},enableSliceUpload:{description:"是否启用分片上传",title:"是否启用分片上传",type:"select",editor:{type:"waiting for modification",enum:[]}},chunkSize:{description:"分片上传时,每片的大小。单位:M",title:"分片大小(M)",type:"number"}}},preview:{description:"附件预览",title:"附件预览",properties:{previewVisible:{description:"预览是否可见",title:"预览是否可见",type:"boolean"},previewReadonly:{description:"预览是否只读",title:"预览是否只读",type:"boolean"},fieldIdKey:{description:"附件ID字段",title:"附件ID字段",type:"string",editor:{type:"field-selector"}},fileNameKey:{description:"附件名称字段",title:"附件名称字段",type:"string",editor:{type:"field-selector"}},previewEnableMulti:{description:"是否启用批量操作",title:"是否启用批量操作",type:"boolean"},noDelete:{description:"是否禁止删除附件",title:"是否禁止删除附件",type:"boolean"},noPreview:{description:"是否禁止预览",title:"是否禁止预览",type:"boolean"},previewDateFormat:{description:"附件上传时间字段的格式化设置,请注意此属性仅针对附件上传时间一个字段,若有自定义预览列,请在预览列编辑器中单独设置时间格式。",title:"附件上传时间格式化",type:"select",editor:{type:"waiting for modification",enum:[]}},fileSortOrderKey:{description:"排序字段",title:"排序字段",type:"string"},orderType:{description:"排序类型",title:"排序类型",type:"select",editor:{type:"waiting for modification",enum:[]}}}}}},ue={contentFill:{type:Boolean,default:!1},orderField:{type:String,default:"createTime"},previewColumns:{type:Array,default:[{field:"name",width:200,title:"文件名",checkbox:!0},{field:"size",width:100,title:"大小"},{field:"createTime",width:100,title:"日期"},{field:"state",width:100,title:"状态"},{field:"action",width:100,title:"操作"}]},previewVisible:{type:Boolean,default:!0},previewEnableMulti:{type:Boolean,default:!0},previewDefaultRename:{type:String,default:""},uploadDisabled:{type:Boolean,default:!1},uploadVisible:{type:Boolean,default:!0},uploadSelectText:{type:String,default:"选择文件"},uploadEnableMulti:{type:Boolean,default:!0},uploadedCount:{type:Number,default:0},disabled:{type:Boolean,default:!1},downloadButtonDisable:{type:Boolean,default:!1},previewButtonDisable:{type:Boolean,default:!1},deleteButtonDisable:{type:Boolean,default:!1},customInfo:{type:String,default:""},fileInfos:{type:Array,default:[]},uploadOptions:{type:Object,default:null},extendConfig:{type:Object,default:{}},uploadServerToken:{type:String,default:""},notifyServiceToken:{type:String,default:""}},Ne=bt(ue,Nt,xt,Tt,Dt),Mt={jan:1,feb:2,mar:3,apr:4,may:5,jun:6,jul:7,aug:8,sep:9,oct:10,nov:11,dec:12},St={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6};class Vt{constructor(){L(this,"regexes",{YEAR:"[1-9]\\d{3}",MONTH:"1[0-2]|0?[1-9]",MONTH2:"1[0-2]|0[1-9]",MONTHNAME:"jan|january|feb|february|mar|march|apr|april|may|jun|june|jul|july|aug|august|sep|september|oct|october|nov|november|dec|december",DAYNAME:"mon|monday|tue|tuesday|wed|wednesday|thu|thursday|fri|friday|sat|saturday|sun|sunday",DAY:"3[01]|[12]\\d|0?[1-9]",DAY2:"3[01]|[12]\\d|0[1-9]",TIMEZONE:"[+-][01]\\d\\:?[0-5]\\d",H24:"[01]\\d|2[0-3]",MIN:"[0-5]\\d",SEC:"[0-5]\\d",MS:"\\d{3,}",H12:"0?[1-9]|1[012]",AMPM:"am|pm",UNIT:"year|month|week|day|hour|minute|second|millisecond"});L(this,"patterns",[["iso_8601",this.makePattern("^(_YEAR_)-(_MONTH_)-(_DAY_)$"),"$2/$3/$1"],["us",this.makePattern("^(_MONTH_)([\\/-])(_DAY_)\\2(_YEAR_)$"),"$1/$3/$4"],["world",this.makePattern("^(_DAY_)([\\/\\.])(_MONTH_)\\2(_YEAR_)$"),"$3/$1/$4"],["chicago",this.makePattern("^(?:(?:_DAYNAME_),? )?(_DAY_)([ -])(_MONTHNAME_)\\2(_YEAR_)$"),"$3 $1, $4"],["conversational",this.makePattern("^(?:(?:_DAYNAME_),? )?(_MONTHNAME_) (_DAY_),? (_YEAR_)$"),"$1 $2, $3"],["month_day_time_year",this.makePattern("^(?:_DAYNAME_) (_MONTHNAME_) (_DAY_) ((?:_H24_)\\:(?:_MIN_)(?:\\:_SEC_)?) (_TIMEZONE_) (_YEAR_)$"),e=>{const n=(""+this.getMonthByName(e[1])).padStart(2,"0"),a=(""+e[2]).padStart(2,"0"),o=e[5],i=e[3],l=e[4],s=o+"-"+n+"-"+a+"T"+i+l;return isNaN(s)?!1:s}],["unix",/^@(-?\d+)$/,e=>this.create(parseInt(e[1],10)*1e3)],["24_hour",this.makePattern("^(?:(.+?)(?: |T))?(_H24_)\\:(_MIN_)(?:\\:(_SEC_)(?:\\.(_MS_))?)? ?(?:GMT)?(_TIMEZONE_)?(?: \\([A-Z]+\\))?$"),e=>{let n;const a=e[1];if(a){if(n=this.create(a),isNaN(n))return!1}else n=new Date,n.setMilliseconds(0);const o=e[2],i=e[3],l=e[4],s=e[5];return n.setHours(parseFloat(o),parseFloat(i),parseFloat(l||0)),s&&n.setMilliseconds(+String(s).slice(0,3)),n}],["12_hour",this.makePattern("^(?:(.+) )?(_H12_)(?:\\:(_MIN_)(?:\\:(_SEC_))?)? ?(_AMPM_)$"),e=>{let n;const a=e[1];if(a){if(n=this.create(a),isNaN(n))return!1}else n=new Date,n.setMilliseconds(0);let o=parseFloat(e[2]);o=e[5].toLowerCase()==="am"?o===12?0:o:o===12?12:o+12;const i=e[3],l=e[4];return n.setHours(o,parseFloat(i||0),parseFloat(l||0)),n}]])}makePattern(e){return e=e.replace(/_([A-Z][A-Z0-9]+)_/g,(n,a)=>this.regexes[a]),new RegExp(e,"i")}getMonthByName(e){return Mt[String(e).slice(0,3).toLowerCase()]}getWeekdayByName(e){return St[String(e).slice(0,3).toLowerCase()]}parse(e){if(!isNaN(Number(e)))return new Date(e);if(e=String(e).replace(/^\s*(.*)\s*$/,"$1"),e=e.replace(/\s{2,}/g," "),e==="")return Date.now();let n=0;for(;n<this.patterns.length;){const a=this.patterns[n];let o,i;typeof a[0]=="string"?(i=a[1],o=a[2]):(i=a[0],o=a[1]);const l=e.match(i);if(!l){n++;continue}if(typeof o=="function"){const s=o(l);if(s instanceof Date)return s}else{const s=Date.parse(e.replace(i,o));if(!isNaN(s))return new Date(s)}n++}return NaN}create(e){return e==null?Date.now():e instanceof Date?e:this.parse(e)}}function z(t){const e=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&e==="[object Date]"?new t.constructor(+t):typeof t=="number"||e==="[object Number]"||typeof t=="string"||e==="[object String]"?new Date(t):new Date(NaN)}function Z(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}const Ee=6048e5,kt=864e5,Ae=6e4,He=36e5;let Ct={};function de(){return Ct}function ae(t,e){var s,f,c,d;const n=de(),a=(e==null?void 0:e.weekStartsOn)??((f=(s=e==null?void 0:e.locale)==null?void 0:s.options)==null?void 0:f.weekStartsOn)??n.weekStartsOn??((d=(c=n.locale)==null?void 0:c.options)==null?void 0:d.weekStartsOn)??0,o=z(t),i=o.getDay(),l=(i<a?7:0)+i-a;return o.setDate(o.getDate()-l),o.setHours(0,0,0,0),o}function fe(t){return ae(t,{weekStartsOn:1})}function Be(t){const e=z(t),n=e.getFullYear(),a=Z(t,0);a.setFullYear(n+1,0,4),a.setHours(0,0,0,0);const o=fe(a),i=Z(t,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const l=fe(i);return e.getTime()>=o.getTime()?n+1:e.getTime()>=l.getTime()?n:n-1}function _e(t){const e=z(t);return e.setHours(0,0,0,0),e}function Re(t){const e=z(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function Pt(t,e){const n=_e(t),a=_e(e),o=+n-Re(n),i=+a-Re(a);return Math.round((o-i)/kt)}function Ft(t){const e=Be(t),n=Z(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),fe(n)}function Ot(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function Ye(t){if(!Ot(t)&&typeof t!="number")return!1;const e=z(t);return!isNaN(Number(e))}function Et(t){const e=z(t),n=Z(t,0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}const At={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Ht=(t,e,n)=>{let a;const o=At[t];return typeof o=="string"?a=o:e===1?a=o.one:a=o.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+a:a+" ago":a};function ve(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const Bt={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},_t={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Rt={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Yt={date:ve({formats:Bt,defaultWidth:"full"}),time:ve({formats:_t,defaultWidth:"full"}),dateTime:ve({formats:Rt,defaultWidth:"full"})},jt={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Wt=(t,e,n,a)=>jt[t];function re(t){return(e,n)=>{const a=n!=null&&n.context?String(n.context):"standalone";let o;if(a==="formatting"&&t.formattingValues){const l=t.defaultFormattingWidth||t.defaultWidth,s=n!=null&&n.width?String(n.width):l;o=t.formattingValues[s]||t.formattingValues[l]}else{const l=t.defaultWidth,s=n!=null&&n.width?String(n.width):t.defaultWidth;o=t.values[s]||t.values[l]}const i=t.argumentCallback?t.argumentCallback(e):e;return o[i]}}const qt={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},$t={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Ut={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Lt={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},zt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Qt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Xt={ordinalNumber:(t,e)=>{const n=Number(t),a=n%100;if(a>20||a<10)switch(a%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:re({values:qt,defaultWidth:"wide"}),quarter:re({values:$t,defaultWidth:"wide",argumentCallback:t=>t-1}),month:re({values:Ut,defaultWidth:"wide"}),day:re({values:Lt,defaultWidth:"wide"}),dayPeriod:re({values:zt,defaultWidth:"wide",formattingValues:Qt,defaultFormattingWidth:"wide"})};function oe(t){return(e,n={})=>{const a=n.width,o=a&&t.matchPatterns[a]||t.matchPatterns[t.defaultMatchWidth],i=e.match(o);if(!i)return null;const l=i[0],s=a&&t.parsePatterns[a]||t.parsePatterns[t.defaultParseWidth],f=Array.isArray(s)?Gt(s,m=>m.test(l)):It(s,m=>m.test(l));let c;c=t.valueCallback?t.valueCallback(f):f,c=n.valueCallback?n.valueCallback(c):c;const d=e.slice(l.length);return{value:c,rest:d}}}function It(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function Gt(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function Zt(t){return(e,n={})=>{const a=e.match(t.matchPattern);if(!a)return null;const o=a[0],i=e.match(t.parsePattern);if(!i)return null;let l=t.valueCallback?t.valueCallback(i[0]):i[0];l=n.valueCallback?n.valueCallback(l):l;const s=e.slice(o.length);return{value:l,rest:s}}}const Jt=/^(\d+)(th|st|nd|rd)?/i,Kt=/\d+/i,en={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},tn={any:[/^b/i,/^(a|c)/i]},nn={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},an={any:[/1/i,/2/i,/3/i,/4/i]},rn={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},on={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},sn={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},ln={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},cn={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},un={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},dn={ordinalNumber:Zt({matchPattern:Jt,parsePattern:Kt,valueCallback:t=>parseInt(t,10)}),era:oe({matchPatterns:en,defaultMatchWidth:"wide",parsePatterns:tn,defaultParseWidth:"any"}),quarter:oe({matchPatterns:nn,defaultMatchWidth:"wide",parsePatterns:an,defaultParseWidth:"any",valueCallback:t=>t+1}),month:oe({matchPatterns:rn,defaultMatchWidth:"wide",parsePatterns:on,defaultParseWidth:"any"}),day:oe({matchPatterns:sn,defaultMatchWidth:"wide",parsePatterns:ln,defaultParseWidth:"any"}),dayPeriod:oe({matchPatterns:cn,defaultMatchWidth:"any",parsePatterns:un,defaultParseWidth:"any"})},fn={code:"en-US",formatDistance:Ht,formatLong:Yt,formatRelative:Wt,localize:Xt,match:dn,options:{weekStartsOn:0,firstWeekContainsDate:1}};function pn(t){const e=z(t);return Pt(e,Et(e))+1}function mn(t){const e=z(t),n=+fe(e)-+Ft(e);return Math.round(n/Ee)+1}function je(t,e){var d,m,h,v;const n=z(t),a=n.getFullYear(),o=de(),i=(e==null?void 0:e.firstWeekContainsDate)??((m=(d=e==null?void 0:e.locale)==null?void 0:d.options)==null?void 0:m.firstWeekContainsDate)??o.firstWeekContainsDate??((v=(h=o.locale)==null?void 0:h.options)==null?void 0:v.firstWeekContainsDate)??1,l=Z(t,0);l.setFullYear(a+1,0,i),l.setHours(0,0,0,0);const s=ae(l,e),f=Z(t,0);f.setFullYear(a,0,i),f.setHours(0,0,0,0);const c=ae(f,e);return n.getTime()>=s.getTime()?a+1:n.getTime()>=c.getTime()?a:a-1}function hn(t,e){var s,f,c,d;const n=de(),a=(e==null?void 0:e.firstWeekContainsDate)??((f=(s=e==null?void 0:e.locale)==null?void 0:s.options)==null?void 0:f.firstWeekContainsDate)??n.firstWeekContainsDate??((d=(c=n.locale)==null?void 0:c.options)==null?void 0:d.firstWeekContainsDate)??1,o=je(t,e),i=Z(t,0);return i.setFullYear(o,0,a),i.setHours(0,0,0,0),ae(i,e)}function gn(t,e){const n=z(t),a=+ae(n,e)-+hn(n,e);return Math.round(a/Ee)+1}function V(t,e){const n=t<0?"-":"",a=Math.abs(t).toString().padStart(e,"0");return n+a}const I={y(t,e){const n=t.getFullYear(),a=n>0?n:1-n;return V(e==="yy"?a%100:a,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):V(n+1,2)},d(t,e){return V(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(t,e){return V(t.getHours()%12||12,e.length)},H(t,e){return V(t.getHours(),e.length)},m(t,e){return V(t.getMinutes(),e.length)},s(t,e){return V(t.getSeconds(),e.length)},S(t,e){const n=e.length,a=t.getMilliseconds(),o=Math.trunc(a*Math.pow(10,n-3));return V(o,e.length)}},ee={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},We={G:function(t,e,n){const a=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(a,{width:"abbreviated"});case"GGGGG":return n.era(a,{width:"narrow"});case"GGGG":default:return n.era(a,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const a=t.getFullYear(),o=a>0?a:1-a;return n.ordinalNumber(o,{unit:"year"})}return I.y(t,e)},Y:function(t,e,n,a){const o=je(t,a),i=o>0?o:1-o;if(e==="YY"){const l=i%100;return V(l,2)}return e==="Yo"?n.ordinalNumber(i,{unit:"year"}):V(i,e.length)},R:function(t,e){const n=Be(t);return V(n,e.length)},u:function(t,e){const n=t.getFullYear();return V(n,e.length)},Q:function(t,e,n){const a=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(a);case"QQ":return V(a,2);case"Qo":return n.ordinalNumber(a,{unit:"quarter"});case"QQQ":return n.quarter(a,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(a,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(a,{width:"wide",context:"formatting"})}},q:function(t,e,n){const a=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(a);case"qq":return V(a,2);case"qo":return n.ordinalNumber(a,{unit:"quarter"});case"qqq":return n.quarter(a,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(a,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(a,{width:"wide",context:"standalone"})}},M:function(t,e,n){const a=t.getMonth();switch(e){case"M":case"MM":return I.M(t,e);case"Mo":return n.ordinalNumber(a+1,{unit:"month"});case"MMM":return n.month(a,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(a,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(a,{width:"wide",context:"formatting"})}},L:function(t,e,n){const a=t.getMonth();switch(e){case"L":return String(a+1);case"LL":return V(a+1,2);case"Lo":return n.ordinalNumber(a+1,{unit:"month"});case"LLL":return n.month(a,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(a,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(a,{width:"wide",context:"standalone"})}},w:function(t,e,n,a){const o=gn(t,a);return e==="wo"?n.ordinalNumber(o,{unit:"week"}):V(o,e.length)},I:function(t,e,n){const a=mn(t);return e==="Io"?n.ordinalNumber(a,{unit:"week"}):V(a,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):I.d(t,e)},D:function(t,e,n){const a=pn(t);return e==="Do"?n.ordinalNumber(a,{unit:"dayOfYear"}):V(a,e.length)},E:function(t,e,n){const a=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(a,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(a,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(a,{width:"short",context:"formatting"});case"EEEE":default:return n.day(a,{width:"wide",context:"formatting"})}},e:function(t,e,n,a){const o=t.getDay(),i=(o-a.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return V(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});case"eeee":default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(t,e,n,a){const o=t.getDay(),i=(o-a.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return V(i,e.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});case"cccc":default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(t,e,n){const a=t.getDay(),o=a===0?7:a;switch(e){case"i":return String(o);case"ii":return V(o,e.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(a,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(a,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(a,{width:"short",context:"formatting"});case"iiii":default:return n.day(a,{width:"wide",context:"formatting"})}},a:function(t,e,n){const o=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(t,e,n){const a=t.getHours();let o;switch(a===12?o=ee.noon:a===0?o=ee.midnight:o=a/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(t,e,n){const a=t.getHours();let o;switch(a>=17?o=ee.evening:a>=12?o=ee.afternoon:a>=4?o=ee.morning:o=ee.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let a=t.getHours()%12;return a===0&&(a=12),n.ordinalNumber(a,{unit:"hour"})}return I.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):I.H(t,e)},K:function(t,e,n){const a=t.getHours()%12;return e==="Ko"?n.ordinalNumber(a,{unit:"hour"}):V(a,e.length)},k:function(t,e,n){let a=t.getHours();return a===0&&(a=24),e==="ko"?n.ordinalNumber(a,{unit:"hour"}):V(a,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):I.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):I.s(t,e)},S:function(t,e){return I.S(t,e)},X:function(t,e,n){const a=t.getTimezoneOffset();if(a===0)return"Z";switch(e){case"X":return $e(a);case"XXXX":case"XX":return J(a);case"XXXXX":case"XXX":default:return J(a,":")}},x:function(t,e,n){const a=t.getTimezoneOffset();switch(e){case"x":return $e(a);case"xxxx":case"xx":return J(a);case"xxxxx":case"xxx":default:return J(a,":")}},O:function(t,e,n){const a=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+qe(a,":");case"OOOO":default:return"GMT"+J(a,":")}},z:function(t,e,n){const a=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+qe(a,":");case"zzzz":default:return"GMT"+J(a,":")}},t:function(t,e,n){const a=Math.trunc(t.getTime()/1e3);return V(a,e.length)},T:function(t,e,n){const a=t.getTime();return V(a,e.length)}};function qe(t,e=""){const n=t>0?"-":"+",a=Math.abs(t),o=Math.trunc(a/60),i=a%60;return i===0?n+String(o):n+String(o)+e+V(i,2)}function $e(t,e){return t%60===0?(t>0?"-":"+")+V(Math.abs(t)/60,2):J(t,e)}function J(t,e=""){const n=t>0?"-":"+",a=Math.abs(t),o=V(Math.trunc(a/60),2),i=V(a%60,2);return n+o+e+i}const Ue=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},Le=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},wn={p:Le,P:(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],a=n[1],o=n[2];if(!o)return Ue(t,e);let i;switch(a){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"});break}return i.replace("{{date}}",Ue(a,e)).replace("{{time}}",Le(o,e))}},yn=/^D+$/,bn=/^Y+$/,Nn=["D","DD","YY","YYYY"];function vn(t){return yn.test(t)}function xn(t){return bn.test(t)}function Tn(t,e,n){const a=Dn(t,e,n);if(console.warn(a),Nn.includes(t))throw new RangeError(a)}function Dn(t,e,n){const a=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${a} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Mn=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Sn=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Vn=/^'([^]*?)'?$/,kn=/''/g,Cn=/[a-zA-Z]/;function pe(t,e,n){var d,m,h,v;const a=de(),o=a.locale??fn,i=a.firstWeekContainsDate??((m=(d=a.locale)==null?void 0:d.options)==null?void 0:m.firstWeekContainsDate)??1,l=a.weekStartsOn??((v=(h=a.locale)==null?void 0:h.options)==null?void 0:v.weekStartsOn)??0,s=z(t);if(!Ye(s))throw new RangeError("Invalid time value");let f=e.match(Sn).map(g=>{const N=g[0];if(N==="p"||N==="P"){const b=wn[N];return b(g,o.formatLong)}return g}).join("").match(Mn).map(g=>{if(g==="''")return{isToken:!1,value:"'"};const N=g[0];if(N==="'")return{isToken:!1,value:Pn(g)};if(We[N])return{isToken:!0,value:g};if(N.match(Cn))throw new RangeError("Format string contains an unescaped latin alphabet character `"+N+"`");return{isToken:!1,value:g}});o.localize.preprocessor&&(f=o.localize.preprocessor(s,f));const c={firstWeekContainsDate:i,weekStartsOn:l,locale:o};return f.map(g=>{if(!g.isToken)return g.value;const N=g.value;(xn(N)||vn(N))&&Tn(N,e,String(t));const b=We[N[0]];return b(s,N,o.localize,c)}).join("")}function Pn(t){const e=t.match(Vn);return e?e[1].replace(kn,"'"):t}function xe(t,e){const a=An(t);let o;if(a.date){const f=Hn(a.date,2);o=Bn(f.restDateString,f.year)}if(!o||isNaN(o.getTime()))return new Date(NaN);const i=o.getTime();let l=0,s;if(a.time&&(l=_n(a.time),isNaN(l)))return new Date(NaN);if(a.timezone){if(s=Rn(a.timezone),isNaN(s))return new Date(NaN)}else{const f=new Date(i+l),c=new Date(0);return c.setFullYear(f.getUTCFullYear(),f.getUTCMonth(),f.getUTCDate()),c.setHours(f.getUTCHours(),f.getUTCMinutes(),f.getUTCSeconds(),f.getUTCMilliseconds()),c}return new Date(i+l+s)}const me={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Fn=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,On=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,En=/^([+-])(\d{2})(?::?(\d{2}))?$/;function An(t){const e={},n=t.split(me.dateTimeDelimiter);let a;if(n.length>2)return e;if(/:/.test(n[0])?a=n[0]:(e.date=n[0],a=n[1],me.timeZoneDelimiter.test(e.date)&&(e.date=t.split(me.timeZoneDelimiter)[0],a=t.substr(e.date.length,t.length))),a){const o=me.timezone.exec(a);o?(e.time=a.replace(o[1],""),e.timezone=o[1]):e.time=a}return e}function Hn(t,e){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),a=t.match(n);if(!a)return{year:NaN,restDateString:""};const o=a[1]?parseInt(a[1]):null,i=a[2]?parseInt(a[2]):null;return{year:i===null?o:i*100,restDateString:t.slice((a[1]||a[2]).length)}}function Bn(t,e){if(e===null)return new Date(NaN);const n=t.match(Fn);if(!n)return new Date(NaN);const a=!!n[4],o=ie(n[1]),i=ie(n[2])-1,l=ie(n[3]),s=ie(n[4]),f=ie(n[5])-1;if(a)return $n(e,s,f)?Yn(e,s,f):new Date(NaN);{const c=new Date(0);return!Wn(e,i,l)||!qn(e,o)?new Date(NaN):(c.setUTCFullYear(e,i,Math.max(o,l)),c)}}function ie(t){return t?parseInt(t):1}function _n(t){const e=t.match(On);if(!e)return NaN;const n=Te(e[1]),a=Te(e[2]),o=Te(e[3]);return Un(n,a,o)?n*He+a*Ae+o*1e3:NaN}function Te(t){return t&&parseFloat(t.replace(",","."))||0}function Rn(t){if(t==="Z")return 0;const e=t.match(En);if(!e)return 0;const n=e[1]==="+"?-1:1,a=parseInt(e[2]),o=e[3]&&parseInt(e[3])||0;return Ln(a,o)?n*(a*He+o*Ae):NaN}function Yn(t,e,n){const a=new Date(0);a.setUTCFullYear(t,0,4);const o=a.getUTCDay()||7,i=(e-1)*7+n+1-o;return a.setUTCDate(a.getUTCDate()+i),a}const jn=[31,null,31,30,31,30,31,31,30,31,30,31];function ze(t){return t%400===0||t%4===0&&t%100!==0}function Wn(t,e,n){return e>=0&&e<=11&&n>=1&&n<=(jn[e]||(ze(t)?29:28))}function qn(t,e){return e>=1&&e<=(ze(t)?366:365)}function $n(t,e,n){return e>=1&&e<=53&&n>=0&&n<=6}function Un(t,e,n){return t===24?e===0&&n===0:n>=0&&n<60&&e>=0&&e<60&&t>=0&&t<25}function Ln(t,e){return e>=0&&e<=59}function zn(){const t=new Vt;function e(n,a){var i;if(!n||typeof n=="string"&&n.indexOf("0001")===0)return"";if(n instanceof Date)return pe(n,a);let o=xe(n);if(o=="Invalid Date"&&(o=t.create(n)||new Date(n)),Ye(o))return o=xe(pe(o,"yyyy-MM-dd HH:mm:ss")),pe(o,a);if(a.indexOf("HH")===0||a.indexOf("hh")===0){const l=(i=n.match(/\d*/g))==null?void 0:i.filter(f=>f!=="").join(":");(a==="HH"||a==="hh")&&(a+=":mm");const s=xe("2024-06-05 "+l);return pe(s,a)}return""}return{formatTo:e}}const Qn=["moz","ms","webkit"];function Xn(){let t=0;return e=>{const n=new Date().getTime(),a=Math.max(0,16-(n-t)),o=setTimeout(()=>{e(n+a)},a);return t=n+a,o}}function In(){if(typeof window>"u")return()=>0;if(window.requestAnimationFrame)return window.requestAnimationFrame.bind(window);const t=Qn.filter(e=>`${e}RequestAnimationFrame`in window)[0];return t?window[`${t}RequestAnimationFrame`]:Xn()}In();var Q=(t=>(t[t.Queue=0]="Queue",t[t.Uploading=1]="Uploading",t[t.Done=2]="Done",t[t.Cancelled=3]="Cancelled",t[t.Remove=4]="Remove",t[t.Error=5]="Error",t))(Q||{});class Qe{constructor(e={},n={}){L(this,"uploadConfig");L(this,"removeConfig");const a={type:"config",url:"",timeout:0,headers:null,data:{}};this.uploadConfig=Object.assign({},a,e),this.removeConfig=Object.assign({},a,n)}}function De(t,e){const{formatTo:n}=zn();return n(t,e)}function Xe(t,e){if(!e)return"";let n="";return t.indexOf(".")===-1&&e.hasOwnProperty(t)?n=e[t]:n=t.split(".").reduce((a,o)=>a?a[o]:null,e),n}function Gn(t){return(e,n)=>{if(!e.hasOwnProperty(t)||e[t]===void 0||e[t]===null)return 1;if(!n.hasOwnProperty(t)||n[t]===void 0||n[t]===null)return-1;if(t!=="createTime"){let i="",l="";return t.indexOf(".")>-1?(i=Xe(t,e),l=Xe(t,n)):(i=e[t],l=n[t]),i>l?1:-1}const a=new Date(e[t]),o=new Date(n[t]);return a.getTime()>o.getTime()?-1:1}}function Ie(t){return(t||[]).findIndex(n=>n==="*")===-1}function Ge(t){return t!=="0 Byte"}function se(t){if(t===0)return"0 Byte";const e=1024,n=["Bytes","KB","MB","GB","TB","PB"],a=Math.floor(Math.log(t)/Math.log(e));return parseFloat((t/e**a).toFixed(2))+" "+n[a]}function Ze(t,e){return t&&(t.hasOwnProperty("allowedContentTypes")&&(e.allowedContentTypes=t.allowedContentTypes||["*"],e.allowedContentTypes=e.allowedContentTypes&&e.allowedContentTypes.length>0?e.allowedContentTypes:["*"]),t.hasOwnProperty("maxUploads")&&(e.maxUploads=t.maxUploads||0),t.hasOwnProperty("maxFileSize")&&(e.maxFileSize=se(1024*1024*(parseInt(String(t.maxFileSize),10)||1)))),e}function Je(t){let e="ffilepreview--filetype";if(!t)return e+"-any";const n=t.lastIndexOf(".");let a="";switch(n>-1&&(a=t.substring(n+1).toLocaleLowerCase()),a){case"pdf":e+="-pdf";break;case"jpeg":case"jpg":case"gif":case"svg":case"png":case"bmp":e+="-img";break;case"ppt":case"pptx":e+="-ppt";break;case"doc":case"docx":e+="-doc";break;case"xls":case"xlsx":e+="-xls";break;case"txt":e+="-txt";break;case"zip":e+="-zip";break;case"wps":e+="-wps";break;case"wpt":e+="-wpt";break;default:e+="-any"}return e}function Ke(t){var e;if(t.type==="done")return 100;if(t.file&&t.file.progress){if(t.file.progress.status===Q.Uploading){const n=((e=t.file.progress.data)==null?void 0:e.percentage)||5;return n>5?n:5}return 5}return 5}function Zn(t){let e=t;return t?(typeof t=="string"&&(e=parseInt(t,10)),se(e)):"0 Byte"}const Jn=()=>Math.random().toString(36).substring(7);function et(t,e){return{fileIndex:e,id:Jn(),name:t.name,size:t.size,type:t.type,form:new FormData,progress:{status:Q.Queue,data:{percentage:0,speed:0,speedHuman:`${se(0)}/s`,startTime:null,endTime:null,eta:null,etaHuman:null}},lastModifiedDate:De(new Date(t.lastModified),"yyyy-MM-dd HH:mm:ss"),nativeFile:t}}function tt(t){const e=[];return t.forEach(n=>{const a={id:"",name:"",size:0,type:"",extend:null,extendHeaders:null,createTime:""};for(const o in a){const i=o.replace("extend","response").replace("createTime","lastModifiedDate");n.hasOwnProperty(i)&&(i==="lastModifiedDate"?a[o]=De(n[i],"yyyy-MM-dd HH:mm:ss"):a[o]=n[i])}e.push(a)}),e}function Kn(t,e){return t?e<=t*1024*1024:!0}function ea(t){return t.find(e=>e==="*")!==void 0}function ta(t,e){if(!t||t.length===0||ea(t))return!0;if(e.lastIndexOf(".")<0)return!1;const n=e.substr(e.lastIndexOf("."));return t.findIndex(a=>a.toLowerCase()===n.toLowerCase())>-1}function na(t){if(t)return t.split(`
`).map(e=>e.split(/: */,2)).filter(e=>e[0]).reduce((e,n)=>(e[n[0]]=n[1],e),{})}function nt(t){return new Date(t*1e3).toISOString().substr(11,8)}class aa extends Qe{upload(e,n,a,o){const i=e[0];return new Promise((l,s)=>{var M,O;const f=n.url||a.url||"",c=n.method||"POST",d=n.data||{},m=n.headers||{},h=new XMLHttpRequest,v=new Date().getTime();let g=((M=i.progress)==null?void 0:M.data)&&i.progress.data.startTime||v,N=0,b=null;h.upload.addEventListener("progress",T=>{var H;if(T.lengthComputable){const P=Math.round(T.loaded*100/T.total),j=new Date().getTime()-v;N=Math.round(T.loaded/j*1e3),g=((H=i.progress)==null?void 0:H.data)&&i.progress.data.startTime||new Date().getTime(),b=Math.ceil((T.total-T.loaded)/N),i.progress={status:Q.Uploading,data:{percentage:P,speed:N,speedHuman:`${se(N)}/s`,startTime:g,endTime:null,eta:b,etaHuman:nt(b)}},o({type:"uploading",files:[i]})}},!1),h.upload.addEventListener("error",T=>{s(T)}),h.onreadystatechange=()=>{if(h.readyState===XMLHttpRequest.DONE){const T=Math.round(i.size/(new Date().getTime()-g)*1e3);i.progress={status:Q.Done,data:{percentage:100,speed:T,speedHuman:`${se(T)}/s`,startTime:g,endTime:new Date().getTime(),eta:b,etaHuman:nt(b||0)}},i.responseStatus=h.status;try{i.response=JSON.parse(h.response)}catch{i.response=h.response}i.responseHeaders=na(h.getAllResponseHeaders()),l({type:"done",files:[i]})}},h.open(c,f,!0),h.withCredentials=!!n.withCredentials;try{const T=i.nativeFile;Object.keys(m).forEach(P=>h.setRequestHeader(P,m[P]));let H;n.includeWebKitFormBoundary!==!1?(Object.keys(d).forEach(P=>{var j;return(j=i.form)==null?void 0:j.append(P,d[P])}),(O=i.form)==null||O.append(n.fieldName||"file",T,T.name),H=i.form):H=T,h.send(H)}catch(T){s(T)}return()=>{h.abort()}})}remove(e,n,a,o){return new Promise((i,l)=>{i({type:"removed",files:e})})}}const ra={showCloseButton:{type:Boolean,default:!0},position:{type:String,default:"top-center"},timeout:{type:Number,default:3e3},theme:{type:String,default:"bootstrap"},left:{type:Number},right:{type:Number},top:{type:Number},bottom:{type:Number},id:{type:String},animate:{type:String,default:"fadeIn"},options:{type:Object}},oa={showCloseButton:{type:Boolean,default:!0},animate:{type:String,default:"fadeIn"},options:{type:Object}},Me=r.defineComponent({name:"Toast",props:oa,emits:["close","click"],setup:(t,e)=>{const n=r.ref(t.animate),a="fadeOut",o=r.computed(()=>t.options),i=r.ref(!1),l=r.computed(()=>{const M={animated:i.value,toast:!0};return M[t.animate]=!1,M[a]=i.value,M[o.value.type]=!0,o.value.theme&&(M[o.value.theme]=!0),M}),s=r.computed(()=>{const T=`f-icon-${o.value&&o.value.type?o.value.type.replace("toasty-type-",""):"default"}`,H={"f-icon":!0};return H[T]=!0,H}),f=r.computed(()=>o.value.title||o.value.message),c=r.computed(()=>o.value.title&&o.value.message),d=r.computed(()=>!o.value.title&&o.value.message),m=r.computed(()=>t.showCloseButton),h=r.computed(()=>!!o.value.buttons||!!e.slots.default);function v(M){M.stopPropagation(),M.preventDefault(),i.value=!1,setTimeout(()=>{e.emit("close",o.value)},200)}function g(M,O){}function N(M){return`f-preten-link ${M.customClass?M.customClass:""}`}r.watch(n,()=>{n.value});const b=()=>{var M;return r.createVNode(r.Fragment,null,[r.createVNode("div",{class:"after-toast-msg text-right"},[!e.slots.default&&((M=o.value.buttons)==null?void 0:M.map(O=>r.createVNode("span",{class:N(O),onClick:T=>void 0},[O.text]))),e.slots.default&&e.slots.default()])])};return()=>r.createVNode("div",{class:l.value,style:"min-height:44px"},[m.value&&r.createVNode("button",{title:"关闭",class:"toast-close f-btn-icon f-bare",onClick:v},[r.createVNode("span",{class:"f-icon modal_close"},null)]),f.value&&r.createVNode("section",{class:"modal-tips"},[r.createVNode("div",{class:"float-left modal-tips-iconwrap"},[r.createVNode("span",{class:s.value},null)]),r.createVNode("div",{class:"modal-tips-content"},[c.value&&r.createVNode(r.Fragment,null,[r.createVNode("h5",{class:"toast-title modal-tips-title",innerHTML:o.value.title},null),r.createVNode("p",{class:"toast-msg",innerHTML:o.value.message},null),h.value&&b()]),d.value&&(o.value.buttons?r.createVNode("div",{class:"toast-title-btns-wrapper d-flex"},[r.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",innerHTML:o.value.message},null),r.createVNode("div",{class:"after-toast-title text-right ml-auto"},[b()])]):r.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",innerHTML:o.value.message},null))])])])}}),he=r.defineComponent({name:"Notify",props:ra,emits:["close","empty"],setup(t,e){const n=r.computed(()=>({"farris-notify":!0})),a={left:12,right:12,top:20,bottom:12},o=r.ref(),i=r.ref(t.options),l=r.ref(t.showCloseButton),s=r.computed(()=>t.position||"bottom-right"),f=r.computed(()=>t.timeout!=null?t.timeout:3e3),c=r.computed(()=>{const h=t.bottom?t.bottom:a.bottom,v=t.top?t.top:a.top,g={transition:"all 0.2s ease",left:s.value.indexOf("left")>-1?`${t.left?t.left:a.left}px`:"",right:s.value.indexOf("right")>-1?`${t.right?t.right:a.right}px`:"",top:s.value.indexOf("top")>-1?`${v}px`:"",bottom:s.value.indexOf("bottom")>-1?`${h}px`:""};return s.value.indexOf("center")>-1&&(g.left="50%",g.marginLeft="calc(-24rem / 2)",s.value==="center-center"&&(g.top="50%",g.transform="translate(-50%, -50%)")),g});function d(h){e.emit("close")}f.value&&setTimeout(()=>{d()},f.value),e.expose({closeToast:d,container:o,notifyPosition:s});function m(h,v){d()}return()=>r.createVNode("div",{class:n.value,style:c.value,ref:o},[r.createVNode(Me,{options:i.value,showCloseButton:l.value,animate:t.animate,onClose:h=>m(h,i.value)},null)])}});class at{constructor(){L(this,"notifyRefs",[]);L(this,"globalConfig",r.reactive({}))}createNotifyInstance(e){const n=this,o=Object.assign({timeout:3e3,position:"bottom-right",showCloseButton:!0},this.globalConfig,{...e}),i=document.createElement("div");i.style.display="contents";const l=r.createApp({setup(){const s=r.ref();function f(){s.value.container.style.transform="scale(0)",setTimeout(()=>{n.updateNotifyPositionForClose(o,s),l.unmount()},220)}if(o.position.indexOf("top")>-1){const c=n.getNotifyInstances(o.position),d=c[c.length-1];if(d){const m=d.value.container.getBoundingClientRect();o.top=m.bottom}}return r.onUnmounted(()=>{document.body.removeChild(i)}),r.onMounted(()=>{n.updateNotifyPositionForCreate(o,s)}),()=>r.createVNode(r.Transition,{mode:"out-in",name:"fade",appear:!0},{default:()=>[r.createVNode(he,r.mergeProps({ref:s},o,{onClose:f}),null)]})}});return l.provide("NotifyService",this),document.body.appendChild(i),l.mount(i),l}getNotifyInstances(e){return this.notifyRefs.filter(n=>n.value.notifyPosition===e)}updateNotifyPositionForCreate(e,n){if(this.notifyRefs&&this.notifyRefs.length){const a=window.innerHeight;e.position.indexOf("bottom")>-1&&this.getNotifyInstances(e.position).forEach(o=>{const i=o.value.container.getBoundingClientRect();o.value.container.style.bottom=i.height+a-i.bottom+"px"})}this.notifyRefs=[...this.notifyRefs,n]}updateNotifyPositionForClose(e,n){const a=this.notifyRefs.indexOf(n);if(e.position.indexOf("top")>-1){const o=this.getNotifyInstances(e.position),i=o.indexOf(n);o.slice(i+1).forEach(l=>{l.value.container.style.top=l.value.container.offsetTop-l.value.container.offsetHeight+"px"})}a>-1&&this.notifyRefs.splice(a,1)}show(e){return this.createNotifyInstance(e)}buildNotifyProps(e,n){let a="",o="",i,l,s;typeof n=="string"?a=n:n&&(a=n.message||"",o=n.title||"",l=n.position||null,s=n.showCloseButton!=null?n.showCloseButton:null,i=n.timeout!=null?n.timeout:null);const c={options:{type:e,message:a,title:o}};return l!=null&&(c.position=l),s!=null&&(c.showCloseButton=s),i!=null&&(c.timeout=i),c}info(e){const n=this.buildNotifyProps("info",e);return this.show(n)}success(e){const n=this.buildNotifyProps("success",e);return this.show(n)}warning(e){const n=this.buildNotifyProps("warning",e);return this.show(n)}error(e){const n=this.buil