@gaoding/open-sdk
Version:
- 稿定设计开放平台对接SDK。
1 lines • 112 kB
JavaScript
var GaodingOpenSdk=function(T){"use strict";var rr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function kc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Uc(e){if(e.__esModule)return e;var r=e.default;if(typeof r=="function"){var t=function n(){return this instanceof n?Reflect.construct(r,arguments,this.constructor):r.apply(this,arguments)};t.prototype=r.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}),t}var Kc=Error,Hc=EvalError,qc=RangeError,Wc=ReferenceError,Qn=SyntaxError,tr=TypeError,zc=URIError,Vc=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var r={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;r[t]=o;for(t in r)return!1;if(typeof Object.keys=="function"&&Object.keys(r).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(r).length!==0)return!1;var a=Object.getOwnPropertySymbols(r);if(a.length!==1||a[0]!==t||!Object.prototype.propertyIsEnumerable.call(r,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var i=Object.getOwnPropertyDescriptor(r,t);if(i.value!==o||i.enumerable!==!0)return!1}return!0},Jn=typeof Symbol<"u"&&Symbol,Yc=Vc,Qc=function(){return typeof Jn!="function"||typeof Symbol!="function"||typeof Jn("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Yc()},dt={__proto__:null,foo:{}},Jc=Object,Xc=function(){return{__proto__:dt}.foo===dt.foo&&!(dt instanceof Jc)},Zc="Function.prototype.bind called on incompatible ",es=Object.prototype.toString,rs=Math.max,ts="[object Function]",Xn=function(r,t){for(var n=[],o=0;o<r.length;o+=1)n[o]=r[o];for(var a=0;a<t.length;a+=1)n[a+r.length]=t[a];return n},ns=function(r,t){for(var n=[],o=t||0,a=0;o<r.length;o+=1,a+=1)n[a]=r[o];return n},os=function(e,r){for(var t="",n=0;n<e.length;n+=1)t+=e[n],n+1<e.length&&(t+=r);return t},as=function(r){var t=this;if(typeof t!="function"||es.apply(t)!==ts)throw new TypeError(Zc+t);for(var n=ns(arguments,1),o,a=function(){if(this instanceof o){var u=t.apply(this,Xn(n,arguments));return Object(u)===u?u:this}return t.apply(r,Xn(n,arguments))},i=rs(0,t.length-n.length),c=[],s=0;s<i;s++)c[s]="$"+s;if(o=Function("binder","return function ("+os(c,",")+"){ return binder.apply(this,arguments); }")(a),t.prototype){var l=function(){};l.prototype=t.prototype,o.prototype=new l,l.prototype=null}return o},is=as,yt=Function.prototype.bind||is,cs=Function.prototype.call,ss=Object.prototype.hasOwnProperty,ls=yt,us=ls.call(cs,ss),I,fs=Kc,ps=Hc,ds=qc,ys=Wc,Fe=Qn,xe=tr,vs=zc,Zn=Function,vt=function(e){try{return Zn('"use strict"; return ('+e+").constructor;")()}catch(r){}},Se=Object.getOwnPropertyDescriptor;if(Se)try{Se({},"")}catch(e){Se=null}var gt=function(){throw new xe},gs=Se?function(){try{return arguments.callee,gt}catch(e){try{return Se(arguments,"callee").get}catch(r){return gt}}}():gt,Le=Qc(),hs=Xc(),U=Object.getPrototypeOf||(hs?function(e){return e.__proto__}:null),Be={},ms=typeof Uint8Array>"u"||!U?I:U(Uint8Array),we={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?I:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?I:ArrayBuffer,"%ArrayIteratorPrototype%":Le&&U?U([][Symbol.iterator]()):I,"%AsyncFromSyncIteratorPrototype%":I,"%AsyncFunction%":Be,"%AsyncGenerator%":Be,"%AsyncGeneratorFunction%":Be,"%AsyncIteratorPrototype%":Be,"%Atomics%":typeof Atomics>"u"?I:Atomics,"%BigInt%":typeof BigInt>"u"?I:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?I:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?I:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?I:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":fs,"%eval%":eval,"%EvalError%":ps,"%Float32Array%":typeof Float32Array>"u"?I:Float32Array,"%Float64Array%":typeof Float64Array>"u"?I:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?I:FinalizationRegistry,"%Function%":Zn,"%GeneratorFunction%":Be,"%Int8Array%":typeof Int8Array>"u"?I:Int8Array,"%Int16Array%":typeof Int16Array>"u"?I:Int16Array,"%Int32Array%":typeof Int32Array>"u"?I:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Le&&U?U(U([][Symbol.iterator]())):I,"%JSON%":typeof JSON=="object"?JSON:I,"%Map%":typeof Map>"u"?I:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Le||!U?I:U(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?I:Promise,"%Proxy%":typeof Proxy>"u"?I:Proxy,"%RangeError%":ds,"%ReferenceError%":ys,"%Reflect%":typeof Reflect>"u"?I:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?I:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Le||!U?I:U(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?I:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Le&&U?U(""[Symbol.iterator]()):I,"%Symbol%":Le?Symbol:I,"%SyntaxError%":Fe,"%ThrowTypeError%":gs,"%TypedArray%":ms,"%TypeError%":xe,"%Uint8Array%":typeof Uint8Array>"u"?I:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?I:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?I:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?I:Uint32Array,"%URIError%":vs,"%WeakMap%":typeof WeakMap>"u"?I:WeakMap,"%WeakRef%":typeof WeakRef>"u"?I:WeakRef,"%WeakSet%":typeof WeakSet>"u"?I:WeakSet};if(U)try{null.error}catch(e){var Es=U(U(e));we["%Error.prototype%"]=Es}var bs=function e(r){var t;if(r==="%AsyncFunction%")t=vt("async function () {}");else if(r==="%GeneratorFunction%")t=vt("function* () {}");else if(r==="%AsyncGeneratorFunction%")t=vt("async function* () {}");else if(r==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(t=n.prototype)}else if(r==="%AsyncIteratorPrototype%"){var o=e("%AsyncGenerator%");o&&U&&(t=U(o.prototype))}return we[r]=t,t},eo={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},nr=yt,_r=us,_s=nr.call(Function.call,Array.prototype.concat),Ss=nr.call(Function.apply,Array.prototype.splice),ro=nr.call(Function.call,String.prototype.replace),Sr=nr.call(Function.call,String.prototype.slice),ws=nr.call(Function.call,RegExp.prototype.exec),Os=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,$s=/\\(\\)?/g,Ts=function(r){var t=Sr(r,0,1),n=Sr(r,-1);if(t==="%"&&n!=="%")throw new Fe("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&t!=="%")throw new Fe("invalid intrinsic syntax, expected opening `%`");var o=[];return ro(r,Os,function(a,i,c,s){o[o.length]=c?ro(s,$s,"$1"):i||a}),o},Ps=function(r,t){var n=r,o;if(_r(eo,n)&&(o=eo[n],n="%"+o[0]+"%"),_r(we,n)){var a=we[n];if(a===Be&&(a=bs(n)),typeof a>"u"&&!t)throw new xe("intrinsic "+r+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:a}}throw new Fe("intrinsic "+r+" does not exist!")},Ge=function(r,t){if(typeof r!="string"||r.length===0)throw new xe("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new xe('"allowMissing" argument must be a boolean');if(ws(/^%?[^%]*%?$/,r)===null)throw new Fe("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Ts(r),o=n.length>0?n[0]:"",a=Ps("%"+o+"%",t),i=a.name,c=a.value,s=!1,l=a.alias;l&&(o=l[0],Ss(n,_s([0,1],l)));for(var u=1,p=!0;u<n.length;u+=1){var d=n[u],E=Sr(d,0,1),h=Sr(d,-1);if((E==='"'||E==="'"||E==="`"||h==='"'||h==="'"||h==="`")&&E!==h)throw new Fe("property names with quotes must have matching quotes");if((d==="constructor"||!p)&&(s=!0),o+="."+d,i="%"+o+"%",_r(we,i))c=we[i];else if(c!=null){if(!(d in c)){if(!t)throw new xe("base intrinsic for "+r+" exists, but the property is not available.");return}if(Se&&u+1>=n.length){var b=Se(c,d);p=!!b,p&&"get"in b&&!("originalValue"in b.get)?c=b.get:c=c[d]}else p=_r(c,d),c=c[d];p&&!s&&(we[i]=c)}}return c},to={exports:{}},ht,no;function mt(){if(no)return ht;no=1;var e=Ge,r=e("%Object.defineProperty%",!0)||!1;if(r)try{r({},"a",{value:1})}catch(t){r=!1}return ht=r,ht}var As=Ge,wr=As("%Object.getOwnPropertyDescriptor%",!0);if(wr)try{wr([],"length")}catch(e){wr=null}var oo=wr,ao=mt(),Is=Qn,ke=tr,io=oo,Ms=function(r,t,n){if(!r||typeof r!="object"&&typeof r!="function")throw new ke("`obj` must be an object or a function`");if(typeof t!="string"&&typeof t!="symbol")throw new ke("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new ke("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new ke("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new ke("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new ke("`loose`, if provided, must be a boolean");var o=arguments.length>3?arguments[3]:null,a=arguments.length>4?arguments[4]:null,i=arguments.length>5?arguments[5]:null,c=arguments.length>6?arguments[6]:!1,s=!!io&&io(r,t);if(ao)ao(r,t,{configurable:i===null&&s?s.configurable:!i,enumerable:o===null&&s?s.enumerable:!o,value:n,writable:a===null&&s?s.writable:!a});else if(c||!o&&!a&&!i)r[t]=n;else throw new Is("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Et=mt(),co=function(){return!!Et};co.hasArrayLengthDefineBug=function(){if(!Et)return null;try{return Et([],"length",{value:1}).length!==1}catch(r){return!0}};var Cs=co,Rs=Ge,so=Ms,Ds=Cs(),lo=oo,uo=tr,Ns=Rs("%Math.floor%"),js=function(r,t){if(typeof r!="function")throw new uo("`fn` is not a function");if(typeof t!="number"||t<0||t>4294967295||Ns(t)!==t)throw new uo("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],o=!0,a=!0;if("length"in r&&lo){var i=lo(r,"length");i&&!i.configurable&&(o=!1),i&&!i.writable&&(a=!1)}return(o||a||!n)&&(Ds?so(r,"length",t,!0,!0):so(r,"length",t)),r};(function(e){var r=yt,t=Ge,n=js,o=tr,a=t("%Function.prototype.apply%"),i=t("%Function.prototype.call%"),c=t("%Reflect.apply%",!0)||r.call(i,a),s=mt(),l=t("%Math.max%");e.exports=function(d){if(typeof d!="function")throw new o("a function is required");var E=c(r,i,arguments);return n(E,1+l(0,d.length-(arguments.length-1)),!0)};var u=function(){return c(r,a,arguments)};s?s(e.exports,"apply",{value:u}):e.exports.apply=u})(to);var Fs=to.exports,fo=Ge,po=Fs,xs=po(fo("String.prototype.indexOf")),Ls=function(r,t){var n=fo(r,!!t);return typeof n=="function"&&xs(r,".prototype.")>-1?po(n):n};const Bs=Uc(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var bt=typeof Map=="function"&&Map.prototype,_t=Object.getOwnPropertyDescriptor&&bt?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Or=bt&&_t&&typeof _t.get=="function"?_t.get:null,yo=bt&&Map.prototype.forEach,St=typeof Set=="function"&&Set.prototype,wt=Object.getOwnPropertyDescriptor&&St?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,$r=St&&wt&&typeof wt.get=="function"?wt.get:null,vo=St&&Set.prototype.forEach,Gs=typeof WeakMap=="function"&&WeakMap.prototype,or=Gs?WeakMap.prototype.has:null,ks=typeof WeakSet=="function"&&WeakSet.prototype,ar=ks?WeakSet.prototype.has:null,Us=typeof WeakRef=="function"&&WeakRef.prototype,go=Us?WeakRef.prototype.deref:null,Ks=Boolean.prototype.valueOf,Hs=Object.prototype.toString,qs=Function.prototype.toString,Ws=String.prototype.match,Ot=String.prototype.slice,ve=String.prototype.replace,zs=String.prototype.toUpperCase,ho=String.prototype.toLowerCase,mo=RegExp.prototype.test,Eo=Array.prototype.concat,ae=Array.prototype.join,Vs=Array.prototype.slice,bo=Math.floor,$t=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Tt=Object.getOwnPropertySymbols,Pt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Ue=typeof Symbol=="function"&&typeof Symbol.iterator=="object",H=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Ue||"symbol")?Symbol.toStringTag:null,_o=Object.prototype.propertyIsEnumerable,So=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function wo(e,r){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||mo.call(/e/,r))return r;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e=="number"){var n=e<0?-bo(-e):bo(e);if(n!==e){var o=String(n),a=Ot.call(r,o.length+1);return ve.call(o,t,"$&_")+"."+ve.call(ve.call(a,/([0-9]{3})/g,"$&_"),/_$/,"")}}return ve.call(r,t,"$&_")}var At=Bs,Oo=At.custom,$o=Ao(Oo)?Oo:null,Ys=function e(r,t,n,o){var a=t||{};if(ge(a,"quoteStyle")&&a.quoteStyle!=="single"&&a.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(ge(a,"maxStringLength")&&(typeof a.maxStringLength=="number"?a.maxStringLength<0&&a.maxStringLength!==1/0:a.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var i=ge(a,"customInspect")?a.customInspect:!0;if(typeof i!="boolean"&&i!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(ge(a,"indent")&&a.indent!==null&&a.indent!==" "&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(ge(a,"numericSeparator")&&typeof a.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var c=a.numericSeparator;if(typeof r>"u")return"undefined";if(r===null)return"null";if(typeof r=="boolean")return r?"true":"false";if(typeof r=="string")return Mo(r,a);if(typeof r=="number"){if(r===0)return 1/0/r>0?"0":"-0";var s=String(r);return c?wo(r,s):s}if(typeof r=="bigint"){var l=String(r)+"n";return c?wo(r,l):l}var u=typeof a.depth>"u"?5:a.depth;if(typeof n>"u"&&(n=0),n>=u&&u>0&&typeof r=="object")return It(r)?"[Array]":"[Object]";var p=dl(a,n);if(typeof o>"u")o=[];else if(Io(o,r)>=0)return"[Circular]";function d(N,L,B){if(L&&(o=Vs.call(o),o.push(L)),B){var G={depth:a.depth};return ge(a,"quoteStyle")&&(G.quoteStyle=a.quoteStyle),e(N,G,n+1,o)}return e(N,a,n+1,o)}if(typeof r=="function"&&!Po(r)){var E=ol(r),h=Tr(r,d);return"[Function"+(E?": "+E:" (anonymous)")+"]"+(h.length>0?" { "+ae.call(h,", ")+" }":"")}if(Ao(r)){var b=Ue?ve.call(String(r),/^(Symbol\(.*\))_[^)]*$/,"$1"):Pt.call(r);return typeof r=="object"&&!Ue?ir(b):b}if(ul(r)){for(var g="<"+ho.call(String(r.nodeName)),f=r.attributes||[],v=0;v<f.length;v++)g+=" "+f[v].name+"="+To(Qs(f[v].value),"double",a);return g+=">",r.childNodes&&r.childNodes.length&&(g+="..."),g+="</"+ho.call(String(r.nodeName))+">",g}if(It(r)){if(r.length===0)return"[]";var y=Tr(r,d);return p&&!pl(y)?"["+Ct(y,p)+"]":"[ "+ae.call(y,", ")+" ]"}if(Xs(r)){var m=Tr(r,d);return!("cause"in Error.prototype)&&"cause"in r&&!_o.call(r,"cause")?"{ ["+String(r)+"] "+ae.call(Eo.call("[cause]: "+d(r.cause),m),", ")+" }":m.length===0?"["+String(r)+"]":"{ ["+String(r)+"] "+ae.call(m,", ")+" }"}if(typeof r=="object"&&i){if($o&&typeof r[$o]=="function"&&At)return At(r,{depth:u-n});if(i!=="symbol"&&typeof r.inspect=="function")return r.inspect()}if(al(r)){var _=[];return yo&&yo.call(r,function(N,L){_.push(d(L,r,!0)+" => "+d(N,r))}),Co("Map",Or.call(r),_,p)}if(sl(r)){var O=[];return vo&&vo.call(r,function(N){O.push(d(N,r))}),Co("Set",$r.call(r),O,p)}if(il(r))return Mt("WeakMap");if(ll(r))return Mt("WeakSet");if(cl(r))return Mt("WeakRef");if(el(r))return ir(d(Number(r)));if(tl(r))return ir(d($t.call(r)));if(rl(r))return ir(Ks.call(r));if(Zs(r))return ir(d(String(r)));if(typeof window<"u"&&r===window)return"{ [object Window] }";if(r===rr)return"{ [object globalThis] }";if(!Js(r)&&!Po(r)){var w=Tr(r,d),S=So?So(r)===Object.prototype:r instanceof Object||r.constructor===Object,$=r instanceof Object?"":"null prototype",A=!S&&H&&Object(r)===r&&H in r?Ot.call(he(r),8,-1):$?"Object":"",C=S||typeof r.constructor!="function"?"":r.constructor.name?r.constructor.name+" ":"",M=C+(A||$?"["+ae.call(Eo.call([],A||[],$||[]),": ")+"] ":"");return w.length===0?M+"{}":p?M+"{"+Ct(w,p)+"}":M+"{ "+ae.call(w,", ")+" }"}return String(r)};function To(e,r,t){var n=(t.quoteStyle||r)==="double"?'"':"'";return n+e+n}function Qs(e){return ve.call(String(e),/"/g,""")}function It(e){return he(e)==="[object Array]"&&(!H||!(typeof e=="object"&&H in e))}function Js(e){return he(e)==="[object Date]"&&(!H||!(typeof e=="object"&&H in e))}function Po(e){return he(e)==="[object RegExp]"&&(!H||!(typeof e=="object"&&H in e))}function Xs(e){return he(e)==="[object Error]"&&(!H||!(typeof e=="object"&&H in e))}function Zs(e){return he(e)==="[object String]"&&(!H||!(typeof e=="object"&&H in e))}function el(e){return he(e)==="[object Number]"&&(!H||!(typeof e=="object"&&H in e))}function rl(e){return he(e)==="[object Boolean]"&&(!H||!(typeof e=="object"&&H in e))}function Ao(e){if(Ue)return e&&typeof e=="object"&&e instanceof Symbol;if(typeof e=="symbol")return!0;if(!e||typeof e!="object"||!Pt)return!1;try{return Pt.call(e),!0}catch(r){}return!1}function tl(e){if(!e||typeof e!="object"||!$t)return!1;try{return $t.call(e),!0}catch(r){}return!1}var nl=Object.prototype.hasOwnProperty||function(e){return e in this};function ge(e,r){return nl.call(e,r)}function he(e){return Hs.call(e)}function ol(e){if(e.name)return e.name;var r=Ws.call(qs.call(e),/^function\s*([\w$]+)/);return r?r[1]:null}function Io(e,r){if(e.indexOf)return e.indexOf(r);for(var t=0,n=e.length;t<n;t++)if(e[t]===r)return t;return-1}function al(e){if(!Or||!e||typeof e!="object")return!1;try{Or.call(e);try{$r.call(e)}catch(r){return!0}return e instanceof Map}catch(r){}return!1}function il(e){if(!or||!e||typeof e!="object")return!1;try{or.call(e,or);try{ar.call(e,ar)}catch(r){return!0}return e instanceof WeakMap}catch(r){}return!1}function cl(e){if(!go||!e||typeof e!="object")return!1;try{return go.call(e),!0}catch(r){}return!1}function sl(e){if(!$r||!e||typeof e!="object")return!1;try{$r.call(e);try{Or.call(e)}catch(r){return!0}return e instanceof Set}catch(r){}return!1}function ll(e){if(!ar||!e||typeof e!="object")return!1;try{ar.call(e,ar);try{or.call(e,or)}catch(r){return!0}return e instanceof WeakSet}catch(r){}return!1}function ul(e){return!e||typeof e!="object"?!1:typeof HTMLElement<"u"&&e instanceof HTMLElement?!0:typeof e.nodeName=="string"&&typeof e.getAttribute=="function"}function Mo(e,r){if(e.length>r.maxStringLength){var t=e.length-r.maxStringLength,n="... "+t+" more character"+(t>1?"s":"");return Mo(Ot.call(e,0,r.maxStringLength),r)+n}var o=ve.call(ve.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,fl);return To(o,"single",r)}function fl(e){var r=e.charCodeAt(0),t={8:"b",9:"t",10:"n",12:"f",13:"r"}[r];return t?"\\"+t:"\\x"+(r<16?"0":"")+zs.call(r.toString(16))}function ir(e){return"Object("+e+")"}function Mt(e){return e+" { ? }"}function Co(e,r,t,n){var o=n?Ct(t,n):ae.call(t,", ");return e+" ("+r+") {"+o+"}"}function pl(e){for(var r=0;r<e.length;r++)if(Io(e[r],"\n")>=0)return!1;return!0}function dl(e,r){var t;if(e.indent===" ")t=" ";else if(typeof e.indent=="number"&&e.indent>0)t=ae.call(Array(e.indent+1)," ");else return null;return{base:t,prev:ae.call(Array(r+1),t)}}function Ct(e,r){if(e.length===0)return"";var t="\n"+r.prev+r.base;return t+ae.call(e,","+t)+"\n"+r.prev}function Tr(e,r){var t=It(e),n=[];if(t){n.length=e.length;for(var o=0;o<e.length;o++)n[o]=ge(e,o)?r(e[o],e):""}var a=typeof Tt=="function"?Tt(e):[],i;if(Ue){i={};for(var c=0;c<a.length;c++)i["$"+a[c]]=a[c]}for(var s in e)ge(e,s)&&(t&&String(Number(s))===s&&s<e.length||Ue&&i["$"+s]instanceof Symbol||(mo.call(/[^\w$]/,s)?n.push(r(s,e)+": "+r(e[s],e)):n.push(s+": "+r(e[s],e))));if(typeof Tt=="function")for(var l=0;l<a.length;l++)_o.call(e,a[l])&&n.push("["+r(a[l])+"]: "+r(e[a[l]],e));return n}var Ro=Ge,Ke=Ls,yl=Ys,vl=tr,Pr=Ro("%WeakMap%",!0),Ar=Ro("%Map%",!0),gl=Ke("WeakMap.prototype.get",!0),hl=Ke("WeakMap.prototype.set",!0),ml=Ke("WeakMap.prototype.has",!0),El=Ke("Map.prototype.get",!0),bl=Ke("Map.prototype.set",!0),_l=Ke("Map.prototype.has",!0),Rt=function(e,r){for(var t=e,n;(n=t.next)!==null;t=n)if(n.key===r)return t.next=n.next,n.next=e.next,e.next=n,n},Sl=function(e,r){var t=Rt(e,r);return t&&t.value},wl=function(e,r,t){var n=Rt(e,r);n?n.value=t:e.next={key:r,next:e.next,value:t}},Ol=function(e,r){return!!Rt(e,r)},$l=function(){var r,t,n,o={assert:function(a){if(!o.has(a))throw new vl("Side channel does not contain "+yl(a))},get:function(a){if(Pr&&a&&(typeof a=="object"||typeof a=="function")){if(r)return gl(r,a)}else if(Ar){if(t)return El(t,a)}else if(n)return Sl(n,a)},has:function(a){if(Pr&&a&&(typeof a=="object"||typeof a=="function")){if(r)return ml(r,a)}else if(Ar){if(t)return _l(t,a)}else if(n)return Ol(n,a);return!1},set:function(a,i){Pr&&a&&(typeof a=="object"||typeof a=="function")?(r||(r=new Pr),hl(r,a,i)):Ar?(t||(t=new Ar),bl(t,a,i)):(n||(n={key:{},next:null}),wl(n,a,i))}};return o},Tl=String.prototype.replace,Pl=/%20/g,Dt={RFC1738:"RFC1738",RFC3986:"RFC3986"},Nt={default:Dt.RFC3986,formatters:{RFC1738:function(e){return Tl.call(e,Pl,"+")},RFC3986:function(e){return String(e)}},RFC1738:Dt.RFC1738,RFC3986:Dt.RFC3986},Al=Nt,jt=Object.prototype.hasOwnProperty,Oe=Array.isArray,ie=function(){for(var e=[],r=0;r<256;++r)e.push("%"+((r<16?"0":"")+r.toString(16)).toUpperCase());return e}(),Il=function(r){for(;r.length>1;){var t=r.pop(),n=t.obj[t.prop];if(Oe(n)){for(var o=[],a=0;a<n.length;++a)typeof n[a]<"u"&&o.push(n[a]);t.obj[t.prop]=o}}},Do=function(r,t){for(var n=t&&t.plainObjects?Object.create(null):{},o=0;o<r.length;++o)typeof r[o]<"u"&&(n[o]=r[o]);return n},Ml=function e(r,t,n){if(!t)return r;if(typeof t!="object"){if(Oe(r))r.push(t);else if(r&&typeof r=="object")(n&&(n.plainObjects||n.allowPrototypes)||!jt.call(Object.prototype,t))&&(r[t]=!0);else return[r,t];return r}if(!r||typeof r!="object")return[r].concat(t);var o=r;return Oe(r)&&!Oe(t)&&(o=Do(r,n)),Oe(r)&&Oe(t)?(t.forEach(function(a,i){if(jt.call(r,i)){var c=r[i];c&&typeof c=="object"&&a&&typeof a=="object"?r[i]=e(c,a,n):r.push(a)}else r[i]=a}),r):Object.keys(t).reduce(function(a,i){var c=t[i];return jt.call(a,i)?a[i]=e(a[i],c,n):a[i]=c,a},o)},Cl=function(r,t){return Object.keys(t).reduce(function(n,o){return n[o]=t[o],n},r)},Rl=function(e,r,t){var n=e.replace(/\+/g," ");if(t==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(o){return n}},Dl=function(r,t,n,o,a){if(r.length===0)return r;var i=r;if(typeof r=="symbol"?i=Symbol.prototype.toString.call(r):typeof r!="string"&&(i=String(r)),n==="iso-8859-1")return escape(i).replace(/%u[0-9a-f]{4}/gi,function(u){return"%26%23"+parseInt(u.slice(2),16)+"%3B"});for(var c="",s=0;s<i.length;++s){var l=i.charCodeAt(s);if(l===45||l===46||l===95||l===126||l>=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||a===Al.RFC1738&&(l===40||l===41)){c+=i.charAt(s);continue}if(l<128){c=c+ie[l];continue}if(l<2048){c=c+(ie[192|l>>6]+ie[128|l&63]);continue}if(l<55296||l>=57344){c=c+(ie[224|l>>12]+ie[128|l>>6&63]+ie[128|l&63]);continue}s+=1,l=65536+((l&1023)<<10|i.charCodeAt(s)&1023),c+=ie[240|l>>18]+ie[128|l>>12&63]+ie[128|l>>6&63]+ie[128|l&63]}return c},Nl=function(r){for(var t=[{obj:{o:r},prop:"o"}],n=[],o=0;o<t.length;++o)for(var a=t[o],i=a.obj[a.prop],c=Object.keys(i),s=0;s<c.length;++s){var l=c[s],u=i[l];typeof u=="object"&&u!==null&&n.indexOf(u)===-1&&(t.push({obj:i,prop:l}),n.push(u))}return Il(t),r},jl=function(r){return Object.prototype.toString.call(r)==="[object RegExp]"},Fl=function(r){return!r||typeof r!="object"?!1:!!(r.constructor&&r.constructor.isBuffer&&r.constructor.isBuffer(r))},xl=function(r,t){return[].concat(r,t)},Ll=function(r,t){if(Oe(r)){for(var n=[],o=0;o<r.length;o+=1)n.push(t(r[o]));return n}return t(r)},No={arrayToObject:Do,assign:Cl,combine:xl,compact:Nl,decode:Rl,encode:Dl,isBuffer:Fl,isRegExp:jl,maybeMap:Ll,merge:Ml},jo=$l,Ir=No,cr=Nt,Bl=Object.prototype.hasOwnProperty,Fo={brackets:function(r){return r+"[]"},comma:"comma",indices:function(r,t){return r+"["+t+"]"},repeat:function(r){return r}},fe=Array.isArray,Gl=Array.prototype.push,xo=function(e,r){Gl.apply(e,fe(r)?r:[r])},kl=Date.prototype.toISOString,Lo=cr.default,q={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:Ir.encode,encodeValuesOnly:!1,format:Lo,formatter:cr.formatters[Lo],indices:!1,serializeDate:function(r){return kl.call(r)},skipNulls:!1,strictNullHandling:!1},Ul=function(r){return typeof r=="string"||typeof r=="number"||typeof r=="boolean"||typeof r=="symbol"||typeof r=="bigint"},Ft={},Kl=function e(r,t,n,o,a,i,c,s,l,u,p,d,E,h,b,g){for(var f=r,v=g,y=0,m=!1;(v=v.get(Ft))!==void 0&&!m;){var _=v.get(r);if(y+=1,typeof _<"u"){if(_===y)throw new RangeError("Cyclic object value");m=!0}typeof v.get(Ft)>"u"&&(y=0)}if(typeof s=="function"?f=s(t,f):f instanceof Date?f=p(f):n==="comma"&&fe(f)&&(f=Ir.maybeMap(f,function(G){return G instanceof Date?p(G):G})),f===null){if(a)return c&&!h?c(t,q.encoder,b,"key",d):t;f=""}if(Ul(f)||Ir.isBuffer(f)){if(c){var O=h?t:c(t,q.encoder,b,"key",d);return[E(O)+"="+E(c(f,q.encoder,b,"value",d))]}return[E(t)+"="+E(String(f))]}var w=[];if(typeof f>"u")return w;var S;if(n==="comma"&&fe(f))h&&c&&(f=Ir.maybeMap(f,c)),S=[{value:f.length>0?f.join(",")||null:void 0}];else if(fe(s))S=s;else{var $=Object.keys(f);S=l?$.sort(l):$}for(var A=o&&fe(f)&&f.length===1?t+"[]":t,C=0;C<S.length;++C){var M=S[C],N=typeof M=="object"&&typeof M.value<"u"?M.value:f[M];if(!(i&&N===null)){var L=fe(f)?typeof n=="function"?n(A,M):A:A+(u?"."+M:"["+M+"]");g.set(r,y);var B=jo();B.set(Ft,g),xo(w,e(N,L,n,o,a,i,n==="comma"&&h&&fe(f)?null:c,s,l,u,p,d,E,h,b,B))}}return w},Hl=function(r){if(!r)return q;if(r.encoder!==null&&typeof r.encoder<"u"&&typeof r.encoder!="function")throw new TypeError("Encoder has to be a function.");var t=r.charset||q.charset;if(typeof r.charset<"u"&&r.charset!=="utf-8"&&r.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=cr.default;if(typeof r.format<"u"){if(!Bl.call(cr.formatters,r.format))throw new TypeError("Unknown format option provided.");n=r.format}var o=cr.formatters[n],a=q.filter;return(typeof r.filter=="function"||fe(r.filter))&&(a=r.filter),{addQueryPrefix:typeof r.addQueryPrefix=="boolean"?r.addQueryPrefix:q.addQueryPrefix,allowDots:typeof r.allowDots>"u"?q.allowDots:!!r.allowDots,charset:t,charsetSentinel:typeof r.charsetSentinel=="boolean"?r.charsetSentinel:q.charsetSentinel,delimiter:typeof r.delimiter>"u"?q.delimiter:r.delimiter,encode:typeof r.encode=="boolean"?r.encode:q.encode,encoder:typeof r.encoder=="function"?r.encoder:q.encoder,encodeValuesOnly:typeof r.encodeValuesOnly=="boolean"?r.encodeValuesOnly:q.encodeValuesOnly,filter:a,format:n,formatter:o,serializeDate:typeof r.serializeDate=="function"?r.serializeDate:q.serializeDate,skipNulls:typeof r.skipNulls=="boolean"?r.skipNulls:q.skipNulls,sort:typeof r.sort=="function"?r.sort:null,strictNullHandling:typeof r.strictNullHandling=="boolean"?r.strictNullHandling:q.strictNullHandling}},ql=function(e,r){var t=e,n=Hl(r),o,a;typeof n.filter=="function"?(a=n.filter,t=a("",t)):fe(n.filter)&&(a=n.filter,o=a);var i=[];if(typeof t!="object"||t===null)return"";var c;r&&r.arrayFormat in Fo?c=r.arrayFormat:r&&"indices"in r?c=r.indices?"indices":"repeat":c="indices";var s=Fo[c];if(r&&"commaRoundTrip"in r&&typeof r.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var l=s==="comma"&&r&&r.commaRoundTrip;o||(o=Object.keys(t)),n.sort&&o.sort(n.sort);for(var u=jo(),p=0;p<o.length;++p){var d=o[p];n.skipNulls&&t[d]===null||xo(i,Kl(t[d],d,s,l,n.strictNullHandling,n.skipNulls,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,u))}var E=i.join(n.delimiter),h=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?h+="utf8=%26%2310003%3B&":h+="utf8=%E2%9C%93&"),E.length>0?h+E:""},He=No,xt=Object.prototype.hasOwnProperty,Wl=Array.isArray,K={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:He.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},zl=function(e){return e.replace(/&#(\d+);/g,function(r,t){return String.fromCharCode(parseInt(t,10))})},Bo=function(e,r){return e&&typeof e=="string"&&r.comma&&e.indexOf(",")>-1?e.split(","):e},Vl="utf8=%26%2310003%3B",Yl="utf8=%E2%9C%93",Ql=function(r,t){var n={__proto__:null},o=t.ignoreQueryPrefix?r.replace(/^\?/,""):r,a=t.parameterLimit===1/0?void 0:t.parameterLimit,i=o.split(t.delimiter,a),c=-1,s,l=t.charset;if(t.charsetSentinel)for(s=0;s<i.length;++s)i[s].indexOf("utf8=")===0&&(i[s]===Yl?l="utf-8":i[s]===Vl&&(l="iso-8859-1"),c=s,s=i.length);for(s=0;s<i.length;++s)if(s!==c){var u=i[s],p=u.indexOf("]="),d=p===-1?u.indexOf("="):p+1,E,h;d===-1?(E=t.decoder(u,K.decoder,l,"key"),h=t.strictNullHandling?null:""):(E=t.decoder(u.slice(0,d),K.decoder,l,"key"),h=He.maybeMap(Bo(u.slice(d+1),t),function(b){return t.decoder(b,K.decoder,l,"value")})),h&&t.interpretNumericEntities&&l==="iso-8859-1"&&(h=zl(h)),u.indexOf("[]=")>-1&&(h=Wl(h)?[h]:h),xt.call(n,E)?n[E]=He.combine(n[E],h):n[E]=h}return n},Jl=function(e,r,t,n){for(var o=n?r:Bo(r,t),a=e.length-1;a>=0;--a){var i,c=e[a];if(c==="[]"&&t.parseArrays)i=[].concat(o);else{i=t.plainObjects?Object.create(null):{};var s=c.charAt(0)==="["&&c.charAt(c.length-1)==="]"?c.slice(1,-1):c,l=parseInt(s,10);!t.parseArrays&&s===""?i={0:o}:!isNaN(l)&&c!==s&&String(l)===s&&l>=0&&t.parseArrays&&l<=t.arrayLimit?(i=[],i[l]=o):s!=="__proto__"&&(i[s]=o)}o=i}return o},Xl=function(r,t,n,o){if(r){var a=n.allowDots?r.replace(/\.([^.[]+)/g,"[$1]"):r,i=/(\[[^[\]]*])/,c=/(\[[^[\]]*])/g,s=n.depth>0&&i.exec(a),l=s?a.slice(0,s.index):a,u=[];if(l){if(!n.plainObjects&&xt.call(Object.prototype,l)&&!n.allowPrototypes)return;u.push(l)}for(var p=0;n.depth>0&&(s=c.exec(a))!==null&&p<n.depth;){if(p+=1,!n.plainObjects&&xt.call(Object.prototype,s[1].slice(1,-1))&&!n.allowPrototypes)return;u.push(s[1])}return s&&u.push("["+a.slice(s.index)+"]"),Jl(u,t,n,o)}},Zl=function(r){if(!r)return K;if(r.decoder!==null&&r.decoder!==void 0&&typeof r.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof r.charset<"u"&&r.charset!=="utf-8"&&r.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=typeof r.charset>"u"?K.charset:r.charset;return{allowDots:typeof r.allowDots>"u"?K.allowDots:!!r.allowDots,allowPrototypes:typeof r.allowPrototypes=="boolean"?r.allowPrototypes:K.allowPrototypes,allowSparse:typeof r.allowSparse=="boolean"?r.allowSparse:K.allowSparse,arrayLimit:typeof r.arrayLimit=="number"?r.arrayLimit:K.arrayLimit,charset:t,charsetSentinel:typeof r.charsetSentinel=="boolean"?r.charsetSentinel:K.charsetSentinel,comma:typeof r.comma=="boolean"?r.comma:K.comma,decoder:typeof r.decoder=="function"?r.decoder:K.decoder,delimiter:typeof r.delimiter=="string"||He.isRegExp(r.delimiter)?r.delimiter:K.delimiter,depth:typeof r.depth=="number"||r.depth===!1?+r.depth:K.depth,ignoreQueryPrefix:r.ignoreQueryPrefix===!0,interpretNumericEntities:typeof r.interpretNumericEntities=="boolean"?r.interpretNumericEntities:K.interpretNumericEntities,parameterLimit:typeof r.parameterLimit=="number"?r.parameterLimit:K.parameterLimit,parseArrays:r.parseArrays!==!1,plainObjects:typeof r.plainObjects=="boolean"?r.plainObjects:K.plainObjects,strictNullHandling:typeof r.strictNullHandling=="boolean"?r.strictNullHandling:K.strictNullHandling}},eu=function(e,r){var t=Zl(r);if(e===""||e===null||typeof e>"u")return t.plainObjects?Object.create(null):{};for(var n=typeof e=="string"?Ql(e,t):e,o=t.plainObjects?Object.create(null):{},a=Object.keys(n),i=0;i<a.length;++i){var c=a[i],s=Xl(c,n[c],t,typeof e=="string");o=He.merge(o,s,t)}return t.allowSparse===!0?o:He.compact(o)},ru=ql,tu=eu,nu=Nt,ou={formats:nu,parse:tu,stringify:ru};const Lt=kc(ou);var V;(function(e){e.Call="call",e.Reply="reply",e.Syn="syn",e.SynAck="synAck",e.Ack="ack"})(V||(V={}));var $e;(function(e){e.Fulfilled="fulfilled",e.Rejected="rejected"})($e||($e={}));var sr;(function(e){e.ConnectionDestroyed="ConnectionDestroyed",e.ConnectionTimeout="ConnectionTimeout",e.NoIframeSrc="NoIframeSrc"})(sr||(sr={}));var Bt;(function(e){e.DataCloneError="DataCloneError"})(Bt||(Bt={}));var te;(function(e){e.Message="message"})(te||(te={}));const Go=(e,r)=>{const t=[];let n=!1;return{destroy(o){n||(n=!0,r("".concat(e,": Destroying connection")),t.forEach(a=>{a(o)}))},onDestroy(o){n?o():t.push(o)}}},ko=e=>(...r)=>{e&&console.log("[Penpal]",...r)},au={"http:":"80","https:":"443"},iu=/^(https?:)?\/\/([^/:]+)?(:(\d+))?/,cu=["file:","data:"],su=e=>{if(e&&cu.find(c=>e.startsWith(c)))return"null";const r=document.location,t=iu.exec(e);let n,o,a;t?(n=t[1]?t[1]:r.protocol,o=t[2],a=t[4]):(n=r.protocol,o=r.hostname,a=r.port);const i=a&&a!==au[n]?":".concat(a):"";return"".concat(n,"//").concat(o).concat(i)},Uo=({name:e,message:r,stack:t})=>({name:e,message:r,stack:t}),lu=e=>{const r=new Error;return Object.keys(e).forEach(t=>r[t]=e[t]),r},Ko=(e,r,t)=>{const{localName:n,local:o,remote:a,originForSending:i,originForReceiving:c}=e;let s=!1;const l=u=>{if(u.source!==a||u.data.penpal!==V.Call)return;if(c!=="*"&&u.origin!==c){t("".concat(n," received message from origin ").concat(u.origin," which did not match expected origin ").concat(c));return}const p=u.data,{methodName:d,args:E,id:h}=p;t("".concat(n,": Received ").concat(d,"() call"));const b=g=>f=>{if(t("".concat(n,": Sending ").concat(d,"() reply")),s){t("".concat(n,": Unable to send ").concat(d,"() reply due to destroyed connection"));return}const v={penpal:V.Reply,id:h,resolution:g,returnValue:f};g===$e.Rejected&&f instanceof Error&&(v.returnValue=Uo(f),v.returnValueIsError=!0);try{a.postMessage(v,i)}catch(y){if(y.name===Bt.DataCloneError){const m={penpal:V.Reply,id:h,resolution:$e.Rejected,returnValue:Uo(y),returnValueIsError:!0};a.postMessage(m,i)}throw y}};new Promise(g=>g(r[d].apply(r,E))).then(b($e.Fulfilled),b($e.Rejected))};return o.addEventListener(te.Message,l),()=>{s=!0,o.removeEventListener(te.Message,l)}};let uu=0;const fu=()=>++uu,Ho=".",qo=e=>e?e.split(Ho):[],pu=e=>e.join(Ho),du=(e,r)=>{const t=qo(r||"");return t.push(e),pu(t)},yu=(e,r,t)=>{const n=qo(r);return n.reduce((o,a,i)=>(typeof o[a]>"u"&&(o[a]={}),i===n.length-1&&(o[a]=t),o[a]),e),e},Gt=(e,r)=>{const t={};return Object.keys(e).forEach(n=>{const o=e[n],a=du(n,r);typeof o=="object"&&Object.assign(t,Gt(o,a)),typeof o=="function"&&(t[a]=o)}),t},vu=e=>{const r={};for(const t in e)yu(r,t,e[t]);return r},Wo=(e,r,t,n,o)=>{const{localName:a,local:i,remote:c,originForSending:s,originForReceiving:l}=r;let u=!1;o("".concat(a,": Connecting call sender"));const p=E=>(...h)=>{o("".concat(a,": Sending ").concat(E,"() call"));let b;try{c.closed&&(b=!0)}catch(g){b=!0}if(b&&n(),u){const g=new Error("Unable to send ".concat(E,"() call due ")+"to destroyed connection");throw g.code=sr.ConnectionDestroyed,g}return new Promise((g,f)=>{const v=fu(),y=_=>{if(_.source!==c||_.data.penpal!==V.Reply||_.data.id!==v)return;if(l!=="*"&&_.origin!==l){o("".concat(a," received message from origin ").concat(_.origin," which did not match expected origin ").concat(l));return}const O=_.data;o("".concat(a,": Received ").concat(E,"() reply")),i.removeEventListener(te.Message,y);let w=O.returnValue;O.returnValueIsError&&(w=lu(w)),(O.resolution===$e.Fulfilled?g:f)(w)};i.addEventListener(te.Message,y);const m={penpal:V.Call,id:v,methodName:E,args:h};c.postMessage(m,s)})},d=t.reduce((E,h)=>(E[h]=p(h),E),{});return Object.assign(e,vu(d)),()=>{u=!0}},gu=(e,r,t,n,o)=>{const{destroy:a,onDestroy:i}=n;let c,s;const l={};return u=>{if(r!=="*"&&u.origin!==r){o("Parent: Handshake - Received ACK message from origin ".concat(u.origin," which did not match expected origin ").concat(r));return}o("Parent: Handshake - Received ACK");const p={localName:"Parent",local:window,remote:u.source,originForSending:t,originForReceiving:r};c&&c(),c=Ko(p,e,o),i(c),s&&s.forEach(E=>{delete l[E]}),s=u.data.methodNames;const d=Wo(l,p,s,a,o);return i(d),l}},hu=(e,r,t,n)=>o=>{if(!o.source)return;if(t!=="*"&&o.origin!==t){e("Parent: Handshake - Received SYN message from origin ".concat(o.origin," which did not match expected origin ").concat(t));return}e("Parent: Handshake - Received SYN, responding with SYN-ACK");const a={penpal:V.SynAck,methodNames:Object.keys(r)};o.source.postMessage(a,n)},mu=6e4,Eu=(e,r)=>{const{destroy:t,onDestroy:n}=r,o=setInterval(()=>{e.isConnected||(clearInterval(o),t())},mu);n(()=>{clearInterval(o)})},zo=(e,r)=>{let t;return e!==void 0&&(t=window.setTimeout(()=>{const n=new Error("Connection timed out after ".concat(e,"ms"));n.code=sr.ConnectionTimeout,r(n)},e)),()=>{clearTimeout(t)}},bu=e=>{if(!e.src&&!e.srcdoc){const r=new Error("Iframe must have src or srcdoc property defined.");throw r.code=sr.NoIframeSrc,r}},_u=e=>{let{iframe:r,methods:t={},childOrigin:n,timeout:o,debug:a=!1}=e;const i=ko(a),c=Go("Parent",i),{onDestroy:s,destroy:l}=c;n||(bu(r),n=su(r.src));const u=n==="null"?"*":n,p=Gt(t),d=hu(i,p,n,u),E=gu(p,n,u,c,i);return{promise:new Promise((b,g)=>{const f=zo(o,l),v=y=>{if(!(y.source!==r.contentWindow||!y.data)){if(y.data.penpal===V.Syn){d(y);return}if(y.data.penpal===V.Ack){const m=E(y);m&&(f(),b(m));return}}};window.addEventListener(te.Message,v),i("Parent: Awaiting handshake"),Eu(r,c),s(y=>{window.removeEventListener(te.Message,v),y&&g(y)})}),destroy(){l()}}},Su=(e,r,t,n)=>{const{destroy:o,onDestroy:a}=t;return i=>{if(!(e instanceof RegExp?e.test(i.origin):e==="*"||e===i.origin)){n("Child: Handshake - Received SYN-ACK from origin ".concat(i.origin," which did not match expected origin ").concat(e));return}n("Child: Handshake - Received SYN-ACK, responding with ACK");const s=i.origin==="null"?"*":i.origin,l={penpal:V.Ack,methodNames:Object.keys(r)};window.parent.postMessage(l,s);const u={localName:"Child",local:window,remote:window.parent,originForSending:s,originForReceiving:i.origin},p=Ko(u,r,n);a(p);const d={},E=Wo(d,u,i.data.methodNames,o,n);return a(E),d}},wu=()=>{try{clearTimeout()}catch(e){return!1}return!0},Ou=(e={})=>{const{parentOrigin:r="*",methods:t={},timeout:n,debug:o=!1}=e,a=ko(o),i=Go("Child",a),{destroy:c,onDestroy:s}=i,l=Gt(t),u=Su(r,l,i,a),p=()=>{a("Child: Handshake - Sending SYN");const E={penpal:V.Syn},h=r instanceof RegExp?"*":r;window.parent.postMessage(E,h)};return{promise:new Promise((E,h)=>{const b=zo(n,c),g=f=>{if(wu()&&!(f.source!==parent||!f.data)&&f.data.penpal===V.SynAck){const v=u(f);v&&(window.removeEventListener(te.Message,g),b(),E(v))}};window.addEventListener(te.Message,g),p(),s(f=>{window.removeEventListener(te.Message,g),f&&h(f)})}),destroy(){c()}}};var Mr=(e,r,t)=>new Promise((n,o)=>{var a=s=>{try{c(t.next(s))}catch(l){o(l)}},i=s=>{try{c(t.throw(s))}catch(l){o(l)}},c=s=>s.done?n(s.value):Promise.resolve(s.value).then(a,i);c((t=t.apply(e,r)).next())});function Vo(){const e={value:null};function r(){return Mr(this,null,function*(){e.value&&e.value.destroy()})}return{connection:e,destroy:r,getService(){return Mr(this,null,function*(){var t;if(!e.value)throw new Error("connection is not ready");return(t=e.value)==null?void 0:t.promise})}}}function $u(){const{connection:e,destroy:r,getService:t}=Vo();function n(o){return Mr(this,null,function*(){if(!o.iframe)throw new Error("iframe is required");r(),e.value=_u(o)})}return{update:n,getService:t}}function Tu(){const{connection:e,destroy:r,getService:t}=Vo();function n(o){return Mr(this,null,function*(){r(),e.value=Ou(o)})}return{update:n,getService:t}}function Pu(e){return{all:e=e||new Map,on:function(r,t){var n=e.get(r);n?n.push(t):e.set(r,[t])},off:function(r,t){var n=e.get(r);n&&(t?n.splice(n.indexOf(t)>>>0,1):e.set(r,[]))},emit:function(r,t){var n=e.get(r);n&&n.slice().map(function(o){o(t)}),(n=e.get("*"))&&n.slice().map(function(o){o(r,t)})}}}var Au=Object.defineProperty,Iu=Object.defineProperties,Mu=Object.getOwnPropertyDescriptors,Yo=Object.getOwnPropertySymbols,Cu=Object.prototype.hasOwnProperty,Ru=Object.prototype.propertyIsEnumerable,Qo=(e,r,t)=>r in e?Au(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,Du=(e,r)=>{for(var t in r||(r={}))Cu.call(r,t)&&Qo(e,t,r[t]);if(Yo)for(var t of Yo(r))Ru.call(r,t)&&Qo(e,t,r[t]);return e},Nu=(e,r)=>Iu(e,Mu(r)),ju=(e,r,t)=>new Promise((n,o)=>{var a=s=>{try{c(t.next(s))}catch(l){o(l)}},i=s=>{try{c(t.throw(s))}catch(l){o(l)}},c=s=>s.done?n(s.value):Promise.resolve(s.value).then(a,i);c((t=t.apply(e,r)).next())});const Fu=()=>{const e=Pu(),r=(t,n)=>{e.on(t,(...o)=>{e.off(t,n),n(...o)})};return Nu(Du({},e),{once:r})},Jo=e=>ju(void 0,[e],function*({type:r,data:t,handler:n,isAll:o=!1}){const{payload:a,resolve:i,reject:c,options:s}=t||{};try{const l=(yield o)?n(r,a,s):n(a,s);i&&i(l)}catch(l){c&&c(l)}});function kt(){const e=[],r=Fu(),t=(i,c,s)=>new Promise((l,u)=>{r.emit(i,{payload:c,options:s,resolve:l,reject:u})}),n=(i,c)=>{const s=e.findIndex(l=>l.source===c);s!==-1&&(r.off(i,e[s].func),e.splice(s,1))},o=(i,c)=>{let s=null;return i==="*"?s=(l,u)=>Jo({type:l,data:u,handler:c,isAll:!0}):s=l=>Jo({type:i,data:l,handler:c}),e.push({func:s,source:c}),r.on(i,s),()=>n(i,c)},a=(i,c)=>{const s=o(i,(...l)=>{s(),c(...l)});return s};return{all:r.all,emit:t,on:o,once:a,off:n}}var Xo=(e,r,t)=>new Promise((n,o)=>{var a=s=>{try{c(t.next(s))}catch(l){o(l)}},i=s=>{try{c(t.throw(s))}catch(l){o(l)}},c=s=>s.done?n(s.value):Promise.resolve(s.value).then(a,i);c((t=t.apply(e,r)).next())});function xu(e){var r,t;const n={type:"resizeWindow",height:(r=window.innerHeight)!=null?r:0};(t=e.contentWindow)==null||t.postMessage(n,"*")}function Lu(e){var r,t,n;const o={type:"resizeVisualViewport",height:(t=(r=window.visualViewport)==null?void 0:r.height)!=null?t:0};(n=e.contentWindow)==null||n.postMessage(o,"*")}function Bu(e){var r;const{container:t,css:n,className:o="gaoding-iframe"}=e||{},a=document.createElement("iframe");a.style.cssText="display: block;width: 100%;height: 100%;".concat(n),a.referrerPolicy="strict-origin-when-cross-origin",a.className=o,a.setAttribute("frameborder","0"),a.setAttribute("allowfullscreen","true"),a.setAttribute("webkitallowfullscreen","true"),a.setAttribute("mozallowfullscreen","true"),window.addEventListener("resize",()=>xu(a)),(r=window.visualViewport)==null||r.addEventListener("resize",()=>Lu(a));let i="";function c(u){return Xo(this,null,function*(){if(i===u)return!1;i=u,a.src=u,setTimeout(()=>{i=""},1e3)})}function s(){if(a.parentElement)return;const u=typeof t=="string"?document.body.querySelector(t):t;if(!u)throw new Error("无效的 container ".concat(t));u.appendChild(a)}function l(){a.parentElement&&a.parentElement.removeChild(a)}return{iframe:a,remove:l,insert:s,update:c}}function Gu(e,r){const{wrapperStyle:t,btnStyle:n,modalClass:o,modalStyle:a,maskStyle:i,btnIcon:c,scrollParent:s="documentElement",onClose:l}=r||{},u=document.createElement("div");u.style.cssText="\n position: relative;\n width: calc(100vw - 100px);\n min-width: 1280px;\n height: calc(100vh - 80px);\n min-height: 604px;\n margin: 50px auto;\n background: rgb(255, 255, 255);\n display: block;\n ".concat(t,"\n ");const p=document.createElement("div");p.style.cssText="\n font-size: 13px;\n width: 42px;\n height: 42px;\n text-align: right;\n position: absolute;\n right: -42px;\n top: 0px;\n background: no-repeat rgb(0, 0, 0);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n ".concat(n,"\n ");const d=document.createElement("img");d.src="https://st-gdx.dancf.com/gaodingx/34555636/design/20190509-142237-249d.png",d.style.cssText="display: block; width: 24px;",p.appendChild(c||d);const E=document.createElement("div");E.style.cssText="\n position: fixed;\n left: 0px;\n top: 0px;\n width: 100%;\n height: 100%;\n z-index: 1000;\n ".concat(a,"\n ");const h=o||"gaoding-editor-iframe-dialog";E.className=h,u.appendChild(p),u.appendChild(e),E.appendChild(u);const b=document.createElement("div");b.style.cssText="\n position: fixed;\n inset: 0px;\n z-index: 999;\n background-color: rgb(0, 0, 0);\n opacity: 0.5;\n ".concat(i,"\n ");let g=!1,f="";const v=S=>{E.style.display=S?"block":"none",b.style.display=S?"block":"none"},y=()=>{const S=document.documentElement.scrollTop,$=document.body;f=$.style.overflow,$&&$.style.position!=="fixed"&&($.style.position="fixed",$.style.top="-"+S+"px",$.style.width="100%",$.style.overflow="hidden")},m=()=>{const S=document.body;if(S&&S.style.position==="fixed"){const $=Math.abs(parseFloat(S.style.top));S.style.position="",S.style.overflow=f,S.style.top="",document.documentElement.scrollTop=$}};function _(){if(document.querySelector(".".concat(h))){if(s==="body"){g?y():m();return}g?(f=document.documentElement.style.overflow,document.documentElement.style.overflow="hidden"):document.documentElement.style.overflow=f}}function O(S,...$){return Xo(this,null,function*(){var A,C;if(l&&S===!0&&(yield l(...$))===!1)return!1;g=!1,_(),(A=b.parentElement)==null||A.removeChild(b),(C=E.parentElement)==null||C.removeChild(E)})}function w(){g||(g=!0,document.body.appendChild(b),document.body.appendChild(E),_())}return p.addEventListener("click",()=>O(!0)),{open:w,close:O,setVisible:v}}function Cr(e,r){if(!e)throw new Error(r)}function ku(e){return e.type==="watermark"}function Uu(e,r){const t=[],n=(o,a,i)=>{o.some((c,s)=>{if(!c)return!1;const l=e(c,a,s,i);return l===!1?!0:(t.push(l),Reflect.has(c,"elements")?n(c.elements,c,[...i,c]):ku(c)&&n([c.template],c,[...i,c]),!1)})};if(!r)throw new Error("画布内容为空");return r.forEach(o=>{o!=null&&o.elements&&n(o.elements,o,[])}),Promise.all(t)}const Te=e=>["%c[@gaoding/open-sdk] %c".concat(e),"color: #2254f4; font-weight: bold;","color: #333"],Rr=new Map;function Ku(e){if(Rr.has(e))return Rr.get(e);let r=null;const t=new Promise(n=>{r=n});return Rr.set(e,{promise:t,$resolve:r}),Rr.get(e)}function Hu(e){return e.replace(/([A-Z])/g,"_$1").toLowerCase()}const qu=e=>{const r={};return Object.keys(e).forEach(t=>{const n=e[t];["function","undefined"].includes(typeof n)||(r[Hu(t)]=Array.isArray(n)&&n.length===0?"":n)}),r},Wu=["__debug__"];function Dr(e,r){const t={};return Object.keys(e).forEach(n=>{const o=n.replace(/[-_]+([a-zA-Z0-9])/g,(a,i)=>i.toUpperCase());Array.isArray(e[n])?t[o]=e[n].map(a=>typeof a=="object"?Dr(a,r):a):typeof e[n]=="object"?t[o]=Dr(e[n],r):(r||Wu).includes(n)?t[n]=e[n]:t[o]=e[n]}),t}const zu=()=>{const e=window.location.search.replace(/^\?/,""),r=Lt.parse(e);return r&&(e.includes("true")||e.includes("false"))&&Object.entries(r).forEach(([t,n])=>{n==="true"?r[t]=!0:n==="false"&&(