markdown-flow-ui 0.1.92 → 0.1.93-beta.0
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/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/@braintree_sanitize-url@7.1.1/node_modules/@braintree/sanitize-url/dist/index.cjs.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/@braintree_sanitize-url@7.1.1/node_modules/@braintree/sanitize-url/dist/index.cjs.js.map +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/@braintree_sanitize-url@7.1.1/node_modules/@braintree/sanitize-url/dist/index.es.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.cjs.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.es.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/diff@5.2.0/node_modules/diff/lib/index.cjs.js +6 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/diff@5.2.0/node_modules/diff/lib/index.cjs.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/diff@5.2.0/node_modules/diff/lib/index.es.js +350 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/diff@5.2.0/node_modules/diff/lib/index.es.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/c4Diagram-YG6GDRKO.cjs.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/c4Diagram-YG6GDRKO.es.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-S3R3BYOJ.cjs.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-S3R3BYOJ.es.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-TZMSLE5B.cjs.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-TZMSLE5B.es.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/ganttDiagram-LVOFAZNH.cjs.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/ganttDiagram-LVOFAZNH.es.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-WL72ISMW.cjs.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-WL72ISMW.es.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rc-input@1.8.0_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-input/es/BaseInput.cjs.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rc-input@1.8.0_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-input/es/BaseInput.es.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/ResizableTextArea.cjs.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/ResizableTextArea.es.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/TextArea.cjs.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/TextArea.es.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/index.cjs.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/index.es.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-flow@0.1.6/node_modules/remark-flow/dist/index.cjs.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-flow@0.1.6/node_modules/remark-flow/dist/index.es.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-flow@0.1.6/node_modules/remark-flow/dist/remark-custom-variable.cjs.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-flow@0.1.6/node_modules/remark-flow/dist/remark-custom-variable.es.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-flow@0.1.6/node_modules/remark-flow/dist/remark-interaction.cjs.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-flow@0.1.6/node_modules/remark-flow/dist/remark-interaction.es.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/style-to-object@1.0.11/node_modules/style-to-object/cjs/index.cjs.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/style-to-object@1.0.11/node_modules/style-to-object/cjs/index.es.js +1 -1
- package/dist/_virtual/index.cjs10.js +1 -1
- package/dist/_virtual/index.cjs2.js +1 -1
- package/dist/_virtual/index.cjs3.js +1 -1
- package/dist/_virtual/index.cjs4.js +1 -1
- package/dist/_virtual/index.cjs7.js +1 -1
- package/dist/_virtual/index.cjs8.js +1 -1
- package/dist/_virtual/index.es10.js +2 -2
- package/dist/_virtual/index.es2.js +5 -2
- package/dist/_virtual/index.es2.js.map +1 -1
- package/dist/_virtual/index.es3.js +2 -4
- package/dist/_virtual/index.es3.js.map +1 -1
- package/dist/_virtual/index.es4.js +4 -5
- package/dist/_virtual/index.es4.js.map +1 -1
- package/dist/_virtual/index.es7.js +2 -3
- package/dist/_virtual/index.es7.js.map +1 -1
- package/dist/_virtual/index.es8.js +3 -2
- package/dist/_virtual/index.es8.js.map +1 -1
- package/dist/components/ContentRender/ContentRender.cjs.js +2 -2
- package/dist/components/ContentRender/ContentRender.cjs.js.map +1 -1
- package/dist/components/ContentRender/ContentRender.es.js +111 -104
- package/dist/components/ContentRender/ContentRender.es.js.map +1 -1
- package/dist/components/ContentRender/ContentRender.stories.d.ts +1 -0
- package/dist/components/ContentRender/IframeSandbox.cjs.js +6 -5
- package/dist/components/ContentRender/IframeSandbox.cjs.js.map +1 -1
- package/dist/components/ContentRender/IframeSandbox.es.js +104 -98
- package/dist/components/ContentRender/IframeSandbox.es.js.map +1 -1
- package/dist/components/ContentRender/SandboxApp.cjs.js +3 -2
- package/dist/components/ContentRender/SandboxApp.cjs.js.map +1 -1
- package/dist/components/ContentRender/SandboxApp.es.js +92 -84
- package/dist/components/ContentRender/SandboxApp.es.js.map +1 -1
- package/dist/components/ContentRender/blackboard/blackboard-runtime.cjs.js +5 -0
- package/dist/components/ContentRender/blackboard/blackboard-runtime.cjs.js.map +1 -0
- package/dist/components/ContentRender/blackboard/blackboard-runtime.d.ts +18 -0
- package/dist/components/ContentRender/blackboard/blackboard-runtime.es.js +137 -0
- package/dist/components/ContentRender/blackboard/blackboard-runtime.es.js.map +1 -0
- package/dist/components/ContentRender/blackboard/diff-parser.cjs.js +2 -0
- package/dist/components/ContentRender/blackboard/diff-parser.cjs.js.map +1 -0
- package/dist/components/ContentRender/blackboard/diff-parser.d.ts +8 -0
- package/dist/components/ContentRender/blackboard/diff-parser.es.js +132 -0
- package/dist/components/ContentRender/blackboard/diff-parser.es.js.map +1 -0
- package/dist/components/ContentRender/blackboard/diff-parser.test.d.ts +1 -0
- package/dist/components/ContentRender/blackboard-vendor.cjs.js +2 -0
- package/dist/components/ContentRender/blackboard-vendor.cjs.js.map +1 -0
- package/dist/components/ContentRender/blackboard-vendor.d.ts +5 -0
- package/dist/components/ContentRender/blackboard-vendor.es.js +15 -0
- package/dist/components/ContentRender/blackboard-vendor.es.js.map +1 -0
- package/dist/components/ContentRender/index.cjs.js +1 -1
- package/dist/components/ContentRender/index.es.js +1 -0
- package/dist/components/ContentRender/index.es.js.map +1 -1
- package/dist/components/ContentRender/utils/split-content.cjs.js +2 -2
- package/dist/components/ContentRender/utils/split-content.cjs.js.map +1 -1
- package/dist/components/ContentRender/utils/split-content.es.js +118 -109
- package/dist/components/ContentRender/utils/split-content.es.js.map +1 -1
- package/dist/components/ContentRender/vendor/daisyui-v4.min.css.cjs.js +22 -0
- package/dist/components/ContentRender/vendor/daisyui-v4.min.css.cjs.js.map +1 -0
- package/dist/components/ContentRender/vendor/daisyui-v4.min.css.es.js +25 -0
- package/dist/components/ContentRender/vendor/daisyui-v4.min.css.es.js.map +1 -0
- package/dist/components/ContentRender/vendor/gsap-v3.min.cjs.js +12 -0
- package/dist/components/ContentRender/vendor/gsap-v3.min.cjs.js.map +1 -0
- package/dist/components/ContentRender/vendor/gsap-v3.min.es.js +15 -0
- package/dist/components/ContentRender/vendor/gsap-v3.min.es.js.map +1 -0
- package/dist/components/ContentRender/vendor/tailwindcss-v3.min.cjs.js +2 -0
- package/dist/components/ContentRender/vendor/tailwindcss-v3.min.cjs.js.map +1 -0
- package/dist/components/ContentRender/vendor/tailwindcss-v3.min.es.js +5 -0
- package/dist/components/ContentRender/vendor/tailwindcss-v3.min.es.js.map +1 -0
- package/dist/components/MarkdownFlow/MarkdownFlow.cjs.js +1 -1
- package/dist/components/MarkdownFlow/MarkdownFlow.cjs.js.map +1 -1
- package/dist/components/MarkdownFlow/MarkdownFlow.es.js +3 -2
- package/dist/components/MarkdownFlow/MarkdownFlow.es.js.map +1 -1
- package/dist/components/ui/inputGroup/textarea.cjs.js +1 -1
- package/dist/components/ui/inputGroup/textarea.es.js +1 -1
- package/dist/markdown-flow-ui-lib.css +1 -1
- package/package.json +4 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../../../../../../../../../../_virtual/index.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../../../../../../../../../../_virtual/index.cjs10.js"),v=require("./constants.cjs.js");var d;function x(){if(d)return c.__exports;d=1,Object.defineProperty(c.__exports,"__esModule",{value:!0}),c.__exports.sanitizeUrl=void 0;var e=v.__require();function m(r){return e.relativeFirstCharacters.indexOf(r[0])>-1}function p(r){var i=r.replace(e.ctrlCharactersRegex,"");return i.replace(e.htmlEntitiesRegex,function(t,a){return String.fromCharCode(a)})}function R(r){return URL.canParse(r)}function l(r){try{return decodeURIComponent(r)}catch{return r}}function f(r){if(!r)return e.BLANK_URL;var i,t=l(r.trim());do t=p(t).replace(e.htmlCtrlEntityRegex,"").replace(e.ctrlCharactersRegex,"").replace(e.whitespaceEscapeCharsRegex,"").trim(),t=l(t),i=t.match(e.ctrlCharactersRegex)||t.match(e.htmlEntitiesRegex)||t.match(e.htmlCtrlEntityRegex)||t.match(e.whitespaceEscapeCharsRegex);while(i&&i.length>0);var a=t;if(!a)return e.BLANK_URL;if(m(a))return a;var u=a.trimStart(),h=u.match(e.urlSchemeRegex);if(!h)return a;var n=h[0].toLowerCase().trim();if(e.invalidProtocolRegex.test(n))return e.BLANK_URL;var s=u.replace(/\\/g,"/");if(n==="mailto:"||n.includes("://"))return s;if(n==="http:"||n==="https:"){if(!R(s))return e.BLANK_URL;var o=new URL(s);return o.protocol=o.protocol.toLowerCase(),o.hostname=o.hostname.toLowerCase(),o.toString()}return s}return c.__exports.sanitizeUrl=f,c.__exports}exports.__require=x;
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../../../../../../../../../../../node_modules/.pnpm/@braintree+sanitize-url@7.1.1/node_modules/@braintree/sanitize-url/dist/index.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sanitizeUrl = void 0;\nvar constants_1 = require(\"./constants\");\nfunction isRelativeUrlWithoutProtocol(url) {\n return constants_1.relativeFirstCharacters.indexOf(url[0]) > -1;\n}\nfunction decodeHtmlCharacters(str) {\n var removedNullByte = str.replace(constants_1.ctrlCharactersRegex, \"\");\n return removedNullByte.replace(constants_1.htmlEntitiesRegex, function (match, dec) {\n return String.fromCharCode(dec);\n });\n}\nfunction isValidUrl(url) {\n return URL.canParse(url);\n}\nfunction decodeURI(uri) {\n try {\n return decodeURIComponent(uri);\n }\n catch (e) {\n // Ignoring error\n // It is possible that the URI contains a `%` not associated\n // with URI/URL-encoding.\n return uri;\n }\n}\nfunction sanitizeUrl(url) {\n if (!url) {\n return constants_1.BLANK_URL;\n }\n var charsToDecode;\n var decodedUrl = decodeURI(url.trim());\n do {\n decodedUrl = decodeHtmlCharacters(decodedUrl)\n .replace(constants_1.htmlCtrlEntityRegex, \"\")\n .replace(constants_1.ctrlCharactersRegex, \"\")\n .replace(constants_1.whitespaceEscapeCharsRegex, \"\")\n .trim();\n decodedUrl = decodeURI(decodedUrl);\n charsToDecode =\n decodedUrl.match(constants_1.ctrlCharactersRegex) ||\n decodedUrl.match(constants_1.htmlEntitiesRegex) ||\n decodedUrl.match(constants_1.htmlCtrlEntityRegex) ||\n decodedUrl.match(constants_1.whitespaceEscapeCharsRegex);\n } while (charsToDecode && charsToDecode.length > 0);\n var sanitizedUrl = decodedUrl;\n if (!sanitizedUrl) {\n return constants_1.BLANK_URL;\n }\n if (isRelativeUrlWithoutProtocol(sanitizedUrl)) {\n return sanitizedUrl;\n }\n // Remove any leading whitespace before checking the URL scheme\n var trimmedUrl = sanitizedUrl.trimStart();\n var urlSchemeParseResults = trimmedUrl.match(constants_1.urlSchemeRegex);\n if (!urlSchemeParseResults) {\n return sanitizedUrl;\n }\n var urlScheme = urlSchemeParseResults[0].toLowerCase().trim();\n if (constants_1.invalidProtocolRegex.test(urlScheme)) {\n return constants_1.BLANK_URL;\n }\n var backSanitized = trimmedUrl.replace(/\\\\/g, \"/\");\n // Handle special cases for mailto: and custom deep-link protocols\n if (urlScheme === \"mailto:\" || urlScheme.includes(\"://\")) {\n return backSanitized;\n }\n // For http and https URLs, perform additional validation\n if (urlScheme === \"http:\" || urlScheme === \"https:\") {\n if (!isValidUrl(backSanitized)) {\n return constants_1.BLANK_URL;\n }\n var url_1 = new URL(backSanitized);\n url_1.protocol = url_1.protocol.toLowerCase();\n url_1.hostname = url_1.hostname.toLowerCase();\n return url_1.toString();\n }\n return backSanitized;\n}\nexports.sanitizeUrl = sanitizeUrl;\n"],"names":["dist","constants_1","require$$0","isRelativeUrlWithoutProtocol","url","decodeHtmlCharacters","str","removedNullByte","match","dec","isValidUrl","decodeURI","uri","sanitizeUrl","charsToDecode","decodedUrl","sanitizedUrl","trimmedUrl","urlSchemeParseResults","urlScheme","backSanitized","url_1"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../../../../../../../../../node_modules/.pnpm/@braintree+sanitize-url@7.1.1/node_modules/@braintree/sanitize-url/dist/index.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sanitizeUrl = void 0;\nvar constants_1 = require(\"./constants\");\nfunction isRelativeUrlWithoutProtocol(url) {\n return constants_1.relativeFirstCharacters.indexOf(url[0]) > -1;\n}\nfunction decodeHtmlCharacters(str) {\n var removedNullByte = str.replace(constants_1.ctrlCharactersRegex, \"\");\n return removedNullByte.replace(constants_1.htmlEntitiesRegex, function (match, dec) {\n return String.fromCharCode(dec);\n });\n}\nfunction isValidUrl(url) {\n return URL.canParse(url);\n}\nfunction decodeURI(uri) {\n try {\n return decodeURIComponent(uri);\n }\n catch (e) {\n // Ignoring error\n // It is possible that the URI contains a `%` not associated\n // with URI/URL-encoding.\n return uri;\n }\n}\nfunction sanitizeUrl(url) {\n if (!url) {\n return constants_1.BLANK_URL;\n }\n var charsToDecode;\n var decodedUrl = decodeURI(url.trim());\n do {\n decodedUrl = decodeHtmlCharacters(decodedUrl)\n .replace(constants_1.htmlCtrlEntityRegex, \"\")\n .replace(constants_1.ctrlCharactersRegex, \"\")\n .replace(constants_1.whitespaceEscapeCharsRegex, \"\")\n .trim();\n decodedUrl = decodeURI(decodedUrl);\n charsToDecode =\n decodedUrl.match(constants_1.ctrlCharactersRegex) ||\n decodedUrl.match(constants_1.htmlEntitiesRegex) ||\n decodedUrl.match(constants_1.htmlCtrlEntityRegex) ||\n decodedUrl.match(constants_1.whitespaceEscapeCharsRegex);\n } while (charsToDecode && charsToDecode.length > 0);\n var sanitizedUrl = decodedUrl;\n if (!sanitizedUrl) {\n return constants_1.BLANK_URL;\n }\n if (isRelativeUrlWithoutProtocol(sanitizedUrl)) {\n return sanitizedUrl;\n }\n // Remove any leading whitespace before checking the URL scheme\n var trimmedUrl = sanitizedUrl.trimStart();\n var urlSchemeParseResults = trimmedUrl.match(constants_1.urlSchemeRegex);\n if (!urlSchemeParseResults) {\n return sanitizedUrl;\n }\n var urlScheme = urlSchemeParseResults[0].toLowerCase().trim();\n if (constants_1.invalidProtocolRegex.test(urlScheme)) {\n return constants_1.BLANK_URL;\n }\n var backSanitized = trimmedUrl.replace(/\\\\/g, \"/\");\n // Handle special cases for mailto: and custom deep-link protocols\n if (urlScheme === \"mailto:\" || urlScheme.includes(\"://\")) {\n return backSanitized;\n }\n // For http and https URLs, perform additional validation\n if (urlScheme === \"http:\" || urlScheme === \"https:\") {\n if (!isValidUrl(backSanitized)) {\n return constants_1.BLANK_URL;\n }\n var url_1 = new URL(backSanitized);\n url_1.protocol = url_1.protocol.toLowerCase();\n url_1.hostname = url_1.hostname.toLowerCase();\n return url_1.toString();\n }\n return backSanitized;\n}\nexports.sanitizeUrl = sanitizeUrl;\n"],"names":["dist","constants_1","require$$0","isRelativeUrlWithoutProtocol","url","decodeHtmlCharacters","str","removedNullByte","match","dec","isValidUrl","decodeURI","uri","sanitizeUrl","charsToDecode","decodedUrl","sanitizedUrl","trimmedUrl","urlSchemeParseResults","urlScheme","backSanitized","url_1"],"mappings":"wOACA,OAAO,eAAeA,EAAAA,UAAS,aAAc,CAAE,MAAO,GAAM,EAC5DA,EAAAA,UAAA,YAAsB,OACtB,IAAIC,EAAcC,EAAAA,UAAA,EAClB,SAASC,EAA6BC,EAAK,CACvC,OAAOH,EAAY,wBAAwB,QAAQG,EAAI,CAAC,CAAC,EAAI,EACjE,CACA,SAASC,EAAqBC,EAAK,CAC/B,IAAIC,EAAkBD,EAAI,QAAQL,EAAY,oBAAqB,EAAE,EACrE,OAAOM,EAAgB,QAAQN,EAAY,kBAAmB,SAAUO,EAAOC,EAAK,CAChF,OAAO,OAAO,aAAaA,CAAG,CACtC,CAAK,CACL,CACA,SAASC,EAAWN,EAAK,CACrB,OAAO,IAAI,SAASA,CAAG,CAC3B,CACA,SAASO,EAAUC,EAAK,CACpB,GAAI,CACA,OAAO,mBAAmBA,CAAG,CACrC,MACc,CAIN,OAAOA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|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../../../../../../../../_virtual/index.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../../../../../../../../_virtual/index.cjs7.js");/*!
|
|
2
2
|
Copyright (c) 2018 Jed Watson.
|
|
3
3
|
Licensed under the MIT License (MIT), see
|
|
4
4
|
http://jedwatson.github.io/classnames
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function C(){}C.prototype={diff:function(e,n){var i,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},t=o.callback;typeof o=="function"&&(t=o,o={}),this.options=o;var s=this;function u(h){return t?(setTimeout(function(){t(void 0,h)},0),!0):h}e=this.castInput(e),n=this.castInput(n),e=this.removeEmpty(this.tokenize(e)),n=this.removeEmpty(this.tokenize(n));var d=n.length,l=e.length,p=1,f=d+l;o.maxEditLength&&(f=Math.min(f,o.maxEditLength));var a=(i=o.timeout)!==null&&i!==void 0?i:1/0,m=Date.now()+a,c=[{oldPos:-1,lastComponent:void 0}],v=this.extractCommon(c[0],n,e,0);if(c[0].oldPos+1>=l&&v+1>=d)return u([{value:this.join(n),count:n.length}]);var z=-1/0,w=1/0;function F(){for(var h=Math.max(z,-p);h<=Math.min(w,p);h+=2){var L=void 0,g=c[h-1],y=c[h+1];g&&(c[h-1]=void 0);var x=!1;if(y){var E=y.oldPos-h;x=y&&0<=E&&E<d}var T=g&&g.oldPos+1<l;if(!x&&!T){c[h]=void 0;continue}if(!T||x&&g.oldPos+1<y.oldPos?L=s.addToPath(y,!0,void 0,0):L=s.addToPath(g,void 0,!0,1),v=s.extractCommon(L,n,e,h),L.oldPos+1>=l&&v+1>=d)return u(Y(s,L.lastComponent,n,e,s.useLongestToken));c[h]=L,L.oldPos+1>=l&&(w=Math.min(w,h-1)),v+1>=d&&(z=Math.max(z,h+1))}p++}if(t)(function h(){setTimeout(function(){if(p>f||Date.now()>m)return t();F()||h()},0)})();else for(;p<=f&&Date.now()<=m;){var D=F();if(D)return D}},addToPath:function(e,n,i,o){var t=e.lastComponent;return t&&t.added===n&&t.removed===i?{oldPos:e.oldPos+o,lastComponent:{count:t.count+1,added:n,removed:i,previousComponent:t.previousComponent}}:{oldPos:e.oldPos+o,lastComponent:{count:1,added:n,removed:i,previousComponent:t}}},extractCommon:function(e,n,i,o){for(var t=n.length,s=i.length,u=e.oldPos,d=u-o,l=0;d+1<t&&u+1<s&&this.equals(n[d+1],i[u+1]);)d++,u++,l++;return l&&(e.lastComponent={count:l,previousComponent:e.lastComponent}),e.oldPos=u,d},equals:function(e,n){return this.options.comparator?this.options.comparator(e,n):e===n||this.options.ignoreCase&&e.toLowerCase()===n.toLowerCase()},removeEmpty:function(e){for(var n=[],i=0;i<e.length;i++)e[i]&&n.push(e[i]);return n},castInput:function(e){return e},tokenize:function(e){return e.split("")},join:function(e){return e.join("")}};function Y(r,e,n,i,o){for(var t=[],s;e;)t.push(e),s=e.previousComponent,delete e.previousComponent,e=s;t.reverse();for(var u=0,d=t.length,l=0,p=0;u<d;u++){var f=t[u];if(f.removed){if(f.value=r.join(i.slice(p,p+f.count)),p+=f.count,u&&t[u-1].added){var m=t[u-1];t[u-1]=t[u],t[u]=m}}else{if(!f.added&&o){var a=n.slice(l,l+f.count);a=a.map(function(v,z){var w=i[p+z];return w.length>v.length?w:v}),f.value=r.join(a)}else f.value=r.join(n.slice(l,l+f.count));l+=f.count,f.added||(p+=f.count)}}var c=t[d-1];return d>1&&typeof c.value=="string"&&(c.added||c.removed)&&r.equals("",c.value)&&(t[d-2].value+=c.value,t.pop()),t}var b=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,V=/\S/,U=new C;U.equals=function(r,e){return this.options.ignoreCase&&(r=r.toLowerCase(),e=e.toLowerCase()),r===e||this.options.ignoreWhitespace&&!V.test(r)&&!V.test(e)};U.tokenize=function(r){for(var e=r.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),n=0;n<e.length-1;n++)!e[n+1]&&e[n+2]&&b.test(e[n])&&b.test(e[n+2])&&(e[n]+=e[n+2],e.splice(n+1,2),n--);return e};var Z=new C;Z.tokenize=function(r){this.options.stripTrailingCr&&(r=r.replace(/\r\n/g,`
|
|
2
|
+
`));var e=[],n=r.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(var i=0;i<n.length;i++){var o=n[i];i%2&&!this.options.newlineIsToken?e[e.length-1]+=o:(this.options.ignoreWhitespace&&(o=o.trim()),e.push(o))}return e};var K=new C;K.tokenize=function(r){return r.split(/(\S.+?[.!?])(?=\s+|$)/)};var S=new C;S.tokenize=function(r){return r.split(/([{}:;,]|\s+)/)};function A(r){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?A=function(e){return typeof e}:A=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},A(r)}var P=Object.prototype.toString,q=new C;q.useLongestToken=!0;q.tokenize=Z.tokenize;q.castInput=function(r){var e=this.options,n=e.undefinedReplacement,i=e.stringifyReplacer,o=i===void 0?function(t,s){return typeof s>"u"?n:s}:i;return typeof r=="string"?r:JSON.stringify(M(r,null,null,o),o," ")};q.equals=function(r,e){return C.prototype.equals.call(q,r.replace(/,([\r\n])/g,"$1"),e.replace(/,([\r\n])/g,"$1"))};function M(r,e,n,i,o){e=e||[],n=n||[],i&&(r=i(o,r));var t;for(t=0;t<e.length;t+=1)if(e[t]===r)return n[t];var s;if(P.call(r)==="[object Array]"){for(e.push(r),s=new Array(r.length),n.push(s),t=0;t<r.length;t+=1)s[t]=M(r[t],e,n,i,o);return e.pop(),n.pop(),s}if(r&&r.toJSON&&(r=r.toJSON()),A(r)==="object"&&r!==null){e.push(r),s={},n.push(s);var u=[],d;for(d in r)r.hasOwnProperty(d)&&u.push(d);for(u.sort(),t=0;t<u.length;t+=1)d=u[t],s[d]=M(r[d],e,n,i,d);e.pop(),n.pop()}else s=r;return s}var R=new C;R.tokenize=function(r){return r.slice()};R.join=R.removeEmpty=function(r){return r};function B(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=r.split(/\r\n|[\n\v\f\r\x85]/),i=r.match(/\r\n|[\n\v\f\r\x85]/g)||[],o=[],t=0;function s(){var l={};for(o.push(l);t<n.length;){var p=n[t];if(/^(\-\-\-|\+\+\+|@@)\s/.test(p))break;var f=/^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(p);f&&(l.index=f[1]),t++}for(u(l),u(l),l.hunks=[];t<n.length;){var a=n[t];if(/^(Index:|diff|\-\-\-|\+\+\+)\s/.test(a))break;if(/^@@/.test(a))l.hunks.push(d());else{if(a&&e.strict)throw new Error("Unknown line "+(t+1)+" "+JSON.stringify(a));t++}}}function u(l){var p=/^(---|\+\+\+)\s+(.*)$/.exec(n[t]);if(p){var f=p[1]==="---"?"old":"new",a=p[2].split(" ",2),m=a[0].replace(/\\\\/g,"\\");/^".*"$/.test(m)&&(m=m.substr(1,m.length-2)),l[f+"FileName"]=m,l[f+"Header"]=(a[1]||"").trim(),t++}}function d(){var l=t,p=n[t++],f=p.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/),a={oldStart:+f[1],oldLines:typeof f[2]>"u"?1:+f[2],newStart:+f[3],newLines:typeof f[4]>"u"?1:+f[4],lines:[],linedelimiters:[]};a.oldLines===0&&(a.oldStart+=1),a.newLines===0&&(a.newStart+=1);for(var m=0,c=0;t<n.length&&!(n[t].indexOf("--- ")===0&&t+2<n.length&&n[t+1].indexOf("+++ ")===0&&n[t+2].indexOf("@@")===0);t++){var v=n[t].length==0&&t!=n.length-1?" ":n[t][0];if(v==="+"||v==="-"||v===" "||v==="\\")a.lines.push(n[t]),a.linedelimiters.push(i[t]||`
|
|
3
|
+
`),v==="+"?m++:v==="-"?c++:v===" "&&(m++,c++);else break}if(!m&&a.newLines===1&&(a.newLines=0),!c&&a.oldLines===1&&(a.oldLines=0),e.strict){if(m!==a.newLines)throw new Error("Added line count did not match for hunk at line "+(l+1));if(c!==a.oldLines)throw new Error("Removed line count did not match for hunk at line "+(l+1))}return a}for(;t<n.length;)s();return o}function k(r,e,n){var i=!0,o=!1,t=!1,s=1;return function u(){if(i&&!t){if(o?s++:i=!1,r+s<=n)return s;t=!0}if(!o)return t||(i=!0),e<=r-s?-s++:(o=!0,u())}}function j(r,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(typeof e=="string"&&(e=B(e)),Array.isArray(e)){if(e.length>1)throw new Error("applyPatch only works with a single input.");e=e[0]}var i=r.split(/\r\n|[\n\v\f\r\x85]/),o=r.match(/\r\n|[\n\v\f\r\x85]/g)||[],t=e.hunks,s=n.compareLine||function(J,O,H,I){return O===I},u=0,d=n.fuzzFactor||0,l=0,p=0,f,a;function m(J,O){for(var H=0;H<J.lines.length;H++){var I=J.lines[H],N=I.length>0?I[0]:" ",X=I.length>0?I.substr(1):I;if(N===" "||N==="-"){if(!s(O+1,i[O],N,X)&&(u++,u>d))return!1;O++}}return!0}for(var c=0;c<t.length;c++){for(var v=t[c],z=i.length-v.oldLines,w=0,F=p+v.oldStart-1,D=k(F,l,z);w!==void 0;w=D())if(m(v,F+w)){v.offset=p+=w;break}if(w===void 0)return!1;l=v.offset+v.oldStart+v.oldLines}for(var h=0,L=0;L<t.length;L++){var g=t[L],y=g.oldStart+g.offset+h-1;h+=g.newLines-g.oldLines;for(var x=0;x<g.lines.length;x++){var E=g.lines[x],T=E.length>0?E[0]:" ",G=E.length>0?E.substr(1):E,Q=g.linedelimiters&&g.linedelimiters[x]||`
|
|
4
|
+
`;if(T===" ")y++;else if(T==="-")i.splice(y,1),o.splice(y,1);else if(T==="+")i.splice(y,0,G),o.splice(y,0,Q),y++;else if(T==="\\"){var W=g.lines[x-1]?g.lines[x-1][0]:null;W==="+"?f=!0:W==="-"&&(a=!0)}}}if(f)for(;!i[i.length-1];)i.pop(),o.pop();else a&&(i.push(""),o.push(`
|
|
5
|
+
`));for(var $=0;$<i.length-1;$++)i[$]=i[$]+o[$];return i.join("")}exports.Diff=C;exports.applyPatch=j;exports.canonicalize=M;exports.parsePatch=B;
|
|
6
|
+
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../../../../../../../../node_modules/.pnpm/diff@5.2.0/node_modules/diff/lib/index.mjs"],"sourcesContent":["function Diff() {}\nDiff.prototype = {\n diff: function diff(oldString, newString) {\n var _options$timeout;\n\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var callback = options.callback;\n\n if (typeof options === 'function') {\n callback = options;\n options = {};\n }\n\n this.options = options;\n var self = this;\n\n function done(value) {\n if (callback) {\n setTimeout(function () {\n callback(undefined, value);\n }, 0);\n return true;\n } else {\n return value;\n }\n } // Allow subclasses to massage the input prior to running\n\n\n oldString = this.castInput(oldString);\n newString = this.castInput(newString);\n oldString = this.removeEmpty(this.tokenize(oldString));\n newString = this.removeEmpty(this.tokenize(newString));\n var newLen = newString.length,\n oldLen = oldString.length;\n var editLength = 1;\n var maxEditLength = newLen + oldLen;\n\n if (options.maxEditLength) {\n maxEditLength = Math.min(maxEditLength, options.maxEditLength);\n }\n\n var maxExecutionTime = (_options$timeout = options.timeout) !== null && _options$timeout !== void 0 ? _options$timeout : Infinity;\n var abortAfterTimestamp = Date.now() + maxExecutionTime;\n var bestPath = [{\n oldPos: -1,\n lastComponent: undefined\n }]; // Seed editLength = 0, i.e. the content starts with the same values\n\n var newPos = this.extractCommon(bestPath[0], newString, oldString, 0);\n\n if (bestPath[0].oldPos + 1 >= oldLen && newPos + 1 >= newLen) {\n // Identity per the equality and tokenizer\n return done([{\n value: this.join(newString),\n count: newString.length\n }]);\n } // Once we hit the right edge of the edit graph on some diagonal k, we can\n // definitely reach the end of the edit graph in no more than k edits, so\n // there's no point in considering any moves to diagonal k+1 any more (from\n // which we're guaranteed to need at least k+1 more edits).\n // Similarly, once we've reached the bottom of the edit graph, there's no\n // point considering moves to lower diagonals.\n // We record this fact by setting minDiagonalToConsider and\n // maxDiagonalToConsider to some finite value once we've hit the edge of\n // the edit graph.\n // This optimization is not faithful to the original algorithm presented in\n // Myers's paper, which instead pointlessly extends D-paths off the end of\n // the edit graph - see page 7 of Myers's paper which notes this point\n // explicitly and illustrates it with a diagram. This has major performance\n // implications for some common scenarios. For instance, to compute a diff\n // where the new text simply appends d characters on the end of the\n // original text of length n, the true Myers algorithm will take O(n+d^2)\n // time while this optimization needs only O(n+d) time.\n\n\n var minDiagonalToConsider = -Infinity,\n maxDiagonalToConsider = Infinity; // Main worker method. checks all permutations of a given edit length for acceptance.\n\n function execEditLength() {\n for (var diagonalPath = Math.max(minDiagonalToConsider, -editLength); diagonalPath <= Math.min(maxDiagonalToConsider, editLength); diagonalPath += 2) {\n var basePath = void 0;\n var removePath = bestPath[diagonalPath - 1],\n addPath = bestPath[diagonalPath + 1];\n\n if (removePath) {\n // No one else is going to attempt to use this value, clear it\n bestPath[diagonalPath - 1] = undefined;\n }\n\n var canAdd = false;\n\n if (addPath) {\n // what newPos will be after we do an insertion:\n var addPathNewPos = addPath.oldPos - diagonalPath;\n canAdd = addPath && 0 <= addPathNewPos && addPathNewPos < newLen;\n }\n\n var canRemove = removePath && removePath.oldPos + 1 < oldLen;\n\n if (!canAdd && !canRemove) {\n // If this path is a terminal then prune\n bestPath[diagonalPath] = undefined;\n continue;\n } // Select the diagonal that we want to branch from. We select the prior\n // path whose position in the old string is the farthest from the origin\n // and does not pass the bounds of the diff graph\n // TODO: Remove the `+ 1` here to make behavior match Myers algorithm\n // and prefer to order removals before insertions.\n\n\n if (!canRemove || canAdd && removePath.oldPos + 1 < addPath.oldPos) {\n basePath = self.addToPath(addPath, true, undefined, 0);\n } else {\n basePath = self.addToPath(removePath, undefined, true, 1);\n }\n\n newPos = self.extractCommon(basePath, newString, oldString, diagonalPath);\n\n if (basePath.oldPos + 1 >= oldLen && newPos + 1 >= newLen) {\n // If we have hit the end of both strings, then we are done\n return done(buildValues(self, basePath.lastComponent, newString, oldString, self.useLongestToken));\n } else {\n bestPath[diagonalPath] = basePath;\n\n if (basePath.oldPos + 1 >= oldLen) {\n maxDiagonalToConsider = Math.min(maxDiagonalToConsider, diagonalPath - 1);\n }\n\n if (newPos + 1 >= newLen) {\n minDiagonalToConsider = Math.max(minDiagonalToConsider, diagonalPath + 1);\n }\n }\n }\n\n editLength++;\n } // Performs the length of edit iteration. Is a bit fugly as this has to support the\n // sync and async mode which is never fun. Loops over execEditLength until a value\n // is produced, or until the edit length exceeds options.maxEditLength (if given),\n // in which case it will return undefined.\n\n\n if (callback) {\n (function exec() {\n setTimeout(function () {\n if (editLength > maxEditLength || Date.now() > abortAfterTimestamp) {\n return callback();\n }\n\n if (!execEditLength()) {\n exec();\n }\n }, 0);\n })();\n } else {\n while (editLength <= maxEditLength && Date.now() <= abortAfterTimestamp) {\n var ret = execEditLength();\n\n if (ret) {\n return ret;\n }\n }\n }\n },\n addToPath: function addToPath(path, added, removed, oldPosInc) {\n var last = path.lastComponent;\n\n if (last && last.added === added && last.removed === removed) {\n return {\n oldPos: path.oldPos + oldPosInc,\n lastComponent: {\n count: last.count + 1,\n added: added,\n removed: removed,\n previousComponent: last.previousComponent\n }\n };\n } else {\n return {\n oldPos: path.oldPos + oldPosInc,\n lastComponent: {\n count: 1,\n added: added,\n removed: removed,\n previousComponent: last\n }\n };\n }\n },\n extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath) {\n var newLen = newString.length,\n oldLen = oldString.length,\n oldPos = basePath.oldPos,\n newPos = oldPos - diagonalPath,\n commonCount = 0;\n\n while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newString[newPos + 1], oldString[oldPos + 1])) {\n newPos++;\n oldPos++;\n commonCount++;\n }\n\n if (commonCount) {\n basePath.lastComponent = {\n count: commonCount,\n previousComponent: basePath.lastComponent\n };\n }\n\n basePath.oldPos = oldPos;\n return newPos;\n },\n equals: function equals(left, right) {\n if (this.options.comparator) {\n return this.options.comparator(left, right);\n } else {\n return left === right || this.options.ignoreCase && left.toLowerCase() === right.toLowerCase();\n }\n },\n removeEmpty: function removeEmpty(array) {\n var ret = [];\n\n for (var i = 0; i < array.length; i++) {\n if (array[i]) {\n ret.push(array[i]);\n }\n }\n\n return ret;\n },\n castInput: function castInput(value) {\n return value;\n },\n tokenize: function tokenize(value) {\n return value.split('');\n },\n join: function join(chars) {\n return chars.join('');\n }\n};\n\nfunction buildValues(diff, lastComponent, newString, oldString, useLongestToken) {\n // First we convert our linked list of components in reverse order to an\n // array in the right order:\n var components = [];\n var nextComponent;\n\n while (lastComponent) {\n components.push(lastComponent);\n nextComponent = lastComponent.previousComponent;\n delete lastComponent.previousComponent;\n lastComponent = nextComponent;\n }\n\n components.reverse();\n var componentPos = 0,\n componentLen = components.length,\n newPos = 0,\n oldPos = 0;\n\n for (; componentPos < componentLen; componentPos++) {\n var component = components[componentPos];\n\n if (!component.removed) {\n if (!component.added && useLongestToken) {\n var value = newString.slice(newPos, newPos + component.count);\n value = value.map(function (value, i) {\n var oldValue = oldString[oldPos + i];\n return oldValue.length > value.length ? oldValue : value;\n });\n component.value = diff.join(value);\n } else {\n component.value = diff.join(newString.slice(newPos, newPos + component.count));\n }\n\n newPos += component.count; // Common case\n\n if (!component.added) {\n oldPos += component.count;\n }\n } else {\n component.value = diff.join(oldString.slice(oldPos, oldPos + component.count));\n oldPos += component.count; // Reverse add and remove so removes are output first to match common convention\n // The diffing algorithm is tied to add then remove output and this is the simplest\n // route to get the desired output with minimal overhead.\n\n if (componentPos && components[componentPos - 1].added) {\n var tmp = components[componentPos - 1];\n components[componentPos - 1] = components[componentPos];\n components[componentPos] = tmp;\n }\n }\n } // Special case handle for when one terminal is ignored (i.e. whitespace).\n // For this case we merge the terminal into the prior string and drop the change.\n // This is only available for string mode.\n\n\n var finalComponent = components[componentLen - 1];\n\n if (componentLen > 1 && typeof finalComponent.value === 'string' && (finalComponent.added || finalComponent.removed) && diff.equals('', finalComponent.value)) {\n components[componentLen - 2].value += finalComponent.value;\n components.pop();\n }\n\n return components;\n}\n\nvar characterDiff = new Diff();\nfunction diffChars(oldStr, newStr, options) {\n return characterDiff.diff(oldStr, newStr, options);\n}\n\nfunction generateOptions(options, defaults) {\n if (typeof options === 'function') {\n defaults.callback = options;\n } else if (options) {\n for (var name in options) {\n /* istanbul ignore else */\n if (options.hasOwnProperty(name)) {\n defaults[name] = options[name];\n }\n }\n }\n\n return defaults;\n}\n\n//\n// Ranges and exceptions:\n// Latin-1 Supplement, 0080–00FF\n// - U+00D7 × Multiplication sign\n// - U+00F7 ÷ Division sign\n// Latin Extended-A, 0100–017F\n// Latin Extended-B, 0180–024F\n// IPA Extensions, 0250–02AF\n// Spacing Modifier Letters, 02B0–02FF\n// - U+02C7 ˇ ˇ Caron\n// - U+02D8 ˘ ˘ Breve\n// - U+02D9 ˙ ˙ Dot Above\n// - U+02DA ˚ ˚ Ring Above\n// - U+02DB ˛ ˛ Ogonek\n// - U+02DC ˜ ˜ Small Tilde\n// - U+02DD ˝ ˝ Double Acute Accent\n// Latin Extended Additional, 1E00–1EFF\n\nvar extendedWordChars = /^[A-Za-z\\xC0-\\u02C6\\u02C8-\\u02D7\\u02DE-\\u02FF\\u1E00-\\u1EFF]+$/;\nvar reWhitespace = /\\S/;\nvar wordDiff = new Diff();\n\nwordDiff.equals = function (left, right) {\n if (this.options.ignoreCase) {\n left = left.toLowerCase();\n right = right.toLowerCase();\n }\n\n return left === right || this.options.ignoreWhitespace && !reWhitespace.test(left) && !reWhitespace.test(right);\n};\n\nwordDiff.tokenize = function (value) {\n // All whitespace symbols except newline group into one token, each newline - in separate token\n var tokens = value.split(/([^\\S\\r\\n]+|[()[\\]{}'\"\\r\\n]|\\b)/); // Join the boundary splits that we do not consider to be boundaries. This is primarily the extended Latin character set.\n\n for (var i = 0; i < tokens.length - 1; i++) {\n // If we have an empty string in the next field and we have only word chars before and after, merge\n if (!tokens[i + 1] && tokens[i + 2] && extendedWordChars.test(tokens[i]) && extendedWordChars.test(tokens[i + 2])) {\n tokens[i] += tokens[i + 2];\n tokens.splice(i + 1, 2);\n i--;\n }\n }\n\n return tokens;\n};\n\nfunction diffWords(oldStr, newStr, options) {\n options = generateOptions(options, {\n ignoreWhitespace: true\n });\n return wordDiff.diff(oldStr, newStr, options);\n}\nfunction diffWordsWithSpace(oldStr, newStr, options) {\n return wordDiff.diff(oldStr, newStr, options);\n}\n\nvar lineDiff = new Diff();\n\nlineDiff.tokenize = function (value) {\n if (this.options.stripTrailingCr) {\n // remove one \\r before \\n to match GNU diff's --strip-trailing-cr behavior\n value = value.replace(/\\r\\n/g, '\\n');\n }\n\n var retLines = [],\n linesAndNewlines = value.split(/(\\n|\\r\\n)/); // Ignore the final empty token that occurs if the string ends with a new line\n\n if (!linesAndNewlines[linesAndNewlines.length - 1]) {\n linesAndNewlines.pop();\n } // Merge the content and line separators into single tokens\n\n\n for (var i = 0; i < linesAndNewlines.length; i++) {\n var line = linesAndNewlines[i];\n\n if (i % 2 && !this.options.newlineIsToken) {\n retLines[retLines.length - 1] += line;\n } else {\n if (this.options.ignoreWhitespace) {\n line = line.trim();\n }\n\n retLines.push(line);\n }\n }\n\n return retLines;\n};\n\nfunction diffLines(oldStr, newStr, callback) {\n return lineDiff.diff(oldStr, newStr, callback);\n}\nfunction diffTrimmedLines(oldStr, newStr, callback) {\n var options = generateOptions(callback, {\n ignoreWhitespace: true\n });\n return lineDiff.diff(oldStr, newStr, options);\n}\n\nvar sentenceDiff = new Diff();\n\nsentenceDiff.tokenize = function (value) {\n return value.split(/(\\S.+?[.!?])(?=\\s+|$)/);\n};\n\nfunction diffSentences(oldStr, newStr, callback) {\n return sentenceDiff.diff(oldStr, newStr, callback);\n}\n\nvar cssDiff = new Diff();\n\ncssDiff.tokenize = function (value) {\n return value.split(/([{}:;,]|\\s+)/);\n};\n\nfunction diffCss(oldStr, newStr, callback) {\n return cssDiff.diff(oldStr, newStr, callback);\n}\n\nfunction _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nfunction _toConsumableArray(arr) {\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();\n}\n\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return _arrayLikeToArray(arr);\n}\n\nfunction _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter);\n}\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\n\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n return arr2;\n}\n\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nvar objectPrototypeToString = Object.prototype.toString;\nvar jsonDiff = new Diff(); // Discriminate between two lines of pretty-printed, serialized JSON where one of them has a\n// dangling comma and the other doesn't. Turns out including the dangling comma yields the nicest output:\n\njsonDiff.useLongestToken = true;\njsonDiff.tokenize = lineDiff.tokenize;\n\njsonDiff.castInput = function (value) {\n var _this$options = this.options,\n undefinedReplacement = _this$options.undefinedReplacement,\n _this$options$stringi = _this$options.stringifyReplacer,\n stringifyReplacer = _this$options$stringi === void 0 ? function (k, v) {\n return typeof v === 'undefined' ? undefinedReplacement : v;\n } : _this$options$stringi;\n return typeof value === 'string' ? value : JSON.stringify(canonicalize(value, null, null, stringifyReplacer), stringifyReplacer, ' ');\n};\n\njsonDiff.equals = function (left, right) {\n return Diff.prototype.equals.call(jsonDiff, left.replace(/,([\\r\\n])/g, '$1'), right.replace(/,([\\r\\n])/g, '$1'));\n};\n\nfunction diffJson(oldObj, newObj, options) {\n return jsonDiff.diff(oldObj, newObj, options);\n} // This function handles the presence of circular references by bailing out when encountering an\n// object that is already on the \"stack\" of items being processed. Accepts an optional replacer\n\nfunction canonicalize(obj, stack, replacementStack, replacer, key) {\n stack = stack || [];\n replacementStack = replacementStack || [];\n\n if (replacer) {\n obj = replacer(key, obj);\n }\n\n var i;\n\n for (i = 0; i < stack.length; i += 1) {\n if (stack[i] === obj) {\n return replacementStack[i];\n }\n }\n\n var canonicalizedObj;\n\n if ('[object Array]' === objectPrototypeToString.call(obj)) {\n stack.push(obj);\n canonicalizedObj = new Array(obj.length);\n replacementStack.push(canonicalizedObj);\n\n for (i = 0; i < obj.length; i += 1) {\n canonicalizedObj[i] = canonicalize(obj[i], stack, replacementStack, replacer, key);\n }\n\n stack.pop();\n replacementStack.pop();\n return canonicalizedObj;\n }\n\n if (obj && obj.toJSON) {\n obj = obj.toJSON();\n }\n\n if (_typeof(obj) === 'object' && obj !== null) {\n stack.push(obj);\n canonicalizedObj = {};\n replacementStack.push(canonicalizedObj);\n\n var sortedKeys = [],\n _key;\n\n for (_key in obj) {\n /* istanbul ignore else */\n if (obj.hasOwnProperty(_key)) {\n sortedKeys.push(_key);\n }\n }\n\n sortedKeys.sort();\n\n for (i = 0; i < sortedKeys.length; i += 1) {\n _key = sortedKeys[i];\n canonicalizedObj[_key] = canonicalize(obj[_key], stack, replacementStack, replacer, _key);\n }\n\n stack.pop();\n replacementStack.pop();\n } else {\n canonicalizedObj = obj;\n }\n\n return canonicalizedObj;\n}\n\nvar arrayDiff = new Diff();\n\narrayDiff.tokenize = function (value) {\n return value.slice();\n};\n\narrayDiff.join = arrayDiff.removeEmpty = function (value) {\n return value;\n};\n\nfunction diffArrays(oldArr, newArr, callback) {\n return arrayDiff.diff(oldArr, newArr, callback);\n}\n\nfunction parsePatch(uniDiff) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var diffstr = uniDiff.split(/\\r\\n|[\\n\\v\\f\\r\\x85]/),\n delimiters = uniDiff.match(/\\r\\n|[\\n\\v\\f\\r\\x85]/g) || [],\n list = [],\n i = 0;\n\n function parseIndex() {\n var index = {};\n list.push(index); // Parse diff metadata\n\n while (i < diffstr.length) {\n var line = diffstr[i]; // File header found, end parsing diff metadata\n\n if (/^(\\-\\-\\-|\\+\\+\\+|@@)\\s/.test(line)) {\n break;\n } // Diff index\n\n\n var header = /^(?:Index:|diff(?: -r \\w+)+)\\s+(.+?)\\s*$/.exec(line);\n\n if (header) {\n index.index = header[1];\n }\n\n i++;\n } // Parse file headers if they are defined. Unified diff requires them, but\n // there's no technical issues to have an isolated hunk without file header\n\n\n parseFileHeader(index);\n parseFileHeader(index); // Parse hunks\n\n index.hunks = [];\n\n while (i < diffstr.length) {\n var _line = diffstr[i];\n\n if (/^(Index:|diff|\\-\\-\\-|\\+\\+\\+)\\s/.test(_line)) {\n break;\n } else if (/^@@/.test(_line)) {\n index.hunks.push(parseHunk());\n } else if (_line && options.strict) {\n // Ignore unexpected content unless in strict mode\n throw new Error('Unknown line ' + (i + 1) + ' ' + JSON.stringify(_line));\n } else {\n i++;\n }\n }\n } // Parses the --- and +++ headers, if none are found, no lines\n // are consumed.\n\n\n function parseFileHeader(index) {\n var fileHeader = /^(---|\\+\\+\\+)\\s+(.*)$/.exec(diffstr[i]);\n\n if (fileHeader) {\n var keyPrefix = fileHeader[1] === '---' ? 'old' : 'new';\n var data = fileHeader[2].split('\\t', 2);\n var fileName = data[0].replace(/\\\\\\\\/g, '\\\\');\n\n if (/^\".*\"$/.test(fileName)) {\n fileName = fileName.substr(1, fileName.length - 2);\n }\n\n index[keyPrefix + 'FileName'] = fileName;\n index[keyPrefix + 'Header'] = (data[1] || '').trim();\n i++;\n }\n } // Parses a hunk\n // This assumes that we are at the start of a hunk.\n\n\n function parseHunk() {\n var chunkHeaderIndex = i,\n chunkHeaderLine = diffstr[i++],\n chunkHeader = chunkHeaderLine.split(/@@ -(\\d+)(?:,(\\d+))? \\+(\\d+)(?:,(\\d+))? @@/);\n var hunk = {\n oldStart: +chunkHeader[1],\n oldLines: typeof chunkHeader[2] === 'undefined' ? 1 : +chunkHeader[2],\n newStart: +chunkHeader[3],\n newLines: typeof chunkHeader[4] === 'undefined' ? 1 : +chunkHeader[4],\n lines: [],\n linedelimiters: []\n }; // Unified Diff Format quirk: If the chunk size is 0,\n // the first number is one lower than one would expect.\n // https://www.artima.com/weblogs/viewpost.jsp?thread=164293\n\n if (hunk.oldLines === 0) {\n hunk.oldStart += 1;\n }\n\n if (hunk.newLines === 0) {\n hunk.newStart += 1;\n }\n\n var addCount = 0,\n removeCount = 0;\n\n for (; i < diffstr.length; i++) {\n // Lines starting with '---' could be mistaken for the \"remove line\" operation\n // But they could be the header for the next file. Therefore prune such cases out.\n if (diffstr[i].indexOf('--- ') === 0 && i + 2 < diffstr.length && diffstr[i + 1].indexOf('+++ ') === 0 && diffstr[i + 2].indexOf('@@') === 0) {\n break;\n }\n\n var operation = diffstr[i].length == 0 && i != diffstr.length - 1 ? ' ' : diffstr[i][0];\n\n if (operation === '+' || operation === '-' || operation === ' ' || operation === '\\\\') {\n hunk.lines.push(diffstr[i]);\n hunk.linedelimiters.push(delimiters[i] || '\\n');\n\n if (operation === '+') {\n addCount++;\n } else if (operation === '-') {\n removeCount++;\n } else if (operation === ' ') {\n addCount++;\n removeCount++;\n }\n } else {\n break;\n }\n } // Handle the empty block count case\n\n\n if (!addCount && hunk.newLines === 1) {\n hunk.newLines = 0;\n }\n\n if (!removeCount && hunk.oldLines === 1) {\n hunk.oldLines = 0;\n } // Perform optional sanity checking\n\n\n if (options.strict) {\n if (addCount !== hunk.newLines) {\n throw new Error('Added line count did not match for hunk at line ' + (chunkHeaderIndex + 1));\n }\n\n if (removeCount !== hunk.oldLines) {\n throw new Error('Removed line count did not match for hunk at line ' + (chunkHeaderIndex + 1));\n }\n }\n\n return hunk;\n }\n\n while (i < diffstr.length) {\n parseIndex();\n }\n\n return list;\n}\n\n// Iterator that traverses in the range of [min, max], stepping\n// by distance from a given start position. I.e. for [0, 4], with\n// start of 2, this will iterate 2, 3, 1, 4, 0.\nfunction distanceIterator (start, minLine, maxLine) {\n var wantForward = true,\n backwardExhausted = false,\n forwardExhausted = false,\n localOffset = 1;\n return function iterator() {\n if (wantForward && !forwardExhausted) {\n if (backwardExhausted) {\n localOffset++;\n } else {\n wantForward = false;\n } // Check if trying to fit beyond text length, and if not, check it fits\n // after offset location (or desired location on first iteration)\n\n\n if (start + localOffset <= maxLine) {\n return localOffset;\n }\n\n forwardExhausted = true;\n }\n\n if (!backwardExhausted) {\n if (!forwardExhausted) {\n wantForward = true;\n } // Check if trying to fit before text beginning, and if not, check it fits\n // before offset location\n\n\n if (minLine <= start - localOffset) {\n return -localOffset++;\n }\n\n backwardExhausted = true;\n return iterator();\n } // We tried to fit hunk before text beginning and beyond text length, then\n // hunk can't fit on the text. Return undefined\n\n };\n}\n\nfunction applyPatch(source, uniDiff) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n if (typeof uniDiff === 'string') {\n uniDiff = parsePatch(uniDiff);\n }\n\n if (Array.isArray(uniDiff)) {\n if (uniDiff.length > 1) {\n throw new Error('applyPatch only works with a single input.');\n }\n\n uniDiff = uniDiff[0];\n } // Apply the diff to the input\n\n\n var lines = source.split(/\\r\\n|[\\n\\v\\f\\r\\x85]/),\n delimiters = source.match(/\\r\\n|[\\n\\v\\f\\r\\x85]/g) || [],\n hunks = uniDiff.hunks,\n compareLine = options.compareLine || function (lineNumber, line, operation, patchContent) {\n return line === patchContent;\n },\n errorCount = 0,\n fuzzFactor = options.fuzzFactor || 0,\n minLine = 0,\n offset = 0,\n removeEOFNL,\n addEOFNL;\n /**\n * Checks if the hunk exactly fits on the provided location\n */\n\n\n function hunkFits(hunk, toPos) {\n for (var j = 0; j < hunk.lines.length; j++) {\n var line = hunk.lines[j],\n operation = line.length > 0 ? line[0] : ' ',\n content = line.length > 0 ? line.substr(1) : line;\n\n if (operation === ' ' || operation === '-') {\n // Context sanity check\n if (!compareLine(toPos + 1, lines[toPos], operation, content)) {\n errorCount++;\n\n if (errorCount > fuzzFactor) {\n return false;\n }\n }\n\n toPos++;\n }\n }\n\n return true;\n } // Search best fit offsets for each hunk based on the previous ones\n\n\n for (var i = 0; i < hunks.length; i++) {\n var hunk = hunks[i],\n maxLine = lines.length - hunk.oldLines,\n localOffset = 0,\n toPos = offset + hunk.oldStart - 1;\n var iterator = distanceIterator(toPos, minLine, maxLine);\n\n for (; localOffset !== undefined; localOffset = iterator()) {\n if (hunkFits(hunk, toPos + localOffset)) {\n hunk.offset = offset += localOffset;\n break;\n }\n }\n\n if (localOffset === undefined) {\n return false;\n } // Set lower text limit to end of the current hunk, so next ones don't try\n // to fit over already patched text\n\n\n minLine = hunk.offset + hunk.oldStart + hunk.oldLines;\n } // Apply patch hunks\n\n\n var diffOffset = 0;\n\n for (var _i = 0; _i < hunks.length; _i++) {\n var _hunk = hunks[_i],\n _toPos = _hunk.oldStart + _hunk.offset + diffOffset - 1;\n\n diffOffset += _hunk.newLines - _hunk.oldLines;\n\n for (var j = 0; j < _hunk.lines.length; j++) {\n var line = _hunk.lines[j],\n operation = line.length > 0 ? line[0] : ' ',\n content = line.length > 0 ? line.substr(1) : line,\n delimiter = _hunk.linedelimiters && _hunk.linedelimiters[j] || '\\n';\n\n if (operation === ' ') {\n _toPos++;\n } else if (operation === '-') {\n lines.splice(_toPos, 1);\n delimiters.splice(_toPos, 1);\n /* istanbul ignore else */\n } else if (operation === '+') {\n lines.splice(_toPos, 0, content);\n delimiters.splice(_toPos, 0, delimiter);\n _toPos++;\n } else if (operation === '\\\\') {\n var previousOperation = _hunk.lines[j - 1] ? _hunk.lines[j - 1][0] : null;\n\n if (previousOperation === '+') {\n removeEOFNL = true;\n } else if (previousOperation === '-') {\n addEOFNL = true;\n }\n }\n }\n } // Handle EOFNL insertion/removal\n\n\n if (removeEOFNL) {\n while (!lines[lines.length - 1]) {\n lines.pop();\n delimiters.pop();\n }\n } else if (addEOFNL) {\n lines.push('');\n delimiters.push('\\n');\n }\n\n for (var _k = 0; _k < lines.length - 1; _k++) {\n lines[_k] = lines[_k] + delimiters[_k];\n }\n\n return lines.join('');\n} // Wrapper that supports multiple file patches via callbacks.\n\nfunction applyPatches(uniDiff, options) {\n if (typeof uniDiff === 'string') {\n uniDiff = parsePatch(uniDiff);\n }\n\n var currentIndex = 0;\n\n function processIndex() {\n var index = uniDiff[currentIndex++];\n\n if (!index) {\n return options.complete();\n }\n\n options.loadFile(index, function (err, data) {\n if (err) {\n return options.complete(err);\n }\n\n var updatedContent = applyPatch(data, index, options);\n options.patched(index, updatedContent, function (err) {\n if (err) {\n return options.complete(err);\n }\n\n processIndex();\n });\n });\n }\n\n processIndex();\n}\n\nfunction structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) {\n if (!options) {\n options = {};\n }\n\n if (typeof options.context === 'undefined') {\n options.context = 4;\n }\n\n var diff = diffLines(oldStr, newStr, options);\n\n if (!diff) {\n return;\n }\n\n diff.push({\n value: '',\n lines: []\n }); // Append an empty value to make cleanup easier\n\n function contextLines(lines) {\n return lines.map(function (entry) {\n return ' ' + entry;\n });\n }\n\n var hunks = [];\n var oldRangeStart = 0,\n newRangeStart = 0,\n curRange = [],\n oldLine = 1,\n newLine = 1;\n\n var _loop = function _loop(i) {\n var current = diff[i],\n lines = current.lines || current.value.replace(/\\n$/, '').split('\\n');\n current.lines = lines;\n\n if (current.added || current.removed) {\n var _curRange;\n\n // If we have previous context, start with that\n if (!oldRangeStart) {\n var prev = diff[i - 1];\n oldRangeStart = oldLine;\n newRangeStart = newLine;\n\n if (prev) {\n curRange = options.context > 0 ? contextLines(prev.lines.slice(-options.context)) : [];\n oldRangeStart -= curRange.length;\n newRangeStart -= curRange.length;\n }\n } // Output our changes\n\n\n (_curRange = curRange).push.apply(_curRange, _toConsumableArray(lines.map(function (entry) {\n return (current.added ? '+' : '-') + entry;\n }))); // Track the updated file position\n\n\n if (current.added) {\n newLine += lines.length;\n } else {\n oldLine += lines.length;\n }\n } else {\n // Identical context lines. Track line changes\n if (oldRangeStart) {\n // Close out any changes that have been output (or join overlapping)\n if (lines.length <= options.context * 2 && i < diff.length - 2) {\n var _curRange2;\n\n // Overlapping\n (_curRange2 = curRange).push.apply(_curRange2, _toConsumableArray(contextLines(lines)));\n } else {\n var _curRange3;\n\n // end the range and output\n var contextSize = Math.min(lines.length, options.context);\n\n (_curRange3 = curRange).push.apply(_curRange3, _toConsumableArray(contextLines(lines.slice(0, contextSize))));\n\n var hunk = {\n oldStart: oldRangeStart,\n oldLines: oldLine - oldRangeStart + contextSize,\n newStart: newRangeStart,\n newLines: newLine - newRangeStart + contextSize,\n lines: curRange\n };\n\n if (i >= diff.length - 2 && lines.length <= options.context) {\n // EOF is inside this hunk\n var oldEOFNewline = /\\n$/.test(oldStr);\n var newEOFNewline = /\\n$/.test(newStr);\n var noNlBeforeAdds = lines.length == 0 && curRange.length > hunk.oldLines;\n\n if (!oldEOFNewline && noNlBeforeAdds && oldStr.length > 0) {\n // special case: old has no eol and no trailing context; no-nl can end up before adds\n // however, if the old file is empty, do not output the no-nl line\n curRange.splice(hunk.oldLines, 0, '\\\');\n }\n\n if (!oldEOFNewline && !noNlBeforeAdds || !newEOFNewline) {\n curRange.push('\\\');\n }\n }\n\n hunks.push(hunk);\n oldRangeStart = 0;\n newRangeStart = 0;\n curRange = [];\n }\n }\n\n oldLine += lines.length;\n newLine += lines.length;\n }\n };\n\n for (var i = 0; i < diff.length; i++) {\n _loop(i);\n }\n\n return {\n oldFileName: oldFileName,\n newFileName: newFileName,\n oldHeader: oldHeader,\n newHeader: newHeader,\n hunks: hunks\n };\n}\nfunction formatPatch(diff) {\n if (Array.isArray(diff)) {\n return diff.map(formatPatch).join('\\n');\n }\n\n var ret = [];\n\n if (diff.oldFileName == diff.newFileName) {\n ret.push('Index: ' + diff.oldFileName);\n }\n\n ret.push('===================================================================');\n ret.push('--- ' + diff.oldFileName + (typeof diff.oldHeader === 'undefined' ? '' : '\\t' + diff.oldHeader));\n ret.push('+++ ' + diff.newFileName + (typeof diff.newHeader === 'undefined' ? '' : '\\t' + diff.newHeader));\n\n for (var i = 0; i < diff.hunks.length; i++) {\n var hunk = diff.hunks[i]; // Unified Diff Format quirk: If the chunk size is 0,\n // the first number is one lower than one would expect.\n // https://www.artima.com/weblogs/viewpost.jsp?thread=164293\n\n if (hunk.oldLines === 0) {\n hunk.oldStart -= 1;\n }\n\n if (hunk.newLines === 0) {\n hunk.newStart -= 1;\n }\n\n ret.push('@@ -' + hunk.oldStart + ',' + hunk.oldLines + ' +' + hunk.newStart + ',' + hunk.newLines + ' @@');\n ret.push.apply(ret, hunk.lines);\n }\n\n return ret.join('\\n') + '\\n';\n}\nfunction createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) {\n return formatPatch(structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options));\n}\nfunction createPatch(fileName, oldStr, newStr, oldHeader, newHeader, options) {\n return createTwoFilesPatch(fileName, fileName, oldStr, newStr, oldHeader, newHeader, options);\n}\n\nfunction arrayEqual(a, b) {\n if (a.length !== b.length) {\n return false;\n }\n\n return arrayStartsWith(a, b);\n}\nfunction arrayStartsWith(array, start) {\n if (start.length > array.length) {\n return false;\n }\n\n for (var i = 0; i < start.length; i++) {\n if (start[i] !== array[i]) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction calcLineCount(hunk) {\n var _calcOldNewLineCount = calcOldNewLineCount(hunk.lines),\n oldLines = _calcOldNewLineCount.oldLines,\n newLines = _calcOldNewLineCount.newLines;\n\n if (oldLines !== undefined) {\n hunk.oldLines = oldLines;\n } else {\n delete hunk.oldLines;\n }\n\n if (newLines !== undefined) {\n hunk.newLines = newLines;\n } else {\n delete hunk.newLines;\n }\n}\nfunction merge(mine, theirs, base) {\n mine = loadPatch(mine, base);\n theirs = loadPatch(theirs, base);\n var ret = {}; // For index we just let it pass through as it doesn't have any necessary meaning.\n // Leaving sanity checks on this to the API consumer that may know more about the\n // meaning in their own context.\n\n if (mine.index || theirs.index) {\n ret.index = mine.index || theirs.index;\n }\n\n if (mine.newFileName || theirs.newFileName) {\n if (!fileNameChanged(mine)) {\n // No header or no change in ours, use theirs (and ours if theirs does not exist)\n ret.oldFileName = theirs.oldFileName || mine.oldFileName;\n ret.newFileName = theirs.newFileName || mine.newFileName;\n ret.oldHeader = theirs.oldHeader || mine.oldHeader;\n ret.newHeader = theirs.newHeader || mine.newHeader;\n } else if (!fileNameChanged(theirs)) {\n // No header or no change in theirs, use ours\n ret.oldFileName = mine.oldFileName;\n ret.newFileName = mine.newFileName;\n ret.oldHeader = mine.oldHeader;\n ret.newHeader = mine.newHeader;\n } else {\n // Both changed... figure it out\n ret.oldFileName = selectField(ret, mine.oldFileName, theirs.oldFileName);\n ret.newFileName = selectField(ret, mine.newFileName, theirs.newFileName);\n ret.oldHeader = selectField(ret, mine.oldHeader, theirs.oldHeader);\n ret.newHeader = selectField(ret, mine.newHeader, theirs.newHeader);\n }\n }\n\n ret.hunks = [];\n var mineIndex = 0,\n theirsIndex = 0,\n mineOffset = 0,\n theirsOffset = 0;\n\n while (mineIndex < mine.hunks.length || theirsIndex < theirs.hunks.length) {\n var mineCurrent = mine.hunks[mineIndex] || {\n oldStart: Infinity\n },\n theirsCurrent = theirs.hunks[theirsIndex] || {\n oldStart: Infinity\n };\n\n if (hunkBefore(mineCurrent, theirsCurrent)) {\n // This patch does not overlap with any of the others, yay.\n ret.hunks.push(cloneHunk(mineCurrent, mineOffset));\n mineIndex++;\n theirsOffset += mineCurrent.newLines - mineCurrent.oldLines;\n } else if (hunkBefore(theirsCurrent, mineCurrent)) {\n // This patch does not overlap with any of the others, yay.\n ret.hunks.push(cloneHunk(theirsCurrent, theirsOffset));\n theirsIndex++;\n mineOffset += theirsCurrent.newLines - theirsCurrent.oldLines;\n } else {\n // Overlap, merge as best we can\n var mergedHunk = {\n oldStart: Math.min(mineCurrent.oldStart, theirsCurrent.oldStart),\n oldLines: 0,\n newStart: Math.min(mineCurrent.newStart + mineOffset, theirsCurrent.oldStart + theirsOffset),\n newLines: 0,\n lines: []\n };\n mergeLines(mergedHunk, mineCurrent.oldStart, mineCurrent.lines, theirsCurrent.oldStart, theirsCurrent.lines);\n theirsIndex++;\n mineIndex++;\n ret.hunks.push(mergedHunk);\n }\n }\n\n return ret;\n}\n\nfunction loadPatch(param, base) {\n if (typeof param === 'string') {\n if (/^@@/m.test(param) || /^Index:/m.test(param)) {\n return parsePatch(param)[0];\n }\n\n if (!base) {\n throw new Error('Must provide a base reference or pass in a patch');\n }\n\n return structuredPatch(undefined, undefined, base, param);\n }\n\n return param;\n}\n\nfunction fileNameChanged(patch) {\n return patch.newFileName && patch.newFileName !== patch.oldFileName;\n}\n\nfunction selectField(index, mine, theirs) {\n if (mine === theirs) {\n return mine;\n } else {\n index.conflict = true;\n return {\n mine: mine,\n theirs: theirs\n };\n }\n}\n\nfunction hunkBefore(test, check) {\n return test.oldStart < check.oldStart && test.oldStart + test.oldLines < check.oldStart;\n}\n\nfunction cloneHunk(hunk, offset) {\n return {\n oldStart: hunk.oldStart,\n oldLines: hunk.oldLines,\n newStart: hunk.newStart + offset,\n newLines: hunk.newLines,\n lines: hunk.lines\n };\n}\n\nfunction mergeLines(hunk, mineOffset, mineLines, theirOffset, theirLines) {\n // This will generally result in a conflicted hunk, but there are cases where the context\n // is the only overlap where we can successfully merge the content here.\n var mine = {\n offset: mineOffset,\n lines: mineLines,\n index: 0\n },\n their = {\n offset: theirOffset,\n lines: theirLines,\n index: 0\n }; // Handle any leading content\n\n insertLeading(hunk, mine, their);\n insertLeading(hunk, their, mine); // Now in the overlap content. Scan through and select the best changes from each.\n\n while (mine.index < mine.lines.length && their.index < their.lines.length) {\n var mineCurrent = mine.lines[mine.index],\n theirCurrent = their.lines[their.index];\n\n if ((mineCurrent[0] === '-' || mineCurrent[0] === '+') && (theirCurrent[0] === '-' || theirCurrent[0] === '+')) {\n // Both modified ...\n mutualChange(hunk, mine, their);\n } else if (mineCurrent[0] === '+' && theirCurrent[0] === ' ') {\n var _hunk$lines;\n\n // Mine inserted\n (_hunk$lines = hunk.lines).push.apply(_hunk$lines, _toConsumableArray(collectChange(mine)));\n } else if (theirCurrent[0] === '+' && mineCurrent[0] === ' ') {\n var _hunk$lines2;\n\n // Theirs inserted\n (_hunk$lines2 = hunk.lines).push.apply(_hunk$lines2, _toConsumableArray(collectChange(their)));\n } else if (mineCurrent[0] === '-' && theirCurrent[0] === ' ') {\n // Mine removed or edited\n removal(hunk, mine, their);\n } else if (theirCurrent[0] === '-' && mineCurrent[0] === ' ') {\n // Their removed or edited\n removal(hunk, their, mine, true);\n } else if (mineCurrent === theirCurrent) {\n // Context identity\n hunk.lines.push(mineCurrent);\n mine.index++;\n their.index++;\n } else {\n // Context mismatch\n conflict(hunk, collectChange(mine), collectChange(their));\n }\n } // Now push anything that may be remaining\n\n\n insertTrailing(hunk, mine);\n insertTrailing(hunk, their);\n calcLineCount(hunk);\n}\n\nfunction mutualChange(hunk, mine, their) {\n var myChanges = collectChange(mine),\n theirChanges = collectChange(their);\n\n if (allRemoves(myChanges) && allRemoves(theirChanges)) {\n // Special case for remove changes that are supersets of one another\n if (arrayStartsWith(myChanges, theirChanges) && skipRemoveSuperset(their, myChanges, myChanges.length - theirChanges.length)) {\n var _hunk$lines3;\n\n (_hunk$lines3 = hunk.lines).push.apply(_hunk$lines3, _toConsumableArray(myChanges));\n\n return;\n } else if (arrayStartsWith(theirChanges, myChanges) && skipRemoveSuperset(mine, theirChanges, theirChanges.length - myChanges.length)) {\n var _hunk$lines4;\n\n (_hunk$lines4 = hunk.lines).push.apply(_hunk$lines4, _toConsumableArray(theirChanges));\n\n return;\n }\n } else if (arrayEqual(myChanges, theirChanges)) {\n var _hunk$lines5;\n\n (_hunk$lines5 = hunk.lines).push.apply(_hunk$lines5, _toConsumableArray(myChanges));\n\n return;\n }\n\n conflict(hunk, myChanges, theirChanges);\n}\n\nfunction removal(hunk, mine, their, swap) {\n var myChanges = collectChange(mine),\n theirChanges = collectContext(their, myChanges);\n\n if (theirChanges.merged) {\n var _hunk$lines6;\n\n (_hunk$lines6 = hunk.lines).push.apply(_hunk$lines6, _toConsumableArray(theirChanges.merged));\n } else {\n conflict(hunk, swap ? theirChanges : myChanges, swap ? myChanges : theirChanges);\n }\n}\n\nfunction conflict(hunk, mine, their) {\n hunk.conflict = true;\n hunk.lines.push({\n conflict: true,\n mine: mine,\n theirs: their\n });\n}\n\nfunction insertLeading(hunk, insert, their) {\n while (insert.offset < their.offset && insert.index < insert.lines.length) {\n var line = insert.lines[insert.index++];\n hunk.lines.push(line);\n insert.offset++;\n }\n}\n\nfunction insertTrailing(hunk, insert) {\n while (insert.index < insert.lines.length) {\n var line = insert.lines[insert.index++];\n hunk.lines.push(line);\n }\n}\n\nfunction collectChange(state) {\n var ret = [],\n operation = state.lines[state.index][0];\n\n while (state.index < state.lines.length) {\n var line = state.lines[state.index]; // Group additions that are immediately after subtractions and treat them as one \"atomic\" modify change.\n\n if (operation === '-' && line[0] === '+') {\n operation = '+';\n }\n\n if (operation === line[0]) {\n ret.push(line);\n state.index++;\n } else {\n break;\n }\n }\n\n return ret;\n}\n\nfunction collectContext(state, matchChanges) {\n var changes = [],\n merged = [],\n matchIndex = 0,\n contextChanges = false,\n conflicted = false;\n\n while (matchIndex < matchChanges.length && state.index < state.lines.length) {\n var change = state.lines[state.index],\n match = matchChanges[matchIndex]; // Once we've hit our add, then we are done\n\n if (match[0] === '+') {\n break;\n }\n\n contextChanges = contextChanges || change[0] !== ' ';\n merged.push(match);\n matchIndex++; // Consume any additions in the other block as a conflict to attempt\n // to pull in the remaining context after this\n\n if (change[0] === '+') {\n conflicted = true;\n\n while (change[0] === '+') {\n changes.push(change);\n change = state.lines[++state.index];\n }\n }\n\n if (match.substr(1) === change.substr(1)) {\n changes.push(change);\n state.index++;\n } else {\n conflicted = true;\n }\n }\n\n if ((matchChanges[matchIndex] || '')[0] === '+' && contextChanges) {\n conflicted = true;\n }\n\n if (conflicted) {\n return changes;\n }\n\n while (matchIndex < matchChanges.length) {\n merged.push(matchChanges[matchIndex++]);\n }\n\n return {\n merged: merged,\n changes: changes\n };\n}\n\nfunction allRemoves(changes) {\n return changes.reduce(function (prev, change) {\n return prev && change[0] === '-';\n }, true);\n}\n\nfunction skipRemoveSuperset(state, removeChanges, delta) {\n for (var i = 0; i < delta; i++) {\n var changeContent = removeChanges[removeChanges.length - delta + i].substr(1);\n\n if (state.lines[state.index + i] !== ' ' + changeContent) {\n return false;\n }\n }\n\n state.index += delta;\n return true;\n}\n\nfunction calcOldNewLineCount(lines) {\n var oldLines = 0;\n var newLines = 0;\n lines.forEach(function (line) {\n if (typeof line !== 'string') {\n var myCount = calcOldNewLineCount(line.mine);\n var theirCount = calcOldNewLineCount(line.theirs);\n\n if (oldLines !== undefined) {\n if (myCount.oldLines === theirCount.oldLines) {\n oldLines += myCount.oldLines;\n } else {\n oldLines = undefined;\n }\n }\n\n if (newLines !== undefined) {\n if (myCount.newLines === theirCount.newLines) {\n newLines += myCount.newLines;\n } else {\n newLines = undefined;\n }\n }\n } else {\n if (newLines !== undefined && (line[0] === '+' || line[0] === ' ')) {\n newLines++;\n }\n\n if (oldLines !== undefined && (line[0] === '-' || line[0] === ' ')) {\n oldLines++;\n }\n }\n });\n return {\n oldLines: oldLines,\n newLines: newLines\n };\n}\n\nfunction reversePatch(structuredPatch) {\n if (Array.isArray(structuredPatch)) {\n return structuredPatch.map(reversePatch).reverse();\n }\n\n return _objectSpread2(_objectSpread2({}, structuredPatch), {}, {\n oldFileName: structuredPatch.newFileName,\n oldHeader: structuredPatch.newHeader,\n newFileName: structuredPatch.oldFileName,\n newHeader: structuredPatch.oldHeader,\n hunks: structuredPatch.hunks.map(function (hunk) {\n return {\n oldLines: hunk.newLines,\n oldStart: hunk.newStart,\n newLines: hunk.oldLines,\n newStart: hunk.oldStart,\n linedelimiters: hunk.linedelimiters,\n lines: hunk.lines.map(function (l) {\n if (l.startsWith('-')) {\n return \"+\".concat(l.slice(1));\n }\n\n if (l.startsWith('+')) {\n return \"-\".concat(l.slice(1));\n }\n\n return l;\n })\n };\n })\n });\n}\n\n// See: http://code.google.com/p/google-diff-match-patch/wiki/API\nfunction convertChangesToDMP(changes) {\n var ret = [],\n change,\n operation;\n\n for (var i = 0; i < changes.length; i++) {\n change = changes[i];\n\n if (change.added) {\n operation = 1;\n } else if (change.removed) {\n operation = -1;\n } else {\n operation = 0;\n }\n\n ret.push([operation, change.value]);\n }\n\n return ret;\n}\n\nfunction convertChangesToXML(changes) {\n var ret = [];\n\n for (var i = 0; i < changes.length; i++) {\n var change = changes[i];\n\n if (change.added) {\n ret.push('<ins>');\n } else if (change.removed) {\n ret.push('<del>');\n }\n\n ret.push(escapeHTML(change.value));\n\n if (change.added) {\n ret.push('</ins>');\n } else if (change.removed) {\n ret.push('</del>');\n }\n }\n\n return ret.join('');\n}\n\nfunction escapeHTML(s) {\n var n = s;\n n = n.replace(/&/g, '&');\n n = n.replace(/</g, '<');\n n = n.replace(/>/g, '>');\n n = n.replace(/\"/g, '"');\n return n;\n}\n\nexport { Diff, applyPatch, applyPatches, canonicalize, convertChangesToDMP, convertChangesToXML, createPatch, createTwoFilesPatch, diffArrays, diffChars, diffCss, diffJson, diffLines, diffSentences, diffTrimmedLines, diffWords, diffWordsWithSpace, formatPatch, merge, parsePatch, reversePatch, structuredPatch };\n"],"names":["Diff","oldString","newString","_options$timeout","options","callback","self","done","value","newLen","oldLen","editLength","maxEditLength","maxExecutionTime","abortAfterTimestamp","bestPath","newPos","minDiagonalToConsider","maxDiagonalToConsider","execEditLength","diagonalPath","basePath","removePath","addPath","canAdd","addPathNewPos","canRemove","buildValues","exec","ret","path","added","removed","oldPosInc","last","oldPos","commonCount","left","right","array","chars","diff","lastComponent","useLongestToken","components","nextComponent","componentPos","componentLen","component","tmp","i","oldValue","finalComponent","extendedWordChars","reWhitespace","wordDiff","tokens","lineDiff","retLines","linesAndNewlines","line","sentenceDiff","cssDiff","_typeof","obj","objectPrototypeToString","jsonDiff","_this$options","undefinedReplacement","_this$options$stringi","stringifyReplacer","k","v","canonicalize","stack","replacementStack","replacer","key","canonicalizedObj","sortedKeys","_key","arrayDiff","parsePatch","uniDiff","diffstr","delimiters","list","parseIndex","index","header","parseFileHeader","_line","parseHunk","fileHeader","keyPrefix","data","fileName","chunkHeaderIndex","chunkHeaderLine","chunkHeader","hunk","addCount","removeCount","operation","distanceIterator","start","minLine","maxLine","wantForward","backwardExhausted","forwardExhausted","localOffset","iterator","applyPatch","source","lines","hunks","compareLine","lineNumber","patchContent","errorCount","fuzzFactor","offset","removeEOFNL","addEOFNL","hunkFits","toPos","j","content","diffOffset","_i","_hunk","_toPos","delimiter","previousOperation","_k"],"mappings":"gFAAA,SAASA,GAAO,CAAC,CACjBA,EAAK,UAAY,CACf,KAAM,SAAcC,EAAWC,EAAW,CACxC,IAAIC,EAEAC,EAAU,UAAU,OAAS,GAAK,UAAU,CAAC,IAAM,OAAY,UAAU,CAAC,EAAI,CAAA,EAC9EC,EAAWD,EAAQ,SAEnB,OAAOA,GAAY,aACrBC,EAAWD,EACXA,EAAU,CAAA,GAGZ,KAAK,QAAUA,EACf,IAAIE,EAAO,KAEX,SAASC,EAAKC,EAAO,CACnB,OAAIH,GACF,WAAW,UAAY,CACrBA,EAAS,OAAWG,CAAK,CAC3B,EAAG,CAAC,EACG,IAEAA,CAEX,CAGAP,EAAY,KAAK,UAAUA,CAAS,EACpCC,EAAY,KAAK,UAAUA,CAAS,EACpCD,EAAY,KAAK,YAAY,KAAK,SAASA,CAAS,CAAC,EACrDC,EAAY,KAAK,YAAY,KAAK,SAASA,CAAS,CAAC,EACrD,IAAIO,EAASP,EAAU,OACnBQ,EAAST,EAAU,OACnBU,EAAa,EACbC,EAAgBH,EAASC,EAEzBN,EAAQ,gBACVQ,EAAgB,KAAK,IAAIA,EAAeR,EAAQ,aAAa,GAG/D,IAAIS,GAAoBV,EAAmBC,EAAQ,WAAa,MAAQD,IAAqB,OAASA,EAAmB,IACrHW,EAAsB,KAAK,IAAG,EAAKD,EACnCE,EAAW,CAAC,CACd,OAAQ,GACR,cAAe,MACrB,CAAK,EAEGC,EAAS,KAAK,cAAcD,EAAS,CAAC,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EAAIlD,EAAWkD,CAAE,EAGvC,OAAOpB,EAAM,KAAK,EAAE,CACtB","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
function E() {
|
|
2
|
+
}
|
|
3
|
+
E.prototype = {
|
|
4
|
+
diff: function(e, n) {
|
|
5
|
+
var i, o = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, t = o.callback;
|
|
6
|
+
typeof o == "function" && (t = o, o = {}), this.options = o;
|
|
7
|
+
var s = this;
|
|
8
|
+
function u(h) {
|
|
9
|
+
return t ? (setTimeout(function() {
|
|
10
|
+
t(void 0, h);
|
|
11
|
+
}, 0), !0) : h;
|
|
12
|
+
}
|
|
13
|
+
e = this.castInput(e), n = this.castInput(n), e = this.removeEmpty(this.tokenize(e)), n = this.removeEmpty(this.tokenize(n));
|
|
14
|
+
var d = n.length, l = e.length, p = 1, f = d + l;
|
|
15
|
+
o.maxEditLength && (f = Math.min(f, o.maxEditLength));
|
|
16
|
+
var a = (i = o.timeout) !== null && i !== void 0 ? i : 1 / 0, m = Date.now() + a, c = [{
|
|
17
|
+
oldPos: -1,
|
|
18
|
+
lastComponent: void 0
|
|
19
|
+
}], v = this.extractCommon(c[0], n, e, 0);
|
|
20
|
+
if (c[0].oldPos + 1 >= l && v + 1 >= d)
|
|
21
|
+
return u([{
|
|
22
|
+
value: this.join(n),
|
|
23
|
+
count: n.length
|
|
24
|
+
}]);
|
|
25
|
+
var z = -1 / 0, w = 1 / 0;
|
|
26
|
+
function F() {
|
|
27
|
+
for (var h = Math.max(z, -p); h <= Math.min(w, p); h += 2) {
|
|
28
|
+
var y = void 0, g = c[h - 1], L = c[h + 1];
|
|
29
|
+
g && (c[h - 1] = void 0);
|
|
30
|
+
var x = !1;
|
|
31
|
+
if (L) {
|
|
32
|
+
var C = L.oldPos - h;
|
|
33
|
+
x = L && 0 <= C && C < d;
|
|
34
|
+
}
|
|
35
|
+
var T = g && g.oldPos + 1 < l;
|
|
36
|
+
if (!x && !T) {
|
|
37
|
+
c[h] = void 0;
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
if (!T || x && g.oldPos + 1 < L.oldPos ? y = s.addToPath(L, !0, void 0, 0) : y = s.addToPath(g, void 0, !0, 1), v = s.extractCommon(y, n, e, h), y.oldPos + 1 >= l && v + 1 >= d)
|
|
41
|
+
return u(X(s, y.lastComponent, n, e, s.useLongestToken));
|
|
42
|
+
c[h] = y, y.oldPos + 1 >= l && (w = Math.min(w, h - 1)), v + 1 >= d && (z = Math.max(z, h + 1));
|
|
43
|
+
}
|
|
44
|
+
p++;
|
|
45
|
+
}
|
|
46
|
+
if (t)
|
|
47
|
+
(function h() {
|
|
48
|
+
setTimeout(function() {
|
|
49
|
+
if (p > f || Date.now() > m)
|
|
50
|
+
return t();
|
|
51
|
+
F() || h();
|
|
52
|
+
}, 0);
|
|
53
|
+
})();
|
|
54
|
+
else
|
|
55
|
+
for (; p <= f && Date.now() <= m; ) {
|
|
56
|
+
var H = F();
|
|
57
|
+
if (H)
|
|
58
|
+
return H;
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
addToPath: function(e, n, i, o) {
|
|
62
|
+
var t = e.lastComponent;
|
|
63
|
+
return t && t.added === n && t.removed === i ? {
|
|
64
|
+
oldPos: e.oldPos + o,
|
|
65
|
+
lastComponent: {
|
|
66
|
+
count: t.count + 1,
|
|
67
|
+
added: n,
|
|
68
|
+
removed: i,
|
|
69
|
+
previousComponent: t.previousComponent
|
|
70
|
+
}
|
|
71
|
+
} : {
|
|
72
|
+
oldPos: e.oldPos + o,
|
|
73
|
+
lastComponent: {
|
|
74
|
+
count: 1,
|
|
75
|
+
added: n,
|
|
76
|
+
removed: i,
|
|
77
|
+
previousComponent: t
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
},
|
|
81
|
+
extractCommon: function(e, n, i, o) {
|
|
82
|
+
for (var t = n.length, s = i.length, u = e.oldPos, d = u - o, l = 0; d + 1 < t && u + 1 < s && this.equals(n[d + 1], i[u + 1]); )
|
|
83
|
+
d++, u++, l++;
|
|
84
|
+
return l && (e.lastComponent = {
|
|
85
|
+
count: l,
|
|
86
|
+
previousComponent: e.lastComponent
|
|
87
|
+
}), e.oldPos = u, d;
|
|
88
|
+
},
|
|
89
|
+
equals: function(e, n) {
|
|
90
|
+
return this.options.comparator ? this.options.comparator(e, n) : e === n || this.options.ignoreCase && e.toLowerCase() === n.toLowerCase();
|
|
91
|
+
},
|
|
92
|
+
removeEmpty: function(e) {
|
|
93
|
+
for (var n = [], i = 0; i < e.length; i++)
|
|
94
|
+
e[i] && n.push(e[i]);
|
|
95
|
+
return n;
|
|
96
|
+
},
|
|
97
|
+
castInput: function(e) {
|
|
98
|
+
return e;
|
|
99
|
+
},
|
|
100
|
+
tokenize: function(e) {
|
|
101
|
+
return e.split("");
|
|
102
|
+
},
|
|
103
|
+
join: function(e) {
|
|
104
|
+
return e.join("");
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
function X(r, e, n, i, o) {
|
|
108
|
+
for (var t = [], s; e; )
|
|
109
|
+
t.push(e), s = e.previousComponent, delete e.previousComponent, e = s;
|
|
110
|
+
t.reverse();
|
|
111
|
+
for (var u = 0, d = t.length, l = 0, p = 0; u < d; u++) {
|
|
112
|
+
var f = t[u];
|
|
113
|
+
if (f.removed) {
|
|
114
|
+
if (f.value = r.join(i.slice(p, p + f.count)), p += f.count, u && t[u - 1].added) {
|
|
115
|
+
var m = t[u - 1];
|
|
116
|
+
t[u - 1] = t[u], t[u] = m;
|
|
117
|
+
}
|
|
118
|
+
} else {
|
|
119
|
+
if (!f.added && o) {
|
|
120
|
+
var a = n.slice(l, l + f.count);
|
|
121
|
+
a = a.map(function(v, z) {
|
|
122
|
+
var w = i[p + z];
|
|
123
|
+
return w.length > v.length ? w : v;
|
|
124
|
+
}), f.value = r.join(a);
|
|
125
|
+
} else
|
|
126
|
+
f.value = r.join(n.slice(l, l + f.count));
|
|
127
|
+
l += f.count, f.added || (p += f.count);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
var c = t[d - 1];
|
|
131
|
+
return d > 1 && typeof c.value == "string" && (c.added || c.removed) && r.equals("", c.value) && (t[d - 2].value += c.value, t.pop()), t;
|
|
132
|
+
}
|
|
133
|
+
var V = /^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/, U = /\S/, Z = new E();
|
|
134
|
+
Z.equals = function(r, e) {
|
|
135
|
+
return this.options.ignoreCase && (r = r.toLowerCase(), e = e.toLowerCase()), r === e || this.options.ignoreWhitespace && !U.test(r) && !U.test(e);
|
|
136
|
+
};
|
|
137
|
+
Z.tokenize = function(r) {
|
|
138
|
+
for (var e = r.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/), n = 0; n < e.length - 1; n++)
|
|
139
|
+
!e[n + 1] && e[n + 2] && V.test(e[n]) && V.test(e[n + 2]) && (e[n] += e[n + 2], e.splice(n + 1, 2), n--);
|
|
140
|
+
return e;
|
|
141
|
+
};
|
|
142
|
+
var b = new E();
|
|
143
|
+
b.tokenize = function(r) {
|
|
144
|
+
this.options.stripTrailingCr && (r = r.replace(/\r\n/g, `
|
|
145
|
+
`));
|
|
146
|
+
var e = [], n = r.split(/(\n|\r\n)/);
|
|
147
|
+
n[n.length - 1] || n.pop();
|
|
148
|
+
for (var i = 0; i < n.length; i++) {
|
|
149
|
+
var o = n[i];
|
|
150
|
+
i % 2 && !this.options.newlineIsToken ? e[e.length - 1] += o : (this.options.ignoreWhitespace && (o = o.trim()), e.push(o));
|
|
151
|
+
}
|
|
152
|
+
return e;
|
|
153
|
+
};
|
|
154
|
+
var Y = new E();
|
|
155
|
+
Y.tokenize = function(r) {
|
|
156
|
+
return r.split(/(\S.+?[.!?])(?=\s+|$)/);
|
|
157
|
+
};
|
|
158
|
+
var K = new E();
|
|
159
|
+
K.tokenize = function(r) {
|
|
160
|
+
return r.split(/([{}:;,]|\s+)/);
|
|
161
|
+
};
|
|
162
|
+
function D(r) {
|
|
163
|
+
"@babel/helpers - typeof";
|
|
164
|
+
return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? D = function(e) {
|
|
165
|
+
return typeof e;
|
|
166
|
+
} : D = function(e) {
|
|
167
|
+
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
168
|
+
}, D(r);
|
|
169
|
+
}
|
|
170
|
+
var k = Object.prototype.toString, q = new E();
|
|
171
|
+
q.useLongestToken = !0;
|
|
172
|
+
q.tokenize = b.tokenize;
|
|
173
|
+
q.castInput = function(r) {
|
|
174
|
+
var e = this.options, n = e.undefinedReplacement, i = e.stringifyReplacer, o = i === void 0 ? function(t, s) {
|
|
175
|
+
return typeof s > "u" ? n : s;
|
|
176
|
+
} : i;
|
|
177
|
+
return typeof r == "string" ? r : JSON.stringify(N(r, null, null, o), o, " ");
|
|
178
|
+
};
|
|
179
|
+
q.equals = function(r, e) {
|
|
180
|
+
return E.prototype.equals.call(q, r.replace(/,([\r\n])/g, "$1"), e.replace(/,([\r\n])/g, "$1"));
|
|
181
|
+
};
|
|
182
|
+
function N(r, e, n, i, o) {
|
|
183
|
+
e = e || [], n = n || [], i && (r = i(o, r));
|
|
184
|
+
var t;
|
|
185
|
+
for (t = 0; t < e.length; t += 1)
|
|
186
|
+
if (e[t] === r)
|
|
187
|
+
return n[t];
|
|
188
|
+
var s;
|
|
189
|
+
if (k.call(r) === "[object Array]") {
|
|
190
|
+
for (e.push(r), s = new Array(r.length), n.push(s), t = 0; t < r.length; t += 1)
|
|
191
|
+
s[t] = N(r[t], e, n, i, o);
|
|
192
|
+
return e.pop(), n.pop(), s;
|
|
193
|
+
}
|
|
194
|
+
if (r && r.toJSON && (r = r.toJSON()), D(r) === "object" && r !== null) {
|
|
195
|
+
e.push(r), s = {}, n.push(s);
|
|
196
|
+
var u = [], d;
|
|
197
|
+
for (d in r)
|
|
198
|
+
r.hasOwnProperty(d) && u.push(d);
|
|
199
|
+
for (u.sort(), t = 0; t < u.length; t += 1)
|
|
200
|
+
d = u[t], s[d] = N(r[d], e, n, i, d);
|
|
201
|
+
e.pop(), n.pop();
|
|
202
|
+
} else
|
|
203
|
+
s = r;
|
|
204
|
+
return s;
|
|
205
|
+
}
|
|
206
|
+
var R = new E();
|
|
207
|
+
R.tokenize = function(r) {
|
|
208
|
+
return r.slice();
|
|
209
|
+
};
|
|
210
|
+
R.join = R.removeEmpty = function(r) {
|
|
211
|
+
return r;
|
|
212
|
+
};
|
|
213
|
+
function S(r) {
|
|
214
|
+
var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = r.split(/\r\n|[\n\v\f\r\x85]/), i = r.match(/\r\n|[\n\v\f\r\x85]/g) || [], o = [], t = 0;
|
|
215
|
+
function s() {
|
|
216
|
+
var l = {};
|
|
217
|
+
for (o.push(l); t < n.length; ) {
|
|
218
|
+
var p = n[t];
|
|
219
|
+
if (/^(\-\-\-|\+\+\+|@@)\s/.test(p))
|
|
220
|
+
break;
|
|
221
|
+
var f = /^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(p);
|
|
222
|
+
f && (l.index = f[1]), t++;
|
|
223
|
+
}
|
|
224
|
+
for (u(l), u(l), l.hunks = []; t < n.length; ) {
|
|
225
|
+
var a = n[t];
|
|
226
|
+
if (/^(Index:|diff|\-\-\-|\+\+\+)\s/.test(a))
|
|
227
|
+
break;
|
|
228
|
+
if (/^@@/.test(a))
|
|
229
|
+
l.hunks.push(d());
|
|
230
|
+
else {
|
|
231
|
+
if (a && e.strict)
|
|
232
|
+
throw new Error("Unknown line " + (t + 1) + " " + JSON.stringify(a));
|
|
233
|
+
t++;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
function u(l) {
|
|
238
|
+
var p = /^(---|\+\+\+)\s+(.*)$/.exec(n[t]);
|
|
239
|
+
if (p) {
|
|
240
|
+
var f = p[1] === "---" ? "old" : "new", a = p[2].split(" ", 2), m = a[0].replace(/\\\\/g, "\\");
|
|
241
|
+
/^".*"$/.test(m) && (m = m.substr(1, m.length - 2)), l[f + "FileName"] = m, l[f + "Header"] = (a[1] || "").trim(), t++;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
function d() {
|
|
245
|
+
var l = t, p = n[t++], f = p.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/), a = {
|
|
246
|
+
oldStart: +f[1],
|
|
247
|
+
oldLines: typeof f[2] > "u" ? 1 : +f[2],
|
|
248
|
+
newStart: +f[3],
|
|
249
|
+
newLines: typeof f[4] > "u" ? 1 : +f[4],
|
|
250
|
+
lines: [],
|
|
251
|
+
linedelimiters: []
|
|
252
|
+
};
|
|
253
|
+
a.oldLines === 0 && (a.oldStart += 1), a.newLines === 0 && (a.newStart += 1);
|
|
254
|
+
for (var m = 0, c = 0; t < n.length && !(n[t].indexOf("--- ") === 0 && t + 2 < n.length && n[t + 1].indexOf("+++ ") === 0 && n[t + 2].indexOf("@@") === 0); t++) {
|
|
255
|
+
var v = n[t].length == 0 && t != n.length - 1 ? " " : n[t][0];
|
|
256
|
+
if (v === "+" || v === "-" || v === " " || v === "\\")
|
|
257
|
+
a.lines.push(n[t]), a.linedelimiters.push(i[t] || `
|
|
258
|
+
`), v === "+" ? m++ : v === "-" ? c++ : v === " " && (m++, c++);
|
|
259
|
+
else
|
|
260
|
+
break;
|
|
261
|
+
}
|
|
262
|
+
if (!m && a.newLines === 1 && (a.newLines = 0), !c && a.oldLines === 1 && (a.oldLines = 0), e.strict) {
|
|
263
|
+
if (m !== a.newLines)
|
|
264
|
+
throw new Error("Added line count did not match for hunk at line " + (l + 1));
|
|
265
|
+
if (c !== a.oldLines)
|
|
266
|
+
throw new Error("Removed line count did not match for hunk at line " + (l + 1));
|
|
267
|
+
}
|
|
268
|
+
return a;
|
|
269
|
+
}
|
|
270
|
+
for (; t < n.length; )
|
|
271
|
+
s();
|
|
272
|
+
return o;
|
|
273
|
+
}
|
|
274
|
+
function P(r, e, n) {
|
|
275
|
+
var i = !0, o = !1, t = !1, s = 1;
|
|
276
|
+
return function u() {
|
|
277
|
+
if (i && !t) {
|
|
278
|
+
if (o ? s++ : i = !1, r + s <= n)
|
|
279
|
+
return s;
|
|
280
|
+
t = !0;
|
|
281
|
+
}
|
|
282
|
+
if (!o)
|
|
283
|
+
return t || (i = !0), e <= r - s ? -s++ : (o = !0, u());
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
function j(r, e) {
|
|
287
|
+
var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
288
|
+
if (typeof e == "string" && (e = S(e)), Array.isArray(e)) {
|
|
289
|
+
if (e.length > 1)
|
|
290
|
+
throw new Error("applyPatch only works with a single input.");
|
|
291
|
+
e = e[0];
|
|
292
|
+
}
|
|
293
|
+
var i = r.split(/\r\n|[\n\v\f\r\x85]/), o = r.match(/\r\n|[\n\v\f\r\x85]/g) || [], t = e.hunks, s = n.compareLine || function(M, O, A, I) {
|
|
294
|
+
return O === I;
|
|
295
|
+
}, u = 0, d = n.fuzzFactor || 0, l = 0, p = 0, f, a;
|
|
296
|
+
function m(M, O) {
|
|
297
|
+
for (var A = 0; A < M.lines.length; A++) {
|
|
298
|
+
var I = M.lines[A], J = I.length > 0 ? I[0] : " ", Q = I.length > 0 ? I.substr(1) : I;
|
|
299
|
+
if (J === " " || J === "-") {
|
|
300
|
+
if (!s(O + 1, i[O], J, Q) && (u++, u > d))
|
|
301
|
+
return !1;
|
|
302
|
+
O++;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
return !0;
|
|
306
|
+
}
|
|
307
|
+
for (var c = 0; c < t.length; c++) {
|
|
308
|
+
for (var v = t[c], z = i.length - v.oldLines, w = 0, F = p + v.oldStart - 1, H = P(F, l, z); w !== void 0; w = H())
|
|
309
|
+
if (m(v, F + w)) {
|
|
310
|
+
v.offset = p += w;
|
|
311
|
+
break;
|
|
312
|
+
}
|
|
313
|
+
if (w === void 0)
|
|
314
|
+
return !1;
|
|
315
|
+
l = v.offset + v.oldStart + v.oldLines;
|
|
316
|
+
}
|
|
317
|
+
for (var h = 0, y = 0; y < t.length; y++) {
|
|
318
|
+
var g = t[y], L = g.oldStart + g.offset + h - 1;
|
|
319
|
+
h += g.newLines - g.oldLines;
|
|
320
|
+
for (var x = 0; x < g.lines.length; x++) {
|
|
321
|
+
var C = g.lines[x], T = C.length > 0 ? C[0] : " ", B = C.length > 0 ? C.substr(1) : C, G = g.linedelimiters && g.linedelimiters[x] || `
|
|
322
|
+
`;
|
|
323
|
+
if (T === " ")
|
|
324
|
+
L++;
|
|
325
|
+
else if (T === "-")
|
|
326
|
+
i.splice(L, 1), o.splice(L, 1);
|
|
327
|
+
else if (T === "+")
|
|
328
|
+
i.splice(L, 0, B), o.splice(L, 0, G), L++;
|
|
329
|
+
else if (T === "\\") {
|
|
330
|
+
var W = g.lines[x - 1] ? g.lines[x - 1][0] : null;
|
|
331
|
+
W === "+" ? f = !0 : W === "-" && (a = !0);
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
if (f)
|
|
336
|
+
for (; !i[i.length - 1]; )
|
|
337
|
+
i.pop(), o.pop();
|
|
338
|
+
else a && (i.push(""), o.push(`
|
|
339
|
+
`));
|
|
340
|
+
for (var $ = 0; $ < i.length - 1; $++)
|
|
341
|
+
i[$] = i[$] + o[$];
|
|
342
|
+
return i.join("");
|
|
343
|
+
}
|
|
344
|
+
export {
|
|
345
|
+
E as Diff,
|
|
346
|
+
j as applyPatch,
|
|
347
|
+
N as canonicalize,
|
|
348
|
+
S as parsePatch
|
|
349
|
+
};
|
|
350
|
+
//# sourceMappingURL=index.es.js.map
|