builder-settings-types 0.0.433 → 0.0.435

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -25,7 +25,7 @@
25
25
  `;class yf{constructor(e,r="gradient"){this.isOpen=!1,this.currentColor="#FF0000",this.currentOpacity=100,this.outsideClick=a=>{if(!this.isOpen)return;const n=a.target;if(this.element.contains(n))return;if(this.backdrop.contains(n)){a.preventDefault(),a.stopPropagation(),this.close(!0);return}const i=document.querySelectorAll(".gstop-color-input, .gstop-color-preview, .gradient-mini-preview");if(Array.from(i).some(l=>l.contains(n)))return;const o=document.querySelector(".gradient-popover");o&&o.contains(n)||(a.preventDefault(),a.stopPropagation(),this.close(!0))},this.keyDown=a=>{if(this.isOpen){if(a.key==="Escape")a.preventDefault(),this.close(!0);else if(a.key==="Enter"){const n=a.target;if(n&&(n.tagName==="INPUT"||n.tagName==="TEXTAREA"))return;a.preventDefault(),this.close(!0)}}},this.onChange=e,this.recentScope=r,this.element=this.build(),this.backdrop=this.createBackdrop()}parsePercentage(e){const r=parseFloat(e);return isNaN(r)?0:r/100}build(){const e=document.createElement("div");e.className="custom-color-picker",e.style.display="none";const r=document.createElement("div");r.className="color-picker-header",r.style.cursor="move";const a=document.createElement("span");a.textContent="Color";const n=document.createElement("button");n.className="color-picker-close",n.innerHTML=k0,n.addEventListener("click",()=>this.close(!0)),r.appendChild(a),r.appendChild(n),ns(r,e);const i=document.createElement("div");i.className="color-picker-area",this.colorArea=i;const s=document.createElement("div");s.className="color-picker-marker",this.colorMarker=s,i.appendChild(s);const o=document.createElement("div");o.className="color-picker-sliders-container";const l=document.createElement("button");l.className="color-picker-eyedropper",l.type="button",l.innerHTML=_0;const c=document.createElement("div");c.className="color-picker-sliders-group";const f=document.createElement("div");f.className="color-picker-hue",this.hueSlider=f;const u=document.createElement("div");u.className="color-picker-hue-marker",this.hueMarker=u,f.appendChild(u);const h=document.createElement("div");h.className="color-picker-opacity",this.opacitySlider=h;const p=document.createElement("div");p.className="color-picker-opacity-marker",this.opacityMarker=p,h.appendChild(p),c.appendChild(f),c.appendChild(h),o.appendChild(l),o.appendChild(c);const m=is(C=>{var B;const M=At(C);if(M&&M.type!=="solid"){(B=this.onChange)==null||B.call(this,C,this.currentOpacity);return}const N=ci(C),z=N.opacity??100;this.currentOpacity=z,this.opacityMarker.style.left=`${z}%`,this.setColor(N.color)},this.recentScope);this.recentSectionRefresh=m.refresh;const d=document.createElement("div");d.className="color-picker-format-section";const g=document.createElement("select");g.className="color-picker-format-select",this.select=g;const x=document.createElement("option");x.value="hex",x.textContent="HEX";const w=document.createElement("option");w.value="rgb",w.textContent="RGB";const v=document.createElement("option");v.value="hsl",v.textContent="HSL",g.appendChild(x),g.appendChild(w),g.appendChild(v);const I=document.createElement("input");I.type="text",I.className="color-picker-color-input",I.value=this.currentColor,this.input=I;const L=document.createElement("div");L.className="color-picker-input-container";const _=document.createElement("button");return _.className="color-picker-copy-inside",_.textContent="Copy",L.appendChild(I),L.appendChild(_),d.appendChild(g),d.appendChild(L),e.appendChild(r),e.appendChild(i),e.appendChild(o),e.appendChild(m.container),e.appendChild(d),e.addEventListener("click",C=>C.stopPropagation()),this.bind(i,f,h,I,g,_,l),e}createBackdrop(){const e=document.createElement("div");return e.className="color-picker-backdrop",e.style.display="none",e.style.pointerEvents="none",e}bind(e,r,a,n,i,s,o){const l=u=>{var w;const h=e.getBoundingClientRect(),p=Math.max(0,Math.min(1,(u.clientX-h.left)/h.width)),m=Math.max(0,Math.min(1,(u.clientY-h.top)/h.height));this.colorMarker.style.left=`${p*100}%`,this.colorMarker.style.top=`${m*100}%`;const g=this.parsePercentage(this.hueMarker.style.left||"0%")*360,x=_a(g,p,1-m);this.currentColor=x,this.syncInput(),this.updateOpacityBg(),(w=this.onChange)==null||w.call(this,x,this.currentOpacity)},c=u=>{var w;const h=r.getBoundingClientRect();let p=Math.max(0,Math.min(1,(u.clientX-h.left)/h.width));this.hueMarker.style.left=`${p*100}%`;const m=p*360,d=this.parsePercentage(this.colorMarker.style.left||"0%"),g=this.parsePercentage(this.colorMarker.style.top||"0%"),x=_a(m,d,1-g);this.currentColor=x,this.colorArea.style.background=`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${m}, 100%, 50%))`,this.syncInput(),this.updateOpacityBg(),(w=this.onChange)==null||w.call(this,x,this.currentOpacity)},f=u=>{var m;const h=a.getBoundingClientRect(),p=Math.max(0,Math.min(1,(u.clientX-h.left)/h.width));this.opacityMarker.style.left=`${p*100}%`,this.currentOpacity=Math.round(p*100),(m=this.onChange)==null||m.call(this,this.currentColor,this.currentOpacity)};e.addEventListener("mousedown",u=>{u.preventDefault(),l(u);const h=m=>l(m),p=()=>{document.removeEventListener("mousemove",h),document.removeEventListener("mouseup",p)};document.addEventListener("mousemove",h),document.addEventListener("mouseup",p)}),r.addEventListener("mousedown",u=>{u.preventDefault(),c(u);const h=m=>c(m),p=()=>{document.removeEventListener("mousemove",h),document.removeEventListener("mouseup",p)};document.addEventListener("mousemove",h),document.addEventListener("mouseup",p)}),a.addEventListener("mousedown",u=>{u.preventDefault(),f(u);const h=m=>f(m),p=()=>{document.removeEventListener("mousemove",h),document.removeEventListener("mouseup",p)};document.addEventListener("mousemove",h),document.addEventListener("mouseup",p)}),i.addEventListener("change",()=>this.syncInput()),n.addEventListener("input",()=>this.applyFromInput()),n.addEventListener("blur",()=>this.syncInput()),n.addEventListener("keydown",u=>{u.key==="Enter"&&(u.preventDefault(),this.syncInput(),n.blur())}),s.addEventListener("click",async()=>{try{await navigator.clipboard.writeText(n.value)}catch{n.select(),document.execCommand("copy")}}),o.addEventListener("click",async()=>{var u;if(!("EyeDropper"in window)){alert("EyeDropper API is not supported in this browser.");return}try{const h=new window.EyeDropper,{sRGBHex:p}=await h.open();this.setColor(p),(u=this.onChange)==null||u.call(this,p,this.currentOpacity)}catch{}}),document.addEventListener("keydown",this.keyDown,!0),setTimeout(()=>document.addEventListener("click",this.outsideClick,!0),0)}setColor(e){var s;this.currentColor=e;const{h:r,s:a,v:n}=ka(e),i=r>=360?r%360:r;this.hueMarker.style.left=`${i/360*100}%`,this.colorMarker.style.left=`${a*100}%`,this.colorMarker.style.top=`${(1-n)*100}%`,this.colorArea.style.background=`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${i}, 100%, 50%))`,this.syncInput(),this.updateOpacityBg(),(s=this.onChange)==null||s.call(this,e,this.currentOpacity)}syncInput(){const e=this.select.value,{h:r,s:a,v:n}=ka(this.currentColor);if(e==="hex")this.input.value=this.currentColor;else if(e==="rgb"){const{r:i,g:s,b:o}=pt(this.currentColor);this.input.value=`rgb(${i}, ${s}, ${o})`}else{const{hue:i,sat:s,lightness:o}=C0(r,a,n);this.input.value=`hsl(${Math.round(i)}, ${Math.round(s*100)}%, ${Math.round(o*100)}%)`}}applyFromInput(){const e=this.input.value.trim();let r="";if(/^#[0-9A-Fa-f]{6}$/.test(e))r=e;else{const a=e.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);if(a){const n=parseInt(a[1]),i=parseInt(a[2]),s=parseInt(a[3]);n<=255&&i<=255&&s<=255&&(r=`#${[n,i,s].map(o=>o.toString(16).padStart(2,"0")).join("")}`)}else{const n=e.match(/hsl\((\d+),\s*(\d+)%,\s*(\d+)%\)/);if(n){const i=parseInt(n[1]),s=parseInt(n[2])/100,o=parseInt(n[3])/100,l=o+s*Math.min(o,1-o),c=l===0?0:2*(1-o/l);r=_a(i,c,l)}}}r&&this.setColor(r)}updateOpacityBg(){const{r:e,g:r,b:a}=pt(this.currentColor);this.opacitySlider.style.setProperty("--base-color",`rgb(${e}, ${r}, ${a})`),this.opacitySlider.style.setProperty("--base-color-transparent",`rgba(${e}, ${r}, ${a}, 0)`)}open(e,r,a){var v;this.currentColor=e,this.currentOpacity=a??100,this.syncInput();const{h:n,s:i,v:s}=ka(e);this.hueMarker.style.left=`${n/360*100}%`,this.colorMarker.style.left=`${i*100}%`,this.colorMarker.style.top=`${(1-s)*100}%`,this.colorArea.style.background=`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${n}, 100%, 50%))`,this.updateOpacityBg(),this.opacityMarker.style.left=`${this.currentOpacity}%`,(v=this.recentSectionRefresh)==null||v.call(this),this.isOpen=!0,this.backdrop.style.display="block",this.backdrop.parentElement||document.body.appendChild(this.backdrop),this.element.style.display="block",this.element.style.position="fixed",this.element.style.zIndex="10002",this.element.style.left="-9999px",this.element.style.top="0px",this.element.parentElement||document.body.appendChild(this.element);const o=this.element.offsetWidth,l=this.element.offsetHeight,c=r.getBoundingClientRect(),f=window.innerWidth,u=window.innerHeight,h=16;let p=c.right+8,m=c.top;const d=f-c.right,g=c.left;d>=o+h?p=c.right+8:g>=o+h?p=c.left-o-8:p=Math.max(h,(f-o)/2);const x=u-c.bottom,w=c.top;x>=l+h?m=c.bottom+8:w>=l+h?m=c.top-l-8:x>w?(m=c.bottom+8,m+l>u-h&&(m=u-l-h)):(m=c.top-l-8,m<h&&(m=h)),this.element.style.left=`${p}px`,this.element.style.top=`${m}px`}close(e){var r;if(this.isOpen&&(this.isOpen=!1,this.backdrop.style.display="none",this.element.style.display="none",document.removeEventListener("click",this.outsideClick,!0),document.removeEventListener("keydown",this.keyDown,!0),e&&this.onChange&&this.recentScope==="solid")){let a=this.currentColor;if(this.currentOpacity<100){const{r:n,g:i,b:s}=pt(this.currentColor);a=`rgba(${n}, ${i}, ${s}, ${this.currentOpacity/100})`}aa.addColor(a,this.recentScope),(r=this.recentSectionRefresh)==null||r.call(this)}}setOnChange(e){this.onChange=e}getIsOpen(){return this.isOpen}getElement(){return this.element}}class kf{constructor(e){this.isDragging=!1,this.currentColor="#FFFFFF",this.currentColor=this.sanitizeColor(e.initialColor),this.currentOpacity=this.clampOpacity(e.initialOpacity),this.onColorChange=e.onColorChange,this.recentScope=e.scope??"solid",this.element=this.build(),this.initFromColor(this.currentColor,this.currentOpacity)}parsePercentage(e){const r=parseFloat(e);return isNaN(r)?0:r/100}sanitizeColor(e){const r=this.currentColor||"#FFFFFF";return ra(e)??r}clampOpacity(e){return Number.isFinite(e)?Math.min(100,Math.max(0,Math.round(e))):100}build(){const e=document.createElement("div");e.className="embedded-color-picker";const r=document.createElement("div");r.className="color-picker-area embedded",this.colorArea=r;const a=document.createElement("div");a.className="color-picker-marker",this.colorMarker=a,r.appendChild(a);const n=document.createElement("div");n.className="color-picker-sliders-container embedded";const i=document.createElement("button");i.className="color-picker-eyedropper",i.type="button",i.innerHTML=_0;const s=document.createElement("div");s.className="color-picker-sliders-group";const o=document.createElement("div");o.className="color-picker-hue embedded",this.hueSlider=o;const l=document.createElement("div");l.className="color-picker-hue-marker",this.hueMarker=l,o.appendChild(l);const c=document.createElement("div");c.className="color-picker-opacity embedded",this.opacitySlider=c;const f=document.createElement("div");f.className="color-picker-opacity-marker",this.opacityMarker=f,c.appendChild(f),s.appendChild(o),s.appendChild(c),n.appendChild(i),n.appendChild(s);const u=is(C=>{const M=At(C);if(M&&M.type!=="solid")this.onColorChange(C,this.currentOpacity);else{const N=ci(C),z=N.opacity??100;this.currentOpacity=z,this.opacityMarker.style.left=`${this.currentOpacity}%`,this.opacityValueInput.value=`${this.currentOpacity}%`,this.setColor(N.color),this.onColorChange(this.currentColor,this.currentOpacity)}},"all");this.recentSectionRefresh=u.refresh;const h=document.createElement("div");h.className="color-picker-format-section embedded";const p=document.createElement("select");p.className="color-picker-format-select",this.select=p;const m=document.createElement("option");m.value="hex",m.textContent="HEX";const d=document.createElement("option");d.value="rgb",d.textContent="RGB";const g=document.createElement("option");g.value="hsl",g.textContent="HSL",p.appendChild(m),p.appendChild(d),p.appendChild(g);const x=document.createElement("input");x.type="text",x.className="color-picker-color-input",this.input=x;const w=document.createElement("div");w.className="color-picker-input-container";const v=document.createElement("div");v.className="color-picker-swatch",this.colorSwatchEl=v;const I=document.createElement("div");I.className="color-picker-swatch-color",this.colorSwatchColorEl=I,v.appendChild(I);const L=document.createElement("div");L.className="color-picker-input-separator";const _=document.createElement("input");return _.type="text",_.className="color-picker-opacity-value-input",_.value=`${this.currentOpacity}%`,this.opacityValueInput=_,w.appendChild(v),w.appendChild(x),w.appendChild(L),w.appendChild(_),h.appendChild(p),h.appendChild(w),e.appendChild(r),e.appendChild(n),e.appendChild(h),e.appendChild(u.container),this.bind(r,o,c,x,p,_,i),e}bind(e,r,a,n,i,s,o){const l=(h,p)=>{const m=p||e.getBoundingClientRect(),d=Math.max(0,Math.min(1,(h.clientX-m.left)/m.width)),g=Math.max(0,Math.min(1,(h.clientY-m.top)/m.height));this.colorMarker.style.left=`${d*100}%`,this.colorMarker.style.top=`${g*100}%`;const w=this.parsePercentage(this.hueMarker.style.left||"0%")*360,v=_a(w,d,1-g);this.currentColor=v,this.syncInput(),this.updateOpacityBg(),this.updateColorSwatch(),this.queueChange()},c=(h,p)=>{const m=p||r.getBoundingClientRect(),d=Math.max(0,Math.min(1,(h.clientX-m.left)/m.width));this.hueMarker.style.left=`${d*100}%`;const g=d*360,x=this.parsePercentage(this.colorMarker.style.left||"0%"),w=this.parsePercentage(this.colorMarker.style.top||"0%"),v=_a(g,x,1-w);this.currentColor=v,this.colorArea.style.background=`linear-gradient(to top, #000, transparent),
