{"version":3,"sources":["webpack://TcVod/webpack/universalModuleDefinition","webpack://TcVod/webpack/bootstrap","webpack://TcVod/./src/tc_vod.ts","webpack://TcVod/./src/uploader.ts","webpack://TcVod/./node_modules/js-sha1/src/sha1.js","webpack://TcVod/./node_modules/process/browser.js","webpack://TcVod/(webpack)/buildin/global.js","webpack://TcVod/(webpack)/buildin/amd-options.js","webpack://TcVod/./node_modules/cos-js-sdk-v5/index.js","webpack://TcVod/./node_modules/cos-js-sdk-v5/src/cos.js","webpack://TcVod/./node_modules/cos-js-sdk-v5/src/util.js","webpack://TcVod/./node_modules/cos-js-sdk-v5/lib/md5.js","webpack://TcVod/./node_modules/cos-js-sdk-v5/lib/crypto.js","webpack://TcVod/./node_modules/cos-js-sdk-v5/lib/xml2json.js","webpack://TcVod/./node_modules/xmldom/dom-parser.js","webpack://TcVod/./node_modules/xmldom/sax.js","webpack://TcVod/./node_modules/xmldom/dom.js","webpack://TcVod/./node_modules/cos-js-sdk-v5/lib/json2xml.js","webpack://TcVod/./node_modules/cos-js-sdk-v5/src/event.js","webpack://TcVod/./node_modules/cos-js-sdk-v5/src/task.js","webpack://TcVod/./node_modules/cos-js-sdk-v5/src/session.js","webpack://TcVod/./node_modules/cos-js-sdk-v5/src/base.js","webpack://TcVod/./node_modules/cos-js-sdk-v5/lib/request.js","webpack://TcVod/./node_modules/cos-js-sdk-v5/src/advance.js","webpack://TcVod/./node_modules/cos-js-sdk-v5/src/async.js","webpack://TcVod/./node_modules/eventemitter3/index.js","webpack://TcVod/./node_modules/axios/index.js","webpack://TcVod/./node_modules/axios/lib/axios.js","webpack://TcVod/./node_modules/axios/lib/utils.js","webpack://TcVod/./node_modules/axios/lib/helpers/bind.js","webpack://TcVod/./node_modules/axios/lib/core/Axios.js","webpack://TcVod/./node_modules/axios/lib/helpers/buildURL.js","webpack://TcVod/./node_modules/axios/lib/core/InterceptorManager.js","webpack://TcVod/./node_modules/axios/lib/core/dispatchRequest.js","webpack://TcVod/./node_modules/axios/lib/core/transformData.js","webpack://TcVod/./node_modules/axios/lib/cancel/isCancel.js","webpack://TcVod/./node_modules/axios/lib/defaults.js","webpack://TcVod/./node_modules/axios/lib/helpers/normalizeHeaderName.js","webpack://TcVod/./node_modules/axios/lib/adapters/xhr.js","webpack://TcVod/./node_modules/axios/lib/core/settle.js","webpack://TcVod/./node_modules/axios/lib/core/createError.js","webpack://TcVod/./node_modules/axios/lib/core/enhanceError.js","webpack://TcVod/./node_modules/axios/lib/helpers/cookies.js","webpack://TcVod/./node_modules/axios/lib/core/buildFullPath.js","webpack://TcVod/./node_modules/axios/lib/helpers/isAbsoluteURL.js","webpack://TcVod/./node_modules/axios/lib/helpers/combineURLs.js","webpack://TcVod/./node_modules/axios/lib/helpers/parseHeaders.js","webpack://TcVod/./node_modules/axios/lib/helpers/isURLSameOrigin.js","webpack://TcVod/./node_modules/axios/lib/core/mergeConfig.js","webpack://TcVod/./node_modules/axios/lib/cancel/Cancel.js","webpack://TcVod/./node_modules/axios/lib/cancel/CancelToken.js","webpack://TcVod/./node_modules/axios/lib/helpers/spread.js","webpack://TcVod/./node_modules/axios/lib/helpers/isAxiosError.js","webpack://TcVod/./src/util.ts","webpack://TcVod/./src/vod_reporter.ts","webpack://TcVod/./node_modules/uuid/v4.js","webpack://TcVod/./node_modules/uuid/lib/rng-browser.js","webpack://TcVod/./node_modules/uuid/lib/bytesToUuid.js"],"names":["root","factory","exports","module","define","amd","window","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","params","allowReport","enableResume","this","getSignature","appId","reportId","upload","uploaderParams","uploader","initReporter","start","VodReporter","TcVod","UploaderEvent","sha1","COS","vodAxios","interceptors","response","use","error","isNaN","code","Promise","reject","sessionName","vodSessionKey","reqKey","uuidv4","applyRequestTimeout","applyRequestRetryCount","commitRequestTimeout","commitRequestRetryCount","retryDelay","validateInitParams","videoFile","mediaFile","videoName","mediaName","coverFile","fileId","cosAuthTime","genFileInfo","setStorage","cname","localStorage","setItem","e","getStorage","result","getItem","delStorage","removeItem","isFunction","Error","isFile","lastDotIndex","lastIndexOf","isString","test","substring","videoInfo","type","toLowerCase","size","coverName","coverLastDotIndex","coverInfo","applyUploadUGC","retryCount","whenError","err","Uploader","host","HOST","MAIN","BACKUP","self","emit","VodReportEvent","report_apply","requestStartTime","delay","signature","sendParams","videoType","videoSize","coverType","coverSize","Date","post","timeout","withCredentials","applyResult","data","applyData","message","uploadToCos","cosParam","bucket","storageBucket","storageAppId","region","storageRegionV5","cos","getAuthorization","options","callback","currentTimeStamp","getUnix","safeExpireTime","tempCertificate","expiredTime","timestamp","TmpSecretId","secretId","TmpSecretKey","secretKey","XCosSecurityToken","token","StartTime","ExpiredTime","uploadCosParams","cosVideoParam","file","video","storagePath","onProgress","video_progress","media_progress","onUpload","video_upload","media_upload","onTaskReady","taskId","push","cosCoverParam","cover","cover_progress","cover_upload","noop","uploadPromises","map","uploadCosParam","resolve","sliceUploadFile","Bucket","Region","Key","Body","report_cos_upload","JSON","stringify","all","commitUploadUGC","report_commit","commitResult","donePromise","_start","then","doneResult","report_done","catch","CLIENT_ERROR_CODE","UPLOAD_FAIL","done","cancel","cancelTask","EventEmitter","NODE_JS","JS_SHA1_NO_NODE_JS","process","versions","node","global","COMMON_JS","JS_SHA1_NO_COMMON_JS","AMD","HEX_CHARS","split","EXTRA","SHIFT","OUTPUT_TYPES","blocks","createOutputMethod","outputType","Sha1","update","createMethod","method","nodeWrap","length","crypto","eval","Buffer","nodeMethod","createHash","digest","constructor","ArrayBuffer","Uint8Array","undefined","sharedMemory","h0","h1","h2","h3","h4","block","bytes","hBytes","finalized","hashed","first","notString","index","charCodeAt","lastByteIndex","hash","finalize","j","a","b","hex","toString","array","arrayBuffer","buffer","dataView","DataView","setUint32","cachedSetTimeout","cachedClearTimeout","defaultSetTimout","defaultClearTimeout","runTimeout","fun","setTimeout","clearTimeout","currentQueue","queue","draining","queueIndex","cleanUpNextTick","concat","drainQueue","len","run","marker","runClearTimeout","Item","nextTick","args","Array","arguments","apply","title","browser","env","argv","version","on","addListener","once","off","removeListener","removeAllListeners","prependListener","prependOnceListener","listeners","binding","cwd","chdir","dir","umask","g","Function","__webpack_amd_options__","util","event","task","base","advance","defaultOptions","AppId","SecretId","SecretKey","ChunkRetryTimes","FileParallelLimit","ChunkParallelLimit","ChunkSize","SliceSize","CopyChunkParallelLimit","CopyChunkSize","CopySliceSize","MaxPartNumber","ProgressInterval","UploadQueueSize","Domain","ServiceDomain","Protocol","CompatibilityMode","ForcePathStyle","UseRawKey","Timeout","CorrectClockSkew","SystemClockOffset","UploadCheckContentMd5","UploadAddMetaMd5","UploadIdCacheLimit","extend","clone","Math","max","min","console","warn","init","getAuth","md5","CryptoJS","xml2json","json2xml","camSafeUrlEncode","str","encodeURIComponent","replace","ua","ChromeVersion","QBCoreVersion","QQBrowserVersion","compareVersion","clearKey","obj","retObj","fileSliceNeedCopy","parseInt","navigator","userAgent","match","v","target","source","each","val","isArray","arr","fn","formatParams","apiName","Headers","indexOf","paramKey","headerKey","getSkewTime","offset","now","apiWrapper","apiFn","formatResult","headers","VersionId","DeleteMarker","_callback","missingResult","hasMissingParams","substr","res","fileSlice","end","isUseToUpload","blob","slice","mozSlice","webkitSlice","reader","FileReader","onload","Blob","readAsArrayBuffer","getBodyMd5","getFileMd5","loaded","md5ctx","getCtx","next","chunk","readFun","fr","readAsBinaryString","fileData","binary","byteLength","String","fromCharCode","content","total","percent","round","binaryBase64","char","btoa","isInArray","item","flag","makeArray","filter","iaArr","uuid","S4","random","throttleOnProgress","time1","timer","size0","size1","time0","speed","info","immediately","getFileSize","api","ContentLength","opt","pathname","KeyTime","Method","queryParams","Query","Pathname","getObjectKeys","list","sort","obj2str","keyList","join","exp","Expires","expires","qAk","qSignTime","qKeyTime","qHeaderList","qUrlParamList","signKey","HmacSHA1","formatString","stringToSign","SHA1","isBrowser","md5cycle","x","k","ff","gg","hh","ii","add32","cmn","q","md5blk","md5blks","hex_chr","rhex","ctx","isBinStr","unescape","tail","state","encode","y","lsw","C","WordArray","lib","Base","mixIn","$super","words","sigBytes","f","clamp","ceil","enc","Hex","parse","Latin1","h","Utf8","decodeURIComponent","escape","BufferedBlockAlgorithm","reset","_data","_nDataBytes","_append","_process","blockSize","_minBufferSize","_doProcessBlock","splice","Hasher","cfg","_doReset","_doFinalize","_createHelper","_createHmacHelper","HMAC","algo","_hash","floor","_hasher","_oKey","_iKey","Base64","wordArray","_map","base64Chars","triplet","charAt","paddingChar","base64Str","base64StrLength","paddingIndex","nBytes","bits1","bits2","DOMParser","xmlToJSON","mergeCDATA","normalize","stripElemPrefix","prefixMatch","RegExp","grokType","sValue","isFinite","parseFloat","parseString","xmlString","xml","stringToXML","getElementsByTagName","parseXML","oXMLParent","vResult","nLength","sCollectedTxt","childNodes","oNode","sProp","vContent","nItem","nodeType","nodeValue","nodeName","keys","xmlToString","xmlDoc","XMLSerializer","serializeToString","parseFromString","ActiveXObject","async","loadXML","locator","DOMHandler","cdata","position","lineNumber","columnNumber","_locator","systemId","_toString","chars","java","lang","appendElement","hander","currentElement","appendChild","doc","mimeType","sax","XMLReader","domBuilder","errorHandler","defaultNSMap","xmlns","entityMap","setDocumentLocator","errorImpl","isCallback","build","msg","buildErrorHandler","nbsp","copy","startDocument","DOMImplementation","createDocument","documentURI","startElement","namespaceURI","localName","qName","attrs","el","createElementNS","getURI","getValue","attr","getQName","createAttributeNS","getLocator","setAttributeNode","endElement","current","tagName","parentNode","startPrefixMapping","prefix","uri","endPrefixMapping","processingInstruction","ins","createProcessingInstruction","ignorableWhitespace","ch","characters","charNode","createCDATASection","createTextNode","skippedEntity","endDocument","comment","comm","createComment","startCDATA","endCDATA","startDTD","publicId","impl","implementation","createDocumentType","dt","warning","fatalError","nameStartChar","nameChar","tagNamePattern","copyLocator","parseElementStartPart","currentNSMap","entityReplacer","attrName","add","setTagName","closed","localNSMap","nsp","nsPrefix","_copy","parseHtmlSpecialContent","elStartEnd","elEndStart","text","fixSelfClosed","closeMap","pos","parseDCC","matchs","buf","reg","lastIndex","exec","pubid","sysid","lastMatch","endDTD","parseInstruction","ElementAttributes","_set_proto_","thiz","parent","__proto__","defaultNSMapCopy","surrogate1","surrogate2","fixedFromCharCode","appendText","xt","lineEnd","linePattern","lineStart","parseStack","tagStart","config","pop","endMatch","locator2","getLocalName","src","dest","_extends","Class","Super","pt","ppt","NodeType","ELEMENT_NODE","ATTRIBUTE_NODE","TEXT_NODE","CDATA_SECTION_NODE","ENTITY_REFERENCE_NODE","ENTITY_NODE","PROCESSING_INSTRUCTION_NODE","COMMENT_NODE","DOCUMENT_NODE","DOCUMENT_TYPE_NODE","DOCUMENT_FRAGMENT_NODE","NOTATION_NODE","ExceptionCode","ExceptionMessage","HIERARCHY_REQUEST_ERR","INDEX_SIZE_ERR","DOMSTRING_SIZE_ERR","NOT_FOUND_ERR","WRONG_DOCUMENT_ERR","INVALID_CHARACTER_ERR","NO_DATA_ALLOWED_ERR","NO_MODIFICATION_ALLOWED_ERR","INUSE_ATTRIBUTE_ERR","NOT_SUPPORTED_ERR","INVALID_STATE_ERR","SYNTAX_ERR","INVALID_MODIFICATION_ERR","NAMESPACE_ERR","INVALID_ACCESS_ERR","DOMException","captureStackTrace","NodeList","LiveNodeList","refresh","_node","_refresh","_updateLiveList","inc","_inc","ownerDocument","ls","__set__","NamedNodeMap","_findNodeIndex","_addNamedNode","newAttr","oldAttr","ownerElement","_onRemoveAttribute","_nsMap","_onAddAttribute","_removeNamedNode","features","_features","feature","Node","_xmlEncoder","_visitNode","firstChild","nextSibling","Document","remove","_onUpdateChild","newChild","cs","child","_removeChild","previous","previousSibling","lastChild","_insertBefore","nextChild","cp","removeChild","newFirst","newLast","pre","Element","Attr","CharacterData","Text","Comment","CDATASection","DocumentType","Notation","Entity","EntityReference","DocumentFragment","ProcessingInstruction","nodeSerializeToString","isHtml","nodeFilter","refNode","documentElement","lookupPrefix","visibleNamespaces","namespace","needNamespaceDefine","isHTML","attributes","sub","internalSubset","getNamedItem","setNamedItem","_ownerElement","setNamedItemNS","getNamedItemNS","removeNamedItem","removeNamedItemNS","hasFeature","qualifiedName","doctype","insertBefore","refChild","replaceChild","oldChild","hasChildNodes","cloneNode","deep","node2","attrs2","appendData","isSupported","hasAttributes","lookupNamespaceURI","isDefaultNamespace","importNode","importedNode","getElementById","id","rtv","getAttribute","createElement","createDocumentFragment","createAttribute","specified","createEntityReference","pl","hasAttribute","getAttributeNode","setAttribute","removeAttribute","removeAttributeNode","_appendSingleChild","setAttributeNodeNS","removeAttributeNS","old","getAttributeNodeNS","hasAttributeNS","getAttributeNS","setAttributeNS","getElementsByTagNameNS","substringData","count","insertData","replaceData","deleteData","splitText","newText","newNode","$$length","getTextContent","set","element_replace","not_safe_in_xml","objKeys","process_to_xml","node_data","makeNode","level","hasSubNodes","indent_value","indent","prettyPrint","removeIllegalNameCharacters","node_descriptor","ret","toJSON","nodes","xml_header","standalone","xmlHeader","xmlheader","docType","initEvent","getList","action","cb","EventProxy","session","originApiMap","transferToTaskMethod","apiMap","SkipTask","_addTask","tasks","uploadingFileCount","nextUploadIndex","formatTask","FilePath","hashPercent","_custom","emitListUpdate","clearQueue","isActive","startNextTask","onTaskStart","UploadData","apiParams","_isRunningTask","killTask","switchToState","waiting","running","pipe","TaskId","toState","UploadId","removeUsing","_addTasks","taskList","isTaskReadyWarning","ignoreAddEvent","TaskReady","onHashProgress","getTaskList","pauseTask","restartTask","isUploadRunning","cache","cacheKey","changed","mtime","save","mod","using","setUsing","getFileId","lastModifiedDate","getUploadIdList","saveUploadId","limit","unshift","removeUploadId","REQUEST","decodeAcl","AccessControlPolicy","GrantFullControl","GrantWrite","GrantRead","GrantReadAcp","GrantWriteAcp","ACL","GrantMap","Grant","AccessControlList","PublicAcl","READ","WRITE","FULL_CONTROL","Grantee","ID","URI","Permission","Owner","uniqGrant","exist","trim","getUrl","longBucket","shortBucket","domain","protocol","location","url","isLocation","getAuthorizationAsync","AuthData","formatAllow","auth","Authorization","atob","KeyName","StsData","Scope","Action","ResourceKey","ScopeKey","_StsCache","compareTime","ScopeLimit","calcAuthByTmpKey","Token","ClientIP","ClientUA","getSTS","allowRetry","isTimeError","serverDate","date","ServerTime","errorCode","Code","errorMessage","Message","serverTime","abs","statusCode","submitRequest","qs","versionId","tryTimes","oldClockOffset","_submitRequest","body","json","rawBody","contentLength","sender","hasReturned","jsonRes","abort","API_MAP","getService","buckets","ListAllMyBucketsResult","Buckets","owner","putBucket","Location","headBucket","getBucket","reqParams","ListBucketResult","Contents","CommonPrefixes","deleteBucket","putBucketAcl","Grants","getBucketAcl","putBucketCors","CORSRules","rule","sKey","CORSConfiguration","CORSRule","getBucketCors","deleteBucketCors","getBucketLocation","getBucketPolicy","ErrorStatus","Policy","putBucketPolicy","PolicyStr","deleteBucketPolicy","putBucketTagging","Tagging","Tags","TagSet","Tag","getBucketTagging","deleteBucketTagging","putBucketLifecycle","Rules","LifecycleConfiguration","Rule","getBucketLifecycle","deleteBucketLifecycle","putBucketVersioning","VersioningConfiguration","getBucketVersioning","putBucketReplication","ReplicationConfiguration","getBucketReplication","deleteBucketReplication","putBucketWebsite","WebsiteConfiguration","RoutingRules","RoutingRule","getBucketWebsite","deleteBucketWebsite","getObject","NotModified","etag","ETag","headObject","listObjectVersions","ListVersionsResult","DeleteMarkers","Versions","Version","putObject","FileSize","ContentType","needCalcMd5","deleteObject","BucketNotFound","getObjectAcl","putObjectAcl","optionsObject","OptionsForbidden","AccessControlAllowOrigin","AccessControlAllowMethods","AccessControlAllowHeaders","AccessControlExposeHeaders","AccessControlMaxAge","putObjectCopy","CopySource","SourceBucket","SourceRegion","SourceKey","CopyObjectResult","deleteMultipleObject","Objects","Quiet","Delete","DeleteResult","Deleted","Errors","restoreObject","RestoreRequest","uploadPartCopy","partNumber","uploadId","CopyPartResult","multipartInit","InitiateMultipartUploadResult","multipartUpload","multipartComplete","Parts","CompleteMultipartUpload","Part","CompleteMultipartUploadResult","multipartList","ListMultipartUploadsResult","Upload","multipartListPart","ListPartsResult","multipartAbort","getObjectUrl","Sign","Url","toUpperCase","signUrl","proto","suffix","oldName","warned","warnOldApi","$","deletedIds","class2type","hasOwn","support","jQuery","selector","context","rtrim","rmsPrefix","rdashAlpha","fcamelCase","letter","isArraylike","isWindow","jquery","toArray","num","pushStack","elems","merge","prevObject","elem","eq","last","copyIsArray","isPlainObject","expando","isReady","isNumeric","isEmptyObject","ownLast","globalEval","execScript","camelCase","string","results","inArray","second","grep","invert","matches","callbackExpect","arg","guid","proxy","tmp","rootjQuery","document","rquickExpr","find","parseHTML","rsingleTag","ready","readyList","rnotwhite","optionsCache","detach","addEventListener","removeEventListener","completed","detachEvent","readyState","Callbacks","_","createOptions","firing","memory","fired","firingLength","firingIndex","firingStart","stack","fire","stopOnFalse","shift","disable","unique","has","empty","disabled","lock","locked","fireWith","Deferred","func","tuples","promise","always","deferred","fail","fns","newDefer","tuple","returned","progress","notify","stateString","when","subordinate","progressValues","progressContexts","resolveContexts","resolveValues","remaining","updateFunc","contexts","values","notifyWith","resolveWith","readyWait","holdReady","hold","wait","triggerHandler","attachEvent","top","frameElement","doScroll","doScrollCheck","inlineBlockNeedsLayout","div","container","style","cssText","zoom","offsetWidth","deleteExpando","acceptData","noData","rbrace","rmultiDash","dataAttr","parseJSON","isEmptyDataObject","internalData","pvt","thisCache","internalKey","isNode","internalRemoveData","cleanData","hasData","removeData","_removeData","dequeue","startLength","hooks","_queueHooks","stop","setter","defer","elements","types","handler","events","handleObjIn","special","eventHandle","handleObj","handlers","namespaces","origType","elemData","handle","triggered","dispatch","rtypenamespace","delegateType","bindType","needsContext","expr","delegateCount","setup","mappedTypes","origCount","teardown","removeEvent","trigger","onlyHandlers","ontype","cur","bubbleType","eventPath","rfocusMorph","Event","isTrigger","namespace_re","noBubble","defaultView","parentWindow","isPropagationStopped","preventDefault","isDefaultPrevented","_default","fix","matched","handlerQueue","delegateTarget","preDispatch","currentTarget","isImmediatePropagationStopped","stopPropagation","postDispatch","sel","button","prop","originalEvent","fixHook","fixHooks","rmouseEvent","mouseHooks","rkeyEvent","keyHooks","props","srcElement","metaKey","original","which","charCode","keyCode","eventDoc","fromElement","pageX","clientX","scrollLeft","clientLeft","pageY","clientY","scrollTop","clientTop","relatedTarget","toElement","load","focus","safeActiveElement","blur","click","beforeunload","returnValue","simulate","bubble","isSimulated","defaultPrevented","returnTrue","returnFalse","timeStamp","rformElems","cancelBubble","stopImmediatePropagation","submitBubbles","submit","form","_submit_bubble","changeBubbles","change","propertyName","_just_changed","focusinBubbles","orig","attaches","one","origFn","time","fx","speeds","nonce","rquery","rvalidtokens","requireNonComma","depth","comma","open","close","ajaxLocParts","ajaxLocation","rhash","rts","rheaders","rnoContent","rprotocol","rurl","prefilters","transports","allTypes","href","addToPrefiltersOrTransports","structure","dataTypeExpression","dataType","dataTypes","inspectPrefiltersOrTransports","originalOptions","jqXHR","inspected","seekingTransport","inspect","selected","prefilterOrFactory","dataTypeOrTransport","ajaxExtend","flatOptions","ajaxSettings","active","lastModified","isLocal","processData","contentType","accepts","html","contents","responseFields","converters","ajaxSetup","settings","ajaxPrefilter","ajaxTransport","ajax","parts","cacheURL","responseHeadersString","timeoutTimer","fireGlobals","transport","responseHeaders","callbackContext","globalEventContext","completeDeferred","requestHeaders","requestHeadersNames","strAbort","getResponseHeader","getAllResponseHeaders","setRequestHeader","lname","overrideMimeType","status","statusText","finalText","complete","success","crossDomain","param","traditional","hasContent","ifModified","beforeSend","send","nativeStatusText","responses","isSuccess","modified","firstDataType","ct","finalDataType","ajaxHandleResponses","conv2","conv","prev","dataFilter","ajaxConvert","rejectWith","getJSON","getScript","_evalUrl","r20","rbracket","rCRLF","rsubmitterTypes","rsubmittable","buildParams","serialize","serializeArray","is","checked","rcheckableType","xhr","createStandardXHR","createActiveXHR","xhrId","xhrCallbacks","xhrSupported","XMLHttpRequest","cors","username","password","xhrFields","onprogress","isAbort","onreadystatechange","responseText","script","head","scriptCharset","charset","oldCallbacks","rjsonp","jsonp","jsonpCallback","originalSettings","callbackName","overwritten","responseContainer","jsonProp","keepScripts","parsed","scripts","buildFragment","stringifyPrimitive","qsStr","sep","ks","Boolean","getResponse","forEach","statusMessage","Async","getUploadIdAndPartList","StorageClass","ETagMap","SliceCount","FinishSize","isAvailableUploadList","PartList","PartCount","Size","PartNumber","chunkItem","getChunkETag","ep","errData","Uploaded","_params","UploadIdList","reverse","eachLimit","asyncCallback","wholeMultipartListPart","PartListData","isAvailable","AvailableUploadData","RemoteUploadIdList","LocalUploadIdList","wholeMultipartList","UploadList","UploadID","Prefix","IsTruncated","KeyMarker","NextKeyMarker","UploadIdMarker","NextUploadIdMarker","PartNumberMarker","NextPartNumberMarker","uploadSliceList","ChunkParallel","AsyncLimit","ServerSideEncryption","needUploadSlices","SliceItem","currentSize","preAddSize","uploadSliceItem","SliceList","FileBody","PartItem","retry","tryCallback","uploadSliceComplete","abortUploadTaskArray","AbortArray","resultList","AbortItem","eachIndex","KeyNotMatch","successList","errorList","copySliceItem","CopySourceRange","UploadCompleteData","SIZE","AutoChunkSize","abortUploadTask","Level","uploadFiles","TotalSize","TotalFinish","onTotalProgress","unFinishCount","files","_onTotalFileFinish","onFileFinish","onTotalFileFinish","Index","fileParams","fileInfo","_onTaskReady","tid","PreAddSize","_onProgress","_onFileFinish","sliceCopyFile","SourceHeaders","TargetHeader","ChunkCount","restoreHeader","resHeaders","iterator","started","replenish","times","Events","EE","emitter","TypeError","listener","evt","_events","_eventsCount","clearEvent","eventNames","names","getOwnPropertySymbols","ee","listenerCount","a1","a2","a3","a4","a5","prefixed","utils","Axios","mergeConfig","createInstance","defaultConfig","instance","request","axios","instanceConfig","defaults","Cancel","CancelToken","isCancel","promises","spread","isAxiosError","default","isUndefined","isObject","getPrototypeOf","isArrayBuffer","isBuffer","isFormData","FormData","isArrayBufferView","isView","isNumber","isDate","isBlob","isStream","isURLSearchParams","URLSearchParams","isStandardBrowserEnv","product","assignValue","thisArg","stripBOM","buildURL","InterceptorManager","dispatchRequest","chain","interceptor","fulfilled","rejected","getUri","paramsSerializer","serializedParams","toISOString","hashmarkIndex","eject","transformData","throwIfCancellationRequested","cancelToken","throwIfRequested","transformRequest","common","adapter","transformResponse","reason","__CANCEL__","normalizeHeaderName","DEFAULT_CONTENT_TYPE","setContentTypeIfUnset","xsrfCookieName","xsrfHeaderName","maxContentLength","maxBodyLength","validateStatus","normalizedName","settle","cookies","buildFullPath","parseHeaders","isURLSameOrigin","createError","requestData","fullPath","baseURL","responseURL","responseType","onabort","onerror","ontimeout","timeoutErrorMessage","xsrfValue","read","onDownloadProgress","onUploadProgress","enhanceError","description","number","fileName","write","path","secure","cookie","toGMTString","isAbsoluteURL","combineURLs","requestedURL","relativeURL","ignoreDuplicateOf","line","originURL","msie","urlParsingNode","resolveURL","search","hostname","port","requestURL","config1","config2","valueFromConfig2Keys","mergeDeepPropertiesKeys","defaultToConfig2Keys","directMergeKeys","getMergedValue","mergeDeepProperties","axiosKeys","otherKeys","executor","resolvePromise","payload","ms","isTest","isDev","ReqType","baseReportData","pkg","platform","device","reportUrl","onApply","onCosUpload","onCommit","onDone","reportObj","assign","fileSize","fileType","customReportData","reqType","errCode","vodErrCode","errMsg","reqTimeCost","Number","reqTime","cosRegion","report","cos_upload","cosErrCode","commit","reportData","log","rng","bytesToUuid","rnds","getRandomValues","msCrypto","rnds8","byteToHex","bth"],"mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAe,MAAID,IAEnBD,EAAY,MAAIC,IARlB,CASGK,QAAQ,WACX,O,YCTE,IAAIC,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUP,QAGnC,IAAIC,EAASI,EAAiBE,GAAY,CACzCC,E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81D,EAAI7pC,EAAIjsB,MAAO81D,EAAI7pC,EAAIjsB,MAAO,IAC9B81D,EAAI7pC,EAAIjsB,MAAO81D,EAAI7pC,EAAIjsB,MAAO,IAC9B81D,EAAI7pC,EAAIjsB,MAAO81D,EAAI7pC,EAAIjsB,MAAO,IAC9B81D,EAAI7pC,EAAIjsB,MAAO81D,EAAI7pC,EAAIjsB,MAAO,IAC9B81D,EAAI7pC,EAAIjsB,MAAO81D,EAAI7pC,EAAIjsB,MACvB81D,EAAI7pC,EAAIjsB,MAAO81D,EAAI7pC,EAAIjsB,MACvB81D,EAAI7pC,EAAIjsB,MAAO81D,EAAI7pC,EAAIjsB,OACtBod,KAAK","file":"vod-js-sdk-v6.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"TcVod\"] = factory();\n\telse\n\t\troot[\"TcVod\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","import Uploader, { IGetSignature, UploaderOptions } from \"./uploader\";\nimport { VodReporter } from \"./vod_reporter\";\n\ninterface TcVodParams {\n getSignature: IGetSignature;\n allowReport?: boolean;\n appId?: number;\n reportId?: string;\n enableResume?: boolean;\n}\nclass TcVod {\n getSignature: IGetSignature;\n allowReport = true; // report sdk status to tencent cloud\n appId: number;\n reportId: string;\n enableResume = true; // resume uploading from break point\n constructor(params: TcVodParams) {\n this.getSignature = params.getSignature;\n if (params.allowReport !== void 0) {\n this.allowReport = params.allowReport;\n }\n if (params.enableResume !== void 0) {\n this.enableResume = params.enableResume;\n }\n this.appId = params.appId;\n this.reportId = params.reportId;\n }\n\n upload(params: Omit): Uploader {\n const uploaderParams = {\n getSignature: this.getSignature,\n appId: this.appId,\n reportId: this.reportId,\n enableResume: this.enableResume,\n ...params\n };\n const uploader = new Uploader(uploaderParams);\n if (this.allowReport) {\n this.initReporter(uploader);\n }\n uploader.start();\n return uploader;\n }\n\n // report to official report system\n initReporter(uploader: Uploader): void {\n new VodReporter(uploader);\n }\n}\n\nexport default TcVod;\n","const sha1 = require(\"js-sha1\");\nconst COS = require(\"cos-js-sdk-v5\");\n\nimport { EventEmitter } from \"eventemitter3\";\nimport axios from \"axios\";\nimport util, { HOST } from \"./util\";\nimport { vodError } from \"./types\";\nimport { VodReportEvent } from \"./vod_reporter\";\nimport * as uuidv4 from \"uuid/v4\";\n\nexport const vodAxios = axios.create();\n\nvodAxios.interceptors.response.use(\n function(response) {\n return response;\n },\n function(error) {\n if (isNaN(error.code)) {\n error.code = 500;\n }\n return Promise.reject(error);\n }\n);\n\nexport type IGetSignature = () => Promise;\nexport interface TcVodFileInfo {\n name: string;\n type: string;\n size: number;\n}\n\nexport enum UploaderEvent {\n video_progress = \"video_progress\",\n media_progress = \"media_progress\",\n\n video_upload = \"video_upload\",\n media_upload = \"media_upload\",\n\n cover_progress = \"cover_progress\",\n cover_upload = \"cover_upload\"\n}\n\ninterface IApplyUpload {\n signature: string;\n vodSessionKey?: string;\n\n videoName?: string;\n videoType?: string;\n videoSize?: number;\n\n coverName?: string;\n coverType?: string;\n coverSize?: number;\n\n fileId?: string;\n}\n\ninterface IApplyData {\n video: {\n storageSignature: string;\n storagePath: string;\n };\n cover?: {\n storageSignature: string;\n storagePath: string;\n };\n storageAppId: number;\n storageBucket: string;\n storageRegion: string;\n storageRegionV5: string;\n domain: string;\n vodSessionKey: string;\n tempCertificate: {\n secretId: string;\n secretKey: string;\n token: string;\n expiredTime: number;\n };\n appId: number;\n timestamp: number;\n StorageRegionV5: string;\n}\n\nexport interface UploaderOptions {\n getSignature: IGetSignature;\n\n videoFile?: File;\n mediaFile?: File;\n coverFile?: File;\n\n videoName?: string;\n mediaName?: string;\n fileId?: string;\n\n appId?: number;\n reportId?: string;\n\n applyRequestTimeout?: number;\n commitRequestTimeout?: number;\n retryDelay?: number;\n\n enableResume?: boolean;\n}\n\nclass Uploader extends EventEmitter implements UploaderOptions {\n getSignature: IGetSignature;\n videoFile: File;\n videoInfo: TcVodFileInfo;\n coverFile: File;\n coverInfo: TcVodFileInfo;\n\n cos: any;\n taskId: string;\n cosAuthTime: number;\n\n videoName: string;\n sessionName: string = \"\";\n vodSessionKey: string = \"\";\n appId: number = 0;\n fileId: string;\n\n reqKey: string = uuidv4();\n reportId: string = \"\";\n\n // resume from break point\n enableResume: boolean = true;\n\n donePromise: Promise;\n\n // apply 请求的超时时间\n applyRequestTimeout = 5000;\n applyRequestRetryCount = 3;\n\n // commit 请求的超时时间\n commitRequestTimeout = 5000;\n commitRequestRetryCount = 3;\n\n // 重试请求的等待时间\n retryDelay = 1000;\n\n // domain\n static host = HOST.MAIN;\n\n constructor(params: UploaderOptions) {\n super();\n this.validateInitParams(params);\n\n this.videoFile = params.mediaFile || params.videoFile;\n this.getSignature = params.getSignature;\n\n this.enableResume = params.enableResume;\n this.videoName = params.mediaName || params.videoName;\n this.coverFile = params.coverFile;\n this.fileId = params.fileId;\n\n this.applyRequestTimeout =\n params.applyRequestTimeout || this.applyRequestTimeout;\n this.commitRequestTimeout =\n params.commitRequestTimeout || this.commitRequestTimeout;\n this.retryDelay = params.retryDelay || this.retryDelay;\n\n // custom report metrics\n this.appId = params.appId || this.appId;\n this.reportId = params.reportId || this.reportId;\n\n this.cosAuthTime = 0;\n this.genFileInfo();\n }\n\n // set storage\n setStorage(name: string, value: string): void {\n if (!name) {\n return;\n }\n\n const cname = \"webugc_\" + sha1(name);\n try {\n localStorage.setItem(cname, value);\n } catch (e) {}\n }\n\n // get storage\n getStorage(name: string): string {\n if (!name) {\n return;\n }\n const cname = \"webugc_\" + sha1(name);\n let result = null;\n try {\n result = localStorage.getItem(cname);\n } catch (e) {}\n\n return result;\n }\n\n // delete storage\n delStorage(name: string): void {\n if (!name) {\n return;\n }\n const cname = \"webugc_\" + sha1(name);\n try {\n localStorage.removeItem(cname);\n } catch (e) {}\n }\n\n // validate init params\n validateInitParams(params: UploaderOptions): void {\n if (!util.isFunction(params.getSignature)) {\n throw new Error(\"getSignature must be a function\");\n }\n if (params.videoFile && !util.isFile(params.videoFile)) {\n throw new Error(\"videoFile must be a File\");\n }\n }\n\n genFileInfo(): void {\n // video file info\n const videoFile = this.videoFile;\n if (videoFile) {\n const lastDotIndex = videoFile.name.lastIndexOf(\".\");\n let videoName = \"\";\n // if specified, use it.\n if (this.videoName) {\n if (!util.isString(this.videoName)) {\n throw new Error(\"mediaName must be a string\");\n } else if (/[:*?<>\\\"\\\\/|]/g.test(this.videoName)) {\n throw new Error(\n 'Cant use these chars in filename: \\\\ / : * ? \" < > |'\n );\n } else {\n videoName = this.videoName;\n }\n } else {\n // else use the meta info of file\n videoName = videoFile.name.substring(0, lastDotIndex);\n }\n this.videoInfo = {\n name: videoName,\n type: videoFile.name.substring(lastDotIndex + 1).toLowerCase(),\n size: videoFile.size\n };\n this.sessionName += `${videoFile.name}_${videoFile.size};`;\n }\n\n // cover file info\n const coverFile = this.coverFile;\n if (coverFile) {\n const coverName = coverFile.name;\n const coverLastDotIndex = coverName.lastIndexOf(\".\");\n this.coverInfo = {\n name: coverName.substring(0, coverLastDotIndex),\n type: coverName.substring(coverLastDotIndex + 1).toLowerCase(),\n size: coverFile.size\n };\n this.sessionName += `${coverFile.name}_${coverFile.size};`;\n }\n }\n\n async applyUploadUGC(retryCount: number = 0): Promise {\n const self = this;\n\n const signature = await this.getSignature();\n\n let sendParams: IApplyUpload;\n const videoInfo = this.videoInfo;\n const coverInfo = this.coverInfo;\n const vodSessionKey =\n this.vodSessionKey ||\n (this.enableResume && this.getStorage(this.sessionName));\n\n // resume from break point\n if (vodSessionKey) {\n sendParams = {\n signature: signature,\n vodSessionKey: vodSessionKey\n };\n } else if (videoInfo) {\n sendParams = {\n signature: signature,\n videoName: videoInfo.name,\n videoType: videoInfo.type,\n videoSize: videoInfo.size\n };\n if (coverInfo) {\n // upload video together with cover\n sendParams.coverName = coverInfo.name;\n sendParams.coverType = coverInfo.type;\n sendParams.coverSize = coverInfo.size;\n }\n } else if (this.fileId && coverInfo) {\n // alter cover\n sendParams = {\n signature: signature,\n fileId: this.fileId,\n coverName: coverInfo.name,\n coverType: coverInfo.type,\n coverSize: coverInfo.size\n };\n } else {\n throw \"Wrong params, please check and try again\";\n }\n const requestStartTime = new Date();\n\n async function whenError(err?: vodError): Promise {\n if (err.code === 500) {\n Uploader.host = Uploader.host === HOST.MAIN ? HOST.BACKUP : HOST.MAIN;\n }\n self.emit(VodReportEvent.report_apply, {\n err: err,\n requestStartTime: requestStartTime\n });\n self.delStorage(self.sessionName);\n if (self.applyRequestRetryCount == retryCount) {\n if (err) {\n throw err;\n }\n throw new Error(`apply upload failed`);\n }\n await util.delay(self.retryDelay);\n return self.applyUploadUGC(retryCount + 1);\n }\n\n let response;\n try {\n response = await vodAxios.post(\n `https://${Uploader.host}/v3/index.php?Action=ApplyUploadUGC`,\n sendParams,\n {\n timeout: this.applyRequestTimeout,\n withCredentials: false\n }\n );\n } catch (e) {\n return whenError(e);\n }\n\n const applyResult = response.data;\n\n // all err code https://user-images.githubusercontent.com/1147375/51222454-bf6ef280-1978-11e9-8e33-1b0fdb2fe200.png\n if (applyResult.code == 0) {\n const applyData = applyResult.data as IApplyData;\n const vodSessionKey = applyData.vodSessionKey;\n this.setStorage(this.sessionName, vodSessionKey);\n this.vodSessionKey = vodSessionKey;\n this.appId = applyData.appId;\n\n this.emit(VodReportEvent.report_apply, {\n data: applyData,\n requestStartTime: requestStartTime\n });\n return applyData;\n } else {\n // return the apply result error info\n const err: vodError = new Error(applyResult.message);\n err.code = applyResult.code;\n\n return whenError(err);\n }\n }\n\n async uploadToCos(applyData: IApplyData) {\n const self = this;\n\n const cosParam = {\n bucket: applyData.storageBucket + \"-\" + applyData.storageAppId,\n region: applyData.storageRegionV5\n };\n\n const cos = new COS({\n getAuthorization: async function(options: object, callback: Function) {\n const currentTimeStamp = util.getUnix();\n const safeExpireTime =\n (applyData.tempCertificate.expiredTime - applyData.timestamp) * 0.9;\n if (self.cosAuthTime === 0) {\n self.cosAuthTime = currentTimeStamp;\n } else if (\n self.cosAuthTime &&\n currentTimeStamp - self.cosAuthTime >= safeExpireTime\n ) {\n applyData = await self.applyUploadUGC();\n self.cosAuthTime = util.getUnix();\n }\n\n callback({\n TmpSecretId: applyData.tempCertificate.secretId,\n TmpSecretKey: applyData.tempCertificate.secretKey,\n XCosSecurityToken: applyData.tempCertificate.token,\n StartTime: applyData.timestamp,\n ExpiredTime: applyData.tempCertificate.expiredTime\n });\n }\n });\n this.cos = cos;\n\n const uploadCosParams = [];\n\n if (this.videoFile) {\n const cosVideoParam = {\n ...cosParam,\n file: this.videoFile,\n key: applyData.video.storagePath,\n onProgress: function(data: any) {\n self.emit(UploaderEvent.video_progress, data);\n self.emit(UploaderEvent.media_progress, data);\n },\n onUpload: function(data: any) {\n self.emit(UploaderEvent.video_upload, data);\n self.emit(UploaderEvent.media_upload, data);\n },\n onTaskReady: function(taskId: string) {\n self.taskId = taskId;\n }\n };\n uploadCosParams.push(cosVideoParam);\n }\n\n if (this.coverFile) {\n const cosCoverParam = {\n ...cosParam,\n file: this.coverFile,\n key: applyData.cover.storagePath,\n onProgress: function(data: any) {\n self.emit(UploaderEvent.cover_progress, data);\n },\n onUpload: function(data: any) {\n self.emit(UploaderEvent.cover_upload, data);\n },\n onTaskReady: util.noop\n };\n uploadCosParams.push(cosCoverParam);\n }\n const requestStartTime = new Date();\n const uploadPromises = uploadCosParams.map(uploadCosParam => {\n return new Promise(function(resolve, reject) {\n cos.sliceUploadFile(\n {\n Bucket: uploadCosParam.bucket,\n Region: uploadCosParam.region,\n Key: uploadCosParam.key,\n Body: uploadCosParam.file,\n onTaskReady: uploadCosParam.onTaskReady,\n onProgress: uploadCosParam.onProgress\n },\n function(err: any, data: any) {\n // only report video file\n if (uploadCosParam.file === self.videoFile) {\n self.emit(VodReportEvent.report_cos_upload, {\n err: err,\n requestStartTime: requestStartTime\n });\n }\n if (!err) {\n uploadCosParam.onUpload(data);\n return resolve();\n }\n self.delStorage(self.sessionName);\n if (JSON.stringify(err) === '{\"error\":\"error\",\"headers\":{}}') {\n return reject(new Error(\"cors error\"));\n }\n reject(err);\n }\n );\n });\n });\n\n return await Promise.all(uploadPromises);\n }\n\n async commitUploadUGC(retryCount: number = 0) {\n const self = this;\n\n const signature = await this.getSignature();\n this.delStorage(this.sessionName);\n const vodSessionKey = this.vodSessionKey;\n\n const requestStartTime = new Date();\n async function whenError(err?: vodError): Promise {\n if (err.code === 500) {\n Uploader.host = Uploader.host === HOST.MAIN ? HOST.BACKUP : HOST.MAIN;\n }\n self.emit(VodReportEvent.report_commit, {\n err: err,\n requestStartTime: requestStartTime\n });\n if (self.commitRequestRetryCount == retryCount) {\n if (err) {\n throw err;\n }\n throw new Error(\"commit upload failed\");\n }\n await util.delay(self.retryDelay);\n return self.commitUploadUGC(retryCount + 1);\n }\n\n let response;\n try {\n response = await vodAxios.post(\n `https://${Uploader.host}/v3/index.php?Action=CommitUploadUGC`,\n {\n signature: signature,\n vodSessionKey: vodSessionKey\n },\n {\n timeout: this.commitRequestTimeout,\n withCredentials: false\n }\n );\n } catch (e) {\n return whenError(e);\n }\n\n const commitResult = response.data;\n\n if (commitResult.code == 0) {\n this.emit(VodReportEvent.report_commit, {\n data: commitResult.data,\n requestStartTime: requestStartTime\n });\n return commitResult.data;\n } else {\n const err: vodError = new Error(commitResult.message);\n err.code = commitResult.code;\n return whenError(err);\n }\n }\n\n start() {\n const requestStartTime = new Date();\n\n this.donePromise = this._start()\n .then(doneResult => {\n this.emit(VodReportEvent.report_done, {\n err: { code: 0 },\n requestStartTime: requestStartTime\n });\n return doneResult;\n })\n .catch(err => {\n this.emit(VodReportEvent.report_done, {\n err: {\n code: (err && err.code) || util.CLIENT_ERROR_CODE.UPLOAD_FAIL\n },\n requestStartTime: requestStartTime\n });\n throw err;\n });\n }\n\n async _start() {\n const applyData = await this.applyUploadUGC();\n\n await this.uploadToCos(applyData);\n\n return await this.commitUploadUGC();\n }\n\n done() {\n return this.donePromise;\n }\n\n cancel() {\n this.cos.cancelTask(this.taskId);\n }\n}\n\nexport default Uploader;\n","/*\n * [js-sha1]{@link https://github.com/emn178/js-sha1}\n *\n * @version 0.6.0\n * @author Chen, Yi-Cyuan [emn178@gmail.com]\n * @copyright Chen, Yi-Cyuan 2014-2017\n * @license MIT\n */\n/*jslint bitwise: true */\n(function() {\n 'use strict';\n\n var root = typeof window === 'object' ? window : {};\n var NODE_JS = !root.JS_SHA1_NO_NODE_JS && typeof process === 'object' && process.versions && process.versions.node;\n if (NODE_JS) {\n root = global;\n }\n var COMMON_JS = !root.JS_SHA1_NO_COMMON_JS && typeof module === 'object' && module.exports;\n var AMD = typeof define === 'function' && define.amd;\n var HEX_CHARS = '0123456789abcdef'.split('');\n var EXTRA = [-2147483648, 8388608, 32768, 128];\n var SHIFT = [24, 16, 8, 0];\n var OUTPUT_TYPES = ['hex', 'array', 'digest', 'arrayBuffer'];\n\n var blocks = [];\n\n var createOutputMethod = function (outputType) {\n return function (message) {\n return new Sha1(true).update(message)[outputType]();\n };\n };\n\n var createMethod = function () {\n var method = createOutputMethod('hex');\n if (NODE_JS) {\n method = nodeWrap(method);\n }\n method.create = function () {\n return new Sha1();\n };\n method.update = function (message) {\n return method.create().update(message);\n };\n for (var i = 0; i < OUTPUT_TYPES.length; ++i) {\n var type = OUTPUT_TYPES[i];\n method[type] = createOutputMethod(type);\n }\n return method;\n };\n\n var nodeWrap = function (method) {\n var crypto = eval(\"require('crypto')\");\n var Buffer = eval(\"require('buffer').Buffer\");\n var nodeMethod = function (message) {\n if (typeof message === 'string') {\n return crypto.createHash('sha1').update(message, 'utf8').digest('hex');\n } else if (message.constructor === ArrayBuffer) {\n message = new Uint8Array(message);\n } else if (message.length === undefined) {\n return method(message);\n }\n return crypto.createHash('sha1').update(new Buffer(message)).digest('hex');\n };\n return nodeMethod;\n };\n\n function Sha1(sharedMemory) {\n if (sharedMemory) {\n blocks[0] = blocks[16] = blocks[1] = blocks[2] = blocks[3] =\n blocks[4] = blocks[5] = blocks[6] = blocks[7] =\n blocks[8] = blocks[9] = blocks[10] = blocks[11] =\n blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;\n this.blocks = blocks;\n } else {\n this.blocks = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\n }\n\n this.h0 = 0x67452301;\n this.h1 = 0xEFCDAB89;\n this.h2 = 0x98BADCFE;\n this.h3 = 0x10325476;\n this.h4 = 0xC3D2E1F0;\n\n this.block = this.start = this.bytes = this.hBytes = 0;\n this.finalized = this.hashed = false;\n this.first = true;\n }\n\n Sha1.prototype.update = function (message) {\n if (this.finalized) {\n return;\n }\n var notString = typeof(message) !== 'string';\n if (notString && message.constructor === root.ArrayBuffer) {\n message = new Uint8Array(message);\n }\n var code, index = 0, i, length = message.length || 0, blocks = this.blocks;\n\n while (index < length) {\n if (this.hashed) {\n this.hashed = false;\n blocks[0] = this.block;\n blocks[16] = blocks[1] = blocks[2] = blocks[3] =\n blocks[4] = blocks[5] = blocks[6] = blocks[7] =\n blocks[8] = blocks[9] = blocks[10] = blocks[11] =\n blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;\n }\n\n if(notString) {\n for (i = this.start; index < length && i < 64; ++index) {\n blocks[i >> 2] |= message[index] << SHIFT[i++ & 3];\n }\n } else {\n for (i = this.start; index < length && i < 64; ++index) {\n code = message.charCodeAt(index);\n if (code < 0x80) {\n blocks[i >> 2] |= code << SHIFT[i++ & 3];\n } else if (code < 0x800) {\n blocks[i >> 2] |= (0xc0 | (code >> 6)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\n } else if (code < 0xd800 || code >= 0xe000) {\n blocks[i >> 2] |= (0xe0 | (code >> 12)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\n } else {\n code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff));\n blocks[i >> 2] |= (0xf0 | (code >> 18)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | ((code >> 12) & 0x3f)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\n }\n }\n }\n\n this.lastByteIndex = i;\n this.bytes += i - this.start;\n if (i >= 64) {\n this.block = blocks[16];\n this.start = i - 64;\n this.hash();\n this.hashed = true;\n } else {\n this.start = i;\n }\n }\n if (this.bytes > 4294967295) {\n this.hBytes += this.bytes / 4294967296 << 0;\n this.bytes = this.bytes % 4294967296;\n }\n return this;\n };\n\n Sha1.prototype.finalize = function () {\n if (this.finalized) {\n return;\n }\n this.finalized = true;\n var blocks = this.blocks, i = this.lastByteIndex;\n blocks[16] = this.block;\n blocks[i >> 2] |= EXTRA[i & 3];\n this.block = blocks[16];\n if (i >= 56) {\n if (!this.hashed) {\n this.hash();\n }\n blocks[0] = this.block;\n blocks[16] = blocks[1] = blocks[2] = blocks[3] =\n blocks[4] = blocks[5] = blocks[6] = blocks[7] =\n blocks[8] = blocks[9] = blocks[10] = blocks[11] =\n blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;\n }\n blocks[14] = this.hBytes << 3 | this.bytes >>> 29;\n blocks[15] = this.bytes << 3;\n this.hash();\n };\n\n Sha1.prototype.hash = function () {\n var a = this.h0, b = this.h1, c = this.h2, d = this.h3, e = this.h4;\n var f, j, t, blocks = this.blocks;\n\n for(j = 16; j < 80; ++j) {\n t = blocks[j - 3] ^ blocks[j - 8] ^ blocks[j - 14] ^ blocks[j - 16];\n blocks[j] = (t << 1) | (t >>> 31);\n }\n\n for(j = 0; j < 20; j += 5) {\n f = (b & c) | ((~b) & d);\n t = (a << 5) | (a >>> 27);\n e = t + f + e + 1518500249 + blocks[j] << 0;\n b = (b << 30) | (b >>> 2);\n\n f = (a & b) | ((~a) & c);\n t = (e << 5) | (e >>> 27);\n d = t + f + d + 1518500249 + blocks[j + 1] << 0;\n a = (a << 30) | (a >>> 2);\n\n f = (e & a) | ((~e) & b);\n t = (d << 5) | (d >>> 27);\n c = t + f + c + 1518500249 + blocks[j + 2] << 0;\n e = (e << 30) | (e >>> 2);\n\n f = (d & e) | ((~d) & a);\n t = (c << 5) | (c >>> 27);\n b = t + f + b + 1518500249 + blocks[j + 3] << 0;\n d = (d << 30) | (d >>> 2);\n\n f = (c & d) | ((~c) & e);\n t = (b << 5) | (b >>> 27);\n a = t + f + a + 1518500249 + blocks[j + 4] << 0;\n c = (c << 30) | (c >>> 2);\n }\n\n for(; j < 40; j += 5) {\n f = b ^ c ^ d;\n t = (a << 5) | (a >>> 27);\n e = t + f + e + 1859775393 + blocks[j] << 0;\n b = (b << 30) | (b >>> 2);\n\n f = a ^ b ^ c;\n t = (e << 5) | (e >>> 27);\n d = t + f + d + 1859775393 + blocks[j + 1] << 0;\n a = (a << 30) | (a >>> 2);\n\n f = e ^ a ^ b;\n t = (d << 5) | (d >>> 27);\n c = t + f + c + 1859775393 + blocks[j + 2] << 0;\n e = (e << 30) | (e >>> 2);\n\n f = d ^ e ^ a;\n t = (c << 5) | (c >>> 27);\n b = t + f + b + 1859775393 + blocks[j + 3] << 0;\n d = (d << 30) | (d >>> 2);\n\n f = c ^ d ^ e;\n t = (b << 5) | (b >>> 27);\n a = t + f + a + 1859775393 + blocks[j + 4] << 0;\n c = (c << 30) | (c >>> 2);\n }\n\n for(; j < 60; j += 5) {\n f = (b & c) | (b & d) | (c & d);\n t = (a << 5) | (a >>> 27);\n e = t + f + e - 1894007588 + blocks[j] << 0;\n b = (b << 30) | (b >>> 2);\n\n f = (a & b) | (a & c) | (b & c);\n t = (e << 5) | (e >>> 27);\n d = t + f + d - 1894007588 + blocks[j + 1] << 0;\n a = (a << 30) | (a >>> 2);\n\n f = (e & a) | (e & b) | (a & b);\n t = (d << 5) | (d >>> 27);\n c = t + f + c - 1894007588 + blocks[j + 2] << 0;\n e = (e << 30) | (e >>> 2);\n\n f = (d & e) | (d & a) | (e & a);\n t = (c << 5) | (c >>> 27);\n b = t + f + b - 1894007588 + blocks[j + 3] << 0;\n d = (d << 30) | (d >>> 2);\n\n f = (c & d) | (c & e) | (d & e);\n t = (b << 5) | (b >>> 27);\n a = t + f + a - 1894007588 + blocks[j + 4] << 0;\n c = (c << 30) | (c >>> 2);\n }\n\n for(; j < 80; j += 5) {\n f = b ^ c ^ d;\n t = (a << 5) | (a >>> 27);\n e = t + f + e - 899497514 + blocks[j] << 0;\n b = (b << 30) | (b >>> 2);\n\n f = a ^ b ^ c;\n t = (e << 5) | (e >>> 27);\n d = t + f + d - 899497514 + blocks[j + 1] << 0;\n a = (a << 30) | (a >>> 2);\n\n f = e ^ a ^ b;\n t = (d << 5) | (d >>> 27);\n c = t + f + c - 899497514 + blocks[j + 2] << 0;\n e = (e << 30) | (e >>> 2);\n\n f = d ^ e ^ a;\n t = (c << 5) | (c >>> 27);\n b = t + f + b - 899497514 + blocks[j + 3] << 0;\n d = (d << 30) | (d >>> 2);\n\n f = c ^ d ^ e;\n t = (b << 5) | (b >>> 27);\n a = t + f + a - 899497514 + blocks[j + 4] << 0;\n c = (c << 30) | (c >>> 2);\n }\n\n this.h0 = this.h0 + a << 0;\n this.h1 = this.h1 + b << 0;\n this.h2 = this.h2 + c << 0;\n this.h3 = this.h3 + d << 0;\n this.h4 = this.h4 + e << 0;\n };\n\n Sha1.prototype.hex = function () {\n this.finalize();\n\n var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3, h4 = this.h4;\n\n return HEX_CHARS[(h0 >> 28) & 0x0F] + HEX_CHARS[(h0 >> 24) & 0x0F] +\n HEX_CHARS[(h0 >> 20) & 0x0F] + HEX_CHARS[(h0 >> 16) & 0x0F] +\n HEX_CHARS[(h0 >> 12) & 0x0F] + HEX_CHARS[(h0 >> 8) & 0x0F] +\n HEX_CHARS[(h0 >> 4) & 0x0F] + HEX_CHARS[h0 & 0x0F] +\n HEX_CHARS[(h1 >> 28) & 0x0F] + HEX_CHARS[(h1 >> 24) & 0x0F] +\n HEX_CHARS[(h1 >> 20) & 0x0F] + HEX_CHARS[(h1 >> 16) & 0x0F] +\n HEX_CHARS[(h1 >> 12) & 0x0F] + HEX_CHARS[(h1 >> 8) & 0x0F] +\n HEX_CHARS[(h1 >> 4) & 0x0F] + HEX_CHARS[h1 & 0x0F] +\n HEX_CHARS[(h2 >> 28) & 0x0F] + HEX_CHARS[(h2 >> 24) & 0x0F] +\n HEX_CHARS[(h2 >> 20) & 0x0F] + HEX_CHARS[(h2 >> 16) & 0x0F] +\n HEX_CHARS[(h2 >> 12) & 0x0F] + HEX_CHARS[(h2 >> 8) & 0x0F] +\n HEX_CHARS[(h2 >> 4) & 0x0F] + HEX_CHARS[h2 & 0x0F] +\n HEX_CHARS[(h3 >> 28) & 0x0F] + HEX_CHARS[(h3 >> 24) & 0x0F] +\n HEX_CHARS[(h3 >> 20) & 0x0F] + HEX_CHARS[(h3 >> 16) & 0x0F] +\n HEX_CHARS[(h3 >> 12) & 0x0F] + HEX_CHARS[(h3 >> 8) & 0x0F] +\n HEX_CHARS[(h3 >> 4) & 0x0F] + HEX_CHARS[h3 & 0x0F] +\n HEX_CHARS[(h4 >> 28) & 0x0F] + HEX_CHARS[(h4 >> 24) & 0x0F] +\n HEX_CHARS[(h4 >> 20) & 0x0F] + HEX_CHARS[(h4 >> 16) & 0x0F] +\n HEX_CHARS[(h4 >> 12) & 0x0F] + HEX_CHARS[(h4 >> 8) & 0x0F] +\n HEX_CHARS[(h4 >> 4) & 0x0F] + HEX_CHARS[h4 & 0x0F];\n };\n\n Sha1.prototype.toString = Sha1.prototype.hex;\n\n Sha1.prototype.digest = function () {\n this.finalize();\n\n var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3, h4 = this.h4;\n\n return [\n (h0 >> 24) & 0xFF, (h0 >> 16) & 0xFF, (h0 >> 8) & 0xFF, h0 & 0xFF,\n (h1 >> 24) & 0xFF, (h1 >> 16) & 0xFF, (h1 >> 8) & 0xFF, h1 & 0xFF,\n (h2 >> 24) & 0xFF, (h2 >> 16) & 0xFF, (h2 >> 8) & 0xFF, h2 & 0xFF,\n (h3 >> 24) & 0xFF, (h3 >> 16) & 0xFF, (h3 >> 8) & 0xFF, h3 & 0xFF,\n (h4 >> 24) & 0xFF, (h4 >> 16) & 0xFF, (h4 >> 8) & 0xFF, h4 & 0xFF\n ];\n };\n\n Sha1.prototype.array = Sha1.prototype.digest;\n\n Sha1.prototype.arrayBuffer = function () {\n this.finalize();\n\n var buffer = new ArrayBuffer(20);\n var dataView = new DataView(buffer);\n dataView.setUint32(0, this.h0);\n dataView.setUint32(4, this.h1);\n dataView.setUint32(8, this.h2);\n dataView.setUint32(12, this.h3);\n dataView.setUint32(16, this.h4);\n return buffer;\n };\n\n var exports = createMethod();\n\n if (COMMON_JS) {\n module.exports = exports;\n } else {\n root.sha1 = exports;\n if (AMD) {\n define(function () {\n return exports;\n });\n }\n }\n})();\n","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","/* globals __webpack_amd_options__ */\nmodule.exports = __webpack_amd_options__;\n","var COS = require('./src/cos');\r\nmodule.exports = COS;","'use strict';\r\n\r\nvar util = require('./util');\r\nvar event = require('./event');\r\nvar task = require('./task');\r\nvar base = require('./base');\r\nvar advance = require('./advance');\r\n\r\nvar defaultOptions = {\r\n AppId: '', // AppId 已废弃,请拼接到 Bucket 后传入,例如:test-1250000000\r\n SecretId: '',\r\n SecretKey: '',\r\n XCosSecurityToken: '', // 使用临时密钥需要注意自行刷新 Token\r\n ChunkRetryTimes: 2,\r\n FileParallelLimit: 3,\r\n ChunkParallelLimit: 3,\r\n ChunkSize: 1024 * 1024,\r\n SliceSize: 1024 * 1024,\r\n CopyChunkParallelLimit: 20,\r\n CopyChunkSize: 1024 * 1024 * 10,\r\n CopySliceSize: 1024 * 1024 * 10,\r\n MaxPartNumber: 10000,\r\n ProgressInterval: 1000,\r\n UploadQueueSize: 10000,\r\n Domain: '',\r\n ServiceDomain: '',\r\n Protocol: '',\r\n CompatibilityMode: false,\r\n ForcePathStyle: false,\r\n UseRawKey: false,\r\n Timeout: 0, // 单位毫秒,0 代表不设置超时时间\r\n CorrectClockSkew: true,\r\n SystemClockOffset: 0, // 单位毫秒,ms\r\n UploadCheckContentMd5: false,\r\n UploadAddMetaMd5: false,\r\n UploadIdCacheLimit: 50,\r\n};\r\n\r\n// 对外暴露的类\r\nvar COS = function (options) {\r\n this.options = util.extend(util.clone(defaultOptions), options || {});\r\n this.options.FileParallelLimit = Math.max(1, this.options.FileParallelLimit);\r\n this.options.ChunkParallelLimit = Math.max(1, this.options.ChunkParallelLimit);\r\n this.options.ChunkRetryTimes = Math.max(0, this.options.ChunkRetryTimes);\r\n this.options.ChunkSize = Math.max(1024 * 1024, this.options.ChunkSize);\r\n this.options.CopyChunkParallelLimit = Math.max(1, this.options.CopyChunkParallelLimit);\r\n this.options.CopyChunkSize = Math.max(1024 * 1024, this.options.CopyChunkSize);\r\n this.options.CopySliceSize = Math.max(0, this.options.CopySliceSize);\r\n this.options.MaxPartNumber = Math.max(1024, Math.min(10000, this.options.MaxPartNumber));\r\n this.options.Timeout = Math.max(0, this.options.Timeout);\r\n if (this.options.AppId) {\r\n console.warn('warning: AppId has been deprecated, Please put it at the end of parameter Bucket(E.g: \"test-1250000000\").');\r\n }\r\n event.init(this);\r\n task.init(this);\r\n};\r\n\r\nbase.init(COS, task);\r\nadvance.init(COS, task);\r\n\r\nCOS.getAuthorization = util.getAuth;\r\nCOS.version = '0.5.27';\r\n\r\nmodule.exports = COS;\r\n","'use strict';\r\n\r\nvar md5 = require('../lib/md5');\r\nvar CryptoJS = require('../lib/crypto');\r\nvar xml2json = require('../lib/xml2json');\r\nvar json2xml = require('../lib/json2xml');\r\n\r\nfunction camSafeUrlEncode(str) {\r\n return encodeURIComponent(str)\r\n .replace(/!/g, '%21')\r\n .replace(/'/g, '%27')\r\n .replace(/\\(/g, '%28')\r\n .replace(/\\)/g, '%29')\r\n .replace(/\\*/g, '%2A');\r\n}\r\n\r\n//测试用的key后面可以去掉\r\nvar getAuth = function (opt) {\r\n opt = opt || {};\r\n\r\n var SecretId = opt.SecretId;\r\n var SecretKey = opt.SecretKey;\r\n var KeyTime = opt.KeyTime;\r\n var method = (opt.method || opt.Method || 'get').toLowerCase();\r\n var queryParams = clone(opt.Query || opt.params || {});\r\n var headers = clone(opt.Headers || opt.headers || {});\r\n\r\n var Key = opt.Key || '';\r\n var pathname;\r\n if (opt.UseRawKey) {\r\n pathname = opt.Pathname || opt.pathname || '/' + Key;\r\n } else {\r\n pathname = opt.Pathname || opt.pathname || Key;\r\n pathname.indexOf('/') !== 0 && (pathname = '/' + pathname);\r\n }\r\n\r\n if (!SecretId) return console.error('missing param SecretId');\r\n if (!SecretKey) return console.error('missing param SecretKey');\r\n\r\n var getObjectKeys = function (obj) {\r\n var list = [];\r\n for (var key in obj) {\r\n if (obj.hasOwnProperty(key)) {\r\n list.push(key);\r\n }\r\n }\r\n return list.sort(function (a, b) {\r\n a = a.toLowerCase();\r\n b = b.toLowerCase();\r\n return a === b ? 0 : (a > b ? 1 : -1);\r\n });\r\n };\r\n\r\n var obj2str = function (obj) {\r\n var i, key, val;\r\n var list = [];\r\n var keyList = getObjectKeys(obj);\r\n for (i = 0; i < keyList.length; i++) {\r\n key = keyList[i];\r\n val = (obj[key] === undefined || obj[key] === null) ? '' : ('' + obj[key]);\r\n key = key.toLowerCase();\r\n key = camSafeUrlEncode(key);\r\n val = camSafeUrlEncode(val) || '';\r\n list.push(key + '=' + val)\r\n }\r\n return list.join('&');\r\n };\r\n\r\n // 签名有效起止时间\r\n var now = Math.round(getSkewTime(opt.SystemClockOffset) / 1000) - 1;\r\n var exp = now;\r\n\r\n var Expires = opt.Expires || opt.expires;\r\n if (Expires === undefined) {\r\n exp += 900; // 签名过期时间为当前 + 900s\r\n } else {\r\n exp += (Expires * 1) || 0;\r\n }\r\n\r\n // 要用到的 Authorization 参数列表\r\n var qSignAlgorithm = 'sha1';\r\n var qAk = SecretId;\r\n var qSignTime = KeyTime || now + ';' + exp;\r\n var qKeyTime = KeyTime || now + ';' + exp;\r\n var qHeaderList = getObjectKeys(headers).join(';').toLowerCase();\r\n var qUrlParamList = getObjectKeys(queryParams).join(';').toLowerCase();\r\n\r\n // 签名算法说明文档:https://www.qcloud.com/document/product/436/7778\r\n // 步骤一:计算 SignKey\r\n var signKey = CryptoJS.HmacSHA1(qKeyTime, SecretKey).toString();\r\n\r\n // 步骤二:构成 FormatString\r\n var formatString = [method, pathname, obj2str(queryParams), obj2str(headers), ''].join('\\n');\r\n\r\n // 步骤三:计算 StringToSign\r\n var stringToSign = ['sha1', qSignTime, CryptoJS.SHA1(formatString).toString(), ''].join('\\n');\r\n\r\n // 步骤四:计算 Signature\r\n var qSignature = CryptoJS.HmacSHA1(stringToSign, signKey).toString();\r\n\r\n // 步骤五:构造 Authorization\r\n var authorization = [\r\n 'q-sign-algorithm=' + qSignAlgorithm,\r\n 'q-ak=' + qAk,\r\n 'q-sign-time=' + qSignTime,\r\n 'q-key-time=' + qKeyTime,\r\n 'q-header-list=' + qHeaderList,\r\n 'q-url-param-list=' + qUrlParamList,\r\n 'q-signature=' + qSignature\r\n ].join('&');\r\n\r\n return authorization;\r\n\r\n};\r\n\r\nvar noop = function () {\r\n\r\n};\r\n\r\n// 清除对象里值为的 undefined 或 null 的属性\r\nvar clearKey = function (obj) {\r\n var retObj = {};\r\n for (var key in obj) {\r\n if (obj.hasOwnProperty(key) && obj[key] !== undefined && obj[key] !== null) {\r\n retObj[key] = obj[key];\r\n }\r\n }\r\n return retObj;\r\n};\r\n\r\nvar readAsBinaryString = function (blob, callback) {\r\n var readFun;\r\n var fr = new FileReader();\r\n if (FileReader.prototype.readAsBinaryString) {\r\n readFun = FileReader.prototype.readAsBinaryString;\r\n fr.onload = function () {\r\n callback(this.result);\r\n };\r\n } else if (FileReader.prototype.readAsArrayBuffer) { // 在 ie11 添加 readAsBinaryString 兼容\r\n readFun = function (fileData) {\r\n var binary = \"\";\r\n var pt = this;\r\n var reader = new FileReader();\r\n reader.onload = function (e) {\r\n var bytes = new Uint8Array(reader.result);\r\n var length = bytes.byteLength;\r\n for (var i = 0; i < length; i++) {\r\n binary += String.fromCharCode(bytes[i]);\r\n }\r\n callback(binary);\r\n };\r\n reader.readAsArrayBuffer(fileData);\r\n };\r\n } else {\r\n console.error('FileReader not support readAsBinaryString');\r\n }\r\n readFun.call(fr, blob);\r\n};\r\n\r\nvar fileSliceNeedCopy = (function () {\r\n var compareVersion = function(a, b) {\r\n a = a.split('.');\r\n b = b.split('.');\r\n for (var i = 0; i < b.length; i++) {\r\n if (a[i] !== b[i]) {\r\n return parseInt(a[i]) > parseInt(b[i]) ? 1 : -1;\r\n }\r\n }\r\n return 0;\r\n };\r\n var check = function (ua) {\r\n var ChromeVersion = (ua.match(/Chrome\\/([.\\d]+)/) || [])[1];\r\n var QBCoreVersion = (ua.match(/QBCore\\/([.\\d]+)/) || [])[1];\r\n var QQBrowserVersion = (ua.match(/QQBrowser\\/([.\\d]+)/) || [])[1];\r\n var need = ChromeVersion && compareVersion(ChromeVersion, '53.0.2785.116') < 0\r\n && QBCoreVersion && compareVersion(QBCoreVersion, '3.53.991.400') < 0\r\n && QQBrowserVersion && compareVersion(QQBrowserVersion, '9.0.2524.400') <= 0 || false;\r\n return need;\r\n };\r\n return check(navigator && navigator.userAgent);\r\n})();\r\n\r\n// 获取文件分片\r\nvar fileSlice = function (file, start, end, isUseToUpload, callback) {\r\n var blob;\r\n if (file.slice) {\r\n blob = file.slice(start, end);\r\n } else if (file.mozSlice) {\r\n blob = file.mozSlice(start, end);\r\n } else if (file.webkitSlice) {\r\n blob = file.webkitSlice(start, end);\r\n }\r\n if (isUseToUpload && fileSliceNeedCopy) {\r\n var reader = new FileReader();\r\n reader.onload = function (e) {\r\n blob = null;\r\n callback(new Blob([reader.result]));\r\n };\r\n reader.readAsArrayBuffer(blob);\r\n } else {\r\n callback(blob);\r\n }\r\n};\r\n\r\n// 获取文件内容的 MD5\r\nvar getBodyMd5 = function (UploadCheckContentMd5, Body, callback, onProgress) {\r\n callback = callback || noop;\r\n if (UploadCheckContentMd5) {\r\n if (typeof Body === 'string') {\r\n callback(util.md5(Body, true));\r\n } else if (Blob && Body instanceof Blob) {\r\n util.getFileMd5(Body, function (err, md5) {\r\n callback(md5);\r\n }, onProgress);\r\n } else {\r\n callback();\r\n }\r\n } else {\r\n callback();\r\n }\r\n};\r\n\r\n// 获取文件 md5 值\r\nvar md5ChunkSize = 1024 * 1024;\r\nvar getFileMd5 = function (blob, callback, onProgress) {\r\n var size = blob.size;\r\n var loaded = 0;\r\n var md5ctx = md5.getCtx();\r\n var next = function (start) {\r\n if (start >= size) {\r\n var hash = md5ctx.digest('hex');\r\n callback(null, hash);\r\n return;\r\n }\r\n var end = Math.min(size, start + md5ChunkSize);\r\n util.fileSlice(blob, start, end, false, function (chunk) {\r\n readAsBinaryString(chunk, function (content) {\r\n chunk = null;\r\n md5ctx = md5ctx.update(content, true);\r\n loaded += content.length;\r\n content = null;\r\n if (onProgress) onProgress({loaded: loaded, total: size, percent: Math.round(loaded / size * 10000) / 10000});\r\n next(start + md5ChunkSize);\r\n });\r\n });\r\n };\r\n next(0);\r\n};\r\n\r\nfunction clone(obj) {\r\n return map(obj, function (v) {\r\n return typeof v === 'object' ? clone(v) : v;\r\n });\r\n}\r\n\r\nfunction extend(target, source) {\r\n each(source, function (val, key) {\r\n target[key] = source[key];\r\n });\r\n return target;\r\n}\r\n\r\nfunction isArray(arr) {\r\n return arr instanceof Array;\r\n}\r\n\r\nfunction isInArray(arr, item) {\r\n var flag = false;\r\n for (var i = 0; i < arr.length; i++) {\r\n if (item === arr[i]) {\r\n flag = true;\r\n break;\r\n }\r\n }\r\n return flag;\r\n}\r\n\r\nfunction makeArray(arr) {\r\n return isArray(arr) ? arr : [arr];\r\n}\r\n\r\nfunction each(obj, fn) {\r\n for (var i in obj) {\r\n if (obj.hasOwnProperty(i)) {\r\n fn(obj[i], i);\r\n }\r\n }\r\n}\r\n\r\nfunction map(obj, fn) {\r\n var o = isArray(obj) ? [] : {};\r\n for (var i in obj) {\r\n if (obj.hasOwnProperty(i)) {\r\n o[i] = fn(obj[i], i);\r\n }\r\n }\r\n return o;\r\n}\r\n\r\nfunction filter(obj, fn) {\r\n var iaArr = isArray(obj);\r\n var o = iaArr ? [] : {};\r\n for (var i in obj) {\r\n if (obj.hasOwnProperty(i)) {\r\n if (fn(obj[i], i)) {\r\n if (iaArr) {\r\n o.push(obj[i]);\r\n } else {\r\n o[i] = obj[i];\r\n }\r\n }\r\n }\r\n }\r\n return o;\r\n}\r\n\r\nvar binaryBase64 = function (str) {\r\n var i, len, char, res = '';\r\n for (i = 0, len = str.length / 2; i < len; i++) {\r\n char = parseInt(str[i * 2] + str[i * 2 + 1], 16);\r\n res += String.fromCharCode(char);\r\n }\r\n return btoa(res);\r\n};\r\nvar uuid = function () {\r\n var S4 = function () {\r\n return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);\r\n };\r\n return (S4() + S4() + \"-\" + S4() + \"-\" + S4() + \"-\" + S4() + \"-\" + S4() + S4() + S4());\r\n};\r\n\r\nvar hasMissingParams = function (apiName, params) {\r\n var Bucket = params.Bucket;\r\n var Region = params.Region;\r\n var Key = params.Key;\r\n if (apiName.indexOf('Bucket') > -1 || apiName === 'deleteMultipleObject' || apiName === 'multipartList' || apiName === 'listObjectVersions') {\r\n if (!Bucket) return 'Bucket';\r\n if (!Region) return 'Region';\r\n } else if (apiName.indexOf('Object') > -1 || apiName.indexOf('multipart') > -1 || apiName === 'sliceUploadFile' || apiName === 'abortUploadTask') {\r\n if (!Bucket) return 'Bucket';\r\n if (!Region) return 'Region';\r\n if (!Key) return 'Key';\r\n }\r\n return false;\r\n};\r\n\r\nvar formatParams = function (apiName, params) {\r\n\r\n // 复制参数对象\r\n params = extend({}, params);\r\n\r\n // 统一处理 Headers\r\n if (apiName !== 'getAuth' && apiName !== 'getV4Auth' && apiName !== 'getObjectUrl') {\r\n var Headers = params.Headers || {};\r\n if (params && typeof params === 'object') {\r\n (function () {\r\n for (var key in params) {\r\n if (params.hasOwnProperty(key) && key.indexOf('x-cos-') > -1) {\r\n Headers[key] = params[key];\r\n }\r\n }\r\n })();\r\n\r\n var headerMap = {\r\n // params headers\r\n 'x-cos-mfa': 'MFA',\r\n 'Content-MD5': 'ContentMD5',\r\n 'Content-Length': 'ContentLength',\r\n 'Content-Type': 'ContentType',\r\n 'Expect': 'Expect',\r\n 'Expires': 'Expires',\r\n 'Cache-Control': 'CacheControl',\r\n 'Content-Disposition': 'ContentDisposition',\r\n 'Content-Encoding': 'ContentEncoding',\r\n 'Range': 'Range',\r\n 'If-Modified-Since': 'IfModifiedSince',\r\n 'If-Unmodified-Since': 'IfUnmodifiedSince',\r\n 'If-Match': 'IfMatch',\r\n 'If-None-Match': 'IfNoneMatch',\r\n 'x-cos-copy-source': 'CopySource',\r\n 'x-cos-copy-source-Range': 'CopySourceRange',\r\n 'x-cos-metadata-directive': 'MetadataDirective',\r\n 'x-cos-copy-source-If-Modified-Since': 'CopySourceIfModifiedSince',\r\n 'x-cos-copy-source-If-Unmodified-Since': 'CopySourceIfUnmodifiedSince',\r\n 'x-cos-copy-source-If-Match': 'CopySourceIfMatch',\r\n 'x-cos-copy-source-If-None-Match': 'CopySourceIfNoneMatch',\r\n 'x-cos-acl': 'ACL',\r\n 'x-cos-grant-read': 'GrantRead',\r\n 'x-cos-grant-write': 'GrantWrite',\r\n 'x-cos-grant-full-control': 'GrantFullControl',\r\n 'x-cos-grant-read-acp': 'GrantReadAcp',\r\n 'x-cos-grant-write-acp': 'GrantWriteAcp',\r\n 'x-cos-storage-class': 'StorageClass',\r\n // SSE-C\r\n 'x-cos-server-side-encryption-customer-algorithm': 'SSECustomerAlgorithm',\r\n 'x-cos-server-side-encryption-customer-key': 'SSECustomerKey',\r\n 'x-cos-server-side-encryption-customer-key-MD5': 'SSECustomerKeyMD5',\r\n // SSE-COS、SSE-KMS\r\n 'x-cos-server-side-encryption': 'ServerSideEncryption',\r\n 'x-cos-server-side-encryption-cos-kms-key-id': 'SSEKMSKeyId',\r\n 'x-cos-server-side-encryption-context': 'SSEContext',\r\n };\r\n util.each(headerMap, function (paramKey, headerKey) {\r\n if (params[paramKey] !== undefined) {\r\n Headers[headerKey] = params[paramKey];\r\n }\r\n });\r\n\r\n params.Headers = clearKey(Headers);\r\n }\r\n }\r\n\r\n return params;\r\n};\r\n\r\nvar apiWrapper = function (apiName, apiFn) {\r\n return function (params, callback) {\r\n\r\n // 处理参数\r\n if (typeof params === 'function') {\r\n callback = params;\r\n params = {};\r\n }\r\n\r\n // 整理参数格式\r\n params = formatParams(apiName, params);\r\n\r\n // 代理回调函数\r\n var formatResult = function (result) {\r\n if (result && result.headers) {\r\n result.headers['x-cos-version-id'] && (result.VersionId = result.headers['x-cos-version-id']);\r\n result.headers['x-cos-delete-marker'] && (result.DeleteMarker = result.headers['x-cos-delete-marker']);\r\n }\r\n return result;\r\n };\r\n var _callback = function (err, data) {\r\n callback && callback(formatResult(err), formatResult(data));\r\n };\r\n\r\n if (apiName !== 'getService' && apiName !== 'abortUploadTask') {\r\n // 判断参数是否完整\r\n var missingResult;\r\n if (missingResult = hasMissingParams(apiName, params)) {\r\n _callback({error: 'missing param ' + missingResult});\r\n return;\r\n }\r\n // 判断 region 格式\r\n if (params.Region) {\r\n if (params.Region.indexOf('cos.') > -1) {\r\n _callback({error: 'param Region should not be start with \"cos.\"'});\r\n return;\r\n } else if (!/^([a-z\\d-]+)$/.test(params.Region)) {\r\n _callback({error: 'Region format error.'});\r\n return;\r\n }\r\n // 判断 region 格式\r\n if (!this.options.CompatibilityMode && params.Region.indexOf('-') === -1 && params.Region !== 'yfb' && params.Region !== 'default') {\r\n console.warn('warning: param Region format error, find help here: https://cloud.tencent.com/document/product/436/6224');\r\n }\r\n }\r\n // 兼容不带 AppId 的 Bucket\r\n if (params.Bucket) {\r\n if (!/^([a-z\\d-]+)-(\\d+)$/.test(params.Bucket)) {\r\n if (params.AppId) {\r\n params.Bucket = params.Bucket + '-' + params.AppId;\r\n } else if (this.options.AppId) {\r\n params.Bucket = params.Bucket + '-' + this.options.AppId;\r\n } else {\r\n _callback({error: 'Bucket should format as \"test-1250000000\".'});\r\n return;\r\n }\r\n }\r\n if (params.AppId) {\r\n console.warn('warning: AppId has been deprecated, Please put it at the end of parameter Bucket(E.g Bucket:\"test-1250000000\" ).');\r\n delete params.AppId;\r\n }\r\n }\r\n // 如果 Key 是 / 开头,强制去掉第一个 /\r\n if (!this.options.UseRawKey && params.Key && params.Key.substr(0, 1) === '/') {\r\n params.Key = params.Key.substr(1);\r\n }\r\n }\r\n var res = apiFn.call(this, params, _callback);\r\n if (apiName === 'getAuth' || apiName === 'getObjectUrl') {\r\n return res;\r\n }\r\n }\r\n};\r\n\r\nvar throttleOnProgress = function (total, onProgress) {\r\n var self = this;\r\n var size0 = 0;\r\n var size1 = 0;\r\n var time0 = Date.now();\r\n var time1;\r\n var timer;\r\n\r\n function update() {\r\n timer = 0;\r\n if (onProgress && (typeof onProgress === 'function')) {\r\n time1 = Date.now();\r\n var speed = Math.max(0, Math.round((size1 - size0) / ((time1 - time0) / 1000) * 100) / 100);\r\n var percent;\r\n if (size1 === 0 && total === 0) {\r\n percent = 1;\r\n } else {\r\n percent = Math.round(size1 / total * 100) / 100 || 0;\r\n }\r\n time0 = time1;\r\n size0 = size1;\r\n try {\r\n onProgress({loaded: size1, total: total, speed: speed, percent: percent});\r\n } catch (e) {\r\n }\r\n }\r\n }\r\n\r\n return function (info, immediately) {\r\n if (info) {\r\n size1 = info.loaded;\r\n total = info.total;\r\n }\r\n if (immediately) {\r\n clearTimeout(timer);\r\n update();\r\n } else {\r\n if (timer) return;\r\n timer = setTimeout(update, self.options.ProgressInterval);\r\n }\r\n };\r\n};\r\n\r\nvar getFileSize = function (api, params, callback) {\r\n var size;\r\n if (typeof params.Body === 'string') {\r\n params.Body = new Blob([params.Body], {type: 'text/plain'});\r\n }\r\n if ((params.Body && (params.Body instanceof Blob || params.Body.toString() === '[object File]' || params.Body.toString() === '[object Blob]'))) {\r\n size = params.Body.size;\r\n } else {\r\n callback({error: 'params body format error, Only allow File|Blob|String.'});\r\n return;\r\n }\r\n params.ContentLength = size;\r\n callback(null, size);\r\n};\r\n\r\n// 获取调正的时间戳\r\nvar getSkewTime = function (offset) {\r\n return Date.now() + (offset || 0);\r\n};\r\n\r\nvar util = {\r\n noop: noop,\r\n formatParams: formatParams,\r\n apiWrapper: apiWrapper,\r\n xml2json: xml2json,\r\n json2xml: json2xml,\r\n md5: md5,\r\n clearKey: clearKey,\r\n fileSlice: fileSlice,\r\n getBodyMd5: getBodyMd5,\r\n getFileMd5: getFileMd5,\r\n binaryBase64: binaryBase64,\r\n extend: extend,\r\n isArray: isArray,\r\n isInArray: isInArray,\r\n makeArray: makeArray,\r\n each: each,\r\n map: map,\r\n filter: filter,\r\n clone: clone,\r\n uuid: uuid,\r\n camSafeUrlEncode: camSafeUrlEncode,\r\n throttleOnProgress: throttleOnProgress,\r\n getFileSize: getFileSize,\r\n getSkewTime: getSkewTime,\r\n getAuth: getAuth,\r\n isBrowser: true,\r\n};\r\n\r\nmodule.exports = util;\r\n","/**\r\n * http://www.myersdaily.org/joseph/javascript/md5-text.html\r\n * http://pajhome.org.uk/crypt/md5\r\n * https://github.com/wbond/md5-js\r\n */\r\nfunction md5cycle(x, k) {\r\n var a = x[0], b = x[1], c = x[2], d = x[3];\r\n\r\n a = ff(a, b, c, d, k[0], 7, -680876936);\r\n d = ff(d, a, b, c, k[1], 12, -389564586);\r\n c = ff(c, d, a, b, k[2], 17, 606105819);\r\n b = ff(b, c, d, a, k[3], 22, -1044525330);\r\n a = ff(a, b, c, d, k[4], 7, -176418897);\r\n d = ff(d, a, b, c, k[5], 12, 1200080426);\r\n c = ff(c, d, a, b, k[6], 17, -1473231341);\r\n b = ff(b, c, d, a, k[7], 22, -45705983);\r\n a = ff(a, b, c, d, k[8], 7, 1770035416);\r\n d = ff(d, a, b, c, k[9], 12, -1958414417);\r\n c = ff(c, d, a, b, k[10], 17, -42063);\r\n b = ff(b, c, d, a, k[11], 22, -1990404162);\r\n a = ff(a, b, c, d, k[12], 7, 1804603682);\r\n d = ff(d, a, b, c, k[13], 12, -40341101);\r\n c = ff(c, d, a, b, k[14], 17, -1502002290);\r\n b = ff(b, c, d, a, k[15], 22, 1236535329);\r\n\r\n a = gg(a, b, c, d, k[1], 5, -165796510);\r\n d = gg(d, a, b, c, k[6], 9, -1069501632);\r\n c = gg(c, d, a, b, k[11], 14, 643717713);\r\n b = gg(b, c, d, a, k[0], 20, -373897302);\r\n a = gg(a, b, c, d, k[5], 5, -701558691);\r\n d = gg(d, a, b, c, k[10], 9, 38016083);\r\n c = gg(c, d, a, b, k[15], 14, -660478335);\r\n b = gg(b, c, d, a, k[4], 20, -405537848);\r\n a = gg(a, b, c, d, k[9], 5, 568446438);\r\n d = gg(d, a, b, c, k[14], 9, -1019803690);\r\n c = gg(c, d, a, b, k[3], 14, -187363961);\r\n b = gg(b, c, d, a, k[8], 20, 1163531501);\r\n a = gg(a, b, c, d, k[13], 5, -1444681467);\r\n d = gg(d, a, b, c, k[2], 9, -51403784);\r\n c = gg(c, d, a, b, k[7], 14, 1735328473);\r\n b = gg(b, c, d, a, k[12], 20, -1926607734);\r\n\r\n a = hh(a, b, c, d, k[5], 4, -378558);\r\n d = hh(d, a, b, c, k[8], 11, -2022574463);\r\n c = hh(c, d, a, b, k[11], 16, 1839030562);\r\n b = hh(b, c, d, a, k[14], 23, -35309556);\r\n a = hh(a, b, c, d, k[1], 4, -1530992060);\r\n d = hh(d, a, b, c, k[4], 11, 1272893353);\r\n c = hh(c, d, a, b, k[7], 16, -155497632);\r\n b = hh(b, c, d, a, k[10], 23, -1094730640);\r\n a = hh(a, b, c, d, k[13], 4, 681279174);\r\n d = hh(d, a, b, c, k[0], 11, -358537222);\r\n c = hh(c, d, a, b, k[3], 16, -722521979);\r\n b = hh(b, c, d, a, k[6], 23, 76029189);\r\n a = hh(a, b, c, d, k[9], 4, -640364487);\r\n d = hh(d, a, b, c, k[12], 11, -421815835);\r\n c = hh(c, d, a, b, k[15], 16, 530742520);\r\n b = hh(b, c, d, a, k[2], 23, -995338651);\r\n\r\n a = ii(a, b, c, d, k[0], 6, -198630844);\r\n d = ii(d, a, b, c, k[7], 10, 1126891415);\r\n c = ii(c, d, a, b, k[14], 15, -1416354905);\r\n b = ii(b, c, d, a, k[5], 21, -57434055);\r\n a = ii(a, b, c, d, k[12], 6, 1700485571);\r\n d = ii(d, a, b, c, k[3], 10, -1894986606);\r\n c = ii(c, d, a, b, k[10], 15, -1051523);\r\n b = ii(b, c, d, a, k[1], 21, -2054922799);\r\n a = ii(a, b, c, d, k[8], 6, 1873313359);\r\n d = ii(d, a, b, c, k[15], 10, -30611744);\r\n c = ii(c, d, a, b, k[6], 15, -1560198380);\r\n b = ii(b, c, d, a, k[13], 21, 1309151649);\r\n a = ii(a, b, c, d, k[4], 6, -145523070);\r\n d = ii(d, a, b, c, k[11], 10, -1120210379);\r\n c = ii(c, d, a, b, k[2], 15, 718787259);\r\n b = ii(b, c, d, a, k[9], 21, -343485551);\r\n\r\n x[0] = add32(a, x[0]);\r\n x[1] = add32(b, x[1]);\r\n x[2] = add32(c, x[2]);\r\n x[3] = add32(d, x[3]);\r\n}\r\n\r\nfunction cmn(q, a, b, x, s, t) {\r\n a = add32(add32(a, q), add32(x, t));\r\n return add32((a << s) | (a >>> (32 - s)), b);\r\n}\r\n\r\nfunction ff(a, b, c, d, x, s, t) {\r\n return cmn((b & c) | ((~b) & d), a, b, x, s, t);\r\n}\r\n\r\nfunction gg(a, b, c, d, x, s, t) {\r\n return cmn((b & d) | (c & (~d)), a, b, x, s, t);\r\n}\r\n\r\nfunction hh(a, b, c, d, x, s, t) {\r\n return cmn(b ^ c ^ d, a, b, x, s, t);\r\n}\r\n\r\nfunction ii(a, b, c, d, x, s, t) {\r\n return cmn(c ^ (b | (~d)), a, b, x, s, t);\r\n}\r\n\r\nfunction md5blk(s) { /* I figured global was faster. */\r\n var md5blks = [], i; /* Andy King said do it this way. */\r\n for (i = 0; i < 64; i += 4) {\r\n md5blks[i >> 2] = s.charCodeAt(i) +\r\n (s.charCodeAt(i + 1) << 8) +\r\n (s.charCodeAt(i + 2) << 16) +\r\n (s.charCodeAt(i + 3) << 24);\r\n }\r\n return md5blks;\r\n}\r\n\r\nvar hex_chr = '0123456789abcdef'.split('');\r\n\r\nfunction rhex(n) {\r\n var s = '', j = 0;\r\n for (; j < 4; j++)\r\n s += hex_chr[(n >> (j * 8 + 4)) & 0x0F] +\r\n hex_chr[(n >> (j * 8)) & 0x0F];\r\n return s;\r\n}\r\n\r\nfunction hex(x) {\r\n for (var i = 0; i < x.length; i++)\r\n x[i] = rhex(x[i]);\r\n return x.join('');\r\n}\r\n\r\nvar add32 = function (a, b) {\r\n return (a + b) & 0xFFFFFFFF;\r\n}\r\n\r\nfunction getCtx() {\r\n var ctx = {};\r\n ctx.state = [1732584193, -271733879, -1732584194, 271733878];\r\n ctx.tail = '';\r\n ctx.size = 0;\r\n ctx.update = function (s, isBinStr) {\r\n if (!isBinStr) s = unescape(encodeURIComponent(s));\r\n ctx.size += s.length;\r\n s = ctx.tail + s;\r\n var i, state = ctx.state;\r\n for (i = 64; i <= s.length; i += 64) {\r\n md5cycle(state, md5blk(s.substring(i - 64, i)));\r\n }\r\n ctx.tail = s.substring(i - 64);\r\n return ctx;\r\n };\r\n ctx.digest = function (encode) {\r\n var i,\r\n n = ctx.size,\r\n state = ctx.state,\r\n s = ctx.tail,\r\n tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\r\n for (i = 0; i < s.length; i++)\r\n tail[i >> 2] |= s.charCodeAt(i) << ((i % 4) << 3);\r\n tail[i >> 2] |= 0x80 << ((i % 4) << 3);\r\n if (i > 55) {\r\n md5cycle(state, tail);\r\n for (i = 0; i < 16; i++) tail[i] = 0;\r\n }\r\n tail[14] = n * 8;\r\n md5cycle(state, tail);\r\n return hex(state);\r\n };\r\n return ctx;\r\n}\r\n\r\nvar md5 = function (s, isBinStr) {\r\n return getCtx().update(s, isBinStr).digest('hex');\r\n}\r\n\r\nif (md5('hello') !== '5d41402abc4b2a76b9719d911017c592') {\r\n add32 = function (x, y) {\r\n var lsw = (x & 0xFFFF) + (y & 0xFFFF),\r\n msw = (x >> 16) + (y >> 16) + (lsw >> 16);\r\n return (msw << 16) | (lsw & 0xFFFF);\r\n }\r\n}\r\n\r\nmd5.getCtx = getCtx;\r\nmodule.exports = md5;\r\n","/*\r\n CryptoJS v3.1.2\r\n code.google.com/p/crypto-js\r\n (c) 2009-2013 by Jeff Mott. All rights reserved.\r\n code.google.com/p/crypto-js/wiki/License\r\n */\r\nvar CryptoJS=CryptoJS||function(g,l){var e={},d=e.lib={},m=function(){},k=d.Base={extend:function(a){m.prototype=this;var c=new m;a&&c.mixIn(a);c.hasOwnProperty(\"init\")||(c.init=function(){c.$super.init.apply(this,arguments)});c.init.prototype=c;c.$super=this;return c},create:function(){var a=this.extend();a.init.apply(a,arguments);return a},init:function(){},mixIn:function(a){for(var c in a)a.hasOwnProperty(c)&&(this[c]=a[c]);a.hasOwnProperty(\"toString\")&&(this.toString=a.toString)},clone:function(){return this.init.prototype.extend(this)}},\r\n p=d.WordArray=k.extend({init:function(a,c){a=this.words=a||[];this.sigBytes=c!=l?c:4*a.length},toString:function(a){return(a||n).stringify(this)},concat:function(a){var c=this.words,q=a.words,f=this.sigBytes;a=a.sigBytes;this.clamp();if(f%4)for(var b=0;b>>2]|=(q[b>>>2]>>>24-8*(b%4)&255)<<24-8*((f+b)%4);else if(65535>>2]=q[b>>>2];else c.push.apply(c,q);this.sigBytes+=a;return this},clamp:function(){var a=this.words,c=this.sigBytes;a[c>>>2]&=4294967295<<\r\n 32-8*(c%4);a.length=g.ceil(c/4)},clone:function(){var a=k.clone.call(this);a.words=this.words.slice(0);return a},random:function(a){for(var c=[],b=0;b>>2]>>>24-8*(f%4)&255;b.push((d>>>4).toString(16));b.push((d&15).toString(16))}return b.join(\"\")},parse:function(a){for(var c=a.length,b=[],f=0;f>>3]|=parseInt(a.substr(f,\r\n 2),16)<<24-4*(f%8);return new p.init(b,c/2)}},j=b.Latin1={stringify:function(a){var c=a.words;a=a.sigBytes;for(var b=[],f=0;f>>2]>>>24-8*(f%4)&255));return b.join(\"\")},parse:function(a){for(var c=a.length,b=[],f=0;f>>2]|=(a.charCodeAt(f)&255)<<24-8*(f%4);return new p.init(b,c)}},h=b.Utf8={stringify:function(a){try{return decodeURIComponent(escape(j.stringify(a)))}catch(c){throw Error(\"Malformed UTF-8 data\");}},parse:function(a){return j.parse(unescape(encodeURIComponent(a)))}},\r\n r=d.BufferedBlockAlgorithm=k.extend({reset:function(){this._data=new p.init;this._nDataBytes=0},_append:function(a){\"string\"==typeof a&&(a=h.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(a){var c=this._data,b=c.words,f=c.sigBytes,d=this.blockSize,e=f/(4*d),e=a?g.ceil(e):g.max((e|0)-this._minBufferSize,0);a=e*d;f=g.min(4*a,f);if(a){for(var k=0;ka;a++){if(16>a)m[a]=d[e+a]|0;else{var c=m[a-3]^m[a-8]^m[a-14]^m[a-16];m[a]=c<<1|c>>>31}c=(n<<5|n>>>27)+l+m[a];c=20>a?c+((j&h|~j&g)+1518500249):40>a?c+((j^h^g)+1859775393):60>a?c+((j&h|j&g|h&g)-1894007588):c+((j^h^\r\ng)-899497514);l=g;g=h;h=j<<30|j>>>2;j=n;n=c}b[0]=b[0]+n|0;b[1]=b[1]+j|0;b[2]=b[2]+h|0;b[3]=b[3]+g|0;b[4]=b[4]+l|0},_doFinalize:function(){var d=this._data,e=d.words,b=8*this._nDataBytes,g=8*d.sigBytes;e[g>>>5]|=128<<24-g%32;e[(g+64>>>9<<4)+14]=Math.floor(b/4294967296);e[(g+64>>>9<<4)+15]=b;d.sigBytes=4*e.length;this._process();return this._hash},clone:function(){var e=d.clone.call(this);e._hash=this._hash.clone();return e}});g.SHA1=d._createHelper(l);g.HmacSHA1=d._createHmacHelper(l)})();\r\n(function(){var g=CryptoJS,l=g.enc.Utf8;g.algo.HMAC=g.lib.Base.extend({init:function(e,d){e=this._hasher=new e.init;\"string\"==typeof d&&(d=l.parse(d));var g=e.blockSize,k=4*g;d.sigBytes>k&&(d=e.finalize(d));d.clamp();for(var p=this._oKey=d.clone(),b=this._iKey=d.clone(),n=p.words,j=b.words,h=0;h>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\r\n var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff;\r\n var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff;\r\n\r\n var triplet = (byte1 << 16) | (byte2 << 8) | byte3;\r\n\r\n for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) {\r\n base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f));\r\n }\r\n }\r\n\r\n // Add padding\r\n var paddingChar = map.charAt(64);\r\n if (paddingChar) {\r\n while (base64Chars.length % 4) {\r\n base64Chars.push(paddingChar);\r\n }\r\n }\r\n\r\n return base64Chars.join('');\r\n },\r\n\r\n /**\r\n * Converts a Base64 string to a word array.\r\n *\r\n * @param {string} base64Str The Base64 string.\r\n *\r\n * @return {WordArray} The word array.\r\n *\r\n * @static\r\n *\r\n * @example\r\n *\r\n * var wordArray = CryptoJS.enc.Base64.parse(base64String);\r\n */\r\n parse: function (base64Str) {\r\n // Shortcuts\r\n var base64StrLength = base64Str.length;\r\n var map = this._map;\r\n\r\n // Ignore padding\r\n var paddingChar = map.charAt(64);\r\n if (paddingChar) {\r\n var paddingIndex = base64Str.indexOf(paddingChar);\r\n if (paddingIndex != -1) {\r\n base64StrLength = paddingIndex;\r\n }\r\n }\r\n\r\n // Convert\r\n var words = [];\r\n var nBytes = 0;\r\n for (var i = 0; i < base64StrLength; i++) {\r\n if (i % 4) {\r\n var bits1 = map.indexOf(base64Str.charAt(i - 1)) << ((i % 4) * 2);\r\n var bits2 = map.indexOf(base64Str.charAt(i)) >>> (6 - (i % 4) * 2);\r\n words[nBytes >>> 2] |= (bits1 | bits2) << (24 - (nBytes % 4) * 8);\r\n nBytes++;\r\n }\r\n }\r\n\r\n return WordArray.create(words, nBytes);\r\n },\r\n\r\n _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='\r\n };\r\n}());\r\n\r\nif(typeof module === 'object'){\r\n module.exports = CryptoJS;\r\n}else{\r\n window.CryptoJS = CryptoJS;\r\n}\r\n","/* Copyright 2015 William Summers, MetaTribal LLC\r\n * adapted from https://developer.mozilla.org/en-US/docs/JXON\r\n *\r\n * Licensed under the MIT License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * https://opensource.org/licenses/MIT\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @author William Summers\r\n * https://github.com/metatribal/xmlToJSON\r\n */\r\nvar DOMParser = require('xmldom').DOMParser;\r\n\r\nvar xmlToJSON = (function () {\r\n\r\n this.version = \"1.3.5\";\r\n\r\n var options = { // set up the default options\r\n mergeCDATA: true, // extract cdata and merge with text\r\n normalize: true, // collapse multiple spaces to single space\r\n stripElemPrefix: true, // for elements of same name in diff namespaces, you can enable namespaces and access the nskey property\r\n };\r\n\r\n var prefixMatch = new RegExp(/(?!xmlns)^.*:/);\r\n var trimMatch = new RegExp(/^\\s+|\\s+$/g);\r\n\r\n this.grokType = function (sValue) {\r\n if (/^\\s*$/.test(sValue)) {\r\n return null;\r\n }\r\n if (/^(?:true|false)$/i.test(sValue)) {\r\n return sValue.toLowerCase() === \"true\";\r\n }\r\n if (isFinite(sValue)) {\r\n return parseFloat(sValue);\r\n }\r\n return sValue;\r\n };\r\n\r\n this.parseString = function (xmlString, opt) {\r\n if (xmlString) {\r\n var xml = this.stringToXML(xmlString);\r\n if (xml.getElementsByTagName('parsererror').length) {\r\n return null;\r\n } else {\r\n return this.parseXML(xml, opt);\r\n }\r\n } else {\r\n return null;\r\n }\r\n };\r\n\r\n this.parseXML = function (oXMLParent, opt) {\r\n\r\n // initialize options\r\n for (var key in opt) {\r\n options[key] = opt[key];\r\n }\r\n\r\n var vResult = {},\r\n nLength = 0,\r\n sCollectedTxt = \"\";\r\n\r\n // iterate over the children\r\n var childNum = oXMLParent.childNodes.length;\r\n if (childNum) {\r\n for (var oNode, sProp, vContent, nItem = 0; nItem < oXMLParent.childNodes.length; nItem++) {\r\n oNode = oXMLParent.childNodes.item(nItem);\r\n\r\n if (oNode.nodeType === 4) {\r\n if (options.mergeCDATA) {\r\n sCollectedTxt += oNode.nodeValue;\r\n }\r\n } /* nodeType is \"CDATASection\" (4) */\r\n else if (oNode.nodeType === 3) {\r\n sCollectedTxt += oNode.nodeValue;\r\n } /* nodeType is \"Text\" (3) */\r\n else if (oNode.nodeType === 1) { /* nodeType is \"Element\" (1) */\r\n\r\n if (nLength === 0) {\r\n vResult = {};\r\n }\r\n\r\n // using nodeName to support browser (IE) implementation with no 'localName' property\r\n if (options.stripElemPrefix) {\r\n sProp = oNode.nodeName.replace(prefixMatch, '');\r\n } else {\r\n sProp = oNode.nodeName;\r\n }\r\n\r\n vContent = xmlToJSON.parseXML(oNode);\r\n\r\n if (vResult.hasOwnProperty(sProp)) {\r\n if (vResult[sProp].constructor !== Array) {\r\n vResult[sProp] = [vResult[sProp]];\r\n }\r\n vResult[sProp].push(vContent);\r\n\r\n } else {\r\n vResult[sProp] = vContent;\r\n nLength++;\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (!Object.keys(vResult).length) {\r\n // vResult = sCollectedTxt.replace(trimMatch, '') || ''; // by carsonxu 修复 getBucket返回的 Key 是 \" /\" 这种场景\r\n vResult = sCollectedTxt || '';\r\n }\r\n\r\n return vResult;\r\n };\r\n\r\n // Convert xmlDocument to a string\r\n // Returns null on failure\r\n this.xmlToString = function (xmlDoc) {\r\n try {\r\n var xmlString = xmlDoc.xml ? xmlDoc.xml : (new XMLSerializer()).serializeToString(xmlDoc);\r\n return xmlString;\r\n } catch (err) {\r\n return null;\r\n }\r\n };\r\n\r\n // Convert a string to XML Node Structure\r\n // Returns null on failure\r\n this.stringToXML = function (xmlString) {\r\n try {\r\n var xmlDoc = null;\r\n\r\n if (window.DOMParser) {\r\n\r\n var parser = new DOMParser();\r\n xmlDoc = parser.parseFromString(xmlString, \"text/xml\");\r\n\r\n return xmlDoc;\r\n } else {\r\n xmlDoc = new ActiveXObject(\"Microsoft.XMLDOM\");\r\n xmlDoc.async = false;\r\n xmlDoc.loadXML(xmlString);\r\n\r\n return xmlDoc;\r\n }\r\n } catch (e) {\r\n return null;\r\n }\r\n };\r\n\r\n return this;\r\n\r\n}).call({});\r\n\r\nvar xml2json = function (xmlString) {\r\n return xmlToJSON.parseString(xmlString);\r\n};\r\n\r\nmodule.exports = xml2json;\r\n","function DOMParser(options){\r\n\tthis.options = options ||{locator:{}};\r\n\t\r\n}\r\nDOMParser.prototype.parseFromString = function(source,mimeType){\r\n\tvar options = this.options;\r\n\tvar sax = new XMLReader();\r\n\tvar domBuilder = options.domBuilder || new DOMHandler();//contentHandler and LexicalHandler\r\n\tvar errorHandler = options.errorHandler;\r\n\tvar locator = options.locator;\r\n\tvar defaultNSMap = options.xmlns||{};\r\n\tvar entityMap = {'lt':'<','gt':'>','amp':'&','quot':'\"','apos':\"'\"}\r\n\tif(locator){\r\n\t\tdomBuilder.setDocumentLocator(locator)\r\n\t}\r\n\t\r\n\tsax.errorHandler = buildErrorHandler(errorHandler,domBuilder,locator);\r\n\tsax.domBuilder = options.domBuilder || domBuilder;\r\n\tif(/\\/x?html?$/.test(mimeType)){\r\n\t\tentityMap.nbsp = '\\xa0';\r\n\t\tentityMap.copy = '\\xa9';\r\n\t\tdefaultNSMap['']= 'http://www.w3.org/1999/xhtml';\r\n\t}\r\n\tdefaultNSMap.xml = defaultNSMap.xml || 'http://www.w3.org/XML/1998/namespace';\r\n\tif(source){\r\n\t\tsax.parse(source,defaultNSMap,entityMap);\r\n\t}else{\r\n\t\tsax.errorHandler.error(\"invalid doc source\");\r\n\t}\r\n\treturn domBuilder.doc;\r\n}\r\nfunction buildErrorHandler(errorImpl,domBuilder,locator){\r\n\tif(!errorImpl){\r\n\t\tif(domBuilder instanceof DOMHandler){\r\n\t\t\treturn domBuilder;\r\n\t\t}\r\n\t\terrorImpl = domBuilder ;\r\n\t}\r\n\tvar errorHandler = {}\r\n\tvar isCallback = errorImpl instanceof Function;\r\n\tlocator = locator||{}\r\n\tfunction build(key){\r\n\t\tvar fn = errorImpl[key];\r\n\t\tif(!fn && isCallback){\r\n\t\t\tfn = errorImpl.length == 2?function(msg){errorImpl(key,msg)}:errorImpl;\r\n\t\t}\r\n\t\terrorHandler[key] = fn && function(msg){\r\n\t\t\tfn('[xmldom '+key+']\\t'+msg+_locator(locator));\r\n\t\t}||function(){};\r\n\t}\r\n\tbuild('warning');\r\n\tbuild('error');\r\n\tbuild('fatalError');\r\n\treturn errorHandler;\r\n}\r\n\r\n//console.log('#\\n\\n\\n\\n\\n\\n\\n####')\r\n/**\r\n * +ContentHandler+ErrorHandler\r\n * +LexicalHandler+EntityResolver2\r\n * -DeclHandler-DTDHandler \r\n * \r\n * DefaultHandler:EntityResolver, DTDHandler, ContentHandler, ErrorHandler\r\n * DefaultHandler2:DefaultHandler,LexicalHandler, DeclHandler, EntityResolver2\r\n * @link http://www.saxproject.org/apidoc/org/xml/sax/helpers/DefaultHandler.html\r\n */\r\nfunction DOMHandler() {\r\n this.cdata = false;\r\n}\r\nfunction position(locator,node){\r\n\tnode.lineNumber = locator.lineNumber;\r\n\tnode.columnNumber = locator.columnNumber;\r\n}\r\n/**\r\n * @see org.xml.sax.ContentHandler#startDocument\r\n * @link http://www.saxproject.org/apidoc/org/xml/sax/ContentHandler.html\r\n */ \r\nDOMHandler.prototype = {\r\n\tstartDocument : function() {\r\n \tthis.doc = new DOMImplementation().createDocument(null, null, null);\r\n \tif (this.locator) {\r\n \tthis.doc.documentURI = this.locator.systemId;\r\n \t}\r\n\t},\r\n\tstartElement:function(namespaceURI, localName, qName, attrs) {\r\n\t\tvar doc = this.doc;\r\n\t var el = doc.createElementNS(namespaceURI, qName||localName);\r\n\t var len = attrs.length;\r\n\t appendElement(this, el);\r\n\t this.currentElement = el;\r\n\t \r\n\t\tthis.locator && position(this.locator,el)\r\n\t for (var i = 0 ; i < len; i++) {\r\n\t var namespaceURI = attrs.getURI(i);\r\n\t var value = attrs.getValue(i);\r\n\t var qName = attrs.getQName(i);\r\n\t\t\tvar attr = doc.createAttributeNS(namespaceURI, qName);\r\n\t\t\tthis.locator &&position(attrs.getLocator(i),attr);\r\n\t\t\tattr.value = attr.nodeValue = value;\r\n\t\t\tel.setAttributeNode(attr)\r\n\t }\r\n\t},\r\n\tendElement:function(namespaceURI, localName, qName) {\r\n\t\tvar current = this.currentElement\r\n\t\tvar tagName = current.tagName;\r\n\t\tthis.currentElement = current.parentNode;\r\n\t},\r\n\tstartPrefixMapping:function(prefix, uri) {\r\n\t},\r\n\tendPrefixMapping:function(prefix) {\r\n\t},\r\n\tprocessingInstruction:function(target, data) {\r\n\t var ins = this.doc.createProcessingInstruction(target, data);\r\n\t this.locator && position(this.locator,ins)\r\n\t appendElement(this, ins);\r\n\t},\r\n\tignorableWhitespace:function(ch, start, length) {\r\n\t},\r\n\tcharacters:function(chars, start, length) {\r\n\t\tchars = _toString.apply(this,arguments)\r\n\t\t//console.log(chars)\r\n\t\tif(chars){\r\n\t\t\tif (this.cdata) {\r\n\t\t\t\tvar charNode = this.doc.createCDATASection(chars);\r\n\t\t\t} else {\r\n\t\t\t\tvar charNode = this.doc.createTextNode(chars);\r\n\t\t\t}\r\n\t\t\tif(this.currentElement){\r\n\t\t\t\tthis.currentElement.appendChild(charNode);\r\n\t\t\t}else if(/^\\s*$/.test(chars)){\r\n\t\t\t\tthis.doc.appendChild(charNode);\r\n\t\t\t\t//process xml\r\n\t\t\t}\r\n\t\t\tthis.locator && position(this.locator,charNode)\r\n\t\t}\r\n\t},\r\n\tskippedEntity:function(name) {\r\n\t},\r\n\tendDocument:function() {\r\n\t\tthis.doc.normalize();\r\n\t},\r\n\tsetDocumentLocator:function (locator) {\r\n\t if(this.locator = locator){// && !('lineNumber' in locator)){\r\n\t \tlocator.lineNumber = 0;\r\n\t }\r\n\t},\r\n\t//LexicalHandler\r\n\tcomment:function(chars, start, length) {\r\n\t\tchars = _toString.apply(this,arguments)\r\n\t var comm = this.doc.createComment(chars);\r\n\t this.locator && position(this.locator,comm)\r\n\t appendElement(this, comm);\r\n\t},\r\n\t\r\n\tstartCDATA:function() {\r\n\t //used in characters() methods\r\n\t this.cdata = true;\r\n\t},\r\n\tendCDATA:function() {\r\n\t this.cdata = false;\r\n\t},\r\n\t\r\n\tstartDTD:function(name, publicId, systemId) {\r\n\t\tvar impl = this.doc.implementation;\r\n\t if (impl && impl.createDocumentType) {\r\n\t var dt = impl.createDocumentType(name, publicId, systemId);\r\n\t this.locator && position(this.locator,dt)\r\n\t appendElement(this, dt);\r\n\t }\r\n\t},\r\n\t/**\r\n\t * @see org.xml.sax.ErrorHandler\r\n\t * @link http://www.saxproject.org/apidoc/org/xml/sax/ErrorHandler.html\r\n\t */\r\n\twarning:function(error) {\r\n\t\tconsole.warn('[xmldom warning]\\t'+error,_locator(this.locator));\r\n\t},\r\n\terror:function(error) {\r\n\t\tconsole.error('[xmldom error]\\t'+error,_locator(this.locator));\r\n\t},\r\n\tfatalError:function(error) {\r\n\t\tconsole.error('[xmldom fatalError]\\t'+error,_locator(this.locator));\r\n\t throw error;\r\n\t}\r\n}\r\nfunction _locator(l){\r\n\tif(l){\r\n\t\treturn '\\n@'+(l.systemId ||'')+'#[line:'+l.lineNumber+',col:'+l.columnNumber+']'\r\n\t}\r\n}\r\nfunction _toString(chars,start,length){\r\n\tif(typeof chars == 'string'){\r\n\t\treturn chars.substr(start,length)\r\n\t}else{//java sax connect width xmldom on rhino(what about: \"? && !(chars instanceof String)\")\r\n\t\tif(chars.length >= start+length || start){\r\n\t\t\treturn new java.lang.String(chars,start,length)+'';\r\n\t\t}\r\n\t\treturn chars;\r\n\t}\r\n}\r\n\r\n/*\r\n * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/LexicalHandler.html\r\n * used method of org.xml.sax.ext.LexicalHandler:\r\n * #comment(chars, start, length)\r\n * #startCDATA()\r\n * #endCDATA()\r\n * #startDTD(name, publicId, systemId)\r\n *\r\n *\r\n * IGNORED method of org.xml.sax.ext.LexicalHandler:\r\n * #endDTD()\r\n * #startEntity(name)\r\n * #endEntity(name)\r\n *\r\n *\r\n * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/DeclHandler.html\r\n * IGNORED method of org.xml.sax.ext.DeclHandler\r\n * \t#attributeDecl(eName, aName, type, mode, value)\r\n * #elementDecl(name, model)\r\n * #externalEntityDecl(name, publicId, systemId)\r\n * #internalEntityDecl(name, value)\r\n * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/EntityResolver2.html\r\n * IGNORED method of org.xml.sax.EntityResolver2\r\n * #resolveEntity(String name,String publicId,String baseURI,String systemId)\r\n * #resolveEntity(publicId, systemId)\r\n * #getExternalSubset(name, baseURI)\r\n * @link http://www.saxproject.org/apidoc/org/xml/sax/DTDHandler.html\r\n * IGNORED method of org.xml.sax.DTDHandler\r\n * #notationDecl(name, publicId, systemId) {};\r\n * #unparsedEntityDecl(name, publicId, systemId, notationName) {};\r\n */\r\n\"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl\".replace(/\\w+/g,function(key){\r\n\tDOMHandler.prototype[key] = function(){return null}\r\n})\r\n\r\n/* Private static helpers treated below as private instance methods, so don't need to add these to the public API; we might use a Relator to also get rid of non-standard public properties */\r\nfunction appendElement (hander,node) {\r\n if (!hander.currentElement) {\r\n hander.doc.appendChild(node);\r\n } else {\r\n hander.currentElement.appendChild(node);\r\n }\r\n}//appendChild and setAttributeNS are preformance key\r\n\r\n//if(typeof require == 'function'){\r\n\tvar XMLReader = require('./sax').XMLReader;\r\n\tvar DOMImplementation = exports.DOMImplementation = require('./dom').DOMImplementation;\r\n\texports.XMLSerializer = require('./dom').XMLSerializer ;\r\n\texports.DOMParser = DOMParser;\r\n//}\r\n","//[4] \tNameStartChar\t ::= \t\":\" | [A-Z] | \"_\" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]\r\n//[4a] \tNameChar\t ::= \tNameStartChar | \"-\" | \".\" | [0-9] | #xB7 | [#x0300-#x036F] | [#x203F-#x2040]\r\n//[5] \tName\t ::= \tNameStartChar (NameChar)*\r\nvar nameStartChar = /[A-Z_a-z\\xC0-\\xD6\\xD8-\\xF6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]///\\u10000-\\uEFFFF\r\nvar nameChar = new RegExp(\"[\\\\-\\\\.0-9\"+nameStartChar.source.slice(1,-1)+\"\\\\u00B7\\\\u0300-\\\\u036F\\\\u203F-\\\\u2040]\");\r\nvar tagNamePattern = new RegExp('^'+nameStartChar.source+nameChar.source+'*(?:\\:'+nameStartChar.source+nameChar.source+'*)?$');\r\n//var tagNamePattern = /^[a-zA-Z_][\\w\\-\\.]*(?:\\:[a-zA-Z_][\\w\\-\\.]*)?$/\r\n//var handlers = 'resolveEntity,getExternalSubset,characters,endDocument,endElement,endPrefixMapping,ignorableWhitespace,processingInstruction,setDocumentLocator,skippedEntity,startDocument,startElement,startPrefixMapping,notationDecl,unparsedEntityDecl,error,fatalError,warning,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,comment,endCDATA,endDTD,endEntity,startCDATA,startDTD,startEntity'.split(',')\r\n\r\n//S_TAG,\tS_ATTR,\tS_EQ,\tS_ATTR_NOQUOT_VALUE\r\n//S_ATTR_SPACE,\tS_ATTR_END,\tS_TAG_SPACE, S_TAG_CLOSE\r\nvar S_TAG = 0;//tag name offerring\r\nvar S_ATTR = 1;//attr name offerring \r\nvar S_ATTR_SPACE=2;//attr name end and space offer\r\nvar S_EQ = 3;//=space?\r\nvar S_ATTR_NOQUOT_VALUE = 4;//attr value(no quot value only)\r\nvar S_ATTR_END = 5;//attr value end and no space(quot end)\r\nvar S_TAG_SPACE = 6;//(attr value end || tag end ) && (space offer)\r\nvar S_TAG_CLOSE = 7;//closed el\r\n\r\nfunction XMLReader(){\r\n\t\r\n}\r\n\r\nXMLReader.prototype = {\r\n\tparse:function(source,defaultNSMap,entityMap){\r\n\t\tvar domBuilder = this.domBuilder;\r\n\t\tdomBuilder.startDocument();\r\n\t\t_copy(defaultNSMap ,defaultNSMap = {})\r\n\t\tparse(source,defaultNSMap,entityMap,\r\n\t\t\t\tdomBuilder,this.errorHandler);\r\n\t\tdomBuilder.endDocument();\r\n\t}\r\n}\r\nfunction parse(source,defaultNSMapCopy,entityMap,domBuilder,errorHandler){\r\n\tfunction fixedFromCharCode(code) {\r\n\t\t// String.prototype.fromCharCode does not supports\r\n\t\t// > 2 bytes unicode chars directly\r\n\t\tif (code > 0xffff) {\r\n\t\t\tcode -= 0x10000;\r\n\t\t\tvar surrogate1 = 0xd800 + (code >> 10)\r\n\t\t\t\t, surrogate2 = 0xdc00 + (code & 0x3ff);\r\n\r\n\t\t\treturn String.fromCharCode(surrogate1, surrogate2);\r\n\t\t} else {\r\n\t\t\treturn String.fromCharCode(code);\r\n\t\t}\r\n\t}\r\n\tfunction entityReplacer(a){\r\n\t\tvar k = a.slice(1,-1);\r\n\t\tif(k in entityMap){\r\n\t\t\treturn entityMap[k]; \r\n\t\t}else if(k.charAt(0) === '#'){\r\n\t\t\treturn fixedFromCharCode(parseInt(k.substr(1).replace('x','0x')))\r\n\t\t}else{\r\n\t\t\terrorHandler.error('entity not found:'+a);\r\n\t\t\treturn a;\r\n\t\t}\r\n\t}\r\n\tfunction appendText(end){//has some bugs\r\n\t\tif(end>start){\r\n\t\t\tvar xt = source.substring(start,end).replace(/&#?\\w+;/g,entityReplacer);\r\n\t\t\tlocator&&position(start);\r\n\t\t\tdomBuilder.characters(xt,0,end-start);\r\n\t\t\tstart = end\r\n\t\t}\r\n\t}\r\n\tfunction position(p,m){\r\n\t\twhile(p>=lineEnd && (m = linePattern.exec(source))){\r\n\t\t\tlineStart = m.index;\r\n\t\t\tlineEnd = lineStart + m[0].length;\r\n\t\t\tlocator.lineNumber++;\r\n\t\t\t//console.log('line++:',locator,startPos,endPos)\r\n\t\t}\r\n\t\tlocator.columnNumber = p-lineStart+1;\r\n\t}\r\n\tvar lineStart = 0;\r\n\tvar lineEnd = 0;\r\n\tvar linePattern = /.*(?:\\r\\n?|\\n)|.*$/g\r\n\tvar locator = domBuilder.locator;\r\n\t\r\n\tvar parseStack = [{currentNSMap:defaultNSMapCopy}]\r\n\tvar closeMap = {};\r\n\tvar start = 0;\r\n\twhile(true){\r\n\t\ttry{\r\n\t\t\tvar tagStart = source.indexOf('<',start);\r\n\t\t\tif(tagStart<0){\r\n\t\t\t\tif(!source.substr(start).match(/^\\s*$/)){\r\n\t\t\t\t\tvar doc = domBuilder.doc;\r\n\t \t\t\tvar text = doc.createTextNode(source.substr(start));\r\n\t \t\t\tdoc.appendChild(text);\r\n\t \t\t\tdomBuilder.currentElement = text;\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif(tagStart>start){\r\n\t\t\t\tappendText(tagStart);\r\n\t\t\t}\r\n\t\t\tswitch(source.charAt(tagStart+1)){\r\n\t\t\tcase '/':\r\n\t\t\t\tvar end = source.indexOf('>',tagStart+3);\r\n\t\t\t\tvar tagName = source.substring(tagStart+2,end);\r\n\t\t\t\tvar config = parseStack.pop();\r\n\t\t\t\tif(end<0){\r\n\t\t\t\t\t\r\n\t \t\ttagName = source.substring(tagStart+2).replace(/[\\s<].*/,'');\r\n\t \t\t//console.error('#@@@@@@'+tagName)\r\n\t \t\terrorHandler.error(\"end tag name: \"+tagName+' is not complete:'+config.tagName);\r\n\t \t\tend = tagStart+1+tagName.length;\r\n\t \t}else if(tagName.match(/\\s\r\n\t\t\t\tlocator&&position(tagStart);\r\n\t\t\t\tend = parseInstruction(source,tagStart,domBuilder);\r\n\t\t\t\tbreak;\r\n\t\t\tcase '!':// start){\r\n\t\t\tstart = end;\r\n\t\t}else{\r\n\t\t\t//TODO: 这里有可能sax回退,有位置错误风险\r\n\t\t\tappendText(Math.max(tagStart,start)+1);\r\n\t\t}\r\n\t}\r\n}\r\nfunction copyLocator(f,t){\r\n\tt.lineNumber = f.lineNumber;\r\n\tt.columnNumber = f.columnNumber;\r\n\treturn t;\r\n}\r\n\r\n/**\r\n * @see #appendElement(source,elStartEnd,el,selfClosed,entityReplacer,domBuilder,parseStack);\r\n * @return end of the elementStartPart(end of elementEndPart for selfClosed el)\r\n */\r\nfunction parseElementStartPart(source,start,el,currentNSMap,entityReplacer,errorHandler){\r\n\tvar attrName;\r\n\tvar value;\r\n\tvar p = ++start;\r\n\tvar s = S_TAG;//status\r\n\twhile(true){\r\n\t\tvar c = source.charAt(p);\r\n\t\tswitch(c){\r\n\t\tcase '=':\r\n\t\t\tif(s === S_ATTR){//attrName\r\n\t\t\t\tattrName = source.slice(start,p);\r\n\t\t\t\ts = S_EQ;\r\n\t\t\t}else if(s === S_ATTR_SPACE){\r\n\t\t\t\ts = S_EQ;\r\n\t\t\t}else{\r\n\t\t\t\t//fatalError: equal must after attrName or space after attrName\r\n\t\t\t\tthrow new Error('attribute equal must after attrName');\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase '\\'':\r\n\t\tcase '\"':\r\n\t\t\tif(s === S_EQ || s === S_ATTR //|| s == S_ATTR_SPACE\r\n\t\t\t\t){//equal\r\n\t\t\t\tif(s === S_ATTR){\r\n\t\t\t\t\terrorHandler.warning('attribute value must after \"=\"')\r\n\t\t\t\t\tattrName = source.slice(start,p)\r\n\t\t\t\t}\r\n\t\t\t\tstart = p+1;\r\n\t\t\t\tp = source.indexOf(c,start)\r\n\t\t\t\tif(p>0){\r\n\t\t\t\t\tvalue = source.slice(start,p).replace(/&#?\\w+;/g,entityReplacer);\r\n\t\t\t\t\tel.add(attrName,value,start-1);\r\n\t\t\t\t\ts = S_ATTR_END;\r\n\t\t\t\t}else{\r\n\t\t\t\t\t//fatalError: no end quot match\r\n\t\t\t\t\tthrow new Error('attribute value no end \\''+c+'\\' match');\r\n\t\t\t\t}\r\n\t\t\t}else if(s == S_ATTR_NOQUOT_VALUE){\r\n\t\t\t\tvalue = source.slice(start,p).replace(/&#?\\w+;/g,entityReplacer);\r\n\t\t\t\t//console.log(attrName,value,start,p)\r\n\t\t\t\tel.add(attrName,value,start);\r\n\t\t\t\t//console.dir(el)\r\n\t\t\t\terrorHandler.warning('attribute \"'+attrName+'\" missed start quot('+c+')!!');\r\n\t\t\t\tstart = p+1;\r\n\t\t\t\ts = S_ATTR_END\r\n\t\t\t}else{\r\n\t\t\t\t//fatalError: no equal before\r\n\t\t\t\tthrow new Error('attribute value must after \"=\"');\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase '/':\r\n\t\t\tswitch(s){\r\n\t\t\tcase S_TAG:\r\n\t\t\t\tel.setTagName(source.slice(start,p));\r\n\t\t\tcase S_ATTR_END:\r\n\t\t\tcase S_TAG_SPACE:\r\n\t\t\tcase S_TAG_CLOSE:\r\n\t\t\t\ts =S_TAG_CLOSE;\r\n\t\t\t\tel.closed = true;\r\n\t\t\tcase S_ATTR_NOQUOT_VALUE:\r\n\t\t\tcase S_ATTR:\r\n\t\t\tcase S_ATTR_SPACE:\r\n\t\t\t\tbreak;\r\n\t\t\t//case S_EQ:\r\n\t\t\tdefault:\r\n\t\t\t\tthrow new Error(\"attribute invalid close char('/')\")\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase ''://end document\r\n\t\t\t//throw new Error('unexpected end of input')\r\n\t\t\terrorHandler.error('unexpected end of input');\r\n\t\t\tif(s == S_TAG){\r\n\t\t\t\tel.setTagName(source.slice(start,p));\r\n\t\t\t}\r\n\t\t\treturn p;\r\n\t\tcase '>':\r\n\t\t\tswitch(s){\r\n\t\t\tcase S_TAG:\r\n\t\t\t\tel.setTagName(source.slice(start,p));\r\n\t\t\tcase S_ATTR_END:\r\n\t\t\tcase S_TAG_SPACE:\r\n\t\t\tcase S_TAG_CLOSE:\r\n\t\t\t\tbreak;//normal\r\n\t\t\tcase S_ATTR_NOQUOT_VALUE://Compatible state\r\n\t\t\tcase S_ATTR:\r\n\t\t\t\tvalue = source.slice(start,p);\r\n\t\t\t\tif(value.slice(-1) === '/'){\r\n\t\t\t\t\tel.closed = true;\r\n\t\t\t\t\tvalue = value.slice(0,-1)\r\n\t\t\t\t}\r\n\t\t\tcase S_ATTR_SPACE:\r\n\t\t\t\tif(s === S_ATTR_SPACE){\r\n\t\t\t\t\tvalue = attrName;\r\n\t\t\t\t}\r\n\t\t\t\tif(s == S_ATTR_NOQUOT_VALUE){\r\n\t\t\t\t\terrorHandler.warning('attribute \"'+value+'\" missed quot(\")!!');\r\n\t\t\t\t\tel.add(attrName,value.replace(/&#?\\w+;/g,entityReplacer),start)\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(currentNSMap[''] !== 'http://www.w3.org/1999/xhtml' || !value.match(/^(?:disabled|checked|selected)$/i)){\r\n\t\t\t\t\t\terrorHandler.warning('attribute \"'+value+'\" missed value!! \"'+value+'\" instead!!')\r\n\t\t\t\t\t}\r\n\t\t\t\t\tel.add(value,value,start)\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase S_EQ:\r\n\t\t\t\tthrow new Error('attribute value missed!!');\r\n\t\t\t}\r\n//\t\t\tconsole.log(tagName,tagNamePattern,tagNamePattern.test(tagName))\r\n\t\t\treturn p;\r\n\t\t/*xml space '\\x20' | #x9 | #xD | #xA; */\r\n\t\tcase '\\u0080':\r\n\t\t\tc = ' ';\r\n\t\tdefault:\r\n\t\t\tif(c<= ' '){//space\r\n\t\t\t\tswitch(s){\r\n\t\t\t\tcase S_TAG:\r\n\t\t\t\t\tel.setTagName(source.slice(start,p));//tagName\r\n\t\t\t\t\ts = S_TAG_SPACE;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase S_ATTR:\r\n\t\t\t\t\tattrName = source.slice(start,p)\r\n\t\t\t\t\ts = S_ATTR_SPACE;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase S_ATTR_NOQUOT_VALUE:\r\n\t\t\t\t\tvar value = source.slice(start,p).replace(/&#?\\w+;/g,entityReplacer);\r\n\t\t\t\t\terrorHandler.warning('attribute \"'+value+'\" missed quot(\")!!');\r\n\t\t\t\t\tel.add(attrName,value,start)\r\n\t\t\t\tcase S_ATTR_END:\r\n\t\t\t\t\ts = S_TAG_SPACE;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t//case S_TAG_SPACE:\r\n\t\t\t\t//case S_EQ:\r\n\t\t\t\t//case S_ATTR_SPACE:\r\n\t\t\t\t//\tvoid();break;\r\n\t\t\t\t//case S_TAG_CLOSE:\r\n\t\t\t\t\t//ignore warning\r\n\t\t\t\t}\r\n\t\t\t}else{//not space\r\n//S_TAG,\tS_ATTR,\tS_EQ,\tS_ATTR_NOQUOT_VALUE\r\n//S_ATTR_SPACE,\tS_ATTR_END,\tS_TAG_SPACE, S_TAG_CLOSE\r\n\t\t\t\tswitch(s){\r\n\t\t\t\t//case S_TAG:void();break;\r\n\t\t\t\t//case S_ATTR:void();break;\r\n\t\t\t\t//case S_ATTR_NOQUOT_VALUE:void();break;\r\n\t\t\t\tcase S_ATTR_SPACE:\r\n\t\t\t\t\tvar tagName = el.tagName;\r\n\t\t\t\t\tif(currentNSMap[''] !== 'http://www.w3.org/1999/xhtml' || !attrName.match(/^(?:disabled|checked|selected)$/i)){\r\n\t\t\t\t\t\terrorHandler.warning('attribute \"'+attrName+'\" missed value!! \"'+attrName+'\" instead2!!')\r\n\t\t\t\t\t}\r\n\t\t\t\t\tel.add(attrName,attrName,start);\r\n\t\t\t\t\tstart = p;\r\n\t\t\t\t\ts = S_ATTR;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase S_ATTR_END:\r\n\t\t\t\t\terrorHandler.warning('attribute space is required\"'+attrName+'\"!!')\r\n\t\t\t\tcase S_TAG_SPACE:\r\n\t\t\t\t\ts = S_ATTR;\r\n\t\t\t\t\tstart = p;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase S_EQ:\r\n\t\t\t\t\ts = S_ATTR_NOQUOT_VALUE;\r\n\t\t\t\t\tstart = p;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase S_TAG_CLOSE:\r\n\t\t\t\t\tthrow new Error(\"elements closed character '/' and '>' must be connected to\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}//end outer switch\r\n\t\t//console.log('p++',p)\r\n\t\tp++;\r\n\t}\r\n}\r\n/**\r\n * @return true if has new namespace define\r\n */\r\nfunction appendElement(el,domBuilder,currentNSMap){\r\n\tvar tagName = el.tagName;\r\n\tvar localNSMap = null;\r\n\t//var currentNSMap = parseStack[parseStack.length-1].currentNSMap;\r\n\tvar i = el.length;\r\n\twhile(i--){\r\n\t\tvar a = el[i];\r\n\t\tvar qName = a.qName;\r\n\t\tvar value = a.value;\r\n\t\tvar nsp = qName.indexOf(':');\r\n\t\tif(nsp>0){\r\n\t\t\tvar prefix = a.prefix = qName.slice(0,nsp);\r\n\t\t\tvar localName = qName.slice(nsp+1);\r\n\t\t\tvar nsPrefix = prefix === 'xmlns' && localName\r\n\t\t}else{\r\n\t\t\tlocalName = qName;\r\n\t\t\tprefix = null\r\n\t\t\tnsPrefix = qName === 'xmlns' && ''\r\n\t\t}\r\n\t\t//can not set prefix,because prefix !== ''\r\n\t\ta.localName = localName ;\r\n\t\t//prefix == null for no ns prefix attribute \r\n\t\tif(nsPrefix !== false){//hack!!\r\n\t\t\tif(localNSMap == null){\r\n\t\t\t\tlocalNSMap = {}\r\n\t\t\t\t//console.log(currentNSMap,0)\r\n\t\t\t\t_copy(currentNSMap,currentNSMap={})\r\n\t\t\t\t//console.log(currentNSMap,1)\r\n\t\t\t}\r\n\t\t\tcurrentNSMap[nsPrefix] = localNSMap[nsPrefix] = value;\r\n\t\t\ta.uri = 'http://www.w3.org/2000/xmlns/'\r\n\t\t\tdomBuilder.startPrefixMapping(nsPrefix, value) \r\n\t\t}\r\n\t}\r\n\tvar i = el.length;\r\n\twhile(i--){\r\n\t\ta = el[i];\r\n\t\tvar prefix = a.prefix;\r\n\t\tif(prefix){//no prefix attribute has no namespace\r\n\t\t\tif(prefix === 'xml'){\r\n\t\t\t\ta.uri = 'http://www.w3.org/XML/1998/namespace';\r\n\t\t\t}if(prefix !== 'xmlns'){\r\n\t\t\t\ta.uri = currentNSMap[prefix || '']\r\n\t\t\t\t\r\n\t\t\t\t//{console.log('###'+a.qName,domBuilder.locator.systemId+'',currentNSMap,a.uri)}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tvar nsp = tagName.indexOf(':');\r\n\tif(nsp>0){\r\n\t\tprefix = el.prefix = tagName.slice(0,nsp);\r\n\t\tlocalName = el.localName = tagName.slice(nsp+1);\r\n\t}else{\r\n\t\tprefix = null;//important!!\r\n\t\tlocalName = el.localName = tagName;\r\n\t}\r\n\t//no prefix element has default namespace\r\n\tvar ns = el.uri = currentNSMap[prefix || ''];\r\n\tdomBuilder.startElement(ns,localName,tagName,el);\r\n\t//endPrefixMapping and startPrefixMapping have not any help for dom builder\r\n\t//localNSMap = null\r\n\tif(el.closed){\r\n\t\tdomBuilder.endElement(ns,localName,tagName);\r\n\t\tif(localNSMap){\r\n\t\t\tfor(prefix in localNSMap){\r\n\t\t\t\tdomBuilder.endPrefixMapping(prefix) \r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\tel.currentNSMap = currentNSMap;\r\n\t\tel.localNSMap = localNSMap;\r\n\t\t//parseStack.push(el);\r\n\t\treturn true;\r\n\t}\r\n}\r\nfunction parseHtmlSpecialContent(source,elStartEnd,tagName,entityReplacer,domBuilder){\r\n\tif(/^(?:script|textarea)$/i.test(tagName)){\r\n\t\tvar elEndStart = source.indexOf('',elStartEnd);\r\n\t\tvar text = source.substring(elStartEnd+1,elEndStart);\r\n\t\tif(/[&<]/.test(text)){\r\n\t\t\tif(/^script$/i.test(tagName)){\r\n\t\t\t\t//if(!/\\]\\]>/.test(text)){\r\n\t\t\t\t\t//lexHandler.startCDATA();\r\n\t\t\t\t\tdomBuilder.characters(text,0,text.length);\r\n\t\t\t\t\t//lexHandler.endCDATA();\r\n\t\t\t\t\treturn elEndStart;\r\n\t\t\t\t//}\r\n\t\t\t}//}else{//text area\r\n\t\t\t\ttext = text.replace(/&#?\\w+;/g,entityReplacer);\r\n\t\t\t\tdomBuilder.characters(text,0,text.length);\r\n\t\t\t\treturn elEndStart;\r\n\t\t\t//}\r\n\t\t\t\r\n\t\t}\r\n\t}\r\n\treturn elStartEnd+1;\r\n}\r\nfunction fixSelfClosed(source,elStartEnd,tagName,closeMap){\r\n\t//if(tagName in closeMap){\r\n\tvar pos = closeMap[tagName];\r\n\tif(pos == null){\r\n\t\t//console.log(tagName)\r\n\t\tpos = source.lastIndexOf('')\r\n\t\tif(pos',start+4);\r\n\t\t\t//append comment source.substring(4,end)//\");\n\tcase DOCUMENT_TYPE_NODE:\n\t\tvar pubid = node.publicId;\n\t\tvar sysid = node.systemId;\n\t\tbuf.push('');\n\t\t}else if(sysid && sysid!='.'){\n\t\t\tbuf.push(' SYSTEM \"',sysid,'\">');\n\t\t}else{\n\t\t\tvar sub = node.internalSubset;\n\t\t\tif(sub){\n\t\t\t\tbuf.push(\" [\",sub,\"]\");\n\t\t\t}\n\t\t\tbuf.push(\">\");\n\t\t}\n\t\treturn;\n\tcase PROCESSING_INSTRUCTION_NODE:\n\t\treturn buf.push( \"\");\n\tcase ENTITY_REFERENCE_NODE:\n\t\treturn buf.push( '&',node.nodeName,';');\n\t//case ENTITY_NODE:\n\t//case NOTATION_NODE:\n\tdefault:\n\t\tbuf.push('??',node.nodeName);\n\t}\n}\nfunction importNode(doc,node,deep){\n\tvar node2;\n\tswitch (node.nodeType) {\n\tcase ELEMENT_NODE:\n\t\tnode2 = node.cloneNode(false);\n\t\tnode2.ownerDocument = doc;\n\t\t//var attrs = node2.attributes;\n\t\t//var len = attrs.length;\n\t\t//for(var i=0;i, Joscha Feth 2013 [MIT Licensed]\r\n\r\nvar element_start_char =\r\n \"a-zA-Z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u00FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FFF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\";\r\nvar element_non_start_char = \"\\-.0-9\\u00B7\\u0300-\\u036F\\u203F\\u2040\";\r\nvar element_replace = new RegExp(\"^([^\" + element_start_char + \"])|^((x|X)(m|M)(l|L))|([^\" + element_start_char + element_non_start_char + \"])\", \"g\");\r\nvar not_safe_in_xml = /[^\\x09\\x0A\\x0D\\x20-\\xFF\\x85\\xA0-\\uD7FF\\uE000-\\uFDCF\\uFDE0-\\uFFFD]/gm;\r\n\r\nvar objKeys = function (obj) {\r\n var l = [];\r\n if (obj instanceof Object) {\r\n for (var k in obj) {\r\n if (obj.hasOwnProperty(k)) {\r\n l.push(k);\r\n }\r\n }\r\n }\r\n return l;\r\n};\r\nvar process_to_xml = function (node_data, options) {\r\n\r\n var makeNode = function (name, content, attributes, level, hasSubNodes) {\r\n var indent_value = options.indent !== undefined ? options.indent : \"\\t\";\r\n var indent = options.prettyPrint ? '\\n' + new Array(level).join(indent_value) : '';\r\n if (options.removeIllegalNameCharacters) {\r\n name = name.replace(element_replace, '_');\r\n }\r\n\r\n var node = [indent, '<', name, (attributes || '')];\r\n if (content && content.length > 0) {\r\n node.push('>')\r\n node.push(content);\r\n hasSubNodes && node.push(indent);\r\n node.push('');\r\n } else {\r\n node.push('/>');\r\n }\r\n return node.join('');\r\n };\r\n\r\n return (function fn(node_data, node_descriptor, level) {\r\n var type = typeof node_data;\r\n if ((Array.isArray) ? Array.isArray(node_data) : node_data instanceof Array) {\r\n type = 'array';\r\n } else if (node_data instanceof Date) {\r\n type = 'date';\r\n }\r\n\r\n switch (type) {\r\n //if value is an array create child nodes from values\r\n case 'array':\r\n var ret = [];\r\n node_data.map(function (v) {\r\n ret.push(fn(v, 1, level + 1));\r\n //entries that are values of an array are the only ones that can be special node descriptors\r\n });\r\n options.prettyPrint && ret.push('\\n');\r\n return ret.join('');\r\n break;\r\n\r\n case 'date':\r\n // cast dates to ISO 8601 date (soap likes it)\r\n return node_data.toJSON ? node_data.toJSON() : node_data + '';\r\n break;\r\n\r\n case 'object':\r\n var nodes = [];\r\n for (var name in node_data) {\r\n if (node_data.hasOwnProperty(name)) {\r\n if (node_data[name] instanceof Array) {\r\n for (var j = 0; j < node_data[name].length; j++) {\r\n if (node_data[name].hasOwnProperty(j)) {\r\n nodes.push(makeNode(name, fn(node_data[name][j], 0, level + 1), null, level + 1, objKeys(node_data[name][j]).length));\r\n }\r\n }\r\n } else {\r\n nodes.push(makeNode(name, fn(node_data[name], 0, level + 1), null, level + 1));\r\n }\r\n }\r\n }\r\n options.prettyPrint && nodes.length > 0 && nodes.push('\\n');\r\n return nodes.join('');\r\n break;\r\n\r\n case 'function':\r\n return node_data();\r\n break;\r\n\r\n default:\r\n return options.escape ? esc(node_data) : '' + node_data;\r\n }\r\n\r\n }(node_data, 0, 0))\r\n};\r\n\r\n\r\nvar xml_header = function (standalone) {\r\n var ret = ['');\r\n\r\n return ret.join('');\r\n};\r\n\r\nfunction esc(str) {\r\n return ('' + str).replace(/&/g, '&')\r\n .replace(//g, '>')\r\n .replace(/'/g, ''')\r\n .replace(/\"/g, '"')\r\n .replace(not_safe_in_xml, '');\r\n}\r\n\r\nmodule.exports = function (obj, options) {\r\n if (!options) {\r\n options = {\r\n xmlHeader: {\r\n standalone: true\r\n },\r\n prettyPrint: true,\r\n indent: \" \",\r\n escape: true,\r\n };\r\n }\r\n\r\n if (typeof obj == 'string') {\r\n try {\r\n obj = JSON.parse(obj.toString());\r\n } catch (e) {\r\n return false;\r\n }\r\n }\r\n\r\n var xmlheader = '';\r\n var docType = '';\r\n if (options) {\r\n if (typeof options == 'object') {\r\n // our config is an object\r\n\r\n if (options.xmlHeader) {\r\n // the user wants an xml header\r\n xmlheader = xml_header(!!options.xmlHeader.standalone);\r\n }\r\n\r\n if (typeof options.docType != 'undefined') {\r\n docType = ''\r\n }\r\n } else {\r\n // our config is a boolean value, so just add xml header\r\n xmlheader = xml_header();\r\n }\r\n }\r\n options = options || {}\r\n\r\n var ret = [\r\n xmlheader,\r\n (options.prettyPrint && docType ? '\\n' : ''),\r\n docType,\r\n process_to_xml(obj, options)\r\n ];\r\n return ret.join('').replace(/\\n{2,}/g, '\\n').replace(/\\s+$/g, '');\r\n};","var initEvent = function (cos) {\r\n var listeners = {};\r\n var getList = function (action) {\r\n !listeners[action] && (listeners[action] = []);\r\n return listeners[action];\r\n };\r\n cos.on = function (action, callback) {\r\n if (action === 'task-list-update') {\r\n console.warn('warning: Event \"' + action + '\" has been deprecated. Please use \"list-update\" instead.');\r\n }\r\n getList(action).push(callback);\r\n };\r\n cos.off = function (action, callback) {\r\n var list = getList(action);\r\n for (var i = list.length - 1; i >= 0; i--) {\r\n callback === list[i] && list.splice(i, 1);\r\n }\r\n };\r\n cos.emit = function (action, data) {\r\n var list = getList(action).map(function (cb) {\r\n return cb;\r\n });\r\n for (var i = 0; i < list.length; i++) {\r\n list[i](data);\r\n }\r\n };\r\n};\r\n\r\nvar EventProxy = function () {\r\n initEvent(this);\r\n};\r\n\r\nmodule.exports.init = initEvent;\r\nmodule.exports.EventProxy = EventProxy;","var session = require('./session');\r\nvar util = require('./util');\r\n\r\nvar originApiMap = {};\r\nvar transferToTaskMethod = function (apiMap, apiName) {\r\n originApiMap[apiName] = apiMap[apiName];\r\n apiMap[apiName] = function (params, callback) {\r\n if (params.SkipTask) {\r\n originApiMap[apiName].call(this, params, callback);\r\n } else {\r\n this._addTask(apiName, params, callback);\r\n }\r\n };\r\n};\r\n\r\nvar initTask = function (cos) {\r\n\r\n var queue = [];\r\n var tasks = {};\r\n var uploadingFileCount = 0;\r\n var nextUploadIndex = 0;\r\n\r\n // 接口返回简略的任务信息\r\n var formatTask = function (task) {\r\n var t = {\r\n id: task.id,\r\n Bucket: task.Bucket,\r\n Region: task.Region,\r\n Key: task.Key,\r\n FilePath: task.FilePath,\r\n state: task.state,\r\n loaded: task.loaded,\r\n size: task.size,\r\n speed: task.speed,\r\n percent: task.percent,\r\n hashPercent: task.hashPercent,\r\n error: task.error,\r\n };\r\n if (task.FilePath) t.FilePath = task.FilePath;\r\n if (task._custom) t._custom = task._custom;\r\n return t;\r\n };\r\n\r\n var emitListUpdate = (function () {\r\n var timer;\r\n var emit = function () {\r\n timer = 0;\r\n cos.emit('task-list-update', {list: util.map(queue, formatTask)});\r\n cos.emit('list-update', {list: util.map(queue, formatTask)});\r\n };\r\n return function () {\r\n if (!timer) timer = setTimeout(emit);\r\n }\r\n })();\r\n\r\n var clearQueue = function () {\r\n if (queue.length <= cos.options.UploadQueueSize) return;\r\n for (var i = 0;\r\n i < nextUploadIndex && // 小于当前操作的 index 才清理\r\n i < queue.length && // 大于队列才清理\r\n queue.length > cos.options.UploadQueueSize // 如果还太多,才继续清理\r\n ;) {\r\n var isActive = queue[i].state === 'waiting' || queue[i].state === 'checking' || queue[i].state === 'uploading';\r\n if (!queue[i] || !isActive) {\r\n tasks[queue[i].id] && (delete tasks[queue[i].id]);\r\n queue.splice(i, 1);\r\n nextUploadIndex--;\r\n } else {\r\n i++;\r\n }\r\n }\r\n emitListUpdate();\r\n };\r\n\r\n var startNextTask = function () {\r\n // 检查是否允许增加执行进程\r\n if (uploadingFileCount >= cos.options.FileParallelLimit) return;\r\n // 跳过不可执行的任务\r\n while (queue[nextUploadIndex] && queue[nextUploadIndex].state !== 'waiting') nextUploadIndex++;\r\n // 检查是否已遍历结束\r\n if (nextUploadIndex >= queue.length) return;\r\n // 上传该遍历到的任务\r\n var task = queue[nextUploadIndex];\r\n nextUploadIndex++;\r\n uploadingFileCount++;\r\n task.state = 'checking';\r\n task.params.onTaskStart && task.params.onTaskStart(formatTask(task));\r\n !task.params.UploadData && (task.params.UploadData = {});\r\n var apiParams = util.formatParams(task.api, task.params);\r\n originApiMap[task.api].call(cos, apiParams, function (err, data) {\r\n if (!cos._isRunningTask(task.id)) return;\r\n if (task.state === 'checking' || task.state === 'uploading') {\r\n task.state = err ? 'error' : 'success';\r\n err && (task.error = err);\r\n uploadingFileCount--;\r\n emitListUpdate();\r\n startNextTask();\r\n task.callback && task.callback(err, data);\r\n if (task.state === 'success') {\r\n if (task.params) {\r\n delete task.params.UploadData;\r\n delete task.params.Body;\r\n delete task.params;\r\n }\r\n delete task.callback;\r\n }\r\n }\r\n clearQueue();\r\n });\r\n emitListUpdate();\r\n // 异步执行下一个任务\r\n setTimeout(startNextTask);\r\n };\r\n\r\n var killTask = function (id, switchToState) {\r\n var task = tasks[id];\r\n if (!task) return;\r\n var waiting = task && task.state === 'waiting';\r\n var running = task && (task.state === 'checking' || task.state === 'uploading');\r\n if (switchToState === 'canceled' && task.state !== 'canceled' ||\r\n switchToState === 'paused' && waiting ||\r\n switchToState === 'paused' && running) {\r\n if (switchToState === 'paused' && task.params.Body && typeof task.params.Body.pipe === 'function') {\r\n console.error('stream not support pause');\r\n return;\r\n }\r\n task.state = switchToState;\r\n cos.emit('inner-kill-task', {TaskId: id, toState: switchToState});\r\n try {\r\n var UploadId = task && task.params && task.params.UploadData.UploadId\r\n } catch(e) {}\r\n if (switchToState === 'canceled' && UploadId) session.removeUsing(UploadId)\r\n emitListUpdate();\r\n if (running) {\r\n uploadingFileCount--;\r\n startNextTask();\r\n }\r\n if (switchToState === 'canceled') {\r\n if (task.params) {\r\n delete task.params.UploadData;\r\n delete task.params.Body;\r\n delete task.params;\r\n }\r\n delete task.callback;\r\n }\r\n }\r\n clearQueue();\r\n };\r\n\r\n cos._addTasks = function (taskList) {\r\n util.each(taskList, function (task) {\r\n cos._addTask(task.api, task.params, task.callback, true);\r\n });\r\n emitListUpdate();\r\n };\r\n\r\n var isTaskReadyWarning = true;\r\n cos._addTask = function (api, params, callback, ignoreAddEvent) {\r\n\r\n // 复制参数对象\r\n params = util.formatParams(api, params);\r\n\r\n // 生成 id\r\n var id = util.uuid();\r\n params.TaskId = id;\r\n params.onTaskReady && params.onTaskReady(id);\r\n if (params.TaskReady) {\r\n params.TaskReady(id);\r\n isTaskReadyWarning && console.warn('warning: Param \"TaskReady\" has been deprecated. Please use \"onTaskReady\" instead.');\r\n isTaskReadyWarning = false;\r\n }\r\n\r\n var task = {\r\n // env\r\n params: params,\r\n callback: callback,\r\n api: api,\r\n index: queue.length,\r\n // task\r\n id: id,\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n Key: params.Key,\r\n FilePath: params.FilePath || '',\r\n state: 'waiting',\r\n loaded: 0,\r\n size: 0,\r\n speed: 0,\r\n percent: 0,\r\n hashPercent: 0,\r\n error: null,\r\n _custom: params._custom,\r\n };\r\n var onHashProgress = params.onHashProgress;\r\n params.onHashProgress = function (info) {\r\n if (!cos._isRunningTask(task.id)) return;\r\n task.hashPercent = info.percent;\r\n onHashProgress && onHashProgress(info);\r\n emitListUpdate();\r\n };\r\n var onProgress = params.onProgress;\r\n params.onProgress = function (info) {\r\n if (!cos._isRunningTask(task.id)) return;\r\n task.state === 'checking' && (task.state = 'uploading');\r\n task.loaded = info.loaded;\r\n task.speed = info.speed;\r\n task.percent = info.percent;\r\n onProgress && onProgress(info);\r\n emitListUpdate();\r\n };\r\n\r\n // 异步获取 filesize\r\n util.getFileSize(api, params, function (err, size) {\r\n // 开始处理上传\r\n if (err) { // 如果获取大小出错,不加入队列\r\n callback(err);\r\n return;\r\n }\r\n // 获取完文件大小再把任务加入队列\r\n tasks[id] = task;\r\n queue.push(task);\r\n task.size = size;\r\n !ignoreAddEvent && emitListUpdate();\r\n startNextTask();\r\n clearQueue();\r\n });\r\n return id;\r\n };\r\n cos._isRunningTask = function (id) {\r\n var task = tasks[id];\r\n return !!(task && (task.state === 'checking' || task.state === 'uploading'));\r\n };\r\n cos.getTaskList = function () {\r\n return util.map(queue, formatTask);\r\n };\r\n cos.cancelTask = function (id) {\r\n killTask(id, 'canceled');\r\n };\r\n cos.pauseTask = function (id) {\r\n killTask(id, 'paused');\r\n };\r\n cos.restartTask = function (id) {\r\n var task = tasks[id];\r\n if (task && (task.state === 'paused' || task.state === 'error')) {\r\n task.state = 'waiting';\r\n emitListUpdate();\r\n nextUploadIndex = Math.min(nextUploadIndex, task.index);\r\n startNextTask();\r\n }\r\n };\r\n cos.isUploadRunning = function () {\r\n return uploadingFileCount || nextUploadIndex < queue.length;\r\n };\r\n\r\n};\r\n\r\nmodule.exports.transferToTaskMethod = transferToTaskMethod;\r\nmodule.exports.init = initTask;\r\n","var util = require('./util');\r\n\r\n// 按照文件特征值,缓存 UploadId\r\nvar cacheKey = 'cos_sdk_upload_cache';\r\nvar expires = 30 * 24 * 3600;\r\nvar cache;\r\nvar timer;\r\n\r\nvar init = function () {\r\n if (cache) return;\r\n cache = JSON.parse(localStorage.getItem(cacheKey) || '[]') || [];\r\n // 清理太老旧的数据\r\n var changed = false;\r\n var now = Math.round(Date.now() / 1000);\r\n for (var i = cache.length - 1; i >= 0; i--) {\r\n var mtime = cache[i][2];\r\n if (!mtime || mtime + expires < now) {\r\n cache.splice(i, 1);\r\n changed = true;\r\n }\r\n }\r\n changed && localStorage.setItem(cacheKey, JSON.stringify(cache));\r\n};\r\n\r\n// 把缓存存到本地\r\nvar save = function () {\r\n if (timer) return;\r\n timer = setTimeout(function () {\r\n localStorage.setItem(cacheKey, JSON.stringify(cache));\r\n timer = null;\r\n }, 400);\r\n};\r\n\r\nvar mod = {\r\n using: {},\r\n // 标记 UploadId 正在使用\r\n setUsing: function (uuid) {\r\n mod.using[uuid] = true;\r\n },\r\n // 标记 UploadId 已经没在使用\r\n removeUsing: function (uuid) {\r\n delete mod.using[uuid];\r\n },\r\n // 用上传参数生成哈希值\r\n getFileId: function (file, ChunkSize, Bucket, Key) {\r\n if (file.name && file.size && file.lastModifiedDate && ChunkSize) {\r\n return util.md5([file.name, file.size, file.lastModifiedDate, ChunkSize, Bucket, Key].join('::'));\r\n } else {\r\n return null;\r\n }\r\n },\r\n // 获取文件对应的 UploadId 列表\r\n getUploadIdList: function (uuid) {\r\n if (!uuid) return null;\r\n init();\r\n var list = [];\r\n for (var i = 0; i < cache.length; i++) {\r\n if (cache[i][0] === uuid)\r\n list.push(cache[i][1]);\r\n }\r\n return list.length ? list : null;\r\n },\r\n // 缓存 UploadId\r\n saveUploadId: function (uuid, UploadId, limit) {\r\n init();\r\n if (!uuid) return;\r\n // 清理没用的 UploadId\r\n for (var i = cache.length - 1; i >= 0; i--) {\r\n var item = cache[i];\r\n if (item[0] === uuid && item[1] === UploadId) {\r\n cache.splice(i, 1);\r\n }\r\n }\r\n cache.unshift([uuid, UploadId, Math.round(Date.now() / 1000)]);\r\n if (cache.length > limit) cache.splice(limit);\r\n save();\r\n },\r\n // UploadId 已用完,移除掉\r\n removeUploadId: function (UploadId) {\r\n init();\r\n delete mod.using[UploadId];\r\n for (var i = cache.length - 1; i >= 0; i--) {\r\n if (cache[i][1] === UploadId) cache.splice(i, 1)\r\n }\r\n save();\r\n },\r\n};\r\n\r\nmodule.exports = mod;\r\n","var REQUEST = require('../lib/request');\r\nvar util = require('./util');\r\n\r\n\r\n// Bucket 相关\r\n\r\n/**\r\n * 获取用户的 bucket 列表\r\n * @param {Object} params 回调函数,必须,下面为参数列表\r\n * 无特殊参数\r\n * @param {Function} callback 回调函数,必须\r\n */\r\nfunction getService(params, callback) {\r\n\r\n if (typeof params === 'function') {\r\n callback = params;\r\n params = {};\r\n }\r\n var protocol = this.options.Protocol || (util.isBrowser && location.protocol === 'http:' ? 'http:' : 'https:');\r\n var domain = this.options.ServiceDomain;\r\n var region = params.Region;\r\n if (domain) {\r\n domain = domain.replace(/\\{Region\\}/ig, region || '').replace(/\\{.*?\\}/ig, '');\r\n if (!/^[a-zA-Z]+:\\/\\//.test(domain)) {\r\n domain = protocol + '//' + domain;\r\n }\r\n if (domain.slice(-1) === '/') {\r\n domain = domain.slice(0, -1);\r\n }\r\n } else if(region){\r\n domain = protocol + '//cos.'+ region + '.myqcloud.com';\r\n } else {\r\n domain = protocol + '//service.cos.myqcloud.com';\r\n }\r\n\r\n submitRequest.call(this, {\r\n Action: 'name/cos:GetService',\r\n url: domain,\r\n method: 'GET',\r\n headers: params.Headers,\r\n }, function (err, data) {\r\n if (err) {\r\n return callback(err);\r\n }\r\n var buckets = (data && data.ListAllMyBucketsResult && data.ListAllMyBucketsResult.Buckets\r\n && data.ListAllMyBucketsResult.Buckets.Bucket) || [];\r\n buckets = util.isArray(buckets) ? buckets : [buckets];\r\n var owner = (data && data.ListAllMyBucketsResult && data.ListAllMyBucketsResult.Owner) || {};\r\n callback(null, {\r\n Buckets: buckets,\r\n Owner: owner,\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n}\r\n\r\n/**\r\n * 创建 Bucket,并初始化访问权限\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {String} params.ACL 用户自定义文件权限,可以设置:private,public-read;默认值:private,非必须\r\n * @param {String} params.GrantRead 赋予被授权者读的权限,格式x-cos-grant-read: uin=\" \",uin=\" \",非必须\r\n * @param {String} params.GrantWrite 赋予被授权者写的权限,格式x-cos-grant-write: uin=\" \",uin=\" \",非必须\r\n * @param {String} params.GrantFullControl 赋予被授权者读写权限,格式x-cos-grant-full-control: uin=\" \",uin=\" \",非必须\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回的数据\r\n * @return {String} data.Location 操作地址\r\n */\r\nfunction putBucket(params, callback) {\r\n\r\n var self = this;\r\n submitRequest.call(this, {\r\n Action: 'name/cos:PutBucket',\r\n method: 'PUT',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n headers: params.Headers,\r\n }, function (err, data) {\r\n if (err) {\r\n return callback(err);\r\n }\r\n var url = getUrl({\r\n protocol: self.options.Protocol,\r\n domain: self.options.Domain,\r\n bucket: params.Bucket,\r\n region: params.Region,\r\n isLocation: true,\r\n });\r\n callback(null, {\r\n Location: url,\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n}\r\n\r\n/**\r\n * 查看是否存在该Bucket,是否有权限访问\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回的数据\r\n * @return {Boolean} data.BucketExist Bucket是否存在\r\n * @return {Boolean} data.BucketAuth 是否有 Bucket 的访问权限\r\n */\r\nfunction headBucket(params, callback) {\r\n submitRequest.call(this, {\r\n Action: 'name/cos:HeadBucket',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n headers: params.Headers,\r\n method: 'HEAD',\r\n }, function (err, data) {\r\n callback(err, data);\r\n });\r\n}\r\n\r\n/**\r\n * 获取 Bucket 下的 object 列表\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {String} params.Prefix 前缀匹配,用来规定返回的文件前缀地址,非必须\r\n * @param {String} params.Delimiter 定界符为一个符号,如果有Prefix,则将Prefix到delimiter之间的相同路径归为一类,非必须\r\n * @param {String} params.Marker 默认以UTF-8二进制顺序列出条目,所有列出条目从marker开始,非必须\r\n * @param {String} params.MaxKeys 单次返回最大的条目数量,默认1000,非必须\r\n * @param {String} params.EncodingType 规定返回值的编码方式,非必须\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回的数据\r\n * @return {Object} data.ListBucketResult 返回的 object 列表信息\r\n */\r\nfunction getBucket(params, callback) {\r\n var reqParams = {};\r\n reqParams['prefix'] = params['Prefix'] || '';\r\n reqParams['delimiter'] = params['Delimiter'];\r\n reqParams['marker'] = params['Marker'];\r\n reqParams['max-keys'] = params['MaxKeys'];\r\n reqParams['encoding-type'] = params['EncodingType'];\r\n\r\n submitRequest.call(this, {\r\n Action: 'name/cos:GetBucket',\r\n ResourceKey: reqParams['prefix'],\r\n method: 'GET',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n headers: params.Headers,\r\n qs: reqParams,\r\n }, function (err, data) {\r\n if (err) {\r\n return callback(err);\r\n }\r\n var ListBucketResult = data.ListBucketResult || {};\r\n var Contents = ListBucketResult.Contents || [];\r\n var CommonPrefixes = ListBucketResult.CommonPrefixes || [];\r\n\r\n Contents = util.isArray(Contents) ? Contents : [Contents];\r\n CommonPrefixes = util.isArray(CommonPrefixes) ? CommonPrefixes : [CommonPrefixes];\r\n\r\n var result = util.clone(ListBucketResult);\r\n util.extend(result, {\r\n Contents: Contents,\r\n CommonPrefixes: CommonPrefixes,\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n\r\n callback(null, result);\r\n });\r\n}\r\n\r\n/**\r\n * 删除 Bucket\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回的数据\r\n * @return {String} data.Location 操作地址\r\n */\r\nfunction deleteBucket(params, callback) {\r\n submitRequest.call(this, {\r\n Action: 'name/cos:DeleteBucket',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n headers: params.Headers,\r\n method: 'DELETE',\r\n }, function (err, data) {\r\n if (err && err.statusCode === 204) {\r\n return callback(null, {statusCode: err.statusCode});\r\n } else if (err) {\r\n return callback(err);\r\n }\r\n callback(null, {\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n}\r\n\r\n/**\r\n * 设置 Bucket 的 权限列表\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {String} params.ACL 用户自定义文件权限,可以设置:private,public-read;默认值:private,非必须\r\n * @param {String} params.GrantRead 赋予被授权者读的权限,格式x-cos-grant-read: uin=\" \",uin=\" \",非必须\r\n * @param {String} params.GrantWrite 赋予被授权者写的权限,格式x-cos-grant-write: uin=\" \",uin=\" \",非必须\r\n * @param {String} params.GrantFullControl 赋予被授权者读写权限,格式x-cos-grant-full-control: uin=\" \",uin=\" \",非必须\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回的数据\r\n */\r\nfunction putBucketAcl(params, callback) {\r\n var headers = params.Headers;\r\n\r\n var xml = '';\r\n if (params['AccessControlPolicy']) {\r\n var AccessControlPolicy = util.clone(params['AccessControlPolicy'] || {});\r\n var Grants = AccessControlPolicy.Grants || AccessControlPolicy.Grant;\r\n Grants = util.isArray(Grants) ? Grants : [Grants];\r\n delete AccessControlPolicy.Grant;\r\n delete AccessControlPolicy.Grants;\r\n AccessControlPolicy.AccessControlList = {Grant: Grants};\r\n xml = util.json2xml({AccessControlPolicy: AccessControlPolicy});\r\n\r\n headers['Content-Type'] = 'application/xml';\r\n headers['Content-MD5'] = util.binaryBase64(util.md5(xml));\r\n }\r\n\r\n // Grant Header 去重\r\n util.each(headers, function (val, key) {\r\n if (key.indexOf('x-cos-grant-') === 0) {\r\n headers[key] = uniqGrant(headers[key]);\r\n }\r\n });\r\n\r\n submitRequest.call(this, {\r\n Action: 'name/cos:PutBucketACL',\r\n method: 'PUT',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n headers: headers,\r\n action: 'acl',\r\n body: xml,\r\n }, function (err, data) {\r\n if (err) {\r\n return callback(err);\r\n }\r\n callback(null, {\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n}\r\n\r\n/**\r\n * 获取 Bucket 的 权限列表\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回的数据\r\n * @return {Object} data.AccessControlPolicy 访问权限信息\r\n */\r\nfunction getBucketAcl(params, callback) {\r\n\r\n submitRequest.call(this, {\r\n Action: 'name/cos:GetBucketACL',\r\n method: 'GET',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n headers: params.Headers,\r\n action: 'acl',\r\n }, function (err, data) {\r\n if (err) {\r\n return callback(err);\r\n }\r\n var AccessControlPolicy = data.AccessControlPolicy || {};\r\n var Owner = AccessControlPolicy.Owner || {};\r\n var Grant = AccessControlPolicy.AccessControlList.Grant || [];\r\n Grant = util.isArray(Grant) ? Grant : [Grant];\r\n var result = decodeAcl(AccessControlPolicy);\r\n if (data.headers && data.headers['x-cos-acl']) {\r\n result.ACL = data.headers['x-cos-acl'];\r\n }\r\n result = util.extend(result, {\r\n Owner: Owner,\r\n Grants: Grant,\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n callback(null, result);\r\n });\r\n}\r\n\r\n/**\r\n * 设置 Bucket 的 跨域设置\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {Object} params.CORSConfiguration 相关的跨域设置,必须\r\n * @param {Array} params.CORSConfiguration.CORSRules 对应的跨域规则\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回的数据\r\n */\r\nfunction putBucketCors(params, callback) {\r\n\r\n var CORSConfiguration = params['CORSConfiguration'] || {};\r\n var CORSRules = CORSConfiguration['CORSRules'] || params['CORSRules'] || [];\r\n CORSRules = util.clone(util.isArray(CORSRules) ? CORSRules : [CORSRules]);\r\n util.each(CORSRules, function (rule) {\r\n util.each(['AllowedOrigin', 'AllowedHeader', 'AllowedMethod', 'ExposeHeader'], function (key, k) {\r\n var sKey = key + 's';\r\n var val = rule[sKey] || rule[key] || [];\r\n delete rule[sKey];\r\n rule[key] = util.isArray(val) ? val : [val];\r\n });\r\n });\r\n\r\n var xml = util.json2xml({CORSConfiguration: {CORSRule: CORSRules}});\r\n\r\n var headers = params.Headers;\r\n headers['Content-Type'] = 'application/xml';\r\n headers['Content-MD5'] = util.binaryBase64(util.md5(xml));\r\n\r\n submitRequest.call(this, {\r\n Action: 'name/cos:PutBucketCORS',\r\n method: 'PUT',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n body: xml,\r\n action: 'cors',\r\n headers: headers,\r\n }, function (err, data) {\r\n if (err) {\r\n return callback(err);\r\n }\r\n callback(null, {\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n}\r\n\r\n/**\r\n * 获取 Bucket 的 跨域设置\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回的数据\r\n * @return {Object} data.CORSRules Bucket的跨域设置\r\n */\r\nfunction getBucketCors(params, callback) {\r\n submitRequest.call(this, {\r\n Action: 'name/cos:GetBucketCORS',\r\n method: 'GET',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n headers: params.Headers,\r\n action: 'cors',\r\n }, function (err, data) {\r\n if (err) {\r\n if (err.statusCode === 404 && err.error && err.error.Code === 'NoSuchCORSConfiguration') {\r\n var result = {\r\n CORSRules: [],\r\n statusCode: err.statusCode,\r\n };\r\n err.headers && (result.headers = err.headers);\r\n callback(null, result);\r\n } else {\r\n callback(err);\r\n }\r\n return;\r\n }\r\n var CORSConfiguration = data.CORSConfiguration || {};\r\n var CORSRules = CORSConfiguration.CORSRules || CORSConfiguration.CORSRule || [];\r\n CORSRules = util.clone(util.isArray(CORSRules) ? CORSRules : [CORSRules]);\r\n\r\n util.each(CORSRules, function (rule) {\r\n util.each(['AllowedOrigin', 'AllowedHeader', 'AllowedMethod', 'ExposeHeader'], function (key, j) {\r\n var sKey = key + 's';\r\n var val = rule[sKey] || rule[key] || [];\r\n delete rule[key];\r\n rule[sKey] = util.isArray(val) ? val : [val];\r\n });\r\n });\r\n\r\n callback(null, {\r\n CORSRules: CORSRules,\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n}\r\n\r\n/**\r\n * 删除 Bucket 的 跨域设置\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回的数据\r\n */\r\nfunction deleteBucketCors(params, callback) {\r\n submitRequest.call(this, {\r\n Action: 'name/cos:DeleteBucketCORS',\r\n method: 'DELETE',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n headers: params.Headers,\r\n action: 'cors',\r\n }, function (err, data) {\r\n if (err && err.statusCode === 204) {\r\n return callback(null, {statusCode: err.statusCode});\r\n } else if (err) {\r\n return callback(err);\r\n }\r\n callback(null, {\r\n statusCode: data.statusCode || err.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n}\r\n\r\n/**\r\n * 获取 Bucket 的 地域信息\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回数据,包含地域信息 LocationConstraint\r\n */\r\nfunction getBucketLocation(params, callback) {\r\n submitRequest.call(this, {\r\n Action: 'name/cos:GetBucketLocation',\r\n method: 'GET',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n headers: params.Headers,\r\n action: 'location',\r\n }, function (err, data) {\r\n if (err) {\r\n return callback(err);\r\n }\r\n callback(null, data);\r\n });\r\n}\r\n\r\nfunction putBucketPolicy(params, callback) {\r\n var Policy = params['Policy'];\r\n var PolicyStr = Policy;\r\n try {\r\n if (typeof Policy === 'string') {\r\n Policy = JSON.parse(PolicyStr);\r\n } else {\r\n PolicyStr = JSON.stringify(Policy);\r\n }\r\n } catch (e) {\r\n callback({error: 'Policy format error'});\r\n }\r\n\r\n var headers = params.Headers;\r\n headers['Content-Type'] = 'application/json';\r\n headers['Content-MD5'] = util.binaryBase64(util.md5(PolicyStr));\r\n\r\n submitRequest.call(this, {\r\n Action: 'name/cos:PutBucketPolicy',\r\n method: 'PUT',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n action: 'policy',\r\n body: util.isBrowser ? PolicyStr : Policy,\r\n headers: headers,\r\n json: true,\r\n }, function (err, data) {\r\n if (err && err.statusCode === 204) {\r\n return callback(null, {statusCode: err.statusCode});\r\n } else if (err) {\r\n return callback(err);\r\n }\r\n callback(null, {\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n}\r\n\r\n/**\r\n * 获取 Bucket 的读取权限策略\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回数据\r\n */\r\nfunction getBucketPolicy(params, callback) {\r\n submitRequest.call(this, {\r\n Action: 'name/cos:GetBucketPolicy',\r\n method: 'GET',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n headers: params.Headers,\r\n action: 'policy',\r\n rawBody: true,\r\n }, function (err, data) {\r\n if (err) {\r\n if (err.statusCode && err.statusCode === 403) {\r\n return callback({ErrorStatus: 'Access Denied'});\r\n }\r\n if (err.statusCode && err.statusCode === 405) {\r\n return callback({ErrorStatus: 'Method Not Allowed'});\r\n }\r\n if (err.statusCode && err.statusCode === 404) {\r\n return callback({ErrorStatus: 'Policy Not Found'});\r\n }\r\n return callback(err);\r\n }\r\n var Policy = {};\r\n try {\r\n Policy = JSON.parse(data.body);\r\n } catch (e) {\r\n }\r\n callback(null, {\r\n Policy: Policy,\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n}\r\n\r\n/**\r\n * 删除 Bucket 的 跨域设置\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回的数据\r\n */\r\nfunction deleteBucketPolicy(params, callback) {\r\n submitRequest.call(this, {\r\n Action: 'name/cos:DeleteBucketPolicy',\r\n method: 'DELETE',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n headers: params.Headers,\r\n action: 'policy',\r\n }, function (err, data) {\r\n if (err && err.statusCode === 204) {\r\n return callback(null, {statusCode: err.statusCode});\r\n } else if (err) {\r\n return callback(err);\r\n }\r\n callback(null, {\r\n statusCode: data.statusCode || err.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n}\r\n\r\n/**\r\n * 设置 Bucket 的标签\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {Array} params.TagSet 标签设置,必须\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回数据\r\n */\r\nfunction putBucketTagging(params, callback) {\r\n\r\n var Tagging = params['Tagging'] || {};\r\n var Tags = Tagging.TagSet || Tagging.Tags || params['Tags'] || [];\r\n Tags = util.clone(util.isArray(Tags) ? Tags : [Tags]);\r\n var xml = util.json2xml({Tagging: {TagSet: {Tag: Tags}}});\r\n\r\n var headers = params.Headers;\r\n headers['Content-Type'] = 'application/xml';\r\n headers['Content-MD5'] = util.binaryBase64(util.md5(xml));\r\n\r\n submitRequest.call(this, {\r\n Action: 'name/cos:PutBucketTagging',\r\n method: 'PUT',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n body: xml,\r\n action: 'tagging',\r\n headers: headers,\r\n }, function (err, data) {\r\n if (err && err.statusCode === 204) {\r\n return callback(null, {statusCode: err.statusCode});\r\n } else if (err) {\r\n return callback(err);\r\n }\r\n callback(null, {\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n}\r\n\r\n/**\r\n * 获取 Bucket 的标签设置\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回数据\r\n */\r\nfunction getBucketTagging(params, callback) {\r\n\r\n submitRequest.call(this, {\r\n Action: 'name/cos:GetBucketTagging',\r\n method: 'GET',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n headers: params.Headers,\r\n action: 'tagging',\r\n }, function (err, data) {\r\n if (err) {\r\n if (err.statusCode === 404 && err.error && (err.error === \"Not Found\" || err.error.Code === 'NoSuchTagSet')) {\r\n var result = {\r\n Tags: [],\r\n statusCode: err.statusCode,\r\n };\r\n err.headers && (result.headers = err.headers);\r\n callback(null, result);\r\n } else {\r\n callback(err);\r\n }\r\n return;\r\n }\r\n var Tags = [];\r\n try {\r\n Tags = data.Tagging.TagSet.Tag || [];\r\n } catch (e) {\r\n }\r\n Tags = util.clone(util.isArray(Tags) ? Tags : [Tags]);\r\n callback(null, {\r\n Tags: Tags,\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n}\r\n\r\n/**\r\n * 删除 Bucket 的 标签设置\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回的数据\r\n */\r\nfunction deleteBucketTagging(params, callback) {\r\n submitRequest.call(this, {\r\n Action: 'name/cos:DeleteBucketTagging',\r\n method: 'DELETE',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n headers: params.Headers,\r\n action: 'tagging',\r\n }, function (err, data) {\r\n if (err && err.statusCode === 204) {\r\n return callback(null, {statusCode: err.statusCode});\r\n } else if (err) {\r\n return callback(err);\r\n }\r\n callback(null, {\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n}\r\n\r\nfunction putBucketLifecycle(params, callback) {\r\n\r\n var LifecycleConfiguration = params['LifecycleConfiguration'] || {};\r\n var Rules = LifecycleConfiguration.Rules || params.Rules || [];\r\n Rules = util.clone(Rules);\r\n var xml = util.json2xml({LifecycleConfiguration: {Rule: Rules}});\r\n\r\n var headers = params.Headers;\r\n headers['Content-Type'] = 'application/xml';\r\n headers['Content-MD5'] = util.binaryBase64(util.md5(xml));\r\n\r\n submitRequest.call(this, {\r\n Action: 'name/cos:PutBucketLifecycle',\r\n method: 'PUT',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n body: xml,\r\n action: 'lifecycle',\r\n headers: headers,\r\n }, function (err, data) {\r\n if (err && err.statusCode === 204) {\r\n return callback(null, {statusCode: err.statusCode});\r\n } else if (err) {\r\n return callback(err);\r\n }\r\n callback(null, {\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n}\r\n\r\nfunction getBucketLifecycle(params, callback) {\r\n submitRequest.call(this, {\r\n Action: 'name/cos:GetBucketLifecycle',\r\n method: 'GET',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n headers: params.Headers,\r\n action: 'lifecycle',\r\n }, function (err, data) {\r\n if (err) {\r\n if (err.statusCode === 404 && err.error && err.error.Code === 'NoSuchLifecycleConfiguration') {\r\n var result = {\r\n Rules: [],\r\n statusCode: err.statusCode,\r\n };\r\n err.headers && (result.headers = err.headers);\r\n callback(null, result);\r\n } else {\r\n callback(err);\r\n }\r\n return;\r\n }\r\n var Rules = [];\r\n try {\r\n Rules = data.LifecycleConfiguration.Rule || [];\r\n } catch (e) {\r\n }\r\n Rules = util.clone(util.isArray(Rules) ? Rules : [Rules]);\r\n callback(null, {\r\n Rules: Rules,\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n}\r\n\r\nfunction deleteBucketLifecycle(params, callback) {\r\n submitRequest.call(this, {\r\n Action: 'name/cos:DeleteBucketLifecycle',\r\n method: 'DELETE',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n headers: params.Headers,\r\n action: 'lifecycle',\r\n }, function (err, data) {\r\n if (err && err.statusCode === 204) {\r\n return callback(null, {statusCode: err.statusCode});\r\n } else if (err) {\r\n return callback(err);\r\n }\r\n callback(null, {\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n}\r\n\r\nfunction putBucketVersioning(params, callback) {\r\n\r\n if (!params['VersioningConfiguration']) {\r\n callback({error: 'missing param VersioningConfiguration'});\r\n return;\r\n }\r\n var VersioningConfiguration = params['VersioningConfiguration'] || {};\r\n var xml = util.json2xml({VersioningConfiguration: VersioningConfiguration});\r\n\r\n var headers = params.Headers;\r\n headers['Content-Type'] = 'application/xml';\r\n headers['Content-MD5'] = util.binaryBase64(util.md5(xml));\r\n\r\n submitRequest.call(this, {\r\n Action: 'name/cos:PutBucketVersioning',\r\n method: 'PUT',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n body: xml,\r\n action: 'versioning',\r\n headers: headers,\r\n }, function (err, data) {\r\n if (err && err.statusCode === 204) {\r\n return callback(null, {statusCode: err.statusCode});\r\n } else if (err) {\r\n return callback(err);\r\n }\r\n callback(null, {\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n}\r\n\r\nfunction getBucketVersioning(params, callback) {\r\n submitRequest.call(this, {\r\n Action: 'name/cos:GetBucketVersioning',\r\n method: 'GET',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n headers: params.Headers,\r\n action: 'versioning',\r\n }, function (err, data) {\r\n if (!err) {\r\n !data.VersioningConfiguration && (data.VersioningConfiguration = {});\r\n }\r\n callback(err, data);\r\n });\r\n}\r\n\r\nfunction putBucketReplication(params, callback) {\r\n var ReplicationConfiguration = util.clone(params.ReplicationConfiguration);\r\n var xml = util.json2xml({ReplicationConfiguration: ReplicationConfiguration});\r\n xml = xml.replace(/<(\\/?)Rules>/ig, '<$1Rule>');\r\n xml = xml.replace(/<(\\/?)Tags>/ig, '<$1Tag>');\r\n\r\n var headers = params.Headers;\r\n headers['Content-Type'] = 'application/xml';\r\n headers['Content-MD5'] = util.binaryBase64(util.md5(xml));\r\n\r\n submitRequest.call(this, {\r\n Action: 'name/cos:PutBucketReplication',\r\n method: 'PUT',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n body: xml,\r\n action: 'replication',\r\n headers: headers,\r\n }, function (err, data) {\r\n if (err && err.statusCode === 204) {\r\n return callback(null, {statusCode: err.statusCode});\r\n } else if (err) {\r\n return callback(err);\r\n }\r\n callback(null, {\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n}\r\n\r\nfunction getBucketReplication(params, callback) {\r\n submitRequest.call(this, {\r\n Action: 'name/cos:GetBucketReplication',\r\n method: 'GET',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n headers: params.Headers,\r\n action: 'replication',\r\n }, function (err, data) {\r\n if (err) {\r\n if (err.statusCode === 404 && err.error && (err.error === 'Not Found' || err.error.Code === 'ReplicationConfigurationnotFoundError')) {\r\n var result = {\r\n ReplicationConfiguration: {Rules: []},\r\n statusCode: err.statusCode,\r\n };\r\n err.headers && (result.headers = err.headers);\r\n callback(null, result);\r\n } else {\r\n callback(err);\r\n }\r\n return;\r\n }\r\n if (!err) {\r\n !data.ReplicationConfiguration && (data.ReplicationConfiguration = {});\r\n }\r\n if (data.ReplicationConfiguration.Rule) {\r\n data.ReplicationConfiguration.Rules = data.ReplicationConfiguration.Rule;\r\n delete data.ReplicationConfiguration.Rule;\r\n }\r\n callback(err, data);\r\n });\r\n}\r\n\r\nfunction deleteBucketReplication(params, callback) {\r\n submitRequest.call(this, {\r\n Action: 'name/cos:DeleteBucketReplication',\r\n method: 'DELETE',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n headers: params.Headers,\r\n action: 'replication',\r\n }, function (err, data) {\r\n if (err && err.statusCode === 204) {\r\n return callback(null, {statusCode: err.statusCode});\r\n } else if (err) {\r\n return callback(err);\r\n }\r\n callback(null, {\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n}\r\n\r\n/**\r\n * 设置 Bucket 静态网站配置信息\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {Object} params.WebsiteConfiguration 地域名称,必须\r\n * @param {Object} WebsiteConfiguration.IndexDocument 索引文档,必须\r\n * @param {Object} WebsiteConfiguration.ErrorDocument 错误文档,非必须\r\n * @param {Object} WebsiteConfiguration.RedirectAllRequestsTo 重定向所有请求,非必须\r\n * @param {Array} params.RoutingRules 重定向规则,非必须\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回数据\r\n */\r\nfunction putBucketWebsite(params, callback) {\r\n\r\n if (!params['WebsiteConfiguration']) {\r\n callback({ error: 'missing param WebsiteConfiguration' });\r\n return;\r\n }\r\n\r\n var WebsiteConfiguration = util.clone(params['WebsiteConfiguration'] || {});\r\n var RoutingRules = WebsiteConfiguration['RoutingRules'] || WebsiteConfiguration['RoutingRule'] || [];\r\n RoutingRules = util.isArray(RoutingRules) ? RoutingRules : [RoutingRules];\r\n delete WebsiteConfiguration.RoutingRule;\r\n delete WebsiteConfiguration.RoutingRules;\r\n RoutingRules.length > 0 && (WebsiteConfiguration.RoutingRules = { RoutingRule: RoutingRules });\r\n var xml = util.json2xml({ WebsiteConfiguration: WebsiteConfiguration });\r\n\r\n var headers = params.Headers;\r\n headers['Content-Type'] = 'application/xml';\r\n headers['Content-MD5'] = util.binaryBase64(util.md5(xml));\r\n\r\n submitRequest.call(this, {\r\n Action: 'name/cos:PutBucketWebsite',\r\n method: 'PUT',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n body: xml,\r\n action: 'website',\r\n headers: headers,\r\n }, function (err, data) {\r\n if (err && err.statusCode === 204) {\r\n return callback(null, {statusCode: err.statusCode});\r\n } else if (err) {\r\n return callback(err);\r\n }\r\n callback(null, {\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n}\r\n\r\n/**\r\n * 获取 Bucket 的静态网站配置信息\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回数据\r\n */\r\nfunction getBucketWebsite(params, callback) {\r\n\r\n submitRequest.call(this, {\r\n Action: 'name/cos:GetBucketWebsite',\r\n method: 'GET',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n Key: params.Key,\r\n headers: params.Headers,\r\n action: 'website',\r\n }, function (err, data) {\r\n if (err) {\r\n if(err.statusCode === 404 && err.error.Code === 'NoSuchWebsiteConfiguration'){\r\n var result = {\r\n WebsiteConfiguration: {},\r\n statusCode: err.statusCode,\r\n };\r\n err.headers && (result.headers = err.headers);\r\n callback(null, result);\r\n } else {\r\n callback(err);\r\n }\r\n return;\r\n }\r\n\r\n var WebsiteConfiguration = data.WebsiteConfiguration || {};\r\n if (WebsiteConfiguration['RoutingRules']) {\r\n var RoutingRules = util.clone(WebsiteConfiguration['RoutingRules'].RoutingRule || []);\r\n RoutingRules = util.makeArray(RoutingRules);\r\n WebsiteConfiguration.RoutingRules = RoutingRules;\r\n }\r\n\r\n callback(null, {\r\n WebsiteConfiguration: WebsiteConfiguration,\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n}\r\n\r\n/**\r\n * 删除 Bucket 的静态网站配置\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回数据\r\n */\r\nfunction deleteBucketWebsite(params, callback) {\r\n\r\n submitRequest.call(this, {\r\n Action: 'name/cos:DeleteBucketWebsite',\r\n method: 'DELETE',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n headers: params.Headers,\r\n action: 'website',\r\n }, function (err, data) {\r\n if (err && err.statusCode === 204) {\r\n return callback(null, {statusCode: err.statusCode});\r\n } else if (err) {\r\n return callback(err);\r\n }\r\n callback(null, {\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n}\r\n\r\n// Object 相关\r\n\r\n/**\r\n * 取回对应Object的元数据,Head的权限与Get的权限一致\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {String} params.Key 文件名称,必须\r\n * @param {String} params.IfModifiedSince 当Object在指定时间后被修改,则返回对应Object元信息,否则返回304,非必须\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 为指定 object 的元数据,如果设置了 IfModifiedSince ,且文件未修改,则返回一个对象,NotModified 属性为 true\r\n * @return {Boolean} data.NotModified 是否在 IfModifiedSince 时间点之后未修改该 object,则为 true\r\n */\r\nfunction headObject(params, callback) {\r\n submitRequest.call(this, {\r\n Action: 'name/cos:HeadObject',\r\n method: 'HEAD',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n Key: params.Key,\r\n VersionId: params.VersionId,\r\n headers: params.Headers,\r\n }, function (err, data) {\r\n if (err) {\r\n var statusCode = err.statusCode;\r\n if (params.Headers['If-Modified-Since'] && statusCode && statusCode === 304) {\r\n return callback(null, {\r\n NotModified: true,\r\n statusCode: statusCode,\r\n });\r\n }\r\n return callback(err);\r\n }\r\n if (data.headers && data.headers.etag) {\r\n data.ETag = data.headers && data.headers.etag;\r\n }\r\n callback(null, data);\r\n });\r\n}\r\n\r\n\r\nfunction listObjectVersions(params, callback) {\r\n var reqParams = {};\r\n reqParams['prefix'] = params['Prefix'] || '';\r\n reqParams['delimiter'] = params['Delimiter'];\r\n reqParams['key-marker'] = params['KeyMarker'];\r\n reqParams['version-id-marker'] = params['VersionIdMarker'];\r\n reqParams['max-keys'] = params['MaxKeys'];\r\n reqParams['encoding-type'] = params['EncodingType'];\r\n\r\n submitRequest.call(this, {\r\n Action: 'name/cos:GetBucketObjectVersions',\r\n ResourceKey: reqParams['prefix'],\r\n method: 'GET',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n headers: params.Headers,\r\n qs: reqParams,\r\n action: 'versions',\r\n }, function (err, data) {\r\n if (err) {\r\n return callback(err);\r\n }\r\n var ListVersionsResult = data.ListVersionsResult || {};\r\n var DeleteMarkers = ListVersionsResult.DeleteMarker || [];\r\n DeleteMarkers = util.isArray(DeleteMarkers) ? DeleteMarkers : [DeleteMarkers];\r\n var Versions = ListVersionsResult.Version || [];\r\n Versions = util.isArray(Versions) ? Versions : [Versions];\r\n\r\n var result = util.clone(ListVersionsResult);\r\n delete result.DeleteMarker;\r\n delete result.Version;\r\n util.extend(result, {\r\n DeleteMarkers: DeleteMarkers,\r\n Versions: Versions,\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n\r\n callback(null, result);\r\n });\r\n}\r\n\r\n/**\r\n * 下载 object\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {String} params.Key 文件名称,必须\r\n * @param {WriteStream} params.Output 文件写入流,非必须\r\n * @param {String} params.IfModifiedSince 当Object在指定时间后被修改,则返回对应Object元信息,否则返回304,非必须\r\n * @param {String} params.IfUnmodifiedSince 如果文件修改时间早于或等于指定时间,才返回文件内容。否则返回 412 (precondition failed),非必须\r\n * @param {String} params.IfMatch 当 ETag 与指定的内容一致,才返回文件。否则返回 412 (precondition failed),非必须\r\n * @param {String} params.IfNoneMatch 当 ETag 与指定的内容不一致,才返回文件。否则返回304 (not modified),非必须\r\n * @param {String} params.ResponseContentType 设置返回头部中的 Content-Type 参数,非必须\r\n * @param {String} params.ResponseContentLanguage 设置返回头部中的 Content-Language 参数,非必须\r\n * @param {String} params.ResponseExpires 设置返回头部中的 Content-Expires 参数,非必须\r\n * @param {String} params.ResponseCacheControl 设置返回头部中的 Cache-Control 参数,非必须\r\n * @param {String} params.ResponseContentDisposition 设置返回头部中的 Content-Disposition 参数,非必须\r\n * @param {String} params.ResponseContentEncoding 设置返回头部中的 Content-Encoding 参数,非必须\r\n * @param {Function} callback 回调函数,必须\r\n * @param {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @param {Object} data 为对应的 object 数据,包括 body 和 headers\r\n */\r\nfunction getObject(params, callback) {\r\n var reqParams = {};\r\n\r\n reqParams['response-content-type'] = params['ResponseContentType'];\r\n reqParams['response-content-language'] = params['ResponseContentLanguage'];\r\n reqParams['response-expires'] = params['ResponseExpires'];\r\n reqParams['response-cache-control'] = params['ResponseCacheControl'];\r\n reqParams['response-content-disposition'] = params['ResponseContentDisposition'];\r\n reqParams['response-content-encoding'] = params['ResponseContentEncoding'];\r\n\r\n // 如果用户自己传入了 output\r\n submitRequest.call(this, {\r\n Action: 'name/cos:GetObject',\r\n method: 'GET',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n Key: params.Key,\r\n VersionId: params.VersionId,\r\n headers: params.Headers,\r\n qs: reqParams,\r\n rawBody: true,\r\n }, function (err, data) {\r\n if (err) {\r\n var statusCode = err.statusCode;\r\n if (params.Headers['If-Modified-Since'] && statusCode && statusCode === 304) {\r\n return callback(null, {\r\n NotModified: true\r\n });\r\n }\r\n return callback(err);\r\n }\r\n var result = {};\r\n result.Body = data.body;\r\n if (data.headers && data.headers.etag) {\r\n result.ETag = data.headers && data.headers.etag;\r\n }\r\n util.extend(result, {\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n callback(null, result);\r\n });\r\n\r\n}\r\n\r\n/**\r\n * 上传 object\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {String} params.Key 文件名称,必须\r\n * @param {File || Blob || String} params.Body 上传文件对象或字符串,必须\r\n * @param {String} params.CacheControl RFC 2616 中定义的缓存策略,将作为 Object 元数据保存,非必须\r\n * @param {String} params.ContentDisposition RFC 2616 中定义的文件名称,将作为 Object 元数据保存,非必须\r\n * @param {String} params.ContentEncoding RFC 2616 中定义的编码格式,将作为 Object 元数据保存,非必须\r\n * @param {String} params.ContentLength RFC 2616 中定义的 HTTP 请求内容长度(字节),必须\r\n * @param {String} params.ContentType RFC 2616 中定义的内容类型(MIME),将作为 Object 元数据保存,非必须\r\n * @param {String} params.Expect 当使用 Expect: 100-continue 时,在收到服务端确认后,才会发送请求内容,非必须\r\n * @param {String} params.Expires RFC 2616 中定义的过期时间,将作为 Object 元数据保存,非必须\r\n * @param {String} params.ACL 允许用户自定义文件权限,有效值:private | public-read,非必须\r\n * @param {String} params.GrantRead 赋予被授权者读取对象的权限,格式:id=\"[OwnerUin]\",可使用半角逗号(,)分隔多组被授权者,非必须\r\n * @param {String} params.GrantReadAcp 赋予被授权者读取对象的访问控制列表(ACL)的权限,格式:id=\"[OwnerUin]\",可使用半角逗号(,)分隔多组被授权者,非必须\r\n * @param {String} params.GrantWriteAcp 赋予被授权者写入对象的访问控制列表(ACL)的权限,格式:id=\"[OwnerUin]\",可使用半角逗号(,)分隔多组被授权者,非必须\r\n * @param {String} params.GrantFullControl 赋予被授权者操作对象的所有权限,格式:id=\"[OwnerUin]\",可使用半角逗号(,)分隔多组被授权者,非必须\r\n * @param {String} params.StorageClass 设置对象的存储级别,枚举值:STANDARD、STANDARD_IA、ARCHIVE,默认值:STANDARD,非必须\r\n * @param {String} params.x-cos-meta-* 允许用户自定义的头部信息,将作为对象的元数据保存。大小限制2KB,非必须\r\n * @param {String} params.ContentSha1 RFC 3174 中定义的 160-bit 内容 SHA-1 算法校验,非必须\r\n * @param {String} params.ServerSideEncryption 支持按照指定的加密算法进行服务端数据加密,格式 x-cos-server-side-encryption: \"AES256\",非必须\r\n * @param {Function} params.onProgress 上传进度回调函数\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 为对应的 object 数据\r\n * @return {String} data.ETag 为对应上传文件的 ETag 值\r\n */\r\nfunction putObject(params, callback) {\r\n var self = this;\r\n var FileSize = params.ContentLength;\r\n var onProgress = util.throttleOnProgress.call(self, FileSize, params.onProgress);\r\n\r\n // 特殊处理 Cache-Control\r\n var headers = params.Headers;\r\n !headers['Cache-Control'] && (headers['Cache-Control'] = '');\r\n\r\n // 获取 File 或 Blob 的 type 属性,如果有,作为文件 Content-Type\r\n var ContentType = headers['Content-Type'] || (params.Body && params.Body.type);\r\n !headers['Content-Type'] && ContentType && (headers['Content-Type'] = ContentType);\r\n\r\n var needCalcMd5 = params.UploadAddMetaMd5 || self.options.UploadAddMetaMd5 || self.options.UploadCheckContentMd5;\r\n util.getBodyMd5(needCalcMd5, params.Body, function (md5) {\r\n if (md5) {\r\n if (self.options.UploadCheckContentMd5) params.Headers['Content-MD5'] = util.binaryBase64(md5);\r\n if (params.UploadAddMetaMd5 || self.options.UploadAddMetaMd5) params.Headers['x-cos-meta-md5'] = md5;\r\n }\r\n\r\n if (params.ContentLength !== undefined) {\r\n params.Headers['Content-Length'] = params.ContentLength;\r\n }\r\n onProgress(null, true); // 任务状态开始 uploading\r\n submitRequest.call(self, {\r\n Action: 'name/cos:PutObject',\r\n TaskId: params.TaskId,\r\n method: 'PUT',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n Key: params.Key,\r\n headers: params.Headers,\r\n body: params.Body,\r\n onProgress: onProgress,\r\n }, function (err, data) {\r\n if (err) {\r\n onProgress(null, true);\r\n return callback(err);\r\n }\r\n onProgress({loaded: FileSize, total: FileSize}, true);\r\n if (data) {\r\n var url = getUrl({\r\n ForcePathStyle: self.options.ForcePathStyle,\r\n protocol: self.options.Protocol,\r\n domain: self.options.Domain,\r\n bucket: params.Bucket,\r\n region: params.Region,\r\n object: params.Key,\r\n });\r\n url = url.substr(url.indexOf('://') + 3);\r\n var result = {\r\n Location: url,\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n };\r\n if (data.headers && data.headers.etag) {\r\n result.ETag = data.headers.etag;\r\n }\r\n return callback(null, result);\r\n }\r\n callback(null, data);\r\n });\r\n }, params.onHashProgress);\r\n}\r\n\r\n/**\r\n * 删除 object\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {String} params.Key object名称,必须\r\n * @param {Function} callback 回调函数,必须\r\n * @param {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @param {Object} data 删除操作成功之后返回的数据\r\n */\r\nfunction deleteObject(params, callback) {\r\n submitRequest.call(this, {\r\n Action: 'name/cos:DeleteObject',\r\n method: 'DELETE',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n Key: params.Key,\r\n headers: params.Headers,\r\n VersionId: params.VersionId,\r\n }, function (err, data) {\r\n if (err) {\r\n var statusCode = err.statusCode;\r\n if (statusCode && statusCode === 204) {\r\n return callback(null, {statusCode: statusCode});\r\n } else if (statusCode && statusCode === 404) {\r\n return callback(null, {BucketNotFound: true, statusCode: statusCode,});\r\n } else {\r\n return callback(err);\r\n }\r\n }\r\n callback(null, {\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n}\r\n\r\n/**\r\n * 获取 object 的 权限列表\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {String} params.Key object名称,必须\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回的数据\r\n * @return {Object} data.AccessControlPolicy 权限列表\r\n */\r\nfunction getObjectAcl(params, callback) {\r\n\r\n submitRequest.call(this, {\r\n Action: 'name/cos:GetObjectACL',\r\n method: 'GET',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n Key: params.Key,\r\n headers: params.Headers,\r\n action: 'acl',\r\n }, function (err, data) {\r\n if (err) {\r\n return callback(err);\r\n }\r\n var AccessControlPolicy = data.AccessControlPolicy || {};\r\n var Owner = AccessControlPolicy.Owner || {};\r\n var Grant = AccessControlPolicy.AccessControlList && AccessControlPolicy.AccessControlList.Grant || [];\r\n Grant = util.isArray(Grant) ? Grant : [Grant];\r\n var result = decodeAcl(AccessControlPolicy);\r\n if (data.headers && data.headers['x-cos-acl']) {\r\n result.ACL = data.headers['x-cos-acl'];\r\n }\r\n result = util.extend(result, {\r\n Owner: Owner,\r\n Grants: Grant,\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n callback(null, result);\r\n });\r\n}\r\n\r\n/**\r\n * 设置 object 的 权限列表\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {String} params.Key object名称,必须\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回的数据\r\n */\r\nfunction putObjectAcl(params, callback) {\r\n var headers = params.Headers;\r\n\r\n var xml = '';\r\n if (params['AccessControlPolicy']) {\r\n var AccessControlPolicy = util.clone(params['AccessControlPolicy'] || {});\r\n var Grants = AccessControlPolicy.Grants || AccessControlPolicy.Grant;\r\n Grants = util.isArray(Grants) ? Grants : [Grants];\r\n delete AccessControlPolicy.Grant;\r\n delete AccessControlPolicy.Grants;\r\n AccessControlPolicy.AccessControlList = {Grant: Grants};\r\n xml = util.json2xml({AccessControlPolicy: AccessControlPolicy});\r\n\r\n headers['Content-Type'] = 'application/xml';\r\n headers['Content-MD5'] = util.binaryBase64(util.md5(xml));\r\n }\r\n\r\n // Grant Header 去重\r\n util.each(headers, function (val, key) {\r\n if (key.indexOf('x-cos-grant-') === 0) {\r\n headers[key] = uniqGrant(headers[key]);\r\n }\r\n });\r\n\r\n submitRequest.call(this, {\r\n Action: 'name/cos:PutObjectACL',\r\n method: 'PUT',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n Key: params.Key,\r\n action: 'acl',\r\n headers: headers,\r\n body: xml,\r\n }, function (err, data) {\r\n if (err) {\r\n return callback(err);\r\n }\r\n callback(null, {\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n}\r\n\r\n/**\r\n * Options Object请求实现跨域访问的预请求。即发出一个 OPTIONS 请求给服务器以确认是否可以进行跨域操作。\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {String} params.Key object名称,必须\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回的数据\r\n */\r\nfunction optionsObject(params, callback) {\r\n\r\n var headers = params.Headers;\r\n headers['Origin'] = params['Origin'];\r\n headers['Access-Control-Request-Method'] = params['AccessControlRequestMethod'];\r\n headers['Access-Control-Request-Headers'] = params['AccessControlRequestHeaders'];\r\n\r\n submitRequest.call(this, {\r\n Action: 'name/cos:OptionsObject',\r\n method: 'OPTIONS',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n Key: params.Key,\r\n headers: headers,\r\n }, function (err, data) {\r\n if (err) {\r\n if (err.statusCode && err.statusCode === 403) {\r\n return callback(null, {\r\n OptionsForbidden: true,\r\n statusCode: err.statusCode\r\n });\r\n }\r\n return callback(err);\r\n }\r\n\r\n var headers = data.headers || {};\r\n callback(null, {\r\n AccessControlAllowOrigin: headers['access-control-allow-origin'],\r\n AccessControlAllowMethods: headers['access-control-allow-methods'],\r\n AccessControlAllowHeaders: headers['access-control-allow-headers'],\r\n AccessControlExposeHeaders: headers['access-control-expose-headers'],\r\n AccessControlMaxAge: headers['access-control-max-age'],\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n}\r\n\r\n/**\r\n * @param {Object} 参数列表\r\n * @param {String} Bucket Bucket 名称\r\n * @param {String} Region 地域名称\r\n * @param {String} Key 文件名称\r\n * @param {String} CopySource 源文件URL绝对路径,可以通过versionid子资源指定历史版本\r\n * @param {String} ACL 允许用户自定义文件权限。有效值:private,public-read默认值:private。\r\n * @param {String} GrantRead 赋予被授权者读的权限,格式 x-cos-grant-read: uin=\" \",uin=\" \",当需要给子账户授权时,uin=\"RootAcountID/SubAccountID\",当需要给根账户授权时,uin=\"RootAcountID\"。\r\n * @param {String} GrantWrite 赋予被授权者写的权限,格式 x-cos-grant-write: uin=\" \",uin=\" \",当需要给子账户授权时,uin=\"RootAcountID/SubAccountID\",当需要给根账户授权时,uin=\"RootAcountID\"。\r\n * @param {String} GrantFullControl 赋予被授权者读写权限,格式 x-cos-grant-full-control: uin=\" \",uin=\" \",当需要给子账户授权时,uin=\"RootAcountID/SubAccountID\",当需要给根账户授权时,uin=\"RootAcountID\"。\r\n * @param {String} MetadataDirective 是否拷贝元数据,枚举值:Copy, Replaced,默认值Copy。假如标记为Copy,忽略Header中的用户元数据信息直接复制;假如标记为Replaced,按Header信息修改元数据。当目标路径和原路径一致,即用户试图修改元数据时,必须为Replaced\r\n * @param {String} CopySourceIfModifiedSince 当Object在指定时间后被修改,则执行操作,否则返回412。可与x-cos-copy-source-If-None-Match一起使用,与其他条件联合使用返回冲突。\r\n * @param {String} CopySourceIfUnmodifiedSince 当Object在指定时间后未被修改,则执行操作,否则返回412。可与x-cos-copy-source-If-Match一起使用,与其他条件联合使用返回冲突。\r\n * @param {String} CopySourceIfMatch 当Object的Etag和给定一致时,则执行操作,否则返回412。可与x-cos-copy-source-If-Unmodified-Since一起使用,与其他条件联合使用返回冲突。\r\n * @param {String} CopySourceIfNoneMatch 当Object的Etag和给定不一致时,则执行操作,否则返回412。可与x-cos-copy-source-If-Modified-Since一起使用,与其他条件联合使用返回冲突。\r\n * @param {String} StorageClass 存储级别,枚举值:存储级别,枚举值:Standard, Standard_IA,Archive;默认值:Standard\r\n * @param {String} CacheControl 指定所有缓存机制在整个请求/响应链中必须服从的指令。\r\n * @param {String} ContentDisposition MIME 协议的扩展,MIME 协议指示 MIME 用户代理如何显示附加的文件\r\n * @param {String} ContentEncoding HTTP 中用来对「采用何种编码格式传输正文」进行协定的一对头部字段\r\n * @param {String} ContentLength 设置响应消息的实体内容的大小,单位为字节\r\n * @param {String} ContentType RFC 2616 中定义的 HTTP 请求内容类型(MIME),例如text/plain\r\n * @param {String} Expect 请求的特定的服务器行为\r\n * @param {String} Expires 响应过期的日期和时间\r\n * @param {String} params.ServerSideEncryption 支持按照指定的加密算法进行服务端数据加密,格式 x-cos-server-side-encryption: \"AES256\",非必须\r\n * @param {String} ContentLanguage 指定内容语言\r\n * @param {String} x-cos-meta-* 允许用户自定义的头部信息,将作为 Object 元数据返回。大小限制2K。\r\n */\r\nfunction putObjectCopy(params, callback) {\r\n\r\n // 特殊处理 Cache-Control\r\n var headers = params.Headers;\r\n !headers['Cache-Control'] && (headers['Cache-Control'] = '');\r\n\r\n var CopySource = params.CopySource || '';\r\n var m = CopySource.match(/^([^.]+-\\d+)\\.cos(v6)?\\.([^.]+)\\.[^/]+\\/(.+)$/);\r\n if (!m) {\r\n callback({error: 'CopySource format error'});\r\n return;\r\n }\r\n\r\n var SourceBucket = m[1];\r\n var SourceRegion = m[3];\r\n var SourceKey = decodeURIComponent(m[4]);\r\n\r\n submitRequest.call(this, {\r\n Scope: [{\r\n action: 'name/cos:GetObject',\r\n bucket: SourceBucket,\r\n region: SourceRegion,\r\n prefix: SourceKey,\r\n }, {\r\n action: 'name/cos:PutObject',\r\n bucket: params.Bucket,\r\n region: params.Region,\r\n prefix: params.Key,\r\n }],\r\n method: 'PUT',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n Key: params.Key,\r\n VersionId: params.VersionId,\r\n headers: params.Headers,\r\n }, function (err, data) {\r\n if (err) {\r\n return callback(err);\r\n }\r\n var result = util.clone(data.CopyObjectResult || {});\r\n util.extend(result, {\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n callback(null, result);\r\n });\r\n}\r\n\r\nfunction uploadPartCopy(params, callback) {\r\n\r\n var CopySource = params.CopySource || '';\r\n var m = CopySource.match(/^([^.]+-\\d+)\\.cos(v6)?\\.([^.]+)\\.[^/]+\\/(.+)$/);\r\n if (!m) {\r\n callback({error: 'CopySource format error'});\r\n return;\r\n }\r\n\r\n var SourceBucket = m[1];\r\n var SourceRegion = m[3];\r\n var SourceKey = decodeURIComponent(m[4]);\r\n\r\n submitRequest.call(this, {\r\n Scope: [{\r\n action: 'name/cos:GetObject',\r\n bucket: SourceBucket,\r\n region: SourceRegion,\r\n prefix: SourceKey,\r\n }, {\r\n action: 'name/cos:PutObject',\r\n bucket: params.Bucket,\r\n region: params.Region,\r\n prefix: params.Key,\r\n }],\r\n method: 'PUT',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n Key: params.Key,\r\n VersionId: params.VersionId,\r\n qs: {\r\n partNumber: params['PartNumber'],\r\n uploadId: params['UploadId'],\r\n },\r\n headers: params.Headers,\r\n }, function (err, data) {\r\n if (err) {\r\n return callback(err);\r\n }\r\n var result = util.clone(data.CopyPartResult || {});\r\n util.extend(result, {\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n callback(null, result);\r\n });\r\n}\r\n\r\nfunction deleteMultipleObject(params, callback) {\r\n var Objects = params.Objects || [];\r\n var Quiet = params.Quiet;\r\n Objects = util.isArray(Objects) ? Objects : [Objects];\r\n\r\n var xml = util.json2xml({Delete: {Object: Objects, Quiet: Quiet || false}});\r\n\r\n var headers = params.Headers;\r\n headers['Content-Type'] = 'application/xml';\r\n headers['Content-MD5'] = util.binaryBase64(util.md5(xml));\r\n\r\n var Scope = util.map(Objects, function (v) {\r\n return {\r\n action: 'name/cos:DeleteObject',\r\n bucket: params.Bucket,\r\n region: params.Region,\r\n prefix: v.Key,\r\n };\r\n });\r\n\r\n submitRequest.call(this, {\r\n Scope: Scope,\r\n method: 'POST',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n body: xml,\r\n action: 'delete',\r\n headers: headers,\r\n }, function (err, data) {\r\n if (err) {\r\n return callback(err);\r\n }\r\n var DeleteResult = data.DeleteResult || {};\r\n var Deleted = DeleteResult.Deleted || [];\r\n var Errors = DeleteResult.Error || [];\r\n\r\n Deleted = util.isArray(Deleted) ? Deleted : [Deleted];\r\n Errors = util.isArray(Errors) ? Errors : [Errors];\r\n\r\n var result = util.clone(DeleteResult);\r\n util.extend(result, {\r\n Error: Errors,\r\n Deleted: Deleted,\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n callback(null, result);\r\n });\r\n}\r\n\r\nfunction restoreObject(params, callback) {\r\n var headers = params.Headers;\r\n if (!params['RestoreRequest']) {\r\n callback({error: 'missing param RestoreRequest'});\r\n return;\r\n }\r\n\r\n var RestoreRequest = params.RestoreRequest || {};\r\n var xml = util.json2xml({RestoreRequest: RestoreRequest});\r\n\r\n headers['Content-Type'] = 'application/xml';\r\n headers['Content-MD5'] = util.binaryBase64(util.md5(xml));\r\n\r\n submitRequest.call(this, {\r\n Action: 'name/cos:RestoreObject',\r\n method: 'POST',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n Key: params.Key,\r\n VersionId: params.VersionId,\r\n body: xml,\r\n action: 'restore',\r\n headers: headers,\r\n }, function (err, data) {\r\n callback(err, data);\r\n });\r\n}\r\n\r\n\r\n// 分块上传\r\n\r\n\r\n/**\r\n * 初始化分块上传\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {String} params.Key object名称,必须\r\n * @param {String} params.UploadId object名称,必须\r\n * @param {String} params.CacheControl RFC 2616 中定义的缓存策略,将作为 Object 元数据保存,非必须\r\n * @param {String} params.ContentDisposition RFC 2616 中定义的文件名称,将作为 Object 元数据保存 ,非必须\r\n * @param {String} params.ContentEncoding RFC 2616 中定义的编码格式,将作为 Object 元数据保存,非必须\r\n * @param {String} params.ContentType RFC 2616 中定义的内容类型(MIME),将作为 Object 元数据保存,非必须\r\n * @param {String} params.Expires RFC 2616 中定义的过期时间,将作为 Object 元数据保存,非必须\r\n * @param {String} params.ACL 允许用户自定义文件权限,非必须\r\n * @param {String} params.GrantRead 赋予被授权者读的权限 ,非必须\r\n * @param {String} params.GrantWrite 赋予被授权者写的权限 ,非必须\r\n * @param {String} params.GrantFullControl 赋予被授权者读写权限 ,非必须\r\n * @param {String} params.StorageClass 设置Object的存储级别,枚举值:Standard,Standard_IA,Archive,非必须\r\n * @param {String} params.ServerSideEncryption 支持按照指定的加密算法进行服务端数据加密,格式 x-cos-server-side-encryption: \"AES256\",非必须\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回的数据\r\n */\r\nfunction multipartInit(params, callback) {\r\n\r\n var self = this;\r\n // 特殊处理 Cache-Control\r\n var headers = params.Headers;\r\n !headers['Cache-Control'] && (headers['Cache-Control'] = '');\r\n util.getBodyMd5(params.Body && (params.UploadAddMetaMd5 || self.options.UploadAddMetaMd5), params.Body, function (md5) {\r\n if (md5) params.Headers['x-cos-meta-md5'] = md5;\r\n submitRequest.call(self, {\r\n Action: 'name/cos:InitiateMultipartUpload',\r\n method: 'POST',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n Key: params.Key,\r\n action: 'uploads',\r\n headers: params.Headers,\r\n }, function (err, data) {\r\n if (err) {\r\n return callback(err);\r\n }\r\n data = util.clone(data || {});\r\n if (data && data.InitiateMultipartUploadResult) {\r\n return callback(null, util.extend(data.InitiateMultipartUploadResult, {\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n }));\r\n }\r\n callback(null, data);\r\n });\r\n }, params.onHashProgress);\r\n}\r\n\r\n/**\r\n * 分块上传\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {String} params.Key object名称,必须\r\n * @param {File || Blob || String} params.Body 上传文件对象或字符串\r\n * @param {String} params.ContentLength RFC 2616 中定义的 HTTP 请求内容长度(字节),非必须\r\n * @param {String} params.Expect 当使用 Expect: 100-continue 时,在收到服务端确认后,才会发送请求内容,非必须\r\n * @param {String} params.ServerSideEncryption 支持按照指定的加密算法进行服务端数据加密,格式 x-cos-server-side-encryption: \"AES256\",非必须\r\n * @param {String} params.ContentSha1 RFC 3174 中定义的 160-bit 内容 SHA-1 算法校验值,非必须\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回的数据\r\n * @return {Object} data.ETag 返回的文件分块 sha1 值\r\n */\r\nfunction multipartUpload(params, callback) {\r\n\r\n var self = this;\r\n util.getFileSize('multipartUpload', params, function () {\r\n util.getBodyMd5(self.options.UploadCheckContentMd5, params.Body, function (md5) {\r\n if (md5) params.Headers['Content-MD5'] = util.binaryBase64(md5);\r\n submitRequest.call(self, {\r\n Action: 'name/cos:UploadPart',\r\n TaskId: params.TaskId,\r\n method: 'PUT',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n Key: params.Key,\r\n qs: {\r\n partNumber: params['PartNumber'],\r\n uploadId: params['UploadId'],\r\n },\r\n headers: params.Headers,\r\n onProgress: params.onProgress,\r\n body: params.Body || null\r\n }, function (err, data) {\r\n if (err) {\r\n return callback(err);\r\n }\r\n data['headers'] = data['headers'] || {};\r\n callback(null, {\r\n ETag: data['headers']['etag'] || '',\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n });\r\n });\r\n\r\n}\r\n\r\n/**\r\n * 完成分块上传\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {String} params.Key object名称,必须\r\n * @param {Array} params.Parts 分块信息列表,必须\r\n * @param {String} params.Parts[i].PartNumber 块编号,必须\r\n * @param {String} params.Parts[i].ETag 分块的 sha1 校验值\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回的数据\r\n * @return {Object} data.CompleteMultipartUpload 完成分块上传后的文件信息,包括Location, Bucket, Key 和 ETag\r\n */\r\nfunction multipartComplete(params, callback) {\r\n var self = this;\r\n\r\n var UploadId = params.UploadId;\r\n\r\n var Parts = params['Parts'];\r\n\r\n for (var i = 0, len = Parts.length; i < len; i++) {\r\n if (Parts[i]['ETag'].indexOf('\"') === 0) {\r\n continue;\r\n }\r\n Parts[i]['ETag'] = '\"' + Parts[i]['ETag'] + '\"';\r\n }\r\n\r\n var xml = util.json2xml({CompleteMultipartUpload: {Part: Parts}});\r\n\r\n var headers = params.Headers;\r\n headers['Content-Type'] = 'application/xml';\r\n headers['Content-MD5'] = util.binaryBase64(util.md5(xml));\r\n\r\n submitRequest.call(this, {\r\n Action: 'name/cos:CompleteMultipartUpload',\r\n method: 'POST',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n Key: params.Key,\r\n qs: {\r\n uploadId: UploadId\r\n },\r\n body: xml,\r\n headers: headers,\r\n }, function (err, data) {\r\n if (err) {\r\n return callback(err);\r\n }\r\n var url = getUrl({\r\n ForcePathStyle: self.options.ForcePathStyle,\r\n protocol: self.options.Protocol,\r\n domain: self.options.Domain,\r\n bucket: params.Bucket,\r\n region: params.Region,\r\n object: params.Key,\r\n isLocation: true,\r\n });\r\n var CompleteMultipartUploadResult = data.CompleteMultipartUploadResult || {};\r\n var result = util.extend(CompleteMultipartUploadResult, {\r\n Location: url,\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n callback(null, result);\r\n });\r\n}\r\n\r\n/**\r\n * 分块上传任务列表查询\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {String} params.Delimiter 定界符为一个符号,如果有Prefix,则将Prefix到delimiter之间的相同路径归为一类,定义为Common Prefix,然后列出所有Common Prefix。如果没有Prefix,则从路径起点开始,非必须\r\n * @param {String} params.EncodingType 规定返回值的编码方式,非必须\r\n * @param {String} params.Prefix 前缀匹配,用来规定返回的文件前缀地址,非必须\r\n * @param {String} params.MaxUploads 单次返回最大的条目数量,默认1000,非必须\r\n * @param {String} params.KeyMarker 与upload-id-marker一起使用
当upload-id-marker未被指定时,ObjectName字母顺序大于key-marker的条目将被列出
当upload-id-marker被指定时,ObjectName字母顺序大于key-marker的条目被列出,ObjectName字母顺序等于key-marker同时UploadId大于upload-id-marker的条目将被列出,非必须\r\n * @param {String} params.UploadIdMarker 与key-marker一起使用
当key-marker未被指定时,upload-id-marker将被忽略
当key-marker被指定时,ObjectName字母顺序大于key-marker的条目被列出,ObjectName字母顺序等于key-marker同时UploadId大于upload-id-marker的条目将被列出,非必须\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回的数据\r\n * @return {Object} data.ListMultipartUploadsResult 分块上传任务信息\r\n */\r\nfunction multipartList(params, callback) {\r\n var reqParams = {};\r\n\r\n reqParams['delimiter'] = params['Delimiter'];\r\n reqParams['encoding-type'] = params['EncodingType'];\r\n reqParams['prefix'] = params['Prefix'] || '';\r\n\r\n reqParams['max-uploads'] = params['MaxUploads'];\r\n\r\n reqParams['key-marker'] = params['KeyMarker'];\r\n reqParams['upload-id-marker'] = params['UploadIdMarker'];\r\n\r\n reqParams = util.clearKey(reqParams);\r\n\r\n submitRequest.call(this, {\r\n Action: 'name/cos:ListMultipartUploads',\r\n ResourceKey: reqParams['prefix'],\r\n method: 'GET',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n headers: params.Headers,\r\n qs: reqParams,\r\n action: 'uploads',\r\n }, function (err, data) {\r\n if (err) {\r\n return callback(err);\r\n }\r\n\r\n if (data && data.ListMultipartUploadsResult) {\r\n var Upload = data.ListMultipartUploadsResult.Upload || [];\r\n\r\n var CommonPrefixes = data.ListMultipartUploadsResult.CommonPrefixes || [];\r\n\r\n CommonPrefixes = util.isArray(CommonPrefixes) ? CommonPrefixes : [CommonPrefixes];\r\n Upload = util.isArray(Upload) ? Upload : [Upload];\r\n\r\n data.ListMultipartUploadsResult.Upload = Upload;\r\n data.ListMultipartUploadsResult.CommonPrefixes = CommonPrefixes;\r\n }\r\n var result = util.clone(data.ListMultipartUploadsResult || {});\r\n util.extend(result, {\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n callback(null, result);\r\n });\r\n}\r\n\r\n/**\r\n * 上传的分块列表查询\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {String} params.Key object名称,必须\r\n * @param {String} params.UploadId 标示本次分块上传的ID,必须\r\n * @param {String} params.EncodingType 规定返回值的编码方式,非必须\r\n * @param {String} params.MaxParts 单次返回最大的条目数量,默认1000,非必须\r\n * @param {String} params.PartNumberMarker 默认以UTF-8二进制顺序列出条目,所有列出条目从marker开始,非必须\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回的数据\r\n * @return {Object} data.ListMultipartUploadsResult 分块信息\r\n */\r\nfunction multipartListPart(params, callback) {\r\n var reqParams = {};\r\n\r\n reqParams['uploadId'] = params['UploadId'];\r\n reqParams['encoding-type'] = params['EncodingType'];\r\n reqParams['max-parts'] = params['MaxParts'];\r\n reqParams['part-number-marker'] = params['PartNumberMarker'];\r\n\r\n submitRequest.call(this, {\r\n Action: 'name/cos:ListParts',\r\n method: 'GET',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n Key: params.Key,\r\n headers: params.Headers,\r\n qs: reqParams,\r\n }, function (err, data) {\r\n if (err) {\r\n return callback(err);\r\n }\r\n var ListPartsResult = data.ListPartsResult || {};\r\n var Part = ListPartsResult.Part || [];\r\n Part = util.isArray(Part) ? Part : [Part];\r\n\r\n ListPartsResult.Part = Part;\r\n var result = util.clone(ListPartsResult);\r\n util.extend(result, {\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n callback(null, result);\r\n });\r\n}\r\n\r\n/**\r\n * 抛弃分块上传\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {String} params.Key object名称,必须\r\n * @param {String} params.UploadId 标示本次分块上传的ID,必须\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回的数据\r\n */\r\nfunction multipartAbort(params, callback) {\r\n var reqParams = {};\r\n\r\n reqParams['uploadId'] = params['UploadId'];\r\n submitRequest.call(this, {\r\n Action: 'name/cos:AbortMultipartUpload',\r\n method: 'DELETE',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n Key: params.Key,\r\n headers: params.Headers,\r\n qs: reqParams,\r\n }, function (err, data) {\r\n if (err) {\r\n return callback(err);\r\n }\r\n callback(null, {\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n}\r\n\r\n/**\r\n * 获取签名\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Method 请求方法,必须\r\n * @param {String} params.Key object名称,必须\r\n * @param {String} params.Expires 名超时时间,单位秒,可选\r\n * @return {String} data 返回签名字符串\r\n */\r\nfunction getAuth(params) {\r\n var self = this;\r\n return util.getAuth({\r\n SecretId: params.SecretId || this.options.SecretId || '',\r\n SecretKey: params.SecretKey || this.options.SecretKey || '',\r\n Method: params.Method,\r\n Key: params.Key,\r\n Query: params.Query,\r\n Headers: params.Headers,\r\n Expires: params.Expires,\r\n UseRawKey: self.options.UseRawKey,\r\n SystemClockOffset: self.options.SystemClockOffset,\r\n });\r\n}\r\n\r\n/**\r\n * 获取文件下载链接\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {String} params.Key object名称,必须\r\n * @param {String} params.Method 请求的方法,可选\r\n * @param {String} params.Expires 签名超时时间,单位秒,可选\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回的数据\r\n */\r\nfunction getObjectUrl(params, callback) {\r\n var self = this;\r\n var url = getUrl({\r\n ForcePathStyle: self.options.ForcePathStyle,\r\n protocol: params.Protocol || self.options.Protocol,\r\n domain: self.options.Domain,\r\n bucket: params.Bucket,\r\n region: params.Region,\r\n object: params.Key,\r\n });\r\n if (params.Sign !== undefined && !params.Sign) {\r\n callback(null, {Url: url});\r\n return url;\r\n }\r\n var AuthData = getAuthorizationAsync.call(this, {\r\n Action: ((params.Method || '').toUpperCase() === 'PUT' ? 'name/cos:PutObject' : 'name/cos:GetObject'),\r\n Bucket: params.Bucket || '',\r\n Region: params.Region || '',\r\n Method: params.Method || 'get',\r\n Key: params.Key,\r\n Expires: params.Expires,\r\n }, function (err, AuthData) {\r\n if (!callback) return;\r\n if (err) {\r\n callback(err);\r\n return;\r\n }\r\n var signUrl = url;\r\n signUrl += '?' + (AuthData.Authorization.indexOf('q-signature') > -1 ?\r\n AuthData.Authorization : 'sign=' + encodeURIComponent(AuthData.Authorization));\r\n AuthData.XCosSecurityToken && (signUrl += '&x-cos-security-token=' + AuthData.XCosSecurityToken);\r\n AuthData.ClientIP && (signUrl += '&clientIP=' + AuthData.ClientIP);\r\n AuthData.ClientUA && (signUrl += '&clientUA=' + AuthData.ClientUA);\r\n AuthData.Token && (signUrl += '&token=' + AuthData.Token);\r\n setTimeout(function () {\r\n callback(null, {Url: signUrl});\r\n });\r\n });\r\n if (AuthData) {\r\n return url + '?' + AuthData.Authorization +\r\n (AuthData.XCosSecurityToken ? '&x-cos-security-token=' + AuthData.XCosSecurityToken : '');\r\n } else {\r\n return url;\r\n }\r\n}\r\n\r\n\r\n/**\r\n * 私有方法\r\n */\r\nfunction decodeAcl(AccessControlPolicy) {\r\n var result = {\r\n GrantFullControl: [],\r\n GrantWrite: [],\r\n GrantRead: [],\r\n GrantReadAcp: [],\r\n GrantWriteAcp: [],\r\n ACL: '',\r\n };\r\n var GrantMap = {\r\n 'FULL_CONTROL': 'GrantFullControl',\r\n 'WRITE': 'GrantWrite',\r\n 'READ': 'GrantRead',\r\n 'READ_ACP': 'GrantReadAcp',\r\n 'WRITE_ACP': 'GrantWriteAcp',\r\n };\r\n var AccessControlList = AccessControlPolicy && AccessControlPolicy.AccessControlList || {};\r\n var Grant = AccessControlList.Grant;\r\n if (Grant) {\r\n Grant = util.isArray(Grant) ? Grant : [Grant];\r\n }\r\n var PublicAcl = {READ: 0, WRITE: 0, FULL_CONTROL: 0};\r\n Grant && Grant.length && util.each(Grant, function (item) {\r\n if (item.Grantee.ID === 'qcs::cam::anyone:anyone' || item.Grantee.URI === 'http://cam.qcloud.com/groups/global/AllUsers') {\r\n PublicAcl[item.Permission] = 1;\r\n } else if (item.Grantee.ID !== AccessControlPolicy.Owner.ID) {\r\n result[GrantMap[item.Permission]].push('id=\"' + item.Grantee.ID + '\"');\r\n }\r\n });\r\n if (PublicAcl.FULL_CONTROL || (PublicAcl.WRITE && PublicAcl.READ)) {\r\n result.ACL = 'public-read-write';\r\n } else if (PublicAcl.READ) {\r\n result.ACL = 'public-read';\r\n } else {\r\n result.ACL = 'private';\r\n }\r\n util.each(GrantMap, function (item) {\r\n result[item] = uniqGrant(result[item].join(','));\r\n });\r\n return result;\r\n}\r\n\r\n// Grant 去重\r\nfunction uniqGrant(str) {\r\n var arr = str.split(',');\r\n var exist = {};\r\n var i, item;\r\n for (i = 0; i < arr.length; ) {\r\n item = arr[i].trim();\r\n if (exist[item]) {\r\n arr.splice(i, 1);\r\n } else {\r\n exist[item] = true;\r\n arr[i] = item;\r\n i++;\r\n }\r\n }\r\n return arr.join(',');\r\n}\r\n\r\n// 生成操作 url\r\nfunction getUrl(params) {\r\n var longBucket = params.bucket;\r\n var shortBucket = longBucket.substr(0, longBucket.lastIndexOf('-'));\r\n var appId = longBucket.substr(longBucket.lastIndexOf('-') + 1);\r\n var domain = params.domain;\r\n var region = params.region;\r\n var object = params.object;\r\n var protocol = params.protocol || (util.isBrowser && location.protocol === 'http:' ? 'http:' : 'https:');\r\n if (!domain) {\r\n if (['cn-south', 'cn-south-2', 'cn-north', 'cn-east', 'cn-southwest', 'sg'].indexOf(region) > -1) {\r\n domain = '{Region}.myqcloud.com';\r\n } else {\r\n domain = 'cos.{Region}.myqcloud.com';\r\n }\r\n if (!params.ForcePathStyle) {\r\n domain = '{Bucket}.' + domain;\r\n }\r\n }\r\n domain = domain.replace(/\\{\\{AppId\\}\\}/ig, appId)\r\n .replace(/\\{\\{Bucket\\}\\}/ig, shortBucket)\r\n .replace(/\\{\\{Region\\}\\}/ig, region)\r\n .replace(/\\{\\{.*?\\}\\}/ig, '');\r\n domain = domain.replace(/\\{AppId\\}/ig, appId)\r\n .replace(/\\{BucketName\\}/ig, shortBucket)\r\n .replace(/\\{Bucket\\}/ig, longBucket)\r\n .replace(/\\{Region\\}/ig, region)\r\n .replace(/\\{.*?\\}/ig, '');\r\n if (!/^[a-zA-Z]+:\\/\\//.test(domain)) {\r\n domain = protocol + '//' + domain;\r\n }\r\n\r\n // 去掉域名最后的斜杆\r\n if (domain.slice(-1) === '/') {\r\n domain = domain.slice(0, -1);\r\n }\r\n var url = domain;\r\n\r\n if (params.ForcePathStyle) {\r\n url += '/' + longBucket;\r\n }\r\n url += '/';\r\n if (object) {\r\n url += util.camSafeUrlEncode(object).replace(/%2F/g, '/');\r\n }\r\n\r\n if (params.isLocation) {\r\n url = url.replace(/^https?:\\/\\//, '');\r\n }\r\n return url;\r\n}\r\n\r\n// 异步获取签名\r\nfunction getAuthorizationAsync(params, callback) {\r\n\r\n var headers = util.clone(params.Headers);\r\n delete headers['Content-Type'];\r\n delete headers['Cache-Control'];\r\n util.each(headers, function (v, k) {\r\n v === '' && delete headers[k];\r\n });\r\n\r\n var cb = function (AuthData) {\r\n\r\n // 检查签名格式\r\n var formatAllow = false;\r\n var auth = AuthData.Authorization;\r\n if (auth) {\r\n if (auth.indexOf(' ') > -1) {\r\n formatAllow = false;\r\n } else if (auth.indexOf('q-sign-algorithm=') > -1 &&\r\n auth.indexOf('q-ak=') > -1 &&\r\n auth.indexOf('q-sign-time=') > -1 &&\r\n auth.indexOf('q-key-time=') > -1 &&\r\n auth.indexOf('q-url-param-list=') > -1) {\r\n formatAllow = true;\r\n } else {\r\n try {\r\n auth = atob(auth);\r\n if (auth.indexOf('a=') > -1 &&\r\n auth.indexOf('k=') > -1 &&\r\n auth.indexOf('t=') > -1 &&\r\n auth.indexOf('r=') > -1 &&\r\n auth.indexOf('b=') > -1) {\r\n formatAllow = true;\r\n }\r\n } catch (e) {}\r\n }\r\n }\r\n if (formatAllow) {\r\n callback && callback(null, AuthData);\r\n } else {\r\n callback && callback('authorization error');\r\n }\r\n };\r\n\r\n var self = this;\r\n var Bucket = params.Bucket || '';\r\n var Region = params.Region || '';\r\n\r\n // PathName\r\n var KeyName = params.Key || '';\r\n if (self.options.ForcePathStyle && Bucket) {\r\n KeyName = Bucket + '/' + KeyName;\r\n }\r\n var Pathname = '/' + KeyName;\r\n\r\n // Action、ResourceKey\r\n var StsData = {};\r\n var Scope = params.Scope;\r\n if (!Scope) {\r\n var Action = params.Action || '';\r\n var ResourceKey = params.ResourceKey || params.Key || '';\r\n Scope = params.Scope || [{\r\n action: Action,\r\n bucket: Bucket,\r\n region: Region,\r\n prefix: ResourceKey,\r\n }];\r\n }\r\n var ScopeKey = util.md5(JSON.stringify(Scope));\r\n\r\n // STS\r\n self._StsCache = self._StsCache ||[];\r\n (function () {\r\n var i, AuthData;\r\n for (i = self._StsCache.length - 1; i >= 0; i--) {\r\n AuthData = self._StsCache[i];\r\n var compareTime = Math.round(util.getSkewTime(self.options.SystemClockOffset) / 1000) + 30;\r\n if (AuthData.StartTime && compareTime < AuthData.StartTime || compareTime >= AuthData.ExpiredTime) {\r\n self._StsCache.splice(i, 1);\r\n continue;\r\n }\r\n if (!AuthData.ScopeLimit || AuthData.ScopeLimit && AuthData.ScopeKey === ScopeKey) {\r\n StsData = AuthData;\r\n break;\r\n }\r\n }\r\n })();\r\n\r\n var calcAuthByTmpKey = function () {\r\n var KeyTime = StsData.StartTime && StsData.ExpiredTime ? StsData.StartTime + ';' + StsData.ExpiredTime : '';\r\n var Authorization = util.getAuth({\r\n SecretId: StsData.TmpSecretId,\r\n SecretKey: StsData.TmpSecretKey,\r\n Method: params.Method,\r\n Pathname: Pathname,\r\n Query: params.Query,\r\n Headers: headers,\r\n Expires: params.Expires,\r\n UseRawKey: self.options.UseRawKey,\r\n SystemClockOffset: self.options.SystemClockOffset,\r\n KeyTime: KeyTime\r\n });\r\n var AuthData = {\r\n Authorization: Authorization,\r\n XCosSecurityToken: StsData.XCosSecurityToken || '',\r\n Token: StsData.Token || '',\r\n ClientIP: StsData.ClientIP || '',\r\n ClientUA: StsData.ClientUA || '',\r\n };\r\n cb(AuthData);\r\n };\r\n\r\n // 先判断是否有临时密钥\r\n if (StsData.ExpiredTime && StsData.ExpiredTime - (util.getSkewTime(self.options.SystemClockOffset) / 1000) > 60) { // 如果缓存的临时密钥有效,并还有超过60秒有效期就直接使用\r\n calcAuthByTmpKey();\r\n } else if (self.options.getAuthorization) { // 外部计算签名或获取临时密钥\r\n self.options.getAuthorization.call(self, {\r\n Bucket: Bucket,\r\n Region: Region,\r\n Method: params.Method,\r\n Key: KeyName,\r\n Pathname: Pathname,\r\n Query: params.Query,\r\n Headers: headers,\r\n Scope: Scope,\r\n }, function (AuthData) {\r\n if (typeof AuthData === 'string') {\r\n AuthData = {Authorization: AuthData};\r\n }\r\n if (AuthData.TmpSecretId &&\r\n AuthData.TmpSecretKey &&\r\n AuthData.XCosSecurityToken &&\r\n AuthData.ExpiredTime) {\r\n StsData = AuthData || {};\r\n StsData.Scope = Scope;\r\n StsData.ScopeKey = ScopeKey;\r\n self._StsCache.push(StsData);\r\n calcAuthByTmpKey();\r\n } else {\r\n cb(AuthData);\r\n }\r\n });\r\n } else if (self.options.getSTS) { // 外部获取临时密钥\r\n self.options.getSTS.call(self, {\r\n Bucket: Bucket,\r\n Region: Region,\r\n }, function (data) {\r\n StsData = data || {};\r\n StsData.Scope = Scope;\r\n StsData.ScopeKey = ScopeKey;\r\n StsData.TmpSecretId = StsData.SecretId;\r\n StsData.TmpSecretKey = StsData.SecretKey;\r\n self._StsCache.push(StsData);\r\n calcAuthByTmpKey();\r\n });\r\n } else { // 内部计算获取签名\r\n return (function () {\r\n var Authorization = util.getAuth({\r\n SecretId: params.SecretId || self.options.SecretId,\r\n SecretKey: params.SecretKey || self.options.SecretKey,\r\n Method: params.Method,\r\n Pathname: Pathname,\r\n Query: params.Query,\r\n Headers: headers,\r\n Expires: params.Expires,\r\n UseRawKey: self.options.UseRawKey,\r\n SystemClockOffset: self.options.SystemClockOffset,\r\n });\r\n var AuthData = {\r\n Authorization: Authorization,\r\n XCosSecurityToken: self.options.XCosSecurityToken,\r\n };\r\n cb(AuthData);\r\n return AuthData;\r\n })();\r\n }\r\n return '';\r\n}\r\n\r\n// 调整时间偏差\r\nfunction allowRetry(err) {\r\n var allowRetry = false;\r\n var isTimeError = false;\r\n var serverDate = (err.headers && (err.headers.date || err.headers.Date)) || (err.error && err.error.ServerTime);\r\n try {\r\n var errorCode = err.error.Code;\r\n var errorMessage = err.error.Message;\r\n if (errorCode === 'RequestTimeTooSkewed' ||\r\n (errorCode === 'AccessDenied' && errorMessage === 'Request has expired')) {\r\n isTimeError = true;\r\n }\r\n } catch (e) {\r\n }\r\n if (err) {\r\n if (isTimeError && serverDate) {\r\n var serverTime = Date.parse(serverDate);\r\n if (this.options.CorrectClockSkew && Math.abs(util.getSkewTime(this.options.SystemClockOffset) - serverTime) >= 30000) {\r\n console.error('error: Local time is too skewed.');\r\n this.options.SystemClockOffset = serverTime - Date.now();\r\n allowRetry = true;\r\n }\r\n } else if (Math.round(err.statusCode / 100) === 5) {\r\n allowRetry = true;\r\n }\r\n }\r\n return allowRetry;\r\n}\r\n\r\n// 获取签名并发起请求\r\nfunction submitRequest(params, callback) {\r\n var self = this;\r\n\r\n // 处理 headers\r\n !params.headers && (params.headers = {});\r\n\r\n // 处理 query\r\n !params.qs && (params.qs = {});\r\n params.VersionId && (params.qs.versionId = params.VersionId);\r\n params.qs = util.clearKey(params.qs);\r\n\r\n // 清理 undefined 和 null 字段\r\n params.headers && (params.headers = util.clearKey(params.headers));\r\n params.qs && (params.qs = util.clearKey(params.qs));\r\n\r\n var Query = util.clone(params.qs);\r\n params.action && (Query[params.action] = '');\r\n\r\n var next = function (tryTimes) {\r\n var oldClockOffset = self.options.SystemClockOffset;\r\n getAuthorizationAsync.call(self, {\r\n Bucket: params.Bucket || '',\r\n Region: params.Region || '',\r\n Method: params.method,\r\n Key: params.Key,\r\n Query: Query,\r\n Headers: params.headers,\r\n Action: params.Action,\r\n ResourceKey: params.ResourceKey,\r\n Scope: params.Scope,\r\n }, function (err, AuthData) {\r\n if (err) {\r\n callback(err);\r\n return;\r\n }\r\n params.AuthData = AuthData;\r\n _submitRequest.call(self, params, function (err, data) {\r\n if (err && tryTimes < 2 && (oldClockOffset !== self.options.SystemClockOffset || allowRetry.call(self, err))) {\r\n if (params.headers) {\r\n delete params.headers.Authorization;\r\n delete params.headers['token'];\r\n delete params.headers['clientIP'];\r\n delete params.headers['clientUA'];\r\n delete params.headers['x-cos-security-token'];\r\n }\r\n next(tryTimes + 1);\r\n } else {\r\n callback(err, data);\r\n }\r\n });\r\n });\r\n };\r\n next(1);\r\n\r\n}\r\n\r\n// 发起请求\r\nfunction _submitRequest(params, callback) {\r\n var self = this;\r\n var TaskId = params.TaskId;\r\n if (TaskId && !self._isRunningTask(TaskId)) return;\r\n\r\n var bucket = params.Bucket;\r\n var region = params.Region;\r\n var object = params.Key;\r\n var method = params.method || 'GET';\r\n var url = params.url;\r\n var body = params.body;\r\n var json = params.json;\r\n var rawBody = params.rawBody;\r\n\r\n // url\r\n url = url || getUrl({\r\n ForcePathStyle: self.options.ForcePathStyle,\r\n protocol: self.options.Protocol,\r\n domain: self.options.Domain,\r\n bucket: bucket,\r\n region: region,\r\n object: object,\r\n });\r\n if (params.action) {\r\n url = url + '?' + params.action;\r\n }\r\n\r\n var opt = {\r\n method: method,\r\n url: url,\r\n headers: params.headers,\r\n qs: params.qs,\r\n body: body,\r\n json: json,\r\n };\r\n\r\n // 获取签名\r\n opt.headers.Authorization = params.AuthData.Authorization;\r\n params.AuthData.Token && (opt.headers['token'] = params.AuthData.Token);\r\n params.AuthData.ClientIP && (opt.headers['clientIP'] = params.AuthData.ClientIP);\r\n params.AuthData.ClientUA && (opt.headers['clientUA'] = params.AuthData.ClientUA);\r\n params.AuthData.XCosSecurityToken && (opt.headers['x-cos-security-token'] = params.AuthData.XCosSecurityToken);\r\n\r\n // 清理 undefined 和 null 字段\r\n opt.headers && (opt.headers = util.clearKey(opt.headers));\r\n opt = util.clearKey(opt);\r\n\r\n // progress\r\n if (params.onProgress && typeof params.onProgress === 'function') {\r\n var contentLength = body && (body.size || body.length) || 0;\r\n opt.onProgress = function (e) {\r\n if (TaskId && !self._isRunningTask(TaskId)) return;\r\n var loaded = e ? e.loaded : 0;\r\n params.onProgress({loaded: loaded, total: contentLength});\r\n };\r\n }\r\n if (this.options.Timeout) {\r\n opt.timeout = this.options.Timeout;\r\n }\r\n\r\n self.emit('before-send', opt);\r\n var sender = REQUEST(opt, function (err, response, body) {\r\n if (err === 'abort') return;\r\n\r\n // 返回内容添加 状态码 和 headers\r\n var hasReturned;\r\n var cb = function (err, data) {\r\n TaskId && self.off('inner-kill-task', killTask);\r\n if (hasReturned) return;\r\n hasReturned = true;\r\n var attrs = {};\r\n response && response.statusCode && (attrs.statusCode = response.statusCode);\r\n response && response.headers && (attrs.headers = response.headers);\r\n\r\n if (err) {\r\n err = util.extend(err || {}, attrs);\r\n callback(err, null);\r\n } else {\r\n data = util.extend(data || {}, attrs);\r\n callback(null, data);\r\n }\r\n sender = null;\r\n };\r\n\r\n // 请求错误,发生网络错误\r\n if (err) {\r\n cb({error: err});\r\n return;\r\n }\r\n\r\n var jsonRes;\r\n\r\n // 不对 body 进行转换,body 直接挂载返回\r\n if(rawBody) {\r\n jsonRes = {};\r\n jsonRes.body = body;\r\n } else {\r\n try {\r\n jsonRes = body && body.indexOf('<') > -1 && body.indexOf('>') > -1 && util.xml2json(body) || {};\r\n } catch (e) {\r\n jsonRes = body || {};\r\n }\r\n }\r\n\r\n // 请求返回码不为 200\r\n var statusCode = response.statusCode;\r\n var statusSuccess = Math.floor(statusCode / 100) === 2; // 200 202 204 206\r\n if (!statusSuccess) {\r\n cb({error: jsonRes.Error || jsonRes});\r\n return;\r\n }\r\n\r\n\r\n if (jsonRes.Error) {\r\n cb({error: jsonRes.Error});\r\n return;\r\n }\r\n cb(null, jsonRes);\r\n });\r\n\r\n // kill task\r\n var killTask = function (data) {\r\n if (data.TaskId === TaskId) {\r\n sender && sender.abort && sender.abort();\r\n self.off('inner-kill-task', killTask);\r\n }\r\n };\r\n TaskId && self.on('inner-kill-task', killTask);\r\n\r\n}\r\n\r\n\r\nvar API_MAP = {\r\n // Bucket 相关方法\r\n getService: getService, // Bucket\r\n putBucket: putBucket,\r\n headBucket: headBucket, // Bucket\r\n getBucket: getBucket,\r\n deleteBucket: deleteBucket,\r\n putBucketAcl: putBucketAcl, // BucketACL\r\n getBucketAcl: getBucketAcl,\r\n putBucketCors: putBucketCors, // BucketCors\r\n getBucketCors: getBucketCors,\r\n deleteBucketCors: deleteBucketCors,\r\n getBucketLocation: getBucketLocation, // BucketLocation\r\n getBucketPolicy: getBucketPolicy, // BucketPolicy\r\n putBucketPolicy: putBucketPolicy,\r\n deleteBucketPolicy: deleteBucketPolicy,\r\n putBucketTagging: putBucketTagging, // BucketTagging\r\n getBucketTagging: getBucketTagging,\r\n deleteBucketTagging: deleteBucketTagging,\r\n putBucketLifecycle: putBucketLifecycle, // BucketLifecycle\r\n getBucketLifecycle: getBucketLifecycle,\r\n deleteBucketLifecycle: deleteBucketLifecycle,\r\n putBucketVersioning: putBucketVersioning, // BucketVersioning\r\n getBucketVersioning: getBucketVersioning,\r\n putBucketReplication: putBucketReplication, // BucketReplication\r\n getBucketReplication: getBucketReplication,\r\n deleteBucketReplication: deleteBucketReplication,\r\n putBucketWebsite: putBucketWebsite, // BucketWebsite\r\n getBucketWebsite: getBucketWebsite,\r\n deleteBucketWebsite: deleteBucketWebsite,\r\n\r\n // Object 相关方法\r\n getObject: getObject,\r\n headObject: headObject,\r\n listObjectVersions: listObjectVersions,\r\n putObject: putObject,\r\n deleteObject: deleteObject,\r\n getObjectAcl: getObjectAcl,\r\n putObjectAcl: putObjectAcl,\r\n optionsObject: optionsObject,\r\n putObjectCopy: putObjectCopy,\r\n deleteMultipleObject: deleteMultipleObject,\r\n restoreObject: restoreObject,\r\n\r\n // 分块上传相关方法\r\n uploadPartCopy: uploadPartCopy,\r\n multipartInit: multipartInit,\r\n multipartUpload: multipartUpload,\r\n multipartComplete: multipartComplete,\r\n multipartList: multipartList,\r\n multipartListPart: multipartListPart,\r\n multipartAbort: multipartAbort,\r\n\r\n // 工具方法\r\n getObjectUrl: getObjectUrl,\r\n getAuth: getAuth,\r\n};\r\n\r\nfunction warnOldApi(apiName, fn, proto) {\r\n util.each(['Cors', 'Acl'], function (suffix) {\r\n if (apiName.slice(-suffix.length) === suffix) {\r\n var oldName = apiName.slice(0, -suffix.length) + suffix.toUpperCase();\r\n var apiFn = util.apiWrapper(apiName, fn);\r\n var warned = false;\r\n proto[oldName] = function () {\r\n !warned && console.warn('warning: cos.' + oldName + ' has been deprecated. Please Use cos.' + apiName + ' instead.');\r\n warned = true;\r\n apiFn.apply(this, arguments);\r\n };\r\n }\r\n });\r\n}\r\n\r\nmodule.exports.init = function (COS, task) {\r\n task.transferToTaskMethod(API_MAP, 'putObject');\r\n util.each(API_MAP, function (fn, apiName) {\r\n COS.prototype[apiName] = util.apiWrapper(apiName, fn);\r\n warnOldApi(apiName, fn, COS.prototype);\r\n });\r\n};\r\n","var $ = (function () {\r\n var deletedIds = [];\r\n\r\n var slice = deletedIds.slice;\r\n\r\n var concat = deletedIds.concat;\r\n\r\n var push = deletedIds.push;\r\n\r\n var indexOf = deletedIds.indexOf;\r\n\r\n var class2type = {};\r\n\r\n var toString = class2type.toString;\r\n\r\n var hasOwn = class2type.hasOwnProperty;\r\n\r\n var support = {};\r\n\r\n\r\n var\r\n version = \"1.11.1 -css,-css/addGetHookIf,-css/curCSS,-css/defaultDisplay,-css/hiddenVisibleSelectors,-css/support,-css/swap,-css/var/cssExpand,-css/var/isHidden,-css/var/rmargin,-css/var/rnumnonpx,-effects,-effects/Tween,-effects/animatedSelector,-effects/support,-dimensions,-offset,-deprecated,-event-alias,-wrap\",\r\n\r\n // Define a local copy of jQuery\r\n jQuery = function (selector, context) {\r\n // The jQuery object is actually just the init constructor 'enhanced'\r\n // Need init if jQuery is called (just allow error to be thrown if not included)\r\n return new jQuery.fn.init(selector, context);\r\n },\r\n\r\n // Support: Android<4.1, IE<9\r\n // Make sure we trim BOM and NBSP\r\n rtrim = /^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g,\r\n\r\n // Matches dashed string for camelizing\r\n rmsPrefix = /^-ms-/,\r\n rdashAlpha = /-([\\da-z])/gi,\r\n\r\n // Used by jQuery.camelCase as callback to replace()\r\n fcamelCase = function (all, letter) {\r\n return letter.toUpperCase();\r\n };\r\n\r\n jQuery.fn = jQuery.prototype = {\r\n // The current version of jQuery being used\r\n jquery: version,\r\n\r\n constructor: jQuery,\r\n\r\n // Start with an empty selector\r\n selector: \"\",\r\n\r\n // The default length of a jQuery object is 0\r\n length: 0,\r\n\r\n toArray: function () {\r\n return slice.call(this);\r\n },\r\n\r\n // Get the Nth element in the matched element set OR\r\n // Get the whole matched element set as a clean array\r\n get: function (num) {\r\n return num != null ?\r\n\r\n // Return just the one element from the set\r\n ( num < 0 ? this[num + this.length] : this[num] ) :\r\n\r\n // Return all the elements in a clean array\r\n slice.call(this);\r\n },\r\n\r\n // Take an array of elements and push it onto the stack\r\n // (returning the new matched element set)\r\n pushStack: function (elems) {\r\n\r\n // Build a new jQuery matched element set\r\n var ret = jQuery.merge(this.constructor(), elems);\r\n\r\n // Add the old object onto the stack (as a reference)\r\n ret.prevObject = this;\r\n ret.context = this.context;\r\n\r\n // Return the newly-formed element set\r\n return ret;\r\n },\r\n\r\n // Execute a callback for every element in the matched set.\r\n // (You can seed the arguments with an array of args, but this is\r\n // only used internally.)\r\n each: function (callback, args) {\r\n return jQuery.each(this, callback, args);\r\n },\r\n\r\n map: function (callback) {\r\n return this.pushStack(jQuery.map(this, function (elem, i) {\r\n return callback.call(elem, i, elem);\r\n }));\r\n },\r\n\r\n slice: function () {\r\n return this.pushStack(slice.apply(this, arguments));\r\n },\r\n\r\n first: function () {\r\n return this.eq(0);\r\n },\r\n\r\n last: function () {\r\n return this.eq(-1);\r\n },\r\n\r\n eq: function (i) {\r\n var len = this.length,\r\n j = +i + ( i < 0 ? len : 0 );\r\n return this.pushStack(j >= 0 && j < len ? [this[j]] : []);\r\n },\r\n\r\n end: function () {\r\n return this.prevObject || this.constructor(null);\r\n },\r\n\r\n // For internal use only.\r\n // Behaves like an Array's method, not like a jQuery method.\r\n push: push,\r\n sort: deletedIds.sort,\r\n splice: deletedIds.splice\r\n };\r\n\r\n jQuery.extend = jQuery.fn.extend = function () {\r\n var src, copyIsArray, copy, name, options, clone,\r\n target = arguments[0] || {},\r\n i = 1,\r\n length = arguments.length,\r\n deep = false;\r\n\r\n // Handle a deep copy situation\r\n if (typeof target === \"boolean\") {\r\n deep = target;\r\n\r\n // skip the boolean and the target\r\n target = arguments[i] || {};\r\n i++;\r\n }\r\n\r\n // Handle case when target is a string or something (possible in deep copy)\r\n if (typeof target !== \"object\" && !jQuery.isFunction(target)) {\r\n target = {};\r\n }\r\n\r\n // extend jQuery itself if only one argument is passed\r\n if (i === length) {\r\n target = this;\r\n i--;\r\n }\r\n\r\n for (; i < length; i++) {\r\n // Only deal with non-null/undefined values\r\n if ((options = arguments[i]) != null) {\r\n // Extend the base object\r\n for (name in options) {\r\n src = target[name];\r\n copy = options[name];\r\n\r\n // Prevent never-ending loop\r\n if (target === copy) {\r\n continue;\r\n }\r\n\r\n // Recurse if we're merging plain objects or arrays\r\n if (deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) )) {\r\n if (copyIsArray) {\r\n copyIsArray = false;\r\n clone = src && jQuery.isArray(src) ? src : [];\r\n\r\n } else {\r\n clone = src && jQuery.isPlainObject(src) ? src : {};\r\n }\r\n\r\n // Never move original objects, clone them\r\n target[name] = jQuery.extend(deep, clone, copy);\r\n\r\n // Don't bring in undefined values\r\n } else if (copy !== undefined) {\r\n target[name] = copy;\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Return the modified object\r\n return target;\r\n };\r\n\r\n jQuery.extend({\r\n // Unique for each copy of jQuery on the page\r\n expando: \"jQuery\" + ( version + Math.random() ).replace(/\\D/g, \"\"),\r\n\r\n // Assume jQuery is ready without the ready module\r\n isReady: true,\r\n\r\n error: function (msg) {\r\n throw new Error(msg);\r\n },\r\n\r\n noop: function () {\r\n },\r\n\r\n // See test/unit/core.js for details concerning isFunction.\r\n // Since version 1.3, DOM methods and functions like alert\r\n // aren't supported. They return false on IE (#2968).\r\n isFunction: function (obj) {\r\n return jQuery.type(obj) === \"function\";\r\n },\r\n\r\n isArray: Array.isArray || function (obj) {\r\n return jQuery.type(obj) === \"array\";\r\n },\r\n\r\n isWindow: function (obj) {\r\n /* jshint eqeqeq: false */\r\n return obj != null && obj == obj.window;\r\n },\r\n\r\n isNumeric: function (obj) {\r\n // parseFloat NaNs numeric-cast false positives (null|true|false|\"\")\r\n // ...but misinterprets leading-number strings, particularly hex literals (\"0x...\")\r\n // subtraction forces infinities to NaN\r\n return !jQuery.isArray(obj) && obj - parseFloat(obj) >= 0;\r\n },\r\n\r\n isEmptyObject: function (obj) {\r\n var name;\r\n for (name in obj) {\r\n return false;\r\n }\r\n return true;\r\n },\r\n\r\n isPlainObject: function (obj) {\r\n var key;\r\n\r\n // Must be an Object.\r\n // Because of IE, we also have to check the presence of the constructor property.\r\n // Make sure that DOM nodes and window objects don't pass through, as well\r\n if (!obj || jQuery.type(obj) !== \"object\" || obj.nodeType || jQuery.isWindow(obj)) {\r\n return false;\r\n }\r\n\r\n try {\r\n // Not own constructor property must be Object\r\n if (obj.constructor &&\r\n !hasOwn.call(obj, \"constructor\") &&\r\n !hasOwn.call(obj.constructor.prototype, \"isPrototypeOf\")) {\r\n return false;\r\n }\r\n } catch (e) {\r\n // IE8,9 Will throw exceptions on certain host objects #9897\r\n return false;\r\n }\r\n\r\n // Support: IE<9\r\n // Handle iteration over inherited properties before own properties.\r\n if (support.ownLast) {\r\n for (key in obj) {\r\n return hasOwn.call(obj, key);\r\n }\r\n }\r\n\r\n // Own properties are enumerated firstly, so to speed up,\r\n // if last one is own, then all properties are own.\r\n for (key in obj) {\r\n }\r\n\r\n return key === undefined || hasOwn.call(obj, key);\r\n },\r\n\r\n type: function (obj) {\r\n if (obj == null) {\r\n return obj + \"\";\r\n }\r\n return typeof obj === \"object\" || typeof obj === \"function\" ?\r\n class2type[toString.call(obj)] || \"object\" :\r\n typeof obj;\r\n },\r\n\r\n // Evaluates a script in a global context\r\n // Workarounds based on findings by Jim Driscoll\r\n // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context\r\n globalEval: function (data) {\r\n if (data && jQuery.trim(data)) {\r\n // We use execScript on Internet Explorer\r\n // We use an anonymous function so that context is window\r\n // rather than jQuery in Firefox\r\n ( window.execScript || function (data) {\r\n window[\"eval\"].call(window, data);\r\n } )(data);\r\n }\r\n },\r\n\r\n // Convert dashed to camelCase; used by the css and data modules\r\n // Microsoft forgot to hump their vendor prefix (#9572)\r\n camelCase: function (string) {\r\n return string.replace(rmsPrefix, \"ms-\").replace(rdashAlpha, fcamelCase);\r\n },\r\n\r\n nodeName: function (elem, name) {\r\n return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();\r\n },\r\n\r\n // args is for internal usage only\r\n each: function (obj, callback, args) {\r\n var value,\r\n i = 0,\r\n length = obj.length,\r\n isArray = isArraylike(obj);\r\n\r\n if (args) {\r\n if (isArray) {\r\n for (; i < length; i++) {\r\n value = callback.apply(obj[i], args);\r\n\r\n if (value === false) {\r\n break;\r\n }\r\n }\r\n } else {\r\n for (i in obj) {\r\n value = callback.apply(obj[i], args);\r\n\r\n if (value === false) {\r\n break;\r\n }\r\n }\r\n }\r\n\r\n // A special, fast, case for the most common use of each\r\n } else {\r\n if (isArray) {\r\n for (; i < length; i++) {\r\n value = callback.call(obj[i], i, obj[i]);\r\n\r\n if (value === false) {\r\n break;\r\n }\r\n }\r\n } else {\r\n for (i in obj) {\r\n value = callback.call(obj[i], i, obj[i]);\r\n\r\n if (value === false) {\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return obj;\r\n },\r\n\r\n // Support: Android<4.1, IE<9\r\n trim: function (text) {\r\n return text == null ?\r\n \"\" :\r\n ( text + \"\" ).replace(rtrim, \"\");\r\n },\r\n\r\n // results is for internal usage only\r\n makeArray: function (arr, results) {\r\n var ret = results || [];\r\n\r\n if (arr != null) {\r\n if (isArraylike(Object(arr))) {\r\n jQuery.merge(ret,\r\n typeof arr === \"string\" ?\r\n [arr] : arr\r\n );\r\n } else {\r\n push.call(ret, arr);\r\n }\r\n }\r\n\r\n return ret;\r\n },\r\n\r\n inArray: function (elem, arr, i) {\r\n var len;\r\n\r\n if (arr) {\r\n if (indexOf) {\r\n return indexOf.call(arr, elem, i);\r\n }\r\n\r\n len = arr.length;\r\n i = i ? i < 0 ? Math.max(0, len + i) : i : 0;\r\n\r\n for (; i < len; i++) {\r\n // Skip accessing in sparse arrays\r\n if (i in arr && arr[i] === elem) {\r\n return i;\r\n }\r\n }\r\n }\r\n\r\n return -1;\r\n },\r\n\r\n merge: function (first, second) {\r\n var len = +second.length,\r\n j = 0,\r\n i = first.length;\r\n\r\n while (j < len) {\r\n first[i++] = second[j++];\r\n }\r\n\r\n // Support: IE<9\r\n // Workaround casting of .length to NaN on otherwise arraylike objects (e.g., NodeLists)\r\n if (len !== len) {\r\n while (second[j] !== undefined) {\r\n first[i++] = second[j++];\r\n }\r\n }\r\n\r\n first.length = i;\r\n\r\n return first;\r\n },\r\n\r\n grep: function (elems, callback, invert) {\r\n var callbackInverse,\r\n matches = [],\r\n i = 0,\r\n length = elems.length,\r\n callbackExpect = !invert;\r\n\r\n // Go through the array, only saving the items\r\n // that pass the validator function\r\n for (; i < length; i++) {\r\n callbackInverse = !callback(elems[i], i);\r\n if (callbackInverse !== callbackExpect) {\r\n matches.push(elems[i]);\r\n }\r\n }\r\n\r\n return matches;\r\n },\r\n\r\n // arg is for internal usage only\r\n map: function (elems, callback, arg) {\r\n var value,\r\n i = 0,\r\n length = elems.length,\r\n isArray = isArraylike(elems),\r\n ret = [];\r\n\r\n // Go through the array, translating each of the items to their new values\r\n if (isArray) {\r\n for (; i < length; i++) {\r\n value = callback(elems[i], i, arg);\r\n\r\n if (value != null) {\r\n ret.push(value);\r\n }\r\n }\r\n\r\n // Go through every key on the object,\r\n } else {\r\n for (i in elems) {\r\n value = callback(elems[i], i, arg);\r\n\r\n if (value != null) {\r\n ret.push(value);\r\n }\r\n }\r\n }\r\n\r\n // Flatten any nested arrays\r\n return concat.apply([], ret);\r\n },\r\n\r\n // A global GUID counter for objects\r\n guid: 1,\r\n\r\n // Bind a function to a context, optionally partially applying any\r\n // arguments.\r\n proxy: function (fn, context) {\r\n var args, proxy, tmp;\r\n\r\n if (typeof context === \"string\") {\r\n tmp = fn[context];\r\n context = fn;\r\n fn = tmp;\r\n }\r\n\r\n // Quick check to determine if target is callable, in the spec\r\n // this throws a TypeError, but we will just return undefined.\r\n if (!jQuery.isFunction(fn)) {\r\n return undefined;\r\n }\r\n\r\n // Simulated bind\r\n args = slice.call(arguments, 2);\r\n proxy = function () {\r\n return fn.apply(context || this, args.concat(slice.call(arguments)));\r\n };\r\n\r\n // Set the guid of unique handler to the same of original handler, so it can be removed\r\n proxy.guid = fn.guid = fn.guid || jQuery.guid++;\r\n\r\n return proxy;\r\n },\r\n\r\n now: function () {\r\n return +( new Date() );\r\n },\r\n\r\n // jQuery.support is not used in Core but other projects attach their\r\n // properties to it so it needs to exist.\r\n support: support\r\n });\r\n\r\n// Populate the class2type map\r\n jQuery.each(\"Boolean Number String Function Array Date RegExp Object Error\".split(\" \"), function (i, name) {\r\n class2type[\"[object \" + name + \"]\"] = name.toLowerCase();\r\n });\r\n\r\n function isArraylike(obj) {\r\n var length = obj.length,\r\n type = jQuery.type(obj);\r\n\r\n if (type === \"function\" || jQuery.isWindow(obj)) {\r\n return false;\r\n }\r\n\r\n if (obj.nodeType === 1 && length) {\r\n return true;\r\n }\r\n\r\n return type === \"array\" || length === 0 ||\r\n typeof length === \"number\" && length > 0 && ( length - 1 ) in obj;\r\n }\r\n\r\n\r\n// Initialize a jQuery object\r\n\r\n\r\n// A central reference to the root jQuery(document)\r\n var rootjQuery,\r\n\r\n // Use the correct document accordingly with window argument (sandbox)\r\n document = window.document,\r\n\r\n // A simple way to check for HTML strings\r\n // Prioritize #id over to avoid XSS via location.hash (#9521)\r\n // Strict HTML recognition (#11290: must start with <)\r\n rquickExpr = /^(?:\\s*(<[\\w\\W]+>)[^>]*|#([\\w-]*))$/,\r\n\r\n init = jQuery.fn.init = function (selector, context) {\r\n var match, elem;\r\n\r\n // HANDLE: $(\"\"), $(null), $(undefined), $(false)\r\n if (!selector) {\r\n return this;\r\n }\r\n\r\n // Handle HTML strings\r\n if (typeof selector === \"string\") {\r\n if (selector.charAt(0) === \"<\" && selector.charAt(selector.length - 1) === \">\" && selector.length >= 3) {\r\n // Assume that strings that start and end with <> are HTML and skip the regex check\r\n match = [null, selector, null];\r\n\r\n } else {\r\n match = rquickExpr.exec(selector);\r\n }\r\n\r\n // Match html or make sure no context is specified for #id\r\n if (match && (match[1] || !context)) {\r\n\r\n // HANDLE: $(html) -> $(array)\r\n if (match[1]) {\r\n context = context instanceof jQuery ? context[0] : context;\r\n\r\n // scripts is true for back-compat\r\n // Intentionally let the error be thrown if parseHTML is not present\r\n jQuery.merge(this, jQuery.parseHTML(\r\n match[1],\r\n context && context.nodeType ? context.ownerDocument || context : document,\r\n true\r\n ));\r\n\r\n // HANDLE: $(html, props)\r\n if (rsingleTag.test(match[1]) && jQuery.isPlainObject(context)) {\r\n for (match in context) {\r\n // Properties of context are called as methods if possible\r\n if (jQuery.isFunction(this[match])) {\r\n this[match](context[match]);\r\n\r\n // ...and otherwise set as attributes\r\n } else {\r\n this.attr(match, context[match]);\r\n }\r\n }\r\n }\r\n\r\n return this;\r\n\r\n // HANDLE: $(#id)\r\n } else {\r\n elem = document.getElementById(match[2]);\r\n\r\n // Check parentNode to catch when Blackberry 4.6 returns\r\n // nodes that are no longer in the document #6963\r\n if (elem && elem.parentNode) {\r\n // Handle the case where IE and Opera return items\r\n // by name instead of ID\r\n if (elem.id !== match[2]) {\r\n return rootjQuery.find(selector);\r\n }\r\n\r\n // Otherwise, we inject the element directly into the jQuery object\r\n this.length = 1;\r\n this[0] = elem;\r\n }\r\n\r\n this.context = document;\r\n this.selector = selector;\r\n return this;\r\n }\r\n\r\n // HANDLE: $(expr, $(...))\r\n } else if (!context || context.jquery) {\r\n return ( context || rootjQuery ).find(selector);\r\n\r\n // HANDLE: $(expr, context)\r\n // (which is just equivalent to: $(context).find(expr)\r\n } else {\r\n return this.constructor(context).find(selector);\r\n }\r\n\r\n // HANDLE: $(DOMElement)\r\n } else if (selector.nodeType) {\r\n this.context = this[0] = selector;\r\n this.length = 1;\r\n return this;\r\n\r\n // HANDLE: $(function)\r\n // Shortcut for document ready\r\n } else if (jQuery.isFunction(selector)) {\r\n return typeof rootjQuery.ready !== \"undefined\" ?\r\n rootjQuery.ready(selector) :\r\n // Execute immediately if ready is not present\r\n selector(jQuery);\r\n }\r\n\r\n if (selector.selector !== undefined) {\r\n this.selector = selector.selector;\r\n this.context = selector.context;\r\n }\r\n\r\n return jQuery.makeArray(selector, this);\r\n };\r\n\r\n// Give the init function the jQuery prototype for later instantiation\r\n init.prototype = jQuery.fn;\r\n\r\n// Initialize central reference\r\n rootjQuery = jQuery(document);\r\n\r\n\r\n var rnotwhite = (/\\S+/g);\r\n\r\n// String to Object options format cache\r\n var optionsCache = {};\r\n\r\n// Convert String-formatted options into Object-formatted ones and store in cache\r\n function createOptions(options) {\r\n var object = optionsCache[options] = {};\r\n jQuery.each(options.match(rnotwhite) || [], function (_, flag) {\r\n object[flag] = true;\r\n });\r\n return object;\r\n }\r\n\r\n /*\r\n * Create a callback list using the following parameters:\r\n *\r\n *\toptions: an optional list of space-separated options that will change how\r\n *\t\t\tthe callback list behaves or a more traditional option object\r\n *\r\n * By default a callback list will act like an event callback list and can be\r\n * \"fired\" multiple times.\r\n *\r\n * Possible options:\r\n *\r\n *\tonce:\t\t\twill ensure the callback list can only be fired once (like a Deferred)\r\n *\r\n *\tmemory:\t\t\twill keep track of previous values and will call any callback added\r\n *\t\t\t\t\tafter the list has been fired right away with the latest \"memorized\"\r\n *\t\t\t\t\tvalues (like a Deferred)\r\n *\r\n *\tunique:\t\t\twill ensure a callback can only be added once (no duplicate in the list)\r\n *\r\n *\tstopOnFalse:\tinterrupt callings when a callback returns false\r\n *\r\n */\r\n jQuery.Callbacks = function (options) {\r\n\r\n // Convert options from String-formatted to Object-formatted if needed\r\n // (we check in cache first)\r\n options = typeof options === \"string\" ?\r\n ( optionsCache[options] || createOptions(options) ) :\r\n jQuery.extend({}, options);\r\n\r\n var // Flag to know if list is currently firing\r\n firing,\r\n // Last fire value (for non-forgettable lists)\r\n memory,\r\n // Flag to know if list was already fired\r\n fired,\r\n // End of the loop when firing\r\n firingLength,\r\n // Index of currently firing callback (modified by remove if needed)\r\n firingIndex,\r\n // First callback to fire (used internally by add and fireWith)\r\n firingStart,\r\n // Actual callback list\r\n list = [],\r\n // Stack of fire calls for repeatable lists\r\n stack = !options.once && [],\r\n // Fire callbacks\r\n fire = function (data) {\r\n memory = options.memory && data;\r\n fired = true;\r\n firingIndex = firingStart || 0;\r\n firingStart = 0;\r\n firingLength = list.length;\r\n firing = true;\r\n for (; list && firingIndex < firingLength; firingIndex++) {\r\n if (list[firingIndex].apply(data[0], data[1]) === false && options.stopOnFalse) {\r\n memory = false; // To prevent further calls using add\r\n break;\r\n }\r\n }\r\n firing = false;\r\n if (list) {\r\n if (stack) {\r\n if (stack.length) {\r\n fire(stack.shift());\r\n }\r\n } else if (memory) {\r\n list = [];\r\n } else {\r\n self.disable();\r\n }\r\n }\r\n },\r\n // Actual Callbacks object\r\n self = {\r\n // Add a callback or a collection of callbacks to the list\r\n add: function () {\r\n if (list) {\r\n // First, we save the current length\r\n var start = list.length;\r\n (function add(args) {\r\n jQuery.each(args, function (_, arg) {\r\n var type = jQuery.type(arg);\r\n if (type === \"function\") {\r\n if (!options.unique || !self.has(arg)) {\r\n list.push(arg);\r\n }\r\n } else if (arg && arg.length && type !== \"string\") {\r\n // Inspect recursively\r\n add(arg);\r\n }\r\n });\r\n })(arguments);\r\n // Do we need to add the callbacks to the\r\n // current firing batch?\r\n if (firing) {\r\n firingLength = list.length;\r\n // With memory, if we're not firing then\r\n // we should call right away\r\n } else if (memory) {\r\n firingStart = start;\r\n fire(memory);\r\n }\r\n }\r\n return this;\r\n },\r\n // Remove a callback from the list\r\n remove: function () {\r\n if (list) {\r\n jQuery.each(arguments, function (_, arg) {\r\n var index;\r\n while (( index = jQuery.inArray(arg, list, index) ) > -1) {\r\n list.splice(index, 1);\r\n // Handle firing indexes\r\n if (firing) {\r\n if (index <= firingLength) {\r\n firingLength--;\r\n }\r\n if (index <= firingIndex) {\r\n firingIndex--;\r\n }\r\n }\r\n }\r\n });\r\n }\r\n return this;\r\n },\r\n // Check if a given callback is in the list.\r\n // If no argument is given, return whether or not list has callbacks attached.\r\n has: function (fn) {\r\n return fn ? jQuery.inArray(fn, list) > -1 : !!( list && list.length );\r\n },\r\n // Remove all callbacks from the list\r\n empty: function () {\r\n list = [];\r\n firingLength = 0;\r\n return this;\r\n },\r\n // Have the list do nothing anymore\r\n disable: function () {\r\n list = stack = memory = undefined;\r\n return this;\r\n },\r\n // Is it disabled?\r\n disabled: function () {\r\n return !list;\r\n },\r\n // Lock the list in its current state\r\n lock: function () {\r\n stack = undefined;\r\n if (!memory) {\r\n self.disable();\r\n }\r\n return this;\r\n },\r\n // Is it locked?\r\n locked: function () {\r\n return !stack;\r\n },\r\n // Call all callbacks with the given context and arguments\r\n fireWith: function (context, args) {\r\n if (list && ( !fired || stack )) {\r\n args = args || [];\r\n args = [context, args.slice ? args.slice() : args];\r\n if (firing) {\r\n stack.push(args);\r\n } else {\r\n fire(args);\r\n }\r\n }\r\n return this;\r\n },\r\n // Call all the callbacks with the given arguments\r\n fire: function () {\r\n self.fireWith(this, arguments);\r\n return this;\r\n },\r\n // To know if the callbacks have already been called at least once\r\n fired: function () {\r\n return !!fired;\r\n }\r\n };\r\n\r\n return self;\r\n };\r\n\r\n\r\n jQuery.extend({\r\n\r\n Deferred: function (func) {\r\n var tuples = [\r\n // action, add listener, listener list, final state\r\n [\"resolve\", \"done\", jQuery.Callbacks(\"once memory\"), \"resolved\"],\r\n [\"reject\", \"fail\", jQuery.Callbacks(\"once memory\"), \"rejected\"],\r\n [\"notify\", \"progress\", jQuery.Callbacks(\"memory\")]\r\n ],\r\n state = \"pending\",\r\n promise = {\r\n state: function () {\r\n return state;\r\n },\r\n always: function () {\r\n deferred.done(arguments).fail(arguments);\r\n return this;\r\n },\r\n then: function (/* fnDone, fnFail, fnProgress */) {\r\n var fns = arguments;\r\n return jQuery.Deferred(function (newDefer) {\r\n jQuery.each(tuples, function (i, tuple) {\r\n var fn = jQuery.isFunction(fns[i]) && fns[i];\r\n // deferred[ done | fail | progress ] for forwarding actions to newDefer\r\n deferred[tuple[1]](function () {\r\n var returned = fn && fn.apply(this, arguments);\r\n if (returned && jQuery.isFunction(returned.promise)) {\r\n returned.promise()\r\n .done(newDefer.resolve)\r\n .fail(newDefer.reject)\r\n .progress(newDefer.notify);\r\n } else {\r\n newDefer[tuple[0] + \"With\"](this === promise ? newDefer.promise() : this, fn ? [returned] : arguments);\r\n }\r\n });\r\n });\r\n fns = null;\r\n }).promise();\r\n },\r\n // Get a promise for this deferred\r\n // If obj is provided, the promise aspect is added to the object\r\n promise: function (obj) {\r\n return obj != null ? jQuery.extend(obj, promise) : promise;\r\n }\r\n },\r\n deferred = {};\r\n\r\n // Keep pipe for back-compat\r\n promise.pipe = promise.then;\r\n\r\n // Add list-specific methods\r\n jQuery.each(tuples, function (i, tuple) {\r\n var list = tuple[2],\r\n stateString = tuple[3];\r\n\r\n // promise[ done | fail | progress ] = list.add\r\n promise[tuple[1]] = list.add;\r\n\r\n // Handle state\r\n if (stateString) {\r\n list.add(function () {\r\n // state = [ resolved | rejected ]\r\n state = stateString;\r\n\r\n // [ reject_list | resolve_list ].disable; progress_list.lock\r\n }, tuples[i ^ 1][2].disable, tuples[2][2].lock);\r\n }\r\n\r\n // deferred[ resolve | reject | notify ]\r\n deferred[tuple[0]] = function () {\r\n deferred[tuple[0] + \"With\"](this === deferred ? promise : this, arguments);\r\n return this;\r\n };\r\n deferred[tuple[0] + \"With\"] = list.fireWith;\r\n });\r\n\r\n // Make the deferred a promise\r\n promise.promise(deferred);\r\n\r\n // Call given func if any\r\n if (func) {\r\n func.call(deferred, deferred);\r\n }\r\n\r\n // All done!\r\n return deferred;\r\n },\r\n\r\n // Deferred helper\r\n when: function (subordinate /* , ..., subordinateN */) {\r\n var i = 0,\r\n resolveValues = slice.call(arguments),\r\n length = resolveValues.length,\r\n\r\n // the count of uncompleted subordinates\r\n remaining = length !== 1 || ( subordinate && jQuery.isFunction(subordinate.promise) ) ? length : 0,\r\n\r\n // the master Deferred. If resolveValues consist of only a single Deferred, just use that.\r\n deferred = remaining === 1 ? subordinate : jQuery.Deferred(),\r\n\r\n // Update function for both resolve and progress values\r\n updateFunc = function (i, contexts, values) {\r\n return function (value) {\r\n contexts[i] = this;\r\n values[i] = arguments.length > 1 ? slice.call(arguments) : value;\r\n if (values === progressValues) {\r\n deferred.notifyWith(contexts, values);\r\n\r\n } else if (!(--remaining)) {\r\n deferred.resolveWith(contexts, values);\r\n }\r\n };\r\n },\r\n\r\n progressValues, progressContexts, resolveContexts;\r\n\r\n // add listeners to Deferred subordinates; treat others as resolved\r\n if (length > 1) {\r\n progressValues = new Array(length);\r\n progressContexts = new Array(length);\r\n resolveContexts = new Array(length);\r\n for (; i < length; i++) {\r\n if (resolveValues[i] && jQuery.isFunction(resolveValues[i].promise)) {\r\n resolveValues[i].promise()\r\n .done(updateFunc(i, resolveContexts, resolveValues))\r\n .fail(deferred.reject)\r\n .progress(updateFunc(i, progressContexts, progressValues));\r\n } else {\r\n --remaining;\r\n }\r\n }\r\n }\r\n\r\n // if we're not waiting on anything, resolve the master\r\n if (!remaining) {\r\n deferred.resolveWith(resolveContexts, resolveValues);\r\n }\r\n\r\n return deferred.promise();\r\n }\r\n });\r\n\r\n\r\n// The deferred used on DOM ready\r\n var readyList;\r\n\r\n jQuery.fn.ready = function (fn) {\r\n // Add the callback\r\n jQuery.ready.promise().done(fn);\r\n\r\n return this;\r\n };\r\n\r\n jQuery.extend({\r\n // Is the DOM ready to be used? Set to true once it occurs.\r\n isReady: false,\r\n\r\n // A counter to track how many items to wait for before\r\n // the ready event fires. See #6781\r\n readyWait: 1,\r\n\r\n // Hold (or release) the ready event\r\n holdReady: function (hold) {\r\n if (hold) {\r\n jQuery.readyWait++;\r\n } else {\r\n jQuery.ready(true);\r\n }\r\n },\r\n\r\n // Handle when the DOM is ready\r\n ready: function (wait) {\r\n\r\n // Abort if there are pending holds or we're already ready\r\n if (wait === true ? --jQuery.readyWait : jQuery.isReady) {\r\n return;\r\n }\r\n\r\n // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).\r\n if (!document.body) {\r\n return setTimeout(jQuery.ready);\r\n }\r\n\r\n // Remember that the DOM is ready\r\n jQuery.isReady = true;\r\n\r\n // If a normal DOM Ready event fired, decrement, and wait if need be\r\n if (wait !== true && --jQuery.readyWait > 0) {\r\n return;\r\n }\r\n\r\n // If there are functions bound, to execute\r\n readyList.resolveWith(document, [jQuery]);\r\n\r\n // Trigger any bound ready events\r\n if (jQuery.fn.triggerHandler) {\r\n jQuery(document).triggerHandler(\"ready\");\r\n jQuery(document).off(\"ready\");\r\n }\r\n }\r\n });\r\n\r\n /**\r\n * Clean-up method for dom ready events\r\n */\r\n function detach() {\r\n if (document.addEventListener) {\r\n document.removeEventListener(\"DOMContentLoaded\", completed, false);\r\n window.removeEventListener(\"load\", completed, false);\r\n\r\n } else {\r\n document.detachEvent(\"onreadystatechange\", completed);\r\n window.detachEvent(\"onload\", completed);\r\n }\r\n }\r\n\r\n /**\r\n * The ready event handler and self cleanup method\r\n */\r\n function completed() {\r\n // readyState === \"complete\" is good enough for us to call the dom ready in oldIE\r\n if (document.addEventListener || event.type === \"load\" || document.readyState === \"complete\") {\r\n detach();\r\n jQuery.ready();\r\n }\r\n }\r\n\r\n jQuery.ready.promise = function (obj) {\r\n if (!readyList) {\r\n\r\n readyList = jQuery.Deferred();\r\n\r\n // Catch cases where $(document).ready() is called after the browser event has already occurred.\r\n // we once tried to use readyState \"interactive\" here, but it caused issues like the one\r\n // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15\r\n if (document.readyState === \"complete\") {\r\n // Handle it asynchronously to allow scripts the opportunity to delay ready\r\n setTimeout(jQuery.ready);\r\n\r\n // Standards-based browsers support DOMContentLoaded\r\n } else if (document.addEventListener) {\r\n // Use the handy event callback\r\n document.addEventListener(\"DOMContentLoaded\", completed, false);\r\n\r\n // A fallback to window.onload, that will always work\r\n window.addEventListener(\"load\", completed, false);\r\n\r\n // If IE event model is used\r\n } else {\r\n // Ensure firing before onload, maybe late but safe also for iframes\r\n document.attachEvent(\"onreadystatechange\", completed);\r\n\r\n // A fallback to window.onload, that will always work\r\n window.attachEvent(\"onload\", completed);\r\n\r\n // If IE and not a frame\r\n // continually check to see if the document is ready\r\n var top = false;\r\n\r\n try {\r\n top = window.frameElement == null && document.documentElement;\r\n } catch (e) {\r\n }\r\n\r\n if (top && top.doScroll) {\r\n (function doScrollCheck() {\r\n if (!jQuery.isReady) {\r\n\r\n try {\r\n // Use the trick by Diego Perini\r\n // http://javascript.nwbox.com/IEContentLoaded/\r\n top.doScroll(\"left\");\r\n } catch (e) {\r\n return setTimeout(doScrollCheck, 50);\r\n }\r\n\r\n // detach all dom ready events\r\n detach();\r\n\r\n // and execute any waiting functions\r\n jQuery.ready();\r\n }\r\n })();\r\n }\r\n }\r\n }\r\n return readyList.promise(obj);\r\n };\r\n\r\n\r\n var strundefined = typeof undefined;\r\n\r\n\r\n// Support: IE<9\r\n// Iteration over object's inherited properties before its own\r\n var i;\r\n for (i in jQuery(support)) {\r\n break;\r\n }\r\n support.ownLast = i !== \"0\";\r\n\r\n// Note: most support tests are defined in their respective modules.\r\n// false until the test is run\r\n support.inlineBlockNeedsLayout = false;\r\n\r\n\r\n// Execute ASAP in case we need to set body.style.zoom\r\n jQuery(function () {\r\n // Minified: var a,b,c,d\r\n var val, div, body, container;\r\n\r\n body = document.getElementsByTagName(\"body\")[0];\r\n if (!body || !body.style) {\r\n // Return for frameset docs that don't have a body\r\n return;\r\n }\r\n\r\n // Setup\r\n div = document.createElement(\"div\");\r\n container = document.createElement(\"div\");\r\n container.style.cssText = \"position:absolute;border:0;width:0;height:0;top:0;left:-9999px\";\r\n body.appendChild(container).appendChild(div);\r\n\r\n if (typeof div.style.zoom !== strundefined) {\r\n // Support: IE<8\r\n // Check if natively block-level elements act like inline-block\r\n // elements when setting their display to 'inline' and giving\r\n // them layout\r\n div.style.cssText = \"display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1\";\r\n\r\n support.inlineBlockNeedsLayout = val = div.offsetWidth === 3;\r\n if (val) {\r\n // Prevent IE 6 from affecting layout for positioned elements #11048\r\n // Prevent IE from shrinking the body in IE 7 mode #12869\r\n // Support: IE<8\r\n body.style.zoom = 1;\r\n }\r\n }\r\n\r\n body.removeChild(container);\r\n });\r\n\r\n\r\n (function () {\r\n var div = document.createElement(\"div\");\r\n\r\n // Execute the test only if not already executed in another module.\r\n if (support.deleteExpando == null) {\r\n // Support: IE<9\r\n support.deleteExpando = true;\r\n try {\r\n delete div.test;\r\n } catch (e) {\r\n support.deleteExpando = false;\r\n }\r\n }\r\n\r\n // Null elements to avoid leaks in IE.\r\n div = null;\r\n })();\r\n\r\n\r\n /**\r\n * Determines whether an object can have data\r\n */\r\n jQuery.acceptData = function (elem) {\r\n var noData = jQuery.noData[(elem.nodeName + \" \").toLowerCase()],\r\n nodeType = +elem.nodeType || 1;\r\n\r\n // Do not set data on non-element DOM nodes because it will not be cleared (#8335).\r\n return nodeType !== 1 && nodeType !== 9 ?\r\n false :\r\n\r\n // Nodes accept data unless otherwise specified; rejection can be conditional\r\n !noData || noData !== true && elem.getAttribute(\"classid\") === noData;\r\n };\r\n\r\n\r\n var rbrace = /^(?:\\{[\\w\\W]*\\}|\\[[\\w\\W]*\\])$/,\r\n rmultiDash = /([A-Z])/g;\r\n\r\n function dataAttr(elem, key, data) {\r\n // If nothing was found internally, try to fetch any\r\n // data from the HTML5 data-* attribute\r\n if (data === undefined && elem.nodeType === 1) {\r\n\r\n var name = \"data-\" + key.replace(rmultiDash, \"-$1\").toLowerCase();\r\n\r\n data = elem.getAttribute(name);\r\n\r\n if (typeof data === \"string\") {\r\n try {\r\n data = data === \"true\" ? true :\r\n data === \"false\" ? false :\r\n data === \"null\" ? null :\r\n // Only convert to a number if it doesn't change the string\r\n +data + \"\" === data ? +data :\r\n rbrace.test(data) ? jQuery.parseJSON(data) :\r\n data;\r\n } catch (e) {\r\n }\r\n\r\n // Make sure we set the data so it isn't changed later\r\n jQuery.data(elem, key, data);\r\n\r\n } else {\r\n data = undefined;\r\n }\r\n }\r\n\r\n return data;\r\n }\r\n\r\n// checks a cache object for emptiness\r\n function isEmptyDataObject(obj) {\r\n var name;\r\n for (name in obj) {\r\n\r\n // if the public data object is empty, the private is still empty\r\n if (name === \"data\" && jQuery.isEmptyObject(obj[name])) {\r\n continue;\r\n }\r\n if (name !== \"toJSON\") {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n }\r\n\r\n function internalData(elem, name, data, pvt /* Internal Use Only */) {\r\n if (!jQuery.acceptData(elem)) {\r\n return;\r\n }\r\n\r\n var ret, thisCache,\r\n internalKey = jQuery.expando,\r\n\r\n // We have to handle DOM nodes and JS objects differently because IE6-7\r\n // can't GC object references properly across the DOM-JS boundary\r\n isNode = elem.nodeType,\r\n\r\n // Only DOM nodes need the global jQuery cache; JS object data is\r\n // attached directly to the object so GC can occur automatically\r\n cache = isNode ? jQuery.cache : elem,\r\n\r\n // Only defining an ID for JS objects if its cache already exists allows\r\n // the code to shortcut on the same path as a DOM node with no cache\r\n id = isNode ? elem[internalKey] : elem[internalKey] && internalKey;\r\n\r\n // Avoid doing any more work than we need to when trying to get data on an\r\n // object that has no data at all\r\n if ((!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === \"string\") {\r\n return;\r\n }\r\n\r\n if (!id) {\r\n // Only DOM nodes need a new unique ID for each element since their data\r\n // ends up in the global cache\r\n if (isNode) {\r\n id = elem[internalKey] = deletedIds.pop() || jQuery.guid++;\r\n } else {\r\n id = internalKey;\r\n }\r\n }\r\n\r\n if (!cache[id]) {\r\n // Avoid exposing jQuery metadata on plain JS objects when the object\r\n // is serialized using JSON.stringify\r\n cache[id] = isNode ? {} : {toJSON: jQuery.noop};\r\n }\r\n\r\n // An object can be passed to jQuery.data instead of a key/value pair; this gets\r\n // shallow copied over onto the existing cache\r\n if (typeof name === \"object\" || typeof name === \"function\") {\r\n if (pvt) {\r\n cache[id] = jQuery.extend(cache[id], name);\r\n } else {\r\n cache[id].data = jQuery.extend(cache[id].data, name);\r\n }\r\n }\r\n\r\n thisCache = cache[id];\r\n\r\n // jQuery data() is stored in a separate object inside the object's internal data\r\n // cache in order to avoid key collisions between internal data and user-defined\r\n // data.\r\n if (!pvt) {\r\n if (!thisCache.data) {\r\n thisCache.data = {};\r\n }\r\n\r\n thisCache = thisCache.data;\r\n }\r\n\r\n if (data !== undefined) {\r\n thisCache[jQuery.camelCase(name)] = data;\r\n }\r\n\r\n // Check for both converted-to-camel and non-converted data property names\r\n // If a data property was specified\r\n if (typeof name === \"string\") {\r\n\r\n // First Try to find as-is property data\r\n ret = thisCache[name];\r\n\r\n // Test for null|undefined property data\r\n if (ret == null) {\r\n\r\n // Try to find the camelCased property\r\n ret = thisCache[jQuery.camelCase(name)];\r\n }\r\n } else {\r\n ret = thisCache;\r\n }\r\n\r\n return ret;\r\n }\r\n\r\n function internalRemoveData(elem, name, pvt) {\r\n if (!jQuery.acceptData(elem)) {\r\n return;\r\n }\r\n\r\n var thisCache, i,\r\n isNode = elem.nodeType,\r\n\r\n // See jQuery.data for more information\r\n cache = isNode ? jQuery.cache : elem,\r\n id = isNode ? elem[jQuery.expando] : jQuery.expando;\r\n\r\n // If there is already no cache entry for this object, there is no\r\n // purpose in continuing\r\n if (!cache[id]) {\r\n return;\r\n }\r\n\r\n if (name) {\r\n\r\n thisCache = pvt ? cache[id] : cache[id].data;\r\n\r\n if (thisCache) {\r\n\r\n // Support array or space separated string names for data keys\r\n if (!jQuery.isArray(name)) {\r\n\r\n // try the string as a key before any manipulation\r\n if (name in thisCache) {\r\n name = [name];\r\n } else {\r\n\r\n // split the camel cased version by spaces unless a key with the spaces exists\r\n name = jQuery.camelCase(name);\r\n if (name in thisCache) {\r\n name = [name];\r\n } else {\r\n name = name.split(\" \");\r\n }\r\n }\r\n } else {\r\n // If \"name\" is an array of keys...\r\n // When data is initially created, via (\"key\", \"val\") signature,\r\n // keys will be converted to camelCase.\r\n // Since there is no way to tell _how_ a key was added, remove\r\n // both plain key and camelCase key. #12786\r\n // This will only penalize the array argument path.\r\n name = name.concat(jQuery.map(name, jQuery.camelCase));\r\n }\r\n\r\n i = name.length;\r\n while (i--) {\r\n delete thisCache[name[i]];\r\n }\r\n\r\n // If there is no data left in the cache, we want to continue\r\n // and let the cache object itself get destroyed\r\n if (pvt ? !isEmptyDataObject(thisCache) : !jQuery.isEmptyObject(thisCache)) {\r\n return;\r\n }\r\n }\r\n }\r\n\r\n // See jQuery.data for more information\r\n if (!pvt) {\r\n delete cache[id].data;\r\n\r\n // Don't destroy the parent cache unless the internal data object\r\n // had been the only thing left in it\r\n if (!isEmptyDataObject(cache[id])) {\r\n return;\r\n }\r\n }\r\n\r\n // Destroy the cache\r\n if (isNode) {\r\n jQuery.cleanData([elem], true);\r\n\r\n // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080)\r\n /* jshint eqeqeq: false */\r\n } else if (support.deleteExpando || cache != cache.window) {\r\n /* jshint eqeqeq: true */\r\n delete cache[id];\r\n\r\n // When all else fails, null\r\n } else {\r\n cache[id] = null;\r\n }\r\n }\r\n\r\n jQuery.extend({\r\n cache: {},\r\n\r\n // The following elements (space-suffixed to avoid Object.prototype collisions)\r\n // throw uncatchable exceptions if you attempt to set expando properties\r\n noData: {\r\n \"applet \": true,\r\n \"embed \": true,\r\n // ...but Flash objects (which have this classid) *can* handle expandos\r\n \"object \": \"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"\r\n },\r\n\r\n hasData: function (elem) {\r\n elem = elem.nodeType ? jQuery.cache[elem[jQuery.expando]] : elem[jQuery.expando];\r\n return !!elem && !isEmptyDataObject(elem);\r\n },\r\n\r\n data: function (elem, name, data) {\r\n return internalData(elem, name, data);\r\n },\r\n\r\n removeData: function (elem, name) {\r\n return internalRemoveData(elem, name);\r\n },\r\n\r\n // For internal use only.\r\n _data: function (elem, name, data) {\r\n return internalData(elem, name, data, true);\r\n },\r\n\r\n _removeData: function (elem, name) {\r\n return internalRemoveData(elem, name, true);\r\n }\r\n });\r\n\r\n jQuery.fn.extend({\r\n data: function (key, value) {\r\n var i, name, data,\r\n elem = this[0],\r\n attrs = elem && elem.attributes;\r\n\r\n // Special expections of .data basically thwart jQuery.access,\r\n // so implement the relevant behavior ourselves\r\n\r\n // Gets all values\r\n if (key === undefined) {\r\n if (this.length) {\r\n data = jQuery.data(elem);\r\n\r\n if (elem.nodeType === 1 && !jQuery._data(elem, \"parsedAttrs\")) {\r\n i = attrs.length;\r\n while (i--) {\r\n\r\n // Support: IE11+\r\n // The attrs elements can be null (#14894)\r\n if (attrs[i]) {\r\n name = attrs[i].name;\r\n if (name.indexOf(\"data-\") === 0) {\r\n name = jQuery.camelCase(name.slice(5));\r\n dataAttr(elem, name, data[name]);\r\n }\r\n }\r\n }\r\n jQuery._data(elem, \"parsedAttrs\", true);\r\n }\r\n }\r\n\r\n return data;\r\n }\r\n\r\n // Sets multiple values\r\n if (typeof key === \"object\") {\r\n return this.each(function () {\r\n jQuery.data(this, key);\r\n });\r\n }\r\n\r\n return arguments.length > 1 ?\r\n\r\n // Sets one value\r\n this.each(function () {\r\n jQuery.data(this, key, value);\r\n }) :\r\n\r\n // Gets one value\r\n // Try to fetch any internally stored data first\r\n elem ? dataAttr(elem, key, jQuery.data(elem, key)) : undefined;\r\n },\r\n\r\n removeData: function (key) {\r\n return this.each(function () {\r\n jQuery.removeData(this, key);\r\n });\r\n }\r\n });\r\n\r\n\r\n jQuery.extend({\r\n queue: function (elem, type, data) {\r\n var queue;\r\n\r\n if (elem) {\r\n type = ( type || \"fx\" ) + \"queue\";\r\n queue = jQuery._data(elem, type);\r\n\r\n // Speed up dequeue by getting out quickly if this is just a lookup\r\n if (data) {\r\n if (!queue || jQuery.isArray(data)) {\r\n queue = jQuery._data(elem, type, jQuery.makeArray(data));\r\n } else {\r\n queue.push(data);\r\n }\r\n }\r\n return queue || [];\r\n }\r\n },\r\n\r\n dequeue: function (elem, type) {\r\n type = type || \"fx\";\r\n\r\n var queue = jQuery.queue(elem, type),\r\n startLength = queue.length,\r\n fn = queue.shift(),\r\n hooks = jQuery._queueHooks(elem, type),\r\n next = function () {\r\n jQuery.dequeue(elem, type);\r\n };\r\n\r\n // If the fx queue is dequeued, always remove the progress sentinel\r\n if (fn === \"inprogress\") {\r\n fn = queue.shift();\r\n startLength--;\r\n }\r\n\r\n if (fn) {\r\n\r\n // Add a progress sentinel to prevent the fx queue from being\r\n // automatically dequeued\r\n if (type === \"fx\") {\r\n queue.unshift(\"inprogress\");\r\n }\r\n\r\n // clear up the last queue stop function\r\n delete hooks.stop;\r\n fn.call(elem, next, hooks);\r\n }\r\n\r\n if (!startLength && hooks) {\r\n hooks.empty.fire();\r\n }\r\n },\r\n\r\n // not intended for public consumption - generates a queueHooks object, or returns the current one\r\n _queueHooks: function (elem, type) {\r\n var key = type + \"queueHooks\";\r\n return jQuery._data(elem, key) || jQuery._data(elem, key, {\r\n empty: jQuery.Callbacks(\"once memory\").add(function () {\r\n jQuery._removeData(elem, type + \"queue\");\r\n jQuery._removeData(elem, key);\r\n })\r\n });\r\n }\r\n });\r\n\r\n jQuery.fn.extend({\r\n queue: function (type, data) {\r\n var setter = 2;\r\n\r\n if (typeof type !== \"string\") {\r\n data = type;\r\n type = \"fx\";\r\n setter--;\r\n }\r\n\r\n if (arguments.length < setter) {\r\n return jQuery.queue(this[0], type);\r\n }\r\n\r\n return data === undefined ?\r\n this :\r\n this.each(function () {\r\n var queue = jQuery.queue(this, type, data);\r\n\r\n // ensure a hooks for this queue\r\n jQuery._queueHooks(this, type);\r\n\r\n if (type === \"fx\" && queue[0] !== \"inprogress\") {\r\n jQuery.dequeue(this, type);\r\n }\r\n });\r\n },\r\n dequeue: function (type) {\r\n return this.each(function () {\r\n jQuery.dequeue(this, type);\r\n });\r\n },\r\n clearQueue: function (type) {\r\n return this.queue(type || \"fx\", []);\r\n },\r\n // Get a promise resolved when queues of a certain type\r\n // are emptied (fx is the type by default)\r\n promise: function (type, obj) {\r\n var tmp,\r\n count = 1,\r\n defer = jQuery.Deferred(),\r\n elements = this,\r\n i = this.length,\r\n resolve = function () {\r\n if (!( --count )) {\r\n defer.resolveWith(elements, [elements]);\r\n }\r\n };\r\n\r\n if (typeof type !== \"string\") {\r\n obj = type;\r\n type = undefined;\r\n }\r\n type = type || \"fx\";\r\n\r\n while (i--) {\r\n tmp = jQuery._data(elements[i], type + \"queueHooks\");\r\n if (tmp && tmp.empty) {\r\n count++;\r\n tmp.empty.add(resolve);\r\n }\r\n }\r\n resolve();\r\n return defer.promise(obj);\r\n }\r\n });\r\n\r\n\r\n /*\r\n * Helper functions for managing events -- not part of the public interface.\r\n * Props to Dean Edwards' addEvent library for many of the ideas.\r\n */\r\n jQuery.event = {\r\n\r\n global: {},\r\n\r\n add: function (elem, types, handler, data, selector) {\r\n var tmp, events, t, handleObjIn,\r\n special, eventHandle, handleObj,\r\n handlers, type, namespaces, origType,\r\n elemData = jQuery._data(elem);\r\n\r\n // Don't attach events to noData or text/comment nodes (but allow plain objects)\r\n if (!elemData) {\r\n return;\r\n }\r\n\r\n // Caller can pass in an object of custom data in lieu of the handler\r\n if (handler.handler) {\r\n handleObjIn = handler;\r\n handler = handleObjIn.handler;\r\n selector = handleObjIn.selector;\r\n }\r\n\r\n // Make sure that the handler has a unique ID, used to find/remove it later\r\n if (!handler.guid) {\r\n handler.guid = jQuery.guid++;\r\n }\r\n\r\n // Init the element's event structure and main handler, if this is the first\r\n if (!(events = elemData.events)) {\r\n events = elemData.events = {};\r\n }\r\n if (!(eventHandle = elemData.handle)) {\r\n eventHandle = elemData.handle = function (e) {\r\n // Discard the second event of a jQuery.event.trigger() and\r\n // when an event is called after a page has unloaded\r\n return typeof jQuery !== strundefined && (!e || jQuery.event.triggered !== e.type) ?\r\n jQuery.event.dispatch.apply(eventHandle.elem, arguments) :\r\n undefined;\r\n };\r\n // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events\r\n eventHandle.elem = elem;\r\n }\r\n\r\n // Handle multiple events separated by a space\r\n types = ( types || \"\" ).match(rnotwhite) || [\"\"];\r\n t = types.length;\r\n while (t--) {\r\n tmp = rtypenamespace.exec(types[t]) || [];\r\n type = origType = tmp[1];\r\n namespaces = ( tmp[2] || \"\" ).split(\".\").sort();\r\n\r\n // There *must* be a type, no attaching namespace-only handlers\r\n if (!type) {\r\n continue;\r\n }\r\n\r\n // If event changes its type, use the special event handlers for the changed type\r\n special = jQuery.event.special[type] || {};\r\n\r\n // If selector defined, determine special event api type, otherwise given type\r\n type = ( selector ? special.delegateType : special.bindType ) || type;\r\n\r\n // Update special based on newly reset type\r\n special = jQuery.event.special[type] || {};\r\n\r\n // handleObj is passed to all event handlers\r\n handleObj = jQuery.extend({\r\n type: type,\r\n origType: origType,\r\n data: data,\r\n handler: handler,\r\n guid: handler.guid,\r\n selector: selector,\r\n needsContext: selector && jQuery.expr.match.needsContext.test(selector),\r\n namespace: namespaces.join(\".\")\r\n }, handleObjIn);\r\n\r\n // Init the event handler queue if we're the first\r\n if (!(handlers = events[type])) {\r\n handlers = events[type] = [];\r\n handlers.delegateCount = 0;\r\n\r\n // Only use addEventListener/attachEvent if the special events handler returns false\r\n if (!special.setup || special.setup.call(elem, data, namespaces, eventHandle) === false) {\r\n // Bind the global event handler to the element\r\n if (elem.addEventListener) {\r\n elem.addEventListener(type, eventHandle, false);\r\n\r\n } else if (elem.attachEvent) {\r\n elem.attachEvent(\"on\" + type, eventHandle);\r\n }\r\n }\r\n }\r\n\r\n if (special.add) {\r\n special.add.call(elem, handleObj);\r\n\r\n if (!handleObj.handler.guid) {\r\n handleObj.handler.guid = handler.guid;\r\n }\r\n }\r\n\r\n // Add to the element's handler list, delegates in front\r\n if (selector) {\r\n handlers.splice(handlers.delegateCount++, 0, handleObj);\r\n } else {\r\n handlers.push(handleObj);\r\n }\r\n\r\n // Keep track of which events have ever been used, for event optimization\r\n jQuery.event.global[type] = true;\r\n }\r\n\r\n // Nullify elem to prevent memory leaks in IE\r\n elem = null;\r\n },\r\n\r\n // Detach an event or set of events from an element\r\n remove: function (elem, types, handler, selector, mappedTypes) {\r\n var j, handleObj, tmp,\r\n origCount, t, events,\r\n special, handlers, type,\r\n namespaces, origType,\r\n elemData = jQuery.hasData(elem) && jQuery._data(elem);\r\n\r\n if (!elemData || !(events = elemData.events)) {\r\n return;\r\n }\r\n\r\n // Once for each type.namespace in types; type may be omitted\r\n types = ( types || \"\" ).match(rnotwhite) || [\"\"];\r\n t = types.length;\r\n while (t--) {\r\n tmp = rtypenamespace.exec(types[t]) || [];\r\n type = origType = tmp[1];\r\n namespaces = ( tmp[2] || \"\" ).split(\".\").sort();\r\n\r\n // Unbind all events (on this namespace, if provided) for the element\r\n if (!type) {\r\n for (type in events) {\r\n jQuery.event.remove(elem, type + types[t], handler, selector, true);\r\n }\r\n continue;\r\n }\r\n\r\n special = jQuery.event.special[type] || {};\r\n type = ( selector ? special.delegateType : special.bindType ) || type;\r\n handlers = events[type] || [];\r\n tmp = tmp[2] && new RegExp(\"(^|\\\\.)\" + namespaces.join(\"\\\\.(?:.*\\\\.|)\") + \"(\\\\.|$)\");\r\n\r\n // Remove matching events\r\n origCount = j = handlers.length;\r\n while (j--) {\r\n handleObj = handlers[j];\r\n\r\n if (( mappedTypes || origType === handleObj.origType ) &&\r\n ( !handler || handler.guid === handleObj.guid ) &&\r\n ( !tmp || tmp.test(handleObj.namespace) ) &&\r\n ( !selector || selector === handleObj.selector || selector === \"**\" && handleObj.selector )) {\r\n handlers.splice(j, 1);\r\n\r\n if (handleObj.selector) {\r\n handlers.delegateCount--;\r\n }\r\n if (special.remove) {\r\n special.remove.call(elem, handleObj);\r\n }\r\n }\r\n }\r\n\r\n // Remove generic event handler if we removed something and no more handlers exist\r\n // (avoids potential for endless recursion during removal of special event handlers)\r\n if (origCount && !handlers.length) {\r\n if (!special.teardown || special.teardown.call(elem, namespaces, elemData.handle) === false) {\r\n jQuery.removeEvent(elem, type, elemData.handle);\r\n }\r\n\r\n delete events[type];\r\n }\r\n }\r\n\r\n // Remove the expando if it's no longer used\r\n if (jQuery.isEmptyObject(events)) {\r\n delete elemData.handle;\r\n\r\n // removeData also checks for emptiness and clears the expando if empty\r\n // so use it instead of delete\r\n jQuery._removeData(elem, \"events\");\r\n }\r\n },\r\n\r\n trigger: function (event, data, elem, onlyHandlers) {\r\n var handle, ontype, cur,\r\n bubbleType, special, tmp, i,\r\n eventPath = [elem || document],\r\n type = hasOwn.call(event, \"type\") ? event.type : event,\r\n namespaces = hasOwn.call(event, \"namespace\") ? event.namespace.split(\".\") : [];\r\n\r\n cur = tmp = elem = elem || document;\r\n\r\n // Don't do events on text and comment nodes\r\n if (elem.nodeType === 3 || elem.nodeType === 8) {\r\n return;\r\n }\r\n\r\n // focus/blur morphs to focusin/out; ensure we're not firing them right now\r\n if (rfocusMorph.test(type + jQuery.event.triggered)) {\r\n return;\r\n }\r\n\r\n if (type.indexOf(\".\") >= 0) {\r\n // Namespaced trigger; create a regexp to match event type in handle()\r\n namespaces = type.split(\".\");\r\n type = namespaces.shift();\r\n namespaces.sort();\r\n }\r\n ontype = type.indexOf(\":\") < 0 && \"on\" + type;\r\n\r\n // Caller can pass in a jQuery.Event object, Object, or just an event type string\r\n event = event[jQuery.expando] ?\r\n event :\r\n new jQuery.Event(type, typeof event === \"object\" && event);\r\n\r\n // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)\r\n event.isTrigger = onlyHandlers ? 2 : 3;\r\n event.namespace = namespaces.join(\".\");\r\n event.namespace_re = event.namespace ?\r\n new RegExp(\"(^|\\\\.)\" + namespaces.join(\"\\\\.(?:.*\\\\.|)\") + \"(\\\\.|$)\") :\r\n null;\r\n\r\n // Clean up the event in case it is being reused\r\n event.result = undefined;\r\n if (!event.target) {\r\n event.target = elem;\r\n }\r\n\r\n // Clone any incoming data and prepend the event, creating the handler arg list\r\n data = data == null ?\r\n [event] :\r\n jQuery.makeArray(data, [event]);\r\n\r\n // Allow special events to draw outside the lines\r\n special = jQuery.event.special[type] || {};\r\n if (!onlyHandlers && special.trigger && special.trigger.apply(elem, data) === false) {\r\n return;\r\n }\r\n\r\n // Determine event propagation path in advance, per W3C events spec (#9951)\r\n // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)\r\n if (!onlyHandlers && !special.noBubble && !jQuery.isWindow(elem)) {\r\n\r\n bubbleType = special.delegateType || type;\r\n if (!rfocusMorph.test(bubbleType + type)) {\r\n cur = cur.parentNode;\r\n }\r\n for (; cur; cur = cur.parentNode) {\r\n eventPath.push(cur);\r\n tmp = cur;\r\n }\r\n\r\n // Only add window if we got to document (e.g., not plain obj or detached DOM)\r\n if (tmp === (elem.ownerDocument || document)) {\r\n eventPath.push(tmp.defaultView || tmp.parentWindow || window);\r\n }\r\n }\r\n\r\n // Fire handlers on the event path\r\n i = 0;\r\n while ((cur = eventPath[i++]) && !event.isPropagationStopped()) {\r\n\r\n event.type = i > 1 ?\r\n bubbleType :\r\n special.bindType || type;\r\n\r\n // jQuery handler\r\n handle = ( jQuery._data(cur, \"events\") || {} )[event.type] && jQuery._data(cur, \"handle\");\r\n if (handle) {\r\n handle.apply(cur, data);\r\n }\r\n\r\n // Native handler\r\n handle = ontype && cur[ontype];\r\n if (handle && handle.apply && jQuery.acceptData(cur)) {\r\n event.result = handle.apply(cur, data);\r\n if (event.result === false) {\r\n event.preventDefault();\r\n }\r\n }\r\n }\r\n event.type = type;\r\n\r\n // If nobody prevented the default action, do it now\r\n if (!onlyHandlers && !event.isDefaultPrevented()) {\r\n\r\n if ((!special._default || special._default.apply(eventPath.pop(), data) === false) &&\r\n jQuery.acceptData(elem)) {\r\n\r\n // Call a native DOM method on the target with the same name name as the event.\r\n // Can't use an .isFunction() check here because IE6/7 fails that test.\r\n // Don't do default actions on window, that's where global variables be (#6170)\r\n if (ontype && elem[type] && !jQuery.isWindow(elem)) {\r\n\r\n // Don't re-trigger an onFOO event when we call its FOO() method\r\n tmp = elem[ontype];\r\n\r\n if (tmp) {\r\n elem[ontype] = null;\r\n }\r\n\r\n // Prevent re-triggering of the same event, since we already bubbled it above\r\n jQuery.event.triggered = type;\r\n try {\r\n elem[type]();\r\n } catch (e) {\r\n // IE<9 dies on focus/blur to hidden element (#1486,#12518)\r\n // only reproducible on winXP IE8 native, not IE9 in IE8 mode\r\n }\r\n jQuery.event.triggered = undefined;\r\n\r\n if (tmp) {\r\n elem[ontype] = tmp;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return event.result;\r\n },\r\n\r\n dispatch: function (event) {\r\n\r\n // Make a writable jQuery.Event from the native event object\r\n event = jQuery.event.fix(event);\r\n\r\n var i, ret, handleObj, matched, j,\r\n handlerQueue = [],\r\n args = slice.call(arguments),\r\n handlers = ( jQuery._data(this, \"events\") || {} )[event.type] || [],\r\n special = jQuery.event.special[event.type] || {};\r\n\r\n // Use the fix-ed jQuery.Event rather than the (read-only) native event\r\n args[0] = event;\r\n event.delegateTarget = this;\r\n\r\n // Call the preDispatch hook for the mapped type, and let it bail if desired\r\n if (special.preDispatch && special.preDispatch.call(this, event) === false) {\r\n return;\r\n }\r\n\r\n // Determine handlers\r\n handlerQueue = jQuery.event.handlers.call(this, event, handlers);\r\n\r\n // Run delegates first; they may want to stop propagation beneath us\r\n i = 0;\r\n while ((matched = handlerQueue[i++]) && !event.isPropagationStopped()) {\r\n event.currentTarget = matched.elem;\r\n\r\n j = 0;\r\n while ((handleObj = matched.handlers[j++]) && !event.isImmediatePropagationStopped()) {\r\n\r\n // Triggered event must either 1) have no namespace, or\r\n // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).\r\n if (!event.namespace_re || event.namespace_re.test(handleObj.namespace)) {\r\n\r\n event.handleObj = handleObj;\r\n event.data = handleObj.data;\r\n\r\n ret = ( (jQuery.event.special[handleObj.origType] || {}).handle || handleObj.handler )\r\n .apply(matched.elem, args);\r\n\r\n if (ret !== undefined) {\r\n if ((event.result = ret) === false) {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Call the postDispatch hook for the mapped type\r\n if (special.postDispatch) {\r\n special.postDispatch.call(this, event);\r\n }\r\n\r\n return event.result;\r\n },\r\n\r\n handlers: function (event, handlers) {\r\n var sel, handleObj, matches, i,\r\n handlerQueue = [],\r\n delegateCount = handlers.delegateCount,\r\n cur = event.target;\r\n\r\n // Find delegate handlers\r\n // Black-hole SVG instance trees (#13180)\r\n // Avoid non-left-click bubbling in Firefox (#3861)\r\n if (delegateCount && cur.nodeType && (!event.button || event.type !== \"click\")) {\r\n\r\n /* jshint eqeqeq: false */\r\n for (; cur != this; cur = cur.parentNode || this) {\r\n /* jshint eqeqeq: true */\r\n\r\n // Don't check non-elements (#13208)\r\n // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)\r\n if (cur.nodeType === 1 && (cur.disabled !== true || event.type !== \"click\")) {\r\n matches = [];\r\n for (i = 0; i < delegateCount; i++) {\r\n handleObj = handlers[i];\r\n\r\n // Don't conflict with Object.prototype properties (#13203)\r\n sel = handleObj.selector + \" \";\r\n\r\n if (matches[sel] === undefined) {\r\n matches[sel] = handleObj.needsContext ?\r\n jQuery(sel, this).index(cur) >= 0 :\r\n jQuery.find(sel, this, null, [cur]).length;\r\n }\r\n if (matches[sel]) {\r\n matches.push(handleObj);\r\n }\r\n }\r\n if (matches.length) {\r\n handlerQueue.push({elem: cur, handlers: matches});\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Add the remaining (directly-bound) handlers\r\n if (delegateCount < handlers.length) {\r\n handlerQueue.push({elem: this, handlers: handlers.slice(delegateCount)});\r\n }\r\n\r\n return handlerQueue;\r\n },\r\n\r\n fix: function (event) {\r\n if (event[jQuery.expando]) {\r\n return event;\r\n }\r\n\r\n // Create a writable copy of the event object and normalize some properties\r\n var i, prop, copy,\r\n type = event.type,\r\n originalEvent = event,\r\n fixHook = this.fixHooks[type];\r\n\r\n if (!fixHook) {\r\n this.fixHooks[type] = fixHook =\r\n rmouseEvent.test(type) ? this.mouseHooks :\r\n rkeyEvent.test(type) ? this.keyHooks :\r\n {};\r\n }\r\n copy = fixHook.props ? this.props.concat(fixHook.props) : this.props;\r\n\r\n event = new jQuery.Event(originalEvent);\r\n\r\n i = copy.length;\r\n while (i--) {\r\n prop = copy[i];\r\n event[prop] = originalEvent[prop];\r\n }\r\n\r\n // Support: IE<9\r\n // Fix target property (#1925)\r\n if (!event.target) {\r\n event.target = originalEvent.srcElement || document;\r\n }\r\n\r\n // Support: Chrome 23+, Safari?\r\n // Target should not be a text node (#504, #13143)\r\n if (event.target.nodeType === 3) {\r\n event.target = event.target.parentNode;\r\n }\r\n\r\n // Support: IE<9\r\n // For mouse/key events, metaKey==false if it's undefined (#3368, #11328)\r\n event.metaKey = !!event.metaKey;\r\n\r\n return fixHook.filter ? fixHook.filter(event, originalEvent) : event;\r\n },\r\n\r\n // Includes some event props shared by KeyEvent and MouseEvent\r\n props: \"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which\".split(\" \"),\r\n\r\n fixHooks: {},\r\n\r\n keyHooks: {\r\n props: \"char charCode key keyCode\".split(\" \"),\r\n filter: function (event, original) {\r\n\r\n // Add which for key events\r\n if (event.which == null) {\r\n event.which = original.charCode != null ? original.charCode : original.keyCode;\r\n }\r\n\r\n return event;\r\n }\r\n },\r\n\r\n mouseHooks: {\r\n props: \"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement\".split(\" \"),\r\n filter: function (event, original) {\r\n var body, eventDoc, doc,\r\n button = original.button,\r\n fromElement = original.fromElement;\r\n\r\n // Calculate pageX/Y if missing and clientX/Y available\r\n if (event.pageX == null && original.clientX != null) {\r\n eventDoc = event.target.ownerDocument || document;\r\n doc = eventDoc.documentElement;\r\n body = eventDoc.body;\r\n\r\n event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );\r\n event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );\r\n }\r\n\r\n // Add relatedTarget, if necessary\r\n if (!event.relatedTarget && fromElement) {\r\n event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;\r\n }\r\n\r\n // Add which for click: 1 === left; 2 === middle; 3 === right\r\n // Note: button is not normalized, so don't use it\r\n if (!event.which && button !== undefined) {\r\n event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );\r\n }\r\n\r\n return event;\r\n }\r\n },\r\n\r\n special: {\r\n load: {\r\n // Prevent triggered image.load events from bubbling to window.load\r\n noBubble: true\r\n },\r\n focus: {\r\n // Fire native event if possible so blur/focus sequence is correct\r\n trigger: function () {\r\n if (this !== safeActiveElement() && this.focus) {\r\n try {\r\n this.focus();\r\n return false;\r\n } catch (e) {\r\n // Support: IE<9\r\n // If we error on focus to hidden element (#1486, #12518),\r\n // let .trigger() run the handlers\r\n }\r\n }\r\n },\r\n delegateType: \"focusin\"\r\n },\r\n blur: {\r\n trigger: function () {\r\n if (this === safeActiveElement() && this.blur) {\r\n this.blur();\r\n return false;\r\n }\r\n },\r\n delegateType: \"focusout\"\r\n },\r\n click: {\r\n // For checkbox, fire native event so checked state will be right\r\n trigger: function () {\r\n if (jQuery.nodeName(this, \"input\") && this.type === \"checkbox\" && this.click) {\r\n this.click();\r\n return false;\r\n }\r\n },\r\n\r\n // For cross-browser consistency, don't fire native .click() on links\r\n _default: function (event) {\r\n return jQuery.nodeName(event.target, \"a\");\r\n }\r\n },\r\n\r\n beforeunload: {\r\n postDispatch: function (event) {\r\n\r\n // Support: Firefox 20+\r\n // Firefox doesn't alert if the returnValue field is not set.\r\n if (event.result !== undefined && event.originalEvent) {\r\n event.originalEvent.returnValue = event.result;\r\n }\r\n }\r\n }\r\n },\r\n\r\n simulate: function (type, elem, event, bubble) {\r\n // Piggyback on a donor event to simulate a different one.\r\n // Fake originalEvent to avoid donor's stopPropagation, but if the\r\n // simulated event prevents default then we do the same on the donor.\r\n var e = jQuery.extend(\r\n new jQuery.Event(),\r\n event,\r\n {\r\n type: type,\r\n isSimulated: true,\r\n originalEvent: {}\r\n }\r\n );\r\n if (bubble) {\r\n jQuery.event.trigger(e, null, elem);\r\n } else {\r\n jQuery.event.dispatch.call(elem, e);\r\n }\r\n if (e.isDefaultPrevented()) {\r\n event.preventDefault();\r\n }\r\n }\r\n };\r\n\r\n jQuery.removeEvent = document.removeEventListener ?\r\n function (elem, type, handle) {\r\n if (elem.removeEventListener) {\r\n elem.removeEventListener(type, handle, false);\r\n }\r\n } :\r\n function (elem, type, handle) {\r\n var name = \"on\" + type;\r\n\r\n if (elem.detachEvent) {\r\n\r\n // #8545, #7054, preventing memory leaks for custom events in IE6-8\r\n // detachEvent needed property on element, by name of that event, to properly expose it to GC\r\n if (typeof elem[name] === strundefined) {\r\n elem[name] = null;\r\n }\r\n\r\n elem.detachEvent(name, handle);\r\n }\r\n };\r\n\r\n jQuery.Event = function (src, props) {\r\n // Allow instantiation without the 'new' keyword\r\n if (!(this instanceof jQuery.Event)) {\r\n return new jQuery.Event(src, props);\r\n }\r\n\r\n // Event object\r\n if (src && src.type) {\r\n this.originalEvent = src;\r\n this.type = src.type;\r\n\r\n // Events bubbling up the document may have been marked as prevented\r\n // by a handler lower down the tree; reflect the correct value.\r\n this.isDefaultPrevented = src.defaultPrevented ||\r\n src.defaultPrevented === undefined &&\r\n // Support: IE < 9, Android < 4.0\r\n src.returnValue === false ?\r\n returnTrue :\r\n returnFalse;\r\n\r\n // Event type\r\n } else {\r\n this.type = src;\r\n }\r\n\r\n // Put explicitly provided properties onto the event object\r\n if (props) {\r\n jQuery.extend(this, props);\r\n }\r\n\r\n // Create a timestamp if incoming event doesn't have one\r\n this.timeStamp = src && src.timeStamp || jQuery.now();\r\n\r\n // Mark it as fixed\r\n this[jQuery.expando] = true;\r\n };\r\n\r\n var rformElems = /^(?:input|select|textarea)$/i,\r\n rkeyEvent = /^key/,\r\n rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/,\r\n rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,\r\n rtypenamespace = /^([^.]*)(?:\\.(.+)|)$/;\r\n\r\n function returnTrue() {\r\n return true;\r\n }\r\n\r\n function returnFalse() {\r\n return false;\r\n }\r\n\r\n// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding\r\n// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html\r\n jQuery.Event.prototype = {\r\n isDefaultPrevented: returnFalse,\r\n isPropagationStopped: returnFalse,\r\n isImmediatePropagationStopped: returnFalse,\r\n\r\n preventDefault: function () {\r\n var e = this.originalEvent;\r\n\r\n this.isDefaultPrevented = returnTrue;\r\n if (!e) {\r\n return;\r\n }\r\n\r\n // If preventDefault exists, run it on the original event\r\n if (e.preventDefault) {\r\n e.preventDefault();\r\n\r\n // Support: IE\r\n // Otherwise set the returnValue property of the original event to false\r\n } else {\r\n e.returnValue = false;\r\n }\r\n },\r\n stopPropagation: function () {\r\n var e = this.originalEvent;\r\n\r\n this.isPropagationStopped = returnTrue;\r\n if (!e) {\r\n return;\r\n }\r\n // If stopPropagation exists, run it on the original event\r\n if (e.stopPropagation) {\r\n e.stopPropagation();\r\n }\r\n\r\n // Support: IE\r\n // Set the cancelBubble property of the original event to true\r\n e.cancelBubble = true;\r\n },\r\n stopImmediatePropagation: function () {\r\n var e = this.originalEvent;\r\n\r\n this.isImmediatePropagationStopped = returnTrue;\r\n\r\n if (e && e.stopImmediatePropagation) {\r\n e.stopImmediatePropagation();\r\n }\r\n\r\n this.stopPropagation();\r\n }\r\n };\r\n\r\n\r\n// IE submit delegation\r\n if (!support.submitBubbles) {\r\n\r\n jQuery.event.special.submit = {\r\n setup: function () {\r\n // Only need this for delegated form submit events\r\n if (jQuery.nodeName(this, \"form\")) {\r\n return false;\r\n }\r\n\r\n // Lazy-add a submit handler when a descendant form may potentially be submitted\r\n jQuery.event.add(this, \"click._submit keypress._submit\", function (e) {\r\n // Node name check avoids a VML-related crash in IE (#9807)\r\n var elem = e.target,\r\n form = jQuery.nodeName(elem, \"input\") || jQuery.nodeName(elem, \"button\") ? elem.form : undefined;\r\n if (form && !jQuery._data(form, \"submitBubbles\")) {\r\n jQuery.event.add(form, \"submit._submit\", function (event) {\r\n event._submit_bubble = true;\r\n });\r\n jQuery._data(form, \"submitBubbles\", true);\r\n }\r\n });\r\n // return undefined since we don't need an event listener\r\n },\r\n\r\n postDispatch: function (event) {\r\n // If form was submitted by the user, bubble the event up the tree\r\n if (event._submit_bubble) {\r\n delete event._submit_bubble;\r\n if (this.parentNode && !event.isTrigger) {\r\n jQuery.event.simulate(\"submit\", this.parentNode, event, true);\r\n }\r\n }\r\n },\r\n\r\n teardown: function () {\r\n // Only need this for delegated form submit events\r\n if (jQuery.nodeName(this, \"form\")) {\r\n return false;\r\n }\r\n\r\n // Remove delegated handlers; cleanData eventually reaps submit handlers attached above\r\n jQuery.event.remove(this, \"._submit\");\r\n }\r\n };\r\n }\r\n\r\n// IE change delegation and checkbox/radio fix\r\n if (!support.changeBubbles) {\r\n\r\n jQuery.event.special.change = {\r\n\r\n setup: function () {\r\n\r\n if (rformElems.test(this.nodeName)) {\r\n // IE doesn't fire change on a check/radio until blur; trigger it on click\r\n // after a propertychange. Eat the blur-change in special.change.handle.\r\n // This still fires onchange a second time for check/radio after blur.\r\n if (this.type === \"checkbox\" || this.type === \"radio\") {\r\n jQuery.event.add(this, \"propertychange._change\", function (event) {\r\n if (event.originalEvent.propertyName === \"checked\") {\r\n this._just_changed = true;\r\n }\r\n });\r\n jQuery.event.add(this, \"click._change\", function (event) {\r\n if (this._just_changed && !event.isTrigger) {\r\n this._just_changed = false;\r\n }\r\n // Allow triggered, simulated change events (#11500)\r\n jQuery.event.simulate(\"change\", this, event, true);\r\n });\r\n }\r\n return false;\r\n }\r\n // Delegated event; lazy-add a change handler on descendant inputs\r\n jQuery.event.add(this, \"beforeactivate._change\", function (e) {\r\n var elem = e.target;\r\n\r\n if (rformElems.test(elem.nodeName) && !jQuery._data(elem, \"changeBubbles\")) {\r\n jQuery.event.add(elem, \"change._change\", function (event) {\r\n if (this.parentNode && !event.isSimulated && !event.isTrigger) {\r\n jQuery.event.simulate(\"change\", this.parentNode, event, true);\r\n }\r\n });\r\n jQuery._data(elem, \"changeBubbles\", true);\r\n }\r\n });\r\n },\r\n\r\n handle: function (event) {\r\n var elem = event.target;\r\n\r\n // Swallow native change events from checkbox/radio, we already triggered them above\r\n if (this !== elem || event.isSimulated || event.isTrigger || (elem.type !== \"radio\" && elem.type !== \"checkbox\")) {\r\n return event.handleObj.handler.apply(this, arguments);\r\n }\r\n },\r\n\r\n teardown: function () {\r\n jQuery.event.remove(this, \"._change\");\r\n\r\n return !rformElems.test(this.nodeName);\r\n }\r\n };\r\n }\r\n\r\n// Create \"bubbling\" focus and blur events\r\n if (!support.focusinBubbles) {\r\n jQuery.each({focus: \"focusin\", blur: \"focusout\"}, function (orig, fix) {\r\n\r\n // Attach a single capturing handler on the document while someone wants focusin/focusout\r\n var handler = function (event) {\r\n jQuery.event.simulate(fix, event.target, jQuery.event.fix(event), true);\r\n };\r\n\r\n jQuery.event.special[fix] = {\r\n setup: function () {\r\n var doc = this.ownerDocument || this,\r\n attaches = jQuery._data(doc, fix);\r\n\r\n if (!attaches) {\r\n doc.addEventListener(orig, handler, true);\r\n }\r\n jQuery._data(doc, fix, ( attaches || 0 ) + 1);\r\n },\r\n teardown: function () {\r\n var doc = this.ownerDocument || this,\r\n attaches = jQuery._data(doc, fix) - 1;\r\n\r\n if (!attaches) {\r\n doc.removeEventListener(orig, handler, true);\r\n jQuery._removeData(doc, fix);\r\n } else {\r\n jQuery._data(doc, fix, attaches);\r\n }\r\n }\r\n };\r\n });\r\n }\r\n\r\n jQuery.fn.extend({\r\n\r\n on: function (types, selector, data, fn, /*INTERNAL*/ one) {\r\n var type, origFn;\r\n\r\n // Types can be a map of types/handlers\r\n if (typeof types === \"object\") {\r\n // ( types-Object, selector, data )\r\n if (typeof selector !== \"string\") {\r\n // ( types-Object, data )\r\n data = data || selector;\r\n selector = undefined;\r\n }\r\n for (type in types) {\r\n this.on(type, selector, data, types[type], one);\r\n }\r\n return this;\r\n }\r\n\r\n if (data == null && fn == null) {\r\n // ( types, fn )\r\n fn = selector;\r\n data = selector = undefined;\r\n } else if (fn == null) {\r\n if (typeof selector === \"string\") {\r\n // ( types, selector, fn )\r\n fn = data;\r\n data = undefined;\r\n } else {\r\n // ( types, data, fn )\r\n fn = data;\r\n data = selector;\r\n selector = undefined;\r\n }\r\n }\r\n if (fn === false) {\r\n fn = returnFalse;\r\n } else if (!fn) {\r\n return this;\r\n }\r\n\r\n if (one === 1) {\r\n origFn = fn;\r\n fn = function (event) {\r\n // Can use an empty set, since event contains the info\r\n jQuery().off(event);\r\n return origFn.apply(this, arguments);\r\n };\r\n // Use same guid so caller can remove using origFn\r\n fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );\r\n }\r\n return this.each(function () {\r\n jQuery.event.add(this, types, fn, data, selector);\r\n });\r\n },\r\n one: function (types, selector, data, fn) {\r\n return this.on(types, selector, data, fn, 1);\r\n },\r\n off: function (types, selector, fn) {\r\n var handleObj, type;\r\n if (types && types.preventDefault && types.handleObj) {\r\n // ( event ) dispatched jQuery.Event\r\n handleObj = types.handleObj;\r\n jQuery(types.delegateTarget).off(\r\n handleObj.namespace ? handleObj.origType + \".\" + handleObj.namespace : handleObj.origType,\r\n handleObj.selector,\r\n handleObj.handler\r\n );\r\n return this;\r\n }\r\n if (typeof types === \"object\") {\r\n // ( types-object [, selector] )\r\n for (type in types) {\r\n this.off(type, selector, types[type]);\r\n }\r\n return this;\r\n }\r\n if (selector === false || typeof selector === \"function\") {\r\n // ( types [, fn] )\r\n fn = selector;\r\n selector = undefined;\r\n }\r\n if (fn === false) {\r\n fn = returnFalse;\r\n }\r\n return this.each(function () {\r\n jQuery.event.remove(this, types, fn, selector);\r\n });\r\n },\r\n\r\n trigger: function (type, data) {\r\n return this.each(function () {\r\n jQuery.event.trigger(type, data, this);\r\n });\r\n },\r\n triggerHandler: function (type, data) {\r\n var elem = this[0];\r\n if (elem) {\r\n return jQuery.event.trigger(type, data, elem, true);\r\n }\r\n }\r\n });\r\n\r\n\r\n// Based off of the plugin by Clint Helfers, with permission.\r\n// http://blindsignals.com/index.php/2009/07/jquery-delay/\r\n jQuery.fn.delay = function (time, type) {\r\n time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;\r\n type = type || \"fx\";\r\n\r\n return this.queue(type, function (next, hooks) {\r\n var timeout = setTimeout(next, time);\r\n hooks.stop = function () {\r\n clearTimeout(timeout);\r\n };\r\n });\r\n };\r\n\r\n\r\n var nonce = jQuery.now();\r\n\r\n var rquery = (/\\?/);\r\n\r\n\r\n var rvalidtokens = /(,)|(\\[|{)|(}|])|\"(?:[^\"\\\\\\r\\n]|\\\\[\"\\\\\\/bfnrt]|\\\\u[\\da-fA-F]{4})*\"\\s*:?|true|false|null|-?(?!0\\d)\\d+(?:\\.\\d+|)(?:[eE][+-]?\\d+|)/g;\r\n\r\n jQuery.parseJSON = function (data) {\r\n // Attempt to parse using the native JSON parser first\r\n if (window.JSON && window.JSON.parse) {\r\n // Support: Android 2.3\r\n // Workaround failure to string-cast null input\r\n return window.JSON.parse(data + \"\");\r\n }\r\n\r\n var requireNonComma,\r\n depth = null,\r\n str = jQuery.trim(data + \"\");\r\n\r\n // Guard against invalid (and possibly dangerous) input by ensuring that nothing remains\r\n // after removing valid tokens\r\n return str && !jQuery.trim(str.replace(rvalidtokens, function (token, comma, open, close) {\r\n\r\n // Force termination if we see a misplaced comma\r\n if (requireNonComma && comma) {\r\n depth = 0;\r\n }\r\n\r\n // Perform no more replacements after returning to outermost depth\r\n if (depth === 0) {\r\n return token;\r\n }\r\n\r\n // Commas must not follow \"[\", \"{\", or \",\"\r\n requireNonComma = open || comma;\r\n\r\n // Determine new depth\r\n // array/object open (\"[\" or \"{\"): depth += true - false (increment)\r\n // array/object close (\"]\" or \"}\"): depth += false - true (decrement)\r\n // other cases (\",\" or primitive): depth += true - true (numeric cast)\r\n depth += !close - !open;\r\n\r\n // Remove this token\r\n return \"\";\r\n })) ?\r\n ( Function(\"return \" + str) )() :\r\n jQuery.error(\"Invalid JSON: \" + data);\r\n };\r\n\r\n\r\n// Cross-browser xml parsing\r\n jQuery.parseXML = function (data) {\r\n var xml, tmp;\r\n if (!data || typeof data !== \"string\") {\r\n return null;\r\n }\r\n try {\r\n if (window.DOMParser) { // Standard\r\n tmp = new DOMParser();\r\n xml = tmp.parseFromString(data, \"text/xml\");\r\n } else { // IE\r\n xml = new ActiveXObject(\"Microsoft.XMLDOM\");\r\n xml.async = \"false\";\r\n xml.loadXML(data);\r\n }\r\n } catch (e) {\r\n xml = undefined;\r\n }\r\n if (!xml || !xml.documentElement || xml.getElementsByTagName(\"parsererror\").length) {\r\n jQuery.error(\"Invalid XML: \" + data);\r\n }\r\n return xml;\r\n };\r\n\r\n\r\n var\r\n // Document location\r\n ajaxLocParts,\r\n ajaxLocation,\r\n\r\n rhash = /#.*$/,\r\n rts = /([?&])_=[^&]*/,\r\n rheaders = /^(.*?):[ \\t]*([^\\r\\n]*)\\r?$/mg, // IE leaves an \\r character at EOL\r\n // #7653, #8125, #8152: local protocol detection\r\n rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,\r\n rnoContent = /^(?:GET|HEAD)$/,\r\n rprotocol = /^\\/\\//,\r\n rurl = /^([\\w.+-]+:)(?:\\/\\/(?:[^\\/?#]*@|)([^\\/?#:]*)(?::(\\d+)|)|)/,\r\n\r\n /* Prefilters\r\n * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)\r\n * 2) These are called:\r\n * - BEFORE asking for a transport\r\n * - AFTER param serialization (s.data is a string if s.processData is true)\r\n * 3) key is the dataType\r\n * 4) the catchall symbol \"*\" can be used\r\n * 5) execution will start with transport dataType and THEN continue down to \"*\" if needed\r\n */\r\n prefilters = {},\r\n\r\n /* Transports bindings\r\n * 1) key is the dataType\r\n * 2) the catchall symbol \"*\" can be used\r\n * 3) selection will start with transport dataType and THEN go to \"*\" if needed\r\n */\r\n transports = {},\r\n\r\n // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression\r\n allTypes = \"*/\".concat(\"*\");\r\n\r\n// #8138, IE may throw an exception when accessing\r\n// a field from window.location if document.domain has been set\r\n try {\r\n ajaxLocation = location.href;\r\n } catch (e) {\r\n // Use the href attribute of an A element\r\n // since IE will modify it given document.location\r\n ajaxLocation = document.createElement(\"a\");\r\n ajaxLocation.href = \"\";\r\n ajaxLocation = ajaxLocation.href;\r\n }\r\n\r\n// Segment location into parts\r\n ajaxLocParts = rurl.exec(ajaxLocation.toLowerCase()) || [];\r\n\r\n// Base \"constructor\" for jQuery.ajaxPrefilter and jQuery.ajaxTransport\r\n function addToPrefiltersOrTransports(structure) {\r\n\r\n // dataTypeExpression is optional and defaults to \"*\"\r\n return function (dataTypeExpression, func) {\r\n\r\n if (typeof dataTypeExpression !== \"string\") {\r\n func = dataTypeExpression;\r\n dataTypeExpression = \"*\";\r\n }\r\n\r\n var dataType,\r\n i = 0,\r\n dataTypes = dataTypeExpression.toLowerCase().match(rnotwhite) || [];\r\n\r\n if (jQuery.isFunction(func)) {\r\n // For each dataType in the dataTypeExpression\r\n while ((dataType = dataTypes[i++])) {\r\n // Prepend if requested\r\n if (dataType.charAt(0) === \"+\") {\r\n dataType = dataType.slice(1) || \"*\";\r\n (structure[dataType] = structure[dataType] || []).unshift(func);\r\n\r\n // Otherwise append\r\n } else {\r\n (structure[dataType] = structure[dataType] || []).push(func);\r\n }\r\n }\r\n }\r\n };\r\n }\r\n\r\n// Base inspection function for prefilters and transports\r\n function inspectPrefiltersOrTransports(structure, options, originalOptions, jqXHR) {\r\n\r\n var inspected = {},\r\n seekingTransport = ( structure === transports );\r\n\r\n function inspect(dataType) {\r\n var selected;\r\n inspected[dataType] = true;\r\n jQuery.each(structure[dataType] || [], function (_, prefilterOrFactory) {\r\n var dataTypeOrTransport = prefilterOrFactory(options, originalOptions, jqXHR);\r\n if (typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[dataTypeOrTransport]) {\r\n options.dataTypes.unshift(dataTypeOrTransport);\r\n inspect(dataTypeOrTransport);\r\n return false;\r\n } else if (seekingTransport) {\r\n return !( selected = dataTypeOrTransport );\r\n }\r\n });\r\n return selected;\r\n }\r\n\r\n return inspect(options.dataTypes[0]) || !inspected[\"*\"] && inspect(\"*\");\r\n }\r\n\r\n// A special extend for ajax options\r\n// that takes \"flat\" options (not to be deep extended)\r\n// Fixes #9887\r\n function ajaxExtend(target, src) {\r\n var deep, key,\r\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\r\n\r\n for (key in src) {\r\n if (src[key] !== undefined) {\r\n ( flatOptions[key] ? target : ( deep || (deep = {}) ) )[key] = src[key];\r\n }\r\n }\r\n if (deep) {\r\n jQuery.extend(true, target, deep);\r\n }\r\n\r\n return target;\r\n }\r\n\r\n /* Handles responses to an ajax request:\r\n * - finds the right dataType (mediates between content-type and expected dataType)\r\n * - returns the corresponding response\r\n */\r\n function ajaxHandleResponses(s, jqXHR, responses) {\r\n var firstDataType, ct, finalDataType, type,\r\n contents = s.contents,\r\n dataTypes = s.dataTypes;\r\n\r\n // Remove auto dataType and get content-type in the process\r\n while (dataTypes[0] === \"*\") {\r\n dataTypes.shift();\r\n if (ct === undefined) {\r\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\r\n }\r\n }\r\n\r\n // Check if we're dealing with a known content-type\r\n if (ct) {\r\n for (type in contents) {\r\n if (contents[type] && contents[type].test(ct)) {\r\n dataTypes.unshift(type);\r\n break;\r\n }\r\n }\r\n }\r\n\r\n // Check to see if we have a response for the expected dataType\r\n if (dataTypes[0] in responses) {\r\n finalDataType = dataTypes[0];\r\n } else {\r\n // Try convertible dataTypes\r\n for (type in responses) {\r\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\r\n finalDataType = type;\r\n break;\r\n }\r\n if (!firstDataType) {\r\n firstDataType = type;\r\n }\r\n }\r\n // Or just use first one\r\n finalDataType = finalDataType || firstDataType;\r\n }\r\n\r\n // If we found a dataType\r\n // We add the dataType to the list if needed\r\n // and return the corresponding response\r\n if (finalDataType) {\r\n if (finalDataType !== dataTypes[0]) {\r\n dataTypes.unshift(finalDataType);\r\n }\r\n return responses[finalDataType];\r\n }\r\n }\r\n\r\n /* Chain conversions given the request and the original response\r\n * Also sets the responseXXX fields on the jqXHR instance\r\n */\r\n function ajaxConvert(s, response, jqXHR, isSuccess) {\r\n var conv2, current, conv, tmp, prev,\r\n converters = {},\r\n // Work with a copy of dataTypes in case we need to modify it for conversion\r\n dataTypes = s.dataTypes.slice();\r\n\r\n // Create converters map with lowercased keys\r\n if (dataTypes[1]) {\r\n for (conv in s.converters) {\r\n converters[conv.toLowerCase()] = s.converters[conv];\r\n }\r\n }\r\n\r\n current = dataTypes.shift();\r\n\r\n // Convert to each sequential dataType\r\n while (current) {\r\n\r\n if (s.responseFields[current]) {\r\n jqXHR[s.responseFields[current]] = response;\r\n }\r\n\r\n // Apply the dataFilter if provided\r\n if (!prev && isSuccess && s.dataFilter) {\r\n response = s.dataFilter(response, s.dataType);\r\n }\r\n\r\n prev = current;\r\n current = dataTypes.shift();\r\n\r\n if (current) {\r\n\r\n // There's only work to do if current dataType is non-auto\r\n if (current === \"*\") {\r\n\r\n current = prev;\r\n\r\n // Convert response if prev dataType is non-auto and differs from current\r\n } else if (prev !== \"*\" && prev !== current) {\r\n\r\n // Seek a direct converter\r\n conv = converters[prev + \" \" + current] || converters[\"* \" + current];\r\n\r\n // If none found, seek a pair\r\n if (!conv) {\r\n for (conv2 in converters) {\r\n\r\n // If conv2 outputs current\r\n tmp = conv2.split(\" \");\r\n if (tmp[1] === current) {\r\n\r\n // If prev can be converted to accepted input\r\n conv = converters[prev + \" \" + tmp[0]] ||\r\n converters[\"* \" + tmp[0]];\r\n if (conv) {\r\n // Condense equivalence converters\r\n if (conv === true) {\r\n conv = converters[conv2];\r\n\r\n // Otherwise, insert the intermediate dataType\r\n } else if (converters[conv2] !== true) {\r\n current = tmp[0];\r\n dataTypes.unshift(tmp[1]);\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Apply converter (if not an equivalence)\r\n if (conv !== true) {\r\n\r\n // Unless errors are allowed to bubble, catch and return them\r\n if (conv && s[\"throws\"]) {\r\n response = conv(response);\r\n } else {\r\n try {\r\n response = conv(response);\r\n } catch (e) {\r\n return {\r\n state: \"parsererror\",\r\n error: conv ? e : \"No conversion from \" + prev + \" to \" + current\r\n };\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n return {state: \"success\", data: response};\r\n }\r\n\r\n jQuery.extend({\r\n\r\n // Counter for holding the number of active queries\r\n active: 0,\r\n\r\n // Last-Modified header cache for next request\r\n lastModified: {},\r\n etag: {},\r\n\r\n ajaxSettings: {\r\n url: ajaxLocation,\r\n type: \"GET\",\r\n isLocal: rlocalProtocol.test(ajaxLocParts[1]),\r\n global: true,\r\n processData: true,\r\n async: true,\r\n contentType: \"application/x-www-form-urlencoded; charset=UTF-8\",\r\n /*\r\n timeout: 0,\r\n data: null,\r\n dataType: null,\r\n username: null,\r\n password: null,\r\n cache: null,\r\n throws: false,\r\n traditional: false,\r\n headers: {},\r\n */\r\n\r\n accepts: {\r\n \"*\": allTypes,\r\n text: \"text/plain\",\r\n html: \"text/html\",\r\n xml: \"application/xml, text/xml\",\r\n json: \"application/json, text/javascript\"\r\n },\r\n\r\n contents: {\r\n xml: /xml/,\r\n html: /html/,\r\n json: /json/\r\n },\r\n\r\n responseFields: {\r\n xml: \"responseXML\",\r\n text: \"responseText\",\r\n json: \"responseJSON\"\r\n },\r\n\r\n // Data converters\r\n // Keys separate source (or catchall \"*\") and destination types with a single space\r\n converters: {\r\n\r\n // Convert anything to text\r\n \"* text\": String,\r\n\r\n // Text to html (true = no transformation)\r\n \"text html\": true,\r\n\r\n // Evaluate text as a json expression\r\n \"text json\": jQuery.parseJSON,\r\n\r\n // Parse text as xml\r\n \"text xml\": jQuery.parseXML\r\n },\r\n\r\n // For options that shouldn't be deep extended:\r\n // you can add your own custom options here if\r\n // and when you create one that shouldn't be\r\n // deep extended (see ajaxExtend)\r\n flatOptions: {\r\n url: true,\r\n context: true\r\n }\r\n },\r\n\r\n // Creates a full fledged settings object into target\r\n // with both ajaxSettings and settings fields.\r\n // If target is omitted, writes into ajaxSettings.\r\n ajaxSetup: function (target, settings) {\r\n return settings ?\r\n\r\n // Building a settings object\r\n ajaxExtend(ajaxExtend(target, jQuery.ajaxSettings), settings) :\r\n\r\n // Extending ajaxSettings\r\n ajaxExtend(jQuery.ajaxSettings, target);\r\n },\r\n\r\n ajaxPrefilter: addToPrefiltersOrTransports(prefilters),\r\n ajaxTransport: addToPrefiltersOrTransports(transports),\r\n\r\n // Main method\r\n ajax: function (url, options) {\r\n\r\n // If url is an object, simulate pre-1.5 signature\r\n if (typeof url === \"object\") {\r\n options = url;\r\n url = undefined;\r\n }\r\n\r\n // Force options to be an object\r\n options = options || {};\r\n\r\n var // Cross-domain detection vars\r\n parts,\r\n // Loop variable\r\n i,\r\n // URL without anti-cache param\r\n cacheURL,\r\n // Response headers as string\r\n responseHeadersString,\r\n // timeout handle\r\n timeoutTimer,\r\n\r\n // To know if global events are to be dispatched\r\n fireGlobals,\r\n\r\n transport,\r\n // Response headers\r\n responseHeaders,\r\n // Create the final options object\r\n s = jQuery.ajaxSetup({}, options),\r\n // Callbacks context\r\n callbackContext = s.context || s,\r\n // Context for global events is callbackContext if it is a DOM node or jQuery collection\r\n globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?\r\n jQuery(callbackContext) :\r\n jQuery.event,\r\n // Deferreds\r\n deferred = jQuery.Deferred(),\r\n completeDeferred = jQuery.Callbacks(\"once memory\"),\r\n // Status-dependent callbacks\r\n statusCode = s.statusCode || {},\r\n // Headers (they are sent all at once)\r\n requestHeaders = {},\r\n requestHeadersNames = {},\r\n // The jqXHR state\r\n state = 0,\r\n // Default abort message\r\n strAbort = \"canceled\",\r\n // Fake xhr\r\n jqXHR = {\r\n readyState: 0,\r\n\r\n // Builds headers hashtable if needed\r\n getResponseHeader: function (key) {\r\n var match;\r\n if (state === 2) {\r\n if (!responseHeaders) {\r\n responseHeaders = {};\r\n while ((match = rheaders.exec(responseHeadersString))) {\r\n responseHeaders[match[1].toLowerCase()] = match[2];\r\n }\r\n }\r\n match = responseHeaders[key.toLowerCase()];\r\n }\r\n return match == null ? null : match;\r\n },\r\n\r\n // Raw string\r\n getAllResponseHeaders: function () {\r\n return state === 2 ? responseHeadersString : null;\r\n },\r\n\r\n // Caches the header\r\n setRequestHeader: function (name, value) {\r\n var lname = name.toLowerCase();\r\n if (!state) {\r\n name = requestHeadersNames[lname] = requestHeadersNames[lname] || name;\r\n requestHeaders[name] = value;\r\n }\r\n return this;\r\n },\r\n\r\n // Overrides response content-type header\r\n overrideMimeType: function (type) {\r\n if (!state) {\r\n s.mimeType = type;\r\n }\r\n return this;\r\n },\r\n\r\n // Status-dependent callbacks\r\n statusCode: function (map) {\r\n var code;\r\n if (map) {\r\n if (state < 2) {\r\n for (code in map) {\r\n // Lazy-add the new callback in a way that preserves old ones\r\n statusCode[code] = [statusCode[code], map[code]];\r\n }\r\n } else {\r\n // Execute the appropriate callbacks\r\n jqXHR.always(map[jqXHR.status]);\r\n }\r\n }\r\n return this;\r\n },\r\n\r\n // Cancel the request\r\n abort: function (statusText) {\r\n var finalText = statusText || strAbort;\r\n if (transport) {\r\n transport.abort(finalText);\r\n }\r\n done(0, finalText);\r\n return this;\r\n }\r\n };\r\n\r\n // Attach deferreds\r\n deferred.promise(jqXHR).complete = completeDeferred.add;\r\n jqXHR.success = jqXHR.done;\r\n jqXHR.error = jqXHR.fail;\r\n\r\n // Remove hash character (#7531: and string promotion)\r\n // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)\r\n // Handle falsy url in the settings object (#10093: consistency with old signature)\r\n // We also use the url parameter if available\r\n s.url = ( ( url || s.url || ajaxLocation ) + \"\" ).replace(rhash, \"\").replace(rprotocol, ajaxLocParts[1] + \"//\");\r\n\r\n // Alias method option to type as per ticket #12004\r\n s.type = options.method || options.type || s.method || s.type;\r\n\r\n // Extract dataTypes list\r\n s.dataTypes = jQuery.trim(s.dataType || \"*\").toLowerCase().match(rnotwhite) || [\"\"];\r\n\r\n // A cross-domain request is in order when we have a protocol:host:port mismatch\r\n if (s.crossDomain == null) {\r\n parts = rurl.exec(s.url.toLowerCase());\r\n s.crossDomain = !!( parts &&\r\n ( parts[1] !== ajaxLocParts[1] || parts[2] !== ajaxLocParts[2] ||\r\n ( parts[3] || ( parts[1] === \"http:\" ? \"80\" : \"443\" ) ) !==\r\n ( ajaxLocParts[3] || ( ajaxLocParts[1] === \"http:\" ? \"80\" : \"443\" ) ) )\r\n );\r\n }\r\n\r\n // Convert data if not already a string\r\n if (s.data && s.processData && typeof s.data !== \"string\") {\r\n s.data = jQuery.param(s.data, s.traditional);\r\n }\r\n\r\n // Apply prefilters\r\n inspectPrefiltersOrTransports(prefilters, s, options, jqXHR);\r\n\r\n // If request was aborted inside a prefilter, stop there\r\n if (state === 2) {\r\n return jqXHR;\r\n }\r\n\r\n // We can fire global events as of now if asked to\r\n fireGlobals = s.global;\r\n\r\n // Watch for a new set of requests\r\n if (fireGlobals && jQuery.active++ === 0) {\r\n jQuery.event.trigger(\"ajaxStart\");\r\n }\r\n\r\n // Uppercase the type\r\n s.type = s.type.toUpperCase();\r\n\r\n // Determine if request has content\r\n s.hasContent = !rnoContent.test(s.type);\r\n\r\n // Save the URL in case we're toying with the If-Modified-Since\r\n // and/or If-None-Match header later on\r\n cacheURL = s.url;\r\n\r\n // More options handling for requests with no content\r\n if (!s.hasContent) {\r\n\r\n // If data is available, append data to url\r\n if (s.data) {\r\n cacheURL = ( s.url += ( rquery.test(cacheURL) ? \"&\" : \"?\" ) + s.data );\r\n // #9682: remove data so that it's not used in an eventual retry\r\n delete s.data;\r\n }\r\n\r\n // Add anti-cache in url if needed\r\n if (s.cache === false) {\r\n s.url = rts.test(cacheURL) ?\r\n\r\n // If there is already a '_' parameter, set its value\r\n cacheURL.replace(rts, \"$1_=\" + nonce++) :\r\n\r\n // Otherwise add one to the end\r\n cacheURL + ( rquery.test(cacheURL) ? \"&\" : \"?\" ) + \"_=\" + nonce++;\r\n }\r\n }\r\n\r\n // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\r\n if (s.ifModified) {\r\n if (jQuery.lastModified[cacheURL]) {\r\n jqXHR.setRequestHeader(\"If-Modified-Since\", jQuery.lastModified[cacheURL]);\r\n }\r\n if (jQuery.etag[cacheURL]) {\r\n jqXHR.setRequestHeader(\"If-None-Match\", jQuery.etag[cacheURL]);\r\n }\r\n }\r\n\r\n // Set the correct header, if data is being sent\r\n if (s.data && s.hasContent && s.contentType !== false || options.contentType) {\r\n jqXHR.setRequestHeader(\"Content-Type\", s.contentType);\r\n }\r\n\r\n // Set the Accepts header for the server, depending on the dataType\r\n // jqXHR.setRequestHeader(\r\n // \"Accept\",\r\n // s.dataTypes[0] && s.accepts[s.dataTypes[0]] ?\r\n // s.accepts[s.dataTypes[0]] + ( s.dataTypes[0] !== \"*\" ? \", \" + allTypes + \"; q=0.01\" : \"\" ) :\r\n // s.accepts[\"*\"]\r\n // );\r\n\r\n // Check for headers option\r\n for (i in s.headers) {\r\n jqXHR.setRequestHeader(i, s.headers[i]);\r\n }\r\n\r\n // Allow custom headers/mimetypes and early abort\r\n if (s.beforeSend && ( s.beforeSend.call(callbackContext, jqXHR, s) === false || state === 2 )) {\r\n // Abort if not done already and return\r\n return jqXHR.abort();\r\n }\r\n\r\n // aborting is no longer a cancellation\r\n strAbort = \"abort\";\r\n\r\n // Install callbacks on deferreds\r\n for (i in {success: 1, error: 1, complete: 1}) {\r\n jqXHR[i](s[i]);\r\n }\r\n\r\n // Get transport\r\n transport = inspectPrefiltersOrTransports(transports, s, options, jqXHR);\r\n\r\n // If no transport, we auto-abort\r\n if (!transport) {\r\n done(-1, \"No Transport\");\r\n } else {\r\n jqXHR.readyState = 1;\r\n\r\n // Send global event\r\n if (fireGlobals) {\r\n globalEventContext.trigger(\"ajaxSend\", [jqXHR, s]);\r\n }\r\n // Timeout\r\n if (s.async && s.timeout > 0) {\r\n timeoutTimer = setTimeout(function () {\r\n jqXHR.abort(\"timeout\");\r\n }, s.timeout);\r\n }\r\n\r\n try {\r\n state = 1;\r\n transport.send(requestHeaders, done);\r\n } catch (e) {\r\n // Propagate exception as error if not done\r\n if (state < 2) {\r\n done(-1, e);\r\n // Simply rethrow otherwise\r\n } else {\r\n throw e;\r\n }\r\n }\r\n }\r\n\r\n // Callback for when everything is done\r\n function done(status, nativeStatusText, responses, headers) {\r\n var isSuccess, success, error, response, modified,\r\n statusText = nativeStatusText;\r\n\r\n // Called once\r\n if (state === 2) {\r\n return;\r\n }\r\n\r\n // State is \"done\" now\r\n state = 2;\r\n\r\n // Clear timeout if it exists\r\n if (timeoutTimer) {\r\n clearTimeout(timeoutTimer);\r\n }\r\n\r\n // Dereference transport for early garbage collection\r\n // (no matter how long the jqXHR object will be used)\r\n transport = undefined;\r\n\r\n // Cache response headers\r\n responseHeadersString = headers || \"\";\r\n\r\n // Set readyState\r\n jqXHR.readyState = status > 0 ? 4 : 0;\r\n\r\n // Determine if successful\r\n isSuccess = status >= 200 && status < 300 || status === 304;\r\n\r\n // Get response data\r\n if (responses) {\r\n response = ajaxHandleResponses(s, jqXHR, responses);\r\n }\r\n\r\n // Convert no matter what (that way responseXXX fields are always set)\r\n response = ajaxConvert(s, response, jqXHR, isSuccess);\r\n\r\n // If successful, handle type chaining\r\n if (isSuccess) {\r\n\r\n // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\r\n if (s.ifModified) {\r\n modified = jqXHR.getResponseHeader(\"Last-Modified\");\r\n if (modified) {\r\n jQuery.lastModified[cacheURL] = modified;\r\n }\r\n modified = jqXHR.getResponseHeader(\"etag\");\r\n if (modified) {\r\n jQuery.etag[cacheURL] = modified;\r\n }\r\n }\r\n\r\n // if no content\r\n if (status === 204 || s.type === \"HEAD\") {\r\n statusText = \"nocontent\";\r\n\r\n // if not modified\r\n } else if (status === 304) {\r\n statusText = \"notmodified\";\r\n\r\n // If we have data, let's convert it\r\n } else {\r\n statusText = response.state;\r\n success = response.data;\r\n error = response.error;\r\n isSuccess = !error;\r\n }\r\n } else {\r\n // We extract error from statusText\r\n // then normalize statusText and status for non-aborts\r\n error = statusText;\r\n if (status || !statusText) {\r\n statusText = \"error\";\r\n if (status < 0) {\r\n status = 0;\r\n }\r\n }\r\n }\r\n\r\n // Set data for the fake xhr object\r\n jqXHR.status = status;\r\n jqXHR.statusText = ( nativeStatusText || statusText ) + \"\";\r\n\r\n // Success/Error\r\n if (isSuccess) {\r\n deferred.resolveWith(callbackContext, [success, statusText, jqXHR]);\r\n } else {\r\n deferred.rejectWith(callbackContext, [jqXHR, statusText, error]);\r\n }\r\n\r\n // Status-dependent callbacks\r\n jqXHR.statusCode(statusCode);\r\n statusCode = undefined;\r\n\r\n if (fireGlobals) {\r\n globalEventContext.trigger(isSuccess ? \"ajaxSuccess\" : \"ajaxError\",\r\n [jqXHR, s, isSuccess ? success : error]);\r\n }\r\n\r\n // Complete\r\n completeDeferred.fireWith(callbackContext, [jqXHR, statusText]);\r\n\r\n if (fireGlobals) {\r\n globalEventContext.trigger(\"ajaxComplete\", [jqXHR, s]);\r\n // Handle the global AJAX counter\r\n if (!( --jQuery.active )) {\r\n jQuery.event.trigger(\"ajaxStop\");\r\n }\r\n }\r\n }\r\n\r\n return jqXHR;\r\n },\r\n\r\n getJSON: function (url, data, callback) {\r\n return jQuery.get(url, data, callback, \"json\");\r\n },\r\n\r\n getScript: function (url, callback) {\r\n return jQuery.get(url, undefined, callback, \"script\");\r\n }\r\n });\r\n\r\n jQuery.each([\"get\", \"post\"], function (i, method) {\r\n jQuery[method] = function (url, data, callback, type) {\r\n // shift arguments if data argument was omitted\r\n if (jQuery.isFunction(data)) {\r\n type = type || callback;\r\n callback = data;\r\n data = undefined;\r\n }\r\n\r\n return jQuery.ajax({\r\n url: url,\r\n type: method,\r\n dataType: type,\r\n data: data,\r\n success: callback\r\n });\r\n };\r\n });\r\n\r\n// Attach a bunch of functions for handling common AJAX events\r\n jQuery.each([\"ajaxStart\", \"ajaxStop\", \"ajaxComplete\", \"ajaxError\", \"ajaxSuccess\", \"ajaxSend\"], function (i, type) {\r\n jQuery.fn[type] = function (fn) {\r\n return this.on(type, fn);\r\n };\r\n });\r\n\r\n\r\n jQuery._evalUrl = function (url) {\r\n return jQuery.ajax({\r\n url: url,\r\n type: \"GET\",\r\n dataType: \"script\",\r\n async: false,\r\n global: false,\r\n \"throws\": true\r\n });\r\n };\r\n\r\n\r\n var r20 = /%20/g,\r\n rbracket = /\\[\\]$/,\r\n rCRLF = /\\r?\\n/g,\r\n rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,\r\n rsubmittable = /^(?:input|select|textarea|keygen)/i;\r\n\r\n function buildParams(prefix, obj, traditional, add) {\r\n var name;\r\n\r\n if (jQuery.isArray(obj)) {\r\n // Serialize array item.\r\n jQuery.each(obj, function (i, v) {\r\n if (traditional || rbracket.test(prefix)) {\r\n // Treat each array item as a scalar.\r\n add(prefix, v);\r\n\r\n } else {\r\n // Item is non-scalar (array or object), encode its numeric index.\r\n buildParams(prefix + \"[\" + ( typeof v === \"object\" ? i : \"\" ) + \"]\", v, traditional, add);\r\n }\r\n });\r\n\r\n } else if (!traditional && jQuery.type(obj) === \"object\") {\r\n // Serialize object item.\r\n for (name in obj) {\r\n buildParams(prefix + \"[\" + name + \"]\", obj[name], traditional, add);\r\n }\r\n\r\n } else {\r\n // Serialize scalar item.\r\n add(prefix, obj);\r\n }\r\n }\r\n\r\n// Serialize an array of form elements or a set of\r\n// key/values into a query string\r\n jQuery.param = function (a, traditional) {\r\n var prefix,\r\n s = [],\r\n add = function (key, value) {\r\n // If value is a function, invoke it and return its value\r\n value = jQuery.isFunction(value) ? value() : ( value == null ? \"\" : value );\r\n s[s.length] = encodeURIComponent(key) + \"=\" + encodeURIComponent(value);\r\n };\r\n\r\n // Set traditional to true for jQuery <= 1.3.2 behavior.\r\n if (traditional === undefined) {\r\n traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;\r\n }\r\n\r\n // If an array was passed in, assume that it is an array of form elements.\r\n if (jQuery.isArray(a) || ( a.jquery && !jQuery.isPlainObject(a) )) {\r\n // Serialize the form elements\r\n jQuery.each(a, function () {\r\n add(this.name, this.value);\r\n });\r\n\r\n } else {\r\n // If traditional, encode the \"old\" way (the way 1.3.2 or older\r\n // did it), otherwise encode params recursively.\r\n for (prefix in a) {\r\n buildParams(prefix, a[prefix], traditional, add);\r\n }\r\n }\r\n\r\n // Return the resulting serialization\r\n return s.join(\"&\").replace(r20, \"+\");\r\n };\r\n\r\n jQuery.fn.extend({\r\n serialize: function () {\r\n return jQuery.param(this.serializeArray());\r\n },\r\n serializeArray: function () {\r\n return this.map(function () {\r\n // Can add propHook for \"elements\" to filter or add form elements\r\n var elements = jQuery.prop(this, \"elements\");\r\n return elements ? jQuery.makeArray(elements) : this;\r\n })\r\n .filter(function () {\r\n var type = this.type;\r\n // Use .is(\":disabled\") so that fieldset[disabled] works\r\n return this.name && !jQuery(this).is(\":disabled\") &&\r\n rsubmittable.test(this.nodeName) && !rsubmitterTypes.test(type) &&\r\n ( this.checked || !rcheckableType.test(type) );\r\n })\r\n .map(function (i, elem) {\r\n var val = jQuery(this).val();\r\n\r\n return val == null ?\r\n null :\r\n jQuery.isArray(val) ?\r\n jQuery.map(val, function (val) {\r\n return {name: elem.name, value: val.replace(rCRLF, \"\\r\\n\")};\r\n }) :\r\n {name: elem.name, value: val.replace(rCRLF, \"\\r\\n\")};\r\n }).get();\r\n }\r\n });\r\n\r\n\r\n// Create the request object\r\n// (This is still attached to ajaxSettings for backward compatibility)\r\n jQuery.ajaxSettings.xhr = window.ActiveXObject !== undefined ?\r\n // Support: IE6+\r\n function () {\r\n\r\n // XHR cannot access local files, always use ActiveX for that case\r\n return !this.isLocal &&\r\n\r\n // Support: IE7-8\r\n // oldIE XHR does not support non-RFC2616 methods (#13240)\r\n // See http://msdn.microsoft.com/en-us/library/ie/ms536648(v=vs.85).aspx\r\n // and http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9\r\n // Although this check for six methods instead of eight\r\n // since IE also does not support \"trace\" and \"connect\"\r\n /^(get|post|head|put|delete|options)$/i.test(this.type) &&\r\n\r\n createStandardXHR() || createActiveXHR();\r\n } :\r\n // For all other browsers, use the standard XMLHttpRequest object\r\n createStandardXHR;\r\n\r\n var xhrId = 0,\r\n xhrCallbacks = {},\r\n xhrSupported = jQuery.ajaxSettings.xhr();\r\n\r\n// Support: IE<10\r\n// Open requests must be manually aborted on unload (#5280)\r\n if (window.ActiveXObject) {\r\n jQuery(window).on(\"unload\", function () {\r\n for (var key in xhrCallbacks) {\r\n xhrCallbacks[key](undefined, true);\r\n }\r\n });\r\n }\r\n\r\n// Determine support properties\r\n support.cors = !!xhrSupported && ( \"withCredentials\" in xhrSupported );\r\n xhrSupported = support.ajax = !!xhrSupported;\r\n\r\n// Create transport if the browser can provide an xhr\r\n if (xhrSupported) {\r\n\r\n jQuery.ajaxTransport(function (options) {\r\n // Cross domain only allowed if supported through XMLHttpRequest\r\n if (!options.crossDomain || support.cors) {\r\n\r\n var callback;\r\n\r\n return {\r\n send: function (headers, complete) {\r\n var i,\r\n xhr = options.xhr(),\r\n id = ++xhrId;\r\n\r\n // Open the socket\r\n xhr.open(options.type, options.url, options.async, options.username, options.password);\r\n\r\n // Apply custom fields if provided\r\n if (options.xhrFields) {\r\n for (i in options.xhrFields) {\r\n xhr[i] = options.xhrFields[i];\r\n }\r\n }\r\n\r\n // Override mime type if needed\r\n if (options.mimeType && xhr.overrideMimeType) {\r\n xhr.overrideMimeType(options.mimeType);\r\n }\r\n\r\n // X-Requested-With header\r\n // For cross-domain requests, seeing as conditions for a preflight are\r\n // akin to a jigsaw puzzle, we simply never set it to be sure.\r\n // (it can always be set on a per-request basis or even using ajaxSetup)\r\n // For same-domain requests, won't change header if already provided.\r\n if (!options.crossDomain && !headers[\"X-Requested-With\"]) {\r\n headers[\"X-Requested-With\"] = \"XMLHttpRequest\";\r\n }\r\n\r\n // Set headers\r\n for (i in headers) {\r\n // Support: IE<9\r\n // IE's ActiveXObject throws a 'Type Mismatch' exception when setting\r\n // request header to a null-value.\r\n //\r\n // To keep consistent with other XHR implementations, cast the value\r\n // to string and ignore `undefined`.\r\n if (headers[i] !== undefined) {\r\n xhr.setRequestHeader(i, headers[i] + \"\");\r\n }\r\n }\r\n\r\n if (xhr.upload && options.progress) {\r\n xhr.upload.onprogress = options.progress;\r\n }\r\n\r\n // Do send the request\r\n // This may raise an exception which is actually\r\n // handled in jQuery.ajax (so no try/catch here)\r\n xhr.send(( options.hasContent && (options.body || options.data)) || null);\r\n\r\n // Listener\r\n callback = function (_, isAbort) {\r\n var status, statusText, responses;\r\n\r\n // Was never called and is aborted or complete\r\n if (callback && ( isAbort || xhr.readyState === 4 )) {\r\n // Clean up\r\n delete xhrCallbacks[id];\r\n callback = undefined;\r\n xhr.onreadystatechange = jQuery.noop;\r\n\r\n // Abort manually if needed\r\n if (isAbort) {\r\n if (xhr.readyState !== 4) {\r\n xhr.abort();\r\n }\r\n } else {\r\n responses = {};\r\n status = xhr.status;\r\n\r\n // Support: IE<10\r\n // Accessing binary-data responseText throws an exception\r\n // (#11426)\r\n if (typeof xhr.responseText === \"string\") {\r\n responses.text = xhr.responseText;\r\n }\r\n\r\n // Firefox throws an exception when accessing\r\n // statusText for faulty cross-domain requests\r\n try {\r\n statusText = xhr.statusText;\r\n } catch (e) {\r\n // We normalize with Webkit giving an empty statusText\r\n statusText = \"\";\r\n }\r\n\r\n // Filter status for non standard behaviors\r\n\r\n // If the request is local and we have data: assume a success\r\n // (success with no data won't get notified, that's the best we\r\n // can do given current implementations)\r\n if (!status && options.isLocal && !options.crossDomain) {\r\n status = responses.text ? 200 : 404;\r\n // IE - #1450: sometimes returns 1223 when it should be 204\r\n } else if (status === 1223) {\r\n status = 204;\r\n }\r\n }\r\n }\r\n\r\n // Call complete if needed\r\n if (responses) {\r\n complete(status, statusText, responses, xhr.getAllResponseHeaders());\r\n }\r\n };\r\n\r\n if (!options.async) {\r\n // if we're in sync mode we fire the callback\r\n callback();\r\n } else if (xhr.readyState === 4) {\r\n // (IE6 & IE7) if it's in cache and has been\r\n // retrieved directly we need to fire the callback\r\n setTimeout(callback);\r\n } else {\r\n // Add to the list of active xhr callbacks\r\n xhr.onreadystatechange = xhrCallbacks[id] = callback;\r\n }\r\n },\r\n\r\n abort: function () {\r\n if (callback) {\r\n callback(undefined, true);\r\n }\r\n }\r\n };\r\n }\r\n });\r\n }\r\n\r\n// Functions to create xhrs\r\n function createStandardXHR() {\r\n try {\r\n return new window.XMLHttpRequest();\r\n } catch (e) {\r\n }\r\n }\r\n\r\n function createActiveXHR() {\r\n try {\r\n return new window.ActiveXObject(\"Microsoft.XMLHTTP\");\r\n } catch (e) {\r\n }\r\n }\r\n\r\n\r\n// Install script dataType\r\n jQuery.ajaxSetup({\r\n accepts: {\r\n script: \"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript\"\r\n },\r\n contents: {\r\n script: /(?:java|ecma)script/\r\n },\r\n converters: {\r\n \"text script\": function (text) {\r\n jQuery.globalEval(text);\r\n return text;\r\n }\r\n }\r\n });\r\n\r\n// Handle cache's special case and global\r\n jQuery.ajaxPrefilter(\"script\", function (s) {\r\n if (s.cache === undefined) {\r\n s.cache = false;\r\n }\r\n if (s.crossDomain) {\r\n s.type = \"GET\";\r\n s.global = false;\r\n }\r\n });\r\n\r\n// Bind script tag hack transport\r\n jQuery.ajaxTransport(\"script\", function (s) {\r\n\r\n // This transport only deals with cross domain requests\r\n if (s.crossDomain) {\r\n\r\n var script,\r\n head = document.head || jQuery(\"head\")[0] || document.documentElement;\r\n\r\n return {\r\n\r\n send: function (_, callback) {\r\n\r\n script = document.createElement(\"script\");\r\n\r\n script.async = true;\r\n\r\n if (s.scriptCharset) {\r\n script.charset = s.scriptCharset;\r\n }\r\n\r\n script.src = s.url;\r\n\r\n // Attach handlers for all browsers\r\n script.onload = script.onreadystatechange = function (_, isAbort) {\r\n\r\n if (isAbort || !script.readyState || /loaded|complete/.test(script.readyState)) {\r\n\r\n // Handle memory leak in IE\r\n script.onload = script.onreadystatechange = null;\r\n\r\n // Remove the script\r\n if (script.parentNode) {\r\n script.parentNode.removeChild(script);\r\n }\r\n\r\n // Dereference the script\r\n script = null;\r\n\r\n // Callback if not abort\r\n if (!isAbort) {\r\n callback(200, \"success\");\r\n }\r\n }\r\n };\r\n\r\n // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending\r\n // Use native DOM manipulation to avoid our domManip AJAX trickery\r\n head.insertBefore(script, head.firstChild);\r\n },\r\n\r\n abort: function () {\r\n if (script) {\r\n script.onload(undefined, true);\r\n }\r\n }\r\n };\r\n }\r\n });\r\n\r\n\r\n var oldCallbacks = [],\r\n rjsonp = /(=)\\?(?=&|$)|\\?\\?/;\r\n\r\n// Default jsonp settings\r\n jQuery.ajaxSetup({\r\n jsonp: \"callback\",\r\n jsonpCallback: function () {\r\n var callback = oldCallbacks.pop() || ( jQuery.expando + \"_\" + ( nonce++ ) );\r\n this[callback] = true;\r\n return callback;\r\n }\r\n });\r\n\r\n// Detect, normalize options and install callbacks for jsonp requests\r\n jQuery.ajaxPrefilter(\"json jsonp\", function (s, originalSettings, jqXHR) {\r\n\r\n var callbackName, overwritten, responseContainer,\r\n jsonProp = s.jsonp !== false && ( rjsonp.test(s.url) ?\r\n \"url\" :\r\n typeof s.data === \"string\" && !( s.contentType || \"\" ).indexOf(\"application/x-www-form-urlencoded\") && rjsonp.test(s.data) && \"data\"\r\n );\r\n\r\n // Handle iff the expected data type is \"jsonp\" or we have a parameter to set\r\n if (jsonProp || s.dataTypes[0] === \"jsonp\") {\r\n\r\n // Get callback name, remembering preexisting value associated with it\r\n callbackName = s.jsonpCallback = jQuery.isFunction(s.jsonpCallback) ?\r\n s.jsonpCallback() :\r\n s.jsonpCallback;\r\n\r\n // Insert callback into url or form data\r\n if (jsonProp) {\r\n s[jsonProp] = s[jsonProp].replace(rjsonp, \"$1\" + callbackName);\r\n } else if (s.jsonp !== false) {\r\n s.url += ( rquery.test(s.url) ? \"&\" : \"?\" ) + s.jsonp + \"=\" + callbackName;\r\n }\r\n\r\n // Use data converter to retrieve json after script execution\r\n s.converters[\"script json\"] = function () {\r\n if (!responseContainer) {\r\n jQuery.error(callbackName + \" was not called\");\r\n }\r\n return responseContainer[0];\r\n };\r\n\r\n // force json dataType\r\n s.dataTypes[0] = \"json\";\r\n\r\n // Install callback\r\n overwritten = window[callbackName];\r\n window[callbackName] = function () {\r\n responseContainer = arguments;\r\n };\r\n\r\n // Clean-up function (fires after converters)\r\n jqXHR.always(function () {\r\n // Restore preexisting value\r\n window[callbackName] = overwritten;\r\n\r\n // Save back as free\r\n if (s[callbackName]) {\r\n // make sure that re-using the options doesn't screw things around\r\n s.jsonpCallback = originalSettings.jsonpCallback;\r\n\r\n // save the callback name for future use\r\n oldCallbacks.push(callbackName);\r\n }\r\n\r\n // Call if it was a function and we have a response\r\n if (responseContainer && jQuery.isFunction(overwritten)) {\r\n overwritten(responseContainer[0]);\r\n }\r\n\r\n responseContainer = overwritten = undefined;\r\n });\r\n\r\n // Delegate to script\r\n return \"script\";\r\n }\r\n });\r\n\r\n// data: string of html\r\n// context (optional): If specified, the fragment will be created in this context, defaults to document\r\n// keepScripts (optional): If true, will include scripts passed in the html string\r\n jQuery.parseHTML = function (data, context, keepScripts) {\r\n if (!data || typeof data !== \"string\") {\r\n return null;\r\n }\r\n if (typeof context === \"boolean\") {\r\n keepScripts = context;\r\n context = false;\r\n }\r\n context = context || document;\r\n\r\n var parsed = rsingleTag.exec(data),\r\n scripts = !keepScripts && [];\r\n\r\n // Single tag\r\n if (parsed) {\r\n return [context.createElement(parsed[1])];\r\n }\r\n\r\n parsed = jQuery.buildFragment([data], context, scripts);\r\n\r\n if (scripts && scripts.length) {\r\n jQuery(scripts).remove();\r\n }\r\n\r\n return jQuery.merge([], parsed.childNodes);\r\n };\r\n\r\n return jQuery;\r\n\r\n})();\r\n\r\nvar stringifyPrimitive = function(v) {\r\n switch (typeof v) {\r\n case 'string':\r\n return v;\r\n case 'boolean':\r\n return v ? 'true' : 'false';\r\n case 'number':\r\n return isFinite(v) ? v : '';\r\n default:\r\n return '';\r\n }\r\n};\r\n\r\nvar queryStringify = function(obj, sep, eq, name) {\r\n sep = sep || '&';\r\n eq = eq || '=';\r\n if (obj === null) {\r\n obj = undefined;\r\n }\r\n if (typeof obj === 'object') {\r\n return Object.keys(obj).map(function(k) {\r\n var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;\r\n if (Array.isArray(obj[k])) {\r\n return obj[k].map(function(v) {\r\n return ks + encodeURIComponent(stringifyPrimitive(v));\r\n }).join(sep);\r\n } else {\r\n return ks + encodeURIComponent(stringifyPrimitive(obj[k]));\r\n }\r\n }).filter(Boolean).join(sep);\r\n\r\n }\r\n if (!name) return '';\r\n return encodeURIComponent(stringifyPrimitive(name)) + eq +\r\n encodeURIComponent(stringifyPrimitive(obj));\r\n};\r\n\r\nvar request = function (options, callback) {\r\n\r\n options = $.extend(true, {headers: {}, qs: {}}, options);\r\n\r\n // method\r\n options.type = options.method;\r\n delete options.method;\r\n\r\n // progress\r\n if (options.onProgress) {\r\n options.progress = options.onProgress;\r\n delete options.onProgress;\r\n }\r\n\r\n // qs\r\n if (options.qs) {\r\n var qsStr = queryStringify(options.qs);\r\n if (qsStr) {\r\n options.url += (options.url.indexOf('?') === -1 ? '?' : '&') + qsStr;\r\n }\r\n delete options.qs;\r\n }\r\n\r\n // json\r\n if (options.json) {\r\n options.data = options.body;\r\n delete options.json;\r\n delete options.body;\r\n !options.headers && (options.headers = {});\r\n options.headers['Content-Type'] = 'application/json';\r\n }\r\n\r\n // body\r\n if (options.body) {\r\n if (!(options.body instanceof Blob || options.body.toString() === '[object File]' || options.body.toString() === '[object Blob]')) {\r\n options.data = options.body;\r\n delete options.body;\r\n }\r\n }\r\n\r\n // headers\r\n if (options.headers) {\r\n var headers = options.headers;\r\n delete options.headers;\r\n options.beforeSend = function (xhr) {\r\n for (var key in headers) {\r\n if (headers.hasOwnProperty(key) &&\r\n key.toLowerCase() !== 'content-length' &&\r\n key.toLowerCase() !== 'user-agent' &&\r\n key.toLowerCase() !== 'origin' &&\r\n key.toLowerCase() !== 'host') {\r\n xhr.setRequestHeader(key, headers[key]);\r\n }\r\n }\r\n };\r\n }\r\n\r\n var getResponse = function (xhr) {\r\n var headers = {};\r\n xhr.getAllResponseHeaders().trim().split('\\n').forEach(function (item) {\r\n if (item) {\r\n var index = item.indexOf(':');\r\n var key = item.substr(0, index).trim().toLowerCase();\r\n var val = item.substr(index + 1).trim();\r\n headers[key] = val;\r\n }\r\n });\r\n return {\r\n statusCode: xhr.status,\r\n statusMessage: xhr.statusText,\r\n headers: headers\r\n };\r\n };\r\n\r\n // callback\r\n options.success = function (data, state, xhr) {\r\n callback(null, getResponse(xhr), data);\r\n };\r\n options.error = function (xhr) {\r\n if (xhr.responseText) {\r\n callback(null, getResponse(xhr), xhr.responseText);\r\n } else {\r\n callback(xhr.statusText, getResponse(xhr), xhr.responseText);\r\n }\r\n };\r\n\r\n options.dataType = 'text';\r\n\r\n // send\r\n return $.ajax(options);\r\n\r\n};\r\n\r\nmodule.exports = request;\r\n","var session = require('./session');\r\nvar Async = require('./async');\r\nvar EventProxy = require('./event').EventProxy;\r\nvar util = require('./util');\r\n\r\n// 文件分块上传全过程,暴露的分块上传接口\r\nfunction sliceUploadFile(params, callback) {\r\n var self = this;\r\n var ep = new EventProxy();\r\n var TaskId = params.TaskId;\r\n var Bucket = params.Bucket;\r\n var Region = params.Region;\r\n var Key = params.Key;\r\n var Body = params.Body;\r\n var ChunkSize = params.ChunkSize || params.SliceSize || self.options.ChunkSize;\r\n var AsyncLimit = params.AsyncLimit;\r\n var StorageClass = params.StorageClass || 'Standard';\r\n var ServerSideEncryption = params.ServerSideEncryption;\r\n var FileSize;\r\n\r\n var onProgress;\r\n var onHashProgress = params.onHashProgress;\r\n\r\n // 上传过程中出现错误,返回错误\r\n ep.on('error', function (err) {\r\n if (!self._isRunningTask(TaskId)) return;\r\n return callback(err);\r\n });\r\n\r\n // 上传分块完成,开始 uploadSliceComplete 操作\r\n ep.on('upload_complete', function (UploadCompleteData) {\r\n callback(null, UploadCompleteData);\r\n });\r\n\r\n // 上传分块完成,开始 uploadSliceComplete 操作\r\n ep.on('upload_slice_complete', function (UploadData) {\r\n uploadSliceComplete.call(self, {\r\n Bucket: Bucket,\r\n Region: Region,\r\n Key: Key,\r\n UploadId: UploadData.UploadId,\r\n SliceList: UploadData.SliceList,\r\n }, function (err, data) {\r\n if (!self._isRunningTask(TaskId)) return;\r\n session.removeUsing(UploadData.UploadId);\r\n if (err) {\r\n onProgress(null, true);\r\n return ep.emit('error', err);\r\n }\r\n session.removeUploadId(UploadData.UploadId);\r\n onProgress({loaded: FileSize, total: FileSize}, true);\r\n ep.emit('upload_complete', data);\r\n });\r\n });\r\n\r\n // 获取 UploadId 完成,开始上传每个分片\r\n ep.on('get_upload_data_finish', function (UploadData) {\r\n\r\n // 处理 UploadId 缓存\r\n var uuid = session.getFileId(Body, params.ChunkSize, Bucket, Key);\r\n uuid && session.saveUploadId(uuid, UploadData.UploadId, self.options.UploadIdCacheLimit); // 缓存 UploadId\r\n session.setUsing(UploadData.UploadId); // 标记 UploadId 为正在使用\r\n\r\n // 获取 UploadId\r\n onProgress(null, true); // 任务状态开始 uploading\r\n uploadSliceList.call(self, {\r\n TaskId: TaskId,\r\n Bucket: Bucket,\r\n Region: Region,\r\n Key: Key,\r\n Body: Body,\r\n FileSize: FileSize,\r\n SliceSize: ChunkSize,\r\n AsyncLimit: AsyncLimit,\r\n ServerSideEncryption: ServerSideEncryption,\r\n UploadData: UploadData,\r\n onProgress: onProgress\r\n }, function (err, data) {\r\n if (!self._isRunningTask(TaskId)) return;\r\n if (err) {\r\n onProgress(null, true);\r\n return ep.emit('error', err);\r\n }\r\n ep.emit('upload_slice_complete', data);\r\n });\r\n });\r\n\r\n // 开始获取文件 UploadId,里面会视情况计算 ETag,并比对,保证文件一致性,也优化上传\r\n ep.on('get_file_size_finish', function () {\r\n\r\n onProgress = util.throttleOnProgress.call(self, FileSize, params.onProgress);\r\n\r\n if (params.UploadData.UploadId) {\r\n ep.emit('get_upload_data_finish', params.UploadData);\r\n } else {\r\n var _params = util.extend({\r\n TaskId: TaskId,\r\n Bucket: Bucket,\r\n Region: Region,\r\n Key: Key,\r\n Headers: params.Headers,\r\n StorageClass: StorageClass,\r\n Body: Body,\r\n FileSize: FileSize,\r\n SliceSize: ChunkSize,\r\n onHashProgress: onHashProgress,\r\n }, params);\r\n getUploadIdAndPartList.call(self, _params, function (err, UploadData) {\r\n if (!self._isRunningTask(TaskId)) return;\r\n if (err) return ep.emit('error', err);\r\n params.UploadData.UploadId = UploadData.UploadId;\r\n params.UploadData.PartList = UploadData.PartList;\r\n ep.emit('get_upload_data_finish', params.UploadData);\r\n });\r\n }\r\n });\r\n\r\n // 获取上传文件大小\r\n FileSize = params.ContentLength;\r\n delete params.ContentLength;\r\n !params.Headers && (params.Headers = {});\r\n util.each(params.Headers, function (item, key) {\r\n if (key.toLowerCase() === 'content-length') {\r\n delete params.Headers[key];\r\n }\r\n });\r\n\r\n // 控制分片大小\r\n (function () {\r\n var SIZE = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 1024 * 2, 1024 * 4, 1024 * 5];\r\n var AutoChunkSize = 1024 * 1024;\r\n for (var i = 0; i < SIZE.length; i++) {\r\n AutoChunkSize = SIZE[i] * 1024 * 1024;\r\n if (FileSize / AutoChunkSize <= self.options.MaxPartNumber) break;\r\n }\r\n params.ChunkSize = params.SliceSize = ChunkSize = Math.max(ChunkSize, AutoChunkSize);\r\n })();\r\n\r\n // 开始上传\r\n if (FileSize === 0) {\r\n params.Body = '';\r\n params.ContentLength = 0;\r\n params.SkipTask = true;\r\n self.putObject(params, function (err, data) {\r\n if (err) {\r\n return callback(err);\r\n }\r\n callback(null, data);\r\n });\r\n } else {\r\n ep.emit('get_file_size_finish');\r\n }\r\n\r\n}\r\n\r\n// 获取上传任务的 UploadId\r\nfunction getUploadIdAndPartList(params, callback) {\r\n var TaskId = params.TaskId;\r\n var Bucket = params.Bucket;\r\n var Region = params.Region;\r\n var Key = params.Key;\r\n var StorageClass = params.StorageClass;\r\n var self = this;\r\n\r\n // 计算 ETag\r\n var ETagMap = {};\r\n var FileSize = params.FileSize;\r\n var SliceSize = params.SliceSize;\r\n var SliceCount = Math.ceil(FileSize / SliceSize);\r\n var FinishSliceCount = 0;\r\n var FinishSize = 0;\r\n var onHashProgress = util.throttleOnProgress.call(self, FileSize, params.onHashProgress);\r\n var getChunkETag = function (PartNumber, callback) {\r\n var start = SliceSize * (PartNumber - 1);\r\n var end = Math.min(start + SliceSize, FileSize);\r\n var ChunkSize = end - start;\r\n\r\n if (ETagMap[PartNumber]) {\r\n callback(null, {\r\n PartNumber: PartNumber,\r\n ETag: ETagMap[PartNumber],\r\n Size: ChunkSize\r\n });\r\n } else {\r\n util.fileSlice(params.Body, start, end, false, function (chunkItem) {\r\n util.getFileMd5(chunkItem, function (err, md5) {\r\n if (err) return callback(err);\r\n var ETag = '\"' + md5 + '\"';\r\n ETagMap[PartNumber] = ETag;\r\n FinishSliceCount += 1;\r\n FinishSize += ChunkSize;\r\n callback(err, {\r\n PartNumber: PartNumber,\r\n ETag: ETag,\r\n Size: ChunkSize\r\n });\r\n onHashProgress({loaded: FinishSize, total: FileSize});\r\n });\r\n });\r\n }\r\n };\r\n\r\n // 通过和文件的 md5 对比,判断 UploadId 是否可用\r\n var isAvailableUploadList = function (PartList, callback) {\r\n var PartCount = PartList.length;\r\n // 如果没有分片,通过\r\n if (PartCount === 0) {\r\n return callback(null, true);\r\n }\r\n // 检查分片数量\r\n if (PartCount > SliceCount) {\r\n return callback(null, false);\r\n }\r\n // 检查分片大小\r\n if (PartCount > 1) {\r\n var PartSliceSize = Math.max(PartList[0].Size, PartList[1].Size);\r\n if (PartSliceSize !== SliceSize) {\r\n return callback(null, false);\r\n }\r\n }\r\n // 逐个分片计算并检查 ETag 是否一致\r\n var next = function (index) {\r\n if (index < PartCount) {\r\n var Part = PartList[index];\r\n getChunkETag(Part.PartNumber, function (err, chunk) {\r\n if (chunk && chunk.ETag === Part.ETag && chunk.Size === Part.Size) {\r\n next(index + 1);\r\n } else {\r\n callback(null, false);\r\n }\r\n });\r\n } else {\r\n callback(null, true);\r\n }\r\n };\r\n next(0);\r\n };\r\n\r\n var ep = new EventProxy();\r\n ep.on('error', function (errData) {\r\n if (!self._isRunningTask(TaskId)) return;\r\n return callback(errData);\r\n });\r\n\r\n // 存在 UploadId\r\n ep.on('upload_id_available', function (UploadData) {\r\n // 转换成 map\r\n var map = {};\r\n var list = [];\r\n util.each(UploadData.PartList, function (item) {\r\n map[item.PartNumber] = item;\r\n });\r\n for (var PartNumber = 1; PartNumber <= SliceCount; PartNumber++) {\r\n var item = map[PartNumber];\r\n if (item) {\r\n item.PartNumber = PartNumber;\r\n item.Uploaded = true;\r\n } else {\r\n item = {\r\n PartNumber: PartNumber,\r\n ETag: null,\r\n Uploaded: false\r\n };\r\n }\r\n list.push(item);\r\n }\r\n UploadData.PartList = list;\r\n callback(null, UploadData);\r\n });\r\n\r\n // 不存在 UploadId, 初始化生成 UploadId\r\n ep.on('no_available_upload_id', function () {\r\n if (!self._isRunningTask(TaskId)) return;\r\n var _params = util.extend({\r\n Bucket: Bucket,\r\n Region: Region,\r\n Key: Key,\r\n Headers: util.clone(params.Headers),\r\n StorageClass: StorageClass,\r\n Body: params.Body,\r\n }, params);\r\n // 获取 File 或 Blob 的 type 属性,如果有,作为文件 Content-Type\r\n var ContentType = params.Headers['Content-Type'] || (params.Body && params.Body.type);\r\n if (ContentType) {\r\n _params.Headers['Content-Type'] = ContentType;\r\n }\r\n self.multipartInit(_params, function (err, data) {\r\n if (!self._isRunningTask(TaskId)) return;\r\n if (err) return ep.emit('error', err);\r\n var UploadId = data.UploadId;\r\n if (!UploadId) {\r\n return callback({Message: 'no upload id'});\r\n }\r\n ep.emit('upload_id_available', {UploadId: UploadId, PartList: []});\r\n });\r\n });\r\n\r\n // 如果已存在 UploadId,找一个可以用的 UploadId\r\n ep.on('has_and_check_upload_id', function (UploadIdList) {\r\n // 串行地,找一个内容一致的 UploadId\r\n UploadIdList = UploadIdList.reverse();\r\n Async.eachLimit(UploadIdList, 1, function (UploadId, asyncCallback) {\r\n if (!self._isRunningTask(TaskId)) return;\r\n // 如果正在上传,跳过\r\n if (session.using[UploadId]) {\r\n asyncCallback(); // 检查下一个 UploadId\r\n return;\r\n }\r\n // 判断 UploadId 是否可用\r\n wholeMultipartListPart.call(self, {\r\n Bucket: Bucket,\r\n Region: Region,\r\n Key: Key,\r\n UploadId: UploadId,\r\n }, function (err, PartListData) {\r\n if (!self._isRunningTask(TaskId)) return;\r\n if (err) {\r\n session.removeUsing(UploadId);\r\n return ep.emit('error', err);\r\n }\r\n var PartList = PartListData.PartList;\r\n PartList.forEach(function (item) {\r\n item.PartNumber *= 1;\r\n item.Size *= 1;\r\n item.ETag = item.ETag || '';\r\n });\r\n isAvailableUploadList(PartList, function (err, isAvailable) {\r\n if (!self._isRunningTask(TaskId)) return;\r\n if (err) return ep.emit('error', err);\r\n if (isAvailable) {\r\n asyncCallback({\r\n UploadId: UploadId,\r\n PartList: PartList\r\n }); // 马上结束\r\n } else {\r\n asyncCallback(); // 检查下一个 UploadId\r\n }\r\n });\r\n });\r\n }, function (AvailableUploadData) {\r\n if (!self._isRunningTask(TaskId)) return;\r\n onHashProgress(null, true);\r\n if (AvailableUploadData && AvailableUploadData.UploadId) {\r\n ep.emit('upload_id_available', AvailableUploadData);\r\n } else {\r\n ep.emit('no_available_upload_id');\r\n }\r\n });\r\n });\r\n\r\n // 在本地缓存找可用的 UploadId\r\n ep.on('seek_local_avail_upload_id', function (RemoteUploadIdList) {\r\n // 在本地找可用的 UploadId\r\n var uuid = session.getFileId(params.Body, params.ChunkSize, Bucket, Key);\r\n var LocalUploadIdList = session.getUploadIdList(uuid);\r\n if (!uuid || !LocalUploadIdList) {\r\n ep.emit('has_and_check_upload_id', RemoteUploadIdList);\r\n return;\r\n }\r\n var next = function (index) {\r\n // 如果本地找不到可用 UploadId,再一个个遍历校验远端\r\n if (index >= LocalUploadIdList.length) {\r\n ep.emit('has_and_check_upload_id', RemoteUploadIdList);\r\n return;\r\n }\r\n var UploadId = LocalUploadIdList[index];\r\n // 如果不在远端 UploadId 列表里,跳过并删除\r\n if (!util.isInArray(RemoteUploadIdList, UploadId)) {\r\n session.removeUploadId(UploadId);\r\n next(index + 1);\r\n return;\r\n }\r\n // 如果正在上传,跳过\r\n if (session.using[UploadId]) {\r\n next(index + 1);\r\n return;\r\n }\r\n // 判断 UploadId 是否存在线上\r\n wholeMultipartListPart.call(self, {\r\n Bucket: Bucket,\r\n Region: Region,\r\n Key: Key,\r\n UploadId: UploadId,\r\n }, function (err, PartListData) {\r\n if (!self._isRunningTask(TaskId)) return;\r\n if (err) {\r\n // 如果 UploadId 获取会出错,跳过并删除\r\n session.removeUploadId(UploadId);\r\n next(index + 1);\r\n } else {\r\n // 找到可用 UploadId\r\n ep.emit('upload_id_available', {\r\n UploadId: UploadId,\r\n PartList: PartListData.PartList,\r\n });\r\n }\r\n });\r\n };\r\n next(0);\r\n });\r\n\r\n // 获取线上 UploadId 列表\r\n ep.on('get_remote_upload_id_list', function (RemoteUploadIdList) {\r\n // 获取符合条件的 UploadId 列表,因为同一个文件可以有多个上传任务。\r\n wholeMultipartList.call(self, {\r\n Bucket: Bucket,\r\n Region: Region,\r\n Key: Key,\r\n }, function (err, data) {\r\n if (!self._isRunningTask(TaskId)) return;\r\n if (err) {\r\n return ep.emit('error', err);\r\n }\r\n // 整理远端 UploadId 列表\r\n var RemoteUploadIdList = util.filter(data.UploadList, function (item) {\r\n return item.Key === Key && (!StorageClass || item.StorageClass.toUpperCase() === StorageClass.toUpperCase());\r\n }).reverse().map(function (item) {\r\n return item.UploadId || item.UploadID;\r\n });\r\n if (RemoteUploadIdList.length) {\r\n ep.emit('seek_local_avail_upload_id', RemoteUploadIdList);\r\n } else {\r\n // 远端没有 UploadId,清理缓存的 UploadId\r\n var uuid = session.getFileId(params.Body, params.ChunkSize, Bucket, Key), LocalUploadIdList;\r\n if (uuid && (LocalUploadIdList = session.getUploadIdList(uuid))) {\r\n util.each(LocalUploadIdList, function (UploadId) {\r\n session.removeUploadId(UploadId);\r\n });\r\n }\r\n ep.emit('no_available_upload_id');\r\n }\r\n });\r\n });\r\n\r\n // 开始找可用 UploadId\r\n ep.emit('get_remote_upload_id_list');\r\n\r\n}\r\n\r\n// 获取符合条件的全部上传任务 (条件包括 Bucket, Region, Prefix)\r\nfunction wholeMultipartList(params, callback) {\r\n var self = this;\r\n var UploadList = [];\r\n var sendParams = {\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n Prefix: params.Key\r\n };\r\n var next = function () {\r\n self.multipartList(sendParams, function (err, data) {\r\n if (err) return callback(err);\r\n UploadList.push.apply(UploadList, data.Upload || []);\r\n if (data.IsTruncated === 'true') { // 列表不完整\r\n sendParams.KeyMarker = data.NextKeyMarker;\r\n sendParams.UploadIdMarker = data.NextUploadIdMarker;\r\n next();\r\n } else {\r\n callback(null, {UploadList: UploadList});\r\n }\r\n });\r\n };\r\n next();\r\n}\r\n\r\n// 获取指定上传任务的分块列表\r\nfunction wholeMultipartListPart(params, callback) {\r\n var self = this;\r\n var PartList = [];\r\n var sendParams = {\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n Key: params.Key,\r\n UploadId: params.UploadId\r\n };\r\n var next = function () {\r\n self.multipartListPart(sendParams, function (err, data) {\r\n if (err) return callback(err);\r\n PartList.push.apply(PartList, data.Part || []);\r\n if (data.IsTruncated === 'true') { // 列表不完整\r\n sendParams.PartNumberMarker = data.NextPartNumberMarker;\r\n next();\r\n } else {\r\n callback(null, {PartList: PartList});\r\n }\r\n });\r\n };\r\n next();\r\n}\r\n\r\n// 上传文件分块,包括\r\n/*\r\n UploadId (上传任务编号)\r\n AsyncLimit (并发量),\r\n SliceList (上传的分块数组),\r\n FilePath (本地文件的位置),\r\n SliceSize (文件分块大小)\r\n FileSize (文件大小)\r\n onProgress (上传成功之后的回调函数)\r\n */\r\nfunction uploadSliceList(params, cb) {\r\n var self = this;\r\n var TaskId = params.TaskId;\r\n var Bucket = params.Bucket;\r\n var Region = params.Region;\r\n var Key = params.Key;\r\n var UploadData = params.UploadData;\r\n var FileSize = params.FileSize;\r\n var SliceSize = params.SliceSize;\r\n var ChunkParallel = Math.min(params.AsyncLimit || self.options.ChunkParallelLimit || 1, 256);\r\n var Body = params.Body;\r\n var SliceCount = Math.ceil(FileSize / SliceSize);\r\n var FinishSize = 0;\r\n var ServerSideEncryption = params.ServerSideEncryption;\r\n var needUploadSlices = util.filter(UploadData.PartList, function (SliceItem) {\r\n if (SliceItem['Uploaded']) {\r\n FinishSize += SliceItem['PartNumber'] >= SliceCount ? (FileSize % SliceSize || SliceSize) : SliceSize;\r\n }\r\n return !SliceItem['Uploaded'];\r\n });\r\n var onProgress = params.onProgress;\r\n\r\n Async.eachLimit(needUploadSlices, ChunkParallel, function (SliceItem, asyncCallback) {\r\n if (!self._isRunningTask(TaskId)) return;\r\n var PartNumber = SliceItem['PartNumber'];\r\n var currentSize = Math.min(FileSize, SliceItem['PartNumber'] * SliceSize) - (SliceItem['PartNumber'] - 1) * SliceSize;\r\n var preAddSize = 0;\r\n uploadSliceItem.call(self, {\r\n TaskId: TaskId,\r\n Bucket: Bucket,\r\n Region: Region,\r\n Key: Key,\r\n SliceSize: SliceSize,\r\n FileSize: FileSize,\r\n PartNumber: PartNumber,\r\n ServerSideEncryption: ServerSideEncryption,\r\n Body: Body,\r\n UploadData: UploadData,\r\n onProgress: function (data) {\r\n FinishSize += data.loaded - preAddSize;\r\n preAddSize = data.loaded;\r\n onProgress({loaded: FinishSize, total: FileSize});\r\n },\r\n }, function (err, data) {\r\n if (!self._isRunningTask(TaskId)) return;\r\n if (util.isBrowser && !err && !data.ETag) {\r\n err = 'get ETag error, please add \"ETag\" to CORS ExposeHeader setting.';\r\n }\r\n if (err) {\r\n FinishSize -= preAddSize;\r\n } else {\r\n FinishSize += currentSize - preAddSize;\r\n SliceItem.ETag = data.ETag;\r\n }\r\n asyncCallback(err || null, data);\r\n });\r\n }, function (err) {\r\n if (!self._isRunningTask(TaskId)) return;\r\n if (err) return cb(err);\r\n cb(null, {\r\n UploadId: UploadData.UploadId,\r\n SliceList: UploadData.PartList\r\n });\r\n });\r\n}\r\n\r\n// 上传指定分片\r\nfunction uploadSliceItem(params, callback) {\r\n var self = this;\r\n var TaskId = params.TaskId;\r\n var Bucket = params.Bucket;\r\n var Region = params.Region;\r\n var Key = params.Key;\r\n var FileSize = params.FileSize;\r\n var FileBody = params.Body;\r\n var PartNumber = params.PartNumber * 1;\r\n var SliceSize = params.SliceSize;\r\n var ServerSideEncryption = params.ServerSideEncryption;\r\n var UploadData = params.UploadData;\r\n var ChunkRetryTimes = self.options.ChunkRetryTimes + 1;\r\n\r\n var start = SliceSize * (PartNumber - 1);\r\n\r\n var ContentLength = SliceSize;\r\n\r\n var end = start + SliceSize;\r\n\r\n if (end > FileSize) {\r\n end = FileSize;\r\n ContentLength = end - start;\r\n }\r\n\r\n var PartItem = UploadData.PartList[PartNumber - 1];\r\n Async.retry(ChunkRetryTimes, function (tryCallback) {\r\n if (!self._isRunningTask(TaskId)) return;\r\n util.fileSlice(FileBody, start, end, true, function (Body) {\r\n self.multipartUpload({\r\n TaskId: TaskId,\r\n Bucket: Bucket,\r\n Region: Region,\r\n Key: Key,\r\n ContentLength: ContentLength,\r\n PartNumber: PartNumber,\r\n UploadId: UploadData.UploadId,\r\n ServerSideEncryption: ServerSideEncryption,\r\n Body: Body,\r\n onProgress: params.onProgress,\r\n }, function (err, data) {\r\n if (!self._isRunningTask(TaskId)) return;\r\n if (err) {\r\n return tryCallback(err);\r\n } else {\r\n PartItem.Uploaded = true;\r\n return tryCallback(null, data);\r\n }\r\n });\r\n });\r\n }, function (err, data) {\r\n if (!self._isRunningTask(TaskId)) return;\r\n return callback(err, data);\r\n });\r\n}\r\n\r\n\r\n// 完成分块上传\r\nfunction uploadSliceComplete(params, callback) {\r\n var Bucket = params.Bucket;\r\n var Region = params.Region;\r\n var Key = params.Key;\r\n var UploadId = params.UploadId;\r\n var SliceList = params.SliceList;\r\n var self = this;\r\n var ChunkRetryTimes = this.options.ChunkRetryTimes + 1;\r\n var Parts = SliceList.map(function (item) {\r\n return {\r\n PartNumber: item.PartNumber,\r\n ETag: item.ETag\r\n };\r\n });\r\n // 完成上传的请求也做重试\r\n Async.retry(ChunkRetryTimes, function (tryCallback) {\r\n self.multipartComplete({\r\n Bucket: Bucket,\r\n Region: Region,\r\n Key: Key,\r\n UploadId: UploadId,\r\n Parts: Parts\r\n }, tryCallback);\r\n }, function (err, data) {\r\n callback(err, data);\r\n });\r\n}\r\n\r\n// 抛弃分块上传任务\r\n/*\r\n AsyncLimit (抛弃上传任务的并发量),\r\n UploadId (上传任务的编号,当 Level 为 task 时候需要)\r\n Level (抛弃分块上传任务的级别,task : 抛弃指定的上传任务,file : 抛弃指定的文件对应的上传任务,其他值 :抛弃指定Bucket 的全部上传任务)\r\n */\r\nfunction abortUploadTask(params, callback) {\r\n var Bucket = params.Bucket;\r\n var Region = params.Region;\r\n var Key = params.Key;\r\n var UploadId = params.UploadId;\r\n var Level = params.Level || 'task';\r\n var AsyncLimit = params.AsyncLimit;\r\n var self = this;\r\n\r\n var ep = new EventProxy();\r\n\r\n ep.on('error', function (errData) {\r\n return callback(errData);\r\n });\r\n\r\n // 已经获取到需要抛弃的任务列表\r\n ep.on('get_abort_array', function (AbortArray) {\r\n abortUploadTaskArray.call(self, {\r\n Bucket: Bucket,\r\n Region: Region,\r\n Key: Key,\r\n Headers: params.Headers,\r\n AsyncLimit: AsyncLimit,\r\n AbortArray: AbortArray\r\n }, function (err, data) {\r\n if (err) {\r\n return callback(err);\r\n }\r\n callback(null, data);\r\n });\r\n });\r\n\r\n if (Level === 'bucket') {\r\n // Bucket 级别的任务抛弃,抛弃该 Bucket 下的全部上传任务\r\n wholeMultipartList.call(self, {\r\n Bucket: Bucket,\r\n Region: Region\r\n }, function (err, data) {\r\n if (err) {\r\n return callback(err);\r\n }\r\n ep.emit('get_abort_array', data.UploadList || []);\r\n });\r\n } else if (Level === 'file') {\r\n // 文件级别的任务抛弃,抛弃该文件的全部上传任务\r\n if (!Key) return callback({error: 'abort_upload_task_no_key'});\r\n wholeMultipartList.call(self, {\r\n Bucket: Bucket,\r\n Region: Region,\r\n Key: Key\r\n }, function (err, data) {\r\n if (err) {\r\n return callback(err);\r\n }\r\n ep.emit('get_abort_array', data.UploadList || []);\r\n });\r\n } else if (Level === 'task') {\r\n // 单个任务级别的任务抛弃,抛弃指定 UploadId 的上传任务\r\n if (!UploadId) return callback({error: 'abort_upload_task_no_id'});\r\n if (!Key) return callback({error: 'abort_upload_task_no_key'});\r\n ep.emit('get_abort_array', [{\r\n Key: Key,\r\n UploadId: UploadId\r\n }]);\r\n } else {\r\n return callback({error: 'abort_unknown_level'});\r\n }\r\n}\r\n\r\n// 批量抛弃分块上传任务\r\nfunction abortUploadTaskArray(params, callback) {\r\n\r\n var Bucket = params.Bucket;\r\n var Region = params.Region;\r\n var Key = params.Key;\r\n var AbortArray = params.AbortArray;\r\n var AsyncLimit = params.AsyncLimit || 1;\r\n var self = this;\r\n\r\n var index = 0;\r\n var resultList = new Array(AbortArray.length);\r\n Async.eachLimit(AbortArray, AsyncLimit, function (AbortItem, callback) {\r\n var eachIndex = index;\r\n if (Key && Key !== AbortItem.Key) {\r\n resultList[eachIndex] = {error: {KeyNotMatch: true}};\r\n callback(null);\r\n return;\r\n }\r\n var UploadId = AbortItem.UploadId || AbortItem.UploadID;\r\n\r\n self.multipartAbort({\r\n Bucket: Bucket,\r\n Region: Region,\r\n Key: AbortItem.Key,\r\n Headers: params.Headers,\r\n UploadId: UploadId\r\n }, function (err, data) {\r\n var task = {\r\n Bucket: Bucket,\r\n Region: Region,\r\n Key: AbortItem.Key,\r\n UploadId: UploadId\r\n };\r\n resultList[eachIndex] = {error: err, task: task};\r\n callback(null);\r\n });\r\n index++;\r\n\r\n }, function (err) {\r\n if (err) {\r\n return callback(err);\r\n }\r\n\r\n var successList = [];\r\n var errorList = [];\r\n\r\n for (var i = 0, len = resultList.length; i < len; i++) {\r\n var item = resultList[i];\r\n if (item['task']) {\r\n if (item['error']) {\r\n errorList.push(item['task']);\r\n } else {\r\n successList.push(item['task']);\r\n }\r\n }\r\n }\r\n\r\n return callback(null, {\r\n successList: successList,\r\n errorList: errorList\r\n });\r\n });\r\n}\r\n\r\n\r\n// 批量上传文件\r\nfunction uploadFiles(params, callback) {\r\n var self = this;\r\n\r\n // 判断多大的文件使用分片上传\r\n var SliceSize = params.SliceSize === undefined ? self.options.SliceSize : params.SliceSize;\r\n\r\n // 汇总返回进度\r\n var TotalSize = 0;\r\n var TotalFinish = 0;\r\n var onTotalProgress = util.throttleOnProgress.call(self, TotalFinish, params.onProgress);\r\n\r\n // 汇总返回回调\r\n var unFinishCount = params.files.length;\r\n var _onTotalFileFinish = params.onFileFinish;\r\n var resultList = Array(unFinishCount);\r\n var onTotalFileFinish = function (err, data, options) {\r\n onTotalProgress(null, true);\r\n _onTotalFileFinish && _onTotalFileFinish(err, data, options);\r\n resultList[options.Index] = {\r\n options: options,\r\n error: err,\r\n data: data\r\n };\r\n if (--unFinishCount <= 0 && callback) {\r\n callback(null, {\r\n files: resultList,\r\n });\r\n }\r\n };\r\n\r\n // 开始处理每个文件\r\n var taskList = [];\r\n util.each(params.files, function (fileParams, index) {\r\n (function () { // 对齐 nodejs 缩进\r\n\r\n var Body = fileParams.Body;\r\n var FileSize = Body.size || Body.length || 0;\r\n var fileInfo = {Index: index, TaskId: ''};\r\n\r\n // 更新文件总大小\r\n TotalSize += FileSize;\r\n\r\n // 整理 option,用于返回给回调\r\n util.each(fileParams, function (v, k) {\r\n if (typeof v !== 'object' && typeof v !== 'function') {\r\n fileInfo[k] = v;\r\n }\r\n });\r\n\r\n // 处理单个文件 TaskReady\r\n var _onTaskReady = fileParams.onTaskReady;\r\n var onTaskReady = function (tid) {\r\n fileInfo.TaskId = tid;\r\n _onTaskReady && _onTaskReady(tid);\r\n };\r\n fileParams.onTaskReady = onTaskReady;\r\n\r\n // 处理单个文件进度\r\n var PreAddSize = 0;\r\n var _onProgress = fileParams.onProgress;\r\n var onProgress = function (info) {\r\n TotalFinish = TotalFinish - PreAddSize + info.loaded;\r\n PreAddSize = info.loaded;\r\n _onProgress && _onProgress(info);\r\n onTotalProgress({loaded: TotalFinish, total: TotalSize});\r\n };\r\n fileParams.onProgress = onProgress;\r\n\r\n // 处理单个文件完成\r\n var _onFileFinish = fileParams.onFileFinish;\r\n var onFileFinish = function (err, data) {\r\n _onFileFinish && _onFileFinish(err, data);\r\n onTotalFileFinish && onTotalFileFinish(err, data, fileInfo);\r\n };\r\n\r\n // 添加上传任务\r\n var api = FileSize >= SliceSize ? 'sliceUploadFile' : 'putObject';\r\n taskList.push({\r\n api: api,\r\n params: fileParams,\r\n callback: onFileFinish,\r\n });\r\n })();\r\n });\r\n self._addTasks(taskList);\r\n}\r\n\r\n// 分片复制文件\r\nfunction sliceCopyFile(params, callback) {\r\n var ep = new EventProxy();\r\n\r\n var self = this;\r\n var Bucket = params.Bucket;\r\n var Region = params.Region;\r\n var Key = params.Key;\r\n var CopySource = params.CopySource;\r\n var m = CopySource.match(/^([^.]+-\\d+)\\.cos(v6)?\\.([^.]+)\\.[^/]+\\/(.+)$/);\r\n if (!m) {\r\n callback({error: 'CopySource format error'});\r\n return;\r\n }\r\n\r\n var SourceBucket = m[1];\r\n var SourceRegion = m[3];\r\n var SourceKey = decodeURIComponent(m[4]);\r\n var CopySliceSize = params.CopySliceSize === undefined ? self.options.CopySliceSize : params.CopySliceSize;\r\n CopySliceSize = Math.max(0, CopySliceSize);\r\n\r\n var ChunkSize = params.CopyChunkSize || this.options.CopyChunkSize;\r\n var ChunkParallel = this.options.CopyChunkParallelLimit;\r\n\r\n var FinishSize = 0;\r\n var FileSize;\r\n var onProgress;\r\n\r\n // 分片复制完成,开始 multipartComplete 操作\r\n ep.on('copy_slice_complete', function (UploadData) {\r\n self.multipartComplete({\r\n Bucket: Bucket,\r\n Region: Region,\r\n Key: Key,\r\n UploadId: UploadData.UploadId,\r\n Parts: UploadData.PartList,\r\n },function (err, data) {\r\n if (err) {\r\n onProgress(null, true);\r\n return callback(err);\r\n }\r\n onProgress({loaded: FileSize, total: FileSize}, true);\r\n callback(null, data);\r\n });\r\n });\r\n\r\n ep.on('get_copy_data_finish',function (UploadData) {\r\n Async.eachLimit(UploadData.PartList, ChunkParallel, function (SliceItem, asyncCallback) {\r\n var PartNumber = SliceItem.PartNumber;\r\n var CopySourceRange = SliceItem.CopySourceRange;\r\n var currentSize = SliceItem.end - SliceItem.start;\r\n var preAddSize = 0;\r\n\r\n copySliceItem.call(self, {\r\n Bucket: Bucket,\r\n Region: Region,\r\n Key: Key,\r\n CopySource: CopySource,\r\n UploadId: UploadData.UploadId,\r\n PartNumber: PartNumber,\r\n CopySourceRange: CopySourceRange,\r\n onProgress: function (data) {\r\n FinishSize += data.loaded - preAddSize;\r\n preAddSize = data.loaded;\r\n onProgress({loaded: FinishSize, total: FileSize});\r\n }\r\n },function (err,data) {\r\n if (err) {\r\n return asyncCallback(err);\r\n }\r\n onProgress({loaded: FinishSize, total: FileSize});\r\n\r\n FinishSize += currentSize - preAddSize;\r\n SliceItem.ETag = data.ETag;\r\n asyncCallback(err || null, data);\r\n });\r\n }, function (err) {\r\n if (err) {\r\n onProgress(null, true);\r\n return callback(err);\r\n }\r\n\r\n ep.emit('copy_slice_complete', UploadData);\r\n });\r\n });\r\n\r\n ep.on('get_file_size_finish', function (SourceHeaders) {\r\n // 控制分片大小\r\n (function () {\r\n var SIZE = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 1024 * 2, 1024 * 4, 1024 * 5];\r\n var AutoChunkSize = 1024 * 1024;\r\n for (var i = 0; i < SIZE.length; i++) {\r\n AutoChunkSize = SIZE[i] * 1024 * 1024;\r\n if (FileSize / AutoChunkSize <= self.options.MaxPartNumber) break;\r\n }\r\n params.ChunkSize = ChunkSize = Math.max(ChunkSize, AutoChunkSize);\r\n\r\n var ChunkCount = Math.ceil(FileSize / ChunkSize);\r\n\r\n var list = [];\r\n for (var partNumber = 1; partNumber <= ChunkCount; partNumber++) {\r\n var start = (partNumber - 1) * ChunkSize;\r\n var end = partNumber * ChunkSize < FileSize ? (partNumber * ChunkSize - 1) : FileSize - 1;\r\n var item = {\r\n PartNumber: partNumber,\r\n start: start,\r\n end: end,\r\n CopySourceRange: \"bytes=\" + start + \"-\" + end,\r\n };\r\n list.push(item);\r\n }\r\n params.PartList = list;\r\n })();\r\n\r\n var TargetHeader;\r\n if (params.Headers['x-cos-metadata-directive'] === 'Replaced') {\r\n TargetHeader = params.Headers;\r\n } else {\r\n TargetHeader = SourceHeaders;\r\n }\r\n TargetHeader['x-cos-storage-class'] = params.Headers['x-cos-storage-class'] || SourceHeaders['x-cos-storage-class'];\r\n TargetHeader = util.clearKey(TargetHeader);\r\n /**\r\n * 对于归档存储的对象,如果未恢复副本,则不允许 Copy\r\n */\r\n if (SourceHeaders['x-cos-storage-class'] === 'ARCHIVE') {\r\n var restoreHeader = SourceHeaders['x-cos-restore'];\r\n if (!restoreHeader || restoreHeader === 'ongoing-request=\"true\"') {\r\n callback({ error: 'Unrestored archive object is not allowed to be copied' });\r\n return;\r\n }\r\n }\r\n /**\r\n * 去除一些无用的头部,规避 multipartInit 出错\r\n * 这些头部通常是在 putObjectCopy 时才使用\r\n */\r\n delete TargetHeader['x-cos-copy-source'];\r\n delete TargetHeader['x-cos-metadata-directive'];\r\n delete TargetHeader['x-cos-copy-source-If-Modified-Since'];\r\n delete TargetHeader['x-cos-copy-source-If-Unmodified-Since'];\r\n delete TargetHeader['x-cos-copy-source-If-Match'];\r\n delete TargetHeader['x-cos-copy-source-If-None-Match'];\r\n self.multipartInit({\r\n Bucket: Bucket,\r\n Region: Region,\r\n Key: Key,\r\n Headers: TargetHeader,\r\n },function (err,data) {\r\n if (err) {\r\n return callback(err);\r\n }\r\n params.UploadId = data.UploadId;\r\n ep.emit('get_copy_data_finish', params);\r\n });\r\n });\r\n\r\n // 获取远端复制源文件的大小\r\n self.headObject({\r\n Bucket: SourceBucket,\r\n Region: SourceRegion,\r\n Key: SourceKey,\r\n },function(err, data) {\r\n if (err) {\r\n if (err.statusCode && err.statusCode === 404) {\r\n callback({ErrorStatus: SourceKey + ' Not Exist'});\r\n } else {\r\n callback(err);\r\n }\r\n return;\r\n }\r\n\r\n FileSize = params.FileSize = data.headers['content-length'];\r\n if (FileSize === undefined || !FileSize) {\r\n callback({error: 'get Content-Length error, please add \"Content-Length\" to CORS ExposeHeader setting.'});\r\n return;\r\n }\r\n\r\n onProgress = util.throttleOnProgress.call(self, FileSize, params.onProgress);\r\n\r\n // 开始上传\r\n if (FileSize <= CopySliceSize) {\r\n if (!params.Headers['x-cos-metadata-directive']) {\r\n params.Headers['x-cos-metadata-directive'] = 'Copy';\r\n }\r\n self.putObjectCopy(params, function (err, data) {\r\n if (err) {\r\n onProgress(null, true);\r\n return callback(err);\r\n }\r\n onProgress({loaded: FileSize, total: FileSize}, true);\r\n callback(err, data);\r\n });\r\n } else {\r\n var resHeaders = data.headers;\r\n var SourceHeaders = {\r\n 'Cache-Control': resHeaders['cache-control'],\r\n 'Content-Disposition': resHeaders['content-disposition'],\r\n 'Content-Encoding': resHeaders['content-encoding'],\r\n 'Content-Type': resHeaders['content-type'],\r\n 'Expires': resHeaders['expires'],\r\n 'x-cos-storage-class': resHeaders['x-cos-storage-class'],\r\n };\r\n util.each(resHeaders, function (v, k) {\r\n var metaPrefix = 'x-cos-meta-';\r\n if (k.indexOf(metaPrefix) === 0 && k.length > metaPrefix.length) {\r\n SourceHeaders[k] = v;\r\n }\r\n });\r\n ep.emit('get_file_size_finish', SourceHeaders);\r\n }\r\n });\r\n}\r\n\r\n// 复制指定分片\r\nfunction copySliceItem(params, callback) {\r\n var TaskId = params.TaskId;\r\n var Bucket = params.Bucket;\r\n var Region = params.Region;\r\n var Key = params.Key;\r\n var CopySource = params.CopySource;\r\n var UploadId = params.UploadId;\r\n var PartNumber = params.PartNumber * 1;\r\n var CopySourceRange = params.CopySourceRange;\r\n\r\n var ChunkRetryTimes = this.options.ChunkRetryTimes + 1;\r\n var self = this;\r\n\r\n Async.retry(ChunkRetryTimes, function (tryCallback) {\r\n self.uploadPartCopy({\r\n TaskId: TaskId,\r\n Bucket: Bucket,\r\n Region: Region,\r\n Key: Key,\r\n CopySource: CopySource,\r\n UploadId: UploadId,\r\n PartNumber:PartNumber,\r\n CopySourceRange:CopySourceRange,\r\n onProgress:params.onProgress,\r\n },function (err,data) {\r\n tryCallback(err || null, data);\r\n })\r\n }, function (err, data) {\r\n return callback(err, data);\r\n });\r\n}\r\n\r\n\r\nvar API_MAP = {\r\n sliceUploadFile: sliceUploadFile,\r\n abortUploadTask: abortUploadTask,\r\n uploadFiles: uploadFiles,\r\n sliceCopyFile: sliceCopyFile,\r\n};\r\n\r\nmodule.exports.init = function (COS, task) {\r\n task.transferToTaskMethod(API_MAP, 'sliceUploadFile');\r\n util.each(API_MAP, function (fn, apiName) {\r\n COS.prototype[apiName] = util.apiWrapper(apiName, fn);\r\n });\r\n};\r\n","var eachLimit = function (arr, limit, iterator, callback) {\r\n callback = callback || function () {};\r\n if (!arr.length || limit <= 0) {\r\n return callback();\r\n }\r\n\r\n var completed = 0;\r\n var started = 0;\r\n var running = 0;\r\n\r\n (function replenish () {\r\n if (completed >= arr.length) {\r\n return callback();\r\n }\r\n\r\n while (running < limit && started < arr.length) {\r\n started += 1;\r\n running += 1;\r\n iterator(arr[started - 1], function (err) {\r\n\r\n if (err) {\r\n callback(err);\r\n callback = function () {};\r\n } else {\r\n completed += 1;\r\n running -= 1;\r\n if (completed >= arr.length) {\r\n callback();\r\n } else {\r\n replenish();\r\n }\r\n }\r\n });\r\n }\r\n })();\r\n};\r\n\r\nvar retry = function (times, iterator, callback) {\r\n var next = function (index) {\r\n iterator(function (err, data) {\r\n if (err && index < times) {\r\n next(index + 1);\r\n } else {\r\n callback(err, data);\r\n }\r\n });\r\n };\r\n if (times < 1) {\r\n callback();\r\n } else {\r\n next(1);\r\n }\r\n};\r\n\r\nvar async = {\r\n eachLimit: eachLimit,\r\n retry: retry\r\n};\r\n\r\nmodule.exports = async;","'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Add a listener for a given event.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} once Specify if the listener is a one-time listener.\n * @returns {EventEmitter}\n * @private\n */\nfunction addListener(emitter, event, fn, context, once) {\n if (typeof fn !== 'function') {\n throw new TypeError('The listener must be a function');\n }\n\n var listener = new EE(fn, context || emitter, once)\n , evt = prefix ? prefix + event : event;\n\n if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;\n else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);\n else emitter._events[evt] = [emitter._events[evt], listener];\n\n return emitter;\n}\n\n/**\n * Clear event by name.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} evt The Event name.\n * @private\n */\nfunction clearEvent(emitter, evt) {\n if (--emitter._eventsCount === 0) emitter._events = new Events();\n else delete emitter._events[evt];\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Array} The registered listeners.\n * @public\n */\nEventEmitter.prototype.listeners = function listeners(event) {\n var evt = prefix ? prefix + event : event\n , handlers = this._events[evt];\n\n if (!handlers) return [];\n if (handlers.fn) return [handlers.fn];\n\n for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {\n ee[i] = handlers[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Return the number of listeners listening to a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Number} The number of listeners.\n * @public\n */\nEventEmitter.prototype.listenerCount = function listenerCount(event) {\n var evt = prefix ? prefix + event : event\n , listeners = this._events[evt];\n\n if (!listeners) return 0;\n if (listeners.fn) return 1;\n return listeners.length;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n return addListener(this, event, fn, context, false);\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n return addListener(this, event, fn, context, true);\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {*} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n clearEvent(this, evt);\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn &&\n (!once || listeners.once) &&\n (!context || listeners.context === context)\n ) {\n clearEvent(this, evt);\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn ||\n (once && !listeners[i].once) ||\n (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else clearEvent(this, evt);\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {(String|Symbol)} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) clearEvent(this, evt);\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n","module.exports = require('./lib/axios');","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(mergeConfig(axios.defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\n// Expose isAxiosError\naxios.isAxiosError = require('./helpers/isAxiosError');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n","'use strict';\n\nvar bind = require('./helpers/bind');\n\n/*global toString:true*/\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (toString.call(val) !== '[object Object]') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.replace(/^\\s*/, '').replace(/\\s*$/, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM\n};\n","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = arguments[1] || {};\n config.url = arguments[0];\n } else {\n config = config || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n // Hook up interceptors middleware\n var chain = [dispatchRequest, undefined];\n var promise = Promise.resolve(config);\n\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n chain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n chain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData(\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData(\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData(\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn(data, headers);\n });\n\n return data;\n};\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nvar defaults = {\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data)) {\n setContentTypeIfUnset(headers, 'application/json;charset=utf-8');\n return JSON.stringify(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n /*eslint no-param-reassign:0*/\n if (typeof data === 'string') {\n try {\n data = JSON.parse(data);\n } catch (e) { /* Ignore */ }\n }\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar cookies = require('./../helpers/cookies');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n // Listen for ready state\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n };\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(createError(timeoutErrorMessage, config, 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (config.responseType) {\n try {\n request.responseType = config.responseType;\n } catch (e) {\n // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.\n // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.\n if (config.responseType !== 'json') {\n throw e;\n }\n }\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (!requestData) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code\n };\n };\n return error;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n","'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\nvar combineURLs = require('../helpers/combineURLs');\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n var valueFromConfig2Keys = ['url', 'method', 'data'];\n var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];\n var defaultToConfig2Keys = [\n 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',\n 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',\n 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',\n 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',\n 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'\n ];\n var directMergeKeys = ['validateStatus'];\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n }\n\n utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n }\n });\n\n utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);\n\n utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n utils.forEach(directMergeKeys, function merge(prop) {\n if (prop in config2) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n var axiosKeys = valueFromConfig2Keys\n .concat(mergeDeepPropertiesKeys)\n .concat(defaultToConfig2Keys)\n .concat(directMergeKeys);\n\n var otherKeys = Object\n .keys(config1)\n .concat(Object.keys(config2))\n .filter(function filterAxiosKeys(key) {\n return axiosKeys.indexOf(key) === -1;\n });\n\n utils.forEach(otherKeys, mergeDeepProperties);\n\n return config;\n};\n","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n","'use strict';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nmodule.exports = function isAxiosError(payload) {\n return (typeof payload === 'object') && (payload.isAxiosError === true);\n};\n","function isFile(v: any): boolean {\n return Object.prototype.toString.call(v) == \"[object File]\";\n}\n\nfunction isFunction(v: any): boolean {\n return typeof v === \"function\";\n}\n\nfunction isString(v: any): boolean {\n return typeof v === \"string\";\n}\n\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nfunction noop() {}\n\nfunction delay(ms: number) {\n return new Promise(resolve => {\n setTimeout(() => {\n resolve();\n }, ms);\n });\n}\n\nfunction getUnix() {\n return Math.floor(Date.now() / 1000);\n}\n\nenum CLIENT_ERROR_CODE {\n UPLOAD_FAIL = 1\n}\n\nexport enum HOST {\n MAIN = \"vod2.qcloud.com\",\n BACKUP = \"vod2.dnsv1.com\"\n}\n\nexport default {\n isFile,\n isFunction,\n isString,\n noop,\n delay,\n getUnix,\n isTest: process.env.NODE_ENV === \"test\",\n isDev: process.env.NODE_ENV === \"development\",\n CLIENT_ERROR_CODE\n};\n","import Uploader, { vodAxios } from \"./uploader\";\nimport * as pkg from \"../package.json\";\nimport util from \"./util\";\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\ninterface IVodReporter {}\n\nexport enum VodReportEvent {\n report_apply = \"report_apply\",\n report_cos_upload = \"report_cos_upload\",\n report_commit = \"report_commit\",\n report_done = \"report_done\"\n}\n\nenum ReqType {\n apply = 10001,\n cos_upload = 20001,\n commit = 10002,\n done = 40001\n}\n\ninterface ReportObj {\n err: any;\n requestStartTime: Date;\n data: any;\n}\n\nexport class VodReporter {\n uploader: Uploader;\n options: IVodReporter;\n\n // only partial data when created\n baseReportData: any = {\n version: pkg.version,\n platform: 3000,\n device: navigator.userAgent\n };\n\n reportUrl = \"https://vodreport.qcloud.com/ugcupload_new\";\n\n constructor(uploader: Uploader, options?: IVodReporter) {\n this.uploader = uploader;\n this.options = options;\n\n this.init();\n }\n\n init() {\n this.uploader.on(VodReportEvent.report_apply, this.onApply.bind(this));\n this.uploader.on(\n VodReportEvent.report_cos_upload,\n this.onCosUpload.bind(this)\n );\n this.uploader.on(VodReportEvent.report_commit, this.onCommit.bind(this));\n this.uploader.on(VodReportEvent.report_done, this.onDone.bind(this));\n }\n\n // ApplyUploadUGC\n onApply(reportObj: ReportObj) {\n try {\n const uploader = this.uploader;\n if (!uploader.videoFile) {\n return;\n }\n Object.assign(this.baseReportData, {\n appId: uploader.appId,\n fileSize: uploader.videoFile.size,\n fileName: uploader.videoFile.name,\n fileType: uploader.videoFile.type,\n vodSessionKey: uploader.vodSessionKey,\n reqKey: uploader.reqKey,\n reportId: uploader.reportId\n });\n\n const customReportData = {\n reqType: ReqType.apply,\n errCode: 0,\n vodErrCode: 0,\n errMsg: \"\",\n reqTimeCost: Number(new Date()) - Number(reportObj.requestStartTime),\n reqTime: Number(reportObj.requestStartTime)\n };\n if (reportObj.err) {\n customReportData.errCode = 1;\n customReportData.vodErrCode = reportObj.err.code;\n customReportData.errMsg = reportObj.err.message;\n }\n if (reportObj.data) {\n this.baseReportData.cosRegion = reportObj.data.storageRegionV5;\n }\n this.report(customReportData);\n } catch (e) {\n console.error(`onApply`, e);\n if (util.isTest) {\n throw e;\n }\n }\n }\n\n // upload to cos\n onCosUpload(reportObj: ReportObj) {\n try {\n const customReportData = {\n reqType: ReqType.cos_upload,\n errCode: 0,\n cosErrCode: \"\",\n errMsg: \"\",\n reqTimeCost: Number(new Date()) - Number(reportObj.requestStartTime),\n reqTime: Number(reportObj.requestStartTime)\n };\n if (reportObj.err) {\n customReportData.errCode = 1;\n customReportData.cosErrCode = reportObj.err.error\n ? reportObj.err.error.Code\n : reportObj.err;\n if (reportObj.err && reportObj.err.error === \"error\") {\n customReportData.cosErrCode = \"cors error\";\n }\n customReportData.errMsg = JSON.stringify(reportObj.err);\n }\n this.report(customReportData);\n } catch (e) {\n console.error(`onCosUpload`, e);\n if (util.isTest) {\n throw e;\n }\n }\n }\n\n // CommitUploadUGC\n onCommit(reportObj: ReportObj) {\n try {\n const customReportData = {\n reqType: ReqType.commit,\n errCode: 0,\n vodErrCode: 0,\n errMsg: \"\",\n reqTimeCost: Number(new Date()) - Number(reportObj.requestStartTime),\n reqTime: Number(reportObj.requestStartTime)\n };\n if (reportObj.err) {\n customReportData.errCode = 1;\n customReportData.vodErrCode = reportObj.err.code;\n customReportData.errMsg = reportObj.err.message;\n }\n if (reportObj.data) {\n this.baseReportData.fileId = reportObj.data.fileId;\n }\n this.report(customReportData);\n } catch (e) {\n console.error(`onCommit`, e);\n if (util.isTest) {\n throw e;\n }\n }\n }\n\n onDone(reportObj: ReportObj) {\n try {\n const customReportData = {\n reqType: ReqType.done,\n errCode: reportObj.err && reportObj.err.code,\n reqTimeCost: Number(new Date()) - Number(reportObj.requestStartTime),\n reqTime: Number(reportObj.requestStartTime)\n };\n this.report(customReportData);\n } catch (e) {\n console.error(`onDone`, e);\n if (util.isTest) {\n throw e;\n }\n }\n }\n\n report(reportData: any) {\n reportData = { ...this.baseReportData, ...reportData };\n this.send(reportData);\n }\n\n send(reportData: any) {\n if (util.isDev || util.isTest) {\n console.log(`send reportData`, reportData);\n return;\n }\n vodAxios.post(this.reportUrl, reportData);\n }\n}\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\nfunction v4(options, buf, offset) {\n var i = buf && offset || 0;\n\n if (typeof(options) == 'string') {\n buf = options === 'binary' ? new Array(16) : null;\n options = null;\n }\n options = options || {};\n\n var rnds = options.random || (options.rng || rng)();\n\n // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n\n // Copy bytes to buffer, if provided\n if (buf) {\n for (var ii = 0; ii < 16; ++ii) {\n buf[i + ii] = rnds[ii];\n }\n }\n\n return buf || bytesToUuid(rnds);\n}\n\nmodule.exports = v4;\n","// Unique ID creation requires a high quality random # generator. In the\n// browser this is a little complicated due to unknown quality of Math.random()\n// and inconsistent support for the `crypto` API. We do the best we can via\n// feature-detection\n\n// getRandomValues needs to be invoked in a context where \"this\" is a Crypto\n// implementation. Also, find the complete implementation of crypto on IE11.\nvar getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||\n (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));\n\nif (getRandomValues) {\n // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto\n var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef\n\n module.exports = function whatwgRNG() {\n getRandomValues(rnds8);\n return rnds8;\n };\n} else {\n // Math.random()-based (RNG)\n //\n // If all else fails, use Math.random(). It's fast, but is of unspecified\n // quality.\n var rnds = new Array(16);\n\n module.exports = function mathRNG() {\n for (var i = 0, r; i < 16; i++) {\n if ((i & 0x03) === 0) r = Math.random() * 0x100000000;\n rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;\n }\n\n return rnds;\n };\n}\n","/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nvar byteToHex = [];\nfor (var i = 0; i < 256; ++i) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n\nfunction bytesToUuid(buf, offset) {\n var i = offset || 0;\n var bth = byteToHex;\n // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4\n return ([\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]]\n ]).join('');\n}\n\nmodule.exports = bytesToUuid;\n"],"sourceRoot":""}