{"version":3,"sources":["jsdelivr-header.js","/npm/multipartish@0.1.1/lib/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,aAEA,IAAI,QAAU,OAId,SAAS,aAAa,GAClB,IAAI,EAAW,GAEf,GAAG,GAAQ,EAAK,SACZ,EAAW,EAAK,cAEhB,IAAK,IAAI,EAAI,EAAG,EAAI,GAAI,IACpB,GAAY,KAAK,MAAsB,GAAhB,KAAK,UAAe,SAAS,IAI5D,KAAK,QAAU,GACf,KAAK,gBAAiB,EACtB,KAAK,SAAW,CACpB,CAEA,SAAS,SAAS,GACX,EAAG,iBACF,EAAG,SAAW,KACd,EAAG,SAAW,EAAG,SACjB,EAAG,SAAW,QACd,EAAG,gBAAiB,EAE5B,CAEA,aAAa,UAAU,YAAc,SAAS,GAE1C,MAAO,cAAgB,GAAW,SAAW,cAAgB,KAAK,QACtE,EAEA,aAAa,UAAU,OAAS,SAAS,EAAQ,GAa7C,OAZA,SAAS,WAEI,IAAV,GACC,KAAK,SAAW,EAChB,KAAK,SAAW,KAChB,KAAK,SAAW,GAEhB,KAAK,SAAW,EAIpB,KAAK,SAAW,QACT,IACX,EAEA,aAAa,UAAU,KAAO,SAAS,GAOnC,OANA,SAAS,MAET,KAAK,SAAW,QAChB,KAAK,SAAW,EAChB,KAAK,SAAW,QAChB,KAAK,gBAAiB,EACf,IACX,EAEA,aAAa,UAAU,IAAM,WACzB,IAAI,EAAM,KAAK,QAWf,OATI,KAAK,iBAEL,GAAO,SAGX,GAAO,KACP,GAAO,KAAK,SACZ,GAAO,KACP,GAAO,OAEX,EAEA,OAAO,QAAU","file":"/npm/multipartish@0.1.1/lib/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/multipartish@0.1.1/lib/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","\"use strict\";\n\nvar newline = \"\\r\\n\"\n\n// available args:\n//     boundary\nfunction MultiPartish(args) {\n    var boundary = \"\"\n    // XXX: is this unique enough?, maybe we should use window.crypto or something\n    if(args && args.boundary) {\n        boundary = args.boundary;\n    } else {\n        for (var i = 0; i < 40; i++) {\n            boundary += Math.floor(Math.random() * 36).toString(36)\n        }\n    }\n\n    this._result = ''\n    this._need_boundray = true\n    this.boundary = boundary\n}\n\nfunction separate(mp) {\n    if(mp._need_boundray) {\n        mp._result += \"--\"\n        mp._result += mp.boundary\n        mp._result += newline\n        mp._need_boundray = false\n    }\n}\n\nMultiPartish.prototype.contentType = function(subtype) {\n    // https://www.w3.org/Protocols/rfc1341/7_2_Multipart.html\n    return \"multipart/\" + (subtype || \"mixed\") + \"; boundary=\" + this.boundary\n}\n\nMultiPartish.prototype.header = function(header, value) {\n    separate(this)\n\n    if(value !== undefined) {\n        this._result += header\n        this._result += \": \"\n        this._result += value\n    } else {\n        this._result += header\n    }\n\n\n    this._result += newline\n    return this\n}\n\nMultiPartish.prototype.part = function(text) {\n    separate(this)\n\n    this._result += newline\n    this._result += text\n    this._result += newline\n    this._need_boundray = true\n    return this\n}\n\nMultiPartish.prototype.get = function() {\n    var out = this._result\n\n    if(!this._need_boundray) {\n        // no body for last part, let's pretend it's empty\n        out += newline\n    }\n\n    out += \"--\"\n    out += this.boundary\n    out += \"--\"\n    out += newline\n    return out\n}\n\nmodule.exports = MultiPartish\n"]}