26
26
  linear-gradient(to right, #fff, hsl(${g}, 100%, 50%))`,this.syncInput(),this.updateOpacityBg(),this.updateColorSwatch(),this.queueChange()},f=(h,p)=>{const m=p||a.getBoundingClientRect(),d=Math.max(0,Math.min(1,(h.clientX-m.left)/m.width));this.opacityMarker.style.left=`${d*100}%`,this.currentOpacity=this.clampOpacity(d*100),this.opacityValueInput.value=`${this.currentOpacity}%`,this.updateColorSwatch(),this.queueChange()},u=(h,p,m)=>{h.preventDefault(),this.isDragging=!0,this.cachedRect=m.getBoundingClientRect(),p(h,this.cachedRect);let d=null,g;const x=()=>{this.dragRafId===void 0&&(this.dragRafId=window.requestAnimationFrame(()=>{this.dragRafId=void 0,d&&this.cachedRect&&p(d,this.cachedRect)}))},w=()=>{this.isDragging&&(this.isDragging=!1,this.dragRafId!==void 0&&(cancelAnimationFrame(this.dragRafId),this.dragRafId=void 0),this.cachedRect=void 0,d=null,this.flushChange(),document.removeEventListener("mousemove",g),document.removeEventListener("mouseup",w),window.removeEventListener("blur",w),this.applyPendingExternal())};g=v=>{if(!v.buttons){w();return}d=v,x()},document.addEventListener("mousemove",g),document.addEventListener("mouseup",w),window.addEventListener("blur",w)};e.addEventListener("mousedown",h=>{u(h,l,e)}),r.addEventListener("mousedown",h=>{u(h,c,r)}),a.addEventListener("mousedown",h=>{u(h,f,a)}),i.addEventListener("change",()=>{this.syncInput()}),n.addEventListener("input",()=>{this.applyFromInput()}),n.addEventListener("blur",()=>{this.syncInput()}),n.addEventListener("keydown",h=>{h.key==="Enter"&&(h.preventDefault(),this.syncInput(),n.blur())}),s.addEventListener("focus",h=>{const p=h.target;p.value=p.value.replace("%",""),setTimeout(()=>p.select(),0)}),s.addEventListener("input",()=>{const h=s.value.replace(/[^\d]/g,""),p=parseInt(h,10);if(!Number.isNaN(p)){const m=Math.max(0,Math.min(100,p));this.currentOpacity=m,this.opacityMarker.style.left=`${m}%`,this.updateColorSwatch(),this.queueChange()}}),s.addEventListener("blur",()=>{s.value=`${this.currentOpacity}%`}),s.addEventListener("keydown",h=>{h.key==="Enter"&&(h.preventDefault(),s.blur())}),o.addEventListener("click",async()=>{if(!("EyeDropper"in window)){alert("EyeDropper API is not supported in this browser.");return}try{const h=new window.EyeDropper,{sRGBHex:p}=await h.open();this.setColor(p),this.onColorChange(this.currentColor,this.currentOpacity)}catch{}})}setColor(e){const r=this.sanitizeColor(e);this.currentColor=r;const{h:a,s:n,v:i}=ka(r),s=a>=360?a%360:a;this.hueMarker.style.left=`${s/360*100}%`,this.colorMarker.style.left=`${n*100}%`,this.colorMarker.style.top=`${(1-i)*100}%`,this.colorArea.style.background=`linear-gradient(to top, #000, transparent),
27
27
  linear-gradient(to right, #fff, hsl(${s}, 100%, 50%))`,this.syncInput(),this.updateOpacityBg(),this.updateColorSwatch()}syncInput(){const e=this.select.value,{h:r,s:a,v:n}=ka(this.currentColor);if(e==="hex")this.input.value=this.currentColor;else if(e==="rgb"){const{r:i,g:s,b:o}=pt(this.currentColor);this.input.value=`rgb(${i}, ${s}, ${o})`}else{const{hue:i,sat:s,lightness:o}=C0(r,a,n);this.input.value=`hsl(${Math.round(i)}, ${Math.round(s*100)}%, ${Math.round(o*100)}%)`}}applyFromInput(){const e=this.input.value.trim();let r="";if(/^#[0-9A-Fa-f]{6}$/.test(e))r=e;else{const a=e.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);if(a){const n=parseInt(a[1],10),i=parseInt(a[2],10),s=parseInt(a[3],10);n<=255&&i<=255&&s<=255&&(r="#"+[n,i,s].map(o=>o.toString(16).padStart(2,"0")).join(""))}else{const n=e.match(/hsl\((\d+),\s*(\d+)%,\s*(\d+)%\)/);if(n){const i=parseInt(n[1],10),s=parseInt(n[2],10)/100,o=parseInt(n[3],10)/100,l=o+s*Math.min(o,1-o),c=l===0?0:2*(1-o/l);r=_a(i,c,l)}}}r&&(this.setColor(r),this.onColorChange(this.currentColor,this.currentOpacity))}updateOpacityBg(){const{r:e,g:r,b:a}=pt(this.currentColor);this.opacitySlider.style.setProperty("--base-color",`rgb(${e}, ${r}, ${a})`),this.opacitySlider.style.setProperty("--base-color-transparent",`rgba(${e}, ${r}, ${a}, 0)`)}updateColorSwatch(){if(this.colorSwatchEl&&this.colorSwatchColorEl){const{r:e,g:r,b:a}=pt(this.currentColor),n=this.currentOpacity/100;this.colorSwatchColorEl.style.backgroundColor=`rgba(${e}, ${r}, ${a}, ${n})`,this.currentOpacity<100?this.colorSwatchEl.classList.add("has-transparency"):this.colorSwatchEl.classList.remove("has-transparency")}}queueChange(){this.changeRafId===void 0&&(this.changeRafId=window.requestAnimationFrame(()=>{this.changeRafId=void 0,this.onColorChange(this.currentColor,this.currentOpacity)}))}flushChange(){this.changeRafId!==void 0&&(cancelAnimationFrame(this.changeRafId),this.changeRafId=void 0),this.onColorChange(this.currentColor,this.currentOpacity)}applyPendingExternal(){if(!this.pendingExternalUpdate)return;const{color:e,opacity:r}=this.pendingExternalUpdate;this.pendingExternalUpdate=void 0,this.initFromColor(e,r)}initFromColor(e,r){var l;const a=this.sanitizeColor(e);this.currentColor=a,this.currentOpacity=this.clampOpacity(r);const{h:n,s:i,v:s}=ka(a),o=n>=360?n%360:n;this.hueMarker.style.left=`${o/360*100}%`,this.colorMarker.style.left=`${i*100}%`,this.colorMarker.style.top=`${(1-s)*100}%`,this.colorArea.style.background=`linear-gradient(to top, #000, transparent),
28
- linear-gradient(to right, #fff, hsl(${o}, 100%, 50%))`,this.opacityMarker.style.left=`${this.currentOpacity}%`,this.opacityValueInput.value=`${this.currentOpacity}%`,this.updateOpacityBg(),this.updateColorSwatch(),this.syncInput(),(l=this.recentSectionRefresh)==null||l.call(this)}commitRecentColor(){var e;if(this.recentScope==="solid"){let r=this.currentColor;if(this.currentOpacity<100){const{r:a,g:n,b:i}=pt(this.currentColor);r=`rgba(${a}, ${n}, ${i}, ${this.currentOpacity/100})`}aa.addColor(r,this.recentScope),(e=this.recentSectionRefresh)==null||e.call(this)}}getElement(){return this.element}updateColor(e,r){if(this.isDragging){this.pendingExternalUpdate={color:e,opacity:r};return}this.initFromColor(e,r)}}const er=class er extends Le{constructor(e={}){const r=typeof e.default=="string"?void 0:e.default;super({...e,title:e.title||"Color",default:r}),this.inputType={type:"text",angle:"number",stops:"text"},this.element=null,this.previewEl=null,this.inputEl=void 0,this.popoverEl=null,this.backdropEl=null,this.isPopoverOpen=!1,this.isEditing=!1,this.popoverPosition=null,this.previewUpdateTimeout=null,this.changeDebounceTimeout=null,this.solidPicker=null,this.pendingSolidColor=null,this.sharedStopColorPicker=null,this.colorPickerStopIndex=null,this.variant="default",this.globalLayoutMode="list",this.globalSearchQuery="",this.currentMode="custom",this.linkedGlobalVariable=null,this.unlinkButton=null,this.onBackgroundClick=a=>{var h;if(!this.popoverEl||!this.isPopoverOpen)return;const n=a.target,i=this.popoverEl.contains(n),s=(h=this.element)==null?void 0:h.contains(n),o=document.querySelectorAll(".custom-color-picker"),l=Array.from(o).some(p=>p.contains(n)),c=n.closest(".gstop-color-input, .gradient-mini-preview, .gstop-color-preview"),f=n.classList.contains("color-picker-backdrop"),u=n.classList.contains("gradient-popover-backdrop");!i&&!s&&!l&&!c&&!f&&!u&&this.closePopover()},this.handlePopoverKeydown=a=>{var n,i;if(this.isPopoverOpen){if(a.key==="Escape"){if(a.preventDefault(),(n=this.sharedStopColorPicker)!=null&&n.getIsOpen()){this.sharedStopColorPicker.close(!1),this.colorPickerStopIndex=null;return}this.closePopover();return}if(a.key==="Enter"){const s=a.target;if(s&&(s.tagName==="INPUT"||s.tagName==="TEXTAREA"))return;if(a.preventDefault(),(i=this.sharedStopColorPicker)!=null&&i.getIsOpen()){this.sharedStopColorPicker.close(!0),this.colorPickerStopIndex=null;return}this.closePopover()}}},this.detectChange=e.detectChange,this.onColorChange=e.onColorChange,this.variant=e.variant??"default",this.originalDefault=e.default,this.value=this.defaultValue(),this.setLinkedGlobalVariableFrom(this.originalDefault??this.value)}resolveGlobalVarColor(e){if(e&&e.startsWith("var(--")){const r=e.replace("var(--","").replace(")","");return(Le.GlobalVariables||{})[r]||e}return e}getSharedStopColorPicker(){return this.sharedStopColorPicker||(this.sharedStopColorPicker=new yf(void 0,"solid")),this.sharedStopColorPicker}setLinkedGlobalVariableFrom(e){var a,n;if(!e){this.linkedGlobalVariable=null;return}const r=typeof e=="string"?e:((n=(a=e.stops)==null?void 0:a[0])==null?void 0:n.color)??null;this.linkedGlobalVariable=r&&r.startsWith("var(--")?r:null}isBoundToGlobal(){return!!this.linkedGlobalVariable}clearGlobalBindingForCustomChange(){var e,r;this.isBoundToGlobal()&&((r=(e=this.value)==null?void 0:e.stops)!=null&&r.length&&(this.value.stops=this.value.stops.map(a=>({...a,color:this.resolveGlobalVarColor(a.color)}))),this.linkedGlobalVariable=null,this.updateUnlinkButtonVisibility())}breakGlobalBinding(){var e;!this.isBoundToGlobal()||!this.value||((e=this.value.stops)!=null&&e.length&&(this.value.stops=this.value.stops.map(r=>({...r,color:this.resolveGlobalVarColor(r.color)}))),this.linkedGlobalVariable=null,this.updateUI(),this.triggerChange(),this.isPopoverOpen&&this.refreshPopoverContent())}defaultValue(){const e=this.originalDefault;if(typeof e=="string"){if(e.startsWith("var(--"))return yr({type:"solid",angle:0,stops:[{color:e,position:0,opacity:100}]});const a=At(e);if(a)return yr(a)}return yr(e&&typeof e=="object"?e:{type:"linear",angle:90,stops:[{color:"#a84b4b",position:0,opacity:100},{color:"#786666",position:100,opacity:100}]})}setValue(e){let r=null;typeof e=="string"?e.startsWith("var(--")?r=yr({type:"solid",angle:0,stops:[{color:e,position:0,opacity:100}]}):r=At(e):e&&typeof e=="object"&&(r=yr(e)),r||(r=this.defaultValue()),this.value=r,this.setLinkedGlobalVariableFrom(e??r),this.updateUI(),this.isPopoverOpen&&this.refreshPopoverContent(),this.triggerChange(),this.pendingSolidColor=null,this.updateUnlinkButtonVisibility()}updateUI(){if(this.previewEl&&this.value)if(this.value.type==="solid"){const e=this.value.stops[0],r=e.opacity??100,a=this.resolveGlobalVarColor(e.color);this.previewEl.style.background=Hi(a,r)}else{const e=this.resolveGradientGlobalVars(this.value);this.previewEl.style.background=Zt(e)}if(this.inputEl&&this.value&&!this.isEditing)if(this.isBoundToGlobal()&&this.linkedGlobalVariable){const r=this.linkedGlobalVariable.replace("var(--","").replace(")","").split("-").map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" ");this.inputEl.value=`Linked: ${r}`}else this.inputEl.value=$n(this.value);this.updateUnlinkButtonVisibility()}resolveGradientGlobalVars(e){return{...e,stops:e.stops.map(r=>({...r,color:this.resolveGlobalVarColor(r.color)}))}}updateUnlinkButtonVisibility(){if(!this.unlinkButton)return;const e=this.isBoundToGlobal();e?this.unlinkButton.classList.add("visible"):this.unlinkButton.classList.remove("visible"),this.previewEl&&(e?this.previewEl.classList.add("bound"):this.previewEl.classList.remove("bound"))}cssForTextValue(){return this.value?{background:Zt(this.value),"-webkit-background-clip":"text","background-clip":"text",color:"transparent","-webkit-text-fill-color":"transparent"}:{}}draw(){const e=document.createElement("div");if(e.className="gradient-setting-wrapper",this.props.title){const a=document.createElement("div");a.className="icon-container";const n=document.createElement("span");n.className="input-label",n.textContent=this.props.title,a.appendChild(n),e.appendChild(a)}const r=document.createElement("div");return r.className="gradient-input-wrapper",this.previewEl=document.createElement("div"),this.previewEl.className="gradient-mini-preview",this.previewEl.style.background=this.value?Zt(this.value):"linear-gradient(90deg, #a84b4b 0%, #786666 100%)",this.previewEl.addEventListener("click",a=>{a.preventDefault(),a.stopPropagation(),this.openPopover()}),this.inputEl=document.createElement("input"),this.inputEl.type="text",this.inputEl.className="gradient-text-input",this.inputEl.placeholder="Enter gradient CSS or paste color...",this.inputEl.value=this.value?$n(this.value):"",this.inputEl.readOnly=!1,this.inputEl.addEventListener("focus",()=>{if(this.isEditing=!0,this.value)if(this.value.type==="solid"){const a=this.value.stops[0];if(a){const i=this.resolveGlobalVarColor(a.color).toUpperCase(),s=a.opacity??100;if(s===100)this.inputEl.value=i;else{const l=Math.round(s/100*255).toString(16).toUpperCase().padStart(2,"0");this.inputEl.value=`${i}${l}`}}}else this.inputEl.value=Zt(this.value)}),this.inputEl.addEventListener("blur",()=>{this.isEditing=!1,this.value&&(this.inputEl.value=$n(this.value))}),this.inputEl.addEventListener("paste",a=>this.handlePaste(a)),this.inputEl.addEventListener("input",a=>this.handleTextInput(a)),this.inputEl.addEventListener("keydown",a=>{a.key==="Enter"&&(this.handleTextInput(a),this.inputEl.blur()),a.key==="Escape"&&(this.value&&(this.inputEl.value=Zt(this.value)),this.inputEl.blur())}),r.appendChild(this.previewEl),this.unlinkButton=document.createElement("button"),this.unlinkButton.type="button",this.unlinkButton.className="gradient-unlink-button",this.unlinkButton.innerHTML=Cf,this.unlinkButton.title="Break global color binding",this.unlinkButton.addEventListener("click",a=>{a.preventDefault(),a.stopPropagation(),this.breakGlobalBinding()}),r.appendChild(this.unlinkButton),r.appendChild(this.inputEl),e.appendChild(r),this.createPopover(),this.element=e,this.updateUnlinkButtonVisibility(),e}createPopover(){if(this.popoverEl)return;this.backdropEl=document.createElement("div"),this.backdropEl.className="gradient-popover-backdrop",this.backdropEl.style.display="none",this.backdropEl.style.pointerEvents="none",this.popoverEl=document.createElement("div"),this.popoverEl.className="gradient-popover",this.popoverEl.style.display="none",this.popoverEl.addEventListener("click",l=>{l.stopPropagation()});const e=document.createElement("div");e.className="gradient-popover-header",e.style.cursor="move";let r=null;if(this.variant!=="global"){r=document.createElement("div"),r.className="color-setting-tabs header-tabs";const l=document.createElement("button");l.className="color-tab active",l.textContent="Custom";const c=document.createElement("button");c.className="color-tab",c.textContent="Global",r.appendChild(l),r.appendChild(c),e.appendChild(r)}else{const l=document.createElement("div");e.appendChild(l)}const a=document.createElement("button");a.type="button",a.className="gradient-popover-close",a.innerHTML=k0,a.addEventListener("click",()=>this.closePopover()),e.appendChild(a),ns(e,this.popoverEl,(l,c)=>{this.popoverPosition={left:l,top:c}});const n=document.createElement("div");n.className="gradient-editor";const i=document.createElement("div");i.className="type-tabs-wrapper";const s=this.createTypeTabs();i.appendChild(s),n.appendChild(i);const o=document.createElement("div");if(o.className="gradient-editor-content",this.updatePopoverContent(o),n.appendChild(o),this.variant!=="global"&&r){const l=r.children[0],c=r.children[1],f=u=>{this.currentMode=u,u==="custom"?(l.classList.add("active"),c.classList.remove("active"),i.style.display="block"):(c.classList.add("active"),l.classList.remove("active"),i.style.display="none"),this.updatePopoverContent(o)};l.addEventListener("click",()=>f("custom")),c.addEventListener("click",()=>f("global")),this.isBoundToGlobal()?(this.currentMode="global",f("global")):(this.currentMode="custom",f("custom"))}this.popoverEl.appendChild(e),this.popoverEl.appendChild(n),document.body.appendChild(this.backdropEl),document.body.appendChild(this.popoverEl)}createTypeTabs(){var n,i;const e=document.createElement("div");e.className="gradient-type-tabs";const r=document.createElement("button");r.type="button",r.className=`gradient-type-tab ${((n=this.value)==null?void 0:n.type)==="solid"?"active":""}`,r.innerHTML=vf,r.addEventListener("click",()=>this.switchType("solid"));const a=document.createElement("button");return a.type="button",a.className=`gradient-type-tab ${((i=this.value)==null?void 0:i.type)!=="solid"?"active":""}`,a.innerHTML=wf,a.addEventListener("click",()=>{var o,l;const s=((o=this.value)==null?void 0:o.type)==="solid"?"linear":((l=this.value)==null?void 0:l.type)||"linear";this.switchType(s)}),e.appendChild(r),e.appendChild(a),e}switchType(e,r=!1){var l,c;if(!this.value)return;const a=this.value.type,n=this.isBoundToGlobal(),i=this.linkedGlobalVariable;this.value.type=e;let s=!1;if(n&&i&&a==="solid"!=(e==="solid")){const f=this.resolveGlobalVarColor(i),u=this.value.stops&&this.value.stops[0]?this.value.stops[0].opacity??100:100,h=At(f);h&&h.type!=="solid"&&h.stops.length>=2?(this.value.stops=h.stops,this.value.angle=h.angle,this.value.type=h.type,this.linkedGlobalVariable=null,s=!0):((l=this.value.stops)!=null&&l.length&&(this.value.stops=this.value.stops.map(p=>({...p,color:p.color.startsWith("var(--")?this.resolveGlobalVarColor(p.color):p.color}))),!this.value.stops||this.value.stops.length===0?this.value.stops=[{color:f,position:0,opacity:u}]:this.value.stops[0]={...this.value.stops[0],color:f,opacity:u},this.linkedGlobalVariable=null,s=!0)}if(e!=="solid"&&(this.pendingSolidColor=null),e!=="solid"&&(!this.value.stops||this.value.stops.length===0)&&(this.value.stops=[{color:"#a84b4b",position:0,opacity:100},{color:"#786666",position:100,opacity:100}]),e!=="solid"&&this.value.stops.length===1){const u=this.value.stops[0].color;if(u.startsWith("var(--")){const h=this.resolveGlobalVarColor(u),p=At(h);p&&p.type!=="solid"&&p.stops.length>=2?(this.value.stops=p.stops,this.value.angle=p.angle,this.value.type=p.type):(this.value.stops.push({color:"#786666",position:100,opacity:100}),this.value.angle=90)}else if(u.startsWith("linear-gradient")||u.startsWith("radial-gradient")){const h=At(u);h&&h.type!=="solid"&&h.stops.length>=2?(this.value.stops=h.stops,this.value.angle=h.angle,this.value.type=h.type):(this.value.stops=[{color:"#a84b4b",position:0,opacity:100},{color:"#786666",position:100,opacity:100}],this.value.angle=90)}else this.value.stops.push({color:"#786666",position:100,opacity:100}),this.value.angle=90}else if(e!=="solid"&&this.value.stops.length>=2)this.value.angle||(this.value.angle=90);else if(e==="solid"&&n&&i){const f=this.value.stops&&this.value.stops[0]?this.value.stops[0].opacity??100:100;this.value.stops=[{color:i,position:0,opacity:f}],this.value.angle=0}if(this.popoverEl){const f=this.popoverEl.querySelectorAll(".gradient-type-tab");f.forEach(p=>p.classList.remove("active"));const u=f[0],h=f[1];e==="solid"?u==null||u.classList.add("active"):h==null||h.classList.add("active")}const o=(c=this.popoverEl)==null?void 0:c.querySelector(".gradient-editor-content");o&&this.updatePopoverContent(o),this.updateUI(),(r||s||a!==e)&&this.triggerChange()}updatePopoverContent(e){if(e.innerHTML="",!!this.value){if(this.variant!=="global"&&this.currentMode==="global"){this.renderGlobalColors(e);return}this.value.type==="solid"?this.renderSolid(e):this.renderGradient(e)}}renderGlobalColors(e){(!this.value||!this.value.stops||!this.value.stops.length)&&(this.value||(this.value=this.defaultValue()),this.value.stops=[{color:"#000000",position:0,opacity:100}]);const r=this.value.stops[0],a=h=>{h.innerHTML="";let p={};try{p=Le.GlobalVariables||{}}catch(d){console.warn("Could not access Setting.GlobalVariables",d)}if(!p||Object.keys(p).length===0){const d=document.createElement("div");d.textContent="No global colors defined",d.style.fontSize="12px",d.style.color="#666",d.style.padding="8px",h.appendChild(d);return}Object.keys(Le.GlobalVariables),this.globalSearchQuery.toLowerCase();let m;this.globalLayoutMode==="list"?(m=document.createElement("div"),m.className="global-colors-list"):(m=document.createElement("div"),m.className="global-colors-grid"),h.appendChild(m),Object.keys(Le.GlobalVariables).forEach(d=>{let g=Le.GlobalVariables[d];if(this.globalLayoutMode==="list"){const x=document.createElement("div");x.className="global-color-row";const w=document.createElement("div");w.className="global-color-circle";const v=this.resolveGlobalVarColor(g);w.style.background=Xa(v),(this.linkedGlobalVariable===`var(--${d})`||r.color===`var(--${d})`)&&w.classList.add("selected");const L=document.createElement("span");L.className="global-color-label",L.textContent=d.split("-").map(_=>_.charAt(0).toUpperCase()+_.slice(1)).join(" "),x.appendChild(w),x.appendChild(L),x.addEventListener("click",_=>{_.preventDefault();const C=`var(--${d})`;this.setValue(C),this.pendingSolidColor=C,a(h)}),m.appendChild(x)}else{const x=document.createElement("div");x.className="global-color-circle";const w=this.resolveGlobalVarColor(g);x.style.background=Xa(w),x.title=d.split("-").map(I=>I.charAt(0).toUpperCase()+I.slice(1)).join(" "),(this.linkedGlobalVariable===`var(--${d})`||r.color===`var(--${d})`)&&x.classList.add("selected"),x.addEventListener("click",I=>{I.preventDefault();const L=`var(--${d})`;this.setValue(L),this.pendingSolidColor=L,a(h)}),m.appendChild(x)}})},n=document.createElement("div");n.className="global-controls-row";const i=document.createElement("div");i.className="global-search-container";const s=document.createElement("span");s.className="global-search-icon",s.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>';const o=document.createElement("span");o.className="global-search-separator";const l=document.createElement("input");l.type="text",l.className="global-search-input",l.placeholder="Search",l.value=this.globalSearchQuery;const c=document.createElement("div");l.addEventListener("input",h=>{this.globalSearchQuery=h.target.value,a(c)}),i.appendChild(s),i.appendChild(o),i.appendChild(l);const f=document.createElement("button");f.className="global-layout-toggle",f.type="button";const u=()=>{f.innerHTML=this.globalLayoutMode==="list"?'<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="7" height="7"></rect><rect x="14" y="3" width="7" height="7"></rect><rect x="14" y="14" width="7" height="7"></rect><rect x="3" y="14" width="7" height="7"></rect></svg>':'<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="8" y1="6" x2="21" y2="6"></line><line x1="8" y1="12" x2="21" y2="12"></line><line x1="8" y1="18" x2="21" y2="18"></line><line x1="3" y1="6" x2="3.01" y2="6"></line><line x1="3" y1="12" x2="3.01" y2="12"></line><line x1="3" y1="18" x2="3.01" y2="18"></line></svg>'};u(),f.addEventListener("click",()=>{this.globalLayoutMode=this.globalLayoutMode==="list"?"grid":"list",u(),a(c)}),n.appendChild(i),n.appendChild(f),e.appendChild(n),e.appendChild(c),a(c)}renderSolid(e){(!this.value||!this.value.stops||!this.value.stops.length)&&(this.value||(this.value=this.defaultValue()),this.value.stops=[{color:"#000000",position:0,opacity:100}]);const r=this.value.stops[0],a=new kf({initialColor:r.color.startsWith("var(--")?this.resolveGlobalVarColor(r.color):r.color,initialOpacity:r.opacity??100,onColorChange:(n,i)=>{if(this.clearGlobalBindingForCustomChange(),this.value){const s=At(n);if(s&&s.type!=="solid"){this.value=s,this.switchType(s.type,!0);return}this.value.stops[0].color=n,this.value.stops[0].opacity=i,this.updateUI(),this.triggerChange(),this.pendingSolidColor=n}}});this.solidPicker=a,e.appendChild(a.getElement())}renderGradient(e){this.solidPicker=null;let r=null;{const f=document.createElement("div");f.className="gradient-subtype-inline";const u=document.createElement("select");u.className="gradient-subtype-select";const h=document.createElement("option");h.value="linear",h.textContent="Linear";const p=document.createElement("option");p.value="radial",p.textContent="Radial",u.appendChild(h),u.appendChild(p),u.value=this.value.type==="radial"?"radial":"linear",r=document.createElement("input"),r.type="text",r.inputMode="numeric",r.className="gradient-degree-input",r.value=`${this.value.angle??90}°`,r.style.width="75px",r.style.textAlign="center",(!this.value.angle||this.value.stops.length<2)&&(this.value.angle=90,r.value="90°");const m=document.createElement("button");m.type="button",m.className="gradient-flip-btn",m.innerHTML=gf,u.addEventListener("change",()=>{this.clearGlobalBindingForCustomChange(),this.switchType(u.value==="radial"?"radial":"linear",!0),r&&this.updateDegreeVisibility(r)}),r.addEventListener("focus",d=>{const g=d.target;g.value=g.value.replace(/[^0-9-]/g,""),setTimeout(()=>g.select(),0)}),r.addEventListener("input",d=>{this.clearGlobalBindingForCustomChange();const g=parseInt(d.target.value);!Number.isNaN(g)&&this.value&&(this.value.angle=Math.max(0,Math.min(360,g)),this.debouncedPreviewUpdate())}),r.addEventListener("blur",d=>{var w;this.previewUpdateTimeout&&(clearTimeout(this.previewUpdateTimeout),this.previewUpdateTimeout=null);const g=d.target;let x=parseInt(g.value);Number.isNaN(x)&&(x=((w=this.value)==null?void 0:w.angle)??0),x=Math.max(0,Math.min(360,x)),this.value&&(this.value.angle=x),g.value=`${x}°`,this.updateGradientPreview(),this.updateUI(),this.triggerChange()}),m.addEventListener("click",()=>{this.clearGlobalBindingForCustomChange(),!(!this.value||!this.value.stops)&&(this.value.stops.forEach(d=>{d.position=100-d.position}),this.value.stops.sort((d,g)=>d.position-g.position),this.updateGradientPreview(a),this.createHandles(n,a),this.updateStopsList(l),this.updateUI(),this.triggerChange())}),f.appendChild(u),f.appendChild(r),f.appendChild(m),e.appendChild(f),this.updateDegreeVisibility(r)}const a=document.createElement("div");a.className="gradient-preview",this.updateGradientPreview(a);const n=document.createElement("div");n.className="gradient-handles",a.appendChild(n),e.appendChild(a),this.createHandles(n,a),a.addEventListener("click",f=>{var d;const u=f.target;if(u.classList.contains("gstop-handle")||u.classList.contains("gstop-chip"))return;const h=a.getBoundingClientRect(),m=(f.clientX-h.left)/h.width*100;this.clearGlobalBindingForCustomChange(),this.addStopAtPosition(m),this.updateStopsList(),this.updateGradientPreview(a),this.createHandles(n,a),this.updateUI(),((d=document.activeElement)==null?void 0:d.tagName)!=="INPUT"&&this.repositionPopover(),this.triggerChange()});const i=document.createElement("div");i.className="gradient-stops-header";const s=document.createElement("span");s.textContent="Stops";const o=document.createElement("button");o.type="button",o.className="gradient-add-stop",o.innerHTML=Ef,i.appendChild(s),i.appendChild(o);const l=document.createElement("div");l.className="gradient-stops",e.appendChild(i),e.appendChild(l),this.updateStopsList(l);const c=is(f=>{const u=At(f);u&&(this.clearGlobalBindingForCustomChange(),this.value=u,this.switchType(u.type,!0),this.updateUI(),this.triggerChange())},"all");this.recentGradientRefresh=c.refresh,e.appendChild(c.container),o.addEventListener("click",()=>{var f;this.clearGlobalBindingForCustomChange(),this.addStop(),this.updateStopsList(l),this.updateGradientPreview(a),this.createHandles(n,a),this.updateUI(),((f=document.activeElement)==null?void 0:f.tagName)!=="INPUT"&&this.repositionPopover(),this.triggerChange()})}updateDegreeVisibility(e){var r;e&&(((r=this.value)==null?void 0:r.type)==="radial"?(e.disabled=!0,e.style.opacity="0.5"):(e.disabled=!1,e.style.opacity="1"))}updateGradientPreview(e){var a;const r=e||((a=this.popoverEl)==null?void 0:a.querySelector(".gradient-preview"));if(r&&this.value)if(this.value.type==="solid")r.style.background=Zt(this.value);else{const n=this.value.stops.map(i=>`${Hi(i.color,i.opacity??100)} ${i.position}%`).join(", ");r.style.background=`linear-gradient(90deg, ${n})`}}debouncedPreviewUpdate(e){this.previewUpdateTimeout&&clearTimeout(this.previewUpdateTimeout),this.previewUpdateTimeout=window.setTimeout(()=>{this.updateGradientPreview(e),this.previewUpdateTimeout=null},16)}createHandles(e,r){e.innerHTML="",!(!this.value||this.value.type==="solid"||!this.value.stops)&&this.value.stops.forEach((a,n)=>{const i=document.createElement("div");i.className="gstop-handle",i.style.left=`${Math.max(0,Math.min(100,a.position))}%`,i.style.top="0%";const s=document.createElement("div");s.className="gstop-chip";const o=this.resolveGlobalVarColor(a.color);s.style.backgroundColor=o,i.appendChild(s);let l=!1,c=!1,f=0,u=0;const h=d=>{l=!0,c=!1,f=d.clientX,u=this.value.stops[n].position,i.classList.add("selected"),document.addEventListener("mousemove",p),document.addEventListener("mouseup",m),d.preventDefault(),d.stopPropagation()},p=d=>{if(!l||!this.value)return;const g=d.clientX-f;if(Math.abs(g)>3&&(c=!0),c){this.clearGlobalBindingForCustomChange();const x=r.getBoundingClientRect();let w=u+g/x.width*100;w=Math.max(0,Math.min(100,w)),this.value.stops[n].position=Math.round(w),i.style.left=`${w}%`,this.updateGradientPreview()}},m=d=>{var g;if(l)if(l=!1,i.classList.remove("selected"),document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",m),c)this.value&&(this.value.stops.sort((x,w)=>x.position-w.position),this.createHandles(e,r),this.updateStopsList()),this.updateUI(),this.triggerChange();else{d.stopPropagation();const x=(g=this.value)==null?void 0:g.stops[n];x&&setTimeout(()=>{const w=this.getSharedStopColorPicker();w.getIsOpen()&&w.close(!1),this.colorPickerStopIndex=n,w.setOnChange((I,L)=>{this.clearGlobalBindingForCustomChange(),this.value&&this.value.stops[n]&&(this.value.stops[n].color=I,L!==void 0&&(this.value.stops[n].opacity=L),s.style.backgroundColor=I,this.updateGradientPreview(),this.updateStopsList(),this.updateUI(),this.triggerChange())});const v=this.resolveGlobalVarColor(x.color);w.open(v,s,x.opacity??100)},0)}};i.addEventListener("mousedown",h),e.appendChild(i)})}updateStopsList(e){var a;const r=e||((a=this.popoverEl)==null?void 0:a.querySelector(".gradient-stops"));!r||!this.value||this.value.type==="solid"||!this.value.stops||(r.innerHTML="",this.value.stops.forEach((n,i)=>{var v,I;const s=document.createElement("div");s.className="gstop-row";const o=document.createElement("div");o.className="gstop-position-group";const l=document.createElement("input");l.type="text",l.className="gstop-position-input",l.value=`${n.position}%`,l.style.width="60px",o.appendChild(l);const c=document.createElement("div");c.className="gstop-color-container";const f=this.resolveGlobalVarColor(n.color),u=n.opacity??100,h=document.createElement("div");h.className="gstop-color-preview",u<100&&h.classList.add("has-transparency");const p=document.createElement("div");p.className="gstop-color-preview-color";const m=pt(f);p.style.backgroundColor=`rgba(${m.r}, ${m.g}, ${m.b}, ${u/100})`,h.appendChild(p);const d=document.createElement("input");d.type="text",d.className="gstop-color-input",d.value=f.replace("#","").toUpperCase();const g=document.createElement("div");g.className="gstop-color-separator";const x=document.createElement("input");x.type="text",x.className="gstop-opacity-input",x.value=`${n.opacity??100}%`,c.appendChild(h),c.appendChild(d),c.appendChild(g),c.appendChild(x);const w=document.createElement("button");w.type="button",w.className="gstop-del",w.innerHTML=xf,w.disabled=(((I=(v=this.value)==null?void 0:v.stops)==null?void 0:I.length)||0)<=2,s.appendChild(o),s.appendChild(c),s.appendChild(w),r.appendChild(s),h.addEventListener("click",L=>{L.preventDefault(),L.stopPropagation();const _=this.getSharedStopColorPicker();_.getIsOpen()&&_.close(!1),this.colorPickerStopIndex=i,_.setOnChange((M,N)=>{this.clearGlobalBindingForCustomChange(),d.value=M.replace("#","").toUpperCase(),this.value.stops[i].color=M;const z=N!==void 0?N:this.value.stops[i].opacity??100;N!==void 0&&(this.value.stops[i].opacity=N,x.value=`${N}%`);const B=pt(M);p.style.backgroundColor=`rgba(${B.r}, ${B.g}, ${B.b}, ${z/100})`,z<100?h.classList.add("has-transparency"):h.classList.remove("has-transparency"),this.updateGradientPreview(),this.createHandles(this.popoverEl.querySelector(".gradient-handles"),this.popoverEl.querySelector(".gradient-preview")),this.updateUI(),this.triggerChange()});const C=this.resolveGlobalVarColor(n.color);_.open(C,h,n.opacity??100)}),d.addEventListener("input",()=>{this.clearGlobalBindingForCustomChange();const L=d.value.trim(),_=L.startsWith("#")?L:`#${L}`;if(/^#[0-9A-Fa-f]{6}$/.test(_)){this.value.stops[i].color=_;const C=this.value.stops[i].opacity??100,M=pt(_);p.style.backgroundColor=`rgba(${M.r}, ${M.g}, ${M.b}, ${C/100})`,this.debouncedPreviewUpdate()}}),d.addEventListener("blur",()=>{this.previewUpdateTimeout&&(clearTimeout(this.previewUpdateTimeout),this.previewUpdateTimeout=null),this.updateGradientPreview(),this.updateUI(),this.triggerChange()}),x.addEventListener("focus",L=>{const _=L.target;_.value=_.value.replace("%",""),setTimeout(()=>_.select(),0)}),x.addEventListener("input",()=>{this.clearGlobalBindingForCustomChange();const L=x.value.replace(/[^\d]/g,""),_=parseInt(L,10);if(!Number.isNaN(_)){const C=Math.max(0,Math.min(100,_));this.value.stops[i].opacity=C;const M=this.resolveGlobalVarColor(this.value.stops[i].color),N=pt(M);p.style.backgroundColor=`rgba(${N.r}, ${N.g}, ${N.b}, ${C/100})`,C<100?h.classList.add("has-transparency"):h.classList.remove("has-transparency"),this.debouncedPreviewUpdate()}}),x.addEventListener("blur",()=>{x.value=`${this.value.stops[i].opacity??100}%`,this.previewUpdateTimeout&&(clearTimeout(this.previewUpdateTimeout),this.previewUpdateTimeout=null),this.updateGradientPreview(),this.createHandles(this.popoverEl.querySelector(".gradient-handles"),this.popoverEl.querySelector(".gradient-preview")),this.updateUI(),this.triggerChange()}),x.addEventListener("keydown",L=>{L.key==="Enter"&&(L.preventDefault(),x.blur())}),l.addEventListener("focus",L=>{const _=L.target;_.value=_.value.replace("%",""),_.select()}),l.addEventListener("input",L=>{this.clearGlobalBindingForCustomChange();const _=L.target,C=parseInt(_.value.replace(/[^\d]/g,""),10);if(!Number.isNaN(C)){const M=Math.max(0,Math.min(100,C));this.value.stops[i].position=M,_.value=`${M}%`,this.debouncedPreviewUpdate()}}),l.addEventListener("blur",L=>{this.previewUpdateTimeout&&(clearTimeout(this.previewUpdateTimeout),this.previewUpdateTimeout=null);const _=L.target,C=parseInt(_.value.replace(/[^\d]/g,""),10);if(Number.isNaN(C))_.value=`${this.value.stops[i].position}%`;else{const M=Math.max(0,Math.min(100,C));this.value.stops[i].position=M,_.value=`${M}%`}this.updateGradientPreview(),this.createHandles(this.popoverEl.querySelector(".gradient-handles"),this.popoverEl.querySelector(".gradient-preview")),this.updateStopsList(),this.updateUI(),this.triggerChange()}),w.addEventListener("click",()=>{var L,_;(this.value.stops.length||0)<=2||((L=this.sharedStopColorPicker)!=null&&L.getIsOpen()&&this.colorPickerStopIndex===i?(this.sharedStopColorPicker.close(!1),this.colorPickerStopIndex=null):this.colorPickerStopIndex!==null&&this.colorPickerStopIndex>i&&this.colorPickerStopIndex--,this.clearGlobalBindingForCustomChange(),this.value.stops.splice(i,1),this.createHandles(this.popoverEl.querySelector(".gradient-handles"),this.popoverEl.querySelector(".gradient-preview")),this.updateStopsList(),this.updateGradientPreview(),this.updateUI(),((_=document.activeElement)==null?void 0:_.tagName)!=="INPUT"&&this.repositionPopover(),this.triggerChange())})}))}addStop(){if(!this.value||this.value.type==="solid"||!this.value.stops)return;const e=this.value.stops.map(n=>n.position).sort((n,i)=>n-i);let r=50,a=0;for(let n=0;n<e.length-1;n++){const i=e[n+1]-e[n];i>a&&(a=i,r=e[n]+i/2)}this.addStopAtPosition(r)}addStopAtPosition(e){if(!this.value||this.value.type==="solid"||!this.value.stops)return;const r=Math.max(0,Math.min(100,e)),a=[...this.value.stops].sort((c,f)=>c.position-f.position);let n=a[0],i=a[a.length-1];for(let c=0;c<a.length-1;c++)if(a[c].position<=r&&a[c+1].position>=r){n=a[c],i=a[c+1];break}let s,o;if(n===i||n.position===i.position)s=n.color,o=n.opacity??100;else{const c=(r-n.position)/(i.position-n.position),f=pt(n.color),u=pt(i.color),h=Math.round(f.r+(u.r-f.r)*c),p=Math.round(f.g+(u.g-f.g)*c),m=Math.round(f.b+(u.b-f.b)*c);s=`#${h.toString(16).padStart(2,"0")}${p.toString(16).padStart(2,"0")}${m.toString(16).padStart(2,"0")}`.toUpperCase(),o=Math.round((n.opacity??100)+((i.opacity??100)-(n.opacity??100))*c)}const l={position:Math.round(r),color:s,opacity:o};this.value.stops.push(l),this.value.stops.sort((c,f)=>c.position-f.position)}openPopover(){if(this.popoverEl&&(er.openInstance&&er.openInstance!==this&&er.openInstance.closePopover(),!this.isPopoverOpen)){if(this.isPopoverOpen=!0,er.openInstance=this,this.backdropEl&&(this.backdropEl.style.display="block",this.backdropEl.parentElement||document.body.appendChild(this.backdropEl)),this.popoverEl.style.display="flex",this.refreshPopoverContent(),this.element){const e=this.element.getBoundingClientRect(),r=306,a=window.innerWidth,n=window.innerHeight,i=16;this.popoverEl.style.position="fixed",this.popoverEl.style.zIndex="10000",this.popoverEl.style.left="-9999px",this.popoverEl.style.top="0px";const s=this.popoverEl.offsetHeight;let o=e.right+8,l=e.top;const c=a-e.right,f=e.left,u=r+i;c<u&&f>c+100&&(o=e.left-r-8);const h=n-e.bottom,p=e.top;p>=s+i?l=e.top-s-8:h>=s+i?l=e.bottom+8:p>h?(l=e.top-s-8,l<i&&(l=i)):(l=e.bottom+8,l+s>n-i&&(l=n-s-i)),this.popoverEl.style.left=`${o}px`,this.popoverEl.style.top=`${l}px`,this.popoverPosition={left:o,top:l}}setTimeout(()=>document.addEventListener("click",this.onBackgroundClick,!0),200),document.addEventListener("keydown",this.handlePopoverKeydown,!0)}}repositionPopover(){var e;if(!(!this.popoverEl||!this.isPopoverOpen||!this.element)&&((e=document.activeElement)==null?void 0:e.tagName)!=="INPUT"){if(this.popoverPosition){this.popoverEl.style.left=`${this.popoverPosition.left}px`,this.popoverEl.style.top=`${this.popoverPosition.top}px`;return}requestAnimationFrame(()=>{if(!this.popoverEl||!this.element)return;const r=this.element.getBoundingClientRect(),a=306,n=window.innerWidth,i=window.innerHeight,s=16;this.popoverEl.style.left,this.popoverEl.style.top,this.popoverEl.style.left="-9999px",this.popoverEl.style.top="0px";const o=this.popoverEl.offsetHeight;let l=r.right+8,c=r.top;const f=n-r.right,u=r.left,h=a+s;f<h&&u>f+100&&(l=r.left-a-8);const p=i-r.bottom,m=r.top;m>=o+s?c=r.top-o-8:p>=o+s?c=r.bottom+8:m>p?(c=r.top-o-8,c<s&&(c=s)):(c=r.bottom+8,c+o>i-s&&(c=i-o-s)),this.popoverEl.style.left=`${l}px`,this.popoverEl.style.top=`${c}px`})}}refreshPopoverContent(){var i,s;if(!this.popoverEl)return;const e=this.popoverEl.querySelectorAll(".gradient-type-tab");e.forEach(o=>o.classList.remove("active"));const r=e[0],a=e[1];((i=this.value)==null?void 0:i.type)==="solid"?r.classList.add("active"):(a.classList.add("active"),(s=this.recentGradientRefresh)==null||s.call(this)),this.popoverEl.offsetHeight;const n=this.popoverEl.querySelector(".gradient-editor-content");n&&this.updatePopoverContent(n)}closePopover(){var e,r;if(!(!this.popoverEl||!this.isPopoverOpen)){if(this.isPopoverOpen=!1,this.popoverPosition=null,(e=this.sharedStopColorPicker)!=null&&e.getIsOpen()&&(this.sharedStopColorPicker.close(!0),this.colorPickerStopIndex=null),this.backdropEl&&(this.backdropEl.style.display="none"),this.popoverEl.style.display="none",document.removeEventListener("click",this.onBackgroundClick,!0),document.removeEventListener("keydown",this.handlePopoverKeydown,!0),this.commitPendingSolidColor(),this.value&&this.value.type!=="solid"){const a=this.resolveGradientGlobalVars(this.value),n=Zt(a);aa.addColor(n,"gradient"),(r=this.recentGradientRefresh)==null||r.call(this)}this.previewUpdateTimeout&&(clearTimeout(this.previewUpdateTimeout),this.previewUpdateTimeout=null),er.openInstance===this&&(er.openInstance=null)}}commitPendingSolidColor(){if(this.pendingSolidColor){if(this.solidPicker)this.solidPicker.commitRecentColor();else{const e=this.resolveGlobalVarColor(this.pendingSolidColor);aa.addColor(e,"solid")}this.pendingSolidColor=null}}handlePaste(e){var a;e.preventDefault();const r=((a=e.clipboardData)==null?void 0:a.getData("text"))||"";this.parseAndSet(r)}handleTextInput(e){const r=e.target;this.parseAndSet(r.value)}parseAndSet(e){let r=e.trim();r&&!r.startsWith("#")&&!r.startsWith("var(")&&!r.startsWith("rgb")&&!r.startsWith("hsl")&&!r.includes("gradient")&&/^[0-9A-Fa-f]{3}$|^[0-9A-Fa-f]{6}$|^[0-9A-Fa-f]{8}$/.test(r)&&(r="#"+r,this.inputEl&&(this.inputEl.value=r));const a=At(r);a&&this.setValue(a)}getChangePayload(){var e;if(this.value)return this.isBoundToGlobal()?((e=this.value.stops)==null?void 0:e.some(a=>a.opacity!==void 0&&a.opacity!==100))?this.resolveGradientGlobalVars(this.value):this.linkedGlobalVariable||void 0:this.value}triggerChange(){var r;const e=this.getChangePayload();debugger;(r=this.onColorChange)==null||r.call(this,this.getValue()),e!==void 0&&(this.changeDebounceTimeout&&clearTimeout(this.changeDebounceTimeout),this.changeDebounceTimeout=setTimeout(()=>{var a,n;(a=this.onChange)==null||a.call(this,e),(n=this.detectChange)==null||n.call(this,e),this.changeDebounceTimeout=null},er.CHANGE_DEBOUNCE_DELAY))}getElement(){return this.element}getValue(){const e=this.getChangePayload();return e?typeof e=="string"?e:Zt(e):""}getCSSValue(){const e=this.getChangePayload();return e?typeof e=="string"?e:Zt(e):""}getCSSForText(){return this.value?this.cssForTextValue():{}}getRawValue(){return this.value}};er.openInstance=null,er.CHANGE_DEBOUNCE_DELAY=150;let na=er;/*! xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */var zn={};zn.version="0.18.5";var T0=1252,_f=[874,932,936,949,950,1250,1251,1252,1253,1254,1255,1256,1257,1258,1e4],ss={0:1252,1:65001,2:65001,77:1e4,128:932,129:949,130:1361,134:936,136:950,161:1253,162:1254,163:1258,177:1255,178:1256,186:1257,204:1251,222:874,238:1250,255:1252,69:6969},os=function(t){_f.indexOf(t)!=-1&&(T0=ss[0]=t)};function Tf(){os(1252)}var ar=function(t){os(t)};function ls(){ar(1200),Tf()}function no(t){for(var e=[],r=0,a=t.length;r<a;++r)e[r]=t.charCodeAt(r);return e}function Sf(t){for(var e=[],r=0;r<t.length>>1;++r)e[r]=String.fromCharCode(t.charCodeAt(2*r)+(t.charCodeAt(2*r+1)<<8));return e.join("")}function S0(t){for(var e=[],r=0;r<t.length>>1;++r)e[r]=String.fromCharCode(t.charCodeAt(2*r+1)+(t.charCodeAt(2*r)<<8));return e.join("")}var $a=function(t){var e=t.charCodeAt(0),r=t.charCodeAt(1);return e==255&&r==254?Sf(t.slice(2)):e==254&&r==255?S0(t.slice(2)):e==65279?t.slice(1):t},bn=function(e){return String.fromCharCode(e)},io=function(e){return String.fromCharCode(e)},Ui,Or="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function an(t){for(var e="",r=0,a=0,n=0,i=0,s=0,o=0,l=0,c=0;c<t.length;)r=t.charCodeAt(c++),i=r>>2,a=t.charCodeAt(c++),s=(r&3)<<4|a>>4,n=t.charCodeAt(c++),o=(a&15)<<2|n>>6,l=n&63,isNaN(a)?o=l=64:isNaN(n)&&(l=64),e+=Or.charAt(i)+Or.charAt(s)+Or.charAt(o)+Or.charAt(l);return e}function Bt(t){var e="",r=0,a=0,n=0,i=0,s=0,o=0,l=0;t=t.replace(/[^\w\+\/\=]/g,"");for(var c=0;c<t.length;)i=Or.indexOf(t.charAt(c++)),s=Or.indexOf(t.charAt(c++)),r=i<<2|s>>4,e+=String.fromCharCode(r),o=Or.indexOf(t.charAt(c++)),a=(s&15)<<4|o>>2,o!==64&&(e+=String.fromCharCode(a)),l=Or.indexOf(t.charAt(c++)),n=(o&3)<<6|l,l!==64&&(e+=String.fromCharCode(n));return e}var _e=function(){return typeof Buffer<"u"&&typeof process<"u"&&typeof process.versions<"u"&&!!process.versions.node}(),Lr=function(){if(typeof Buffer<"u"){var t=!Buffer.from;if(!t)try{Buffer.from("foo","utf8")}catch{t=!0}return t?function(e,r){return r?new Buffer(e,r):new Buffer(e)}:Buffer.from.bind(Buffer)}return function(){}}();function Dr(t){return _e?Buffer.alloc?Buffer.alloc(t):new Buffer(t):typeof Uint8Array<"u"?new Uint8Array(t):new Array(t)}function so(t){return _e?Buffer.allocUnsafe?Buffer.allocUnsafe(t):new Buffer(t):typeof Uint8Array<"u"?new Uint8Array(t):new Array(t)}var Dt=function(e){return _e?Lr(e,"binary"):e.split("").map(function(r){return r.charCodeAt(0)&255})};function fi(t){if(typeof ArrayBuffer>"u")return Dt(t);for(var e=new ArrayBuffer(t.length),r=new Uint8Array(e),a=0;a!=t.length;++a)r[a]=t.charCodeAt(a)&255;return e}function Hr(t){if(Array.isArray(t))return t.map(function(a){return String.fromCharCode(a)}).join("");for(var e=[],r=0;r<t.length;++r)e[r]=String.fromCharCode(t[r]);return e.join("")}function bf(t){if(typeof Uint8Array>"u")throw new Error("Unsupported");return new Uint8Array(t)}function cs(t){if(typeof ArrayBuffer>"u")throw new Error("Unsupported");if(t instanceof ArrayBuffer)return cs(new Uint8Array(t));for(var e=new Array(t.length),r=0;r<t.length;++r)e[r]=t[r];return e}var ft=_e?function(t){return Buffer.concat(t.map(function(e){return Buffer.isBuffer(e)?e:Lr(e)}))}:function(t){if(typeof Uint8Array<"u"){var e=0,r=0;for(e=0;e<t.length;++e)r+=t[e].length;var a=new Uint8Array(r),n=0;for(e=0,r=0;e<t.length;r+=n,++e)if(n=t[e].length,t[e]instanceof Uint8Array)a.set(t[e],r);else{if(typeof t[e]=="string")throw"wtf";a.set(new Uint8Array(t[e]),r)}return a}return[].concat.apply([],t.map(function(i){return Array.isArray(i)?i:[].slice.call(i)}))};function Lf(t){for(var e=[],r=0,a=t.length+250,n=Dr(t.length+255),i=0;i<t.length;++i){var s=t.charCodeAt(i);if(s<128)n[r++]=s;else if(s<2048)n[r++]=192|s>>6&31,n[r++]=128|s&63;else if(s>=55296&&s<57344){s=(s&1023)+64;var o=t.charCodeAt(++i)&1023;n[r++]=240|s>>8&7,n[r++]=128|s>>2&63,n[r++]=128|o>>6&15|(s&3)<<4,n[r++]=128|o&63}else n[r++]=224|s>>12&15,n[r++]=128|s>>6&63,n[r++]=128|s&63;r>a&&(e.push(n.slice(0,r)),r=0,n=Dr(65535),a=65530)}return e.push(n.slice(0,r)),ft(e)}var Lt=/\u0000/g,Wa=/[\u0001-\u0006]/g;function Ta(t){for(var e="",r=t.length-1;r>=0;)e+=t.charAt(r--);return e}function nr(t,e){var r=""+t;return r.length>=e?r:Ke("0",e-r.length)+r}function fs(t,e){var r=""+t;return r.length>=e?r:Ke(" ",e-r.length)+r}function Xn(t,e){var r=""+t;return r.length>=e?r:r+Ke(" ",e-r.length)}function Ff(t,e){var r=""+Math.round(t);return r.length>=e?r:Ke("0",e-r.length)+r}function Af(t,e){var r=""+t;return r.length>=e?r:Ke("0",e-r.length)+r}var oo=Math.pow(2,32);function xa(t,e){if(t>oo||t<-oo)return Ff(t,e);var r=Math.round(t);return Af(r,e)}function jn(t,e){return e=e||0,t.length>=7+e&&(t.charCodeAt(e)|32)===103&&(t.charCodeAt(e+1)|32)===101&&(t.charCodeAt(e+2)|32)===110&&(t.charCodeAt(e+3)|32)===101&&(t.charCodeAt(e+4)|32)===114&&(t.charCodeAt(e+5)|32)===97&&(t.charCodeAt(e+6)|32)===108}var lo=[["Sun","Sunday"],["Mon","Monday"],["Tue","Tuesday"],["Wed","Wednesday"],["Thu","Thursday"],["Fri","Friday"],["Sat","Saturday"]],Ci=[["J","Jan","January"],["F","Feb","February"],["M","Mar","March"],["A","Apr","April"],["M","May","May"],["J","Jun","June"],["J","Jul","July"],["A","Aug","August"],["S","Sep","September"],["O","Oct","October"],["N","Nov","November"],["D","Dec","December"]];function If(t){return t||(t={}),t[0]="General",t[1]="0",t[2]="0.00",t[3]="#,##0",t[4]="#,##0.00",t[9]="0%",t[10]="0.00%",t[11]="0.00E+00",t[12]="# ?/?",t[13]="# ??/??",t[14]="m/d/yy",t[15]="d-mmm-yy",t[16]="d-mmm",t[17]="mmm-yy",t[18]="h:mm AM/PM",t[19]="h:mm:ss AM/PM",t[20]="h:mm",t[21]="h:mm:ss",t[22]="m/d/yy h:mm",t[37]="#,##0 ;(#,##0)",t[38]="#,##0 ;[Red](#,##0)",t[39]="#,##0.00;(#,##0.00)",t[40]="#,##0.00;[Red](#,##0.00)",t[45]="mm:ss",t[46]="[h]:mm:ss",t[47]="mmss.0",t[48]="##0.0E+0",t[49]="@",t[56]='"上午/下午 "hh"時"mm"分"ss"秒 "',t}var ge={0:"General",1:"0",2:"0.00",3:"#,##0",4:"#,##0.00",9:"0%",10:"0.00%",11:"0.00E+00",12:"# ?/?",13:"# ??/??",14:"m/d/yy",15:"d-mmm-yy",16:"d-mmm",17:"mmm-yy",18:"h:mm AM/PM",19:"h:mm:ss AM/PM",20:"h:mm",21:"h:mm:ss",22:"m/d/yy h:mm",37:"#,##0 ;(#,##0)",38:"#,##0 ;[Red](#,##0)",39:"#,##0.00;(#,##0.00)",40:"#,##0.00;[Red](#,##0.00)",45:"mm:ss",46:"[h]:mm:ss",47:"mmss.0",48:"##0.0E+0",49:"@",56:'"上午/下午 "hh"時"mm"分"ss"秒 "'},co={5:37,6:38,7:39,8:40,23:0,24:0,25:0,26:0,27:14,28:14,29:14,30:14,31:14,50:14,51:14,52:14,53:14,54:14,55:14,56:14,57:14,58:14,59:1,60:2,61:3,62:4,67:9,68:10,69:12,70:13,71:14,72:14,73:15,74:16,75:17,76:20,77:21,78:22,79:45,80:46,81:47,82:0},Nf={5:'"$"#,##0_);\\("$"#,##0\\)',63:'"$"#,##0_);\\("$"#,##0\\)',6:'"$"#,##0_);[Red]\\("$"#,##0\\)',64:'"$"#,##0_);[Red]\\("$"#,##0\\)',7:'"$"#,##0.00_);\\("$"#,##0.00\\)',65:'"$"#,##0.00_);\\("$"#,##0.00\\)',8:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',66:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',41:'_(* #,##0_);_(* \\(#,##0\\);_(* "-"_);_(@_)',42:'_("$"* #,##0_);_("$"* \\(#,##0\\);_("$"* "-"_);_(@_)',43:'_(* #,##0.00_);_(* \\(#,##0.00\\);_(* "-"??_);_(@_)',44:'_("$"* #,##0.00_);_("$"* \\(#,##0.00\\);_("$"* "-"??_);_(@_)'};function Kn(t,e,r){for(var a=t<0?-1:1,n=t*a,i=0,s=1,o=0,l=1,c=0,f=0,u=Math.floor(n);c<e&&(u=Math.floor(n),o=u*s+i,f=u*c+l,!(n-u<5e-8));)n=1/(n-u),i=s,s=o,l=c,c=f;if(f>e&&(c>e?(f=l,o=i):(f=c,o=s)),!r)return[0,a*o,f];var h=Math.floor(a*o/f);return[h,a*o-h*f,f]}function Kr(t,e,r){if(t>2958465||t<0)return null;var a=t|0,n=Math.floor(86400*(t-a)),i=0,s=[],o={D:a,T:n,u:86400*(t-a)-n,y:0,m:0,d:0,H:0,M:0,S:0,q:0};if(Math.abs(o.u)<1e-6&&(o.u=0),e&&e.date1904&&(a+=1462),o.u>.9999&&(o.u=0,++n==86400&&(o.T=n=0,++a,++o.D)),a===60)s=r?[1317,10,29]:[1900,2,29],i=3;else if(a===0)s=r?[1317,8,29]:[1900,1,0],i=6;else{a>60&&--a;var l=new Date(1900,0,1);l.setDate(l.getDate()+a-1),s=[l.getFullYear(),l.getMonth()+1,l.getDate()],i=l.getDay(),a<60&&(i=(i+6)%7),r&&(i=Bf(l,s))}return o.y=s[0],o.m=s[1],o.d=s[2],o.S=n%60,n=Math.floor(n/60),o.M=n%60,n=Math.floor(n/60),o.H=n,o.q=i,o}var b0=new Date(1899,11,31,0,0,0),Mf=b0.getTime(),Of=new Date(1900,2,1,0,0,0);function L0(t,e){var r=t.getTime();return e?r-=1461*24*60*60*1e3:t>=Of&&(r+=24*60*60*1e3),(r-(Mf+(t.getTimezoneOffset()-b0.getTimezoneOffset())*6e4))/(24*60*60*1e3)}function hs(t){return t.indexOf(".")==-1?t:t.replace(/(?:\.0*|(\.\d*[1-9])0+)$/,"$1")}function Pf(t){return t.indexOf("E")==-1?t:t.replace(/(?:\.0*|(\.\d*[1-9])0+)[Ee]/,"$1E").replace(/(E[+-])(\d)$/,"$10$2")}function Df(t){var e=t<0?12:11,r=hs(t.toFixed(12));return r.length<=e||(r=t.toPrecision(10),r.length<=e)?r:t.toExponential(5)}function Rf(t){var e=hs(t.toFixed(11));return e.length>(t<0?12:11)||e==="0"||e==="-0"?t.toPrecision(6):e}function nn(t){var e=Math.floor(Math.log(Math.abs(t))*Math.LOG10E),r;return e>=-4&&e<=-1?r=t.toPrecision(10+e):Math.abs(e)<=9?r=Df(t):e===10?r=t.toFixed(10).substr(0,12):r=Rf(t),hs(Pf(r.toUpperCase()))}function ia(t,e){switch(typeof t){case"string":return t;case"boolean":return t?"TRUE":"FALSE";case"number":return(t|0)===t?t.toString(10):nn(t);case"undefined":return"";case"object":if(t==null)return"";if(t instanceof Date)return Kt(14,L0(t,e&&e.date1904),e)}throw new Error("unsupported value in General format: "+t)}function Bf(t,e){e[0]-=581;var r=t.getDay();return t<60&&(r=(r+6)%7),r}function Vf(t,e,r,a){var n="",i=0,s=0,o=r.y,l,c=0;switch(t){case 98:o=r.y+543;case 121:switch(e.length){case 1:case 2:l=o%100,c=2;break;default:l=o%1e4,c=4;break}break;case 109:switch(e.length){case 1:case 2:l=r.m,c=e.length;break;case 3:return Ci[r.m-1][1];case 5:return Ci[r.m-1][0];default:return Ci[r.m-1][2]}break;case 100:switch(e.length){case 1:case 2:l=r.d,c=e.length;break;case 3:return lo[r.q][0];default:return lo[r.q][1]}break;case 104:switch(e.length){case 1:case 2:l=1+(r.H+11)%12,c=e.length;break;default:throw"bad hour format: "+e}break;case 72:switch(e.length){case 1:case 2:l=r.H,c=e.length;break;default:throw"bad hour format: "+e}break;case 77:switch(e.length){case 1:case 2:l=r.M,c=e.length;break;default:throw"bad minute format: "+e}break;case 115:if(e!="s"&&e!="ss"&&e!=".0"&&e!=".00"&&e!=".000")throw"bad second format: "+e;return r.u===0&&(e=="s"||e=="ss")?nr(r.S,e.length):(a>=2?s=a===3?1e3:100:s=a===1?10:1,i=Math.round(s*(r.S+r.u)),i>=60*s&&(i=0),e==="s"?i===0?"0":""+i/s:(n=nr(i,2+a),e==="ss"?n.substr(0,2):"."+n.substr(2,e.length-1)));case 90:switch(e){case"[h]":case"[hh]":l=r.D*24+r.H;break;case"[m]":case"[mm]":l=(r.D*24+r.H)*60+r.M;break;case"[s]":case"[ss]":l=((r.D*24+r.H)*60+r.M)*60+Math.round(r.S+r.u);break;default:throw"bad abstime format: "+e}c=e.length===3?1:2;break;case 101:l=o,c=1;break}var f=c>0?nr(l,c):"";return f}function Pr(t){var e=3;if(t.length<=e)return t;for(var r=t.length%e,a=t.substr(0,r);r!=t.length;r+=e)a+=(a.length>0?",":"")+t.substr(r,e);return a}var F0=/%/g;function Hf(t,e,r){var a=e.replace(F0,""),n=e.length-a.length;return _r(t,a,r*Math.pow(10,2*n))+Ke("%",n)}function Uf(t,e,r){for(var a=e.length-1;e.charCodeAt(a-1)===44;)--a;return _r(t,e.substr(0,a),r/Math.pow(10,3*(e.length-a)))}function A0(t,e){var r,a=t.indexOf("E")-t.indexOf(".")-1;if(t.match(/^#+0.0E\+0$/)){if(e==0)return"0.0E+0";if(e<0)return"-"+A0(t,-e);var n=t.indexOf(".");n===-1&&(n=t.indexOf("E"));var i=Math.floor(Math.log(e)*Math.LOG10E)%n;if(i<0&&(i+=n),r=(e/Math.pow(10,i)).toPrecision(a+1+(n+i)%n),r.indexOf("e")===-1){var s=Math.floor(Math.log(e)*Math.LOG10E);for(r.indexOf(".")===-1?r=r.charAt(0)+"."+r.substr(1)+"E+"+(s-r.length+i):r+="E+"+(s-i);r.substr(0,2)==="0.";)r=r.charAt(0)+r.substr(2,n)+"."+r.substr(2+n),r=r.replace(/^0+([1-9])/,"$1").replace(/^0+\./,"0.");r=r.replace(/\+-/,"-")}r=r.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,function(o,l,c,f){return l+c+f.substr(0,(n+i)%n)+"."+f.substr(i)+"E"})}else r=e.toExponential(a);return t.match(/E\+00$/)&&r.match(/e[+-]\d$/)&&(r=r.substr(0,r.length-1)+"0"+r.charAt(r.length-1)),t.match(/E\-/)&&r.match(/e\+/)&&(r=r.replace(/e\+/,"e")),r.replace("e","E")}var I0=/# (\?+)( ?)\/( ?)(\d+)/;function $f(t,e,r){var a=parseInt(t[4],10),n=Math.round(e*a),i=Math.floor(n/a),s=n-i*a,o=a;return r+(i===0?"":""+i)+" "+(s===0?Ke(" ",t[1].length+1+t[4].length):fs(s,t[1].length)+t[2]+"/"+t[3]+nr(o,t[4].length))}function Wf(t,e,r){return r+(e===0?"":""+e)+Ke(" ",t[1].length+2+t[4].length)}var N0=/^#*0*\.([0#]+)/,M0=/\).*[0#]/,O0=/\(###\) ###\\?-####/;function St(t){for(var e="",r,a=0;a!=t.length;++a)switch(r=t.charCodeAt(a)){case 35:break;case 63:e+=" ";break;case 48:e+="0";break;default:e+=String.fromCharCode(r)}return e}function fo(t,e){var r=Math.pow(10,e);return""+Math.round(t*r)/r}function ho(t,e){var r=t-Math.floor(t),a=Math.pow(10,e);return e<(""+Math.round(r*a)).length?0:Math.round(r*a)}function Gf(t,e){return e<(""+Math.round((t-Math.floor(t))*Math.pow(10,e))).length?1:0}function zf(t){return t<2147483647&&t>-2147483648?""+(t>=0?t|0:t-1|0):""+Math.floor(t)}function $t(t,e,r){if(t.charCodeAt(0)===40&&!e.match(M0)){var a=e.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return r>=0?$t("n",a,r):"("+$t("n",a,-r)+")"}if(e.charCodeAt(e.length-1)===44)return Uf(t,e,r);if(e.indexOf("%")!==-1)return Hf(t,e,r);if(e.indexOf("E")!==-1)return A0(e,r);if(e.charCodeAt(0)===36)return"$"+$t(t,e.substr(e.charAt(1)==" "?2:1),r);var n,i,s,o,l=Math.abs(r),c=r<0?"-":"";if(e.match(/^00+$/))return c+xa(l,e.length);if(e.match(/^[#?]+$/))return n=xa(r,0),n==="0"&&(n=""),n.length>e.length?n:St(e.substr(0,e.length-n.length))+n;if(i=e.match(I0))return $f(i,l,c);if(e.match(/^#+0+$/))return c+xa(l,e.length-e.indexOf("0"));if(i=e.match(N0))return n=fo(r,i[1].length).replace(/^([^\.]+)$/,"$1."+St(i[1])).replace(/\.$/,"."+St(i[1])).replace(/\.(\d*)$/,function(m,d){return"."+d+Ke("0",St(i[1]).length-d.length)}),e.indexOf("0.")!==-1?n:n.replace(/^0\./,".");if(e=e.replace(/^#+([0.])/,"$1"),i=e.match(/^(0*)\.(#*)$/))return c+fo(l,i[2].length).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,i[1].length?"0.":".");if(i=e.match(/^#{1,3},##0(\.?)$/))return c+Pr(xa(l,0));if(i=e.match(/^#,##0\.([#0]*0)$/))return r<0?"-"+$t(t,e,-r):Pr(""+(Math.floor(r)+Gf(r,i[1].length)))+"."+nr(ho(r,i[1].length),i[1].length);if(i=e.match(/^#,#*,#0/))return $t(t,e.replace(/^#,#*,/,""),r);if(i=e.match(/^([0#]+)(\\?-([0#]+))+$/))return n=Ta($t(t,e.replace(/[\\-]/g,""),r)),s=0,Ta(Ta(e.replace(/\\/g,"")).replace(/[0#]/g,function(m){return s<n.length?n.charAt(s++):m==="0"?"0":""}));if(e.match(O0))return n=$t(t,"##########",r),"("+n.substr(0,3)+") "+n.substr(3,3)+"-"+n.substr(6);var f="";if(i=e.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return s=Math.min(i[4].length,7),o=Kn(l,Math.pow(10,s)-1,!1),n=""+c,f=_r("n",i[1],o[1]),f.charAt(f.length-1)==" "&&(f=f.substr(0,f.length-1)+"0"),n+=f+i[2]+"/"+i[3],f=Xn(o[2],s),f.length<i[4].length&&(f=St(i[4].substr(i[4].length-f.length))+f),n+=f,n;if(i=e.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return s=Math.min(Math.max(i[1].length,i[4].length),7),o=Kn(l,Math.pow(10,s)-1,!0),c+(o[0]||(o[1]?"":"0"))+" "+(o[1]?fs(o[1],s)+i[2]+"/"+i[3]+Xn(o[2],s):Ke(" ",2*s+1+i[2].length+i[3].length));if(i=e.match(/^[#0?]+$/))return n=xa(r,0),e.length<=n.length?n:St(e.substr(0,e.length-n.length))+n;if(i=e.match(/^([#0?]+)\.([#0]+)$/)){n=""+r.toFixed(Math.min(i[2].length,10)).replace(/([^0])0+$/,"$1"),s=n.indexOf(".");var u=e.indexOf(".")-s,h=e.length-n.length-u;return St(e.substr(0,u)+n+e.substr(e.length-h))}if(i=e.match(/^00,000\.([#0]*0)$/))return s=ho(r,i[1].length),r<0?"-"+$t(t,e,-r):Pr(zf(r)).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,function(m){return"00,"+(m.length<3?nr(0,3-m.length):"")+m})+"."+nr(s,i[1].length);switch(e){case"###,##0.00":return $t(t,"#,##0.00",r);case"###,###":case"##,###":case"#,###":var p=Pr(xa(l,0));return p!=="0"?c+p:"";case"###,###.00":return $t(t,"###,##0.00",r).replace(/^0\./,".");case"#,###.00":return $t(t,"#,##0.00",r).replace(/^0\./,".")}throw new Error("unsupported format |"+e+"|")}function Xf(t,e,r){for(var a=e.length-1;e.charCodeAt(a-1)===44;)--a;return _r(t,e.substr(0,a),r/Math.pow(10,3*(e.length-a)))}function jf(t,e,r){var a=e.replace(F0,""),n=e.length-a.length;return _r(t,a,r*Math.pow(10,2*n))+Ke("%",n)}function P0(t,e){var r,a=t.indexOf("E")-t.indexOf(".")-1;if(t.match(/^#+0.0E\+0$/)){if(e==0)return"0.0E+0";if(e<0)return"-"+P0(t,-e);var n=t.indexOf(".");n===-1&&(n=t.indexOf("E"));var i=Math.floor(Math.log(e)*Math.LOG10E)%n;if(i<0&&(i+=n),r=(e/Math.pow(10,i)).toPrecision(a+1+(n+i)%n),!r.match(/[Ee]/)){var s=Math.floor(Math.log(e)*Math.LOG10E);r.indexOf(".")===-1?r=r.charAt(0)+"."+r.substr(1)+"E+"+(s-r.length+i):r+="E+"+(s-i),r=r.replace(/\+-/,"-")}r=r.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,function(o,l,c,f){return l+c+f.substr(0,(n+i)%n)+"."+f.substr(i)+"E"})}else r=e.toExponential(a);return t.match(/E\+00$/)&&r.match(/e[+-]\d$/)&&(r=r.substr(0,r.length-1)+"0"+r.charAt(r.length-1)),t.match(/E\-/)&&r.match(/e\+/)&&(r=r.replace(/e\+/,"e")),r.replace("e","E")}function ur(t,e,r){if(t.charCodeAt(0)===40&&!e.match(M0)){var a=e.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return r>=0?ur("n",a,r):"("+ur("n",a,-r)+")"}if(e.charCodeAt(e.length-1)===44)return Xf(t,e,r);if(e.indexOf("%")!==-1)return jf(t,e,r);if(e.indexOf("E")!==-1)return P0(e,r);if(e.charCodeAt(0)===36)return"$"+ur(t,e.substr(e.charAt(1)==" "?2:1),r);var n,i,s,o,l=Math.abs(r),c=r<0?"-":"";if(e.match(/^00+$/))return c+nr(l,e.length);if(e.match(/^[#?]+$/))return n=""+r,r===0&&(n=""),n.length>e.length?n:St(e.substr(0,e.length-n.length))+n;if(i=e.match(I0))return Wf(i,l,c);if(e.match(/^#+0+$/))return c+nr(l,e.length-e.indexOf("0"));if(i=e.match(N0))return n=(""+r).replace(/^([^\.]+)$/,"$1."+St(i[1])).replace(/\.$/,"."+St(i[1])),n=n.replace(/\.(\d*)$/,function(m,d){return"."+d+Ke("0",St(i[1]).length-d.length)}),e.indexOf("0.")!==-1?n:n.replace(/^0\./,".");if(e=e.replace(/^#+([0.])/,"$1"),i=e.match(/^(0*)\.(#*)$/))return c+(""+l).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,i[1].length?"0.":".");if(i=e.match(/^#{1,3},##0(\.?)$/))return c+Pr(""+l);if(i=e.match(/^#,##0\.([#0]*0)$/))return r<0?"-"+ur(t,e,-r):Pr(""+r)+"."+Ke("0",i[1].length);if(i=e.match(/^#,#*,#0/))return ur(t,e.replace(/^#,#*,/,""),r);if(i=e.match(/^([0#]+)(\\?-([0#]+))+$/))return n=Ta(ur(t,e.replace(/[\\-]/g,""),r)),s=0,Ta(Ta(e.replace(/\\/g,"")).replace(/[0#]/g,function(m){return s<n.length?n.charAt(s++):m==="0"?"0":""}));if(e.match(O0))return n=ur(t,"##########",r),"("+n.substr(0,3)+") "+n.substr(3,3)+"-"+n.substr(6);var f="";if(i=e.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return s=Math.min(i[4].length,7),o=Kn(l,Math.pow(10,s)-1,!1),n=""+c,f=_r("n",i[1],o[1]),f.charAt(f.length-1)==" "&&(f=f.substr(0,f.length-1)+"0"),n+=f+i[2]+"/"+i[3],f=Xn(o[2],s),f.length<i[4].length&&(f=St(i[4].substr(i[4].length-f.length))+f),n+=f,n;if(i=e.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return s=Math.min(Math.max(i[1].length,i[4].length),7),o=Kn(l,Math.pow(10,s)-1,!0),c+(o[0]||(o[1]?"":"0"))+" "+(o[1]?fs(o[1],s)+i[2]+"/"+i[3]+Xn(o[2],s):Ke(" ",2*s+1+i[2].length+i[3].length));if(i=e.match(/^[#0?]+$/))return n=""+r,e.length<=n.length?n:St(e.substr(0,e.length-n.length))+n;if(i=e.match(/^([#0]+)\.([#0]+)$/)){n=""+r.toFixed(Math.min(i[2].length,10)).replace(/([^0])0+$/,"$1"),s=n.indexOf(".");var u=e.indexOf(".")-s,h=e.length-n.length-u;return St(e.substr(0,u)+n+e.substr(e.length-h))}if(i=e.match(/^00,000\.([#0]*0)$/))return r<0?"-"+ur(t,e,-r):Pr(""+r).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,function(m){return"00,"+(m.length<3?nr(0,3-m.length):"")+m})+"."+nr(0,i[1].length);switch(e){case"###,###":case"##,###":case"#,###":var p=Pr(""+l);return p!=="0"?c+p:"";default:if(e.match(/\.[0#?]*$/))return ur(t,e.slice(0,e.lastIndexOf(".")),r)+St(e.slice(e.lastIndexOf(".")))}throw new Error("unsupported format |"+e+"|")}function _r(t,e,r){return(r|0)===r?ur(t,e,r):$t(t,e,r)}function Kf(t){for(var e=[],r=!1,a=0,n=0;a<t.length;++a)switch(t.charCodeAt(a)){case 34:r=!r;break;case 95:case 42:case 92:++a;break;case 59:e[e.length]=t.substr(n,a-n),n=a+1}if(e[e.length]=t.substr(n),r===!0)throw new Error("Format |"+t+"| unterminated string ");return e}var D0=/\[[HhMmSs\u0E0A\u0E19\u0E17]*\]/;function Na(t){for(var e=0,r="",a="";e<t.length;)switch(r=t.charAt(e)){case"G":jn(t,e)&&(e+=6),e++;break;case'"':for(;t.charCodeAt(++e)!==34&&e<t.length;);++e;break;case"\\":e+=2;break;case"_":e+=2;break;case"@":++e;break;case"B":case"b":if(t.charAt(e+1)==="1"||t.charAt(e+1)==="2")return!0;case"M":case"D":case"Y":case"H":case"S":case"E":case"m":case"d":case"y":case"h":case"s":case"e":case"g":return!0;case"A":case"a":case"上":if(t.substr(e,3).toUpperCase()==="A/P"||t.substr(e,5).toUpperCase()==="AM/PM"||t.substr(e,5).toUpperCase()==="上午/下午")return!0;++e;break;case"[":for(a=r;t.charAt(e++)!=="]"&&e<t.length;)a+=t.charAt(e);if(a.match(D0))return!0;break;case".":case"0":case"#":for(;e<t.length&&("0#?.,E+-%".indexOf(r=t.charAt(++e))>-1||r=="\\"&&t.charAt(e+1)=="-"&&"0#".indexOf(t.charAt(e+2))>-1););break;case"?":for(;t.charAt(++e)===r;);break;case"*":++e,(t.charAt(e)==" "||t.charAt(e)=="*")&&++e;break;case"(":case")":++e;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(;e<t.length&&"0123456789".indexOf(t.charAt(++e))>-1;);break;case" ":++e;break;default:++e;break}return!1}function Yf(t,e,r,a){for(var n=[],i="",s=0,o="",l="t",c,f,u,h="H";s<t.length;)switch(o=t.charAt(s)){case"G":if(!jn(t,s))throw new Error("unrecognized character "+o+" in "+t);n[n.length]={t:"G",v:"General"},s+=7;break;case'"':for(i="";(u=t.charCodeAt(++s))!==34&&s<t.length;)i+=String.fromCharCode(u);n[n.length]={t:"t",v:i},++s;break;case"\\":var p=t.charAt(++s),m=p==="("||p===")"?p:"t";n[n.length]={t:m,v:p},++s;break;case"_":n[n.length]={t:"t",v:" "},s+=2;break;case"@":n[n.length]={t:"T",v:e},++s;break;case"B":case"b":if(t.charAt(s+1)==="1"||t.charAt(s+1)==="2"){if(c==null&&(c=Kr(e,r,t.charAt(s+1)==="2"),c==null))return"";n[n.length]={t:"X",v:t.substr(s,2)},l=o,s+=2;break}case"M":case"D":case"Y":case"H":case"S":case"E":o=o.toLowerCase();case"m":case"d":case"y":case"h":case"s":case"e":case"g":if(e<0||c==null&&(c=Kr(e,r),c==null))return"";for(i=o;++s<t.length&&t.charAt(s).toLowerCase()===o;)i+=o;o==="m"&&l.toLowerCase()==="h"&&(o="M"),o==="h"&&(o=h),n[n.length]={t:o,v:i},l=o;break;case"A":case"a":case"上":var d={t:o,v:o};if(c==null&&(c=Kr(e,r)),t.substr(s,3).toUpperCase()==="A/P"?(c!=null&&(d.v=c.H>=12?"P":"A"),d.t="T",h="h",s+=3):t.substr(s,5).toUpperCase()==="AM/PM"?(c!=null&&(d.v=c.H>=12?"PM":"AM"),d.t="T",s+=5,h="h"):t.substr(s,5).toUpperCase()==="上午/下午"?(c!=null&&(d.v=c.H>=12?"下午":"上午"),d.t="T",s+=5,h="h"):(d.t="t",++s),c==null&&d.t==="T")return"";n[n.length]=d,l=o;break;case"[":for(i=o;t.charAt(s++)!=="]"&&s<t.length;)i+=t.charAt(s);if(i.slice(-1)!=="]")throw'unterminated "[" block: |'+i+"|";if(i.match(D0)){if(c==null&&(c=Kr(e,r),c==null))return"";n[n.length]={t:"Z",v:i.toLowerCase()},l=i.charAt(1)}else i.indexOf("$")>-1&&(i=(i.match(/\$([^-\[\]]*)/)||[])[1]||"$",Na(t)||(n[n.length]={t:"t",v:i}));break;case".":if(c!=null){for(i=o;++s<t.length&&(o=t.charAt(s))==="0";)i+=o;n[n.length]={t:"s",v:i};break}case"0":case"#":for(i=o;++s<t.length&&"0#?.,E+-%".indexOf(o=t.charAt(s))>-1;)i+=o;n[n.length]={t:"n",v:i};break;case"?":for(i=o;t.charAt(++s)===o;)i+=o;n[n.length]={t:o,v:i},l=o;break;case"*":++s,(t.charAt(s)==" "||t.charAt(s)=="*")&&++s;break;case"(":case")":n[n.length]={t:a===1?"t":o,v:o},++s;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(i=o;s<t.length&&"0123456789".indexOf(t.charAt(++s))>-1;)i+=t.charAt(s);n[n.length]={t:"D",v:i};break;case" ":n[n.length]={t:o,v:o},++s;break;case"$":n[n.length]={t:"t",v:"$"},++s;break;default:if(",$-+/():!^&'~{}<>=€acfijklopqrtuvwxzP".indexOf(o)===-1)throw new Error("unrecognized character "+o+" in "+t);n[n.length]={t:"t",v:o},++s;break}var g=0,x=0,w;for(s=n.length-1,l="t";s>=0;--s)switch(n[s].t){case"h":case"H":n[s].t=h,l="h",g<1&&(g=1);break;case"s":(w=n[s].v.match(/\.0+$/))&&(x=Math.max(x,w[0].length-1)),g<3&&(g=3);case"d":case"y":case"M":case"e":l=n[s].t;break;case"m":l==="s"&&(n[s].t="M",g<2&&(g=2));break;case"X":break;case"Z":g<1&&n[s].v.match(/[Hh]/)&&(g=1),g<2&&n[s].v.match(/[Mm]/)&&(g=2),g<3&&n[s].v.match(/[Ss]/)&&(g=3)}switch(g){case 0:break;case 1:c.u>=.5&&(c.u=0,++c.S),c.S>=60&&(c.S=0,++c.M),c.M>=60&&(c.M=0,++c.H);break;case 2:c.u>=.5&&(c.u=0,++c.S),c.S>=60&&(c.S=0,++c.M);break}var v="",I;for(s=0;s<n.length;++s)switch(n[s].t){case"t":case"T":case" ":case"D":break;case"X":n[s].v="",n[s].t=";";break;case"d":case"m":case"y":case"h":case"H":case"M":case"s":case"e":case"b":case"Z":n[s].v=Vf(n[s].t.charCodeAt(0),n[s].v,c,x),n[s].t="t";break;case"n":case"?":for(I=s+1;n[I]!=null&&((o=n[I].t)==="?"||o==="D"||(o===" "||o==="t")&&n[I+1]!=null&&(n[I+1].t==="?"||n[I+1].t==="t"&&n[I+1].v==="/")||n[s].t==="("&&(o===" "||o==="n"||o===")")||o==="t"&&(n[I].v==="/"||n[I].v===" "&&n[I+1]!=null&&n[I+1].t=="?"));)n[s].v+=n[I].v,n[I]={v:"",t:";"},++I;v+=n[s].v,s=I-1;break;case"G":n[s].t="t",n[s].v=ia(e,r);break}var L="",_,C;if(v.length>0){v.charCodeAt(0)==40?(_=e<0&&v.charCodeAt(0)===45?-e:e,C=_r("n",v,_)):(_=e<0&&a>1?-e:e,C=_r("n",v,_),_<0&&n[0]&&n[0].t=="t"&&(C=C.substr(1),n[0].v="-"+n[0].v)),I=C.length-1;var M=n.length;for(s=0;s<n.length;++s)if(n[s]!=null&&n[s].t!="t"&&n[s].v.indexOf(".")>-1){M=s;break}var N=n.length;if(M===n.length&&C.indexOf("E")===-1){for(s=n.length-1;s>=0;--s)n[s]==null||"n?".indexOf(n[s].t)===-1||(I>=n[s].v.length-1?(I-=n[s].v.length,n[s].v=C.substr(I+1,n[s].v.length)):I<0?n[s].v="":(n[s].v=C.substr(0,I+1),I=-1),n[s].t="t",N=s);I>=0&&N<n.length&&(n[N].v=C.substr(0,I+1)+n[N].v)}else if(M!==n.length&&C.indexOf("E")===-1){for(I=C.indexOf(".")-1,s=M;s>=0;--s)if(!(n[s]==null||"n?".indexOf(n[s].t)===-1)){for(f=n[s].v.indexOf(".")>-1&&s===M?n[s].v.indexOf(".")-1:n[s].v.length-1,L=n[s].v.substr(f+1);f>=0;--f)I>=0&&(n[s].v.charAt(f)==="0"||n[s].v.charAt(f)==="#")&&(L=C.charAt(I--)+L);n[s].v=L,n[s].t="t",N=s}for(I>=0&&N<n.length&&(n[N].v=C.substr(0,I+1)+n[N].v),I=C.indexOf(".")+1,s=M;s<n.length;++s)if(!(n[s]==null||"n?(".indexOf(n[s].t)===-1&&s!==M)){for(f=n[s].v.indexOf(".")>-1&&s===M?n[s].v.indexOf(".")+1:0,L=n[s].v.substr(0,f);f<n[s].v.length;++f)I<C.length&&(L+=C.charAt(I++));n[s].v=L,n[s].t="t",N=s}}}for(s=0;s<n.length;++s)n[s]!=null&&"n?".indexOf(n[s].t)>-1&&(_=a>1&&e<0&&s>0&&n[s-1].v==="-"?-e:e,n[s].v=_r(n[s].t,n[s].v,_),n[s].t="t");var z="";for(s=0;s!==n.length;++s)n[s]!=null&&(z+=n[s].v);return z}var uo=/\[(=|>[=]?|<[>=]?)(-?\d+(?:\.\d*)?)\]/;function po(t,e){if(e==null)return!1;var r=parseFloat(e[2]);switch(e[1]){case"=":if(t==r)return!0;break;case">":if(t>r)return!0;break;case"<":if(t<r)return!0;break;case"<>":if(t!=r)return!0;break;case">=":if(t>=r)return!0;break;case"<=":if(t<=r)return!0;break}return!1}function qf(t,e){var r=Kf(t),a=r.length,n=r[a-1].indexOf("@");if(a<4&&n>-1&&--a,r.length>4)throw new Error("cannot find right format for |"+r.join("|")+"|");if(typeof e!="number")return[4,r.length===4||n>-1?r[r.length-1]:"@"];switch(r.length){case 1:r=n>-1?["General","General","General",r[0]]:[r[0],r[0],r[0],"@"];break;case 2:r=n>-1?[r[0],r[0],r[0],r[1]]:[r[0],r[1],r[0],"@"];break;case 3:r=n>-1?[r[0],r[1],r[0],r[2]]:[r[0],r[1],r[2],"@"];break}var i=e>0?r[0]:e<0?r[1]:r[2];if(r[0].indexOf("[")===-1&&r[1].indexOf("[")===-1)return[a,i];if(r[0].match(/\[[=<>]/)!=null||r[1].match(/\[[=<>]/)!=null){var s=r[0].match(uo),o=r[1].match(uo);return po(e,s)?[a,r[0]]:po(e,o)?[a,r[1]]:[a,r[s!=null&&o!=null?2:1]]}return[a,i]}function Kt(t,e,r){r==null&&(r={});var a="";switch(typeof t){case"string":t=="m/d/yy"&&r.dateNF?a=r.dateNF:a=t;break;case"number":t==14&&r.dateNF?a=r.dateNF:a=(r.table!=null?r.table:ge)[t],a==null&&(a=r.table&&r.table[co[t]]||ge[co[t]]),a==null&&(a=Nf[t]||"General");break}if(jn(a,0))return ia(e,r);e instanceof Date&&(e=L0(e,r.date1904));var n=qf(a,e);if(jn(n[1]))return ia(e,r);if(e===!0)e="TRUE";else if(e===!1)e="FALSE";else if(e===""||e==null)return"";return Yf(n[1],e,r,n[0])}function Tr(t,e){if(typeof e!="number"){e=+e||-1;for(var r=0;r<392;++r){if(ge[r]==null){e<0&&(e=r);continue}if(ge[r]==t){e=r;break}}e<0&&(e=391)}return ge[e]=t,e}function hi(t){for(var e=0;e!=392;++e)t[e]!==void 0&&Tr(t[e],e)}function Ma(){ge=If()}var Jf={5:'"$"#,##0_);\\("$"#,##0\\)',6:'"$"#,##0_);[Red]\\("$"#,##0\\)',7:'"$"#,##0.00_);\\("$"#,##0.00\\)',8:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',23:"General",24:"General",25:"General",26:"General",27:"m/d/yy",28:"m/d/yy",29:"m/d/yy",30:"m/d/yy",31:"m/d/yy",32:"h:mm:ss",33:"h:mm:ss",34:"h:mm:ss",35:"h:mm:ss",36:"m/d/yy",41:'_(* #,##0_);_(* (#,##0);_(* "-"_);_(@_)',42:'_("$"* #,##0_);_("$"* (#,##0);_("$"* "-"_);_(@_)',43:'_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)',44:'_("$"* #,##0.00_);_("$"* (#,##0.00);_("$"* "-"??_);_(@_)',50:"m/d/yy",51:"m/d/yy",52:"m/d/yy",53:"m/d/yy",54:"m/d/yy",55:"m/d/yy",56:"m/d/yy",57:"m/d/yy",58:"m/d/yy",59:"0",60:"0.00",61:"#,##0",62:"#,##0.00",63:'"$"#,##0_);\\("$"#,##0\\)',64:'"$"#,##0_);[Red]\\("$"#,##0\\)',65:'"$"#,##0.00_);\\("$"#,##0.00\\)',66:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',67:"0%",68:"0.00%",69:"# ?/?",70:"# ??/??",71:"m/d/yy",72:"m/d/yy",73:"d-mmm-yy",74:"d-mmm",75:"mmm-yy",76:"h:mm",77:"h:mm:ss",78:"m/d/yy h:mm",79:"mm:ss",80:"[h]:mm:ss",81:"mmss.0"},R0=/[dD]+|[mM]+|[yYeE]+|[Hh]+|[Ss]+/g;function Zf(t){var e=typeof t=="number"?ge[t]:t;return e=e.replace(R0,"(\\d+)"),new RegExp("^"+e+"$")}function Qf(t,e,r){var a=-1,n=-1,i=-1,s=-1,o=-1,l=-1;(e.match(R0)||[]).forEach(function(u,h){var p=parseInt(r[h+1],10);switch(u.toLowerCase().charAt(0)){case"y":a=p;break;case"d":i=p;break;case"h":s=p;break;case"s":l=p;break;case"m":s>=0?o=p:n=p;break}}),l>=0&&o==-1&&n>=0&&(o=n,n=-1);var c=(""+(a>=0?a:new Date().getFullYear())).slice(-4)+"-"+("00"+(n>=1?n:1)).slice(-2)+"-"+("00"+(i>=1?i:1)).slice(-2);c.length==7&&(c="0"+c),c.length==8&&(c="20"+c);var f=("00"+(s>=0?s:0)).slice(-2)+":"+("00"+(o>=0?o:0)).slice(-2)+":"+("00"+(l>=0?l:0)).slice(-2);return s==-1&&o==-1&&l==-1?c:a==-1&&n==-1&&i==-1?f:c+"T"+f}var eh=function(){var t={};t.version="1.2.0";function e(){for(var C=0,M=new Array(256),N=0;N!=256;++N)C=N,C=C&1?-306674912^C>>>1:C>>>1,C=C&1?-306674912^C>>>1:C>>>1,C=C&1?-306674912^C>>>1:C>>>1,C=C&1?-306674912^C>>>1:C>>>1,C=C&1?-306674912^C>>>1:C>>>1,C=C&1?-306674912^C>>>1:C>>>1,C=C&1?-306674912^C>>>1:C>>>1,C=C&1?-306674912^C>>>1:C>>>1,M[N]=C;return typeof Int32Array<"u"?new Int32Array(M):M}var r=e();function a(C){var M=0,N=0,z=0,B=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(z=0;z!=256;++z)B[z]=C[z];for(z=0;z!=256;++z)for(N=C[z],M=256+z;M<4096;M+=256)N=B[M]=N>>>8^C[N&255];var D=[];for(z=1;z!=16;++z)D[z-1]=typeof Int32Array<"u"?B.subarray(z*256,z*256+256):B.slice(z*256,z*256+256);return D}var n=a(r),i=n[0],s=n[1],o=n[2],l=n[3],c=n[4],f=n[5],u=n[6],h=n[7],p=n[8],m=n[9],d=n[10],g=n[11],x=n[12],w=n[13],v=n[14];function I(C,M){for(var N=M^-1,z=0,B=C.length;z<B;)N=N>>>8^r[(N^C.charCodeAt(z++))&255];return~N}function L(C,M){for(var N=M^-1,z=C.length-15,B=0;B<z;)N=v[C[B++]^N&255]^w[C[B++]^N>>8&255]^x[C[B++]^N>>16&255]^g[C[B++]^N>>>24]^d[C[B++]]^m[C[B++]]^p[C[B++]]^h[C[B++]]^u[C[B++]]^f[C[B++]]^c[C[B++]]^l[C[B++]]^o[C[B++]]^s[C[B++]]^i[C[B++]]^r[C[B++]];for(z+=15;B<z;)N=N>>>8^r[(N^C[B++])&255];return~N}function _(C,M){for(var N=M^-1,z=0,B=C.length,D=0,q=0;z<B;)D=C.charCodeAt(z++),D<128?N=N>>>8^r[(N^D)&255]:D<2048?(N=N>>>8^r[(N^(192|D>>6&31))&255],N=N>>>8^r[(N^(128|D&63))&255]):D>=55296&&D<57344?(D=(D&1023)+64,q=C.charCodeAt(z++)&1023,N=N>>>8^r[(N^(240|D>>8&7))&255],N=N>>>8^r[(N^(128|D>>2&63))&255],N=N>>>8^r[(N^(128|q>>6&15|(D&3)<<4))&255],N=N>>>8^r[(N^(128|q&63))&255]):(N=N>>>8^r[(N^(224|D>>12&15))&255],N=N>>>8^r[(N^(128|D>>6&63))&255],N=N>>>8^r[(N^(128|D&63))&255]);return~N}return t.table=r,t.bstr=I,t.buf=L,t.str=_,t}(),pe=function(){var e={};e.version="1.2.1";function r(E,T){for(var y=E.split("/"),k=T.split("/"),S=0,b=0,H=Math.min(y.length,k.length);S<H;++S){if(b=y[S].length-k[S].length)return b;if(y[S]!=k[S])return y[S]<k[S]?-1:1}return y.length-k.length}function a(E){if(E.charAt(E.length-1)=="/")return E.slice(0,-1).indexOf("/")===-1?E:a(E.slice(0,-1));var T=E.lastIndexOf("/");return T===-1?E:E.slice(0,T+1)}function n(E){if(E.charAt(E.length-1)=="/")return n(E.slice(0,-1));var T=E.lastIndexOf("/");return T===-1?E:E.slice(T+1)}function i(E,T){typeof T=="string"&&(T=new Date(T));var y=T.getHours();y=y<<6|T.getMinutes(),y=y<<5|T.getSeconds()>>>1,E.write_shift(2,y);var k=T.getFullYear()-1980;k=k<<4|T.getMonth()+1,k=k<<5|T.getDate(),E.write_shift(2,k)}function s(E){var T=E.read_shift(2)&65535,y=E.read_shift(2)&65535,k=new Date,S=y&31;y>>>=5;var b=y&15;y>>>=4,k.setMilliseconds(0),k.setFullYear(y+1980),k.setMonth(b-1),k.setDate(S);var H=T&31;T>>>=5;var j=T&63;return T>>>=6,k.setHours(T),k.setMinutes(j),k.setSeconds(H<<1),k}function o(E){dt(E,0);for(var T={},y=0;E.l<=E.length-4;){var k=E.read_shift(2),S=E.read_shift(2),b=E.l+S,H={};switch(k){case 21589:y=E.read_shift(1),y&1&&(H.mtime=E.read_shift(4)),S>5&&(y&2&&(H.atime=E.read_shift(4)),y&4&&(H.ctime=E.read_shift(4))),H.mtime&&(H.mt=new Date(H.mtime*1e3));break}E.l=b,T[k]=H}return T}var l;function c(){return l||(l={})}function f(E,T){if(E[0]==80&&E[1]==75)return Qs(E,T);if((E[0]|32)==109&&(E[1]|32)==105)return Qc(E,T);if(E.length<512)throw new Error("CFB file size "+E.length+" < 512");var y=3,k=512,S=0,b=0,H=0,j=0,V=0,U=[],G=E.slice(0,512);dt(G,0);var Z=u(G);switch(y=Z[0],y){case 3:k=512;break;case 4:k=4096;break;case 0:if(Z[1]==0)return Qs(E,T);default:throw new Error("Major Version: Expected 3 or 4 saw "+y)}k!==512&&(G=E.slice(0,k),dt(G,28));var se=E.slice(0,k);h(G,y);var ue=G.read_shift(4,"i");if(y===3&&ue!==0)throw new Error("# Directory Sectors: Expected 0 saw "+ue);G.l+=4,H=G.read_shift(4,"i"),G.l+=4,G.chk("00100000","Mini Stream Cutoff Size: "),j=G.read_shift(4,"i"),S=G.read_shift(4,"i"),V=G.read_shift(4,"i"),b=G.read_shift(4,"i");for(var ee=-1,he=0;he<109&&(ee=G.read_shift(4,"i"),!(ee<0));++he)U[he]=ee;var Ee=p(E,k);g(V,b,Ee,k,U);var Ge=w(Ee,H,U,k);Ge[H].name="!Directory",S>0&&j!==q&&(Ge[j].name="!MiniFAT"),Ge[U[0]].name="!FAT",Ge.fat_addrs=U,Ge.ssz=k;var ze={},gt=[],Ba=[],Va=[];v(H,Ge,Ee,gt,S,ze,Ba,j),m(Ba,Va,gt),gt.shift();var Ha={FileIndex:Ba,FullPaths:Va};return T&&T.raw&&(Ha.raw={header:se,sectors:Ee}),Ha}function u(E){if(E[E.l]==80&&E[E.l+1]==75)return[0,0];E.chk(oe,"Header Signature: "),E.l+=16;var T=E.read_shift(2,"u");return[E.read_shift(2,"u"),T]}function h(E,T){var y=9;switch(E.l+=2,y=E.read_shift(2)){case 9:if(T!=3)throw new Error("Sector Shift: Expected 9 saw "+y);break;case 12:if(T!=4)throw new Error("Sector Shift: Expected 12 saw "+y);break;default:throw new Error("Sector Shift: Expected 9 or 12 saw "+y)}E.chk("0600","Mini Sector Shift: "),E.chk("000000000000","Reserved: ")}function p(E,T){for(var y=Math.ceil(E.length/T)-1,k=[],S=1;S<y;++S)k[S-1]=E.slice(S*T,(S+1)*T);return k[y-1]=E.slice(y*T),k}function m(E,T,y){for(var k=0,S=0,b=0,H=0,j=0,V=y.length,U=[],G=[];k<V;++k)U[k]=G[k]=k,T[k]=y[k];for(;j<G.length;++j)k=G[j],S=E[k].L,b=E[k].R,H=E[k].C,U[k]===k&&(S!==-1&&U[S]!==S&&(U[k]=U[S]),b!==-1&&U[b]!==b&&(U[k]=U[b])),H!==-1&&(U[H]=k),S!==-1&&k!=U[k]&&(U[S]=U[k],G.lastIndexOf(S)<j&&G.push(S)),b!==-1&&k!=U[k]&&(U[b]=U[k],G.lastIndexOf(b)<j&&G.push(b));for(k=1;k<V;++k)U[k]===k&&(b!==-1&&U[b]!==b?U[k]=U[b]:S!==-1&&U[S]!==S&&(U[k]=U[S]));for(k=1;k<V;++k)if(E[k].type!==0){if(j=k,j!=U[j])do j=U[j],T[k]=T[j]+"/"+T[k];while(j!==0&&U[j]!==-1&&j!=U[j]);U[k]=-1}for(T[0]+="/",k=1;k<V;++k)E[k].type!==2&&(T[k]+="/")}function d(E,T,y){for(var k=E.start,S=E.size,b=[],H=k;y&&S>0&&H>=0;)b.push(T.slice(H*D,H*D+D)),S-=D,H=jr(y,H*4);return b.length===0?X(0):ft(b).slice(0,E.size)}function g(E,T,y,k,S){var b=q;if(E===q){if(T!==0)throw new Error("DIFAT chain shorter than expected")}else if(E!==-1){var H=y[E],j=(k>>>2)-1;if(!H)return;for(var V=0;V<j&&(b=jr(H,V*4))!==q;++V)S.push(b);g(jr(H,k-4),T-1,y,k,S)}}function x(E,T,y,k,S){var b=[],H=[];S||(S=[]);var j=k-1,V=0,U=0;for(V=T;V>=0;){S[V]=!0,b[b.length]=V,H.push(E[V]);var G=y[Math.floor(V*4/k)];if(U=V*4&j,k<4+U)throw new Error("FAT boundary crossed: "+V+" 4 "+k);if(!E[G])break;V=jr(E[G],U)}return{nodes:b,data:So([H])}}function w(E,T,y,k){var S=E.length,b=[],H=[],j=[],V=[],U=k-1,G=0,Z=0,se=0,ue=0;for(G=0;G<S;++G)if(j=[],se=G+T,se>=S&&(se-=S),!H[se]){V=[];var ee=[];for(Z=se;Z>=0;){ee[Z]=!0,H[Z]=!0,j[j.length]=Z,V.push(E[Z]);var he=y[Math.floor(Z*4/k)];if(ue=Z*4&U,k<4+ue)throw new Error("FAT boundary crossed: "+Z+" 4 "+k);if(!E[he]||(Z=jr(E[he],ue),ee[Z]))break}b[se]={nodes:j,data:So([V])}}return b}function v(E,T,y,k,S,b,H,j){for(var V=0,U=k.length?2:0,G=T[E].data,Z=0,se=0,ue;Z<G.length;Z+=128){var ee=G.slice(Z,Z+128);dt(ee,64),se=ee.read_shift(2),ue=vs(ee,0,se-U),k.push(ue);var he={name:ue,type:ee.read_shift(1),color:ee.read_shift(1),L:ee.read_shift(4,"i"),R:ee.read_shift(4,"i"),C:ee.read_shift(4,"i"),clsid:ee.read_shift(16),state:ee.read_shift(4,"i"),start:0,size:0},Ee=ee.read_shift(2)+ee.read_shift(2)+ee.read_shift(2)+ee.read_shift(2);Ee!==0&&(he.ct=I(ee,ee.l-8));var Ge=ee.read_shift(2)+ee.read_shift(2)+ee.read_shift(2)+ee.read_shift(2);Ge!==0&&(he.mt=I(ee,ee.l-8)),he.start=ee.read_shift(4,"i"),he.size=ee.read_shift(4,"i"),he.size<0&&he.start<0&&(he.size=he.type=0,he.start=q,he.name=""),he.type===5?(V=he.start,S>0&&V!==q&&(T[V].name="!StreamData")):he.size>=4096?(he.storage="fat",T[he.start]===void 0&&(T[he.start]=x(y,he.start,T.fat_addrs,T.ssz)),T[he.start].name=he.name,he.content=T[he.start].data.slice(0,he.size)):(he.storage="minifat",he.size<0?he.size=0:V!==q&&he.start!==q&&T[V]&&(he.content=d(he,T[V].data,(T[j]||{}).data))),he.content&&dt(he.content,0),b[ue]=he,H.push(he)}}function I(E,T){return new Date((Pt(E,T+4)/1e7*Math.pow(2,32)+Pt(E,T)/1e7-11644473600)*1e3)}function L(E,T){return c(),f(l.readFileSync(E),T)}function _(E,T){var y=T&&T.type;switch(y||_e&&Buffer.isBuffer(E)&&(y="buffer"),y||"base64"){case"file":return L(E,T);case"base64":return f(Dt(Bt(E)),T);case"binary":return f(Dt(E),T)}return f(E,T)}function C(E,T){var y=T||{},k=y.root||"Root Entry";if(E.FullPaths||(E.FullPaths=[]),E.FileIndex||(E.FileIndex=[]),E.FullPaths.length!==E.FileIndex.length)throw new Error("inconsistent CFB structure");E.FullPaths.length===0&&(E.FullPaths[0]=k+"/",E.FileIndex[0]={name:k,type:5}),y.CLSID&&(E.FileIndex[0].clsid=y.CLSID),M(E)}function M(E){var T="Sh33tJ5";if(!pe.find(E,"/"+T)){var y=X(4);y[0]=55,y[1]=y[3]=50,y[2]=54,E.FileIndex.push({name:T,type:2,content:y,size:4,L:69,R:69,C:69}),E.FullPaths.push(E.FullPaths[0]+T),N(E)}}function N(E,T){C(E);for(var y=!1,k=!1,S=E.FullPaths.length-1;S>=0;--S){var b=E.FileIndex[S];switch(b.type){case 0:k?y=!0:(E.FileIndex.pop(),E.FullPaths.pop());break;case 1:case 2:case 5:k=!0,isNaN(b.R*b.L*b.C)&&(y=!0),b.R>-1&&b.L>-1&&b.R==b.L&&(y=!0);break;default:y=!0;break}}if(!(!y&&!T)){var H=new Date(1987,1,19),j=0,V=Object.create?Object.create(null):{},U=[];for(S=0;S<E.FullPaths.length;++S)V[E.FullPaths[S]]=!0,E.FileIndex[S].type!==0&&U.push([E.FullPaths[S],E.FileIndex[S]]);for(S=0;S<U.length;++S){var G=a(U[S][0]);k=V[G],k||(U.push([G,{name:n(G).replace("/",""),type:1,clsid:fe,ct:H,mt:H,content:null}]),V[G]=!0)}for(U.sort(function(ue,ee){return r(ue[0],ee[0])}),E.FullPaths=[],E.FileIndex=[],S=0;S<U.length;++S)E.FullPaths[S]=U[S][0],E.FileIndex[S]=U[S][1];for(S=0;S<U.length;++S){var Z=E.FileIndex[S],se=E.FullPaths[S];if(Z.name=n(se).replace("/",""),Z.L=Z.R=Z.C=-(Z.color=1),Z.size=Z.content?Z.content.length:0,Z.start=0,Z.clsid=Z.clsid||fe,S===0)Z.C=U.length>1?1:-1,Z.size=0,Z.type=5;else if(se.slice(-1)=="/"){for(j=S+1;j<U.length&&a(E.FullPaths[j])!=se;++j);for(Z.C=j>=U.length?-1:j,j=S+1;j<U.length&&a(E.FullPaths[j])!=a(se);++j);Z.R=j>=U.length?-1:j,Z.type=1}else a(E.FullPaths[S+1]||"")==a(se)&&(Z.R=S+1),Z.type=2}}}function z(E,T){var y=T||{};if(y.fileType=="mad")return ef(E,y);switch(N(E),y.fileType){case"zip":return jc(E,y)}var k=function(ue){for(var ee=0,he=0,Ee=0;Ee<ue.FileIndex.length;++Ee){var Ge=ue.FileIndex[Ee];if(Ge.content){var ze=Ge.content.length;ze>0&&(ze<4096?ee+=ze+63>>6:he+=ze+511>>9)}}for(var gt=ue.FullPaths.length+3>>2,Ba=ee+7>>3,Va=ee+127>>7,Ha=Ba+he+gt+Va,Gr=Ha+127>>7,Ei=Gr<=109?0:Math.ceil((Gr-109)/127);Ha+Gr+Ei+127>>7>Gr;)Ei=++Gr<=109?0:Math.ceil((Gr-109)/127);var Er=[1,Ei,Gr,Va,gt,he,ee,0];return ue.FileIndex[0].size=ee<<6,Er[7]=(ue.FileIndex[0].start=Er[0]+Er[1]+Er[2]+Er[3]+Er[4]+Er[5])+(Er[6]+7>>3),Er}(E),S=X(k[7]<<9),b=0,H=0;{for(b=0;b<8;++b)S.write_shift(1,ie[b]);for(b=0;b<8;++b)S.write_shift(2,0);for(S.write_shift(2,62),S.write_shift(2,3),S.write_shift(2,65534),S.write_shift(2,9),S.write_shift(2,6),b=0;b<3;++b)S.write_shift(2,0);for(S.write_shift(4,0),S.write_shift(4,k[2]),S.write_shift(4,k[0]+k[1]+k[2]+k[3]-1),S.write_shift(4,0),S.write_shift(4,4096),S.write_shift(4,k[3]?k[0]+k[1]+k[2]-1:q),S.write_shift(4,k[3]),S.write_shift(-4,k[1]?k[0]-1:q),S.write_shift(4,k[1]),b=0;b<109;++b)S.write_shift(-4,b<k[2]?k[1]+b:-1)}if(k[1])for(H=0;H<k[1];++H){for(;b<236+H*127;++b)S.write_shift(-4,b<k[2]?k[1]+b:-1);S.write_shift(-4,H===k[1]-1?q:H+1)}var j=function(ue){for(H+=ue;b<H-1;++b)S.write_shift(-4,b+1);ue&&(++b,S.write_shift(-4,q))};for(H=b=0,H+=k[1];b<H;++b)S.write_shift(-4,le.DIFSECT);for(H+=k[2];b<H;++b)S.write_shift(-4,le.FATSECT);j(k[3]),j(k[4]);for(var V=0,U=0,G=E.FileIndex[0];V<E.FileIndex.length;++V)G=E.FileIndex[V],G.content&&(U=G.content.length,!(U<4096)&&(G.start=H,j(U+511>>9)));for(j(k[6]+7>>3);S.l&511;)S.write_shift(-4,le.ENDOFCHAIN);for(H=b=0,V=0;V<E.FileIndex.length;++V)G=E.FileIndex[V],G.content&&(U=G.content.length,!(!U||U>=4096)&&(G.start=H,j(U+63>>6)));for(;S.l&511;)S.write_shift(-4,le.ENDOFCHAIN);for(b=0;b<k[4]<<2;++b){var Z=E.FullPaths[b];if(!Z||Z.length===0){for(V=0;V<17;++V)S.write_shift(4,0);for(V=0;V<3;++V)S.write_shift(4,-1);for(V=0;V<12;++V)S.write_shift(4,0);continue}G=E.FileIndex[b],b===0&&(G.start=G.size?G.start-1:q);var se=b===0&&y.root||G.name;if(U=2*(se.length+1),S.write_shift(64,se,"utf16le"),S.write_shift(2,U),S.write_shift(1,G.type),S.write_shift(1,G.color),S.write_shift(-4,G.L),S.write_shift(-4,G.R),S.write_shift(-4,G.C),G.clsid)S.write_shift(16,G.clsid,"hex");else for(V=0;V<4;++V)S.write_shift(4,0);S.write_shift(4,G.state||0),S.write_shift(4,0),S.write_shift(4,0),S.write_shift(4,0),S.write_shift(4,0),S.write_shift(4,G.start),S.write_shift(4,G.size),S.write_shift(4,0)}for(b=1;b<E.FileIndex.length;++b)if(G=E.FileIndex[b],G.size>=4096)if(S.l=G.start+1<<9,_e&&Buffer.isBuffer(G.content))G.content.copy(S,S.l,0,G.size),S.l+=G.size+511&-512;else{for(V=0;V<G.size;++V)S.write_shift(1,G.content[V]);for(;V&511;++V)S.write_shift(1,0)}for(b=1;b<E.FileIndex.length;++b)if(G=E.FileIndex[b],G.size>0&&G.size<4096)if(_e&&Buffer.isBuffer(G.content))G.content.copy(S,S.l,0,G.size),S.l+=G.size+63&-64;else{for(V=0;V<G.size;++V)S.write_shift(1,G.content[V]);for(;V&63;++V)S.write_shift(1,0)}if(_e)S.l=S.length;else for(;S.l<S.length;)S.write_shift(1,0);return S}function B(E,T){var y=E.FullPaths.map(function(V){return V.toUpperCase()}),k=y.map(function(V){var U=V.split("/");return U[U.length-(V.slice(-1)=="/"?2:1)]}),S=!1;T.charCodeAt(0)===47?(S=!0,T=y[0].slice(0,-1)+T):S=T.indexOf("/")!==-1;var b=T.toUpperCase(),H=S===!0?y.indexOf(b):k.indexOf(b);if(H!==-1)return E.FileIndex[H];var j=!b.match(Wa);for(b=b.replace(Lt,""),j&&(b=b.replace(Wa,"!")),H=0;H<y.length;++H)if((j?y[H].replace(Wa,"!"):y[H]).replace(Lt,"")==b||(j?k[H].replace(Wa,"!"):k[H]).replace(Lt,"")==b)return E.FileIndex[H];return null}var D=64,q=-2,oe="d0cf11e0a1b11ae1",ie=[208,207,17,224,161,177,26,225],fe="00000000000000000000000000000000",le={MAXREGSECT:-6,DIFSECT:-4,FATSECT:-3,ENDOFCHAIN:q,FREESECT:-1,HEADER_SIGNATURE:oe,HEADER_MINOR_VERSION:"3e00",MAXREGSID:-6,NOSTREAM:-1,HEADER_CLSID:fe,EntryTypes:["unknown","storage","stream","lockbytes","property","root"]};function Fe(E,T,y){c();var k=z(E,y);l.writeFileSync(T,k)}function W(E){for(var T=new Array(E.length),y=0;y<E.length;++y)T[y]=String.fromCharCode(E[y]);return T.join("")}function me(E,T){var y=z(E,T);switch(T&&T.type||"buffer"){case"file":return c(),l.writeFileSync(T.filename,y),y;case"binary":return typeof y=="string"?y:W(y);case"base64":return an(typeof y=="string"?y:W(y));case"buffer":if(_e)return Buffer.isBuffer(y)?y:Lr(y);case"array":return typeof y=="string"?Dt(y):y}return y}var de;function F(E){try{var T=E.InflateRaw,y=new T;if(y._processChunk(new Uint8Array([3,0]),y._finishFlushFlag),y.bytesRead)de=E;else throw new Error("zlib does not expose bytesRead")}catch(k){console.error("cannot use native zlib: "+(k.message||k))}}function R(E,T){if(!de)return Js(E,T);var y=de.InflateRaw,k=new y,S=k._processChunk(E.slice(E.l),k._finishFlushFlag);return E.l+=k.bytesRead,S}function O(E){return de?de.deflateRawSync(E):Te(E)}var P=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],K=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258],te=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577];function re(E){var T=(E<<1|E<<11)&139536|(E<<5|E<<15)&558144;return(T>>16|T>>8|T)&255}for(var Q=typeof Uint8Array<"u",J=Q?new Uint8Array(256):[],ke=0;ke<256;++ke)J[ke]=re(ke);function A(E,T){var y=J[E&255];return T<=8?y>>>8-T:(y=y<<8|J[E>>8&255],T<=16?y>>>16-T:(y=y<<8|J[E>>16&255],y>>>24-T))}function He(E,T){var y=T&7,k=T>>>3;return(E[k]|(y<=6?0:E[k+1]<<8))>>>y&3}function Ae(E,T){var y=T&7,k=T>>>3;return(E[k]|(y<=5?0:E[k+1]<<8))>>>y&7}function Ve(E,T){var y=T&7,k=T>>>3;return(E[k]|(y<=4?0:E[k+1]<<8))>>>y&15}function be(E,T){var y=T&7,k=T>>>3;return(E[k]|(y<=3?0:E[k+1]<<8))>>>y&31}function ce(E,T){var y=T&7,k=T>>>3;return(E[k]|(y<=1?0:E[k+1]<<8))>>>y&127}function Je(E,T,y){var k=T&7,S=T>>>3,b=(1<<y)-1,H=E[S]>>>k;return y<8-k||(H|=E[S+1]<<8-k,y<16-k)||(H|=E[S+2]<<16-k,y<24-k)||(H|=E[S+3]<<24-k),H&b}function Vt(E,T,y){var k=T&7,S=T>>>3;return k<=5?E[S]|=(y&7)<<k:(E[S]|=y<<k&255,E[S+1]=(y&7)>>8-k),T+3}function lr(E,T,y){var k=T&7,S=T>>>3;return y=(y&1)<<k,E[S]|=y,T+1}function vr(E,T,y){var k=T&7,S=T>>>3;return y<<=k,E[S]|=y&255,y>>>=8,E[S+1]=y,T+8}function Da(E,T,y){var k=T&7,S=T>>>3;return y<<=k,E[S]|=y&255,y>>>=8,E[S+1]=y&255,E[S+2]=y>>>8,T+16}function Ir(E,T){var y=E.length,k=2*y>T?2*y:T+5,S=0;if(y>=T)return E;if(_e){var b=so(k);if(E.copy)E.copy(b);else for(;S<E.length;++S)b[S]=E[S];return b}else if(Q){var H=new Uint8Array(k);if(H.set)H.set(E);else for(;S<y;++S)H[S]=E[S];return H}return E.length=k,E}function Mt(E){for(var T=new Array(E),y=0;y<E;++y)T[y]=0;return T}function wr(E,T,y){var k=1,S=0,b=0,H=0,j=0,V=E.length,U=Q?new Uint16Array(32):Mt(32);for(b=0;b<32;++b)U[b]=0;for(b=V;b<y;++b)E[b]=0;V=E.length;var G=Q?new Uint16Array(V):Mt(V);for(b=0;b<V;++b)U[S=E[b]]++,k<S&&(k=S),G[b]=0;for(U[0]=0,b=1;b<=k;++b)U[b+16]=j=j+U[b-1]<<1;for(b=0;b<V;++b)j=E[b],j!=0&&(G[b]=U[j+16]++);var Z=0;for(b=0;b<V;++b)if(Z=E[b],Z!=0)for(j=A(G[b],k)>>k-Z,H=(1<<k+4-Z)-1;H>=0;--H)T[j|H<<Z]=Z&15|b<<4;return k}var Nr=Q?new Uint16Array(512):Mt(512),Ra=Q?new Uint16Array(32):Mt(32);if(!Q){for(var Tt=0;Tt<512;++Tt)Nr[Tt]=0;for(Tt=0;Tt<32;++Tt)Ra[Tt]=0}(function(){for(var E=[],T=0;T<32;T++)E.push(5);wr(E,Ra,32);var y=[];for(T=0;T<=143;T++)y.push(8);for(;T<=255;T++)y.push(9);for(;T<=279;T++)y.push(7);for(;T<=287;T++)y.push(8);wr(y,Nr,288)})();var cr=function(){for(var T=Q?new Uint8Array(32768):[],y=0,k=0;y<te.length-1;++y)for(;k<te[y+1];++k)T[k]=y;for(;k<32768;++k)T[k]=29;var S=Q?new Uint8Array(259):[];for(y=0,k=0;y<K.length-1;++y)for(;k<K[y+1];++k)S[k]=y;function b(j,V){for(var U=0;U<j.length;){var G=Math.min(65535,j.length-U),Z=U+G==j.length;for(V.write_shift(1,+Z),V.write_shift(2,G),V.write_shift(2,~G&65535);G-- >0;)V[V.l++]=j[U++]}return V.l}function H(j,V){for(var U=0,G=0,Z=Q?new Uint16Array(32768):[];G<j.length;){var se=Math.min(65535,j.length-G);if(se<10){for(U=Vt(V,U,+(G+se==j.length)),U&7&&(U+=8-(U&7)),V.l=U/8|0,V.write_shift(2,se),V.write_shift(2,~se&65535);se-- >0;)V[V.l++]=j[G++];U=V.l*8;continue}U=Vt(V,U,+(G+se==j.length)+2);for(var ue=0;se-- >0;){var ee=j[G];ue=(ue<<5^ee)&32767;var he=-1,Ee=0;if((he=Z[ue])&&(he|=G&-32768,he>G&&(he-=32768),he<G))for(;j[he+Ee]==j[G+Ee]&&Ee<250;)++Ee;if(Ee>2){ee=S[Ee],ee<=22?U=vr(V,U,J[ee+1]>>1)-1:(vr(V,U,3),U+=5,vr(V,U,J[ee-23]>>5),U+=3);var Ge=ee<8?0:ee-4>>2;Ge>0&&(Da(V,U,Ee-K[ee]),U+=Ge),ee=T[G-he],U=vr(V,U,J[ee]>>3),U-=3;var ze=ee<4?0:ee-2>>1;ze>0&&(Da(V,U,G-he-te[ee]),U+=ze);for(var gt=0;gt<Ee;++gt)Z[ue]=G&32767,ue=(ue<<5^j[G])&32767,++G;se-=Ee-1}else ee<=143?ee=ee+48:U=lr(V,U,1),U=vr(V,U,J[ee]),Z[ue]=G&32767,++G}U=vr(V,U,0)-1}return V.l=(U+7)/8|0,V.l}return function(V,U){return V.length<8?b(V,U):H(V,U)}}();function Te(E){var T=X(50+Math.floor(E.length*1.1)),y=cr(E,T);return T.slice(0,y)}var Ze=Q?new Uint16Array(32768):Mt(32768),Ht=Q?new Uint16Array(32768):Mt(32768),it=Q?new Uint16Array(128):Mt(128),Wr=1,qs=1;function Gc(E,T){var y=be(E,T)+257;T+=5;var k=be(E,T)+1;T+=5;var S=Ve(E,T)+4;T+=4;for(var b=0,H=Q?new Uint8Array(19):Mt(19),j=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],V=1,U=Q?new Uint8Array(8):Mt(8),G=Q?new Uint8Array(8):Mt(8),Z=H.length,se=0;se<S;++se)H[P[se]]=b=Ae(E,T),V<b&&(V=b),U[b]++,T+=3;var ue=0;for(U[0]=0,se=1;se<=V;++se)G[se]=ue=ue+U[se-1]<<1;for(se=0;se<Z;++se)(ue=H[se])!=0&&(j[se]=G[ue]++);var ee=0;for(se=0;se<Z;++se)if(ee=H[se],ee!=0){ue=J[j[se]]>>8-ee;for(var he=(1<<7-ee)-1;he>=0;--he)it[ue|he<<ee]=ee&7|se<<3}var Ee=[];for(V=1;Ee.length<y+k;)switch(ue=it[ce(E,T)],T+=ue&7,ue>>>=3){case 16:for(b=3+He(E,T),T+=2,ue=Ee[Ee.length-1];b-- >0;)Ee.push(ue);break;case 17:for(b=3+Ae(E,T),T+=3;b-- >0;)Ee.push(0);break;case 18:for(b=11+ce(E,T),T+=7;b-- >0;)Ee.push(0);break;default:Ee.push(ue),V<ue&&(V=ue);break}var Ge=Ee.slice(0,y),ze=Ee.slice(y);for(se=y;se<286;++se)Ge[se]=0;for(se=k;se<30;++se)ze[se]=0;return Wr=wr(Ge,Ze,286),qs=wr(ze,Ht,30),T}function zc(E,T){if(E[0]==3&&!(E[1]&3))return[Dr(T),2];for(var y=0,k=0,S=so(T||1<<18),b=0,H=S.length>>>0,j=0,V=0;!(k&1);){if(k=Ae(E,y),y+=3,k>>>1)k>>1==1?(j=9,V=5):(y=Gc(E,y),j=Wr,V=qs);else{y&7&&(y+=8-(y&7));var U=E[y>>>3]|E[(y>>>3)+1]<<8;if(y+=32,U>0)for(!T&&H<b+U&&(S=Ir(S,b+U),H=S.length);U-- >0;)S[b++]=E[y>>>3],y+=8;continue}for(;;){!T&&H<b+32767&&(S=Ir(S,b+32767),H=S.length);var G=Je(E,y,j),Z=k>>>1==1?Nr[G]:Ze[G];if(y+=Z&15,Z>>>=4,!(Z>>>8&255))S[b++]=Z;else{if(Z==256)break;Z-=257;var se=Z<8?0:Z-4>>2;se>5&&(se=0);var ue=b+K[Z];se>0&&(ue+=Je(E,y,se),y+=se),G=Je(E,y,V),Z=k>>>1==1?Ra[G]:Ht[G],y+=Z&15,Z>>>=4;var ee=Z<4?0:Z-2>>1,he=te[Z];for(ee>0&&(he+=Je(E,y,ee),y+=ee),!T&&H<ue&&(S=Ir(S,ue+100),H=S.length);b<ue;)S[b]=S[b-he],++b}}}return T?[S,y+7>>>3]:[S.slice(0,b),y+7>>>3]}function Js(E,T){var y=E.slice(E.l||0),k=zc(y,T);return E.l+=k[1],k[0]}function Zs(E,T){if(E)typeof console<"u"&&console.error(T);else throw new Error(T)}function Qs(E,T){var y=E;dt(y,0);var k=[],S=[],b={FileIndex:k,FullPaths:S};C(b,{root:T.root});for(var H=y.length-4;(y[H]!=80||y[H+1]!=75||y[H+2]!=5||y[H+3]!=6)&&H>=0;)--H;y.l=H+4,y.l+=4;var j=y.read_shift(2);y.l+=6;var V=y.read_shift(4);for(y.l=V,H=0;H<j;++H){y.l+=20;var U=y.read_shift(4),G=y.read_shift(4),Z=y.read_shift(2),se=y.read_shift(2),ue=y.read_shift(2);y.l+=8;var ee=y.read_shift(4),he=o(y.slice(y.l+Z,y.l+Z+se));y.l+=Z+se+ue;var Ee=y.l;y.l=ee+4,Xc(y,U,G,b,he),y.l=Ee}return b}function Xc(E,T,y,k,S){E.l+=2;var b=E.read_shift(2),H=E.read_shift(2),j=s(E);if(b&8257)throw new Error("Unsupported ZIP encryption");for(var V=E.read_shift(4),U=E.read_shift(4),G=E.read_shift(4),Z=E.read_shift(2),se=E.read_shift(2),ue="",ee=0;ee<Z;++ee)ue+=String.fromCharCode(E[E.l++]);if(se){var he=o(E.slice(E.l,E.l+se));(he[21589]||{}).mt&&(j=he[21589].mt),((S||{})[21589]||{}).mt&&(j=S[21589].mt)}E.l+=se;var Ee=E.slice(E.l,E.l+U);switch(H){case 8:Ee=R(E,G);break;case 0:break;default:throw new Error("Unsupported ZIP Compression method "+H)}var Ge=!1;b&8&&(V=E.read_shift(4),V==134695760&&(V=E.read_shift(4),Ge=!0),U=E.read_shift(4),G=E.read_shift(4)),U!=T&&Zs(Ge,"Bad compressed size: "+T+" != "+U),G!=y&&Zs(Ge,"Bad uncompressed size: "+y+" != "+G),wi(k,ue,Ee,{unsafe:!0,mt:j})}function jc(E,T){var y=T||{},k=[],S=[],b=X(1),H=y.compression?8:0,j=0,V=0,U=0,G=0,Z=0,se=E.FullPaths[0],ue=se,ee=E.FileIndex[0],he=[],Ee=0;for(V=1;V<E.FullPaths.length;++V)if(ue=E.FullPaths[V].slice(se.length),ee=E.FileIndex[V],!(!ee.size||!ee.content||ue=="Sh33tJ5")){var Ge=G,ze=X(ue.length);for(U=0;U<ue.length;++U)ze.write_shift(1,ue.charCodeAt(U)&127);ze=ze.slice(0,ze.l),he[Z]=eh.buf(ee.content,0);var gt=ee.content;H==8&&(gt=O(gt)),b=X(30),b.write_shift(4,67324752),b.write_shift(2,20),b.write_shift(2,j),b.write_shift(2,H),ee.mt?i(b,ee.mt):b.write_shift(4,0),b.write_shift(-4,he[Z]),b.write_shift(4,gt.length),b.write_shift(4,ee.content.length),b.write_shift(2,ze.length),b.write_shift(2,0),G+=b.length,k.push(b),G+=ze.length,k.push(ze),G+=gt.length,k.push(gt),b=X(46),b.write_shift(4,33639248),b.write_shift(2,0),b.write_shift(2,20),b.write_shift(2,j),b.write_shift(2,H),b.write_shift(4,0),b.write_shift(-4,he[Z]),b.write_shift(4,gt.length),b.write_shift(4,ee.content.length),b.write_shift(2,ze.length),b.write_shift(2,0),b.write_shift(2,0),b.write_shift(2,0),b.write_shift(2,0),b.write_shift(4,0),b.write_shift(4,Ge),Ee+=b.l,S.push(b),Ee+=ze.length,S.push(ze),++Z}return b=X(22),b.write_shift(4,101010256),b.write_shift(2,0),b.write_shift(2,0),b.write_shift(2,Z),b.write_shift(2,Z),b.write_shift(4,Ee),b.write_shift(4,G),b.write_shift(2,0),ft([ft(k),ft(S),b])}var Sn={htm:"text/html",xml:"text/xml",gif:"image/gif",jpg:"image/jpeg",png:"image/png",mso:"application/x-mso",thmx:"application/vnd.ms-officetheme",sh33tj5:"application/octet-stream"};function Kc(E,T){if(E.ctype)return E.ctype;var y=E.name||"",k=y.match(/\.([^\.]+)$/);return k&&Sn[k[1]]||T&&(k=(y=T).match(/[\.\\]([^\.\\])+$/),k&&Sn[k[1]])?Sn[k[1]]:"application/octet-stream"}function Yc(E){for(var T=an(E),y=[],k=0;k<T.length;k+=76)y.push(T.slice(k,k+76));return y.join(`\r
28
+ linear-gradient(to right, #fff, hsl(${o}, 100%, 50%))`,this.opacityMarker.style.left=`${this.currentOpacity}%`,this.opacityValueInput.value=`${this.currentOpacity}%`,this.updateOpacityBg(),this.updateColorSwatch(),this.syncInput(),(l=this.recentSectionRefresh)==null||l.call(this)}commitRecentColor(){var e;if(this.recentScope==="solid"){let r=this.currentColor;if(this.currentOpacity<100){const{r:a,g:n,b:i}=pt(this.currentColor);r=`rgba(${a}, ${n}, ${i}, ${this.currentOpacity/100})`}aa.addColor(r,this.recentScope),(e=this.recentSectionRefresh)==null||e.call(this)}}getElement(){return this.element}updateColor(e,r){if(this.isDragging){this.pendingExternalUpdate={color:e,opacity:r};return}this.initFromColor(e,r)}}const er=class er extends Le{constructor(e={}){const r=typeof e.default=="string"?void 0:e.default;super({...e,title:e.title||"Color",default:r}),this.inputType={type:"text",angle:"number",stops:"text"},this.element=null,this.previewEl=null,this.inputEl=void 0,this.popoverEl=null,this.backdropEl=null,this.isPopoverOpen=!1,this.isEditing=!1,this.popoverPosition=null,this.previewUpdateTimeout=null,this.changeDebounceTimeout=null,this.solidPicker=null,this.pendingSolidColor=null,this.sharedStopColorPicker=null,this.colorPickerStopIndex=null,this.variant="default",this.globalLayoutMode="list",this.globalSearchQuery="",this.currentMode="custom",this.linkedGlobalVariable=null,this.unlinkButton=null,this.onBackgroundClick=a=>{var h;if(!this.popoverEl||!this.isPopoverOpen)return;const n=a.target,i=this.popoverEl.contains(n),s=(h=this.element)==null?void 0:h.contains(n),o=document.querySelectorAll(".custom-color-picker"),l=Array.from(o).some(p=>p.contains(n)),c=n.closest(".gstop-color-input, .gradient-mini-preview, .gstop-color-preview"),f=n.classList.contains("color-picker-backdrop"),u=n.classList.contains("gradient-popover-backdrop");!i&&!s&&!l&&!c&&!f&&!u&&this.closePopover()},this.handlePopoverKeydown=a=>{var n,i;if(this.isPopoverOpen){if(a.key==="Escape"){if(a.preventDefault(),(n=this.sharedStopColorPicker)!=null&&n.getIsOpen()){this.sharedStopColorPicker.close(!1),this.colorPickerStopIndex=null;return}this.closePopover();return}if(a.key==="Enter"){const s=a.target;if(s&&(s.tagName==="INPUT"||s.tagName==="TEXTAREA"))return;if(a.preventDefault(),(i=this.sharedStopColorPicker)!=null&&i.getIsOpen()){this.sharedStopColorPicker.close(!0),this.colorPickerStopIndex=null;return}this.closePopover()}}},this.detectChange=e.detectChange,this.onColorChange=e.onColorChange,this.variant=e.variant??"default",this.hideGlobalsTab=e.hideGlobalsTab,this.originalDefault=e.default,this.value=this.defaultValue(),this.setLinkedGlobalVariableFrom(this.originalDefault??this.value)}resolveGlobalVarColor(e){if(e&&e.startsWith("var(--")){const r=e.replace("var(--","").replace(")","");return(Le.GlobalVariables||{})[r]||e}return e}getSharedStopColorPicker(){return this.sharedStopColorPicker||(this.sharedStopColorPicker=new yf(void 0,"solid")),this.sharedStopColorPicker}setLinkedGlobalVariableFrom(e){var a,n;if(!e){this.linkedGlobalVariable=null;return}const r=typeof e=="string"?e:((n=(a=e.stops)==null?void 0:a[0])==null?void 0:n.color)??null;this.linkedGlobalVariable=r&&r.startsWith("var(--")?r:null}isBoundToGlobal(){return!!this.linkedGlobalVariable}clearGlobalBindingForCustomChange(){var e,r;this.isBoundToGlobal()&&((r=(e=this.value)==null?void 0:e.stops)!=null&&r.length&&(this.value.stops=this.value.stops.map(a=>({...a,color:this.resolveGlobalVarColor(a.color)}))),this.linkedGlobalVariable=null,this.updateUnlinkButtonVisibility())}breakGlobalBinding(){var e;!this.isBoundToGlobal()||!this.value||((e=this.value.stops)!=null&&e.length&&(this.value.stops=this.value.stops.map(r=>({...r,color:this.resolveGlobalVarColor(r.color)}))),this.linkedGlobalVariable=null,this.updateUI(),this.triggerChange(),this.isPopoverOpen&&this.refreshPopoverContent())}defaultValue(){const e=this.originalDefault;if(typeof e=="string"){if(e.startsWith("var(--"))return yr({type:"solid",angle:0,stops:[{color:e,position:0,opacity:100}]});const a=At(e);if(a)return yr(a)}return yr(e&&typeof e=="object"?e:{type:"linear",angle:90,stops:[{color:"#a84b4b",position:0,opacity:100},{color:"#786666",position:100,opacity:100}]})}setValue(e){let r=null;typeof e=="string"?e.startsWith("var(--")?r=yr({type:"solid",angle:0,stops:[{color:e,position:0,opacity:100}]}):r=At(e):e&&typeof e=="object"&&(r=yr(e)),r||(r=this.defaultValue()),this.value=r,this.setLinkedGlobalVariableFrom(e??r),this.updateUI(),this.isPopoverOpen&&this.refreshPopoverContent(),this.triggerChange(),this.pendingSolidColor=null,this.updateUnlinkButtonVisibility()}updateUI(){if(this.previewEl&&this.value)if(this.value.type==="solid"){const e=this.value.stops[0],r=e.opacity??100,a=this.resolveGlobalVarColor(e.color);this.previewEl.style.background=Hi(a,r)}else{const e=this.resolveGradientGlobalVars(this.value);this.previewEl.style.background=Zt(e)}if(this.inputEl&&this.value&&!this.isEditing)if(this.isBoundToGlobal()&&this.linkedGlobalVariable){const r=this.linkedGlobalVariable.replace("var(--","").replace(")","").split("-").map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" ");this.inputEl.value=`Linked: ${r}`}else this.inputEl.value=$n(this.value);this.updateUnlinkButtonVisibility()}resolveGradientGlobalVars(e){return{...e,stops:e.stops.map(r=>({...r,color:this.resolveGlobalVarColor(r.color)}))}}updateUnlinkButtonVisibility(){if(!this.unlinkButton)return;const e=this.isBoundToGlobal();e?this.unlinkButton.classList.add("visible"):this.unlinkButton.classList.remove("visible"),this.previewEl&&(e?this.previewEl.classList.add("bound"):this.previewEl.classList.remove("bound"))}cssForTextValue(){return this.value?{background:Zt(this.value),"-webkit-background-clip":"text","background-clip":"text",color:"transparent","-webkit-text-fill-color":"transparent"}:{}}draw(){const e=document.createElement("div");if(e.className="gradient-setting-wrapper",this.props.title){const a=document.createElement("div");a.className="icon-container";const n=document.createElement("span");n.className="input-label",n.textContent=this.props.title,a.appendChild(n),e.appendChild(a)}const r=document.createElement("div");return r.className="gradient-input-wrapper",this.previewEl=document.createElement("div"),this.previewEl.className="gradient-mini-preview",this.previewEl.style.background=this.value?Zt(this.value):"linear-gradient(90deg, #a84b4b 0%, #786666 100%)",this.previewEl.addEventListener("click",a=>{a.preventDefault(),a.stopPropagation(),this.openPopover()}),this.inputEl=document.createElement("input"),this.inputEl.type="text",this.inputEl.className="gradient-text-input",this.inputEl.placeholder="Enter gradient CSS or paste color...",this.inputEl.value=this.value?$n(this.value):"",this.inputEl.readOnly=!1,this.inputEl.addEventListener("focus",()=>{if(this.isEditing=!0,this.value)if(this.value.type==="solid"){const a=this.value.stops[0];if(a){const i=this.resolveGlobalVarColor(a.color).toUpperCase(),s=a.opacity??100;if(s===100)this.inputEl.value=i;else{const l=Math.round(s/100*255).toString(16).toUpperCase().padStart(2,"0");this.inputEl.value=`${i}${l}`}}}else this.inputEl.value=Zt(this.value)}),this.inputEl.addEventListener("blur",()=>{this.isEditing=!1,this.value&&(this.inputEl.value=$n(this.value))}),this.inputEl.addEventListener("paste",a=>this.handlePaste(a)),this.inputEl.addEventListener("input",a=>this.handleTextInput(a)),this.inputEl.addEventListener("keydown",a=>{a.key==="Enter"&&(this.handleTextInput(a),this.inputEl.blur()),a.key==="Escape"&&(this.value&&(this.inputEl.value=Zt(this.value)),this.inputEl.blur())}),r.appendChild(this.previewEl),this.unlinkButton=document.createElement("button"),this.unlinkButton.type="button",this.unlinkButton.className="gradient-unlink-button",this.unlinkButton.innerHTML=Cf,this.unlinkButton.title="Break global color binding",this.unlinkButton.addEventListener("click",a=>{a.preventDefault(),a.stopPropagation(),this.breakGlobalBinding()}),r.appendChild(this.unlinkButton),r.appendChild(this.inputEl),e.appendChild(r),this.createPopover(),this.element=e,this.updateUnlinkButtonVisibility(),e}createPopover(){if(this.popoverEl)return;this.backdropEl=document.createElement("div"),this.backdropEl.className="gradient-popover-backdrop",this.backdropEl.style.display="none",this.backdropEl.style.pointerEvents="none",this.popoverEl=document.createElement("div"),this.popoverEl.className="gradient-popover",this.popoverEl.style.display="none",this.popoverEl.addEventListener("click",l=>{l.stopPropagation()});const e=document.createElement("div");e.className="gradient-popover-header",e.style.cursor="move";let r=null;if(this.hideGlobalsTab){const l=document.createElement("div");e.appendChild(l)}else{r=document.createElement("div"),r.className="color-setting-tabs header-tabs";const l=document.createElement("button");l.className="color-tab active",l.textContent="Custom";const c=document.createElement("button");c.className="color-tab",c.textContent="Global",r.appendChild(l),r.appendChild(c),e.appendChild(r)}const a=document.createElement("button");a.type="button",a.className="gradient-popover-close",a.innerHTML=k0,a.addEventListener("click",()=>this.closePopover()),e.appendChild(a),ns(e,this.popoverEl,(l,c)=>{this.popoverPosition={left:l,top:c}});const n=document.createElement("div");n.className="gradient-editor";const i=document.createElement("div");i.className="type-tabs-wrapper";const s=this.createTypeTabs();i.appendChild(s),n.appendChild(i);const o=document.createElement("div");if(o.className="gradient-editor-content",this.updatePopoverContent(o),n.appendChild(o),this.variant!=="global"&&r){const l=r.children[0],c=r.children[1],f=u=>{this.currentMode=u,u==="custom"?(l.classList.add("active"),c.classList.remove("active"),i.style.display="block"):(c.classList.add("active"),l.classList.remove("active"),i.style.display="none"),this.updatePopoverContent(o)};l.addEventListener("click",()=>f("custom")),c.addEventListener("click",()=>f("global")),this.isBoundToGlobal()?(this.currentMode="global",f("global")):(this.currentMode="custom",f("custom"))}this.popoverEl.appendChild(e),this.popoverEl.appendChild(n),document.body.appendChild(this.backdropEl),document.body.appendChild(this.popoverEl)}createTypeTabs(){var n,i;const e=document.createElement("div");e.className="gradient-type-tabs";const r=document.createElement("button");r.type="button",r.className=`gradient-type-tab ${((n=this.value)==null?void 0:n.type)==="solid"?"active":""}`,r.innerHTML=vf,r.addEventListener("click",()=>this.switchType("solid"));const a=document.createElement("button");return a.type="button",a.className=`gradient-type-tab ${((i=this.value)==null?void 0:i.type)!=="solid"?"active":""}`,a.innerHTML=wf,a.addEventListener("click",()=>{var o,l;const s=((o=this.value)==null?void 0:o.type)==="solid"?"linear":((l=this.value)==null?void 0:l.type)||"linear";this.switchType(s)}),e.appendChild(r),e.appendChild(a),e}switchType(e,r=!1){var l,c;if(!this.value)return;const a=this.value.type,n=this.isBoundToGlobal(),i=this.linkedGlobalVariable;this.value.type=e;let s=!1;if(n&&i&&a==="solid"!=(e==="solid")){const f=this.resolveGlobalVarColor(i),u=this.value.stops&&this.value.stops[0]?this.value.stops[0].opacity??100:100,h=At(f);h&&h.type!=="solid"&&h.stops.length>=2?(this.value.stops=h.stops,this.value.angle=h.angle,this.value.type=h.type,this.linkedGlobalVariable=null,s=!0):((l=this.value.stops)!=null&&l.length&&(this.value.stops=this.value.stops.map(p=>({...p,color:p.color.startsWith("var(--")?this.resolveGlobalVarColor(p.color):p.color}))),!this.value.stops||this.value.stops.length===0?this.value.stops=[{color:f,position:0,opacity:u}]:this.value.stops[0]={...this.value.stops[0],color:f,opacity:u},this.linkedGlobalVariable=null,s=!0)}if(e!=="solid"&&(this.pendingSolidColor=null),e!=="solid"&&(!this.value.stops||this.value.stops.length===0)&&(this.value.stops=[{color:"#a84b4b",position:0,opacity:100},{color:"#786666",position:100,opacity:100}]),e!=="solid"&&this.value.stops.length===1){const u=this.value.stops[0].color;if(u.startsWith("var(--")){const h=this.resolveGlobalVarColor(u),p=At(h);p&&p.type!=="solid"&&p.stops.length>=2?(this.value.stops=p.stops,this.value.angle=p.angle,this.value.type=p.type):(this.value.stops.push({color:"#786666",position:100,opacity:100}),this.value.angle=90)}else if(u.startsWith("linear-gradient")||u.startsWith("radial-gradient")){const h=At(u);h&&h.type!=="solid"&&h.stops.length>=2?(this.value.stops=h.stops,this.value.angle=h.angle,this.value.type=h.type):(this.value.stops=[{color:"#a84b4b",position:0,opacity:100},{color:"#786666",position:100,opacity:100}],this.value.angle=90)}else this.value.stops.push({color:"#786666",position:100,opacity:100}),this.value.angle=90}else if(e!=="solid"&&this.value.stops.length>=2)this.value.angle||(this.value.angle=90);else if(e==="solid"&&n&&i){const f=this.value.stops&&this.value.stops[0]?this.value.stops[0].opacity??100:100;this.value.stops=[{color:i,position:0,opacity:f}],this.value.angle=0}if(this.popoverEl){const f=this.popoverEl.querySelectorAll(".gradient-type-tab");f.forEach(p=>p.classList.remove("active"));const u=f[0],h=f[1];e==="solid"?u==null||u.classList.add("active"):h==null||h.classList.add("active")}const o=(c=this.popoverEl)==null?void 0:c.querySelector(".gradient-editor-content");o&&this.updatePopoverContent(o),this.updateUI(),(r||s||a!==e)&&this.triggerChange()}updatePopoverContent(e){if(e.innerHTML="",!!this.value){if(this.variant!=="global"&&this.currentMode==="global"){this.renderGlobalColors(e);return}this.value.type==="solid"?this.renderSolid(e):this.renderGradient(e)}}renderGlobalColors(e){(!this.value||!this.value.stops||!this.value.stops.length)&&(this.value||(this.value=this.defaultValue()),this.value.stops=[{color:"#000000",position:0,opacity:100}]);const r=this.value.stops[0],a=h=>{h.innerHTML="";let p={};try{p=Le.GlobalVariables||{}}catch(d){console.warn("Could not access Setting.GlobalVariables",d)}if(!p||Object.keys(p).length===0){const d=document.createElement("div");d.textContent="No global colors defined",d.style.fontSize="12px",d.style.color="#666",d.style.padding="8px",h.appendChild(d);return}Object.keys(Le.GlobalVariables),this.globalSearchQuery.toLowerCase();let m;this.globalLayoutMode==="list"?(m=document.createElement("div"),m.className="global-colors-list"):(m=document.createElement("div"),m.className="global-colors-grid"),h.appendChild(m),Object.keys(Le.GlobalVariables).forEach(d=>{let g=Le.GlobalVariables[d];if(this.globalLayoutMode==="list"){const x=document.createElement("div");x.className="global-color-row";const w=document.createElement("div");w.className="global-color-circle";const v=this.resolveGlobalVarColor(g);w.style.background=Xa(v),(this.linkedGlobalVariable===`var(--${d})`||r.color===`var(--${d})`)&&w.classList.add("selected");const L=document.createElement("span");L.className="global-color-label",L.textContent=d.split("-").map(_=>_.charAt(0).toUpperCase()+_.slice(1)).join(" "),x.appendChild(w),x.appendChild(L),x.addEventListener("click",_=>{_.preventDefault();const C=`var(--${d})`;this.setValue(C),this.pendingSolidColor=C,a(h)}),m.appendChild(x)}else{const x=document.createElement("div");x.className="global-color-circle";const w=this.resolveGlobalVarColor(g);x.style.background=Xa(w),x.title=d.split("-").map(I=>I.charAt(0).toUpperCase()+I.slice(1)).join(" "),(this.linkedGlobalVariable===`var(--${d})`||r.color===`var(--${d})`)&&x.classList.add("selected"),x.addEventListener("click",I=>{I.preventDefault();const L=`var(--${d})`;this.setValue(L),this.pendingSolidColor=L,a(h)}),m.appendChild(x)}})},n=document.createElement("div");n.className="global-controls-row";const i=document.createElement("div");i.className="global-search-container";const s=document.createElement("span");s.className="global-search-icon",s.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>';const o=document.createElement("span");o.className="global-search-separator";const l=document.createElement("input");l.type="text",l.className="global-search-input",l.placeholder="Search",l.value=this.globalSearchQuery;const c=document.createElement("div");l.addEventListener("input",h=>{this.globalSearchQuery=h.target.value,a(c)}),i.appendChild(s),i.appendChild(o),i.appendChild(l);const f=document.createElement("button");f.className="global-layout-toggle",f.type="button";const u=()=>{f.innerHTML=this.globalLayoutMode==="list"?'<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="7" height="7"></rect><rect x="14" y="3" width="7" height="7"></rect><rect x="14" y="14" width="7" height="7"></rect><rect x="3" y="14" width="7" height="7"></rect></svg>':'<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="8" y1="6" x2="21" y2="6"></line><line x1="8" y1="12" x2="21" y2="12"></line><line x1="8" y1="18" x2="21" y2="18"></line><line x1="3" y1="6" x2="3.01" y2="6"></line><line x1="3" y1="12" x2="3.01" y2="12"></line><line x1="3" y1="18" x2="3.01" y2="18"></line></svg>'};u(),f.addEventListener("click",()=>{this.globalLayoutMode=this.globalLayoutMode==="list"?"grid":"list",u(),a(c)}),n.appendChild(i),n.appendChild(f),e.appendChild(n),e.appendChild(c),a(c)}renderSolid(e){(!this.value||!this.value.stops||!this.value.stops.length)&&(this.value||(this.value=this.defaultValue()),this.value.stops=[{color:"#000000",position:0,opacity:100}]);const r=this.value.stops[0],a=new kf({initialColor:r.color.startsWith("var(--")?this.resolveGlobalVarColor(r.color):r.color,initialOpacity:r.opacity??100,onColorChange:(n,i)=>{if(this.clearGlobalBindingForCustomChange(),this.value){const s=At(n);if(s&&s.type!=="solid"){this.value=s,this.switchType(s.type,!0);return}this.value.stops[0].color=n,this.value.stops[0].opacity=i,this.updateUI(),this.triggerChange(),this.pendingSolidColor=n}}});this.solidPicker=a,e.appendChild(a.getElement())}renderGradient(e){this.solidPicker=null;let r=null;{const f=document.createElement("div");f.className="gradient-subtype-inline";const u=document.createElement("select");u.className="gradient-subtype-select";const h=document.createElement("option");h.value="linear",h.textContent="Linear";const p=document.createElement("option");p.value="radial",p.textContent="Radial",u.appendChild(h),u.appendChild(p),u.value=this.value.type==="radial"?"radial":"linear",r=document.createElement("input"),r.type="text",r.inputMode="numeric",r.className="gradient-degree-input",r.value=`${this.value.angle??90}°`,r.style.width="75px",r.style.textAlign="center",(!this.value.angle||this.value.stops.length<2)&&(this.value.angle=90,r.value="90°");const m=document.createElement("button");m.type="button",m.className="gradient-flip-btn",m.innerHTML=gf,u.addEventListener("change",()=>{this.clearGlobalBindingForCustomChange(),this.switchType(u.value==="radial"?"radial":"linear",!0),r&&this.updateDegreeVisibility(r)}),r.addEventListener("focus",d=>{const g=d.target;g.value=g.value.replace(/[^0-9-]/g,""),setTimeout(()=>g.select(),0)}),r.addEventListener("input",d=>{this.clearGlobalBindingForCustomChange();const g=parseInt(d.target.value);!Number.isNaN(g)&&this.value&&(this.value.angle=Math.max(0,Math.min(360,g)),this.debouncedPreviewUpdate())}),r.addEventListener("blur",d=>{var w;this.previewUpdateTimeout&&(clearTimeout(this.previewUpdateTimeout),this.previewUpdateTimeout=null);const g=d.target;let x=parseInt(g.value);Number.isNaN(x)&&(x=((w=this.value)==null?void 0:w.angle)??0),x=Math.max(0,Math.min(360,x)),this.value&&(this.value.angle=x),g.value=`${x}°`,this.updateGradientPreview(),this.updateUI(),this.triggerChange()}),m.addEventListener("click",()=>{this.clearGlobalBindingForCustomChange(),!(!this.value||!this.value.stops)&&(this.value.stops.forEach(d=>{d.position=100-d.position}),this.value.stops.sort((d,g)=>d.position-g.position),this.updateGradientPreview(a),this.createHandles(n,a),this.updateStopsList(l),this.updateUI(),this.triggerChange())}),f.appendChild(u),f.appendChild(r),f.appendChild(m),e.appendChild(f),this.updateDegreeVisibility(r)}const a=document.createElement("div");a.className="gradient-preview",this.updateGradientPreview(a);const n=document.createElement("div");n.className="gradient-handles",a.appendChild(n),e.appendChild(a),this.createHandles(n,a),a.addEventListener("click",f=>{var d;const u=f.target;if(u.classList.contains("gstop-handle")||u.classList.contains("gstop-chip"))return;const h=a.getBoundingClientRect(),m=(f.clientX-h.left)/h.width*100;this.clearGlobalBindingForCustomChange(),this.addStopAtPosition(m),this.updateStopsList(),this.updateGradientPreview(a),this.createHandles(n,a),this.updateUI(),((d=document.activeElement)==null?void 0:d.tagName)!=="INPUT"&&this.repositionPopover(),this.triggerChange()});const i=document.createElement("div");i.className="gradient-stops-header";const s=document.createElement("span");s.textContent="Stops";const o=document.createElement("button");o.type="button",o.className="gradient-add-stop",o.innerHTML=Ef,i.appendChild(s),i.appendChild(o);const l=document.createElement("div");l.className="gradient-stops",e.appendChild(i),e.appendChild(l),this.updateStopsList(l);const c=is(f=>{const u=At(f);u&&(this.clearGlobalBindingForCustomChange(),this.value=u,this.switchType(u.type,!0),this.updateUI(),this.triggerChange())},"all");this.recentGradientRefresh=c.refresh,e.appendChild(c.container),o.addEventListener("click",()=>{var f;this.clearGlobalBindingForCustomChange(),this.addStop(),this.updateStopsList(l),this.updateGradientPreview(a),this.createHandles(n,a),this.updateUI(),((f=document.activeElement)==null?void 0:f.tagName)!=="INPUT"&&this.repositionPopover(),this.triggerChange()})}updateDegreeVisibility(e){var r;e&&(((r=this.value)==null?void 0:r.type)==="radial"?(e.disabled=!0,e.style.opacity="0.5"):(e.disabled=!1,e.style.opacity="1"))}updateGradientPreview(e){var a;const r=e||((a=this.popoverEl)==null?void 0:a.querySelector(".gradient-preview"));if(r&&this.value)if(this.value.type==="solid")r.style.background=Zt(this.value);else{const n=this.value.stops.map(i=>`${Hi(i.color,i.opacity??100)} ${i.position}%`).join(", ");r.style.background=`linear-gradient(90deg, ${n})`}}debouncedPreviewUpdate(e){this.previewUpdateTimeout&&clearTimeout(this.previewUpdateTimeout),this.previewUpdateTimeout=window.setTimeout(()=>{this.updateGradientPreview(e),this.previewUpdateTimeout=null},16)}createHandles(e,r){e.innerHTML="",!(!this.value||this.value.type==="solid"||!this.value.stops)&&this.value.stops.forEach((a,n)=>{const i=document.createElement("div");i.className="gstop-handle",i.style.left=`${Math.max(0,Math.min(100,a.position))}%`,i.style.top="0%";const s=document.createElement("div");s.className="gstop-chip";const o=this.resolveGlobalVarColor(a.color);s.style.backgroundColor=o,i.appendChild(s);let l=!1,c=!1,f=0,u=0;const h=d=>{l=!0,c=!1,f=d.clientX,u=this.value.stops[n].position,i.classList.add("selected"),document.addEventListener("mousemove",p),document.addEventListener("mouseup",m),d.preventDefault(),d.stopPropagation()},p=d=>{if(!l||!this.value)return;const g=d.clientX-f;if(Math.abs(g)>3&&(c=!0),c){this.clearGlobalBindingForCustomChange();const x=r.getBoundingClientRect();let w=u+g/x.width*100;w=Math.max(0,Math.min(100,w)),this.value.stops[n].position=Math.round(w),i.style.left=`${w}%`,this.updateGradientPreview()}},m=d=>{var g;if(l)if(l=!1,i.classList.remove("selected"),document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",m),c)this.value&&(this.value.stops.sort((x,w)=>x.position-w.position),this.createHandles(e,r),this.updateStopsList()),this.updateUI(),this.triggerChange();else{d.stopPropagation();const x=(g=this.value)==null?void 0:g.stops[n];x&&setTimeout(()=>{const w=this.getSharedStopColorPicker();w.getIsOpen()&&w.close(!1),this.colorPickerStopIndex=n,w.setOnChange((I,L)=>{this.clearGlobalBindingForCustomChange(),this.value&&this.value.stops[n]&&(this.value.stops[n].color=I,L!==void 0&&(this.value.stops[n].opacity=L),s.style.backgroundColor=I,this.updateGradientPreview(),this.updateStopsList(),this.updateUI(),this.triggerChange())});const v=this.resolveGlobalVarColor(x.color);w.open(v,s,x.opacity??100)},0)}};i.addEventListener("mousedown",h),e.appendChild(i)})}updateStopsList(e){var a;const r=e||((a=this.popoverEl)==null?void 0:a.querySelector(".gradient-stops"));!r||!this.value||this.value.type==="solid"||!this.value.stops||(r.innerHTML="",this.value.stops.forEach((n,i)=>{var v,I;const s=document.createElement("div");s.className="gstop-row";const o=document.createElement("div");o.className="gstop-position-group";const l=document.createElement("input");l.type="text",l.className="gstop-position-input",l.value=`${n.position}%`,l.style.width="60px",o.appendChild(l);const c=document.createElement("div");c.className="gstop-color-container";const f=this.resolveGlobalVarColor(n.color),u=n.opacity??100,h=document.createElement("div");h.className="gstop-color-preview",u<100&&h.classList.add("has-transparency");const p=document.createElement("div");p.className="gstop-color-preview-color";const m=pt(f);p.style.backgroundColor=`rgba(${m.r}, ${m.g}, ${m.b}, ${u/100})`,h.appendChild(p);const d=document.createElement("input");d.type="text",d.className="gstop-color-input",d.value=f.replace("#","").toUpperCase();const g=document.createElement("div");g.className="gstop-color-separator";const x=document.createElement("input");x.type="text",x.className="gstop-opacity-input",x.value=`${n.opacity??100}%`,c.appendChild(h),c.appendChild(d),c.appendChild(g),c.appendChild(x);const w=document.createElement("button");w.type="button",w.className="gstop-del",w.innerHTML=xf,w.disabled=(((I=(v=this.value)==null?void 0:v.stops)==null?void 0:I.length)||0)<=2,s.appendChild(o),s.appendChild(c),s.appendChild(w),r.appendChild(s),h.addEventListener("click",L=>{L.preventDefault(),L.stopPropagation();const _=this.getSharedStopColorPicker();_.getIsOpen()&&_.close(!1),this.colorPickerStopIndex=i,_.setOnChange((M,N)=>{this.clearGlobalBindingForCustomChange(),d.value=M.replace("#","").toUpperCase(),this.value.stops[i].color=M;const z=N!==void 0?N:this.value.stops[i].opacity??100;N!==void 0&&(this.value.stops[i].opacity=N,x.value=`${N}%`);const B=pt(M);p.style.backgroundColor=`rgba(${B.r}, ${B.g}, ${B.b}, ${z/100})`,z<100?h.classList.add("has-transparency"):h.classList.remove("has-transparency"),this.updateGradientPreview(),this.createHandles(this.popoverEl.querySelector(".gradient-handles"),this.popoverEl.querySelector(".gradient-preview")),this.updateUI(),this.triggerChange()});const C=this.resolveGlobalVarColor(n.color);_.open(C,h,n.opacity??100)}),d.addEventListener("input",()=>{this.clearGlobalBindingForCustomChange();const L=d.value.trim(),_=L.startsWith("#")?L:`#${L}`;if(/^#[0-9A-Fa-f]{6}$/.test(_)){this.value.stops[i].color=_;const C=this.value.stops[i].opacity??100,M=pt(_);p.style.backgroundColor=`rgba(${M.r}, ${M.g}, ${M.b}, ${C/100})`,this.debouncedPreviewUpdate()}}),d.addEventListener("blur",()=>{this.previewUpdateTimeout&&(clearTimeout(this.previewUpdateTimeout),this.previewUpdateTimeout=null),this.updateGradientPreview(),this.updateUI(),this.triggerChange()}),x.addEventListener("focus",L=>{const _=L.target;_.value=_.value.replace("%",""),setTimeout(()=>_.select(),0)}),x.addEventListener("input",()=>{this.clearGlobalBindingForCustomChange();const L=x.value.replace(/[^\d]/g,""),_=parseInt(L,10);if(!Number.isNaN(_)){const C=Math.max(0,Math.min(100,_));this.value.stops[i].opacity=C;const M=this.resolveGlobalVarColor(this.value.stops[i].color),N=pt(M);p.style.backgroundColor=`rgba(${N.r}, ${N.g}, ${N.b}, ${C/100})`,C<100?h.classList.add("has-transparency"):h.classList.remove("has-transparency"),this.debouncedPreviewUpdate()}}),x.addEventListener("blur",()=>{x.value=`${this.value.stops[i].opacity??100}%`,this.previewUpdateTimeout&&(clearTimeout(this.previewUpdateTimeout),this.previewUpdateTimeout=null),this.updateGradientPreview(),this.createHandles(this.popoverEl.querySelector(".gradient-handles"),this.popoverEl.querySelector(".gradient-preview")),this.updateUI(),this.triggerChange()}),x.addEventListener("keydown",L=>{L.key==="Enter"&&(L.preventDefault(),x.blur())}),l.addEventListener("focus",L=>{const _=L.target;_.value=_.value.replace("%",""),_.select()}),l.addEventListener("input",L=>{this.clearGlobalBindingForCustomChange();const _=L.target,C=parseInt(_.value.replace(/[^\d]/g,""),10);if(!Number.isNaN(C)){const M=Math.max(0,Math.min(100,C));this.value.stops[i].position=M,_.value=`${M}%`,this.debouncedPreviewUpdate()}}),l.addEventListener("blur",L=>{this.previewUpdateTimeout&&(clearTimeout(this.previewUpdateTimeout),this.previewUpdateTimeout=null);const _=L.target,C=parseInt(_.value.replace(/[^\d]/g,""),10);if(Number.isNaN(C))_.value=`${this.value.stops[i].position}%`;else{const M=Math.max(0,Math.min(100,C));this.value.stops[i].position=M,_.value=`${M}%`}this.updateGradientPreview(),this.createHandles(this.popoverEl.querySelector(".gradient-handles"),this.popoverEl.querySelector(".gradient-preview")),this.updateStopsList(),this.updateUI(),this.triggerChange()}),w.addEventListener("click",()=>{var L,_;(this.value.stops.length||0)<=2||((L=this.sharedStopColorPicker)!=null&&L.getIsOpen()&&this.colorPickerStopIndex===i?(this.sharedStopColorPicker.close(!1),this.colorPickerStopIndex=null):this.colorPickerStopIndex!==null&&this.colorPickerStopIndex>i&&this.colorPickerStopIndex--,this.clearGlobalBindingForCustomChange(),this.value.stops.splice(i,1),this.createHandles(this.popoverEl.querySelector(".gradient-handles"),this.popoverEl.querySelector(".gradient-preview")),this.updateStopsList(),this.updateGradientPreview(),this.updateUI(),((_=document.activeElement)==null?void 0:_.tagName)!=="INPUT"&&this.repositionPopover(),this.triggerChange())})}))}addStop(){if(!this.value||this.value.type==="solid"||!this.value.stops)return;const e=this.value.stops.map(n=>n.position).sort((n,i)=>n-i);let r=50,a=0;for(let n=0;n<e.length-1;n++){const i=e[n+1]-e[n];i>a&&(a=i,r=e[n]+i/2)}this.addStopAtPosition(r)}addStopAtPosition(e){if(!this.value||this.value.type==="solid"||!this.value.stops)return;const r=Math.max(0,Math.min(100,e)),a=[...this.value.stops].sort((c,f)=>c.position-f.position);let n=a[0],i=a[a.length-1];for(let c=0;c<a.length-1;c++)if(a[c].position<=r&&a[c+1].position>=r){n=a[c],i=a[c+1];break}let s,o;if(n===i||n.position===i.position)s=n.color,o=n.opacity??100;else{const c=(r-n.position)/(i.position-n.position),f=pt(n.color),u=pt(i.color),h=Math.round(f.r+(u.r-f.r)*c),p=Math.round(f.g+(u.g-f.g)*c),m=Math.round(f.b+(u.b-f.b)*c);s=`#${h.toString(16).padStart(2,"0")}${p.toString(16).padStart(2,"0")}${m.toString(16).padStart(2,"0")}`.toUpperCase(),o=Math.round((n.opacity??100)+((i.opacity??100)-(n.opacity??100))*c)}const l={position:Math.round(r),color:s,opacity:o};this.value.stops.push(l),this.value.stops.sort((c,f)=>c.position-f.position)}openPopover(){if(this.popoverEl&&(er.openInstance&&er.openInstance!==this&&er.openInstance.closePopover(),!this.isPopoverOpen)){if(this.isPopoverOpen=!0,er.openInstance=this,this.backdropEl&&(this.backdropEl.style.display="block",this.backdropEl.parentElement||document.body.appendChild(this.backdropEl)),this.popoverEl.style.display="flex",this.refreshPopoverContent(),this.element){const e=this.element.getBoundingClientRect(),r=306,a=window.innerWidth,n=window.innerHeight,i=16;this.popoverEl.style.position="fixed",this.popoverEl.style.zIndex="10000",this.popoverEl.style.left="-9999px",this.popoverEl.style.top="0px";const s=this.popoverEl.offsetHeight;let o=e.right+8,l=e.top;const c=a-e.right,f=e.left,u=r+i;c<u&&f>c+100&&(o=e.left-r-8);const h=n-e.bottom,p=e.top;p>=s+i?l=e.top-s-8:h>=s+i?l=e.bottom+8:p>h?(l=e.top-s-8,l<i&&(l=i)):(l=e.bottom+8,l+s>n-i&&(l=n-s-i)),this.popoverEl.style.left=`${o}px`,this.popoverEl.style.top=`${l}px`,this.popoverPosition={left:o,top:l}}setTimeout(()=>document.addEventListener("click",this.onBackgroundClick,!0),200),document.addEventListener("keydown",this.handlePopoverKeydown,!0)}}repositionPopover(){var e;if(!(!this.popoverEl||!this.isPopoverOpen||!this.element)&&((e=document.activeElement)==null?void 0:e.tagName)!=="INPUT"){if(this.popoverPosition){this.popoverEl.style.left=`${this.popoverPosition.left}px`,this.popoverEl.style.top=`${this.popoverPosition.top}px`;return}requestAnimationFrame(()=>{if(!this.popoverEl||!this.element)return;const r=this.element.getBoundingClientRect(),a=306,n=window.innerWidth,i=window.innerHeight,s=16;this.popoverEl.style.left,this.popoverEl.style.top,this.popoverEl.style.left="-9999px",this.popoverEl.style.top="0px";const o=this.popoverEl.offsetHeight;let l=r.right+8,c=r.top;const f=n-r.right,u=r.left,h=a+s;f<h&&u>f+100&&(l=r.left-a-8);const p=i-r.bottom,m=r.top;m>=o+s?c=r.top-o-8:p>=o+s?c=r.bottom+8:m>p?(c=r.top-o-8,c<s&&(c=s)):(c=r.bottom+8,c+o>i-s&&(c=i-o-s)),this.popoverEl.style.left=`${l}px`,this.popoverEl.style.top=`${c}px`})}}refreshPopoverContent(){var i,s;if(!this.popoverEl)return;const e=this.popoverEl.querySelectorAll(".gradient-type-tab");e.forEach(o=>o.classList.remove("active"));const r=e[0],a=e[1];((i=this.value)==null?void 0:i.type)==="solid"?r.classList.add("active"):(a.classList.add("active"),(s=this.recentGradientRefresh)==null||s.call(this)),this.popoverEl.offsetHeight;const n=this.popoverEl.querySelector(".gradient-editor-content");n&&this.updatePopoverContent(n)}closePopover(){var e,r;if(!(!this.popoverEl||!this.isPopoverOpen)){if(this.isPopoverOpen=!1,this.popoverPosition=null,(e=this.sharedStopColorPicker)!=null&&e.getIsOpen()&&(this.sharedStopColorPicker.close(!0),this.colorPickerStopIndex=null),this.backdropEl&&(this.backdropEl.style.display="none"),this.popoverEl.style.display="none",document.removeEventListener("click",this.onBackgroundClick,!0),document.removeEventListener("keydown",this.handlePopoverKeydown,!0),this.commitPendingSolidColor(),this.value&&this.value.type!=="solid"){const a=this.resolveGradientGlobalVars(this.value),n=Zt(a);aa.addColor(n,"gradient"),(r=this.recentGradientRefresh)==null||r.call(this)}this.previewUpdateTimeout&&(clearTimeout(this.previewUpdateTimeout),this.previewUpdateTimeout=null),er.openInstance===this&&(er.openInstance=null)}}commitPendingSolidColor(){if(this.pendingSolidColor){if(this.solidPicker)this.solidPicker.commitRecentColor();else{const e=this.resolveGlobalVarColor(this.pendingSolidColor);aa.addColor(e,"solid")}this.pendingSolidColor=null}}handlePaste(e){var a;e.preventDefault();const r=((a=e.clipboardData)==null?void 0:a.getData("text"))||"";this.parseAndSet(r)}handleTextInput(e){const r=e.target;this.parseAndSet(r.value)}parseAndSet(e){let r=e.trim();r&&!r.startsWith("#")&&!r.startsWith("var(")&&!r.startsWith("rgb")&&!r.startsWith("hsl")&&!r.includes("gradient")&&/^[0-9A-Fa-f]{3}$|^[0-9A-Fa-f]{6}$|^[0-9A-Fa-f]{8}$/.test(r)&&(r="#"+r,this.inputEl&&(this.inputEl.value=r));const a=At(r);a&&this.setValue(a)}getChangePayload(){var e;if(this.value)return this.isBoundToGlobal()?((e=this.value.stops)==null?void 0:e.some(a=>a.opacity!==void 0&&a.opacity!==100))?this.resolveGradientGlobalVars(this.value):this.linkedGlobalVariable||void 0:this.value}triggerChange(){var r;const e=this.getChangePayload();(r=this.onColorChange)==null||r.call(this,this.getValue()),e!==void 0&&(this.changeDebounceTimeout&&clearTimeout(this.changeDebounceTimeout),this.changeDebounceTimeout=setTimeout(()=>{var a,n;(a=this.onChange)==null||a.call(this,e),(n=this.detectChange)==null||n.call(this,e),this.changeDebounceTimeout=null},er.CHANGE_DEBOUNCE_DELAY))}getElement(){return this.element}getValue(){const e=this.getChangePayload();return e?typeof e=="string"?e:Zt(e):""}getCSSValue(){const e=this.getChangePayload();return e?typeof e=="string"?e:Zt(e):""}getCSSForText(){return this.value?this.cssForTextValue():{}}getRawValue(){return this.value}};er.openInstance=null,er.CHANGE_DEBOUNCE_DELAY=150;let na=er;/*! xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */var zn={};zn.version="0.18.5";var T0=1252,_f=[874,932,936,949,950,1250,1251,1252,1253,1254,1255,1256,1257,1258,1e4],ss={0:1252,1:65001,2:65001,77:1e4,128:932,129:949,130:1361,134:936,136:950,161:1253,162:1254,163:1258,177:1255,178:1256,186:1257,204:1251,222:874,238:1250,255:1252,69:6969},os=function(t){_f.indexOf(t)!=-1&&(T0=ss[0]=t)};function Tf(){os(1252)}var ar=function(t){os(t)};function ls(){ar(1200),Tf()}function no(t){for(var e=[],r=0,a=t.length;r<a;++r)e[r]=t.charCodeAt(r);return e}function Sf(t){for(var e=[],r=0;r<t.length>>1;++r)e[r]=String.fromCharCode(t.charCodeAt(2*r)+(t.charCodeAt(2*r+1)<<8));return e.join("")}function S0(t){for(var e=[],r=0;r<t.length>>1;++r)e[r]=String.fromCharCode(t.charCodeAt(2*r+1)+(t.charCodeAt(2*r)<<8));return e.join("")}var $a=function(t){var e=t.charCodeAt(0),r=t.charCodeAt(1);return e==255&&r==254?Sf(t.slice(2)):e==254&&r==255?S0(t.slice(2)):e==65279?t.slice(1):t},bn=function(e){return String.fromCharCode(e)},io=function(e){return String.fromCharCode(e)},Ui,Or="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function an(t){for(var e="",r=0,a=0,n=0,i=0,s=0,o=0,l=0,c=0;c<t.length;)r=t.charCodeAt(c++),i=r>>2,a=t.charCodeAt(c++),s=(r&3)<<4|a>>4,n=t.charCodeAt(c++),o=(a&15)<<2|n>>6,l=n&63,isNaN(a)?o=l=64:isNaN(n)&&(l=64),e+=Or.charAt(i)+Or.charAt(s)+Or.charAt(o)+Or.charAt(l);return e}function Bt(t){var e="",r=0,a=0,n=0,i=0,s=0,o=0,l=0;t=t.replace(/[^\w\+\/\=]/g,"");for(var c=0;c<t.length;)i=Or.indexOf(t.charAt(c++)),s=Or.indexOf(t.charAt(c++)),r=i<<2|s>>4,e+=String.fromCharCode(r),o=Or.indexOf(t.charAt(c++)),a=(s&15)<<4|o>>2,o!==64&&(e+=String.fromCharCode(a)),l=Or.indexOf(t.charAt(c++)),n=(o&3)<<6|l,l!==64&&(e+=String.fromCharCode(n));return e}var _e=function(){return typeof Buffer<"u"&&typeof process<"u"&&typeof process.versions<"u"&&!!process.versions.node}(),Lr=function(){if(typeof Buffer<"u"){var t=!Buffer.from;if(!t)try{Buffer.from("foo","utf8")}catch{t=!0}return t?function(e,r){return r?new Buffer(e,r):new Buffer(e)}:Buffer.from.bind(Buffer)}return function(){}}();function Dr(t){return _e?Buffer.alloc?Buffer.alloc(t):new Buffer(t):typeof Uint8Array<"u"?new Uint8Array(t):new Array(t)}function so(t){return _e?Buffer.allocUnsafe?Buffer.allocUnsafe(t):new Buffer(t):typeof Uint8Array<"u"?new Uint8Array(t):new Array(t)}var Dt=function(e){return _e?Lr(e,"binary"):e.split("").map(function(r){return r.charCodeAt(0)&255})};function fi(t){if(typeof ArrayBuffer>"u")return Dt(t);for(var e=new ArrayBuffer(t.length),r=new Uint8Array(e),a=0;a!=t.length;++a)r[a]=t.charCodeAt(a)&255;return e}function Hr(t){if(Array.isArray(t))return t.map(function(a){return String.fromCharCode(a)}).join("");for(var e=[],r=0;r<t.length;++r)e[r]=String.fromCharCode(t[r]);return e.join("")}function bf(t){if(typeof Uint8Array>"u")throw new Error("Unsupported");return new Uint8Array(t)}function cs(t){if(typeof ArrayBuffer>"u")throw new Error("Unsupported");if(t instanceof ArrayBuffer)return cs(new Uint8Array(t));for(var e=new Array(t.length),r=0;r<t.length;++r)e[r]=t[r];return e}var ft=_e?function(t){return Buffer.concat(t.map(function(e){return Buffer.isBuffer(e)?e:Lr(e)}))}:function(t){if(typeof Uint8Array<"u"){var e=0,r=0;for(e=0;e<t.length;++e)r+=t[e].length;var a=new Uint8Array(r),n=0;for(e=0,r=0;e<t.length;r+=n,++e)if(n=t[e].length,t[e]instanceof Uint8Array)a.set(t[e],r);else{if(typeof t[e]=="string")throw"wtf";a.set(new Uint8Array(t[e]),r)}return a}return[].concat.apply([],t.map(function(i){return Array.isArray(i)?i:[].slice.call(i)}))};function Lf(t){for(var e=[],r=0,a=t.length+250,n=Dr(t.length+255),i=0;i<t.length;++i){var s=t.charCodeAt(i);if(s<128)n[r++]=s;else if(s<2048)n[r++]=192|s>>6&31,n[r++]=128|s&63;else if(s>=55296&&s<57344){s=(s&1023)+64;var o=t.charCodeAt(++i)&1023;n[r++]=240|s>>8&7,n[r++]=128|s>>2&63,n[r++]=128|o>>6&15|(s&3)<<4,n[r++]=128|o&63}else n[r++]=224|s>>12&15,n[r++]=128|s>>6&63,n[r++]=128|s&63;r>a&&(e.push(n.slice(0,r)),r=0,n=Dr(65535),a=65530)}return e.push(n.slice(0,r)),ft(e)}var Lt=/\u0000/g,Wa=/[\u0001-\u0006]/g;function Ta(t){for(var e="",r=t.length-1;r>=0;)e+=t.charAt(r--);return e}function nr(t,e){var r=""+t;return r.length>=e?r:Ke("0",e-r.length)+r}function fs(t,e){var r=""+t;return r.length>=e?r:Ke(" ",e-r.length)+r}function Xn(t,e){var r=""+t;return r.length>=e?r:r+Ke(" ",e-r.length)}function Ff(t,e){var r=""+Math.round(t);return r.length>=e?r:Ke("0",e-r.length)+r}function Af(t,e){var r=""+t;return r.length>=e?r:Ke("0",e-r.length)+r}var oo=Math.pow(2,32);function xa(t,e){if(t>oo||t<-oo)return Ff(t,e);var r=Math.round(t);return Af(r,e)}function jn(t,e){return e=e||0,t.length>=7+e&&(t.charCodeAt(e)|32)===103&&(t.charCodeAt(e+1)|32)===101&&(t.charCodeAt(e+2)|32)===110&&(t.charCodeAt(e+3)|32)===101&&(t.charCodeAt(e+4)|32)===114&&(t.charCodeAt(e+5)|32)===97&&(t.charCodeAt(e+6)|32)===108}var lo=[["Sun","Sunday"],["Mon","Monday"],["Tue","Tuesday"],["Wed","Wednesday"],["Thu","Thursday"],["Fri","Friday"],["Sat","Saturday"]],Ci=[["J","Jan","January"],["F","Feb","February"],["M","Mar","March"],["A","Apr","April"],["M","May","May"],["J","Jun","June"],["J","Jul","July"],["A","Aug","August"],["S","Sep","September"],["O","Oct","October"],["N","Nov","November"],["D","Dec","December"]];function If(t){return t||(t={}),t[0]="General",t[1]="0",t[2]="0.00",t[3]="#,##0",t[4]="#,##0.00",t[9]="0%",t[10]="0.00%",t[11]="0.00E+00",t[12]="# ?/?",t[13]="# ??/??",t[14]="m/d/yy",t[15]="d-mmm-yy",t[16]="d-mmm",t[17]="mmm-yy",t[18]="h:mm AM/PM",t[19]="h:mm:ss AM/PM",t[20]="h:mm",t[21]="h:mm:ss",t[22]="m/d/yy h:mm",t[37]="#,##0 ;(#,##0)",t[38]="#,##0 ;[Red](#,##0)",t[39]="#,##0.00;(#,##0.00)",t[40]="#,##0.00;[Red](#,##0.00)",t[45]="mm:ss",t[46]="[h]:mm:ss",t[47]="mmss.0",t[48]="##0.0E+0",t[49]="@",t[56]='"上午/下午 "hh"時"mm"分"ss"秒 "',t}var ge={0:"General",1:"0",2:"0.00",3:"#,##0",4:"#,##0.00",9:"0%",10:"0.00%",11:"0.00E+00",12:"# ?/?",13:"# ??/??",14:"m/d/yy",15:"d-mmm-yy",16:"d-mmm",17:"mmm-yy",18:"h:mm AM/PM",19:"h:mm:ss AM/PM",20:"h:mm",21:"h:mm:ss",22:"m/d/yy h:mm",37:"#,##0 ;(#,##0)",38:"#,##0 ;[Red](#,##0)",39:"#,##0.00;(#,##0.00)",40:"#,##0.00;[Red](#,##0.00)",45:"mm:ss",46:"[h]:mm:ss",47:"mmss.0",48:"##0.0E+0",49:"@",56:'"上午/下午 "hh"時"mm"分"ss"秒 "'},co={5:37,6:38,7:39,8:40,23:0,24:0,25:0,26:0,27:14,28:14,29:14,30:14,31:14,50:14,51:14,52:14,53:14,54:14,55:14,56:14,57:14,58:14,59:1,60:2,61:3,62:4,67:9,68:10,69:12,70:13,71:14,72:14,73:15,74:16,75:17,76:20,77:21,78:22,79:45,80:46,81:47,82:0},Nf={5:'"$"#,##0_);\\("$"#,##0\\)',63:'"$"#,##0_);\\("$"#,##0\\)',6:'"$"#,##0_);[Red]\\("$"#,##0\\)',64:'"$"#,##0_);[Red]\\("$"#,##0\\)',7:'"$"#,##0.00_);\\("$"#,##0.00\\)',65:'"$"#,##0.00_);\\("$"#,##0.00\\)',8:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',66:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',41:'_(* #,##0_);_(* \\(#,##0\\);_(* "-"_);_(@_)',42:'_("$"* #,##0_);_("$"* \\(#,##0\\);_("$"* "-"_);_(@_)',43:'_(* #,##0.00_);_(* \\(#,##0.00\\);_(* "-"??_);_(@_)',44:'_("$"* #,##0.00_);_("$"* \\(#,##0.00\\);_("$"* "-"??_);_(@_)'};function Kn(t,e,r){for(var a=t<0?-1:1,n=t*a,i=0,s=1,o=0,l=1,c=0,f=0,u=Math.floor(n);c<e&&(u=Math.floor(n),o=u*s+i,f=u*c+l,!(n-u<5e-8));)n=1/(n-u),i=s,s=o,l=c,c=f;if(f>e&&(c>e?(f=l,o=i):(f=c,o=s)),!r)return[0,a*o,f];var h=Math.floor(a*o/f);return[h,a*o-h*f,f]}function Kr(t,e,r){if(t>2958465||t<0)return null;var a=t|0,n=Math.floor(86400*(t-a)),i=0,s=[],o={D:a,T:n,u:86400*(t-a)-n,y:0,m:0,d:0,H:0,M:0,S:0,q:0};if(Math.abs(o.u)<1e-6&&(o.u=0),e&&e.date1904&&(a+=1462),o.u>.9999&&(o.u=0,++n==86400&&(o.T=n=0,++a,++o.D)),a===60)s=r?[1317,10,29]:[1900,2,29],i=3;else if(a===0)s=r?[1317,8,29]:[1900,1,0],i=6;else{a>60&&--a;var l=new Date(1900,0,1);l.setDate(l.getDate()+a-1),s=[l.getFullYear(),l.getMonth()+1,l.getDate()],i=l.getDay(),a<60&&(i=(i+6)%7),r&&(i=Bf(l,s))}return o.y=s[0],o.m=s[1],o.d=s[2],o.S=n%60,n=Math.floor(n/60),o.M=n%60,n=Math.floor(n/60),o.H=n,o.q=i,o}var b0=new Date(1899,11,31,0,0,0),Mf=b0.getTime(),Of=new Date(1900,2,1,0,0,0);function L0(t,e){var r=t.getTime();return e?r-=1461*24*60*60*1e3:t>=Of&&(r+=24*60*60*1e3),(r-(Mf+(t.getTimezoneOffset()-b0.getTimezoneOffset())*6e4))/(24*60*60*1e3)}function hs(t){return t.indexOf(".")==-1?t:t.replace(/(?:\.0*|(\.\d*[1-9])0+)$/,"$1")}function Pf(t){return t.indexOf("E")==-1?t:t.replace(/(?:\.0*|(\.\d*[1-9])0+)[Ee]/,"$1E").replace(/(E[+-])(\d)$/,"$10$2")}function Df(t){var e=t<0?12:11,r=hs(t.toFixed(12));return r.length<=e||(r=t.toPrecision(10),r.length<=e)?r:t.toExponential(5)}function Rf(t){var e=hs(t.toFixed(11));return e.length>(t<0?12:11)||e==="0"||e==="-0"?t.toPrecision(6):e}function nn(t){var e=Math.floor(Math.log(Math.abs(t))*Math.LOG10E),r;return e>=-4&&e<=-1?r=t.toPrecision(10+e):Math.abs(e)<=9?r=Df(t):e===10?r=t.toFixed(10).substr(0,12):r=Rf(t),hs(Pf(r.toUpperCase()))}function ia(t,e){switch(typeof t){case"string":return t;case"boolean":return t?"TRUE":"FALSE";case"number":return(t|0)===t?t.toString(10):nn(t);case"undefined":return"";case"object":if(t==null)return"";if(t instanceof Date)return Kt(14,L0(t,e&&e.date1904),e)}throw new Error("unsupported value in General format: "+t)}function Bf(t,e){e[0]-=581;var r=t.getDay();return t<60&&(r=(r+6)%7),r}function Vf(t,e,r,a){var n="",i=0,s=0,o=r.y,l,c=0;switch(t){case 98:o=r.y+543;case 121:switch(e.length){case 1:case 2:l=o%100,c=2;break;default:l=o%1e4,c=4;break}break;case 109:switch(e.length){case 1:case 2:l=r.m,c=e.length;break;case 3:return Ci[r.m-1][1];case 5:return Ci[r.m-1][0];default:return Ci[r.m-1][2]}break;case 100:switch(e.length){case 1:case 2:l=r.d,c=e.length;break;case 3:return lo[r.q][0];default:return lo[r.q][1]}break;case 104:switch(e.length){case 1:case 2:l=1+(r.H+11)%12,c=e.length;break;default:throw"bad hour format: "+e}break;case 72:switch(e.length){case 1:case 2:l=r.H,c=e.length;break;default:throw"bad hour format: "+e}break;case 77:switch(e.length){case 1:case 2:l=r.M,c=e.length;break;default:throw"bad minute format: "+e}break;case 115:if(e!="s"&&e!="ss"&&e!=".0"&&e!=".00"&&e!=".000")throw"bad second format: "+e;return r.u===0&&(e=="s"||e=="ss")?nr(r.S,e.length):(a>=2?s=a===3?1e3:100:s=a===1?10:1,i=Math.round(s*(r.S+r.u)),i>=60*s&&(i=0),e==="s"?i===0?"0":""+i/s:(n=nr(i,2+a),e==="ss"?n.substr(0,2):"."+n.substr(2,e.length-1)));case 90:switch(e){case"[h]":case"[hh]":l=r.D*24+r.H;break;case"[m]":case"[mm]":l=(r.D*24+r.H)*60+r.M;break;case"[s]":case"[ss]":l=((r.D*24+r.H)*60+r.M)*60+Math.round(r.S+r.u);break;default:throw"bad abstime format: "+e}c=e.length===3?1:2;break;case 101:l=o,c=1;break}var f=c>0?nr(l,c):"";return f}function Pr(t){var e=3;if(t.length<=e)return t;for(var r=t.length%e,a=t.substr(0,r);r!=t.length;r+=e)a+=(a.length>0?",":"")+t.substr(r,e);return a}var F0=/%/g;function Hf(t,e,r){var a=e.replace(F0,""),n=e.length-a.length;return _r(t,a,r*Math.pow(10,2*n))+Ke("%",n)}function Uf(t,e,r){for(var a=e.length-1;e.charCodeAt(a-1)===44;)--a;return _r(t,e.substr(0,a),r/Math.pow(10,3*(e.length-a)))}function A0(t,e){var r,a=t.indexOf("E")-t.indexOf(".")-1;if(t.match(/^#+0.0E\+0$/)){if(e==0)return"0.0E+0";if(e<0)return"-"+A0(t,-e);var n=t.indexOf(".");n===-1&&(n=t.indexOf("E"));var i=Math.floor(Math.log(e)*Math.LOG10E)%n;if(i<0&&(i+=n),r=(e/Math.pow(10,i)).toPrecision(a+1+(n+i)%n),r.indexOf("e")===-1){var s=Math.floor(Math.log(e)*Math.LOG10E);for(r.indexOf(".")===-1?r=r.charAt(0)+"."+r.substr(1)+"E+"+(s-r.length+i):r+="E+"+(s-i);r.substr(0,2)==="0.";)r=r.charAt(0)+r.substr(2,n)+"."+r.substr(2+n),r=r.replace(/^0+([1-9])/,"$1").replace(/^0+\./,"0.");r=r.replace(/\+-/,"-")}r=r.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,function(o,l,c,f){return l+c+f.substr(0,(n+i)%n)+"."+f.substr(i)+"E"})}else r=e.toExponential(a);return t.match(/E\+00$/)&&r.match(/e[+-]\d$/)&&(r=r.substr(0,r.length-1)+"0"+r.charAt(r.length-1)),t.match(/E\-/)&&r.match(/e\+/)&&(r=r.replace(/e\+/,"e")),r.replace("e","E")}var I0=/# (\?+)( ?)\/( ?)(\d+)/;function $f(t,e,r){var a=parseInt(t[4],10),n=Math.round(e*a),i=Math.floor(n/a),s=n-i*a,o=a;return r+(i===0?"":""+i)+" "+(s===0?Ke(" ",t[1].length+1+t[4].length):fs(s,t[1].length)+t[2]+"/"+t[3]+nr(o,t[4].length))}function Wf(t,e,r){return r+(e===0?"":""+e)+Ke(" ",t[1].length+2+t[4].length)}var N0=/^#*0*\.([0#]+)/,M0=/\).*[0#]/,O0=/\(###\) ###\\?-####/;function St(t){for(var e="",r,a=0;a!=t.length;++a)switch(r=t.charCodeAt(a)){case 35:break;case 63:e+=" ";break;case 48:e+="0";break;default:e+=String.fromCharCode(r)}return e}function fo(t,e){var r=Math.pow(10,e);return""+Math.round(t*r)/r}function ho(t,e){var r=t-Math.floor(t),a=Math.pow(10,e);return e<(""+Math.round(r*a)).length?0:Math.round(r*a)}function Gf(t,e){return e<(""+Math.round((t-Math.floor(t))*Math.pow(10,e))).length?1:0}function zf(t){return t<2147483647&&t>-2147483648?""+(t>=0?t|0:t-1|0):""+Math.floor(t)}function $t(t,e,r){if(t.charCodeAt(0)===40&&!e.match(M0)){var a=e.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return r>=0?$t("n",a,r):"("+$t("n",a,-r)+")"}if(e.charCodeAt(e.length-1)===44)return Uf(t,e,r);if(e.indexOf("%")!==-1)return Hf(t,e,r);if(e.indexOf("E")!==-1)return A0(e,r);if(e.charCodeAt(0)===36)return"$"+$t(t,e.substr(e.charAt(1)==" "?2:1),r);var n,i,s,o,l=Math.abs(r),c=r<0?"-":"";if(e.match(/^00+$/))return c+xa(l,e.length);if(e.match(/^[#?]+$/))return n=xa(r,0),n==="0"&&(n=""),n.length>e.length?n:St(e.substr(0,e.length-n.length))+n;if(i=e.match(I0))return $f(i,l,c);if(e.match(/^#+0+$/))return c+xa(l,e.length-e.indexOf("0"));if(i=e.match(N0))return n=fo(r,i[1].length).replace(/^([^\.]+)$/,"$1."+St(i[1])).replace(/\.$/,"."+St(i[1])).replace(/\.(\d*)$/,function(m,d){return"."+d+Ke("0",St(i[1]).length-d.length)}),e.indexOf("0.")!==-1?n:n.replace(/^0\./,".");if(e=e.replace(/^#+([0.])/,"$1"),i=e.match(/^(0*)\.(#*)$/))return c+fo(l,i[2].length).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,i[1].length?"0.":".");if(i=e.match(/^#{1,3},##0(\.?)$/))return c+Pr(xa(l,0));if(i=e.match(/^#,##0\.([#0]*0)$/))return r<0?"-"+$t(t,e,-r):Pr(""+(Math.floor(r)+Gf(r,i[1].length)))+"."+nr(ho(r,i[1].length),i[1].length);if(i=e.match(/^#,#*,#0/))return $t(t,e.replace(/^#,#*,/,""),r);if(i=e.match(/^([0#]+)(\\?-([0#]+))+$/))return n=Ta($t(t,e.replace(/[\\-]/g,""),r)),s=0,Ta(Ta(e.replace(/\\/g,"")).replace(/[0#]/g,function(m){return s<n.length?n.charAt(s++):m==="0"?"0":""}));if(e.match(O0))return n=$t(t,"##########",r),"("+n.substr(0,3)+") "+n.substr(3,3)+"-"+n.substr(6);var f="";if(i=e.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return s=Math.min(i[4].length,7),o=Kn(l,Math.pow(10,s)-1,!1),n=""+c,f=_r("n",i[1],o[1]),f.charAt(f.length-1)==" "&&(f=f.substr(0,f.length-1)+"0"),n+=f+i[2]+"/"+i[3],f=Xn(o[2],s),f.length<i[4].length&&(f=St(i[4].substr(i[4].length-f.length))+f),n+=f,n;if(i=e.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return s=Math.min(Math.max(i[1].length,i[4].length),7),o=Kn(l,Math.pow(10,s)-1,!0),c+(o[0]||(o[1]?"":"0"))+" "+(o[1]?fs(o[1],s)+i[2]+"/"+i[3]+Xn(o[2],s):Ke(" ",2*s+1+i[2].length+i[3].length));if(i=e.match(/^[#0?]+$/))return n=xa(r,0),e.length<=n.length?n:St(e.substr(0,e.length-n.length))+n;if(i=e.match(/^([#0?]+)\.([#0]+)$/)){n=""+r.toFixed(Math.min(i[2].length,10)).replace(/([^0])0+$/,"$1"),s=n.indexOf(".");var u=e.indexOf(".")-s,h=e.length-n.length-u;return St(e.substr(0,u)+n+e.substr(e.length-h))}if(i=e.match(/^00,000\.([#0]*0)$/))return s=ho(r,i[1].length),r<0?"-"+$t(t,e,-r):Pr(zf(r)).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,function(m){return"00,"+(m.length<3?nr(0,3-m.length):"")+m})+"."+nr(s,i[1].length);switch(e){case"###,##0.00":return $t(t,"#,##0.00",r);case"###,###":case"##,###":case"#,###":var p=Pr(xa(l,0));return p!=="0"?c+p:"";case"###,###.00":return $t(t,"###,##0.00",r).replace(/^0\./,".");case"#,###.00":return $t(t,"#,##0.00",r).replace(/^0\./,".")}throw new Error("unsupported format |"+e+"|")}function Xf(t,e,r){for(var a=e.length-1;e.charCodeAt(a-1)===44;)--a;return _r(t,e.substr(0,a),r/Math.pow(10,3*(e.length-a)))}function jf(t,e,r){var a=e.replace(F0,""),n=e.length-a.length;return _r(t,a,r*Math.pow(10,2*n))+Ke("%",n)}function P0(t,e){var r,a=t.indexOf("E")-t.indexOf(".")-1;if(t.match(/^#+0.0E\+0$/)){if(e==0)return"0.0E+0";if(e<0)return"-"+P0(t,-e);var n=t.indexOf(".");n===-1&&(n=t.indexOf("E"));var i=Math.floor(Math.log(e)*Math.LOG10E)%n;if(i<0&&(i+=n),r=(e/Math.pow(10,i)).toPrecision(a+1+(n+i)%n),!r.match(/[Ee]/)){var s=Math.floor(Math.log(e)*Math.LOG10E);r.indexOf(".")===-1?r=r.charAt(0)+"."+r.substr(1)+"E+"+(s-r.length+i):r+="E+"+(s-i),r=r.replace(/\+-/,"-")}r=r.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,function(o,l,c,f){return l+c+f.substr(0,(n+i)%n)+"."+f.substr(i)+"E"})}else r=e.toExponential(a);return t.match(/E\+00$/)&&r.match(/e[+-]\d$/)&&(r=r.substr(0,r.length-1)+"0"+r.charAt(r.length-1)),t.match(/E\-/)&&r.match(/e\+/)&&(r=r.replace(/e\+/,"e")),r.replace("e","E")}function ur(t,e,r){if(t.charCodeAt(0)===40&&!e.match(M0)){var a=e.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return r>=0?ur("n",a,r):"("+ur("n",a,-r)+")"}if(e.charCodeAt(e.length-1)===44)return Xf(t,e,r);if(e.indexOf("%")!==-1)return jf(t,e,r);if(e.indexOf("E")!==-1)return P0(e,r);if(e.charCodeAt(0)===36)return"$"+ur(t,e.substr(e.charAt(1)==" "?2:1),r);var n,i,s,o,l=Math.abs(r),c=r<0?"-":"";if(e.match(/^00+$/))return c+nr(l,e.length);if(e.match(/^[#?]+$/))return n=""+r,r===0&&(n=""),n.length>e.length?n:St(e.substr(0,e.length-n.length))+n;if(i=e.match(I0))return Wf(i,l,c);if(e.match(/^#+0+$/))return c+nr(l,e.length-e.indexOf("0"));if(i=e.match(N0))return n=(""+r).replace(/^([^\.]+)$/,"$1."+St(i[1])).replace(/\.$/,"."+St(i[1])),n=n.replace(/\.(\d*)$/,function(m,d){return"."+d+Ke("0",St(i[1]).length-d.length)}),e.indexOf("0.")!==-1?n:n.replace(/^0\./,".");if(e=e.replace(/^#+([0.])/,"$1"),i=e.match(/^(0*)\.(#*)$/))return c+(""+l).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,i[1].length?"0.":".");if(i=e.match(/^#{1,3},##0(\.?)$/))return c+Pr(""+l);if(i=e.match(/^#,##0\.([#0]*0)$/))return r<0?"-"+ur(t,e,-r):Pr(""+r)+"."+Ke("0",i[1].length);if(i=e.match(/^#,#*,#0/))return ur(t,e.replace(/^#,#*,/,""),r);if(i=e.match(/^([0#]+)(\\?-([0#]+))+$/))return n=Ta(ur(t,e.replace(/[\\-]/g,""),r)),s=0,Ta(Ta(e.replace(/\\/g,"")).replace(/[0#]/g,function(m){return s<n.length?n.charAt(s++):m==="0"?"0":""}));if(e.match(O0))return n=ur(t,"##########",r),"("+n.substr(0,3)+") "+n.substr(3,3)+"-"+n.substr(6);var f="";if(i=e.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return s=Math.min(i[4].length,7),o=Kn(l,Math.pow(10,s)-1,!1),n=""+c,f=_r("n",i[1],o[1]),f.charAt(f.length-1)==" "&&(f=f.substr(0,f.length-1)+"0"),n+=f+i[2]+"/"+i[3],f=Xn(o[2],s),f.length<i[4].length&&(f=St(i[4].substr(i[4].length-f.length))+f),n+=f,n;if(i=e.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return s=Math.min(Math.max(i[1].length,i[4].length),7),o=Kn(l,Math.pow(10,s)-1,!0),c+(o[0]||(o[1]?"":"0"))+" "+(o[1]?fs(o[1],s)+i[2]+"/"+i[3]+Xn(o[2],s):Ke(" ",2*s+1+i[2].length+i[3].length));if(i=e.match(/^[#0?]+$/))return n=""+r,e.length<=n.length?n:St(e.substr(0,e.length-n.length))+n;if(i=e.match(/^([#0]+)\.([#0]+)$/)){n=""+r.toFixed(Math.min(i[2].length,10)).replace(/([^0])0+$/,"$1"),s=n.indexOf(".");var u=e.indexOf(".")-s,h=e.length-n.length-u;return St(e.substr(0,u)+n+e.substr(e.length-h))}if(i=e.match(/^00,000\.([#0]*0)$/))return r<0?"-"+ur(t,e,-r):Pr(""+r).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,function(m){return"00,"+(m.length<3?nr(0,3-m.length):"")+m})+"."+nr(0,i[1].length);switch(e){case"###,###":case"##,###":case"#,###":var p=Pr(""+l);return p!=="0"?c+p:"";default:if(e.match(/\.[0#?]*$/))return ur(t,e.slice(0,e.lastIndexOf(".")),r)+St(e.slice(e.lastIndexOf(".")))}throw new Error("unsupported format |"+e+"|")}function _r(t,e,r){return(r|0)===r?ur(t,e,r):$t(t,e,r)}function Kf(t){for(var e=[],r=!1,a=0,n=0;a<t.length;++a)switch(t.charCodeAt(a)){case 34:r=!r;break;case 95:case 42:case 92:++a;break;case 59:e[e.length]=t.substr(n,a-n),n=a+1}if(e[e.length]=t.substr(n),r===!0)throw new Error("Format |"+t+"| unterminated string ");return e}var D0=/\[[HhMmSs\u0E0A\u0E19\u0E17]*\]/;function Na(t){for(var e=0,r="",a="";e<t.length;)switch(r=t.charAt(e)){case"G":jn(t,e)&&(e+=6),e++;break;case'"':for(;t.charCodeAt(++e)!==34&&e<t.length;);++e;break;case"\\":e+=2;break;case"_":e+=2;break;case"@":++e;break;case"B":case"b":if(t.charAt(e+1)==="1"||t.charAt(e+1)==="2")return!0;case"M":case"D":case"Y":case"H":case"S":case"E":case"m":case"d":case"y":case"h":case"s":case"e":case"g":return!0;case"A":case"a":case"上":if(t.substr(e,3).toUpperCase()==="A/P"||t.substr(e,5).toUpperCase()==="AM/PM"||t.substr(e,5).toUpperCase()==="上午/下午")return!0;++e;break;case"[":for(a=r;t.charAt(e++)!=="]"&&e<t.length;)a+=t.charAt(e);if(a.match(D0))return!0;break;case".":case"0":case"#":for(;e<t.length&&("0#?.,E+-%".indexOf(r=t.charAt(++e))>-1||r=="\\"&&t.charAt(e+1)=="-"&&"0#".indexOf(t.charAt(e+2))>-1););break;case"?":for(;t.charAt(++e)===r;);break;case"*":++e,(t.charAt(e)==" "||t.charAt(e)=="*")&&++e;break;case"(":case")":++e;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(;e<t.length&&"0123456789".indexOf(t.charAt(++e))>-1;);break;case" ":++e;break;default:++e;break}return!1}function Yf(t,e,r,a){for(var n=[],i="",s=0,o="",l="t",c,f,u,h="H";s<t.length;)switch(o=t.charAt(s)){case"G":if(!jn(t,s))throw new Error("unrecognized character "+o+" in "+t);n[n.length]={t:"G",v:"General"},s+=7;break;case'"':for(i="";(u=t.charCodeAt(++s))!==34&&s<t.length;)i+=String.fromCharCode(u);n[n.length]={t:"t",v:i},++s;break;case"\\":var p=t.charAt(++s),m=p==="("||p===")"?p:"t";n[n.length]={t:m,v:p},++s;break;case"_":n[n.length]={t:"t",v:" "},s+=2;break;case"@":n[n.length]={t:"T",v:e},++s;break;case"B":case"b":if(t.charAt(s+1)==="1"||t.charAt(s+1)==="2"){if(c==null&&(c=Kr(e,r,t.charAt(s+1)==="2"),c==null))return"";n[n.length]={t:"X",v:t.substr(s,2)},l=o,s+=2;break}case"M":case"D":case"Y":case"H":case"S":case"E":o=o.toLowerCase();case"m":case"d":case"y":case"h":case"s":case"e":case"g":if(e<0||c==null&&(c=Kr(e,r),c==null))return"";for(i=o;++s<t.length&&t.charAt(s).toLowerCase()===o;)i+=o;o==="m"&&l.toLowerCase()==="h"&&(o="M"),o==="h"&&(o=h),n[n.length]={t:o,v:i},l=o;break;case"A":case"a":case"上":var d={t:o,v:o};if(c==null&&(c=Kr(e,r)),t.substr(s,3).toUpperCase()==="A/P"?(c!=null&&(d.v=c.H>=12?"P":"A"),d.t="T",h="h",s+=3):t.substr(s,5).toUpperCase()==="AM/PM"?(c!=null&&(d.v=c.H>=12?"PM":"AM"),d.t="T",s+=5,h="h"):t.substr(s,5).toUpperCase()==="上午/下午"?(c!=null&&(d.v=c.H>=12?"下午":"上午"),d.t="T",s+=5,h="h"):(d.t="t",++s),c==null&&d.t==="T")return"";n[n.length]=d,l=o;break;case"[":for(i=o;t.charAt(s++)!=="]"&&s<t.length;)i+=t.charAt(s);if(i.slice(-1)!=="]")throw'unterminated "[" block: |'+i+"|";if(i.match(D0)){if(c==null&&(c=Kr(e,r),c==null))return"";n[n.length]={t:"Z",v:i.toLowerCase()},l=i.charAt(1)}else i.indexOf("$")>-1&&(i=(i.match(/\$([^-\[\]]*)/)||[])[1]||"$",Na(t)||(n[n.length]={t:"t",v:i}));break;case".":if(c!=null){for(i=o;++s<t.length&&(o=t.charAt(s))==="0";)i+=o;n[n.length]={t:"s",v:i};break}case"0":case"#":for(i=o;++s<t.length&&"0#?.,E+-%".indexOf(o=t.charAt(s))>-1;)i+=o;n[n.length]={t:"n",v:i};break;case"?":for(i=o;t.charAt(++s)===o;)i+=o;n[n.length]={t:o,v:i},l=o;break;case"*":++s,(t.charAt(s)==" "||t.charAt(s)=="*")&&++s;break;case"(":case")":n[n.length]={t:a===1?"t":o,v:o},++s;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(i=o;s<t.length&&"0123456789".indexOf(t.charAt(++s))>-1;)i+=t.charAt(s);n[n.length]={t:"D",v:i};break;case" ":n[n.length]={t:o,v:o},++s;break;case"$":n[n.length]={t:"t",v:"$"},++s;break;default:if(",$-+/():!^&'~{}<>=€acfijklopqrtuvwxzP".indexOf(o)===-1)throw new Error("unrecognized character "+o+" in "+t);n[n.length]={t:"t",v:o},++s;break}var g=0,x=0,w;for(s=n.length-1,l="t";s>=0;--s)switch(n[s].t){case"h":case"H":n[s].t=h,l="h",g<1&&(g=1);break;case"s":(w=n[s].v.match(/\.0+$/))&&(x=Math.max(x,w[0].length-1)),g<3&&(g=3);case"d":case"y":case"M":case"e":l=n[s].t;break;case"m":l==="s"&&(n[s].t="M",g<2&&(g=2));break;case"X":break;case"Z":g<1&&n[s].v.match(/[Hh]/)&&(g=1),g<2&&n[s].v.match(/[Mm]/)&&(g=2),g<3&&n[s].v.match(/[Ss]/)&&(g=3)}switch(g){case 0:break;case 1:c.u>=.5&&(c.u=0,++c.S),c.S>=60&&(c.S=0,++c.M),c.M>=60&&(c.M=0,++c.H);break;case 2:c.u>=.5&&(c.u=0,++c.S),c.S>=60&&(c.S=0,++c.M);break}var v="",I;for(s=0;s<n.length;++s)switch(n[s].t){case"t":case"T":case" ":case"D":break;case"X":n[s].v="",n[s].t=";";break;case"d":case"m":case"y":case"h":case"H":case"M":case"s":case"e":case"b":case"Z":n[s].v=Vf(n[s].t.charCodeAt(0),n[s].v,c,x),n[s].t="t";break;case"n":case"?":for(I=s+1;n[I]!=null&&((o=n[I].t)==="?"||o==="D"||(o===" "||o==="t")&&n[I+1]!=null&&(n[I+1].t==="?"||n[I+1].t==="t"&&n[I+1].v==="/")||n[s].t==="("&&(o===" "||o==="n"||o===")")||o==="t"&&(n[I].v==="/"||n[I].v===" "&&n[I+1]!=null&&n[I+1].t=="?"));)n[s].v+=n[I].v,n[I]={v:"",t:";"},++I;v+=n[s].v,s=I-1;break;case"G":n[s].t="t",n[s].v=ia(e,r);break}var L="",_,C;if(v.length>0){v.charCodeAt(0)==40?(_=e<0&&v.charCodeAt(0)===45?-e:e,C=_r("n",v,_)):(_=e<0&&a>1?-e:e,C=_r("n",v,_),_<0&&n[0]&&n[0].t=="t"&&(C=C.substr(1),n[0].v="-"+n[0].v)),I=C.length-1;var M=n.length;for(s=0;s<n.length;++s)if(n[s]!=null&&n[s].t!="t"&&n[s].v.indexOf(".")>-1){M=s;break}var N=n.length;if(M===n.length&&C.indexOf("E")===-1){for(s=n.length-1;s>=0;--s)n[s]==null||"n?".indexOf(n[s].t)===-1||(I>=n[s].v.length-1?(I-=n[s].v.length,n[s].v=C.substr(I+1,n[s].v.length)):I<0?n[s].v="":(n[s].v=C.substr(0,I+1),I=-1),n[s].t="t",N=s);I>=0&&N<n.length&&(n[N].v=C.substr(0,I+1)+n[N].v)}else if(M!==n.length&&C.indexOf("E")===-1){for(I=C.indexOf(".")-1,s=M;s>=0;--s)if(!(n[s]==null||"n?".indexOf(n[s].t)===-1)){for(f=n[s].v.indexOf(".")>-1&&s===M?n[s].v.indexOf(".")-1:n[s].v.length-1,L=n[s].v.substr(f+1);f>=0;--f)I>=0&&(n[s].v.charAt(f)==="0"||n[s].v.charAt(f)==="#")&&(L=C.charAt(I--)+L);n[s].v=L,n[s].t="t",N=s}for(I>=0&&N<n.length&&(n[N].v=C.substr(0,I+1)+n[N].v),I=C.indexOf(".")+1,s=M;s<n.length;++s)if(!(n[s]==null||"n?(".indexOf(n[s].t)===-1&&s!==M)){for(f=n[s].v.indexOf(".")>-1&&s===M?n[s].v.indexOf(".")+1:0,L=n[s].v.substr(0,f);f<n[s].v.length;++f)I<C.length&&(L+=C.charAt(I++));n[s].v=L,n[s].t="t",N=s}}}for(s=0;s<n.length;++s)n[s]!=null&&"n?".indexOf(n[s].t)>-1&&(_=a>1&&e<0&&s>0&&n[s-1].v==="-"?-e:e,n[s].v=_r(n[s].t,n[s].v,_),n[s].t="t");var z="";for(s=0;s!==n.length;++s)n[s]!=null&&(z+=n[s].v);return z}var uo=/\[(=|>[=]?|<[>=]?)(-?\d+(?:\.\d*)?)\]/;function po(t,e){if(e==null)return!1;var r=parseFloat(e[2]);switch(e[1]){case"=":if(t==r)return!0;break;case">":if(t>r)return!0;break;case"<":if(t<r)return!0;break;case"<>":if(t!=r)return!0;break;case">=":if(t>=r)return!0;break;case"<=":if(t<=r)return!0;break}return!1}function qf(t,e){var r=Kf(t),a=r.length,n=r[a-1].indexOf("@");if(a<4&&n>-1&&--a,r.length>4)throw new Error("cannot find right format for |"+r.join("|")+"|");if(typeof e!="number")return[4,r.length===4||n>-1?r[r.length-1]:"@"];switch(r.length){case 1:r=n>-1?["General","General","General",r[0]]:[r[0],r[0],r[0],"@"];break;case 2:r=n>-1?[r[0],r[0],r[0],r[1]]:[r[0],r[1],r[0],"@"];break;case 3:r=n>-1?[r[0],r[1],r[0],r[2]]:[r[0],r[1],r[2],"@"];break}var i=e>0?r[0]:e<0?r[1]:r[2];if(r[0].indexOf("[")===-1&&r[1].indexOf("[")===-1)return[a,i];if(r[0].match(/\[[=<>]/)!=null||r[1].match(/\[[=<>]/)!=null){var s=r[0].match(uo),o=r[1].match(uo);return po(e,s)?[a,r[0]]:po(e,o)?[a,r[1]]:[a,r[s!=null&&o!=null?2:1]]}return[a,i]}function Kt(t,e,r){r==null&&(r={});var a="";switch(typeof t){case"string":t=="m/d/yy"&&r.dateNF?a=r.dateNF:a=t;break;case"number":t==14&&r.dateNF?a=r.dateNF:a=(r.table!=null?r.table:ge)[t],a==null&&(a=r.table&&r.table[co[t]]||ge[co[t]]),a==null&&(a=Nf[t]||"General");break}if(jn(a,0))return ia(e,r);e instanceof Date&&(e=L0(e,r.date1904));var n=qf(a,e);if(jn(n[1]))return ia(e,r);if(e===!0)e="TRUE";else if(e===!1)e="FALSE";else if(e===""||e==null)return"";return Yf(n[1],e,r,n[0])}function Tr(t,e){if(typeof e!="number"){e=+e||-1;for(var r=0;r<392;++r){if(ge[r]==null){e<0&&(e=r);continue}if(ge[r]==t){e=r;break}}e<0&&(e=391)}return ge[e]=t,e}function hi(t){for(var e=0;e!=392;++e)t[e]!==void 0&&Tr(t[e],e)}function Ma(){ge=If()}var Jf={5:'"$"#,##0_);\\("$"#,##0\\)',6:'"$"#,##0_);[Red]\\("$"#,##0\\)',7:'"$"#,##0.00_);\\("$"#,##0.00\\)',8:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',23:"General",24:"General",25:"General",26:"General",27:"m/d/yy",28:"m/d/yy",29:"m/d/yy",30:"m/d/yy",31:"m/d/yy",32:"h:mm:ss",33:"h:mm:ss",34:"h:mm:ss",35:"h:mm:ss",36:"m/d/yy",41:'_(* #,##0_);_(* (#,##0);_(* "-"_);_(@_)',42:'_("$"* #,##0_);_("$"* (#,##0);_("$"* "-"_);_(@_)',43:'_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)',44:'_("$"* #,##0.00_);_("$"* (#,##0.00);_("$"* "-"??_);_(@_)',50:"m/d/yy",51:"m/d/yy",52:"m/d/yy",53:"m/d/yy",54:"m/d/yy",55:"m/d/yy",56:"m/d/yy",57:"m/d/yy",58:"m/d/yy",59:"0",60:"0.00",61:"#,##0",62:"#,##0.00",63:'"$"#,##0_);\\("$"#,##0\\)',64:'"$"#,##0_);[Red]\\("$"#,##0\\)',65:'"$"#,##0.00_);\\("$"#,##0.00\\)',66:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',67:"0%",68:"0.00%",69:"# ?/?",70:"# ??/??",71:"m/d/yy",72:"m/d/yy",73:"d-mmm-yy",74:"d-mmm",75:"mmm-yy",76:"h:mm",77:"h:mm:ss",78:"m/d/yy h:mm",79:"mm:ss",80:"[h]:mm:ss",81:"mmss.0"},R0=/[dD]+|[mM]+|[yYeE]+|[Hh]+|[Ss]+/g;function Zf(t){var e=typeof t=="number"?ge[t]:t;return e=e.replace(R0,"(\\d+)"),new RegExp("^"+e+"$")}function Qf(t,e,r){var a=-1,n=-1,i=-1,s=-1,o=-1,l=-1;(e.match(R0)||[]).forEach(function(u,h){var p=parseInt(r[h+1],10);switch(u.toLowerCase().charAt(0)){case"y":a=p;break;case"d":i=p;break;case"h":s=p;break;case"s":l=p;break;case"m":s>=0?o=p:n=p;break}}),l>=0&&o==-1&&n>=0&&(o=n,n=-1);var c=(""+(a>=0?a:new Date().getFullYear())).slice(-4)+"-"+("00"+(n>=1?n:1)).slice(-2)+"-"+("00"+(i>=1?i:1)).slice(-2);c.length==7&&(c="0"+c),c.length==8&&(c="20"+c);var f=("00"+(s>=0?s:0)).slice(-2)+":"+("00"+(o>=0?o:0)).slice(-2)+":"+("00"+(l>=0?l:0)).slice(-2);return s==-1&&o==-1&&l==-1?c:a==-1&&n==-1&&i==-1?f:c+"T"+f}var eh=function(){var t={};t.version="1.2.0";function e(){for(var C=0,M=new Array(256),N=0;N!=256;++N)C=N,C=C&1?-306674912^C>>>1:C>>>1,C=C&1?-306674912^C>>>1:C>>>1,C=C&1?-306674912^C>>>1:C>>>1,C=C&1?-306674912^C>>>1:C>>>1,C=C&1?-306674912^C>>>1:C>>>1,C=C&1?-306674912^C>>>1:C>>>1,C=C&1?-306674912^C>>>1:C>>>1,C=C&1?-306674912^C>>>1:C>>>1,M[N]=C;return typeof Int32Array<"u"?new Int32Array(M):M}var r=e();function a(C){var M=0,N=0,z=0,B=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(z=0;z!=256;++z)B[z]=C[z];for(z=0;z!=256;++z)for(N=C[z],M=256+z;M<4096;M+=256)N=B[M]=N>>>8^C[N&255];var D=[];for(z=1;z!=16;++z)D[z-1]=typeof Int32Array<"u"?B.subarray(z*256,z*256+256):B.slice(z*256,z*256+256);return D}var n=a(r),i=n[0],s=n[1],o=n[2],l=n[3],c=n[4],f=n[5],u=n[6],h=n[7],p=n[8],m=n[9],d=n[10],g=n[11],x=n[12],w=n[13],v=n[14];function I(C,M){for(var N=M^-1,z=0,B=C.length;z<B;)N=N>>>8^r[(N^C.charCodeAt(z++))&255];return~N}function L(C,M){for(var N=M^-1,z=C.length-15,B=0;B<z;)N=v[C[B++]^N&255]^w[C[B++]^N>>8&255]^x[C[B++]^N>>16&255]^g[C[B++]^N>>>24]^d[C[B++]]^m[C[B++]]^p[C[B++]]^h[C[B++]]^u[C[B++]]^f[C[B++]]^c[C[B++]]^l[C[B++]]^o[C[B++]]^s[C[B++]]^i[C[B++]]^r[C[B++]];for(z+=15;B<z;)N=N>>>8^r[(N^C[B++])&255];return~N}function _(C,M){for(var N=M^-1,z=0,B=C.length,D=0,q=0;z<B;)D=C.charCodeAt(z++),D<128?N=N>>>8^r[(N^D)&255]:D<2048?(N=N>>>8^r[(N^(192|D>>6&31))&255],N=N>>>8^r[(N^(128|D&63))&255]):D>=55296&&D<57344?(D=(D&1023)+64,q=C.charCodeAt(z++)&1023,N=N>>>8^r[(N^(240|D>>8&7))&255],N=N>>>8^r[(N^(128|D>>2&63))&255],N=N>>>8^r[(N^(128|q>>6&15|(D&3)<<4))&255],N=N>>>8^r[(N^(128|q&63))&255]):(N=N>>>8^r[(N^(224|D>>12&15))&255],N=N>>>8^r[(N^(128|D>>6&63))&255],N=N>>>8^r[(N^(128|D&63))&255]);return~N}return t.table=r,t.bstr=I,t.buf=L,t.str=_,t}(),pe=function(){var e={};e.version="1.2.1";function r(E,T){for(var y=E.split("/"),k=T.split("/"),S=0,b=0,H=Math.min(y.length,k.length);S<H;++S){if(b=y[S].length-k[S].length)return b;if(y[S]!=k[S])return y[S]<k[S]?-1:1}return y.length-k.length}function a(E){if(E.charAt(E.length-1)=="/")return E.slice(0,-1).indexOf("/")===-1?E:a(E.slice(0,-1));var T=E.lastIndexOf("/");return T===-1?E:E.slice(0,T+1)}function n(E){if(E.charAt(E.length-1)=="/")return n(E.slice(0,-1));var T=E.lastIndexOf("/");return T===-1?E:E.slice(T+1)}function i(E,T){typeof T=="string"&&(T=new Date(T));var y=T.getHours();y=y<<6|T.getMinutes(),y=y<<5|T.getSeconds()>>>1,E.write_shift(2,y);var k=T.getFullYear()-1980;k=k<<4|T.getMonth()+1,k=k<<5|T.getDate(),E.write_shift(2,k)}function s(E){var T=E.read_shift(2)&65535,y=E.read_shift(2)&65535,k=new Date,S=y&31;y>>>=5;var b=y&15;y>>>=4,k.setMilliseconds(0),k.setFullYear(y+1980),k.setMonth(b-1),k.setDate(S);var H=T&31;T>>>=5;var j=T&63;return T>>>=6,k.setHours(T),k.setMinutes(j),k.setSeconds(H<<1),k}function o(E){dt(E,0);for(var T={},y=0;E.l<=E.length-4;){var k=E.read_shift(2),S=E.read_shift(2),b=E.l+S,H={};switch(k){case 21589:y=E.read_shift(1),y&1&&(H.mtime=E.read_shift(4)),S>5&&(y&2&&(H.atime=E.read_shift(4)),y&4&&(H.ctime=E.read_shift(4))),H.mtime&&(H.mt=new Date(H.mtime*1e3));break}E.l=b,T[k]=H}return T}var l;function c(){return l||(l={})}function f(E,T){if(E[0]==80&&E[1]==75)return Qs(E,T);if((E[0]|32)==109&&(E[1]|32)==105)return Qc(E,T);if(E.length<512)throw new Error("CFB file size "+E.length+" < 512");var y=3,k=512,S=0,b=0,H=0,j=0,V=0,U=[],G=E.slice(0,512);dt(G,0);var Z=u(G);switch(y=Z[0],y){case 3:k=512;break;case 4:k=4096;break;case 0:if(Z[1]==0)return Qs(E,T);default:throw new Error("Major Version: Expected 3 or 4 saw "+y)}k!==512&&(G=E.slice(0,k),dt(G,28));var se=E.slice(0,k);h(G,y);var ue=G.read_shift(4,"i");if(y===3&&ue!==0)throw new Error("# Directory Sectors: Expected 0 saw "+ue);G.l+=4,H=G.read_shift(4,"i"),G.l+=4,G.chk("00100000","Mini Stream Cutoff Size: "),j=G.read_shift(4,"i"),S=G.read_shift(4,"i"),V=G.read_shift(4,"i"),b=G.read_shift(4,"i");for(var ee=-1,he=0;he<109&&(ee=G.read_shift(4,"i"),!(ee<0));++he)U[he]=ee;var Ee=p(E,k);g(V,b,Ee,k,U);var Ge=w(Ee,H,U,k);Ge[H].name="!Directory",S>0&&j!==q&&(Ge[j].name="!MiniFAT"),Ge[U[0]].name="!FAT",Ge.fat_addrs=U,Ge.ssz=k;var ze={},gt=[],Ba=[],Va=[];v(H,Ge,Ee,gt,S,ze,Ba,j),m(Ba,Va,gt),gt.shift();var Ha={FileIndex:Ba,FullPaths:Va};return T&&T.raw&&(Ha.raw={header:se,sectors:Ee}),Ha}function u(E){if(E[E.l]==80&&E[E.l+1]==75)return[0,0];E.chk(oe,"Header Signature: "),E.l+=16;var T=E.read_shift(2,"u");return[E.read_shift(2,"u"),T]}function h(E,T){var y=9;switch(E.l+=2,y=E.read_shift(2)){case 9:if(T!=3)throw new Error("Sector Shift: Expected 9 saw "+y);break;case 12:if(T!=4)throw new Error("Sector Shift: Expected 12 saw "+y);break;default:throw new Error("Sector Shift: Expected 9 or 12 saw "+y)}E.chk("0600","Mini Sector Shift: "),E.chk("000000000000","Reserved: ")}function p(E,T){for(var y=Math.ceil(E.length/T)-1,k=[],S=1;S<y;++S)k[S-1]=E.slice(S*T,(S+1)*T);return k[y-1]=E.slice(y*T),k}function m(E,T,y){for(var k=0,S=0,b=0,H=0,j=0,V=y.length,U=[],G=[];k<V;++k)U[k]=G[k]=k,T[k]=y[k];for(;j<G.length;++j)k=G[j],S=E[k].L,b=E[k].R,H=E[k].C,U[k]===k&&(S!==-1&&U[S]!==S&&(U[k]=U[S]),b!==-1&&U[b]!==b&&(U[k]=U[b])),H!==-1&&(U[H]=k),S!==-1&&k!=U[k]&&(U[S]=U[k],G.lastIndexOf(S)<j&&G.push(S)),b!==-1&&k!=U[k]&&(U[b]=U[k],G.lastIndexOf(b)<j&&G.push(b));for(k=1;k<V;++k)U[k]===k&&(b!==-1&&U[b]!==b?U[k]=U[b]:S!==-1&&U[S]!==S&&(U[k]=U[S]));for(k=1;k<V;++k)if(E[k].type!==0){if(j=k,j!=U[j])do j=U[j],T[k]=T[j]+"/"+T[k];while(j!==0&&U[j]!==-1&&j!=U[j]);U[k]=-1}for(T[0]+="/",k=1;k<V;++k)E[k].type!==2&&(T[k]+="/")}function d(E,T,y){for(var k=E.start,S=E.size,b=[],H=k;y&&S>0&&H>=0;)b.push(T.slice(H*D,H*D+D)),S-=D,H=jr(y,H*4);return b.length===0?X(0):ft(b).slice(0,E.size)}function g(E,T,y,k,S){var b=q;if(E===q){if(T!==0)throw new Error("DIFAT chain shorter than expected")}else if(E!==-1){var H=y[E],j=(k>>>2)-1;if(!H)return;for(var V=0;V<j&&(b=jr(H,V*4))!==q;++V)S.push(b);g(jr(H,k-4),T-1,y,k,S)}}function x(E,T,y,k,S){var b=[],H=[];S||(S=[]);var j=k-1,V=0,U=0;for(V=T;V>=0;){S[V]=!0,b[b.length]=V,H.push(E[V]);var G=y[Math.floor(V*4/k)];if(U=V*4&j,k<4+U)throw new Error("FAT boundary crossed: "+V+" 4 "+k);if(!E[G])break;V=jr(E[G],U)}return{nodes:b,data:So([H])}}function w(E,T,y,k){var S=E.length,b=[],H=[],j=[],V=[],U=k-1,G=0,Z=0,se=0,ue=0;for(G=0;G<S;++G)if(j=[],se=G+T,se>=S&&(se-=S),!H[se]){V=[];var ee=[];for(Z=se;Z>=0;){ee[Z]=!0,H[Z]=!0,j[j.length]=Z,V.push(E[Z]);var he=y[Math.floor(Z*4/k)];if(ue=Z*4&U,k<4+ue)throw new Error("FAT boundary crossed: "+Z+" 4 "+k);if(!E[he]||(Z=jr(E[he],ue),ee[Z]))break}b[se]={nodes:j,data:So([V])}}return b}function v(E,T,y,k,S,b,H,j){for(var V=0,U=k.length?2:0,G=T[E].data,Z=0,se=0,ue;Z<G.length;Z+=128){var ee=G.slice(Z,Z+128);dt(ee,64),se=ee.read_shift(2),ue=vs(ee,0,se-U),k.push(ue);var he={name:ue,type:ee.read_shift(1),color:ee.read_shift(1),L:ee.read_shift(4,"i"),R:ee.read_shift(4,"i"),C:ee.read_shift(4,"i"),clsid:ee.read_shift(16),state:ee.read_shift(4,"i"),start:0,size:0},Ee=ee.read_shift(2)+ee.read_shift(2)+ee.read_shift(2)+ee.read_shift(2);Ee!==0&&(he.ct=I(ee,ee.l-8));var Ge=ee.read_shift(2)+ee.read_shift(2)+ee.read_shift(2)+ee.read_shift(2);Ge!==0&&(he.mt=I(ee,ee.l-8)),he.start=ee.read_shift(4,"i"),he.size=ee.read_shift(4,"i"),he.size<0&&he.start<0&&(he.size=he.type=0,he.start=q,he.name=""),he.type===5?(V=he.start,S>0&&V!==q&&(T[V].name="!StreamData")):he.size>=4096?(he.storage="fat",T[he.start]===void 0&&(T[he.start]=x(y,he.start,T.fat_addrs,T.ssz)),T[he.start].name=he.name,he.content=T[he.start].data.slice(0,he.size)):(he.storage="minifat",he.size<0?he.size=0:V!==q&&he.start!==q&&T[V]&&(he.content=d(he,T[V].data,(T[j]||{}).data))),he.content&&dt(he.content,0),b[ue]=he,H.push(he)}}function I(E,T){return new Date((Pt(E,T+4)/1e7*Math.pow(2,32)+Pt(E,T)/1e7-11644473600)*1e3)}function L(E,T){return c(),f(l.readFileSync(E),T)}function _(E,T){var y=T&&T.type;switch(y||_e&&Buffer.isBuffer(E)&&(y="buffer"),y||"base64"){case"file":return L(E,T);case"base64":return f(Dt(Bt(E)),T);case"binary":return f(Dt(E),T)}return f(E,T)}function C(E,T){var y=T||{},k=y.root||"Root Entry";if(E.FullPaths||(E.FullPaths=[]),E.FileIndex||(E.FileIndex=[]),E.FullPaths.length!==E.FileIndex.length)throw new Error("inconsistent CFB structure");E.FullPaths.length===0&&(E.FullPaths[0]=k+"/",E.FileIndex[0]={name:k,type:5}),y.CLSID&&(E.FileIndex[0].clsid=y.CLSID),M(E)}function M(E){var T="Sh33tJ5";if(!pe.find(E,"/"+T)){var y=X(4);y[0]=55,y[1]=y[3]=50,y[2]=54,E.FileIndex.push({name:T,type:2,content:y,size:4,L:69,R:69,C:69}),E.FullPaths.push(E.FullPaths[0]+T),N(E)}}function N(E,T){C(E);for(var y=!1,k=!1,S=E.FullPaths.length-1;S>=0;--S){var b=E.FileIndex[S];switch(b.type){case 0:k?y=!0:(E.FileIndex.pop(),E.FullPaths.pop());break;case 1:case 2:case 5:k=!0,isNaN(b.R*b.L*b.C)&&(y=!0),b.R>-1&&b.L>-1&&b.R==b.L&&(y=!0);break;default:y=!0;break}}if(!(!y&&!T)){var H=new Date(1987,1,19),j=0,V=Object.create?Object.create(null):{},U=[];for(S=0;S<E.FullPaths.length;++S)V[E.FullPaths[S]]=!0,E.FileIndex[S].type!==0&&U.push([E.FullPaths[S],E.FileIndex[S]]);for(S=0;S<U.length;++S){var G=a(U[S][0]);k=V[G],k||(U.push([G,{name:n(G).replace("/",""),type:1,clsid:fe,ct:H,mt:H,content:null}]),V[G]=!0)}for(U.sort(function(ue,ee){return r(ue[0],ee[0])}),E.FullPaths=[],E.FileIndex=[],S=0;S<U.length;++S)E.FullPaths[S]=U[S][0],E.FileIndex[S]=U[S][1];for(S=0;S<U.length;++S){var Z=E.FileIndex[S],se=E.FullPaths[S];if(Z.name=n(se).replace("/",""),Z.L=Z.R=Z.C=-(Z.color=1),Z.size=Z.content?Z.content.length:0,Z.start=0,Z.clsid=Z.clsid||fe,S===0)Z.C=U.length>1?1:-1,Z.size=0,Z.type=5;else if(se.slice(-1)=="/"){for(j=S+1;j<U.length&&a(E.FullPaths[j])!=se;++j);for(Z.C=j>=U.length?-1:j,j=S+1;j<U.length&&a(E.FullPaths[j])!=a(se);++j);Z.R=j>=U.length?-1:j,Z.type=1}else a(E.FullPaths[S+1]||"")==a(se)&&(Z.R=S+1),Z.type=2}}}function z(E,T){var y=T||{};if(y.fileType=="mad")return ef(E,y);switch(N(E),y.fileType){case"zip":return jc(E,y)}var k=function(ue){for(var ee=0,he=0,Ee=0;Ee<ue.FileIndex.length;++Ee){var Ge=ue.FileIndex[Ee];if(Ge.content){var ze=Ge.content.length;ze>0&&(ze<4096?ee+=ze+63>>6:he+=ze+511>>9)}}for(var gt=ue.FullPaths.length+3>>2,Ba=ee+7>>3,Va=ee+127>>7,Ha=Ba+he+gt+Va,Gr=Ha+127>>7,Ei=Gr<=109?0:Math.ceil((Gr-109)/127);Ha+Gr+Ei+127>>7>Gr;)Ei=++Gr<=109?0:Math.ceil((Gr-109)/127);var Er=[1,Ei,Gr,Va,gt,he,ee,0];return ue.FileIndex[0].size=ee<<6,Er[7]=(ue.FileIndex[0].start=Er[0]+Er[1]+Er[2]+Er[3]+Er[4]+Er[5])+(Er[6]+7>>3),Er}(E),S=X(k[7]<<9),b=0,H=0;{for(b=0;b<8;++b)S.write_shift(1,ie[b]);for(b=0;b<8;++b)S.write_shift(2,0);for(S.write_shift(2,62),S.write_shift(2,3),S.write_shift(2,65534),S.write_shift(2,9),S.write_shift(2,6),b=0;b<3;++b)S.write_shift(2,0);for(S.write_shift(4,0),S.write_shift(4,k[2]),S.write_shift(4,k[0]+k[1]+k[2]+k[3]-1),S.write_shift(4,0),S.write_shift(4,4096),S.write_shift(4,k[3]?k[0]+k[1]+k[2]-1:q),S.write_shift(4,k[3]),S.write_shift(-4,k[1]?k[0]-1:q),S.write_shift(4,k[1]),b=0;b<109;++b)S.write_shift(-4,b<k[2]?k[1]+b:-1)}if(k[1])for(H=0;H<k[1];++H){for(;b<236+H*127;++b)S.write_shift(-4,b<k[2]?k[1]+b:-1);S.write_shift(-4,H===k[1]-1?q:H+1)}var j=function(ue){for(H+=ue;b<H-1;++b)S.write_shift(-4,b+1);ue&&(++b,S.write_shift(-4,q))};for(H=b=0,H+=k[1];b<H;++b)S.write_shift(-4,le.DIFSECT);for(H+=k[2];b<H;++b)S.write_shift(-4,le.FATSECT);j(k[3]),j(k[4]);for(var V=0,U=0,G=E.FileIndex[0];V<E.FileIndex.length;++V)G=E.FileIndex[V],G.content&&(U=G.content.length,!(U<4096)&&(G.start=H,j(U+511>>9)));for(j(k[6]+7>>3);S.l&511;)S.write_shift(-4,le.ENDOFCHAIN);for(H=b=0,V=0;V<E.FileIndex.length;++V)G=E.FileIndex[V],G.content&&(U=G.content.length,!(!U||U>=4096)&&(G.start=H,j(U+63>>6)));for(;S.l&511;)S.write_shift(-4,le.ENDOFCHAIN);for(b=0;b<k[4]<<2;++b){var Z=E.FullPaths[b];if(!Z||Z.length===0){for(V=0;V<17;++V)S.write_shift(4,0);for(V=0;V<3;++V)S.write_shift(4,-1);for(V=0;V<12;++V)S.write_shift(4,0);continue}G=E.FileIndex[b],b===0&&(G.start=G.size?G.start-1:q);var se=b===0&&y.root||G.name;if(U=2*(se.length+1),S.write_shift(64,se,"utf16le"),S.write_shift(2,U),S.write_shift(1,G.type),S.write_shift(1,G.color),S.write_shift(-4,G.L),S.write_shift(-4,G.R),S.write_shift(-4,G.C),G.clsid)S.write_shift(16,G.clsid,"hex");else for(V=0;V<4;++V)S.write_shift(4,0);S.write_shift(4,G.state||0),S.write_shift(4,0),S.write_shift(4,0),S.write_shift(4,0),S.write_shift(4,0),S.write_shift(4,G.start),S.write_shift(4,G.size),S.write_shift(4,0)}for(b=1;b<E.FileIndex.length;++b)if(G=E.FileIndex[b],G.size>=4096)if(S.l=G.start+1<<9,_e&&Buffer.isBuffer(G.content))G.content.copy(S,S.l,0,G.size),S.l+=G.size+511&-512;else{for(V=0;V<G.size;++V)S.write_shift(1,G.content[V]);for(;V&511;++V)S.write_shift(1,0)}for(b=1;b<E.FileIndex.length;++b)if(G=E.FileIndex[b],G.size>0&&G.size<4096)if(_e&&Buffer.isBuffer(G.content))G.content.copy(S,S.l,0,G.size),S.l+=G.size+63&-64;else{for(V=0;V<G.size;++V)S.write_shift(1,G.content[V]);for(;V&63;++V)S.write_shift(1,0)}if(_e)S.l=S.length;else for(;S.l<S.length;)S.write_shift(1,0);return S}function B(E,T){var y=E.FullPaths.map(function(V){return V.toUpperCase()}),k=y.map(function(V){var U=V.split("/");return U[U.length-(V.slice(-1)=="/"?2:1)]}),S=!1;T.charCodeAt(0)===47?(S=!0,T=y[0].slice(0,-1)+T):S=T.indexOf("/")!==-1;var b=T.toUpperCase(),H=S===!0?y.indexOf(b):k.indexOf(b);if(H!==-1)return E.FileIndex[H];var j=!b.match(Wa);for(b=b.replace(Lt,""),j&&(b=b.replace(Wa,"!")),H=0;H<y.length;++H)if((j?y[H].replace(Wa,"!"):y[H]).replace(Lt,"")==b||(j?k[H].replace(Wa,"!"):k[H]).replace(Lt,"")==b)return E.FileIndex[H];return null}var D=64,q=-2,oe="d0cf11e0a1b11ae1",ie=[208,207,17,224,161,177,26,225],fe="00000000000000000000000000000000",le={MAXREGSECT:-6,DIFSECT:-4,FATSECT:-3,ENDOFCHAIN:q,FREESECT:-1,HEADER_SIGNATURE:oe,HEADER_MINOR_VERSION:"3e00",MAXREGSID:-6,NOSTREAM:-1,HEADER_CLSID:fe,EntryTypes:["unknown","storage","stream","lockbytes","property","root"]};function Fe(E,T,y){c();var k=z(E,y);l.writeFileSync(T,k)}function W(E){for(var T=new Array(E.length),y=0;y<E.length;++y)T[y]=String.fromCharCode(E[y]);return T.join("")}function me(E,T){var y=z(E,T);switch(T&&T.type||"buffer"){case"file":return c(),l.writeFileSync(T.filename,y),y;case"binary":return typeof y=="string"?y:W(y);case"base64":return an(typeof y=="string"?y:W(y));case"buffer":if(_e)return Buffer.isBuffer(y)?y:Lr(y);case"array":return typeof y=="string"?Dt(y):y}return y}var de;function F(E){try{var T=E.InflateRaw,y=new T;if(y._processChunk(new Uint8Array([3,0]),y._finishFlushFlag),y.bytesRead)de=E;else throw new Error("zlib does not expose bytesRead")}catch(k){console.error("cannot use native zlib: "+(k.message||k))}}function R(E,T){if(!de)return Js(E,T);var y=de.InflateRaw,k=new y,S=k._processChunk(E.slice(E.l),k._finishFlushFlag);return E.l+=k.bytesRead,S}function O(E){return de?de.deflateRawSync(E):Te(E)}var P=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],K=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258],te=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577];function re(E){var T=(E<<1|E<<11)&139536|(E<<5|E<<15)&558144;return(T>>16|T>>8|T)&255}for(var Q=typeof Uint8Array<"u",J=Q?new Uint8Array(256):[],ke=0;ke<256;++ke)J[ke]=re(ke);function A(E,T){var y=J[E&255];return T<=8?y>>>8-T:(y=y<<8|J[E>>8&255],T<=16?y>>>16-T:(y=y<<8|J[E>>16&255],y>>>24-T))}function He(E,T){var y=T&7,k=T>>>3;return(E[k]|(y<=6?0:E[k+1]<<8))>>>y&3}function Ae(E,T){var y=T&7,k=T>>>3;return(E[k]|(y<=5?0:E[k+1]<<8))>>>y&7}function Ve(E,T){var y=T&7,k=T>>>3;return(E[k]|(y<=4?0:E[k+1]<<8))>>>y&15}function be(E,T){var y=T&7,k=T>>>3;return(E[k]|(y<=3?0:E[k+1]<<8))>>>y&31}function ce(E,T){var y=T&7,k=T>>>3;return(E[k]|(y<=1?0:E[k+1]<<8))>>>y&127}function Je(E,T,y){var k=T&7,S=T>>>3,b=(1<<y)-1,H=E[S]>>>k;return y<8-k||(H|=E[S+1]<<8-k,y<16-k)||(H|=E[S+2]<<16-k,y<24-k)||(H|=E[S+3]<<24-k),H&b}function Vt(E,T,y){var k=T&7,S=T>>>3;return k<=5?E[S]|=(y&7)<<k:(E[S]|=y<<k&255,E[S+1]=(y&7)>>8-k),T+3}function lr(E,T,y){var k=T&7,S=T>>>3;return y=(y&1)<<k,E[S]|=y,T+1}function vr(E,T,y){var k=T&7,S=T>>>3;return y<<=k,E[S]|=y&255,y>>>=8,E[S+1]=y,T+8}function Da(E,T,y){var k=T&7,S=T>>>3;return y<<=k,E[S]|=y&255,y>>>=8,E[S+1]=y&255,E[S+2]=y>>>8,T+16}function Ir(E,T){var y=E.length,k=2*y>T?2*y:T+5,S=0;if(y>=T)return E;if(_e){var b=so(k);if(E.copy)E.copy(b);else for(;S<E.length;++S)b[S]=E[S];return b}else if(Q){var H=new Uint8Array(k);if(H.set)H.set(E);else for(;S<y;++S)H[S]=E[S];return H}return E.length=k,E}function Mt(E){for(var T=new Array(E),y=0;y<E;++y)T[y]=0;return T}function wr(E,T,y){var k=1,S=0,b=0,H=0,j=0,V=E.length,U=Q?new Uint16Array(32):Mt(32);for(b=0;b<32;++b)U[b]=0;for(b=V;b<y;++b)E[b]=0;V=E.length;var G=Q?new Uint16Array(V):Mt(V);for(b=0;b<V;++b)U[S=E[b]]++,k<S&&(k=S),G[b]=0;for(U[0]=0,b=1;b<=k;++b)U[b+16]=j=j+U[b-1]<<1;for(b=0;b<V;++b)j=E[b],j!=0&&(G[b]=U[j+16]++);var Z=0;for(b=0;b<V;++b)if(Z=E[b],Z!=0)for(j=A(G[b],k)>>k-Z,H=(1<<k+4-Z)-1;H>=0;--H)T[j|H<<Z]=Z&15|b<<4;return k}var Nr=Q?new Uint16Array(512):Mt(512),Ra=Q?new Uint16Array(32):Mt(32);if(!Q){for(var Tt=0;Tt<512;++Tt)Nr[Tt]=0;for(Tt=0;Tt<32;++Tt)Ra[Tt]=0}(function(){for(var E=[],T=0;T<32;T++)E.push(5);wr(E,Ra,32);var y=[];for(T=0;T<=143;T++)y.push(8);for(;T<=255;T++)y.push(9);for(;T<=279;T++)y.push(7);for(;T<=287;T++)y.push(8);wr(y,Nr,288)})();var cr=function(){for(var T=Q?new Uint8Array(32768):[],y=0,k=0;y<te.length-1;++y)for(;k<te[y+1];++k)T[k]=y;for(;k<32768;++k)T[k]=29;var S=Q?new Uint8Array(259):[];for(y=0,k=0;y<K.length-1;++y)for(;k<K[y+1];++k)S[k]=y;function b(j,V){for(var U=0;U<j.length;){var G=Math.min(65535,j.length-U),Z=U+G==j.length;for(V.write_shift(1,+Z),V.write_shift(2,G),V.write_shift(2,~G&65535);G-- >0;)V[V.l++]=j[U++]}return V.l}function H(j,V){for(var U=0,G=0,Z=Q?new Uint16Array(32768):[];G<j.length;){var se=Math.min(65535,j.length-G);if(se<10){for(U=Vt(V,U,+(G+se==j.length)),U&7&&(U+=8-(U&7)),V.l=U/8|0,V.write_shift(2,se),V.write_shift(2,~se&65535);se-- >0;)V[V.l++]=j[G++];U=V.l*8;continue}U=Vt(V,U,+(G+se==j.length)+2);for(var ue=0;se-- >0;){var ee=j[G];ue=(ue<<5^ee)&32767;var he=-1,Ee=0;if((he=Z[ue])&&(he|=G&-32768,he>G&&(he-=32768),he<G))for(;j[he+Ee]==j[G+Ee]&&Ee<250;)++Ee;if(Ee>2){ee=S[Ee],ee<=22?U=vr(V,U,J[ee+1]>>1)-1:(vr(V,U,3),U+=5,vr(V,U,J[ee-23]>>5),U+=3);var Ge=ee<8?0:ee-4>>2;Ge>0&&(Da(V,U,Ee-K[ee]),U+=Ge),ee=T[G-he],U=vr(V,U,J[ee]>>3),U-=3;var ze=ee<4?0:ee-2>>1;ze>0&&(Da(V,U,G-he-te[ee]),U+=ze);for(var gt=0;gt<Ee;++gt)Z[ue]=G&32767,ue=(ue<<5^j[G])&32767,++G;se-=Ee-1}else ee<=143?ee=ee+48:U=lr(V,U,1),U=vr(V,U,J[ee]),Z[ue]=G&32767,++G}U=vr(V,U,0)-1}return V.l=(U+7)/8|0,V.l}return function(V,U){return V.length<8?b(V,U):H(V,U)}}();function Te(E){var T=X(50+Math.floor(E.length*1.1)),y=cr(E,T);return T.slice(0,y)}var Ze=Q?new Uint16Array(32768):Mt(32768),Ht=Q?new Uint16Array(32768):Mt(32768),it=Q?new Uint16Array(128):Mt(128),Wr=1,qs=1;function Gc(E,T){var y=be(E,T)+257;T+=5;var k=be(E,T)+1;T+=5;var S=Ve(E,T)+4;T+=4;for(var b=0,H=Q?new Uint8Array(19):Mt(19),j=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],V=1,U=Q?new Uint8Array(8):Mt(8),G=Q?new Uint8Array(8):Mt(8),Z=H.length,se=0;se<S;++se)H[P[se]]=b=Ae(E,T),V<b&&(V=b),U[b]++,T+=3;var ue=0;for(U[0]=0,se=1;se<=V;++se)G[se]=ue=ue+U[se-1]<<1;for(se=0;se<Z;++se)(ue=H[se])!=0&&(j[se]=G[ue]++);var ee=0;for(se=0;se<Z;++se)if(ee=H[se],ee!=0){ue=J[j[se]]>>8-ee;for(var he=(1<<7-ee)-1;he>=0;--he)it[ue|he<<ee]=ee&7|se<<3}var Ee=[];for(V=1;Ee.length<y+k;)switch(ue=it[ce(E,T)],T+=ue&7,ue>>>=3){case 16:for(b=3+He(E,T),T+=2,ue=Ee[Ee.length-1];b-- >0;)Ee.push(ue);break;case 17:for(b=3+Ae(E,T),T+=3;b-- >0;)Ee.push(0);break;case 18:for(b=11+ce(E,T),T+=7;b-- >0;)Ee.push(0);break;default:Ee.push(ue),V<ue&&(V=ue);break}var Ge=Ee.slice(0,y),ze=Ee.slice(y);for(se=y;se<286;++se)Ge[se]=0;for(se=k;se<30;++se)ze[se]=0;return Wr=wr(Ge,Ze,286),qs=wr(ze,Ht,30),T}function zc(E,T){if(E[0]==3&&!(E[1]&3))return[Dr(T),2];for(var y=0,k=0,S=so(T||1<<18),b=0,H=S.length>>>0,j=0,V=0;!(k&1);){if(k=Ae(E,y),y+=3,k>>>1)k>>1==1?(j=9,V=5):(y=Gc(E,y),j=Wr,V=qs);else{y&7&&(y+=8-(y&7));var U=E[y>>>3]|E[(y>>>3)+1]<<8;if(y+=32,U>0)for(!T&&H<b+U&&(S=Ir(S,b+U),H=S.length);U-- >0;)S[b++]=E[y>>>3],y+=8;continue}for(;;){!T&&H<b+32767&&(S=Ir(S,b+32767),H=S.length);var G=Je(E,y,j),Z=k>>>1==1?Nr[G]:Ze[G];if(y+=Z&15,Z>>>=4,!(Z>>>8&255))S[b++]=Z;else{if(Z==256)break;Z-=257;var se=Z<8?0:Z-4>>2;se>5&&(se=0);var ue=b+K[Z];se>0&&(ue+=Je(E,y,se),y+=se),G=Je(E,y,V),Z=k>>>1==1?Ra[G]:Ht[G],y+=Z&15,Z>>>=4;var ee=Z<4?0:Z-2>>1,he=te[Z];for(ee>0&&(he+=Je(E,y,ee),y+=ee),!T&&H<ue&&(S=Ir(S,ue+100),H=S.length);b<ue;)S[b]=S[b-he],++b}}}return T?[S,y+7>>>3]:[S.slice(0,b),y+7>>>3]}function Js(E,T){var y=E.slice(E.l||0),k=zc(y,T);return E.l+=k[1],k[0]}function Zs(E,T){if(E)typeof console<"u"&&console.error(T);else throw new Error(T)}function Qs(E,T){var y=E;dt(y,0);var k=[],S=[],b={FileIndex:k,FullPaths:S};C(b,{root:T.root});for(var H=y.length-4;(y[H]!=80||y[H+1]!=75||y[H+2]!=5||y[H+3]!=6)&&H>=0;)--H;y.l=H+4,y.l+=4;var j=y.read_shift(2);y.l+=6;var V=y.read_shift(4);for(y.l=V,H=0;H<j;++H){y.l+=20;var U=y.read_shift(4),G=y.read_shift(4),Z=y.read_shift(2),se=y.read_shift(2),ue=y.read_shift(2);y.l+=8;var ee=y.read_shift(4),he=o(y.slice(y.l+Z,y.l+Z+se));y.l+=Z+se+ue;var Ee=y.l;y.l=ee+4,Xc(y,U,G,b,he),y.l=Ee}return b}function Xc(E,T,y,k,S){E.l+=2;var b=E.read_shift(2),H=E.read_shift(2),j=s(E);if(b&8257)throw new Error("Unsupported ZIP encryption");for(var V=E.read_shift(4),U=E.read_shift(4),G=E.read_shift(4),Z=E.read_shift(2),se=E.read_shift(2),ue="",ee=0;ee<Z;++ee)ue+=String.fromCharCode(E[E.l++]);if(se){var he=o(E.slice(E.l,E.l+se));(he[21589]||{}).mt&&(j=he[21589].mt),((S||{})[21589]||{}).mt&&(j=S[21589].mt)}E.l+=se;var Ee=E.slice(E.l,E.l+U);switch(H){case 8:Ee=R(E,G);break;case 0:break;default:throw new Error("Unsupported ZIP Compression method "+H)}var Ge=!1;b&8&&(V=E.read_shift(4),V==134695760&&(V=E.read_shift(4),Ge=!0),U=E.read_shift(4),G=E.read_shift(4)),U!=T&&Zs(Ge,"Bad compressed size: "+T+" != "+U),G!=y&&Zs(Ge,"Bad uncompressed size: "+y+" != "+G),wi(k,ue,Ee,{unsafe:!0,mt:j})}function jc(E,T){var y=T||{},k=[],S=[],b=X(1),H=y.compression?8:0,j=0,V=0,U=0,G=0,Z=0,se=E.FullPaths[0],ue=se,ee=E.FileIndex[0],he=[],Ee=0;for(V=1;V<E.FullPaths.length;++V)if(ue=E.FullPaths[V].slice(se.length),ee=E.FileIndex[V],!(!ee.size||!ee.content||ue=="Sh33tJ5")){var Ge=G,ze=X(ue.length);for(U=0;U<ue.length;++U)ze.write_shift(1,ue.charCodeAt(U)&127);ze=ze.slice(0,ze.l),he[Z]=eh.buf(ee.content,0);var gt=ee.content;H==8&&(gt=O(gt)),b=X(30),b.write_shift(4,67324752),b.write_shift(2,20),b.write_shift(2,j),b.write_shift(2,H),ee.mt?i(b,ee.mt):b.write_shift(4,0),b.write_shift(-4,he[Z]),b.write_shift(4,gt.length),b.write_shift(4,ee.content.length),b.write_shift(2,ze.length),b.write_shift(2,0),G+=b.length,k.push(b),G+=ze.length,k.push(ze),G+=gt.length,k.push(gt),b=X(46),b.write_shift(4,33639248),b.write_shift(2,0),b.write_shift(2,20),b.write_shift(2,j),b.write_shift(2,H),b.write_shift(4,0),b.write_shift(-4,he[Z]),b.write_shift(4,gt.length),b.write_shift(4,ee.content.length),b.write_shift(2,ze.length),b.write_shift(2,0),b.write_shift(2,0),b.write_shift(2,0),b.write_shift(2,0),b.write_shift(4,0),b.write_shift(4,Ge),Ee+=b.l,S.push(b),Ee+=ze.length,S.push(ze),++Z}return b=X(22),b.write_shift(4,101010256),b.write_shift(2,0),b.write_shift(2,0),b.write_shift(2,Z),b.write_shift(2,Z),b.write_shift(4,Ee),b.write_shift(4,G),b.write_shift(2,0),ft([ft(k),ft(S),b])}var Sn={htm:"text/html",xml:"text/xml",gif:"image/gif",jpg:"image/jpeg",png:"image/png",mso:"application/x-mso",thmx:"application/vnd.ms-officetheme",sh33tj5:"application/octet-stream"};function Kc(E,T){if(E.ctype)return E.ctype;var y=E.name||"",k=y.match(/\.([^\.]+)$/);return k&&Sn[k[1]]||T&&(k=(y=T).match(/[\.\\]([^\.\\])+$/),k&&Sn[k[1]])?Sn[k[1]]:"application/octet-stream"}function Yc(E){for(var T=an(E),y=[],k=0;k<T.length;k+=76)y.push(T.slice(k,k+76));return y.join(`\r
29
29
  `)+`\r
30
30
  `}function qc(E){var T=E.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7E-\xFF=]/g,function(U){var G=U.charCodeAt(0).toString(16).toUpperCase();return"="+(G.length==1?"0"+G:G)});T=T.replace(/ $/mg,"=20").replace(/\t$/mg,"=09"),T.charAt(0)==`
31
31
  `&&(T="=0D"+T.slice(1)),T=T.replace(/\r(?!\n)/mg,"=0D").replace(/\n\n/mg,`
@@ -1238,7 +1238,7 @@ const Zt = class Zt extends Le {
1238
1238
  this.closePopover();
1239
1239
  }
1240
1240
  }
1241
- }, this.detectChange = e.detectChange, this.onColorChange = e.onColorChange, this.variant = e.variant ?? "default", this.originalDefault = e.default, this.value = this.defaultValue(), this.setLinkedGlobalVariableFrom(this.originalDefault ?? this.value);
1241
+ }, this.detectChange = e.detectChange, this.onColorChange = e.onColorChange, this.variant = e.variant ?? "default", this.hideGlobalsTab = e.hideGlobalsTab, this.originalDefault = e.default, this.value = this.defaultValue(), this.setLinkedGlobalVariableFrom(this.originalDefault ?? this.value);
1242
1242
  }
