!function(){!function(e){"use strict";var t={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};if(t.arrayBuffer)var r=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],n=function(e){return e&&DataView.prototype.isPrototypeOf(e)},o=ArrayBuffer.isView||function(e){return e&&r.indexOf(Object.prototype.toString.call(e))>-1};function a(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function i(e){return"string"!=typeof e&&(e=String(e)),e}function s(e){var r={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return t.iterable&&(r[Symbol.iterator]=function(){return r}),r}function u(e){this.map={},e instanceof u?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function l(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function c(e){return new Promise(function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function f(e){var t=new FileReader,r=c(t);return t.readAsArrayBuffer(e),r}function h(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function d(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,e)if("string"==typeof e)this._bodyText=e;else if(t.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(t.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else if(t.arrayBuffer&&t.blob&&n(e))this._bodyArrayBuffer=h(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!t.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(e)&&!o(e))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=h(e)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},t.blob&&(this.blob=function(){var e=l(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?l(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(f)}),this.text=function(){var e,t,r,n=l(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,r=c(t),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},t.formData&&(this.formData=function(){return this.text().then(m)}),this.json=function(){return this.text().then(JSON.parse)},this}u.prototype.append=function(e,t){e=a(e),t=i(t);var r=this.map[e];this.map[e]=r?r+","+t:t},u.prototype.delete=function(e){delete this.map[a(e)]},u.prototype.get=function(e){return e=a(e),this.has(e)?this.map[e]:null},u.prototype.has=function(e){return this.map.hasOwnProperty(a(e))},u.prototype.set=function(e,t){this.map[a(e)]=i(t)},u.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},u.prototype.keys=function(){var e=[];return this.forEach(function(t,r){e.push(r)}),s(e)},u.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),s(e)},u.prototype.entries=function(){var e=[];return this.forEach(function(t,r){e.push([r,t])}),s(e)},t.iterable&&(u.prototype[Symbol.iterator]=u.prototype.entries);var p=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function y(e,t){var r,n,o=(t=t||{}).body;if(e instanceof y){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new u(e.headers)),this.method=e.method,this.mode=e.mode,o||null==e._bodyInit||(o=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new u(t.headers)),this.method=(r=t.method||this.method||"GET",n=r.toUpperCase(),p.indexOf(n)>-1?n:r),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(o)}function m(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(o))}}),t}function b(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new u(t.headers),this.url=t.url||"",this._initBody(e)}y.prototype.clone=function(){return new y(this,{body:this._bodyInit})},d.call(y.prototype),d.call(b.prototype),b.prototype.clone=function(){return new b(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new u(this.headers),url:this.url})},b.error=function(){var e=new b(null,{status:0,statusText:""});return e.type="error",e};var v=[301,302,303,307,308];b.redirect=function(e,t){if(-1===v.indexOf(t))throw new RangeError("Invalid status code");return new b(null,{status:t,headers:{location:e}})},e.Headers=u,e.Request=y,e.Response=b,e.fetch=function(e,r){return new Promise(function(n,o){var a=new y(e,r),i=new XMLHttpRequest;i.onload=function(){var e,t,r={status:i.status,statusText:i.statusText,headers:(e=i.getAllResponseHeaders()||"",t=new u,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(e){var r=e.split(":"),n=r.shift().trim();if(n){var o=r.join(":").trim();t.append(n,o)}}),t)};r.url="responseURL"in i?i.responseURL:r.headers.get("X-Request-URL");var o="response"in i?i.response:i.responseText;n(new b(o,r))},i.onerror=function(){o(new TypeError("Network request failed"))},i.ontimeout=function(){o(new TypeError("Network request failed"))},i.open(a.method,a.url,!0),"include"===a.credentials?i.withCredentials=!0:"omit"===a.credentials&&(i.withCredentials=!1),"responseType"in i&&t.blob&&(i.responseType="blob"),a.headers.forEach(function(e,t){i.setRequestHeader(t,e)}),i.send(void 0===a._bodyInit?null:a._bodyInit)})},e.fetch.polyfill=!0}("undefined"!=typeof self?self:this),function(){var e=/^(?:button|image|reset|file)$/i,t=/^(?:input|select|textarea|keygen)/i,r=/(\[[^\[\]]*\])/g;function n(e,t,n){t.match(r);var o=e[t];return o?(Array.isArray(o)||(e[t]=[o]),e[t].push(n)):e[t]=n,e}function o(e,t,r){return r=r.replace(/(\r)?\n/g,"\r\n"),r=(r=encodeURIComponent(r)).replace(/%20/g,"+"),e+(e?"&":"")+encodeURIComponent(t)+"="+r}window.NebulaSerialize=function(r,a){"object"!=typeof a?a={hash:!!a}:void 0===a.hash&&(a.hash=!0);for(var i=a.hash?{}:"",s=a.serializer||(a.hash?n:o),u=r&&r.elements?r.elements:[],l=Object.create(null),c=0;c<u.length;++c){var f=u[c];if((a.disabled||!f.disabled)&&f.name&&t.test(f.nodeName)&&!e.test(f.type)&&(!/submit/.test(f.type)||document.activeElement===f||window.lastClickElement===f)){var h=f.name,d=f.value;if("checkbox"!==f.type&&"radio"!==f.type||f.checked||(d=void 0),a.empty){if("checkbox"===f.type&&!f.checked)continue;if("radio"===f.type&&!f.checked)continue;if("radio"===f.type&&(l[f.name]||f.checked?f.checked&&(l[f.name]=!0):l[f.name]=!1),void 0==d&&"radio"==f.type)continue}else if(!d)continue;if("select-multiple"!==f.type)i=s(i,h,d);else{d=[];for(var p=f.options,y=0;y<p.length;++y){var m=p[y],b=a.empty&&!m.value,v=m.value||b;m.selected&&v&&(i=s(i,h,m.value))}}}}if(a.empty)for(var h in l)l[h]||(i=s(i,h,""));return i}}(),function(){var e="NEBULA_BRIDGE_JS_REPLACE_STRING",t=window.webkit,r=t.messageHandlers.PSDXMLHTTPREQUESTMESSAGE.postMessage,n=t.messageHandlers.PSDXMLHTTPREQUESTMESSAGE;function o(e){return r.apply(n,[e])}var a=document.__lookupSetter__("cookie"),i=document.__lookupGetter__("cookie");function s(e,t){var r=[];if("form"==e.nodeName.toLowerCase()){for(var n=NebulaSerialize(e,{hash:!0,empty:!0}),o=[].slice.call(e.querySelectorAll("input")),a=0;a<o.length;a++){var i=o[a],s=i.type,u=i.name;if("file"==s&&i.files&&i.files.length>0)for(var l=i.files.length,c=0;c<l;c++)"application/x-www-form-urlencoded"!=e.enctype.toLowerCase()&&"text/plain"!=e.enctype.toLowerCase()||t?L[u]&&L[u][c]?r.push({name:u,value:L[u][c]}):r.push({name:u,value:i.files[c]}):r.push({name:u,value:i.files[c].name})}for(var f in n)n.hasOwnProperty(f)&&r.push({name:f,value:n[f]})}return r}function u(e){return new Promise(function(t,r){var n=e.value;if("string"==typeof n)t(e);else if(n instanceof Blob||n instanceof File){var o=new FileReader;o.onload=function(n){var o=n.target.result;o.length>0?(e.value=o,t(e)):r(new Error(""))},o.onerror=function(){r(new Error(""))},o.onabort=function(){r(new Error(""))},o.readAsDataURL(n)}else t(e)})}function l(e){for(var t="",r=new Uint8Array(e),n=r.byteLength,o=0;o<n;o++)t+=String.fromCharCode(r[o]);return window.btoa(t)}a&&i&&Object.defineProperty(document,"cookie",{set:function(r){if("string"==typeof r){var n={};n[b]="cookie",n.cookie=r,n.url=document.location.href,n.msgKt=e,t&&t.messageHandlers&&t.messageHandlers.PSDXMLHTTPREQUESTMESSAGE&&t.messageHandlers.PSDXMLHTTPREQUESTMESSAGE.postMessage&&o(n),a.apply(document,[r])}},get:function(){return i.apply(document,[])},configurable:!1});function c(t){if(t instanceof Error){var r={};r[b]="error",r.errorInfo=t.message,r.msgKt=e,o(r)}}function f(e){var t=e;if(t&&t.nodeName&&"string"==typeof t.nodeName&&"form"==t.nodeName.toLowerCase()){var r=t.method;if("string"!=typeof r&&(r=t.getAttribute("method")),r&&"get"===r.toLowerCase())return!0}return!1}function h(e){var t=e;if(!f(t)){var r=+new Date+""+Math.round(1e5*Math.random()),n=t.getAttribute("action");if(n||(n=""),/X-NEBULAXMLHTTPREQUEST/.test(n))t.setAttribute("action",n.replace(/X-NEBULAXMLHTTPREQUEST=(\d+)/,"X-NEBULAXMLHTTPREQUEST="+r));else{var o=document.createElement("a");if(o.href=n,o.search&&o.search.length>0){var a=o.search;/X-NEBULAXMLHTTPREQUEST/.test(a)?(a=a.replace(/X-NEBULAXMLHTTPREQUEST=(\d+)/,"X-NEBULAXMLHTTPREQUEST="+r),t.setAttribute("action",o.protocol+"//"+o.host+o.pathname+a+o.hash)):t.setAttribute("action",o.protocol+"//"+o.host+o.pathname+o.search+"&X-NEBULAXMLHTTPREQUEST="+r+o.hash)}else t.setAttribute("action",o.protocol+"//"+o.host+o.pathname+"?X-NEBULAXMLHTTPREQUEST="+r+o.hash)}t.setAttribute("data-nebulaId",r)}}var d,p=(d=FormData,window.originFormData=d,function(e){this.realFormData=new d(e),e&&(this.targetForm=e),this.appendData=[]});p.prototype.constructor=window.originFormData,p.prototype.append=function(e,t,r){this.appendData.push({name:e,value:t,fileName:r})},FormData=p;var y={},m="msgRequestUrl",b="type",v={cacheMessage:function(t,r,n,o,a){e===a&&(y[o]={msgId:o,callBack:function(){var e=t;try{return r.apply(e,n)}catch(e){c(e)}}},setTimeout(function(){v.triggerMessageCallBack(o,a)},500))},triggerMessageCallBack:function(t,r){e===r&&y[t]&&(y[t].callBack(),delete y[t])},addFormExtraInfoToElement:function(t,r){if(e===r){var n={};n[b]="FormElement",n.msgKt=r;var a=function(e){if(e&&e.nodeType){for(var t=e;t;){if("form"===t.nodeName.toLowerCase())return t;if(t===document||t===document.documentElement||t===document.body)break;t=t.parentNode}return null}}(t||document.activeElement);if(f(a))return;if(a){var i=a.getAttribute("data-nebulaId"),l=a.getAttribute("action"),h=s(a,!1);return Promise.all(h.map(function(e){return u(e)})).then(function(e){n.msgId=i,n.val=e,n[b]="FormElement",n.FormEnctype=a.enctype,n.AcceptCharset=a.acceptCharset,n.DocumentCharset=document.charset,n[m]=l,o(n)}).catch(function(e){c(e)}),i}}},updateCookies:void 0};window.NebulaXMLHttpRequestMessageBridge=v,Object.freeze(window.NebulaXMLHttpRequestMessageBridge),Object.defineProperty(window,"NebulaXMLHttpRequestMessageBridge",{configurable:!1,writable:!1});var E,w,g=function(e){return"^^^^"+e+"^^^^"},T=["POST","PUT","DELETE","PATCH"],A=/\^\^\^\^(\d+)\^\^\^\^/;XMLHttpRequest.prototype.open=(E=XMLHttpRequest.prototype.open,function(e,t,r,n,o){var a=[].slice.call(arguments),i=!0;a.length>2&&(i=!!a[2]),this.requestAsync=i;var s=+new Date+""+Math.round(1e5*Math.random());if(this.requestId=s,e&&T.indexOf(e.toUpperCase())>-1){var u=document.createElement("a");u.href=t,A.test(u.hash)?u.hash=u.hash.replace(A,g(s)):u.hash&&u.hash.length>0?u.hash=u.hash+g(s):u.hash=g(s),t=u.href}return this.requestUrl=t,a[1]=t,E.apply(this,a)}),XMLHttpRequest.prototype.send=(w=XMLHttpRequest.prototype.send,function(t){var r,n,a,i=this.requestId,f={},h=this,d=[].slice.call(arguments);if(f.msgId=i,f.msgKt=e,f.msgMainUrl=document.location.href,f[m]=this.requestUrl,!t)return w.apply(this,d);if("string"==typeof t&&t.length>0)f.val=t,f[b]="String",o(f);else if(t instanceof Blob){if(f[b]="Blob",this.requestAsync)return r=t,n=function(t){f.val=t,o(f),v.cacheMessage(h,w,d,i,e)},(a=new FileReader).onload=function(e){var t=e.target.result;n(t)},void a.readAsDataURL(r);f.error="NOTSUPPORT",o(f)}else if(t instanceof FormData){if(f[b]="FormData",this.requestAsync){f[b]="FormData";var p=t.appendData;return t.targetForm&&(p=p.concat(s(t.targetForm,!0))),void Promise.all(p.map(function(e){return u(e)})).then(function(r){f.val=r,o(f),v.cacheMessage(h,w,t.realFormData,i,e)}).catch(function(e){c(e)})}f.error="NOTSUPPORT",o(f)}else if(t.nodeType)f[b]="Document",t===document?f.val=(new XMLSerializer).serializeToString(document):f.val=t.toString(),o(f);else if(t instanceof ArrayBuffer)f.val=l(t),f[b]="ArrayBuffer",o(f);else{if(!t.buffer)return w.apply(this,d);f.val=l(t.buffer),f[b]="ArrayBuffer",o(f)}return this.requestAsync?v.cacheMessage(h,w,d,i,e):w.apply(this,d)});var B,L={};window.lastClickElement=null,document.addEventListener("DOMContentLoaded",function(){!function(){for(var t=[].slice.call(document.querySelectorAll("form")),r=t.length-1;r>=0;r--)h(t[r]),t[r].addEventListener("submit",function(t){v.addFormExtraInfoToElement(t.target,e)},!1)}(),document.addEventListener("change",function(e){var t=e.target;if(t.nodeName&&t.nodeName.toLowerCase()&&t.type&&"file"===t.type)for(var r=t,n=0;n<r.files.length;n++)!function(e){u({name:r.name,value:e}).then(function(t){L[r.name]||(L[r.name]=[]),L[r.name].push({name:r.name,value:t.value,fileName:e.name})}).catch(function(e){c(e)})}(r.files[n])},!1),document.addEventListener("click",function(e){window.lastClickElement=e.target},!0)},!1),HTMLFormElement.prototype.submit=(B=HTMLFormElement.prototype.submit,function(){var t=[].slice.call(arguments);s(this,!1),h(this),window.lastClickElement=this,v.addFormExtraInfoToElement(this,e),B.apply(this,t)})}()}();
|