cdn.js 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533
  1. (() => {
  2. var _window$dateFns;function _typeof(o) {"@babel/helpers - typeof";return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {return typeof o;} : function (o) {return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;}, _typeof(o);}function ownKeys(e, r) {var t = Object.keys(e);if (Object.getOwnPropertySymbols) {var o = Object.getOwnPropertySymbols(e);r && (o = o.filter(function (r) {return Object.getOwnPropertyDescriptor(e, r).enumerable;})), t.push.apply(t, o);}return t;}function _objectSpread(e) {for (var r = 1; r < arguments.length; r++) {var t = null != arguments[r] ? arguments[r] : {};r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {_defineProperty(e, r, t[r]);}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));});}return e;}function _defineProperty(obj, key, value) {key = _toPropertyKey(key);if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}function _toPropertyKey(t) {var i = _toPrimitive(t, "string");return "symbol" == _typeof(i) ? i : String(i);}function _toPrimitive(t, r) {if ("object" != _typeof(t) || !t) return t;var e = t[Symbol.toPrimitive];if (void 0 !== e) {var i = e.call(t, r || "default");if ("object" != _typeof(i)) return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return ("string" === r ? String : Number)(t);}var __defProp = Object.defineProperty;
  3. var __export = function __export(target, all) {
  4. for (var name in all)
  5. __defProp(target, name, {
  6. get: all[name],
  7. enumerable: true,
  8. configurable: true,
  9. set: function set(newValue) {return all[name] = function () {return newValue;};}
  10. });
  11. };
  12. // lib/locale/pt/_lib/formatDistance.js
  13. var formatDistanceLocale = {
  14. lessThanXSeconds: {
  15. one: "menos de um segundo",
  16. other: "menos de {{count}} segundos"
  17. },
  18. xSeconds: {
  19. one: "1 segundo",
  20. other: "{{count}} segundos"
  21. },
  22. halfAMinute: "meio minuto",
  23. lessThanXMinutes: {
  24. one: "menos de um minuto",
  25. other: "menos de {{count}} minutos"
  26. },
  27. xMinutes: {
  28. one: "1 minuto",
  29. other: "{{count}} minutos"
  30. },
  31. aboutXHours: {
  32. one: "aproximadamente 1 hora",
  33. other: "aproximadamente {{count}} horas"
  34. },
  35. xHours: {
  36. one: "1 hora",
  37. other: "{{count}} horas"
  38. },
  39. xDays: {
  40. one: "1 dia",
  41. other: "{{count}} dias"
  42. },
  43. aboutXWeeks: {
  44. one: "aproximadamente 1 semana",
  45. other: "aproximadamente {{count}} semanas"
  46. },
  47. xWeeks: {
  48. one: "1 semana",
  49. other: "{{count}} semanas"
  50. },
  51. aboutXMonths: {
  52. one: "aproximadamente 1 m\xEAs",
  53. other: "aproximadamente {{count}} meses"
  54. },
  55. xMonths: {
  56. one: "1 m\xEAs",
  57. other: "{{count}} meses"
  58. },
  59. aboutXYears: {
  60. one: "aproximadamente 1 ano",
  61. other: "aproximadamente {{count}} anos"
  62. },
  63. xYears: {
  64. one: "1 ano",
  65. other: "{{count}} anos"
  66. },
  67. overXYears: {
  68. one: "mais de 1 ano",
  69. other: "mais de {{count}} anos"
  70. },
  71. almostXYears: {
  72. one: "quase 1 ano",
  73. other: "quase {{count}} anos"
  74. }
  75. };
  76. var formatDistance = function formatDistance(token, count, options) {
  77. var result;
  78. var tokenValue = formatDistanceLocale[token];
  79. if (typeof tokenValue === "string") {
  80. result = tokenValue;
  81. } else if (count === 1) {
  82. result = tokenValue.one;
  83. } else {
  84. result = tokenValue.other.replace("{{count}}", String(count));
  85. }
  86. if (options !== null && options !== void 0 && options.addSuffix) {
  87. if (options.comparison && options.comparison > 0) {
  88. return "daqui a " + result;
  89. } else {
  90. return "h\xE1 " + result;
  91. }
  92. }
  93. return result;
  94. };
  95. // lib/locale/_lib/buildFormatLongFn.js
  96. function buildFormatLongFn(args) {
  97. return function () {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  98. var width = options.width ? String(options.width) : args.defaultWidth;
  99. var format = args.formats[width] || args.formats[args.defaultWidth];
  100. return format;
  101. };
  102. }
  103. // lib/locale/pt/_lib/formatLong.js
  104. var dateFormats = {
  105. full: "EEEE, d 'de' MMMM 'de' y",
  106. long: "d 'de' MMMM 'de' y",
  107. medium: "d 'de' MMM 'de' y",
  108. short: "dd/MM/y"
  109. };
  110. var timeFormats = {
  111. full: "HH:mm:ss zzzz",
  112. long: "HH:mm:ss z",
  113. medium: "HH:mm:ss",
  114. short: "HH:mm"
  115. };
  116. var dateTimeFormats = {
  117. full: "{{date}} '\xE0s' {{time}}",
  118. long: "{{date}} '\xE0s' {{time}}",
  119. medium: "{{date}}, {{time}}",
  120. short: "{{date}}, {{time}}"
  121. };
  122. var formatLong = {
  123. date: buildFormatLongFn({
  124. formats: dateFormats,
  125. defaultWidth: "full"
  126. }),
  127. time: buildFormatLongFn({
  128. formats: timeFormats,
  129. defaultWidth: "full"
  130. }),
  131. dateTime: buildFormatLongFn({
  132. formats: dateTimeFormats,
  133. defaultWidth: "full"
  134. })
  135. };
  136. // lib/locale/pt/_lib/formatRelative.js
  137. var formatRelativeLocale = {
  138. lastWeek: function lastWeek(date) {
  139. var weekday = date.getDay();
  140. var last = weekday === 0 || weekday === 6 ? "\xFAltimo" : "\xFAltima";
  141. return "'" + last + "' eeee '\xE0s' p";
  142. },
  143. yesterday: "'ontem \xE0s' p",
  144. today: "'hoje \xE0s' p",
  145. tomorrow: "'amanh\xE3 \xE0s' p",
  146. nextWeek: "eeee '\xE0s' p",
  147. other: "P"
  148. };
  149. var formatRelative = function formatRelative(token, date, _baseDate, _options) {
  150. var format = formatRelativeLocale[token];
  151. if (typeof format === "function") {
  152. return format(date);
  153. }
  154. return format;
  155. };
  156. // lib/locale/_lib/buildLocalizeFn.js
  157. function buildLocalizeFn(args) {
  158. return function (value, options) {
  159. var context = options !== null && options !== void 0 && options.context ? String(options.context) : "standalone";
  160. var valuesArray;
  161. if (context === "formatting" && args.formattingValues) {
  162. var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
  163. var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;
  164. valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
  165. } else {
  166. var _defaultWidth = args.defaultWidth;
  167. var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;
  168. valuesArray = args.values[_width] || args.values[_defaultWidth];
  169. }
  170. var index = args.argumentCallback ? args.argumentCallback(value) : value;
  171. return valuesArray[index];
  172. };
  173. }
  174. // lib/locale/pt/_lib/localize.js
  175. var eraValues = {
  176. narrow: ["aC", "dC"],
  177. abbreviated: ["a.C.", "d.C."],
  178. wide: ["antes de Cristo", "depois de Cristo"]
  179. };
  180. var quarterValues = {
  181. narrow: ["1", "2", "3", "4"],
  182. abbreviated: ["T1", "T2", "T3", "T4"],
  183. wide: ["1\xBA trimestre", "2\xBA trimestre", "3\xBA trimestre", "4\xBA trimestre"]
  184. };
  185. var monthValues = {
  186. narrow: ["j", "f", "m", "a", "m", "j", "j", "a", "s", "o", "n", "d"],
  187. abbreviated: [
  188. "jan",
  189. "fev",
  190. "mar",
  191. "abr",
  192. "mai",
  193. "jun",
  194. "jul",
  195. "ago",
  196. "set",
  197. "out",
  198. "nov",
  199. "dez"],
  200. wide: [
  201. "janeiro",
  202. "fevereiro",
  203. "mar\xE7o",
  204. "abril",
  205. "maio",
  206. "junho",
  207. "julho",
  208. "agosto",
  209. "setembro",
  210. "outubro",
  211. "novembro",
  212. "dezembro"]
  213. };
  214. var dayValues = {
  215. narrow: ["d", "s", "t", "q", "q", "s", "s"],
  216. short: ["dom", "seg", "ter", "qua", "qui", "sex", "s\xE1b"],
  217. abbreviated: ["dom", "seg", "ter", "qua", "qui", "sex", "s\xE1b"],
  218. wide: [
  219. "domingo",
  220. "segunda-feira",
  221. "ter\xE7a-feira",
  222. "quarta-feira",
  223. "quinta-feira",
  224. "sexta-feira",
  225. "s\xE1bado"]
  226. };
  227. var dayPeriodValues = {
  228. narrow: {
  229. am: "AM",
  230. pm: "PM",
  231. midnight: "meia-noite",
  232. noon: "meio-dia",
  233. morning: "manh\xE3",
  234. afternoon: "tarde",
  235. evening: "noite",
  236. night: "madrugada"
  237. },
  238. abbreviated: {
  239. am: "AM",
  240. pm: "PM",
  241. midnight: "meia-noite",
  242. noon: "meio-dia",
  243. morning: "manh\xE3",
  244. afternoon: "tarde",
  245. evening: "noite",
  246. night: "madrugada"
  247. },
  248. wide: {
  249. am: "AM",
  250. pm: "PM",
  251. midnight: "meia-noite",
  252. noon: "meio-dia",
  253. morning: "manh\xE3",
  254. afternoon: "tarde",
  255. evening: "noite",
  256. night: "madrugada"
  257. }
  258. };
  259. var formattingDayPeriodValues = {
  260. narrow: {
  261. am: "AM",
  262. pm: "PM",
  263. midnight: "meia-noite",
  264. noon: "meio-dia",
  265. morning: "da manh\xE3",
  266. afternoon: "da tarde",
  267. evening: "da noite",
  268. night: "da madrugada"
  269. },
  270. abbreviated: {
  271. am: "AM",
  272. pm: "PM",
  273. midnight: "meia-noite",
  274. noon: "meio-dia",
  275. morning: "da manh\xE3",
  276. afternoon: "da tarde",
  277. evening: "da noite",
  278. night: "da madrugada"
  279. },
  280. wide: {
  281. am: "AM",
  282. pm: "PM",
  283. midnight: "meia-noite",
  284. noon: "meio-dia",
  285. morning: "da manh\xE3",
  286. afternoon: "da tarde",
  287. evening: "da noite",
  288. night: "da madrugada"
  289. }
  290. };
  291. var ordinalNumber = function ordinalNumber(dirtyNumber, _options) {
  292. var number = Number(dirtyNumber);
  293. return number + "\xBA";
  294. };
  295. var localize = {
  296. ordinalNumber: ordinalNumber,
  297. era: buildLocalizeFn({
  298. values: eraValues,
  299. defaultWidth: "wide"
  300. }),
  301. quarter: buildLocalizeFn({
  302. values: quarterValues,
  303. defaultWidth: "wide",
  304. argumentCallback: function argumentCallback(quarter) {return quarter - 1;}
  305. }),
  306. month: buildLocalizeFn({
  307. values: monthValues,
  308. defaultWidth: "wide"
  309. }),
  310. day: buildLocalizeFn({
  311. values: dayValues,
  312. defaultWidth: "wide"
  313. }),
  314. dayPeriod: buildLocalizeFn({
  315. values: dayPeriodValues,
  316. defaultWidth: "wide",
  317. formattingValues: formattingDayPeriodValues,
  318. defaultFormattingWidth: "wide"
  319. })
  320. };
  321. // lib/locale/_lib/buildMatchFn.js
  322. function buildMatchFn(args) {
  323. return function (string) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  324. var width = options.width;
  325. var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
  326. var matchResult = string.match(matchPattern);
  327. if (!matchResult) {
  328. return null;
  329. }
  330. var matchedString = matchResult[0];
  331. var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
  332. var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {return pattern.test(matchedString);}) : findKey(parsePatterns, function (pattern) {return pattern.test(matchedString);});
  333. var value;
  334. value = args.valueCallback ? args.valueCallback(key) : key;
  335. value = options.valueCallback ? options.valueCallback(value) : value;
  336. var rest = string.slice(matchedString.length);
  337. return { value: value, rest: rest };
  338. };
  339. }
  340. function findKey(object, predicate) {
  341. for (var key in object) {
  342. if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) {
  343. return key;
  344. }
  345. }
  346. return;
  347. }
  348. function findIndex(array, predicate) {
  349. for (var key = 0; key < array.length; key++) {
  350. if (predicate(array[key])) {
  351. return key;
  352. }
  353. }
  354. return;
  355. }
  356. // lib/locale/_lib/buildMatchPatternFn.js
  357. function buildMatchPatternFn(args) {
  358. return function (string) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  359. var matchResult = string.match(args.matchPattern);
  360. if (!matchResult)
  361. return null;
  362. var matchedString = matchResult[0];
  363. var parseResult = string.match(args.parsePattern);
  364. if (!parseResult)
  365. return null;
  366. var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
  367. value = options.valueCallback ? options.valueCallback(value) : value;
  368. var rest = string.slice(matchedString.length);
  369. return { value: value, rest: rest };
  370. };
  371. }
  372. // lib/locale/pt/_lib/match.js
  373. var matchOrdinalNumberPattern = /^(\d+)(º|ª)?/i;
  374. var parseOrdinalNumberPattern = /\d+/i;
  375. var matchEraPatterns = {
  376. narrow: /^(ac|dc|a|d)/i,
  377. abbreviated: /^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,
  378. wide: /^(antes de cristo|antes da era comum|depois de cristo|era comum)/i
  379. };
  380. var parseEraPatterns = {
  381. any: [/^ac/i, /^dc/i],
  382. wide: [
  383. /^(antes de cristo|antes da era comum)/i,
  384. /^(depois de cristo|era comum)/i]
  385. };
  386. var matchQuarterPatterns = {
  387. narrow: /^[1234]/i,
  388. abbreviated: /^T[1234]/i,
  389. wide: /^[1234](º|ª)? trimestre/i
  390. };
  391. var parseQuarterPatterns = {
  392. any: [/1/i, /2/i, /3/i, /4/i]
  393. };
  394. var matchMonthPatterns = {
  395. narrow: /^[jfmasond]/i,
  396. abbreviated: /^(jan|fev|mar|abr|mai|jun|jul|ago|set|out|nov|dez)/i,
  397. wide: /^(janeiro|fevereiro|março|abril|maio|junho|julho|agosto|setembro|outubro|novembro|dezembro)/i
  398. };
  399. var parseMonthPatterns = {
  400. narrow: [
  401. /^j/i,
  402. /^f/i,
  403. /^m/i,
  404. /^a/i,
  405. /^m/i,
  406. /^j/i,
  407. /^j/i,
  408. /^a/i,
  409. /^s/i,
  410. /^o/i,
  411. /^n/i,
  412. /^d/i],
  413. any: [
  414. /^ja/i,
  415. /^f/i,
  416. /^mar/i,
  417. /^ab/i,
  418. /^mai/i,
  419. /^jun/i,
  420. /^jul/i,
  421. /^ag/i,
  422. /^s/i,
  423. /^o/i,
  424. /^n/i,
  425. /^d/i]
  426. };
  427. var matchDayPatterns = {
  428. narrow: /^[dstq]/i,
  429. short: /^(dom|seg|ter|qua|qui|sex|s[áa]b)/i,
  430. abbreviated: /^(dom|seg|ter|qua|qui|sex|s[áa]b)/i,
  431. wide: /^(domingo|segunda-?\s?feira|terça-?\s?feira|quarta-?\s?feira|quinta-?\s?feira|sexta-?\s?feira|s[áa]bado)/i
  432. };
  433. var parseDayPatterns = {
  434. narrow: [/^d/i, /^s/i, /^t/i, /^q/i, /^q/i, /^s/i, /^s/i],
  435. any: [/^d/i, /^seg/i, /^t/i, /^qua/i, /^qui/i, /^sex/i, /^s[áa]/i]
  436. };
  437. var matchDayPeriodPatterns = {
  438. narrow: /^(a|p|meia-?\s?noite|meio-?\s?dia|(da) (manh[ãa]|tarde|noite|madrugada))/i,
  439. any: /^([ap]\.?\s?m\.?|meia-?\s?noite|meio-?\s?dia|(da) (manh[ãa]|tarde|noite|madrugada))/i
  440. };
  441. var parseDayPeriodPatterns = {
  442. any: {
  443. am: /^a/i,
  444. pm: /^p/i,
  445. midnight: /^meia/i,
  446. noon: /^meio/i,
  447. morning: /manh[ãa]/i,
  448. afternoon: /tarde/i,
  449. evening: /noite/i,
  450. night: /madrugada/i
  451. }
  452. };
  453. var match = {
  454. ordinalNumber: buildMatchPatternFn({
  455. matchPattern: matchOrdinalNumberPattern,
  456. parsePattern: parseOrdinalNumberPattern,
  457. valueCallback: function valueCallback(value) {return parseInt(value, 10);}
  458. }),
  459. era: buildMatchFn({
  460. matchPatterns: matchEraPatterns,
  461. defaultMatchWidth: "wide",
  462. parsePatterns: parseEraPatterns,
  463. defaultParseWidth: "any"
  464. }),
  465. quarter: buildMatchFn({
  466. matchPatterns: matchQuarterPatterns,
  467. defaultMatchWidth: "wide",
  468. parsePatterns: parseQuarterPatterns,
  469. defaultParseWidth: "any",
  470. valueCallback: function valueCallback(index) {return index + 1;}
  471. }),
  472. month: buildMatchFn({
  473. matchPatterns: matchMonthPatterns,
  474. defaultMatchWidth: "wide",
  475. parsePatterns: parseMonthPatterns,
  476. defaultParseWidth: "any"
  477. }),
  478. day: buildMatchFn({
  479. matchPatterns: matchDayPatterns,
  480. defaultMatchWidth: "wide",
  481. parsePatterns: parseDayPatterns,
  482. defaultParseWidth: "any"
  483. }),
  484. dayPeriod: buildMatchFn({
  485. matchPatterns: matchDayPeriodPatterns,
  486. defaultMatchWidth: "any",
  487. parsePatterns: parseDayPeriodPatterns,
  488. defaultParseWidth: "any"
  489. })
  490. };
  491. // lib/locale/pt.js
  492. var pt = {
  493. code: "pt",
  494. formatDistance: formatDistance,
  495. formatLong: formatLong,
  496. formatRelative: formatRelative,
  497. localize: localize,
  498. match: match,
  499. options: {
  500. weekStartsOn: 1,
  501. firstWeekContainsDate: 4
  502. }
  503. };
  504. // lib/locale/pt/cdn.js
  505. window.dateFns = _objectSpread(_objectSpread({},
  506. window.dateFns), {}, {
  507. locale: _objectSpread(_objectSpread({}, (_window$dateFns =
  508. window.dateFns) === null || _window$dateFns === void 0 ? void 0 : _window$dateFns.locale), {}, {
  509. pt: pt }) });
  510. //# debugId=E1E493019B2A2A0A64756E2164756E21
  511. //# sourceMappingURL=cdn.js.map
  512. })();