61 lines
82 KiB
JavaScript
Executable File
61 lines
82 KiB
JavaScript
Executable File
/*
|
||
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
||
if you want to view the source, please visit the github repository of this plugin
|
||
*/
|
||
|
||
var on=Object.create;var De=Object.defineProperty;var ln=Object.getOwnPropertyDescriptor;var cn=Object.getOwnPropertyNames;var fn=Object.getPrototypeOf,dn=Object.prototype.hasOwnProperty;var Ft=(r,e)=>()=>(r&&(e=r(r=0)),e);var S=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),At=(r,e)=>{for(var t in e)De(r,t,{get:e[t],enumerable:!0})},It=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of cn(e))!dn.call(r,i)&&i!==t&&De(r,i,{get:()=>e[i],enumerable:!(n=ln(e,i))||n.enumerable});return r};var Ct=(r,e,t)=>(t=r!=null?on(fn(r)):{},It(e||!r||!r.__esModule?De(t,"default",{value:r,enumerable:!0}):t,r)),Pt=r=>It(De({},"__esModule",{value:!0}),r);var $t,Rt=Ft(()=>{$t="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"});var Mt={};At(Mt,{customAlphabet:()=>pn,customRandom:()=>kt,nanoid:()=>hn,random:()=>Nt,urlAlphabet:()=>$t});var Nt,kt,pn,hn,Lt=Ft(()=>{Rt();Nt=r=>crypto.getRandomValues(new Uint8Array(r)),kt=(r,e,t)=>{let n=(2<<Math.log(r.length-1)/Math.LN2)-1,i=-~(1.6*n*e/r.length);return(s=e)=>{let a="";for(;;){let u=t(i),o=i|0;for(;o--;)if(a+=r[u[o]&n]||"",a.length===s)return a}}},pn=(r,e=21)=>kt(r,e,Nt),hn=(r=21)=>crypto.getRandomValues(new Uint8Array(r)).reduce((e,t)=>(t&=63,t<36?e+=t.toString(36):t<62?e+=(t-26).toString(36).toUpperCase():t>62?e+="-":e+="_",e),"")});var jt=S(ee=>{"use strict";Object.defineProperty(ee,"__esModule",{value:!0});ee.headerDefaults=ee.eventDefaults=void 0;var mn=(Lt(),Pt(Mt)),Ns=ee.headerDefaults=function(){return{productId:"adamgibbons/ics",method:"PUBLISH"}},ks=ee.eventDefaults=function(){return{title:"Untitled event",uid:(0,mn.nanoid)(),timestamp:Date.now()}}});var qt=S(Fe=>{"use strict";Object.defineProperty(Fe,"__esModule",{value:!0});Fe.buildEvent=Tn;Fe.buildHeader=vn;var Ut=jt();function ge(r){return ge=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ge(r)}function gn(r,e,t){return e=yn(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function yn(r){var e=bn(r,"string");return ge(e)==="symbol"?e:String(e)}function bn(r,e){if(ge(r)!=="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(ge(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function Vt(r){return Object.entries(r).reduce(function(e,t){return typeof t[1]!="undefined"?Object.assign(e,gn({},t[0],t[1])):e},{})}function vn(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=Object.assign({},(0,Ut.headerDefaults)(),r);return Vt(e)}function Tn(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=Object.assign({},(0,Ut.eventDefaults)(),r);return Vt(e)}});var ze=S(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});qe.default=_n;function zt(r,e){return On(r)||En(r,e)||Sn(r,e)||xn()}function xn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Sn(r,e){if(r){if(typeof r=="string")return Ht(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Ht(r,e)}}function Ht(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function En(r,e){var t=r==null?null:typeof Symbol!="undefined"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var n,i,s,a,u=[],o=!0,l=!1;try{if(s=(t=t.call(r)).next,e===0){if(Object(t)!==t)return;o=!1}else for(;!(o=(n=s.call(t)).done)&&(u.push(n.value),u.length!==e);o=!0);}catch(c){l=!0,i=c}finally{try{if(!o&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(l)throw i}}return u}}function On(r){if(Array.isArray(r))return r}var C=function(e){return e<10?"0".concat(e):"".concat(e)};function _n(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"utc",t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"local";if(typeof r=="string")return r;if(Array.isArray(r)&&r.length===3){var n=zt(r,3),i=n[0],s=n[1],a=n[2];return"".concat(i).concat(C(s)).concat(C(a))}var u=new Date;if(Array.isArray(r)&&r.length>0&&r[0]){var o=zt(r,6),l=o[0],c=o[1],d=o[2],p=o[3],h=p===void 0?0:p,E=o[4],m=E===void 0?0:E,x=o[5],T=x===void 0?0:x;t==="local"?u=new Date(l,c-1,d,h,m,T):u=new Date(Date.UTC(l,c-1,d,h,m,T))}else Array.isArray(r)||(u=new Date(r));return e==="local"?[u.getFullYear(),C(u.getMonth()+1),C(u.getDate()),"T",C(u.getHours()),C(u.getMinutes()),C(u.getSeconds())].join(""):[u.getUTCFullYear(),C(u.getUTCMonth()+1),C(u.getUTCDate()),"T",C(u.getUTCHours()),C(u.getUTCMinutes()),C(u.getUTCSeconds()),"Z"].join("")}});var Gt=S(He=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});He.default=wn;function wn(r){var e=r.lat,t=r.lon;return"".concat(e,";").concat(t)}});var Ae=S(Ge=>{"use strict";Object.defineProperty(Ge,"__esModule",{value:!0});Ge.default=Dn;function Dn(r){return'"'.concat(r.replaceAll('"','\\"'),'"')}});var Yt=S(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye.default=An;var ye=Fn(Ae());function Fn(r){return r&&r.__esModule?r:{default:r}}function An(r){var e=r.name,t=r.email,n=r.rsvp,i=r.dir,s=r.partstat,a=r.role,u=r.cutype,o=r.xNumGuests,l=[];n!==void 0&&l.push(n?"RSVP=TRUE":"RSVP=FALSE"),u&&l.push("CUTYPE=".concat((0,ye.default)(u))),o!==void 0&&l.push("X-NUM-GUESTS=".concat(o)),a&&l.push("ROLE=".concat((0,ye.default)(a))),s&&l.push("PARTSTAT=".concat((0,ye.default)(s))),i&&l.push("DIR=".concat((0,ye.default)(i))),l.push("CN=".concat((0,ye.default)(e||"Unnamed attendee")));var c=l.join(";").concat(t?":mailto:".concat(t):"");return c}});var Bt=S(Ze=>{"use strict";Object.defineProperty(Ze,"__esModule",{value:!0});Ze.default=Cn;var Be=In(Ae());function In(r){return r&&r.__esModule?r:{default:r}}function Cn(r){var e=r.name,t=r.email,n=r.dir,i=r.sentBy,s="";return s+=n?"DIR=".concat((0,Be.default)(n),";"):"",s+=i?"SENT-BY=".concat((0,Be.default)("MAILTO:".concat(i)),";"):"",s+="CN=",s+=(0,Be.default)(e||"Organizer"),s+=t?":MAILTO:".concat(t):"",s}});var Jt=S((Hs,Xt)=>{"use strict";var We;(function(r){r[r.HIGH_SURROGATE_START=55296]="HIGH_SURROGATE_START",r[r.HIGH_SURROGATE_END=56319]="HIGH_SURROGATE_END",r[r.LOW_SURROGATE_START=56320]="LOW_SURROGATE_START",r[r.REGIONAL_INDICATOR_START=127462]="REGIONAL_INDICATOR_START",r[r.REGIONAL_INDICATOR_END=127487]="REGIONAL_INDICATOR_END",r[r.FITZPATRICK_MODIFIER_START=127995]="FITZPATRICK_MODIFIER_START",r[r.FITZPATRICK_MODIFIER_END=127999]="FITZPATRICK_MODIFIER_END",r[r.VARIATION_MODIFIER_START=65024]="VARIATION_MODIFIER_START",r[r.VARIATION_MODIFIER_END=65039]="VARIATION_MODIFIER_END",r[r.DIACRITICAL_MARKS_START=8400]="DIACRITICAL_MARKS_START",r[r.DIACRITICAL_MARKS_END=8447]="DIACRITICAL_MARKS_END",r[r.SUBDIVISION_INDICATOR_START=127988]="SUBDIVISION_INDICATOR_START",r[r.TAGS_START=917504]="TAGS_START",r[r.TAGS_END=917631]="TAGS_END",r[r.ZWJ=8205]="ZWJ"})(We||(We={}));var Wt=Object.freeze([776,2359,2367,2984,3007,3021,3633,3635,3648,3657,4352,4449,4520]),Ke;function P(r){if(typeof r!="string")throw new TypeError("string cannot be undefined or null");let e=[],t=0,n=0;for(;t<r.length;)n+=Pn(t+n,r),Nn(r[t+n])&&n++,$n(r[t+n])&&n++,Rn(r[t+n])&&n++,kn(r[t+n])?n++:(e.push(r.substring(t,t+n)),t+=n,n=0);return e}function Pn(r,e){let t=e[r];if(!function(a){return a&&B(a[0].charCodeAt(0),55296,56319)}(t)||r===e.length-1)return 1;let n=t+e[r+1],i=e.substring(r+2,r+5);return Zt(n)&&Zt(i)?4:function(a){return B(Xe(a),127988,127988)}(n)&&function(a){let u=a.codePointAt(0);return typeof a=="string"&&typeof u=="number"&&B(u,917504,917631)}(i)?e.slice(r).indexOf(String.fromCodePoint(917631))+2:function(a){return B(Xe(a),127995,127999)}(i)?4:2}function Zt(r){return B(Xe(r),127462,127487)}function $n(r){return typeof r=="string"&&B(r.charCodeAt(0),65024,65039)}function Rn(r){return typeof r=="string"&&B(r.charCodeAt(0),8400,8447)}function Nn(r){return typeof r=="string"&&Wt.includes(r.charCodeAt(0))}function kn(r){return typeof r=="string"&&r.charCodeAt(0)===8205}function Xe(r){return(r.charCodeAt(0)-55296<<10)+(r.charCodeAt(1)-56320)+65536}function B(r,e,t){return r>=e&&r<=t}function Kt(r,e,t){let n=P(r);if(e===void 0)return r;if(e>=n.length)return"";let i=n.length-e,s=e+(t===void 0?i:t);return s>e+i&&(s=void 0),n.slice(e,s).join("")}(function(r){r[r.unit_1=1]="unit_1",r[r.unit_2=2]="unit_2",r[r.unit_4=4]="unit_4"})(Ke||(Ke={})),Object.defineProperty(P,"runes",{value:P}),Object.defineProperty(P,"default",{value:P}),Object.defineProperty(P,"__esModule",{value:!0}),Object.defineProperty(P,"substr",{value:Kt}),Object.defineProperty(P,"substring",{value:Kt}),Object.defineProperty(P,"EnumRunesCode",{value:We}),Object.defineProperty(P,"EnumCodeUnits",{value:Ke}),Object.defineProperty(P,"GRAPHEMES",{value:Wt}),Xt.exports=P});var er=S((Gs,Qt)=>{"use strict";Qt.exports=Jt()});var et=S(Qe=>{"use strict";Object.defineProperty(Qe,"__esModule",{value:!0});Qe.default=Mn;var Je=er();function Mn(r){for(var e=[],t=75;(0,Je.runes)(r).length>t;)e.push((0,Je.substring)(r,0,t)),r=(0,Je.substring)(r,t),t=74;return e.push(r),e.join(`\r
|
||
`)}});var rt=S(tt=>{"use strict";Object.defineProperty(tt,"__esModule",{value:!0});tt.default=Ln;function Ln(r){return r.replace(/\r?\n/gm,"\\n")}});var rr=S(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});it.default=qn;var jn=nt(ze()),te=nt(et()),re=nt(rt());function nt(r){return r&&r.__esModule?r:{default:r}}function tr(r){var e=r.weeks,t=r.days,n=r.hours,i=r.minutes,s=r.seconds,a="P";return a+=e?"".concat(e,"W"):"",a+=t?"".concat(t,"D"):"",a+="T",a+=n?"".concat(n,"H"):"",a+=i?"".concat(i,"M"):"",a+=s?"".concat(s,"S"):"",a}function Un(r){var e="";if(Array.isArray(r)||typeof r=="number"||typeof r=="string")e="TRIGGER;VALUE=DATE-TIME:".concat((0,re.default)((0,jn.default)(r)),`\r
|
||
`);else{var t=r.before?"-":"";e="TRIGGER:".concat((0,re.default)(t+tr(r)),`\r
|
||
`)}return e}function Vn(r){return r.toUpperCase()}function qn(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=r.action,t=r.repeat,n=r.description,i=r.duration,s=r.attach,a=r.attachType,u=r.trigger,o=r.summary,l=`BEGIN:VALARM\r
|
||
`;l+=(0,te.default)("ACTION:".concat((0,re.default)(Vn(e))))+`\r
|
||
`,l+=t?(0,te.default)("REPEAT:".concat(t))+`\r
|
||
`:"",l+=n?(0,te.default)("DESCRIPTION:".concat((0,re.default)(n)))+`\r
|
||
`:"",l+=i?(0,te.default)("DURATION:".concat(tr(i)))+`\r
|
||
`:"";var c=a||"FMTTYPE=audio/basic";return l+=s?(0,te.default)((0,re.default)("ATTACH;".concat(c,":").concat(s)))+`\r
|
||
`:"",l+=u?Un(u):"",l+=o?(0,te.default)("SUMMARY:".concat((0,re.default)(o)))+`\r
|
||
`:"",l+=`END:VALARM\r
|
||
`,l}});var Ie=S(st=>{"use strict";Object.defineProperty(st,"__esModule",{value:!0});st.default=zn;function zn(r){return r.replace(/\\/gm,"\\\\").replace(/\r?\n/gm,"\\n").replace(/;/gm,"\\;").replace(/,/gm,"\\,")}});var nr=S(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.default=Yn;var Hn=Gn(Ie());function Gn(r){return r&&r.__esModule?r:{default:r}}function Yn(r){return(0,Hn.default)(r)}});var ir=S(ut=>{"use strict";Object.defineProperty(ut,"__esModule",{value:!0});ut.default=Kn;var Bn=Zn(Ie());function Zn(r){return r&&r.__esModule?r:{default:r}}function Kn(r){return(0,Bn.default)(r)}});var sr=S(ot=>{"use strict";Object.defineProperty(ot,"__esModule",{value:!0});ot.default=Wn;function Wn(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=r.weeks,t=r.days,n=r.hours,i=r.minutes,s=r.seconds,a="P";return a+=e?"".concat(e,"W"):"",a+=t?"".concat(t,"D"):"",a+="T",a+=n?"".concat(n,"H"):"",a+=i?"".concat(i,"M"):"",a+=s?"".concat(s,"S"):"",a}});var ar=S(lt=>{"use strict";Object.defineProperty(lt,"__esModule",{value:!0});lt.default=Qn;var Xn=Jn(Ie());function Jn(r){return r&&r.__esModule?r:{default:r}}function Qn(r){return(0,Xn.default)(r)}});var ur=S(A=>{"use strict";Object.defineProperty(A,"__esModule",{value:!0});Object.defineProperty(A,"encodeParamValue",{enumerable:!0,get:function(){return ci.default}});Object.defineProperty(A,"foldLine",{enumerable:!0,get:function(){return oi.default}});Object.defineProperty(A,"formatDate",{enumerable:!0,get:function(){return ei.default}});Object.defineProperty(A,"formatDuration",{enumerable:!0,get:function(){return ui.default}});Object.defineProperty(A,"setAlarm",{enumerable:!0,get:function(){return ii.default}});Object.defineProperty(A,"setContact",{enumerable:!0,get:function(){return ri.default}});Object.defineProperty(A,"setDescription",{enumerable:!0,get:function(){return si.default}});Object.defineProperty(A,"setGeolocation",{enumerable:!0,get:function(){return ti.default}});Object.defineProperty(A,"setLocation",{enumerable:!0,get:function(){return li.default}});Object.defineProperty(A,"setOrganizer",{enumerable:!0,get:function(){return ni.default}});Object.defineProperty(A,"setSummary",{enumerable:!0,get:function(){return ai.default}});var ei=$(ze()),ti=$(Gt()),ri=$(Yt()),ni=$(Bt()),ii=$(rr()),si=$(nr()),ai=$(ir()),ui=$(sr()),oi=$(et()),li=$(ar()),ci=$(Ae());function $(r){return r&&r.__esModule?r:{default:r}}});var or=S(be=>{"use strict";Object.defineProperty(be,"__esModule",{value:!0});be.formatEvent=hi;be.formatFooter=pi;be.formatHeader=di;var g=ur(),_=fi(rt());function fi(r){return r&&r.__esModule?r:{default:r}}function di(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=r.productId,t=r.method,n=r.calName,i="";return i+=`BEGIN:VCALENDAR\r
|
||
`,i+=`VERSION:2.0\r
|
||
`,i+=`CALSCALE:GREGORIAN\r
|
||
`,i+=(0,g.foldLine)("PRODID:".concat((0,_.default)(e)))+`\r
|
||
`,i+=(0,g.foldLine)("METHOD:".concat((0,_.default)(t)))+`\r
|
||
`,i+=n?(0,g.foldLine)("X-WR-CALNAME:".concat((0,_.default)(n)))+`\r
|
||
`:"",i+=`X-PUBLISHED-TTL:PT1H\r
|
||
`,i}function pi(){return`END:VCALENDAR\r
|
||
`}function hi(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=r.title,t=r.uid,n=r.sequence,i=r.timestamp,s=r.start,a=r.startType,u=r.startInputType,o=r.startOutputType,l=r.duration,c=r.end,d=r.endInputType,p=r.endOutputType,h=r.description,E=r.url,m=r.geo,x=r.location,T=r.status,I=r.categories,H=r.organizer,X=r.attendees,J=r.alarms,Q=r.recurrenceRule,pe=r.exclusionDates,Ve=r.busyStatus,G=r.transp,he=r.classification,O=r.created,N=r.lastModified,me=r.htmlContent,v="";return v+=`BEGIN:VEVENT\r
|
||
`,v+=(0,g.foldLine)("UID:".concat((0,_.default)(t)))+`\r
|
||
`,v+=e?(0,g.foldLine)("SUMMARY:".concat((0,_.default)((0,g.setSummary)(e))))+`\r
|
||
`:"",v+=(0,g.foldLine)("DTSTAMP:".concat((0,_.default)((0,g.formatDate)(i))))+`\r
|
||
`,v+=(0,g.foldLine)("DTSTART".concat(s&&s.length==3?";VALUE=DATE":"",":").concat((0,_.default)((0,g.formatDate)(s,o||a,u))))+`\r
|
||
`,(!c||c.length!==3||s.length!==c.length||s.some(function(Y,un){return Y!==c[un]}))&&c&&(v+=(0,g.foldLine)("DTEND".concat(c.length===3?";VALUE=DATE":"",":").concat((0,_.default)((0,g.formatDate)(c,p||o||a,d||u))))+`\r
|
||
`),v+=typeof n!="undefined"?"SEQUENCE:".concat(n,`\r
|
||
`):"",v+=h?(0,g.foldLine)("DESCRIPTION:".concat((0,_.default)((0,g.setDescription)(h))))+`\r
|
||
`:"",v+=E?(0,g.foldLine)("URL:".concat((0,_.default)(E)))+`\r
|
||
`:"",v+=m?(0,g.foldLine)("GEO:".concat((0,g.setGeolocation)(m)))+`\r
|
||
`:"",v+=x?(0,g.foldLine)("LOCATION:".concat((0,_.default)((0,g.setLocation)(x))))+`\r
|
||
`:"",v+=T?(0,g.foldLine)("STATUS:".concat((0,_.default)(T)))+`\r
|
||
`:"",v+=I?(0,g.foldLine)("CATEGORIES:".concat((0,_.default)(I.join(","))))+`\r
|
||
`:"",v+=H?(0,g.foldLine)("ORGANIZER;".concat((0,g.setOrganizer)(H)))+`\r
|
||
`:"",v+=Ve?(0,g.foldLine)("X-MICROSOFT-CDO-BUSYSTATUS:".concat((0,_.default)(Ve)))+`\r
|
||
`:"",v+=G?(0,g.foldLine)("TRANSP:".concat((0,_.default)(G)))+`\r
|
||
`:"",v+=he?(0,g.foldLine)("CLASS:".concat((0,_.default)(he)))+`\r
|
||
`:"",v+=O?"CREATED:"+(0,_.default)((0,g.formatDate)(O))+`\r
|
||
`:"",v+=N?"LAST-MODIFIED:"+(0,_.default)((0,g.formatDate)(N))+`\r
|
||
`:"",v+=me?(0,g.foldLine)("X-ALT-DESC;FMTTYPE=text/html:".concat((0,_.default)(me)))+`\r
|
||
`:"",X&&X.forEach(function(Y){v+=(0,g.foldLine)("ATTENDEE;".concat((0,_.default)((0,g.setContact)(Y))))+`\r
|
||
`}),v+=Q?(0,g.foldLine)("RRULE:".concat((0,_.default)(Q)))+`\r
|
||
`:"",v+=pe?(0,g.foldLine)("EXDATE:".concat((0,_.default)(pe.map(function(Y){return(0,g.formatDate)(Y)}).join(","))))+`\r
|
||
`:"",v+=l?(0,g.foldLine)("DURATION:".concat((0,g.formatDuration)(l)))+`\r
|
||
`:"",J&&J.forEach(function(Y){v+=(0,g.setAlarm)(Y)}),v+=`END:VEVENT\r
|
||
`,v}});var hr=S((ra,pr)=>{"use strict";function Z(r){this._maxSize=r,this.clear()}Z.prototype.clear=function(){this._size=0,this._values=Object.create(null)};Z.prototype.get=function(r){return this._values[r]};Z.prototype.set=function(r,e){return this._size>=this._maxSize&&this.clear(),r in this._values||this._size++,this._values[r]=e};var mi=/[^.^\]^[]+|(?=\[\]|\.\.)/g,dr=/^\d+$/,gi=/^\d/,yi=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,bi=/^\s*(['"]?)(.*?)(\1)\s*$/,dt=512,lr=new Z(dt),cr=new Z(dt),fr=new Z(dt);pr.exports={Cache:Z,split:ft,normalizePath:ct,setter:function(r){var e=ct(r);return cr.get(r)||cr.set(r,function(n,i){for(var s=0,a=e.length,u=n;s<a-1;){var o=e[s];if(o==="__proto__"||o==="constructor"||o==="prototype")return n;u=u[e[s++]]}u[e[s]]=i})},getter:function(r,e){var t=ct(r);return fr.get(r)||fr.set(r,function(i){for(var s=0,a=t.length;s<a;)if(i!=null||!e)i=i[t[s++]];else return;return i})},join:function(r){return r.reduce(function(e,t){return e+(pt(t)||dr.test(t)?"["+t+"]":(e?".":"")+t)},"")},forEach:function(r,e,t){vi(Array.isArray(r)?r:ft(r),e,t)}};function ct(r){return lr.get(r)||lr.set(r,ft(r).map(function(e){return e.replace(bi,"$2")}))}function ft(r){return r.match(mi)||[""]}function vi(r,e,t){var n=r.length,i,s,a,u;for(s=0;s<n;s++)i=r[s],i&&(Si(i)&&(i='"'+i+'"'),u=pt(i),a=!u&&/^\d+$/.test(i),e.call(t,i,u,a,s,r))}function pt(r){return typeof r=="string"&&r&&["'",'"'].indexOf(r.charAt(0))!==-1}function Ti(r){return r.match(gi)&&!r.match(dr)}function xi(r){return yi.test(r)}function Si(r){return!pt(r)&&(Ti(r)||xi(r))}});var yr=S((na,gr)=>{var Ei=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,Ce=r=>r.match(Ei)||[],Pe=r=>r[0].toUpperCase()+r.slice(1),ht=(r,e)=>Ce(r).join(e).toLowerCase(),mr=r=>Ce(r).reduce((e,t)=>`${e}${e?t[0].toUpperCase()+t.slice(1).toLowerCase():t.toLowerCase()}`,""),Oi=r=>Pe(mr(r)),_i=r=>ht(r,"_"),wi=r=>ht(r,"-"),Di=r=>Pe(ht(r," ")),Fi=r=>Ce(r).map(Pe).join(" ");gr.exports={words:Ce,upperFirst:Pe,camelCase:mr,pascalCase:Oi,snakeCase:_i,kebabCase:wi,sentenceCase:Di,titleCase:Fi}});var vr=S((ia,mt)=>{mt.exports=function(r){return br(Ai(r),r)};mt.exports.array=br;function br(r,e){var t=r.length,n=new Array(t),i={},s=t,a=Ii(e),u=Ci(r);for(e.forEach(function(l){if(!u.has(l[0])||!u.has(l[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});s--;)i[s]||o(r[s],s,new Set);return n;function o(l,c,d){if(d.has(l)){var p;try{p=", node was:"+JSON.stringify(l)}catch(m){p=""}throw new Error("Cyclic dependency"+p)}if(!u.has(l))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(l));if(!i[c]){i[c]=!0;var h=a.get(l)||new Set;if(h=Array.from(h),c=h.length){d.add(l);do{var E=h[--c];o(E,u.get(E),d)}while(c);d.delete(l)}n[--t]=l}}}function Ai(r){for(var e=new Set,t=0,n=r.length;t<n;t++){var i=r[t];e.add(i[0]),e.add(i[1])}return Array.from(e)}function Ii(r){for(var e=new Map,t=0,n=r.length;t<n;t++){var i=r[t];e.has(i[0])||e.set(i[0],new Set),e.has(i[1])||e.set(i[1],new Set),e.get(i[0]).add(i[1])}return e}function Ci(r){for(var e=new Map,t=0,n=r.length;t<n;t++)e.set(r[t],t);return e}});var Ur=S(b=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var K=hr(),gt=yr(),Pi=vr();function $i(r){return r&&typeof r=="object"&&"default"in r?r:{default:r}}var Ri=$i(Pi),Ni=Object.prototype.toString,ki=Error.prototype.toString,Mi=RegExp.prototype.toString,Li=typeof Symbol!="undefined"?Symbol.prototype.toString:()=>"",ji=/^Symbol\((.*)\)(.*)$/;function Ui(r){return r!=+r?"NaN":r===0&&1/r<0?"-0":""+r}function Tr(r,e=!1){if(r==null||r===!0||r===!1)return""+r;let t=typeof r;if(t==="number")return Ui(r);if(t==="string")return e?`"${r}"`:r;if(t==="function")return"[Function "+(r.name||"anonymous")+"]";if(t==="symbol")return Li.call(r).replace(ji,"Symbol($1)");let n=Ni.call(r).slice(8,-1);return n==="Date"?isNaN(r.getTime())?""+r:r.toISOString(r):n==="Error"||r instanceof Error?"["+ki.call(r)+"]":n==="RegExp"?Mi.call(r):null}function M(r,e){let t=Tr(r,e);return t!==null?t:JSON.stringify(r,function(n,i){let s=Tr(this[n],e);return s!==null?s:i},2)}function _r(r){return r==null?[]:[].concat(r)}var wr,Dr,Fr,Vi=/\$\{\s*(\w+)\s*\}/g;wr=Symbol.toStringTag;var Me=class{constructor(e,t,n,i){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[wr]="Error",this.name="ValidationError",this.value=t,this.path=n,this.type=i,this.errors=[],this.inner=[],_r(e).forEach(s=>{if(w.isError(s)){this.errors.push(...s.errors);let a=s.inner.length?s.inner:[s];this.inner.push(...a)}else this.errors.push(s)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}};Dr=Symbol.hasInstance;Fr=Symbol.toStringTag;var w=class extends Error{static formatError(e,t){let n=t.label||t.path||"this";return t=Object.assign({},t,{path:n,originalPath:t.path}),typeof e=="string"?e.replace(Vi,(i,s)=>M(t[s])):typeof e=="function"?e(t):e}static isError(e){return e&&e.name==="ValidationError"}constructor(e,t,n,i,s){let a=new Me(e,t,n,i);if(s)return a;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[Fr]="Error",this.name=a.name,this.message=a.message,this.type=a.type,this.value=a.value,this.path=a.path,this.errors=a.errors,this.inner=a.inner,Error.captureStackTrace&&Error.captureStackTrace(this,w)}static[Dr](e){return Me[Symbol.hasInstance](e)||super[Symbol.hasInstance](e)}},k={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:r,type:e,value:t,originalValue:n})=>{let i=n!=null&&n!==t?` (cast from the value \`${M(n,!0)}\`).`:".";return e!=="mixed"?`${r} must be a \`${e}\` type, but the final value was: \`${M(t,!0)}\``+i:`${r} must match the configured type. The validated value was: \`${M(t,!0)}\``+i}},F={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},q={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},yt={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},bt={isValue:"${path} field must be ${value}"},Re={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},Ne={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},Ar={notType:r=>{let{path:e,value:t,spec:n}=r,i=n.types.length;if(Array.isArray(t)){if(t.length<i)return`${e} tuple value has too few items, expected a length of ${i} but got ${t.length} for value: \`${M(t,!0)}\``;if(t.length>i)return`${e} tuple value has too many items, expected a length of ${i} but got ${t.length} for value: \`${M(t,!0)}\``}return w.formatError(k.notType,r)}},Ir=Object.assign(Object.create(null),{mixed:k,string:F,number:q,date:yt,object:Re,array:Ne,boolean:bt,tuple:Ar}),W=r=>r&&r.__isYupSchema__,se=class{static fromOptions(e,t){if(!t.then&&!t.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:n,then:i,otherwise:s}=t,a=typeof n=="function"?n:(...u)=>u.every(o=>o===n);return new se(e,(u,o)=>{var l;let c=a(...u)?i:s;return(l=c==null?void 0:c(o))!=null?l:o})}constructor(e,t){this.fn=void 0,this.refs=e,this.refs=e,this.fn=t}resolve(e,t){let n=this.refs.map(s=>s.getValue(t==null?void 0:t.value,t==null?void 0:t.parent,t==null?void 0:t.context)),i=this.fn(n,e,t);if(i===void 0||i===e)return e;if(!W(i))throw new TypeError("conditions must return a schema object");return i.resolve(t)}},$e={context:"$",value:"."};function qi(r,e){return new L(r,e)}var L=class{constructor(e,t={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof e!="string")throw new TypeError("ref must be a string, got: "+e);if(this.key=e.trim(),e==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===$e.context,this.isValue=this.key[0]===$e.value,this.isSibling=!this.isContext&&!this.isValue;let n=this.isContext?$e.context:this.isValue?$e.value:"";this.path=this.key.slice(n.length),this.getter=this.path&&K.getter(this.path,!0),this.map=t.map}getValue(e,t,n){let i=this.isContext?n:this.isValue?e:t;return this.getter&&(i=this.getter(i||{})),this.map&&(i=this.map(i)),i}cast(e,t){return this.getValue(e,t==null?void 0:t.parent,t==null?void 0:t.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(e){return e&&e.__isYupRef}};L.prototype.__isYupRef=!0;var R=r=>r==null;function ne(r){function e({value:t,path:n="",options:i,originalValue:s,schema:a},u,o){let{name:l,test:c,params:d,message:p,skipAbsent:h}=r,{parent:E,context:m,abortEarly:x=a.spec.abortEarly,disableStackTrace:T=a.spec.disableStackTrace}=i;function I(O){return L.isRef(O)?O.getValue(t,E,m):O}function H(O={}){let N=Object.assign({value:t,originalValue:s,label:a.spec.label,path:O.path||n,spec:a.spec,disableStackTrace:O.disableStackTrace||T},d,O.params);for(let v of Object.keys(N))N[v]=I(N[v]);let me=new w(w.formatError(O.message||p,N),t,N.path,O.type||l,N.disableStackTrace);return me.params=N,me}let X=x?u:o,J={path:n,parent:E,type:l,from:i.from,createError:H,resolve:I,options:i,originalValue:s,schema:a},Q=O=>{w.isError(O)?X(O):O?o(null):X(H())},pe=O=>{w.isError(O)?X(O):u(O)};if(h&&R(t))return Q(!0);let G;try{var he;if(G=c.call(J,t,J),typeof((he=G)==null?void 0:he.then)=="function"){if(i.sync)throw new Error(`Validation test of type: "${J.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(G).then(Q,pe)}}catch(O){pe(O);return}Q(G)}return e.OPTIONS=r,e}function Tt(r,e,t,n=t){let i,s,a;return e?(K.forEach(e,(u,o,l)=>{let c=o?u.slice(1,u.length-1):u;r=r.resolve({context:n,parent:i,value:t});let d=r.type==="tuple",p=l?parseInt(c,10):0;if(r.innerType||d){if(d&&!l)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${a}" must contain an index to the tuple element, e.g. "${a}[0]"`);if(t&&p>=t.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${u}, in the path: ${e}. because there is no value at that index. `);i=t,t=t&&t[p],r=d?r.spec.types[p]:r.innerType}if(!l){if(!r.fields||!r.fields[c])throw new Error(`The schema does not contain the path: ${e}. (failed at: ${a} which is a type: "${r.type}")`);i=t,t=t&&t[c],r=r.fields[c]}s=c,a=o?"["+u+"]":"."+u}),{schema:r,parent:i,parentPath:s}):{parent:i,parentPath:e,schema:r}}function zi(r,e,t,n){return Tt(r,e,t,n).schema}var ae=class extends Set{describe(){let e=[];for(let t of this.values())e.push(L.isRef(t)?t.describe():t);return e}resolveAll(e){let t=[];for(let n of this.values())t.push(e(n));return t}clone(){return new ae(this.values())}merge(e,t){let n=this.clone();return e.forEach(i=>n.add(i)),t.forEach(i=>n.delete(i)),n}};function ie(r,e=new Map){if(W(r)||!r||typeof r!="object")return r;if(e.has(r))return e.get(r);let t;if(r instanceof Date)t=new Date(r.getTime()),e.set(r,t);else if(r instanceof RegExp)t=new RegExp(r),e.set(r,t);else if(Array.isArray(r)){t=new Array(r.length),e.set(r,t);for(let n=0;n<r.length;n++)t[n]=ie(r[n],e)}else if(r instanceof Map){t=new Map,e.set(r,t);for(let[n,i]of r.entries())t.set(n,ie(i,e))}else if(r instanceof Set){t=new Set,e.set(r,t);for(let n of r)t.add(ie(n,e))}else if(r instanceof Object){t={},e.set(r,t);for(let[n,i]of Object.entries(r))t[n]=ie(i,e)}else throw Error(`Unable to clone ${r}`);return t}var D=class{constructor(e){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new ae,this._blacklist=new ae,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(k.notType)}),this.type=e.type,this._typeCheck=e.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},e==null?void 0:e.spec),this.withMutation(t=>{t.nonNullable()})}get _type(){return this.type}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;let t=Object.create(Object.getPrototypeOf(this));return t.type=this.type,t._typeCheck=this._typeCheck,t._whitelist=this._whitelist.clone(),t._blacklist=this._blacklist.clone(),t.internalTests=Object.assign({},this.internalTests),t.exclusiveTests=Object.assign({},this.exclusiveTests),t.deps=[...this.deps],t.conditions=[...this.conditions],t.tests=[...this.tests],t.transforms=[...this.transforms],t.spec=ie(Object.assign({},this.spec,e)),t}label(e){let t=this.clone();return t.spec.label=e,t}meta(...e){if(e.length===0)return this.spec.meta;let t=this.clone();return t.spec.meta=Object.assign(t.spec.meta||{},e[0]),t}withMutation(e){let t=this._mutate;this._mutate=!0;let n=e(this);return this._mutate=t,n}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let t=this,n=e.clone(),i=Object.assign({},t.spec,n.spec);return n.spec=i,n.internalTests=Object.assign({},t.internalTests,n.internalTests),n._whitelist=t._whitelist.merge(e._whitelist,e._blacklist),n._blacklist=t._blacklist.merge(e._blacklist,e._whitelist),n.tests=t.tests,n.exclusiveTests=t.exclusiveTests,n.withMutation(s=>{e.tests.forEach(a=>{s.test(a.OPTIONS)})}),n.transforms=[...t.transforms,...n.transforms],n}isType(e){return e==null?!!(this.spec.nullable&&e===null||this.spec.optional&&e===void 0):this._typeCheck(e)}resolve(e){let t=this;if(t.conditions.length){let n=t.conditions;t=t.clone(),t.conditions=[],t=n.reduce((i,s)=>s.resolve(i,e),t),t=t.resolve(e)}return t}resolveOptions(e){var t,n,i,s;return Object.assign({},e,{from:e.from||[],strict:(t=e.strict)!=null?t:this.spec.strict,abortEarly:(n=e.abortEarly)!=null?n:this.spec.abortEarly,recursive:(i=e.recursive)!=null?i:this.spec.recursive,disableStackTrace:(s=e.disableStackTrace)!=null?s:this.spec.disableStackTrace})}cast(e,t={}){let n=this.resolve(Object.assign({value:e},t)),i=t.assert==="ignore-optionality",s=n._cast(e,t);if(t.assert!==!1&&!n.isType(s)){if(i&&R(s))return s;let a=M(e),u=M(s);throw new TypeError(`The value of ${t.path||"field"} could not be cast to a value that satisfies the schema type: "${n.type}".
|
||
|
||
attempted value: ${a}
|
||
`+(u!==a?`result of cast: ${u}`:""))}return s}_cast(e,t){let n=e===void 0?e:this.transforms.reduce((i,s)=>s.call(this,i,e,this),e);return n===void 0&&(n=this.getDefault(t)),n}_validate(e,t={},n,i){let{path:s,originalValue:a=e,strict:u=this.spec.strict}=t,o=e;u||(o=this._cast(o,Object.assign({assert:!1},t)));let l=[];for(let c of Object.values(this.internalTests))c&&l.push(c);this.runTests({path:s,value:o,originalValue:a,options:t,tests:l},n,c=>{if(c.length)return i(c,o);this.runTests({path:s,value:o,originalValue:a,options:t,tests:this.tests},n,i)})}runTests(e,t,n){let i=!1,{tests:s,value:a,originalValue:u,path:o,options:l}=e,c=m=>{i||(i=!0,t(m,a))},d=m=>{i||(i=!0,n(m,a))},p=s.length,h=[];if(!p)return d([]);let E={value:a,originalValue:u,path:o,options:l,schema:this};for(let m=0;m<s.length;m++){let x=s[m];x(E,c,function(I){I&&(Array.isArray(I)?h.push(...I):h.push(I)),--p<=0&&d(h)})}}asNestedTest({key:e,index:t,parent:n,parentPath:i,originalParent:s,options:a}){let u=e!=null?e:t;if(u==null)throw TypeError("Must include `key` or `index` for nested validations");let o=typeof u=="number",l=n[u],c=Object.assign({},a,{strict:!0,parent:n,value:l,originalValue:s[u],key:void 0,[o?"index":"key"]:u,path:o||u.includes(".")?`${i||""}[${o?u:`"${u}"`}]`:(i?`${i}.`:"")+e});return(d,p,h)=>this.resolve(c)._validate(l,c,p,h)}validate(e,t){var n;let i=this.resolve(Object.assign({},t,{value:e})),s=(n=t==null?void 0:t.disableStackTrace)!=null?n:i.spec.disableStackTrace;return new Promise((a,u)=>i._validate(e,t,(o,l)=>{w.isError(o)&&(o.value=l),u(o)},(o,l)=>{o.length?u(new w(o,l,void 0,void 0,s)):a(l)}))}validateSync(e,t){var n;let i=this.resolve(Object.assign({},t,{value:e})),s,a=(n=t==null?void 0:t.disableStackTrace)!=null?n:i.spec.disableStackTrace;return i._validate(e,Object.assign({},t,{sync:!0}),(u,o)=>{throw w.isError(u)&&(u.value=o),u},(u,o)=>{if(u.length)throw new w(u,e,void 0,void 0,a);s=o}),s}isValid(e,t){return this.validate(e,t).then(()=>!0,n=>{if(w.isError(n))return!1;throw n})}isValidSync(e,t){try{return this.validateSync(e,t),!0}catch(n){if(w.isError(n))return!1;throw n}}_getDefault(e){let t=this.spec.default;return t==null?t:typeof t=="function"?t.call(this,e):ie(t)}getDefault(e){return this.resolve(e||{})._getDefault(e)}default(e){return arguments.length===0?this._getDefault():this.clone({default:e})}strict(e=!0){return this.clone({strict:e})}nullability(e,t){let n=this.clone({nullable:e});return n.internalTests.nullable=ne({message:t,name:"nullable",test(i){return i===null?this.schema.spec.nullable:!0}}),n}optionality(e,t){let n=this.clone({optional:e});return n.internalTests.optionality=ne({message:t,name:"optionality",test(i){return i===void 0?this.schema.spec.optional:!0}}),n}optional(){return this.optionality(!0)}defined(e=k.defined){return this.optionality(!1,e)}nullable(){return this.nullability(!0)}nonNullable(e=k.notNull){return this.nullability(!1,e)}required(e=k.required){return this.clone().withMutation(t=>t.nonNullable(e).defined(e))}notRequired(){return this.clone().withMutation(e=>e.nullable().optional())}transform(e){let t=this.clone();return t.transforms.push(e),t}test(...e){let t;if(e.length===1?typeof e[0]=="function"?t={test:e[0]}:t=e[0]:e.length===2?t={name:e[0],test:e[1]}:t={name:e[0],message:e[1],test:e[2]},t.message===void 0&&(t.message=k.default),typeof t.test!="function")throw new TypeError("`test` is a required parameters");let n=this.clone(),i=ne(t),s=t.exclusive||t.name&&n.exclusiveTests[t.name]===!0;if(t.exclusive&&!t.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return t.name&&(n.exclusiveTests[t.name]=!!t.exclusive),n.tests=n.tests.filter(a=>!(a.OPTIONS.name===t.name&&(s||a.OPTIONS.test===i.OPTIONS.test))),n.tests.push(i),n}when(e,t){!Array.isArray(e)&&typeof e!="string"&&(t=e,e=".");let n=this.clone(),i=_r(e).map(s=>new L(s));return i.forEach(s=>{s.isSibling&&n.deps.push(s.key)}),n.conditions.push(typeof t=="function"?new se(i,t):se.fromOptions(i,t)),n}typeError(e){let t=this.clone();return t.internalTests.typeError=ne({message:e,name:"typeError",skipAbsent:!0,test(n){return this.schema._typeCheck(n)?!0:this.createError({params:{type:this.schema.type}})}}),t}oneOf(e,t=k.oneOf){let n=this.clone();return e.forEach(i=>{n._whitelist.add(i),n._blacklist.delete(i)}),n.internalTests.whiteList=ne({message:t,name:"oneOf",skipAbsent:!0,test(i){let s=this.schema._whitelist,a=s.resolveAll(this.resolve);return a.includes(i)?!0:this.createError({params:{values:Array.from(s).join(", "),resolved:a}})}}),n}notOneOf(e,t=k.notOneOf){let n=this.clone();return e.forEach(i=>{n._blacklist.add(i),n._whitelist.delete(i)}),n.internalTests.blacklist=ne({message:t,name:"notOneOf",test(i){let s=this.schema._blacklist,a=s.resolveAll(this.resolve);return a.includes(i)?this.createError({params:{values:Array.from(s).join(", "),resolved:a}}):!0}}),n}strip(e=!0){let t=this.clone();return t.spec.strip=e,t}describe(e){let t=(e?this.resolve(e):this).clone(),{label:n,meta:i,optional:s,nullable:a}=t.spec;return{meta:i,label:n,optional:s,nullable:a,default:t.getDefault(e),type:t.type,oneOf:t._whitelist.describe(),notOneOf:t._blacklist.describe(),tests:t.tests.map(o=>({name:o.OPTIONS.name,params:o.OPTIONS.params})).filter((o,l,c)=>c.findIndex(d=>d.name===o.name)===l)}}};D.prototype.__isYupSchema__=!0;for(let r of["validate","validateSync"])D.prototype[`${r}At`]=function(e,t,n={}){let{parent:i,parentPath:s,schema:a}=Tt(this,e,t,n.context);return a[r](i&&i[s],Object.assign({},n,{parent:i,path:e}))};for(let r of["equals","is"])D.prototype[r]=D.prototype.oneOf;for(let r of["not","nope"])D.prototype[r]=D.prototype.notOneOf;var Hi=()=>!0;function Cr(r){return new ve(r)}var ve=class extends D{constructor(e){super(typeof e=="function"?{type:"mixed",check:e}:Object.assign({type:"mixed",check:Hi},e))}};Cr.prototype=ve.prototype;function xt(){return new Te}var Te=class extends D{constructor(){super({type:"boolean",check(e){return e instanceof Boolean&&(e=e.valueOf()),typeof e=="boolean"}}),this.withMutation(()=>{this.transform((e,t,n)=>{if(n.spec.coerce&&!n.isType(e)){if(/^(true|1)$/i.test(String(e)))return!0;if(/^(false|0)$/i.test(String(e)))return!1}return e})})}isTrue(e=bt.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"true"},test(t){return R(t)||t===!0}})}isFalse(e=bt.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"false"},test(t){return R(t)||t===!1}})}default(e){return super.default(e)}defined(e){return super.defined(e)}optional(){return super.optional()}required(e){return super.required(e)}notRequired(){return super.notRequired()}nullable(){return super.nullable()}nonNullable(e){return super.nonNullable(e)}strip(e){return super.strip(e)}};xt.prototype=Te.prototype;var Gi=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function Yi(r){let e=vt(r);if(!e)return Date.parse?Date.parse(r):Number.NaN;if(e.z===void 0&&e.plusMinus===void 0)return new Date(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond).valueOf();let t=0;return e.z!=="Z"&&e.plusMinus!==void 0&&(t=e.hourOffset*60+e.minuteOffset,e.plusMinus==="+"&&(t=0-t)),Date.UTC(e.year,e.month,e.day,e.hour,e.minute+t,e.second,e.millisecond)}function vt(r){var e,t;let n=Gi.exec(r);return n?{year:U(n[1]),month:U(n[2],1)-1,day:U(n[3],1),hour:U(n[4]),minute:U(n[5]),second:U(n[6]),millisecond:n[7]?U(n[7].substring(0,3)):0,precision:(e=(t=n[7])==null?void 0:t.length)!=null?e:void 0,z:n[8]||void 0,plusMinus:n[9]||void 0,hourOffset:U(n[10]),minuteOffset:U(n[11])}:null}function U(r,e=0){return Number(r)||e}var Bi=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Zi=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,Ki=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,Wi="^\\d{4}-\\d{2}-\\d{2}",Xi="\\d{2}:\\d{2}:\\d{2}",Ji="(([+-]\\d{2}(:?\\d{2})?)|Z)",Qi=new RegExp(`${Wi}T${Xi}(\\.\\d+)?${Ji}$`),es=r=>R(r)||r===r.trim(),ts={}.toString();function Pr(){return new xe}var xe=class extends D{constructor(){super({type:"string",check(e){return e instanceof String&&(e=e.valueOf()),typeof e=="string"}}),this.withMutation(()=>{this.transform((e,t,n)=>{if(!n.spec.coerce||n.isType(e)||Array.isArray(e))return e;let i=e!=null&&e.toString?e.toString():e;return i===ts?e:i})})}required(e){return super.required(e).withMutation(t=>t.test({message:e||k.required,name:"required",skipAbsent:!0,test:n=>!!n.length}))}notRequired(){return super.notRequired().withMutation(e=>(e.tests=e.tests.filter(t=>t.OPTIONS.name!=="required"),e))}length(e,t=F.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(n){return n.length===this.resolve(e)}})}min(e,t=F.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(n){return n.length>=this.resolve(e)}})}max(e,t=F.max){return this.test({name:"max",exclusive:!0,message:t,params:{max:e},skipAbsent:!0,test(n){return n.length<=this.resolve(e)}})}matches(e,t){let n=!1,i,s;return t&&(typeof t=="object"?{excludeEmptyString:n=!1,message:i,name:s}=t:i=t),this.test({name:s||"matches",message:i||F.matches,params:{regex:e},skipAbsent:!0,test:a=>a===""&&n||a.search(e)!==-1})}email(e=F.email){return this.matches(Bi,{name:"email",message:e,excludeEmptyString:!0})}url(e=F.url){return this.matches(Zi,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=F.uuid){return this.matches(Ki,{name:"uuid",message:e,excludeEmptyString:!1})}datetime(e){let t="",n,i;return e&&(typeof e=="object"?{message:t="",allowOffset:n=!1,precision:i=void 0}=e:t=e),this.matches(Qi,{name:"datetime",message:t||F.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:t||F.datetime_offset,params:{allowOffset:n},skipAbsent:!0,test:s=>{if(!s||n)return!0;let a=vt(s);return a?!!a.z:!1}}).test({name:"datetime_precision",message:t||F.datetime_precision,params:{precision:i},skipAbsent:!0,test:s=>{if(!s||i==null)return!0;let a=vt(s);return a?a.precision===i:!1}})}ensure(){return this.default("").transform(e=>e===null?"":e)}trim(e=F.trim){return this.transform(t=>t!=null?t.trim():t).test({message:e,name:"trim",test:es})}lowercase(e=F.lowercase){return this.transform(t=>R(t)?t:t.toLowerCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:t=>R(t)||t===t.toLowerCase()})}uppercase(e=F.uppercase){return this.transform(t=>R(t)?t:t.toUpperCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:t=>R(t)||t===t.toUpperCase()})}};Pr.prototype=xe.prototype;var rs=r=>r!=+r;function $r(){return new Se}var Se=class extends D{constructor(){super({type:"number",check(e){return e instanceof Number&&(e=e.valueOf()),typeof e=="number"&&!rs(e)}}),this.withMutation(()=>{this.transform((e,t,n)=>{if(!n.spec.coerce)return e;let i=e;if(typeof i=="string"){if(i=i.replace(/\s/g,""),i==="")return NaN;i=+i}return n.isType(i)||i===null?i:parseFloat(i)})})}min(e,t=q.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(n){return n>=this.resolve(e)}})}max(e,t=q.max){return this.test({message:t,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(n){return n<=this.resolve(e)}})}lessThan(e,t=q.lessThan){return this.test({message:t,name:"max",exclusive:!0,params:{less:e},skipAbsent:!0,test(n){return n<this.resolve(e)}})}moreThan(e,t=q.moreThan){return this.test({message:t,name:"min",exclusive:!0,params:{more:e},skipAbsent:!0,test(n){return n>this.resolve(e)}})}positive(e=q.positive){return this.moreThan(0,e)}negative(e=q.negative){return this.lessThan(0,e)}integer(e=q.integer){return this.test({name:"integer",message:e,skipAbsent:!0,test:t=>Number.isInteger(t)})}truncate(){return this.transform(e=>R(e)?e:e|0)}round(e){var t;let n=["ceil","floor","round","trunc"];if(e=((t=e)==null?void 0:t.toLowerCase())||"round",e==="trunc")return this.truncate();if(n.indexOf(e.toLowerCase())===-1)throw new TypeError("Only valid options for round() are: "+n.join(", "));return this.transform(i=>R(i)?i:Math[e](i))}};$r.prototype=Se.prototype;var Rr=new Date(""),ns=r=>Object.prototype.toString.call(r)==="[object Date]";function St(){return new z}var z=class extends D{constructor(){super({type:"date",check(e){return ns(e)&&!isNaN(e.getTime())}}),this.withMutation(()=>{this.transform((e,t,n)=>!n.spec.coerce||n.isType(e)||e===null?e:(e=Yi(e),isNaN(e)?z.INVALID_DATE:new Date(e)))})}prepareParam(e,t){let n;if(L.isRef(e))n=e;else{let i=this.cast(e);if(!this._typeCheck(i))throw new TypeError(`\`${t}\` must be a Date or a value that can be \`cast()\` to a Date`);n=i}return n}min(e,t=yt.min){let n=this.prepareParam(e,"min");return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(i){return i>=this.resolve(n)}})}max(e,t=yt.max){let n=this.prepareParam(e,"max");return this.test({message:t,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(i){return i<=this.resolve(n)}})}};z.INVALID_DATE=Rr;St.prototype=z.prototype;St.INVALID_DATE=Rr;function is(r,e=[]){let t=[],n=new Set,i=new Set(e.map(([a,u])=>`${a}-${u}`));function s(a,u){let o=K.split(a)[0];n.add(o),i.has(`${u}-${o}`)||t.push([u,o])}for(let a of Object.keys(r)){let u=r[a];n.add(a),L.isRef(u)&&u.isSibling?s(u.path,a):W(u)&&"deps"in u&&u.deps.forEach(o=>s(o,a))}return Ri.default.array(Array.from(n),t).reverse()}function xr(r,e){let t=1/0;return r.some((n,i)=>{var s;if((s=e.path)!=null&&s.includes(n))return t=i,!0}),t}function Nr(r){return(e,t)=>xr(r,e)-xr(r,t)}var kr=(r,e,t)=>{if(typeof r!="string")return r;let n=r;try{n=JSON.parse(r)}catch(i){}return t.isType(n)?n:r};function ke(r){if("fields"in r){let e={};for(let[t,n]of Object.entries(r.fields))e[t]=ke(n);return r.setFields(e)}if(r.type==="array"){let e=r.optional();return e.innerType&&(e.innerType=ke(e.innerType)),e}return r.type==="tuple"?r.optional().clone({types:r.spec.types.map(ke)}):"optional"in r?r.optional():r}var ss=(r,e)=>{let t=[...K.normalizePath(e)];if(t.length===1)return t[0]in r;let n=t.pop(),i=K.getter(K.join(t),!0)(r);return!!(i&&n in i)},Sr=r=>Object.prototype.toString.call(r)==="[object Object]";function Er(r,e){let t=Object.keys(r.fields);return Object.keys(e).filter(n=>t.indexOf(n)===-1)}var as=Nr([]);function Mr(r){return new Ee(r)}var Ee=class extends D{constructor(e){super({type:"object",check(t){return Sr(t)||typeof t=="function"}}),this.fields=Object.create(null),this._sortErrors=as,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{e&&this.shape(e)})}_cast(e,t={}){var n;let i=super._cast(e,t);if(i===void 0)return this.getDefault(t);if(!this._typeCheck(i))return i;let s=this.fields,a=(n=t.stripUnknown)!=null?n:this.spec.noUnknown,u=[].concat(this._nodes,Object.keys(i).filter(d=>!this._nodes.includes(d))),o={},l=Object.assign({},t,{parent:o,__validating:t.__validating||!1}),c=!1;for(let d of u){let p=s[d],h=d in i;if(p){let E,m=i[d];l.path=(t.path?`${t.path}.`:"")+d,p=p.resolve({value:m,context:t.context,parent:o});let x=p instanceof D?p.spec:void 0,T=x==null?void 0:x.strict;if(x!=null&&x.strip){c=c||d in i;continue}E=!t.__validating||!T?p.cast(i[d],l):i[d],E!==void 0&&(o[d]=E)}else h&&!a&&(o[d]=i[d]);(h!==d in o||o[d]!==i[d])&&(c=!0)}return c?o:i}_validate(e,t={},n,i){let{from:s=[],originalValue:a=e,recursive:u=this.spec.recursive}=t;t.from=[{schema:this,value:a},...s],t.__validating=!0,t.originalValue=a,super._validate(e,t,n,(o,l)=>{if(!u||!Sr(l)){i(o,l);return}a=a||l;let c=[];for(let d of this._nodes){let p=this.fields[d];!p||L.isRef(p)||c.push(p.asNestedTest({options:t,key:d,parent:l,parentPath:t.path,originalParent:a}))}this.runTests({tests:c,value:l,originalValue:a,options:t},n,d=>{i(d.sort(this._sortErrors).concat(o),l)})})}clone(e){let t=super.clone(e);return t.fields=Object.assign({},this.fields),t._nodes=this._nodes,t._excludedEdges=this._excludedEdges,t._sortErrors=this._sortErrors,t}concat(e){let t=super.concat(e),n=t.fields;for(let[i,s]of Object.entries(this.fields)){let a=n[i];n[i]=a===void 0?s:a}return t.withMutation(i=>i.setFields(n,[...this._excludedEdges,...e._excludedEdges]))}_getDefault(e){if("default"in this.spec)return super._getDefault(e);if(!this._nodes.length)return;let t={};return this._nodes.forEach(n=>{var i;let s=this.fields[n],a=e;(i=a)!=null&&i.value&&(a=Object.assign({},a,{parent:a.value,value:a.value[n]})),t[n]=s&&"getDefault"in s?s.getDefault(a):void 0}),t}setFields(e,t){let n=this.clone();return n.fields=e,n._nodes=is(e,t),n._sortErrors=Nr(Object.keys(e)),t&&(n._excludedEdges=t),n}shape(e,t=[]){return this.clone().withMutation(n=>{let i=n._excludedEdges;return t.length&&(Array.isArray(t[0])||(t=[t]),i=[...n._excludedEdges,...t]),n.setFields(Object.assign(n.fields,e),i)})}partial(){let e={};for(let[t,n]of Object.entries(this.fields))e[t]="optional"in n&&n.optional instanceof Function?n.optional():n;return this.setFields(e)}deepPartial(){return ke(this)}pick(e){let t={};for(let n of e)this.fields[n]&&(t[n]=this.fields[n]);return this.setFields(t,this._excludedEdges.filter(([n,i])=>e.includes(n)&&e.includes(i)))}omit(e){let t=[];for(let n of Object.keys(this.fields))e.includes(n)||t.push(n);return this.pick(t)}from(e,t,n){let i=K.getter(e,!0);return this.transform(s=>{if(!s)return s;let a=s;return ss(s,e)&&(a=Object.assign({},s),n||delete a[e],a[t]=i(s)),a})}json(){return this.transform(kr)}exact(e){return this.test({name:"exact",exclusive:!0,message:e||Re.exact,test(t){if(t==null)return!0;let n=Er(this.schema,t);return n.length===0||this.createError({params:{properties:n.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(e=!0,t=Re.noUnknown){typeof e!="boolean"&&(t=e,e=!0);let n=this.test({name:"noUnknown",exclusive:!0,message:t,test(i){if(i==null)return!0;let s=Er(this.schema,i);return!e||s.length===0||this.createError({params:{unknown:s.join(", ")}})}});return n.spec.noUnknown=e,n}unknown(e=!0,t=Re.noUnknown){return this.noUnknown(!e,t)}transformKeys(e){return this.transform(t=>{if(!t)return t;let n={};for(let i of Object.keys(t))n[e(i)]=t[i];return n})}camelCase(){return this.transformKeys(gt.camelCase)}snakeCase(){return this.transformKeys(gt.snakeCase)}constantCase(){return this.transformKeys(e=>gt.snakeCase(e).toUpperCase())}describe(e){let t=(e?this.resolve(e):this).clone(),n=super.describe(e);n.fields={};for(let[s,a]of Object.entries(t.fields)){var i;let u=e;(i=u)!=null&&i.value&&(u=Object.assign({},u,{parent:u.value,value:u.value[s]})),n.fields[s]=a.describe(u)}return n}};Mr.prototype=Ee.prototype;function Lr(r){return new Oe(r)}var Oe=class extends D{constructor(e){super({type:"array",spec:{types:e},check(t){return Array.isArray(t)}}),this.innerType=void 0,this.innerType=e}_cast(e,t){let n=super._cast(e,t);if(!this._typeCheck(n)||!this.innerType)return n;let i=!1,s=n.map((a,u)=>{let o=this.innerType.cast(a,Object.assign({},t,{path:`${t.path||""}[${u}]`}));return o!==a&&(i=!0),o});return i?s:n}_validate(e,t={},n,i){var s;let a=this.innerType,u=(s=t.recursive)!=null?s:this.spec.recursive;t.originalValue!=null&&t.originalValue,super._validate(e,t,n,(o,l)=>{var c;if(!u||!a||!this._typeCheck(l)){i(o,l);return}let d=new Array(l.length);for(let h=0;h<l.length;h++){var p;d[h]=a.asNestedTest({options:t,index:h,parent:l,parentPath:t.path,originalParent:(p=t.originalValue)!=null?p:e})}this.runTests({value:l,tests:d,originalValue:(c=t.originalValue)!=null?c:e,options:t},n,h=>i(h.concat(o),l))})}clone(e){let t=super.clone(e);return t.innerType=this.innerType,t}json(){return this.transform(kr)}concat(e){let t=super.concat(e);return t.innerType=this.innerType,e.innerType&&(t.innerType=t.innerType?t.innerType.concat(e.innerType):e.innerType),t}of(e){let t=this.clone();if(!W(e))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+M(e));return t.innerType=e,t.spec=Object.assign({},t.spec,{types:e}),t}length(e,t=Ne.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(n){return n.length===this.resolve(e)}})}min(e,t){return t=t||Ne.min,this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(n){return n.length>=this.resolve(e)}})}max(e,t){return t=t||Ne.max,this.test({message:t,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(n){return n.length<=this.resolve(e)}})}ensure(){return this.default(()=>[]).transform((e,t)=>this._typeCheck(e)?e:t==null?[]:[].concat(t))}compact(e){let t=e?(n,i,s)=>!e(n,i,s):n=>!!n;return this.transform(n=>n!=null?n.filter(t):n)}describe(e){let t=(e?this.resolve(e):this).clone(),n=super.describe(e);if(t.innerType){var i;let s=e;(i=s)!=null&&i.value&&(s=Object.assign({},s,{parent:s.value,value:s.value[0]})),n.innerType=t.innerType.describe(s)}return n}};Lr.prototype=Oe.prototype;function jr(r){return new _e(r)}var _e=class extends D{constructor(e){super({type:"tuple",spec:{types:e},check(t){let n=this.spec.types;return Array.isArray(t)&&t.length===n.length}}),this.withMutation(()=>{this.typeError(Ar.notType)})}_cast(e,t){let{types:n}=this.spec,i=super._cast(e,t);if(!this._typeCheck(i))return i;let s=!1,a=n.map((u,o)=>{let l=u.cast(i[o],Object.assign({},t,{path:`${t.path||""}[${o}]`}));return l!==i[o]&&(s=!0),l});return s?a:i}_validate(e,t={},n,i){let s=this.spec.types;super._validate(e,t,n,(a,u)=>{var o;if(!this._typeCheck(u)){i(a,u);return}let l=[];for(let[d,p]of s.entries()){var c;l[d]=p.asNestedTest({options:t,index:d,parent:u,parentPath:t.path,originalParent:(c=t.originalValue)!=null?c:e})}this.runTests({value:u,tests:l,originalValue:(o=t.originalValue)!=null?o:e,options:t},n,d=>i(d.concat(a),u))})}describe(e){let t=(e?this.resolve(e):this).clone(),n=super.describe(e);return n.innerType=t.spec.types.map((i,s)=>{var a;let u=e;return(a=u)!=null&&a.value&&(u=Object.assign({},u,{parent:u.value,value:u.value[s]})),i.describe(u)}),n}};jr.prototype=_e.prototype;function us(r){return new ue(r)}function Or(r){try{return r()}catch(e){if(w.isError(e))return Promise.reject(e);throw e}}var ue=class{constructor(e){this.type="lazy",this.__isYupSchema__=!0,this.spec=void 0,this._resolve=(t,n={})=>{let i=this.builder(t,n);if(!W(i))throw new TypeError("lazy() functions must return a valid schema");return this.spec.optional&&(i=i.optional()),i.resolve(n)},this.builder=e,this.spec={meta:void 0,optional:!1}}clone(e){let t=new ue(this.builder);return t.spec=Object.assign({},this.spec,e),t}optionality(e){return this.clone({optional:e})}optional(){return this.optionality(!0)}resolve(e){return this._resolve(e.value,e)}cast(e,t){return this._resolve(e,t).cast(e,t)}asNestedTest(e){let{key:t,index:n,parent:i,options:s}=e,a=i[n!=null?n:t];return this._resolve(a,Object.assign({},s,{value:a,parent:i})).asNestedTest(e)}validate(e,t){return Or(()=>this._resolve(e,t).validate(e,t))}validateSync(e,t){return this._resolve(e,t).validateSync(e,t)}validateAt(e,t,n){return Or(()=>this._resolve(t,n).validateAt(e,t,n))}validateSyncAt(e,t,n){return this._resolve(t,n).validateSyncAt(e,t,n)}isValid(e,t){try{return this._resolve(e,t).isValid(e,t)}catch(n){if(w.isError(n))return Promise.resolve(!1);throw n}}isValidSync(e,t){return this._resolve(e,t).isValidSync(e,t)}describe(e){return e?this.resolve(e).describe(e):{type:"lazy",meta:this.spec.meta,label:void 0}}meta(...e){if(e.length===0)return this.spec.meta;let t=this.clone();return t.spec.meta=Object.assign(t.spec.meta||{},e[0]),t}};function os(r){Object.keys(r).forEach(e=>{Object.keys(r[e]).forEach(t=>{Ir[e][t]=r[e][t]})})}function ls(r,e,t){if(!r||!W(r.prototype))throw new TypeError("You must provide a yup schema constructor function");if(typeof e!="string")throw new TypeError("A Method name must be provided");if(typeof t!="function")throw new TypeError("Method function must be provided");r.prototype[e]=t}b.ArraySchema=Oe;b.BooleanSchema=Te;b.DateSchema=z;b.LazySchema=ue;b.MixedSchema=ve;b.NumberSchema=Se;b.ObjectSchema=Ee;b.Schema=D;b.StringSchema=xe;b.TupleSchema=_e;b.ValidationError=w;b.addMethod=ls;b.array=Lr;b.bool=xt;b.boolean=xt;b.date=St;b.defaultLocale=Ir;b.getIn=Tt;b.isSchema=W;b.lazy=us;b.mixed=Cr;b.number=$r;b.object=Mr;b.printValue=M;b.reach=zi;b.ref=qi;b.setLocale=os;b.string=Pr;b.tuple=jr});var Zr=S(ce=>{"use strict";Object.defineProperty(ce,"__esModule",{value:!0});ce.urlRegex=void 0;ce.validateHeader=vs;ce.validateHeaderAndEvent=Ts;var f=cs(Ur());function zr(r){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(zr=function(i){return i?t:e})(r)}function cs(r,e){if(!e&&r&&r.__esModule)return r;if(r===null||le(r)!=="object"&&typeof r!="function")return{default:r};var t=zr(e);if(t&&t.has(r))return t.get(r);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in r)if(s!=="default"&&Object.prototype.hasOwnProperty.call(r,s)){var a=i?Object.getOwnPropertyDescriptor(r,s):null;a&&(a.get||a.set)?Object.defineProperty(n,s,a):n[s]=r[s]}return n.default=r,t&&t.set(r,n),n}function le(r){return le=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},le(r)}function Vr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function qr(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Vr(Object(t),!0).forEach(function(n){fs(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Vr(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function fs(r,e,t){return e=ds(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ds(r){var e=ps(r,"string");return le(e)==="symbol"?e:String(e)}function ps(r,e){if(le(r)!=="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(le(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Hr=ce.urlRegex=/^(?:([a-z0-9+.-]+):\/\/)(?:\S+(?::\S*)?@)?(?:(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*\.?)(?::\d{2,5})?(?:[/?#]\S*)?$/,oe=function(e){var t=e.required;return f.lazy(function(n){return typeof n=="number"?f.number().integer().min(0):typeof n=="string"?f.string().required():!t&&typeof n=="undefined"?f.mixed().oneOf([void 0]):f.array().required().min(3).max(7).of(f.lazy(function(i,s){var a=s.parent.indexOf(s.value);return[f.number().integer(),f.number().integer().min(1).max(12),f.number().integer().min(1).max(31),f.number().integer().min(0).max(23),f.number().integer().min(0).max(60),f.number().integer().min(0).max(60)][a]}))})},Gr=f.object().shape({before:f.boolean(),weeks:f.number(),days:f.number(),hours:f.number(),minutes:f.number(),seconds:f.number()}).noUnknown(),Yr=f.object().shape({name:f.string(),email:f.string().email(),rsvp:f.boolean(),dir:f.string().matches(Hr),partstat:f.string(),role:f.string(),cutype:f.string(),xNumGuests:f.number()}).noUnknown(),hs=f.object().shape({name:f.string(),email:f.string().email(),dir:f.string(),sentBy:f.string()}).noUnknown(),ms=f.object().shape({action:f.string().matches(/^(audio|display|email)$/).required(),trigger:f.mixed().required(),description:f.string(),duration:Gr,repeat:f.number(),attach:f.string(),attachType:f.string(),summary:f.string(),attendee:Yr,"x-prop":f.mixed(),"iana-prop":f.mixed()}).noUnknown(),Br={productId:f.string(),method:f.string(),calName:f.string()},gs=f.object().shape(Br).noUnknown(),ys={summary:f.string(),timestamp:oe({required:!1}),title:f.string(),uid:f.string(),sequence:f.number().integer().max(2147483647),start:oe({required:!0}),duration:Gr,startType:f.string().matches(/^(utc|local)$/),startInputType:f.string().matches(/^(utc|local)$/),startOutputType:f.string().matches(/^(utc|local)$/),end:oe({required:!1}),endInputType:f.string().matches(/^(utc|local)$/),endOutputType:f.string().matches(/^(utc|local)$/),description:f.string(),url:f.string().matches(Hr),geo:f.object().shape({lat:f.number(),lon:f.number()}),location:f.string(),status:f.string().matches(/^(TENTATIVE|CANCELLED|CONFIRMED)$/i),categories:f.array().of(f.string()),organizer:hs,attendees:f.array().of(Yr),alarms:f.array().of(ms),recurrenceRule:f.string(),busyStatus:f.string().matches(/^(TENTATIVE|FREE|BUSY|OOF)$/i),transp:f.string().matches(/^(TRANSPARENT|OPAQUE)$/i),classification:f.string(),created:oe({required:!1}),lastModified:oe({required:!1}),exclusionDates:f.array().of(oe({required:!0})),htmlContent:f.string()},bs=f.object().shape(qr(qr({},Br),ys)).test("xor","object should have end or duration (but not both)",function(r){var e=!!r.end,t=!!r.duration;return e&&!t||!e&&t||!e&&!t}).noUnknown();function vs(r){try{var e=gs.validateSync(r,{abortEarly:!1,strict:!0});return{error:null,value:e}}catch(t){return{error:Object.assign({},t),value:void 0}}}function Ts(r){try{var e=bs.validateSync(r,{abortEarly:!1,strict:!0});return{error:null,value:e}}catch(t){return{error:Object.assign({},t),value:void 0}}}});var Kr=S(we=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});var Et=Zr();Object.keys(Et).forEach(function(r){r==="default"||r==="__esModule"||r in we&&we[r]===Et[r]||Object.defineProperty(we,r,{enumerable:!0,get:function(){return Et[r]}})})});var Xr=S(j=>{"use strict";Object.defineProperty(j,"__esModule",{value:!0});Object.defineProperty(j,"buildEvent",{enumerable:!0,get:function(){return Wr.buildEvent}});Object.defineProperty(j,"buildHeader",{enumerable:!0,get:function(){return Wr.buildHeader}});Object.defineProperty(j,"formatEvent",{enumerable:!0,get:function(){return Ot.formatEvent}});Object.defineProperty(j,"formatFooter",{enumerable:!0,get:function(){return Ot.formatFooter}});Object.defineProperty(j,"formatHeader",{enumerable:!0,get:function(){return Ot.formatHeader}});Object.defineProperty(j,"urlRegex",{enumerable:!0,get:function(){return _t.urlRegex}});Object.defineProperty(j,"validateHeader",{enumerable:!0,get:function(){return _t.validateHeader}});Object.defineProperty(j,"validateHeaderAndEvent",{enumerable:!0,get:function(){return _t.validateHeaderAndEvent}});var Wr=qt(),Ot=or(),_t=Kr()});var tn=S(de=>{"use strict";Object.defineProperty(de,"__esModule",{value:!0});de.convertTimestampToArray=_s;de.createEvent=ws;de.createEvents=en;de.isValidURL=Ds;var V=Xr();function fe(r){return fe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fe(r)}function Jr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Le(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Jr(Object(t),!0).forEach(function(n){xs(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Jr(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function xs(r,e,t){return e=Ss(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ss(r){var e=Es(r,"string");return fe(e)==="symbol"?e:String(e)}function Es(r,e){if(fe(r)!=="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(fe(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function Os(r){return(0,V.validateHeader)((0,V.buildHeader)(r))}function Qr(r){return(0,V.validateHeaderAndEvent)(Le(Le({},(0,V.buildHeader)(r)),(0,V.buildEvent)(r)))}function _s(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"local",t=[],n=new Date(r);return t.push(e==="local"?n.getFullYear():n.getUTCFullYear()),t.push((e==="local"?n.getMonth():n.getUTCMonth())+1),t.push(e==="local"?n.getDate():n.getUTCDate()),t.push(e==="local"?n.getHours():n.getUTCHours()),t.push(e==="local"?n.getMinutes():n.getUTCMinutes()),t}function ws(r,e){return en([r],e)}function en(r,e,t){var n=fe(e)==="object"?e:{},i=arguments.length===3?t:typeof e=="function"?e:null,s=function(){if(!r)return{error:new Error("one argument is required"),value:null};var o=r.length===0?Os(n):Qr(Le(Le({},r[0]),n)),l=o.error,c=o.value;if(l)return{error:l,value:null};var d="";d+=(0,V.formatHeader)(c);for(var p=0;p<r.length;p++){var h=Qr(r[p]),E=h.error,m=h.value;if(E)return{error:E,value:null};d+=(0,V.formatEvent)(m)}return d+=(0,V.formatFooter)(),{error:null,value:d}},a;try{a=s()}catch(u){a={error:u,value:null}}return i?i(a.error,a.value):a}function Ds(r){return V.urlRegex.test(r)}});var Cs={};At(Cs,{default:()=>Ue});module.exports=Pt(Cs);var y=require("obsidian"),nn=Ct(require("http")),sn=Ct(tn()),an=require("os");var Fs={pluginName:"Diary ICS",copySuccess:"ICS subscription link copied to clipboard",serverStarted:"ICS server started: http://{0}:{1}/feed.ics",serverError:"HTTP server error: {0}",fileProvided:"ICS file provided",fileGenerationError:"Error generating ICS file",notFound:"Not found",cannotGetMoment:"Cannot get moment library",cannotGetFileCache:"Cannot get file cache or heading information: {0}",generatingIcsContent:"Generating ICS content: {0}",generatingIcsFiles:"Generating ICS content: {0} diary files",copyIcsUrlCommand:"Copy ICS subscription link",portSetting:"HTTP server port",portDesc:"Port used by the local HTTP server",applyButton:"Apply",portApplied:"Port applied, server restarted",contentSettingsTitle:"Content",headingLevelSetting:"Heading level",headingLevelDesc:"Which level of headings to extract from diary as calendar entries",h1Option:"Level 1 heading (#)",h2Option:"Level 2 heading (##)",includeSubheadingsSetting:"Include subheadings",includeSubheadingsDesc:"Include subheadings under the heading in the calendar event description",diarySettingsTitle:"Diary",diaryFormatSetting:"Diary naming format",diaryFormatDesc:"The naming format of diary files, e.g., YYYY-MM-DD",diaryFolderSetting:"Diary folder",diaryFolderDesc:"The folder path where diary files are located, leave empty for root directory",frontmatterSettingsTitle:"Frontmatter",includeFrontmatterSetting:"Include frontmatter",includeFrontmatterDesc:"Include the frontmatter content of diary files as separate calendar events",frontmatterTitleSetting:"Frontmatter title template",frontmatterTitleDesc:"Customize the title format of frontmatter events, use {{fieldName}} to reference specific fields, or {{filename}} to reference the current filename",frontmatterTemplateSetting:"Frontmatter content template",frontmatterTemplateDesc:"Customize the display format of frontmatter content, use {{fieldName}} to reference specific fields",templateExampleTitle:"Template examples:",templateExample1:'1. Using "Weather:{{weather}} Mood:{{mood}}" will replace specific fields',templateExample2:`2. Using "{{filename}}'s Diary" will replace with the current filename (without extension)`,templateExample3:"3. Leave empty to use the default format (title as filename+[frontmatter], content as one field per line)",templateExample4:"4. Properties with null values will be automatically skipped",icsLinkTitle:"ICS subscription link",copyLinkButton:"Copy link",instructionsTitle:"Instructions",instruction1:"1. Copy the ICS subscription link above",instruction2:"2. Add this subscription link in your system calendar application",instruction3:"3. Ensure Obsidian is running to provide the ICS file"},As={pluginName:"\u65E5\u8BB0\u65E5\u5386\u8BA2\u9605",copySuccess:"ICS\u8BA2\u9605\u94FE\u63A5\u5DF2\u590D\u5236\u5230\u526A\u8D34\u677F",serverStarted:"ICS\u670D\u52A1\u5668\u5DF2\u542F\u52A8: http://{0}:{1}/feed.ics",serverError:"HTTP\u670D\u52A1\u5668\u9519\u8BEF: {0}",fileProvided:"\u5DF2\u63D0\u4F9BICS\u6587\u4EF6",fileGenerationError:"\u751F\u6210ICS\u6587\u4EF6\u65F6\u51FA\u9519",notFound:"\u672A\u627E\u5230",cannotGetMoment:"\u65E0\u6CD5\u83B7\u53D6moment\u5E93",cannotGetFileCache:"\u65E0\u6CD5\u83B7\u53D6\u6587\u4EF6\u7F13\u5B58\u6216\u6807\u9898\u4FE1\u606F: {0}",generatingIcsContent:"\u751F\u6210ICS\u6587\u4EF6\u5185\u5BB9: {0}",generatingIcsFiles:"\u751F\u6210ICS\u6587\u4EF6\u5185\u5BB9: {0} \u4E2A\u65E5\u8BB0\u6587\u4EF6",copyIcsUrlCommand:"\u590D\u5236ICS\u8BA2\u9605\u94FE\u63A5",portSetting:"HTTP\u670D\u52A1\u5668\u7AEF\u53E3",portDesc:"\u672C\u5730HTTP\u670D\u52A1\u5668\u4F7F\u7528\u7684\u7AEF\u53E3\u53F7",applyButton:"\u5E94\u7528",portApplied:"\u7AEF\u53E3\u5DF2\u5E94\u7528\uFF0C\u670D\u52A1\u5668\u5DF2\u91CD\u542F",contentSettingsTitle:"\u5185\u5BB9\u8BBE\u7F6E",headingLevelSetting:"\u6807\u9898\u7EA7\u522B",headingLevelDesc:"\u4ECE\u65E5\u8BB0\u4E2D\u63D0\u53D6\u54EA\u4E00\u7EA7\u6807\u9898\u4F5C\u4E3A\u65E5\u5386\u6761\u76EE",h1Option:"\u4E00\u7EA7\u6807\u9898 (#)",h2Option:"\u4E8C\u7EA7\u6807\u9898 (##)",includeSubheadingsSetting:"\u5305\u542B\u5B50\u7EA7\u6807\u9898",includeSubheadingsDesc:"\u5728\u65E5\u5386\u4E8B\u4EF6\u63CF\u8FF0\u4E2D\u5305\u542B\u6807\u9898\u4E0B\u7684\u5B50\u7EA7\u6807\u9898",diarySettingsTitle:"\u65E5\u8BB0\u8BBE\u7F6E",diaryFormatSetting:"\u65E5\u8BB0\u547D\u540D\u683C\u5F0F",diaryFormatDesc:"\u65E5\u8BB0\u6587\u4EF6\u7684\u547D\u540D\u683C\u5F0F\uFF0C\u4F8B\u5982YYYY-MM-DD",diaryFolderSetting:"\u65E5\u8BB0\u6587\u4EF6\u5939",diaryFolderDesc:"\u65E5\u8BB0\u6587\u4EF6\u6240\u5728\u7684\u6587\u4EF6\u5939\u8DEF\u5F84\uFF0C\u7559\u7A7A\u8868\u793A\u6839\u76EE\u5F55",frontmatterSettingsTitle:"Frontmatter\u8BBE\u7F6E",includeFrontmatterSetting:"\u5305\u542BFrontmatter",includeFrontmatterDesc:"\u5C06\u65E5\u8BB0\u6587\u4EF6\u7684Frontmatter\u5185\u5BB9\u4F5C\u4E3A\u5355\u72EC\u7684\u65E5\u5386\u4E8B\u4EF6",frontmatterTitleSetting:"Frontmatter\u6807\u9898\u6A21\u677F",frontmatterTitleDesc:"\u81EA\u5B9A\u4E49Frontmatter\u65E5\u7A0B\u7684\u6807\u9898\u683C\u5F0F\uFF0C\u53EF\u4F7F\u7528{{\u5B57\u6BB5\u540D}}\u5F15\u7528\u7279\u5B9A\u5B57\u6BB5\uFF0C\u4E5F\u53EF\u4F7F\u7528{{filename}}\u5F15\u7528\u5F53\u524D\u6587\u4EF6\u540D",frontmatterTemplateSetting:"Frontmatter\u5185\u5BB9\u6A21\u677F",frontmatterTemplateDesc:"\u81EA\u5B9A\u4E49Frontmatter\u5185\u5BB9\u7684\u663E\u793A\u683C\u5F0F\uFF0C\u53EF\u76F4\u63A5\u4F7F\u7528{{\u5B57\u6BB5\u540D}}\u5F15\u7528\u7279\u5B9A\u5B57\u6BB5",templateExampleTitle:"\u6A21\u677F\u793A\u4F8B\uFF1A",templateExample1:'1. \u4F7F\u7528 "\u5929\u6C14:{{weather}} \u5FC3\u60C5:{{mood}}" \u5C06\u66FF\u6362\u7279\u5B9A\u5B57\u6BB5',templateExample2:'2. \u4F7F\u7528 "{{filename}}\u7684\u65E5\u8BB0" \u5C06\u66FF\u6362\u4E3A\u5F53\u524D\u6587\u4EF6\u540D\uFF08\u4E0D\u542B\u6269\u5C55\u540D\uFF09',templateExample3:"3. \u7559\u7A7A\u5219\u4F7F\u7528\u9ED8\u8BA4\u683C\u5F0F\uFF08\u6807\u9898\u4E3A\u6587\u4EF6\u540D+[frontmatter]\uFF0C\u5185\u5BB9\u4E3A\u6BCF\u884C\u4E00\u4E2A\u5B57\u6BB5\uFF09",templateExample4:"4. \u503C\u4E3Anull\u7684\u5C5E\u6027\u5C06\u88AB\u81EA\u52A8\u8DF3\u8FC7",icsLinkTitle:"ICS\u8BA2\u9605\u94FE\u63A5",copyLinkButton:"\u590D\u5236\u94FE\u63A5",instructionsTitle:"\u4F7F\u7528\u8BF4\u660E",instruction1:"1. \u590D\u5236\u4E0A\u9762\u7684ICS\u8BA2\u9605\u94FE\u63A5",instruction2:"2. \u5728\u7CFB\u7EDF\u65E5\u5386\u5E94\u7528\u4E2D\u6DFB\u52A0\u8BE5\u8BA2\u9605\u94FE\u63A5",instruction3:"3. \u786E\u4FDDObsidian\u5728\u8FD0\u884C\u72B6\u6001\uFF0C\u4EE5\u4FBFHTTP\u670D\u52A1\u5668\u80FD\u591F\u63D0\u4F9BICS\u6587\u4EF6"};function je(r,...e){return r.replace(/{(\d+)}/g,(t,n)=>{let i=parseInt(n,10);return typeof e[i]!="undefined"?String(e[i]):t})}function rn(r){return r.startsWith("zh")?As:Fs}var wt="YYYY-MM-DD",Is={port:19347,headingLevel:"h2",includeSubheadings:!0,includeFrontmatter:!1,frontmatterTemplate:"",frontmatterTitleTemplate:"",diaryFormat:wt,diaryFolder:""},Ue=class extends y.Plugin{constructor(){super(...arguments);this.server=null;this.dailyNoteFormat=wt;this.dailyNoteFolder=""}getLocalIP(){let t=(0,an.networkInterfaces)();for(let n of Object.keys(t))for(let i of t[n])if(i.family==="IPv4"&&!i.internal)return i.address;return"127.0.0.1"}async onload(){await this.loadSettings(),this.locale=rn((0,y.getLanguage)()),this.dailyNoteFormat=this.settings.diaryFormat,this.dailyNoteFolder=this.settings.diaryFolder;let t=this.getLocalIP(),n=this.addRibbonIcon("calendar-heart",this.locale.pluginName,i=>{let s=`http://${t}:${this.settings.port}/feed.ics`;navigator.clipboard.writeText(s),new y.Notice(`${this.locale.pluginName}: http://${t}:${this.settings.port}/feed.ics
|
||
${this.locale.copySuccess}`)});this.addCommand({id:"copy-ics-url",name:this.locale.copyIcsUrlCommand,callback:()=>{let i=`http://${t}:${this.settings.port}/feed.ics`;navigator.clipboard.writeText(i),new y.Notice(this.locale.copySuccess)}}),this.addSettingTab(new Dt(this.app,this)),this.startServer()}onunload(){this.server&&(this.server.close(),this.server=null)}async loadSettings(){this.settings=Object.assign({},Is,await this.loadData())}async saveSettings(t=!1){await this.saveData(this.settings),t&&this.server&&(this.server.close(),this.server=null,this.startServer())}startServer(){let t=this.settings.port,n=this.getLocalIP();this.server=nn.createServer(async(i,s)=>{if(i.url==="/feed.ics")try{let a=await this.generateIcsContent();s.writeHead(200,{"Content-Type":"text/calendar","Content-Disposition":'attachment; filename="obsidian-diary.ics"'}),s.end(a)}catch(a){console.error(this.locale.fileGenerationError+":",a),s.writeHead(500),s.end(this.locale.fileGenerationError)}else s.writeHead(404),s.end(this.locale.notFound)}),this.server.listen(t,"0.0.0.0",()=>{new y.Notice(je(this.locale.serverStarted,n,t))}),this.server.on("error",i=>{console.error(this.locale.serverError.replace("{0}",""),i),new y.Notice(je(this.locale.serverError,i.message))})}getDailyNoteSettings(){var t;return{format:this.settings.diaryFormat||wt,folder:((t=this.settings.diaryFolder)==null?void 0:t.trim())||"",template:""}}isDiaryFile(t){if(t.extension!=="md")return!1;let n=this.dailyNoteFolder==="/"?"":this.dailyNoteFolder;return this.dailyNoteFolder&&!t.path.startsWith(n)?!1:y.moment?(0,y.moment)(t.basename,this.dailyNoteFormat,!0).isValid():(console.error(this.locale.cannotGetMoment),!1)}async parseDiaryFile(t){var o,l;let n=this.app.metadataCache.getFileCache(t),i=[];if(!n||!n.headings)return[];let s=this.settings.headingLevel==="h1"?1:2,a=s+1,u=((o=n.headings)==null?void 0:o.filter(c=>c.level===s))||[];for(let c=0;c<u.length;c++){let d=u[c],p=u[c+1],h=d.heading,E=d.position.start.line,m=[];(((l=n.headings)==null?void 0:l.filter(T=>T.level>s&&T.position.start.line>E&&(p?T.position.start.line<p.position.start.line:!0)))||[]).forEach(T=>{let I=T.level-a,H=" ".repeat(I);m.push(H+T.heading)}),i.push({title:h,content:m.join(`
|
||
`)})}return i}async generateIcsContent(){let t=[],n=this.app.vault.getName(),i=this.app.vault.getMarkdownFiles().filter(s=>this.isDiaryFile(s));new y.Notice(je(this.locale.generatingIcsFiles,i.length),1e3);for(let s of i){let a=(0,y.moment)(s.basename,this.dailyNoteFormat,!0),u=a.year(),o=a.month()+1,l=a.date(),c=await this.parseDiaryFile(s);if(this.settings.includeFrontmatter){let d=this.app.metadataCache.getFileCache(s);if(d!=null&&d.frontmatter){let p="",h=d.frontmatter;if(this.settings.frontmatterTemplate){let m=this.settings.frontmatterTemplate,x=m;if(m.includes("{{"))for(let T in h)T!=="position"&&(h[T]===null||h[T]===void 0||(x=x.replace(new RegExp(`\\{\\{${T}\\}\\}`,"g"),String(h[T]))));else x=m;p+=x}else for(let m in h)m!=="position"&&(h[m]===null||h[m]===void 0||(p+=`${m}: ${h[m]}
|
||
`));let E=`${s.basename}[frontmatter]`;if(this.settings.frontmatterTitleTemplate){let m=this.settings.frontmatterTitleTemplate;if(m.includes("{{")){let x=m;x.includes("{{filename}}")&&(x=x.replace(/\{\{filename\}\}/g,s.basename));for(let T in h)T!=="position"&&(h[T]===null||h[T]===void 0||(x=x.replace(new RegExp(`\\{\\{${T}\\}\\}`,"g"),String(h[T]))));E=x}else E=m}p&&t.push({title:E,url:`obsidian://open?vault=${encodeURIComponent(n)}&file=${encodeURIComponent(s.path)}`,description:p,start:[u,o,l],duration:{days:1},status:"CONFIRMED",busyStatus:"FREE"})}}for(let d of c){let p="";this.settings.includeSubheadings&&d.content&&(p+=""+d.content+`
|
||
|
||
`),t.push({title:d.title,url:`obsidian://open?vault=${encodeURIComponent(n)}&file=${encodeURIComponent(s.path)}${encodeURIComponent(`#${d.title}`)}`,description:p,start:[u,o,l],duration:{days:1},status:"CONFIRMED",busyStatus:"FREE"})}}return new Promise((s,a)=>{(0,sn.createEvents)(t,(u,o)=>{u?a(u):s(o)})})}},Dt=class extends y.PluginSettingTab{constructor(t,n){super(t,n);this.plugin=n}display(){let{containerEl:t}=this,n=this.plugin.locale;t.empty(),new y.Setting(t).setName(n.portSetting).setDesc(n.portDesc).addText(o=>o.setPlaceholder("19347").setValue(this.plugin.settings.port.toString()).onChange(async l=>{let c=parseInt(l);!isNaN(c)&&c>0&&c<65536&&(this.plugin.settings.port=c,await this.plugin.saveSettings(!1))})).addButton(o=>o.setButtonText(n.applyButton).onClick(async()=>{await this.plugin.saveSettings(!0),new y.Notice(n.portApplied)})),new y.Setting(t).setName(n.contentSettingsTitle).setHeading(),new y.Setting(t).setName(n.headingLevelSetting).setDesc(n.headingLevelDesc).addDropdown(o=>o.addOption("h1",n.h1Option).addOption("h2",n.h2Option).setValue(this.plugin.settings.headingLevel).onChange(async l=>{this.plugin.settings.headingLevel=l,await this.plugin.saveSettings(!1)})),new y.Setting(t).setName(n.includeSubheadingsSetting).setDesc(n.includeSubheadingsDesc).addToggle(o=>o.setValue(this.plugin.settings.includeSubheadings).onChange(async l=>{this.plugin.settings.includeSubheadings=l,await this.plugin.saveSettings(!1)})),new y.Setting(t).setName(n.diarySettingsTitle).setHeading(),new y.Setting(t).setName(n.diaryFormatSetting).setDesc(n.diaryFormatDesc).addText(o=>o.setPlaceholder("YYYY-MM-DD").setValue(this.plugin.settings.diaryFormat).onChange(async l=>{this.plugin.settings.diaryFormat=l,this.plugin.dailyNoteFormat=l,await this.plugin.saveSettings(!1)})),new y.Setting(t).setName(n.diaryFolderSetting).setDesc(n.diaryFolderDesc).addText(o=>o.setPlaceholder("").setValue(this.plugin.settings.diaryFolder).onChange(async l=>{this.plugin.settings.diaryFolder=l,this.plugin.dailyNoteFolder=l,await this.plugin.saveSettings(!1)})),new y.Setting(t).setName(n.frontmatterSettingsTitle).setHeading(),new y.Setting(t).setName(n.includeFrontmatterSetting).setDesc(n.includeFrontmatterDesc).addToggle(o=>o.setValue(this.plugin.settings.includeFrontmatter).onChange(async l=>{this.plugin.settings.includeFrontmatter=l,await this.plugin.saveSettings(!1)})),new y.Setting(t).setName(n.frontmatterTitleSetting).setDesc(n.frontmatterTitleDesc).addText(o=>o.setPlaceholder("{{filename}}[frontmatter]").setValue(this.plugin.settings.frontmatterTitleTemplate).onChange(async l=>{this.plugin.settings.frontmatterTitleTemplate=l,await this.plugin.saveSettings(!1)})),new y.Setting(t).setName(n.frontmatterTemplateSetting).setDesc(n.frontmatterTemplateDesc).addText(o=>o.setPlaceholder("").setValue(this.plugin.settings.frontmatterTemplate).onChange(async l=>{this.plugin.settings.frontmatterTemplate=l,await this.plugin.saveSettings(!1)}));let i=t.createEl("div",{text:n.templateExampleTitle,cls:"diary-ics-template-example"});i.createEl("div",{text:n.templateExample1}),i.createEl("div",{text:n.templateExample2}),i.createEl("div",{text:n.templateExample3}),i.createEl("div",{text:n.templateExample4});let s=this.plugin.getLocalIP();new y.Setting(t).setName(n.icsLinkTitle).setHeading();let a=t.createEl("div",{text:`http://${s}:${this.plugin.settings.port}/feed.ics`,cls:"diary-ics-link-div"});t.createEl("button",{text:n.copyLinkButton,cls:"diary-ics-copy-button"}).addEventListener("click",()=>{let o=`http://${s}:${this.plugin.settings.port}/feed.ics`;navigator.clipboard.writeText(o),new y.Notice(n.copySuccess)}),new y.Setting(t).setName(n.instructionsTitle).setHeading(),t.createEl("p",{text:n.instruction1}),t.createEl("p",{text:n.instruction2}),t.createEl("p",{text:n.instruction3})}};
|
||
|
||
/* nosourcemap */ |