1243
1243
  resolveGlobalVarColor(e) {
1244
1244
  if (e && e.startsWith("var(--")) {
@@ -1391,15 +1391,15 @@ const Zt = class Zt extends Le {
1391
1391
  const e = document.createElement("div");
1392
1392
  e.className = "gradient-popover-header", e.style.cursor = "move";
1393
1393
  let r = null;
1394
- if (this.variant !== "global") {
1394
+ if (this.hideGlobalsTab) {
1395
+ const l = document.createElement("div");
1396
+ e.appendChild(l);
1397
+ } else {
1395
1398
  r = document.createElement("div"), r.className = "color-setting-tabs header-tabs";
1396
1399
  const l = document.createElement("button");
1397
1400
  l.className = "color-tab active", l.textContent = "Custom";
1398
1401
  const c = document.createElement("button");
1399
1402
  c.className = "color-tab", c.textContent = "Global", r.appendChild(l), r.appendChild(c), e.appendChild(r);
1400
- } else {
1401
- const l = document.createElement("div");
1402
- e.appendChild(l);
1403
1403
  }
1404
1404
  const a = document.createElement("button");
1405
1405
  a.type = "button", a.className = "gradient-popover-close", a.innerHTML = y0, a.addEventListener("click", () => this.closePopover()), e.appendChild(a), rs(e, this.popoverEl, (l, c) => {
@@ -1943,7 +1943,6 @@ const Zt = class Zt extends Le {
1943
1943
  triggerChange() {
1944
1944
  var r;
1945
1945
  const e = this.getChangePayload();
1946
- debugger;
1947
1946
  (r = this.onColorChange) == null || r.call(this, this.getValue()), e !== void 0 && (this.changeDebounceTimeout && clearTimeout(this.changeDebounceTimeout), this.changeDebounceTimeout = setTimeout(() => {
1948
1947
  var a, n;
1949
1948
  (a = this.onChange) == null || a.call(this, e), (n = this.detectChange) == null || n.call(this, e), this.changeDebounceTimeout = null;
@@ -31,6 +31,7 @@ export declare class GradientSetting extends Setting<GradientValue, SettingProps
31
31
  private currentMode;
32
32
  private linkedGlobalVariable;
33
33
  private unlinkButton;
34
+ private hideGlobalsTab;
34
35
  constructor(props?: GradientSettingProps);
35
36
  private originalDefault;
36
37
  private resolveGlobalVarColor;
@@ -24,4 +24,5 @@ export interface GradientSettingProps {
24
24
  id?: string;
25
25
  includeGetJson?: boolean;
26
26
  variant?: "default" | "global";
27
+ hideGlobalsTab?: boolean;
27
28
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "builder-settings-types",
3
3
  "description": "builder settings",
4
- "version": "0.0.433",
4
+ "version": "0.0.435",
5
5
  "type": "module",
6
6
  "main": "dist/builder-settings-types.cjs.js",
7
7
  "module": "dist/builder-settings-types.es.js",