mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-12-16 06:42:51 +00:00
20 lines
146 KiB
JavaScript
20 lines
146 KiB
JavaScript
var x=Object.defineProperty;var A=(e,t,r)=>t in e?x(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var S=(e,t,r)=>(A(e,typeof t!="symbol"?t+"":t,r),r);function __vite_legacy_guard(){import("data:text/javascript,")}const p=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const a of s)if(a.type==="childList")for(const i of a.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&n(i)}).observe(document,{childList:!0,subtree:!0});function r(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerpolicy&&(a.referrerPolicy=s.referrerpolicy),s.crossorigin==="use-credentials"?a.credentials="include":s.crossorigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(s){if(s.ep)return;s.ep=!0;const a=r(s);fetch(s.href,a)}};p();function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var events={exports:{}},R=typeof Reflect=="object"?Reflect:null,ReflectApply=R&&typeof R.apply=="function"?R.apply:function(t,r,n){return Function.prototype.apply.call(t,r,n)},ReflectOwnKeys;R&&typeof R.ownKeys=="function"?ReflectOwnKeys=R.ownKeys:Object.getOwnPropertySymbols?ReflectOwnKeys=function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:ReflectOwnKeys=function(t){return Object.getOwnPropertyNames(t)};function ProcessEmitWarning(e){console&&console.warn&&console.warn(e)}var NumberIsNaN=Number.isNaN||function(t){return t!==t};function EventEmitter(){EventEmitter.init.call(this)}events.exports=EventEmitter;events.exports.once=once;EventEmitter.EventEmitter=EventEmitter;EventEmitter.prototype._events=void 0;EventEmitter.prototype._eventsCount=0;EventEmitter.prototype._maxListeners=void 0;var defaultMaxListeners=10;function checkListener(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(EventEmitter,"defaultMaxListeners",{enumerable:!0,get:function(){return defaultMaxListeners},set:function(e){if(typeof e!="number"||e<0||NumberIsNaN(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");defaultMaxListeners=e}});EventEmitter.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};EventEmitter.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||NumberIsNaN(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this};function _getMaxListeners(e){return e._maxListeners===void 0?EventEmitter.defaultMaxListeners:e._maxListeners}EventEmitter.prototype.getMaxListeners=function(){return _getMaxListeners(this)};EventEmitter.prototype.emit=function(t){for(var r=[],n=1;n<arguments.length;n++)r.push(arguments[n]);var s=t==="error",a=this._events;if(a!==void 0)s=s&&a.error===void 0;else if(!s)return!1;if(s){var i;if(r.length>0&&(i=r[0]),i instanceof Error)throw i;var o=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw o.context=i,o}var l=a[t];if(l===void 0)return!1;if(typeof l=="function")ReflectApply(l,this,r);else for(var u=l.length,d=arrayClone(l,u),n=0;n<u;++n)ReflectApply(d[n],this,r);return!0};function _addListener(e,t,r,n){var s,a,i;if(checkListener(r),a=e._events,a===void 0?(a=e._events=Object.create(null),e._eventsCount=0):(a.newListener!==void 0&&(e.emit("newListener",t,r.listener?r.listener:r),a=e._events),i=a[t]),i===void 0)i=a[t]=r,++e._eventsCount;else if(typeof i=="function"?i=a[t]=n?[r,i]:[i,r]:n?i.unshift(r):i.push(r),s=_getMaxListeners(e),s>0&&i.length>s&&!i.warned){i.warned=!0;var o=new Error("Possible EventEmitter memory leak detected. "+i.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");o.name="MaxListenersExceededWarning",o.emitter=e,o.type=t,o.count=i.length,ProcessEmitWarning(o)}return e}EventEmitter.prototype.addListener=function(t,r){return _addListener(this,t,r,!1)};EventEmitter.prototype.on=EventEmitter.prototype.addListener;EventEmitter.prototype.prependListener=function(t,r){return _addListener(this,t,r,!0)};function onceWrapper(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function _onceWrap(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},s=onceWrapper.bind(n);return s.listener=r,n.wrapFn=s,s}EventEmitter.prototype.once=function(t,r){return checkListener(r),this.on(t,_onceWrap(this,t,r)),this};EventEmitter.prototype.prependOnceListener=function(t,r){return checkListener(r),this.prependListener(t,_onceWrap(this,t,r)),this};EventEmitter.prototype.removeListener=function(t,r){var n,s,a,i,o;if(checkListener(r),s=this._events,s===void 0)return this;if(n=s[t],n===void 0)return this;if(n===r||n.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete s[t],s.removeListener&&this.emit("removeListener",t,n.listener||r));else if(typeof n!="function"){for(a=-1,i=n.length-1;i>=0;i--)if(n[i]===r||n[i].listener===r){o=n[i].listener,a=i;break}if(a<0)return this;a===0?n.shift():spliceOne(n,a),n.length===1&&(s[t]=n[0]),s.removeListener!==void 0&&this.emit("removeListener",t,o||r)}return this};EventEmitter.prototype.off=EventEmitter.prototype.removeListener;EventEmitter.prototype.removeAllListeners=function(t){var r,n,s;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[t]),this;if(arguments.length===0){var a=Object.keys(n),i;for(s=0;s<a.length;++s)i=a[s],i!=="removeListener"&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=n[t],typeof r=="function")this.removeListener(t,r);else if(r!==void 0)for(s=r.length-1;s>=0;s--)this.removeListener(t,r[s]);return this};function _listeners(e,t,r){var n=e._events;if(n===void 0)return[];var s=n[t];return s===void 0?[]:typeof s=="function"?r?[s.listener||s]:[s]:r?unwrapListeners(s):arrayClone(s,s.length)}EventEmitter.prototype.listeners=function(t){return _listeners(this,t,!0)};EventEmitter.prototype.rawListeners=function(t){return _listeners(this,t,!1)};EventEmitter.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):listenerCount.call(e,t)};EventEmitter.prototype.listenerCount=listenerCount;function listenerCount(e){var t=this._events;if(t!==void 0){var r=t[e];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}EventEmitter.prototype.eventNames=function(){return this._eventsCount>0?ReflectOwnKeys(this._events):[]};function arrayClone(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function spliceOne(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function unwrapListeners(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}function once(e,t){return new Promise(function(r,n){function s(i){e.removeListener(t,a),n(i)}function a(){typeof e.removeListener=="function"&&e.removeListener("error",s),r([].slice.call(arguments))}eventTargetAgnosticAddListener(e,t,a,{once:!0}),t!=="error"&&addErrorHandlerIfEventEmitter(e,s,{once:!0})})}function addErrorHandlerIfEventEmitter(e,t,r){typeof e.on=="function"&&eventTargetAgnosticAddListener(e,"error",t,r)}function eventTargetAgnosticAddListener(e,t,r,n){if(typeof e.on=="function")n.once?e.once(t,r):e.on(t,r);else if(typeof e.addEventListener=="function")e.addEventListener(t,function s(a){n.once&&e.removeEventListener(t,s),r(a)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}class Env{constructor(t=globalThis.navigator.userAgent,r={}){S(this,"isIos",!1);S(this,"isIphone",!1);S(this,"isIpad",!1);S(this,"isAndroid",!1);S(this,"isAndroidPad",!1);S(this,"isMac",!1);S(this,"isWin",!1);S(this,"isMqq",!1);S(this,"isWechat",!1);S(this,"isWeb",!1);this.isIphone=t.indexOf("iPhone")>=0,this.isIpad=/(iPad).*OS\s([\d_]+)/.test(t),this.isIos=this.isIphone||this.isIpad,this.isAndroid=t.indexOf("Android")>=0,this.isAndroidPad=this.isAndroid&&t.indexOf("Mobile")<0,this.isMac=t.indexOf("Macintosh")>=0,this.isWin=t.indexOf("Windows")>=0,this.isMqq=/QQ\/([\d.]+)/.test(t),this.isWechat=t.indexOf("MicroMessenger")>=0&&t.indexOf("wxwork")<0,this.isWeb=!this.isIos&&!this.isAndroid&&!/(WebOS|BlackBerry)/.test(t),Object.entries(r).forEach(([n,s])=>{this[n]=s})}}const COMMON_EVENT_PREFIX="magic:common:events:",COMMON_METHOD_PREFIX="magic:common:actions:",CommonMethod={SHOW:"show",HIDE:"hide",SCROLL_TO_VIEW:"scrollIntoView",SCROLL_TO_TOP:"scrollToTop"},DEFAULT_EVENTS=[{label:"\u70B9\u51FB",value:`${COMMON_EVENT_PREFIX}click`}],getCommonEventName=(e,t)=>{const r=`${e}:${t}`;return e.startsWith(COMMON_EVENT_PREFIX)?r:`${COMMON_EVENT_PREFIX}${r}`},isCommonMethod=e=>e.startsWith(COMMON_METHOD_PREFIX),getDirectComponent=(e,t)=>{var n;if(!e)return!1;if(!e.id)return getDirectComponent(e.parentElement,t);const r=(n=t.page)==null?void 0:n.getNode(e.id);return r||!1},commonClickEventHandler=(e,t,r)=>{const n=getDirectComponent(r.target,e);if(n){const{instance:s,data:a}=n;e.emit(getCommonEventName(t,a.id),s)}},bindCommonEventListener=e=>{window.document.body.addEventListener("click",t=>{commonClickEventHandler(e,"click",t)}),window.document.body.addEventListener("click",t=>{commonClickEventHandler(e,"click:capture",t)},!0)},triggerCommonMethod=(e,t)=>{const{instance:r}=t;switch(e.replace(COMMON_METHOD_PREFIX,"")){case CommonMethod.SHOW:r.show();break;case CommonMethod.HIDE:r.hide();break;case CommonMethod.SCROLL_TO_VIEW:r.$el.scrollIntoView({behavior:"smooth"});break;case CommonMethod.SCROLL_TO_TOP:window.scrollTo({top:0,behavior:"smooth"});break}};class Node extends events.exports.EventEmitter{constructor(r){super();S(this,"data");S(this,"style");S(this,"events");S(this,"instance");S(this,"page");S(this,"parent");S(this,"app");this.page=r.page,this.parent=r.parent,this.app=r.app;const{events:n}=r.config;this.data=r.config,this.events=n,this.listenLifeSafe(),this.once("destroy",()=>{this.instance=null,typeof this.data.destroy=="function"&&this.data.destroy(this),this.listenLifeSafe()})}listenLifeSafe(){this.once("created",r=>{this.instance=r,typeof this.data.created=="function"&&this.data.created(this)}),this.once("mounted",r=>{this.instance=r;const n=this.app.eventQueueMap[r.config.id]||[];for(let s=n.shift();s;s=n.shift())this.app.eventHandler(s.eventConfig,s.fromCpt,s.args);typeof this.data.mounted=="function"&&this.data.mounted(this)})}}class Page extends Node{constructor(r){super(r);S(this,"nodes",new Map);this.setNode(r.config.id,this),this.initNode(r.config,this)}initNode(r,n){var a;const s=new Node({config:r,parent:n,page:this,app:this.app});this.setNode(r.id,s),(a=r.items)==null||a.forEach(i=>{this.initNode(i,s)})}getNode(r){return this.nodes.get(r)}setNode(r,n){this.nodes.set(r,n)}deleteNode(r){this.nodes.delete(r)}}const style2Obj=e=>{if(typeof e!="string")return e;const t={};return e.split(";").forEach(r=>{if(!r)return;const n=r.split(":");let s=n.shift(),a=n.join(":");!s||(s=s.replace(/^\s*/,"").replace(/\s*$/,""),a=a.replace(/^\s*/,"").replace(/\s*$/,""),s=s.split("-").map((i,o)=>o>0?`${i[0].toUpperCase()}${i.substr(1)}`:i).join(""),t[s]=a)}),t},fillBackgroundImage=e=>e&&!/^url/.test(e)&&!/^linear-gradient/.test(e)?`url(${e})`:e;class App extends events.exports.EventEmitter{constructor(r){super();S(this,"env");S(this,"pages",new Map);S(this,"page");S(this,"platform","mobile");S(this,"jsEngine","browser");S(this,"designWidth",375);S(this,"components",new Map);S(this,"eventQueueMap",{});if(this.env=new Env(r.ua),r.platform&&(this.platform=r.platform),r.jsEngine&&(this.jsEngine=r.jsEngine),r.designWidth&&(this.designWidth=r.designWidth),this.platform==="mobile"||this.platform==="editor"){const n=()=>{let{width:s}=document.documentElement.getBoundingClientRect();s=Math.min(800,s);const a=s/(this.designWidth/100);document.documentElement.style.fontSize=`${a}px`};n(),document.body.style.fontSize="14px",globalThis.addEventListener("resize",n)}r.transformStyle&&(this.transformStyle=r.transformStyle),r.config&&this.setConfig(r.config,r.curPage),bindCommonEventListener(this)}transformStyle(r){if(!r)return{};let n={};const s={};typeof r=="string"?n=style2Obj(r):n={...r};const a=["zIndex","opacity","fontWeight"];return Object.entries(n).forEach(([i,o])=>{i==="backgroundImage"?o&&(s[i]=fillBackgroundImage(o)):i==="transform"&&typeof o!="string"?s[i]=Object.entries(o).map(([l,u])=>{let d=0;return l==="scale"&&(d=1),`${l}(${u||d})`}).join(" "):!a.includes(i)&&o&&/^[-]?[0-9]*[.]?[0-9]*$/.test(o)?s[i]=`${o/100}rem`:s[i]=o}),s}setConfig(r,n){var s,a,i;this.pages=new Map,(s=r.items)==null||s.forEach(o=>{this.pages.set(o.id,new Page({config:o,app:this}))}),this.setPage(n||((i=(a=this.page)==null?void 0:a.data)==null?void 0:i.id))}setPage(r){let n;r&&(n=this.pages.get(r)),n||(n=this.pages.get(this.pages.keys().next().value)),this.page=n,this.platform!=="magic"&&this.bindEvents()}registerComponent(r,n){this.components.set(r,n)}unregisterComponent(r){this.components.delete(r)}resolveComponent(r){return this.components.get(r)}bindEvents(){var r;if(!!this.page){this.removeAllListeners();for(const[,n]of this.page.nodes)(r=n.events)==null||r.forEach(s=>this.bindEvent(s,`${n.data.id}`))}}bindEvent(r,n){let{name:s}=r;DEFAULT_EVENTS.findIndex(a=>a.value===s)>-1&&(s=getCommonEventName(s,n)),this.on(s,(a,...i)=>{this.eventHandler(r,a,i)})}eventHandler(r,n,s){if(!this.page)throw new Error("\u5F53\u524D\u6CA1\u6709\u9875\u9762");const{method:a,to:i}=r,o=this.page.getNode(i);if(!o)throw`ID\u4E3A${i}\u7684\u7EC4\u4EF6\u4E0D\u5B58\u5728`;if(isCommonMethod(a))return triggerCommonMethod(a,o);o.instance?typeof o.instance[a]=="function"&&o.instance[a](n,...s):this.addEventToMap({eventConfig:r,fromCpt:n,args:s})}destroy(){this.removeAllListeners(),this.pages.clear()}addEventToMap(r){this.eventQueueMap[r.eventConfig.to]?this.eventQueueMap[r.eventConfig.to].push(r):this.eventQueueMap[r.eventConfig.to]=[r]}}//! moment.js
|
|
//! version : 2.29.3
|
|
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
|
|
//! license : MIT
|
|
//! momentjs.com
|
|
var hookCallback;function hooks(){return hookCallback.apply(null,arguments)}function setHookCallback(e){hookCallback=e}function isArray$1(e){return e instanceof Array||Object.prototype.toString.call(e)==="[object Array]"}function isObject$1(e){return e!=null&&Object.prototype.toString.call(e)==="[object Object]"}function hasOwnProp(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function isObjectEmpty(e){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(e).length===0;var t;for(t in e)if(hasOwnProp(e,t))return!1;return!0}function isUndefined$1(e){return e===void 0}function isNumber$1(e){return typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]"}function isDate$1(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function map(e,t){var r=[],n,s=e.length;for(n=0;n<s;++n)r.push(t(e[n],n));return r}function extend$1(e,t){for(var r in t)hasOwnProp(t,r)&&(e[r]=t[r]);return hasOwnProp(t,"toString")&&(e.toString=t.toString),hasOwnProp(t,"valueOf")&&(e.valueOf=t.valueOf),e}function createUTC(e,t,r,n){return createLocalOrUTC(e,t,r,n,!0).utc()}function defaultParsingFlags(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function getParsingFlags(e){return e._pf==null&&(e._pf=defaultParsingFlags()),e._pf}var some;Array.prototype.some?some=Array.prototype.some:some=function(e){var t=Object(this),r=t.length>>>0,n;for(n=0;n<r;n++)if(n in t&&e.call(this,t[n],n,t))return!0;return!1};function isValid(e){if(e._isValid==null){var t=getParsingFlags(e),r=some.call(t.parsedDateParts,function(s){return s!=null}),n=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&r);if(e._strict&&(n=n&&t.charsLeftOver===0&&t.unusedTokens.length===0&&t.bigHour===void 0),Object.isFrozen==null||!Object.isFrozen(e))e._isValid=n;else return n}return e._isValid}function createInvalid(e){var t=createUTC(NaN);return e!=null?extend$1(getParsingFlags(t),e):getParsingFlags(t).userInvalidated=!0,t}var momentProperties=hooks.momentProperties=[],updateInProgress=!1;function copyConfig(e,t){var r,n,s,a=momentProperties.length;if(isUndefined$1(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),isUndefined$1(t._i)||(e._i=t._i),isUndefined$1(t._f)||(e._f=t._f),isUndefined$1(t._l)||(e._l=t._l),isUndefined$1(t._strict)||(e._strict=t._strict),isUndefined$1(t._tzm)||(e._tzm=t._tzm),isUndefined$1(t._isUTC)||(e._isUTC=t._isUTC),isUndefined$1(t._offset)||(e._offset=t._offset),isUndefined$1(t._pf)||(e._pf=getParsingFlags(t)),isUndefined$1(t._locale)||(e._locale=t._locale),a>0)for(r=0;r<a;r++)n=momentProperties[r],s=t[n],isUndefined$1(s)||(e[n]=s);return e}function Moment(e){copyConfig(this,e),this._d=new Date(e._d!=null?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),updateInProgress===!1&&(updateInProgress=!0,hooks.updateOffset(this),updateInProgress=!1)}function isMoment(e){return e instanceof Moment||e!=null&&e._isAMomentObject!=null}function warn(e){hooks.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+e)}function deprecate(e,t){var r=!0;return extend$1(function(){if(hooks.deprecationHandler!=null&&hooks.deprecationHandler(null,e),r){var n=[],s,a,i,o=arguments.length;for(a=0;a<o;a++){if(s="",typeof arguments[a]=="object"){s+=`
|
|
[`+a+"] ";for(i in arguments[0])hasOwnProp(arguments[0],i)&&(s+=i+": "+arguments[0][i]+", ");s=s.slice(0,-2)}else s=arguments[a];n.push(s)}warn(e+`
|
|
Arguments: `+Array.prototype.slice.call(n).join("")+`
|
|
`+new Error().stack),r=!1}return t.apply(this,arguments)},t)}var deprecations={};function deprecateSimple(e,t){hooks.deprecationHandler!=null&&hooks.deprecationHandler(e,t),deprecations[e]||(warn(t),deprecations[e]=!0)}hooks.suppressDeprecationWarnings=!1;hooks.deprecationHandler=null;function isFunction$1(e){return typeof Function<"u"&&e instanceof Function||Object.prototype.toString.call(e)==="[object Function]"}function set(e){var t,r;for(r in e)hasOwnProp(e,r)&&(t=e[r],isFunction$1(t)?this[r]=t:this["_"+r]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function mergeConfigs(e,t){var r=extend$1({},e),n;for(n in t)hasOwnProp(t,n)&&(isObject$1(e[n])&&isObject$1(t[n])?(r[n]={},extend$1(r[n],e[n]),extend$1(r[n],t[n])):t[n]!=null?r[n]=t[n]:delete r[n]);for(n in e)hasOwnProp(e,n)&&!hasOwnProp(t,n)&&isObject$1(e[n])&&(r[n]=extend$1({},r[n]));return r}function Locale(e){e!=null&&this.set(e)}var keys;Object.keys?keys=Object.keys:keys=function(e){var t,r=[];for(t in e)hasOwnProp(e,t)&&r.push(t);return r};var defaultCalendar={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function calendar(e,t,r){var n=this._calendar[e]||this._calendar.sameElse;return isFunction$1(n)?n.call(t,r):n}function zeroFill(e,t,r){var n=""+Math.abs(e),s=t-n.length,a=e>=0;return(a?r?"+":"":"-")+Math.pow(10,Math.max(0,s)).toString().substr(1)+n}var formattingTokens=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,localFormattingTokens=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,formatFunctions={},formatTokenFunctions={};function addFormatToken(e,t,r,n){var s=n;typeof n=="string"&&(s=function(){return this[n]()}),e&&(formatTokenFunctions[e]=s),t&&(formatTokenFunctions[t[0]]=function(){return zeroFill(s.apply(this,arguments),t[1],t[2])}),r&&(formatTokenFunctions[r]=function(){return this.localeData().ordinal(s.apply(this,arguments),e)})}function removeFormattingTokens(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function makeFormatFunction(e){var t=e.match(formattingTokens),r,n;for(r=0,n=t.length;r<n;r++)formatTokenFunctions[t[r]]?t[r]=formatTokenFunctions[t[r]]:t[r]=removeFormattingTokens(t[r]);return function(s){var a="",i;for(i=0;i<n;i++)a+=isFunction$1(t[i])?t[i].call(s,e):t[i];return a}}function formatMoment(e,t){return e.isValid()?(t=expandFormat(t,e.localeData()),formatFunctions[t]=formatFunctions[t]||makeFormatFunction(t),formatFunctions[t](e)):e.localeData().invalidDate()}function expandFormat(e,t){var r=5;function n(s){return t.longDateFormat(s)||s}for(localFormattingTokens.lastIndex=0;r>=0&&localFormattingTokens.test(e);)e=e.replace(localFormattingTokens,n),localFormattingTokens.lastIndex=0,r-=1;return e}var defaultLongDateFormat={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function longDateFormat(e){var t=this._longDateFormat[e],r=this._longDateFormat[e.toUpperCase()];return t||!r?t:(this._longDateFormat[e]=r.match(formattingTokens).map(function(n){return n==="MMMM"||n==="MM"||n==="DD"||n==="dddd"?n.slice(1):n}).join(""),this._longDateFormat[e])}var defaultInvalidDate="Invalid date";function invalidDate(){return this._invalidDate}var defaultOrdinal="%d",defaultDayOfMonthOrdinalParse=/\d{1,2}/;function ordinal(e){return this._ordinal.replace("%d",e)}var defaultRelativeTime={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function relativeTime(e,t,r,n){var s=this._relativeTime[r];return isFunction$1(s)?s(e,t,r,n):s.replace(/%d/i,e)}function pastFuture(e,t){var r=this._relativeTime[e>0?"future":"past"];return isFunction$1(r)?r(t):r.replace(/%s/i,t)}var aliases={};function addUnitAlias(e,t){var r=e.toLowerCase();aliases[r]=aliases[r+"s"]=aliases[t]=e}function normalizeUnits(e){return typeof e=="string"?aliases[e]||aliases[e.toLowerCase()]:void 0}function normalizeObjectUnits(e){var t={},r,n;for(n in e)hasOwnProp(e,n)&&(r=normalizeUnits(n),r&&(t[r]=e[n]));return t}var priorities={};function addUnitPriority(e,t){priorities[e]=t}function getPrioritizedUnits(e){var t=[],r;for(r in e)hasOwnProp(e,r)&&t.push({unit:r,priority:priorities[r]});return t.sort(function(n,s){return n.priority-s.priority}),t}function isLeapYear(e){return e%4===0&&e%100!==0||e%400===0}function absFloor(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function toInt(e){var t=+e,r=0;return t!==0&&isFinite(t)&&(r=absFloor(t)),r}function makeGetSet(e,t){return function(r){return r!=null?(set$1(this,e,r),hooks.updateOffset(this,t),this):get(this,e)}}function get(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function set$1(e,t,r){e.isValid()&&!isNaN(r)&&(t==="FullYear"&&isLeapYear(e.year())&&e.month()===1&&e.date()===29?(r=toInt(r),e._d["set"+(e._isUTC?"UTC":"")+t](r,e.month(),daysInMonth(r,e.month()))):e._d["set"+(e._isUTC?"UTC":"")+t](r))}function stringGet(e){return e=normalizeUnits(e),isFunction$1(this[e])?this[e]():this}function stringSet(e,t){if(typeof e=="object"){e=normalizeObjectUnits(e);var r=getPrioritizedUnits(e),n,s=r.length;for(n=0;n<s;n++)this[r[n].unit](e[r[n].unit])}else if(e=normalizeUnits(e),isFunction$1(this[e]))return this[e](t);return this}var match1=/\d/,match2=/\d\d/,match3=/\d{3}/,match4=/\d{4}/,match6=/[+-]?\d{6}/,match1to2=/\d\d?/,match3to4=/\d\d\d\d?/,match5to6=/\d\d\d\d\d\d?/,match1to3=/\d{1,3}/,match1to4=/\d{1,4}/,match1to6=/[+-]?\d{1,6}/,matchUnsigned=/\d+/,matchSigned=/[+-]?\d+/,matchOffset=/Z|[+-]\d\d:?\d\d/gi,matchShortOffset=/Z|[+-]\d\d(?::?\d\d)?/gi,matchTimestamp=/[+-]?\d+(\.\d{1,3})?/,matchWord=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,regexes;regexes={};function addRegexToken(e,t,r){regexes[e]=isFunction$1(t)?t:function(n,s){return n&&r?r:t}}function getParseRegexForToken(e,t){return hasOwnProp(regexes,e)?regexes[e](t._strict,t._locale):new RegExp(unescapeFormat(e))}function unescapeFormat(e){return regexEscape(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,r,n,s,a){return r||n||s||a}))}function regexEscape(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var tokens={};function addParseToken(e,t){var r,n=t,s;for(typeof e=="string"&&(e=[e]),isNumber$1(t)&&(n=function(a,i){i[t]=toInt(a)}),s=e.length,r=0;r<s;r++)tokens[e[r]]=n}function addWeekParseToken(e,t){addParseToken(e,function(r,n,s,a){s._w=s._w||{},t(r,s._w,s,a)})}function addTimeToArrayFromToken(e,t,r){t!=null&&hasOwnProp(tokens,e)&&tokens[e](t,r._a,r,e)}var YEAR=0,MONTH=1,DATE=2,HOUR=3,MINUTE=4,SECOND=5,MILLISECOND=6,WEEK=7,WEEKDAY=8;function mod(e,t){return(e%t+t)%t}var indexOf;Array.prototype.indexOf?indexOf=Array.prototype.indexOf:indexOf=function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1};function daysInMonth(e,t){if(isNaN(e)||isNaN(t))return NaN;var r=mod(t,12);return e+=(t-r)/12,r===1?isLeapYear(e)?29:28:31-r%7%2}addFormatToken("M",["MM",2],"Mo",function(){return this.month()+1});addFormatToken("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)});addFormatToken("MMMM",0,0,function(e){return this.localeData().months(this,e)});addUnitAlias("month","M");addUnitPriority("month",8);addRegexToken("M",match1to2);addRegexToken("MM",match1to2,match2);addRegexToken("MMM",function(e,t){return t.monthsShortRegex(e)});addRegexToken("MMMM",function(e,t){return t.monthsRegex(e)});addParseToken(["M","MM"],function(e,t){t[MONTH]=toInt(e)-1});addParseToken(["MMM","MMMM"],function(e,t,r,n){var s=r._locale.monthsParse(e,n,r._strict);s!=null?t[MONTH]=s:getParsingFlags(r).invalidMonth=e});var defaultLocaleMonths="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),defaultLocaleMonthsShort="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),MONTHS_IN_FORMAT=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,defaultMonthsShortRegex=matchWord,defaultMonthsRegex=matchWord;function localeMonths(e,t){return e?isArray$1(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||MONTHS_IN_FORMAT).test(t)?"format":"standalone"][e.month()]:isArray$1(this._months)?this._months:this._months.standalone}function localeMonthsShort(e,t){return e?isArray$1(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[MONTHS_IN_FORMAT.test(t)?"format":"standalone"][e.month()]:isArray$1(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function handleStrictParse(e,t,r){var n,s,a,i=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],n=0;n<12;++n)a=createUTC([2e3,n]),this._shortMonthsParse[n]=this.monthsShort(a,"").toLocaleLowerCase(),this._longMonthsParse[n]=this.months(a,"").toLocaleLowerCase();return r?t==="MMM"?(s=indexOf.call(this._shortMonthsParse,i),s!==-1?s:null):(s=indexOf.call(this._longMonthsParse,i),s!==-1?s:null):t==="MMM"?(s=indexOf.call(this._shortMonthsParse,i),s!==-1?s:(s=indexOf.call(this._longMonthsParse,i),s!==-1?s:null)):(s=indexOf.call(this._longMonthsParse,i),s!==-1?s:(s=indexOf.call(this._shortMonthsParse,i),s!==-1?s:null))}function localeMonthsParse(e,t,r){var n,s,a;if(this._monthsParseExact)return handleStrictParse.call(this,e,t,r);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;n<12;n++){if(s=createUTC([2e3,n]),r&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=new RegExp("^"+this.months(s,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(s,"").replace(".","")+"$","i")),!r&&!this._monthsParse[n]&&(a="^"+this.months(s,"")+"|^"+this.monthsShort(s,""),this._monthsParse[n]=new RegExp(a.replace(".",""),"i")),r&&t==="MMMM"&&this._longMonthsParse[n].test(e))return n;if(r&&t==="MMM"&&this._shortMonthsParse[n].test(e))return n;if(!r&&this._monthsParse[n].test(e))return n}}function setMonth(e,t){var r;if(!e.isValid())return e;if(typeof t=="string"){if(/^\d+$/.test(t))t=toInt(t);else if(t=e.localeData().monthsParse(t),!isNumber$1(t))return e}return r=Math.min(e.date(),daysInMonth(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,r),e}function getSetMonth(e){return e!=null?(setMonth(this,e),hooks.updateOffset(this,!0),this):get(this,"Month")}function getDaysInMonth(){return daysInMonth(this.year(),this.month())}function monthsShortRegex(e){return this._monthsParseExact?(hasOwnProp(this,"_monthsRegex")||computeMonthsParse.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(hasOwnProp(this,"_monthsShortRegex")||(this._monthsShortRegex=defaultMonthsShortRegex),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function monthsRegex(e){return this._monthsParseExact?(hasOwnProp(this,"_monthsRegex")||computeMonthsParse.call(this),e?this._monthsStrictRegex:this._monthsRegex):(hasOwnProp(this,"_monthsRegex")||(this._monthsRegex=defaultMonthsRegex),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)}function computeMonthsParse(){function e(i,o){return o.length-i.length}var t=[],r=[],n=[],s,a;for(s=0;s<12;s++)a=createUTC([2e3,s]),t.push(this.monthsShort(a,"")),r.push(this.months(a,"")),n.push(this.months(a,"")),n.push(this.monthsShort(a,""));for(t.sort(e),r.sort(e),n.sort(e),s=0;s<12;s++)t[s]=regexEscape(t[s]),r[s]=regexEscape(r[s]);for(s=0;s<24;s++)n[s]=regexEscape(n[s]);this._monthsRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+t.join("|")+")","i")}addFormatToken("Y",0,0,function(){var e=this.year();return e<=9999?zeroFill(e,4):"+"+e});addFormatToken(0,["YY",2],0,function(){return this.year()%100});addFormatToken(0,["YYYY",4],0,"year");addFormatToken(0,["YYYYY",5],0,"year");addFormatToken(0,["YYYYYY",6,!0],0,"year");addUnitAlias("year","y");addUnitPriority("year",1);addRegexToken("Y",matchSigned);addRegexToken("YY",match1to2,match2);addRegexToken("YYYY",match1to4,match4);addRegexToken("YYYYY",match1to6,match6);addRegexToken("YYYYYY",match1to6,match6);addParseToken(["YYYYY","YYYYYY"],YEAR);addParseToken("YYYY",function(e,t){t[YEAR]=e.length===2?hooks.parseTwoDigitYear(e):toInt(e)});addParseToken("YY",function(e,t){t[YEAR]=hooks.parseTwoDigitYear(e)});addParseToken("Y",function(e,t){t[YEAR]=parseInt(e,10)});function daysInYear(e){return isLeapYear(e)?366:365}hooks.parseTwoDigitYear=function(e){return toInt(e)+(toInt(e)>68?1900:2e3)};var getSetYear=makeGetSet("FullYear",!0);function getIsLeapYear(){return isLeapYear(this.year())}function createDate(e,t,r,n,s,a,i){var o;return e<100&&e>=0?(o=new Date(e+400,t,r,n,s,a,i),isFinite(o.getFullYear())&&o.setFullYear(e)):o=new Date(e,t,r,n,s,a,i),o}function createUTCDate(e){var t,r;return e<100&&e>=0?(r=Array.prototype.slice.call(arguments),r[0]=e+400,t=new Date(Date.UTC.apply(null,r)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function firstWeekOffset(e,t,r){var n=7+t-r,s=(7+createUTCDate(e,0,n).getUTCDay()-t)%7;return-s+n-1}function dayOfYearFromWeeks(e,t,r,n,s){var a=(7+r-n)%7,i=firstWeekOffset(e,n,s),o=1+7*(t-1)+a+i,l,u;return o<=0?(l=e-1,u=daysInYear(l)+o):o>daysInYear(e)?(l=e+1,u=o-daysInYear(e)):(l=e,u=o),{year:l,dayOfYear:u}}function weekOfYear(e,t,r){var n=firstWeekOffset(e.year(),t,r),s=Math.floor((e.dayOfYear()-n-1)/7)+1,a,i;return s<1?(i=e.year()-1,a=s+weeksInYear(i,t,r)):s>weeksInYear(e.year(),t,r)?(a=s-weeksInYear(e.year(),t,r),i=e.year()+1):(i=e.year(),a=s),{week:a,year:i}}function weeksInYear(e,t,r){var n=firstWeekOffset(e,t,r),s=firstWeekOffset(e+1,t,r);return(daysInYear(e)-n+s)/7}addFormatToken("w",["ww",2],"wo","week");addFormatToken("W",["WW",2],"Wo","isoWeek");addUnitAlias("week","w");addUnitAlias("isoWeek","W");addUnitPriority("week",5);addUnitPriority("isoWeek",5);addRegexToken("w",match1to2);addRegexToken("ww",match1to2,match2);addRegexToken("W",match1to2);addRegexToken("WW",match1to2,match2);addWeekParseToken(["w","ww","W","WW"],function(e,t,r,n){t[n.substr(0,1)]=toInt(e)});function localeWeek(e){return weekOfYear(e,this._week.dow,this._week.doy).week}var defaultLocaleWeek={dow:0,doy:6};function localeFirstDayOfWeek(){return this._week.dow}function localeFirstDayOfYear(){return this._week.doy}function getSetWeek(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,"d")}function getSetISOWeek(e){var t=weekOfYear(this,1,4).week;return e==null?t:this.add((e-t)*7,"d")}addFormatToken("d",0,"do","day");addFormatToken("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)});addFormatToken("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)});addFormatToken("dddd",0,0,function(e){return this.localeData().weekdays(this,e)});addFormatToken("e",0,0,"weekday");addFormatToken("E",0,0,"isoWeekday");addUnitAlias("day","d");addUnitAlias("weekday","e");addUnitAlias("isoWeekday","E");addUnitPriority("day",11);addUnitPriority("weekday",11);addUnitPriority("isoWeekday",11);addRegexToken("d",match1to2);addRegexToken("e",match1to2);addRegexToken("E",match1to2);addRegexToken("dd",function(e,t){return t.weekdaysMinRegex(e)});addRegexToken("ddd",function(e,t){return t.weekdaysShortRegex(e)});addRegexToken("dddd",function(e,t){return t.weekdaysRegex(e)});addWeekParseToken(["dd","ddd","dddd"],function(e,t,r,n){var s=r._locale.weekdaysParse(e,n,r._strict);s!=null?t.d=s:getParsingFlags(r).invalidWeekday=e});addWeekParseToken(["d","e","E"],function(e,t,r,n){t[n]=toInt(e)});function parseWeekday(e,t){return typeof e!="string"?e:isNaN(e)?(e=t.weekdaysParse(e),typeof e=="number"?e:null):parseInt(e,10)}function parseIsoWeekday(e,t){return typeof e=="string"?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function shiftWeekdays(e,t){return e.slice(t,7).concat(e.slice(0,t))}var defaultLocaleWeekdays="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),defaultLocaleWeekdaysShort="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),defaultLocaleWeekdaysMin="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),defaultWeekdaysRegex=matchWord,defaultWeekdaysShortRegex=matchWord,defaultWeekdaysMinRegex=matchWord;function localeWeekdays(e,t){var r=isArray$1(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return e===!0?shiftWeekdays(r,this._week.dow):e?r[e.day()]:r}function localeWeekdaysShort(e){return e===!0?shiftWeekdays(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function localeWeekdaysMin(e){return e===!0?shiftWeekdays(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function handleStrictParse$1(e,t,r){var n,s,a,i=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)a=createUTC([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(a,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(a,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(a,"").toLocaleLowerCase();return r?t==="dddd"?(s=indexOf.call(this._weekdaysParse,i),s!==-1?s:null):t==="ddd"?(s=indexOf.call(this._shortWeekdaysParse,i),s!==-1?s:null):(s=indexOf.call(this._minWeekdaysParse,i),s!==-1?s:null):t==="dddd"?(s=indexOf.call(this._weekdaysParse,i),s!==-1||(s=indexOf.call(this._shortWeekdaysParse,i),s!==-1)?s:(s=indexOf.call(this._minWeekdaysParse,i),s!==-1?s:null)):t==="ddd"?(s=indexOf.call(this._shortWeekdaysParse,i),s!==-1||(s=indexOf.call(this._weekdaysParse,i),s!==-1)?s:(s=indexOf.call(this._minWeekdaysParse,i),s!==-1?s:null)):(s=indexOf.call(this._minWeekdaysParse,i),s!==-1||(s=indexOf.call(this._weekdaysParse,i),s!==-1)?s:(s=indexOf.call(this._shortWeekdaysParse,i),s!==-1?s:null))}function localeWeekdaysParse(e,t,r){var n,s,a;if(this._weekdaysParseExact)return handleStrictParse$1.call(this,e,t,r);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(s=createUTC([2e3,1]).day(n),r&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(s,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(s,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(s,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(a="^"+this.weekdays(s,"")+"|^"+this.weekdaysShort(s,"")+"|^"+this.weekdaysMin(s,""),this._weekdaysParse[n]=new RegExp(a.replace(".",""),"i")),r&&t==="dddd"&&this._fullWeekdaysParse[n].test(e))return n;if(r&&t==="ddd"&&this._shortWeekdaysParse[n].test(e))return n;if(r&&t==="dd"&&this._minWeekdaysParse[n].test(e))return n;if(!r&&this._weekdaysParse[n].test(e))return n}}function getSetDayOfWeek(e){if(!this.isValid())return e!=null?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return e!=null?(e=parseWeekday(e,this.localeData()),this.add(e-t,"d")):t}function getSetLocaleDayOfWeek(e){if(!this.isValid())return e!=null?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return e==null?t:this.add(e-t,"d")}function getSetISODayOfWeek(e){if(!this.isValid())return e!=null?this:NaN;if(e!=null){var t=parseIsoWeekday(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function weekdaysRegex(e){return this._weekdaysParseExact?(hasOwnProp(this,"_weekdaysRegex")||computeWeekdaysParse.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(hasOwnProp(this,"_weekdaysRegex")||(this._weekdaysRegex=defaultWeekdaysRegex),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function weekdaysShortRegex(e){return this._weekdaysParseExact?(hasOwnProp(this,"_weekdaysRegex")||computeWeekdaysParse.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(hasOwnProp(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=defaultWeekdaysShortRegex),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function weekdaysMinRegex(e){return this._weekdaysParseExact?(hasOwnProp(this,"_weekdaysRegex")||computeWeekdaysParse.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(hasOwnProp(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=defaultWeekdaysMinRegex),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function computeWeekdaysParse(){function e(d,c){return c.length-d.length}var t=[],r=[],n=[],s=[],a,i,o,l,u;for(a=0;a<7;a++)i=createUTC([2e3,1]).day(a),o=regexEscape(this.weekdaysMin(i,"")),l=regexEscape(this.weekdaysShort(i,"")),u=regexEscape(this.weekdays(i,"")),t.push(o),r.push(l),n.push(u),s.push(o),s.push(l),s.push(u);t.sort(e),r.sort(e),n.sort(e),s.sort(e),this._weekdaysRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function hFormat(){return this.hours()%12||12}function kFormat(){return this.hours()||24}addFormatToken("H",["HH",2],0,"hour");addFormatToken("h",["hh",2],0,hFormat);addFormatToken("k",["kk",2],0,kFormat);addFormatToken("hmm",0,0,function(){return""+hFormat.apply(this)+zeroFill(this.minutes(),2)});addFormatToken("hmmss",0,0,function(){return""+hFormat.apply(this)+zeroFill(this.minutes(),2)+zeroFill(this.seconds(),2)});addFormatToken("Hmm",0,0,function(){return""+this.hours()+zeroFill(this.minutes(),2)});addFormatToken("Hmmss",0,0,function(){return""+this.hours()+zeroFill(this.minutes(),2)+zeroFill(this.seconds(),2)});function meridiem(e,t){addFormatToken(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}meridiem("a",!0);meridiem("A",!1);addUnitAlias("hour","h");addUnitPriority("hour",13);function matchMeridiem(e,t){return t._meridiemParse}addRegexToken("a",matchMeridiem);addRegexToken("A",matchMeridiem);addRegexToken("H",match1to2);addRegexToken("h",match1to2);addRegexToken("k",match1to2);addRegexToken("HH",match1to2,match2);addRegexToken("hh",match1to2,match2);addRegexToken("kk",match1to2,match2);addRegexToken("hmm",match3to4);addRegexToken("hmmss",match5to6);addRegexToken("Hmm",match3to4);addRegexToken("Hmmss",match5to6);addParseToken(["H","HH"],HOUR);addParseToken(["k","kk"],function(e,t,r){var n=toInt(e);t[HOUR]=n===24?0:n});addParseToken(["a","A"],function(e,t,r){r._isPm=r._locale.isPM(e),r._meridiem=e});addParseToken(["h","hh"],function(e,t,r){t[HOUR]=toInt(e),getParsingFlags(r).bigHour=!0});addParseToken("hmm",function(e,t,r){var n=e.length-2;t[HOUR]=toInt(e.substr(0,n)),t[MINUTE]=toInt(e.substr(n)),getParsingFlags(r).bigHour=!0});addParseToken("hmmss",function(e,t,r){var n=e.length-4,s=e.length-2;t[HOUR]=toInt(e.substr(0,n)),t[MINUTE]=toInt(e.substr(n,2)),t[SECOND]=toInt(e.substr(s)),getParsingFlags(r).bigHour=!0});addParseToken("Hmm",function(e,t,r){var n=e.length-2;t[HOUR]=toInt(e.substr(0,n)),t[MINUTE]=toInt(e.substr(n))});addParseToken("Hmmss",function(e,t,r){var n=e.length-4,s=e.length-2;t[HOUR]=toInt(e.substr(0,n)),t[MINUTE]=toInt(e.substr(n,2)),t[SECOND]=toInt(e.substr(s))});function localeIsPM(e){return(e+"").toLowerCase().charAt(0)==="p"}var defaultLocaleMeridiemParse=/[ap]\.?m?\.?/i,getSetHour=makeGetSet("Hours",!0);function localeMeridiem(e,t,r){return e>11?r?"pm":"PM":r?"am":"AM"}var baseConfig={calendar:defaultCalendar,longDateFormat:defaultLongDateFormat,invalidDate:defaultInvalidDate,ordinal:defaultOrdinal,dayOfMonthOrdinalParse:defaultDayOfMonthOrdinalParse,relativeTime:defaultRelativeTime,months:defaultLocaleMonths,monthsShort:defaultLocaleMonthsShort,week:defaultLocaleWeek,weekdays:defaultLocaleWeekdays,weekdaysMin:defaultLocaleWeekdaysMin,weekdaysShort:defaultLocaleWeekdaysShort,meridiemParse:defaultLocaleMeridiemParse},locales={},localeFamilies={},globalLocale;function commonPrefix(e,t){var r,n=Math.min(e.length,t.length);for(r=0;r<n;r+=1)if(e[r]!==t[r])return r;return n}function normalizeLocale(e){return e&&e.toLowerCase().replace("_","-")}function chooseLocale(e){for(var t=0,r,n,s,a;t<e.length;){for(a=normalizeLocale(e[t]).split("-"),r=a.length,n=normalizeLocale(e[t+1]),n=n?n.split("-"):null;r>0;){if(s=loadLocale(a.slice(0,r).join("-")),s)return s;if(n&&n.length>=r&&commonPrefix(a,n)>=r-1)break;r--}t++}return globalLocale}function isLocaleNameSane(e){return e.match("^[^/\\\\]*$")!=null}function loadLocale(e){var t=null,r;if(locales[e]===void 0&&typeof module<"u"&&module&&module.exports&&isLocaleNameSane(e))try{t=globalLocale._abbr,r=require,r("./locale/"+e),getSetGlobalLocale(t)}catch{locales[e]=null}return locales[e]}function getSetGlobalLocale(e,t){var r;return e&&(isUndefined$1(t)?r=getLocale(e):r=defineLocale(e,t),r?globalLocale=r:typeof console<"u"&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),globalLocale._abbr}function defineLocale(e,t){if(t!==null){var r,n=baseConfig;if(t.abbr=e,locales[e]!=null)deprecateSimple("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=locales[e]._config;else if(t.parentLocale!=null)if(locales[t.parentLocale]!=null)n=locales[t.parentLocale]._config;else if(r=loadLocale(t.parentLocale),r!=null)n=r._config;else return localeFamilies[t.parentLocale]||(localeFamilies[t.parentLocale]=[]),localeFamilies[t.parentLocale].push({name:e,config:t}),null;return locales[e]=new Locale(mergeConfigs(n,t)),localeFamilies[e]&&localeFamilies[e].forEach(function(s){defineLocale(s.name,s.config)}),getSetGlobalLocale(e),locales[e]}else return delete locales[e],null}function updateLocale(e,t){if(t!=null){var r,n,s=baseConfig;locales[e]!=null&&locales[e].parentLocale!=null?locales[e].set(mergeConfigs(locales[e]._config,t)):(n=loadLocale(e),n!=null&&(s=n._config),t=mergeConfigs(s,t),n==null&&(t.abbr=e),r=new Locale(t),r.parentLocale=locales[e],locales[e]=r),getSetGlobalLocale(e)}else locales[e]!=null&&(locales[e].parentLocale!=null?(locales[e]=locales[e].parentLocale,e===getSetGlobalLocale()&&getSetGlobalLocale(e)):locales[e]!=null&&delete locales[e]);return locales[e]}function getLocale(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return globalLocale;if(!isArray$1(e)){if(t=loadLocale(e),t)return t;e=[e]}return chooseLocale(e)}function listLocales(){return keys(locales)}function checkOverflow(e){var t,r=e._a;return r&&getParsingFlags(e).overflow===-2&&(t=r[MONTH]<0||r[MONTH]>11?MONTH:r[DATE]<1||r[DATE]>daysInMonth(r[YEAR],r[MONTH])?DATE:r[HOUR]<0||r[HOUR]>24||r[HOUR]===24&&(r[MINUTE]!==0||r[SECOND]!==0||r[MILLISECOND]!==0)?HOUR:r[MINUTE]<0||r[MINUTE]>59?MINUTE:r[SECOND]<0||r[SECOND]>59?SECOND:r[MILLISECOND]<0||r[MILLISECOND]>999?MILLISECOND:-1,getParsingFlags(e)._overflowDayOfYear&&(t<YEAR||t>DATE)&&(t=DATE),getParsingFlags(e)._overflowWeeks&&t===-1&&(t=WEEK),getParsingFlags(e)._overflowWeekday&&t===-1&&(t=WEEKDAY),getParsingFlags(e).overflow=t),e}var extendedIsoRegex=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,basicIsoRegex=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,tzRegex=/Z|[+-]\d\d(?::?\d\d)?/,isoDates=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],isoTimes=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],aspNetJsonRegex=/^\/?Date\((-?\d+)/i,rfc2822=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,obsOffsets={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function configFromISO(e){var t,r,n=e._i,s=extendedIsoRegex.exec(n)||basicIsoRegex.exec(n),a,i,o,l,u=isoDates.length,d=isoTimes.length;if(s){for(getParsingFlags(e).iso=!0,t=0,r=u;t<r;t++)if(isoDates[t][1].exec(s[1])){i=isoDates[t][0],a=isoDates[t][2]!==!1;break}if(i==null){e._isValid=!1;return}if(s[3]){for(t=0,r=d;t<r;t++)if(isoTimes[t][1].exec(s[3])){o=(s[2]||" ")+isoTimes[t][0];break}if(o==null){e._isValid=!1;return}}if(!a&&o!=null){e._isValid=!1;return}if(s[4])if(tzRegex.exec(s[4]))l="Z";else{e._isValid=!1;return}e._f=i+(o||"")+(l||""),configFromStringAndFormat(e)}else e._isValid=!1}function extractFromRFC2822Strings(e,t,r,n,s,a){var i=[untruncateYear(e),defaultLocaleMonthsShort.indexOf(t),parseInt(r,10),parseInt(n,10),parseInt(s,10)];return a&&i.push(parseInt(a,10)),i}function untruncateYear(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function preprocessRFC2822(e){return e.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function checkWeekday(e,t,r){if(e){var n=defaultLocaleWeekdaysShort.indexOf(e),s=new Date(t[0],t[1],t[2]).getDay();if(n!==s)return getParsingFlags(r).weekdayMismatch=!0,r._isValid=!1,!1}return!0}function calculateOffset(e,t,r){if(e)return obsOffsets[e];if(t)return 0;var n=parseInt(r,10),s=n%100,a=(n-s)/100;return a*60+s}function configFromRFC2822(e){var t=rfc2822.exec(preprocessRFC2822(e._i)),r;if(t){if(r=extractFromRFC2822Strings(t[4],t[3],t[2],t[5],t[6],t[7]),!checkWeekday(t[1],r,e))return;e._a=r,e._tzm=calculateOffset(t[8],t[9],t[10]),e._d=createUTCDate.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),getParsingFlags(e).rfc2822=!0}else e._isValid=!1}function configFromString(e){var t=aspNetJsonRegex.exec(e._i);if(t!==null){e._d=new Date(+t[1]);return}if(configFromISO(e),e._isValid===!1)delete e._isValid;else return;if(configFromRFC2822(e),e._isValid===!1)delete e._isValid;else return;e._strict?e._isValid=!1:hooks.createFromInputFallback(e)}hooks.createFromInputFallback=deprecate("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))});function defaults$3(e,t,r){return e!=null?e:t!=null?t:r}function currentDateArray(e){var t=new Date(hooks.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function configFromArray(e){var t,r,n=[],s,a,i;if(!e._d){for(s=currentDateArray(e),e._w&&e._a[DATE]==null&&e._a[MONTH]==null&&dayOfYearFromWeekInfo(e),e._dayOfYear!=null&&(i=defaults$3(e._a[YEAR],s[YEAR]),(e._dayOfYear>daysInYear(i)||e._dayOfYear===0)&&(getParsingFlags(e)._overflowDayOfYear=!0),r=createUTCDate(i,0,e._dayOfYear),e._a[MONTH]=r.getUTCMonth(),e._a[DATE]=r.getUTCDate()),t=0;t<3&&e._a[t]==null;++t)e._a[t]=n[t]=s[t];for(;t<7;t++)e._a[t]=n[t]=e._a[t]==null?t===2?1:0:e._a[t];e._a[HOUR]===24&&e._a[MINUTE]===0&&e._a[SECOND]===0&&e._a[MILLISECOND]===0&&(e._nextDay=!0,e._a[HOUR]=0),e._d=(e._useUTC?createUTCDate:createDate).apply(null,n),a=e._useUTC?e._d.getUTCDay():e._d.getDay(),e._tzm!=null&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[HOUR]=24),e._w&&typeof e._w.d<"u"&&e._w.d!==a&&(getParsingFlags(e).weekdayMismatch=!0)}}function dayOfYearFromWeekInfo(e){var t,r,n,s,a,i,o,l,u;t=e._w,t.GG!=null||t.W!=null||t.E!=null?(a=1,i=4,r=defaults$3(t.GG,e._a[YEAR],weekOfYear(createLocal(),1,4).year),n=defaults$3(t.W,1),s=defaults$3(t.E,1),(s<1||s>7)&&(l=!0)):(a=e._locale._week.dow,i=e._locale._week.doy,u=weekOfYear(createLocal(),a,i),r=defaults$3(t.gg,e._a[YEAR],u.year),n=defaults$3(t.w,u.week),t.d!=null?(s=t.d,(s<0||s>6)&&(l=!0)):t.e!=null?(s=t.e+a,(t.e<0||t.e>6)&&(l=!0)):s=a),n<1||n>weeksInYear(r,a,i)?getParsingFlags(e)._overflowWeeks=!0:l!=null?getParsingFlags(e)._overflowWeekday=!0:(o=dayOfYearFromWeeks(r,n,s,a,i),e._a[YEAR]=o.year,e._dayOfYear=o.dayOfYear)}hooks.ISO_8601=function(){};hooks.RFC_2822=function(){};function configFromStringAndFormat(e){if(e._f===hooks.ISO_8601){configFromISO(e);return}if(e._f===hooks.RFC_2822){configFromRFC2822(e);return}e._a=[],getParsingFlags(e).empty=!0;var t=""+e._i,r,n,s,a,i,o=t.length,l=0,u,d;for(s=expandFormat(e._f,e._locale).match(formattingTokens)||[],d=s.length,r=0;r<d;r++)a=s[r],n=(t.match(getParseRegexForToken(a,e))||[])[0],n&&(i=t.substr(0,t.indexOf(n)),i.length>0&&getParsingFlags(e).unusedInput.push(i),t=t.slice(t.indexOf(n)+n.length),l+=n.length),formatTokenFunctions[a]?(n?getParsingFlags(e).empty=!1:getParsingFlags(e).unusedTokens.push(a),addTimeToArrayFromToken(a,n,e)):e._strict&&!n&&getParsingFlags(e).unusedTokens.push(a);getParsingFlags(e).charsLeftOver=o-l,t.length>0&&getParsingFlags(e).unusedInput.push(t),e._a[HOUR]<=12&&getParsingFlags(e).bigHour===!0&&e._a[HOUR]>0&&(getParsingFlags(e).bigHour=void 0),getParsingFlags(e).parsedDateParts=e._a.slice(0),getParsingFlags(e).meridiem=e._meridiem,e._a[HOUR]=meridiemFixWrap(e._locale,e._a[HOUR],e._meridiem),u=getParsingFlags(e).era,u!==null&&(e._a[YEAR]=e._locale.erasConvertYear(u,e._a[YEAR])),configFromArray(e),checkOverflow(e)}function meridiemFixWrap(e,t,r){var n;return r==null?t:e.meridiemHour!=null?e.meridiemHour(t,r):(e.isPM!=null&&(n=e.isPM(r),n&&t<12&&(t+=12),!n&&t===12&&(t=0)),t)}function configFromStringAndArray(e){var t,r,n,s,a,i,o=!1,l=e._f.length;if(l===0){getParsingFlags(e).invalidFormat=!0,e._d=new Date(NaN);return}for(s=0;s<l;s++)a=0,i=!1,t=copyConfig({},e),e._useUTC!=null&&(t._useUTC=e._useUTC),t._f=e._f[s],configFromStringAndFormat(t),isValid(t)&&(i=!0),a+=getParsingFlags(t).charsLeftOver,a+=getParsingFlags(t).unusedTokens.length*10,getParsingFlags(t).score=a,o?a<n&&(n=a,r=t):(n==null||a<n||i)&&(n=a,r=t,i&&(o=!0));extend$1(e,r||t)}function configFromObject(e){if(!e._d){var t=normalizeObjectUnits(e._i),r=t.day===void 0?t.date:t.day;e._a=map([t.year,t.month,r,t.hour,t.minute,t.second,t.millisecond],function(n){return n&&parseInt(n,10)}),configFromArray(e)}}function createFromConfig(e){var t=new Moment(checkOverflow(prepareConfig(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function prepareConfig(e){var t=e._i,r=e._f;return e._locale=e._locale||getLocale(e._l),t===null||r===void 0&&t===""?createInvalid({nullInput:!0}):(typeof t=="string"&&(e._i=t=e._locale.preparse(t)),isMoment(t)?new Moment(checkOverflow(t)):(isDate$1(t)?e._d=t:isArray$1(r)?configFromStringAndArray(e):r?configFromStringAndFormat(e):configFromInput(e),isValid(e)||(e._d=null),e))}function configFromInput(e){var t=e._i;isUndefined$1(t)?e._d=new Date(hooks.now()):isDate$1(t)?e._d=new Date(t.valueOf()):typeof t=="string"?configFromString(e):isArray$1(t)?(e._a=map(t.slice(0),function(r){return parseInt(r,10)}),configFromArray(e)):isObject$1(t)?configFromObject(e):isNumber$1(t)?e._d=new Date(t):hooks.createFromInputFallback(e)}function createLocalOrUTC(e,t,r,n,s){var a={};return(t===!0||t===!1)&&(n=t,t=void 0),(r===!0||r===!1)&&(n=r,r=void 0),(isObject$1(e)&&isObjectEmpty(e)||isArray$1(e)&&e.length===0)&&(e=void 0),a._isAMomentObject=!0,a._useUTC=a._isUTC=s,a._l=r,a._i=e,a._f=t,a._strict=n,createFromConfig(a)}function createLocal(e,t,r,n){return createLocalOrUTC(e,t,r,n,!1)}var prototypeMin=deprecate("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=createLocal.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:createInvalid()}),prototypeMax=deprecate("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=createLocal.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:createInvalid()});function pickBy(e,t){var r,n;if(t.length===1&&isArray$1(t[0])&&(t=t[0]),!t.length)return createLocal();for(r=t[0],n=1;n<t.length;++n)(!t[n].isValid()||t[n][e](r))&&(r=t[n]);return r}function min(){var e=[].slice.call(arguments,0);return pickBy("isBefore",e)}function max(){var e=[].slice.call(arguments,0);return pickBy("isAfter",e)}var now=function(){return Date.now?Date.now():+new Date},ordering=["year","quarter","month","week","day","hour","minute","second","millisecond"];function isDurationValid(e){var t,r=!1,n,s=ordering.length;for(t in e)if(hasOwnProp(e,t)&&!(indexOf.call(ordering,t)!==-1&&(e[t]==null||!isNaN(e[t]))))return!1;for(n=0;n<s;++n)if(e[ordering[n]]){if(r)return!1;parseFloat(e[ordering[n]])!==toInt(e[ordering[n]])&&(r=!0)}return!0}function isValid$1(){return this._isValid}function createInvalid$1(){return createDuration(NaN)}function Duration(e){var t=normalizeObjectUnits(e),r=t.year||0,n=t.quarter||0,s=t.month||0,a=t.week||t.isoWeek||0,i=t.day||0,o=t.hour||0,l=t.minute||0,u=t.second||0,d=t.millisecond||0;this._isValid=isDurationValid(t),this._milliseconds=+d+u*1e3+l*6e4+o*1e3*60*60,this._days=+i+a*7,this._months=+s+n*3+r*12,this._data={},this._locale=getLocale(),this._bubble()}function isDuration(e){return e instanceof Duration}function absRound(e){return e<0?Math.round(-1*e)*-1:Math.round(e)}function compareArrays(e,t,r){var n=Math.min(e.length,t.length),s=Math.abs(e.length-t.length),a=0,i;for(i=0;i<n;i++)(r&&e[i]!==t[i]||!r&&toInt(e[i])!==toInt(t[i]))&&a++;return a+s}function offset(e,t){addFormatToken(e,0,0,function(){var r=this.utcOffset(),n="+";return r<0&&(r=-r,n="-"),n+zeroFill(~~(r/60),2)+t+zeroFill(~~r%60,2)})}offset("Z",":");offset("ZZ","");addRegexToken("Z",matchShortOffset);addRegexToken("ZZ",matchShortOffset);addParseToken(["Z","ZZ"],function(e,t,r){r._useUTC=!0,r._tzm=offsetFromString(matchShortOffset,e)});var chunkOffset=/([\+\-]|\d\d)/gi;function offsetFromString(e,t){var r=(t||"").match(e),n,s,a;return r===null?null:(n=r[r.length-1]||[],s=(n+"").match(chunkOffset)||["-",0,0],a=+(s[1]*60)+toInt(s[2]),a===0?0:s[0]==="+"?a:-a)}function cloneWithOffset(e,t){var r,n;return t._isUTC?(r=t.clone(),n=(isMoment(e)||isDate$1(e)?e.valueOf():createLocal(e).valueOf())-r.valueOf(),r._d.setTime(r._d.valueOf()+n),hooks.updateOffset(r,!1),r):createLocal(e).local()}function getDateOffset(e){return-Math.round(e._d.getTimezoneOffset())}hooks.updateOffset=function(){};function getSetOffset(e,t,r){var n=this._offset||0,s;if(!this.isValid())return e!=null?this:NaN;if(e!=null){if(typeof e=="string"){if(e=offsetFromString(matchShortOffset,e),e===null)return this}else Math.abs(e)<16&&!r&&(e=e*60);return!this._isUTC&&t&&(s=getDateOffset(this)),this._offset=e,this._isUTC=!0,s!=null&&this.add(s,"m"),n!==e&&(!t||this._changeInProgress?addSubtract(this,createDuration(e-n,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,hooks.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?n:getDateOffset(this)}function getSetZone(e,t){return e!=null?(typeof e!="string"&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function setOffsetToUTC(e){return this.utcOffset(0,e)}function setOffsetToLocal(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(getDateOffset(this),"m")),this}function setOffsetToParsedOffset(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var e=offsetFromString(matchOffset,this._i);e!=null?this.utcOffset(e):this.utcOffset(0,!0)}return this}function hasAlignedHourOffset(e){return this.isValid()?(e=e?createLocal(e).utcOffset():0,(this.utcOffset()-e)%60===0):!1}function isDaylightSavingTime(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function isDaylightSavingTimeShifted(){if(!isUndefined$1(this._isDSTShifted))return this._isDSTShifted;var e={},t;return copyConfig(e,this),e=prepareConfig(e),e._a?(t=e._isUTC?createUTC(e._a):createLocal(e._a),this._isDSTShifted=this.isValid()&&compareArrays(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function isLocal(){return this.isValid()?!this._isUTC:!1}function isUtcOffset(){return this.isValid()?this._isUTC:!1}function isUtc(){return this.isValid()?this._isUTC&&this._offset===0:!1}var aspNetRegex=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,isoRegex=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function createDuration(e,t){var r=e,n=null,s,a,i;return isDuration(e)?r={ms:e._milliseconds,d:e._days,M:e._months}:isNumber$1(e)||!isNaN(+e)?(r={},t?r[t]=+e:r.milliseconds=+e):(n=aspNetRegex.exec(e))?(s=n[1]==="-"?-1:1,r={y:0,d:toInt(n[DATE])*s,h:toInt(n[HOUR])*s,m:toInt(n[MINUTE])*s,s:toInt(n[SECOND])*s,ms:toInt(absRound(n[MILLISECOND]*1e3))*s}):(n=isoRegex.exec(e))?(s=n[1]==="-"?-1:1,r={y:parseIso(n[2],s),M:parseIso(n[3],s),w:parseIso(n[4],s),d:parseIso(n[5],s),h:parseIso(n[6],s),m:parseIso(n[7],s),s:parseIso(n[8],s)}):r==null?r={}:typeof r=="object"&&("from"in r||"to"in r)&&(i=momentsDifference(createLocal(r.from),createLocal(r.to)),r={},r.ms=i.milliseconds,r.M=i.months),a=new Duration(r),isDuration(e)&&hasOwnProp(e,"_locale")&&(a._locale=e._locale),isDuration(e)&&hasOwnProp(e,"_isValid")&&(a._isValid=e._isValid),a}createDuration.fn=Duration.prototype;createDuration.invalid=createInvalid$1;function parseIso(e,t){var r=e&&parseFloat(e.replace(",","."));return(isNaN(r)?0:r)*t}function positiveMomentsDifference(e,t){var r={};return r.months=t.month()-e.month()+(t.year()-e.year())*12,e.clone().add(r.months,"M").isAfter(t)&&--r.months,r.milliseconds=+t-+e.clone().add(r.months,"M"),r}function momentsDifference(e,t){var r;return e.isValid()&&t.isValid()?(t=cloneWithOffset(t,e),e.isBefore(t)?r=positiveMomentsDifference(e,t):(r=positiveMomentsDifference(t,e),r.milliseconds=-r.milliseconds,r.months=-r.months),r):{milliseconds:0,months:0}}function createAdder(e,t){return function(r,n){var s,a;return n!==null&&!isNaN(+n)&&(deprecateSimple(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),a=r,r=n,n=a),s=createDuration(r,n),addSubtract(this,s,e),this}}function addSubtract(e,t,r,n){var s=t._milliseconds,a=absRound(t._days),i=absRound(t._months);!e.isValid()||(n=n==null?!0:n,i&&setMonth(e,get(e,"Month")+i*r),a&&set$1(e,"Date",get(e,"Date")+a*r),s&&e._d.setTime(e._d.valueOf()+s*r),n&&hooks.updateOffset(e,a||i))}var add=createAdder(1,"add"),subtract=createAdder(-1,"subtract");function isString$1(e){return typeof e=="string"||e instanceof String}function isMomentInput(e){return isMoment(e)||isDate$1(e)||isString$1(e)||isNumber$1(e)||isNumberOrStringArray(e)||isMomentInputObject(e)||e===null||e===void 0}function isMomentInputObject(e){var t=isObject$1(e)&&!isObjectEmpty(e),r=!1,n=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],s,a,i=n.length;for(s=0;s<i;s+=1)a=n[s],r=r||hasOwnProp(e,a);return t&&r}function isNumberOrStringArray(e){var t=isArray$1(e),r=!1;return t&&(r=e.filter(function(n){return!isNumber$1(n)&&isString$1(e)}).length===0),t&&r}function isCalendarSpec(e){var t=isObject$1(e)&&!isObjectEmpty(e),r=!1,n=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],s,a;for(s=0;s<n.length;s+=1)a=n[s],r=r||hasOwnProp(e,a);return t&&r}function getCalendarFormat(e,t){var r=e.diff(t,"days",!0);return r<-6?"sameElse":r<-1?"lastWeek":r<0?"lastDay":r<1?"sameDay":r<2?"nextDay":r<7?"nextWeek":"sameElse"}function calendar$1(e,t){arguments.length===1&&(arguments[0]?isMomentInput(arguments[0])?(e=arguments[0],t=void 0):isCalendarSpec(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var r=e||createLocal(),n=cloneWithOffset(r,this).startOf("day"),s=hooks.calendarFormat(this,n)||"sameElse",a=t&&(isFunction$1(t[s])?t[s].call(this,r):t[s]);return this.format(a||this.localeData().calendar(s,this,createLocal(r)))}function clone(){return new Moment(this)}function isAfter(e,t){var r=isMoment(e)?e:createLocal(e);return this.isValid()&&r.isValid()?(t=normalizeUnits(t)||"millisecond",t==="millisecond"?this.valueOf()>r.valueOf():r.valueOf()<this.clone().startOf(t).valueOf()):!1}function isBefore(e,t){var r=isMoment(e)?e:createLocal(e);return this.isValid()&&r.isValid()?(t=normalizeUnits(t)||"millisecond",t==="millisecond"?this.valueOf()<r.valueOf():this.clone().endOf(t).valueOf()<r.valueOf()):!1}function isBetween(e,t,r,n){var s=isMoment(e)?e:createLocal(e),a=isMoment(t)?t:createLocal(t);return this.isValid()&&s.isValid()&&a.isValid()?(n=n||"()",(n[0]==="("?this.isAfter(s,r):!this.isBefore(s,r))&&(n[1]===")"?this.isBefore(a,r):!this.isAfter(a,r))):!1}function isSame(e,t){var r=isMoment(e)?e:createLocal(e),n;return this.isValid()&&r.isValid()?(t=normalizeUnits(t)||"millisecond",t==="millisecond"?this.valueOf()===r.valueOf():(n=r.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf())):!1}function isSameOrAfter(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function isSameOrBefore(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function diff(e,t,r){var n,s,a;if(!this.isValid())return NaN;if(n=cloneWithOffset(e,this),!n.isValid())return NaN;switch(s=(n.utcOffset()-this.utcOffset())*6e4,t=normalizeUnits(t),t){case"year":a=monthDiff(this,n)/12;break;case"month":a=monthDiff(this,n);break;case"quarter":a=monthDiff(this,n)/3;break;case"second":a=(this-n)/1e3;break;case"minute":a=(this-n)/6e4;break;case"hour":a=(this-n)/36e5;break;case"day":a=(this-n-s)/864e5;break;case"week":a=(this-n-s)/6048e5;break;default:a=this-n}return r?a:absFloor(a)}function monthDiff(e,t){if(e.date()<t.date())return-monthDiff(t,e);var r=(t.year()-e.year())*12+(t.month()-e.month()),n=e.clone().add(r,"months"),s,a;return t-n<0?(s=e.clone().add(r-1,"months"),a=(t-n)/(n-s)):(s=e.clone().add(r+1,"months"),a=(t-n)/(s-n)),-(r+a)||0}hooks.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";hooks.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function toString$1(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function toISOString(e){if(!this.isValid())return null;var t=e!==!0,r=t?this.clone().utc():this;return r.year()<0||r.year()>9999?formatMoment(r,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):isFunction$1(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",formatMoment(r,"Z")):formatMoment(r,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function inspect(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="",r,n,s,a;return this.isLocal()||(e=this.utcOffset()===0?"moment.utc":"moment.parseZone",t="Z"),r="["+e+'("]',n=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",s="-MM-DD[T]HH:mm:ss.SSS",a=t+'[")]',this.format(r+n+s+a)}function format(e){e||(e=this.isUtc()?hooks.defaultFormatUtc:hooks.defaultFormat);var t=formatMoment(this,e);return this.localeData().postformat(t)}function from(e,t){return this.isValid()&&(isMoment(e)&&e.isValid()||createLocal(e).isValid())?createDuration({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function fromNow(e){return this.from(createLocal(),e)}function to(e,t){return this.isValid()&&(isMoment(e)&&e.isValid()||createLocal(e).isValid())?createDuration({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function toNow(e){return this.to(createLocal(),e)}function locale(e){var t;return e===void 0?this._locale._abbr:(t=getLocale(e),t!=null&&(this._locale=t),this)}var lang=deprecate("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return e===void 0?this.localeData():this.locale(e)});function localeData(){return this._locale}var MS_PER_SECOND=1e3,MS_PER_MINUTE=60*MS_PER_SECOND,MS_PER_HOUR=60*MS_PER_MINUTE,MS_PER_400_YEARS=(365*400+97)*24*MS_PER_HOUR;function mod$1(e,t){return(e%t+t)%t}function localStartOfDate(e,t,r){return e<100&&e>=0?new Date(e+400,t,r)-MS_PER_400_YEARS:new Date(e,t,r).valueOf()}function utcStartOfDate(e,t,r){return e<100&&e>=0?Date.UTC(e+400,t,r)-MS_PER_400_YEARS:Date.UTC(e,t,r)}function startOf(e){var t,r;if(e=normalizeUnits(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(r=this._isUTC?utcStartOfDate:localStartOfDate,e){case"year":t=r(this.year(),0,1);break;case"quarter":t=r(this.year(),this.month()-this.month()%3,1);break;case"month":t=r(this.year(),this.month(),1);break;case"week":t=r(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=r(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=mod$1(t+(this._isUTC?0:this.utcOffset()*MS_PER_MINUTE),MS_PER_HOUR);break;case"minute":t=this._d.valueOf(),t-=mod$1(t,MS_PER_MINUTE);break;case"second":t=this._d.valueOf(),t-=mod$1(t,MS_PER_SECOND);break}return this._d.setTime(t),hooks.updateOffset(this,!0),this}function endOf(e){var t,r;if(e=normalizeUnits(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(r=this._isUTC?utcStartOfDate:localStartOfDate,e){case"year":t=r(this.year()+1,0,1)-1;break;case"quarter":t=r(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=r(this.year(),this.month()+1,1)-1;break;case"week":t=r(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=r(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=MS_PER_HOUR-mod$1(t+(this._isUTC?0:this.utcOffset()*MS_PER_MINUTE),MS_PER_HOUR)-1;break;case"minute":t=this._d.valueOf(),t+=MS_PER_MINUTE-mod$1(t,MS_PER_MINUTE)-1;break;case"second":t=this._d.valueOf(),t+=MS_PER_SECOND-mod$1(t,MS_PER_SECOND)-1;break}return this._d.setTime(t),hooks.updateOffset(this,!0),this}function valueOf(){return this._d.valueOf()-(this._offset||0)*6e4}function unix(){return Math.floor(this.valueOf()/1e3)}function toDate(){return new Date(this.valueOf())}function toArray(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function toObject(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function toJSON(){return this.isValid()?this.toISOString():null}function isValid$2(){return isValid(this)}function parsingFlags(){return extend$1({},getParsingFlags(this))}function invalidAt(){return getParsingFlags(this).overflow}function creationData(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}addFormatToken("N",0,0,"eraAbbr");addFormatToken("NN",0,0,"eraAbbr");addFormatToken("NNN",0,0,"eraAbbr");addFormatToken("NNNN",0,0,"eraName");addFormatToken("NNNNN",0,0,"eraNarrow");addFormatToken("y",["y",1],"yo","eraYear");addFormatToken("y",["yy",2],0,"eraYear");addFormatToken("y",["yyy",3],0,"eraYear");addFormatToken("y",["yyyy",4],0,"eraYear");addRegexToken("N",matchEraAbbr);addRegexToken("NN",matchEraAbbr);addRegexToken("NNN",matchEraAbbr);addRegexToken("NNNN",matchEraName);addRegexToken("NNNNN",matchEraNarrow);addParseToken(["N","NN","NNN","NNNN","NNNNN"],function(e,t,r,n){var s=r._locale.erasParse(e,n,r._strict);s?getParsingFlags(r).era=s:getParsingFlags(r).invalidEra=e});addRegexToken("y",matchUnsigned);addRegexToken("yy",matchUnsigned);addRegexToken("yyy",matchUnsigned);addRegexToken("yyyy",matchUnsigned);addRegexToken("yo",matchEraYearOrdinal);addParseToken(["y","yy","yyy","yyyy"],YEAR);addParseToken(["yo"],function(e,t,r,n){var s;r._locale._eraYearOrdinalRegex&&(s=e.match(r._locale._eraYearOrdinalRegex)),r._locale.eraYearOrdinalParse?t[YEAR]=r._locale.eraYearOrdinalParse(e,s):t[YEAR]=parseInt(e,10)});function localeEras(e,t){var r,n,s,a=this._eras||getLocale("en")._eras;for(r=0,n=a.length;r<n;++r){switch(typeof a[r].since){case"string":s=hooks(a[r].since).startOf("day"),a[r].since=s.valueOf();break}switch(typeof a[r].until){case"undefined":a[r].until=1/0;break;case"string":s=hooks(a[r].until).startOf("day").valueOf(),a[r].until=s.valueOf();break}}return a}function localeErasParse(e,t,r){var n,s,a=this.eras(),i,o,l;for(e=e.toUpperCase(),n=0,s=a.length;n<s;++n)if(i=a[n].name.toUpperCase(),o=a[n].abbr.toUpperCase(),l=a[n].narrow.toUpperCase(),r)switch(t){case"N":case"NN":case"NNN":if(o===e)return a[n];break;case"NNNN":if(i===e)return a[n];break;case"NNNNN":if(l===e)return a[n];break}else if([i,o,l].indexOf(e)>=0)return a[n]}function localeErasConvertYear(e,t){var r=e.since<=e.until?1:-1;return t===void 0?hooks(e.since).year():hooks(e.since).year()+(t-e.offset)*r}function getEraName(){var e,t,r,n=this.localeData().eras();for(e=0,t=n.length;e<t;++e)if(r=this.clone().startOf("day").valueOf(),n[e].since<=r&&r<=n[e].until||n[e].until<=r&&r<=n[e].since)return n[e].name;return""}function getEraNarrow(){var e,t,r,n=this.localeData().eras();for(e=0,t=n.length;e<t;++e)if(r=this.clone().startOf("day").valueOf(),n[e].since<=r&&r<=n[e].until||n[e].until<=r&&r<=n[e].since)return n[e].narrow;return""}function getEraAbbr(){var e,t,r,n=this.localeData().eras();for(e=0,t=n.length;e<t;++e)if(r=this.clone().startOf("day").valueOf(),n[e].since<=r&&r<=n[e].until||n[e].until<=r&&r<=n[e].since)return n[e].abbr;return""}function getEraYear(){var e,t,r,n,s=this.localeData().eras();for(e=0,t=s.length;e<t;++e)if(r=s[e].since<=s[e].until?1:-1,n=this.clone().startOf("day").valueOf(),s[e].since<=n&&n<=s[e].until||s[e].until<=n&&n<=s[e].since)return(this.year()-hooks(s[e].since).year())*r+s[e].offset;return this.year()}function erasNameRegex(e){return hasOwnProp(this,"_erasNameRegex")||computeErasParse.call(this),e?this._erasNameRegex:this._erasRegex}function erasAbbrRegex(e){return hasOwnProp(this,"_erasAbbrRegex")||computeErasParse.call(this),e?this._erasAbbrRegex:this._erasRegex}function erasNarrowRegex(e){return hasOwnProp(this,"_erasNarrowRegex")||computeErasParse.call(this),e?this._erasNarrowRegex:this._erasRegex}function matchEraAbbr(e,t){return t.erasAbbrRegex(e)}function matchEraName(e,t){return t.erasNameRegex(e)}function matchEraNarrow(e,t){return t.erasNarrowRegex(e)}function matchEraYearOrdinal(e,t){return t._eraYearOrdinalRegex||matchUnsigned}function computeErasParse(){var e=[],t=[],r=[],n=[],s,a,i=this.eras();for(s=0,a=i.length;s<a;++s)t.push(regexEscape(i[s].name)),e.push(regexEscape(i[s].abbr)),r.push(regexEscape(i[s].narrow)),n.push(regexEscape(i[s].name)),n.push(regexEscape(i[s].abbr)),n.push(regexEscape(i[s].narrow));this._erasRegex=new RegExp("^("+n.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+t.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+e.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+r.join("|")+")","i")}addFormatToken(0,["gg",2],0,function(){return this.weekYear()%100});addFormatToken(0,["GG",2],0,function(){return this.isoWeekYear()%100});function addWeekYearFormatToken(e,t){addFormatToken(0,[e,e.length],0,t)}addWeekYearFormatToken("gggg","weekYear");addWeekYearFormatToken("ggggg","weekYear");addWeekYearFormatToken("GGGG","isoWeekYear");addWeekYearFormatToken("GGGGG","isoWeekYear");addUnitAlias("weekYear","gg");addUnitAlias("isoWeekYear","GG");addUnitPriority("weekYear",1);addUnitPriority("isoWeekYear",1);addRegexToken("G",matchSigned);addRegexToken("g",matchSigned);addRegexToken("GG",match1to2,match2);addRegexToken("gg",match1to2,match2);addRegexToken("GGGG",match1to4,match4);addRegexToken("gggg",match1to4,match4);addRegexToken("GGGGG",match1to6,match6);addRegexToken("ggggg",match1to6,match6);addWeekParseToken(["gggg","ggggg","GGGG","GGGGG"],function(e,t,r,n){t[n.substr(0,2)]=toInt(e)});addWeekParseToken(["gg","GG"],function(e,t,r,n){t[n]=hooks.parseTwoDigitYear(e)});function getSetWeekYear(e){return getSetWeekYearHelper.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function getSetISOWeekYear(e){return getSetWeekYearHelper.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function getISOWeeksInYear(){return weeksInYear(this.year(),1,4)}function getISOWeeksInISOWeekYear(){return weeksInYear(this.isoWeekYear(),1,4)}function getWeeksInYear(){var e=this.localeData()._week;return weeksInYear(this.year(),e.dow,e.doy)}function getWeeksInWeekYear(){var e=this.localeData()._week;return weeksInYear(this.weekYear(),e.dow,e.doy)}function getSetWeekYearHelper(e,t,r,n,s){var a;return e==null?weekOfYear(this,n,s).year:(a=weeksInYear(e,n,s),t>a&&(t=a),setWeekAll.call(this,e,t,r,n,s))}function setWeekAll(e,t,r,n,s){var a=dayOfYearFromWeeks(e,t,r,n,s),i=createUTCDate(a.year,0,a.dayOfYear);return this.year(i.getUTCFullYear()),this.month(i.getUTCMonth()),this.date(i.getUTCDate()),this}addFormatToken("Q",0,"Qo","quarter");addUnitAlias("quarter","Q");addUnitPriority("quarter",7);addRegexToken("Q",match1);addParseToken("Q",function(e,t){t[MONTH]=(toInt(e)-1)*3});function getSetQuarter(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}addFormatToken("D",["DD",2],"Do","date");addUnitAlias("date","D");addUnitPriority("date",9);addRegexToken("D",match1to2);addRegexToken("DD",match1to2,match2);addRegexToken("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient});addParseToken(["D","DD"],DATE);addParseToken("Do",function(e,t){t[DATE]=toInt(e.match(match1to2)[0])});var getSetDayOfMonth=makeGetSet("Date",!0);addFormatToken("DDD",["DDDD",3],"DDDo","dayOfYear");addUnitAlias("dayOfYear","DDD");addUnitPriority("dayOfYear",4);addRegexToken("DDD",match1to3);addRegexToken("DDDD",match3);addParseToken(["DDD","DDDD"],function(e,t,r){r._dayOfYear=toInt(e)});function getSetDayOfYear(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return e==null?t:this.add(e-t,"d")}addFormatToken("m",["mm",2],0,"minute");addUnitAlias("minute","m");addUnitPriority("minute",14);addRegexToken("m",match1to2);addRegexToken("mm",match1to2,match2);addParseToken(["m","mm"],MINUTE);var getSetMinute=makeGetSet("Minutes",!1);addFormatToken("s",["ss",2],0,"second");addUnitAlias("second","s");addUnitPriority("second",15);addRegexToken("s",match1to2);addRegexToken("ss",match1to2,match2);addParseToken(["s","ss"],SECOND);var getSetSecond=makeGetSet("Seconds",!1);addFormatToken("S",0,0,function(){return~~(this.millisecond()/100)});addFormatToken(0,["SS",2],0,function(){return~~(this.millisecond()/10)});addFormatToken(0,["SSS",3],0,"millisecond");addFormatToken(0,["SSSS",4],0,function(){return this.millisecond()*10});addFormatToken(0,["SSSSS",5],0,function(){return this.millisecond()*100});addFormatToken(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3});addFormatToken(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4});addFormatToken(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5});addFormatToken(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6});addUnitAlias("millisecond","ms");addUnitPriority("millisecond",16);addRegexToken("S",match1to3,match1);addRegexToken("SS",match1to3,match2);addRegexToken("SSS",match1to3,match3);var token,getSetMillisecond;for(token="SSSS";token.length<=9;token+="S")addRegexToken(token,matchUnsigned);function parseMs(e,t){t[MILLISECOND]=toInt(("0."+e)*1e3)}for(token="S";token.length<=9;token+="S")addParseToken(token,parseMs);getSetMillisecond=makeGetSet("Milliseconds",!1);addFormatToken("z",0,0,"zoneAbbr");addFormatToken("zz",0,0,"zoneName");function getZoneAbbr(){return this._isUTC?"UTC":""}function getZoneName(){return this._isUTC?"Coordinated Universal Time":""}var proto=Moment.prototype;proto.add=add;proto.calendar=calendar$1;proto.clone=clone;proto.diff=diff;proto.endOf=endOf;proto.format=format;proto.from=from;proto.fromNow=fromNow;proto.to=to;proto.toNow=toNow;proto.get=stringGet;proto.invalidAt=invalidAt;proto.isAfter=isAfter;proto.isBefore=isBefore;proto.isBetween=isBetween;proto.isSame=isSame;proto.isSameOrAfter=isSameOrAfter;proto.isSameOrBefore=isSameOrBefore;proto.isValid=isValid$2;proto.lang=lang;proto.locale=locale;proto.localeData=localeData;proto.max=prototypeMax;proto.min=prototypeMin;proto.parsingFlags=parsingFlags;proto.set=stringSet;proto.startOf=startOf;proto.subtract=subtract;proto.toArray=toArray;proto.toObject=toObject;proto.toDate=toDate;proto.toISOString=toISOString;proto.inspect=inspect;typeof Symbol<"u"&&Symbol.for!=null&&(proto[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"});proto.toJSON=toJSON;proto.toString=toString$1;proto.unix=unix;proto.valueOf=valueOf;proto.creationData=creationData;proto.eraName=getEraName;proto.eraNarrow=getEraNarrow;proto.eraAbbr=getEraAbbr;proto.eraYear=getEraYear;proto.year=getSetYear;proto.isLeapYear=getIsLeapYear;proto.weekYear=getSetWeekYear;proto.isoWeekYear=getSetISOWeekYear;proto.quarter=proto.quarters=getSetQuarter;proto.month=getSetMonth;proto.daysInMonth=getDaysInMonth;proto.week=proto.weeks=getSetWeek;proto.isoWeek=proto.isoWeeks=getSetISOWeek;proto.weeksInYear=getWeeksInYear;proto.weeksInWeekYear=getWeeksInWeekYear;proto.isoWeeksInYear=getISOWeeksInYear;proto.isoWeeksInISOWeekYear=getISOWeeksInISOWeekYear;proto.date=getSetDayOfMonth;proto.day=proto.days=getSetDayOfWeek;proto.weekday=getSetLocaleDayOfWeek;proto.isoWeekday=getSetISODayOfWeek;proto.dayOfYear=getSetDayOfYear;proto.hour=proto.hours=getSetHour;proto.minute=proto.minutes=getSetMinute;proto.second=proto.seconds=getSetSecond;proto.millisecond=proto.milliseconds=getSetMillisecond;proto.utcOffset=getSetOffset;proto.utc=setOffsetToUTC;proto.local=setOffsetToLocal;proto.parseZone=setOffsetToParsedOffset;proto.hasAlignedHourOffset=hasAlignedHourOffset;proto.isDST=isDaylightSavingTime;proto.isLocal=isLocal;proto.isUtcOffset=isUtcOffset;proto.isUtc=isUtc;proto.isUTC=isUtc;proto.zoneAbbr=getZoneAbbr;proto.zoneName=getZoneName;proto.dates=deprecate("dates accessor is deprecated. Use date instead.",getSetDayOfMonth);proto.months=deprecate("months accessor is deprecated. Use month instead",getSetMonth);proto.years=deprecate("years accessor is deprecated. Use year instead",getSetYear);proto.zone=deprecate("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",getSetZone);proto.isDSTShifted=deprecate("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",isDaylightSavingTimeShifted);function createUnix(e){return createLocal(e*1e3)}function createInZone(){return createLocal.apply(null,arguments).parseZone()}function preParsePostFormat(e){return e}var proto$1=Locale.prototype;proto$1.calendar=calendar;proto$1.longDateFormat=longDateFormat;proto$1.invalidDate=invalidDate;proto$1.ordinal=ordinal;proto$1.preparse=preParsePostFormat;proto$1.postformat=preParsePostFormat;proto$1.relativeTime=relativeTime;proto$1.pastFuture=pastFuture;proto$1.set=set;proto$1.eras=localeEras;proto$1.erasParse=localeErasParse;proto$1.erasConvertYear=localeErasConvertYear;proto$1.erasAbbrRegex=erasAbbrRegex;proto$1.erasNameRegex=erasNameRegex;proto$1.erasNarrowRegex=erasNarrowRegex;proto$1.months=localeMonths;proto$1.monthsShort=localeMonthsShort;proto$1.monthsParse=localeMonthsParse;proto$1.monthsRegex=monthsRegex;proto$1.monthsShortRegex=monthsShortRegex;proto$1.week=localeWeek;proto$1.firstDayOfYear=localeFirstDayOfYear;proto$1.firstDayOfWeek=localeFirstDayOfWeek;proto$1.weekdays=localeWeekdays;proto$1.weekdaysMin=localeWeekdaysMin;proto$1.weekdaysShort=localeWeekdaysShort;proto$1.weekdaysParse=localeWeekdaysParse;proto$1.weekdaysRegex=weekdaysRegex;proto$1.weekdaysShortRegex=weekdaysShortRegex;proto$1.weekdaysMinRegex=weekdaysMinRegex;proto$1.isPM=localeIsPM;proto$1.meridiem=localeMeridiem;function get$1(e,t,r,n){var s=getLocale(),a=createUTC().set(n,t);return s[r](a,e)}function listMonthsImpl(e,t,r){if(isNumber$1(e)&&(t=e,e=void 0),e=e||"",t!=null)return get$1(e,t,r,"month");var n,s=[];for(n=0;n<12;n++)s[n]=get$1(e,n,r,"month");return s}function listWeekdaysImpl(e,t,r,n){typeof e=="boolean"?(isNumber$1(t)&&(r=t,t=void 0),t=t||""):(t=e,r=t,e=!1,isNumber$1(t)&&(r=t,t=void 0),t=t||"");var s=getLocale(),a=e?s._week.dow:0,i,o=[];if(r!=null)return get$1(t,(r+a)%7,n,"day");for(i=0;i<7;i++)o[i]=get$1(t,(i+a)%7,n,"day");return o}function listMonths(e,t){return listMonthsImpl(e,t,"months")}function listMonthsShort(e,t){return listMonthsImpl(e,t,"monthsShort")}function listWeekdays(e,t,r){return listWeekdaysImpl(e,t,r,"weekdays")}function listWeekdaysShort(e,t,r){return listWeekdaysImpl(e,t,r,"weekdaysShort")}function listWeekdaysMin(e,t,r){return listWeekdaysImpl(e,t,r,"weekdaysMin")}getSetGlobalLocale("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,r=toInt(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return e+r}});hooks.lang=deprecate("moment.lang is deprecated. Use moment.locale instead.",getSetGlobalLocale);hooks.langData=deprecate("moment.langData is deprecated. Use moment.localeData instead.",getLocale);var mathAbs=Math.abs;function abs(){var e=this._data;return this._milliseconds=mathAbs(this._milliseconds),this._days=mathAbs(this._days),this._months=mathAbs(this._months),e.milliseconds=mathAbs(e.milliseconds),e.seconds=mathAbs(e.seconds),e.minutes=mathAbs(e.minutes),e.hours=mathAbs(e.hours),e.months=mathAbs(e.months),e.years=mathAbs(e.years),this}function addSubtract$1(e,t,r,n){var s=createDuration(t,r);return e._milliseconds+=n*s._milliseconds,e._days+=n*s._days,e._months+=n*s._months,e._bubble()}function add$1(e,t){return addSubtract$1(this,e,t,1)}function subtract$1(e,t){return addSubtract$1(this,e,t,-1)}function absCeil(e){return e<0?Math.floor(e):Math.ceil(e)}function bubble(){var e=this._milliseconds,t=this._days,r=this._months,n=this._data,s,a,i,o,l;return e>=0&&t>=0&&r>=0||e<=0&&t<=0&&r<=0||(e+=absCeil(monthsToDays(r)+t)*864e5,t=0,r=0),n.milliseconds=e%1e3,s=absFloor(e/1e3),n.seconds=s%60,a=absFloor(s/60),n.minutes=a%60,i=absFloor(a/60),n.hours=i%24,t+=absFloor(i/24),l=absFloor(daysToMonths(t)),r+=l,t-=absCeil(monthsToDays(l)),o=absFloor(r/12),r%=12,n.days=t,n.months=r,n.years=o,this}function daysToMonths(e){return e*4800/146097}function monthsToDays(e){return e*146097/4800}function as(e){if(!this.isValid())return NaN;var t,r,n=this._milliseconds;if(e=normalizeUnits(e),e==="month"||e==="quarter"||e==="year")switch(t=this._days+n/864e5,r=this._months+daysToMonths(t),e){case"month":return r;case"quarter":return r/3;case"year":return r/12}else switch(t=this._days+Math.round(monthsToDays(this._months)),e){case"week":return t/7+n/6048e5;case"day":return t+n/864e5;case"hour":return t*24+n/36e5;case"minute":return t*1440+n/6e4;case"second":return t*86400+n/1e3;case"millisecond":return Math.floor(t*864e5)+n;default:throw new Error("Unknown unit "+e)}}function valueOf$1(){return this.isValid()?this._milliseconds+this._days*864e5+this._months%12*2592e6+toInt(this._months/12)*31536e6:NaN}function makeAs(e){return function(){return this.as(e)}}var asMilliseconds=makeAs("ms"),asSeconds=makeAs("s"),asMinutes=makeAs("m"),asHours=makeAs("h"),asDays=makeAs("d"),asWeeks=makeAs("w"),asMonths=makeAs("M"),asQuarters=makeAs("Q"),asYears=makeAs("y");function clone$1(){return createDuration(this)}function get$2(e){return e=normalizeUnits(e),this.isValid()?this[e+"s"]():NaN}function makeGetter(e){return function(){return this.isValid()?this._data[e]:NaN}}var milliseconds=makeGetter("milliseconds"),seconds=makeGetter("seconds"),minutes=makeGetter("minutes"),hours=makeGetter("hours"),days=makeGetter("days"),months=makeGetter("months"),years=makeGetter("years");function weeks(){return absFloor(this.days()/7)}var round=Math.round,thresholds={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function substituteTimeAgo(e,t,r,n,s){return s.relativeTime(t||1,!!r,e,n)}function relativeTime$1(e,t,r,n){var s=createDuration(e).abs(),a=round(s.as("s")),i=round(s.as("m")),o=round(s.as("h")),l=round(s.as("d")),u=round(s.as("M")),d=round(s.as("w")),c=round(s.as("y")),m=a<=r.ss&&["s",a]||a<r.s&&["ss",a]||i<=1&&["m"]||i<r.m&&["mm",i]||o<=1&&["h"]||o<r.h&&["hh",o]||l<=1&&["d"]||l<r.d&&["dd",l];return r.w!=null&&(m=m||d<=1&&["w"]||d<r.w&&["ww",d]),m=m||u<=1&&["M"]||u<r.M&&["MM",u]||c<=1&&["y"]||["yy",c],m[2]=t,m[3]=+e>0,m[4]=n,substituteTimeAgo.apply(null,m)}function getSetRelativeTimeRounding(e){return e===void 0?round:typeof e=="function"?(round=e,!0):!1}function getSetRelativeTimeThreshold(e,t){return thresholds[e]===void 0?!1:t===void 0?thresholds[e]:(thresholds[e]=t,e==="s"&&(thresholds.ss=t-1),!0)}function humanize(e,t){if(!this.isValid())return this.localeData().invalidDate();var r=!1,n=thresholds,s,a;return typeof e=="object"&&(t=e,e=!1),typeof e=="boolean"&&(r=e),typeof t=="object"&&(n=Object.assign({},thresholds,t),t.s!=null&&t.ss==null&&(n.ss=t.s-1)),s=this.localeData(),a=relativeTime$1(this,!r,n,s),r&&(a=s.pastFuture(+this,a)),s.postformat(a)}var abs$1=Math.abs;function sign(e){return(e>0)-(e<0)||+e}function toISOString$1(){if(!this.isValid())return this.localeData().invalidDate();var e=abs$1(this._milliseconds)/1e3,t=abs$1(this._days),r=abs$1(this._months),n,s,a,i,o=this.asSeconds(),l,u,d,c;return o?(n=absFloor(e/60),s=absFloor(n/60),e%=60,n%=60,a=absFloor(r/12),r%=12,i=e?e.toFixed(3).replace(/\.?0+$/,""):"",l=o<0?"-":"",u=sign(this._months)!==sign(o)?"-":"",d=sign(this._days)!==sign(o)?"-":"",c=sign(this._milliseconds)!==sign(o)?"-":"",l+"P"+(a?u+a+"Y":"")+(r?u+r+"M":"")+(t?d+t+"D":"")+(s||n||e?"T":"")+(s?c+s+"H":"")+(n?c+n+"M":"")+(e?c+i+"S":"")):"P0D"}var proto$2=Duration.prototype;proto$2.isValid=isValid$1;proto$2.abs=abs;proto$2.add=add$1;proto$2.subtract=subtract$1;proto$2.as=as;proto$2.asMilliseconds=asMilliseconds;proto$2.asSeconds=asSeconds;proto$2.asMinutes=asMinutes;proto$2.asHours=asHours;proto$2.asDays=asDays;proto$2.asWeeks=asWeeks;proto$2.asMonths=asMonths;proto$2.asQuarters=asQuarters;proto$2.asYears=asYears;proto$2.valueOf=valueOf$1;proto$2._bubble=bubble;proto$2.clone=clone$1;proto$2.get=get$2;proto$2.milliseconds=milliseconds;proto$2.seconds=seconds;proto$2.minutes=minutes;proto$2.hours=hours;proto$2.days=days;proto$2.weeks=weeks;proto$2.months=months;proto$2.years=years;proto$2.humanize=humanize;proto$2.toISOString=toISOString$1;proto$2.toString=toISOString$1;proto$2.toJSON=toISOString$1;proto$2.locale=locale;proto$2.localeData=localeData;proto$2.toIsoString=deprecate("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",toISOString$1);proto$2.lang=lang;addFormatToken("X",0,0,"unix");addFormatToken("x",0,0,"valueOf");addRegexToken("x",matchSigned);addRegexToken("X",matchTimestamp);addParseToken("X",function(e,t,r){r._d=new Date(parseFloat(e)*1e3)});addParseToken("x",function(e,t,r){r._d=new Date(toInt(e))});//! moment.js
|
|
hooks.version="2.29.3";setHookCallback(createLocal);hooks.fn=proto;hooks.min=min;hooks.max=max;hooks.now=now;hooks.utc=createUTC;hooks.unix=createUnix;hooks.months=listMonths;hooks.isDate=isDate$1;hooks.locale=getSetGlobalLocale;hooks.invalid=createInvalid;hooks.duration=createDuration;hooks.isMoment=isMoment;hooks.weekdays=listWeekdays;hooks.parseZone=createInZone;hooks.localeData=getLocale;hooks.isDuration=isDuration;hooks.monthsShort=listMonthsShort;hooks.weekdaysMin=listWeekdaysMin;hooks.defineLocale=defineLocale;hooks.updateLocale=updateLocale;hooks.locales=listLocales;hooks.weekdaysShort=listWeekdaysShort;hooks.normalizeUnits=normalizeUnits;hooks.relativeTimeRounding=getSetRelativeTimeRounding;hooks.relativeTimeThreshold=getSetRelativeTimeThreshold;hooks.calendarFormat=getCalendarFormat;hooks.prototype=proto;hooks.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};const toLine=(e="")=>e.replace(/\B([A-Z])/g,"-$1").toLowerCase(),filterXSS=e=>e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),getUrlParam=(e,t)=>{const r=t||location.href,n=new RegExp(`[?&#]${e}=([^&#]+)`,"gi"),s=r.match(n);let a;return s&&s.length>0?(a=s[s.length-1].split("="),a&&a.length>1?filterXSS(a[1]):""):""},_sfc_main$8=Vue.defineComponent({name:"magic-ui-component",props:{config:{type:Object,default:()=>({})}},setup(e){var n;const t=(n=Vue.getCurrentInstance())==null?void 0:n.proxy,r=Vue.inject("app");return Vue.provide("hoc",t),{tagName:Vue.computed(()=>`magic-ui-${toLine(e.config.type)}`),style:Vue.computed(()=>r==null?void 0:r.transformStyle(e.config.style)),display:()=>{var a;const s=(a=e.config)==null?void 0:a.display;return typeof s=="function"?s(r):s!==!1}}}}),_export_sfc=(e,t)=>{const r=e.__vccOpts||e;for(const[n,s]of t)r[n]=s;return r};function _sfc_render$7(e,t,r,n,s,a){return e.display()?(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(e.tagName),{key:0,id:e.config.id,class:Vue.normalizeClass(`magic-ui-component${e.config.className?` ${e.config.className}`:""}`),style:Vue.normalizeStyle(e.style),config:e.config},null,8,["id","class","style","config"])):Vue.createCommentVNode("v-if",!0)}const Component=_export_sfc(_sfc_main$8,[["render",_sfc_render$7],["__file","/data/magic/tmagic-editor/packages/ui/src/Component.vue"]]),useApp=e=>{var s,a;const t=Vue.inject("app"),r=(s=t==null?void 0:t.page)==null?void 0:s.getNode(e.config.id),n=(a=Vue.getCurrentInstance())==null?void 0:a.proxy;return r==null||r.emit("created",n),Vue.onMounted(()=>{r==null||r.emit("mounted",n)}),Vue.onUnmounted(()=>{r==null||r.emit("destroy",n)}),t},_sfc_main$7=Vue.defineComponent({name:"magic-ui-page",components:{"magic-ui-component":Component},props:{config:{type:Object,default:()=>({})}},setup(e){const t=useApp(e);return{style:Vue.computed(()=>t==null?void 0:t.transformStyle(e.config.style||{})),refresh(){window.location.reload()}}}}),_hoisted_1$3=["id"];function _sfc_render$6(e,t,r,n,s,a){const i=Vue.resolveComponent("magic-ui-component");return Vue.openBlock(),Vue.createElementBlock("div",{id:`${e.config.id||""}`,class:Vue.normalizeClass(`magic-ui-page magic-ui-container${e.config.className?` ${e.config.className}`:""}`),style:Vue.normalizeStyle(e.style)},[Vue.renderSlot(e.$slots,"default"),(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(e.config.items,o=>(Vue.openBlock(),Vue.createBlock(i,{key:o.id,config:o},null,8,["config"]))),128))],14,_hoisted_1$3)}const page=_export_sfc(_sfc_main$7,[["render",_sfc_render$6],["__file","/data/magic/tmagic-editor/packages/ui/src/page/src/index.vue"]]),useCommonMethod=e=>({show:()=>{e.config.style.display="initial"},hide:()=>{e.config.style.display="none"}}),_sfc_main$6=Vue.defineComponent({name:"magic-ui-container",components:{"magic-ui-component":Component},props:{config:{type:Object,default:()=>({})}},setup(e){const t=useApp(e);return{style:Vue.computed(()=>t==null?void 0:t.transformStyle(e.config.style||{})),display:()=>{var n;const r=(n=e.config)==null?void 0:n.display;return typeof r=="function"?r(t):r!==!1},...useCommonMethod(e)}}}),_hoisted_1$2=["id"];function _sfc_render$5(e,t,r,n,s,a){const i=Vue.resolveComponent("magic-ui-component");return e.display()?(Vue.openBlock(),Vue.createElementBlock("div",{key:0,id:`${e.config.id||""}`,class:Vue.normalizeClass(`magic-ui-container${e.config.className?` ${e.config.className}`:""}`),style:Vue.normalizeStyle(e.style)},[Vue.renderSlot(e.$slots,"default"),(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(e.config.items,o=>(Vue.openBlock(),Vue.createBlock(i,{key:o.id,config:o},null,8,["config"]))),128))],14,_hoisted_1$2)):Vue.createCommentVNode("v-if",!0)}const container=_export_sfc(_sfc_main$6,[["render",_sfc_render$5],["__file","/data/magic/tmagic-editor/packages/ui/src/container/src/Container.vue"]]),_sfc_main$5=Vue.defineComponent({name:"magic-ui-button",props:{config:{type:Object,default:()=>({})},model:{type:Object,default:()=>({})}},setup(e){var o;useApp(e);const t=(o=Vue.getCurrentInstance())==null?void 0:o.proxy,r=Vue.reactive([]),n=Vue.computed(()=>[typeof e.config.preAction=="function"?e.config.preAction:()=>!0,...r,typeof e.config.postAction=="function"?e.config.postAction:()=>!0]);function s(l){r.push(l)}async function a(){for(const l of n.value)if(typeof l=="function"&&await l(t,{model:e.model})===!1)break}const i=Vue.computed(()=>{var l,u,d;return{type:"text",text:((l=e.config)==null?void 0:l.text)||"",disabledText:((u=e.config)==null?void 0:u.disabledText)||"",html:((d=e.config)==null?void 0:d.html)||""}});return{pushAction:s,clickHandler:a,textConfig:i}}});function _sfc_render$4(e,t,r,n,s,a){const i=Vue.resolveComponent("magic-ui-text");return Vue.openBlock(),Vue.createElementBlock("button",{class:"magic-ui-button",onClick:t[0]||(t[0]=(...o)=>e.clickHandler&&e.clickHandler(...o))},[Vue.renderSlot(e.$slots,"default",{},()=>[Vue.createVNode(i,{config:e.textConfig},null,8,["config"])])])}const button=_export_sfc(_sfc_main$5,[["render",_sfc_render$4],["__file","/data/magic/tmagic-editor/packages/ui/src/button/src/index.vue"]]),_sfc_main$4=Vue.defineComponent({name:"magic-ui-text",props:{config:{type:Object,default:()=>({})},model:{type:Object,default:()=>({})},vars:{type:Object,default:()=>({})}},setup(e){var s;useApp(e);const t=(s=Vue.getCurrentInstance())==null?void 0:s.proxy,r=Vue.inject("hoc");return{displayText:Vue.computed(()=>{var o,l;let a=((o=e.config)==null?void 0:o.text)||"";const{vars:i}=e;if((r==null?void 0:r.disabled)&&((l=e.config)==null?void 0:l.disabledText)&&(a=e.config.disabledText),typeof a=="function")return a.bind(t)(t,{model:e.model});if(Object.prototype.toString.call(i)==="[object Object]"){let u=a;return Object.entries(i).forEach(([d,c])=>{u=u.replace(new RegExp(`{{${d}}}`,"g"),c)}),u}return a||""})}},render(){var t,r,n,s;const e=(t=this.config)!=null&&t.multiple?"magic-ui-text":"magic-ui-text magic-ui-text--single-line";return typeof((r=this.$slots)==null?void 0:r.default)=="function"?Vue.h("span",{class:e},[((s=(n=this.$slots)==null?void 0:n.default)==null?void 0:s.call(n))||""]):Vue.h("span",{class:e,...this.displayText?{innerHTML:this.displayText}:{}})}}),text=_export_sfc(_sfc_main$4,[["__file","/data/magic/tmagic-editor/packages/ui/src/text/src/index.vue"]]),_sfc_main$3=Vue.defineComponent({name:"magic-ui-img",props:{config:{type:Object,default:()=>({})},model:{type:Object,default:()=>({})}},setup(e){return useApp(e),{clickHandler(){e.config.url&&(window.location.href=e.config.url)}}}}),_hoisted_1$1=["src"];function _sfc_render$3(e,t,r,n,s,a){return Vue.openBlock(),Vue.createElementBlock("img",{class:"magic-ui-img",src:e.config.src,onClick:t[0]||(t[0]=(...i)=>e.clickHandler&&e.clickHandler(...i))},null,8,_hoisted_1$1)}const img=_export_sfc(_sfc_main$3,[["render",_sfc_render$3],["__file","/data/magic/tmagic-editor/packages/ui/src/img/src/index.vue"]]);var browser={},canPromise$1=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},qrcode$1={},utils$a={};let toSJISFunction;const CODEWORDS_COUNT=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];utils$a.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return t*4+17};utils$a.getSymbolTotalCodewords=function(t){return CODEWORDS_COUNT[t]};utils$a.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t};utils$a.setToSJISFunction=function(t){if(typeof t!="function")throw new Error('"toSJISFunc" is not a valid function.');toSJISFunction=t};utils$a.isKanjiModeEnabled=function(){return typeof toSJISFunction<"u"};utils$a.toSJIS=function(t){return toSJISFunction(t)};var errorCorrectionLevel={};(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+r)}}e.isValid=function(n){return n&&typeof n.bit<"u"&&n.bit>=0&&n.bit<4},e.from=function(n,s){if(e.isValid(n))return n;try{return t(n)}catch{return s}}})(errorCorrectionLevel);function BitBuffer$1(){this.buffer=[],this.length=0}BitBuffer$1.prototype={get:function(e){const t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)===1},put:function(e,t){for(let r=0;r<t;r++)this.putBit((e>>>t-r-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(e){const t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var bitBuffer=BitBuffer$1;function BitMatrix$1(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}BitMatrix$1.prototype.set=function(e,t,r,n){const s=e*this.size+t;this.data[s]=r,n&&(this.reservedBit[s]=!0)};BitMatrix$1.prototype.get=function(e,t){return this.data[e*this.size+t]};BitMatrix$1.prototype.xor=function(e,t,r){this.data[e*this.size+t]^=r};BitMatrix$1.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]};var bitMatrix=BitMatrix$1,alignmentPattern={};(function(e){const t=utils$a.getSymbolSize;e.getRowColCoords=function(n){if(n===1)return[];const s=Math.floor(n/7)+2,a=t(n),i=a===145?26:Math.ceil((a-13)/(2*s-2))*2,o=[a-7];for(let l=1;l<s-1;l++)o[l]=o[l-1]-i;return o.push(6),o.reverse()},e.getPositions=function(n){const s=[],a=e.getRowColCoords(n),i=a.length;for(let o=0;o<i;o++)for(let l=0;l<i;l++)o===0&&l===0||o===0&&l===i-1||o===i-1&&l===0||s.push([a[o],a[l]]);return s}})(alignmentPattern);var finderPattern={};const getSymbolSize=utils$a.getSymbolSize,FINDER_PATTERN_SIZE=7;finderPattern.getPositions=function(t){const r=getSymbolSize(t);return[[0,0],[r-FINDER_PATTERN_SIZE,0],[0,r-FINDER_PATTERN_SIZE]]};var maskPattern={};(function(e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(s){return s!=null&&s!==""&&!isNaN(s)&&s>=0&&s<=7},e.from=function(s){return e.isValid(s)?parseInt(s,10):void 0},e.getPenaltyN1=function(s){const a=s.size;let i=0,o=0,l=0,u=null,d=null;for(let c=0;c<a;c++){o=l=0,u=d=null;for(let m=0;m<a;m++){let h=s.get(c,m);h===u?o++:(o>=5&&(i+=t.N1+(o-5)),u=h,o=1),h=s.get(m,c),h===d?l++:(l>=5&&(i+=t.N1+(l-5)),d=h,l=1)}o>=5&&(i+=t.N1+(o-5)),l>=5&&(i+=t.N1+(l-5))}return i},e.getPenaltyN2=function(s){const a=s.size;let i=0;for(let o=0;o<a-1;o++)for(let l=0;l<a-1;l++){const u=s.get(o,l)+s.get(o,l+1)+s.get(o+1,l)+s.get(o+1,l+1);(u===4||u===0)&&i++}return i*t.N2},e.getPenaltyN3=function(s){const a=s.size;let i=0,o=0,l=0;for(let u=0;u<a;u++){o=l=0;for(let d=0;d<a;d++)o=o<<1&2047|s.get(u,d),d>=10&&(o===1488||o===93)&&i++,l=l<<1&2047|s.get(d,u),d>=10&&(l===1488||l===93)&&i++}return i*t.N3},e.getPenaltyN4=function(s){let a=0;const i=s.data.length;for(let l=0;l<i;l++)a+=s.data[l];return Math.abs(Math.ceil(a*100/i/5)-10)*t.N4};function r(n,s,a){switch(n){case e.Patterns.PATTERN000:return(s+a)%2===0;case e.Patterns.PATTERN001:return s%2===0;case e.Patterns.PATTERN010:return a%3===0;case e.Patterns.PATTERN011:return(s+a)%3===0;case e.Patterns.PATTERN100:return(Math.floor(s/2)+Math.floor(a/3))%2===0;case e.Patterns.PATTERN101:return s*a%2+s*a%3===0;case e.Patterns.PATTERN110:return(s*a%2+s*a%3)%2===0;case e.Patterns.PATTERN111:return(s*a%3+(s+a)%2)%2===0;default:throw new Error("bad maskPattern:"+n)}}e.applyMask=function(s,a){const i=a.size;for(let o=0;o<i;o++)for(let l=0;l<i;l++)a.isReserved(l,o)||a.xor(l,o,r(s,l,o))},e.getBestMask=function(s,a){const i=Object.keys(e.Patterns).length;let o=0,l=1/0;for(let u=0;u<i;u++){a(u),e.applyMask(u,s);const d=e.getPenaltyN1(s)+e.getPenaltyN2(s)+e.getPenaltyN3(s)+e.getPenaltyN4(s);e.applyMask(u,s),d<l&&(l=d,o=u)}return o}})(maskPattern);var errorCorrectionCode={};const ECLevel$1=errorCorrectionLevel,EC_BLOCKS_TABLE=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],EC_CODEWORDS_TABLE=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];errorCorrectionCode.getBlocksCount=function(t,r){switch(r){case ECLevel$1.L:return EC_BLOCKS_TABLE[(t-1)*4+0];case ECLevel$1.M:return EC_BLOCKS_TABLE[(t-1)*4+1];case ECLevel$1.Q:return EC_BLOCKS_TABLE[(t-1)*4+2];case ECLevel$1.H:return EC_BLOCKS_TABLE[(t-1)*4+3];default:return}};errorCorrectionCode.getTotalCodewordsCount=function(t,r){switch(r){case ECLevel$1.L:return EC_CODEWORDS_TABLE[(t-1)*4+0];case ECLevel$1.M:return EC_CODEWORDS_TABLE[(t-1)*4+1];case ECLevel$1.Q:return EC_CODEWORDS_TABLE[(t-1)*4+2];case ECLevel$1.H:return EC_CODEWORDS_TABLE[(t-1)*4+3];default:return}};var polynomial={},galoisField={};const EXP_TABLE=new Uint8Array(512),LOG_TABLE=new Uint8Array(256);(function(){let t=1;for(let r=0;r<255;r++)EXP_TABLE[r]=t,LOG_TABLE[t]=r,t<<=1,t&256&&(t^=285);for(let r=255;r<512;r++)EXP_TABLE[r]=EXP_TABLE[r-255]})();galoisField.log=function(t){if(t<1)throw new Error("log("+t+")");return LOG_TABLE[t]};galoisField.exp=function(t){return EXP_TABLE[t]};galoisField.mul=function(t,r){return t===0||r===0?0:EXP_TABLE[LOG_TABLE[t]+LOG_TABLE[r]]};(function(e){const t=galoisField;e.mul=function(n,s){const a=new Uint8Array(n.length+s.length-1);for(let i=0;i<n.length;i++)for(let o=0;o<s.length;o++)a[i+o]^=t.mul(n[i],s[o]);return a},e.mod=function(n,s){let a=new Uint8Array(n);for(;a.length-s.length>=0;){const i=a[0];for(let l=0;l<s.length;l++)a[l]^=t.mul(s[l],i);let o=0;for(;o<a.length&&a[o]===0;)o++;a=a.slice(o)}return a},e.generateECPolynomial=function(n){let s=new Uint8Array([1]);for(let a=0;a<n;a++)s=e.mul(s,new Uint8Array([1,t.exp(a)]));return s}})(polynomial);const Polynomial=polynomial;function ReedSolomonEncoder$1(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}ReedSolomonEncoder$1.prototype.initialize=function(t){this.degree=t,this.genPoly=Polynomial.generateECPolynomial(this.degree)};ReedSolomonEncoder$1.prototype.encode=function(t){if(!this.genPoly)throw new Error("Encoder not initialized");const r=new Uint8Array(t.length+this.degree);r.set(t);const n=Polynomial.mod(r,this.genPoly),s=this.degree-n.length;if(s>0){const a=new Uint8Array(this.degree);return a.set(n,s),a}return n};var reedSolomonEncoder=ReedSolomonEncoder$1,version={},mode={},versionCheck={};versionCheck.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40};var regex={};const numeric="[0-9]+",alphanumeric="[A-Z $%*+\\-./:]+";let kanji="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";kanji=kanji.replace(/u/g,"\\u");const byte="(?:(?![A-Z0-9 $%*+\\-./:]|"+kanji+`)(?:.|[\r
|
|
]))+`;regex.KANJI=new RegExp(kanji,"g");regex.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");regex.BYTE=new RegExp(byte,"g");regex.NUMERIC=new RegExp(numeric,"g");regex.ALPHANUMERIC=new RegExp(alphanumeric,"g");const TEST_KANJI=new RegExp("^"+kanji+"$"),TEST_NUMERIC=new RegExp("^"+numeric+"$"),TEST_ALPHANUMERIC=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");regex.testKanji=function(t){return TEST_KANJI.test(t)};regex.testNumeric=function(t){return TEST_NUMERIC.test(t)};regex.testAlphanumeric=function(t){return TEST_ALPHANUMERIC.test(t)};(function(e){const t=versionCheck,r=regex;e.NUMERIC={id:"Numeric",bit:1<<0,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:1<<1,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:1<<2,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:1<<3,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(a,i){if(!a.ccBits)throw new Error("Invalid mode: "+a);if(!t.isValid(i))throw new Error("Invalid version: "+i);return i>=1&&i<10?a.ccBits[0]:i<27?a.ccBits[1]:a.ccBits[2]},e.getBestModeForData=function(a){return r.testNumeric(a)?e.NUMERIC:r.testAlphanumeric(a)?e.ALPHANUMERIC:r.testKanji(a)?e.KANJI:e.BYTE},e.toString=function(a){if(a&&a.id)return a.id;throw new Error("Invalid mode")},e.isValid=function(a){return a&&a.bit&&a.ccBits};function n(s){if(typeof s!="string")throw new Error("Param is not a string");switch(s.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+s)}}e.from=function(a,i){if(e.isValid(a))return a;try{return n(a)}catch{return i}}})(mode);(function(e){const t=utils$a,r=errorCorrectionCode,n=errorCorrectionLevel,s=mode,a=versionCheck,i=1<<12|1<<11|1<<10|1<<9|1<<8|1<<5|1<<2|1<<0,o=t.getBCHDigit(i);function l(m,h,y){for(let v=1;v<=40;v++)if(h<=e.getCapacity(v,y,m))return v}function u(m,h){return s.getCharCountIndicator(m,h)+4}function d(m,h){let y=0;return m.forEach(function(v){y+=u(v.mode,h)+v.getBitsLength()}),y}function c(m,h){for(let y=1;y<=40;y++)if(d(m,y)<=e.getCapacity(y,h,s.MIXED))return y}e.from=function(h,y){return a.isValid(h)?parseInt(h,10):y},e.getCapacity=function(h,y,v){if(!a.isValid(h))throw new Error("Invalid QR Code version");typeof v>"u"&&(v=s.BYTE);const T=t.getSymbolTotalCodewords(h),g=r.getTotalCodewordsCount(h,y),k=(T-g)*8;if(v===s.MIXED)return k;const _=k-u(v,h);switch(v){case s.NUMERIC:return Math.floor(_/10*3);case s.ALPHANUMERIC:return Math.floor(_/11*2);case s.KANJI:return Math.floor(_/13);case s.BYTE:default:return Math.floor(_/8)}},e.getBestVersionForData=function(h,y){let v;const T=n.from(y,n.M);if(Array.isArray(h)){if(h.length>1)return c(h,T);if(h.length===0)return 1;v=h[0]}else v=h;return l(v.mode,v.getLength(),T)},e.getEncodedBits=function(h){if(!a.isValid(h)||h<7)throw new Error("Invalid QR Code version");let y=h<<12;for(;t.getBCHDigit(y)-o>=0;)y^=i<<t.getBCHDigit(y)-o;return h<<12|y}})(version);var formatInfo={};const Utils$3=utils$a,G15=1<<10|1<<8|1<<5|1<<4|1<<2|1<<1|1<<0,G15_MASK=1<<14|1<<12|1<<10|1<<4|1<<1,G15_BCH=Utils$3.getBCHDigit(G15);formatInfo.getEncodedBits=function(t,r){const n=t.bit<<3|r;let s=n<<10;for(;Utils$3.getBCHDigit(s)-G15_BCH>=0;)s^=G15<<Utils$3.getBCHDigit(s)-G15_BCH;return(n<<10|s)^G15_MASK};var segments={};const Mode$4=mode;function NumericData(e){this.mode=Mode$4.NUMERIC,this.data=e.toString()}NumericData.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)};NumericData.prototype.getLength=function(){return this.data.length};NumericData.prototype.getBitsLength=function(){return NumericData.getBitsLength(this.data.length)};NumericData.prototype.write=function(t){let r,n,s;for(r=0;r+3<=this.data.length;r+=3)n=this.data.substr(r,3),s=parseInt(n,10),t.put(s,10);const a=this.data.length-r;a>0&&(n=this.data.substr(r),s=parseInt(n,10),t.put(s,a*3+1))};var numericData=NumericData;const Mode$3=mode,ALPHA_NUM_CHARS=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function AlphanumericData(e){this.mode=Mode$3.ALPHANUMERIC,this.data=e}AlphanumericData.getBitsLength=function(t){return 11*Math.floor(t/2)+6*(t%2)};AlphanumericData.prototype.getLength=function(){return this.data.length};AlphanumericData.prototype.getBitsLength=function(){return AlphanumericData.getBitsLength(this.data.length)};AlphanumericData.prototype.write=function(t){let r;for(r=0;r+2<=this.data.length;r+=2){let n=ALPHA_NUM_CHARS.indexOf(this.data[r])*45;n+=ALPHA_NUM_CHARS.indexOf(this.data[r+1]),t.put(n,11)}this.data.length%2&&t.put(ALPHA_NUM_CHARS.indexOf(this.data[r]),6)};var alphanumericData=AlphanumericData,encodeUtf8$1=function(t){for(var r=[],n=t.length,s=0;s<n;s++){var a=t.charCodeAt(s);if(a>=55296&&a<=56319&&n>s+1){var i=t.charCodeAt(s+1);i>=56320&&i<=57343&&(a=(a-55296)*1024+i-56320+65536,s+=1)}if(a<128){r.push(a);continue}if(a<2048){r.push(a>>6|192),r.push(a&63|128);continue}if(a<55296||a>=57344&&a<65536){r.push(a>>12|224),r.push(a>>6&63|128),r.push(a&63|128);continue}if(a>=65536&&a<=1114111){r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(a&63|128);continue}r.push(239,191,189)}return new Uint8Array(r).buffer};const encodeUtf8=encodeUtf8$1,Mode$2=mode;function ByteData(e){this.mode=Mode$2.BYTE,this.data=new Uint8Array(encodeUtf8(e))}ByteData.getBitsLength=function(t){return t*8};ByteData.prototype.getLength=function(){return this.data.length};ByteData.prototype.getBitsLength=function(){return ByteData.getBitsLength(this.data.length)};ByteData.prototype.write=function(e){for(let t=0,r=this.data.length;t<r;t++)e.put(this.data[t],8)};var byteData=ByteData;const Mode$1=mode,Utils$2=utils$a;function KanjiData(e){this.mode=Mode$1.KANJI,this.data=e}KanjiData.getBitsLength=function(t){return t*13};KanjiData.prototype.getLength=function(){return this.data.length};KanjiData.prototype.getBitsLength=function(){return KanjiData.getBitsLength(this.data.length)};KanjiData.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let r=Utils$2.toSJIS(this.data[t]);if(r>=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw new Error("Invalid SJIS character: "+this.data[t]+`
|
|
Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),e.put(r,13)}};var kanjiData=KanjiData,dijkstra={exports:{}};(function(e){var t={single_source_shortest_paths:function(r,n,s){var a={},i={};i[n]=0;var o=t.PriorityQueue.make();o.push(n,0);for(var l,u,d,c,m,h,y,v,T;!o.empty();){l=o.pop(),u=l.value,c=l.cost,m=r[u]||{};for(d in m)m.hasOwnProperty(d)&&(h=m[d],y=c+h,v=i[d],T=typeof i[d]>"u",(T||v>y)&&(i[d]=y,o.push(d,y),a[d]=u))}if(typeof s<"u"&&typeof i[s]>"u"){var g=["Could not find a path from ",n," to ",s,"."].join("");throw new Error(g)}return a},extract_shortest_path_from_predecessor_list:function(r,n){for(var s=[],a=n;a;)s.push(a),r[a],a=r[a];return s.reverse(),s},find_path:function(r,n,s){var a=t.single_source_shortest_paths(r,n,s);return t.extract_shortest_path_from_predecessor_list(a,s)},PriorityQueue:{make:function(r){var n=t.PriorityQueue,s={},a;r=r||{};for(a in n)n.hasOwnProperty(a)&&(s[a]=n[a]);return s.queue=[],s.sorter=r.sorter||n.default_sorter,s},default_sorter:function(r,n){return r.cost-n.cost},push:function(r,n){var s={value:r,cost:n};this.queue.push(s),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=t})(dijkstra);(function(e){const t=mode,r=numericData,n=alphanumericData,s=byteData,a=kanjiData,i=regex,o=utils$a,l=dijkstra.exports;function u(g){return unescape(encodeURIComponent(g)).length}function d(g,k,_){const f=[];let w;for(;(w=g.exec(_))!==null;)f.push({data:w[0],index:w.index,mode:k,length:w[0].length});return f}function c(g){const k=d(i.NUMERIC,t.NUMERIC,g),_=d(i.ALPHANUMERIC,t.ALPHANUMERIC,g);let f,w;return o.isKanjiModeEnabled()?(f=d(i.BYTE,t.BYTE,g),w=d(i.KANJI,t.KANJI,g)):(f=d(i.BYTE_KANJI,t.BYTE,g),w=[]),k.concat(_,f,w).sort(function(M,C){return M.index-C.index}).map(function(M){return{data:M.data,mode:M.mode,length:M.length}})}function m(g,k){switch(k){case t.NUMERIC:return r.getBitsLength(g);case t.ALPHANUMERIC:return n.getBitsLength(g);case t.KANJI:return a.getBitsLength(g);case t.BYTE:return s.getBitsLength(g)}}function h(g){return g.reduce(function(k,_){const f=k.length-1>=0?k[k.length-1]:null;return f&&f.mode===_.mode?(k[k.length-1].data+=_.data,k):(k.push(_),k)},[])}function y(g){const k=[];for(let _=0;_<g.length;_++){const f=g[_];switch(f.mode){case t.NUMERIC:k.push([f,{data:f.data,mode:t.ALPHANUMERIC,length:f.length},{data:f.data,mode:t.BYTE,length:f.length}]);break;case t.ALPHANUMERIC:k.push([f,{data:f.data,mode:t.BYTE,length:f.length}]);break;case t.KANJI:k.push([f,{data:f.data,mode:t.BYTE,length:u(f.data)}]);break;case t.BYTE:k.push([{data:f.data,mode:t.BYTE,length:u(f.data)}])}}return k}function v(g,k){const _={},f={start:{}};let w=["start"];for(let E=0;E<g.length;E++){const M=g[E],C=[];for(let D=0;D<M.length;D++){const O=M[D],b=""+E+D;C.push(b),_[b]={node:O,lastCount:0},f[b]={};for(let P=0;P<w.length;P++){const $=w[P];_[$]&&_[$].node.mode===O.mode?(f[$][b]=m(_[$].lastCount+O.length,O.mode)-m(_[$].lastCount,O.mode),_[$].lastCount+=O.length):(_[$]&&(_[$].lastCount=O.length),f[$][b]=m(O.length,O.mode)+4+t.getCharCountIndicator(O.mode,k))}}w=C}for(let E=0;E<w.length;E++)f[w[E]].end=0;return{map:f,table:_}}function T(g,k){let _;const f=t.getBestModeForData(g);if(_=t.from(k,f),_!==t.BYTE&&_.bit<f.bit)throw new Error('"'+g+'" cannot be encoded with mode '+t.toString(_)+`.
|
|
Suggested mode is: `+t.toString(f));switch(_===t.KANJI&&!o.isKanjiModeEnabled()&&(_=t.BYTE),_){case t.NUMERIC:return new r(g);case t.ALPHANUMERIC:return new n(g);case t.KANJI:return new a(g);case t.BYTE:return new s(g)}}e.fromArray=function(k){return k.reduce(function(_,f){return typeof f=="string"?_.push(T(f,null)):f.data&&_.push(T(f.data,f.mode)),_},[])},e.fromString=function(k,_){const f=c(k,o.isKanjiModeEnabled()),w=y(f),E=v(w,_),M=l.find_path(E.map,"start","end"),C=[];for(let D=1;D<M.length-1;D++)C.push(E.table[M[D]].node);return e.fromArray(h(C))},e.rawSplit=function(k){return e.fromArray(c(k,o.isKanjiModeEnabled()))}})(segments);const Utils$1=utils$a,ECLevel=errorCorrectionLevel,BitBuffer=bitBuffer,BitMatrix=bitMatrix,AlignmentPattern=alignmentPattern,FinderPattern=finderPattern,MaskPattern=maskPattern,ECCode=errorCorrectionCode,ReedSolomonEncoder=reedSolomonEncoder,Version=version,FormatInfo=formatInfo,Mode=mode,Segments=segments;function setupFinderPattern(e,t){const r=e.size,n=FinderPattern.getPositions(t);for(let s=0;s<n.length;s++){const a=n[s][0],i=n[s][1];for(let o=-1;o<=7;o++)if(!(a+o<=-1||r<=a+o))for(let l=-1;l<=7;l++)i+l<=-1||r<=i+l||(o>=0&&o<=6&&(l===0||l===6)||l>=0&&l<=6&&(o===0||o===6)||o>=2&&o<=4&&l>=2&&l<=4?e.set(a+o,i+l,!0,!0):e.set(a+o,i+l,!1,!0))}}function setupTimingPattern(e){const t=e.size;for(let r=8;r<t-8;r++){const n=r%2===0;e.set(r,6,n,!0),e.set(6,r,n,!0)}}function setupAlignmentPattern(e,t){const r=AlignmentPattern.getPositions(t);for(let n=0;n<r.length;n++){const s=r[n][0],a=r[n][1];for(let i=-2;i<=2;i++)for(let o=-2;o<=2;o++)i===-2||i===2||o===-2||o===2||i===0&&o===0?e.set(s+i,a+o,!0,!0):e.set(s+i,a+o,!1,!0)}}function setupVersionInfo(e,t){const r=e.size,n=Version.getEncodedBits(t);let s,a,i;for(let o=0;o<18;o++)s=Math.floor(o/3),a=o%3+r-8-3,i=(n>>o&1)===1,e.set(s,a,i,!0),e.set(a,s,i,!0)}function setupFormatInfo(e,t,r){const n=e.size,s=FormatInfo.getEncodedBits(t,r);let a,i;for(a=0;a<15;a++)i=(s>>a&1)===1,a<6?e.set(a,8,i,!0):a<8?e.set(a+1,8,i,!0):e.set(n-15+a,8,i,!0),a<8?e.set(8,n-a-1,i,!0):a<9?e.set(8,15-a-1+1,i,!0):e.set(8,15-a-1,i,!0);e.set(n-8,8,1,!0)}function setupData(e,t){const r=e.size;let n=-1,s=r-1,a=7,i=0;for(let o=r-1;o>0;o-=2)for(o===6&&o--;;){for(let l=0;l<2;l++)if(!e.isReserved(s,o-l)){let u=!1;i<t.length&&(u=(t[i]>>>a&1)===1),e.set(s,o-l,u),a--,a===-1&&(i++,a=7)}if(s+=n,s<0||r<=s){s-=n,n=-n;break}}}function createData(e,t,r){const n=new BitBuffer;r.forEach(function(l){n.put(l.mode.bit,4),n.put(l.getLength(),Mode.getCharCountIndicator(l.mode,e)),l.write(n)});const s=Utils$1.getSymbolTotalCodewords(e),a=ECCode.getTotalCodewordsCount(e,t),i=(s-a)*8;for(n.getLengthInBits()+4<=i&&n.put(0,4);n.getLengthInBits()%8!==0;)n.putBit(0);const o=(i-n.getLengthInBits())/8;for(let l=0;l<o;l++)n.put(l%2?17:236,8);return createCodewords(n,e,t)}function createCodewords(e,t,r){const n=Utils$1.getSymbolTotalCodewords(t),s=ECCode.getTotalCodewordsCount(t,r),a=n-s,i=ECCode.getBlocksCount(t,r),o=n%i,l=i-o,u=Math.floor(n/i),d=Math.floor(a/i),c=d+1,m=u-d,h=new ReedSolomonEncoder(m);let y=0;const v=new Array(i),T=new Array(i);let g=0;const k=new Uint8Array(e.buffer);for(let M=0;M<i;M++){const C=M<l?d:c;v[M]=k.slice(y,y+C),T[M]=h.encode(v[M]),y+=C,g=Math.max(g,C)}const _=new Uint8Array(n);let f=0,w,E;for(w=0;w<g;w++)for(E=0;E<i;E++)w<v[E].length&&(_[f++]=v[E][w]);for(w=0;w<m;w++)for(E=0;E<i;E++)_[f++]=T[E][w];return _}function createSymbol(e,t,r,n){let s;if(Array.isArray(e))s=Segments.fromArray(e);else if(typeof e=="string"){let u=t;if(!u){const d=Segments.rawSplit(e);u=Version.getBestVersionForData(d,r)}s=Segments.fromString(e,u||40)}else throw new Error("Invalid data");const a=Version.getBestVersionForData(s,r);if(!a)throw new Error("The amount of data is too big to be stored in a QR Code");if(!t)t=a;else if(t<a)throw new Error(`
|
|
The chosen QR Code version cannot contain this amount of data.
|
|
Minimum version required to store current data is: `+a+`.
|
|
`);const i=createData(t,r,s),o=Utils$1.getSymbolSize(t),l=new BitMatrix(o);return setupFinderPattern(l,t),setupTimingPattern(l),setupAlignmentPattern(l,t),setupFormatInfo(l,r,0),t>=7&&setupVersionInfo(l,t),setupData(l,i),isNaN(n)&&(n=MaskPattern.getBestMask(l,setupFormatInfo.bind(null,l,r))),MaskPattern.applyMask(n,l),setupFormatInfo(l,r,n),{modules:l,version:t,errorCorrectionLevel:r,maskPattern:n,segments:s}}qrcode$1.create=function(t,r){if(typeof t>"u"||t==="")throw new Error("No input text");let n=ECLevel.M,s,a;return typeof r<"u"&&(n=ECLevel.from(r.errorCorrectionLevel,ECLevel.M),s=Version.from(r.version),a=MaskPattern.from(r.maskPattern),r.toSJISFunc&&Utils$1.setToSJISFunction(r.toSJISFunc)),createSymbol(t,s,n,a)};var canvas={},utils$9={};(function(e){function t(r){if(typeof r=="number"&&(r=r.toString()),typeof r!="string")throw new Error("Color should be defined as hex string");let n=r.slice().replace("#","").split("");if(n.length<3||n.length===5||n.length>8)throw new Error("Invalid hex color: "+r);(n.length===3||n.length===4)&&(n=Array.prototype.concat.apply([],n.map(function(a){return[a,a]}))),n.length===6&&n.push("F","F");const s=parseInt(n.join(""),16);return{r:s>>24&255,g:s>>16&255,b:s>>8&255,a:s&255,hex:"#"+n.slice(0,6).join("")}}e.getOptions=function(n){n||(n={}),n.color||(n.color={});const s=typeof n.margin>"u"||n.margin===null||n.margin<0?4:n.margin,a=n.width&&n.width>=21?n.width:void 0,i=n.scale||4;return{width:a,scale:a?4:i,margin:s,color:{dark:t(n.color.dark||"#000000ff"),light:t(n.color.light||"#ffffffff")},type:n.type,rendererOpts:n.rendererOpts||{}}},e.getScale=function(n,s){return s.width&&s.width>=n+s.margin*2?s.width/(n+s.margin*2):s.scale},e.getImageWidth=function(n,s){const a=e.getScale(n,s);return Math.floor((n+s.margin*2)*a)},e.qrToImageData=function(n,s,a){const i=s.modules.size,o=s.modules.data,l=e.getScale(i,a),u=Math.floor((i+a.margin*2)*l),d=a.margin*l,c=[a.color.light,a.color.dark];for(let m=0;m<u;m++)for(let h=0;h<u;h++){let y=(m*u+h)*4,v=a.color.light;if(m>=d&&h>=d&&m<u-d&&h<u-d){const T=Math.floor((m-d)/l),g=Math.floor((h-d)/l);v=c[o[T*i+g]?1:0]}n[y++]=v.r,n[y++]=v.g,n[y++]=v.b,n[y]=v.a}}})(utils$9);(function(e){const t=utils$9;function r(s,a,i){s.clearRect(0,0,a.width,a.height),a.style||(a.style={}),a.height=i,a.width=i,a.style.height=i+"px",a.style.width=i+"px"}function n(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}e.render=function(a,i,o){let l=o,u=i;typeof l>"u"&&(!i||!i.getContext)&&(l=i,i=void 0),i||(u=n()),l=t.getOptions(l);const d=t.getImageWidth(a.modules.size,l),c=u.getContext("2d"),m=c.createImageData(d,d);return t.qrToImageData(m.data,a,l),r(c,u,d),c.putImageData(m,0,0),u},e.renderToDataURL=function(a,i,o){let l=o;typeof l>"u"&&(!i||!i.getContext)&&(l=i,i=void 0),l||(l={});const u=e.render(a,i,l),d=l.type||"image/png",c=l.rendererOpts||{};return u.toDataURL(d,c.quality)}})(canvas);var svgTag={};const Utils=utils$9;function getColorAttrib(e,t){const r=e.a/255,n=t+'="'+e.hex+'"';return r<1?n+" "+t+'-opacity="'+r.toFixed(2).slice(1)+'"':n}function svgCmd(e,t,r){let n=e+t;return typeof r<"u"&&(n+=" "+r),n}function qrToPath(e,t,r){let n="",s=0,a=!1,i=0;for(let o=0;o<e.length;o++){const l=Math.floor(o%t),u=Math.floor(o/t);!l&&!a&&(a=!0),e[o]?(i++,o>0&&l>0&&e[o-1]||(n+=a?svgCmd("M",l+r,.5+u+r):svgCmd("m",s,0),s=0,a=!1),l+1<t&&e[o+1]||(n+=svgCmd("h",i),i=0)):s++}return n}svgTag.render=function(t,r,n){const s=Utils.getOptions(r),a=t.modules.size,i=t.modules.data,o=a+s.margin*2,l=s.color.light.a?"<path "+getColorAttrib(s.color.light,"fill")+' d="M0 0h'+o+"v"+o+'H0z"/>':"",u="<path "+getColorAttrib(s.color.dark,"stroke")+' d="'+qrToPath(i,a,s.margin)+'"/>',d='viewBox="0 0 '+o+" "+o+'"',c=s.width?'width="'+s.width+'" height="'+s.width+'" ':"",m='<svg xmlns="http://www.w3.org/2000/svg" '+c+d+' shape-rendering="crispEdges">'+l+u+`</svg>
|
|
`;return typeof n=="function"&&n(null,m),m};const canPromise=canPromise$1,QRCode=qrcode$1,CanvasRenderer=canvas,SvgRenderer=svgTag;function renderCanvas(e,t,r,n,s){const a=[].slice.call(arguments,1),i=a.length,o=typeof a[i-1]=="function";if(!o&&!canPromise())throw new Error("Callback required as last argument");if(o){if(i<2)throw new Error("Too few arguments provided");i===2?(s=r,r=t,t=n=void 0):i===3&&(t.getContext&&typeof s>"u"?(s=n,n=void 0):(s=n,n=r,r=t,t=void 0))}else{if(i<1)throw new Error("Too few arguments provided");return i===1?(r=t,t=n=void 0):i===2&&!t.getContext&&(n=r,r=t,t=void 0),new Promise(function(l,u){try{const d=QRCode.create(r,n);l(e(d,t,n))}catch(d){u(d)}})}try{const l=QRCode.create(r,n);s(null,e(l,t,n))}catch(l){s(l)}}browser.create=QRCode.create;browser.toCanvas=renderCanvas.bind(null,CanvasRenderer.render);browser.toDataURL=renderCanvas.bind(null,CanvasRenderer.renderToDataURL);browser.toString=renderCanvas.bind(null,function(e,t,r){return SvgRenderer.render(e,r)});const _sfc_main$2=Vue.defineComponent({name:"magic-ui-qrcode",props:{config:{type:Object,default:()=>({})},model:{type:Object,default:()=>({})}},setup(e){useApp(e);const t=Vue.ref();return Vue.watch(()=>e.config.url,(r="")=>{browser.toDataURL(r,(n,s)=>{n&&console.error(n),t.value=s})},{immediate:!0}),{imgUrl:t}}}),_hoisted_1=["src"];function _sfc_render$2(e,t,r,n,s,a){return Vue.openBlock(),Vue.createElementBlock("img",{class:"magic-ui-qrcode",src:e.imgUrl},null,8,_hoisted_1)}const qrcode=_export_sfc(_sfc_main$2,[["render",_sfc_render$2],["__file","/data/magic/tmagic-editor/packages/ui/src/qrcode/src/index.vue"]]),_sfc_main$1=Vue.defineComponent({name:"magic-ui-overlay",props:{config:{type:Object,default:()=>({})},model:{type:Object,default:()=>({})}},setup(e){var i;const t=Vue.ref(!1),r=useApp(e),n=(i=r==null?void 0:r.page)==null?void 0:i.getNode(e.config.id),s=()=>{t.value=!0,r&&r.emit("overlay:open",n)},a=()=>{t.value=!1,r&&r.emit("overlay:close",n)};return r==null||r.on("editor:select",(o,l)=>{l.find(u=>u.id===e.config.id)?s():a()}),{visible:t,openOverlay:s,closeOverlay:a}}});function _sfc_render$1(e,t,r,n,s,a){const i=Vue.resolveComponent("magic-ui-container");return e.visible?(Vue.openBlock(),Vue.createBlock(i,{key:0,class:"magic-ui-overlay",config:{items:e.config.items}},{default:Vue.withCtx(()=>[Vue.renderSlot(e.$slots,"default")]),_:3},8,["config"])):Vue.createCommentVNode("v-if",!0)}const overlay=_export_sfc(_sfc_main$1,[["render",_sfc_render$1],["__file","/data/magic/tmagic-editor/packages/ui/src/overlay/src/index.vue"]]),components={page,container,button,text,img,qrcode,overlay},plugins={};var axios$3={exports:{}},axios$2={exports:{}},bind$2=function(t,r){return function(){for(var s=new Array(arguments.length),a=0;a<s.length;a++)s[a]=arguments[a];return t.apply(r,s)}},bind$1=bind$2,toString=Object.prototype.toString;function isArray(e){return Array.isArray(e)}function isUndefined(e){return typeof e>"u"}function isBuffer(e){return e!==null&&!isUndefined(e)&&e.constructor!==null&&!isUndefined(e.constructor)&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function isArrayBuffer(e){return toString.call(e)==="[object ArrayBuffer]"}function isFormData(e){return toString.call(e)==="[object FormData]"}function isArrayBufferView(e){var t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&isArrayBuffer(e.buffer),t}function isString(e){return typeof e=="string"}function isNumber(e){return typeof e=="number"}function isObject(e){return e!==null&&typeof e=="object"}function isPlainObject(e){if(toString.call(e)!=="[object Object]")return!1;var t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function isDate(e){return toString.call(e)==="[object Date]"}function isFile(e){return toString.call(e)==="[object File]"}function isBlob(e){return toString.call(e)==="[object Blob]"}function isFunction(e){return toString.call(e)==="[object Function]"}function isStream(e){return isObject(e)&&isFunction(e.pipe)}function isURLSearchParams(e){return toString.call(e)==="[object URLSearchParams]"}function trim(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function isStandardBrowserEnv(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function forEach(e,t){if(!(e===null||typeof e>"u"))if(typeof e!="object"&&(e=[e]),isArray(e))for(var r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.call(null,e[s],s,e)}function merge(){var e={};function t(s,a){isPlainObject(e[a])&&isPlainObject(s)?e[a]=merge(e[a],s):isPlainObject(s)?e[a]=merge({},s):isArray(s)?e[a]=s.slice():e[a]=s}for(var r=0,n=arguments.length;r<n;r++)forEach(arguments[r],t);return e}function extend(e,t,r){return forEach(t,function(s,a){r&&typeof s=="function"?e[a]=bind$1(s,r):e[a]=s}),e}function stripBOM(e){return e.charCodeAt(0)===65279&&(e=e.slice(1)),e}var utils$8={isArray,isArrayBuffer,isBuffer,isFormData,isArrayBufferView,isString,isNumber,isObject,isPlainObject,isUndefined,isDate,isFile,isBlob,isFunction,isStream,isURLSearchParams,isStandardBrowserEnv,forEach,merge,extend,trim,stripBOM},utils$7=utils$8;function encode(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var buildURL$1=function(t,r,n){if(!r)return t;var s;if(n)s=n(r);else if(utils$7.isURLSearchParams(r))s=r.toString();else{var a=[];utils$7.forEach(r,function(l,u){l===null||typeof l>"u"||(utils$7.isArray(l)?u=u+"[]":l=[l],utils$7.forEach(l,function(c){utils$7.isDate(c)?c=c.toISOString():utils$7.isObject(c)&&(c=JSON.stringify(c)),a.push(encode(u)+"="+encode(c))}))}),s=a.join("&")}if(s){var i=t.indexOf("#");i!==-1&&(t=t.slice(0,i)),t+=(t.indexOf("?")===-1?"?":"&")+s}return t},utils$6=utils$8;function InterceptorManager$1(){this.handlers=[]}InterceptorManager$1.prototype.use=function(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1};InterceptorManager$1.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)};InterceptorManager$1.prototype.forEach=function(t){utils$6.forEach(this.handlers,function(n){n!==null&&t(n)})};var InterceptorManager_1=InterceptorManager$1,utils$5=utils$8,normalizeHeaderName=function(t,r){utils$5.forEach(t,function(s,a){a!==r&&a.toUpperCase()===r.toUpperCase()&&(t[r]=s,delete t[a])})},enhanceError=function(t,r,n,s,a){return t.config=r,n&&(t.code=n),t.request=s,t.response=a,t.isAxiosError=!0,t.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},t},createError,hasRequiredCreateError;function requireCreateError(){if(hasRequiredCreateError)return createError;hasRequiredCreateError=1;var e=enhanceError;return createError=function(r,n,s,a,i){var o=new Error(r);return e(o,n,s,a,i)},createError}var settle,hasRequiredSettle;function requireSettle(){if(hasRequiredSettle)return settle;hasRequiredSettle=1;var e=requireCreateError();return settle=function(r,n,s){var a=s.config.validateStatus;!s.status||!a||a(s.status)?r(s):n(e("Request failed with status code "+s.status,s.config,null,s.request,s))},settle}var cookies,hasRequiredCookies;function requireCookies(){if(hasRequiredCookies)return cookies;hasRequiredCookies=1;var e=utils$8;return cookies=e.isStandardBrowserEnv()?function(){return{write:function(n,s,a,i,o,l){var u=[];u.push(n+"="+encodeURIComponent(s)),e.isNumber(a)&&u.push("expires="+new Date(a).toGMTString()),e.isString(i)&&u.push("path="+i),e.isString(o)&&u.push("domain="+o),l===!0&&u.push("secure"),document.cookie=u.join("; ")},read:function(n){var s=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return s?decodeURIComponent(s[3]):null},remove:function(n){this.write(n,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}(),cookies}var isAbsoluteURL,hasRequiredIsAbsoluteURL;function requireIsAbsoluteURL(){return hasRequiredIsAbsoluteURL||(hasRequiredIsAbsoluteURL=1,isAbsoluteURL=function(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}),isAbsoluteURL}var combineURLs,hasRequiredCombineURLs;function requireCombineURLs(){return hasRequiredCombineURLs||(hasRequiredCombineURLs=1,combineURLs=function(t,r){return r?t.replace(/\/+$/,"")+"/"+r.replace(/^\/+/,""):t}),combineURLs}var buildFullPath,hasRequiredBuildFullPath;function requireBuildFullPath(){if(hasRequiredBuildFullPath)return buildFullPath;hasRequiredBuildFullPath=1;var e=requireIsAbsoluteURL(),t=requireCombineURLs();return buildFullPath=function(n,s){return n&&!e(s)?t(n,s):s},buildFullPath}var parseHeaders,hasRequiredParseHeaders;function requireParseHeaders(){if(hasRequiredParseHeaders)return parseHeaders;hasRequiredParseHeaders=1;var e=utils$8,t=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];return parseHeaders=function(n){var s={},a,i,o;return n&&e.forEach(n.split(`
|
|
`),function(u){if(o=u.indexOf(":"),a=e.trim(u.substr(0,o)).toLowerCase(),i=e.trim(u.substr(o+1)),a){if(s[a]&&t.indexOf(a)>=0)return;a==="set-cookie"?s[a]=(s[a]?s[a]:[]).concat([i]):s[a]=s[a]?s[a]+", "+i:i}}),s},parseHeaders}var isURLSameOrigin,hasRequiredIsURLSameOrigin;function requireIsURLSameOrigin(){if(hasRequiredIsURLSameOrigin)return isURLSameOrigin;hasRequiredIsURLSameOrigin=1;var e=utils$8;return isURLSameOrigin=e.isStandardBrowserEnv()?function(){var r=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a"),s;function a(i){var o=i;return r&&(n.setAttribute("href",o),o=n.href),n.setAttribute("href",o),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return s=a(window.location.href),function(o){var l=e.isString(o)?a(o):o;return l.protocol===s.protocol&&l.host===s.host}}():function(){return function(){return!0}}(),isURLSameOrigin}var Cancel_1,hasRequiredCancel;function requireCancel(){if(hasRequiredCancel)return Cancel_1;hasRequiredCancel=1;function e(t){this.message=t}return e.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},e.prototype.__CANCEL__=!0,Cancel_1=e,Cancel_1}var xhr,hasRequiredXhr;function requireXhr(){if(hasRequiredXhr)return xhr;hasRequiredXhr=1;var e=utils$8,t=requireSettle(),r=requireCookies(),n=buildURL$1,s=requireBuildFullPath(),a=requireParseHeaders(),i=requireIsURLSameOrigin(),o=requireCreateError(),l=requireDefaults(),u=requireCancel();return xhr=function(c){return new Promise(function(h,y){var v=c.data,T=c.headers,g=c.responseType,k;function _(){c.cancelToken&&c.cancelToken.unsubscribe(k),c.signal&&c.signal.removeEventListener("abort",k)}e.isFormData(v)&&delete T["Content-Type"];var f=new XMLHttpRequest;if(c.auth){var w=c.auth.username||"",E=c.auth.password?unescape(encodeURIComponent(c.auth.password)):"";T.Authorization="Basic "+btoa(w+":"+E)}var M=s(c.baseURL,c.url);f.open(c.method.toUpperCase(),n(M,c.params,c.paramsSerializer),!0),f.timeout=c.timeout;function C(){if(!!f){var O="getAllResponseHeaders"in f?a(f.getAllResponseHeaders()):null,b=!g||g==="text"||g==="json"?f.responseText:f.response,P={data:b,status:f.status,statusText:f.statusText,headers:O,config:c,request:f};t(function(L){h(L),_()},function(L){y(L),_()},P),f=null}}if("onloadend"in f?f.onloadend=C:f.onreadystatechange=function(){!f||f.readyState!==4||f.status===0&&!(f.responseURL&&f.responseURL.indexOf("file:")===0)||setTimeout(C)},f.onabort=function(){!f||(y(o("Request aborted",c,"ECONNABORTED",f)),f=null)},f.onerror=function(){y(o("Network Error",c,null,f)),f=null},f.ontimeout=function(){var b=c.timeout?"timeout of "+c.timeout+"ms exceeded":"timeout exceeded",P=c.transitional||l.transitional;c.timeoutErrorMessage&&(b=c.timeoutErrorMessage),y(o(b,c,P.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",f)),f=null},e.isStandardBrowserEnv()){var D=(c.withCredentials||i(M))&&c.xsrfCookieName?r.read(c.xsrfCookieName):void 0;D&&(T[c.xsrfHeaderName]=D)}"setRequestHeader"in f&&e.forEach(T,function(b,P){typeof v>"u"&&P.toLowerCase()==="content-type"?delete T[P]:f.setRequestHeader(P,b)}),e.isUndefined(c.withCredentials)||(f.withCredentials=!!c.withCredentials),g&&g!=="json"&&(f.responseType=c.responseType),typeof c.onDownloadProgress=="function"&&f.addEventListener("progress",c.onDownloadProgress),typeof c.onUploadProgress=="function"&&f.upload&&f.upload.addEventListener("progress",c.onUploadProgress),(c.cancelToken||c.signal)&&(k=function(O){!f||(y(!O||O&&O.type?new u("canceled"):O),f.abort(),f=null)},c.cancelToken&&c.cancelToken.subscribe(k),c.signal&&(c.signal.aborted?k():c.signal.addEventListener("abort",k))),v||(v=null),f.send(v)})},xhr}var defaults_1,hasRequiredDefaults;function requireDefaults(){if(hasRequiredDefaults)return defaults_1;hasRequiredDefaults=1;var e=utils$8,t=normalizeHeaderName,r=enhanceError,n={"Content-Type":"application/x-www-form-urlencoded"};function s(l,u){!e.isUndefined(l)&&e.isUndefined(l["Content-Type"])&&(l["Content-Type"]=u)}function a(){var l;return(typeof XMLHttpRequest<"u"||typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]")&&(l=requireXhr()),l}function i(l,u,d){if(e.isString(l))try{return(u||JSON.parse)(l),e.trim(l)}catch(c){if(c.name!=="SyntaxError")throw c}return(d||JSON.stringify)(l)}var o={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:a(),transformRequest:[function(u,d){return t(d,"Accept"),t(d,"Content-Type"),e.isFormData(u)||e.isArrayBuffer(u)||e.isBuffer(u)||e.isStream(u)||e.isFile(u)||e.isBlob(u)?u:e.isArrayBufferView(u)?u.buffer:e.isURLSearchParams(u)?(s(d,"application/x-www-form-urlencoded;charset=utf-8"),u.toString()):e.isObject(u)||d&&d["Content-Type"]==="application/json"?(s(d,"application/json"),i(u)):u}],transformResponse:[function(u){var d=this.transitional||o.transitional,c=d&&d.silentJSONParsing,m=d&&d.forcedJSONParsing,h=!c&&this.responseType==="json";if(h||m&&e.isString(u)&&u.length)try{return JSON.parse(u)}catch(y){if(h)throw y.name==="SyntaxError"?r(y,this,"E_JSON_PARSE"):y}return u}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(u){return u>=200&&u<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};return e.forEach(["delete","get","head"],function(u){o.headers[u]={}}),e.forEach(["post","put","patch"],function(u){o.headers[u]=e.merge(n)}),defaults_1=o,defaults_1}var utils$4=utils$8,defaults$2=requireDefaults(),transformData$1=function(t,r,n){var s=this||defaults$2;return utils$4.forEach(n,function(i){t=i.call(s,t,r)}),t},isCancel$1,hasRequiredIsCancel;function requireIsCancel(){return hasRequiredIsCancel||(hasRequiredIsCancel=1,isCancel$1=function(t){return!!(t&&t.__CANCEL__)}),isCancel$1}var utils$3=utils$8,transformData=transformData$1,isCancel=requireIsCancel(),defaults$1=requireDefaults(),Cancel=requireCancel();function throwIfCancellationRequested(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Cancel("canceled")}var dispatchRequest$1=function(t){throwIfCancellationRequested(t),t.headers=t.headers||{},t.data=transformData.call(t,t.data,t.headers,t.transformRequest),t.headers=utils$3.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),utils$3.forEach(["delete","get","head","post","put","patch","common"],function(s){delete t.headers[s]});var r=t.adapter||defaults$1.adapter;return r(t).then(function(s){return throwIfCancellationRequested(t),s.data=transformData.call(t,s.data,s.headers,t.transformResponse),s},function(s){return isCancel(s)||(throwIfCancellationRequested(t),s&&s.response&&(s.response.data=transformData.call(t,s.response.data,s.response.headers,t.transformResponse))),Promise.reject(s)})},utils$2=utils$8,mergeConfig$2=function(t,r){r=r||{};var n={};function s(d,c){return utils$2.isPlainObject(d)&&utils$2.isPlainObject(c)?utils$2.merge(d,c):utils$2.isPlainObject(c)?utils$2.merge({},c):utils$2.isArray(c)?c.slice():c}function a(d){if(utils$2.isUndefined(r[d])){if(!utils$2.isUndefined(t[d]))return s(void 0,t[d])}else return s(t[d],r[d])}function i(d){if(!utils$2.isUndefined(r[d]))return s(void 0,r[d])}function o(d){if(utils$2.isUndefined(r[d])){if(!utils$2.isUndefined(t[d]))return s(void 0,t[d])}else return s(void 0,r[d])}function l(d){if(d in r)return s(t[d],r[d]);if(d in t)return s(void 0,t[d])}var u={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:l};return utils$2.forEach(Object.keys(t).concat(Object.keys(r)),function(c){var m=u[c]||a,h=m(c);utils$2.isUndefined(h)&&m!==l||(n[c]=h)}),n},data,hasRequiredData;function requireData(){return hasRequiredData||(hasRequiredData=1,data={version:"0.25.0"}),data}var VERSION=requireData().version,validators$1={};["object","boolean","number","function","string","symbol"].forEach(function(e,t){validators$1[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});var deprecatedWarnings={};validators$1.transitional=function(t,r,n){function s(a,i){return"[Axios v"+VERSION+"] Transitional option '"+a+"'"+i+(n?". "+n:"")}return function(a,i,o){if(t===!1)throw new Error(s(i," has been removed"+(r?" in "+r:"")));return r&&!deprecatedWarnings[i]&&(deprecatedWarnings[i]=!0,console.warn(s(i," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(a,i,o):!0}};function assertOptions(e,t,r){if(typeof e!="object")throw new TypeError("options must be an object");for(var n=Object.keys(e),s=n.length;s-- >0;){var a=n[s],i=t[a];if(i){var o=e[a],l=o===void 0||i(o,a,e);if(l!==!0)throw new TypeError("option "+a+" must be "+l);continue}if(r!==!0)throw Error("Unknown option "+a)}}var validator$1={assertOptions,validators:validators$1},utils$1=utils$8,buildURL=buildURL$1,InterceptorManager=InterceptorManager_1,dispatchRequest=dispatchRequest$1,mergeConfig$1=mergeConfig$2,validator=validator$1,validators=validator.validators;function Axios$1(e){this.defaults=e,this.interceptors={request:new InterceptorManager,response:new InterceptorManager}}Axios$1.prototype.request=function(t,r){if(typeof t=="string"?(r=r||{},r.url=t):r=t||{},!r.url)throw new Error("Provided config url is not valid");r=mergeConfig$1(this.defaults,r),r.method?r.method=r.method.toLowerCase():this.defaults.method?r.method=this.defaults.method.toLowerCase():r.method="get";var n=r.transitional;n!==void 0&&validator.assertOptions(n,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},!1);var s=[],a=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(r)===!1||(a=a&&h.synchronous,s.unshift(h.fulfilled,h.rejected))});var i=[];this.interceptors.response.forEach(function(h){i.push(h.fulfilled,h.rejected)});var o;if(!a){var l=[dispatchRequest,void 0];for(Array.prototype.unshift.apply(l,s),l=l.concat(i),o=Promise.resolve(r);l.length;)o=o.then(l.shift(),l.shift());return o}for(var u=r;s.length;){var d=s.shift(),c=s.shift();try{u=d(u)}catch(m){c(m);break}}try{o=dispatchRequest(u)}catch(m){return Promise.reject(m)}for(;i.length;)o=o.then(i.shift(),i.shift());return o};Axios$1.prototype.getUri=function(t){if(!t.url)throw new Error("Provided config url is not valid");return t=mergeConfig$1(this.defaults,t),buildURL(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")};utils$1.forEach(["delete","get","head","options"],function(t){Axios$1.prototype[t]=function(r,n){return this.request(mergeConfig$1(n||{},{method:t,url:r,data:(n||{}).data}))}});utils$1.forEach(["post","put","patch"],function(t){Axios$1.prototype[t]=function(r,n,s){return this.request(mergeConfig$1(s||{},{method:t,url:r,data:n}))}});var Axios_1=Axios$1,CancelToken_1,hasRequiredCancelToken;function requireCancelToken(){if(hasRequiredCancelToken)return CancelToken_1;hasRequiredCancelToken=1;var e=requireCancel();function t(r){if(typeof r!="function")throw new TypeError("executor must be a function.");var n;this.promise=new Promise(function(i){n=i});var s=this;this.promise.then(function(a){if(!!s._listeners){var i,o=s._listeners.length;for(i=0;i<o;i++)s._listeners[i](a);s._listeners=null}}),this.promise.then=function(a){var i,o=new Promise(function(l){s.subscribe(l),i=l}).then(a);return o.cancel=function(){s.unsubscribe(i)},o},r(function(i){s.reason||(s.reason=new e(i),n(s.reason))})}return t.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},t.prototype.subscribe=function(n){if(this.reason){n(this.reason);return}this._listeners?this._listeners.push(n):this._listeners=[n]},t.prototype.unsubscribe=function(n){if(!!this._listeners){var s=this._listeners.indexOf(n);s!==-1&&this._listeners.splice(s,1)}},t.source=function(){var n,s=new t(function(i){n=i});return{token:s,cancel:n}},CancelToken_1=t,CancelToken_1}var spread,hasRequiredSpread;function requireSpread(){return hasRequiredSpread||(hasRequiredSpread=1,spread=function(t){return function(n){return t.apply(null,n)}}),spread}var isAxiosError,hasRequiredIsAxiosError;function requireIsAxiosError(){if(hasRequiredIsAxiosError)return isAxiosError;hasRequiredIsAxiosError=1;var e=utils$8;return isAxiosError=function(r){return e.isObject(r)&&r.isAxiosError===!0},isAxiosError}var utils=utils$8,bind=bind$2,Axios=Axios_1,mergeConfig=mergeConfig$2,defaults=requireDefaults();function createInstance(e){var t=new Axios(e),r=bind(Axios.prototype.request,t);return utils.extend(r,Axios.prototype,t),utils.extend(r,t),r.create=function(s){return createInstance(mergeConfig(e,s))},r}var axios$1=createInstance(defaults);axios$1.Axios=Axios;axios$1.Cancel=requireCancel();axios$1.CancelToken=requireCancelToken();axios$1.isCancel=requireIsCancel();axios$1.VERSION=requireData().version;axios$1.all=function(t){return Promise.all(t)};axios$1.spread=requireSpread();axios$1.isAxiosError=requireIsAxiosError();axios$2.exports=axios$1;axios$2.exports.default=axios$1;(function(e){e.exports=axios$2.exports})(axios$3);const axios=getDefaultExportFromCjs(axios$3.exports),service=axios.create({withCredentials:!0,timeout:7e3}),requestHandler=function(e){return e},responseHandler=function(e){return e};service.interceptors.request.use(requestHandler);service.interceptors.response.use(responseHandler);const request={install(e){e.provide("request",service)}},_sfc_main=Vue.defineComponent({name:"App",setup(){var r;const e=Vue.inject("app");return{pageConfig:Vue.reactive(((r=e==null?void 0:e.page)==null?void 0:r.data)||{})}}});function _sfc_render(e,t,r,n,s,a){const i=Vue.resolveComponent("magic-ui-page");return Vue.openBlock(),Vue.createBlock(i,{config:e.pageConfig},null,8,["config"])}const AppComponent=_export_sfc(_sfc_main,[["render",_sfc_render],["__file","/data/magic/tmagic-editor/runtime/vue3/page/App.vue"]]),getLocalConfig=()=>{const configStr=localStorage.getItem("magicDSL");if(!configStr)return[];try{return[eval(`(${configStr})`)]}catch(e){return[]}},magicApp=Vue.createApp(AppComponent);magicApp.use(request);Object.values(components).forEach(e=>{magicApp.component(e.name,e)});Object.values(plugins).forEach(e=>{magicApp.use(e)});const app=new App({config:((getUrlParam("localPreview")?getLocalConfig():window.magicDSL)||[])[0]||{},curPage:getUrlParam("page")});magicApp.config.globalProperties.app=app;magicApp.provide("app",app);magicApp.mount("#app");export{__vite_legacy_guard};
|
|
//# sourceMappingURL=index.b9c60957.js.map
|