All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.pepstock.charba.client.resources.LuxonLibraryResource Maven / Gradle / Ivy

/**
    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License.  You may obtain a copy of the License at
    
      http://www.apache.org/licenses/LICENSE-2.0
    
    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.
*/
package org.pepstock.charba.client.resources;
 
/**
 * Contains the content of luxon.min.js to inject.
* * @author Andrea "Stock" Stocchero * */ final class LuxonLibraryResource extends AbstractInjectableResource { // encoded javascript content of luxon.min.js private static final String[] CONTENT = { "var luxon=function(e){\"use strict\";function L(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[n++]}};throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order t", "o be iterable, non-array objects must have a [Symbol.iterator]() method.\")}var t=function(e){function t(){return e.apply(this,arguments)||this}return o(t,e),t}(q(Error)),Y=function(t){function e(e){return t.call(this,\"Invalid DateTime: \"+e.toMessage())||this}return o(e,t),e}(t),P=function(t){function e(e){return t.call(this,\"Invalid Interval: \"+e.toMessage())||this}return o(e,t),e}(t),H=function(t){function e(e){return t.call(this,\"Invalid Duration: \"+e.toMessage())||this}return o(e,t),e}(t),w=function(e){function t(){return e.apply(this,arguments)||this}return o(t,e),t}(t),J=function(t){function e(e){return t.call(this,\"Invalid unit \"+e)||this}return o(e,t),e}(t),u=function(e){function t(){return e.apply(this,arguments)||this}return o(t,e),t}(t),n=function(e){function t(){return e.call(this,\"Zone is an abstract class\")||this}return o(t,e),t}(t),t=\"numeric\",r=\"short\",a=\"long\",G={year:t,month:t,day:t},$={year:t,month:r,day:t},B={year:t,month:r,day:t,weekday:r},Q={year:t,", "month:a,day:t},K={year:t,month:a,day:t,weekday:a},X={hour:t,minute:t},ee={hour:t,minute:t,second:t},te={hour:t,minute:t,second:t,timeZoneName:r},ne={hour:t,minute:t,second:t,timeZoneName:a},re={hour:t,minute:t,hourCycle:\"h23\"},ie={hour:t,minute:t,second:t,hourCycle:\"h23\"},oe={hour:t,minute:t,second:t,hourCycle:\"h23\",timeZoneName:r},ae={hour:t,minute:t,second:t,hourCycle:\"h23\",timeZoneName:a},ue={year:t,month:t,day:t,hour:t,minute:t},se={year:t,month:t,day:t,hour:t,minute:t,second:t},le={year:t,month:r,day:t,hour:t,minute:t},ce={year:t,month:r,day:t,hour:t,minute:t,second:t},fe={year:t,month:r,day:t,weekday:r,hour:t,minute:t},de={year:t,month:a,day:t,hour:t,minute:t,timeZoneName:r},he={year:t,month:a,day:t,hour:t,minute:t,second:t,timeZoneName:r},me={year:t,month:a,day:t,weekday:a,hour:t,minute:t,timeZoneName:a},ye={year:t,month:a,day:t,weekday:a,hour:t,minute:t,second:t,timeZoneName:a},s=function(){function e(){}var t=e.prototype;return t.offsetName=function(e,t){throw new n},t.", "formatOffset=function(e,t){throw new n},t.offset=function(e){throw new n},t.equals=function(e){throw new n},i(e,[{key:\"type\",get:function(){throw new n}},{key:\"name\",get:function(){throw new n}},{key:\"ianaName\",get:function(){return this.name}},{key:\"isUniversal\",get:function(){throw new n}},{key:\"isValid\",get:function(){throw new n}}]),e}(),ve=null,ge=function(e){function t(){return e.apply(this,arguments)||this}o(t,e);var n=t.prototype;return n.offsetName=function(e,t){return gt(e,t.format,t.locale)},n.formatOffset=function(e,t){return bt(this.offset(e),t)},n.offset=function(e){return-new Date(e).getTimezoneOffset()},n.equals=function(e){return\"system\"===e.type},i(t,[{key:\"type\",get:function(){return\"system\"}},{key:\"name\",get:function(){return(new Intl.DateTimeFormat).resolvedOptions().timeZone}},{key:\"isUniversal\",get:function(){return!1}},{key:\"isValid\",get:function(){return!0}}],[{key:\"instance\",get:function(){return ve=null===ve?new t:ve}}]),t}(s),pe={};var", " ke={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};var we={},f=function(n){function r(e){var t=n.call(this)||this;return t.zoneName=e,t.valid=r.isValidZone(e),t}o(r,n),r.create=function(e){return we[e]||(we[e]=new r(e)),we[e]},r.resetCache=function(){we={},pe={}},r.isValidSpecifier=function(e){return this.isValidZone(e)},r.isValidZone=function(e){if(!e)return!1;try{return new Intl.DateTimeFormat(\"en-US\",{timeZone:e}).format(),!0}catch(e){return!1}};var e=r.prototype;return e.offsetName=function(e,t){return gt(e,t.format,t.locale,this.name)},e.formatOffset=function(e,t){return bt(this.offset(e),t)},e.offset=function(e){var t,n,r,i,o,a,u,s,e=new Date(e);return isNaN(e)?NaN:(i=this.name,pe[i]||(pe[i]=new Intl.DateTimeFormat(\"en-US\",{hour12:!1,timeZone:i,year:\"numeric\",month:\"2-digit\",day:\"2-digit\",hour:\"2-digit\",minute:\"2-digit\",second:\"2-digit\",era:\"short\"})),a=(i=(i=pe[i]).formatToParts?function(e,t){for(var n=e.formatToParts(t),r=[],i=0;iyt(i,t,n)?(r=i+1,a=1):r=i,l({weekYear:r,weekNumber:a,weekday:o},St(e))}function Ke(e,t,n){void 0===n&&(n=1);var r,i=e.weekYear,o=e.weekNumber,a=e.weekday,n=Be(Je(i,1,t=void 0===t?4:t),n),u=M(i),o=7*o+a-n-7+t,a=(o<1?o+=M(r=i-1):uO.twoDigitCutoffYear?1900+e:2e3+e}function gt(e,t,n,r){void 0===r&&(r=null);var e=new Date(e),i={hourCycle:\"h23\",year:\"numeric\",month:\"2-digit\",day:\"2-digit\",hour:\"2-digit\",minute:\"2-digit\"},r=(r&&(i.timeZone=r),l({timeZoneName:t},i)),t=new Intl.DateTimeFormat(n,r).formatToParts(e).find(function(e){return\"timezonename\"===e.type.toLowerCase()});return t?t.value:null}function pt(e,t){e=parseInt(e,10),Number.isNaN(e)&&(e=0),t=parseInt(t,10)||0;return 60*e+(e<0||Object.is(e,-0)?-t:t)}function kt(e){var t=Number(e);if(\"boolean\"==typeof e||\"\"===e||Number.isNaN(t))", "throw new u(\"Invalid unit value \"+e);return t}function wt(e,t){var n,r,i={};for(n in e)h(e,n)&&null!=(r=e[n])&&(i[t(n)]=kt(r));return i}function bt(e,t){var n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),i=0<=e?\"+\":\"-\";switch(t){case\"short\":return i+m(n,2)+\":\"+m(r,2);case\"narrow\":return i+n+(0e},t.isBefore=function(e){return!!this.isValid&&this.e<=e},t.contains=function(e){return!!this.isValid&&this.s<=e&&this.e>e},t.set=function(e){var e=void 0===e?{}:e,t=e.start,e=e.end;return this.isValid?l.fromDateTimes(t||this.s,e||this.e):this},t.splitAt=function(){var t=this;if(!this.isValid)return[];for(var e=arguments.length,n=new Array(e),r=0;r+this.e?this.e:s;o.push(l.fromDateTimes(a,s)),a=s,u+=1}return o},t.splitBy=function(e){var t=E.fromDurationLike(e);if(!this.isValid||!t.isValid||0===t.as(\"milliseconds\"))return[];for(var n=this.s,r=1,i=[];n+this.e?this.e:o;i.push(l.fromDateTimes(n,o)),n=o,r+=1}return i},t.divideEqually=function(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]},t.overlaps=function(e){return this.e>e.s&&this.s=e.e},t.equals=function(e){return!(!this.isValid||!e.isValid)&&this.s.equals(e.s)&&this.e.equals(e.e)},t.intersection=function(e){var t;return this.isValid?(t=(this.s>e.s?this:e).s,(e=(this.ee.e?this:e).e,l.fromDateTimes(t,e)):this},l.merge=function(e){var e=e.sort(function(e,t){return e.s-t.s}).reduce(function(e,t){var n=e[0],e=e[1];return e?e.overlaps(t)||e.abutsStart(t)?[n,e.union(t)]:[n.concat([e]),t]:[n,t]},[[],null]),t=e[0],e=e[1];return e&&t.push(e),t},l.xor=function(e){for(var t,n=null,r=0,i=[],e=e.map(function(e){return[{time:e.s,type:\"s\"},{time:e.e,type:\"e\"}]}),o=R((t=Array.prototype).concat.apply(t,e).sort(function(e,t){return e.time-t.time}));!(a=o()).done;)var a=a.value,n=1===(r+=\"s\"===a.type?1:-1)?a.time:(n&&+n!=+a.time&&i.push(l.fromDateTimes(n,a.time)),null);return l.merge(i)},t.difference=function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;rthis.valueOf())?this:e,r?e:this,t,n),r?e.negate():e):E.invalid(\"created by diffing an invalid DateTime\")},t.diffNow=function(e,t){return void 0===e&&(e=\"milliseconds\"),void 0===t&&(t={}),this.diff(k.now(),e,t)},t.until=function(e){return this.isValid?Mn.fromDateTimes(this,e):this},t.hasSame=function(e,t,n){var r;return!!this.isValid&&(r=e.valueOf(),(e=this.setZone(e.zone,{keepLocalTime:!0})).startOf(t,n)<=r)&&r<=e.endOf(t,n)},t.equals=function(e){retu", "rn this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)},t.toRelative=function(e){var t,n,r,i;return this.isValid?(t=(e=void 0===e?{}:e).base||k.fromObject({},{zone:this.zone}),n=e.padding?thisthis.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset)}},{key:\"isInLeapYear\",get:function(){return ft(this.year)}},{key:\"daysInMonth\",get:function(){return dt(this.year,this.month)}},{key:\"daysInYear\",get:function(){return this.isValid?M(this.year):NaN}},{key:\"weeksInWeekYear\",get:function(){return this.isValid?yt(this.weekYear):NaN}},{key:\"weeksInLocalWeekYear\",get:function(){return this.isValid?yt(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}}],[{key:\"DATE_SHORT\",get:function(){return G}},{key:\"DATE_MED\",get:function(){return $}},{key:\"DATE_MED_WITH_WEEKDAY\",get:function(){return B}},{key:\"DATE_FULL\",get:function(){return Q}},{key:\"DATE_HUGE\",get:function(){return K}},{key:\"TIME_SIMPLE\",ge", "t:function(){return X}},{key:\"TIME_WITH_SECONDS\",get:function(){return ee}},{key:\"TIME_WITH_SHORT_OFFSET\",get:function(){return te}},{key:\"TIME_WITH_LONG_OFFSET\",get:function(){return ne}},{key:\"TIME_24_SIMPLE\",get:function(){return re}},{key:\"TIME_24_WITH_SECONDS\",get:function(){return ie}},{key:\"TIME_24_WITH_SHORT_OFFSET\",get:function(){return oe}},{key:\"TIME_24_WITH_LONG_OFFSET\",get:function(){return ae}},{key:\"DATETIME_SHORT\",get:function(){return ue}},{key:\"DATETIME_SHORT_WITH_SECONDS\",get:function(){return se}},{key:\"DATETIME_MED\",get:function(){return le}},{key:\"DATETIME_MED_WITH_SECONDS\",get:function(){return ce}},{key:\"DATETIME_MED_WITH_WEEKDAY\",get:function(){return fe}},{key:\"DATETIME_FULL\",get:function(){return de}},{key:\"DATETIME_FULL_WITH_SECONDS\",get:function(){return he}},{key:\"DATETIME_HUGE\",get:function(){return me}},{key:\"DATETIME_HUGE_WITH_SECONDS\",get:function(){return ye}}]),k}(Symbol.for(\"nodejs.util.inspect.custom\"));function yr(", "e){if(W.isDateTime(e))return e;if(e&&e.valueOf&&y(e.valueOf()))return W.fromJSDate(e);if(e&&\"object\"==typeof e)return W.fromObject(e);throw new u(\"Unknown datetime argument: \"+e+\", of type \"+typeof e)}return e.DateTime=W,e.Duration=E,e.FixedOffsetZone=d,e.IANAZone=f,e.Info=In,e.Interval=Mn,e.InvalidZone=Le,e.Settings=O,e.SystemZone=ge,e.VERSION=\"3.4.4\",e.Zone=s,Object.defineProperty(e,\"__esModule\",{value:!0}),e}({});" }; /** * Creates the injectable resource with luxon.min.js content. */ LuxonLibraryResource() { super(ResourceName.DATE_TIME_LIBRARY, CONTENT); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy