zhihao-ui 1.3.9 → 1.3.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/dist/es/{BaseInfo-DFEg4oWo.js → BaseInfo-Bhin5Xqy.js} +1 -1
  2. package/dist/es/{BaseItem-BvdMV2Gu.js → BaseItem-BoLcxB-U.js} +3 -3
  3. package/dist/es/{Button-NgQ5sHIG.js → Button-DdMNoo0g.js} +2 -2
  4. package/dist/es/{DatePicker-B2pu6NJQ.js → DatePicker-sUXbd9V4.js} +3 -3
  5. package/dist/es/{DetailHeader-DDDbFDig.js → DetailHeader--0WANmGX.js} +3 -3
  6. package/dist/es/{DetailSubTitle-IqUKEU6D.js → DetailSubTitle-BUqZQxrl.js} +2 -2
  7. package/dist/es/{Dialog-DzTqitsD.js → Dialog-BKHohBv4.js} +3 -3
  8. package/dist/es/{DiyDataTable-DlgBshaZ.js → DiyDataTable-GuaKFrG5.js} +4 -4
  9. package/dist/es/{EditInfoPair-DQQoCmp8.js → EditInfoPair-CajUIoGj.js} +3 -3
  10. package/dist/es/{FileWrapper-pzSCoy4C.js → FileWrapper-CvYOVYx4.js} +4 -4
  11. package/dist/es/{Grid-D3sfvKjP.js → Grid-eLpow9Qb.js} +2 -2
  12. package/dist/es/{InfoPair-O3-tZH-B.js → InfoPair-BoTzSjD8.js} +3 -3
  13. package/dist/es/{Input-m8a-UuQp.js → Input-BKzWwcsD.js} +3 -3
  14. package/dist/es/{Loading-5WuhZO5j.js → Loading-3Cz4Wb5p.js} +2 -2
  15. package/dist/es/{Map-CCtm5zBi.js → Map-Dw2qcOkb.js} +224 -222
  16. package/dist/es/{MessageBox-3q9YfNRL.js → MessageBox--A4VqZyI.js} +2 -2
  17. package/dist/es/{MoneyInput-DddMW7cV.js → MoneyInput-DeYknAkX.js} +5 -5
  18. package/dist/es/{PageHeadPanel-BLvPIfGZ.js → PageHeadPanel-8pDHbfnc.js} +2 -2
  19. package/dist/es/{Table-iJRuASc3.js → Table-DcnAnAAU.js} +5 -5
  20. package/dist/es/{ToolTips-Cv8eNWyC.js → ToolTips-xwoX6Ww8.js} +3 -3
  21. package/dist/es/index.js +22 -22
  22. package/dist/es/{utils-DSw1USoH.js → utils-pSjFFegY.js} +1 -1
  23. package/dist/es/{vendor-Cc_TVxUO.js → vendor-CINc7P9P.js} +8 -8
  24. package/dist/index.css +1 -1
  25. package/dist/types/components/Map/Map.vue.d.ts +1 -1
  26. package/dist/types/components/Map/function/shipTrack.d.ts +7 -4
  27. package/dist/types/components/Map/index.d.ts +3 -3
  28. package/dist/umd/index.css +1 -1
  29. package/dist/umd/index.umd.cjs +7 -7
  30. package/package.json +1 -1
@@ -50,7 +50,7 @@ var hookCallback;function hooks(){return hookCallback.apply(null,arguments)}func
50
50
  [`+g+"] ";for(y in arguments[0])hasOwnProp(arguments[0],y)&&(i+=y+": "+arguments[0][y]+", ");i=i.slice(0,-2)}else i=arguments[g];r.push(i)}warn$1(t+`
51
51
  Arguments: `+Array.prototype.slice.call(r).join("")+`
52
52
  `+new Error().stack),n=!1}return e.apply(this,arguments)},e)}var deprecations={};function deprecateSimple(t,e){hooks.deprecationHandler!=null&&hooks.deprecationHandler(t,e),deprecations[t]||(warn$1(e),deprecations[t]=!0)}hooks.suppressDeprecationWarnings=!1,hooks.deprecationHandler=null;function isFunction(t){return typeof Function<"u"&&t instanceof Function||Object.prototype.toString.call(t)==="[object Function]"}function set(t){var e,n;for(n in t)hasOwnProp(t,n)&&(e=t[n],isFunction(e)?this[n]=e:this["_"+n]=e);this._config=t,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function mergeConfigs(t,e){var n=extend$4({},t),r;for(r in e)hasOwnProp(e,r)&&(isObject(t[r])&&isObject(e[r])?(n[r]={},extend$4(n[r],t[r]),extend$4(n[r],e[r])):e[r]!=null?n[r]=e[r]:delete n[r]);for(r in t)hasOwnProp(t,r)&&!hasOwnProp(e,r)&&isObject(t[r])&&(n[r]=extend$4({},n[r]));return n}function Locale(t){t!=null&&this.set(t)}var keys;Object.keys?keys=Object.keys:keys=function(t){var e,n=[];for(e in t)hasOwnProp(t,e)&&n.push(e);return n};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(t,e,n){var r=this._calendar[t]||this._calendar.sameElse;return isFunction(r)?r.call(e,n):r}function zeroFill(t,e,n){var r=""+Math.abs(t),i=e-r.length,g=t>=0;return(g?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+r}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(t,e,n,r){var i=r;typeof r=="string"&&(i=function(){return this[r]()}),t&&(formatTokenFunctions[t]=i),e&&(formatTokenFunctions[e[0]]=function(){return zeroFill(i.apply(this,arguments),e[1],e[2])}),n&&(formatTokenFunctions[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),t)})}function removeFormattingTokens(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function makeFormatFunction(t){var e=t.match(formattingTokens),n,r;for(n=0,r=e.length;n<r;n++)formatTokenFunctions[e[n]]?e[n]=formatTokenFunctions[e[n]]:e[n]=removeFormattingTokens(e[n]);return function(i){var g="",y;for(y=0;y<r;y++)g+=isFunction(e[y])?e[y].call(i,t):e[y];return g}}function formatMoment(t,e){return t.isValid()?(e=expandFormat(e,t.localeData()),formatFunctions[e]=formatFunctions[e]||makeFormatFunction(e),formatFunctions[e](t)):t.localeData().invalidDate()}function expandFormat(t,e){var n=5;function r(i){return e.longDateFormat(i)||i}for(localFormattingTokens.lastIndex=0;n>=0&&localFormattingTokens.test(t);)t=t.replace(localFormattingTokens,r),localFormattingTokens.lastIndex=0,n-=1;return t}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(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.match(formattingTokens).map(function(r){return r==="MMMM"||r==="MM"||r==="DD"||r==="dddd"?r.slice(1):r}).join(""),this._longDateFormat[t])}var defaultInvalidDate="Invalid date";function invalidDate(){return this._invalidDate}var defaultOrdinal="%d",defaultDayOfMonthOrdinalParse=/\d{1,2}/;function ordinal(t){return this._ordinal.replace("%d",t)}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(t,e,n,r){var i=this._relativeTime[n];return isFunction(i)?i(t,e,n,r):i.replace(/%d/i,t)}function pastFuture(t,e){var n=this._relativeTime[t>0?"future":"past"];return isFunction(n)?n(e):n.replace(/%s/i,e)}var aliases={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function normalizeUnits(t){return typeof t=="string"?aliases[t]||aliases[t.toLowerCase()]:void 0}function normalizeObjectUnits(t){var e={},n,r;for(r in t)hasOwnProp(t,r)&&(n=normalizeUnits(r),n&&(e[n]=t[r]));return e}var priorities={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function getPrioritizedUnits(t){var e=[],n;for(n in t)hasOwnProp(t,n)&&e.push({unit:n,priority:priorities[n]});return e.sort(function(r,i){return r.priority-i.priority}),e}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,match1to2NoLeadingZero=/^[1-9]\d?/,match1to2HasZero=/^([1-9]\d|\d)/,regexes;regexes={};function addRegexToken(t,e,n){regexes[t]=isFunction(e)?e:function(r,i){return r&&n?n:e}}function getParseRegexForToken(t,e){return hasOwnProp(regexes,t)?regexes[t](e._strict,e._locale):new RegExp(unescapeFormat(t))}function unescapeFormat(t){return regexEscape(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,n,r,i,g){return n||r||i||g}))}function regexEscape(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function absFloor(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function toInt(t){var e=+t,n=0;return e!==0&&isFinite(e)&&(n=absFloor(e)),n}var tokens={};function addParseToken(t,e){var n,r=e,i;for(typeof t=="string"&&(t=[t]),isNumber(e)&&(r=function(g,y){y[e]=toInt(g)}),i=t.length,n=0;n<i;n++)tokens[t[n]]=r}function addWeekParseToken(t,e){addParseToken(t,function(n,r,i,g){i._w=i._w||{},e(n,i._w,i,g)})}function addTimeToArrayFromToken(t,e,n){e!=null&&hasOwnProp(tokens,t)&&tokens[t](e,n._a,n,t)}function isLeapYear(t){return t%4===0&&t%100!==0||t%400===0}var YEAR=0,MONTH=1,DATE=2,HOUR=3,MINUTE=4,SECOND=5,MILLISECOND=6,WEEK=7,WEEKDAY=8;addFormatToken("Y",0,0,function(){var t=this.year();return t<=9999?zeroFill(t,4):"+"+t}),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"),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(t,e){e[YEAR]=t.length===2?hooks.parseTwoDigitYear(t):toInt(t)}),addParseToken("YY",function(t,e){e[YEAR]=hooks.parseTwoDigitYear(t)}),addParseToken("Y",function(t,e){e[YEAR]=parseInt(t,10)});function daysInYear(t){return isLeapYear(t)?366:365}hooks.parseTwoDigitYear=function(t){return toInt(t)+(toInt(t)>68?1900:2e3)};var getSetYear=makeGetSet("FullYear",!0);function getIsLeapYear(){return isLeapYear(this.year())}function makeGetSet(t,e){return function(n){return n!=null?(set$1(this,t,n),hooks.updateOffset(this,e),this):get$4(this,t)}}function get$4(t,e){if(!t.isValid())return NaN;var n=t._d,r=t._isUTC;switch(e){case"Milliseconds":return r?n.getUTCMilliseconds():n.getMilliseconds();case"Seconds":return r?n.getUTCSeconds():n.getSeconds();case"Minutes":return r?n.getUTCMinutes():n.getMinutes();case"Hours":return r?n.getUTCHours():n.getHours();case"Date":return r?n.getUTCDate():n.getDate();case"Day":return r?n.getUTCDay():n.getDay();case"Month":return r?n.getUTCMonth():n.getMonth();case"FullYear":return r?n.getUTCFullYear():n.getFullYear();default:return NaN}}function set$1(t,e,n){var r,i,g,y,k;if(!(!t.isValid()||isNaN(n))){switch(r=t._d,i=t._isUTC,e){case"Milliseconds":return void(i?r.setUTCMilliseconds(n):r.setMilliseconds(n));case"Seconds":return void(i?r.setUTCSeconds(n):r.setSeconds(n));case"Minutes":return void(i?r.setUTCMinutes(n):r.setMinutes(n));case"Hours":return void(i?r.setUTCHours(n):r.setHours(n));case"Date":return void(i?r.setUTCDate(n):r.setDate(n));case"FullYear":break;default:return}g=n,y=t.month(),k=t.date(),k=k===29&&y===1&&!isLeapYear(g)?28:k,i?r.setUTCFullYear(g,y,k):r.setFullYear(g,y,k)}}function stringGet(t){return t=normalizeUnits(t),isFunction(this[t])?this[t]():this}function stringSet(t,e){if(typeof t=="object"){t=normalizeObjectUnits(t);var n=getPrioritizedUnits(t),r,i=n.length;for(r=0;r<i;r++)this[n[r].unit](t[n[r].unit])}else if(t=normalizeUnits(t),isFunction(this[t]))return this[t](e);return this}function mod(t,e){return(t%e+e)%e}var indexOf;Array.prototype.indexOf?indexOf=Array.prototype.indexOf:indexOf=function(t){var e;for(e=0;e<this.length;++e)if(this[e]===t)return e;return-1};function daysInMonth(t,e){if(isNaN(t)||isNaN(e))return NaN;var n=mod(e,12);return t+=(e-n)/12,n===1?isLeapYear(t)?29:28:31-n%7%2}addFormatToken("M",["MM",2],"Mo",function(){return this.month()+1}),addFormatToken("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)}),addFormatToken("MMMM",0,0,function(t){return this.localeData().months(this,t)}),addRegexToken("M",match1to2,match1to2NoLeadingZero),addRegexToken("MM",match1to2,match2),addRegexToken("MMM",function(t,e){return e.monthsShortRegex(t)}),addRegexToken("MMMM",function(t,e){return e.monthsRegex(t)}),addParseToken(["M","MM"],function(t,e){e[MONTH]=toInt(t)-1}),addParseToken(["MMM","MMMM"],function(t,e,n,r){var i=n._locale.monthsParse(t,r,n._strict);i!=null?e[MONTH]=i:getParsingFlags(n).invalidMonth=t});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(t,e){return t?isArray(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||MONTHS_IN_FORMAT).test(e)?"format":"standalone"][t.month()]:isArray(this._months)?this._months:this._months.standalone}function localeMonthsShort(t,e){return t?isArray(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[MONTHS_IN_FORMAT.test(e)?"format":"standalone"][t.month()]:isArray(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function handleStrictParse(t,e,n){var r,i,g,y=t.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],r=0;r<12;++r)g=createUTC([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(g,"").toLocaleLowerCase(),this._longMonthsParse[r]=this.months(g,"").toLocaleLowerCase();return n?e==="MMM"?(i=indexOf.call(this._shortMonthsParse,y),i!==-1?i:null):(i=indexOf.call(this._longMonthsParse,y),i!==-1?i:null):e==="MMM"?(i=indexOf.call(this._shortMonthsParse,y),i!==-1?i:(i=indexOf.call(this._longMonthsParse,y),i!==-1?i:null)):(i=indexOf.call(this._longMonthsParse,y),i!==-1?i:(i=indexOf.call(this._shortMonthsParse,y),i!==-1?i:null))}function localeMonthsParse(t,e,n){var r,i,g;if(this._monthsParseExact)return handleStrictParse.call(this,t,e,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++){if(i=createUTC([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),!n&&!this._monthsParse[r]&&(g="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[r]=new RegExp(g.replace(".",""),"i")),n&&e==="MMMM"&&this._longMonthsParse[r].test(t))return r;if(n&&e==="MMM"&&this._shortMonthsParse[r].test(t))return r;if(!n&&this._monthsParse[r].test(t))return r}}function setMonth(t,e){if(!t.isValid())return t;if(typeof e=="string"){if(/^\d+$/.test(e))e=toInt(e);else if(e=t.localeData().monthsParse(e),!isNumber(e))return t}var n=e,r=t.date();return r=r<29?r:Math.min(r,daysInMonth(t.year(),n)),t._isUTC?t._d.setUTCMonth(n,r):t._d.setMonth(n,r),t}function getSetMonth(t){return t!=null?(setMonth(this,t),hooks.updateOffset(this,!0),this):get$4(this,"Month")}function getDaysInMonth(){return daysInMonth(this.year(),this.month())}function monthsShortRegex(t){return this._monthsParseExact?(hasOwnProp(this,"_monthsRegex")||computeMonthsParse.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(hasOwnProp(this,"_monthsShortRegex")||(this._monthsShortRegex=defaultMonthsShortRegex),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)}function monthsRegex(t){return this._monthsParseExact?(hasOwnProp(this,"_monthsRegex")||computeMonthsParse.call(this),t?this._monthsStrictRegex:this._monthsRegex):(hasOwnProp(this,"_monthsRegex")||(this._monthsRegex=defaultMonthsRegex),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)}function computeMonthsParse(){function t(L,$){return $.length-L.length}var e=[],n=[],r=[],i,g,y,k;for(i=0;i<12;i++)g=createUTC([2e3,i]),y=regexEscape(this.monthsShort(g,"")),k=regexEscape(this.months(g,"")),e.push(y),n.push(k),r.push(k),r.push(y);e.sort(t),n.sort(t),r.sort(t),this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+e.join("|")+")","i")}function createDate(t,e,n,r,i,g,y){var k;return t<100&&t>=0?(k=new Date(t+400,e,n,r,i,g,y),isFinite(k.getFullYear())&&k.setFullYear(t)):k=new Date(t,e,n,r,i,g,y),k}function createUTCDate(t){var e,n;return t<100&&t>=0?(n=Array.prototype.slice.call(arguments),n[0]=t+400,e=new Date(Date.UTC.apply(null,n)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t)):e=new Date(Date.UTC.apply(null,arguments)),e}function firstWeekOffset(t,e,n){var r=7+e-n,i=(7+createUTCDate(t,0,r).getUTCDay()-e)%7;return-i+r-1}function dayOfYearFromWeeks(t,e,n,r,i){var g=(7+n-r)%7,y=firstWeekOffset(t,r,i),k=1+7*(e-1)+g+y,L,$;return k<=0?(L=t-1,$=daysInYear(L)+k):k>daysInYear(t)?(L=t+1,$=k-daysInYear(t)):(L=t,$=k),{year:L,dayOfYear:$}}function weekOfYear(t,e,n){var r=firstWeekOffset(t.year(),e,n),i=Math.floor((t.dayOfYear()-r-1)/7)+1,g,y;return i<1?(y=t.year()-1,g=i+weeksInYear(y,e,n)):i>weeksInYear(t.year(),e,n)?(g=i-weeksInYear(t.year(),e,n),y=t.year()+1):(y=t.year(),g=i),{week:g,year:y}}function weeksInYear(t,e,n){var r=firstWeekOffset(t,e,n),i=firstWeekOffset(t+1,e,n);return(daysInYear(t)-r+i)/7}addFormatToken("w",["ww",2],"wo","week"),addFormatToken("W",["WW",2],"Wo","isoWeek"),addRegexToken("w",match1to2,match1to2NoLeadingZero),addRegexToken("ww",match1to2,match2),addRegexToken("W",match1to2,match1to2NoLeadingZero),addRegexToken("WW",match1to2,match2),addWeekParseToken(["w","ww","W","WW"],function(t,e,n,r){e[r.substr(0,1)]=toInt(t)});function localeWeek(t){return weekOfYear(t,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(t){var e=this.localeData().week(this);return t==null?e:this.add((t-e)*7,"d")}function getSetISOWeek(t){var e=weekOfYear(this,1,4).week;return t==null?e:this.add((t-e)*7,"d")}addFormatToken("d",0,"do","day"),addFormatToken("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),addFormatToken("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),addFormatToken("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),addFormatToken("e",0,0,"weekday"),addFormatToken("E",0,0,"isoWeekday"),addRegexToken("d",match1to2),addRegexToken("e",match1to2),addRegexToken("E",match1to2),addRegexToken("dd",function(t,e){return e.weekdaysMinRegex(t)}),addRegexToken("ddd",function(t,e){return e.weekdaysShortRegex(t)}),addRegexToken("dddd",function(t,e){return e.weekdaysRegex(t)}),addWeekParseToken(["dd","ddd","dddd"],function(t,e,n,r){var i=n._locale.weekdaysParse(t,r,n._strict);i!=null?e.d=i:getParsingFlags(n).invalidWeekday=t}),addWeekParseToken(["d","e","E"],function(t,e,n,r){e[r]=toInt(t)});function parseWeekday(t,e){return typeof t!="string"?t:isNaN(t)?(t=e.weekdaysParse(t),typeof t=="number"?t:null):parseInt(t,10)}function parseIsoWeekday(t,e){return typeof t=="string"?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function shiftWeekdays(t,e){return t.slice(e,7).concat(t.slice(0,e))}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(t,e){var n=isArray(this._weekdays)?this._weekdays:this._weekdays[t&&t!==!0&&this._weekdays.isFormat.test(e)?"format":"standalone"];return t===!0?shiftWeekdays(n,this._week.dow):t?n[t.day()]:n}function localeWeekdaysShort(t){return t===!0?shiftWeekdays(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort}function localeWeekdaysMin(t){return t===!0?shiftWeekdays(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin}function handleStrictParse$1(t,e,n){var r,i,g,y=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)g=createUTC([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(g,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(g,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(g,"").toLocaleLowerCase();return n?e==="dddd"?(i=indexOf.call(this._weekdaysParse,y),i!==-1?i:null):e==="ddd"?(i=indexOf.call(this._shortWeekdaysParse,y),i!==-1?i:null):(i=indexOf.call(this._minWeekdaysParse,y),i!==-1?i:null):e==="dddd"?(i=indexOf.call(this._weekdaysParse,y),i!==-1||(i=indexOf.call(this._shortWeekdaysParse,y),i!==-1)?i:(i=indexOf.call(this._minWeekdaysParse,y),i!==-1?i:null)):e==="ddd"?(i=indexOf.call(this._shortWeekdaysParse,y),i!==-1||(i=indexOf.call(this._weekdaysParse,y),i!==-1)?i:(i=indexOf.call(this._minWeekdaysParse,y),i!==-1?i:null)):(i=indexOf.call(this._minWeekdaysParse,y),i!==-1||(i=indexOf.call(this._weekdaysParse,y),i!==-1)?i:(i=indexOf.call(this._shortWeekdaysParse,y),i!==-1?i:null))}function localeWeekdaysParse(t,e,n){var r,i,g;if(this._weekdaysParseExact)return handleStrictParse$1.call(this,t,e,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(i=createUTC([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(g="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[r]=new RegExp(g.replace(".",""),"i")),n&&e==="dddd"&&this._fullWeekdaysParse[r].test(t))return r;if(n&&e==="ddd"&&this._shortWeekdaysParse[r].test(t))return r;if(n&&e==="dd"&&this._minWeekdaysParse[r].test(t))return r;if(!n&&this._weekdaysParse[r].test(t))return r}}function getSetDayOfWeek(t){if(!this.isValid())return t!=null?this:NaN;var e=get$4(this,"Day");return t!=null?(t=parseWeekday(t,this.localeData()),this.add(t-e,"d")):e}function getSetLocaleDayOfWeek(t){if(!this.isValid())return t!=null?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return t==null?e:this.add(t-e,"d")}function getSetISODayOfWeek(t){if(!this.isValid())return t!=null?this:NaN;if(t!=null){var e=parseIsoWeekday(t,this.localeData());return this.day(this.day()%7?e:e-7)}else return this.day()||7}function weekdaysRegex(t){return this._weekdaysParseExact?(hasOwnProp(this,"_weekdaysRegex")||computeWeekdaysParse.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(hasOwnProp(this,"_weekdaysRegex")||(this._weekdaysRegex=defaultWeekdaysRegex),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function weekdaysShortRegex(t){return this._weekdaysParseExact?(hasOwnProp(this,"_weekdaysRegex")||computeWeekdaysParse.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(hasOwnProp(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=defaultWeekdaysShortRegex),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function weekdaysMinRegex(t){return this._weekdaysParseExact?(hasOwnProp(this,"_weekdaysRegex")||computeWeekdaysParse.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(hasOwnProp(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=defaultWeekdaysMinRegex),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function computeWeekdaysParse(){function t(V,z){return z.length-V.length}var e=[],n=[],r=[],i=[],g,y,k,L,$;for(g=0;g<7;g++)y=createUTC([2e3,1]).day(g),k=regexEscape(this.weekdaysMin(y,"")),L=regexEscape(this.weekdaysShort(y,"")),$=regexEscape(this.weekdays(y,"")),e.push(k),n.push(L),r.push($),i.push(k),i.push(L),i.push($);e.sort(t),n.sort(t),r.sort(t),i.sort(t),this._weekdaysRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+e.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(t,e){addFormatToken(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}meridiem("a",!0),meridiem("A",!1);function matchMeridiem(t,e){return e._meridiemParse}addRegexToken("a",matchMeridiem),addRegexToken("A",matchMeridiem),addRegexToken("H",match1to2,match1to2HasZero),addRegexToken("h",match1to2,match1to2NoLeadingZero),addRegexToken("k",match1to2,match1to2NoLeadingZero),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(t,e,n){var r=toInt(t);e[HOUR]=r===24?0:r}),addParseToken(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t}),addParseToken(["h","hh"],function(t,e,n){e[HOUR]=toInt(t),getParsingFlags(n).bigHour=!0}),addParseToken("hmm",function(t,e,n){var r=t.length-2;e[HOUR]=toInt(t.substr(0,r)),e[MINUTE]=toInt(t.substr(r)),getParsingFlags(n).bigHour=!0}),addParseToken("hmmss",function(t,e,n){var r=t.length-4,i=t.length-2;e[HOUR]=toInt(t.substr(0,r)),e[MINUTE]=toInt(t.substr(r,2)),e[SECOND]=toInt(t.substr(i)),getParsingFlags(n).bigHour=!0}),addParseToken("Hmm",function(t,e,n){var r=t.length-2;e[HOUR]=toInt(t.substr(0,r)),e[MINUTE]=toInt(t.substr(r))}),addParseToken("Hmmss",function(t,e,n){var r=t.length-4,i=t.length-2;e[HOUR]=toInt(t.substr(0,r)),e[MINUTE]=toInt(t.substr(r,2)),e[SECOND]=toInt(t.substr(i))});function localeIsPM(t){return(t+"").toLowerCase().charAt(0)==="p"}var defaultLocaleMeridiemParse=/[ap]\.?m?\.?/i,getSetHour=makeGetSet("Hours",!0);function localeMeridiem(t,e,n){return t>11?n?"pm":"PM":n?"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(t,e){var n,r=Math.min(t.length,e.length);for(n=0;n<r;n+=1)if(t[n]!==e[n])return n;return r}function normalizeLocale(t){return t&&t.toLowerCase().replace("_","-")}function chooseLocale(t){for(var e=0,n,r,i,g;e<t.length;){for(g=normalizeLocale(t[e]).split("-"),n=g.length,r=normalizeLocale(t[e+1]),r=r?r.split("-"):null;n>0;){if(i=loadLocale(g.slice(0,n).join("-")),i)return i;if(r&&r.length>=n&&commonPrefix(g,r)>=n-1)break;n--}e++}return globalLocale}function isLocaleNameSane(t){return!!(t&&t.match("^[^/\\\\]*$"))}function loadLocale(t){var e=null,n;if(locales[t]===void 0&&typeof module<"u"&&module&&module.exports&&isLocaleNameSane(t))try{e=globalLocale._abbr,n=require,n("./locale/"+t),getSetGlobalLocale(e)}catch{locales[t]=null}return locales[t]}function getSetGlobalLocale(t,e){var n;return t&&(isUndefined(e)?n=getLocale(t):n=defineLocale(t,e),n?globalLocale=n:typeof console<"u"&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),globalLocale._abbr}function defineLocale(t,e){if(e!==null){var n,r=baseConfig;if(e.abbr=t,locales[t]!=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."),r=locales[t]._config;else if(e.parentLocale!=null)if(locales[e.parentLocale]!=null)r=locales[e.parentLocale]._config;else if(n=loadLocale(e.parentLocale),n!=null)r=n._config;else return localeFamilies[e.parentLocale]||(localeFamilies[e.parentLocale]=[]),localeFamilies[e.parentLocale].push({name:t,config:e}),null;return locales[t]=new Locale(mergeConfigs(r,e)),localeFamilies[t]&&localeFamilies[t].forEach(function(i){defineLocale(i.name,i.config)}),getSetGlobalLocale(t),locales[t]}else return delete locales[t],null}function updateLocale(t,e){if(e!=null){var n,r,i=baseConfig;locales[t]!=null&&locales[t].parentLocale!=null?locales[t].set(mergeConfigs(locales[t]._config,e)):(r=loadLocale(t),r!=null&&(i=r._config),e=mergeConfigs(i,e),r==null&&(e.abbr=t),n=new Locale(e),n.parentLocale=locales[t],locales[t]=n),getSetGlobalLocale(t)}else locales[t]!=null&&(locales[t].parentLocale!=null?(locales[t]=locales[t].parentLocale,t===getSetGlobalLocale()&&getSetGlobalLocale(t)):locales[t]!=null&&delete locales[t]);return locales[t]}function getLocale(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return globalLocale;if(!isArray(t)){if(e=loadLocale(t),e)return e;t=[t]}return chooseLocale(t)}function listLocales(){return keys(locales)}function checkOverflow(t){var e,n=t._a;return n&&getParsingFlags(t).overflow===-2&&(e=n[MONTH]<0||n[MONTH]>11?MONTH:n[DATE]<1||n[DATE]>daysInMonth(n[YEAR],n[MONTH])?DATE:n[HOUR]<0||n[HOUR]>24||n[HOUR]===24&&(n[MINUTE]!==0||n[SECOND]!==0||n[MILLISECOND]!==0)?HOUR:n[MINUTE]<0||n[MINUTE]>59?MINUTE:n[SECOND]<0||n[SECOND]>59?SECOND:n[MILLISECOND]<0||n[MILLISECOND]>999?MILLISECOND:-1,getParsingFlags(t)._overflowDayOfYear&&(e<YEAR||e>DATE)&&(e=DATE),getParsingFlags(t)._overflowWeeks&&e===-1&&(e=WEEK),getParsingFlags(t)._overflowWeekday&&e===-1&&(e=WEEKDAY),getParsingFlags(t).overflow=e),t}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(t){var e,n,r=t._i,i=extendedIsoRegex.exec(r)||basicIsoRegex.exec(r),g,y,k,L,$=isoDates.length,V=isoTimes.length;if(i){for(getParsingFlags(t).iso=!0,e=0,n=$;e<n;e++)if(isoDates[e][1].exec(i[1])){y=isoDates[e][0],g=isoDates[e][2]!==!1;break}if(y==null){t._isValid=!1;return}if(i[3]){for(e=0,n=V;e<n;e++)if(isoTimes[e][1].exec(i[3])){k=(i[2]||" ")+isoTimes[e][0];break}if(k==null){t._isValid=!1;return}}if(!g&&k!=null){t._isValid=!1;return}if(i[4])if(tzRegex.exec(i[4]))L="Z";else{t._isValid=!1;return}t._f=y+(k||"")+(L||""),configFromStringAndFormat(t)}else t._isValid=!1}function extractFromRFC2822Strings(t,e,n,r,i,g){var y=[untruncateYear(t),defaultLocaleMonthsShort.indexOf(e),parseInt(n,10),parseInt(r,10),parseInt(i,10)];return g&&y.push(parseInt(g,10)),y}function untruncateYear(t){var e=parseInt(t,10);return e<=49?2e3+e:e<=999?1900+e:e}function preprocessRFC2822(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function checkWeekday(t,e,n){if(t){var r=defaultLocaleWeekdaysShort.indexOf(t),i=new Date(e[0],e[1],e[2]).getDay();if(r!==i)return getParsingFlags(n).weekdayMismatch=!0,n._isValid=!1,!1}return!0}function calculateOffset(t,e,n){if(t)return obsOffsets[t];if(e)return 0;var r=parseInt(n,10),i=r%100,g=(r-i)/100;return g*60+i}function configFromRFC2822(t){var e=rfc2822.exec(preprocessRFC2822(t._i)),n;if(e){if(n=extractFromRFC2822Strings(e[4],e[3],e[2],e[5],e[6],e[7]),!checkWeekday(e[1],n,t))return;t._a=n,t._tzm=calculateOffset(e[8],e[9],e[10]),t._d=createUTCDate.apply(null,t._a),t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),getParsingFlags(t).rfc2822=!0}else t._isValid=!1}function configFromString(t){var e=aspNetJsonRegex.exec(t._i);if(e!==null){t._d=new Date(+e[1]);return}if(configFromISO(t),t._isValid===!1)delete t._isValid;else return;if(configFromRFC2822(t),t._isValid===!1)delete t._isValid;else return;t._strict?t._isValid=!1:hooks.createFromInputFallback(t)}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(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))});function defaults$3(t,e,n){return t??e??n}function currentDateArray(t){var e=new Date(hooks.now());return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function configFromArray(t){var e,n,r=[],i,g,y;if(!t._d){for(i=currentDateArray(t),t._w&&t._a[DATE]==null&&t._a[MONTH]==null&&dayOfYearFromWeekInfo(t),t._dayOfYear!=null&&(y=defaults$3(t._a[YEAR],i[YEAR]),(t._dayOfYear>daysInYear(y)||t._dayOfYear===0)&&(getParsingFlags(t)._overflowDayOfYear=!0),n=createUTCDate(y,0,t._dayOfYear),t._a[MONTH]=n.getUTCMonth(),t._a[DATE]=n.getUTCDate()),e=0;e<3&&t._a[e]==null;++e)t._a[e]=r[e]=i[e];for(;e<7;e++)t._a[e]=r[e]=t._a[e]==null?e===2?1:0:t._a[e];t._a[HOUR]===24&&t._a[MINUTE]===0&&t._a[SECOND]===0&&t._a[MILLISECOND]===0&&(t._nextDay=!0,t._a[HOUR]=0),t._d=(t._useUTC?createUTCDate:createDate).apply(null,r),g=t._useUTC?t._d.getUTCDay():t._d.getDay(),t._tzm!=null&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[HOUR]=24),t._w&&typeof t._w.d<"u"&&t._w.d!==g&&(getParsingFlags(t).weekdayMismatch=!0)}}function dayOfYearFromWeekInfo(t){var e,n,r,i,g,y,k,L,$;e=t._w,e.GG!=null||e.W!=null||e.E!=null?(g=1,y=4,n=defaults$3(e.GG,t._a[YEAR],weekOfYear(createLocal(),1,4).year),r=defaults$3(e.W,1),i=defaults$3(e.E,1),(i<1||i>7)&&(L=!0)):(g=t._locale._week.dow,y=t._locale._week.doy,$=weekOfYear(createLocal(),g,y),n=defaults$3(e.gg,t._a[YEAR],$.year),r=defaults$3(e.w,$.week),e.d!=null?(i=e.d,(i<0||i>6)&&(L=!0)):e.e!=null?(i=e.e+g,(e.e<0||e.e>6)&&(L=!0)):i=g),r<1||r>weeksInYear(n,g,y)?getParsingFlags(t)._overflowWeeks=!0:L!=null?getParsingFlags(t)._overflowWeekday=!0:(k=dayOfYearFromWeeks(n,r,i,g,y),t._a[YEAR]=k.year,t._dayOfYear=k.dayOfYear)}hooks.ISO_8601=function(){},hooks.RFC_2822=function(){};function configFromStringAndFormat(t){if(t._f===hooks.ISO_8601){configFromISO(t);return}if(t._f===hooks.RFC_2822){configFromRFC2822(t);return}t._a=[],getParsingFlags(t).empty=!0;var e=""+t._i,n,r,i,g,y,k=e.length,L=0,$,V;for(i=expandFormat(t._f,t._locale).match(formattingTokens)||[],V=i.length,n=0;n<V;n++)g=i[n],r=(e.match(getParseRegexForToken(g,t))||[])[0],r&&(y=e.substr(0,e.indexOf(r)),y.length>0&&getParsingFlags(t).unusedInput.push(y),e=e.slice(e.indexOf(r)+r.length),L+=r.length),formatTokenFunctions[g]?(r?getParsingFlags(t).empty=!1:getParsingFlags(t).unusedTokens.push(g),addTimeToArrayFromToken(g,r,t)):t._strict&&!r&&getParsingFlags(t).unusedTokens.push(g);getParsingFlags(t).charsLeftOver=k-L,e.length>0&&getParsingFlags(t).unusedInput.push(e),t._a[HOUR]<=12&&getParsingFlags(t).bigHour===!0&&t._a[HOUR]>0&&(getParsingFlags(t).bigHour=void 0),getParsingFlags(t).parsedDateParts=t._a.slice(0),getParsingFlags(t).meridiem=t._meridiem,t._a[HOUR]=meridiemFixWrap(t._locale,t._a[HOUR],t._meridiem),$=getParsingFlags(t).era,$!==null&&(t._a[YEAR]=t._locale.erasConvertYear($,t._a[YEAR])),configFromArray(t),checkOverflow(t)}function meridiemFixWrap(t,e,n){var r;return n==null?e:t.meridiemHour!=null?t.meridiemHour(e,n):(t.isPM!=null&&(r=t.isPM(n),r&&e<12&&(e+=12),!r&&e===12&&(e=0)),e)}function configFromStringAndArray(t){var e,n,r,i,g,y,k=!1,L=t._f.length;if(L===0){getParsingFlags(t).invalidFormat=!0,t._d=new Date(NaN);return}for(i=0;i<L;i++)g=0,y=!1,e=copyConfig({},t),t._useUTC!=null&&(e._useUTC=t._useUTC),e._f=t._f[i],configFromStringAndFormat(e),isValid(e)&&(y=!0),g+=getParsingFlags(e).charsLeftOver,g+=getParsingFlags(e).unusedTokens.length*10,getParsingFlags(e).score=g,k?g<r&&(r=g,n=e):(r==null||g<r||y)&&(r=g,n=e,y&&(k=!0));extend$4(t,n||e)}function configFromObject(t){if(!t._d){var e=normalizeObjectUnits(t._i),n=e.day===void 0?e.date:e.day;t._a=map([e.year,e.month,n,e.hour,e.minute,e.second,e.millisecond],function(r){return r&&parseInt(r,10)}),configFromArray(t)}}function createFromConfig(t){var e=new Moment(checkOverflow(prepareConfig(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function prepareConfig(t){var e=t._i,n=t._f;return t._locale=t._locale||getLocale(t._l),e===null||n===void 0&&e===""?createInvalid({nullInput:!0}):(typeof e=="string"&&(t._i=e=t._locale.preparse(e)),isMoment(e)?new Moment(checkOverflow(e)):(isDate(e)?t._d=e:isArray(n)?configFromStringAndArray(t):n?configFromStringAndFormat(t):configFromInput(t),isValid(t)||(t._d=null),t))}function configFromInput(t){var e=t._i;isUndefined(e)?t._d=new Date(hooks.now()):isDate(e)?t._d=new Date(e.valueOf()):typeof e=="string"?configFromString(t):isArray(e)?(t._a=map(e.slice(0),function(n){return parseInt(n,10)}),configFromArray(t)):isObject(e)?configFromObject(t):isNumber(e)?t._d=new Date(e):hooks.createFromInputFallback(t)}function createLocalOrUTC(t,e,n,r,i){var g={};return(e===!0||e===!1)&&(r=e,e=void 0),(n===!0||n===!1)&&(r=n,n=void 0),(isObject(t)&&isObjectEmpty(t)||isArray(t)&&t.length===0)&&(t=void 0),g._isAMomentObject=!0,g._useUTC=g._isUTC=i,g._l=n,g._i=t,g._f=e,g._strict=r,createFromConfig(g)}function createLocal(t,e,n,r){return createLocalOrUTC(t,e,n,r,!1)}var prototypeMin=deprecate("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=createLocal.apply(null,arguments);return this.isValid()&&t.isValid()?t<this?this:t:createInvalid()}),prototypeMax=deprecate("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=createLocal.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:createInvalid()});function pickBy(t,e){var n,r;if(e.length===1&&isArray(e[0])&&(e=e[0]),!e.length)return createLocal();for(n=e[0],r=1;r<e.length;++r)(!e[r].isValid()||e[r][t](n))&&(n=e[r]);return n}function min(){var t=[].slice.call(arguments,0);return pickBy("isBefore",t)}function max(){var t=[].slice.call(arguments,0);return pickBy("isAfter",t)}var now=function(){return Date.now?Date.now():+new Date},ordering=["year","quarter","month","week","day","hour","minute","second","millisecond"];function isDurationValid(t){var e,n=!1,r,i=ordering.length;for(e in t)if(hasOwnProp(t,e)&&!(indexOf.call(ordering,e)!==-1&&(t[e]==null||!isNaN(t[e]))))return!1;for(r=0;r<i;++r)if(t[ordering[r]]){if(n)return!1;parseFloat(t[ordering[r]])!==toInt(t[ordering[r]])&&(n=!0)}return!0}function isValid$1(){return this._isValid}function createInvalid$1(){return createDuration(NaN)}function Duration(t){var e=normalizeObjectUnits(t),n=e.year||0,r=e.quarter||0,i=e.month||0,g=e.week||e.isoWeek||0,y=e.day||0,k=e.hour||0,L=e.minute||0,$=e.second||0,V=e.millisecond||0;this._isValid=isDurationValid(e),this._milliseconds=+V+$*1e3+L*6e4+k*1e3*60*60,this._days=+y+g*7,this._months=+i+r*3+n*12,this._data={},this._locale=getLocale(),this._bubble()}function isDuration(t){return t instanceof Duration}function absRound(t){return t<0?Math.round(-1*t)*-1:Math.round(t)}function compareArrays(t,e,n){var r=Math.min(t.length,e.length),i=Math.abs(t.length-e.length),g=0,y;for(y=0;y<r;y++)toInt(t[y])!==toInt(e[y])&&g++;return g+i}function offset(t,e){addFormatToken(t,0,0,function(){var n=this.utcOffset(),r="+";return n<0&&(n=-n,r="-"),r+zeroFill(~~(n/60),2)+e+zeroFill(~~n%60,2)})}offset("Z",":"),offset("ZZ",""),addRegexToken("Z",matchShortOffset),addRegexToken("ZZ",matchShortOffset),addParseToken(["Z","ZZ"],function(t,e,n){n._useUTC=!0,n._tzm=offsetFromString(matchShortOffset,t)});var chunkOffset=/([\+\-]|\d\d)/gi;function offsetFromString(t,e){var n=(e||"").match(t),r,i,g;return n===null?null:(r=n[n.length-1]||[],i=(r+"").match(chunkOffset)||["-",0,0],g=+(i[1]*60)+toInt(i[2]),g===0?0:i[0]==="+"?g:-g)}function cloneWithOffset(t,e){var n,r;return e._isUTC?(n=e.clone(),r=(isMoment(t)||isDate(t)?t.valueOf():createLocal(t).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+r),hooks.updateOffset(n,!1),n):createLocal(t).local()}function getDateOffset(t){return-Math.round(t._d.getTimezoneOffset())}hooks.updateOffset=function(){};function getSetOffset(t,e,n){var r=this._offset||0,i;if(!this.isValid())return t!=null?this:NaN;if(t!=null){if(typeof t=="string"){if(t=offsetFromString(matchShortOffset,t),t===null)return this}else Math.abs(t)<16&&!n&&(t=t*60);return!this._isUTC&&e&&(i=getDateOffset(this)),this._offset=t,this._isUTC=!0,i!=null&&this.add(i,"m"),r!==t&&(!e||this._changeInProgress?addSubtract(this,createDuration(t-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,hooks.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?r:getDateOffset(this)}function getSetZone(t,e){return t!=null?(typeof t!="string"&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}function setOffsetToUTC(t){return this.utcOffset(0,t)}function setOffsetToLocal(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&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 t=offsetFromString(matchOffset,this._i);t!=null?this.utcOffset(t):this.utcOffset(0,!0)}return this}function hasAlignedHourOffset(t){return this.isValid()?(t=t?createLocal(t).utcOffset():0,(this.utcOffset()-t)%60===0):!1}function isDaylightSavingTime(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function isDaylightSavingTimeShifted(){if(!isUndefined(this._isDSTShifted))return this._isDSTShifted;var t={},e;return copyConfig(t,this),t=prepareConfig(t),t._a?(e=t._isUTC?createUTC(t._a):createLocal(t._a),this._isDSTShifted=this.isValid()&&compareArrays(t._a,e.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(t,e){var n=t,r=null,i,g,y;return isDuration(t)?n={ms:t._milliseconds,d:t._days,M:t._months}:isNumber(t)||!isNaN(+t)?(n={},e?n[e]=+t:n.milliseconds=+t):(r=aspNetRegex.exec(t))?(i=r[1]==="-"?-1:1,n={y:0,d:toInt(r[DATE])*i,h:toInt(r[HOUR])*i,m:toInt(r[MINUTE])*i,s:toInt(r[SECOND])*i,ms:toInt(absRound(r[MILLISECOND]*1e3))*i}):(r=isoRegex.exec(t))?(i=r[1]==="-"?-1:1,n={y:parseIso(r[2],i),M:parseIso(r[3],i),w:parseIso(r[4],i),d:parseIso(r[5],i),h:parseIso(r[6],i),m:parseIso(r[7],i),s:parseIso(r[8],i)}):n==null?n={}:typeof n=="object"&&("from"in n||"to"in n)&&(y=momentsDifference(createLocal(n.from),createLocal(n.to)),n={},n.ms=y.milliseconds,n.M=y.months),g=new Duration(n),isDuration(t)&&hasOwnProp(t,"_locale")&&(g._locale=t._locale),isDuration(t)&&hasOwnProp(t,"_isValid")&&(g._isValid=t._isValid),g}createDuration.fn=Duration.prototype,createDuration.invalid=createInvalid$1;function parseIso(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function positiveMomentsDifference(t,e){var n={};return n.months=e.month()-t.month()+(e.year()-t.year())*12,t.clone().add(n.months,"M").isAfter(e)&&--n.months,n.milliseconds=+e-+t.clone().add(n.months,"M"),n}function momentsDifference(t,e){var n;return t.isValid()&&e.isValid()?(e=cloneWithOffset(e,t),t.isBefore(e)?n=positiveMomentsDifference(t,e):(n=positiveMomentsDifference(e,t),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function createAdder(t,e){return function(n,r){var i,g;return r!==null&&!isNaN(+r)&&(deprecateSimple(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),g=n,n=r,r=g),i=createDuration(n,r),addSubtract(this,i,t),this}}function addSubtract(t,e,n,r){var i=e._milliseconds,g=absRound(e._days),y=absRound(e._months);t.isValid()&&(r=r??!0,y&&setMonth(t,get$4(t,"Month")+y*n),g&&set$1(t,"Date",get$4(t,"Date")+g*n),i&&t._d.setTime(t._d.valueOf()+i*n),r&&hooks.updateOffset(t,g||y))}var add$3=createAdder(1,"add"),subtract=createAdder(-1,"subtract");function isString(t){return typeof t=="string"||t instanceof String}function isMomentInput(t){return isMoment(t)||isDate(t)||isString(t)||isNumber(t)||isNumberOrStringArray(t)||isMomentInputObject(t)||t===null||t===void 0}function isMomentInputObject(t){var e=isObject(t)&&!isObjectEmpty(t),n=!1,r=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],i,g,y=r.length;for(i=0;i<y;i+=1)g=r[i],n=n||hasOwnProp(t,g);return e&&n}function isNumberOrStringArray(t){var e=isArray(t),n=!1;return e&&(n=t.filter(function(r){return!isNumber(r)&&isString(t)}).length===0),e&&n}function isCalendarSpec(t){var e=isObject(t)&&!isObjectEmpty(t),n=!1,r=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],i,g;for(i=0;i<r.length;i+=1)g=r[i],n=n||hasOwnProp(t,g);return e&&n}function getCalendarFormat(t,e){var n=t.diff(e,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"}function calendar$1(t,e){arguments.length===1&&(arguments[0]?isMomentInput(arguments[0])?(t=arguments[0],e=void 0):isCalendarSpec(arguments[0])&&(e=arguments[0],t=void 0):(t=void 0,e=void 0));var n=t||createLocal(),r=cloneWithOffset(n,this).startOf("day"),i=hooks.calendarFormat(this,r)||"sameElse",g=e&&(isFunction(e[i])?e[i].call(this,n):e[i]);return this.format(g||this.localeData().calendar(i,this,createLocal(n)))}function clone$2(){return new Moment(this)}function isAfter(t,e){var n=isMoment(t)?t:createLocal(t);return this.isValid()&&n.isValid()?(e=normalizeUnits(e)||"millisecond",e==="millisecond"?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(e).valueOf()):!1}function isBefore(t,e){var n=isMoment(t)?t:createLocal(t);return this.isValid()&&n.isValid()?(e=normalizeUnits(e)||"millisecond",e==="millisecond"?this.valueOf()<n.valueOf():this.clone().endOf(e).valueOf()<n.valueOf()):!1}function isBetween(t,e,n,r){var i=isMoment(t)?t:createLocal(t),g=isMoment(e)?e:createLocal(e);return this.isValid()&&i.isValid()&&g.isValid()?(r=r||"()",(r[0]==="("?this.isAfter(i,n):!this.isBefore(i,n))&&(r[1]===")"?this.isBefore(g,n):!this.isAfter(g,n))):!1}function isSame(t,e){var n=isMoment(t)?t:createLocal(t),r;return this.isValid()&&n.isValid()?(e=normalizeUnits(e)||"millisecond",e==="millisecond"?this.valueOf()===n.valueOf():(r=n.valueOf(),this.clone().startOf(e).valueOf()<=r&&r<=this.clone().endOf(e).valueOf())):!1}function isSameOrAfter(t,e){return this.isSame(t,e)||this.isAfter(t,e)}function isSameOrBefore(t,e){return this.isSame(t,e)||this.isBefore(t,e)}function diff(t,e,n){var r,i,g;if(!this.isValid())return NaN;if(r=cloneWithOffset(t,this),!r.isValid())return NaN;switch(i=(r.utcOffset()-this.utcOffset())*6e4,e=normalizeUnits(e),e){case"year":g=monthDiff(this,r)/12;break;case"month":g=monthDiff(this,r);break;case"quarter":g=monthDiff(this,r)/3;break;case"second":g=(this-r)/1e3;break;case"minute":g=(this-r)/6e4;break;case"hour":g=(this-r)/36e5;break;case"day":g=(this-r-i)/864e5;break;case"week":g=(this-r-i)/6048e5;break;default:g=this-r}return n?g:absFloor(g)}function monthDiff(t,e){if(t.date()<e.date())return-monthDiff(e,t);var n=(e.year()-t.year())*12+(e.month()-t.month()),r=t.clone().add(n,"months"),i,g;return e-r<0?(i=t.clone().add(n-1,"months"),g=(e-r)/(r-i)):(i=t.clone().add(n+1,"months"),g=(e-r)/(i-r)),-(n+g)||0}hooks.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",hooks.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function toString$2(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function toISOString(t){if(!this.isValid())return null;var e=t!==!0,n=e?this.clone().utc():this;return n.year()<0||n.year()>9999?formatMoment(n,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):isFunction(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",formatMoment(n,"Z")):formatMoment(n,e?"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 t="moment",e="",n,r,i,g;return this.isLocal()||(t=this.utcOffset()===0?"moment.utc":"moment.parseZone",e="Z"),n="["+t+'("]',r=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i="-MM-DD[T]HH:mm:ss.SSS",g=e+'[")]',this.format(n+r+i+g)}function format(t){t||(t=this.isUtc()?hooks.defaultFormatUtc:hooks.defaultFormat);var e=formatMoment(this,t);return this.localeData().postformat(e)}function from(t,e){return this.isValid()&&(isMoment(t)&&t.isValid()||createLocal(t).isValid())?createDuration({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function fromNow(t){return this.from(createLocal(),t)}function to(t,e){return this.isValid()&&(isMoment(t)&&t.isValid()||createLocal(t).isValid())?createDuration({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function toNow(t){return this.to(createLocal(),t)}function locale(t){var e;return t===void 0?this._locale._abbr:(e=getLocale(t),e!=null&&(this._locale=e),this)}var lang=deprecate("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return t===void 0?this.localeData():this.locale(t)});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(t,e){return(t%e+e)%e}function localStartOfDate(t,e,n){return t<100&&t>=0?new Date(t+400,e,n)-MS_PER_400_YEARS:new Date(t,e,n).valueOf()}function utcStartOfDate(t,e,n){return t<100&&t>=0?Date.UTC(t+400,e,n)-MS_PER_400_YEARS:Date.UTC(t,e,n)}function startOf(t){var e,n;if(t=normalizeUnits(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?utcStartOfDate:localStartOfDate,t){case"year":e=n(this.year(),0,1);break;case"quarter":e=n(this.year(),this.month()-this.month()%3,1);break;case"month":e=n(this.year(),this.month(),1);break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":e=n(this.year(),this.month(),this.date());break;case"hour":e=this._d.valueOf(),e-=mod$1(e+(this._isUTC?0:this.utcOffset()*MS_PER_MINUTE),MS_PER_HOUR);break;case"minute":e=this._d.valueOf(),e-=mod$1(e,MS_PER_MINUTE);break;case"second":e=this._d.valueOf(),e-=mod$1(e,MS_PER_SECOND);break}return this._d.setTime(e),hooks.updateOffset(this,!0),this}function endOf(t){var e,n;if(t=normalizeUnits(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?utcStartOfDate:localStartOfDate,t){case"year":e=n(this.year()+1,0,1)-1;break;case"quarter":e=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=n(this.year(),this.month()+1,1)-1;break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=MS_PER_HOUR-mod$1(e+(this._isUTC?0:this.utcOffset()*MS_PER_MINUTE),MS_PER_HOUR)-1;break;case"minute":e=this._d.valueOf(),e+=MS_PER_MINUTE-mod$1(e,MS_PER_MINUTE)-1;break;case"second":e=this._d.valueOf(),e+=MS_PER_SECOND-mod$1(e,MS_PER_SECOND)-1;break}return this._d.setTime(e),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$1(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function toObject(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}}function toJSON(){return this.isValid()?this.toISOString():null}function isValid$2(){return isValid(this)}function parsingFlags(){return extend$4({},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(t,e,n,r){var i=n._locale.erasParse(t,r,n._strict);i?getParsingFlags(n).era=i:getParsingFlags(n).invalidEra=t}),addRegexToken("y",matchUnsigned),addRegexToken("yy",matchUnsigned),addRegexToken("yyy",matchUnsigned),addRegexToken("yyyy",matchUnsigned),addRegexToken("yo",matchEraYearOrdinal),addParseToken(["y","yy","yyy","yyyy"],YEAR),addParseToken(["yo"],function(t,e,n,r){var i;n._locale._eraYearOrdinalRegex&&(i=t.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?e[YEAR]=n._locale.eraYearOrdinalParse(t,i):e[YEAR]=parseInt(t,10)});function localeEras(t,e){var n,r,i,g=this._eras||getLocale("en")._eras;for(n=0,r=g.length;n<r;++n){switch(typeof g[n].since){case"string":i=hooks(g[n].since).startOf("day"),g[n].since=i.valueOf();break}switch(typeof g[n].until){case"undefined":g[n].until=1/0;break;case"string":i=hooks(g[n].until).startOf("day").valueOf(),g[n].until=i.valueOf();break}}return g}function localeErasParse(t,e,n){var r,i,g=this.eras(),y,k,L;for(t=t.toUpperCase(),r=0,i=g.length;r<i;++r)if(y=g[r].name.toUpperCase(),k=g[r].abbr.toUpperCase(),L=g[r].narrow.toUpperCase(),n)switch(e){case"N":case"NN":case"NNN":if(k===t)return g[r];break;case"NNNN":if(y===t)return g[r];break;case"NNNNN":if(L===t)return g[r];break}else if([y,k,L].indexOf(t)>=0)return g[r]}function localeErasConvertYear(t,e){var n=t.since<=t.until?1:-1;return e===void 0?hooks(t.since).year():hooks(t.since).year()+(e-t.offset)*n}function getEraName(){var t,e,n,r=this.localeData().eras();for(t=0,e=r.length;t<e;++t)if(n=this.clone().startOf("day").valueOf(),r[t].since<=n&&n<=r[t].until||r[t].until<=n&&n<=r[t].since)return r[t].name;return""}function getEraNarrow(){var t,e,n,r=this.localeData().eras();for(t=0,e=r.length;t<e;++t)if(n=this.clone().startOf("day").valueOf(),r[t].since<=n&&n<=r[t].until||r[t].until<=n&&n<=r[t].since)return r[t].narrow;return""}function getEraAbbr(){var t,e,n,r=this.localeData().eras();for(t=0,e=r.length;t<e;++t)if(n=this.clone().startOf("day").valueOf(),r[t].since<=n&&n<=r[t].until||r[t].until<=n&&n<=r[t].since)return r[t].abbr;return""}function getEraYear(){var t,e,n,r,i=this.localeData().eras();for(t=0,e=i.length;t<e;++t)if(n=i[t].since<=i[t].until?1:-1,r=this.clone().startOf("day").valueOf(),i[t].since<=r&&r<=i[t].until||i[t].until<=r&&r<=i[t].since)return(this.year()-hooks(i[t].since).year())*n+i[t].offset;return this.year()}function erasNameRegex(t){return hasOwnProp(this,"_erasNameRegex")||computeErasParse.call(this),t?this._erasNameRegex:this._erasRegex}function erasAbbrRegex(t){return hasOwnProp(this,"_erasAbbrRegex")||computeErasParse.call(this),t?this._erasAbbrRegex:this._erasRegex}function erasNarrowRegex(t){return hasOwnProp(this,"_erasNarrowRegex")||computeErasParse.call(this),t?this._erasNarrowRegex:this._erasRegex}function matchEraAbbr(t,e){return e.erasAbbrRegex(t)}function matchEraName(t,e){return e.erasNameRegex(t)}function matchEraNarrow(t,e){return e.erasNarrowRegex(t)}function matchEraYearOrdinal(t,e){return e._eraYearOrdinalRegex||matchUnsigned}function computeErasParse(){var t=[],e=[],n=[],r=[],i,g,y,k,L,$=this.eras();for(i=0,g=$.length;i<g;++i)y=regexEscape($[i].name),k=regexEscape($[i].abbr),L=regexEscape($[i].narrow),e.push(y),t.push(k),n.push(L),r.push(y),r.push(k),r.push(L);this._erasRegex=new RegExp("^("+r.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+e.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+t.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+n.join("|")+")","i")}addFormatToken(0,["gg",2],0,function(){return this.weekYear()%100}),addFormatToken(0,["GG",2],0,function(){return this.isoWeekYear()%100});function addWeekYearFormatToken(t,e){addFormatToken(0,[t,t.length],0,e)}addWeekYearFormatToken("gggg","weekYear"),addWeekYearFormatToken("ggggg","weekYear"),addWeekYearFormatToken("GGGG","isoWeekYear"),addWeekYearFormatToken("GGGGG","isoWeekYear"),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(t,e,n,r){e[r.substr(0,2)]=toInt(t)}),addWeekParseToken(["gg","GG"],function(t,e,n,r){e[r]=hooks.parseTwoDigitYear(t)});function getSetWeekYear(t){return getSetWeekYearHelper.call(this,t,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function getSetISOWeekYear(t){return getSetWeekYearHelper.call(this,t,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 t=this.localeData()._week;return weeksInYear(this.year(),t.dow,t.doy)}function getWeeksInWeekYear(){var t=this.localeData()._week;return weeksInYear(this.weekYear(),t.dow,t.doy)}function getSetWeekYearHelper(t,e,n,r,i){var g;return t==null?weekOfYear(this,r,i).year:(g=weeksInYear(t,r,i),e>g&&(e=g),setWeekAll.call(this,t,e,n,r,i))}function setWeekAll(t,e,n,r,i){var g=dayOfYearFromWeeks(t,e,n,r,i),y=createUTCDate(g.year,0,g.dayOfYear);return this.year(y.getUTCFullYear()),this.month(y.getUTCMonth()),this.date(y.getUTCDate()),this}addFormatToken("Q",0,"Qo","quarter"),addRegexToken("Q",match1),addParseToken("Q",function(t,e){e[MONTH]=(toInt(t)-1)*3});function getSetQuarter(t){return t==null?Math.ceil((this.month()+1)/3):this.month((t-1)*3+this.month()%3)}addFormatToken("D",["DD",2],"Do","date"),addRegexToken("D",match1to2,match1to2NoLeadingZero),addRegexToken("DD",match1to2,match2),addRegexToken("Do",function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient}),addParseToken(["D","DD"],DATE),addParseToken("Do",function(t,e){e[DATE]=toInt(t.match(match1to2)[0])});var getSetDayOfMonth=makeGetSet("Date",!0);addFormatToken("DDD",["DDDD",3],"DDDo","dayOfYear"),addRegexToken("DDD",match1to3),addRegexToken("DDDD",match3),addParseToken(["DDD","DDDD"],function(t,e,n){n._dayOfYear=toInt(t)});function getSetDayOfYear(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return t==null?e:this.add(t-e,"d")}addFormatToken("m",["mm",2],0,"minute"),addRegexToken("m",match1to2,match1to2HasZero),addRegexToken("mm",match1to2,match2),addParseToken(["m","mm"],MINUTE);var getSetMinute=makeGetSet("Minutes",!1);addFormatToken("s",["ss",2],0,"second"),addRegexToken("s",match1to2,match1to2HasZero),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}),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(t,e){e[MILLISECOND]=toInt(("0."+t)*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$3,proto.calendar=calendar$1,proto.clone=clone$2,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$1,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$2,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(t){return createLocal(t*1e3)}function createInZone(){return createLocal.apply(null,arguments).parseZone()}function preParsePostFormat(t){return t}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$1(t,e,n,r){var i=getLocale(),g=createUTC().set(r,e);return i[n](g,t)}function listMonthsImpl(t,e,n){if(isNumber(t)&&(e=t,t=void 0),t=t||"",e!=null)return get$1$1(t,e,n,"month");var r,i=[];for(r=0;r<12;r++)i[r]=get$1$1(t,r,n,"month");return i}function listWeekdaysImpl(t,e,n,r){typeof t=="boolean"?(isNumber(e)&&(n=e,e=void 0),e=e||""):(e=t,n=e,t=!1,isNumber(e)&&(n=e,e=void 0),e=e||"");var i=getLocale(),g=t?i._week.dow:0,y,k=[];if(n!=null)return get$1$1(e,(n+g)%7,r,"day");for(y=0;y<7;y++)k[y]=get$1$1(e,(y+g)%7,r,"day");return k}function listMonths(t,e){return listMonthsImpl(t,e,"months")}function listMonthsShort(t,e){return listMonthsImpl(t,e,"monthsShort")}function listWeekdays(t,e,n){return listWeekdaysImpl(t,e,n,"weekdays")}function listWeekdaysShort(t,e,n){return listWeekdaysImpl(t,e,n,"weekdaysShort")}function listWeekdaysMin(t,e,n){return listWeekdaysImpl(t,e,n,"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(t){var e=t%10,n=toInt(t%100/10)===1?"th":e===1?"st":e===2?"nd":e===3?"rd":"th";return t+n}}),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 t=this._data;return this._milliseconds=mathAbs(this._milliseconds),this._days=mathAbs(this._days),this._months=mathAbs(this._months),t.milliseconds=mathAbs(t.milliseconds),t.seconds=mathAbs(t.seconds),t.minutes=mathAbs(t.minutes),t.hours=mathAbs(t.hours),t.months=mathAbs(t.months),t.years=mathAbs(t.years),this}function addSubtract$1(t,e,n,r){var i=createDuration(e,n);return t._milliseconds+=r*i._milliseconds,t._days+=r*i._days,t._months+=r*i._months,t._bubble()}function add$1$1(t,e){return addSubtract$1(this,t,e,1)}function subtract$1(t,e){return addSubtract$1(this,t,e,-1)}function absCeil(t){return t<0?Math.floor(t):Math.ceil(t)}function bubble(){var t=this._milliseconds,e=this._days,n=this._months,r=this._data,i,g,y,k,L;return t>=0&&e>=0&&n>=0||t<=0&&e<=0&&n<=0||(t+=absCeil(monthsToDays(n)+e)*864e5,e=0,n=0),r.milliseconds=t%1e3,i=absFloor(t/1e3),r.seconds=i%60,g=absFloor(i/60),r.minutes=g%60,y=absFloor(g/60),r.hours=y%24,e+=absFloor(y/24),L=absFloor(daysToMonths(e)),n+=L,e-=absCeil(monthsToDays(L)),k=absFloor(n/12),n%=12,r.days=e,r.months=n,r.years=k,this}function daysToMonths(t){return t*4800/146097}function monthsToDays(t){return t*146097/4800}function as(t){if(!this.isValid())return NaN;var e,n,r=this._milliseconds;if(t=normalizeUnits(t),t==="month"||t==="quarter"||t==="year")switch(e=this._days+r/864e5,n=this._months+daysToMonths(e),t){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(e=this._days+Math.round(monthsToDays(this._months)),t){case"week":return e/7+r/6048e5;case"day":return e+r/864e5;case"hour":return e*24+r/36e5;case"minute":return e*1440+r/6e4;case"second":return e*86400+r/1e3;case"millisecond":return Math.floor(e*864e5)+r;default:throw new Error("Unknown unit "+t)}}function makeAs(t){return function(){return this.as(t)}}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"),valueOf$1=asMilliseconds;function clone$1$1(){return createDuration(this)}function get$2$1(t){return t=normalizeUnits(t),this.isValid()?this[t+"s"]():NaN}function makeGetter(t){return function(){return this.isValid()?this._data[t]: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(t,e,n,r,i){return i.relativeTime(e||1,!!n,t,r)}function relativeTime$1(t,e,n,r){var i=createDuration(t).abs(),g=round(i.as("s")),y=round(i.as("m")),k=round(i.as("h")),L=round(i.as("d")),$=round(i.as("M")),V=round(i.as("w")),z=round(i.as("y")),re=g<=n.ss&&["s",g]||g<n.s&&["ss",g]||y<=1&&["m"]||y<n.m&&["mm",y]||k<=1&&["h"]||k<n.h&&["hh",k]||L<=1&&["d"]||L<n.d&&["dd",L];return n.w!=null&&(re=re||V<=1&&["w"]||V<n.w&&["ww",V]),re=re||$<=1&&["M"]||$<n.M&&["MM",$]||z<=1&&["y"]||["yy",z],re[2]=e,re[3]=+t>0,re[4]=r,substituteTimeAgo.apply(null,re)}function getSetRelativeTimeRounding(t){return t===void 0?round:typeof t=="function"?(round=t,!0):!1}function getSetRelativeTimeThreshold(t,e){return thresholds[t]===void 0?!1:e===void 0?thresholds[t]:(thresholds[t]=e,t==="s"&&(thresholds.ss=e-1),!0)}function humanize(t,e){if(!this.isValid())return this.localeData().invalidDate();var n=!1,r=thresholds,i,g;return typeof t=="object"&&(e=t,t=!1),typeof t=="boolean"&&(n=t),typeof e=="object"&&(r=Object.assign({},thresholds,e),e.s!=null&&e.ss==null&&(r.ss=e.s-1)),i=this.localeData(),g=relativeTime$1(this,!n,r,i),n&&(g=i.pastFuture(+this,g)),i.postformat(g)}var abs$1=Math.abs;function sign(t){return(t>0)-(t<0)||+t}function toISOString$1(){if(!this.isValid())return this.localeData().invalidDate();var t=abs$1(this._milliseconds)/1e3,e=abs$1(this._days),n=abs$1(this._months),r,i,g,y,k=this.asSeconds(),L,$,V,z;return k?(r=absFloor(t/60),i=absFloor(r/60),t%=60,r%=60,g=absFloor(n/12),n%=12,y=t?t.toFixed(3).replace(/\.?0+$/,""):"",L=k<0?"-":"",$=sign(this._months)!==sign(k)?"-":"",V=sign(this._days)!==sign(k)?"-":"",z=sign(this._milliseconds)!==sign(k)?"-":"",L+"P"+(g?$+g+"Y":"")+(n?$+n+"M":"")+(e?V+e+"D":"")+(i||r||t?"T":"")+(i?z+i+"H":"")+(r?z+r+"M":"")+(t?z+y+"S":"")):"P0D"}var proto$2=Duration.prototype;proto$2.isValid=isValid$1,proto$2.abs=abs,proto$2.add=add$1$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$1,proto$2.get=get$2$1,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(t,e,n){n._d=new Date(parseFloat(t)*1e3)}),addParseToken("x",function(t,e,n){n._d=new Date(toInt(t))});//! moment.js
53
- hooks.version="2.30.1",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,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 DEFAULT_VALUE$1="--",LOG_DATE_FORMAT_T="YYYY-MM-DDTHH:mm:ss",LOG_DATE_FORMAT_END="YYYY-MM-DDT23:59:59",DATE_PICKER_FORMAT="YYYY-MM-DD",CDN_URL$1="https://static.zhihaoscm.cn/",dateFormat=(t,e=DATE_PICKER_FORMAT)=>t?hooks(t).format(e).replace("Invalid date",DEFAULT_VALUE$1):DEFAULT_VALUE$1,validateNumber=t=>typeof t=="number"?!0:typeof t=="string"?!isNaN(parseFloat(t)):!1;function digitUppercase(t){const e=["角","分"],n=["零","壹","贰","叁","肆","伍","陆","柒","捌","玖"],r=[["元","万","亿"],["","拾","佰","仟"]],i=t<0?"负":"";t=Math.abs(t);let g="";for(let y=0;y<e.length;y++)g+=(n[Math.floor(t*10*Math.pow(10,y))%10]+e[y]).replace(/零./,"");g=g||"整",t=Math.floor(t);for(let y=0;y<r[0].length&&t>0;y++){let k="";for(let L=0;L<r[1].length&&t>0;L++)k=n[t%10]+r[1][L]+k,t=Math.floor(t/10);g=k.replace(/(零.)*零$/,"").replace(/^$/,"零")+r[0][y]+g}return i+g.replace(/(零.)*零元/,"元").replace(/(零.)+/g,"零").replace(/^整$/,"零元整")}const _sfc_main$r=vue.defineComponent({name:"zh-date-picker",__name:"DatePicker",props:{style:{},class:{},modelValue:{}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,r=e,i=k=>Array.isArray(k)?[dateFormat(k[0],LOG_DATE_FORMAT_T),dateFormat(k[1],LOG_DATE_FORMAT_END)]:k&&dateFormat(k,LOG_DATE_FORMAT_T),g=k=>{const L=i(k);r("update:modelValue",L)},y=k=>{const L=i(k);r("change",L)};return(k,L)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass([n.class,"zh-date-picker"])},[vue.createVNode(vue.unref(ElDatePicker),vue.mergeProps(k.$attrs,{style:n.style,"model-value":n.modelValue,"onUpdate:modelValue":g,onChange:y}),null,16,["style","model-value"])],2))}}),ZhDatePicker=withInstall$1(_sfc_main$r),_hoisted_1$h={class:"info-pair"},_hoisted_2$b={class:"info-pair--title"},_hoisted_3$b={key:0,class:"info-pair--title--tip"},_sfc_main$q=vue.defineComponent({name:"zh-detail-sub-title",__name:"DetailSubTitle",props:{title:{},value:{},ellipsis:{type:Boolean},tip:{}},setup(t){const e=t;return(n,r)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$h,[vue.createElementVNode("div",_hoisted_2$b,[vue.createTextVNode(vue.toDisplayString(e.title)+" ",1),n.tip?(vue.openBlock(),vue.createElementBlock("div",_hoisted_3$b,vue.toDisplayString(n.tip),1)):vue.createCommentVNode("",!0)]),vue.createElementVNode("div",{class:vue.normalizeClass(["info-pair--value",{ellipsis:n.ellipsis}])},[vue.renderSlot(n.$slots,"value",{},()=>[vue.createTextVNode(vue.toDisplayString(e.value||vue.unref(DEFAULT_VALUE$1)),1)])],2)]))}}),ZhDetailSubTitle=withInstall$1(_sfc_main$q),_hoisted_1$g={class:"title"},_hoisted_2$a={key:0,class:"sub-title"},_hoisted_3$a={class:"zh-dialog__footer"},_sfc_main$p=vue.defineComponent({name:"ZhDialog",inheritAttrs:!1,__name:"Dialog",props:vue.mergeModels({title:{},subTitle:{},cancelButtonText:{default:"取消"},confirmButtonText:{default:"确定"},confirmButtonDisabled:{type:Boolean,default:!1},closeOnClickModal:{type:Boolean,default:!1},size:{default:"middle"},width:{},appendToBody:{type:Boolean},appendTo:{},beforeClose:{},destroyOnClose:{type:Boolean},closeOnPressEscape:{type:Boolean},lockScroll:{type:Boolean},modal:{type:Boolean},openDelay:{},closeDelay:{},top:{},modelValue:{type:Boolean},modalClass:{},zIndex:{},trapFocus:{type:Boolean},headerAriaLevel:{},center:{type:Boolean},alignCenter:{type:Boolean},closeIcon:{},draggable:{type:Boolean},overflow:{type:Boolean},fullscreen:{type:Boolean},showClose:{type:Boolean},ariaLevel:{}},{modelValue:{type:Boolean,default:!0},modelModifiers:{}}),emits:vue.mergeModels(["submit","close"],["update:modelValue"]),setup(t,{emit:e}){const n=t,r=vue.useModel(t,"modelValue"),i=e,g=()=>{i("close")},y=()=>{i("submit")},k=()=>{i("close")},L={small:"400px",middle:"600px",large:"800px",extraLarge:"920px"},$=vue.computed(()=>n.width?n.width:L[n.size]);return(V,z)=>(vue.openBlock(),vue.createBlock(vue.unref(ElDialog),vue.mergeProps({modelValue:r.value,"onUpdate:modelValue":z[0]||(z[0]=re=>r.value=re),class:"zh-dialog"},V.$attrs,{width:$.value,"close-on-click-modal":V.closeOnClickModal,onClose:k}),{header:vue.withCtx(()=>[vue.renderSlot(V.$slots,"header",{},()=>[vue.createElementVNode("div",_hoisted_1$g,vue.toDisplayString(V.title),1),V.subTitle?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$a,vue.toDisplayString(V.subTitle),1)):vue.createCommentVNode("",!0)])]),footer:vue.withCtx(()=>[vue.renderSlot(V.$slots,"footer",{},()=>[vue.createElementVNode("div",_hoisted_3$a,[vue.createVNode(ZhButton$1,{onClick:g},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(V.cancelButtonText),1)]),_:1}),vue.createVNode(ZhButton$1,{type:"primary",disabled:V.confirmButtonDisabled,onClick:y},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(V.confirmButtonText),1)]),_:1},8,["disabled"])])])]),default:vue.withCtx(()=>[vue.renderSlot(V.$slots,"default")]),_:3},16,["modelValue","width","close-on-click-modal"]))}}),ZhDialog=withInstall$1(_sfc_main$p),_hoisted_1$f={class:"info-pair"},_hoisted_2$9={class:"info-pair--title"},_hoisted_3$9={key:0,class:"info-pair--title--tip"},_sfc_main$o=vue.defineComponent({name:"zh-edit-info-pair",__name:"EditInfoPair",props:{title:{},value:{},ellipsis:{type:Boolean},tip:{}},setup(t){const e=t;return(n,r)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$f,[vue.createElementVNode("div",_hoisted_2$9,[vue.createTextVNode(vue.toDisplayString(e.title)+" ",1),n.tip?(vue.openBlock(),vue.createElementBlock("div",_hoisted_3$9,vue.toDisplayString(n.tip),1)):vue.createCommentVNode("",!0)]),vue.createElementVNode("div",{class:vue.normalizeClass(["info-pair--value",{ellipsis:n.ellipsis}])},[vue.renderSlot(n.$slots,"value",{},()=>[vue.createTextVNode(vue.toDisplayString(e.value||vue.unref(DEFAULT_VALUE$1)),1)],!0)],2)]))}}),EditInfoPair=_export_sfc(_sfc_main$o,[["__scopeId","data-v-c62707eb"]]),ZhEditInfoPair=withInstall$1(EditInfoPair),_hoisted_1$e={class:"file_wrapper"},_hoisted_2$8={key:0,class:"header"},_hoisted_3$8={class:"file_main"},_hoisted_4$5={class:"file"},_hoisted_5$5={class:"file_name"},_sfc_main$n=vue.defineComponent({name:"zh-file-wrapper",__name:"FileWrapper",props:{downLoadUrl:{type:String,default:""},canPreview:{type:Boolean,default:!1},fileName:{type:String,default:DEFAULT_VALUE$1},canDelete:{type:Boolean,default:!1},title:{type:String,default:""},fileId:{type:Number,default:0}},emits:["deleteFile"],setup(t,{emit:e}){const n=t,r=e,i=()=>{n.canDelete&&r("deleteFile",n.fileId)};return(g,y)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$e,[n.title?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$8,vue.toDisplayString(n.title),1)):vue.createCommentVNode("",!0),vue.createElementVNode("div",_hoisted_3$8,[vue.createElementVNode("div",_hoisted_4$5,[y[0]||(y[0]=vue.createElementVNode("div",{class:"file_type mr-12"},[vue.createElementVNode("i",{class:"iconfont icon-xiangmuguanli"})],-1)),vue.createElementVNode("div",_hoisted_5$5,vue.toDisplayString(n.fileName),1)]),vue.createVNode(vue.unref(ElLink),{size:"small",class:"btn",link:"",style:{width:"80px"},href:n.downLoadUrl,underline:!1,download:"download"},{default:vue.withCtx(()=>y[1]||(y[1]=[vue.createTextVNode(" 查看/下载 ")])),_:1},8,["href"]),t.canDelete?(vue.openBlock(),vue.createElementBlock("i",{key:0,class:"iconfont icon-close close",onClick:i})):vue.createCommentVNode("",!0)])]))}}),FileWrapper=_export_sfc(_sfc_main$n,[["__scopeId","data-v-d98ece31"]]),ZhFileWrapper=withInstall$1(FileWrapper),_sfc_main$m=vue.defineComponent({name:"Grid",__name:"Grid",props:{cols:{default:()=>({xs:1,sm:2,md:2,lg:4,xl:4})},collapsed:{type:Boolean,default:!1},collapsedRows:{default:1},gap:{default:16}},setup(t,{expose:e}){const n=t;vue.onBeforeMount(()=>n.collapsed&&L()),vue.onMounted(()=>{r({target:{innerWidth:window.innerWidth}}),window.addEventListener("resize",r)}),vue.onActivated(()=>{r({target:{innerWidth:window.innerWidth}}),window.addEventListener("resize",r)}),vue.onUnmounted(()=>{window.removeEventListener("resize",r)}),vue.onDeactivated(()=>{window.removeEventListener("resize",r)});const r=oe=>{let j=oe.target.innerWidth;switch(!!j){case j<768:i.value="xs";break;case(j>=768&&j<992):i.value="sm";break;case(j>=992&&j<1200):i.value="md";break;case(j>=1200&&j<1920):i.value="lg";break;case j>=1920:i.value="xl";break}};vue.provide("gap",Array.isArray(n.gap)?n.gap[0]:n.gap);let i=vue.ref("xl");vue.provide("breakPoint",i);const g=vue.ref(-1);vue.provide("shouldHiddenIndex",g);const y=vue.computed(()=>typeof n.cols=="object"?n.cols[i.value]??n.cols:n.cols);vue.provide("cols",y);const k=vue.useSlots().default(),L=()=>{var ae,ue,de,pe;let oe=[],j=null;k.forEach(le=>{var he;typeof le.type=="object"&&le.type.name==="GridItem"&&((he=le.props)==null?void 0:he.suffix)!==void 0&&(j=le),typeof le.type=="symbol"&&Array.isArray(le.children)&&oe.push(...le.children)});let ie=0;j&&(ie=(((ae=j.props[i.value])==null?void 0:ae.span)??((ue=j.props)==null?void 0:ue.span)??1)+(((de=j.props[i.value])==null?void 0:de.offset)??((pe=j.props)==null?void 0:pe.offset)??0));try{let le=!1;oe.reduce((he=0,_e,Ce)=>{var xe,Ie,Ne,Ue;if(he+=(((xe=_e.props[i.value])==null?void 0:xe.span)??((Ie=_e.props)==null?void 0:Ie.span)??1)+(((Ne=_e.props[i.value])==null?void 0:Ne.offset)??((Ue=_e.props)==null?void 0:Ue.offset)??0),Number(he)>n.collapsedRows*y.value-ie)throw g.value=Ce,le=!0,"find it";return he},0),le||(g.value=-1)}catch{}};vue.watch(()=>i.value,()=>{n.collapsed&&L()}),vue.watch(()=>n.collapsed,oe=>{if(oe)return L();g.value=-1});const $=vue.computed(()=>typeof n.gap=="number"?`${n.gap}px`:Array.isArray(n.gap)?`${n.gap[1]}px ${n.gap[0]}px`:"unset"),V=vue.computed(()=>({display:"grid",gridGap:$.value,gridTemplateColumns:`repeat(${y.value}, minmax(0, 1fr))`})),z=vue.inject("clearGridItemData",()=>{}),re=vue.ref(!1);return vue.onMounted(()=>{re.value=!0}),vue.onBeforeUpdate(()=>{re.value=!1,z()}),vue.onUpdated(()=>{re.value=!0}),vue.provide("isRegistrationComplete",re),e({breakPoint:i}),(oe,j)=>(vue.openBlock(),vue.createElementBlock("div",{style:vue.normalizeStyle(V.value)},[vue.renderSlot(oe.$slots,"default")],4))}}),_sfc_main$l=vue.defineComponent({name:"GridItem",__name:"GridItem",props:{offset:{default:0},span:{default:1},suffix:{type:Boolean,default:!1},xs:{default:void 0},sm:{default:void 0},md:{default:void 0},lg:{default:void 0},xl:{default:void 0},label:{}},setup(t){const e=t,n=vue.useAttrs(),r=vue.ref(!0),i=vue.inject("breakPoint",vue.ref("xl")),g=vue.inject("shouldHiddenIndex",vue.ref(-1));vue.watch(()=>[g.value,i.value],de=>{n.index&&(r.value=!(de[0]!==-1&&parseInt(n.index)>=Number(de[0])))},{immediate:!0});const y=vue.inject("gap",0),k=vue.inject("cols",vue.ref(4)),L=vue.computed(()=>{var le,he;let de=((le=e[i.value])==null?void 0:le.span)??e.span,pe=((he=e[i.value])==null?void 0:he.offset)??e.offset;return e.suffix?{gridColumnStart:k.value-de-pe+1,gridColumnEnd:`span ${de+pe}`,marginLeft:pe!==0?`calc(((100% + ${y}px) / ${de+pe}) * ${pe})`:"unset"}:{gridColumn:`span ${de+pe>k.value?k.value:de+pe}/span ${de+pe>k.value?k.value:de+pe}`,marginLeft:pe!==0?`calc(((100% + ${y}px) / ${de+pe}) * ${pe})`:"unset"}}),$=vue.inject("gridItemData",vue.reactive({})),V=vue.inject("isMultiGrid",vue.ref(!1)),z=vue.ref(null),re=vue.ref(0),oe=vue.ref(0),j=vue.inject("registerGridItem",null),ie=vue.inject("getColumnData",null),ae=vue.inject("isRegistrationComplete",vue.ref(!1)),ue=()=>{if(z.value&&j){const de=z.value.parentElement;if(de){const pe=z.value.offsetLeft,le=de.offsetWidth/k.value;oe.value=Math.floor(pe/le)+1,le&&j(oe.value,e.label||"")}}};return vue.watchEffect(()=>{if(V.value&&ae.value&&e.label&&z.value&&(ue(),ie)){const de=ie(oe.value);re.value=de.maxWidth||0}}),vue.watch($,()=>{if(ie){const de=ie(oe.value);de.maxWidth!==re.value&&(re.value=de.maxWidth)}}),(de,pe)=>vue.withDirectives((vue.openBlock(),vue.createElementBlock("div",{style:vue.normalizeStyle(L.value),ref_key:"gridItemRef",ref:z},[vue.renderSlot(de.$slots,"default",{maxLabelWidthInCol:re.value,columnIndex:oe.value})],4)),[[vue.vShow,r.value]])}}),DEFAULT_FONT_SIZE=12;function findItemNested(t,e,n,r){return t.reduce((i,g)=>{if(i)return i;if(g[n]===e)return g;if(g[r])return findItemNested(g[r],e,n,r)},null)}function getValueByProp(t,e,n){const r=isUndefined$2(n)?DEFAULT_VALUE$1:n,i=get$5(t,e);return isNil(i)||i===""?r:i}const $get=getValueByProp;function handleProp(t){const e=t.split(".");return e.length==1?t:e[e.length-1]}function filterEnum(t,e,n,r){const i=(n==null?void 0:n.value)??"value",g=(n==null?void 0:n.label)??"label",y=(n==null?void 0:n.children)??"children";let k={};return Array.isArray(e)&&(k=findItemNested(e,t,i,y)),r=="tag"?k!=null&&k.tagType?k.tagType:"":k?k[g]:DEFAULT_VALUE$1}function filterEnumObj(t,e,n){const r="value",i="children";let g={};return Array.isArray(e)&&(g=findItemNested(e,t,r,i)),g}function formatValue(t){return isArray$2(t)?t.length?t.join(" / "):DEFAULT_VALUE$1:t??DEFAULT_VALUE$1}function handleRowAccordingToProp(t,e){return e.includes(".")?(e.split(".").forEach(n=>t=t[n]??DEFAULT_VALUE$1),t):t[e]??DEFAULT_VALUE$1}const getWidthByText=(t,e)=>{const n=e||DEFAULT_FONT_SIZE,i=document.createElement("canvas").getContext("2d");return i.font=`${n}px Microsoft YaHei`,i.measureText(t).width},useColSetting=t=>{const e=t||"zhihao-col-setting",n=()=>{const k=localStorage.getItem(e);return k?JSON.parse(k):{}},r=k=>{localStorage.setItem(e,JSON.stringify(k))};return{getMap:n,setMap:r,getColumnCache:k=>n()[k]||[],setColumnCache:(k,L)=>{const $=n();$[k]=L,r($)},removeColumnCache:k=>{const L=n();delete L[k],r(L)}}},collectGridItems=()=>{let t=vue.reactive({});return{gridItemData:t,registerGridItem:(i,g)=>{var k;if(!g)return;t[i]||(t[i]={labels:[],maxLength:0,maxWidth:0}),(k=t[i])==null||k.labels.push(g),t[i].maxLength=Math.max(g.length,t[i].maxLength);const y=Math.ceil(getWidthByText(g,14));t[i].maxWidth=Math.max(y||0,t[i].maxWidth)},getColumnData:i=>t[i]||{},clearGridItemData:()=>{t=vue.reactive({})}}},_hoisted_1$d={class:"multi-grid"},_sfc_main$k=vue.defineComponent({name:"MultiGrid",__name:"MultiGrid",setup(t){const{getColumnData:e,registerGridItem:n,clearGridItemData:r,gridItemData:i}=collectGridItems();return vue.provide("registerGridItem",n),vue.provide("getColumnData",e),vue.provide("clearGridItemData",r),vue.provide("gridItemData",i),vue.provide("isMultiGrid",vue.ref(!0)),(g,y)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$d,[vue.renderSlot(g.$slots,"default")]))}}),ZhGrid=withInstall$1(_sfc_main$m),ZhGridItem=withInstall$1(_sfc_main$l),ZhMultiGrid=withInstall$1(_sfc_main$k),_hoisted_1$c={class:"info-pair"},_hoisted_2$7={class:"info-pair--title"},_hoisted_3$7={key:0,class:"info-pair--title--tip"},_sfc_main$j=vue.defineComponent({name:"zh-info-pair",__name:"InfoPair",props:{title:{},value:{},ellipsis:{type:Boolean},tip:{}},setup(t){const e=t;return(n,r)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$c,[vue.createElementVNode("div",_hoisted_2$7,[vue.createTextVNode(vue.toDisplayString(e.title)+" ",1),n.tip?(vue.openBlock(),vue.createElementBlock("div",_hoisted_3$7,vue.toDisplayString(n.tip),1)):vue.createCommentVNode("",!0)]),vue.createElementVNode("div",{class:vue.normalizeClass(["info-pair--value",{ellipsis:n.ellipsis}])},[vue.renderSlot(n.$slots,"value",{},()=>[vue.createTextVNode(vue.toDisplayString(e.value||vue.unref(DEFAULT_VALUE$1)),1)],!0)],2)]))}}),InfoPair=_export_sfc(_sfc_main$j,[["__scopeId","data-v-5a1b0655"]]),ZhInfoPair=withInstall$1(InfoPair),_sfc_main$i=vue.defineComponent({name:"zh-input",__name:"Input",props:vue.mergeModels({style:{},class:{default:"zh-default-input"},size:{default:"default"},className:{}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=vue.useAttrs(),n=t,r=vue.useModel(t,"modelValue"),i=()=>{(e.max||Number(e.max)===0)&&Number(r.value)>=e.max&&(r.value=e.max.toString()),(e.min||Number(e.min)===0)&&Number(r.value)<=e.min&&(r.value=e.min.toString())};return(g,y)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(n.class)},[vue.createVNode(vue.unref(ElInput),vue.mergeProps(g.$attrs,{modelValue:r.value,"onUpdate:modelValue":y[0]||(y[0]=k=>r.value=k),size:g.size,onBlur:i}),vue.createSlots({_:2},[vue.renderList(g.$slots,(k,L)=>({name:k,fn:vue.withCtx($=>[vue.renderSlot(g.$slots,k,vue.normalizeProps(vue.guardReactiveProps($)),void 0,!0)])}))]),1040,["modelValue","size"])],2))}}),Input=_export_sfc(_sfc_main$i,[["__scopeId","data-v-ce1df798"]]),ZhInput=withInstall$1(Input),_sfc_main$h=vue.defineComponent({name:"zh-input-number",__name:"InputNumber",props:{style:{},class:{},modelValue:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e,i=vue.useAttrs(),g=($,V=0,z=0,re=0)=>{let oe=($==null?void 0:$.toString())??"",j,ie,ae;return z===0?(oe=oe.replace(/[^\d]/g,""),oe=oe.replace(/^0\d+/g,"0"),V!==0&&(oe=oe.slice(0,V))):(oe=oe.replace(/[^\-\d.]/g,""),oe=oe.replace(/^[^\-\d]/g,""),oe=oe.replace(/\.{2}/g,"."),oe=oe.replace(/^0(\d+)/g,"$1"),j=oe.split(".")||[],j.length>1?(V===0?ie=j[0]:ie=j[0].slice(0,V),ae=j[1].slice(0,z),oe=ie+"."+ae):V!==0&&(oe=oe.slice(0,V))),re!==0&&(oe=oe.slice(0,re)),oe},y=()=>{n.modelValue===""||n.modelValue===void 0||(i.max&&Number(n.modelValue)>i.max&&r("update:modelValue",i.max.toString()),i.min&&Number(n.modelValue)<i.min&&r("update:modelValue",i.min.toString()))},k=$=>$?g($,i.integer,i.precision,i.maxLength):"",L=$=>{/^\d+\.0*$/.test(($==null?void 0:$.toString())||"")||$===""?r("update:modelValue",k($)):r("update:modelValue",Number(k($)))};return($,V)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["input-number",n.class]),style:vue.normalizeStyle(n.style)},[vue.createVNode(vue.unref(ElInput),vue.mergeProps($.$attrs,{"model-value":n.modelValue,"onUpdate:modelValue":L,onBlur:y,style:{width:"100%"},formatter:k}),vue.createSlots({_:2},[vue.renderList(Object.keys($.$slots),z=>({name:z,fn:vue.withCtx(re=>[vue.renderSlot($.$slots,z,vue.normalizeProps(vue.guardReactiveProps(re)),void 0,!0)])}))]),1040,["model-value"])],6))}}),InputNumber=_export_sfc(_sfc_main$h,[["__scopeId","data-v-920e8405"]]),ZhInputNumber=withInstall$1(InputNumber),_hoisted_1$b={class:"loading-box"},_sfc_main$g=vue.defineComponent({name:"zh-loading",__name:"Loading",setup(t){return(e,n)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$b,n[0]||(n[0]=[vue.createElementVNode("div",{class:"loading-wrap"},[vue.createElementVNode("span",{class:"dot dot-spin"},[vue.createElementVNode("i"),vue.createElementVNode("i"),vue.createElementVNode("i"),vue.createElementVNode("i")])],-1)])))}}),Loading=_export_sfc(_sfc_main$g,[["__scopeId","data-v-d30f17c3"]]),ZhLoading=withInstall$1(Loading),defaultOptions={type:"",showCancelButton:!0,showConfirmButton:!0,cancelButtonText:"取消",confirmButtonText:"确定",closeOnClickModal:!1,closeOnPressEscape:!1,showClose:!0,draggable:!1,center:!1,roundButton:!1},ZhMessageBox$1={confirm(t,e,n={}){return ElMessageBox.confirm(t,e,{...defaultOptions,...n,customClass:"zh-message-box zh-message-confirm"})},alert(t,e,n={}){return ElMessageBox.alert(t,e,{...defaultOptions,...n,showCancelButton:!1,customClass:"zh-message-box zh-message-alert"})},prompt(t,e,n={}){return ElMessageBox.prompt(t,e,{...defaultOptions,...n,customClass:"zh-message-box zh-message-prompt"})}},ZhConfirm=ZhMessageBox$1.confirm,ZhAlert=ZhMessageBox$1.alert,ZhPrompt=ZhMessageBox$1.prompt,ZhMessageBox=withInstall$1(ZhMessageBox$1),_sfc_main$f=vue.defineComponent({name:"zh-money-input",__name:"MoneyInput",props:vue.mergeModels({style:{},class:{},showTooltip:{type:Boolean,default:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,n=vue.useModel(t,"modelValue"),r=vue.computed(()=>{if(n.value)return validateNumber(n.value)&&Number(n.value)>=1e3?digitUppercase(Number(n.value)):""}),i=vue.ref(!1);return(g,y)=>(vue.openBlock(),vue.createBlock(vue.unref(ElTooltip),{effect:"dark",content:r.value,placement:"top",visible:g.showTooltip&&i.value&&!!r.value},{default:vue.withCtx(()=>[vue.createVNode(InputNumber,vue.mergeProps(g.$attrs,{modelValue:n.value,"onUpdate:modelValue":y[0]||(y[0]=k=>n.value=k),style:e.style,class:e.class,onFocus:y[1]||(y[1]=()=>i.value=!0),onBlur:y[2]||(y[2]=()=>i.value=!1)}),vue.createSlots({_:2},[vue.renderList(Object.keys(g.$slots),k=>({name:k,fn:vue.withCtx(L=>[vue.renderSlot(g.$slots,k,vue.normalizeProps(vue.guardReactiveProps(L)),void 0,!0)])}))]),1040,["modelValue","style","class"])]),_:3},8,["content","visible"]))}}),MoneyInput=_export_sfc(_sfc_main$f,[["__scopeId","data-v-cfd94d9e"]]),ZhMoneyInput=withInstall$1(MoneyInput),_hoisted_1$a={class:"page-head"},_hoisted_2$6={class:"left-wrap"},_hoisted_3$6={class:"page-name"},_hoisted_4$4={class:"value"},_hoisted_5$4={class:"other-inform"},_hoisted_6$4={class:"label"},_hoisted_7$4={class:"value mg-r-24"},_hoisted_8$3={class:"status"},_sfc_main$e=vue.defineComponent({name:"zh-page-head-panel",__name:"PageHeadPanel",props:{dataSource:{}},setup(t){const e=t,{name:n,no:r,status:i,extendLabel:g,extendValue:y}=vue.toRefs(e.dataSource);return(k,L)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$a,[vue.createElementVNode("div",_hoisted_2$6,[vue.createElementVNode("span",_hoisted_3$6,vue.toDisplayString(vue.unref(n)),1),vue.createElementVNode("div",null,[L[0]||(L[0]=vue.createElementVNode("span",{class:"label mg-l-16"},"编号",-1)),vue.createElementVNode("span",_hoisted_4$4,vue.toDisplayString(vue.unref(r)),1)])]),vue.createElementVNode("div",_hoisted_5$4,[vue.renderSlot(k.$slots,"extend",{},()=>[vue.createElementVNode("span",_hoisted_6$4,vue.toDisplayString(vue.unref(g)),1),vue.createElementVNode("span",_hoisted_7$4,vue.toDisplayString(vue.unref(y)),1)],!0),vue.createElementVNode("span",_hoisted_8$3,vue.toDisplayString(vue.unref(i)),1)])]))}}),PageHeadPanel=_export_sfc(_sfc_main$e,[["__scopeId","data-v-9f56969d"]]),ZhPageHeadPanel=withInstall$1(PageHeadPanel),_sfc_main$d=vue.defineComponent({name:"zh-tool-tips",__name:"ToolTips",props:{placement:{default:"top"},content:{}},setup(t){const e=t;return(n,r)=>(vue.openBlock(),vue.createBlock(vue.unref(ElTooltip),{class:"box-item",effect:"dark",content:e.content,placement:e.placement},{default:vue.withCtx(()=>[vue.renderSlot(n.$slots,"default",{},()=>[r[0]||(r[0]=vue.createElementVNode("i",{class:"iconfont icon-Frame2"},null,-1))],!0)]),_:3},8,["content","placement"]))}}),ToolTips=_export_sfc(_sfc_main$d,[["__scopeId","data-v-e5a0ae09"]]),ZhToolTips=withInstall$1(ToolTips),_sfc_main$c=vue.defineComponent({name:"ZhBaseInfo",__name:"BaseInfo",props:{contentWidth:{default:void 0},labelWidth:{default:"70px"},infoDirection:{default:"vertical"},cols:{default:5},gap:{default:16}},setup(t){const e=t,n=vue.ref(),r=vue.ref(),i=vue.ref();vue.provide("infoLabelWidth",n),vue.provide("infoContentWidth",r),vue.provide("infoDirection",i);function g(){n.value=e.labelWidth}function y(){r.value=e.contentWidth}function k(){i.value=e.infoDirection}return vue.watch(()=>e.contentWidth,()=>y(),{immediate:!0}),vue.watch(()=>e.labelWidth,()=>g(),{immediate:!0}),vue.watch(()=>e.infoDirection,()=>k(),{immediate:!0}),(L,$)=>{const V=vue.resolveComponent("grid");return vue.openBlock(),vue.createBlock(V,{cols:L.cols,gap:L.gap},{default:vue.withCtx(()=>[vue.renderSlot(L.$slots,"default")]),_:3},8,["cols","gap"])}}}),ZhBaseInfo=withInstall$1(_sfc_main$c),_hoisted_1$9={class:"common-card"},_hoisted_2$5={class:"detail-header"},_hoisted_3$5={class:"detail-header--left"},_hoisted_4$3={class:"title common-title"},_hoisted_5$3={class:"info-pair--label"},_hoisted_6$3={class:"info-pair--value"},_hoisted_7$3={key:1,class:"detail-header--right"},_hoisted_8$2={class:"info-pair--label"},_hoisted_9$1={class:"info-pair--value"},_sfc_main$b=vue.defineComponent({name:"ZhDetailHeader",__name:"DetailHeader",props:{title:{},leftInfos:{},rightInfos:{},stateMeta:{},stateDesc:{}},setup(t){const e=vue.useSlots(),n=t;return(r,i)=>{var g,y;return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$9,[vue.createElementVNode("div",null,[vue.renderSlot(r.$slots,"menu",{},void 0,!0)]),vue.createElementVNode("div",_hoisted_2$5,[vue.createElementVNode("div",_hoisted_3$5,[vue.createElementVNode("div",_hoisted_4$3,vue.toDisplayString(n.title),1),vue.renderSlot(r.$slots,"extra-info",{},void 0,!0),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(n.leftInfos,k=>(vue.openBlock(),vue.createElementBlock("div",{class:"info-pair",key:k.value},[vue.createElementVNode("div",_hoisted_5$3,vue.toDisplayString(k.label),1),vue.createElementVNode("div",_hoisted_6$3,vue.toDisplayString(k.value??vue.unref(DEFAULT_VALUE$1)),1)]))),128))]),vue.renderSlot(r.$slots,"default",{},void 0,!0),vue.unref(e)["right-infos"]?vue.renderSlot(r.$slots,"right-infos",{key:0},void 0,!0):(vue.openBlock(),vue.createElementBlock("div",_hoisted_7$3,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(n.rightInfos,k=>(vue.openBlock(),vue.createElementBlock("div",{class:"info-pair",key:k.value},[vue.createElementVNode("div",_hoisted_8$2,vue.toDisplayString(k.label),1),vue.createElementVNode("div",_hoisted_9$1,vue.toDisplayString(k.value??vue.unref(DEFAULT_VALUE$1)),1)]))),128)),r.stateDesc||r.stateMeta?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(["state common-title",(g=r.stateMeta)==null?void 0:g.state])},vue.toDisplayString(r.stateDesc||((y=r.stateMeta)==null?void 0:y.intro)),3)):vue.createCommentVNode("",!0)]))])])}}}),DetailHeader=_export_sfc(_sfc_main$b,[["__scopeId","data-v-8b185816"]]),ZhDetailHeader=withInstall$1(DetailHeader);var DIY_DATA_TYPE=(t=>(t.AUTOCOMPLETE="autocomplete",t.FORMAT="format",t.TEXT="text",t))(DIY_DATA_TYPE||{});const _hoisted_1$8={key:0},_hoisted_2$4={key:1,class:"col-edit-header"},_hoisted_3$4=["onClick"],_hoisted_4$2={key:0},_hoisted_5$2={class:"header-operation-container"},_hoisted_6$2={class:"operation-container"},_hoisted_7$2=["onClick"],ZH_DIV="$ZH_DIV$",_sfc_main$a=vue.defineComponent({name:"zh-diy-data-table",__name:"DiyDataTable",props:vue.mergeModels({isEdit:{type:Boolean,default:!1},maxRowLength:{default:50},maxColLength:{default:10},defaultMinWidth:{default:120},beforeAddRow:{},addRowText:{default:"增行"},addColumnText:{default:"增列"},customAddRow:{type:Boolean,default:!0},customAddColumn:{type:Boolean,default:!0}},{rawData:{required:!0},rawDataModifiers:{}}),emits:["update:rawData"],setup(t,{expose:e}){const n=t,r=vue.useModel(t,"rawData"),i=vue.ref([]),g=()=>{if(r.value.length===n.maxRowLength){ElMessage({message:`最多添加${n.maxRowLength}行`,type:"warning"});return}let j={};n.beforeAddRow&&(j=n.beforeAddRow(r.value)),r.value.push(j)},y=()=>{if(i.value.filter(ae=>ae.isAdd).length>=n.maxColLength){ElMessage({message:`最多添加${n.maxColLength}列`,type:"warning"});return}const ie=String(Date.now());i.value.push({prop:ie,label:"",isEditHeader:!0,isAdd:!0,maxlength:15,minWidth:150,headerMaxlength:15})},k=(j,ie)=>{i.value.splice(j,1),r.value.forEach(ae=>{delete ae[ie.prop]})},L=j=>{j===0&&i.value.forEach(ie=>{ie.isSameData&&(r.value[1][ie.prop]=r.value[0][ie.prop])}),r.value.splice(j,1)},$=(j,ie,ae)=>{ie(ae.completeList.filter(ue=>ue.includes(j)).map(ue=>({value:ue})))},V=j=>[{validator:(ie,ae,ue)=>{if(!i.value[j].label){ue(new Error("请输入表头"));return}ue()},message:"请输入表头",trigger:["blur","change"]}],z=j=>{const ie=[];return j.required&&ie.push({required:!0,message:"请输入"+j.label,trigger:j.slot?void 0:"blur"}),j.varidate&&ie.push({validator:(ae,ue,de)=>{const pe=j.varidate(ue);pe!==!0?de(new Error(pe)):de()},trigger:j.slot?void 0:"blur"}),ie},re=(j,ie)=>{let ae=j;return ie.isSameData&&(ae=r.value[0]||DEFAULT_VALUE$1),ie.formatter?ie.showFormatter?ie.type===DIY_DATA_TYPE.FORMAT?ie.showFormatter(ie.formatter(ae)):ie.showFormatter(ae[ie.prop]):ie.formatter(ae[ie.prop]):ae[ie.prop]||DEFAULT_VALUE$1},oe=vue.ref();return e({initData:(j,ie)=>{console.log("initData",j,ie),j=cloneDeep(j)||[],j.length===0&&j.push({}),ie=[...ie];for(const ae in j[0])if(!ie.some(ue=>ue.prop===ae)){const ue=Date.now()+ae,de=ae.split(ZH_DIV);if(de.length!==2){console.log("keySplit 失败",ae);continue}const pe=Number(de[1]);ie[pe]={prop:ae,isEditHeader:!0,label:de[0],key:ue,isAdd:!0,maxlength:15,headerMaxlength:15}}r.value=j,i.value=ie},getData:async()=>{await oe.value.validate();for(const ie in i.value){const ae=i.value[ie];for(const ue of i.value)if(ae.prop!==ue.prop&&ae.label===ue.label){ElMessage({message:"所有列的表头不可重复",type:"warning"});return}}const j=cloneDeep(r.value);for(const ie in j){const ae=j[ie];for(const ue in i.value){const de=i.value[ue];if(de.isSameData&&ie!=="0"&&(ae[de.prop]=j[0][de.prop]),de.varidate&&!de.varidate(ae[de.prop]))return;if(de.isAdd){const pe=ae[de.prop];delete ae[de.prop];const le=de.label+ZH_DIV+ue;ae[le]=pe}de.formatter&&de.type===DIY_DATA_TYPE.FORMAT&&(ae[de.prop]=de.formatter(ae))}}return console.log("DiyDataTable 获取数据",j,i.value),{data:j,columns:i.value}},updateColumn:(j,ie)=>{const ae=i.value[j].prop;if(i.value[j]=ie,ae!==ie.prop)for(const ue of r.value)ue[ie.prop]=ue[ae],delete ue[ae]},resetColumns:j=>{const ae=i.value.filter(de=>!de.isAdd).reduce((de,pe)=>(j.some(le=>le.prop===pe.prop)||de.push(pe.prop),de),[]);r.value.forEach(de=>{ae.forEach(pe=>{delete de[pe]})});const ue=j.filter(de=>de.isAdd);i.value=[...j,...ue]},onAddRow:g,onAddColumn:y}),(j,ie)=>(vue.openBlock(),vue.createBlock(vue.unref(ElForm),{class:"diy-data-table",model:t.rawData,ref_key:"formRef",ref:oe},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElTable),vue.mergeProps({data:r.value},j.$attrs),{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElTableColumn),{type:"index",label:"序号",width:"132",fixed:"left"}),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(i.value,(ae,ue)=>(vue.openBlock(),vue.createBlock(vue.unref(ElTableColumn),{key:ae.key||ue,prop:ae.prop,label:ae.label,width:ae.width,"min-width":ae.minWidth||j.defaultMinWidth,fixed:ae.fixed},{header:vue.withCtx(()=>[j.isEdit?ae.isEditHeader?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$4,[vue.createVNode(vue.unref(ElFormItem),{prop:`columns.${ue}`,rules:V(ue)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:ae.label,"onUpdate:modelValue":de=>ae.label=de,maxlength:ae.headerMaxlength||20,placeholder:"请输入表头"},null,8,["modelValue","onUpdate:modelValue","maxlength"])]),_:2},1032,["prop","rules"]),ae.isAdd?(vue.openBlock(),vue.createElementBlock("i",{key:0,class:"iconfont icon-close",onClick:de=>k(ue,ae)},null,8,_hoisted_3$4)):vue.createCommentVNode("",!0)])):(vue.openBlock(),vue.createElementBlock("div",{key:2,class:vue.normalizeClass({"is-required-label":ae.required})},vue.toDisplayString(ae.label),3)):(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$8,vue.toDisplayString(ae.label),1))]),default:vue.withCtx(de=>[n.isEdit&&(!ae.isSameData||de.$index===0)&&ae.type!==vue.unref(DIY_DATA_TYPE).TEXT?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:0,prop:`${de.$index}.${ae.prop}`,rules:z(ae),class:vue.normalizeClass(["col-edit-container",{"close-padding":ae.isAdd}])},{default:vue.withCtx(()=>[ae.type===vue.unref(DIY_DATA_TYPE).FORMAT&&ae.formatter?(vue.openBlock(),vue.createElementBlock("div",_hoisted_4$2,vue.toDisplayString(ae.showFormatter?ae.showFormatter(ae.formatter(de.row)):ae.formatter(de.row)),1)):ae.type===vue.unref(DIY_DATA_TYPE).AUTOCOMPLETE?(vue.openBlock(),vue.createBlock(vue.unref(ElAutocomplete),{key:1,modelValue:de.row[ae.prop],"onUpdate:modelValue":pe=>de.row[ae.prop]=pe,placeholder:ae.placeholder||"请输入","fetch-suggestions":(pe,le)=>$(pe,le,ae),maxlength:ae.maxlength||20},null,8,["modelValue","onUpdate:modelValue","placeholder","fetch-suggestions","maxlength"])):ae.slot?vue.renderSlot(j.$slots,ae.slot,{key:2,row:de.row,$index:de.$index},void 0,!0):(vue.openBlock(),vue.createBlock(vue.unref(ElInput),{key:3,modelValue:de.row[ae.prop],"onUpdate:modelValue":pe=>de.row[ae.prop]=pe,placeholder:ae.placeholder||"请输入",formatter:ae.formatter,parser:ae.parser,maxlength:ae.maxlength||20},null,8,["modelValue","onUpdate:modelValue","placeholder","formatter","parser","maxlength"]))]),_:2},1032,["prop","rules","class"])):ae.slot?vue.renderSlot(j.$slots,ae.slot,{key:1,row:de.row,$index:de.$index},void 0,!0):(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:2},[vue.createTextVNode(vue.toDisplayString(re(de.row,ae)),1)],64))]),_:2},1032,["prop","label","width","min-width","fixed"]))),128)),n.isEdit?(vue.openBlock(),vue.createBlock(vue.unref(ElTableColumn),{key:0,width:"150",fixed:"right"},{header:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_5$2,[j.customAddRow?(vue.openBlock(),vue.createBlock(vue.unref(ElButton),{key:0,type:"primary",link:"",onClick:g},{default:vue.withCtx(()=>[ie[0]||(ie[0]=vue.createElementVNode("i",{class:"iconfont icon-Frame1"},null,-1)),vue.createTextVNode(vue.toDisplayString(j.addRowText),1)]),_:1})):vue.createCommentVNode("",!0),j.customAddColumn?(vue.openBlock(),vue.createBlock(vue.unref(ElButton),{key:1,type:"primary",link:"",onClick:y},{default:vue.withCtx(()=>[ie[1]||(ie[1]=vue.createElementVNode("i",{class:"iconfont icon-Frame-11"},null,-1)),vue.createTextVNode(vue.toDisplayString(j.addColumnText),1)]),_:1})):vue.createCommentVNode("",!0)])]),default:vue.withCtx(({$index:ae})=>[vue.createElementVNode("div",_hoisted_6$2,[j.$slots.operation?vue.renderSlot(j.$slots,"operation",{key:0,row:r.value[ae],$index:ae},void 0,!0):(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[r.value.length>1?(vue.openBlock(),vue.createElementBlock("i",{key:0,class:"iconfont icon-close",onClick:ue=>L(ae)},null,8,_hoisted_7$2)):vue.createCommentVNode("",!0)],64))])]),_:3})):vue.createCommentVNode("",!0)]),_:3},16,["data"])]),_:3},8,["model"]))}}),DiyDataTable=_export_sfc(_sfc_main$a,[["__scopeId","data-v-048d82d3"]]),ZhDiyDataTable=withInstall$1(DiyDataTable),METERS_PER_UNIT$1={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};class Projection{constructor(e){this.code_=e.code,this.units_=e.units,this.extent_=e.extent!==void 0?e.extent:null,this.worldExtent_=e.worldExtent!==void 0?e.worldExtent:null,this.axisOrientation_=e.axisOrientation!==void 0?e.axisOrientation:"enu",this.global_=e.global!==void 0?e.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=e.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=e.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||METERS_PER_UNIT$1[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(e){this.global_=e,this.canWrapX_=!!(e&&this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(e){this.defaultTileGrid_=e}setExtent(e){this.extent_=e,this.canWrapX_=!!(this.global_&&e)}setWorldExtent(e){this.worldExtent_=e}setGetPointResolution(e){this.getPointResolutionFunc_=e}getPointResolutionFunc(){return this.getPointResolutionFunc_}}const RADIUS$1=6378137,HALF_SIZE=Math.PI*RADIUS$1,EXTENT$1=[-HALF_SIZE,-HALF_SIZE,HALF_SIZE,HALF_SIZE],WORLD_EXTENT=[-180,-85,180,85],MAX_SAFE_Y=RADIUS$1*Math.log(Math.tan(Math.PI/2));class EPSG3857Projection extends Projection{constructor(e){super({code:e,units:"m",extent:EXTENT$1,global:!0,worldExtent:WORLD_EXTENT,getPointResolution:function(n,r){return n/Math.cosh(r[1]/RADIUS$1)}})}}const PROJECTIONS$1=[new EPSG3857Projection("EPSG:3857"),new EPSG3857Projection("EPSG:102100"),new EPSG3857Projection("EPSG:102113"),new EPSG3857Projection("EPSG:900913"),new EPSG3857Projection("http://www.opengis.net/def/crs/EPSG/0/3857"),new EPSG3857Projection("http://www.opengis.net/gml/srs/epsg.xml#3857")];function fromEPSG4326(t,e,n,r){const i=t.length;n=n>1?n:2,r=r??n,e===void 0&&(n>2?e=t.slice():e=new Array(i));for(let g=0;g<i;g+=r){e[g]=HALF_SIZE*t[g]/180;let y=RADIUS$1*Math.log(Math.tan(Math.PI*(+t[g+1]+90)/360));y>MAX_SAFE_Y?y=MAX_SAFE_Y:y<-MAX_SAFE_Y&&(y=-MAX_SAFE_Y),e[g+1]=y}return e}function toEPSG4326(t,e,n,r){const i=t.length;n=n>1?n:2,r=r??n,e===void 0&&(n>2?e=t.slice():e=new Array(i));for(let g=0;g<i;g+=r)e[g]=180*t[g]/HALF_SIZE,e[g+1]=360*Math.atan(Math.exp(t[g+1]/RADIUS$1))/Math.PI-90;return e}const RADIUS=6378137,EXTENT=[-180,-90,180,90],METERS_PER_UNIT=Math.PI*RADIUS/180;class EPSG4326Projection extends Projection{constructor(e,n){super({code:e,units:"degrees",extent:EXTENT,axisOrientation:n,global:!0,metersPerUnit:METERS_PER_UNIT,worldExtent:EXTENT})}}const PROJECTIONS=[new EPSG4326Projection("CRS:84"),new EPSG4326Projection("EPSG:4326","neu"),new EPSG4326Projection("urn:ogc:def:crs:OGC:1.3:CRS84"),new EPSG4326Projection("urn:ogc:def:crs:OGC:2:84"),new EPSG4326Projection("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new EPSG4326Projection("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new EPSG4326Projection("http://www.opengis.net/def/crs/EPSG/0/4326","neu")];let cache$1={};function get$3(t){return cache$1[t]||cache$1[t.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}function add$2(t,e){cache$1[t]=e}function clear(t){for(const e in t)delete t[e]}function isEmpty$1(t){let e;for(e in t)return!1;return!e}let transforms={};function add$1(t,e,n){const r=t.getCode(),i=e.getCode();r in transforms||(transforms[r]={}),transforms[r][i]=n}function get$2(t,e){return t in transforms&&e in transforms[t]?transforms[t][e]:null}const Relationship={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function boundingExtent(t){const e=createEmpty();for(let n=0,r=t.length;n<r;++n)extendCoordinate(e,t[n]);return e}function _boundingExtentXYs(t,e,n){const r=Math.min.apply(null,t),i=Math.min.apply(null,e),g=Math.max.apply(null,t),y=Math.max.apply(null,e);return createOrUpdate$2(r,i,g,y,n)}function buffer(t,e,n){return n?(n[0]=t[0]-e,n[1]=t[1]-e,n[2]=t[2]+e,n[3]=t[3]+e,n):[t[0]-e,t[1]-e,t[2]+e,t[3]+e]}function clone$1(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t.slice()}function closestSquaredDistanceXY(t,e,n){let r,i;return e<t[0]?r=t[0]-e:t[2]<e?r=e-t[2]:r=0,n<t[1]?i=t[1]-n:t[3]<n?i=n-t[3]:i=0,r*r+i*i}function containsCoordinate(t,e){return containsXY(t,e[0],e[1])}function containsExtent(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}function containsXY(t,e,n){return t[0]<=e&&e<=t[2]&&t[1]<=n&&n<=t[3]}function coordinateRelationship(t,e){const n=t[0],r=t[1],i=t[2],g=t[3],y=e[0],k=e[1];let L=Relationship.UNKNOWN;return y<n?L=L|Relationship.LEFT:y>i&&(L=L|Relationship.RIGHT),k<r?L=L|Relationship.BELOW:k>g&&(L=L|Relationship.ABOVE),L===Relationship.UNKNOWN&&(L=Relationship.INTERSECTING),L}function createEmpty(){return[1/0,1/0,-1/0,-1/0]}function createOrUpdate$2(t,e,n,r,i){return i?(i[0]=t,i[1]=e,i[2]=n,i[3]=r,i):[t,e,n,r]}function createOrUpdateEmpty(t){return createOrUpdate$2(1/0,1/0,-1/0,-1/0,t)}function createOrUpdateFromCoordinate(t,e){const n=t[0],r=t[1];return createOrUpdate$2(n,r,n,r,e)}function createOrUpdateFromFlatCoordinates(t,e,n,r,i){const g=createOrUpdateEmpty(i);return extendFlatCoordinates(g,t,e,n,r)}function equals$2(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function extend$3(t,e){return e[0]<t[0]&&(t[0]=e[0]),e[2]>t[2]&&(t[2]=e[2]),e[1]<t[1]&&(t[1]=e[1]),e[3]>t[3]&&(t[3]=e[3]),t}function extendCoordinate(t,e){e[0]<t[0]&&(t[0]=e[0]),e[0]>t[2]&&(t[2]=e[0]),e[1]<t[1]&&(t[1]=e[1]),e[1]>t[3]&&(t[3]=e[1])}function extendFlatCoordinates(t,e,n,r,i){for(;n<r;n+=i)extendXY(t,e[n],e[n+1]);return t}function extendXY(t,e,n){t[0]=Math.min(t[0],e),t[1]=Math.min(t[1],n),t[2]=Math.max(t[2],e),t[3]=Math.max(t[3],n)}function forEachCorner(t,e){let n;return n=e(getBottomLeft(t)),n||(n=e(getBottomRight(t)),n)||(n=e(getTopRight(t)),n)||(n=e(getTopLeft(t)),n)?n:!1}function getArea$1(t){let e=0;return isEmpty(t)||(e=getWidth(t)*getHeight(t)),e}function getBottomLeft(t){return[t[0],t[1]]}function getBottomRight(t){return[t[2],t[1]]}function getCenter$1(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function getCorner(t,e){let n;if(e==="bottom-left")n=getBottomLeft(t);else if(e==="bottom-right")n=getBottomRight(t);else if(e==="top-left")n=getTopLeft(t);else if(e==="top-right")n=getTopRight(t);else throw new Error("Invalid corner");return n}function getForViewAndSize(t,e,n,r,i){const[g,y,k,L,$,V,z,re]=getRotatedViewport(t,e,n,r);return createOrUpdate$2(Math.min(g,k,$,z),Math.min(y,L,V,re),Math.max(g,k,$,z),Math.max(y,L,V,re),i)}function getRotatedViewport(t,e,n,r){const i=e*r[0]/2,g=e*r[1]/2,y=Math.cos(n),k=Math.sin(n),L=i*y,$=i*k,V=g*y,z=g*k,re=t[0],oe=t[1];return[re-L+z,oe-$-V,re-L-z,oe-$+V,re+L-z,oe+$+V,re+L+z,oe+$-V,re-L+z,oe-$-V]}function getHeight(t){return t[3]-t[1]}function getIntersection(t,e,n){const r=n||createEmpty();return intersects$1(t,e)?(t[0]>e[0]?r[0]=t[0]:r[0]=e[0],t[1]>e[1]?r[1]=t[1]:r[1]=e[1],t[2]<e[2]?r[2]=t[2]:r[2]=e[2],t[3]<e[3]?r[3]=t[3]:r[3]=e[3]):createOrUpdateEmpty(r),r}function getTopLeft(t){return[t[0],t[3]]}function getTopRight(t){return[t[2],t[3]]}function getWidth(t){return t[2]-t[0]}function intersects$1(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function isEmpty(t){return t[2]<t[0]||t[3]<t[1]}function returnOrUpdate(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t}function intersectsSegment(t,e,n){let r=!1;const i=coordinateRelationship(t,e),g=coordinateRelationship(t,n);if(i===Relationship.INTERSECTING||g===Relationship.INTERSECTING)r=!0;else{const y=t[0],k=t[1],L=t[2],$=t[3],V=e[0],z=e[1],re=n[0],oe=n[1],j=(oe-z)/(re-V);let ie,ae;g&Relationship.ABOVE&&!(i&Relationship.ABOVE)&&(ie=re-(oe-$)/j,r=ie>=y&&ie<=L),!r&&g&Relationship.RIGHT&&!(i&Relationship.RIGHT)&&(ae=oe-(re-L)*j,r=ae>=k&&ae<=$),!r&&g&Relationship.BELOW&&!(i&Relationship.BELOW)&&(ie=re-(oe-k)/j,r=ie>=y&&ie<=L),!r&&g&Relationship.LEFT&&!(i&Relationship.LEFT)&&(ae=oe-(re-y)*j,r=ae>=k&&ae<=$)}return r}function applyTransform(t,e,n,r){if(isEmpty(t))return createOrUpdateEmpty(n);let i=[];i=[t[0],t[1],t[2],t[1],t[2],t[3],t[0],t[3]],e(i,i,2);const g=[],y=[];for(let k=0,L=i.length;k<L;k+=2)g.push(i[k]),y.push(i[k+1]);return _boundingExtentXYs(g,y,n)}function wrapX$2(t,e){const n=e.getExtent(),r=getCenter$1(t);if(e.canWrapX()&&(r[0]<n[0]||r[0]>=n[2])){const i=getWidth(n),y=Math.floor((r[0]-n[0])/i)*i;t[0]-=y,t[2]-=y}return t}function wrapAndSliceX(t,e,n){if(e.canWrapX()){const r=e.getExtent();if(!isFinite(t[0])||!isFinite(t[2]))return[[r[0],t[1],r[2],t[3]]];wrapX$2(t,e);const i=getWidth(r);if(getWidth(t)>i&&!n)return[[r[0],t[1],r[2],t[3]]];if(t[0]<r[0])return[[t[0]+i,t[1],r[2],t[3]],[r[0],t[1],t[2],t[3]]];if(t[2]>r[2])return[[t[0],t[1],r[2],t[3]],[r[0],t[1],t[2]-i,t[3]]]}return[t]}function clamp(t,e,n){return Math.min(Math.max(t,e),n)}function squaredSegmentDistance(t,e,n,r,i,g){const y=i-n,k=g-r;if(y!==0||k!==0){const L=((t-n)*y+(e-r)*k)/(y*y+k*k);L>1?(n=i,r=g):L>0&&(n+=y*L,r+=k*L)}return squaredDistance$1(t,e,n,r)}function squaredDistance$1(t,e,n,r){const i=n-t,g=r-e;return i*i+g*g}function solveLinearSystem(t){const e=t.length;for(let r=0;r<e;r++){let i=r,g=Math.abs(t[r][r]);for(let k=r+1;k<e;k++){const L=Math.abs(t[k][r]);L>g&&(g=L,i=k)}if(g===0)return null;const y=t[i];t[i]=t[r],t[r]=y;for(let k=r+1;k<e;k++){const L=-t[k][r]/t[r][r];for(let $=r;$<e+1;$++)r==$?t[k][$]=0:t[k][$]+=L*t[r][$]}}const n=new Array(e);for(let r=e-1;r>=0;r--){n[r]=t[r][e]/t[r][r];for(let i=r-1;i>=0;i--)t[i][e]-=t[i][r]*n[r]}return n}function toDegrees(t){return t*180/Math.PI}function toRadians(t){return t*Math.PI/180}function modulo(t,e){const n=t%e;return n*e<0?n+e:n}function lerp(t,e,n){return t+n*(e-t)}function toFixed(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}function floor(t,e){return Math.floor(toFixed(t,e))}function ceil(t,e){return Math.ceil(toFixed(t,e))}function wrap(t,e,n){if(t>=e&&t<n)return t;const r=n-e;return((t-e)%r+r)%r+e}function add(t,e){return t[0]+=+e[0],t[1]+=+e[1],t}function equals$1(t,e){let n=!0;for(let r=t.length-1;r>=0;--r)if(t[r]!=e[r]){n=!1;break}return n}function rotate$1(t,e){const n=Math.cos(e),r=Math.sin(e),i=t[0]*n-t[1]*r,g=t[1]*n+t[0]*r;return t[0]=i,t[1]=g,t}function scale$3(t,e){return t[0]*=e,t[1]*=e,t}function squaredDistance(t,e){const n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}function distance$1(t,e){return Math.sqrt(squaredDistance(t,e))}function wrapX$1(t,e){if(e.canWrapX()){const n=getWidth(e.getExtent()),r=getWorldsAway(t,e,n);r&&(t[0]-=r*n)}return t}function getWorldsAway(t,e,n){const r=e.getExtent();let i=0;return e.canWrapX()&&(t[0]<r[0]||t[0]>r[2])&&(n=n||getWidth(r),i=Math.floor((t[0]-r[0])/n)),i}const DEFAULT_RADIUS=63710088e-1;function getDistance(t,e,n){n=n||DEFAULT_RADIUS;const r=toRadians(t[1]),i=toRadians(e[1]),g=(i-r)/2,y=toRadians(e[0]-t[0])/2,k=Math.sin(g)*Math.sin(g)+Math.sin(y)*Math.sin(y)*Math.cos(r)*Math.cos(i);return 2*n*Math.atan2(Math.sqrt(k),Math.sqrt(1-k))}function getLengthInternal(t,e){let n=0;for(let r=0,i=t.length;r<i-1;++r)n+=getDistance(t[r],t[r+1],e);return n}function getLength(t,e){e=e||{};const n=e.radius||DEFAULT_RADIUS,r=e.projection||"EPSG:3857",i=t.getType();i!=="GeometryCollection"&&(t=t.clone().transform(r,"EPSG:4326"));let g=0,y,k,L,$,V,z;switch(i){case"Point":case"MultiPoint":break;case"LineString":case"LinearRing":{y=t.getCoordinates(),g=getLengthInternal(y,n);break}case"MultiLineString":case"Polygon":{for(y=t.getCoordinates(),L=0,$=y.length;L<$;++L)g+=getLengthInternal(y[L],n);break}case"MultiPolygon":{for(y=t.getCoordinates(),L=0,$=y.length;L<$;++L)for(k=y[L],V=0,z=k.length;V<z;++V)g+=getLengthInternal(k[V],n);break}case"GeometryCollection":{const re=t.getGeometries();for(L=0,$=re.length;L<$;++L)g+=getLength(re[L],e);break}default:throw new Error("Unsupported geometry type: "+i)}return g}function getAreaInternal(t,e){let n=0;const r=t.length;let i=t[r-1][0],g=t[r-1][1];for(let y=0;y<r;y++){const k=t[y][0],L=t[y][1];n+=toRadians(k-i)*(2+Math.sin(toRadians(g))+Math.sin(toRadians(L))),i=k,g=L}return n*e*e/2}function getArea(t,e){e=e||{};const n=e.radius||DEFAULT_RADIUS,r=e.projection||"EPSG:3857",i=t.getType();i!=="GeometryCollection"&&(t=t.clone().transform(r,"EPSG:4326"));let g=0,y,k,L,$,V,z;switch(i){case"Point":case"MultiPoint":case"LineString":case"MultiLineString":case"LinearRing":break;case"Polygon":{for(y=t.getCoordinates(),g=Math.abs(getAreaInternal(y[0],n)),L=1,$=y.length;L<$;++L)g-=Math.abs(getAreaInternal(y[L],n));break}case"MultiPolygon":{for(y=t.getCoordinates(),L=0,$=y.length;L<$;++L)for(k=y[L],g+=Math.abs(getAreaInternal(k[0],n)),V=1,z=k.length;V<z;++V)g-=Math.abs(getAreaInternal(k[V],n));break}case"GeometryCollection":{const re=t.getGeometries();for(L=0,$=re.length;L<$;++L)g+=getArea(re[L],e);break}default:throw new Error("Unsupported geometry type: "+i)}return g}const K0=.9996,E=.00669438,E2=E*E,E3=E2*E,E_P2=E/(1-E),SQRT_E=Math.sqrt(1-E),_E=(1-SQRT_E)/(1+SQRT_E),_E2=_E*_E,_E3=_E2*_E,_E4=_E3*_E,_E5=_E4*_E,M1=1-E/4-3*E2/64-5*E3/256,M2=3*E/8+3*E2/32+45*E3/1024,M3=15*E2/256+45*E3/1024,M4=35*E3/3072,P2=3/2*_E-27/32*_E3+269/512*_E5,P3=21/16*_E2-55/32*_E4,P4=151/96*_E3-417/128*_E5,P5=1097/512*_E4,R=6378137;function toLonLat$1(t,e,n){const r=t-5e5,y=(n.north?e:e-1e7)/K0/(R*M1),k=y+P2*Math.sin(2*y)+P3*Math.sin(4*y)+P4*Math.sin(6*y)+P5*Math.sin(8*y),L=Math.sin(k),$=L*L,V=Math.cos(k),z=L/V,re=z*z,oe=re*re,j=1-E*$,ie=Math.sqrt(1-E*$),ae=R/ie,ue=(1-E)/j,de=E_P2*V**2,pe=de*de,le=r/(ae*K0),he=le*le,_e=he*le,Ce=_e*le,xe=Ce*le,Ie=xe*le,Ne=k-z/ue*(he/2-Ce/24*(5+3*re+10*de-4*pe-9*E_P2))+Ie/720*(61+90*re+298*de+45*oe-252*E_P2-3*pe);let Ue=(le-_e/6*(1+2*re+de)+xe/120*(5-2*de+28*re-3*pe+8*E_P2+24*oe))/V;return Ue=wrap(Ue+toRadians(zoneToCentralLongitude(n.number)),-Math.PI,Math.PI),[toDegrees(Ue),toDegrees(Ne)]}const MIN_LATITUDE=-80,MAX_LATITUDE=84,MIN_LONGITUDE=-180,MAX_LONGITUDE=180;function fromLonLat$1(t,e,n){t=wrap(t,MIN_LONGITUDE,MAX_LONGITUDE),e<MIN_LATITUDE?e=MIN_LATITUDE:e>MAX_LATITUDE&&(e=MAX_LATITUDE);const r=toRadians(e),i=Math.sin(r),g=Math.cos(r),y=i/g,k=y*y,L=k*k,$=toRadians(t),V=zoneToCentralLongitude(n.number),z=toRadians(V),re=R/Math.sqrt(1-E*i**2),oe=E_P2*g**2,j=g*wrap($-z,-Math.PI,Math.PI),ie=j*j,ae=ie*j,ue=ae*j,de=ue*j,pe=de*j,le=R*(M1*r-M2*Math.sin(2*r)+M3*Math.sin(4*r)-M4*Math.sin(6*r)),he=K0*re*(j+ae/6*(1-k+oe)+de/120*(5-18*k+L+72*oe-58*E_P2))+5e5;let _e=K0*(le+re*y*(ie/2+ue/24*(5-k+9*oe+4*oe**2)+pe/720*(61-58*k+L+600*oe-330*E_P2)));return n.north||(_e+=1e7),[he,_e]}function zoneToCentralLongitude(t){return(t-1)*6-180+3}const epsgRegExes=[/^EPSG:(\d+)$/,/^urn:ogc:def:crs:EPSG::(\d+)$/,/^http:\/\/www\.opengis\.net\/def\/crs\/EPSG\/0\/(\d+)$/];function zoneFromCode(t){let e=0;for(const i of epsgRegExes){const g=t.match(i);if(g){e=parseInt(g[1]);break}}if(!e)return null;let n=0,r=!1;return e>32700&&e<32761?n=e-32700:e>32600&&e<32661&&(r=!0,n=e-32600),n?{number:n,north:r}:null}function makeTransformFunction(t,e){return function(n,r,i,g){const y=n.length;i=i>1?i:2,g=g??i,r||(i>2?r=n.slice():r=new Array(y));for(let k=0;k<y;k+=g){const L=n[k],$=n[k+1],V=t(L,$,e);r[k]=V[0],r[k+1]=V[1]}return r}}function makeProjection(t){return zoneFromCode(t)?new Projection({code:t,units:"m"}):null}function makeTransforms(t){const e=zoneFromCode(t.getCode());return e?{forward:makeTransformFunction(fromLonLat$1,e),inverse:makeTransformFunction(toLonLat$1,e)}:null}function warn(...t){console.warn(...t)}const transformFactories=[makeTransforms],projectionFactories=[makeProjection];let showCoordinateWarning=!0;function disableCoordinateWarning(t){showCoordinateWarning=!1}function cloneTransform(t,e){if(e!==void 0){for(let n=0,r=t.length;n<r;++n)e[n]=t[n];e=e}else e=t.slice();return e}function addProjection(t){add$2(t.getCode(),t),add$1(t,t,cloneTransform)}function addProjections(t){t.forEach(addProjection)}function get$1(t){if(typeof t!="string")return t;const e=get$3(t);if(e)return e;for(const n of projectionFactories){const r=n(t);if(r)return r}return null}function getPointResolution(t,e,n,r){t=get$1(t);let i;const g=t.getPointResolutionFunc();if(g){if(i=g(e,n),r&&r!==t.getUnits()){const y=t.getMetersPerUnit();y&&(i=i*y/METERS_PER_UNIT$1[r])}}else{const y=t.getUnits();if(y=="degrees"&&!r||r=="degrees")i=e;else{const k=getTransformFromProjections(t,get$1("EPSG:4326"));if(!k&&y!=="degrees")i=e*t.getMetersPerUnit();else{let $=[n[0]-e/2,n[1],n[0]+e/2,n[1],n[0],n[1]-e/2,n[0],n[1]+e/2];$=k($,$,2);const V=getDistance($.slice(0,2),$.slice(2,4)),z=getDistance($.slice(4,6),$.slice(6,8));i=(V+z)/2}const L=r?METERS_PER_UNIT$1[r]:t.getMetersPerUnit();L!==void 0&&(i/=L)}}return i}function addEquivalentProjections(t){addProjections(t),t.forEach(function(e){t.forEach(function(n){e!==n&&add$1(e,n,cloneTransform)})})}function addEquivalentTransforms(t,e,n,r){t.forEach(function(i){e.forEach(function(g){add$1(i,g,n),add$1(g,i,r)})})}function createProjection(t,e){return t?typeof t=="string"?get$1(t):t:get$1(e)}function createTransformFromCoordinateTransform(t){return function(e,n,r,i){const g=e.length;r=r!==void 0?r:2,i=i??r,n=n!==void 0?n:new Array(g);for(let y=0;y<g;y+=i){const k=t(e.slice(y,y+r)),L=k.length;for(let $=0,V=i;$<V;++$)n[y+$]=$>=L?e[y+$]:k[$]}return n}}function fromLonLat(t,e){return disableCoordinateWarning(),transform(t,"EPSG:4326","EPSG:3857")}function toLonLat(t,e){const n=transform(t,"EPSG:3857","EPSG:4326"),r=n[0];return(r<-180||r>180)&&(n[0]=modulo(r+180,360)-180),n}function equivalent(t,e){if(t===e)return!0;const n=t.getUnits()===e.getUnits();return(t.getCode()===e.getCode()||getTransformFromProjections(t,e)===cloneTransform)&&n}function getTransformFromProjections(t,e){const n=t.getCode(),r=e.getCode();let i=get$2(n,r);if(i)return i;let g=null,y=null;for(const L of transformFactories)g||(g=L(t)),y||(y=L(e));if(!g&&!y)return null;const k="EPSG:4326";if(y)if(g)i=composeTransformFuncs(g.inverse,y.forward);else{const L=get$2(n,k);L&&(i=composeTransformFuncs(L,y.forward))}else{const L=get$2(k,r);L&&(i=composeTransformFuncs(g.inverse,L))}return i&&(addProjection(t),addProjection(e),add$1(t,e,i)),i}function composeTransformFuncs(t,e){return function(n,r,i,g){return r=t(n,r,i,g),e(r,r,i,g)}}function getTransform(t,e){const n=get$1(t),r=get$1(e);return getTransformFromProjections(n,r)}function transform(t,e,n){const r=getTransform(e,n);if(!r){const i=get$1(e).getCode(),g=get$1(n).getCode();throw new Error(`No transform available between ${i} and ${g}`)}return r(t,void 0,t.length)}function transformExtent(t,e,n,r){const i=getTransform(e,n);return applyTransform(t,i,void 0)}function toUserCoordinate(t,e){return t}function fromUserCoordinate(t,e){return showCoordinateWarning&&!equals$1(t,[0,0])&&t[0]>=-180&&t[0]<=180&&t[1]>=-90&&t[1]<=90&&(showCoordinateWarning=!1,warn("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),t}function toUserExtent(t,e){return t}function fromUserExtent(t,e){return t}function addCommon(){addEquivalentProjections(PROJECTIONS$1),addEquivalentProjections(PROJECTIONS),addEquivalentTransforms(PROJECTIONS,PROJECTIONS$1,fromEPSG4326,toEPSG4326)}addCommon();class BaseEvent{constructor(e){this.propagationStopped,this.defaultPrevented,this.type=e,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}}const ObjectEventType={PROPERTYCHANGE:"propertychange"};class Disposable{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}function binarySearch(t,e,n){let r,i;n=n||ascending;let g=0,y=t.length,k=!1;for(;g<y;)r=g+(y-g>>1),i=+n(t[r],e),i<0?g=r+1:(y=r,k=!i);return k?g:~g}function ascending(t,e){return t>e?1:t<e?-1:0}function descending(t,e){return t<e?1:t>e?-1:0}function linearFindNearest(t,e,n){if(t[0]<=e)return 0;const r=t.length;if(e<=t[r-1])return r-1;if(typeof n=="function"){for(let i=1;i<r;++i){const g=t[i];if(g===e)return i;if(g<e)return n(e,t[i-1],g)>0?i-1:i}return r-1}if(n>0){for(let i=1;i<r;++i)if(t[i]<e)return i-1;return r-1}if(n<0){for(let i=1;i<r;++i)if(t[i]<=e)return i;return r-1}for(let i=1;i<r;++i){if(t[i]==e)return i;if(t[i]<e)return t[i-1]-e<e-t[i]?i-1:i}return r-1}function reverseSubArray(t,e,n){for(;e<n;){const r=t[e];t[e]=t[n],t[n]=r,++e,--n}}function extend$2(t,e){const n=Array.isArray(e)?e:[e],r=n.length;for(let i=0;i<r;i++)t[t.length]=n[i]}function equals(t,e){const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function isSorted(t,e,n){const r=e||ascending;return t.every(function(i,g){if(g===0)return!0;const y=r(t[g-1],i);return!(y>0||y===0)})}function TRUE(){return!0}function FALSE(){return!1}function VOID(){}function memoizeOne(t){let e,n,r;return function(){const i=Array.prototype.slice.call(arguments);return(!n||this!==r||!equals(i,n))&&(r=this,n=i,e=t.apply(this,arguments)),e}}function toPromise(t){function e(){let n;try{n=t()}catch(r){return Promise.reject(r)}return n instanceof Promise?n:Promise.resolve(n)}return e()}class Target extends Disposable{constructor(e){super(),this.eventTarget_=e,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(e,n){if(!e||!n)return;const r=this.listeners_||(this.listeners_={}),i=r[e]||(r[e]=[]);i.includes(n)||i.push(n)}dispatchEvent(e){const n=typeof e=="string",r=n?e:e.type,i=this.listeners_&&this.listeners_[r];if(!i)return;const g=n?new BaseEvent(e):e;g.target||(g.target=this.eventTarget_||this);const y=this.dispatching_||(this.dispatching_={}),k=this.pendingRemovals_||(this.pendingRemovals_={});r in y||(y[r]=0,k[r]=0),++y[r];let L;for(let $=0,V=i.length;$<V;++$)if("handleEvent"in i[$]?L=i[$].handleEvent(g):L=i[$].call(this,g),L===!1||g.propagationStopped){L=!1;break}if(--y[r]===0){let $=k[r];for(delete k[r];$--;)this.removeEventListener(r,VOID);delete y[r]}return L}disposeInternal(){this.listeners_&&clear(this.listeners_)}getListeners(e){return this.listeners_&&this.listeners_[e]||void 0}hasListener(e){return this.listeners_?e?e in this.listeners_:Object.keys(this.listeners_).length>0:!1}removeEventListener(e,n){if(!this.listeners_)return;const r=this.listeners_[e];if(!r)return;const i=r.indexOf(n);i!==-1&&(this.pendingRemovals_&&e in this.pendingRemovals_?(r[i]=VOID,++this.pendingRemovals_[e]):(r.splice(i,1),r.length===0&&delete this.listeners_[e]))}}const EventType={CHANGE:"change",ERROR:"error",BLUR:"blur",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",FOCUS:"focus",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"};function listen(t,e,n,r,i){if(i){const y=n;n=function(){t.removeEventListener(e,n),y.apply(r??this,arguments)}}else r&&r!==t&&(n=n.bind(r));const g={target:t,type:e,listener:n};return t.addEventListener(e,n),g}function listenOnce(t,e,n,r){return listen(t,e,n,r,!0)}function unlistenByKey(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),clear(t))}class Observable extends Target{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(EventType.CHANGE)}getRevision(){return this.revision_}onInternal(e,n){if(Array.isArray(e)){const r=e.length,i=new Array(r);for(let g=0;g<r;++g)i[g]=listen(this,e[g],n);return i}return listen(this,e,n)}onceInternal(e,n){let r;if(Array.isArray(e)){const i=e.length;r=new Array(i);for(let g=0;g<i;++g)r[g]=listenOnce(this,e[g],n)}else r=listenOnce(this,e,n);return n.ol_key=r,r}unInternal(e,n){const r=n.ol_key;if(r)unByKey(r);else if(Array.isArray(e))for(let i=0,g=e.length;i<g;++i)this.removeEventListener(e[i],n);else this.removeEventListener(e,n)}}Observable.prototype.on,Observable.prototype.once,Observable.prototype.un;function unByKey(t){if(Array.isArray(t))for(let e=0,n=t.length;e<n;++e)unlistenByKey(t[e]);else unlistenByKey(t)}function abstract(){throw new Error("Unimplemented abstract method.")}let uidCounter_=0;function getUid(t){return t.ol_uid||(t.ol_uid=String(++uidCounter_))}class ObjectEvent extends BaseEvent{constructor(e,n,r){super(e),this.key=n,this.oldValue=r}}class BaseObject extends Observable{constructor(e){super(),this.on,this.once,this.un,getUid(this),this.values_=null,e!==void 0&&this.setProperties(e)}get(e){let n;return this.values_&&this.values_.hasOwnProperty(e)&&(n=this.values_[e]),n}getKeys(){return this.values_&&Object.keys(this.values_)||[]}getProperties(){return this.values_&&Object.assign({},this.values_)||{}}getPropertiesInternal(){return this.values_}hasProperties(){return!!this.values_}notify(e,n){let r;r=`change:${e}`,this.hasListener(r)&&this.dispatchEvent(new ObjectEvent(r,e,n)),r=ObjectEventType.PROPERTYCHANGE,this.hasListener(r)&&this.dispatchEvent(new ObjectEvent(r,e,n))}addChangeListener(e,n){this.addEventListener(`change:${e}`,n)}removeChangeListener(e,n){this.removeEventListener(`change:${e}`,n)}set(e,n,r){const i=this.values_||(this.values_={});if(r)i[e]=n;else{const g=i[e];i[e]=n,g!==n&&this.notify(e,g)}}setProperties(e,n){for(const r in e)this.set(r,e[r],n)}applyProperties(e){e.values_&&Object.assign(this.values_||(this.values_={}),e.values_)}unset(e,n){if(this.values_&&e in this.values_){const r=this.values_[e];delete this.values_[e],isEmpty$1(this.values_)&&(this.values_=null),n||this.notify(e,r)}}}const MapEventType={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend",LOADSTART:"loadstart",LOADEND:"loadend"};class Control extends BaseObject{constructor(e){super();const n=e.element;n&&!e.target&&!n.style.pointerEvents&&(n.style.pointerEvents="auto"),this.element=n||null,this.target_=null,this.map_=null,this.listenerKeys=[],e.render&&(this.render=e.render),e.target&&this.setTarget(e.target)}disposeInternal(){var e;(e=this.element)==null||e.remove(),super.disposeInternal()}getMap(){return this.map_}setMap(e){var n;this.map_&&((n=this.element)==null||n.remove());for(let r=0,i=this.listenerKeys.length;r<i;++r)unlistenByKey(this.listenerKeys[r]);if(this.listenerKeys.length=0,this.map_=e,e){const r=this.target_??e.getOverlayContainerStopEvent();this.element&&r.appendChild(this.element),this.render!==VOID&&this.listenerKeys.push(listen(e,MapEventType.POSTRENDER,this.render,this)),e.render()}}render(e){}setTarget(e){this.target_=typeof e=="string"?document.getElementById(e):e}}const CLASS_HIDDEN="ol-hidden",CLASS_SELECTABLE="ol-selectable",CLASS_UNSELECTABLE="ol-unselectable",CLASS_CONTROL="ol-control",CLASS_COLLAPSED="ol-collapsed",fontRegEx=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))",`?\\s*([-,\\"\\'\\sa-z]+?)\\s*$`].join(""),"i"),fontRegExMatchIndex=["style","variant","weight","size","lineHeight","family"],getFontParameters=function(t){const e=t.match(fontRegEx);if(!e)return null;const n={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"};for(let r=0,i=fontRegExMatchIndex.length;r<i;++r){const g=e[r+1];g!==void 0&&(n[fontRegExMatchIndex[r]]=g)}return n.families=n.family.split(/,\s?/),n},UNITS_PROP="units",LEADING_DIGITS=[1,2,5],DEFAULT_DPI=25.4/.28;let ScaleLine$1=class extends Control{constructor(e){e=e||{};const n=document.createElement("div");n.style.pointerEvents="none",super({element:n,render:e.render,target:e.target}),this.on,this.once,this.un;const r=e.className!==void 0?e.className:e.bar?"ol-scale-bar":"ol-scale-line";this.innerElement_=document.createElement("div"),this.innerElement_.className=r+"-inner",this.element.className=r+" "+CLASS_UNSELECTABLE,this.element.appendChild(this.innerElement_),this.viewState_=null,this.minWidth_=e.minWidth!==void 0?e.minWidth:64,this.maxWidth_=e.maxWidth,this.renderedVisible_=!1,this.renderedWidth_=void 0,this.renderedHTML_="",this.addChangeListener(UNITS_PROP,this.handleUnitsChanged_),this.setUnits(e.units||"metric"),this.scaleBar_=e.bar||!1,this.scaleBarSteps_=e.steps||4,this.scaleBarText_=e.text||!1,this.dpi_=e.dpi||void 0}getUnits(){return this.get(UNITS_PROP)}handleUnitsChanged_(){this.updateElement_()}setUnits(e){this.set(UNITS_PROP,e)}setDpi(e){this.dpi_=e}updateElement_(){const e=this.viewState_;if(!e){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}const n=e.center,r=e.projection,i=this.getUnits(),g=i=="degrees"?"degrees":"m";let y=getPointResolution(r,e.resolution,n,g);const k=this.minWidth_*(this.dpi_||DEFAULT_DPI)/DEFAULT_DPI,L=this.maxWidth_!==void 0?this.maxWidth_*(this.dpi_||DEFAULT_DPI)/DEFAULT_DPI:void 0;let $=k*y,V="";if(i=="degrees"){const pe=METERS_PER_UNIT$1.degrees;$*=pe,$<pe/60?(V="″",y*=3600):$<pe?(V="′",y*=60):V="°"}else if(i=="imperial")$<.9144?(V="in",y/=.0254):$<1609.344?(V="ft",y/=.3048):(V="mi",y/=1609.344);else if(i=="nautical")y/=1852,V="NM";else if(i=="metric")$<1e-6?(V="nm",y*=1e9):$<.001?(V="μm",y*=1e6):$<1?(V="mm",y*=1e3):$<1e3?V="m":(V="km",y/=1e3);else if(i=="us")$<.9144?(V="in",y*=39.37):$<1609.344?(V="ft",y/=.30480061):(V="mi",y/=1609.3472);else throw new Error("Invalid units");let z=3*Math.floor(Math.log(k*y)/Math.log(10)),re,oe,j,ie,ae,ue;for(;;){j=Math.floor(z/3);const pe=Math.pow(10,j);if(re=LEADING_DIGITS[(z%3+3)%3]*pe,oe=Math.round(re/y),isNaN(oe)){this.element.style.display="none",this.renderedVisible_=!1;return}if(L!==void 0&&oe>=L){re=ie,oe=ae,j=ue;break}else if(oe>=k)break;ie=re,ae=oe,ue=j,++z}const de=this.scaleBar_?this.createScaleBar(oe,re,V):re.toFixed(j<0?-j:0)+" "+V;this.renderedHTML_!=de&&(this.innerElement_.innerHTML=de,this.renderedHTML_=de),this.renderedWidth_!=oe&&(this.innerElement_.style.width=oe+"px",this.renderedWidth_=oe),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}createScaleBar(e,n,r){const i=this.getScaleForResolution(),g=i<1?Math.round(1/i).toLocaleString()+" : 1":"1 : "+Math.round(i).toLocaleString(),y=this.scaleBarSteps_,k=e/y,L=[this.createMarker("absolute")];for(let V=0;V<y;++V){const z=V%2===0?"ol-scale-singlebar-odd":"ol-scale-singlebar-even";L.push(`<div><div class="ol-scale-singlebar ${z}" style="width: ${k}px;"></div>`+this.createMarker("relative")+(V%2===0||y===2?this.createStepText(V,e,!1,n,r):"")+"</div>")}return L.push(this.createStepText(y,e,!0,n,r)),(this.scaleBarText_?`<div class="ol-scale-text" style="width: ${e}px;">`+g+"</div>":"")+L.join("")}createMarker(e){return`<div class="ol-scale-step-marker" style="position: ${e}; top: ${e==="absolute"?3:-10}px;"></div>`}createStepText(e,n,r,i,g){const k=(e===0?0:Math.round(i/this.scaleBarSteps_*e*100)/100)+(e===0?"":" "+g),L=e===0?-3:n/this.scaleBarSteps_*-1,$=e===0?0:n/this.scaleBarSteps_*2;return`<div class="ol-scale-step-text" style="margin-left: ${L}px;text-align: ${e===0?"left":"center"};min-width: ${$}px;left: ${r?n+"px":"unset"};">`+k+"</div>"}getScaleForResolution(){const e=getPointResolution(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,"m"),n=this.dpi_||DEFAULT_DPI,r=1e3/25.4;return e*r*n}render(e){const n=e.frameState;n?this.viewState_=n.viewState:this.viewState_=null,this.updateElement_()}};const CollectionEventType={ADD:"add",REMOVE:"remove"},Property$3={LENGTH:"length"};class CollectionEvent extends BaseEvent{constructor(e,n,r){super(e),this.element=n,this.index=r}}class Collection extends BaseObject{constructor(e,n){if(super(),this.on,this.once,this.un,n=n||{},this.unique_=!!n.unique,this.array_=e||[],this.unique_)for(let r=0,i=this.array_.length;r<i;++r)this.assertUnique_(this.array_[r],r);this.updateLength_()}clear(){for(;this.getLength()>0;)this.pop()}extend(e){for(let n=0,r=e.length;n<r;++n)this.push(e[n]);return this}forEach(e){const n=this.array_;for(let r=0,i=n.length;r<i;++r)e(n[r],r,n)}getArray(){return this.array_}item(e){return this.array_[e]}getLength(){return this.get(Property$3.LENGTH)}insertAt(e,n){if(e<0||e>this.getLength())throw new Error("Index out of bounds: "+e);this.unique_&&this.assertUnique_(n),this.array_.splice(e,0,n),this.updateLength_(),this.dispatchEvent(new CollectionEvent(CollectionEventType.ADD,n,e))}pop(){return this.removeAt(this.getLength()-1)}push(e){this.unique_&&this.assertUnique_(e);const n=this.getLength();return this.insertAt(n,e),this.getLength()}remove(e){const n=this.array_;for(let r=0,i=n.length;r<i;++r)if(n[r]===e)return this.removeAt(r)}removeAt(e){if(e<0||e>=this.getLength())return;const n=this.array_[e];return this.array_.splice(e,1),this.updateLength_(),this.dispatchEvent(new CollectionEvent(CollectionEventType.REMOVE,n,e)),n}setAt(e,n){const r=this.getLength();if(e>=r){this.insertAt(e,n);return}if(e<0)throw new Error("Index out of bounds: "+e);this.unique_&&this.assertUnique_(n,e);const i=this.array_[e];this.array_[e]=n,this.dispatchEvent(new CollectionEvent(CollectionEventType.REMOVE,i,e)),this.dispatchEvent(new CollectionEvent(CollectionEventType.ADD,n,e))}updateLength_(){this.set(Property$3.LENGTH,this.array_.length)}assertUnique_(e,n){for(let r=0,i=this.array_.length;r<i;++r)if(this.array_[r]===e&&r!==n)throw new Error("Duplicate item added to a unique collection")}}function assert(t,e){if(!t)throw new Error(e)}class Feature extends BaseObject{constructor(e){if(super(),this.on,this.once,this.un,this.id_=void 0,this.geometryName_="geometry",this.style_=null,this.styleFunction_=void 0,this.geometryChangeKey_=null,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),e)if(typeof e.getSimplifiedGeometry=="function"){const n=e;this.setGeometry(n)}else{const n=e;this.setProperties(n)}}clone(){const e=new Feature(this.hasProperties()?this.getProperties():null);e.setGeometryName(this.getGeometryName());const n=this.getGeometry();n&&e.setGeometry(n.clone());const r=this.getStyle();return r&&e.setStyle(r),e}getGeometry(){return this.get(this.geometryName_)}getId(){return this.id_}getGeometryName(){return this.geometryName_}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}handleGeometryChange_(){this.changed()}handleGeometryChanged_(){this.geometryChangeKey_&&(unlistenByKey(this.geometryChangeKey_),this.geometryChangeKey_=null);const e=this.getGeometry();e&&(this.geometryChangeKey_=listen(e,EventType.CHANGE,this.handleGeometryChange_,this)),this.changed()}setGeometry(e){this.set(this.geometryName_,e)}setStyle(e){this.style_=e,this.styleFunction_=e?createStyleFunction(e):void 0,this.changed()}setId(e){this.id_=e,this.changed()}setGeometryName(e){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=e,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()}}function createStyleFunction(t){if(typeof t=="function")return t;let e;return Array.isArray(t)?e=t:(assert(typeof t.getZIndex=="function","Expected an `ol/style/Style` or an array of `ol/style/Style.js`"),e=[t]),function(){return e}}new Array(6);function create$1(){return[1,0,0,1,0,0]}function multiply(t,e){const n=t[0],r=t[1],i=t[2],g=t[3],y=t[4],k=t[5],L=e[0],$=e[1],V=e[2],z=e[3],re=e[4],oe=e[5];return t[0]=n*L+i*$,t[1]=r*L+g*$,t[2]=n*V+i*z,t[3]=r*V+g*z,t[4]=n*re+i*oe+y,t[5]=r*re+g*oe+k,t}function setFromArray(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function apply(t,e){const n=e[0],r=e[1];return e[0]=t[0]*n+t[2]*r+t[4],e[1]=t[1]*n+t[3]*r+t[5],e}function compose(t,e,n,r,i,g,y,k){const L=Math.sin(g),$=Math.cos(g);return t[0]=r*$,t[1]=i*L,t[2]=-r*L,t[3]=i*$,t[4]=y*r*$-k*r*L+e,t[5]=y*i*L+k*i*$+n,t}function makeInverse(t,e){const n=determinant(e);assert(n!==0,"Transformation matrix cannot be inverted");const r=e[0],i=e[1],g=e[2],y=e[3],k=e[4],L=e[5];return t[0]=y/n,t[1]=-i/n,t[2]=-g/n,t[3]=r/n,t[4]=(g*L-y*k)/n,t[5]=-(r*L-i*k)/n,t}function determinant(t){return t[0]*t[3]-t[1]*t[2]}const matrixPrecision=[1e6,1e6,1e6,1e6,2,2];function toString$1(t){return"matrix("+t.map((n,r)=>Math.round(n*matrixPrecision[r])/matrixPrecision[r]).join(", ")+")"}function transform2D(t,e,n,r,i,g,y){g=g||[],y=y||2;let k=0;for(let L=e;L<n;L+=r){const $=t[L],V=t[L+1];g[k++]=i[0]*$+i[2]*V+i[4],g[k++]=i[1]*$+i[3]*V+i[5];for(let z=2;z<y;z++)g[k++]=t[L+z]}return g&&g.length!=k&&(g.length=k),g}function rotate(t,e,n,r,i,g,y){y=y||[];const k=Math.cos(i),L=Math.sin(i),$=g[0],V=g[1];let z=0;for(let re=e;re<n;re+=r){const oe=t[re]-$,j=t[re+1]-V;y[z++]=$+oe*k-j*L,y[z++]=V+oe*L+j*k;for(let ie=re+2;ie<re+r;++ie)y[z++]=t[ie]}return y&&y.length!=z&&(y.length=z),y}function scale$2(t,e,n,r,i,g,y,k){k=k||[];const L=y[0],$=y[1];let V=0;for(let z=e;z<n;z+=r){const re=t[z]-L,oe=t[z+1]-$;k[V++]=L+i*re,k[V++]=$+g*oe;for(let j=z+2;j<z+r;++j)k[V++]=t[j]}return k&&k.length!=V&&(k.length=V),k}function translate$1(t,e,n,r,i,g,y){y=y||[];let k=0;for(let L=e;L<n;L+=r){y[k++]=t[L]+i,y[k++]=t[L+1]+g;for(let $=L+2;$<L+r;++$)y[k++]=t[$]}return y&&y.length!=k&&(y.length=k),y}const tmpTransform$1=create$1();class Geometry extends BaseObject{constructor(){super(),this.extent_=createEmpty(),this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=memoizeOne((e,n,r)=>{if(!r)return this.getSimplifiedGeometry(n);const i=this.clone();return i.applyTransform(r),i.getSimplifiedGeometry(n)})}simplifyTransformed(e,n){return this.simplifyTransformedInternal(this.getRevision(),e,n)}clone(){return abstract()}closestPointXY(e,n,r,i){return abstract()}containsXY(e,n){const r=this.getClosestPoint([e,n]);return r[0]===e&&r[1]===n}getClosestPoint(e,n){return n=n||[NaN,NaN],this.closestPointXY(e[0],e[1],n,1/0),n}intersectsCoordinate(e){return this.containsXY(e[0],e[1])}computeExtent(e){return abstract()}getExtent(e){if(this.extentRevision_!=this.getRevision()){const n=this.computeExtent(this.extent_);(isNaN(n[0])||isNaN(n[1]))&&createOrUpdateEmpty(n),this.extentRevision_=this.getRevision()}return returnOrUpdate(this.extent_,e)}rotate(e,n){abstract()}scale(e,n,r){abstract()}simplify(e){return this.getSimplifiedGeometry(e*e)}getSimplifiedGeometry(e){return abstract()}getType(){return abstract()}applyTransform(e){abstract()}intersectsExtent(e){return abstract()}translate(e,n){abstract()}transform(e,n){const r=get$1(e),i=r.getUnits()=="tile-pixels"?function(g,y,k){const L=r.getExtent(),$=r.getWorldExtent(),V=getHeight($)/getHeight(L);compose(tmpTransform$1,$[0],$[3],V,-V,0,0,0);const z=transform2D(g,0,g.length,k,tmpTransform$1,y),re=getTransform(r,n);return re?re(z,z,k):z}:getTransform(r,n);return this.applyTransform(i),this}}class SimpleGeometry extends Geometry{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates}computeExtent(e){return createOrUpdateFromFlatCoordinates(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}getCoordinates(){return abstract()}getFirstCoordinate(){return this.flatCoordinates.slice(0,this.stride)}getFlatCoordinates(){return this.flatCoordinates}getLastCoordinate(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)}getLayout(){return this.layout}getSimplifiedGeometry(e){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),e<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&e<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;const n=this.getSimplifiedGeometryInternal(e);return n.getFlatCoordinates().length<this.flatCoordinates.length?n:(this.simplifiedGeometryMaxMinSquaredTolerance=e,this)}getSimplifiedGeometryInternal(e){return this}getStride(){return this.stride}setFlatCoordinates(e,n){this.stride=getStrideForLayout(e),this.layout=e,this.flatCoordinates=n}setCoordinates(e,n){abstract()}setLayout(e,n,r){let i;if(e)i=getStrideForLayout(e);else{for(let g=0;g<r;++g){if(n.length===0){this.layout="XY",this.stride=2;return}n=n[0]}i=n.length,e=getLayoutForStride(i)}this.layout=e,this.stride=i}applyTransform(e){this.flatCoordinates&&(e(this.flatCoordinates,this.flatCoordinates,this.layout.startsWith("XYZ")?3:2,this.stride),this.changed())}rotate(e,n){const r=this.getFlatCoordinates();if(r){const i=this.getStride();rotate(r,0,r.length,i,e,n,r),this.changed()}}scale(e,n,r){n===void 0&&(n=e),r||(r=getCenter$1(this.getExtent()));const i=this.getFlatCoordinates();if(i){const g=this.getStride();scale$2(i,0,i.length,g,e,n,r,i),this.changed()}}translate(e,n){const r=this.getFlatCoordinates();if(r){const i=this.getStride();translate$1(r,0,r.length,i,e,n,r),this.changed()}}}function getLayoutForStride(t){let e;return t==2?e="XY":t==3?e="XYZ":t==4&&(e="XYZM"),e}function getStrideForLayout(t){let e;return t=="XY"?e=2:t=="XYZ"||t=="XYM"?e=3:t=="XYZM"&&(e=4),e}function transformGeom2D(t,e,n){const r=t.getFlatCoordinates();if(!r)return null;const i=t.getStride();return transform2D(r,0,r.length,i,e,n)}function assignClosest(t,e,n,r,i,g,y){const k=t[e],L=t[e+1],$=t[n]-k,V=t[n+1]-L;let z;if($===0&&V===0)z=e;else{const re=((i-k)*$+(g-L)*V)/($*$+V*V);if(re>1)z=n;else if(re>0){for(let oe=0;oe<r;++oe)y[oe]=lerp(t[e+oe],t[n+oe],re);y.length=r;return}else z=e}for(let re=0;re<r;++re)y[re]=t[z+re];y.length=r}function maxSquaredDelta(t,e,n,r,i){let g=t[e],y=t[e+1];for(e+=r;e<n;e+=r){const k=t[e],L=t[e+1],$=squaredDistance$1(g,y,k,L);$>i&&(i=$),g=k,y=L}return i}function arrayMaxSquaredDelta(t,e,n,r,i){for(let g=0,y=n.length;g<y;++g){const k=n[g];i=maxSquaredDelta(t,e,k,r,i),e=k}return i}function multiArrayMaxSquaredDelta(t,e,n,r,i){for(let g=0,y=n.length;g<y;++g){const k=n[g];i=arrayMaxSquaredDelta(t,e,k,r,i),e=k[k.length-1]}return i}function assignClosestPoint(t,e,n,r,i,g,y,k,L,$,V){if(e==n)return $;let z,re;if(i===0){if(re=squaredDistance$1(y,k,t[e],t[e+1]),re<$){for(z=0;z<r;++z)L[z]=t[e+z];return L.length=r,re}return $}V=V||[NaN,NaN];let oe=e+r;for(;oe<n;)if(assignClosest(t,oe-r,oe,r,y,k,V),re=squaredDistance$1(y,k,V[0],V[1]),re<$){for($=re,z=0;z<r;++z)L[z]=V[z];L.length=r,oe+=r}else oe+=r*Math.max((Math.sqrt(re)-Math.sqrt($))/i|0,1);if(g&&(assignClosest(t,n-r,e,r,y,k,V),re=squaredDistance$1(y,k,V[0],V[1]),re<$)){for($=re,z=0;z<r;++z)L[z]=V[z];L.length=r}return $}function assignClosestArrayPoint(t,e,n,r,i,g,y,k,L,$,V){V=V||[NaN,NaN];for(let z=0,re=n.length;z<re;++z){const oe=n[z];$=assignClosestPoint(t,e,oe,r,i,g,y,k,L,$,V),e=oe}return $}function assignClosestMultiArrayPoint(t,e,n,r,i,g,y,k,L,$,V){V=V||[NaN,NaN];for(let z=0,re=n.length;z<re;++z){const oe=n[z];$=assignClosestArrayPoint(t,e,oe,r,i,g,y,k,L,$,V),e=oe[oe.length-1]}return $}function deflateCoordinate(t,e,n,r){for(let i=0,g=n.length;i<g;++i)t[e++]=n[i];return e}function deflateCoordinates(t,e,n,r){for(let i=0,g=n.length;i<g;++i){const y=n[i];for(let k=0;k<r;++k)t[e++]=y[k]}return e}function deflateCoordinatesArray(t,e,n,r,i){i=i||[];let g=0;for(let y=0,k=n.length;y<k;++y){const L=deflateCoordinates(t,e,n[y],r);i[g++]=L,e=L}return i.length=g,i}function deflateMultiCoordinatesArray(t,e,n,r,i){i=i||[];let g=0;for(let y=0,k=n.length;y<k;++y){const L=deflateCoordinatesArray(t,e,n[y],r,i[g]);L.length===0&&(L[0]=e),i[g++]=L,e=L[L.length-1]}return i.length=g,i}function douglasPeucker(t,e,n,r,i,g,y){const k=(n-e)/r;if(k<3){for(;e<n;e+=r)g[y++]=t[e],g[y++]=t[e+1];return y}const L=new Array(k);L[0]=1,L[k-1]=1;const $=[e,n-r];let V=0;for(;$.length>0;){const z=$.pop(),re=$.pop();let oe=0;const j=t[re],ie=t[re+1],ae=t[z],ue=t[z+1];for(let de=re+r;de<z;de+=r){const pe=t[de],le=t[de+1],he=squaredSegmentDistance(pe,le,j,ie,ae,ue);he>oe&&(V=de,oe=he)}oe>i&&(L[(V-e)/r]=1,re+r<V&&$.push(re,V),V+r<z&&$.push(V,z))}for(let z=0;z<k;++z)L[z]&&(g[y++]=t[e+z*r],g[y++]=t[e+z*r+1]);return y}function douglasPeuckerArray(t,e,n,r,i,g,y,k){for(let L=0,$=n.length;L<$;++L){const V=n[L];y=douglasPeucker(t,e,V,r,i,g,y),k.push(y),e=V}return y}function snap(t,e){return e*Math.round(t/e)}function quantize(t,e,n,r,i,g,y){if(e==n)return y;let k=snap(t[e],i),L=snap(t[e+1],i);e+=r,g[y++]=k,g[y++]=L;let $,V;do if($=snap(t[e],i),V=snap(t[e+1],i),e+=r,e==n)return g[y++]=$,g[y++]=V,y;while($==k&&V==L);for(;e<n;){const z=snap(t[e],i),re=snap(t[e+1],i);if(e+=r,z==$&&re==V)continue;const oe=$-k,j=V-L,ie=z-k,ae=re-L;if(oe*ae==j*ie&&(oe<0&&ie<oe||oe==ie||oe>0&&ie>oe)&&(j<0&&ae<j||j==ae||j>0&&ae>j)){$=z,V=re;continue}g[y++]=$,g[y++]=V,k=$,L=V,$=z,V=re}return g[y++]=$,g[y++]=V,y}function quantizeArray(t,e,n,r,i,g,y,k){for(let L=0,$=n.length;L<$;++L){const V=n[L];y=quantize(t,e,V,r,i,g,y),k.push(y),e=V}return y}function quantizeMultiArray(t,e,n,r,i,g,y,k){for(let L=0,$=n.length;L<$;++L){const V=n[L],z=[];y=quantizeArray(t,e,V,r,i,g,y,z),k.push(z),e=V[V.length-1]}return y}function inflateCoordinates(t,e,n,r,i){i=i!==void 0?i:[];let g=0;for(let y=e;y<n;y+=r)i[g++]=t.slice(y,y+r);return i.length=g,i}function inflateCoordinatesArray(t,e,n,r,i){i=i!==void 0?i:[];let g=0;for(let y=0,k=n.length;y<k;++y){const L=n[y];i[g++]=inflateCoordinates(t,e,L,r,i[g]),e=L}return i.length=g,i}function inflateMultiCoordinatesArray(t,e,n,r,i){i=i!==void 0?i:[];let g=0;for(let y=0,k=n.length;y<k;++y){const L=n[y];i[g++]=L.length===1&&L[0]===e?[]:inflateCoordinatesArray(t,e,L,r,i[g]),e=L[L.length-1]}return i.length=g,i}function linearRing(t,e,n,r){let i=0;const g=t[n-r],y=t[n-r+1];let k=0,L=0;for(;e<n;e+=r){const $=t[e]-g,V=t[e+1]-y;i+=L*$-k*V,k=$,L=V}return i/2}function linearRings(t,e,n,r){let i=0;for(let g=0,y=n.length;g<y;++g){const k=n[g];i+=linearRing(t,e,k,r),e=k}return i}function linearRingss$1(t,e,n,r){let i=0;for(let g=0,y=n.length;g<y;++g){const k=n[g];i+=linearRings(t,e,k,r),e=k[k.length-1]}return i}class LinearRing extends SimpleGeometry{constructor(e,n){super(),this.maxDelta_=-1,this.maxDeltaRevision_=-1,n!==void 0&&!Array.isArray(e[0])?this.setFlatCoordinates(n,e):this.setCoordinates(e,n)}clone(){return new LinearRing(this.flatCoordinates.slice(),this.layout)}closestPointXY(e,n,r,i){return i<closestSquaredDistanceXY(this.getExtent(),e,n)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(maxSquaredDelta(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),assignClosestPoint(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,e,n,r,i))}getArea(){return linearRing(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return inflateCoordinates(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(e){const n=[];return n.length=douglasPeucker(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,n,0),new LinearRing(n,"XY")}getType(){return"LinearRing"}intersectsExtent(e){return!1}setCoordinates(e,n){this.setLayout(n,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=deflateCoordinates(this.flatCoordinates,0,e,this.stride),this.changed()}}class Point extends SimpleGeometry{constructor(e,n){super(),this.setCoordinates(e,n)}clone(){const e=new Point(this.flatCoordinates.slice(),this.layout);return e.applyProperties(this),e}closestPointXY(e,n,r,i){const g=this.flatCoordinates,y=squaredDistance$1(e,n,g[0],g[1]);if(y<i){const k=this.stride;for(let L=0;L<k;++L)r[L]=g[L];return r.length=k,y}return i}getCoordinates(){return this.flatCoordinates.slice()}computeExtent(e){return createOrUpdateFromCoordinate(this.flatCoordinates,e)}getType(){return"Point"}intersectsExtent(e){return containsXY(e,this.flatCoordinates[0],this.flatCoordinates[1])}setCoordinates(e,n){this.setLayout(n,e,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=deflateCoordinate(this.flatCoordinates,0,e,this.stride),this.changed()}}function linearRingContainsExtent(t,e,n,r,i){return!forEachCorner(i,function(y){return!linearRingContainsXY(t,e,n,r,y[0],y[1])})}function linearRingContainsXY(t,e,n,r,i,g){let y=0,k=t[n-r],L=t[n-r+1];for(;e<n;e+=r){const $=t[e],V=t[e+1];L<=g?V>g&&($-k)*(g-L)-(i-k)*(V-L)>0&&y++:V<=g&&($-k)*(g-L)-(i-k)*(V-L)<0&&y--,k=$,L=V}return y!==0}function linearRingsContainsXY(t,e,n,r,i,g){if(n.length===0||!linearRingContainsXY(t,e,n[0],r,i,g))return!1;for(let y=1,k=n.length;y<k;++y)if(linearRingContainsXY(t,n[y-1],n[y],r,i,g))return!1;return!0}function linearRingssContainsXY(t,e,n,r,i,g){if(n.length===0)return!1;for(let y=0,k=n.length;y<k;++y){const L=n[y];if(linearRingsContainsXY(t,e,L,r,i,g))return!0;e=L[L.length-1]}return!1}function getInteriorPointOfArray(t,e,n,r,i,g,y){let k,L,$,V,z,re,oe;const j=i[g+1],ie=[];for(let de=0,pe=n.length;de<pe;++de){const le=n[de];for(V=t[le-r],re=t[le-r+1],k=e;k<le;k+=r)z=t[k],oe=t[k+1],(j<=re&&oe<=j||re<=j&&j<=oe)&&($=(j-re)/(oe-re)*(z-V)+V,ie.push($)),V=z,re=oe}let ae=NaN,ue=-1/0;for(ie.sort(ascending),V=ie[0],k=1,L=ie.length;k<L;++k){z=ie[k];const de=Math.abs(z-V);de>ue&&($=(V+z)/2,linearRingsContainsXY(t,e,n,r,$,j)&&(ae=$,ue=de)),V=z}return isNaN(ae)&&(ae=i[g]),y?(y.push(ae,j,ue),y):[ae,j,ue]}function getInteriorPointsOfMultiArray(t,e,n,r,i){let g=[];for(let y=0,k=n.length;y<k;++y){const L=n[y];g=getInteriorPointOfArray(t,e,L,r,i,2*y,g),e=L[L.length-1]}return g}function forEach(t,e,n,r,i){let g;for(e+=r;e<n;e+=r)if(g=i(t.slice(e-r,e),t.slice(e,e+r)),g)return g;return!1}function intersectsLineString(t,e,n,r,i){const g=extendFlatCoordinates(createEmpty(),t,e,n,r);return intersects$1(i,g)?containsExtent(i,g)||g[0]>=i[0]&&g[2]<=i[2]||g[1]>=i[1]&&g[3]<=i[3]?!0:forEach(t,e,n,r,function(y,k){return intersectsSegment(i,y,k)}):!1}function intersectsLineStringArray(t,e,n,r,i){for(let g=0,y=n.length;g<y;++g){if(intersectsLineString(t,e,n[g],r,i))return!0;e=n[g]}return!1}function intersectsLinearRing(t,e,n,r,i){return!!(intersectsLineString(t,e,n,r,i)||linearRingContainsXY(t,e,n,r,i[0],i[1])||linearRingContainsXY(t,e,n,r,i[0],i[3])||linearRingContainsXY(t,e,n,r,i[2],i[1])||linearRingContainsXY(t,e,n,r,i[2],i[3]))}function intersectsLinearRingArray(t,e,n,r,i){if(!intersectsLinearRing(t,e,n[0],r,i))return!1;if(n.length===1)return!0;for(let g=1,y=n.length;g<y;++g)if(linearRingContainsExtent(t,n[g-1],n[g],r,i)&&!intersectsLineString(t,n[g-1],n[g],r,i))return!1;return!0}function intersectsLinearRingMultiArray(t,e,n,r,i){for(let g=0,y=n.length;g<y;++g){const k=n[g];if(intersectsLinearRingArray(t,e,k,r,i))return!0;e=k[k.length-1]}return!1}function coordinates(t,e,n,r){for(;e<n-r;){for(let i=0;i<r;++i){const g=t[e+i];t[e+i]=t[n-r+i],t[n-r+i]=g}e+=r,n-=r}}function linearRingIsClockwise(t,e,n,r){let i=0,g=t[n-r],y=t[n-r+1];for(;e<n;e+=r){const k=t[e],L=t[e+1];i+=(k-g)*(L+y),g=k,y=L}return i===0?void 0:i>0}function linearRingsAreOriented(t,e,n,r,i){i=i!==void 0?i:!1;for(let g=0,y=n.length;g<y;++g){const k=n[g],L=linearRingIsClockwise(t,e,k,r);if(g===0){if(i&&L||!i&&!L)return!1}else if(i&&!L||!i&&L)return!1;e=k}return!0}function linearRingssAreOriented(t,e,n,r,i){for(let g=0,y=n.length;g<y;++g){const k=n[g];if(!linearRingsAreOriented(t,e,k,r,i))return!1;k.length&&(e=k[k.length-1])}return!0}function orientLinearRings(t,e,n,r,i){i=i!==void 0?i:!1;for(let g=0,y=n.length;g<y;++g){const k=n[g],L=linearRingIsClockwise(t,e,k,r);(g===0?i&&L||!i&&!L:i&&!L||!i&&L)&&coordinates(t,e,k,r),e=k}return e}function orientLinearRingsArray(t,e,n,r,i){for(let g=0,y=n.length;g<y;++g)e=orientLinearRings(t,e,n[g],r,i);return e}function inflateEnds(t,e){const n=[];let r=0,i=0,g;for(let y=0,k=e.length;y<k;++y){const L=e[y],$=linearRingIsClockwise(t,r,L,2);if(g===void 0&&(g=$),$===g)n.push(e.slice(i,y+1));else{if(n.length===0)continue;n[n.length-1].push(e[i])}i=y+1,r=L}return n}class Polygon extends SimpleGeometry{constructor(e,n,r){super(),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,n!==void 0&&r?(this.setFlatCoordinates(n,e),this.ends_=r):this.setCoordinates(e,n)}appendLinearRing(e){this.flatCoordinates?extend$2(this.flatCoordinates,e.getFlatCoordinates()):this.flatCoordinates=e.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const e=new Polygon(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return e.applyProperties(this),e}closestPointXY(e,n,r,i){return i<closestSquaredDistanceXY(this.getExtent(),e,n)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(arrayMaxSquaredDelta(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),assignClosestArrayPoint(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,e,n,r,i))}containsXY(e,n){return linearRingsContainsXY(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,n)}getArea(){return linearRings(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(e){let n;return e!==void 0?(n=this.getOrientedFlatCoordinates().slice(),orientLinearRings(n,0,this.ends_,this.stride,e)):n=this.flatCoordinates,inflateCoordinatesArray(n,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){const e=getCenter$1(this.getExtent());this.flatInteriorPoint_=getInteriorPointOfArray(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new Point(this.getFlatInteriorPoint(),"XYM")}getLinearRingCount(){return this.ends_.length}getLinearRing(e){return e<0||this.ends_.length<=e?null:new LinearRing(this.flatCoordinates.slice(e===0?0:this.ends_[e-1],this.ends_[e]),this.layout)}getLinearRings(){const e=this.layout,n=this.flatCoordinates,r=this.ends_,i=[];let g=0;for(let y=0,k=r.length;y<k;++y){const L=r[y],$=new LinearRing(n.slice(g,L),e);i.push($),g=L}return i}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const e=this.flatCoordinates;linearRingsAreOriented(e,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=e:(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=orientLinearRings(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(e){const n=[],r=[];return n.length=quantizeArray(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(e),n,0,r),new Polygon(n,"XY",r)}getType(){return"Polygon"}intersectsExtent(e){return intersectsLinearRingArray(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e)}setCoordinates(e,n){this.setLayout(n,e,2),this.flatCoordinates||(this.flatCoordinates=[]);const r=deflateCoordinatesArray(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=r.length===0?0:r[r.length-1],this.changed()}}function fromExtent(t){if(isEmpty(t))throw new Error("Cannot create polygon from empty extent");const e=t[0],n=t[1],r=t[2],i=t[3],g=[e,n,e,i,r,i,r,n,e,n];return new Polygon(g,"XY",[g.length])}const RenderEventType={PRERENDER:"prerender",POSTRENDER:"postrender",PRECOMPOSE:"precompose",POSTCOMPOSE:"postcompose",RENDERCOMPLETE:"rendercomplete"},ImageState={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4},rgb={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]};var xyz={name:"xyz",min:[0,0,0],channel:["X","Y","Z"],alias:["XYZ","ciexyz","cie1931"]};xyz.whitepoint={2:{A:[109.85,100,35.585],C:[98.074,100,118.232],D50:[96.422,100,82.521],D55:[95.682,100,92.149],D65:[95.045592705167,100,108.9057750759878],D75:[94.972,100,122.638],F2:[99.187,100,67.395],F7:[95.044,100,108.755],F11:[100.966,100,64.37],E:[100,100,100]},10:{A:[111.144,100,35.2],C:[97.285,100,116.145],D50:[96.72,100,81.427],D55:[95.799,100,90.926],D65:[94.811,100,107.304],D75:[94.416,100,120.641],F2:[103.28,100,69.026],F7:[95.792,100,107.687],F11:[103.866,100,65.627],E:[100,100,100]}},xyz.max=xyz.whitepoint[2].D65,xyz.rgb=function(t,e){e=e||xyz.whitepoint[2].E;var n=t[0]/e[0],r=t[1]/e[1],i=t[2]/e[2],g,y,k;return g=n*3.240969941904521+r*-1.537383177570093+i*-.498610760293,y=n*-.96924363628087+r*1.87596750150772+i*.041555057407175,k=n*.055630079696993+r*-.20397695888897+i*1.056971514242878,g=g>.0031308?1.055*Math.pow(g,1/2.4)-.055:g=g*12.92,y=y>.0031308?1.055*Math.pow(y,1/2.4)-.055:y=y*12.92,k=k>.0031308?1.055*Math.pow(k,1/2.4)-.055:k=k*12.92,g=Math.min(Math.max(0,g),1),y=Math.min(Math.max(0,y),1),k=Math.min(Math.max(0,k),1),[g*255,y*255,k*255]},rgb.xyz=function(t,e){var n=t[0]/255,r=t[1]/255,i=t[2]/255;n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92;var g=n*.41239079926595+r*.35758433938387+i*.18048078840183,y=n*.21263900587151+r*.71516867876775+i*.072192315360733,k=n*.019330818715591+r*.11919477979462+i*.95053215224966;return e=e||xyz.whitepoint[2].E,[g*e[0],y*e[1],k*e[2]]};const luv={name:"luv",min:[0,-134,-140],max:[100,224,122],channel:["lightness","u","v"],alias:["LUV","cieluv","cie1976"],xyz:function(t,e,n){var r,i,g,y,k,L,$,V,z,re,oe,j,ie;if(g=t[0],y=t[1],k=t[2],g===0)return[0,0,0];var ae=.0011070564598794539;return e=e||"D65",n=n||2,z=xyz.whitepoint[n][e][0],re=xyz.whitepoint[n][e][1],oe=xyz.whitepoint[n][e][2],j=4*z/(z+15*re+3*oe),ie=9*re/(z+15*re+3*oe),r=y/(13*g)+j||0,i=k/(13*g)+ie||0,$=g>8?re*Math.pow((g+16)/116,3):re*g*ae,L=$*9*r/(4*i)||0,V=$*(12-3*r-20*i)/(4*i)||0,[L,$,V]}};xyz.luv=function(t,e,n){var r,i,g,y,k,L,$,V,z,re,oe,j,ie,ae=.008856451679035631,ue=903.2962962962961;e=e||"D65",n=n||2,z=xyz.whitepoint[n][e][0],re=xyz.whitepoint[n][e][1],oe=xyz.whitepoint[n][e][2],j=4*z/(z+15*re+3*oe),ie=9*re/(z+15*re+3*oe),L=t[0],$=t[1],V=t[2],r=4*L/(L+15*$+3*V)||0,i=9*$/(L+15*$+3*V)||0;var de=$/re;return g=de<=ae?ue*de:116*Math.pow(de,1/3)-16,y=13*g*(r-j),k=13*g*(i-ie),[g,y,k]};var lchuv={name:"lchuv",channel:["lightness","chroma","hue"],alias:["LCHuv","cielchuv"],min:[0,0,0],max:[100,100,360],luv:function(t){var e=t[0],n=t[1],r=t[2],i,g,y;return y=r/360*2*Math.PI,i=n*Math.cos(y),g=n*Math.sin(y),[e,i,g]},xyz:function(t){return luv.xyz(lchuv.luv(t))}};luv.lchuv=function(t){var e=t[0],n=t[1],r=t[2],i=Math.sqrt(n*n+r*r),g=Math.atan2(r,n),y=g*360/2/Math.PI;return y<0&&(y+=360),[e,i,y]},xyz.lchuv=function(t){return luv.lchuv(xyz.luv(t))};const names={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};var baseHues={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function parse$1(t){var V,z;var e,n=[],r=1,i;if(typeof t=="number")return{space:"rgb",values:[t>>>16,(t&65280)>>>8,t&255],alpha:1};if(typeof t=="number")return{space:"rgb",values:[t>>>16,(t&65280)>>>8,t&255],alpha:1};if(t=String(t).toLowerCase(),names[t])n=names[t].slice(),i="rgb";else if(t==="transparent")r=0,i="rgb",n=[0,0,0];else if(t[0]==="#"){var g=t.slice(1),y=g.length,k=y<=4;r=1,k?(n=[parseInt(g[0]+g[0],16),parseInt(g[1]+g[1],16),parseInt(g[2]+g[2],16)],y===4&&(r=parseInt(g[3]+g[3],16)/255)):(n=[parseInt(g[0]+g[1],16),parseInt(g[2]+g[3],16),parseInt(g[4]+g[5],16)],y===8&&(r=parseInt(g[6]+g[7],16)/255)),n[0]||(n[0]=0),n[1]||(n[1]=0),n[2]||(n[2]=0),i="rgb"}else if(e=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(t)){var L=e[1];i=L.replace(/a$/,"");var $=i==="cmyk"?4:i==="gray"?1:3;n=e[2].trim().split(/\s*[,\/]\s*|\s+/),i==="color"&&(i=n.shift()),n=n.map(function(re,oe){if(re[re.length-1]==="%")return re=parseFloat(re)/100,oe===3?re:i==="rgb"?re*255:i[0]==="h"||i[0]==="l"&&!oe?re*100:i==="lab"?re*125:i==="lch"?oe<2?re*150:re*360:i[0]==="o"&&!oe?re:i==="oklab"?re*.4:i==="oklch"?oe<2?re*.4:re*360:re;if(i[oe]==="h"||oe===2&&i[i.length-1]==="h"){if(baseHues[re]!==void 0)return baseHues[re];if(re.endsWith("deg"))return parseFloat(re);if(re.endsWith("turn"))return parseFloat(re)*360;if(re.endsWith("grad"))return parseFloat(re)*360/400;if(re.endsWith("rad"))return parseFloat(re)*180/Math.PI}return re==="none"?0:parseFloat(re)}),r=n.length>$?n.pop():1}else/[0-9](?:\s|\/|,)/.test(t)&&(n=t.match(/([0-9]+)/g).map(function(re){return parseFloat(re)}),i=((z=(V=t.match(/([a-z])/ig))==null?void 0:V.join(""))==null?void 0:z.toLowerCase())||"rgb");return{space:i,values:n,alpha:r}}const hsl={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(t){var e=t[0]/360,n=t[1]/100,r=t[2]/100,i,g,y,k,L,$=0;if(n===0)return L=r*255,[L,L,L];for(g=r<.5?r*(1+n):r+n-r*n,i=2*r-g,k=[0,0,0];$<3;)y=e+1/3*-($-1),y<0?y++:y>1&&y--,L=6*y<1?i+(g-i)*6*y:2*y<1?g:3*y<2?i+(g-i)*(2/3-y)*6:i,k[$++]=L*255;return k}};rgb.hsl=function(t){var e=t[0]/255,n=t[1]/255,r=t[2]/255,i=Math.min(e,n,r),g=Math.max(e,n,r),y=g-i,k,L,$;return g===i?k=0:e===g?k=(n-r)/y:n===g?k=2+(r-e)/y:r===g&&(k=4+(e-n)/y),k=Math.min(k*60,360),k<0&&(k+=360),$=(i+g)/2,g===i?L=0:$<=.5?L=y/(g+i):L=y/(2-g-i),[k,L*100,$*100]};function rgba(t){Array.isArray(t)&&t.raw&&(t=String.raw(...arguments)),t instanceof Number&&(t=+t);var e,n=parse$1(t);if(!n.space)return[];const r=n.space[0]==="h"?hsl.min:rgb.min,i=n.space[0]==="h"?hsl.max:rgb.max;return e=Array(3),e[0]=Math.min(Math.max(n.values[0],r[0]),i[0]),e[1]=Math.min(Math.max(n.values[1],r[1]),i[1]),e[2]=Math.min(Math.max(n.values[2],r[2]),i[2]),n.space[0]==="h"&&(e=hsl.rgb(e)),e.push(Math.min(Math.max(n.alpha,0),1)),e}const NO_COLOR=[NaN,NaN,NaN,0];function asString(t){return typeof t=="string"?t:toString(t)}const MAX_CACHE_SIZE=1024,cache={};let cacheSize=0;function withAlpha(t){if(t.length===4)return t;const e=t.slice();return e[3]=1,e}function rgbaToLcha(t){const e=xyz.lchuv(rgb.xyz(t));return e[3]=t[3],e}function lchaToRgba(t){const e=xyz.rgb(lchuv.xyz(t));return e[3]=t[3],e}function fromString(t){if(t==="none")return NO_COLOR;if(cache.hasOwnProperty(t))return cache[t];if(cacheSize>=MAX_CACHE_SIZE){let n=0;for(const r in cache)n++&3||(delete cache[r],--cacheSize)}const e=rgba(t);if(e.length!==4)throw new Error('failed to parse "'+t+'" as color');for(const n of e)if(isNaN(n))throw new Error('failed to parse "'+t+'" as color');return normalize(e),cache[t]=e,++cacheSize,e}function asArray(t){return Array.isArray(t)?t:fromString(t)}function normalize(t){return t[0]=clamp(t[0]+.5|0,0,255),t[1]=clamp(t[1]+.5|0,0,255),t[2]=clamp(t[2]+.5|0,0,255),t[3]=clamp(t[3],0,1),t}function toString(t){let e=t[0];e!=(e|0)&&(e=e+.5|0);let n=t[1];n!=(n|0)&&(n=n+.5|0);let r=t[2];r!=(r|0)&&(r=r+.5|0);const i=t[3]===void 0?1:Math.round(t[3]*1e3)/1e3;return"rgba("+e+","+n+","+r+","+i+")"}const ua=typeof navigator<"u"&&typeof navigator.userAgent<"u"?navigator.userAgent.toLowerCase():"",FIREFOX=ua.includes("firefox"),SAFARI=ua.includes("safari")&&!ua.includes("chrom");SAFARI&&(ua.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(ua));const WEBKIT=ua.includes("webkit")&&!ua.includes("edge"),MAC=ua.includes("macintosh"),DEVICE_PIXEL_RATIO=typeof devicePixelRatio<"u"?devicePixelRatio:1,WORKER_OFFSCREEN_CANVAS=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,IMAGE_DECODE=typeof Image<"u"&&Image.prototype.decode,PASSIVE_EVENT_LISTENERS=function(){let t=!1;try{const e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch{}return t}();function createCanvasContext2D(t,e,n,r){let i;return n&&n.length?i=n.shift():WORKER_OFFSCREEN_CANVAS?i=new OffscreenCanvas(t||300,e||300):i=document.createElement("canvas"),t&&(i.width=t),e&&(i.height=e),i.getContext("2d",r)}let sharedCanvasContext;function getSharedCanvasContext2D(){return sharedCanvasContext||(sharedCanvasContext=createCanvasContext2D(1,1)),sharedCanvasContext}function releaseCanvas(t){const e=t.canvas;e.width=1,e.height=1,t.clearRect(0,0,1,1)}function outerWidth(t){let e=t.offsetWidth;const n=getComputedStyle(t);return e+=parseInt(n.marginLeft,10)+parseInt(n.marginRight,10),e}function outerHeight(t){let e=t.offsetHeight;const n=getComputedStyle(t);return e+=parseInt(n.marginTop,10)+parseInt(n.marginBottom,10),e}function replaceNode(t,e){const n=e.parentNode;n&&n.replaceChild(t,e)}function removeChildren(t){for(;t.lastChild;)t.lastChild.remove()}function replaceChildren(t,e){const n=t.childNodes;for(let r=0;;++r){const i=n[r],g=e[r];if(!i&&!g)break;if(i!==g){if(!i){t.appendChild(g);continue}if(!g){t.removeChild(i),--r;continue}t.insertBefore(g,i)}}}function listenImage(t,e,n){const r=t;let i=!0,g=!1,y=!1;const k=[listenOnce(r,EventType.LOAD,function(){y=!0,g||e()})];return r.src&&IMAGE_DECODE?(g=!0,r.decode().then(function(){i&&e()}).catch(function(L){i&&(y?e():n())})):k.push(listenOnce(r,EventType.ERROR,n)),function(){i=!1,k.forEach(unlistenByKey)}}function load(t,e){return new Promise((n,r)=>{function i(){y(),n(t)}function g(){y(),r(new Error("Image load error"))}function y(){t.removeEventListener("load",i),t.removeEventListener("error",g)}t.addEventListener("load",i),t.addEventListener("error",g)})}function decodeFallback(t,e){return e&&(t.src=e),t.src&&IMAGE_DECODE?new Promise((n,r)=>t.decode().then(()=>n(t)).catch(i=>t.complete&&t.width?n(t):r(i))):load(t)}class IconImageCache{constructor(){this.cache_={},this.patternCache_={},this.cacheSize_=0,this.maxCacheSize_=1024}clear(){this.cache_={},this.patternCache_={},this.cacheSize_=0}canExpireCache(){return this.cacheSize_>this.maxCacheSize_}expire(){if(this.canExpireCache()){let e=0;for(const n in this.cache_){const r=this.cache_[n];!(e++&3)&&!r.hasListener()&&(delete this.cache_[n],delete this.patternCache_[n],--this.cacheSize_)}}}get(e,n,r){const i=getCacheKey$1(e,n,r);return i in this.cache_?this.cache_[i]:null}getPattern(e,n,r){const i=getCacheKey$1(e,n,r);return i in this.patternCache_?this.patternCache_[i]:null}set(e,n,r,i,g){const y=getCacheKey$1(e,n,r),k=y in this.cache_;this.cache_[y]=i,g&&(i.getImageState()===ImageState.IDLE&&i.load(),i.getImageState()===ImageState.LOADING?i.ready().then(()=>{this.patternCache_[y]=getSharedCanvasContext2D().createPattern(i.getImage(1),"repeat")}):this.patternCache_[y]=getSharedCanvasContext2D().createPattern(i.getImage(1),"repeat")),k||++this.cacheSize_}setSize(e){this.maxCacheSize_=e,this.expire()}}function getCacheKey$1(t,e,n){const r=n?asArray(n):"null";return e+":"+t+":"+r}const shared=new IconImageCache;let taintedTestContext=null;class IconImage extends Target{constructor(e,n,r,i,g){super(),this.hitDetectionImage_=null,this.image_=e,this.crossOrigin_=r,this.canvas_={},this.color_=g,this.imageState_=i===void 0?ImageState.IDLE:i,this.size_=e&&e.width&&e.height?[e.width,e.height]:null,this.src_=n,this.tainted_,this.ready_=null}initializeImage_(){this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)}isTainted_(){if(this.tainted_===void 0&&this.imageState_===ImageState.LOADED){taintedTestContext||(taintedTestContext=createCanvasContext2D(1,1,void 0,{willReadFrequently:!0})),taintedTestContext.drawImage(this.image_,0,0);try{taintedTestContext.getImageData(0,0,1,1),this.tainted_=!1}catch{taintedTestContext=null,this.tainted_=!0}}return this.tainted_===!0}dispatchChangeEvent_(){this.dispatchEvent(EventType.CHANGE)}handleImageError_(){this.imageState_=ImageState.ERROR,this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=ImageState.LOADED,this.size_=[this.image_.width,this.image_.height],this.dispatchChangeEvent_()}getImage(e){return this.image_||this.initializeImage_(),this.replaceColor_(e),this.canvas_[e]?this.canvas_[e]:this.image_}getPixelRatio(e){return this.replaceColor_(e),this.canvas_[e]?e:1}getImageState(){return this.imageState_}getHitDetectionImage(){if(this.image_||this.initializeImage_(),!this.hitDetectionImage_)if(this.isTainted_()){const e=this.size_[0],n=this.size_[1],r=createCanvasContext2D(e,n);r.fillRect(0,0,e,n),this.hitDetectionImage_=r.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_===ImageState.IDLE){this.image_||this.initializeImage_(),this.imageState_=ImageState.LOADING;try{this.src_!==void 0&&(this.image_.src=this.src_)}catch{this.handleImageError_()}this.image_ instanceof HTMLImageElement&&decodeFallback(this.image_,this.src_).then(e=>{this.image_=e,this.handleImageLoad_()}).catch(this.handleImageError_.bind(this))}}replaceColor_(e){if(!this.color_||this.canvas_[e]||this.imageState_!==ImageState.LOADED)return;const n=this.image_,r=createCanvasContext2D(Math.ceil(n.width*e),Math.ceil(n.height*e)),i=r.canvas;r.scale(e,e),r.drawImage(n,0,0),r.globalCompositeOperation="multiply",r.fillStyle=asString(this.color_),r.fillRect(0,0,i.width/e,i.height/e),r.globalCompositeOperation="destination-in",r.drawImage(n,0,0),this.canvas_[e]=i}ready(){return this.ready_||(this.ready_=new Promise(e=>{if(this.imageState_===ImageState.LOADED||this.imageState_===ImageState.ERROR)e();else{const n=()=>{(this.imageState_===ImageState.LOADED||this.imageState_===ImageState.ERROR)&&(this.removeEventListener(EventType.CHANGE,n),e())};this.addEventListener(EventType.CHANGE,n)}})),this.ready_}}function get(t,e,n,r,i,g){let y=e===void 0?void 0:shared.get(e,n,i);return y||(y=new IconImage(t,t&&"src"in t?t.src||void 0:e,n,r,i),shared.set(e,n,i,y,g)),g&&y&&!shared.getPattern(e,n,i)&&shared.set(e,n,i,y,g),y}class Fill{constructor(e){e=e||{},this.patternImage_=null,this.color_=null,e.color!==void 0&&this.setColor(e.color)}clone(){const e=this.getColor();return new Fill({color:Array.isArray(e)?e.slice():e||void 0})}getColor(){return this.color_}setColor(e){if(e!==null&&typeof e=="object"&&"src"in e){const n=get(null,e.src,"anonymous",void 0,e.offset?null:e.color?e.color:null,!(e.offset&&e.size));n.ready().then(()=>{this.patternImage_=null}),n.getImageState()===ImageState.IDLE&&n.load(),n.getImageState()===ImageState.LOADING&&(this.patternImage_=n)}this.color_=e}getKey(){const e=this.getColor();return e?e instanceof CanvasPattern||e instanceof CanvasGradient?getUid(e):typeof e=="object"&&"src"in e?e.src+":"+e.offset:asArray(e).toString():""}loading(){return!!this.patternImage_}ready(){return this.patternImage_?this.patternImage_.ready():Promise.resolve()}}function interpolatePoint(t,e,n,r,i,g,y){let k,L;const $=(n-e)/r;if($===1)k=e;else if($===2)k=e,L=i;else if($!==0){let V=t[e],z=t[e+1],re=0;const oe=[0];for(let ae=e+r;ae<n;ae+=r){const ue=t[ae],de=t[ae+1];re+=Math.sqrt((ue-V)*(ue-V)+(de-z)*(de-z)),oe.push(re),V=ue,z=de}const j=i*re,ie=binarySearch(oe,j);ie<0?(L=(j-oe[-ie-2])/(oe[-ie-1]-oe[-ie-2]),k=e+(-ie-2)*r):k=e+ie*r}y=y>1?y:2,g=g||new Array(y);for(let V=0;V<y;++V)g[V]=k===void 0?NaN:L===void 0?t[k+V]:lerp(t[k+V],t[k+r+V],L);return g}function lineStringCoordinateAtM(t,e,n,r,i,g){if(n==e)return null;let y;if(i<t[e+r-1])return g?(y=t.slice(e,e+r),y[r-1]=i,y):null;if(t[n-1]<i)return g?(y=t.slice(n-r,n),y[r-1]=i,y):null;if(i==t[e+r-1])return t.slice(e,e+r);let k=e/r,L=n/r;for(;k<L;){const re=k+L>>1;i<t[(re+1)*r-1]?L=re:k=re+1}const $=t[k*r-1];if(i==$)return t.slice((k-1)*r,(k-1)*r+r);const V=t[(k+1)*r-1],z=(i-$)/(V-$);y=[];for(let re=0;re<r-1;++re)y.push(lerp(t[(k-1)*r+re],t[k*r+re],z));return y.push(i),y}function lineStringsCoordinateAtM(t,e,n,r,i,g,y){if(y)return lineStringCoordinateAtM(t,e,n[n.length-1],r,i,g);let k;if(i<t[r-1])return g?(k=t.slice(0,r),k[r-1]=i,k):null;if(t[t.length-1]<i)return g?(k=t.slice(t.length-r),k[r-1]=i,k):null;for(let L=0,$=n.length;L<$;++L){const V=n[L];if(e!=V){if(i<t[e+r-1])return null;if(i<=t[V-1])return lineStringCoordinateAtM(t,e,V,r,i,!1);e=V}}return null}function lineStringLength(t,e,n,r){let i=t[e],g=t[e+1],y=0;for(let k=e+r;k<n;k+=r){const L=t[k],$=t[k+1];y+=Math.sqrt((L-i)*(L-i)+($-g)*($-g)),i=L,g=$}return y}class LineString extends SimpleGeometry{constructor(e,n){super(),this.flatMidpoint_=null,this.flatMidpointRevision_=-1,this.maxDelta_=-1,this.maxDeltaRevision_=-1,n!==void 0&&!Array.isArray(e[0])?this.setFlatCoordinates(n,e):this.setCoordinates(e,n)}appendCoordinate(e){extend$2(this.flatCoordinates,e),this.changed()}clone(){const e=new LineString(this.flatCoordinates.slice(),this.layout);return e.applyProperties(this),e}closestPointXY(e,n,r,i){return i<closestSquaredDistanceXY(this.getExtent(),e,n)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(maxSquaredDelta(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),assignClosestPoint(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,e,n,r,i))}forEachSegment(e){return forEach(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}getCoordinateAtM(e,n){return this.layout!="XYM"&&this.layout!="XYZM"?null:(n=n!==void 0?n:!1,lineStringCoordinateAtM(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,n))}getCoordinates(){return inflateCoordinates(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinateAt(e,n){return interpolatePoint(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,n,this.stride)}getLength(){return lineStringLength(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getFlatMidpoint(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_??void 0),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_}getSimplifiedGeometryInternal(e){const n=[];return n.length=douglasPeucker(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,n,0),new LineString(n,"XY")}getType(){return"LineString"}intersectsExtent(e){return intersectsLineString(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}setCoordinates(e,n){this.setLayout(n,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=deflateCoordinates(this.flatCoordinates,0,e,this.stride),this.changed()}}class Stroke{constructor(e){e=e||{},this.color_=e.color!==void 0?e.color:null,this.lineCap_=e.lineCap,this.lineDash_=e.lineDash!==void 0?e.lineDash:null,this.lineDashOffset_=e.lineDashOffset,this.lineJoin_=e.lineJoin,this.miterLimit_=e.miterLimit,this.width_=e.width}clone(){const e=this.getColor();return new Stroke({color:Array.isArray(e)?e.slice():e||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})}getColor(){return this.color_}getLineCap(){return this.lineCap_}getLineDash(){return this.lineDash_}getLineDashOffset(){return this.lineDashOffset_}getLineJoin(){return this.lineJoin_}getMiterLimit(){return this.miterLimit_}getWidth(){return this.width_}setColor(e){this.color_=e}setLineCap(e){this.lineCap_=e}setLineDash(e){this.lineDash_=e}setLineDashOffset(e){this.lineDashOffset_=e}setLineJoin(e){this.lineJoin_=e}setMiterLimit(e){this.miterLimit_=e}setWidth(e){this.width_=e}}function hasArea(t){return t[0]>0&&t[1]>0}function scale$1(t,e,n){return n===void 0&&(n=[0,0]),n[0]=t[0]*e+.5|0,n[1]=t[1]*e+.5|0,n}function toSize(t,e){return Array.isArray(t)?t:(e===void 0?e=[t,t]:(e[0]=t,e[1]=t),e)}class ImageStyle{constructor(e){this.opacity_=e.opacity,this.rotateWithView_=e.rotateWithView,this.rotation_=e.rotation,this.scale_=e.scale,this.scaleArray_=toSize(e.scale),this.displacement_=e.displacement,this.declutterMode_=e.declutterMode}clone(){const e=this.getScale();return new ImageStyle({opacity:this.getOpacity(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getOpacity(){return this.opacity_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getDisplacement(){return this.displacement_}getDeclutterMode(){return this.declutterMode_}getAnchor(){return abstract()}getImage(e){return abstract()}getHitDetectionImage(){return abstract()}getPixelRatio(e){return 1}getImageState(){return abstract()}getImageSize(){return abstract()}getOrigin(){return abstract()}getSize(){return abstract()}setDisplacement(e){this.displacement_=e}setOpacity(e){this.opacity_=e}setRotateWithView(e){this.rotateWithView_=e}setRotation(e){this.rotation_=e}setScale(e){this.scale_=e,this.scaleArray_=toSize(e)}listenImageChange(e){abstract()}load(){abstract()}unlistenImageChange(e){abstract()}ready(){return Promise.resolve()}}function asColorLike(t){return t?Array.isArray(t)?toString(t):typeof t=="object"&&"src"in t?asCanvasPattern(t):t:null}function asCanvasPattern(t){if(!t.offset||!t.size)return shared.getPattern(t.src,"anonymous",t.color);const e=t.src+":"+t.offset,n=shared.getPattern(e,void 0,t.color);if(n)return n;const r=shared.get(t.src,"anonymous",null);if(r.getImageState()!==ImageState.LOADED)return null;const i=createCanvasContext2D(t.size[0],t.size[1]);return i.drawImage(r.getImage(1),t.offset[0],t.offset[1],t.size[0],t.size[1],0,0,t.size[0],t.size[1]),get(i.canvas,e,void 0,ImageState.LOADED,t.color,!0),shared.getPattern(e,void 0,t.color)}const defaultFont="10px sans-serif",defaultFillStyle="#000",defaultLineCap="round",defaultLineDash=[],defaultLineDashOffset=0,defaultLineJoin="round",defaultMiterLimit=10,defaultStrokeStyle="#000",defaultTextAlign="center",defaultTextBaseline="middle",defaultPadding=[0,0,0,0],defaultLineWidth=1,checkedFonts=new BaseObject;let measureContext=null,measureFont;const textHeights={},registerFont=function(){const e="32px ",n=["monospace","serif"],r=n.length,i="wmytzilWMYTZIL@#/&?$%10";let g,y;function k($,V,z){let re=!0;for(let oe=0;oe<r;++oe){const j=n[oe];if(y=measureTextWidth($+" "+V+" "+e+j,i),z!=j){const ie=measureTextWidth($+" "+V+" "+e+z+","+j,i);re=re&&ie!=y}}return!!re}function L(){let $=!0;const V=checkedFonts.getKeys();for(let z=0,re=V.length;z<re;++z){const oe=V[z];if(checkedFonts.get(oe)<100){const[j,ie,ae]=oe.split(`
53
+ hooks.version="2.30.1",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,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 DEFAULT_VALUE$1="--",LOG_DATE_FORMAT_T="YYYY-MM-DDTHH:mm:ss",LOG_DATE_FORMAT_END="YYYY-MM-DDT23:59:59",DATE_PICKER_FORMAT="YYYY-MM-DD",CDN_URL$1="https://static.zhihaoscm.cn/",dateFormat=(t,e=DATE_PICKER_FORMAT)=>t?hooks(t).format(e).replace("Invalid date",DEFAULT_VALUE$1):DEFAULT_VALUE$1,validateNumber=t=>typeof t=="number"?!0:typeof t=="string"?!isNaN(parseFloat(t)):!1;function digitUppercase(t){const e=["角","分"],n=["零","壹","贰","叁","肆","伍","陆","柒","捌","玖"],r=[["元","万","亿"],["","拾","佰","仟"]],i=t<0?"负":"";t=Math.abs(t);let g="";for(let y=0;y<e.length;y++)g+=(n[Math.floor(t*10*Math.pow(10,y))%10]+e[y]).replace(/零./,"");g=g||"整",t=Math.floor(t);for(let y=0;y<r[0].length&&t>0;y++){let k="";for(let L=0;L<r[1].length&&t>0;L++)k=n[t%10]+r[1][L]+k,t=Math.floor(t/10);g=k.replace(/(零.)*零$/,"").replace(/^$/,"零")+r[0][y]+g}return i+g.replace(/(零.)*零元/,"元").replace(/(零.)+/g,"零").replace(/^整$/,"零元整")}const _sfc_main$r=vue.defineComponent({name:"zh-date-picker",__name:"DatePicker",props:{style:{},class:{},modelValue:{}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,r=e,i=k=>Array.isArray(k)?[dateFormat(k[0],LOG_DATE_FORMAT_T),dateFormat(k[1],LOG_DATE_FORMAT_END)]:k&&dateFormat(k,LOG_DATE_FORMAT_T),g=k=>{const L=i(k);r("update:modelValue",L)},y=k=>{const L=i(k);r("change",L)};return(k,L)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass([n.class,"zh-date-picker"])},[vue.createVNode(vue.unref(ElDatePicker),vue.mergeProps(k.$attrs,{style:n.style,"model-value":n.modelValue,"onUpdate:modelValue":g,onChange:y}),null,16,["style","model-value"])],2))}}),ZhDatePicker=withInstall$1(_sfc_main$r),_hoisted_1$i={class:"info-pair"},_hoisted_2$b={class:"info-pair--title"},_hoisted_3$b={key:0,class:"info-pair--title--tip"},_sfc_main$q=vue.defineComponent({name:"zh-detail-sub-title",__name:"DetailSubTitle",props:{title:{},value:{},ellipsis:{type:Boolean},tip:{}},setup(t){const e=t;return(n,r)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$i,[vue.createElementVNode("div",_hoisted_2$b,[vue.createTextVNode(vue.toDisplayString(e.title)+" ",1),n.tip?(vue.openBlock(),vue.createElementBlock("div",_hoisted_3$b,vue.toDisplayString(n.tip),1)):vue.createCommentVNode("",!0)]),vue.createElementVNode("div",{class:vue.normalizeClass(["info-pair--value",{ellipsis:n.ellipsis}])},[vue.renderSlot(n.$slots,"value",{},()=>[vue.createTextVNode(vue.toDisplayString(e.value||vue.unref(DEFAULT_VALUE$1)),1)])],2)]))}}),ZhDetailSubTitle=withInstall$1(_sfc_main$q),_hoisted_1$h={class:"title"},_hoisted_2$a={key:0,class:"sub-title"},_hoisted_3$a={class:"zh-dialog__footer"},_sfc_main$p=vue.defineComponent({name:"ZhDialog",inheritAttrs:!1,__name:"Dialog",props:vue.mergeModels({title:{},subTitle:{},cancelButtonText:{default:"取消"},confirmButtonText:{default:"确定"},confirmButtonDisabled:{type:Boolean,default:!1},closeOnClickModal:{type:Boolean,default:!1},size:{default:"middle"},width:{},appendToBody:{type:Boolean},appendTo:{},beforeClose:{},destroyOnClose:{type:Boolean},closeOnPressEscape:{type:Boolean},lockScroll:{type:Boolean},modal:{type:Boolean},openDelay:{},closeDelay:{},top:{},modelValue:{type:Boolean},modalClass:{},zIndex:{},trapFocus:{type:Boolean},headerAriaLevel:{},center:{type:Boolean},alignCenter:{type:Boolean},closeIcon:{},draggable:{type:Boolean},overflow:{type:Boolean},fullscreen:{type:Boolean},showClose:{type:Boolean},ariaLevel:{}},{modelValue:{type:Boolean,default:!0},modelModifiers:{}}),emits:vue.mergeModels(["submit","close"],["update:modelValue"]),setup(t,{emit:e}){const n=t,r=vue.useModel(t,"modelValue"),i=e,g=()=>{i("close")},y=()=>{i("submit")},k=()=>{i("close")},L={small:"400px",middle:"600px",large:"800px",extraLarge:"920px"},$=vue.computed(()=>n.width?n.width:L[n.size]);return(V,z)=>(vue.openBlock(),vue.createBlock(vue.unref(ElDialog),vue.mergeProps({modelValue:r.value,"onUpdate:modelValue":z[0]||(z[0]=re=>r.value=re),class:"zh-dialog"},V.$attrs,{width:$.value,"close-on-click-modal":V.closeOnClickModal,onClose:k}),{header:vue.withCtx(()=>[vue.renderSlot(V.$slots,"header",{},()=>[vue.createElementVNode("div",_hoisted_1$h,vue.toDisplayString(V.title),1),V.subTitle?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$a,vue.toDisplayString(V.subTitle),1)):vue.createCommentVNode("",!0)])]),footer:vue.withCtx(()=>[vue.renderSlot(V.$slots,"footer",{},()=>[vue.createElementVNode("div",_hoisted_3$a,[vue.createVNode(ZhButton$1,{onClick:g},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(V.cancelButtonText),1)]),_:1}),vue.createVNode(ZhButton$1,{type:"primary",disabled:V.confirmButtonDisabled,onClick:y},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(V.confirmButtonText),1)]),_:1},8,["disabled"])])])]),default:vue.withCtx(()=>[vue.renderSlot(V.$slots,"default")]),_:3},16,["modelValue","width","close-on-click-modal"]))}}),ZhDialog=withInstall$1(_sfc_main$p),_hoisted_1$g={class:"info-pair"},_hoisted_2$9={class:"info-pair--title"},_hoisted_3$9={key:0,class:"info-pair--title--tip"},_sfc_main$o=vue.defineComponent({name:"zh-edit-info-pair",__name:"EditInfoPair",props:{title:{},value:{},ellipsis:{type:Boolean},tip:{}},setup(t){const e=t;return(n,r)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$g,[vue.createElementVNode("div",_hoisted_2$9,[vue.createTextVNode(vue.toDisplayString(e.title)+" ",1),n.tip?(vue.openBlock(),vue.createElementBlock("div",_hoisted_3$9,vue.toDisplayString(n.tip),1)):vue.createCommentVNode("",!0)]),vue.createElementVNode("div",{class:vue.normalizeClass(["info-pair--value",{ellipsis:n.ellipsis}])},[vue.renderSlot(n.$slots,"value",{},()=>[vue.createTextVNode(vue.toDisplayString(e.value||vue.unref(DEFAULT_VALUE$1)),1)],!0)],2)]))}}),EditInfoPair=_export_sfc(_sfc_main$o,[["__scopeId","data-v-c62707eb"]]),ZhEditInfoPair=withInstall$1(EditInfoPair),_hoisted_1$f={class:"file_wrapper"},_hoisted_2$8={key:0,class:"header"},_hoisted_3$8={class:"file_main"},_hoisted_4$5={class:"file"},_hoisted_5$5={class:"file_name"},_sfc_main$n=vue.defineComponent({name:"zh-file-wrapper",__name:"FileWrapper",props:{downLoadUrl:{type:String,default:""},canPreview:{type:Boolean,default:!1},fileName:{type:String,default:DEFAULT_VALUE$1},canDelete:{type:Boolean,default:!1},title:{type:String,default:""},fileId:{type:Number,default:0}},emits:["deleteFile"],setup(t,{emit:e}){const n=t,r=e,i=()=>{n.canDelete&&r("deleteFile",n.fileId)};return(g,y)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$f,[n.title?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$8,vue.toDisplayString(n.title),1)):vue.createCommentVNode("",!0),vue.createElementVNode("div",_hoisted_3$8,[vue.createElementVNode("div",_hoisted_4$5,[y[0]||(y[0]=vue.createElementVNode("div",{class:"file_type mr-12"},[vue.createElementVNode("i",{class:"iconfont icon-xiangmuguanli"})],-1)),vue.createElementVNode("div",_hoisted_5$5,vue.toDisplayString(n.fileName),1)]),vue.createVNode(vue.unref(ElLink),{size:"small",class:"btn",link:"",style:{width:"80px"},href:n.downLoadUrl,underline:!1,download:"download"},{default:vue.withCtx(()=>y[1]||(y[1]=[vue.createTextVNode(" 查看/下载 ")])),_:1},8,["href"]),t.canDelete?(vue.openBlock(),vue.createElementBlock("i",{key:0,class:"iconfont icon-close close",onClick:i})):vue.createCommentVNode("",!0)])]))}}),FileWrapper=_export_sfc(_sfc_main$n,[["__scopeId","data-v-d98ece31"]]),ZhFileWrapper=withInstall$1(FileWrapper),_sfc_main$m=vue.defineComponent({name:"Grid",__name:"Grid",props:{cols:{default:()=>({xs:1,sm:2,md:2,lg:4,xl:4})},collapsed:{type:Boolean,default:!1},collapsedRows:{default:1},gap:{default:16}},setup(t,{expose:e}){const n=t;vue.onBeforeMount(()=>n.collapsed&&L()),vue.onMounted(()=>{r({target:{innerWidth:window.innerWidth}}),window.addEventListener("resize",r)}),vue.onActivated(()=>{r({target:{innerWidth:window.innerWidth}}),window.addEventListener("resize",r)}),vue.onUnmounted(()=>{window.removeEventListener("resize",r)}),vue.onDeactivated(()=>{window.removeEventListener("resize",r)});const r=oe=>{let j=oe.target.innerWidth;switch(!!j){case j<768:i.value="xs";break;case(j>=768&&j<992):i.value="sm";break;case(j>=992&&j<1200):i.value="md";break;case(j>=1200&&j<1920):i.value="lg";break;case j>=1920:i.value="xl";break}};vue.provide("gap",Array.isArray(n.gap)?n.gap[0]:n.gap);let i=vue.ref("xl");vue.provide("breakPoint",i);const g=vue.ref(-1);vue.provide("shouldHiddenIndex",g);const y=vue.computed(()=>typeof n.cols=="object"?n.cols[i.value]??n.cols:n.cols);vue.provide("cols",y);const k=vue.useSlots().default(),L=()=>{var ae,ue,de,pe;let oe=[],j=null;k.forEach(le=>{var he;typeof le.type=="object"&&le.type.name==="GridItem"&&((he=le.props)==null?void 0:he.suffix)!==void 0&&(j=le),typeof le.type=="symbol"&&Array.isArray(le.children)&&oe.push(...le.children)});let ie=0;j&&(ie=(((ae=j.props[i.value])==null?void 0:ae.span)??((ue=j.props)==null?void 0:ue.span)??1)+(((de=j.props[i.value])==null?void 0:de.offset)??((pe=j.props)==null?void 0:pe.offset)??0));try{let le=!1;oe.reduce((he=0,_e,Ce)=>{var xe,Ie,Ne,Ue;if(he+=(((xe=_e.props[i.value])==null?void 0:xe.span)??((Ie=_e.props)==null?void 0:Ie.span)??1)+(((Ne=_e.props[i.value])==null?void 0:Ne.offset)??((Ue=_e.props)==null?void 0:Ue.offset)??0),Number(he)>n.collapsedRows*y.value-ie)throw g.value=Ce,le=!0,"find it";return he},0),le||(g.value=-1)}catch{}};vue.watch(()=>i.value,()=>{n.collapsed&&L()}),vue.watch(()=>n.collapsed,oe=>{if(oe)return L();g.value=-1});const $=vue.computed(()=>typeof n.gap=="number"?`${n.gap}px`:Array.isArray(n.gap)?`${n.gap[1]}px ${n.gap[0]}px`:"unset"),V=vue.computed(()=>({display:"grid",gridGap:$.value,gridTemplateColumns:`repeat(${y.value}, minmax(0, 1fr))`})),z=vue.inject("clearGridItemData",()=>{}),re=vue.ref(!1);return vue.onMounted(()=>{re.value=!0}),vue.onBeforeUpdate(()=>{re.value=!1,z()}),vue.onUpdated(()=>{re.value=!0}),vue.provide("isRegistrationComplete",re),e({breakPoint:i}),(oe,j)=>(vue.openBlock(),vue.createElementBlock("div",{style:vue.normalizeStyle(V.value)},[vue.renderSlot(oe.$slots,"default")],4))}}),_sfc_main$l=vue.defineComponent({name:"GridItem",__name:"GridItem",props:{offset:{default:0},span:{default:1},suffix:{type:Boolean,default:!1},xs:{default:void 0},sm:{default:void 0},md:{default:void 0},lg:{default:void 0},xl:{default:void 0},label:{}},setup(t){const e=t,n=vue.useAttrs(),r=vue.ref(!0),i=vue.inject("breakPoint",vue.ref("xl")),g=vue.inject("shouldHiddenIndex",vue.ref(-1));vue.watch(()=>[g.value,i.value],de=>{n.index&&(r.value=!(de[0]!==-1&&parseInt(n.index)>=Number(de[0])))},{immediate:!0});const y=vue.inject("gap",0),k=vue.inject("cols",vue.ref(4)),L=vue.computed(()=>{var le,he;let de=((le=e[i.value])==null?void 0:le.span)??e.span,pe=((he=e[i.value])==null?void 0:he.offset)??e.offset;return e.suffix?{gridColumnStart:k.value-de-pe+1,gridColumnEnd:`span ${de+pe}`,marginLeft:pe!==0?`calc(((100% + ${y}px) / ${de+pe}) * ${pe})`:"unset"}:{gridColumn:`span ${de+pe>k.value?k.value:de+pe}/span ${de+pe>k.value?k.value:de+pe}`,marginLeft:pe!==0?`calc(((100% + ${y}px) / ${de+pe}) * ${pe})`:"unset"}}),$=vue.inject("gridItemData",vue.reactive({})),V=vue.inject("isMultiGrid",vue.ref(!1)),z=vue.ref(null),re=vue.ref(0),oe=vue.ref(0),j=vue.inject("registerGridItem",null),ie=vue.inject("getColumnData",null),ae=vue.inject("isRegistrationComplete",vue.ref(!1)),ue=()=>{if(z.value&&j){const de=z.value.parentElement;if(de){const pe=z.value.offsetLeft,le=de.offsetWidth/k.value;oe.value=Math.floor(pe/le)+1,le&&j(oe.value,e.label||"")}}};return vue.watchEffect(()=>{if(V.value&&ae.value&&e.label&&z.value&&(ue(),ie)){const de=ie(oe.value);re.value=de.maxWidth||0}}),vue.watch($,()=>{if(ie){const de=ie(oe.value);de.maxWidth!==re.value&&(re.value=de.maxWidth)}}),(de,pe)=>vue.withDirectives((vue.openBlock(),vue.createElementBlock("div",{style:vue.normalizeStyle(L.value),ref_key:"gridItemRef",ref:z},[vue.renderSlot(de.$slots,"default",{maxLabelWidthInCol:re.value,columnIndex:oe.value})],4)),[[vue.vShow,r.value]])}}),DEFAULT_FONT_SIZE=12;function findItemNested(t,e,n,r){return t.reduce((i,g)=>{if(i)return i;if(g[n]===e)return g;if(g[r])return findItemNested(g[r],e,n,r)},null)}function getValueByProp(t,e,n){const r=isUndefined$2(n)?DEFAULT_VALUE$1:n,i=get$5(t,e);return isNil(i)||i===""?r:i}const $get=getValueByProp;function handleProp(t){const e=t.split(".");return e.length==1?t:e[e.length-1]}function filterEnum(t,e,n,r){const i=(n==null?void 0:n.value)??"value",g=(n==null?void 0:n.label)??"label",y=(n==null?void 0:n.children)??"children";let k={};return Array.isArray(e)&&(k=findItemNested(e,t,i,y)),r=="tag"?k!=null&&k.tagType?k.tagType:"":k?k[g]:DEFAULT_VALUE$1}function filterEnumObj(t,e,n){const r="value",i="children";let g={};return Array.isArray(e)&&(g=findItemNested(e,t,r,i)),g}function formatValue(t){return isArray$2(t)?t.length?t.join(" / "):DEFAULT_VALUE$1:t??DEFAULT_VALUE$1}function handleRowAccordingToProp(t,e){return e.includes(".")?(e.split(".").forEach(n=>t=t[n]??DEFAULT_VALUE$1),t):t[e]??DEFAULT_VALUE$1}const getWidthByText=(t,e)=>{const n=e||DEFAULT_FONT_SIZE,i=document.createElement("canvas").getContext("2d");return i.font=`${n}px Microsoft YaHei`,i.measureText(t).width},useColSetting=t=>{const e=t||"zhihao-col-setting",n=()=>{const k=localStorage.getItem(e);return k?JSON.parse(k):{}},r=k=>{localStorage.setItem(e,JSON.stringify(k))};return{getMap:n,setMap:r,getColumnCache:k=>n()[k]||[],setColumnCache:(k,L)=>{const $=n();$[k]=L,r($)},removeColumnCache:k=>{const L=n();delete L[k],r(L)}}},collectGridItems=()=>{let t=vue.reactive({});return{gridItemData:t,registerGridItem:(i,g)=>{var k;if(!g)return;t[i]||(t[i]={labels:[],maxLength:0,maxWidth:0}),(k=t[i])==null||k.labels.push(g),t[i].maxLength=Math.max(g.length,t[i].maxLength);const y=Math.ceil(getWidthByText(g,14));t[i].maxWidth=Math.max(y||0,t[i].maxWidth)},getColumnData:i=>t[i]||{},clearGridItemData:()=>{t=vue.reactive({})}}},_hoisted_1$e={class:"multi-grid"},_sfc_main$k=vue.defineComponent({name:"MultiGrid",__name:"MultiGrid",setup(t){const{getColumnData:e,registerGridItem:n,clearGridItemData:r,gridItemData:i}=collectGridItems();return vue.provide("registerGridItem",n),vue.provide("getColumnData",e),vue.provide("clearGridItemData",r),vue.provide("gridItemData",i),vue.provide("isMultiGrid",vue.ref(!0)),(g,y)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$e,[vue.renderSlot(g.$slots,"default")]))}}),ZhGrid=withInstall$1(_sfc_main$m),ZhGridItem=withInstall$1(_sfc_main$l),ZhMultiGrid=withInstall$1(_sfc_main$k),_hoisted_1$d={class:"info-pair"},_hoisted_2$7={class:"info-pair--title"},_hoisted_3$7={key:0,class:"info-pair--title--tip"},_sfc_main$j=vue.defineComponent({name:"zh-info-pair",__name:"InfoPair",props:{title:{},value:{},ellipsis:{type:Boolean},tip:{}},setup(t){const e=t;return(n,r)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$d,[vue.createElementVNode("div",_hoisted_2$7,[vue.createTextVNode(vue.toDisplayString(e.title)+" ",1),n.tip?(vue.openBlock(),vue.createElementBlock("div",_hoisted_3$7,vue.toDisplayString(n.tip),1)):vue.createCommentVNode("",!0)]),vue.createElementVNode("div",{class:vue.normalizeClass(["info-pair--value",{ellipsis:n.ellipsis}])},[vue.renderSlot(n.$slots,"value",{},()=>[vue.createTextVNode(vue.toDisplayString(e.value||vue.unref(DEFAULT_VALUE$1)),1)],!0)],2)]))}}),InfoPair=_export_sfc(_sfc_main$j,[["__scopeId","data-v-5a1b0655"]]),ZhInfoPair=withInstall$1(InfoPair),_sfc_main$i=vue.defineComponent({name:"zh-input",__name:"Input",props:vue.mergeModels({style:{},class:{default:"zh-default-input"},size:{default:"default"},className:{}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=vue.useAttrs(),n=t,r=vue.useModel(t,"modelValue"),i=()=>{(e.max||Number(e.max)===0)&&Number(r.value)>=e.max&&(r.value=e.max.toString()),(e.min||Number(e.min)===0)&&Number(r.value)<=e.min&&(r.value=e.min.toString())};return(g,y)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(n.class)},[vue.createVNode(vue.unref(ElInput),vue.mergeProps(g.$attrs,{modelValue:r.value,"onUpdate:modelValue":y[0]||(y[0]=k=>r.value=k),size:g.size,onBlur:i}),vue.createSlots({_:2},[vue.renderList(g.$slots,(k,L)=>({name:k,fn:vue.withCtx($=>[vue.renderSlot(g.$slots,k,vue.normalizeProps(vue.guardReactiveProps($)),void 0,!0)])}))]),1040,["modelValue","size"])],2))}}),Input=_export_sfc(_sfc_main$i,[["__scopeId","data-v-ce1df798"]]),ZhInput=withInstall$1(Input),_sfc_main$h=vue.defineComponent({name:"zh-input-number",__name:"InputNumber",props:{style:{},class:{},modelValue:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e,i=vue.useAttrs(),g=($,V=0,z=0,re=0)=>{let oe=($==null?void 0:$.toString())??"",j,ie,ae;return z===0?(oe=oe.replace(/[^\d]/g,""),oe=oe.replace(/^0\d+/g,"0"),V!==0&&(oe=oe.slice(0,V))):(oe=oe.replace(/[^\-\d.]/g,""),oe=oe.replace(/^[^\-\d]/g,""),oe=oe.replace(/\.{2}/g,"."),oe=oe.replace(/^0(\d+)/g,"$1"),j=oe.split(".")||[],j.length>1?(V===0?ie=j[0]:ie=j[0].slice(0,V),ae=j[1].slice(0,z),oe=ie+"."+ae):V!==0&&(oe=oe.slice(0,V))),re!==0&&(oe=oe.slice(0,re)),oe},y=()=>{n.modelValue===""||n.modelValue===void 0||(i.max&&Number(n.modelValue)>i.max&&r("update:modelValue",i.max.toString()),i.min&&Number(n.modelValue)<i.min&&r("update:modelValue",i.min.toString()))},k=$=>$?g($,i.integer,i.precision,i.maxLength):"",L=$=>{/^\d+\.0*$/.test(($==null?void 0:$.toString())||"")||$===""?r("update:modelValue",k($)):r("update:modelValue",Number(k($)))};return($,V)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["input-number",n.class]),style:vue.normalizeStyle(n.style)},[vue.createVNode(vue.unref(ElInput),vue.mergeProps($.$attrs,{"model-value":n.modelValue,"onUpdate:modelValue":L,onBlur:y,style:{width:"100%"},formatter:k}),vue.createSlots({_:2},[vue.renderList(Object.keys($.$slots),z=>({name:z,fn:vue.withCtx(re=>[vue.renderSlot($.$slots,z,vue.normalizeProps(vue.guardReactiveProps(re)),void 0,!0)])}))]),1040,["model-value"])],6))}}),InputNumber=_export_sfc(_sfc_main$h,[["__scopeId","data-v-920e8405"]]),ZhInputNumber=withInstall$1(InputNumber),_hoisted_1$c={class:"loading-box"},_sfc_main$g=vue.defineComponent({name:"zh-loading",__name:"Loading",setup(t){return(e,n)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$c,n[0]||(n[0]=[vue.createElementVNode("div",{class:"loading-wrap"},[vue.createElementVNode("span",{class:"dot dot-spin"},[vue.createElementVNode("i"),vue.createElementVNode("i"),vue.createElementVNode("i"),vue.createElementVNode("i")])],-1)])))}}),Loading=_export_sfc(_sfc_main$g,[["__scopeId","data-v-d30f17c3"]]),ZhLoading=withInstall$1(Loading),defaultOptions={type:"",showCancelButton:!0,showConfirmButton:!0,cancelButtonText:"取消",confirmButtonText:"确定",closeOnClickModal:!1,closeOnPressEscape:!1,showClose:!0,draggable:!1,center:!1,roundButton:!1},ZhMessageBox$1={confirm(t,e,n={}){return ElMessageBox.confirm(t,e,{...defaultOptions,...n,customClass:"zh-message-box zh-message-confirm"})},alert(t,e,n={}){return ElMessageBox.alert(t,e,{...defaultOptions,...n,showCancelButton:!1,customClass:"zh-message-box zh-message-alert"})},prompt(t,e,n={}){return ElMessageBox.prompt(t,e,{...defaultOptions,...n,customClass:"zh-message-box zh-message-prompt"})}},ZhConfirm=ZhMessageBox$1.confirm,ZhAlert=ZhMessageBox$1.alert,ZhPrompt=ZhMessageBox$1.prompt,ZhMessageBox=withInstall$1(ZhMessageBox$1),_sfc_main$f=vue.defineComponent({name:"zh-money-input",__name:"MoneyInput",props:vue.mergeModels({style:{},class:{},showTooltip:{type:Boolean,default:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,n=vue.useModel(t,"modelValue"),r=vue.computed(()=>{if(n.value)return validateNumber(n.value)&&Number(n.value)>=1e3?digitUppercase(Number(n.value)):""}),i=vue.ref(!1);return(g,y)=>(vue.openBlock(),vue.createBlock(vue.unref(ElTooltip),{effect:"dark",content:r.value,placement:"top",visible:g.showTooltip&&i.value&&!!r.value},{default:vue.withCtx(()=>[vue.createVNode(InputNumber,vue.mergeProps(g.$attrs,{modelValue:n.value,"onUpdate:modelValue":y[0]||(y[0]=k=>n.value=k),style:e.style,class:e.class,onFocus:y[1]||(y[1]=()=>i.value=!0),onBlur:y[2]||(y[2]=()=>i.value=!1)}),vue.createSlots({_:2},[vue.renderList(Object.keys(g.$slots),k=>({name:k,fn:vue.withCtx(L=>[vue.renderSlot(g.$slots,k,vue.normalizeProps(vue.guardReactiveProps(L)),void 0,!0)])}))]),1040,["modelValue","style","class"])]),_:3},8,["content","visible"]))}}),MoneyInput=_export_sfc(_sfc_main$f,[["__scopeId","data-v-cfd94d9e"]]),ZhMoneyInput=withInstall$1(MoneyInput),_hoisted_1$b={class:"page-head"},_hoisted_2$6={class:"left-wrap"},_hoisted_3$6={class:"page-name"},_hoisted_4$4={class:"value"},_hoisted_5$4={class:"other-inform"},_hoisted_6$4={class:"label"},_hoisted_7$4={class:"value mg-r-24"},_hoisted_8$3={class:"status"},_sfc_main$e=vue.defineComponent({name:"zh-page-head-panel",__name:"PageHeadPanel",props:{dataSource:{}},setup(t){const e=t,{name:n,no:r,status:i,extendLabel:g,extendValue:y}=vue.toRefs(e.dataSource);return(k,L)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$b,[vue.createElementVNode("div",_hoisted_2$6,[vue.createElementVNode("span",_hoisted_3$6,vue.toDisplayString(vue.unref(n)),1),vue.createElementVNode("div",null,[L[0]||(L[0]=vue.createElementVNode("span",{class:"label mg-l-16"},"编号",-1)),vue.createElementVNode("span",_hoisted_4$4,vue.toDisplayString(vue.unref(r)),1)])]),vue.createElementVNode("div",_hoisted_5$4,[vue.renderSlot(k.$slots,"extend",{},()=>[vue.createElementVNode("span",_hoisted_6$4,vue.toDisplayString(vue.unref(g)),1),vue.createElementVNode("span",_hoisted_7$4,vue.toDisplayString(vue.unref(y)),1)],!0),vue.createElementVNode("span",_hoisted_8$3,vue.toDisplayString(vue.unref(i)),1)])]))}}),PageHeadPanel=_export_sfc(_sfc_main$e,[["__scopeId","data-v-9f56969d"]]),ZhPageHeadPanel=withInstall$1(PageHeadPanel),_sfc_main$d=vue.defineComponent({name:"zh-tool-tips",__name:"ToolTips",props:{placement:{default:"top"},content:{}},setup(t){const e=t;return(n,r)=>(vue.openBlock(),vue.createBlock(vue.unref(ElTooltip),{class:"box-item",effect:"dark",content:e.content,placement:e.placement},{default:vue.withCtx(()=>[vue.renderSlot(n.$slots,"default",{},()=>[r[0]||(r[0]=vue.createElementVNode("i",{class:"iconfont icon-Frame2"},null,-1))],!0)]),_:3},8,["content","placement"]))}}),ToolTips=_export_sfc(_sfc_main$d,[["__scopeId","data-v-e5a0ae09"]]),ZhToolTips=withInstall$1(ToolTips),_sfc_main$c=vue.defineComponent({name:"ZhBaseInfo",__name:"BaseInfo",props:{contentWidth:{default:void 0},labelWidth:{default:"70px"},infoDirection:{default:"vertical"},cols:{default:5},gap:{default:16}},setup(t){const e=t,n=vue.ref(),r=vue.ref(),i=vue.ref();vue.provide("infoLabelWidth",n),vue.provide("infoContentWidth",r),vue.provide("infoDirection",i);function g(){n.value=e.labelWidth}function y(){r.value=e.contentWidth}function k(){i.value=e.infoDirection}return vue.watch(()=>e.contentWidth,()=>y(),{immediate:!0}),vue.watch(()=>e.labelWidth,()=>g(),{immediate:!0}),vue.watch(()=>e.infoDirection,()=>k(),{immediate:!0}),(L,$)=>{const V=vue.resolveComponent("grid");return vue.openBlock(),vue.createBlock(V,{cols:L.cols,gap:L.gap},{default:vue.withCtx(()=>[vue.renderSlot(L.$slots,"default")]),_:3},8,["cols","gap"])}}}),ZhBaseInfo=withInstall$1(_sfc_main$c),_hoisted_1$a={class:"common-card"},_hoisted_2$5={class:"detail-header"},_hoisted_3$5={class:"detail-header--left"},_hoisted_4$3={class:"title common-title"},_hoisted_5$3={class:"info-pair--label"},_hoisted_6$3={class:"info-pair--value"},_hoisted_7$3={key:1,class:"detail-header--right"},_hoisted_8$2={class:"info-pair--label"},_hoisted_9$1={class:"info-pair--value"},_sfc_main$b=vue.defineComponent({name:"ZhDetailHeader",__name:"DetailHeader",props:{title:{},leftInfos:{},rightInfos:{},stateMeta:{},stateDesc:{}},setup(t){const e=vue.useSlots(),n=t;return(r,i)=>{var g,y;return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$a,[vue.createElementVNode("div",null,[vue.renderSlot(r.$slots,"menu",{},void 0,!0)]),vue.createElementVNode("div",_hoisted_2$5,[vue.createElementVNode("div",_hoisted_3$5,[vue.createElementVNode("div",_hoisted_4$3,vue.toDisplayString(n.title),1),vue.renderSlot(r.$slots,"extra-info",{},void 0,!0),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(n.leftInfos,k=>(vue.openBlock(),vue.createElementBlock("div",{class:"info-pair",key:k.value},[vue.createElementVNode("div",_hoisted_5$3,vue.toDisplayString(k.label),1),vue.createElementVNode("div",_hoisted_6$3,vue.toDisplayString(k.value??vue.unref(DEFAULT_VALUE$1)),1)]))),128))]),vue.renderSlot(r.$slots,"default",{},void 0,!0),vue.unref(e)["right-infos"]?vue.renderSlot(r.$slots,"right-infos",{key:0},void 0,!0):(vue.openBlock(),vue.createElementBlock("div",_hoisted_7$3,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(n.rightInfos,k=>(vue.openBlock(),vue.createElementBlock("div",{class:"info-pair",key:k.value},[vue.createElementVNode("div",_hoisted_8$2,vue.toDisplayString(k.label),1),vue.createElementVNode("div",_hoisted_9$1,vue.toDisplayString(k.value??vue.unref(DEFAULT_VALUE$1)),1)]))),128)),r.stateDesc||r.stateMeta?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(["state common-title",(g=r.stateMeta)==null?void 0:g.state])},vue.toDisplayString(r.stateDesc||((y=r.stateMeta)==null?void 0:y.intro)),3)):vue.createCommentVNode("",!0)]))])])}}}),DetailHeader=_export_sfc(_sfc_main$b,[["__scopeId","data-v-8b185816"]]),ZhDetailHeader=withInstall$1(DetailHeader);var DIY_DATA_TYPE=(t=>(t.AUTOCOMPLETE="autocomplete",t.FORMAT="format",t.TEXT="text",t))(DIY_DATA_TYPE||{});const _hoisted_1$9={key:0},_hoisted_2$4={key:1,class:"col-edit-header"},_hoisted_3$4=["onClick"],_hoisted_4$2={key:0},_hoisted_5$2={class:"header-operation-container"},_hoisted_6$2={class:"operation-container"},_hoisted_7$2=["onClick"],ZH_DIV="$ZH_DIV$",_sfc_main$a=vue.defineComponent({name:"zh-diy-data-table",__name:"DiyDataTable",props:vue.mergeModels({isEdit:{type:Boolean,default:!1},maxRowLength:{default:50},maxColLength:{default:10},defaultMinWidth:{default:120},beforeAddRow:{},addRowText:{default:"增行"},addColumnText:{default:"增列"},customAddRow:{type:Boolean,default:!0},customAddColumn:{type:Boolean,default:!0}},{rawData:{required:!0},rawDataModifiers:{}}),emits:["update:rawData"],setup(t,{expose:e}){const n=t,r=vue.useModel(t,"rawData"),i=vue.ref([]),g=()=>{if(r.value.length===n.maxRowLength){ElMessage({message:`最多添加${n.maxRowLength}行`,type:"warning"});return}let j={};n.beforeAddRow&&(j=n.beforeAddRow(r.value)),r.value.push(j)},y=()=>{if(i.value.filter(ae=>ae.isAdd).length>=n.maxColLength){ElMessage({message:`最多添加${n.maxColLength}列`,type:"warning"});return}const ie=String(Date.now());i.value.push({prop:ie,label:"",isEditHeader:!0,isAdd:!0,maxlength:15,minWidth:150,headerMaxlength:15})},k=(j,ie)=>{i.value.splice(j,1),r.value.forEach(ae=>{delete ae[ie.prop]})},L=j=>{j===0&&i.value.forEach(ie=>{ie.isSameData&&(r.value[1][ie.prop]=r.value[0][ie.prop])}),r.value.splice(j,1)},$=(j,ie,ae)=>{ie(ae.completeList.filter(ue=>ue.includes(j)).map(ue=>({value:ue})))},V=j=>[{validator:(ie,ae,ue)=>{if(!i.value[j].label){ue(new Error("请输入表头"));return}ue()},message:"请输入表头",trigger:["blur","change"]}],z=j=>{const ie=[];return j.required&&ie.push({required:!0,message:"请输入"+j.label,trigger:j.slot?void 0:"blur"}),j.varidate&&ie.push({validator:(ae,ue,de)=>{const pe=j.varidate(ue);pe!==!0?de(new Error(pe)):de()},trigger:j.slot?void 0:"blur"}),ie},re=(j,ie)=>{let ae=j;return ie.isSameData&&(ae=r.value[0]||DEFAULT_VALUE$1),ie.formatter?ie.showFormatter?ie.type===DIY_DATA_TYPE.FORMAT?ie.showFormatter(ie.formatter(ae)):ie.showFormatter(ae[ie.prop]):ie.formatter(ae[ie.prop]):ae[ie.prop]||DEFAULT_VALUE$1},oe=vue.ref();return e({initData:(j,ie)=>{console.log("initData",j,ie),j=cloneDeep(j)||[],j.length===0&&j.push({}),ie=[...ie];for(const ae in j[0])if(!ie.some(ue=>ue.prop===ae)){const ue=Date.now()+ae,de=ae.split(ZH_DIV);if(de.length!==2){console.log("keySplit 失败",ae);continue}const pe=Number(de[1]);ie[pe]={prop:ae,isEditHeader:!0,label:de[0],key:ue,isAdd:!0,maxlength:15,headerMaxlength:15}}r.value=j,i.value=ie},getData:async()=>{await oe.value.validate();for(const ie in i.value){const ae=i.value[ie];for(const ue of i.value)if(ae.prop!==ue.prop&&ae.label===ue.label){ElMessage({message:"所有列的表头不可重复",type:"warning"});return}}const j=cloneDeep(r.value);for(const ie in j){const ae=j[ie];for(const ue in i.value){const de=i.value[ue];if(de.isSameData&&ie!=="0"&&(ae[de.prop]=j[0][de.prop]),de.varidate&&!de.varidate(ae[de.prop]))return;if(de.isAdd){const pe=ae[de.prop];delete ae[de.prop];const le=de.label+ZH_DIV+ue;ae[le]=pe}de.formatter&&de.type===DIY_DATA_TYPE.FORMAT&&(ae[de.prop]=de.formatter(ae))}}return console.log("DiyDataTable 获取数据",j,i.value),{data:j,columns:i.value}},updateColumn:(j,ie)=>{const ae=i.value[j].prop;if(i.value[j]=ie,ae!==ie.prop)for(const ue of r.value)ue[ie.prop]=ue[ae],delete ue[ae]},resetColumns:j=>{const ae=i.value.filter(de=>!de.isAdd).reduce((de,pe)=>(j.some(le=>le.prop===pe.prop)||de.push(pe.prop),de),[]);r.value.forEach(de=>{ae.forEach(pe=>{delete de[pe]})});const ue=j.filter(de=>de.isAdd);i.value=[...j,...ue]},onAddRow:g,onAddColumn:y}),(j,ie)=>(vue.openBlock(),vue.createBlock(vue.unref(ElForm),{class:"diy-data-table",model:t.rawData,ref_key:"formRef",ref:oe},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElTable),vue.mergeProps({data:r.value},j.$attrs),{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElTableColumn),{type:"index",label:"序号",width:"132",fixed:"left"}),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(i.value,(ae,ue)=>(vue.openBlock(),vue.createBlock(vue.unref(ElTableColumn),{key:ae.key||ue,prop:ae.prop,label:ae.label,width:ae.width,"min-width":ae.minWidth||j.defaultMinWidth,fixed:ae.fixed},{header:vue.withCtx(()=>[j.isEdit?ae.isEditHeader?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$4,[vue.createVNode(vue.unref(ElFormItem),{prop:`columns.${ue}`,rules:V(ue)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:ae.label,"onUpdate:modelValue":de=>ae.label=de,maxlength:ae.headerMaxlength||20,placeholder:"请输入表头"},null,8,["modelValue","onUpdate:modelValue","maxlength"])]),_:2},1032,["prop","rules"]),ae.isAdd?(vue.openBlock(),vue.createElementBlock("i",{key:0,class:"iconfont icon-close",onClick:de=>k(ue,ae)},null,8,_hoisted_3$4)):vue.createCommentVNode("",!0)])):(vue.openBlock(),vue.createElementBlock("div",{key:2,class:vue.normalizeClass({"is-required-label":ae.required})},vue.toDisplayString(ae.label),3)):(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$9,vue.toDisplayString(ae.label),1))]),default:vue.withCtx(de=>[n.isEdit&&(!ae.isSameData||de.$index===0)&&ae.type!==vue.unref(DIY_DATA_TYPE).TEXT?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:0,prop:`${de.$index}.${ae.prop}`,rules:z(ae),class:vue.normalizeClass(["col-edit-container",{"close-padding":ae.isAdd}])},{default:vue.withCtx(()=>[ae.type===vue.unref(DIY_DATA_TYPE).FORMAT&&ae.formatter?(vue.openBlock(),vue.createElementBlock("div",_hoisted_4$2,vue.toDisplayString(ae.showFormatter?ae.showFormatter(ae.formatter(de.row)):ae.formatter(de.row)),1)):ae.type===vue.unref(DIY_DATA_TYPE).AUTOCOMPLETE?(vue.openBlock(),vue.createBlock(vue.unref(ElAutocomplete),{key:1,modelValue:de.row[ae.prop],"onUpdate:modelValue":pe=>de.row[ae.prop]=pe,placeholder:ae.placeholder||"请输入","fetch-suggestions":(pe,le)=>$(pe,le,ae),maxlength:ae.maxlength||20},null,8,["modelValue","onUpdate:modelValue","placeholder","fetch-suggestions","maxlength"])):ae.slot?vue.renderSlot(j.$slots,ae.slot,{key:2,row:de.row,$index:de.$index},void 0,!0):(vue.openBlock(),vue.createBlock(vue.unref(ElInput),{key:3,modelValue:de.row[ae.prop],"onUpdate:modelValue":pe=>de.row[ae.prop]=pe,placeholder:ae.placeholder||"请输入",formatter:ae.formatter,parser:ae.parser,maxlength:ae.maxlength||20},null,8,["modelValue","onUpdate:modelValue","placeholder","formatter","parser","maxlength"]))]),_:2},1032,["prop","rules","class"])):ae.slot?vue.renderSlot(j.$slots,ae.slot,{key:1,row:de.row,$index:de.$index},void 0,!0):(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:2},[vue.createTextVNode(vue.toDisplayString(re(de.row,ae)),1)],64))]),_:2},1032,["prop","label","width","min-width","fixed"]))),128)),n.isEdit?(vue.openBlock(),vue.createBlock(vue.unref(ElTableColumn),{key:0,width:"150",fixed:"right"},{header:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_5$2,[j.customAddRow?(vue.openBlock(),vue.createBlock(vue.unref(ElButton),{key:0,type:"primary",link:"",onClick:g},{default:vue.withCtx(()=>[ie[0]||(ie[0]=vue.createElementVNode("i",{class:"iconfont icon-Frame1"},null,-1)),vue.createTextVNode(vue.toDisplayString(j.addRowText),1)]),_:1})):vue.createCommentVNode("",!0),j.customAddColumn?(vue.openBlock(),vue.createBlock(vue.unref(ElButton),{key:1,type:"primary",link:"",onClick:y},{default:vue.withCtx(()=>[ie[1]||(ie[1]=vue.createElementVNode("i",{class:"iconfont icon-Frame-11"},null,-1)),vue.createTextVNode(vue.toDisplayString(j.addColumnText),1)]),_:1})):vue.createCommentVNode("",!0)])]),default:vue.withCtx(({$index:ae})=>[vue.createElementVNode("div",_hoisted_6$2,[j.$slots.operation?vue.renderSlot(j.$slots,"operation",{key:0,row:r.value[ae],$index:ae},void 0,!0):(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[r.value.length>1?(vue.openBlock(),vue.createElementBlock("i",{key:0,class:"iconfont icon-close",onClick:ue=>L(ae)},null,8,_hoisted_7$2)):vue.createCommentVNode("",!0)],64))])]),_:3})):vue.createCommentVNode("",!0)]),_:3},16,["data"])]),_:3},8,["model"]))}}),DiyDataTable=_export_sfc(_sfc_main$a,[["__scopeId","data-v-048d82d3"]]),ZhDiyDataTable=withInstall$1(DiyDataTable),METERS_PER_UNIT$1={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};class Projection{constructor(e){this.code_=e.code,this.units_=e.units,this.extent_=e.extent!==void 0?e.extent:null,this.worldExtent_=e.worldExtent!==void 0?e.worldExtent:null,this.axisOrientation_=e.axisOrientation!==void 0?e.axisOrientation:"enu",this.global_=e.global!==void 0?e.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=e.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=e.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||METERS_PER_UNIT$1[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(e){this.global_=e,this.canWrapX_=!!(e&&this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(e){this.defaultTileGrid_=e}setExtent(e){this.extent_=e,this.canWrapX_=!!(this.global_&&e)}setWorldExtent(e){this.worldExtent_=e}setGetPointResolution(e){this.getPointResolutionFunc_=e}getPointResolutionFunc(){return this.getPointResolutionFunc_}}const RADIUS$1=6378137,HALF_SIZE=Math.PI*RADIUS$1,EXTENT$1=[-HALF_SIZE,-HALF_SIZE,HALF_SIZE,HALF_SIZE],WORLD_EXTENT=[-180,-85,180,85],MAX_SAFE_Y=RADIUS$1*Math.log(Math.tan(Math.PI/2));class EPSG3857Projection extends Projection{constructor(e){super({code:e,units:"m",extent:EXTENT$1,global:!0,worldExtent:WORLD_EXTENT,getPointResolution:function(n,r){return n/Math.cosh(r[1]/RADIUS$1)}})}}const PROJECTIONS$1=[new EPSG3857Projection("EPSG:3857"),new EPSG3857Projection("EPSG:102100"),new EPSG3857Projection("EPSG:102113"),new EPSG3857Projection("EPSG:900913"),new EPSG3857Projection("http://www.opengis.net/def/crs/EPSG/0/3857"),new EPSG3857Projection("http://www.opengis.net/gml/srs/epsg.xml#3857")];function fromEPSG4326(t,e,n,r){const i=t.length;n=n>1?n:2,r=r??n,e===void 0&&(n>2?e=t.slice():e=new Array(i));for(let g=0;g<i;g+=r){e[g]=HALF_SIZE*t[g]/180;let y=RADIUS$1*Math.log(Math.tan(Math.PI*(+t[g+1]+90)/360));y>MAX_SAFE_Y?y=MAX_SAFE_Y:y<-MAX_SAFE_Y&&(y=-MAX_SAFE_Y),e[g+1]=y}return e}function toEPSG4326(t,e,n,r){const i=t.length;n=n>1?n:2,r=r??n,e===void 0&&(n>2?e=t.slice():e=new Array(i));for(let g=0;g<i;g+=r)e[g]=180*t[g]/HALF_SIZE,e[g+1]=360*Math.atan(Math.exp(t[g+1]/RADIUS$1))/Math.PI-90;return e}const RADIUS=6378137,EXTENT=[-180,-90,180,90],METERS_PER_UNIT=Math.PI*RADIUS/180;class EPSG4326Projection extends Projection{constructor(e,n){super({code:e,units:"degrees",extent:EXTENT,axisOrientation:n,global:!0,metersPerUnit:METERS_PER_UNIT,worldExtent:EXTENT})}}const PROJECTIONS=[new EPSG4326Projection("CRS:84"),new EPSG4326Projection("EPSG:4326","neu"),new EPSG4326Projection("urn:ogc:def:crs:OGC:1.3:CRS84"),new EPSG4326Projection("urn:ogc:def:crs:OGC:2:84"),new EPSG4326Projection("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new EPSG4326Projection("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new EPSG4326Projection("http://www.opengis.net/def/crs/EPSG/0/4326","neu")];let cache$1={};function get$3(t){return cache$1[t]||cache$1[t.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}function add$2(t,e){cache$1[t]=e}function clear(t){for(const e in t)delete t[e]}function isEmpty$1(t){let e;for(e in t)return!1;return!e}let transforms={};function add$1(t,e,n){const r=t.getCode(),i=e.getCode();r in transforms||(transforms[r]={}),transforms[r][i]=n}function get$2(t,e){return t in transforms&&e in transforms[t]?transforms[t][e]:null}const Relationship={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function boundingExtent(t){const e=createEmpty();for(let n=0,r=t.length;n<r;++n)extendCoordinate(e,t[n]);return e}function _boundingExtentXYs(t,e,n){const r=Math.min.apply(null,t),i=Math.min.apply(null,e),g=Math.max.apply(null,t),y=Math.max.apply(null,e);return createOrUpdate$2(r,i,g,y,n)}function buffer(t,e,n){return n?(n[0]=t[0]-e,n[1]=t[1]-e,n[2]=t[2]+e,n[3]=t[3]+e,n):[t[0]-e,t[1]-e,t[2]+e,t[3]+e]}function clone$1(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t.slice()}function closestSquaredDistanceXY(t,e,n){let r,i;return e<t[0]?r=t[0]-e:t[2]<e?r=e-t[2]:r=0,n<t[1]?i=t[1]-n:t[3]<n?i=n-t[3]:i=0,r*r+i*i}function containsCoordinate(t,e){return containsXY(t,e[0],e[1])}function containsExtent(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}function containsXY(t,e,n){return t[0]<=e&&e<=t[2]&&t[1]<=n&&n<=t[3]}function coordinateRelationship(t,e){const n=t[0],r=t[1],i=t[2],g=t[3],y=e[0],k=e[1];let L=Relationship.UNKNOWN;return y<n?L=L|Relationship.LEFT:y>i&&(L=L|Relationship.RIGHT),k<r?L=L|Relationship.BELOW:k>g&&(L=L|Relationship.ABOVE),L===Relationship.UNKNOWN&&(L=Relationship.INTERSECTING),L}function createEmpty(){return[1/0,1/0,-1/0,-1/0]}function createOrUpdate$2(t,e,n,r,i){return i?(i[0]=t,i[1]=e,i[2]=n,i[3]=r,i):[t,e,n,r]}function createOrUpdateEmpty(t){return createOrUpdate$2(1/0,1/0,-1/0,-1/0,t)}function createOrUpdateFromCoordinate(t,e){const n=t[0],r=t[1];return createOrUpdate$2(n,r,n,r,e)}function createOrUpdateFromFlatCoordinates(t,e,n,r,i){const g=createOrUpdateEmpty(i);return extendFlatCoordinates(g,t,e,n,r)}function equals$2(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function extend$3(t,e){return e[0]<t[0]&&(t[0]=e[0]),e[2]>t[2]&&(t[2]=e[2]),e[1]<t[1]&&(t[1]=e[1]),e[3]>t[3]&&(t[3]=e[3]),t}function extendCoordinate(t,e){e[0]<t[0]&&(t[0]=e[0]),e[0]>t[2]&&(t[2]=e[0]),e[1]<t[1]&&(t[1]=e[1]),e[1]>t[3]&&(t[3]=e[1])}function extendFlatCoordinates(t,e,n,r,i){for(;n<r;n+=i)extendXY(t,e[n],e[n+1]);return t}function extendXY(t,e,n){t[0]=Math.min(t[0],e),t[1]=Math.min(t[1],n),t[2]=Math.max(t[2],e),t[3]=Math.max(t[3],n)}function forEachCorner(t,e){let n;return n=e(getBottomLeft(t)),n||(n=e(getBottomRight(t)),n)||(n=e(getTopRight(t)),n)||(n=e(getTopLeft(t)),n)?n:!1}function getArea$1(t){let e=0;return isEmpty(t)||(e=getWidth(t)*getHeight(t)),e}function getBottomLeft(t){return[t[0],t[1]]}function getBottomRight(t){return[t[2],t[1]]}function getCenter$1(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function getCorner(t,e){let n;if(e==="bottom-left")n=getBottomLeft(t);else if(e==="bottom-right")n=getBottomRight(t);else if(e==="top-left")n=getTopLeft(t);else if(e==="top-right")n=getTopRight(t);else throw new Error("Invalid corner");return n}function getForViewAndSize(t,e,n,r,i){const[g,y,k,L,$,V,z,re]=getRotatedViewport(t,e,n,r);return createOrUpdate$2(Math.min(g,k,$,z),Math.min(y,L,V,re),Math.max(g,k,$,z),Math.max(y,L,V,re),i)}function getRotatedViewport(t,e,n,r){const i=e*r[0]/2,g=e*r[1]/2,y=Math.cos(n),k=Math.sin(n),L=i*y,$=i*k,V=g*y,z=g*k,re=t[0],oe=t[1];return[re-L+z,oe-$-V,re-L-z,oe-$+V,re+L-z,oe+$+V,re+L+z,oe+$-V,re-L+z,oe-$-V]}function getHeight(t){return t[3]-t[1]}function getIntersection(t,e,n){const r=n||createEmpty();return intersects$1(t,e)?(t[0]>e[0]?r[0]=t[0]:r[0]=e[0],t[1]>e[1]?r[1]=t[1]:r[1]=e[1],t[2]<e[2]?r[2]=t[2]:r[2]=e[2],t[3]<e[3]?r[3]=t[3]:r[3]=e[3]):createOrUpdateEmpty(r),r}function getTopLeft(t){return[t[0],t[3]]}function getTopRight(t){return[t[2],t[3]]}function getWidth(t){return t[2]-t[0]}function intersects$1(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function isEmpty(t){return t[2]<t[0]||t[3]<t[1]}function returnOrUpdate(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t}function intersectsSegment(t,e,n){let r=!1;const i=coordinateRelationship(t,e),g=coordinateRelationship(t,n);if(i===Relationship.INTERSECTING||g===Relationship.INTERSECTING)r=!0;else{const y=t[0],k=t[1],L=t[2],$=t[3],V=e[0],z=e[1],re=n[0],oe=n[1],j=(oe-z)/(re-V);let ie,ae;g&Relationship.ABOVE&&!(i&Relationship.ABOVE)&&(ie=re-(oe-$)/j,r=ie>=y&&ie<=L),!r&&g&Relationship.RIGHT&&!(i&Relationship.RIGHT)&&(ae=oe-(re-L)*j,r=ae>=k&&ae<=$),!r&&g&Relationship.BELOW&&!(i&Relationship.BELOW)&&(ie=re-(oe-k)/j,r=ie>=y&&ie<=L),!r&&g&Relationship.LEFT&&!(i&Relationship.LEFT)&&(ae=oe-(re-y)*j,r=ae>=k&&ae<=$)}return r}function applyTransform(t,e,n,r){if(isEmpty(t))return createOrUpdateEmpty(n);let i=[];i=[t[0],t[1],t[2],t[1],t[2],t[3],t[0],t[3]],e(i,i,2);const g=[],y=[];for(let k=0,L=i.length;k<L;k+=2)g.push(i[k]),y.push(i[k+1]);return _boundingExtentXYs(g,y,n)}function wrapX$2(t,e){const n=e.getExtent(),r=getCenter$1(t);if(e.canWrapX()&&(r[0]<n[0]||r[0]>=n[2])){const i=getWidth(n),y=Math.floor((r[0]-n[0])/i)*i;t[0]-=y,t[2]-=y}return t}function wrapAndSliceX(t,e,n){if(e.canWrapX()){const r=e.getExtent();if(!isFinite(t[0])||!isFinite(t[2]))return[[r[0],t[1],r[2],t[3]]];wrapX$2(t,e);const i=getWidth(r);if(getWidth(t)>i&&!n)return[[r[0],t[1],r[2],t[3]]];if(t[0]<r[0])return[[t[0]+i,t[1],r[2],t[3]],[r[0],t[1],t[2],t[3]]];if(t[2]>r[2])return[[t[0],t[1],r[2],t[3]],[r[0],t[1],t[2]-i,t[3]]]}return[t]}function clamp(t,e,n){return Math.min(Math.max(t,e),n)}function squaredSegmentDistance(t,e,n,r,i,g){const y=i-n,k=g-r;if(y!==0||k!==0){const L=((t-n)*y+(e-r)*k)/(y*y+k*k);L>1?(n=i,r=g):L>0&&(n+=y*L,r+=k*L)}return squaredDistance$1(t,e,n,r)}function squaredDistance$1(t,e,n,r){const i=n-t,g=r-e;return i*i+g*g}function solveLinearSystem(t){const e=t.length;for(let r=0;r<e;r++){let i=r,g=Math.abs(t[r][r]);for(let k=r+1;k<e;k++){const L=Math.abs(t[k][r]);L>g&&(g=L,i=k)}if(g===0)return null;const y=t[i];t[i]=t[r],t[r]=y;for(let k=r+1;k<e;k++){const L=-t[k][r]/t[r][r];for(let $=r;$<e+1;$++)r==$?t[k][$]=0:t[k][$]+=L*t[r][$]}}const n=new Array(e);for(let r=e-1;r>=0;r--){n[r]=t[r][e]/t[r][r];for(let i=r-1;i>=0;i--)t[i][e]-=t[i][r]*n[r]}return n}function toDegrees(t){return t*180/Math.PI}function toRadians(t){return t*Math.PI/180}function modulo(t,e){const n=t%e;return n*e<0?n+e:n}function lerp(t,e,n){return t+n*(e-t)}function toFixed(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}function floor(t,e){return Math.floor(toFixed(t,e))}function ceil(t,e){return Math.ceil(toFixed(t,e))}function wrap(t,e,n){if(t>=e&&t<n)return t;const r=n-e;return((t-e)%r+r)%r+e}function add(t,e){return t[0]+=+e[0],t[1]+=+e[1],t}function equals$1(t,e){let n=!0;for(let r=t.length-1;r>=0;--r)if(t[r]!=e[r]){n=!1;break}return n}function rotate$1(t,e){const n=Math.cos(e),r=Math.sin(e),i=t[0]*n-t[1]*r,g=t[1]*n+t[0]*r;return t[0]=i,t[1]=g,t}function scale$3(t,e){return t[0]*=e,t[1]*=e,t}function squaredDistance(t,e){const n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}function distance$1(t,e){return Math.sqrt(squaredDistance(t,e))}function wrapX$1(t,e){if(e.canWrapX()){const n=getWidth(e.getExtent()),r=getWorldsAway(t,e,n);r&&(t[0]-=r*n)}return t}function getWorldsAway(t,e,n){const r=e.getExtent();let i=0;return e.canWrapX()&&(t[0]<r[0]||t[0]>r[2])&&(n=n||getWidth(r),i=Math.floor((t[0]-r[0])/n)),i}const DEFAULT_RADIUS=63710088e-1;function getDistance(t,e,n){n=n||DEFAULT_RADIUS;const r=toRadians(t[1]),i=toRadians(e[1]),g=(i-r)/2,y=toRadians(e[0]-t[0])/2,k=Math.sin(g)*Math.sin(g)+Math.sin(y)*Math.sin(y)*Math.cos(r)*Math.cos(i);return 2*n*Math.atan2(Math.sqrt(k),Math.sqrt(1-k))}function getLengthInternal(t,e){let n=0;for(let r=0,i=t.length;r<i-1;++r)n+=getDistance(t[r],t[r+1],e);return n}function getLength(t,e){e=e||{};const n=e.radius||DEFAULT_RADIUS,r=e.projection||"EPSG:3857",i=t.getType();i!=="GeometryCollection"&&(t=t.clone().transform(r,"EPSG:4326"));let g=0,y,k,L,$,V,z;switch(i){case"Point":case"MultiPoint":break;case"LineString":case"LinearRing":{y=t.getCoordinates(),g=getLengthInternal(y,n);break}case"MultiLineString":case"Polygon":{for(y=t.getCoordinates(),L=0,$=y.length;L<$;++L)g+=getLengthInternal(y[L],n);break}case"MultiPolygon":{for(y=t.getCoordinates(),L=0,$=y.length;L<$;++L)for(k=y[L],V=0,z=k.length;V<z;++V)g+=getLengthInternal(k[V],n);break}case"GeometryCollection":{const re=t.getGeometries();for(L=0,$=re.length;L<$;++L)g+=getLength(re[L],e);break}default:throw new Error("Unsupported geometry type: "+i)}return g}function getAreaInternal(t,e){let n=0;const r=t.length;let i=t[r-1][0],g=t[r-1][1];for(let y=0;y<r;y++){const k=t[y][0],L=t[y][1];n+=toRadians(k-i)*(2+Math.sin(toRadians(g))+Math.sin(toRadians(L))),i=k,g=L}return n*e*e/2}function getArea(t,e){e=e||{};const n=e.radius||DEFAULT_RADIUS,r=e.projection||"EPSG:3857",i=t.getType();i!=="GeometryCollection"&&(t=t.clone().transform(r,"EPSG:4326"));let g=0,y,k,L,$,V,z;switch(i){case"Point":case"MultiPoint":case"LineString":case"MultiLineString":case"LinearRing":break;case"Polygon":{for(y=t.getCoordinates(),g=Math.abs(getAreaInternal(y[0],n)),L=1,$=y.length;L<$;++L)g-=Math.abs(getAreaInternal(y[L],n));break}case"MultiPolygon":{for(y=t.getCoordinates(),L=0,$=y.length;L<$;++L)for(k=y[L],g+=Math.abs(getAreaInternal(k[0],n)),V=1,z=k.length;V<z;++V)g-=Math.abs(getAreaInternal(k[V],n));break}case"GeometryCollection":{const re=t.getGeometries();for(L=0,$=re.length;L<$;++L)g+=getArea(re[L],e);break}default:throw new Error("Unsupported geometry type: "+i)}return g}const K0=.9996,E=.00669438,E2=E*E,E3=E2*E,E_P2=E/(1-E),SQRT_E=Math.sqrt(1-E),_E=(1-SQRT_E)/(1+SQRT_E),_E2=_E*_E,_E3=_E2*_E,_E4=_E3*_E,_E5=_E4*_E,M1=1-E/4-3*E2/64-5*E3/256,M2=3*E/8+3*E2/32+45*E3/1024,M3=15*E2/256+45*E3/1024,M4=35*E3/3072,P2=3/2*_E-27/32*_E3+269/512*_E5,P3=21/16*_E2-55/32*_E4,P4=151/96*_E3-417/128*_E5,P5=1097/512*_E4,R=6378137;function toLonLat$1(t,e,n){const r=t-5e5,y=(n.north?e:e-1e7)/K0/(R*M1),k=y+P2*Math.sin(2*y)+P3*Math.sin(4*y)+P4*Math.sin(6*y)+P5*Math.sin(8*y),L=Math.sin(k),$=L*L,V=Math.cos(k),z=L/V,re=z*z,oe=re*re,j=1-E*$,ie=Math.sqrt(1-E*$),ae=R/ie,ue=(1-E)/j,de=E_P2*V**2,pe=de*de,le=r/(ae*K0),he=le*le,_e=he*le,Ce=_e*le,xe=Ce*le,Ie=xe*le,Ne=k-z/ue*(he/2-Ce/24*(5+3*re+10*de-4*pe-9*E_P2))+Ie/720*(61+90*re+298*de+45*oe-252*E_P2-3*pe);let Ue=(le-_e/6*(1+2*re+de)+xe/120*(5-2*de+28*re-3*pe+8*E_P2+24*oe))/V;return Ue=wrap(Ue+toRadians(zoneToCentralLongitude(n.number)),-Math.PI,Math.PI),[toDegrees(Ue),toDegrees(Ne)]}const MIN_LATITUDE=-80,MAX_LATITUDE=84,MIN_LONGITUDE=-180,MAX_LONGITUDE=180;function fromLonLat$1(t,e,n){t=wrap(t,MIN_LONGITUDE,MAX_LONGITUDE),e<MIN_LATITUDE?e=MIN_LATITUDE:e>MAX_LATITUDE&&(e=MAX_LATITUDE);const r=toRadians(e),i=Math.sin(r),g=Math.cos(r),y=i/g,k=y*y,L=k*k,$=toRadians(t),V=zoneToCentralLongitude(n.number),z=toRadians(V),re=R/Math.sqrt(1-E*i**2),oe=E_P2*g**2,j=g*wrap($-z,-Math.PI,Math.PI),ie=j*j,ae=ie*j,ue=ae*j,de=ue*j,pe=de*j,le=R*(M1*r-M2*Math.sin(2*r)+M3*Math.sin(4*r)-M4*Math.sin(6*r)),he=K0*re*(j+ae/6*(1-k+oe)+de/120*(5-18*k+L+72*oe-58*E_P2))+5e5;let _e=K0*(le+re*y*(ie/2+ue/24*(5-k+9*oe+4*oe**2)+pe/720*(61-58*k+L+600*oe-330*E_P2)));return n.north||(_e+=1e7),[he,_e]}function zoneToCentralLongitude(t){return(t-1)*6-180+3}const epsgRegExes=[/^EPSG:(\d+)$/,/^urn:ogc:def:crs:EPSG::(\d+)$/,/^http:\/\/www\.opengis\.net\/def\/crs\/EPSG\/0\/(\d+)$/];function zoneFromCode(t){let e=0;for(const i of epsgRegExes){const g=t.match(i);if(g){e=parseInt(g[1]);break}}if(!e)return null;let n=0,r=!1;return e>32700&&e<32761?n=e-32700:e>32600&&e<32661&&(r=!0,n=e-32600),n?{number:n,north:r}:null}function makeTransformFunction(t,e){return function(n,r,i,g){const y=n.length;i=i>1?i:2,g=g??i,r||(i>2?r=n.slice():r=new Array(y));for(let k=0;k<y;k+=g){const L=n[k],$=n[k+1],V=t(L,$,e);r[k]=V[0],r[k+1]=V[1]}return r}}function makeProjection(t){return zoneFromCode(t)?new Projection({code:t,units:"m"}):null}function makeTransforms(t){const e=zoneFromCode(t.getCode());return e?{forward:makeTransformFunction(fromLonLat$1,e),inverse:makeTransformFunction(toLonLat$1,e)}:null}function warn(...t){console.warn(...t)}const transformFactories=[makeTransforms],projectionFactories=[makeProjection];let showCoordinateWarning=!0;function disableCoordinateWarning(t){showCoordinateWarning=!1}function cloneTransform(t,e){if(e!==void 0){for(let n=0,r=t.length;n<r;++n)e[n]=t[n];e=e}else e=t.slice();return e}function addProjection(t){add$2(t.getCode(),t),add$1(t,t,cloneTransform)}function addProjections(t){t.forEach(addProjection)}function get$1(t){if(typeof t!="string")return t;const e=get$3(t);if(e)return e;for(const n of projectionFactories){const r=n(t);if(r)return r}return null}function getPointResolution(t,e,n,r){t=get$1(t);let i;const g=t.getPointResolutionFunc();if(g){if(i=g(e,n),r&&r!==t.getUnits()){const y=t.getMetersPerUnit();y&&(i=i*y/METERS_PER_UNIT$1[r])}}else{const y=t.getUnits();if(y=="degrees"&&!r||r=="degrees")i=e;else{const k=getTransformFromProjections(t,get$1("EPSG:4326"));if(!k&&y!=="degrees")i=e*t.getMetersPerUnit();else{let $=[n[0]-e/2,n[1],n[0]+e/2,n[1],n[0],n[1]-e/2,n[0],n[1]+e/2];$=k($,$,2);const V=getDistance($.slice(0,2),$.slice(2,4)),z=getDistance($.slice(4,6),$.slice(6,8));i=(V+z)/2}const L=r?METERS_PER_UNIT$1[r]:t.getMetersPerUnit();L!==void 0&&(i/=L)}}return i}function addEquivalentProjections(t){addProjections(t),t.forEach(function(e){t.forEach(function(n){e!==n&&add$1(e,n,cloneTransform)})})}function addEquivalentTransforms(t,e,n,r){t.forEach(function(i){e.forEach(function(g){add$1(i,g,n),add$1(g,i,r)})})}function createProjection(t,e){return t?typeof t=="string"?get$1(t):t:get$1(e)}function createTransformFromCoordinateTransform(t){return function(e,n,r,i){const g=e.length;r=r!==void 0?r:2,i=i??r,n=n!==void 0?n:new Array(g);for(let y=0;y<g;y+=i){const k=t(e.slice(y,y+r)),L=k.length;for(let $=0,V=i;$<V;++$)n[y+$]=$>=L?e[y+$]:k[$]}return n}}function fromLonLat(t,e){return disableCoordinateWarning(),transform(t,"EPSG:4326","EPSG:3857")}function toLonLat(t,e){const n=transform(t,"EPSG:3857","EPSG:4326"),r=n[0];return(r<-180||r>180)&&(n[0]=modulo(r+180,360)-180),n}function equivalent(t,e){if(t===e)return!0;const n=t.getUnits()===e.getUnits();return(t.getCode()===e.getCode()||getTransformFromProjections(t,e)===cloneTransform)&&n}function getTransformFromProjections(t,e){const n=t.getCode(),r=e.getCode();let i=get$2(n,r);if(i)return i;let g=null,y=null;for(const L of transformFactories)g||(g=L(t)),y||(y=L(e));if(!g&&!y)return null;const k="EPSG:4326";if(y)if(g)i=composeTransformFuncs(g.inverse,y.forward);else{const L=get$2(n,k);L&&(i=composeTransformFuncs(L,y.forward))}else{const L=get$2(k,r);L&&(i=composeTransformFuncs(g.inverse,L))}return i&&(addProjection(t),addProjection(e),add$1(t,e,i)),i}function composeTransformFuncs(t,e){return function(n,r,i,g){return r=t(n,r,i,g),e(r,r,i,g)}}function getTransform(t,e){const n=get$1(t),r=get$1(e);return getTransformFromProjections(n,r)}function transform(t,e,n){const r=getTransform(e,n);if(!r){const i=get$1(e).getCode(),g=get$1(n).getCode();throw new Error(`No transform available between ${i} and ${g}`)}return r(t,void 0,t.length)}function transformExtent(t,e,n,r){const i=getTransform(e,n);return applyTransform(t,i,void 0)}function toUserCoordinate(t,e){return t}function fromUserCoordinate(t,e){return showCoordinateWarning&&!equals$1(t,[0,0])&&t[0]>=-180&&t[0]<=180&&t[1]>=-90&&t[1]<=90&&(showCoordinateWarning=!1,warn("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),t}function toUserExtent(t,e){return t}function fromUserExtent(t,e){return t}function addCommon(){addEquivalentProjections(PROJECTIONS$1),addEquivalentProjections(PROJECTIONS),addEquivalentTransforms(PROJECTIONS,PROJECTIONS$1,fromEPSG4326,toEPSG4326)}addCommon();class BaseEvent{constructor(e){this.propagationStopped,this.defaultPrevented,this.type=e,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}}const ObjectEventType={PROPERTYCHANGE:"propertychange"};class Disposable{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}function binarySearch(t,e,n){let r,i;n=n||ascending;let g=0,y=t.length,k=!1;for(;g<y;)r=g+(y-g>>1),i=+n(t[r],e),i<0?g=r+1:(y=r,k=!i);return k?g:~g}function ascending(t,e){return t>e?1:t<e?-1:0}function descending(t,e){return t<e?1:t>e?-1:0}function linearFindNearest(t,e,n){if(t[0]<=e)return 0;const r=t.length;if(e<=t[r-1])return r-1;if(typeof n=="function"){for(let i=1;i<r;++i){const g=t[i];if(g===e)return i;if(g<e)return n(e,t[i-1],g)>0?i-1:i}return r-1}if(n>0){for(let i=1;i<r;++i)if(t[i]<e)return i-1;return r-1}if(n<0){for(let i=1;i<r;++i)if(t[i]<=e)return i;return r-1}for(let i=1;i<r;++i){if(t[i]==e)return i;if(t[i]<e)return t[i-1]-e<e-t[i]?i-1:i}return r-1}function reverseSubArray(t,e,n){for(;e<n;){const r=t[e];t[e]=t[n],t[n]=r,++e,--n}}function extend$2(t,e){const n=Array.isArray(e)?e:[e],r=n.length;for(let i=0;i<r;i++)t[t.length]=n[i]}function equals(t,e){const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function isSorted(t,e,n){const r=e||ascending;return t.every(function(i,g){if(g===0)return!0;const y=r(t[g-1],i);return!(y>0||y===0)})}function TRUE(){return!0}function FALSE(){return!1}function VOID(){}function memoizeOne(t){let e,n,r;return function(){const i=Array.prototype.slice.call(arguments);return(!n||this!==r||!equals(i,n))&&(r=this,n=i,e=t.apply(this,arguments)),e}}function toPromise(t){function e(){let n;try{n=t()}catch(r){return Promise.reject(r)}return n instanceof Promise?n:Promise.resolve(n)}return e()}class Target extends Disposable{constructor(e){super(),this.eventTarget_=e,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(e,n){if(!e||!n)return;const r=this.listeners_||(this.listeners_={}),i=r[e]||(r[e]=[]);i.includes(n)||i.push(n)}dispatchEvent(e){const n=typeof e=="string",r=n?e:e.type,i=this.listeners_&&this.listeners_[r];if(!i)return;const g=n?new BaseEvent(e):e;g.target||(g.target=this.eventTarget_||this);const y=this.dispatching_||(this.dispatching_={}),k=this.pendingRemovals_||(this.pendingRemovals_={});r in y||(y[r]=0,k[r]=0),++y[r];let L;for(let $=0,V=i.length;$<V;++$)if("handleEvent"in i[$]?L=i[$].handleEvent(g):L=i[$].call(this,g),L===!1||g.propagationStopped){L=!1;break}if(--y[r]===0){let $=k[r];for(delete k[r];$--;)this.removeEventListener(r,VOID);delete y[r]}return L}disposeInternal(){this.listeners_&&clear(this.listeners_)}getListeners(e){return this.listeners_&&this.listeners_[e]||void 0}hasListener(e){return this.listeners_?e?e in this.listeners_:Object.keys(this.listeners_).length>0:!1}removeEventListener(e,n){if(!this.listeners_)return;const r=this.listeners_[e];if(!r)return;const i=r.indexOf(n);i!==-1&&(this.pendingRemovals_&&e in this.pendingRemovals_?(r[i]=VOID,++this.pendingRemovals_[e]):(r.splice(i,1),r.length===0&&delete this.listeners_[e]))}}const EventType={CHANGE:"change",ERROR:"error",BLUR:"blur",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",FOCUS:"focus",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"};function listen(t,e,n,r,i){if(i){const y=n;n=function(){t.removeEventListener(e,n),y.apply(r??this,arguments)}}else r&&r!==t&&(n=n.bind(r));const g={target:t,type:e,listener:n};return t.addEventListener(e,n),g}function listenOnce(t,e,n,r){return listen(t,e,n,r,!0)}function unlistenByKey(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),clear(t))}class Observable extends Target{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(EventType.CHANGE)}getRevision(){return this.revision_}onInternal(e,n){if(Array.isArray(e)){const r=e.length,i=new Array(r);for(let g=0;g<r;++g)i[g]=listen(this,e[g],n);return i}return listen(this,e,n)}onceInternal(e,n){let r;if(Array.isArray(e)){const i=e.length;r=new Array(i);for(let g=0;g<i;++g)r[g]=listenOnce(this,e[g],n)}else r=listenOnce(this,e,n);return n.ol_key=r,r}unInternal(e,n){const r=n.ol_key;if(r)unByKey(r);else if(Array.isArray(e))for(let i=0,g=e.length;i<g;++i)this.removeEventListener(e[i],n);else this.removeEventListener(e,n)}}Observable.prototype.on,Observable.prototype.once,Observable.prototype.un;function unByKey(t){if(Array.isArray(t))for(let e=0,n=t.length;e<n;++e)unlistenByKey(t[e]);else unlistenByKey(t)}function abstract(){throw new Error("Unimplemented abstract method.")}let uidCounter_=0;function getUid(t){return t.ol_uid||(t.ol_uid=String(++uidCounter_))}class ObjectEvent extends BaseEvent{constructor(e,n,r){super(e),this.key=n,this.oldValue=r}}class BaseObject extends Observable{constructor(e){super(),this.on,this.once,this.un,getUid(this),this.values_=null,e!==void 0&&this.setProperties(e)}get(e){let n;return this.values_&&this.values_.hasOwnProperty(e)&&(n=this.values_[e]),n}getKeys(){return this.values_&&Object.keys(this.values_)||[]}getProperties(){return this.values_&&Object.assign({},this.values_)||{}}getPropertiesInternal(){return this.values_}hasProperties(){return!!this.values_}notify(e,n){let r;r=`change:${e}`,this.hasListener(r)&&this.dispatchEvent(new ObjectEvent(r,e,n)),r=ObjectEventType.PROPERTYCHANGE,this.hasListener(r)&&this.dispatchEvent(new ObjectEvent(r,e,n))}addChangeListener(e,n){this.addEventListener(`change:${e}`,n)}removeChangeListener(e,n){this.removeEventListener(`change:${e}`,n)}set(e,n,r){const i=this.values_||(this.values_={});if(r)i[e]=n;else{const g=i[e];i[e]=n,g!==n&&this.notify(e,g)}}setProperties(e,n){for(const r in e)this.set(r,e[r],n)}applyProperties(e){e.values_&&Object.assign(this.values_||(this.values_={}),e.values_)}unset(e,n){if(this.values_&&e in this.values_){const r=this.values_[e];delete this.values_[e],isEmpty$1(this.values_)&&(this.values_=null),n||this.notify(e,r)}}}const MapEventType={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend",LOADSTART:"loadstart",LOADEND:"loadend"};class Control extends BaseObject{constructor(e){super();const n=e.element;n&&!e.target&&!n.style.pointerEvents&&(n.style.pointerEvents="auto"),this.element=n||null,this.target_=null,this.map_=null,this.listenerKeys=[],e.render&&(this.render=e.render),e.target&&this.setTarget(e.target)}disposeInternal(){var e;(e=this.element)==null||e.remove(),super.disposeInternal()}getMap(){return this.map_}setMap(e){var n;this.map_&&((n=this.element)==null||n.remove());for(let r=0,i=this.listenerKeys.length;r<i;++r)unlistenByKey(this.listenerKeys[r]);if(this.listenerKeys.length=0,this.map_=e,e){const r=this.target_??e.getOverlayContainerStopEvent();this.element&&r.appendChild(this.element),this.render!==VOID&&this.listenerKeys.push(listen(e,MapEventType.POSTRENDER,this.render,this)),e.render()}}render(e){}setTarget(e){this.target_=typeof e=="string"?document.getElementById(e):e}}const CLASS_HIDDEN="ol-hidden",CLASS_SELECTABLE="ol-selectable",CLASS_UNSELECTABLE="ol-unselectable",CLASS_CONTROL="ol-control",CLASS_COLLAPSED="ol-collapsed",fontRegEx=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))",`?\\s*([-,\\"\\'\\sa-z]+?)\\s*$`].join(""),"i"),fontRegExMatchIndex=["style","variant","weight","size","lineHeight","family"],getFontParameters=function(t){const e=t.match(fontRegEx);if(!e)return null;const n={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"};for(let r=0,i=fontRegExMatchIndex.length;r<i;++r){const g=e[r+1];g!==void 0&&(n[fontRegExMatchIndex[r]]=g)}return n.families=n.family.split(/,\s?/),n},UNITS_PROP="units",LEADING_DIGITS=[1,2,5],DEFAULT_DPI=25.4/.28;let ScaleLine$1=class extends Control{constructor(e){e=e||{};const n=document.createElement("div");n.style.pointerEvents="none",super({element:n,render:e.render,target:e.target}),this.on,this.once,this.un;const r=e.className!==void 0?e.className:e.bar?"ol-scale-bar":"ol-scale-line";this.innerElement_=document.createElement("div"),this.innerElement_.className=r+"-inner",this.element.className=r+" "+CLASS_UNSELECTABLE,this.element.appendChild(this.innerElement_),this.viewState_=null,this.minWidth_=e.minWidth!==void 0?e.minWidth:64,this.maxWidth_=e.maxWidth,this.renderedVisible_=!1,this.renderedWidth_=void 0,this.renderedHTML_="",this.addChangeListener(UNITS_PROP,this.handleUnitsChanged_),this.setUnits(e.units||"metric"),this.scaleBar_=e.bar||!1,this.scaleBarSteps_=e.steps||4,this.scaleBarText_=e.text||!1,this.dpi_=e.dpi||void 0}getUnits(){return this.get(UNITS_PROP)}handleUnitsChanged_(){this.updateElement_()}setUnits(e){this.set(UNITS_PROP,e)}setDpi(e){this.dpi_=e}updateElement_(){const e=this.viewState_;if(!e){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}const n=e.center,r=e.projection,i=this.getUnits(),g=i=="degrees"?"degrees":"m";let y=getPointResolution(r,e.resolution,n,g);const k=this.minWidth_*(this.dpi_||DEFAULT_DPI)/DEFAULT_DPI,L=this.maxWidth_!==void 0?this.maxWidth_*(this.dpi_||DEFAULT_DPI)/DEFAULT_DPI:void 0;let $=k*y,V="";if(i=="degrees"){const pe=METERS_PER_UNIT$1.degrees;$*=pe,$<pe/60?(V="″",y*=3600):$<pe?(V="′",y*=60):V="°"}else if(i=="imperial")$<.9144?(V="in",y/=.0254):$<1609.344?(V="ft",y/=.3048):(V="mi",y/=1609.344);else if(i=="nautical")y/=1852,V="NM";else if(i=="metric")$<1e-6?(V="nm",y*=1e9):$<.001?(V="μm",y*=1e6):$<1?(V="mm",y*=1e3):$<1e3?V="m":(V="km",y/=1e3);else if(i=="us")$<.9144?(V="in",y*=39.37):$<1609.344?(V="ft",y/=.30480061):(V="mi",y/=1609.3472);else throw new Error("Invalid units");let z=3*Math.floor(Math.log(k*y)/Math.log(10)),re,oe,j,ie,ae,ue;for(;;){j=Math.floor(z/3);const pe=Math.pow(10,j);if(re=LEADING_DIGITS[(z%3+3)%3]*pe,oe=Math.round(re/y),isNaN(oe)){this.element.style.display="none",this.renderedVisible_=!1;return}if(L!==void 0&&oe>=L){re=ie,oe=ae,j=ue;break}else if(oe>=k)break;ie=re,ae=oe,ue=j,++z}const de=this.scaleBar_?this.createScaleBar(oe,re,V):re.toFixed(j<0?-j:0)+" "+V;this.renderedHTML_!=de&&(this.innerElement_.innerHTML=de,this.renderedHTML_=de),this.renderedWidth_!=oe&&(this.innerElement_.style.width=oe+"px",this.renderedWidth_=oe),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}createScaleBar(e,n,r){const i=this.getScaleForResolution(),g=i<1?Math.round(1/i).toLocaleString()+" : 1":"1 : "+Math.round(i).toLocaleString(),y=this.scaleBarSteps_,k=e/y,L=[this.createMarker("absolute")];for(let V=0;V<y;++V){const z=V%2===0?"ol-scale-singlebar-odd":"ol-scale-singlebar-even";L.push(`<div><div class="ol-scale-singlebar ${z}" style="width: ${k}px;"></div>`+this.createMarker("relative")+(V%2===0||y===2?this.createStepText(V,e,!1,n,r):"")+"</div>")}return L.push(this.createStepText(y,e,!0,n,r)),(this.scaleBarText_?`<div class="ol-scale-text" style="width: ${e}px;">`+g+"</div>":"")+L.join("")}createMarker(e){return`<div class="ol-scale-step-marker" style="position: ${e}; top: ${e==="absolute"?3:-10}px;"></div>`}createStepText(e,n,r,i,g){const k=(e===0?0:Math.round(i/this.scaleBarSteps_*e*100)/100)+(e===0?"":" "+g),L=e===0?-3:n/this.scaleBarSteps_*-1,$=e===0?0:n/this.scaleBarSteps_*2;return`<div class="ol-scale-step-text" style="margin-left: ${L}px;text-align: ${e===0?"left":"center"};min-width: ${$}px;left: ${r?n+"px":"unset"};">`+k+"</div>"}getScaleForResolution(){const e=getPointResolution(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,"m"),n=this.dpi_||DEFAULT_DPI,r=1e3/25.4;return e*r*n}render(e){const n=e.frameState;n?this.viewState_=n.viewState:this.viewState_=null,this.updateElement_()}};const CollectionEventType={ADD:"add",REMOVE:"remove"},Property$3={LENGTH:"length"};class CollectionEvent extends BaseEvent{constructor(e,n,r){super(e),this.element=n,this.index=r}}class Collection extends BaseObject{constructor(e,n){if(super(),this.on,this.once,this.un,n=n||{},this.unique_=!!n.unique,this.array_=e||[],this.unique_)for(let r=0,i=this.array_.length;r<i;++r)this.assertUnique_(this.array_[r],r);this.updateLength_()}clear(){for(;this.getLength()>0;)this.pop()}extend(e){for(let n=0,r=e.length;n<r;++n)this.push(e[n]);return this}forEach(e){const n=this.array_;for(let r=0,i=n.length;r<i;++r)e(n[r],r,n)}getArray(){return this.array_}item(e){return this.array_[e]}getLength(){return this.get(Property$3.LENGTH)}insertAt(e,n){if(e<0||e>this.getLength())throw new Error("Index out of bounds: "+e);this.unique_&&this.assertUnique_(n),this.array_.splice(e,0,n),this.updateLength_(),this.dispatchEvent(new CollectionEvent(CollectionEventType.ADD,n,e))}pop(){return this.removeAt(this.getLength()-1)}push(e){this.unique_&&this.assertUnique_(e);const n=this.getLength();return this.insertAt(n,e),this.getLength()}remove(e){const n=this.array_;for(let r=0,i=n.length;r<i;++r)if(n[r]===e)return this.removeAt(r)}removeAt(e){if(e<0||e>=this.getLength())return;const n=this.array_[e];return this.array_.splice(e,1),this.updateLength_(),this.dispatchEvent(new CollectionEvent(CollectionEventType.REMOVE,n,e)),n}setAt(e,n){const r=this.getLength();if(e>=r){this.insertAt(e,n);return}if(e<0)throw new Error("Index out of bounds: "+e);this.unique_&&this.assertUnique_(n,e);const i=this.array_[e];this.array_[e]=n,this.dispatchEvent(new CollectionEvent(CollectionEventType.REMOVE,i,e)),this.dispatchEvent(new CollectionEvent(CollectionEventType.ADD,n,e))}updateLength_(){this.set(Property$3.LENGTH,this.array_.length)}assertUnique_(e,n){for(let r=0,i=this.array_.length;r<i;++r)if(this.array_[r]===e&&r!==n)throw new Error("Duplicate item added to a unique collection")}}function assert(t,e){if(!t)throw new Error(e)}class Feature extends BaseObject{constructor(e){if(super(),this.on,this.once,this.un,this.id_=void 0,this.geometryName_="geometry",this.style_=null,this.styleFunction_=void 0,this.geometryChangeKey_=null,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),e)if(typeof e.getSimplifiedGeometry=="function"){const n=e;this.setGeometry(n)}else{const n=e;this.setProperties(n)}}clone(){const e=new Feature(this.hasProperties()?this.getProperties():null);e.setGeometryName(this.getGeometryName());const n=this.getGeometry();n&&e.setGeometry(n.clone());const r=this.getStyle();return r&&e.setStyle(r),e}getGeometry(){return this.get(this.geometryName_)}getId(){return this.id_}getGeometryName(){return this.geometryName_}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}handleGeometryChange_(){this.changed()}handleGeometryChanged_(){this.geometryChangeKey_&&(unlistenByKey(this.geometryChangeKey_),this.geometryChangeKey_=null);const e=this.getGeometry();e&&(this.geometryChangeKey_=listen(e,EventType.CHANGE,this.handleGeometryChange_,this)),this.changed()}setGeometry(e){this.set(this.geometryName_,e)}setStyle(e){this.style_=e,this.styleFunction_=e?createStyleFunction(e):void 0,this.changed()}setId(e){this.id_=e,this.changed()}setGeometryName(e){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=e,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()}}function createStyleFunction(t){if(typeof t=="function")return t;let e;return Array.isArray(t)?e=t:(assert(typeof t.getZIndex=="function","Expected an `ol/style/Style` or an array of `ol/style/Style.js`"),e=[t]),function(){return e}}new Array(6);function create$1(){return[1,0,0,1,0,0]}function multiply(t,e){const n=t[0],r=t[1],i=t[2],g=t[3],y=t[4],k=t[5],L=e[0],$=e[1],V=e[2],z=e[3],re=e[4],oe=e[5];return t[0]=n*L+i*$,t[1]=r*L+g*$,t[2]=n*V+i*z,t[3]=r*V+g*z,t[4]=n*re+i*oe+y,t[5]=r*re+g*oe+k,t}function setFromArray(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function apply(t,e){const n=e[0],r=e[1];return e[0]=t[0]*n+t[2]*r+t[4],e[1]=t[1]*n+t[3]*r+t[5],e}function compose(t,e,n,r,i,g,y,k){const L=Math.sin(g),$=Math.cos(g);return t[0]=r*$,t[1]=i*L,t[2]=-r*L,t[3]=i*$,t[4]=y*r*$-k*r*L+e,t[5]=y*i*L+k*i*$+n,t}function makeInverse(t,e){const n=determinant(e);assert(n!==0,"Transformation matrix cannot be inverted");const r=e[0],i=e[1],g=e[2],y=e[3],k=e[4],L=e[5];return t[0]=y/n,t[1]=-i/n,t[2]=-g/n,t[3]=r/n,t[4]=(g*L-y*k)/n,t[5]=-(r*L-i*k)/n,t}function determinant(t){return t[0]*t[3]-t[1]*t[2]}const matrixPrecision=[1e6,1e6,1e6,1e6,2,2];function toString$1(t){return"matrix("+t.map((n,r)=>Math.round(n*matrixPrecision[r])/matrixPrecision[r]).join(", ")+")"}function transform2D(t,e,n,r,i,g,y){g=g||[],y=y||2;let k=0;for(let L=e;L<n;L+=r){const $=t[L],V=t[L+1];g[k++]=i[0]*$+i[2]*V+i[4],g[k++]=i[1]*$+i[3]*V+i[5];for(let z=2;z<y;z++)g[k++]=t[L+z]}return g&&g.length!=k&&(g.length=k),g}function rotate(t,e,n,r,i,g,y){y=y||[];const k=Math.cos(i),L=Math.sin(i),$=g[0],V=g[1];let z=0;for(let re=e;re<n;re+=r){const oe=t[re]-$,j=t[re+1]-V;y[z++]=$+oe*k-j*L,y[z++]=V+oe*L+j*k;for(let ie=re+2;ie<re+r;++ie)y[z++]=t[ie]}return y&&y.length!=z&&(y.length=z),y}function scale$2(t,e,n,r,i,g,y,k){k=k||[];const L=y[0],$=y[1];let V=0;for(let z=e;z<n;z+=r){const re=t[z]-L,oe=t[z+1]-$;k[V++]=L+i*re,k[V++]=$+g*oe;for(let j=z+2;j<z+r;++j)k[V++]=t[j]}return k&&k.length!=V&&(k.length=V),k}function translate$1(t,e,n,r,i,g,y){y=y||[];let k=0;for(let L=e;L<n;L+=r){y[k++]=t[L]+i,y[k++]=t[L+1]+g;for(let $=L+2;$<L+r;++$)y[k++]=t[$]}return y&&y.length!=k&&(y.length=k),y}const tmpTransform$1=create$1();class Geometry extends BaseObject{constructor(){super(),this.extent_=createEmpty(),this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=memoizeOne((e,n,r)=>{if(!r)return this.getSimplifiedGeometry(n);const i=this.clone();return i.applyTransform(r),i.getSimplifiedGeometry(n)})}simplifyTransformed(e,n){return this.simplifyTransformedInternal(this.getRevision(),e,n)}clone(){return abstract()}closestPointXY(e,n,r,i){return abstract()}containsXY(e,n){const r=this.getClosestPoint([e,n]);return r[0]===e&&r[1]===n}getClosestPoint(e,n){return n=n||[NaN,NaN],this.closestPointXY(e[0],e[1],n,1/0),n}intersectsCoordinate(e){return this.containsXY(e[0],e[1])}computeExtent(e){return abstract()}getExtent(e){if(this.extentRevision_!=this.getRevision()){const n=this.computeExtent(this.extent_);(isNaN(n[0])||isNaN(n[1]))&&createOrUpdateEmpty(n),this.extentRevision_=this.getRevision()}return returnOrUpdate(this.extent_,e)}rotate(e,n){abstract()}scale(e,n,r){abstract()}simplify(e){return this.getSimplifiedGeometry(e*e)}getSimplifiedGeometry(e){return abstract()}getType(){return abstract()}applyTransform(e){abstract()}intersectsExtent(e){return abstract()}translate(e,n){abstract()}transform(e,n){const r=get$1(e),i=r.getUnits()=="tile-pixels"?function(g,y,k){const L=r.getExtent(),$=r.getWorldExtent(),V=getHeight($)/getHeight(L);compose(tmpTransform$1,$[0],$[3],V,-V,0,0,0);const z=transform2D(g,0,g.length,k,tmpTransform$1,y),re=getTransform(r,n);return re?re(z,z,k):z}:getTransform(r,n);return this.applyTransform(i),this}}class SimpleGeometry extends Geometry{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates}computeExtent(e){return createOrUpdateFromFlatCoordinates(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}getCoordinates(){return abstract()}getFirstCoordinate(){return this.flatCoordinates.slice(0,this.stride)}getFlatCoordinates(){return this.flatCoordinates}getLastCoordinate(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)}getLayout(){return this.layout}getSimplifiedGeometry(e){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),e<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&e<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;const n=this.getSimplifiedGeometryInternal(e);return n.getFlatCoordinates().length<this.flatCoordinates.length?n:(this.simplifiedGeometryMaxMinSquaredTolerance=e,this)}getSimplifiedGeometryInternal(e){return this}getStride(){return this.stride}setFlatCoordinates(e,n){this.stride=getStrideForLayout(e),this.layout=e,this.flatCoordinates=n}setCoordinates(e,n){abstract()}setLayout(e,n,r){let i;if(e)i=getStrideForLayout(e);else{for(let g=0;g<r;++g){if(n.length===0){this.layout="XY",this.stride=2;return}n=n[0]}i=n.length,e=getLayoutForStride(i)}this.layout=e,this.stride=i}applyTransform(e){this.flatCoordinates&&(e(this.flatCoordinates,this.flatCoordinates,this.layout.startsWith("XYZ")?3:2,this.stride),this.changed())}rotate(e,n){const r=this.getFlatCoordinates();if(r){const i=this.getStride();rotate(r,0,r.length,i,e,n,r),this.changed()}}scale(e,n,r){n===void 0&&(n=e),r||(r=getCenter$1(this.getExtent()));const i=this.getFlatCoordinates();if(i){const g=this.getStride();scale$2(i,0,i.length,g,e,n,r,i),this.changed()}}translate(e,n){const r=this.getFlatCoordinates();if(r){const i=this.getStride();translate$1(r,0,r.length,i,e,n,r),this.changed()}}}function getLayoutForStride(t){let e;return t==2?e="XY":t==3?e="XYZ":t==4&&(e="XYZM"),e}function getStrideForLayout(t){let e;return t=="XY"?e=2:t=="XYZ"||t=="XYM"?e=3:t=="XYZM"&&(e=4),e}function transformGeom2D(t,e,n){const r=t.getFlatCoordinates();if(!r)return null;const i=t.getStride();return transform2D(r,0,r.length,i,e,n)}function assignClosest(t,e,n,r,i,g,y){const k=t[e],L=t[e+1],$=t[n]-k,V=t[n+1]-L;let z;if($===0&&V===0)z=e;else{const re=((i-k)*$+(g-L)*V)/($*$+V*V);if(re>1)z=n;else if(re>0){for(let oe=0;oe<r;++oe)y[oe]=lerp(t[e+oe],t[n+oe],re);y.length=r;return}else z=e}for(let re=0;re<r;++re)y[re]=t[z+re];y.length=r}function maxSquaredDelta(t,e,n,r,i){let g=t[e],y=t[e+1];for(e+=r;e<n;e+=r){const k=t[e],L=t[e+1],$=squaredDistance$1(g,y,k,L);$>i&&(i=$),g=k,y=L}return i}function arrayMaxSquaredDelta(t,e,n,r,i){for(let g=0,y=n.length;g<y;++g){const k=n[g];i=maxSquaredDelta(t,e,k,r,i),e=k}return i}function multiArrayMaxSquaredDelta(t,e,n,r,i){for(let g=0,y=n.length;g<y;++g){const k=n[g];i=arrayMaxSquaredDelta(t,e,k,r,i),e=k[k.length-1]}return i}function assignClosestPoint(t,e,n,r,i,g,y,k,L,$,V){if(e==n)return $;let z,re;if(i===0){if(re=squaredDistance$1(y,k,t[e],t[e+1]),re<$){for(z=0;z<r;++z)L[z]=t[e+z];return L.length=r,re}return $}V=V||[NaN,NaN];let oe=e+r;for(;oe<n;)if(assignClosest(t,oe-r,oe,r,y,k,V),re=squaredDistance$1(y,k,V[0],V[1]),re<$){for($=re,z=0;z<r;++z)L[z]=V[z];L.length=r,oe+=r}else oe+=r*Math.max((Math.sqrt(re)-Math.sqrt($))/i|0,1);if(g&&(assignClosest(t,n-r,e,r,y,k,V),re=squaredDistance$1(y,k,V[0],V[1]),re<$)){for($=re,z=0;z<r;++z)L[z]=V[z];L.length=r}return $}function assignClosestArrayPoint(t,e,n,r,i,g,y,k,L,$,V){V=V||[NaN,NaN];for(let z=0,re=n.length;z<re;++z){const oe=n[z];$=assignClosestPoint(t,e,oe,r,i,g,y,k,L,$,V),e=oe}return $}function assignClosestMultiArrayPoint(t,e,n,r,i,g,y,k,L,$,V){V=V||[NaN,NaN];for(let z=0,re=n.length;z<re;++z){const oe=n[z];$=assignClosestArrayPoint(t,e,oe,r,i,g,y,k,L,$,V),e=oe[oe.length-1]}return $}function deflateCoordinate(t,e,n,r){for(let i=0,g=n.length;i<g;++i)t[e++]=n[i];return e}function deflateCoordinates(t,e,n,r){for(let i=0,g=n.length;i<g;++i){const y=n[i];for(let k=0;k<r;++k)t[e++]=y[k]}return e}function deflateCoordinatesArray(t,e,n,r,i){i=i||[];let g=0;for(let y=0,k=n.length;y<k;++y){const L=deflateCoordinates(t,e,n[y],r);i[g++]=L,e=L}return i.length=g,i}function deflateMultiCoordinatesArray(t,e,n,r,i){i=i||[];let g=0;for(let y=0,k=n.length;y<k;++y){const L=deflateCoordinatesArray(t,e,n[y],r,i[g]);L.length===0&&(L[0]=e),i[g++]=L,e=L[L.length-1]}return i.length=g,i}function douglasPeucker(t,e,n,r,i,g,y){const k=(n-e)/r;if(k<3){for(;e<n;e+=r)g[y++]=t[e],g[y++]=t[e+1];return y}const L=new Array(k);L[0]=1,L[k-1]=1;const $=[e,n-r];let V=0;for(;$.length>0;){const z=$.pop(),re=$.pop();let oe=0;const j=t[re],ie=t[re+1],ae=t[z],ue=t[z+1];for(let de=re+r;de<z;de+=r){const pe=t[de],le=t[de+1],he=squaredSegmentDistance(pe,le,j,ie,ae,ue);he>oe&&(V=de,oe=he)}oe>i&&(L[(V-e)/r]=1,re+r<V&&$.push(re,V),V+r<z&&$.push(V,z))}for(let z=0;z<k;++z)L[z]&&(g[y++]=t[e+z*r],g[y++]=t[e+z*r+1]);return y}function douglasPeuckerArray(t,e,n,r,i,g,y,k){for(let L=0,$=n.length;L<$;++L){const V=n[L];y=douglasPeucker(t,e,V,r,i,g,y),k.push(y),e=V}return y}function snap(t,e){return e*Math.round(t/e)}function quantize(t,e,n,r,i,g,y){if(e==n)return y;let k=snap(t[e],i),L=snap(t[e+1],i);e+=r,g[y++]=k,g[y++]=L;let $,V;do if($=snap(t[e],i),V=snap(t[e+1],i),e+=r,e==n)return g[y++]=$,g[y++]=V,y;while($==k&&V==L);for(;e<n;){const z=snap(t[e],i),re=snap(t[e+1],i);if(e+=r,z==$&&re==V)continue;const oe=$-k,j=V-L,ie=z-k,ae=re-L;if(oe*ae==j*ie&&(oe<0&&ie<oe||oe==ie||oe>0&&ie>oe)&&(j<0&&ae<j||j==ae||j>0&&ae>j)){$=z,V=re;continue}g[y++]=$,g[y++]=V,k=$,L=V,$=z,V=re}return g[y++]=$,g[y++]=V,y}function quantizeArray(t,e,n,r,i,g,y,k){for(let L=0,$=n.length;L<$;++L){const V=n[L];y=quantize(t,e,V,r,i,g,y),k.push(y),e=V}return y}function quantizeMultiArray(t,e,n,r,i,g,y,k){for(let L=0,$=n.length;L<$;++L){const V=n[L],z=[];y=quantizeArray(t,e,V,r,i,g,y,z),k.push(z),e=V[V.length-1]}return y}function inflateCoordinates(t,e,n,r,i){i=i!==void 0?i:[];let g=0;for(let y=e;y<n;y+=r)i[g++]=t.slice(y,y+r);return i.length=g,i}function inflateCoordinatesArray(t,e,n,r,i){i=i!==void 0?i:[];let g=0;for(let y=0,k=n.length;y<k;++y){const L=n[y];i[g++]=inflateCoordinates(t,e,L,r,i[g]),e=L}return i.length=g,i}function inflateMultiCoordinatesArray(t,e,n,r,i){i=i!==void 0?i:[];let g=0;for(let y=0,k=n.length;y<k;++y){const L=n[y];i[g++]=L.length===1&&L[0]===e?[]:inflateCoordinatesArray(t,e,L,r,i[g]),e=L[L.length-1]}return i.length=g,i}function linearRing(t,e,n,r){let i=0;const g=t[n-r],y=t[n-r+1];let k=0,L=0;for(;e<n;e+=r){const $=t[e]-g,V=t[e+1]-y;i+=L*$-k*V,k=$,L=V}return i/2}function linearRings(t,e,n,r){let i=0;for(let g=0,y=n.length;g<y;++g){const k=n[g];i+=linearRing(t,e,k,r),e=k}return i}function linearRingss$1(t,e,n,r){let i=0;for(let g=0,y=n.length;g<y;++g){const k=n[g];i+=linearRings(t,e,k,r),e=k[k.length-1]}return i}class LinearRing extends SimpleGeometry{constructor(e,n){super(),this.maxDelta_=-1,this.maxDeltaRevision_=-1,n!==void 0&&!Array.isArray(e[0])?this.setFlatCoordinates(n,e):this.setCoordinates(e,n)}clone(){return new LinearRing(this.flatCoordinates.slice(),this.layout)}closestPointXY(e,n,r,i){return i<closestSquaredDistanceXY(this.getExtent(),e,n)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(maxSquaredDelta(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),assignClosestPoint(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,e,n,r,i))}getArea(){return linearRing(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return inflateCoordinates(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(e){const n=[];return n.length=douglasPeucker(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,n,0),new LinearRing(n,"XY")}getType(){return"LinearRing"}intersectsExtent(e){return!1}setCoordinates(e,n){this.setLayout(n,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=deflateCoordinates(this.flatCoordinates,0,e,this.stride),this.changed()}}class Point extends SimpleGeometry{constructor(e,n){super(),this.setCoordinates(e,n)}clone(){const e=new Point(this.flatCoordinates.slice(),this.layout);return e.applyProperties(this),e}closestPointXY(e,n,r,i){const g=this.flatCoordinates,y=squaredDistance$1(e,n,g[0],g[1]);if(y<i){const k=this.stride;for(let L=0;L<k;++L)r[L]=g[L];return r.length=k,y}return i}getCoordinates(){return this.flatCoordinates.slice()}computeExtent(e){return createOrUpdateFromCoordinate(this.flatCoordinates,e)}getType(){return"Point"}intersectsExtent(e){return containsXY(e,this.flatCoordinates[0],this.flatCoordinates[1])}setCoordinates(e,n){this.setLayout(n,e,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=deflateCoordinate(this.flatCoordinates,0,e,this.stride),this.changed()}}function linearRingContainsExtent(t,e,n,r,i){return!forEachCorner(i,function(y){return!linearRingContainsXY(t,e,n,r,y[0],y[1])})}function linearRingContainsXY(t,e,n,r,i,g){let y=0,k=t[n-r],L=t[n-r+1];for(;e<n;e+=r){const $=t[e],V=t[e+1];L<=g?V>g&&($-k)*(g-L)-(i-k)*(V-L)>0&&y++:V<=g&&($-k)*(g-L)-(i-k)*(V-L)<0&&y--,k=$,L=V}return y!==0}function linearRingsContainsXY(t,e,n,r,i,g){if(n.length===0||!linearRingContainsXY(t,e,n[0],r,i,g))return!1;for(let y=1,k=n.length;y<k;++y)if(linearRingContainsXY(t,n[y-1],n[y],r,i,g))return!1;return!0}function linearRingssContainsXY(t,e,n,r,i,g){if(n.length===0)return!1;for(let y=0,k=n.length;y<k;++y){const L=n[y];if(linearRingsContainsXY(t,e,L,r,i,g))return!0;e=L[L.length-1]}return!1}function getInteriorPointOfArray(t,e,n,r,i,g,y){let k,L,$,V,z,re,oe;const j=i[g+1],ie=[];for(let de=0,pe=n.length;de<pe;++de){const le=n[de];for(V=t[le-r],re=t[le-r+1],k=e;k<le;k+=r)z=t[k],oe=t[k+1],(j<=re&&oe<=j||re<=j&&j<=oe)&&($=(j-re)/(oe-re)*(z-V)+V,ie.push($)),V=z,re=oe}let ae=NaN,ue=-1/0;for(ie.sort(ascending),V=ie[0],k=1,L=ie.length;k<L;++k){z=ie[k];const de=Math.abs(z-V);de>ue&&($=(V+z)/2,linearRingsContainsXY(t,e,n,r,$,j)&&(ae=$,ue=de)),V=z}return isNaN(ae)&&(ae=i[g]),y?(y.push(ae,j,ue),y):[ae,j,ue]}function getInteriorPointsOfMultiArray(t,e,n,r,i){let g=[];for(let y=0,k=n.length;y<k;++y){const L=n[y];g=getInteriorPointOfArray(t,e,L,r,i,2*y,g),e=L[L.length-1]}return g}function forEach(t,e,n,r,i){let g;for(e+=r;e<n;e+=r)if(g=i(t.slice(e-r,e),t.slice(e,e+r)),g)return g;return!1}function intersectsLineString(t,e,n,r,i){const g=extendFlatCoordinates(createEmpty(),t,e,n,r);return intersects$1(i,g)?containsExtent(i,g)||g[0]>=i[0]&&g[2]<=i[2]||g[1]>=i[1]&&g[3]<=i[3]?!0:forEach(t,e,n,r,function(y,k){return intersectsSegment(i,y,k)}):!1}function intersectsLineStringArray(t,e,n,r,i){for(let g=0,y=n.length;g<y;++g){if(intersectsLineString(t,e,n[g],r,i))return!0;e=n[g]}return!1}function intersectsLinearRing(t,e,n,r,i){return!!(intersectsLineString(t,e,n,r,i)||linearRingContainsXY(t,e,n,r,i[0],i[1])||linearRingContainsXY(t,e,n,r,i[0],i[3])||linearRingContainsXY(t,e,n,r,i[2],i[1])||linearRingContainsXY(t,e,n,r,i[2],i[3]))}function intersectsLinearRingArray(t,e,n,r,i){if(!intersectsLinearRing(t,e,n[0],r,i))return!1;if(n.length===1)return!0;for(let g=1,y=n.length;g<y;++g)if(linearRingContainsExtent(t,n[g-1],n[g],r,i)&&!intersectsLineString(t,n[g-1],n[g],r,i))return!1;return!0}function intersectsLinearRingMultiArray(t,e,n,r,i){for(let g=0,y=n.length;g<y;++g){const k=n[g];if(intersectsLinearRingArray(t,e,k,r,i))return!0;e=k[k.length-1]}return!1}function coordinates(t,e,n,r){for(;e<n-r;){for(let i=0;i<r;++i){const g=t[e+i];t[e+i]=t[n-r+i],t[n-r+i]=g}e+=r,n-=r}}function linearRingIsClockwise(t,e,n,r){let i=0,g=t[n-r],y=t[n-r+1];for(;e<n;e+=r){const k=t[e],L=t[e+1];i+=(k-g)*(L+y),g=k,y=L}return i===0?void 0:i>0}function linearRingsAreOriented(t,e,n,r,i){i=i!==void 0?i:!1;for(let g=0,y=n.length;g<y;++g){const k=n[g],L=linearRingIsClockwise(t,e,k,r);if(g===0){if(i&&L||!i&&!L)return!1}else if(i&&!L||!i&&L)return!1;e=k}return!0}function linearRingssAreOriented(t,e,n,r,i){for(let g=0,y=n.length;g<y;++g){const k=n[g];if(!linearRingsAreOriented(t,e,k,r,i))return!1;k.length&&(e=k[k.length-1])}return!0}function orientLinearRings(t,e,n,r,i){i=i!==void 0?i:!1;for(let g=0,y=n.length;g<y;++g){const k=n[g],L=linearRingIsClockwise(t,e,k,r);(g===0?i&&L||!i&&!L:i&&!L||!i&&L)&&coordinates(t,e,k,r),e=k}return e}function orientLinearRingsArray(t,e,n,r,i){for(let g=0,y=n.length;g<y;++g)e=orientLinearRings(t,e,n[g],r,i);return e}function inflateEnds(t,e){const n=[];let r=0,i=0,g;for(let y=0,k=e.length;y<k;++y){const L=e[y],$=linearRingIsClockwise(t,r,L,2);if(g===void 0&&(g=$),$===g)n.push(e.slice(i,y+1));else{if(n.length===0)continue;n[n.length-1].push(e[i])}i=y+1,r=L}return n}class Polygon extends SimpleGeometry{constructor(e,n,r){super(),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,n!==void 0&&r?(this.setFlatCoordinates(n,e),this.ends_=r):this.setCoordinates(e,n)}appendLinearRing(e){this.flatCoordinates?extend$2(this.flatCoordinates,e.getFlatCoordinates()):this.flatCoordinates=e.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const e=new Polygon(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return e.applyProperties(this),e}closestPointXY(e,n,r,i){return i<closestSquaredDistanceXY(this.getExtent(),e,n)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(arrayMaxSquaredDelta(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),assignClosestArrayPoint(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,e,n,r,i))}containsXY(e,n){return linearRingsContainsXY(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,n)}getArea(){return linearRings(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(e){let n;return e!==void 0?(n=this.getOrientedFlatCoordinates().slice(),orientLinearRings(n,0,this.ends_,this.stride,e)):n=this.flatCoordinates,inflateCoordinatesArray(n,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){const e=getCenter$1(this.getExtent());this.flatInteriorPoint_=getInteriorPointOfArray(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new Point(this.getFlatInteriorPoint(),"XYM")}getLinearRingCount(){return this.ends_.length}getLinearRing(e){return e<0||this.ends_.length<=e?null:new LinearRing(this.flatCoordinates.slice(e===0?0:this.ends_[e-1],this.ends_[e]),this.layout)}getLinearRings(){const e=this.layout,n=this.flatCoordinates,r=this.ends_,i=[];let g=0;for(let y=0,k=r.length;y<k;++y){const L=r[y],$=new LinearRing(n.slice(g,L),e);i.push($),g=L}return i}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const e=this.flatCoordinates;linearRingsAreOriented(e,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=e:(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=orientLinearRings(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(e){const n=[],r=[];return n.length=quantizeArray(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(e),n,0,r),new Polygon(n,"XY",r)}getType(){return"Polygon"}intersectsExtent(e){return intersectsLinearRingArray(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e)}setCoordinates(e,n){this.setLayout(n,e,2),this.flatCoordinates||(this.flatCoordinates=[]);const r=deflateCoordinatesArray(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=r.length===0?0:r[r.length-1],this.changed()}}function fromExtent(t){if(isEmpty(t))throw new Error("Cannot create polygon from empty extent");const e=t[0],n=t[1],r=t[2],i=t[3],g=[e,n,e,i,r,i,r,n,e,n];return new Polygon(g,"XY",[g.length])}const RenderEventType={PRERENDER:"prerender",POSTRENDER:"postrender",PRECOMPOSE:"precompose",POSTCOMPOSE:"postcompose",RENDERCOMPLETE:"rendercomplete"},ImageState={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4},rgb={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]};var xyz={name:"xyz",min:[0,0,0],channel:["X","Y","Z"],alias:["XYZ","ciexyz","cie1931"]};xyz.whitepoint={2:{A:[109.85,100,35.585],C:[98.074,100,118.232],D50:[96.422,100,82.521],D55:[95.682,100,92.149],D65:[95.045592705167,100,108.9057750759878],D75:[94.972,100,122.638],F2:[99.187,100,67.395],F7:[95.044,100,108.755],F11:[100.966,100,64.37],E:[100,100,100]},10:{A:[111.144,100,35.2],C:[97.285,100,116.145],D50:[96.72,100,81.427],D55:[95.799,100,90.926],D65:[94.811,100,107.304],D75:[94.416,100,120.641],F2:[103.28,100,69.026],F7:[95.792,100,107.687],F11:[103.866,100,65.627],E:[100,100,100]}},xyz.max=xyz.whitepoint[2].D65,xyz.rgb=function(t,e){e=e||xyz.whitepoint[2].E;var n=t[0]/e[0],r=t[1]/e[1],i=t[2]/e[2],g,y,k;return g=n*3.240969941904521+r*-1.537383177570093+i*-.498610760293,y=n*-.96924363628087+r*1.87596750150772+i*.041555057407175,k=n*.055630079696993+r*-.20397695888897+i*1.056971514242878,g=g>.0031308?1.055*Math.pow(g,1/2.4)-.055:g=g*12.92,y=y>.0031308?1.055*Math.pow(y,1/2.4)-.055:y=y*12.92,k=k>.0031308?1.055*Math.pow(k,1/2.4)-.055:k=k*12.92,g=Math.min(Math.max(0,g),1),y=Math.min(Math.max(0,y),1),k=Math.min(Math.max(0,k),1),[g*255,y*255,k*255]},rgb.xyz=function(t,e){var n=t[0]/255,r=t[1]/255,i=t[2]/255;n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92;var g=n*.41239079926595+r*.35758433938387+i*.18048078840183,y=n*.21263900587151+r*.71516867876775+i*.072192315360733,k=n*.019330818715591+r*.11919477979462+i*.95053215224966;return e=e||xyz.whitepoint[2].E,[g*e[0],y*e[1],k*e[2]]};const luv={name:"luv",min:[0,-134,-140],max:[100,224,122],channel:["lightness","u","v"],alias:["LUV","cieluv","cie1976"],xyz:function(t,e,n){var r,i,g,y,k,L,$,V,z,re,oe,j,ie;if(g=t[0],y=t[1],k=t[2],g===0)return[0,0,0];var ae=.0011070564598794539;return e=e||"D65",n=n||2,z=xyz.whitepoint[n][e][0],re=xyz.whitepoint[n][e][1],oe=xyz.whitepoint[n][e][2],j=4*z/(z+15*re+3*oe),ie=9*re/(z+15*re+3*oe),r=y/(13*g)+j||0,i=k/(13*g)+ie||0,$=g>8?re*Math.pow((g+16)/116,3):re*g*ae,L=$*9*r/(4*i)||0,V=$*(12-3*r-20*i)/(4*i)||0,[L,$,V]}};xyz.luv=function(t,e,n){var r,i,g,y,k,L,$,V,z,re,oe,j,ie,ae=.008856451679035631,ue=903.2962962962961;e=e||"D65",n=n||2,z=xyz.whitepoint[n][e][0],re=xyz.whitepoint[n][e][1],oe=xyz.whitepoint[n][e][2],j=4*z/(z+15*re+3*oe),ie=9*re/(z+15*re+3*oe),L=t[0],$=t[1],V=t[2],r=4*L/(L+15*$+3*V)||0,i=9*$/(L+15*$+3*V)||0;var de=$/re;return g=de<=ae?ue*de:116*Math.pow(de,1/3)-16,y=13*g*(r-j),k=13*g*(i-ie),[g,y,k]};var lchuv={name:"lchuv",channel:["lightness","chroma","hue"],alias:["LCHuv","cielchuv"],min:[0,0,0],max:[100,100,360],luv:function(t){var e=t[0],n=t[1],r=t[2],i,g,y;return y=r/360*2*Math.PI,i=n*Math.cos(y),g=n*Math.sin(y),[e,i,g]},xyz:function(t){return luv.xyz(lchuv.luv(t))}};luv.lchuv=function(t){var e=t[0],n=t[1],r=t[2],i=Math.sqrt(n*n+r*r),g=Math.atan2(r,n),y=g*360/2/Math.PI;return y<0&&(y+=360),[e,i,y]},xyz.lchuv=function(t){return luv.lchuv(xyz.luv(t))};const names={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};var baseHues={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function parse$1(t){var V,z;var e,n=[],r=1,i;if(typeof t=="number")return{space:"rgb",values:[t>>>16,(t&65280)>>>8,t&255],alpha:1};if(typeof t=="number")return{space:"rgb",values:[t>>>16,(t&65280)>>>8,t&255],alpha:1};if(t=String(t).toLowerCase(),names[t])n=names[t].slice(),i="rgb";else if(t==="transparent")r=0,i="rgb",n=[0,0,0];else if(t[0]==="#"){var g=t.slice(1),y=g.length,k=y<=4;r=1,k?(n=[parseInt(g[0]+g[0],16),parseInt(g[1]+g[1],16),parseInt(g[2]+g[2],16)],y===4&&(r=parseInt(g[3]+g[3],16)/255)):(n=[parseInt(g[0]+g[1],16),parseInt(g[2]+g[3],16),parseInt(g[4]+g[5],16)],y===8&&(r=parseInt(g[6]+g[7],16)/255)),n[0]||(n[0]=0),n[1]||(n[1]=0),n[2]||(n[2]=0),i="rgb"}else if(e=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(t)){var L=e[1];i=L.replace(/a$/,"");var $=i==="cmyk"?4:i==="gray"?1:3;n=e[2].trim().split(/\s*[,\/]\s*|\s+/),i==="color"&&(i=n.shift()),n=n.map(function(re,oe){if(re[re.length-1]==="%")return re=parseFloat(re)/100,oe===3?re:i==="rgb"?re*255:i[0]==="h"||i[0]==="l"&&!oe?re*100:i==="lab"?re*125:i==="lch"?oe<2?re*150:re*360:i[0]==="o"&&!oe?re:i==="oklab"?re*.4:i==="oklch"?oe<2?re*.4:re*360:re;if(i[oe]==="h"||oe===2&&i[i.length-1]==="h"){if(baseHues[re]!==void 0)return baseHues[re];if(re.endsWith("deg"))return parseFloat(re);if(re.endsWith("turn"))return parseFloat(re)*360;if(re.endsWith("grad"))return parseFloat(re)*360/400;if(re.endsWith("rad"))return parseFloat(re)*180/Math.PI}return re==="none"?0:parseFloat(re)}),r=n.length>$?n.pop():1}else/[0-9](?:\s|\/|,)/.test(t)&&(n=t.match(/([0-9]+)/g).map(function(re){return parseFloat(re)}),i=((z=(V=t.match(/([a-z])/ig))==null?void 0:V.join(""))==null?void 0:z.toLowerCase())||"rgb");return{space:i,values:n,alpha:r}}const hsl={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(t){var e=t[0]/360,n=t[1]/100,r=t[2]/100,i,g,y,k,L,$=0;if(n===0)return L=r*255,[L,L,L];for(g=r<.5?r*(1+n):r+n-r*n,i=2*r-g,k=[0,0,0];$<3;)y=e+1/3*-($-1),y<0?y++:y>1&&y--,L=6*y<1?i+(g-i)*6*y:2*y<1?g:3*y<2?i+(g-i)*(2/3-y)*6:i,k[$++]=L*255;return k}};rgb.hsl=function(t){var e=t[0]/255,n=t[1]/255,r=t[2]/255,i=Math.min(e,n,r),g=Math.max(e,n,r),y=g-i,k,L,$;return g===i?k=0:e===g?k=(n-r)/y:n===g?k=2+(r-e)/y:r===g&&(k=4+(e-n)/y),k=Math.min(k*60,360),k<0&&(k+=360),$=(i+g)/2,g===i?L=0:$<=.5?L=y/(g+i):L=y/(2-g-i),[k,L*100,$*100]};function rgba(t){Array.isArray(t)&&t.raw&&(t=String.raw(...arguments)),t instanceof Number&&(t=+t);var e,n=parse$1(t);if(!n.space)return[];const r=n.space[0]==="h"?hsl.min:rgb.min,i=n.space[0]==="h"?hsl.max:rgb.max;return e=Array(3),e[0]=Math.min(Math.max(n.values[0],r[0]),i[0]),e[1]=Math.min(Math.max(n.values[1],r[1]),i[1]),e[2]=Math.min(Math.max(n.values[2],r[2]),i[2]),n.space[0]==="h"&&(e=hsl.rgb(e)),e.push(Math.min(Math.max(n.alpha,0),1)),e}const NO_COLOR=[NaN,NaN,NaN,0];function asString(t){return typeof t=="string"?t:toString(t)}const MAX_CACHE_SIZE=1024,cache={};let cacheSize=0;function withAlpha(t){if(t.length===4)return t;const e=t.slice();return e[3]=1,e}function rgbaToLcha(t){const e=xyz.lchuv(rgb.xyz(t));return e[3]=t[3],e}function lchaToRgba(t){const e=xyz.rgb(lchuv.xyz(t));return e[3]=t[3],e}function fromString(t){if(t==="none")return NO_COLOR;if(cache.hasOwnProperty(t))return cache[t];if(cacheSize>=MAX_CACHE_SIZE){let n=0;for(const r in cache)n++&3||(delete cache[r],--cacheSize)}const e=rgba(t);if(e.length!==4)throw new Error('failed to parse "'+t+'" as color');for(const n of e)if(isNaN(n))throw new Error('failed to parse "'+t+'" as color');return normalize(e),cache[t]=e,++cacheSize,e}function asArray(t){return Array.isArray(t)?t:fromString(t)}function normalize(t){return t[0]=clamp(t[0]+.5|0,0,255),t[1]=clamp(t[1]+.5|0,0,255),t[2]=clamp(t[2]+.5|0,0,255),t[3]=clamp(t[3],0,1),t}function toString(t){let e=t[0];e!=(e|0)&&(e=e+.5|0);let n=t[1];n!=(n|0)&&(n=n+.5|0);let r=t[2];r!=(r|0)&&(r=r+.5|0);const i=t[3]===void 0?1:Math.round(t[3]*1e3)/1e3;return"rgba("+e+","+n+","+r+","+i+")"}const ua=typeof navigator<"u"&&typeof navigator.userAgent<"u"?navigator.userAgent.toLowerCase():"",FIREFOX=ua.includes("firefox"),SAFARI=ua.includes("safari")&&!ua.includes("chrom");SAFARI&&(ua.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(ua));const WEBKIT=ua.includes("webkit")&&!ua.includes("edge"),MAC=ua.includes("macintosh"),DEVICE_PIXEL_RATIO=typeof devicePixelRatio<"u"?devicePixelRatio:1,WORKER_OFFSCREEN_CANVAS=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,IMAGE_DECODE=typeof Image<"u"&&Image.prototype.decode,PASSIVE_EVENT_LISTENERS=function(){let t=!1;try{const e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch{}return t}();function createCanvasContext2D(t,e,n,r){let i;return n&&n.length?i=n.shift():WORKER_OFFSCREEN_CANVAS?i=new OffscreenCanvas(t||300,e||300):i=document.createElement("canvas"),t&&(i.width=t),e&&(i.height=e),i.getContext("2d",r)}let sharedCanvasContext;function getSharedCanvasContext2D(){return sharedCanvasContext||(sharedCanvasContext=createCanvasContext2D(1,1)),sharedCanvasContext}function releaseCanvas(t){const e=t.canvas;e.width=1,e.height=1,t.clearRect(0,0,1,1)}function outerWidth(t){let e=t.offsetWidth;const n=getComputedStyle(t);return e+=parseInt(n.marginLeft,10)+parseInt(n.marginRight,10),e}function outerHeight(t){let e=t.offsetHeight;const n=getComputedStyle(t);return e+=parseInt(n.marginTop,10)+parseInt(n.marginBottom,10),e}function replaceNode(t,e){const n=e.parentNode;n&&n.replaceChild(t,e)}function removeChildren(t){for(;t.lastChild;)t.lastChild.remove()}function replaceChildren(t,e){const n=t.childNodes;for(let r=0;;++r){const i=n[r],g=e[r];if(!i&&!g)break;if(i!==g){if(!i){t.appendChild(g);continue}if(!g){t.removeChild(i),--r;continue}t.insertBefore(g,i)}}}function listenImage(t,e,n){const r=t;let i=!0,g=!1,y=!1;const k=[listenOnce(r,EventType.LOAD,function(){y=!0,g||e()})];return r.src&&IMAGE_DECODE?(g=!0,r.decode().then(function(){i&&e()}).catch(function(L){i&&(y?e():n())})):k.push(listenOnce(r,EventType.ERROR,n)),function(){i=!1,k.forEach(unlistenByKey)}}function load(t,e){return new Promise((n,r)=>{function i(){y(),n(t)}function g(){y(),r(new Error("Image load error"))}function y(){t.removeEventListener("load",i),t.removeEventListener("error",g)}t.addEventListener("load",i),t.addEventListener("error",g)})}function decodeFallback(t,e){return e&&(t.src=e),t.src&&IMAGE_DECODE?new Promise((n,r)=>t.decode().then(()=>n(t)).catch(i=>t.complete&&t.width?n(t):r(i))):load(t)}class IconImageCache{constructor(){this.cache_={},this.patternCache_={},this.cacheSize_=0,this.maxCacheSize_=1024}clear(){this.cache_={},this.patternCache_={},this.cacheSize_=0}canExpireCache(){return this.cacheSize_>this.maxCacheSize_}expire(){if(this.canExpireCache()){let e=0;for(const n in this.cache_){const r=this.cache_[n];!(e++&3)&&!r.hasListener()&&(delete this.cache_[n],delete this.patternCache_[n],--this.cacheSize_)}}}get(e,n,r){const i=getCacheKey$1(e,n,r);return i in this.cache_?this.cache_[i]:null}getPattern(e,n,r){const i=getCacheKey$1(e,n,r);return i in this.patternCache_?this.patternCache_[i]:null}set(e,n,r,i,g){const y=getCacheKey$1(e,n,r),k=y in this.cache_;this.cache_[y]=i,g&&(i.getImageState()===ImageState.IDLE&&i.load(),i.getImageState()===ImageState.LOADING?i.ready().then(()=>{this.patternCache_[y]=getSharedCanvasContext2D().createPattern(i.getImage(1),"repeat")}):this.patternCache_[y]=getSharedCanvasContext2D().createPattern(i.getImage(1),"repeat")),k||++this.cacheSize_}setSize(e){this.maxCacheSize_=e,this.expire()}}function getCacheKey$1(t,e,n){const r=n?asArray(n):"null";return e+":"+t+":"+r}const shared=new IconImageCache;let taintedTestContext=null;class IconImage extends Target{constructor(e,n,r,i,g){super(),this.hitDetectionImage_=null,this.image_=e,this.crossOrigin_=r,this.canvas_={},this.color_=g,this.imageState_=i===void 0?ImageState.IDLE:i,this.size_=e&&e.width&&e.height?[e.width,e.height]:null,this.src_=n,this.tainted_,this.ready_=null}initializeImage_(){this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)}isTainted_(){if(this.tainted_===void 0&&this.imageState_===ImageState.LOADED){taintedTestContext||(taintedTestContext=createCanvasContext2D(1,1,void 0,{willReadFrequently:!0})),taintedTestContext.drawImage(this.image_,0,0);try{taintedTestContext.getImageData(0,0,1,1),this.tainted_=!1}catch{taintedTestContext=null,this.tainted_=!0}}return this.tainted_===!0}dispatchChangeEvent_(){this.dispatchEvent(EventType.CHANGE)}handleImageError_(){this.imageState_=ImageState.ERROR,this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=ImageState.LOADED,this.size_=[this.image_.width,this.image_.height],this.dispatchChangeEvent_()}getImage(e){return this.image_||this.initializeImage_(),this.replaceColor_(e),this.canvas_[e]?this.canvas_[e]:this.image_}getPixelRatio(e){return this.replaceColor_(e),this.canvas_[e]?e:1}getImageState(){return this.imageState_}getHitDetectionImage(){if(this.image_||this.initializeImage_(),!this.hitDetectionImage_)if(this.isTainted_()){const e=this.size_[0],n=this.size_[1],r=createCanvasContext2D(e,n);r.fillRect(0,0,e,n),this.hitDetectionImage_=r.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_===ImageState.IDLE){this.image_||this.initializeImage_(),this.imageState_=ImageState.LOADING;try{this.src_!==void 0&&(this.image_.src=this.src_)}catch{this.handleImageError_()}this.image_ instanceof HTMLImageElement&&decodeFallback(this.image_,this.src_).then(e=>{this.image_=e,this.handleImageLoad_()}).catch(this.handleImageError_.bind(this))}}replaceColor_(e){if(!this.color_||this.canvas_[e]||this.imageState_!==ImageState.LOADED)return;const n=this.image_,r=createCanvasContext2D(Math.ceil(n.width*e),Math.ceil(n.height*e)),i=r.canvas;r.scale(e,e),r.drawImage(n,0,0),r.globalCompositeOperation="multiply",r.fillStyle=asString(this.color_),r.fillRect(0,0,i.width/e,i.height/e),r.globalCompositeOperation="destination-in",r.drawImage(n,0,0),this.canvas_[e]=i}ready(){return this.ready_||(this.ready_=new Promise(e=>{if(this.imageState_===ImageState.LOADED||this.imageState_===ImageState.ERROR)e();else{const n=()=>{(this.imageState_===ImageState.LOADED||this.imageState_===ImageState.ERROR)&&(this.removeEventListener(EventType.CHANGE,n),e())};this.addEventListener(EventType.CHANGE,n)}})),this.ready_}}function get(t,e,n,r,i,g){let y=e===void 0?void 0:shared.get(e,n,i);return y||(y=new IconImage(t,t&&"src"in t?t.src||void 0:e,n,r,i),shared.set(e,n,i,y,g)),g&&y&&!shared.getPattern(e,n,i)&&shared.set(e,n,i,y,g),y}class Fill{constructor(e){e=e||{},this.patternImage_=null,this.color_=null,e.color!==void 0&&this.setColor(e.color)}clone(){const e=this.getColor();return new Fill({color:Array.isArray(e)?e.slice():e||void 0})}getColor(){return this.color_}setColor(e){if(e!==null&&typeof e=="object"&&"src"in e){const n=get(null,e.src,"anonymous",void 0,e.offset?null:e.color?e.color:null,!(e.offset&&e.size));n.ready().then(()=>{this.patternImage_=null}),n.getImageState()===ImageState.IDLE&&n.load(),n.getImageState()===ImageState.LOADING&&(this.patternImage_=n)}this.color_=e}getKey(){const e=this.getColor();return e?e instanceof CanvasPattern||e instanceof CanvasGradient?getUid(e):typeof e=="object"&&"src"in e?e.src+":"+e.offset:asArray(e).toString():""}loading(){return!!this.patternImage_}ready(){return this.patternImage_?this.patternImage_.ready():Promise.resolve()}}function interpolatePoint(t,e,n,r,i,g,y){let k,L;const $=(n-e)/r;if($===1)k=e;else if($===2)k=e,L=i;else if($!==0){let V=t[e],z=t[e+1],re=0;const oe=[0];for(let ae=e+r;ae<n;ae+=r){const ue=t[ae],de=t[ae+1];re+=Math.sqrt((ue-V)*(ue-V)+(de-z)*(de-z)),oe.push(re),V=ue,z=de}const j=i*re,ie=binarySearch(oe,j);ie<0?(L=(j-oe[-ie-2])/(oe[-ie-1]-oe[-ie-2]),k=e+(-ie-2)*r):k=e+ie*r}y=y>1?y:2,g=g||new Array(y);for(let V=0;V<y;++V)g[V]=k===void 0?NaN:L===void 0?t[k+V]:lerp(t[k+V],t[k+r+V],L);return g}function lineStringCoordinateAtM(t,e,n,r,i,g){if(n==e)return null;let y;if(i<t[e+r-1])return g?(y=t.slice(e,e+r),y[r-1]=i,y):null;if(t[n-1]<i)return g?(y=t.slice(n-r,n),y[r-1]=i,y):null;if(i==t[e+r-1])return t.slice(e,e+r);let k=e/r,L=n/r;for(;k<L;){const re=k+L>>1;i<t[(re+1)*r-1]?L=re:k=re+1}const $=t[k*r-1];if(i==$)return t.slice((k-1)*r,(k-1)*r+r);const V=t[(k+1)*r-1],z=(i-$)/(V-$);y=[];for(let re=0;re<r-1;++re)y.push(lerp(t[(k-1)*r+re],t[k*r+re],z));return y.push(i),y}function lineStringsCoordinateAtM(t,e,n,r,i,g,y){if(y)return lineStringCoordinateAtM(t,e,n[n.length-1],r,i,g);let k;if(i<t[r-1])return g?(k=t.slice(0,r),k[r-1]=i,k):null;if(t[t.length-1]<i)return g?(k=t.slice(t.length-r),k[r-1]=i,k):null;for(let L=0,$=n.length;L<$;++L){const V=n[L];if(e!=V){if(i<t[e+r-1])return null;if(i<=t[V-1])return lineStringCoordinateAtM(t,e,V,r,i,!1);e=V}}return null}function lineStringLength(t,e,n,r){let i=t[e],g=t[e+1],y=0;for(let k=e+r;k<n;k+=r){const L=t[k],$=t[k+1];y+=Math.sqrt((L-i)*(L-i)+($-g)*($-g)),i=L,g=$}return y}class LineString extends SimpleGeometry{constructor(e,n){super(),this.flatMidpoint_=null,this.flatMidpointRevision_=-1,this.maxDelta_=-1,this.maxDeltaRevision_=-1,n!==void 0&&!Array.isArray(e[0])?this.setFlatCoordinates(n,e):this.setCoordinates(e,n)}appendCoordinate(e){extend$2(this.flatCoordinates,e),this.changed()}clone(){const e=new LineString(this.flatCoordinates.slice(),this.layout);return e.applyProperties(this),e}closestPointXY(e,n,r,i){return i<closestSquaredDistanceXY(this.getExtent(),e,n)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(maxSquaredDelta(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),assignClosestPoint(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,e,n,r,i))}forEachSegment(e){return forEach(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}getCoordinateAtM(e,n){return this.layout!="XYM"&&this.layout!="XYZM"?null:(n=n!==void 0?n:!1,lineStringCoordinateAtM(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,n))}getCoordinates(){return inflateCoordinates(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinateAt(e,n){return interpolatePoint(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,n,this.stride)}getLength(){return lineStringLength(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getFlatMidpoint(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_??void 0),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_}getSimplifiedGeometryInternal(e){const n=[];return n.length=douglasPeucker(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,n,0),new LineString(n,"XY")}getType(){return"LineString"}intersectsExtent(e){return intersectsLineString(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}setCoordinates(e,n){this.setLayout(n,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=deflateCoordinates(this.flatCoordinates,0,e,this.stride),this.changed()}}class Stroke{constructor(e){e=e||{},this.color_=e.color!==void 0?e.color:null,this.lineCap_=e.lineCap,this.lineDash_=e.lineDash!==void 0?e.lineDash:null,this.lineDashOffset_=e.lineDashOffset,this.lineJoin_=e.lineJoin,this.miterLimit_=e.miterLimit,this.width_=e.width}clone(){const e=this.getColor();return new Stroke({color:Array.isArray(e)?e.slice():e||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})}getColor(){return this.color_}getLineCap(){return this.lineCap_}getLineDash(){return this.lineDash_}getLineDashOffset(){return this.lineDashOffset_}getLineJoin(){return this.lineJoin_}getMiterLimit(){return this.miterLimit_}getWidth(){return this.width_}setColor(e){this.color_=e}setLineCap(e){this.lineCap_=e}setLineDash(e){this.lineDash_=e}setLineDashOffset(e){this.lineDashOffset_=e}setLineJoin(e){this.lineJoin_=e}setMiterLimit(e){this.miterLimit_=e}setWidth(e){this.width_=e}}function hasArea(t){return t[0]>0&&t[1]>0}function scale$1(t,e,n){return n===void 0&&(n=[0,0]),n[0]=t[0]*e+.5|0,n[1]=t[1]*e+.5|0,n}function toSize(t,e){return Array.isArray(t)?t:(e===void 0?e=[t,t]:(e[0]=t,e[1]=t),e)}class ImageStyle{constructor(e){this.opacity_=e.opacity,this.rotateWithView_=e.rotateWithView,this.rotation_=e.rotation,this.scale_=e.scale,this.scaleArray_=toSize(e.scale),this.displacement_=e.displacement,this.declutterMode_=e.declutterMode}clone(){const e=this.getScale();return new ImageStyle({opacity:this.getOpacity(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getOpacity(){return this.opacity_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getDisplacement(){return this.displacement_}getDeclutterMode(){return this.declutterMode_}getAnchor(){return abstract()}getImage(e){return abstract()}getHitDetectionImage(){return abstract()}getPixelRatio(e){return 1}getImageState(){return abstract()}getImageSize(){return abstract()}getOrigin(){return abstract()}getSize(){return abstract()}setDisplacement(e){this.displacement_=e}setOpacity(e){this.opacity_=e}setRotateWithView(e){this.rotateWithView_=e}setRotation(e){this.rotation_=e}setScale(e){this.scale_=e,this.scaleArray_=toSize(e)}listenImageChange(e){abstract()}load(){abstract()}unlistenImageChange(e){abstract()}ready(){return Promise.resolve()}}function asColorLike(t){return t?Array.isArray(t)?toString(t):typeof t=="object"&&"src"in t?asCanvasPattern(t):t:null}function asCanvasPattern(t){if(!t.offset||!t.size)return shared.getPattern(t.src,"anonymous",t.color);const e=t.src+":"+t.offset,n=shared.getPattern(e,void 0,t.color);if(n)return n;const r=shared.get(t.src,"anonymous",null);if(r.getImageState()!==ImageState.LOADED)return null;const i=createCanvasContext2D(t.size[0],t.size[1]);return i.drawImage(r.getImage(1),t.offset[0],t.offset[1],t.size[0],t.size[1],0,0,t.size[0],t.size[1]),get(i.canvas,e,void 0,ImageState.LOADED,t.color,!0),shared.getPattern(e,void 0,t.color)}const defaultFont="10px sans-serif",defaultFillStyle="#000",defaultLineCap="round",defaultLineDash=[],defaultLineDashOffset=0,defaultLineJoin="round",defaultMiterLimit=10,defaultStrokeStyle="#000",defaultTextAlign="center",defaultTextBaseline="middle",defaultPadding=[0,0,0,0],defaultLineWidth=1,checkedFonts=new BaseObject;let measureContext=null,measureFont;const textHeights={},registerFont=function(){const e="32px ",n=["monospace","serif"],r=n.length,i="wmytzilWMYTZIL@#/&?$%10";let g,y;function k($,V,z){let re=!0;for(let oe=0;oe<r;++oe){const j=n[oe];if(y=measureTextWidth($+" "+V+" "+e+j,i),z!=j){const ie=measureTextWidth($+" "+V+" "+e+z+","+j,i);re=re&&ie!=y}}return!!re}function L(){let $=!0;const V=checkedFonts.getKeys();for(let z=0,re=V.length;z<re;++z){const oe=V[z];if(checkedFonts.get(oe)<100){const[j,ie,ae]=oe.split(`
54
54
  `);k(j,ie,ae)?(clear(textHeights),measureContext=null,measureFont=void 0,checkedFonts.set(oe,100)):(checkedFonts.set(oe,checkedFonts.get(oe)+1,!0),$=!1)}}$&&(clearInterval(g),g=void 0)}return function($){const V=getFontParameters($);if(!V)return;const z=V.families;for(let re=0,oe=z.length;re<oe;++re){const j=z[re],ie=V.style+`
55
55
  `+V.weight+`
56
56
  `+j;checkedFonts.get(ie)===void 0&&(checkedFonts.set(ie,100,!0),k(V.style,V.weight,j)||(checkedFonts.set(ie,0,!0),g===void 0&&(g=setInterval(L,32))))}}}(),measureTextHeight=function(){let t;return function(e){let n=textHeights[e];if(n==null){if(WORKER_OFFSCREEN_CANVAS){const r=getFontParameters(e),i=measureText(e,"Žg");n=(isNaN(Number(r.lineHeight))?1.2:Number(r.lineHeight))*(i.actualBoundingBoxAscent+i.actualBoundingBoxDescent)}else t||(t=document.createElement("div"),t.innerHTML="M",t.style.minHeight="0",t.style.maxHeight="none",t.style.height="auto",t.style.padding="0",t.style.border="none",t.style.position="absolute",t.style.display="block",t.style.left="-99999px"),t.style.font=e,document.body.appendChild(t),n=t.offsetHeight,document.body.removeChild(t);textHeights[e]=n}return n}}();function measureText(t,e){return measureContext||(measureContext=createCanvasContext2D(1,1)),t!=measureFont&&(measureContext.font=t,measureFont=measureContext.font),measureContext.measureText(e)}function measureTextWidth(t,e){return measureText(t,e).width}function measureAndCacheTextWidth(t,e,n){if(e in n)return n[e];const r=e.split(`
@@ -131,7 +131,7 @@ hooks.version="2.30.1",setHookCallback(createLocal),hooks.fn=proto,hooks.min=min
131
131
  gl_FragColor = texture2D(u_texture, v_texcoord);
132
132
  }
133
133
  `;function createCanvasContextWebGL(t,e,n,r){let i;return n&&n.length?i=n.shift():WORKER_OFFSCREEN_CANVAS?i=new OffscreenCanvas(t||300,e||300):i=document.createElement("canvas"),t&&(i.width=t),e&&(i.height=e),i.getContext("webgl",r)}function releaseGLCanvas(t){const e=t.canvas;e.width=1,e.height=1,t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT|t.STENCIL_BUFFER_BIT)}const canvasGLPool=[];function render$1(t,e,n,r,i,g,y,k,L,$,V,z,re,oe){const j=Math.round(r*e),ie=Math.round(r*n);t.canvas.width=j,t.canvas.height=ie;let ae,ue;if(ue=t.createTexture(),t.bindTexture(t.TEXTURE_2D,ue),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),re?(t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR)):(t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST)),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,j,ie,0,t.RGBA,V,null),ae=t.createFramebuffer(),t.bindFramebuffer(t.FRAMEBUFFER,ae),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,ue,0),ae===null)throw new Error("Could not create framebuffer");if(ue===null)throw new Error("Could not create texture");if(L.length===0)return{width:j,height:ie,framebuffer:ae,texture:ue};const de=createEmpty();L.forEach(function(Ne,Ue,kt){extend$3(de,Ne.extent)});let pe,le,he;const _e=1/i;{if(pe=t.createTexture(),ue===null)throw new Error("Could not create texture");le=Math.round(getWidth(de)*_e),he=Math.round(getHeight(de)*_e);const Ne=t.getParameter(t.MAX_TEXTURE_SIZE),Ue=Math.max(le,he),kt=Ue>Ne?Ne/Ue:1,Dt=Math.round(le*kt),jt=Math.round(he*kt);t.bindTexture(t.TEXTURE_2D,pe),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),re?(t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR)):(t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST)),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,Dt,jt,0,t.RGBA,V,null);const Fe=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,Fe),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,pe,0);const $e=new Canvas(t);L.forEach(function(Ve,ze,Oe){const qe=(Ve.extent[0]-de[0])*_e*kt,Et=-(Ve.extent[3]-de[3])*_e*kt,hn=getWidth(Ve.extent)*_e*kt,At=getHeight(Ve.extent)*_e*kt;if(t.bindFramebuffer(t.FRAMEBUFFER,Fe),t.viewport(0,0,Dt,jt),Ve.clipExtent){const Lt=(Ve.clipExtent[0]-de[0])*_e*kt,wn=-(Ve.clipExtent[3]-de[3])*_e*kt,kn=getWidth(Ve.clipExtent)*_e*kt,En=getHeight(Ve.clipExtent)*_e*kt;t.enable(t.SCISSOR_TEST),t.scissor(re?Lt:Math.round(Lt),re?wn:Math.round(wn),re?kn:Math.round(Lt+kn)-Math.round(Lt),re?En:Math.round(wn+En)-Math.round(wn))}$e.drawImage(Ve.texture,Ve.width,Ve.height,$,$,Ve.width-2*$,Ve.height-2*$,re?qe:Math.round(qe),re?Et:Math.round(Et),re?hn:Math.round(qe+hn)-Math.round(qe),re?At:Math.round(Et+At)-Math.round(Et),Dt,jt),t.disable(t.SCISSOR_TEST)}),t.deleteFramebuffer(Fe)}const Ce=getTopLeft(y),xe=getTopLeft(de),Ie=Ne=>{const Ue=(Ne[0][0]-Ce[0])/g*r,kt=-(Ne[0][1]-Ce[1])/g*r,Dt=(Ne[1][0]-Ce[0])/g*r,jt=-(Ne[1][1]-Ce[1])/g*r,Fe=(Ne[2][0]-Ce[0])/g*r,$e=-(Ne[2][1]-Ce[1])/g*r;return{u1:Dt,v1:jt,u0:Ue,v0:kt,u2:Fe,v2:$e}};t.bindFramebuffer(t.FRAMEBUFFER,ae),t.viewport(0,0,j,ie);{const Ne=[],Ue=[],kt=createProgram(t,TRIANGLE_FRAGMENT_SHADER,TRIANGLE_VERTEX_SHADER);t.useProgram(kt);const Dt=t.getUniformLocation(kt,"u_texture");t.bindTexture(t.TEXTURE_2D,pe),t.uniform1i(Dt,0),k.getTriangles().forEach(function(qe,Et,hn){const At=qe.source,Lt=qe.target,{u1:wn,v1:kn,u0:En,v0:Cn,u2:Pn,v2:Dn}=Ie(Lt),Nn=(At[0][0]-xe[0])/i/le,Vn=-(At[0][1]-xe[1])/i/he,Bn=(At[1][0]-xe[0])/i/le,jn=-(At[1][1]-xe[1])/i/he,Xn=(At[2][0]-xe[0])/i/le,Zn=-(At[2][1]-xe[1])/i/he;Ne.push(wn,kn,En,Cn,Pn,Dn),Ue.push(Bn,jn,Nn,Vn,Xn,Zn)});const jt=orthographic(0,j,ie,0,-1,1),Fe=t.getUniformLocation(kt,"u_matrix");t.uniformMatrix4fv(Fe,!1,jt);const $e=t.getAttribLocation(kt,"a_position"),Ve=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,Ve),t.bufferData(t.ARRAY_BUFFER,new Float32Array(Ne),t.STATIC_DRAW),t.vertexAttribPointer($e,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray($e);const ze=t.getAttribLocation(kt,"a_texcoord"),Oe=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,Oe),t.bufferData(t.ARRAY_BUFFER,new Float32Array(Ue),t.STATIC_DRAW),t.vertexAttribPointer(ze,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(ze),t.drawArrays(t.TRIANGLES,0,Ne.length/2)}if(z){const Ne=createProgram(t,EDGE_FRAGMENT_SHADER,EDGE_VERTEX_SHADER);t.useProgram(Ne);const Ue=orthographic(0,j,ie,0,-1,1),kt=t.getUniformLocation(Ne,"u_matrix");t.uniformMatrix4fv(kt,!1,Ue);const Dt=Array.isArray(z)?z:[0,0,0,255],jt=t.getUniformLocation(Ne,"u_val");t.uniform4fv(jt,Dt);const Fe=t.getAttribLocation(Ne,"a_position"),$e=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,$e),t.vertexAttribPointer(Fe,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(Fe);const Ve=k.getTriangles().reduce(function(ze,Oe){const qe=Oe.target,{u1:Et,v1:hn,u0:At,v0:Lt,u2:wn,v2:kn}=Ie(qe);return ze.concat([Et,hn,At,Lt,At,Lt,wn,kn,wn,kn,Et,hn])},[]);t.bufferData(t.ARRAY_BUFFER,new Float32Array(Ve),t.STATIC_DRAW),t.drawArrays(t.LINES,0,Ve.length/2)}return{width:j,height:ie,framebuffer:ae,texture:ue}}class ReprojDataTile extends DataTile{constructor(e){super({tileCoord:e.tileCoord,loader:()=>Promise.resolve(new Uint8ClampedArray(4)),interpolate:e.interpolate,transition:e.transition}),this.renderEdges_=e.renderEdges!==void 0?e.renderEdges:!1,this.pixelRatio_=e.pixelRatio,this.gutter_=e.gutter,this.reprojData_=null,this.reprojError_=null,this.reprojSize_=void 0,this.sourceTileGrid_=e.sourceTileGrid,this.targetTileGrid_=e.targetTileGrid,this.wrappedTileCoord_=e.wrappedTileCoord||e.tileCoord,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0;const n=e.sourceProj,r=n.getExtent(),i=e.sourceTileGrid.getExtent();this.clipExtent_=n.canWrapX()?i?getIntersection(r,i):r:i;const g=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_),y=this.targetTileGrid_.getExtent();let k=this.sourceTileGrid_.getExtent();const L=y?getIntersection(g,y):g;if(getArea$1(L)===0){this.state=TileState.EMPTY;return}r&&(k?k=getIntersection(k,r):k=r);const $=this.targetTileGrid_.getResolution(this.wrappedTileCoord_[0]),V=e.targetProj,z=calculateSourceExtentResolution(n,V,L,$);if(!isFinite(z)||z<=0){this.state=TileState.EMPTY;return}const re=e.errorThreshold!==void 0?e.errorThreshold:ERROR_THRESHOLD;if(this.triangulation_=new Triangulation(n,V,L,k,z*re,$,e.transformMatrix),this.triangulation_.getTriangles().length===0){this.state=TileState.EMPTY;return}this.sourceZ_=this.sourceTileGrid_.getZForResolution(z);let oe=this.triangulation_.calculateSourceExtent();if(k&&(n.canWrapX()?(oe[1]=clamp(oe[1],k[1],k[3]),oe[3]=clamp(oe[3],k[1],k[3])):oe=getIntersection(oe,k)),!getArea$1(oe))this.state=TileState.EMPTY;else{let j=0,ie=0;n.canWrapX()&&(j=getWidth(r),ie=Math.floor((oe[0]-r[0])/j)),wrapAndSliceX(oe.slice(),n,!0).forEach(ue=>{const de=this.sourceTileGrid_.getTileRangeForExtentAndZ(ue,this.sourceZ_),pe=e.getTileFunction;for(let le=de.minX;le<=de.maxX;le++)for(let he=de.minY;he<=de.maxY;he++){const _e=pe(this.sourceZ_,le,he,this.pixelRatio_);if(_e){const Ce=ie*j;this.sourceTiles_.push({tile:_e,offset:Ce})}}++ie}),this.sourceTiles_.length===0&&(this.state=TileState.EMPTY)}}getSize(){return this.reprojSize_}getData(){return this.reprojData_}getError(){return this.reprojError_}reproject_(){const e=[];let n=!1;if(this.sourceTiles_.forEach(le=>{var Et;const he=le.tile;if(!he||he.getState()!==TileState.LOADED)return;const _e=he.getSize(),Ce=this.gutter_;let xe;const Ie=asArrayLike(he.getData());Ie?xe=Ie:(n=!0,xe=toArray(asImageLike(he.getData())));const Ne=[_e[0]+2*Ce,_e[1]+2*Ce],Ue=xe instanceof Float32Array,kt=Ne[0]*Ne[1],Dt=Ue?Float32Array:Uint8ClampedArray,jt=new Dt(xe.buffer),Fe=Dt.BYTES_PER_ELEMENT,$e=Fe*jt.length/kt,Ve=jt.byteLength/Ne[1],ze=Math.floor(Ve/Fe/Ne[0]),Oe=this.sourceTileGrid_.getTileCoordExtent(he.tileCoord);Oe[0]+=le.offset,Oe[2]+=le.offset;const qe=(Et=this.clipExtent_)==null?void 0:Et.slice();qe&&(qe[0]+=le.offset,qe[2]+=le.offset),e.push({extent:Oe,clipExtent:qe,data:jt,dataType:Dt,bytesPerPixel:$e,pixelSize:Ne,bandCount:ze})}),this.sourceTiles_.length=0,e.length===0){this.state=TileState.ERROR,this.changed();return}const r=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(r),g=typeof i=="number"?i:i[0],y=typeof i=="number"?i:i[1],k=g*this.pixelRatio_,L=y*this.pixelRatio_,$=this.targetTileGrid_.getResolution(r),V=this.sourceTileGrid_.getResolution(this.sourceZ_),z=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_),re=e[0].bandCount,oe=new e[0].dataType(re*k*L),j=createCanvasContextWebGL(k,L,canvasGLPool,{premultipliedAlpha:!1,antialias:!1});let ie;const ae=j.RGBA;let ue;e[0].dataType==Float32Array?(ue=j.FLOAT,j.getExtension("WEBGL_color_buffer_float"),j.getExtension("OES_texture_float"),j.getExtension("EXT_float_blend"),ie=j.getExtension("OES_texture_float_linear")!==null&&this.interpolate):(ue=j.UNSIGNED_BYTE,ie=this.interpolate);const de=4,pe=Math.ceil(re/de);for(let le=pe-1;le>=0;--le){const he=[];for(let Dt=0,jt=e.length;Dt<jt;++Dt){const Fe=e[Dt],$e=Fe.pixelSize,Ve=$e[0],ze=$e[1],Oe=new Fe.dataType(de*Ve*ze),qe=Fe.data;let Et=le*de;for(let At=0,Lt=Oe.length;At<Lt;At+=de)Oe[At]=qe[Et],Oe[At+1]=qe[Et+1],Oe[At+2]=qe[Et+2],Oe[At+3]=qe[Et+3],Et+=re;const hn=j.createTexture();j.bindTexture(j.TEXTURE_2D,hn),ie?(j.texParameteri(j.TEXTURE_2D,j.TEXTURE_MIN_FILTER,j.LINEAR),j.texParameteri(j.TEXTURE_2D,j.TEXTURE_MAG_FILTER,j.LINEAR)):(j.texParameteri(j.TEXTURE_2D,j.TEXTURE_MIN_FILTER,j.NEAREST),j.texParameteri(j.TEXTURE_2D,j.TEXTURE_MAG_FILTER,j.NEAREST)),j.texParameteri(j.TEXTURE_2D,j.TEXTURE_WRAP_S,j.CLAMP_TO_EDGE),j.texParameteri(j.TEXTURE_2D,j.TEXTURE_WRAP_T,j.CLAMP_TO_EDGE),j.texImage2D(j.TEXTURE_2D,0,ae,Ve,ze,0,ae,ue,Oe),he.push({extent:Fe.extent,clipExtent:Fe.clipExtent,texture:hn,width:Ve,height:ze})}const{framebuffer:_e,width:Ce,height:xe}=render$1(j,g,y,this.pixelRatio_,V,$,z,this.triangulation_,he,this.gutter_,ue,this.renderEdges_,ie),Ie=Ce,Ne=xe*de,Ue=new e[0].dataType(Ie*Ne);j.bindFramebuffer(j.FRAMEBUFFER,_e),j.readPixels(0,0,Ce,xe,j.RGBA,ue,Ue);let kt=le*de;for(let Dt=0,jt=Ue.length;Dt<jt;Dt+=de){const Fe=(Ie-1-(Dt/Ne|0))*Ne+Dt%Ne;oe[kt]=Ue[Fe],oe[kt+1]=Ue[Fe+1],oe[kt+2]=Ue[Fe+2],oe[kt+3]=Ue[Fe+3],kt+=re}}if(releaseGLCanvas(j),canvasGLPool.push(j.canvas),n){const le=createCanvasContext2D(g,y),he=new ImageData(oe,g);le.putImageData(he,0,0),this.reprojData_=le.canvas}else this.reprojData_=oe;this.reprojSize_=[Math.round(k),Math.round(L)],this.state=TileState.LOADED,this.changed()}load(){if(this.state!==TileState.IDLE&&this.state!==TileState.ERROR)return;this.state=TileState.LOADING,this.changed();let e=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(({tile:n})=>{const r=n.getState();if(r!==TileState.IDLE&&r!==TileState.LOADING)return;e++;const i=listen(n,EventType.CHANGE,()=>{const g=n.getState();(g==TileState.LOADED||g==TileState.ERROR||g==TileState.EMPTY)&&(unlistenByKey(i),e--,e===0&&(this.unlistenSources_(),this.reproject_()))});this.sourcesListenerKeys_.push(i)}),e===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function({tile:n}){n.getState()==TileState.IDLE&&n.load()})}unlistenSources_(){this.sourcesListenerKeys_.forEach(unlistenByKey),this.sourcesListenerKeys_=null}}class ReprojTile extends Tile{constructor(e,n,r,i,g,y,k,L,$,V,z,re){super(g,TileState.IDLE,re),this.renderEdges_=z!==void 0?z:!1,this.pixelRatio_=k,this.gutter_=L,this.canvas_=null,this.sourceTileGrid_=n,this.targetTileGrid_=i,this.wrappedTileCoord_=y||g,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0,this.clipExtent_=e.canWrapX()?e.getExtent():void 0;const oe=i.getTileCoordExtent(this.wrappedTileCoord_),j=this.targetTileGrid_.getExtent();let ie=this.sourceTileGrid_.getExtent();const ae=j?getIntersection(oe,j):oe;if(getArea$1(ae)===0){this.state=TileState.EMPTY;return}const ue=e.getExtent();ue&&(ie?ie=getIntersection(ie,ue):ie=ue);const de=i.getResolution(this.wrappedTileCoord_[0]),pe=calculateSourceExtentResolution(e,r,ae,de);if(!isFinite(pe)||pe<=0){this.state=TileState.EMPTY;return}const le=V!==void 0?V:ERROR_THRESHOLD;if(this.triangulation_=new Triangulation(e,r,ae,ie,pe*le,de),this.triangulation_.getTriangles().length===0){this.state=TileState.EMPTY;return}this.sourceZ_=n.getZForResolution(pe);let he=this.triangulation_.calculateSourceExtent();if(ie&&(e.canWrapX()?(he[1]=clamp(he[1],ie[1],ie[3]),he[3]=clamp(he[3],ie[1],ie[3])):he=getIntersection(he,ie)),!getArea$1(he))this.state=TileState.EMPTY;else{let _e=0,Ce=0;e.canWrapX()&&(_e=getWidth(ue),Ce=Math.floor((he[0]-ue[0])/_e)),wrapAndSliceX(he.slice(),e,!0).forEach(Ie=>{const Ne=n.getTileRangeForExtentAndZ(Ie,this.sourceZ_);for(let Ue=Ne.minX;Ue<=Ne.maxX;Ue++)for(let kt=Ne.minY;kt<=Ne.maxY;kt++){const Dt=$(this.sourceZ_,Ue,kt,k);if(Dt){const jt=Ce*_e;this.sourceTiles_.push({tile:Dt,offset:jt})}}++Ce}),this.sourceTiles_.length===0&&(this.state=TileState.EMPTY)}}getImage(){return this.canvas_}reproject_(){const e=[];if(this.sourceTiles_.forEach(n=>{var i;const r=n.tile;if(r&&r.getState()==TileState.LOADED){const g=this.sourceTileGrid_.getTileCoordExtent(r.tileCoord);g[0]+=n.offset,g[2]+=n.offset;const y=(i=this.clipExtent_)==null?void 0:i.slice();y&&(y[0]+=n.offset,y[2]+=n.offset),e.push({extent:g,clipExtent:y,image:r.getImage()})}}),this.sourceTiles_.length=0,e.length===0)this.state=TileState.ERROR;else{const n=this.wrappedTileCoord_[0],r=this.targetTileGrid_.getTileSize(n),i=typeof r=="number"?r:r[0],g=typeof r=="number"?r:r[1],y=this.targetTileGrid_.getResolution(n),k=this.sourceTileGrid_.getResolution(this.sourceZ_),L=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=render$2(i,g,this.pixelRatio_,k,this.sourceTileGrid_.getExtent(),y,L,this.triangulation_,e,this.gutter_,this.renderEdges_,this.interpolate),this.state=TileState.LOADED}this.changed()}load(){if(this.state==TileState.IDLE){this.state=TileState.LOADING,this.changed();let e=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(({tile:n})=>{const r=n.getState();if(r==TileState.IDLE||r==TileState.LOADING){e++;const i=listen(n,EventType.CHANGE,g=>{const y=n.getState();(y==TileState.LOADED||y==TileState.ERROR||y==TileState.EMPTY)&&(unlistenByKey(i),e--,e===0&&(this.unlistenSources_(),this.reproject_()))});this.sourcesListenerKeys_.push(i)}}),e===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function({tile:n},r,i){n.getState()==TileState.IDLE&&n.load()})}}unlistenSources_(){this.sourcesListenerKeys_.forEach(unlistenByKey),this.sourcesListenerKeys_=null}release(){this.canvas_&&(releaseCanvas(this.canvas_.getContext("2d")),canvasPool.push(this.canvas_),this.canvas_=null),super.release()}}function getCacheKey(t,e,n,r){return`${t},${getKeyZXY(e,n,r)}`}function addTileToLookup(t,e,n){if(!(n in t))return t[n]=new Set([e]),!0;const r=t[n],i=r.has(e);return i||r.add(e),!i}function removeTileFromLookup(t,e,n){const r=t[n];return r?r.delete(e):!1}function getRenderExtent(t,e){const n=t.layerStatesArray[t.layerIndex];n.extent&&(e=getIntersection(e,fromUserExtent(n.extent,t.viewState.projection)));const r=n.layer.getRenderSource();if(!r.getWrapX()){const i=r.getTileGridForProjection(t.viewState.projection).getExtent();i&&(e=getIntersection(e,i))}return e}class CanvasTileLayerRenderer extends CanvasLayerRenderer{constructor(e,n){super(e),n=n||{},this.extentChanged=!0,this.renderComplete=!1,this.renderedExtent_=null,this.renderedPixelRatio,this.renderedProjection=null,this.renderedRevision,this.renderedTiles=[],this.renderedSourceKey_,this.renderedSourceRevision_,this.tempExtent=createEmpty(),this.tempTileRange_=new TileRange(0,0,0,0),this.tempTileCoord_=createOrUpdate$1(0,0,0);const r=n.cacheSize!==void 0?n.cacheSize:512;this.tileCache_=new LRUCache(r),this.maxStaleKeys=r*.5}getTileCache(){return this.tileCache_}getOrCreateTile(e,n,r,i){const g=this.tileCache_,k=this.getLayer().getSource(),L=getCacheKey(k.getKey(),e,n,r);let $;if(g.containsKey(L))$=g.get(L);else{if($=k.getTile(e,n,r,i.pixelRatio,i.viewState.projection),!$)return null;g.set(L,$)}return $}getTile(e,n,r,i){const g=this.getOrCreateTile(e,n,r,i);return g||null}getData(e){const n=this.frameState;if(!n)return null;const r=this.getLayer(),i=apply(n.pixelToCoordinateTransform,e.slice()),g=r.getExtent();if(g&&!containsCoordinate(g,i))return null;const y=n.viewState,k=r.getRenderSource(),L=k.getTileGridForProjection(y.projection),$=k.getTilePixelRatio(n.pixelRatio);for(let V=L.getZForResolution(y.resolution);V>=L.getMinZoom();--V){const z=L.getTileCoordForCoordAndZ(i,V),re=this.getTile(V,z[1],z[2],n);if(!re||re.getState()!==TileState.LOADED)continue;const oe=L.getOrigin(V),j=toSize(L.getTileSize(V)),ie=L.getResolution(V);let ae;if(re instanceof ImageTile||re instanceof ReprojTile)ae=re.getImage();else if(re instanceof DataTile){if(ae=asImageLike(re.getData()),!ae)continue}else continue;const ue=Math.floor($*((i[0]-oe[0])/ie-z[1]*j[0])),de=Math.floor($*((oe[1]-i[1])/ie-z[2]*j[1])),pe=Math.round($*k.getGutterForProjection(y.projection));return this.getImageData(ae,ue+pe,de+pe)}return null}prepareFrame(e){this.renderedProjection?e.viewState.projection!==this.renderedProjection&&(this.tileCache_.clear(),this.renderedProjection=e.viewState.projection):this.renderedProjection=e.viewState.projection;const n=this.getLayer().getSource();if(!n)return!1;const r=n.getRevision();return this.renderedRevision_?this.renderedRevision_!==r&&(this.renderedRevision_=r,this.renderedSourceKey_===n.getKey()&&this.tileCache_.clear()):this.renderedRevision_=r,!0}enqueueTiles(e,n,r,i,g){const y=e.viewState,k=this.getLayer(),L=k.getRenderSource(),$=L.getTileGridForProjection(y.projection),V=getUid(L);V in e.wantedTiles||(e.wantedTiles[V]={});const z=e.wantedTiles[V],re=k.getMapInternal(),oe=Math.max(r-g,$.getMinZoom(),$.getZForResolution(Math.min(k.getMaxResolution(),re?re.getView().getResolutionForZoom(Math.max(k.getMinZoom(),0)):$.getResolution(0)),L.zDirection));for(let j=r;j>=oe;--j){const ie=$.getTileRangeForExtentAndZ(n,j,this.tempTileRange_),ae=$.getResolution(j);for(let ue=ie.minX;ue<=ie.maxX;++ue)for(let de=ie.minY;de<=ie.maxY;++de){const pe=this.getTile(j,ue,de,e);if(!pe||!addTileToLookup(i,pe,j))continue;const he=pe.getKey();if(z[he]=!0,pe.getState()===TileState.IDLE&&!e.tileQueue.isKeyQueued(he)){const _e=createOrUpdate$1(j,ue,de,this.tempTileCoord_);e.tileQueue.enqueue([pe,V,$.getTileCoordCenter(_e),ae])}}}}findStaleTile_(e,n){const r=this.tileCache_,i=e[0],g=e[1],y=e[2],k=this.getStaleKeys();for(let L=0;L<k.length;++L){const $=getCacheKey(k[L],i,g,y);if(r.containsKey($)){const V=r.get($);if(V.getState()===TileState.LOADED)return V.endTransition(getUid(this)),addTileToLookup(n,V,i),!0}}return!1}findAltTiles_(e,n,r,i){const g=e.getTileRangeForTileCoordAndZ(n,r,this.tempTileRange_);if(!g)return!1;let y=!0;const k=this.tileCache_,$=this.getLayer().getRenderSource().getKey();for(let V=g.minX;V<=g.maxX;++V)for(let z=g.minY;z<=g.maxY;++z){const re=getCacheKey($,r,V,z);let oe=!1;if(k.containsKey(re)){const j=k.get(re);j.getState()===TileState.LOADED&&(addTileToLookup(i,j,r),oe=!0)}oe||(y=!1)}return y}renderFrame(e,n){let r=!0;this.renderComplete=!0;const i=e.layerStatesArray[e.layerIndex],g=e.viewState,y=g.projection,k=g.resolution,L=g.center,$=e.pixelRatio,V=this.getLayer(),z=V.getSource(),re=z.getRevision(),oe=z.getTileGridForProjection(y),j=oe.getZForResolution(k,z.zDirection),ie=oe.getResolution(j),ae=z.getKey();this.renderedSourceKey_?this.renderedSourceKey_!==ae&&(this.prependStaleKey(this.renderedSourceKey_),this.renderedSourceKey_=ae):this.renderedSourceKey_=ae;let ue=e.extent;const de=z.getTilePixelRatio($);this.prepareContainer(e,n);const pe=this.context.canvas.width,le=this.context.canvas.height,he=i.extent&&fromUserExtent(i.extent);he&&(ue=getIntersection(ue,fromUserExtent(i.extent)));const _e=ie*pe/2/de,Ce=ie*le/2/de,xe=[L[0]-_e,L[1]-Ce,L[0]+_e,L[1]+Ce],Ie={};this.renderedTiles.length=0;const Ne=V.getPreload();if(e.nextExtent){const qe=oe.getZForResolution(g.nextResolution,z.zDirection),Et=getRenderExtent(e,e.nextExtent);this.enqueueTiles(e,Et,qe,Ie,Ne)}const Ue=getRenderExtent(e,ue);if(this.enqueueTiles(e,Ue,j,Ie,0),Ne>0&&setTimeout(()=>{this.enqueueTiles(e,Ue,j-1,Ie,Ne-1)},0),!(j in Ie))return this.container;const kt=getUid(this),Dt=e.time;for(const qe of Ie[j]){const Et=qe.getState();if((qe instanceof ReprojTile||qe instanceof ReprojDataTile)&&Et===TileState.EMPTY)continue;const hn=qe.tileCoord;if(Et===TileState.LOADED&&qe.getAlpha(kt,Dt)===1){qe.endTransition(kt);continue}if(Et!==TileState.IDLE&&(r=!1),Et!==TileState.ERROR&&(this.renderComplete=!1),this.findStaleTile_(hn,Ie)){removeTileFromLookup(Ie,qe,j),e.animate=!0;continue}if(this.findAltTiles_(oe,hn,j+1,Ie))continue;const wn=oe.getMinZoom();for(let kn=j-1;kn>=wn&&!this.findAltTiles_(oe,hn,kn,Ie);--kn);}const jt=ie/k*$/de,Fe=this.getRenderContext(e);compose(this.tempTransform,pe/2,le/2,jt,jt,0,-pe/2,-le/2),i.extent&&this.clipUnrotated(Fe,e,he),z.getInterpolate()||(Fe.imageSmoothingEnabled=!1),this.preRender(Fe,e);const $e=Object.keys(Ie).map(Number);$e.sort(ascending);let Ve;const ze=[],Oe=[];for(let qe=$e.length-1;qe>=0;--qe){const Et=$e[qe],hn=z.getTilePixelSize(Et,$,y),Lt=oe.getResolution(Et)/ie,wn=hn[0]*Lt*jt,kn=hn[1]*Lt*jt,En=oe.getTileCoordForCoordAndZ(getTopLeft(xe),Et),Cn=oe.getTileCoordExtent(En),Pn=apply(this.tempTransform,[de*(Cn[0]-xe[0])/ie,de*(xe[3]-Cn[3])/ie]),Dn=de*z.getGutterForProjection(y);for(const Nn of Ie[Et]){if(Nn.getState()!==TileState.LOADED)continue;const Vn=Nn.tileCoord,Bn=En[1]-Vn[1],jn=Math.round(Pn[0]-(Bn-1)*wn),Xn=En[2]-Vn[2],Zn=Math.round(Pn[1]-(Xn-1)*kn),zn=Math.round(Pn[0]-Bn*wn),Gn=Math.round(Pn[1]-Xn*kn),Fn=jn-zn,Un=Zn-Gn,xn=$e.length===1;let Rn=!1;Ve=[zn,Gn,zn+Fn,Gn,zn+Fn,Gn+Un,zn,Gn+Un];for(let Ln=0,_n=ze.length;Ln<_n;++Ln)if(!xn&&Et<Oe[Ln]){const Mn=ze[Ln];intersects$1([zn,Gn,zn+Fn,Gn+Un],[Mn[0],Mn[3],Mn[4],Mn[7]])&&(Rn||(Fe.save(),Rn=!0),Fe.beginPath(),Fe.moveTo(Ve[0],Ve[1]),Fe.lineTo(Ve[2],Ve[3]),Fe.lineTo(Ve[4],Ve[5]),Fe.lineTo(Ve[6],Ve[7]),Fe.moveTo(Mn[6],Mn[7]),Fe.lineTo(Mn[4],Mn[5]),Fe.lineTo(Mn[2],Mn[3]),Fe.lineTo(Mn[0],Mn[1]),Fe.clip())}ze.push(Ve),Oe.push(Et),this.drawTile(Nn,e,zn,Gn,Fn,Un,Dn,xn),Rn&&Fe.restore(),this.renderedTiles.unshift(Nn),this.updateUsedTiles(e.usedTiles,z,Nn)}}if(this.renderedRevision=re,this.renderedResolution=ie,this.extentChanged=!this.renderedExtent_||!equals$2(this.renderedExtent_,xe),this.renderedExtent_=xe,this.renderedPixelRatio=$,this.postRender(this.context,e),i.extent&&Fe.restore(),Fe.imageSmoothingEnabled=!0,this.renderComplete){const qe=(Et,hn)=>{const At=getUid(z),Lt=hn.wantedTiles[At],wn=Lt?Object.keys(Lt).length:0;this.updateCacheSize(wn),this.tileCache_.expireCache()};e.postRenderFunctions.push(qe)}return!this.renderComplete&&!r&&(e.animate=!0),this.container}updateCacheSize(e){this.tileCache_.highWaterMark=Math.max(this.tileCache_.highWaterMark,e*2)}drawTile(e,n,r,i,g,y,k,L){let $;if(e instanceof DataTile){if($=asImageLike(e.getData()),!$)throw new Error("Rendering array data is not yet supported")}else $=this.getTileImage(e);if(!$)return;const V=this.getRenderContext(n),z=getUid(this),re=n.layerStatesArray[n.layerIndex],oe=re.opacity*(L?e.getAlpha(z,n.time):1),j=oe!==V.globalAlpha;j&&(V.save(),V.globalAlpha=oe),V.drawImage($,k,k,$.width-2*k,$.height-2*k,r,i,g,y),j&&V.restore(),oe!==re.opacity?n.animate=!0:L&&e.endTransition(z)}getImage(){const e=this.context;return e?e.canvas:null}getTileImage(e){return e.getImage()}updateUsedTiles(e,n,r){const i=getUid(n);i in e||(e[i]={}),e[i][r.getKey()]=!0}}class TileLayer extends BaseTileLayer{constructor(e){super(e)}createRenderer(){return new CanvasTileLayerRenderer(this,{cacheSize:this.getCacheSize()})}}const TIAN_DI_TU_KEY="a6e8f78974f2581f2ca00485b40c948f",MAP_ZOOM={default:13,min:3,max:18,shipModelMin:13,shipTriggleMin:16,shipModelMax:18,scaleNum:.555},projection={data:"EPSG:4326",mercator:"EPSG:3857"},MAP_DEFAULT_CENTER=[114.84,30.52],CDN_URL="https://static.zhihaoscm.cn/",equatorialCircumference=2003750834e-2;var BASE_MAP_LINK=(t=>(t.vectorTile=`https://t0.tianditu.gov.cn/vec_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=vec&TILEMATRIXSET=w&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${TIAN_DI_TU_KEY}`,t.vectorTileMark=`https://t0.tianditu.gov.cn/cva_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cva&TILEMATRIXSET=w&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${TIAN_DI_TU_KEY}`,t.satelliteImgTile=`https://t0.tianditu.gov.cn/img_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&TILEMATRIXSET=w&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${TIAN_DI_TU_KEY}`,t.satelliteImgTileMark=`https://t0.tianditu.gov.cn/cia_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cia&TILEMATRIXSET=w&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${TIAN_DI_TU_KEY}`,t.greenTile=`${CDN_URL}/map/tile/{z}/{x}/{y}.png`,t))(BASE_MAP_LINK||{}),LENGTH_UNIT=(t=>(t[t.M=1]="M",t[t.KM=2]="KM",t[t.NM=3]="NM",t))(LENGTH_UNIT||{});const TileEventType={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"},tmpTileCoord=[0,0,0],DECIMALS=5;class TileGrid{constructor(e){this.minZoom=e.minZoom!==void 0?e.minZoom:0,this.resolutions_=e.resolutions,assert(isSorted(this.resolutions_,(i,g)=>g-i),"`resolutions` must be sorted in descending order");let n;if(!e.origins){for(let i=0,g=this.resolutions_.length-1;i<g;++i)if(!n)n=this.resolutions_[i]/this.resolutions_[i+1];else if(this.resolutions_[i]/this.resolutions_[i+1]!==n){n=void 0;break}}this.zoomFactor_=n,this.maxZoom=this.resolutions_.length-1,this.origin_=e.origin!==void 0?e.origin:null,this.origins_=null,e.origins!==void 0&&(this.origins_=e.origins,assert(this.origins_.length==this.resolutions_.length,"Number of `origins` and `resolutions` must be equal"));const r=e.extent;r!==void 0&&!this.origin_&&!this.origins_&&(this.origin_=getTopLeft(r)),assert(!this.origin_&&this.origins_||this.origin_&&!this.origins_,"Either `origin` or `origins` must be configured, never both"),this.tileSizes_=null,e.tileSizes!==void 0&&(this.tileSizes_=e.tileSizes,assert(this.tileSizes_.length==this.resolutions_.length,"Number of `tileSizes` and `resolutions` must be equal")),this.tileSize_=e.tileSize!==void 0?e.tileSize:this.tileSizes_?null:DEFAULT_TILE_SIZE,assert(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,"Either `tileSize` or `tileSizes` must be configured, never both"),this.extent_=r!==void 0?r:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],e.sizes!==void 0?this.fullTileRanges_=e.sizes.map((i,g)=>{const y=new TileRange(Math.min(0,i[0]),Math.max(i[0]-1,-1),Math.min(0,i[1]),Math.max(i[1]-1,-1));if(r){const k=this.getTileRangeForExtentAndZ(r,g);y.minX=Math.max(k.minX,y.minX),y.maxX=Math.min(k.maxX,y.maxX),y.minY=Math.max(k.minY,y.minY),y.maxY=Math.min(k.maxY,y.maxY)}return y}):r&&this.calculateTileRanges_(r)}forEachTileCoord(e,n,r){const i=this.getTileRangeForExtentAndZ(e,n);for(let g=i.minX,y=i.maxX;g<=y;++g)for(let k=i.minY,L=i.maxY;k<=L;++k)r([n,g,k])}forEachTileCoordParentTileRange(e,n,r,i){let g,y,k,L=null,$=e[0]-1;for(this.zoomFactor_===2?(y=e[1],k=e[2]):L=this.getTileCoordExtent(e,i);$>=this.minZoom;){if(y!==void 0&&k!==void 0?(y=Math.floor(y/2),k=Math.floor(k/2),g=createOrUpdate(y,y,k,k,r)):g=this.getTileRangeForExtentAndZ(L,$,r),n($,g))return!0;--$}return!1}getExtent(){return this.extent_}getMaxZoom(){return this.maxZoom}getMinZoom(){return this.minZoom}getOrigin(e){return this.origin_?this.origin_:this.origins_[e]}getResolution(e){return this.resolutions_[e]}getResolutions(){return this.resolutions_}getTileCoordChildTileRange(e,n,r){if(e[0]<this.maxZoom){if(this.zoomFactor_===2){const g=e[1]*2,y=e[2]*2;return createOrUpdate(g,g+1,y,y+1,n)}const i=this.getTileCoordExtent(e,r||this.tmpExtent_);return this.getTileRangeForExtentAndZ(i,e[0]+1,n)}return null}getTileRangeForTileCoordAndZ(e,n,r){if(n>this.maxZoom||n<this.minZoom)return null;const i=e[0],g=e[1],y=e[2];if(n===i)return createOrUpdate(g,y,g,y,r);if(this.zoomFactor_){const L=Math.pow(this.zoomFactor_,n-i),$=Math.floor(g*L),V=Math.floor(y*L);if(n<i)return createOrUpdate($,$,V,V,r);const z=Math.floor(L*(g+1))-1,re=Math.floor(L*(y+1))-1;return createOrUpdate($,z,V,re,r)}const k=this.getTileCoordExtent(e,this.tmpExtent_);return this.getTileRangeForExtentAndZ(k,n,r)}getTileRangeForExtentAndZ(e,n,r){this.getTileCoordForXYAndZ_(e[0],e[3],n,!1,tmpTileCoord);const i=tmpTileCoord[1],g=tmpTileCoord[2];this.getTileCoordForXYAndZ_(e[2],e[1],n,!0,tmpTileCoord);const y=tmpTileCoord[1],k=tmpTileCoord[2];return createOrUpdate(i,y,g,k,r)}getTileCoordCenter(e){const n=this.getOrigin(e[0]),r=this.getResolution(e[0]),i=toSize(this.getTileSize(e[0]),this.tmpSize_);return[n[0]+(e[1]+.5)*i[0]*r,n[1]-(e[2]+.5)*i[1]*r]}getTileCoordExtent(e,n){const r=this.getOrigin(e[0]),i=this.getResolution(e[0]),g=toSize(this.getTileSize(e[0]),this.tmpSize_),y=r[0]+e[1]*g[0]*i,k=r[1]-(e[2]+1)*g[1]*i,L=y+g[0]*i,$=k+g[1]*i;return createOrUpdate$2(y,k,L,$,n)}getTileCoordForCoordAndResolution(e,n,r){return this.getTileCoordForXYAndResolution_(e[0],e[1],n,!1,r)}getTileCoordForXYAndResolution_(e,n,r,i,g){const y=this.getZForResolution(r),k=r/this.getResolution(y),L=this.getOrigin(y),$=toSize(this.getTileSize(y),this.tmpSize_);let V=k*(e-L[0])/r/$[0],z=k*(L[1]-n)/r/$[1];return i?(V=ceil(V,DECIMALS)-1,z=ceil(z,DECIMALS)-1):(V=floor(V,DECIMALS),z=floor(z,DECIMALS)),createOrUpdate$1(y,V,z,g)}getTileCoordForXYAndZ_(e,n,r,i,g){const y=this.getOrigin(r),k=this.getResolution(r),L=toSize(this.getTileSize(r),this.tmpSize_);let $=(e-y[0])/k/L[0],V=(y[1]-n)/k/L[1];return i?($=ceil($,DECIMALS)-1,V=ceil(V,DECIMALS)-1):($=floor($,DECIMALS),V=floor(V,DECIMALS)),createOrUpdate$1(r,$,V,g)}getTileCoordForCoordAndZ(e,n,r){return this.getTileCoordForXYAndZ_(e[0],e[1],n,!1,r)}getTileCoordResolution(e){return this.resolutions_[e[0]]}getTileSize(e){return this.tileSize_?this.tileSize_:this.tileSizes_[e]}getFullTileRange(e){return this.fullTileRanges_?this.fullTileRanges_[e]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,e):null}getZForResolution(e,n){const r=linearFindNearest(this.resolutions_,e,n||0);return clamp(r,this.minZoom,this.maxZoom)}tileCoordIntersectsViewport(e,n){return intersectsLinearRing(n,0,n.length,2,this.getTileCoordExtent(e))}calculateTileRanges_(e){const n=this.resolutions_.length,r=new Array(n);for(let i=this.minZoom;i<n;++i)r[i]=this.getTileRangeForExtentAndZ(e,i);this.fullTileRanges_=r}}function getForProjection(t){let e=t.getDefaultTileGrid();return e||(e=createForProjection(t),t.setDefaultTileGrid(e)),e}function wrapX(t,e,n){const r=e[0],i=t.getTileCoordCenter(e),g=extentFromProjection(n);if(!containsCoordinate(g,i)){const y=getWidth(g),k=Math.ceil((g[0]-i[0])/y);return i[0]+=y*k,t.getTileCoordForCoordAndZ(i,r)}return e}function createForExtent(t,e,n,r){r=r!==void 0?r:"top-left";const i=resolutionsFromExtent(t,e,n);return new TileGrid({extent:t,origin:getCorner(t,r),resolutions:i,tileSize:n})}function createXYZ(t){const e=t||{},n=e.extent||get$1("EPSG:3857").getExtent(),r={extent:n,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:resolutionsFromExtent(n,e.maxZoom,e.tileSize,e.maxResolution)};return new TileGrid(r)}function resolutionsFromExtent(t,e,n,r){e=e!==void 0?e:DEFAULT_MAX_ZOOM,n=toSize(n!==void 0?n:DEFAULT_TILE_SIZE);const i=getHeight(t),g=getWidth(t);r=r>0?r:Math.max(g/n[0],i/n[1]);const y=e+1,k=new Array(y);for(let L=0;L<y;++L)k[L]=r/Math.pow(2,L);return k}function createForProjection(t,e,n,r){const i=extentFromProjection(t);return createForExtent(i,e,n,r)}function extentFromProjection(t){t=get$1(t);let e=t.getExtent();if(!e){const n=180*METERS_PER_UNIT$1.degrees/t.getMetersPerUnit();e=createOrUpdate$2(-n,-n,n,n)}return e}class TileSource extends Source{constructor(e){super({attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX,interpolate:e.interpolate}),this.on,this.once,this.un,this.tilePixelRatio_=e.tilePixelRatio!==void 0?e.tilePixelRatio:1,this.tileGrid=e.tileGrid!==void 0?e.tileGrid:null;const n=[256,256];this.tileGrid&&toSize(this.tileGrid.getTileSize(this.tileGrid.getMinZoom()),n),this.tmpSize=[0,0],this.key_=e.key||getUid(this),this.tileOptions={transition:e.transition,interpolate:e.interpolate},this.zDirection=e.zDirection?e.zDirection:0}getGutterForProjection(e){return 0}getKey(){return this.key_}setKey(e){this.key_!==e&&(this.key_=e,this.changed())}getResolutions(e){const n=e?this.getTileGridForProjection(e):this.tileGrid;return n?n.getResolutions():null}getTile(e,n,r,i,g){return abstract()}getTileGrid(){return this.tileGrid}getTileGridForProjection(e){return this.tileGrid?this.tileGrid:getForProjection(e)}getTilePixelRatio(e){return this.tilePixelRatio_}getTilePixelSize(e,n,r){const i=this.getTileGridForProjection(r),g=this.getTilePixelRatio(n),y=toSize(i.getTileSize(e),this.tmpSize);return g==1?y:scale$1(y,g,this.tmpSize)}getTileCoordForTileUrlFunction(e,n){const r=n!==void 0?n:this.getProjection(),i=n!==void 0?this.getTileGridForProjection(r):this.tileGrid||this.getTileGridForProjection(r);return this.getWrapX()&&r.isGlobal()&&(e=wrapX(i,e,r)),withinExtentAndZ(e,i)?e:null}clear(){}refresh(){this.clear(),super.refresh()}}class TileSourceEvent extends BaseEvent{constructor(e,n){super(e),this.tile=n}}const zRegEx=/\{z\}/g,xRegEx=/\{x\}/g,yRegEx=/\{y\}/g,dashYRegEx=/\{-y\}/g;function renderXYZTemplate(t,e,n,r,i){return t.replace(zRegEx,e.toString()).replace(xRegEx,n.toString()).replace(yRegEx,r.toString()).replace(dashYRegEx,function(){if(i===void 0)throw new Error("If the URL template has a {-y} placeholder, the grid extent must be known");return(i-r).toString()})}function expandUrl(t){const e=[];let n=/\{([a-z])-([a-z])\}/.exec(t);if(n){const r=n[1].charCodeAt(0),i=n[2].charCodeAt(0);let g;for(g=r;g<=i;++g)e.push(t.replace(n[0],String.fromCharCode(g)));return e}if(n=/\{(\d+)-(\d+)\}/.exec(t),n){const r=parseInt(n[2],10);for(let i=parseInt(n[1],10);i<=r;i++)e.push(t.replace(n[0],i.toString()));return e}return e.push(t),e}function createFromTemplate(t,e){return function(n,r,i){if(!n)return;let g;const y=n[0];if(e){const k=e.getFullTileRange(y);k&&(g=k.getHeight()-1)}return renderXYZTemplate(t,y,n[1],n[2],g)}}function createFromTemplates(t,e){const n=t.length,r=new Array(n);for(let i=0;i<n;++i)r[i]=createFromTemplate(t[i],e);return createFromTileUrlFunctions(r)}function createFromTileUrlFunctions(t){return t.length===1?t[0]:function(e,n,r){if(!e)return;const i=hash(e),g=modulo(i,t.length);return t[g](e,n,r)}}class UrlTile extends TileSource{constructor(e){super({attributions:e.attributions,cacheSize:e.cacheSize,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tilePixelRatio:e.tilePixelRatio,wrapX:e.wrapX,transition:e.transition,interpolate:e.interpolate,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.generateTileUrlFunction_=this.tileUrlFunction===UrlTile.prototype.tileUrlFunction,this.tileLoadFunction=e.tileLoadFunction,e.tileUrlFunction&&(this.tileUrlFunction=e.tileUrlFunction),this.urls=null,e.urls?this.setUrls(e.urls):e.url&&this.setUrl(e.url),this.tileLoadingKeys_={}}getTileLoadFunction(){return this.tileLoadFunction}getTileUrlFunction(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction}getUrls(){return this.urls}handleTileChange(e){const n=e.target,r=getUid(n),i=n.getState();let g;i==TileState.LOADING?(this.tileLoadingKeys_[r]=!0,g=TileEventType.TILELOADSTART):r in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[r],g=i==TileState.ERROR?TileEventType.TILELOADERROR:i==TileState.LOADED?TileEventType.TILELOADEND:void 0),g!=null&&this.dispatchEvent(new TileSourceEvent(g,n))}setTileLoadFunction(e){this.tileLoadFunction=e,this.changed()}setTileUrlFunction(e,n){this.tileUrlFunction=e,typeof n<"u"?this.setKey(n):this.changed()}setUrl(e){const n=expandUrl(e);this.urls=n,this.setUrls(n)}setUrls(e){this.urls=e;const n=e.join(`
134
- `);this.generateTileUrlFunction_?this.setTileUrlFunction(createFromTemplates(e,this.tileGrid),n):this.setKey(n)}tileUrlFunction(e,n,r){}}class TileImage extends UrlTile{constructor(e){super({attributions:e.attributions,cacheSize:e.cacheSize,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:defaultTileLoadFunction,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,interpolate:e.interpolate!==void 0?e.interpolate:!0,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.crossOrigin=e.crossOrigin!==void 0?e.crossOrigin:null,this.tileClass=e.tileClass!==void 0?e.tileClass:ImageTile,this.tileGridForProjection={},this.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}getGutterForProjection(e){return this.getProjection()&&e&&!equivalent(this.getProjection(),e)?0:this.getGutter()}getGutter(){return 0}getKey(){let e=super.getKey();return this.getInterpolate()||(e+=":disable-interpolation"),e}getTileGridForProjection(e){const n=this.getProjection();if(this.tileGrid&&(!n||equivalent(n,e)))return this.tileGrid;const r=getUid(e);return r in this.tileGridForProjection||(this.tileGridForProjection[r]=getForProjection(e)),this.tileGridForProjection[r]}createTile_(e,n,r,i,g,y){const k=[e,n,r],L=this.getTileCoordForTileUrlFunction(k,g),$=L?this.tileUrlFunction(L,i,g):void 0,V=new this.tileClass(k,$!==void 0?TileState.IDLE:TileState.EMPTY,$!==void 0?$:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return V.key=y,V.addEventListener(EventType.CHANGE,this.handleTileChange.bind(this)),V}getTile(e,n,r,i,g){const y=this.getProjection();if(!y||!g||equivalent(y,g))return this.getTileInternal(e,n,r,i,y||g);const k=[e,n,r],L=this.getKey(),$=this.getTileGridForProjection(y),V=this.getTileGridForProjection(g),z=this.getTileCoordForTileUrlFunction(k,g),re=new ReprojTile(y,$,g,V,k,z,this.getTilePixelRatio(i),this.getGutter(),(oe,j,ie,ae)=>this.getTileInternal(oe,j,ie,ae,y),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);return re.key=L,re}getTileInternal(e,n,r,i,g){const y=this.getKey();return this.createTile_(e,n,r,i,g,y)}setRenderReprojectionEdges(e){this.renderReprojectionEdges_!=e&&(this.renderReprojectionEdges_=e,this.changed())}setTileGridForProjection(e,n){const r=get$1(e);if(r){const i=getUid(r);i in this.tileGridForProjection||(this.tileGridForProjection[i]=n)}}}function defaultTileLoadFunction(t,e){t.getImage().src=e}class XYZ extends TileImage{constructor(e){e=e||{};const n=e.projection!==void 0?e.projection:"EPSG:3857",r=e.tileGrid!==void 0?e.tileGrid:createXYZ({extent:extentFromProjection(n),maxResolution:e.maxResolution,maxZoom:e.maxZoom,minZoom:e.minZoom,tileSize:e.tileSize});super({attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,interpolate:e.interpolate,projection:n,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileGrid:r,tileLoadFunction:e.tileLoadFunction,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX!==void 0?e.wrapX:!0,transition:e.transition,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.gutter_=e.gutter!==void 0?e.gutter:0}getGutter(){return this.gutter_}}class FeatureFormat{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.featureClass=Feature,this.supportedMediaTypes=null}getReadOptions(e,n){if(n){let r=n.dataProjection?get$1(n.dataProjection):this.readProjection(e);n.extent&&r&&r.getUnits()==="tile-pixels"&&(r=get$1(r),r.setWorldExtent(n.extent)),n={dataProjection:r,featureProjection:n.featureProjection}}return this.adaptOptions(n)}adaptOptions(e){return Object.assign({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection,featureClass:this.featureClass},e)}getType(){return abstract()}readFeature(e,n){return abstract()}readFeatures(e,n){return abstract()}readGeometry(e,n){return abstract()}readProjection(e){return abstract()}writeFeature(e,n){return abstract()}writeFeatures(e,n){return abstract()}writeGeometry(e,n){return abstract()}}function transformGeometryWithOptions(t,e,n){const r=n?get$1(n.featureProjection):null,i=n?get$1(n.dataProjection):null;let g=t;if(r&&i&&!equivalent(r,i)){e&&(g=t.clone());const y=e?r:i,k=e?i:r;y.getUnits()==="tile-pixels"?g.transform(y,k):g.applyTransform(getTransform(y,k))}if(e&&n&&n.decimals!==void 0){const y=Math.pow(10,n.decimals),k=function(L){for(let $=0,V=L.length;$<V;++$)L[$]=Math.round(L[$]*y)/y;return L};g===t&&(g=t.clone()),g.applyTransform(k)}return g}class TextFeature extends FeatureFormat{constructor(){super()}getType(){return"text"}readFeature(e,n){return this.readFeatureFromText(getText(e),this.adaptOptions(n))}readFeatureFromText(e,n){return abstract()}readFeatures(e,n){return this.readFeaturesFromText(getText(e),this.adaptOptions(n))}readFeaturesFromText(e,n){return abstract()}readGeometry(e,n){return this.readGeometryFromText(getText(e),this.adaptOptions(n))}readGeometryFromText(e,n){return abstract()}readProjection(e){return this.readProjectionFromText(getText(e))}readProjectionFromText(e){return this.dataProjection}writeFeature(e,n){return this.writeFeatureText(e,this.adaptOptions(n))}writeFeatureText(e,n){return abstract()}writeFeatures(e,n){return this.writeFeaturesText(e,this.adaptOptions(n))}writeFeaturesText(e,n){return abstract()}writeGeometry(e,n){return this.writeGeometryText(e,this.adaptOptions(n))}writeGeometryText(e,n){return abstract()}}function getText(t){return typeof t=="string"?t:""}function flipXY(t,e,n,r,i,g){i!==void 0?(i=i,g=g!==void 0?g:0):(i=[],g=0);let y=e;for(;y<n;){const k=t[y++];i[g++]=t[y++],i[g++]=k;for(let L=2;L<r;++L)i[g++]=t[y++]}return i.length=g,i}class Polyline extends TextFeature{constructor(e){super(),e=e||{},this.dataProjection=get$1("EPSG:4326"),this.factor_=e.factor?e.factor:1e5,this.geometryLayout_=e.geometryLayout?e.geometryLayout:"XY"}readFeatureFromText(e,n){const r=this.readGeometryFromText(e,n);return new Feature(r)}readFeaturesFromText(e,n){return[this.readFeatureFromText(e,n)]}readGeometryFromText(e,n){const r=getStrideForLayout(this.geometryLayout_),i=decodeDeltas(e,r,this.factor_);flipXY(i,0,i.length,r,i);const g=inflateCoordinates(i,0,i.length,r),y=new LineString(g,this.geometryLayout_);return transformGeometryWithOptions(y,!1,this.adaptOptions(n))}writeFeatureText(e,n){const r=e.getGeometry();if(r)return this.writeGeometryText(r,n);throw new Error("Expected `feature` to have a geometry")}writeFeaturesText(e,n){return this.writeFeatureText(e[0],n)}writeGeometryText(e,n){e=transformGeometryWithOptions(e,!0,this.adaptOptions(n));const r=e.getFlatCoordinates(),i=e.getStride();return flipXY(r,0,r.length,i,r),encodeDeltas(r,i,this.factor_)}}function encodeDeltas(t,e,n){n=n||1e5;let r;const i=new Array(e);for(r=0;r<e;++r)i[r]=0;for(let g=0,y=t.length;g<y;)for(r=0;r<e;++r,++g){const k=t[g],L=k-i[r];i[r]=k,t[g]=L}return encodeFloats(t,n)}function decodeDeltas(t,e,n){n=n||1e5;let r;const i=new Array(e);for(r=0;r<e;++r)i[r]=0;const g=decodeFloats(t,n);for(let y=0,k=g.length;y<k;)for(r=0;r<e;++r,++y)i[r]+=g[y],g[y]=i[r];return g}function encodeFloats(t,e){e=e||1e5;for(let n=0,r=t.length;n<r;++n)t[n]=Math.round(t[n]*e);return encodeSignedIntegers(t)}function decodeFloats(t,e){e=e||1e5;const n=decodeSignedIntegers(t);for(let r=0,i=n.length;r<i;++r)n[r]/=e;return n}function encodeSignedIntegers(t){for(let e=0,n=t.length;e<n;++e){const r=t[e];t[e]=r<0?~(r<<1):r<<1}return encodeUnsignedIntegers(t)}function decodeSignedIntegers(t){const e=decodeUnsignedIntegers(t);for(let n=0,r=e.length;n<r;++n){const i=e[n];e[n]=i&1?~(i>>1):i>>1}return e}function encodeUnsignedIntegers(t){let e="";for(let n=0,r=t.length;n<r;++n)e+=encodeUnsignedInteger(t[n]);return e}function decodeUnsignedIntegers(t){const e=[];let n=0,r=0;for(let i=0,g=t.length;i<g;++i){const y=t.charCodeAt(i)-63;n|=(y&31)<<r,y<32?(e.push(n),n=0,r=0):r+=5}return e}function encodeUnsignedInteger(t){let e,n="";for(;t>=32;)e=(32|t&31)+63,n+=String.fromCharCode(e),t>>=5;return e=t+63,n+=String.fromCharCode(e),n}var SHIP_SAIL_STATUS=(t=>(t[t.发动机使用中=0]="发动机使用中",t[t.锚泊=1]="锚泊",t[t.未操作=2]="未操作",t[t.操纵能力受限=3]="操纵能力受限",t[t.吃水受限=4]="吃水受限",t[t.系泊=5]="系泊",t[t.搁浅=6]="搁浅",t[t.从事捕捞=7]="从事捕捞",t[t.航行中=8]="航行中",t[t.留作将来修正导航状态=9]="留作将来修正导航状态",t[t.高速船留用=10]="高速船留用",t[t.机动船尾推作业=11]="机动船尾推作业",t[t.机动船顶推或侧推作业=12]="机动船顶推或侧推作业",t[t.飞翼船留用=13]="飞翼船留用",t[t.现行的=14]="现行的",t[t.未定义=15]="未定义",t))(SHIP_SAIL_STATUS||{}),SHIP_DIRECT=(t=>(t.left="left",t.right="right",t.front="front",t.up="up",t.down="down",t.back="back",t))(SHIP_DIRECT||{});const convertSixHundredThousandToLatLng=function(t,e){const n=Number(e)/6e5;return[Number(t)/6e5,n]},calculateCirclePoints=(t,e)=>{const n=fromLonLat(t),r=e*1e3,i=[n[0]-r,n[1]-r,n[0]+r,n[1]+r],g=transformExtent(i,projection.mercator,projection.data);return{leftTopPoint:{lng:g[0],lat:g[3]},rightTopPoint:{lng:g[2],lat:g[3]},rightBottomPoint:{lng:g[2],lat:g[1]},leftBottomPoint:{lng:g[0],lat:g[1]}}},formatLength=function(t,e){const r=getLength(t);let i="";switch(console.log(e,LENGTH_UNIT),e){case LENGTH_UNIT.M:i=Math.round(r*100)/100+" m";break;case LENGTH_UNIT.KM:i=Math.round(r/1e3*100)/100+" km";break;case LENGTH_UNIT.NM:i=(Math.round(r/1e3*100)/100/1.852).toFixed(2)+" nm";break}return i};function lonLatToMercator(t){const e=t[0]*equatorialCircumference/180;let n=Math.log(Math.tan((90+t[1])*Math.PI/360))/(Math.PI/180);return n=n*equatorialCircumference/180,[e,n]}function getIconFont(unicode=""){return unicode.indexOf("&amp;")!==-1&&(unicode=unicode.replace("&amp;","&")),unicode.indexOf("&amp")!==-1&&(unicode=unicode.replace("&amp","&")),eval('("'+unicode.replace("&#x","\\u").replace(";","")+'")')}const getIconStyle=t=>{const e=new Text({font:"Normal 14px map-iconfont",text:getIconFont(t),fill:new Fill({color:"#fff"}),offsetY:-14});return new Style({text:e,zIndex:100})},mercatorToLonLat=(t,e="lonlat")=>{const n={lon:0,lat:0},r=t[0]/equatorialCircumference*180;let i=t[1]/equatorialCircumference*180;return i=180/Math.PI*(2*Math.atan(Math.exp(i*Math.PI/180))-Math.PI/2),n.lon=r,n.lat=i,e==="lonlat"?n:[r,i]},formatMinutesToDDHHMM=t=>{const e=hooks.duration(t,"minutes"),n=Math.floor(e.asDays()),r=e.hours(),i=e.minutes();let g=`${String(i).padStart(2,"0")}分`;return r!==0&&(g=`${String(r).padStart(2,"0")}时${g}`),n!==0&&(g=`${String(n).padStart(2,"0")}天${g}`),g},trackLayers=new Map,allTracks={};let activeTrackId=null;const DEFAULT_VALUE="--";let moveFeatureHandler=null;const popupEle=document.createElement("div"),popupOverlay=new Overlay({element:popupEle,positioning:"top-left",stopEvent:!1,className:"track-label-popup"});let polyline,linePath,startMarker,position$1,geoMarker,trackAnimating=!1,lastTime=Date.now(),vectorLayer$4,distance=0,routeFeature=null,thresholdNum=20;const MAX_CACHED_LAYERS=5,usedIds=[],manageLayerCache=t=>{var n;const e=getInstall();for(usedIds.unshift(t);usedIds.length>MAX_CACHED_LAYERS;){const r=usedIds.pop(),i=trackLayers.get(r);i&&((n=i.getSource())==null||n.clear(),e==null||e.removeLayer(i),trackLayers.delete(r),delete allTracks[r])}};let trackColor="";const colors=["#ff0000","#00ff00","#0079ff","#ffa500","#800080","#008080","#ffc0cb","#800000","#000080","#808000"],reRenderTrackLine=()=>{var t;activeTrackId&&((t=trackLayers.get(activeTrackId))!=null&&t.getVisible())&&debounce(()=>{handlerRenderLine()},300)},preprocessTrackData=(t,e)=>{let n=[];return n=e.map((r,i)=>{if(Number(r.lon)>180||Number(r.lat)>180){const[g,y]=convertSixHundredThousandToLatLng(r.lon,r.lat);r.lon=g,r.lat=y}return r.center=[r.lon,r.lat],r.centerPoint=lonLatToMercator(r.center),r.time=hooks(r.createdAt).format("YYYY-MM-DD HH:mm:ss"),r.id=t,r.index=i,r.bounds=[],r}),n},renderTrackLine=async(t,e,n,r="ship",i=200)=>{const g=getInstall();if(!g||(e=e==null?void 0:e.reverse(),popupOverlay&&r==="ship"&&(g!=null&&g.getOverlays().getArray().includes(popupOverlay)||g.addOverlay(popupOverlay)),(e==null?void 0:e.length)<2))return;manageLayerCache(t),activeTrackId=t,allTracks[t]=e;const y=Object.keys(allTracks).findIndex(k=>k===t)||0;trackColor=n||colors[y>10?10:y],thresholdNum=i,await handlerRenderLine(),await setTrackViewCenter(activeTrackId)},createTrackLayer=t=>{const e=new VectorSource;return new VectorLayer({source:e,visible:!1,className:`track-layer-${t}`,renderBuffer:1024})},setActiveLayer=t=>{const e=getInstall();trackLayers.forEach((n,r)=>{var g;const i=r===t;n.getVisible()!==i&&(n.setVisible(i),e.getLayers().getArray().includes(n)||e.addLayer(n),i||(g=n.getSource())==null||g.clear())}),activeTrackId=t},handlerRenderLine=async()=>{const t=activeTrackId;if(!trackLayers.has(t)){const L=createTrackLayer(t);trackLayers.set(t,L)}setActiveLayer(t);const e=trackLayers.get(t).getSource();e==null||e.clear();const n=trackColor||"",r=allTracks[t]||[];if(!(r&&r.length>1))return[];const i=Math.max(1,Math.floor(r.length/thresholdNum)),g=r.filter((L,$)=>$%i===0);let y=[];y=preprocessTrackData(t,g);const k=y.map(L=>L.centerPoint);console.log("processedList",y.length),removeAllLabel(),y.length>=2&&(await createTrackLineFeature(t,k,n),await createPointFeature(t,y,n))},createTrackLineFeature=(t,e,n)=>{const r=new LineString(e),i=trackLayers.get(t).getSource(),g=i.getFeatureById(t);if(g)g.setGeometry(r),g.setId(t),g.setStyle(createTrackLineStyle(n)),routeFeature=g;else{const y=new Feature({geometry:r});y.setId(t),y.set("type","line"),y.setStyle(createTrackLineStyle(n)),i.addFeature(y),routeFeature=y}return routeFeature},createTrackLineStyle=t=>new Style({stroke:new Stroke({color:t,width:2})}),handleTrackMapEvent=(t,e,n)=>{const r=t==null?void 0:t.get("trackId"),i=getInstall();if(t&&r&&e==="hover"){i.getTargetElement().style.cursor=r?"pointer":"";const g=t.get("data"),y=renderTrackPointHtml(g),k=n==null?void 0:n.coordinate;k&&(popupEle.querySelector(".popup-content"),popupEle.innerHTML=y,popupOverlay==null||popupOverlay.setPosition(k))}else popupOverlay&&popupOverlay.setPosition(void 0)},renderTrackPointHtml=t=>{if(!(t!=null&&t.time))return;let e="";return t!=null&&t.stayTime&&(e=`
134
+ `);this.generateTileUrlFunction_?this.setTileUrlFunction(createFromTemplates(e,this.tileGrid),n):this.setKey(n)}tileUrlFunction(e,n,r){}}class TileImage extends UrlTile{constructor(e){super({attributions:e.attributions,cacheSize:e.cacheSize,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:defaultTileLoadFunction,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,interpolate:e.interpolate!==void 0?e.interpolate:!0,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.crossOrigin=e.crossOrigin!==void 0?e.crossOrigin:null,this.tileClass=e.tileClass!==void 0?e.tileClass:ImageTile,this.tileGridForProjection={},this.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}getGutterForProjection(e){return this.getProjection()&&e&&!equivalent(this.getProjection(),e)?0:this.getGutter()}getGutter(){return 0}getKey(){let e=super.getKey();return this.getInterpolate()||(e+=":disable-interpolation"),e}getTileGridForProjection(e){const n=this.getProjection();if(this.tileGrid&&(!n||equivalent(n,e)))return this.tileGrid;const r=getUid(e);return r in this.tileGridForProjection||(this.tileGridForProjection[r]=getForProjection(e)),this.tileGridForProjection[r]}createTile_(e,n,r,i,g,y){const k=[e,n,r],L=this.getTileCoordForTileUrlFunction(k,g),$=L?this.tileUrlFunction(L,i,g):void 0,V=new this.tileClass(k,$!==void 0?TileState.IDLE:TileState.EMPTY,$!==void 0?$:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return V.key=y,V.addEventListener(EventType.CHANGE,this.handleTileChange.bind(this)),V}getTile(e,n,r,i,g){const y=this.getProjection();if(!y||!g||equivalent(y,g))return this.getTileInternal(e,n,r,i,y||g);const k=[e,n,r],L=this.getKey(),$=this.getTileGridForProjection(y),V=this.getTileGridForProjection(g),z=this.getTileCoordForTileUrlFunction(k,g),re=new ReprojTile(y,$,g,V,k,z,this.getTilePixelRatio(i),this.getGutter(),(oe,j,ie,ae)=>this.getTileInternal(oe,j,ie,ae,y),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);return re.key=L,re}getTileInternal(e,n,r,i,g){const y=this.getKey();return this.createTile_(e,n,r,i,g,y)}setRenderReprojectionEdges(e){this.renderReprojectionEdges_!=e&&(this.renderReprojectionEdges_=e,this.changed())}setTileGridForProjection(e,n){const r=get$1(e);if(r){const i=getUid(r);i in this.tileGridForProjection||(this.tileGridForProjection[i]=n)}}}function defaultTileLoadFunction(t,e){t.getImage().src=e}class XYZ extends TileImage{constructor(e){e=e||{};const n=e.projection!==void 0?e.projection:"EPSG:3857",r=e.tileGrid!==void 0?e.tileGrid:createXYZ({extent:extentFromProjection(n),maxResolution:e.maxResolution,maxZoom:e.maxZoom,minZoom:e.minZoom,tileSize:e.tileSize});super({attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,interpolate:e.interpolate,projection:n,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileGrid:r,tileLoadFunction:e.tileLoadFunction,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX!==void 0?e.wrapX:!0,transition:e.transition,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.gutter_=e.gutter!==void 0?e.gutter:0}getGutter(){return this.gutter_}}class FeatureFormat{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.featureClass=Feature,this.supportedMediaTypes=null}getReadOptions(e,n){if(n){let r=n.dataProjection?get$1(n.dataProjection):this.readProjection(e);n.extent&&r&&r.getUnits()==="tile-pixels"&&(r=get$1(r),r.setWorldExtent(n.extent)),n={dataProjection:r,featureProjection:n.featureProjection}}return this.adaptOptions(n)}adaptOptions(e){return Object.assign({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection,featureClass:this.featureClass},e)}getType(){return abstract()}readFeature(e,n){return abstract()}readFeatures(e,n){return abstract()}readGeometry(e,n){return abstract()}readProjection(e){return abstract()}writeFeature(e,n){return abstract()}writeFeatures(e,n){return abstract()}writeGeometry(e,n){return abstract()}}function transformGeometryWithOptions(t,e,n){const r=n?get$1(n.featureProjection):null,i=n?get$1(n.dataProjection):null;let g=t;if(r&&i&&!equivalent(r,i)){e&&(g=t.clone());const y=e?r:i,k=e?i:r;y.getUnits()==="tile-pixels"?g.transform(y,k):g.applyTransform(getTransform(y,k))}if(e&&n&&n.decimals!==void 0){const y=Math.pow(10,n.decimals),k=function(L){for(let $=0,V=L.length;$<V;++$)L[$]=Math.round(L[$]*y)/y;return L};g===t&&(g=t.clone()),g.applyTransform(k)}return g}class TextFeature extends FeatureFormat{constructor(){super()}getType(){return"text"}readFeature(e,n){return this.readFeatureFromText(getText(e),this.adaptOptions(n))}readFeatureFromText(e,n){return abstract()}readFeatures(e,n){return this.readFeaturesFromText(getText(e),this.adaptOptions(n))}readFeaturesFromText(e,n){return abstract()}readGeometry(e,n){return this.readGeometryFromText(getText(e),this.adaptOptions(n))}readGeometryFromText(e,n){return abstract()}readProjection(e){return this.readProjectionFromText(getText(e))}readProjectionFromText(e){return this.dataProjection}writeFeature(e,n){return this.writeFeatureText(e,this.adaptOptions(n))}writeFeatureText(e,n){return abstract()}writeFeatures(e,n){return this.writeFeaturesText(e,this.adaptOptions(n))}writeFeaturesText(e,n){return abstract()}writeGeometry(e,n){return this.writeGeometryText(e,this.adaptOptions(n))}writeGeometryText(e,n){return abstract()}}function getText(t){return typeof t=="string"?t:""}function flipXY(t,e,n,r,i,g){i!==void 0?(i=i,g=g!==void 0?g:0):(i=[],g=0);let y=e;for(;y<n;){const k=t[y++];i[g++]=t[y++],i[g++]=k;for(let L=2;L<r;++L)i[g++]=t[y++]}return i.length=g,i}class Polyline extends TextFeature{constructor(e){super(),e=e||{},this.dataProjection=get$1("EPSG:4326"),this.factor_=e.factor?e.factor:1e5,this.geometryLayout_=e.geometryLayout?e.geometryLayout:"XY"}readFeatureFromText(e,n){const r=this.readGeometryFromText(e,n);return new Feature(r)}readFeaturesFromText(e,n){return[this.readFeatureFromText(e,n)]}readGeometryFromText(e,n){const r=getStrideForLayout(this.geometryLayout_),i=decodeDeltas(e,r,this.factor_);flipXY(i,0,i.length,r,i);const g=inflateCoordinates(i,0,i.length,r),y=new LineString(g,this.geometryLayout_);return transformGeometryWithOptions(y,!1,this.adaptOptions(n))}writeFeatureText(e,n){const r=e.getGeometry();if(r)return this.writeGeometryText(r,n);throw new Error("Expected `feature` to have a geometry")}writeFeaturesText(e,n){return this.writeFeatureText(e[0],n)}writeGeometryText(e,n){e=transformGeometryWithOptions(e,!0,this.adaptOptions(n));const r=e.getFlatCoordinates(),i=e.getStride();return flipXY(r,0,r.length,i,r),encodeDeltas(r,i,this.factor_)}}function encodeDeltas(t,e,n){n=n||1e5;let r;const i=new Array(e);for(r=0;r<e;++r)i[r]=0;for(let g=0,y=t.length;g<y;)for(r=0;r<e;++r,++g){const k=t[g],L=k-i[r];i[r]=k,t[g]=L}return encodeFloats(t,n)}function decodeDeltas(t,e,n){n=n||1e5;let r;const i=new Array(e);for(r=0;r<e;++r)i[r]=0;const g=decodeFloats(t,n);for(let y=0,k=g.length;y<k;)for(r=0;r<e;++r,++y)i[r]+=g[y],g[y]=i[r];return g}function encodeFloats(t,e){e=e||1e5;for(let n=0,r=t.length;n<r;++n)t[n]=Math.round(t[n]*e);return encodeSignedIntegers(t)}function decodeFloats(t,e){e=e||1e5;const n=decodeSignedIntegers(t);for(let r=0,i=n.length;r<i;++r)n[r]/=e;return n}function encodeSignedIntegers(t){for(let e=0,n=t.length;e<n;++e){const r=t[e];t[e]=r<0?~(r<<1):r<<1}return encodeUnsignedIntegers(t)}function decodeSignedIntegers(t){const e=decodeUnsignedIntegers(t);for(let n=0,r=e.length;n<r;++n){const i=e[n];e[n]=i&1?~(i>>1):i>>1}return e}function encodeUnsignedIntegers(t){let e="";for(let n=0,r=t.length;n<r;++n)e+=encodeUnsignedInteger(t[n]);return e}function decodeUnsignedIntegers(t){const e=[];let n=0,r=0;for(let i=0,g=t.length;i<g;++i){const y=t.charCodeAt(i)-63;n|=(y&31)<<r,y<32?(e.push(n),n=0,r=0):r+=5}return e}function encodeUnsignedInteger(t){let e,n="";for(;t>=32;)e=(32|t&31)+63,n+=String.fromCharCode(e),t>>=5;return e=t+63,n+=String.fromCharCode(e),n}var SHIP_SAIL_STATUS=(t=>(t[t.发动机使用中=0]="发动机使用中",t[t.锚泊=1]="锚泊",t[t.未操作=2]="未操作",t[t.操纵能力受限=3]="操纵能力受限",t[t.吃水受限=4]="吃水受限",t[t.系泊=5]="系泊",t[t.搁浅=6]="搁浅",t[t.从事捕捞=7]="从事捕捞",t[t.航行中=8]="航行中",t[t.留作将来修正导航状态=9]="留作将来修正导航状态",t[t.高速船留用=10]="高速船留用",t[t.机动船尾推作业=11]="机动船尾推作业",t[t.机动船顶推或侧推作业=12]="机动船顶推或侧推作业",t[t.飞翼船留用=13]="飞翼船留用",t[t.现行的=14]="现行的",t[t.未定义=15]="未定义",t))(SHIP_SAIL_STATUS||{}),SHIP_DIRECT=(t=>(t.left="left",t.right="right",t.front="front",t.up="up",t.down="down",t.back="back",t))(SHIP_DIRECT||{});const convertSixHundredThousandToLatLng=function(t,e){const n=Number(e)/6e5;return[Number(t)/6e5,n]},calculateCirclePoints=(t,e)=>{const n=fromLonLat(t),r=e*1e3,i=[n[0]-r,n[1]-r,n[0]+r,n[1]+r],g=transformExtent(i,projection.mercator,projection.data);return{leftTopPoint:{lng:g[0],lat:g[3]},rightTopPoint:{lng:g[2],lat:g[3]},rightBottomPoint:{lng:g[2],lat:g[1]},leftBottomPoint:{lng:g[0],lat:g[1]}}},formatLength=function(t,e){const r=getLength(t);let i="";switch(console.log(e,LENGTH_UNIT),e){case LENGTH_UNIT.M:i=Math.round(r*100)/100+" m";break;case LENGTH_UNIT.KM:i=Math.round(r/1e3*100)/100+" km";break;case LENGTH_UNIT.NM:i=(Math.round(r/1e3*100)/100/1.852).toFixed(2)+" nm";break}return i};function lonLatToMercator(t){const e=t[0]*equatorialCircumference/180;let n=Math.log(Math.tan((90+t[1])*Math.PI/360))/(Math.PI/180);return n=n*equatorialCircumference/180,[e,n]}function getIconFont(unicode=""){return unicode.indexOf("&amp;")!==-1&&(unicode=unicode.replace("&amp;","&")),unicode.indexOf("&amp")!==-1&&(unicode=unicode.replace("&amp","&")),eval('("'+unicode.replace("&#x","\\u").replace(";","")+'")')}const getIconStyle=t=>{const e=new Text({font:"Normal 14px map-iconfont",text:getIconFont(t),fill:new Fill({color:"#fff"}),offsetY:-14});return new Style({text:e,zIndex:100})},mercatorToLonLat=(t,e="lonlat")=>{const n={lon:0,lat:0},r=t[0]/equatorialCircumference*180;let i=t[1]/equatorialCircumference*180;return i=180/Math.PI*(2*Math.atan(Math.exp(i*Math.PI/180))-Math.PI/2),n.lon=r,n.lat=i,e==="lonlat"?n:[r,i]},formatMinutesToDDHHMM=t=>{const e=hooks.duration(t,"minutes"),n=Math.floor(e.asDays()),r=e.hours(),i=e.minutes();let g=`${String(i).padStart(2,"0")}分`;return r!==0&&(g=`${String(r).padStart(2,"0")}时${g}`),n!==0&&(g=`${String(n).padStart(2,"0")}天${g}`),g},trackLayers=new Map,allTracks={};let activeTrackId=null;const DEFAULT_VALUE="--";let moveFeatureHandler=null;const popupEle=document.createElement("div"),popupOverlay=new Overlay({element:popupEle,positioning:"top-left",stopEvent:!1,className:"track-label-popup"});let polyline,linePath,startMarker,position$1,geoMarker,trackAnimating=!1,lastTime=Date.now(),vectorLayer$4,distance=0,routeFeature=null;const MAX_CACHED_LAYERS=5,usedIds=[],manageLayerCache=t=>{var n;const e=getInstall();for(usedIds.unshift(t);usedIds.length>MAX_CACHED_LAYERS;){const r=usedIds.pop(),i=trackLayers.get(r);i&&((n=i.getSource())==null||n.clear(),e==null||e.removeLayer(i),trackLayers.delete(r),delete allTracks[r])}};let trackColor="";const colors=["#ff0000","#00ff00","#0079ff","#ffa500","#800080","#008080","#ffc0cb","#800000","#000080","#808000"],reRenderTrackLine=debounce(()=>{if(console.log("reRenderTrackLine------------"),activeTrackId&&allTracks[activeTrackId]&&trackLayers.get(activeTrackId).getVisible()){const t=cloneDeep(preprocessTrackData(activeTrackId,allTracks[activeTrackId]));createPointFeature(activeTrackId,t)}},300),preprocessTrackData=(t,e)=>{let n=[];return n=e.map((r,i)=>{if(Number(r.lon)>180||Number(r.lat)>180){const[g,y]=convertSixHundredThousandToLatLng(r.lon,r.lat);r.lon=g,r.lat=y}return r.center=[r.lon,r.lat],r.centerPoint=lonLatToMercator(r.center),r.time=hooks(r.createdAt).format("YYYY-MM-DD HH:mm:ss"),r.id=t,r.index=i,r}),n},renderTrackLine=async(t,e,n,r="ship")=>{const i=getInstall();if(!i||(e=e==null?void 0:e.reverse(),popupOverlay&&r==="ship"&&(i!=null&&i.getOverlays().getArray().includes(popupOverlay)||i.addOverlay(popupOverlay)),(e==null?void 0:e.length)<2))return;manageLayerCache(t),activeTrackId=t,allTracks[t]=e;const g=Object.keys(allTracks).findIndex(y=>y===t)||0;trackColor=n||colors[g>10?10:g],await handlerRenderLine(),await setTrackViewCenter(activeTrackId)},createTrackLayer=t=>{const e=new VectorSource;return new VectorLayer({source:e,visible:!1,className:`track-layer-${t}`,renderBuffer:1024})},setActiveLayer=t=>{const e=getInstall();trackLayers.forEach((n,r)=>{var g;const i=r===t;n.getVisible()!==i&&(n.setVisible(i),e.getLayers().getArray().includes(n)||e.addLayer(n),i||(g=n.getSource())==null||g.clear())}),activeTrackId=t},handlerRenderLine=async()=>{const t=activeTrackId;if(!trackLayers.has(t)){const g=createTrackLayer(t);trackLayers.set(t,g)}await setActiveLayer(t);const e=trackColor||"",n=allTracks[t]||[];if(!(n&&n.length>1))return[];let r=[];r=cloneDeep(preprocessTrackData(t,n));const i=r.map(g=>g.centerPoint);r.length>=2&&await createTrackLineFeature(t,i,e)},createTrackLineFeature=(t,e,n)=>{const r=new LineString(e),i=trackLayers.get(t).getSource(),g=i.getFeatureById(t);if(g)g.setGeometry(r),g.setId(t),g.setStyle(createTrackLineStyle(n)),routeFeature=g;else{const y=new Feature({geometry:r});y.setId(t),y.set("type","line"),y.setStyle(createTrackLineStyle(n)),i.addFeature(y),routeFeature=y}return routeFeature},createTrackLineStyle=t=>new Style({stroke:new Stroke({color:t,width:2})}),handleTrackMapEvent=(t,e,n)=>{const r=t==null?void 0:t.get("trackId"),i=getInstall();if(t&&r&&e==="hover"){i.getTargetElement().style.cursor=r?"pointer":"";const g=t.get("data"),y=renderTrackPointHtml(g),k=n==null?void 0:n.coordinate;k&&(popupEle.querySelector(".popup-content"),popupEle.innerHTML=y,popupOverlay==null||popupOverlay.setPosition(k))}else popupOverlay&&popupOverlay.setPosition(void 0)},renderTrackPointHtml=t=>{if(!(t!=null&&t.time))return;let e="";return t!=null&&t.stayTime&&(e=`
135
135
  <div class="item w-100">
136
136
  <div class="item-label">停泊时间约</div>
137
137
  <div class="item-item">${formatMinutesToDDHHMM(Number(t.stayTime))}</div>
@@ -167,7 +167,7 @@ hooks.version="2.30.1",setHookCallback(createLocal),hooks.fn=proto,hooks.min=min
167
167
  <div class="item-item">${t.time}</div>
168
168
  </div>
169
169
  ${e??e}
170
- </div>`},createPointFeature=(t,e,n)=>{const r=getInstall(),i=r.getView().getZoom()||10,g={10:4,11:6,12:8,13:12,14:16,15:20,16:24,17:30,default:4},y=g[i]||g.default,k=e.filter(z=>z.index===0||z.index===e.length-1||z.state!=="0");if(e.length<=y){const z=e.map(oe=>createPointFeatureWithStyle(oe));trackLayers.get(t).getSource().addFeatures(z),createArrowFetaure(t,e,e,n),e.forEach(oe=>{const j=createPointLabelOverlay(t,n,oe);r.addOverlay(j)});return}const L=douglasPeuckerSimplify(e,k,y);if(k.forEach(z=>{L.some(re=>re.index===z.index)||L.push(z)}),L.length>y){const z=Math.floor(L.length/y),re=[];for(let oe=0;oe<L.length;oe+=z)re.push(L[oe]);L.splice(1,L.length-2,...re.slice(1,re.length-1))}console.log("pointList------",L);const $=L.map(z=>createPointFeatureWithStyle(z));trackLayers.get(t).getSource().addFeatures($),createArrowFetaure(t,L,e,n),L.forEach(z=>{const re=createPointLabelOverlay(t,n,z);r.addOverlay(re)})};function douglasPeuckerSimplify(t,e,n){if(t.length<=n)return[...t];const r=t.map(y=>fromLonLat(y.centerPoint)),g=douglasPeuckerIndex(r,0,r.length-1).map(y=>t[y]);if(e.forEach(y=>{g.some(k=>k.index===y.index)||g.push(y)}),g.length>n){const y=Math.floor(g.length/n),k=[];for(let L=0;L<g.length;L+=y)k.push(g[L]);g.splice(1,g.length-2,...k.slice(1,k.length-1))}return g}function douglasPeuckerIndex(t,e,n){const r=[e];let i=0;if(e<n){const g=t[e],y=t[n];let k=0;for(let L=e+1;L<n;L++){const $=pointToLineDistance(t[L],g,y);$>k&&(k=$,i=L)}if(k>1e-4){const L=douglasPeuckerIndex(t,e,i),$=douglasPeuckerIndex(t,i,n);r.push(...L.slice(1),...$.slice(1))}else r.push(n)}return r}function pointToLineDistance(t,e,n){const r=t[0]-e[0],i=t[1]-e[1],g=n[0]-e[0],y=n[1]-e[1],k=r*g+i*y,L=g*g+y*y;let $=-1;L!==0&&($=k/L);let V,z;$<0?(V=e[0],z=e[1]):$>1?(V=n[0],z=n[1]):(V=e[0]+$*g,z=e[1]+$*y);const re=t[0]-V,oe=t[1]-z;return Math.sqrt(re*re+oe*oe)}const createPointFeatureWithStyle=t=>{const e=new Feature({geometry:new Point(t.centerPoint),data:t});e.set("type","track_point"),e.set("trackId",t.id),e.set("data",t);let n=[...createPointStyle(trackColor)];return(t.index===0||t.index===allTracks[t.id].length-1)&&(n=[...createIconPointStyle(t)],e.set("type","track_begin")),t.state!==void 0&&t.state!==null&&(n=[...createIconStateStyle(t)],e.set("type","track_icon")),e.setStyle(n),e},createPointLabelOverlay=(t,e,n)=>{const r=document.createElement("div");r.className="track-overlay-label",r.style.position="relative",r.style.backgroundColor="rgba(255,255,255,0.8)",r.style.border=`1px solid ${e}`,r.style.fontSize="12px",r.innerHTML=`
170
+ </div>`},filterPoints=t=>{const e=getInstall(),n=100,r=t.map(L=>{const $=e.getPixelFromCoordinate(fromLonLat(L.center));return{...L,original:L,pixel:$,distance:0}});let i=0;r[0].distance=0;for(let L=1;L<r.length;L++){const $=r[L-1].pixel,V=r[L].pixel,z=V[0]-$[0],re=V[1]-$[1];i+=Math.sqrt(z*z+re*re),r[L].distance=i}const g=r.filter((L,$)=>$===0||$===r.length-1),y=[];for(let L=0;L<g.length;L++){const $=g[L];if(y.push($),L<g.length-1){const V=g[L+1],z=V.distance-$.distance,re=Math.floor(z/n);for(let oe=1;oe<=re;oe++){const j=$.distance+oe*n;if(j>=V.distance)break;const ie=interpolateBetweenPoints(r,j);ie&&y.push(ie)}}}return Array.from(new Map(y.map(L=>[L.distance.toFixed(2),L])).values()).map(L=>({...L.original,...L,coord:L.coord,pixel:L.pixel,distance:L.distance}))};function interpolateBetweenPoints(t,e){const n=getInstall();for(let r=1;r<t.length;r++){const i=t[r-1],g=t[r];if(e>=i.distance&&e<=g.distance){const y=(e-i.distance)/(g.distance-i.distance),k=i.pixel[0]+y*(g.pixel[0]-i.pixel[0]),L=i.pixel[1]+y*(g.pixel[1]-i.pixel[1]),$=n.getCoordinateFromPixel([k,L]);return{...i,coord:$,pixel:[k,L],distance:e,original:void 0}}}return null}const createPointFeature=async(t,e)=>{const n=getInstall();await removeAllLabel(),await removeAllFetaure(t);const r=filterPoints(e),i=r.map(y=>createPointFeatureWithStyle(y));trackLayers.get(t).getSource().addFeatures(i),createArrowFetaure(t,r,e,trackColor),r.forEach(y=>{const k=createPointLabelOverlay(t,trackColor,y);n.addOverlay(k)})},createPointFeatureWithStyle=t=>{const e=new Feature({geometry:new Point(t.centerPoint),data:t});e.set("type","track_point"),e.set("trackId",t.id),e.set("data",t);let n=[...createPointStyle(trackColor)];return(t.index===0||t.index===allTracks[t.id].length-1)&&(n=[...createIconPointStyle(t)],e.set("type","track_begin")),t.state!==void 0&&t.state!==null&&(n=[...createIconStateStyle(t)],e.set("type","track_icon")),e.setStyle(n),e},createPointLabelOverlay=(t,e,n)=>{const r=document.createElement("div");r.className="track-overlay-label",r.style.position="relative",r.style.backgroundColor="rgba(255,255,255,0.8)",r.style.border=`1px solid ${e}`,r.style.fontSize="12px",r.innerHTML=`
171
171
  <span>${n.time}</span>
172
172
  <svg
173
173
  style="position: absolute;left: -20px;top: 0;"
@@ -179,7 +179,7 @@ hooks.version="2.30.1",setHookCallback(createLocal),hooks.fn=proto,hooks.min=min
179
179
  x2="20" y2="0"
180
180
  stroke="${e}"
181
181
  stroke-width="1" />
182
- `;const i=new Overlay({element:r,position:fromLonLat(n.center),positioning:"top-left",offset:[20,-20],stopEvent:!1,className:"track-label-time-overlay"});return i.set("class","track-label-overlay"),i.set("trackId",t),i},removeAllLabel=()=>{const t=getInstall(),e=cloneDeep(t==null?void 0:t.getOverlays().getArray()),n=e==null?void 0:e.filter(r=>r.get("class")==="track-label-overlay");n&&n.length>0&&n.forEach(r=>{r.setPosition(void 0),t.removeOverlay(r),r.dispose()})},createPointStyle=t=>[new Style({image:new CircleStyle({stroke:new Stroke({color:"rgba(0, 0, 0, 0.01)",width:20}),radius:3})}),new Style({image:new CircleStyle({fill:new Fill({color:t}),stroke:new Stroke({color:"#fff",width:2}),radius:3})})],createIconStateStyle=t=>{const e="#E31818",n="#1890FF",r="&#xe6d2",i=new Style({text:new Text({font:"Normal 22px map-iconfont",text:getIconFont(r),offsetY:-10,fill:new Fill({color:Number(t.state)===0?e:Number(t.state)===1?n:""})}),zIndex:99}),y=getIconStyle("&#xe6e2;"),L=getIconStyle("&#xe703;"),$=[];return Number(t.state)===0?$.push(y):Number(t.state)===1&&$.push(L),$.push(i),$},createArrowFetaure=(t,e,n,r)=>{const i=e||[],g=e.length;g||(i.push(n[0]),i.push(n[n.length-1]));const y=[];for(let L=0;L<g-1;L++){let $;const V=e[L],z=(e[L+1].index+V.index)/2;if(z%2===0)$=n[z].centerPoint;else{const re=n[Math.floor(z)],oe=n[Math.ceil(z)];if(re&&oe){const[j,ie]=re.centerPoint,[ae,ue]=oe.centerPoint;$=[(j+ae)/2,(ie+ue)/2]}}if($){const re=new Feature({geometry:new Point($)});re.set("type","track_arrow"),re.setStyle(new Style({text:new Text({font:"700 12px map-iconfont",text:getIconFont("&#xe6bc;"),fill:new Fill({color:r}),rotation:getRotation(e[L].center,e[L+1].center)*(Math.PI/180)})})),y.push(re)}}const k=trackLayers.get(t).getSource();k==null||k.addFeatures(y)},setTrackViewCenter=t=>{var y;const n=getInstall().getView(),r=trackLayers.get(t).getSource(),i=routeFeature||(t?r.getFeatureById(t):null);if(!i)return;const g=(y=i==null?void 0:i.getGeometry())==null?void 0:y.getExtent();if(g!=null&&g.length)try{const k=buffer(g,Math.max(g[2]-g[0],g[3]-g[1])*.02);n.fit(k)}catch(k){console.log(k)}},createIconPointStyle=t=>{const e="&#xe69b;",i=t.index===0?"#fcdc3f":"#ff0000";return[new Style({text:new Text({font:"Normal 14px map-iconfont",text:getIconFont(e),fill:new Fill({color:i})}),zIndex:101})]},removeAllTrackLayer=()=>{console.log("清除所有的轨迹-----");const t=getInstall();stopAnimation(),trackLayers.forEach(n=>{var r;(r=n.getSource())==null||r.clear(),t==null||t.removeLayer(n)}),Object.keys(allTracks).forEach(n=>{trackLayers.delete(n),delete allTracks[n]}),removeAllLabel()},closeTrack=t=>{const e=getInstall(),n=trackLayers.get(t||activeTrackId);n==null||n.setVisible(!1),cloneDeep(e.getOverlays().getArray()).forEach(i=>{i.get("class")==="track-label-overlay"&&(i.setPosition(void 0),e.removeOverlay(i))}),stopAnimation()},getTrackLength=(t,e=LENGTH_UNIT.NM)=>{const n={id:t,length:"--"},i=(allTracks[t]||[]).map(y=>transform([y.lon,y.lat],projection.data,projection.mercator)),g=new LineString(i);return n.length=formatLength(g,e)||"--",console.log("showTracks",n),n},playShipTrack=(t,e)=>{handlePlay(String(t),e)},handlePlay=(t,e)=>{const n=allTracks[String(t)],r=n==null?void 0:n.map(i=>[i.lon,i.lat]);r&&playAnimation(r,e)},geoMarkerStyle=new Style({text:new Text({font:"700 20px map-iconfont",text:getIconFont("&#xe657;"),fill:new Fill({color:"#ff0000"}),rotation:0})}),moveFeature=(t,e)=>{var re,oe;const n=getInstall(),r=Number(50*e),i=((re=t.frameState)==null?void 0:re.time)??Date.now(),g=i-lastTime;if(distance=(distance+r*g/1e6)%2,lastTime=i,distance>=1){stopAnimation();return}const y=linePath.getCoordinateAt(distance>1?2-distance:distance),k=linePath.getCoordinateAt(distance>1?distance-.01:distance),L=linePath.getCoordinateAt(distance>1?2-distance:distance+.01),V=getRotation(mercatorToLonLat(k,"array"),mercatorToLonLat(L,"array"))*Math.PI/180;(oe=geoMarkerStyle.getText())==null||oe.setRotation(V),position$1.setCoordinates(y);const z=getVectorContext(t);z.setStyle(geoMarkerStyle),z.drawGeometry(position$1),n==null||n.render()},startAnimation=()=>{var t;trackAnimating=!0,lastTime=Date.now(),distance=0,position$1=((t=startMarker.getGeometry())==null?void 0:t.clone())||new Point([0,0]),moveFeatureHandler&&(vectorLayer$4==null||vectorLayer$4.on("postrender",moveFeatureHandler)),geoMarker==null||geoMarker.setGeometry(void 0)},stopAnimation=()=>{const t=getInstall();trackAnimating&&(trackAnimating=!1,geoMarker==null||geoMarker.setGeometry(void 0),moveFeatureHandler&&vectorLayer$4&&vectorLayer$4.un("postrender",moveFeatureHandler),vectorLayer$4&&(t==null||t.removeLayer(vectorLayer$4)),vectorLayer$4=null,geoMarker=null)},playAnimation=(t,e)=>{trackAnimating&&stopAnimation(),polyline=new Polyline({factor:1e6}).writeGeometry(new LineString(t)),linePath=new Polyline({factor:1e6}).readGeometry(polyline,{dataProjection:projection.data,featureProjection:projection.mercator}),startMarker=new Feature({type:"icon",geometry:new Point(linePath.getFirstCoordinate())});const n=startMarker.getGeometry();position$1=n?n.clone():new Point([0,0]),geoMarker=new Feature({type:"geoMarker",style:geoMarkerStyle,geometry:position$1}),vectorLayer$4=new VectorLayer({source:new VectorSource({features:[geoMarker]})});const r=getInstall();r==null||r.addLayer(vectorLayer$4),moveFeatureHandler=i=>moveFeature(i,e),startAnimation()},getRotation=(t,e,n)=>{function r(z){return 180*(z%(2*Math.PI))/Math.PI}function i(z){return z%360*Math.PI/180}function g(z){var re;if(!z)throw new Error("Coordinate is required");if(!Array.isArray(z)){if((z==null?void 0:z.type)==="Feature"&&(z==null?void 0:z.geometry)!==null&&((re=z==null?void 0:z.geometry)==null?void 0:re.type)==="Point")return z==null?void 0:z.geometry.coordinates;if(z.type==="Point")return(z==null?void 0:z.coordinates)||[]}if(Array.isArray(z)&&z.length>=2&&!Array.isArray(z[0])&&!Array.isArray(z[1]))return z;throw new Error("Coordinate must be GeoJSON Point or an Array of numbers")}function y(z,re,oe={}){if(oe.final)return function(_e,Ce){return(y(Ce,_e)+180)%360}(z,re);const j=g(z),ie=g(re),ae=i(j[0]),ue=i(ie[0]),de=i(j[1]),pe=i(ie[1]),le=Math.sin(ue-ae)*Math.cos(pe),he=Math.cos(de)*Math.sin(pe)-Math.sin(de)*Math.cos(pe)*Math.cos(ue-ae);return r(Math.atan2(le,he))}function k(z){return!isNaN(z)&&z!==null&&!Array.isArray(z)}function L(z,re={},oe={}){return z||console.log("Coordinates are required"),Array.isArray(z)||console.log("Coordinates must be an Array"),z.length<2&&console.log("Coordinates must be at least 2 numbers long"),(!k(z[0])||!k(z[1]))&&console.log("Coordinates must contain numbers"),$({type:"Point",coordinates:z},re,oe)}function $(z,re={},oe={}){const j={type:"Feature",id:"",properties:{},bbox:{},geometry:{}};return oe.id!==void 0&&(j.id=oe.id),oe.bbox&&(j.bbox=oe.bbox),j.properties=re,j.geometry=z,j}const V=y(L(t),L(e),n);return V<0?360+V:V},getRightIcons=t=>{const e=[];return t.existDevice&&e.push("&#xe687;"),t.existMobile&&e.push("&#xe688;"),t.existWaterGauge&&e.push("&#xe686;"),e};new RBush$1;function useShipOverlay(t){const e=vue.ref(null),n=vue.ref(null),r=vue.computed(()=>({"--overlay-color":t.color||"#FFF","--bg-color":t.selected?t.color:"#ffffff",position:"relative","pointer-events":"none"})),i=vue.computed(()=>({position:"relative","border-radius":"1px","background-color":"var(--bg-color)",color:"#000","padding-right":"5px","box-shadow":"0 2px 10px rgba(0, 0, 0, 0.2)","font-size":"10px","white-space":"nowrap",border:"1px solid #FFF","pointer-events":"auto",transition:"background-color 0.5s ease, border 0.5s ease","z-index":"1",display:"flex","align-items":"center"})),g=vue.computed(()=>({width:"14px",height:"14px",margin:"1px 5px 1px 1px","background-color":"var(--bg-color)"})),y=vue.computed(()=>({position:"absolute",top:"0px",color:"var(--overlay-color)","pointer-events":"none",transform:"translateY(-1px)","z-index":"0",width:"20px",height:"20px",overflow:"visible"}));let k=null;const L=()=>{$(),k=window.setInterval(()=>{if(e.value){const z=e.value.querySelector(".ship-overlay-content");z&&z.style&&(z.style.backgroundColor=t.color,z.style.color="#FFF",setTimeout(()=>{z&&z.style&&(z.style.backgroundColor="#ffffff",z.style.color="#000")},500))}},1e3)},$=()=>{k&&(clearInterval(k),k=null)},V=()=>{n.value&&n.value.setPosition(fromLonLat(t.position))};return vue.watch(()=>t.selected,z=>{z?L():$()},{immediate:!0}),vue.watch(()=>t.position,()=>{V()},{deep:!0}),vue.onMounted(()=>{}),vue.onBeforeUnmount(()=>{$()}),()=>vue.h("div",{ref:e,class:"ship-overlay-container",style:r.value},[vue.h("div",{class:"ship-overlay-content",style:i.value},[vue.h("div",{style:t.selected?g.value:{}},""),vue.h("div",{class:"text"},t.name||"未命名船舶"),vue.h("div",{class:"icons",style:{color:"#3370ff"}},[t.existDevice?vue.h("i",{class:"iconfont icon-Frame-19",style:{fontSize:"12px"}}):"",t.existMobile?vue.h("i",{class:"iconfont icon-Frame13",style:{fontSize:"12px"}}):"",t.existWaterGauge?vue.h("i",{class:"iconfont icon-a-Frame7",style:{fontSize:"12px"}}):""])]),vue.h("svg",{class:"ship-overlay-line",style:y.value,viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[vue.h("line",{x1:"0",y1:"0",x2:"0",y2:"0",stroke:"white","stroke-width":"1"})])])}const POSITION_PRIORITY=[{positioning:"top-left",offset:[20,-20],line:{x1:"0",y1:"20",x2:"20",y2:"4"}},{positioning:"top-right",offset:[-20,-20],line:{x1:"0",y1:"4",x2:"20",y2:"20"}},{positioning:"top-left",offset:[20,0],line:{x1:"0",y1:"0",x2:"20",y2:"4"}},{positioning:"top-right",offset:[-20,0],line:{x1:"0",y1:"4",x2:"20",y2:"0"}},{positioning:"top-left",offset:[20,20],line:{x1:"20",y1:"4",x2:"0",y2:"-20"}},{positioning:"top-right",offset:[-20,20],line:{x1:"0",y1:"4",x2:"20",y2:"-20"}}],existingOverlays=vue.ref([]);function isOverlapping(t,e){return!(t.right<e.left||t.left>e.right||t.bottom<e.top||t.top>e.bottom)}function calculateBestPosition(t,e){const n=existingOverlays.value.filter(r=>r!==t).map(r=>{var i;return(i=r.getElement())==null?void 0:i.getBoundingClientRect()}).filter(r=>r!==void 0);for(const r of POSITION_PRIORITY){t.setPositioning(r.positioning),t.setOffset(r.offset),t.setPosition(e);const i=t.getElement();if(!i)continue;i.offsetHeight;const g=i.getBoundingClientRect();if(!n.some(k=>isOverlapping(g,k)))break}}function addOverlay(t,e,n,r){const i=new Overlay({element:n,positioning:"top-left",id:"label-"+(r==null?void 0:r.id),offset:[0,0],autoPan:!1,className:r.blinking?"ship-label-overlay-blinking":"ship-label-overlay"});i.set("class","zh-map-ship-overlay"),t.addOverlay(i),existingOverlays.value.push(i),vue.nextTick(async()=>{await calculateBestPosition(i,e),setLinePath(i)})}function setLinePath(t){const e=t.getElement(),n=e==null?void 0:e.querySelector(".ship-overlay-line"),r=t.getPositioning(),i=t.getOffset();n&&r==="top-right"&&(n.style.right="-20px"),n&&r==="top-left"&&(n.style.left="-20px");const g=POSITION_PRIORITY.filter(k=>k.positioning===r&&k.offset===i),y=e==null?void 0:e.querySelector(".ship-overlay-line line");if(g.length>0){const{x1:k,y1:L,x2:$,y2:V}=g[0].line;y&&(y.setAttribute("x1",k),y.setAttribute("y1",L),y.setAttribute("x2",$),y.setAttribute("y2",V))}}function removeLabelOverlay(t){existingOverlays.value=[],t.getOverlays().getArray().filter(r=>r.get("class")==="zh-map-ship-overlay").forEach(r=>{r.setPosition(void 0),r.setElement(void 0),t.removeOverlay(r),r.dispose()})}const getShipDirectPath=t=>{const{spd:e,hdg:n,cog:r}=t;return e?n!==null&&+n!=511&&r!==null?r-+n>=3?SHIP_DIRECT.right:r-+n<=-3?SHIP_DIRECT.left:SHIP_DIRECT.front:SHIP_DIRECT.front:""},createShipStyle=t=>{const{shipData:e}=t.getProperties(),n=getShipType(),r=getShipScale(e,n);return initShipStyle(t,r,n)},getShipType=()=>{const t=getZoom();return t<=MAP_ZOOM.shipModelMax&&t>=MAP_ZOOM.shipTriggleMin?"ship":"triangle"},getShipScale=(t,e)=>{if(e==="ship"){const{len:n,wid:r}=t,i=97,g=20,k=1/getView().getResolution(),L=n*k/i,$=r*k/g;return Math.max(L,$)}return MAP_ZOOM.scaleNum},initShipStyle=(t,e,n)=>{const{color:r,direct:i,isHighlight:g,shipData:y}=t.getProperties(),k=(y.cog-90+360)%360;return new Style({image:new Icon({src:L(),scale:e||MAP_ZOOM.scaleNum,anchor:[.5,.5],rotation:k*Math.PI/180,rotateWithView:!1})});function L(){return`data:image/svg+xml;utf8,${encodeURIComponent($())}`}function $(){switch(n){case"triangle":return`<svg width="41" height="24" viewBox="0 0 41 24" fill="none" xmlns="http://www.w3.org/2000/svg">
182
+ `;const i=new Overlay({element:r,position:fromLonLat(n.center),positioning:"top-left",offset:[20,-20],stopEvent:!1,className:"track-label-time-overlay"});return i.set("class","track-label-overlay"),i.set("trackId",t),i},removeAllLabel=()=>{const t=getInstall(),e=cloneDeep(t==null?void 0:t.getOverlays().getArray()),n=e==null?void 0:e.filter(r=>r.get("class")==="track-label-overlay");n&&n.length>0&&n.forEach(r=>{r.setPosition(void 0),t.removeOverlay(r),r.dispose()})},removeAllFetaure=t=>{const e=trackLayers.get(t).getSource();e.forEachFeature(n=>{n.get("type")!=="line"&&e.removeFeature(n)})},createPointStyle=t=>[new Style({image:new CircleStyle({stroke:new Stroke({color:"rgba(0, 0, 0, 0.01)",width:20}),radius:3})}),new Style({image:new CircleStyle({fill:new Fill({color:t}),stroke:new Stroke({color:"#fff",width:2}),radius:3})})],createIconStateStyle=t=>{const e="#E31818",n="#1890FF",r="&#xe6d2",i=new Style({text:new Text({font:"Normal 22px map-iconfont",text:getIconFont(r),offsetY:-10,fill:new Fill({color:Number(t.state)===0?e:Number(t.state)===1?n:""})}),zIndex:99}),y=getIconStyle("&#xe6e2;"),L=getIconStyle("&#xe703;"),$=[];return Number(t.state)===0?$.push(y):Number(t.state)===1&&$.push(L),$.push(i),$},createArrowFetaure=(t,e,n,r)=>{const i=e||[],g=e.length;g||(i.push(n[0]),i.push(n[n.length-1]));const y=[];for(let L=0;L<g-1;L++){let $;const V=e[L],z=(e[L+1].index+V.index)/2;if(z%2===0)$=n[z].centerPoint;else{const re=n[Math.floor(z)],oe=n[Math.ceil(z)];if(re&&oe){const[j,ie]=re.centerPoint,[ae,ue]=oe.centerPoint;$=[(j+ae)/2,(ie+ue)/2]}}if($){const re=new Feature({geometry:new Point($)});re.set("type","track_arrow"),re.setStyle(new Style({text:new Text({font:"700 12px map-iconfont",text:getIconFont("&#xe6bc;"),fill:new Fill({color:r}),rotation:getRotation(e[L].center,e[L+1].center)*(Math.PI/180)})})),y.push(re)}}const k=trackLayers.get(t).getSource();k==null||k.addFeatures(y)},setTrackViewCenter=t=>{var y;const n=getInstall().getView(),r=trackLayers.get(t).getSource(),i=routeFeature||(t?r.getFeatureById(t):null);if(!i)return;const g=(y=i==null?void 0:i.getGeometry())==null?void 0:y.getExtent();if(g!=null&&g.length)try{const k=buffer(g,Math.max(g[2]-g[0],g[3]-g[1])*.02);n.fit(k)}catch(k){console.log(k)}},createIconPointStyle=t=>{const e="&#xe69b;",i=t.index===0?"#fcdc3f":"#ff0000";return[new Style({text:new Text({font:"Normal 14px map-iconfont",text:getIconFont(e),fill:new Fill({color:i})}),zIndex:101})]},removeAllTrackLayer=()=>{console.log("清除所有的轨迹-----");const t=getInstall();stopAnimation(),trackLayers.forEach(n=>{var r;(r=n.getSource())==null||r.clear(),t==null||t.removeLayer(n)}),Object.keys(allTracks).forEach(n=>{trackLayers.delete(n),delete allTracks[n]}),removeAllLabel()},closeTrack=t=>{const e=getInstall(),n=trackLayers.get(t||activeTrackId);n==null||n.setVisible(!1),cloneDeep(e.getOverlays().getArray()).forEach(i=>{i.get("class")==="track-label-overlay"&&(i.setPosition(void 0),e.removeOverlay(i))}),stopAnimation()},getTrackLength=(t,e=LENGTH_UNIT.NM)=>{const n={id:t,length:"--"},i=(allTracks[t]||[]).map(y=>transform([y.lon,y.lat],projection.data,projection.mercator)),g=new LineString(i);return n.length=formatLength(g,e)||"--",n},playShipTrack=(t,e)=>{handlePlay(String(t),e)},handlePlay=(t,e)=>{const n=allTracks[String(t)],r=n==null?void 0:n.map(i=>[i.lon,i.lat]);r&&playAnimation(r,e)},geoMarkerStyle=new Style({text:new Text({font:"700 20px map-iconfont",text:getIconFont("&#xe657;"),fill:new Fill({color:"#ff0000"}),rotation:0})}),moveFeature=(t,e)=>{var re,oe;const n=getInstall(),r=Number(50*e),i=((re=t.frameState)==null?void 0:re.time)??Date.now(),g=i-lastTime;if(distance=(distance+r*g/1e6)%2,lastTime=i,distance>=1){stopAnimation();return}const y=linePath.getCoordinateAt(distance>1?2-distance:distance),k=linePath.getCoordinateAt(distance>1?distance-.01:distance),L=linePath.getCoordinateAt(distance>1?2-distance:distance+.01),V=getRotation(mercatorToLonLat(k,"array"),mercatorToLonLat(L,"array"))*Math.PI/180;(oe=geoMarkerStyle.getText())==null||oe.setRotation(V),position$1.setCoordinates(y);const z=getVectorContext(t);z.setStyle(geoMarkerStyle),z.drawGeometry(position$1),n==null||n.render()},startAnimation=()=>{var t;trackAnimating=!0,lastTime=Date.now(),distance=0,position$1=((t=startMarker.getGeometry())==null?void 0:t.clone())||new Point([0,0]),moveFeatureHandler&&(vectorLayer$4==null||vectorLayer$4.on("postrender",moveFeatureHandler)),geoMarker==null||geoMarker.setGeometry(void 0)},stopAnimation=()=>{const t=getInstall();trackAnimating&&(trackAnimating=!1,geoMarker==null||geoMarker.setGeometry(void 0),moveFeatureHandler&&vectorLayer$4&&vectorLayer$4.un("postrender",moveFeatureHandler),vectorLayer$4&&(t==null||t.removeLayer(vectorLayer$4)),vectorLayer$4=null,geoMarker=null)},playAnimation=(t,e)=>{trackAnimating&&stopAnimation(),polyline=new Polyline({factor:1e6}).writeGeometry(new LineString(t)),linePath=new Polyline({factor:1e6}).readGeometry(polyline,{dataProjection:projection.data,featureProjection:projection.mercator}),startMarker=new Feature({type:"icon",geometry:new Point(linePath.getFirstCoordinate())});const n=startMarker.getGeometry();position$1=n?n.clone():new Point([0,0]),geoMarker=new Feature({type:"geoMarker",style:geoMarkerStyle,geometry:position$1}),vectorLayer$4=new VectorLayer({source:new VectorSource({features:[geoMarker]})});const r=getInstall();r==null||r.addLayer(vectorLayer$4),moveFeatureHandler=i=>moveFeature(i,e),startAnimation()},getRotation=(t,e,n)=>{function r(z){return 180*(z%(2*Math.PI))/Math.PI}function i(z){return z%360*Math.PI/180}function g(z){var re;if(!z)throw new Error("Coordinate is required");if(!Array.isArray(z)){if((z==null?void 0:z.type)==="Feature"&&(z==null?void 0:z.geometry)!==null&&((re=z==null?void 0:z.geometry)==null?void 0:re.type)==="Point")return z==null?void 0:z.geometry.coordinates;if(z.type==="Point")return(z==null?void 0:z.coordinates)||[]}if(Array.isArray(z)&&z.length>=2&&!Array.isArray(z[0])&&!Array.isArray(z[1]))return z;throw new Error("Coordinate must be GeoJSON Point or an Array of numbers")}function y(z,re,oe={}){if(oe.final)return function(_e,Ce){return(y(Ce,_e)+180)%360}(z,re);const j=g(z),ie=g(re),ae=i(j[0]),ue=i(ie[0]),de=i(j[1]),pe=i(ie[1]),le=Math.sin(ue-ae)*Math.cos(pe),he=Math.cos(de)*Math.sin(pe)-Math.sin(de)*Math.cos(pe)*Math.cos(ue-ae);return r(Math.atan2(le,he))}function k(z){return!isNaN(z)&&z!==null&&!Array.isArray(z)}function L(z,re={},oe={}){return z||console.log("Coordinates are required"),Array.isArray(z)||console.log("Coordinates must be an Array"),z.length<2&&console.log("Coordinates must be at least 2 numbers long"),(!k(z[0])||!k(z[1]))&&console.log("Coordinates must contain numbers"),$({type:"Point",coordinates:z},re,oe)}function $(z,re={},oe={}){const j={type:"Feature",id:"",properties:{},bbox:{},geometry:{}};return oe.id!==void 0&&(j.id=oe.id),oe.bbox&&(j.bbox=oe.bbox),j.properties=re,j.geometry=z,j}const V=y(L(t),L(e),n);return V<0?360+V:V},getRightIcons=t=>{const e=[];return t.existDevice&&e.push("&#xe687;"),t.existMobile&&e.push("&#xe688;"),t.existWaterGauge&&e.push("&#xe686;"),e};new RBush$1;function useShipOverlay(t){const e=vue.ref(null),n=vue.ref(null),r=vue.computed(()=>({"--overlay-color":t.color||"#FFF","--bg-color":t.selected?t.color:"#ffffff",position:"relative","pointer-events":"none"})),i=vue.computed(()=>({position:"relative","border-radius":"1px","background-color":"var(--bg-color)",color:"#000","padding-right":"5px","box-shadow":"0 2px 10px rgba(0, 0, 0, 0.2)","font-size":"10px","white-space":"nowrap",border:"1px solid #FFF","pointer-events":"auto",transition:"background-color 0.5s ease, border 0.5s ease","z-index":"1",display:"flex","align-items":"center"})),g=vue.computed(()=>({width:"14px",height:"14px",margin:"1px 5px 1px 1px","background-color":"var(--bg-color)"})),y=vue.computed(()=>({position:"absolute",top:"0px",color:"var(--overlay-color)","pointer-events":"none",transform:"translateY(-1px)","z-index":"0",width:"20px",height:"20px",overflow:"visible"}));let k=null;const L=()=>{$(),k=window.setInterval(()=>{if(e.value){const z=e.value.querySelector(".ship-overlay-content");z&&z.style&&(z.style.backgroundColor=t.color,z.style.color="#FFF",setTimeout(()=>{z&&z.style&&(z.style.backgroundColor="#ffffff",z.style.color="#000")},500))}},1e3)},$=()=>{k&&(clearInterval(k),k=null)},V=()=>{n.value&&n.value.setPosition(fromLonLat(t.position))};return vue.watch(()=>t.selected,z=>{z?L():$()},{immediate:!0}),vue.watch(()=>t.position,()=>{V()},{deep:!0}),vue.onMounted(()=>{}),vue.onBeforeUnmount(()=>{$()}),()=>vue.h("div",{ref:e,class:"ship-overlay-container",style:r.value},[vue.h("div",{class:"ship-overlay-content",style:i.value},[vue.h("div",{style:t.selected?g.value:{}},""),vue.h("div",{class:"text"},t.name||"未命名船舶"),vue.h("div",{class:"icons",style:{color:"#3370ff"}},[t.existDevice?vue.h("i",{class:"iconfont icon-Frame-19",style:{fontSize:"12px"}}):"",t.existMobile?vue.h("i",{class:"iconfont icon-Frame13",style:{fontSize:"12px"}}):"",t.existWaterGauge?vue.h("i",{class:"iconfont icon-a-Frame7",style:{fontSize:"12px"}}):""])]),vue.h("svg",{class:"ship-overlay-line",style:y.value,viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[vue.h("line",{x1:"0",y1:"0",x2:"0",y2:"0",stroke:"white","stroke-width":"1"})])])}const POSITION_PRIORITY=[{positioning:"top-left",offset:[20,-20],line:{x1:"0",y1:"20",x2:"20",y2:"4"}},{positioning:"top-right",offset:[-20,-20],line:{x1:"0",y1:"4",x2:"20",y2:"20"}},{positioning:"top-left",offset:[20,0],line:{x1:"0",y1:"0",x2:"20",y2:"4"}},{positioning:"top-right",offset:[-20,0],line:{x1:"0",y1:"4",x2:"20",y2:"0"}},{positioning:"top-left",offset:[20,20],line:{x1:"20",y1:"4",x2:"0",y2:"-20"}},{positioning:"top-right",offset:[-20,20],line:{x1:"0",y1:"4",x2:"20",y2:"-20"}}],existingOverlays=vue.ref([]);function isOverlapping(t,e){return!(t.right<e.left||t.left>e.right||t.bottom<e.top||t.top>e.bottom)}function calculateBestPosition(t,e){const n=existingOverlays.value.filter(r=>r!==t).map(r=>{var i;return(i=r.getElement())==null?void 0:i.getBoundingClientRect()}).filter(r=>r!==void 0);for(const r of POSITION_PRIORITY){t.setPositioning(r.positioning),t.setOffset(r.offset),t.setPosition(e);const i=t.getElement();if(!i)continue;i.offsetHeight;const g=i.getBoundingClientRect();if(!n.some(k=>isOverlapping(g,k)))break}}function addOverlay(t,e,n,r){const i=new Overlay({element:n,positioning:"top-left",id:"label-"+(r==null?void 0:r.id),offset:[0,0],autoPan:!1,className:r.blinking?"ship-label-overlay-blinking":"ship-label-overlay"});i.set("class","zh-map-ship-overlay"),t.addOverlay(i),existingOverlays.value.push(i),vue.nextTick(async()=>{await calculateBestPosition(i,e),setLinePath(i)})}function setLinePath(t){const e=t.getElement(),n=e==null?void 0:e.querySelector(".ship-overlay-line"),r=t.getPositioning(),i=t.getOffset();n&&r==="top-right"&&(n.style.right="-20px"),n&&r==="top-left"&&(n.style.left="-20px");const g=POSITION_PRIORITY.filter(k=>k.positioning===r&&k.offset===i),y=e==null?void 0:e.querySelector(".ship-overlay-line line");if(g.length>0){const{x1:k,y1:L,x2:$,y2:V}=g[0].line;y&&(y.setAttribute("x1",k),y.setAttribute("y1",L),y.setAttribute("x2",$),y.setAttribute("y2",V))}}function removeLabelOverlay(t){existingOverlays.value=[];const n=t.getOverlays().getArray().filter(r=>r.get("class")==="zh-map-ship-overlay");console.log("labelOverlays--------",n),n.forEach(r=>{r.setPosition(void 0),r.setElement(void 0),t.removeOverlay(r),r.dispose()})}const getShipDirectPath=t=>{const{spd:e,hdg:n,cog:r}=t;return e?n!==null&&+n!=511&&r!==null?r-+n>=3?SHIP_DIRECT.right:r-+n<=-3?SHIP_DIRECT.left:SHIP_DIRECT.front:SHIP_DIRECT.front:""},createShipStyle=t=>{const{shipData:e}=t.getProperties(),n=getShipType(),r=getShipScale(e,n);return initShipStyle(t,r,n)},getShipType=()=>{const t=getZoom();return t<=MAP_ZOOM.shipModelMax&&t>=MAP_ZOOM.shipTriggleMin?"ship":"triangle"},getShipScale=(t,e)=>{if(e==="ship"){const{len:n,wid:r}=t,i=97,g=20,k=1/getView().getResolution(),L=n*k/i,$=r*k/g;return Math.max(L,$)}return MAP_ZOOM.scaleNum},initShipStyle=(t,e,n)=>{const{color:r,direct:i,isHighlight:g,shipData:y}=t.getProperties(),k=(y.cog-90+360)%360;return new Style({image:new Icon({src:L(),scale:e||MAP_ZOOM.scaleNum,anchor:[.5,.5],rotation:k*Math.PI/180,rotateWithView:!1})});function L(){return`data:image/svg+xml;utf8,${encodeURIComponent($())}`}function $(){switch(n){case"triangle":return`<svg width="41" height="24" viewBox="0 0 41 24" fill="none" xmlns="http://www.w3.org/2000/svg">
183
183
  <path d="M30.8843 12.6777L2.21343 21.7067C1.75559 21.8509 1.28947 21.509 1.28947 21.029L1.28947 2.97103C1.28947 2.49102 1.75558 2.14913 2.21342 2.29331L30.8843 11.3223C31.5471 11.531 31.5471 12.469 30.8843 12.6777Z"
184
184
  fill="${r}" stroke="${g?"#FF2424":"black"}" stroke-width="${g?"2":"0.578947"}" />
185
185
  <!--path船航向左边或者向前-->
@@ -201,7 +201,7 @@ hooks.version="2.30.1",setHookCallback(createLocal),hooks.fn=proto,hooks.min=min
201
201
  <path d="M1.99982 46.9998L1.99982 1.99982L46.9998 1.99982L46.9998 46.9998L1.99982 46.9998Z" fill="#FF2424" fill-opacity="0.2"/>
202
202
  <path fill-rule="evenodd" clip-rule="evenodd" d="M19.9998 0.5V3.5L3.49976 3.5V20H0.499756V0.500002L19.9998 0.5ZM45.4998 3.5H28.9998V0.5H48.4998V20H45.4998V3.5ZM48.4998 29L48.4998 48.5H28.9998V45.5H45.4998L45.4998 29H48.4998ZM3.49976 45.5L3.49976 29H0.499756L0.499758 48.5L19.9998 48.5V45.5L3.49976 45.5Z" fill="#FF2424"/>
203
203
  </svg>
204
- `,g=document.createElement("div");return g.className="ship-overlay-selected",g.innerHTML=i,g},createLabelStyle=t=>{const e=getInstall(),{shipData:n,blinking:r}=t.getProperties(),{lon:i,lat:g}=n,y=createLabelElement(t);addOverlay(e,fromLonLat([i,g]),y,{...n,blinking:r})},createLabelElement=t=>{const e=document.createElement("div");e.className="ship-overlay-box",e.style.position="relative";const n=t.getProperties(),{shipData:r,blinking:i,blinkingColor:g,name:y}=n,{lon:k,lat:L}=r,$=vue.createVNode({setup(){return useShipOverlay({position:[k+.002,L+.002],selected:i,name:y,color:g,existDevice:r==null?void 0:r.existDevice,existMobile:r==null?void 0:r.existMobile,existWaterGauge:r==null?void 0:r.existWaterGauge})}});return vue.render($,e),e};let selectedShipFeature=null,selectedShip=null;const shipsSource=new VectorSource,shipsLayer=new VectorLayer({source:shipsSource,className:"zh-map--ship-layer",updateWhileInteracting:!1,updateWhileAnimating:!1,renderBuffer:300,zIndex:101});let hoveredShipId="",attentionShips={},attentionShipsColor={};const renderShipList=t=>{console.log("renderShipList",t);const e=getInstall();if(!t||!e)return;removeSelectedOverlay(),e.getLayers().getArray().includes(shipsLayer)||e.addLayer(shipsLayer);const n=(selectedShip==null?void 0:selectedShip.id)||(selectedShipFeature==null?void 0:selectedShipFeature.get("id"));removeLabelOverlay(e),shipsSource&&shipsSource.clear();const r=[];if(selectedShip){const g=t.filter(y=>y.id===n);g.length===0?t.push(selectedShip):selectedShip=g[0]}const i=getZoom();t.forEach(g=>{if(g){const y=createShipFetature(g);r.push(y),((selectedShip==null?void 0:selectedShip.id)==g.id||i>=MAP_ZOOM.shipModelMin)&&createLabelStyle(y)}}),shipsSource.addFeatures(r),handleChangeSelected()},createShipFetature=t=>{const e=(selectedShip==null?void 0:selectedShip.id)||(selectedShipFeature==null?void 0:selectedShipFeature.get("id")),n=fromLonLat([t==null?void 0:t.lon,t==null?void 0:t.lat]),r=new Feature({geometry:new Point(n),shipData:t,id:t.id,name:t.cnname||"未命名船舶",selected:t.id===e,rightIcons:getRightIcons(t),blinking:attentionShips[t.id]||!1,blinkingColor:attentionShipsColor[t.id]||"",color:t.fill||"#04C900",direct:getShipDirectPath(t),isHighlight:!1});return r.setStyle(createShipStyle(r)),r},handleChangeSelected=()=>{var i;if(!selectedShip)return;const t=getInstall();if(!t)return;let r=cloneDeep(t.getOverlays().getArray()).find(g=>g.get("class")=="ship-overlay-selected");if(r){const g=selectedShipElement(selectedShip);r.setElement(g),r.setPosition(fromLonLat([selectedShip.lon,selectedShip.lat]))}else r=selectedShipStyle(selectedShip),t.addOverlay(r);r&&((i=r.get("element"))!=null&&i.parentElement)&&(r.get("element").parentElement.style.display="block")},clearShipList=()=>{const t=getInstall();if(!t||!shipsSource)return;const e=(selectedShip==null?void 0:selectedShip.id)||"";shipsSource.getFeatures().forEach(r=>{r.get("shipData").shipId!==e&&shipsSource.removeFeature(r)});const n=t.getOverlays().getArray();cloneDeep(n).map(r=>{(r.getId()!=="label-"+e||r.getId()!=="selected-"+e)&&(r.setPosition(void 0),t.removeOverlay(r),r.dispose())})},renderShipBlink=(t,e)=>{const n=getInstall();attentionShips=t,attentionShipsColor=e;const r=cloneDeep(n.getOverlays().getArray()),i=cloneDeep(shipsSource.getFeatures());for(const g in attentionShips){const y=attentionShips[g],k=r.find($=>$.getId()==="label-"+g),L=i.find($=>g===$.get("id"));if(k&&L){L.set("blinking",y),L.set("blinkingColor",attentionShipsColor[g]||"");const $=k.getElement(),V=createLabelElement(L),z=V.querySelector(".ship-overlay-line"),re=$==null?void 0:$.querySelector(".ship-overlay-line");$&&$!==V&&(re&&z&&z.replaceWith(re),k.setElement(V))}}},filterShipShow=t=>{const e=getInstall();if(!e)return;const n=shipsSource.getFeatures(),r=selectedShipFeature?selectedShipFeature.get("id"):"",i=n.filter(k=>k.get("id")!==r),g=new Map;t.forEach(k=>{g.set(k.id,!0)});const y=cloneDeep(e.getOverlays().getArray());i.forEach(k=>{const L=k.get("id"),$=y.find(V=>V.getId()==="label-"+L);if(!g.has(L))k.setStyle([]),$&&($.get("element").style.visibility="hidden");else{$&&($.get("element").style.visibility="visible");const V=k.getStyle();(V==null?void 0:V.length)==0&&k.setStyle(createShipStyle(k))}})},renderShipSelected=t=>{if(t){console.log("选中",t);const e=shipsSource.getFeatures().find(n=>n.get("id")===t.id);e&&(selectedShipFeature=e),selectedShip=t,handleChangeSelected()}else console.log("取消选中"),selectedShip=null,selectedShipFeature=null,removeSelectedOverlay()},handleShipMapEvent=debounce((t,e,n)=>{const r=getInstall();if(t){const i=t.get("shipData"),g=t.get("id");if(r.getTargetElement().style.cursor=g?"pointer":"",e==="click"&&(renderShipSelected(i),n&&n(g)),e==="hover"){hoveredShipId&&hoveredShipId!==g&&clearHoverHight(),hoveredShipId=g;const y=shipsSource.getFeatures().find(k=>k.get("id")===hoveredShipId);y==null||y.set("isHighlight",!0),y==null||y.setStyle(createShipStyle(y))}}else r.getTargetElement().style.cursor="",clearHoverHight()},10),clearHoverHight=()=>{const t=hoveredShipId?shipsSource.getFeatures().find(e=>e.get("id")===hoveredShipId):null;hoveredShipId=null,t==null||t.set("isHighlight",!1),t==null||t.setStyle(createShipStyle(t))},removeSelectedOverlay=()=>{try{const t=getInstall(),n=cloneDeep(t.getOverlays().getArray()).find(r=>r.get("class")=="ship-overlay-selected");n&&n.setPosition(void 0)}catch(t){console.log(t)}},PORT_LAYER_CLASS_NAME="zh-map-port-layer";let vectorLayer$3,vectorSource$3;const renderPortList=t=>{var e;if(!(!t||t.length===0)){if(vectorSource$3||(vectorSource$3=new VectorSource),vectorSource$3.clear(),selectedPortData){const n=t.find(r=>r.id===selectedPortData.id);n?selectedPortData=n:t.push(selectedPortData)}t.forEach(n=>{renderPortPoint$1(n)}),vectorLayer$3||(vectorLayer$3=new VectorLayer({className:PORT_LAYER_CLASS_NAME,source:vectorSource$3,zIndex:100}),(e=getInstall())==null||e.addLayer(vectorLayer$3))}},renderPortPoint$1=t=>{const e=getZoom(),[n,r]=t.latLon.split(","),i=new Feature({geometry:new Point(fromLonLat([Number(n),Number(r)]))});i.setStyle(setPortStyle$1(t,e,t.id===(selectedPortData==null?void 0:selectedPortData.id))),i.set("portData",t),vectorSource$3.addFeature(i)},setPortStyle$1=(t,e,n)=>{const r=g=>`<svg width="46" height="46" viewBox="0 0 46 46" fill="none" xmlns="http://www.w3.org/2000/svg">
204
+ `,g=document.createElement("div");return g.className="ship-overlay-selected",g.innerHTML=i,g},createLabelStyle=t=>{const e=getInstall(),{shipData:n,blinking:r}=t.getProperties(),{lon:i,lat:g}=n,y=createLabelElement(t);addOverlay(e,fromLonLat([i,g]),y,{...n,blinking:r})},createLabelElement=t=>{const e=document.createElement("div");e.className="ship-overlay-box",e.style.position="relative";const n=t.getProperties(),{shipData:r,blinking:i,blinkingColor:g,name:y}=n,{lon:k,lat:L}=r,$=vue.createVNode({setup(){return useShipOverlay({position:[k+.002,L+.002],selected:i,name:y,color:g,existDevice:r==null?void 0:r.existDevice,existMobile:r==null?void 0:r.existMobile,existWaterGauge:r==null?void 0:r.existWaterGauge})}});return vue.render($,e),e};let selectedShipFeature=null,selectedShip=null;const shipsSource=new VectorSource,shipsLayer=new VectorLayer({source:shipsSource,className:"zh-map--ship-layer",updateWhileInteracting:!1,updateWhileAnimating:!1,renderBuffer:300,zIndex:101});let hoveredShipId="",attentionShips={},attentionShipsColor={};const renderShipList=t=>{const e=getInstall();if(!t||!e)return;removeSelectedOverlay(),removeLabelOverlay(e),e.getLayers().getArray().includes(shipsLayer)||e.addLayer(shipsLayer);const n=(selectedShip==null?void 0:selectedShip.id)||(selectedShipFeature==null?void 0:selectedShipFeature.get("id"));shipsSource&&shipsSource.clear();const r=[];if(selectedShip){const g=t.filter(y=>y.id===n);g.length===0?t.push(selectedShip):selectedShip=g[0]}const i=getZoom();t.forEach(g=>{if(g){const y=createShipFetature(g);r.push(y),((selectedShip==null?void 0:selectedShip.id)==g.id||i>=MAP_ZOOM.shipModelMin)&&createLabelStyle(y)}}),shipsSource.addFeatures(r),handleChangeSelected()},createShipFetature=t=>{const e=(selectedShip==null?void 0:selectedShip.id)||(selectedShipFeature==null?void 0:selectedShipFeature.get("id")),n=fromLonLat([t==null?void 0:t.lon,t==null?void 0:t.lat]),r=new Feature({geometry:new Point(n),shipData:t,id:t.id,name:t.cnname||"未命名船舶",selected:t.id===e,rightIcons:getRightIcons(t),blinking:attentionShips[t.id]||!1,blinkingColor:attentionShipsColor[t.id]||"",color:t.fill||"#04C900",direct:getShipDirectPath(t),isHighlight:!1});return r.setStyle(createShipStyle(r)),r},handleChangeSelected=async()=>{if(!selectedShip)return;const t=getInstall();if(!t)return;let r=cloneDeep(t.getOverlays().getArray()).find(i=>i.get("class")=="ship-overlay-selected");if(console.log("selected----------",r),r){const i=selectedShipElement(selectedShip);await r.setElement(i),await r.setPosition(fromLonLat([selectedShip.lon,selectedShip.lat]))}else r=selectedShipStyle(selectedShip),t.addOverlay(r);setTimeout(()=>{var i;r&&((i=r.get("element"))!=null&&i.parentElement)&&(r.get("element").parentElement.style.display="block")},20)},clearShipList=()=>{const t=getInstall();if(!t||!shipsSource)return;const e=(selectedShip==null?void 0:selectedShip.id)||"";shipsSource.getFeatures().forEach(r=>{r.get("shipData").shipId!==e&&shipsSource.removeFeature(r)});const n=t.getOverlays().getArray();cloneDeep(n).map(r=>{(r.getId()!=="label-"+e||r.getId()!=="selected-"+e)&&(r.setPosition(void 0),t.removeOverlay(r),r.dispose())})},renderShipBlink=(t,e)=>{const n=getInstall();attentionShips=t,attentionShipsColor=e;const r=cloneDeep(n.getOverlays().getArray()),i=cloneDeep(shipsSource.getFeatures());for(const g in attentionShips){const y=attentionShips[g],k=r.find($=>$.getId()==="label-"+g),L=i.find($=>g===$.get("id"));if(k&&L){L.set("blinking",y),L.set("blinkingColor",attentionShipsColor[g]||"");const $=k.getElement(),V=createLabelElement(L),z=V.querySelector(".ship-overlay-line"),re=$==null?void 0:$.querySelector(".ship-overlay-line");$&&$!==V&&(re&&z&&z.replaceWith(re),k.setElement(V))}}},filterShipShow=t=>{const e=getInstall();if(!e)return;const n=shipsSource.getFeatures(),r=selectedShipFeature?selectedShipFeature.get("id"):"",i=n.filter(k=>k.get("id")!==r),g=new Map;t.forEach(k=>{g.set(k.id,!0)});const y=cloneDeep(e.getOverlays().getArray());i.forEach(k=>{const L=k.get("id"),$=y.find(V=>V.getId()==="label-"+L);if(!g.has(L))k.setStyle([]),$&&($.get("element").style.visibility="hidden");else{$&&($.get("element").style.visibility="visible");const V=k.getStyle();(V==null?void 0:V.length)==0&&k.setStyle(createShipStyle(k))}})},renderShipSelected=t=>{if(t){console.log("选中",t);const e=shipsSource.getFeatures().find(n=>n.get("id")===t.id);e&&(selectedShipFeature=e),selectedShip=t,handleChangeSelected()}else console.log("取消选中"),selectedShip=null,selectedShipFeature=null,removeSelectedOverlay()},handleShipMapEvent=debounce((t,e,n)=>{const r=getInstall();if(t){const i=t.get("shipData"),g=t.get("id");if(r.getTargetElement().style.cursor=g?"pointer":"",e==="click"&&(renderShipSelected(i),n&&n(g)),e==="hover"){hoveredShipId&&hoveredShipId!==g&&clearHoverHight(),hoveredShipId=g;const y=shipsSource.getFeatures().find(k=>k.get("id")===hoveredShipId);y==null||y.set("isHighlight",!0),y==null||y.setStyle(createShipStyle(y))}}else r.getTargetElement().style.cursor="",clearHoverHight()},10),clearHoverHight=()=>{const t=hoveredShipId?shipsSource.getFeatures().find(e=>e.get("id")===hoveredShipId):null;hoveredShipId=null,t==null||t.set("isHighlight",!1),t==null||t.setStyle(createShipStyle(t))},removeSelectedOverlay=()=>{console.log("removeSelectedOverlay-------");try{const t=getInstall(),n=cloneDeep(t.getOverlays().getArray()).find(r=>r.get("class")=="ship-overlay-selected");n&&n.setPosition(void 0)}catch(t){console.log(t)}},PORT_LAYER_CLASS_NAME="zh-map-port-layer";let vectorLayer$3,vectorSource$3;const renderPortList=t=>{var e;if(!(!t||t.length===0)){if(vectorSource$3||(vectorSource$3=new VectorSource),vectorSource$3.clear(),selectedPortData){const n=t.find(r=>r.id===selectedPortData.id);n?selectedPortData=n:t.push(selectedPortData)}t.forEach(n=>{renderPortPoint$1(n)}),vectorLayer$3||(vectorLayer$3=new VectorLayer({className:PORT_LAYER_CLASS_NAME,source:vectorSource$3,zIndex:100}),(e=getInstall())==null||e.addLayer(vectorLayer$3))}},renderPortPoint$1=t=>{const e=getZoom(),[n,r]=t.latLon.split(","),i=new Feature({geometry:new Point(fromLonLat([Number(n),Number(r)]))});i.setStyle(setPortStyle$1(t,e,t.id===(selectedPortData==null?void 0:selectedPortData.id))),i.set("portData",t),vectorSource$3.addFeature(i)},setPortStyle$1=(t,e,n)=>{const r=g=>`<svg width="46" height="46" viewBox="0 0 46 46" fill="none" xmlns="http://www.w3.org/2000/svg">
205
205
  <path fill-rule="evenodd" clip-rule="evenodd" d="M22.6563 44.9304C22.5453 44.8844 22.4445 44.817 22.3595 44.7321C22.3595 44.7321 9.36986 31.7424 9.32952 31.6913C7.09059 29.0791 5.64794 25.8802 5.17255 22.4736C4.69716 19.0671 5.20896 15.5957 6.64728 12.471C8.08561 9.34625 10.3902 6.69909 13.2878 4.84325C16.1855 2.98741 19.5548 2.00068 22.9965 2C26.4381 1.99932 29.8078 2.98473 32.7062 4.83943C35.6046 6.69414 37.9102 9.34039 39.3498 12.4646C40.7893 15.5888 41.3025 19.0599 40.8284 22.4666C40.3544 25.8734 38.913 29.0729 36.6751 31.686C36.6401 31.737 23.6531 44.7321 23.6531 44.7321C23.5682 44.817 23.4674 44.8844 23.3564 44.9304C23.2454 44.9763 23.1265 45 23.0063 45C22.8862 45 22.7673 44.9763 22.6563 44.9304Z" fill="${g}"/>
206
206
  <g clip-path="url(#clip0_10059_122082)">
207
207
  <path d="M34.8624 22.8687L32.5874 25.6313L33.4812 25.7125C33.4812 25.7125 30.5562 28.0687 27.9562 28.2312C25.3562 28.3937 24.1374 24.9 24.1374 24.9V19.1312H27.6312V17.425H24.2999V15.15C25.7624 14.6625 26.7374 13.2812 26.7374 11.6562C26.7374 9.625 25.1124 8 23.0812 8H22.9999C20.9687 8 19.3437 9.625 19.3437 11.6562C19.3437 13.2812 20.3999 14.6625 21.7812 15.15V17.425H18.4499V19.1312H21.9437V24.9C21.9437 24.9 20.6437 28.3125 18.0437 28.2312C15.4437 28.0687 12.5187 25.7125 12.5187 25.7125L13.4124 25.6313L11.0562 22.8687L10.2437 26.2812L11.2187 26.0375C11.2187 26.0375 13.1687 29.5313 16.1749 30.8313C19.1812 32.2125 22.1874 33.9187 22.8374 34C23.4874 33.9187 26.4937 32.2125 29.4187 30.8313C32.3437 29.45 34.3749 26.0375 34.3749 26.0375L35.3499 26.2812L34.8624 22.8687ZM23.0812 13.6875C21.9437 13.6875 21.0499 12.7937 21.0499 11.6562C21.0499 10.6 21.9437 9.70625 22.9999 9.70625H23.0812C24.1374 9.70625 25.0312 10.6 25.0312 11.6562C25.1124 12.7937 24.1374 13.6875 23.0812 13.6875Z" fill="white"/>
@@ -212,7 +212,7 @@ hooks.version="2.30.1",setHookCallback(createLocal),hooks.fn=proto,hooks.min=min
212
212
  </clipPath>
213
213
  </defs>
214
214
  </svg>
215
- `,i=()=>`data:image/svg+xml;utf8,${encodeURIComponent(r(n?"#FF5733":"#3370FF"))}`;return new Style({text:new Text({text:t.shortName,font:"12px sans-serif",fill:new Fill({color:n?"#ffffff":"#000000"}),backgroundFill:new Fill({color:n?"#FF5733":"#FFFFFF"}),offsetY:30}),image:new Icon({src:i(),scale:.5*e/10})})},clearPortList=()=>{if(selectedPortFeature$1){console.log("清除非选中的港口");const t=selectedPortFeature$1.get("portData").id;vectorSource$3.getFeatures().forEach(e=>{e.get("portData").id!==t&&vectorSource$3.removeFeature(e)})}else console.log("清除所有港口"),vectorSource$3.clear()},clearSelectedPort$1=()=>{const t=selectedPortFeature$1.get("portData"),e=getZoom();vectorSource$3.getFeatures().forEach(r=>{r.get("portData").id===t.id&&(r==null||r.setStyle(setPortStyle$1(t,e,!1)))}),selectedPortData=null,selectedPortFeature$1=null};let selectedPortFeature$1=null,selectedPortData=null;const selectedPort=t=>{t?(clearPrevSelectedPort$1(),addSelectedPortStyle$1(t)):clearSelectedPort$1()},clearPrevSelectedPort$1=()=>{if(selectedPortFeature$1){const t=selectedPortFeature$1.get("portData"),e=getZoom();selectedPortFeature$1.setStyle(setPortStyle$1(t,e,!1))}},addSelectedPortStyle$1=t=>{const e=vectorSource$3.getFeatures();selectedPortData=t,selectedPortFeature$1=e.find(n=>n.get("portData").id===t.id)},handlePortHover=t=>{const e=getInstall(),n=e.forEachFeatureAtPixel(t,r=>r);n&&n.get("portData")&&(e.getTargetElement().style.cursor="pointer")},DrawEventType={DRAWSTART:"drawstart",DRAWEND:"drawend",DRAWABORT:"drawabort"};class DrawEvent extends BaseEvent{constructor(e,n){super(e),this.feature=n}}function getTraceTargets(t,e){const n=[];for(let r=0;r<e.length;++r){const g=e[r].getGeometry();appendGeometryTraceTargets(t,g,n)}return n}function getSquaredDistance(t,e){return squaredDistance$1(t[0],t[1],e[0],e[1])}function getCoordinate(t,e){const n=t.length;return e<0?t[e+n]:e>=n?t[e-n]:t[e]}function getCumulativeSquaredDistance(t,e,n){let r,i;e<n?(r=e,i=n):(r=n,i=e);const g=Math.ceil(r),y=Math.floor(i);if(g>y){const L=interpolateCoordinate(t,r),$=interpolateCoordinate(t,i);return getSquaredDistance(L,$)}let k=0;if(r<g){const L=interpolateCoordinate(t,r),$=getCoordinate(t,g);k+=getSquaredDistance(L,$)}if(y<i){const L=getCoordinate(t,y),$=interpolateCoordinate(t,i);k+=getSquaredDistance(L,$)}for(let L=g;L<y-1;++L){const $=getCoordinate(t,L),V=getCoordinate(t,L+1);k+=getSquaredDistance($,V)}return k}function appendGeometryTraceTargets(t,e,n){if(e instanceof LineString){appendTraceTarget(t,e.getCoordinates(),!1,n);return}if(e instanceof MultiLineString){const r=e.getCoordinates();for(let i=0,g=r.length;i<g;++i)appendTraceTarget(t,r[i],!1,n);return}if(e instanceof Polygon){const r=e.getCoordinates();for(let i=0,g=r.length;i<g;++i)appendTraceTarget(t,r[i],!0,n);return}if(e instanceof MultiPolygon){const r=e.getCoordinates();for(let i=0,g=r.length;i<g;++i){const y=r[i];for(let k=0,L=y.length;k<L;++k)appendTraceTarget(t,y[k],!0,n)}return}if(e instanceof GeometryCollection){const r=e.getGeometries();for(let i=0;i<r.length;++i)appendGeometryTraceTargets(t,r[i],n);return}}const sharedUpdateInfo={index:-1,endIndex:NaN};function getTraceTargetUpdate(t,e,n,r){const i=t[0],g=t[1];let y=1/0,k=-1,L=NaN;for(let z=0;z<e.targets.length;++z){const re=e.targets[z],oe=re.coordinates;let j=1/0,ie;for(let ae=0;ae<oe.length-1;++ae){const ue=oe[ae],de=oe[ae+1],pe=getPointSegmentRelationship(i,g,ue,de);pe.squaredDistance<j&&(j=pe.squaredDistance,ie=ae+pe.along)}j<y&&(y=j,re.ring&&e.targetIndex===z&&(re.endIndex>re.startIndex?ie<re.startIndex&&(ie+=oe.length):re.endIndex<re.startIndex&&ie>re.startIndex&&(ie-=oe.length)),L=ie,k=z)}const $=e.targets[k];let V=$.ring;if(e.targetIndex===k&&V){const z=interpolateCoordinate($.coordinates,L),re=n.getPixelFromCoordinate(z);distance$1(re,e.startPx)>r&&(V=!1)}if(V){const z=$.coordinates,re=z.length,oe=$.startIndex,j=L;if(oe<j){const ie=getCumulativeSquaredDistance(z,oe,j);getCumulativeSquaredDistance(z,oe,j-re)<ie&&(L-=re)}else{const ie=getCumulativeSquaredDistance(z,oe,j);getCumulativeSquaredDistance(z,oe,j+re)<ie&&(L+=re)}}return sharedUpdateInfo.index=k,sharedUpdateInfo.endIndex=L,sharedUpdateInfo}function appendTraceTarget(t,e,n,r){const i=t[0],g=t[1];for(let y=0,k=e.length-1;y<k;++y){const L=e[y],$=e[y+1],V=getPointSegmentRelationship(i,g,L,$);if(V.squaredDistance===0){const z=y+V.along;r.push({coordinates:e,ring:n,startIndex:z,endIndex:z});return}}}const sharedRel={along:0,squaredDistance:0};function getPointSegmentRelationship(t,e,n,r){const i=n[0],g=n[1],y=r[0],k=r[1],L=y-i,$=k-g;let V=0,z=i,re=g;return(L!==0||$!==0)&&(V=clamp(((t-i)*L+(e-g)*$)/(L*L+$*$),0,1),z+=L*V,re+=$*V),sharedRel.along=V,sharedRel.squaredDistance=toFixed(squaredDistance$1(t,e,z,re),10),sharedRel}function interpolateCoordinate(t,e){const n=t.length;let r=Math.floor(e);const i=e-r;r>=n?r-=n:r<0&&(r+=n);let g=r+1;g>=n&&(g-=n);const y=t[r],k=y[0],L=y[1],$=t[g],V=$[0]-k,z=$[1]-L;return[k+V*i,L+z*i]}class Draw extends PointerInteraction{constructor(e){const n=e;n.stopDown||(n.stopDown=FALSE),super(n),this.on,this.once,this.un,this.shouldHandle_=!1,this.downPx_=null,this.downTimeout_,this.lastDragTime_,this.pointerType_,this.freehand_=!1,this.source_=e.source?e.source:null,this.features_=e.features?e.features:null,this.snapTolerance_=e.snapTolerance?e.snapTolerance:12,this.type_=e.type,this.mode_=getMode(this.type_),this.stopClick_=!!e.stopClick,this.minPoints_=e.minPoints?e.minPoints:this.mode_==="Polygon"?3:2,this.maxPoints_=this.mode_==="Circle"?2:e.maxPoints?e.maxPoints:1/0,this.finishCondition_=e.finishCondition?e.finishCondition:TRUE,this.geometryLayout_=e.geometryLayout?e.geometryLayout:"XY";let r=e.geometryFunction;if(!r){const i=this.mode_;if(i==="Circle")r=(g,y,k)=>{const L=y||new Circle([NaN,NaN]),$=fromUserCoordinate(g[0]),V=squaredDistance($,fromUserCoordinate(g[g.length-1]));return L.setCenterAndRadius($,Math.sqrt(V),this.geometryLayout_),L};else{let g;i==="Point"?g=Point:i==="LineString"?g=LineString:i==="Polygon"&&(g=Polygon),r=(y,k,L)=>(k?i==="Polygon"?y[0].length?k.setCoordinates([y[0].concat([y[0][0]])],this.geometryLayout_):k.setCoordinates([],this.geometryLayout_):k.setCoordinates(y,this.geometryLayout_):k=new g(y,this.geometryLayout_),k)}}this.geometryFunction_=r,this.dragVertexDelay_=e.dragVertexDelay!==void 0?e.dragVertexDelay:500,this.finishCoordinate_=null,this.sketchFeature_=null,this.sketchPoint_=null,this.sketchCoords_=null,this.sketchLine_=null,this.sketchLineCoords_=null,this.squaredClickTolerance_=e.clickTolerance?e.clickTolerance*e.clickTolerance:36,this.overlay_=new VectorLayer({source:new VectorSource({useSpatialIndex:!1,wrapX:e.wrapX?e.wrapX:!1}),style:e.style?e.style:getDefaultStyleFunction(),updateWhileInteracting:!0}),this.geometryName_=e.geometryName,this.condition_=e.condition?e.condition:noModifierKeys,this.freehandCondition_,e.freehand?this.freehandCondition_=always:this.freehandCondition_=e.freehandCondition?e.freehandCondition:shiftKeyOnly,this.traceCondition_,this.setTrace(e.trace||!1),this.traceState_={active:!1},this.traceSource_=e.traceSource||e.source||null,this.addChangeListener(InteractionProperty.ACTIVE,this.updateState_)}setTrace(e){let n;e?e===!0?n=always:n=e:n=never,this.traceCondition_=n}setMap(e){super.setMap(e),this.updateState_()}getOverlay(){return this.overlay_}handleEvent(e){e.originalEvent.type===EventType.CONTEXTMENU&&e.originalEvent.preventDefault(),this.freehand_=this.mode_!=="Point"&&this.freehandCondition_(e);let n=e.type===MapBrowserEventType.POINTERMOVE,r=!0;return!this.freehand_&&this.lastDragTime_&&e.type===MapBrowserEventType.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=e.pixel,this.shouldHandle_=!this.freehand_,n=!0):this.lastDragTime_=void 0,this.shouldHandle_&&this.downTimeout_!==void 0&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0)),this.freehand_&&e.type===MapBrowserEventType.POINTERDRAG&&this.sketchFeature_!==null?(this.addToDrawing_(e.coordinate),r=!1):this.freehand_&&e.type===MapBrowserEventType.POINTERDOWN?r=!1:n&&this.getPointerCount()<2?(r=e.type===MapBrowserEventType.POINTERMOVE,r&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):(e.originalEvent.pointerType==="mouse"||e.type===MapBrowserEventType.POINTERDRAG&&this.downTimeout_===void 0)&&this.handlePointerMove_(e)):e.type===MapBrowserEventType.DBLCLICK&&(r=!1),super.handleEvent(e)&&r}handleDownEvent(e){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=e.pixel,this.finishCoordinate_||this.startDrawing_(e.coordinate),!0):this.condition_(e)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(()=>{this.handlePointerMove_(new MapBrowserEvent(MapBrowserEventType.POINTERMOVE,e.map,e.originalEvent,!1,e.frameState))},this.dragVertexDelay_),this.downPx_=e.pixel,!0):(this.lastDragTime_=void 0,!1)}deactivateTrace_(){this.traceState_={active:!1}}toggleTraceState_(e){if(!this.traceSource_||!this.traceCondition_(e))return;if(this.traceState_.active){this.deactivateTrace_();return}const n=this.getMap(),r=n.getCoordinateFromPixel([e.pixel[0]-this.snapTolerance_,e.pixel[1]+this.snapTolerance_]),i=n.getCoordinateFromPixel([e.pixel[0]+this.snapTolerance_,e.pixel[1]-this.snapTolerance_]),g=boundingExtent([r,i]),y=this.traceSource_.getFeaturesInExtent(g);if(y.length===0)return;const k=getTraceTargets(e.coordinate,y);k.length&&(this.traceState_={active:!0,startPx:e.pixel.slice(),targets:k,targetIndex:-1})}addOrRemoveTracedCoordinates_(e,n){const r=e.startIndex<=e.endIndex,i=e.startIndex<=n;r===i?r&&n>e.endIndex||!r&&n<e.endIndex?this.addTracedCoordinates_(e,e.endIndex,n):(r&&n<e.endIndex||!r&&n>e.endIndex)&&this.removeTracedCoordinates_(n,e.endIndex):(this.removeTracedCoordinates_(e.startIndex,e.endIndex),this.addTracedCoordinates_(e,e.startIndex,n))}removeTracedCoordinates_(e,n){if(e===n)return;let r=0;if(e<n){const i=Math.ceil(e);let g=Math.floor(n);g===n&&(g-=1),r=g-i+1}else{const i=Math.floor(e);let g=Math.ceil(n);g===n&&(g+=1),r=i-g+1}r>0&&this.removeLastPoints_(r)}addTracedCoordinates_(e,n,r){if(n===r)return;const i=[];if(n<r){const g=Math.ceil(n);let y=Math.floor(r);y===r&&(y-=1);for(let k=g;k<=y;++k)i.push(getCoordinate(e.coordinates,k))}else{const g=Math.floor(n);let y=Math.ceil(r);y===r&&(y+=1);for(let k=g;k>=y;--k)i.push(getCoordinate(e.coordinates,k))}i.length&&this.appendCoordinates(i)}updateTrace_(e){const n=this.traceState_;if(!n.active||n.targetIndex===-1&&distance$1(n.startPx,e.pixel)<this.snapTolerance_)return;const r=getTraceTargetUpdate(e.coordinate,n,this.getMap(),this.snapTolerance_);if(n.targetIndex!==r.index){if(n.targetIndex!==-1){const L=n.targets[n.targetIndex];this.removeTracedCoordinates_(L.startIndex,L.endIndex)}const k=n.targets[r.index];this.addTracedCoordinates_(k,k.startIndex,r.endIndex)}else{const k=n.targets[n.targetIndex];this.addOrRemoveTracedCoordinates_(k,r.endIndex)}n.targetIndex=r.index;const i=n.targets[n.targetIndex];i.endIndex=r.endIndex;const g=interpolateCoordinate(i.coordinates,i.endIndex),y=this.getMap().getPixelFromCoordinate(g);e.coordinate=g,e.pixel=[Math.round(y[0]),Math.round(y[1])]}handleUpEvent(e){let n=!0;if(this.getPointerCount()===0){this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(e);const r=this.traceState_.active;if(this.toggleTraceState_(e),this.shouldHandle_){const i=!this.finishCoordinate_;i&&this.startDrawing_(e.coordinate),!i&&this.freehand_?this.finishDrawing():!this.freehand_&&(!i||this.mode_==="Point")&&(this.atFinish_(e.pixel,r)?this.finishCondition_(e)&&this.finishDrawing():this.addToDrawing_(e.coordinate)),n=!1}else this.freehand_&&this.abortDrawing()}return!n&&this.stopClick_&&e.preventDefault(),n}handlePointerMove_(e){if(this.pointerType_=e.originalEvent.pointerType,this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){const n=this.downPx_,r=e.pixel,i=n[0]-r[0],g=n[1]-r[1],y=i*i+g*g;if(this.shouldHandle_=this.freehand_?y>this.squaredClickTolerance_:y<=this.squaredClickTolerance_,!this.shouldHandle_)return}if(!this.finishCoordinate_){this.createOrUpdateSketchPoint_(e.coordinate.slice());return}this.updateTrace_(e),this.modifyDrawing_(e.coordinate)}atFinish_(e,n){let r=!1;if(this.sketchFeature_){let i=!1,g=[this.finishCoordinate_];const y=this.mode_;if(y==="Point")r=!0;else if(y==="Circle")r=this.sketchCoords_.length===2;else if(y==="LineString")i=!n&&this.sketchCoords_.length>this.minPoints_;else if(y==="Polygon"){const k=this.sketchCoords_;i=k[0].length>this.minPoints_,g=[k[0][0],k[0][k[0].length-2]],n?g=[k[0][0]]:g=[k[0][0],k[0][k[0].length-2]]}if(i){const k=this.getMap();for(let L=0,$=g.length;L<$;L++){const V=g[L],z=k.getPixelFromCoordinate(V),re=e[0]-z[0],oe=e[1]-z[1],j=this.freehand_?1:this.snapTolerance_;if(r=Math.sqrt(re*re+oe*oe)<=j,r){this.finishCoordinate_=V;break}}}}return r}createOrUpdateSketchPoint_(e){this.sketchPoint_?this.sketchPoint_.getGeometry().setCoordinates(e):(this.sketchPoint_=new Feature(new Point(e)),this.updateSketchFeatures_())}createOrUpdateCustomSketchLine_(e){this.sketchLine_||(this.sketchLine_=new Feature);const n=e.getLinearRing(0);let r=this.sketchLine_.getGeometry();r?(r.setFlatCoordinates(n.getLayout(),n.getFlatCoordinates()),r.changed()):(r=new LineString(n.getFlatCoordinates(),n.getLayout()),this.sketchLine_.setGeometry(r))}startDrawing_(e){const n=this.getMap().getView().getProjection(),r=getStrideForLayout(this.geometryLayout_);for(;e.length<r;)e.push(0);this.finishCoordinate_=e,this.mode_==="Point"?this.sketchCoords_=e.slice():this.mode_==="Polygon"?(this.sketchCoords_=[[e.slice(),e.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[e.slice(),e.slice()],this.sketchLineCoords_&&(this.sketchLine_=new Feature(new LineString(this.sketchLineCoords_)));const i=this.geometryFunction_(this.sketchCoords_,void 0,n);this.sketchFeature_=new Feature,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(i),this.updateSketchFeatures_(),this.dispatchEvent(new DrawEvent(DrawEventType.DRAWSTART,this.sketchFeature_))}modifyDrawing_(e){const n=this.getMap(),r=this.sketchFeature_.getGeometry(),i=n.getView().getProjection(),g=getStrideForLayout(this.geometryLayout_);let y,k;for(;e.length<g;)e.push(0);this.mode_==="Point"?k=this.sketchCoords_:this.mode_==="Polygon"?(y=this.sketchCoords_[0],k=y[y.length-1],this.atFinish_(n.getPixelFromCoordinate(e))&&(e=this.finishCoordinate_.slice())):(y=this.sketchCoords_,k=y[y.length-1]),k[0]=e[0],k[1]=e[1],this.geometryFunction_(this.sketchCoords_,r,i),this.sketchPoint_&&this.sketchPoint_.getGeometry().setCoordinates(e),r.getType()==="Polygon"&&this.mode_!=="Polygon"?this.createOrUpdateCustomSketchLine_(r):this.sketchLineCoords_&&this.sketchLine_.getGeometry().setCoordinates(this.sketchLineCoords_),this.updateSketchFeatures_()}addToDrawing_(e){const n=this.sketchFeature_.getGeometry(),r=this.getMap().getView().getProjection();let i,g;const y=this.mode_;return y==="LineString"||y==="Circle"?(this.finishCoordinate_=e.slice(),g=this.sketchCoords_,g.length>=this.maxPoints_&&(this.freehand_?g.pop():i=!0),g.push(e.slice()),this.geometryFunction_(g,n,r)):y==="Polygon"&&(g=this.sketchCoords_[0],g.length>=this.maxPoints_&&(this.freehand_?g.pop():i=!0),g.push(e.slice()),i&&(this.finishCoordinate_=g[0]),this.geometryFunction_(this.sketchCoords_,n,r)),this.createOrUpdateSketchPoint_(e.slice()),this.updateSketchFeatures_(),i?this.finishDrawing():this.sketchFeature_}removeLastPoints_(e){if(!this.sketchFeature_)return;const n=this.sketchFeature_.getGeometry(),r=this.getMap().getView().getProjection(),i=this.mode_;for(let g=0;g<e;++g){let y;if(i==="LineString"||i==="Circle"){if(y=this.sketchCoords_,y.splice(-2,1),y.length>=2){this.finishCoordinate_=y[y.length-2].slice();const k=this.finishCoordinate_.slice();y[y.length-1]=k,this.createOrUpdateSketchPoint_(k)}this.geometryFunction_(y,n,r),n.getType()==="Polygon"&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(n)}else if(i==="Polygon"){y=this.sketchCoords_[0],y.splice(-2,1);const k=this.sketchLine_.getGeometry();if(y.length>=2){const L=y[y.length-2].slice();y[y.length-1]=L,this.createOrUpdateSketchPoint_(L)}k.setCoordinates(y),this.geometryFunction_(this.sketchCoords_,n,r)}if(y.length===1){this.abortDrawing();break}}this.updateSketchFeatures_()}removeLastPoint(){this.removeLastPoints_(1)}finishDrawing(){const e=this.abortDrawing_();if(!e)return null;let n=this.sketchCoords_;const r=e.getGeometry(),i=this.getMap().getView().getProjection();return this.mode_==="LineString"?(n.pop(),this.geometryFunction_(n,r,i)):this.mode_==="Polygon"&&(n[0].pop(),this.geometryFunction_(n,r,i),n=r.getCoordinates()),this.type_==="MultiPoint"?e.setGeometry(new MultiPoint([n])):this.type_==="MultiLineString"?e.setGeometry(new MultiLineString([n])):this.type_==="MultiPolygon"&&e.setGeometry(new MultiPolygon([n])),this.dispatchEvent(new DrawEvent(DrawEventType.DRAWEND,e)),this.features_&&this.features_.push(e),this.source_&&this.source_.addFeature(e),e}abortDrawing_(){this.finishCoordinate_=null;const e=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),this.deactivateTrace_(),e}abortDrawing(){const e=this.abortDrawing_();e&&this.dispatchEvent(new DrawEvent(DrawEventType.DRAWABORT,e))}appendCoordinates(e){const n=this.mode_,r=!this.sketchFeature_;r&&this.startDrawing_(e[0]);let i;if(n==="LineString"||n==="Circle")i=this.sketchCoords_;else if(n==="Polygon")i=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[];else return;r&&i.shift(),i.pop();for(let y=0;y<e.length;y++)this.addToDrawing_(e[y]);const g=e[e.length-1];this.sketchFeature_=this.addToDrawing_(g),this.modifyDrawing_(g)}extend(e){const r=e.getGeometry();this.sketchFeature_=e,this.sketchCoords_=r.getCoordinates();const i=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=i.slice(),this.sketchCoords_.push(i.slice()),this.sketchPoint_=new Feature(new Point(i)),this.updateSketchFeatures_(),this.dispatchEvent(new DrawEvent(DrawEventType.DRAWSTART,this.sketchFeature_))}updateSketchFeatures_(){const e=[];this.sketchFeature_&&e.push(this.sketchFeature_),this.sketchLine_&&e.push(this.sketchLine_),this.sketchPoint_&&e.push(this.sketchPoint_);const n=this.overlay_.getSource();n.clear(!0),n.addFeatures(e)}updateState_(){const e=this.getMap(),n=this.getActive();(!e||!n)&&this.abortDrawing(),this.overlay_.setMap(n?e:null)}}function getDefaultStyleFunction(){const t=createEditingStyle();return function(e,n){return t[e.getGeometry().getType()]}}function getMode(t){switch(t){case"Point":case"MultiPoint":return"Point";case"LineString":case"MultiLineString":return"LineString";case"Polygon":case"MultiPolygon":return"Polygon";case"Circle":return"Circle";default:throw new Error("Invalid type: "+t)}}const disableDoubleClickZoom=()=>{getInstall().getInteractions().forEach(e=>{e instanceof DoubleClickZoom&&e.setActive(!1)})},enableDoubleClickZoom=()=>{getInstall().getInteractions().forEach(e=>{e instanceof DoubleClickZoom&&e.setActive(!0)})},props=vue.ref(),setProps=t=>{props.value=t},getProps=()=>props.value,measureHistory=vue.ref([]),unit=vue.ref("km"),setUnit=t=>{unit.value=t};let helpTooltipElement$1;const state=vue.ref(!1),open$1=()=>{initMapLayer(),disableDoubleClickZoom(),changeCursor("pointer");const t=getInstall();t.on("pointermove",pointerMoveHandler$1),t.getViewport().addEventListener("mouseout",()=>{helpTooltipElement$1&&helpTooltipElement$1.classList.add("hidden")}),addInteraction(),state.value=!0};let vectorSource$2,vectorLayer$2;const initMapLayer=()=>{vectorSource$2=new VectorSource,vectorLayer$2=new VectorLayer({source:vectorSource$2,zIndex:1e3,style:{"fill-color":"rgba(255, 255, 255, 0.2)","stroke-color":"#ffcc33","stroke-width":2,"circle-radius":7,"circle-fill-color":"#ffcc33"}}),getInstall().addLayer(vectorLayer$2)};let sketch$1,helpTooltip;const pointerMoveHandler$1=t=>{if(t.dragging)return;let e="点击选择起点";sketch$1&&(e="单击继续,双击结束"),helpTooltipElement$1&&(helpTooltipElement$1.innerHTML=e,helpTooltip.setPosition(t.coordinate),helpTooltipElement$1.classList.remove("hidden"))},changeCursor=t=>{getInstall().getTargetElement().style.cursor=t};let draw$1;const addInteraction=()=>{draw$1=new Draw({source:vectorSource$2,type:"LineString",style:new Style({fill:new Fill({color:"rgba(255, 255, 255, 0.2)"}),stroke:new Stroke({color:"rgba(255,204,51)",lineDash:[10,10],width:2}),image:new CircleStyle({radius:5,stroke:new Stroke({color:"rgba(0, 0, 0, 0.7)"}),fill:new Fill({color:"rgba(255, 255, 255, 0.2)"})})}),condition:e=>e.originalEvent.target.tagName!=="DIV"}),getInstall().addInteraction(draw$1),createMeasureTooltip$1(),createHelpTooltip$1();let t;draw$1.on("drawstart",function(e){var r;sketch$1=e.feature,sketch$1.set("randomId",generateRandomId());let n;t=(r=sketch$1.getGeometry())==null?void 0:r.on("change",function(i){const g=i.target,y=computedDistance(g,unit.value);n=g.getLastCoordinate(),measureTooltipElement$1&&y&&(measureTooltipElement$1.innerHTML=y),measureTooltip$1.setPosition(n)})}),draw$1.on("drawend",function(){var e,n,r;if(measureTooltipElement$1&&(measureTooltipElement$1.className="ol-tooltip ol-tooltip-static ol-tooltip-measure"),measureTooltipElement$1!=null&&measureTooltipElement$1.innerHTML){const i=(sketch$1==null?void 0:sketch$1.get("randomId"))||generateRandomId();measureHistory.value.push({id:i,value:measureTooltipElement$1==null?void 0:measureTooltipElement$1.innerHTML}),measureTooltipElement$1.innerHTML=`${measureTooltipElement$1.innerHTML}<div class="ol-tooltip-delete-button" data-id="${i}"><i class="map-iconfont icon-delete"></i></div>`}(e=document.querySelector(".ol-selectable:has(.ol-tooltip-delete-button):last-child .ol-tooltip-delete-button"))==null||e.addEventListener("click",i=>{var y;i.preventDefault(),i.stopPropagation();const g=(y=i.target)==null?void 0:y.getAttribute("data-id");g&&deleteLine(g)}),measureTooltip$1.setOffset([0,-7]),sketch$1=null,measureTooltipElement$1=null,createMeasureTooltip$1(),t&&unByKey(t),(n=getProps())!=null&&n.lineDrawEnd&&((r=getProps())==null||r.lineDrawEnd(measureHistory.value))})},generateRandomId=()=>Math.random().toString(36).substring(2,9);let measureTooltipElement$1,measureTooltip$1;const createMeasureTooltip$1=()=>{measureTooltipElement$1!=null&&measureTooltipElement$1.parentNode&&measureTooltipElement$1.parentNode.removeChild(measureTooltipElement$1),measureTooltipElement$1=document.createElement("div"),measureTooltipElement$1.className="ol-tooltip ol-tooltip-measure",measureTooltip$1=new Overlay({element:measureTooltipElement$1,offset:[0,-15],positioning:"bottom-center",stopEvent:!1,insertFirst:!1}),getInstall().addOverlay(measureTooltip$1)},createHelpTooltip$1=()=>{helpTooltipElement$1!=null&&helpTooltipElement$1.parentNode&&helpTooltipElement$1.parentNode.removeChild(helpTooltipElement$1),helpTooltipElement$1=document.createElement("div"),helpTooltipElement$1.className="ol-tooltip hidden",helpTooltip=new Overlay({element:helpTooltipElement$1,offset:[15,0],positioning:"center-left"}),getInstall().addOverlay(helpTooltip)},close$1=()=>{measureHistory.value.forEach((t,e)=>{var i,g;const n=document.querySelectorAll(".ol-tooltip.ol-tooltip-static.ol-tooltip-measure");n[e]&&((g=(i=n[e])==null?void 0:i.parentNode)==null||g.removeChild(n[e]));const r=vectorSource$2.getFeatures();r[e]&&vectorSource$2.removeFeature(r[e])}),removeInteraction(),enableDoubleClickZoom(),state.value=!1},deleteLine=t=>{var n,r,i,g;const e=measureHistory.value.findIndex(y=>y.id===t);if(e!==-1){measureHistory.value.splice(e,1);const y=document.querySelectorAll(".ol-tooltip.ol-tooltip-static.ol-tooltip-measure");y[e]&&((r=(n=y[e])==null?void 0:n.parentNode)==null||r.removeChild(y[e]));const k=vectorSource$2.getFeatures();k[e]&&vectorSource$2.removeFeature(k[e])}(i=getProps())!=null&&i.lineDrawEnd&&((g=getProps())==null||g.lineDrawEnd(measureHistory.value))},computedDistance=(t,e)=>{const r=getLength(t);let i="";switch(e){case"m":i=`${Math.round(r*100)/100} m`;break;case"km":i=`${Math.round(r/1e3*100)/100} km`;break;case"nm":i=`${Math.round(r/1.852*100)/100} nm`;break}return i},removeInteraction=()=>{measureHistory.value=[],document.querySelectorAll(".ol-tooltip.ol-tooltip-static").forEach(e=>{var n;(n=e==null?void 0:e.parentNode)==null||n.removeChild(e)}),vectorSource$2.clear();const t=getInstall();if(draw$1){const e=t.getInteractions().getArray().find(n=>getUid(n)===getUid(draw$1));e&&t.removeInteraction(e)}t.removeLayer(vectorLayer$2),helpTooltipElement$1!=null&&helpTooltipElement$1.parentNode&&helpTooltipElement$1.parentNode.removeChild(helpTooltipElement$1),measureTooltipElement$1!=null&&measureTooltipElement$1.parentNode&&measureTooltipElement$1.parentNode.removeChild(measureTooltipElement$1)},getState=()=>state.value,drawLine={open:open$1,close:close$1,deleteLine,setUnit,getState},mapInstance=vue.ref(),getInstall=()=>mapInstance.value,getView=()=>getInstall().getView(),getZoom=()=>{var t;return(t=getView())==null?void 0:t.getZoom()},setZoom=t=>{var e;(e=getView())==null||e.setZoom(t)},setCenter=(t,e)=>{var n;(n=getView())==null||n.setCenter(fromLonLat([t,e]))},getCenter=()=>{var e;const t=(e=getView())==null?void 0:e.getCenter();return toLonLat(t)},getSize=()=>{var t;return(t=getInstall())==null?void 0:t.getSize()},BASE_LAYER_MAP=new Map$2,initMap=t=>{setBaseLayerMap(t);const e={zoom:t.zoom,center:fromLonLat(t.center),minZoom:MAP_ZOOM.min,maxZoom:MAP_ZOOM.max,constrainResolution:!0,enableRotation:!1,multiWorld:!0},n=new Map$2({target:"map",controls:defaults$2({zoom:!1}),layers:[BASE_LAYER_MAP.get("vectorTile"),BASE_LAYER_MAP.get("vectorTileMark"),BASE_LAYER_MAP.get("satelliteImgTile"),BASE_LAYER_MAP.get("satelliteImgTileMark")],view:new View(e)});mapInstance.value=n,setBaseMapEvent(n,t)},setBaseLayerMap=t=>{BASE_LAYER_MAP.set("vectorTile",new TileLayer({source:new XYZ({url:BASE_MAP_LINK.vectorTile}),visible:t.layerType==="vector",zIndex:0,preload:1,className:"vector"})),BASE_LAYER_MAP.set("vectorTileMark",new TileLayer({source:new XYZ({url:BASE_MAP_LINK.vectorTileMark}),visible:t.layerType==="vector",zIndex:1,preload:1,className:"vector"})),BASE_LAYER_MAP.set("satelliteImgTile",new TileLayer({source:new XYZ({url:BASE_MAP_LINK.satelliteImgTile}),visible:t.layerType==="satellite",zIndex:0,preload:1,className:"satellite"})),BASE_LAYER_MAP.set("satelliteImgTileMark",new TileLayer({source:new XYZ({url:BASE_MAP_LINK.satelliteImgTileMark}),visible:t.layerType==="satellite",zIndex:1,preload:1,className:"satellite"})),BASE_LAYER_MAP.set("greenMark",new TileLayer({source:new XYZ({url:BASE_MAP_LINK.greenTile}),visible:t.showGreenLayer,zIndex:2,className:"greenTile"}))},setBaseMapEvent=(t,e)=>{t.on("moveend",()=>{var r;const n=getZoom();(r=e.mapMoveEnd)==null||r.call(e,n),reRenderTrackLine()}),t.on("pointermove",n=>{const r=t.getEventPixel(n.originalEvent),i=t.forEachFeatureAtPixel(r,g=>g);handleShipMapEvent(i,"hover"),handleTrackMapEvent(i,"hover",n),i&&handlePortHover(r)}),t.on("movestart",()=>{console.log("movestart-----------------------"),removeSelectedOverlay()}),t.on("click",debounce(n=>{if(console.log("1",drawLine.getState()),drawLine.getState())return;const r=t.getEventPixel(n.originalEvent),i=t.forEachFeatureAtPixel(r,g=>{if(g!=null&&g.get("shipData")||g!=null&&g.get("portData"))return g});if(console.log("2",i),!!i){if(n.preventDefault(),n.stopPropagation(),i.get("shipData"))handleShipMapEvent(i,"click",e==null?void 0:e.selectShip);else if(i.get("portData")){const g=i.get("portData");selectedPort(g),e==null||e.selectPort(g)}}},150))},_hoisted_1$7={id:"scale-line-container"},_sfc_main$9=vue.defineComponent({__name:"scaleLine",setup(t,{expose:e}){return e({setScaleLine:r=>{r||(r="metric");const i=new ScaleLine$1({units:r}),g=document.getElementById("scale-line-container");g&&(i.setTarget(g),getInstall().addControl(i))}}),(r,i)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$7))}}),ScaleLine=_export_sfc(_sfc_main$9,[["__scopeId","data-v-31ff8293"]]),_hoisted_1$6={class:"zoom"},_sfc_main$8=vue.defineComponent({__name:"zoomControl",setup(t){const e=vue.inject("mapInstance"),n=()=>{if(e!=null&&e.value){const i=getZoom();if(!i)return;setZoom(i+1)}},r=()=>{if(e!=null&&e.value){const i=getZoom();if(!i)return;setZoom(i-1)}};return(i,g)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$6,[vue.createElementVNode("div",{class:"button big-button",onClick:n}," + "),vue.createElementVNode("div",{class:"button small-button",onClick:r}," - ")]))}}),ZoomControl=_export_sfc(_sfc_main$8,[["__scopeId","data-v-37968fef"]]),getLayers=()=>{var t;return(t=getInstall())==null?void 0:t.getLayers()},layerType=vue.ref("vector"),getShowLayerType=()=>layerType.value,setShowLayerType=t=>{layerType.value=t;const e=getLayers();e&&e.getArray().forEach(n=>{n.setVisible(n.className_===t)})},showGreenTile=vue.ref(),getGreenTileVisible=()=>showGreenTile.value,setGreenTileVisible=t=>{if(t!==showGreenTile.value){if(t){const e=getLayers();if(!e.getArray().find(r=>r.className_==="greenTile")){const r=new TileLayer({source:new XYZ({url:BASE_MAP_LINK.greenTile}),visible:t,zIndex:2,className:"greenTile"});e.push(r)}}else{const e=getLayers(),n=e.getArray().find(r=>r.className_==="greenTile");n&&e.remove(n)}showGreenTile.value=t}};let storeFeature;const open=()=>{init()},init=()=>{initLayer(),createMeasureTooltip(),createHelpTooltip(),initDraw()};let vectorLayer$1=null,vectorSource$1=null;const initLayer=()=>{if(vectorLayer$1||vectorSource$1)return;const t=new VectorSource,e=new VectorLayer({source:t,style:new Style({stroke:new Stroke({color:"#fbcc33",width:2})})});vectorLayer$1=e,vectorSource$1=t;const n=getInstall();n.on("pointermove",pointerMoveHandler),n.addLayer(e),n.on(["dblclick"],function(r){draw&&(r.stopPropagation(),r.preventDefault())})};let sketch;const pointerMoveHandler=t=>{if(t.dragging)return;const e=sketch?"单击继续,双击结束":"点击选择起点";helpTooltipElement&&(helpTooltipElement.innerHTML=e,tipOverlay.setPosition(t.coordinate))};let draw,lineLimitError=!1;const initDraw=()=>{if(storeFeature){helpTooltipElement!=null&&helpTooltipElement.parentNode&&helpTooltipElement.parentNode.removeChild(helpTooltipElement);const e=storeFeature.getGeometry();if(!e)return;const n=computedArea(e,"nm");measureTooltipElement&&(measureTooltipElement.innerHTML=`
215
+ `,i=()=>`data:image/svg+xml;utf8,${encodeURIComponent(r(n?"#FF5733":"#3370FF"))}`;return new Style({text:new Text({text:t.shortName,font:"12px sans-serif",fill:new Fill({color:n?"#ffffff":"#000000"}),backgroundFill:new Fill({color:n?"#FF5733":"#FFFFFF"}),offsetY:30}),image:new Icon({src:i(),scale:.5*e/10})})},clearPortList=()=>{if(selectedPortFeature$1){console.log("清除非选中的港口");const t=selectedPortFeature$1.get("portData").id;vectorSource$3.getFeatures().forEach(e=>{e.get("portData").id!==t&&vectorSource$3.removeFeature(e)})}else console.log("清除所有港口"),vectorSource$3.clear()},clearSelectedPort$1=()=>{const t=selectedPortFeature$1==null?void 0:selectedPortFeature$1.get("portData"),e=getZoom();t&&vectorSource$3.getFeatures().forEach(r=>{r.get("portData").id===t.id&&(r==null||r.setStyle(setPortStyle$1(t,e,!1)))}),selectedPortData=null,selectedPortFeature$1=null};let selectedPortFeature$1=null,selectedPortData=null;const selectedPort=t=>{t?(clearPrevSelectedPort$1(),addSelectedPortStyle$1(t)):clearSelectedPort$1()},clearPrevSelectedPort$1=()=>{if(selectedPortFeature$1){const t=selectedPortFeature$1==null?void 0:selectedPortFeature$1.get("portData"),e=getZoom();selectedPortFeature$1.setStyle(setPortStyle$1(t,e,!1))}},addSelectedPortStyle$1=t=>{const e=vectorSource$3.getFeatures();selectedPortData=t,selectedPortFeature$1=e.find(n=>n.get("portData").id===t.id)},handlePortHover=t=>{const e=getInstall(),n=e.forEachFeatureAtPixel(t,r=>r);n&&n.get("portData")&&(e.getTargetElement().style.cursor="pointer")},DrawEventType={DRAWSTART:"drawstart",DRAWEND:"drawend",DRAWABORT:"drawabort"};class DrawEvent extends BaseEvent{constructor(e,n){super(e),this.feature=n}}function getTraceTargets(t,e){const n=[];for(let r=0;r<e.length;++r){const g=e[r].getGeometry();appendGeometryTraceTargets(t,g,n)}return n}function getSquaredDistance(t,e){return squaredDistance$1(t[0],t[1],e[0],e[1])}function getCoordinate(t,e){const n=t.length;return e<0?t[e+n]:e>=n?t[e-n]:t[e]}function getCumulativeSquaredDistance(t,e,n){let r,i;e<n?(r=e,i=n):(r=n,i=e);const g=Math.ceil(r),y=Math.floor(i);if(g>y){const L=interpolateCoordinate(t,r),$=interpolateCoordinate(t,i);return getSquaredDistance(L,$)}let k=0;if(r<g){const L=interpolateCoordinate(t,r),$=getCoordinate(t,g);k+=getSquaredDistance(L,$)}if(y<i){const L=getCoordinate(t,y),$=interpolateCoordinate(t,i);k+=getSquaredDistance(L,$)}for(let L=g;L<y-1;++L){const $=getCoordinate(t,L),V=getCoordinate(t,L+1);k+=getSquaredDistance($,V)}return k}function appendGeometryTraceTargets(t,e,n){if(e instanceof LineString){appendTraceTarget(t,e.getCoordinates(),!1,n);return}if(e instanceof MultiLineString){const r=e.getCoordinates();for(let i=0,g=r.length;i<g;++i)appendTraceTarget(t,r[i],!1,n);return}if(e instanceof Polygon){const r=e.getCoordinates();for(let i=0,g=r.length;i<g;++i)appendTraceTarget(t,r[i],!0,n);return}if(e instanceof MultiPolygon){const r=e.getCoordinates();for(let i=0,g=r.length;i<g;++i){const y=r[i];for(let k=0,L=y.length;k<L;++k)appendTraceTarget(t,y[k],!0,n)}return}if(e instanceof GeometryCollection){const r=e.getGeometries();for(let i=0;i<r.length;++i)appendGeometryTraceTargets(t,r[i],n);return}}const sharedUpdateInfo={index:-1,endIndex:NaN};function getTraceTargetUpdate(t,e,n,r){const i=t[0],g=t[1];let y=1/0,k=-1,L=NaN;for(let z=0;z<e.targets.length;++z){const re=e.targets[z],oe=re.coordinates;let j=1/0,ie;for(let ae=0;ae<oe.length-1;++ae){const ue=oe[ae],de=oe[ae+1],pe=getPointSegmentRelationship(i,g,ue,de);pe.squaredDistance<j&&(j=pe.squaredDistance,ie=ae+pe.along)}j<y&&(y=j,re.ring&&e.targetIndex===z&&(re.endIndex>re.startIndex?ie<re.startIndex&&(ie+=oe.length):re.endIndex<re.startIndex&&ie>re.startIndex&&(ie-=oe.length)),L=ie,k=z)}const $=e.targets[k];let V=$.ring;if(e.targetIndex===k&&V){const z=interpolateCoordinate($.coordinates,L),re=n.getPixelFromCoordinate(z);distance$1(re,e.startPx)>r&&(V=!1)}if(V){const z=$.coordinates,re=z.length,oe=$.startIndex,j=L;if(oe<j){const ie=getCumulativeSquaredDistance(z,oe,j);getCumulativeSquaredDistance(z,oe,j-re)<ie&&(L-=re)}else{const ie=getCumulativeSquaredDistance(z,oe,j);getCumulativeSquaredDistance(z,oe,j+re)<ie&&(L+=re)}}return sharedUpdateInfo.index=k,sharedUpdateInfo.endIndex=L,sharedUpdateInfo}function appendTraceTarget(t,e,n,r){const i=t[0],g=t[1];for(let y=0,k=e.length-1;y<k;++y){const L=e[y],$=e[y+1],V=getPointSegmentRelationship(i,g,L,$);if(V.squaredDistance===0){const z=y+V.along;r.push({coordinates:e,ring:n,startIndex:z,endIndex:z});return}}}const sharedRel={along:0,squaredDistance:0};function getPointSegmentRelationship(t,e,n,r){const i=n[0],g=n[1],y=r[0],k=r[1],L=y-i,$=k-g;let V=0,z=i,re=g;return(L!==0||$!==0)&&(V=clamp(((t-i)*L+(e-g)*$)/(L*L+$*$),0,1),z+=L*V,re+=$*V),sharedRel.along=V,sharedRel.squaredDistance=toFixed(squaredDistance$1(t,e,z,re),10),sharedRel}function interpolateCoordinate(t,e){const n=t.length;let r=Math.floor(e);const i=e-r;r>=n?r-=n:r<0&&(r+=n);let g=r+1;g>=n&&(g-=n);const y=t[r],k=y[0],L=y[1],$=t[g],V=$[0]-k,z=$[1]-L;return[k+V*i,L+z*i]}class Draw extends PointerInteraction{constructor(e){const n=e;n.stopDown||(n.stopDown=FALSE),super(n),this.on,this.once,this.un,this.shouldHandle_=!1,this.downPx_=null,this.downTimeout_,this.lastDragTime_,this.pointerType_,this.freehand_=!1,this.source_=e.source?e.source:null,this.features_=e.features?e.features:null,this.snapTolerance_=e.snapTolerance?e.snapTolerance:12,this.type_=e.type,this.mode_=getMode(this.type_),this.stopClick_=!!e.stopClick,this.minPoints_=e.minPoints?e.minPoints:this.mode_==="Polygon"?3:2,this.maxPoints_=this.mode_==="Circle"?2:e.maxPoints?e.maxPoints:1/0,this.finishCondition_=e.finishCondition?e.finishCondition:TRUE,this.geometryLayout_=e.geometryLayout?e.geometryLayout:"XY";let r=e.geometryFunction;if(!r){const i=this.mode_;if(i==="Circle")r=(g,y,k)=>{const L=y||new Circle([NaN,NaN]),$=fromUserCoordinate(g[0]),V=squaredDistance($,fromUserCoordinate(g[g.length-1]));return L.setCenterAndRadius($,Math.sqrt(V),this.geometryLayout_),L};else{let g;i==="Point"?g=Point:i==="LineString"?g=LineString:i==="Polygon"&&(g=Polygon),r=(y,k,L)=>(k?i==="Polygon"?y[0].length?k.setCoordinates([y[0].concat([y[0][0]])],this.geometryLayout_):k.setCoordinates([],this.geometryLayout_):k.setCoordinates(y,this.geometryLayout_):k=new g(y,this.geometryLayout_),k)}}this.geometryFunction_=r,this.dragVertexDelay_=e.dragVertexDelay!==void 0?e.dragVertexDelay:500,this.finishCoordinate_=null,this.sketchFeature_=null,this.sketchPoint_=null,this.sketchCoords_=null,this.sketchLine_=null,this.sketchLineCoords_=null,this.squaredClickTolerance_=e.clickTolerance?e.clickTolerance*e.clickTolerance:36,this.overlay_=new VectorLayer({source:new VectorSource({useSpatialIndex:!1,wrapX:e.wrapX?e.wrapX:!1}),style:e.style?e.style:getDefaultStyleFunction(),updateWhileInteracting:!0}),this.geometryName_=e.geometryName,this.condition_=e.condition?e.condition:noModifierKeys,this.freehandCondition_,e.freehand?this.freehandCondition_=always:this.freehandCondition_=e.freehandCondition?e.freehandCondition:shiftKeyOnly,this.traceCondition_,this.setTrace(e.trace||!1),this.traceState_={active:!1},this.traceSource_=e.traceSource||e.source||null,this.addChangeListener(InteractionProperty.ACTIVE,this.updateState_)}setTrace(e){let n;e?e===!0?n=always:n=e:n=never,this.traceCondition_=n}setMap(e){super.setMap(e),this.updateState_()}getOverlay(){return this.overlay_}handleEvent(e){e.originalEvent.type===EventType.CONTEXTMENU&&e.originalEvent.preventDefault(),this.freehand_=this.mode_!=="Point"&&this.freehandCondition_(e);let n=e.type===MapBrowserEventType.POINTERMOVE,r=!0;return!this.freehand_&&this.lastDragTime_&&e.type===MapBrowserEventType.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=e.pixel,this.shouldHandle_=!this.freehand_,n=!0):this.lastDragTime_=void 0,this.shouldHandle_&&this.downTimeout_!==void 0&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0)),this.freehand_&&e.type===MapBrowserEventType.POINTERDRAG&&this.sketchFeature_!==null?(this.addToDrawing_(e.coordinate),r=!1):this.freehand_&&e.type===MapBrowserEventType.POINTERDOWN?r=!1:n&&this.getPointerCount()<2?(r=e.type===MapBrowserEventType.POINTERMOVE,r&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):(e.originalEvent.pointerType==="mouse"||e.type===MapBrowserEventType.POINTERDRAG&&this.downTimeout_===void 0)&&this.handlePointerMove_(e)):e.type===MapBrowserEventType.DBLCLICK&&(r=!1),super.handleEvent(e)&&r}handleDownEvent(e){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=e.pixel,this.finishCoordinate_||this.startDrawing_(e.coordinate),!0):this.condition_(e)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(()=>{this.handlePointerMove_(new MapBrowserEvent(MapBrowserEventType.POINTERMOVE,e.map,e.originalEvent,!1,e.frameState))},this.dragVertexDelay_),this.downPx_=e.pixel,!0):(this.lastDragTime_=void 0,!1)}deactivateTrace_(){this.traceState_={active:!1}}toggleTraceState_(e){if(!this.traceSource_||!this.traceCondition_(e))return;if(this.traceState_.active){this.deactivateTrace_();return}const n=this.getMap(),r=n.getCoordinateFromPixel([e.pixel[0]-this.snapTolerance_,e.pixel[1]+this.snapTolerance_]),i=n.getCoordinateFromPixel([e.pixel[0]+this.snapTolerance_,e.pixel[1]-this.snapTolerance_]),g=boundingExtent([r,i]),y=this.traceSource_.getFeaturesInExtent(g);if(y.length===0)return;const k=getTraceTargets(e.coordinate,y);k.length&&(this.traceState_={active:!0,startPx:e.pixel.slice(),targets:k,targetIndex:-1})}addOrRemoveTracedCoordinates_(e,n){const r=e.startIndex<=e.endIndex,i=e.startIndex<=n;r===i?r&&n>e.endIndex||!r&&n<e.endIndex?this.addTracedCoordinates_(e,e.endIndex,n):(r&&n<e.endIndex||!r&&n>e.endIndex)&&this.removeTracedCoordinates_(n,e.endIndex):(this.removeTracedCoordinates_(e.startIndex,e.endIndex),this.addTracedCoordinates_(e,e.startIndex,n))}removeTracedCoordinates_(e,n){if(e===n)return;let r=0;if(e<n){const i=Math.ceil(e);let g=Math.floor(n);g===n&&(g-=1),r=g-i+1}else{const i=Math.floor(e);let g=Math.ceil(n);g===n&&(g+=1),r=i-g+1}r>0&&this.removeLastPoints_(r)}addTracedCoordinates_(e,n,r){if(n===r)return;const i=[];if(n<r){const g=Math.ceil(n);let y=Math.floor(r);y===r&&(y-=1);for(let k=g;k<=y;++k)i.push(getCoordinate(e.coordinates,k))}else{const g=Math.floor(n);let y=Math.ceil(r);y===r&&(y+=1);for(let k=g;k>=y;--k)i.push(getCoordinate(e.coordinates,k))}i.length&&this.appendCoordinates(i)}updateTrace_(e){const n=this.traceState_;if(!n.active||n.targetIndex===-1&&distance$1(n.startPx,e.pixel)<this.snapTolerance_)return;const r=getTraceTargetUpdate(e.coordinate,n,this.getMap(),this.snapTolerance_);if(n.targetIndex!==r.index){if(n.targetIndex!==-1){const L=n.targets[n.targetIndex];this.removeTracedCoordinates_(L.startIndex,L.endIndex)}const k=n.targets[r.index];this.addTracedCoordinates_(k,k.startIndex,r.endIndex)}else{const k=n.targets[n.targetIndex];this.addOrRemoveTracedCoordinates_(k,r.endIndex)}n.targetIndex=r.index;const i=n.targets[n.targetIndex];i.endIndex=r.endIndex;const g=interpolateCoordinate(i.coordinates,i.endIndex),y=this.getMap().getPixelFromCoordinate(g);e.coordinate=g,e.pixel=[Math.round(y[0]),Math.round(y[1])]}handleUpEvent(e){let n=!0;if(this.getPointerCount()===0){this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(e);const r=this.traceState_.active;if(this.toggleTraceState_(e),this.shouldHandle_){const i=!this.finishCoordinate_;i&&this.startDrawing_(e.coordinate),!i&&this.freehand_?this.finishDrawing():!this.freehand_&&(!i||this.mode_==="Point")&&(this.atFinish_(e.pixel,r)?this.finishCondition_(e)&&this.finishDrawing():this.addToDrawing_(e.coordinate)),n=!1}else this.freehand_&&this.abortDrawing()}return!n&&this.stopClick_&&e.preventDefault(),n}handlePointerMove_(e){if(this.pointerType_=e.originalEvent.pointerType,this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){const n=this.downPx_,r=e.pixel,i=n[0]-r[0],g=n[1]-r[1],y=i*i+g*g;if(this.shouldHandle_=this.freehand_?y>this.squaredClickTolerance_:y<=this.squaredClickTolerance_,!this.shouldHandle_)return}if(!this.finishCoordinate_){this.createOrUpdateSketchPoint_(e.coordinate.slice());return}this.updateTrace_(e),this.modifyDrawing_(e.coordinate)}atFinish_(e,n){let r=!1;if(this.sketchFeature_){let i=!1,g=[this.finishCoordinate_];const y=this.mode_;if(y==="Point")r=!0;else if(y==="Circle")r=this.sketchCoords_.length===2;else if(y==="LineString")i=!n&&this.sketchCoords_.length>this.minPoints_;else if(y==="Polygon"){const k=this.sketchCoords_;i=k[0].length>this.minPoints_,g=[k[0][0],k[0][k[0].length-2]],n?g=[k[0][0]]:g=[k[0][0],k[0][k[0].length-2]]}if(i){const k=this.getMap();for(let L=0,$=g.length;L<$;L++){const V=g[L],z=k.getPixelFromCoordinate(V),re=e[0]-z[0],oe=e[1]-z[1],j=this.freehand_?1:this.snapTolerance_;if(r=Math.sqrt(re*re+oe*oe)<=j,r){this.finishCoordinate_=V;break}}}}return r}createOrUpdateSketchPoint_(e){this.sketchPoint_?this.sketchPoint_.getGeometry().setCoordinates(e):(this.sketchPoint_=new Feature(new Point(e)),this.updateSketchFeatures_())}createOrUpdateCustomSketchLine_(e){this.sketchLine_||(this.sketchLine_=new Feature);const n=e.getLinearRing(0);let r=this.sketchLine_.getGeometry();r?(r.setFlatCoordinates(n.getLayout(),n.getFlatCoordinates()),r.changed()):(r=new LineString(n.getFlatCoordinates(),n.getLayout()),this.sketchLine_.setGeometry(r))}startDrawing_(e){const n=this.getMap().getView().getProjection(),r=getStrideForLayout(this.geometryLayout_);for(;e.length<r;)e.push(0);this.finishCoordinate_=e,this.mode_==="Point"?this.sketchCoords_=e.slice():this.mode_==="Polygon"?(this.sketchCoords_=[[e.slice(),e.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[e.slice(),e.slice()],this.sketchLineCoords_&&(this.sketchLine_=new Feature(new LineString(this.sketchLineCoords_)));const i=this.geometryFunction_(this.sketchCoords_,void 0,n);this.sketchFeature_=new Feature,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(i),this.updateSketchFeatures_(),this.dispatchEvent(new DrawEvent(DrawEventType.DRAWSTART,this.sketchFeature_))}modifyDrawing_(e){const n=this.getMap(),r=this.sketchFeature_.getGeometry(),i=n.getView().getProjection(),g=getStrideForLayout(this.geometryLayout_);let y,k;for(;e.length<g;)e.push(0);this.mode_==="Point"?k=this.sketchCoords_:this.mode_==="Polygon"?(y=this.sketchCoords_[0],k=y[y.length-1],this.atFinish_(n.getPixelFromCoordinate(e))&&(e=this.finishCoordinate_.slice())):(y=this.sketchCoords_,k=y[y.length-1]),k[0]=e[0],k[1]=e[1],this.geometryFunction_(this.sketchCoords_,r,i),this.sketchPoint_&&this.sketchPoint_.getGeometry().setCoordinates(e),r.getType()==="Polygon"&&this.mode_!=="Polygon"?this.createOrUpdateCustomSketchLine_(r):this.sketchLineCoords_&&this.sketchLine_.getGeometry().setCoordinates(this.sketchLineCoords_),this.updateSketchFeatures_()}addToDrawing_(e){const n=this.sketchFeature_.getGeometry(),r=this.getMap().getView().getProjection();let i,g;const y=this.mode_;return y==="LineString"||y==="Circle"?(this.finishCoordinate_=e.slice(),g=this.sketchCoords_,g.length>=this.maxPoints_&&(this.freehand_?g.pop():i=!0),g.push(e.slice()),this.geometryFunction_(g,n,r)):y==="Polygon"&&(g=this.sketchCoords_[0],g.length>=this.maxPoints_&&(this.freehand_?g.pop():i=!0),g.push(e.slice()),i&&(this.finishCoordinate_=g[0]),this.geometryFunction_(this.sketchCoords_,n,r)),this.createOrUpdateSketchPoint_(e.slice()),this.updateSketchFeatures_(),i?this.finishDrawing():this.sketchFeature_}removeLastPoints_(e){if(!this.sketchFeature_)return;const n=this.sketchFeature_.getGeometry(),r=this.getMap().getView().getProjection(),i=this.mode_;for(let g=0;g<e;++g){let y;if(i==="LineString"||i==="Circle"){if(y=this.sketchCoords_,y.splice(-2,1),y.length>=2){this.finishCoordinate_=y[y.length-2].slice();const k=this.finishCoordinate_.slice();y[y.length-1]=k,this.createOrUpdateSketchPoint_(k)}this.geometryFunction_(y,n,r),n.getType()==="Polygon"&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(n)}else if(i==="Polygon"){y=this.sketchCoords_[0],y.splice(-2,1);const k=this.sketchLine_.getGeometry();if(y.length>=2){const L=y[y.length-2].slice();y[y.length-1]=L,this.createOrUpdateSketchPoint_(L)}k.setCoordinates(y),this.geometryFunction_(this.sketchCoords_,n,r)}if(y.length===1){this.abortDrawing();break}}this.updateSketchFeatures_()}removeLastPoint(){this.removeLastPoints_(1)}finishDrawing(){const e=this.abortDrawing_();if(!e)return null;let n=this.sketchCoords_;const r=e.getGeometry(),i=this.getMap().getView().getProjection();return this.mode_==="LineString"?(n.pop(),this.geometryFunction_(n,r,i)):this.mode_==="Polygon"&&(n[0].pop(),this.geometryFunction_(n,r,i),n=r.getCoordinates()),this.type_==="MultiPoint"?e.setGeometry(new MultiPoint([n])):this.type_==="MultiLineString"?e.setGeometry(new MultiLineString([n])):this.type_==="MultiPolygon"&&e.setGeometry(new MultiPolygon([n])),this.dispatchEvent(new DrawEvent(DrawEventType.DRAWEND,e)),this.features_&&this.features_.push(e),this.source_&&this.source_.addFeature(e),e}abortDrawing_(){this.finishCoordinate_=null;const e=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),this.deactivateTrace_(),e}abortDrawing(){const e=this.abortDrawing_();e&&this.dispatchEvent(new DrawEvent(DrawEventType.DRAWABORT,e))}appendCoordinates(e){const n=this.mode_,r=!this.sketchFeature_;r&&this.startDrawing_(e[0]);let i;if(n==="LineString"||n==="Circle")i=this.sketchCoords_;else if(n==="Polygon")i=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[];else return;r&&i.shift(),i.pop();for(let y=0;y<e.length;y++)this.addToDrawing_(e[y]);const g=e[e.length-1];this.sketchFeature_=this.addToDrawing_(g),this.modifyDrawing_(g)}extend(e){const r=e.getGeometry();this.sketchFeature_=e,this.sketchCoords_=r.getCoordinates();const i=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=i.slice(),this.sketchCoords_.push(i.slice()),this.sketchPoint_=new Feature(new Point(i)),this.updateSketchFeatures_(),this.dispatchEvent(new DrawEvent(DrawEventType.DRAWSTART,this.sketchFeature_))}updateSketchFeatures_(){const e=[];this.sketchFeature_&&e.push(this.sketchFeature_),this.sketchLine_&&e.push(this.sketchLine_),this.sketchPoint_&&e.push(this.sketchPoint_);const n=this.overlay_.getSource();n.clear(!0),n.addFeatures(e)}updateState_(){const e=this.getMap(),n=this.getActive();(!e||!n)&&this.abortDrawing(),this.overlay_.setMap(n?e:null)}}function getDefaultStyleFunction(){const t=createEditingStyle();return function(e,n){return t[e.getGeometry().getType()]}}function getMode(t){switch(t){case"Point":case"MultiPoint":return"Point";case"LineString":case"MultiLineString":return"LineString";case"Polygon":case"MultiPolygon":return"Polygon";case"Circle":return"Circle";default:throw new Error("Invalid type: "+t)}}const disableDoubleClickZoom=()=>{getInstall().getInteractions().forEach(e=>{e instanceof DoubleClickZoom&&e.setActive(!1)})},enableDoubleClickZoom=()=>{getInstall().getInteractions().forEach(e=>{e instanceof DoubleClickZoom&&e.setActive(!0)})},props=vue.ref(),setProps=t=>{props.value=t},getProps=()=>props.value,measureHistory=vue.ref([]),unit=vue.ref("km"),setUnit=t=>{unit.value=t};let helpTooltipElement$1;const state=vue.ref(!1),open$1=()=>{initMapLayer(),disableDoubleClickZoom(),changeCursor("pointer");const t=getInstall();t.on("pointermove",pointerMoveHandler$1),t.getViewport().addEventListener("mouseout",()=>{helpTooltipElement$1&&helpTooltipElement$1.classList.add("hidden")}),addInteraction(),state.value=!0};let vectorSource$2,vectorLayer$2;const initMapLayer=()=>{vectorSource$2=new VectorSource,vectorLayer$2=new VectorLayer({source:vectorSource$2,zIndex:1e3,style:{"fill-color":"rgba(255, 255, 255, 0.2)","stroke-color":"#ffcc33","stroke-width":2,"circle-radius":7,"circle-fill-color":"#ffcc33"}}),getInstall().addLayer(vectorLayer$2)};let sketch$1,helpTooltip;const pointerMoveHandler$1=t=>{if(t.dragging)return;let e="点击选择起点";sketch$1&&(e="单击继续,双击结束"),helpTooltipElement$1&&(helpTooltipElement$1.innerHTML=e,helpTooltip.setPosition(t.coordinate),helpTooltipElement$1.classList.remove("hidden"))},changeCursor=t=>{getInstall().getTargetElement().style.cursor=t};let draw$1;const addInteraction=()=>{draw$1=new Draw({source:vectorSource$2,type:"LineString",style:new Style({fill:new Fill({color:"rgba(255, 255, 255, 0.2)"}),stroke:new Stroke({color:"rgba(255,204,51)",lineDash:[10,10],width:2}),image:new CircleStyle({radius:5,stroke:new Stroke({color:"rgba(0, 0, 0, 0.7)"}),fill:new Fill({color:"rgba(255, 255, 255, 0.2)"})})}),condition:e=>e.originalEvent.target.tagName!=="DIV"}),getInstall().addInteraction(draw$1),createMeasureTooltip$1(),createHelpTooltip$1();let t;draw$1.on("drawstart",function(e){var r;sketch$1=e.feature,sketch$1.set("randomId",generateRandomId());let n;t=(r=sketch$1.getGeometry())==null?void 0:r.on("change",function(i){const g=i.target,y=computedDistance(g,unit.value);n=g.getLastCoordinate(),measureTooltipElement$1&&y&&(measureTooltipElement$1.innerHTML=y),measureTooltip$1.setPosition(n)})}),draw$1.on("drawend",function(){var e,n,r;if(measureTooltipElement$1&&(measureTooltipElement$1.className="ol-tooltip ol-tooltip-static ol-tooltip-measure"),measureTooltipElement$1!=null&&measureTooltipElement$1.innerHTML){const i=(sketch$1==null?void 0:sketch$1.get("randomId"))||generateRandomId();measureHistory.value.push({id:i,value:measureTooltipElement$1==null?void 0:measureTooltipElement$1.innerHTML}),measureTooltipElement$1.innerHTML=`${measureTooltipElement$1.innerHTML}<div class="ol-tooltip-delete-button" data-id="${i}"><i class="map-iconfont icon-delete"></i></div>`}(e=document.querySelector(".ol-selectable:has(.ol-tooltip-delete-button):last-child .ol-tooltip-delete-button"))==null||e.addEventListener("click",i=>{var y;i.preventDefault(),i.stopPropagation();const g=(y=i.target)==null?void 0:y.getAttribute("data-id");g&&deleteLine(g)}),measureTooltip$1.setOffset([0,-7]),sketch$1=null,measureTooltipElement$1=null,createMeasureTooltip$1(),t&&unByKey(t),(n=getProps())!=null&&n.lineDrawEnd&&((r=getProps())==null||r.lineDrawEnd(measureHistory.value))})},generateRandomId=()=>Math.random().toString(36).substring(2,9);let measureTooltipElement$1,measureTooltip$1;const createMeasureTooltip$1=()=>{measureTooltipElement$1!=null&&measureTooltipElement$1.parentNode&&measureTooltipElement$1.parentNode.removeChild(measureTooltipElement$1),measureTooltipElement$1=document.createElement("div"),measureTooltipElement$1.className="ol-tooltip ol-tooltip-measure",measureTooltip$1=new Overlay({element:measureTooltipElement$1,offset:[0,-15],positioning:"bottom-center",stopEvent:!1,insertFirst:!1}),getInstall().addOverlay(measureTooltip$1)},createHelpTooltip$1=()=>{helpTooltipElement$1!=null&&helpTooltipElement$1.parentNode&&helpTooltipElement$1.parentNode.removeChild(helpTooltipElement$1),helpTooltipElement$1=document.createElement("div"),helpTooltipElement$1.className="ol-tooltip hidden",helpTooltip=new Overlay({element:helpTooltipElement$1,offset:[15,0],positioning:"center-left"}),getInstall().addOverlay(helpTooltip)},close$1=()=>{measureHistory.value.forEach((t,e)=>{var i,g;const n=document.querySelectorAll(".ol-tooltip.ol-tooltip-static.ol-tooltip-measure");n[e]&&((g=(i=n[e])==null?void 0:i.parentNode)==null||g.removeChild(n[e]));const r=vectorSource$2.getFeatures();r[e]&&vectorSource$2.removeFeature(r[e])}),removeInteraction(),enableDoubleClickZoom(),state.value=!1},deleteLine=t=>{var n,r,i,g;const e=measureHistory.value.findIndex(y=>y.id===t);if(e!==-1){measureHistory.value.splice(e,1);const y=document.querySelectorAll(".ol-tooltip.ol-tooltip-static.ol-tooltip-measure");y[e]&&((r=(n=y[e])==null?void 0:n.parentNode)==null||r.removeChild(y[e]));const k=vectorSource$2.getFeatures();k[e]&&vectorSource$2.removeFeature(k[e])}(i=getProps())!=null&&i.lineDrawEnd&&((g=getProps())==null||g.lineDrawEnd(measureHistory.value))},computedDistance=(t,e)=>{const r=getLength(t);let i="";switch(e){case"m":i=`${Math.round(r*100)/100} m`;break;case"km":i=`${Math.round(r/1e3*100)/100} km`;break;case"nm":i=`${Math.round(r/1.852*100)/100} nm`;break}return i},removeInteraction=()=>{measureHistory.value=[],document.querySelectorAll(".ol-tooltip.ol-tooltip-static").forEach(e=>{var n;(n=e==null?void 0:e.parentNode)==null||n.removeChild(e)}),vectorSource$2.clear();const t=getInstall();if(draw$1){const e=t.getInteractions().getArray().find(n=>getUid(n)===getUid(draw$1));e&&t.removeInteraction(e)}t.removeLayer(vectorLayer$2),helpTooltipElement$1!=null&&helpTooltipElement$1.parentNode&&helpTooltipElement$1.parentNode.removeChild(helpTooltipElement$1),measureTooltipElement$1!=null&&measureTooltipElement$1.parentNode&&measureTooltipElement$1.parentNode.removeChild(measureTooltipElement$1)},getState=()=>state.value,drawLine={open:open$1,close:close$1,deleteLine,setUnit,getState},mapInstance=vue.ref(),getInstall=()=>mapInstance.value,getView=()=>getInstall().getView(),getZoom=()=>{var t;return(t=getView())==null?void 0:t.getZoom()},setZoom=t=>{var e;(e=getView())==null||e.setZoom(t)},setCenter=(t,e)=>{var n;(n=getView())==null||n.setCenter(fromLonLat([t,e]))},getCenter=()=>{var e;const t=(e=getView())==null?void 0:e.getCenter();return toLonLat(t)},getSize=()=>{var t;return(t=getInstall())==null?void 0:t.getSize()},BASE_LAYER_MAP=new Map$2,initMap=t=>{setBaseLayerMap(t);const e={zoom:t.zoom,center:fromLonLat(t.center),minZoom:MAP_ZOOM.min,maxZoom:MAP_ZOOM.max,constrainResolution:!0,enableRotation:!1,multiWorld:!0},n=new Map$2({target:"map",controls:defaults$2({zoom:!1}),layers:[BASE_LAYER_MAP.get("vectorTile"),BASE_LAYER_MAP.get("vectorTileMark"),BASE_LAYER_MAP.get("satelliteImgTile"),BASE_LAYER_MAP.get("satelliteImgTileMark")],view:new View(e)});mapInstance.value=n,setBaseMapEvent(n,t)},setBaseLayerMap=t=>{BASE_LAYER_MAP.set("vectorTile",new TileLayer({source:new XYZ({url:BASE_MAP_LINK.vectorTile}),visible:t.layerType==="vector",zIndex:0,preload:1,className:"vector"})),BASE_LAYER_MAP.set("vectorTileMark",new TileLayer({source:new XYZ({url:BASE_MAP_LINK.vectorTileMark}),visible:t.layerType==="vector",zIndex:1,preload:1,className:"vector"})),BASE_LAYER_MAP.set("satelliteImgTile",new TileLayer({source:new XYZ({url:BASE_MAP_LINK.satelliteImgTile}),visible:t.layerType==="satellite",zIndex:0,preload:1,className:"satellite"})),BASE_LAYER_MAP.set("satelliteImgTileMark",new TileLayer({source:new XYZ({url:BASE_MAP_LINK.satelliteImgTileMark}),visible:t.layerType==="satellite",zIndex:1,preload:1,className:"satellite"})),BASE_LAYER_MAP.set("greenMark",new TileLayer({source:new XYZ({url:BASE_MAP_LINK.greenTile}),visible:t.showGreenLayer,zIndex:2,className:"greenTile"}))},setBaseMapEvent=(t,e)=>{t.on("moveend",()=>{var r;const n=getZoom();(r=e.mapMoveEnd)==null||r.call(e,n),reRenderTrackLine()}),t.on("pointermove",n=>{const r=t.getEventPixel(n.originalEvent),i=t.forEachFeatureAtPixel(r,g=>g);handleShipMapEvent(i,"hover"),handleTrackMapEvent(i,"hover",n),i&&handlePortHover(r)}),t.on("movestart",()=>{console.log("movestart-----------------------"),removeSelectedOverlay()}),t.on("click",debounce(n=>{if(console.log("1",drawLine.getState()),drawLine.getState())return;const r=t.getEventPixel(n.originalEvent),i=t.forEachFeatureAtPixel(r,g=>{if(g!=null&&g.get("shipData")||g!=null&&g.get("portData"))return g});if(console.log("2",i),!!i){if(n.preventDefault(),n.stopPropagation(),i.get("shipData"))handleShipMapEvent(i,"click",e==null?void 0:e.selectShip);else if(i.get("portData")){const g=i.get("portData");selectedPort(g),e==null||e.selectPort(g)}}},150))},_hoisted_1$8={id:"scale-line-container"},_sfc_main$9=vue.defineComponent({__name:"scaleLine",setup(t,{expose:e}){return e({setScaleLine:r=>{r||(r="metric");const i=new ScaleLine$1({units:r}),g=document.getElementById("scale-line-container");g&&(i.setTarget(g),getInstall().addControl(i))}}),(r,i)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$8))}}),ScaleLine=_export_sfc(_sfc_main$9,[["__scopeId","data-v-31ff8293"]]),_hoisted_1$7={class:"zoom"},_sfc_main$8=vue.defineComponent({__name:"zoomControl",setup(t){const e=()=>{if(!getInstall())return;const i=getZoom();i&&setZoom(i+1)},n=()=>{if(!getInstall())return;const i=getZoom();i&&setZoom(i-1)};return(r,i)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$7,[vue.createElementVNode("div",{class:"button big-button",onClick:e}," + "),vue.createElementVNode("div",{class:"button small-button",onClick:n}," - ")]))}}),ZoomControl=_export_sfc(_sfc_main$8,[["__scopeId","data-v-2b7e25f2"]]),getLayers=()=>{var t;return(t=getInstall())==null?void 0:t.getLayers()},layerType=vue.ref("vector"),getShowLayerType=()=>layerType.value,setShowLayerType=t=>{layerType.value=t;const e=getLayers();e&&e.getArray().forEach(n=>{n.setVisible(n.className_===t)})},showGreenTile=vue.ref(),getGreenTileVisible=()=>showGreenTile.value,setGreenTileVisible=t=>{if(t!==showGreenTile.value){if(t){const e=getLayers();if(!e.getArray().find(r=>r.className_==="greenTile")){const r=new TileLayer({source:new XYZ({url:BASE_MAP_LINK.greenTile}),visible:t,zIndex:2,className:"greenTile"});e.push(r)}}else{const e=getLayers(),n=e.getArray().find(r=>r.className_==="greenTile");n&&e.remove(n)}showGreenTile.value=t}};let storeFeature;const open=()=>{init()},init=()=>{initLayer(),createMeasureTooltip(),createHelpTooltip(),initDraw()};let vectorLayer$1=null,vectorSource$1=null;const initLayer=()=>{if(vectorLayer$1||vectorSource$1)return;const t=new VectorSource,e=new VectorLayer({source:t,style:new Style({stroke:new Stroke({color:"#fbcc33",width:2})})});vectorLayer$1=e,vectorSource$1=t;const n=getInstall();n.on("pointermove",pointerMoveHandler),n.addLayer(e),n.on(["dblclick"],function(r){draw&&(r.stopPropagation(),r.preventDefault())})};let sketch;const pointerMoveHandler=t=>{if(t.dragging)return;const e=sketch?"单击继续,双击结束":"点击选择起点";helpTooltipElement&&(helpTooltipElement.innerHTML=e,tipOverlay.setPosition(t.coordinate))};let draw,lineLimitError=!1;const initDraw=()=>{if(storeFeature){helpTooltipElement!=null&&helpTooltipElement.parentNode&&helpTooltipElement.parentNode.removeChild(helpTooltipElement);const e=storeFeature.getGeometry();if(!e)return;const n=computedArea(e,"nm");measureTooltipElement&&(measureTooltipElement.innerHTML=`
216
216
  <span class="text">面积:${n}${lineLimitError?'<span class="error pl-12">超出可以绘画的距离</span>':""}</span>
217
217
  `),measureTooltipElement&&(measureTooltipElement.innerHTML+='<span class="delete-icon" ><i class="map-iconfont icon-delete" /></div>');const r=e.getCoordinates(),i=r[0][r[0].length-2];if(measureTooltip.setPosition(i),vectorLayer$1){const y=vectorLayer$1.getSource();y&&storeFeature&&(y.clear(),y.addFeature(storeFeature))}setTimeout(()=>{var y;(y=document.querySelector(".delete-icon"))==null||y.addEventListener("click",()=>{var k;console.log("delete"),reset(),(k=getProps())==null||k.areaDrawEnd([])})},0);const g=getCenter$1(storeFeature.getGeometry().getExtent());getInstall().getView().setCenter(g);return}draw=new Draw({type:"Polygon",source:vectorSource$1,trace:!0,style:[new Style({stroke:new Stroke({color:"rgba(255, 255, 255, 1)",width:1.5,lineDash:[10,10]}),fill:new Fill({color:"rgba(255, 255, 255, 0.25)"})}),new Style({image:new CircleStyle({radius:5,fill:new Fill({color:"rgb(51,112,255, 1)"})}),geometry:function(e){const n=e.getGeometry().getCoordinates();return new MultiPoint(n)}})]}),getInstall().addInteraction(draw);let t;draw.on("drawstart",e=>{var n;sketch=e.feature,t=(n=sketch.getGeometry())==null?void 0:n.on("change",r=>{const i=r.target,g=computedArea(i,"nm"),k=i.getCoordinates()[0],L=new LineString([k[k.length-2],k[k.length-1]]),$=computedDistance(L,"nm");if(lineLimitError=Number(getLength(L)/1e3)>150,!g)return;const V='<span class="error pl-4">超出可以绘画的距离</span>';measureTooltipElement&&(measureTooltipElement.innerHTML=`
218
218
  <div class="text">
@@ -231,7 +231,7 @@ hooks.version="2.30.1",setHookCallback(createLocal),hooks.fn=proto,hooks.min=min
231
231
  <div>
232
232
  <span class="text">单击继续,双击结束</span>
233
233
  </div>
234
- `)})}),draw.on("drawend",e=>{var g,y,k;if(!e.feature.getGeometry())return;storeFeature=e.feature,measureTooltipElement&&(measureTooltipElement.innerHTML+='<span class="delete-icon"><i class="map-iconfont icon-delete" /></div>'),measureTooltip.setOffset([10,0]);const n=e.feature.getGeometry(),r=n.getCoordinates(),i=r[0][r[0].length-2];if(measureTooltip.setPosition(i),helpTooltipElement!=null&&helpTooltipElement.parentNode&&helpTooltipElement.parentNode.removeChild(helpTooltipElement),(g=getProps())!=null&&g.areaDrawEnd){n.getInteriorPoint().getCoordinates();const L=r[0].map($=>transform($,projection.mercator,projection.data));(y=getProps())==null||y.areaDrawEnd(L)}draw&&(draw.setActive(!1),getInstall().removeInteraction(draw),getInstall().getInteractions().forEach($=>{$ instanceof Draw&&($.setActive(!1),getInstall().removeInteraction($))})),t&&unByKey(t),(k=document.querySelector(".delete-icon"))==null||k.addEventListener("click",()=>{var L;reset(),(L=getProps())==null||L.areaDrawEnd([])})})},computedArea=(t,e)=>{const n=getArea(t);switch(e){case"km":return n>1e4?Math.round(n/1e6*100)/100+" km<sup>2</sup>":Math.round(n*100)/100+" m<sup>2</sup>";case"nm":return n>1e4?Math.round(n/1e6/Math.pow(1.852,2)*100)/100+" nm<sup>2</sup>":Math.round(n*100)/100+" m<sup>2</sup>"}};let measureTooltipElement,measureTooltip;const createMeasureTooltip=()=>{measureTooltipElement!=null&&measureTooltipElement.parentNode&&measureTooltipElement.parentNode.removeChild(measureTooltipElement),measureTooltipElement=document.createElement("div"),measureTooltipElement.style.display="flex",measureTooltipElement.className="ol-tooltip ol-tooltip-draw-polygon",measureTooltip=new Overlay({element:measureTooltipElement,offset:[0,-15],positioning:"bottom-center",stopEvent:!1,insertFirst:!1}),getInstall().addOverlay(measureTooltip)};let helpTooltipElement,tipOverlay;const createHelpTooltip=()=>{helpTooltipElement!=null&&helpTooltipElement.parentNode&&helpTooltipElement.parentNode.removeChild(helpTooltipElement),helpTooltipElement=document.createElement("div"),helpTooltipElement.className="ol-tooltip ol-help-tooltip",tipOverlay=new Overlay({element:helpTooltipElement,offset:[15,0],positioning:"center-left"}),getInstall().addOverlay(tipOverlay)},reset=()=>{vectorSource$1==null||vectorSource$1.clear(),storeFeature=null,createMeasureTooltip(),createHelpTooltip(),initDraw()},close=()=>{const t=getInstall();vectorSource$1==null||vectorSource$1.clear(),vectorSource$1=null,vectorLayer$1&&(t.removeLayer(vectorLayer$1),vectorLayer$1=null),sketch=null,draw&&(draw=null,t.getInteractions().forEach(e=>{e instanceof Draw&&t.removeInteraction(e)})),helpTooltipElement!=null&&helpTooltipElement.parentElement&&helpTooltipElement.parentElement.removeChild(helpTooltipElement),measureTooltipElement!=null&&measureTooltipElement.parentElement&&measureTooltipElement.parentElement.removeChild(measureTooltipElement),tipOverlay&&t.removeOverlay(tipOverlay),measureTooltip&&t.removeOverlay(measureTooltip)},drawPolygon={open,close,reset};let currentTruckOverlay=null;const locationTruck=async t=>{const e=getInstall();if(!e||(console.log("vehicleInfo",t),!(t!=null&&t.lon&&(t!=null&&t.lat))))return;const n=Math.abs(Number(t.lon))>180?convertSixHundredThousandToLatLng(t.lon,t.lat):[t.lon,t.lat];drawTruckIcon(t,fromLonLat(n));const r=e.getView(),i=new Point(n);r.setCenter(transform(i.getCoordinates(),projection.data,projection.mercator))},drawTruckIcon=(t,e)=>{const n=getInstall(),r=`${CDN_URL}map/car-icon.gif`;currentTruckOverlay||(currentTruckOverlay=new Overlay({element:document.createElement("div"),positioning:"center-center",stopEvent:!1}),n.addOverlay(currentTruckOverlay));const i=currentTruckOverlay.getElement();i.style.backgroundImage=`url(${r})`,i.style.width="80px",i.style.height="80px";const g=(t==null?void 0:t.drc)||"";i.style.transform=`rotate(${g}deg)`,i.style.backgroundSize="cover",currentTruckOverlay==null||currentTruckOverlay.setPosition(e)},renderTruckTrack=(t,e,n,r=1e3)=>{renderTrackLine(t,e,n,LENGTH_UNIT.KM,"truck")},closeTruckTrack=()=>{closeTrack()},removeTruckIcon=()=>{const t=currentTruckOverlay==null?void 0:currentTruckOverlay.getElement();t&&(t.innerHTML="")},resetTrackView=t=>{setTrackViewCenter(t)},playTrack=(t,e)=>{playShipTrack(t,e)},LOCATION_LAYER_CLASS_NAME="zh-map-location-layer";let vectorLayer,vectorSource,selectedPortFeature=null,selectedloactionData=null;const render=t=>{var e;if(!(!t||t.length===0)){if(vectorSource||(vectorSource=new VectorSource),vectorSource.clear(),selectedloactionData){const n=t.find(r=>r.id===selectedloactionData.id);n?selectedloactionData=n:t.push(selectedloactionData)}t.forEach(n=>{renderPortPoint(n)}),vectorLayer||(vectorLayer=new VectorLayer({className:LOCATION_LAYER_CLASS_NAME,source:vectorSource,zIndex:100}),(e=getInstall())==null||e.addLayer(vectorLayer))}},renderPortPoint=t=>{const e=getZoom(),[n,r]=t.latLon.split(","),i=new Feature({geometry:new Point(fromLonLat([Number(n),Number(r)]))});i.setStyle(setPortStyle(t,e,t.id===(selectedloactionData==null?void 0:selectedloactionData.id))),i.set("loactionData",t),vectorSource.addFeature(i)},setPortStyle=(t,e,n)=>{const r={image:new Icon({src:n&&t.selectedPath||t.defaultPath,scale:.5*e/10})};return t.name&&(r.text=new Text({text:t.name,font:"12px sans-serif",fill:new Fill({color:"#000000"}),backgroundFill:new Fill({color:"#FFFFFF"}),offsetY:30})),new Style(r)},clearList=()=>{if(selectedPortFeature){const t=selectedPortFeature.get("loactionData").id;vectorSource.getFeatures().forEach(e=>{e.get("loactionData").id!==t&&vectorSource.removeFeature(e)})}else vectorSource.clear()},clearSelected=()=>{const t=selectedPortFeature.get("loactionData"),e=getZoom();vectorSource.getFeatures().forEach(r=>{r.get("loactionData").id===t.id&&(r==null||r.setStyle(setPortStyle(t,e,!1)))}),selectedloactionData=null,selectedPortFeature=null},selectedLocation=t=>{t?(clearPrevSelectedPort(),addSelectedPortStyle(t)):clearSelectedPort()},clearPrevSelectedPort=()=>{if(selectedPortFeature){const t=selectedPortFeature.get("loactionData"),e=getZoom();selectedPortFeature.setStyle(setPortStyle(t,e,!1))}},addSelectedPortStyle=t=>{const e=vectorSource.getFeatures();selectedloactionData=t,selectedPortFeature=e.find(n=>n.get("loactionData").id===t.id)},position={render,selected:selectedLocation,clearSelected,clear:clearList},_sfc_main$7=vue.defineComponent({__name:"Map",props:{zoom:{default:MAP_ZOOM.default},center:{default:MAP_DEFAULT_CENTER},layerType:{default:"vector"},showGreenLayer:{type:Boolean,default:!1},showScale:{type:Boolean,default:!0},scaleLineUnit:{default:"metric"},mapMoveEnd:{type:Function,default:()=>{}},lineDrawEnd:{},areaDrawEnd:{type:Function,default:()=>{}},selectShip:{type:Function,default:()=>{}},selectPort:{type:Function,default:()=>{}}},setup(t,{expose:e}){const n=vue.ref(),r=vue.ref(),i=t;return console.log(i),vue.onMounted(()=>{var y;initMap(i),setProps(i),setShowLayerType(i.layerType),setGreenTileVisible(i.showGreenLayer),(y=r.value)==null||y.setScaleLine(i.scaleLineUnit)}),e({getInstall,getZoom,setZoom,getView,setCenter,getCenter,layer:{getGreenTileVisible,setGreenTileVisible,getShowLayerType,setShowLayerType},ship:{render:renderShipList,selected:renderShipSelected,filter:filterShipShow,blinking:renderShipBlink,clear:clearShipList},track:{render:renderTrackLine,remove:removeAllTrackLayer,play:playShipTrack,setCenter:setTrackViewCenter,close:closeTrack,getLength:getTrackLength},port:{render:renderPortList,clear:clearPortList,selected:selectedPort},position,drawLine,drawPolygon,carTrack:{location:locationTruck,remove:removeTruckIcon,renderTrack:renderTruckTrack,setCenter:resetTrackView,closeTrack:closeTruckTrack,playTrack},utils:{getCalculateExtent:()=>{const y=getView().calculateExtent(getSize()),k=transform([y[0],y[1]],projection.mercator,projection.data),L=transform([y[2],y[3]],projection.mercator,projection.data);return[k[0],k[1],L[0],L[1]]},convertSixHundredThousandToLatLng,calculateCirclePoints}}),(y,k)=>(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createElementVNode("div",{id:"map",ref_key:"zhMapRef",ref:n,class:"zh-map"},null,512),vue.createVNode(ScaleLine,{ref_key:"scaleLineRef",ref:r},null,512),vue.createVNode(ZoomControl,{ref:"zoomControlRef"},null,512)],64))}}),Map$1=_export_sfc(_sfc_main$7,[["__scopeId","data-v-da85b816"]]),ZhMap=withInstall$1(Map$1);var zhCn={name:"zh-cn",el:{breadcrumb:{label:"面包屑"},colorpicker:{confirm:"确定",clear:"清空",defaultLabel:"颜色选择器",description:"当前颜色 {color},按 Enter 键选择新颜色",alphaLabel:"选择透明度的值"},datepicker:{now:"此刻",today:"今天",cancel:"取消",clear:"清空",confirm:"确定",dateTablePrompt:"使用方向键与 Enter 键可选择日期",monthTablePrompt:"使用方向键与 Enter 键可选择月份",yearTablePrompt:"使用方向键与 Enter 键可选择年份",selectedDate:"已选日期",selectDate:"选择日期",selectTime:"选择时间",startDate:"开始日期",startTime:"开始时间",endDate:"结束日期",endTime:"结束时间",prevYear:"前一年",nextYear:"后一年",prevMonth:"上个月",nextMonth:"下个月",year:"年",month1:"1 月",month2:"2 月",month3:"3 月",month4:"4 月",month5:"5 月",month6:"6 月",month7:"7 月",month8:"8 月",month9:"9 月",month10:"10 月",month11:"11 月",month12:"12 月",weeks:{sun:"日",mon:"一",tue:"二",wed:"三",thu:"四",fri:"五",sat:"六"},weeksFull:{sun:"星期日",mon:"星期一",tue:"星期二",wed:"星期三",thu:"星期四",fri:"星期五",sat:"星期六"},months:{jan:"一月",feb:"二月",mar:"三月",apr:"四月",may:"五月",jun:"六月",jul:"七月",aug:"八月",sep:"九月",oct:"十月",nov:"十一月",dec:"十二月"}},inputNumber:{decrease:"减少数值",increase:"增加数值"},select:{loading:"加载中",noMatch:"无匹配数据",noData:"无数据",placeholder:"请选择"},dropdown:{toggleDropdown:"切换下拉选项"},mention:{loading:"加载中"},cascader:{noMatch:"无匹配数据",loading:"加载中",placeholder:"请选择",noData:"暂无数据"},pagination:{goto:"前往",pagesize:"条/页",total:"共 {total} 条",pageClassifier:"页",page:"页",prev:"上一页",next:"下一页",currentPage:"第 {pager} 页",prevPages:"向前 {pager} 页",nextPages:"向后 {pager} 页",deprecationWarning:"你使用了一些已被废弃的用法,请参考 el-pagination 的官方文档"},dialog:{close:"关闭此对话框"},drawer:{close:"关闭此对话框"},messagebox:{title:"提示",confirm:"确定",cancel:"取消",error:"输入的数据不合法!",close:"关闭此对话框"},upload:{deleteTip:"按 delete 键可删除",delete:"删除",preview:"查看图片",continue:"继续上传"},slider:{defaultLabel:"滑块介于 {min} 至 {max}",defaultRangeStartLabel:"选择起始值",defaultRangeEndLabel:"选择结束值"},table:{emptyText:"暂无数据",confirmFilter:"筛选",resetFilter:"重置",clearFilter:"全部",sumText:"合计"},tour:{next:"下一步",previous:"上一步",finish:"结束导览"},tree:{emptyText:"暂无数据"},transfer:{noMatch:"无匹配数据",noData:"无数据",titles:["列表 1","列表 2"],filterPlaceholder:"请输入搜索内容",noCheckedFormat:"共 {total} 项",hasCheckedFormat:"已选 {checked}/{total} 项"},image:{error:"加载失败"},pageHeader:{title:"返回"},popconfirm:{confirmButtonText:"确定",cancelButtonText:"取消"},carousel:{leftArrow:"上一张幻灯片",rightArrow:"下一张幻灯片",indicator:"幻灯片切换至索引 {index}"}}};/**!
234
+ `)})}),draw.on("drawend",e=>{var g,y,k;if(!e.feature.getGeometry())return;storeFeature=e.feature,measureTooltipElement&&(measureTooltipElement.innerHTML+='<span class="delete-icon"><i class="map-iconfont icon-delete" /></div>'),measureTooltip.setOffset([10,0]);const n=e.feature.getGeometry(),r=n.getCoordinates(),i=r[0][r[0].length-2];if(measureTooltip.setPosition(i),helpTooltipElement!=null&&helpTooltipElement.parentNode&&helpTooltipElement.parentNode.removeChild(helpTooltipElement),(g=getProps())!=null&&g.areaDrawEnd){n.getInteriorPoint().getCoordinates();const L=r[0].map($=>transform($,projection.mercator,projection.data));(y=getProps())==null||y.areaDrawEnd(L)}draw&&(draw.setActive(!1),getInstall().removeInteraction(draw),getInstall().getInteractions().forEach($=>{$ instanceof Draw&&($.setActive(!1),getInstall().removeInteraction($))})),t&&unByKey(t),(k=document.querySelector(".delete-icon"))==null||k.addEventListener("click",()=>{var L;reset(),(L=getProps())==null||L.areaDrawEnd([])})})},computedArea=(t,e)=>{const n=getArea(t);switch(e){case"km":return n>1e4?Math.round(n/1e6*100)/100+" km<sup>2</sup>":Math.round(n*100)/100+" m<sup>2</sup>";case"nm":return n>1e4?Math.round(n/1e6/Math.pow(1.852,2)*100)/100+" nm<sup>2</sup>":Math.round(n*100)/100+" m<sup>2</sup>"}};let measureTooltipElement,measureTooltip;const createMeasureTooltip=()=>{measureTooltipElement!=null&&measureTooltipElement.parentNode&&measureTooltipElement.parentNode.removeChild(measureTooltipElement),measureTooltipElement=document.createElement("div"),measureTooltipElement.style.display="flex",measureTooltipElement.className="ol-tooltip ol-tooltip-draw-polygon",measureTooltip=new Overlay({element:measureTooltipElement,offset:[0,-15],positioning:"bottom-center",stopEvent:!1,insertFirst:!1}),getInstall().addOverlay(measureTooltip)};let helpTooltipElement,tipOverlay;const createHelpTooltip=()=>{helpTooltipElement!=null&&helpTooltipElement.parentNode&&helpTooltipElement.parentNode.removeChild(helpTooltipElement),helpTooltipElement=document.createElement("div"),helpTooltipElement.className="ol-tooltip ol-help-tooltip",tipOverlay=new Overlay({element:helpTooltipElement,offset:[15,0],positioning:"center-left"}),getInstall().addOverlay(tipOverlay)},reset=()=>{vectorSource$1==null||vectorSource$1.clear(),storeFeature=null,createMeasureTooltip(),createHelpTooltip(),initDraw()},close=()=>{const t=getInstall();vectorSource$1==null||vectorSource$1.clear(),vectorSource$1=null,vectorLayer$1&&(t.removeLayer(vectorLayer$1),vectorLayer$1=null),sketch=null,draw&&(draw=null,t.getInteractions().forEach(e=>{e instanceof Draw&&t.removeInteraction(e)})),helpTooltipElement!=null&&helpTooltipElement.parentElement&&helpTooltipElement.parentElement.removeChild(helpTooltipElement),measureTooltipElement!=null&&measureTooltipElement.parentElement&&measureTooltipElement.parentElement.removeChild(measureTooltipElement),tipOverlay&&t.removeOverlay(tipOverlay),measureTooltip&&t.removeOverlay(measureTooltip)},drawPolygon={open,close,reset};let currentTruckOverlay=null;const locationTruck=async t=>{const e=getInstall();if(!e||(console.log("vehicleInfo",t),!(t!=null&&t.lon&&(t!=null&&t.lat))))return;const n=Math.abs(Number(t.lon))>180?convertSixHundredThousandToLatLng(t.lon,t.lat):[t.lon,t.lat];drawTruckIcon(t,fromLonLat(n));const r=e.getView(),i=new Point(n);r.setCenter(transform(i.getCoordinates(),projection.data,projection.mercator))},drawTruckIcon=(t,e)=>{const n=getInstall(),r=`${CDN_URL}map/car-icon.gif`;currentTruckOverlay||(currentTruckOverlay=new Overlay({element:document.createElement("div"),positioning:"center-center",stopEvent:!1}),n.addOverlay(currentTruckOverlay));const i=currentTruckOverlay.getElement();i.style.backgroundImage=`url(${r})`,i.style.width="80px",i.style.height="80px";const g=(t==null?void 0:t.drc)||"";i.style.transform=`rotate(${g}deg)`,i.style.backgroundSize="cover",currentTruckOverlay==null||currentTruckOverlay.setPosition(e)},renderTruckTrack=(t,e,n,r=1e3)=>{renderTrackLine(t,e,n,LENGTH_UNIT.KM)},closeTruckTrack=()=>{closeTrack()},removeTruckIcon=()=>{const t=currentTruckOverlay==null?void 0:currentTruckOverlay.getElement();t&&(t.innerHTML="")},resetTrackView=t=>{setTrackViewCenter(t)},playTrack=(t,e)=>{playShipTrack(t,e)},LOCATION_LAYER_CLASS_NAME="zh-map-location-layer";let vectorLayer,vectorSource,selectedPortFeature=null,selectedloactionData=null;const render=t=>{var e;if(!(!t||t.length===0)){if(vectorSource||(vectorSource=new VectorSource),vectorSource.clear(),selectedloactionData){const n=t.find(r=>r.id===selectedloactionData.id);n?selectedloactionData=n:t.push(selectedloactionData)}t.forEach(n=>{renderPortPoint(n)}),vectorLayer||(vectorLayer=new VectorLayer({className:LOCATION_LAYER_CLASS_NAME,source:vectorSource,zIndex:100}),(e=getInstall())==null||e.addLayer(vectorLayer))}},renderPortPoint=t=>{const e=getZoom(),[n,r]=t.latLon.split(","),i=new Feature({geometry:new Point(fromLonLat([Number(n),Number(r)]))});i.setStyle(setPortStyle(t,e,t.id===(selectedloactionData==null?void 0:selectedloactionData.id))),i.set("loactionData",t),vectorSource.addFeature(i)},setPortStyle=(t,e,n)=>{const r={image:new Icon({src:n&&t.selectedPath||t.defaultPath,scale:.5*e/10})};return t.name&&(r.text=new Text({text:t.name,font:"12px sans-serif",fill:new Fill({color:"#000000"}),backgroundFill:new Fill({color:"#FFFFFF"}),offsetY:30})),new Style(r)},clearList=()=>{if(selectedPortFeature){const t=selectedPortFeature.get("loactionData").id;vectorSource.getFeatures().forEach(e=>{e.get("loactionData").id!==t&&vectorSource.removeFeature(e)})}else vectorSource.clear()},clearSelected=()=>{const t=selectedPortFeature.get("loactionData"),e=getZoom();vectorSource.getFeatures().forEach(r=>{r.get("loactionData").id===t.id&&(r==null||r.setStyle(setPortStyle(t,e,!1)))}),selectedloactionData=null,selectedPortFeature=null},selectedLocation=t=>{t?(clearPrevSelectedPort(),addSelectedPortStyle(t)):clearSelectedPort()},clearPrevSelectedPort=()=>{if(selectedPortFeature){const t=selectedPortFeature.get("loactionData"),e=getZoom();selectedPortFeature.setStyle(setPortStyle(t,e,!1))}},addSelectedPortStyle=t=>{const e=vectorSource.getFeatures();selectedloactionData=t,selectedPortFeature=e.find(n=>n.get("loactionData").id===t.id)},position={render,selected:selectedLocation,clearSelected,clear:clearList},_hoisted_1$6={class:"zh-map-box"},_sfc_main$7=vue.defineComponent({__name:"Map",props:{zoom:{default:MAP_ZOOM.default},center:{default:MAP_DEFAULT_CENTER},layerType:{default:"vector"},showGreenLayer:{type:Boolean,default:!1},showScale:{type:Boolean,default:!0},scaleLineUnit:{default:"metric"},mapMoveEnd:{type:Function,default:()=>{}},lineDrawEnd:{},areaDrawEnd:{type:Function,default:()=>{}},selectShip:{type:Function,default:()=>{}},selectPort:{type:Function,default:()=>{}}},setup(t,{expose:e}){const n=vue.ref(),r=vue.ref(),i=t;return vue.onMounted(()=>{var y;initMap(i),setProps(i),setShowLayerType(i.layerType),setGreenTileVisible(i.showGreenLayer),(y=r.value)==null||y.setScaleLine(i.scaleLineUnit)}),e({getInstall,getZoom,setZoom,getView,setCenter,getCenter,layer:{getGreenTileVisible,setGreenTileVisible,getShowLayerType,setShowLayerType},ship:{render:renderShipList,selected:renderShipSelected,filter:filterShipShow,blinking:renderShipBlink,clear:clearShipList},track:{render:renderTrackLine,remove:removeAllTrackLayer,play:playShipTrack,setCenter:setTrackViewCenter,close:closeTrack,getLength:getTrackLength},port:{render:renderPortList,clear:clearPortList,selected:selectedPort},position,drawLine,drawPolygon,carTrack:{location:locationTruck,remove:removeTruckIcon,renderTrack:renderTruckTrack,setCenter:resetTrackView,closeTrack:closeTruckTrack,playTrack},utils:{getCalculateExtent:()=>{const y=getView().calculateExtent(getSize()),k=transform([y[0],y[1]],projection.mercator,projection.data),L=transform([y[2],y[3]],projection.mercator,projection.data);return[k[0],k[1],L[0],L[1]]},convertSixHundredThousandToLatLng,calculateCirclePoints}}),(y,k)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$6,[vue.createElementVNode("div",{id:"map",ref_key:"zhMapRef",ref:n,class:"zh-map"},null,512),vue.createVNode(ScaleLine,{ref_key:"scaleLineRef",ref:r},null,512),vue.createVNode(ZoomControl,{ref:"zoomControlRef"},null,512)]))}}),Map$1=_export_sfc(_sfc_main$7,[["__scopeId","data-v-d813907c"]]),ZhMap=withInstall$1(Map$1);var zhCn={name:"zh-cn",el:{breadcrumb:{label:"面包屑"},colorpicker:{confirm:"确定",clear:"清空",defaultLabel:"颜色选择器",description:"当前颜色 {color},按 Enter 键选择新颜色",alphaLabel:"选择透明度的值"},datepicker:{now:"此刻",today:"今天",cancel:"取消",clear:"清空",confirm:"确定",dateTablePrompt:"使用方向键与 Enter 键可选择日期",monthTablePrompt:"使用方向键与 Enter 键可选择月份",yearTablePrompt:"使用方向键与 Enter 键可选择年份",selectedDate:"已选日期",selectDate:"选择日期",selectTime:"选择时间",startDate:"开始日期",startTime:"开始时间",endDate:"结束日期",endTime:"结束时间",prevYear:"前一年",nextYear:"后一年",prevMonth:"上个月",nextMonth:"下个月",year:"年",month1:"1 月",month2:"2 月",month3:"3 月",month4:"4 月",month5:"5 月",month6:"6 月",month7:"7 月",month8:"8 月",month9:"9 月",month10:"10 月",month11:"11 月",month12:"12 月",weeks:{sun:"日",mon:"一",tue:"二",wed:"三",thu:"四",fri:"五",sat:"六"},weeksFull:{sun:"星期日",mon:"星期一",tue:"星期二",wed:"星期三",thu:"星期四",fri:"星期五",sat:"星期六"},months:{jan:"一月",feb:"二月",mar:"三月",apr:"四月",may:"五月",jun:"六月",jul:"七月",aug:"八月",sep:"九月",oct:"十月",nov:"十一月",dec:"十二月"}},inputNumber:{decrease:"减少数值",increase:"增加数值"},select:{loading:"加载中",noMatch:"无匹配数据",noData:"无数据",placeholder:"请选择"},dropdown:{toggleDropdown:"切换下拉选项"},mention:{loading:"加载中"},cascader:{noMatch:"无匹配数据",loading:"加载中",placeholder:"请选择",noData:"暂无数据"},pagination:{goto:"前往",pagesize:"条/页",total:"共 {total} 条",pageClassifier:"页",page:"页",prev:"上一页",next:"下一页",currentPage:"第 {pager} 页",prevPages:"向前 {pager} 页",nextPages:"向后 {pager} 页",deprecationWarning:"你使用了一些已被废弃的用法,请参考 el-pagination 的官方文档"},dialog:{close:"关闭此对话框"},drawer:{close:"关闭此对话框"},messagebox:{title:"提示",confirm:"确定",cancel:"取消",error:"输入的数据不合法!",close:"关闭此对话框"},upload:{deleteTip:"按 delete 键可删除",delete:"删除",preview:"查看图片",continue:"继续上传"},slider:{defaultLabel:"滑块介于 {min} 至 {max}",defaultRangeStartLabel:"选择起始值",defaultRangeEndLabel:"选择结束值"},table:{emptyText:"暂无数据",confirmFilter:"筛选",resetFilter:"重置",clearFilter:"全部",sumText:"合计"},tour:{next:"下一步",previous:"上一步",finish:"结束导览"},tree:{emptyText:"暂无数据"},transfer:{noMatch:"无匹配数据",noData:"无数据",titles:["列表 1","列表 2"],filterPlaceholder:"请输入搜索内容",noCheckedFormat:"共 {total} 项",hasCheckedFormat:"已选 {checked}/{total} 项"},image:{error:"加载失败"},pageHeader:{title:"返回"},popconfirm:{confirmButtonText:"确定",cancelButtonText:"取消"},carousel:{leftArrow:"上一张幻灯片",rightArrow:"下一张幻灯片",indicator:"幻灯片切换至索引 {index}"}}};/**!
235
235
  * Sortable 1.15.6
236
236
  * @author RubaXa <trash@rubaxa.org>
237
237
  * @author owenm <owen23355@gmail.com>