pluie-bin/dist/pluie-bin.min.js

1 line
4.8 KiB
JavaScript
Raw Permalink Normal View History

2016-12-18 23:39:08 +00:00
!function e(n,t,r){function i(u,f){if(!t[u]){if(!n[u]){var a="function"==typeof require&&require;if(!f&&a)return a(u,!0);if(o)return o(u,!0);var s=new Error("Cannot find module '"+u+"'");throw s.code="MODULE_NOT_FOUND",s}var c=t[u]={exports:{}};n[u][0].call(c.exports,function(e){var t=n[u][1][e];return i(t?t:e)},c,c.exports,e,n,t,r)}return t[u].exports}for(var o="function"==typeof require&&require,u=0;u<r.length;u++)i(r[u]);return i}({1:[function(e,n,t){"undefined"==typeof pluie&&(pluie={bin:{}}),e("./lib/bin")(pluie.bin),n.exports=pluie},{"./lib/bin":2}],2:[function(e,n,t){n.exports=function(n){return e("./encoder")(n),String.prototype.removeEndNullBytes=function(){return this.replace(/\0+$/g,"")},String.prototype.removeStartNullBytes=function(){return this.replace(/^\0+/g,"")},n.enc=new n.TextEncoder("utf-8"),n.dec=new n.TextDecoder("utf-8",{fatal:!0}),n.intFromBytes=function(e){var n=null;if(null!=e&&e.length>0)for(var t=n=0,r=e.length;t<r;t++)n=256*n+e[t];return n},n.bytesFromInt=function(e,n){for(var t=new Uint8Array(n);e;)t.set([255&e],--n),e>>=8;return t},n.pack=function(e,n,t){var r=null;return"n"==n||"N"==n?t>=0&&t<=2147483647&&(r=this.bytesFromInt(t,"n"==n?2:4)):"a"==n&&(r=new Uint8Array(e),r.set(this.enc.encode(t),0)),r},n.unpack=function(e,n,t){var r=null;if("n"==n||"N"==n){var i=t.slice(0,e*("n"==n?2:4));r=this.intFromBytes(i)}else"a"==n&&(r=this.dec.decode(t.slice(0,e)).removeEndNullBytes());return r},n.mergeBuffers=function(e){for(var n=0,t=0,r=e.length;t<r;t++)null!=e[t]&&(n+=e[t].byteLength);for(var i=new Uint8Array(n),t=0,o=0,r=e.length;t<r;t++)null!=e[t]&&(i.set(new Uint8Array(e[t]),o),o+=e[t].byteLength);return i},n.getBuffer=function(e,n){var t=new Uint8Array(n?n:e.length);return t.set(new Uint8Array(e),0),t},e("./file")(n),n}},{"./encoder":3,"./file":4}],3:[function(e,n,t){function r(){}function i(){}!function(){"use strict";function e(e,n){n=n||1/0;for(var t,r=e.length,i=null,o=[],u=0;u<r;u++){if(t=e.charCodeAt(u),t>55295&&t<57344){if(!i){if(t>56319){(n-=3)>-1&&o.push(239,191,189);continue}if(u+1===r){(n-=3)>-1&&o.push(239,191,189);continue}i=t;continue}if(t<56320){(n-=3)>-1&&o.push(239,191,189),i=t;continue}t=i-55296<<10|t-56320|65536,i=null}else i&&((n-=3)>-1&&o.push(239,191,189),i=null);if(t<128){if((n-=1)<0)break;o.push(t)}else if(t<2048){if((n-=2)<0)break;o.push(t>>6|192,63&t|128)}else if(t<65536){if((n-=3)<0)break;o.push(t>>12|224,t>>6&63|128,63&t|128)}else{if(!(t<2097152))throw new Error("Invalid code point");if((n-=4)<0)break;o.push(t>>18|240,t>>12&63|128,t>>6&63|128,63&t|128)}}return o}function n(e,n,r){var i="",o="";r=Math.min(e.length,r||1/0),n=n||0;for(var u=n;u<r;u++)e[u]<=127?(i+=t(o)+String.fromCharCode(e[u]),o=""):o+="%"+e[u].toString(16);return i+t(o)}function t(e){try{return decodeURIComponent(e)}catch(e){return String.fromCharCode(65533)}}r.prototype.encode=function(n){var t;return t="undefined"==typeof Uint8Array?e(n):new Uint8Array(e(n))},i.prototype.decode=function(e){return n(e,0,e.length)}}(),n.exports=function(e){e.TextEncoder=r,e.TextDecoder=i}},{}],4:[function(e,n,t){n.exports=function(n){e("./header")(n),n.File=function(e,t){this.header=t,this.binary=e,this.extractProperties=function(e){e||(e=this.binary),null!=e&&e.length>=this.header.def.length&&this.header.def.map.forEach(function(t){var r=e.slice(t.offset,t.offset+t.length),i=n.unpack(t.size,t.type,r);t.value=i})},this.buildProperties=function(e){var t=[];this.header.buildProperties(e),this.header.def.map.forEach(function(e){var r=n.pack(e.size,e.type,e.value);t.push(r)}),t=n.mergeBuffers(t)},this.extractProperties(e)},n.smpFile=function(e){return new n.File(e,new n.Header([["signature","a",9,"∢SMP0.2"],["size","N",1,""],["id","N",1,""],["from","a",32,""],["to","a",32,""],["channel","a",32,""],["command","n",1,""],["index","n",1,""],["split","n",1,""]]))},n.smpsFile=function(e){return new n.File(e,new n.Header([["signature","a",13,"ﷸSMPS0.2∢"],["size","N",1,""],["nonce","a",12,""],["cypher","a",135,""]]))},n.smpaFile=function(e){return new n.BaseFile(e,new n.Header([["signature","a",13,"ﷸSMPA0.2∢"],["size"