@d19n/webchat 1.0.4 → 1.0.6
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.
- package/README.md +22 -2
- package/dist/TwilioChat/index.d.ts +2 -0
- package/dist/_virtual/_commonjsHelpers.js +1 -1
- package/dist/_virtual/index12.js +1 -1
- package/dist/_virtual/index13.js +1 -1
- package/dist/_virtual/index14.js +1 -1
- package/dist/_virtual/index15.js +1 -1
- package/dist/_virtual/index2.js +1 -1
- package/dist/_virtual/index3.js +1 -1
- package/dist/_virtual/index4.js +1 -1
- package/dist/_virtual/index5.js +1 -1
- package/dist/_virtual/index6.js +1 -1
- package/dist/_virtual/index7.js +1 -1
- package/dist/_virtual/index8.js +1 -1
- package/dist/assets/styles/app.scss +248 -0
- package/dist/assets/styles/fonts.css +107 -0
- package/dist/assets/styles/variables.d.ts +58 -0
- package/dist/assets/styles/variables.tsx +74 -0
- package/dist/index.js +9 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -9
- package/dist/index.mjs.map +1 -1
- package/dist/node_modules/@d19n/odin-sdk-generator/dist/utilities/helpers.js +1 -1
- package/dist/node_modules/attr-accept/dist/es/index.js +1 -1
- package/dist/node_modules/classnames/index.js +1 -1
- package/dist/node_modules/hoist-non-react-statics/node_modules/react-is/index.js +1 -1
- package/dist/node_modules/mdast-util-gfm-strikethrough/from-markdown.js +1 -1
- package/dist/node_modules/mdast-util-gfm-table/from-markdown.js +1 -1
- package/dist/node_modules/mdast-util-gfm-task-list-item/from-markdown.js +1 -1
- package/dist/node_modules/micromark-extension-gfm-autolink-literal/syntax.js +1 -1
- package/dist/node_modules/micromark-extension-gfm-autolink-literal/syntax.js.map +1 -1
- package/dist/node_modules/micromark-extension-gfm-table/syntax.js +1 -1
- package/dist/node_modules/micromark-extension-gfm-table/syntax.js.map +1 -1
- package/dist/node_modules/prop-types/index.js +1 -1
- package/dist/node_modules/prop-types/node_modules/react-is/index.js +1 -1
- package/dist/node_modules/react-bootstrap/esm/Col.js +1 -1
- package/dist/node_modules/react-bootstrap/esm/Row.js +1 -1
- package/dist/node_modules/react-dropzone/dist/es/index.js +1 -1
- package/dist/node_modules/react-dropzone/dist/es/utils/index.js +1 -1
- package/dist/node_modules/react-is/index.js +1 -1
- package/dist/node_modules/react-is/index.js.map +1 -1
- package/dist/node_modules/react-markdown/node_modules/react-is/index.js +1 -1
- package/dist/node_modules/react-timer-hook/dist/index.js +1 -1
- package/dist/node_modules/style-inject/dist/style-inject.es.js +2 -0
- package/dist/node_modules/style-inject/dist/style-inject.es.js.map +1 -0
- package/dist/node_modules/styled-components/dist/styled-components.browser.esm.js +1 -1
- package/dist/node_modules/use-debounce/dist/index.module.js +2 -0
- package/dist/node_modules/use-debounce/dist/index.module.js.map +1 -0
- package/dist/package.json/package.json +9 -5
- package/dist/src/NotificationBar/index.js +1 -1
- package/dist/src/TwilioChat/Chat.js +1 -1
- package/dist/src/TwilioChat/Chat.js.map +1 -1
- package/dist/src/TwilioChat/index.js +1 -1
- package/dist/src/TwilioChat/index.js.map +1 -1
- package/dist/src/assets/styles/app.scss.js +2 -0
- package/dist/src/assets/styles/app.scss.js.map +1 -0
- package/dist/src/assets/styles/fonts.css.js +2 -0
- package/dist/src/assets/styles/fonts.css.js.map +1 -0
- package/package.json +9 -5
- package/dist/_virtual/Component.js +0 -2
- package/dist/_virtual/Component.js.map +0 -1
- package/dist/_virtual/index16.js +0 -2
- package/dist/_virtual/index16.js.map +0 -1
- package/dist/node_modules/lodash.debounce/index.js +0 -2
- package/dist/node_modules/lodash.debounce/index.js.map +0 -1
- package/dist/node_modules/react-debounce-input/lib/Component.js +0 -2
- package/dist/node_modules/react-debounce-input/lib/Component.js.map +0 -1
- package/dist/node_modules/react-debounce-input/lib/index.js +0 -2
- package/dist/node_modules/react-debounce-input/lib/index.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__exports as e}from"../../../../../_virtual/helpers.js";import n from"../../../../../_virtual/
|
|
1
|
+
import{__exports as e}from"../../../../../_virtual/helpers.js";import n from"../../../../../_virtual/index14.js";import{__require as r}from"../../../odin-types/dist/types/schema.types.js";var a;function s(){if(a)return e;a=1,Object.defineProperty(e,"__esModule",{value:!0}),e.applyCaseToString=e.chunkArray=void 0;const s=n,t=r();return e.chunkArray=(e,n)=>Array.from({length:Math.ceil(e.length/n)},(r,a)=>e.slice(a*n,a*n+n)),e.applyCaseToString=function(e,n){if(!e)return e;function r(e){return(0,s.camelCase)(e)}switch(n){case t.ChangeCaseEnums.LOWER_CASE:return e.toLowerCase();case t.ChangeCaseEnums.UPPER_CASE:return e.toUpperCase();case t.ChangeCaseEnums.CAMEL_CASE:return r(e);case t.ChangeCaseEnums.CAPITAL_CASE:return a=e,(0,s.capitalCase)(a);case t.ChangeCaseEnums.CONSTANT_CASE:return function(e){return(0,s.constantCase)(e)}(e);case t.ChangeCaseEnums.DOT_CASE:return function(e){return(0,s.dotCase)(e)}(e);case t.ChangeCaseEnums.PASCAL_CASE:return function(e){return(0,s.pascalCase)(e)}(e);case t.ChangeCaseEnums.PATH_CASE:return function(e){return(0,s.pathCase)(e)}(e);case t.ChangeCaseEnums.SENTENCE_CASE:return function(e){return(0,s.sentenceCase)(e)}(e);case t.ChangeCaseEnums.SNAKE_CASE:return function(e){return(0,s.snakeCase)(e)}(e);case t.ChangeCaseEnums.CAMEL_UPPER_CASE:case t.ChangeCaseEnums.CAMEL_LOWER_CASE:return r(e);case t.ChangeCaseEnums.UPPERCASE_NOCASE_NOSPACE:return function(e){return e.replace(/\s+/g,"").toUpperCase()}(e);default:return e}var a},e}export{s as __require};
|
|
2
2
|
//# sourceMappingURL=helpers.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__exports as r}from"../../../../_virtual/
|
|
1
|
+
import{__exports as r}from"../../../../_virtual/index12.js";var e;function t(){return e||(e=1,r.__esModule=!0,r.default=function(r,e){if(r&&e){var t=Array.isArray(e)?e:e.split(",");if(0===t.length)return!0;var a=r.name||"",n=(r.type||"").toLowerCase(),o=n.replace(/\/.*$/,"");return t.some(function(r){var e=r.trim().toLowerCase();return"."===e.charAt(0)?a.toLowerCase().endsWith(e):e.endsWith("/*")?o===e.replace(/\/.*$/,""):n===e})}return!0}),r}export{t as __require};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__module as r}from"../../../../_virtual/
|
|
1
|
+
import{__module as r}from"../../../../_virtual/index15.js";import{__require as e}from"./cjs/react-is.production.min.js";import{__require as o}from"./cjs/react-is.development.js";var s;function t(){return s||(s=1,"production"===process.env.NODE_ENV?r.exports=e():r.exports=o()),r.exports}export{t as __require};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__exports as t}from"../../_virtual/from-
|
|
1
|
+
import{__exports as t}from"../../_virtual/from-markdown4.js";var e;function r(){if(e)return t;return e=1,t.canContainEols=["delete"],t.enter={strikethrough:function(t){this.enter({type:"delete",children:[]},t)}},t.exit={strikethrough:function(t){this.exit(t)}},t}export{r as __require};
|
|
2
2
|
//# sourceMappingURL=from-markdown.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__exports as t}from"../../_virtual/from-
|
|
1
|
+
import{__exports as t}from"../../_virtual/from-markdown2.js";var e;function a(){if(e)return t;function a(t){this.exit(t)}function i(t){this.enter({type:"tableCell",children:[]},t)}function n(t,e){return"|"===e?e:t}return e=1,t.enter={table:function(t){this.enter({type:"table",align:t._align,children:[]},t),this.setData("inTable",!0)},tableData:i,tableHeader:i,tableRow:function(t){this.enter({type:"tableRow",children:[]},t)}},t.exit={codeText:function(t){var e=this.resume();this.getData("inTable")&&(e=e.replace(/\\([\\|])/g,n));this.stack[this.stack.length-1].value=e,this.exit(t)},table:function(t){this.exit(t),this.setData("inTable")},tableData:a,tableHeader:a,tableRow:a},t}export{a as __require};
|
|
2
2
|
//# sourceMappingURL=from-markdown.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__exports as t}from"../../_virtual/from-
|
|
1
|
+
import{__exports as t}from"../../_virtual/from-markdown3.js";var e;function s(){if(e)return t;function s(t){this.stack[this.stack.length-2].checked="taskListCheckValueChecked"===t.type}return e=1,t.exit={taskListCheckValueChecked:s,taskListCheckValueUnchecked:s,paragraph:function(t){var e,s=this.stack[this.stack.length-2],i=this.stack[this.stack.length-1],a=s.children,r=i.children[0],c=-1;if(s&&"listItem"===s.type&&"boolean"==typeof s.checked&&r&&"text"===r.type){for(;++c<a.length;)if("paragraph"===a[c].type){e=a[c];break}e===i&&(r.value=r.value.slice(1),0===r.value.length?i.children.shift():(r.position.start.column++,r.position.start.offset++,i.position.start=Object.assign({},r.position.start)))}this.exit(t)}},t}export{s as __require};
|
|
2
2
|
//# sourceMappingURL=from-markdown.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__exports as n}from"../../_virtual/
|
|
1
|
+
import{__exports as n}from"../../_virtual/syntax2.js";import{__require as t}from"../micromark/dist/character/ascii-alpha.js";import{__require as r}from"../micromark/dist/character/ascii-alphanumeric.js";import{__require as e}from"../micromark/dist/character/ascii-control.js";import{__require as u}from"../micromark/dist/character/markdown-line-ending.js";import{__require as i}from"../micromark/dist/character/unicode-punctuation.js";import{__require as o}from"../micromark/dist/character/unicode-whitespace.js";var c;function a(){if(c)return n;c=1;var a=t(),s=r(),f=e(),l=u(),m=i(),k=o(),p={tokenize:function(n,t,r){return function(t){return n.consume(t),e};function e(t){return 87===t||t-32==87?(n.consume(t),u):r(t)}function u(t){return 87===t||t-32==87?(n.consume(t),i):r(t)}function i(t){return 46===t?(n.consume(t),o):r(t)}function o(n){return null===n||l(n)?r(n):t(n)}},partial:!0},h={tokenize:function(n,t,r){var e,u;return i;function i(t){return 38===t?n.check(d,c,o)(t):46===t||95===t?n.check(_,c,o)(t):f(t)||k(t)||45!==t&&m(t)?c(t):(n.consume(t),i)}function o(t){return 46===t?(u=e,e=void 0,n.consume(t),i):(95===t&&(e=!0),n.consume(t),i)}function c(n){return u||e?r(n):t(n)}},partial:!0},v={tokenize:function(n,t){var r=0;return e;function e(o){return 38===o?n.check(d,t,u)(o):(40===o&&r++,41===o?n.check(_,i,u)(o):b(o)?t(o):w(o)?n.check(_,t,u)(o):(n.consume(o),e))}function u(t){return n.consume(t),e}function i(n){return--r<0?t(n):u(n)}},partial:!0},_={tokenize:function(n,t,r){return function(t){return n.consume(t),e};function e(u){return w(u)?(n.consume(u),e):b(u)?t(u):r(u)}},partial:!0},d={tokenize:function(n,t,r){return function(t){return n.consume(t),e};function e(t){return a(t)?(n.consume(t),e):59===t?(n.consume(t),u):r(t)}function u(n){return b(n)?t(n):r(n)}},partial:!0},A={tokenize:function(n,t,r){var e=this;return function(t){if(87!==t&&t-32!=87||!y(e.previous)||W(e.events))return r(t);return n.enter("literalAutolink"),n.enter("literalAutolinkWww"),n.check(p,n.attempt(h,n.attempt(v,u),r),r)(t)};function u(r){return n.exit("literalAutolinkWww"),n.exit("literalAutolink"),t(r)}},previous:y},x={tokenize:function(n,t,r){var e=this;return function(t){if(72!==t&&t-32!=72||!E(e.previous)||W(e.events))return r(t);return n.enter("literalAutolink"),n.enter("literalAutolinkHttp"),n.consume(t),u};function u(t){return 84===t||t-32==84?(n.consume(t),i):r(t)}function i(t){return 84===t||t-32==84?(n.consume(t),o):r(t)}function o(t){return 80===t||t-32==80?(n.consume(t),c):r(t)}function c(t){return 83===t||t-32==83?(n.consume(t),a):a(t)}function a(t){return 58===t?(n.consume(t),s):r(t)}function s(t){return 47===t?(n.consume(t),l):r(t)}function l(t){return 47===t?(n.consume(t),p):r(t)}function p(t){return f(t)||k(t)||m(t)?r(t):n.attempt(h,n.attempt(v,_),r)(t)}function _(r){return n.exit("literalAutolinkHttp"),n.exit("literalAutolink"),t(r)}},previous:E},z={tokenize:function(n,t,r){var e,u=this;return function(t){if(!g(t)||!H(u.previous)||W(u.events))return r(t);return n.enter("literalAutolink"),n.enter("literalAutolinkEmail"),i(t)};function i(t){return g(t)?(n.consume(t),i):64===t?(n.consume(t),o):r(t)}function o(t){return 46===t?n.check(_,l,c)(t):45===t||95===t?n.check(_,r,a)(t):s(t)?(n.consume(t),o):l(t)}function c(t){return n.consume(t),e=!0,o}function a(t){return n.consume(t),f}function f(t){return 46===t?n.check(_,r,c)(t):o(t)}function l(u){return e?(n.exit("literalAutolinkEmail"),n.exit("literalAutolink"),t(u)):r(u)}},previous:H},j={};n.text=j;for(var q=48;q<123;)j[q]=z,58===++q?q=65:91===q&&(q=97);function w(n){return 33===n||34===n||39===n||41===n||42===n||44===n||46===n||58===n||59===n||60===n||63===n||95===n||126===n}function b(n){return null===n||n<0||32===n||60===n}function g(n){return 43===n||45===n||46===n||95===n||s(n)}function y(n){return null===n||n<0||32===n||40===n||42===n||95===n||126===n}function E(n){return null===n||!a(n)}function H(n){return 47!==n&&E(n)}function W(n){for(var t=n.length;t--;)if(("labelLink"===n[t][1].type||"labelImage"===n[t][1].type)&&!n[t][1]._balanced)return!0}return j[43]=z,j[45]=z,j[46]=z,j[95]=z,j[72]=[z,x],j[104]=[z,x],j[87]=[z,A],j[119]=[z,A],n}export{a as __require};
|
|
2
2
|
//# sourceMappingURL=syntax.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"syntax.js","sources":["../../../node_modules/micromark-extension-gfm-autolink-literal/syntax.js"],"sourcesContent":["var asciiAlpha = require('micromark/dist/character/ascii-alpha')\nvar asciiAlphanumeric = require('micromark/dist/character/ascii-alphanumeric')\nvar asciiControl = require('micromark/dist/character/ascii-control')\nvar markdownLineEnding = require('micromark/dist/character/markdown-line-ending')\nvar unicodePunctuation = require('micromark/dist/character/unicode-punctuation')\nvar unicodeWhitespace = require('micromark/dist/character/unicode-whitespace')\n\nvar www = {tokenize: tokenizeWww, partial: true}\nvar domain = {tokenize: tokenizeDomain, partial: true}\nvar path = {tokenize: tokenizePath, partial: true}\nvar punctuation = {tokenize: tokenizePunctuation, partial: true}\nvar namedCharacterReference = {\n tokenize: tokenizeNamedCharacterReference,\n partial: true\n}\n\nvar wwwAutolink = {tokenize: tokenizeWwwAutolink, previous: previousWww}\nvar httpAutolink = {tokenize: tokenizeHttpAutolink, previous: previousHttp}\nvar emailAutolink = {tokenize: tokenizeEmailAutolink, previous: previousEmail}\n\nvar text = {}\n\n// Export hooked constructs.\nexports.text = text\n\n// `0`\nvar code = 48\n\n// While the code is smaller than `{`.\nwhile (code < 123) {\n text[code] = emailAutolink\n code++\n // Jump from `:` -> `A`\n if (code === 58) code = 65\n // Jump from `[` -> `a`\n else if (code === 91) code = 97\n}\n\n// `+`\ntext[43] = emailAutolink\n// `-`\ntext[45] = emailAutolink\n// `.`\ntext[46] = emailAutolink\n// `_`\ntext[95] = emailAutolink\n// `h`.\ntext[72] = [emailAutolink, httpAutolink]\ntext[104] = [emailAutolink, httpAutolink]\n// `w`.\ntext[87] = [emailAutolink, wwwAutolink]\ntext[119] = [emailAutolink, wwwAutolink]\n\nfunction tokenizeEmailAutolink(effects, ok, nok) {\n var self = this\n var hasDot\n\n return start\n\n function start(code) {\n /* istanbul ignore next - hooks. */\n if (\n !gfmAtext(code) ||\n !previousEmail(self.previous) ||\n previous(self.events)\n ) {\n return nok(code)\n }\n\n effects.enter('literalAutolink')\n effects.enter('literalAutolinkEmail')\n return atext(code)\n }\n\n function atext(code) {\n if (gfmAtext(code)) {\n effects.consume(code)\n return atext\n }\n\n // `@`\n if (code === 64) {\n effects.consume(code)\n return label\n }\n\n return nok(code)\n }\n\n function label(code) {\n // `.`\n if (code === 46) {\n return effects.check(punctuation, done, dotContinuation)(code)\n }\n\n if (\n // `-`\n code === 45 ||\n // `_`\n code === 95\n ) {\n return effects.check(punctuation, nok, dashOrUnderscoreContinuation)(code)\n }\n\n if (asciiAlphanumeric(code)) {\n effects.consume(code)\n return label\n }\n\n return done(code)\n }\n\n function dotContinuation(code) {\n effects.consume(code)\n hasDot = true\n return label\n }\n\n function dashOrUnderscoreContinuation(code) {\n effects.consume(code)\n return afterDashOrUnderscore\n }\n\n function afterDashOrUnderscore(code) {\n // `.`\n if (code === 46) {\n return effects.check(punctuation, nok, dotContinuation)(code)\n }\n\n return label(code)\n }\n\n function done(code) {\n if (hasDot) {\n effects.exit('literalAutolinkEmail')\n effects.exit('literalAutolink')\n return ok(code)\n }\n\n return nok(code)\n }\n}\n\nfunction tokenizeWwwAutolink(effects, ok, nok) {\n var self = this\n\n return start\n\n function start(code) {\n /* istanbul ignore next - hooks. */\n if (\n (code !== 87 && code - 32 !== 87) ||\n !previousWww(self.previous) ||\n previous(self.events)\n ) {\n return nok(code)\n }\n\n effects.enter('literalAutolink')\n effects.enter('literalAutolinkWww')\n // For `www.` we check instead of attempt, because when it matches, GH\n // treats it as part of a domain (yes, it says a valid domain must come\n // after `www.`, but that’s not how it’s implemented by them).\n return effects.check(\n www,\n effects.attempt(domain, effects.attempt(path, done), nok),\n nok\n )(code)\n }\n\n function done(code) {\n effects.exit('literalAutolinkWww')\n effects.exit('literalAutolink')\n return ok(code)\n }\n}\n\nfunction tokenizeHttpAutolink(effects, ok, nok) {\n var self = this\n\n return start\n\n function start(code) {\n /* istanbul ignore next - hooks. */\n if (\n (code !== 72 && code - 32 !== 72) ||\n !previousHttp(self.previous) ||\n previous(self.events)\n ) {\n return nok(code)\n }\n\n effects.enter('literalAutolink')\n effects.enter('literalAutolinkHttp')\n effects.consume(code)\n return t1\n }\n\n function t1(code) {\n // `t`\n if (code === 84 || code - 32 === 84) {\n effects.consume(code)\n return t2\n }\n\n return nok(code)\n }\n\n function t2(code) {\n // `t`\n if (code === 84 || code - 32 === 84) {\n effects.consume(code)\n return p\n }\n\n return nok(code)\n }\n\n function p(code) {\n // `p`\n if (code === 80 || code - 32 === 80) {\n effects.consume(code)\n return s\n }\n\n return nok(code)\n }\n\n function s(code) {\n // `s`\n if (code === 83 || code - 32 === 83) {\n effects.consume(code)\n return colon\n }\n\n return colon(code)\n }\n\n function colon(code) {\n // `:`\n if (code === 58) {\n effects.consume(code)\n return slash1\n }\n\n return nok(code)\n }\n\n function slash1(code) {\n // `/`\n if (code === 47) {\n effects.consume(code)\n return slash2\n }\n\n return nok(code)\n }\n\n function slash2(code) {\n // `/`\n if (code === 47) {\n effects.consume(code)\n return after\n }\n\n return nok(code)\n }\n\n function after(code) {\n return asciiControl(code) ||\n unicodeWhitespace(code) ||\n unicodePunctuation(code)\n ? nok(code)\n : effects.attempt(domain, effects.attempt(path, done), nok)(code)\n }\n\n function done(code) {\n effects.exit('literalAutolinkHttp')\n effects.exit('literalAutolink')\n return ok(code)\n }\n}\n\nfunction tokenizeWww(effects, ok, nok) {\n return start\n\n function start(code) {\n // Assume a `w`.\n effects.consume(code)\n return w2\n }\n\n function w2(code) {\n // `w`\n if (code === 87 || code - 32 === 87) {\n effects.consume(code)\n return w3\n }\n\n return nok(code)\n }\n\n function w3(code) {\n // `w`\n if (code === 87 || code - 32 === 87) {\n effects.consume(code)\n return dot\n }\n\n return nok(code)\n }\n\n function dot(code) {\n // `.`\n if (code === 46) {\n effects.consume(code)\n return after\n }\n\n return nok(code)\n }\n\n function after(code) {\n return code === null || markdownLineEnding(code) ? nok(code) : ok(code)\n }\n}\n\nfunction tokenizeDomain(effects, ok, nok) {\n var hasUnderscoreInLastSegment\n var hasUnderscoreInLastLastSegment\n\n return domain\n\n function domain(code) {\n // `&`\n if (code === 38) {\n return effects.check(\n namedCharacterReference,\n done,\n punctuationContinuation\n )(code)\n }\n\n if (code === 46 /* `.` */ || code === 95 /* `_` */) {\n return effects.check(punctuation, done, punctuationContinuation)(code)\n }\n\n // GH documents that only alphanumerics (other than `-`, `.`, and `_`) can\n // occur, which sounds like ASCII only, but they also support `www.點看.com`,\n // so that’s Unicode.\n // Instead of some new production for Unicode alphanumerics, markdown\n // already has that for Unicode punctuation and whitespace, so use those.\n if (\n asciiControl(code) ||\n unicodeWhitespace(code) ||\n (code !== 45 /* `-` */ && unicodePunctuation(code))\n ) {\n return done(code)\n }\n\n effects.consume(code)\n return domain\n }\n\n function punctuationContinuation(code) {\n // `.`\n if (code === 46) {\n hasUnderscoreInLastLastSegment = hasUnderscoreInLastSegment\n hasUnderscoreInLastSegment = undefined\n effects.consume(code)\n return domain\n }\n\n // `_`\n if (code === 95) hasUnderscoreInLastSegment = true\n\n effects.consume(code)\n return domain\n }\n\n function done(code) {\n if (!hasUnderscoreInLastLastSegment && !hasUnderscoreInLastSegment) {\n return ok(code)\n }\n\n return nok(code)\n }\n}\n\nfunction tokenizePath(effects, ok) {\n var balance = 0\n\n return inPath\n\n function inPath(code) {\n // `&`\n if (code === 38) {\n return effects.check(\n namedCharacterReference,\n ok,\n continuedPunctuation\n )(code)\n }\n\n // `(`\n if (code === 40) {\n balance++\n }\n\n // `)`\n if (code === 41) {\n return effects.check(\n punctuation,\n parenAtPathEnd,\n continuedPunctuation\n )(code)\n }\n\n if (pathEnd(code)) {\n return ok(code)\n }\n\n if (trailingPunctuation(code)) {\n return effects.check(punctuation, ok, continuedPunctuation)(code)\n }\n\n effects.consume(code)\n return inPath\n }\n\n function continuedPunctuation(code) {\n effects.consume(code)\n return inPath\n }\n\n function parenAtPathEnd(code) {\n balance--\n return balance < 0 ? ok(code) : continuedPunctuation(code)\n }\n}\n\nfunction tokenizeNamedCharacterReference(effects, ok, nok) {\n return start\n\n function start(code) {\n // Assume an ampersand.\n effects.consume(code)\n return inside\n }\n\n function inside(code) {\n if (asciiAlpha(code)) {\n effects.consume(code)\n return inside\n }\n\n // `;`\n if (code === 59) {\n effects.consume(code)\n return after\n }\n\n return nok(code)\n }\n\n function after(code) {\n // If the named character reference is followed by the end of the path, it’s\n // not continued punctuation.\n return pathEnd(code) ? ok(code) : nok(code)\n }\n}\n\nfunction tokenizePunctuation(effects, ok, nok) {\n return start\n\n function start(code) {\n // Always a valid trailing punctuation marker.\n effects.consume(code)\n return after\n }\n\n function after(code) {\n // Check the next.\n if (trailingPunctuation(code)) {\n effects.consume(code)\n return after\n }\n\n // If the punctuation marker is followed by the end of the path, it’s not\n // continued punctuation.\n return pathEnd(code) ? ok(code) : nok(code)\n }\n}\n\nfunction trailingPunctuation(code) {\n return (\n // `!`\n code === 33 ||\n // `\"`\n code === 34 ||\n // `'`\n code === 39 ||\n // `)`\n code === 41 ||\n // `*`\n code === 42 ||\n // `,`\n code === 44 ||\n // `.`\n code === 46 ||\n // `:`\n code === 58 ||\n // `;`\n code === 59 ||\n // `<`\n code === 60 ||\n // `?`\n code === 63 ||\n // `_`.\n code === 95 ||\n // `~`\n code === 126\n )\n}\n\nfunction pathEnd(code) {\n return (\n // EOF.\n code === null ||\n // CR, LF, CRLF, HT, VS.\n code < 0 ||\n // Space.\n code === 32 ||\n // `<`\n code === 60\n )\n}\n\nfunction gfmAtext(code) {\n return (\n code === 43 /* `+` */ ||\n code === 45 /* `-` */ ||\n code === 46 /* `.` */ ||\n code === 95 /* `_` */ ||\n asciiAlphanumeric(code)\n )\n}\n\nfunction previousWww(code) {\n return (\n code === null ||\n code < 0 ||\n code === 32 /* ` ` */ ||\n code === 40 /* `(` */ ||\n code === 42 /* `*` */ ||\n code === 95 /* `_` */ ||\n code === 126 /* `~` */\n )\n}\n\nfunction previousHttp(code) {\n return code === null || !asciiAlpha(code)\n}\n\nfunction previousEmail(code) {\n return code !== 47 /* `/` */ && previousHttp(code)\n}\n\nfunction previous(events) {\n var index = events.length\n\n while (index--) {\n if (\n (events[index][1].type === 'labelLink' ||\n events[index][1].type === 'labelImage') &&\n !events[index][1]._balanced\n ) {\n return true\n }\n }\n}\n"],"names":["asciiAlpha","require$$0","asciiAlphanumeric","require$$1","asciiControl","require$$2","markdownLineEnding","require$$3","unicodePunctuation","require$$4","unicodeWhitespace","require$$5","www","tokenize","effects","ok","nok","code","consume","w2","w3","dot","after","partial","domain","hasUnderscoreInLastSegment","hasUnderscoreInLastLastSegment","check","namedCharacterReference","done","punctuationContinuation","punctuation","undefined","path","balance","inPath","continuedPunctuation","parenAtPathEnd","pathEnd","trailingPunctuation","inside","wwwAutolink","self","this","previousWww","previous","events","enter","attempt","exit","httpAutolink","previousHttp","t1","t2","p","s","colon","slash1","slash2","emailAutolink","hasDot","gfmAtext","previousEmail","atext","label","dotContinuation","dashOrUnderscoreContinuation","afterDashOrUnderscore","text","syntax","index","length","type","_balanced"],"mappings":"qiBAAA,IAAIA,EAAaC,IACbC,EAAoBC,IACpBC,EAAeC,IACfC,EAAqBC,IACrBC,EAAqBC,IACrBC,EAAoBC,IAEpBC,EAAM,CAACC,SAoRX,SAAqBC,EAASC,EAAIC,GAChC,OAEA,SAAeC,GAGb,OADAH,EAAQI,QAAQD,GACTE,CACX,EAEE,SAASA,EAAGF,GAEV,OAAa,KAATA,GAAeA,EAAO,IAAO,IAC/BH,EAAQI,QAAQD,GACTG,GAGFJ,EAAIC,EACf,CAEE,SAASG,EAAGH,GAEV,OAAa,KAATA,GAAeA,EAAO,IAAO,IAC/BH,EAAQI,QAAQD,GACTI,GAGFL,EAAIC,EACf,CAEE,SAASI,EAAIJ,GAEX,OAAa,KAATA,GACFH,EAAQI,QAAQD,GACTK,GAGFN,EAAIC,EACf,CAEE,SAASK,EAAML,GACb,OAAgB,OAATA,GAAiBX,EAAmBW,GAAQD,EAAIC,GAAQF,EAAGE,EACtE,CACA,EA9TkCM,SAAS,GACvCC,EAAS,CAACX,SA+Td,SAAwBC,EAASC,EAAIC,GACnC,IAAIS,EACAC,EAEJ,OAAOF,EAEP,SAASA,EAAOP,GAEd,OAAa,KAATA,EACKH,EAAQa,MACbC,EACAC,EACAC,EAHKhB,CAILG,GAGS,KAATA,GAAkC,KAATA,EACpBH,EAAQa,MAAMI,EAAaF,EAAMC,EAAjChB,CAA0DG,GASjEb,EAAaa,IACbP,EAAkBO,IACR,KAATA,GAAyBT,EAAmBS,GAEtCY,EAAKZ,IAGdH,EAAQI,QAAQD,GACTO,EACX,CAEE,SAASM,EAAwBb,GAE/B,OAAa,KAATA,GACFS,EAAiCD,EACjCA,OAA6BO,EAC7BlB,EAAQ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AAGE,MACU,eAA1B1B,EAAOwB,GAAO,GAAGE,QAClB1B,EAAOwB,GAAO,GAAGG,UAElB,OAAO,CAGb,QA7hBAL,EAAK,IAAMT,EAEXS,EAAK,IAAMT,EAEXS,EAAK,IAAMT,EAEXS,EAAK,IAAMT,EAEXS,EAAK,IAAM,CAACT,EAAeT,GAC3BkB,EAAK,KAAO,CAACT,EAAeT,GAE5BkB,EAAK,IAAM,CAACT,EAAelB,GAC3B2B,EAAK,KAAO,CAACT,EAAelB","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"syntax.js","sources":["../../../node_modules/micromark-extension-gfm-autolink-literal/syntax.js"],"sourcesContent":["var asciiAlpha = require('micromark/dist/character/ascii-alpha')\nvar asciiAlphanumeric = require('micromark/dist/character/ascii-alphanumeric')\nvar asciiControl = require('micromark/dist/character/ascii-control')\nvar markdownLineEnding = require('micromark/dist/character/markdown-line-ending')\nvar unicodePunctuation = require('micromark/dist/character/unicode-punctuation')\nvar unicodeWhitespace = require('micromark/dist/character/unicode-whitespace')\n\nvar www = {tokenize: tokenizeWww, partial: true}\nvar domain = {tokenize: tokenizeDomain, partial: true}\nvar path = {tokenize: tokenizePath, partial: true}\nvar punctuation = {tokenize: tokenizePunctuation, partial: true}\nvar namedCharacterReference = {\n tokenize: tokenizeNamedCharacterReference,\n partial: true\n}\n\nvar wwwAutolink = {tokenize: tokenizeWwwAutolink, previous: previousWww}\nvar httpAutolink = {tokenize: tokenizeHttpAutolink, previous: previousHttp}\nvar emailAutolink = {tokenize: tokenizeEmailAutolink, previous: previousEmail}\n\nvar text = {}\n\n// Export hooked constructs.\nexports.text = text\n\n// `0`\nvar code = 48\n\n// While the code is smaller than `{`.\nwhile (code < 123) {\n text[code] = emailAutolink\n code++\n // Jump from `:` -> `A`\n if (code === 58) code = 65\n // Jump from `[` -> `a`\n else if (code === 91) code = 97\n}\n\n// `+`\ntext[43] = emailAutolink\n// `-`\ntext[45] = emailAutolink\n// `.`\ntext[46] = emailAutolink\n// `_`\ntext[95] = emailAutolink\n// `h`.\ntext[72] = [emailAutolink, httpAutolink]\ntext[104] = [emailAutolink, httpAutolink]\n// `w`.\ntext[87] = [emailAutolink, wwwAutolink]\ntext[119] = [emailAutolink, wwwAutolink]\n\nfunction tokenizeEmailAutolink(effects, ok, nok) {\n var self = this\n var hasDot\n\n return start\n\n function start(code) {\n /* istanbul ignore next - hooks. */\n if (\n !gfmAtext(code) ||\n !previousEmail(self.previous) ||\n previous(self.events)\n ) {\n return nok(code)\n }\n\n effects.enter('literalAutolink')\n effects.enter('literalAutolinkEmail')\n return atext(code)\n }\n\n function atext(code) {\n if (gfmAtext(code)) {\n effects.consume(code)\n return atext\n }\n\n // `@`\n if (code === 64) {\n effects.consume(code)\n return label\n }\n\n return nok(code)\n }\n\n function label(code) {\n // `.`\n if (code === 46) {\n return effects.check(punctuation, done, dotContinuation)(code)\n }\n\n if (\n // `-`\n code === 45 ||\n // `_`\n code === 95\n ) {\n return effects.check(punctuation, nok, dashOrUnderscoreContinuation)(code)\n }\n\n if (asciiAlphanumeric(code)) {\n effects.consume(code)\n return label\n }\n\n return done(code)\n }\n\n function dotContinuation(code) {\n effects.consume(code)\n hasDot = true\n return label\n }\n\n function dashOrUnderscoreContinuation(code) {\n effects.consume(code)\n return afterDashOrUnderscore\n }\n\n function afterDashOrUnderscore(code) {\n // `.`\n if (code === 46) {\n return effects.check(punctuation, nok, dotContinuation)(code)\n }\n\n return label(code)\n }\n\n function done(code) {\n if (hasDot) {\n effects.exit('literalAutolinkEmail')\n effects.exit('literalAutolink')\n return ok(code)\n }\n\n return nok(code)\n }\n}\n\nfunction tokenizeWwwAutolink(effects, ok, nok) {\n var self = this\n\n return start\n\n function start(code) {\n /* istanbul ignore next - hooks. */\n if (\n (code !== 87 && code - 32 !== 87) ||\n !previousWww(self.previous) ||\n previous(self.events)\n ) {\n return nok(code)\n }\n\n effects.enter('literalAutolink')\n effects.enter('literalAutolinkWww')\n // For `www.` we check instead of attempt, because when it matches, GH\n // treats it as part of a domain (yes, it says a valid domain must come\n // after `www.`, but that’s not how it’s implemented by them).\n return effects.check(\n www,\n effects.attempt(domain, effects.attempt(path, done), nok),\n nok\n )(code)\n }\n\n function done(code) {\n effects.exit('literalAutolinkWww')\n effects.exit('literalAutolink')\n return ok(code)\n }\n}\n\nfunction tokenizeHttpAutolink(effects, ok, nok) {\n var self = this\n\n return start\n\n function start(code) {\n /* istanbul ignore next - hooks. */\n if (\n (code !== 72 && code - 32 !== 72) ||\n !previousHttp(self.previous) ||\n previous(self.events)\n ) {\n return nok(code)\n }\n\n effects.enter('literalAutolink')\n effects.enter('literalAutolinkHttp')\n effects.consume(code)\n return t1\n }\n\n function t1(code) {\n // `t`\n if (code === 84 || code - 32 === 84) {\n effects.consume(code)\n return t2\n }\n\n return nok(code)\n }\n\n function t2(code) {\n // `t`\n if (code === 84 || code - 32 === 84) {\n effects.consume(code)\n return p\n }\n\n return nok(code)\n }\n\n function p(code) {\n // `p`\n if (code === 80 || code - 32 === 80) {\n effects.consume(code)\n return s\n }\n\n return nok(code)\n }\n\n function s(code) {\n // `s`\n if (code === 83 || code - 32 === 83) {\n effects.consume(code)\n return colon\n }\n\n return colon(code)\n }\n\n function colon(code) {\n // `:`\n if (code === 58) {\n effects.consume(code)\n return slash1\n }\n\n return nok(code)\n }\n\n function slash1(code) {\n // `/`\n if (code === 47) {\n effects.consume(code)\n return slash2\n }\n\n return nok(code)\n }\n\n function slash2(code) {\n // `/`\n if (code === 47) {\n effects.consume(code)\n return after\n }\n\n return nok(code)\n }\n\n function after(code) {\n return asciiControl(code) ||\n unicodeWhitespace(code) ||\n unicodePunctuation(code)\n ? nok(code)\n : effects.attempt(domain, effects.attempt(path, done), nok)(code)\n }\n\n function done(code) {\n effects.exit('literalAutolinkHttp')\n effects.exit('literalAutolink')\n return ok(code)\n }\n}\n\nfunction tokenizeWww(effects, ok, nok) {\n return start\n\n function start(code) {\n // Assume a `w`.\n effects.consume(code)\n return w2\n }\n\n function w2(code) {\n // `w`\n if (code === 87 || code - 32 === 87) {\n effects.consume(code)\n return w3\n }\n\n return nok(code)\n }\n\n function w3(code) {\n // `w`\n if (code === 87 || code - 32 === 87) {\n effects.consume(code)\n return dot\n }\n\n return nok(code)\n }\n\n function dot(code) {\n // `.`\n if (code === 46) {\n effects.consume(code)\n return after\n }\n\n return nok(code)\n }\n\n function after(code) {\n return code === null || markdownLineEnding(code) ? nok(code) : ok(code)\n }\n}\n\nfunction tokenizeDomain(effects, ok, nok) {\n var hasUnderscoreInLastSegment\n var hasUnderscoreInLastLastSegment\n\n return domain\n\n function domain(code) {\n // `&`\n if (code === 38) {\n return effects.check(\n namedCharacterReference,\n done,\n punctuationContinuation\n )(code)\n }\n\n if (code === 46 /* `.` */ || code === 95 /* `_` */) {\n return effects.check(punctuation, done, punctuationContinuation)(code)\n }\n\n // GH documents that only alphanumerics (other than `-`, `.`, and `_`) can\n // occur, which sounds like ASCII only, but they also support `www.點看.com`,\n // so that’s Unicode.\n // Instead of some new production for Unicode alphanumerics, markdown\n // already has that for Unicode punctuation and whitespace, so use those.\n if (\n asciiControl(code) ||\n unicodeWhitespace(code) ||\n (code !== 45 /* `-` */ && unicodePunctuation(code))\n ) {\n return done(code)\n }\n\n effects.consume(code)\n return domain\n }\n\n function punctuationContinuation(code) {\n // `.`\n if (code === 46) {\n hasUnderscoreInLastLastSegment = hasUnderscoreInLastSegment\n hasUnderscoreInLastSegment = undefined\n effects.consume(code)\n return domain\n }\n\n // `_`\n if (code === 95) hasUnderscoreInLastSegment = true\n\n effects.consume(code)\n return domain\n }\n\n function done(code) {\n if (!hasUnderscoreInLastLastSegment && !hasUnderscoreInLastSegment) {\n return ok(code)\n }\n\n return nok(code)\n }\n}\n\nfunction tokenizePath(effects, ok) {\n var balance = 0\n\n return inPath\n\n function inPath(code) {\n // `&`\n if (code === 38) {\n return effects.check(\n namedCharacterReference,\n ok,\n continuedPunctuation\n )(code)\n }\n\n // `(`\n if (code === 40) {\n balance++\n }\n\n // `)`\n if (code === 41) {\n return effects.check(\n punctuation,\n parenAtPathEnd,\n continuedPunctuation\n )(code)\n }\n\n if (pathEnd(code)) {\n return ok(code)\n }\n\n if (trailingPunctuation(code)) {\n return effects.check(punctuation, ok, continuedPunctuation)(code)\n }\n\n effects.consume(code)\n return inPath\n }\n\n function continuedPunctuation(code) {\n effects.consume(code)\n return inPath\n }\n\n function parenAtPathEnd(code) {\n balance--\n return balance < 0 ? ok(code) : continuedPunctuation(code)\n }\n}\n\nfunction tokenizeNamedCharacterReference(effects, ok, nok) {\n return start\n\n function start(code) {\n // Assume an ampersand.\n effects.consume(code)\n return inside\n }\n\n function inside(code) {\n if (asciiAlpha(code)) {\n effects.consume(code)\n return inside\n }\n\n // `;`\n if (code === 59) {\n effects.consume(code)\n return after\n }\n\n return nok(code)\n }\n\n function after(code) {\n // If the named character reference is followed by the end of the path, it’s\n // not continued punctuation.\n return pathEnd(code) ? ok(code) : nok(code)\n }\n}\n\nfunction tokenizePunctuation(effects, ok, nok) {\n return start\n\n function start(code) {\n // Always a valid trailing punctuation marker.\n effects.consume(code)\n return after\n }\n\n function after(code) {\n // Check the next.\n if (trailingPunctuation(code)) {\n effects.consume(code)\n return after\n }\n\n // If the punctuation marker is followed by the end of the path, it’s not\n // continued punctuation.\n return pathEnd(code) ? ok(code) : nok(code)\n }\n}\n\nfunction trailingPunctuation(code) {\n return (\n // `!`\n code === 33 ||\n // `\"`\n code === 34 ||\n // `'`\n code === 39 ||\n // `)`\n code === 41 ||\n // `*`\n code === 42 ||\n // `,`\n code === 44 ||\n // `.`\n code === 46 ||\n // `:`\n code === 58 ||\n // `;`\n code === 59 ||\n // `<`\n code === 60 ||\n // `?`\n code === 63 ||\n // `_`.\n code === 95 ||\n // `~`\n code === 126\n )\n}\n\nfunction pathEnd(code) {\n return (\n // EOF.\n code === null ||\n // CR, LF, CRLF, HT, VS.\n code < 0 ||\n // Space.\n code === 32 ||\n // `<`\n code === 60\n )\n}\n\nfunction gfmAtext(code) {\n return (\n code === 43 /* `+` */ ||\n code === 45 /* `-` */ ||\n code === 46 /* `.` */ ||\n code === 95 /* `_` */ ||\n asciiAlphanumeric(code)\n )\n}\n\nfunction previousWww(code) {\n return (\n code === null ||\n code < 0 ||\n code === 32 /* ` ` */ ||\n code === 40 /* `(` */ ||\n code === 42 /* `*` */ ||\n code === 95 /* `_` */ ||\n code === 126 /* `~` */\n )\n}\n\nfunction previousHttp(code) {\n return code === null || !asciiAlpha(code)\n}\n\nfunction previousEmail(code) {\n return code !== 47 /* `/` */ && previousHttp(code)\n}\n\nfunction previous(events) {\n var index = events.length\n\n while (index--) {\n if (\n (events[index][1].type === 'labelLink' ||\n events[index][1].type === 'labelImage') &&\n !events[index][1]._balanced\n ) {\n return true\n }\n }\n}\n"],"names":["asciiAlpha","require$$0","asciiAlphanumeric","require$$1","asciiControl","require$$2","markdownLineEnding","require$$3","unicodePunctuation","require$$4","unicodeWhitespace","require$$5","www","tokenize","effects","ok","nok","code","consume","w2","w3","dot","after","partial","domain","hasUnderscoreInLastSegment","hasUnderscoreInLastLastSegment","check","namedCharacterReference","done","punctuationContinuation","punctuation","undefined","path","balance","inPath","continuedPunctuation","parenAtPathEnd","pathEnd","trailingPunctuation","inside","wwwAutolink","self","this","previousWww","previous","events","enter","attempt","exit","httpAutolink","previousHttp","t1","t2","p","s","colon","slash1","slash2","emailAutolink","hasDot","gfmAtext","previousEmail","atext","label","dotContinuation","dashOrUnderscoreContinuation","afterDashOrUnderscore","text","syntax","index","length","type","_balanced"],"mappings":"siBAAA,IAAIA,EAAaC,IACbC,EAAoBC,IACpBC,EAAeC,IACfC,EAAqBC,IACrBC,EAAqBC,IACrBC,EAAoBC,IAEpBC,EAAM,CAACC,SAoRX,SAAqBC,EAASC,EAAIC,GAChC,OAEA,SAAeC,GAGb,OADAH,EAAQI,QAAQD,GACTE,CACX,EAEE,SAASA,EAAGF,GAEV,OAAa,KAATA,GAAeA,EAAO,IAAO,IAC/BH,EAAQI,QAAQD,GACT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,OAFb1C,EAEiBA,EAAO,GAEN,KAATA,IAAaA,EAAO,IA2c/B,SAASsB,EAAoBtB,GAC3B,OAEW,KAATA,GAES,KAATA,GAES,KAATA,GAES,KAATA,GAES,KAATA,GAES,KAATA,GAES,KAATA,GAES,KAATA,GAES,KAATA,GAES,KAATA,GAES,KAATA,GAES,KAATA,GAES,MAATA,CAEJ,CAEA,SAASqB,EAAQrB,GACf,OAEW,OAATA,GAEAA,EAAO,GAEE,KAATA,GAES,KAATA,CAEJ,CAEA,SAAS4C,EAAS5C,GAChB,OACW,KAATA,GACS,KAATA,GACS,KAATA,GACS,KAATA,GACAf,EAAkBe,EAEtB,CAEA,SAAS2B,EAAY3B,GACnB,OACW,OAATA,GACAA,EAAO,GACE,KAATA,GACS,KAATA,GACS,KAATA,GACS,KAATA,GACS,MAATA,CAEJ,CAEA,SAASkC,EAAalC,GACpB,OAAgB,OAATA,IAAkBjB,EAAWiB,EACtC,CAEA,SAAS6C,EAAc7C,GACrB,OAAgB,KAATA,GAAyBkC,EAAalC,EAC/C,CAEA,SAAS4B,EAASC,GAGhB,IAFA,IAAIwB,EAAQxB,EAAOyB,OAEZD,KACL,IAC6B,cAA1BxB,EAAOwB,GAAO,GAAGE,MACU,eAA1B1B,EAAOwB,GAAO,GAAGE,QAClB1B,EAAOwB,GAAO,GAAGG,UAElB,OAAO,CAGb,QA7hBAL,EAAK,IAAMT,EAEXS,EAAK,IAAMT,EAEXS,EAAK,IAAMT,EAEXS,EAAK,IAAMT,EAEXS,EAAK,IAAM,CAACT,EAAeT,GAC3BkB,EAAK,KAAO,CAACT,EAAeT,GAE5BkB,EAAK,IAAM,CAACT,EAAelB,GAC3B2B,EAAK,KAAO,CAACT,EAAelB","x_google_ignoreList":[0]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__exports as e}from"../../_virtual/
|
|
1
|
+
import{__exports as e}from"../../_virtual/syntax.js";import{__require as t}from"../micromark/dist/tokenize/factory-space.js";var n;function r(){if(n)return e;n=1,e.flow={null:{tokenize:function(e,t,n){var u,o,a=[],c=0;return function(t){if(null===t||-5===t||-4===t||-3===t)return n(t);if(e.enter("table")._align=a,e.enter("tableHead"),e.enter("tableRow"),124===t)return s(t);return c++,e.enter("temporaryTableCellContent"),b(t)};function s(t){return e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),u=!0,m}function m(t){return null===t||-5===t||-4===t||-3===t?function(t){if(null===t)return n(t);return e.exit("tableRow"),e.exit("tableHead"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),e.check(i,n,r(e,d,"linePrefix",4))}(t):-2===t||-1===t||32===t?(e.enter("whitespace"),e.consume(t),f):(u&&(u=void 0,c++),124===t?s(t):(e.enter("temporaryTableCellContent"),b(t)))}function f(t){return-2===t||-1===t||32===t?(e.consume(t),f):(e.exit("whitespace"),m(t))}function b(t){return null===t||t<0||32===t||124===t?(e.exit("temporaryTableCellContent"),m(t)):(e.consume(t),92===t?p:b)}function p(t){return 92===t||124===t?(e.consume(t),b):b(t)}function d(t){return null===t||t<0||32===t?n(t):(e.enter("tableDelimiterRow"),x(t))}function x(t){return null===t||-5===t||-4===t||-3===t?v(t):-2===t||-1===t||32===t?(e.enter("whitespace"),e.consume(t),C):45===t?(e.enter("tableDelimiterFiller"),e.consume(t),o=!0,a.push(null),y):58===t?(e.enter("tableDelimiterAlignment"),e.consume(t),e.exit("tableDelimiterAlignment"),a.push("left"),D):124===t?(e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),x):n(t)}function C(t){return-2===t||-1===t||32===t?(e.consume(t),C):(e.exit("whitespace"),x(t))}function y(t){return 45===t?(e.consume(t),y):(e.exit("tableDelimiterFiller"),58===t?(e.enter("tableDelimiterAlignment"),e.consume(t),e.exit("tableDelimiterAlignment"),a[a.length-1]="left"===a[a.length-1]?"center":"right",h):x(t))}function D(t){return 45===t?(e.enter("tableDelimiterFiller"),e.consume(t),o=!0,y):n(t)}function h(t){return null===t||-5===t||-4===t||-3===t?v(t):-2===t||-1===t||32===t?(e.enter("whitespace"),e.consume(t),C):124===t?(e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),x):n(t)}function v(t){return e.exit("tableDelimiterRow"),o&&c===a.length?null===t?w(t):e.check(l,w,g)(t):n(t)}function w(n){return e.exit("table"),t(n)}function g(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),r(e,k,"linePrefix",4)}function k(t){return e.enter("tableBody"),R(t)}function R(t){return e.enter("tableRow"),124===t?T(t):(e.enter("temporaryTableCellContent"),z(t))}function T(t){return e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),_}function _(t){return null===t||-5===t||-4===t||-3===t?function(t){if(e.exit("tableRow"),null===t)return H(t);return e.check(l,H,F)(t)}(t):-2===t||-1===t||32===t?(e.enter("whitespace"),e.consume(t),E):124===t?T(t):(e.enter("temporaryTableCellContent"),z(t))}function E(t){return-2===t||-1===t||32===t?(e.consume(t),E):(e.exit("whitespace"),_(t))}function z(t){return null===t||t<0||32===t||124===t?(e.exit("temporaryTableCellContent"),_(t)):(e.consume(t),92===t?A:z)}function A(t){return 92===t||124===t?(e.consume(t),z):z(t)}function H(t){return e.exit("tableBody"),w(t)}function F(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),r(e,R,"linePrefix",4)}},resolve:function(e,t){var n,r,i,l,u,o,a,c,s,m,f=e.length,b=-1;for(;++b<f;)n=e[b][1],l&&("temporaryTableCellContent"===n.type&&(c=c||b,s=b),"tableCellDivider"!==n.type&&"tableRow"!==n.type||!s||(a={type:"chunkText",start:(o={type:"tableContent",start:e[c][1].start,end:e[s][1].end}).start,end:o.end,contentType:"text"},e.splice(c,s-c+1,["enter",o,t],["enter",a,t],["exit",a,t],["exit",o,t]),b-=s-c-3,f=e.length,c=void 0,s=void 0)),"exit"===e[b][0]&&m&&m+1<b&&("tableCellDivider"===n.type||"tableRow"===n.type&&(m+3<b||"whitespace"!==e[m][1].type))&&(u={type:i?"tableDelimiter":r?"tableHeader":"tableData",start:e[m][1].start,end:e[b][1].end},e.splice(b+("tableCellDivider"===n.type?1:0),0,["exit",u,t]),e.splice(m,0,["enter",u,t]),b+=2,f=e.length,m=b+1),"tableRow"===n.type&&(l="enter"===e[b][0])&&(m=b+1),"tableDelimiterRow"===n.type&&(i="enter"===e[b][0])&&(m=b+1),"tableHead"===n.type&&(r="enter"===e[b][0]);return e},interruptible:!0}};var r=t(),i={tokenize:function(e,t,n){return function(t){if(45!==t)return n(t);return e.enter("setextUnderline"),r(t)};function r(t){return 45===t?(e.consume(t),r):i(t)}function i(r){return-2===r||-1===r||32===r?(e.consume(r),i):null===r||-5===r||-4===r||-3===r?t(r):n(r)}},partial:!0},l={tokenize:function(e,t,n){var r=0;return function(t){return e.enter("check"),e.consume(t),i};function i(l){return-1===l||32===l?(e.consume(l),4===++r?t:i):null===l||l<0?t(l):n(l)}},partial:!0};return e}export{r as __require};
|
|
2
2
|
//# sourceMappingURL=syntax.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"syntax.js","sources":["../../../node_modules/micromark-extension-gfm-table/syntax.js"],"sourcesContent":["exports.flow = {\n null: {tokenize: tokenizeTable, resolve: resolveTable, interruptible: true}\n}\n\nvar createSpace = require('micromark/dist/tokenize/factory-space')\n\nvar setextUnderlineMini = {tokenize: tokenizeSetextUnderlineMini, partial: true}\nvar nextPrefixedOrBlank = {tokenize: tokenizeNextPrefixedOrBlank, partial: true}\n\nfunction resolveTable(events, context) {\n var length = events.length\n var index = -1\n var token\n var inHead\n var inDelimiterRow\n var inRow\n var cell\n var content\n var text\n var contentStart\n var contentEnd\n var cellStart\n\n while (++index < length) {\n token = events[index][1]\n\n if (inRow) {\n if (token.type === 'temporaryTableCellContent') {\n contentStart = contentStart || index\n contentEnd = index\n }\n\n if (\n // Combine separate content parts into one.\n (token.type === 'tableCellDivider' || token.type === 'tableRow') &&\n contentEnd\n ) {\n content = {\n type: 'tableContent',\n start: events[contentStart][1].start,\n end: events[contentEnd][1].end\n }\n text = {\n type: 'chunkText',\n start: content.start,\n end: content.end,\n contentType: 'text'\n }\n\n events.splice(\n contentStart,\n contentEnd - contentStart + 1,\n ['enter', content, context],\n ['enter', text, context],\n ['exit', text, context],\n ['exit', content, context]\n )\n index -= contentEnd - contentStart - 3\n length = events.length\n contentStart = undefined\n contentEnd = undefined\n }\n }\n\n if (\n events[index][0] === 'exit' &&\n cellStart &&\n cellStart + 1 < index &&\n (token.type === 'tableCellDivider' ||\n (token.type === 'tableRow' &&\n (cellStart + 3 < index ||\n events[cellStart][1].type !== 'whitespace')))\n ) {\n cell = {\n type: inDelimiterRow\n ? 'tableDelimiter'\n : inHead\n ? 'tableHeader'\n : 'tableData',\n start: events[cellStart][1].start,\n end: events[index][1].end\n }\n events.splice(index + (token.type === 'tableCellDivider' ? 1 : 0), 0, [\n 'exit',\n cell,\n context\n ])\n events.splice(cellStart, 0, ['enter', cell, context])\n index += 2\n length = events.length\n cellStart = index + 1\n }\n\n if (token.type === 'tableRow') {\n inRow = events[index][0] === 'enter'\n\n if (inRow) {\n cellStart = index + 1\n }\n }\n\n if (token.type === 'tableDelimiterRow') {\n inDelimiterRow = events[index][0] === 'enter'\n\n if (inDelimiterRow) {\n cellStart = index + 1\n }\n }\n\n if (token.type === 'tableHead') {\n inHead = events[index][0] === 'enter'\n }\n }\n\n return events\n}\n\nfunction tokenizeTable(effects, ok, nok) {\n var align = []\n var tableHeaderCount = 0\n var seenDelimiter\n var hasDash\n\n return start\n\n function start(code) {\n /* istanbul ignore if - used to be passed in beta micromark versions. */\n if (code === null || code === -5 || code === -4 || code === -3) {\n return nok(code)\n }\n\n effects.enter('table')._align = align\n effects.enter('tableHead')\n effects.enter('tableRow')\n\n // If we start with a pipe, we open a cell marker.\n if (code === 124) {\n return cellDividerHead(code)\n }\n\n tableHeaderCount++\n effects.enter('temporaryTableCellContent')\n // Can’t be space or eols at the start of a construct, so we’re in a cell.\n return inCellContentHead(code)\n }\n\n function cellDividerHead(code) {\n // Always a pipe.\n effects.enter('tableCellDivider')\n effects.consume(code)\n effects.exit('tableCellDivider')\n seenDelimiter = true\n return cellBreakHead\n }\n\n function cellBreakHead(code) {\n // EOF, CR, LF, CRLF.\n if (code === null || code === -5 || code === -4 || code === -3) {\n return atRowEndHead(code)\n }\n\n // HT, VS, SP.\n if (code === -2 || code === -1 || code === 32) {\n effects.enter('whitespace')\n effects.consume(code)\n return inWhitespaceHead\n }\n\n if (seenDelimiter) {\n seenDelimiter = undefined\n tableHeaderCount++\n }\n\n // `|`\n if (code === 124) {\n return cellDividerHead(code)\n }\n\n // Anything else is cell content.\n effects.enter('temporaryTableCellContent')\n return inCellContentHead(code)\n }\n\n function inWhitespaceHead(code) {\n // HT, VS, SP.\n if (code === -2 || code === -1 || code === 32) {\n effects.consume(code)\n return inWhitespaceHead\n }\n\n effects.exit('whitespace')\n return cellBreakHead(code)\n }\n\n function inCellContentHead(code) {\n // EOF, whitespace, pipe\n if (code === null || code < 0 || code === 32 || code === 124) {\n effects.exit('temporaryTableCellContent')\n return cellBreakHead(code)\n }\n\n effects.consume(code)\n // `\\`\n return code === 92 ? inCellContentEscapeHead : inCellContentHead\n }\n\n function inCellContentEscapeHead(code) {\n // `\\` or `|`\n if (code === 92 || code === 124) {\n effects.consume(code)\n return inCellContentHead\n }\n\n // Anything else.\n return inCellContentHead(code)\n }\n\n function atRowEndHead(code) {\n if (code === null) {\n return nok(code)\n }\n\n effects.exit('tableRow')\n effects.exit('tableHead')\n\n // Always a line ending.\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n\n // If a setext heading, exit.\n return effects.check(\n setextUnderlineMini,\n nok,\n // Support an indent before the delimiter row.\n createSpace(effects, rowStartDelimiter, 'linePrefix', 4)\n )\n }\n\n function rowStartDelimiter(code) {\n // If there’s another space, or we’re at the EOL/EOF, exit.\n if (code === null || code < 0 || code === 32) {\n return nok(code)\n }\n\n effects.enter('tableDelimiterRow')\n return atDelimiterRowBreak(code)\n }\n\n function atDelimiterRowBreak(code) {\n // EOF, CR, LF, CRLF.\n if (code === null || code === -5 || code === -4 || code === -3) {\n return rowEndDelimiter(code)\n }\n\n // HT, VS, SP.\n if (code === -2 || code === -1 || code === 32) {\n effects.enter('whitespace')\n effects.consume(code)\n return inWhitespaceDelimiter\n }\n\n // `-`\n if (code === 45) {\n effects.enter('tableDelimiterFiller')\n effects.consume(code)\n hasDash = true\n align.push(null)\n return inFillerDelimiter\n }\n\n // `:`\n if (code === 58) {\n effects.enter('tableDelimiterAlignment')\n effects.consume(code)\n effects.exit('tableDelimiterAlignment')\n align.push('left')\n return afterLeftAlignment\n }\n\n // If we start with a pipe, we open a cell marker.\n if (code === 124) {\n effects.enter('tableCellDivider')\n effects.consume(code)\n effects.exit('tableCellDivider')\n return atDelimiterRowBreak\n }\n\n return nok(code)\n }\n\n function inWhitespaceDelimiter(code) {\n // HT, VS, SP.\n if (code === -2 || code === -1 || code === 32) {\n effects.consume(code)\n return inWhitespaceDelimiter\n }\n\n effects.exit('whitespace')\n return atDelimiterRowBreak(code)\n }\n\n function inFillerDelimiter(code) {\n // `-`\n if (code === 45) {\n effects.consume(code)\n return inFillerDelimiter\n }\n\n effects.exit('tableDelimiterFiller')\n\n // `:`\n if (code === 58) {\n effects.enter('tableDelimiterAlignment')\n effects.consume(code)\n effects.exit('tableDelimiterAlignment')\n\n align[align.length - 1] =\n align[align.length - 1] === 'left' ? 'center' : 'right'\n\n return afterRightAlignment\n }\n\n return atDelimiterRowBreak(code)\n }\n\n function afterLeftAlignment(code) {\n // `-`\n if (code === 45) {\n effects.enter('tableDelimiterFiller')\n effects.consume(code)\n hasDash = true\n return inFillerDelimiter\n }\n\n // Anything else is not ok.\n return nok(code)\n }\n\n function afterRightAlignment(code) {\n // EOF, CR, LF, CRLF.\n if (code === null || code === -5 || code === -4 || code === -3) {\n return rowEndDelimiter(code)\n }\n\n // HT, VS, SP.\n if (code === -2 || code === -1 || code === 32) {\n effects.enter('whitespace')\n effects.consume(code)\n return inWhitespaceDelimiter\n }\n\n // `|`\n if (code === 124) {\n effects.enter('tableCellDivider')\n effects.consume(code)\n effects.exit('tableCellDivider')\n return atDelimiterRowBreak\n }\n\n return nok(code)\n }\n\n function rowEndDelimiter(code) {\n effects.exit('tableDelimiterRow')\n\n // Exit if there was no dash at all, or if the header cell count is not the\n // delimiter cell count.\n if (!hasDash || tableHeaderCount !== align.length) {\n return nok(code)\n }\n\n if (code === null) {\n return tableClose(code)\n }\n\n return effects.check(nextPrefixedOrBlank, tableClose, tableContinue)(code)\n }\n\n function tableClose(code) {\n effects.exit('table')\n return ok(code)\n }\n\n function tableContinue(code) {\n // Always a line ending.\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n // We checked that it’s not a prefixed or blank line, so we’re certain a\n // body is coming, though it may be indented.\n return createSpace(effects, bodyStart, 'linePrefix', 4)\n }\n\n function bodyStart(code) {\n effects.enter('tableBody')\n return rowStartBody(code)\n }\n\n function rowStartBody(code) {\n effects.enter('tableRow')\n\n // If we start with a pipe, we open a cell marker.\n if (code === 124) {\n return cellDividerBody(code)\n }\n\n effects.enter('temporaryTableCellContent')\n // Can’t be space or eols at the start of a construct, so we’re in a cell.\n return inCellContentBody(code)\n }\n\n function cellDividerBody(code) {\n // Always a pipe.\n effects.enter('tableCellDivider')\n effects.consume(code)\n effects.exit('tableCellDivider')\n return cellBreakBody\n }\n\n function cellBreakBody(code) {\n // EOF, CR, LF, CRLF.\n if (code === null || code === -5 || code === -4 || code === -3) {\n return atRowEndBody(code)\n }\n\n // HT, VS, SP.\n if (code === -2 || code === -1 || code === 32) {\n effects.enter('whitespace')\n effects.consume(code)\n return inWhitespaceBody\n }\n\n // `|`\n if (code === 124) {\n return cellDividerBody(code)\n }\n\n // Anything else is cell content.\n effects.enter('temporaryTableCellContent')\n return inCellContentBody(code)\n }\n\n function inWhitespaceBody(code) {\n // HT, VS, SP.\n if (code === -2 || code === -1 || code === 32) {\n effects.consume(code)\n return inWhitespaceBody\n }\n\n effects.exit('whitespace')\n return cellBreakBody(code)\n }\n\n function inCellContentBody(code) {\n // EOF, whitespace, pipe\n if (code === null || code < 0 || code === 32 || code === 124) {\n effects.exit('temporaryTableCellContent')\n return cellBreakBody(code)\n }\n\n effects.consume(code)\n // `\\`\n return code === 92 ? inCellContentEscapeBody : inCellContentBody\n }\n\n function inCellContentEscapeBody(code) {\n // `\\` or `|`\n if (code === 92 || code === 124) {\n effects.consume(code)\n return inCellContentBody\n }\n\n // Anything else.\n return inCellContentBody(code)\n }\n\n function atRowEndBody(code) {\n effects.exit('tableRow')\n\n if (code === null) {\n return tableBodyClose(code)\n }\n\n return effects.check(\n nextPrefixedOrBlank,\n tableBodyClose,\n tableBodyContinue\n )(code)\n }\n\n function tableBodyClose(code) {\n effects.exit('tableBody')\n return tableClose(code)\n }\n\n function tableBodyContinue(code) {\n // Always a line ending.\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n // Support an optional prefix, then start a body row.\n return createSpace(effects, rowStartBody, 'linePrefix', 4)\n }\n}\n\n// Based on micromark, but that won’t work as we’re in a table, and that expects\n// content.\n// <https://github.com/micromark/micromark/blob/main/lib/tokenize/setext-underline.js>\nfunction tokenizeSetextUnderlineMini(effects, ok, nok) {\n return start\n\n function start(code) {\n // `-`\n if (code !== 45) {\n return nok(code)\n }\n\n effects.enter('setextUnderline')\n return sequence(code)\n }\n\n function sequence(code) {\n if (code === 45) {\n effects.consume(code)\n return sequence\n }\n\n return whitespace(code)\n }\n\n function whitespace(code) {\n if (code === -2 || code === -1 || code === 32) {\n effects.consume(code)\n return whitespace\n }\n\n if (code === null || code === -5 || code === -4 || code === -3) {\n return ok(code)\n }\n\n return nok(code)\n }\n}\n\nfunction tokenizeNextPrefixedOrBlank(effects, ok, nok) {\n var size = 0\n\n return start\n\n function start(code) {\n // This is a check, so we don’t care about tokens, but we open a bogus one\n // so we’re valid.\n effects.enter('check')\n // EOL.\n effects.consume(code)\n return whitespace\n }\n\n function whitespace(code) {\n // VS or SP.\n if (code === -1 || code === 32) {\n effects.consume(code)\n size++\n return size === 4 ? ok : whitespace\n }\n\n // EOF or whitespace\n if (code === null || code < 0) {\n return ok(code)\n }\n\n // Anything else.\n return nok(code)\n }\n}\n"],"names":["syntax","flow","null","tokenize","effects","ok","nok","seenDelimiter","hasDash","align","tableHeaderCount","code","enter","_align","cellDividerHead","inCellContentHead","consume","exit","cellBreakHead","check","setextUnderlineMini","createSpace","rowStartDelimiter","atRowEndHead","inWhitespaceHead","undefined","inCellContentEscapeHead","atDelimiterRowBreak","rowEndDelimiter","inWhitespaceDelimiter","push","inFillerDelimiter","afterLeftAlignment","length","afterRightAlignment","tableClose","nextPrefixedOrBlank","tableContinue","bodyStart","rowStartBody","cellDividerBody","inCellContentBody","cellBreakBody","tableBodyClose","tableBodyContinue","atRowEndBody","inWhitespaceBody","inCellContentEscapeBody","resolve","events","context","token","inHead","inDelimiterRow","inRow","cell","content","text","contentStart","contentEnd","cellStart","index","type","start","end","contentType","splice","interruptible","require$$0","sequence","whitespace","partial","size"],"mappings":"mKAAAA,EAAAC,KAAe,CACbC,KAAM,CAACC,SAoHT,SAAuBC,EAASC,EAAIC,GAClC,IAEIC,EACAC,EAHAC,EAAQ,GACRC,EAAmB,EAIvB,OAEA,SAAeC,GAEb,GAAa,OAATA,IAA0B,IAATA,IAAwB,IAATA,QAAeA,EACjD,OAAOL,EAAIK,GAQb,GALAP,EAAQQ,MAAM,SAASC,OAASJ,EAChCL,EAAQQ,MAAM,aACdR,EAAQQ,MAAM,YAGD,MAATD,EACF,OAAOG,EAAgBH,GAMzB,OAHAD,IACAN,EAAQQ,MAAM,6BAEPG,EAAkBJ,EAC7B,EAEE,SAASG,EAAgBH,GAMvB,OAJAP,EAAQQ,MAAM,oBACdR,EAAQY,QAAQL,GAChBP,EAAQa,KAAK,oBACbV,GAAgB,EACTW,CACX,CAEE,SAASA,EAAcP,GAErB,OAAa,OAATA,IAA0B,IAATA,IAAwB,IA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EACoBnE,EAAKiE,GAId,OAAT3D,GAAiBA,EAAO,EACnBN,EAAGM,GAILL,EAAIK,EACf,CACA,EAxjBkE4D,SAAS","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"syntax.js","sources":["../../../node_modules/micromark-extension-gfm-table/syntax.js"],"sourcesContent":["exports.flow = {\n null: {tokenize: tokenizeTable, resolve: resolveTable, interruptible: true}\n}\n\nvar createSpace = require('micromark/dist/tokenize/factory-space')\n\nvar setextUnderlineMini = {tokenize: tokenizeSetextUnderlineMini, partial: true}\nvar nextPrefixedOrBlank = {tokenize: tokenizeNextPrefixedOrBlank, partial: true}\n\nfunction resolveTable(events, context) {\n var length = events.length\n var index = -1\n var token\n var inHead\n var inDelimiterRow\n var inRow\n var cell\n var content\n var text\n var contentStart\n var contentEnd\n var cellStart\n\n while (++index < length) {\n token = events[index][1]\n\n if (inRow) {\n if (token.type === 'temporaryTableCellContent') {\n contentStart = contentStart || index\n contentEnd = index\n }\n\n if (\n // Combine separate content parts into one.\n (token.type === 'tableCellDivider' || token.type === 'tableRow') &&\n contentEnd\n ) {\n content = {\n type: 'tableContent',\n start: events[contentStart][1].start,\n end: events[contentEnd][1].end\n }\n text = {\n type: 'chunkText',\n start: content.start,\n end: content.end,\n contentType: 'text'\n }\n\n events.splice(\n contentStart,\n contentEnd - contentStart + 1,\n ['enter', content, context],\n ['enter', text, context],\n ['exit', text, context],\n ['exit', content, context]\n )\n index -= contentEnd - contentStart - 3\n length = events.length\n contentStart = undefined\n contentEnd = undefined\n }\n }\n\n if (\n events[index][0] === 'exit' &&\n cellStart &&\n cellStart + 1 < index &&\n (token.type === 'tableCellDivider' ||\n (token.type === 'tableRow' &&\n (cellStart + 3 < index ||\n events[cellStart][1].type !== 'whitespace')))\n ) {\n cell = {\n type: inDelimiterRow\n ? 'tableDelimiter'\n : inHead\n ? 'tableHeader'\n : 'tableData',\n start: events[cellStart][1].start,\n end: events[index][1].end\n }\n events.splice(index + (token.type === 'tableCellDivider' ? 1 : 0), 0, [\n 'exit',\n cell,\n context\n ])\n events.splice(cellStart, 0, ['enter', cell, context])\n index += 2\n length = events.length\n cellStart = index + 1\n }\n\n if (token.type === 'tableRow') {\n inRow = events[index][0] === 'enter'\n\n if (inRow) {\n cellStart = index + 1\n }\n }\n\n if (token.type === 'tableDelimiterRow') {\n inDelimiterRow = events[index][0] === 'enter'\n\n if (inDelimiterRow) {\n cellStart = index + 1\n }\n }\n\n if (token.type === 'tableHead') {\n inHead = events[index][0] === 'enter'\n }\n }\n\n return events\n}\n\nfunction tokenizeTable(effects, ok, nok) {\n var align = []\n var tableHeaderCount = 0\n var seenDelimiter\n var hasDash\n\n return start\n\n function start(code) {\n /* istanbul ignore if - used to be passed in beta micromark versions. */\n if (code === null || code === -5 || code === -4 || code === -3) {\n return nok(code)\n }\n\n effects.enter('table')._align = align\n effects.enter('tableHead')\n effects.enter('tableRow')\n\n // If we start with a pipe, we open a cell marker.\n if (code === 124) {\n return cellDividerHead(code)\n }\n\n tableHeaderCount++\n effects.enter('temporaryTableCellContent')\n // Can’t be space or eols at the start of a construct, so we’re in a cell.\n return inCellContentHead(code)\n }\n\n function cellDividerHead(code) {\n // Always a pipe.\n effects.enter('tableCellDivider')\n effects.consume(code)\n effects.exit('tableCellDivider')\n seenDelimiter = true\n return cellBreakHead\n }\n\n function cellBreakHead(code) {\n // EOF, CR, LF, CRLF.\n if (code === null || code === -5 || code === -4 || code === -3) {\n return atRowEndHead(code)\n }\n\n // HT, VS, SP.\n if (code === -2 || code === -1 || code === 32) {\n effects.enter('whitespace')\n effects.consume(code)\n return inWhitespaceHead\n }\n\n if (seenDelimiter) {\n seenDelimiter = undefined\n tableHeaderCount++\n }\n\n // `|`\n if (code === 124) {\n return cellDividerHead(code)\n }\n\n // Anything else is cell content.\n effects.enter('temporaryTableCellContent')\n return inCellContentHead(code)\n }\n\n function inWhitespaceHead(code) {\n // HT, VS, SP.\n if (code === -2 || code === -1 || code === 32) {\n effects.consume(code)\n return inWhitespaceHead\n }\n\n effects.exit('whitespace')\n return cellBreakHead(code)\n }\n\n function inCellContentHead(code) {\n // EOF, whitespace, pipe\n if (code === null || code < 0 || code === 32 || code === 124) {\n effects.exit('temporaryTableCellContent')\n return cellBreakHead(code)\n }\n\n effects.consume(code)\n // `\\`\n return code === 92 ? inCellContentEscapeHead : inCellContentHead\n }\n\n function inCellContentEscapeHead(code) {\n // `\\` or `|`\n if (code === 92 || code === 124) {\n effects.consume(code)\n return inCellContentHead\n }\n\n // Anything else.\n return inCellContentHead(code)\n }\n\n function atRowEndHead(code) {\n if (code === null) {\n return nok(code)\n }\n\n effects.exit('tableRow')\n effects.exit('tableHead')\n\n // Always a line ending.\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n\n // If a setext heading, exit.\n return effects.check(\n setextUnderlineMini,\n nok,\n // Support an indent before the delimiter row.\n createSpace(effects, rowStartDelimiter, 'linePrefix', 4)\n )\n }\n\n function rowStartDelimiter(code) {\n // If there’s another space, or we’re at the EOL/EOF, exit.\n if (code === null || code < 0 || code === 32) {\n return nok(code)\n }\n\n effects.enter('tableDelimiterRow')\n return atDelimiterRowBreak(code)\n }\n\n function atDelimiterRowBreak(code) {\n // EOF, CR, LF, CRLF.\n if (code === null || code === -5 || code === -4 || code === -3) {\n return rowEndDelimiter(code)\n }\n\n // HT, VS, SP.\n if (code === -2 || code === -1 || code === 32) {\n effects.enter('whitespace')\n effects.consume(code)\n return inWhitespaceDelimiter\n }\n\n // `-`\n if (code === 45) {\n effects.enter('tableDelimiterFiller')\n effects.consume(code)\n hasDash = true\n align.push(null)\n return inFillerDelimiter\n }\n\n // `:`\n if (code === 58) {\n effects.enter('tableDelimiterAlignment')\n effects.consume(code)\n effects.exit('tableDelimiterAlignment')\n align.push('left')\n return afterLeftAlignment\n }\n\n // If we start with a pipe, we open a cell marker.\n if (code === 124) {\n effects.enter('tableCellDivider')\n effects.consume(code)\n effects.exit('tableCellDivider')\n return atDelimiterRowBreak\n }\n\n return nok(code)\n }\n\n function inWhitespaceDelimiter(code) {\n // HT, VS, SP.\n if (code === -2 || code === -1 || code === 32) {\n effects.consume(code)\n return inWhitespaceDelimiter\n }\n\n effects.exit('whitespace')\n return atDelimiterRowBreak(code)\n }\n\n function inFillerDelimiter(code) {\n // `-`\n if (code === 45) {\n effects.consume(code)\n return inFillerDelimiter\n }\n\n effects.exit('tableDelimiterFiller')\n\n // `:`\n if (code === 58) {\n effects.enter('tableDelimiterAlignment')\n effects.consume(code)\n effects.exit('tableDelimiterAlignment')\n\n align[align.length - 1] =\n align[align.length - 1] === 'left' ? 'center' : 'right'\n\n return afterRightAlignment\n }\n\n return atDelimiterRowBreak(code)\n }\n\n function afterLeftAlignment(code) {\n // `-`\n if (code === 45) {\n effects.enter('tableDelimiterFiller')\n effects.consume(code)\n hasDash = true\n return inFillerDelimiter\n }\n\n // Anything else is not ok.\n return nok(code)\n }\n\n function afterRightAlignment(code) {\n // EOF, CR, LF, CRLF.\n if (code === null || code === -5 || code === -4 || code === -3) {\n return rowEndDelimiter(code)\n }\n\n // HT, VS, SP.\n if (code === -2 || code === -1 || code === 32) {\n effects.enter('whitespace')\n effects.consume(code)\n return inWhitespaceDelimiter\n }\n\n // `|`\n if (code === 124) {\n effects.enter('tableCellDivider')\n effects.consume(code)\n effects.exit('tableCellDivider')\n return atDelimiterRowBreak\n }\n\n return nok(code)\n }\n\n function rowEndDelimiter(code) {\n effects.exit('tableDelimiterRow')\n\n // Exit if there was no dash at all, or if the header cell count is not the\n // delimiter cell count.\n if (!hasDash || tableHeaderCount !== align.length) {\n return nok(code)\n }\n\n if (code === null) {\n return tableClose(code)\n }\n\n return effects.check(nextPrefixedOrBlank, tableClose, tableContinue)(code)\n }\n\n function tableClose(code) {\n effects.exit('table')\n return ok(code)\n }\n\n function tableContinue(code) {\n // Always a line ending.\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n // We checked that it’s not a prefixed or blank line, so we’re certain a\n // body is coming, though it may be indented.\n return createSpace(effects, bodyStart, 'linePrefix', 4)\n }\n\n function bodyStart(code) {\n effects.enter('tableBody')\n return rowStartBody(code)\n }\n\n function rowStartBody(code) {\n effects.enter('tableRow')\n\n // If we start with a pipe, we open a cell marker.\n if (code === 124) {\n return cellDividerBody(code)\n }\n\n effects.enter('temporaryTableCellContent')\n // Can’t be space or eols at the start of a construct, so we’re in a cell.\n return inCellContentBody(code)\n }\n\n function cellDividerBody(code) {\n // Always a pipe.\n effects.enter('tableCellDivider')\n effects.consume(code)\n effects.exit('tableCellDivider')\n return cellBreakBody\n }\n\n function cellBreakBody(code) {\n // EOF, CR, LF, CRLF.\n if (code === null || code === -5 || code === -4 || code === -3) {\n return atRowEndBody(code)\n }\n\n // HT, VS, SP.\n if (code === -2 || code === -1 || code === 32) {\n effects.enter('whitespace')\n effects.consume(code)\n return inWhitespaceBody\n }\n\n // `|`\n if (code === 124) {\n return cellDividerBody(code)\n }\n\n // Anything else is cell content.\n effects.enter('temporaryTableCellContent')\n return inCellContentBody(code)\n }\n\n function inWhitespaceBody(code) {\n // HT, VS, SP.\n if (code === -2 || code === -1 || code === 32) {\n effects.consume(code)\n return inWhitespaceBody\n }\n\n effects.exit('whitespace')\n return cellBreakBody(code)\n }\n\n function inCellContentBody(code) {\n // EOF, whitespace, pipe\n if (code === null || code < 0 || code === 32 || code === 124) {\n effects.exit('temporaryTableCellContent')\n return cellBreakBody(code)\n }\n\n effects.consume(code)\n // `\\`\n return code === 92 ? inCellContentEscapeBody : inCellContentBody\n }\n\n function inCellContentEscapeBody(code) {\n // `\\` or `|`\n if (code === 92 || code === 124) {\n effects.consume(code)\n return inCellContentBody\n }\n\n // Anything else.\n return inCellContentBody(code)\n }\n\n function atRowEndBody(code) {\n effects.exit('tableRow')\n\n if (code === null) {\n return tableBodyClose(code)\n }\n\n return effects.check(\n nextPrefixedOrBlank,\n tableBodyClose,\n tableBodyContinue\n )(code)\n }\n\n function tableBodyClose(code) {\n effects.exit('tableBody')\n return tableClose(code)\n }\n\n function tableBodyContinue(code) {\n // Always a line ending.\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n // Support an optional prefix, then start a body row.\n return createSpace(effects, rowStartBody, 'linePrefix', 4)\n }\n}\n\n// Based on micromark, but that won’t work as we’re in a table, and that expects\n// content.\n// <https://github.com/micromark/micromark/blob/main/lib/tokenize/setext-underline.js>\nfunction tokenizeSetextUnderlineMini(effects, ok, nok) {\n return start\n\n function start(code) {\n // `-`\n if (code !== 45) {\n return nok(code)\n }\n\n effects.enter('setextUnderline')\n return sequence(code)\n }\n\n function sequence(code) {\n if (code === 45) {\n effects.consume(code)\n return sequence\n }\n\n return whitespace(code)\n }\n\n function whitespace(code) {\n if (code === -2 || code === -1 || code === 32) {\n effects.consume(code)\n return whitespace\n }\n\n if (code === null || code === -5 || code === -4 || code === -3) {\n return ok(code)\n }\n\n return nok(code)\n }\n}\n\nfunction tokenizeNextPrefixedOrBlank(effects, ok, nok) {\n var size = 0\n\n return start\n\n function start(code) {\n // This is a check, so we don’t care about tokens, but we open a bogus one\n // so we’re valid.\n effects.enter('check')\n // EOL.\n effects.consume(code)\n return whitespace\n }\n\n function whitespace(code) {\n // VS or SP.\n if (code === -1 || code === 32) {\n effects.consume(code)\n size++\n return size === 4 ? ok : whitespace\n }\n\n // EOF or whitespace\n if (code === null || code < 0) {\n return ok(code)\n }\n\n // Anything else.\n return nok(code)\n }\n}\n"],"names":["syntax","flow","null","tokenize","effects","ok","nok","seenDelimiter","hasDash","align","tableHeaderCount","code","enter","_align","cellDividerHead","inCellContentHead","consume","exit","cellBreakHead","check","setextUnderlineMini","createSpace","rowStartDelimiter","atRowEndHead","inWhitespaceHead","undefined","inCellContentEscapeHead","atDelimiterRowBreak","rowEndDelimiter","inWhitespaceDelimiter","push","inFillerDelimiter","afterLeftAlignment","length","afterRightAlignment","tableClose","nextPrefixedOrBlank","tableContinue","bodyStart","rowStartBody","cellDividerBody","inCellContentBody","cellBreakBody","tableBodyClose","tableBodyContinue","atRowEndBody","inWhitespaceBody","inCellContentEscapeBody","resolve","events","context","token","inHead","inDelimiterRow","inRow","cell","content","text","contentStart","contentEnd","cellStart","index","type","start","end","contentType","splice","interruptible","require$$0","sequence","whitespace","partial","size"],"mappings":"kKAAAA,EAAAC,KAAe,CACbC,KAAM,CAACC,SAoHT,SAAuBC,EAASC,EAAIC,GAClC,IAEIC,EACAC,EAHAC,EAAQ,GACRC,EAAmB,EAIvB,OAEA,SAAeC,GAEb,GAAa,OAATA,IAA0B,IAATA,IAAwB,IAATA,QAAeA,EACjD,OAAOL,EAAIK,GAQb,GALAP,EAAQQ,MAAM,SAASC,OAASJ,EAChCL,EAAQQ,MAAM,aACdR,EAAQQ,MAAM,YAGD,MAATD,EACF,OAAOG,EAAgBH,GAMzB,OAHAD,IACAN,EAAQQ,MAAM,6BAEPG,EAAkBJ,EAC7B,EAEE,SAASG,EAAgBH,GAMvB,OAJAP,EAAQQ,MAAM,oBACdR,EAAQY,QAAQL,GAChBP,EAAQa,KAAK,oBACbV,GAAgB,EACTW,CACX,CAEE,SAASA,EAAcP,GAErB,OAAa,OAATA,IAA0B,IAATA,IAAwB,IAATA,QAAeA,EA4DrD,SAAsBA,GACpB,GAAa,OAATA,EACF,OAAOL,EAAIK,GAYb,OATAP,EAAQa,KAAK,YACbb,EAAQa,KAAK,aAGbb,EAAQQ,MAAM,cACdR,EAAQY,QAAQL,GAChBP,EAAQa,KAAK,cAGNb,EAAQe,MACbC,EACAd,EAEAe,EAAYjB,EAASkB,EAAmB,aAAc,GAE5D,CA/EaC,CAAaZ,IAIT,IAATA,IAAwB,IAATA,GAAwB,KAATA,GAChCP,EAAQQ,MAAM,cACdR,EAAQY,QAAQL,GACTa,IAGLjB,IACFA,OAAgBkB,EAChBf,KAIW,MAATC,EACKG,EAAgBH,IAIzBP,EAAQQ,MAAM,6BACPG,EAAkBJ,IAC7B,CAEE,SAASa,EAAiBb,GAExB,OAAa,IAATA,IAAwB,IAATA,GAAwB,KAAT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IAGxE,IAAI9C,EAAc+C,IAEdhD,EAAsB,CAACjB,SAuf3B,SAAqCC,EAASC,EAAIC,GAChD,OAEA,SAAeK,GAEb,GAAa,KAATA,EACF,OAAOL,EAAIK,GAIb,OADAP,EAAQQ,MAAM,mBACPyD,EAAS1D,EACpB,EAEE,SAAS0D,EAAS1D,GAChB,OAAa,KAATA,GACFP,EAAQY,QAAQL,GACT0D,GAGFC,EAAW3D,EACtB,CAEE,SAAS2D,EAAW3D,GAClB,OAAa,IAATA,IAAwB,IAATA,GAAwB,KAATA,GAChCP,EAAQY,QAAQL,GACT2D,GAGI,OAAT3D,IAA0B,IAATA,IAAwB,IAATA,QAAeA,EAC1CN,EAAGM,GAGLL,EAAIK,EACf,CACA,EAzhBkE4D,SAAS,GACvEnC,EAAsB,CAACjC,SA0hB3B,SAAqCC,EAASC,EAAIC,GAChD,IAAIkE,EAAO,EAEX,OAEA,SAAe7D,GAMb,OAHAP,EAAQQ,MAAM,SAEdR,EAAQY,QAAQL,GACT2D,CACX,EAEE,SAASA,EAAW3D,GAElB,OAAa,IAATA,GAAwB,KAATA,GACjBP,EAAQY,QAAQL,GAEA,MADhB6D,EACoBnE,EAAKiE,GAId,OAAT3D,GAAiBA,EAAO,EACnBN,EAAGM,GAILL,EAAIK,EACf,CACA,EAxjBkE4D,SAAS","x_google_ignoreList":[0]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__module as r}from"../../_virtual/
|
|
1
|
+
import{__module as r}from"../../_virtual/index8.js";import{__require as e}from"./node_modules/react-is/index.js";import{__require as o}from"./factoryWithTypeCheckers.js";import{__require as i}from"./factoryWithThrowingShims.js";var s;function t(){if(s)return r.exports;if(s=1,"production"!==process.env.NODE_ENV){var t=e();r.exports=o()(t.isElement,true)}else r.exports=i()();return r.exports}export{t as __require};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__module as r}from"../../../../_virtual/
|
|
1
|
+
import{__module as r}from"../../../../_virtual/index13.js";import{__require as e}from"./cjs/react-is.production.min.js";import{__require as o}from"./cjs/react-is.development.js";var s;function t(){return s||(s=1,"production"===process.env.NODE_ENV?r.exports=e():r.exports=o()),r.exports}export{t as __require};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import s from"../../../_virtual/
|
|
1
|
+
import s from"../../../_virtual/index7.js";import*as e from"react";import{useBootstrapPrefix as r,useBootstrapBreakpoints as o,useBootstrapMinBreakpoint as t}from"./ThemeProvider.js";import{jsx as a}from"react/jsx-runtime";function f({as:e,bsPrefix:a,className:f,...l}){a=r(a,"col");const n=o(),c=t(),m=[],i=[];return n.forEach(s=>{const e=l[s];let r,o,t;delete l[s],"object"==typeof e&&null!=e?({span:r,offset:o,order:t}=e):r=e;const f=s!==c?`-${s}`:"";r&&m.push(!0===r?`${a}${f}`:`${a}${f}-${r}`),null!=t&&i.push(`order${f}-${t}`),null!=o&&i.push(`offset${f}-${o}`)}),[{...l,className:s(f,...m,...i)},{as:e,bsPrefix:a,spans:m}]}const l=e.forwardRef((e,r)=>{const[{className:o,...t},{as:l="div",bsPrefix:n,spans:c}]=f(e);return a(l,{...t,ref:r,className:s(o,!c.length&&n)})});l.displayName="Col";export{l as default,f as useCol};
|
|
2
2
|
//# sourceMappingURL=Col.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import r from"../../../_virtual/
|
|
1
|
+
import r from"../../../_virtual/index7.js";import*as e from"react";import{useBootstrapPrefix as o,useBootstrapBreakpoints as s,useBootstrapMinBreakpoint as t}from"./ThemeProvider.js";import{jsx as a}from"react/jsx-runtime";const l=e.forwardRef(({bsPrefix:e,className:l,as:m="div",...c},f)=>{const i=o(e,"row"),n=s(),p=t(),d=`${i}-cols`,u=[];return n.forEach(r=>{const e=c[r];let o;delete c[r],null!=e&&"object"==typeof e?({cols:o}=e):o=e;const s=r!==p?`-${r}`:"";null!=o&&u.push(`${d}${s}-${o}`)}),a(m,{ref:f,...c,className:r(l,i,...u)})});l.displayName="Row";export{l as default};
|
|
2
2
|
//# sourceMappingURL=Row.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e,{useMemo as n,useRef as r,useReducer as t,useEffect as o,useCallback as i,forwardRef as c,useImperativeHandle as u,Fragment as a}from"react";import l from"../../../../_virtual/index4.js";import{fromEvent as s}from"../../../file-selector/dist/es2015/file-selector.js";import{acceptPropAsAcceptAttr as f,pickerOptionsFromAccept as p,canUseFileSystemAccessAPI as g,onDocumentDragOver as d,isEvtWithFiles as v,isPropagationStopped as D,allFilesAccepted as y,fileAccepted as m,fileMatchSize as b,TOO_MANY_FILES_REJECTION as h,isAbort as F,isSecurityError as O,isIeOrEdge as j,composeEventHandlers as w}from"./utils/index.js";var A=["children"],E=["open"],S=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],x=["refKey","onChange","onClick"];function P(e){return function(e){if(Array.isArray(e))return R(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||C(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var t,o,i=[],c=!0,u=!1;try{for(r=r.call(e);!(c=(t=r.next()).done)&&(i.push(t.value),!n||i.length!==n);c=!0);}catch(e){u=!0,o=e}finally{try{c||null==r.return||r.return()}finally{if(u)throw o}}return i}(e,n)||C(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function C(e,n){if(e){if("string"==typeof e)return R(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?R(e,n):void 0}}function R(e,n){(null==n||n>e.length)&&(n=e.length);for(var r=0,t=new Array(n);r<n;r++)t[r]=e[r];return t}function I(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,t)}return r}function L(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?I(Object(r),!0).forEach(function(n){z(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):I(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function z(e,n,r){return n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function K(e,n){if(null==e)return{};var r,t,o=function(e,n){if(null==e)return{};var r,t,o={},i=Object.keys(e);for(t=0;t<i.length;t++)r=i[t],n.indexOf(r)>=0||(o[r]=e[r]);return o}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(t=0;t<i.length;t++)r=i[t],n.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var T=c(function(n,r){var t=n.children,o=N(K(n,A)),i=o.open,c=K(o,E);return u(r,function(){return{open:i}},[i]),e.createElement(a,null,t(L(L({},c),{},{open:i})))});T.displayName="Dropzone";var B={disabled:!1,getFilesFromEvent:s,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1,autoFocus:!1};T.defaultProps=B,T.propTypes={children:l.func,accept:l.objectOf(l.arrayOf(l.string)),multiple:l.bool,preventDropOnDocument:l.bool,noClick:l.bool,noKeyboard:l.bool,noDrag:l.bool,noDragEventsBubbling:l.bool,minSize:l.number,maxSize:l.number,maxFiles:l.number,disabled:l.bool,getFilesFromEvent:l.func,onFileDialogCancel:l.func,onFileDialogOpen:l.func,useFsAccessApi:l.bool,autoFocus:l.bool,onDragEnter:l.func,onDragLeave:l.func,onDragOver:l.func,onDrop:l.func,onDropAccepted:l.func,onDropRejected:l.func,onError:l.func,validator:l.func};var _={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function N(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},c=L(L({},B),e),u=c.accept,a=c.disabled,l=c.getFilesFromEvent,s=c.maxSize,A=c.minSize,E=c.multiple,C=c.maxFiles,R=c.onDragEnter,I=c.onDragLeave,T=c.onDragOver,N=c.onDrop,M=c.onDropAccepted,W=c.onDropRejected,$=c.onFileDialogCancel,G=c.onFileDialogOpen,H=c.useFsAccessApi,J=c.autoFocus,Q=c.preventDropOnDocument,V=c.noClick,X=c.noKeyboard,Y=c.noDrag,Z=c.noDragEventsBubbling,ee=c.onError,ne=c.validator,re=n(function(){return f(u)},[u]),te=n(function(){return p(u)},[u]),oe=n(function(){return"function"==typeof G?G:q},[G]),ie=n(function(){return"function"==typeof $?$:q},[$]),ce=r(null),ue=r(null),ae=k(t(U,_),2),le=ae[0],se=ae[1],fe=le.isFocused,pe=le.isFileDialogActive,ge=r("undefined"!=typeof window&&window.isSecureContext&&H&&g()),de=function(){!ge.current&&pe&&setTimeout(function(){ue.current&&(ue.current.files.length||(se({type:"closeDialog"}),ie()))},300)};o(function(){return window.addEventListener("focus",de,!1),function(){window.removeEventListener("focus",de,!1)}},[ue,pe,ie,ge]);var ve=r([]),De=function(e){ce.current&&ce.current.contains(e.target)||(e.preventDefault(),ve.current=[])};o(function(){return Q&&(document.addEventListener("dragover",d,!1),document.addEventListener("drop",De,!1)),function(){Q&&(document.removeEventListener("dragover",d),document.removeEventListener("drop",De))}},[ce,Q]),o(function(){return!a&&J&&ce.current&&ce.current.focus(),function(){}},[ce,J,a]);var ye=i(function(e){ee?ee(e):console.error(e)},[ee]),me=i(function(e){e.preventDefault(),e.persist(),Ce(e),ve.current=[].concat(P(ve.current),[e.target]),v(e)&&Promise.resolve(l(e)).then(function(n){if(!D(e)||Z){var r=n.length,t=r>0&&y({files:n,accept:re,minSize:A,maxSize:s,multiple:E,maxFiles:C,validator:ne});se({isDragAccept:t,isDragReject:r>0&&!t,isDragActive:!0,type:"setDraggedFiles"}),R&&R(e)}}).catch(function(e){return ye(e)})},[l,R,ye,Z,re,A,s,E,C,ne]),be=i(function(e){e.preventDefault(),e.persist(),Ce(e);var n=v(e);if(n&&e.dataTransfer)try{e.dataTransfer.dropEffect="copy"}catch(e){}return n&&T&&T(e),!1},[T,Z]),he=i(function(e){e.preventDefault(),e.persist(),Ce(e);var n=ve.current.filter(function(e){return ce.current&&ce.current.contains(e)}),r=n.indexOf(e.target);-1!==r&&n.splice(r,1),ve.current=n,n.length>0||(se({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),v(e)&&I&&I(e))},[ce,I,Z]),Fe=i(function(e,n){var r=[],t=[];e.forEach(function(e){var n=k(m(e,re),2),o=n[0],i=n[1],c=k(b(e,A,s),2),u=c[0],a=c[1],l=ne?ne(e):null;if(o&&u&&!l)r.push(e);else{var f=[i,a];l&&(f=f.concat(l)),t.push({file:e,errors:f.filter(function(e){return e})})}}),(!E&&r.length>1||E&&C>=1&&r.length>C)&&(r.forEach(function(e){t.push({file:e,errors:[h]})}),r.splice(0)),se({acceptedFiles:r,fileRejections:t,isDragReject:t.length>0,type:"setFiles"}),N&&N(r,t,n),t.length>0&&W&&W(t,n),r.length>0&&M&&M(r,n)},[se,E,re,A,s,C,N,M,W,ne]),Oe=i(function(e){e.preventDefault(),e.persist(),Ce(e),ve.current=[],v(e)&&Promise.resolve(l(e)).then(function(n){D(e)&&!Z||Fe(n,e)}).catch(function(e){return ye(e)}),se({type:"reset"})},[l,Fe,ye,Z]),je=i(function(){if(ge.current){se({type:"openDialog"}),oe();var e={multiple:E,types:te};window.showOpenFilePicker(e).then(function(e){return l(e)}).then(function(e){Fe(e,null),se({type:"closeDialog"})}).catch(function(e){F(e)?(ie(e),se({type:"closeDialog"})):O(e)?(ge.current=!1,ue.current?(ue.current.value=null,ue.current.click()):ye(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):ye(e)})}else ue.current&&(se({type:"openDialog"}),oe(),ue.current.value=null,ue.current.click())},[se,oe,ie,H,Fe,ye,te,E]),we=i(function(e){ce.current&&ce.current.isEqualNode(e.target)&&(" "!==e.key&&"Enter"!==e.key&&32!==e.keyCode&&13!==e.keyCode||(e.preventDefault(),je()))},[ce,je]),Ae=i(function(){se({type:"focus"})},[]),Ee=i(function(){se({type:"blur"})},[]),Se=i(function(){V||(j()?setTimeout(je,0):je())},[V,je]),xe=function(e){return a?null:e},Pe=function(e){return X?null:xe(e)},ke=function(e){return Y?null:xe(e)},Ce=function(e){Z&&e.stopPropagation()},Re=n(function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.refKey,r=void 0===n?"ref":n,t=e.role,o=e.onKeyDown,i=e.onFocus,c=e.onBlur,u=e.onClick,l=e.onDragEnter,s=e.onDragOver,f=e.onDragLeave,p=e.onDrop,g=K(e,S);return L(L(z({onKeyDown:Pe(w(o,we)),onFocus:Pe(w(i,Ae)),onBlur:Pe(w(c,Ee)),onClick:xe(w(u,Se)),onDragEnter:ke(w(l,me)),onDragOver:ke(w(s,be)),onDragLeave:ke(w(f,he)),onDrop:ke(w(p,Oe)),role:"string"==typeof t&&""!==t?t:"presentation"},r,ce),a||X?{}:{tabIndex:0}),g)}},[ce,we,Ae,Ee,Se,me,be,he,Oe,X,Y,a]),Ie=i(function(e){e.stopPropagation()},[]),Le=n(function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.refKey,r=void 0===n?"ref":n,t=e.onChange,o=e.onClick,i=K(e,x);return L(L({},z({accept:re,multiple:E,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:xe(w(t,Oe)),onClick:xe(w(o,Ie)),tabIndex:-1},r,ue)),i)}},[ue,u,E,Oe,a]);return L(L({},le),{},{isFocused:fe&&!a,getRootProps:Re,getInputProps:Le,rootRef:ce,inputRef:ue,open:xe(je)})}function U(e,n){switch(n.type){case"focus":return L(L({},e),{},{isFocused:!0});case"blur":return L(L({},e),{},{isFocused:!1});case"openDialog":return L(L({},_),{},{isFileDialogActive:!0});case"closeDialog":return L(L({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return L(L({},e),{},{isDragActive:n.isDragActive,isDragAccept:n.isDragAccept,isDragReject:n.isDragReject});case"setFiles":return L(L({},e),{},{acceptedFiles:n.acceptedFiles,fileRejections:n.fileRejections,isDragReject:n.isDragReject});case"reset":return L({},_);default:return e}}function q(){}export{T as default,N as useDropzone};
|
|
1
|
+
import e,{useMemo as n,useRef as r,useReducer as t,useEffect as o,useCallback as i,forwardRef as c,useImperativeHandle as u,Fragment as a}from"react";import l from"../../../../_virtual/index3.js";import{fromEvent as s}from"../../../file-selector/dist/es2015/file-selector.js";import{acceptPropAsAcceptAttr as f,pickerOptionsFromAccept as p,canUseFileSystemAccessAPI as g,onDocumentDragOver as d,isEvtWithFiles as v,isPropagationStopped as D,allFilesAccepted as y,fileAccepted as m,fileMatchSize as b,TOO_MANY_FILES_REJECTION as h,isAbort as F,isSecurityError as O,isIeOrEdge as j,composeEventHandlers as w}from"./utils/index.js";var A=["children"],E=["open"],S=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],x=["refKey","onChange","onClick"];function P(e){return function(e){if(Array.isArray(e))return R(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||C(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var t,o,i=[],c=!0,u=!1;try{for(r=r.call(e);!(c=(t=r.next()).done)&&(i.push(t.value),!n||i.length!==n);c=!0);}catch(e){u=!0,o=e}finally{try{c||null==r.return||r.return()}finally{if(u)throw o}}return i}(e,n)||C(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function C(e,n){if(e){if("string"==typeof e)return R(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?R(e,n):void 0}}function R(e,n){(null==n||n>e.length)&&(n=e.length);for(var r=0,t=new Array(n);r<n;r++)t[r]=e[r];return t}function I(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,t)}return r}function L(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?I(Object(r),!0).forEach(function(n){z(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):I(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function z(e,n,r){return n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function K(e,n){if(null==e)return{};var r,t,o=function(e,n){if(null==e)return{};var r,t,o={},i=Object.keys(e);for(t=0;t<i.length;t++)r=i[t],n.indexOf(r)>=0||(o[r]=e[r]);return o}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(t=0;t<i.length;t++)r=i[t],n.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var T=c(function(n,r){var t=n.children,o=N(K(n,A)),i=o.open,c=K(o,E);return u(r,function(){return{open:i}},[i]),e.createElement(a,null,t(L(L({},c),{},{open:i})))});T.displayName="Dropzone";var B={disabled:!1,getFilesFromEvent:s,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1,autoFocus:!1};T.defaultProps=B,T.propTypes={children:l.func,accept:l.objectOf(l.arrayOf(l.string)),multiple:l.bool,preventDropOnDocument:l.bool,noClick:l.bool,noKeyboard:l.bool,noDrag:l.bool,noDragEventsBubbling:l.bool,minSize:l.number,maxSize:l.number,maxFiles:l.number,disabled:l.bool,getFilesFromEvent:l.func,onFileDialogCancel:l.func,onFileDialogOpen:l.func,useFsAccessApi:l.bool,autoFocus:l.bool,onDragEnter:l.func,onDragLeave:l.func,onDragOver:l.func,onDrop:l.func,onDropAccepted:l.func,onDropRejected:l.func,onError:l.func,validator:l.func};var _={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function N(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},c=L(L({},B),e),u=c.accept,a=c.disabled,l=c.getFilesFromEvent,s=c.maxSize,A=c.minSize,E=c.multiple,C=c.maxFiles,R=c.onDragEnter,I=c.onDragLeave,T=c.onDragOver,N=c.onDrop,M=c.onDropAccepted,W=c.onDropRejected,$=c.onFileDialogCancel,G=c.onFileDialogOpen,H=c.useFsAccessApi,J=c.autoFocus,Q=c.preventDropOnDocument,V=c.noClick,X=c.noKeyboard,Y=c.noDrag,Z=c.noDragEventsBubbling,ee=c.onError,ne=c.validator,re=n(function(){return f(u)},[u]),te=n(function(){return p(u)},[u]),oe=n(function(){return"function"==typeof G?G:q},[G]),ie=n(function(){return"function"==typeof $?$:q},[$]),ce=r(null),ue=r(null),ae=k(t(U,_),2),le=ae[0],se=ae[1],fe=le.isFocused,pe=le.isFileDialogActive,ge=r("undefined"!=typeof window&&window.isSecureContext&&H&&g()),de=function(){!ge.current&&pe&&setTimeout(function(){ue.current&&(ue.current.files.length||(se({type:"closeDialog"}),ie()))},300)};o(function(){return window.addEventListener("focus",de,!1),function(){window.removeEventListener("focus",de,!1)}},[ue,pe,ie,ge]);var ve=r([]),De=function(e){ce.current&&ce.current.contains(e.target)||(e.preventDefault(),ve.current=[])};o(function(){return Q&&(document.addEventListener("dragover",d,!1),document.addEventListener("drop",De,!1)),function(){Q&&(document.removeEventListener("dragover",d),document.removeEventListener("drop",De))}},[ce,Q]),o(function(){return!a&&J&&ce.current&&ce.current.focus(),function(){}},[ce,J,a]);var ye=i(function(e){ee?ee(e):console.error(e)},[ee]),me=i(function(e){e.preventDefault(),e.persist(),Ce(e),ve.current=[].concat(P(ve.current),[e.target]),v(e)&&Promise.resolve(l(e)).then(function(n){if(!D(e)||Z){var r=n.length,t=r>0&&y({files:n,accept:re,minSize:A,maxSize:s,multiple:E,maxFiles:C,validator:ne});se({isDragAccept:t,isDragReject:r>0&&!t,isDragActive:!0,type:"setDraggedFiles"}),R&&R(e)}}).catch(function(e){return ye(e)})},[l,R,ye,Z,re,A,s,E,C,ne]),be=i(function(e){e.preventDefault(),e.persist(),Ce(e);var n=v(e);if(n&&e.dataTransfer)try{e.dataTransfer.dropEffect="copy"}catch(e){}return n&&T&&T(e),!1},[T,Z]),he=i(function(e){e.preventDefault(),e.persist(),Ce(e);var n=ve.current.filter(function(e){return ce.current&&ce.current.contains(e)}),r=n.indexOf(e.target);-1!==r&&n.splice(r,1),ve.current=n,n.length>0||(se({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),v(e)&&I&&I(e))},[ce,I,Z]),Fe=i(function(e,n){var r=[],t=[];e.forEach(function(e){var n=k(m(e,re),2),o=n[0],i=n[1],c=k(b(e,A,s),2),u=c[0],a=c[1],l=ne?ne(e):null;if(o&&u&&!l)r.push(e);else{var f=[i,a];l&&(f=f.concat(l)),t.push({file:e,errors:f.filter(function(e){return e})})}}),(!E&&r.length>1||E&&C>=1&&r.length>C)&&(r.forEach(function(e){t.push({file:e,errors:[h]})}),r.splice(0)),se({acceptedFiles:r,fileRejections:t,isDragReject:t.length>0,type:"setFiles"}),N&&N(r,t,n),t.length>0&&W&&W(t,n),r.length>0&&M&&M(r,n)},[se,E,re,A,s,C,N,M,W,ne]),Oe=i(function(e){e.preventDefault(),e.persist(),Ce(e),ve.current=[],v(e)&&Promise.resolve(l(e)).then(function(n){D(e)&&!Z||Fe(n,e)}).catch(function(e){return ye(e)}),se({type:"reset"})},[l,Fe,ye,Z]),je=i(function(){if(ge.current){se({type:"openDialog"}),oe();var e={multiple:E,types:te};window.showOpenFilePicker(e).then(function(e){return l(e)}).then(function(e){Fe(e,null),se({type:"closeDialog"})}).catch(function(e){F(e)?(ie(e),se({type:"closeDialog"})):O(e)?(ge.current=!1,ue.current?(ue.current.value=null,ue.current.click()):ye(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):ye(e)})}else ue.current&&(se({type:"openDialog"}),oe(),ue.current.value=null,ue.current.click())},[se,oe,ie,H,Fe,ye,te,E]),we=i(function(e){ce.current&&ce.current.isEqualNode(e.target)&&(" "!==e.key&&"Enter"!==e.key&&32!==e.keyCode&&13!==e.keyCode||(e.preventDefault(),je()))},[ce,je]),Ae=i(function(){se({type:"focus"})},[]),Ee=i(function(){se({type:"blur"})},[]),Se=i(function(){V||(j()?setTimeout(je,0):je())},[V,je]),xe=function(e){return a?null:e},Pe=function(e){return X?null:xe(e)},ke=function(e){return Y?null:xe(e)},Ce=function(e){Z&&e.stopPropagation()},Re=n(function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.refKey,r=void 0===n?"ref":n,t=e.role,o=e.onKeyDown,i=e.onFocus,c=e.onBlur,u=e.onClick,l=e.onDragEnter,s=e.onDragOver,f=e.onDragLeave,p=e.onDrop,g=K(e,S);return L(L(z({onKeyDown:Pe(w(o,we)),onFocus:Pe(w(i,Ae)),onBlur:Pe(w(c,Ee)),onClick:xe(w(u,Se)),onDragEnter:ke(w(l,me)),onDragOver:ke(w(s,be)),onDragLeave:ke(w(f,he)),onDrop:ke(w(p,Oe)),role:"string"==typeof t&&""!==t?t:"presentation"},r,ce),a||X?{}:{tabIndex:0}),g)}},[ce,we,Ae,Ee,Se,me,be,he,Oe,X,Y,a]),Ie=i(function(e){e.stopPropagation()},[]),Le=n(function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.refKey,r=void 0===n?"ref":n,t=e.onChange,o=e.onClick,i=K(e,x);return L(L({},z({accept:re,multiple:E,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:xe(w(t,Oe)),onClick:xe(w(o,Ie)),tabIndex:-1},r,ue)),i)}},[ue,u,E,Oe,a]);return L(L({},le),{},{isFocused:fe&&!a,getRootProps:Re,getInputProps:Le,rootRef:ce,inputRef:ue,open:xe(je)})}function U(e,n){switch(n.type){case"focus":return L(L({},e),{},{isFocused:!0});case"blur":return L(L({},e),{},{isFocused:!1});case"openDialog":return L(L({},_),{},{isFileDialogActive:!0});case"closeDialog":return L(L({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return L(L({},e),{},{isDragActive:n.isDragActive,isDragAccept:n.isDragAccept,isDragReject:n.isDragReject});case"setFiles":return L(L({},e),{},{acceptedFiles:n.acceptedFiles,fileRejections:n.fileRejections,isDragReject:n.isDragReject});case"reset":return L({},_);default:return e}}function q(){}export{T as default,N as useDropzone};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"../../../../../_virtual/
|
|
1
|
+
import e from"../../../../../_virtual/index6.js";function t(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||a(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function r(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach(function(t){o(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,i=[],a=!0,c=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){c=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(c)throw o}}return i}(e,t)||a(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){if(e){if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var u="function"==typeof e?e:e.default,l="file-invalid-type",f="file-too-large",s="file-too-small",p="too-many-files",y=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(","),t=e.length>1?"one of ".concat(e.join(", ")):e[0];return{code:l,message:"File type must be ".concat(t)}},d=function(e){return{code:f,message:"File is larger than ".concat(e," ").concat(1===e?"byte":"bytes")}},b=function(e){return{code:s,message:"File is smaller than ".concat(e," ").concat(1===e?"byte":"bytes")}},m={code:p,message:"Too many files"};function v(e,t){var n="application/x-moz-file"===e.type||u(e,t);return[n,n?null:y(t)]}function g(e,t,n){if(O(e.size))if(O(t)&&O(n)){if(e.size>n)return[!1,d(n)];if(e.size<t)return[!1,b(t)]}else{if(O(t)&&e.size<t)return[!1,b(t)];if(O(n)&&e.size>n)return[!1,d(n)]}return[!0,null]}function O(e){return null!=e}function h(e){var t=e.files,n=e.accept,r=e.minSize,o=e.maxSize,a=e.multiple,c=e.maxFiles,u=e.validator;return!(!a&&t.length>1||a&&c>=1&&t.length>c)&&t.every(function(e){var t=i(v(e,n),1)[0],a=i(g(e,r,o),1)[0],c=u?u(e):null;return t&&a&&!c})}function w(e){return"function"==typeof e.isPropagationStopped?e.isPropagationStopped():void 0!==e.cancelBubble&&e.cancelBubble}function j(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(e){return"Files"===e||"application/x-moz-file"===e}):!!e.target&&!!e.target.files}function S(e){e.preventDefault()}function A(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.navigator.userAgent;return function(e){return-1!==e.indexOf("MSIE")||-1!==e.indexOf("Trident/")}(e)||function(e){return-1!==e.indexOf("Edge/")}(e)}function E(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return t.some(function(t){return!w(e)&&t&&t.apply(void 0,[e].concat(r)),w(e)})}}function x(){return"showOpenFilePicker"in window}function P(e){return O(e)?[{description:"Files",accept:Object.entries(e).filter(function(e){var t=i(e,2),n=t[0],r=t[1],o=!0;return M(n)||(console.warn('Skipped "'.concat(n,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),o=!1),Array.isArray(r)&&r.every(D)||(console.warn('Skipped "'.concat(n,'" because an invalid file extension was provided.')),o=!1),o}).reduce(function(e,t){var n=i(t,2),a=n[0],c=n[1];return r(r({},e),{},o({},a,c))},{})}]:e}function T(e){if(O(e))return Object.entries(e).reduce(function(e,n){var r=i(n,2),o=r[0],a=r[1];return[].concat(t(e),[o],t(a))},[]).filter(function(e){return M(e)||D(e)}).join(",")}function z(e){return e instanceof DOMException&&("AbortError"===e.name||e.code===e.ABORT_ERR)}function I(e){return e instanceof DOMException&&("SecurityError"===e.name||e.code===e.SECURITY_ERR)}function M(e){return"audio/*"===e||"video/*"===e||"image/*"===e||"text/*"===e||"application/*"===e||/\w+\/[-+.\w]+/g.test(e)}function D(e){return/^.*\.[\w]+$/.test(e)}export{l as FILE_INVALID_TYPE,f as FILE_TOO_LARGE,s as FILE_TOO_SMALL,p as TOO_MANY_FILES,m as TOO_MANY_FILES_REJECTION,T as acceptPropAsAcceptAttr,h as allFilesAccepted,x as canUseFileSystemAccessAPI,E as composeEventHandlers,v as fileAccepted,g as fileMatchSize,y as getInvalidTypeRejectionErr,d as getTooLargeRejectionErr,b as getTooSmallRejectionErr,z as isAbort,j as isEvtWithFiles,D as isExt,A as isIeOrEdge,M as isMIMEType,w as isPropagationStopped,I as isSecurityError,S as onDocumentDragOver,P as pickerOptionsFromAccept};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__module as r}from"../../_virtual/
|
|
1
|
+
import{__module as r}from"../../_virtual/index9.js";import{__require as e}from"./cjs/react-is.production.js";import{__require as o}from"./cjs/react-is.development.js";var s;function t(){return s||(s=1,"production"===process.env.NODE_ENV?r.exports=e():r.exports=o()),r.exports}export{t as __require};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../node_modules/react-is/index.js"],"sourcesContent":["'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n"],"names":["process","env","NODE_ENV","reactIsModule","exports","require$$0","require$$1"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../node_modules/react-is/index.js"],"sourcesContent":["'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n"],"names":["process","env","NODE_ENV","reactIsModule","exports","require$$0","require$$1"],"mappings":"yMAE6B,eAAzBA,QAAQC,IAAIC,SACdC,EAAAC,QAAiBC,IAEjBF,EAAAC,QAAiBE","x_google_ignoreList":[0]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__module as r}from"../../../../_virtual/
|
|
1
|
+
import{__module as r}from"../../../../_virtual/index11.js";import{__require as e}from"./cjs/react-is.production.min.js";import{__require as o}from"./cjs/react-is.development.js";var s;function t(){return s||(s=1,"production"===process.env.NODE_ENV?r.exports=e():r.exports=o()),r.exports}export{t as __require};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__module as e}from"../../../_virtual/
|
|
1
|
+
import{__module as e}from"../../../_virtual/index5.js";import t from"react";var s;e.exports;function i(){return s||(s=1,"undefined"!=typeof self&&self,e.exports=(i=t,(()=>{var e={155:e=>{e.exports=i}},t={};function s(i){var o=t[i];if(void 0!==o)return o.exports;var r=t[i]={exports:{}};return e[i](r,r.exports,s),r.exports}s.d=(e,t)=>{for(var i in t)s.o(t,i)&&!s.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};s.r(o),s.d(o,{useStopwatch:()=>u,useTime:()=>d,useTimer:()=>m});var r=s(155);class n{static getTimeFromMilliseconds(e,t=!0){const s=t?Math.ceil(e/1e3):Math.floor(e/1e3),i=Math.floor(s/86400),o=Math.floor(s%86400/3600),r=Math.floor(s%3600/60),n=Math.floor(s%60);return{totalMilliseconds:e,totalSeconds:s,milliseconds:Math.floor(e%1e3),seconds:n,minutes:r,hours:o,days:i}}static getMillisecondsFromExpiry(e){const t=(new Date).getTime(),s=(null==e?void 0:e.getTime())-t;return s>0?s:0}static getMillisecondsFromPrevTime(e){const t=(new Date).getTime()-e;return t>0?t:0}static getMillisecondsFromTimeNow(){const e=new Date;return e.getTime()-60*e.getTimezoneOffset()*1e3}static getFormattedTimeFromMilliseconds(e,t){const{milliseconds:s,seconds:i,minutes:o,hours:r}=n.getTimeFromMilliseconds(e);let l="",a=r;return"12-hour"===t&&(l=r>=12?"pm":"am",a=r%12),{milliseconds:s,seconds:i,minutes:o,hours:a,ampm:l}}}class l{static expiryTimestamp(e){const t=new Date(e).getTime()>0;return t||console.warn("react-timer-hook: { useTimer } Invalid expiryTimestamp settings",e),t}static onExpire(e){const t=e&&"function"==typeof e;return e&&!t&&console.warn("react-timer-hook: { useTimer } Invalid onExpire settings function",e),t}}function a(e,t){const s=(0,r.useRef)(e);(0,r.useEffect)(()=>{s.current=e}),(0,r.useEffect)(()=>{if(!t)return()=>{};const e=setInterval(()=>{var e;null===(e=null==s?void 0:s.current)||void 0===e||e.call(s)},t);return()=>clearInterval(e)},[t])}const c=1e3;function m({expiryTimestamp:e,onExpire:t=()=>{},autoStart:s=!0,interval:i=c}){const[o,m]=(0,r.useState)(e),[u,d]=(0,r.useState)(n.getMillisecondsFromExpiry(o)),[g,p]=(0,r.useState)(s),[f,T]=(0,r.useState)(s),[M,v]=(0,r.useState)(i),x=(0,r.useCallback)(()=>{l.onExpire(t)&&t(),p(!1),v(null)},[t]),y=(0,r.useCallback)(()=>{p(!1)},[]),F=(0,r.useCallback)((e,t=!0)=>{v(i),T(t),p(t),m(e),d(n.getMillisecondsFromExpiry(e))},[i]),b=(0,r.useCallback)(()=>{const e=new Date;e.setMilliseconds(e.getMilliseconds()+u),F(e)},[u,F]),S=(0,r.useCallback)(()=>{f?(d(n.getMillisecondsFromExpiry(o)),p(!0)):b()},[o,f,b]);return a(()=>{const e=n.getMillisecondsFromExpiry(o);d(e),e<=0?x():M&&e<M&&v(e)},g?M:null),(0,r.useEffect)(()=>{l.expiryTimestamp(o)},[o]),Object.assign(Object.assign({},n.getTimeFromMilliseconds(u)),{start:S,pause:y,resume:b,restart:F,isRunning:g})}function u({autoStart:e=!0,offsetTimestamp:t,interval:s=c}={}){const i=t?n.getMillisecondsFromExpiry(t):0,[o,l]=(0,r.useState)((new Date).getTime()-new Date(i).getTime()),[m,u]=(0,r.useState)(n.getMillisecondsFromPrevTime(o||0)),[d,g]=(0,r.useState)(e),p=c-m%c,[f,T]=(0,r.useState)(s<p?s:p);a(()=>{f!==s&&T(s),u(n.getMillisecondsFromPrevTime(o))},d?f:null);const M=(0,r.useCallback)(()=>{l((new Date).getTime()-new Date(m).getTime()),g(!0)},[m]),v=(0,r.useCallback)(()=>{d&&(u(n.getMillisecondsFromPrevTime(o)),g(!1))},[o,d]),x=(0,r.useCallback)((e,t=!0)=>{const i=e?n.getMillisecondsFromExpiry(e):0,o=(new Date).getTime()-new Date(i).getTime(),r=n.getMillisecondsFromPrevTime(o),a=c-r%c;l(o),u(r),T(s<a?s:a),g(t)},[s]);return Object.assign(Object.assign({},n.getTimeFromMilliseconds(m,!1)),{start:M,pause:v,reset:x,isRunning:d})}function d({format:e,interval:t=c}={}){const[s,i]=(0,r.useState)(n.getMillisecondsFromTimeNow());return a(()=>{i(n.getMillisecondsFromTimeNow())},t),Object.assign({},n.getFormattedTimeFromMilliseconds(s,e))}return o})())),e.exports;var i}export{i as __require};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function e(e,t){void 0===t&&(t={});var d=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css","top"===d&&n.firstChild?n.insertBefore(s,n.firstChild):n.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}}export{e as default};
|
|
2
|
+
//# sourceMappingURL=style-inject.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style-inject.es.js","sources":["../../../../node_modules/style-inject/dist/style-inject.es.js"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n"],"names":["styleInject","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode"],"mappings":"AAAA,SAASA,EAAYC,EAAKC,QACX,IAARA,IAAiBA,EAAM,CAAA,GAC5B,IAAIC,EAAWD,EAAIC,SAEnB,GAAKF,GAA2B,oBAAbG,SAAnB,CAEA,IAAIC,EAAOD,SAASC,MAAQD,SAASE,qBAAqB,QAAQ,GAC9DC,EAAQH,SAASI,cAAc,SACnCD,EAAME,KAAO,WAEI,QAAbN,GACEE,EAAKK,WACPL,EAAKM,aAAaJ,EAAOF,EAAKK,YAKhCL,EAAKO,YAAYL,GAGfA,EAAMM,WACRN,EAAMM,WAAWC,QAAUb,EAE3BM,EAAMK,YAAYR,SAASW,eAAed,GAnBW,CAqBzD","x_google_ignoreList":[0]}
|