moodle-plagiarism_pchkorg/assets/viewer/plagCheck.js

33 lines
348 KiB
JavaScript
Raw Normal View History

2018-11-01 14:21:14 +00:00
!function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=407)}([function(e,t,n){"use strict";e.exports=n(35)},function(e,t,n){"use strict";function r(e,t,n,r,i,a,s,u){if(o(t),!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,i,a,s,u],p=0;c=new Error(t.replace(/%s/g,function(){return l[p++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}}var o=function(e){};e.exports=r},function(e,t,n){e.exports=n(296)()},function(e,t,n){"use strict";var r=n(12),o=r;e.exports=o},function(e,t,n){"use strict";function r(e){for(var t=arguments.length-1,n="Minified React error #"+e+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+e,r=0;r<t;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);n+=" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";var o=new Error(n);throw o.name="Invariant Violation",o.framesToPop=1,o}e.exports=r},function(e,t,n){"use strict";function r(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
var o=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,s,u=r(e),c=1;c<arguments.length;c++){n=Object(arguments[c]);for(var l in n)i.call(n,l)&&(u[l]=n[l]);if(o){s=o(n);for(var p=0;p<s.length;p++)a.call(n,s[p])&&(u[s[p]]=n[s[p]])}}return u}},function(e,t,n){"use strict";function r(e,t){return 1===e.nodeType&&e.getAttribute(h)===String(t)||8===e.nodeType&&e.nodeValue===" react-text: "+t+" "||8===e.nodeType&&e.nodeValue===" react-empty: "+t+" "}function o(e){for(var t;t=e._renderedComponent;)e=t;return e}function i(e,t){var n=o(e);n._hostNode=t,t[m]=n}function a(e){var t=e._hostNode;t&&(delete t[m],e._hostNode=null)}function s(e,t){if(!(e._flags&g.hasCachedChildNodes)){var n=e._renderedChildren,a=t.firstChild;e:for(var s in n)if(n.hasOwnProperty(s)){var u=n[s],c=o(u)._domID;if(0!==c){for(;null!==a;a=a.nextSibling)if(r(a,c)){i(u,a);continue e}p("32",c)}}e._flags|=g.hasCachedChildNodes}}function u(e){if(e[m])return e[m];for(var t=[];!e[m];){if(t.push(e),!e.parentNode)return null;e=e.parentNode}for(var n,r;e&&(r=e[m]);e=t.pop())n=r,t.length&&s(r,e);return n}function c(e){var t=u(e);return null!=t&&t._hostNode===e?t:null}function l(e){if(void 0===e._hostNode&&p("33"),e._hostNode)return e._hostNode;for(var t=[];!e._hostNode;)t.push(e),e._hostParent||p("34"),e=e._hostParent;for(;t.length;e=t.pop())s(e,e._hostNode);return e._hostNode}var p=n(4),f=n(33),d=n(130),h=(n(1),f.ID_ATTRIBUTE_NAME),g=d,m="__reactInternalInstance$"+Math.random().toString(36).slice(2),v={getClosestInstanceFromNode:u,getInstanceFromNode:c,getNodeFromInstance:l,precacheChildNodes:s,precacheNode:i,uncacheNode:a};e.exports=v},function(e,t,n){var r,o;/*!
Copyright (c) 2016 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
!function(){"use strict";function n(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var o=typeof r;if("string"===o||"number"===o)e.push(r);else if(Array.isArray(r))e.push(n.apply(null,r));else if("object"===o)for(var a in r)i.call(r,a)&&r[a]&&e.push(a)}}return e.join(" ")}var i={}.hasOwnProperty;void 0!==e&&e.exports?e.exports=n:(r=[],void 0!==(o=function(){return n}.apply(t,r))&&(e.exports=o))}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={REQUEST_TYPE_GET:"GET",REQUEST_TYPE_POST:"POST",FETCH_READER_TEXT:"text",FETCH_READER_JSON:"json",COMPONENT_NAME:"plagCheck",READY_EVENT_NAME:"pCheckReady",SOURCE_HIGHLIGHT:"highlight",SOURCE_IGNORE:"ignore",ORIGINAL:"original",PLAGIARISM:"plagiarism",QUOTE:"quote",REFERENCE:"reference",HEADER:"header",PARAPHRASE:"paraphrase",NODE_TYPES:["plagiarism","paraphrase","header","quote","reference","original"],I18N_PLAGCHECK_NAMESPACE:"plagCheck",I18N_DEFAULT_NAMESPACE:"_primitives",CUSTOM_OPTIONS_DEFAULT:{},CUSTOM_PROPS_DEFAULT:{},DUMMY_FUNCTION:function(){},EMPTY_STRING:"",NOT_ID:-1,EMPTY_ARRAY:[],EMPTY_OBJECT:{},ENV_PRODUCTION:"production",PARAPHRASE_BOUNDARY:1,TRANSPARENT:"transparent",INDEX_EXTERNAL:"external",INDEX_INTERNAL:"internal",INDEX_CACHE:"cache",REG_EXP_MULTIPLE_NEW_LINES:/\n+/g,REG_EXP_NBSP_NEW_LINES:/(\u00a0\n)+|(\u00a0)+/g,REG_EXP_WORDS_COUNT:/[\w\d]+/gi,KEY_ESCAPE:27,KEY_ARROW_LEFT:37,KEY_ARROW_RIGHT:39,DIRECTION_PREV:"prev",DIRECTION_NEXT:"next",USER_CUSTOMER:"customer",USER_SUPPORTER:"supporter"}},function(e,t){var n=e.exports={version:"2.5.0"};"number"==typeof __e&&(__e=n)},function(e,t,n){var r=n(114)("wks"),o=n(55),i=n(14).Symbol,a="function"==typeof i;(e.exports=function(e){return r[e]||(r[e]=a&&i[e]||(a?i:o)("Symbol."+e))}).store=r},function(e,t,n){"use strict";var r=!("undefined"==typeof window||!window.document||!window.document.createElement),o={canUseDOM:r,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:r&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:r&&!!window.screen,isInWorker:!r};e.exports=o},function(e,t,n){"use strict";function r(e){return function(){return e}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},e.exports=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default={ACTIVE:"pCheck-active",INACTIVE:"pCheck-inactive",DISABLED:"pCheck-disabled",TRANSPARENT:"pCheck-transparent",MATCHED:"pCheck-matched",NON_MATCHED:"pCheck-non-matched",ALLOWED:"pCheck-allowed",DISALLOWED:"pCheck-disallowed",PASSED:"pCheck-passed",FILTERED:"pCheck-filtered",UNFILTERED:"pCheck-unfiltered",HIGHLIGHTED:"pCheck-highlighted",UNHIGHLIGHTED:"pCheck-unhighlighted",SELECTED:"pCheck-selected",IGNORED:"pCheck-ignored",PLAGIARISM:"pCheck-plagiarism",PARAPHRASE:"pCheck-paraphrase",HEADER:"pCheck-header",QUOTE:"pCheck-quote",REFERENCE:"pCheck-reference",ORIGINAL:"pCheck-original",ALL_SOURCES:"pCheck-all",LINK:"pCheck-link",DIRECTION_TOP:"pCheck-top",DIRECTION_BOTTOM:"pCheck-bottom",COPIED:"pCheck-copied",NOT_COPIED:"pCheck-not-copied",INHERIT:"inherit"}},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,n){"use strict";var r=null;e.exports={debugTool:r}},function(e,t,n){"use strict";function r(){k.ReactReconcileTransaction&&E||l("123")}function o(){this.reinitializeTransaction(),this.dirtyComponentsLength=null,this.callbackQueue=f.getPooled(),this.reconcileTransaction=k.ReactReconcileTransaction.getPooled(!0)}function i(e,t,n,o,i,a){return r(),E.batchedUpdates(e,t,n,o,i,a)}function a(e,t){return e._mountOrder-t._mountOrder}function s(e){var t=e.dirtyComponentsLength;t!==v.length&&l("124",t,v.length),v.sort(a),y++;for(var n=0;n<t;n++){var r=v[n],o=r._pendingCallbacks;r._pendingCallbacks=null;if(h.logTopLevelRenders){var i=r;r._currentElement.type.isReactTopLevel
* Checks if an event is supported in the current execution environment.
*
* NOTE: This will not work correctly for non-generic events such as `change`,
* `reset`, `load`, `error`, and `select`.
*
* Borrows from Modernizr.
*
* @param {string} eventNameSuffix Event name, e.g. "click".
* @param {?boolean} capture Check if the capture phase is supported.
* @return {boolean} True if the event is supported.
* @internal
* @license Modernizr 3.0.0pre (Custom Build) | MIT
*/
function r(e,t){if(!i.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,r=n in document;if(!r){var a=document.createElement("div");a.setAttribute(n,"return;"),r="function"==typeof a[n]}return!r&&o&&"wheel"===e&&(r=document.implementation.hasFeature("Events.wheel","3.0")),r}var o,i=n(11);i.canUseDOM&&(o=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("","")),e.exports=r},function(e,t,n){"use strict";function r(e,t){var n=null===e||!1===e,r=null===t||!1===t;if(n||r)return n===r;var o=typeof e,i=typeof t;return"string"===o||"number"===o?"string"===i||"number"===i:"object"===i&&e.type===t.type&&e.key===t.key}e.exports=r},function(e,t,n){"use strict";var r=(n(5),n(12)),o=(n(3),r);e.exports=o},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){return e.type===p.default||e.type===d.default||e.type===g.default}function i(e,t){return c.Children.map(e,function(e){return null===e?null:o(e)?t(e):e.props&&e.props.children&&"object"===u(e.props.children)?(0,c.cloneElement)(e,s({},e.props,{children:i(e.props.children,t)})):e})}function a(e,t){return c.Children.forEach(e,function(e){null!==e&&(e.type===p.default||e.type===g.default?t(e):e.props&&e.props.children&&"object"===u(e.props.children)&&(e.type===d.default&&t(e),a(e.props.children,t)))})}t.__esModule=!0;var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.deepMap=i,t.deepForEach=a;var c=n(0),l=n(48),p=r(l),f=n(63),d=r(f),h=n(49),g=r(h)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.cos,n=e.t;return a.default.createElement("div",{className:"pCheck-details-sourceItem-cos",title:n("nodeDetails-SourceItem-CosineSimilarity-tooltip",{cos:t})},n("nodeDetails-SourceItem-CosineSimilarity-cos",{cos:t}))}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var i=n(0),a=r(i),s=n(2),u=r(s);n(248),o.propTypes={cos:u.default.number.isRequired,t:u.default.func.isRequired}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),c=r(u),l=n(2),p=r(l),f=n(379),d=n(7),h=r(d),g=n(25),m=r(g),v=n(8),y=r(v),b=n(13),_=r(b),E=n(185),C=r(E),x=n(101),w=r(x),O=n(190),S=r(O),k=n(20),T=n(100),P=n(66),N=n(187),R=r(N),I=n(165),M=r(I),A=n(174),j=r(A),D=n(183),L=r(D),U=n(173),F=r(U);n(268);var H=function(e){function t(e){o(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));n.toggleAllSourceHandler=function(){var e=n.state,t=e.allSourcesEnabled,r=e.report_data;n.setState({allSourcesEnabled:!t,report_data:(0,P.toggleAllSources)(r,t)})},n.enableSourceHandler=function(e){var t=n.state.report_data,r=(0,P.enableSource)({report_data:t,id:e}),o=r.report_data;n.setState({report_data:o})},n.disableSourceHandler=function(e){var t=n.state.report_data,r=(0,P.disableSource)({report_data:t,id:e}),o=r.report_data;n.setState({repor
* [js-htmlencode]{@link https://github.com/emn178/js-htmlencode}
*
* @version 0.3.0
* @author Chen, Yi-Cyuan [emn178@gmail.com]
* @copyright Chen, Yi-Cyuan 2014-2017
* @license MIT
*/
!function(){"use strict";var i="object"==typeof window?window:{};!i.JS_HTMLENCODE_NO_NODE_JS&&"object"==typeof t&&t.versions&&t.versions.node&&(i=r);var a=!i.JS_HTMLENCODE_NO_COMMON_JS&&"object"==typeof e&&e.exports,s=n(404),u={"&nbsp;":" ","&iexcl;":"¡","&cent;":"¢","&pound;":"£","&curren;":"¤","&yen;":"¥","&brvbar;":"¦","&sect;":"§","&uml;":"¨","&copy;":"©","&ordf;":"ª","&laquo;":"«","&not;":"¬","&shy;":"­","&reg;":"®","&macr;":"¯","&deg;":"°","&plusmn;":"±","&sup2;":"²","&sup3;":"³","&acute;":"´","&micro;":"µ","&para;":"¶","&middot;":"·","&cedil;":"¸","&sup1;":"¹","&ordm;":"º","&raquo;":"»","&frac14;":"¼","&frac12;":"½","&frac34;":"¾","&iquest;":"¿","&Agrave;":"À","&Aacute;":"Á","&Acirc;":"Â","&Atilde;":"Ã","&Auml;":"Ä","&Aring;":"Å","&AElig;":"Æ","&Ccedil;":"Ç","&Egrave;":"È","&Eacute;":"É","&Ecirc;":"Ê","&Euml;":"Ë","&Igrave;":"Ì","&Iacute;":"Í","&Icirc;":"Î","&Iuml;":"Ï","&ETH;":"Ð","&Ntilde;":"Ñ","&Ograve;":"Ò","&Oacute;":"Ó","&Ocirc;":"Ô","&Otilde;":"Õ","&Ouml;":"Ö","&times;":"×","&Oslash;":"Ø","&Ugrave;":"Ù","&Uacute;":"Ú","&Ucirc;":"Û","&Uuml;":"Ü","&Yacute;":"Ý","&THORN;":"Þ","&szlig;":"ß","&agrave;":"à","&aacute;":"á","&acirc;":"â","&atilde;":"ã","&auml;":"ä","&aring;":"å","&aelig;":"æ","&ccedil;":"ç","&egrave;":"è","&eacute;":"é","&ecirc;":"ê","&euml;":"ë","&igrave;":"ì","&iacute;":"í","&icirc;":"î","&iuml;":"ï","&eth;":"ð","&ntilde;":"ñ","&ograve;":"ò","&oacute;":"ó","&ocirc;":"ô","&otilde;":"õ","&ouml;":"ö","&divide;":"÷","&oslash;":"ø","&ugrave;":"ù","&uacute;":"ú","&ucirc;":"û","&uuml;":"ü","&yacute;":"ý","&thorn;":"þ","&yuml;":"ÿ","&quot;":'"',"&amp;":"&","&lt;":"<","&gt;":">","&apos;":"'","&OElig;":"Œ","&oelig;":"œ","&Scaron;":"Š","&scaron;":"š","&Yuml;":"Ÿ","&circ;":"ˆ","&tilde;":"˜","&ensp;":"","&emsp;":"","&thinsp;":"","&zwnj;":"","&zwj;":"","&lrm;":"","&rlm;":"","&ndash;":"","&mdash;":"—","&lsquo;":"","&rsquo;":"","&sbquo;":"","&ldquo;":"“","&rdquo;":"”","&bdquo;":"„","&dagger;":"†","&Dagger;":"‡","&permil;":"‰","&lsaquo;":"","&rsaquo;":"","&euro;":"€","&fnof;":"ƒ","&Alpha;":"Α","&Beta;":"Β","&Gamma;":"Γ","&Delta;":"Δ","&Epsilon;":"Ε","&Zeta;":"Ζ","&Eta;":"Η","&Theta;":"Θ","&Iota;":"Ι","&Kappa;":"Κ","&Lambda;":"Λ","&Mu;":"Μ","&Nu;":"Ν","&Xi;":"Ξ","&Omicron;":"Ο","&Pi;":"Π","&Rho;":"Ρ","&Sigma;":"Σ","&Tau;":"Τ","&Upsilon;":"Υ","&Phi;":"Φ","&Chi;":"Χ","&Psi;":"Ψ","&Omega;":"Ω","&alpha;":"α","&beta;":"β","&gamma;":"γ","&delta;":"δ","&epsilon;":"ε","&zeta;":"ζ","&eta;":"η","&theta;":"θ","&iota;":"ι","&kappa;":"κ","&lambda;":"λ","&mu;":"μ","&nu;":"ν","&xi;":"ξ","&omicron;":"ο","&pi;":"π","&rho;":"ρ","&sigmaf;":"ς","&sigma;":"σ","&tau;":"τ","&upsilon;":"υ","&phi;":"φ","&chi;":"χ","&psi;":"ψ","&omega;":"ω","&thetasym;":"ϑ","&upsih;":"ϒ","&piv;":"ϖ","&bull;":"•","&hellip;":"…","&prime;":"","&Prime;":"″","&oline;":"‾","&frasl;":"","&weierp;":"℘","&image;":"","&real;":"","&trade;":"™","&alefsym;":"ℵ","&larr;":"←","&uarr;":"↑","&rarr;":"→","&darr;":"↓","&harr;":"↔","&crarr;":"↵","&lArr;":"⇐","&uArr;":"⇑","&rArr;":"⇒","&dArr;":"⇓","&hArr;":"⇔","&forall;":"∀","&part;":"∂","&exist;":"∃","&empty;":"∅","&nabla;":"∇","&isin;":"∈","&notin;":"∉","&ni;":"∋","&prod;":"∏","&sum;":"∑","&minus;":"","&lowast;":"","&radic;":"√","&prop;":"∝","&infin;":"∞","&ang;":"∠","&and;":"∧","&or;":"","&cap;":"∩","&cup;":"","&int;":"∫","&there4;":"∴","&sim;":"","&cong;":"≅","&asymp;":"≈","&ne;":"≠","&equiv;":"≡","&le;":"≤","&ge;":"≥","&sub;":"⊂","&sup;":"⊃","&nsub;":"⊄","&sube;":"⊆","&supe;":"⊇","&oplus;":"⊕","&otimes;":"⊗","&perp;":"⊥","&sdot;":"⋅","&lceil;":"⌈","&rceil;":"⌉","&lfloor;":"⌊","&rfloor;":"⌋","&lang;":"〈","&rang;":"〉","&loz;":"◊","&spades;":"♠","&clubs;":"♣","&hearts;":"♥","&diams;":"♦"},c=function(e){if("#"!==e.charAt(1))return u[e]||e;var t,n=e.charAt(2);return"x"==