index.127c6539.js 7.7 KB

1
  1. import{d as V,a as P,P as q}from"./vendor.2b2105af.js";var C={},R=s=>encodeURIComponent(s).replace(/[!'()*]/g,f=>`%${f.charCodeAt(0).toString(16).toUpperCase()}`),E="%[a-f0-9]{2}",A=new RegExp(E,"gi"),N=new RegExp("("+E+")+","gi");function p(s,f){try{return decodeURIComponent(s.join(""))}catch{}if(s.length===1)return s;f=f||1;var o=s.slice(0,f),l=s.slice(f);return Array.prototype.concat.call([],p(o),p(l))}function B(s){try{return decodeURIComponent(s)}catch{for(var f=s.match(A),o=1;o<f.length;o++)s=p(f,o).join(""),f=s.match(A);return s}}function H(s){for(var f={"%FE%FF":"\uFFFD\uFFFD","%FF%FE":"\uFFFD\uFFFD"},o=N.exec(s);o;){try{f[o[0]]=decodeURIComponent(o[0])}catch{var l=B(o[0]);l!==o[0]&&(f[o[0]]=l)}o=N.exec(s)}f["%C2"]="\uFFFD";for(var g=Object.keys(f),m=0;m<g.length;m++){var h=g[m];s=s.replace(new RegExp(h,"g"),f[h])}return s}var L=function(s){if(typeof s!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof s+"`");try{return s=s.replace(/\+/g," "),decodeURIComponent(s)}catch{return H(s)}},T=(s,f)=>{if(!(typeof s=="string"&&typeof f=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(f==="")return[s];const o=s.indexOf(f);return o===-1?[s]:[s.slice(0,o),s.slice(o+f.length)]},M=function(s,f){for(var o={},l=Object.keys(s),g=Array.isArray(f),m=0;m<l.length;m++){var h=l[m],F=s[h];(g?f.indexOf(h)!==-1:f(h,F,s))&&(o[h]=F)}return o};(function(s){const f=R,o=L,l=T,g=M,m=r=>r==null,h=Symbol("encodeFragmentIdentifier");function F(r){switch(r.arrayFormat){case"index":return e=>(n,t)=>{const a=n.length;return t===void 0||r.skipNull&&t===null||r.skipEmptyString&&t===""?n:t===null?[...n,[d(e,r),"[",a,"]"].join("")]:[...n,[d(e,r),"[",d(a,r),"]=",d(t,r)].join("")]};case"bracket":return e=>(n,t)=>t===void 0||r.skipNull&&t===null||r.skipEmptyString&&t===""?n:t===null?[...n,[d(e,r),"[]"].join("")]:[...n,[d(e,r),"[]=",d(t,r)].join("")];case"colon-list-separator":return e=>(n,t)=>t===void 0||r.skipNull&&t===null||r.skipEmptyString&&t===""?n:t===null?[...n,[d(e,r),":list="].join("")]:[...n,[d(e,r),":list=",d(t,r)].join("")];case"comma":case"separator":case"bracket-separator":{const e=r.arrayFormat==="bracket-separator"?"[]=":"=";return n=>(t,a)=>a===void 0||r.skipNull&&a===null||r.skipEmptyString&&a===""?t:(a=a===null?"":a,t.length===0?[[d(n,r),e,d(a,r)].join("")]:[[t,d(a,r)].join(r.arrayFormatSeparator)])}default:return e=>(n,t)=>t===void 0||r.skipNull&&t===null||r.skipEmptyString&&t===""?n:t===null?[...n,d(e,r)]:[...n,[d(e,r),"=",d(t,r)].join("")]}}function D(r){let e;switch(r.arrayFormat){case"index":return(n,t,a)=>{if(e=/\[(\d*)\]$/.exec(n),n=n.replace(/\[\d*\]$/,""),!e){a[n]=t;return}a[n]===void 0&&(a[n]={}),a[n][e[1]]=t};case"bracket":return(n,t,a)=>{if(e=/(\[\])$/.exec(n),n=n.replace(/\[\]$/,""),!e){a[n]=t;return}if(a[n]===void 0){a[n]=[t];return}a[n]=[].concat(a[n],t)};case"colon-list-separator":return(n,t,a)=>{if(e=/(:list)$/.exec(n),n=n.replace(/:list$/,""),!e){a[n]=t;return}if(a[n]===void 0){a[n]=[t];return}a[n]=[].concat(a[n],t)};case"comma":case"separator":return(n,t,a)=>{const c=typeof t=="string"&&t.includes(r.arrayFormatSeparator),i=typeof t=="string"&&!c&&y(t,r).includes(r.arrayFormatSeparator);t=i?y(t,r):t;const u=c||i?t.split(r.arrayFormatSeparator).map(I=>y(I,r)):t===null?t:y(t,r);a[n]=u};case"bracket-separator":return(n,t,a)=>{const c=/(\[\])$/.test(n);if(n=n.replace(/\[\]$/,""),!c){a[n]=t&&y(t,r);return}const i=t===null?[]:t.split(r.arrayFormatSeparator).map(u=>y(u,r));if(a[n]===void 0){a[n]=i;return}a[n]=[].concat(a[n],i)};default:return(n,t,a)=>{if(a[n]===void 0){a[n]=t;return}a[n]=[].concat(a[n],t)}}}function w(r){if(typeof r!="string"||r.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function d(r,e){return e.encode?e.strict?f(r):encodeURIComponent(r):r}function y(r,e){return e.decode?o(r):r}function S(r){return Array.isArray(r)?r.sort():typeof r=="object"?S(Object.keys(r)).sort((e,n)=>Number(e)-Number(n)).map(e=>r[e]):r}function b(r){const e=r.indexOf("#");return e!==-1&&(r=r.slice(0,e)),r}function x(r){let e="";const n=r.indexOf("#");return n!==-1&&(e=r.slice(n)),e}function O(r){r=b(r);const e=r.indexOf("?");return e===-1?"":r.slice(e+1)}function j(r,e){return e.parseNumbers&&!Number.isNaN(Number(r))&&typeof r=="string"&&r.trim()!==""?r=Number(r):e.parseBooleans&&r!==null&&(r.toLowerCase()==="true"||r.toLowerCase()==="false")&&(r=r.toLowerCase()==="true"),r}function $(r,e){e=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},e),w(e.arrayFormatSeparator);const n=D(e),t=Object.create(null);if(typeof r!="string"||(r=r.trim().replace(/^[?#&]/,""),!r))return t;for(const a of r.split("&")){if(a==="")continue;let[c,i]=l(e.decode?a.replace(/\+/g," "):a,"=");i=i===void 0?null:["comma","separator","bracket-separator"].includes(e.arrayFormat)?i:y(i,e),n(y(c,e),i,t)}for(const a of Object.keys(t)){const c=t[a];if(typeof c=="object"&&c!==null)for(const i of Object.keys(c))c[i]=j(c[i],e);else t[a]=j(c,e)}return e.sort===!1?t:(e.sort===!0?Object.keys(t).sort():Object.keys(t).sort(e.sort)).reduce((a,c)=>{const i=t[c];return Boolean(i)&&typeof i=="object"&&!Array.isArray(i)?a[c]=S(i):a[c]=i,a},Object.create(null))}s.extract=O,s.parse=$,s.stringify=(r,e)=>{if(!r)return"";e=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},e),w(e.arrayFormatSeparator);const n=i=>e.skipNull&&m(r[i])||e.skipEmptyString&&r[i]==="",t=F(e),a={};for(const i of Object.keys(r))n(i)||(a[i]=r[i]);const c=Object.keys(a);return e.sort!==!1&&c.sort(e.sort),c.map(i=>{const u=r[i];return u===void 0?"":u===null?d(i,e):Array.isArray(u)?u.length===0&&e.arrayFormat==="bracket-separator"?d(i,e)+"[]":u.reduce(t(i),[]).join("&"):d(i,e)+"="+d(u,e)}).filter(i=>i.length>0).join("&")},s.parseUrl=(r,e)=>{e=Object.assign({decode:!0},e);const[n,t]=l(r,"#");return Object.assign({url:n.split("?")[0]||"",query:$(O(r),e)},e&&e.parseFragmentIdentifier&&t?{fragmentIdentifier:y(t,e)}:{})},s.stringifyUrl=(r,e)=>{e=Object.assign({encode:!0,strict:!0,[h]:!0},e);const n=b(r.url).split("?")[0]||"",t=s.extract(r.url),a=s.parse(t,{sort:!1}),c=Object.assign(a,r.query);let i=s.stringify(c,e);i&&(i=`?${i}`);let u=x(r.url);return r.fragmentIdentifier&&(u=`#${e[h]?d(r.fragmentIdentifier,e):r.fragmentIdentifier}`),`${n}${i}${u}`},s.pick=(r,e,n)=>{n=Object.assign({parseFragmentIdentifier:!0,[h]:!1},n);const{url:t,query:a,fragmentIdentifier:c}=s.parseUrl(r,n);return s.stringifyUrl({url:t,query:g(a,e),fragmentIdentifier:c},n)},s.exclude=(r,e,n)=>{const t=Array.isArray(e)?a=>!e.includes(a):(a,c)=>!e(a,c);return s.pick(r,t,n)}})(C);var U=C,_=V({name:"col-popup",props:{height:{type:String,default:"100%"},destroy:{type:Boolean,default:!1},modelValue:{type:Boolean,default:!1}},data(){return{popupShow:!1,isDestroy:!1}},watch:{modelValue(s){this.hashState()}},mounted(){this.destroy&&(this.isDestroy=!1),window.addEventListener("hashchange",this.onHash,!1)},unmounted(){window.removeEventListener("hashchange",this.onHash,!1)},methods:{onHash(){this.$emit("update:modelValue",!1),this.isDestroy=!1},onPopupClose(s){this.$emit("update:modelValue",s),this.hashState()},hashState(){if(this.modelValue){this.isDestroy=!1;const s=window.location.hash.slice(1).split("?"),f=U.parse(s[1]);let o=0;for(let m in f)o++;const l=window.location.href,g=o>0?"&cPop="+ +new Date:"?cPop="+ +new Date;history.pushState("","",`${l}${g}`)}else{const s=window.location.hash.slice(1).split("?");U.parse(s[1]).cPop&&window.history.go(-1)}this.$refs.protocolPopup&&(this.$refs.protocolPopup.scrollTop=0)}},render(){return P(q,{ref:"protocolPopup",show:this.modelValue,transitionAppear:!0,position:"bottom",style:{height:this.height},onClosed:()=>{this.destroy&&(this.isDestroy=!0)}},{default:()=>[this.$slots.default&&!this.isDestroy&&this.$slots.default()]})}});export{_ as C};